diff --git a/tests/.gitignore b/tests/.gitignore new file mode 100644 index 0000000000..65931ac665 --- /dev/null +++ b/tests/.gitignore @@ -0,0 +1,15 @@ +*~ +aclocal.m4 +install-sh +autom4te.cache/ +missing +configure +Makefile.in +config.log +config.status +config.guess +config.sub +depcomp +Makefile +.deps/ + diff --git a/tests/Makefile.am b/tests/Makefile.am new file mode 100644 index 0000000000..aa12b7aa46 --- /dev/null +++ b/tests/Makefile.am @@ -0,0 +1,186 @@ +AUTOMAKE_OPTIONS = foreign +ACLOCAL_AMFLAGS = -I m4 +AM_MAKEFLAGS = --no-print-directory +SUBDIRS = +TESTS = + +# Tests are broken up into those which require elevetated credentials +# versus those that run in normal userspace + +if ROOT_ENABLED + +if BOS_ENABLED + SUBDIRS += bos +endif +if OOB_ENABLED + SUBDIRS += oob +endif +if CLCK_ENABLED + SUBDIRS += clck +endif + +if LUSTRE_ENABLED + SUBDIRS += lustre +endif + +else # non root tests + +if MODULES_ENABLED + SUBDIRS += modules +endif + +if USERENV_ENABLED + SUBDIRS += user-env +endif + + + +if ITAC_ENABLED + SUBDIRS += perf-tools/intel-itac +endif + +if ADVISOR_ENABLED + SUBDIRS += perf-tools/intel-advisor +endif + +#---------------------------------------------------------------------- +# run OHPC wrapper tests for embeded autotools project (e.g. those that +# have compiler and/or mpi dependencies) +#---------------------------------------------------------------------- + +if RMS_HARNESS_ENABLED + TESTS += rms-harness/ohpc-tests/test_mpi_families +endif + +if APPS_ENABLED + TESTS += apps/miniFE/ohpc-tests/test_miniFE + TESTS += apps/miniDFT/ohpc-tests/test_miniDFT + TESTS += apps/hpcg/run + TESTS += apps/prk/ohpc-tests/test_PRK +endif + +if COMPILERS_ENABLED + TESTS += compilers/ohpc-tests/test_compiler_families +endif + +if VALGRIND_ENABLED + TESTS += dev-tools/valgrind/ohpc-tests/test_compiler_families +endif + +if R_ENABLED + TESTS += dev-tools/R-base/ohpc-tests/test_compiler_families +endif + +if MPIP_ENABLED + TESTS += perf-tools/mpiP/ohpc-tests/test_mpiP +endif + +if VTUNE_ENABLED + TESTS += perf-tools/intel-vtune/ohpc-tests/test_mpi_families +endif + +if FFTW_ENABLED + TESTS += libs/fftw/ohpc-tests/test_mpi_families +endif + +if ADIOS_ENABLED + TESTS += libs/adios/ohpc-tests/test_mpi_families +endif + +if BOOST_ENABLED + TESTS += libs/boost/ohpc-tests/test_mpi_families +endif + +if BOOST_MPI_ENABLED + TESTS += libs/boost-mpi/ohpc-tests/test_mpi_families +endif + +if GSL_ENABLED + TESTS += libs/gsl/ohpc-tests/test_gsl +endif + +if IMB_ENABLED + TESTS += libs/imb/ohpc-tests/test_imb +endif + +if HDF5_ENABLED + TESTS += libs/hdf5/ohpc-tests/test_hdf5 +endif + +if PHDF5_ENABLED + TESTS += libs/phdf5/ohpc-tests/test_mpi_families +endif + +if HYPRE_ENABLED + TESTS += libs/hypre/ohpc-tests/test_hypre +endif + +if INSPECTOR_ENABLED + TESTS += dev-tools/intel-inspector/ohpc-tests/test_inspector +endif + +if METIS_ENABLED + TESTS += libs/metis/ohpc-tests/test_compiler_families +endif + +if MUMPS_ENABLED + TESTS += libs/mumps/ohpc-tests/test_mumps +endif + +if NETCDF_ENABLED + TESTS += libs/netcdf/ohpc-tests/test_mpi_families +endif + +if OPENBLAS_ENABLED + TESTS += libs/openblas/ohpc-tests/test_openblas +endif + +if OOM_ENABLED + TESTS += user-env-oom/ohpc-tests/test_compiler_families +endif + +if PAPI_ENABLED + TESTS += perf-tools/papi/ohpc-tests/test_compiler_families +endif + +if PETSC_ENABLED + TESTS += libs/petsc/ohpc-tests/test_petsc +endif + +if MPI_ENABLED + TESTS += mpi/ohpc-tests/test_mpi_families +endif + +if NUMPY_ENABLED + TESTS += dev-tools/numpy/ohpc-tests/test_numpy +endif + +if SCALAPACK_ENABLED + TESTS += libs/scalapack/ohpc-tests/test_scalapack +endif + +if SCIPY_ENABLED + TESTS += dev-tools/scipy/ohpc-tests/test_scipy +endif + +if SUPERLU_DIST_ENABLED + TESTS += libs/superlu_dist/ohpc-tests/test_superlu_dist +endif + +if TAU_ENABLED + TESTS += perf-tools/tau/ohpc-tests/test_tau +endif + +if TBB_ENABLED + TESTS += dev-tools/tbb/ohpc-tests/test_tbb +endif + +if CILK_ENABLED + TESTS += dev-tools/cilk/ohpc-tests/test_cilk +endif + +if TRILINOS_ENABLED + TESTS += libs/trilinos/ohpc-tests/test_trilinos +endif + +endif diff --git a/tests/TEST_ENV b/tests/TEST_ENV new file mode 120000 index 0000000000..925b9ff6cc --- /dev/null +++ b/tests/TEST_ENV @@ -0,0 +1 @@ +common/TEST_ENV \ No newline at end of file diff --git a/tests/apps/.gitignore b/tests/apps/.gitignore new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/tests/apps/.gitignore @@ -0,0 +1 @@ + diff --git a/tests/apps/hpcg/.gitignore b/tests/apps/hpcg/.gitignore new file mode 100644 index 0000000000..f75e1b89ca --- /dev/null +++ b/tests/apps/hpcg/.gitignore @@ -0,0 +1,12 @@ +*~ +*.o +*.yaml +hpcg_log_*.txt +log.HPCG +xhpcg +xhpcg.* +family-*/ +compile +test-driver +test-suite.log.orig +job.*.out diff --git a/tests/apps/hpcg/BUGS b/tests/apps/hpcg/BUGS new file mode 100644 index 0000000000..fcd8ddb9de --- /dev/null +++ b/tests/apps/hpcg/BUGS @@ -0,0 +1,10 @@ +============================================================== + List of the known problems with the HPCG software + + Current as of release HPCG - 2.4 - June 3, 2014 +============================================================== +- No known bugs + +============================================================== + +============================================================== diff --git a/tests/apps/hpcg/COPYRIGHT b/tests/apps/hpcg/COPYRIGHT new file mode 100644 index 0000000000..c22eff5d20 --- /dev/null +++ b/tests/apps/hpcg/COPYRIGHT @@ -0,0 +1,46 @@ +====================================================================== + -- High Performance Conjugate Gradient Benchmark (HPCG) + HPCG - 2.4 - June 3, 2014 + + Michael A. Heroux + Scalable Algorithms Group, Computing Research Center + Sandia National Laboratories, Albuquerque, NM + + Piotr Luszczek + Jack Dongarra + University of Tennessee, Knoxville + Innovative Computing Laboratory + (C) Copyright 2013 All Rights Reserved + + -- Copyright notice and Licensing terms: + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions, and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + 3. The name of the University, the name of the Laboratory, or the + names of its contributors may not be used to endorse or promote + products derived from this software without specific written + permission. + + -- Disclaimer: + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY + OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +====================================================================== diff --git a/tests/apps/hpcg/HISTORY b/tests/apps/hpcg/HISTORY new file mode 100644 index 0000000000..46bd94aab9 --- /dev/null +++ b/tests/apps/hpcg/HISTORY @@ -0,0 +1,176 @@ +#################################################### +High Performance Conjugate Gradient Benchmark (HPCG) +#################################################### + +:Author: Jack Dongarra and Michael Heroux and Piotr Luszczek +:Revision: 2.4 +:Date: June 3, 2014 + +=============== +History of HPCG +=============== + +----------- +Version 2.4 +----------- + +* Fixed (again) the FLOP count for DDOT and WAXPBY. We forgot that the + preamble is called many times. + +----------- +Version 2.3 +----------- + +* Fixed the FLOP count for DDOT and WAXPBY. The operations in the preamble were + not being accounted for. + +----------- +Version 2.2 +----------- + +* Reduced the penalty for optimization overhead by a factor of 10 (amortized over 10 + sets of 50 reference iterations. +* Fixed a bug that did not account for increased iterations that can occur with + multicoloring reorderings. +* Fixed numerous other small bugs reported by HPCG users. + +----------- +Version 2.1 +----------- + +* Fixed a small but important bug in ComputeProlongation_ref.cpp (- sign should be + sign). + +----------- +Version 2.0 +----------- + +* Added support for a synthetic multigrid V cycle. Parameters include + the number of levels in the the grid hierarchy, number of pre and + post smoother steps. +* Refactored data classes to support needs for recursion in V cycle. +* Made simple modifications to make compilation on MS Windows easier. + This includes changing the format of output files to remove colons. + +----------- +Version 1.1 +----------- + +* Added a simple code for users remove in order to indicate whether +optimization was done for dot-product, SPMV, SYMGS, or WAXPBY. +* Fixed a problem with computing the variance of results from multiple runs. + +----------- +Version 1.0 +----------- + +* Changed the diagonal entry from 27 to 26 to influence convergence rate. +* Changed license file (COPYRIGHT) from 4-clause BSD (original BSD) to 3-clause +BSD (modified BSD) +* Added a line to the input file (hpcg.dat) that allows to specify time to run +the benchmark. + +----------- +Version 0.5 +----------- + +* Improved the formula used for scaling of departure of symmetry + +----------- +Version 0.4 +----------- + +* Fixed bugs in integer computations where intermediate 32-bit + integer computations resulted in values that exceeded the + 32-bit range and gave incorrect results. +* Fixed the computation of the number of CG set runs to take + into account varying timing results across MPI processes. + +----------- +Version 0.3 +----------- + +* Given out to friendly testers. +* Includes Doxygen output. +* Numerous small changes. +* Substantially improved output. +* Tested on large systems. + +----------- +Version 0.2 +----------- +* Given out to "friends". +* Numerous small changes. + + +----------- +Version 0.1 +----------- + +* Added local symmetric Gauss-Seidel preconditioning. +* Changed global geometry to be true 3D. Previously was a beam (subdomains + were stacked only in the z dimension). +* Introduced three global/local index modes: 32/32, 64/32, 64/64 to handle all + problem sizes. +* Changed execution strategy to perform multiple runs with just a few + iterations per run. +* Added infrastructure and rules for user adaptation of kernels for performance + optimization. +* Added benchmark modification and reporting rules. +* Changed directory and file layout to mimic HPL layouts where appropriate. + +================ +History of HPCCG +================ + +-------------------------- +NAME CHANGE: HPCCG to HPCG +-------------------------- + +* The name was changed from HPCCG to HPCG without any code changes. + +----------- +Version 1.0 +----------- + +* Released as part of Mantevo Suite 1.0, December 2012. + +----------- +Version 0.5 +----------- + +* Added timing for Allreduce calls in MPI mode, printing min/max/avg times. +* Set the solver tolerance to zero to make all solves take ``max_iter`` + iterations. +* Changed accumulator to a local variable for ``ddot``. It seems to help + dual-core performance. + +----------- +Version 0.4 +----------- + +- Made total_nnz a "long long" so that MFLOP numbers were valid + when the nonzero count is more than 2^31. + +----------- +Version 0.3 +----------- + +* Fixed a performance bug in ``make_local_matrix.cpp`` that was very noticeable + when the fraction of off-processor grid points was large. + +----------- +Version 0.2 +----------- + +* Fixed bugs related to turning MPI compilation off. +* Added more text to README to improve understanding. +* Added new ``Makfile.x86linux.gcc`` for non-opteron systems. +* Made ``MPI_Wtime`` the default timer when in MPI mode. + +----------- +Version 0.1 +----------- + +HPCCG (Original version) was written as a teaching code for illustrating the +anatomy of a distributed memory parallel sparse iterative solver for new +research students and junior staff members. March 2000. diff --git a/tests/apps/hpcg/INSTALL b/tests/apps/hpcg/INSTALL new file mode 100644 index 0000000000..996b67d8b9 --- /dev/null +++ b/tests/apps/hpcg/INSTALL @@ -0,0 +1,186 @@ +#################################################### +High Performance Conjugate Gradient Benchmark (HPCG) +#################################################### + +:Author: Jack Dongarra and Michael Heroux and Piotr Luszczek +:Revision: 2.4 +:Date: June 3, 2014 + +=================== +Download and Unpack +=================== + +Retrieve the tar-gzip file, then uncompress it with:: + + gunzip hpcg.tar.gz; tar -xvf hpcg.tar + +this will create an ``hpcg`` directory, that we call the top-level directory +in the text below. + +============= +Configuration +============= + +HPCG uses a make-compatible file for configuring the compilers, linkers, and +their command line flags. + +Create a file ``Make.`` in the ``setup`` directory right under the +top-level directory. Suffix ```` should be a name that you choose for +your system. To make the process easier, you may want to re-use one of the +example files contained already in the ``setup`` directory. The +``Make.`` file contains the command names of the compilers and linkers +together with their options for using special directories and linking with +libraries as well as their paths that are to be used for building the binary. + +The most important variables that need to be set in ``Make.`` are: + +* ``MPdir`` specifies the path to where the MPI installation resides. For some + MPI implementations, using the MPI-enabled compiler (such as ``mpicxx``) is + sufficient and it is not required specified any MPI installation paths. This + variable can be used to setup the ``MPinc`` and ``MPlib`` variables. + +* ``MPinc`` specifies the path to include directories with MPI header files. A + common setting here would be ``MPinc = $(MPdir)/include``, provided that the + ``MPdir`` variable was set properly. + +* ``MPlib`` specifies the path to directories with MPI library files. A common + setting here would be ``MPlib = $(MPdir)/lib``, provided that the ``MPdir`` + variable was set properly. + +* ``HPCG_OPTS`` specifies additional compiler options for compiling the HPCG + source files. These options might include optimization, debugging, or tuning + flags. + +* ``CXX`` specifies the name of the C++ compiler for compiling the code. It + should be a C++ that supports a subset of STL that is used in HPCG as well as + the subset of constructs used in the MPI standard. + +* ``CXXFLAGS`` specifies the flags to be used when invoking the C++ compiler. + These might include optimization and profiling options. + +* ``LINKER`` specifies the linker capable of linking C++ programs that include + MPI calls. + +* ``LINKERFLAGS`` specifies the flags passed to the linker that might indicate + directories where to look for standard C++ and MPI libraries. + +HPCG supports in-source and out-of-source builds. In the case of the former, +the object files and the binary reside in the same directory structure as the +source files. There is no need for a seperate configuation step and the reader +may skip the the Build section. + +In the latter case, a seperate directory is created to hold the object and +binary executable files. For example, create a custom directory, ``build`` in +this example, for the results of compilation and linking:: + + mkdir build + +Next, go this new directory and use the ``configure`` script to create the +build infrastructure: + + cd build + /path/to/hpcg/configure /path/to/setup/file + +Notice that you have to give a absolute or relative path to the ``configure`` +shell script so that the location of the source files can be discovered +automatically. Sample setup files are found in the hpcg/setup directory. + +===== +Build +===== + +For the in-source builds, while in the top-level directory, simply type:: + + make path/to/setup/file + +For the out-of-source builds, go to the ``build`` directory and type ``make``. + +In both cases, the executable called ``xhpcg`` should be created in the ``bin`` +directory. + +============= +Example Build +============= + +As an example, let's use a Linux cluster and create a file called +``Make.Linux`` in the ``setup`` directory right under the top-level directory. + +For in-source build, we type ``make setup/Make.Linux`` which creates the executable +file called ``bin/xhpcg``. + +For out-of-source build, we create the build directory called ``build_Linux`` +and go to that direcotry:: + + mkdir build_Linux + cd build_Linux + +Then, while in the ``build_Linux`` directory we type:: + + /path/to/hpcg/configure ../setup/Make.Linux + make + +This creates the executable file ``bin/xhpcg``. + +==== +Test +==== + +For a quick check, go to the ``bin`` directory and run the HPCG executable as +follows:: + + mpirun -np 8 xhpcg + +Note that this will use the default ``hpcg.dat`` file. If you'd like to change +the size of local dimensions of the problem to NX=32, NY=24, NZ=16 then run the +following:: + + mpirun -np 8 xhpcg 32 24 16 + +====== +Tuning +====== + +Most of the performance parameters can be tuned by modifying the input file +``hpcg.dat``. See the file ``TUNING`` in the top-level directory. + + +==================== +Compile Time Options +==================== + +At the end of the "model" ``Make.``, the user is given the opportunity to +compile the software with some specific compile options. The list of this +options and their meaning are: + +* Compile with modest debugging turned on:: + + -DHPCG_DEBUG + +* Compile with voluminous debugging information turned on:: + + -DHPCG_DETAILED_DEBUG + +* Compile without MPI enabled:: + + -DHPCG_NOMPI + +* Compile without OpenMP enabled:: + + -DHPCG_NOOPENMP + +* Enable detail timers:: + + -DHPCG_DETAILED_TIMING + + +By default HPCG will: + +* Turn on MPI support. +* Turn on OpenMP support. +* not display detailed timing information. + +=================== +Further information +=================== + +Check out the website http://software.sandia.gov/hpcg for the latest information. diff --git a/tests/apps/hpcg/LOCAL_ENV b/tests/apps/hpcg/LOCAL_ENV new file mode 100644 index 0000000000..667d550e33 --- /dev/null +++ b/tests/apps/hpcg/LOCAL_ENV @@ -0,0 +1,9 @@ +TEST_DIR=$(pwd | sed "s#$(cd $(readlink common); cd ..; pwd)##") + +CMD_TIMEOUT="5:00" +TEST_EXE="./bin/xhpcg" +TEST_MAX_COMPUTES=1024 +TEST_NUM_RANKS=8 +TEST_NUM_THREADS=4 +TEST_VERIFY=1 +TEST_PERFLOG=./log.HPCG diff --git a/tests/apps/hpcg/Makefile.ohpc b/tests/apps/hpcg/Makefile.ohpc new file mode 100644 index 0000000000..b3b7ac4d0b --- /dev/null +++ b/tests/apps/hpcg/Makefile.ohpc @@ -0,0 +1,24 @@ +# -*- Makefile -*- + +# by default, "arch" is unknown, should be specified in the command line +arch = intel + +setup_file = setup/Make.ohpc +include $(setup_file) + +HPCG_DEPS = src/CG.o src/CG_ref.o src/TestCG.o src/ComputeResidual.o \ + src/ExchangeHalo.o src/GenerateGeometry.o src/GenerateProblem.o \ + src/OptimizeProblem.o src/ReadHpcgDat.o src/ReportResults.o \ + src/SetupHalo.o src/TestSymmetry.o src/TestNorms.o src/WriteProblem.o \ + src/YAML_Doc.o src/YAML_Element.o src/ComputeDotProduct.o \ + src/ComputeDotProduct_ref.o src/finalize.o src/init.o src/mytimer.o src/ComputeSPMV.o \ + src/ComputeSPMV_ref.o src/ComputeSYMGS.o src/ComputeSYMGS_ref.o src/ComputeWAXPBY.o src/ComputeWAXPBY_ref.o \ + src/ComputeMG_ref.o src/ComputeMG.o src/ComputeProlongation_ref.o src/ComputeRestriction_ref.o src/GenerateCoarseProblem.o + +bin/xhpcg: testing/main.o $(HPCG_DEPS) + $(LINKER) $(LINKFLAGS) testing/main.o $(HPCG_DEPS) -o bin/xhpcg $(HPCG_LIBS) + +clean: + rm -f $(HPCG_DEPS) bin/xhpcg testing/main.o + +.PHONY: clean diff --git a/tests/apps/hpcg/QUICKSTART b/tests/apps/hpcg/QUICKSTART new file mode 100644 index 0000000000..b27393990a --- /dev/null +++ b/tests/apps/hpcg/QUICKSTART @@ -0,0 +1,52 @@ +NOTE: The instructions in this file assume you are working with a version + of the software from the HPCG repository, or have already unpacked + the hpcg distribution tar file. We assume you are in the main hpcg + directory. + +1) Review the collection of setup files in hpcg/setup. Determine which of + these files is usable for your system, or create a new file of your own + with appropriate parameters, starting from an existing file if you like. + Note the suffix of the file Make.suffix (e.g., Make.MPI_GCC_OpenMP has the + suffix MPI_GCC_OpenMP). + + Example commands: + ls setup + cp setup/Make.MPI_GCC_OMP setup/Make.My_MPI_OMP + vi setup/Make.My_MPI_OMP + +2) Create a build directory under the main hpcg directory (or somewhere else on + your system). Give the directory a meaningful name such as MPI_GCC_OpenMP. + + Example command: + mkdir My_MPI_OMP_BUILD + +3) 'cd' to your build directory, and run the configure command located in the + main hpcg directory, defining the path and file argument to be the location + of the setup file defined in step 1. Then run 'make'. + + Example commands: + cd My_MPI_OMP_BUILD + ../configure ../setup/Make.My_MPI_OMP + make + +4) If make is successful, you will have a bin directory containing the files + hpcg.dat and xhpcg. 'cd' to the bin directory and run the benchmark. + + Example commands: + cd bin + export OMP_NUM_THREADS 4 + mpiexec -np 64 ./xhpcg + +5) The benchmark has completed execution. This should take a few minutes + when running in evaluation mode, and take more than 5 hours in official + benchmark mode. When the run is complete, you will see a file called + 'benchmark-hpcg-[version]_[timestamp].yaml'. You will also see a log file + called 'hpcg_log_[timestamp].txt. The official results from your run are + in the .yaml file. The final two lines of the file declare whether or not + the results are valid, and explain how to report them. + + Example commands: + less HPCG-Benchmark-1.1_2014:01:22-22:46:06.yaml + mail hpcg-results@software.sandia.gov < HPCG-Benchmark-1.1_2014:01:22-22:46:06.yaml + +6) If results are not valid, do not submit them. diff --git a/tests/apps/hpcg/README b/tests/apps/hpcg/README new file mode 100644 index 0000000000..7abb80f315 --- /dev/null +++ b/tests/apps/hpcg/README @@ -0,0 +1,67 @@ +#################################################### +High Performance Conjugate Gradient Benchmark (HPCG) +#################################################### + +:Author: Jack Dongarra and Michael Heroux and Piotr Luszczek +:Revision: 2.4 +:Date: June 3, 2014 + +============ +Introduction +============ + +HPCG is a software package that performs a fixed number of symmetric +Gauss-Seidel preconditioned conjugate gradient iterations using double +precision (64 bit) floating point values. Integer arrays have global and local +scope (global indices are unique across the entire distributed memory system, +local indices are unique within a memory image). Integer data for global/local +indices have three modes: + +* 32/32 - global and local integers are 32-bit +* 64/32 - global integers are 64-bit, local are 32-bit +* 64/64 - global and local are 64-bit. + +These various modes are required in order to address sufficiently big problems +if the range of indexing goes above 2^31 (roughly 2.1B), or to conserve storage +costs if the range of indexing is less than 2^31. + +The HPCG software package requires the availibility on your system of an +implementation of the Message Passing Interface (MPI). An implementation +compliant with MPI version 1.1 is sufficient. + +============ +Installation +============ + +See the file ``INSTALL`` in this directory. + +============= +Documentation +============= + +The source code documentation can be generated with a Doxygen (version 1.8 or +newer). In this directory type:: + + doxygen tools/hpcg.dox + +Doxygen will then generate various output formats in the ``out`` directory. + +====== +Tuning +====== + +See the file ``TUNING`` in this directory. + +==== +Bugs +==== + +Known problems and bugs with this release are documented in the file +``BUGS``. + +=================== +Further information +=================== + +Check out the website http://software.sandia.gov/hpcg for the latest +information. diff --git a/tests/apps/hpcg/TODO b/tests/apps/hpcg/TODO new file mode 100644 index 0000000000..cea51b0a94 --- /dev/null +++ b/tests/apps/hpcg/TODO @@ -0,0 +1,8 @@ +============================================================== + High Performance Conjugate Gradient Benchmark (HPCG) + HPCG - 2.4 - June 3, 2014 +============================================================== + +- Add support for derived MPI Communicators (other than MPI_COMM_WORLD) + +============================================================== diff --git a/tests/apps/hpcg/TUNING b/tests/apps/hpcg/TUNING new file mode 100644 index 0000000000..18fdd6551b --- /dev/null +++ b/tests/apps/hpcg/TUNING @@ -0,0 +1,47 @@ +============================================================== +Performance tuning and setting up the input data file hpcg.dat +============================================================== + +Current as of release HPCG - 2.4 - June 3, 2014 + +Check the website http://software.sandia.gov/hpcg for the latest +information. + +After building the executable hpcg/bin/xhpcg, one may want to modify the +input data file hpcg.dat. This file should reside in the same directory +as the executable hpcg/bin/xhpcg. An example hpcg.dat file is provided +by default. This file contains information about the problem sizes, +machine configuration, and algorithm features to be used by the executable. +It is 4 lines long. All the selected parameters will be printed in the +output generated by the executable. + +================================ +Description of the hpcg.dat file +================================ + +* Line 1: (unused) Typically one would use this line for its own good. For +example, it could be used to summarize the con- tent of the input file. By +default this line reads: + +HPCG benchmark input file + +* Line 2: (unused) same as Line 1. By default, this line reads: + +Sandia National Laboratories; University of Tennessee, Knoxville + +* Line 3: This line specifies the local (to an MPI process) dimensions of the +problem. By default, this line reads: + +104 104 104 + +which means that each MPI process will be computing a solution for a cube of +size 104 points. + +* Line 4: This line specifies the number of seconds of how long the timed +portion of the benchmark should run. By default, this line reads: + +60 + +which means that the timed portion of the benchmark will run 1 minute. +This length of time is not sufficient for submitting an official run +but does give sufficient data for tuning the benchmark in most cases. diff --git a/tests/apps/hpcg/bin/hpcg.dat b/tests/apps/hpcg/bin/hpcg.dat new file mode 100644 index 0000000000..0e4508e11f --- /dev/null +++ b/tests/apps/hpcg/bin/hpcg.dat @@ -0,0 +1,4 @@ +HPCG benchmark input file +Sandia National Laboratories; University of Tennessee, Knoxville +104 104 104 +60 diff --git a/tests/apps/hpcg/build b/tests/apps/hpcg/build new file mode 100755 index 0000000000..f4bb7fba3d --- /dev/null +++ b/tests/apps/hpcg/build @@ -0,0 +1,27 @@ +#!./common/bats/bin/bats +# -*-sh-*- + +load ./common/test_helper_functions || exit 1 +source ./common/functions || exit 1 + +if [ -s ./LOCAL_ENV ];then + source ./LOCAL_ENV +else + ERROR "missing LOCAL_ENV" +fi + +@test "[$TEST_DIR] build HPCG executable ($LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + # force delete exe + rm -f $TEST_EXE $TEST_EXE.$LMOD_FAMILY_COMPILER.$LMOD_FAMILY_MPI + + # build exe + make -f Makefile.ohpc clean + make -f Makefile.ohpc + + if [ ! -s $TEST_EXE ];then + flunk "failed to create $TEST_EXE" + fi + + # rename exe + cp -f $TEST_EXE $TEST_EXE.$LMOD_FAMILY_COMPILER.$LMOD_FAMILY_MPI +} diff --git a/tests/apps/hpcg/common b/tests/apps/hpcg/common new file mode 120000 index 0000000000..dc879abe93 --- /dev/null +++ b/tests/apps/hpcg/common @@ -0,0 +1 @@ +../../common \ No newline at end of file diff --git a/tests/apps/hpcg/rm_execution_multi_host b/tests/apps/hpcg/rm_execution_multi_host new file mode 100755 index 0000000000..ea4f28026f --- /dev/null +++ b/tests/apps/hpcg/rm_execution_multi_host @@ -0,0 +1,70 @@ +#!./common/bats/bin/bats +# -*-sh-*- + +load ./common/test_helper_functions || exit 1 +source ./common/functions || exit 1 +source ./common/TEST_ENV + +if [ -s ./LOCAL_ENV ];then + . ./LOCAL_ENV +else + ERROR "LOCAL_ENV does not exist" +fi + +rm=$RESOURCE_MANAGER + +# init run options +nx=32 +ny=$nx +nz=$nx +nt=30 + +NODES=$((NUM_COMPUTES < TEST_MAX_COMPUTES ? NUM_COMPUTES : TEST_MAX_COMPUTES)) +TASKS=$((NODES * TEST_NUM_RANKS)) +ARGS="$nx $ny $nz $nt" +EXE=$TEST_EXE.$LMOD_FAMILY_COMPILER.$LMOD_FAMILY_MPI + +# set global env settings +export OMP_NUM_THREADS=$TEST_NUM_THREADS +if [ $LMOD_FAMILY_MPI == "mvapich2" ];then + export MV2_ENABLE_AFFINITY=0 + export IPATH_NO_CPUAFFINITY=1 +fi + +@test "[$TEST_DIR] check if resource manager is defined" { + if [ "x$rm" = "x" ]; then + flunk "missing resource manager" + fi +} + +@test "[$TEST_DIR] run HPCG on multi nodes under resource manager ($rm/$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + if [ ! -x $EXE ];then + flunk "missing $EXE" + fi + + run_mpi_binary -t $CMD_TIMEOUT $EXE "$ARGS" $NODES $TASKS +} + +@test "[$TEST_DIR] log HPCG multi node results ($rm/$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + run_tag=HPCG.${nx}x${ny}x${nz}.P${TASKS} + echo "Finding latest HPCG-Bencmark-*.yaml in $(pwd)" + run_yaml=`ls -t HPCG-Benchmark-*.yaml | head -n 1` + wrk_yaml=$run_tag.$LMOD_FAMILY_COMPILER.$LMOD_FAMILY_MPI.yaml + echo "Moving $run_yaml to $wrk_yaml" + mv $run_yaml $wrk_yaml + + str="HPCG result is VALID" + ref_perf=`grep "$str" ref/$wrk_yaml | cut -d ' ' -f12` + cur_perf=`grep "$str" $wrk_yaml | cut -d ' ' -f12` + + if [ -z $ref_perf ];then + ref_perf="?" + fi + + if [ -z $cur_perf ];then + cur_perf="?" + fi + + fmt="%-24s %-10s %-10s %16s %16s\n" + printf "$fmt" $run_tag $LMOD_FAMILY_COMPILER $LMOD_FAMILY_MPI $ref_perf $cur_perf >>$TEST_PERFLOG +} diff --git a/tests/apps/hpcg/rm_execution_single_host b/tests/apps/hpcg/rm_execution_single_host new file mode 100755 index 0000000000..8057e23ce1 --- /dev/null +++ b/tests/apps/hpcg/rm_execution_single_host @@ -0,0 +1,70 @@ +#!./common/bats/bin/bats +# -*-sh-*- + +load ./common/test_helper_functions || exit 1 +source ./common/functions || exit 1 +source ./common/TEST_ENV + +if [ -s ./LOCAL_ENV ];then + . ./LOCAL_ENV +else + ERROR "LOCAL_ENV does not exist" +fi + +rm=$RESOURCE_MANAGER + +# init run options +nx=32 +ny=$nx +nz=$nx +nt=30 + +NODES=1 +TASKS=$((NODES*TEST_NUM_RANKS)) +ARGS="$nx $ny $nz $nt" +EXE=$TEST_EXE.$LMOD_FAMILY_COMPILER.$LMOD_FAMILY_MPI + +# set global env settings +export OMP_NUM_THREADS=$TEST_NUM_THREADS +if [ $LMOD_FAMILY_MPI == "mvapich2" ];then + export MV2_ENABLE_AFFINITY=0 + export IPATH_NO_CPUAFFINITY=1 +fi + +@test "[$TEST_DIR] check if resource manager is defined" { + if [ "x$rm" = "x" ]; then + flunk "missing resource manager" + fi +} + +@test "[$TEST_DIR] run HPCG on single node under resource manager ($rm/$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + if [ ! -x "$EXE" ];then + flunk "missing $EXE" + fi + + run_mpi_binary -t $CMD_TIMEOUT ${EXE} "$ARGS" $NODES $TASKS +} + +@test "[$TEST_DIR] log HPCG single node results ($rm/$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + run_tag=HPCG.${nx}x${ny}x${nz}.P${TASKS} + echo "Finding latest HPCG-Bencmark-*.yaml in $(pwd)" + run_yaml=`ls -t HPCG-Benchmark-*.yaml | head -n 1` + wrk_yaml=$run_tag.$LMOD_FAMILY_COMPILER.$LMOD_FAMILY_MPI.yaml + echo "Moving $run_yaml to $wrk_yaml" + mv $run_yaml $wrk_yaml + + str="HPCG result is VALID" + ref_perf=`grep "$str" ref/$wrk_yaml | cut -d ' ' -f12` + cur_perf=`grep "$str" $wrk_yaml | cut -d ' ' -f12` + + if [ -z $ref_perf ];then + ref_perf="?" + fi + + if [ -z $cur_perf ];then + cur_perf="?" + fi + + fmt="%-24s %-10s %-10s %16s %16s\n" + printf "$fmt" $run_tag $LMOD_FAMILY_COMPILER $LMOD_FAMILY_MPI $ref_perf $cur_perf >>$TEST_PERFLOG +} diff --git a/tests/apps/hpcg/run b/tests/apps/hpcg/run new file mode 100755 index 0000000000..d07c53cb15 --- /dev/null +++ b/tests/apps/hpcg/run @@ -0,0 +1,79 @@ +#!/bin/bash + +cd "$(dirname "$0")" || exit 1 + +source ./LOCAL_ENV || exit 1 +export BATS_JUNIT_CLASS=$TEST_DIR +source ./common/TEST_ENV || exit 1 +source ./common/functions || exit 1 + + +for i in "$@"; do + case $i in + -c=*|--compiler=*) + COMPILER_FAMILIES="${i#*=}" + shift + ;; + -m=*|--mpi=*) + MPI_FAMILIES="${i#*=}" + shift + ;; + -t|--tap) + BATS_OPTS="$BATS_OPTS -t" + shift + ;; + -x|--xml) + BATS_OPTS="$BATS_OPTS -x" + shift + ;; + *) + echo "$0: Unknown option - $*" + # unknown option + ;; + esac +done + +for compiler in $COMPILER_FAMILIES ; do + for mpi in $MPI_FAMILIES ; do + + echo " " + echo " " + echo "-------------------------------------------------------" + echo "Apps: HPCG tests: $compiler-$mpi" + echo "-------------------------------------------------------" + + rm -f HPCG*.yaml + rm -f hpcg*.txt + rm -f job.*.out + + module purge || exit 1 + module load prun || exit 1 + module load $compiler || exit 1 + module load $mpi || exit 1 + + ./build $BATS_OPTS + ./rm_execution_single_host $BATS_OPTS + ./rm_execution_multi_host $BATS_OPTS + + # save .log files for potential integration with CI + save_logs_mpi_family . $compiler $mpi + mv HPCG*.yaml family-$compiler-$mpi + mv hpcg*.txt family-$compiler-$mpi + mv job.*.out family-$compiler-$mpi + done +done + +if [ -r log.HPCG ]; then + echo " " + echo " " + echo "-------------------------------------------------------" + echo "Apps: HPCG tests: Results Summary" + echo "-------------------------------------------------------" + print "%-24s %-10s %-10s %16s %16s\n" \ + Run_ID Compiler MPI_Stack Ref_GFLOP/s Curr_GFLOP/s + cat log.HPCG + + mkdir -p logs + cat log.HPCG >> logs/log.HPCG + rm log.HPCG +fi diff --git a/tests/apps/hpcg/setup/Make.GCC_OMP b/tests/apps/hpcg/setup/Make.GCC_OMP new file mode 100644 index 0000000000..dfc1e5cb94 --- /dev/null +++ b/tests/apps/hpcg/setup/Make.GCC_OMP @@ -0,0 +1,129 @@ +#HEADER +# -- High Performance Conjugate Gradient Benchmark (HPCG) +# HPCG - 1.1 - November 26, 2013 + +# Michael A. Heroux +# Scalable Algorithms Group, Computing Research Division +# Sandia National Laboratories, Albuquerque, NM +# +# Piotr Luszczek +# Jack Dongarra +# University of Tennessee, Knoxville +# Innovative Computing Laboratory +# +# (C) Copyright 2013 All Rights Reserved +# +# +# -- Copyright notice and Licensing terms: +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions, and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# 3. All advertising materials mentioning features or use of this +# software must display the following acknowledgement: +# This product includes software developed at Sandia National +# Laboratories, Albuquerque, NM and the University of +# Tennessee, Knoxville, Innovative Computing Laboratory. +# +# 4. The name of the University, the name of the Laboratory, or the +# names of its contributors may not be used to endorse or promote +# products derived from this software without specific written +# permission. +# +# -- Disclaimer: +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY +# OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# ###################################################################### +#@HEADER +# ---------------------------------------------------------------------- +# - shell -------------------------------------------------------------- +# ---------------------------------------------------------------------- +# +SHELL = /bin/sh +# +CD = cd +CP = cp +LN_S = ln -s -f +MKDIR = mkdir -p +RM = /bin/rm -f +TOUCH = touch +# +# ---------------------------------------------------------------------- +# - HPCG Directory Structure / HPCG library ------------------------------ +# ---------------------------------------------------------------------- +# +TOPdir = . +SRCdir = $(TOPdir)/src +INCdir = $(TOPdir)/src +BINdir = $(TOPdir)/bin +# +# ---------------------------------------------------------------------- +# - Message Passing library (MPI) -------------------------------------- +# ---------------------------------------------------------------------- +# MPinc tells the C compiler where to find the Message Passing library +# header files, MPlib is defined to be the name of the library to be +# used. The variable MPdir is only used for defining MPinc and MPlib. +# +MPdir = +MPinc = +MPlib = +# +# +# ---------------------------------------------------------------------- +# - HPCG includes / libraries / specifics ------------------------------- +# ---------------------------------------------------------------------- +# +HPCG_INCLUDES = -I$(INCdir) -I$(INCdir)/$(arch) $(MPinc) +HPCG_LIBS = +# +# - Compile time options ----------------------------------------------- +# +# -DHPCG_NOMPI Define to disable MPI +# -DHPCG_NOOPENMP Define to disable OPENMP +# -DHPCG_DEBUG Define to enable debugging output +# -DHPCG_DETAILED_DEBUG Define to enable very detailed debugging output +# +# By default HPCG will: +# *) Build with MPI enabled. +# *) Build with OpenMP enabled. +# *) Not generate debugging output. +# +HPCG_OPTS = -DHPCG_NOMPI +# +# ---------------------------------------------------------------------- +# +HPCG_DEFS = $(HPCG_OPTS) $(HPCG_INCLUDES) +# +# ---------------------------------------------------------------------- +# - Compilers / linkers - Optimization flags --------------------------- +# ---------------------------------------------------------------------- +# +CXX = /usr/bin/g++ +CXXFLAGS = $(HPCG_DEFS) -O3 -ffast-math -ftree-vectorize -ftree-vectorizer-verbose=0 -fopenmp +# +LINKER = $(CXX) +LINKFLAGS = $(CXXFLAGS) +# +ARCHIVER = ar +ARFLAGS = r +RANLIB = echo +# +# ---------------------------------------------------------------------- diff --git a/tests/apps/hpcg/setup/Make.ICPC_OMP b/tests/apps/hpcg/setup/Make.ICPC_OMP new file mode 100644 index 0000000000..cfbeeb3dbd --- /dev/null +++ b/tests/apps/hpcg/setup/Make.ICPC_OMP @@ -0,0 +1,129 @@ +#HEADER +# -- High Performance Conjugate Gradient Benchmark (HPCG) +# HPCG - 1.1 - November 26, 2013 + +# Michael A. Heroux +# Scalable Algorithms Group, Computing Research Division +# Sandia National Laboratories, Albuquerque, NM +# +# Piotr Luszczek +# Jack Dongarra +# University of Tennessee, Knoxville +# Innovative Computing Laboratory +# +# (C) Copyright 2013 All Rights Reserved +# +# +# -- Copyright notice and Licensing terms: +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions, and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# 3. All advertising materials mentioning features or use of this +# software must display the following acknowledgement: +# This product includes software developed at Sandia National +# Laboratories, Albuquerque, NM and the University of +# Tennessee, Knoxville, Innovative Computing Laboratory. +# +# 4. The name of the University, the name of the Laboratory, or the +# names of its contributors may not be used to endorse or promote +# products derived from this software without specific written +# permission. +# +# -- Disclaimer: +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY +# OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# ###################################################################### +#@HEADER +# ---------------------------------------------------------------------- +# - shell -------------------------------------------------------------- +# ---------------------------------------------------------------------- +# +SHELL = /bin/sh +# +CD = cd +CP = cp +LN_S = ln -s -f +MKDIR = mkdir -p +RM = /bin/rm -f +TOUCH = touch +# +# ---------------------------------------------------------------------- +# - HPCG Directory Structure / HPCG library ------------------------------ +# ---------------------------------------------------------------------- +# +TOPdir = . +SRCdir = $(TOPdir)/src +INCdir = $(TOPdir)/src +BINdir = $(TOPdir)/bin +# +# ---------------------------------------------------------------------- +# - Message Passing library (MPI) -------------------------------------- +# ---------------------------------------------------------------------- +# MPinc tells the C compiler where to find the Message Passing library +# header files, MPlib is defined to be the name of the library to be +# used. The variable MPdir is only used for defining MPinc and MPlib. +# +MPdir = +MPinc = +MPlib = +# +# +# ---------------------------------------------------------------------- +# - HPCG includes / libraries / specifics ------------------------------- +# ---------------------------------------------------------------------- +# +HPCG_INCLUDES = -I$(INCdir) -I$(INCdir)/$(arch) $(MPinc) +HPCG_LIBS = +# +# - Compile time options ----------------------------------------------- +# +# -DHPCG_NOMPI Define to disable MPI +# -DHPCG_NOOPENMP Define to disable OPENMP +# -DHPCG_DEBUG Define to enable debugging output +# -DHPCG_DETAILED_DEBUG Define to enable very detailed debugging output +# +# By default HPCG will: +# *) Build with MPI enabled. +# *) Build with OpenMP enabled. +# *) Not generate debugging output. +# +HPCG_OPTS = -DHPCG_NOMPI +# +# ---------------------------------------------------------------------- +# +HPCG_DEFS = $(HPCG_OPTS) $(HPCG_INCLUDES) +# +# ---------------------------------------------------------------------- +# - Compilers / linkers - Optimization flags --------------------------- +# ---------------------------------------------------------------------- +# +CXX = icpc +CXXFLAGS = $(HPCG_DEFS) -O3 -openmp -mavx +# +LINKER = $(CXX) +LINKFLAGS = $(CXXFLAGS) +# +ARCHIVER = ar +ARFLAGS = r +RANLIB = echo +# +# ---------------------------------------------------------------------- diff --git a/tests/apps/hpcg/setup/Make.Linux_MPI b/tests/apps/hpcg/setup/Make.Linux_MPI new file mode 100644 index 0000000000..db11fcef1b --- /dev/null +++ b/tests/apps/hpcg/setup/Make.Linux_MPI @@ -0,0 +1,130 @@ +#HEADER +# -- High Performance Conjugate Gradient Benchmark (HPCG) +# HPCG - 1.1 - November 26, 2013 + +# Michael A. Heroux +# Scalable Algorithms Group, Computing Research Division +# Sandia National Laboratories, Albuquerque, NM +# +# Piotr Luszczek +# Jack Dongarra +# University of Tennessee, Knoxville +# Innovative Computing Laboratory +# +# (C) Copyright 2013 All Rights Reserved +# +# +# -- Copyright notice and Licensing terms: +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions, and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# 3. All advertising materials mentioning features or use of this +# software must display the following acknowledgement: +# This product includes software developed at Sandia National +# Laboratories, Albuquerque, NM and the University of +# Tennessee, Knoxville, Innovative Computing Laboratory. +# +# 4. The name of the University, the name of the Laboratory, or the +# names of its contributors may not be used to endorse or promote +# products derived from this software without specific written +# permission. +# +# -- Disclaimer: +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY +# OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# ###################################################################### +#@HEADER +# ---------------------------------------------------------------------- +# - shell -------------------------------------------------------------- +# ---------------------------------------------------------------------- +# +SHELL = /bin/sh +# +CD = cd +CP = cp +LN_S = ln -s -f +MKDIR = mkdir -p +RM = /bin/rm -f +TOUCH = touch +# +# ---------------------------------------------------------------------- +# - HPCG Directory Structure / HPCG library ------------------------------ +# ---------------------------------------------------------------------- +# +TOPdir = . +SRCdir = $(TOPdir)/src +INCdir = $(TOPdir)/src +BINdir = $(TOPdir)/bin +# +# ---------------------------------------------------------------------- +# - Message Passing library (MPI) -------------------------------------- +# ---------------------------------------------------------------------- +# MPinc tells the C compiler where to find the Message Passing library +# header files, MPlib is defined to be the name of the library to be +# used. The variable MPdir is only used for defining MPinc and MPlib. +# +MPdir = +MPinc = +MPlib = +# +# +# ---------------------------------------------------------------------- +# - HPCG includes / libraries / specifics ------------------------------- +# ---------------------------------------------------------------------- +# +HPCG_INCLUDES = -I$(INCdir) -I$(INCdir)/$(arch) $(MPinc) +HPCG_LIBS = +# +# - Compile time options ----------------------------------------------- +# +# -DHPCG_NOMPI Define to disable MPI +# -DHPCG_NOOPENMP Define to disable OPENMP +# -DHPCG_DEBUG Define to enable debugging output +# -DHPCG_DETAILED_DEBUG Define to enable very detailed debugging output +# +# By default HPCG will: +# *) Build with MPI enabled. +# *) Build with OpenMP enabled. +# *) Not generate debugging output. +# +HPCG_OPTS = -DHPCG_NOOPENMP +# +# ---------------------------------------------------------------------- +# +HPCG_DEFS = $(HPCG_OPTS) $(HPCG_INCLUDES) +# +# ---------------------------------------------------------------------- +# - Compilers / linkers - Optimization flags --------------------------- +# ---------------------------------------------------------------------- +# +CXX = mpicxx +#CXXFLAGS = $(HPCG_DEFS) -fomit-frame-pointer -O3 -funroll-loops -W -Wall +CXXFLAGS = $(HPCG_DEFS) -O3 -ffast-math -ftree-vectorize -ftree-vectorizer-verbose=0 +# +LINKER = $(CXX) +LINKFLAGS = $(CXXFLAGS) +# +ARCHIVER = ar +ARFLAGS = r +RANLIB = echo +# +# ---------------------------------------------------------------------- diff --git a/tests/apps/hpcg/setup/Make.Linux_Serial b/tests/apps/hpcg/setup/Make.Linux_Serial new file mode 100644 index 0000000000..b3070b1edc --- /dev/null +++ b/tests/apps/hpcg/setup/Make.Linux_Serial @@ -0,0 +1,129 @@ +#HEADER +# -- High Performance Conjugate Gradient Benchmark (HPCG) +# HPCG - 1.1 - November 26, 2013 + +# Michael A. Heroux +# Scalable Algorithms Group, Computing Research Division +# Sandia National Laboratories, Albuquerque, NM +# +# Piotr Luszczek +# Jack Dongarra +# University of Tennessee, Knoxville +# Innovative Computing Laboratory +# +# (C) Copyright 2013 All Rights Reserved +# +# +# -- Copyright notice and Licensing terms: +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions, and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# 3. All advertising materials mentioning features or use of this +# software must display the following acknowledgement: +# This product includes software developed at Sandia National +# Laboratories, Albuquerque, NM and the University of +# Tennessee, Knoxville, Innovative Computing Laboratory. +# +# 4. The name of the University, the name of the Laboratory, or the +# names of its contributors may not be used to endorse or promote +# products derived from this software without specific written +# permission. +# +# -- Disclaimer: +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY +# OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# ###################################################################### +#@HEADER +# ---------------------------------------------------------------------- +# - shell -------------------------------------------------------------- +# ---------------------------------------------------------------------- +# +SHELL = /bin/sh +# +CD = cd +CP = cp +LN_S = ln -s -f +MKDIR = mkdir -p +RM = /bin/rm -f +TOUCH = touch +# +# ---------------------------------------------------------------------- +# - HPCG Directory Structure / HPCG library ------------------------------ +# ---------------------------------------------------------------------- +# +TOPdir = . +SRCdir = $(TOPdir)/src +INCdir = $(TOPdir)/src +BINdir = $(TOPdir)/bin +# +# ---------------------------------------------------------------------- +# - Message Passing library (MPI) -------------------------------------- +# ---------------------------------------------------------------------- +# MPinc tells the C compiler where to find the Message Passing library +# header files, MPlib is defined to be the name of the library to be +# used. The variable MPdir is only used for defining MPinc and MPlib. +# +MPdir = +MPinc = +MPlib = +# +# +# ---------------------------------------------------------------------- +# - HPCG includes / libraries / specifics ------------------------------- +# ---------------------------------------------------------------------- +# +HPCG_INCLUDES = -I$(INCdir) -I$(INCdir)/$(arch) $(MPinc) +HPCG_LIBS = +# +# - Compile time options ----------------------------------------------- +# +# -DHPCG_NOMPI Define to disable MPI +# -DHPCG_NOOPENMP Define to disable OPENMP +# -DHPCG_DEBUG Define to enable debugging output +# -DHPCG_DETAILED_DEBUG Define to enable very detailed debugging output +# +# By default HPCG will: +# *) Build with MPI enabled. +# *) Build with OpenMP enabled. +# *) Not generate debugging output. +# +HPCG_OPTS = -DHPCG_NOMPI -DHPCG_NOOPENMP +# +# ---------------------------------------------------------------------- +# +HPCG_DEFS = $(HPCG_OPTS) $(HPCG_INCLUDES) +# +# ---------------------------------------------------------------------- +# - Compilers / linkers - Optimization flags --------------------------- +# ---------------------------------------------------------------------- +# +CXX = /usr/bin/g++ +CXXFLAGS = $(HPCG_DEFS) -fomit-frame-pointer -O3 -funroll-loops -W -Wall -pedantic +# +LINKER = $(CXX) +LINKFLAGS = $(CXXFLAGS) +# +ARCHIVER = ar +ARFLAGS = r +RANLIB = echo +# +# ---------------------------------------------------------------------- diff --git a/tests/apps/hpcg/setup/Make.MPIICPC_OMP b/tests/apps/hpcg/setup/Make.MPIICPC_OMP new file mode 100644 index 0000000000..97f71e2d7e --- /dev/null +++ b/tests/apps/hpcg/setup/Make.MPIICPC_OMP @@ -0,0 +1,129 @@ +#HEADER +# -- High Performance Conjugate Gradient Benchmark (HPCG) +# HPCG - 1.1 - November 26, 2013 + +# Michael A. Heroux +# Scalable Algorithms Group, Computing Research Division +# Sandia National Laboratories, Albuquerque, NM +# +# Piotr Luszczek +# Jack Dongarra +# University of Tennessee, Knoxville +# Innovative Computing Laboratory +# +# (C) Copyright 2013 All Rights Reserved +# +# +# -- Copyright notice and Licensing terms: +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions, and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# 3. All advertising materials mentioning features or use of this +# software must display the following acknowledgement: +# This product includes software developed at Sandia National +# Laboratories, Albuquerque, NM and the University of +# Tennessee, Knoxville, Innovative Computing Laboratory. +# +# 4. The name of the University, the name of the Laboratory, or the +# names of its contributors may not be used to endorse or promote +# products derived from this software without specific written +# permission. +# +# -- Disclaimer: +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY +# OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# ###################################################################### +#@HEADER +# ---------------------------------------------------------------------- +# - shell -------------------------------------------------------------- +# ---------------------------------------------------------------------- +# +SHELL = /bin/sh +# +CD = cd +CP = cp +LN_S = ln -s -f +MKDIR = mkdir -p +RM = /bin/rm -f +TOUCH = touch +# +# ---------------------------------------------------------------------- +# - HPCG Directory Structure / HPCG library ------------------------------ +# ---------------------------------------------------------------------- +# +TOPdir = . +SRCdir = $(TOPdir)/src +INCdir = $(TOPdir)/src +BINdir = $(TOPdir)/bin +# +# ---------------------------------------------------------------------- +# - Message Passing library (MPI) -------------------------------------- +# ---------------------------------------------------------------------- +# MPinc tells the C compiler where to find the Message Passing library +# header files, MPlib is defined to be the name of the library to be +# used. The variable MPdir is only used for defining MPinc and MPlib. +# +MPdir = +MPinc = +MPlib = +# +# +# ---------------------------------------------------------------------- +# - HPCG includes / libraries / specifics ------------------------------- +# ---------------------------------------------------------------------- +# +HPCG_INCLUDES = -I$(INCdir) -I$(INCdir)/$(arch) $(MPinc) +HPCG_LIBS = +# +# - Compile time options ----------------------------------------------- +# +# -DHPCG_NOMPI Define to disable MPI +# -DHPCG_NOOPENMP Define to disable OPENMP +# -DHPCG_DEBUG Define to enable debugging output +# -DHPCG_DETAILED_DEBUG Define to enable very detailed debugging output +# +# By default HPCG will: +# *) Build with MPI enabled. +# *) Build with OpenMP enabled. +# *) Not generate debugging output. +# +HPCG_OPTS = +# +# ---------------------------------------------------------------------- +# +HPCG_DEFS = $(HPCG_OPTS) $(HPCG_INCLUDES) -DMPICH_IGNORE_CXX_SEEK +# +# ---------------------------------------------------------------------- +# - Compilers / linkers - Optimization flags --------------------------- +# ---------------------------------------------------------------------- +# +CXX = mpiicpc +CXXFLAGS = $(HPCG_DEFS) -O3 -openmp +# +LINKER = $(CXX) +LINKFLAGS = $(CXXFLAGS) +# +ARCHIVER = ar +ARFLAGS = r +RANLIB = echo +# +# ---------------------------------------------------------------------- diff --git a/tests/apps/hpcg/setup/Make.MPI_GCC_OMP b/tests/apps/hpcg/setup/Make.MPI_GCC_OMP new file mode 100644 index 0000000000..ce15d344d0 --- /dev/null +++ b/tests/apps/hpcg/setup/Make.MPI_GCC_OMP @@ -0,0 +1,129 @@ +#HEADER +# -- High Performance Conjugate Gradient Benchmark (HPCG) +# HPCG - 1.1 - November 26, 2013 + +# Michael A. Heroux +# Scalable Algorithms Group, Computing Research Division +# Sandia National Laboratories, Albuquerque, NM +# +# Piotr Luszczek +# Jack Dongarra +# University of Tennessee, Knoxville +# Innovative Computing Laboratory +# +# (C) Copyright 2013 All Rights Reserved +# +# +# -- Copyright notice and Licensing terms: +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions, and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# 3. All advertising materials mentioning features or use of this +# software must display the following acknowledgement: +# This product includes software developed at Sandia National +# Laboratories, Albuquerque, NM and the University of +# Tennessee, Knoxville, Innovative Computing Laboratory. +# +# 4. The name of the University, the name of the Laboratory, or the +# names of its contributors may not be used to endorse or promote +# products derived from this software without specific written +# permission. +# +# -- Disclaimer: +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY +# OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# ###################################################################### +#@HEADER +# ---------------------------------------------------------------------- +# - shell -------------------------------------------------------------- +# ---------------------------------------------------------------------- +# +SHELL = /bin/sh +# +CD = cd +CP = cp +LN_S = ln -s -f +MKDIR = mkdir -p +RM = /bin/rm -f +TOUCH = touch +# +# ---------------------------------------------------------------------- +# - HPCG Directory Structure / HPCG library ------------------------------ +# ---------------------------------------------------------------------- +# +TOPdir = . +SRCdir = $(TOPdir)/src +INCdir = $(TOPdir)/src +BINdir = $(TOPdir)/bin +# +# ---------------------------------------------------------------------- +# - Message Passing library (MPI) -------------------------------------- +# ---------------------------------------------------------------------- +# MPinc tells the C compiler where to find the Message Passing library +# header files, MPlib is defined to be the name of the library to be +# used. The variable MPdir is only used for defining MPinc and MPlib. +# +MPdir = +MPinc = +MPlib = +# +# +# ---------------------------------------------------------------------- +# - HPCG includes / libraries / specifics ------------------------------- +# ---------------------------------------------------------------------- +# +HPCG_INCLUDES = -I$(INCdir) -I$(INCdir)/$(arch) $(MPinc) +HPCG_LIBS = +# +# - Compile time options ----------------------------------------------- +# +# -DHPCG_NOMPI Define to disable MPI +# -DHPCG_NOOPENMP Define to disable OPENMP +# -DHPCG_DEBUG Define to enable debugging output +# -DHPCG_DETAILED_DEBUG Define to enable very detailed debugging output +# +# By default HPCG will: +# *) Build with MPI enabled. +# *) Build with OpenMP enabled. +# *) Not generate debugging output. +# +HPCG_OPTS = +# +# ---------------------------------------------------------------------- +# +HPCG_DEFS = $(HPCG_OPTS) $(HPCG_INCLUDES) +# +# ---------------------------------------------------------------------- +# - Compilers / linkers - Optimization flags --------------------------- +# ---------------------------------------------------------------------- +# +CXX = mpicxx +CXXFLAGS = $(HPCG_DEFS) -O3 -ffast-math -ftree-vectorize -ftree-vectorizer-verbose=0 -fopenmp +# +LINKER = $(CXX) +LINKFLAGS = $(CXXFLAGS) +# +ARCHIVER = ar +ARFLAGS = r +RANLIB = echo +# +# ---------------------------------------------------------------------- diff --git a/tests/apps/hpcg/setup/Make.MPI_ICPC b/tests/apps/hpcg/setup/Make.MPI_ICPC new file mode 100644 index 0000000000..c1dcaa55d2 --- /dev/null +++ b/tests/apps/hpcg/setup/Make.MPI_ICPC @@ -0,0 +1,129 @@ +#HEADER +# -- High Performance Conjugate Gradient Benchmark (HPCG) +# HPCG - 1.1 - November 26, 2013 + +# Michael A. Heroux +# Scalable Algorithms Group, Computing Research Division +# Sandia National Laboratories, Albuquerque, NM +# +# Piotr Luszczek +# Jack Dongarra +# University of Tennessee, Knoxville +# Innovative Computing Laboratory +# +# (C) Copyright 2013 All Rights Reserved +# +# +# -- Copyright notice and Licensing terms: +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions, and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# 3. All advertising materials mentioning features or use of this +# software must display the following acknowledgement: +# This product includes software developed at Sandia National +# Laboratories, Albuquerque, NM and the University of +# Tennessee, Knoxville, Innovative Computing Laboratory. +# +# 4. The name of the University, the name of the Laboratory, or the +# names of its contributors may not be used to endorse or promote +# products derived from this software without specific written +# permission. +# +# -- Disclaimer: +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY +# OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# ###################################################################### +#@HEADER +# ---------------------------------------------------------------------- +# - shell -------------------------------------------------------------- +# ---------------------------------------------------------------------- +# +SHELL = /bin/sh +# +CD = cd +CP = cp +LN_S = ln -s -f +MKDIR = mkdir -p +RM = /bin/rm -f +TOUCH = touch +# +# ---------------------------------------------------------------------- +# - HPCG Directory Structure / HPCG library ------------------------------ +# ---------------------------------------------------------------------- +# +TOPdir = . +SRCdir = $(TOPdir)/src +INCdir = $(TOPdir)/src +BINdir = $(TOPdir)/bin +# +# ---------------------------------------------------------------------- +# - Message Passing library (MPI) -------------------------------------- +# ---------------------------------------------------------------------- +# MPinc tells the C compiler where to find the Message Passing library +# header files, MPlib is defined to be the name of the library to be +# used. The variable MPdir is only used for defining MPinc and MPlib. +# +MPdir = +MPinc = +MPlib = +# +# +# ---------------------------------------------------------------------- +# - HPCG includes / libraries / specifics ------------------------------- +# ---------------------------------------------------------------------- +# +HPCG_INCLUDES = -I$(INCdir) -I$(INCdir)/$(arch) $(MPinc) +HPCG_LIBS = +# +# - Compile time options ----------------------------------------------- +# +# -DHPCG_NOMPI Define to disable MPI +# -DHPCG_NOOPENMP Define to disable OPENMP +# -DHPCG_DEBUG Define to enable debugging output +# -DHPCG_DETAILED_DEBUG Define to enable very detailed debugging output +# +# By default HPCG will: +# *) Build with MPI enabled. +# *) Build with OpenMP enabled. +# *) Not generate debugging output. +# +HPCG_OPTS = -DHPCG_NOOPENMP +# +# ---------------------------------------------------------------------- +# +HPCG_DEFS = $(HPCG_OPTS) $(HPCG_INCLUDES) +# +# ---------------------------------------------------------------------- +# - Compilers / linkers - Optimization flags --------------------------- +# ---------------------------------------------------------------------- +# +CXX = mpicxx +CXXFLAGS = $(HPCG_DEFS) -O3 -mavx +# +LINKER = $(CXX) +LINKFLAGS = $(CXXFLAGS) +# +ARCHIVER = ar +ARFLAGS = r +RANLIB = echo +# +# ---------------------------------------------------------------------- diff --git a/tests/apps/hpcg/setup/Make.MPI_ICPC_OMP b/tests/apps/hpcg/setup/Make.MPI_ICPC_OMP new file mode 100644 index 0000000000..6ed0998057 --- /dev/null +++ b/tests/apps/hpcg/setup/Make.MPI_ICPC_OMP @@ -0,0 +1,129 @@ +#HEADER +# -- High Performance Conjugate Gradient Benchmark (HPCG) +# HPCG - 1.1 - November 26, 2013 + +# Michael A. Heroux +# Scalable Algorithms Group, Computing Research Division +# Sandia National Laboratories, Albuquerque, NM +# +# Piotr Luszczek +# Jack Dongarra +# University of Tennessee, Knoxville +# Innovative Computing Laboratory +# +# (C) Copyright 2013 All Rights Reserved +# +# +# -- Copyright notice and Licensing terms: +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions, and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# 3. All advertising materials mentioning features or use of this +# software must display the following acknowledgement: +# This product includes software developed at Sandia National +# Laboratories, Albuquerque, NM and the University of +# Tennessee, Knoxville, Innovative Computing Laboratory. +# +# 4. The name of the University, the name of the Laboratory, or the +# names of its contributors may not be used to endorse or promote +# products derived from this software without specific written +# permission. +# +# -- Disclaimer: +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY +# OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# ###################################################################### +#@HEADER +# ---------------------------------------------------------------------- +# - shell -------------------------------------------------------------- +# ---------------------------------------------------------------------- +# +SHELL = /bin/sh +# +CD = cd +CP = cp +LN_S = ln -s -f +MKDIR = mkdir -p +RM = /bin/rm -f +TOUCH = touch +# +# ---------------------------------------------------------------------- +# - HPCG Directory Structure / HPCG library ------------------------------ +# ---------------------------------------------------------------------- +# +TOPdir = . +SRCdir = $(TOPdir)/src +INCdir = $(TOPdir)/src +BINdir = $(TOPdir)/bin +# +# ---------------------------------------------------------------------- +# - Message Passing library (MPI) -------------------------------------- +# ---------------------------------------------------------------------- +# MPinc tells the C compiler where to find the Message Passing library +# header files, MPlib is defined to be the name of the library to be +# used. The variable MPdir is only used for defining MPinc and MPlib. +# +MPdir = +MPinc = +MPlib = +# +# +# ---------------------------------------------------------------------- +# - HPCG includes / libraries / specifics ------------------------------- +# ---------------------------------------------------------------------- +# +HPCG_INCLUDES = -I$(INCdir) -I$(INCdir)/$(arch) $(MPinc) +HPCG_LIBS = +# +# - Compile time options ----------------------------------------------- +# +# -DHPCG_NOMPI Define to disable MPI +# -DHPCG_NOOPENMP Define to disable OPENMP +# -DHPCG_DEBUG Define to enable debugging output +# -DHPCG_DETAILED_DEBUG Define to enable very detailed debugging output +# +# By default HPCG will: +# *) Build with MPI enabled. +# *) Build with OpenMP enabled. +# *) Not generate debugging output. +# +HPCG_OPTS = +# +# ---------------------------------------------------------------------- +# +HPCG_DEFS = $(HPCG_OPTS) $(HPCG_INCLUDES) +# +# ---------------------------------------------------------------------- +# - Compilers / linkers - Optimization flags --------------------------- +# ---------------------------------------------------------------------- +# +CXX = mpicxx +CXXFLAGS = $(HPCG_DEFS) -O3 -openmp -mavx +# +LINKER = $(CXX) +LINKFLAGS = $(CXXFLAGS) +# +ARCHIVER = ar +ARFLAGS = r +RANLIB = echo +# +# ---------------------------------------------------------------------- diff --git a/tests/apps/hpcg/setup/Make.UNKNOWN b/tests/apps/hpcg/setup/Make.UNKNOWN new file mode 100644 index 0000000000..b06002198e --- /dev/null +++ b/tests/apps/hpcg/setup/Make.UNKNOWN @@ -0,0 +1,23 @@ +# -*- Makefile -*- + +arch=UNKNOWN + +VERSION = 2.0 + +UNKNOWN: + @echo + @echo Please specify "'"arch"'" variable, for example: + @echo 1. Create file "'"Make.Unix"'" in the "'"setup"'" directory + @echo 2. Type: "'"make arch=Unix"'" + @echo + +GNUTAR = gnutar # or "gtar" on Linux + +dist: + @echo Packaging for version $(VERSION) + ln -s -f . hpcg-$(VERSION) + grep :0: /etc/group | sed -e 's/:.*//' | xargs -I '{}' $(GNUTAR) --owner=root --group='{}' -cvhof hpcg-$(VERSION).tar hpcg-$(VERSION)/src/*.[ch]pp hpcg-$(VERSION)/testing/*.[ch]pp hpcg-$(VERSION)/[BCHIQRTV]* hpcg-$(VERSION)/bin/hpcg.dat hpcg-$(VERSION)/setup/Make.* hpcg-$(VERSION)/configure hpcg-$(VERSION)/Makefile hpcg-$(VERSION)/Makefile.ext hpcg-$(VERSION)/tools/hpcg.dox + gzip -v --best hpcg-$(VERSION).tar + rm -f hpcg-$(VERSION) + +.PHONY: UNKNOWN dist diff --git a/tests/apps/hpcg/setup/Make.ohpc b/tests/apps/hpcg/setup/Make.ohpc new file mode 100644 index 0000000000..aefdc8a6c9 --- /dev/null +++ b/tests/apps/hpcg/setup/Make.ohpc @@ -0,0 +1,134 @@ +#HEADER +# -- High Performance Conjugate Gradient Benchmark (HPCG) +# HPCG - 1.1 - November 26, 2013 + +# Michael A. Heroux +# Scalable Algorithms Group, Computing Research Division +# Sandia National Laboratories, Albuquerque, NM +# +# Piotr Luszczek +# Jack Dongarra +# University of Tennessee, Knoxville +# Innovative Computing Laboratory +# +# (C) Copyright 2013 All Rights Reserved +# +# +# -- Copyright notice and Licensing terms: +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions, and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# 3. All advertising materials mentioning features or use of this +# software must display the following acknowledgement: +# This product includes software developed at Sandia National +# Laboratories, Albuquerque, NM and the University of +# Tennessee, Knoxville, Innovative Computing Laboratory. +# +# 4. The name of the University, the name of the Laboratory, or the +# names of its contributors may not be used to endorse or promote +# products derived from this software without specific written +# permission. +# +# -- Disclaimer: +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY +# OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# ###################################################################### +#@HEADER +# ---------------------------------------------------------------------- +# - shell -------------------------------------------------------------- +# ---------------------------------------------------------------------- +# +SHELL = /bin/sh +# +CD = cd +CP = cp +LN_S = ln -s -f +MKDIR = mkdir -p +RM = /bin/rm -f +TOUCH = touch +# +# ---------------------------------------------------------------------- +# - HPCG Directory Structure / HPCG library ------------------------------ +# ---------------------------------------------------------------------- +# +TOPdir = . +SRCdir = $(TOPdir)/src +INCdir = $(TOPdir)/src +BINdir = $(TOPdir)/bin +# +# ---------------------------------------------------------------------- +# - Message Passing library (MPI) -------------------------------------- +# ---------------------------------------------------------------------- +# MPinc tells the C compiler where to find the Message Passing library +# header files, MPlib is defined to be the name of the library to be +# used. The variable MPdir is only used for defining MPinc and MPlib. +# +MPdir = +MPinc = +MPlib = +# +# +# ---------------------------------------------------------------------- +# - HPCG includes / libraries / specifics ------------------------------- +# ---------------------------------------------------------------------- +# +HPCG_INCLUDES = -I$(INCdir) -I$(INCdir)/$(arch) $(MPinc) +HPCG_LIBS = +# +# - Compile time options ----------------------------------------------- +# +# -DHPCG_NOMPI Define to disable MPI +# -DHPCG_NOOPENMP Define to disable OPENMP +# -DHPCG_DEBUG Define to enable debugging output +# -DHPCG_DETAILED_DEBUG Define to enable very detailed debugging output +# +# By default HPCG will: +# *) Build with MPI enabled. +# *) Build with OpenMP enabled. +# *) Not generate debugging output. +# +HPCG_OPTS = +# +# ---------------------------------------------------------------------- +# +HPCG_DEFS = $(HPCG_OPTS) $(HPCG_INCLUDES) -DMPICH_IGNORE_CXX_SEEK +# +# ---------------------------------------------------------------------- +# - Compilers / linkers - Optimization flags --------------------------- +# ---------------------------------------------------------------------- +# +CXX = mpicxx + +ifeq ($(LMOD_FAMILY_COMPILER),intel) +CXXFLAGS = $(HPCG_DEFS) -O3 -openmp +else +CXXFLAGS = $(HPCG_DEFS) -O3 -ffast-math -ftree-vectorize -ftree-vectorizer-verbose=0 -fopenmp +endif +# +LINKER = $(CXX) +LINKFLAGS = $(CXXFLAGS) +# +ARCHIVER = ar +ARFLAGS = r +RANLIB = echo +# +# ---------------------------------------------------------------------- diff --git a/tests/apps/hpcg/src/CG.cpp b/tests/apps/hpcg/src/CG.cpp new file mode 100644 index 0000000000..2456ccea96 --- /dev/null +++ b/tests/apps/hpcg/src/CG.cpp @@ -0,0 +1,143 @@ + +//@HEADER +// *************************************************** +// +// HPCG: High Performance Conjugate Gradient Benchmark +// +// Contact: +// Michael A. Heroux ( maherou@sandia.gov) +// Jack Dongarra (dongarra@eecs.utk.edu) +// Piotr Luszczek (luszczek@eecs.utk.edu) +// +// *************************************************** +//@HEADER + +/*! + @file CG.cpp + + HPCG routine + */ + +#include + +#include + +#include "hpcg.hpp" + +#include "CG.hpp" +#include "mytimer.hpp" +#include "ComputeSPMV.hpp" +#include "ComputeMG.hpp" +#include "ComputeDotProduct.hpp" +#include "ComputeWAXPBY.hpp" + + +// Use TICK and TOCK to time a code section in MATLAB-like fashion +#define TICK() t0 = mytimer() //!< record current time in 't0' +#define TOCK(t) t += mytimer() - t0 //!< store time difference in 't' using time in 't0' + +/*! + Routine to compute an approximate solution to Ax = b + + @param[in] geom The description of the problem's geometry. + @param[inout] A The known system matrix + @param[inout] data The data structure with all necessary CG vectors preallocated + @param[in] b The known right hand side vector + @param[inout] x On entry: the initial guess; on exit: the new approximate solution + @param[in] max_iter The maximum number of iterations to perform, even if tolerance is not met. + @param[in] tolerance The stopping criterion to assert convergence: if norm of residual is <= to tolerance. + @param[out] niters The number of iterations actually performed. + @param[out] normr The 2-norm of the residual vector after the last iteration. + @param[out] normr0 The 2-norm of the residual vector before the first iteration. + @param[out] times The 7-element vector of the timing information accumulated during all of the iterations. + @param[in] doPreconditioning The flag to indicate whether the preconditioner should be invoked at each iteration. + + @return Returns zero on success and a non-zero value otherwise. + + @see CG_ref() +*/ +int CG(const SparseMatrix & A, CGData & data, const Vector & b, Vector & x, + const int max_iter, const double tolerance, int & niters, double & normr, double & normr0, + double * times, bool doPreconditioning) { + + double t_begin = mytimer(); // Start timing right away + normr = 0.0; + double rtz = 0.0, oldrtz = 0.0, alpha = 0.0, beta = 0.0, pAp = 0.0; + + + double t0 = 0.0, t1 = 0.0, t2 = 0.0, t3 = 0.0, t4 = 0.0, t5 = 0.0; +//#ifndef HPCG_NOMPI +// double t6 = 0.0; +//#endif + local_int_t nrow = A.localNumberOfRows; + Vector & r = data.r; // Residual vector + Vector & z = data.z; // Preconditioned residual vector + Vector & p = data.p; // Direction vector (in MPI mode ncol>=nrow) + Vector & Ap = data.Ap; + + if (!doPreconditioning && A.geom->rank==0) HPCG_fout << "WARNING: PERFORMING UNPRECONDITIONED ITERATIONS" << std::endl; + +#ifdef HPCG_DEBUG + int print_freq = 1; + if (print_freq>50) print_freq=50; + if (print_freq<1) print_freq=1; +#endif + // p is of length ncols, copy x to p for sparse MV operation + CopyVector(x, p); + TICK(); ComputeSPMV(A, p, Ap); TOCK(t3); // Ap = A*p + TICK(); ComputeWAXPBY(nrow, 1.0, b, -1.0, Ap, r, A.isWaxpbyOptimized); TOCK(t2); // r = b - Ax (x stored in p) + TICK(); ComputeDotProduct(nrow, r, r, normr, t4, A.isDotProductOptimized); TOCK(t1); + normr = sqrt(normr); +#ifdef HPCG_DEBUG + if (A.geom->rank==0) HPCG_fout << "Initial Residual = "<< normr << std::endl; +#endif + + // Record initial residual for convergence testing + normr0 = normr; + + // Start iterations + + for (int k=1; k<=max_iter && normr/normr0 > tolerance; k++ ) { + TICK(); + if (doPreconditioning) + ComputeMG(A, r, z); // Apply preconditioner + else + CopyVector (r, z); // copy r to z (no preconditioning) + TOCK(t5); // Preconditioner apply time + + if (k == 1) { + TICK(); ComputeWAXPBY(nrow, 1.0, z, 0.0, z, p, A.isWaxpbyOptimized); TOCK(t2); // Copy Mr to p + TICK(); ComputeDotProduct (nrow, r, z, rtz, t4, A.isDotProductOptimized); TOCK(t1); // rtz = r'*z + } else { + oldrtz = rtz; + TICK(); ComputeDotProduct (nrow, r, z, rtz, t4, A.isDotProductOptimized); TOCK(t1); // rtz = r'*z + beta = rtz/oldrtz; + TICK(); ComputeWAXPBY (nrow, 1.0, z, beta, p, p, A.isWaxpbyOptimized); TOCK(t2); // p = beta*p + z + } + + TICK(); ComputeSPMV(A, p, Ap); TOCK(t3); // Ap = A*p + TICK(); ComputeDotProduct(nrow, p, Ap, pAp, t4, A.isDotProductOptimized); TOCK(t1); // alpha = p'*Ap + alpha = rtz/pAp; + TICK(); ComputeWAXPBY(nrow, 1.0, x, alpha, p, x, A.isWaxpbyOptimized);// x = x + alpha*p + ComputeWAXPBY(nrow, 1.0, r, -alpha, Ap, r, A.isWaxpbyOptimized); TOCK(t2);// r = r - alpha*Ap + TICK(); ComputeDotProduct(nrow, r, r, normr, t4, A.isDotProductOptimized); TOCK(t1); + normr = sqrt(normr); +#ifdef HPCG_DEBUG + if (A.geom->rank==0 && (k%print_freq == 0 || k == max_iter)) + HPCG_fout << "Iteration = "<< k << " Scaled Residual = "<< normr/normr0 << std::endl; +#endif + niters = k; + } + + // Store times + times[1] += t1; // dot-product time + times[2] += t2; // WAXPBY time + times[3] += t3; // SPMV time + times[4] += t4; // AllReduce time + times[5] += t5; // preconditioner apply time +//#ifndef HPCG_NOMPI +// times[6] += t6; // exchange halo time +//#endif + times[0] += mytimer() - t_begin; // Total time. All done... + return(0); +} diff --git a/tests/apps/hpcg/src/CG.hpp b/tests/apps/hpcg/src/CG.hpp new file mode 100644 index 0000000000..a080dfaacc --- /dev/null +++ b/tests/apps/hpcg/src/CG.hpp @@ -0,0 +1,39 @@ + +//@HEADER +// *************************************************** +// +// HPCG: High Performance Conjugate Gradient Benchmark +// +// Contact: +// Michael A. Heroux ( maherou@sandia.gov) +// Jack Dongarra (dongarra@eecs.utk.edu) +// Piotr Luszczek (luszczek@eecs.utk.edu) +// +// *************************************************** +//@HEADER + +#ifndef CG_HPP +#define CG_HPP + +#include "SparseMatrix.hpp" +#include "Vector.hpp" +#include "CGData.hpp" + +int CG(const SparseMatrix & A, CGData & data, const Vector & b, Vector & x, + const int max_iter, const double tolerance, int & niters, double & normr, double & normr0, + double * times, bool doPreconditioning); + +// this function will compute the Conjugate Gradient iterations. +// geom - Domain and processor topology information +// A - Matrix +// b - constant +// x - used for return value +// max_iter - how many times we iterate +// tolerance - Stopping tolerance for preconditioned iterations. +// niters - number of iterations performed +// normr - computed residual norm +// normr0 - Original residual +// times - array of timing information +// doPreconditioning - bool to specify whether or not symmetric GS will be applied. + +#endif // CG_HPP diff --git a/tests/apps/hpcg/src/CGData.hpp b/tests/apps/hpcg/src/CGData.hpp new file mode 100644 index 0000000000..0a5d7bcb13 --- /dev/null +++ b/tests/apps/hpcg/src/CGData.hpp @@ -0,0 +1,66 @@ + +//@HEADER +// *************************************************** +// +// HPCG: High Performance Conjugate Gradient Benchmark +// +// Contact: +// Michael A. Heroux ( maherou@sandia.gov) +// Jack Dongarra (dongarra@eecs.utk.edu) +// Piotr Luszczek (luszczek@eecs.utk.edu) +// +// *************************************************** +//@HEADER + +/*! + @file CGData.hpp + + HPCG data structure + */ + +#ifndef CGDATA_HPP +#define CGDATA_HPP + +#include "SparseMatrix.hpp" +#include "Vector.hpp" + +struct CGData_STRUCT { + Vector r; //!< pointer to residual vector + Vector z; //!< pointer to preconditioned residual vector + Vector p; //!< pointer to direction vector + Vector Ap; //!< pointer to Krylov vector +}; +typedef struct CGData_STRUCT CGData; + +/*! + Constructor for the data structure of CG vectors. + + @param[in] A the data structure that describes the problem matrix and its structure + @param[out] data the data structure for CG vectors that will be allocated to get it ready for use in CG iterations + */ +inline void InitializeSparseCGData(SparseMatrix & A, CGData & data) { + local_int_t nrow = A.localNumberOfRows; + local_int_t ncol = A.localNumberOfColumns; + InitializeVector(data.r, nrow); + InitializeVector(data.z, ncol); + InitializeVector(data.p, ncol); + InitializeVector(data.Ap, nrow); + return; +} + +/*! + Destructor for the CG vectors data. + + @param[inout] data the CG vectors data structure whose storage is deallocated + */ +inline void DeleteCGData(CGData & data) { + + DeleteVector (data.r); + DeleteVector (data.z); + DeleteVector (data.p); + DeleteVector (data.Ap); + return; +} + +#endif // CGDATA_HPP + diff --git a/tests/apps/hpcg/src/CG_ref.cpp b/tests/apps/hpcg/src/CG_ref.cpp new file mode 100644 index 0000000000..4998cb151e --- /dev/null +++ b/tests/apps/hpcg/src/CG_ref.cpp @@ -0,0 +1,145 @@ + +//@HEADER +// *************************************************** +// +// HPCG: High Performance Conjugate Gradient Benchmark +// +// Contact: +// Michael A. Heroux ( maherou@sandia.gov) +// Jack Dongarra (dongarra@eecs.utk.edu) +// Piotr Luszczek (luszczek@eecs.utk.edu) +// +// *************************************************** +//@HEADER + +/*! + @file CG_ref.cpp + + HPCG routine + */ + +#include + +#include + +#include "hpcg.hpp" + +#include "CG_ref.hpp" +#include "mytimer.hpp" +#include "ComputeSPMV_ref.hpp" +#include "ComputeMG_ref.hpp" +#include "ComputeDotProduct_ref.hpp" +#include "ComputeWAXPBY_ref.hpp" + + +// Use TICK and TOCK to time a code section in MATLAB-like fashion +#define TICK() t0 = mytimer() //!< record current time in 't0' +#define TOCK(t) t += mytimer() - t0 //!< store time difference in 't' using time in 't0' + +/*! + Reference routine to compute an approximate solution to Ax = b + + @param[inout] A The known system matrix + @param[inout] data The data structure with all necessary CG vectors preallocated + @param[in] b The known right hand side vector + @param[inout] x On entry: the initial guess; on exit: the new approximate solution + @param[in] max_iter The maximum number of iterations to perform, even if tolerance is not met. + @param[in] tolerance The stopping criterion to assert convergence: if norm of residual is <= to tolerance. + @param[out] niters The number of iterations actually performed. + @param[out] normr The 2-norm of the residual vector after the last iteration. + @param[out] normr0 The 2-norm of the residual vector before the first iteration. + @param[out] times The 7-element vector of the timing information accumulated during all of the iterations. + @param[in] doPreconditioning The flag to indicate whether the preconditioner should be invoked at each iteration. + + @return Returns zero on success and a non-zero value otherwise. + + @see CG() +*/ +int CG_ref(const SparseMatrix & A, CGData & data, const Vector & b, Vector & x, + const int max_iter, const double tolerance, int & niters, double & normr, double & normr0, + double * times, bool doPreconditioning) { + + double t_begin = mytimer(); // Start timing right away + normr = 0.0; + double rtz = 0.0, oldrtz = 0.0, alpha = 0.0, beta = 0.0, pAp = 0.0; + + + double t0 = 0.0, t1 = 0.0, t2 = 0.0, t3 = 0.0, t4 = 0.0, t5 = 0.0; +//#ifndef HPCG_NOMPI +// double t6 = 0.0; +//#endif + + local_int_t nrow = A.localNumberOfRows; + + Vector & r = data.r; // Residual vector + Vector & z = data.z; // Preconditioned residual vector + Vector & p = data.p; // Direction vector (in MPI mode ncol>=nrow) + Vector & Ap = data.Ap; + + if (!doPreconditioning && A.geom->rank==0) HPCG_fout << "WARNING: PERFORMING UNPRECONDITIONED ITERATIONS" << std::endl; + +#ifdef HPCG_DEBUG + int print_freq = 1; + if (print_freq>50) print_freq=50; + if (print_freq<1) print_freq=1; +#endif + // p is of length ncols, copy x to p for sparse MV operation + CopyVector(x, p); + TICK(); ComputeSPMV_ref(A, p, Ap); TOCK(t3); // Ap = A*p + TICK(); ComputeWAXPBY_ref(nrow, 1.0, b, -1.0, Ap, r); TOCK(t2); // r = b - Ax (x stored in p) + TICK(); ComputeDotProduct_ref(nrow, r, r, normr, t4); TOCK(t1); + normr = sqrt(normr); +#ifdef HPCG_DEBUG + if (A.geom->rank==0) HPCG_fout << "Initial Residual = "<< normr << std::endl; +#endif + + // Record initial residual for convergence testing + normr0 = normr; + + // Start iterations + + for (int k=1; k<=max_iter && normr/normr0 > tolerance; k++ ) { + TICK(); + if (doPreconditioning) + ComputeMG_ref(A, r, z); // Apply preconditioner + else + ComputeWAXPBY_ref(nrow, 1.0, r, 0.0, r, z); // copy r to z (no preconditioning) + TOCK(t5); // Preconditioner apply time + + if (k == 1) { + CopyVector(z, p); TOCK(t2); // Copy Mr to p + TICK(); ComputeDotProduct_ref(nrow, r, z, rtz, t4); TOCK(t1); // rtz = r'*z + } else { + oldrtz = rtz; + TICK(); ComputeDotProduct_ref(nrow, r, z, rtz, t4); TOCK(t1); // rtz = r'*z + beta = rtz/oldrtz; + TICK(); ComputeWAXPBY_ref(nrow, 1.0, z, beta, p, p); TOCK(t2); // p = beta*p + z + } + + TICK(); ComputeSPMV_ref(A, p, Ap); TOCK(t3); // Ap = A*p + TICK(); ComputeDotProduct_ref(nrow, p, Ap, pAp, t4); TOCK(t1); // alpha = p'*Ap + alpha = rtz/pAp; + TICK(); ComputeWAXPBY_ref(nrow, 1.0, x, alpha, p, x);// x = x + alpha*p + ComputeWAXPBY_ref(nrow, 1.0, r, -alpha, Ap, r); TOCK(t2);// r = r - alpha*Ap + TICK(); ComputeDotProduct_ref(nrow, r, r, normr, t4); TOCK(t1); + normr = sqrt(normr); +#ifdef HPCG_DEBUG + if (A.geom->rank==0 && (k%print_freq == 0 || k == max_iter)) + HPCG_fout << "Iteration = "<< k << " Scaled Residual = "<< normr/normr0 << std::endl; +#endif + niters = k; + } + + // Store times + times[1] += t1; // dot product time + times[2] += t2; // WAXPBY time + times[3] += t3; // SPMV time + times[4] += t4; // AllReduce time + times[5] += t5; // preconditioner apply time +//#ifndef HPCG_NOMPI +// times[6] += t6; // exchange halo time +//#endif + times[0] += mytimer() - t_begin; // Total time. All done... + return(0); +} + diff --git a/tests/apps/hpcg/src/CG_ref.hpp b/tests/apps/hpcg/src/CG_ref.hpp new file mode 100644 index 0000000000..c58df0b8db --- /dev/null +++ b/tests/apps/hpcg/src/CG_ref.hpp @@ -0,0 +1,39 @@ + +//@HEADER +// *************************************************** +// +// HPCG: High Performance Conjugate Gradient Benchmark +// +// Contact: +// Michael A. Heroux ( maherou@sandia.gov) +// Jack Dongarra (dongarra@eecs.utk.edu) +// Piotr Luszczek (luszczek@eecs.utk.edu) +// +// *************************************************** +//@HEADER + +#ifndef CG_REF_HPP +#define CG_REF_HPP + +#include "SparseMatrix.hpp" +#include "Vector.hpp" +#include "CGData.hpp" + +int CG_ref(const SparseMatrix & A, CGData & data, const Vector & b, Vector & x, + const int max_iter, const double tolerance, int & niters, double & normr, double & normr0, + double * times, bool doPreconditioning); + +// this function will compute the Conjugate Gradient iterations. +// geom - Domain and processor topology information +// A - Matrix +// b - constant +// x - used for return value +// max_iter - how many times we iterate +// tolerance - Stopping tolerance for preconditioned iterations. +// niters - number of iterations performed +// normr - computed residual norm +// normr0 - Original residual +// times - array of timing information +// doPreconditioning - bool to specify whether or not symmetric GS will be applied. + +#endif // CG_REF_HPP diff --git a/tests/apps/hpcg/src/ComputeDotProduct.cpp b/tests/apps/hpcg/src/ComputeDotProduct.cpp new file mode 100644 index 0000000000..50d1a7c9e5 --- /dev/null +++ b/tests/apps/hpcg/src/ComputeDotProduct.cpp @@ -0,0 +1,47 @@ + +//@HEADER +// *************************************************** +// +// HPCG: High Performance Conjugate Gradient Benchmark +// +// Contact: +// Michael A. Heroux ( maherou@sandia.gov) +// Jack Dongarra (dongarra@eecs.utk.edu) +// Piotr Luszczek (luszczek@eecs.utk.edu) +// +// *************************************************** +//@HEADER + +/*! + @file ComputeDotProduct.cpp + + HPCG routine + */ + +#include "ComputeDotProduct.hpp" +#include "ComputeDotProduct_ref.hpp" + +/*! + Routine to compute the dot product of two vectors. + + This routine calls the reference dot-product implementation by default, but + can be replaced by a custom routine that is optimized and better suited for + the target system. + + @param[in] n the number of vector elements (on this processor) + @param[in] x, y the input vectors + @param[out] result a pointer to scalar value, on exit will contain the result. + @param[out] time_allreduce the time it took to perform the communication between processes + @param[out] isOptimized should be set to false if this routine uses the reference implementation (is not optimized); otherwise leave it unchanged + + @return returns 0 upon success and non-zero otherwise + + @see ComputeDotProduct_ref +*/ +int ComputeDotProduct(const local_int_t n, const Vector & x, const Vector & y, + double & result, double & time_allreduce, bool & isOptimized) { + + // This line and the next two lines should be removed and your version of ComputeDotProduct should be used. + isOptimized = false; + return(ComputeDotProduct_ref(n, x, y, result, time_allreduce)); +} diff --git a/tests/apps/hpcg/src/ComputeDotProduct.hpp b/tests/apps/hpcg/src/ComputeDotProduct.hpp new file mode 100644 index 0000000000..33a213c93c --- /dev/null +++ b/tests/apps/hpcg/src/ComputeDotProduct.hpp @@ -0,0 +1,21 @@ + +//@HEADER +// *************************************************** +// +// HPCG: High Performance Conjugate Gradient Benchmark +// +// Contact: +// Michael A. Heroux ( maherou@sandia.gov) +// Jack Dongarra (dongarra@eecs.utk.edu) +// Piotr Luszczek (luszczek@eecs.utk.edu) +// +// *************************************************** +//@HEADER + +#ifndef COMPUTEDOTPRODUCT_HPP +#define COMPUTEDOTPRODUCT_HPP +#include "Vector.hpp" +int ComputeDotProduct(const local_int_t n, const Vector & x, const Vector & y, + double & result, double & time_allreduce, bool & isOptimized); + +#endif // COMPUTEDOTPRODUCT_HPP diff --git a/tests/apps/hpcg/src/ComputeDotProduct_ref.cpp b/tests/apps/hpcg/src/ComputeDotProduct_ref.cpp new file mode 100644 index 0000000000..0bd9560bd1 --- /dev/null +++ b/tests/apps/hpcg/src/ComputeDotProduct_ref.cpp @@ -0,0 +1,79 @@ + +//@HEADER +// *************************************************** +// +// HPCG: High Performance Conjugate Gradient Benchmark +// +// Contact: +// Michael A. Heroux ( maherou@sandia.gov) +// Jack Dongarra (dongarra@eecs.utk.edu) +// Piotr Luszczek (luszczek@eecs.utk.edu) +// +// *************************************************** +//@HEADER + +/*! + @file ComputeDotProduct_ref.cpp + + HPCG routine + */ + +#ifndef HPCG_NOMPI +#include +#include "mytimer.hpp" +#endif +#ifndef HPCG_NOOPENMP +#include +#endif +#include +#include "ComputeDotProduct_ref.hpp" + +/*! + Routine to compute the dot product of two vectors where: + + This is the reference dot-product implementation. It _CANNOT_ be modified for the + purposes of this benchmark. + + @param[in] n the number of vector elements (on this processor) + @param[in] x, y the input vectors + @param[in] result a pointer to scalar value, on exit will contain result. + @param[out] time_allreduce the time it took to perform the communication between processes + + @return returns 0 upon success and non-zero otherwise + + @see ComputeDotProduct +*/ +int ComputeDotProduct_ref(const local_int_t n, const Vector & x, const Vector & y, + double & result, double & time_allreduce) { + assert(x.localLength>=n); // Test vector lengths + assert(y.localLength>=n); + + double local_result = 0.0; + double * xv = x.values; + double * yv = y.values; + if (yv==xv) { +#ifndef HPCG_NOOPENMP + #pragma omp parallel for reduction (+:local_result) +#endif + for (local_int_t i=0; i +#include + +/*! + + @param[in] A the known system matrix + @param[in] r the input vector + @param[inout] x On exit contains the result of the multigrid V-cycle with r as the RHS, x is the approximation to Ax = r. + + @return returns 0 upon success and non-zero otherwise + + @see ComputeMG +*/ +int ComputeMG_ref(const SparseMatrix & A, const Vector & r, Vector & x) { + assert(x.localLength==A.localNumberOfColumns); // Make sure x contain space for halo values + + ZeroVector(x); // initialize x to zero + + int ierr = 0; + if (A.mgData!=0) { // Go to next coarse level if defined + int numberOfPresmootherSteps = A.mgData->numberOfPresmootherSteps; + for (int i=0; i< numberOfPresmootherSteps; ++i) ierr += ComputeSYMGS_ref(A, r, x); + if (ierr!=0) return(ierr); + ierr = ComputeSPMV_ref(A, x, *A.mgData->Axf); if (ierr!=0) return(ierr); + // Perform restriction operation using simple injection + ierr = ComputeRestriction_ref(A, r); if (ierr!=0) return(ierr); + ierr = ComputeMG_ref(*A.Ac,*A.mgData->rc, *A.mgData->xc); if (ierr!=0) return(ierr); + ierr = ComputeProlongation_ref(A, x); if (ierr!=0) return(ierr); + int numberOfPostsmootherSteps = A.mgData->numberOfPostsmootherSteps; + for (int i=0; i< numberOfPostsmootherSteps; ++i) ierr += ComputeSYMGS_ref(A, r, x); + if (ierr!=0) return(ierr); + } + else { + ierr = ComputeSYMGS_ref(A, r, x); + if (ierr!=0) return(ierr); + } + return(0); +} + diff --git a/tests/apps/hpcg/src/ComputeMG_ref.hpp b/tests/apps/hpcg/src/ComputeMG_ref.hpp new file mode 100644 index 0000000000..97028b5f61 --- /dev/null +++ b/tests/apps/hpcg/src/ComputeMG_ref.hpp @@ -0,0 +1,22 @@ + +//@HEADER +// *************************************************** +// +// HPCG: High Performance Conjugate Gradient Benchmark +// +// Contact: +// Michael A. Heroux ( maherou@sandia.gov) +// Jack Dongarra (dongarra@eecs.utk.edu) +// Piotr Luszczek (luszczek@eecs.utk.edu) +// +// *************************************************** +//@HEADER + +#ifndef COMPUTEMG_REF_HPP +#define COMPUTEMG_REF_HPP +#include "SparseMatrix.hpp" +#include "Vector.hpp" + +int ComputeMG_ref(const SparseMatrix & A, const Vector & r, Vector & x); + +#endif // COMPUTEMG_REF_HPP diff --git a/tests/apps/hpcg/src/ComputeProlongation_ref.cpp b/tests/apps/hpcg/src/ComputeProlongation_ref.cpp new file mode 100644 index 0000000000..998d99f512 --- /dev/null +++ b/tests/apps/hpcg/src/ComputeProlongation_ref.cpp @@ -0,0 +1,52 @@ + +//@HEADER +// *************************************************** +// +// HPCG: High Performance Conjugate Gradient Benchmark +// +// Contact: +// Michael A. Heroux ( maherou@sandia.gov) +// Jack Dongarra (dongarra@eecs.utk.edu) +// Piotr Luszczek (luszczek@eecs.utk.edu) +// +// *************************************************** +//@HEADER + +/*! + @file ComputeProlongation_ref.cpp + + HPCG routine + */ + +#ifndef HPCG_NOOPENMP +#include // If this routine is not compiled with HPCG_NOOPENMP +#endif + +#include "ComputeProlongation_ref.hpp" + +/*! + Routine to compute the coarse residual vector. + + @param[in] Af - Fine grid sparse matrix object containing pointers to current coarse grid correction and the f2c operator. + @param[inout] xf - Fine grid solution vector, update with coarse grid correction. + + Note that the fine grid residual is never explicitly constructed. + We only compute it for the fine grid points that will be injected into corresponding coarse grid points. + + @return Returns zero on success and a non-zero value otherwise. +*/ +int ComputeProlongation_ref(const SparseMatrix & Af, Vector & xf) { + + double * xfv = xf.values; + double * xcv = Af.mgData->xc->values; + local_int_t * f2c = Af.mgData->f2cOperator; + local_int_t nc = Af.mgData->rc->localLength; + +#ifndef HPCG_NOOPENMP +#pragma omp parallel for +#endif +// TODO: Somehow note that this loop can be safely vectorized since f2c has no repeated indices + for (local_int_t i=0; i // If this routine is not compiled with HPCG_NOMPI +#endif +#ifndef HPCG_NOOPENMP +#include // If this routine is not compiled with HPCG_NOOPENMP +#endif + +#include "Vector.hpp" + +#ifdef HPCG_DETAILED_DEBUG +#include +#include "hpcg.hpp" +#endif + +#include // needed for fabs +#include "ComputeResidual.hpp" +#ifdef HPCG_DETAILED_DEBUG +#include +#endif + +/*! + Routine to compute the inf-norm difference between two vectors where: + + @param[in] n number of vector elements (local to this processor) + @param[in] v1, v2 input vectors + @param[out] residual pointer to scalar value; on exit, will contain result: inf-norm difference + + @return Returns zero on success and a non-zero value otherwise. +*/ +int ComputeResidual(const local_int_t n, const Vector & v1, const Vector & v2, double & residual) { + + double * v1v = v1.values; + double * v2v = v2.values; + double local_residual = 0.0; + +#ifndef HPCG_NOOPENMP + #pragma omp parallel default(none) shared(local_residual, v1v, v2v) + { + double threadlocal_residual = 0.0; + #pragma omp for + for (local_int_t i=0; i threadlocal_residual) threadlocal_residual = diff; + } + #pragma omp critical + { + if (threadlocal_residual>local_residual) local_residual = threadlocal_residual; + } + } +#else // No threading + for (local_int_t i=0; i local_residual) local_residual = diff; +#ifdef HPCG_DETAILED_DEBUG + HPCG_fout << " Computed, exact, diff = " << v1v[i] << " " << v2v[i] << " " << diff << std::endl; +#endif + } +#endif + +#ifndef HPCG_NOMPI + // Use MPI's reduce function to collect all partial sums + double global_residual = 0; + MPI_Allreduce(&local_residual, &global_residual, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); + residual = global_residual; +#else + residual = local_residual; +#endif + + return(0); +} diff --git a/tests/apps/hpcg/src/ComputeResidual.hpp b/tests/apps/hpcg/src/ComputeResidual.hpp new file mode 100644 index 0000000000..524fee02be --- /dev/null +++ b/tests/apps/hpcg/src/ComputeResidual.hpp @@ -0,0 +1,19 @@ + +//@HEADER +// *************************************************** +// +// HPCG: High Performance Conjugate Gradient Benchmark +// +// Contact: +// Michael A. Heroux ( maherou@sandia.gov) +// Jack Dongarra (dongarra@eecs.utk.edu) +// Piotr Luszczek (luszczek@eecs.utk.edu) +// +// *************************************************** +//@HEADER + +#ifndef COMPUTERESIDUAL_HPP +#define COMPUTERESIDUAL_HPP +#include "Vector.hpp" +int ComputeResidual(const local_int_t n, const Vector & v1, const Vector & v2, double & residual); +#endif // COMPUTERESIDUAL_HPP diff --git a/tests/apps/hpcg/src/ComputeRestriction_ref.cpp b/tests/apps/hpcg/src/ComputeRestriction_ref.cpp new file mode 100644 index 0000000000..e920b4142b --- /dev/null +++ b/tests/apps/hpcg/src/ComputeRestriction_ref.cpp @@ -0,0 +1,54 @@ + +//@HEADER +// *************************************************** +// +// HPCG: High Performance Conjugate Gradient Benchmark +// +// Contact: +// Michael A. Heroux ( maherou@sandia.gov) +// Jack Dongarra (dongarra@eecs.utk.edu) +// Piotr Luszczek (luszczek@eecs.utk.edu) +// +// *************************************************** +//@HEADER + +/*! + @file ComputeRestriction_ref.cpp + + HPCG routine + */ + + +#ifndef HPCG_NOOPENMP +#include // If this routine is not compiled with HPCG_NOOPENMP +#endif + +#include "ComputeRestriction_ref.hpp" + +/*! + Routine to compute the coarse residual vector. + + @param[inout] A - Sparse matrix object containing pointers to mgData->Axf, the fine grid matrix-vector product and mgData->rc the coarse residual vector. + @param[in] rf - Fine grid RHS. + + + Note that the fine grid residual is never explicitly constructed. + We only compute it for the fine grid points that will be injected into corresponding coarse grid points. + + @return Returns zero on success and a non-zero value otherwise. +*/ +int ComputeRestriction_ref(const SparseMatrix & A, const Vector & rf) { + + double * Axfv = A.mgData->Axf->values; + double * rfv = rf.values; + double * rcv = A.mgData->rc->values; + local_int_t * f2c = A.mgData->f2cOperator; + local_int_t nc = A.mgData->rc->localLength; + +#ifndef HPCG_NOOPENMP +#pragma omp parallel for +#endif + for (local_int_t i=0; i +#endif +#include + +/*! + Routine to compute matrix vector product y = Ax where: + Precondition: First call exchange_externals to get off-processor values of x + + This is the reference SPMV implementation. It CANNOT be modified for the + purposes of this benchmark. + + @param[in] A the known system matrix + @param[in] x the known vector + @param[out] y the On exit contains the result: Ax. + + @return returns 0 upon success and non-zero otherwise + + @see ComputeSPMV +*/ +int ComputeSPMV_ref( const SparseMatrix & A, Vector & x, Vector & y) { + + assert(x.localLength>=A.localNumberOfColumns); // Test vector lengths + assert(y.localLength>=A.localNumberOfRows); + +#ifndef HPCG_NOMPI + ExchangeHalo(A,x); +#endif + const double * const xv = x.values; + double * const yv = y.values; + const local_int_t nrow = A.localNumberOfRows; +#ifndef HPCG_NOOPENMP + #pragma omp parallel for +#endif + for (local_int_t i=0; i< nrow; i++) { + double sum = 0.0; + const double * const cur_vals = A.matrixValues[i]; + const local_int_t * const cur_inds = A.mtxIndL[i]; + const int cur_nnz = A.nonzerosInRow[i]; + + for (int j=0; j< cur_nnz; j++) + sum += cur_vals[j]*xv[cur_inds[j]]; + yv[i] = sum; + } + return(0); +} diff --git a/tests/apps/hpcg/src/ComputeSPMV_ref.hpp b/tests/apps/hpcg/src/ComputeSPMV_ref.hpp new file mode 100644 index 0000000000..c2f882105a --- /dev/null +++ b/tests/apps/hpcg/src/ComputeSPMV_ref.hpp @@ -0,0 +1,22 @@ + +//@HEADER +// *************************************************** +// +// HPCG: High Performance Conjugate Gradient Benchmark +// +// Contact: +// Michael A. Heroux ( maherou@sandia.gov) +// Jack Dongarra (dongarra@eecs.utk.edu) +// Piotr Luszczek (luszczek@eecs.utk.edu) +// +// *************************************************** +//@HEADER + +#ifndef COMPUTESPMV_REF_HPP +#define COMPUTESPMV_REF_HPP +#include "Vector.hpp" +#include "SparseMatrix.hpp" + +int ComputeSPMV_ref( const SparseMatrix & A, Vector & x, Vector & y); + +#endif // COMPUTESPMV_REF_HPP diff --git a/tests/apps/hpcg/src/ComputeSYMGS.cpp b/tests/apps/hpcg/src/ComputeSYMGS.cpp new file mode 100644 index 0000000000..fb6c3517b5 --- /dev/null +++ b/tests/apps/hpcg/src/ComputeSYMGS.cpp @@ -0,0 +1,53 @@ + +//@HEADER +// *************************************************** +// +// HPCG: High Performance Conjugate Gradient Benchmark +// +// Contact: +// Michael A. Heroux ( maherou@sandia.gov) +// Jack Dongarra (dongarra@eecs.utk.edu) +// Piotr Luszczek (luszczek@eecs.utk.edu) +// +// *************************************************** +//@HEADER + +/*! + @file ComputeSYMGS.cpp + + HPCG routine + */ + +#include "ComputeSYMGS.hpp" +#include "ComputeSYMGS_ref.hpp" + +/*! + Routine to one step of symmetrix Gauss-Seidel: + + Assumption about the structure of matrix A: + - Each row 'i' of the matrix has nonzero diagonal value whose address is matrixDiagonal[i] + - Entries in row 'i' are ordered such that: + - lower triangular terms are stored before the diagonal element. + - upper triangular terms are stored after the diagonal element. + - No other assumptions are made about entry ordering. + + Symmetric Gauss-Seidel notes: + - We use the input vector x as the RHS and start with an initial guess for y of all zeros. + - We perform one forward sweep. Since y is initially zero we can ignore the upper triangular terms of A. + - We then perform one back sweep. + - For simplicity we include the diagonal contribution in the for-j loop, then correct the sum after + + @param[in] A the known system matrix + @param[in] x the input vector + @param[out] y On exit contains the result of one symmetric GS sweep with x as the RHS. + + @return returns 0 upon success and non-zero otherwise + + @see ComputeSYMGS_ref +*/ +int ComputeSYMGS( const SparseMatrix & A, const Vector & x, Vector & y) { + + // This line and the next two lines should be removed and your version of ComputeSYMGS should be used. + return(ComputeSYMGS_ref(A, x, y)); + +} diff --git a/tests/apps/hpcg/src/ComputeSYMGS.hpp b/tests/apps/hpcg/src/ComputeSYMGS.hpp new file mode 100644 index 0000000000..7de18c5fec --- /dev/null +++ b/tests/apps/hpcg/src/ComputeSYMGS.hpp @@ -0,0 +1,22 @@ + +//@HEADER +// *************************************************** +// +// HPCG: High Performance Conjugate Gradient Benchmark +// +// Contact: +// Michael A. Heroux ( maherou@sandia.gov) +// Jack Dongarra (dongarra@eecs.utk.edu) +// Piotr Luszczek (luszczek@eecs.utk.edu) +// +// *************************************************** +//@HEADER + +#ifndef COMPUTESYMGS_HPP +#define COMPUTESYMGS_HPP +#include "SparseMatrix.hpp" +#include "Vector.hpp" + +int ComputeSYMGS( const SparseMatrix & A, const Vector & x, Vector & y); + +#endif // COMPUTESYMGS_HPP diff --git a/tests/apps/hpcg/src/ComputeSYMGS_ref.cpp b/tests/apps/hpcg/src/ComputeSYMGS_ref.cpp new file mode 100644 index 0000000000..275d9afa7a --- /dev/null +++ b/tests/apps/hpcg/src/ComputeSYMGS_ref.cpp @@ -0,0 +1,104 @@ + +//@HEADER +// *************************************************** +// +// HPCG: High Performance Conjugate Gradient Benchmark +// +// Contact: +// Michael A. Heroux ( maherou@sandia.gov) +// Jack Dongarra (dongarra@eecs.utk.edu) +// Piotr Luszczek (luszczek@eecs.utk.edu) +// +// *************************************************** +//@HEADER + +/*! + @file ComputeSYMGS_ref.cpp + + HPCG routine + */ + +#ifndef HPCG_NOMPI +#include "ExchangeHalo.hpp" +#endif +#include "ComputeSYMGS_ref.hpp" +#include + +/*! + Computes one step of symmetric Gauss-Seidel: + + Assumption about the structure of matrix A: + - Each row 'i' of the matrix has nonzero diagonal value whose address is matrixDiagonal[i] + - Entries in row 'i' are ordered such that: + - lower triangular terms are stored before the diagonal element. + - upper triangular terms are stored after the diagonal element. + - No other assumptions are made about entry ordering. + + Symmetric Gauss-Seidel notes: + - We use the input vector x as the RHS and start with an initial guess for y of all zeros. + - We perform one forward sweep. x should be initially zero on the first GS sweep, but we do not attempt to exploit this fact. + - We then perform one back sweep. + - For simplicity we include the diagonal contribution in the for-j loop, then correct the sum after + + @param[in] A the known system matrix + @param[in] r the input vector + @param[inout] x On entry, x should contain relevant values, on exit x contains the result of one symmetric GS sweep with r as the RHS. + + + @warning Early versions of this kernel (Version 1.1 and earlier) had the r and x arguments in reverse order, and out of sync with other kernels. + + @return returns 0 upon success and non-zero otherwise + + @see ComputeSYMGS +*/ +int ComputeSYMGS_ref( const SparseMatrix & A, const Vector & r, Vector & x) { + + assert(x.localLength==A.localNumberOfColumns); // Make sure x contain space for halo values + +#ifndef HPCG_NOMPI + ExchangeHalo(A,x); +#endif + + const local_int_t nrow = A.localNumberOfRows; + double ** matrixDiagonal = A.matrixDiagonal; // An array of pointers to the diagonal entries A.matrixValues + const double * const rv = r.values; + double * const xv = x.values; + + for (local_int_t i=0; i< nrow; i++) { + const double * const currentValues = A.matrixValues[i]; + const local_int_t * const currentColIndices = A.mtxIndL[i]; + const int currentNumberOfNonzeros = A.nonzerosInRow[i]; + const double currentDiagonal = matrixDiagonal[i][0]; // Current diagonal value + double sum = rv[i]; // RHS value + + for (int j=0; j< currentNumberOfNonzeros; j++) { + local_int_t curCol = currentColIndices[j]; + sum -= currentValues[j] * xv[curCol]; + } + sum += xv[i]*currentDiagonal; // Remove diagonal contribution from previous loop + + xv[i] = sum/currentDiagonal; + + } + + // Now the back sweep. + + for (local_int_t i=nrow-1; i>=0; i--) { + const double * const currentValues = A.matrixValues[i]; + const local_int_t * const currentColIndices = A.mtxIndL[i]; + const int currentNumberOfNonzeros = A.nonzerosInRow[i]; + const double currentDiagonal = matrixDiagonal[i][0]; // Current diagonal value + double sum = rv[i]; // RHS value + + for (int j = 0; j< currentNumberOfNonzeros; j++) { + local_int_t curCol = currentColIndices[j]; + sum -= currentValues[j]*xv[curCol]; + } + sum += xv[i]*currentDiagonal; // Remove diagonal contribution from previous loop + + xv[i] = sum/currentDiagonal; + } + + return(0); +} + diff --git a/tests/apps/hpcg/src/ComputeSYMGS_ref.hpp b/tests/apps/hpcg/src/ComputeSYMGS_ref.hpp new file mode 100644 index 0000000000..1ab3ab2568 --- /dev/null +++ b/tests/apps/hpcg/src/ComputeSYMGS_ref.hpp @@ -0,0 +1,22 @@ + +//@HEADER +// *************************************************** +// +// HPCG: High Performance Conjugate Gradient Benchmark +// +// Contact: +// Michael A. Heroux ( maherou@sandia.gov) +// Jack Dongarra (dongarra@eecs.utk.edu) +// Piotr Luszczek (luszczek@eecs.utk.edu) +// +// *************************************************** +//@HEADER + +#ifndef COMPUTESYMGS_REF_HPP +#define COMPUTESYMGS_REF_HPP +#include "SparseMatrix.hpp" +#include "Vector.hpp" + +int ComputeSYMGS_ref( const SparseMatrix & A, const Vector & r, Vector & x); + +#endif // COMPUTESYMGS_REF_HPP diff --git a/tests/apps/hpcg/src/ComputeWAXPBY.cpp b/tests/apps/hpcg/src/ComputeWAXPBY.cpp new file mode 100644 index 0000000000..c531315b2f --- /dev/null +++ b/tests/apps/hpcg/src/ComputeWAXPBY.cpp @@ -0,0 +1,48 @@ + +//@HEADER +// *************************************************** +// +// HPCG: High Performance Conjugate Gradient Benchmark +// +// Contact: +// Michael A. Heroux ( maherou@sandia.gov) +// Jack Dongarra (dongarra@eecs.utk.edu) +// Piotr Luszczek (luszczek@eecs.utk.edu) +// +// *************************************************** +//@HEADER + +/*! + @file ComputeWAXPBY.cpp + + HPCG routine + */ + +#include "ComputeWAXPBY.hpp" +#include "ComputeWAXPBY_ref.hpp" + +/*! + Routine to compute the update of a vector with the sum of two + scaled vectors where: w = alpha*x + beta*y + + This routine calls the reference WAXPBY implementation by default, but + can be replaced by a custom, optimized routine suited for + the target system. + + @param[in] n the number of vector elements (on this processor) + @param[in] alpha, beta the scalars applied to x and y respectively. + @param[in] x, y the input vectors + @param[out] w the output vector + @param[out] isOptimized should be set to false if this routine uses the reference implementation (is not optimized); otherwise leave it unchanged + + @return returns 0 upon success and non-zero otherwise + + @see ComputeWAXPBY_ref +*/ +int ComputeWAXPBY(const local_int_t n, const double alpha, const Vector & x, + const double beta, const Vector & y, Vector & w, bool & isOptimized) { + + // This line and the next two lines should be removed and your version of ComputeWAXPBY should be used. + isOptimized = false; + return(ComputeWAXPBY_ref(n, alpha, x, beta, y, w)); +} diff --git a/tests/apps/hpcg/src/ComputeWAXPBY.hpp b/tests/apps/hpcg/src/ComputeWAXPBY.hpp new file mode 100644 index 0000000000..024ddecc6f --- /dev/null +++ b/tests/apps/hpcg/src/ComputeWAXPBY.hpp @@ -0,0 +1,20 @@ + +//@HEADER +// *************************************************** +// +// HPCG: High Performance Conjugate Gradient Benchmark +// +// Contact: +// Michael A. Heroux ( maherou@sandia.gov) +// Jack Dongarra (dongarra@eecs.utk.edu) +// Piotr Luszczek (luszczek@eecs.utk.edu) +// +// *************************************************** +//@HEADER + +#ifndef COMPUTEWAXPBY_HPP +#define COMPUTEWAXPBY_HPP +#include "Vector.hpp" +int ComputeWAXPBY(const local_int_t n, const double alpha, const Vector & x, + const double beta, const Vector & y, Vector & w, bool & isOptimized); +#endif // COMPUTEWAXPBY_HPP diff --git a/tests/apps/hpcg/src/ComputeWAXPBY_ref.cpp b/tests/apps/hpcg/src/ComputeWAXPBY_ref.cpp new file mode 100644 index 0000000000..a0f8d58994 --- /dev/null +++ b/tests/apps/hpcg/src/ComputeWAXPBY_ref.cpp @@ -0,0 +1,69 @@ + +//@HEADER +// *************************************************** +// +// HPCG: High Performance Conjugate Gradient Benchmark +// +// Contact: +// Michael A. Heroux ( maherou@sandia.gov) +// Jack Dongarra (dongarra@eecs.utk.edu) +// Piotr Luszczek (luszczek@eecs.utk.edu) +// +// *************************************************** +//@HEADER + +/*! + @file ComputeWAXPBY_ref.cpp + + HPCG routine + */ + +#include "ComputeWAXPBY_ref.hpp" +#ifndef HPCG_NOOPENMP +#include +#endif +#include +/*! + Routine to compute the update of a vector with the sum of two + scaled vectors where: w = alpha*x + beta*y + + This is the reference WAXPBY impmentation. It CANNOT be modified for the + purposes of this benchmark. + + @param[in] n the number of vector elements (on this processor) + @param[in] alpha, beta the scalars applied to x and y respectively. + @param[in] x, y the input vectors + @param[out] w the output vector. + + @return returns 0 upon success and non-zero otherwise + + @see ComputeWAXPBY +*/ +int ComputeWAXPBY_ref(const local_int_t n, const double alpha, const Vector & x, + const double beta, const Vector & y, Vector & w) { + + assert(x.localLength>=n); // Test vector lengths + assert(y.localLength>=n); + + const double * const xv = x.values; + const double * const yv = y.values; + double * const wv = w.values; + if (alpha==1.0) { +#ifndef HPCG_NOOPENMP + #pragma omp parallel for +#endif + for (local_int_t i=0; i +#include "Geometry.hpp" +#include "ExchangeHalo.hpp" +#include + +/*! + Communicates data that is at the border of the part of the domain assigned to this processor. + + @param[in] A The known system matrix + @param[inout] x On entry: the local vector entries followed by entries to be communicated; on exit: the vector with non-local entries updated by other processors + */ +void ExchangeHalo(const SparseMatrix & A, Vector & x) { + + // Extract Matrix pieces + + local_int_t localNumberOfRows = A.localNumberOfRows; + int num_neighbors = A.numberOfSendNeighbors; + local_int_t * receiveLength = A.receiveLength; + local_int_t * sendLength = A.sendLength; + int * neighbors = A.neighbors; + double * sendBuffer = A.sendBuffer; + local_int_t totalToBeSent = A.totalToBeSent; + local_int_t * elementsToSend = A.elementsToSend; + + double * const xv = x.values; + + int size, rank; // Number of MPI processes, My process ID + MPI_Comm_size(MPI_COMM_WORLD, &size); + MPI_Comm_rank(MPI_COMM_WORLD, &rank); + + // + // first post receives, these are immediate receives + // Do not wait for result to come, will do that at the + // wait call below. + // + + int MPI_MY_TAG = 99; + + MPI_Request * request = new MPI_Request[num_neighbors]; + + // + // Externals are at end of locals + // + double * x_external = (double *) xv + localNumberOfRows; + + // Post receives first + // TODO: Thread this loop + for (int i = 0; i < num_neighbors; i++) { + local_int_t n_recv = receiveLength[i]; + MPI_Irecv(x_external, n_recv, MPI_DOUBLE, neighbors[i], MPI_MY_TAG, MPI_COMM_WORLD, request+i); + x_external += n_recv; + } + + + // + // Fill up send buffer + // + + // TODO: Thread this loop + for (local_int_t i=0; i +#endif + +#include +#include "GenerateCoarseProblem.hpp" +#include "GenerateGeometry.hpp" +#include "GenerateProblem.hpp" +#include "SetupHalo.hpp" + +/*! + Routine to construct a prolongation/restriction operator for a given fine grid matrix + solution (as computed by a direct solver). + + @param[inout] Af - The known system matrix, on output its coarse operator, fine-to-coarse operator and auxiliary vectors will be defined. + + Note that the matrix Af is considered const because the attributes we are modifying are declared as mutable. + +*/ + +void GenerateCoarseProblem(const SparseMatrix & Af) { + + // Make local copies of geometry information. Use global_int_t since the RHS products in the calculations + // below may result in global range values. + global_int_t nxf = Af.geom->nx; + global_int_t nyf = Af.geom->ny; + global_int_t nzf = Af.geom->nz; + + local_int_t nxc, nyc, nzc; //Coarse nx, ny, nz + assert(nxf%2==0); assert(nyf%2==0); assert(nzf%2==0); // Need fine grid dimensions to be divisible by 2 + nxc = nxf/2; nyc = nyf/2; nzc = nzf/2; + local_int_t * f2cOperator = new local_int_t[Af.localNumberOfRows]; + local_int_t localNumberOfRows = nxc*nyc*nzc; // This is the size of our subblock + // If this assert fails, it most likely means that the local_int_t is set to int and should be set to long long + assert(localNumberOfRows>0); // Throw an exception of the number of rows is less than zero (can happen if int overflow) + + // Use a parallel loop to do initial assignment: + // distributes the physical placement of arrays of pointers across the memory system +#ifndef HPCG_NOOPENMP + #pragma omp parallel for +#endif + for (local_int_t i=0; i< localNumberOfRows; ++i) { + f2cOperator[i] = 0; + } + + + // TODO: This triply nested loop could be flattened or use nested parallelism +#ifndef HPCG_NOOPENMP + #pragma omp parallel for +#endif + for (local_int_t izc=0; izcsize, Af.geom->rank, Af.geom->numThreads, nxc, nyc, nzc, geomc); + + SparseMatrix * Ac = new SparseMatrix; + InitializeSparseMatrix(*Ac, geomc); + GenerateProblem(*Ac, 0, 0, 0); + SetupHalo(*Ac); + Vector *rc = new Vector; + Vector *xc = new Vector; + Vector * Axf = new Vector; + InitializeVector(*rc, Ac->localNumberOfRows); + InitializeVector(*xc, Ac->localNumberOfColumns); + InitializeVector(*Axf, Af.localNumberOfColumns); + Af.Ac = Ac; + MGData * mgData = new MGData; + InitializeMGData(f2cOperator, rc, xc, Axf, *mgData); + Af.mgData = mgData; + + return; +} diff --git a/tests/apps/hpcg/src/GenerateCoarseProblem.hpp b/tests/apps/hpcg/src/GenerateCoarseProblem.hpp new file mode 100644 index 0000000000..9595e94a28 --- /dev/null +++ b/tests/apps/hpcg/src/GenerateCoarseProblem.hpp @@ -0,0 +1,20 @@ + +//@HEADER +// *************************************************** +// +// HPCG: High Performance Conjugate Gradient Benchmark +// +// Contact: +// Michael A. Heroux ( maherou@sandia.gov) +// Jack Dongarra (dongarra@eecs.utk.edu) +// Piotr Luszczek (luszczek@eecs.utk.edu) +// +// *************************************************** +//@HEADER + +#ifndef GENERATECOARSEPROBLEM_HPP +#define GENERATECOARSEPROBLEM_HPP +#include "SparseMatrix.hpp" + +void GenerateCoarseProblem(const SparseMatrix & A); +#endif // GENERATECOARSEPROBLEM_HPP diff --git a/tests/apps/hpcg/src/GenerateGeometry.cpp b/tests/apps/hpcg/src/GenerateGeometry.cpp new file mode 100644 index 0000000000..ce69884203 --- /dev/null +++ b/tests/apps/hpcg/src/GenerateGeometry.cpp @@ -0,0 +1,244 @@ + +//@HEADER +// *************************************************** +// +// HPCG: High Performance Conjugate Gradient Benchmark +// +// Contact: +// Michael A. Heroux ( maherou@sandia.gov) +// Jack Dongarra (dongarra@eecs.utk.edu) +// Piotr Luszczek (luszczek@eecs.utk.edu) +// +// *************************************************** +//@HEADER + +/*! + @file GenerateGeometry.cpp + + HPCG routine + */ + +#include +#include + +#include "GenerateGeometry.hpp" +#ifdef HPCG_DEBUG +#include +#include "hpcg.hpp" +using std::endl; + +#include +#endif + +typedef struct Counter_s { + int length; //!< number of prime factor counts (cannot exceed 32 for a 32-bit integer) + int max_counts[32+1]; //!< maximum value for prime factor counts + int cur_counts[32+1]; //!< current prime factor counts +} Counter; + +static void +Counter_new(Counter * this_, int * counts, int length) { + int i; + + this_->length = length; + + for (i = 0; i < 32; ++i) { + this_->max_counts[i] = counts[i]; + this_->cur_counts[i] = 0; + } + /* terminate with 0's */ + this_->max_counts[i] = this_->cur_counts[i] = 0; + this_->max_counts[length] = this_->cur_counts[length] = 0; +} + +static void +Counter_next(Counter * this_) { + int i; + + for (i = 0; i < this_->length; ++i) { + this_->cur_counts[i]++; + if (this_->cur_counts[i] > this_->max_counts[i]) { + this_->cur_counts[i] = 0; + continue; + } + break; + } +} + +static int +Counter_is_zero(Counter * this_) { + int i; + for (i = 0; i < this_->length; ++i) + if (this_->cur_counts[i]) return 0; + return 1; +} + +static int +Counter_product(Counter * this_, int * multipliers) { + int i, j, k=0, x=1; + + for (i = 0; i < this_->length; ++i) + for (j = 0; j < this_->cur_counts[i]; ++j) { + k = 1; + x *= multipliers[i]; + } + + return x * k; +} + +static void +Counter_max_cur_sub(Counter * this_, Counter * that, Counter * res) { + int i; + + res->length = this_->length; + for (i = 0; i < this_->length; ++i) { + res->max_counts[i] = this_->max_counts[i] - that->cur_counts[i]; + res->cur_counts[i] = 0; + } +} + +static void +primefactor_i(int x, int * factors) { + int i, d, sq=(int)(sqrt((double)x))+1L; + div_t r; + + /* remove 2 as a factor with shifts */ + for (i = 0; x > 1 && (x & 1) == 0; x >>= 1) { + factors[i++] = 2; + } + + /* keep removing subsequent odd numbers */ + for (d = 3; d <= sq; d += 2) { + while (1) { + r = div(x, d); + if (r.rem == 0) { + factors[i++] = d; + x = r.quot; + continue; + } + break; + } + } + if (x > 1 || i == 0) /* left with a prime or x==1 */ + factors[i++] = x; + + factors[i] = 0; /* terminate with 0 */ +} +static void +gen_min_area3(int n, int * f1, int * f2, int * f3) { + int i, j, df_cnt; + int tf1, tf2, tf3; + int factors[32+1], distinct_factors[32+1], count_factors[32+1]; + Counter c_main, c1, c2; + + /* at the beginning, minimum area is the maximum area */ + double area, min_area = 2.0 * n + 1.0; + + primefactor_i( n, factors ); /* factors are sorted: ascending order */ + + if (1 == n || factors[1] == 0) { /* prime number */ + *f1 = n; + *f2 = 1; + *f3 = 1; + return; + } else if (factors[2] == 0) { /* two prime factors */ + *f1 = factors[0]; + *f2 = factors[1]; + *f3 = 1; + return; + } else if (factors[3] == 0) { /* three prime factors */ + *f1 = factors[0]; + *f2 = factors[1]; + *f3 = factors[2]; + return; + } + + /* we have more than 3 prime factors so we need to try all possible combinations */ + + for (j = 0, i = 0; factors[i];) { + distinct_factors[j++] = factors[i]; + count_factors[j-1] = 0; + do { + count_factors[j-1]++; + } while (distinct_factors[j-1] == factors[++i]); + } + df_cnt = j; + + Counter_new( &c_main, count_factors, df_cnt ); + + Counter_new( &c1, count_factors, df_cnt ); + + for (Counter_next( &c1 ); ! Counter_is_zero( &c1 ); Counter_next( &c1 )) { + + Counter_max_cur_sub( &c_main, &c1, &c2 ); + for (Counter_next( &c2 ); ! Counter_is_zero( &c2 ); Counter_next( &c2 )) { + tf1 = Counter_product( &c1, distinct_factors ); + tf2 = Counter_product( &c2, distinct_factors ); + tf3 = n / tf1/ tf2; + + area = tf1 * (double)tf2 + tf2 * (double)tf3 + tf1 * (double)tf3; + if (area < min_area) { + min_area = area; + *f1 = tf1; + *f2 = tf2; + *f3 = tf3; + } + } + } +} + +/*! + Computes the factorization of the total number of processes into a + 3-dimensional process grid that is as close as possible to a cube. The + quality of the factorization depends on the prime number structure of the + total number of processes. It then stores this decompostion together with the + parallel parameters of the run in the geometry data structure. + + @param[in] size total number of MPI processes + @param[in] rank this process' rank among other MPI processes + @param[in] numThreads number of OpenMP threads in this process + @param[in] nx, ny, nz number of grid points for each local block in the x, y, and z dimensions, respectively + @param[out] geom data structure that will store the above parameters and the factoring of total number of processes into three dimensions +*/ +void GenerateGeometry(int size, int rank, int numThreads, int nx, int ny, int nz, Geometry * geom) { + + int npx, npy, npz; + + gen_min_area3( size, &npx, &npy, &npz ); + + // Now compute this process's indices in the 3D cube + int ipz = rank/(npx*npy); + int ipy = (rank-ipz*npx*npy)/npx; + int ipx = rank%npx; + +#ifdef HPCG_DEBUG + if (rank==0) + HPCG_fout << "size = "<< size << endl + << "nx = " << nx << endl + << "ny = " << ny << endl + << "nz = " << nz << endl + << "npx = " << npx << endl + << "npy = " << npy << endl + << "npz = " << npz << endl; + + HPCG_fout << "For rank = " << rank << endl + << "ipx = " << ipx << endl + << "ipy = " << ipy << endl + << "ipz = " << ipz << endl; + + assert(size==npx*npy*npz); +#endif + geom->size = size; + geom->rank = rank; + geom->numThreads = numThreads; + geom->nx = nx; + geom->ny = ny; + geom->nz = nz; + geom->npx = npx; + geom->npy = npy; + geom->npz = npz; + geom->ipx = ipx; + geom->ipy = ipy; + geom->ipz = ipz; + return; +} diff --git a/tests/apps/hpcg/src/GenerateGeometry.hpp b/tests/apps/hpcg/src/GenerateGeometry.hpp new file mode 100644 index 0000000000..e2f98e5d1b --- /dev/null +++ b/tests/apps/hpcg/src/GenerateGeometry.hpp @@ -0,0 +1,19 @@ + +//@HEADER +// *************************************************** +// +// HPCG: High Performance Conjugate Gradient Benchmark +// +// Contact: +// Michael A. Heroux ( maherou@sandia.gov) +// Jack Dongarra (dongarra@eecs.utk.edu) +// Piotr Luszczek (luszczek@eecs.utk.edu) +// +// *************************************************** +//@HEADER + +#ifndef GENERATEGEOMETRY_HPP +#define GENERATEGEOMETRY_HPP +#include "Geometry.hpp" +void GenerateGeometry(int size, int rank, int numThreads, int nx, int ny, int nz, Geometry * geom); +#endif // GENERATEGEOMETRY_HPP diff --git a/tests/apps/hpcg/src/GenerateProblem.cpp b/tests/apps/hpcg/src/GenerateProblem.cpp new file mode 100644 index 0000000000..037a920ec2 --- /dev/null +++ b/tests/apps/hpcg/src/GenerateProblem.cpp @@ -0,0 +1,210 @@ + +//@HEADER +// *************************************************** +// +// HPCG: High Performance Conjugate Gradient Benchmark +// +// Contact: +// Michael A. Heroux ( maherou@sandia.gov) +// Jack Dongarra (dongarra@eecs.utk.edu) +// Piotr Luszczek (luszczek@eecs.utk.edu) +// +// *************************************************** +//@HEADER + +/*! + @file GenerateProblem.cpp + + HPCG routine + */ + +#ifndef HPCG_NOMPI +#include +#endif + +#ifndef HPCG_NOOPENMP +#include +#endif + +#if defined(HPCG_DEBUG) || defined(HPCG_DETAILED_DEBUG) +#include +using std::endl; +#include "hpcg.hpp" +#endif +#include + +#include "GenerateProblem.hpp" + + +/*! + Routine to read a sparse matrix, right hand side, initial guess, and exact + solution (as computed by a direct solver). + + @param[in] geom data structure that stores the parallel run parameters and the factoring of total number of processes into three dimensional grid + @param[in] A The known system matrix + @param[inout] b The newly allocated and generated right hand side vector (if b!=0 on entry) + @param[inout] x The newly allocated solution vector with entries set to 0.0 (if x!=0 on entry) + @param[inout] xexact The newly allocated solution vector with entries set to the exact solution (if the xexact!=0 non-zero on entry) + + @see GenerateGeometry +*/ + +void GenerateProblem(SparseMatrix & A, Vector * b, Vector * x, Vector * xexact) { + + // Make local copies of geometry information. Use global_int_t since the RHS products in the calculations + // below may result in global range values. + global_int_t nx = A.geom->nx; + global_int_t ny = A.geom->ny; + global_int_t nz = A.geom->nz; + global_int_t npx = A.geom->npx; + global_int_t npy = A.geom->npy; + global_int_t npz = A.geom->npz; + global_int_t ipx = A.geom->ipx; + global_int_t ipy = A.geom->ipy; + global_int_t ipz = A.geom->ipz; + global_int_t gnx = nx*npx; + global_int_t gny = ny*npy; + global_int_t gnz = nz*npz; + + local_int_t localNumberOfRows = nx*ny*nz; // This is the size of our subblock + // If this assert fails, it most likely means that the local_int_t is set to int and should be set to long long + assert(localNumberOfRows>0); // Throw an exception of the number of rows is less than zero (can happen if int overflow) + local_int_t numberOfNonzerosPerRow = 27; // We are approximating a 27-point finite element/volume/difference 3D stencil + + global_int_t totalNumberOfRows = ((global_int_t) localNumberOfRows)*((global_int_t) A.geom->size); // Total number of grid points in mesh + // If this assert fails, it most likely means that the global_int_t is set to int and should be set to long long + assert(totalNumberOfRows>0); // Throw an exception of the number of rows is less than zero (can happen if int overflow) + + + // Allocate arrays that are of length localNumberOfRows + char * nonzerosInRow = new char[localNumberOfRows]; + global_int_t ** mtxIndG = new global_int_t*[localNumberOfRows]; + local_int_t ** mtxIndL = new local_int_t*[localNumberOfRows]; + double ** matrixValues = new double*[localNumberOfRows]; + double ** matrixDiagonal = new double*[localNumberOfRows]; + + if (b!=0) InitializeVector(*b, localNumberOfRows); + if (x!=0) InitializeVector(*x, localNumberOfRows); + if (xexact!=0) InitializeVector(*xexact, localNumberOfRows); + double * bv = 0; + double * xv = 0; + double * xexactv = 0; + if (b!=0) bv = b->values; // Only compute exact solution if requested + if (x!=0) xv = x->values; // Only compute exact solution if requested + if (xexact!=0) xexactv = xexact->values; // Only compute exact solution if requested + A.localToGlobalMap.resize(localNumberOfRows); + + // Use a parallel loop to do initial assignment: + // distributes the physical placement of arrays of pointers across the memory system +#ifndef HPCG_NOOPENMP + #pragma omp parallel for +#endif + for (local_int_t i=0; i< localNumberOfRows; ++i) { + matrixValues[i] = 0; + matrixDiagonal[i] = 0; + mtxIndG[i] = 0; + mtxIndL[i] = 0; + } + // Now allocate the arrays pointed to + for (local_int_t i=0; i< localNumberOfRows; ++i) { + mtxIndL[i] = new local_int_t[numberOfNonzerosPerRow]; + matrixValues[i] = new double[numberOfNonzerosPerRow]; + mtxIndG[i] = new global_int_t[numberOfNonzerosPerRow]; + } + + + + local_int_t localNumberOfNonzeros = 0; + // TODO: This triply nested loop could be flattened or use nested parallelism +#ifndef HPCG_NOOPENMP + #pragma omp parallel for +#endif + for (local_int_t iz=0; iz-1 && giz+sz-1 && giy+sy-1 && gix+sxrank << " of " << A.geom->size <<" has " << localNumberOfRows << " rows." << endl + << "Process " << A.geom->rank << " of " << A.geom->size <<" has " << localNumberOfNonzeros<< " nonzeros." <0); // Throw an exception of the number of nonzeros is less than zero (can happen if int overflow) + + A.title = 0; + A.totalNumberOfRows = totalNumberOfRows; + A.totalNumberOfNonzeros = totalNumberOfNonzeros; + A.localNumberOfRows = localNumberOfRows; + A.localNumberOfColumns = localNumberOfRows; + A.localNumberOfNonzeros = localNumberOfNonzeros; + A.nonzerosInRow = nonzerosInRow; + A.mtxIndG = mtxIndG; + A.mtxIndL = mtxIndL; + A.matrixValues = matrixValues; + A.matrixDiagonal = matrixDiagonal; + + return; +} diff --git a/tests/apps/hpcg/src/GenerateProblem.hpp b/tests/apps/hpcg/src/GenerateProblem.hpp new file mode 100644 index 0000000000..5f11023c33 --- /dev/null +++ b/tests/apps/hpcg/src/GenerateProblem.hpp @@ -0,0 +1,22 @@ + +//@HEADER +// *************************************************** +// +// HPCG: High Performance Conjugate Gradient Benchmark +// +// Contact: +// Michael A. Heroux ( maherou@sandia.gov) +// Jack Dongarra (dongarra@eecs.utk.edu) +// Piotr Luszczek (luszczek@eecs.utk.edu) +// +// *************************************************** +//@HEADER + +#ifndef GENERATEPROBLEM_HPP +#define GENERATEPROBLEM_HPP +#include "Geometry.hpp" +#include "SparseMatrix.hpp" +#include "Vector.hpp" + +void GenerateProblem(SparseMatrix & A, Vector * b, Vector * x, Vector * xexact); +#endif // GENERATEPROBLEM_HPP diff --git a/tests/apps/hpcg/src/Geometry.hpp b/tests/apps/hpcg/src/Geometry.hpp new file mode 100644 index 0000000000..9745afa99f --- /dev/null +++ b/tests/apps/hpcg/src/Geometry.hpp @@ -0,0 +1,88 @@ + +//@HEADER +// *************************************************** +// +// HPCG: High Performance Conjugate Gradient Benchmark +// +// Contact: +// Michael A. Heroux ( maherou@sandia.gov) +// Jack Dongarra (dongarra@eecs.utk.edu) +// Piotr Luszczek (luszczek@eecs.utk.edu) +// +// *************************************************** +//@HEADER + +/*! + @file Geometry.hpp + + HPCG data structure for problem geometry + */ + +#ifndef GEOMETRY_HPP +#define GEOMETRY_HPP + +/*! + This defines the type for integers that have local subdomain dimension. + + Define as "long long" when local problem dimension is > 2^31 +*/ +typedef int local_int_t; +//typedef long long local_int_t; + +/*! + This defines the type for integers that have global dimension + + Define as "long long" when global problem dimension is > 2^31 +*/ +//typedef int global_int_t; +typedef long long global_int_t; + +// This macro should be defined if the global_int_t is not long long +// in order to stop complaints from non-C++11 compliant compilers. +//#define HPCG_NO_LONG_LONG + +/*! + This is a data structure to contain all processor geometry information +*/ +struct Geometry_STRUCT { + int size; //!< Number of MPI processes + int rank; //!< This process' rank in the range [0 to size - 1] + int numThreads; //!< This process' number of threads + int nx; //!< Number of x-direction grid points for each local subdomain + int ny; //!< Number of y-direction grid points for each local subdomain + int nz; //!< Number of z-direction grid points for each local subdomain + int npx; //!< Number of processors in x-direction + int npy; //!< Number of processors in y-direction + int npz; //!< Number of processors in z-direction + int ipx; //!< Current rank's x location in the npx by npy by npz processor grid + int ipy; //!< Current rank's y location in the npx by npy by npz processor grid + int ipz; //!< Current rank's z location in the npx by npy by npz processor grid + +}; +typedef struct Geometry_STRUCT Geometry; + +/*! + Returns the rank of the MPI process that is assigned the global row index + given as the input argument. + + @param[in] geom The description of the problem's geometry. + @param[in] index The global row index + + @return Returns the MPI rank of the process assigned the row +*/ +inline int ComputeRankOfMatrixRow(const Geometry & geom, global_int_t index) { + global_int_t gnx = geom.nx*geom.npx; + global_int_t gny = geom.ny*geom.npy; + + global_int_t iz = index/(gny*gnx); + global_int_t iy = (index-iz*gny*gnx)/gnx; + global_int_t ix = index%gnx; + global_int_t ipz = iz/geom.nz; + global_int_t ipy = iy/geom.ny; + global_int_t ipx = ix/geom.nx; + int rank = ipx+ipy*geom.npx+ipz*geom.npy*geom.npx; + return(rank); +} + + +#endif // GEOMETRY_HPP diff --git a/tests/apps/hpcg/src/MGData.hpp b/tests/apps/hpcg/src/MGData.hpp new file mode 100644 index 0000000000..ece8a6547b --- /dev/null +++ b/tests/apps/hpcg/src/MGData.hpp @@ -0,0 +1,78 @@ + +//@HEADER +// *************************************************** +// +// HPCG: High Performance Conjugate Gradient Benchmark +// +// Contact: +// Michael A. Heroux ( maherou@sandia.gov) +// Jack Dongarra (dongarra@eecs.utk.edu) +// Piotr Luszczek (luszczek@eecs.utk.edu) +// +// *************************************************** +//@HEADER + +/*! + @file MGData.hpp + + HPCG data structure + */ + +#ifndef MGDATA_HPP +#define MGDATA_HPP + +#include +#include "SparseMatrix.hpp" +#include "Vector.hpp" + +struct MGData_STRUCT { + int numberOfPresmootherSteps; // Call ComputeSYMGS this many times prior to coarsening + int numberOfPostsmootherSteps; // Call ComputeSYMGS this many times after coarsening + local_int_t * f2cOperator; //!< 1D array containing the fine operator local IDs that will be injected into coarse space. + Vector * rc; // coarse grid residual vector + Vector * xc; // coarse grid solution vector + Vector * Axf; // fine grid residual vector + /*! + This is for storing optimized data structres created in OptimizeProblem and + used inside optimized ComputeSPMV(). + */ + void * optimizationData; +}; +typedef struct MGData_STRUCT MGData; + +/*! + Constructor for the data structure of CG vectors. + + @param[in] Ac - Fully-formed coarse matrix + @param[in] f2cOperator - + @param[out] data the data structure for CG vectors that will be allocated to get it ready for use in CG iterations + */ +inline void InitializeMGData(local_int_t * f2cOperator, Vector * rc, Vector * xc, Vector * Axf, MGData & data) { + data.numberOfPresmootherSteps = 1; + data.numberOfPostsmootherSteps = 1; + data.f2cOperator = f2cOperator; // Space for injection operator + data.rc = rc; + data.xc = xc; + data.Axf = Axf; + return; +} + +/*! + Destructor for the CG vectors data. + + @param[inout] data the MG data structure whose storage is deallocated + */ +inline void DeleteMGData(MGData & data) { + + delete [] data.f2cOperator; + DeleteVector(*data.Axf); + DeleteVector(*data.rc); + DeleteVector(*data.xc); + delete data.Axf; + delete data.rc; + delete data.xc; + return; +} + +#endif // MGDATA_HPP + diff --git a/tests/apps/hpcg/src/OptimizeProblem.cpp b/tests/apps/hpcg/src/OptimizeProblem.cpp new file mode 100644 index 0000000000..f2b9e37dc9 --- /dev/null +++ b/tests/apps/hpcg/src/OptimizeProblem.cpp @@ -0,0 +1,43 @@ + +//@HEADER +// *************************************************** +// +// HPCG: High Performance Conjugate Gradient Benchmark +// +// Contact: +// Michael A. Heroux ( maherou@sandia.gov) +// Jack Dongarra (dongarra@eecs.utk.edu) +// Piotr Luszczek (luszczek@eecs.utk.edu) +// +// *************************************************** +//@HEADER + +/*! + @file OptimizeProblem.cpp + + HPCG routine + */ + +#include "OptimizeProblem.hpp" +/*! + Optimizes the data structures used for CG iteration to increase the + performance of the benchmark version of the preconditioned CG algorithm. + + @param[inout] A The known system matrix, also contains the MG hierarchy in attributes Ac and mgData. + @param[inout] data The data structure with all necessary CG vectors preallocated + @param[inout] b The known right hand side vector + @param[inout] x The solution vector to be computed in future CG iteration + @param[inout] xexact The exact solution vector + + @return returns 0 upon success and non-zero otherwise + + @see GenerateGeometry + @see GenerateProblem +*/ +int OptimizeProblem(SparseMatrix & A, CGData & data, Vector & b, Vector & x, Vector & xexact) { + +// This function can be used to completely transform any part of the data structures. +// Right now it does nothing, so compiling with a check for unused variables results in complaints + + return(0); +} diff --git a/tests/apps/hpcg/src/OptimizeProblem.hpp b/tests/apps/hpcg/src/OptimizeProblem.hpp new file mode 100644 index 0000000000..d8d23407ff --- /dev/null +++ b/tests/apps/hpcg/src/OptimizeProblem.hpp @@ -0,0 +1,24 @@ + +//@HEADER +// *************************************************** +// +// HPCG: High Performance Conjugate Gradient Benchmark +// +// Contact: +// Michael A. Heroux ( maherou@sandia.gov) +// Jack Dongarra (dongarra@eecs.utk.edu) +// Piotr Luszczek (luszczek@eecs.utk.edu) +// +// *************************************************** +//@HEADER + +#ifndef OPTIMIZEPROBLEM_HPP +#define OPTIMIZEPROBLEM_HPP + +#include "SparseMatrix.hpp" +#include "Vector.hpp" +#include "CGData.hpp" + +int OptimizeProblem(SparseMatrix & A, CGData & data, Vector & b, Vector & x, Vector & xexact); + +#endif // OPTIMIZEPROBLEM_HPP diff --git a/tests/apps/hpcg/src/ReadHpcgDat.cpp b/tests/apps/hpcg/src/ReadHpcgDat.cpp new file mode 100644 index 0000000000..d4dab27962 --- /dev/null +++ b/tests/apps/hpcg/src/ReadHpcgDat.cpp @@ -0,0 +1,64 @@ + +//@HEADER +// *************************************************** +// +// HPCG: High Performance Conjugate Gradient Benchmark +// +// Contact: +// Michael A. Heroux ( maherou@sandia.gov) +// Jack Dongarra (dongarra@eecs.utk.edu) +// Piotr Luszczek (luszczek@eecs.utk.edu) +// +// *************************************************** +//@HEADER + +#include + +#include "ReadHpcgDat.hpp" + +static int +SkipUntilEol(FILE *stream) { + int chOrEof; + bool finished; + + do { + chOrEof = fgetc( stream ); + finished = (chOrEof == EOF) || (chOrEof == '\n') || (chOrEof == '\r'); + } while (! finished); + + if ('\r' == chOrEof) { // on Windows, \r might be followed by \n + int chOrEofExtra = fgetc( stream ); + + if ('\n' == chOrEofExtra || EOF == chOrEofExtra) + chOrEof = chOrEofExtra; + else + ungetc(chOrEofExtra, stream); + } + + return chOrEof; +} + +int +ReadHpcgDat(int *localDimensions, int *secondsPerRun) { + FILE * hpcgStream = fopen("hpcg.dat", "r"); + + if (! hpcgStream) + return -1; + + SkipUntilEol(hpcgStream); // skip the first line + + SkipUntilEol(hpcgStream); // skip the second line + + for (int i = 0; i < 3; ++i) + if (fscanf(hpcgStream, "%d", localDimensions+i) != 1 || localDimensions[i] < 10) + localDimensions[i] = 10; + + SkipUntilEol( hpcgStream ); // skip the rest of the second line + + if (fscanf(hpcgStream, "%d", secondsPerRun) != 1 || secondsPerRun[0] < 1) + secondsPerRun[0] = 30 * 60; // 30 minutes + + fclose(hpcgStream); + + return 0; +} diff --git a/tests/apps/hpcg/src/ReadHpcgDat.hpp b/tests/apps/hpcg/src/ReadHpcgDat.hpp new file mode 100644 index 0000000000..5f289cedfd --- /dev/null +++ b/tests/apps/hpcg/src/ReadHpcgDat.hpp @@ -0,0 +1,20 @@ + +//@HEADER +// *************************************************** +// +// HPCG: High Performance Conjugate Gradient Benchmark +// +// Contact: +// Michael A. Heroux ( maherou@sandia.gov) +// Jack Dongarra (dongarra@eecs.utk.edu) +// Piotr Luszczek (luszczek@eecs.utk.edu) +// +// *************************************************** +//@HEADER + +#ifndef READHPCGDAT_HPP +#define READHPCGDAT_HPP + +int ReadHpcgDat(int *localDimensions, int *secondsPerRun); + +#endif // READHPCGDAT_HPP diff --git a/tests/apps/hpcg/src/ReportResults.cpp b/tests/apps/hpcg/src/ReportResults.cpp new file mode 100644 index 0000000000..6f35524587 --- /dev/null +++ b/tests/apps/hpcg/src/ReportResults.cpp @@ -0,0 +1,266 @@ + +//@HEADER +// *************************************************** +// +// HPCG: High Performance Conjugate Gradient Benchmark +// +// Contact: +// Michael A. Heroux ( maherou@sandia.gov) +// Jack Dongarra (dongarra@eecs.utk.edu) +// Piotr Luszczek (luszczek@eecs.utk.edu) +// +// *************************************************** +//@HEADER + +/*! + @file ReportResults.cpp + + HPCG routine + */ + +#ifndef HPCG_NOMPI +#include // If this routine is not compiled with HPCG_NOMPI +#endif + +#include "ReportResults.hpp" +#include "YAML_Element.hpp" +#include "YAML_Doc.hpp" + +#ifdef HPCG_DEBUG +#include +using std::endl; + +#include "hpcg.hpp" +#endif + +/*! + Creates a YAML file and writes the information about the HPCG run, its results, and validity. + + @param[in] geom The description of the problem's geometry. + @param[in] A The known system matrix + @param[in] numberOfMgLevels Number of levels in multigrid V cycle + @param[in] numberOfCgSets Number of CG runs performed + @param[in] niters Number of preconditioned CG iterations performed to lower the residual below a threshold + @param[in] times Vector of cumulative timings for each of the phases of a preconditioned CG iteration + @param[in] testcg_data the data structure with the results of the CG-correctness test including pass/fail information + @param[in] testsymmetry_data the data structure with the results of the CG symmetry test including pass/fail information + @param[in] testnorms_data the data structure with the results of the CG norm test including pass/fail information + @param[in] global_failure indicates whether a failure occured during the correctness tests of CG + + @see YAML_Doc +*/ +void ReportResults(const SparseMatrix & A, int numberOfMgLevels, int numberOfCgSets, int refMaxIters,int optMaxIters, double times[], + const TestCGData & testcg_data, const TestSymmetryData & testsymmetry_data, const TestNormsData & testnorms_data, int global_failure) { + + double minOfficialTime = 3600; // Any official benchmark result much run at least this many seconds + +#ifndef HPCG_NOMPI + double t4 = times[4]; + double t4min = 0.0; + double t4max = 0.0; + double t4avg = 0.0; + MPI_Allreduce(&t4, &t4min, 1, MPI_DOUBLE, MPI_MIN, MPI_COMM_WORLD); + MPI_Allreduce(&t4, &t4max, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); + MPI_Allreduce(&t4, &t4avg, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + t4avg = t4avg/((double) A.geom->size); +#endif + + // initialize YAML doc + + if (A.geom->rank==0) { // Only PE 0 needs to compute and report timing results + + double fNumberOfCgSets = numberOfCgSets; + double fniters = fNumberOfCgSets * (double) optMaxIters; + double fnrow = A.totalNumberOfRows; + double fnnz = A.totalNumberOfNonzeros; + + // Op counts come from implementation of CG in CG.cpp (include 1 extra for the CG preamble ops) + double fnops_ddot = (3.0*fniters+fNumberOfCgSets)*2.0*fnrow; // 3 ddots with nrow adds and nrow mults + double fnops_waxpby = (3.0*fniters+fNumberOfCgSets)*2.0*fnrow; // 3 WAXPBYs with nrow adds and nrow mults + double fnops_sparsemv = (fniters+fNumberOfCgSets)*2.0*fnnz; // 1 SpMV with nnz adds and nnz mults + // Op counts from the multigrid preconditioners + double fnops_precond = 0.0; + const SparseMatrix * Af = &A; + for (int i=1; itotalNumberOfNonzeros; + double fnumberOfPresmootherSteps = Af->mgData->numberOfPresmootherSteps; + double fnumberOfPostsmootherSteps = Af->mgData->numberOfPostsmootherSteps; + fnops_precond += fnumberOfPresmootherSteps*fniters*4.0*fnnz_Af; // number of presmoother flops + fnops_precond += fniters*2.0*fnnz_Af; // cost of fine grid residual calculation + fnops_precond += fnumberOfPostsmootherSteps*fniters*4.0*fnnz_Af; // number of postsmoother flops + Af = Af->Ac; // Go to next coarse level + } + + fnops_precond += fniters*4.0*((double) Af->totalNumberOfNonzeros); // One symmetric GS sweep at the coarsest level + double fnops = fnops_ddot+fnops_waxpby+fnops_sparsemv+fnops_precond; + double reffnops = fnops * ((double) refMaxIters)/((double) optMaxIters); + + YAML_Doc doc("HPCG-Benchmark", "2.4"); + doc.add("HPCG Benchmark","Version 2.4 June 3, 2014"); + + doc.add("Machine Summary",""); + doc.get("Machine Summary")->add("Distributed Processes",A.geom->size); + doc.get("Machine Summary")->add("Threads per processes",A.geom->numThreads); + + doc.add("Global Problem Dimensions",""); + doc.get("Global Problem Dimensions")->add("Global nx",A.geom->npx*A.geom->nx); + doc.get("Global Problem Dimensions")->add("Global ny",A.geom->npy*A.geom->ny); + doc.get("Global Problem Dimensions")->add("Global nz",A.geom->npz*A.geom->nz); + + doc.add("Processor Dimensions",""); + doc.get("Processor Dimensions")->add("npx",A.geom->npx); + doc.get("Processor Dimensions")->add("npy",A.geom->npy); + doc.get("Processor Dimensions")->add("npz",A.geom->npz); + + doc.add("Local Domain Dimensions",""); + doc.get("Local Domain Dimensions")->add("nx",A.geom->nx); + doc.get("Local Domain Dimensions")->add("ny",A.geom->ny); + doc.get("Local Domain Dimensions")->add("nz",A.geom->nz); + + doc.add("********** Problem Summary ***********",""); + + doc.add("Linear System Information",""); + doc.get("Linear System Information")->add("Number of Equations",A.totalNumberOfRows); + doc.get("Linear System Information")->add("Number of Nonzero Terms",A.totalNumberOfNonzeros); + + doc.add("Multigrid Information",""); + doc.get("Multigrid Information")->add("Number of coarse grid levels", numberOfMgLevels-1); + Af = &A; + doc.get("Multigrid Information")->add("Coarse Grids",""); + for (int i=1; iget("Coarse Grids")->add("Grid Level",i); + doc.get("Multigrid Information")->get("Coarse Grids")->add("Number of Equations",Af->Ac->totalNumberOfRows); + doc.get("Multigrid Information")->get("Coarse Grids")->add("Number of Nonzero Terms",Af->Ac->totalNumberOfNonzeros); + doc.get("Multigrid Information")->get("Coarse Grids")->add("Number of Presmoother Steps",Af->mgData->numberOfPresmootherSteps); + doc.get("Multigrid Information")->get("Coarse Grids")->add("Number of Postsmoother Steps",Af->mgData->numberOfPostsmootherSteps); + Af = Af->Ac; + } + + doc.add("********** Validation Testing Summary ***********",""); + doc.add("Spectral Convergence Tests",""); + if (testcg_data.count_fail==0) + doc.get("Spectral Convergence Tests")->add("Result", "PASSED"); + else + doc.get("Spectral Convergence Tests")->add("Result", "FAILED"); + doc.get("Spectral Convergence Tests")->add("Unpreconditioned",""); + doc.get("Spectral Convergence Tests")->get("Unpreconditioned")->add("Maximum iteration count", testcg_data.niters_max_no_prec); + doc.get("Spectral Convergence Tests")->get("Unpreconditioned")->add("Expected iteration count", testcg_data.expected_niters_no_prec); + doc.get("Spectral Convergence Tests")->add("Preconditioned",""); + doc.get("Spectral Convergence Tests")->get("Preconditioned")->add("Maximum iteration count", testcg_data.niters_max_prec); + doc.get("Spectral Convergence Tests")->get("Preconditioned")->add("Expected iteration count", testcg_data.expected_niters_prec); + + const char DepartureFromSymmetry[] = "Departure from Symmetry |x'Ay-y'Ax|/(2*||x||*||A||*||y||)/epsilon"; + doc.add(DepartureFromSymmetry,""); + if (testsymmetry_data.count_fail==0) + doc.get(DepartureFromSymmetry)->add("Result", "PASSED"); + else + doc.get(DepartureFromSymmetry)->add("Result", "FAILED"); + doc.get(DepartureFromSymmetry)->add("Departure for SpMV", testsymmetry_data.depsym_spmv); + doc.get(DepartureFromSymmetry)->add("Departure for MG", testsymmetry_data.depsym_mg); + + doc.add("********** Iterations Summary ***********",""); + doc.add("Iteration Count Information",""); + if (!global_failure) + doc.get("Iteration Count Information")->add("Result", "PASSED"); + else + doc.get("Iteration Count Information")->add("Result", "FAILED"); + doc.get("Iteration Count Information")->add("Reference CG iterations per set", refMaxIters); + doc.get("Iteration Count Information")->add("Optimized CG iterations per set", optMaxIters); + doc.get("Iteration Count Information")->add("Total number of reference iterations", refMaxIters*numberOfCgSets); + doc.get("Iteration Count Information")->add("Total number of optimized iterations", optMaxIters*numberOfCgSets); + + doc.add("********** Reproducibility Summary ***********",""); + doc.add("Reproducibility Information",""); + if (testnorms_data.pass) + doc.get("Reproducibility Information")->add("Result", "PASSED"); + else + doc.get("Reproducibility Information")->add("Result", "FAILED"); + doc.get("Reproducibility Information")->add("Scaled residual mean", testnorms_data.mean); + doc.get("Reproducibility Information")->add("Scaled residual variance", testnorms_data.variance); + + doc.add("********** Performance Summary (times in sec) ***********",""); + + doc.add("Benchmark Time Summary",""); + doc.get("Benchmark Time Summary")->add("Optimization phase",times[7]); + doc.get("Benchmark Time Summary")->add("DDOT",times[1]); + doc.get("Benchmark Time Summary")->add("WAXPBY",times[2]); + doc.get("Benchmark Time Summary")->add("SpMV",times[3]); + doc.get("Benchmark Time Summary")->add("MG",times[5]); + doc.get("Benchmark Time Summary")->add("Total",times[0]); + + doc.add("Floating Point Operations Summary",""); + doc.get("Floating Point Operations Summary")->add("Raw DDOT",fnops_ddot); + doc.get("Floating Point Operations Summary")->add("Raw WAXPBY",fnops_waxpby); + doc.get("Floating Point Operations Summary")->add("Raw SpMV",fnops_sparsemv); + doc.get("Floating Point Operations Summary")->add("Raw MG",fnops_precond); + doc.get("Floating Point Operations Summary")->add("Total",fnops); + doc.get("Floating Point Operations Summary")->add("Total with convergence overhead",reffnops); + + doc.add("GFLOP/s Summary",""); + doc.get("GFLOP/s Summary")->add("Raw DDOT",fnops_ddot/times[1]/1.0E9); + doc.get("GFLOP/s Summary")->add("Raw WAXPBY",fnops_waxpby/times[2]/1.0E9); + doc.get("GFLOP/s Summary")->add("Raw SpMV",fnops_sparsemv/(times[3])/1.0E9); + doc.get("GFLOP/s Summary")->add("Raw MG",fnops_precond/(times[5])/1.0E9); + doc.get("GFLOP/s Summary")->add("Raw Total",fnops/times[0]/1.0E9); + doc.get("GFLOP/s Summary")->add("Total with convergence overhead",reffnops/times[0]/1.0E9); + // This final GFLOP/s rating includes the overhead of optimizing the data structures vs ten sets of 50 iterations of CG + double totalGflops = reffnops/(times[0]+fNumberOfCgSets*times[7]/10.0)/1.0E9; + doc.get("GFLOP/s Summary")->add("Total with convergence and optimization phase overhead",totalGflops); + + //double totalSparseMVTime = times[3] + times[6]; + //doc.add("Sparse Operations Overheads",""); + //doc.get("Sparse Operations Overheads")->add("SpMV GFLOP/s with overhead",fnops_sparsemv/(totalSparseMVTime)/1.0E9); + //doc.get("Sparse Operations Overheads")->add("Overhead time (sec)", (times[7]+times[6])); + //doc.get("Sparse Operations Overheads")->add("Overhead as percentage of time", (times[7]+times[6])/totalSparseMVTime*100.0); + doc.add("User Optimization Overheads",""); + doc.get("User Optimization Overheads")->add("Optimization phase time (sec)", (times[7])); + doc.get("User Optimization Overheads")->add("Optimization phase time vs reference SpMV+MG time", times[7]/times[8]); + +#ifndef HPCG_NOMPI + doc.add("DDOT Timing Variations",""); + doc.get("DDOT Timing Variations")->add("Min DDOT MPI_Allreduce time",t4min); + doc.get("DDOT Timing Variations")->add("Max DDOT MPI_Allreduce time",t4max); + doc.get("DDOT Timing Variations")->add("Avg DDOT MPI_Allreduce time",t4avg); + + //doc.get("Sparse Operations Overheads")->add("Halo exchange time (sec)", (times[6])); + //doc.get("Sparse Operations Overheads")->add("Halo exchange as percentage of SpMV time", (times[6])/totalSparseMVTime*100.0); +#endif + doc.add("********** Final Summary **********",""); + bool isValidRun = (testcg_data.count_fail==0) && (testsymmetry_data.count_fail==0) && (testnorms_data.pass) && (!global_failure); + if (isValidRun) { + doc.get("********** Final Summary **********")->add("HPCG result is VALID with a GFLOP/s rating of", totalGflops); + if (!A.isDotProductOptimized) { + doc.get("********** Final Summary **********")->add("Reference version of ComputeDotProduct used","Performance results are most likely suboptimal"); + } + if (!A.isSpmvOptimized) { + doc.get("********** Final Summary **********")->add("Reference version of ComputeSPMV used","Performance results are most likely suboptimal"); + } + if (!A.isMgOptimized) { + if (A.geom->numThreads>1) + doc.get("********** Final Summary **********")->add("Reference version of ComputeMG used and number of threads greater than 1","Performance results are severely suboptimal"); + else // numThreads ==1 + doc.get("********** Final Summary **********")->add("Reference version of ComputeMG used","Performance results are most likely suboptimal"); + } + if (!A.isWaxpbyOptimized) { + doc.get("********** Final Summary **********")->add("Reference version of ComputeWAXPBY used","Performance results are most likely suboptimal"); + } + if (times[0]>=minOfficialTime) { + doc.get("********** Final Summary **********")->add("Please send the YAML file contents to","HPCG-Results@software.sandia.gov"); + } + else { + doc.get("********** Final Summary **********")->add("Results are valid but execution time (sec) is",times[0]); + doc.get("********** Final Summary **********")->add("Official results execution time (sec) must be at least",minOfficialTime); + + } + } else { + doc.get("********** Final Summary **********")->add("HPCG result is","INVALID."); + doc.get("********** Final Summary **********")->add("Please review the YAML file contents","You may NOT submit these results for consideration."); + } + + std::string yaml = doc.generateYAML(); +#ifdef HPCG_DEBUG + HPCG_fout << yaml; +#endif + } + return; +} diff --git a/tests/apps/hpcg/src/ReportResults.hpp b/tests/apps/hpcg/src/ReportResults.hpp new file mode 100644 index 0000000000..b9748ca815 --- /dev/null +++ b/tests/apps/hpcg/src/ReportResults.hpp @@ -0,0 +1,25 @@ + +//@HEADER +// *************************************************** +// +// HPCG: High Performance Conjugate Gradient Benchmark +// +// Contact: +// Michael A. Heroux ( maherou@sandia.gov) +// Jack Dongarra (dongarra@eecs.utk.edu) +// Piotr Luszczek (luszczek@eecs.utk.edu) +// +// *************************************************** +//@HEADER + +#ifndef REPORTRESULTS_HPP +#define REPORTRESULTS_HPP +#include "SparseMatrix.hpp" +#include "TestCG.hpp" +#include "TestSymmetry.hpp" +#include "TestNorms.hpp" + +void ReportResults(const SparseMatrix & A, int numberOfMgLevels, int numberOfCgSets, int refMaxIters, int optMaxIters, double times[], + const TestCGData & testcg_data, const TestSymmetryData & testsymmetry_data, const TestNormsData & testnorms_data, int global_failure); + +#endif // REPORTRESULTS_HPP diff --git a/tests/apps/hpcg/src/SetupHalo.cpp b/tests/apps/hpcg/src/SetupHalo.cpp new file mode 100644 index 0000000000..d2e66dc30a --- /dev/null +++ b/tests/apps/hpcg/src/SetupHalo.cpp @@ -0,0 +1,181 @@ + +//@HEADER +// *************************************************** +// +// HPCG: High Performance Conjugate Gradient Benchmark +// +// Contact: +// Michael A. Heroux ( maherou@sandia.gov) +// Jack Dongarra (dongarra@eecs.utk.edu) +// Piotr Luszczek (luszczek@eecs.utk.edu) +// +// *************************************************** +//@HEADER + +/*! + @file SetupHalo.cpp + + HPCG routine + */ + +#ifndef HPCG_NOMPI +#include +#include +#include +#endif + +#ifndef HPCG_NOOPENMP +#include +#endif + +#ifdef HPCG_DETAILED_DEBUG +#include +using std::endl; +#include "hpcg.hpp" +#include +#endif + +#include "SetupHalo.hpp" +#include "mytimer.hpp" + +/*! + Prepares system matrix data structure and creates data necessary necessary + for communication of boundary values of this process. + + @param[in] geom The description of the problem's geometry. + @param[inout] A The known system matrix + + @see ExchangeHalo +*/ +void SetupHalo(SparseMatrix & A) { + + // Extract Matrix pieces + + local_int_t localNumberOfRows = A.localNumberOfRows; + char * nonzerosInRow = A.nonzerosInRow; + global_int_t ** mtxIndG = A.mtxIndG; + local_int_t ** mtxIndL = A.mtxIndL; + +#ifdef HPCG_NOMPI // In the non-MPI case we simply copy global indices to local index storage +#ifndef HPCG_NOOPENMP + #pragma omp parallel for +#endif + for (local_int_t i=0; i< localNumberOfRows; i++) { + int cur_nnz = nonzerosInRow[i]; + for (int j=0; j > sendList, receiveList; + typedef std::map< int, std::set< global_int_t> >::iterator map_iter; + typedef std::set::iterator set_iter; + std::map< local_int_t, local_int_t > externalToLocalMap; + + // TODO: With proper critical and atomic regions, this loop could be threaded, but not attempting it at this time + for (local_int_t i=0; i< localNumberOfRows; i++) { + global_int_t currentGlobalRow = A.localToGlobalMap[i]; + for (int j=0; jrank!=rankIdOfColumnEntry) {// If column index is not a row index, then it comes from another processor + receiveList[rankIdOfColumnEntry].insert(curIndex); + sendList[rankIdOfColumnEntry].insert(currentGlobalRow); // Matrix symmetry means we know the neighbor process wants my value + } + } + } + + // Count number of matrix entries to send and receive + local_int_t totalToBeSent = 0; + for (map_iter curNeighbor = sendList.begin(); curNeighbor != sendList.end(); ++curNeighbor) { + totalToBeSent += (curNeighbor->second).size(); + } + local_int_t totalToBeReceived = 0; + for (map_iter curNeighbor = receiveList.begin(); curNeighbor != receiveList.end(); ++curNeighbor) { + totalToBeReceived += (curNeighbor->second).size(); + } + +#ifdef HPCG_DETAILED_DEBUG + // These are all attributes that should be true, due to symmetry + HPCG_fout << "totalToBeSent = " << totalToBeSent << " totalToBeReceived = " << totalToBeReceived << endl; + assert(totalToBeSent==totalToBeReceived); // Number of sent entry should equal number of received + assert(sendList.size()==receiveList.size()); // Number of send-to neighbors should equal number of receive-from + // Each receive-from neighbor should be a send-to neighbor, and send the same number of entries + for (map_iter curNeighbor = receiveList.begin(); curNeighbor != receiveList.end(); ++curNeighbor) { + assert(sendList.find(curNeighbor->first)!=sendList.end()); + assert(sendList[curNeighbor->first].size()==receiveList[curNeighbor->first].size()); + } +#endif + + // Build the arrays and lists needed by the ExchangeHalo function. + double * sendBuffer = new double[totalToBeSent]; + local_int_t * elementsToSend = new local_int_t[totalToBeSent]; + int * neighbors = new int[sendList.size()]; + local_int_t * receiveLength = new local_int_t[receiveList.size()]; + local_int_t * sendLength = new local_int_t[sendList.size()]; + int neighborCount = 0; + local_int_t receiveEntryCount = 0; + local_int_t sendEntryCount = 0; + for (map_iter curNeighbor = receiveList.begin(); curNeighbor != receiveList.end(); ++curNeighbor, ++neighborCount) { + int neighborId = curNeighbor->first; // rank of current neighbor we are processing + neighbors[neighborCount] = neighborId; // store rank ID of current neighbor + receiveLength[neighborCount] = receiveList[neighborId].size(); + sendLength[neighborCount] = sendList[neighborId].size(); // Get count if sends/receives + for (set_iter i = receiveList[neighborId].begin(); i != receiveList[neighborId].end(); ++i, ++receiveEntryCount) { + externalToLocalMap[*i] = localNumberOfRows + receiveEntryCount; // The remote columns are indexed at end of internals + } + for (set_iter i = sendList[neighborId].begin(); i != sendList[neighborId].end(); ++i, ++sendEntryCount) { + //if (geom.rank==1) HPCG_fout << "*i, globalToLocalMap[*i], sendEntryCount = " << *i << " " << A.globalToLocalMap[*i] << " " << sendEntryCount << endl; + elementsToSend[sendEntryCount] = A.globalToLocalMap[*i]; // store local ids of entry to send + } + } + + // Convert matrix indices to local IDs +#ifndef HPCG_NOOPENMP + #pragma omp parallel for +#endif + for (local_int_t i=0; i< localNumberOfRows; i++) { + for (int j=0; jrank==rankIdOfColumnEntry) { // My column index, so convert to local index + mtxIndL[i][j] = A.globalToLocalMap[curIndex]; + } else { // If column index is not a row index, then it comes from another processor + mtxIndL[i][j] = externalToLocalMap[curIndex]; + } + } + } + + // Store contents in our matrix struct + A.numberOfExternalValues = externalToLocalMap.size(); + A.localNumberOfColumns = A.localNumberOfRows + A.numberOfExternalValues; + A.numberOfSendNeighbors = sendList.size(); + A.totalToBeSent = totalToBeSent; + A.elementsToSend = elementsToSend; + A.neighbors = neighbors; + A.receiveLength = receiveLength; + A.sendLength = sendLength; + A.sendBuffer = sendBuffer; + +#ifdef HPCG_DETAILED_DEBUG + HPCG_fout << " For rank " << A.geom->rank << " of " << A.geom->size << ", number of neighbors = " << A.numberOfSendNeighbors << endl; + for (int i = 0; i < A.numberOfSendNeighbors; i++) { + HPCG_fout << " rank " << A.geom->rank << " neighbor " << neighbors[i] << " send/recv length = " << sendLength[i] << "/" << receiveLength[i] << endl; + for (local_int_t j = 0; jrank << " elementsToSend[" << j << "] = " << elementsToSend[j] << endl; + } +#endif + +#endif // ifndef HPCG_NOMPI + + return; +} diff --git a/tests/apps/hpcg/src/SetupHalo.hpp b/tests/apps/hpcg/src/SetupHalo.hpp new file mode 100644 index 0000000000..60635cd89d --- /dev/null +++ b/tests/apps/hpcg/src/SetupHalo.hpp @@ -0,0 +1,21 @@ + +//@HEADER +// *************************************************** +// +// HPCG: High Performance Conjugate Gradient Benchmark +// +// Contact: +// Michael A. Heroux ( maherou@sandia.gov) +// Jack Dongarra (dongarra@eecs.utk.edu) +// Piotr Luszczek (luszczek@eecs.utk.edu) +// +// *************************************************** +//@HEADER + +#ifndef SETUPHALO_HPP +#define SETUPHALO_HPP +#include "SparseMatrix.hpp" + +void SetupHalo(SparseMatrix & A); + +#endif // SETUPHALO_HPP diff --git a/tests/apps/hpcg/src/SparseMatrix.hpp b/tests/apps/hpcg/src/SparseMatrix.hpp new file mode 100644 index 0000000000..47a3e49246 --- /dev/null +++ b/tests/apps/hpcg/src/SparseMatrix.hpp @@ -0,0 +1,172 @@ + +//@HEADER +// *************************************************** +// +// HPCG: High Performance Conjugate Gradient Benchmark +// +// Contact: +// Michael A. Heroux ( maherou@sandia.gov) +// Jack Dongarra (dongarra@eecs.utk.edu) +// Piotr Luszczek (luszczek@eecs.utk.edu) +// +// *************************************************** +//@HEADER + +/*! + @file SparseMatrix.hpp + + HPCG data structures for the sparse matrix + */ + +#ifndef SPARSEMATRIX_HPP +#define SPARSEMATRIX_HPP + +#include +#include +#include +#include "Geometry.hpp" +#include "Vector.hpp" +#include "MGData.hpp" + +struct SparseMatrix_STRUCT { + char * title; //!< name of the sparse matrix + Geometry * geom; //!< geometry associated with this matrix + global_int_t totalNumberOfRows; //!< total number of matrix rows across all processes + global_int_t totalNumberOfNonzeros; //!< total number of matrix nonzeros across all processes + local_int_t localNumberOfRows; //!< number of rows local to this process + local_int_t localNumberOfColumns; //!< number of columns local to this process + local_int_t localNumberOfNonzeros; //!< number of nonzeros local to this process + char * nonzerosInRow; //!< The number of nonzeros in a row will always be 27 or fewer + global_int_t ** mtxIndG; //!< matrix indices as global values + local_int_t ** mtxIndL; //!< matrix indices as local values + double ** matrixValues; //!< values of matrix entries + double ** matrixDiagonal; //!< values of matrix diagonal entries + std::map< global_int_t, local_int_t > globalToLocalMap; //!< global-to-local mapping + std::vector< global_int_t > localToGlobalMap; //!< local-to-global mapping + mutable bool isDotProductOptimized; + mutable bool isSpmvOptimized; + mutable bool isMgOptimized; + mutable bool isWaxpbyOptimized; + /*! + This is for storing optimized data structres created in OptimizeProblem and + used inside optimized ComputeSPMV(). + */ + mutable struct SparseMatrix_STRUCT * Ac; // Coarse grid matrix + mutable MGData * mgData; // Pointer to the coarse level data for this fine matrix + void * optimizationData; // pointer that can be used to store implementation-specific data + +#ifndef HPCG_NOMPI + local_int_t numberOfExternalValues; //!< number of entries that are external to this process + int numberOfSendNeighbors; //!< number of neighboring processes that will be send local data + local_int_t totalToBeSent; //!< total number of entries to be sent + local_int_t * elementsToSend; //!< elements to send to neighboring processes + int * neighbors; //!< neighboring processes + local_int_t * receiveLength; //!< lenghts of messages received from neighboring processes + local_int_t * sendLength; //!< lenghts of messages sent to neighboring processes + double * sendBuffer; //!< send buffer for non-blocking sends +#endif +}; +typedef struct SparseMatrix_STRUCT SparseMatrix; + +/*! + Initializes the known system matrix data structure members to 0. + + @param[in] A the known system matrix + */ +inline void InitializeSparseMatrix(SparseMatrix & A, Geometry * geom) { + A.title = 0; + A.geom = geom; + A.totalNumberOfRows = 0; + A.totalNumberOfNonzeros = 0; + A.localNumberOfRows = 0; + A.localNumberOfColumns = 0; + A.localNumberOfNonzeros = 0; + A.nonzerosInRow = 0; + A.mtxIndG = 0; + A.mtxIndL = 0; + A.matrixValues = 0; + A.matrixDiagonal = 0; + + // Optimization is ON by default. The code that switches it OFF is in the + // functions that are meant to be optimized. + A.isDotProductOptimized = true; + A.isSpmvOptimized = true; + A.isMgOptimized = true; + A.isWaxpbyOptimized = true; + +#ifndef HPCG_NOMPI + A.numberOfExternalValues = 0; + A.numberOfSendNeighbors = 0; + A.totalToBeSent = 0; + A.elementsToSend = 0; + A.neighbors = 0; + A.receiveLength = 0; + A.sendLength = 0; + A.sendBuffer = 0; +#endif + A.mgData = 0; // Fine-to-coarse grid transfer initially not defined. + A.Ac =0; + return; +} + +/*! + Copy values from matrix diagonal into user-provided vector. + + @param[in] A the known system matrix. + @param[inout] diagonal Vector of diagonal values (must be allocated before call to this function). + */ +inline void CopyMatrixDiagonal(SparseMatrix & A, Vector & diagonal) { + double ** curDiagA = A.matrixDiagonal; + double * dv = diagonal.values; + assert(A.localNumberOfRows==diagonal.localLength); + for (local_int_t i=0; i +#include +using std::endl; +#include +#include "hpcg.hpp" + +#include "TestCG.hpp" +#include "CG.hpp" + +/*! + Test the correctness of the Preconditined CG implementation by using a system matrix with a dominant diagonal. + + @param[in] geom The description of the problem's geometry. + @param[in] A The known system matrix + @param[in] data the data structure with all necessary CG vectors preallocated + @param[in] b The known right hand side vector + @param[inout] x On entry: the initial guess; on exit: the new approximate solution + @param[out] testcg_data the data structure with the results of the test including pass/fail information + + @return Returns zero on success and a non-zero value otherwise. + + @see CG() + */ +int TestCG(SparseMatrix & A, CGData & data, Vector & b, Vector & x, TestCGData & testcg_data) { + + + // Use this array for collecting timing information + std::vector< double > times(8,0.0); + // Temporary storage for holding original diagonal and RHS + Vector origDiagA, exaggeratedDiagA, origB; + InitializeVector(origDiagA, A.localNumberOfRows); + InitializeVector(exaggeratedDiagA, A.localNumberOfRows); + InitializeVector(origB, A.localNumberOfRows); + CopyMatrixDiagonal(A, origDiagA); + CopyVector(origDiagA, exaggeratedDiagA); + CopyVector(b, origB); + + // Modify the matrix diagonal to greatly exaggerate diagonal values. + // CG should converge in about 10 iterations for this problem, regardless of problem size + for (local_int_t i=0; i< A.localNumberOfRows; ++i) { + global_int_t globalRowID = A.localToGlobalMap[i]; + if (globalRowID<9) { + double scale = (globalRowID+2)*1.0e6; + ScaleVectorValue(exaggeratedDiagA, i, scale); + ScaleVectorValue(b, i, scale); + } else { + ScaleVectorValue(exaggeratedDiagA, i, 1.0e6); + ScaleVectorValue(b, i, 1.0e6); + } + } + ReplaceMatrixDiagonal(A, exaggeratedDiagA); + + int niters = 0; + double normr = 0.0; + double normr0 = 0.0; + int maxIters = 50; + int numberOfCgCalls = 2; + double tolerance = 1.0e-12; // Set tolerance to reasonable value for grossly scaled diagonal terms + testcg_data.expected_niters_no_prec = 12; // For the unpreconditioned CG call, we should take about 10 iterations, permit 12 + testcg_data.expected_niters_prec = 2; // For the preconditioned case, we should take about 1 iteration, permit 2 + testcg_data.niters_max_no_prec = 0; + testcg_data.niters_max_prec = 0; + for (int k=0; k<2; ++k) { // This loop tests both unpreconditioned and preconditioned runs + int expected_niters = testcg_data.expected_niters_no_prec; + if (k==1) expected_niters = testcg_data.expected_niters_prec; + for (int i=0; i< numberOfCgCalls; ++i) { + ZeroVector(x); // Zero out x + int ierr = CG(A, data, b, x, maxIters, tolerance, niters, normr, normr0, ×[0], k==1); + if (ierr) HPCG_fout << "Error in call to CG: " << ierr << ".\n" << endl; + if (niters <= expected_niters) { + ++testcg_data.count_pass; + } else { + ++testcg_data.count_fail; + } + if (k==0 && niters>testcg_data.niters_max_no_prec) testcg_data.niters_max_no_prec = niters; // Keep track of largest iter count + if (k==1 && niters>testcg_data.niters_max_prec) testcg_data.niters_max_prec = niters; // Same for preconditioned run + if (A.geom->rank==0) { + HPCG_fout << "Call [" << i << "] Number of Iterations [" << niters <<"] Scaled Residual [" << normr/normr0 << "]" << endl; + if (niters > expected_niters) + HPCG_fout << " Expected " << expected_niters << " iterations. Performed " << niters << "." << endl; + } + } + } + + // Restore matrix diagonal and RHS + ReplaceMatrixDiagonal(A, origDiagA); + CopyVector(origB, b); + // Delete vectors + DeleteVector(origDiagA); + DeleteVector(exaggeratedDiagA); + DeleteVector(origB); + testcg_data.normr = normr; + + return 0; +} diff --git a/tests/apps/hpcg/src/TestCG.hpp b/tests/apps/hpcg/src/TestCG.hpp new file mode 100644 index 0000000000..fa2eaa34a8 --- /dev/null +++ b/tests/apps/hpcg/src/TestCG.hpp @@ -0,0 +1,44 @@ + +//@HEADER +// *************************************************** +// +// HPCG: High Performance Conjugate Gradient Benchmark +// +// Contact: +// Michael A. Heroux ( maherou@sandia.gov) +// Jack Dongarra (dongarra@eecs.utk.edu) +// Piotr Luszczek (luszczek@eecs.utk.edu) +// +// *************************************************** +//@HEADER + +/*! + @file TestCG.hpp + + HPCG data structure + */ + +#ifndef TESTCG_HPP +#define TESTCG_HPP + +#include "hpcg.hpp" +#include "SparseMatrix.hpp" +#include "Vector.hpp" +#include "CGData.hpp" + + +struct TestCGData_STRUCT { + int count_pass; //!< number of succesful tests + int count_fail; //!< number of succesful tests + int expected_niters_no_prec; //!< expected number of test CG iterations without preconditioning with diagonally dominant matrix (~12) + int expected_niters_prec; //!< expected number of test CG iterations with preconditioning and with diagonally dominant matrix (~1-2) + int niters_max_no_prec; //!< maximum number of test CG iterations without predictitioner + int niters_max_prec; //!< maximum number of test CG iterations without predictitioner + double normr; //!< residual norm achieved during test CG iterations +}; +typedef struct TestCGData_STRUCT TestCGData; + +extern int TestCG(SparseMatrix & A, CGData & data, Vector & b, Vector & x, TestCGData & testcg_data); + +#endif // TESTCG_HPP + diff --git a/tests/apps/hpcg/src/TestNorms.cpp b/tests/apps/hpcg/src/TestNorms.cpp new file mode 100644 index 0000000000..5a9f8f310b --- /dev/null +++ b/tests/apps/hpcg/src/TestNorms.cpp @@ -0,0 +1,46 @@ + +//@HEADER +// *************************************************** +// +// HPCG: High Performance Conjugate Gradient Benchmark +// +// Contact: +// Michael A. Heroux ( maherou@sandia.gov) +// Jack Dongarra (dongarra@eecs.utk.edu) +// Piotr Luszczek (luszczek@eecs.utk.edu) +// +// *************************************************** +//@HEADER + +/*! + @file TestNorms.cpp + + HPCG routine + */ + +#include +#include "TestNorms.hpp" + +/*! + Computes the mean and standard deviation of the array of norm results. + + @param[in] testnorms_data data structure with the results of norm test + + @return Returns 0 upon success or non-zero otherwise +*/ +int TestNorms(TestNormsData & testnorms_data) { + double mean_delta = 0.0; + for (int i= 0; i +#include +#include +using std::endl; +#include +#include +#ifndef HPCG_NOMPI +#include // If this routine is not compiled with -DHPCG_NOMPI then include mpi.h +#endif + +#include "hpcg.hpp" + +#include "ComputeSPMV.hpp" +#include "ComputeMG.hpp" +#include "ComputeDotProduct.hpp" +#include "ComputeResidual.hpp" +#include "Geometry.hpp" +#include "SparseMatrix.hpp" +#include "TestSymmetry.hpp" + +/*! + Tests symmetry-preserving properties of the sparse matrix vector multiply and + symmetric Gauss-Siedel routines. + + @param[in] geom The description of the problem's geometry. + @param[in] A The known system matrix + @param[in] b The known right hand side vector + @param[in] xexact The exact solution vector + @param[inout] testsymmetry_data The data structure with the results of the CG symmetry test including pass/fail information + + @return returns 0 upon success and non-zero otherwise + + @see ComputeDotProduct + @see ComputeDotProduct_ref + @see ComputeSPMV + @see ComputeSPMV_ref + @see ComputeMG + @see ComputeMG_ref +*/ +int TestSymmetry(SparseMatrix & A, Vector & b, Vector & xexact, TestSymmetryData & testsymmetry_data) { + + local_int_t nrow = A.localNumberOfRows; + local_int_t ncol = A.localNumberOfColumns; + + Vector x_ncol, y_ncol, z_ncol; + InitializeVector(x_ncol, ncol); + InitializeVector(y_ncol, ncol); + InitializeVector(z_ncol, ncol); + + double t4 = 0.0; // Needed for dot-product call, otherwise unused + testsymmetry_data.count_fail = 0; + + // Test symmetry of matrix + + // First load vectors with random values + FillRandomVector(x_ncol); + FillRandomVector(y_ncol); + + double xNorm2, yNorm2; + double ANorm = 2 * 26.0; + + // Next, compute x'*A*y + ComputeDotProduct(nrow, y_ncol, y_ncol, yNorm2, t4, A.isDotProductOptimized); + int ierr = ComputeSPMV(A, y_ncol, z_ncol); // z_nrow = A*y_overlap + if (ierr) HPCG_fout << "Error in call to SpMV: " << ierr << ".\n" << endl; + double xtAy = 0.0; + ierr = ComputeDotProduct(nrow, x_ncol, z_ncol, xtAy, t4, A.isDotProductOptimized); // x'*A*y + if (ierr) HPCG_fout << "Error in call to dot: " << ierr << ".\n" << endl; + + // Next, compute y'*A*x + ComputeDotProduct(nrow, x_ncol, x_ncol, xNorm2, t4, A.isDotProductOptimized); + ierr = ComputeSPMV(A, x_ncol, z_ncol); // b_computed = A*x_overlap + if (ierr) HPCG_fout << "Error in call to SpMV: " << ierr << ".\n" << endl; + double ytAx = 0.0; + ierr = ComputeDotProduct(nrow, y_ncol, z_ncol, ytAx, t4, A.isDotProductOptimized); // y'*A*x + if (ierr) HPCG_fout << "Error in call to dot: " << ierr << ".\n" << endl; + + testsymmetry_data.depsym_spmv = std::fabs((long double) (xtAy - ytAx))/((xNorm2*ANorm*yNorm2 + yNorm2*ANorm*xNorm2) * (DBL_EPSILON)); + if (testsymmetry_data.depsym_spmv > 1.0) ++testsymmetry_data.count_fail; // If the difference is > 1, count it wrong + if (A.geom->rank==0) HPCG_fout << "Departure from symmetry (scaled) for SpMV abs(x'*A*y - y'*A*x) = " << testsymmetry_data.depsym_spmv << endl; + + // Test symmetry of symmetric Gauss-Seidel + + // Compute x'*Minv*y + ierr = ComputeMG(A, y_ncol, z_ncol); // z_ncol = Minv*y_ncol + if (ierr) HPCG_fout << "Error in call to MG: " << ierr << ".\n" << endl; + double xtMinvy = 0.0; + ierr = ComputeDotProduct(nrow, x_ncol, z_ncol, xtMinvy, t4, A.isDotProductOptimized); // x'*Minv*y + if (ierr) HPCG_fout << "Error in call to dot: " << ierr << ".\n" << endl; + + // Next, compute z'*Minv*x + ierr = ComputeMG(A, x_ncol, z_ncol); // z_ncol = Minv*x_ncol + if (ierr) HPCG_fout << "Error in call to MG: " << ierr << ".\n" << endl; + double ytMinvx = 0.0; + ierr = ComputeDotProduct(nrow, y_ncol, z_ncol, ytMinvx, t4, A.isDotProductOptimized); // y'*Minv*x + if (ierr) HPCG_fout << "Error in call to dot: " << ierr << ".\n" << endl; + + testsymmetry_data.depsym_mg = std::fabs((long double) (xtMinvy - ytMinvx))/((xNorm2*ANorm*yNorm2 + yNorm2*ANorm*xNorm2) * (DBL_EPSILON)); + if (testsymmetry_data.depsym_mg > 1.0) ++testsymmetry_data.count_fail; // If the difference is > 1, count it wrong + if (A.geom->rank==0) HPCG_fout << "Departure from symmetry (scaled) for MG abs(x'*Minv*y - y'*Minv*x) = " << testsymmetry_data.depsym_mg << endl; + + CopyVector(xexact, x_ncol); // Copy exact answer into overlap vector + + int numberOfCalls = 2; + double residual = 0.0; + for (int i=0; i< numberOfCalls; ++i) { + ierr = ComputeSPMV(A, x_ncol, z_ncol); // b_computed = A*x_overlap + if (ierr) HPCG_fout << "Error in call to SpMV: " << ierr << ".\n" << endl; + if ((ierr = ComputeResidual(A.localNumberOfRows, b, z_ncol, residual))) + HPCG_fout << "Error in call to compute_residual: " << ierr << ".\n" << endl; + if (A.geom->rank==0) HPCG_fout << "SpMV call [" << i << "] Residual [" << residual << "]" << endl; + } + DeleteVector(x_ncol); + DeleteVector(y_ncol); + DeleteVector(z_ncol); + + return 0; +} + diff --git a/tests/apps/hpcg/src/TestSymmetry.hpp b/tests/apps/hpcg/src/TestSymmetry.hpp new file mode 100644 index 0000000000..d41be7bc89 --- /dev/null +++ b/tests/apps/hpcg/src/TestSymmetry.hpp @@ -0,0 +1,37 @@ + +//@HEADER +// *************************************************** +// +// HPCG: High Performance Conjugate Gradient Benchmark +// +// Contact: +// Michael A. Heroux ( maherou@sandia.gov) +// Jack Dongarra (dongarra@eecs.utk.edu) +// Piotr Luszczek (luszczek@eecs.utk.edu) +// +// *************************************************** +//@HEADER + +/*! + @file TestSymmetry.hpp + + HPCG data structures for symmetry testing + */ + +#ifndef TESTSYMMETRY_HPP +#define TESTSYMMETRY_HPP + +#include "hpcg.hpp" +#include "SparseMatrix.hpp" +#include "CGData.hpp" + +struct TestSymmetryData_STRUCT { + double depsym_spmv; //!< departure from symmetry for the SPMV kernel + double depsym_mg; //!< departure from symmetry for the SYMGS kernel + int count_fail; //!< number of failures in the symmetry tests +}; +typedef struct TestSymmetryData_STRUCT TestSymmetryData; + +extern int TestSymmetry(SparseMatrix & A, Vector & b, Vector & xexact, TestSymmetryData & testsymmetry_data); + +#endif // TESTSYMMETRY_HPP diff --git a/tests/apps/hpcg/src/Vector.hpp b/tests/apps/hpcg/src/Vector.hpp new file mode 100644 index 0000000000..db12543e5a --- /dev/null +++ b/tests/apps/hpcg/src/Vector.hpp @@ -0,0 +1,115 @@ + +//@HEADER +// *************************************************** +// +// HPCG: High Performance Conjugate Gradient Benchmark +// +// Contact: +// Michael A. Heroux ( maherou@sandia.gov) +// Jack Dongarra (dongarra@eecs.utk.edu) +// Piotr Luszczek (luszczek@eecs.utk.edu) +// +// *************************************************** +//@HEADER + +/*! + @file Vector.hpp + + HPCG data structures for dense vectors + */ + +#ifndef VECTOR_HPP +#define VECTOR_HPP +#include +#include +#include "Geometry.hpp" + +struct Vector_STRUCT { + local_int_t localLength; //!< length of local portion of the vector + double * values; //!< array of values + /*! + This is for storing optimized data structres created in OptimizeProblem and + used inside optimized ComputeSPMV(). + */ + void * optimizationData; + +}; +typedef struct Vector_STRUCT Vector; + +/*! + Initializes input vector. + + @param[in] v + @param[in] localLength Length of local portion of input vector + */ +inline void InitializeVector(Vector & v, local_int_t localLength) { + v.localLength = localLength; + v.values = new double[localLength]; + v.optimizationData = 0; + return; +} + +/*! + Fill the input vector with zero values. + + @param[inout] v - On entrance v is initialized, on exit all its values are zero. + */ +inline void ZeroVector(Vector & v) { + local_int_t localLength = v.localLength; + double * vv = v.values; + for (int i=0; i=0 && index < v.localLength); + double * vv = v.values; + vv[index] *= value; + return; +} +/*! + Fill the input vector with pseudo-random values. + + @param[in] v + */ +inline void FillRandomVector(Vector & v) { + local_int_t localLength = v.localLength; + double * vv = v.values; + for (int i=0; i= localLength); + double * vv = v.values; + double * wv = w.values; + for (int i=0; i +#include "WriteProblem.hpp" +#include "Geometry.hpp" + + +/*! + Routine to dump: + - matrix in row, col, val format for analysis with MATLAB + - x, xexact, b as simple arrays of numbers. + + Writes to A.dat, x.dat, xexact.dat and b.dat, respectivly. + + NOTE: THIS CODE ONLY WORKS ON SINGLE PROCESSOR RUNS + + Read into MATLAB using: + + load A.dat + A=spconvert(A); + load x.dat + load xexact.dat + load b.dat + + @param[in] geom The description of the problem's geometry. + @param[in] A The known system matrix + @param[in] b The known right hand side vector + @param[in] x The solution vector computed by CG iteration + @param[in] xexact Generated exact solution + + @return Returns with -1 if used with more than one MPI process. Returns with 0 otherwise. + + @see GenerateProblem +*/ +int WriteProblem( const Geometry & geom, const SparseMatrix & A, + const Vector b, const Vector x, const Vector xexact) { + + if (geom.size!=1) return(-1); //TODO Only works on one processor. Need better error handler + const global_int_t nrow = A.totalNumberOfRows; + + FILE * fA = 0, * fx = 0, * fxexact = 0, * fb = 0; + fA = fopen("A.dat", "w"); + fx = fopen("x.dat", "w"); + fxexact = fopen("xexact.dat", "w"); + fb = fopen("b.dat", "w"); + + if (! fA || ! fx || ! fxexact || ! fb) { + if (fb) fclose(fb); + if (fxexact) fclose(fxexact); + if (fx) fclose(fx); + if (fA) fclose(fA); + return -1; + } + + for (global_int_t i=0; i< nrow; i++) { + const double * const currentRowValues = A.matrixValues[i]; + const global_int_t * const currentRowIndices = A.mtxIndG[i]; + const int currentNumberOfNonzeros = A.nonzerosInRow[i]; + for (int j=0; j< currentNumberOfNonzeros; j++) +#ifdef HPCG_NO_LONG_LONG + fprintf(fA, " %d %d %22.16e\n",i+1,(global_int_t)(currentRowIndices[j]+1),currentRowValues[j]); +#else + fprintf(fA, " %lld %lld %22.16e\n",i+1,(global_int_t)(currentRowIndices[j]+1),currentRowValues[j]); +#endif + fprintf(fx, "%22.16e\n",x.values[i]); + fprintf(fxexact, "%22.16e\n",xexact.values[i]); + fprintf(fb, "%22.16e\n",b.values[i]); + } + + fclose(fA); + fclose(fx); + fclose(fxexact); + fclose(fb); + return(0); +} diff --git a/tests/apps/hpcg/src/WriteProblem.hpp b/tests/apps/hpcg/src/WriteProblem.hpp new file mode 100644 index 0000000000..8b7849a487 --- /dev/null +++ b/tests/apps/hpcg/src/WriteProblem.hpp @@ -0,0 +1,21 @@ + +//@HEADER +// *************************************************** +// +// HPCG: High Performance Conjugate Gradient Benchmark +// +// Contact: +// Michael A. Heroux ( maherou@sandia.gov) +// Jack Dongarra (dongarra@eecs.utk.edu) +// Piotr Luszczek (luszczek@eecs.utk.edu) +// +// *************************************************** +//@HEADER + +#ifndef WRITEPROBLEM_HPP +#define WRITEPROBLEM_HPP +#include "Geometry.hpp" +#include "SparseMatrix.hpp" + +int WriteProblem( const Geometry & geom, const SparseMatrix & A, const Vector b, const Vector x, const Vector xexact); +#endif // WRITEPROBLEM_HPP diff --git a/tests/apps/hpcg/src/YAML_Doc.cpp b/tests/apps/hpcg/src/YAML_Doc.cpp new file mode 100644 index 0000000000..5847759be4 --- /dev/null +++ b/tests/apps/hpcg/src/YAML_Doc.cpp @@ -0,0 +1,82 @@ + +//@HEADER +// *************************************************** +// +// HPCG: High Performance Conjugate Gradient Benchmark +// +// Contact: +// Michael A. Heroux ( maherou@sandia.gov) +// Jack Dongarra (dongarra@eecs.utk.edu) +// Piotr Luszczek (luszczek@eecs.utk.edu) +// +// *************************************************** +//@HEADER + +#include +#include +#include +#include +#include +#include "YAML_Doc.hpp" +using namespace std; + +/*! + Sets the application name and version which will become part of the YAML doc. + + @param[in] miniApp_Name application name + @param[in] miniApp_Version application name + @param[in] destination_Directory destination directory for the YAML document + @param[in] destination_FileName file name for the YAML document +*/ +YAML_Doc::YAML_Doc(const std::string & miniApp_Name, const std::string & miniApp_Version, const std::string & destination_Directory, const std::string & destination_FileName) { + miniAppName = miniApp_Name; + miniAppVersion = miniApp_Version; + destinationDirectory = destination_Directory; + destinationFileName = destination_FileName; +} + +//inherits the destructor from YAML_Element +YAML_Doc::~YAML_Doc(void) { +} + +/*! + Generates YAML from the elements of the document and saves it to a file. + + @return returns the complete YAML document as a string +*/ +string YAML_Doc::generateYAML() { + string yaml; + yaml = yaml + miniAppName + "\n"; + yaml = yaml + miniAppVersion + "\n"; + for (size_t i=0; iprintYAML(""); + } + + time_t rawtime; + tm * ptm; + time ( &rawtime ); + ptm = localtime(&rawtime); + char sdate[25]; + //use tm_mon+1 because tm_mon is 0 .. 11 instead of 1 .. 12 + sprintf (sdate,"%04d.%02d.%02d.%02d.%02d.%02d",ptm->tm_year + 1900, ptm->tm_mon+1, + ptm->tm_mday, ptm->tm_hour, ptm->tm_min,ptm->tm_sec); + + string filename; + if (destinationFileName=="") + filename = miniAppName + "-" + miniAppVersion + "_"; + else + filename = destinationFileName; + filename = filename + string(sdate) + ".yaml"; + if (destinationDirectory!="" && destinationDirectory!=".") { + string mkdir_cmd = "mkdir " + destinationDirectory; + system(mkdir_cmd.c_str()); + filename = destinationDirectory + "/" + destinationFileName; + } else + filename = "./" + filename; + + ofstream myfile; + myfile.open(filename.c_str()); + myfile << yaml; + myfile.close(); + return yaml; +} diff --git a/tests/apps/hpcg/src/YAML_Doc.hpp b/tests/apps/hpcg/src/YAML_Doc.hpp new file mode 100644 index 0000000000..ae832267b8 --- /dev/null +++ b/tests/apps/hpcg/src/YAML_Doc.hpp @@ -0,0 +1,113 @@ + +//@HEADER +// *************************************************** +// +// HPCG: High Performance Conjugate Gradient Benchmark +// +// Contact: +// Michael A. Heroux ( maherou@sandia.gov) +// Jack Dongarra (dongarra@eecs.utk.edu) +// Piotr Luszczek (luszczek@eecs.utk.edu) +// +// *************************************************** +//@HEADER + +/*! + @file YAML_Doc.hpp + + HPCG YAML classes + */ + +// Changelog +// +// Version 0.1 +// - Initial version. +// +///////////////////////////////////////////////////////////////////////// + +#ifndef YAML_DOC_HPP +#define YAML_DOC_HPP +#include +#include "YAML_Element.hpp" + +//! The YAML_Doc class for the uniform collecting and reporting of performance data for HPCG + +/*! + +The YAML_Doc class works in conjuction with the YAML_Element class to facilitate easy collecting and reporting of YAML-formatted +data that can be then registered with the HPCG results collection website. + +\code + +//EXAMPLE CODE FOR GENERATING YAML + + YAML_Doc doc("hpcg","0.1"); + doc.add("final_residual",1.4523e-13); + doc.add("time","4.893"); + +//note: the following line will remove the data (4.890) associated with "time" + doc.get("time")->add("total",4.243); + +//note: the following line will likewise remove the data (1.243) associated with "time" + doc.get("time")->get("total")->add("time",2.457); + doc.get("time")->get("total")->add("flops",4.88e5); + doc.get("time")->add("ddot",1.243); + doc.get("time")->add("sparsemv",""); + doc.get("time")->get("sparsemv")->add("time",0.3445); + doc.get("time")->get("sparsemv")->add("overhead",""); + doc.get("time")->get("sparsemv")->get("overhead")->add("time",0.0123); + doc.get("time")->get("sparsemv")->get("overhead")->add("percentage",0.034); + cout << doc.generateYAML() << endl; + return 0; + +\endcode + +Below is the output generated by the above code: + +\verbatim + +final_residual: 1.4523e-13 +time: + total: + time: 2.457 + flops: 4.88e5 + ddot: 1.243 + sparsemv: + time: 0.3445 + overhead: + time: 0.0123 + percentage: 0.034 + +\endverbatim + +\note {No value is allowed to be attached to a key that has children. If children are added to a key, the value is simply set to "".} + +*/ +class YAML_Doc: public YAML_Element { +public: + //! Constructor: accepts mini-application name and version as strings, optionally accepts directory and file name for printing results. + /*! + The sole constructor for this class accepts and name and version number for the mini-application as well as optional directory + and file name information for results that are generated by the generateYAML() method. + \param miniApp_Name (in) string containing name of the mini-application + \param miniApp_Version (in) string containing the version of the mini-application + \param destination_Directory (in, optional) path of diretory where results file will be stored, relative to current working directory. + If this value is not supplied, the results file will be stored in the current working directory. If the directory does not exist + it will be created. + \param destination_FileName (in, optional) root name of the results file. A suffix of ".yaml" will be automatically appended. If no + file name is specified the filename will be constructed by concatenating the miniAppName + miniAppVersion + ".yaml" strings. + */ + YAML_Doc(const std::string & miniApp_Name, const std::string & miniApp_Version, const std::string & destination_Directory = "", const std::string & destination_FileName = ""); + //! Destructor + ~YAML_Doc(); + //! Generate YAML results to standard out and to a file using specified directory and filename, using current directory and miniAppName + miniAppVersion + ".yaml" by default + std::string generateYAML(); + +protected: + std::string miniAppName; //!< the name of the application that generated the YAML output + std::string miniAppVersion; //!< the version of the application that generated the YAML output + std::string destinationDirectory; //!< the destination directory for the generated the YAML output + std::string destinationFileName; //!< the filename for the generated the YAML output +}; +#endif // YAML_DOC_HPP + diff --git a/tests/apps/hpcg/src/YAML_Element.cpp b/tests/apps/hpcg/src/YAML_Element.cpp new file mode 100644 index 0000000000..c1a4ae2afd --- /dev/null +++ b/tests/apps/hpcg/src/YAML_Element.cpp @@ -0,0 +1,202 @@ + +//@HEADER +// *************************************************** +// +// HPCG: High Performance Conjugate Gradient Benchmark +// +// Contact: +// Michael A. Heroux ( maherou@sandia.gov) +// Jack Dongarra (dongarra@eecs.utk.edu) +// Piotr Luszczek (luszczek@eecs.utk.edu) +// +// *************************************************** +//@HEADER + +/*! + @file YAML_Element.cpp + + HPCG routine + */ + +#include +#include +#include +#include "YAML_Element.hpp" +using namespace std; +YAML_Element::YAML_Element(const std::string & key_arg, const std::string & value_arg) { + key = key_arg; + value = value_arg; +} + +YAML_Element::~YAML_Element() { + for (size_t i=0; ivalue = ""; + string converted_value = convert_double_to_string(value_arg); + YAML_Element * element = new YAML_Element(key_arg,converted_value); + children.push_back(element); + return element; +} + +/*! + Add an element to the vector + + @param[in] key_arg The key under which the element is stored + @param[in] value_arg The value of the element + + @return Returns the added element +*/ +YAML_Element * YAML_Element::add(const std::string & key_arg, int value_arg) { + this->value = ""; + string converted_value = convert_int_to_string(value_arg); + YAML_Element * element = new YAML_Element(key_arg,converted_value); + children.push_back(element); + return element; +} + +#ifndef HPCG_NO_LONG_LONG + +/*! + Add an element to the vector + + @param[in] key_arg The key under which the element is stored + @param[in] value_arg The value of the element + + @return Returns the added element +*/ +YAML_Element * YAML_Element::add(const std::string & key_arg, long long value_arg) { + this->value = ""; + string converted_value = convert_long_long_to_string(value_arg); + YAML_Element * element = new YAML_Element(key_arg,converted_value); + children.push_back(element); + return element; +} + +#endif + +/*! + Add an element to the vector + + @param[in] key_arg The key under which the element is stored + @param[in] value_arg The value of the element + + @return Returns the added element +*/ +YAML_Element * YAML_Element::add(const std::string & key_arg, size_t value_arg) { + this->value = ""; + string converted_value = convert_size_t_to_string(value_arg); + YAML_Element * element = new YAML_Element(key_arg,converted_value); + children.push_back(element); + return element; +} + +/*! + Add an element to the vector + + @param[in] key_arg The key under which the element is stored + @param[in] value_arg The value of the element + + @return Returns the added element +*/ +YAML_Element * YAML_Element::add(const std::string & key_arg, const std::string & value_arg) { + this->value = ""; + YAML_Element * element = new YAML_Element(key_arg, value_arg); + children.push_back(element); + return element; +} + +/*! + Returns the pointer to the YAML_Element for the given key. + @param[in] key_arg The key under which the element was stored + + @return If found, returns the element, otherwise returns NULL +*/ +YAML_Element * YAML_Element::get(const std::string & key_arg) { + for (size_t i=0; igetKey() == key_arg) { + return children[i]; + } + } + return 0; +} + +/*! + Prints a line of a YAML document. Correct YAML depends on + correct spacing; the parameter space should be the proper + amount of space for the parent element + + @param[in] space spacing inserted at the beginning of the line + + @return Returns a single line of the YAML document without the leading white space +*/ +string YAML_Element::printYAML(std::string space) { + string yaml_line = space + key + ": " + value + "\n"; + for (int i=0; i<2; i++) space = space + " "; + for (size_t i=0; iprintYAML(space); + } + return yaml_line; +} + +/*! + Converts a double precision value to a string. + + @param[in] value_arg The value to be converted. +*/ +string YAML_Element::convert_double_to_string(double value_arg) { + stringstream strm; + strm << value_arg; + return strm.str(); +} + +/*! + Converts a integer value to a string. + + @param[in] value_arg The value to be converted. +*/ +string YAML_Element::convert_int_to_string(int value_arg) { + stringstream strm; + strm << value_arg; + return strm.str(); +} + +#ifndef HPCG_NO_LONG_LONG + +/*! + Converts a "long long" integer value to a string. + + @param[in] value_arg The value to be converted. +*/ +string YAML_Element::convert_long_long_to_string(long long value_arg) { + stringstream strm; + strm << value_arg; + return strm.str(); +} + +#endif + +/*! + Converts a "size_t" integer value to a string. + + @param[in] value_arg The value to be converted. +*/ +string YAML_Element::convert_size_t_to_string(size_t value_arg) { + stringstream strm; + strm << value_arg; + return strm.str(); +} diff --git a/tests/apps/hpcg/src/YAML_Element.hpp b/tests/apps/hpcg/src/YAML_Element.hpp new file mode 100644 index 0000000000..3955c5ca2d --- /dev/null +++ b/tests/apps/hpcg/src/YAML_Element.hpp @@ -0,0 +1,79 @@ + +//@HEADER +// *************************************************** +// +// HPCG: High Performance Conjugate Gradient Benchmark +// +// Contact: +// Michael A. Heroux ( maherou@sandia.gov) +// Jack Dongarra (dongarra@eecs.utk.edu) +// Piotr Luszczek (luszczek@eecs.utk.edu) +// +// *************************************************** +//@HEADER + +/*! + @file YAML_Element.hpp + + HPCG data structures for YAML output + */ + +// Changelog +// +// Version 0.1 +// - Initial version. +// +///////////////////////////////////////////////////////////////////////// + +#ifndef YAML_ELEMENT_HPP +#define YAML_ELEMENT_HPP +#include +#include +#include "Geometry.hpp" +//! HPCG YAML_Element class, from the HPCG YAML_Element class for registering key-value pairs of performance data + +/*! + HPCG generates a collection of performance data for each run of the executable. YAML_Element, and + the related YAML_Doc class, provide a uniform facility for gathering and reporting this data using the YAML text format. +*/ +class YAML_Element { +public: + + //! Default constructor. + YAML_Element () {key=""; value="";} + //! Construct with known key-value pair + YAML_Element (const std::string & key_arg, const std::string & value_arg); + //! Destructor + ~YAML_Element (); + //! Key accessor method + std::string getKey() {return key;} + //! Add a child element to an element list associated with this element, value of type double + YAML_Element * add(const std::string & key_arg, double value_arg); + //! Add a child element to an element list associated with this element, value of type int + YAML_Element * add(const std::string & key_arg, int value_arg); +#ifndef HPCG_NO_LONG_LONG + //! Add a child element to an element list associated with this element, value of type long long + YAML_Element * add(const std::string & key_arg, long long value_arg); +#endif + //! Add a child element to an element list associated with this element, value of type size_t + YAML_Element * add(const std::string & key_arg, size_t value_arg); + //! Add a child element to an element list associated with this element, value of type string + YAML_Element * add(const std::string & key_arg, const std::string & value_arg); + //! get the element in the list with the given key + YAML_Element * get(const std::string & key_arg); + std::string printYAML(std::string space); + +protected: + std::string key; //!< the key under which the element is stored + std::string value; //!< the value of the stored element + std::vector children; //!< children elements of this element + +private: + std::string convert_double_to_string(double value_arg); + std::string convert_int_to_string(int value_arg); +#ifndef HPCG_NO_LONG_LONG + std::string convert_long_long_to_string(long long value_arg); +#endif + std::string convert_size_t_to_string(size_t value_arg); +}; +#endif // YAML_ELEMENT_HPP diff --git a/tests/apps/hpcg/src/finalize.cpp b/tests/apps/hpcg/src/finalize.cpp new file mode 100644 index 0000000000..d9ce31b3a9 --- /dev/null +++ b/tests/apps/hpcg/src/finalize.cpp @@ -0,0 +1,30 @@ + +//@HEADER +// *************************************************** +// +// HPCG: High Performance Conjugate Gradient Benchmark +// +// Contact: +// Michael A. Heroux ( maherou@sandia.gov) +// Jack Dongarra (dongarra@eecs.utk.edu) +// Piotr Luszczek (luszczek@eecs.utk.edu) +// +// *************************************************** +//@HEADER + +#include + +#include "hpcg.hpp" + +/*! + Closes the I/O stream used for logging information throughout the HPCG run. + + @return returns 0 upon success and non-zero otherwise + + @see HPCG_Init +*/ +int +HPCG_Finalize(void) { + HPCG_fout.close(); + return(0); +} diff --git a/tests/apps/hpcg/src/hpcg.hpp b/tests/apps/hpcg/src/hpcg.hpp new file mode 100644 index 0000000000..30856cc29e --- /dev/null +++ b/tests/apps/hpcg/src/hpcg.hpp @@ -0,0 +1,45 @@ + +//@HEADER +// *************************************************** +// +// HPCG: High Performance Conjugate Gradient Benchmark +// +// Contact: +// Michael A. Heroux ( maherou@sandia.gov) +// Jack Dongarra (dongarra@eecs.utk.edu) +// Piotr Luszczek (luszczek@eecs.utk.edu) +// +// *************************************************** +//@HEADER + +/*! + @file hpcg.hpp + + HPCG data structures and functions + */ + +#ifndef HPCG_HPP +#define HPCG_HPP + +#include + +extern std::ofstream HPCG_fout; + +struct HPCG_Params_STRUCT { + int comm_size; //!< Number of MPI processes in MPI_COMM_WORLD + int comm_rank; //!< This process' MPI rank in the range [0 to comm_size - 1] + int numThreads; //!< This process' number of threads + int nx; //!< Number of x-direction grid points for each local subdomain + int ny; //!< Number of y-direction grid points for each local subdomain + int nz; //!< Number of z-direction grid points for each local subdomain + int runningTime; //!< Number of seconds to run the timed portion of the benchmark +}; +/*! + HPCG_Params is a shorthand for HPCG_Params_STRUCT + */ +typedef HPCG_Params_STRUCT HPCG_Params; + +extern int HPCG_Init(int * argc_p, char ** *argv_p, HPCG_Params & params); +extern int HPCG_Finalize(void); + +#endif // HPCG_HPP diff --git a/tests/apps/hpcg/src/init.cpp b/tests/apps/hpcg/src/init.cpp new file mode 100644 index 0000000000..59023f410c --- /dev/null +++ b/tests/apps/hpcg/src/init.cpp @@ -0,0 +1,138 @@ + +//@HEADER +// *************************************************** +// +// HPCG: High Performance Conjugate Gradient Benchmark +// +// Contact: +// Michael A. Heroux ( maherou@sandia.gov) +// Jack Dongarra (dongarra@eecs.utk.edu) +// Piotr Luszczek (luszczek@eecs.utk.edu) +// +// *************************************************** +//@HEADER + +#ifndef HPCG_NOMPI +#include +#endif + +#ifndef HPCG_NOOPENMP +#include +#endif + +#include +#include +#include + +#include +#include + +#include "hpcg.hpp" + +#include "ReadHpcgDat.hpp" + +std::ofstream HPCG_fout; //!< output file stream for logging activities during HPCG run + +static int +startswith(const char * s, const char * prefix) { + size_t n = strlen( prefix ); + if (strncmp( s, prefix, n )) + return 0; + return 1; +} + +/*! + Initializes an HPCG run by obtaining problem parameters (from a file on + command line) and then broadcasts them to all nodes. It also initializes + loggin I/O streams that are used throughout the HPCG run. Only MPI rank 0 + performs I/O operations. + + The function assumes that MPI has already been initialized for MPI runs. + + @param[in] argc_p the pointer to the "argc" parameter passed to the main() function + @param[in] argv_p the pointer to the "argv" parameter passed to the main() function + @param[out] params the reference to the data structures that is filled the basic parameters of the run + + @return returns 0 upon success and non-zero otherwise + + @see HPCG_Finalize +*/ +int +HPCG_Init(int * argc_p, char ** *argv_p, HPCG_Params & params) { + int argc = *argc_p; + char ** argv = *argv_p; + char fname[80]; + int i, j, iparams[4]; + char cparams[4][6] = {"--nx=", "--ny=", "--nz=", "--nt="}; + time_t rawtime; + tm * ptm; + + /* for sequential and some MPI implementations it's OK to read first three args */ + for (i = 0; i < 4; ++i) + if (argc <= i+1 || sscanf(argv[i+1], "%d", iparams+i) != 1 || iparams[i] < 10) iparams[i] = 0; + + /* for some MPI environments, command line arguments may get complicated so we need a prefix */ + for (i = 1; i <= argc && argv[i]; ++i) + for (j = 0; j < 3; ++j) + if (startswith(argv[i], cparams[j])) + if (sscanf(argv[i]+strlen(cparams[j]), "%d", iparams+j) != 1 || iparams[j] < 10) iparams[j] = 0; + + if (! iparams[0] && ! iparams[1] && ! iparams[2]) { /* no geometry arguments on the command line */ + ReadHpcgDat(iparams, iparams+3); + } + + for (i = 0; i < 3; ++i) { + if (iparams[i] < 16) + for (j = 1; j <= 2; ++j) + if (iparams[(i+j)%3] > iparams[i]) + iparams[i] = iparams[(i+j)%3]; + if (iparams[i] < 16) + iparams[i] = 16; + } + +#ifndef HPCG_NOMPI + MPI_Bcast( iparams, 4, MPI_INT, 0, MPI_COMM_WORLD ); +#endif + + params.nx = iparams[0]; + params.ny = iparams[1]; + params.nz = iparams[2]; + + params.runningTime = iparams[3]; + +#ifdef HPCG_NOMPI + params.comm_rank = 0; + params.comm_size = 1; +#else + MPI_Comm_rank( MPI_COMM_WORLD, ¶ms.comm_rank ); + MPI_Comm_size( MPI_COMM_WORLD, ¶ms.comm_size ); +#endif + +#ifdef HPCG_NOOPENMP + params.numThreads = 1; +#else + #pragma omp parallel + params.numThreads = omp_get_num_threads(); +#endif + + time ( &rawtime ); + ptm = localtime(&rawtime); + sprintf( fname, "hpcg_log_%04d.%02d.%02d.%02d.%02d.%02d.txt", + 1900 + ptm->tm_year, ptm->tm_mon+1, ptm->tm_mday, ptm->tm_hour, ptm->tm_min, ptm->tm_sec ); + + if (0 == params.comm_rank) + HPCG_fout.open(fname); + else { +#if defined(HPCG_DEBUG) || defined(HPCG_DETAILED_DEBUG) + char local[15]; + sprintf( local, "%d_", params.comm_rank ); + sprintf( fname, "hpcg_log_%s%04.d%02d.%02d.%02d.%02d.%02d.txt", local, + 1900 + ptm->tm_year, ptm->tm_mon+1, ptm->tm_mday, ptm->tm_hour, ptm->tm_min, ptm->tm_sec ); + HPCG_fout.open(fname); +#else + HPCG_fout.open("/dev/null"); +#endif + } + + return 0; +} diff --git a/tests/apps/hpcg/src/mytimer.cpp b/tests/apps/hpcg/src/mytimer.cpp new file mode 100644 index 0000000000..80ab2020c2 --- /dev/null +++ b/tests/apps/hpcg/src/mytimer.cpp @@ -0,0 +1,54 @@ + +//@HEADER +// *************************************************** +// +// HPCG: High Performance Conjugate Gradient Benchmark +// +// Contact: +// Michael A. Heroux ( maherou@sandia.gov) +// Jack Dongarra (dongarra@eecs.utk.edu) +// Piotr Luszczek (luszczek@eecs.utk.edu) +// +// *************************************************** +//@HEADER + +///////////////////////////////////////////////////////////////////////// + +// Function to return time in seconds. +// If compiled with no flags, return CPU time (user and system). +// If compiled with -DWALL, returns elapsed time. + +///////////////////////////////////////////////////////////////////////// + +#ifndef HPCG_NOMPI +#include // If this routine is not compiled with HPCG_NOMPI then use MPI + +double mytimer(void) { + return(MPI_Wtime()); +} + +#elif !defined(HPCG_NOOPENMP) + +#include // If this routine is compiled with HPCG_NOMPI and not compiled with HPCG_NOOPENMP then use OpenMP timer +double mytimer(void) { + return(omp_get_wtime()); +} +#else + +#include +#include +#include +double mytimer(void) { + struct timeval tp; + static long start=0, startu; + if (!start) { + gettimeofday(&tp, NULL); + start = tp.tv_sec; + startu = tp.tv_usec; + return(0.0); + } + gettimeofday(&tp, NULL); + return( ((double) (tp.tv_sec - start)) + (tp.tv_usec-startu)/1000000.0 ); +} + +#endif diff --git a/tests/apps/hpcg/src/mytimer.hpp b/tests/apps/hpcg/src/mytimer.hpp new file mode 100644 index 0000000000..73944c02e8 --- /dev/null +++ b/tests/apps/hpcg/src/mytimer.hpp @@ -0,0 +1,18 @@ + +//@HEADER +// *************************************************** +// +// HPCG: High Performance Conjugate Gradient Benchmark +// +// Contact: +// Michael A. Heroux ( maherou@sandia.gov) +// Jack Dongarra (dongarra@eecs.utk.edu) +// Piotr Luszczek (luszczek@eecs.utk.edu) +// +// *************************************************** +//@HEADER + +#ifndef MYTIMER_HPP +#define MYTIMER_HPP +double mytimer(void); +#endif // MYTIMER_HPP diff --git a/tests/apps/hpcg/src/temp.cpp b/tests/apps/hpcg/src/temp.cpp new file mode 100644 index 0000000000..105d907cdc --- /dev/null +++ b/tests/apps/hpcg/src/temp.cpp @@ -0,0 +1,80 @@ +int TestSymmetry(SparseMatrix & A, Vector & b, Vector & xexact, TestSymmetryData & testsymmetry_data) { + + local_int_t nrow = A.localNumberOfRows; + local_int_t ncol = A.localNumberOfColumns; + + Vector x_ncol, y_ncol, z_ncol; + InitializeVector(x_ncol, ncol); + InitializeVector(y_ncol, ncol); + InitializeVector(z_ncol, ncol); + + double t4 = 0.0; // Needed for dot-product call, otherwise unused + testsymmetry_data.count_fail = 0; + + // Test symmetry of matrix + + // First load vectors with random values + FillRandomVector(x_ncol); + FillRandomVector(y_ncol); + + double xNorm2, yNorm2; + double ANorm = 2 * 26.0; + + // Next, compute x'*A*y + ComputeDotProduct(nrow, y_ncol, y_ncol, yNorm2, t4, A.isDotProductOptimized); + int ierr = ComputeSPMV(A, y_ncol, z_ncol); // z_nrow = A*y_overlap + if (ierr) HPCG_fout << "Error in call to SpMV: " << ierr << ".\n" << endl; + double xtAy = 0.0; + ierr = ComputeDotProduct(nrow, x_ncol, z_ncol, xtAy, t4, A.isDotProductOptimized); // x'*A*y + if (ierr) HPCG_fout << "Error in call to dot: " << ierr << ".\n" << endl; + + // Next, compute y'*A*x + ComputeDotProduct(nrow, x_ncol, x_ncol, xNorm2, t4, A.isDotProductOptimized); + ierr = ComputeSPMV(A, x_ncol, z_ncol); // b_computed = A*x_overlap + if (ierr) HPCG_fout << "Error in call to SpMV: " << ierr << ".\n" << endl; + double ytAx = 0.0; + ierr = ComputeDotProduct(nrow, y_ncol, z_ncol, ytAx, t4, A.isDotProductOptimized); // y'*A*x + if (ierr) HPCG_fout << "Error in call to dot: " << ierr << ".\n" << endl; + + testsymmetry_data.depsym_spmv = std::fabs((long double) (xtAy - ytAx))/((xNorm2*ANorm*yNorm2 + yNorm2*ANorm*xNorm2) * (DBL_EPSILON)); + if (testsymmetry_data.depsym_spmv > 1.0) ++testsymmetry_data.count_fail; // If the difference is > 1, count it wrong + if (A.geom->rank==0) HPCG_fout << "Departure from symmetry (scaled) for SpMV abs(x'*A*y - y'*A*x) = " << testsymmetry_data.depsym_spmv << endl; + + // Test symmetry of symmetric Gauss-Seidel + + // Compute x'*Minv*y + ierr = ComputeMG(A, y_ncol, z_ncol); // z_ncol = Minv*y_ncol + if (ierr) HPCG_fout << "Error in call to MG: " << ierr << ".\n" << endl; + double xtMinvy = 0.0; + ierr = ComputeDotProduct(nrow, x_ncol, z_ncol, xtMinvy, t4, A.isDotProductOptimized); // x'*Minv*y + if (ierr) HPCG_fout << "Error in call to dot: " << ierr << ".\n" << endl; + + // Next, compute z'*Minv*x + ierr = ComputeMG(A, x_ncol, z_ncol); // z_ncol = Minv*x_ncol + if (ierr) HPCG_fout << "Error in call to MG: " << ierr << ".\n" << endl; + double ytMinvx = 0.0; + ierr = ComputeDotProduct(nrow, y_ncol, z_ncol, ytMinvx, t4, A.isDotProductOptimized); // y'*Minv*x + if (ierr) HPCG_fout << "Error in call to dot: " << ierr << ".\n" << endl; + + testsymmetry_data.depsym_mg = std::fabs((long double) (xtMinvy - ytMinvx))/((xNorm2*ANorm*yNorm2 + yNorm2*ANorm*xNorm2) * (DBL_EPSILON)); + if (testsymmetry_data.depsym_mg > 1.0) ++testsymmetry_data.count_fail; // If the difference is > 1, count it wrong + if (A.geom->rank==0) HPCG_fout << "Departure from symmetry (scaled) for MG abs(x'*Minv*y - y'*Minv*x) = " << testsymmetry_data.depsym_mg << endl; + + CopyVector(xexact, x_ncol); // Copy exact answer into overlap vector + + int numberOfCalls = 2; + double residual = 0.0; + for (int i=0; i< numberOfCalls; ++i) { + ierr = ComputeSPMV(A, x_ncol, z_ncol); // b_computed = A*x_overlap + if (ierr) HPCG_fout << "Error in call to SpMV: " << ierr << ".\n" << endl; + if ((ierr = ComputeResidual(A.localNumberOfRows, b, z_ncol, residual))) + HPCG_fout << "Error in call to compute_residual: " << ierr << ".\n" << endl; + if (A.geom->rank==0) HPCG_fout << "SpMV call [" << i << "] Residual [" << residual << "]" << endl; + } + DeleteVector(x_ncol); + DeleteVector(y_ncol); + DeleteVector(z_ncol); + + return 0; +} + diff --git a/tests/apps/hpcg/testing/main.cpp b/tests/apps/hpcg/testing/main.cpp new file mode 100644 index 0000000000..efbf25c454 --- /dev/null +++ b/tests/apps/hpcg/testing/main.cpp @@ -0,0 +1,345 @@ + +//@HEADER +// *************************************************** +// +// HPCG: High Performance Conjugate Gradient Benchmark +// +// Contact: +// Michael A. Heroux ( maherou@sandia.gov) +// Jack Dongarra (dongarra@eecs.utk.edu) +// Piotr Luszczek (luszczek@eecs.utk.edu) +// +// *************************************************** +//@HEADER + +/*! + @file main.cpp + + HPCG routine + */ + +// Main routine of a program that calls the HPCG conjugate gradient +// solver to solve the problem, and then prints results. + +#ifndef HPCG_NOMPI +#include // If this routine is not compiled with HPCG_NOMPI +#endif + +#include +#include +#include +#ifdef HPCG_DETAILED_DEBUG +using std::cin; +#endif +using std::endl; + +#include + +#include "hpcg.hpp" + +#include "GenerateGeometry.hpp" +#include "GenerateProblem.hpp" +#include "GenerateCoarseProblem.hpp" +#include "SetupHalo.hpp" +#include "ExchangeHalo.hpp" +#include "OptimizeProblem.hpp" +#include "WriteProblem.hpp" +#include "ReportResults.hpp" +#include "mytimer.hpp" +#include "ComputeSPMV_ref.hpp" +#include "ComputeMG_ref.hpp" +#include "ComputeResidual.hpp" +#include "CG.hpp" +#include "CG_ref.hpp" +#include "Geometry.hpp" +#include "SparseMatrix.hpp" +#include "Vector.hpp" +#include "CGData.hpp" +#include "TestCG.hpp" +#include "TestSymmetry.hpp" +#include "TestNorms.hpp" + +/*! + Main driver program: Construct synthetic problem, run V&V tests, compute benchmark parameters, run benchmark, report results. + + @param[in] argc Standard argument count. Should equal 1 (no arguments passed in) or 4 (nx, ny, nz passed in) + @param[in] argv Standard argument array. If argc==1, argv is unused. If argc==4, argv[1], argv[2], argv[3] will be interpreted as nx, ny, nz, resp. + + @return Returns zero on success and a non-zero value otherwise. + +*/ +int main(int argc, char * argv[]) { + +#ifndef HPCG_NOMPI + MPI_Init(&argc, &argv); +#endif + + HPCG_Params params; + + HPCG_Init(&argc, &argv, params); + + int size = params.comm_size, rank = params.comm_rank; // Number of MPI processes, My process ID + +#ifdef HPCG_DETAILED_DEBUG + if (size < 100 && rank==0) HPCG_fout << "Process "<Ac; // Make the just-constructed coarse grid the next level + } + + + CGData data; + InitializeSparseCGData(A, data); + + + // Use this array for collecting timing information + std::vector< double > times(9,0.0); + + // Call user-tunable set up function. + double t7 = mytimer(); OptimizeProblem(A, data, b, x, xexact); t7 = mytimer() - t7; + times[7] = t7; +#ifdef HPCG_DEBUG + if (rank==0) HPCG_fout << "Total problem setup time in main (sec) = " << mytimer() - t1 << endl; +#endif + +#ifdef HPCG_DETAILED_DEBUG + if (geom->size == 1) WriteProblem(*geom, A, b, x, xexact); +#endif + + + ////////////////////////////// + // Validation Testing Phase // + ////////////////////////////// + +#ifdef HPCG_DEBUG + t1 = mytimer(); +#endif + TestCGData testcg_data; + testcg_data.count_pass = testcg_data.count_fail = 0; + TestCG(A, data, b, x, testcg_data); + + TestSymmetryData testsymmetry_data; + TestSymmetry(A, b, xexact, testsymmetry_data); + +#ifdef HPCG_DEBUG + if (rank==0) HPCG_fout << "Total validation (TestCG and TestSymmetry) execution time in main (sec) = " << mytimer() - t1 << endl; +#endif + +#ifdef HPCG_DEBUG + t1 = mytimer(); +#endif + + /////////////////////////////////////// + // Reference SpMV+MG Timing Phase // + /////////////////////////////////////// + + // Call Reference SpMV and MG. Compute Optimization time as ratio of times in these routines + + local_int_t nrow = A.localNumberOfRows; + local_int_t ncol = A.localNumberOfColumns; + + Vector x_overlap, b_computed; + InitializeVector(x_overlap, ncol); // Overlapped copy of x vector + InitializeVector(b_computed, nrow); // Computed RHS vector + + + // Record execution time of reference SpMV and MG kernels for reporting times + // First load vector with random values + FillRandomVector(x_overlap); + + int numberOfCalls = 10; + double t_begin = mytimer(); + for (int i=0; i< numberOfCalls; ++i) { + ierr = ComputeSPMV_ref(A, x_overlap, b_computed); // b_computed = A*x_overlap + if (ierr) HPCG_fout << "Error in call to SpMV: " << ierr << ".\n" << endl; + ierr = ComputeMG_ref(A, b_computed, x_overlap); // b_computed = Minv*y_overlap + if (ierr) HPCG_fout << "Error in call to MG: " << ierr << ".\n" << endl; + } + times[8] = (mytimer() - t_begin)/((double) numberOfCalls); // Total time divided by number of calls. +#ifdef HPCG_DEBUG + if (rank==0) HPCG_fout << "Total SpMV+MG timing phase execution time in main (sec) = " << mytimer() - t1 << endl; +#endif + + /////////////////////////////// + // Reference CG Timing Phase // + /////////////////////////////// + +#ifdef HPCG_DEBUG + t1 = mytimer(); +#endif + int global_failure = 0; // assume all is well: no failures + + int niters = 0; + int totalNiters_ref = 0; + double normr = 0.0; + double normr0 = 0.0; + int refMaxIters = 50; + numberOfCalls = 1; // Only need to run the residual reduction analysis once + + // Compute the residual reduction for the natural ordering and reference kernels + std::vector< double > ref_times(9,0.0); + double tolerance = 0.0; // Set tolerance to zero to make all runs do maxIters iterations + int err_count = 0; + for (int i=0; i< numberOfCalls; ++i) { + ZeroVector(x); + ierr = CG_ref( A, data, b, x, refMaxIters, tolerance, niters, normr, normr0, &ref_times[0], true); + if (ierr) ++err_count; // count the number of errors in CG + totalNiters_ref += niters; + } + if (rank == 0 && err_count) HPCG_fout << err_count << " error(s) in call(s) to reference CG." << endl; + double refTolerance = normr / normr0; + + ////////////////////////////// + // Optimized CG Setup Phase // + ////////////////////////////// + + niters = 0; + normr = 0.0; + normr0 = 0.0; + err_count = 0; + int tolerance_failures = 0; + + int optMaxIters = 10*refMaxIters; + int optNiters = 0; + double opt_worst_time = 0.0; + + std::vector< double > opt_times(9,0.0); + + // Compute the residual reduction and residual count for the user ordering and optimized kernels. + for (int i=0; i< numberOfCalls; ++i) { + ZeroVector(x); // start x at all zeros + double last_cummulative_time = opt_times[0]; + ierr = CG( A, data, b, x, optMaxIters, refTolerance, niters, normr, normr0, &opt_times[0], true); + if (ierr) ++err_count; // count the number of errors in CG + if (normr / normr0 > refTolerance) ++tolerance_failures; // the number of failures to reduce residual + + // pick the largest number of iterations to guarantee convergence + if (niters > optNiters) optNiters = niters; + + double current_time = opt_times[0] - last_cummulative_time; + if (current_time > opt_worst_time) opt_worst_time = current_time; + } + +#ifndef HPCG_NOMPI +// Get the absolute worst time across all MPI ranks (time in CG can be different) + double local_opt_worst_time = opt_worst_time; + MPI_Allreduce(&local_opt_worst_time, &opt_worst_time, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); +#endif + + + if (rank == 0 && err_count) HPCG_fout << err_count << " error(s) in call(s) to optimized CG." << endl; + if (tolerance_failures) { + global_failure = 1; + if (rank == 0) + HPCG_fout << "Failed to reduce the residual " << tolerance_failures << " times." << endl; + } + + /////////////////////////////// + // Optimized CG Timing Phase // + /////////////////////////////// + + // Here we finally run the benchmark phase + // The variable total_runtime is the target benchmark execution time in seconds + + double total_runtime = params.runningTime; + int numberOfCgSets = int(total_runtime / opt_worst_time) + 1; // Run at least once, account for rounding + +#ifdef HPCG_DEBUG + if (rank==0) { + HPCG_fout << "Projected running time: " << total_runtime << " seconds" << endl; + HPCG_fout << "Number of CG sets: " << numberOfCgSets << endl; + } +#endif + + /* This is the timed run for a specified amount of time. */ + + optMaxIters = optNiters; + double optTolerance = 0.0; // Force optMaxIters iterations + TestNormsData testnorms_data; + testnorms_data.samples = numberOfCgSets; + testnorms_data.values = new double[numberOfCgSets]; + + for (int i=0; i< numberOfCgSets; ++i) { + ZeroVector(x); // Zero out x + ierr = CG( A, data, b, x, optMaxIters, optTolerance, niters, normr, normr0, ×[0], true); + if (ierr) HPCG_fout << "Error in call to CG: " << ierr << ".\n" << endl; + if (rank==0) HPCG_fout << "Call [" << i << "] Scaled Residual [" << normr/normr0 << "]" << endl; + testnorms_data.values[i] = normr/normr0; // Record scaled residual from this run + } + + // Compute difference between known exact solution and computed solution + // All processors are needed here. +#ifdef HPCG_DEBUG + double residual = 0; + ierr = ComputeResidual(A.localNumberOfRows, x, xexact, residual); + if (ierr) HPCG_fout << "Error in call to compute_residual: " << ierr << ".\n" << endl; + if (rank==0) HPCG_fout << "Difference between computed and exact = " << residual << ".\n" << endl; +#endif + + // Test Norm Results + ierr = TestNorms(testnorms_data); + + //////////////////// + // Report Results // + //////////////////// + + // Report results to YAML file + ReportResults(A, numberOfMgLevels, numberOfCgSets, refMaxIters, optMaxIters, ×[0], testcg_data, testsymmetry_data, testnorms_data, global_failure); + + // Clean up + DeleteMatrix(A); // This delete will recursively delete all coarse grid data + DeleteCGData(data); + DeleteVector(x); + DeleteVector(b); + DeleteVector(xexact); + DeleteVector(x_overlap); + DeleteVector(b_computed); + delete [] testnorms_data.values; + + + + HPCG_Finalize(); + + // Finish up +#ifndef HPCG_NOMPI + MPI_Finalize(); +#endif + return 0 ; +} diff --git a/tests/apps/hpcg/tools/hpcg.dox b/tests/apps/hpcg/tools/hpcg.dox new file mode 100644 index 0000000000..0f4f9b983a --- /dev/null +++ b/tests/apps/hpcg/tools/hpcg.dox @@ -0,0 +1,1869 @@ +# Doxyfile 1.8.3.1 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project. +# +# All text after a hash (#) is considered a comment and will be ignored. +# The format is: +# TAG = value [value, ...] +# For lists items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (" "). + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# http://www.gnu.org/software/libiconv for the list of possible encodings. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or sequence of words) that should +# identify the project. Note that if you do not use Doxywizard you need +# to put quotes around the project name if it contains spaces. + +PROJECT_NAME = HPCG + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. +# This could be handy for archiving the generated documentation or +# if some version control system is used. + +PROJECT_NUMBER ="Version 2.4" + +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer +# a quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = "High Performance Preconditioned CG solver benchmark" + +# With the PROJECT_LOGO tag one can specify an logo or icon that is +# included in the documentation. The maximum height of the logo should not +# exceed 55 pixels and the maximum width should not exceed 200 pixels. +# Doxygen will copy the logo to the output directory. + +PROJECT_LOGO = + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) +# base path where the generated documentation will be put. +# If a relative path is entered, it will be relative to the location +# where doxygen was started. If left blank the current directory will be used. + +OUTPUT_DIRECTORY = out/ + +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create +# 4096 sub-directories (in 2 levels) under the output directory of each output +# format and will distribute the generated files over these directories. +# Enabling this option can be useful when feeding doxygen a huge amount of +# source files, where putting all generated files in the same directory would +# otherwise cause performance problems for the file system. + +CREATE_SUBDIRS = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# The default language is English, other supported languages are: +# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, +# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, +# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English +# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, +# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak, +# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will +# include brief member descriptions after the members that are listed in +# the file and class documentation (similar to JavaDoc). +# Set to NO to disable this. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend +# the brief description of a member or function before the detailed description. +# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator +# that is used to form the text in various listings. Each string +# in this list, if found as the leading text of the brief description, will be +# stripped from the text and the result after processing the whole list, is +# used as the annotated text. Otherwise, the brief description is used as-is. +# If left blank, the following values are used ("$name" is automatically +# replaced with the name of the entity): "The $name class" "The $name widget" +# "The $name file" "is" "provides" "specifies" "contains" +# "represents" "a" "an" "the" + +ABBREVIATE_BRIEF = + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# Doxygen will generate a detailed section even if there is only a brief +# description. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full +# path before files name in the file list and in the header files. If set +# to NO the shortest path that makes the file name unique will be used. + +FULL_PATH_NAMES = YES + +# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag +# can be used to strip a user-defined part of the path. Stripping is +# only done if one of the specified strings matches the left-hand part of +# the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the +# path to strip. Note that you specify absolute paths here, but also +# relative paths, which will be relative from the directory where doxygen is +# started. + +STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of +# the path mentioned in the documentation of a class, which tells +# the reader which header file to include in order to use a class. +# If left blank only the name of the header file containing the class +# definition is used. Otherwise one should specify the include paths that +# are normally passed to the compiler using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter +# (but less readable) file names. This can be useful if your file system +# doesn't support long names like on DOS, Mac, or CD-ROM. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen +# will interpret the first line (until the first dot) of a JavaDoc-style +# comment as the brief description. If set to NO, the JavaDoc +# comments will behave just like regular Qt-style comments +# (thus requiring an explicit @brief command for a brief description.) + +JAVADOC_AUTOBRIEF = NO + +# If the QT_AUTOBRIEF tag is set to YES then Doxygen will +# interpret the first line (until the first dot) of a Qt-style +# comment as the brief description. If set to NO, the comments +# will behave just like regular Qt-style comments (thus requiring +# an explicit \brief command for a brief description.) + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen +# treat a multi-line C++ special comment block (i.e. a block of //! or /// +# comments) as a brief description. This used to be the default behaviour. +# The new default is to treat a multi-line C++ comment block as a detailed +# description. Set this tag to YES if you prefer the old behaviour instead. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented +# member inherits the documentation from any documented member that it +# re-implements. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce +# a new page for each member. If set to NO, the documentation of a member will +# be part of the file/class/namespace that contains it. + +SEPARATE_MEMBER_PAGES = YES + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. +# Doxygen uses this value to replace tabs by spaces in code fragments. + +TAB_SIZE = 4 + +# This tag can be used to specify a number of aliases that acts +# as commands in the documentation. An alias has the form "name=value". +# For example adding "sideeffect=\par Side Effects:\n" will allow you to +# put the command \sideeffect (or @sideeffect) in the documentation, which +# will result in a user-defined paragraph with heading "Side Effects:". +# You can put \n's in the value part of an alias to insert newlines. + +ALIASES = + +# This tag can be used to specify a number of word-keyword mappings (TCL only). +# A mapping has the form "name=value". For example adding +# "class=itcl::class" will allow you to use the command class in the +# itcl::class meaning. + +TCL_SUBST = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C +# sources only. Doxygen will then generate output that is more tailored for C. +# For instance, some of the names that are used will be different. The list +# of all members will be omitted, etc. + +OPTIMIZE_OUTPUT_FOR_C = YES + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java +# sources only. Doxygen will then generate output that is more tailored for +# Java. For instance, namespaces will be presented as packages, qualified +# scopes will look different, etc. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources only. Doxygen will then generate output that is more tailored for +# Fortran. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for +# VHDL. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given +# extension. Doxygen has a built-in mapping, but you can override or extend it +# using this tag. The format is ext=language, where ext is a file extension, +# and language is one of the parsers supported by doxygen: IDL, Java, +# Javascript, CSharp, C, C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, +# C++. For instance to make doxygen treat .inc files as Fortran files (default +# is PHP), and .f files as C (default is Fortran), use: inc=Fortran f=C. Note +# that for custom extensions you also need to set FILE_PATTERNS otherwise the +# files are not read by doxygen. + +EXTENSION_MAPPING = + +# If MARKDOWN_SUPPORT is enabled (the default) then doxygen pre-processes all +# comments according to the Markdown format, which allows for more readable +# documentation. See http://daringfireball.net/projects/markdown/ for details. +# The output of markdown processing is further processed by doxygen, so you +# can mix doxygen, HTML, and XML commands with Markdown formatting. +# Disable only in case of backward compatibilities issues. + +MARKDOWN_SUPPORT = YES + +# When enabled doxygen tries to link words that correspond to documented classes, +# or namespaces to their corresponding documentation. Such a link can be +# prevented in individual cases by by putting a % sign in front of the word or +# globally by setting AUTOLINK_SUPPORT to NO. + +AUTOLINK_SUPPORT = YES + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should +# set this tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. +# func(std::string) {}). This also makes the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. +# Doxygen will parse them like normal C++ but will assume all classes use public +# instead of private inheritance when no explicit protection keyword is present. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate +# getter and setter methods for a property. Setting this option to YES (the +# default) will make doxygen replace the get and set methods by a property in +# the documentation. This will only work if the methods are indeed getting or +# setting a simple type. If this is not the case, or you want to show the +# methods anyway, you should set this option to NO. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. + +DISTRIBUTE_GROUP_DOC = NO + +# Set the SUBGROUPING tag to YES (the default) to allow class member groups of +# the same type (for instance a group of public functions) to be put as a +# subgroup of that type (e.g. under the Public Functions section). Set it to +# NO to prevent subgrouping. Alternatively, this can be done per class using +# the \nosubgrouping command. + +SUBGROUPING = YES + +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and +# unions are shown inside the group in which they are included (e.g. using +# @ingroup) instead of on a separate page (for HTML and Man pages) or +# section (for LaTeX and RTF). + +INLINE_GROUPED_CLASSES = NO + +# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and +# unions with only public data fields will be shown inline in the documentation +# of the scope in which they are defined (i.e. file, namespace, or group +# documentation), provided this scope is documented. If set to NO (the default), +# structs, classes, and unions are shown on a separate page (for HTML and Man +# pages) or section (for LaTeX and RTF). + +INLINE_SIMPLE_STRUCTS = NO + +# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum +# is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically +# be useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. + +TYPEDEF_HIDES_STRUCT = YES + +# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to +# determine which symbols to keep in memory and which to flush to disk. +# When the cache is full, less often used symbols will be written to disk. +# For small to medium size projects (<1000 input files) the default value is +# probably good enough. For larger projects a too small cache size can cause +# doxygen to be busy swapping symbols to and from disk most of the time +# causing a significant performance penalty. +# If the system has enough physical memory increasing the cache will improve the +# performance by keeping more symbols in memory. Note that the value works on +# a logarithmic scale so increasing the size by one will roughly double the +# memory usage. The cache size is given by this formula: +# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, +# corresponding to a cache size of 2^16 = 65536 symbols. + +SYMBOL_CACHE_SIZE = 4 + +# Similar to the SYMBOL_CACHE_SIZE the size of the symbol lookup cache can be +# set using LOOKUP_CACHE_SIZE. This cache is used to resolve symbols given +# their name and scope. Since this can be an expensive process and often the +# same symbol appear multiple times in the code, doxygen keeps a cache of +# pre-resolved symbols. If the cache is too small doxygen will become slower. +# If the cache is too large, memory is wasted. The cache size is given by this +# formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range is 0..9, the default is 0, +# corresponding to a cache size of 2^16 = 65536 symbols. + +LOOKUP_CACHE_SIZE = 0 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. +# Private class members and static file members will be hidden unless +# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES + +EXTRACT_ALL = NO + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class +# will be included in the documentation. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal +# scope will be included in the documentation. + +EXTRACT_PACKAGE = NO + +# If the EXTRACT_STATIC tag is set to YES all static members of a file +# will be included in the documentation. + +EXTRACT_STATIC = NO + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) +# defined locally in source files will be included in the documentation. +# If set to NO only classes defined in header files are included. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. When set to YES local +# methods, which are defined in the implementation section but not in +# the interface are included in the documentation. +# If set to NO (the default) only methods in the interface are included. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base +# name of the file that contains the anonymous namespace. By default +# anonymous namespaces are hidden. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all +# undocumented members of documented classes, files or namespaces. +# If set to NO (the default) these members will be included in the +# various overviews, but no documentation section is generated. +# This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. +# If set to NO (the default) these classes will be included in the various +# overviews. This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all +# friend (class|struct|union) declarations. +# If set to NO (the default) these declarations will be included in the +# documentation. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any +# documentation blocks found inside the body of a function. +# If set to NO (the default) these blocks will be appended to the +# function's detailed documentation block. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation +# that is typed after a \internal command is included. If the tag is set +# to NO (the default) then the documentation will be excluded. +# Set it to YES to include the internal documentation. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate +# file names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. + +CASE_SENSE_NAMES = YES + +# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen +# will show members with their full class and namespace scopes in the +# documentation. If set to YES the scope will be hidden. + +HIDE_SCOPE_NAMES = NO + +# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen +# will put a list of the files that are included by a file in the documentation +# of that file. + +SHOW_INCLUDE_FILES = YES + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen +# will list include files with double quotes in the documentation +# rather than with sharp brackets. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] +# is inserted in the documentation for inline members. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen +# will sort the (detailed) documentation of file and class members +# alphabetically by member name. If set to NO the members will appear in +# declaration order. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the +# brief documentation of file, namespace and class members alphabetically +# by member name. If set to NO (the default) the members will appear in +# declaration order. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen +# will sort the (brief and detailed) documentation of class members so that +# constructors and destructors are listed first. If set to NO (the default) +# the constructors will appear in the respective orders defined by +# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. +# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO +# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the +# hierarchy of group names into alphabetical order. If set to NO (the default) +# the group names will appear in their defined order. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be +# sorted by fully-qualified names, including namespaces. If set to +# NO (the default), the class list will be sorted only by class name, +# not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the +# alphabetical list. + +SORT_BY_SCOPE_NAME = NO + +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to +# do proper type resolution of all parameters of a function it will reject a +# match between the prototype and the implementation of a member function even +# if there is only one candidate or it is obvious which candidate to choose +# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen +# will still accept a match between prototype and implementation in such cases. + +STRICT_PROTO_MATCHING = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or +# disable (NO) the todo list. This list is created by putting \todo +# commands in the documentation. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or +# disable (NO) the test list. This list is created by putting \test +# commands in the documentation. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or +# disable (NO) the bug list. This list is created by putting \bug +# commands in the documentation. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or +# disable (NO) the deprecated list. This list is created by putting +# \deprecated commands in the documentation. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional +# documentation sections, marked by \if section-label ... \endif +# and \cond section-label ... \endcond blocks. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines +# the initial value of a variable or macro consists of for it to appear in +# the documentation. If the initializer consists of more lines than specified +# here it will be hidden. Use a value of 0 to hide initializers completely. +# The appearance of the initializer of individual variables and macros in the +# documentation can be controlled using \showinitializer or \hideinitializer +# command in the documentation regardless of this setting. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated +# at the bottom of the documentation of classes and structs. If set to YES the +# list will mention the files that were used to generate the documentation. + +SHOW_USED_FILES = YES + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. +# This will remove the Files entry from the Quick Index and from the +# Folder Tree View (if specified). The default is YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the +# Namespaces page. +# This will remove the Namespaces entry from the Quick Index +# and from the Folder Tree View (if specified). The default is YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command , where is the value of +# the FILE_VERSION_FILTER tag, and is the name of an input file +# provided by doxygen. Whatever the program writes to standard output +# is used as the file version. See the manual for examples. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. To create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. +# You can optionally specify a file name after the option, if omitted +# DoxygenLayout.xml will be used as the name of the layout file. + +LAYOUT_FILE = + +# The CITE_BIB_FILES tag can be used to specify one or more bib files +# containing the references data. This must be a list of .bib files. The +# .bib extension is automatically appended if omitted. Using this command +# requires the bibtex tool to be installed. See also +# http://en.wikipedia.org/wiki/BibTeX for more info. For LaTeX the style +# of the bibliography can be controlled using LATEX_BIB_STYLE. To use this +# feature you need bibtex and perl available in the search path. Do not use +# file names with spaces, bibtex cannot handle them. + +CITE_BIB_FILES = + +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated +# by doxygen. Possible values are YES and NO. If left blank NO is used. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated by doxygen. Possible values are YES and NO. If left blank +# NO is used. + +WARNINGS = YES + +# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings +# for undocumented members. If EXTRACT_ALL is set to YES then this flag will +# automatically be disabled. + +WARN_IF_UNDOCUMENTED = YES + +# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some +# parameters in a documented function, or documenting parameters that +# don't exist or using markup commands wrongly. + +WARN_IF_DOC_ERROR = YES + +# The WARN_NO_PARAMDOC option can be enabled to get warnings for +# functions that are documented, but have no documentation for their parameters +# or return value. If set to NO (the default) doxygen will only warn about +# wrong or incomplete parameter documentation, but not about the absence of +# documentation. + +WARN_NO_PARAMDOC = YES + +# The WARN_FORMAT tag determines the format of the warning messages that +# doxygen can produce. The string should contain the $file, $line, and $text +# tags, which will be replaced by the file and line number from which the +# warning originated and the warning text. Optionally the format may contain +# $version, which will be replaced by the version of the file (if it could +# be obtained via FILE_VERSION_FILTER) + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning +# and error messages should be written. If left blank the output is written +# to stderr. + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag can be used to specify the files and/or directories that contain +# documented source files. You may enter file names like "myfile.cpp" or +# directories like "/usr/src/myproject". Separate the files or directories +# with spaces. + +INPUT = index.doc src testing + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is +# also the default input encoding. Doxygen uses libiconv (or the iconv built +# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for +# the list of possible encodings. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank the following patterns are tested: +# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh +# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py +# *.f90 *.f *.for *.vhd *.vhdl + +FILE_PATTERNS = + +# The RECURSIVE tag can be used to turn specify whether or not subdirectories +# should be searched for input files as well. Possible values are YES and NO. +# If left blank NO is used. + +RECURSIVE = YES + +# The EXCLUDE tag can be used to specify files and/or directories that should be +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. +# Note that relative paths are relative to the directory from which doxygen is +# run. + +EXCLUDE = + +# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or +# directories that are symbolic links (a Unix file system feature) are excluded +# from the input. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. Note that the wildcards are matched +# against the file with absolute path, so to exclude all test directories +# for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or +# directories that contain example code fragments that are included (see +# the \include command). + +EXAMPLE_PATH = . + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank all files are included. + +EXAMPLE_PATTERNS = + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude +# commands irrespective of the value of the RECURSIVE tag. +# Possible values are YES and NO. If left blank NO is used. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or +# directories that contain image that are included in the documentation (see +# the \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command , where +# is the value of the INPUT_FILTER tag, and is the name of an +# input file. Doxygen will then use the output that the filter program writes +# to standard output. +# If FILTER_PATTERNS is specified, this tag will be +# ignored. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. +# Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. +# The filters are a list of the form: +# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further +# info on how filters are used. If FILTER_PATTERNS is empty or if +# non of the patterns match the file name, INPUT_FILTER is applied. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will be used to filter the input files when producing source +# files to browse (i.e. when SOURCE_BROWSER is set to YES). + +FILTER_SOURCE_FILES = NO + +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) +# and it is also possible to disable source filtering for a specific pattern +# using *.ext= (so without naming a filter). This option only has effect when +# FILTER_SOURCE_FILES is enabled. + +FILTER_SOURCE_PATTERNS = + +# If the USE_MD_FILE_AS_MAINPAGE tag refers to the name of a markdown file that +# is part of the input, its contents will be placed on the main page (index.html). +# This can be useful if you have a project on for instance GitHub and want reuse +# the introduction page also for the doxygen output. + +USE_MDFILE_AS_MAINPAGE = + +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will +# be generated. Documented entities will be cross-referenced with these sources. +# Note: To get rid of all source code in the generated output, make sure also +# VERBATIM_HEADERS is set to NO. + +SOURCE_BROWSER = YES + +# Setting the INLINE_SOURCES tag to YES will include the body +# of functions and classes directly in the documentation. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct +# doxygen to hide any special comment blocks from generated source code +# fragments. Normal C, C++ and Fortran comments will always remain visible. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES +# then for each documented function all documented +# functions referencing it will be listed. + +REFERENCED_BY_RELATION = NO + +# If the REFERENCES_RELATION tag is set to YES +# then for each documented function all documented entities +# called/used by that function will be listed. + +REFERENCES_RELATION = NO + +# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) +# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from +# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will +# link to the source code. +# Otherwise they will link to the documentation. + +REFERENCES_LINK_SOURCE = YES + +# If the USE_HTAGS tag is set to YES then the references to source code +# will point to the HTML generated by the htags(1) tool instead of doxygen +# built-in source browser. The htags tool is part of GNU's global source +# tagging system (see http://www.gnu.org/software/global/global.html). You +# will need version 4.8.6 or higher. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen +# will generate a verbatim copy of the header file for each class for +# which an include is specified. Set to NO to disable this. + +VERBATIM_HEADERS = YES + +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index +# of all compounds will be generated. Enable this if the project +# contains a lot of classes, structs, unions or interfaces. + +ALPHABETICAL_INDEX = YES + +# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then +# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns +# in which this list will be split (can be a number in the range [1..20]) + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all +# classes will be put under the same header in the alphabetical index. +# The IGNORE_PREFIX tag can be used to specify one or more prefixes that +# should be ignored while generating the index headers. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES (the default) Doxygen will +# generate HTML output. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `html' will be used as the default path. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for +# each generated HTML page (for example: .htm,.php,.asp). If it is left blank +# doxygen will generate files with .html extension. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a personal HTML header for +# each generated HTML page. If it is left blank doxygen will generate a +# standard header. Note that when using a custom header you are responsible +# for the proper inclusion of any scripts and style sheets that doxygen +# needs, which is dependent on the configuration options used. +# It is advised to generate a default header using "doxygen -w html +# header.html footer.html stylesheet.css YourConfigFile" and then modify +# that header. Note that the header is subject to change so you typically +# have to redo this when upgrading to a newer version of doxygen or when +# changing the value of configuration settings such as GENERATE_TREEVIEW! + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a personal HTML footer for +# each generated HTML page. If it is left blank doxygen will generate a +# standard footer. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading +# style sheet that is used by each HTML page. It can be used to +# fine-tune the look of the HTML output. If left blank doxygen will +# generate a default style sheet. Note that it is recommended to use +# HTML_EXTRA_STYLESHEET instead of this one, as it is more robust and this +# tag will in the future become obsolete. + +HTML_STYLESHEET = + +# The HTML_EXTRA_STYLESHEET tag can be used to specify an additional +# user-defined cascading style sheet that is included after the standard +# style sheets created by doxygen. Using this option one can overrule +# certain style aspects. This is preferred over using HTML_STYLESHEET +# since it does not replace the standard style sheet and is therefor more +# robust against future updates. Doxygen will copy the style sheet file to +# the output directory. + +HTML_EXTRA_STYLESHEET = + +# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the HTML output directory. Note +# that these files will be copied to the base HTML output directory. Use the +# $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these +# files. In the HTML_STYLESHEET file, use the file name only. Also note that +# the files will be copied as-is; there are no commands or markers available. + +HTML_EXTRA_FILES = + +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. +# Doxygen will adjust the colors in the style sheet and background images +# according to this color. Hue is specified as an angle on a colorwheel, +# see http://en.wikipedia.org/wiki/Hue for more information. +# For instance the value 0 represents red, 60 is yellow, 120 is green, +# 180 is cyan, 240 is blue, 300 purple, and 360 is red again. +# The allowed range is 0 to 359. + +HTML_COLORSTYLE_HUE = 220 + +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of +# the colors in the HTML output. For a value of 0 the output will use +# grayscales only. A value of 255 will produce the most vivid colors. + +HTML_COLORSTYLE_SAT = 100 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to +# the luminance component of the colors in the HTML output. Values below +# 100 gradually make the output lighter, whereas values above 100 make +# the output darker. The value divided by 100 is the actual gamma applied, +# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2, +# and 100 does not change the gamma. + +HTML_COLORSTYLE_GAMMA = 80 + +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting +# this to NO can help when comparing the output of multiple runs. + +HTML_TIMESTAMP = YES + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. + +HTML_DYNAMIC_SECTIONS = NO + +# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of +# entries shown in the various tree structured indices initially; the user +# can expand and collapse entries dynamically later on. Doxygen will expand +# the tree to such a level that at most the specified number of entries are +# visible (unless a fully collapsed tree already exceeds this amount). +# So setting the number of entries 1 will produce a full collapsed tree by +# default. 0 is a special value representing an infinite number of entries +# and will result in a full expanded tree by default. + +HTML_INDEX_NUM_ENTRIES = 100 + +# If the GENERATE_DOCSET tag is set to YES, additional index files +# will be generated that can be used as input for Apple's Xcode 3 +# integrated development environment, introduced with OSX 10.5 (Leopard). +# To create a documentation set, doxygen will generate a Makefile in the +# HTML output directory. Running make will produce the docset in that +# directory and running "make install" will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find +# it at startup. +# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html +# for more information. + +GENERATE_DOCSET = NO + +# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the +# feed. A documentation feed provides an umbrella under which multiple +# documentation sets from a single provider (such as a company or product suite) +# can be grouped. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that +# should uniquely identify the documentation set bundle. This should be a +# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen +# will append .docset to the name. + +DOCSET_BUNDLE_ID = edu.utk.icl.hpcg + +# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely +# identify the documentation publisher. This should be a reverse domain-name +# style string, e.g. com.mycompany.MyDocSet.documentation. + +DOCSET_PUBLISHER_ID = edu.utk.icl + +# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher. + +DOCSET_PUBLISHER_NAME = Publisher + +# If the GENERATE_HTMLHELP tag is set to YES, additional index files +# will be generated that can be used as input for tools like the +# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) +# of the generated HTML documentation. + +GENERATE_HTMLHELP = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can +# be used to specify the file name of the resulting .chm file. You +# can add a path in front of the file if the result should not be +# written to the html output directory. + +CHM_FILE = + +# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can +# be used to specify the location (absolute path including file name) of +# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run +# the HTML help compiler on the generated index.hhp. + +HHC_LOCATION = + +# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag +# controls if a separate .chi index file is generated (YES) or that +# it should be included in the master .chm file (NO). + +GENERATE_CHI = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING +# is used to encode HtmlHelp index (hhk), content (hhc) and project file +# content. + +CHM_INDEX_ENCODING = + +# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag +# controls whether a binary table of contents is generated (YES) or a +# normal table of contents (NO) in the .chm file. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members +# to the contents of the HTML help documentation and to the tree view. + +TOC_EXPAND = NO + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated +# that can be used as input for Qt's qhelpgenerator to generate a +# Qt Compressed Help (.qch) of the generated HTML documentation. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can +# be used to specify the file name of the resulting .qch file. +# The path specified is relative to the HTML output folder. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#namespace + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#virtual-folders + +QHP_VIRTUAL_FOLDER = doc + +# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to +# add. For more information please see +# http://doc.trolltech.com/qthelpproject.html#custom-filters + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see +# +# Qt Help Project / Custom Filters. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this +# project's +# filter section matches. +# +# Qt Help Project / Filter Attributes. + +QHP_SECT_FILTER_ATTRS = + +# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can +# be used to specify the location of Qt's qhelpgenerator. +# If non-empty doxygen will try to run qhelpgenerator on the generated +# .qhp file. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files +# will be generated, which together with the HTML files, form an Eclipse help +# plugin. To install this plugin and make it available under the help contents +# menu in Eclipse, the contents of the directory containing the HTML and XML +# files needs to be copied into the plugins directory of eclipse. The name of +# the directory within the plugins directory should be the same as +# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before +# the help appears. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have +# this name. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# The DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) +# at top of each HTML page. The value NO (the default) enables the index and +# the value YES disables it. Since the tabs have the same information as the +# navigation tree you can set this option to NO if you already set +# GENERATE_TREEVIEW to YES. + +DISABLE_INDEX = NO + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. +# If the tag value is set to YES, a side panel will be generated +# containing a tree-like index structure (just like the one that +# is generated for HTML Help). For this to work a browser that supports +# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). +# Windows users are probably better off using the HTML help feature. +# Since the tree basically has the same information as the tab index you +# could consider to set DISABLE_INDEX to NO when enabling this option. + +GENERATE_TREEVIEW = YES + +# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values +# (range [0,1..20]) that doxygen will group on one line in the generated HTML +# documentation. Note that a value of 0 will completely suppress the enum +# values from appearing in the overview section. + +ENUM_VALUES_PER_LINE = 4 + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be +# used to set the initial width (in pixels) of the frame in which the tree +# is shown. + +TREEVIEW_WIDTH = 250 + +# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open +# links to external symbols imported via tag files in a separate window. + +EXT_LINKS_IN_WINDOW = NO + +# Use this tag to change the font size of Latex formulas included +# as images in the HTML documentation. The default is 10. Note that +# when you change the font size after a successful doxygen run you need +# to manually remove any form_*.png images from the HTML output directory +# to force them to be regenerated. + +FORMULA_FONTSIZE = 10 + +# Use the FORMULA_TRANPARENT tag to determine whether or not the images +# generated for formulas are transparent PNGs. Transparent PNGs are +# not supported properly for IE 6.0, but are supported on all modern browsers. +# Note that when changing this option you need to delete any form_*.png files +# in the HTML output before the changes have effect. + +FORMULA_TRANSPARENT = YES + +# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax +# (see http://www.mathjax.org) which uses client side Javascript for the +# rendering instead of using prerendered bitmaps. Use this if you do not +# have LaTeX installed or if you want to formulas look prettier in the HTML +# output. When enabled you may also need to install MathJax separately and +# configure the path to it using the MATHJAX_RELPATH option. + +USE_MATHJAX = NO + +# When MathJax is enabled you can set the default output format to be used for +# thA MathJax output. Supported types are HTML-CSS, NativeMML (i.e. MathML) and +# SVG. The default value is HTML-CSS, which is slower, but has the best +# compatibility. + +MATHJAX_FORMAT = HTML-CSS + +# When MathJax is enabled you need to specify the location relative to the +# HTML output directory using the MATHJAX_RELPATH option. The destination +# directory should contain the MathJax.js script. For instance, if the mathjax +# directory is located at the same level as the HTML output directory, then +# MATHJAX_RELPATH should be ../mathjax. The default value points to +# the MathJax Content Delivery Network so you can quickly see the result without +# installing MathJax. +# However, it is strongly recommended to install a local +# copy of MathJax from http://www.mathjax.org before deployment. + +MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest + +# The MATHJAX_EXTENSIONS tag can be used to specify one or MathJax extension +# names that should be enabled during MathJax rendering. + +MATHJAX_EXTENSIONS = + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box +# for the HTML output. The underlying search engine uses javascript +# and DHTML and should work on any modern browser. Note that when using +# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets +# (GENERATE_DOCSET) there is already a search function so this one should +# typically be disabled. For large projects the javascript based search engine +# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. + +SEARCHENGINE = YES + +# When the SERVER_BASED_SEARCH tag is enabled the search engine will be +# implemented using a web server instead of a web client using Javascript. +# There are two flavours of web server based search depending on the +# EXTERNAL_SEARCH setting. When disabled, doxygen will generate a PHP script for +# searching and an index file used by the script. When EXTERNAL_SEARCH is +# enabled the indexing and searching needs to be provided by external tools. +# See the manual for details. + +SERVER_BASED_SEARCH = NO + +# When EXTERNAL_SEARCH is enabled doxygen will no longer generate the PHP +# script for searching. Instead the search results are written to an XML file +# which needs to be processed by an external indexer. Doxygen will invoke an +# external search engine pointed to by the SEARCHENGINE_URL option to obtain +# the search results. Doxygen ships with an example indexer (doxyindexer) and +# search engine (doxysearch.cgi) which are based on the open source search engine +# library Xapian. See the manual for configuration details. + +EXTERNAL_SEARCH = NO + +# The SEARCHENGINE_URL should point to a search engine hosted by a web server +# which will returned the search results when EXTERNAL_SEARCH is enabled. +# Doxygen ships with an example search engine (doxysearch) which is based on +# the open source search engine library Xapian. See the manual for configuration +# details. + +SEARCHENGINE_URL = + +# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed +# search data is written to a file for indexing by an external tool. With the +# SEARCHDATA_FILE tag the name of this file can be specified. + +SEARCHDATA_FILE = searchdata.xml + +# When SERVER_BASED_SEARCH AND EXTERNAL_SEARCH are both enabled the +# EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is +# useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple +# projects and redirect the results back to the right project. + +EXTERNAL_SEARCH_ID = + +# The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen +# projects other than the one defined by this configuration file, but that are +# all added to the same external search index. Each project needs to have a +# unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id +# of to a relative location where the documentation can be found. +# The format is: EXTRA_SEARCH_MAPPINGS = id1=loc1 id2=loc2 ... + +EXTRA_SEARCH_MAPPINGS = + +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- + +# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will +# generate Latex output. + +GENERATE_LATEX = YES + +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `latex' will be used as the default path. + +LATEX_OUTPUT = latex + +# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be +# invoked. If left blank `latex' will be used as the default command name. +# Note that when enabling USE_PDFLATEX this option is only used for +# generating bitmaps for formulas in the HTML output, but not in the +# Makefile that is written to the output directory. + +LATEX_CMD_NAME = latex + +# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to +# generate index for LaTeX. If left blank `makeindex' will be used as the +# default command name. + +MAKEINDEX_CMD_NAME = makeindex + +# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact +# LaTeX documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_LATEX = NO + +# The PAPER_TYPE tag can be used to set the paper type that is used +# by the printer. Possible values are: a4, letter, legal and +# executive. If left blank a4wide will be used. + +PAPER_TYPE = letter + +# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX +# packages that should be included in the LaTeX output. + +EXTRA_PACKAGES = kpfonts + +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for +# the generated latex document. The header should contain everything until +# the first chapter. If it is left blank doxygen will generate a +# standard header. Notice: only use this tag if you know what you are doing! + +LATEX_HEADER = + +# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for +# the generated latex document. The footer should contain everything after +# the last chapter. If it is left blank doxygen will generate a +# standard footer. Notice: only use this tag if you know what you are doing! + +LATEX_FOOTER = + +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated +# is prepared for conversion to pdf (using ps2pdf). The pdf file will +# contain links (just like the HTML output) instead of page references +# This makes the output suitable for online browsing using a pdf viewer. + +PDF_HYPERLINKS = YES + +# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of +# plain latex in the generated Makefile. Set this option to YES to get a +# higher quality PDF documentation. + +USE_PDFLATEX = YES + +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. +# command to the generated LaTeX files. This will instruct LaTeX to keep +# running if errors occur, instead of asking the user for help. +# This option is also used when generating formulas in HTML. + +LATEX_BATCHMODE = NO + +# If LATEX_HIDE_INDICES is set to YES then doxygen will not +# include the index chapters (such as File Index, Compound Index, etc.) +# in the output. + +LATEX_HIDE_INDICES = NO + +# If LATEX_SOURCE_CODE is set to YES then doxygen will include +# source code with syntax highlighting in the LaTeX output. +# Note that which sources are shown also depends on other settings +# such as SOURCE_BROWSER. + +LATEX_SOURCE_CODE = YES + +# The LATEX_BIB_STYLE tag can be used to specify the style to use for the +# bibliography, e.g. plainnat, or ieeetr. The default style is "plain". See +# http://en.wikipedia.org/wiki/BibTeX for more info. + +LATEX_BIB_STYLE = plain + +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- + +# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output +# The RTF output is optimized for Word 97 and may not look very pretty with +# other RTF readers or editors. + +GENERATE_RTF = NO + +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `rtf' will be used as the default path. + +RTF_OUTPUT = rtf + +# If the COMPACT_RTF tag is set to YES Doxygen generates more compact +# RTF documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_RTF = NO + +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated +# will contain hyperlink fields. The RTF file will +# contain links (just like the HTML output) instead of page references. +# This makes the output suitable for online browsing using WORD or other +# programs which support those fields. +# Note: wordpad (write) and others do not support links. + +RTF_HYPERLINKS = NO + +# Load style sheet definitions from file. Syntax is similar to doxygen's +# config file, i.e. a series of assignments. You only have to provide +# replacements, missing definitions are set to their default value. + +RTF_STYLESHEET_FILE = + +# Set optional variables used in the generation of an rtf document. +# Syntax is similar to doxygen's config file. + +RTF_EXTENSIONS_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- + +# If the GENERATE_MAN tag is set to YES (the default) Doxygen will +# generate man pages + +GENERATE_MAN = YES + +# The MAN_OUTPUT tag is used to specify where the man pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `man' will be used as the default path. + +MAN_OUTPUT = man + +# The MAN_EXTENSION tag determines the extension that is added to +# the generated man pages (default is the subroutine's section .3) + +MAN_EXTENSION = .3 + +# If the MAN_LINKS tag is set to YES and Doxygen generates man output, +# then it will generate one additional man file for each entity +# documented in the real man page(s). These additional files +# only source the real man page, but without them the man command +# would be unable to find the correct page. The default is NO. + +MAN_LINKS = NO + +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- + +# If the GENERATE_XML tag is set to YES Doxygen will +# generate an XML file that captures the structure of +# the code including all documentation. + +GENERATE_XML = NO + +# The XML_OUTPUT tag is used to specify where the XML pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `xml' will be used as the default path. + +XML_OUTPUT = xml + +# The XML_SCHEMA tag can be used to specify an XML schema, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_SCHEMA = + +# The XML_DTD tag can be used to specify an XML DTD, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_DTD = + +# If the XML_PROGRAMLISTING tag is set to YES Doxygen will +# dump the program listings (including syntax highlighting +# and cross-referencing information) to the XML output. Note that +# enabling this will significantly increase the size of the XML output. + +XML_PROGRAMLISTING = YES + +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- + +# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will +# generate an AutoGen Definitions (see autogen.sf.net) file +# that captures the structure of the code including all +# documentation. Note that this feature is still experimental +# and incomplete at the moment. + +GENERATE_AUTOGEN_DEF = NO + +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- + +# If the GENERATE_PERLMOD tag is set to YES Doxygen will +# generate a Perl module file that captures the structure of +# the code including all documentation. Note that this +# feature is still experimental and incomplete at the +# moment. + +GENERATE_PERLMOD = NO + +# If the PERLMOD_LATEX tag is set to YES Doxygen will generate +# the necessary Makefile rules, Perl scripts and LaTeX code to be able +# to generate PDF and DVI output from the Perl module output. + +PERLMOD_LATEX = NO + +# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be +# nicely formatted so it can be parsed by a human reader. +# This is useful +# if you want to understand what is going on. +# On the other hand, if this +# tag is set to NO the size of the Perl module output will be much smaller +# and Perl will parse it just the same. + +PERLMOD_PRETTY = YES + +# The names of the make variables in the generated doxyrules.make file +# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. +# This is useful so different doxyrules.make files included by the same +# Makefile don't overwrite each other's variables. + +PERLMOD_MAKEVAR_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- + +# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will +# evaluate all C-preprocessor directives found in the sources and include +# files. + +ENABLE_PREPROCESSING = YES + +# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro +# names in the source code. If set to NO (the default) only conditional +# compilation will be performed. Macro expansion can be done in a controlled +# way by setting EXPAND_ONLY_PREDEF to YES. + +MACRO_EXPANSION = NO + +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES +# then the macro expansion is limited to the macros specified with the +# PREDEFINED and EXPAND_AS_DEFINED tags. + +EXPAND_ONLY_PREDEF = NO + +# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files +# pointed to by INCLUDE_PATH will be searched when a #include is found. + +SEARCH_INCLUDES = YES + +# The INCLUDE_PATH tag can be used to specify one or more directories that +# contain include files that are not input files but should be processed by +# the preprocessor. + +INCLUDE_PATH = + +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard +# patterns (like *.h and *.hpp) to filter out the header-files in the +# directories. If left blank, the patterns specified with FILE_PATTERNS will +# be used. + +INCLUDE_FILE_PATTERNS = + +# The PREDEFINED tag can be used to specify one or more macro names that +# are defined before the preprocessor is started (similar to the -D option of +# gcc). The argument of the tag is a list of macros of the form: name +# or name=definition (no spaces). If the definition and the = are +# omitted =1 is assumed. To prevent a macro definition from being +# undefined via #undef or recursively expanded use the := operator +# instead of the = operator. + +PREDEFINED = + +# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then +# this tag can be used to specify a list of macro names that should be expanded. +# The macro definition that is found in the sources will be used. +# Use the PREDEFINED tag if you want to use a different macro definition that +# overrules the definition found in the source code. + +EXPAND_AS_DEFINED = + +# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then +# doxygen's preprocessor will remove all references to function-like macros +# that are alone on a line, have an all uppercase name, and do not end with a +# semicolon, because these will confuse the parser if not removed. + +SKIP_FUNCTION_MACROS = NO + +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- + +# The TAGFILES option can be used to specify one or more tagfiles. For each +# tag file the location of the external documentation should be added. The +# format of a tag file without this location is as follows: +# +# TAGFILES = file1 file2 ... +# Adding location for the tag files is done as follows: +# +# TAGFILES = file1=loc1 "file2 = loc2" ... +# where "loc1" and "loc2" can be relative or absolute paths +# or URLs. Note that each tag file must have a unique name (where the name does +# NOT include the path). If a tag file is not located in the directory in which +# doxygen is run, you must also specify the path to the tagfile here. + +TAGFILES = + +# When a file name is specified after GENERATE_TAGFILE, doxygen will create +# a tag file that is based on the input files it reads. + +GENERATE_TAGFILE = + +# If the ALLEXTERNALS tag is set to YES all external classes will be listed +# in the class index. If set to NO only the inherited external classes +# will be listed. + +ALLEXTERNALS = NO + +# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will +# be listed. + +EXTERNAL_GROUPS = YES + +# The PERL_PATH should be the absolute path and name of the perl script +# interpreter (i.e. the result of `which perl'). + +PERL_PATH = /usr/bin/perl + +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- + +# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will +# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base +# or super classes. Setting the tag to NO turns the diagrams off. Note that +# this option also works with HAVE_DOT disabled, but it is recommended to +# install and use dot, since it yields more powerful graphs. + +CLASS_DIAGRAMS = YES + +# You can define message sequence charts within doxygen comments using the \msc +# command. Doxygen will then run the mscgen tool (see +# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the +# documentation. The MSCGEN_PATH tag allows you to specify the directory where +# the mscgen tool resides. If left empty the tool is assumed to be found in the +# default search path. + +MSCGEN_PATH = + +# If set to YES, the inheritance and collaboration graphs will hide +# inheritance and usage relations if the target is undocumented +# or is not a class. + +HIDE_UNDOC_RELATIONS = YES + +# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is +# available from the path. This tool is part of Graphviz, a graph visualization +# toolkit from AT&T and Lucent Bell Labs. The other options in this section +# have no effect if this option is set to NO (the default) + +HAVE_DOT = YES + +# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is +# allowed to run in parallel. When set to 0 (the default) doxygen will +# base this on the number of processors available in the system. You can set it +# explicitly to a value larger than 0 to get control over the balance +# between CPU load and processing speed. + +DOT_NUM_THREADS = 0 + +# By default doxygen will use the Helvetica font for all dot files that +# doxygen generates. When you want a differently looking font you can specify +# the font name using DOT_FONTNAME. You need to make sure dot is able to find +# the font, which can be done by putting it in a standard location or by setting +# the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the +# directory containing the font. + +DOT_FONTNAME = Helvetica + +# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. +# The default size is 10pt. + +DOT_FONTSIZE = 10 + +# By default doxygen will tell dot to use the Helvetica font. +# If you specify a different font using DOT_FONTNAME you can use DOT_FONTPATH to +# set the path where dot can find it. + +DOT_FONTPATH = + +# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect inheritance relations. Setting this tag to YES will force the +# CLASS_DIAGRAMS tag to NO. + +CLASS_GRAPH = YES + +# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect implementation dependencies (inheritance, containment, and +# class references variables) of the class with other documented classes. + +COLLABORATION_GRAPH = YES + +# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for groups, showing the direct groups dependencies + +GROUP_GRAPHS = YES + +# If the UML_LOOK tag is set to YES doxygen will generate inheritance and +# collaboration diagrams in a style similar to the OMG's Unified Modeling +# Language. + +UML_LOOK = YES + +# If the UML_LOOK tag is enabled, the fields and methods are shown inside +# the class node. If there are many fields or methods and many nodes the +# graph may become too big to be useful. The UML_LIMIT_NUM_FIELDS +# threshold limits the number of items for each type to make the size more +# managable. Set this to 0 for no limit. Note that the threshold may be +# exceeded by 50% before the limit is enforced. + +UML_LIMIT_NUM_FIELDS = 10 + +# If set to YES, the inheritance and collaboration graphs will show the +# relations between templates and their instances. + +TEMPLATE_RELATIONS = NO + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT +# tags are set to YES then doxygen will generate a graph for each documented +# file showing the direct and indirect include dependencies of the file with +# other documented files. + +INCLUDE_GRAPH = YES + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and +# HAVE_DOT tags are set to YES then doxygen will generate a graph for each +# documented header file showing the documented files that directly or +# indirectly include this file. + +INCLUDED_BY_GRAPH = YES + +# If the CALL_GRAPH and HAVE_DOT options are set to YES then +# doxygen will generate a call dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable call graphs +# for selected functions only using the \callgraph command. + +CALL_GRAPH = NO + +# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then +# doxygen will generate a caller dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable caller +# graphs for selected functions only using the \callergraph command. + +CALLER_GRAPH = NO + +# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen +# will generate a graphical hierarchy of all classes instead of a textual one. + +GRAPHICAL_HIERARCHY = YES + +# If the DIRECTORY_GRAPH and HAVE_DOT tags are set to YES +# then doxygen will show the dependencies a directory has on other directories +# in a graphical way. The dependency relations are determined by the #include +# relations between the files in the directories. + +DIRECTORY_GRAPH = YES + +# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images +# generated by dot. Possible values are svg, png, jpg, or gif. +# If left blank png will be used. If you choose svg you need to set +# HTML_FILE_EXTENSION to xhtml in order to make the SVG files +# visible in IE 9+ (other browsers do not have this requirement). + +DOT_IMAGE_FORMAT = png + +# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to +# enable generation of interactive SVG images that allow zooming and panning. +# Note that this requires a modern browser other than Internet Explorer. +# Tested and working are Firefox, Chrome, Safari, and Opera. For IE 9+ you +# need to set HTML_FILE_EXTENSION to xhtml in order to make the SVG files +# visible. Older versions of IE do not have SVG support. + +INTERACTIVE_SVG = YES + +# The tag DOT_PATH can be used to specify the path where the dot tool can be +# found. If left blank, it is assumed the dot tool can be found in the path. + +DOT_PATH = + +# The DOTFILE_DIRS tag can be used to specify one or more directories that +# contain dot files that are included in the documentation (see the +# \dotfile command). + +DOTFILE_DIRS = + +# The MSCFILE_DIRS tag can be used to specify one or more directories that +# contain msc files that are included in the documentation (see the +# \mscfile command). + +MSCFILE_DIRS = + +# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of +# nodes that will be shown in the graph. If the number of nodes in a graph +# becomes larger than this value, doxygen will truncate the graph, which is +# visualized by representing a node as a red box. Note that doxygen if the +# number of direct children of the root node in a graph is already larger than +# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note +# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. + +DOT_GRAPH_MAX_NODES = 50 + +# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the +# graphs generated by dot. A depth value of 3 means that only nodes reachable +# from the root by following a path via at most 3 edges will be shown. Nodes +# that lay further from the root node will be omitted. Note that setting this +# option to 1 or 2 may greatly reduce the computation time needed for large +# code bases. Also note that the size of a graph can be further restricted by +# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. + +MAX_DOT_GRAPH_DEPTH = 0 + +# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent +# background. This is disabled by default, because dot on Windows does not +# seem to support this out of the box. Warning: Depending on the platform used, +# enabling this option may lead to badly anti-aliased labels on the edges of +# a graph (i.e. they become hard to read). + +DOT_TRANSPARENT = NO + +# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output +# files in one run (i.e. multiple -o and -T options on the command line). This +# makes dot run faster, but since only newer versions of dot (>1.8.10) +# support this, this feature is disabled by default. + +DOT_MULTI_TARGETS = NO + +# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will +# generate a legend page explaining the meaning of the various boxes and +# arrows in the dot generated graphs. + +GENERATE_LEGEND = YES + +# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will +# remove the intermediate dot files that are used to generate +# the various graphs. + +DOT_CLEANUP = YES diff --git a/tests/apps/miniDFT/.gitignore b/tests/apps/miniDFT/.gitignore new file mode 100644 index 0000000000..3266f21e80 --- /dev/null +++ b/tests/apps/miniDFT/.gitignore @@ -0,0 +1,7 @@ +*~ +log.miniDFT +family-*/ +compile +test-driver +test-suite.log.orig +job.*.out diff --git a/tests/apps/miniDFT/Makefile.am b/tests/apps/miniDFT/Makefile.am new file mode 100644 index 0000000000..39cbee2e65 --- /dev/null +++ b/tests/apps/miniDFT/Makefile.am @@ -0,0 +1,3 @@ +AUTOMAKE_OPTIONS = foreign +AM_MAKEFLAGS = --no-print-directory +SUBDIRS = tests diff --git a/tests/apps/miniDFT/bootstrap b/tests/apps/miniDFT/bootstrap new file mode 120000 index 0000000000..b17b398013 --- /dev/null +++ b/tests/apps/miniDFT/bootstrap @@ -0,0 +1 @@ +../../bootstrap \ No newline at end of file diff --git a/tests/apps/miniDFT/configure.ac b/tests/apps/miniDFT/configure.ac new file mode 100644 index 0000000000..dc9644b8db --- /dev/null +++ b/tests/apps/miniDFT/configure.ac @@ -0,0 +1,35 @@ +AC_PREREQ([2.63]) +AC_INIT([miniDFT], [0.10.0], [karl.w.schulz@intel.com]) +AM_INIT_AUTOMAKE +m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) + +# set compilers to use MPI toolchain + +CC=mpicc +CXX=mpicxx +FC=mpif90 + +# test compilers + +AC_PROG_CC +AC_PROG_FC +AC_PROG_CXX + +AC_OUTPUT( Makefile tests/Makefile) + +echo +echo '-------------------------------------------------- SUMMARY --------------------------------------------------' +echo +echo Package version............... : $PACKAGE-$VERSION +echo OHPC compiler toolchain........ : $LMOD_FAMILY_COMPILER +echo OHPC MPI toolchain............. : $LMOD_FAMILY_MPI +echo +echo C compiler.................... : `which $CC` +echo C++ compiler.................. : `which $CXX` +echo Fortran compiler ............. : `which $FC` +echo +echo C compiler flags.............. : $CFLAGS +echo C++ compiler flags............ : $CXXFLAGS +echo Fortran compiler flags........ : $FCFLAGS +echo +echo '-------------------------------------------------------------------------------------------------------------' diff --git a/tests/apps/miniDFT/ohpc-tests/test_miniDFT b/tests/apps/miniDFT/ohpc-tests/test_miniDFT new file mode 100755 index 0000000000..9b6d958544 --- /dev/null +++ b/tests/apps/miniDFT/ohpc-tests/test_miniDFT @@ -0,0 +1,62 @@ +#!/bin/bash +# -*-sh-*- + +TEST_LOGS="" +MAKEFLAGS="" + +source ./TEST_ENV || exit 1 +source ./common/functions || exit 1 + +cd apps/miniDFT || exit 1 +export BATS_JUNIT_CLASS=MiniDFT + +# bootstrap the local autotools project + +./bootstrap || exit 1 + +rm -f tests/test/miniDFT.*.out tests/log.miniDFT >& /dev/null + +make_check_failure=0 + +for compiler in $COMPILER_FAMILIES ; do + # for mpi in $MPI_FAMILIES ; do + # skip openmpi temporarily - need libmkl_blacs_openmpi_*.so + for mpi in ${MPI_FAMILIES//openmpi} ; do + echo " " + echo " " + echo "-------------------------------------------------------" + echo "Apps: MiniDFT tests: $compiler-$mpi" + echo "-------------------------------------------------------" + + module purge || exit 1 + module load prun || exit 1 + module load $compiler || exit 1 + module load $mpi || exit 1 + if [ $compiler == "gnu" ];then + module load mkl || exit 1 + fi + + ./configure || exit 1 + make clean || exit 1 + + make -k check + if [ $? != 0 ] ; then + make_check_failure=1 + fi + + save_logs_mpi_family tests $compiler $mpi + + make distclean + done +done + +echo " " +echo " " +echo "-------------------------------------------------------" +echo "Apps: MiniDFT tests: Results Summary" +echo "-------------------------------------------------------" +printf "%-24s %-10s %-10s %16s %16s\n" \ +Run_ID Compiler MPI_Stack Reference_Time Current_Time +cat tests/log.miniDFT + +exit $make_check_failure diff --git a/tests/apps/miniDFT/tests/ChangeLog b/tests/apps/miniDFT/tests/ChangeLog new file mode 100644 index 0000000000..3703bb74e7 --- /dev/null +++ b/tests/apps/miniDFT/tests/ChangeLog @@ -0,0 +1,31 @@ +01-June-2013 v1.06 B. Austin + * README: removed 10k MPI task constraint for capability run + +28-May-2013 v1.05 B. Austin + * src/init_run.f90: force stop if npool != nkpoint + * src/c_bands.f90 hinit0.f90 init_run.f90 openfil.f90 + version.f90 wfcinit.f90: added ifdef to override new force stop + * README: updated to describe force stop behavior. + * src/pwscf.f90: renamed IPM regions + +25-April-2013 v1.04 B. Austin + * README: described capability improvement experiment + * benchmark/*.out.ref: moved to sample_outputs/*.out.ref, and updated + * benchmark/*.in and espresso/benchmark/*.in: + renamed single-node.in and large.in + * Added benchmark/*.pbs - sample queue scripts + +18-April-2013 v1.03 B. Austin + * src/pwscf.f90: added IPM regions (ifdef protected) + * src/Makefile.hopper.*: added optional (default=off) IPM defines + * benchmark/magnesia_10_130.out.ref: updated reference output + +27-March-2013 v1.02 B. Austin + * README: define concurrency for MPI-only tests. + * Added ChangeLog + +22-March-2013 v1.01 B. Austin + * src/*.UPF src/*.nml: removed pseudopotential files from src directory + +02-March-2013 v1.0 B. Austin + * Initial check-in diff --git a/tests/apps/miniDFT/tests/License b/tests/apps/miniDFT/tests/License new file mode 100644 index 0000000000..5b6e7c66c2 --- /dev/null +++ b/tests/apps/miniDFT/tests/License @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/tests/apps/miniDFT/tests/Makefile.am b/tests/apps/miniDFT/tests/Makefile.am new file mode 100644 index 0000000000..4e868308fc --- /dev/null +++ b/tests/apps/miniDFT/tests/Makefile.am @@ -0,0 +1,5 @@ +TESTS_ENVIRONMENT = BATS_NO_SUMMARY=1 + +TESTS = build +TESTS += rm_execution_single_host +TESTS += rm_execution_multi_host diff --git a/tests/apps/miniDFT/tests/README b/tests/apps/miniDFT/tests/README new file mode 100644 index 0000000000..50c9ad0194 --- /dev/null +++ b/tests/apps/miniDFT/tests/README @@ -0,0 +1,125 @@ +This is the README file for MiniDFT 1.06. + +A.) Description + +Mini-DFT is a plane-wave denstity functional theory (DFT) mini-app for modeling materials. Given an set of atomic coordinates and pseudopotentials, mini-DFT computes self-consistent solutions of the Kohn-Sham equations using either the LDA or PBE exchange-correlation functionals. For each iteration of the self-consistent field cycle, the Fock matrix is constructed and then diagonalized. To build the Fock matrix, Fast Fourier Transforms are used to tranform orbitals from the plane wave basis ( where the kinetic energy is most readily compted ) to real space ( where the potential is evaluated ) and back. Davidson diagonalization is used to compute the orbital energies and update the orbital coefficients. + +The mini-DFT mini-app was excised from the general-purpose Quantum Espresso (QE) code . +Quantum Espresso is licensed per the GNU General Public License (GPL). +A copy of the GPL is provided in the 'License' file in this directory. + +The mini-DFT distribution consists for four top-level directories. +src: source code and makefiles for mini-DFT +test: small input files for build validation +benchmark: input files for performance measurement +espresso: mirrors the test and benchmark directories, but with QE-compatible input files + +B.) How to Build mini-DFT: + +B.0) Dependencies: mini-DFT requires ScaLAPACK, BLAS and FFT libraries. Mini-DFT calls the FFT routines through the FFTW3 interface. + +B.1) Define the mini-DFT root directory + +> export MDFT_ROOT=/path/to/mini-DFT + +B.2) Move to the src directory. + +> cd $MDFT_ROOT/src + +B.3) Configure manually... + a) Select the Makefile.system.compiler that most closely resembles your own. + b) Edit the chosen makefile to your liking. + NB: The first line of the makefile can be uncommented to enable OpenMP support. + c) Create a link to the selected makefile. + +> ln -s Makefile.system.compiler Makefile + +B.4) Initiate the build + +> make + +Note: parallel make (e.g., -j 4) will not work. + +B.5) Validate your build (optional): + +B.5.i) Move to the test directory. The two jobs in this directory are significantly smaller than either of the required benchmark runs, and can be used to quickly confirm that your build of mini-DFT gives correct results. These jobs can run with any concurrency less than about 70 MPI tasks. Section C provides more detail about how to run the code. + +> cd $MDFT_ROOT/test + +B.5.ii) The first test simulates a 3x3x3 super-cell for bulk silicon, using the LDA functional and a 30 Ry plane-wave cutoff. + +> mpirun -np 8 ./mini_dft -in Si_333.in > Si_333.out + +B.5.iii) The second test is a 2 x 2 x 2 super-cell for TiO2, using the PBE GGA functional and a 100 Ry plane-wave cutoff. + +B.5.iv) The output from these to runs can be compared to the Quantum Espresso output in the test directory. After the SCF has converged, the final value of the "total energy" should agree with the QE output to within 1e-6 Ry, regardless of the number of MPI tasks used. + +> diff QE_Si_333.out.ref Si_333.out +> diff QE_TiO2_222.out.ref TiO2_222.out + +C.) How to run mini-DFT: + +Mini-DFT accepts three mutally-compatible command line options. + +The -in flag (required) is used to identify the input file read by mini-DFT. + +The -ntg flag (optional) enables task-group parallelism to improve the parallel scalingof the FFTs. The number of task groups must be a divisor of the number of MPI ranks. The default value for ntg is 1. + +The -ndiag flag (optional) sets the number of MPI ranks used for diagonalizaton Ndiag must be a square integer. The default value for Ndiag is the largest square integer less than half the total number of MPI ranks. + +The -npool flag (optional) divides the MPI ranks into "pools". K-points are distributed among pools, and individual k-points can be evaluated with very little communication between pools. The default value for npool is 1. + +To run the code, do someting like: +export OMP_NUM_THREADS=2 +mpirun -np 32 ./mini_dft -in Si_333.in -ntg 4 -ndiag 25 > Si_333.out + +D.) Required Problems: +Input decks for for two problem sizes (single-node and large) are provided in the $MDFT_ROOT/benchmark directory. + + +D.1) Single_node case +The single-node input file (single-node.in) performs one SCF cycle for a 3x3x3 super-cell for TiO2, using the PBE GGA functional and a 120 Ry plane wave cutoff. Only one SCF iteration is performed, so the jobs will exit before the SCF cycle converges. Two runs are required: + +D.1.a) MPI-only: Un-optimized code using only MPI as an execution model is allowed (see RFP documentation). The MPI concurrency is fixed to 40 MPI tasks, but affinity (their placement of those tasks) is left to the discretion of the vendor. The -ndiag and -ntg flags may not be used. Please ensure that OpenMP is turned off for these runs. + +D.1.b) MPI+X: Using an additional parallelism-enabling API (such as OpenMP, etc), and any other possible optimizations (see RFP documentation) the vendor will return the result of a run that minimizes execution time with concurrency (MPI tasks and number of threads) and affinity at the discretion of the vendor. The -ndiag and -ntg flags may also be tuned by the vendor. + + +D.2) Large case +The large test case (large.in) performs one SCF cycle for a 10x10x10 super-cell of MgO, using the LDA functional and a 130 Ry plane wave cutoff. Only one SCF iteration is performed, so the jobs will exit before the SCF cycle converges. Two runs are required: + +D.2.a) MPI-only: As per (D.1.a) for the single node test, but the MPI concurrency is set to 10000 tasks. + +D.2.b) MPI+X: Same rules as for the optimized single node case but for a large problem that spans many nodes. This problem has been tested at 10000 MPI ranks in MPI-only mode + +D.3) Capability Improvement +Capability improvement measurements are enabled by increasing the number of k-points used in the large test case. The k-point grid is specified on the last two lines of large.in: + +K_POINTS automatic +nk1 nk2 nk3 1 1 1 + +To increase the number of k-points, adjust the (integer) parameters nk1, nk2 and nk3, which determine the size of the k-point integration grid. The number of k-points increases (roughly) linearly with the product nk1 * nk2 * nk3, though a significant fraction of these points are excluded due to symmetry. Grep for "number of k points" to determine the actual number of k-points used. The increase in capability for the capability improvement calculation is the increase in the number of k-oints used for the large problem (1). + +The rules for the capability improvement measurement are the same as the MPI+X case (D.1.b). The -npool command line argument should be set to the number of k-points. + +Advice to vendors: The number of k-points is printed at the beginning of a MiniDFT run, but cannot be easily counted beforehand to set -npool. A reasonable solution is to initiate a trial-run with -npool=1. The trial-run will print the number of k-points and stop if there is not an equal number of pools. Then restart with an appropriate value for npool. + + +E) Verification: +The benchmark runs are validated based on the total energy after one SCF cycle. The total energy should agree with the reference value to within 1e-6 Ry. The script validate_minidft.py should be used extract the energies and perform the comparison. + +> ./validate_minidft.py single-node.out +> ./validate_minidft.py large.out + +Reference output listings for the small and large case are in the ../sample_outputs directory. + +F.) Timing. + The time measured by the miniDFT benchmark excludes initialization and finalization stages. It is labeled "Benchmark_Time" (without quotes) and is on the final line of output. The Benchmark_Time is also printed by validate_minidft.py. + +G.) Reporting + +For the electronic submission, include all the source and the makefiles used to build on the target platform. Include all standard output files. + +H.) Authorship + +The mini-DFT mini-app was excised from the general-purpose Quantum Espresso http://www.quantum-espresso.org/ (QE) code. QE is an open-source program licensed per the GNU General Public License (GPL). A copy of the GPL is provided in the 'License' file in this directory. diff --git a/tests/apps/miniDFT/tests/TEST_ENV b/tests/apps/miniDFT/tests/TEST_ENV new file mode 100644 index 0000000000..75613439d8 --- /dev/null +++ b/tests/apps/miniDFT/tests/TEST_ENV @@ -0,0 +1,11 @@ +if [ -s ../../../TEST_ENV ];then + source ../../../TEST_ENV +fi + +CMD_TIMEOUT="15:00" +TEST_EXE="./src/mini_dft" +TEST_MAX_COMPUTES=4 +TEST_NUM_RANKS=4 +TEST_NUM_THREADS=2 +TEST_VERIFY=1 +TEST_PERFLOG=./log.miniDFT diff --git a/tests/apps/miniDFT/tests/benchmark/.gitignore b/tests/apps/miniDFT/tests/benchmark/.gitignore new file mode 100644 index 0000000000..821ed3f5cc --- /dev/null +++ b/tests/apps/miniDFT/tests/benchmark/.gitignore @@ -0,0 +1,4 @@ +*~ +*.err +*.log +*.out diff --git a/tests/apps/miniDFT/tests/benchmark/Mg.pz.nml b/tests/apps/miniDFT/tests/benchmark/Mg.pz.nml new file mode 100644 index 0000000000..1f08b94444 --- /dev/null +++ b/tests/apps/miniDFT/tests/benchmark/Mg.pz.nml @@ -0,0 +1,810 @@ + +&header + generated="Generated using BHS code" + author = "BHS" + date = "1982" + comment = "See Bachelet-Hamann-Schlueter paper: PRB26, 4199 (1982)" + psd = "Mg" + typ = "NC" + rel = "no" + tvanp = .false. + tpawp = .false. + tcoulombp= .false. + has_so = .false. + has_wfc = .false. + has_gipaw= .false. + nlcc = .false. + dft = "PZ " + zp = 2.000000000000000E+000 + etotps = 0.000000000000000E+000 + ecutwfc = 0.000000000000000E+000 + ecutrho = 0.000000000000000E+000 + nv = "0" + lmax = 0 + lmax_rho = 0 + lloc = 0 + nmesh = 425 + nwfc = 2 + nbeta = 1 +/ + +&mesh + dx = 2.439988682353512E-002 + nmesh = 425 + xmin =-5.075173815233834E+000 + rmax = 7.725134331853100E+001 + zmesh = 1.200000000000000E+001 + r(1:425) = + 1.52630324073E-03 1.56494179122E-03 1.60455848128E-03 1.64517807262E-03 + 1.68682595382E-03 1.72952815614E-03 1.77331136986E-03 1.81820296092E-03 + 1.86423098801E-03 1.91142422016E-03 1.95981215467E-03 2.00942503557E-03 + 2.06029387253E-03 2.11245046023E-03 2.16592739823E-03 2.22075811136E-03 + 2.27697687061E-03 2.33461881452E-03 2.39371997119E-03 2.45431728076E-03 + 2.51644861853E-03 2.58015281860E-03 2.64546969817E-03 2.71244008243E-03 + 2.78110583003E-03 2.85150985931E-03 2.92369617507E-03 2.99770989612E-03 + 3.07359728344E-03 3.15140576911E-03 3.23118398598E-03 3.31298179802E-03 + 3.39685033153E-03 3.48284200708E-03 3.57101057225E-03 3.66141113528E-03 + 3.75410019946E-03 3.84913569847E-03 3.94657703260E-03 4.04648510583E-03 + 4.14892236399E-03 4.25395283368E-03 4.36164216237E-03 4.47205765939E-03 + 4.58526833803E-03 4.70134495865E-03 4.82036007290E-03 4.94238806912E-03 + 5.06750521877E-03 5.19578972414E-03 5.32732176723E-03 5.46218355984E-03 + 5.60045939498E-03 5.74223569956E-03 5.88760108837E-03 6.03664641952E-03 + 6.18946485119E-03 6.34615189988E-03 6.50680550010E-03 6.67152606556E-03 + 6.84041655199E-03 7.01358252144E-03 7.19113220828E-03 7.37317658684E-03 + 7.55982944078E-03 7.75120743422E-03 7.94743018463E-03 8.14862033761E-03 + 8.35490364357E-03 8.56640903627E-03 8.78326871349E-03 9.00561821957E-03 + 9.23359653019E-03 9.46734613923E-03 9.70701314779E-03 9.95274735556E-03 + 1.02047023544E-02 1.04630356244E-02 1.07279086323E-02 1.09994869323E-02 + 1.12779402697E-02 1.15634426869E-02 1.18561726322E-02 1.21563130714E-02 + 1.24640516019E-02 1.27795805704E-02 1.31030971928E-02 1.34348036775E-02 + 1.37749073518E-02 1.41236207916E-02 1.44811619542E-02 1.48477543144E-02 + 1.52236270044E-02 1.56090149568E-02 1.60041590517E-02 1.64093062670E-02 + 1.68247098329E-02 1.72506293901E-02 1.76873311522E-02 1.81350880721E-02 + 1.85941800124E-02 1.90648939204E-02 1.95475240078E-02 2.00423719340E-02 + 2.05497469951E-02 2.10699663171E-02 2.16033550538E-02 2.21502465907E-02 + 2.27109827528E-02 2.32859140185E-02 2.38753997383E-02 2.44798083603E-02 + 2.50995176594E-02 2.57349149740E-02 2.63863974483E-02 2.70543722799E-02 + 2.77392569748E-02 2.84414796084E-02 2.91614790926E-02 2.98997054505E-02 + 3.06566200976E-02 3.14326961303E-02 3.22284186212E-02 3.30442849229E-02 + 3.38808049784E-02 3.47385016399E-02 3.56179109957E-02 3.65195827054E-02 + 3.74440803431E-02 3.83919817499E-02 3.93638793951E-02 4.03603807463E-02 + 4.13821086493E-02 4.24297017173E-02 4.35038147301E-02 4.46051190432E-02 + 4.57343030078E-02 4.68920724006E-02 4.80791508650E-02 4.92962803639E-02 + 5.05442216427E-02 5.18237547054E-02 5.31356793018E-02 5.44808154275E-02 + 5.58600038363E-02 5.72741065659E-02 5.87240074766E-02 6.02106128035E-02 + 6.17348517235E-02 6.32976769354E-02 6.49000652560E-02 6.65430182299E-02 + 6.82275627565E-02 6.99547517308E-02 7.17256647021E-02 7.35414085487E-02 + 7.54031181697E-02 7.73119571940E-02 7.92691187084E-02 8.12758260024E-02 + 8.33333333333E-02 8.54429267104E-02 8.76059246980E-02 8.98236792404E-02 + 9.20975765063E-02 9.44290377556E-02 9.68195202274E-02 9.92705180510E-02 + 1.01783563180E-01 1.04360226349E-01 1.07002118057E-01 1.09710889572E-01 + 1.12488233965E-01 1.15335887165E-01 1.18255629049E-01 1.21249284552E-01 + 1.24318724803E-01 1.27465868305E-01 1.30692682124E-01 1.34001183124E-01 + 1.37393439225E-01 1.40871570698E-01 1.44437751489E-01 1.48094210576E-01 + 1.51843233366E-01 1.55687163119E-01 1.59628402418E-01 1.63669414664E-01 + 1.67812725623E-01 1.72060924997E-01 1.76416668051E-01 1.80882677265E-01 + 1.85461744041E-01 1.90156730444E-01 1.94970570994E-01 1.99906274497E-01 + 2.04966925930E-01 2.10155688363E-01 2.15475804943E-01 2.20930600915E-01 + 2.26523485705E-01 2.32257955047E-01 2.38137593172E-01 2.44166075044E-01 + 2.50347168662E-01 2.56684737410E-01 2.63182742474E-01 2.69845245320E-01 + 2.76676410228E-01 2.83680506899E-01 2.90861913122E-01 2.98225117508E-01 + 3.05774722302E-01 3.13515446250E-01 3.21452127558E-01 3.29589726910E-01 + 3.37933330570E-01 3.46488153563E-01 3.55259542931E-01 3.64252981077E-01 + 3.73474089195E-01 3.82928630776E-01 3.92622515216E-01 4.02561801509E-01 + 4.12752702033E-01 4.23201586432E-01 4.33914985598E-01 4.44899595756E-01 + 4.56162282644E-01 4.67710085808E-01 4.79550223000E-01 4.91690094693E-01 + 5.04137288701E-01 5.16899584925E-01 5.29984960217E-01 5.43401593361E-01 + 5.57157870190E-01 5.71262388825E-01 5.85723965049E-01 6.00551637818E-01 + 6.15754674911E-01 6.31342578720E-01 6.47325092192E-01 6.63712204920E-01 + 6.80514159381E-01 6.97741457344E-01 7.15404866431E-01 7.33515426849E-01 + 7.52084458286E-01 7.71123566992E-01 7.90644653030E-01 8.10659917713E-01 + 8.31181871235E-01 8.52223340483E-01 8.73797477061E-01 8.95917765506E-01 + 9.18598031720E-01 9.41852451607E-01 9.65695559935E-01 9.90142259425E-01 + 1.01520783006E+00 1.04090793863E+00 1.06725864856E+00 1.09427642987E+00 + 1.12197816958E+00 1.15038118217E+00 1.17950322045E+00 1.20936248663E+00 + 1.23997764374E+00 1.27136782724E+00 1.30355265702E+00 1.33655224964E+00 + 1.37038723092E+00 1.40507874884E+00 1.44064848671E+00 1.47711867679E+00 + 1.51451211412E+00 1.55285217082E+00 1.59216281069E+00 1.63246860413E+00 + 1.67379474360E+00 1.71616705927E+00 1.75961203521E+00 1.80415682596E+00 + 1.84982927345E+00 1.89665792446E+00 1.94467204841E+00 1.99390165570E+00 + 2.04437751643E+00 2.09613117965E+00 2.14919499310E+00 2.20360212338E+00 + 2.25938657672E+00 2.31658322022E+00 2.37522780365E+00 2.43535698177E+00 + 2.49700833728E+00 2.56022040429E+00 2.62503269240E+00 2.69148571138E+00 + 2.75962099656E+00 2.82948113469E+00 2.90110979063E+00 2.97455173464E+00 + 3.04985287031E+00 3.12706026330E+00 3.20622217075E+00 3.28738807143E+00 + 3.37060869667E+00 3.45593606207E+00 3.54342350001E+00 3.63312569298E+00 + 3.72509870778E+00 3.81940003053E+00 3.91608860263E+00 4.01522485759E+00 + 4.11687075879E+00 4.22108983824E+00 4.32794723624E+00 4.43750974214E+00 + 4.54984583610E+00 4.66502573180E+00 4.78312142045E+00 4.90420671570E+00 + 5.02835729978E+00 5.15565077086E+00 5.28616669151E+00 5.41998663842E+00 + 5.55719425341E+00 5.69787529571E+00 5.84211769556E+00 5.99001160914E+00 + 6.14164947497E+00 6.29712607164E+00 6.45653857711E+00 6.61998662936E+00 + 6.78757238875E+00 6.95940060184E+00 7.13557866685E+00 7.31621670081E+00 + 7.50142760838E+00 7.69132715239E+00 7.88603402624E+00 8.08566992808E+00 + 8.29035963683E+00 8.50023109022E+00 8.71541546476E+00 8.93604725767E+00 + 9.16226437101E+00 9.39420819784E+00 9.63202371060E+00 9.87585955173E+00 + 1.01258681266E+01 1.03822056986E+01 1.06450324872E+01 1.09145127676E+01 + 1.11908149737E+01 1.14741118036E+01 1.17645803268E+01 1.20624020957E+01 + 1.23677632585E+01 1.26808546761E+01 1.30018720405E+01 1.33310159983E+01 + 1.36684922750E+01 1.40145118043E+01 1.43692908597E+01 1.47330511897E+01 + 1.51060201563E+01 1.54884308772E+01 1.58805223716E+01 1.62825397094E+01 + 1.66947341646E+01 1.71173633721E+01 1.75506914889E+01 1.79949893592E+01 + 1.84505346837E+01 1.89176121929E+01 1.93965138256E+01 1.98875389109E+01 + 2.03909943554E+01 2.09071948351E+01 2.14364629921E+01 2.19791296364E+01 + 2.25355339522E+01 2.31060237103E+01 2.36909554853E+01 2.42906948788E+01 + 2.49056167473E+01 2.55361054369E+01 2.61825550238E+01 2.68453695599E+01 + 2.75249633258E+01 2.82217610898E+01 2.89361983732E+01 2.96687217226E+01 + 3.04197889888E+01 3.11898696134E+01 3.19794449218E+01 3.27890084243E+01 + 3.36190661244E+01 3.44701368353E+01 3.53427525037E+01 3.62374585430E+01 + 3.71548141735E+01 3.80953927724E+01 3.90597822319E+01 4.00485853267E+01 + 4.10624200911E+01 4.21019202047E+01 4.31677353890E+01 4.42605318132E+01 + 4.53809925105E+01 4.65298178054E+01 4.77077257511E+01 4.89154525785E+01 + 5.01537531560E+01 5.14234014619E+01 5.27251910677E+01 5.40599356342E+01 + 5.54284694204E+01 5.68316478042E+01 5.82703478180E+01 5.97454686960E+01 + 6.12579324368E+01 + rab(1:425) = + 3.81575810182E-05 3.91235447806E-05 4.01139620321E-05 4.11294518156E-05 + 4.21706488454E-05 4.32382039035E-05 4.43327842466E-05 4.54550740230E-05 + 4.66057747003E-05 4.77856055040E-05 4.89953038667E-05 5.02356258892E-05 + 5.15073468132E-05 5.28112615057E-05 5.41481849557E-05 5.55189527841E-05 + 5.69244217652E-05 5.83654703630E-05 5.98429992797E-05 6.13579320190E-05 + 6.29112154632E-05 6.45038204650E-05 6.61367424543E-05 6.78110020606E-05 + 6.95276457507E-05 7.12877464826E-05 7.30924043768E-05 7.49427474030E-05 + 7.68399320859E-05 7.87851442278E-05 8.07795996494E-05 8.28245449505E-05 + 8.49212582883E-05 8.70710501769E-05 8.92752643063E-05 9.15352783821E-05 + 9.38525049866E-05 9.62283924618E-05 9.86644258149E-05 1.01162127646E-04 + 1.03723059100E-04 1.06348820842E-04 1.09041054059E-04 1.11801441485E-04 + 1.14631708451E-04 1.17533623966E-04 1.20509001823E-04 1.23559701728E-04 + 1.26687630469E-04 1.29894743103E-04 1.33183044181E-04 1.36554588996E-04 + 1.40011484874E-04 1.43555892489E-04 1.47190027209E-04 1.50916160488E-04 + 1.54736621280E-04 1.58653797497E-04 1.62670137502E-04 1.66788151639E-04 + 1.71010413800E-04 1.75339563036E-04 1.79778305207E-04 1.84329414671E-04 + 1.88995736020E-04 1.93780185856E-04 1.98685754616E-04 2.03715508440E-04 + 2.08872591089E-04 2.14160225907E-04 2.19581717837E-04 2.25140455489E-04 + 2.30839913255E-04 2.36683653481E-04 2.42675328695E-04 2.48818683889E-04 + 2.55117558860E-04 2.61575890611E-04 2.68197715808E-04 2.74987173308E-04 + 2.81948506743E-04 2.89086067173E-04 2.96404315805E-04 3.03907826784E-04 + 3.11601290047E-04 3.19489514260E-04 3.27577429820E-04 3.35870091937E-04 + 3.44372683795E-04 3.53090519791E-04 3.62029048855E-04 3.71193857860E-04 + 3.80590675110E-04 3.90225373921E-04 4.00103976293E-04 4.10232656675E-04 + 4.20617745822E-04 4.31265734752E-04 4.42183278806E-04 4.53377201803E-04 + 4.64854500309E-04 4.76622348011E-04 4.88688100195E-04 5.01059298351E-04 + 5.13743674878E-04 5.26749157927E-04 5.40083876346E-04 5.53756164769E-04 + 5.67774568821E-04 5.82147850461E-04 5.96884993459E-04 6.11995209007E-04 + 6.27487941484E-04 6.43372874350E-04 6.59659936206E-04 6.76359306997E-04 + 6.93481424371E-04 7.11036990210E-04 7.29036977315E-04 7.47492636262E-04 + 7.66415502441E-04 7.85817403257E-04 8.05710465530E-04 8.26107123073E-04 + 8.47020124460E-04 8.68462540997E-04 8.90447774893E-04 9.12989567635E-04 + 9.36102008578E-04 9.59799543748E-04 9.84096984877E-04 1.00900951866E-03 + 1.03455271623E-03 1.06074254293E-03 1.08759536825E-03 1.11512797608E-03 + 1.14335757520E-03 1.17230181001E-03 1.20197877163E-03 1.23240700910E-03 + 1.26360554107E-03 1.29559386764E-03 1.32839198255E-03 1.36202038569E-03 + 1.39650009591E-03 1.43185266415E-03 1.46810018691E-03 1.50526532009E-03 + 1.54337129309E-03 1.58244192339E-03 1.62250163140E-03 1.66357545575E-03 + 1.70568906891E-03 1.74886879327E-03 1.79314161755E-03 1.83853521372E-03 + 1.88507795424E-03 1.93279892985E-03 1.98172796771E-03 2.03189565006E-03 + 2.08333333333E-03 2.13607316776E-03 2.19014811745E-03 2.24559198101E-03 + 2.30243941266E-03 2.36072594389E-03 2.42048800568E-03 2.48176295128E-03 + 2.54458907950E-03 2.60900565873E-03 2.67505295143E-03 2.74277223931E-03 + 2.81220584912E-03 2.88339717913E-03 2.95639072624E-03 3.03123211379E-03 + 3.10796812009E-03 3.18664670763E-03 3.26731705310E-03 3.35002957810E-03 + 3.43483598063E-03 3.52178926746E-03 3.61094378722E-03 3.70235526440E-03 + 3.79608083415E-03 3.89217907798E-03 3.99071006045E-03 4.09173536660E-03 + 4.19531814056E-03 4.30152312493E-03 4.41041670128E-03 4.52206693163E-03 + 4.63654360103E-03 4.75391826110E-03 4.87426427485E-03 4.99765686243E-03 + 5.12417314824E-03 5.25389220908E-03 5.38689512357E-03 5.52326502288E-03 + 5.66308714262E-03 5.80644887618E-03 5.95343982930E-03 6.10415187611E-03 + 6.25867921656E-03 6.41711843525E-03 6.57956856185E-03 6.74613113300E-03 + 6.91691025570E-03 7.09201267248E-03 7.27154782805E-03 7.45562793771E-03 + 7.64436805754E-03 7.83788615625E-03 8.03630318895E-03 8.23974317275E-03 + 8.44833326426E-03 8.66220383908E-03 8.88148857327E-03 9.10632452694E-03 + 9.33685222987E-03 9.57321576939E-03 9.81556288040E-03 1.00640450377E-02 + 1.03188175508E-02 1.05800396608E-02 1.08478746400E-02 1.11224898939E-02 + 1.14040570661E-02 1.16927521452E-02 1.19887555750E-02 1.22922523673E-02 + 1.26034322175E-02 1.29224896231E-02 1.32496240054E-02 1.35850398340E-02 + 1.39289467547E-02 1.42815597206E-02 1.46430991262E-02 1.50137909455E-02 + 1.53938668728E-02 1.57835644680E-02 1.61831273048E-02 1.65928051230E-02 + 1.70128539845E-02 1.74435364336E-02 1.78851216608E-02 1.83378856712E-02 + 1.88021114572E-02 1.92780891748E-02 1.97661163257E-02 2.02664979428E-02 + 2.07795467809E-02 2.13055835121E-02 2.18449369265E-02 2.23979441377E-02 + 2.29649507930E-02 2.35463112902E-02 2.41423889984E-02 2.47535564856E-02 + 2.53801957515E-02 2.60226984658E-02 2.66814662139E-02 2.73569107469E-02 + 2.80494542396E-02 2.87595295543E-02 2.94875805112E-02 3.02340621658E-02 + 3.09994410935E-02 3.17841956810E-02 3.25888164254E-02 3.34138062409E-02 + 3.42596807731E-02 3.51269687210E-02 3.60162121678E-02 3.69279669197E-02 + 3.78628028530E-02 3.88213042706E-02 3.98040702671E-02 4.08117151033E-02 + 4.18448685900E-02 4.29041764817E-02 4.39903008803E-02 4.51039206490E-02 + 4.62457318363E-02 4.74164481115E-02 4.86168012103E-02 4.98475413924E-02 + 5.11094379106E-02 5.24032794913E-02 5.37298748275E-02 5.50900530845E-02 + 5.64846644180E-02 5.79145805056E-02 5.93806950912E-02 6.08839245442E-02 + 6.24252084321E-02 6.40055101073E-02 6.56258173099E-02 6.72871427846E-02 + 6.89905249139E-02 7.07370283672E-02 7.25277447658E-02 7.43637933659E-02 + 7.62463217577E-02 7.81765065825E-02 8.01555542688E-02 8.21847017858E-02 + 8.42652174168E-02 8.63984015517E-02 8.85855875001E-02 9.08281423244E-02 + 9.31274676944E-02 9.54850007632E-02 9.79022150658E-02 1.00380621440E-01 + 1.02921768970E-01 1.05527245956E-01 1.08198680906E-01 1.10937743554E-01 + 1.13746145902E-01 1.16625643295E-01 1.19578035511E-01 1.22605167892E-01 + 1.25708932495E-01 1.28891269272E-01 1.32154167288E-01 1.35499665960E-01 + 1.38929856335E-01 1.42446882393E-01 1.46052942389E-01 1.49750290228E-01 + 1.53541236874E-01 1.57428151791E-01 1.61413464428E-01 1.65499665734E-01 + 1.69689309719E-01 1.73985015046E-01 1.78389466671E-01 1.82905417520E-01 + 1.87535690209E-01 1.92283178810E-01 1.97150850656E-01 2.02141748202E-01 + 2.07258990921E-01 2.12505777256E-01 2.17885386619E-01 2.23401181442E-01 + 2.29056609275E-01 2.34855204946E-01 2.40800592765E-01 2.46896488793E-01 + 2.53146703164E-01 2.59555142465E-01 2.66125812179E-01 2.72862819189E-01 + 2.79770374344E-01 2.86852795089E-01 2.94114508170E-01 3.01560052392E-01 + 3.09194081464E-01 3.17021366901E-01 3.25046801013E-01 3.33275399957E-01 + 3.41712306875E-01 3.50362795108E-01 3.59232271493E-01 3.68326279743E-01 + 3.77650503907E-01 3.87210771929E-01 3.97013059289E-01 4.07063492734E-01 + 4.17368354114E-01 4.27934084302E-01 4.38767287222E-01 4.49874733980E-01 + 4.61263367092E-01 4.72940304823E-01 4.84912845641E-01 4.97188472772E-01 + 5.09774858884E-01 5.22679870877E-01 5.35911574804E-01 5.49478240910E-01 + 5.63388348804E-01 5.77650592757E-01 5.92273887133E-01 6.07267371969E-01 + 6.22640418681E-01 6.38402635924E-01 6.54563875595E-01 6.71134238997E-01 + 6.88124083145E-01 7.05544027246E-01 7.23404959331E-01 7.41718043064E-01 + 7.60494724719E-01 7.79746740334E-01 7.99486123044E-01 8.19725210606E-01 + 8.40476653110E-01 8.61753420881E-01 8.83568812593E-01 9.05936463576E-01 + 9.28870354339E-01 9.52384819310E-01 9.76494555797E-01 1.00121463317E+00 + 1.02656050228E+00 1.05254800512E+00 1.07919338473E+00 1.10651329533E+00 + 1.13452481276E+00 1.16324544514E+00 1.19269314378E+00 1.22288631446E+00 + 1.25384382890E+00 1.28558503655E+00 1.31812977669E+00 1.35149839086E+00 + 1.38571173551E+00 1.42079119511E+00 1.45675869545E+00 1.49363671740E+00 + 1.53144831092E+00 +/ + +&local +vloc(1:425) = + -1.75981408371E+00 -1.75981414086E+00 -1.75981420095E+00 -1.75981426411E+00 + -1.75981433051E+00 -1.75981440032E+00 -1.75981447370E+00 -1.75981455085E+00 + -1.75981463195E+00 -1.75981471721E+00 -1.75981480684E+00 -1.75981490107E+00 + -1.75981500013E+00 -1.75981510427E+00 -1.75981521374E+00 -1.75981532883E+00 + -1.75981544983E+00 -1.75981557702E+00 -1.75981571073E+00 -1.75981585130E+00 + -1.75981599908E+00 -1.75981615444E+00 -1.75981631776E+00 -1.75981648945E+00 + -1.75981666994E+00 -1.75981685969E+00 -1.75981705917E+00 -1.75981726888E+00 + -1.75981748933E+00 -1.75981772109E+00 -1.75981796473E+00 -1.75981822087E+00 + -1.75981849013E+00 -1.75981877320E+00 -1.75981907078E+00 -1.75981938362E+00 + -1.75981971250E+00 -1.75982005824E+00 -1.75982042171E+00 -1.75982080381E+00 + -1.75982120550E+00 -1.75982162778E+00 -1.75982207172E+00 -1.75982253841E+00 + -1.75982302903E+00 -1.75982354481E+00 -1.75982408702E+00 -1.75982465704E+00 + -1.75982525628E+00 -1.75982588624E+00 -1.75982654850E+00 -1.75982724471E+00 + -1.75982797661E+00 -1.75982874603E+00 -1.75982955490E+00 -1.75983040524E+00 + -1.75983129917E+00 -1.75983223893E+00 -1.75983322687E+00 -1.75983426545E+00 + -1.75983535728E+00 -1.75983650507E+00 -1.75983771171E+00 -1.75983898021E+00 + -1.75984031374E+00 -1.75984171562E+00 -1.75984318938E+00 -1.75984473868E+00 + -1.75984636740E+00 -1.75984807961E+00 -1.75984987959E+00 -1.75985177184E+00 + -1.75985376109E+00 -1.75985585230E+00 -1.75985805071E+00 -1.75986036180E+00 + -1.75986279136E+00 -1.75986534545E+00 -1.75986803045E+00 -1.75987085307E+00 + -1.75987382037E+00 -1.75987693975E+00 -1.75988021901E+00 -1.75988366634E+00 + -1.75988729035E+00 -1.75989110009E+00 -1.75989510507E+00 -1.75989931530E+00 + -1.75990374130E+00 -1.75990839410E+00 -1.75991328534E+00 -1.75991842721E+00 + -1.75992383257E+00 -1.75992951489E+00 -1.75993548836E+00 -1.75994176790E+00 + -1.75994836916E+00 -1.75995530863E+00 -1.75996260361E+00 -1.75997027231E+00 + -1.75997833385E+00 -1.75998680834E+00 -1.75999571691E+00 -1.76000508177E+00 + -1.76001492627E+00 -1.76002527496E+00 -1.76003615361E+00 -1.76004758933E+00 + -1.76005961063E+00 -1.76007224743E+00 -1.76008553121E+00 -1.76009949505E+00 + -1.76011417370E+00 -1.76012960369E+00 -1.76014582342E+00 -1.76016287323E+00 + -1.76018079553E+00 -1.76019963486E+00 -1.76021943805E+00 -1.76024025431E+00 + -1.76026213533E+00 -1.76028513545E+00 -1.76030931174E+00 -1.76033472420E+00 + -1.76036143585E+00 -1.76038951291E+00 -1.76041902494E+00 -1.76045004505E+00 + -1.76048265003E+00 -1.76051692054E+00 -1.76055294135E+00 -1.76059080146E+00 + -1.76063059441E+00 -1.76067241841E+00 -1.76071637665E+00 -1.76076257748E+00 + -1.76081113471E+00 -1.76086216786E+00 -1.76091580245E+00 -1.76097217027E+00 + -1.76103140970E+00 -1.76109366607E+00 -1.76115909190E+00 -1.76122784737E+00 + -1.76130010057E+00 -1.76137602799E+00 -1.76145581482E+00 -1.76153965546E+00 + -1.76162775389E+00 -1.76172032413E+00 -1.76181759077E+00 -1.76191978939E+00 + -1.76202716712E+00 -1.76213998318E+00 -1.76225850940E+00 -1.76238303084E+00 + -1.76251384636E+00 -1.76265126928E+00 -1.76279562799E+00 -1.76294726666E+00 + -1.76310654592E+00 -1.76327384359E+00 -1.76344955543E+00 -1.76363409589E+00 + -1.76382789894E+00 -1.76403141888E+00 -1.76424513119E+00 -1.76446953339E+00 + -1.76470514594E+00 -1.76495251318E+00 -1.76521220423E+00 -1.76548481399E+00 + -1.76577096408E+00 -1.76607130387E+00 -1.76638651146E+00 -1.76671729472E+00 + -1.76706439231E+00 -1.76742857475E+00 -1.76781064540E+00 -1.76821144153E+00 + -1.76863183536E+00 -1.76907273506E+00 -1.76953508571E+00 -1.77001987034E+00 + -1.77052811081E+00 -1.77106086869E+00 -1.77161924614E+00 -1.77220438666E+00 + -1.77281747579E+00 -1.77345974171E+00 -1.77413245576E+00 -1.77483693284E+00 + -1.77557453167E+00 -1.77634665490E+00 -1.77715474907E+00 -1.77800030434E+00 + -1.77888485412E+00 -1.77980997434E+00 -1.78077728256E+00 -1.78178843679E+00 + -1.78284513400E+00 -1.78394910835E+00 -1.78510212902E+00 -1.78630599774E+00 + -1.78756254586E+00 -1.78887363111E+00 -1.79024113382E+00 -1.79166695277E+00 + -1.79315300052E+00 -1.79470119835E+00 -1.79631347058E+00 -1.79799173855E+00 + -1.79973791402E+00 -1.80155389217E+00 -1.80344154406E+00 -1.80540270879E+00 + -1.80743918520E+00 -1.80955272331E+00 -1.81174501543E+00 -1.81401768719E+00 + -1.81637228846E+00 -1.81881028430E+00 -1.82133304611E+00 -1.82394184308E+00 + -1.82663783413E+00 -1.82942206048E+00 -1.83229543907E+00 -1.83525875691E+00 + -1.83831266670E+00 -1.84145768373E+00 -1.84469418423E+00 -1.84802240541E+00 + -1.85144244698E+00 -1.85495427440E+00 -1.85855772352E+00 -1.86225250656E+00 + -1.86603821889E+00 -1.86991434611E+00 -1.87388027070E+00 -1.87793527713E+00 + -1.88207855424E+00 -1.88630919315E+00 -1.89062617891E+00 -1.89502837347E+00 + -1.89951448744E+00 -1.90408303754E+00 -1.90873228654E+00 -1.91346016205E+00 + -1.91826415043E+00 -1.92314116209E+00 -1.92808736460E+00 -1.93309798014E+00 + -1.93816704487E+00 -1.94328712822E+00 -1.94844901197E+00 -1.95364132998E+00 + -1.95885017225E+00 -1.96405865877E+00 -1.96924649198E+00 -1.97438949941E+00 + -1.97945918145E+00 -1.98442228235E+00 -1.98924040530E+00 -1.99386969497E+00 + -1.99826061187E+00 -2.00235782326E+00 -2.00610023343E+00 -2.00942117264E+00 + -2.01224875813E+00 -2.01450643258E+00 -2.01611367498E+00 -2.01698686749E+00 + -2.01704028887E+00 -2.01618719334E+00 -2.01434092310E+00 -2.01141599662E+00 + -2.00732911365E+00 -2.00200002427E+00 -1.99535222433E+00 -1.98731346328E+00 + -1.97781608235E+00 -1.96679723850E+00 -1.95419910913E+00 -1.93996920718E+00 + -1.92406096066E+00 -1.90643471590E+00 -1.88705930385E+00 -1.86591425895E+00 + -1.84299269913E+00 -1.81830476814E+00 -1.79188141725E+00 -1.76377817923E+00 + -1.73407848326E+00 -1.70289599844E+00 -1.67037549518E+00 -1.63669179314E+00 + -1.60204652322E+00 -1.56666265885E+00 -1.53077704225E+00 -1.49463140556E+00 + -1.45846262084E+00 -1.42249306163E+00 -1.38692199095E+00 -1.35191879176E+00 + -1.31761863630E+00 -1.28412088406E+00 -1.25149015557E+00 -1.21975970933E+00 + -1.18893650497E+00 -1.15900720417E+00 -1.12994435389E+00 -1.10171210194E+00 + -1.07427097867E+00 -1.04758149717E+00 -1.02160653345E+00 -9.96312613184E-01 + -9.71670334700E-01 -9.47654196909E-01 -9.24242086363E-01 -9.01414629360E-01 + -8.79154551753E-01 -8.57446127876E-01 -8.36274750675E-01 -8.15626621983E-01 + -7.95488543962E-01 -7.75847786631E-01 -7.56692007597E-01 -7.38009204856E-01 + -7.19787689072E-01 -7.02016066554E-01 -6.84683227767E-01 -6.67778338543E-01 + -6.51290832594E-01 -6.35210404636E-01 -6.19527003863E-01 -6.04230827637E-01 + -5.89312315347E-01 -5.74762142439E-01 -5.60571214579E-01 -5.46730661977E-01 + -5.33231833836E-01 -5.20066292949E-01 -5.07225810425E-01 -4.94702360544E-01 + -4.82488115742E-01 -4.70575441719E-01 -4.58956892666E-01 -4.47625206611E-01 + -4.36573300881E-01 -4.25794267677E-01 -4.15281369750E-01 -4.05028036198E-01 + -3.95027858353E-01 -3.85274585779E-01 -3.75762122363E-01 -3.66484522505E-01 + -3.57435987404E-01 -3.48610861431E-01 -3.40003628595E-01 -3.31608909094E-01 + -3.23421455956E-01 -3.15436151757E-01 -3.07648005420E-01 -3.00052149102E-01 + -2.92643835145E-01 -2.85418433111E-01 -2.78371426888E-01 -2.71498411870E-01 + -2.64795092197E-01 -2.58257278076E-01 -2.51880883161E-01 -2.45661921997E-01 + -2.39596507532E-01 -2.33680848683E-01 -2.27911247972E-01 -2.22284099210E-01 + -2.16795885245E-01 -2.11443175767E-01 -2.06222625156E-01 -2.01130970399E-01 + -1.96165029046E-01 -1.91321697222E-01 -1.86597947687E-01 -1.81990827943E-01 + -1.77497458391E-01 -1.73115030529E-01 -1.68840805196E-01 -1.64672110862E-01 + -1.60606341959E-01 -1.56640957247E-01 -1.52773478232E-01 -1.49001487615E-01 + -1.45322627778E-01 -1.41734599314E-01 -1.38235159588E-01 -1.34822121337E-01 + -1.31493351301E-01 -1.28246768890E-01 -1.25080344884E-01 -1.21992100165E-01 + -1.18980104480E-01 -1.16042475233E-01 -1.13177376312E-01 -1.10383016934E-01 + -1.07657650535E-01 -1.04999573673E-01 -1.02407124962E-01 -9.98786840376E-02 + -9.74126705422E-02 -9.50075431370E-02 -9.26617985389E-02 -9.03739705814E-02 + -8.81426292974E-02 -8.59663800260E-02 -8.38438625405E-02 -8.17737501985E-02 + -7.97547491123E-02 -7.77855973406E-02 -7.58650640993E-02 -7.39919489927E-02 + -7.21650812629E-02 -7.03833190581E-02 -6.86455487188E-02 -6.69506840820E-02 + -6.52976658023E-02 +/ + +&nonlocal + els_beta(1) = "3S" + lll(1) = 0 + kbeta(1) = 353 + rcut(1) = 0.000000000000000E+000 + rcutus(1) = 0.000000000000000E+000 + beta(1:353,1) = + 7.63599747962E-04 7.82930437316E-04 8.02750467354E-04 8.23072238063E-04 + 8.43908493859E-04 8.65272208795E-04 8.87176739637E-04 9.09635825854E-04 + 9.32663436548E-04 9.56274038356E-04 9.80482327532E-04 1.00530345959E-03 + 1.03075297275E-03 1.05684671141E-03 1.08360105576E-03 1.11103273043E-03 + 1.13915880450E-03 1.16799692109E-03 1.19756510606E-03 1.22788180625E-03 + 1.25896600426E-03 1.29083710372E-03 1.32351504401E-03 1.35702026206E-03 + 1.39137369230E-03 1.42659680499E-03 1.46271164439E-03 1.49974071407E-03 + 1.53770724471E-03 1.57663492625E-03 1.61654806095E-03 1.65747167823E-03 + 1.69943130499E-03 1.74245319532E-03 1.78656425385E-03 1.83179199760E-03 + 1.87816478547E-03 1.92571151217E-03 1.97446199093E-03 2.02444664725E-03 + 2.07569674856E-03 2.12824432774E-03 2.18212222130E-03 2.23736414597E-03 + 2.29400458385E-03 2.35207901206E-03 2.41162374966E-03 2.47267595761E-03 + 2.53527383014E-03 2.59945651823E-03 2.66526412953E-03 2.73273788155E-03 + 2.80191987191E-03 2.87285342290E-03 2.94558285168E-03 3.02015366183E-03 + 3.09661246661E-03 3.17500710390E-03 3.25538655958E-03 3.33780115889E-03 + 3.42230241337E-03 3.50894313557E-03 3.59777755400E-03 3.68886123642E-03 + 3.78225116646E-03 3.87800570525E-03 3.97618482122E-03 4.07685001326E-03 + 4.18006366033E-03 4.28589120275E-03 4.39439846328E-03 4.50565317789E-03 + 4.61972499578E-03 4.73668586198E-03 4.85660810390E-03 4.97956711005E-03 + 5.10564018215E-03 5.23490576946E-03 5.36744499964E-03 5.50334091336E-03 + 5.64267846402E-03 5.78554451802E-03 5.93202938535E-03 6.08222414045E-03 + 6.23622291866E-03 6.39412215053E-03 6.55602132732E-03 6.72202108714E-03 + 6.89222551131E-03 7.06674174150E-03 7.24567883141E-03 7.42914927758E-03 + 7.61726748838E-03 7.81015169743E-03 8.00792281529E-03 8.21070519477E-03 + 8.41862548262E-03 8.63181453269E-03 8.85040587522E-03 9.07453686441E-03 + 9.30434829577E-03 9.53998402289E-03 9.78159248792E-03 1.00293251908E-02 + 1.02833378368E-02 1.05437899532E-02 1.08108456547E-02 1.10846728775E-02 + 1.13654433784E-02 1.16533342657E-02 1.19485264674E-02 1.22512058787E-02 + 1.25615633616E-02 1.28797947439E-02 1.32061000529E-02 1.35406854285E-02 + 1.38837619736E-02 1.42355465186E-02 1.45962604727E-02 1.49661328830E-02 + 1.53453969903E-02 1.57342925226E-02 1.61330664596E-02 1.65419707345E-02 + 1.69612645279E-02 1.73912146486E-02 1.78320932356E-02 1.82841804329E-02 + 1.87477640057E-02 1.92231389530E-02 1.97106082708E-02 2.02104821819E-02 + 2.07230800459E-02 2.12487295887E-02 2.17877665153E-02 2.23405360340E-02 + 2.29073924688E-02 2.34887003993E-02 2.40848323581E-02 2.46961726488E-02 + 2.53231146576E-02 2.59660639061E-02 2.66254353588E-02 2.73016560916E-02 + 2.79951648941E-02 2.87064122537E-02 2.94358614883E-02 3.01839879602E-02 + 3.09512805860E-02 3.17382421965E-02 3.25453895105E-02 3.33732534877E-02 + 3.42223800618E-02 3.50933308706E-02 3.59866828324E-02 3.69030307798E-02 + 3.78429847319E-02 3.88071740462E-02 3.97962446793E-02 4.08108614122E-02 + 4.18517089218E-02 4.29194978129E-02 4.40149492199E-02 4.51388061746E-02 + 4.62918487885E-02 4.74748635088E-02 4.86886697483E-02 4.99341082347E-02 + 5.12120484738E-02 5.25233808801E-02 5.38690280155E-02 5.52499443182E-02 + 5.66671119741E-02 5.81215329296E-02 5.96142591080E-02 6.11463652090E-02 + 6.27189597061E-02 6.43331919531E-02 6.59902439348E-02 6.76913410579E-02 + 6.94377399229E-02 7.12307504060E-02 7.30717155866E-02 7.49620259615E-02 + 7.69031220562E-02 7.88964854257E-02 8.09436485952E-02 8.30462009915E-02 + 8.52057755630E-02 8.74240695437E-02 8.97028305780E-02 9.20438654672E-02 + 9.44490371278E-02 9.69202726326E-02 9.94595670184E-02 1.02068971365E-01 + 1.04750607067E-01 1.07506656641E-01 1.10339384382E-01 1.13251106737E-01 + 1.16244222868E-01 1.19321194761E-01 1.22484553016E-01 1.25736901504E-01 + 1.29080909362E-01 1.32519316829E-01 1.36054924323E-01 1.39690595032E-01 + 1.43429244207E-01 1.47273849117E-01 1.51227418765E-01 1.55293017866E-01 + 1.59473723602E-01 1.63772639796E-01 1.68192873558E-01 1.72737515700E-01 + 1.77409639537E-01 1.82212257404E-01 1.87148317238E-01 1.92220667223E-01 + 1.97432014403E-01 2.02784906498E-01 2.08281680175E-01 2.13924423692E-01 + 2.19714904800E-01 2.25654537300E-01 2.31744292730E-01 2.37984645000E-01 + 2.44375462259E-01 2.50915933028E-01 2.57604448437E-01 2.64438483322E-01 + 2.71414474500E-01 2.78527655287E-01 2.85771895198E-01 2.93139531758E-01 + 3.00621129571E-01 3.08205288044E-01 3.15878358870E-01 3.23624173160E-01 + 3.31423730645E-01 3.39254843052E-01 3.47091744333E-01 3.54904660362E-01 + 3.62659436871E-01 3.70316850314E-01 3.77832218065E-01 3.85154756358E-01 + 3.92226954560E-01 3.98983914161E-01 4.05352671298E-01 4.11251583264E-01 + 4.16589666474E-01 4.21265968073E-01 4.25169213690E-01 4.28177473301E-01 + 4.30158130452E-01 4.30968182187E-01 4.30455131088E-01 4.28458238497E-01 + 4.24810741735E-01 4.19342833218E-01 4.11885770361E-01 4.02277109821E-01 + 3.90367419873E-01 3.76028188265E-01 3.59161189847E-01 3.39709094511E-01 + 3.17666906399E-01 2.93093870928E-01 2.66125127644E-01 2.36982072616E-01 + 2.05980453650E-01 1.73534737477E-01 1.40157450078E-01 1.06452191021E-01 + 7.30992377435E-02 4.08331385211E-02 1.04124327127E-02 -1.74175741760E-02 + -4.19669827173E-02 -6.26454699606E-02 -7.90046289100E-02 -9.07741956609E-02 + -9.78877805460E-02 -1.00494389337E-01 -9.89531972913E-02 -9.38107445113E-02 + -8.57618787601E-02 -7.55977830510E-02 -6.41462630795E-02 -5.22105962477E-02 + -4.05134867887E-02 -2.96520259767E-02 -2.00679917205E-02 -1.20356627562E-02 + -5.66693308393E-03 -9.31261208106E-04 2.31371381547E-03 4.28598935685E-03 + 5.24259346393E-03 5.44695513995E-03 5.14332536248E-03 4.53974181399E-03 + 3.79951321784E-03 3.04000366985E-03 2.33678618778E-03 1.73101138587E-03 + 1.23803518053E-03 8.55798788166E-04 5.72006169921E-04 3.69654543144E-04 + 2.30869458267E-04 1.39246805009E-04 8.10242478401E-05 4.54284907328E-05 + 2.45089063252E-05 1.27039699655E-05 6.31626367773E-06 3.00694184270E-06 + 1.36813343715E-06 5.93774253860E-07 2.45306518589E-07 9.62606139283E-08 + 3.57968755465E-08 1.25848460331E-08 4.17202291678E-09 1.30067197642E-09 + 3.80251145215E-10 1.03930709593E-10 2.64729969209E-11 6.26305557166E-12 + 1.37135744467E-12 2.76875462291E-13 5.13335331576E-14 8.70803717801E-15 + 1.35013311642E-15 1.85002779762E-16 2.24630980483E-17 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 + + dion(1:1) = + 2.17710200589E+01 +/ + +&pswfc + els(1) = "3S" + lchi(1) = 0 + oc(1) = 2.000000000000000E+000 + nchi(1) = 3 + epseu(1) = 0.000000000000000E+000 + rcut_chi(1) = 0.000000000000000E+000 + rcutus_chi(1) = 0.000000000000000E+000 + chi(1:425,1) = + 1.99521110000E-04 2.04572030000E-04 2.09750810000E-04 2.15060690000E-04 + 2.20505000000E-04 2.26087130000E-04 2.31810570000E-04 2.37678910000E-04 + 2.43695800000E-04 2.49865020000E-04 2.56190410000E-04 2.62675930000E-04 + 2.69325640000E-04 2.76143680000E-04 2.83134330000E-04 2.90301960000E-04 + 2.97651030000E-04 3.05186150000E-04 3.12912030000E-04 3.20833490000E-04 + 3.28955490000E-04 3.37283100000E-04 3.45821530000E-04 3.54576120000E-04 + 3.63552340000E-04 3.72755800000E-04 3.82192260000E-04 3.91867600000E-04 + 4.01787890000E-04 4.11959320000E-04 4.22388240000E-04 4.33081190000E-04 + 4.44044840000E-04 4.55286050000E-04 4.66811850000E-04 4.78629430000E-04 + 4.90746200000E-04 5.03169710000E-04 5.15907750000E-04 5.28968270000E-04 + 5.42359440000E-04 5.56089630000E-04 5.70167420000E-04 5.84601620000E-04 + 5.99401240000E-04 6.14575550000E-04 6.30134040000E-04 6.46086420000E-04 + 6.62442670000E-04 6.79213020000E-04 6.96407950000E-04 7.14038230000E-04 + 7.32114860000E-04 7.50649160000E-04 7.69652710000E-04 7.89137400000E-04 + 8.09115410000E-04 8.29599240000E-04 8.50601690000E-04 8.72135910000E-04 + 8.94215360000E-04 9.16853840000E-04 9.40065520000E-04 9.63864920000E-04 + 9.88266930000E-04 1.01328680000E-03 1.03894020000E-03 1.06524320000E-03 + 1.09221210000E-03 1.11986400000E-03 1.14821610000E-03 1.17728610000E-03 + 1.20709220000E-03 1.23765320000E-03 1.26898800000E-03 1.30111630000E-03 + 1.33405830000E-03 1.36783450000E-03 1.40246610000E-03 1.43797480000E-03 + 1.47438280000E-03 1.51171280000E-03 1.54998840000E-03 1.58923340000E-03 + 1.62947240000E-03 1.67073060000E-03 1.71303400000E-03 1.75640890000E-03 + 1.80088250000E-03 1.84648280000E-03 1.89323830000E-03 1.94117840000E-03 + 1.99033300000E-03 2.04073300000E-03 2.09241000000E-03 2.14539650000E-03 + 2.19972560000E-03 2.25543150000E-03 2.31254910000E-03 2.37111430000E-03 + 2.43116390000E-03 2.49273550000E-03 2.55586790000E-03 2.62060070000E-03 + 2.68697460000E-03 2.75503130000E-03 2.82481370000E-03 2.89636570000E-03 + 2.96973220000E-03 3.04495950000E-03 3.12209490000E-03 3.20118700000E-03 + 3.28228570000E-03 3.36544220000E-03 3.45070880000E-03 3.53813940000E-03 + 3.62778920000E-03 3.71971490000E-03 3.81397440000E-03 3.91062760000E-03 + 4.00973550000E-03 4.11136080000E-03 4.21556810000E-03 4.32242330000E-03 + 4.43199420000E-03 4.54435060000E-03 4.65956370000E-03 4.77770680000E-03 + 4.89885520000E-03 5.02308610000E-03 5.15047880000E-03 5.28111450000E-03 + 5.41507680000E-03 5.55245150000E-03 5.69332650000E-03 5.83779220000E-03 + 5.98594140000E-03 6.13786960000E-03 6.29367440000E-03 6.45345650000E-03 + 6.61731900000E-03 6.78536820000E-03 6.95771290000E-03 7.13446510000E-03 + 7.31573990000E-03 7.50165550000E-03 7.69233350000E-03 7.88789870000E-03 + 8.08847950000E-03 8.29420800000E-03 8.50522000000E-03 8.72165510000E-03 + 8.94365690000E-03 9.17137320000E-03 9.40495590000E-03 9.64456170000E-03 + 9.89035140000E-03 1.01424910000E-02 1.04011510000E-02 1.06665070000E-02 + 1.09387400000E-02 1.12180380000E-02 1.15045920000E-02 1.17985990000E-02 + 1.21002660000E-02 1.24098020000E-02 1.27274250000E-02 1.30533590000E-02 + 1.33878360000E-02 1.37310940000E-02 1.40833800000E-02 1.44449500000E-02 + 1.48160680000E-02 1.51970040000E-02 1.55880420000E-02 1.59894730000E-02 + 1.64015980000E-02 1.68247300000E-02 1.72591920000E-02 1.77053200000E-02 + 1.81634600000E-02 1.86339740000E-02 1.91172350000E-02 1.96136310000E-02 + 2.01235660000E-02 2.06474580000E-02 2.11857420000E-02 2.17388720000E-02 + 2.23073180000E-02 2.28915720000E-02 2.34921450000E-02 2.41095700000E-02 + 2.47444020000E-02 2.53972210000E-02 2.60686340000E-02 2.67592730000E-02 + 2.74698000000E-02 2.82009060000E-02 2.89533180000E-02 2.97277930000E-02 + 3.05251280000E-02 3.13461570000E-02 3.21917550000E-02 3.30628420000E-02 + 3.39603840000E-02 3.48853980000E-02 3.58389530000E-02 3.68221750000E-02 + 3.78362490000E-02 3.88824270000E-02 3.99620260000E-02 4.10764410000E-02 + 4.22271410000E-02 4.34156810000E-02 4.46437050000E-02 4.59129510000E-02 + 4.72252620000E-02 4.85825870000E-02 4.99869940000E-02 5.14406760000E-02 + 5.29459570000E-02 5.45053060000E-02 5.61213440000E-02 5.77968570000E-02 + 5.95348020000E-02 6.13383260000E-02 6.32107730000E-02 6.51557030000E-02 + 6.71769000000E-02 6.92783930000E-02 7.14644690000E-02 7.37396900000E-02 + 7.61089140000E-02 7.85773090000E-02 8.11503740000E-02 8.38339640000E-02 + 8.66343010000E-02 8.95580060000E-02 9.26121130000E-02 9.58040940000E-02 + 9.91418820000E-02 1.02633890000E-01 1.06289030000E-01 1.10116730000E-01 + 1.14126980000E-01 1.18330290000E-01 1.22737750000E-01 1.27361020000E-01 + 1.32212330000E-01 1.37304470000E-01 1.42650770000E-01 1.48265090000E-01 + 1.54161770000E-01 1.60355550000E-01 1.66861530000E-01 1.73695050000E-01 + 1.80871560000E-01 1.88406450000E-01 1.96314900000E-01 2.04611590000E-01 + 2.13310460000E-01 2.22424360000E-01 2.31964680000E-01 2.41940880000E-01 + 2.52360050000E-01 2.63226310000E-01 2.74540210000E-01 2.86298110000E-01 + 2.98491470000E-01 3.11106150000E-01 3.24121750000E-01 3.37510910000E-01 + 3.51238780000E-01 3.65262540000E-01 3.79531080000E-01 3.93984920000E-01 + 4.08556390000E-01 4.23170030000E-01 4.37743400000E-01 4.52188160000E-01 + 4.66411430000E-01 4.80317590000E-01 4.93810050000E-01 5.06793430000E-01 + 5.19175530000E-01 5.30869310000E-01 5.41794700000E-01 5.51879950000E-01 + 5.61062690000E-01 5.69290440000E-01 5.76520650000E-01 5.82720370000E-01 + 5.87865480000E-01 5.91939690000E-01 5.94933450000E-01 5.96842810000E-01 + 5.97668450000E-01 5.97414850000E-01 5.96089820000E-01 5.93704120000E-01 + 5.90271450000E-01 5.85808540000E-01 5.80335360000E-01 5.73875330000E-01 + 5.66455600000E-01 5.58107110000E-01 5.48864750000E-01 5.38767250000E-01 + 5.27857140000E-01 5.16180490000E-01 5.03786720000E-01 4.90728320000E-01 + 4.77060490000E-01 4.62840860000E-01 4.48129140000E-01 4.32986710000E-01 + 4.17476320000E-01 4.01661630000E-01 3.85606860000E-01 3.69376380000E-01 + 3.53034290000E-01 3.36644020000E-01 3.20267910000E-01 3.03966790000E-01 + 2.87799630000E-01 2.71823080000E-01 2.56091150000E-01 2.40654870000E-01 + 2.25561920000E-01 2.10856400000E-01 1.96578500000E-01 1.82764340000E-01 + 1.69445790000E-01 1.56650280000E-01 1.44400800000E-01 1.32715780000E-01 + 1.21609180000E-01 1.11090460000E-01 1.01164800000E-01 9.18331480000E-02 + 8.30924860000E-02 7.49360360000E-02 6.73535410000E-02 6.03315570000E-02 + 5.38537810000E-02 4.79013930000E-02 4.24534060000E-02 3.74870270000E-02 + 3.29780180000E-02 2.89010430000E-02 2.52300180000E-02 2.19384310000E-02 + 1.89996490000E-02 1.63872000000E-02 1.40750310000E-02 1.20377290000E-02 + 1.02507250000E-02 8.69045230000E-03 7.33448760000E-03 6.16165370000E-03 + 5.15209780000E-03 4.28734010000E-03 3.55029970000E-03 2.92529690000E-03 + 2.39803520000E-03 1.95556700000E-03 1.58624430000E-03 1.27965740000E-03 + 1.02656480000E-03 8.18816050000E-04 6.49270600000E-04 5.11713620000E-04 + 4.00781320000E-04 3.11953190000E-04 2.41277370000E-04 1.85404060000E-04 + 1.41522620000E-04 1.07290960000E-04 8.07710730000E-05 6.03708050000E-05 + 4.47916880000E-05 3.29826990000E-05 2.40996190000E-05 1.74696480000E-05 + 1.25609010000E-05 8.95633920000E-06 6.33171690000E-06 4.43710290000E-06 + 3.08154140000E-06 2.12044980000E-06 1.44536630000E-06 9.75694150000E-07 + 6.52121570000E-07 4.31432700000E-07 2.82458680000E-07 1.82952810000E-07 + 1.17205370000E-07 7.42436290000E-08 4.64889840000E-08 2.87668960000E-08 + 1.75856310000E-08 1.06172590000E-08 6.32882310000E-09 3.72357940000E-09 + 2.16180970000E-09 1.23840040000E-09 7.00352340000E-10 3.92000090000E-10 + 2.19213180000E-10 1.20759850000E-10 6.55071340000E-11 3.49780330000E-11 + 1.83767710000E-11 9.49580790000E-12 4.82392960000E-12 2.40818060000E-12 + 1.18087590000E-12 5.68525220000E-13 2.68610920000E-13 1.24485600000E-13 + 5.65618960000E-14 2.51837650000E-14 1.09821190000E-14 4.68804550000E-15 + 1.95795700000E-15 + + els(2) = "3P" + lchi(2) = 1 + oc(2) = 0.000000000000000E+000 + nchi(2) = 3 + epseu(2) = 0.000000000000000E+000 + rcut_chi(2) = 0.000000000000000E+000 + rcutus_chi(2) = 0.000000000000000E+000 + chi(1:425,2) = + 2.91543910000E-07 3.06491680000E-07 3.22205850000E-07 3.38725690000E-07 + 3.56092530000E-07 3.74349780000E-07 3.93543100000E-07 4.13720480000E-07 + 4.34932380000E-07 4.57231840000E-07 4.80674610000E-07 5.05319320000E-07 + 5.31227590000E-07 5.58464200000E-07 5.87097270000E-07 6.17198380000E-07 + 6.48842810000E-07 6.82109690000E-07 7.17082190000E-07 7.53847770000E-07 + 7.92498360000E-07 8.33130600000E-07 8.75846110000E-07 9.20751680000E-07 + 9.67959620000E-07 1.01758790000E-06 1.06976080000E-06 1.12460860000E-06 + 1.18226840000E-06 1.24288460000E-06 1.30660860000E-06 1.37359990000E-06 + 1.44402580000E-06 1.51806250000E-06 1.59589520000E-06 1.67771850000E-06 + 1.76373690000E-06 1.85416550000E-06 1.94923060000E-06 2.04916970000E-06 + 2.15423280000E-06 2.26468250000E-06 2.38079520000E-06 2.50286100000E-06 + 2.63118530000E-06 2.76608900000E-06 2.90790920000E-06 3.05700070000E-06 + 3.21373630000E-06 3.37850790000E-06 3.55172740000E-06 3.73382810000E-06 + 3.92526530000E-06 4.12651770000E-06 4.33808840000E-06 4.56050650000E-06 + 4.79432830000E-06 5.04013830000E-06 5.29855110000E-06 5.57021310000E-06 + 5.85580340000E-06 6.15603610000E-06 6.47166200000E-06 6.80347040000E-06 + 7.15229080000E-06 7.51899550000E-06 7.90450150000E-06 8.30977260000E-06 + 8.73582240000E-06 9.18371600000E-06 9.65457340000E-06 1.01495720000E-05 + 1.06699500000E-05 1.12170070000E-05 1.17921130000E-05 1.23967040000E-05 + 1.30322940000E-05 1.37004700000E-05 1.44029050000E-05 1.51413530000E-05 + 1.59176620000E-05 1.67337730000E-05 1.75917260000E-05 1.84936660000E-05 + 1.94418500000E-05 2.04386470000E-05 2.14865500000E-05 2.25881790000E-05 + 2.37462890000E-05 2.49637760000E-05 2.62436830000E-05 2.75892110000E-05 + 2.90037240000E-05 3.04907590000E-05 3.20540340000E-05 3.36974580000E-05 + 3.54251400000E-05 3.72414000000E-05 3.91507780000E-05 4.11580500000E-05 + 4.32682330000E-05 4.54866030000E-05 4.78187080000E-05 5.02703780000E-05 + 5.28477420000E-05 5.55572460000E-05 5.84056620000E-05 6.14001130000E-05 + 6.45480860000E-05 6.78574500000E-05 7.13364790000E-05 7.49938720000E-05 + 7.88387730000E-05 8.28807930000E-05 8.71300390000E-05 9.15971330000E-05 + 9.62932430000E-05 1.01230110000E-04 1.06420070000E-04 1.11876110000E-04 + 1.17611860000E-04 1.23641660000E-04 1.29980580000E-04 1.36644480000E-04 + 1.43650000000E-04 1.51014660000E-04 1.58756870000E-04 1.66895980000E-04 + 1.75452340000E-04 1.84447330000E-04 1.93903440000E-04 2.03844290000E-04 + 2.14294740000E-04 2.25280910000E-04 2.36830250000E-04 2.48971620000E-04 + 2.61735370000E-04 2.75153400000E-04 2.89259230000E-04 3.04088120000E-04 + 3.19677110000E-04 3.36065170000E-04 3.53293230000E-04 3.71404350000E-04 + 3.90443770000E-04 4.10459060000E-04 4.31500210000E-04 4.53619800000E-04 + 4.76873070000E-04 5.01318110000E-04 5.27015970000E-04 5.54030830000E-04 + 5.82430160000E-04 6.12284880000E-04 6.43669530000E-04 6.76662470000E-04 + 7.11346090000E-04 7.47806950000E-04 7.86136090000E-04 8.26429160000E-04 + 8.68786740000E-04 9.13314510000E-04 9.60123600000E-04 1.00933080000E-03 + 1.06105880000E-03 1.11543680000E-03 1.17260020000E-03 1.23269180000E-03 + 1.29586120000E-03 1.36226600000E-03 1.43207170000E-03 1.50545230000E-03 + 1.58259060000E-03 1.66367880000E-03 1.74891880000E-03 1.83852310000E-03 + 1.93271460000E-03 2.03172780000E-03 2.13580910000E-03 2.24521750000E-03 + 2.36022510000E-03 2.48111800000E-03 2.60819660000E-03 2.74177670000E-03 + 2.88219030000E-03 3.02978590000E-03 3.18493020000E-03 3.34800790000E-03 + 3.51942380000E-03 3.69960270000E-03 3.88899140000E-03 4.08805880000E-03 + 4.29729800000E-03 4.51722670000E-03 4.74838880000E-03 4.99135580000E-03 + 5.24672770000E-03 5.51513500000E-03 5.79723980000E-03 6.09373750000E-03 + 6.40535830000E-03 6.73286910000E-03 7.07707510000E-03 7.43882190000E-03 + 7.81899720000E-03 8.21853280000E-03 8.63840720000E-03 9.07964710000E-03 + 9.54333030000E-03 1.00305880000E-02 1.05426070000E-02 1.10806320000E-02 + 1.16459710000E-02 1.22399920000E-02 1.28641350000E-02 1.35199050000E-02 + 1.42088840000E-02 1.49327280000E-02 1.56931740000E-02 1.64920410000E-02 + 1.73312370000E-02 1.82127580000E-02 1.91386970000E-02 2.01112430000E-02 + 2.11326890000E-02 2.22054340000E-02 2.33319860000E-02 2.45149720000E-02 + 2.57571330000E-02 2.70613360000E-02 2.84305770000E-02 2.98679810000E-02 + 3.13768120000E-02 3.29604720000E-02 3.46225090000E-02 3.63666200000E-02 + 3.81966520000E-02 4.01166090000E-02 4.21306530000E-02 4.42431070000E-02 + 4.64584590000E-02 4.87813580000E-02 5.12166210000E-02 5.37692320000E-02 + 5.64443350000E-02 5.92472410000E-02 6.21834150000E-02 6.52584790000E-02 + 6.84781980000E-02 7.18484760000E-02 7.53753430000E-02 7.90649410000E-02 + 8.29235050000E-02 8.69573460000E-02 9.11728240000E-02 9.55763220000E-02 + 1.00174210000E-01 1.04972820000E-01 1.09978360000E-01 1.15196940000E-01 + 1.20634430000E-01 1.26296460000E-01 1.32188320000E-01 1.38314900000E-01 + 1.44680570000E-01 1.51289120000E-01 1.58143640000E-01 1.65246420000E-01 + 1.72598810000E-01 1.80201120000E-01 1.88052470000E-01 1.96150650000E-01 + 2.04492010000E-01 2.13071270000E-01 2.21881410000E-01 2.30913540000E-01 + 2.40156710000E-01 2.49597880000E-01 2.59221700000E-01 2.69010500000E-01 + 2.78944190000E-01 2.89000190000E-01 2.99153450000E-01 3.09376450000E-01 + 3.19639260000E-01 3.29909670000E-01 3.40153300000E-01 3.50333850000E-01 + 3.60413370000E-01 3.70352530000E-01 3.80111040000E-01 3.89648030000E-01 + 3.98922510000E-01 4.07893830000E-01 4.16522150000E-01 4.24768890000E-01 + 4.32597170000E-01 4.39972110000E-01 4.46861220000E-01 4.53234500000E-01 + 4.59064660000E-01 4.64327090000E-01 4.68999860000E-01 4.73063610000E-01 + 4.76501410000E-01 4.79298640000E-01 4.81442810000E-01 4.82923460000E-01 + 4.83732080000E-01 4.83862040000E-01 4.83308670000E-01 4.82069220000E-01 + 4.80143030000E-01 4.77531560000E-01 4.74238550000E-01 4.70270120000E-01 + 4.65634850000E-01 4.60343900000E-01 4.54411080000E-01 4.47852840000E-01 + 4.40688360000E-01 4.32939470000E-01 4.24630680000E-01 4.15789100000E-01 + 4.06444300000E-01 3.96628300000E-01 3.86375320000E-01 3.75721700000E-01 + 3.64705640000E-01 3.53367010000E-01 3.41747100000E-01 3.29888380000E-01 + 3.17834140000E-01 3.05628280000E-01 2.93314920000E-01 2.80938130000E-01 + 2.68541560000E-01 2.56168160000E-01 2.43859830000E-01 2.31657100000E-01 + 2.19598880000E-01 2.07722150000E-01 1.96061710000E-01 1.84649990000E-01 + 1.73516810000E-01 1.62689250000E-01 1.52191530000E-01 1.42044900000E-01 + 1.32267590000E-01 1.22874810000E-01 1.13878720000E-01 1.05288550000E-01 + 9.71106090000E-02 8.93484290000E-02 8.20028900000E-02 7.50723710000E-02 + 6.85529210000E-02 6.24384460000E-02 5.67209040000E-02 5.13905090000E-02 + 4.64359400000E-02 4.18445450000E-02 3.76025540000E-02 3.36952720000E-02 + 3.01072800000E-02 2.68226140000E-02 2.38249460000E-02 2.10977380000E-02 + 1.86243990000E-02 1.63884130000E-02 1.43734690000E-02 1.25635570000E-02 + 1.09433320000E-02 9.50025660000E-03 8.21946710000E-03 7.08656340000E-03 + 6.08795610000E-03 5.21087110000E-03 4.44334740000E-03 3.77423060000E-03 + 3.19316120000E-03 2.69055850000E-03 2.25760040000E-03 1.88619850000E-03 + 1.56897100000E-03 1.29921170000E-03 1.07085690000E-03 8.78450460000E-04 + 7.17106900000E-04 5.82473900000E-04 4.70694100000E-04 3.78366880000E-04 + 3.02510530000E-04 2.40525070000E-04 1.90156260000E-04 1.49460940000E-04 + 1.16774070000E-04 9.06775690000E-05 6.99712460000E-05 5.36457580000E-05 + 4.08578230000E-05 3.09076040000E-05 2.32182830000E-05 1.73177690000E-05 + 1.28224620000E-05 9.42295250000E-06 6.87155790000E-06 4.97153390000E-06 + 3.56783560000E-06 2.53926800000E-06 1.79188180000E-06 1.25346690000E-06 + 8.69005650000E-07 5.96952850000E-07 4.06223830000E-07 2.73778390000E-07 + 1.82703070000E-07 1.20704530000E-07 7.89383730000E-08 5.11087540000E-08 + 3.27840280000E-08 2.08831510000E-08 1.32958750000E-08 8.36699550000E-09 + 5.20265170000E-09 +/ + +&rhoatom + rho_at(1:425) = + 7.96173466713E-08 8.36994309166E-08 8.79908045913E-08 9.25022007666E-08 + 9.72449100500E-08 1.02230780703E-07 1.07472280727E-07 1.12982528518E-07 + 1.18775285875E-07 1.24865056439E-07 1.31267052352E-07 1.37997288403E-07 + 1.45072600723E-07 1.52510664008E-07 1.60330097649E-07 1.68550455960E-07 + 1.77192271320E-07 1.86277172304E-07 1.95827877037E-07 2.05868256611E-07 + 2.16423428802E-07 2.27519779091E-07 2.39185061223E-07 2.51448449749E-07 + 2.64340607839E-07 2.77893772867E-07 2.92141847208E-07 3.07120431860E-07 + 3.22867017101E-07 3.39420962670E-07 3.56823650581E-07 3.75118634264E-07 + 3.94351639861E-07 4.14570774649E-07 4.35826606601E-07 4.58172262524E-07 + 4.81663665629E-07 5.06359514123E-07 5.32321613020E-07 5.59614861334E-07 + 5.88307524314E-07 6.18471353187E-07 6.50181773659E-07 6.83518108213E-07 + 7.18563693027E-07 7.55406213316E-07 7.94137816733E-07 8.34855324217E-07 + 8.77660582073E-07 9.22660653075E-07 9.69968065646E-07 1.01970118780E-06 + 1.07198433647E-06 1.12694832282E-06 1.18473058802E-06 1.24547567216E-06 + 1.30933549340E-06 1.37646979802E-06 1.44704647006E-06 1.52124209102E-06 + 1.59924222012E-06 1.68124192785E-06 1.76744636379E-06 1.85807116801E-06 + 1.95334304986E-06 2.05350027811E-06 2.15879347835E-06 2.26948615029E-06 + 2.38585454277E-06 2.50819075699E-06 2.63680042460E-06 2.77200512251E-06 + 2.91414315860E-06 3.06357088694E-06 3.22066108829E-06 3.38580725225E-06 + 3.55942309560E-06 3.74194243878E-06 3.93382232330E-06 4.13554305087E-06 + 4.34760928187E-06 4.57055117937E-06 4.80492808027E-06 5.05132559935E-06 + 5.31036060472E-06 5.58268147555E-06 5.86897097031E-06 6.16994444800E-06 + 6.48635555761E-06 6.81899746139E-06 7.16870252117E-06 7.53634716125E-06 + 7.92285090178E-06 8.32918235458E-06 8.75635921620E-06 9.20545228442E-06 + 9.67758543059E-06 1.01739425024E-05 1.06957666798E-05 1.12443660473E-05 + 1.18211158173E-05 1.24274605459E-05 1.30649214445E-05 1.37350960577E-05 + 1.44396650021E-05 1.51803949280E-05 1.59591448794E-05 1.67778685363E-05 + 1.76386186794E-05 1.85435567133E-05 1.94949531292E-05 2.04951964179E-05 + 2.15467988328E-05 2.26524024031E-05 2.38147824448E-05 2.50368608277E-05 + 2.63217089593E-05 2.76725578746E-05 2.90928014477E-05 3.05860164518E-05 + 3.21559575599E-05 3.38065752556E-05 3.55420288115E-05 3.73666863688E-05 + 3.92851451777E-05 4.13022447514E-05 4.34230677487E-05 4.56529645335E-05 + 4.79975645411E-05 5.04627879360E-05 5.30548637385E-05 5.57803407242E-05 + 5.86461134998E-05 6.16594353197E-05 6.48279332712E-05 6.81596355408E-05 + 7.16629888885E-05 7.53468864532E-05 7.92206749064E-05 8.32942015948E-05 + 8.75778214955E-05 9.20824432191E-05 9.68195375977E-05 1.01801184526E-04 + 1.07040100569E-04 1.12549670481E-04 1.18343989350E-04 1.24437891803E-04 + 1.30847001244E-04 1.37587772695E-04 1.44677534497E-04 1.52134535367E-04 + 1.59977997490E-04 1.68228172747E-04 1.76906390962E-04 1.86035140770E-04 + 1.95638101631E-04 2.05740247370E-04 2.16367884250E-04 2.27548743162E-04 + 2.39312065575E-04 2.51688753139E-04 2.64711274173E-04 2.78413876726E-04 + 2.92832874542E-04 3.08006371358E-04 3.23974694261E-04 3.40780362366E-04 + 3.58468305526E-04 3.77085884874E-04 3.96683184449E-04 4.17313161005E-04 + 4.39031741961E-04 4.61897861152E-04 4.85974106788E-04 5.11326493635E-04 + 5.38024833907E-04 5.66143079146E-04 5.95759416986E-04 6.26956712605E-04 + 6.59822558343E-04 6.94449974065E-04 7.30937348090E-04 7.69389042008E-04 + 8.09915817113E-04 8.52635043724E-04 8.97671328181E-04 9.45157111665E-04 + 9.95232872706E-04 1.04804813726E-03 1.10376175340E-03 1.16254273117E-03 + 1.22457086068E-03 1.29003766905E-03 1.35914735725E-03 1.43211738298E-03 + 1.50917982408E-03 1.59058219844E-03 1.67658924642E-03 1.76748335330E-03 + 1.86356687883E-03 1.96516311734E-03 2.07261817996E-03 2.18630304223E-03 + 2.30661536285E-03 2.43398198724E-03 2.56886110427E-03 2.71174514346E-03 + 2.86316347678E-03 3.02368625882E-03 3.19392704405E-03 3.37454801045E-03 + 3.56626287407E-03 3.76984271339E-03 3.98612079225E-03 4.21599813906E-03 + 4.46045074194E-03 4.72053551923E-03 4.99739913831E-03 5.29228629467E-03 + 5.60654872529E-03 5.94165676431E-03 6.29921050473E-03 6.68095335816E-03 + 7.08878529836E-03 7.52478047296E-03 7.99120364652E-03 8.49053126685E-03 + 9.02547178722E-03 9.59899147332E-03 1.02143406589E-02 1.08750837626E-02 + 1.15851335805E-02 1.23487869794E-02 1.31707664007E-02 1.40562670399E-02 + 1.50110042195E-02 1.60412728774E-02 1.71540069486E-02 1.83568488543E-02 + 1.96582255330E-02 2.10674307531E-02 2.25947157967E-02 2.42513884518E-02 + 2.60499351278E-02 2.80041150630E-02 3.01291105501E-02 3.24416588309E-02 + 3.49602004081E-02 3.77050349640E-02 4.06984843632E-02 4.39650738254E-02 + 4.75317026591E-02 5.14278048316E-02 5.56855403879E-02 6.03399407890E-02 + 6.54290424337E-02 7.09939808032E-02 7.70790799240E-02 8.37318055247E-02 + 9.10027046908E-02 9.89451918428E-02 1.07615225535E-01 1.17070778830E-01 + 1.27371189672E-01 1.38576180552E-01 1.50744653814E-01 1.63933215579E-01 + 1.78194315326E-01 1.93574073136E-01 2.10109817646E-01 2.27827228738E-01 + 2.46737361152E-01 2.66833446255E-01 2.88087681372E-01 3.10448234375E-01 + 3.33836647620E-01 3.58145748580E-01 3.83238568487E-01 4.08948264088E-01 + 4.35079244069E-01 4.61409974527E-01 4.87696730962E-01 5.13679161382E-01 + 5.39086461902E-01 5.63644448600E-01 5.87082993896E-01 6.09142958424E-01 + 6.29582684220E-01 6.48183210151E-01 6.64752119753E-01 6.79126059226E-01 + 6.91171645151E-01 7.00785193195E-01 7.07891619858E-01 7.12442679697E-01 + 7.14415152251E-01 7.13809006001E-01 7.10646147015E-01 7.04969164210E-01 + 6.96840769370E-01 6.86343291074E-01 6.73578260133E-01 6.58665788765E-01 + 6.41743893543E-01 6.22967092465E-01 6.02505027585E-01 5.80540299345E-01 + 5.57266320498E-01 5.32884596513E-01 5.07602118497E-01 4.81628568100E-01 + 4.55173422238E-01 4.28443323371E-01 4.01639452234E-01 3.74954982073E-01 + 3.48572955521E-01 3.22664130029E-01 2.97385300958E-01 2.72877820204E-01 + 2.49266419832E-01 2.26658392404E-01 2.05143068352E-01 1.84791618846E-01 + 1.65657254056E-01 1.47775573641E-01 1.31165354217E-01 1.15829532909E-01 + 1.01756359508E-01 8.89208428419E-02 7.72862133245E-02 6.68056079513E-02 + 5.74237514974E-02 4.90786204482E-02 4.17031820813E-02 3.52269565220E-02 + 2.95775853205E-02 2.46821806060E-02 2.04686335181E-02 1.68666541432E-02 + 1.38087224593E-02 1.12308189828E-02 9.07299897048E-03 7.27979354009E-03 + 5.80045945599E-03 4.58908690268E-03 3.60458336200E-03 2.81055438660E-03 + 2.17509934242E-03 1.67054057298E-03 1.27310761656E-03 9.62589509484E-04 + 7.21973324246E-04 5.37080647680E-04 3.96212995302E-04 2.89813838955E-04 + 2.10154726051E-04 1.51047922357E-04 1.07589416709E-04 7.59319526374E-05 + 5.30882234815E-05 3.67625702661E-05 2.52092559196E-05 1.71147239063E-05 + 1.15011456409E-05 7.64848458298E-06 5.03234195856E-06 3.27504612275E-06 + 2.10767057720E-06 1.34091944748E-06 8.43104624049E-07 5.23701657787E-07 + 3.21251332922E-07 1.94629585502E-07 1.16429538548E-07 6.87493309290E-08 + 4.00573039433E-08 2.30227001954E-08 1.30479324671E-08 7.28926819270E-09 + 4.01259062778E-09 2.17571686665E-09 1.16158327189E-09 6.10377202488E-10 + 3.15552467864E-10 1.60432023731E-10 8.01812778035E-11 3.93757642904E-11 + 1.89917947998E-11 8.99261470864E-12 4.17816748235E-12 1.90395814869E-12 + 8.50525084119E-13 3.72268349259E-13 1.59565811815E-13 6.69434613738E-14 + 2.74741975137E-14 1.10242328942E-14 4.32245126670E-15 1.65506861095E-15 + 6.18508835336E-16 2.25452377346E-16 8.01080036622E-17 2.77300870962E-17 + 9.34684235803E-18 3.06727110144E-18 9.80986800287E-19 3.07328141120E-19 + 9.61088365714E-20 2.91658827440E-20 8.58236920979E-21 2.44692558510E-21 + 6.75411424773E-22 1.80340735347E-22 4.65405935715E-23 1.15986676044E-23 + 2.78893578240E-24 6.46441851552E-25 1.44303652686E-25 3.09933292147E-26 + 6.39849615823E-27 1.26844403915E-27 2.41213875460E-28 4.39555412201E-29 + 7.66719122770E-30 +/ diff --git a/tests/apps/miniDFT/tests/benchmark/O.pbe.nml b/tests/apps/miniDFT/tests/benchmark/O.pbe.nml new file mode 100644 index 0000000000..c07552c775 --- /dev/null +++ b/tests/apps/miniDFT/tests/benchmark/O.pbe.nml @@ -0,0 +1,1997 @@ + +&header + generated='Generated using "atomic" code by A. Dal Corso (Quantum ESPRESSO distribution)' + author = "AM" + date = "15Dec2010" + comment = " " + psd = " O" + typ = "NC" + rel = "scalar" + tvanp = .false. + tpawp = .false. + tcoulombp= .false. + has_so = .false. + has_wfc = .false. + has_gipaw= .false. + nlcc = .false. + dft = "PBE " + zp = 6.000000000000000E+000 + etotps = -3.156320598423343E+001 + ecutwfc = 0.000000000000000E+000 + ecutrho = 0.000000000000000E+000 + nv = "2.0.1" + lmax = 1 + lmax_rho = 2 + lloc = 1 + nmesh = 1095 + nwfc = 2 + nbeta = 1 +/ + +&mesh + dx = 1.250000000000000E-002 + nmesh = 1095 + xmin =-7.000000000000000E+000 + rmax = 1.000000000000000E+002 + zmesh = 8.000000000000000E+000 + r(1:1095) = + 1.139852456943145E-004 1.154190035836278E-004 1.168707959270728E-004 1.183408495701567E-004 + 1.198293942117525E-004 1.213366624399886E-004 1.228628897685923E-004 1.244083146736889E-004 + 1.259731786310638E-004 1.275577261538943E-004 1.291622048309546E-004 1.307868653653023E-004 + 1.324319616134513E-004 1.340977506250371E-004 1.357844926829822E-004 1.374924513441648E-004 + 1.392218934806004E-004 1.409730893211415E-004 1.427463124937009E-004 1.445418400680072E-004 + 1.463599525988968E-004 1.482009341701516E-004 1.500650724388876E-004 1.519526586805018E-004 + 1.538639878341851E-004 1.557993585490062E-004 1.577590732305768E-004 1.597434380883031E-004 + 1.617527631832310E-004 1.637873624764950E-004 1.658475538783739E-004 1.679336592979659E-004 + 1.700460046934867E-004 1.721849201232021E-004 1.743507397969998E-004 1.765438021286102E-004 + 1.787644497884843E-004 1.810130297573369E-004 1.832898933803629E-004 1.855953964221359E-004 + 1.879298991221965E-004 1.902937662513414E-004 1.926873671686188E-004 1.951110758790415E-004 + 1.975652710920271E-004 2.000503362805705E-004 2.025666597411633E-004 2.051146346544658E-004 + 2.076946591467417E-004 2.103071363520676E-004 2.129524744753217E-004 2.156310868559678E-004 + 2.183433920326400E-004 2.210898138085401E-004 2.238707813176587E-004 2.266867290918269E-004 + 2.295380971286134E-004 2.324253309600751E-004 2.353488817223722E-004 2.383092062262596E-004 + 2.413067670284637E-004 2.443420325039584E-004 2.474154769191496E-004 2.505275805059799E-004 + 2.536788295369668E-004 2.568697164011824E-004 2.601007396811912E-004 2.633724042309543E-004 + 2.666852212547135E-004 2.700397083868693E-004 2.734363897728606E-004 2.768757961510646E-004 + 2.803584649357254E-004 2.838849403009259E-004 2.874557732656170E-004 2.910715217797142E-004 + 2.947327508112791E-004 2.984400324347967E-004 3.021939459205629E-004 3.059950778251979E-004 + 3.098440220832948E-004 3.137413801002248E-004 3.176877608461073E-004 3.216837809509625E-004 + 3.257300648010623E-004 3.298272446364902E-004 3.339759606499313E-004 3.381768610867033E-004 + 3.424306023460460E-004 3.467378490836861E-004 3.510992743156891E-004 3.555155595236209E-004 + 3.599873947610304E-004 3.645154787612710E-004 3.691005190466808E-004 3.737432320391325E-004 + 3.784443431719769E-004 3.832045870033929E-004 3.880247073311636E-004 3.929054573088975E-004 + 3.978475995637084E-004 4.028519063153783E-004 4.079191594970185E-004 4.130501508772477E-004 + 4.182456821839090E-004 4.235065652293390E-004 4.288336220372168E-004 4.342276849710067E-004 + 4.396895968640161E-004 4.452202111510912E-004 4.508203920019663E-004 4.564910144562929E-004 + 4.622329645603665E-004 4.680471395055725E-004 4.739344477685760E-004 4.798958092532704E-004 + 4.859321554345163E-004 4.920444295036854E-004 4.982335865160363E-004 5.045005935399448E-004 + 5.108464298080083E-004 5.172720868700546E-004 5.237785687480724E-004 5.303668920930925E-004 + 5.370380863440425E-004 5.437931938885961E-004 5.506332702260508E-004 5.575593841322502E-004 + 5.645726178265832E-004 5.716740671410841E-004 5.788648416916557E-004 5.861460650514514E-004 + 5.935188749264347E-004 6.009844233331482E-004 6.085438767787204E-004 6.161984164431315E-004 + 6.239492383637771E-004 6.317975536223518E-004 6.397445885340814E-004 6.477915848393406E-004 + 6.559397998976731E-004 6.641905068842594E-004 6.725449949888526E-004 6.810045696172156E-004 + 6.895705525950964E-004 6.982442823747625E-004 7.070271142441385E-004 7.159204205385731E-004 + 7.249255908552677E-004 7.340440322704065E-004 7.432771695590118E-004 7.526264454175699E-004 + 7.620933206894547E-004 7.716792745931876E-004 7.813858049535702E-004 7.912144284357184E-004 + 8.011666807820479E-004 8.112441170522359E-004 8.214483118662016E-004 8.317808596501467E-004 + 8.422433748856834E-004 8.528374923621034E-004 8.635648674318165E-004 8.744271762690013E-004 + 8.854261161315157E-004 8.965634056260874E-004 9.078407849768614E-004 9.192600162973045E-004 + 9.308228838655423E-004 9.425311944031595E-004 9.543867773574952E-004 9.663914851875088E-004 + 9.785471936532217E-004 9.908558021088118E-004 1.003319233799395E-003 1.015939436161526E-003 + 1.028718381127504E-003 1.041658065433476E-003 1.054760510931441E-003 1.068027764905168E-003 + 1.081461900390079E-003 1.095065016497179E-003 1.108839238741032E-003 1.122786719371889E-003 + 1.136909637711978E-003 1.151210200496018E-003 1.165690642216041E-003 1.180353225470526E-003 + 1.195200241317938E-003 1.210234009634712E-003 1.225456879477728E-003 1.240871229451376E-003 + 1.256479468079198E-003 1.272284034180234E-003 1.288287397250094E-003 1.304492057846813E-003 + 1.320900547981582E-003 1.337515431514366E-003 1.354339304554519E-003 1.371374795866436E-003 + 1.388624567280288E-003 1.406091314107958E-003 1.423777765564172E-003 1.441686685192953E-003 + 1.459820871299432E-003 1.478183157387077E-003 1.496776412600453E-003 1.515603542173512E-003 + 1.534667487883554E-003 1.553971228510887E-003 1.573517780304250E-003 1.593310197452134E-003 + 1.613351572559984E-003 1.633645037133435E-003 1.654193762067618E-003 1.675000958142604E-003 + 1.696069876525117E-003 1.717403809276518E-003 1.739006089867202E-003 1.760880093697467E-003 + 1.783029238624907E-003 1.805456985498485E-003 1.828166838699278E-003 1.851162346688050E-003 + 1.874447102559715E-003 1.898024744604743E-003 1.921898956877679E-003 1.946073469772761E-003 + 1.970552060606811E-003 1.995338554209453E-003 2.020436823520734E-003 2.045850790196303E-003 + 2.071584425220157E-003 2.097641749525120E-003 2.124026834621135E-003 2.150743803231423E-003 + 2.177796829936689E-003 2.205190141827395E-003 2.232928019164254E-003 2.261014796047039E-003 + 2.289454861091772E-003 2.318252658116486E-003 2.347412686835551E-003 2.376939503562782E-003 + 2.406837721923366E-003 2.437112013574749E-003 2.467767108936598E-003 2.498807797929929E-003 + 2.530238930725549E-003 2.562065418501907E-003 2.594292234212468E-003 2.626924413362754E-003 + 2.659967054797147E-003 2.693425321495596E-003 2.727304441380347E-003 2.761609708132805E-003 + 2.796346482020700E-003 2.831520190735621E-003 2.867136330241116E-003 2.903200465631447E-003 + 2.939718232001138E-003 2.976695335325485E-003 3.014137553352109E-003 3.052050736503754E-003 + 3.090440808792425E-003 3.129313768745018E-003 3.168675690340618E-003 3.208532723959554E-003 + 3.248891097344418E-003 3.289757116573164E-003 3.331137167044436E-003 3.373037714475311E-003 + 3.415465305911571E-003 3.458426570750697E-003 3.501928221777728E-003 3.545977056214138E-003 + 3.590579956779929E-003 3.635743892769060E-003 3.681475921138411E-003 3.727783187610464E-003 + 3.774672927789813E-003 3.822152468293762E-003 3.870229227897112E-003 3.918910718691361E-003 + 3.968204547258494E-003 4.018118415859508E-003 4.068660123637929E-003 4.119837567838421E-003 + 4.171658745040760E-003 4.224131752409320E-003 4.277264788958254E-003 4.331066156832628E-003 + 4.385544262605630E-003 4.440707618592121E-003 4.496564844178708E-003 4.553124667170529E-003 + 4.610395925155002E-003 4.668387566882703E-003 4.727108653665635E-003 4.786568360793083E-003 + 4.846775978965251E-003 4.907740915744977E-003 4.969472697027665E-003 5.031980968529731E-003 + 5.095275497295778E-003 5.159366173224694E-003 5.224263010614990E-003 5.289976149729540E-003 + 5.356515858380023E-003 5.423892533531297E-003 5.492116702925928E-003 5.561199026729190E-003 + 5.631150299194728E-003 5.701981450351176E-003 5.773703547710015E-003 5.846327797994873E-003 + 5.919865548892616E-003 5.994328290826434E-003 6.069727658751247E-003 6.146075433971698E-003 + 6.223383545982993E-003 6.301664074334922E-003 6.380929250519302E-003 6.461191459881176E-003 + 6.542463243554048E-003 6.624757300419475E-003 6.708086489091267E-003 6.792463829924687E-003 + 6.877902507050907E-003 6.964415870437050E-003 7.052017437972169E-003 7.140720897579412E-003 + 7.230540109354811E-003 7.321489107732945E-003 7.413582103679840E-003 7.506833486913493E-003 + 7.601257828152247E-003 7.696869881391529E-003 7.793684586209182E-003 7.891717070099797E-003 + 7.990982650838446E-003 8.091496838874069E-003 8.193275339753045E-003 8.296334056573205E-003 + 8.400689092468720E-003 8.506356753126275E-003 8.613353549332823E-003 8.721696199555458E-003 + 8.831401632553703E-003 8.942486990024652E-003 9.054969629281432E-003 9.168867125965267E-003 + 9.284197276791738E-003 9.400978102331554E-003 9.519227849826291E-003 9.638964996039589E-003 + 9.760208250144146E-003 9.882976556645086E-003 1.000728909834007E-002 1.013316529931665E-002 + 1.026062482798735E-002 1.038968760016282E-002 1.052037378216380E-002 1.065270379397211E-002 + 1.078669831242131E-002 1.092237827442755E-002 1.105976488026091E-002 1.119887959685809E-002 + 1.133974416117657E-002 1.148238058359111E-002 1.162681115133294E-002 1.177305843197209E-002 + 1.192114527694371E-002 1.207109482511861E-002 1.222293050641876E-002 1.237667604547829E-002 + 1.253235546535047E-002 1.268999309126139E-002 1.284961355441080E-002 1.301124179582083E-002 + 1.317490307023304E-002 1.334062295005453E-002 1.350842732935366E-002 1.367834242790612E-002 + 1.385039479529175E-002 1.402461131504297E-002 1.420101920884547E-002 1.437964604079155E-002 + 1.456051972168713E-002 1.474366851341282E-002 1.492912103333995E-002 1.511690625880209E-002 + 1.530705353162274E-002 1.549959256270016E-002 1.569455343664966E-002 1.589196661650445E-002 + 1.609186294847553E-002 1.629427366677146E-002 1.649923039847878E-002 1.670676516850381E-002 + 1.691691040457659E-002 1.712969894231781E-002 1.734516403036941E-002 1.756333933558977E-002 + 1.778425894831421E-002 1.800795738768166E-002 1.823446960702843E-002 1.846383099934961E-002 + 1.869607740282939E-002 1.893124510644083E-002 1.916937085561606E-002 1.941049185798788E-002 + 1.965464578920346E-002 1.990187079881129E-002 2.015220551622211E-002 2.040568905674480E-002 + 2.066236102769832E-002 2.092226153460032E-002 2.118543118743377E-002 2.145191110699236E-002 + 2.172174293130564E-002 2.199496882214519E-002 2.227163147161231E-002 2.255177410880886E-002 + 2.283544050659185E-002 2.312267498841303E-002 2.341352243524463E-002 2.370802829259192E-002 + 2.400623857759428E-002 2.430819988621546E-002 2.461395940052426E-002 2.492356489606690E-002 + 2.523706474933193E-002 2.555450794530926E-002 2.587594408514410E-002 2.620142339388723E-002 + 2.653099672834289E-002 2.686471558501508E-002 2.720263210815413E-002 2.754479909790425E-002 + 2.789127001855373E-002 2.824209900688886E-002 2.859734088065281E-002 2.895705114711111E-002 + 2.932128601172473E-002 2.969010238693227E-002 3.006355790104277E-002 3.044171090724010E-002 + 3.082462049270083E-002 3.121234648782671E-002 3.160494947559331E-002 3.200249080101626E-002 + 3.240503258073645E-002 3.281263771272593E-002 3.322536988611585E-002 3.364329359114798E-002 + 3.406647412925158E-002 3.449497762324665E-002 3.492887102767593E-002 3.536822213926663E-002 + 3.581309960752376E-002 3.626357294545692E-002 3.671971254044162E-002 3.718158966521759E-002 + 3.764927648902529E-002 3.812284608888241E-002 3.860237246100249E-002 3.908793053235673E-002 + 3.957959617238167E-002 4.007744620483386E-002 4.058155841979372E-002 4.109201158582052E-002 + 4.160888546225996E-002 4.213226081170681E-002 4.266221941262424E-002 4.319884407212182E-002 + 4.374221863889443E-002 4.429242801632360E-002 4.484955817574397E-002 4.541369616987644E-002 + 4.598493014643029E-002 4.656334936187663E-002 4.714904419539463E-002 4.774210616299364E-002 + 4.834262793181269E-002 4.895070333459987E-002 4.956642738437412E-002 5.018989628927085E-002 + 5.082120746757492E-002 5.146045956294235E-002 5.210775245981355E-002 5.276318729902069E-002 + 5.342686649359085E-002 5.409889374474844E-002 5.477937405811870E-002 5.546841376013498E-002 + 5.616612051465271E-002 5.687260333977171E-002 5.758797262487076E-002 5.831234014785609E-002 + 5.904581909262684E-002 5.978852406676052E-002 6.054057111942033E-002 6.130207775948830E-002 + 6.207316297392623E-002 6.285394724636761E-002 6.364455257594366E-002 6.444510249634554E-002 + 6.525572209512705E-002 6.607653803324971E-002 6.690767856487378E-002 6.774927355739840E-002 + 6.860145451175333E-002 6.946435458294646E-002 7.033810860086952E-002 7.122285309136538E-002 + 7.211872629756085E-002 7.302586820146700E-002 7.394442054585193E-002 7.487452685638822E-002 + 7.581633246407918E-002 7.676998452796724E-002 7.773563205812754E-002 7.871342593895130E-002 + 7.970351895272172E-002 8.070606580348651E-002 8.172122314123093E-002 8.274914958635428E-002 + 8.379000575445496E-002 8.484395428142685E-002 8.591115984887153E-002 8.699178920983026E-002 + 8.808601121483921E-002 8.919399683831286E-002 9.031591920525908E-002 9.145195361833022E-002 + 9.260227758521475E-002 9.376707084637276E-002 9.494651540312112E-002 9.614079554607138E-002 + 9.735009788392561E-002 9.857461137263460E-002 9.981452734492216E-002 1.010700395401816E-001 + 1.023413441347478E-001 1.036286397725500E-001 1.049321275961509E-001 1.062520112781748E-001 + 1.075884970531323E-001 1.089417937496448E-001 1.103121128230744E-001 1.116996683885645E-001 + 1.131046772544950E-001 1.145273589563598E-001 1.159679357910692E-001 1.174266328516845E-001 + 1.189036780625893E-001 1.203993022151028E-001 1.219137390035416E-001 1.234472250617353E-001 + 1.250000000000000E-001 1.265723064425793E-001 1.281643900655537E-001 1.297764996352282E-001 + 1.314088870470031E-001 1.330618073647324E-001 1.347355188605790E-001 1.364302830553690E-001 + 1.381463647594560E-001 1.398840321140977E-001 1.416435566333533E-001 1.434252132465091E-001 + 1.452292803410354E-001 1.470560398060864E-001 1.489057770765449E-001 1.507787811776226E-001 + 1.526753447700213E-001 1.545957641956607E-001 1.565403395239831E-001 1.585093745988400E-001 + 1.605031770859677E-001 1.625220585210614E-001 1.645663343584527E-001 1.666363240204004E-001 + 1.687323509470005E-001 1.708547426467245E-001 1.730038307475940E-001 1.751799510489967E-001 + 1.773834435741573E-001 1.796146526232657E-001 1.818739268272752E-001 1.841616192023770E-001 + 1.864780872051588E-001 1.888236927884592E-001 1.911988024579225E-001 1.936037873292666E-001 + 1.960390231862711E-001 1.985048905394930E-001 2.010017746857230E-001 2.035300657681889E-001 + 2.060901588375160E-001 2.086824539134554E-001 2.113073560473865E-001 2.139652753856082E-001 + 2.166566272334245E-001 2.193818321200373E-001 2.221413158642548E-001 2.249355096410262E-001 + 2.277648500488137E-001 2.306297791778126E-001 2.335307446790278E-001 2.364681998342213E-001 + 2.394426036267371E-001 2.424544208132194E-001 2.455041219962311E-001 2.485921836977865E-001 + 2.517190884338096E-001 2.548853247895270E-001 2.580913874958110E-001 2.613377775064821E-001 + 2.646250020765843E-001 2.679535748416449E-001 2.713240158979304E-001 2.747368518837129E-001 + 2.781926160615587E-001 2.816918484016511E-001 2.852350956661630E-001 2.888229114946881E-001 + 2.924558564907490E-001 2.961344983093927E-001 2.998594117458873E-001 3.036311788255361E-001 + 3.074503888946188E-001 3.113176387124790E-001 3.152335325447687E-001 3.191986822578659E-001 + 3.232137074144809E-001 3.272792353704627E-001 3.313959013728260E-001 3.355643486590090E-001 + 3.397852285573806E-001 3.440592005890134E-001 3.483869325707314E-001 3.527691007194624E-001 + 3.572063897578957E-001 3.616994930214701E-001 3.662491125667131E-001 3.708559592809336E-001 + 3.755207529933040E-001 3.802442225873332E-001 3.850271061147539E-001 3.898701509108494E-001 + 3.947741137112211E-001 3.997397607700343E-001 4.047678679797454E-001 4.098592209923342E-001 + 4.150146153420689E-001 4.202348565698038E-001 4.255207603488522E-001 4.308731526124346E-001 + 4.362928696827302E-001 4.417807584015592E-001 4.473376762626975E-001 4.529644915458676E-001 + 4.586620834524058E-001 4.644313422426380E-001 4.702731693749893E-001 4.761884776468328E-001 + 4.821781913371216E-001 4.882432463508068E-001 4.943845903650722E-001 5.006031829774161E-001 + 5.068999958555845E-001 5.132760128894014E-001 5.197322303445013E-001 5.262696570179950E-001 + 5.328893143961028E-001 5.395922368137556E-001 5.463794716162196E-001 5.532520793227422E-001 + 5.602111337922581E-001 5.672577223911884E-001 5.743929461633362E-001 5.816179200019336E-001 + 5.889337728238431E-001 5.963416477459503E-001 6.038427022637854E-001 6.114381084323758E-001 + 6.191290530493891E-001 6.269167378405703E-001 6.348023796475102E-001 6.427872106177864E-001 + 6.508724783974813E-001 6.590594463261362E-001 6.673493936341475E-001 6.757436156426458E-001 + 6.842434239659007E-001 6.928501467162530E-001 7.015651287116443E-001 7.103897316857435E-001 + 7.193253345007163E-001 7.283733333626849E-001 7.375351420398772E-001 7.468121920835402E-001 + 7.562059330516188E-001 7.657178327352483E-001 7.753493773881089E-001 7.851020719586458E-001 + 7.949774403252287E-001 8.049770255342580E-001 8.151023900412641E-001 8.253551159550543E-001 + 8.357368052849090E-001 8.462490801909092E-001 8.568935832373978E-001 8.676719776496294E-001 + 8.785859475736626E-001 8.896371983394996E-001 9.008274567275582E-001 9.121584712384796E-001 + 9.236320123663313E-001 9.352498728752607E-001 9.470138680796061E-001 9.589258361275534E-001 + 9.709876382883472E-001 9.832011592431115E-001 9.955683073793475E-001 1.008091015089109E+000 + 1.020771239070956E+000 1.033610960635684E+000 1.046612186015908E+000 1.059776946679548E+000 + 1.073107299647237E+000 1.086605327813750E+000 1.100273140273452E+000 1.114112872649842E+000 + 1.128126687429266E+000 1.142316774298791E+000 1.156685350488361E+000 1.171234661117242E+000 + 1.185966979544816E+000 1.200884607725814E+000 1.215989876569986E+000 1.231285146306323E+000 + 1.246772806851841E+000 1.262455278185007E+000 1.278335010723876E+000 1.294414485708962E+000 + 1.310696215590946E+000 1.327182744423251E+000 1.343876648259544E+000 1.360780535556269E+000 + 1.377897047580201E+000 1.395228858821171E+000 1.412778677409949E+000 1.430549245541390E+000 + 1.448543339902925E+000 1.466763772108402E+000 1.485213389137424E+000 1.503895073780192E+000 + 1.522811745087934E+000 1.541966358829033E+000 1.561361907950852E+000 1.581001423047403E+000 + 1.600887972832880E+000 1.621024664621142E+000 1.641414644811254E+000 1.662061099379099E+000 + 1.682967254375214E+000 1.704136376428846E+000 1.725571773258387E+000 1.747276794188206E+000 + 1.769254830671976E+000 1.791509316822619E+000 1.814043729948866E+000 1.836861591098618E+000 + 1.859966465609106E+000 1.883361963663974E+000 1.907051740857397E+000 1.931039498765253E+000 + 1.955328985523521E+000 1.979923996413929E+000 2.004828374456959E+000 2.030046011012357E+000 + 2.055580846387133E+000 2.081436870451268E+000 2.107618123261131E+000 2.134128695690733E+000 + 2.160972730070958E+000 2.188154420836786E+000 2.215678015182705E+000 2.243547813726332E+000 + 2.271768171180383E+000 2.300343497033134E+000 2.329278256237377E+000 2.358576969908110E+000 + 2.388244216028959E+000 2.418284630167477E+000 2.448702906199502E+000 2.479503797042542E+000 + 2.510692115398458E+000 2.542272734505453E+000 2.574250588899504E+000 2.606630675185429E+000 + 2.639418052817578E+000 2.672617844890418E+000 2.706235238939009E+000 2.740275487749559E+000 + 2.774743910180208E+000 2.809645891992078E+000 2.844986886690841E+000 2.880772416378825E+000 + 2.917008072617840E+000 2.953699517302906E+000 2.990852483546894E+000 3.028472776576372E+000 + 3.066566274638672E+000 3.105138929920356E+000 3.144196769477300E+000 3.183745896176387E+000 + 3.223792489649133E+000 3.264342807257249E+000 3.305403185070350E+000 3.346980038856020E+000 + 3.389079865082238E+000 3.431709241932512E+000 3.474874830333711E+000 3.518583374996832E+000 + 3.562841705470915E+000 3.607656737210129E+000 3.653035472654368E+000 3.698985002323373E+000 + 3.745512505924628E+000 3.792625253475245E+000 3.840330606437867E+000 3.888636018870958E+000 + 3.937549038593496E+000 3.987077308364313E+000 4.037228567076340E+000 4.088010650965772E+000 + 4.139431494836539E+000 4.191499133300121E+000 4.244221702030944E+000 4.297607439037654E+000 + 4.351664685950256E+000 4.406401889323567E+000 4.461827601956989E+000 4.517950484230867E+000 + 4.574779305459755E+000 4.632322945262574E+000 4.690590394950125E+000 4.749590758929975E+000 + 4.809333256129017E+000 4.869827221434003E+000 4.931082107150069E+000 4.993107484477742E+000 + 5.055913045008429E+000 5.119508602238725E+000 5.183904093103852E+000 5.249109579530251E+000 + 5.315135250007848E+000 5.381991421181995E+000 5.449688539465439E+000 5.518237182670661E+000 + 5.587648061662607E+000 5.657932022032345E+000 5.729100045791689E+000 5.801163253089122E+000 + 5.874132903947419E+000 5.948020400022963E+000 6.022837286387352E+000 6.098595253331307E+000 + 6.175306138191273E+000 6.252981927199102E+000 6.331634757354833E+000 6.411276918323213E+000 + 6.491920854353936E+000 6.573579166226057E+000 6.656264613216962E+000 6.739990115095946E+000 + 6.824768754143030E+000 6.910613777193061E+000 6.997538597705519E+000 7.085556797860484E+000 + 7.174682130680780E+000 7.264928522180998E+000 7.356310073543432E+000 7.448841063321374E+000 + 7.542535949670257E+000 7.637409372606672E+000 7.733476156295986E+000 7.830751311368615E+000 + 7.929250037265418E+000 8.028987724612744E+000 8.129979957627127E+000 8.232242516550462E+000 + 8.335791380115651E+000 8.440642728043269E+000 8.546812943569778E+000 8.654318616007330E+000 + 8.763176543335982E+000 8.873403734828367E+000 8.985017413707384E+000 9.098035019837468E+000 + 9.212474212449481E+000 9.328352872900114E+000 9.445689107465835E+000 9.564501250171986E+000 + 9.684807865657621E+000 9.806627752076144E+000 9.929979944032667E+000 1.005488371555816E+001 + 1.018135858312102E+001 1.030942430867664E+001 1.043910090275516E+001 1.057040862758825E+001 + 1.070336800027508E+001 1.083799979598811E+001 1.097432505121937E+001 1.111236506706729E+001 + 1.125214141256523E+001 1.139367592805156E+001 1.153699072858224E+001 1.168210820738647E+001 + 1.182905103936552E+001 1.197784218463586E+001 1.212850489211668E+001 1.228106270316251E+001 + 1.243553945524174E+001 1.259195928566114E+001 1.275034663533746E+001 1.291072625261636E+001 + 1.307312319713928E+001 1.323756284375925E+001 1.340407088650557E+001 1.357267334259870E+001 + 1.374339655651545E+001 1.391626720410529E+001 1.409131229675867E+001 1.426855918562738E+001 + 1.444803556589846E+001 1.462976948112149E+001 1.481378932759042E+001 1.500012385878069E+001 + 1.518880218984187E+001 1.537985380214707E+001 1.557330854789943E+001 1.576919665479652E+001 + 1.596754873075363E+001 1.616839576868612E+001 1.637176915135232E+001 1.657770065625708E+001 + 1.678622246061694E+001 1.699736714638814E+001 1.721116770535734E+001 1.742765754429690E+001 + 1.764687049018463E+001 1.786884079548925E+001 1.809360314352264E+001 1.832119265385890E+001 + 1.855164488782207E+001 1.878499585404262E+001 1.902128201408370E+001 1.926054028813861E+001 + 1.950280806079939E+001 1.974812318689843E+001 1.999652399742333E+001 2.024804930550604E+001 + 2.050273841248775E+001 2.076063111405951E+001 2.102176770648068E+001 2.128618899287514E+001 + 2.155393628960679E+001 2.182505143273556E+001 2.209957678455406E+001 2.237755524020708E+001 + 2.265903023439392E+001 2.294404574815500E+001 2.323264631574429E+001 2.352487703158756E+001 + 2.382078355732875E+001 2.412041212896457E+001 2.442380956406887E+001 2.473102326910822E+001 + 2.504210124684898E+001 2.535709210385811E+001 2.567604505809792E+001 2.599900994661633E+001 + 2.632603723333434E+001 2.665717801693076E+001 2.699248403882676E+001 2.733200769127052E+001 + 2.767580202552340E+001 2.802392076014966E+001 2.837641828940976E+001 2.873334969175986E+001 + 2.909477073845779E+001 2.946073790227733E+001 2.983130836633248E+001 3.020654003301210E+001 + 3.058649153302755E+001 3.097122223457379E+001 3.136079225260557E+001 3.175526245823091E+001 + 3.215469448822187E+001 3.255915075464585E+001 3.296869445461741E+001 3.338338958017277E+001 + 3.380330092826912E+001 3.422849411090882E+001 3.465903556539175E+001 3.509499256469619E+001 + 3.553643322799012E+001 3.598342653127542E+001 3.643604231816502E+001 3.689435131079654E+001 + 3.735842512088257E+001 3.782833626089998E+001 3.830415815542057E+001 3.878596515258330E+001 + 3.927383253571178E+001 3.976783653507726E+001 4.026805433980957E+001 4.077456410995854E+001 + 4.128744498870611E+001 4.180677711473313E+001 4.233264163474094E+001 4.286512071613055E+001 + 4.340429755984189E+001 4.395025641335360E+001 4.450308258384739E+001 4.506286245153721E+001 + 4.562968348316611E+001 4.620363424567365E+001 4.678480442003402E+001 4.737328481526944E+001 + 4.796916738263903E+001 4.857254523000610E+001 4.918351263638706E+001 4.980216506668199E+001 + 5.042859918659189E+001 5.106291287772257E+001 5.170520525287860E+001 5.235557667155054E+001 + 5.301412875559557E+001 5.368096440511674E+001 5.435618781454108E+001 5.503990448889986E+001 + 5.573222126031470E+001 5.643324630468944E+001 5.714308915861362E+001 5.786186073647745E+001 + 5.858967334780213E+001 5.932664071478911E+001 6.007287799008867E+001 6.082850177479340E+001 + 6.159363013665710E+001 6.236838262854275E+001 6.315288030710369E+001 6.394724575169803E+001 + 6.475160308354275E+001 6.556607798510755E+001 6.639079771975264E+001 6.722589115161468E+001 + 6.807148876574118E+001 6.892772268847985E+001 6.979472670812325E+001 7.067263629581315E+001 + 7.156158862670898E+001 7.246172260142080E+001 7.337317886771361E+001 7.429609984248353E+001 + 7.523062973401028E+001 7.617691456449101E+001 7.713510219285546E+001 7.810534233787011E+001 + 7.908778660153176E+001 8.008258849275511E+001 8.108990345135987E+001 8.210988887235747E+001 + 8.314270413054523E+001 8.418851060540868E+001 8.524747170633694E+001 8.631975289815679E+001 + 8.740552172698573E+001 8.850494784641242E+001 8.961820304400499E+001 9.074546126815267E+001 + 9.188689865524674E+001 9.304269355720088E+001 9.421302656932016E+001 9.539808055851896E+001 + 9.659804069189374E+001 9.781309446565707E+001 9.904343173443276E+001 + + rab(1:1095) = + 1.424815571178932E-006 1.442737544795347E-006 1.460884949088410E-006 1.479260619626959E-006 + 1.497867427646906E-006 1.516708280499858E-006 1.535786122107404E-006 1.555103933421111E-006 + 1.574664732888298E-006 1.594471576923679E-006 1.614527560386933E-006 1.634835817066279E-006 + 1.655399520168141E-006 1.676221882812964E-006 1.697306158537278E-006 1.718655641802060E-006 + 1.740273668507505E-006 1.762163616514269E-006 1.784328906171262E-006 1.806773000850090E-006 + 1.829499407486210E-006 1.852511677126895E-006 1.875813405486095E-006 1.899408233506273E-006 + 1.923299847927314E-006 1.947491981862577E-006 1.971988415382210E-006 1.996792976103788E-006 + 2.021909539790388E-006 2.047342030956188E-006 2.073094423479674E-006 2.099170741224573E-006 + 2.125575058668584E-006 2.152311501540027E-006 2.179384247462498E-006 2.206797526607627E-006 + 2.234555622356054E-006 2.262662871966712E-006 2.291123667254536E-006 2.319942455276699E-006 + 2.349123739027457E-006 2.378672078141768E-006 2.408592089607735E-006 2.438888448488019E-006 + 2.469565888650339E-006 2.500629203507132E-006 2.532083246764542E-006 2.563932933180822E-006 + 2.596183239334272E-006 2.628839204400846E-006 2.661905930941522E-006 2.695388585699598E-006 + 2.729292400407999E-006 2.763622672606751E-006 2.798384766470734E-006 2.833584113647836E-006 + 2.869226214107668E-006 2.905316637000939E-006 2.941861021529652E-006 2.978865077828245E-006 + 3.016334587855796E-006 3.054275406299480E-006 3.092693461489370E-006 3.131594756324749E-006 + 3.170985369212085E-006 3.210871455014780E-006 3.251259246014890E-006 3.292155052886929E-006 + 3.333565265683919E-006 3.375496354835867E-006 3.417954872160758E-006 3.460947451888308E-006 + 3.504480811696568E-006 3.548561753761574E-006 3.593197165820213E-006 3.638394022246428E-006 + 3.684159385140989E-006 3.730500405434959E-006 3.777424324007037E-006 3.824938472814974E-006 + 3.873050276041185E-006 3.921767251252811E-006 3.971097010576341E-006 4.021047261887031E-006 + 4.071625810013278E-006 4.122840557956128E-006 4.174699508124142E-006 4.227210763583792E-006 + 4.280382529325576E-006 4.334223113546076E-006 4.388740928946114E-006 4.443944494045262E-006 + 4.499842434512880E-006 4.556443484515887E-006 4.613756488083511E-006 4.671790400489157E-006 + 4.730554289649712E-006 4.790057337542412E-006 4.850308841639545E-006 4.911318216361220E-006 + 4.973094994546355E-006 5.035648828942229E-006 5.098989493712732E-006 5.163126885965597E-006 + 5.228071027298863E-006 5.293832065366737E-006 5.360420275465210E-006 5.427846062137584E-006 + 5.496119960800201E-006 5.565252639388640E-006 5.635254900024580E-006 5.706137680703662E-006 + 5.777912057004582E-006 5.850589243819657E-006 5.924180597107200E-006 5.998697615665881E-006 + 6.074151942931454E-006 6.150555368796068E-006 6.227919831450454E-006 6.306257419249310E-006 + 6.385580372600104E-006 6.465901085875683E-006 6.547232109350906E-006 6.629586151163657E-006 + 6.712976079300532E-006 6.797414923607452E-006 6.882915877825635E-006 6.969492301653128E-006 + 7.057157722832291E-006 7.145925839263552E-006 7.235810521145697E-006 7.326825813143143E-006 + 7.418985936580434E-006 7.512305291664353E-006 7.606798459734005E-006 7.702480205539145E-006 + 7.799365479547215E-006 7.897469420279397E-006 7.996807356676018E-006 8.097394810491758E-006 + 8.199247498720913E-006 8.302381336053244E-006 8.406812437360658E-006 8.512557120215196E-006 + 8.619631907438707E-006 8.728053529684530E-006 8.837838928051731E-006 8.949005256732165E-006 + 9.061569885690847E-006 9.175550403380082E-006 9.290964619487647E-006 9.407830567719623E-006 + 9.526166508618185E-006 9.645990932414846E-006 9.767322561919628E-006 9.890180355446481E-006 + 1.001458350977560E-005 1.014055146315295E-005 1.026810389832752E-005 1.039726074562683E-005 + 1.052804218607104E-005 1.066046865452629E-005 1.079456084289771E-005 1.093033970336252E-005 + 1.106782645164395E-005 1.120704257032609E-005 1.134800981221077E-005 1.149075020371631E-005 + 1.163528604831928E-005 1.178163993003950E-005 1.192983471696869E-005 1.207989356484386E-005 + 1.223183992066527E-005 1.238569752636015E-005 1.254149042249244E-005 1.269924295201908E-005 + 1.285897976409380E-005 1.302072581791845E-005 1.318450638664302E-005 1.335034706131460E-005 + 1.351827375487599E-005 1.368831270621473E-005 1.386049048426290E-005 1.403483399214862E-005 + 1.421137047139973E-005 1.439012750620022E-005 1.457113302770051E-005 1.475441531838158E-005 + 1.494000301647423E-005 1.512792512043390E-005 1.531821099347161E-005 1.551089036814221E-005 + 1.570599335098998E-005 1.590355042725292E-005 1.610359246562617E-005 1.630615072308516E-005 + 1.651125684976977E-005 1.671894289392958E-005 1.692924130693149E-005 1.714218494833045E-005 + 1.735780709100360E-005 1.757614142634948E-005 1.779722206955215E-005 1.802108356491191E-005 + 1.824776089124290E-005 1.847728946733847E-005 1.870970515750566E-005 1.894504427716891E-005 + 1.918334359854443E-005 1.942464035638608E-005 1.966897225380312E-005 1.991637746815167E-005 + 2.016689465699980E-005 2.042056296416794E-005 2.067742202584522E-005 2.093751197678255E-005 + 2.120087345656396E-005 2.146754761595648E-005 2.173757612334003E-005 2.201100117121834E-005 + 2.228786548281134E-005 2.256821231873106E-005 2.285208548374097E-005 2.313952933360063E-005 + 2.343058878199644E-005 2.372530930755929E-005 2.402373696097099E-005 2.432591837215952E-005 + 2.463190075758514E-005 2.494173192761816E-005 2.525546029400918E-005 2.557313487745379E-005 + 2.589480531525196E-005 2.622052186906400E-005 2.655033543276419E-005 2.688429754039279E-005 + 2.722246037420862E-005 2.756487677284244E-005 2.791160023955318E-005 2.826268495058799E-005 + 2.861818576364716E-005 2.897815822645607E-005 2.934265858544439E-005 2.971174379453478E-005 + 3.008547152404208E-005 3.046390016968437E-005 3.084708886170747E-005 3.123509747412411E-005 + 3.162798663406936E-005 3.202581773127384E-005 3.242865292765585E-005 3.283655516703442E-005 + 3.324958818496434E-005 3.366781651869496E-005 3.409130551725433E-005 3.452012135166007E-005 + 3.495433102525876E-005 3.539400238419527E-005 3.583920412801396E-005 3.629000582039309E-005 + 3.674647790001423E-005 3.720869169156856E-005 3.767671941690137E-005 3.815063420629693E-005 + 3.863051010990531E-005 3.911642210931274E-005 3.960844612925773E-005 4.010665904949443E-005 + 4.061113871680524E-005 4.112196395716455E-005 4.163921458805545E-005 4.216297143094138E-005 + 4.269331632389464E-005 4.323033213438372E-005 4.377410277222160E-005 4.432471320267672E-005 + 4.488224945974912E-005 4.544679865961325E-005 4.601844901423014E-005 4.659728984513080E-005 + 4.718341159737266E-005 4.777690585367203E-005 4.837786534871390E-005 4.898638398364202E-005 + 4.960255684073118E-005 5.022648019824386E-005 5.085825154547411E-005 5.149796959798026E-005 + 5.214573431300950E-005 5.280164690511650E-005 5.346580986197818E-005 5.413832696040785E-005 + 5.481930328257037E-005 5.550884523240151E-005 5.620706055223386E-005 5.691405833963162E-005 + 5.762994906443753E-005 5.835484458603378E-005 5.908885817082044E-005 5.983210450991353E-005 + 6.058469973706564E-005 6.134676144681221E-005 6.211840871284581E-005 6.289976210662165E-005 + 6.369094371619722E-005 6.449207716530867E-005 6.530328763268737E-005 6.612470187161925E-005 + 6.695644822975030E-005 6.779865666914121E-005 6.865145878657410E-005 6.951498783411488E-005 + 7.038937873993410E-005 7.127476812938969E-005 7.217129434637519E-005 7.307909747493592E-005 + 7.399831936115771E-005 7.492910363533043E-005 7.587159573439059E-005 7.682594292464622E-005 + 7.779229432478742E-005 7.877080092918653E-005 7.976161563149129E-005 8.076489324851471E-005 + 8.178079054442560E-005 8.280946625524344E-005 8.385108111364084E-005 8.490579787405859E-005 + 8.597378133813635E-005 8.705519838046312E-005 8.815021797465211E-005 8.925901121974264E-005 + 9.038175136693514E-005 9.151861384666182E-005 9.266977629599800E-005 9.383541858641867E-005 + 9.501572285190309E-005 9.621087351739412E-005 9.742105732761478E-005 9.864646337624746E-005 + 9.988728313548058E-005 1.011437104859259E-004 1.024159417469131E-004 1.037041757071651E-004 + 1.050086136558590E-004 1.063294594140784E-004 1.076669193666603E-004 1.090212024944432E-004 + 1.103925204069213E-004 1.117810873753082E-004 1.131871203660179E-004 1.146108390745658E-004 + 1.160524659598967E-004 1.175122262791444E-004 1.189903481228286E-004 1.204870624504949E-004 + 1.220026031268018E-004 1.235372069580636E-004 1.250911137292509E-004 1.266645662414582E-004 + 1.282578103498419E-004 1.298710950020353E-004 1.315046722770475E-004 1.331587974246514E-004 + 1.348337289052664E-004 1.365297284303444E-004 1.382470610032614E-004 1.399859949607261E-004 + 1.417468020147071E-004 1.435297572948889E-004 1.453351393916617E-004 1.471632303996511E-004 + 1.490143159617964E-004 1.508886853139826E-004 1.527866313302345E-004 1.547084505684786E-004 + 1.566544433168809E-004 1.586249136407673E-004 1.606201694301351E-004 1.626405224477604E-004 + 1.646862883779130E-004 1.667577868756816E-004 1.688553416169208E-004 1.709792803488265E-004 + 1.731299349411468E-004 1.753076414380371E-004 1.775127401105684E-004 1.797455755098944E-004 + 1.820064965210891E-004 1.842958564176603E-004 1.866140129167494E-004 1.889613282350261E-004 + 1.913381691452843E-004 1.937449070337520E-004 1.961819179581208E-004 1.986495827063056E-004 + 2.011482868559441E-004 2.036784208346433E-004 2.062403799809848E-004 2.088345646062977E-004 + 2.114613800572074E-004 2.141212367789726E-004 2.168145503796177E-004 2.195417416948721E-004 + 2.223032368539276E-004 2.250994673460207E-004 2.279308700878554E-004 2.307978874918701E-004 + 2.337009675353674E-004 2.366405638305104E-004 2.396171356952008E-004 2.426311482248485E-004 + 2.456830723650432E-004 2.487733849851412E-004 2.519025689527764E-004 2.550711132093100E-004 + 2.582795128462290E-004 2.615282691825040E-004 2.648178898429222E-004 2.681488888374045E-004 + 2.715217866413205E-004 2.749371102768149E-004 2.783953933951539E-004 2.818971763601107E-004 + 2.854430063323981E-004 2.890334373551629E-004 2.926690304405579E-004 2.963503536573990E-004 + 3.000779822199285E-004 3.038524985776933E-004 3.076744925065532E-004 3.115445612008362E-004 + 3.154633093666492E-004 3.194313493163658E-004 3.234493010643013E-004 3.275177924235903E-004 + 3.316374591042861E-004 3.358089448126885E-004 3.400329013519266E-004 3.443099887238031E-004 + 3.486408752319216E-004 3.530262375861108E-004 3.574667610081602E-004 3.619631393388889E-004 + 3.665160751465591E-004 3.711262798366534E-004 3.757944737630347E-004 3.805213863405012E-004 + 3.853077561587603E-004 3.901543310978340E-004 3.950618684449164E-004 4.000311350127033E-004 + 4.050629072592057E-004 4.101579714090741E-004 4.153171235764481E-004 4.205411698893498E-004 + 4.258309266156448E-004 4.311872202905832E-004 4.366108878459491E-004 4.421027767408329E-004 + 4.476637450940471E-004 4.532946618182115E-004 4.589964067555203E-004 4.647698708152199E-004 + 4.706159561128161E-004 4.765355761110301E-004 4.825296557625311E-004 4.885991316544592E-004 + 4.947449521547709E-004 5.009680775604233E-004 5.072694802474214E-004 5.136501448227566E-004 + 5.201110682782494E-004 5.266532601463351E-004 5.332777426578031E-004 5.399855509015227E-004 + 5.467777329861804E-004 5.536553502040450E-004 5.606194771967997E-004 5.676712021234555E-004 + 5.748116268303787E-004 5.820418670234579E-004 5.893630524424330E-004 5.967763270374205E-004 + 6.042828491476587E-004 6.118837916824984E-004 6.195803423046766E-004 6.273737036158857E-004 + 6.352650933446865E-004 6.432557445367794E-004 6.513469057476694E-004 6.595398412377587E-004 + 6.678358311698857E-004 6.762361718093556E-004 6.847421757264837E-004 6.933551720016873E-004 + 7.020765064331589E-004 7.109075417471465E-004 7.198496578108846E-004 7.289042518482011E-004 + 7.380727386578355E-004 7.473565508345065E-004 7.567571389927542E-004 7.662759719936037E-004 + 7.759145371740779E-004 7.856743405795952E-004 7.955569071992958E-004 8.055637812043192E-004 + 8.156965261890882E-004 8.259567254156214E-004 8.363459820609223E-004 8.468659194674800E-004 + 8.575181813969166E-004 8.683044322868308E-004 8.792263575108690E-004 8.902856636420673E-004 + 9.014840787195107E-004 9.128233525183375E-004 9.243052568231492E-004 9.359315857048528E-004 + 9.477041558009898E-004 9.596248065995906E-004 9.716954007265943E-004 9.839178242368911E-004 + 9.962939869090216E-004 1.008825822543581E-003 1.021515289265387E-003 1.034364369829428E-003 + 1.047375071930687E-003 1.060549428517836E-003 1.073889498110894E-003 1.087397365122878E-003 + 1.101075140185490E-003 1.114924960478911E-003 1.128948990065739E-003 1.143149420229128E-003 + 1.157528469815184E-003 1.172088385579660E-003 1.186831442539014E-003 1.201759944325892E-003 + 1.216876223549070E-003 1.232182642157933E-003 1.247681591811527E-003 1.263375494252270E-003 + 1.279266801684348E-003 1.295357997156876E-003 1.311651594951887E-003 1.328150140977185E-003 + 1.344856213164154E-003 1.361772421870560E-003 1.378901410288430E-003 1.396245854857056E-003 + 1.413808465681187E-003 1.431591986954497E-003 1.449599197388365E-003 1.467832910646056E-003 + 1.486295975782366E-003 1.504991277688785E-003 1.523921737544271E-003 1.543090313271691E-003 + 1.562500000000000E-003 1.582153830532242E-003 1.602054875819421E-003 1.622206245440352E-003 + 1.642611088087539E-003 1.663272592059155E-003 1.684193985757237E-003 1.705378538192113E-003 + 1.726829559493200E-003 1.748550401426221E-003 1.770544457916916E-003 1.792815165581363E-003 + 1.815366004262943E-003 1.838200497576080E-003 1.861322213456811E-003 1.884734764720282E-003 + 1.908441809625266E-003 1.932447052445758E-003 1.956754244049789E-003 1.981367182485501E-003 + 2.006289713574596E-003 2.031525731513268E-003 2.057079179480659E-003 2.082954050255006E-003 + 2.109154386837506E-003 2.135684283084057E-003 2.162547884344924E-003 2.189749388112459E-003 + 2.217293044676966E-003 2.245183157790821E-003 2.273424085340940E-003 2.302020240029712E-003 + 2.330976090064486E-003 2.360296159855740E-003 2.389985030724031E-003 2.420047341615833E-003 + 2.450487789828390E-003 2.481311131743663E-003 2.512522183571537E-003 2.544125822102361E-003 + 2.576126985468951E-003 2.608530673918192E-003 2.641341950592331E-003 2.674565942320102E-003 + 2.708207840417807E-003 2.742272901500467E-003 2.776766448303186E-003 2.811693870512827E-003 + 2.847060625610172E-003 2.882872239722658E-003 2.919134308487848E-003 2.955852497927766E-003 + 2.993032545334214E-003 3.030680260165243E-003 3.068801524952888E-003 3.107402296222331E-003 + 3.146488605422621E-003 3.186066559869087E-003 3.226142343697637E-003 3.266722218831027E-003 + 3.307812525957304E-003 3.349419685520562E-003 3.391550198724130E-003 3.434210648546411E-003 + 3.477407700769483E-003 3.521148105020638E-003 3.565438695827038E-003 3.610286393683601E-003 + 3.655698206134363E-003 3.701681228867409E-003 3.748242646823591E-003 3.795389735319201E-003 + 3.843129861182736E-003 3.891470483905988E-003 3.940419156809609E-003 3.989983528223323E-003 + 4.040171342681011E-003 4.090990442130784E-003 4.142448767160325E-003 4.194554358237613E-003 + 4.247315356967258E-003 4.300740007362668E-003 4.354836657134143E-003 4.409613758993280E-003 + 4.465079871973697E-003 4.521243662768377E-003 4.578113907083914E-003 4.635699491011670E-003 + 4.694009412416301E-003 4.753052782341665E-003 4.812838826434424E-003 4.873376886385618E-003 + 4.934676421390265E-003 4.996747009625429E-003 5.059598349746818E-003 5.123240262404178E-003 + 5.187682691775861E-003 5.252935707122548E-003 5.319009504360653E-003 5.385914407655433E-003 + 5.453660871034128E-003 5.522259480019490E-003 5.591720953283720E-003 5.662056144323345E-003 + 5.733276043155073E-003 5.805391778032975E-003 5.878414617187367E-003 5.952355970585410E-003 + 6.027227391714021E-003 6.103040579385086E-003 6.179807379563402E-003 6.257539787217702E-003 + 6.336249948194807E-003 6.415950161117518E-003 6.496652879306267E-003 6.578370712724938E-003 + 6.661116429951285E-003 6.744902960171945E-003 6.829743395202745E-003 6.915650991534278E-003 + 7.002639172403226E-003 7.090721529889855E-003 7.179911827041703E-003 7.270224000024170E-003 + 7.361672160298038E-003 7.454270596824380E-003 7.548033778297318E-003 7.642976355404698E-003 + 7.739113163117365E-003 7.836459223007129E-003 7.935029745593878E-003 8.034840132722331E-003 + 8.135905979968517E-003 8.238243079076703E-003 8.341867420426844E-003 8.446795195533074E-003 + 8.553042799573758E-003 8.660626833953163E-003 8.769564108895555E-003 8.879871646071794E-003 + 8.991566681258955E-003 9.104666667033563E-003 9.219189275498465E-003 9.335152401044253E-003 + 9.452574163145235E-003 9.571472909190604E-003 9.691867217351362E-003 9.813775899483073E-003 + 9.937218004065359E-003 1.006221281917823E-002 1.018877987551580E-002 1.031693894943818E-002 + 1.044671006606136E-002 1.057811350238637E-002 1.071116979046747E-002 1.084589972062037E-002 + 1.098232434467078E-002 1.112046497924375E-002 1.126034320909448E-002 1.140198089048100E-002 + 1.154540015457914E-002 1.169062341094076E-002 1.183767335099508E-002 1.198657295159442E-002 + 1.213734547860434E-002 1.229001449053889E-002 1.244460384224184E-002 1.260113768861387E-002 + 1.275964048838695E-002 1.292013700794605E-002 1.308265232519885E-002 1.324721183349435E-002 + 1.341384124559046E-002 1.358256659767188E-002 1.375341425341815E-002 1.392641090812303E-002 + 1.410158359286583E-002 1.427895967873489E-002 1.445856688110451E-002 1.464043326396552E-002 + 1.482458724431020E-002 1.501105759657267E-002 1.519987345712483E-002 1.539106432882903E-002 + 1.558466008564801E-002 1.578069097731259E-002 1.597918763404845E-002 1.618018107136203E-002 + 1.638370269488683E-002 1.658978430529064E-002 1.679845810324430E-002 1.700975669445336E-002 + 1.722371309475251E-002 1.744036073526463E-002 1.765973346762436E-002 1.788186556926738E-002 + 1.810679174878657E-002 1.833454715135502E-002 1.856516736421781E-002 1.879868842225241E-002 + 1.903514681359918E-002 1.927457948536292E-002 1.951702384938565E-002 1.976251778809254E-002 + 2.001109966041100E-002 2.026280830776427E-002 2.051768306014067E-002 2.077576374223873E-002 + 2.103709067969017E-002 2.130170470536057E-002 2.156964716572984E-002 2.184095992735258E-002 + 2.211568538339970E-002 2.239386646028273E-002 2.267554662436082E-002 2.296076988873272E-002 + 2.324958082011383E-002 2.354202454579968E-002 2.383814676071747E-002 2.413799373456567E-002 + 2.444161231904402E-002 2.474904995517412E-002 2.506035468071199E-002 2.537557513765447E-002 + 2.569476057983916E-002 2.601796088064085E-002 2.634522654076414E-002 2.667660869613416E-002 + 2.701215912588698E-002 2.735193026045983E-002 2.769597518978382E-002 2.804434767157915E-002 + 2.839710213975479E-002 2.875429371291418E-002 2.911597820296721E-002 2.948221212385138E-002 + 2.985305270036198E-002 3.022855787709347E-002 3.060878632749378E-002 3.099379746303177E-002 + 3.138365144248073E-002 3.177840918131817E-002 3.217813236124380E-002 3.258288343981787E-002 + 3.299272566021973E-002 3.340772306113023E-002 3.382794048673762E-002 3.425344359686949E-002 + 3.468429887725260E-002 3.512057364990098E-002 3.556233608363552E-002 3.600965520473531E-002 + 3.646260090772301E-002 3.692124396628633E-002 3.738565604433618E-002 3.785590970720466E-002 + 3.833207843298340E-002 3.881423662400445E-002 3.930245961846625E-002 3.979682370220484E-002 + 4.029740612061417E-002 4.080428509071562E-002 4.131753981337938E-002 4.183725048570025E-002 + 4.236349831352798E-002 4.289636552415640E-002 4.343593537917140E-002 4.398229218746040E-002 + 4.453552131838644E-002 4.509570921512662E-002 4.566294340817960E-002 4.623731252904216E-002 + 4.681890632405786E-002 4.740781566844057E-002 4.800413258047334E-002 4.860795023588697E-002 + 4.921936298241870E-002 4.983846635455391E-002 5.046535708845426E-002 5.110013313707215E-002 + 5.174289368545674E-002 5.239373916625151E-002 5.305277127538680E-002 5.372009298797067E-002 + 5.439580857437820E-002 5.508002361654460E-002 5.577284502446236E-002 5.647438105288584E-002 + 5.718474131824694E-002 5.790403681578218E-002 5.863237993687657E-002 5.936988448662470E-002 + 6.011666570161272E-002 6.087284026792503E-002 6.163852633937587E-002 6.241384355597177E-002 + 6.319891306260537E-002 6.399385752798407E-002 6.479880116379814E-002 6.561386974412814E-002 + 6.643919062509811E-002 6.727489276477494E-002 6.812110674331799E-002 6.897796478338326E-002 + 6.984560077078260E-002 7.072415027540432E-002 7.161375057239612E-002 7.251454066361403E-002 + 7.342666129934274E-002 7.435025500028704E-002 7.528546607984191E-002 7.623244066664135E-002 + 7.719132672739093E-002 7.816227408998877E-002 7.914543446693542E-002 8.014096147904017E-002 + 8.114901067942420E-002 8.216973957782571E-002 8.320330766521203E-002 8.424987643869933E-002 + 8.530960942678788E-002 8.638267221491326E-002 8.746923247131899E-002 8.856945997325605E-002 + 8.968352663350976E-002 9.081160652726249E-002 9.195387591929291E-002 9.311051329151718E-002 + 9.428169937087821E-002 9.546761715758340E-002 9.666845195369983E-002 9.788439139210769E-002 + 9.911562546581773E-002 1.003623465576593E-001 1.016247494703391E-001 1.029030314568808E-001 + 1.041973922514456E-001 1.055080341005409E-001 1.068351617946222E-001 1.081789827000916E-001 + 1.095397067916998E-001 1.109175466853546E-001 1.123127176713423E-001 1.137254377479684E-001 + 1.151559276556185E-001 1.166044109112514E-001 1.180711138433229E-001 1.195562656271498E-001 + 1.210600983207203E-001 1.225828469009518E-001 1.241247493004083E-001 1.256860464444771E-001 + 1.272669822890127E-001 1.288678038584580E-001 1.304887612844395E-001 1.321301078448531E-001 + 1.337921000034385E-001 1.354749974498514E-001 1.371790631402421E-001 1.389045633383411E-001 + 1.406517676570653E-001 1.424209491006445E-001 1.442123841072780E-001 1.460263525923308E-001 + 1.478631379920690E-001 1.497230273079483E-001 1.516063111514585E-001 1.535132837895314E-001 + 1.554442431905218E-001 1.573994910707643E-001 1.593793329417183E-001 1.613840781577045E-001 + 1.634140399642410E-001 1.654695355469907E-001 1.675508860813196E-001 1.696584167824838E-001 + 1.717924569564432E-001 1.739533400513162E-001 1.761414037094833E-001 1.783569898203423E-001 + 1.806004445737307E-001 1.828721185140186E-001 1.851723665948802E-001 1.875015482347587E-001 + 1.898600273730234E-001 1.922481725268383E-001 1.946663568487429E-001 1.971149581849565E-001 + 1.995943591344204E-001 2.021049471085765E-001 2.046471143919041E-001 2.072212582032135E-001 + 2.098277807577118E-001 2.124670893298518E-001 2.151395963169668E-001 2.178457193037112E-001 + 2.205858811273078E-001 2.233605099436157E-001 2.261700392940330E-001 2.290149081732362E-001 + 2.318955610977760E-001 2.348124481755328E-001 2.377660251760463E-001 2.407567536017327E-001 + 2.437851007599924E-001 2.468515398362304E-001 2.499565499677917E-001 2.531006163188256E-001 + 2.562842301560969E-001 2.595078889257439E-001 2.627720963310085E-001 2.660773624109393E-001 + 2.694242036200849E-001 2.728131429091945E-001 2.762447098069257E-001 2.797194405025886E-001 + 2.832378779299240E-001 2.868005718519375E-001 2.904080789468036E-001 2.940609628948445E-001 + 2.977597944666094E-001 3.015051516120572E-001 3.052976195508609E-001 3.091377908638527E-001 + 3.130262655856123E-001 3.169636512982264E-001 3.209505632262240E-001 3.249876243327041E-001 + 3.290754654166793E-001 3.332147252116345E-001 3.374060504853346E-001 3.416500961408815E-001 + 3.459475253190425E-001 3.502990095018708E-001 3.547052286176220E-001 3.591668711469982E-001 + 3.636846342307223E-001 3.682592237784666E-001 3.728913545791561E-001 3.775817504126512E-001 + 3.823311441628444E-001 3.871402779321724E-001 3.920099031575697E-001 3.969407807278864E-001 + 4.019336811027734E-001 4.069893844330731E-001 4.121086806827176E-001 4.172923697521596E-001 + 4.225412616033641E-001 4.278561763863603E-001 4.332379445673968E-001 4.386874070587024E-001 + 4.442054153498765E-001 4.497928316409427E-001 4.554505289770628E-001 4.611793913849567E-001 + 4.669803140110322E-001 4.728542032612498E-001 4.788019769427572E-001 4.848245644072913E-001 + 4.909229066963972E-001 4.970979566884657E-001 5.033506792476196E-001 5.096820513744817E-001 + 5.160930623588265E-001 5.225847139341642E-001 5.291580204342619E-001 5.358140089516319E-001 + 5.425537194980236E-001 5.493782051669200E-001 5.562885322980924E-001 5.632857806442152E-001 + 5.703710435395765E-001 5.775454280709207E-001 5.848100552504253E-001 5.921660601908680E-001 + 5.996145922829879E-001 6.071568153750763E-001 6.147939079548382E-001 6.225270633335249E-001 + 6.303574898323987E-001 6.382864109715322E-001 6.463150656609825E-001 6.544447083943817E-001 + 6.626766094449447E-001 6.710120550639593E-001 6.794523476817635E-001 6.879988061112483E-001 + 6.966527657539338E-001 7.054155788086180E-001 7.142886144826703E-001 7.232732592059681E-001 + 7.323709168475266E-001 7.415830089348640E-001 7.509109748761085E-001 7.603562721849175E-001 + 7.699203767082138E-001 7.796047828567845E-001 7.894110038387961E-001 7.993405718962254E-001 + 8.093950385442844E-001 8.195759748138445E-001 8.298849714969081E-001 8.403236393951835E-001 + 8.508936095717647E-001 8.615965336059981E-001 8.724340838515406E-001 8.834079536976644E-001 + 8.945198578338623E-001 9.057715325177601E-001 9.171647358464201E-001 9.287012480310441E-001 + 9.403828716751286E-001 9.522114320561377E-001 9.641887774106932E-001 9.763167792233765E-001 + 9.885973325191471E-001 1.001032356159439E+000 1.013623793141998E+000 1.026373610904469E+000 + 1.039283801631815E+000 1.052356382567609E+000 1.065593396329212E+000 1.078996911226960E+000 + 1.092569021587322E+000 1.106311848080155E+000 1.120227538050062E+000 1.134318265851908E+000 + 1.148586233190584E+000 1.163033669465011E+000 1.177662832116502E+000 1.192476006981487E+000 + 1.207475508648672E+000 1.222663680820713E+000 1.238042896680410E+000 +/ + +&local +vloc(1:1095) = +-3.959624422322239E+001 -3.959625385320293E+001 -3.959626365265639E+001 -3.959627363427202E+001 +-3.959628381049185E+001 -3.959629419351949E+001 -3.959630479532859E+001 -3.959631563552769E+001 +-3.959632679662119E+001 -3.959633824025218E+001 -3.959634895829286E+001 -3.959636096043304E+001 +-3.959637326635907E+001 -3.959638588377608E+001 -3.959639882055205E+001 -3.959641208478321E+001 +-3.959642482061974E+001 -3.959643874103972E+001 -3.959645301380638E+001 -3.959646764783876E+001 +-3.959648265226726E+001 -3.959649803652388E+001 -3.959651381012080E+001 -3.959652998296047E+001 +-3.959654656512785E+001 -3.959656228255710E+001 -3.959657968021117E+001 -3.959659751820813E+001 +-3.959661580762333E+001 -3.959663455995469E+001 -3.959665272687897E+001 -3.959667241201253E+001 +-3.959669259532957E+001 -3.959671328951007E+001 -3.959673450747822E+001 -3.959675626250315E+001 +-3.959677856807991E+001 -3.959680143816168E+001 -3.959682488712718E+001 -3.959684892956729E+001 +-3.959687358045201E+001 -3.959689885523004E+001 -3.959692476967803E+001 -3.959694964703533E+001 +-3.959697684508745E+001 -3.959700473148285E+001 -3.959703332357536E+001 -3.959706130022479E+001 +-3.959709132248835E+001 -3.959712210450277E+001 -3.959715366545179E+001 -3.959718602506627E+001 +-3.959721920363561E+001 -3.959725322174640E+001 -3.959728810073616E+001 -3.959732386241821E+001 +-3.959736052912092E+001 -3.959739812369802E+001 -3.959743666963212E+001 -3.959747619091922E+001 +-3.959751671224312E+001 -3.959755825884703E+001 -3.959760085672698E+001 -3.959764453234449E+001 +-3.959768931306181E+001 -3.959773522686079E+001 -3.959778230241007E+001 -3.959782809197516E+001 +-3.959787751601688E+001 -3.959792819061214E+001 -3.959797831202674E+001 -3.959803153579206E+001 +-3.959808610607536E+001 -3.959814205673877E+001 -3.959819942276579E+001 -3.959825824013600E+001 +-3.959831854558553E+001 -3.959838037659943E+001 -3.959844377170353E+001 -3.959850877077351E+001 +-3.959857541414056E+001 -3.959864374326736E+001 -3.959871380086004E+001 -3.959878563065821E+001 +-3.959885927754785E+001 -3.959893478716450E+001 -3.959901220673706E+001 -3.959909158449379E+001 +-3.959917296986502E+001 -3.959925641354704E+001 -3.959934196757856E+001 -3.959942968529555E+001 +-3.959951962136442E+001 -3.959961183181136E+001 -3.959970637415143E+001 -3.959980330736803E+001 +-3.959990269178395E+001 -3.960000458943888E+001 -3.960010906376169E+001 -3.960021617987327E+001 +-3.960032177447619E+001 -3.960043426779335E+001 -3.960054682068021E+001 -3.960066500283769E+001 +-3.960078617283736E+001 -3.960091040603426E+001 -3.960103777998404E+001 -3.960116837371622E+001 +-3.960130226827267E+001 -3.960143954748899E+001 -3.960158029639967E+001 -3.960172460295617E+001 +-3.960187255692673E+001 -3.960202425001235E+001 -3.960217977687456E+001 -3.960233923385778E+001 +-3.960250272014594E+001 -3.960267033772063E+001 -3.960284219049998E+001 -3.960301838570417E+001 +-3.960319903271947E+001 -3.960338424337389E+001 -3.960357413296531E+001 -3.960376881915365E+001 +-3.960396842292008E+001 -3.960417306819384E+001 -3.960438288197346E+001 -3.960459799453165E+001 +-3.960481853973278E+001 -3.960504465450713E+001 -3.960527647890746E+001 -3.960551415699551E+001 +-3.960575783565987E+001 -3.960600766615320E+001 -3.960626380373282E+001 -3.960652640650666E+001 +-3.960679563741736E+001 -3.960707166303802E+001 -3.960735465434943E+001 -3.960764478725350E+001 +-3.960794224096051E+001 -3.960824719981267E+001 -3.960855985230738E+001 -3.960888039140300E+001 +-3.960920901608949E+001 -3.960954592903887E+001 -3.960989133851782E+001 -3.961024545803881E+001 +-3.961060850604117E+001 -3.961098070732739E+001 -3.961136229162902E+001 -3.961175349450270E+001 +-3.961215455731018E+001 -3.961256572717987E+001 -3.961298725812046E+001 -3.961341940908272E+001 +-3.961385113269051E+001 -3.961429945781320E+001 -3.961476466031022E+001 -3.961524157870063E+001 +-3.961573050426911E+001 -3.961623173956241E+001 -3.961674559259257E+001 -3.961727237834213E+001 +-3.961781242133592E+001 -3.961836605106301E+001 -3.961893360900636E+001 -3.961951544408767E+001 +-3.962011191120283E+001 -3.962072337650537E+001 -3.962135021396065E+001 -3.962199280788710E+001 +-3.962265155098670E+001 -3.962332684672803E+001 -3.962401910839040E+001 -3.962472875705509E+001 +-3.962545622673819E+001 -3.962620196120464E+001 -3.962696641546403E+001 -3.962775005481082E+001 +-3.962855335624653E+001 -3.962937681062910E+001 -3.963022091545676E+001 -3.963108618400486E+001 +-3.963197314489632E+001 -3.963288233423840E+001 -3.963381430301356E+001 -3.963476961585763E+001 +-3.963574885210996E+001 -3.963675260455043E+001 -3.963778147779157E+001 -3.963883609429405E+001 +-3.963991708980490E+001 -3.964102511471709E+001 -3.964216083777580E+001 -3.964332494317706E+001 +-3.964451813116897E+001 -3.964574111566558E+001 -3.964699462966875E+001 -3.964827942659944E+001 +-3.964959627610289E+001 -3.965094596519575E+001 -3.965232929702616E+001 -3.965374709729971E+001 +-3.965520021295357E+001 -3.965668950747217E+001 -3.965821586612641E+001 -3.965978019465902E+001 +-3.966138342043062E+001 -3.966302649385507E+001 -3.966471038535632E+001 -3.966643608775642E+001 +-3.966820461817282E+001 -3.967001701891080E+001 -3.967187435440663E+001 -3.967377771278021E+001 +-3.967572821017840E+001 -3.967772698670711E+001 -3.967977520928349E+001 -3.968187407255830E+001 +-3.968402479531592E+001 -3.968622862692985E+001 -3.968848684422215E+001 -3.969080075207050E+001 +-3.969317168811222E+001 -3.969560101643839E+001 -3.969809013283709E+001 -3.970064046584488E+001 +-3.970325347490444E+001 -3.970593065129921E+001 -3.970867351798940E+001 -3.971148363535628E+001 +-3.971436259688690E+001 -3.971731202771502E+001 -3.972033359043128E+001 -3.972342898412528E+001 +-3.972659994610670E+001 -3.972984825047364E+001 -3.973317570677385E+001 -3.973658416300761E+001 +-3.974007550953901E+001 -3.974365167655071E+001 -3.974731463034571E+001 -3.975106638139673E+001 +-3.975490898213205E+001 -3.975884452604420E+001 -3.976287515117252E+001 -3.976700303664419E+001 +-3.977123040633841E+001 -3.977555953090206E+001 -3.977999272554747E+001 -3.978453235015787E+001 +-3.978918081022131E+001 -3.979394055963083E+001 -3.979881410065585E+001 -3.980380398150628E+001 +-3.980891279907638E+001 -3.981414320043779E+001 -3.981949788022260E+001 -3.982497958321085E+001 +-3.983059110611984E+001 -3.983633529525559E+001 -3.984221504646986E+001 -3.984823330790708E+001 +-3.985439307976844E+001 -3.986069741224780E+001 -3.986714940905466E+001 -3.987375222571273E+001 +-3.988050906805398E+001 -3.988742319644839E+001 -3.989449792250991E+001 -3.990173660753597E+001 +-3.990914266777280E+001 -3.991671957296776E+001 -3.992447084048937E+001 -3.993240004063362E+001 +-3.994051079586599E+001 -3.994880677534161E+001 -3.995729170107003E+001 -3.996596934425022E+001 +-3.997484352281001E+001 -3.998391810470068E+001 -3.999319700396335E+001 -4.000268417927282E+001 +-4.001238363466462E+001 -4.002229941785579E+001 -4.003243561752453E+001 -4.004279636378524E+001 +-4.005338582571950E+001 -4.006420820841491E+001 -4.007526775258853E+001 -4.008656873257435E+001 +-4.009811545434859E+001 -4.010991225140452E+001 -4.012196348320845E+001 -4.013427353249168E+001 +-4.014684680109113E+001 -4.015968771038958E+001 -4.017280069636121E+001 -4.018619020155356E+001 +-4.019986067752056E+001 -4.021381658169957E+001 -4.022806236655482E+001 -4.024260247832386E+001 +-4.025744135498729E+001 -4.027258342029845E+001 -4.028803307766791E+001 -4.030379470263949E+001 +-4.031987264126917E+001 -4.033627120446770E+001 -4.035299465862101E+001 -4.037004722113040E+001 +-4.038743305215781E+001 -4.040515625043559E+001 -4.042322084522425E+001 -4.044163078673675E+001 +-4.046038994077573E+001 -4.047950207780458E+001 -4.049897086704922E+001 -4.051879986679895E+001 +-4.053899251516101E+001 -4.055955212386759E+001 -4.058048186418223E+001 -4.060178475638114E+001 +-4.062346366315550E+001 -4.064552127967315E+001 -4.066796011952887E+001 -4.069078250402461E+001 +-4.071399055198499E+001 -4.073758616870347E+001 -4.076157103408228E+001 -4.078594658663473E+001 +-4.081071401578915E+001 -4.083587424746926E+001 -4.086142792880906E+001 -4.088737542223959E+001 +-4.091371678551491E+001 -4.094045175696474E+001 -4.096757974759171E+001 -4.099509982621129E+001 +-4.102301070524802E+001 -4.105131072504656E+001 -4.107999784004303E+001 -4.110906960641775E+001 +-4.113852316988388E+001 -4.116835525038687E+001 -4.119856212704838E+001 -4.122913962534739E+001 +-4.126008310281662E+001 -4.129138743910027E+001 -4.132304702158214E+001 -4.135505572989688E+001 +-4.138740692741445E+001 -4.142009344709812E+001 -4.145310758008198E+001 -4.148644106795610E+001 +-4.152008508728126E+001 -4.155403024093830E+001 -4.158826655276783E+001 -4.162278345547695E+001 +-4.165756978231397E+001 -4.169261376189576E+001 -4.172790301122655E+001 -4.176342452968175E+001 +-4.179916469568556E+001 -4.183510926462677E+001 -4.187124336365805E+001 -4.190755149117378E+001 +-4.194401751935484E+001 -4.198062469280887E+001 -4.201735563065912E+001 -4.205419233060698E+001 +-4.209111617592109E+001 -4.212810794112944E+001 -4.216514779731067E+001 -4.220221532371206E+001 +-4.223928951789279E+001 -4.227634880672285E+001 -4.231337106193568E+001 -4.235033361567424E+001 +-4.238721327475213E+001 -4.242398633869050E+001 -4.246062862193686E+001 -4.249711547483102E+001 +-4.253342180433381E+001 -4.256952209987960E+001 -4.260539046016859E+001 -4.264100061835472E+001 +-4.267632597178967E+001 -4.271133961131588E+001 -4.274601435359618E+001 -4.278032277487175E+001 +-4.281423724250126E+001 -4.284772995156664E+001 -4.288077296192242E+001 -4.291333823517571E+001 +-4.294539767292859E+001 -4.297692315614239E+001 -4.300788658632446E+001 -4.303825992551376E+001 +-4.306801523937721E+001 -4.309712473948586E+001 -4.312556082491562E+001 -4.315329612757731E+001 +-4.318030355517750E+001 -4.320655633619381E+001 -4.323202806416063E+001 -4.325669274043040E+001 +-4.328052482032509E+001 -4.330349925834413E+001 -4.332559155094251E+001 -4.334677778076352E+001 +-4.336703466143051E+001 -4.338633957940118E+001 -4.340467063703568E+001 -4.342200669662034E+001 +-4.343832742090601E+001 -4.345361331278325E+001 -4.346784575642702E+001 -4.348100705674133E+001 +-4.349308047724875E+001 -4.350405027717395E+001 -4.351390174774717E+001 -4.352262124726816E+001 +-4.353019623471035E+001 -4.353661530225310E+001 -4.354186820612621E+001 -4.354594589631882E+001 +-4.354884054514665E+001 -4.355054557350576E+001 -4.355105567568366E+001 -4.355036684343142E+001 +-4.354847638691513E+001 -4.354538295389044E+001 -4.354108654786082E+001 -4.353558854409998E+001 +-4.352889170317948E+001 -4.352100018156423E+001 -4.351191954147816E+001 -4.350165675795539E+001 +-4.349022022268107E+001 -4.347761974602678E+001 -4.346386655603686E+001 -4.344897329484915E+001 +-4.343295401254769E+001 -4.341582415797911E+001 -4.339760056595358E+001 -4.337830144219731E+001 +-4.335794634481226E+001 -4.333655616186607E+001 -4.331415308678017E+001 -4.329076058990246E+001 +-4.326640338607654E+001 -4.324110739928062E+001 -4.321489972368241E+001 -4.318780858134167E+001 +-4.315986327642790E+001 -4.313109414544411E+001 -4.310153250461207E+001 -4.307121059366671E+001 +-4.304016151628120E+001 -4.300841917769293E+001 -4.297601821893730E+001 -4.294299394848011E+001 +-4.290938227099564E+001 -4.287521961354832E+001 -4.284054284989391E+001 -4.280538922247148E+001 +-4.276979626250813E+001 -4.273380170905182E+001 -4.269744342678402E+001 -4.266075932266887E+001 +-4.262378726220760E+001 -4.258656498572839E+001 -4.254913002484299E+001 -4.251151961931686E+001 +-4.247377063487595E+001 -4.243591948232704E+001 -4.239800203835091E+001 -4.236005356821910E+001 +-4.232210865085646E+001 -4.228420110670304E+001 -4.224636392830116E+001 -4.220862921423593E+001 +-4.217102810678582E+001 -4.213359073321885E+001 -4.209634615111398E+001 -4.205932229788326E+001 +-4.202254594471989E+001 -4.198604265506128E+001 -4.194983674768567E+001 -4.191395126443923E+001 +-4.187840794271904E+001 -4.184322719278221E+001 -4.180842807964157E+001 -4.177402830971891E+001 +-4.174004422208472E+001 -4.170649078408281E+001 -4.167338159134914E+001 -4.164072887196771E+001 +-4.160854349461746E+001 -4.157683498049085E+001 -4.154561151871239E+001 -4.151487998508778E+001 +-4.148464596389050E+001 -4.145491377241514E+001 -4.142568648803468E+001 -4.139696597746462E+001 +-4.136875292797397E+001 -4.134104688023588E+001 -4.131384626254455E+001 -4.128714842611944E+001 +-4.126094968120724E+001 -4.123524533373017E+001 -4.121002972221524E+001 -4.118529625475959E+001 +-4.116103744579230E+001 -4.113724495240997E+001 -4.111390961008259E+001 -4.109102146753341E+001 +-4.106856982061737E+001 -4.104654324503528E+001 -4.102492962774496E+001 -4.100371619694189E+001 +-4.098288955049977E+001 -4.096243568278015E+001 -4.094234000973876E+001 -4.092258739227847E+001 +-4.090316215780146E+001 -4.088404811994393E+001 -4.086522859649053E+001 -4.084668642547640E+001 +-4.082840397951054E+001 -4.081036317835947E+001 -4.079254549984673E+001 -4.077493198914320E+001 +-4.075750326654364E+001 -4.074023953382294E+001 -4.072312057927762E+001 -4.070612578159226E+001 +-4.068923411266333E+001 -4.067242413952578E+001 -4.065567402555048E+001 -4.063896153107815E+001 +-4.062226401366831E+001 -4.060555842815108E+001 -4.058882132668231E+001 -4.057202885900578E+001 +-4.055515677312526E+001 -4.053818041660601E+001 -4.052107473872596E+001 -4.050381429369295E+001 +-4.048637324515210E+001 -4.046872537220580E+001 -4.045084407716515E+001 -4.043270239524563E+001 +-4.041427300641514E+001 -4.039552824959622E+001 -4.037644013940550E+001 -4.035698038560230E+001 +-4.033712041540193E+001 -4.031683139878376E+001 -4.029608427690121E+001 -4.027484979367080E+001 +-4.025309853058457E+001 -4.023080094475345E+001 -4.020792741014667E+001 -4.018444826194668E+001 +-4.016033384388997E+001 -4.013555455841021E+001 -4.011008091934276E+001 -4.008388360688748E+001 +-4.005693352446495E+001 -4.002920185703660E+001 -4.000066013038764E+001 -3.997128027081121E+001 +-3.994103466456078E+001 -3.990989621637193E+001 -3.987783840630577E+001 -3.984483534409548E+001 +-3.981086182013963E+001 -3.977589335224729E+001 -3.973990622719733E+001 -3.970287753617811E+001 +-3.966478520315997E+001 -3.962560800527201E+001 -3.958532558428436E+001 -3.954391844833957E+001 +-3.950136796317405E+001 -3.945765633214353E+001 -3.941276656447339E+001 -3.936668243129992E+001 +-3.931938840921839E+001 -3.927086961122075E+001 -3.922111170507708E+001 -3.917010081943430E+001 +-3.911782343807818E+001 -3.906426628300703E+001 -3.900941618720385E+001 -3.895325995813640E+001 +-3.889578423321370E+001 -3.883697532857892E+001 -3.877681908273917E+001 -3.871530069665008E+001 +-3.865240457189442E+001 -3.858811414863106E+001 -3.852241174494580E+001 -3.845527839913985E+001 +-3.838669371636971E+001 -3.831663572082950E+001 -3.824508071442265E+001 -3.817200314253141E+001 +-3.809737546713617E+001 -3.802116804710825E+001 -3.794334902496166E+001 -3.786388421884738E+001 +-3.778273701794684E+001 -3.769986827875206E+001 -3.761523621904136E+001 -3.752879630560395E+001 +-3.744050113100351E+001 -3.735030027385471E+001 -3.725814013633087E+001 -3.716396375186932E+001 +-3.706771055533252E+001 -3.696931610737339E+001 -3.686871176438089E+001 -3.676582428529409E+001 +-3.666057536693921E+001 -3.655288110036830E+001 -3.644265134218848E+001 -3.632978899726477E+001 +-3.621418921253964E+001 -3.609573848628547E+001 -3.597431370300207E+001 -3.584978111147404E+001 +-3.572199527224459E+001 -3.559079801080024E+001 -3.545601742378953E+001 -3.531746699710136E+001 +-3.517494490585584E+001 -3.502823357622079E+001 -3.487709959620228E+001 -3.472129406564835E+001 +-3.456055347302387E+001 -3.439460117666948E+001 -3.422314954999603E+001 -3.404590282285145E+001 +-3.386256061552667E+001 -3.367282211889420E+001 -3.347639082674549E+001 -3.327297967837047E+001 +-3.306231642557412E+001 -3.284414900390122E+001 -3.261825066777087E+001 -3.238442464744304E+001 +-3.214250810437295E+001 -3.189237520035545E+001 -3.163393915217515E+001 -3.136715321215296E+001 +-3.109201058918671E+001 -3.080854339700434E+001 -3.051682077906126E+001 -3.021694640683766E+001 +-2.990905557637376E+001 -2.959331213537850E+001 -2.926990546131848E+001 -2.893904768275773E+001 +-2.860097129647674E+001 -2.825592728675647E+001 -2.790418380569671E+001 -2.754602542884180E+001 +-2.718175296187562E+001 -2.681168374363328E+001 -2.643615236888547E+001 -2.605551174101892E+001 +-2.567013435888192E+001 -2.528041374229176E+001 -2.488676590544256E+001 -2.448963079518096E+001 +-2.408947362047910E+001 -2.368678600932860E+001 -2.328208693887347E+001 -2.287592339333025E+001 +-2.246887071177796E+001 -2.206153259407756E+001 -2.165454073798715E+001 -2.124855408404616E+001 +-2.084425764713963E+001 -2.044236091497493E+001 -2.004359579417128E+001 -1.964871408444628E+001 +-1.925848446062146E+001 -1.887368894100901E+001 -1.849511881933488E+001 -1.812357003581853E+001 +-1.775983796155302E+001 -1.740471156908653E+001 -1.705896696132256E+001 -1.672336023084910E+001 +-1.639861962292675E+001 -1.608543697810289E+001 -1.578445843537438E+001 -1.549627438472702E+001 +-1.522140866967019E+001 -1.496030705715428E+001 -1.471332501534683E+001 -1.448071487071766E+001 +-1.426261245655528E+001 -1.405902341752106E+001 -1.386980940147944E+001 -1.369467445324832E+001 +-1.353315202794706E+001 -1.338459316729963E+001 -1.324815653376933E+001 -1.312280117797825E+001 +-1.300728312774491E+001 -1.290015713544758E+001 -1.279978520739085E+001 -1.270435386757408E+001 +-1.261190248202305E+001 -1.252036539255855E+001 -1.242763108556672E+001 -1.233162215912159E+001 +-1.223040046110953E+001 -1.212230246700639E+001 -1.200611077036348E+001 -1.188126850144401E+001 +-1.174814460768029E+001 -1.160835944477409E+001 -1.146518402115629E+001 -1.132280407179867E+001 +-1.118218989168451E+001 -1.104331785872899E+001 -1.090616668641812E+001 -1.077071544792547E+001 +-1.063694343630547E+001 -1.050483016425221E+001 -1.037435536387954E+001 -1.024549898648309E+001 +-1.011824120225304E+001 -9.992562399913206E+000 -9.868443186270932E+000 -9.745864385665094E+000 +-9.624807039307031E+000 -9.505252404509125E+000 -9.387181953799780E+000 -9.270577373928035E+000 +-9.155420564758977E+000 -9.041693638065841E+000 -8.929378916223136E+000 -8.818458930806344E+000 +-8.708916421101794E+000 -8.600734333274142E+000 -8.493895816559178E+000 -8.388384222195361E+000 +-8.284183107116700E+000 -8.181276223554081E+000 -8.079647517800044E+000 -7.979281139011116E+000 +-7.880161428197857E+000 -7.782272914648133E+000 -7.685600318873758E+000 -7.590128548919757E+000 +-7.495842698362337E+000 -7.402728044281923E+000 -7.310770045201123E+000 -7.219954339049376E+000 +-7.130266741097813E+000 -7.041693241918789E+000 -6.954220005346530E+000 -6.867833366443412E+000 +-6.782519829475073E+000 -6.698266065896354E+000 -6.615058912350452E+000 -6.532885368681790E+000 +-6.451732595964483E+000 -6.371587914547370E+000 -6.292438802116163E+000 -6.214272891774091E+000 +-6.137077970141021E+000 -6.060841975472012E+000 -5.985552995795609E+000 -5.911199267071920E+000 +-5.837769171371101E+000 -5.765251235071945E+000 -5.693634127080952E+000 -5.622906657071764E+000 +-5.553057773744779E+000 -5.484076563107118E+000 -5.415952246772511E+000 -5.348674180281180E+000 +-5.282231851439473E+000 -5.216614878678951E+000 -5.151813009434896E+000 -5.087816118543952E+000 +-5.024614206660758E+000 -4.962197398693361E+000 -4.900555942257230E+000 -4.839680206147747E+000 +-4.779560678831080E+000 -4.720187966953350E+000 -4.661552793835557E+000 -4.603645998151747E+000 +-4.546458532352778E+000 -4.489981461093135E+000 -4.434205960236691E+000 -4.379123315283386E+000 +-4.324724919839739E+000 -4.271002274455124E+000 -4.217946985237782E+000 -4.165550762538802E+000 +-4.113805419653025E+000 -4.062702871536509E+000 -4.012235133540450E+000 -3.962394320161430E+000 +-3.913172643807676E+000 -3.864562413581273E+000 -3.816556034076072E+000 -3.769146004191123E+000 +-3.722324915959468E+000 -3.676085453391948E+000 -3.630420391335976E+000 -3.585322594349039E+000 +-3.540785015586642E+000 -3.496800695704459E+000 -3.453362761774627E+000 -3.410464426215798E+000 +-3.368098985736761E+000 -3.326259820293465E+000 -3.284940392059132E+000 -3.244134244407273E+000 +-3.203835000907359E+000 -3.164036364332936E+000 -3.124732115681998E+000 -3.085916113209257E+000 +-3.047582291470274E+000 -3.009724660377183E+000 -2.972337304265751E+000 -2.935414380973737E+000 +-2.898950120930256E+000 -2.862938826256054E+000 -2.827374869874560E+000 -2.792252694633524E+000 +-2.757566812437220E+000 -2.723311803388990E+000 -2.689482314944101E+000 -2.656073061072815E+000 +-2.623078821433511E+000 -2.590494440555879E+000 -2.558314827033982E+000 -2.526534952729197E+000 +-2.495149851982928E+000 -2.464154620838935E+000 -2.433544416275329E+000 -2.403314455446000E+000 +-2.373460014931491E+000 -2.343976429999216E+000 -2.314859093872842E+000 -2.286103457010875E+000 +-2.257705026394218E+000 -2.229659364822695E+000 -2.201962090220418E+000 -2.174608874949822E+000 +-2.147595445134400E+000 -2.120917579989881E+000 -2.094571111163854E+000 -2.068551922083709E+000 +-2.042855947312708E+000 -2.017479171914232E+000 -1.992417630823918E+000 -1.967667408229740E+000 +-1.943224636959844E+000 -1.919085497878015E+000 -1.895246219286778E+000 -1.871703076337889E+000 +-1.848452390450245E+000 -1.825490528735059E+000 -1.802813903428163E+000 -1.780418971329452E+000 +-1.758302233249252E+000 -1.736460233461611E+000 -1.714889559164406E+000 -1.693586839946112E+000 +-1.672548747259256E+000 -1.651771993900352E+000 -1.631253333496329E+000 -1.610989559997323E+000 +-1.590977507175718E+000 -1.571214048131446E+000 -1.551696094803352E+000 -1.532420597486635E+000 +-1.513384544356245E+000 -1.494584960996125E+000 -1.476018909934304E+000 -1.457683490183649E+000 +-1.439575836788294E+000 -1.421693120375618E+000 -1.404032546713658E+000 -1.386591356273957E+000 +-1.369366823799665E+000 -1.352356257878858E+000 -1.335557000523053E+000 -1.318966427020459E+000 +-1.302581944420165E+000 -1.286400992820359E+000 -1.270421043808944E+000 -1.254639600362399E+000 +-1.239054196452522E+000 -1.223662396657451E+000 -1.208461795776663E+000 -1.193450018449908E+000 +-1.178624719393483E+000 -1.163983580515975E+000 -1.149524314397601E+000 -1.135244661294176E+000 +-1.121142389443103E+000 -1.107215294698165E+000 -1.093461200163570E+000 -1.079877955891535E+000 +-1.066463437839677E+000 -1.053215552162067E+000 -1.040132217590330E+000 -1.027211850796977E+000 +-1.014451620253952E+000 -1.001849900379708E+000 -9.894047210561528E-001 -9.771141382321297E-001 +-9.649762314791170E-001 -9.529891042245537E-001 -9.411508834554730E-001 -9.294597195302924E-001 +-9.179137854626759E-001 -9.065112772914954E-001 -8.952504133516535E-001 -8.841294341102472E-001 +-8.731466018916424E-001 -8.623002006059632E-001 -8.515885354809387E-001 -8.410099327971033E-001 +-8.305627396262671E-001 -8.202453235732438E-001 -8.100560725207732E-001 -7.999933943774529E-001 +-7.900557168293979E-001 -7.802414870943259E-001 -7.705491716789135E-001 -7.609772561391901E-001 +-7.515242448438997E-001 -7.421886607408139E-001 -7.329690451259345E-001 -7.238639574155717E-001 +-7.148719749212562E-001 -7.059916926274302E-001 -6.972217229719252E-001 -6.885606956291402E-001 +-6.800072572959326E-001 -6.715600714801644E-001 -6.632178182914461E-001 -6.549791942366218E-001 +-6.468429120134611E-001 -6.388077003113125E-001 -6.308723036120029E-001 -6.230354819936503E-001 +-6.152960109369360E-001 -6.076526811337597E-001 -6.001042982982882E-001 -5.926496829803486E-001 +-5.852876703811285E-001 -5.780171101711836E-001 -5.708368663106879E-001 -5.637458168719287E-001 +-5.567428538640069E-001 -5.498268830597020E-001 -5.429968238245080E-001 -5.362516089477720E-001 +-5.295901844759453E-001 -5.230115095479038E-001 -5.165145562323030E-001 -5.100983093669719E-001 +-5.037617664002824E-001 -4.975039372345033E-001 -4.913238440710975E-001 -4.852205212579329E-001 +-4.791930151384047E-001 -4.732403839024175E-001 -4.673616974392293E-001 -4.615560371921216E-001 +-4.558224960148674E-001 -4.501601780299943E-001 -4.445681984887966E-001 -4.390456836330927E-001 +-4.335917705587028E-001 -4.282056070806111E-001 -4.228863515998176E-001 -4.176331729718307E-001 +-4.124452503768011E-001 -4.073217731912699E-001 -4.022619408615019E-001 -3.972649627784022E-001 +-3.923300581539789E-001 -3.874564558993426E-001 -3.826433945042280E-001 -3.778901219179976E-001 +-3.731958954321414E-001 -3.685599815642194E-001 -3.639816559432570E-001 -3.594602031965630E-001 +-3.549949168379451E-001 -3.505850991573267E-001 -3.462300611117225E-001 -3.419291222175767E-001 +-3.376816104444386E-001 -3.334868621099500E-001 -3.293442217761512E-001 -3.252530421470610E-001 +-3.212126839675380E-001 -3.172225159233980E-001 -3.132819145427642E-001 -3.093902640986557E-001 +-3.055469565127718E-001 -3.017513912604827E-001 -2.980029752769965E-001 -2.943011228646885E-001 +-2.906452556015889E-001 -2.870348022509996E-001 -2.834691986722382E-001 -2.799478877324925E-001 +-2.764703192197627E-001 -2.730359497568949E-001 -2.696442427166725E-001 -2.662946681379695E-001 +-2.629867026429443E-001 -2.597198293552571E-001 -2.564935378193113E-001 -2.533073239204900E-001 +-2.501606898063886E-001 -2.470531438090256E-001 -2.439842003680159E-001 -2.409533799547039E-001 +-2.379602089972332E-001 -2.350042198065516E-001 -2.320849505033352E-001 -2.292019449458151E-001 +-2.263547526585080E-001 -2.235429287618262E-001 -2.207660339025646E-001 -2.180236341852526E-001 +-2.153153011043542E-001 -2.126406114773162E-001 -2.099991473784422E-001 -2.073904960735922E-001 +-2.048142499556933E-001 -2.022700064810474E-001 -1.997573681064362E-001 -1.972759422270011E-001 +-1.948253411148996E-001 -1.924051818587228E-001 -1.900150863036626E-001 -1.876546809924264E-001 +-1.853235971068816E-001 -1.830214704104282E-001 -1.807479411910869E-001 -1.785026542052909E-001 +-1.762852586223813E-001 -1.740954079697865E-001 -1.719327600788865E-001 -1.697969770315491E-001 +-1.676877251073272E-001 -1.656046747313170E-001 -1.635475004226588E-001 -1.615158807436814E-001 +-1.595094982496771E-001 -1.575280394392986E-001 -1.555711947055760E-001 -1.536386582875383E-001 +-1.517301282224379E-001 -1.498453062985700E-001 -1.479838980086735E-001 -1.461456125039168E-001 +-1.443301625484495E-001 -1.425372644745219E-001 -1.407666381381631E-001 -1.390180068754051E-001 +-1.372910974590560E-001 -1.355856400560057E-001 -1.339013681850651E-001 -1.322380186753281E-001 +-1.305953316250492E-001 -1.289730503610352E-001 -1.273709213985379E-001 -1.257886944016469E-001 +-1.242261221441756E-001 -1.226829604710290E-001 -1.211589682600567E-001 +/ +&nonlocal + els_beta(1) = "2S" + lll(1) = 0 + kbeta(1) = 741 + rcut(1) = 1.050000000000000E+000 + rcutus(1) = 1.050000000000000E+000 + beta(1:1095,1) = +-2.028817480728866E-003 -2.054336863470290E-003 -2.080177240545214E-003 -2.106342649565853E-003 +-2.132837178931358E-003 -2.159664968466627E-003 -2.186830210069168E-003 -2.214337148364096E-003 +-2.242190081367352E-003 -2.270393361157302E-003 -2.298951394554734E-003 -2.327868643811450E-003 +-2.357149627307494E-003 -2.386798920257165E-003 -2.416821155423910E-003 -2.447221023844192E-003 +-2.478003275560480E-003 -2.509172720363463E-003 -2.540734228543574E-003 -2.572692731652009E-003 +-2.605053223271271E-003 -2.637820759795437E-003 -2.671000461220237E-003 -2.704597511943056E-003 +-2.738617161573027E-003 -2.773064725751271E-003 -2.807945586981496E-003 -2.843265195471019E-003 +-2.879029069982379E-003 -2.915242798695658E-003 -2.951912040081643E-003 -2.989042523785979E-003 +-3.026640051524441E-003 -3.064710497989467E-003 -3.103259811768096E-003 -3.142294016271445E-003 +-3.181819210675887E-003 -3.221841570876060E-003 -3.262367350449866E-003 -3.303402881635622E-003 +-3.344954576321466E-003 -3.387028927047250E-003 -3.429632508019012E-003 -3.472771976136204E-003 +-3.516454072031877E-003 -3.560685621125887E-003 -3.605473534691413E-003 -3.650824810934851E-003 +-3.696746536089304E-003 -3.743245885521842E-003 -3.790330124854640E-003 -3.838006611100282E-003 +-3.886282793811303E-003 -3.935166216244200E-003 -3.984664516538107E-003 -4.034785428908252E-003 +-4.085536784854457E-003 -4.136926514384850E-003 -4.188962647254929E-003 -4.241653314222257E-003 +-4.295006748316907E-003 -4.349031286127890E-003 -4.403735369105789E-003 -4.459127544881754E-003 +-4.515216468603103E-003 -4.572010904285704E-003 -4.629519726183393E-003 -4.687751920174596E-003 +-4.746716585166404E-003 -4.806422934516322E-003 -4.866880297471865E-003 -4.928098120628293E-003 +-4.990085969404679E-003 -5.052853529538525E-003 -5.116410608599224E-003 -5.180767137520485E-003 +-5.245933172152101E-003 -5.311918894831213E-003 -5.378734615973324E-003 -5.446390775683360E-003 +-5.514897945386957E-003 -5.584266829482282E-003 -5.654508267012662E-003 -5.725633233360193E-003 +-5.797652841960722E-003 -5.870578346040340E-003 -5.944421140373740E-003 -6.019192763064720E-003 +-6.094904897349035E-003 -6.171569373419976E-003 -6.249198170276866E-003 -6.327803417596834E-003 +-6.407397397630138E-003 -6.487992547119303E-003 -6.569601459242458E-003 -6.652236885581017E-003 +-6.735911738112220E-003 -6.820639091226660E-003 -6.906432183771239E-003 -6.993304421117789E-003 +-7.081269377257732E-003 -7.170340796923071E-003 -7.260532597734082E-003 -7.351858872374007E-003 +-7.444333890791133E-003 -7.537972102428498E-003 -7.632788138481732E-003 -7.728796814185240E-003 +-7.826013131127171E-003 -7.924452279593512E-003 -8.024129640941628E-003 -8.125060790003684E-003 +-8.227261497520351E-003 -8.330747732605013E-003 -8.435535665239108E-003 -8.541641668798708E-003 +-8.649082322613013E-003 -8.757874414554967E-003 -8.868034943664451E-003 -8.979581122804534E-003 +-9.092530381351044E-003 -9.206900367916066E-003 -9.322708953105644E-003 -9.439974232312180E-003 +-9.558714528542000E-003 -9.678948395278412E-003 -9.800694619380853E-003 -9.923972224020470E-003 +-1.004880047165263E-002 -1.017519886702686E-002 -1.030318716023456E-002 -1.043278534979518E-002 +-1.056401368578109E-002 -1.069689267298186E-002 -1.083144307410834E-002 -1.096768591303696E-002 +-1.110564247809488E-002 -1.124533432538658E-002 -1.138678328216209E-002 -1.153001145022779E-002 +-1.167504120939999E-002 -1.182189522100198E-002 -1.197059643140512E-002 -1.212116807561443E-002 +-1.227363368089934E-002 -1.242801707046997E-002 -1.258434236719989E-002 -1.274263399739552E-002 +-1.290291669461302E-002 -1.306521550352319E-002 -1.322955578382503E-002 -1.339596321420846E-002 +-1.356446379636692E-002 -1.373508385906052E-002 -1.390785006223020E-002 -1.408278940116368E-002 +-1.425992921071388E-002 -1.443929716957031E-002 -1.462092130458430E-002 -1.480482999514860E-002 +-1.499105197763198E-002 -1.517961634986983E-002 -1.537055257571107E-002 -1.556389048962235E-002 +-1.575966030135019E-002 -1.595789260064164E-002 -1.615861836202459E-002 -1.636186894964791E-002 +-1.656767612218274E-002 -1.677607203778534E-002 -1.698708925912228E-002 -1.720076075845912E-002 +-1.741711992281281E-002 -1.763620055916910E-002 -1.785803689976567E-002 -1.808266360744130E-002 +-1.831011578105306E-002 -1.854042896096092E-002 -1.877363913458184E-002 -1.900978274201363E-002 +-1.924889668172941E-002 -1.949101831634404E-002 -1.973618547845269E-002 -1.998443647654330E-002 +-2.023581010098313E-002 -2.049034563008071E-002 -2.074808283622420E-002 -2.100906199209678E-002 +-2.127332387697039E-002 -2.154090978307872E-002 -2.181186152207005E-002 -2.208622143154184E-002 +-2.236403238165701E-002 -2.264533778184383E-002 -2.293018158758002E-002 -2.321860830726198E-002 +-2.351066300916109E-002 -2.380639132846672E-002 -2.410583947441852E-002 -2.440905423752830E-002 +-2.471608299689240E-002 -2.502697372759687E-002 -2.534177500821505E-002 -2.566053602839993E-002 +-2.598330659657214E-002 -2.631013714770420E-002 -2.664107875120346E-002 -2.697618311889355E-002 +-2.731550261309678E-002 -2.765909025481810E-002 -2.800699973203179E-002 -2.835928540807314E-002 +-2.871600233013491E-002 -2.907720623787139E-002 -2.944295357211053E-002 -2.981330148367548E-002 +-3.018830784231779E-002 -3.056803124576228E-002 -3.095253102886646E-002 -3.134186727289492E-002 +-3.173610081491029E-002 -3.213529325728297E-002 -3.253950697731998E-002 -3.294880513701542E-002 +-3.336325169292365E-002 -3.378291140615639E-002 -3.420784985250638E-002 -3.463813343269777E-002 +-3.507382938276605E-002 -3.551500578456857E-002 -3.596173157642715E-002 -3.641407656390524E-002 +-3.687211143072010E-002 -3.733590774979292E-002 -3.780553799443805E-002 -3.828107554969256E-002 +-3.876259472378949E-002 -3.925017075977456E-002 -3.974387984726980E-002 -4.024379913438537E-002 +-4.075000673978076E-002 -4.126258176487892E-002 -4.178160430623323E-002 -4.230715546805098E-002 +-4.283931737487418E-002 -4.337817318442032E-002 -4.392380710058483E-002 -4.447630438660732E-002 +-4.503575137840374E-002 -4.560223549806652E-002 -4.617584526753473E-002 -4.675667032243670E-002 +-4.734480142610662E-002 -4.794033048377836E-002 -4.854335055695773E-002 -4.915395587797592E-002 +-4.977224186472661E-002 -5.039830513558845E-002 -5.103224352453597E-002 -5.167415609644078E-002 +-5.232414316256564E-002 -5.298230629625397E-002 -5.364874834881699E-002 -5.432357346562136E-002 +-5.500688710237957E-002 -5.569879604164559E-002 -5.639940840951892E-002 -5.710883369255874E-002 +-5.782718275491189E-002 -5.855456785565671E-002 -5.929110266636529E-002 -6.003690228888801E-002 +-6.079208327336158E-002 -6.155676363644488E-002 -6.233106287978473E-002 -6.311510200871438E-002 +-6.390900355118846E-002 -6.471289157695638E-002 -6.552689171697795E-002 -6.635113118308440E-002 +-6.718573878788668E-002 -6.803084496493624E-002 -6.888658178913928E-002 -6.975308299742940E-002 +-7.063048400970137E-002 -7.151892195000864E-002 -7.241853566802933E-002 -7.332946576080276E-002 +-7.425185459474096E-002 -7.518584632791817E-002 -7.613158693264184E-002 -7.708922421830922E-002 +-7.805890785455229E-002 -7.904078939467564E-002 -8.003502229939079E-002 -8.104176196084992E-002 +-8.206116572698419E-002 -8.309339292614952E-002 -8.413860489208405E-002 -8.519696498918163E-002 +-8.626863863808441E-002 -8.735379334160023E-002 -8.845259871094702E-002 -8.956522649232987E-002 +-9.069185059385480E-002 -9.183264711278250E-002 -9.298779436312811E-002 -9.415747290360968E-002 +-9.534186556595135E-002 -9.654115748354489E-002 -9.775553612047413E-002 -9.898519130090784E-002 +-1.002303152388646E-001 -1.014911025683556E-001 -1.027677503739090E-001 -1.040604582214825E-001 +-1.053694281897671E-001 -1.066948649018881E-001 -1.080369755575096E-001 -1.093959699653452E-001 +-1.107720605760821E-001 -1.121654625157232E-001 -1.135763936193535E-001 -1.150050744653339E-001 +-1.164517284099313E-001 -1.179165816223882E-001 -1.193998631204377E-001 -1.209018048062717E-001 +-1.224226415029651E-001 -1.239626109913644E-001 -1.255219540474463E-001 -1.271009144801509E-001 +-1.286997391696972E-001 -1.303186781063877E-001 -1.319579844299060E-001 -1.336179144691172E-001 +-1.352987277823739E-001 -1.370006871983380E-001 -1.387240588573228E-001 -1.404691122531626E-001 +-1.422361202756182E-001 -1.440253592533226E-001 -1.458371089972762E-001 -1.476716528448984E-001 +-1.495292777046427E-001 -1.514102741011814E-001 -1.533149362211706E-001 -1.552435619595989E-001 +-1.571964529667325E-001 -1.591739146956594E-001 -1.611762564504451E-001 -1.632037914349051E-001 +-1.652568368020032E-001 -1.673357137038848E-001 -1.694407473425517E-001 -1.715722670211899E-001 +-1.737306061961553E-001 -1.759161025296298E-001 -1.781290979429542E-001 -1.803699386706483E-001 +-1.826389753151274E-001 -1.849365629021230E-001 -1.872630609368197E-001 -1.896188334607157E-001 +-1.920042491092182E-001 -1.944196811699826E-001 -1.968655076420062E-001 -1.993421112954861E-001 +-2.018498797324523E-001 -2.043892054481860E-001 -2.069604858934348E-001 -2.095641235374329E-001 +-2.122005259317415E-001 -2.148701057749170E-001 -2.175732809780196E-001 -2.203104747309757E-001 +-2.230821155698013E-001 -2.258886374447028E-001 -2.287304797890656E-001 -2.316080875893416E-001 +-2.345219114558501E-001 -2.374724076945028E-001 -2.404600383794669E-001 -2.434852714267795E-001 +-2.465485806689262E-001 -2.496504459303952E-001 -2.527913531042270E-001 -2.559717942295632E-001 +-2.591922675702193E-001 -2.624532776942890E-001 -2.657553355547955E-001 -2.690989585714083E-001 +-2.724846707132337E-001 -2.759130025827015E-001 -2.793844915005585E-001 -2.828996815919863E-001 +-2.864591238738595E-001 -2.900633763431580E-001 -2.937130040665553E-001 -2.974085792711925E-001 +-3.011506814366616E-001 -3.049398973882104E-001 -3.087768213911884E-001 -3.126620552467531E-001 +-3.165962083888506E-001 -3.205798979824931E-001 -3.246137490233517E-001 -3.286983944386766E-001 +-3.328344751895747E-001 -3.370226403746558E-001 -3.412635473350703E-001 -3.455578617609591E-001 +-3.499062577993325E-001 -3.543094181634051E-001 -3.587680342434013E-001 -3.632828062188553E-001 +-3.678544431724310E-001 -3.724836632052744E-001 -3.771711935539311E-001 -3.819177707088450E-001 +-3.867241405344626E-001 -3.915910583909683E-001 -3.965192892576697E-001 -4.015096078580608E-001 +-4.065627987865872E-001 -4.116796566371330E-001 -4.168609861332624E-001 -4.221076022602311E-001 +-4.274203303988018E-001 -4.328000064608846E-001 -4.382474770270289E-001 -4.437635994857964E-001 +-4.493492421750331E-001 -4.550052845250802E-001 -4.607326172039389E-001 -4.665321422644219E-001 +-4.724047732933221E-001 -4.783514355626163E-001 -4.843730661827447E-001 -4.904706142579840E-001 +-4.966450410439469E-001 -5.028973201072384E-001 -5.092284374872905E-001 -5.156393918604119E-001 +-5.221311947060761E-001 -5.287048704754802E-001 -5.353614567623987E-001 -5.421020044763651E-001 +-5.489275780182090E-001 -5.558392554579733E-001 -5.628381287152459E-001 -5.699253037419316E-001 +-5.771019007074855E-001 -5.843690541866460E-001 -5.917279133496873E-001 -5.991796421552178E-001 +-6.067254195455539E-001 -6.143664396446890E-001 -6.221039119588860E-001 -6.299390615799171E-001 +-6.378731293909664E-001 -6.459073722752278E-001 -6.540430633272033E-001 -6.622814920667364E-001 +-6.706239646557830E-001 -6.790718041179455E-001 -6.876263505607771E-001 -6.962889614008683E-001 +-7.050610115917270E-001 -7.139438938544570E-001 -7.229390189112367E-001 -7.320478157216037E-001 +-7.412717317215328E-001 -7.506122330653134E-001 -7.600708048702065E-001 -7.696489514638691E-001 +-7.793481966345362E-001 -7.891700838839144E-001 -7.991161766827856E-001 -8.091880587292627E-001 +-8.193873342096691E-001 -8.297156280619929E-001 -8.401745862418466E-001 -8.507658759908927E-001 +-8.614911861076410E-001 -8.723522272205507E-001 -8.833507320633417E-001 -8.944884557524108E-001 +-9.057671760662455E-001 -9.171886937267100E-001 -9.287548326820588E-001 -9.404674403915364E-001 +-9.523283881113831E-001 -9.643395711820728E-001 -9.765029093165835E-001 -9.888203468894696E-001 +-1.001293853226508E+000 -1.013925422894649E+000 -1.026717075991993E+000 -1.039670858437484E+000 +-1.052788842259979E+000 -1.066073125886349E+000 -1.079525834428184E+000 -1.093149119966715E+000 +-1.106945161835474E+000 -1.120916166900193E+000 -1.135064369835422E+000 -1.149392033397267E+000 +-1.163901448691655E+000 -1.178594935437428E+000 -1.193474842223565E+000 -1.208543546759753E+000 +-1.223803456119464E+000 -1.239257006974664E+000 -1.254906665821174E+000 -1.270754929193668E+000 +-1.286804323869197E+000 -1.303057407058045E+000 -1.319516766580669E+000 -1.336185021029349E+000 +-1.353064819913086E+000 -1.370158843784216E+000 -1.387469804345035E+000 -1.405000444532687E+000 +-1.422753538580389E+000 -1.440731892052960E+000 -1.458938341854480E+000 -1.477375756205747E+000 +-1.496047034589050E+000 -1.514955107657624E+000 -1.534102937106927E+000 -1.553493515504754E+000 +-1.573129866076947E+000 -1.593015042445283E+000 -1.613152128313870E+000 -1.633544237100173E+000 +-1.654194511506503E+000 -1.675106123027535E+000 -1.696282271389190E+000 -1.717726183913813E+000 +-1.739441114806355E+000 -1.761430344355871E+000 -1.783697178046282E+000 -1.806244945570003E+000 +-1.829076999737613E+000 -1.852196715276283E+000 -1.875607487509307E+000 -1.899312730908489E+000 +-1.923315877510741E+000 -1.947620375189636E+000 -1.972229685772121E+000 -1.997147282989995E+000 +-2.022376650255116E+000 -2.047921278246644E+000 -2.073784662297916E+000 -2.099970299569804E+000 +-2.126481685996620E+000 -2.153322312989809E+000 -2.180495663883817E+000 -2.208005210107558E+000 +-2.235854407064004E+000 -2.264046689699338E+000 -2.292585467742087E+000 -2.321474120591525E+000 +-2.350715991833440E+000 -2.380314383360134E+000 -2.410272549070232E+000 -2.440593688122476E+000 +-2.471280937716347E+000 -2.502337365370739E+000 -2.533765960670462E+000 -2.565569626448665E+000 +-2.597751169371538E+000 -2.630313289889977E+000 -2.663258571520923E+000 -2.696589469419258E+000 +-2.730308298199076E+000 -2.764417218961069E+000 -2.798918225480672E+000 -2.833813129509299E+000 +-2.869103545138713E+000 -2.904790872176232E+000 -2.940876278475934E+000 -2.977360681168561E+000 +-3.014244726730218E+000 -3.051528769827246E+000 -3.089212850872030E+000 -3.127296672221627E+000 +-3.165779572948441E+000 -3.204660502109164E+000 -3.243937990435502E+000 -3.283610120367262E+000 +-3.323674494345509E+000 -3.364128201280778E+000 -3.404967781108426E+000 -3.446189187340603E+000 +-3.487787747521684E+000 -3.529758121491481E+000 -3.572094257358363E+000 -3.614789345082161E+000 +-3.657835767565024E+000 -3.701225049146692E+000 -3.744947801399513E+000 -3.788993666117757E+000 +-3.833351255395430E+000 -3.878008088686955E+000 -3.922950526746200E+000 -3.968163702340630E+000 +-4.013631447640185E+000 -4.059336218183590E+000 -4.105259013329529E+000 -4.151379293105737E+000 +-4.197674891376169E+000 -4.244121925255153E+000 -4.290694700707675E+000 -4.337365614287368E+000 +-4.384105050978182E+000 -4.430881278122568E+000 -4.477660335438553E+000 -4.524405921150438E+000 +-4.571079274283605E+000 -4.617639053203084E+000 -4.664041210508705E+000 -4.710238864437144E+000 +-4.756182166963260E+000 -4.801818168840506E+000 -4.847090681872980E+000 -4.891940138770752E+000 +-4.936303451005698E+000 -4.980113865157736E+000 -5.023300818321835E+000 -5.065789793234936E+000 +-5.107502173879481E+000 -5.148355102427454E+000 -5.188261338506033E+000 -5.227129121894043E+000 +-5.264862039897698E+000 -5.301358900805475E+000 -5.336513614985766E+000 -5.370215085367773E+000 +-5.402347109236228E+000 -5.432788293474650E+000 -5.461411985609499E+000 -5.488086223239763E+000 +-5.512673704681952E+000 -5.535031783919887E+000 -5.555012493220594E+000 -5.572462597061281E+000 +-5.587223681306849E+000 -5.599132281879747E+000 -5.608020057473048E+000 -5.613714011169411E+000 +-5.616036766139668E+000 -5.614806900900751E+000 -5.609839349907543E+000 -5.600945875530880E+000 +-5.587935617726307E+000 -5.570615727916385E+000 -5.548792093782930E+000 -5.522270161782376E+000 +-5.490855864244049E+000 -5.454356657871933E+000 -5.412582680328250E+000 -5.365348031312682E+000 +-5.312472184143146E+000 -5.253781533269546E+000 -5.189111082385808E+000 -5.118306276821486E+000 +-5.041224982662988E+000 -4.957739613548365E+000 -4.867739404266456E+000 -4.771132828142540E+000 +-4.667850152678289E+000 -4.557846125005155E+000 -4.441102775384212E+000 -4.317632323218912E+000 +-4.187480165826401E+000 -4.050727925531830E+000 -3.907496525508104E+000 -3.757949259200408E+000 +-3.602294812176500E+000 -3.440790188880791E+000 -3.273743490111749E+000 -3.101516480177266E+000 +-2.924526875736115E+000 -2.743250281448280E+000 -2.558221690917394E+000 -2.370036465227355E+000 +-2.179350695899008E+000 -1.986880854608056E+000 -1.793402628823925E+000 -1.599748840998966E+000 +-1.406806349429889E+000 -1.215511831814062E+000 -1.026846358235834E+000 -8.418286692340908E-001 +-6.615070871057700E-001 -4.869500050415136E-001 -3.192349193700731E-001 -1.594359953524181E-001 +-8.610186768778678E-003 1.322180359484435E-001 2.620732551059956E-001 3.800468350433308E-001 + 4.853156257506865E-001 5.771614033658083E-001 6.549907547354812E-001 7.183550547961625E-001 + 7.669701244374719E-001 8.007350930489672E-001 8.197499241998965E-001 8.243309946289926E-001 + 8.150240452511116E-001 7.926137469786079E-001 7.581290418714822E-001 7.128433287356473E-001 + 6.582684581731046E-001 5.961413807492246E-001 5.284021480532008E-001 4.571617939999210E-001 + 3.846584164504213E-001 3.131995309440306E-001 2.450884737487775E-001 1.825322869711200E-001 + 1.275281233536325E-001 8.172476574990027E-002 4.625537401331255E-002 2.153706317589453E-002 + 7.032398260282550E-003 9.673799199547972E-004 4.204707118187760E-016 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + + dion(1:1) = + 1.950924612895554E+000 +/ + +&pswfc + els(1) = "2S" + lchi(1) = 0 + oc(1) = 2.000000000000000E+000 + nchi(1) = 1 + epseu(1) = -1.761170243983008E+000 + rcut_chi(1) = 1.050000000000000E+000 + rcutus_chi(1) = 1.050000000000000E+000 + chi(1:1095,1) = +-1.343341767730406E-004 -1.360238927306804E-004 -1.377348626995604E-004 -1.394673540222670E-004 +-1.412216374041445E-004 -1.429979869555922E-004 -1.447966802348953E-004 -1.466179982915941E-004 +-1.484622257103983E-004 -1.503296506556544E-004 -1.522205649163720E-004 -1.541352639518165E-004 +-1.560740469376748E-004 -1.580372168128028E-004 -1.600250803265604E-004 -1.620379480867414E-004 +-1.640761346081067E-004 -1.661399583615282E-004 -1.682297418237505E-004 -1.703458115277794E-004 +-1.724884981139020E-004 -1.746581363813510E-004 -1.768550653406180E-004 -1.790796282664244E-004 +-1.813321727513591E-004 -1.836130507601902E-004 -1.859226186848610E-004 -1.882612374001767E-004 +-1.906292723201926E-004 -1.930270934553101E-004 -1.954550754700921E-004 -1.979135977418060E-004 +-2.004030444197011E-004 -2.029238044850334E-004 -2.054762718118457E-004 -2.080608452285103E-004 +-2.106779285800479E-004 -2.133279307912287E-004 -2.160112659304679E-004 -2.187283532745262E-004 +-2.214796173740216E-004 -2.242654881197669E-004 -2.270864008099415E-004 -2.299427962181081E-004 +-2.328351206620845E-004 -2.357638260736817E-004 -2.387293700693197E-004 -2.417322160215316E-004 +-2.447728331313668E-004 -2.478516965017048E-004 -2.509692872114915E-004 -2.541260923909085E-004 +-2.573226052974898E-004 -2.605593253931940E-004 -2.638367584224469E-004 -2.671554164911648E-004 +-2.705158181467736E-004 -2.739184884592330E-004 -2.773639591030801E-004 -2.808527684405059E-004 +-2.843854616054749E-004 -2.879625905889052E-004 -2.915847143249170E-004 -2.952523987781696E-004 +-2.989662170322948E-004 -3.027267493794418E-004 -3.065345834109507E-004 -3.103903141091666E-004 +-3.142945439404053E-004 -3.182478829490929E-004 -3.222509488530862E-004 -3.263043671401920E-004 +-3.304087711659042E-004 -3.345648022523659E-004 -3.387731097885795E-004 -3.430343513318740E-004 +-3.473491927106527E-004 -3.517183081284310E-004 -3.561423802691822E-004 -3.606221004040108E-004 +-3.651581684991650E-004 -3.697512933254091E-004 -3.744021925687718E-004 -3.791115929426877E-004 +-3.838802303015495E-004 -3.887088497556878E-004 -3.935982057877966E-004 -3.985490623708253E-004 +-4.035621930873524E-004 -4.086383812504613E-004 -4.137784200261359E-004 -4.189831125571954E-004 +-4.242532720887905E-004 -4.295897220954751E-004 -4.349932964098789E-004 -4.404648393529963E-004 +-4.460052058661168E-004 -4.516152616444117E-004 -4.572958832722055E-004 -4.630479583599446E-004 +-4.688723856828906E-004 -4.747700753215599E-004 -4.807419488039268E-004 -4.867889392494163E-004 +-4.929119915147121E-004 -4.991120623413904E-004 -5.053901205054202E-004 -5.117471469685375E-004 +-5.181841350315272E-004 -5.247020904894296E-004 -5.313020317887044E-004 -5.379849901863664E-004 +-5.447520099111274E-004 -5.516041483265604E-004 -5.585424760963227E-004 -5.655680773514508E-004 +-5.726820498597631E-004 -5.798855051973932E-004 -5.871795689224807E-004 -5.945653807510482E-004 +-6.020440947350877E-004 -6.096168794428906E-004 -6.172849181416424E-004 -6.250494089823190E-004 +-6.329115651869045E-004 -6.408726152379667E-004 -6.489338030706159E-004 -6.570963882668802E-004 +-6.653616462525227E-004 -6.737308684963407E-004 -6.822053627119629E-004 -6.907864530621949E-004 +-6.994754803659280E-004 -7.082738023076526E-004 -7.171827936496104E-004 -7.262038464466119E-004 +-7.353383702635575E-004 -7.445877923956939E-004 -7.539535580916425E-004 -7.634371307792349E-004 +-7.730399922941846E-004 -7.827636431116409E-004 -7.926096025806524E-004 -8.025794091615805E-004 +-8.126746206664987E-004 -8.228968145026194E-004 -8.332475879187805E-004 -8.437285582550326E-004 +-8.543413631953652E-004 -8.650876610236155E-004 -8.759691308825965E-004 -8.869874730364788E-004 +-8.981444091364812E-004 -9.094416824898990E-004 -9.208810583325206E-004 -9.324643241044626E-004 +-9.441932897294870E-004 -9.560697878978243E-004 -9.680956743525547E-004 -9.802728281795997E-004 +-9.926031521013518E-004 -1.005088572774004E-003 -1.017731041088620E-003 -1.030532532475993E-003 +-1.043495047215334E-003 -1.056620610746852E-003 -1.069911273988257E-003 -1.083369113655256E-003 +-1.096996232586075E-003 -1.110794760070063E-003 -1.124766852180429E-003 -1.138914692111177E-003 +-1.153240490518262E-003 -1.167746485865051E-003 -1.182434944772134E-003 -1.197308162371514E-003 +-1.212368462665285E-003 -1.227618198888798E-003 -1.243059753878403E-003 -1.258695540443829E-003 +-1.274528001745228E-003 -1.290559611674986E-003 -1.306792875244323E-003 -1.323230328974759E-003 +-1.339874541294514E-003 -1.356728112939885E-003 -1.373793677361685E-003 -1.391073901136781E-003 +-1.408571484384823E-003 -1.426289161190218E-003 -1.444229700029399E-003 -1.462395904203493E-003 +-1.480790612276406E-003 -1.499416698518442E-003 -1.518277073355504E-003 -1.537374683823924E-003 +-1.556712514031054E-003 -1.576293585621622E-003 -1.596120958249969E-003 -1.616197730058228E-003 +-1.636527038160515E-003 -1.657112059133234E-003 -1.677956009511522E-003 -1.699062146291962E-003 +-1.720433767441618E-003 -1.742074212413470E-003 -1.763986862668355E-003 -1.786175142203455E-003 +-1.808642518087442E-003 -1.831392501002374E-003 -1.854428645792386E-003 -1.877754552019314E-003 +-1.901373864525288E-003 -1.925290274002420E-003 -1.949507517569666E-003 -1.974029379356932E-003 +-1.998859691096556E-003 -2.024002332722214E-003 -2.049461232975374E-003 -2.075240370019397E-003 +-2.101343772061337E-003 -2.127775517981606E-003 -2.154539737971532E-003 -2.181640614178973E-003 +-2.209082381362031E-003 -2.236869327551022E-003 -2.265005794718760E-003 -2.293496179459297E-003 +-2.322344933675189E-003 -2.351556565273446E-003 -2.381135638870200E-003 -2.411086776504296E-003 +-2.441414658359830E-003 -2.472124023497803E-003 -2.503219670596995E-003 -2.534706458704136E-003 +-2.566589307993574E-003 -2.598873200536467E-003 -2.631563181079685E-003 -2.664664357834527E-003 +-2.698181903275332E-003 -2.732121054948208E-003 -2.766487116289909E-003 -2.801285457457023E-003 +-2.836521516165635E-003 -2.872200798541536E-003 -2.908328879981168E-003 -2.944911406023396E-003 +-2.981954093232276E-003 -3.019462730090940E-003 -3.057443177906737E-003 -3.095901371727809E-003 +-3.134843321271165E-003 -3.174275111862500E-003 -3.214202905387825E-003 -3.254632941257112E-003 +-3.295571537380069E-003 -3.337025091154213E-003 -3.379000080465413E-003 -3.421503064701029E-003 +-3.464540685775821E-003 -3.508119669170813E-003 -3.552246824985231E-003 -3.596929049001704E-003 +-3.642173323764926E-003 -3.687986719673875E-003 -3.734376396087840E-003 -3.781349602446374E-003 +-3.828913679403396E-003 -3.877076059975570E-003 -3.925844270705183E-003 -3.975225932837700E-003 +-4.025228763514156E-003 -4.075860576978589E-003 -4.127129285800751E-003 -4.179042902114188E-003 +-4.231609538869981E-003 -4.284837411106308E-003 -4.338734837234003E-003 -4.393310240338375E-003 +-4.448572149497441E-003 -4.504529201116807E-003 -4.561190140281396E-003 -4.618563822124258E-003 +-4.676659213212666E-003 -4.735485392951686E-003 -4.795051555005526E-003 -4.855367008736793E-003 +-4.916441180663959E-003 -4.978283615937253E-003 -5.040903979833147E-003 -5.104312059267808E-003 +-5.168517764329612E-003 -5.233531129831068E-003 -5.299362316880353E-003 -5.366021614472704E-003 +-5.433519441101973E-003 -5.501866346392495E-003 -5.571073012751663E-003 -5.641150257043403E-003 +-5.712109032282768E-003 -5.783960429352039E-003 -5.856715678738515E-003 -5.930386152294316E-003 +-6.004983365018441E-003 -6.080518976861412E-003 -6.157004794552775E-003 -6.234452773451745E-003 +-6.312875019421284E-003 -6.392283790725939E-003 -6.472691499953744E-003 -6.554110715962464E-003 +-6.636554165850525E-003 -6.720034736952927E-003 -6.804565478862497E-003 -6.890159605476737E-003 +-6.976830497070714E-003 -7.064591702396193E-003 -7.153456940807449E-003 -7.243440104414092E-003 +-7.334555260261187E-003 -7.426816652537094E-003 -7.520238704809360E-003 -7.614836022289048E-003 +-7.710623394123832E-003 -7.807615795720261E-003 -7.905828391095542E-003 -8.005276535259280E-003 +-8.105975776625526E-003 -8.207941859455498E-003 -8.311190726331462E-003 -8.415738520662098E-003 +-8.521601589219789E-003 -8.628796484710264E-003 -8.737339968375028E-003 -8.847249012626927E-003 +-8.958540803719413E-003 -9.071232744449856E-003 -9.185342456897359E-003 -9.300887785195553E-003 +-9.417886798340856E-003 -9.536357793036595E-003 -9.656319296573542E-003 -9.777790069747268E-003 +-9.900789109812848E-003 -1.002533565347744E-002 -1.015144917993115E-002 -1.027914941391679E-002 +-1.040845632883900E-002 -1.053939014991316E-002 -1.067197135735493E-002 -1.080622068961051E-002 +-1.094215914662857E-002 -1.107980799317419E-002 -1.121918876218542E-002 -1.136032325817307E-002 +-1.150323356066418E-002 -1.164794202769003E-002 -1.179447129931897E-002 -1.194284430123489E-002 +-1.209308424836185E-002 -1.224521464853557E-002 -1.239925930622233E-002 -1.255524232628598E-002 +-1.271318811780371E-002 -1.287312139793126E-002 -1.303506719581814E-002 -1.319905085657380E-002 +-1.336509804528508E-002 -1.353323475108599E-002 -1.370348729128034E-002 -1.387588231551800E-002 +-1.405044681002559E-002 -1.422720810189228E-002 -1.440619386341146E-002 -1.458743211647914E-002 +-1.477095123704982E-002 -1.495677995965057E-002 -1.514494738195434E-002 -1.533548296941305E-002 +-1.552841655995161E-002 -1.572377836872344E-002 -1.592159899292858E-002 -1.612190941669514E-002 +-1.632474101602514E-002 -1.653012556380550E-002 -1.673809523488526E-002 -1.694868261121976E-002 +-1.716192068708311E-002 -1.737784287434954E-002 -1.759648300784496E-002 -1.781787535076952E-002 +-1.804205460019229E-002 -1.826905589261918E-002 -1.849891480963509E-002 -1.873166738362137E-002 +-1.896735010354992E-002 -1.920599992085465E-002 -1.944765425538185E-002 -1.969235100142053E-002 +-1.994012853381383E-002 -2.019102571415276E-002 -2.044508189705365E-002 -2.070233693652043E-002 +-2.096283119239310E-002 -2.122660553688366E-002 -2.149370136120097E-002 -2.176416058226563E-002 +-2.203802564951668E-002 -2.231533955181119E-002 -2.259614582441841E-002 -2.288048855610988E-002 +-2.316841239634700E-002 -2.345996256256758E-002 -2.375518484757309E-002 -2.405412562701807E-002 +-2.435683186700338E-002 -2.466335113177499E-002 -2.497373159152998E-002 -2.528802203033156E-002 +-2.560627185413480E-002 -2.592853109892501E-002 -2.625485043897054E-002 -2.658528119519186E-002 +-2.691987534364911E-002 -2.725868552414967E-002 -2.760176504897838E-002 -2.794916791175176E-002 +-2.830094879639898E-002 -2.865716308627151E-002 -2.901786687338350E-002 -2.938311696778557E-002 +-2.975297090707382E-002 -3.012748696603689E-002 -3.050672416644325E-002 -3.089074228697126E-002 +-3.127960187328468E-002 -3.167336424825604E-002 -3.207209152234049E-002 -3.247584660410328E-002 +-3.288469321090326E-002 -3.329869587973543E-002 -3.371791997823541E-002 -3.414243171584895E-002 +-3.457229815516954E-002 -3.500758722344730E-002 -3.544836772427231E-002 -3.589470934943583E-002 +-3.634668269097267E-002 -3.680435925338850E-002 -3.726781146607547E-002 -3.773711269591973E-002 +-3.821233726010490E-002 -3.869356043911537E-002 -3.918085848994318E-002 -3.967430865950272E-002 +-4.017398919825761E-002 -4.067997937406376E-002 -4.119235948623329E-002 -4.171121087982390E-002 +-4.223661596015815E-002 -4.276865820757778E-002 -4.330742219243747E-002 -4.385299359034405E-002 +-4.440545919764555E-002 -4.496490694717564E-002 -4.553142592425941E-002 -4.610510638298582E-002 +-4.668603976275272E-002 -4.727431870509049E-002 -4.787003707077069E-002 -4.847328995720573E-002 +-4.908417371614644E-002 -4.970278597168408E-002 -5.032922563856437E-002 -5.096359294081933E-002 +-5.160598943072616E-002 -5.225651800809897E-002 -5.291528293992279E-002 -5.358238988033640E-002 +-5.425794589097373E-002 -5.494205946167159E-002 -5.563484053155247E-002 -5.633640051049189E-002 +-5.704685230097965E-002 -5.776631032038453E-002 -5.849489052363259E-002 -5.923271042630884E-002 +-5.997988912819360E-002 -6.073654733724437E-002 -6.150280739403369E-002 -6.227879329665596E-002 +-6.306463072611396E-002 -6.386044707219839E-002 -6.466637145987264E-002 -6.548253477617653E-002 +-6.630906969766226E-002 -6.714611071837623E-002 -6.799379417840262E-002 -6.885225829298224E-002 +-6.972164318222282E-002 -7.060209090141677E-002 -7.149374547198259E-002 -7.239675291304726E-002 +-7.331126127368713E-002 -7.423742066584500E-002 -7.517538329794322E-002 -7.612530350921083E-002 +-7.708733780474604E-002 -7.806164489133356E-002 -7.904838571403887E-002 -8.004772349360183E-002 +-8.105982376465068E-002 -8.208485441476203E-002 -8.312298572438974E-002 -8.417439040768850E-002 +-8.523924365425763E-002 -8.631772317183181E-002 -8.741000922994682E-002 -8.851628470460833E-002 +-8.963673512399388E-002 -9.077154871521746E-002 -9.192091645218914E-002 -9.308503210460163E-002 +-9.426409228807775E-002 -9.545829651551274E-002 -9.666784724964805E-002 -9.789294995691214E-002 +-9.913381316256800E-002 -1.003906485072054E-001 -1.016636708046188E-001 -1.029530981011128E-001 +-1.042591517362778E-001 -1.055820564052813E-001 -1.069220402227198E-001 -1.082793347880785E-001 +-1.096541752528483E-001 -1.110468003893493E-001 -1.124574526613131E-001 -1.138863782962769E-001 +-1.153338273598445E-001 -1.168000538318700E-001 -1.182853156846220E-001 -1.197898749629893E-001 +-1.213139978667872E-001 -1.228579548352295E-001 -1.244220206336290E-001 -1.260064744423935E-001 +-1.276115999483860E-001 -1.292376854387174E-001 -1.308850238970439E-001 -1.325539131024416E-001 +-1.342446557309335E-001 -1.359575594597437E-001 -1.376929370743595E-001 -1.394511065784771E-001 +-1.412323913069146E-001 -1.430371200415725E-001 -1.448656271305261E-001 -1.467182526103343E-001 +-1.485953423316499E-001 -1.504972480882186E-001 -1.524243277493532E-001 -1.543769453959716E-001 +-1.563554714602859E-001 -1.583602828692315E-001 -1.603917631917235E-001 -1.624503027898280E-001 +-1.645362989739358E-001 -1.666501561620226E-001 -1.687922860430782E-001 -1.709631077447902E-001 +-1.731630480055541E-001 -1.753925413508926E-001 -1.776520302743476E-001 -1.799419654229164E-001 +-1.822628057870914E-001 -1.846150188955544E-001 -1.869990810145756E-001 -1.894154773521514E-001 +-1.918647022669111E-001 -1.943472594818079E-001 -1.968636623025951E-001 -1.994144338410785E-001 +-2.020001072431170E-001 -2.046212259213242E-001 -2.072783437924062E-001 -2.099720255190439E-001 +-2.127028467562058E-001 -2.154713944017491E-001 -2.182782668511313E-001 -2.211240742560274E-001 +-2.240094387865988E-001 -2.269349948971280E-001 -2.299013895946779E-001 -2.329092827103884E-001 +-2.359593471729623E-001 -2.390522692838330E-001 -2.421887489934342E-001 -2.453695001779210E-001 +-2.485952509156050E-001 -2.518667437622771E-001 -2.551847360244934E-001 -2.585500000297910E-001 +-2.619633233926832E-001 -2.654255092751541E-001 -2.689373766402322E-001 -2.724997604970685E-001 +-2.761135121357864E-001 -2.797794993501758E-001 -2.834986066461208E-001 -2.872717354334319E-001 +-2.910998041985192E-001 -2.949837486551022E-001 -2.989245218698726E-001 -3.029230943597349E-001 +-3.069804541569373E-001 -3.110976068380590E-001 -3.152755755124536E-001 -3.195154007653510E-001 +-3.238181405503909E-001 -3.281848700259100E-001 -3.326166813287906E-001 -3.371146832791777E-001 +-3.416800010087784E-001 -3.463137755048688E-001 -3.510171630614762E-001 -3.557913346285091E-001 +-3.606374750488890E-001 -3.655567821729291E-001 -3.705504658383966E-001 -3.756197467037999E-001 +-3.807658549215216E-001 -3.859900286364248E-001 -3.912935122945462E-001 -3.966775547453858E-001 +-4.021434071201876E-001 -4.076923204674194E-001 -4.133255431254338E-001 -4.190443178110296E-001 +-4.248498784013307E-001 -4.307434463850680E-001 -4.367262269579837E-001 -4.427994047357393E-001 +-4.489641390563032E-001 -4.552215588424716E-001 -4.615727569938498E-001 -4.680187842763319E-001 +-4.745606426759467E-001 -4.811992781828329E-001 -4.879355729701533E-001 -4.947703369319728E-001 +-5.017042985435504E-001 -5.087380950072008E-001 -5.158722616468592E-001 -5.231072205148974E-001 +-5.304432681755521E-001 -5.378805626306629E-001 -5.454191093553998E-001 -5.530587464142778E-001 +-5.607991286312247E-001 -5.686397107918219E-001 -5.765797298611999E-001 -5.846181862076426E-001 +-5.927538238297301E-001 -6.009851095941415E-001 -6.093102115020456E-001 -6.177269760145572E-001 +-6.262329044821788E-001 -6.348251287395797E-001 -6.435003859457005E-001 -6.522549927700850E-001 +-6.610848190496581E-001 -6.699852610660313E-001 -6.789512146217691E-001 -6.879770481250581E-001 +-6.970565759257246E-001 -7.061830321814734E-001 -7.153490455714928E-001 -7.245466152147064E-001 +-7.337670881918321E-001 -7.430011391133066E-001 -7.522387522184913E-001 -7.614692065346628E-001 +-7.706810646659225E-001 -7.798621658213950E-001 -7.889996237273751E-001 -7.980798300978947E-001 +-8.070884643607642E-001 -8.160105103493632E-001 -8.248302806722073E-001 -8.335314494601376E-001 +-8.420970941622983E-001 -8.505097470143839E-001 -8.587514567329982E-001 -8.668038608960573E-001 +-8.746482693482243E-001 -8.822657588202533E-001 -8.896372787700573E-001 -8.967437682397958E-001 +-9.035662832769381E-001 -9.100861341881950E-001 -9.162850315848636E-001 -9.221452398391382E-001 +-9.276497362072043E-001 -9.327823734922971E-001 -9.375280437265628E-001 -9.418728399538999E-001 +-9.458042128082130E-001 -9.493111182159253E-001 -9.523841522236746E-001 -9.550156686795271E-001 +-9.571998752985827E-001 -9.589329035441962E-001 -9.602128477790933E-001 -9.610397693151301E-001 +-9.614156613486091E-001 -9.613443713473649E-001 -9.608314783005553E-001 -9.598841234046865E-001 +-9.585107943040048E-001 -9.567210650083779E-001 -9.545252961738170E-001 -9.519343036693255E-001 +-9.489590074148099E-001 -9.456100775360472E-001 -9.418976011563676E-001 -9.378308008798133E-001 +-9.334178455035781E-001 -9.286658050494701E-001 -9.235808161782386E-001 -9.181685240272081E-001 +-9.124346672815121E-001 -9.063852569373805E-001 -9.000265812905375E-001 -8.933651972288702E-001 +-8.864079211543512E-001 -8.791618195540069E-001 -8.716341992401537E-001 -8.638325972804719E-001 +-8.557647706387311E-001 -8.474386855471916E-001 -8.388625066317926E-001 -8.300445858112979E-001 +-8.209934509915079E-001 -8.117177945755601E-001 -8.022264618111686E-001 -7.925284389953879E-001 +-7.826328415572246E-001 -7.725489020380335E-001 -7.622859579892582E-001 -7.518534398066152E-001 +-7.412608585193257E-001 -7.305177935523908E-001 -7.196338804795396E-001 -7.086187987839754E-001 +-6.974822596432481E-001 -6.862339937531152E-001 -6.748837392071335E-001 -6.634412294464763E-001 +-6.519161812921658E-001 -6.403182830748725E-001 -6.286571828758163E-001 -6.169424768906004E-001 +-6.051836979285409E-001 -5.933903040596173E-001 -5.815716674209338E-001 -5.697370631944647E-001 +-5.578956587678775E-001 -5.460565030902808E-001 -5.342285162349870E-001 -5.224204791816369E-001 +-5.106410238304739E-001 -4.988986232620392E-001 -4.872015822561386E-001 -4.755580280846278E-001 +-4.639759015932273E-001 -4.524629485883729E-001 -4.410267115458403E-001 -4.296745216586190E-001 +-4.184134912422039E-001 -4.072505065160498E-001 -3.961922207804165E-001 -3.852450480081402E-001 +-3.744151568709697E-001 -3.637084652200142E-001 -3.531306350394680E-001 -3.426870678921376E-001 +-3.323829008743592E-001 -3.222230030966390E-001 -3.122119727048064E-001 -3.023541344545974E-001 +-2.926535378504534E-001 -2.831139558569095E-001 -2.737388841882912E-001 -2.645315411796233E-001 +-2.554948682386357E-001 -2.466315308756733E-001 -2.379439203051605E-001 -2.294341556091086E-001 +-2.211040864500630E-001 -2.129552963178687E-001 -2.049891062917855E-001 -1.972065792968104E-001 +-1.896085248306009E-001 -1.821955041352593E-001 -1.749678357863328E-001 -1.679256016697070E-001 +-1.610686533158945E-001 -1.543966185602531E-001 -1.479089084970032E-001 -1.416047246946264E-001 +-1.354830666402364E-001 -1.295427393808110E-001 -1.237823613297505E-001 -1.182003722080803E-001 +-1.127950410906814E-001 -1.075644745292310E-001 -1.025066247250119E-001 -9.761929772637561E-002 +-9.290016162741550E-002 -8.834675474625679E-002 -8.395649376330105E-002 -7.972668180172075E-002 +-7.565451643445957E-002 -7.173709760392825E-002 -6.797143544245289E-002 -6.435445798330858E-002 +-6.088301875382573E-002 -5.755390424355815E-002 -5.436384124183465E-002 -5.130950404015087E-002 +-4.838752149578891E-002 -4.559448395376196E-002 -4.292695002467038E-002 -4.038145321632737E-002 +-3.795450841707079E-002 -3.564261822854464E-002 -3.344227914542700E-002 -3.134998757912572E-002 +-2.936224572189615E-002 -2.747556724718178E-002 -2.568648284128348E-002 -2.399154556075709E-002 +-2.238733600925974E-002 -2.087046732694841E-002 -1.943758998500702E-002 -1.808539637747108E-002 +-1.681062520225208E-002 -1.561006562315273E-002 -1.448056120472325E-002 -1.341901361203996E-002 +-1.242238606789364E-002 -1.148770656044913E-002 -1.061207079517089E-002 -9.792644885689291E-003 +-9.026667779289439E-003 -8.311453413823064E-003 -7.644392604050288E-003 -7.022954656691624E-003 +-6.444688714788650E-003 -5.907224833311778E-003 -5.408274789294695E-003 -4.945632631096857E-003 +-4.517174972678681E-003 -4.120861040002922E-003 -3.754732477833842E-003 -3.416912926281437E-003 +-3.105607377419731E-003 -2.819101323187450E-003 -2.555759706550025E-003 -2.314025688558795E-003 +-2.092419244484218E-003 -1.889535602623816E-003 -1.704043539692937E-003 -1.534683546899826E-003 +-1.380265880888705E-003 -1.239668513710815E-003 -1.111834995858471E-003 -9.957722461778529E-004 +-8.905482821692504E-004 -7.952899037961990E-004 -7.091803434652691E-004 -6.314568943142122E-004 +-5.614085283659309E-004 -4.983735154775734E-004 -4.417370533461015E-004 -3.909289181319930E-004 +-3.454211445391222E-004 -3.047257434488394E-004 -2.683924644570308E-004 -2.360066099112674E-004 +-2.071869062974215E-004 -1.815834380872262E-004 -1.588756484355621E-004 -1.387704104137109E-004 +-1.210001717867296E-004 -1.053211756933396E-004 -9.151175896858470E-005 -7.937072926575233E-005 +-6.871582158695160E-005 -5.938223432302902E-005 -5.122124443446146E-005 -4.409890097627817E-005 +-3.789479578226268E-005 -3.250090977725960E-005 -2.782053307866084E-005 -2.376725678240842E-005 +-2.026403409981320E-005 -1.724230832029450E-005 -1.464120491945796E-005 -1.240678500998552E-005 +-1.049135724264854E-005 -8.852845204233458E-006 -7.454207326496869E-006 -6.262906311616602E-006 +-5.250425095428936E-006 -4.391826404818577E-006 -3.665353019334035E-006 -3.052065916632148E-006 +-2.535517564511026E-006 -2.101457716929248E-006 -1.737569175549195E-006 -1.433234972024142E-006 +-1.179357491821685E-006 -9.680938665870723E-007 -7.927290867435514E-007 -6.475320778847807E-007 +-5.276241994739592E-007 -4.288634664203718E-007 -3.477429142387355E-007 -2.813016549911503E-007 +-2.270472942132721E-007 -1.828884985162440E-007 -1.470766197071458E-007 -1.181553945943181E-007 +-9.491785098811248E-008 -7.603486099146203E-008 -6.073410786127121E-008 -4.837176407915130E-008 +-3.841268784305750E-008 -3.041339494730827E-008 -2.400746312748265E-008 -1.889306111012390E-008 +-1.482232723113169E-008 -1.159235260051945E-008 -9.037551449695847E-009 -7.023226576899051E-009 +-5.440160800729992E-009 -4.200086148670443E-009 -3.231901265310047E-009 -2.478524349420220E-009 +-1.894283950261378E-009 -1.442763303955301E-009 -1.095025702674240E-009 -8.281587931342607E-010 +-6.240848232695148E-010 -4.685918190766918E-010 -3.505475937514400E-010 -2.612644781650944E-010 +-1.939878181760678E-010 -1.434857055851085E-010 -1.057211835543121E-010 -7.759137431860347E-011 +-5.672068993476343E-011 -4.129757138190283E-011 -2.994611644402046E-011 -2.162555489045767E-011 +-1.555185688846692E-011 -1.113685809016018E-011 -7.941188043387116E-012 -5.638028409742083E-012 +-3.985330634925237E-012 -2.804612126603285E-012 -1.964845211652283E-012 -1.370270763247127E-012 +-9.512224083674265E-013 -6.572493907689925E-013 -4.519862671303540E-013 -3.093437767727042E-013 +-2.106941451477993E-013 -1.428012490661483E-013 -9.630596371270093E-014 -6.462325628976713E-014 +-4.314311296477770E-014 -2.865452803592299E-014 -1.893241385479927E-014 -1.244288593339210E-014 +-8.134104444331886E-015 -5.288622806239492E-015 -3.419715906695803E-015 -2.198983844709001E-015 +-1.406074188714829E-015 -8.939595120262020E-016 -5.650927334900892E-016 -3.551258659022150E-016 +-2.218572638311016E-016 -1.377721435676700E-016 -8.503796136219608E-017 -5.216686759251185E-017 +-3.180340289702899E-017 -1.926705458191300E-017 -1.159806494042019E-017 -6.936643094270080E-018 +-4.121653351938615E-018 -2.432854448553694E-018 -1.426419090802075E-018 -8.306687184753300E-019 +-4.804200806911277E-019 -2.759239815798463E-019 -1.573601245826465E-019 -8.910423503063960E-020 +-5.009119545481726E-020 -2.795402398384776E-020 -1.548485530383899E-020 -8.513523557661048E-021 +-4.645258505188724E-021 -2.515169469966510E-021 -1.351261436236241E-021 -7.202507037771764E-022 +-3.808527169232365E-022 -1.997633533469661E-022 -1.039239783603225E-022 -5.361818660994457E-023 +-2.743213203276870E-023 -1.391592834130658E-023 -6.998798770266476E-024 -3.489365543082186E-024 +-1.724381727479561E-024 -8.445708424253111E-025 -4.099261481041813E-025 -1.971480786761189E-025 +-9.393918048290111E-026 -4.434223173923008E-026 -2.073258825278866E-026 -9.600695163851284E-027 +-4.402631669600770E-027 -1.999075569706327E-027 -8.986679546084488E-028 -3.999151024053201E-028 +-1.761487206505863E-028 -7.678533022386660E-029 -3.312129627341331E-029 -1.413543630349794E-029 +-5.967957584269283E-030 -2.492286225850680E-030 -1.029357200904571E-030 -4.204069307679108E-031 +-1.697649413446130E-031 -6.777016909086675E-032 -2.674107196085949E-032 -1.042810055079195E-032 +-4.018402491164044E-033 -1.529883459917130E-033 -5.753789899913789E-034 -2.137339932786416E-034 +-7.840604102092595E-035 -2.839967044606395E-035 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + + els(2) = "2P" + lchi(2) = 1 + oc(2) = 4.000000000000000E+000 + nchi(2) = 2 + epseu(2) = -6.637594170761967E-001 + rcut_chi(2) = 8.966126290453905E-001 + rcutus_chi(2) = 8.966126290453905E-001 + chi(1:1095,2) = + 7.665845577818094E-008 7.859907375502957E-008 8.058881870625926E-008 8.262893428696254E-008 + 8.472069563550108E-008 8.686541017050790E-008 8.906441840806580E-008 9.131909479957289E-008 + 9.363084859081834E-008 9.600112470280620E-008 9.843140463487711E-008 1.009232073906926E-007 + 1.034780904276607E-007 1.060976506303967E-007 1.087835253088270E-007 1.115373932215592E-007 + 1.143609756251604E-007 1.172560373499968E-007 1.202243879033090E-007 1.232678826002116E-007 + 1.263884237233236E-007 1.295879617117556E-007 1.328684963801961E-007 1.362320781688588E-007 + 1.396808094250734E-007 1.432168457173177E-007 1.468423971825173E-007 1.505597299074503E-007 + 1.543711673451233E-007 1.582790917670029E-007 1.622859457520098E-007 1.663942337132082E-007 + 1.706065234631419E-007 1.749254478187987E-007 1.793537062472033E-007 1.838940665526687E-007 + 1.885493666067606E-007 1.933225161220564E-007 1.982164984708058E-007 2.032343725496321E-007 + 2.083792746914379E-007 2.136544206257113E-007 2.190631074884557E-007 2.246087158830036E-007 + 2.302947119929987E-007 2.361246497488672E-007 2.421021730491347E-007 2.482310180379762E-007 + 2.545150154404207E-007 2.609580929566736E-007 2.675642777170493E-007 2.743376987990522E-007 + 2.812825898081767E-007 2.884032915240410E-007 2.957042546135067E-007 3.031900424124816E-007 + 3.108653337781444E-007 3.187349260133733E-007 3.268037378652056E-007 3.350768125992052E-007 + 3.435593211516544E-007 3.522565653615474E-007 3.611739812843983E-007 3.703171425899414E-007 + 3.796917640458416E-007 3.893037050895951E-007 3.991589734908541E-007 4.092637291064621E-007 + 4.196242877305486E-007 4.302471250420881E-007 4.411388806523919E-007 4.523063622550611E-007 + 4.637565498809960E-007 4.754966002611220E-007 4.875338512995566E-007 4.998758266600134E-007 + 5.125302404683146E-007 5.255050021339406E-007 5.388082212936422E-007 5.524482128802000E-007 + 5.664335023194938E-007 5.807728308591428E-007 5.954751610320351E-007 6.105496822581647E-007 + 6.260058165882842E-007 6.418532245929505E-007 6.581018114006565E-007 6.747617328888145E-007 + 6.918434020314665E-007 7.093574954076821E-007 7.273149598747164E-007 7.457270194101004E-007 + 7.646051821269374E-007 7.839612474667863E-007 8.038073135746409E-007 8.241557848605929E-007 + 8.450193797529268E-007 8.664111386474821E-007 8.883444320582464E-007 9.108329689742843E-007 + 9.338908054282157E-007 9.575323532816102E-007 9.817723892327777E-007 1.006626064052585E-006 + 1.032108912054083E-006 1.058236860801849E-006 1.085026241067120E-006 1.112493797034941E-006 + 1.140656696769699E-006 1.169532542945594E-006 1.199139383848741E-006 1.229495724657797E-006 + 1.260620539010148E-006 1.292533280860885E-006 1.325253896642002E-006 1.358802837729378E-006 + 1.393201073225370E-006 1.428470103064996E-006 1.464631971453880E-006 1.501709280646393E-006 + 1.539725205072563E-006 1.578703505822614E-006 1.618668545498167E-006 1.659645303439402E-006 + 1.701659391337678E-006 1.744737069243382E-006 1.788905261979013E-006 1.834191575967749E-006 + 1.880624316488023E-006 1.928232505364894E-006 1.977045899109251E-006 2.027095007516207E-006 + 2.078411112734309E-006 2.131026288817461E-006 2.184973421771801E-006 2.240286230110033E-006 + 2.296999285926109E-006 2.355148036503370E-006 2.414768826469703E-006 2.475898920513528E-006 + 2.538576526674820E-006 2.602840820225746E-006 2.668731968155786E-006 2.736291154276705E-006 + 2.805560604963033E-006 2.876583615544113E-006 2.949404577364269E-006 3.024069005527973E-006 + 3.100623567347343E-006 3.179116111509772E-006 3.259595697983899E-006 3.342112628682614E-006 + 3.426718478902275E-006 3.513466129557763E-006 3.602409800233547E-006 3.693605083071373E-006 + 3.787108977515799E-006 3.882979925939263E-006 3.981277850168955E-006 4.082064188938316E-006 + 4.185401936286577E-006 4.291355680930314E-006 4.399991646631680E-006 4.511377733588424E-006 + 4.625583560871719E-006 4.742680509938168E-006 4.862741769243310E-006 4.985842379984391E-006 + 5.112059283001068E-006 5.241471366863320E-006 5.374159517176597E-006 5.510206667135079E-006 + 5.649697849354562E-006 5.792720249017394E-006 5.939363258362709E-006 6.089718532555913E-006 + 6.243880046972453E-006 6.401944155931558E-006 6.564009652916709E-006 6.730177832320453E-006 + 6.900552552752144E-006 7.075240301948204E-006 7.254350263325373E-006 7.437994384218608E-006 + 7.626287445846283E-006 7.819347135046295E-006 8.017294117828103E-006 8.220252114786410E-006 + 8.428347978423775E-006 8.641711772430475E-006 8.860476852970967E-006 9.084779952028033E-006 + 9.314761262856376E-006 9.550564527599255E-006 9.792337127122880E-006 1.004023017312461E-005 + 1.029439860257256E-005 1.055500127453561E-005 1.082220106946427E-005 1.109616499098463E-005 + 1.137706427026849E-005 1.166507447304566E-005 1.196037560932439E-005 1.226315224588923E-005 + 1.257359362164619E-005 1.289189376588728E-005 1.321825161954848E-005 1.355287115953675E-005 + 1.389596152620380E-005 1.424773715404625E-005 1.460841790571373E-005 1.497822920940884E-005 + 1.535740219976451E-005 1.574617386228707E-005 1.614478718145500E-005 1.655349129256584E-005 + 1.697254163742657E-005 1.740220012398394E-005 1.784273528999514E-005 1.829442247084069E-005 + 1.875754397158434E-005 1.923238924338770E-005 1.971925506438940E-005 2.021844572516209E-005 + 2.073027321886294E-005 2.125505743619629E-005 2.179312636531046E-005 2.234481629675338E-005 + 2.291047203361483E-005 2.349044710698710E-005 2.408510399687781E-005 2.469481435871375E-005 + 2.531995925557608E-005 2.596092939631298E-005 2.661812537967776E-005 2.729195794464479E-005 + 2.798284822706016E-005 2.869122802278655E-005 2.941754005750705E-005 3.016223826335633E-005 + 3.092578806255149E-005 3.170866665820024E-005 3.251136333246738E-005 3.333437975228585E-005 + 3.417823028280345E-005 3.504344230876052E-005 3.593055656399916E-005 3.684012746930993E-005 + 3.777272347882662E-005 3.872892743518532E-005 3.970933693366951E-005 4.071456469556821E-005 + 4.174523895098019E-005 4.280200383130345E-005 4.388551977165419E-005 4.499646392346700E-005 + 4.613553057753321E-005 4.730343159774157E-005 4.850089686579174E-005 4.972867473715774E-005 + 5.098753250858641E-005 5.227825689742175E-005 5.360165453305440E-005 5.495855246080287E-005 + 5.634979865854045E-005 5.777626256639033E-005 5.923883562981877E-005 6.073843185646511E-005 + 6.227598838705590E-005 6.385246608075901E-005 6.546885011534261E-005 6.712615060251298E-005 + 6.882540321881468E-005 7.056766985248653E-005 7.235403926667659E-005 7.418562777942860E-005 + 7.606357996086488E-005 7.798906934799866E-005 7.996329917762250E-005 8.198750313772851E-005 + 8.406294613792833E-005 8.619092509935366E-005 8.837276976452815E-005 9.060984352771546E-005 + 9.290354428626123E-005 9.525530531345749E-005 9.766659615347429E-005 1.001389235389148E-004 + 1.026738323315655E-004 1.052729064869269E-004 1.079377700431242E-004 1.106700881348145E-004 + 1.134715680327206E-004 1.163439602094376E-004 1.192890594321772E-004 1.223087058831258E-004 + 1.254047863081169E-004 1.285792351943300E-004 1.318340359777480E-004 1.351712222811242E-004 + 1.385928791832278E-004 1.421011445201588E-004 1.456982102195367E-004 1.493863236683960E-004 + 1.531677891156357E-004 1.570449691098942E-004 1.610202859737434E-004 1.650962233151153E-004 + 1.692753275769024E-004 1.735602096256898E-004 1.779535463806077E-004 1.824580824833145E-004 + 1.870766320101436E-004 1.918120802274800E-004 1.966673853914516E-004 2.016455805930524E-004 + 2.067497756498414E-004 2.119831590453876E-004 2.173489999176651E-004 2.228506500976287E-004 + 2.284915461992305E-004 2.342752117621743E-004 2.402052594487325E-004 2.462853932959856E-004 + 2.525194110248763E-004 2.589112064075063E-004 2.654647716941423E-004 2.721842001014254E-004 + 2.790736883633295E-004 2.861375393464367E-004 2.933801647311502E-004 3.008060877604971E-004 + 3.084199460582186E-004 3.162264945178863E-004 3.242306082648266E-004 3.324372856926803E-004 + 3.408516515764660E-004 3.494789602640685E-004 3.583245989481158E-004 3.673940910202609E-004 + 3.766930995099327E-004 3.862274306096670E-004 3.960030372891912E-004 4.060260230004837E-004 + 4.163026454760795E-004 4.268393206229595E-004 4.376426265144125E-004 4.487193074823195E-004 + 4.600762783123658E-004 4.717206285447627E-004 4.836596268831028E-004 4.959007257140523E-004 + 5.084515657406537E-004 5.213199807320611E-004 5.345140023926209E-004 5.480418653532712E-004 + 5.619120122883032E-004 5.761330991606169E-004 5.907140005986596E-004 6.056638154083323E-004 + 6.209918722232226E-004 6.367077352965939E-004 6.528212104386643E-004 6.693423511027813E-004 + 6.862814646241905E-004 7.036491186151821E-004 7.214561475204959E-004 7.397136593369630E-004 + 7.584330425014444E-004 7.776259729512414E-004 7.973044213612473E-004 8.174806605622047E-004 + 8.381672731445571E-004 8.593771592524673E-004 8.811235445727077E-004 9.034199885232317E-004 + 9.262803926463344E-004 9.497190092114670E-004 9.737504500328494E-004 9.983896955071711E-004 + 1.023652103876800E-003 1.049553420724025E-003 1.076109788702012E-003 1.103337757508283E-003 + 1.131254294106656E-003 1.159876793203726E-003 1.189223087986135E-003 1.219311461124969E-003 + 1.250160656053855E-003 1.281789888527381E-003 1.314218858466717E-003 1.347467762099406E-003 + 1.381557304400489E-003 1.416508711842271E-003 1.452343745460242E-003 1.489084714242809E-003 + 1.526754488852669E-003 1.565376515687860E-003 1.604974831290682E-003 1.645574077112896E-003 + 1.687199514645767E-003 1.729877040923753E-003 1.773633204410792E-003 1.818495221278398E-003 + 1.864490992084923E-003 1.911649118865606E-003 1.959998922643221E-003 2.009570461369329E-003 + 2.060394548306430E-003 2.112502770861452E-003 2.165927509881323E-003 2.220701959421548E-003 + 2.276860146998988E-003 2.334436954340269E-003 2.393468138637469E-003 2.453990354323055E-003 + 2.516041175376208E-003 2.579659118172986E-003 2.644883664893037E-003 2.711755287495827E-003 + 2.780315472279618E-003 2.850606745036722E-003 2.922672696818806E-003 2.996558010326347E-003 + 3.072308486936580E-003 3.149971074384632E-003 3.229593895112742E-003 3.311226275302832E-003 + 3.394918774608007E-003 3.480723216598775E-003 3.568692719940219E-003 3.658881730316523E-003 + 3.751346053119657E-003 3.846142886919362E-003 3.943330857731782E-003 4.042970054104544E-003 + 4.145122063036307E-003 4.249850006749174E-003 4.357218580332682E-003 4.467294090278448E-003 + 4.580144493924742E-003 4.695839439830812E-003 4.814450309100837E-003 4.936050257678019E-003 + 5.060714259629381E-003 5.188519151442292E-003 5.319543677354139E-003 5.453868535736681E-003 + 5.591576426557155E-003 5.732752099938386E-003 5.877482405840489E-003 6.025856344887143E-003 + 6.177965120359545E-003 6.333902191381683E-003 6.493763327320647E-003 6.657646663426045E-003 + 6.825652757732927E-003 6.997884649252809E-003 7.174447917477673E-003 7.355450743221994E-003 + 7.541003970828204E-003 7.731221171761058E-003 7.926218709616647E-003 8.126115806571958E-003 + 8.331034611301087E-003 8.541100268384189E-003 8.756440989235642E-003 8.977188124577574E-003 + 9.203476238485430E-003 9.435443184031979E-003 9.673230180556177E-003 9.916981892583429E-003 + 1.016684651042363E-002 1.042297583247312E-002 1.068552534924690E-002 1.095465432916686E-002 + 1.123052590613177E-002 1.151330716889449E-002 1.180316925227138E-002 1.210028743020859E-002 + 1.240484121072941E-002 1.271701443278645E-002 1.303699536504154E-002 1.336497680659586E-002 + 1.370115618969192E-002 1.404573568440823E-002 1.439892230536650E-002 1.476092802047021E-002 + 1.513196986169240E-002 1.551227003792912E-002 1.590205604993377E-002 1.630156080734609E-002 + 1.671102274782784E-002 1.713068595831576E-002 1.756080029840019E-002 1.800162152583623E-002 + 1.845341142419149E-002 1.891643793263275E-002 1.939097527785098E-002 1.987730410812164E-002 + 2.037571162949427E-002 2.088649174410215E-002 2.140994519057961E-002 2.194637968657111E-002 + 2.249611007331228E-002 2.305945846225881E-002 2.363675438373562E-002 2.422833493757292E-002 + 2.483454494569188E-002 2.545573710659706E-002 2.609227215172702E-002 2.674451900360889E-002 + 2.741285493575610E-002 2.809766573424257E-002 2.879934586087860E-002 2.951829861790682E-002 + 3.025493631412889E-002 3.100968043236422E-002 3.178296179813465E-002 3.257522074945809E-002 + 3.338690730762529E-002 3.421848134882293E-002 3.507041277645535E-002 3.594318169400511E-002 + 3.683727857826129E-002 3.775320445272989E-002 3.869147106102842E-002 3.965260104005155E-002 + 4.063712809267959E-002 4.164559715978541E-002 4.267856459127930E-002 4.373659831591253E-002 + 4.482027800954212E-002 4.593019526153991E-002 4.706695373900874E-002 4.823116934844586E-002 + 4.942347039447200E-002 5.064449773522049E-002 5.189490493395587E-002 5.317535840646507E-002 + 5.448653756373736E-002 5.582913494941994E-002 5.720385637150691E-002 5.861142102768711E-002 + 6.005256162374450E-002 6.152802448436957E-002 6.303856965570503E-002 6.458497099891178E-002 + 6.616801627400209E-002 6.778850721314644E-002 6.944725958261797E-002 7.114510323249472E-002 + 7.288288213319458E-002 7.466145439786916E-002 7.648169228963463E-002 7.834448221256564E-002 + 8.025072468532488E-002 8.220133429624706E-002 8.419723963863761E-002 8.623938322498852E-002 + 8.832872137875170E-002 9.046622410224822E-002 9.265287491922673E-002 9.488967069051711E-002 + 9.717762140115631E-002 9.951774991729473E-002 1.019110917111163E-001 1.043586945519326E-001 + 1.068616181615363E-001 1.094209338318197E-001 1.120377240025865E-001 1.147130817974062E-001 + 1.174481105152737E-001 1.202439230757616E-001 1.231016414152637E-001 1.260223958318478E-001 + 1.290073242761499E-001 1.320575715856594E-001 1.351742886596608E-001 1.383586315720151E-001 + 1.416117606188822E-001 1.449348392984068E-001 1.483290332193101E-001 1.517955089352606E-001 + 1.553354327018188E-001 1.589499691526909E-001 1.626402798919591E-001 1.664075219989039E-001 + 1.702528464419823E-001 1.741773963984853E-001 1.781823054763667E-001 1.822686958347090E-001 + 1.864376761992876E-001 1.906903397696904E-001 1.950277620144694E-001 1.994509983508329E-001 + 2.039610817054368E-001 2.085590199529010E-001 2.132457932287719E-001 2.180223511137642E-001 + 2.228896096862560E-001 2.278484484401818E-001 2.328997070656661E-001 2.380441820899775E-001 + 2.432826233766465E-001 2.486157304809067E-001 2.540441488599661E-001 2.595684659370132E-001 + 2.651892070183077E-001 2.709068310632072E-001 2.767217263075266E-001 2.826342057412518E-001 + 2.886445024422921E-001 2.947527647687105E-001 3.009590514126734E-001 3.072633263202531E-001 + 3.136654534821802E-001 3.201651916016834E-001 3.267621886466885E-001 3.334559762948593E-001 + 3.402459642812705E-001 3.471314346599030E-001 3.541115359916371E-001 3.611852774730137E-001 + 3.683515230217148E-001 3.756089853364961E-001 3.829562199511769E-001 3.903916193042677E-001 + 3.979134068478783E-001 4.055196312216885E-001 4.132081605200043E-001 4.209766766822230E-001 + 4.288226700393940E-001 4.367434340519974E-001 4.447360602765256E-001 4.527974336009458E-001 + 4.609242277916236E-001 4.691129013967908E-001 4.773596940540922E-001 4.856606232521545E-001 + 4.940114815984308E-001 5.024078346477732E-001 5.108450193482199E-001 5.193181431623477E-001 + 5.278220839241243E-001 5.363514904925549E-001 5.449007842644066E-001 5.534641616089078E-001 + 5.620355972875278E-001 5.706088489216128E-001 5.791774625698047E-001 5.877347794757054E-001 + 5.962739440440749E-001 6.047879131009948E-001 6.132694664897032E-001 6.217112190492741E-001 + 6.301056340178318E-001 6.384450378955052E-001 6.467216367948684E-001 6.549275342980052E-001 + 6.630547508296766E-001 6.710952445452277E-001 6.790409337198507E-001 6.868837206126970E-001 + 6.946155167649676E-001 7.022282696756653E-001 7.097139907821443E-001 7.170647846549725E-001 + 7.242728792981332E-001 7.313306574261527E-001 7.382306885696783E-001 7.449657618403384E-001 + 7.515289191646530E-001 7.579134887755096E-001 7.641131187284723E-001 7.701218101892403E-001 + 7.759339502181669E-001 7.815443437581194E-001 7.869482445135428E-001 7.921413843915441E-001 + 7.971200011606017E-001 8.018808639694039E-001 8.064212963576444E-001 8.107391963828360E-001 + 8.148330534824906E-001 8.187019616899143E-001 8.223456288245777E-001 8.257643812849331E-001 + 8.289591640830704E-001 8.319315357769358E-001 8.346836579774983E-001 8.372182791355227E-001 + 8.395387123458663E-001 8.416488069470521E-001 8.435529137405722E-001 8.452558437087386E-001 + 8.467628201724258E-001 8.480794244015744E-001 8.492115347728298E-001 8.501652596610415E-001 + 8.509468643558958E-001 8.515626924128870E-001 8.520190819805585E-001 8.523222777949709E-001 + 8.524783396989162E-001 8.524930487288551E-001 8.523718120175968E-001 8.521195679855572E-001 + 8.517406935373382E-001 8.512389152409462E-001 8.506172267401988E-001 8.498778149297702E-001 + 8.490219976965759E-001 8.480501762860863E-001 8.469618055672306E-001 8.457553856177569E-001 + 8.444284780978958E-001 8.429777507789424E-001 8.413990532888892E-001 8.396875265605782E-001 + 8.378377475360044E-001 8.358439092945040E-001 8.337000348163542E-001 8.314002199317713E-001 + 8.289388974818536E-001 8.263111101525510E-001 8.235127736265376E-001 8.205409043878643E-001 + 8.173937774235414E-001 8.140709678514479E-001 8.105732167495573E-001 8.069020591572043E-001 + 8.030593216888513E-001 7.990469613981120E-001 7.948670519901674E-001 7.905217812728413E-001 + 7.860134485042608E-001 7.813444616448012E-001 7.765173345210473E-001 7.715346839094472E-001 + 7.663992265472731E-001 7.611137760783988E-001 7.556812399412131E-001 7.501046162058302E-001 + 7.443869903674818E-001 7.385315321027277E-001 7.325414919947744E-001 7.264201982338454E-001 + 7.201710532981421E-001 7.137975306204994E-001 7.073031712453672E-001 7.006915804802668E-001 + 6.939664245453039E-001 6.871314272237905E-001 6.801903665163067E-001 6.731470713004929E-001 + 6.660054179976148E-001 6.587693272456999E-001 6.514427605807138E-001 6.440297171250563E-001 + 6.365342302803474E-001 6.289603644242312E-001 6.213122116093053E-001 6.135938882605348E-001 + 6.058095318681186E-001 5.979632976722536E-001 5.900593553359242E-001 5.821018856016384E-001 + 5.740950769279818E-001 5.660431221018718E-001 5.579502148225983E-001 5.498205462540190E-001 + 5.416583015417792E-001 5.334676562930365E-001 5.252527730169469E-001 5.170177975251524E-001 + 5.087668552925647E-001 5.005040477800344E-001 4.922334487218433E-001 4.839591003824619E-001 + 4.756850097886066E-001 4.674151449442462E-001 4.591534310378986E-001 4.509037466532046E-001 + 4.426699199953573E-001 4.344557251475037E-001 4.262648783725879E-001 4.181010344773167E-001 + 4.099677832559236E-001 4.018686460321251E-001 3.938070723181463E-001 3.857864366098324E-001 + 3.778100353367078E-001 3.698810839853502E-001 3.620027144136282E-001 3.541779723722111E-001 + 3.464098152483032E-001 3.387011100448278E-001 3.310546316062981E-001 3.234730611003961E-001 + 3.159589847618996E-001 3.085148929030589E-001 3.011431791919026E-001 2.938461401972797E-001 + 2.866259751967215E-001 2.794847862406287E-001 2.724245784637051E-001 2.654472606319701E-001 + 2.585546459115124E-001 2.517484528429970E-001 2.450303065039318E-001 2.384017398390409E-001 + 2.318641951376308E-001 2.254190256356494E-001 2.190674972192267E-001 2.128107902058801E-001 + 2.066500011792592E-001 2.005861448533150E-001 1.946201559421062E-001 1.887528910121040E-001 + 1.829851302948407E-001 1.773175794390326E-001 1.717508711829252E-001 1.662855669295232E-001 + 1.609221582095523E-001 1.556610680194724E-001 1.505026520245352E-001 1.454471996197649E-001 + 1.404949348447740E-001 1.356460171514417E-001 1.309005420266662E-001 1.262585414755402E-001 + 1.217199843733792E-001 1.172847766979537E-001 1.129527616559881E-001 1.087237197204416E-001 + 1.045973685972039E-001 1.005733631415905E-001 9.665129524637017E-002 9.283069372395293E-002 + 8.911102420583181E-002 8.549168908236296E-002 8.197202750552574E-002 7.855131547642989E-002 + 7.522876603806726E-002 7.200352959218535E-002 6.887469435722601E-002 6.584128698208899E-002 + 6.290227332809845E-002 6.005655942902325E-002 5.730299263640035E-002 5.464036295477426E-002 + 5.206740456885953E-002 4.958279756209537E-002 4.718516982363710E-002 4.487309913855610E-002 + 4.264511545391887E-002 4.049970331151843E-002 3.843530443634689E-002 3.645032046843749E-002 + 3.454311582447758E-002 3.271202067458982E-002 3.095533401890561E-002 2.927132684799373E-002 + 2.765824537085235E-002 2.611431429401181E-002 2.463774013530992E-002 2.322671455607900E-002 + 2.187941769580774E-002 2.059402149379099E-002 1.936869298284621E-002 1.820159754083533E-002 + 1.709090208647318E-002 1.603477820671338E-002 1.503140520386379E-002 1.407897305148863E-002 + 1.317568524908567E-002 1.231976156647928E-002 1.150944066983129E-002 1.074298262213307E-002 + 1.001867125199855E-002 9.334816385519761E-003 8.689755936870365E-003 8.081857854241981E-003 + 7.509521918569348E-003 6.971181393339760E-003 6.465304524586077E-003 5.990395890929348E-003 + 5.544997604263568E-003 5.127690362360200E-003 4.737094355312701E-003 4.371870028339719E-003 + 4.030718704020124E-003 3.712383067542550E-003 3.415647519016873E-003 3.139338397315258E-003 + 2.882324080285969E-003 2.643514966515268E-003 2.421863344101450E-003 2.216363152151600E-003 + 2.026049640917158E-003 1.849998936649522E-003 1.687327517383463E-003 1.537191605944728E-003 + 1.398786486529073E-003 1.271345751236721E-003 1.154140482891915E-003 1.046478380474082E-003 + 9.477028333932470E-004 8.571919507436638E-004 7.743575515435820E-004 6.986441218188300E-004 + 6.295277442159047E-004 5.665150056366306E-004 5.091418881989111E-004 4.569726485571144E-004 + 4.095986904270582E-004 3.666374348885819E-004 3.277311927836293E-004 2.925460432626300E-004 + 2.607707222606449E-004 2.321155244106597E-004 2.063112216398754E-004 1.831084964287518E-004 + 1.622808212987347E-004 1.436138682814248E-004 1.269093213725300E-004 1.119844867543084E-004 + 9.867134522126673E-005 8.681564161201218E-005 7.627601224021512E-005 6.692315121768971E-005 + 5.863901648117145E-005 5.131607628390857E-005 4.485659689741043E-005 3.917197229997181E-005 + 3.418209671117872E-005 2.981478097980356E-005 2.600521405957843E-005 2.264235810686479E-005 + 1.967911078948544E-005 1.707268946209148E-005 1.478430803601421E-005 1.277887047664681E-005 + 1.102468079733011E-005 9.493169344289565E-006 8.158635099126459E-006 6.998003663833427E-006 + 5.990600538332791E-006 5.117939252123248E-006 4.363523869697761E-006 3.712665353843395E-006 + 3.152311241579547E-006 2.670888064114003E-006 2.258155924539304E-006 1.905074634756673E-006 + 1.603680805976580E-006 1.346975284752027E-006 1.128820328483141E-006 9.438459203045262E-007 + 7.873646328387712E-007 6.552944630714146E-007 5.440890761835351E-007 4.506749141733107E-007 + 3.723946451312487E-007 3.069564507363943E-007 2.523886725625801E-007 2.069993617931601E-007 + 1.693403016292659E-007 1.381750967532339E-007 1.124509494124934E-007 9.127376678218614E-008 + 7.388626903504656E-008 5.964879180831758E-008 4.802250034874744E-008 3.855475540198857E-008 + 3.086639277973748E-008 2.464069939728511E-008 1.961388835768030E-008 1.556689431821548E-008 + 1.231832788039394E-008 9.718444082370497E-009 7.643995244230443E-009 5.993852435425499E-009 + 4.685292725419767E-009 3.650861177701284E-009 2.835727296130231E-009 2.195465379636327E-009 + 1.694197039769536E-009 1.303042042127807E-009 9.988307059456911E-010 7.630373958761852E-010 + 5.809002260612961E-010 4.406970280365319E-010 3.331519684707155E-010 2.509509957954725E-010 + 1.883475995294562E-010 1.408432328119249E-010 1.049292244965940E-010 7.787913603162730E-011 + 5.758234083600840E-011 4.241115718879405E-011 3.111518367133702E-011 2.273759960992745E-011 + 1.654912932217883E-011 1.199615289436188E-011 8.660099561380144E-012 6.225801804938767E-012 + 4.456935934997816E-012 3.177042913226915E-012 2.254924288500201E-012 1.593453350347535E-012 + 1.121040396905728E-012 7.851513927148686E-013 5.474080635022485E-013 3.799003715141809E-013 + 2.624241365304021E-013 1.804213125568504E-013 1.234514094982611E-013 8.406248969327576E-014 + 5.696130405120588E-014 3.840627996577907E-014 2.576570546069773E-014 1.719775647002971E-014 + 1.141993565744167E-014 7.543787000931954E-015 4.957018224268122E-015 3.239873334537814E-015 + 2.106117916343675E-015 1.361616541661726E-015 8.754158742394170E-016 5.596687774791476E-016 + 3.557738496160280E-016 2.248599350334098E-016 1.412907380306521E-016 8.825654175498248E-017 + 5.479984892717239E-017 3.382036544443760E-017 2.074486131787533E-017 1.264568878210174E-017 + 7.660200609161282E-018 4.610723270078356E-018 2.757365629964819E-018 1.638252103412378E-018 + 9.669242036342996E-019 5.668827549080152E-019 3.301007551131498E-019 1.909040442031113E-019 + 1.096380980150992E-019 6.252411483171713E-020 3.540256837295189E-020 1.990142283583697E-020 + 1.110596017813807E-020 6.151920545371780E-021 3.382263467019624E-021 1.845462581313459E-021 + 9.992234346395062E-022 5.368308675522184E-022 2.861457270940119E-022 1.513104237251728E-022 + 7.936674415213993E-023 4.129069625983690E-023 2.130418896870418E-023 1.090012891082889E-023 + 5.529758859420384E-024 2.781263951573173E-024 1.386732250404776E-024 6.853458205683369E-025 + 3.356954194190725E-025 1.629486246061723E-025 7.837474650878181E-026 3.734837175185186E-026 + 1.763138984248185E-026 8.244596671147523E-027 3.818284346403259E-027 1.751178618350454E-027 + 7.952480813317832E-028 3.575450974909615E-028 1.591330432405223E-028 7.010288551009714E-029 + 3.056337796645827E-029 1.318560263225846E-029 5.628262132627767E-030 2.376655069223483E-030 + 9.926966959452249E-031 4.100774711915087E-031 1.675150154163590E-031 6.765795898176817E-032 + 2.701465446675277E-032 1.066185055110814E-032 4.158674216369998E-033 1.602883773223423E-033 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 +/ + +&rhoatom + rho_at(1:1095) = + 3.609136560465641E-008 3.700502349847288E-008 3.794181078396430E-008 3.890231298610786E-008 + 3.988713045260043E-008 4.089687872910136E-008 4.193218894397555E-008 4.299370820277606E-008 + 4.408209999271373E-008 4.519804459736596E-008 4.634223952188454E-008 4.751539992896743E-008 + 4.871825908586781E-008 4.995156882271954E-008 5.121610000246571E-008 5.251264300268332E-008 + 5.384200820960607E-008 5.520502652465381E-008 5.660254988378530E-008 5.803545178999899E-008 + 5.950462785931374E-008 6.101099638057250E-008 6.255549888941781E-008 6.413910075679799E-008 + 6.576279179237154E-008 6.742758686318798E-008 6.913452652803088E-008 7.088467768782046E-008 + 7.267913425248152E-008 7.451901782469357E-008 7.640547840095154E-008 7.833969509037485E-008 + 8.032287685171279E-008 8.235626324900934E-008 8.444112522639876E-008 8.657876590251505E-008 + 8.877052138501412E-008 9.101776160571547E-008 9.332189117688770E-008 9.568435026921260E-008 + 9.810661551197452E-008 1.005902009160404E-007 1.031366588202071E-007 1.057475808615058E-007 + 1.084245989700724E-007 1.111693863892033E-007 1.139836587212372E-007 1.168691749999141E-007 + 1.198277387898842E-007 1.228611993140515E-007 1.259714526094591E-007 1.291604427124371E-007 + 1.324301628737568E-007 1.357826568045469E-007 1.392200199537540E-007 1.427444008179427E-007 + 1.463580022842595E-007 1.500630830073941E-007 1.538619588214025E-007 1.577570041872742E-007 + 1.617506536771467E-007 1.658454034960982E-007 1.700438130424659E-007 1.743485065076710E-007 + 1.787621745165451E-007 1.832875758091859E-007 1.879275389653947E-007 1.926849641727740E-007 + 1.975628250395861E-007 2.025641704535135E-007 2.076921264874768E-007 2.129498983537038E-007 + 2.183407724072759E-007 2.238681182003968E-007 2.295353905886745E-007 2.353461318907275E-007 + 2.413039741024739E-007 2.474126411674809E-007 2.536759513047950E-007 2.600978193957126E-007 + 2.666822594309794E-007 2.734333870199497E-007 2.803554219632770E-007 2.874526908907423E-007 + 2.947296299658711E-007 3.021907876590275E-007 3.098408275907220E-007 3.176845314469127E-007 + 3.257268019681187E-007 3.339726660142199E-007 3.424272777068541E-007 3.510959216513808E-007 + 3.599840162404289E-007 3.690971170410852E-007 3.784409202678549E-007 3.880212663435526E-007 + 3.978441435503631E-007 4.079156917733456E-007 4.182422063387331E-007 4.288301419494155E-007 + 4.396861167200765E-007 4.508169163145097E-007 4.622294981876918E-007 4.739309959352753E-007 + 4.859287237532246E-007 4.982301810103663E-007 5.108430569367414E-007 5.237752354306696E-007 + 5.370347999875436E-007 5.506300387534312E-007 5.645694497066585E-007 5.788617459705973E-007 + 5.935158612609996E-007 6.085409554712686E-007 6.239464203991847E-007 6.397418856186405E-007 + 6.559372245000820E-007 6.725425603834132E-007 6.895682729072277E-007 7.070250044983322E-007 + 7.249236670256109E-007 7.432754486224128E-007 7.620918206817091E-007 7.813845450284254E-007 + 8.011656812734112E-007 8.214475943536650E-007 8.422429622635313E-007 8.635647839817064E-007 + 8.854263875990133E-007 9.078414386520461E-007 9.308239486678703E-007 9.543882839251741E-007 + 9.785491744373056E-007 1.003321723162854E-006 1.028721415449535E-006 1.054764128717280E-006 + 1.081466142386608E-006 1.108844148058481E-006 1.136915259952037E-006 1.165697025606720E-006 + 1.195207436855513E-006 1.225464941076158E-006 1.256488452727391E-006 1.288297365177427E-006 + 1.320911562832108E-006 1.354351433570306E-006 1.388637881494375E-006 1.423792340003632E-006 + 1.459836785199055E-006 1.496793749627622E-006 1.534686336374880E-006 1.573538233514568E-006 + 1.613373728924373E-006 1.654217725477091E-006 1.696095756616722E-006 1.739034002329223E-006 + 1.783059305518012E-006 1.828199188794402E-006 1.874481871693536E-006 1.921936288326632E-006 + 1.970592105480552E-006 2.020479741176088E-006 2.071630383696615E-006 2.124076011098988E-006 + 2.177849411218981E-006 2.232984202183777E-006 2.289514853444407E-006 2.347476707341301E-006 + 2.406906001216534E-006 2.467839890086576E-006 2.530316469889807E-006 2.594374801323450E-006 + 2.660054934284760E-006 2.727397932931887E-006 2.796445901380218E-006 2.867242010050127E-006 + 2.939830522682939E-006 3.014256824041857E-006 3.090567448315367E-006 3.168810108240985E-006 + 3.249033724967502E-006 3.331288458674702E-006 3.415625739969619E-006 3.502098302079136E-006 + 3.590760213859198E-006 3.681666913641318E-006 3.774875243937771E-006 3.870443487027127E-006 + 3.968431401442706E-006 4.068900259386821E-006 4.171912885094266E-006 4.277533694169413E-006 + 4.385828733921400E-006 4.496865724723075E-006 4.610714102419553E-006 4.727445061813140E-006 + 4.847131601252126E-006 4.969848568351363E-006 5.095672706873549E-006 5.224682704800764E-006 + 5.356959243626495E-006 5.492585048899422E-006 5.631644942050527E-006 5.774225893536518E-006 + 5.920417077332965E-006 6.070309926811504E-006 6.223998192036603E-006 6.381577998517732E-006 + 6.543147907454317E-006 6.708808977511507E-006 6.878664828165598E-006 7.052821704659508E-006 + 7.231388544608961E-006 7.414477046301830E-006 7.602201738733821E-006 7.794680053424522E-006 + 7.992032398059778E-006 8.194382232006544E-006 8.401856143748397E-006 8.614583930290654E-006 + 8.832698678585317E-006 9.056336849027820E-006 9.285638361078057E-006 9.520746681060576E-006 + 9.761808912199199E-006 1.000897588694358E-005 1.026240226164622E-005 1.052224661365012E-005 + 1.078867154084885E-005 1.106184376378244E-005 1.134193423033375E-005 1.162911822309260E-005 + 1.192357546945530E-005 1.222549025453041E-005 1.253505153692237E-005 1.285245306746673E-005 + 1.317789351099346E-005 1.351157657119514E-005 1.385371111868061E-005 1.420451132229561E-005 + 1.456419678379414E-005 1.493299267594759E-005 1.531112988417905E-005 1.569884515181429E-005 + 1.609638122904224E-005 1.650398702568067E-005 1.692191776784502E-005 1.735043515862121E-005 + 1.778980754284549E-005 1.824031007609759E-005 1.870222489801575E-005 1.917584131004566E-005 + 1.966145595773716E-005 2.015937301770727E-005 2.066990438938959E-005 2.119336989169430E-005 + 2.173009746470594E-005 2.228042337654926E-005 2.284469243555768E-005 2.342325820788152E-005 + 2.401648324067725E-005 2.462473929102320E-005 2.524840756071003E-005 2.588787893705895E-005 + 2.654355423992512E-005 2.721584447504630E-005 2.790517109390312E-005 2.861196626026023E-005 + 2.933667312356324E-005 3.007974609936976E-005 3.084165115699911E-005 3.162286611458957E-005 + 3.242388094175633E-005 3.324519807005011E-005 3.408733271142125E-005 3.495081318489806E-005 + 3.583618125169668E-005 3.674399245898348E-005 3.767481649251742E-005 3.862923753840710E-005 + 3.960785465422212E-005 4.061128214970596E-005 4.164014997734385E-005 4.269510413304654E-005 + 4.377680706721762E-005 4.488593810647901E-005 4.602319388633864E-005 4.718928879508947E-005 + 4.838495542923946E-005 4.961094506077940E-005 5.086802811660286E-005 5.215699467040461E-005 + 5.347865494738875E-005 5.483383984213057E-005 5.622340144994385E-005 5.764821361211571E-005 + 5.910917247538213E-005 6.060719706602523E-005 6.214322987898850E-005 6.371823748241361E-005 + 6.533321113801394E-005 6.698916743771619E-005 6.868714895700781E-005 7.042822492544501E-005 + 7.221349191478668E-005 7.404407454523442E-005 7.592112621027198E-005 7.784582982061198E-005 + 7.981939856777162E-005 8.184307670781642E-005 8.391814036582464E-005 8.604589836164195E-005 + 8.822769305751296E-005 9.046490122819277E-005 9.275893495416123E-005 9.511124253857752E-005 + 9.752330944863702E-005 9.999665928200572E-005 1.025328547590334E-004 1.051334987414646E-004 + 1.078002352783882E-004 1.105347506801894E-004 1.133387746212929E-004 1.162140812725056E-004 + 1.191624904637969E-004 1.221858688783746E-004 1.252861312789471E-004 1.284652417670851E-004 + 1.317252150766264E-004 1.350681179020965E-004 1.384960702631469E-004 1.420112469060468E-004 + 1.456158787432927E-004 1.493122543324367E-004 1.531027213952706E-004 1.569896883785311E-004 + 1.609756260573410E-004 1.650630691826276E-004 1.692546181738077E-004 1.735529408580661E-004 + 1.779607742575996E-004 1.824809264262410E-004 1.871162783369262E-004 1.918697858215109E-004 + 1.967444815644989E-004 2.017434771522913E-004 2.068699651796196E-004 2.121272214148816E-004 + 2.175186070261602E-004 2.230475708697518E-004 2.287176518431148E-004 2.345324813041874E-004 + 2.404957855591112E-004 2.466113884204555E-004 2.528832138381104E-004 2.593152886050956E-004 + 2.659117451405971E-004 2.726768243526493E-004 2.796148785829311E-004 2.867303746362573E-004 + 2.940278968974242E-004 3.015121505381664E-004 3.091879648170768E-004 3.170602964754454E-004 + 3.251342332320778E-004 3.334149973802628E-004 3.419079494901689E-004 3.506185922200816E-004 + 3.595525742399983E-004 3.687156942712364E-004 3.781139052458524E-004 3.877533185897831E-004 + 3.976402086337990E-004 4.077810171564779E-004 4.181823580635893E-004 4.288510222084276E-004 + 4.397939823578112E-004 4.510183983086402E-004 4.625316221600876E-004 4.743412037466947E-004 + 4.864548962378441E-004 4.988806619092847E-004 5.116266780926098E-004 5.247013433088203E-004 + 5.381132835923258E-004 5.518713590120023E-004 5.659846703961741E-004 5.804625662686488E-004 + 5.953146500032424E-004 6.105507872044865E-004 6.261811133225514E-004 6.422160415107092E-004 + 6.586662707340087E-004 6.755427941381870E-004 6.928569076881826E-004 7.106202190860157E-004 + 7.288446569781974E-004 7.475424804632057E-004 7.667262889100498E-004 7.864090320993605E-004 + 8.066040206989167E-004 8.273249370860166E-004 8.485858465296157E-004 8.704012087456853E-004 + 8.927858898398012E-004 9.157551746515588E-004 9.393247795160354E-004 9.635108654581228E-004 + 9.883300518362733E-004 1.013799430452847E-003 1.039936580149006E-003 1.066759581902865E-003 + 1.094287034450380E-003 1.122538070449303E-003 1.151532373207423E-003 1.181290193997177E-003 + 1.211832369979697E-003 1.243180342762345E-003 1.275356177614837E-003 1.308382583370115E-003 + 1.342282933037302E-003 1.377081285155238E-003 1.412802405916343E-003 1.449471792091848E-003 + 1.487115694790824E-003 1.525761144086813E-003 1.565435974547407E-003 1.606168851703612E-003 + 1.647989299497537E-003 1.690927728748604E-003 1.735015466680232E-003 1.780284787550913E-003 + 1.826768944435388E-003 1.874502202203847E-003 1.923519871749064E-003 1.973858345513693E-003 + 2.025555134372271E-003 2.078648905924871E-003 2.133179524261954E-003 2.189188091262641E-003 + 2.246716989491370E-003 2.305809926760901E-003 2.366511982432578E-003 2.428869655528109E-003 + 2.492930914730343E-003 2.558745250354075E-003 2.626363728371575E-003 2.695839046581347E-003 + 2.767225593012623E-003 2.840579506662359E-003 2.915958740665750E-003 2.993423128005959E-003 + 3.073034449873520E-003 3.154856506790907E-003 3.238955192622923E-003 3.325398571599097E-003 + 3.414256958480026E-003 3.505603002005498E-003 3.599511771768547E-003 3.696060848666139E-003 + 3.795330419083960E-003 3.897403372979965E-003 4.002365406038758E-003 4.110305126076788E-003 + 4.221314163886315E-003 4.335487288714699E-003 4.452922528584508E-003 4.573721295669107E-003 + 4.697988516948120E-003 4.825832770377320E-003 4.957366426818012E-003 5.092705797981995E-003 + 5.231971290659733E-003 5.375287567511346E-003 5.522783714712642E-003 5.674593416761197E-003 + 5.830855138761627E-003 5.991712316522815E-003 6.157313554815226E-003 6.327812834151410E-003 + 6.503369726469309E-003 6.684149620114510E-003 6.870323954535005E-003 7.062070465120482E-003 + 7.259573438636906E-003 7.463023979726964E-003 7.672620288967447E-003 7.888567952995921E-003 + 8.111080247241463E-003 8.340378451817185E-003 8.576692181156151E-003 8.820259727997607E-003 + 9.071328422355911E-003 9.330155006131850E-003 9.597006024053631E-003 9.872158231664140E-003 + 1.015589902110079E-002 1.044852686544547E-002 1.075035178245487E-002 1.106169581851408E-002 + 1.138289355369163E-002 1.171429262880962E-002 1.205625429547975E-002 1.240915399009420E-002 + 1.277338193279997E-002 1.314934375252582E-002 1.353746113917354E-002 1.393817252412780E-002 + 1.435193379028442E-002 1.477921901284206E-002 1.522052123215009E-002 1.567635325995385E-002 + 1.614724852042768E-002 1.663376192743827E-002 1.713647079953222E-002 1.765597581419560E-002 + 1.819290200298778E-002 1.874789978920739E-002 1.932164606980552E-002 1.991484534331826E-002 + 2.052823088564993E-002 2.116256597559716E-002 2.181864517206452E-002 2.249729564498249E-002 + 2.319937856200019E-002 2.392579053308560E-002 2.467746511522817E-002 2.545537437949900E-002 + 2.626053054278528E-002 2.709398766657503E-002 2.795684342522781E-002 2.885024094622466E-002 + 2.977537072494697E-002 3.073347261658875E-002 3.172583790785778E-002 3.275381147117142E-002 + 3.381879400409774E-002 3.492224435683498E-002 3.606568195056020E-002 3.725068928950943E-002 + 3.847891456967910E-002 3.975207438705763E-002 4.107195654830934E-002 4.244042298683642E-002 + 4.385941278714023E-002 4.533094532038730E-002 4.685712349405909E-002 4.844013711852421E-002 + 5.008226639332022E-002 5.178588551586097E-002 5.355346641520162E-002 5.538758261338862E-002 + 5.729091321679826E-002 5.926624703971987E-002 6.131648686227249E-002 6.344465382454365E-002 + 6.565389195861815E-002 6.794747285990792E-002 7.032880049890591E-002 7.280141617416545E-002 + 7.536900360694104E-002 7.803539417752645E-002 8.080457230287598E-002 8.368068095460071E-002 + 8.666802731588247E-002 8.977108857525092E-002 9.299451785450608E-002 9.634315026734788E-002 + 9.982200910448874E-002 1.034363121401628E-001 1.071914780540157E-001 1.110931329613471E-001 + 1.151471170435794E-001 1.193594912696478E-001 1.237365441977241E-001 1.282847988453197E-001 + 1.330110196143328E-001 1.379222192560181E-001 1.430256658591728E-001 1.483288898430092E-001 + 1.538396909342593E-001 1.595661451059983E-001 1.655166114534812E-001 1.716997389799749E-001 + 1.781244732631067E-001 1.848000629696567E-001 1.917360661839851E-001 1.989423565124028E-001 + 2.064291289227767E-001 2.142069052754886E-001 2.222865394985604E-001 2.306792223563129E-001 + 2.393964857573356E-001 2.484502065438389E-001 2.578526097006177E-001 2.676162709179110E-001 + 2.777541184383887E-001 2.882794341143586E-001 2.992058535970820E-001 3.105473655758195E-001 + 3.223183099799514E-001 3.345333750532178E-001 3.472075932048730E-001 3.603563355383553E-001 + 3.739953049539719E-001 3.881405277181692E-001 4.028083433881987E-001 4.180153929774969E-001 + 4.337786052439137E-001 4.501151809801064E-001 4.670425751830544E-001 4.845784769778242E-001 + 5.027407871694659E-001 5.215475932964281E-001 5.410171420591287E-001 5.611678089984991E-001 + 5.820180653015261E-001 6.035864416141057E-001 6.258914887461138E-001 6.489517351595169E-001 + 6.727856411377919E-001 6.974115495440167E-001 7.228476330857826E-001 7.491118380178721E-001 + 7.762218242283851E-001 8.041949016709219E-001 8.330479631246307E-001 8.627974132855047E-001 + 8.934590942164167E-001 9.250482072099495E-001 9.575792311474079E-001 9.910658374692892E-001 + 1.025520801907094E+000 1.060955913163621E+000 1.097381878768746E+000 1.134808228379969E+000 + 1.173243214841684E+000 1.212693713363879E+000 1.253165119229536E+000 1.294661244490107E+000 + 1.337184214159558E+000 1.380734362469229E+000 1.425310129797445E+000 1.470907960939005E+000 + 1.517522205429156E+000 1.565145020684281E+000 1.613766278765669E+000 1.663373477612796E+000 + 1.713951657627408E+000 1.765483324517950E+000 1.817948379334614E+000 1.871324056636980E+000 + 1.925584871737658E+000 1.980702577955337E+000 2.036646134787552E+000 2.093381687876581E+000 + 2.150872561589577E+000 2.209079264965329E+000 2.267959511694610E+000 2.327468254697324E+000 + 2.387557735738300E+000 2.448177550383690E+000 2.509274728442136E+000 2.570793829860394E+000 + 2.632677055852185E+000 2.694864374834480E+000 2.757293662529005E+000 2.819900855361307E+000 + 2.882620116059604E+000 2.945384010123923E+000 3.008123691608776E+000 3.070769096444430E+000 + 3.133249141319005E+000 3.195491925962894E+000 3.257424936524561E+000 3.318975247610346E+000 + 3.380069720487266E+000 3.440635194923278E+000 3.500598672171879E+000 3.559887486701184E+000 + 3.618429464428150E+000 3.676153065448613E+000 3.732987509555040E+000 3.788862883207004E+000 + 3.843710227059597E+000 3.897461603658929E+000 3.950050145471439E+000 4.001410084013723E+000 + 4.051476761477645E+000 4.100186626881940E+000 4.147477219406374E+000 4.193287142152820E+000 + 4.237556030102594E+000 4.280224516474528E+000 4.321234202002930E+000 4.360527631823709E+000 + 4.398048284653127E+000 4.433740578746577E+000 4.467549898719685E+000 4.499422646691922E+000 + 4.529306320378326E+000 4.557149619721167E+000 4.582902582448924E+000 4.606516747618394E+000 + 4.627945344793874E+000 4.647143505119919E+000 4.664068489236158E+000 4.678679925861220E+000 + 4.690940054041390E+000 4.700813961619072E+000 4.708269812522362E+000 4.713279056086011E+000 + 4.715816612833983E+000 4.715861032994853E+000 4.713394626438886E+000 4.708403565616320E+000 + 4.700877966263681E+000 4.690811953875819E+000 4.678203726888217E+000 4.663055629774454E+000 + 4.645374250379410E+000 4.625170555280406E+000 4.602460074282587E+000 4.577263139815198E+000 + 4.549605178541126E+000 4.519517040521623E+000 4.487035335432531E+000 4.452202725252361E+000 + 4.415068098091987E+000 4.375686517730733E+000 4.334118806871822E+000 4.290430609317148E+000 + 4.244691140719679E+000 4.196972654065107E+000 4.147350215417223E+000 4.095901497906700E+000 + 4.042706570288598E+000 3.987847680895041E+000 3.931409037816736E+000 3.873476586149655E+000 + 3.814137783141754E+000 3.753481372069180E+000 3.691597155661506E+000 3.628575769882482E+000 + 3.564508458855321E+000 3.499486851701232E+000 3.433602742035853E+000 3.366947870841330E+000 + 3.299613713402093E+000 3.231691270960034E+000 3.163270867710215E+000 3.094441953721816E+000 + 3.025292914330387E+000 2.955910886507720E+000 2.886381582674431E+000 2.816789122381812E+000 + 2.747215872242813E+000 2.677742294443709E+000 2.608446804144489E+000 2.539405636019624E+000 + 2.470692720135497E+000 2.402379567346552E+000 2.334535164342100E+000 2.267225878426545E+000 + 2.200515372086003E+000 2.134464527356235E+000 2.069131379971317E+000 2.004571063238839E+000 + 1.940835761555869E+000 1.877974673449710E+000 1.816033983999606E+000 1.755056846469013E+000 + 1.695083372953769E+000 1.636150633828657E+000 1.578292665753740E+000 1.521540487982517E+000 + 1.465922126695638E+000 1.411462647067365E+000 1.358184192756274E+000 1.306106032497134E+000 + 1.255244613457327E+000 1.205613621008161E+000 1.157224044549334E+000 1.110084249013178E+000 + 1.064200051664210E+000 1.019574803799170E+000 9.762094769427444E-001 9.341027531250303E-001 + 8.932511188184122E-001 8.536489621040070E-001 8.152886726316125E-001 7.781607439320264E-001 + 7.422538776372712E-001 7.075550891626070E-001 6.740498144046407E-001 6.417220170124964E-001 + 6.105542957940100E-001 5.805279918265505E-001 5.516232948523041E-001 5.238193485507716E-001 + 4.970943542969151E-001 4.714256730316063E-001 4.467899248918353E-001 4.231630862712558E-001 + 4.005205840067597E-001 3.788373864140822E-001 3.580880909240159E-001 3.382470081003345E-001 + 3.192882418517020E-001 3.011857656810514E-001 2.839134948471927E-001 2.674453543448088E-001 + 2.517553426397708E-001 2.368175911266718E-001 2.226064193043215E-001 2.090963856924619E-001 + 1.962623345388483E-001 1.840794383899594E-001 1.725232366207477E-001 1.615696700388903E-001 + 1.511951116968792E-001 1.413763940608610E-001 1.320908326984295E-001 1.233162466585174E-001 + 1.150309757251445E-001 1.072138947331223E-001 9.984442513788835E-002 9.290254403357785E-002 + 8.636879081330652E-002 8.022427166355021E-002 7.445066208063483E-002 6.903020759181530E-002 + 6.394572285643356E-002 5.918058931437520E-002 5.471875153969888E-002 5.054471244712146E-002 + 4.664352748820030E-002 4.300079796281249E-002 3.960266356008539E-002 3.643579423150409E-002 + 3.348738148771539E-002 3.074512919973049E-002 2.819724397497777E-002 2.583242516909822E-002 + 2.363985458562404E-002 2.160918590782129E-002 1.973053390005569E-002 1.799446341009169E-002 + 1.639197819875241E-002 1.491450961932547E-002 1.355390516595688E-002 1.230241690795810E-002 + 1.115268982538878E-002 1.009775006037289E-002 9.130993098265329E-003 8.246171892909172E-003 + 7.437384950707605E-003 6.699064388984371E-003 6.025963985028384E-003 5.413147233227065E-003 + 4.855975428714141E-003 4.350095796921757E-003 3.891429689281100E-003 3.476160866011855E-003 + 3.100723887444692E-003 2.761792635607746E-003 2.456268987860445E-003 2.181271664169866E-003 + 1.934125269195867E-003 1.712349549687695E-003 1.513648886810273E-003 1.335902041928791E-003 + 1.177152173107029E-003 1.035597138141127E-003 9.095800983813123E-004 7.975804359164222E-004 + 6.982049949357855E-004 6.101796562673717E-004 5.323412522454973E-004 4.636298272103285E-004 + 4.030812471082376E-004 3.498201598676332E-004 3.030533064886101E-004 2.620631811234451E-004 + 2.262020368533378E-004 1.948862323972449E-004 1.675909136311306E-004 1.438450225583165E-004 + 1.232266252593443E-004 1.053585493664076E-004 8.990432075449645E-005 7.656438841862418E-005 + 6.507262591203287E-005 5.519309725068169E-005 4.671707483999613E-005 3.946029674504452E-005 + 3.326045049833026E-005 2.797487061285973E-005 2.347843703406808E-005 1.966166191418986E-005 + 1.642895231811492E-005 1.369703676192384E-005 1.139354383544059E-005 9.455721559682359E-006 + 7.829286570680156E-006 6.467392695023346E-006 5.329708981121490E-006 4.381597768188554E-006 + 3.593383903842351E-006 2.939706756071335E-006 2.398947200293272E-006 1.952722292436584E-006 + 1.585440860103848E-006 1.283913752182306E-006 1.037012979688743E-006 8.353744541081522E-007 + 6.711394827256097E-007 5.377306109250567E-007 4.296578085190342E-007 3.423513799272013E-007 + 2.720183360519935E-007 2.155192989388144E-007 1.702633189914308E-007 1.341189941825629E-007 + 1.053430416137545E-007 8.250164706248678E-008 6.442516024375438E-008 5.016293969008727E-008 + 3.894469424568933E-008 3.014819036176702E-008 2.327236202334659E-008 1.791499093686525E-008 + 1.375424011646401E-008 1.053342563710948E-008 8.048500403931213E-009 6.137801576873579E-009 + 4.673680961086374E-009 3.555696222094797E-009 2.705092010401698E-009 2.050710202213143E-009 + 1.549072556928544E-009 1.165908751825222E-009 8.743042091315888E-010 6.531988365311785E-010 + 4.861747861348464E-010 3.604813255627143E-010 2.662534700774652E-010 1.958883197675274E-010 + 1.435492384301916E-010 1.047732440351428E-010 7.616138313606007E-011 5.513554840468232E-011 + 3.974827183177851E-011 2.853457636723849E-011 2.039707511629042E-011 1.451723882766705E-011 + 1.028716928879450E-011 7.257370110087801E-012 5.096941581754378E-012 3.563380621620248E-012 + 2.479772335443879E-012 1.717643374504510E-012 1.184131713642948E-012 8.124315251013267E-013 + 5.547110933241880E-013 3.768890540057167E-013 2.548001699451448E-013 1.713949440664316E-013 + 1.147045515072835E-013 7.636942969912139E-014 5.058086422120955E-014 3.332360207401035E-014 + 2.183672303944284E-014 1.423191347249975E-014 9.224642166703026E-015 5.945876660183951E-015 + 3.810936814741767E-015 2.428656268013420E-015 1.538818466438771E-015 9.693127950493447E-016 + 6.069648071643465E-016 3.777926215694329E-016 2.337226531938202E-016 1.437050680789771E-016 + 8.780787169520823E-017 5.331514935702778E-017 3.216539719278915E-017 1.928027293303637E-017 + 1.148121443838776E-017 6.791674254266361E-018 3.990651116583259E-018 2.328904270031712E-018 + 1.349780290556214E-018 7.768554820825256E-019 4.439609363842891E-019 2.519056091632093E-019 + 1.418992729941321E-019 7.934726491569431E-020 4.404056861384094E-020 2.426063931613628E-020 + 1.326290390461898E-020 7.194825016371130E-021 3.872618619604420E-021 2.067993744085588E-021 + 1.095494725288831E-021 5.756307370596395E-022 2.999892976520704E-022 1.550424324575166E-022 + 7.945711171469990E-023 4.037440668994160E-023 2.033873418747260E-023 1.015637431893515E-023 + 5.026926285978212E-024 2.465850837928393E-024 1.198622351949128E-024 5.772971691064510E-025 + 2.754657097349085E-025 1.302074000989469E-025 6.096100202842944E-026 2.826600869372837E-026 + 1.297836063685569E-026 5.900169363239212E-027 2.655486311549716E-027 1.183051310409795E-027 + 5.216597216804307E-028 2.276348892617197E-028 9.828811870290515E-029 4.198711689539671E-029 + 1.774293071017529E-029 7.415998426107355E-030 3.065411811481451E-030 1.252916561940014E-030 + 5.063001282824324E-031 2.022479615329171E-031 7.985229061298544E-032 3.115686865019586E-032 + 1.201209376976367E-032 4.575268475181235E-033 1.721397084391520E-033 6.396537790950949E-034 + 2.347146934903795E-034 8.503507629296820E-035 3.041226086924514E-035 1.073547981734032E-035 + 3.739769662295298E-036 1.285424231248403E-036 4.358660341050868E-037 1.457774163724139E-037 + 4.808205014547398E-038 1.563705974195900E-038 5.013367389606135E-039 1.584266523563092E-039 + 4.933694059135546E-040 1.513845055862697E-040 4.575882464134242E-041 1.362292855611254E-041 + 3.993789889331086E-042 1.152749521427470E-042 3.275175085366430E-043 9.157937731156533E-044 + 2.519632030924495E-044 6.819686390488435E-045 1.815473870457028E-045 4.752512410907514E-046 + 1.223129321733529E-046 3.094171667328168E-047 7.692105337250774E-048 1.878795575081948E-048 + 4.507656584757881E-049 1.062090170441730E-049 2.457040356126323E-050 5.579603490058104E-051 + 1.243463631110288E-051 2.718934970795873E-052 5.831718139995266E-053 1.226650621347121E-053 + 2.529678043447530E-054 5.113539869592847E-055 1.012933018039598E-055 1.965765822736715E-056 + 3.736480290882348E-057 6.954404671032851E-058 1.267093385342866E-058 2.259395727226271E-059 + 3.941786920562265E-060 6.726541295152905E-061 1.122451215597719E-061 1.831039765431450E-062 + 2.919166223832182E-063 4.547002286966594E-064 6.917828495160245E-065 1.027694556185183E-065 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 +/ diff --git a/tests/apps/miniDFT/tests/benchmark/O.pz.nml b/tests/apps/miniDFT/tests/benchmark/O.pz.nml new file mode 100644 index 0000000000..b3a1652446 --- /dev/null +++ b/tests/apps/miniDFT/tests/benchmark/O.pz.nml @@ -0,0 +1,1651 @@ + +&header + generated="Generated using JLMartins code" + author = "Renata Wentzcovitch" + date = "before 1998" + comment = "Oxygen LDA 2s2 2p4 l=1 local Martins-Troullier" + psd = " O" + typ = "NC" + rel = "no" + tvanp = .false. + tpawp = .false. + tcoulombp= .false. + has_so = .false. + has_wfc = .false. + has_gipaw= .false. + nlcc = .false. + dft = "PZ " + zp = 6.000000000000000E+000 + etotps = 0.000000000000000E+000 + ecutwfc = 0.000000000000000E+000 + ecutrho = 0.000000000000000E+000 + nv = "0" + lmax = 0 + lmax_rho = 0 + lloc = 1 + nmesh = 921 + nwfc = 2 + nbeta = 1 +/ + +&mesh + dx = 2.439988682353512E-002 + nmesh = 921 + xmin =-5.075173815233827E+000 + rmax = 7.842409574286100E+001 + zmesh = 8.000000000000000E+000 + r(1:921) = + 3.09844022083E-04 3.14212345306E-04 3.18642255154E-04 3.23134619905E-04 + 3.27690320075E-04 3.32310248597E-04 3.36995310992E-04 3.41746425546E-04 + 3.46564523494E-04 3.51450549198E-04 3.56405460335E-04 3.61430228083E-04 + 3.66525837313E-04 3.71693286780E-04 3.76933589321E-04 3.82247772053E-04 + 3.87636876572E-04 3.93101959159E-04 3.98644090989E-04 4.04264358337E-04 + 4.09963862793E-04 4.15743721479E-04 4.21605067265E-04 4.27549048994E-04 + 4.33576831706E-04 4.39689596864E-04 4.45888542591E-04 4.52174883900E-04 + 4.58549852934E-04 4.65014699206E-04 4.71570689849E-04 4.78219109856E-04 + 4.84961262340E-04 4.91798468784E-04 4.98732069302E-04 5.05763422903E-04 + 5.12893907753E-04 5.20124921451E-04 5.27457881299E-04 5.34894224581E-04 + 5.42435408842E-04 5.50082912181E-04 5.57838233531E-04 5.65702892961E-04 + 5.73678431968E-04 5.81766413785E-04 5.89968423682E-04 5.98286069278E-04 + 6.06720980859E-04 6.15274811695E-04 6.23949238364E-04 6.32745961081E-04 + 6.41666704031E-04 6.50713215710E-04 6.59887269263E-04 6.69190662832E-04 + 6.78625219914E-04 6.88192789712E-04 6.97895247500E-04 7.07734494990E-04 + 7.17712460707E-04 7.27831100364E-04 7.38092397246E-04 7.48498362602E-04 + 7.59051036032E-04 7.69752485896E-04 7.80604809711E-04 7.91610134568E-04 + 8.02770617546E-04 8.14088446134E-04 8.25565838664E-04 8.37205044742E-04 + 8.49008345688E-04 8.60978054988E-04 8.73116518743E-04 8.85426116132E-04 + 8.97909259873E-04 9.10568396704E-04 9.23406007855E-04 9.36424609541E-04 + 9.49626753447E-04 9.63015027238E-04 9.76592055056E-04 9.90360498044E-04 + 1.00432305486E-03 1.01848246221E-03 1.03284149538E-03 1.04740296880E-03 + 1.06216973654E-03 1.07714469296E-03 1.09233077318E-03 1.10773095374E-03 + 1.12334825310E-03 1.13918573232E-03 1.15524649559E-03 1.17153369088E-03 + 1.18805051051E-03 1.20480019185E-03 1.22178601788E-03 1.23901131789E-03 + 1.25647946808E-03 1.27419389227E-03 1.29215806254E-03 1.31037549992E-03 + 1.32884977510E-03 1.34758450909E-03 1.36658337396E-03 1.38585009354E-03 + 1.40538844418E-03 1.42520225546E-03 1.44529541093E-03 1.46567184894E-03 + 1.48633556332E-03 1.50729060423E-03 1.52854107892E-03 1.55009115256E-03 + 1.57194504902E-03 1.59410705175E-03 1.61658150456E-03 1.63937281252E-03 + 1.66248544281E-03 1.68592392556E-03 1.70969285479E-03 1.73379688931E-03 + 1.75824075356E-03 1.78302923862E-03 1.80816720313E-03 1.83365957420E-03 + 1.85951134841E-03 1.88572759280E-03 1.91231344584E-03 1.93927411843E-03 + 1.96661489496E-03 1.99434113431E-03 2.02245827090E-03 2.05097181579E-03 + 2.07988735772E-03 2.10921056422E-03 2.13894718276E-03 2.16910304178E-03 + 2.19968405195E-03 2.23069620724E-03 2.26214558612E-03 2.29403835278E-03 + 2.32638075830E-03 2.35917914189E-03 2.39243993215E-03 2.42616964830E-03 + 2.46037490147E-03 2.49506239599E-03 2.53023893073E-03 2.56591140039E-03 + 2.60208679691E-03 2.63877221077E-03 2.67597483244E-03 2.71370195373E-03 + 2.75196096930E-03 2.79075937802E-03 2.83010478452E-03 2.87000490062E-03 + 2.91046754686E-03 2.95150065406E-03 2.99311226484E-03 3.03531053521E-03 + 3.07810373615E-03 3.12150025528E-03 3.16550859846E-03 3.21013739145E-03 + 3.25539538166E-03 3.30129143977E-03 3.34783456158E-03 3.39503386968E-03 + 3.44289861529E-03 3.49143818004E-03 3.54066207786E-03 3.59057995678E-03 + 3.64120160087E-03 3.69253693212E-03 3.74459601244E-03 3.79738904556E-03 + 3.85092637909E-03 3.90521850652E-03 3.96027606928E-03 4.01610985883E-03 + 4.07273081877E-03 4.13015004699E-03 4.18837879783E-03 4.24742848433E-03 + 4.30731068041E-03 4.36803712318E-03 4.42961971520E-03 4.49207052687E-03 + 4.55540179874E-03 4.61962594395E-03 4.68475555063E-03 4.75080338440E-03 + 4.81778239084E-03 4.88570569805E-03 4.95458661922E-03 5.02443865523E-03 + 5.09527549730E-03 5.16711102967E-03 5.23995933236E-03 5.31383468384E-03 + 5.38875156394E-03 5.46472465659E-03 5.54176885278E-03 5.61989925339E-03 + 5.69913117225E-03 5.77948013907E-03 5.86096190250E-03 5.94359243322E-03 + 6.02738792709E-03 6.11236480828E-03 6.19853973255E-03 6.28592959045E-03 + 6.37455151067E-03 6.46442286339E-03 6.55556126370E-03 6.64798457499E-03 + 6.74171091254E-03 6.83675864702E-03 6.93314640808E-03 7.03089308803E-03 + 7.13001784553E-03 7.23054010935E-03 7.33247958219E-03 7.43585624450E-03 + 7.54069035843E-03 7.64700247182E-03 7.75481342217E-03 7.86414434078E-03 + 7.97501665685E-03 8.08745210172E-03 8.20147271310E-03 8.31710083938E-03 + 8.43435914405E-03 8.55327061011E-03 8.67385854460E-03 8.79614658313E-03 + 8.92015869455E-03 9.04591918563E-03 9.17345270583E-03 9.30278425212E-03 + 9.43393917392E-03 9.56694317799E-03 9.70182233355E-03 9.83860307735E-03 + 9.97731221885E-03 1.01179769455E-02 1.02606248280E-02 1.04052838258E-02 + 1.05519822926E-02 1.07007489816E-02 1.08516130518E-02 1.10046040728E-02 + 1.11597520315E-02 1.13170873372E-02 1.14766408284E-02 1.16384437778E-02 + 1.18025278995E-02 1.19689253545E-02 1.21376687571E-02 1.23087911817E-02 + 1.24823261688E-02 1.26583077317E-02 1.28367703635E-02 1.30177490434E-02 + 1.32012792438E-02 1.33873969371E-02 1.35761386031E-02 1.37675412358E-02 + 1.39616423506E-02 1.41584799919E-02 1.43580927407E-02 1.45605197217E-02 + 1.47658006111E-02 1.49739756447E-02 1.51850856255E-02 1.53991719317E-02 + 1.56162765248E-02 1.58364419582E-02 1.60597113849E-02 1.62861285664E-02 + 1.65157378812E-02 1.67485843336E-02 1.69847135621E-02 1.72241718488E-02 + 1.74670061284E-02 1.77132639971E-02 1.79629937222E-02 1.82162442516E-02 + 1.84730652232E-02 1.87335069747E-02 1.89976205536E-02 1.92654577269E-02 + 1.95370709916E-02 1.98125135847E-02 2.00918394940E-02 2.03751034681E-02 + 2.06623610277E-02 2.09536684762E-02 2.12490829108E-02 2.15486622337E-02 + 2.18524651634E-02 2.21605512462E-02 2.24729808680E-02 2.27898152660E-02 + 2.31111165408E-02 2.34369476683E-02 2.37673725127E-02 2.41024558381E-02 + 2.44422633221E-02 2.47868615679E-02 2.51363181179E-02 2.54907014668E-02 + 2.58500810747E-02 2.62145273813E-02 2.65841118192E-02 2.69589068281E-02 + 2.73389858690E-02 2.77244234387E-02 2.81152950842E-02 2.85116774175E-02 + 2.89136481308E-02 2.93212860117E-02 2.97346709586E-02 3.01538839961E-02 + 3.05790072915E-02 3.10101241702E-02 3.14473191325E-02 3.18906778700E-02 + 3.23402872825E-02 3.27962354948E-02 3.32586118742E-02 3.37275070481E-02 + 3.42030129213E-02 3.46852226945E-02 3.51742308825E-02 3.56701333323E-02 + 3.61730272424E-02 3.66830111816E-02 3.72001851085E-02 3.77246503908E-02 + 3.82565098253E-02 3.87958676582E-02 3.93428296053E-02 3.98975028731E-02 + 4.04599961791E-02 4.10304197738E-02 4.16088854623E-02 4.21955066254E-02 + 4.27903982430E-02 4.33936769156E-02 4.40054608877E-02 4.46258700711E-02 + 4.52550260679E-02 4.58930521947E-02 4.65400735066E-02 4.71962168220E-02 + 4.78616107469E-02 4.85363857007E-02 4.92206739416E-02 4.99146095920E-02 + 5.06183286658E-02 5.13319690940E-02 5.20556707525E-02 5.27895754892E-02 + 5.35338271516E-02 5.42885716155E-02 5.50539568132E-02 5.58301327628E-02 + 5.66172515971E-02 5.74154675939E-02 5.82249372062E-02 5.90458190926E-02 + 5.98782741486E-02 6.07224655380E-02 6.15785587250E-02 6.24467215067E-02 + 6.33271240457E-02 6.42199389037E-02 6.51253410754E-02 6.60435080224E-02 + 6.69746197084E-02 6.79188586343E-02 6.88764098739E-02 6.98474611104E-02 + 7.08322026728E-02 7.18308275737E-02 7.28435315467E-02 7.38705130852E-02 + 7.49119734807E-02 7.59681168628E-02 7.70391502390E-02 7.81252835353E-02 + 7.92267296373E-02 8.03437044319E-02 8.14764268498E-02 8.26251189082E-02 + 8.37900057545E-02 8.49713157100E-02 8.61692803155E-02 8.73841343758E-02 + 8.86161160062E-02 8.98654666790E-02 9.11324312710E-02 9.24172581112E-02 + 9.37201990299E-02 9.50415094076E-02 9.63814482254E-02 9.77402781157E-02 + 9.91182654133E-02 1.00515680208E-01 1.01932796398E-01 1.03369891743E-01 + 1.04827247917E-01 1.06305150568E-01 1.07803889368E-01 1.09323758075E-01 + 1.10865054590E-01 1.12428081009E-01 1.14013143693E-01 1.15620553318E-01 + 1.17250624941E-01 1.18903678063E-01 1.20580036685E-01 1.22280029381E-01 + 1.24003989355E-01 1.25752254507E-01 1.27525167503E-01 1.29323075841E-01 + 1.31146331916E-01 1.32995293091E-01 1.34870321770E-01 1.36771785463E-01 + 1.38700056864E-01 1.40655513921E-01 1.42638539908E-01 1.44649523506E-01 + 1.46688858874E-01 1.48756945728E-01 1.50854189419E-01 1.52981001014E-01 + 1.55137797375E-01 1.57325001241E-01 1.59543041311E-01 1.61792352328E-01 + 1.64073375164E-01 1.66386556907E-01 1.68732350947E-01 1.71111217068E-01 + 1.73523621536E-01 1.75970037189E-01 1.78450943533E-01 1.80966826833E-01 + 1.83518180210E-01 1.86105503738E-01 1.88729304541E-01 1.91390096892E-01 + 1.94088402314E-01 1.96824749684E-01 1.99599675336E-01 2.02413723163E-01 + 2.05267444727E-01 2.08161399368E-01 2.11096154310E-01 2.14072284773E-01 + 2.17090374090E-01 2.20151013815E-01 2.23254803844E-01 2.26402352529E-01 + 2.29594276799E-01 2.32831202283E-01 2.36113763428E-01 2.39442603627E-01 + 2.42818375342E-01 2.46241740236E-01 2.49713369300E-01 2.53233942984E-01 + 2.56804151330E-01 2.60424694113E-01 2.64096280970E-01 2.67819631543E-01 + 2.71595475621E-01 2.75424553282E-01 2.79307615037E-01 2.83245421979E-01 + 2.87238745930E-01 2.91288369595E-01 2.95395086713E-01 2.99559702214E-01 + 3.03783032375E-01 3.08065904983E-01 3.12409159495E-01 3.16813647202E-01 + 3.21280231398E-01 3.25809787549E-01 3.30403203460E-01 3.35061379457E-01 + 3.39785228557E-01 3.44575676650E-01 3.49433662679E-01 3.54360138824E-01 + 3.59356070690E-01 3.64422437497E-01 3.69560232268E-01 3.74770462028E-01 + 3.80054147999E-01 3.85412325799E-01 3.90846045648E-01 3.96356372574E-01 + 4.01944386618E-01 4.07611183048E-01 4.13357872575E-01 4.19185581569E-01 + 4.25095452278E-01 4.31088643057E-01 4.37166328590E-01 4.43329700123E-01 + 4.49579965696E-01 4.55918350382E-01 4.62346096524E-01 4.68864463981E-01 + 4.75474730375E-01 4.82178191337E-01 4.88976160769E-01 4.95869971093E-01 + 5.02860973520E-01 5.09950538306E-01 5.17140055031E-01 5.24430932863E-01 + 5.31824600836E-01 5.39322508133E-01 5.46926124369E-01 5.54636939875E-01 + 5.62456465998E-01 5.70386235389E-01 5.78427802307E-01 5.86582742927E-01 + 5.94852655642E-01 6.03239161382E-01 6.11743903929E-01 6.20368550240E-01 + 6.29114790772E-01 6.37984339817E-01 6.46978935835E-01 6.56100341796E-01 + 6.65350345525E-01 6.74730760051E-01 6.84243423966E-01 6.93890201783E-01 + 7.03672984300E-01 7.13593688976E-01 7.23654260298E-01 7.33856670173E-01 + 7.44202918304E-01 7.54695032590E-01 7.65335069518E-01 7.76125114569E-01 + 7.87067282628E-01 7.98163718394E-01 8.09416596804E-01 8.20828123458E-01 + 8.32400535053E-01 8.44136099816E-01 8.56037117958E-01 8.68105922116E-01 + 8.80344877813E-01 8.92756383924E-01 9.05342873145E-01 9.18106812467E-01 + 9.31050703664E-01 9.44177083779E-01 9.57488525626E-01 9.70987638288E-01 + 9.84677067637E-01 9.98559496842E-01 1.01263764691E+00 1.02691427719E+00 + 1.04139218596E+00 1.05607421093E+00 1.07096322983E+00 1.08606216095E+00 + 1.10137396373E+00 1.11690163934E+00 1.13264823124E+00 1.14861682582E+00 + 1.16481055297E+00 1.18123258672E+00 1.19788614585E+00 1.21477449449E+00 + 1.23190094282E+00 1.24926884767E+00 1.26688161323E+00 1.28474269163E+00 + 1.30285558371E+00 1.32122383966E+00 1.33985105972E+00 1.35874089487E+00 + 1.37789704758E+00 1.39732327253E+00 1.41702337731E+00 1.43700122321E+00 + 1.45726072595E+00 1.47780585646E+00 1.49864064164E+00 1.51976916519E+00 + 1.54119556836E+00 1.56292405080E+00 1.58495887135E+00 1.60730434892E+00 + 1.62996486329E+00 1.65294485598E+00 1.67624883116E+00 1.69988135648E+00 + 1.72384706398E+00 1.74815065103E+00 1.77279688120E+00 1.79779058524E+00 + 1.82313666199E+00 1.84884007935E+00 1.87490587530E+00 1.90133915879E+00 + 1.92814511085E+00 1.95532898552E+00 1.98289611094E+00 2.01085189034E+00 + 2.03920180314E+00 2.06795140603E+00 2.09710633402E+00 2.12667230156E+00 + 2.15665510368E+00 2.18706061710E+00 2.21789480141E+00 2.24916370019E+00 + 2.28087344227E+00 2.31303024284E+00 2.34564040474E+00 2.37871031967E+00 + 2.41224646944E+00 2.44625542724E+00 2.48074385893E+00 2.51571852436E+00 + 2.55118627868E+00 2.58715407367E+00 2.62362895915E+00 2.66061808430E+00 + 2.69812869911E+00 2.73616815579E+00 2.77474391018E+00 2.81386352326E+00 + 2.85353466260E+00 2.89376510387E+00 2.93456273237E+00 2.97593554455E+00 + 3.01789164963E+00 3.06043927114E+00 3.10358674853E+00 3.14734253887E+00 + 3.19171521842E+00 3.23671348437E+00 3.28234615652E+00 3.32862217903E+00 + 3.37555062215E+00 3.42314068399E+00 3.47140169236E+00 3.52034310658E+00 + 3.56997451932E+00 3.62030565849E+00 3.67134638916E+00 3.72310671548E+00 + 3.77559678263E+00 3.82882687884E+00 3.88280743737E+00 3.93754903859E+00 + 3.99306241203E+00 4.04935843849E+00 4.10644815216E+00 4.16434274282E+00 + 4.22305355798E+00 4.28259210516E+00 4.34297005411E+00 4.40419923909E+00 + 4.46629166122E+00 4.52925949081E+00 4.59311506976E+00 4.65787091397E+00 + 4.72353971579E+00 4.79013434652E+00 4.85766785892E+00 4.92615348976E+00 + 4.99560466246E+00 5.06603498967E+00 5.13745827595E+00 5.20988852050E+00 + 5.28333991988E+00 5.35782687080E+00 5.43336397294E+00 5.50996603181E+00 + 5.58764806166E+00 5.66642528842E+00 5.74631315268E+00 5.82732731271E+00 + 5.90948364755E+00 5.99279826010E+00 6.07728748030E+00 6.16296786830E+00 + 6.24985621773E+00 6.33796955899E+00 6.42732516257E+00 6.51794054245E+00 + 6.60983345956E+00 6.70302192518E+00 6.79752420455E+00 6.89335882043E+00 + 6.99054455671E+00 7.08910046210E+00 7.18904585388E+00 7.29040032166E+00 + 7.39318373124E+00 7.49741622849E+00 7.60311824334E+00 7.71031049370E+00 + 7.81901398959E+00 7.92925003727E+00 8.04104024333E+00 8.15440651902E+00 + 8.26937108450E+00 8.38595647318E+00 8.50418553618E+00 8.62408144676E+00 + 8.74566770492E+00 8.86896814195E+00 8.99400692513E+00 9.12080856245E+00 + 9.24939790746E+00 9.37980016406E+00 9.51204089153E+00 9.64614600946E+00 + 9.78214180289E+00 9.92005492742E+00 1.00599124145E+01 1.02017416766E+01 + 1.03455705127E+01 1.04914271138E+01 1.06393400682E+01 1.07893383672E+01 + 1.09414514112E+01 1.10957090146E+01 1.12521414126E+01 1.14107792662E+01 + 1.15716536692E+01 1.17347961533E+01 1.19002386950E+01 1.20680137216E+01 + 1.22381541175E+01 1.24106932308E+01 1.25856648798E+01 1.27631033593E+01 + 1.29430434479E+01 1.31255204145E+01 1.33105700251E+01 1.34982285501E+01 + 1.36885327710E+01 1.38815199882E+01 1.40772280278E+01 1.42756952491E+01 + 1.44769605524E+01 1.46810633863E+01 1.48880437556E+01 1.50979422292E+01 + 1.53107999477E+01 1.55266586321E+01 1.57455605913E+01 1.59675487308E+01 + 1.61926665609E+01 1.64209582055E+01 1.66524684105E+01 1.68872425526E+01 + 1.71253266483E+01 1.73667673629E+01 1.76116120194E+01 1.78599086083E+01 + 1.81117057965E+01 1.83670529370E+01 1.86260000786E+01 1.88885979759E+01 + 1.91548980989E+01 1.94249526432E+01 1.96988145404E+01 1.99765374684E+01 + 2.02581758616E+01 2.05437849221E+01 2.08334206303E+01 2.11271397556E+01 + 2.14249998679E+01 2.17270593488E+01 2.20333774029E+01 2.23440140695E+01 + 2.26590302344E+01 2.29784876417E+01 2.33024489062E+01 2.36309775253E+01 + 2.39641378916E+01 2.43019953057E+01 2.46446159886E+01 2.49920670952E+01 + 2.53444167269E+01 2.57017339455E+01 2.60640887861E+01 2.64315522717E+01 + 2.68041964260E+01 2.71820942887E+01 2.75653199289E+01 2.79539484601E+01 + 2.83480560546E+01 2.87477199589E+01 2.91530185083E+01 2.95640311427E+01 + 2.99808384218E+01 3.04035220412E+01 3.08321648483E+01 3.12668508584E+01 + 3.17076652714E+01 3.21546944882E+01 3.26080261281E+01 3.30677490456E+01 + 3.35339533477E+01 3.40067304120E+01 3.44861729043E+01 3.49723747970E+01 + 3.54654313870E+01 3.59654393152E+01 3.64724965846E+01 3.69867025801E+01 + 3.75081580877E+01 3.80369653143E+01 3.85732279079E+01 3.91170509777E+01 + 3.96685411147E+01 4.02278064128E+01 4.07949564897E+01 4.13701025087E+01 + 4.19533572002E+01 4.25448348840E+01 4.31446514916E+01 4.37529245891E+01 + 4.43697733999E+01 4.49953188282E+01 4.56296834832E+01 4.62729917021E+01 + 4.69253695756E+01 4.75869449717E+01 4.82578475614E+01 4.89382088437E+01 + 4.96281621716E+01 5.03278427782E+01 5.10373878031E+01 5.17569363194E+01 + 5.24866293608E+01 5.32266099497E+01 5.39770231245E+01 5.47380159687E+01 + 5.55097376392E+01 5.62923393960E+01 5.70859746315E+01 5.78907989008E+01 + 5.87069699520E+01 5.95346477573E+01 6.03739945441E+01 6.12251748271E+01 + 6.20883554404E+01 6.29637055702E+01 6.38513967878E+01 6.47516030835E+01 + 6.56645009008E+01 6.65902691705E+01 6.75290893461E+01 6.84811454394E+01 + 6.94466240564E+01 7.04257144341E+01 7.14186084773E+01 7.24255007963E+01 + 7.34465887454E+01 7.44820724610E+01 7.55321549012E+01 7.65970418857E+01 + 7.76769421355E+01 7.87720673147E+01 7.98826320712E+01 8.10088540793E+01 + 8.21509540822E+01 8.33091559351E+01 8.44836866493E+01 8.56747764365E+01 + 8.68826587541E+01 8.81075703510E+01 8.93497513138E+01 9.06094451139E+01 + 9.18868986552E+01 9.31823623229E+01 9.44960900319E+01 9.58283392771E+01 + 9.71793711835E+01 9.85494505578E+01 9.99388459399E+01 1.01347829656E+02 + 1.02776677871E+02 1.04225670643E+02 1.05695091981E+02 1.07185229896E+02 + 1.08696376458E+02 1.10228827858E+02 1.11782884462E+02 1.13358850868E+02 + 1.14957035973E+02 1.16577753024E+02 1.18221319688E+02 1.19888058110E+02 + 1.21578294974E+02 + + rab(1:921) = + 4.33781630917E-06 4.39897283428E-06 4.46099157216E-06 4.52388467866E-06 + 4.58766448105E-06 4.65234348036E-06 4.71793435388E-06 4.78444995765E-06 + 4.85190332892E-06 4.92030768877E-06 4.98967644469E-06 5.06002319316E-06 + 5.13136172238E-06 5.20370601492E-06 5.27707025050E-06 5.35146880874E-06 + 5.42691627200E-06 5.50342742822E-06 5.58101727384E-06 5.65970101671E-06 + 5.73949407910E-06 5.82041210070E-06 5.90247094171E-06 5.98568668592E-06 + 6.07007564388E-06 6.15565435610E-06 6.24243959628E-06 6.33044837460E-06 + 6.41969794107E-06 6.51020578889E-06 6.60198965789E-06 6.69506753799E-06 + 6.78945767277E-06 6.88517856298E-06 6.98224897023E-06 7.08068792064E-06 + 7.18051470854E-06 7.28174890032E-06 7.38441033819E-06 7.48851914413E-06 + 7.59409572379E-06 7.70116077053E-06 7.80973526943E-06 7.91984050145E-06 + 8.03149804756E-06 8.14472979300E-06 8.25955793155E-06 8.37600496990E-06 + 8.49409373203E-06 8.61384736373E-06 8.73528933709E-06 8.85844345513E-06 + 8.98333385644E-06 9.10998501994E-06 9.23842176968E-06 9.36866927965E-06 + 9.50075307880E-06 9.63469905597E-06 9.77053346499E-06 9.90828292986E-06 + 1.00479744499E-05 1.01896354051E-05 1.03332935614E-05 1.04789770764E-05 + 1.06267145045E-05 1.07765348025E-05 1.09284673360E-05 1.10825418840E-05 + 1.12387886456E-05 1.13972382459E-05 1.15579217413E-05 1.17208706264E-05 + 1.18861168396E-05 1.20536927698E-05 1.22236312624E-05 1.23959656258E-05 + 1.25707296382E-05 1.27479575539E-05 1.29276841100E-05 1.31099445336E-05 + 1.32947745483E-05 1.34822103813E-05 1.36722887708E-05 1.38650469726E-05 + 1.40605227680E-05 1.42587544709E-05 1.44597809354E-05 1.46636415631E-05 + 1.48703763116E-05 1.50800257014E-05 1.52926308246E-05 1.55082333523E-05 + 1.57268755434E-05 1.59486002525E-05 1.61734509383E-05 1.64014716723E-05 + 1.66327071472E-05 1.68672026859E-05 1.71050042504E-05 1.73461584505E-05 + 1.75907125531E-05 1.78387144917E-05 1.80902128755E-05 1.83452569989E-05 + 1.86038968514E-05 1.88661831273E-05 1.91321672354E-05 1.94019013096E-05 + 1.96754382186E-05 1.99528315764E-05 2.02341357531E-05 2.05194058851E-05 + 2.08086978865E-05 2.11020684592E-05 2.13995751049E-05 2.17012761358E-05 + 2.20072306863E-05 2.23174987245E-05 2.26321410638E-05 2.29512193753E-05 + 2.32747961993E-05 2.36029349578E-05 2.39356999671E-05 2.42731564503E-05 + 2.46153705498E-05 2.49624093407E-05 2.53143408438E-05 2.56712340388E-05 + 2.60331588778E-05 2.64001862993E-05 2.67723882418E-05 2.71498376581E-05 + 2.75326085295E-05 2.79207758803E-05 2.83144157926E-05 2.87136054210E-05 + 2.91184230080E-05 2.95289478991E-05 2.99452605586E-05 3.03674425850E-05 + 3.07955767273E-05 3.12297469013E-05 3.16700382057E-05 3.21165369389E-05 + 3.25693306162E-05 3.30285079865E-05 3.34941590502E-05 3.39663750762E-05 + 3.44452486205E-05 3.49308735438E-05 3.54233450302E-05 3.59227596055E-05 + 3.64292151568E-05 3.69428109508E-05 3.74636476541E-05 3.79918273522E-05 + 3.85274535702E-05 3.90706312923E-05 3.96214669833E-05 4.01800686086E-05 + 4.07465456561E-05 4.13210091569E-05 4.19035717078E-05 4.24943474929E-05 + 4.30934523061E-05 4.37010035740E-05 4.43171203784E-05 4.49419234804E-05 + 4.55755353432E-05 4.62180801568E-05 4.68696838621E-05 4.75304741755E-05 + 4.82005806140E-05 4.88801345206E-05 4.95692690900E-05 5.02681193949E-05 + 5.09768224121E-05 5.16955170497E-05 5.24243441741E-05 5.31634466379E-05 + 5.39129693073E-05 5.46730590913E-05 5.54438649700E-05 5.62255380237E-05 + 5.70182314628E-05 5.78221006578E-05 5.86373031697E-05 5.94639987807E-05 + 6.03023495258E-05 6.11525197245E-05 6.20146760128E-05 6.28889873761E-05 + 6.37756251824E-05 6.46747632153E-05 6.55865777088E-05 6.65112473816E-05 + 6.74489534717E-05 6.83998797727E-05 6.93642126690E-05 7.03421411732E-05 + 7.13338569621E-05 7.23395544154E-05 7.33594306530E-05 7.43936855738E-05 + 7.54425218952E-05 7.65061451923E-05 7.75847639389E-05 7.86785895475E-05 + 7.97878364116E-05 8.09127219470E-05 8.20534666350E-05 8.32102940651E-05 + 8.43834309792E-05 8.55731073160E-05 8.67795562557E-05 8.80030142663E-05 + 8.92437211494E-05 9.05019200875E-05 9.17778576917E-05 9.30717840499E-05 + 9.43839527756E-05 9.57146210583E-05 9.70640497131E-05 9.84325032324E-05 + 9.98202498374E-05 1.01227561531E-04 1.02654714151E-04 1.04101987423E-04 + 1.05569665018E-04 1.07058034605E-04 1.08567387910E-04 1.10098020771E-04 + 1.11650233196E-04 1.13224329424E-04 1.14820617983E-04 1.16439411751E-04 + 1.18081028017E-04 1.19745788542E-04 1.21434019624E-04 1.23146052164E-04 + 1.24882221724E-04 1.26642868599E-04 1.28428337882E-04 1.30238979530E-04 + 1.32075148435E-04 1.33937204492E-04 1.35825512670E-04 1.37740443083E-04 + 1.39682371064E-04 1.41651677237E-04 1.43648747592E-04 1.45673973561E-04 + 1.47727752096E-04 1.49810485743E-04 1.51922582725E-04 1.54064457019E-04 + 1.56236528440E-04 1.58439222721E-04 1.60672971597E-04 1.62938212890E-04 + 1.65235390594E-04 1.67564954963E-04 1.69927362600E-04 1.72323076544E-04 + 1.74752566363E-04 1.77216308244E-04 1.79714785089E-04 1.82248486608E-04 + 1.84817909413E-04 1.87423557120E-04 1.90065940444E-04 1.92745577301E-04 + 1.95462992908E-04 1.98218719887E-04 2.01013298370E-04 2.03847276104E-04 + 2.06721208555E-04 2.09635659026E-04 2.12591198757E-04 2.15588407043E-04 + 2.18627871348E-04 2.21710187415E-04 2.24835959388E-04 2.28005799929E-04 + 2.31220330337E-04 2.34480180670E-04 2.37785989869E-04 2.41138405884E-04 + 2.44538085798E-04 2.47985695959E-04 2.51481912111E-04 2.55027419523E-04 + 2.58622913125E-04 2.62269097646E-04 2.65966687750E-04 2.69716408176E-04 + 2.73518993882E-04 2.77375190186E-04 2.81285752916E-04 2.85251448553E-04 + 2.89273054388E-04 2.93351358667E-04 2.97487160752E-04 3.01681271272E-04 + 3.05934512288E-04 3.10247717447E-04 3.14621732152E-04 3.19057413724E-04 + 3.23555631571E-04 3.28117267357E-04 3.32743215178E-04 3.37434381734E-04 + 3.42191686509E-04 3.47016061951E-04 3.51908453651E-04 3.56869820535E-04 + 3.61901135046E-04 3.67003383338E-04 3.72177565469E-04 3.77424695593E-04 + 3.82745802166E-04 3.88141928142E-04 3.93614131178E-04 3.99163483844E-04 + 4.04791073831E-04 4.10498004164E-04 4.16285393420E-04 4.22154375946E-04 + 4.28106102081E-04 4.34141738383E-04 4.40262467855E-04 4.46469490180E-04 + 4.52764021954E-04 4.59147296927E-04 4.65620566239E-04 4.72185098673E-04 + 4.78842180898E-04 4.85593117724E-04 4.92439232355E-04 4.99381866652E-04 + 5.06422381393E-04 5.13562156543E-04 5.20802591519E-04 5.28145105471E-04 + 5.35591137554E-04 5.43142147215E-04 5.50799614475E-04 5.58565040223E-04 + 5.66439946507E-04 5.74425876834E-04 5.82524396472E-04 5.90737092756E-04 + 5.99065575402E-04 6.07511476818E-04 6.16076452428E-04 6.24762180996E-04 + 6.33570364951E-04 6.42502730726E-04 6.51561029093E-04 6.60747035508E-04 + 6.70062550456E-04 6.79509399810E-04 6.89089435182E-04 6.98804534289E-04 + 7.08656601321E-04 7.18647567317E-04 7.28779390536E-04 7.39054056848E-04 + 7.49473580122E-04 7.60040002617E-04 7.70755395385E-04 7.81621858679E-04 + 7.92641522359E-04 8.03816546315E-04 8.15149120887E-04 8.26641467297E-04 + 8.38295838080E-04 8.50114517532E-04 8.62099822150E-04 8.74254101094E-04 + 8.86579736640E-04 8.99079144652E-04 9.11754775056E-04 9.24609112314E-04 + 9.37644675918E-04 9.50864020880E-04 9.64269738235E-04 9.77864455545E-04 + 9.91650837419E-04 1.00563158603E-03 1.01980944165E-03 1.03418718319E-03 + 1.04876762873E-03 1.06355363608E-03 1.07854810335E-03 1.09375396949E-03 + 1.10917421492E-03 1.12481186205E-03 1.14066997590E-03 1.15675166472E-03 + 1.17306008056E-03 1.18959841994E-03 1.20636992442E-03 1.22337788126E-03 + 1.24062562409E-03 1.25811653351E-03 1.27585403779E-03 1.29384161356E-03 + 1.31208278642E-03 1.33058113171E-03 1.34934027516E-03 1.36836389362E-03 + 1.38765571579E-03 1.40721952292E-03 1.42705914958E-03 1.44717848440E-03 + 1.46758147084E-03 1.48827210795E-03 1.50925445115E-03 1.53053261306E-03 + 1.55211076426E-03 1.57399313413E-03 1.59618401170E-03 1.61868774645E-03 + 1.64150874918E-03 1.66465149288E-03 1.68812051360E-03 1.71192041134E-03 + 1.73605585096E-03 1.76053156309E-03 1.78535234505E-03 1.81052306177E-03 + 1.83604864682E-03 1.86193410327E-03 1.88818450478E-03 1.91480499648E-03 + 1.94180079610E-03 1.96917719489E-03 1.99693955872E-03 2.02509332909E-03 + 2.05364402424E-03 2.08259724019E-03 2.11195865186E-03 2.14173401419E-03 + 2.17192916325E-03 2.20255001738E-03 2.23360257836E-03 2.26509293259E-03 + 2.29702725229E-03 2.32941179669E-03 2.36225291326E-03 2.39555703896E-03 + 2.42933070151E-03 2.46358052065E-03 2.49831320946E-03 2.53353557566E-03 + 2.56925452294E-03 2.60547705234E-03 2.64221026358E-03 2.67946135648E-03 + 2.71723763239E-03 2.75554649558E-03 2.79439545470E-03 2.83379212428E-03 + 2.87374422618E-03 2.91425959116E-03 2.95534616034E-03 2.99701198683E-03 + 3.03926523726E-03 3.08211419341E-03 3.12556725381E-03 3.16963293540E-03 + 3.21431987519E-03 3.25963683197E-03 3.30559268800E-03 3.35219645077E-03 + 3.39945725479E-03 3.44738436331E-03 3.49598717020E-03 3.54527520177E-03 + 3.59525811863E-03 3.64594571759E-03 3.69734793358E-03 3.74947484160E-03 + 3.80233665869E-03 3.85594374595E-03 3.91030661052E-03 3.96543590770E-03 + 4.02134244302E-03 4.07803717433E-03 4.13553121399E-03 4.19383583099E-03 + 4.25296245325E-03 4.31292266977E-03 4.37372823293E-03 4.43539106083E-03 + 4.49792323958E-03 4.56133702568E-03 4.62564484844E-03 4.69085931240E-03 + 4.75699319980E-03 4.82405947310E-03 4.89207127750E-03 4.96104194353E-03 + 5.03098498966E-03 5.10191412496E-03 5.17384325176E-03 5.24678646840E-03 + 5.32075807198E-03 5.39577256118E-03 5.47184463908E-03 5.54898921604E-03 + 5.62722141265E-03 5.70655656267E-03 5.78701021605E-03 5.86859814196E-03 + 5.95133633189E-03 6.03524100280E-03 6.12032860026E-03 6.20661580172E-03 + 6.29411951975E-03 6.38285690535E-03 6.47284535134E-03 6.56410249574E-03 + 6.65664622525E-03 6.75049467872E-03 6.84566625076E-03 6.94217959531E-03 + 7.04005362927E-03 7.13930753629E-03 7.23996077044E-03 7.34203306008E-03 + 7.44554441170E-03 7.55051511386E-03 7.65696574116E-03 7.76491715826E-03 + 7.87439052397E-03 7.98540729544E-03 8.09798923230E-03 8.21215840098E-03 + 8.32793717899E-03 8.44534825935E-03 8.56441465501E-03 8.68515970335E-03 + 8.80760707081E-03 8.93178075744E-03 9.05770510170E-03 9.18540478515E-03 + 9.31490483735E-03 9.44623064071E-03 9.57940793552E-03 9.71446282496E-03 + 9.85142178020E-03 9.99031164566E-03 1.01311596442E-02 1.02739933824E-02 + 1.04188408563E-02 1.05657304563E-02 1.07146909732E-02 1.08657516040E-02 + 1.10189419568E-02 1.11742920575E-02 1.13318323553E-02 1.14915937284E-02 + 1.16536074907E-02 1.18179053974E-02 1.19845196514E-02 1.21534829096E-02 + 1.23248282894E-02 1.24985893749E-02 1.26748002240E-02 1.28534953745E-02 + 1.30347098513E-02 1.32184791729E-02 1.34048393588E-02 1.35938269360E-02 + 1.37854789469E-02 1.39798329558E-02 1.41769270567E-02 1.43767998807E-02 + 1.45794906035E-02 1.47850389531E-02 1.49934852177E-02 1.52048702533E-02 + 1.54192354923E-02 1.56366229507E-02 1.58570752373E-02 1.60806355614E-02 + 1.63073477416E-02 1.65372562141E-02 1.67704060418E-02 1.70068429228E-02 + 1.72466131994E-02 1.74897638674E-02 1.77363425852E-02 1.79863976828E-02 + 1.82399781720E-02 1.84971337553E-02 1.87579148360E-02 1.90223725281E-02 + 1.92905586661E-02 1.95625258154E-02 1.98383272823E-02 2.01180171249E-02 + 2.04016501633E-02 2.06892819904E-02 2.09809689830E-02 2.12767683127E-02 + 2.15767379571E-02 2.18809367112E-02 2.21894241990E-02 2.25022608849E-02 + 2.28195080860E-02 2.31412279838E-02 2.34674836363E-02 2.37983389907E-02 + 2.41338588958E-02 2.44741091144E-02 2.48191563368E-02 2.51690681933E-02 + 2.55239132678E-02 2.58837611109E-02 2.62486822541E-02 2.66187482231E-02 + 2.69940315519E-02 2.73746057973E-02 2.77605455531E-02 2.81519264647E-02 + 2.85488252440E-02 2.89513196845E-02 2.93594886762E-02 2.97734122218E-02 + 3.01931714515E-02 3.06188486394E-02 3.10505272197E-02 3.14882918027E-02 + 3.19322281917E-02 3.23824233997E-02 3.28389656663E-02 3.33019444754E-02 + 3.37714505721E-02 3.42475759813E-02 3.47304140250E-02 3.52200593411E-02 + 3.57166079015E-02 3.62201570314E-02 3.67308054281E-02 3.72486531802E-02 + 3.77738017876E-02 3.83063541810E-02 3.88464147425E-02 3.93940893257E-02 + 3.99494852765E-02 4.05127114542E-02 4.10838782532E-02 4.16630976238E-02 + 4.22504830948E-02 4.28461497959E-02 4.34502144795E-02 4.40627955442E-02 + 4.46840130579E-02 4.53139887812E-02 4.59528461913E-02 4.66007105065E-02 + 4.72577087101E-02 4.79239695758E-02 4.85996236931E-02 4.92848034921E-02 + 4.99796432705E-02 5.06842792189E-02 5.13988494483E-02 5.21234940167E-02 + 5.28583549568E-02 5.36035763037E-02 5.43593041232E-02 5.51256865403E-02 + 5.59028737685E-02 5.66910181388E-02 5.74902741302E-02 5.83007983994E-02 + 5.91227498117E-02 5.99562894723E-02 6.08015807575E-02 6.16587893472E-02 + 6.25280832570E-02 6.34096328713E-02 6.43036109767E-02 6.52101927956E-02 + 6.61295560211E-02 6.70618808513E-02 6.80073500248E-02 6.89661488567E-02 + 6.99384652745E-02 7.09244898554E-02 7.19244158633E-02 7.29384392871E-02 + 7.39667588784E-02 7.50095761912E-02 7.60670956212E-02 7.71395244453E-02 + 7.82270728633E-02 7.93299540379E-02 8.04483841375E-02 8.15825823779E-02 + 8.27327710657E-02 8.38991756414E-02 8.50820247242E-02 8.62815501562E-02 + 8.74979870482E-02 8.87315738258E-02 8.99825522759E-02 9.12511675944E-02 + 9.25376684338E-02 9.38423069525E-02 9.51653388637E-02 9.65070234861E-02 + 9.78676237940E-02 9.92474064694E-02 1.00646641954E-01 1.02065604503E-01 + 1.03504572237E-01 1.04963827199E-01 1.06443655407E-01 1.07944346912E-01 + 1.09466195854E-01 1.11009500522E-01 1.12574563407E-01 1.14161691266E-01 + 1.15771195183E-01 1.17403390625E-01 1.19058597506E-01 1.20737140255E-01 + 1.22439347869E-01 1.24165553987E-01 1.25916096952E-01 1.27691319874E-01 + 1.29491570704E-01 1.31317202297E-01 1.33168572481E-01 1.35046044132E-01 + 1.36949985240E-01 1.38880768984E-01 1.40838773803E-01 1.42824383472E-01 + 1.44837987178E-01 1.46879979593E-01 1.48950760954E-01 1.51050737141E-01 + 1.53180319757E-01 1.55339926205E-01 1.57529979776E-01 1.59750909727E-01 + 1.62003151369E-01 1.64287146146E-01 1.66603341730E-01 1.68952192102E-01 + 1.71334157645E-01 1.73749705232E-01 1.76199308317E-01 1.78683447030E-01 + 1.81202608271E-01 1.83757285803E-01 1.86347980352E-01 1.88975199701E-01 + 1.91639458794E-01 1.94341279835E-01 1.97081192389E-01 1.99859733487E-01 + 2.02677447733E-01 2.05534887408E-01 2.08432612578E-01 2.11371191208E-01 + 2.14351199268E-01 2.17373220850E-01 2.20437848278E-01 2.23545682231E-01 + 2.26697331852E-01 2.29893414877E-01 2.33134557747E-01 2.36421395736E-01 + 2.39754573076E-01 2.43134743080E-01 2.46562568272E-01 2.50038720517E-01 + 2.53563881151E-01 2.57138741117E-01 2.60764001101E-01 2.64440371663E-01 + 2.68168573384E-01 2.71949337005E-01 2.75783403566E-01 2.79671524557E-01 + 2.83614462062E-01 2.87612988910E-01 2.91667888824E-01 2.95779956579E-01 + 2.99949998151E-01 3.04178830884E-01 3.08467283641E-01 3.12816196973E-01 + 3.17226423282E-01 3.21698826984E-01 3.26234284687E-01 3.30833685354E-01 + 3.35497930483E-01 3.40227934279E-01 3.45024623841E-01 3.49888939333E-01 + 3.54821834177E-01 3.59824275236E-01 3.64897243006E-01 3.70041731803E-01 + 3.75258749965E-01 3.80549320042E-01 3.85914479005E-01 3.91355278441E-01 + 3.96872784764E-01 4.02468079424E-01 4.08142259116E-01 4.13896435997E-01 + 4.19731737905E-01 4.25649308577E-01 4.31650307876E-01 4.37735912018E-01 + 4.43907313799E-01 4.50165722835E-01 4.56512365794E-01 4.62948486638E-01 + 4.69475346868E-01 4.76094225768E-01 4.82806420661E-01 4.89613247158E-01 + 4.96516039419E-01 5.03516150413E-01 5.10614952184E-01 5.17813836121E-01 + 5.25114213227E-01 5.32517514400E-01 5.40025190711E-01 5.47638713688E-01 + 5.55359575606E-01 5.63189289779E-01 5.71129390856E-01 5.79181435121E-01 + 5.87347000802E-01 5.95627688376E-01 6.04025120883E-01 6.12540944247E-01 + 6.21176827598E-01 6.29934463595E-01 6.38815568764E-01 6.47821883830E-01 + 6.56955174058E-01 6.66217229604E-01 6.75609865860E-01 6.85134923812E-01 + 6.94794270403E-01 7.04589798895E-01 7.14523429243E-01 7.24597108471E-01 + 7.34812811052E-01 7.45172539296E-01 7.55678323743E-01 7.66332223561E-01 + 7.77136326948E-01 7.88092751543E-01 7.99203644841E-01 8.10471184611E-01 + 8.21897579328E-01 8.33485068602E-01 8.45235923617E-01 8.57152447580E-01 + 8.69236976166E-01 8.81491877982E-01 8.93919555029E-01 9.06522443170E-01 + 9.19303012611E-01 9.32263768387E-01 9.45407250845E-01 9.58736036151E-01 + 9.72252736790E-01 9.85960002077E-01 9.99860518682E-01 1.01395701115E+00 + 1.02825224244E+00 1.04274901445E+00 1.05745016862E+00 1.07235858640E+00 + 1.08747718990E+00 1.10280894241E+00 1.11835684900E+00 1.13412395711E+00 + 1.15011335715E+00 1.16632818309E+00 1.18277161309E+00 1.19944687011E+00 + 1.21635722256E+00 1.23350598491E+00 1.25089651839E+00 1.26853223159E+00 + 1.28641658117E+00 1.30455307252E+00 1.32294526045E+00 1.34159674988E+00 + 1.36051119657E+00 1.37969230781E+00 1.39914384316E+00 1.41886961518E+00 + 1.43887349019E+00 1.45915938901E+00 1.47973128774E+00 1.50059321854E+00 + 1.52174927041E+00 1.54320359002E+00 1.56496038247E+00 1.58702391216E+00 + 1.60939850362E+00 1.63208854234E+00 1.65509847564E+00 1.67843281353E+00 + 1.70209612964E+00 +/ + +&local +vloc(1:921) = + -3.03300020000E+01 -3.03300020000E+01 -3.03300020000E+01 -3.03300020000E+01 + -3.03300020000E+01 -3.03300020000E+01 -3.03300020000E+01 -3.03300020000E+01 + -3.03300020000E+01 -3.03300020000E+01 -3.03300020000E+01 -3.03300020000E+01 + -3.03300020000E+01 -3.03300020000E+01 -3.03300020000E+01 -3.03300020000E+01 + -3.03300020000E+01 -3.03300020000E+01 -3.03300020000E+01 -3.03300020000E+01 + -3.03300010000E+01 -3.03300010000E+01 -3.03300010000E+01 -3.03300010000E+01 + -3.03300010000E+01 -3.03300010000E+01 -3.03300010000E+01 -3.03300010000E+01 + -3.03300010000E+01 -3.03300010000E+01 -3.03300010000E+01 -3.03300010000E+01 + -3.03300010000E+01 -3.03300010000E+01 -3.03300010000E+01 -3.03300010000E+01 + -3.03300010000E+01 -3.03300010000E+01 -3.03300000000E+01 -3.03300000000E+01 + -3.03300000000E+01 -3.03300000000E+01 -3.03300000000E+01 -3.03300000000E+01 + -3.03300000000E+01 -3.03300000000E+01 -3.03300000000E+01 -3.03300000000E+01 + -3.03300000000E+01 -3.03299990000E+01 -3.03299990000E+01 -3.03299990000E+01 + -3.03299990000E+01 -3.03299990000E+01 -3.03299990000E+01 -3.03299990000E+01 + -3.03299990000E+01 -3.03299990000E+01 -3.03299980000E+01 -3.03299980000E+01 + -3.03299980000E+01 -3.03299980000E+01 -3.03299980000E+01 -3.03299980000E+01 + -3.03299980000E+01 -3.03299970000E+01 -3.03299970000E+01 -3.03299970000E+01 + -3.03299970000E+01 -3.03299970000E+01 -3.03299970000E+01 -3.03299960000E+01 + -3.03299960000E+01 -3.03299960000E+01 -3.03299960000E+01 -3.03299960000E+01 + -3.03299950000E+01 -3.03299950000E+01 -3.03299950000E+01 -3.03299950000E+01 + -3.03299940000E+01 -3.03299940000E+01 -3.03299940000E+01 -3.03299940000E+01 + -3.03299930000E+01 -3.03299930000E+01 -3.03299930000E+01 -3.03299930000E+01 + -3.03299920000E+01 -3.03299920000E+01 -3.03299920000E+01 -3.03299910000E+01 + -3.03299910000E+01 -3.03299910000E+01 -3.03299900000E+01 -3.03299900000E+01 + -3.03299900000E+01 -3.03299890000E+01 -3.03299890000E+01 -3.03299880000E+01 + -3.03299880000E+01 -3.03299870000E+01 -3.03299870000E+01 -3.03299870000E+01 + -3.03299860000E+01 -3.03299860000E+01 -3.03299850000E+01 -3.03299850000E+01 + -3.03299840000E+01 -3.03299840000E+01 -3.03299830000E+01 -3.03299820000E+01 + -3.03299820000E+01 -3.03299810000E+01 -3.03299810000E+01 -3.03299800000E+01 + -3.03299790000E+01 -3.03299790000E+01 -3.03299780000E+01 -3.03299770000E+01 + -3.03299760000E+01 -3.03299760000E+01 -3.03299750000E+01 -3.03299740000E+01 + -3.03299730000E+01 -3.03299720000E+01 -3.03299720000E+01 -3.03299710000E+01 + -3.03299700000E+01 -3.03299690000E+01 -3.03299680000E+01 -3.03299670000E+01 + -3.03299660000E+01 -3.03299650000E+01 -3.03299640000E+01 -3.03299630000E+01 + -3.03299610000E+01 -3.03299600000E+01 -3.03299590000E+01 -3.03299580000E+01 + -3.03299570000E+01 -3.03299550000E+01 -3.03299540000E+01 -3.03299520000E+01 + -3.03299510000E+01 -3.03299500000E+01 -3.03299480000E+01 -3.03299460000E+01 + -3.03299450000E+01 -3.03299430000E+01 -3.03299410000E+01 -3.03299400000E+01 + -3.03299380000E+01 -3.03299360000E+01 -3.03299340000E+01 -3.03299320000E+01 + -3.03299300000E+01 -3.03299280000E+01 -3.03299260000E+01 -3.03299240000E+01 + -3.03299220000E+01 -3.03299190000E+01 -3.03299170000E+01 -3.03299140000E+01 + -3.03299120000E+01 -3.03299090000E+01 -3.03299070000E+01 -3.03299040000E+01 + -3.03299010000E+01 -3.03298980000E+01 -3.03298950000E+01 -3.03298920000E+01 + -3.03298890000E+01 -3.03298860000E+01 -3.03298820000E+01 -3.03298790000E+01 + -3.03298750000E+01 -3.03298720000E+01 -3.03298680000E+01 -3.03298640000E+01 + -3.03298600000E+01 -3.03298560000E+01 -3.03298520000E+01 -3.03298480000E+01 + -3.03298430000E+01 -3.03298390000E+01 -3.03298340000E+01 -3.03298290000E+01 + -3.03298240000E+01 -3.03298190000E+01 -3.03298140000E+01 -3.03298090000E+01 + -3.03298030000E+01 -3.03297980000E+01 -3.03297920000E+01 -3.03297860000E+01 + -3.03297800000E+01 -3.03297730000E+01 -3.03297670000E+01 -3.03297600000E+01 + -3.03297530000E+01 -3.03297460000E+01 -3.03297390000E+01 -3.03297310000E+01 + -3.03297230000E+01 -3.03297160000E+01 -3.03297070000E+01 -3.03296990000E+01 + -3.03296900000E+01 -3.03296810000E+01 -3.03296720000E+01 -3.03296630000E+01 + -3.03296530000E+01 -3.03296430000E+01 -3.03296330000E+01 -3.03296230000E+01 + -3.03296120000E+01 -3.03296010000E+01 -3.03295890000E+01 -3.03295770000E+01 + -3.03295650000E+01 -3.03295530000E+01 -3.03295400000E+01 -3.03295270000E+01 + -3.03295130000E+01 -3.03295000000E+01 -3.03294850000E+01 -3.03294710000E+01 + -3.03294550000E+01 -3.03294400000E+01 -3.03294240000E+01 -3.03294070000E+01 + -3.03293910000E+01 -3.03293730000E+01 -3.03293550000E+01 -3.03293370000E+01 + -3.03293180000E+01 -3.03292990000E+01 -3.03292790000E+01 -3.03292580000E+01 + -3.03292370000E+01 -3.03292150000E+01 -3.03291930000E+01 -3.03291700000E+01 + -3.03291460000E+01 -3.03291220000E+01 -3.03290970000E+01 -3.03290710000E+01 + -3.03290440000E+01 -3.03290170000E+01 -3.03289890000E+01 -3.03289600000E+01 + -3.03289310000E+01 -3.03289000000E+01 -3.03288690000E+01 -3.03288370000E+01 + -3.03288040000E+01 -3.03287700000E+01 -3.03287350000E+01 -3.03286980000E+01 + -3.03286610000E+01 -3.03286230000E+01 -3.03285840000E+01 -3.03285440000E+01 + -3.03285020000E+01 -3.03284600000E+01 -3.03284160000E+01 -3.03283710000E+01 + -3.03283250000E+01 -3.03282770000E+01 -3.03282280000E+01 -3.03281770000E+01 + -3.03281260000E+01 -3.03280720000E+01 -3.03280170000E+01 -3.03279610000E+01 + -3.03279030000E+01 -3.03278430000E+01 -3.03277820000E+01 -3.03277190000E+01 + -3.03276540000E+01 -3.03275870000E+01 -3.03275190000E+01 -3.03274480000E+01 + -3.03273760000E+01 -3.03273010000E+01 -3.03272240000E+01 -3.03271450000E+01 + -3.03270640000E+01 -3.03269810000E+01 -3.03268950000E+01 -3.03268070000E+01 + -3.03267160000E+01 -3.03266220000E+01 -3.03265260000E+01 -3.03264280000E+01 + -3.03263260000E+01 -3.03262220000E+01 -3.03261140000E+01 -3.03260040000E+01 + -3.03258900000E+01 -3.03257730000E+01 -3.03256530000E+01 -3.03255300000E+01 + -3.03254030000E+01 -3.03252720000E+01 -3.03251380000E+01 -3.03249990000E+01 + -3.03248570000E+01 -3.03247110000E+01 -3.03245610000E+01 -3.03244060000E+01 + -3.03242470000E+01 -3.03240840000E+01 -3.03239150000E+01 -3.03237420000E+01 + -3.03235650000E+01 -3.03233820000E+01 -3.03231930000E+01 -3.03230000000E+01 + -3.03228010000E+01 -3.03225960000E+01 -3.03223860000E+01 -3.03221700000E+01 + -3.03219470000E+01 -3.03217180000E+01 -3.03214830000E+01 -3.03212400000E+01 + -3.03209910000E+01 -3.03207350000E+01 -3.03204720000E+01 -3.03202010000E+01 + -3.03199230000E+01 -3.03196360000E+01 -3.03193410000E+01 -3.03190380000E+01 + -3.03187270000E+01 -3.03184060000E+01 -3.03180770000E+01 -3.03177380000E+01 + -3.03173890000E+01 -3.03170300000E+01 -3.03166610000E+01 -3.03162820000E+01 + -3.03158920000E+01 -3.03154910000E+01 -3.03150780000E+01 -3.03146540000E+01 + -3.03142170000E+01 -3.03137680000E+01 -3.03133070000E+01 -3.03128320000E+01 + -3.03123430000E+01 -3.03118410000E+01 -3.03113240000E+01 -3.03107930000E+01 + -3.03102460000E+01 -3.03096840000E+01 -3.03091060000E+01 -3.03085110000E+01 + -3.03079000000E+01 -3.03072710000E+01 -3.03066230000E+01 -3.03059580000E+01 + -3.03052730000E+01 -3.03045690000E+01 -3.03038450000E+01 -3.03031000000E+01 + -3.03023340000E+01 -3.03015460000E+01 -3.03007350000E+01 -3.02999010000E+01 + -3.02990430000E+01 -3.02981610000E+01 -3.02972530000E+01 -3.02963200000E+01 + -3.02953590000E+01 -3.02943710000E+01 -3.02933550000E+01 -3.02923100000E+01 + -3.02912340000E+01 -3.02901280000E+01 -3.02889900000E+01 -3.02878190000E+01 + -3.02866140000E+01 -3.02853750000E+01 -3.02841000000E+01 -3.02827880000E+01 + -3.02814390000E+01 -3.02800500000E+01 -3.02786210000E+01 -3.02771520000E+01 + -3.02756390000E+01 -3.02740830000E+01 -3.02724820000E+01 -3.02708340000E+01 + -3.02691380000E+01 -3.02673940000E+01 -3.02655980000E+01 -3.02637510000E+01 + -3.02618490000E+01 -3.02598920000E+01 -3.02578780000E+01 -3.02558050000E+01 + -3.02536710000E+01 -3.02514750000E+01 -3.02492140000E+01 -3.02468870000E+01 + -3.02444910000E+01 -3.02420250000E+01 -3.02394860000E+01 -3.02368720000E+01 + -3.02341810000E+01 -3.02314090000E+01 -3.02285560000E+01 -3.02256170000E+01 + -3.02225910000E+01 -3.02194740000E+01 -3.02162640000E+01 -3.02129570000E+01 + -3.02095510000E+01 -3.02060420000E+01 -3.02024270000E+01 -3.01987030000E+01 + -3.01948650000E+01 -3.01909100000E+01 -3.01868350000E+01 -3.01826340000E+01 + -3.01783050000E+01 -3.01738420000E+01 -3.01692410000E+01 -3.01644970000E+01 + -3.01596060000E+01 -3.01545620000E+01 -3.01493590000E+01 -3.01439930000E+01 + -3.01384580000E+01 -3.01327470000E+01 -3.01268540000E+01 -3.01207730000E+01 + -3.01144970000E+01 -3.01080190000E+01 -3.01013310000E+01 -3.00944250000E+01 + -3.00872940000E+01 -3.00799300000E+01 -3.00723220000E+01 -3.00644630000E+01 + -3.00563420000E+01 -3.00479490000E+01 -3.00392740000E+01 -3.00303070000E+01 + -3.00210350000E+01 -3.00114460000E+01 -3.00015280000E+01 -2.99912690000E+01 + -2.99806530000E+01 -2.99696670000E+01 -2.99582960000E+01 -2.99465240000E+01 + -2.99343340000E+01 -2.99217100000E+01 -2.99086320000E+01 -2.98950840000E+01 + -2.98810440000E+01 -2.98664910000E+01 -2.98514060000E+01 -2.98357630000E+01 + -2.98195410000E+01 -2.98027130000E+01 -2.97852550000E+01 -2.97671380000E+01 + -2.97483340000E+01 -2.97288130000E+01 -2.97085440000E+01 -2.96874950000E+01 + -2.96656310000E+01 -2.96429160000E+01 -2.96193130000E+01 -2.95947830000E+01 + -2.95692840000E+01 -2.95427740000E+01 -2.95152080000E+01 -2.94865400000E+01 + -2.94567210000E+01 -2.94256990000E+01 -2.93934220000E+01 -2.93598330000E+01 + -2.93248750000E+01 -2.92884880000E+01 -2.92506080000E+01 -2.92111700000E+01 + -2.91701070000E+01 -2.91273450000E+01 -2.90828130000E+01 -2.90364310000E+01 + -2.89881210000E+01 -2.89378000000E+01 -2.88853810000E+01 -2.88307750000E+01 + -2.87738900000E+01 -2.87146300000E+01 -2.86528950000E+01 -2.85885820000E+01 + -2.85215860000E+01 -2.84517960000E+01 -2.83791010000E+01 -2.83033840000E+01 + -2.82245250000E+01 -2.81424020000E+01 -2.80568880000E+01 -2.79678550000E+01 + -2.78751690000E+01 -2.77786950000E+01 -2.76782970000E+01 -2.75738320000E+01 + -2.74651590000E+01 -2.73521320000E+01 -2.72346040000E+01 -2.71124280000E+01 + -2.69854550000E+01 -2.68535330000E+01 -2.67165140000E+01 -2.65742480000E+01 + -2.64265840000E+01 -2.62733760000E+01 -2.61144770000E+01 -2.59497460000E+01 + -2.57790430000E+01 -2.56022350000E+01 -2.54191920000E+01 -2.52297900000E+01 + -2.50339160000E+01 -2.48314610000E+01 -2.46223230000E+01 -2.44064220000E+01 + -2.41836820000E+01 -2.39540420000E+01 -2.37174580000E+01 -2.34738990000E+01 + -2.32233520000E+01 -2.29658270000E+01 -2.27013430000E+01 -2.24299570000E+01 + -2.21517460000E+01 -2.18668130000E+01 -2.15752840000E+01 -2.12773160000E+01 + -2.09730970000E+01 -2.06628450000E+01 -2.03468060000E+01 -2.00252610000E+01 + -1.96985460000E+01 -1.93670170000E+01 -1.90310690000E+01 -1.86911360000E+01 + -1.83476870000E+01 -1.80012310000E+01 -1.76523140000E+01 -1.73014990000E+01 + -1.69494300000E+01 -1.65967620000E+01 -1.62441850000E+01 -1.58924190000E+01 + -1.55422110000E+01 -1.51943360000E+01 -1.48495920000E+01 -1.45087830000E+01 + -1.41727460000E+01 -1.38423310000E+01 -1.35183810000E+01 -1.32017350000E+01 + -1.28932250000E+01 -1.25936660000E+01 -1.23038500000E+01 -1.20245360000E+01 + -1.17564420000E+01 -1.15002390000E+01 -1.12565330000E+01 -1.10258510000E+01 + -1.08086410000E+01 -1.06052480000E+01 -1.04159070000E+01 -1.02407270000E+01 + -1.00797070000E+01 -9.93263010000E+00 -9.79913280000E+00 -9.67858710000E+00 + -9.57027020000E+00 -9.47324580000E+00 -9.38630430000E+00 -9.30801740000E+00 + -9.23677610000E+00 -9.17069910000E+00 -9.10767730000E+00 -9.04550660000E+00 + -8.98190590000E+00 -8.91461020000E+00 -8.84149900000E+00 -8.76076660000E+00 + -8.67113700000E+00 -8.57207960000E+00 -8.46431740000E+00 -8.35032210000E+00 + -8.23463490000E+00 -8.12015220000E+00 -8.00726070000E+00 -7.89593840000E+00 + -7.78616360000E+00 -7.67791890000E+00 -7.57117890000E+00 -7.46592190000E+00 + -7.36212740000E+00 -7.25977530000E+00 -7.15884560000E+00 -7.05931870000E+00 + -6.96117530000E+00 -6.86439830000E+00 -6.76896840000E+00 -6.67486430000E+00 + -6.58206770000E+00 -6.49056060000E+00 -6.40032510000E+00 -6.31134380000E+00 + -6.22359930000E+00 -6.13707500000E+00 -6.05175680000E+00 -5.96762380000E+00 + -5.88465980000E+00 -5.80284850000E+00 -5.72217420000E+00 -5.64262100000E+00 + -5.56417360000E+00 -5.48681670000E+00 -5.41053780000E+00 -5.33531950000E+00 + -5.26114620000E+00 -5.18800350000E+00 -5.11587710000E+00 -5.04475320000E+00 + -4.97461780000E+00 -4.90545730000E+00 -4.83725960000E+00 -4.77001140000E+00 + -4.70369740000E+00 -4.63830470000E+00 -4.57382070000E+00 -4.51023290000E+00 + -4.44752880000E+00 -4.38569630000E+00 -4.32472360000E+00 -4.26460090000E+00 + -4.20531340000E+00 -4.14684960000E+00 -4.08919820000E+00 -4.03234800000E+00 + -3.97628780000E+00 -3.92100690000E+00 -3.86649440000E+00 -3.81274150000E+00 + -3.75973610000E+00 -3.70746700000E+00 -3.65592420000E+00 -3.60509770000E+00 + -3.55497750000E+00 -3.50555390000E+00 -3.45681740000E+00 -3.40875920000E+00 + -3.36137020000E+00 -3.31463950000E+00 -3.26855810000E+00 -3.22311700000E+00 + -3.17830740000E+00 -3.13412060000E+00 -3.09054800000E+00 -3.04758120000E+00 + -3.00521340000E+00 -2.96343430000E+00 -2.92223560000E+00 -2.88160930000E+00 + -2.84154760000E+00 -2.80204270000E+00 -2.76308690000E+00 -2.72467260000E+00 + -2.68679350000E+00 -2.64944120000E+00 -2.61260790000E+00 -2.57628630000E+00 + -2.54046940000E+00 -2.50515030000E+00 -2.47032210000E+00 -2.43597800000E+00 + -2.40211200000E+00 -2.36871750000E+00 -2.33578700000E+00 -2.30331400000E+00 + -2.27129220000E+00 -2.23971540000E+00 -2.20857750000E+00 -2.17787230000E+00 + -2.14759410000E+00 -2.11773810000E+00 -2.08829680000E+00 -2.05926460000E+00 + -2.03063580000E+00 -2.00240480000E+00 -1.97456610000E+00 -1.94711440000E+00 + -1.92004430000E+00 -1.89335140000E+00 -1.86702970000E+00 -1.84107360000E+00 + -1.81547830000E+00 -1.79023850000E+00 -1.76534960000E+00 -1.74080660000E+00 + -1.71660470000E+00 -1.69273970000E+00 -1.66920700000E+00 -1.64600130000E+00 + -1.62311790000E+00 -1.60055250000E+00 -1.57830080000E+00 -1.55635820000E+00 + -1.53472070000E+00 -1.51338400000E+00 -1.49234480000E+00 -1.47159790000E+00 + -1.45113920000E+00 -1.43096480000E+00 -1.41107080000E+00 -1.39145320000E+00 + -1.37210830000E+00 -1.35303240000E+00 -1.33422220000E+00 -1.31567360000E+00 + -1.29738270000E+00 -1.27934590000E+00 -1.26155980000E+00 -1.24402080000E+00 + -1.22672570000E+00 -1.20967090000E+00 -1.19285350000E+00 -1.17627030000E+00 + -1.15991750000E+00 -1.14379190000E+00 -1.12789030000E+00 -1.11220970000E+00 + -1.09674710000E+00 -1.08149940000E+00 -1.06646370000E+00 -1.05163760000E+00 + -1.03701750000E+00 -1.02260050000E+00 -1.00838390000E+00 -9.94364780000E-01 + -9.80540520000E-01 -9.66908410000E-01 -9.53465790000E-01 -9.40210460000E-01 + -9.27139490000E-01 -9.14250110000E-01 -9.01539820000E-01 -8.89006150000E-01 + -8.76646670000E-01 -8.64458970000E-01 -8.52440680000E-01 -8.40589660000E-01 + -8.28903670000E-01 -8.17380030000E-01 -8.06016500000E-01 -7.94810870000E-01 + -7.83760960000E-01 -7.72864630000E-01 -7.62119750000E-01 -7.51524250000E-01 + -7.41076500000E-01 -7.30773890000E-01 -7.20614410000E-01 -7.10596110000E-01 + -7.00717020000E-01 -6.90975230000E-01 -6.81368840000E-01 -6.71895990000E-01 + -6.62555110000E-01 -6.53344150000E-01 -6.44261160000E-01 -6.35304370000E-01 + -6.26472050000E-01 -6.17762470000E-01 -6.09173940000E-01 -6.00704790000E-01 + -5.92353520000E-01 -5.84118540000E-01 -5.75997970000E-01 -5.67990230000E-01 + -5.60093750000E-01 -5.52307010000E-01 -5.44628500000E-01 -5.37056710000E-01 + -5.29590190000E-01 -5.22227780000E-01 -5.14967650000E-01 -5.07808390000E-01 + -5.00748610000E-01 -4.93786940000E-01 -4.86922010000E-01 -4.80152510000E-01 + -4.73477100000E-01 -4.66894700000E-01 -4.60403840000E-01 -4.54002850000E-01 + -4.47691090000E-01 -4.41467090000E-01 -4.35329610000E-01 -4.29277460000E-01 + -4.23309450000E-01 -4.17424410000E-01 -4.11621180000E-01 -4.05898640000E-01 + -4.00255650000E-01 -3.94691110000E-01 -3.89203940000E-01 -3.83793050000E-01 + -3.78457380000E-01 -3.73195900000E-01 -3.68007560000E-01 -3.62891350000E-01 + -3.57846270000E-01 -3.52871320000E-01 -3.47965550000E-01 -3.43127970000E-01 + -3.38357650000E-01 -3.33653650000E-01 -3.29015040000E-01 -3.24440930000E-01 + -3.19930400000E-01 -3.15482580000E-01 -3.11096600000E-01 -3.06771590000E-01 + -3.02506710000E-01 -2.98301130000E-01 -2.94154010000E-01 -2.90064550000E-01 + -2.86031940000E-01 -2.82055390000E-01 -2.78134130000E-01 -2.74267380000E-01 + -2.70454390000E-01 -2.66694410000E-01 -2.62986700000E-01 -2.59330540000E-01 + -2.55725210000E-01 -2.52170000000E-01 -2.48664220000E-01 -2.45207180000E-01 + -2.41798190000E-01 -2.38436610000E-01 -2.35121750000E-01 -2.31852980000E-01 + -2.28629660000E-01 -2.25451140000E-01 -2.22316820000E-01 -2.19226070000E-01 + -2.16178290000E-01 -2.13172880000E-01 -2.10209250000E-01 -2.07286830000E-01 + -2.04405030000E-01 -2.01563300000E-01 -1.98761070000E-01 -1.95997810000E-01 + -1.93272960000E-01 -1.90585990000E-01 -1.87936370000E-01 -1.85323600000E-01 + -1.82747140000E-01 -1.80206510000E-01 -1.77701200000E-01 -1.75230710000E-01 + -1.72794580000E-01 -1.70392310000E-01 -1.68023440000E-01 -1.65687500000E-01 + -1.63384030000E-01 -1.61112600000E-01 -1.58872730000E-01 -1.56664010000E-01 + -1.54486000000E-01 -1.52338260000E-01 -1.50220390000E-01 -1.48131960000E-01 + -1.46072560000E-01 -1.44041790000E-01 -1.42039260000E-01 -1.40064560000E-01 + -1.38117320000E-01 -1.36197150000E-01 -1.34303680000E-01 -1.32436520000E-01 + -1.30595330000E-01 -1.28779740000E-01 -1.26989380000E-01 -1.25223920000E-01 + -1.23483000000E-01 -1.21766280000E-01 -1.20073430000E-01 -1.18404110000E-01 + -1.16758010000E-01 -1.15134780000E-01 -1.13534130000E-01 -1.11955720000E-01 + -1.10399260000E-01 -1.08864440000E-01 -1.07350960000E-01 -1.05858520000E-01 + -1.04386830000E-01 -1.02935590000E-01 -1.01504530000E-01 -1.00093370000E-01 + -9.87018280000E-02 +/ + +&nonlocal + els_beta(1) = "2S" + lll(1) = 0 + kbeta(1) = 743 + rcut(1) = 0.000000000000000E+000 + rcutus(1) = 0.000000000000000E+000 + beta(1:743,1) = + 6.98359985901E-03 7.08205790622E-03 7.18190401282E-03 7.28315772892E-03 + 7.38583905239E-03 7.48996798107E-03 7.59556496050E-03 7.70265073474E-03 + 7.81124619704E-03 7.92137268839E-03 8.03305184825E-03 8.14630546532E-03 + 8.26115577601E-03 8.37762531520E-03 8.49573691625E-03 8.61551371100E-03 + 8.73697927900E-03 8.86015719979E-03 8.98507225195E-03 9.11174801327E-03 + 9.24020893327E-03 9.37048161195E-03 9.50259095838E-03 9.63656279069E-03 + 9.77242352393E-03 9.91019957317E-03 1.00499180997E-02 1.01916064139E-02 + 1.03352922741E-02 1.04810040354E-02 1.06287700529E-02 1.07786192788E-02 + 1.09305811129E-02 1.10846854026E-02 1.12409624433E-02 1.13994426795E-02 + 1.15601579271E-02 1.17231382862E-02 1.18884156610E-02 1.20560240180E-02 + 1.22259952548E-02 1.23983629497E-02 1.25731606812E-02 1.27504229233E-02 + 1.29301841499E-02 1.31124797302E-02 1.32973454813E-02 1.34848175188E-02 + 1.36749334713E-02 1.38677280487E-02 1.40632414584E-02 1.42615114368E-02 + 1.44625767856E-02 1.46664767544E-02 1.48732513387E-02 1.50829418775E-02 + 1.52955876202E-02 1.55112325867E-02 1.57299154454E-02 1.59516840857E-02 + 1.61765777623E-02 1.64046427391E-02 1.66359222948E-02 1.68704626931E-02 + 1.71083113442E-02 1.73495110725E-02 1.75941130732E-02 1.78421624637E-02 + 1.80937084923E-02 1.83488018998E-02 1.86074931815E-02 1.88698293377E-02 + 1.91358648497E-02 1.94056507039E-02 1.96792391334E-02 1.99566881857E-02 + 2.02380445901E-02 2.05233705607E-02 2.08127169937E-02 2.11061450763E-02 + 2.14037085343E-02 2.17054670626E-02 2.20114818487E-02 2.23218096028E-02 + 2.26365115125E-02 2.29556517499E-02 2.32792900101E-02 2.36074935395E-02 + 2.39403217646E-02 2.42778421110E-02 2.46201231384E-02 2.49672275266E-02 + 2.53192269098E-02 2.56761884449E-02 2.60381837658E-02 2.64052815220E-02 + 2.67775566343E-02 2.71550768460E-02 2.75379206667E-02 2.79261624132E-02 + 2.83198781967E-02 2.87191441283E-02 2.91240393042E-02 2.95346447992E-02 + 2.99510352645E-02 3.03732972257E-02 3.08015137691E-02 3.12357669755E-02 + 3.16761419102E-02 3.21227287760E-02 3.25756061810E-02 3.30348716175E-02 + 3.35006124756E-02 3.39729182980E-02 3.44518831042E-02 3.49376009142E-02 + 3.54301657475E-02 3.59296761011E-02 3.64362274870E-02 3.69499213868E-02 + 3.74708577898E-02 3.79991366851E-02 3.85348655240E-02 3.90781457879E-02 + 3.96290864204E-02 4.01877948726E-02 4.07543785956E-02 4.13289510099E-02 + 4.19116240440E-02 4.25025126106E-02 4.31017301305E-02 4.37093959938E-02 + 4.43256295906E-02 4.49505503109E-02 4.55842820221E-02 4.62269485915E-02 + 4.68786753785E-02 4.75395892353E-02 4.82098229833E-02 4.88895049670E-02 + 4.95787713299E-02 5.02777494043E-02 5.09865864553E-02 5.17054149669E-02 + 5.24343796997E-02 5.31736230078E-02 5.39232819472E-02 5.46835149525E-02 + 5.54544632210E-02 5.62362819599E-02 5.70291233917E-02 5.78331427234E-02 + 5.86484966547E-02 5.94753448698E-02 6.03138515301E-02 6.11641793046E-02 + 6.20264938472E-02 6.29009667812E-02 6.37877682374E-02 6.46870728239E-02 + 6.55990580520E-02 6.65238942972E-02 6.74617708468E-02 6.84128713445E-02 + 6.93773808450E-02 7.03554873879E-02 7.13473834896E-02 7.23532646515E-02 + 7.33733248825E-02 7.44077671459E-02 7.54567929124E-02 7.65206081300E-02 + 7.75994217314E-02 7.86934426494E-02 7.98028887709E-02 8.09279749981E-02 + 8.20689236952E-02 8.32259572261E-02 8.43993009398E-02 8.55891891394E-02 + 8.67958501585E-02 8.80195242697E-02 8.92604487608E-02 9.05188668893E-02 + 9.17950278819E-02 9.30891794733E-02 9.44015753674E-02 9.57324737454E-02 + 9.70821342807E-02 9.84508226164E-02 9.98388073802E-02 1.01246358692E-01 + 1.02673754135E-01 1.04121271290E-01 1.05589196693E-01 1.07077815389E-01 + 1.08587419883E-01 1.10118307159E-01 1.11670777183E-01 1.13245131417E-01 + 1.14841681766E-01 1.16460740138E-01 1.18102621423E-01 1.19767650960E-01 + 1.21456152595E-01 1.23168465888E-01 1.24904901865E-01 1.26665825547E-01 + 1.28451573419E-01 1.30262496191E-01 1.32098949047E-01 1.33961290159E-01 + 1.35849883665E-01 1.37765102661E-01 1.39707321732E-01 1.41676919943E-01 + 1.43674283818E-01 1.45699804361E-01 1.47753878543E-01 1.49836903743E-01 + 1.51949313024E-01 1.54091485176E-01 1.56263848105E-01 1.58466849523E-01 + 1.60700881604E-01 1.62966439289E-01 1.65263923063E-01 1.67593791407E-01 + 1.69956495570E-01 1.72352517429E-01 1.74782315304E-01 1.77246336419E-01 + 1.79745138736E-01 1.82279134338E-01 1.84848845047E-01 1.87454800506E-01 + 1.90097485889E-01 1.92777406065E-01 1.95495113214E-01 1.98251129668E-01 + 2.01045992682E-01 2.03880254435E-01 2.06754467108E-01 2.09669197803E-01 + 2.12624984451E-01 2.15622481670E-01 2.18662198897E-01 2.21744762318E-01 + 2.24870783468E-01 2.28040859569E-01 2.31255632344E-01 2.34515698742E-01 + 2.37821730333E-01 2.41174353916E-01 2.44574226135E-01 2.48022033485E-01 + 2.51518417686E-01 2.55064095080E-01 2.58659737235E-01 2.62306042917E-01 + 2.66003763371E-01 2.69753597604E-01 2.73556276883E-01 2.77412547395E-01 + 2.81323170251E-01 2.85288891641E-01 2.89310517447E-01 2.93388823704E-01 + 2.97524601373E-01 3.01718656337E-01 3.05971803823E-01 3.10284905355E-01 + 3.14658791369E-01 3.19094291139E-01 3.23592312705E-01 3.28153715483E-01 + 3.32779409824E-01 3.37470253616E-01 3.42227239971E-01 3.47051217993E-01 + 3.51943181750E-01 3.56904054439E-01 3.61934877850E-01 3.67036540612E-01 + 3.72210100449E-01 3.77456522634E-01 3.82776902056E-01 3.88172217504E-01 + 3.93643550371E-01 3.99191979368E-01 4.04818551877E-01 4.10524411204E-01 + 4.16310649880E-01 4.22178345534E-01 4.28128759652E-01 4.34162985573E-01 + 4.40282187695E-01 4.46487618506E-01 4.52780397060E-01 4.59161852682E-01 + 4.65633177780E-01 4.72195641346E-01 4.78850526803E-01 4.85599132500E-01 + 4.92442786631E-01 4.99382802466E-01 5.06420567894E-01 5.13557391621E-01 + 5.20794744796E-01 5.28134011223E-01 5.35576623558E-01 5.43123978067E-01 + 5.50777587547E-01 5.58538996677E-01 5.66409585509E-01 5.74391018345E-01 + 5.82484848814E-01 5.90692566349E-01 5.99015766093E-01 6.07456169321E-01 + 6.16015306888E-01 6.24694920165E-01 6.33496708061E-01 6.42422317351E-01 + 6.51473520971E-01 6.60652050498E-01 6.69959754763E-01 6.79398319678E-01 + 6.88969700505E-01 6.98675732628E-01 7.08518311247E-01 7.18499268492E-01 + 7.28620639940E-01 7.38884278752E-01 7.49292236046E-01 7.59846541266E-01 + 7.70549305330E-01 7.81402447549E-01 7.92408143928E-01 8.03568573100E-01 + 8.14885799401E-01 8.26362043919E-01 8.37999553984E-01 8.49800654633E-01 + 8.61767472971E-01 8.73902404279E-01 8.86207746758E-01 8.98685885326E-01 + 9.11339265891E-01 9.24170303409E-01 9.37181490168E-01 9.50375250249E-01 + 9.63754229025E-01 9.77320927285E-01 9.91077916738E-01 1.00502801972E+00 + 1.01917366635E+00 1.03351777112E+00 1.04806300891E+00 1.06281211032E+00 + 1.07776804834E+00 1.09293352589E+00 1.10831138653E+00 1.12390487582E+00 + 1.13971658359E+00 1.15574983496E+00 1.17200754564E+00 1.18849281161E+00 + 1.20520877342E+00 1.22215853425E+00 1.23934538841E+00 1.25677262497E+00 + 1.27444343241E+00 1.29236137341E+00 1.31052946322E+00 1.32895149923E+00 + 1.34763062057E+00 1.36657052522E+00 1.38577477991E+00 1.40524701069E+00 + 1.42499068206E+00 1.44500959761E+00 1.46530752722E+00 1.48588815559E+00 + 1.50675525080E+00 1.52791285195E+00 1.54936496592E+00 1.57111508501E+00 + 1.59316786215E+00 1.61552667383E+00 1.63819591361E+00 1.66118009136E+00 + 1.68448293821E+00 1.70810877015E+00 1.73206205351E+00 1.75634671315E+00 + 1.78096754806E+00 1.80592897766E+00 1.83123520089E+00 1.85689101683E+00 + 1.88290075477E+00 1.90926908374E+00 1.93600073604E+00 1.96310024296E+00 + 1.99057259669E+00 2.01842246719E+00 2.04665440855E+00 2.07527380388E+00 + 2.10428517008E+00 2.13369344648E+00 2.16350385505E+00 2.19372131980E+00 + 2.22435104269E+00 2.25539761227E+00 2.28686664797E+00 2.31876315068E+00 + 2.35109241393E+00 2.38385938437E+00 2.41706947921E+00 2.45072772843E+00 + 2.48483981104E+00 2.51941088087E+00 2.55444590664E+00 2.58995061470E+00 + 2.62593021112E+00 2.66238968436E+00 2.69933487810E+00 2.73677061310E+00 + 2.77470263213E+00 2.81313605891E+00 2.85207581277E+00 2.89152754618E+00 + 2.93149626755E+00 2.97198713300E+00 3.01300492770E+00 3.05455527482E+00 + 3.09664298158E+00 3.13927256541E+00 3.18244896232E+00 3.22617702432E+00 + 3.27046136809E+00 3.31530644765E+00 3.36071631042E+00 3.40669541008E+00 + 3.45324770392E+00 3.50037718343E+00 3.54808691772E+00 3.59638106798E+00 + 3.64526239257E+00 3.69473386512E+00 3.74479828573E+00 3.79545842463E+00 + 3.84671553541E+00 3.89857171108E+00 3.95102818520E+00 4.00408614829E+00 + 4.05774594362E+00 4.11200757286E+00 4.16687049160E+00 4.22233383625E+00 + 4.27839583019E+00 4.33505449600E+00 4.39230658910E+00 4.45014935363E+00 + 4.50857751817E+00 4.56758608551E+00 4.62717004771E+00 4.68732109344E+00 + 4.74803222594E+00 4.80929414102E+00 4.87109723506E+00 4.93342911751E+00 + 4.99627849038E+00 5.05963072067E+00 5.12347101002E+00 5.18778224834E+00 + 5.25254658561E+00 5.31774300740E+00 5.38335020819E+00 5.44934423116E+00 + 5.51569933282E+00 5.58238716636E+00 5.64937774663E+00 5.71663881316E+00 + 5.78413490927E+00 5.85182810844E+00 5.91967783803E+00 5.98764066704E+00 + 6.05566932294E+00 6.12371528822E+00 6.19172375783E+00 6.25963801315E+00 + 6.32739853048E+00 6.39493933345E+00 6.46219226537E+00 6.52908343674E+00 + 6.59553552636E+00 6.66146580668E+00 6.72678738314E+00 6.79140755847E+00 + 6.85522858302E+00 6.91814751809E+00 6.98005431200E+00 7.04083462757E+00 + 7.10036708778E+00 7.15852349280E+00 7.21517177202E+00 7.27017026890E+00 + 7.32337094084E+00 7.37462104371E+00 7.42375745272E+00 7.47061252155E+00 + 7.51501032559E+00 7.55676635577E+00 7.59569156636E+00 7.63158682847E+00 + 7.66424712604E+00 7.69345939430E+00 7.71900479298E+00 7.74065621861E+00 + 7.75818217417E+00 7.77134015845E+00 7.77988793687E+00 7.78357307618E+00 + 7.78214024571E+00 7.77533016517E+00 7.76287861153E+00 7.74452168347E+00 + 7.71999119652E+00 7.68902128726E+00 7.65134476989E+00 7.60669698005E+00 + 7.55481960829E+00 7.49545638911E+00 7.42835637144E+00 7.35328700551E+00 + 7.27002171668E+00 7.17834862530E+00 7.07807469155E+00 6.96902355653E+00 + 6.85103970627E+00 6.72399792893E+00 6.58779110655E+00 6.44235604384E+00 + 6.28766231236E+00 6.12371981646E+00 5.95057495688E+00 5.76832315428E+00 + 5.57711049640E+00 5.37713379939E+00 5.16864393118E+00 4.95194885983E+00 + 4.72744346291E+00 4.49557055145E+00 4.25684349888E+00 4.01184812974E+00 + 3.76124119011E+00 3.50575220721E+00 3.24618578831E+00 2.98339697280E+00 + 2.71836149478E+00 2.45209761662E+00 2.18569242074E+00 1.92029374533E+00 + 1.65710029136E+00 1.39736507094E+00 1.14238069362E+00 8.93456618220E-01 + 6.51943587432E-01 4.19200543411E-01 1.96570009216E-01 -1.46304175421E-02 + -2.13120522967E-01 -3.97676629999E-01 -5.67148962006E-01 -7.20482561608E-01 + -8.56732315206E-01 -9.75092119826E-01 -1.07491112558E+00 -1.15571803408E+00 + -1.21722913073E+00 -1.25937936553E+00 -1.28232928258E+00 -1.28648510802E+00 + -1.27245988118E+00 -1.24122482822E+00 -1.19399343687E+00 -1.13224094438E+00 + -1.05771424972E+00 -9.72415633859E-01 -8.78586861075E-01 -7.78682344846E-01 + -6.75275438935E-01 -5.71141826439E-01 -4.69158440253E-01 -3.72123230901E-01 + -2.82711323995E-01 -2.03353703636E-01 -1.36089025278E-01 -8.23874674137E-02 + -4.29513429209E-02 -1.75480459211E-02 -4.50214373218E-03 -4.23162034360E-04 + 6.95360655774E-08 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 6.32189811773E-08 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 5.80241241627E-08 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + dion(1:1) = + 4.39844776150E-01 +/ + +&pswfc + els(1) = "2S" + lchi(1) = 0 + oc(1) = 2.000000000000000E+000 + nchi(1) = 2 + epseu(1) = 0.000000000000000E+000 + rcut_chi(1) = 0.000000000000000E+000 + rcutus_chi(1) = 0.000000000000000E+000 + chi(1:921,1) = + 4.67951610000E-04 4.74549010000E-04 4.81239420000E-04 4.88024150000E-04 + 4.94904540000E-04 5.01881930000E-04 5.08957690000E-04 5.16133210000E-04 + 5.23409890000E-04 5.30789160000E-04 5.38272470000E-04 5.45861280000E-04 + 5.53557080000E-04 5.61361380000E-04 5.69275710000E-04 5.77301620000E-04 + 5.85440690000E-04 5.93694500000E-04 6.02064670000E-04 6.10552860000E-04 + 6.19160710000E-04 6.27889920000E-04 6.36742200000E-04 6.45719280000E-04 + 6.54822930000E-04 6.64054920000E-04 6.73417070000E-04 6.82911210000E-04 + 6.92539200000E-04 7.02302940000E-04 7.12204330000E-04 7.22245310000E-04 + 7.32427850000E-04 7.42753950000E-04 7.53225640000E-04 7.63844960000E-04 + 7.74613990000E-04 7.85534850000E-04 7.96609680000E-04 8.07840650000E-04 + 8.19229950000E-04 8.30779830000E-04 8.42492540000E-04 8.54370390000E-04 + 8.66415690000E-04 8.78630810000E-04 8.91018150000E-04 9.03580130000E-04 + 9.16319210000E-04 9.29237900000E-04 9.42338710000E-04 9.55624230000E-04 + 9.69097060000E-04 9.82759830000E-04 9.96615220000E-04 1.01066600000E-03 + 1.02491480000E-03 1.03936450000E-03 1.05401790000E-03 1.06887800000E-03 + 1.08394750000E-03 1.09922950000E-03 1.11472690000E-03 1.13044280000E-03 + 1.14638030000E-03 1.16254250000E-03 1.17893260000E-03 1.19555370000E-03 + 1.21240910000E-03 1.22950220000E-03 1.24683630000E-03 1.26441480000E-03 + 1.28224110000E-03 1.30031870000E-03 1.31865110000E-03 1.33724210000E-03 + 1.35609510000E-03 1.37521400000E-03 1.39460230000E-03 1.41426410000E-03 + 1.43420300000E-03 1.45442300000E-03 1.47492820000E-03 1.49572240000E-03 + 1.51680970000E-03 1.53819440000E-03 1.55988050000E-03 1.58187240000E-03 + 1.60417440000E-03 1.62679070000E-03 1.64972600000E-03 1.67298450000E-03 + 1.69657100000E-03 1.72049000000E-03 1.74474630000E-03 1.76934450000E-03 + 1.79428950000E-03 1.81958620000E-03 1.84523950000E-03 1.87125450000E-03 + 1.89763630000E-03 1.92439000000E-03 1.95152090000E-03 1.97903430000E-03 + 2.00693560000E-03 2.03523020000E-03 2.06392380000E-03 2.09302190000E-03 + 2.12253020000E-03 2.15245460000E-03 2.18280080000E-03 2.21357490000E-03 + 2.24478290000E-03 2.27643080000E-03 2.30852490000E-03 2.34107150000E-03 + 2.37407690000E-03 2.40754770000E-03 2.44149030000E-03 2.47591150000E-03 + 2.51081800000E-03 2.54621650000E-03 2.58211420000E-03 2.61851790000E-03 + 2.65543490000E-03 2.69287240000E-03 2.73083760000E-03 2.76933810000E-03 + 2.80838140000E-03 2.84797520000E-03 2.88812710000E-03 2.92884510000E-03 + 2.97013720000E-03 3.01201140000E-03 3.05447600000E-03 3.09753930000E-03 + 3.14120970000E-03 3.18549570000E-03 3.23040620000E-03 3.27594980000E-03 + 3.32213540000E-03 3.36897220000E-03 3.41646940000E-03 3.46463610000E-03 + 3.51348200000E-03 3.56301640000E-03 3.61324920000E-03 3.66419030000E-03 + 3.71584940000E-03 3.76823690000E-03 3.82136300000E-03 3.87523810000E-03 + 3.92987270000E-03 3.98527750000E-03 4.04146350000E-03 4.09844160000E-03 + 4.15622290000E-03 4.21481890000E-03 4.27424100000E-03 4.33450090000E-03 + 4.39561020000E-03 4.45758120000E-03 4.52042570000E-03 4.58415630000E-03 + 4.64878540000E-03 4.71432560000E-03 4.78078980000E-03 4.84819110000E-03 + 4.91654250000E-03 4.98585760000E-03 5.05614990000E-03 5.12743320000E-03 + 5.19972150000E-03 5.27302880000E-03 5.34736970000E-03 5.42275860000E-03 + 5.49921040000E-03 5.57674000000E-03 5.65536250000E-03 5.73509360000E-03 + 5.81594860000E-03 5.89794360000E-03 5.98109450000E-03 6.06541760000E-03 + 6.15092960000E-03 6.23764710000E-03 6.32558710000E-03 6.41476690000E-03 + 6.50520390000E-03 6.59691590000E-03 6.68992090000E-03 6.78423700000E-03 + 6.87988280000E-03 6.97687690000E-03 7.07523850000E-03 7.17498670000E-03 + 7.27614110000E-03 7.37872160000E-03 7.48274830000E-03 7.58824140000E-03 + 7.69522180000E-03 7.80371040000E-03 7.91372830000E-03 8.02529730000E-03 + 8.13843910000E-03 8.25317590000E-03 8.36953020000E-03 8.48752480000E-03 + 8.60718280000E-03 8.72852770000E-03 8.85158330000E-03 8.97637360000E-03 + 9.10292300000E-03 9.23125650000E-03 9.36139920000E-03 9.49337650000E-03 + 9.62721430000E-03 9.76293880000E-03 9.90057660000E-03 1.00401550000E-02 + 1.01817010000E-02 1.03252420000E-02 1.04708060000E-02 1.06184230000E-02 + 1.07681200000E-02 1.09199280000E-02 1.10738760000E-02 1.12299940000E-02 + 1.13883130000E-02 1.15488630000E-02 1.17116770000E-02 1.18767850000E-02 + 1.20442220000E-02 1.22140180000E-02 1.23862080000E-02 1.25608250000E-02 + 1.27379040000E-02 1.29174780000E-02 1.30995840000E-02 1.32842570000E-02 + 1.34715330000E-02 1.36614490000E-02 1.38540420000E-02 1.40493500000E-02 + 1.42474100000E-02 1.44482630000E-02 1.46519460000E-02 1.48585010000E-02 + 1.50679670000E-02 1.52803850000E-02 1.54957980000E-02 1.57142460000E-02 + 1.59357740000E-02 1.61604240000E-02 1.63882400000E-02 1.66192680000E-02 + 1.68535510000E-02 1.70911370000E-02 1.73320710000E-02 1.75764010000E-02 + 1.78241750000E-02 1.80754410000E-02 1.83302480000E-02 1.85886460000E-02 + 1.88506860000E-02 1.91164180000E-02 1.93858960000E-02 1.96591720000E-02 + 1.99362990000E-02 2.02173310000E-02 2.05023240000E-02 2.07913330000E-02 + 2.10844150000E-02 2.13816270000E-02 2.16830270000E-02 2.19886740000E-02 + 2.22986290000E-02 2.26129510000E-02 2.29317020000E-02 2.32549450000E-02 + 2.35827420000E-02 2.39151580000E-02 2.42522580000E-02 2.45941080000E-02 + 2.49407740000E-02 2.52923240000E-02 2.56488280000E-02 2.60103550000E-02 + 2.63769740000E-02 2.67487590000E-02 2.71257820000E-02 2.75081160000E-02 + 2.78958360000E-02 2.82890180000E-02 2.86877390000E-02 2.90920760000E-02 + 2.95021090000E-02 2.99179180000E-02 3.03395840000E-02 3.07671880000E-02 + 3.12008160000E-02 3.16405510000E-02 3.20864790000E-02 3.25386870000E-02 + 3.29972640000E-02 3.34622980000E-02 3.39338820000E-02 3.44121060000E-02 + 3.48970640000E-02 3.53888510000E-02 3.58875630000E-02 3.63932960000E-02 + 3.69061490000E-02 3.74262230000E-02 3.79536180000E-02 3.84884380000E-02 + 3.90307870000E-02 3.95807700000E-02 4.01384940000E-02 4.07040690000E-02 + 4.12776030000E-02 4.18592100000E-02 4.24490010000E-02 4.30470920000E-02 + 4.36535990000E-02 4.42686410000E-02 4.48923360000E-02 4.55248060000E-02 + 4.61661730000E-02 4.68165630000E-02 4.74761030000E-02 4.81449190000E-02 + 4.88231410000E-02 4.95109030000E-02 5.02083360000E-02 5.09155760000E-02 + 5.16327610000E-02 5.23600300000E-02 5.30975220000E-02 5.38453830000E-02 + 5.46037550000E-02 5.53727870000E-02 5.61526260000E-02 5.69434240000E-02 + 5.77453350000E-02 5.85585120000E-02 5.93831130000E-02 6.02192980000E-02 + 6.10672270000E-02 6.19270660000E-02 6.27989780000E-02 6.36831340000E-02 + 6.45797030000E-02 6.54888570000E-02 6.64107730000E-02 6.73456270000E-02 + 6.82936000000E-02 6.92548740000E-02 7.02296330000E-02 7.12180650000E-02 + 7.22203600000E-02 7.32367090000E-02 7.42673080000E-02 7.53123550000E-02 + 7.63720490000E-02 7.74465930000E-02 7.85361930000E-02 7.96410570000E-02 + 8.07613960000E-02 8.18974240000E-02 8.30493570000E-02 8.42174160000E-02 + 8.54018210000E-02 8.66028000000E-02 8.78205790000E-02 8.90553900000E-02 + 9.03074680000E-02 9.15770500000E-02 9.28643760000E-02 9.41696900000E-02 + 9.54932380000E-02 9.68352700000E-02 9.81960400000E-02 9.95758030000E-02 + 1.00974820000E-01 1.02393350000E-01 1.03831670000E-01 1.05290030000E-01 + 1.06768730000E-01 1.08268020000E-01 1.09788190000E-01 1.11329530000E-01 + 1.12892330000E-01 1.14476860000E-01 1.16083430000E-01 1.17712330000E-01 + 1.19363870000E-01 1.21038350000E-01 1.22736080000E-01 1.24457370000E-01 + 1.26202540000E-01 1.27971900000E-01 1.29765790000E-01 1.31584520000E-01 + 1.33428440000E-01 1.35297870000E-01 1.37193150000E-01 1.39114640000E-01 + 1.41062670000E-01 1.43037590000E-01 1.45039760000E-01 1.47069540000E-01 + 1.49127300000E-01 1.51213390000E-01 1.53328190000E-01 1.55472080000E-01 + 1.57645430000E-01 1.59848630000E-01 1.62082050000E-01 1.64346100000E-01 + 1.66641170000E-01 1.68967660000E-01 1.71325960000E-01 1.73716490000E-01 + 1.76139660000E-01 1.78595880000E-01 1.81085560000E-01 1.83609140000E-01 + 1.86167040000E-01 1.88759690000E-01 1.91387510000E-01 1.94050960000E-01 + 1.96750460000E-01 1.99486470000E-01 2.02259430000E-01 2.05069800000E-01 + 2.07918030000E-01 2.10804570000E-01 2.13729890000E-01 2.16694460000E-01 + 2.19698740000E-01 2.22743200000E-01 2.25828320000E-01 2.28954570000E-01 + 2.32122440000E-01 2.35332400000E-01 2.38584930000E-01 2.41880530000E-01 + 2.45219680000E-01 2.48602870000E-01 2.52030590000E-01 2.55503340000E-01 + 2.59021600000E-01 2.62585870000E-01 2.66196660000E-01 2.69854440000E-01 + 2.73559730000E-01 2.77313010000E-01 2.81114780000E-01 2.84965540000E-01 + 2.88865770000E-01 2.92815980000E-01 2.96816640000E-01 3.00868260000E-01 + 3.04971310000E-01 3.09126270000E-01 3.13333630000E-01 3.17593860000E-01 + 3.21907430000E-01 3.26274800000E-01 3.30696430000E-01 3.35172770000E-01 + 3.39704280000E-01 3.44291380000E-01 3.48934510000E-01 3.53634080000E-01 + 3.58390510000E-01 3.63204190000E-01 3.68075510000E-01 3.73004850000E-01 + 3.77992570000E-01 3.83039010000E-01 3.88144510000E-01 3.93309370000E-01 + 3.98533900000E-01 4.03818370000E-01 4.09163030000E-01 4.14568130000E-01 + 4.20033860000E-01 4.25560420000E-01 4.31147970000E-01 4.36796620000E-01 + 4.42506490000E-01 4.48277650000E-01 4.54110120000E-01 4.60003910000E-01 + 4.65958970000E-01 4.71975220000E-01 4.78052550000E-01 4.84190780000E-01 + 4.90389690000E-01 4.96649020000E-01 5.02968450000E-01 5.09347600000E-01 + 5.15786020000E-01 5.22283220000E-01 5.28838630000E-01 5.35451610000E-01 + 5.42121430000E-01 5.48847320000E-01 5.55628380000E-01 5.62463660000E-01 + 5.69352090000E-01 5.76292510000E-01 5.83283680000E-01 5.90324210000E-01 + 5.97412620000E-01 6.04547310000E-01 6.11726550000E-01 6.18948470000E-01 + 6.26211070000E-01 6.33512180000E-01 6.40849500000E-01 6.48220550000E-01 + 6.55622680000E-01 6.63053060000E-01 6.70508680000E-01 6.77986310000E-01 + 6.85482520000E-01 6.92993680000E-01 7.00515880000E-01 7.08045030000E-01 + 7.15576750000E-01 7.23106410000E-01 7.30629090000E-01 7.38139610000E-01 + 7.45632470000E-01 7.53101870000E-01 7.60541680000E-01 7.67945450000E-01 + 7.75306370000E-01 7.82617270000E-01 7.89870620000E-01 7.97058500000E-01 + 8.04172600000E-01 8.11204220000E-01 8.18144240000E-01 8.24983110000E-01 + 8.31710880000E-01 8.38317140000E-01 8.44791090000E-01 8.51121450000E-01 + 8.57296540000E-01 8.63304250000E-01 8.69132020000E-01 8.74766910000E-01 + 8.80195580000E-01 8.85404320000E-01 8.90379050000E-01 8.95105380000E-01 + 8.99568640000E-01 9.03753900000E-01 9.07646030000E-01 9.11229780000E-01 + 9.14489780000E-01 9.17410670000E-01 9.19977140000E-01 9.22174040000E-01 + 9.23986450000E-01 9.25399770000E-01 9.26399870000E-01 9.26973170000E-01 + 9.27106770000E-01 9.26788560000E-01 9.26007380000E-01 9.24753130000E-01 + 9.23016930000E-01 9.20791220000E-01 9.18069900000E-01 9.14848490000E-01 + 9.11124200000E-01 9.06896070000E-01 9.02165050000E-01 8.96934080000E-01 + 8.91208160000E-01 8.84994340000E-01 8.78301750000E-01 8.71141600000E-01 + 8.63527050000E-01 8.55473140000E-01 8.46996680000E-01 8.38116000000E-01 + 8.28850800000E-01 8.19221870000E-01 8.09250770000E-01 7.98959530000E-01 + 7.88370300000E-01 7.77504970000E-01 7.66384840000E-01 7.55030260000E-01 + 7.43460400000E-01 7.31692960000E-01 7.19744170000E-01 7.07628820000E-01 + 6.95360660000E-01 6.82952940000E-01 6.70418850000E-01 6.57771550000E-01 + 6.45024170000E-01 6.32189810000E-01 6.19281470000E-01 6.06312070000E-01 + 5.93294430000E-01 5.80241240000E-01 5.67165040000E-01 5.54078220000E-01 + 5.40993000000E-01 5.27921370000E-01 5.14875160000E-01 5.01865930000E-01 + 4.88905030000E-01 4.76003540000E-01 4.63172270000E-01 4.50421780000E-01 + 4.37762290000E-01 4.25203760000E-01 4.12755790000E-01 4.00427700000E-01 + 3.88228420000E-01 3.76166580000E-01 3.64250430000E-01 3.52487860000E-01 + 3.40886410000E-01 3.29453210000E-01 3.18195050000E-01 3.07118290000E-01 + 2.96228940000E-01 2.85532570000E-01 2.75034400000E-01 2.64739230000E-01 + 2.54651450000E-01 2.44775070000E-01 2.35113690000E-01 2.25670510000E-01 + 2.16448350000E-01 2.07449610000E-01 1.98676330000E-01 1.90130130000E-01 + 1.81812290000E-01 1.73723690000E-01 1.65864850000E-01 1.58235920000E-01 + 1.50836710000E-01 1.43666680000E-01 1.36724950000E-01 1.30010340000E-01 + 1.23521320000E-01 1.17256090000E-01 1.11212520000E-01 1.05388250000E-01 + 9.97806130000E-02 9.43867020000E-02 8.92033670000E-02 8.42272350000E-02 + 7.94547140000E-02 7.48820180000E-02 7.05051740000E-02 6.63200380000E-02 + 6.23223110000E-02 5.85075550000E-02 5.48712040000E-02 5.14085790000E-02 + 4.81149090000E-02 4.49853370000E-02 4.20149380000E-02 3.91987350000E-02 + 3.65317090000E-02 3.40088170000E-02 3.16249980000E-02 2.93751940000E-02 + 2.72543560000E-02 2.52574620000E-02 2.33795210000E-02 2.16155880000E-02 + 1.99607770000E-02 1.84102640000E-02 1.69593010000E-02 1.56032230000E-02 + 1.43374560000E-02 1.31575260000E-02 1.20590600000E-02 1.10378000000E-02 + 1.00896000000E-02 9.21043840000E-03 8.39641600000E-03 7.64376220000E-03 + 6.94883750000E-03 6.30813490000E-03 5.71828230000E-03 5.17604280000E-03 + 4.67831570000E-03 4.22213600000E-03 3.80467390000E-03 3.42323390000E-03 + 3.07525340000E-03 2.75830040000E-03 2.47007180000E-03 2.20839040000E-03 + 1.97120200000E-03 1.75657250000E-03 1.56268410000E-03 1.38783170000E-03 + 1.23041940000E-03 1.08895610000E-03 9.62051520000E-04 8.48412120000E-04 + 7.46836650000E-04 6.56211890000E-04 5.75508350000E-04 5.03775930000E-04 + 4.40139630000E-04 3.83795320000E-04 3.34005580000E-04 2.90095600000E-04 + 2.51449240000E-04 2.17505100000E-04 1.87752850000E-04 1.61729570000E-04 + 1.39016310000E-04 1.19234810000E-04 1.02044250000E-04 8.71383590000E-05 + 7.42424710000E-05 6.31109030000E-05 5.35244000000E-05 4.52877740000E-05 + 3.82276840000E-05 3.21905750000E-05 2.70407600000E-05 2.26586440000E-05 + 1.89390870000E-05 1.57898960000E-05 1.31304420000E-05 1.08904000000E-05 + 9.00859070000E-06 7.43194340000E-06 6.11454290000E-06 5.01677720000E-06 + 4.10456830000E-06 3.34868310000E-06 2.72411650000E-06 2.20954220000E-06 + 1.78683160000E-06 1.44067320000E-06 1.15806430000E-06 9.28044670000E-07 + 7.41410930000E-07 5.90459230000E-07 4.68761830000E-07 3.70973300000E-07 + 2.92663360000E-07 2.30173040000E-07 1.80491380000E-07 1.41150330000E-07 + 1.10135460000E-07 8.58105290000E-08 6.68542420000E-08 5.18975940000E-08 + 4.01396130000E-08 3.09303190000E-08 2.37442300000E-08 1.81581310000E-08 + 1.38324830000E-08 1.04959390000E-08 7.93250830000E-09 5.97094990000E-09 + 4.47605270000E-09 3.34149420000E-09 2.48401680000E-09 1.83869950000E-09 + 1.35513710000E-09 9.94363940000E-10 7.26390590000E-10 5.28238960000E-10 + 3.82382780000E-10 2.75515350000E-10 1.97580630000E-10 1.41014930000E-10 + 1.00156410000E-10 7.07873250000E-11 4.97811920000E-11 3.48319290000E-11 + 2.42471780000E-11 1.67913230000E-11 1.15668950000E-11 7.92546080000E-12 + 5.40101390000E-12 3.66046190000E-12 2.46701950000E-12 1.65329820000E-12 + 1.10163330000E-12 7.29785140000E-13 4.80606280000E-13 3.14618440000E-13 + 2.04711650000E-13 1.32381530000E-13 8.50748100000E-14 5.43281740000E-14 + 3.44715630000E-14 2.17304780000E-14 1.36084960000E-14 8.46531540000E-15 + 5.23030780000E-15 3.20937810000E-15 1.95560840000E-15 1.18322550000E-15 + 7.10778640000E-16 4.23875660000E-16 2.50919990000E-16 1.47427830000E-16 + 8.59657100000E-17 4.97423280000E-17 2.85584640000E-17 1.62668570000E-17 + 9.19144980000E-18 5.15141760000E-18 2.86339970000E-18 1.57833470000E-18 + 8.62634530000E-19 4.67426310000E-19 2.51076060000E-19 1.33674870000E-19 + 7.05329940000E-20 3.68788970000E-20 1.91051650000E-20 9.80515250000E-21 + 4.98461040000E-21 2.50970810000E-21 1.25132840000E-21 6.17754180000E-22 + 3.01922630000E-22 1.46066190000E-22 6.99383530000E-23 3.31382420000E-23 + 1.55355890000E-23 7.20518410000E-24 3.30533560000E-24 1.49958890000E-24 + 6.72739920000E-25 2.98381340000E-25 1.30820500000E-25 5.66876990000E-26 + 2.42738680000E-26 1.02695980000E-26 4.29198740000E-27 1.77165460000E-27 + 7.22169940000E-28 2.90644760000E-28 1.15470290000E-28 4.52776120000E-29 + 1.75195110000E-29 6.68812270000E-30 2.51853340000E-30 9.35338210000E-31 + 3.42517070000E-31 1.23652310000E-31 4.39988560000E-32 1.54280530000E-32 + 5.32993190000E-33 1.81376870000E-33 6.07854340000E-34 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 + + els(2) = "2P" + lchi(2) = 1 + oc(2) = 4.000000000000000E+000 + nchi(2) = 2 + epseu(2) = 0.000000000000000E+000 + rcut_chi(2) = 0.000000000000000E+000 + rcutus_chi(2) = 0.000000000000000E+000 + chi(1:921,2) = + 4.28913950000E-07 4.41093260000E-07 4.53618400000E-07 4.66499200000E-07 + 4.79745760000E-07 4.93368470000E-07 5.07378000000E-07 5.21785340000E-07 + 5.36601790000E-07 5.51838960000E-07 5.67508810000E-07 5.83623600000E-07 + 6.00195990000E-07 6.17238960000E-07 6.34765880000E-07 6.52790490000E-07 + 6.71326910000E-07 6.90389700000E-07 7.09993780000E-07 7.30154530000E-07 + 7.50887760000E-07 7.72209730000E-07 7.94137150000E-07 8.16687210000E-07 + 8.39877590000E-07 8.63726480000E-07 8.88252580000E-07 9.13475110000E-07 + 9.39413850000E-07 9.66089140000E-07 9.93521890000E-07 1.02173360000E-06 + 1.05074640000E-06 1.08058310000E-06 1.11126700000E-06 1.14282210000E-06 + 1.17527330000E-06 1.20864600000E-06 1.24296630000E-06 1.27826120000E-06 + 1.31455830000E-06 1.35188600000E-06 1.39027370000E-06 1.42975150000E-06 + 1.47035020000E-06 1.51210180000E-06 1.55503890000E-06 1.59919530000E-06 + 1.64460550000E-06 1.69130520000E-06 1.73933090000E-06 1.78872040000E-06 + 1.83951230000E-06 1.89174640000E-06 1.94546380000E-06 2.00070660000E-06 + 2.05751790000E-06 2.11594250000E-06 2.17602610000E-06 2.23781580000E-06 + 2.30136010000E-06 2.36670870000E-06 2.43391290000E-06 2.50302550000E-06 + 2.57410050000E-06 2.64719380000E-06 2.72236260000E-06 2.79966590000E-06 + 2.87916420000E-06 2.96091990000E-06 3.04499720000E-06 3.13146180000E-06 + 3.22038170000E-06 3.31182650000E-06 3.40586800000E-06 3.50257980000E-06 + 3.60203780000E-06 3.70432000000E-06 3.80950650000E-06 3.91767990000E-06 + 4.02892490000E-06 4.14332880000E-06 4.26098120000E-06 4.38197450000E-06 + 4.50640340000E-06 4.63436560000E-06 4.76596130000E-06 4.90129380000E-06 + 5.04046910000E-06 5.18359640000E-06 5.33078780000E-06 5.48215880000E-06 + 5.63782810000E-06 5.79791770000E-06 5.96255320000E-06 6.13186350000E-06 + 6.30598160000E-06 6.48504370000E-06 6.66919050000E-06 6.85856620000E-06 + 7.05331930000E-06 7.25360250000E-06 7.45957290000E-06 7.67139190000E-06 + 7.88922560000E-06 8.11324490000E-06 8.34362520000E-06 8.58054730000E-06 + 8.82419700000E-06 9.07476510000E-06 9.33244830000E-06 9.59744850000E-06 + 9.86997360000E-06 1.01502370000E-05 1.04384590000E-05 1.07348650000E-05 + 1.10396870000E-05 1.13531650000E-05 1.16755440000E-05 1.20070780000E-05 + 1.23480250000E-05 1.26986540000E-05 1.30592390000E-05 1.34300630000E-05 + 1.38114170000E-05 1.42035990000E-05 1.46069180000E-05 1.50216890000E-05 + 1.54482370000E-05 1.58868970000E-05 1.63380140000E-05 1.68019400000E-05 + 1.72790390000E-05 1.77696850000E-05 1.82742640000E-05 1.87931700000E-05 + 1.93268110000E-05 1.98756040000E-05 2.04399810000E-05 2.10203830000E-05 + 2.16172660000E-05 2.22310980000E-05 2.28623590000E-05 2.35115450000E-05 + 2.41791650000E-05 2.48657420000E-05 2.55718140000E-05 2.62979360000E-05 + 2.70446750000E-05 2.78126180000E-05 2.86023680000E-05 2.94145420000E-05 + 3.02497770000E-05 3.11087290000E-05 3.19920710000E-05 3.29004960000E-05 + 3.38347150000E-05 3.47954610000E-05 3.57834880000E-05 3.67995690000E-05 + 3.78445020000E-05 3.89191050000E-05 4.00242220000E-05 4.11607180000E-05 + 4.23294840000E-05 4.35314370000E-05 4.47675200000E-05 4.60387000000E-05 + 4.73459750000E-05 4.86903700000E-05 5.00729380000E-05 5.14947630000E-05 + 5.29569600000E-05 5.44606760000E-05 5.60070880000E-05 5.75974100000E-05 + 5.92328890000E-05 6.09148050000E-05 6.26444780000E-05 6.44232640000E-05 + 6.62525570000E-05 6.81337910000E-05 7.00684410000E-05 7.20580240000E-05 + 7.41040990000E-05 7.62082700000E-05 7.83721860000E-05 8.05975440000E-05 + 8.28860890000E-05 8.52396140000E-05 8.76599640000E-05 9.01490370000E-05 + 9.27087830000E-05 9.53412100000E-05 9.80483800000E-05 1.00832420000E-04 + 1.03695500000E-04 1.06639880000E-04 1.09667850000E-04 1.12781800000E-04 + 1.15984170000E-04 1.19277450000E-04 1.22664250000E-04 1.26147200000E-04 + 1.29729050000E-04 1.33412590000E-04 1.37200720000E-04 1.41096400000E-04 + 1.45102700000E-04 1.49222730000E-04 1.53459750000E-04 1.57817060000E-04 + 1.62298090000E-04 1.66906340000E-04 1.71645420000E-04 1.76519060000E-04 + 1.81531070000E-04 1.86685370000E-04 1.91986010000E-04 1.97437140000E-04 + 2.03043040000E-04 2.08808090000E-04 2.14736820000E-04 2.20833870000E-04 + 2.27104010000E-04 2.33552170000E-04 2.40183390000E-04 2.47002870000E-04 + 2.54015960000E-04 2.61228140000E-04 2.68645070000E-04 2.76272570000E-04 + 2.84116610000E-04 2.92183330000E-04 3.00479050000E-04 3.09010280000E-04 + 3.17783690000E-04 3.26806170000E-04 3.36084770000E-04 3.45626780000E-04 + 3.55439660000E-04 3.65531100000E-04 3.75909000000E-04 3.86581500000E-04 + 3.97556960000E-04 4.08843970000E-04 4.20451370000E-04 4.32388260000E-04 + 4.44663980000E-04 4.57288160000E-04 4.70270660000E-04 4.83621670000E-04 + 4.97351640000E-04 5.11471320000E-04 5.25991760000E-04 5.40924350000E-04 + 5.56280760000E-04 5.72073030000E-04 5.88313510000E-04 6.05014930000E-04 + 6.22190360000E-04 6.39853250000E-04 6.58017420000E-04 6.76697090000E-04 + 6.95906880000E-04 7.15661830000E-04 7.35977410000E-04 7.56869500000E-04 + 7.78354470000E-04 8.00449120000E-04 8.23170750000E-04 8.46537130000E-04 + 8.70566550000E-04 8.95277810000E-04 9.20690240000E-04 9.46823710000E-04 + 9.73698690000E-04 1.00133620000E-03 1.02975780000E-03 1.05898580000E-03 + 1.08904300000E-03 1.11995290000E-03 1.15173970000E-03 1.18442820000E-03 + 1.21804410000E-03 1.25261350000E-03 1.28816350000E-03 1.32472190000E-03 + 1.36231730000E-03 1.40097900000E-03 1.44073720000E-03 1.48162310000E-03 + 1.52366850000E-03 1.56690630000E-03 1.61137030000E-03 1.65709510000E-03 + 1.70411660000E-03 1.75247130000E-03 1.80219710000E-03 1.85333280000E-03 + 1.90591830000E-03 1.95999470000E-03 2.01560400000E-03 2.07278980000E-03 + 2.13159660000E-03 2.19207030000E-03 2.25425800000E-03 2.31820830000E-03 + 2.38397100000E-03 2.45159740000E-03 2.52114020000E-03 2.59265350000E-03 + 2.66619310000E-03 2.74181620000E-03 2.81958190000E-03 2.89955050000E-03 + 2.98178440000E-03 3.06634770000E-03 3.15330600000E-03 3.24272700000E-03 + 3.33468040000E-03 3.42923760000E-03 3.52647210000E-03 3.62645950000E-03 + 3.72927760000E-03 3.83500620000E-03 3.94372740000E-03 4.05552570000E-03 + 4.17048780000E-03 4.28870300000E-03 4.41026300000E-03 4.53526210000E-03 + 4.66379710000E-03 4.79596780000E-03 4.93187660000E-03 5.07162870000E-03 + 5.21533230000E-03 5.36309880000E-03 5.51504240000E-03 5.67128060000E-03 + 5.83193440000E-03 5.99712770000E-03 6.16698840000E-03 6.34164750000E-03 + 6.52123990000E-03 6.70590420000E-03 6.89578270000E-03 7.09102190000E-03 + 7.29177220000E-03 7.49818810000E-03 7.71042870000E-03 7.92865700000E-03 + 8.15304100000E-03 8.38375310000E-03 8.62097040000E-03 8.86487510000E-03 + 9.11565410000E-03 9.37349990000E-03 9.63860990000E-03 9.91118710000E-03 + 1.01914400000E-02 1.04795830000E-02 1.07758360000E-02 1.10804250000E-02 + 1.13935830000E-02 1.17155490000E-02 1.20465670000E-02 1.23868890000E-02 + 1.27367740000E-02 1.30964890000E-02 1.34663050000E-02 1.38465040000E-02 + 1.42373730000E-02 1.46392090000E-02 1.50523140000E-02 1.54770010000E-02 + 1.59135900000E-02 1.63624100000E-02 1.68238000000E-02 1.72981050000E-02 + 1.77856820000E-02 1.82868960000E-02 1.88021230000E-02 1.93317490000E-02 + 1.98761680000E-02 2.04357860000E-02 2.10110210000E-02 2.16023000000E-02 + 2.22100620000E-02 2.28347580000E-02 2.34768490000E-02 2.41368110000E-02 + 2.48151290000E-02 2.55123030000E-02 2.62288460000E-02 2.69652820000E-02 + 2.77221510000E-02 2.85000060000E-02 2.92994130000E-02 3.01209540000E-02 + 3.09652240000E-02 3.18328360000E-02 3.27244160000E-02 3.36406060000E-02 + 3.45820640000E-02 3.55494660000E-02 3.65435030000E-02 3.75648830000E-02 + 3.86143340000E-02 3.96925970000E-02 4.08004360000E-02 4.19386310000E-02 + 4.31079810000E-02 4.43093040000E-02 4.55434370000E-02 4.68112390000E-02 + 4.81135870000E-02 4.94513790000E-02 5.08255340000E-02 5.22369930000E-02 + 5.36867170000E-02 5.51756890000E-02 5.67049150000E-02 5.82754230000E-02 + 5.98882630000E-02 6.15445100000E-02 6.32452590000E-02 6.49916320000E-02 + 6.67847720000E-02 6.86258480000E-02 7.05160510000E-02 7.24566000000E-02 + 7.44487340000E-02 7.64937210000E-02 7.85928500000E-02 8.07474380000E-02 + 8.29588250000E-02 8.52283770000E-02 8.75574850000E-02 8.99475650000E-02 + 9.24000570000E-02 9.49164270000E-02 9.74981640000E-02 1.00146780000E-01 + 1.02863830000E-01 1.05650850000E-01 1.08509440000E-01 1.11441210000E-01 + 1.14447790000E-01 1.17530830000E-01 1.20692010000E-01 1.23933010000E-01 + 1.27255560000E-01 1.30661380000E-01 1.34152230000E-01 1.37729870000E-01 + 1.41396080000E-01 1.45152660000E-01 1.49001410000E-01 1.52944150000E-01 + 1.56982710000E-01 1.61118910000E-01 1.65354590000E-01 1.69691600000E-01 + 1.74131770000E-01 1.78676940000E-01 1.83328940000E-01 1.88089580000E-01 + 1.92960690000E-01 1.97944050000E-01 2.03041430000E-01 2.08254600000E-01 + 2.13585270000E-01 2.19035140000E-01 2.24605870000E-01 2.30299070000E-01 + 2.36116300000E-01 2.42059100000E-01 2.48128910000E-01 2.54327130000E-01 + 2.60655090000E-01 2.67114030000E-01 2.73705110000E-01 2.80429410000E-01 + 2.87287880000E-01 2.94281400000E-01 3.01410700000E-01 3.08676400000E-01 + 3.16078990000E-01 3.23618790000E-01 3.31295990000E-01 3.39110600000E-01 + 3.47062460000E-01 3.55151220000E-01 3.63376330000E-01 3.71737020000E-01 + 3.80232300000E-01 3.88860960000E-01 3.97621510000E-01 4.06512230000E-01 + 4.15531100000E-01 4.24675810000E-01 4.33943770000E-01 4.43332050000E-01 + 4.52837400000E-01 4.62456210000E-01 4.72184550000E-01 4.82018060000E-01 + 4.91952060000E-01 5.01981410000E-01 5.12100610000E-01 5.22303700000E-01 + 5.32584310000E-01 5.42935610000E-01 5.53350330000E-01 5.63820730000E-01 + 5.74338590000E-01 5.84895220000E-01 5.95481450000E-01 6.06087620000E-01 + 6.16703600000E-01 6.27318740000E-01 6.37921950000E-01 6.48501640000E-01 + 6.59045740000E-01 6.69541730000E-01 6.79976670000E-01 6.90337150000E-01 + 7.00609390000E-01 7.10779200000E-01 7.20832030000E-01 7.30753040000E-01 + 7.40527060000E-01 7.50138690000E-01 7.59572310000E-01 7.68812160000E-01 + 7.77842360000E-01 7.86646960000E-01 7.95210050000E-01 8.03515780000E-01 + 8.11548430000E-01 8.19292510000E-01 8.26732820000E-01 8.33854500000E-01 + 8.40643160000E-01 8.47084950000E-01 8.53166610000E-01 8.58875600000E-01 + 8.64200170000E-01 8.69129440000E-01 8.73653480000E-01 8.77763420000E-01 + 8.81451510000E-01 8.84711200000E-01 8.87537200000E-01 8.89925570000E-01 + 8.91873770000E-01 8.93380690000E-01 8.94446710000E-01 8.95073750000E-01 + 8.95265250000E-01 8.95026200000E-01 8.94363150000E-01 8.93284170000E-01 + 8.91798810000E-01 8.89918090000E-01 8.87654410000E-01 8.85021460000E-01 + 8.82034180000E-01 8.78708580000E-01 8.75061690000E-01 8.71111360000E-01 + 8.66876150000E-01 8.62375110000E-01 8.57627670000E-01 8.52653400000E-01 + 8.47471850000E-01 8.42102280000E-01 8.36563510000E-01 8.30873700000E-01 + 8.25050060000E-01 8.19108750000E-01 8.13064560000E-01 8.06930810000E-01 + 8.00719070000E-01 7.94439100000E-01 7.88098610000E-01 7.81703230000E-01 + 7.75256420000E-01 7.68759450000E-01 7.62211420000E-01 7.55609390000E-01 + 7.48948530000E-01 7.42222330000E-01 7.35422950000E-01 7.28541630000E-01 + 7.21569140000E-01 7.14496330000E-01 7.07314720000E-01 7.00017090000E-01 + 6.92598040000E-01 6.85054450000E-01 6.77385780000E-01 6.69594010000E-01 + 6.61683160000E-01 6.53658210000E-01 6.45524330000E-01 6.37286780000E-01 + 6.28950840000E-01 6.20521820000E-01 6.12005060000E-01 6.03405940000E-01 + 5.94729830000E-01 5.85982150000E-01 5.77168290000E-01 5.68293680000E-01 + 5.59363720000E-01 5.50383850000E-01 5.41359450000E-01 5.32295920000E-01 + 5.23198640000E-01 5.14072960000E-01 5.04924210000E-01 4.95757690000E-01 + 4.86578680000E-01 4.77392420000E-01 4.68204090000E-01 4.59018850000E-01 + 4.49841800000E-01 4.40678010000E-01 4.31532460000E-01 4.22410110000E-01 + 4.13315830000E-01 4.04254450000E-01 3.95230710000E-01 3.86249300000E-01 + 3.77314810000E-01 3.68431770000E-01 3.59604620000E-01 3.50837710000E-01 + 3.42135320000E-01 3.33501630000E-01 3.24940700000E-01 3.16456530000E-01 + 3.08052990000E-01 2.99733850000E-01 2.91502780000E-01 2.83363320000E-01 + 2.75318920000E-01 2.67372890000E-01 2.59528430000E-01 2.51788600000E-01 + 2.44156360000E-01 2.36634510000E-01 2.29225730000E-01 2.21932570000E-01 + 2.14757440000E-01 2.07702590000E-01 2.00770170000E-01 1.93962130000E-01 + 1.87280330000E-01 1.80726440000E-01 1.74302010000E-01 1.68008410000E-01 + 1.61846890000E-01 1.55818520000E-01 1.49924240000E-01 1.44164830000E-01 + 1.38540920000E-01 1.33052980000E-01 1.27701320000E-01 1.22486130000E-01 + 1.17407430000E-01 1.12465090000E-01 1.07658830000E-01 1.02988240000E-01 + 9.84527730000E-02 9.40517150000E-02 8.97842350000E-02 8.56493650000E-02 + 8.16460050000E-02 7.77729300000E-02 7.40287920000E-02 7.04121240000E-02 + 6.69213460000E-02 6.35547660000E-02 6.03105900000E-02 5.71869240000E-02 + 5.41817770000E-02 5.12930730000E-02 4.85186490000E-02 4.58562680000E-02 + 4.33036160000E-02 4.08583180000E-02 3.85179340000E-02 3.62799730000E-02 + 3.41418950000E-02 3.21011160000E-02 3.01550190000E-02 2.83009550000E-02 + 2.65362500000E-02 2.48582140000E-02 2.32641430000E-02 2.17513260000E-02 + 2.03170530000E-02 1.89586150000E-02 1.76733160000E-02 1.64584720000E-02 + 1.53114200000E-02 1.42295230000E-02 1.32101690000E-02 1.22507830000E-02 + 1.13488260000E-02 1.05017990000E-02 9.70725030000E-03 8.96277390000E-03 + 8.26601620000E-03 7.61467740000E-03 7.00651410000E-03 6.43934170000E-03 + 5.91103620000E-03 5.41953630000E-03 4.96284450000E-03 4.53902890000E-03 + 4.14622330000E-03 3.78262870000E-03 3.44651330000E-03 3.13621300000E-03 + 2.85013150000E-03 2.58673980000E-03 2.34457630000E-03 2.12224570000E-03 + 1.91841890000E-03 1.73183170000E-03 1.56128380000E-03 1.40563810000E-03 + 1.26381870000E-03 1.13481010000E-03 1.01765570000E-03 9.11456310000E-04 + 8.15368270000E-04 7.28602340000E-04 6.50421910000E-04 5.80141470000E-04 + 5.17125120000E-04 4.60785120000E-04 4.10580560000E-04 3.65225860000E-04 + 3.24322970000E-04 2.87499170000E-04 2.54406210000E-04 2.24719310000E-04 + 1.98136210000E-04 1.74348160000E-04 1.53131590000E-04 1.34243870000E-04 + 1.17461250000E-04 1.02577770000E-04 8.94042710000E-05 7.77673630000E-05 + 6.75084480000E-05 5.84827640000E-05 5.05584630000E-05 4.36157200000E-05 + 3.75458790000E-05 3.22506290000E-05 2.76412240000E-05 2.36377310000E-05 + 2.01683250000E-05 1.71686170000E-05 1.45810210000E-05 1.23541600000E-05 + 1.04423060000E-05 8.80486340000E-06 7.40588130000E-06 6.21360240000E-06 + 5.20004640000E-06 4.34062540000E-06 3.61378860000E-06 3.00069820000E-06 + 2.48493270000E-06 2.05221570000E-06 1.69017070000E-06 1.38809830000E-06 + 1.13677520000E-06 9.28273770000E-07 7.55799980000E-07 6.13548480000E-07 + 4.96573730000E-07 4.00675560000E-07 3.22297810000E-07 2.58439040000E-07 + 2.06574040000E-07 1.64585130000E-07 1.30702150000E-07 1.03450350000E-07 + 8.16051810000E-08 6.41533420000E-08 5.02591970000E-08 3.92360360000E-08 + 3.05215330000E-08 2.36568680000E-08 1.82690330000E-08 1.40559020000E-08 + 1.07736720000E-08 8.22635500000E-09 6.25700140000E-09 4.74041390000E-09 + 3.57711790000E-09 2.68839250000E-09 2.01219300000E-09 1.49981900000E-09 + 1.11320390000E-09 8.22718470000E-10 6.05399610000E-10 4.43527620000E-10 + 3.23489190000E-10 2.34872390000E-10 1.69749860000E-10 1.22113570000E-10 + 8.74312710000E-11 6.23001400000E-11 4.41775030000E-11 3.11726240000E-11 + 2.18864510000E-11 1.52889060000E-11 1.06254030000E-11 7.34599770000E-12 + 5.05196730000E-12 3.45574890000E-12 2.35105500000E-12 1.59070270000E-12 + 1.07025430000E-12 7.16015370000E-13 4.76277790000E-13 3.14967410000E-13 + 2.07062950000E-13 1.35311410000E-13 8.78870330000E-14 5.67330670000E-14 + 3.63940970000E-14 2.31990630000E-14 1.46931820000E-14 9.24544240000E-15 + 5.77917610000E-15 3.58831010000E-15 2.21288400000E-15 1.35528380000E-15 + 8.24256530000E-16 4.97751060000E-16 2.98425620000E-16 1.77619230000E-16 + 1.04937100000E-16 6.15329830000E-17 3.58080480000E-17 2.06776140000E-17 + 1.18473150000E-17 6.73428090000E-18 3.79721850000E-18 2.12370230000E-18 + 1.17794590000E-18 6.47902910000E-19 3.53342520000E-19 1.91042980000E-19 + 1.02391170000E-19 5.43921800000E-20 2.86350910000E-20 1.49380380000E-20 + 7.72085680000E-21 3.95327990000E-21 2.00499000000E-21 1.00709640000E-21 + 5.00927460000E-22 2.46696840000E-22 1.20275270000E-22 5.80432120000E-23 + 2.77221040000E-23 1.31019860000E-23 6.12660480000E-24 2.83406030000E-24 + 1.29669720000E-24 5.86733910000E-25 2.62511790000E-25 1.16116090000E-25 + 5.07693880000E-26 2.19384710000E-26 9.36771530000E-27 3.95194480000E-27 + 1.64688720000E-27 6.77824910000E-28 2.75483590000E-28 1.10540450000E-28 + 4.37840240000E-29 1.71158970000E-29 6.60226040000E-30 2.51253970000E-30 + 9.43143280000E-31 3.49142640000E-31 1.27439300000E-31 4.58556410000E-32 + 1.62623550000E-32 5.68311680000E-33 1.95664510000E-33 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 +/ + +&rhoatom + rho_at(1:921) = + 4.37958154472E-07 4.50394304037E-07 4.63183581802E-07 4.76336012452E-07 + 4.89861928049E-07 5.03771916971E-07 5.18076890150E-07 5.32788069970E-07 + 5.47916977666E-07 5.63475482852E-07 5.79475792185E-07 5.95930436473E-07 + 6.12852322577E-07 6.30254721847E-07 6.48151279703E-07 6.66556025451E-07 + 6.85483405735E-07 7.04948225212E-07 7.24965750089E-07 7.45551722211E-07 + 7.66722224945E-07 7.88493888507E-07 8.10883781137E-07 8.33909445039E-07 + 8.57588960885E-07 8.81940857646E-07 9.06984256305E-07 9.32738779234E-07 + 9.59224617067E-07 9.86462572378E-07 1.01447396368E-06 1.04328075139E-06 + 1.07290552718E-06 1.10337153112E-06 1.13470266916E-06 1.16692347000E-06 + 1.20005919208E-06 1.23413584443E-06 1.26918014440E-06 1.30521956739E-06 + 1.34228233421E-06 1.38039756225E-06 1.41959509136E-06 1.45990570337E-06 + 1.50136094348E-06 1.54399334637E-06 1.58783635984E-06 1.63292433236E-06 + 1.67929260814E-06 1.72697759165E-06 1.77601658982E-06 1.82644813601E-06 + 1.87831175862E-06 1.93164808174E-06 1.98649893279E-06 2.04290753842E-06 + 2.10091762804E-06 2.16057503657E-06 2.22192640740E-06 2.28502038905E-06 + 2.34990555055E-06 2.41663339258E-06 2.48525581890E-06 2.55582690869E-06 + 2.62840208843E-06 2.70303815915E-06 2.77979379572E-06 2.85872865168E-06 + 2.93990480987E-06 3.02338638780E-06 3.10923860603E-06 3.19752879713E-06 + 3.28832596049E-06 3.38170131592E-06 3.47772784681E-06 3.57648194029E-06 + 3.67803973919E-06 3.78248197954E-06 3.88988919969E-06 4.00034728196E-06 + 4.11394141936E-06 4.23076119455E-06 4.35089901415E-06 4.47444780253E-06 + 4.60150456271E-06 4.73216993376E-06 4.86654520611E-06 5.00473667049E-06 + 5.14685263655E-06 5.29300344190E-06 5.44330541935E-06 5.59787449074E-06 + 5.75683345650E-06 5.92030614360E-06 6.08842151089E-06 6.26131031836E-06 + 6.43910868124E-06 6.62195610163E-06 6.80999553713E-06 7.00337496726E-06 + 7.20224605141E-06 7.40676420320E-06 7.61709022719E-06 7.83338892217E-06 + 8.05582996462E-06 8.28458723296E-06 8.51984136874E-06 8.76177585093E-06 + 9.01058036563E-06 9.26645101557E-06 9.52958704333E-06 9.80019611989E-06 + 1.00784902018E-05 1.03646864836E-05 1.06590102735E-05 1.09616924855E-05 + 1.12729697530E-05 1.15930874330E-05 1.19222950433E-05 1.22608521914E-05 + 1.26090239531E-05 1.29670819530E-05 1.33353096586E-05 1.37139934516E-05 + 1.41034320372E-05 1.45039304943E-05 1.49158014434E-05 1.53393696288E-05 + 1.57749667678E-05 1.62229350536E-05 1.66836240143E-05 1.71573964603E-05 + 1.76446242344E-05 1.81456883943E-05 1.86609830641E-05 1.91909121630E-05 + 1.97358908612E-05 2.02963458680E-05 2.08727196053E-05 2.14654616102E-05 + 2.20750364566E-05 2.27019242556E-05 2.33466170721E-05 2.40096177818E-05 + 2.46914500567E-05 2.53926449538E-05 2.61137552333E-05 2.68553474350E-05 + 2.76179991847E-05 2.84023128359E-05 2.92089027374E-05 3.00384015245E-05 + 3.08914590724E-05 3.17687445161E-05 3.26709484141E-05 3.35987768678E-05 + 3.45529567407E-05 3.55342396160E-05 3.65433940842E-05 3.75812129373E-05 + 3.86485068860E-05 3.97461190961E-05 4.08749047718E-05 4.20357547845E-05 + 4.32295785314E-05 4.44573116697E-05 4.57199187470E-05 4.70183921318E-05 + 4.83537468740E-05 4.97270350235E-05 5.11393328190E-05 5.25917492834E-05 + 5.40854251136E-05 5.56215293122E-05 5.72012725926E-05 5.88258915143E-05 + 6.04966641875E-05 6.22149005091E-05 6.39819473353E-05 6.57991986293E-05 + 6.76680738409E-05 6.95900462715E-05 7.15666211816E-05 7.35993507601E-05 + 7.56898355583E-05 7.78397134899E-05 8.00506731175E-05 8.23244526191E-05 + 8.46628359761E-05 8.70676619505E-05 8.95408203737E-05 9.20842507398E-05 + 9.46999543573E-05 9.73899823408E-05 1.00156453603E-04 1.03001536998E-04 + 1.05927469641E-04 1.08936553157E-04 1.12031152392E-04 1.15213694027E-04 + 1.18486686413E-04 1.21852700454E-04 1.25314377285E-04 1.28874445971E-04 + 1.32535700474E-04 1.36301020549E-04 1.40173367688E-04 1.44155787238E-04 + 1.48251410679E-04 1.52463461312E-04 1.56795253413E-04 1.61250190911E-04 + 1.65831776968E-04 1.70543624043E-04 1.75389438564E-04 1.80373030656E-04 + 1.85498324474E-04 1.90769353735E-04 1.96190268537E-04 2.01765350545E-04 + 2.07498976411E-04 2.13395647991E-04 2.19460004187E-04 2.25696884406E-04 + 2.32111121594E-04 2.38707841515E-04 2.45492211570E-04 2.52469572151E-04 + 2.59645442404E-04 2.67025433750E-04 2.74615436999E-04 2.82421350004E-04 + 2.90449456163E-04 2.98705955802E-04 3.07197447876E-04 3.15930598774E-04 + 3.24912342521E-04 3.34149684852E-04 3.43650013837E-04 3.53420799568E-04 + 3.63469752148E-04 3.73804829499E-04 3.84434189781E-04 3.95366251870E-04 + 4.06609589562E-04 4.18173221002E-04 4.30066160592E-04 4.42297942364E-04 + 4.54878163247E-04 4.67816781342E-04 4.81124129288E-04 4.94810614376E-04 + 5.08887220573E-04 5.23365019364E-04 5.38255489922E-04 5.53570534321E-04 + 5.69322155755E-04 5.85522998112E-04 6.02185821442E-04 6.19323916488E-04 + 6.36950912238E-04 6.55080783415E-04 6.73727931183E-04 6.92907196033E-04 + 7.12633870884E-04 7.32923561721E-04 7.53792578438E-04 7.75257493211E-04 + 7.97335378359E-04 8.20043820702E-04 8.43401019137E-04 8.67425556284E-04 + 8.92136656256E-04 9.17554035763E-04 9.43698001838E-04 9.70589469108E-04 + 9.98250067115E-04 1.02670180260E-03 1.05596751774E-03 1.08607073760E-03 + 1.11703549910E-03 1.14888674232E-03 1.18165005354E-03 1.21535177728E-03 + 1.25001894116E-03 1.28567946896E-03 1.32236221636E-03 1.36009668690E-03 + 1.39891314850E-03 1.43884318471E-03 1.47991899294E-03 1.52217371978E-03 + 1.56564159507E-03 1.61035786022E-03 1.65635879484E-03 1.70368162866E-03 + 1.75236492444E-03 1.80244825754E-03 1.85397237214E-03 1.90697908472E-03 + 1.96151193640E-03 2.01761525206E-03 2.07533490717E-03 2.13471813359E-03 + 2.19581367923E-03 2.25867146368E-03 2.32334341170E-03 2.38988243760E-03 + 2.45834342256E-03 2.52878286945E-03 2.60125894779E-03 2.67583139617E-03 + 2.75256201061E-03 2.83151456039E-03 2.91275440694E-03 2.99634929177E-03 + 3.08236882051E-03 3.17088466045E-03 3.26197075609E-03 3.35570357990E-03 + 3.45216139233E-03 3.55142560572E-03 3.65357939368E-03 3.75870909333E-03 + 3.86690345698E-03 3.97825424219E-03 4.09285560630E-03 4.21080507749E-03 + 4.33220293289E-03 4.45715303595E-03 4.58576239105E-03 4.71814086030E-03 + 4.85440220777E-03 4.99466426031E-03 5.13904763497E-03 5.28767742951E-03 + 5.44068278096E-03 5.59819679816E-03 5.76035645578E-03 5.92730423541E-03 + 6.09918595558E-03 6.27615324290E-03 6.45836179709E-03 6.64597304574E-03 + 6.83915370786E-03 7.03807525987E-03 7.24291549532E-03 7.45385806957E-03 + 7.67109219421E-03 7.89481430587E-03 8.12522611864E-03 8.36253751942E-03 + 8.60696438933E-03 8.85873004650E-03 9.11806606347E-03 9.38521099420E-03 + 9.66041220060E-03 9.94392514701E-03 1.02360139058E-02 1.05369520836E-02 + 1.08470225942E-02 1.11665177297E-02 1.14957406411E-02 1.18350049040E-02 + 1.21846346712E-02 1.25449658881E-02 1.29163463278E-02 1.32991359965E-02 + 1.36937078154E-02 1.41004482122E-02 1.45197568776E-02 1.49520490075E-02 + 1.53977532200E-02 1.58573156963E-02 1.63311968188E-02 1.68198752159E-02 + 1.73238469399E-02 1.78436260174E-02 1.83797456455E-02 1.89327587758E-02 + 1.95032389443E-02 2.00917812932E-02 2.06990038606E-02 2.13255471638E-02 + 2.19720767655E-02 2.26392816462E-02 2.33278834038E-02 2.40386182960E-02 + 2.47722708278E-02 2.55296330011E-02 2.63115430828E-02 2.71188710810E-02 + 2.79525188548E-02 2.88134133684E-02 2.97025348911E-02 3.06208910014E-02 + 3.15695375470E-02 3.25495657094E-02 3.35621130761E-02 3.46083613741E-02 + 3.56895425944E-02 3.68069321704E-02 3.79618701188E-02 3.91557332954E-02 + 4.03899738037E-02 4.16660853846E-02 4.29856312599E-02 4.43502478639E-02 + 4.57616208961E-02 4.72215133324E-02 4.87317662729E-02 5.02942942722E-02 + 5.19110953142E-02 5.35842363144E-02 5.53158863124E-02 5.71083037059E-02 + 5.89638322158E-02 6.08849245658E-02 6.28741214899E-02 6.49340949211E-02 + 6.70676134069E-02 6.92775668783E-02 7.15669586805E-02 7.39389374992E-02 + 7.63967758305E-02 7.89438835505E-02 8.15838112249E-02 8.43202815032E-02 + 8.71571566491E-02 9.00984691927E-02 9.31484117625E-02 9.63113856881E-02 + 9.95919429972E-02 1.02994860836E-01 1.06525098332E-01 1.10187840718E-01 + 1.13988480980E-01 1.17932638450E-01 1.22026184477E-01 1.26275235787E-01 + 1.30686154850E-01 1.35265578750E-01 1.40020428162E-01 1.44957900425E-01 + 1.50085524392E-01 1.55411085402E-01 1.60942731923E-01 1.66688954731E-01 + 1.72658569462E-01 1.78860757946E-01 1.85305081703E-01 1.92001477373E-01 + 1.98960288737E-01 2.06192263141E-01 2.13708606846E-01 2.21520905936E-01 + 2.29641257513E-01 2.38082189851E-01 2.46856719797E-01 2.55978370052E-01 + 2.65461151111E-01 2.75319608925E-01 2.85568797298E-01 2.96224376193E-01 + 3.07302493140E-01 3.18819897159E-01 3.30793928344E-01 3.43242480238E-01 + 3.56184098520E-01 3.69637877952E-01 3.83623546815E-01 3.98161485184E-01 + 4.13272665945E-01 4.28978678904E-01 4.45301771892E-01 4.62264771646E-01 + 4.79891143819E-01 4.98204998838E-01 5.17230986035E-01 5.36994392463E-01 + 5.57521069722E-01 5.78837386455E-01 6.00970270247E-01 6.23947137031E-01 + 6.47795842878E-01 6.72544721443E-01 6.98222410536E-01 7.24857948491E-01 + 7.52480598771E-01 7.81119827105E-01 8.10805276031E-01 8.41566570616E-01 + 8.73433391949E-01 9.06435259249E-01 9.40601430990E-01 9.75960842584E-01 + 1.01254193130E+00 1.05037260144E+00 1.08947994198E+00 1.12989019543E+00 + 1.17162847639E+00 1.21471867253E+00 1.25918330548E+00 1.30504318148E+00 + 1.35231728021E+00 1.40102250846E+00 1.45117359020E+00 1.50278249397E+00 + 1.55585860708E+00 1.61040810528E+00 1.66643393237E+00 1.72393535778E+00 + 1.78290779381E+00 1.84334242059E+00 1.90522605355E+00 1.96854060814E+00 + 2.03326294092E+00 2.09936457357E+00 2.16681137313E+00 2.23556322950E+00 + 2.30557392939E+00 2.37679057064E+00 2.44915382047E+00 2.52259727122E+00 + 2.59704734671E+00 2.67242323360E+00 2.74863686689E+00 2.82559239578E+00 + 2.90318663988E+00 2.98130876565E+00 3.05984025816E+00 3.13865555089E+00 + 3.21762147665E+00 3.29659797731E+00 3.37543811078E+00 3.45398871716E+00 + 3.53209050868E+00 3.60957861190E+00 3.68628338852E+00 3.76203086319E+00 + 3.83664335167E+00 3.90994045037E+00 3.98173981534E+00 4.05185781353E+00 + 4.12011083100E+00 4.18631622316E+00 4.25029305257E+00 4.31186344867E+00 + 4.37085371113E+00 4.42709518833E+00 4.48042558395E+00 4.53068993126E+00 + 4.57774177292E+00 4.62144408576E+00 4.66167006191E+00 4.69830437422E+00 + 4.73124380456E+00 4.76039784881E+00 4.78568937348E+00 4.80705535437E+00 + 4.82444694757E+00 4.83782981828E+00 4.84718440786E+00 4.85250585741E+00 + 4.85380358552E+00 4.85110150250E+00 4.84443728261E+00 4.83386185874E+00 + 4.81943909832E+00 4.80124454289E+00 4.77936528349E+00 4.75389852188E+00 + 4.72495096371E+00 4.69263739128E+00 4.65708021703E+00 4.61840798502E+00 + 4.57675465230E+00 4.53225794158E+00 4.48505870763E+00 4.43529994072E+00 + 4.38312502168E+00 4.32867754087E+00 4.27209946979E+00 4.21353081624E+00 + 4.15310808515E+00 4.09096389810E+00 4.02722560444E+00 3.96201513367E+00 + 3.89544799917E+00 3.82763295438E+00 3.75867174698E+00 3.68865905994E+00 + 3.61768289968E+00 3.54582489318E+00 3.47316127904E+00 3.39976428773E+00 + 3.32570355505E+00 3.25104797908E+00 3.17586789848E+00 3.10023709220E+00 + 3.02423491278E+00 2.94794757329E+00 2.87146932028E+00 2.79490164670E+00 + 2.71835131186E+00 2.64192565851E+00 2.56572951136E+00 2.48986458383E+00 + 2.41442899632E+00 2.33951722812E+00 2.26521985203E+00 2.19162356616E+00 + 2.11881084411E+00 2.04686011367E+00 1.97584530512E+00 1.90583617467E+00 + 1.83689793711E+00 1.76909147517E+00 1.70247307719E+00 1.63709460918E+00 + 1.57300352431E+00 1.51024277300E+00 1.44885093477E+00 1.38886230857E+00 + 1.33030689241E+00 1.27321056573E+00 1.21759496393E+00 1.16347790448E+00 + 1.11087319230E+00 1.05979102581E+00 1.01023780764E+00 9.62216587016E-01 + 9.15726990360E-01 8.70765476538E-01 8.27325436197E-01 7.85397375107E-01 + 7.44969033168E-01 7.06025573643E-01 6.68549773268E-01 6.32522114834E-01 + 5.97921030740E-01 5.64723018638E-01 5.32902728517E-01 5.02433299686E-01 + 4.73286355027E-01 4.45432204722E-01 4.18840051195E-01 3.93478017153E-01 + 3.69313448430E-01 3.46312890162E-01 3.24442320844E-01 3.03667209116E-01 + 2.83952738681E-01 2.65263795176E-01 2.47565165081E-01 2.30821639521E-01 + 2.14998065130E-01 2.00059444855E-01 1.85971093857E-01 1.72698597973E-01 + 1.60208029481E-01 1.48465883489E-01 1.37439244128E-01 1.27095757554E-01 + 1.17403766364E-01 1.08332277939E-01 9.98510700799E-02 9.19306877164E-02 + 8.45424869545E-02 7.76586499317E-02 7.12522065758E-02 6.52970921591E-02 + 5.97681074130E-02 5.46409469648E-02 4.98922047382E-02 4.54993919644E-02 + 4.14409255705E-02 3.76960996452E-02 3.42451164151E-02 3.10690589447E-02 + 2.81498803718E-02 2.54703933365E-02 2.30142521843E-02 2.07659361139E-02 + 1.87107314387E-02 1.68347087664E-02 1.51247048454E-02 1.35682982423E-02 + 1.21537851246E-02 1.08701583320E-02 9.70707905931E-03 8.65485531723E-03 + 7.70441269102E-03 6.84727295020E-03 6.07552456180E-03 5.38179996466E-03 + 4.75924866197E-03 4.20151172562E-03 3.70269818849E-03 3.25735905378E-03 + 2.86046353183E-03 2.50737607788E-03 2.19383248507E-03 1.91591779170E-03 + 1.67004493737E-03 1.45293277307E-03 1.26158690314E-03 1.09327917862E-03 + 9.45529604315E-04 8.16088393126E-04 7.02918223227E-04 6.04178890107E-04 + 5.18211270113E-04 4.43522779721E-04 3.78773919802E-04 3.22764870181E-04 + 2.74423625238E-04 2.32794475713E-04 1.97027379056E-04 1.66368066493E-04 + 1.40148841619E-04 1.17780092523E-04 9.87424215797E-05 8.25794443344E-05 + 6.88911240544E-05 5.73277364653E-05 4.75843179737E-05 3.93956408331E-05 + 3.25316493381E-05 2.67933250514E-05 2.20089781640E-05 1.80308934319E-05 + 1.47323481925E-05 1.20049301207E-05 9.75615813936E-06 7.90737583763E-06 + 6.39187353753E-06 5.15324831849E-06 4.14395490037E-06 3.32403724845E-06 + 2.66001904092E-06 2.12394412105E-06 1.69253946105E-06 1.34649370248E-06 + 1.06983586835E-06 8.49402174819E-07 6.74380360269E-07 5.33610051358E-07 + 4.20775250440E-07 3.30645518360E-07 2.58904920368E-07 2.02004837301E-07 + 1.57038216387E-07 1.21593274660E-07 9.37998176496E-08 7.20873890641E-08 + 5.51896803866E-08 4.20894928769E-08 3.19729341675E-08 2.41913262343E-08 + 1.82297335092E-08 1.36810406996E-08 1.02246978780E-08 7.60936397130E-09 + 5.63879637917E-09 4.16042701048E-09 3.05615799585E-09 2.23497469403E-09 + 1.62704855560E-09 1.17904755214E-09 8.50425821187E-10 6.10501736658E-10 + 4.36167401066E-10 3.10102698300E-10 2.19388437168E-10 1.54435490446E-10 + 1.08161970319E-10 7.53641377837E-11 5.22378845226E-11 3.60167655116E-11 + 2.46995657669E-11 1.68463590948E-11 1.14267090358E-11 7.70726811992E-12 + 5.16903171377E-12 3.44676892010E-12 2.28493451715E-12 1.50576698901E-12 + 9.86341897367E-13 6.42163627547E-13 4.15503518280E-13 2.67162952011E-13 + 1.70691337184E-13 1.08353060632E-13 6.83322083261E-14 4.28078997861E-14 + 2.66376223225E-14 1.64626051859E-14 1.01039475445E-14 6.15786608944E-15 + 3.72625590911E-15 2.23858961534E-15 1.33503026748E-15 7.90273524332E-16 + 4.64288033538E-16 2.70691666379E-16 1.56600266093E-16 8.98860957792E-17 + 5.11830898844E-17 2.89098169372E-17 1.61956826774E-17 8.99782813119E-18 + 4.95689169196E-18 2.70746272354E-18 1.46603475116E-18 7.86866998814E-19 + 4.18581024188E-19 2.20660158338E-19 1.15260059880E-19 5.96468959126E-20 + 3.05769085947E-20 1.55252297761E-20 7.80660708526E-21 3.88692994818E-21 + 1.91606694950E-21 9.35002586707E-22 4.51596755650E-22 2.15854728834E-22 + 1.02089494401E-22 4.77688018394E-23 2.21098384521E-23 1.01213403191E-23 + 4.58177706667E-24 2.05071204030E-24 9.07362132989E-25 3.96817877448E-25 + 1.71500261051E-25 7.32367107048E-26 3.08965222782E-26 1.28745635649E-26 + 5.29812118578E-27 2.15278609631E-27 8.63558389140E-28 3.41912820687E-28 + 1.33595505579E-28 5.15038774950E-29 1.95874223898E-29 7.34717671417E-30 + 2.71759530899E-30 9.91024470924E-31 3.56231402690E-31 1.26194363463E-31 + 4.40471798256E-32 1.51452319875E-32 5.12886520628E-33 1.71025488293E-33 + 5.61435490837E-34 1.81402156960E-34 5.76754733470E-35 1.80404458361E-35 + 5.55022617331E-36 1.67911272315E-36 4.99403745760E-37 1.45989680829E-37 + 4.19358067759E-38 1.18340369806E-38 3.27987374631E-39 8.92579917158E-40 + 2.38446518904E-40 6.25136878710E-41 1.60799396004E-41 4.05697263557E-42 + 1.00371328073E-42 2.43437323464E-43 5.78645622943E-44 1.34760578371E-44 + 3.07406020075E-45 6.86648148577E-46 1.50141145502E-46 3.21275911361E-47 + 6.72569451395E-48 1.37702672458E-48 2.75649759556E-49 5.39317854276E-50 + 1.03101230316E-50 1.92518603927E-51 3.51016359767E-52 6.24714708090E-53 + 1.08489497981E-53 1.83778643447E-54 3.03564833437E-55 4.88767643448E-56 + 7.66816303053E-57 1.17181572046E-57 1.74359369558E-58 2.52514229763E-59 + 3.55807698644E-60 4.87602332265E-61 6.49631007380E-62 8.41095924608E-63 + 1.05785676058E-63 1.29191266250E-64 1.53138401894E-65 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 +/ diff --git a/tests/apps/miniDFT/tests/benchmark/Ti.pbe.nml b/tests/apps/miniDFT/tests/benchmark/Ti.pbe.nml new file mode 100644 index 0000000000..0149b8d1ce --- /dev/null +++ b/tests/apps/miniDFT/tests/benchmark/Ti.pbe.nml @@ -0,0 +1,2746 @@ +&header + generated='Generated using "atomic" code by A. Dal Corso (Quantum ESPRESSO distribution)' + author = "AM" + date = "15Apr2011" + comment = "" + psd = "Ti" + typ = "NC" + rel ="scalar" + tvanp = .false. + tpawp = .false. + tcoulombp= .false. + has_so = .false. + has_wfc = .false. + has_gipaw= .false. + nlcc = .false. + dft = "PBE " + zp = 1.200000000000000E+001 + etotps = -1.092354330442288E+002 + ecutwfc = 0.000000000000000E+000 + ecutrho = 0.000000000000000E+000 + nv = "2.0.1" + lmax = 2 + lmax_rho = 4 + lloc = 0 + nmesh = 1177 + nwfc = 3 + nbeta = 2 +/ +&mesh + dx = 1.250000000000000E-002 + nmesh = 1177 + xmin =-7.000000000000000E+000 + rmax = 1.000000000000000E+002 + zmesh = 2.200000000000000E+001 + r(1:1177) = + 4.144918025247801E-005 4.197054675768283E-005 4.249847124620828E-005 4.303303620732972E-005 + 4.357432516790999E-005 4.412242270545040E-005 4.467741446130630E-005 4.523938715406870E-005 + 4.580842859311411E-005 4.638462769232521E-005 4.696807448398350E-005 4.755886013283720E-005 + 4.815707695034592E-005 4.876281840910440E-005 4.937617915744808E-005 4.999725503424174E-005 + 5.062614308385469E-005 5.126294157132420E-005 5.190774999770943E-005 5.256066911563899E-005 + 5.322180094505338E-005 5.389124878914604E-005 5.456911725050459E-005 5.525551224745521E-005 + 5.595054103061277E-005 5.665431219963862E-005 5.736693572020975E-005 5.808852294120111E-005 + 5.881918661208400E-005 5.955904090054364E-005 6.030820141031780E-005 6.106678519926031E-005 + 6.183491079763153E-005 6.261269822661895E-005 6.340026901709085E-005 6.419774622858552E-005 + 6.500525446853975E-005 6.582291991175889E-005 6.665087032013196E-005 6.748923506259485E-005 + 6.833814513534419E-005 6.919773318230599E-005 7.006813351586138E-005 7.094948213783328E-005 + 7.184191676073714E-005 7.274557682929838E-005 7.366060354224122E-005 7.458713987435118E-005 + 7.552533059881518E-005 7.647532230984278E-005 7.743726344557155E-005 7.841130431126101E-005 + 7.939759710277816E-005 8.039629593037822E-005 8.140755684278499E-005 8.243153785157342E-005 + 8.346839895585942E-005 8.451830216730004E-005 8.558141153540807E-005 8.665789317318529E-005 + 8.774791528307769E-005 8.885164818325759E-005 8.996926433423621E-005 9.110093836581087E-005 + 9.224684710435155E-005 9.340716960042995E-005 9.458208715679679E-005 9.577178335671064E-005 + 9.697644409262310E-005 9.819625759522520E-005 9.943141446285842E-005 1.006821076912962E-004 + 1.019485327039001E-004 1.032308873821549E-004 1.045293720965880E-004 1.058441897380779E-004 + 1.071755457495560E-004 1.085236481581079E-004 1.098887076074774E-004 1.112709373909811E-004 + 1.126705534848345E-004 1.140877745818999E-004 1.155228221258572E-004 1.169759203458045E-004 + 1.184472962912954E-004 1.199371798678146E-004 1.214458038727023E-004 1.229734040315285E-004 + 1.245202190349258E-004 1.260864905758858E-004 1.276724633875233E-004 1.292783852813167E-004 + 1.309045071858292E-004 1.325510831859167E-004 1.342183705624294E-004 1.359066298324118E-004 + 1.376161247898098E-004 1.393471225466883E-004 1.410998935749686E-004 1.428747117486900E-004 + 1.446718543868030E-004 1.464916022965012E-004 1.483342398170977E-004 1.502000548644537E-004 + 1.520893389759669E-004 1.540023873561233E-004 1.559394989226243E-004 1.579009763530933E-004 + 1.598871261323695E-004 1.618982586003968E-004 1.639346880007150E-004 1.659967325295611E-004 + 1.680847143855878E-004 1.701989598202082E-004 1.723397991885731E-004 1.745075670011893E-004 + 1.767026019761877E-004 1.789252470922492E-004 1.811758496421950E-004 1.834547612872527E-004 + 1.857623381120030E-004 1.880989406800198E-004 1.904649340902081E-004 1.928606880338518E-004 + 1.952865768523791E-004 1.977429795958531E-004 2.002302800822003E-004 2.027488669571819E-004 + 2.052991337551212E-004 2.078814789603942E-004 2.104963060696930E-004 2.131440236550732E-004 + 2.158250454277944E-004 2.185397903029630E-004 2.212886824649892E-004 2.240721514338660E-004 + 2.268906321322826E-004 2.297445649535825E-004 2.326343958305751E-004 2.355605763052148E-004 + 2.385235635991538E-004 2.415238206851853E-004 2.445618163595828E-004 2.476380253153511E-004 + 2.507529282163987E-004 2.539070117726409E-004 2.571007688160504E-004 2.603346983776630E-004 + 2.636093057655519E-004 2.669251026437842E-004 2.702826071123679E-004 2.736823437882072E-004 + 2.771248438870744E-004 2.806106453066137E-004 2.841402927103891E-004 2.877143376129885E-004 + 2.913333384661993E-004 2.949978607462676E-004 2.987084770422551E-004 3.024657671455079E-004 + 3.062703181402485E-004 3.101227244953103E-004 3.140235881570242E-004 3.179735186432732E-004 + 3.219731331387330E-004 3.260230565913045E-004 3.301239218097678E-004 3.342763695626562E-004 + 3.384810486783790E-004 3.427386161466034E-004 3.470497372209074E-004 3.514150855227305E-004 + 3.558353431466261E-004 3.603112007668406E-004 3.648433577452346E-004 3.694325222405551E-004 + 3.740794113190923E-004 3.787847510667186E-004 3.835492767023423E-004 3.883737326927885E-004 + 3.932588728691197E-004 3.982054605444285E-004 4.032142686331026E-004 4.082860797715962E-004 + 4.134216864407193E-004 4.186218910894609E-004 4.238875062603785E-004 4.292193547165551E-004 + 4.346182695701593E-004 4.400850944126224E-004 4.456206834464467E-004 4.512259016186824E-004 + 4.569016247560721E-004 4.626487397019031E-004 4.684681444545795E-004 4.743607483079320E-004 + 4.803274719933025E-004 4.863692478234058E-004 4.924870198380069E-004 4.986817439514312E-004 + 5.049543881019231E-004 5.113059324028938E-004 5.177373692960626E-004 5.242497037065282E-004 + 5.308439531997933E-004 5.375211481407553E-004 5.442823318547100E-004 5.511285607903681E-004 + 5.580609046849289E-004 5.650804467312315E-004 5.721882837469999E-004 5.793855263462304E-004 + 5.866732991127215E-004 5.940527407757945E-004 6.015250043882246E-004 6.090912575064013E-004 + 6.167526823727698E-004 6.245104761005520E-004 6.323658508608008E-004 6.403200340718061E-004 + 6.483742685908753E-004 6.565298129085399E-004 6.647879413451919E-004 6.731499442502000E-004 + 6.816171282035326E-004 6.901908162199066E-004 6.988723479555197E-004 7.076630799173677E-004 + 7.165643856752040E-004 7.255776560761647E-004 7.347042994620852E-004 7.439457418895648E-004 + 7.533034273527843E-004 7.627788180091345E-004 7.723733944076856E-004 7.820886557205174E-004 + 7.919261199769780E-004 8.018873243008710E-004 8.119738251506379E-004 8.221871985625597E-004 + 8.325290403970082E-004 8.430009665878129E-004 8.536046133947459E-004 8.643416376591935E-004 + 8.752137170630423E-004 8.862225503908180E-004 8.973698577951265E-004 9.086573810654287E-004 + 9.200868839001996E-004 9.316601521825118E-004 9.433789942590792E-004 9.552452412228196E-004 + 9.672607471989625E-004 9.794273896347623E-004 9.917470695928533E-004 1.004221712048293E-003 + 1.016853266189346E-003 1.029643705722044E-003 1.042595029178588E-003 1.055709260229617E-003 + 1.068988448000414E-003 1.082434667391085E-003 1.096050019400767E-003 1.109836631455911E-003 + 1.123796657742700E-003 1.137932279543643E-003 1.152245705578407E-003 1.166739172348929E-003 + 1.181414944488879E-003 1.196275315117514E-003 1.211322606197977E-003 1.226559168900113E-003 + 1.241987383967844E-003 1.257609662091163E-003 1.273428444282810E-003 1.289446202259686E-003 + 1.305665438829065E-003 1.322088688279658E-003 1.338718516777604E-003 1.355557522767441E-003 + 1.372608337378114E-003 1.389873624834095E-003 1.407356082871677E-003 1.425058443160495E-003 + 1.442983471730361E-003 1.461133969403458E-003 1.479512772231974E-003 1.498122751941244E-003 + 1.516966816378458E-003 1.536047909967025E-003 1.555369014166638E-003 1.574933147939137E-003 + 1.594743368220229E-003 1.614802770397135E-003 1.635114488792258E-003 1.655681697152920E-003 + 1.676507609147273E-003 1.697595478866437E-003 1.718948601332958E-003 1.740570313015666E-003 + 1.762463992351000E-003 1.784633060270901E-003 1.807080980737333E-003 1.829811261283539E-003 + 1.852827453562101E-003 1.876133153899889E-003 1.899732003859996E-003 1.923627690810742E-003 + 1.947823948501827E-003 1.972324557647745E-003 1.997133346518519E-003 2.022254191537887E-003 + 2.047691017888992E-003 2.073447800127700E-003 2.099528562803642E-003 2.125937381089044E-003 + 2.152678381415497E-003 2.179755742118704E-003 2.207173694091362E-003 2.234936521444254E-003 + 2.263048562175634E-003 2.291514208849063E-003 2.320337909279746E-003 2.349524167229519E-003 + 2.379077543110563E-003 2.409002654697991E-003 2.439304177851370E-003 2.469986847245341E-003 + 2.501055457109421E-003 2.532514861977109E-003 2.564369977444425E-003 2.596625780937968E-003 + 2.629287312492658E-003 2.662359675539253E-003 2.695848037701760E-003 2.729757631604907E-003 + 2.764093755691726E-003 2.798861775051465E-003 2.834067122257884E-003 2.869715298218108E-003 + 2.905811873032162E-003 2.942362486863298E-003 2.979372850819289E-003 3.016848747844802E-003 + 3.054796033624989E-003 3.093220637500463E-003 3.132128563393754E-003 3.171525890747439E-003 + 3.211418775474074E-003 3.251813450918055E-003 3.292716228829612E-003 3.334133500351006E-003 + 3.376071737015178E-003 3.418537491756929E-003 3.461537399936833E-003 3.505078180378032E-003 + 3.549166636416053E-003 3.593809656961849E-003 3.639014217578208E-003 3.684787381569693E-003 + 3.731136301086309E-003 3.778068218241025E-003 3.825590466241382E-003 3.873710470535313E-003 + 3.922435749971386E-003 3.971773917973654E-003 4.021732683731242E-003 4.072319853402942E-003 + 4.123543331336934E-003 4.175411121305859E-003 4.227931327757431E-003 4.281112157080758E-003 + 4.334961918888621E-003 4.389489027315858E-003 4.444702002334093E-003 4.500609471083014E-003 + 4.557220169218352E-003 4.614542942276868E-003 4.672586747058474E-003 4.731360653025756E-003 + 4.790873843721106E-003 4.851135618201646E-003 4.912155392492241E-003 4.973942701056772E-003 + 5.036507198287908E-003 5.099858660015624E-003 5.164006985034717E-003 5.228962196651474E-003 + 5.294734444249865E-003 5.361334004877390E-003 5.428771284850892E-003 5.497056821382577E-003 + 5.566201284226452E-003 5.636215477345513E-003 5.707110340599878E-003 5.778896951456163E-003 + 5.851586526718374E-003 5.925190424280532E-003 5.999720144901377E-003 6.075187334001387E-003 + 6.151603783482396E-003 6.228981433570113E-003 6.307332374679786E-003 6.386668849305372E-003 + 6.467003253932440E-003 6.548348140975149E-003 6.630716220737610E-003 6.714120363399857E-003 + 6.798573601028869E-003 6.884089129614849E-003 6.970680311133112E-003 7.058360675631955E-003 + 7.147143923346712E-003 7.237043926840470E-003 7.328074733171677E-003 7.420250566089018E-003 + 7.513585828253935E-003 7.608095103491025E-003 7.703793159066827E-003 7.800694947997220E-003 + 7.898815611383871E-003 7.998170480780069E-003 8.098775080586295E-003 8.200645130475949E-003 + 8.303796547851581E-003 8.408245450332013E-003 8.514008158270775E-003 8.621101197306151E-003 + 8.729541300943373E-003 8.839345413169258E-003 8.950530691099729E-003 9.063114507660690E-003 + 9.177114454302521E-003 9.292548343748822E-003 9.409434212779672E-003 9.527790325049900E-003 + 9.647635173942869E-003 9.768987485460030E-003 9.891866221146954E-003 1.001629058105609E-002 + 1.014228000674681E-002 1.026985418432322E-002 1.039903304751011E-002 1.052983678076768E-002 + 1.066228582244536E-002 1.079640086797537E-002 1.093220287310646E-002 1.106971305717822E-002 + 1.120895290643666E-002 1.134994417739153E-002 1.149270890021575E-002 1.163726938218773E-002 + 1.178364821117689E-002 1.193186825917306E-002 1.208195268586031E-002 1.223392494223563E-002 + 1.238780877427330E-002 1.254362822663515E-002 1.270140764642761E-002 1.286117168700605E-002 + 1.302294531182682E-002 1.318675379834797E-002 1.335262274197877E-002 1.352057806007912E-002 + 1.369064599600919E-002 1.386285312322997E-002 1.403722634945545E-002 1.421379292085699E-002 + 1.439258042632061E-002 1.457361680175777E-002 1.475693033447044E-002 1.494254966757110E-002 + 1.513050380445817E-002 1.532082211334793E-002 1.551353433186336E-002 1.570867057168066E-002 + 1.590626132323434E-002 1.610633746048131E-002 1.630893024572508E-002 1.651407133450052E-002 + 1.672179278052011E-002 1.693212704068241E-002 1.714510698014350E-002 1.736076587745223E-002 + 1.757913742975007E-002 1.780025575803632E-002 1.802415541249968E-002 1.825087137791667E-002 + 1.848043907911815E-002 1.871289438652449E-002 1.894827362175038E-002 1.918661356328025E-002 + 1.942795145221485E-002 1.967232499809034E-002 1.991977238477044E-002 2.017033227641272E-002 + 2.042404382351008E-002 2.068094666900790E-002 2.094108095449846E-002 2.120448732649312E-002 + 2.147120694277339E-002 2.174128147882201E-002 2.201475313433467E-002 2.229166463981393E-002 + 2.257205926324590E-002 2.285598081686095E-002 2.314347366397951E-002 2.343458272594383E-002 + 2.372935348913711E-002 2.402783201209080E-002 2.433006493268138E-002 2.463609947541760E-002 + 2.494598345881939E-002 2.525976530288962E-002 2.557749403667983E-002 2.589921930595105E-002 + 2.622499138093122E-002 2.655486116416982E-002 2.688888019849161E-002 2.722710067505026E-002 + 2.756957544148334E-002 2.791635801016991E-002 2.826750256659183E-002 2.862306397780047E-002 + 2.898309780098972E-002 2.934766029217691E-002 2.971680841499307E-002 3.009059984958337E-002 + 3.046909300161998E-002 3.085234701142795E-002 3.124042176322601E-002 3.163337789448373E-002 + 3.203127680539607E-002 3.243418066847741E-002 3.284215243827603E-002 3.325525586121099E-002 + 3.367355548553264E-002 3.409711667140827E-002 3.452600560113495E-002 3.496028928948050E-002 + 3.540003559415477E-002 3.584531322641258E-002 3.629619176178988E-002 3.675274165097513E-002 + 3.721503423081739E-002 3.768314173547274E-002 3.815713730769125E-002 3.863709501024538E-002 + 3.912308983750265E-002 3.961519772714357E-002 4.011349557202706E-002 4.061806123220527E-002 + 4.112897354708908E-002 4.164631234776719E-002 4.217015846947970E-002 4.270059376424890E-002 + 4.323770111366882E-002 4.378156444185555E-002 4.433226872856060E-002 4.488990002244918E-002 + 4.545454545454546E-002 4.602629325184703E-002 4.660523275111042E-002 4.719145441281025E-002 + 4.778504983527385E-002 4.838611176899361E-002 4.899473413111963E-002 4.961101202013418E-002 + 5.023504173071128E-002 5.086692076876279E-002 5.150674786667393E-002 5.215462299873057E-002 + 5.281064739674016E-002 5.347492356584960E-002 5.414755530056177E-002 5.482864770095366E-002 + 5.551830718909864E-002 5.621664152569478E-002 5.692375982690296E-002 5.763977258139638E-002 + 5.836479166762461E-002 5.909893037129506E-002 5.984230340307373E-002 6.059502691650925E-002 + 6.135721852618201E-002 6.212899732608165E-002 6.291048390821598E-002 6.370180038145336E-002 + 6.450307039060264E-002 6.531441913573298E-002 6.613597339173642E-002 6.696786152813708E-002 + 6.781021352914868E-002 6.866316101398516E-002 6.952683725742635E-002 7.040137721064242E-002 + 7.128691752228042E-002 7.218359655981564E-002 7.309155443117199E-002 7.401093300661414E-002 + 7.494187594091492E-002 7.588452869580196E-002 7.683903856268599E-002 7.780555468567570E-002 + 7.878422808488166E-002 7.977521168001357E-002 8.077866031427448E-002 8.179473077855497E-002 + 8.282358183593228E-002 8.386537424647732E-002 8.492027079237374E-002 8.598843630335319E-002 + 8.707003768244985E-002 8.816524393207978E-002 8.927422618044766E-002 9.039715770828599E-002 + 9.153421397593077E-002 9.268557265073708E-002 9.385141363484034E-002 9.503191909326623E-002 + 9.622727348239431E-002 9.743766357877998E-002 9.866327850833832E-002 9.990430977589559E-002 + 1.011609512951122E-001 1.024333994187822E-001 1.037218529695138E-001 1.050265132707957E-001 + 1.063475841784542E-001 1.076852721125064E-001 1.090397860894135E-001 1.104113377547404E-001 + 1.118001414162250E-001 1.132064140772651E-001 1.146303754708250E-001 1.160722480937694E-001 + 1.175322572416294E-001 1.190106310438046E-001 1.205076004992094E-001 1.220233995123669E-001 + 1.235582649299566E-001 1.251124365778231E-001 1.266861572984478E-001 1.282796729888954E-001 + 1.298932326392348E-001 1.315270883714437E-001 1.331814954788048E-001 1.348567124657940E-001 + 1.365530010884742E-001 1.382706263953939E-001 1.400098567690014E-001 1.417709639675816E-001 + 1.435542231677168E-001 1.453599130072852E-001 1.471883156289983E-001 1.490397167244852E-001 + 1.509144055789342E-001 1.528126751162923E-001 1.547348219450372E-001 1.566811464045217E-001 + 1.586519526119019E-001 1.606475485096579E-001 1.626682459137082E-001 1.647143605621337E-001 + 1.667862121645112E-001 1.688841244518684E-001 1.710084252272688E-001 1.731594464170301E-001 + 1.753375241225897E-001 1.775429986730207E-001 1.797762146782081E-001 1.820375210826968E-001 + 1.843272712202126E-001 1.866458228688732E-001 1.889935383070914E-001 1.913707843701800E-001 + 1.937779325076737E-001 1.962153588413657E-001 1.986834442240799E-001 2.011825742991790E-001 + 2.037131395608211E-001 2.062755354149776E-001 2.088701622412132E-001 2.114974254552486E-001 + 2.141577355723066E-001 2.168515082712547E-001 2.195791644595584E-001 2.223411303390457E-001 + 2.251378374725052E-001 2.279697228511165E-001 2.308372289627310E-001 2.337408038610133E-001 + 2.366809012354477E-001 2.396579804822314E-001 2.426725067760536E-001 2.457249511427803E-001 + 2.488157905330548E-001 2.519455078968193E-001 2.551145922587797E-001 2.583235387948158E-001 + 2.615728489093514E-001 2.648630303137036E-001 2.681945971054099E-001 2.715680698485601E-001 + 2.749839756551341E-001 2.784428482673630E-001 2.819452281411305E-001 2.854916625304166E-001 + 2.890827055728104E-001 2.927189183760938E-001 2.964008691059142E-001 3.001291330745652E-001 + 3.039042928308760E-001 3.077269382512397E-001 3.115976666317810E-001 3.155170827816834E-001 + 3.194857991176955E-001 3.235044357598180E-001 3.275736206282029E-001 3.316939895412653E-001 + 3.358661863150296E-001 3.400908628637312E-001 3.443686793016749E-001 3.487003040463831E-001 + 3.530864139230354E-001 3.575276942702224E-001 3.620248390470355E-001 3.665785509414943E-001 + 3.711895414803476E-001 3.758585311402488E-001 3.805862494603302E-001 3.853734351561992E-001 + 3.902208362353589E-001 3.951292101140910E-001 4.000993237358006E-001 4.051319536908517E-001 + 4.102278863379150E-001 4.153879179268331E-001 4.206128547230404E-001 4.259035131335425E-001 + 4.312607198344784E-001 4.366853119002960E-001 4.421781369345403E-001 4.477400532022991E-001 + 4.533719297643058E-001 4.590746466127297E-001 4.648490948086823E-001 4.706961766214407E-001 + 4.766168056694350E-001 4.826119070630005E-001 4.886824175489252E-001 4.948292856568249E-001 + 5.010534718473457E-001 5.073559486622439E-001 5.137377008763450E-001 5.201997256514146E-001 + 5.267430326919729E-001 5.333686444030552E-001 5.400775960499725E-001 5.468709359200700E-001 + 5.537497254865215E-001 5.607150395741939E-001 5.677679665275824E-001 5.749096083808737E-001 + 5.821410810301383E-001 5.894635144076878E-001 5.968780526586377E-001 6.043858543196722E-001 + 6.119880925000777E-001 6.196859550650348E-001 6.274806448212316E-001 6.353733797048021E-001 + 6.433653929716276E-001 6.514579333900431E-001 6.596522654359511E-001 6.679496694904065E-001 + 6.763514420396750E-001 6.848588958778087E-001 6.934733603117809E-001 7.021961813691830E-001 + 7.110287220085533E-001 7.199723623323379E-001 7.290284998025307E-001 7.381985494590390E-001 + 7.474839441407756E-001 7.568861347095520E-001 7.664065902767749E-001 7.760467984329936E-001 + 7.858082654803483E-001 7.956925166679223E-001 8.057010964300747E-001 8.158355686277571E-001 + 8.260975167928667E-001 8.364885443756851E-001 8.470102749954098E-001 8.576643526938583E-001 + 8.684524421923485E-001 8.793762291518099E-001 8.904374204361827E-001 9.016377443791060E-001 + 9.129789510539849E-001 9.244628125474376E-001 9.360911232361834E-001 9.478657000674289E-001 + 9.597883828427558E-001 9.718610345056065E-001 9.840855414323670E-001 9.964638137271123E-001 + 1.008997785520076E+000 1.021689415269847E+000 1.034540686069397E+000 1.047553605955936E+000 + 1.060730208224669E+000 1.074072551746511E+000 1.087582721289780E+000 1.101262827845954E+000 + 1.115115008959517E+000 1.129141429061948E+000 1.143344279809927E+000 1.157725780427777E+000 + 1.172288178054230E+000 1.187033748093545E+000 1.201964794571037E+000 1.217083650493098E+000 + 1.232392678211723E+000 1.247894269793641E+000 1.263590847394077E+000 1.279484863635212E+000 + 1.295578801989423E+000 1.311875177167320E+000 1.328376535510679E+000 1.345085455390317E+000 + 1.362004547608956E+000 1.379136455809180E+000 1.396483856886497E+000 1.414049461407621E+000 + 1.431836014033999E+000 1.449846293950659E+000 1.468083115300487E+000 1.486549327623917E+000 + 1.505247816304196E+000 1.524181503018226E+000 1.543353346193071E+000 1.562766341468238E+000 + 1.582423522163730E+000 1.602327959754025E+000 1.622482764347996E+000 1.642891085174861E+000 + 1.663556111076274E+000 1.684481071004573E+000 1.705669234527318E+000 1.727123912338173E+000 + 1.748848456774188E+000 1.770846262339637E+000 1.793120766236389E+000 1.815675448900997E+000 + 1.838513834548520E+000 1.861639491723173E+000 1.885056033855946E+000 1.908767119829182E+000 + 1.932776454548308E+000 1.957087789520725E+000 1.981704923441978E+000 2.006631702789331E+000 + 2.031872022422766E+000 2.057429826193580E+000 2.083309107560614E+000 2.109513910214226E+000 + 2.136048328708152E+000 2.162916509099259E+000 2.190122649595401E+000 2.217671001211384E+000 + 2.245565868433190E+000 2.273811609890582E+000 2.302412639038121E+000 2.331373424844805E+000 + 2.360698492492340E+000 2.390392424082203E+000 2.420459859351622E+000 2.450905496398526E+000 + 2.481734092415647E+000 2.512950464433840E+000 2.544559490074734E+000 2.576566108312903E+000 + 2.608975320247556E+000 2.641792189883999E+000 2.675021844924884E+000 2.708669477571409E+000 + 2.742740345334639E+000 2.777239771856971E+000 2.812173147743995E+000 2.847545931406769E+000 + 2.883363649914697E+000 2.919631899859179E+000 2.956356348228046E+000 2.993542733291077E+000 + 3.031196865496601E+000 3.069324628379370E+000 3.107931979479919E+000 3.147024951275393E+000 + 3.186609652122175E+000 3.226692267210315E+000 3.267279059529958E+000 3.308376370849988E+000 + 3.349990622708902E+000 3.392128317418223E+000 3.434796039078485E+000 3.478000454607995E+000 + 3.521748314784590E+000 3.566046455300416E+000 3.610901797830060E+000 3.656321351112060E+000 + 3.702312212044006E+000 3.748881566791505E+000 3.796036691910967E+000 3.843784955486636E+000 + 3.892133818281848E+000 3.941090834904768E+000 3.990663654988860E+000 4.040860024388106E+000 + 4.091687786387355E+000 4.143154882927838E+000 4.195269355848086E+000 4.248039348140534E+000 + 4.301473105223825E+000 4.355578976231222E+000 4.410365415315156E+000 4.465840982968185E+000 + 4.522014347360634E+000 4.578894285694960E+000 4.636489685577259E+000 4.694809546405948E+000 + 4.753862980777919E+000 4.813659215912455E+000 4.874207595092934E+000 4.935517579126800E+000 + 4.997598747823800E+000 5.060460801492834E+000 5.124113562457697E+000 5.188566976591774E+000 + 5.253831114872167E+000 5.319916174953269E+000 5.386832482760152E+000 5.454590494102071E+000 + 5.523200796306135E+000 5.592674109871661E+000 5.663021290145248E+000 5.734253329016917E+000 + 5.806381356637683E+000 5.879416643158589E+000 5.953370600491755E+000 6.028254784093485E+000 + 6.104080894769797E+000 6.180860780504778E+000 6.258606438311760E+000 6.337330016107962E+000 + 6.417043814612591E+000 6.497760289268819E+000 6.579492052190052E+000 6.662251874130508E+000 + 6.746052686480755E+000 6.830907583288226E+000 6.916829823303164E+000 7.003832832050406E+000 + 7.091930203927050E+000 7.181135704326703E+000 7.271463271790304E+000 7.362927020184016E+000 + 7.455541240904636E+000 7.549320405112550E+000 7.644279165992975E+000 7.740432361045507E+000 + 7.837795014402470E+000 7.936382339176566E+000 8.036209739837838E+000 8.137292814620757E+000 + 8.239647357961426E+000 8.343289362965454E+000 8.448235023907015E+000 8.554500738759113E+000 + 8.662103111755910E+000 8.771058955987117E+000 8.881385296025043E+000 8.993099370584806E+000 + 9.106218635217811E+000 9.220760765039314E+000 9.336743657490153E+000 9.454185435133210E+000 + 9.573104448485216E+000 9.693519278883912E+000 9.815448741391551E+000 9.938911887734735E+000 + 1.006392800928123E+001 1.019051664005442E+001 1.031869755978537E+001 1.044849079700358E+001 + 1.057991663216647E+001 1.071299560082812E+001 1.084774849684818E+001 1.098419637564076E+001 + 1.112236055746456E+001 1.126226263075411E+001 1.140392445549294E+001 1.154736816662942E+001 + 1.169261617753523E+001 1.183969118350758E+001 1.198861616531542E+001 1.213941439279010E+001 + 1.229210942846150E+001 1.244672513123957E+001 1.260328566014245E+001 1.276181547807134E+001 + 1.292233935563277E+001 1.308488237500924E+001 1.324946993387819E+001 1.341612774938056E+001 + 1.358488186213912E+001 1.375575864032727E+001 1.392878478378930E+001 1.410398732821211E+001 + 1.428139364934974E+001 1.446103146730082E+001 1.464292885083984E+001 1.482711422180311E+001 + 1.501361635952949E+001 1.520246440535750E+001 1.539368786717853E+001 1.558731662404747E+001 + 1.578338093085159E+001 1.598191142303767E+001 1.618293912139905E+001 1.638649543692262E+001 + 1.659261217569677E+001 1.680132154388133E+001 1.701265615273964E+001 1.722664902373434E+001 + 1.744333359368692E+001 1.766274372000222E+001 1.788491368595893E+001 1.810987820606618E+001 + 1.833767243148796E+001 1.856833195553548E+001 1.880189281922858E+001 1.903839151692747E+001 + 1.927786500203475E+001 1.952035069276972E+001 1.976588647801494E+001 2.001451072323631E+001 + 2.026626227647807E+001 2.052118047443252E+001 2.077930514858677E+001 2.104067663144635E+001 + 2.130533576283714E+001 2.157332389628695E+001 2.184468290548679E+001 2.211945519083396E+001 + 2.239768368605712E+001 2.267941186492464E+001 2.296468374803770E+001 2.325354390970837E+001 + 2.354603748492464E+001 2.384221017640275E+001 2.414210826172823E+001 2.444577860058715E+001 + 2.475326864208770E+001 2.506462643217449E+001 2.537990062113573E+001 2.569914047120478E+001 + 2.602239586425781E+001 2.634971730960757E+001 2.668115595189586E+001 2.701676357908492E+001 + 2.735659263054919E+001 2.770069620526946E+001 2.804912807012926E+001 2.840194266831640E+001 + 2.875919512782973E+001 2.912094127009277E+001 2.948723761867632E+001 2.985814140812999E+001 + 3.023371059292554E+001 3.061400385651225E+001 3.099908062048616E+001 3.138900105387520E+001 + 3.178382608254026E+001 3.218361739869543E+001 3.258843747054727E+001 3.299834955205552E+001 + 3.341341769281700E+001 3.383370674807305E+001 3.425928238884369E+001 3.469021111218871E+001 + 3.512656025159772E+001 3.556839798751167E+001 3.601579335797555E+001 3.646881626942632E+001 + 3.692753750761563E+001 3.739202874867011E+001 3.786236257029131E+001 3.833861246309561E+001 + 3.882085284209780E+001 3.930915905833826E+001 3.980360741065663E+001 4.030427515761406E+001 + 4.081124052956447E+001 4.132458274087874E+001 4.184438200232186E+001 4.237071953358583E+001 + 4.290367757598090E+001 4.344333940528534E+001 4.398978934475803E+001 4.454311277831383E+001 + 4.510339616386483E+001 4.567072704683008E+001 4.624519407381415E+001 4.682688700645881E+001 + 4.741589673546837E+001 4.801231529481115E+001 4.861623587610064E+001 4.922775284315619E+001 + 4.984696174674811E+001 5.047395933952750E+001 5.110884359114366E+001 5.175171370355278E+001 + 5.240267012651766E+001 5.306181457330388E+001 5.372925003657236E+001 5.440508080447198E+001 + 5.508941247693538E+001 5.578235198217849E+001 5.648400759340890E+001 5.719448894574348E+001 + 5.791390705333882E+001 5.864237432673811E+001 5.938000459043467E+001 6.012691310065807E+001 + 6.088321656338269E+001 6.164903315256311E+001 6.242448252859965E+001 6.320968585703477E+001 + 6.400476582748617E+001 6.480984667281692E+001 6.562505418854684E+001 6.645051575250906E+001 + 6.728636034475211E+001 6.813271856769418E+001 6.898972266652969E+001 6.985750654989238E+001 + 7.073620581077982E+001 7.162595774773901E+001 7.252690138632042E+001 7.343917750080070E+001 + 7.436292863617849E+001 7.529829913044841E+001 7.624543513715288E+001 7.720448464822010E+001 + 7.817559751708747E+001 7.915892548211623E+001 8.015462219030179E+001 8.116284322128031E+001 + 8.218374611163924E+001 8.321749037953238E+001 8.426423754960447E+001 8.532415117823076E+001 + 8.639739687907185E+001 8.748414234895215E+001 8.858455739406249E+001 8.969881395649219E+001 + 9.082708614109640E+001 9.196955024269914E+001 9.312638477364081E+001 9.429777049167060E+001 + 9.548389042818989E+001 9.668492991685221E+001 9.790107662252090E+001 9.913252057059316E+001 + 1.003794541766914E+002 + + rab(1:1177) = + 5.181147531559752E-007 5.246318344710354E-007 5.312308905776035E-007 5.379129525916215E-007 + 5.446790645988750E-007 5.515302838181300E-007 5.584676807663288E-007 5.654923394258587E-007 + 5.726053574139265E-007 5.798078461540652E-007 5.871009310497938E-007 5.944857516604651E-007 + 6.019634618793240E-007 6.095352301138051E-007 6.172022394681011E-007 6.249656879280218E-007 + 6.328267885481837E-007 6.407867696415525E-007 6.488468749713680E-007 6.570083639454874E-007 + 6.652725118131673E-007 6.736406098643256E-007 6.821139656313074E-007 6.906939030931902E-007 + 6.993817628826597E-007 7.081789024954827E-007 7.170866965026219E-007 7.261065367650139E-007 + 7.352398326510501E-007 7.444880112567955E-007 7.538525176289725E-007 7.633348149907539E-007 + 7.729363849703942E-007 7.826587278327370E-007 7.925033627136357E-007 8.024718278573191E-007 + 8.125656808567469E-007 8.227864988969862E-007 8.331358790016495E-007 8.436154382824357E-007 + 8.542268141918024E-007 8.649716647788249E-007 8.758516689482673E-007 8.868685267229160E-007 + 8.980239595092143E-007 9.093197103662298E-007 9.207575442780153E-007 9.323392484293898E-007 + 9.440666324851898E-007 9.559415288730349E-007 9.679657930696443E-007 9.801413038907627E-007 + 9.924699637847271E-007 1.004953699129728E-006 1.017594460534812E-006 1.030394223144668E-006 + 1.043354986948243E-006 1.056478777091251E-006 1.069767644192601E-006 1.083223664664816E-006 + 1.096848941038471E-006 1.110645602290720E-006 1.124615804177953E-006 1.138761729572636E-006 + 1.153085588804394E-006 1.167589620005375E-006 1.182276089459960E-006 1.197147291958883E-006 + 1.212205551157789E-006 1.227453219940315E-006 1.242892680785730E-006 1.258526346141203E-006 + 1.274356658798752E-006 1.290386092276936E-006 1.306617151207350E-006 1.323052371725974E-006 + 1.339694321869451E-006 1.356545601976349E-006 1.373608845093468E-006 1.390886717387263E-006 + 1.408381918560431E-006 1.426097182273749E-006 1.444035276573215E-006 1.462199004322557E-006 + 1.480591203641192E-006 1.499214748347683E-006 1.518072548408779E-006 1.537167550394106E-006 + 1.556502737936573E-006 1.576081132198573E-006 1.595905792344042E-006 1.615979816016459E-006 + 1.636306339822865E-006 1.656888539823959E-006 1.677729632030368E-006 1.698832872905148E-006 + 1.720201559872623E-006 1.741839031833604E-006 1.763748669687107E-006 1.785933896858625E-006 + 1.808398179835038E-006 1.831145028706265E-006 1.854177997713721E-006 1.877500685805672E-006 + 1.901116737199586E-006 1.925029841951541E-006 1.949243736532804E-006 1.973762204413667E-006 + 1.998589076654618E-006 2.023728232504960E-006 2.049183600008938E-006 2.074959156619513E-006 + 2.101058929819848E-006 2.127486997752602E-006 2.154247489857163E-006 2.181344587514866E-006 + 2.208782524702347E-006 2.236565588653116E-006 2.264698120527438E-006 2.293184516090658E-006 + 2.322029226400038E-006 2.351236758500248E-006 2.380811676127602E-006 2.410758600423148E-006 + 2.441082210654739E-006 2.471787244948164E-006 2.502878501027504E-006 2.534360836964774E-006 + 2.566239171939015E-006 2.598518487004928E-006 2.631203825871162E-006 2.664300295688415E-006 + 2.697813067847431E-006 2.731747378787037E-006 2.766108530812365E-006 2.800901892923325E-006 + 2.836132901653533E-006 2.871807061919781E-006 2.907929947882188E-006 2.944507203815185E-006 + 2.981544544989423E-006 3.019047758564816E-006 3.057022704494785E-006 3.095475316441889E-006 + 3.134411602704984E-006 3.173837647158011E-006 3.213759610200630E-006 3.254183729720787E-006 + 3.295116322069398E-006 3.336563783047303E-006 3.378532588904599E-006 3.421029297352591E-006 + 3.464060548588430E-006 3.507633066332671E-006 3.551753658879864E-006 3.596429220162356E-006 + 3.641666730827491E-006 3.687473259328345E-006 3.733855963028189E-006 3.780822089318849E-006 + 3.828378976753107E-006 3.876534056191379E-006 3.925294851962802E-006 3.974668983040915E-006 + 4.024664164234162E-006 4.075288207391306E-006 4.126549022622097E-006 4.178454619533203E-006 + 4.231013108479738E-006 4.284232701832543E-006 4.338121715261342E-006 4.392688569034131E-006 + 4.447941789332826E-006 4.503890009585508E-006 4.560541971815432E-006 4.617906528006938E-006 + 4.675992641488654E-006 4.734809388333983E-006 4.794365958779279E-006 4.854671658659856E-006 + 4.915735910863997E-006 4.977568256805357E-006 5.040178357913783E-006 5.103575997144953E-006 + 5.167771080508991E-006 5.232773638618262E-006 5.298593828254731E-006 5.365241933956938E-006 + 5.432728369626991E-006 5.501063680157780E-006 5.570258543080584E-006 5.640323770233530E-006 + 5.711270309450902E-006 5.783109246273789E-006 5.855851805682244E-006 5.929509353849151E-006 + 6.004093399916281E-006 6.079615597792573E-006 6.156087747975086E-006 6.233521799392891E-006 + 6.311929851274039E-006 6.391324155036173E-006 6.471717116200782E-006 6.553121296331603E-006 + 6.635549414997417E-006 6.719014351759442E-006 6.803529148183876E-006 6.889107009879602E-006 + 6.975761308561613E-006 7.063505584140393E-006 7.152353546837499E-006 7.242319079327880E-006 + 7.333416238909019E-006 7.425659259697432E-006 7.519062554852808E-006 7.613640718830016E-006 + 7.709408529659622E-006 7.806380951256900E-006 7.904573135760011E-006 8.004000425897576E-006 + 8.104678357385942E-006 8.206622661356749E-006 8.309849266814899E-006 8.414374303127500E-006 + 8.520214102544157E-006 8.627385202748832E-006 8.735904349443996E-006 8.845788498967097E-006 + 8.957054820940050E-006 9.069720700952058E-006 9.183803743276066E-006 9.299321773619562E-006 + 9.416292841909805E-006 9.534735225114182E-006 9.654667430096070E-006 9.776108196506468E-006 + 9.899076499712226E-006 1.002359155376089E-005 1.014967281438298E-005 1.027733998203200E-005 + 1.040661300496260E-005 1.053751208234766E-005 1.067005766743432E-005 1.080427047073992E-005 + 1.094017146328803E-005 1.107778187988523E-005 1.121712322243908E-005 1.135821726331786E-005 + 1.150108604875250E-005 1.164575190228140E-005 1.179223742823849E-005 1.194056551528525E-005 + 1.209075933998703E-005 1.224284237043453E-005 1.239683836991067E-005 1.255277140060366E-005 + 1.271066582736682E-005 1.287054632152555E-005 1.303243786473235E-005 1.319636575287021E-005 + 1.336235560000518E-005 1.353043334238857E-005 1.370062524250959E-005 1.387295789319888E-005 + 1.404745822178375E-005 1.422415349429554E-005 1.440307131973008E-005 1.458423965436161E-005 + 1.476768680611099E-005 1.495344143896893E-005 1.514153257747471E-005 1.533198961125141E-005 + 1.552484229959805E-005 1.572012077613954E-005 1.591785555353513E-005 1.611807752824608E-005 + 1.632081798536332E-005 1.652610860349572E-005 1.673398145972005E-005 1.694446903459302E-005 + 1.715760421722642E-005 1.737342031042619E-005 1.759195103589596E-005 1.781323053950619E-005 + 1.803729339662952E-005 1.826417461754322E-005 1.849390965289968E-005 1.872653439926555E-005 + 1.896208520473073E-005 1.920059887458782E-005 1.944211267708297E-005 1.968666434923922E-005 + 1.993429210275286E-005 2.018503462996419E-005 2.043893110990322E-005 2.069602121441150E-005 + 2.095634511434092E-005 2.121994348583047E-005 2.148685751666198E-005 2.175712891269583E-005 + 2.203079990438751E-005 2.230791325338626E-005 2.258851225921666E-005 2.287264076604424E-005 + 2.316034316952627E-005 2.345166442374861E-005 2.374665004824996E-005 2.404534613513427E-005 + 2.434779935627284E-005 2.465405697059681E-005 2.496416683148149E-005 2.527817739422359E-005 + 2.559613772361240E-005 2.591809750159625E-005 2.624410703504553E-005 2.657421726361306E-005 + 2.690847976769371E-005 2.724694677648379E-005 2.758967117614203E-005 2.793670651805318E-005 + 2.828810702719543E-005 2.864392761061328E-005 2.900422386599683E-005 2.936905209036899E-005 + 2.973846928888204E-005 3.011253318372489E-005 3.049130222314212E-005 3.087483559056676E-005 + 3.126319321386777E-005 3.165643577471386E-005 3.205462471805531E-005 3.245782226172460E-005 + 3.286609140615823E-005 3.327949594424066E-005 3.369810047127200E-005 3.412197039506133E-005 + 3.455117194614658E-005 3.498577218814332E-005 3.542583902822355E-005 3.587144122772635E-005 + 3.632264841290203E-005 3.677953108579122E-005 3.724216063524112E-005 3.771060934806003E-005 + 3.818495042031236E-005 3.866525796875580E-005 3.915160704242192E-005 3.964407363434300E-005 + 4.014273469342593E-005 4.064766813647569E-005 4.115895286037015E-005 4.167666875438758E-005 + 4.220089671268972E-005 4.273171864696161E-005 4.326921749921042E-005 4.381347725472541E-005 + 4.436458295520066E-005 4.492262071202312E-005 4.548767771972761E-005 4.605984226962116E-005 + 4.663920376357886E-005 4.722585272801282E-005 4.781988082801728E-005 4.842138088169141E-005 + 4.903044687464234E-005 4.964717397467068E-005 5.027165854664053E-005 5.090399816753677E-005 + 5.154429164171168E-005 5.219263901632324E-005 5.284914159696790E-005 5.351390196350948E-005 + 5.418702398610776E-005 5.486861284144823E-005 5.555877502917616E-005 5.625761838853768E-005 + 5.696525211522940E-005 5.768178677846085E-005 5.840733433823093E-005 5.914200816282196E-005 + 5.988592304651383E-005 6.063919522752057E-005 6.140194240615302E-005 6.217428376320966E-005 + 6.295633997859885E-005 6.374823325019531E-005 6.455008731293397E-005 6.536202745814343E-005 + 6.618418055312332E-005 6.701667506096738E-005 6.785964106063615E-005 6.871321026728221E-005 + 6.957751605283065E-005 7.045269346681892E-005 7.133887925749847E-005 7.223621189320204E-005 + 7.314483158397969E-005 7.406488030350666E-005 7.499650181126721E-005 7.593984167501734E-005 + 7.689504729352995E-005 7.786226791962642E-005 7.884165468349733E-005 7.983336061631716E-005 + 8.083754067415551E-005 8.185435176218937E-005 8.288395275922012E-005 8.392650454249822E-005 + 8.498217001286087E-005 8.605111412018561E-005 8.713350388916391E-005 8.822950844539944E-005 + 8.933929904183390E-005 9.046304908550589E-005 9.160093416464596E-005 9.275313207611274E-005 + 9.391982285317420E-005 9.510118879363782E-005 9.629741448833534E-005 9.750868684996525E-005 + 9.873519514229839E-005 9.997713100975087E-005 1.012346885073287E-004 1.025080641309494E-004 + 1.037974568481448E-004 1.051030681291502E-004 1.064251019783847E-004 1.077637649663269E-004 + 1.091192662617922E-004 1.104918176646157E-004 1.118816336387466E-004 1.132889313457586E-004 + 1.147139306787815E-004 1.161568542968603E-004 1.176179276597459E-004 1.190973790631237E-004 + 1.205954396742859E-004 1.221123435682504E-004 1.236483277643369E-004 1.252036322632011E-004 + 1.267785000843351E-004 1.283731773040403E-004 1.299879130938764E-004 1.316229597595960E-004 + 1.332785727805669E-004 1.349550108496921E-004 1.366525359138308E-004 1.383714132147277E-004 + 1.401119113304583E-004 1.418743022173942E-004 1.436588612526969E-004 1.454658672773466E-004 + 1.472956026397111E-004 1.491483532396633E-004 1.510244085732539E-004 1.529240617779454E-004 + 1.548476096784163E-004 1.567953528329393E-004 1.587675955803451E-004 1.607646460875756E-004 + 1.627868163978353E-004 1.648344224793497E-004 1.669077842747346E-004 1.690072257509891E-004 + 1.711330749501150E-004 1.732856640403746E-004 1.754653293681931E-004 1.776724115107124E-004 + 1.799072553290076E-004 1.821702100219721E-004 1.844616291808805E-004 1.867818708446387E-004 + 1.891312975557271E-004 1.915102764168491E-004 1.939191791482920E-004 1.963583821460082E-004 + 1.988282665404292E-004 2.013292182560164E-004 2.038616280715635E-004 2.064258916812565E-004 + 2.090224097565013E-004 2.116515880085301E-004 2.143138372517938E-004 2.170095734681529E-004 + 2.197392178718759E-004 2.225031969754540E-004 2.253019426562460E-004 2.281358922239584E-004 + 2.310054884889769E-004 2.339111798315561E-004 2.368534202718798E-004 2.398326695410031E-004 + 2.428493931526857E-004 2.459040624761293E-004 2.489971548096305E-004 2.521291534551590E-004 + 2.553005477938759E-004 2.585118333625987E-004 2.617635119312307E-004 2.650560915811640E-004 + 2.683900867846674E-004 2.717660184852751E-004 2.751844141791833E-004 2.786458079976741E-004 + 2.821507407905738E-004 2.856997602107619E-004 2.892934207997439E-004 2.929322840742979E-004 + 2.966169186142139E-004 3.003479001511351E-004 3.041258116585172E-004 3.079512434427201E-004 + 3.118247932352424E-004 3.157470662861203E-004 3.197186754584978E-004 3.237402413243881E-004 + 3.278123922616402E-004 3.319357645521228E-004 3.361110024811452E-004 3.403387584381283E-004 + 3.446196930185418E-004 3.489544751271238E-004 3.533437820823979E-004 3.577882997225059E-004 + 3.622887225123715E-004 3.668457536522114E-004 3.714601051874134E-004 3.761324981197922E-004 + 3.808636625202498E-004 3.856543376428494E-004 3.905052720403251E-004 3.954172236810467E-004 + 4.003909600674509E-004 4.054272583559676E-004 4.105269054784504E-004 4.156906982651374E-004 + 4.209194435691580E-004 4.262139583926034E-004 4.315750700141870E-004 4.370036161185063E-004 + 4.425004449269347E-004 4.480664153301573E-004 4.537023970223735E-004 4.594092706371892E-004 + 4.651879278852174E-004 4.710392716934093E-004 4.769642163461406E-004 4.829636876280673E-004 + 4.890386229687831E-004 4.951899715892946E-004 5.014186946503383E-004 5.077257654025659E-004 + 5.141121693386135E-004 5.205789043470899E-004 5.271269808684963E-004 5.337574220531113E-004 + 5.404712639208603E-004 5.472695555231945E-004 5.541533591070075E-004 5.611237502806148E-004 + 5.681818181818183E-004 5.753286656480879E-004 5.825654093888803E-004 5.898931801601282E-004 + 5.973131229409232E-004 6.048263971124201E-004 6.124341766389953E-004 6.201376502516774E-004 + 6.279380216338911E-004 6.358365096095349E-004 6.438343483334241E-004 6.519327874841322E-004 + 6.601330924592520E-004 6.684365445731200E-004 6.768444412570221E-004 6.853580962619208E-004 + 6.939788398637331E-004 7.027080190711849E-004 7.115469978362871E-004 7.204971572674548E-004 + 7.295598958453076E-004 7.387366296411883E-004 7.480287925384216E-004 7.574378364563657E-004 + 7.669652315772751E-004 7.766124665760207E-004 7.863810488526997E-004 7.962725047681670E-004 + 8.062883798825330E-004 8.164302391966623E-004 8.266996673967054E-004 8.370982691017136E-004 + 8.476276691143585E-004 8.582895126748145E-004 8.690854657178294E-004 8.800172151330303E-004 + 8.910864690285053E-004 9.022949569976956E-004 9.136444303896499E-004 9.251366625826768E-004 + 9.367734492614365E-004 9.485566086975246E-004 9.604879820335750E-004 9.725694335709462E-004 + 9.848028510610208E-004 9.971901460001696E-004 1.009733253928431E-003 1.022434134731937E-003 + 1.035294772949153E-003 1.048317178080966E-003 1.061503384904672E-003 1.074855453791915E-003 + 1.088375471030623E-003 1.102065549150997E-003 1.115927827255596E-003 1.129964471353575E-003 + 1.144177674699135E-003 1.158569658134213E-003 1.173142670435504E-003 1.187898988665828E-003 + 1.202840918529929E-003 1.217970794734750E-003 1.233290981354229E-003 1.248803872198695E-003 + 1.264511891188903E-003 1.280417492734778E-003 1.296523162118923E-003 1.312831415884946E-003 + 1.329344802230677E-003 1.346065901406330E-003 1.362997326117669E-003 1.380141721934255E-003 + 1.397501767702813E-003 1.415080175965814E-003 1.432879693385312E-003 1.450903101172117E-003 + 1.469153215520368E-003 1.487632888047558E-003 1.506345006240118E-003 1.525292493904587E-003 + 1.544478311624458E-003 1.563905457222788E-003 1.583576966230597E-003 1.603495912361193E-003 + 1.623665407990435E-003 1.644088604643046E-003 1.664768693485060E-003 1.685708905822425E-003 + 1.706912513605927E-003 1.728382829942424E-003 1.750123209612518E-003 1.772137049594770E-003 + 1.794427789596460E-003 1.816998912591065E-003 1.839853945362479E-003 1.862996459056064E-003 + 1.886430069736677E-003 1.910158438953654E-003 1.934185274312965E-003 1.958514330056521E-003 + 1.983149407648774E-003 2.008094356370723E-003 2.033353073921353E-003 2.058929507026671E-003 + 2.084827652056390E-003 2.111051555648355E-003 2.137605315340861E-003 2.164493080212876E-003 + 2.191719051532371E-003 2.219287483412759E-003 2.247202683477601E-003 2.275469013533710E-003 + 2.304090890252657E-003 2.333072785860916E-003 2.362419228838643E-003 2.392134804627250E-003 + 2.422224156345922E-003 2.452691985517071E-003 2.483543052800998E-003 2.514782178739738E-003 + 2.546414244510264E-003 2.578444192687220E-003 2.610877028015165E-003 2.643717818190608E-003 + 2.676971694653832E-003 2.710643853390683E-003 2.744739555744479E-003 2.779264129238072E-003 + 2.814222968406315E-003 2.849621535638956E-003 2.885465362034137E-003 2.921760048262666E-003 + 2.958511265443097E-003 2.995724756027892E-003 3.033406334700671E-003 3.071561889284754E-003 + 3.110197381663185E-003 3.149318848710241E-003 3.188932403234747E-003 3.229044234935198E-003 + 3.269660611366893E-003 3.310787878921295E-003 3.352432463817624E-003 3.394600873107001E-003 + 3.437299695689176E-003 3.480535603342038E-003 3.524315351764132E-003 3.568645781630208E-003 + 3.613533819660130E-003 3.658986479701173E-003 3.705010863823927E-003 3.751614163432065E-003 + 3.798803660385950E-003 3.846586728140497E-003 3.894970832897263E-003 3.943963534771043E-003 + 3.993572488971193E-003 4.043805446997725E-003 4.094670257852537E-003 4.146174869265817E-003 + 4.198327328937870E-003 4.251135785796640E-003 4.304608491270937E-003 4.358753800579789E-003 + 4.413580174037942E-003 4.469096178377779E-003 4.525310488087944E-003 4.582231886768679E-003 + 4.639869268504344E-003 4.698231639253110E-003 4.757328118254128E-003 4.817167939452490E-003 + 4.877760452941987E-003 4.939115126426138E-003 5.001241546697508E-003 5.064149421135647E-003 + 5.127848579223938E-003 5.192348974085414E-003 5.257660684038006E-003 5.323793914169282E-003 + 5.390758997930981E-003 5.458566398753700E-003 5.527226711681755E-003 5.596750665028739E-003 + 5.667149122053823E-003 5.738433082659122E-003 5.810613685108528E-003 5.883702207768009E-003 + 5.957710070867938E-003 6.032648838287507E-003 6.108530219361565E-003 6.185366070710312E-003 + 6.263168398091822E-003 6.341949358278049E-003 6.421721260954312E-003 6.502496570642682E-003 + 6.584287908649661E-003 6.667108055038191E-003 6.750969950624657E-003 6.835886699000875E-003 + 6.921871568581518E-003 7.008937994677424E-003 7.097099581594781E-003 7.186370104760921E-003 + 7.276763512876729E-003 7.368293930096099E-003 7.460975658232971E-003 7.554823178995903E-003 + 7.649851156250971E-003 7.746074438312935E-003 7.843508060265394E-003 7.942167246310026E-003 + 8.042067412145346E-003 8.143224167375540E-003 8.245653317949389E-003 8.349370868630081E-003 + 8.454393025495938E-003 8.560736198472609E-003 8.668417003897260E-003 8.777452267114788E-003 + 8.887859025106916E-003 8.999654529154223E-003 9.112856247531635E-003 9.227481868237988E-003 + 9.343549301759695E-003 9.461076683869401E-003 9.580082378459687E-003 9.700584980412421E-003 + 9.822603318504354E-003 9.946156458349030E-003 1.007126370537594E-002 1.019794460784696E-002 + 1.032621895991083E-002 1.045610680469606E-002 1.058762843744262E-002 1.072080440867323E-002 + 1.085565552740436E-002 1.099220286439762E-002 1.113046775545228E-002 1.127047180473883E-002 + 1.141223688817481E-002 1.155578515684297E-002 1.170113904045229E-002 1.184832125084286E-002 + 1.199735478553445E-002 1.214826293132008E-002 1.230106926790459E-002 1.245579767158891E-002 + 1.261247231900095E-002 1.277111769087308E-002 1.293175857586746E-002 1.309442007444921E-002 + 1.325912760280837E-002 1.342590689683139E-002 1.359478401612224E-002 1.376578534807442E-002 + 1.393893761199396E-002 1.411426786327435E-002 1.429180349762409E-002 1.447157225534721E-002 + 1.465360222567788E-002 1.483792185116931E-002 1.502455993213796E-002 1.521354563116373E-002 + 1.540490847764654E-002 1.559867837242051E-002 1.579488559242596E-002 1.599356079544014E-002 + 1.619473502486779E-002 1.639843971459150E-002 1.660470669388349E-002 1.681356819237897E-002 + 1.702505684511195E-002 1.723920569761475E-002 1.745604821108121E-002 1.767561826759526E-002 + 1.789795017542498E-002 1.812307867438324E-002 1.835103894125609E-002 1.858186659529896E-002 + 1.881559770380245E-002 1.905226878772782E-002 1.929191682741338E-002 1.953457926835297E-002 + 1.978029402704662E-002 2.002909949692531E-002 2.028103455434995E-002 2.053613856468576E-002 + 2.079445138845343E-002 2.105601338755716E-002 2.132086543159148E-002 2.158904890422716E-002 + 2.186060570967735E-002 2.213557827924547E-002 2.241400957795486E-002 2.269594311126246E-002 + 2.298142293185650E-002 2.327049364653966E-002 2.356320042319933E-002 2.385958899786478E-002 + 2.415970568185385E-002 2.446359736900907E-002 2.477131154302472E-002 2.508289628486664E-002 + 2.539840028028458E-002 2.571787282741975E-002 2.604136384450768E-002 2.636892387767783E-002 + 2.670060410885191E-002 2.703645636374074E-002 2.737653311994251E-002 2.772088751514231E-002 + 2.806957335541488E-002 2.842264512363228E-002 2.878015798797651E-002 2.914216781056006E-002 + 2.950873115615426E-002 2.987990530102753E-002 3.025574824189528E-002 3.063631870498158E-002 + 3.102167615519559E-002 3.141188080542300E-002 3.180699362593418E-002 3.220707635391129E-002 + 3.261219150309445E-002 3.302240237355000E-002 3.343777306156106E-002 3.385836846964261E-002 + 3.428425431668299E-002 3.471549714821214E-002 3.515216434679994E-002 3.559432414258461E-002 + 3.604204562393372E-002 3.649539874823975E-002 3.695445435285057E-002 3.741928416613847E-002 + 3.788996081870751E-002 3.836655785474213E-002 3.884914974349899E-002 3.933781189094241E-002 + 3.983262065152719E-002 4.033365334012894E-002 4.084098824412447E-002 4.135470463562486E-002 + 4.187488278386128E-002 4.240160396772780E-002 4.293495048848107E-002 4.347500568259994E-002 + 4.402185393480737E-002 4.457558069125520E-002 4.513627247287576E-002 4.570401688890074E-002 + 4.627890265055008E-002 4.686101958489382E-002 4.745045864888709E-002 4.804731194358296E-002 + 4.865167272852311E-002 4.926363543630961E-002 4.988329568736075E-002 5.051075030485133E-002 + 5.114609732984193E-002 5.178943603659798E-002 5.244086694810107E-002 5.310049185175667E-002 + 5.376841381529782E-002 5.444473720289027E-002 5.512956769143945E-002 5.582301228710232E-002 + 5.652517934200793E-002 5.723617857118701E-002 5.795612106971574E-002 5.868511933007436E-002 + 5.942328725972399E-002 6.017074019890570E-002 6.092759493866168E-002 6.169396973908500E-002 + 6.246998434779751E-002 6.325576001866043E-002 6.405141953072122E-002 6.485708720739718E-002 + 6.567288893590209E-002 6.649895218691586E-002 6.733540603450190E-002 6.818238117627588E-002 + 6.904000995382668E-002 6.990842637339577E-002 7.078776612681560E-002 7.167816661271147E-002 + 7.257976695797104E-002 7.349270803948237E-002 7.441713250614694E-002 7.535318480116857E-002 + 7.630101118462246E-002 7.726075975630974E-002 7.823258047889700E-002 7.921662520134953E-002 + 8.021304768265740E-002 8.122200361586024E-002 8.224365065237565E-002 8.327814842663135E-002 + 8.432565858100943E-002 8.538634479110284E-002 8.646037279128956E-002 8.754791040063008E-002 + 8.864912754908813E-002 8.976419630408379E-002 9.089329089737880E-002 9.203658775230021E-002 + 9.319426551130795E-002 9.436650506390688E-002 9.555348957491219E-002 9.675540451306884E-002 + 9.797243768003089E-002 9.920477923970708E-002 1.004526217479730E-001 1.017161601827595E-001 + 1.029955919745178E-001 1.042911170370682E-001 1.056029377988377E-001 1.069312592344889E-001 + 1.082762888969489E-001 1.096382369498390E-001 1.110173162003130E-001 1.124137421323101E-001 + 1.138277329402226E-001 1.152595095629914E-001 1.167092957186269E-001 1.181773179391651E-001 + 1.196638056060652E-001 1.211689909860489E-001 1.226931092673944E-001 1.242363985966842E-001 + 1.257991001160154E-001 1.273814580006803E-001 1.289837194973171E-001 1.306061349625448E-001 + 1.322489579020809E-001 1.339124450103515E-001 1.355968562106022E-001 1.373024546955095E-001 + 1.390295069683070E-001 1.407782828844263E-001 1.425490556936617E-001 1.443421020828678E-001 + 1.461577022191903E-001 1.479961397938448E-001 1.498577020664427E-001 1.517426799098762E-001 + 1.536513678557687E-001 1.555840641404946E-001 1.575410707517807E-001 1.595226934758918E-001 + 1.615292419454096E-001 1.635610296876155E-001 1.656183741734774E-001 1.677015968672570E-001 + 1.698110232767390E-001 1.719469830040908E-001 1.741098097973662E-001 1.762998416026514E-001 + 1.785174206168717E-001 1.807628933412603E-001 1.830366106354980E-001 1.853389277725388E-001 + 1.876702044941187E-001 1.900308050669688E-001 1.924210983397316E-001 1.948414578005934E-001 + 1.972922616356449E-001 1.997738927879709E-001 2.022867390174881E-001 2.048311929615328E-001 + 2.074076521962096E-001 2.100165192985166E-001 2.126582019092456E-001 2.153331127966793E-001 + 2.180416699210865E-001 2.207842965000277E-001 2.235614210744866E-001 2.263734775758273E-001 + 2.292209053935995E-001 2.321041494441935E-001 2.350236602403573E-001 2.379798939615934E-001 + 2.409733125254344E-001 2.440043836596216E-001 2.470735809751867E-001 2.501813840404539E-001 + 2.533282784559759E-001 2.565147559304066E-001 2.597413143573347E-001 2.630084578930793E-001 + 2.663166970354642E-001 2.696665487035869E-001 2.730585363185848E-001 2.764931898854245E-001 + 2.799710460757140E-001 2.834926483115580E-001 2.870585468504713E-001 2.906692988713547E-001 + 2.943254685615579E-001 2.980276272050343E-001 3.017763532716029E-001 3.055722325073394E-001 + 3.094158580260963E-001 3.133078304021811E-001 3.172487577641966E-001 3.212392558900598E-001 + 3.252799483032227E-001 3.293714663700946E-001 3.335144493986982E-001 3.377095447385615E-001 + 3.419574078818649E-001 3.462587025658683E-001 3.506141008766157E-001 3.550242833539551E-001 + 3.594899390978716E-001 3.640117658761596E-001 3.685904702334540E-001 3.732267676016249E-001 + 3.779213824115693E-001 3.826750482064031E-001 3.874885077560770E-001 3.923625131734400E-001 + 3.972978260317533E-001 4.022952174836928E-001 4.073554683818409E-001 4.124793694006940E-001 + 4.176677211602125E-001 4.229213343509131E-001 4.282410298605462E-001 4.336276389023589E-001 + 4.390820031449716E-001 4.446049748438958E-001 4.501974169746943E-001 4.558602033678290E-001 + 4.615942188451954E-001 4.674003593583764E-001 4.732795321286414E-001 4.792326557886952E-001 + 4.852606605262225E-001 4.913644882292283E-001 4.975450926332079E-001 5.038034394701757E-001 + 5.101405066195559E-001 5.165572842609842E-001 5.230547750290233E-001 5.296339941698229E-001 + 5.362959696997612E-001 5.430417425660669E-001 5.498723668094754E-001 5.567889097289228E-001 + 5.637924520483104E-001 5.708840880853761E-001 5.780649259226769E-001 5.853360875807352E-001 + 5.926987091933545E-001 6.001539411851393E-001 6.077029484512581E-001 6.153469105394525E-001 + 6.230870218343515E-001 6.309244917440938E-001 6.388605448892958E-001 6.468964212944098E-001 + 6.550333765814709E-001 6.632726821662985E-001 6.716156254571546E-001 6.800635100558998E-001 + 6.886176559616923E-001 6.972793997772312E-001 7.060500949176114E-001 7.149311118217936E-001 + 7.239238381667352E-001 7.330296790842263E-001 7.422500573804335E-001 7.515864137582259E-001 + 7.610402070422837E-001 7.706129144070388E-001 7.803060316074957E-001 7.901210732129347E-001 + 8.000595728435771E-001 8.101230834102116E-001 8.203131773568355E-001 8.306314469063634E-001 + 8.410795043094015E-001 8.516589820961773E-001 8.623715333316211E-001 8.732188318736548E-001 + 8.842025726347478E-001 8.953244718467377E-001 9.065862673290053E-001 9.179897187600088E-001 + 9.295366079522313E-001 9.412287391306052E-001 9.530679392144110E-001 9.650560581027513E-001 + 9.771949689635934E-001 9.894865685264529E-001 1.001932777378773E+000 1.014535540266004E+000 + 1.027296826395490E+000 1.040218629744155E+000 1.053302969370056E+000 1.066551889727885E+000 + 1.079967460988398E+000 1.093551779361902E+000 1.107306967425781E+000 1.121235174456152E+000 + 1.135338576763705E+000 1.149619378033739E+000 1.164079809670510E+000 1.178722131145883E+000 + 1.193548630352374E+000 1.208561623960653E+000 1.223763457781511E+000 1.239156507132415E+000 + 1.254743177208643E+000 +/ +&local +vloc(1:1177) = +-8.055763997176067E+000 -8.055770284309713E+000 -8.055776492429622E+000 -8.055782635699529E+000 +-8.055788727947256E+000 -8.055794782674921E+000 -8.055800813068915E+000 -8.055806832009555E+000 +-8.055812852080628E+000 -8.055818885578557E+000 -8.055824944521502E+000 -8.055831040658109E+000 +-8.055837185476090E+000 -8.055843390210656E+000 -8.055849665852616E+000 -8.055856023156451E+000 +-8.055862472648020E+000 -8.055869024632218E+000 -8.055875786323492E+000 -8.055880957778051E+000 +-8.055888255781426E+000 -8.055895738521572E+000 -8.055903410670915E+000 -8.055910500770020E+000 +-8.055918539459865E+000 -8.055926781636328E+000 -8.055933732892964E+000 -8.055942349812213E+000 +-8.055950325494775E+000 -8.055959355757739E+000 -8.055968614612315E+000 -8.055978107831075E+000 +-8.055986179639502E+000 -8.055995168393409E+000 -8.056005318409786E+000 -8.056015725356234E+000 +-8.056026395736705E+000 -8.056037336209732E+000 -8.056048553646777E+000 -8.056058894372564E+000 +-8.056068833223367E+000 -8.056080833725485E+000 -8.056093138001685E+000 -8.056105753715398E+000 +-8.056117441014869E+000 -8.056130666119138E+000 -8.056144226003958E+000 -8.056158129121872E+000 +-8.056170305625850E+000 -8.056184861610710E+000 -8.056199786048646E+000 -8.056213683567924E+000 +-8.056229332270723E+000 -8.056245377066464E+000 -8.056261828013028E+000 -8.056278695363121E+000 +-8.056295989662575E+000 -8.056311308702368E+000 -8.056327864385674E+000 -8.056346391794886E+000 +-8.056365388132622E+000 -8.056384865284496E+000 -8.056404835451019E+000 -8.056425311078010E+000 +-8.056446304991262E+000 -8.056467830309144E+000 -8.056487907759434E+000 -8.056507895677100E+000 +-8.056530969665275E+000 -8.056554627684640E+000 -8.056578884478045E+000 -8.056603755293423E+000 +-8.056629255618120E+000 -8.056655401351431E+000 -8.056682208838909E+000 -8.056707410160820E+000 +-8.056735529717889E+000 -8.056764361012098E+000 -8.056790882686061E+000 -8.056821110249331E+000 +-8.056852102862885E+000 -8.056883879887504E+000 -8.056916461128914E+000 -8.056949866915932E+000 +-8.056984118184808E+000 -8.057016599280104E+000 -8.057052535669714E+000 -8.057089381609739E+000 +-8.057127160017028E+000 -8.057165894591595E+000 -8.057205609523860E+000 -8.057242640425351E+000 +-8.057284293501564E+000 -8.057327000676521E+000 -8.057370788686713E+000 -8.057415684877620E+000 +-8.057461717355382E+000 -8.057505785038199E+000 -8.057554094432188E+000 -8.057603626444243E+000 +-8.057654411877275E+000 -8.057706482613458E+000 -8.057759871039002E+000 -8.057814610384508E+000 +-8.057870735043476E+000 -8.057928279948472E+000 -8.057982683490884E+000 -8.058043057792286E+000 +-8.058104959800618E+000 -8.058168428333472E+000 -8.058233502925214E+000 -8.058296436538917E+000 +-8.058364747390039E+000 -8.058434786724661E+000 -8.058506598313222E+000 -8.058580226852049E+000 +-8.058655718449852E+000 -8.058733120136056E+000 -8.058812480225988E+000 -8.058893848111486E+000 +-8.058977274619835E+000 -8.059062812079844E+000 -8.059150513641377E+000 -8.059240434059731E+000 +-8.059326640760066E+000 -8.059421014408453E+000 -8.059517775584620E+000 -8.059616984609740E+000 +-8.059713970819615E+000 -8.059818141275054E+000 -8.059924946909756E+000 -8.060034454468992E+000 +-8.060146732311573E+000 -8.060261850223874E+000 -8.060379880192535E+000 -8.060500896061528E+000 +-8.060624972962115E+000 -8.060752188255508E+000 -8.060882621167975E+000 -8.061016353115519E+000 +-8.061153467519699E+000 -8.061294049874293E+000 -8.061438187631106E+000 -8.061585970307490E+000 +-8.061737490543710E+000 -8.061892842564001E+000 -8.062052123528531E+000 -8.062215432190490E+000 +-8.062374189862231E+000 -8.062545640463858E+000 -8.062721426199841E+000 -8.062895228648394E+000 +-8.063079852403906E+000 -8.063269143457623E+000 -8.063463220918580E+000 -8.063662204772562E+000 +-8.063866219317672E+000 -8.064075391177889E+000 -8.064289850739073E+000 -8.064509732280227E+000 +-8.064735171773075E+000 -8.064966309937615E+000 -8.065203290314615E+000 -8.065446260261675E+000 +-8.065695371711440E+000 -8.065950778541785E+000 -8.066212639833262E+000 -8.066481118564878E+000 +-8.066756381733775E+000 -8.067038601130049E+000 -8.067327950949036E+000 -8.067624611486217E+000 +-8.067928767528162E+000 -8.068240607572196E+000 -8.068560325735179E+000 -8.068888119750081E+000 +-8.069224193565931E+000 -8.069568756496652E+000 -8.069922021563270E+000 -8.070284208511229E+000 +-8.070655541813448E+000 -8.071021532602344E+000 -8.071411484398544E+000 -8.071801593504279E+000 +-8.072211240020287E+000 -8.072631228099416E+000 -8.073061817288547E+000 -8.073503274954508E+000 +-8.073955874826144E+000 -8.074419898489086E+000 -8.074895632888396E+000 -8.075383373490329E+000 +-8.075883421439244E+000 -8.076396085580267E+000 -8.076921683239625E+000 -8.077460538145028E+000 +-8.078012984847202E+000 -8.078579364997298E+000 -8.079160029020674E+000 -8.079755336795762E+000 +-8.080365654433058E+000 -8.080991359586786E+000 -8.081632838110316E+000 -8.082290485742513E+000 +-8.082964709863244E+000 -8.083655924511158E+000 -8.084364557667751E+000 -8.085091045056265E+000 +-8.085835833756622E+000 -8.086599383809606E+000 -8.087382162550190E+000 -8.088184654604019E+000 +-8.089007352446467E+000 -8.089850761932739E+000 -8.090715403748630E+000 -8.091601805291555E+000 +-8.092510513735032E+000 -8.093442085943190E+000 -8.094397093433292E+000 -8.095376123977836E+000 +-8.096379775117413E+000 -8.097408664753631E+000 -8.098463421062721E+000 -8.099544689881078E+000 +-8.100653134946418E+000 -8.101789430066635E+000 -8.102954272797557E+000 -8.104148373834290E+000 +-8.105372459673982E+000 -8.106627280333120E+000 -8.107913597625009E+000 -8.109232197273366E+000 +-8.110583883165772E+000 -8.111969476920121E+000 -8.113389822905420E+000 -8.114845782571308E+000 +-8.116338238784705E+000 -8.117829060810639E+000 -8.119377002329319E+000 -8.120982993986647E+000 +-8.122629203183749E+000 -8.124316622092209E+000 -8.126046275105020E+000 -8.127819205572635E+000 +-8.129636481926894E+000 -8.131499202987589E+000 -8.133408490544179E+000 -8.135365489314340E+000 +-8.137371375974858E+000 -8.139427360173787E+000 -8.141534674271369E+000 -8.143694575809402E+000 +-8.145908358447567E+000 -8.148177346789625E+000 -8.150502898291913E+000 -8.152886403238590E+000 +-8.155329278444805E+000 -8.157832974116241E+000 -8.160398976944085E+000 -8.163028814842614E+000 +-8.165724049308198E+000 -8.168486268949763E+000 -8.171317111652971E+000 -8.174218250030080E+000 +-8.177191387248904E+000 -8.180238278474086E+000 -8.183360716494732E+000 -8.186560529076685E+000 +-8.189839588679295E+000 -8.193199815802563E+000 -8.196643172365874E+000 -8.200171661336041E+000 +-8.203787337651940E+000 -8.207492300236769E+000 -8.211288694737762E+000 -8.215178718842028E+000 +-8.219164619073441E+000 -8.223248690376231E+000 -8.227433274793011E+000 -8.231720775396150E+000 +-8.236113651131189E+000 -8.240614405874723E+000 -8.245225599249371E+000 -8.249949858001004E+000 +-8.254789858269049E+000 -8.259748327964488E+000 -8.264828070950657E+000 -8.270031945861543E+000 +-8.275362866667468E+000 -8.280823815869118E+000 -8.286417835442942E+000 -8.292148035815851E+000 +-8.298017597013043E+000 -8.304029759439384E+000 -8.310187832017403E+000 -8.316495196182933E+000 +-8.322955297073989E+000 -8.329571655433446E+000 -8.336347872601282E+000 -8.343287608214913E+000 +-8.350394597949697E+000 -8.357672666964801E+000 -8.365125706307957E+000 -8.372757676359193E+000 +-8.380572622239905E+000 -8.388574675345637E+000 -8.396768041685609E+000 -8.405157001499553E+000 +-8.413745923823019E+000 -8.422539260238848E+000 -8.431541537387577E+000 -8.440757367797755E+000 +-8.450191455804575E+000 -8.459848590108230E+000 -8.469733636165621E+000 -8.479851545155800E+000 +-8.490207364594411E+000 -8.500806226203718E+000 -8.511653339085720E+000 -8.522754007688111E+000 +-8.534113626226135E+000 -8.545737669716848E+000 -8.557631708247664E+000 -8.569801394607762E+000 +-8.582252465177573E+000 -8.594990749899655E+000 -8.608022162824174E+000 -8.621352702203660E+000 +-8.634988450962503E+000 -8.648935581921455E+000 -8.663200349006338E+000 -8.677789086359118E+000 +-8.692708211880561E+000 -8.707964215922553E+000 -8.723563670754650E+000 -8.739513232842173E+000 +-8.755819629911848E+000 -8.772489658139580E+000 -8.789530181631340E+000 -8.806948133262894E+000 +-8.824750513890395E+000 -8.842944386134457E+000 -8.861536866622762E+000 -8.880535124454862E+000 +-8.899946389123450E+000 -8.919777933547405E+000 -8.940037062821956E+000 -8.960731128631549E+000 +-8.981867518644961E+000 -9.003453642147077E+000 -9.025496931195747E+000 -9.048004833327438E+000 +-9.070984806147797E+000 -9.094444308293387E+000 -9.118390793523842E+000 -9.142831709980209E+000 +-9.167774480624097E+000 -9.193226494520635E+000 -9.219195108260498E+000 -9.245687637808242E+000 +-9.272711338199864E+000 -9.300273395703787E+000 -9.328380929286174E+000 -9.357040961912617E+000 +-9.386260414082154E+000 -9.416046108077545E+000 -9.446404731745067E+000 -9.477342834261302E+000 +-9.508866825110109E+000 -9.540982942946075E+000 -9.573697244768548E+000 -9.607015592408501E+000 +-9.640943642681018E+000 -9.675486824978821E+000 -9.710650320496535E+000 -9.746439058274891E+000 +-9.782857682248423E+000 -9.819910534967995E+000 -9.857601649423648E+000 -9.895934724341483E+000 +-9.934913102082835E+000 -9.974539742377488E+000 -1.001481720775979E+001 -1.005574765209258E+001 +-1.009733278417058E+001 -1.013957384337448E+001 -1.018247158952427E+001 -1.022602627255571E+001 +-1.027023760731241E+001 -1.031510474887048E+001 -1.036062627640271E+001 -1.040680016475738E+001 +-1.045362375222514E+001 -1.050109372529177E+001 -1.054920608987991E+001 -1.059795614600240E+001 +-1.064733846343896E+001 -1.069734685383724E+001 -1.074797434847863E+001 -1.079921317318857E+001 +-1.085105472211488E+001 -1.090348953363483E+001 -1.095650726529173E+001 -1.101009667208498E+001 +-1.106424557759697E+001 -1.111894085769401E+001 -1.117416842144439E+001 -1.122991317689045E+001 +-1.128615901830865E+001 -1.134288880542460E+001 -1.140008434370531E+001 -1.145772637029019E+001 +-1.151579453197092E+001 -1.157426737474377E+001 -1.163312232469947E+001 -1.169233567585004E+001 +-1.175188258762865E+001 -1.181173706633315E+001 -1.187187195717186E+001 -1.193225894337732E+001 +-1.199286854180911E+001 -1.205367009971575E+001 -1.211463179312866E+001 -1.217572063087328E+001 +-1.223690245649713E+001 -1.229814196067886E+001 -1.235940268808131E+001 -1.242064704374040E+001 +-1.248183631705532E+001 -1.254293069326405E+001 -1.260388927198389E+001 -1.266467009491749E+001 +-1.272523016388758E+001 -1.278552547200504E+001 -1.284551103565009E+001 -1.290514092776462E+001 +-1.296436831632722E+001 -1.302314549959704E+001 -1.308142395031486E+001 -1.313915435964418E+001 +-1.319628668608765E+001 -1.325277021257172E+001 -1.330855359467878E+001 -1.336358491319812E+001 +-1.341781173944171E+001 -1.347118119908575E+001 -1.352364003559137E+001 -1.357513467674197E+001 +-1.362561130447232E+001 -1.367501592920116E+001 -1.372329446549030E+001 -1.377039281016442E+001 +-1.381625691982922E+001 -1.386083289494457E+001 -1.390406706773376E+001 -1.394590608377310E+001 +-1.398629699072090E+001 -1.402518733153028E+001 -1.406252523412834E+001 -1.409825950574224E+001 +-1.413233973075262E+001 -1.416471636374759E+001 -1.419534082752325E+001 -1.422416561546239E+001 +-1.425114438806332E+001 -1.427623207505352E+001 -1.429938497838362E+001 -1.432056087232074E+001 +-1.433971910770477E+001 -1.435682071317947E+001 -1.437182849870193E+001 -1.438470715878316E+001 +-1.439542337417535E+001 -1.440394591451134E+001 -1.441024573652158E+001 -1.441429608529036E+001 +-1.441607259433224E+001 -1.441555337980003E+001 -1.441271913558736E+001 -1.440755322605094E+001 +-1.440004177566163E+001 -1.439017375516461E+001 -1.437794106363054E+001 -1.436333860882407E+001 +-1.434636438219002E+001 -1.432701952882549E+001 -1.430530841125816E+001 -1.428123866887018E+001 +-1.425482127149334E+001 -1.422607056433163E+001 -1.419500430704093E+001 -1.416164370438351E+001 +-1.412601342893987E+001 -1.408814163501600E+001 -1.404805996258293E+001 -1.400580353246496E+001 +-1.396141093058085E+001 -1.391492418065927E+001 -1.386638870748982E+001 -1.381585328846294E+001 +-1.376336999189896E+001 -1.370899410535785E+001 -1.365278405155915E+001 -1.359480129065470E+001 +-1.353511021118492E+001 -1.347377800956062E+001 -1.341087455712079E+001 -1.334647225486714E+001 +-1.328064587732172E+001 -1.321347240556882E+001 -1.314503084944953E+001 -1.307540206008800E+001 +-1.300466853339831E+001 -1.293291420526556E+001 -1.286022423895226E+001 -1.278668480641658E+001 +-1.271238286427913E+001 -1.263740592478950E+001 -1.256184182421756E+001 -1.248577848930240E+001 +-1.240930370255545E+001 -1.233250486823096E+001 -1.225546878008845E+001 -1.217828139226253E+001 +-1.210102759435813E+001 -1.202379099191798E+001 -1.194665369376763E+001 -1.186969610718727E+001 +-1.179299674194595E+001 -1.171663202426062E+001 -1.164067612160114E+001 -1.156520077921395E+001 +-1.149027516906040E+001 -1.141596575182828E+001 -1.134233615252144E+001 -1.126944705011086E+001 +-1.119735608154489E+001 -1.112611776030215E+001 -1.105578340959877E+001 -1.098640111024493E+001 +-1.091801566302331E+001 -1.085066856536233E+001 -1.078439800206024E+001 -1.071923884955533E+001 +-1.065522269331204E+001 -1.059237785782056E+001 -1.053072944850924E+001 -1.047029940494794E+001 +-1.041110656455967E+001 -1.035316673608812E+001 -1.029649278205090E+001 -1.024109470942810E+001 +-1.018697976756537E+001 -1.013415255247601E+001 -1.008261511697757E+001 -1.003236708545210E+001 +-9.983405772535807E+000 -9.935726305125749E+000 -9.889321746611463E+000 -9.844183222796007E+000 +-9.800300048720295E+000 -9.757659855668640E+000 -9.716248717840239E+000 -9.676051277960063E+000 +-9.637050871334512E+000 -9.599229647771670E+000 -9.562568690995423E+000 -9.527048135193324E+000 +-9.492647278116808E+000 -9.459344690535071E+000 -9.427118321785597E+000 -9.395945601070656E+000 +-9.365803534417072E+000 -9.336668797080284E+000 -9.308517821272860E+000 -9.281326879132708E+000 +-9.255072160847146E+000 -9.229729847950717E+000 -9.205276181783534E+000 -9.181687527184945E+000 +-9.158940431374281E+000 -9.137011678159345E+000 -9.115878337639932E+000 -9.095517811342237E+000 +-9.075907873049925E+000 -9.057026705469729E+000 -9.038852932746551E+000 -9.021365649177264E+000 +-9.004544444191115E+000 -8.988369423694435E+000 -8.972821228076237E+000 -8.957881046995908E+000 +-8.943530631161165E+000 -8.929752301220542E+000 -8.916528953957812E+000 -8.903844066026828E+000 +-8.891681695318272E+000 -8.880026480155749E+000 -8.868863636470666E+000 -8.858178953120127E+000 +-8.847958785505392E+000 -8.838190047611626E+000 -8.828860202651759E+000 -8.819957252367745E+000 +-8.811469725172648E+000 -8.803386663259079E+000 -8.795697608720873E+000 -8.788392588876089E+000 +-8.781462100837521E+000 -8.774897095432207E+000 -8.768688960544338E+000 -8.762829503984177E+000 +-8.757310935982117E+000 -8.752125851327975E+000 -8.747267211260372E+000 -8.742728325139746E+000 +-8.738502832009978E+000 -8.734584682101231E+000 -8.730968118282474E+000 -8.727647657589770E+000 +-8.724618072851070E+000 -8.721874374460281E+000 -8.719411792400074E+000 -8.717225758537170E+000 +-8.715311889264902E+000 -8.713665968562188E+000 -8.712283931561705E+000 -8.711161848700399E+000 +-8.710295910496116E+000 -8.709682413098740E+000 -8.709317744694058E+000 -8.709198372858058E+000 +-8.709320833019158E+000 -8.709681718106172E+000 -8.710277669552827E+000 -8.711105369816513E+000 +-8.712161536563439E+000 -8.713442918708921E+000 -8.714946294473593E+000 -8.716668471706974E+000 +-8.718606290663759E+000 -8.720756629472147E+000 -8.723116412564590E+000 -8.725682622267726E+000 +-8.728452313909155E+000 -8.731422634668757E+000 -8.734590846458955E+000 -8.737954353205991E+000 +-8.741510732754554E+000 -8.745257773804218E+000 -8.749193518150964E+000 -8.753316308527662E+000 +-8.757624842452856E+000 -8.762118232300979E+000 -8.766796071976172E+000 -8.771658510458844E+000 +-8.776706332452548E+000 -8.781941046450155E+000 -8.787364980368102E+000 -8.792981384990270E+000 +-8.798794545329867E+000 -8.804809899974808E+000 -8.811034168522955E+000 -8.817475487020811E+000 +-8.824143551344255E+000 -8.831049768352644E+000 -8.838207414560046E+000 -8.845631802017921E+000 +-8.853340450949318E+000 -8.861353268659975E+000 -8.869692734095642E+000 -8.878384087318247E+000 +-8.887455523120522E+000 -8.896938387831877E+000 -8.906867378336511E+000 -8.917280742189305E+000 +-8.928220477628996E+000 -8.939732532254727E+000 -8.951866999008118E+000 -8.964678308101051E+000 +-8.978225413461848E+000 -8.992571972252700E+000 -9.007786516045700E+000 -9.023942612221081E+000 +-9.041119014232269E+000 -9.059399799435017E+000 -9.078874493265170E+000 -9.099638178683817E+000 +-9.121791589927124E+000 -9.145441189772473E+000 -9.170699229700226E+000 -9.197683792520374E+000 +-9.226518817240889E+000 -9.257334106153120E+000 -9.290265314312474E+000 -9.325453921789713E+000 +-9.363047189246743E+000 -9.403198097542079E+000 -9.446065272208756E+000 -9.491812893723150E+000 +-9.540610594540652E+000 -9.592633343871304E+000 -9.648061321102626E+000 -9.707079778689137E+000 +-9.769878895127455E+000 -9.836653618436840E+000 -9.907603500279004E+000 -9.982932520489527E+000 +-1.006284890145290E+001 -1.014756491128332E+001 -1.023729665434115E+001 -1.033226384712945E+001 +-1.043268957707676E+001 -1.053880004124640E+001 -1.065082426144948E+001 -1.076899377176006E+001 +-1.089354227394288E+001 -1.102470525580413E+001 -1.116271956708029E+001 -1.130782294703174E+001 +-1.146025349757189E+001 -1.162024909543868E+001 -1.178804673661196E+001 -1.196388180599716E+001 +-1.214798726516655E+001 -1.234059275086763E+001 -1.254192357694165E+001 -1.275219963224807E+001 +-1.297163416731305E+001 -1.320043246250130E+001 -1.343879037073776E+001 -1.368689272811462E+001 +-1.394491162606845E+001 -1.421300453934361E+001 -1.449131230452925E+001 -1.477995694470620E+001 +-1.507903933661961E+001 -1.538863671777946E+001 -1.570880003211180E+001 -1.603955111410914E+001 +-1.638087971298054E+001 -1.673274036002423E+001 -1.709504908434793E+001 -1.746767998419723E+001 +-1.785046166340513E+001 -1.824317354498896E+001 -1.864554207655947E+001 -1.905723684498398E+001 +-1.947786662074713E+001 -1.990697535553421E+001 -2.034403815986398E+001 -2.078845729111545E+001 +-2.123955818611071E+001 -2.169658557676996E+001 -2.215869973243336E+001 -2.262497287872366E+001 +-2.309438585083860E+001 -2.356582504968371E+001 -2.403807978330937E+001 -2.450984009483394E+001 +-2.497969520278392E+001 -2.544613271180549E+001 -2.590753879197173E+001 -2.636219957367488E+001 +-2.680830406117869E+001 -2.724394892812452E+001 -2.766714561648865E+001 -2.807583020702422E+001 +-2.846787655072657E+001 -2.884111313089413E+001 -2.919334404650859E+001 -2.952237435499421E+001 +-2.982603977859174E+001 -3.010224046939931E+001 -3.034897816723853E+001 -3.056439571488066E+001 +-3.074681757522653E+001 -3.089478978832902E+001 -3.100711776564481E+001 -3.108290046970368E+001 +-3.112155985358311E+001 -3.112286487617053E+001 -3.108694987208094E+001 -3.101432743265543E+001 +-3.090589615426976E+001 -3.076294357692137E+001 -3.058714436299724E+001 -3.038055329172233E+001 +-3.014559203699602E+001 -2.988502803078262E+001 -2.960194305399332E+001 -2.929968857917834E+001 +-2.898182432174341E+001 -2.865203592024938E+001 -2.831402712580177E+001 -2.797138129280300E+001 +-2.762738628795404E+001 -2.728481662939762E+001 -2.694567186628333E+001 -2.661086240643594E+001 +-2.628038052151570E+001 -2.595411995036496E+001 -2.563199201460306E+001 -2.531391744225404E+001 +-2.499982438126566E+001 -2.468964707778963E+001 -2.438332476196889E+001 -2.408080072161843E+001 +-2.378202154107996E+001 -2.348693648195098E+001 -2.319549698359870E+001 -2.290765626340291E+001 +-2.262336899907351E+001 -2.234259107785765E+001 -2.206527939980480E+001 -2.179139172439187E+001 +-2.152088655169713E+001 -2.125372303092616E+001 -2.098986089046358E+001 -2.072926038476817E+001 +-2.047188225436555E+001 -2.021768769596601E+001 -1.996663834035521E+001 -1.971869623620574E+001 +-1.947382383837249E+001 -1.923198399592940E+001 -1.899313995717031E+001 -1.875725536177139E+001 +-1.852429421918500E+001 -1.829422091850869E+001 -1.806700025356700E+001 -1.784259740137339E+001 +-1.762097788624078E+001 -1.740210762097372E+001 -1.718595291046741E+001 -1.697248042788758E+001 +-1.676165722118234E+001 -1.655345071147621E+001 -1.634782869126039E+001 -1.614475932237413E+001 +-1.594421113379202E+001 -1.574615301924318E+001 -1.555055423469106E+001 -1.535738439570444E+001 +-1.516661347475099E+001 -1.497821179843881E+001 -1.479215004472817E+001 -1.460839924012838E+001 +-1.442693075688691E+001 -1.424771631017311E+001 -1.407072795525068E+001 -1.389593808463055E+001 +-1.372331942519179E+001 -1.355284503525716E+001 -1.338448830161204E+001 -1.321822293645549E+001 +-1.305402297427660E+001 -1.289186276865331E+001 -1.273171698897349E+001 -1.257356061708371E+001 +-1.241736894387344E+001 -1.226311756580531E+001 -1.211078238140469E+001 -1.196033958772152E+001 +-1.181176567677910E+001 -1.166503743202257E+001 -1.152013192477933E+001 -1.137702651074196E+001 +-1.123569882648163E+001 -1.109612678599939E+001 -1.095828857731882E+001 -1.082216265912407E+001 +-1.068772775744376E+001 -1.055496286238122E+001 -1.042384722489001E+001 -1.029436035359324E+001 +-1.016648201164381E+001 -1.004019221362317E+001 -9.915471222479313E+000 -9.792299546493824E+000 +-9.670657936284790E+000 -9.550527381836304E+000 -9.431889109558345E+000 -9.314724579373511E+000 +-9.199015481831388E+000 -9.084743735249603E+000 -8.971891482882855E+000 -8.860441090120039E+000 +-8.750375141710334E+000 -8.641676439019356E+000 -8.534327997315803E+000 -8.428313043089844E+000 +-8.323615011403607E+000 -8.220217543274172E+000 -8.118104483089860E+000 -8.017259876059391E+000 +-7.917667965694434E+000 -7.819313191325248E+000 -7.722180185648954E+000 -7.626253772310575E+000 +-7.531518963515921E+000 -7.437960957676301E+000 -7.345565137084280E+000 -7.254317065619902E+000 +-7.164202486487238E+000 -7.075207319980158E+000 -6.987317661277279E+000 -6.900519778265368E+000 +-6.814800109390507E+000 -6.730145261537054E+000 -6.646542007933245E+000 -6.563977286083675E+000 +-6.482438195727791E+000 -6.401911996823990E+000 -6.322386107559327E+000 -6.243848102383939E+000 +-6.166285710070168E+000 -6.089686811796084E+000 -6.014039439252619E+000 -5.939331772774660E+000 +-5.865552139495164E+000 -5.792689011522391E+000 -5.720731004139862E+000 -5.649666874028537E+000 +-5.579485517511340E+000 -5.510175968819317E+000 -5.441727398379454E+000 -5.374129111123812E+000 +-5.307370544819541E+000 -5.241441268419842E+000 -5.176330980435239E+000 -5.112029507325206E+000 +-5.048526801909794E+000 -4.985812941800837E+000 -4.923878127852904E+000 -4.862712682633193E+000 +-4.802307048910673E+000 -4.742651788163887E+000 -4.683737579107226E+000 -4.625555216235609E+000 +-4.568095608387134E+000 -4.511349777323604E+000 -4.455308856328672E+000 -4.399964088823396E+000 +-4.345306826998153E+000 -4.291328530478738E+000 -4.238020764629016E+000 -4.185375201171141E+000 +-4.133383611312292E+000 -4.082037633410822E+000 -4.031329747527034E+000 -3.981251765117995E+000 +-3.931795861398061E+000 -3.882954308781589E+000 -3.834719475676578E+000 -3.787083825292160E+000 +-3.740039914460994E+000 -3.693580392476275E+000 -3.647697999943111E+000 -3.602385567644295E+000 +-3.557636015420044E+000 -3.513442351061737E+000 -3.469797669219388E+000 -3.426695150322613E+000 +-3.384128059515133E+000 -3.342089745602362E+000 -3.300573639982462E+000 -3.259573255741968E+000 +-3.219082186454329E+000 -3.179094105307605E+000 -3.139602764082751E+000 -3.100601992177352E+000 +-3.062085695641461E+000 -3.024047856225367E+000 -2.986482530439292E+000 -2.949383848624644E+000 +-2.912746014036870E+000 -2.876563301939862E+000 -2.840830058711185E+000 -2.805540700958905E+000 +-2.770689714649065E+000 -2.736271654244146E+000 -2.702281141852195E+000 -2.668712866386488E+000 +-2.635561582735696E+000 -2.602822110944299E+000 -2.570489335403213E+000 -2.538558204050491E+000 +-2.507023727581883E+000 -2.475880978671295E+000 -2.445125091200843E+000 -2.414751259500531E+000 +-2.384754737597372E+000 -2.355130838473776E+000 -2.325874933335249E+000 -2.296982450887084E+000 +-2.268448876620115E+000 -2.240269752105315E+000 -2.212440674297141E+000 -2.184957294845578E+000 +-2.157815319416663E+000 -2.131010507021511E+000 -2.104538669353662E+000 -2.078395670134610E+000 +-2.052577424467550E+000 -2.027079898199066E+000 -2.001899107288795E+000 -1.977031117186939E+000 +-1.952472042219439E+000 -1.928218044980875E+000 -1.904265335734831E+000 -1.880610171821746E+000 +-1.857248857074147E+000 -1.834177741239061E+000 -1.811393219407713E+000 -1.788891731452205E+000 +-1.766669761469261E+000 -1.744723837230869E+000 -1.723050529641706E+000 -1.701646452203378E+000 +-1.680508260485233E+000 -1.659632651601807E+000 -1.639016363696745E+000 -1.618656175433110E+000 +-1.598548905490075E+000 -1.578691412065793E+000 -1.559080592386516E+000 -1.539713382221777E+000 +-1.520586755405577E+000 -1.501697723363573E+000 -1.483043334646071E+000 -1.464620674466879E+000 +-1.446426864247869E+000 -1.428459061169174E+000 -1.410714457725012E+000 -1.393190281284990E+000 +-1.375883793660883E+000 -1.358792290678796E+000 -1.341913101756608E+000 -1.325243589486717E+000 +-1.308781149223912E+000 -1.292523208678406E+000 -1.276467227513918E+000 -1.260610696950718E+000 +-1.244951139373652E+000 -1.229486107944987E+000 -1.214213186222093E+000 -1.199129987779885E+000 +-1.184234155837914E+000 -1.169523362892139E+000 -1.154995310351229E+000 -1.140647728177415E+000 +-1.126478374531797E+000 -1.112485035424036E+000 -1.098665524366429E+000 -1.085017682032258E+000 +-1.071539375918387E+000 -1.058228500012070E+000 -1.045082974461860E+000 -1.032100745252650E+000 +-1.019279783884710E+000 -1.006618087056741E+000 -9.941136763528576E-001 -9.817645979334413E-001 +-9.695689222298702E-001 -9.575247436430017E-001 -9.456301802454230E-001 -9.338833734874100E-001 +-9.222824879065024E-001 -9.108257108407315E-001 -8.995112521453683E-001 -8.883373439132202E-001 +-8.773022401983972E-001 -8.664042167434876E-001 -8.556415707101603E-001 -8.450126204130719E-001 +-8.345157050571125E-001 -8.241491844779059E-001 -8.139114388855168E-001 -8.038008686113709E-001 +-7.938158938582910E-001 -7.839549544536559E-001 -7.742165096056242E-001 -7.645990376623721E-001 +-7.551010358743462E-001 -7.457210201594401E-001 -7.364575248711132E-001 -7.273091025693836E-001 +-7.182743237946505E-001 -7.093517768443531E-001 -7.005400675523746E-001 -6.918378190712091E-001 +-6.832436716568303E-001 -6.747562824562154E-001 -6.663743252975396E-001 -6.580964904829402E-001 +-6.499214845838848E-001 -6.418480302390723E-001 -6.338748659548330E-001 -6.260007459080297E-001 +-6.182244397513825E-001 -6.105447324212323E-001 -6.029604239476875E-001 -5.954703292671153E-001 +-5.880732780369868E-001 -5.807681144529955E-001 -5.735536970684683E-001 -5.664288986160132E-001 +-5.593926058313736E-001 -5.524437192794903E-001 -5.455811531826993E-001 -5.388038352510860E-001 +-5.321107065149363E-001 -5.255007211592658E-001 -5.189728463604174E-001 -5.125260621246716E-001 +-5.061593611288735E-001 -4.998717485630419E-001 -4.936622419749195E-001 -4.875298711164701E-001 +-4.814736777922701E-001 -4.754927157097898E-001 -4.695860503315377E-001 -4.637527587290290E-001 +-4.579919294385851E-001 -4.523026623189080E-001 -4.466840684104339E-001 -4.411352697964357E-001 +-4.356553994658389E-001 -4.302436011777575E-001 -4.248990293276972E-001 -4.196208488154324E-001 +-4.144082349145212E-001 -4.092603731434346E-001 -4.041764591382990E-001 -3.991556985272073E-001 +-3.941973068060981E-001 -3.893005092161788E-001 -3.844645406228618E-001 -3.796886453962172E-001 +-3.749720772928981E-001 -3.703140993395420E-001 -3.657139837176182E-001 -3.611710116497004E-001 +-3.566844732871619E-001 -3.522536675992547E-001 -3.478779022635744E-001 -3.435564935578870E-001 +-3.392887662532884E-001 -3.350740535087058E-001 -3.309116967666975E-001 -3.268010456505532E-001 +-3.227414578626746E-001 -3.187322990842085E-001 -3.147729428759414E-001 -3.108627705804088E-001 +-3.070011712252340E-001 -3.031875414276625E-001 -2.994212853002783E-001 -2.957018143579003E-001 +-2.920285474256257E-001 -2.884009105480222E-001 -2.848183368994488E-001 -2.812802666954827E-001 +-2.777861471054577E-001 -2.743354321660782E-001 -2.709275826961138E-001 -2.675620662121524E-001 +-2.642383568453956E-001 -2.609559352594935E-001 -2.577142885693946E-001 -2.545129102612081E-001 +-2.513513001130608E-001 -2.482289641169340E-001 -2.451454144014766E-001 -2.421001691557716E-001 +-2.390927525540534E-001 +/ + +&nonlocal + els_beta(1) = "3P" + lll(1) = 1 + kbeta(1) = 809 + rcut(1) = 9.000000000000000E-001 + rcutus(1) = 9.000000000000000E-001 + beta(1:1177,1) = +-1.126741090995861E-007 -1.155264677465885E-007 -1.184510341962707E-007 -1.214496363978473E-007 +-1.245241485752880E-007 -1.276764923987662E-007 -1.309086381857674E-007 -1.342226061326007E-007 +-1.376204675770872E-007 -1.411043462932145E-007 -1.446764198185632E-007 -1.483389208153393E-007 +-1.520941384658608E-007 -1.559444199033706E-007 -1.598921716790725E-007 -1.639398612663019E-007 +-1.680900186027780E-007 -1.723452376718975E-007 -1.767081781240574E-007 -1.811815669390247E-007 +-1.857682001303858E-007 -1.904709444931463E-007 -1.952927393955716E-007 -2.002365986163871E-007 +-2.053056122284887E-007 -2.105029485303374E-007 -2.158318560262502E-007 -2.212956654568201E-007 +-2.268977918807371E-007 -2.326417368093126E-007 -2.385310903950352E-007 -2.445695336755341E-007 +-2.507608408743475E-007 -2.571088817599341E-007 -2.636176240644054E-007 -2.702911359634857E-007 +-2.771335886192552E-007 -2.841492587872611E-007 -2.913425314896293E-007 -2.987179027558464E-007 +-3.062799824329225E-007 -3.140334970666962E-007 -3.219832928560796E-007 -3.301343386820890E-007 +-3.384917292135598E-007 -3.470606880914757E-007 -3.558465711939171E-007 -3.648548699836575E-007 +-3.740912149405067E-007 -3.835613790805442E-007 -3.932712815644397E-007 -4.032269913971215E-007 +-4.134347312211035E-007 -4.239008812058353E-007 -4.346319830355191E-007 -4.456347439978720E-007 +-4.569160411763986E-007 -4.684829257487926E-007 -4.803426273941505E-007 -4.925025588117583E-007 +-5.049703203542654E-007 -5.177537047781533E-007 -5.308607021144617E-007 -5.442995046628150E-007 +-5.580785121118805E-007 -5.722063367894399E-007 -5.866918090453765E-007 -6.015439827709301E-007 +-6.167721410576722E-007 -6.323858019997415E-007 -6.483947246429569E-007 -6.648089150845408E-007 +-6.816386327272527E-007 -6.988943966918482E-007 -7.165869923918752E-007 -7.347274782748975E-007 +-7.533271927343912E-007 -7.723977611966030E-007 -7.919511033868196E-007 -8.119994407795859E-007 +-8.325553042375141E-007 -8.536315418434853E-007 -8.752413269311155E-007 -8.973981663185116E-007 +-9.201159087504795E-007 -9.434087535544262E-007 -9.672912595154064E-007 -9.917783539758304E-007 +-1.016885342165536E-006 -1.042627916768060E-006 -1.069022167729059E-006 -1.096084592313055E-006 +-1.123832105414757E-006 -1.152282050131415E-006 -1.181452208602822E-006 -1.211360813125716E-006 +-1.242026557549562E-006 -1.273468608960808E-006 -1.305706619662932E-006 -1.338760739459776E-006 +-1.372651628249807E-006 -1.407400468939232E-006 -1.443028980681992E-006 -1.479559432454936E-006 +-1.517014656976655E-006 -1.555418064978655E-006 -1.594793659837824E-006 -1.635166052579322E-006 +-1.676560477259250E-006 -1.719002806736771E-006 -1.762519568845451E-006 -1.807137962974031E-006 +-1.852885877066906E-006 -1.899791905054997E-006 -1.947885364727874E-006 -1.997196316058314E-006 +-2.047755579990749E-006 -2.099594757705353E-006 -2.152746250369784E-006 -2.207243279390969E-006 +-2.263119907179534E-006 -2.320411058439908E-006 -2.379152541999386E-006 -2.439381073189786E-006 +-2.501134296795729E-006 -2.564450810583805E-006 -2.629370189427427E-006 -2.695933010042398E-006 +-2.764180876348645E-006 -2.834156445474017E-006 -2.905903454416328E-006 -2.979466747380393E-006 +-3.054892303807087E-006 -3.132227267111951E-006 -3.211519974151359E-006 -3.292819985434555E-006 +-3.376178116100576E-006 -3.461646467679324E-006 -3.549278460656671E-006 -3.639128867863994E-006 +-3.731253848712889E-006 -3.825710984296624E-006 -3.922559313380125E-006 -4.021859369301091E-006 +-4.123673217805262E-006 -4.228064495839442E-006 -4.335098451326624E-006 -4.444841983948011E-006 +-4.557363686957414E-006 -4.672733890054247E-006 -4.791024703341732E-006 -4.912310062398063E-006 +-5.036665774488421E-006 -5.164169565946925E-006 -5.294901130758051E-006 -5.428942180367832E-006 +-5.566376494756115E-006 -5.707289974801660E-006 -5.851770695972884E-006 -5.999908963377817E-006 +-6.151797368207551E-006 -6.307530845608693E-006 -6.467206734020765E-006 -6.630924836015752E-006 +-6.798787480677884E-006 -6.970899587562368E-006 -7.147368732273535E-006 -7.328305213702788E-006 +-7.513822122968902E-006 -7.704035414103497E-006 -7.899063976525771E-006 -8.099029709352230E-006 +-8.304057597587260E-006 -8.514275790242638E-006 -8.729815680434690E-006 -8.950811987508826E-006 +-9.177402841243501E-006 -9.409729868185376E-006 -9.647938280170290E-006 -9.892176965085162E-006 +-1.014259857992728E-005 -1.039935964621977E-005 -1.066262064784216E-005 -1.093254613133767E-005 +-1.120930480875994E-005 -1.149306966312284E-005 -1.178401805652039E-005 -1.208233184098323E-005 +-1.238819747214158E-005 -1.270180612576571E-005 -1.302335381725628E-005 -1.335304152416014E-005 +-1.369107531178693E-005 -1.403766646200620E-005 -1.439303160530485E-005 -1.475739285618736E-005 +-1.513097795200422E-005 -1.551402039529414E-005 -1.590675959973014E-005 -1.630944103976013E-005 +-1.672231640403531E-005 -1.714564375272326E-005 -1.757968767880272E-005 -1.802471947344189E-005 +-1.848101729556336E-005 -1.894886634570106E-005 -1.942855904425918E-005 -1.992039521428286E-005 +-2.042468226885621E-005 -2.094173540324436E-005 -2.147187779189890E-005 -2.201544079045150E-005 +-2.257276414282003E-005 -2.314419619355805E-005 -2.373009410557996E-005 -2.433082408339723E-005 +-2.494676160200682E-005 -2.557829164157277E-005 -2.622580892804950E-005 -2.688971817989632E-005 +-2.757043436103682E-005 -2.826838294022305E-005 -2.898400015696434E-005 -2.971773329418861E-005 +-3.047004095780621E-005 -3.124139336334996E-005 -3.203227262987285E-005 -3.284317308128418E-005 +-3.367460155531496E-005 -3.452707772030455E-005 -3.540113440000587E-005 -3.629731790661434E-005 +-3.721618838222611E-005 -3.815832014894063E-005 -3.912430206782656E-005 -4.011473790697329E-005 +-4.113024671886154E-005 -4.217146322728517E-005 -4.323903822406878E-005 -4.433363897582811E-005 +-4.545594964102625E-005 -4.660667169758958E-005 -4.778652438134631E-005 -4.899624513556548E-005 +-5.023659007187540E-005 -5.150833444284968E-005 -5.281227312655719E-005 -5.414922112337751E-005 +-5.552001406539344E-005 -5.692550873867859E-005 -5.836658361880589E-005 -5.984413941991294E-005 +-6.135909965766582E-005 -6.291241122647466E-005 -6.450504499132077E-005 -6.613799639456562E-005 +-6.781228607812075E-005 -6.952896052136732E-005 -7.128909269522454E-005 -7.309378273277527E-005 +-7.494415861686761E-005 -7.684137688512348E-005 -7.878662335279278E-005 -8.078111385390712E-005 +-8.282609500119500E-005 -8.492284496523283E-005 -8.707267427332077E-005 -8.927692662858019E-005 +-9.153697974978674E-005 -9.385424623246267E-005 -9.623017443176662E-005 -9.866624936773362E-005 +-1.011639936534293E-004 -1.037249684466004E-004 -1.063507744254144E-004 -1.090430527888999E-004 +-1.118034862827112E-004 -1.146338002508588E-004 -1.175357637140640E-004 -1.205111904754107E-004 +-1.235619402539839E-004 -1.266899198472071E-004 -1.298970843226008E-004 -1.331854382397091E-004 +-1.365570369029594E-004 -1.400139876462333E-004 -1.435584511499577E-004 -1.471926427915334E-004 +-1.509188340299498E-004 -1.547393538254476E-004 -1.586565900951179E-004 -1.626729912053487E-004 +-1.667910675020478E-004 -1.710133928796028E-004 -1.753426063895554E-004 -1.797814138899956E-004 +-1.843325897367087E-004 -1.889989785171288E-004 -1.937834968281847E-004 -1.986891350991481E-004 +-2.037189594606228E-004 -2.088761136608441E-004 -2.141638210304836E-004 -2.195853864971896E-004 +-2.251441986511213E-004 -2.308437318627645E-004 -2.366875484543574E-004 -2.426793009262777E-004 +-2.488227342397870E-004 -2.551216881575557E-004 -2.615800996434309E-004 -2.682020053229497E-004 +-2.749915440061301E-004 -2.819529592741213E-004 -2.890906021313269E-004 -2.964089337246548E-004 +-3.039125281316018E-004 -3.116060752189026E-004 -3.194943835735405E-004 -3.275823835079457E-004 +-3.358751301412554E-004 -3.443778065585701E-004 -3.530957270501694E-004 -3.620343404327197E-004 +-3.711992334545408E-004 -3.805961342870695E-004 -3.902309161046849E-004 -4.001096007551504E-004 +-4.102383625229517E-004 -4.206235319878878E-004 -4.312715999813260E-004 -4.421892216425844E-004 +-4.533832205779889E-004 -4.648605931251907E-004 -4.766285127254138E-004 -4.886943344063674E-004 +-5.010655993786076E-004 -5.137500397482417E-004 -5.267555833489003E-004 -5.400903586960053E-004 +-5.537627000664258E-004 -5.677811527066875E-004 -5.821544781730031E-004 -5.968916598064452E-004 +-6.120019083466865E-004 -6.274946676878204E-004 -6.433796207798335E-004 -6.596666956794492E-004 +-6.763660717540897E-004 -6.934881860428506E-004 -7.110437397784567E-004 -7.290437050742551E-004 +-7.474993317804489E-004 -7.664221545138326E-004 -7.858239998654214E-004 -8.057169937904857E-004 +-8.261135691855849E-004 -8.470264736573529E-004 -8.684687774878709E-004 -8.904538818016055E-004 +-9.129955269390172E-004 -9.361078010420427E-004 -9.598051488568450E-004 -9.841023807593018E-004 +-1.009014682008871E-003 -1.034557622236620E-003 -1.060747165173318E-003 -1.087599678623690E-003 +-1.115131944693043E-003 -1.143361170272645E-003 -1.172304997790412E-003 -1.201981516233594E-003 +-1.232409272450357E-003 -1.263607282737307E-003 -1.295595044720174E-003 -1.328392549535106E-003 +-1.362020294318103E-003 -1.396499295010471E-003 -1.431851099488216E-003 -1.468097801023602E-003 +-1.505262052087265E-003 -1.543367078499480E-003 -1.582436693939420E-003 -1.622495314821466E-003 +-1.663567975547820E-003 -1.705680344146948E-003 -1.748858738307620E-003 -1.793130141818505E-003 +-1.838522221423618E-003 -1.885063344104095E-003 -1.932782594797085E-003 -1.981709794562812E-003 +-2.031875519211104E-003 -2.083311118399024E-003 -2.136048735211519E-003 -2.190121326237238E-003 +-2.245562682152102E-003 -2.302407448823381E-003 -2.360691148947477E-003 -2.420450204234881E-003 +-2.481721958156120E-003 -2.544544699262878E-003 -2.608957685098774E-003 -2.675001166714764E-003 +-2.742716413804366E-003 -2.812145740474394E-003 -2.883332531667261E-003 -2.956321270251241E-003 +-3.031157564795632E-003 -3.107888178048066E-003 -3.186561056131680E-003 -3.267225358480381E-003 +-3.349931488530724E-003 -3.434731125189629E-003 -3.521677255097413E-003 -3.610824205706251E-003 +-3.702227679194663E-003 -3.795944787239033E-003 -3.892034086663890E-003 -3.990555615993030E-003 +-4.091570932924264E-003 -4.195143152751053E-003 -4.301336987754880E-003 -4.410218787592905E-003 +-4.521856580705951E-003 -4.636320116772548E-003 -4.753680910235442E-003 -4.874012284927482E-003 +-4.997389419824772E-003 -5.123889395955340E-003 -5.253591244492503E-003 -5.386575996062808E-003 +-5.522926731299002E-003 -5.662728632669590E-003 -5.806069037616968E-003 -5.953037493037121E-003 +-6.103725811134781E-003 -6.258228126688368E-003 -6.416640955760596E-003 -6.579063255890776E-003 +-6.745596487806282E-003 -6.916344678691412E-003 -7.091414487052580E-003 -7.270915269220368E-003 +-7.454959147529204E-003 -7.643661080217131E-003 -7.837138933088772E-003 -8.035513552985691E-003 +-8.238908843109844E-003 -8.447451840246409E-003 -8.661272793933793E-003 -8.880505247629763E-003 +-9.105286121923642E-003 -9.335755799846121E-003 -9.572058214329200E-003 -9.814340937870182E-003 +-1.006275527445515E-002 -1.031745635379825E-002 -1.057860322795526E-002 -1.084635897037065E-002 +-1.112089077741906E-002 -1.140237007250406E-002 -1.169097261277757E-002 -1.198687859854627E-002 +-1.229027278543168E-002 -1.260134459935304E-002 -1.292028825440358E-002 -1.324730287369238E-002 +-1.358259261322613E-002 -1.392636678890651E-002 -1.427884000672113E-002 -1.464023229620789E-002 +-1.501076924727393E-002 -1.539068215045349E-002 -1.578020814068999E-002 -1.617959034473032E-002 +-1.658907803222132E-002 -1.700892677060048E-002 -1.743939858387554E-002 -1.788076211538966E-002 +-1.833329279467105E-002 -1.879727300846891E-002 -1.927299227607930E-002 -1.976074742906770E-002 +-2.026084279549734E-002 -2.077359038877481E-002 -2.129931010122775E-002 -2.183832990253121E-002 +-2.239098604310351E-002 -2.295762326259380E-002 -2.353859500358760E-002 -2.413426363065914E-002 +-2.474500065490221E-002 -2.537118696407504E-002 -2.601321305849749E-002 -2.667147929284188E-002 +-2.734639612396317E-002 -2.803838436491594E-002 -2.874787544531139E-002 -2.947531167816899E-002 +-3.022114653342246E-002 -3.098584491824331E-002 -3.176988346434785E-002 -3.257375082245979E-002 +-3.339794796410200E-002 -3.424298849089684E-002 -3.510939895155799E-002 -3.599771916676043E-002 +-3.690850256208100E-002 -3.784231650920470E-002 -3.879974267559762E-002 -3.978137738285134E-002 +-4.078783197390809E-002 -4.181973318938216E-002 -4.287772355319560E-002 -4.396246176775330E-002 +-4.507462311888651E-002 -4.621489989079868E-002 -4.738400179125393E-002 -4.858265638725238E-002 +-4.981160955144316E-002 -5.107162591953046E-002 -5.236348935893351E-002 -5.368800344896835E-002 +-5.504599197282353E-002 -5.643829942160779E-002 -5.786579151075542E-002 -5.932935570907750E-002 +-6.082990178075801E-002 -6.236836234059522E-002 -6.394569342279828E-002 -6.556287506365432E-002 +-6.722091189838549E-002 -6.892083377252693E-002 -7.066369636815682E-002 -7.245058184532156E-002 +-7.428259949900270E-002 -7.616088643197870E-002 -7.808660824394410E-002 -8.006095973725155E-002 +-8.208516563965239E-002 -8.416048134441551E-002 -8.628819366821151E-002 -8.846962162715780E-002 +-9.070611723142469E-002 -9.299906629880929E-002 -9.534988928769340E-002 -9.776004214980245E-002 +-1.002310172031969E-001 -1.027643440259263E-001 -1.053615903707868E-001 -1.080243631016288E-001 +-1.107543091516642E-001 -1.135531165042333E-001 -1.164225151964925E-001 -1.193642783464923E-001 +-1.223802232041193E-001 -1.254722122263776E-001 -1.286421541774958E-001 -1.318920052543448E-001 +-1.352237702376545E-001 -1.386395036695267E-001 -1.421413110577351E-001 -1.457313501073159E-001 +-1.494118319799436E-001 -1.531850225815944E-001 -1.570532438789984E-001 -1.610188752453756E-001 +-1.650843548359594E-001 -1.692521809937974E-001 -1.735249136863224E-001 -1.779051759731823E-001 +-1.823956555058033E-001 -1.869991060591663E-001 -1.917183490962529E-001 -1.965562753656202E-001 +-2.015158465325431E-001 -2.066000968441458E-001 -2.118121348289422E-001 -2.171551450311704E-001 +-2.226323897802931E-001 -2.282472109960173E-001 -2.340030320291451E-001 -2.399033595385603E-001 +-2.459517854046022E-001 -2.521519886790562E-001 -2.585077375719484E-001 -2.650228914752785E-001 +-2.717014030237953E-001 -2.785473201928535E-001 -2.855647884333330E-001 -2.927580528435526E-001 +-3.001314603780194E-001 -3.076894620928077E-001 -3.154366154272564E-001 -3.233775865215995E-001 +-3.315171525700458E-001 -3.398602042087123E-001 -3.484117479377188E-001 -3.571769085766132E-001 +-3.661609317521728E-001 -3.753691864174853E-001 -3.848071674010489E-001 -3.944804979844818E-001 +-4.043949325072282E-001 -4.145563589964751E-001 -4.249708018202722E-001 -4.356444243616172E-001 +-4.465835317110437E-001 -4.577945733749677E-001 -4.692841459967773E-001 -4.810589960873428E-001 +-4.931260227612987E-001 -5.054922804751051E-001 -5.181649817625070E-001 -5.311514999626180E-001 +-5.444593719354169E-001 -5.580963007589713E-001 -5.720701584022235E-001 -5.863889883666155E-001 +-6.010610082892727E-001 -6.160946124998485E-001 -6.314983745224546E-001 -6.472810495134315E-001 +-6.634515766249300E-001 -6.800190812834753E-001 -6.969928773718290E-001 -7.143824693015220E-001 +-7.321975539624719E-001 -7.504480225350139E-001 -7.691439621485667E-001 -7.882956573699483E-001 +-8.079135915030522E-001 -8.280084476802587E-001 -8.485911097244661E-001 -8.696726627590688E-001 +-8.912643935415702E-001 -9.133777904947027E-001 -9.360245434071000E-001 -9.592165427735089E-001 +-9.829658787424076E-001 -1.007284839636650E+000 -1.032185910010263E+000 -1.057681768202096E+000 +-1.083785283344119E+000 -1.110509511779402E+000 -1.137867692841724E+000 -1.165873243945404E+000 +-1.194539754930651E+000 -1.223880981605916E+000 -1.253910838424983E+000 -1.284643390232416E+000 +-1.316092843006576E+000 -1.348273533525015E+000 -1.381199917872077E+000 -1.414886558703548E+000 +-1.449348111177906E+000 -1.484599307457896E+000 -1.520654939680539E+000 -1.557529841287179E+000 +-1.595238866598869E+000 -1.633796868515583E+000 -1.673218674210389E+000 -1.713519058682669E+000 +-1.754712716026301E+000 -1.796814228260952E+000 -1.839838031566183E+000 -1.883798379749220E+000 +-1.928709304768570E+000 -1.974584574126090E+000 -2.021437644930801E+000 -2.069281614427988E+000 +-2.118129166776900E+000 -2.167992515850654E+000 -2.218883343821204E+000 -2.270812735282193E+000 +-2.323791106652117E+000 -2.377828130589610E+000 -2.432932655142984E+000 -2.489112617345668E+000 +-2.546374950959995E+000 -2.604725488062551E+000 -2.664168854155634E+000 -2.724708356482052E+000 +-2.786345865213372E+000 -2.849081687176533E+000 -2.912914431779668E+000 -2.977840868795389E+000 +-3.043855777660017E+000 -3.110951787948824E+000 -3.179119210692590E+000 -3.248345860208869E+000 +-3.318616866132800E+000 -3.389914475348846E+000 -3.462217843545019E+000 -3.535502816137835E+000 +-3.609741698348491E+000 -3.684903014249826E+000 -3.760951254651117E+000 -3.837846613743069E+000 +-3.915544714491052E+000 -3.993996322840904E+000 -4.073147050889369E+000 -4.152937049273103E+000 +-4.233300689145533E+000 -4.314166234242856E+000 -4.395455503689904E+000 -4.477083526364375E+000 +-4.558958187827582E+000 -4.640979871040733E+000 -4.723041092321791E+000 -4.805026134259753E+000 +-4.886810677592283E+000 -4.968261434372732E+000 -5.049235785102661E+000 -5.129581422890452E+000 +-5.209136008115400E+000 -5.287726837531200E+000 -5.365170532235695E+000 -5.441272749463348E+000 +-5.515827923726221E+000 -5.588619043436204E+000 -5.659417469785441E+000 -5.727982805342765E+000 +-5.794062820536998E+000 -5.857393446941189E+000 -5.917698847039297E+000 -5.974691570941305E+000 +-6.028072811307485E+000 -6.077532768534345E+000 -6.122751139033164E+000 -6.163397740179403E+000 +-6.199133286209296E+000 -6.229610329967048E+000 -6.254474385934661E+000 -6.273365250377884E+000 +-6.285918534680279E+000 -6.291767427973547E+000 -6.290544704961770E+000 -6.281884994329302E+000 +-6.265427322261502E+000 -6.240817944332982E+000 -6.207713477262783E+000 -6.165784339728400E+000 +-6.114718508494126E+000 -6.054225592464499E+000 -5.984041222837040E+000 -5.903931752218848E+000 +-5.813699249304765E+000 -5.713186768415940E+000 -5.602283864795304E+000 -5.480932316994045E+000 +-5.349132006921396E+000 -5.206946896150050E+000 -5.054511023888581E+000 -4.892034437699690E+000 +-4.719808952662309E+000 -4.538213618405452E+000 -4.347719756508491E+000 -4.148895413481021E+000 +-3.942409057304448E+000 -3.729032328850276E+000 -3.509641644014471E+000 -3.285218428876452E+000 +-3.056847759503075E+000 -2.825715171203143E+000 -2.593101400275251E+000 -2.360374825898332E+000 +-2.128981392221127E+000 -1.900431812463062E+000 -1.676285889540162E+000 -1.458133833015132E+000 +-1.247574511620703E+000 -1.046190655700902E+000 -8.555211159312436E-001 -6.770303945822398E-001 +-5.120757939464325E-001 -3.618726733811468E-001 -2.274584711259200E-001 -1.096563282906759E-001 +-9.039348041338267E-003 7.410326992805605E-002 1.397967647871462E-001 1.884063468964680E-001 + 2.206558375286447E-001 2.376373161189566E-001 2.408094755127621E-001 2.319821999300481E-001 + 2.132847099535964E-001 1.871144625013242E-001 1.560638466997885E-001 1.228215699029496E-001 + 9.004546833679371E-002 6.020328628778985E-002 3.537772559570571E-002 1.703175227548087E-002 + 5.729742392182262E-003 8.095496302189142E-004 1.197524714767390E-012 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 + + els_beta(2) = "3D" + lll(2) = 2 + kbeta(2) = 819 + rcut(2) = 1.000000000000000E+000 + rcutus(2) = 1.000000000000000E+000 + beta(1:1177,2) = + 1.586013978883939E-011 1.646618740130396E-011 1.709539330318276E-011 1.774864241895137E-011 + 1.842685348781618E-011 1.913098035584250E-011 1.986201331745792E-011 2.062098050821685E-011 + 2.140894935078544E-011 2.222702805618081E-011 2.307636718237494E-011 2.395816125245651E-011 + 2.487365043462572E-011 2.582412228638502E-011 2.681091356537915E-011 2.783541210943035E-011 + 2.889905878841407E-011 3.000334953071957E-011 3.114983742714533E-011 3.234013491518928E-011 + 3.357591604680394E-011 3.485891884280802E-011 3.619094773726428E-011 3.757387611526205E-011 + 3.900964894767382E-011 4.050028552659021E-011 4.204788230528247E-011 4.365461584668472E-011 + 4.532274588454422E-011 4.705461850154410E-011 4.885266942886796E-011 5.071942747184822E-011 + 5.265751806651487E-011 5.466966697204701E-011 5.675870410432086E-011 5.892756751594414E-011 + 6.117930752837676E-011 6.351709102194719E-011 6.594420588979928E-011 6.846406566203364E-011 + 7.108021430654552E-011 7.379633121331323E-011 7.661623636914610E-011 7.954389573016909E-011 + 8.258342679960258E-011 8.573910441867708E-011 8.901536677883355E-011 9.241682166365993E-011 + 9.594825292934515E-011 9.961462723276443E-011 1.034211010166569E-010 1.073730277617223E-010 + 1.114759655158339E-010 1.157356847109572E-010 1.201581762787705E-010 1.247496600763967E-010 + 1.295165936341012E-010 1.344656812372558E-010 1.396038833553429E-010 1.449384264312614E-010 + 1.504768130446988E-010 1.562268324638687E-010 1.621965716004506E-010 1.683944263831379E-010 + 1.748291135657956E-010 1.815096829868258E-010 1.884455302969928E-010 1.956464101736008E-010 + 2.031224500396125E-010 2.108841643070039E-010 2.189424691643821E-010 2.273086979296707E-010 + 2.359946169894514E-010 2.450124423473775E-010 2.543748568049389E-010 2.640950277987325E-010 + 2.741866259193352E-010 2.846638441378176E-010 2.955414177669405E-010 3.068346451851115E-010 + 3.185594093522382E-010 3.307322001477523E-010 3.433701375622096E-010 3.564909957750865E-010 + 3.701132281526431E-010 3.842559932009926E-010 3.989391815109001E-010 4.141834437321885E-010 + 4.300102196171047E-010 4.464417681734935E-010 4.635011989701727E-010 4.812125046385609E-010 + 4.996005946162512E-010 5.186913301799916E-010 5.385115608173515E-010 5.590891619882112E-010 + 5.804530743292034E-010 6.026333443562245E-010 6.256611667222746E-010 6.495689280900572E-010 + 6.743902526810206E-010 7.001600495649388E-010 7.269145617565036E-010 7.546914171880051E-010 + 7.835296816297790E-010 8.134699136328360E-010 8.445542215709659E-010 8.768263228625394E-010 + 9.103316054552744E-010 9.451171916604785E-010 9.812320044264963E-010 1.018726836144615E-009 + 1.057654420084177E-009 1.098069504557354E-009 1.140028929917928E-009 1.183591708502319E-009 + 1.228819107625327E-009 1.275774735747314E-009 1.324524631933985E-009 1.375137358734623E-009 + 1.427684098609355E-009 1.482238754041116E-009 1.538878051473079E-009 1.597681649217730E-009 + 1.658732249489382E-009 1.722115714717629E-009 1.787921188305405E-009 1.856241220001421E-009 + 1.927171896063324E-009 2.000812974394682E-009 2.077268024845737E-009 2.156644574875407E-009 + 2.239054260779264E-009 2.324612984696231E-009 2.413441077614861E-009 2.505663468608297E-009 + 2.601409860536133E-009 2.700814912460123E-009 2.804018429030354E-009 2.911165557108273E-009 + 3.022406989902972E-009 3.137899178907999E-009 3.257804553936633E-009 3.382291751565150E-009 + 3.511535852305356E-009 3.645718626839882E-009 3.785028791666659E-009 3.929662274512048E-009 + 4.079822489885875E-009 4.235720625166030E-009 4.397575937614782E-009 4.565616062744776E-009 + 4.740077334468187E-009 4.921205117479458E-009 5.109254152338980E-009 5.304488913743019E-009 + 5.507183982483914E-009 5.717624431623507E-009 5.936106227423015E-009 6.162936645593218E-009 + 6.398434703450231E-009 6.642931608584921E-009 6.896771224676707E-009 7.160310555107004E-009 + 7.433920245052558E-009 7.717985102764368E-009 8.012904640766167E-009 8.319093637732581E-009 + 8.636982721838012E-009 8.967018976396368E-009 9.309666568643050E-009 9.665407402544475E-009 + 1.003474179655199E-008 1.041818918725448E-008 1.081628885991873E-008 1.122960070694469E-008 + 1.165870601530346E-008 1.210420828406395E-008 1.256673407315908E-008 1.304693388458507E-008 + 1.354548307727224E-008 1.406308281691569E-008 1.460046106209973E-008 1.515837358810450E-008 + 1.573760504983401E-008 1.633897008536003E-008 1.696331446163525E-008 1.761151626398539E-008 + 1.828448713105412E-008 1.898317353693780E-008 1.970855812231192E-008 2.046166107642346E-008 + 2.124354157189032E-008 2.205529925432772E-008 2.289807578889583E-008 2.377305646594267E-008 + 2.468147186800300E-008 2.562459960049441E-008 2.660376608854728E-008 2.762034844249469E-008 + 2.867577639464467E-008 2.977153431006161E-008 3.090916327418121E-008 3.209026326019762E-008 + 3.331649537927024E-008 3.458958421671312E-008 3.591132025745637E-008 3.728356240418596E-008 + 3.870824059170712E-008 4.018735850120688E-008 4.172299637823125E-008 4.331731395834431E-008 + 4.497255350457906E-008 4.669104296095499E-008 4.847519922649706E-008 5.032753155435772E-008 + 5.225064508082826E-008 5.424724448919493E-008 5.632013781359949E-008 5.847224038825013E-008 + 6.070657894753584E-008 6.302629588281576E-008 6.543465366186297E-008 6.793503941718336E-008 + 7.053096970966159E-008 7.322609547422915E-008 7.602420715451853E-008 7.892924003371443E-008 + 8.194527976910718E-008 8.507656813812880E-008 8.832750900394972E-008 9.170267450903398E-008 + 9.520681150535312E-008 9.884484823030884E-008 1.026219012377533E-007 1.065432825938464E-007 + 1.106145073478832E-007 1.148413012885835E-007 1.192296089967630E-007 1.237856022057056E-007 + 1.285156884809916E-007 1.334265202319982E-007 1.385250040677330E-007 1.438183105101670E-007 + 1.493138840787253E-007 1.550194537601130E-007 1.609430438782075E-007 1.670929853792966E-007 + 1.734779275485383E-007 1.801068501741177E-007 1.869890761762042E-007 1.941342847184770E-007 + 2.015525248206477E-007 2.092542294911316E-007 2.172502303997395E-007 2.255517731110223E-007 + 2.341705328996937E-007 2.431186311703705E-007 2.524086525047222E-007 2.620536623600034E-007 + 2.720672254438555E-007 2.824634247912215E-007 2.932568815701976E-007 3.044627756446775E-007 + 3.160968669227047E-007 3.281755175205491E-007 3.407157147736878E-007 3.537350951270368E-007 + 3.672519689380368E-007 3.812853462274728E-007 3.958549634142319E-007 4.109813110716065E-007 + 4.266856627441611E-007 4.429901048656969E-007 4.599175678203834E-007 4.774918581907269E-007 + 4.957376922377390E-007 5.146807306603671E-007 5.343476146830821E-007 5.547660035223640E-007 + 5.759646132847593E-007 5.979732573512298E-007 6.208228883045603E-007 6.445456414587929E-007 + 6.691748800519019E-007 6.947452421652374E-007 7.212926894357481E-007 7.488545576294337E-007 + 7.774696091471891E-007 8.071780875368395E-007 8.380217740880163E-007 8.700440465894848E-007 + 9.032899403314937E-007 9.378062114389718E-007 9.736414026245955E-007 1.010845911454179E-006 + 1.049472061220405E-006 1.089574174524503E-006 1.131208649669383E-006 1.174434039971609E-006 + 1.219311136103725E-006 1.265903051582747E-006 1.314275311524961E-006 1.364495944791878E-006 + 1.416635579656876E-006 1.470767543127010E-006 1.526967964059705E-006 1.585315880219235E-006 + 1.645893349423556E-006 1.708785564937752E-006 1.774080975276307E-006 1.841871408582670E-006 + 1.912252201760955E-006 1.985322334541336E-006 2.061184568667623E-006 2.139945592402673E-006 + 2.221716170554849E-006 2.306611300236357E-006 2.394750372572515E-006 2.486257340589264E-006 + 2.581260893514870E-006 2.679894637740998E-006 2.782297284697374E-006 2.888612845904284E-006 + 2.998990835477021E-006 3.113586480367033E-006 3.232560938635131E-006 3.356081526063840E-006 + 3.484321951427215E-006 3.617462560748939E-006 3.755690590892066E-006 3.899200432836712E-006 + 4.048193905015948E-006 4.202880537093972E-006 4.363477864585434E-006 4.530211734730099E-006 + 4.703316624052576E-006 4.883035968053675E-006 5.069622503496578E-006 5.263338623768967E-006 + 5.464456747820586E-006 5.673259703194540E-006 5.890041123690922E-006 6.115105862221395E-006 + 6.348770419434999E-006 6.591363388717607E-006 6.843225918190112E-006 7.104712190354873E-006 + 7.376189920064240E-006 7.658040871510874E-006 7.950661394966486E-006 8.254462984022794E-006 + 8.569872854118113E-006 8.897334543162154E-006 9.237308535102911E-006 9.590272907311905E-006 + 9.956724002697024E-006 1.033717712748754E-005 1.073216727567131E-005 1.114224988110205E-005 + 1.156800159833314E-005 1.201002111327470E-005 1.246892998481291E-005 1.294537351857361E-005 + 1.344002167405736E-005 1.395357000642046E-005 1.448674064422399E-005 1.504028330452487E-005 + 1.561497634673390E-005 1.621162786672126E-005 1.683107683270552E-005 1.747419426452138E-005 + 1.814188445792229E-005 1.883508625563666E-005 1.955477436696257E-005 2.030196073775388E-005 + 2.107769597272038E-005 2.188307081203995E-005 2.271921766435447E-005 2.358731219830231E-005 + 2.448857499482120E-005 2.542427326254004E-005 2.639572261866856E-005 2.740428893788336E-005 + 2.845139027180528E-005 2.953849884176187E-005 3.066714310763183E-005 3.183890991567286E-005 + 3.305544672834858E-005 3.431846393928144E-005 3.562973727657998E-005 3.699111029791221E-005 + 3.840449698082401E-005 3.987188441193720E-005 4.139533557879818E-005 4.297699226829296E-005 + 4.461907807569341E-005 4.632390152855319E-005 4.809385932983494E-005 4.993143972481513E-005 + 5.183922599648635E-005 5.381990009435810E-005 5.587624640174079E-005 5.801115564679544E-005 + 6.022762896282817E-005 6.252878210352094E-005 6.491784981900425E-005 6.739819039890219E-005 + 6.997329038871656E-005 7.264676948615471E-005 7.542238562426005E-005 7.830404024846537E-005 + 8.129578379495538E-005 8.440182137801406E-005 8.762651869431515E-005 9.097440815242398E-005 + 9.445019523608967E-005 9.805876511023125E-005 1.018051894788660E-004 1.056947337045723E-004 + 1.097328641994493E-004 1.139252560979108E-004 1.182778012220458E-004 1.227966163506835E-004 + 1.274880518037274E-004 1.323587003537566E-004 1.374154064773546E-004 1.426652759590899E-004 + 1.481156858615755E-004 1.537742948755323E-004 1.596490540643147E-004 1.657482180179088E-004 + 1.720803564319723E-004 1.786543661280895E-004 1.854794835320151E-004 1.925652976273241E-004 + 1.999217634025453E-004 2.075592158105296E-004 2.154883842595358E-004 2.237204076562314E-004 + 2.322668500215855E-004 2.411397167014225E-004 2.503514711942193E-004 2.599150526196005E-004 + 2.698438938518572E-004 2.801519403437415E-004 2.908536696667484E-004 3.019641117950709E-004 + 3.134988701614657E-004 3.254741435143099E-004 3.379067486062486E-004 3.508141437459808E-004 + 3.642144532459036E-004 3.781264927996036E-004 3.925697958244280E-004 4.075646408057202E-004 + 4.231320796806830E-004 4.392939673012357E-004 4.560729920167618E-004 4.734927074191344E-004 + 4.915775652940278E-004 5.103529498241859E-004 5.298452130919947E-004 5.500817119305486E-004 + 5.710908461741851E-004 5.929020983614146E-004 6.155460749451546E-004 6.390545490672062E-004 + 6.634605049561009E-004 6.887981840096069E-004 7.151031326255080E-004 7.424122518466542E-004 + 7.707638488887164E-004 8.001976906216913E-004 8.307550590788135E-004 8.624788090692873E-004 + 8.954134279741459E-004 9.296050978074120E-004 9.651017596279248E-004 1.001953180390257E-003 + 1.040211022326510E-003 1.079928914954175E-003 1.121162529808745E-003 1.163969658003522E-003 + 1.208410290722746E-003 1.254546702758210E-003 1.302443539203566E-003 1.352167905424709E-003 + 1.403789460429125E-003 1.457380513761508E-003 1.513016126057709E-003 1.570774213393985E-003 + 1.630735655573455E-003 1.692984408497032E-003 1.757607620771422E-003 1.824695754712404E-003 + 1.894342711907479E-003 1.966645963507826E-003 2.041706685425973E-003 2.119629898621814E-003 + 2.200524614666385E-003 2.284503986779767E-003 2.371685466546442E-003 2.462190966519141E-003 + 2.556147028929565E-003 2.653685000732500E-003 2.754941215218025E-003 2.860057180434828E-003 + 2.969179774676730E-003 3.082461449293338E-003 3.200060439095245E-003 3.322140980633984E-003 + 3.448873538646768E-003 3.580435040966832E-003 3.717009122210427E-003 3.858786376563098E-003 + 4.005964619999091E-003 4.158749162279537E-003 4.317353089087630E-003 4.481997554671334E-003 + 4.652912085377444E-003 4.830334894474282E-003 5.014513208674134E-003 5.205703606781248E-003 + 5.404172370905698E-003 5.610195850699025E-003 5.824060841083379E-003 6.046064973961917E-003 + 6.276517124415658E-003 6.515737831908668E-003 6.764059737041917E-003 7.021828034414337E-003 + 7.289400942168550E-003 7.567150188818754E-003 7.855461517977863E-003 8.154735211622273E-003 + 8.465386632553824E-003 8.787846786740260E-003 9.122562906238885E-003 9.469999053430486E-003 + 9.830636747315309E-003 1.020497561264699E-002 1.059353405270573E-002 1.099684994653808E-002 + 1.141548137151744E-002 1.185000735210598E-002 1.230102863572803E-002 1.276916849669199E-002 + 1.325507356912898E-002 1.375941470994536E-002 1.428288789281739E-002 1.482621513428825E-002 + 1.539014545305881E-002 1.597545586359806E-002 1.658295240523070E-002 1.721347120789546E-002 + 1.786787959580134E-002 1.854707723024472E-002 1.925199729288705E-002 1.998360771082872E-002 + 2.074291242485196E-002 2.153095270224428E-002 2.234880849565039E-002 2.319759984944155E-002 + 2.407848835512776E-002 2.499267865737929E-002 2.594142001226318E-002 2.692600789933873E-002 + 2.794778568929834E-002 2.900814636887709E-002 3.010853432479592E-002 3.125044718854243E-002 + 3.243543774383071E-002 3.366511589862359E-002 3.494115072363479E-002 3.626527255926863E-002 + 3.763927519298975E-002 3.906501810914944E-002 4.054442881333175E-002 4.207950523331111E-002 + 4.367231819874513E-002 4.532501400175497E-002 4.703981704056784E-002 4.881903254842358E-002 + 5.066504940996304E-002 5.258034306733327E-002 5.456747851825800E-002 5.662911340832629E-002 + 5.876800121975880E-002 6.098699455890712E-002 6.328904854473022E-002 6.567722430048371E-002 + 6.815469255082574E-002 7.072473732652348E-002 7.339075977889671E-002 7.615628210608991E-002 + 7.902495159320658E-002 8.200054476826422E-002 8.508697167585164E-002 8.828828027026882E-002 + 9.160866092982083E-002 9.505245109381047E-002 9.862414002362579E-002 1.023283736891636E-001 + 1.061699597816364E-001 1.101538728536122E-001 1.142852595869053E-001 1.185694441886741E-001 + 1.230119339158125E-001 1.276184247273954E-001 1.323948070646003E-001 1.373471717571457E-001 + 1.424818160548668E-001 1.478052497825975E-001 1.533242016160193E-001 1.590456254755947E-001 + 1.649767070351059E-001 1.711248703406627E-001 1.774977845353474E-001 1.841033706838816E-001 + 1.909498086908737E-001 1.980455443053014E-001 2.053992962028930E-001 2.130200631370275E-001 + 2.209171311476130E-001 2.291000808161766E-001 2.375787945540599E-001 2.463634639091740E-001 + 2.554645968752379E-001 2.648930251857339E-001 2.746599115730528E-001 2.847767569713646E-001 + 2.952554076396947E-001 3.061080621794893E-001 3.173472784185771E-001 3.289859801309166E-001 + 3.410374635588135E-001 3.535154037013953E-001 3.664338603300792E-001 3.798072836884516E-001 + 3.936505198305023E-001 4.079788155474377E-001 4.228078228293061E-001 4.381536028035404E-001 + 4.540326290879629E-001 4.704617904911644E-001 4.874583929881308E-001 5.050401608936693E-001 + 5.232252371506759E-001 5.420321826443093E-001 5.614799744469707E-001 5.815880028924906E-001 + 6.023760673709444E-001 6.238643707284807E-001 6.460735121488540E-001 6.690244783855609E-001 + 6.927386332052708E-001 7.172377048945515E-001 7.425437716731818E-001 7.686792448479188E-001 + 7.956668495311675E-001 8.235296027391584E-001 8.522907886739891E-001 8.819739309837126E-001 + 9.126027617838534E-001 9.442011872131006E-001 9.767932492850091E-001 1.010403083786419E+000 + 1.045054873962551E+000 1.080772799717534E+000 1.117580982048530E+000 1.155503422421071E+000 + 1.194563936782904E+000 1.234786083904216E+000 1.276193087722850E+000 1.318807753365018E+000 + 1.362652376504839E+000 1.407748645719751E+000 1.454117537494557E+000 1.501779203523582E+000 + 1.550752849959623E+000 1.601056608259620E+000 1.652707397280593E+000 1.705720776286531E+000 + 1.760110788536652E+000 1.815889795139622E+000 1.873068298876423E+000 1.931654757717142E+000 + 1.991655387785505E+000 2.053073955558424E+000 2.115911559128453E+000 2.180166398404413E+000 + 2.245833534180202E+000 2.312904636065721E+000 2.381367719345900E+000 2.451206870916462E+000 + 2.522401964537952E+000 2.594928365753463E+000 2.668756626932225E+000 2.743852173029744E+000 + 2.820174978797888E+000 2.897679238335086E+000 2.976313028037556E+000 3.056017964199745E+000 + 3.136728856713650E+000 3.218373360535287E+000 3.300871626820664E+000 3.384135955883575E+000 + 3.468070454393972E+000 3.552570699516445E+000 3.637523412984249E+000 3.722806148413395E+000 + 3.808286995481477E+000 3.893824304927217E+000 3.979266438663885E+000 4.064451549642516E+000 + 4.149207396444270E+000 4.233351197920884E+000 4.316689533535072E+000 4.399018295370902E+000 + 4.480122698083595E+000 4.559777353330997E+000 4.637746415466567E+000 4.713783805470111E+000 + 4.787633520234990E+000 4.859030034412503E+000 4.927698802022600E+000 4.993356864964404E+000 + 5.055713575389352E+000 5.114471438620295E+000 5.169327082900756E+000 5.219972361726859E+000 + 5.266095593837488E+000 5.307382945106167E+000 5.343519955578034E+000 5.374193213719792E+000 + 5.399092178590265E+000 5.417911149088861E+000 5.430351377695985E+000 5.436123324181819E+000 + 5.434949042632221E+000 5.426564692828907E+000 5.410723164537805E+000 5.387196800620468E+000 + 5.355780202110796E+000 5.316293095520185E+000 5.268583239681751E+000 5.212529346458149E+000 + 5.148043986661832E+000 5.075076449623605E+000 4.993615522049914E+000 4.903692149193208E+000 + 4.805381938988256E+000 4.698807467746647E+000 4.584140344323987E+000 4.461602988446097E+000 + 4.331470078172054E+000 4.194069621346860E+000 4.049783606412324E+000 3.899048189155459E+000 + 3.742353373917331E+000 3.580242150493290E+000 3.413309051444106E+000 3.242198098804681E+000 + 3.067600114211031E+000 2.890249372231510E+000 2.710919583137901E+000 2.530419198423502E+000 + 2.349586039988150E+000 2.169281261984241E+000 1.990382662755268E+000 1.813777373017099E+000 + 1.640353955346093E+000 1.470993959088717E+000 1.306562983963455E+000 1.147901314893992E+000 + 9.958142000657394E-001 8.510618539711469E-001 7.143492775377758E-001 5.863159986561808E-001 + 4.675258490132335E-001 3.584569077138738E-001 2.594917595319485E-001 1.709082367536493E-001 + 9.287083965571109E-002 2.542306310172526E-002 -3.151910282694076E-002 -7.817217999083925E-002 +-1.148883368712655E-001 -1.421561944320368E-001 -1.605987546408234E-001 -1.709677927764287E-001 +-1.741339244025560E-001 -1.710714065757611E-001 -1.628365601636454E-001 -1.505385069835973E-001 +-1.353007042597320E-001 -1.182115338424319E-001 -1.002619706487867E-001 -8.226510148249258E-002 +-6.486478244285586E-002 -4.867106843062511E-002 -3.425552340464791E-002 -2.211133100224610E-002 +-1.260371269767548E-002 -5.909259850195633E-003 -1.942647218801536E-003 -2.690080039601190E-004 + 8.391833212926056E-014 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 + dion(1:4) = +-1.275816085584227E+000 0.000000000000000E+000 0.000000000000000E+000 -4.814177794229427E+000 +/ + +&pswfc + els(1) = "3P" + lchi(1) = 1 + oc(1) = 6.000000000000000E+000 + nchi(1) = 2 + epseu(1) = -6.571780880819030E+000 + rcut_chi(1) = 9.000000000000000E-001 + rcutus_chi(1) = 9.000000000000000E-001 + chi(1:1177,1) = + 5.713073518220381E-009 5.857700662653833E-009 6.005989060668534E-009 6.158031397339205E-009 + 6.313922704074705E-009 6.473760418015427E-009 6.637644442934680E-009 6.805677211681779E-009 + 6.977963750205942E-009 7.154611743200913E-009 7.335731601411389E-009 7.521436530643325E-009 + 7.711842602521241E-009 7.907068827036787E-009 8.107237226933830E-009 8.312472913976655E-009 + 8.522904167148867E-009 8.738662512831953E-009 8.959882807013523E-009 9.186703319576714E-009 + 9.419265820723326E-009 9.657715669584842E-009 9.902201905076596E-009 1.015287733905194E-008 + 1.040989865181461E-008 1.067342649004904E-008 1.094362556722973E-008 1.122066476657256E-008 + 1.150471724659222E-008 1.179596054933200E-008 1.209457671133326E-008 1.240075237741424E-008 + 1.271467891732910E-008 1.303655254538029E-008 1.336657444305878E-008 1.370495088478911E-008 + 1.405189336685755E-008 1.440761873960420E-008 1.477234934296146E-008 1.514631314542374E-008 + 1.552974388653514E-008 1.592288122298430E-008 1.632597087839757E-008 1.673926479692432E-008 + 1.716302130071017E-008 1.759750525135674E-008 1.804298821546874E-008 1.849974863439194E-008 + 1.896807199824803E-008 1.944825102437521E-008 1.994058584028609E-008 2.044538417125708E-008 + 2.096296153266663E-008 2.149364142720271E-008 2.203775554706244E-008 2.259564398127038E-008 + 2.316765542824532E-008 2.375414741374813E-008 2.435548651434685E-008 2.497204858653912E-008 + 2.560421900167446E-008 2.625239288682402E-008 2.691697537174777E-008 2.759838184211373E-008 + 2.829703819912758E-008 2.901338112573461E-008 2.974785835956074E-008 3.050092897276317E-008 + 3.127306365896521E-008 3.206474502745515E-008 3.287646790483272E-008 3.370873964429167E-008 + 3.456208044273207E-008 3.543702366589997E-008 3.633411618175872E-008 3.725391870229881E-008 + 3.819700613400114E-008 3.916396793717233E-008 4.015540849437620E-008 4.117194748819271E-008 + 4.221422028853945E-008 4.328287834979859E-008 4.437858961799687E-008 4.550203894829341E-008 + 4.665392853303653E-008 4.783497834065657E-008 4.904592656566941E-008 5.028753009007196E-008 + 5.156056495641797E-008 5.286582685286962E-008 5.420413161052841E-008 5.557631571335585E-008 + 5.698323682100320E-008 5.842577430487623E-008 5.990482979777100E-008 6.142132775742325E-008 + 6.297621604432445E-008 6.457046651416518E-008 6.620507562527624E-008 6.788106506144750E-008 + 6.959948237051308E-008 7.136140161910261E-008 7.316792406396731E-008 7.502017884030120E-008 + 7.691932366748701E-008 7.886654557270799E-008 8.086306163287817E-008 8.291011973535446E-008 + 8.500899935790682E-008 8.716101236843297E-008 8.936750384491775E-008 9.162985291615053E-008 + 9.394947362372469E-008 9.632781580585937E-008 9.876636600359513E-008 1.012666483899294E-007 + 1.038302257224736E-007 1.064587003202274E-007 1.091537150650789E-007 1.119169544286593E-007 + 1.147501455251907E-007 1.176550591909888E-007 1.206335110912917E-007 1.236873628551096E-007 + 1.268185232388017E-007 1.300289493191110E-007 1.333206477163988E-007 1.366956758488476E-007 + 1.401561432184126E-007 1.437042127293284E-007 1.473421020399928E-007 1.510720849490745E-007 + 1.548964928167094E-007 1.588177160216755E-007 1.628382054554560E-007 1.669604740541238E-007 + 1.711870983690070E-007 1.755207201771161E-007 1.799640481323377E-007 1.845198594584303E-007 + 1.891910016848763E-007 1.939803944266797E-007 1.988910312092166E-007 2.039259813392845E-007 + 2.090883918235168E-007 2.143814893353606E-007 2.198085822318499E-007 2.253730626214340E-007 + 2.310784084841524E-007 2.369281858454816E-007 2.429260510052138E-007 2.490757528227604E-007 + 2.553811350603057E-007 2.618461387852807E-007 2.684748048336534E-007 2.752712763355788E-007 + 2.822398013049851E-007 2.893847352947156E-007 2.967105441188855E-007 3.042218066441560E-007 + 3.119232176516694E-007 3.198195907714332E-007 3.279158614909901E-007 3.362170902402503E-007 + 3.447284655544195E-007 3.534553073169931E-007 3.624030700848499E-007 3.715773464975196E-007 + 3.809838707727543E-007 3.906285222905945E-007 4.005173292681603E-007 4.106564725274767E-007 + 4.210522893586751E-007 4.317112774809957E-007 4.426400991040630E-007 4.538455850919692E-007 + 4.653347392327757E-007 4.771147426160950E-007 4.891929581214888E-007 5.015769350204942E-007 + 5.142744136951472E-007 5.272933304759591E-007 5.406418226023604E-007 5.543282333087258E-007 + 5.683611170391443E-007 5.827492447942074E-007 5.975016096131481E-007 6.126274321947595E-007 + 6.281361666606086E-007 6.440375064641467E-007 6.603413904494048E-007 6.770580090630710E-007 + 6.941978107238163E-007 7.117715083528716E-007 7.297900860699198E-007 7.482648060584904E-007 + 7.672072156051603E-007 7.866291543169447E-007 8.065427615213961E-007 8.269604838540438E-007 + 8.478950830378973E-007 8.693596438598965E-007 8.913675823492812E-007 9.139326541629951E-007 + 9.370689631833687E-007 9.607909703334458E-007 9.851135026154782E-007 1.010051762378221E-006 + 1.035621336818827E-006 1.061838207725295E-006 1.088718761465526E-006 1.116279799229268E-006 + 1.144538547529328E-006 1.173512668968616E-006 1.203220273279767E-006 1.233679928644216E-006 + 1.264910673297822E-006 1.296932027430286E-006 1.329764005385799E-006 1.363427128172547E-006 + 1.397942436288887E-006 1.433331502874229E-006 1.469616447192817E-006 1.506819948458851E-006 + 1.544965260011594E-006 1.584076223849314E-006 1.624177285531154E-006 1.665293509456231E-006 + 1.707450594529532E-006 1.750674890224378E-006 1.794993413051513E-006 1.840433863445098E-006 + 1.887024643076173E-006 1.934794872604399E-006 1.983774409879188E-006 2.033993868601571E-006 + 2.085484637458510E-006 2.138278899741569E-006 2.192409653462230E-006 2.247910731976428E-006 + 2.304816825131168E-006 2.363163500946497E-006 2.422987227846298E-006 2.484325397451888E-006 + 2.547216347952607E-006 2.611699388068019E-006 2.677814821616719E-006 2.745603972707082E-006 + 2.815109211565691E-006 2.886373981019619E-006 2.959442823649079E-006 3.034361409627442E-006 + 3.111176565265995E-006 3.189936302281305E-006 3.270689847803454E-006 3.353487675143940E-006 + 3.438381535342424E-006 3.525424489512064E-006 3.614670942003660E-006 3.706176674409330E-006 + 3.799998880426937E-006 3.896196201607131E-006 3.994828764005244E-006 4.095958215761033E-006 + 4.199647765629724E-006 4.305962222488438E-006 4.414968035842662E-006 4.526733337358139E-006 + 4.641327983444084E-006 4.758823598914345E-006 4.879293621753842E-006 5.002813349018186E-006 + 5.129459983895199E-006 5.259312683957783E-006 5.392452610638234E-006 5.528962979954941E-006 + 5.668929114523199E-006 5.812438496882566E-006 5.959580824174193E-006 6.110448064202220E-006 + 6.265134512914285E-006 6.423736853337107E-006 6.586354216003922E-006 6.753088240911531E-006 + 6.924043141045772E-006 7.099325767514999E-006 7.279045676332327E-006 7.463315196888354E-006 + 7.652249502157200E-006 7.845966680679684E-006 8.044587810368610E-006 8.248237034182334E-006 + 8.457041637713870E-006 8.671132128744024E-006 8.890642318808284E-006 9.115709406828377E-006 + 9.346474064860870E-006 9.583080526016236E-006 9.825676674603501E-006 1.007441413855665E-005 + 1.032944838420064E-005 1.059093881341619E-005 1.085904886326406E-005 1.113394610813116E-005 + 1.141580236446217E-005 1.170479379814215E-005 1.200110103459743E-005 1.230490927168319E-005 + 1.261640839542871E-005 1.293579309871225E-005 1.326326300293989E-005 1.359902278280440E-005 + 1.394328229420183E-005 1.429625670538612E-005 1.465816663144336E-005 1.502923827216987E-005 + 1.540970355344020E-005 1.579980027215343E-005 1.619977224484822E-005 1.660986946007959E-005 + 1.703034823465251E-005 1.746147137380995E-005 1.790350833547557E-005 1.835673539865347E-005 + 1.882143583609033E-005 1.929790009130787E-005 1.978642596011597E-005 2.028731877672012E-005 + 2.080089160453927E-005 2.132746543185352E-005 2.186736937240354E-005 2.242094087106718E-005 + 2.298852591474199E-005 2.357047924856492E-005 2.416716459760458E-005 2.477895489416455E-005 + 2.540623251083947E-005 2.604938949946970E-005 2.670882783614387E-005 2.738495967240193E-005 + 2.807820759279626E-005 2.878900487897086E-005 2.951779578042449E-005 3.026503579212608E-005 + 3.103119193915635E-005 3.181674306855302E-005 3.262218014854190E-005 3.344800657534122E-005 + 3.429473848772997E-005 3.516290508957755E-005 3.605304898053553E-005 3.696572649509809E-005 + 3.790150805024330E-005 3.886097850187181E-005 3.984473751026571E-005 4.085339991479567E-005 + 4.188759611811052E-005 4.294797248004908E-005 4.403519172151960E-005 4.514993333860003E-005 + 4.629289402711687E-005 4.746478811796767E-005 4.866634802345915E-005 4.989832469493981E-005 + 5.116148809201185E-005 5.245662766361647E-005 5.378455284129158E-005 5.514609354491099E-005 + 5.654210070121964E-005 5.797344677548918E-005 5.944102631662573E-005 6.094575651606926E-005 + 6.248857778083441E-005 6.407045432104942E-005 6.569237475236050E-005 6.735535271357702E-005 + 6.906042749994296E-005 7.080866471243000E-005 7.260115692345682E-005 7.443902435945090E-005 + 7.632341560067733E-005 7.825550829877211E-005 8.023650991242716E-005 8.226765846168549E-005 + 8.435022330131840E-005 8.648550591376522E-005 8.867484072213113E-005 9.091959592374984E-005 + 9.322117434483113E-005 9.558101431672523E-005 9.800059057435196E-005 1.004814151773530E-004 + 1.030250384545423E-004 1.056330499722440E-004 1.083070795271204E-004 1.110487981641092E-004 + 1.138599192201045E-004 1.167421993940314E-004 1.196974398439822E-004 1.227274873120961E-004 + 1.258342352778855E-004 1.290196251407243E-004 1.322856474322381E-004 1.356343430593488E-004 + 1.390678045787496E-004 1.425881775036032E-004 1.461976616432769E-004 1.498985124769495E-004 + 1.536930425619438E-004 1.575836229776631E-004 1.615726848060283E-004 1.656627206493412E-004 + 1.698562861865117E-004 1.741560017686251E-004 1.785645540548358E-004 1.830846976896097E-004 + 1.877192570223554E-004 1.924711278705159E-004 1.973432793272153E-004 2.023387556145867E-004 + 2.074606779839320E-004 2.127122466638953E-004 2.180967428578607E-004 2.236175307918163E-004 + 2.292780598139555E-004 2.350818665473220E-004 2.410325770968345E-004 2.471339093120611E-004 + 2.533896751071516E-004 2.598037828393642E-004 2.663802397476657E-004 2.731231544529182E-004 + 2.800367395212030E-004 2.871253140918743E-004 2.943933065719702E-004 3.018452573986533E-004 + 3.094858218713963E-004 3.173197730556621E-004 3.253520047598863E-004 3.335875345876006E-004 + 3.420315070665914E-004 3.506891968570314E-004 3.595660120405682E-004 3.686674974924117E-004 + 3.779993383385032E-004 3.875673634999063E-004 3.973775493266154E-004 4.074360233230248E-004 + 4.177490679673661E-004 4.283231246274727E-004 4.391647975752925E-004 4.502808581026295E-004 + 4.616782487406539E-004 4.733640875857903E-004 4.853456727346490E-004 4.976304868307436E-004 + 5.102262017257931E-004 5.231406832584883E-004 5.363819961536640E-004 5.499584090448993E-004 + 5.638783996236400E-004 5.781506599180109E-004 5.927841017045704E-004 6.077878620563361E-004 + 6.231713090304942E-004 6.389440474992889E-004 6.551159251276757E-004 6.716970385014099E-004 + 6.886977394093370E-004 7.061286412837312E-004 7.240006258026451E-004 7.423248496583107E-004 + 7.611127514957392E-004 7.803760590257751E-004 8.001267963169563E-004 8.203772912706376E-004 + 8.411401832839652E-004 8.624284311053620E-004 8.842553208873406E-004 9.066344744415555E-004 + 9.295798577011283E-004 9.531057893954097E-004 9.772269499424601E-004 1.001958390564666E-003 + 1.027315542633046E-003 1.053314227245918E-003 1.079970665047754E-003 1.107301486294182E-003 + 1.135323741169258E-003 1.164054910361235E-003 1.193512915903265E-003 1.223716132285581E-003 + 1.254683397845882E-003 1.286434026444810E-003 1.318987819433567E-003 1.352365077920887E-003 + 1.386586615346769E-003 1.421673770370528E-003 1.457648420080926E-003 1.494532993536322E-003 + 1.532350485642965E-003 1.571124471379764E-003 1.610879120378044E-003 1.651639211865015E-003 + 1.693430149979899E-003 1.736277979471848E-003 1.780209401789016E-003 1.825251791568369E-003 + 1.871433213536035E-003 1.918782439828262E-003 1.967328967743211E-003 2.017103037934150E-003 + 2.068135653054780E-003 2.120458596867728E-003 2.174104453827462E-003 2.229106629149178E-003 + 2.285499369375459E-003 2.343317783452756E-003 2.402597864330085E-003 2.463376511092538E-003 + 2.525691551642581E-003 2.589581765942310E-003 2.655086909830236E-003 2.722247739426420E-003 + 2.791106036140081E-003 2.861704632294196E-003 2.934087437381839E-003 3.008299464969402E-003 + 3.084386860262169E-003 3.162396928348070E-003 3.242378163135729E-003 3.324380277003370E-003 + 3.408454231175433E-003 3.494652266844189E-003 3.583027937053955E-003 3.673636139365939E-003 + 3.766533149322130E-003 3.861776654726989E-003 3.959425790766217E-003 4.059541175982152E-003 + 4.162184949125875E-003 4.267420806906436E-003 4.375314042658120E-003 4.485931585947039E-003 + 4.599342043138836E-003 4.715615738949706E-003 4.834824759003379E-003 4.957042993417176E-003 + 5.082346181440796E-003 5.210811957171814E-003 5.342519896372436E-003 5.477551564412611E-003 + 5.615990565364862E-003 5.757922592276994E-003 5.903435478649066E-003 6.052619251141638E-003 + 6.205566183542861E-003 6.362370852022357E-003 6.523130191700438E-003 6.687943554561702E-003 + 6.856912768742575E-003 7.030142199222913E-003 7.207738809952163E-003 7.389812227441342E-003 + 7.576474805852377E-003 7.767841693617107E-003 7.964030901618501E-003 8.165163372967426E-003 + 8.371363054408641E-003 8.582756969390318E-003 8.799475292831834E-003 9.021651427625134E-003 + 9.249422082905422E-003 9.482927354127490E-003 9.722310804984388E-003 9.967719551205786E-003 + 1.021930434627354E-002 1.047721966909285E-002 1.074162381365745E-002 1.101267898074788E-002 + 1.129055137170239E-002 1.157541128430012E-002 1.186743321079685E-002 1.216679593815386E-002 + 1.247368265050078E-002 1.278828103387346E-002 1.311078338326844E-002 1.344138671205549E-002 + 1.378029286379032E-002 1.412770862646918E-002 1.448384584926761E-002 1.484892156180568E-002 + 1.522315809598153E-002 1.560678321041590E-002 1.600003021754945E-002 1.640313811343490E-002 + 1.681635171026592E-002 1.723992177168403E-002 1.767410515090491E-002 1.811916493170461E-002 + 1.857537057230618E-002 1.904299805220614E-002 1.952233002197979E-002 2.001365595610371E-002 + 2.051727230883233E-002 2.103348267316524E-002 2.156259794294008E-002 2.210493647808495E-002 + 2.266082427306302E-002 2.323059512853970E-002 2.381459082630222E-002 2.441316130745856E-002 + 2.502666485394111E-002 2.565546827333816E-002 2.629994708707389E-002 2.696048572195489E-002 + 2.763747770509827E-002 2.833132586225354E-002 2.904244251952696E-002 2.977124970851373E-002 + 3.051817937483866E-002 3.128367359010358E-002 3.206818476723304E-002 3.287217587920670E-002 + 3.369612068116147E-002 3.454050393583990E-002 3.540582164235696E-002 3.629258126824997E-002 + 3.720130198476997E-002 3.813251490536642E-002 3.908676332730810E-002 4.006460297637648E-002 + 4.106660225455796E-002 4.209334249065336E-002 4.314541819371209E-002 4.422343730918901E-002 + 4.532802147771082E-002 4.645980629632635E-002 4.761944158210428E-002 4.880759163792714E-002 + 5.002493552031765E-002 5.127216730911844E-002 5.254999637882981E-002 5.385914767139585E-002 + 5.520036197020921E-002 5.657439617508833E-002 5.798202357796120E-002 5.942403413896801E-002 + 6.090123476267542E-002 6.241444957407035E-002 6.396452019397830E-002 6.555230601352596E-002 + 6.717868446723950E-002 6.884455130434446E-002 7.055082085780030E-002 7.229842631057415E-002 + 7.408831995862353E-002 7.592147347002363E-002 7.779887813963982E-002 7.972154513870464E-002 + 8.169050575862108E-002 8.370681164827093E-002 8.577153504406060E-002 8.788576899189401E-002 + 9.005062756020821E-002 9.226724604316014E-002 9.453678115299718E-002 9.686041120058649E-002 + 9.923933626302071E-002 1.016747783371535E-001 1.041679814778539E-001 1.067202119197002E-001 + 1.093327581807613E-001 1.120069311470387E-001 1.147440641360644E-001 1.175455129380643E-001 + 1.204126558330166E-001 1.233468935818344E-001 1.263496493898189E-001 1.294223688404186E-001 + 1.325665197972350E-001 1.357835922721032E-001 1.390750982569593E-001 1.424425715170955E-001 + 1.458875673432704E-001 1.494116622600171E-001 1.530164536873567E-001 1.567035595529764E-001 + 1.604746178517895E-001 1.643312861496326E-001 1.682752410276975E-001 1.723081774641204E-001 + 1.764318081489735E-001 1.806478627287212E-001 1.849580869759995E-001 1.893642418803787E-001 + 1.938681026555545E-001 1.984714576581815E-001 2.031761072133378E-001 2.079838623413518E-001 + 2.128965433804712E-001 2.179159784995794E-001 2.230440020948770E-001 2.282824530641546E-001 + 2.336331729519603E-001 2.390980039586419E-001 2.446787868058939E-001 2.503773584510773E-001 + 2.561955496421954E-001 2.621351823050089E-001 2.681980667533456E-001 2.743859987132232E-001 + 2.807007561509228E-001 2.871440958946723E-001 2.937177500390677E-001 3.004234221208222E-001 + 3.072627830538615E-001 3.142374668111733E-001 3.213490658402017E-001 3.285991261978967E-001 + 3.359891423908508E-001 3.435205519052233E-001 3.511947294103880E-001 3.590129806194707E-001 + 3.669765357890997E-001 3.750865428398666E-001 3.833440600781134E-001 3.917500484987532E-001 + 4.003053636479501E-001 4.090107470235244E-001 4.178668169900496E-001 4.268740591846757E-001 + 4.360328163888140E-001 4.453432778399675E-001 4.548054679571731E-001 4.644192344528016E-001 + 4.741842358028488E-001 4.840999280473583E-001 4.941655508923467E-001 5.043801130845090E-001 + 5.147423770302204E-001 5.252508426309177E-001 5.359037303079197E-001 5.466989631912692E-001 + 5.576341484492779E-001 5.687065577382957E-001 5.799131067559328E-001 5.912503338856296E-001 + 6.027143779263657E-001 6.143009549084800E-001 6.260053340053687E-001 6.378223125614040E-001 + 6.497461902689722E-001 6.617707425425083E-001 6.738891931548775E-001 6.860941862219171E-001 + 6.983777576446752E-001 7.107313061461353E-001 7.231455640705178E-001 7.356105681487528E-001 + 7.481156304739432E-001 7.606493099757455E-001 7.731993847329376E-001 7.857528255192076E-001 + 7.982957710384382E-001 8.108135053724798E-001 8.232904382364516E-001 8.357100887134206E-001 + 8.480550732214085E-001 8.603070985497995E-001 8.724469608881676E-001 8.844545518561425E-001 + 8.963088726258920E-001 9.079880573057736E-001 9.194694068207137E-001 9.307294345771253E-001 + 9.417439252316196E-001 9.524880078864280E-001 9.629362450020343E-001 9.730627382392718E-001 + 9.828412523080385E-001 9.922453576951257E-001 1.001248592855112E+000 1.009824646060030E+000 + 1.017947556597752E+000 1.025591934366663E+000 1.032733196113644E+000 1.039347815581042E+000 + 1.045413583640763E+000 1.050909873072501E+000 1.055817900958262E+000 1.060120979682472E+000 + 1.063804745207637E+000 1.066857348594371E+000 1.069269593597920E+000 1.071034999536379E+000 + 1.072149764409427E+000 1.072612598354798E+000 1.072424391847801E+000 1.071587690426032E+000 + 1.070106118270693E+000 1.067984202196006E+000 1.065227351723261E+000 1.061841848932560E+000 + 1.057834836312705E+000 1.053214302726913E+000 1.047989067607154E+000 1.042168763484356E+000 + 1.035763816955753E+000 1.028785428184352E+000 1.021245549019500E+000 1.013156859821308E+000 + 1.004532745065794E+000 9.953872678016865E-001 9.857351430238847E-001 9.755917100227249E-001 + 9.649729037621617E-001 9.538952253338502E-001 9.423757115279076E-001 9.304319035546309E-001 + 9.180818149450930E-001 9.053438986518637E-001 8.922370133647387E-001 8.787803890501622E-001 + 8.649935917172931E-001 8.508964874088556E-001 8.365092054115097E-001 8.218521006761215E-001 + 8.069457154407494E-001 7.918107400541491E-001 7.764679729979741E-001 7.609382801129556E-001 + 7.452425530561088E-001 7.294016670367529E-001 7.134364378889109E-001 6.973675785709821E-001 + 6.812156552203880E-001 6.650010429212662E-001 6.487438813816720E-001 6.324640307551969E-001 + 6.161810278793450E-001 5.999140432373210E-001 5.836818389791119E-001 5.675027283596522E-001 + 5.513945369645278E-001 5.353745660955663E-001 5.194595586785719E-001 5.036656680328989E-001 + 4.880084298076144E-001 4.725027373423477E-001 4.571628206540134E-001 4.420022291852051E-001 + 4.270338183785754E-001 4.122697400665679E-001 3.977214365901936E-001 3.833996384871282E-001 + 3.693143655208982E-001 3.554749307620615E-001 3.418899473813509E-001 3.285673377757301E-001 + 3.155143446227681E-001 3.027375434476552E-001 2.902428562910548E-001 2.780355660845704E-001 + 2.661203313730894E-001 2.545012010681478E-001 2.431816289715946E-001 2.321644878716100E-001 + 2.214520830804775E-001 2.110461653521245E-001 2.009479431840698E-001 1.911580945698065E-001 + 1.816767783211351E-001 1.725036451232393E-001 1.636378485168610E-001 1.550780560209846E-001 + 1.468224606159177E-001 1.388687928012488E-001 1.312143334271021E-001 1.238559274721409E-001 + 1.167899989098829E-001 1.100125667682416E-001 1.035192624479151E-001 9.730534832530055E-002 + 9.136573762674108E-002 8.569501552456846E-002 8.028746137268214E-002 7.513707197108518E-002 + 7.023758572533338E-002 6.558250754842999E-002 6.116513433927525E-002 5.697858086311113E-002 + 5.301580585514614E-002 4.926963816823227E-002 4.573280278860544E-002 4.239794654977374E-002 + 3.925766338312286E-002 3.630451895422748E-002 3.353107454575449E-002 3.092991006081133E-002 + 2.849364603427643E-002 2.621496455373082E-002 2.408662900583072E-002 2.210150257809416E-002 + 2.025256545993835E-002 1.853293070024925E-002 1.693585869167060E-002 1.545477026407370E-002 + 1.408325838123921E-002 1.281509844559459E-002 1.164425722586924E-002 1.056490043172602E-002 + 9.571398967791302E-003 8.658333907028448E-003 7.820500230084950E-003 7.052909383099762E-003 + 6.350790711498487E-003 5.709591831549846E-003 5.124978004929267E-003 4.592830584262377E-003 + 4.109244599632740E-003 3.670525557367215E-003 3.273185523095274E-003 2.913938561153695E-003 + 2.589695601915163E-003 2.297558807601527E-003 2.034815505642234E-003 1.798931756701356E-003 + 1.587545622167612E-003 1.398460193226809E-003 1.229636440661425E-003 1.079185941292917E-003 + 9.453635335442980E-004 8.265599509974068E-004 7.212944790941751E-004 6.282076763252864E-004 + 5.460541974023030E-004 4.736957520579292E-004 4.100942292983616E-004 3.543050131738807E-004 + 3.054705124685239E-004 2.628139231632024E-004 2.256332391226233E-004 1.932955232151000E-004 + 1.652314480130730E-004 1.409301123549920E-004 1.199341373870588E-004 1.018350432542563E-004 + 8.626890537813499E-005 7.291233640150445E-005 6.147907744004595E-005 5.171549535898937E-005 + 4.339782795511430E-005 3.632921638739082E-005 3.033691447022094E-005 2.526972787969675E-005 + 2.099567181922993E-005 1.739983533262328E-005 1.438244023885100E-005 1.185708258120988E-005 + 9.749144521328623E-006 7.994364752793941E-006 6.537555746872585E-006 5.331456461151729E-006 + 4.335709528389563E-006 3.515952385446531E-006 2.843012289435873E-006 2.292195689473453E-006 + 1.842662967682300E-006 1.476880123333771E-006 1.180139540953571E-006 9.401425495972628E-007 + 7.466370398927241E-007 5.911039523531816E-007 4.664869802480603E-007 3.669603391777808E-007 + 2.877299404177229E-007 2.248637637934849E-007 1.751476567137884E-007 1.359631880161464E-007 + 1.051845580117335E-007 8.109190956092001E-008 6.229869958723697E-008 4.769107690389118E-008 + 3.637747162137628E-008 2.764683498609501E-008 2.093417769404813E-008 1.579224107433428E-008 + 1.186830066233223E-008 8.885247235514923E-009 6.626218021846809E-009 4.922162142119893E-009 + 3.641820995427706E-009 2.683687756578669E-009 1.969581860278122E-009 1.439535643347646E-009 + 1.047742449858767E-009 7.593596208553931E-010 5.479969346747525E-010 3.937521796580370E-010 + 2.816814747023348E-010 2.006134579316893E-010 1.422342052421618E-010 1.003843023343886E-010 + 7.052138454863003E-011 4.931111824374260E-011 3.431740362083495E-011 2.376885448501602E-011 + 1.638362916513345E-011 1.123867933374322E-011 7.672642966114915E-012 5.214094957198777E-012 + 3.528817082726973E-012 2.381267665705056E-012 1.606610446594055E-012 1.078256886535217E-012 + 7.198041870942759E-013 4.779228553322317E-013 3.155898280464901E-013 2.072430855648540E-013 + 1.353314306877513E-013 8.787153240779351E-014 5.672801387318032E-014 3.640955450006067E-014 + 2.323109714123703E-014 1.473426263149192E-014 9.288782155599184E-015 5.820064242028050E-015 + 3.624114725770366E-015 2.242576991226764E-015 1.378890353981225E-015 8.423921308768696E-016 + 5.112883268606081E-016 3.082824713341214E-016 1.846405501524063E-016 1.098409058846233E-016 + 6.489674298765667E-017 3.807728841250568E-017 2.218479982492339E-017 1.283373294676381E-017 + 7.370883977723126E-018 4.202578824714963E-018 2.378493684635331E-018 1.336095816291324E-018 + 7.448722400973624E-019 4.120910295415995E-019 2.262193762774352E-019 1.232109378229029E-019 + 6.657460053597807E-020 3.568323323569961E-020 1.897020761358039E-020 1.000201734219212E-020 + 5.229565096754398E-021 2.711191803593430E-021 1.393558756714095E-021 7.100906411562849E-022 + 3.586561278527761E-022 1.795438721015096E-022 8.907217994028038E-023 4.378682172295313E-023 + 2.132674992965308E-023 1.029047160316851E-023 4.918402076622400E-024 2.328300786043027E-024 + 1.091510579423154E-024 5.066843226623238E-025 2.328701444012627E-025 1.059503715396926E-025 + 4.771427112535666E-026 2.126646769693280E-026 9.379660074655577E-027 4.093230616476988E-027 + 1.767155174112370E-027 7.546642390310776E-028 3.187454398608921E-028 1.331328045537664E-028 + 5.498143627775605E-029 2.244787423740202E-029 9.059411034646792E-030 3.613491102970009E-030 + 1.424269509825342E-030 5.546647941388047E-031 2.133912065368205E-031 8.108926453879534E-032 + 3.043152537539202E-032 1.127689003239632E-032 4.125638003053172E-033 1.489906654045815E-033 + 5.310339718188228E-034 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 + + els(2) = "3D" + lchi(2) = 2 + oc(2) = 0.000000000000000E+000 + nchi(2) = 3 + epseu(2) = -3.841408597712678E+000 + rcut_chi(2) = 1.000000000000000E+000 + rcutus_chi(2) = 1.000000000000000E+000 + chi(1:1177,2) = +-1.109914671868205E-012 -1.152326727870288E-012 -1.196359433208574E-012 -1.242074716145936E-012 +-1.289536871331851E-012 -1.338812650242699E-012 -1.389971355062025E-012 -1.443084936148156E-012 +-1.498228093226232E-012 -1.555478380447005E-012 -1.614916315460140E-012 -1.676625492655419E-012 +-1.740692700731117E-012 -1.807208044754909E-012 -1.876265072888960E-012 -1.947960907957430E-012 +-2.022396384041449E-012 -2.099676188293648E-012 -2.179909008171710E-012 -2.263207684298002E-012 +-2.349689369160283E-012 -2.439475691876691E-012 -2.532692929256706E-012 -2.629472183398720E-012 +-2.729949566073948E-012 -2.834266390156022E-012 -2.942569368365481E-012 -3.055010819608706E-012 +-3.171748883201442E-012 -3.292947741278269E-012 -3.418777849700744E-012 -3.549416177789040E-012 +-3.685046457214173E-012 -3.825859440400923E-012 -3.972053168804822E-012 -4.123833251440576E-012 +-4.281413154053562E-012 -4.445014499341196E-012 -4.614867378646326E-012 -4.791210675561068E-012 +-4.974292401896150E-012 -5.164370046488373E-012 -5.361710937336643E-012 -5.566592617575997E-012 +-5.779303235818310E-012 -6.000141951408667E-012 -6.229419355167470E-012 -6.467457906209882E-012 +-6.714592385457000E-012 -6.971170366476631E-012 -7.237552704315803E-012 -7.514114043012578E-012 +-7.801243342500821E-012 -8.099344425649154E-012 -8.408836546203285E-012 -8.730154978430543E-012 +-9.063751629295926E-012 -9.410095674030595E-012 -9.769674215986787E-012 -1.014299297170695E-011 +-1.053057698217080E-011 -1.093297135122061E-011 -1.135074201220309E-011 -1.178447652390622E-011 +-1.223478489691044E-011 -1.270230045151631E-011 -1.318768070845530E-011 -1.369160831363649E-011 +-1.421479199822950E-011 -1.475796757543427E-011 -1.532189897533935E-011 -1.590737931932406E-011 +-1.651523203551586E-011 -1.714631201687144E-011 -1.780150682351046E-011 -1.848173793099279E-011 +-1.918796202629486E-011 -1.992117235330807E-011 -2.068240010975102E-011 -2.147271589746076E-011 +-2.229323122810249E-011 -2.314510008641532E-011 -2.402952055319287E-011 -2.494773649028119E-011 +-2.590103928996368E-011 -2.689076969119345E-011 -2.791831966522755E-011 -2.898513437331523E-011 +-3.009271419919302E-011 -3.124261685924550E-011 -3.243645959329974E-011 -3.367592143913411E-011 +-3.496274559390068E-011 -3.629874186578200E-011 -3.768578921933093E-011 -3.912583841807252E-011 +-4.062091476808511E-011 -4.217312096641934E-011 -4.378464005836023E-011 -4.545773850769275E-011 +-4.719476938428780E-011 -4.899817567349233E-011 -5.087049371197791E-011 -5.281435675487957E-011 +-5.483249867924211E-011 -5.692775782898258E-011 -5.910308100677614E-011 -6.136152761847969E-011 +-6.370627397592253E-011 -6.614061776411417E-011 -6.866798267915393E-011 -7.129192324336335E-011 +-7.401612980441505E-011 -7.684443372548741E-011 -7.978081277374560E-011 -8.282939671472708E-011 +-8.599447312049908E-011 -8.928049339975802E-011 -9.269207905834959E-011 -9.623402819901681E-011 +-9.991132226951503E-011 -1.037291330685864E-010 -1.076928300196463E-010 -1.118079877224109E-010 +-1.160803937930876E-010 -1.205160570041543E-010 -1.251212157351757E-010 -1.299023467465412E-010 +-1.348661742884648E-010 -1.400196795580576E-010 -1.453701105177737E-010 -1.509249920890369E-010 +-1.566921367353869E-010 -1.626796554500271E-010 -1.688959691632289E-010 -1.753498205856329E-010 +-1.820502865041089E-010 -1.890067905474613E-010 -1.962291164399378E-010 -2.037274217611819E-010 +-2.115122522319764E-010 -2.195945565458756E-010 -2.279857017675807E-010 -2.366974893197187E-010 +-2.457421715805052E-010 -2.551324691156352E-010 -2.648815885686400E-010 -2.750032412348660E-010 +-2.855116623452028E-010 -2.964216310866792E-010 -3.077484913880821E-010 -3.195081734998356E-010 +-3.317172163984882E-010 -3.443927910473178E-010 -3.575527245457688E-010 -3.712155252016827E-010 +-3.854004085615900E-010 -4.001273244356655E-010 -4.154169849553591E-010 -4.312908937031633E-010 +-4.477713759554795E-010 -4.648816100811268E-010 -4.826456601396412E-010 -5.010885097252221E-010 +-5.202360971039142E-010 -5.401153516934474E-010 -5.607542319370465E-010 -5.821817646244585E-010 +-6.044280857155177E-010 -6.275244827236505E-010 -6.515034387189335E-010 -6.763986780125896E-010 +-7.022452135871754E-010 -7.290793963391566E-010 -7.569389662031409E-010 -7.858631052296501E-010 +-8.158924926911055E-010 -8.470693622935004E-010 -8.794375615742384E-010 -9.130426135696757E-010 +-9.479317808390810E-010 -9.841541319350821E-010 -1.021760610414045E-009 -1.060804106483487E-009 +-1.101339531387250E-009 -1.143423894633069E-009 -1.187116384171142E-009 -1.232478449636462E-009 +-1.279573888771996E-009 -1.328468937154233E-009 -1.379232361347305E-009 -1.431935555616695E-009 +-1.486652642338536E-009 -1.543460576245737E-009 -1.602439252657524E-009 -1.663671619844602E-009 +-1.727243795688015E-009 -1.793245188795714E-009 -1.861768624247205E-009 -1.932910474143117E-009 +-2.006770793143271E-009 -2.083453459183904E-009 -2.163066319571924E-009 -2.245721342661674E-009 +-2.331534775327502E-009 -2.420627306453629E-009 -2.513124236671231E-009 -2.609155654581438E-009 +-2.708856619712110E-009 -2.812367352465689E-009 -2.919833431325228E-009 -3.031405997596022E-009 +-3.147241967970711E-009 -3.267504255216809E-009 -3.392361997297108E-009 -3.521990795245027E-009 +-3.656572960129651E-009 -3.796297769457609E-009 -3.941361733372446E-009 -4.091968871025926E-009 +-4.248330997509826E-009 -4.410668021751880E-009 -4.579208255794682E-009 -4.754188735892643E-009 +-4.935855555878495E-009 -5.124464213268199E-009 -5.320279968591006E-009 -5.523578218450016E-009 +-5.734644882837889E-009 -5.953776807252394E-009 -6.181282180177324E-009 -6.417480966515964E-009 +-6.662705357586545E-009 -6.917300238312623E-009 -7.181623672265383E-009 -7.456047405240013E-009 +-7.740957388074396E-009 -8.036754319445223E-009 -8.343854209405098E-009 -8.662688964452967E-009 +-8.993706994960781E-009 -9.337373845810655E-009 -9.694172851129279E-009 -1.006460581404052E-008 +-1.044919371239202E-008 -1.084847743144834E-008 -1.126301852458107E-008 -1.169340000302564E-008 +-1.214022715581544E-008 -1.260412840104647E-008 -1.308575616966943E-008 -1.358578782305247E-008 +-1.410492660560463E-008 -1.464390263379978E-008 -1.520347392299212E-008 -1.578442745346678E-008 +-1.638758027722528E-008 -1.701378066706173E-008 -1.766390930954626E-008 -1.833888054359288E-008 +-1.903964364635380E-008 -1.976718416824852E-008 -2.052252531900485E-008 -2.130672940666162E-008 +-2.212089933155591E-008 -2.296618013739626E-008 -2.384376062160304E-008 -2.475487500718028E-008 +-2.570080467847019E-008 -2.668287998323128E-008 -2.770248210357426E-008 -2.876104499838657E-008 +-2.986005741997713E-008 -3.100106500777712E-008 -3.218567246204125E-008 -3.341554580060568E-008 +-3.469241470187672E-008 -3.601807493734452E-008 -3.739439089704267E-008 -3.882329821150491E-008 +-4.030680647390579E-008 -4.184700206621344E-008 -4.344605109332828E-008 -4.510620242933335E-008 +-4.682979088014072E-008 -4.861924046697992E-008 -5.047706783534655E-008 -5.240588579420400E-008 +-5.440840699041484E-008 -5.648744772356923E-008 -5.864593190657386E-008 -6.088689517757069E-008 +-6.321348916896752E-008 -6.562898593958285E-008 -6.813678257613720E-008 -7.074040597056072E-008 +-7.344351777983526E-008 -7.624991957534354E-008 -7.916355818896654E-008 -8.218853126344649E-008 +-8.532909301481786E-008 -8.858966021501038E-008 -9.197481840303482E-008 -9.548932833348504E-008 +-9.913813267142262E-008 -1.029263629430567E-007 -1.068593467519929E-007 -1.109426152711961E-007 +-1.151819110212008E-007 -1.195831959455045E-007 -1.241526597944992E-007 -1.288967288297264E-007 +-1.338220748606932E-007 -1.389356246269571E-007 -1.442445695386652E-007 -1.497563757892466E-007 +-1.554787948544711E-007 -1.614198743926371E-007 -1.675879695612115E-007 -1.739917547658307E-007 +-1.806402358581798E-007 -1.875427627998985E-007 -1.947090428103139E-007 -2.021491540164871E-007 +-2.098735596247572E-007 -2.178931226337076E-007 -2.262191211092353E-007 -2.348632640431957E-007 +-2.438377078179147E-007 -2.531550732997120E-007 -2.628284635854634E-007 -2.728714824271450E-007 +-2.832982533602601E-007 -2.941234395630308E-007 -3.053622644742722E-007 -3.170305331989269E-007 +-3.291446547313423E-007 -3.417216650275299E-007 -3.547792509588334E-007 -3.683357751806652E-007 +-3.824103019512718E-007 -3.970226239368060E-007 -4.121932900403800E-007 -4.279436342942080E-007 +-4.442958058554416E-007 -4.612728001478520E-007 -4.788984911931141E-007 -4.971976651771378E-007 +-5.161960552986004E-007 -5.359203779486576E-007 -5.563983702726666E-007 -5.776588291666999E-007 +-5.997316517636425E-007 -6.226478774657589E-007 -6.464397315827813E-007 -6.711406706368349E-007 +-6.967854293978464E-007 -7.234100697155143E-007 -7.510520312164484E-007 -7.797501839376902E-007 +-8.095448829705630E-007 -8.404780251916009E-007 -8.725931081602535E-007 -9.059352912660913E-007 +-9.405514592114056E-007 -9.764902879183558E-007 -1.013802312953252E-006 -1.052540000564045E-006 +-1.092757821430818E-006 -1.134512327232823E-006 -1.177862230139611E-006 -1.222868485337860E-006 +-1.269594376709812E-006 -1.318105605783591E-006 -1.368470384080320E-006 -1.420759528987680E-006 +-1.475046563294531E-006 -1.531407818526310E-006 -1.589922542226298E-006 -1.650673009333321E-006 +-1.713744637812268E-006 -1.779226108699681E-006 -1.847209490732967E-006 -1.917790369738086E-006 +-1.991067982957360E-006 -2.067145358505855E-006 -2.146129460152090E-006 -2.228131337626162E-006 +-2.313266282666246E-006 -2.401653991022370E-006 -2.493418730644751E-006 -2.588689516292659E-006 +-2.687600290808700E-006 -2.790290113312826E-006 -2.896903354580009E-006 -3.007589899875586E-006 +-3.122505359532750E-006 -3.241811287567424E-006 -3.365675408637110E-006 -3.494271853661897E-006 +-3.627781404437967E-006 -3.766391747586455E-006 -3.910297738193718E-006 -4.059701673512444E-006 +-4.214813577107255E-006 -4.375851493842956E-006 -4.543041796128763E-006 -4.716619501847624E-006 +-4.896828604416023E-006 -5.083922415436590E-006 -5.278163920423539E-006 -5.479826148099044E-006 +-5.689192553777761E-006 -5.906557417376366E-006 -6.132226256605240E-006 -6.366516255920829E-006 +-6.609756711839101E-006 -6.862289495233224E-006 -7.124469531262622E-006 -7.396665297604751E-006 +-7.679259341686719E-006 -7.972648817640326E-006 -8.277246043731435E-006 -8.593479081043327E-006 +-8.921792334223137E-006 -9.262647175131274E-006 -9.616522590265581E-006 -9.983915852865115E-006 +-1.036534322063276E-005 -1.076134066005144E-005 -1.117246459830585E-005 -1.159929270385994E-005 +-1.204242469678006E-005 -1.250248318993528E-005 -1.298011456224919E-005 -1.347598986522168E-005 +-1.399080576398618E-005 -1.452528551421461E-005 -1.508017997623328E-005 -1.565626866776367E-005 +-1.625436085675581E-005 -1.687529669583786E-005 -1.751994839996257E-005 -1.818922146889174E-005 +-1.888405595622147E-005 -1.960542778671531E-005 -2.035435012377961E-005 -2.113187478898429E-005 +-2.193909373560470E-005 -2.277714057823408E-005 -2.364719218059415E-005 -2.455047030375188E-005 +-2.548824331703256E-005 -2.646182797400761E-005 -2.747259125602342E-005 -2.852195228583163E-005 +-2.961138431397762E-005 -3.074241678070339E-005 -3.191663745622573E-005 -3.313569466235779E-005 +-3.440129957855380E-005 -3.571522863557279E-005 -3.707932600007716E-005 -3.849550615360676E-005 +-3.996575656949813E-005 -4.149214049145277E-005 -4.307679981759752E-005 -4.472195809402413E-005 +-4.642992362194448E-005 -4.820309268275291E-005 -5.004395288544889E-005 -5.195508664103849E-005 +-5.393917476870679E-005 -5.599900023873294E-005 -5.813745205730445E-005 -6.035752929858140E-005 +-6.266234528955890E-005 -6.505513195348601E-005 -6.753924431781150E-005 -7.011816519285037E-005 +-7.279551002759639E-005 -7.557503194934448E-005 -7.846062699403367E-005 -8.145633953448076E-005 +-8.456636791393803E-005 -8.779507029268650E-005 -9.114697071566104E-005 -9.462676540940080E-005 +-9.823932931692565E-005 -1.019897228794554E-004 -1.058831990742199E-004 -1.099252107179519E-004 +-1.141214180460019E-004 -1.184776965773876E-004 -1.230001452764674E-004 -1.276950950223183E-004 +-1.325691173973110E-004 -1.376290338067911E-004 -1.428819249422184E-004 -1.483351406005623E-004 +-1.539963098732239E-004 -1.598733517182401E-004 -1.659744859300237E-004 -1.723082445214180E-004 +-1.788834835333796E-004 -1.857093952881595E-004 -1.927955211024309E-004 -2.001517644774069E-004 +-2.077884047836091E-004 -2.157161114585890E-004 -2.239459587365560E-004 -2.324894409295671E-004 +-2.413584882806121E-004 -2.505654834096953E-004 -2.601232783747346E-004 -2.700452123699083E-004 +-2.803451300848720E-004 -2.910374007491100E-004 -3.021369378865511E-004 -3.136592198064641E-004 +-3.256203108575795E-004 -3.380368834733307E-004 -3.509262410370919E-004 -3.643063415973189E-004 +-3.781958224635301E-004 -3.926140257151664E-004 -4.075810246564821E-004 -4.231176512517721E-004 +-4.392455245764401E-004 -4.559870803206434E-004 -4.733656013835080E-004 -4.914052495972423E-004 +-5.101310986218039E-004 -5.295691680521814E-004 -5.497464587817915E-004 -5.706909896669606E-004 +-5.924318355390044E-004 -6.149991666119614E-004 -6.384242893356965E-004 -6.627396887457125E-004 +-6.879790723627608E-004 -7.141774156970851E-004 -7.413710094139555E-004 -7.695975082190248E-004 +-7.988959815239458E-004 -8.293069659546778E-004 -8.608725197669320E-004 -8.936362792352826E-004 +-9.276435170846195E-004 -9.629412030348161E-004 -9.995780665317182E-004 -1.037604661739899E-003 +-1.077073434874960E-003 -1.118038793955617E-003 -1.160557181058260E-003 -1.204687147159246E-003 +-1.250489429652756E-003 -1.298027032634730E-003 -1.347365310046105E-003 -1.398572051771327E-003 +-1.451717572790977E-003 -1.506874805490197E-003 -1.564119395227577E-003 -1.623529799272130E-003 +-1.685187389219019E-003 -1.749176556997832E-003 -1.815584824590297E-003 -1.884502957577516E-003 +-1.956025082640092E-003 -2.030248809137656E-003 -2.107275354897749E-003 -2.187209676347222E-003 +-2.270160603122759E-003 -2.356240977300412E-003 -2.445567797387572E-003 -2.538262367224019E-003 +-2.634450449942266E-003 -2.734262427140656E-003 -2.837833463426205E-003 -2.945303676487375E-003 +-3.056818312860455E-003 -3.172527929556371E-003 -3.292588581718029E-003 -3.417162016481457E-003 +-3.546415873217016E-003 -3.680523890330034E-003 -3.819666118802951E-003 -3.964029142663790E-003 +-4.113806306568509E-003 -4.269197950686902E-003 -4.430411653084150E-003 -4.597662479791959E-003 +-4.771173242765036E-003 -4.951174765920034E-003 -5.137906159455257E-003 -5.331615102650311E-003 +-5.532558135345192E-003 -5.741000958298393E-003 -5.957218742623273E-003 -6.181496448500787E-003 +-6.414129153365493E-003 -6.655422389759563E-003 -6.905692493046788E-003 -7.165266959175435E-003 +-7.434484812674378E-003 -7.713696985062252E-003 -8.003266703843496E-003 -8.303569892258162E-003 +-8.614995579944981E-003 -8.937946324667810E-003 -9.272838645245928E-003 -9.620103465816841E-003 +-9.980186571547769E-003 -1.035354907589778E-002 -1.074066789951627E-002 -1.114203626084673E-002 +-1.155816417848449E-002 -1.198957898531658E-002 -1.243682585444796E-002 -1.290046833689312E-002 +-1.338108891098384E-002 -1.387928954341365E-002 -1.439569226180608E-002 -1.493093973865805E-002 +-1.548569588647051E-002 -1.606064646383623E-002 -1.665649969220912E-002 -1.727398688302946E-002 +-1.791386307482755E-002 -1.857690767986958E-002 -1.926392513984924E-002 -1.997574559006194E-002 +-2.071322553142768E-002 -2.147724850965326E-002 -2.226872580074288E-002 -2.308859710197935E-002 +-2.393783122740654E-002 -2.481742680674327E-002 -2.572841298655550E-002 -2.667185013240022E-002 +-2.764883053053632E-002 -2.866047908767118E-002 -2.970795402707713E-002 -3.079244757927070E-002 +-3.191518666529630E-002 -3.307743357049753E-002 -3.428048660649127E-002 -3.552568075888173E-002 +-3.681438831806583E-002 -3.814801949028370E-002 -3.952802298586160E-002 -4.095588658137812E-002 +-4.243313765225470E-002 -4.396134367203627E-002 -4.554211267437402E-002 -4.717709367346578E-002 +-4.886797703843540E-002 -5.061649481684945E-002 -5.242442100227689E-002 -5.429357174049071E-002 +-5.622580546859501E-002 -5.822302298103475E-002 -6.028716741610696E-002 -6.242022415624730E-002 +-6.462422063500889E-002 -6.690122604328452E-002 -6.925335092695563E-002 -7.168274666776722E-002 +-7.419160483884985E-002 -7.678215642591707E-002 -7.945667090478138E-002 -8.221745516543870E-002 +-8.506685227258455E-002 -8.800724005204137E-002 -9.104102949219905E-002 -9.417066294920466E-002 +-9.739861214428548E-002 -1.007273759412508E-001 -1.041594778919085E-001 -1.076974635368411E-001 +-1.113438974487319E-001 -1.151013600052123E-001 -1.189724438780256E-001 -1.229597502251756E-001 +-1.270658845726585E-001 -1.312934523723746E-001 -1.356450542228826E-001 -1.401232807398072E-001 +-1.447307070629594E-001 -1.494698869875623E-001 -1.543433467074420E-001 -1.593535781586139E-001 +-1.645030319524126E-001 -1.697941098881814E-001 -1.752291570365528E-001 -1.808104533855603E-001 +-1.865402050432015E-001 -1.924205349916691E-001 -1.984534733902655E-001 -2.046409474260645E-001 +-2.109847707136547E-001 -2.174866322478557E-001 -2.241480849160995E-001 -2.309705335802841E-001 +-2.379552227412933E-001 -2.451032238030917E-001 -2.524154219573245E-001 -2.598925027137000E-001 +-2.675349381061115E-001 -2.753429726094589E-001 -2.833166088074742E-001 -2.914555928575161E-001 +-2.997593998042666E-001 -3.082272188005585E-001 -3.168579383001092E-001 -3.256501312937503E-001 +-3.346020406677969E-001 -3.437115647704025E-001 -3.529762432791173E-001 -3.623932434703024E-001 +-3.719593469984950E-001 -3.816709373012314E-001 -3.915239877520540E-001 -4.015140506914548E-001 +-4.116362474721451E-001 -4.218852596612518E-001 -4.322553215476302E-001 -4.427402141073426E-001 +-4.533332605843729E-001 -4.640273238465699E-001 -4.748148056785735E-001 -4.856876481738981E-001 +-4.966373373870987E-001 -5.076549094041326E-001 -5.187309589841382E-001 -5.298556509190070E-001 +-5.410187342479129E-001 -5.522095594523835E-001 -5.634170987433210E-001 -5.746299695344752E-001 +-5.858364611771563E-001 -5.970245650083612E-001 -6.081820077388723E-001 -6.192962881793401E-001 +-6.303547172708437E-001 -6.413444613520145E-001 -6.522525885576996E-001 -6.630661182044184E-001 +-6.737720729758485E-001 -6.843575336775426E-001 -6.948096962843713E-001 -7.051159309573447E-001 +-7.152638426587341E-001 -7.252413329467774E-001 -7.350366624838023E-001 -7.446385137454918E-001 +-7.540360533745870E-001 -7.632189935805899E-001 -7.721776519485309E-001 -7.809030089856367E-001 +-7.893867627053061E-001 -7.976213795242063E-001 -8.056001407310364E-001 -8.133171837755898E-001 +-8.207675376245243E-001 -8.279471514366898E-001 -8.348529158263155E-001 -8.414826760073750E-001 +-8.478352361477001E-001 -8.539103543070372E-001 -8.597087273899733E-001 -8.652319656127307E-001 +-8.704825560628994E-001 -8.754638150235704E-001 -8.801798288390974E-001 -8.846353832193903E-001 +-8.888358810145258E-001 -8.927872486428545E-001 -8.964958315253919E-001 -8.999682790689296E-001 +-9.032114199525165E-001 -9.062321287089610E-001 -9.090371848577464E-001 -9.116331261403675E-001 +-9.140260977362721E-001 -9.162216996982816E-001 -9.182248352410686E-001 -9.200395629425345E-001 +-9.216689563711850E-001 -9.231149751231017E-001 -9.243783517253741E-001 -9.254584993161499E-001 +-9.263534454138350E-001 -9.270597973958549E-001 -9.275727454643544E-001 -9.278861088093873E-001 +-9.279924302976509E-001 -9.278831242043520E-001 -9.275486801324053E-001 -9.269789241657663E-001 +-9.261633352981061E-001 -9.250914110493617E-001 -9.237530706909418E-001 -9.221390773713029E-001 +-9.202414513594849E-001 -9.180538352548725E-001 -9.155717579381163E-001 -9.127927267792610E-001 +-9.097160565922359E-001 -9.063423398303055E-001 -9.026727139724054E-001 -8.987086273391314E-001 +-8.944518219630417E-001 -8.899043331435215E-001 -8.850684889530842E-001 -8.799469096982419E-001 +-8.745425073307006E-001 -8.688584847972438E-001 -8.628983353085917E-001 -8.566658414992527E-001 +-8.501650744415801E-001 -8.434003924679242E-001 -8.363764397453113E-001 -8.290981445370745E-001 +-8.215707170759501E-001 -8.137996469633921E-001 -8.057907000010360E-001 -7.975499143495947E-001 +-7.890835959062666E-001 -7.803983127892100E-001 -7.715008888107032E-001 -7.623983958197820E-001 +-7.530981448092200E-001 -7.436076756952681E-001 -7.339347456824956E-001 -7.240873161543159E-001 +-7.140735380642140E-001 -7.039017358328595E-001 -6.935803897976979E-001 -6.831181173074616E-001 +-6.725236526003895E-001 -6.618058256565174E-001 -6.509735402608411E-001 -6.400357515596777E-001 +-6.290014434313818E-001 -6.178796060233140E-001 -6.066792138273228E-001 -5.954092046742873E-001 +-5.840784600232468E-001 -5.726957869016037E-001 -5.612699018199273E-001 -5.498094169384983E-001 +-5.383228287042219E-001 -5.268185091076159E-001 -5.153046996324402E-001 -5.037895078878736E-001 +-4.922809068277141E-001 -4.807867363761457E-001 -4.693147071982353E-001 -4.578724062788215E-001 +-4.464673039088998E-001 -4.351067616268594E-001 -4.237980406255449E-001 -4.125483101170280E-001 +-4.013646551465034E-001 -3.902540833654283E-001 -3.792235303114299E-001 -3.682798627973528E-001 +-3.574298800818383E-001 -3.466803125758676E-001 -3.360378179301381E-001 -3.255089744426692E-001 +-3.151002718204150E-001 -3.048180994186386E-001 -2.946687321635849E-001 -2.846583144344612E-001 +-2.747928422374927E-001 -2.650781440465027E-001 -2.555198607105285E-001 -2.461234248397772E-001 +-2.368940400779104E-001 -2.278366606528235E-001 -2.189559715719054E-001 -2.102563697934807E-001 +-2.017419466660726E-001 -1.934164718835521E-001 -1.852833791591224E-001 -1.773457537762140E-001 +-1.696063221311138E-001 -1.620674433416176E-001 -1.547311029589543E-001 -1.475989087871304E-001 +-1.406720887849459E-001 -1.339514910012340E-001 -1.274375854732643E-001 -1.211304680014735E-001 +-1.150298657004169E-001 -1.091351442157230E-001 -1.034453164894879E-001 -9.795905295158422E-002 +-9.267469301144352E-002 -8.759025772363760E-002 -8.270346350075999E-002 -7.801173674841895E-002 +-7.351222929936828E-002 -6.920183452674210E-002 -6.507720401985227E-002 -6.113476470993396E-002 +-5.737073633747431E-002 -5.378114915725080E-002 -5.036186178188148E-002 -4.710857906949086E-002 +-4.401686996599604E-002 -4.108218521748479E-002 -3.829987487317254E-002 -3.566520550447583E-002 +-3.317337707081166E-002 -3.081953936781888E-002 -2.859880799879171E-002 -2.650627981520616E-002 +-2.453704777730558E-002 -2.268621519077722E-002 -2.094890928059408E-002 -1.932029406810130E-002 +-1.779558252238292E-002 -1.637004796184315E-002 -1.503903468675808E-002 -1.379796782828773E-002 +-1.264236240406758E-002 -1.156783157500635E-002 -1.057009410228786E-002 -9.644981007790307E-003 +-8.788441445181578E-003 -7.996547792806395E-003 -7.265499983134135E-003 -6.591629086971412E-003 +-5.971400173844213E-003 -5.401414472909904E-003 -4.878410861456299E-003 -4.399266710473836E-003 +-3.960998118939320E-003 -3.560759570318517E-003 -3.195843046376001E-003 -2.863676634671122E-003 +-2.561822667118141E-003 -2.287975427698495E-003 -2.039958467836807E-003 -1.815721568097323E-003 +-1.613337384716016E-003 -1.430998782655097E-003 -1.267022571063318E-003 -1.119826547574266E-003 +-9.879349362533364E-004 -8.699751341658228E-004 -7.646731788142539E-004 -6.708491613069328E-004 +-5.874126133216343E-004 -5.133578943032382E-004 -4.477596035912395E-004 -3.897680403364035E-004 +-3.386047321579409E-004 -2.935580515355409E-004 -2.539789369461929E-004 -2.192767337646807E-004 +-1.889151679686942E-004 -1.624084637432234E-004 -1.393176141812738E-004 -1.192468124445447E-004 +-1.018400489921678E-004 -8.677787882045583E-005 -7.377436109117977E-005 -6.257417206942536E-005 +-5.294989095056281E-005 -4.469945693410428E-005 -3.764379480314594E-005 -3.162460529291852E-005 +-2.650231568034159E-005 -2.215418529658858E-005 -1.847256005335998E-005 -1.536326957650378E-005 +-1.274416015244275E-005 -1.054375640732146E-005 -8.700044448915566E-006 -7.159369099632709E-006 +-5.875437827464562E-006 -4.808424032357347E-006 -3.924162459875888E-006 -3.193429683991710E-006 +-2.591302818212762E-006 -2.096589871223049E-006 -1.691325452183817E-006 -1.360325844747599E-006 +-1.090797801014851E-006 -8.719957510085462E-007 -6.949224742043485E-007 -5.520686322653660E-007 +-4.371869120140136E-007 -3.450968710421046E-007 -2.715169120033581E-007 -2.129201328955733E-007 +-1.664111073959767E-007 -1.296209399291765E-007 -1.006182134440443E-007 -7.783370308727961E-008 +-5.999696568954515E-008 -4.608313315035403E-008 -3.526843762439058E-008 -2.689317831343778E-008 +-2.043100428606967E-008 -1.546353586641816E-008 -1.165947965482783E-008 -8.757510151408358E-009 +-6.552295286067967E-009 -4.883134980415364E-009 -3.624762247529381E-009 -2.679926330516297E-009 +-1.973438016213078E-009 -1.447409521495869E-009 -1.057466172048978E-009 -7.697453580531138E-010 +-5.585307822933948E-010 -4.043975826752679E-010 -2.927672322006930E-010 -2.110104068774647E-010 +-1.514008766225205E-010 -1.081362540220379E-010 -7.687898990091456E-011 -5.440165591463880E-011 +-3.831413652100477E-011 -2.685483485885377E-011 -1.873165597839108E-011 -1.300150108283056E-011 +-8.979404089981892E-012 -6.170366400492423E-012 -4.218481884127906E-012 -2.869163213666832E-012 +-1.941242686664061E-012 -1.306475444173300E-012 -8.745617472794965E-013 -5.822615533903831E-013 +-3.855266429409540E-013 -2.538453335796962E-013 -1.662003599358308E-013 -1.081961540176563E-013 +-7.002892929036021E-014 -4.506063082276571E-014 -2.882299377098421E-014 -1.832611749010484E-014 +-1.158133206366638E-014 -7.273943581026671E-015 -4.540158230107176E-015 -2.815966942507531E-015 +-1.735421788970751E-015 -1.062596701481423E-015 -6.463717373513866E-016 -3.905807546256023E-016 +-2.344323634682500E-016 -1.397544796638547E-016 -8.274049108676491E-017 -4.864485432788234E-017 +-2.839775276499848E-017 -1.645965058885180E-017 -9.471257672429394E-018 -5.410101768821290E-018 +-3.067423924651603E-018 -1.726124379547633E-018 -9.639602336304101E-019 -5.341868640756639E-019 +-2.937190597105946E-019 -1.602260577206541E-019 -8.670676345057177E-020 -4.654229417879687E-020 +-2.477839684004989E-020 -1.308230566069140E-020 -6.849132223806676E-021 -3.555338107683577E-021 +-1.829673986186490E-021 -9.333977082785868E-022 -4.719675366471804E-022 -2.365165163068151E-022 +-1.174534363997429E-022 -5.779299919727447E-023 -2.817342900020602E-023 -1.360530370443916E-023 +-6.507726268499191E-024 -3.082837380927308E-024 -1.446170177246042E-024 -6.717104584671616E-025 +-3.088762733403483E-025 -1.405956361551232E-025 -6.334151138001427E-026 -2.824086707163570E-026 +-1.245901429825813E-026 -5.438106480911005E-027 -2.348073472935556E-027 -1.002804934760990E-027 +-4.235475334978145E-028 -1.768919714268841E-028 -7.304204964305237E-029 -2.981497619736009E-029 +-1.202900508574428E-029 -4.796173934462246E-030 -1.889581210844481E-030 -7.354891252835701E-031 +-2.827878979037006E-031 -1.073871297146637E-031 -4.027009360460148E-032 -1.491019483411858E-032 +-5.449851818532516E-033 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 + + els(3) = "3S" + lchi(3) = 0 + oc(3) = 2.000000000000000E+000 + nchi(3) = 1 + epseu(3) = -8.373940011626802E+000 + rcut_chi(3) = 9.434307879632442E-001 + rcutus_chi(3) = 9.434307879632442E-001 + chi(1:1177,3) = + 3.102279727032465E-005 3.141301602639238E-005 3.180814313032442E-005 3.220824032154230E-005 + 3.261337011605411E-005 3.302359581622266E-005 3.343898152065682E-005 3.385959213422685E-005 + 3.428549337820610E-005 3.471675180053999E-005 3.515343478624439E-005 3.559561056793451E-005 + 3.604334823648659E-005 3.649671775183337E-005 3.695578995389556E-005 3.742063657365070E-005 + 3.789133024434127E-005 3.836794451282392E-005 3.885055385106112E-005 3.933923366775784E-005 + 3.983406032014413E-005 4.033511112590609E-005 4.084246437526715E-005 4.135619934322087E-005 + 4.187639630191802E-005 4.240313653320917E-005 4.293650234134522E-005 4.347657706583761E-005 + 4.402344509448033E-005 4.457719187653570E-005 4.513790393608602E-005 4.570566888555325E-005 + 4.628057543938854E-005 4.686271342793412E-005 4.745217381145949E-005 4.804904869437420E-005 + 4.865343133961936E-005 4.926541618324029E-005 4.988509884914216E-005 5.051257616403184E-005 + 5.114794617254700E-005 5.179130815257592E-005 5.244276263076987E-005 5.310241139825066E-005 + 5.377035752651585E-005 5.444670538354384E-005 5.513156065010163E-005 5.582503033625770E-005 + 5.652722279810272E-005 5.723824775468042E-005 5.795821630513125E-005 5.868724094605229E-005 + 5.942543558907481E-005 6.017291557866344E-005 6.092979771013913E-005 6.169620024792846E-005 + 6.247224294404294E-005 6.325804705679062E-005 6.405373536972287E-005 6.485943221081993E-005 + 6.567526347191719E-005 6.650135662837616E-005 6.733784075900300E-005 6.818484656621750E-005 + 6.904250639647553E-005 6.991095426094858E-005 7.079032585646348E-005 7.168075858670538E-005 + 7.258239158368729E-005 7.349536572949023E-005 7.441982367827615E-005 7.535590987857809E-005 + 7.630377059587095E-005 7.726355393542578E-005 7.823540986545154E-005 7.921949024052809E-005 + 8.021594882533422E-005 8.122494131867372E-005 8.224662537780352E-005 8.328116064306869E-005 + 8.432870876284627E-005 8.538943341880359E-005 8.646350035147404E-005 8.755107738615449E-005 + 8.865233445912864E-005 8.976744364421994E-005 9.089657917967891E-005 9.203991749540847E-005 + 9.319763724053174E-005 9.436991931130642E-005 9.555694687939060E-005 9.675890542046375E-005 + 9.797598274320854E-005 9.920836901865599E-005 1.004562568099008E-004 1.017198411021896E-004 + 1.029993193333889E-004 1.042948914248346E-004 1.056067598125712E-004 1.069351294789829E-004 + 1.082802079848229E-004 1.096422055016457E-004 1.110213348446471E-004 1.124178115059178E-004 + 1.138318536881143E-004 1.152636823385547E-004 1.167135211837420E-004 1.181815967643229E-004 + 1.196681384704856E-004 1.211733785778028E-004 1.226975522835260E-004 1.242408977433361E-004 + 1.258036561085564E-004 1.273860715638335E-004 1.289883913652924E-004 1.306108658791716E-004 + 1.322537486209434E-004 1.339172962949278E-004 1.356017688344036E-004 1.373074294422240E-004 + 1.390345446319436E-004 1.407833842694624E-004 1.425542216151942E-004 1.443473333667647E-004 + 1.461629997022471E-004 1.480015043239414E-004 1.498631345027049E-004 1.517481811228393E-004 + 1.536569387275436E-004 1.555897055649380E-004 1.575467836346673E-004 1.595284787350897E-004 + 1.615351005110599E-004 1.635669625023135E-004 1.656243821924594E-004 1.677076810585881E-004 + 1.698171846215059E-004 1.719532224965984E-004 1.741161284453365E-004 1.763062404274281E-004 + 1.785239006536269E-004 1.807694556392054E-004 1.830432562581012E-004 1.853456577977428E-004 + 1.876770200145663E-004 1.900377071902303E-004 1.924280881885378E-004 1.948485365130743E-004 + 1.972994303655709E-004 1.997811527050015E-004 2.022940913074233E-004 2.048386388265705E-004 + 2.074151928552100E-004 2.100241559872691E-004 2.126659358807437E-004 2.153409453214002E-004 + 2.180496022872759E-004 2.207923300139936E-004 2.235695570608952E-004 2.263817173780098E-004 + 2.292292503738621E-004 2.321126009841350E-004 2.350322197411957E-004 2.379885628444967E-004 + 2.409820922318623E-004 2.440132756516711E-004 2.470825867359486E-004 2.501905050743764E-004 + 2.533375162892348E-004 2.565241121112885E-004 2.597507904566244E-004 2.630180555044589E-004 + 2.663264177759216E-004 2.696763942138320E-004 2.730685082634798E-004 2.765032899544190E-004 + 2.799812759832955E-004 2.835030097977109E-004 2.870690416811478E-004 2.906799288389586E-004 + 2.943362354854372E-004 2.980385329319892E-004 3.017873996764060E-004 3.055834214932679E-004 + 3.094271915254804E-004 3.133193103769627E-004 3.172603862065057E-004 3.212510348228054E-004 + 3.252918797806959E-004 3.293835524785938E-004 3.335266922571643E-004 3.377219464992341E-004 + 3.419699707309561E-004 3.462714287242521E-004 3.506269926005405E-004 3.550373429357691E-004 + 3.595031688667740E-004 3.640251681989710E-004 3.686040475154050E-004 3.732405222871733E-004 + 3.779353169852325E-004 3.826891651936203E-004 3.875028097240933E-004 3.923770027322138E-004 + 3.973125058348953E-004 4.023100902294255E-004 4.073705368139898E-004 4.124946363097088E-004 + 4.176831893842130E-004 4.229370067767737E-004 4.282569094250037E-004 4.336437285931586E-004 + 4.390983060020489E-004 4.446214939605869E-004 4.502141554989913E-004 4.558771645036664E-004 + 4.616114058537789E-004 4.674177755595530E-004 4.732971809023076E-004 4.792505405762555E-004 + 4.852787848320847E-004 4.913828556223505E-004 4.975637067486953E-004 5.038223040109204E-004 + 5.101596253579372E-004 5.165766610406156E-004 5.230744137665565E-004 5.296538988568126E-004 + 5.363161444045840E-004 5.430621914359089E-004 5.498930940723744E-004 5.568099196958840E-004 + 5.638137491154884E-004 5.709056767363251E-004 5.780868107306817E-004 5.853582732112090E-004 + 5.927212004063209E-004 6.001767428377987E-004 6.077260655006298E-004 6.153703480451159E-004 + 6.231107849612674E-004 6.309485857655278E-004 6.388849751898372E-004 6.469211933730878E-004 + 6.550584960549836E-004 6.632981547723421E-004 6.716414570578700E-004 6.800897066414392E-004 + 6.886442236538978E-004 6.973063448334491E-004 7.060774237346283E-004 7.149588309399134E-004 + 7.239519542739948E-004 7.330581990207509E-004 7.422789881429521E-004 7.516157625047328E-004 + 7.610699810968685E-004 7.706431212648849E-004 7.803366789400438E-004 7.901521688732392E-004 + 8.000911248718360E-004 8.101551000395018E-004 8.203456670190444E-004 8.306644182383246E-004 + 8.411129661592610E-004 8.516929435299652E-004 8.624060036400687E-004 8.732538205792533E-004 + 8.842380894990484E-004 8.953605268779219E-004 9.066228707897151E-004 9.180268811754618E-004 + 9.295743401186271E-004 9.412670521238233E-004 9.531068443990356E-004 9.650955671414020E-004 + 9.772350938266052E-004 9.895273215019009E-004 1.001974171082852E-003 1.014577587653796E-003 + 1.027339540772102E-003 1.040262024776275E-003 1.053347059097929E-003 1.066596688577704E-003 + 1.080012983785173E-003 1.093598041342770E-003 1.107353984253818E-003 1.121282962234684E-003 + 1.135387152051136E-003 1.149668757858933E-003 1.164130011548717E-003 1.178773173095260E-003 + 1.193600530911118E-003 1.208614402204741E-003 1.223817133343118E-003 1.239211100218982E-003 + 1.254798708622666E-003 1.270582394618645E-003 1.286564624926831E-003 1.302747897308703E-003 + 1.319134740958280E-003 1.335727716898063E-003 1.352529418379960E-003 1.369542471291288E-003 + 1.386769534565895E-003 1.404213300600480E-003 1.421876495676180E-003 1.439761880385481E-003 + 1.457872250064521E-003 1.476210435230868E-003 1.494779302026830E-003 1.513581752668364E-003 + 1.532620725899670E-003 1.551899197453534E-003 1.571420180517496E-003 1.591186726205911E-003 + 1.611201924037992E-003 1.631468902421888E-003 1.651990829144915E-003 1.672770911869969E-003 + 1.693812398638235E-003 1.715118578378271E-003 1.736692781421519E-003 1.758538380024371E-003 + 1.780658788896836E-003 1.803057465737914E-003 1.825737911777746E-003 1.848703672326651E-003 + 1.871958337331119E-003 1.895505541936850E-003 1.919348967058957E-003 1.943492339959377E-003 + 1.967939434831628E-003 1.992694073392988E-003 2.017760125484184E-003 2.043141509676711E-003 + 2.068842193887852E-003 2.094866196003525E-003 2.121217584509043E-003 2.147900479127892E-003 + 2.174919051468629E-003 2.202277525680014E-003 2.229980179114476E-003 2.258031343000027E-003 + 2.286435403120719E-003 2.315196800505787E-003 2.344320032127552E-003 2.373809651608225E-003 + 2.403670269935716E-003 2.433906556188586E-003 2.464523238270236E-003 2.495525103652454E-003 + 2.526917000128473E-003 2.558703836575636E-003 2.590890583727803E-003 2.623482274957632E-003 + 2.656484007068857E-003 2.689900941098708E-003 2.723738303130584E-003 2.758001385117140E-003 + 2.792695545713918E-003 2.827826211123641E-003 2.863398875951339E-003 2.899419104070451E-003 + 2.935892529500027E-003 2.972824857293185E-003 3.010221864436992E-003 3.048089400763902E-003 + 3.086433389874898E-003 3.125259830074536E-003 3.164574795318007E-003 3.204384436170389E-003 + 3.244694980778261E-003 3.285512735853858E-003 3.326844087671907E-003 3.368695503079339E-003 + 3.411073530518034E-003 3.453984801060803E-003 3.497436029460739E-003 3.541434015214178E-003 + 3.585985643637418E-003 3.631097886957390E-003 3.676777805416480E-003 3.723032548391675E-003 + 3.769869355528286E-003 3.817295557888366E-003 3.865318579114102E-003 3.913945936606334E-003 + 3.963185242718452E-003 4.013044205965857E-003 4.063530632251211E-003 4.114652426105722E-003 + 4.166417591946614E-003 4.218834235351114E-003 4.271910564347095E-003 4.325654890720672E-003 + 4.380075631340977E-003 4.435181309502314E-003 4.490980556284010E-003 4.547482111928156E-003 + 4.604694827235534E-003 4.662627664979973E-003 4.721289701341391E-003 4.780690127357821E-003 + 4.840838250396649E-003 4.901743495645386E-003 4.963415407622274E-003 5.025863651706935E-003 + 5.089098015691436E-003 5.153128411352047E-003 5.217964876041963E-003 5.283617574305369E-003 + 5.350096799513082E-003 5.417412975520185E-003 5.485576658345880E-003 5.554598537875995E-003 + 5.624489439588405E-003 5.695260326301745E-003 5.766922299947808E-003 5.839486603367893E-003 + 5.912964622133584E-003 5.987367886392237E-003 6.062708072737632E-003 6.138997006106120E-003 + 6.216246661698718E-003 6.294469166929479E-003 6.373676803400667E-003 6.453882008905017E-003 + 6.535097379455655E-003 6.617335671343984E-003 6.700609803226076E-003 6.784932858238033E-003 + 6.870318086140651E-003 6.956778905494068E-003 7.044328905862706E-003 7.132981850051073E-003 + 7.222751676371004E-003 7.313652500940703E-003 7.405698620016245E-003 7.498904512356032E-003 + 7.593284841618757E-003 7.688854458795456E-003 7.785628404676172E-003 7.883621912351946E-003 + 7.982850409752607E-003 8.083329522221032E-003 8.185075075124532E-003 8.288103096503964E-003 + 8.392429819761280E-003 8.498071686386176E-003 8.605045348722501E-003 8.713367672775189E-003 + 8.823055741058381E-003 8.934126855485542E-003 9.046598540302328E-003 9.160488545062928E-003 + 9.275814847650773E-003 9.392595657344309E-003 9.510849417928817E-003 9.630594810855046E-003 + 9.751850758445561E-003 9.874636427149737E-003 9.998971230848308E-003 1.012487483420845E-002 + 1.025236715609033E-002 1.038146837300613E-002 1.051219892263269E-002 1.064457950737857E-002 + 1.077863109800700E-002 1.091437493731539E-002 1.105183254387296E-002 1.119102571581731E-002 + 1.133197653471138E-002 1.147470736946197E-002 1.161924088030108E-002 1.176560002283128E-002 + 1.191380805213673E-002 1.206388852696084E-002 1.221586531395248E-002 1.236976259198170E-002 + 1.252560485652677E-002 1.268341692413410E-002 1.284322393695239E-002 1.300505136734297E-002 + 1.316892502256773E-002 1.333487104955648E-002 1.350291593975566E-002 1.367308653406000E-002 + 1.384541002782916E-002 1.401991397599131E-002 1.419662629823559E-002 1.437557528429559E-002 + 1.455678959932591E-002 1.474029828937399E-002 1.492613078694955E-002 1.511431691669394E-002 + 1.530488690115185E-002 1.549787136664758E-002 1.569330134926889E-002 1.589120830096071E-002 + 1.609162409573153E-002 1.629458103597533E-002 1.650011185891184E-002 1.670824974314821E-002 + 1.691902831536508E-002 1.713248165713030E-002 1.734864431184364E-002 1.756755129181559E-002 + 1.778923808548408E-002 1.801374066477267E-002 1.824109549259368E-002 1.847133953050051E-002 + 1.870451024649265E-002 1.894064562297800E-002 1.917978416489639E-002 1.942196490800874E-002 + 1.966722742735658E-002 1.991561184589636E-002 2.016715884331360E-002 2.042190966502176E-002 + 2.067990613135103E-002 2.094119064693245E-002 2.120580621028287E-002 2.147379642359644E-002 + 2.174520550274847E-002 2.202007828751805E-002 2.229846025203547E-002 2.258039751546118E-002 + 2.286593685290298E-002 2.315512570657847E-002 2.344801219723010E-002 2.374464513580023E-002 + 2.404507403537412E-002 2.434934912339867E-002 2.465752135418545E-002 2.496964242170665E-002 + 2.528576477269281E-002 2.560594162004158E-002 2.593022695654713E-002 2.625867556896023E-002 + 2.659134305238913E-002 2.692828582505205E-002 2.726956114339205E-002 2.761522711756618E-002 + 2.796534272732030E-002 2.831996783826213E-002 2.867916321854519E-002 2.904299055597674E-002 + 2.941151247556360E-002 2.978479255750973E-002 3.016289535568058E-002 3.054588641654931E-002 + 3.093383229864041E-002 3.132680059248768E-002 3.172485994112310E-002 3.212808006111434E-002 + 3.253653176416918E-002 3.295028697932578E-002 3.336941877574844E-002 3.379400138614945E-002 + 3.422411023085764E-002 3.465982194255644E-002 3.510121439171323E-002 3.554836671272441E-002 + 3.600135933080023E-002 3.646027398961512E-002 3.692519377974980E-002 3.739620316795252E-002 + 3.787338802724786E-002 3.835683566792297E-002 3.884663486942134E-002 3.934287591317659E-002 + 3.984565061641858E-002 4.035505236698692E-002 4.087117615918689E-002 4.139411863072514E-002 + 4.192397810076338E-002 4.246085460913013E-002 4.300484995673192E-002 4.355606774720685E-002 + 4.411461342986551E-002 4.468059434396542E-002 4.525411976436725E-002 4.583530094862342E-002 + 4.642425118555043E-002 4.702108584533973E-002 4.762592243126291E-002 4.823888063302965E-002 + 4.886008238185948E-002 4.948965190733012E-002 5.012771579606827E-002 5.077440305235072E-002 + 5.142984516068673E-002 5.209417615045547E-002 5.276753266267479E-002 5.345005401898112E-002 + 5.414188229290313E-002 5.484316238351509E-002 5.555404209155949E-002 5.627467219813144E-002 + 5.700520654602207E-002 5.774580212382119E-002 5.849661915288321E-002 5.925782117726581E-002 + 6.002957515675349E-002 6.081205156308428E-002 6.160542447950090E-002 6.240987170375379E-002 + 6.322557485468834E-002 6.405271948255341E-002 6.489149518317378E-002 6.574209571613567E-002 + 6.660471912713917E-002 6.747956787467875E-002 6.836684896121868E-002 6.926677406903689E-002 + 7.017955970091877E-002 7.110542732588769E-002 7.204460353016842E-002 7.299732017358666E-002 + 7.396381455161512E-002 7.494432956328698E-002 7.593911388520425E-002 7.694842215187828E-002 + 7.797251514265074E-002 7.901165997544940E-002 8.006613030764805E-002 8.113620654430505E-002 + 8.222217605407095E-002 8.332433339306280E-002 8.444298053701779E-002 8.557842712204741E-002 + 8.673099069432975E-002 8.790099696908700E-002 8.908878009921112E-002 9.029468295391253E-002 + 9.151905740778295E-002 9.276226464067579E-002 9.402467544882538E-002 9.530667056764004E-002 + 9.660864100661964E-002 9.793098839686776E-002 9.927412535168177E-002 1.006384758407249E-001 + 1.020244755782990E-001 1.034325724262577E-001 1.048632268121178E-001 1.063169121629432E-001 + 1.077941153555982E-001 1.092953371839859E-001 1.108210928439038E-001 1.123719124361755E-001 + 1.139483414887300E-001 1.155509414983271E-001 1.171802904926409E-001 1.188369836134404E-001 + 1.205216337216212E-001 1.222348720248617E-001 1.239773487287020E-001 1.257497337118523E-001 + 1.275527172265655E-001 1.293870106249177E-001 1.312533471118586E-001 1.331524825259081E-001 + 1.350851961483850E-001 1.370522915420646E-001 1.390545974201710E-001 1.410929685466124E-001 + 1.431682866683656E-001 1.452814614809221E-001 1.474334316276889E-001 1.496251657342372E-001 + 1.518576634782612E-001 1.541319566960984E-001 1.564491105266169E-001 1.588102245932458E-001 + 1.612164342248706E-001 1.636689117162529E-001 1.661688676285684E-001 1.687175521305641E-001 + 1.713162563807409E-001 1.739663139508535E-001 1.766691022908731E-001 1.794260442354202E-001 + 1.822386095514833E-001 1.851083165270388E-001 1.880367335999656E-001 1.910254810263713E-001 + 1.940762325871657E-001 1.971907173313712E-001 2.003707213542934E-001 2.036180896082514E-001 + 2.069347277430913E-001 2.103226039731896E-001 2.137837509670555E-001 2.173202677549937E-001 + 2.209343216495611E-001 2.246281501727394E-001 2.284040629828590E-001 2.322644437933164E-001 + 2.362117522740335E-001 2.402485259254101E-001 2.443773819131837E-001 2.486010188511636E-001 + 2.529222185171962E-001 2.573438474859663E-001 2.618688586603233E-001 2.665002926807098E-001 + 2.712412791899948E-001 2.760950379285097E-001 2.810648796313769E-001 2.861542066972859E-001 + 2.913665135946757E-001 2.967053869678588E-001 3.021745054018928E-001 3.077776388010388E-001 + 3.135186473313503E-001 3.194014798733729E-001 3.254301719260501E-001 3.316088428977522E-001 + 3.379416927148541E-001 3.444329976725061E-001 3.510871054461621E-001 3.579084291761078E-001 + 3.649014405306315E-001 3.720706616467189E-001 3.794206558402097E-001 3.869560169703218E-001 + 3.946813573364265E-001 4.026012939779812E-001 4.107204332417727E-001 4.190433534742154E-001 + 4.275745856905010E-001 4.363185920672075E-001 4.452797421006499E-001 4.544622862701623E-001 + 4.638703270438764E-001 4.735077870647562E-001 4.833783743570868E-001 4.934855443986670E-001 + 5.038324589121606E-001 5.144219412409149E-001 5.252564281906146E-001 5.363379182390805E-001 + 5.476679160429356E-001 5.592473732024855E-001 5.710766252857016E-001 5.831553251593200E-001 + 5.954823727305973E-001 6.080558412677388E-001 6.208729005411652E-001 6.339297371120794E-001 + 6.472214721895655E-001 6.607420775830255E-001 6.744842903929305E-001 6.884395272093994E-001 + 7.025977987242400E-001 7.169476258066074E-001 7.314759582437391E-001 7.461680975038831E-001 + 7.610076250356977E-001 7.759763377732493E-001 7.910541926637109E-001 8.062192621706391E-001 + 8.214477028228853E-001 8.367137389706949E-001 8.519896639683878E-001 8.672458610184260E-001 + 8.824508458756319E-001 8.975713335129963E-001 9.125723306826705E-001 9.274172560579630E-001 + 9.420680893062764E-001 9.564855500120574E-001 9.706293068379797E-001 9.844582166798372E-001 + 9.979305928370643E-001 1.011004500392217E+000 1.023638076079342E+000 1.035789868939150E+000 + 1.047419197030527E+000 1.058486514421847E+000 1.068953781657804E+000 1.078784831930711E+000 + 1.087945724329078E+000 1.096405074847486E+000 1.104134355382864E+000 1.111108150782237E+000 + 1.117304364220401E+000 1.122704361853143E+000 1.127293048899173E+000 1.131058871145640E+000 + 1.133993738451114E+000 1.136092870250939E+000 1.137354567483237E+000 1.137779920899827E+000 + 1.137372472579308E+000 1.136137855823249E+000 1.134083448726713E+000 1.131218089028614E+000 + 1.127551907423270E+000 1.123096275258521E+000 1.117863775300199E+000 1.111868170909520E+000 + 1.105124372237408E+000 1.097648399629170E+000 1.089457344430178E+000 1.080569327379441E+000 + 1.071003454773387E+000 1.060779772577310E+000 1.049919218656852E+000 1.038443573296780E+000 + 1.026375408169082E+000 1.013738033907219E+000 1.000555446437975E+000 9.868522722169372E-001 + 9.726537125079638E-001 9.579854868412035E-001 9.428737757782318E-001 9.273451631066473E-001 + 9.114265775802006E-001 8.951452343141411E-001 8.785285759391975E-001 8.616042136116356E-001 + 8.443998679712448E-001 8.269433101344728E-001 8.092623028066100E-001 7.913845415924180E-001 + 7.733375965872786E-001 7.551488543346035E-001 7.368454602353945E-001 7.184542615012670E-001 + 7.000017507616038E-001 6.815140104524251E-001 6.630166581206557E-001 6.445347928045041E-001 + 6.260929426795477E-001 6.077150141812961E-001 5.894242428420404E-001 5.712431461049957E-001 + 5.531934784011474E-001 5.352961887919081E-001 5.175713814920623E-001 5.000382795907281E-001 + 4.827151922818657E-001 4.656194858993049E-001 4.487675590238236E-001 4.321748218917089E-001 + 4.158556802861685E-001 3.998235240362504E-001 3.840907201844128E-001 3.686686108156938E-001 + 3.535675154711240E-001 3.387967379981137E-001 3.243645776236737E-001 3.102783439749737E-001 + 2.965443757181049E-001 2.831680624419676E-001 2.701538693814284E-001 2.575053645534048E-001 + 2.452252478719243E-001 2.333153818135218E-001 2.217768232221765E-001 2.106098558723177E-001 + 1.998140234477911E-001 1.893881626421260E-001 1.793304361386682E-001 1.696383652855472E-001 + 1.603088623373591E-001 1.513382621901360E-001 1.427223535861950E-001 1.344564098086119E-001 + 1.265352189197106E-001 1.189531136229617E-001 1.117040008425594E-001 1.047813911198507E-001 + 9.817842792138363E-002 9.188791694085419E-002 8.590235545817088E-002 8.021396179498538E-002 + 7.481470487921746E-002 6.969633390308712E-002 6.485040803162211E-002 6.026832609291344E-002 + 5.594135615866108E-002 5.186066490460264E-002 4.801734662574229E-002 4.440245177113330E-002 + 4.100701485729594E-002 3.782208161796510E-002 3.483873525040291E-002 3.204812162451574E-002 + 2.944147332996701E-002 2.701013244782631E-002 2.474557194649663E-002 2.263941561620319E-002 + 2.068345647172079E-002 1.886967356884173E-002 1.719024719596179E-002 1.563757241777112E-002 + 1.420427096311594E-002 1.288320146342933E-002 1.166746806155067E-002 1.055042742313738E-002 + 9.525694194129930E-003 8.587144957806467E-003 7.728920753825060E-003 6.945428229293332E-003 + 6.231339498337421E-003 5.581590791891885E-003 4.991379983538816E-003 4.456163080236202E-003 + 3.971649768751168E-003 3.533798109615193E-003 3.138808470514341E-003 2.783116790289441E-003 + 2.463387263222443E-003 2.176504531101053E-003 1.919565467759837E-003 1.689870637467344E-003 + 1.484915504740406E-003 1.302381468990903E-003 1.140126792918567E-003 9.961774888239687E-004 + 8.687182220941297E-004 7.560832860718610E-004 6.567476974169896E-004 5.693184559580960E-004 + 4.925260079673266E-004 4.252159468143393E-004 3.663409801098614E-004 3.149531877713059E-004 + 2.701965909645015E-004 2.313000476240357E-004 1.975704862526391E-004 1.683864859655072E-004 + 1.431922072920545E-004 1.214916750847441E-004 1.028434120176943E-004 8.685541858832078E-005 + 7.318049326149261E-005 6.151188441246691E-005 5.157926402436331E-005 4.314501166768967E-005 + 3.600079612086747E-005 2.996444106739203E-005 2.487706061129143E-005 2.060044987086265E-005 + 1.701471562316153E-005 1.401614131672755E-005 1.151532677031165E-005 9.435260714428836E-006 + 7.709863546780700E-006 6.282604913149372E-006 5.105261757484203E-006 4.136816253777973E-006 + 3.342481050620196E-006 2.692839944773491E-006 2.163092810257386E-006 1.732394333169708E-006 + 1.383276829898899E-006 1.101148148719979E-006 8.738563644221854E-007 6.913136661218984E-007 + 5.451725043978946E-007 4.285477010123506E-007 3.357788293871192E-007 2.622277442241839E-007 + 2.041066725413962E-007 1.583327750223259E-007 1.224055456771717E-007 9.430383966904383E-008 + 7.239970453681132E-008 5.538654009833634E-008 4.221942851941849E-008 3.206576010329060E-008 + 2.426453419268413E-008 1.829294020254460E-008 1.373902330688850E-008 1.027941480232691E-008 + 7.661260762713281E-009 5.687616336193724E-009 4.205688896200919E-009 3.097413126306717E-009 + 2.271926770909914E-009 1.659588875432048E-009 1.207244400941210E-009 8.744915299619239E-010 + 6.307520549801664E-010 4.529821050538525E-010 3.238911437424263E-010 2.305625726534095E-010 + 1.633902004816790E-010 1.152619884716914E-010 8.093646886672083E-011 5.656857884101943E-011 + 3.935080939745915E-011 2.724292072406716E-011 1.876934751153399E-011 1.286808303004662E-011 + 8.778517720021123E-012 5.958606305526235E-012 4.024003479984814E-012 2.703570370360052E-012 + 1.807016842167760E-012 1.201492968097707E-012 7.947448304965751E-013 5.230598125877196E-013 + 3.426880404867156E-013 2.237739823377289E-013 1.460924042942280E-013 9.483846805429423E-014 + 6.121380248919002E-014 3.928174903501038E-014 2.505977739431953E-014 1.589192246719863E-014 + 1.001742274253589E-014 6.276000806088283E-015 3.907725775108244E-015 2.417940018838314E-015 + 1.486665120009554E-015 9.082227287183137E-016 5.512493992953708E-016 3.323877152786612E-016 + 1.990888543805484E-016 1.184452646476372E-016 6.998748627073830E-017 4.106934035872895E-017 + 2.393161079662242E-017 1.384665155259462E-017 7.954218178951333E-018 4.536186755638886E-018 + 2.567942756611439E-018 1.442914274420416E-018 8.046662539811467E-019 4.453176301908563E-019 + 2.445462959022487E-019 1.332438333209888E-019 7.202531668521004E-020 3.862174774475969E-020 + 2.054203535559261E-020 1.083615944617791E-020 5.668689492124577E-021 2.940490324308670E-021 + 1.512308897738554E-021 7.710778163752447E-022 3.897135921998000E-022 1.952246437300173E-022 + 9.692079371653407E-023 4.768078619764643E-023 2.324150478364441E-023 1.122352064533745E-023 + 5.368921014151167E-024 2.543819687228981E-024 1.193643819302157E-024 5.546248972256990E-025 + 2.551564427003981E-025 1.162095991541221E-025 5.239028831501885E-026 2.337637884372209E-026 + 1.032202699265205E-026 4.509796878297719E-027 1.949375148292034E-027 8.335310996704759E-028 + 3.525144162093263E-028 1.474350199028789E-028 6.097227086231348E-029 2.492932509569204E-029 + 1.007564407698353E-029 4.024910134442564E-030 1.588900741491320E-030 6.197690540915147E-031 + 2.388306525464899E-031 9.090986116751324E-032 3.417633868134587E-032 1.268719750555362E-032 + 4.650103844226560E-033 1.682467486225844E-033 6.008239040580709E-034 2.117350460320250E-034 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 +/ +&rhoatom + rho_at(1:1177) = + 1.924828096786578E-009 1.973555357624711E-009 2.023516155229837E-009 2.074741716748551E-009 + 2.127264059847182E-009 2.181116012723921E-009 2.236331234627599E-009 2.292944236895847E-009 + 2.350990404525897E-009 2.410506018291409E-009 2.471528277419223E-009 2.534095322840147E-009 + 2.598246261028380E-009 2.664021188444402E-009 2.731461216596668E-009 2.800608497737724E-009 + 2.871506251210836E-009 2.944198790463605E-009 3.018731550745399E-009 3.095151117506012E-009 + 3.173505255513174E-009 3.253842938707218E-009 3.336214380811547E-009 3.420671066717954E-009 + 3.507265784666526E-009 3.596052659240155E-009 3.687087185194331E-009 3.780426262143340E-009 + 3.876128230124562E-009 3.974252906063073E-009 4.074861621159373E-009 4.178017259223619E-009 + 4.283784295980228E-009 4.392228839367568E-009 4.503418670857797E-009 4.617423287822759E-009 + 4.734313946972354E-009 4.854163708892614E-009 4.977047483711198E-009 5.103042077919047E-009 + 5.232226242377202E-009 5.364680721539033E-009 5.500488303918495E-009 5.639733873836039E-009 + 5.782504464474480E-009 5.928889312277989E-009 6.078979912728211E-009 6.232870077532383E-009 + 6.390655993259219E-009 6.552436281459162E-009 6.718312060306545E-009 6.888387007802396E-009 + 7.062767426577094E-009 7.241562310333646E-009 7.424883411972967E-009 7.612845313443735E-009 + 7.805565497360595E-009 8.003164420435388E-009 8.205765588767313E-009 8.413495635039155E-009 + 8.626484397667665E-009 8.844865001957732E-009 9.068773943311068E-009 9.298351172541325E-009 + 9.533740183348953E-009 9.775088102010595E-009 1.002254577933903E-008 1.027626788497108E-008 + 1.053641300404250E-008 1.080314373631030E-008 1.107662679778427E-008 1.135703312493154E-008 + 1.164453798151903E-008 1.193932106816077E-008 1.224156663463838E-008 1.255146359506500E-008 + 1.286920564596494E-008 1.319499138734229E-008 1.352902444681450E-008 1.387151360688879E-008 + 1.422267293546026E-008 1.458272191961393E-008 1.495188560281400E-008 1.533039472556612E-008 + 1.571848586964070E-008 1.611640160594732E-008 1.652439064615275E-008 1.694270799813729E-008 + 1.737161512538665E-008 1.781138011041886E-008 1.826227782234865E-008 1.872459008869371E-008 + 1.919860587153067E-008 1.968462144811026E-008 2.018294059604526E-008 2.069387478318642E-008 + 2.121774336230555E-008 2.175487377070697E-008 2.230560173489242E-008 2.287027148040763E-008 + 2.344923594700070E-008 2.404285700922807E-008 2.465150570264520E-008 2.527556245572353E-008 + 2.591541732763866E-008 2.657147025207855E-008 2.724413128722402E-008 2.793382087205778E-008 + 2.864097008916248E-008 2.936602093417152E-008 3.010942659204165E-008 3.087165172031989E-008 + 3.165317273958143E-008 3.245447813122081E-008 3.327606874278202E-008 3.411845810101836E-008 + 3.498217273287800E-008 3.586775249461621E-008 3.677575090923912E-008 3.770673551249076E-008 + 3.866128820759920E-008 3.964000562900393E-008 4.064349951529180E-008 4.167239709157418E-008 + 4.272734146154518E-008 4.380899200946528E-008 4.491802481232230E-008 4.605513306242685E-008 + 4.722102750070706E-008 4.841643686097274E-008 4.964210832542753E-008 5.089880799171303E-008 + 5.218732135177739E-008 5.350845378286798E-008 5.486303105095463E-008 5.625189982689759E-008 + 5.767592821568510E-008 5.913600629906864E-008 6.063304669193755E-008 6.216798511277937E-008 + 6.374178096858277E-008 6.535541795454985E-008 6.700990466899161E-008 6.870627524379114E-008 + 7.044558999082939E-008 7.222893606477720E-008 7.405742814266830E-008 7.593220912067783E-008 + 7.785445082854273E-008 7.982535476206977E-008 8.184615283418981E-008 8.391810814502825E-008 + 8.604251577147282E-008 8.822070357673184E-008 9.045403304039014E-008 9.274390010948198E-008 + 9.509173607111105E-008 9.749900844716662E-008 9.996722191169170E-008 1.024979192314800E-007 + 1.050926822304878E-007 1.077531327786644E-007 1.104809338058207E-007 1.132777903411685E-007 + 1.161454505791813E-007 1.190857069724424E-007 1.221003973521664E-007 1.251914060770898E-007 + 1.283606652114554E-007 1.316101557328244E-007 1.349419087704687E-007 1.383580068751238E-007 + 1.418605853208917E-007 1.454518334401109E-007 1.491339959920282E-007 1.529093745661256E-007 + 1.567803290209857E-007 1.607492789595877E-007 1.648187052419668E-007 1.689911515361745E-007 + 1.732692259085130E-007 1.776556024540430E-007 1.821530229683757E-007 1.867642986618059E-007 + 1.914923119168488E-007 1.963400180902848E-007 2.013104473608433E-007 2.064067066236708E-007 + 2.116319814327806E-007 2.169895379926956E-007 2.224827252005220E-007 2.281149767397488E-007 + 2.338898132270645E-007 2.398108444135501E-007 2.458817714416173E-007 2.521063891591018E-007 + 2.584885884919745E-007 2.650323588771368E-007 2.717417907568350E-007 2.786210781362550E-007 + 2.856745212058874E-007 2.929065290303222E-007 3.003216223051349E-007 3.079244361836096E-007 + 3.157197231750579E-007 3.237123561165490E-007 3.319073312199147E-007 3.403097711959340E-007 + 3.489249284576564E-007 3.577581884048697E-007 3.668150727917610E-007 3.761012431798950E-007 + 3.856225044786585E-007 3.953848085753938E-007 4.053942580574961E-007 4.156571100288039E-007 + 4.261797800226729E-007 4.369688460141840E-007 4.480310525340035E-007 4.593733148864693E-007 + 4.710027234745406E-007 4.829265482343343E-007 4.951522431820145E-007 5.076874510758870E-007 + 5.205400081966296E-007 5.337179492486399E-007 5.472295123855825E-007 5.610831443632812E-007 + 5.752875058231937E-007 5.898514767097711E-007 6.047841618250958E-007 6.200948965243079E-007 + 6.357932525553473E-007 6.518890440467170E-007 6.683923336469977E-007 6.853134388199618E-007 + 7.026629382992586E-007 7.204516787066967E-007 7.386907813382832E-007 7.573916491222878E-007 + 7.765659737536781E-007 7.962257430094323E-007 8.163832482492757E-007 8.370510921066026E-007 + 8.582421963743735E-007 8.799698100909495E-007 9.022475178309505E-007 9.250892482063273E-007 + 9.485092825829974E-007 9.725222640185198E-007 9.971432064264182E-007 1.022387503972921E-006 + 1.048270940711994E-006 1.074809700464769E-006 1.102020376949533E-006 1.129919984168666E-006 + 1.158525967059071E-006 1.187856212412755E-006 1.217929060074468E-006 1.248763314423419E-006 + 1.280378256146307E-006 1.312793654309079E-006 1.346029778734964E-006 1.380107412696660E-006 + 1.415047865930592E-006 1.450872987981442E-006 1.487605181885414E-006 1.525267418200771E-006 + 1.563883249394554E-006 1.603476824594493E-006 1.644072904715453E-006 1.685696877969921E-006 + 1.728374775772321E-006 1.772133289047191E-006 1.816999784951523E-006 1.863002324021771E-006 + 1.910169677756421E-006 1.958531346645133E-006 2.008117578655937E-006 2.058959388192062E-006 + 2.111088575530458E-006 2.164537746754237E-006 2.219340334191665E-006 2.275530617374585E-006 + 2.333143744529621E-006 2.392215754615606E-006 2.452783599921358E-006 2.514885169237944E-006 + 2.578559311620240E-006 2.643845860752730E-006 2.710785659935064E-006 2.779420587703169E-006 + 2.849793584102175E-006 2.921948677627811E-006 2.995931012853381E-006 3.071786878759819E-006 + 3.149563737786891E-006 3.229310255623906E-006 3.311076331758920E-006 3.394913130805904E-006 + 3.480873114629670E-006 3.569010075289122E-006 3.659379168819755E-006 3.752036949876928E-006 + 3.847041407261963E-006 3.944452000353731E-006 4.044329696469005E-006 4.146737009175377E-006 + 4.251738037581177E-006 4.359398506627574E-006 4.469785808408544E-006 4.582969044545155E-006 + 4.699019069641280E-006 4.818008535848564E-006 4.940011938569251E-006 5.065105663326022E-006 + 5.193368033829081E-006 5.324879361271199E-006 5.459721994882516E-006 5.597980373777459E-006 + 5.739741080127186E-006 5.885092893691835E-006 6.034126847747533E-006 6.186936286444455E-006 + 6.343616923632686E-006 6.504266903194061E-006 6.668986860918780E-006 6.837879987966978E-006 + 7.011052095956234E-006 7.188611683717108E-006 7.370670005760185E-006 7.557341142498813E-006 + 7.748742072273251E-006 7.944992745223117E-006 8.146216159056029E-006 8.352538436761945E-006 + 8.564088906323770E-006 8.781000182476329E-006 9.003408250567046E-006 9.231452552573209E-006 + 9.465276075332146E-006 9.705025441042095E-006 9.950851000093268E-006 1.020290692629000E-005 + 1.046135131452659E-005 1.072634628098141E-005 1.099805806589492E-005 1.127665713899991E-005 + 1.156231830767333E-005 1.185522082788160E-005 1.215554851799278E-005 1.246348987553104E-005 + 1.277923819695146E-005 1.310299170051449E-005 1.343495365234237E-005 1.377533249574133E-005 + 1.412434198387655E-005 1.448220131588831E-005 1.484913527654105E-005 1.522537437949900E-005 + 1.561115501432515E-005 1.600671959730227E-005 1.641231672617843E-005 1.682820133894156E-005 + 1.725463487673087E-005 1.769188545099553E-005 1.814022801501507E-005 1.859994453989808E-005 + 1.907132419517954E-005 1.955466353414122E-005 2.005026668398146E-005 2.055844554096594E-005 + 2.107951997069371E-005 2.161381801361724E-005 2.216167609595868E-005 2.272343924616894E-005 + 2.329946131708038E-005 2.389010521390822E-005 2.449574312825994E-005 2.511675677831754E-005 + 2.575353765536105E-005 2.640648727680744E-005 2.707601744594401E-005 2.776255051854023E-005 + 2.846651967652840E-005 2.918836920894746E-005 2.992855480035189E-005 3.068754382689210E-005 + 3.146581566028001E-005 3.226386197985915E-005 3.308218709300538E-005 3.392130826409166E-005 + 3.478175605225580E-005 3.566407465821987E-005 3.656882228041479E-005 3.749657148067349E-005 + 3.844790955976296E-005 3.942343894303346E-005 4.042377757647331E-005 4.144955933346477E-005 + 4.250143443254719E-005 4.358006986650191E-005 4.468614984308396E-005 4.582037623773593E-005 + 4.698346905862870E-005 4.817616692438648E-005 4.939922755486414E-005 5.065342827535475E-005 + 5.193956653462071E-005 5.325846043715194E-005 5.461094929006781E-005 5.599789416509476E-005 + 5.742017847606269E-005 5.887870857238114E-005 6.037441434896712E-005 6.190824987311687E-005 + 6.348119402882512E-005 6.509425117907580E-005 6.674845184664435E-005 6.844485341396815E-005 + 7.018454084266403E-005 7.196862741328691E-005 7.379825548594735E-005 7.567459728242439E-005 + 7.759885569043322E-005 7.957226509072800E-005 8.159609220774714E-005 8.367163698452688E-005 + 8.580023348264177E-005 8.798325080794894E-005 9.022209406294692E-005 9.251820532658613E-005 + 9.487306466239268E-005 9.728819115580864E-005 9.976514398167201E-005 1.023055235028004E-004 + 1.049109724006768E-004 1.075831768392650E-004 1.103238676630287E-004 1.131348216302607E-004 + 1.160178626828718E-004 1.189748632538309E-004 1.220077456134894E-004 1.251184832560754E-004 + 1.283091023276808E-004 1.315816830971218E-004 1.349383614711027E-004 1.383813305551649E-004 + 1.419128422619623E-004 1.455352089684606E-004 1.492508052237176E-004 1.530620695089693E-004 + 1.569715060518079E-004 1.609816866963115E-004 1.650952528310539E-004 1.693149173769987E-004 + 1.736434668373622E-004 1.780837634116073E-004 1.826387471758206E-004 1.873114383318114E-004 + 1.921049395273632E-004 1.970224382501668E-004 2.020672092980664E-004 2.072426173283534E-004 + 2.125521194889520E-004 2.179992681344619E-004 2.235877136301349E-004 2.293212072469970E-004 + 2.352036041514522E-004 2.412388664928440E-004 2.474310665925947E-004 2.537843902386898E-004 + 2.603031400894350E-004 2.669917391905734E-004 2.738547346100261E-004 2.808968011946904E-004 + 2.881227454539258E-004 2.955375095745482E-004 3.031461755723603E-004 3.109539695854551E-004 + 3.189662663147558E-004 3.271885936174967E-004 3.356266372595768E-004 3.442862458329962E-004 + 3.531734358448333E-004 3.622943969845110E-004 3.716554975763972E-004 3.812632902250816E-004 + 3.911245176610001E-004 4.012461187944095E-004 4.116352349860760E-004 4.222992165433964E-004 + 4.332456294510666E-004 4.444822623458136E-004 4.560171337451309E-004 4.678584995404012E-004 + 4.800148607652521E-004 4.924949716504670E-004 5.053078479773158E-004 5.184627757416570E-004 + 5.319693201417565E-004 5.458373349033436E-004 5.600769719560261E-004 5.746986914758452E-004 + 5.897132723094166E-004 6.051318227958057E-004 6.209657920030377E-004 6.372269813968846E-004 + 6.539275569604295E-004 6.710800617837286E-004 6.886974291437725E-004 7.067929960959211E-004 + 7.253805175989150E-004 7.444741811966527E-004 7.640886222809351E-004 7.842389399605466E-004 + 8.049407135632276E-004 8.262100197982901E-004 8.480634506089848E-004 8.705181317450329E-004 + 8.935917420872118E-004 9.173025337573473E-004 9.416693530486545E-004 9.667116622130000E-004 + 9.924495621433901E-004 1.018903815991812E-003 1.046095873764423E-003 1.074047897938102E-003 + 1.102782790144440E-003 1.132324218969454E-003 1.162696648919579E-003 1.193925370606937E-003 + 1.226036532209351E-003 1.259057172263266E-003 1.293015253850478E-003 1.327939700242517E-003 + 1.363860432069561E-003 1.400808406083921E-003 1.438815655591595E-003 1.477915332628785E-003 + 1.518141751964067E-003 1.559530437010706E-003 1.602118167737684E-003 1.645943030672309E-003 + 1.691044471091680E-003 1.737463347504984E-003 1.785241988533543E-003 1.834424252300627E-003 + 1.885055588448501E-003 1.937183102905802E-003 1.990855625534287E-003 2.046123780790258E-003 + 2.103040061542420E-003 2.161658906194896E-003 2.222036779271190E-003 2.284232255622487E-003 + 2.348306108431564E-003 2.414321401191835E-003 2.482343583849788E-003 2.552440593308163E-003 + 2.624682958496659E-003 2.699143910227203E-003 2.775899496060976E-003 2.855028700425716E-003 + 2.936613570233089E-003 3.020739346258187E-003 3.107494600555753E-003 3.196971380201057E-003 + 3.289265357657271E-003 3.384475988085804E-003 3.482706673931231E-003 3.584064937128645E-003 + 3.688662599297827E-003 3.796615970306470E-003 3.908046045602871E-003 4.023078712738033E-003 + 4.141844967517167E-003 4.264481140241931E-003 4.391129132526848E-003 4.521936665196583E-003 + 4.657057537795245E-003 4.796651900264204E-003 4.940886537371732E-003 5.089935166505822E-003 + 5.243978749470586E-003 5.403205818957583E-003 5.567812820395269E-003 5.738004469913498E-003 + 5.913994129195173E-003 6.096004198023876E-003 6.284266525374865E-003 6.479022839937069E-003 + 6.680525200995912E-003 6.889036470650886E-003 7.104830808387874E-003 7.328194189074523E-003 + 7.559424945497336E-003 7.798834336611919E-003 8.046747142732989E-003 8.303502288948180E-003 + 8.569453498100265E-003 8.844969974744984E-003 9.130437121557486E-003 9.426257289729336E-003 + 9.732850564969298E-003 1.005065559079650E-002 1.038013043089228E-002 1.072175347235904E-002 + 1.107602437181945E-002 1.144346504637815E-002 1.182462071156092E-002 1.222006096844304E-002 + 1.263038094227914E-002 1.305620247505232E-002 1.349817537446949E-002 1.395697872204440E-002 + 1.443332224302847E-002 1.492794774107337E-002 1.544163060063848E-002 1.597518136029032E-002 + 1.652944736018039E-002 1.710531446713401E-002 1.770370888093242E-002 1.832559902552833E-002 + 1.897199752909819E-002 1.964396329700269E-002 2.034260368190491E-002 2.106907675547543E-002 + 2.182459368630558E-002 2.261042122884452E-002 2.342788432838032E-002 2.427836884729521E-002 + 2.516332441804422E-002 2.608426742853154E-002 2.704278414579301E-002 2.804053398413379E-002 + 2.907925292412102E-002 3.016075708908653E-002 3.128694648606255E-002 3.245980891834526E-002 + 3.368142407716346E-002 3.495396782022030E-002 3.627971664517301E-002 3.766105236642371E-002 + 3.910046700390658E-002 4.060056789288118E-002 4.216408302407083E-002 4.379386662382136E-002 + 4.549290498430305E-002 4.726432255412735E-002 4.911138830010943E-002 5.103752235127269E-002 + 5.304630293655802E-002 5.514147362807872E-002 5.732695090213600E-002 5.960683203059534E-002 + 6.198540331560547E-002 6.446714868102565E-002 6.705675863431551E-002 6.975913961301866E-002 + 7.257942373035620E-002 7.552297893481977E-002 7.859541959901917E-002 8.180261755340390E-002 + 8.515071358081930E-002 8.864612938819641E-002 9.229558007198978E-002 9.610608709427088E-002 + 1.000849917866600E-001 1.042399693995211E-001 1.085790437140559E-001 1.131106022351103E-001 + 1.178434119826307E-001 1.227866358998008E-001 1.279498498959067E-001 1.333430605419502E-001 + 1.389767234369271E-001 1.448617622624955E-001 1.510095885435023E-001 1.574321221314513E-001 + 1.641418124275277E-001 1.711516603611945E-001 1.784752411396232E-001 1.861267277823591E-001 + 1.941209154545394E-001 2.024732466107572E-001 2.111998369602188E-001 2.203175022621525E-001 + 2.298437859585225E-001 2.397969876488761E-001 2.501961924096580E-001 2.610613009574687E-001 + 2.724130606525119E-001 2.842730973348558E-001 2.966639479820164E-001 3.096090941717877E-001 + 3.231329963290912E-001 3.372611287298336E-001 3.520200152283500E-001 3.674372656677955E-001 + 3.835416129248559E-001 4.003629505312400E-001 4.179323708044811E-001 4.362822034096009E-001 + 4.554460542609243E-001 4.754588446598009E-001 4.963568505489453E-001 5.181777417474436E-001 + 5.409606210120491E-001 5.647460627499719E-001 5.895761511857931E-001 6.154945177602236E-001 + 6.425463775108318E-001 6.707785641545061E-001 7.002395635578308E-001 7.309795452445998E-001 + 7.630503915489855E-001 7.965057239780209E-001 8.314009262978587E-001 8.677931638040994E-001 + 9.057413981771985E-001 9.453063972589527E-001 9.865507390149431E-001 1.029538808870277E+000 + 1.074336789521270E+000 1.121012642233833E+000 1.169636078539463E+000 1.220278521131725E+000 + 1.273013052649753E+000 1.327914350909938E+000 1.385058609012993E+000 1.444523438610644E+000 + 1.506387754464574E+000 1.570731638270499E+000 1.637636179552902E+000 1.707183291262164E+000 + 1.779455497527176E+000 1.854535690834670E+000 1.932506855724619E+000 2.013451755911750E+000 + 2.097452581571277E+000 2.184590553367077E+000 2.274945479658786E+000 2.368595263208514E+000 + 2.465615353626132E+000 2.566078141755009E+000 2.670052292219319E+000 2.777602010442556E+000 + 2.888786240620720E+000 3.003657791408458E+000 3.122262386471839E+000 3.244637637597044E+000 + 3.370811938740718E+000 3.500803280289043E+000 3.634617983879301E+000 3.772249359453690E+000 + 3.913676287781124E+000 4.058861733516611E+000 4.207751195986397E+000 4.360271107297915E+000 + 4.516327190081499E+000 4.675802790167435E+000 4.838557202770031E+000 5.004424014258449E+000 + 5.173209485293118E+000 5.344691004931090E+000 5.518615649167344E+000 5.694698881171542E+000 + 5.872623434072649E+000 6.052038420379644E+000 6.232558714833202E+000 6.413764659462462E+000 + 6.595202140665742E+000 6.776383088023213E+000 6.956786443060965E+000 7.135859643106423E+000 + 7.313020660504220E+000 7.487660630631369E+000 7.659147093230540E+000 7.826827860492219E+000 + 7.990035512046748E+000 8.148092501630988E+000 8.300316842807096E+000 8.446028321949131E+000 + 8.584555166071841E+000 8.715241071330365E+000 8.837452475604078E+000 8.950585935987947E+000 + 9.054075449775638E+000 9.147399536175701E+000 9.230087876096249E+000 9.301727289372039E+000 + 9.361966813250383E+000 9.410521633168901E+000 9.447175607108328E+000 9.471782118196989E+000 + 9.484262986701477E+000 9.484605171765882E+000 9.472854994732511E+000 9.449109799526678E+000 + 9.413509234029927E+000 9.366232023840556E+000 9.307494705412942E+000 9.237550331830462E+000 + 9.156687001726613E+000 9.065226223228187E+000 8.963521125610381E+000 8.851954532041583E+000 + 8.730936907361560E+000 8.600904195285107E+000 8.462315559762876E+000 8.315651045460609E+000 + 8.161409172445017E+000 8.000104480190386E+000 7.832265035947301E+000 7.658429922349852E+000 + 7.479146718882118E+000 7.294968991485057E+000 7.106453804166978E+000 6.914159265988351E+000 + 6.718642126236371E+000 6.520455429987573E+000 6.320146245591683E+000 6.118253474901577E+000 + 5.915305756331610E+000 5.711819470060691E+000 5.508296853916888E+000 5.305224237657406E+000 + 5.103070402599875E+000 4.902285072796324E+000 4.703297543088516E+000 4.506515448586239E+000 + 4.312323679452144E+000 4.121083444141861E+000 3.933131483336672E+000 3.748779436122819E+000 + 3.568313359250326E+000 3.391993399440976E+000 3.220053617880767E+000 3.052701965138531E+000 + 2.890120403801799E+000 2.732465175110386E+000 2.579867204803431E+000 2.432432642286006E+000 + 2.290243526085393E+000 2.153358567430362E+000 2.021814042679622E+000 1.895624784284418E+000 + 1.774785259032304E+000 1.659270721521602E+000 1.549038430193564E+000 1.444028912829690E+000 + 1.344167268226764E+000 1.249364490803658E+000 1.159518805174173E+000 1.074516998232068E+000 + 9.942357370207028E-001 9.185428615760307E-001 8.472986430060530E-001 7.803569982657481E-001 + 7.175666543641025E-001 6.587722560579047E-001 6.038154124049805E-001 5.525356788289217E-001 + 5.047714725535263E-001 4.603609203686996E-001 4.191426386670396E-001 3.809564465256273E-001 + 3.456440132918931E-001 3.130494426644784E-001 2.830197956458146E-001 2.554055549945973E-001 + 2.300610339409994E-001 2.068447319660214E-001 1.856196404118320E-001 1.662535006055080E-001 + 1.486190170661049E-001 1.325940282439157E-001 1.180616371268363E-001 1.049103039536001E-001 + 9.303390320455152E-002 8.233174700068216E-002 7.270857703029772E-002 6.407452713633191E-002 + 5.634505873021127E-002 4.944087124323114E-002 4.328778987597293E-002 3.781663295290384E-002 + 3.296306122615431E-002 2.866741149387129E-002 2.487451690014486E-002 2.153351626236407E-002 + 1.859765472650161E-002 1.602407798106942E-002 1.377362216732735E-002 1.181060150871119E-002 + 1.010259554905065E-002 8.620237740176459E-003 7.337006958474213E-003 6.229023360461341E-003 + 5.274849813147058E-003 4.455299959214796E-003 3.753253803121763E-003 3.153481534878796E-003 + 2.642476146014689E-003 2.208295239094210E-003 1.840412289783223E-003 1.529577490068310E-003 + 1.267688183683547E-003 1.047668800557950E-003 8.633601063333917E-004 7.094175055890282E-004 + 5.812180729750608E-004 4.747759344326309E-004 3.866655803216977E-004 3.139526627340820E-004 + 2.541318095847459E-004 2.050709772452112E-004 1.649618604760847E-004 1.322758821971639E-004 + 1.057252951901019E-004 8.422894218525724E-005 6.688223901946445E-005 5.293096680755006E-005 + 4.174848256226919E-005 3.281598271727856E-005 2.570547992813738E-005 2.006517980020077E-005 + 1.560697035182976E-005 1.209576267509021E-005 9.340446084630689E-006 7.186244796280297E-006 + 5.508285658869842E-006 4.206207539618776E-006 3.199662547506633E-006 2.424577324875719E-006 + 1.830059135462381E-006 1.375846447336157E-006 1.030217196213786E-006 7.682799816371678E-007 + 5.705841731146864E-007 4.219943730985473E-007 3.107829925363915E-007 2.279019398336058E-007 + 1.664007031176535E-007 1.209635148673064E-007 8.754292015398305E-008 6.307101327734135E-008 + 4.523294530632377E-008 3.229015723197786E-008 2.294326727852911E-008 1.622500305085240E-008 + 1.141911281915015E-008 7.997814028920651E-009 5.574097672665867E-009 3.865581380118584E-009 + 2.667253769992346E-009 1.831028391550769E-009 1.250485464356297E-009 8.495448242769811E-010 + 5.741018229627817E-010 3.858842612951436E-010 2.579650607520829E-010 1.715023971528729E-010 + 1.133846888065112E-010 7.453883332444888E-011 4.872180811182958E-011 3.166249325272587E-011 + 2.045575994235830E-011 1.313718792748279E-011 8.386342251957678E-012 5.320994509732099E-012 + 3.355284650472650E-012 2.102558632573443E-012 1.309225576734737E-012 8.100157691188354E-013 + 4.979086469158939E-013 3.040515369267409E-013 1.844377314368409E-013 1.111272637104405E-013 + 6.650013729769101E-014 3.952008473659406E-014 2.332214345974806E-014 1.366582083366721E-014 + 7.950245951888975E-015 4.591593378961119E-015 2.632353652443102E-015 1.497898739771295E-015 + 8.459350599788174E-016 4.740960961923515E-016 2.636504025842742E-016 1.454723991197269E-016 + 7.963055369165518E-017 4.323965050083439E-017 2.328861765000499E-017 1.243997721903410E-017 + 6.589682419816772E-018 3.461246556173034E-018 1.802508419289567E-018 9.305758490344666E-019 + 4.762208438896140E-019 2.415455669980665E-019 1.214158000532303E-019 6.047666751646655E-020 + 2.984612469167028E-020 1.459240546539496E-020 7.067368386342975E-021 3.390297844314284E-021 + 1.610774697909853E-021 7.579476285905844E-022 3.532593864940209E-022 1.631387060061600E-022 + 7.472279427930461E-023 3.402570028600894E-023 1.548843874751700E-023 6.976332586563125E-024 + 3.108909104067513E-024 1.370540310265716E-024 5.976121780399459E-025 2.577098719545178E-025 + 1.098919971383199E-025 4.633008698321336E-026 1.930901309977488E-026 7.954154916543868E-027 + 3.238182519057423E-027 1.302619030324111E-027 5.176986401015360E-028 2.032422600694362E-028 + 7.880639071726435E-029 3.017529282899654E-029 1.140815818898848E-029 4.257788166960202E-030 + 1.568507707763523E-030 5.702326567944468E-031 2.045540915390602E-031 7.239054424891156E-032 + 2.526964310821747E-032 8.699314864933074E-033 2.953002434924013E-033 9.882311913719036E-034 + 3.259804276287660E-034 1.059702475123587E-034 3.394345751518204E-035 1.071092947483377E-035 + 3.329012498562380E-036 1.018915288893930E-036 3.070515409734788E-037 9.108568742051845E-038 + 2.659308340643082E-038 7.639763351834770E-039 2.159213741749150E-039 6.002423574159030E-040 + 1.640901642577767E-040 4.410337891727039E-041 1.165203890005834E-041 3.025372927164016E-042 + 7.718054384877018E-043 1.934160390645613E-043 4.760312492536675E-044 1.150371563249626E-044 + 2.728981788460229E-045 6.353628755702412E-046 1.451440815240682E-046 3.252590869127966E-047 + 7.148372318488842E-048 1.540374060464837E-048 3.253710323560254E-049 6.735288861933596E-050 + 1.365991021718147E-050 2.713575922227922E-051 5.278681437457383E-052 1.005272220462149E-052 + 1.873702457043289E-053 3.417108698563338E-054 6.095919349287256E-055 1.063460622120381E-055 + 1.813775005423663E-056 3.023442352330697E-057 4.924375704900590E-058 7.834390779712392E-059 + 1.217126181970872E-059 1.845918203142256E-060 2.732148421634400E-061 3.945281294065639E-062 + 5.556466420038769E-063 7.630094928165562E-064 1.021253335934194E-064 1.331893102661997E-065 + 1.691982475354046E-066 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 +/ diff --git a/tests/apps/miniDFT/tests/benchmark/large.in b/tests/apps/miniDFT/tests/benchmark/large.in new file mode 100644 index 0000000000..7bbc36794f --- /dev/null +++ b/tests/apps/miniDFT/tests/benchmark/large.in @@ -0,0 +1,2042 @@ +&control +prefix = 'magnesia' +calculation = 'scf' +restart_mode = 'from_scratch' +wf_collect = .false. +disk_io = 'none' +tstress = .false. +tprnfor = .false. +outdir = './' +wfcdir = './' +pseudo_dir = './' +/ +&system +ibrav = 0 +celldm(1) = 7.93658 +nat = 2000 +ntyp = 2 +nbnd = 4000 +ecutwfc = 130 +/ +&electrons +electron_maxstep = 1 +conv_thr = 1.0d-10 +diago_thr_init=5.0d-4 +startingwfc='atomic' +mixing_mode = 'plain' +mixing_beta = 0.7 +mixing_ndim = 8 +diagonalization = 'david' +diago_david_ndim = 4 +diago_full_acc = .true. +/ +CELL_PARAMETERS +0.0 5.0 5.0 +5.0 0.0 5.0 +5.0 5.0 0.0 +ATOMIC_SPECIES +Mg 24.305 Mg.pz.nml +O 15.999 O.pz.nml +ATOMIC_POSITIONS crystal +Mg 0.0 0.0 0.0 +O 0.05 0.05 0.05 +Mg 0.0 0.0 0.1 +O 0.05 0.05 0.15 +Mg 0.0 0.0 0.2 +O 0.05 0.05 0.25 +Mg 0.0 0.0 0.3 +O 0.05 0.05 0.35 +Mg 0.0 0.0 0.4 +O 0.05 0.05 0.45 +Mg 0.0 0.0 0.5 +O 0.05 0.05 0.55 +Mg 0.0 0.0 0.6 +O 0.05 0.05 0.65 +Mg 0.0 0.0 0.7 +O 0.05 0.05 0.75 +Mg 0.0 0.0 0.8 +O 0.05 0.05 0.85 +Mg 0.0 0.0 0.9 +O 0.05 0.05 0.95 +Mg 0.0 0.1 0.0 +O 0.05 0.15 0.05 +Mg 0.0 0.1 0.1 +O 0.05 0.15 0.15 +Mg 0.0 0.1 0.2 +O 0.05 0.15 0.25 +Mg 0.0 0.1 0.3 +O 0.05 0.15 0.35 +Mg 0.0 0.1 0.4 +O 0.05 0.15 0.45 +Mg 0.0 0.1 0.5 +O 0.05 0.15 0.55 +Mg 0.0 0.1 0.6 +O 0.05 0.15 0.65 +Mg 0.0 0.1 0.7 +O 0.05 0.15 0.75 +Mg 0.0 0.1 0.8 +O 0.05 0.15 0.85 +Mg 0.0 0.1 0.9 +O 0.05 0.15 0.95 +Mg 0.0 0.2 0.0 +O 0.05 0.25 0.05 +Mg 0.0 0.2 0.1 +O 0.05 0.25 0.15 +Mg 0.0 0.2 0.2 +O 0.05 0.25 0.25 +Mg 0.0 0.2 0.3 +O 0.05 0.25 0.35 +Mg 0.0 0.2 0.4 +O 0.05 0.25 0.45 +Mg 0.0 0.2 0.5 +O 0.05 0.25 0.55 +Mg 0.0 0.2 0.6 +O 0.05 0.25 0.65 +Mg 0.0 0.2 0.7 +O 0.05 0.25 0.75 +Mg 0.0 0.2 0.8 +O 0.05 0.25 0.85 +Mg 0.0 0.2 0.9 +O 0.05 0.25 0.95 +Mg 0.0 0.3 0.0 +O 0.05 0.35 0.05 +Mg 0.0 0.3 0.1 +O 0.05 0.35 0.15 +Mg 0.0 0.3 0.2 +O 0.05 0.35 0.25 +Mg 0.0 0.3 0.3 +O 0.05 0.35 0.35 +Mg 0.0 0.3 0.4 +O 0.05 0.35 0.45 +Mg 0.0 0.3 0.5 +O 0.05 0.35 0.55 +Mg 0.0 0.3 0.6 +O 0.05 0.35 0.65 +Mg 0.0 0.3 0.7 +O 0.05 0.35 0.75 +Mg 0.0 0.3 0.8 +O 0.05 0.35 0.85 +Mg 0.0 0.3 0.9 +O 0.05 0.35 0.95 +Mg 0.0 0.4 0.0 +O 0.05 0.45 0.05 +Mg 0.0 0.4 0.1 +O 0.05 0.45 0.15 +Mg 0.0 0.4 0.2 +O 0.05 0.45 0.25 +Mg 0.0 0.4 0.3 +O 0.05 0.45 0.35 +Mg 0.0 0.4 0.4 +O 0.05 0.45 0.45 +Mg 0.0 0.4 0.5 +O 0.05 0.45 0.55 +Mg 0.0 0.4 0.6 +O 0.05 0.45 0.65 +Mg 0.0 0.4 0.7 +O 0.05 0.45 0.75 +Mg 0.0 0.4 0.8 +O 0.05 0.45 0.85 +Mg 0.0 0.4 0.9 +O 0.05 0.45 0.95 +Mg 0.0 0.5 0.0 +O 0.05 0.55 0.05 +Mg 0.0 0.5 0.1 +O 0.05 0.55 0.15 +Mg 0.0 0.5 0.2 +O 0.05 0.55 0.25 +Mg 0.0 0.5 0.3 +O 0.05 0.55 0.35 +Mg 0.0 0.5 0.4 +O 0.05 0.55 0.45 +Mg 0.0 0.5 0.5 +O 0.05 0.55 0.55 +Mg 0.0 0.5 0.6 +O 0.05 0.55 0.65 +Mg 0.0 0.5 0.7 +O 0.05 0.55 0.75 +Mg 0.0 0.5 0.8 +O 0.05 0.55 0.85 +Mg 0.0 0.5 0.9 +O 0.05 0.55 0.95 +Mg 0.0 0.6 0.0 +O 0.05 0.65 0.05 +Mg 0.0 0.6 0.1 +O 0.05 0.65 0.15 +Mg 0.0 0.6 0.2 +O 0.05 0.65 0.25 +Mg 0.0 0.6 0.3 +O 0.05 0.65 0.35 +Mg 0.0 0.6 0.4 +O 0.05 0.65 0.45 +Mg 0.0 0.6 0.5 +O 0.05 0.65 0.55 +Mg 0.0 0.6 0.6 +O 0.05 0.65 0.65 +Mg 0.0 0.6 0.7 +O 0.05 0.65 0.75 +Mg 0.0 0.6 0.8 +O 0.05 0.65 0.85 +Mg 0.0 0.6 0.9 +O 0.05 0.65 0.95 +Mg 0.0 0.7 0.0 +O 0.05 0.75 0.05 +Mg 0.0 0.7 0.1 +O 0.05 0.75 0.15 +Mg 0.0 0.7 0.2 +O 0.05 0.75 0.25 +Mg 0.0 0.7 0.3 +O 0.05 0.75 0.35 +Mg 0.0 0.7 0.4 +O 0.05 0.75 0.45 +Mg 0.0 0.7 0.5 +O 0.05 0.75 0.55 +Mg 0.0 0.7 0.6 +O 0.05 0.75 0.65 +Mg 0.0 0.7 0.7 +O 0.05 0.75 0.75 +Mg 0.0 0.7 0.8 +O 0.05 0.75 0.85 +Mg 0.0 0.7 0.9 +O 0.05 0.75 0.95 +Mg 0.0 0.8 0.0 +O 0.05 0.85 0.05 +Mg 0.0 0.8 0.1 +O 0.05 0.85 0.15 +Mg 0.0 0.8 0.2 +O 0.05 0.85 0.25 +Mg 0.0 0.8 0.3 +O 0.05 0.85 0.35 +Mg 0.0 0.8 0.4 +O 0.05 0.85 0.45 +Mg 0.0 0.8 0.5 +O 0.05 0.85 0.55 +Mg 0.0 0.8 0.6 +O 0.05 0.85 0.65 +Mg 0.0 0.8 0.7 +O 0.05 0.85 0.75 +Mg 0.0 0.8 0.8 +O 0.05 0.85 0.85 +Mg 0.0 0.8 0.9 +O 0.05 0.85 0.95 +Mg 0.0 0.9 0.0 +O 0.05 0.95 0.05 +Mg 0.0 0.9 0.1 +O 0.05 0.95 0.15 +Mg 0.0 0.9 0.2 +O 0.05 0.95 0.25 +Mg 0.0 0.9 0.3 +O 0.05 0.95 0.35 +Mg 0.0 0.9 0.4 +O 0.05 0.95 0.45 +Mg 0.0 0.9 0.5 +O 0.05 0.95 0.55 +Mg 0.0 0.9 0.6 +O 0.05 0.95 0.65 +Mg 0.0 0.9 0.7 +O 0.05 0.95 0.75 +Mg 0.0 0.9 0.8 +O 0.05 0.95 0.85 +Mg 0.0 0.9 0.9 +O 0.05 0.95 0.95 +Mg 0.1 0.0 0.0 +O 0.15 0.05 0.05 +Mg 0.1 0.0 0.1 +O 0.15 0.05 0.15 +Mg 0.1 0.0 0.2 +O 0.15 0.05 0.25 +Mg 0.1 0.0 0.3 +O 0.15 0.05 0.35 +Mg 0.1 0.0 0.4 +O 0.15 0.05 0.45 +Mg 0.1 0.0 0.5 +O 0.15 0.05 0.55 +Mg 0.1 0.0 0.6 +O 0.15 0.05 0.65 +Mg 0.1 0.0 0.7 +O 0.15 0.05 0.75 +Mg 0.1 0.0 0.8 +O 0.15 0.05 0.85 +Mg 0.1 0.0 0.9 +O 0.15 0.05 0.95 +Mg 0.1 0.1 0.0 +O 0.15 0.15 0.05 +Mg 0.1 0.1 0.1 +O 0.15 0.15 0.15 +Mg 0.1 0.1 0.2 +O 0.15 0.15 0.25 +Mg 0.1 0.1 0.3 +O 0.15 0.15 0.35 +Mg 0.1 0.1 0.4 +O 0.15 0.15 0.45 +Mg 0.1 0.1 0.5 +O 0.15 0.15 0.55 +Mg 0.1 0.1 0.6 +O 0.15 0.15 0.65 +Mg 0.1 0.1 0.7 +O 0.15 0.15 0.75 +Mg 0.1 0.1 0.8 +O 0.15 0.15 0.85 +Mg 0.1 0.1 0.9 +O 0.15 0.15 0.95 +Mg 0.1 0.2 0.0 +O 0.15 0.25 0.05 +Mg 0.1 0.2 0.1 +O 0.15 0.25 0.15 +Mg 0.1 0.2 0.2 +O 0.15 0.25 0.25 +Mg 0.1 0.2 0.3 +O 0.15 0.25 0.35 +Mg 0.1 0.2 0.4 +O 0.15 0.25 0.45 +Mg 0.1 0.2 0.5 +O 0.15 0.25 0.55 +Mg 0.1 0.2 0.6 +O 0.15 0.25 0.65 +Mg 0.1 0.2 0.7 +O 0.15 0.25 0.75 +Mg 0.1 0.2 0.8 +O 0.15 0.25 0.85 +Mg 0.1 0.2 0.9 +O 0.15 0.25 0.95 +Mg 0.1 0.3 0.0 +O 0.15 0.35 0.05 +Mg 0.1 0.3 0.1 +O 0.15 0.35 0.15 +Mg 0.1 0.3 0.2 +O 0.15 0.35 0.25 +Mg 0.1 0.3 0.3 +O 0.15 0.35 0.35 +Mg 0.1 0.3 0.4 +O 0.15 0.35 0.45 +Mg 0.1 0.3 0.5 +O 0.15 0.35 0.55 +Mg 0.1 0.3 0.6 +O 0.15 0.35 0.65 +Mg 0.1 0.3 0.7 +O 0.15 0.35 0.75 +Mg 0.1 0.3 0.8 +O 0.15 0.35 0.85 +Mg 0.1 0.3 0.9 +O 0.15 0.35 0.95 +Mg 0.1 0.4 0.0 +O 0.15 0.45 0.05 +Mg 0.1 0.4 0.1 +O 0.15 0.45 0.15 +Mg 0.1 0.4 0.2 +O 0.15 0.45 0.25 +Mg 0.1 0.4 0.3 +O 0.15 0.45 0.35 +Mg 0.1 0.4 0.4 +O 0.15 0.45 0.45 +Mg 0.1 0.4 0.5 +O 0.15 0.45 0.55 +Mg 0.1 0.4 0.6 +O 0.15 0.45 0.65 +Mg 0.1 0.4 0.7 +O 0.15 0.45 0.75 +Mg 0.1 0.4 0.8 +O 0.15 0.45 0.85 +Mg 0.1 0.4 0.9 +O 0.15 0.45 0.95 +Mg 0.1 0.5 0.0 +O 0.15 0.55 0.05 +Mg 0.1 0.5 0.1 +O 0.15 0.55 0.15 +Mg 0.1 0.5 0.2 +O 0.15 0.55 0.25 +Mg 0.1 0.5 0.3 +O 0.15 0.55 0.35 +Mg 0.1 0.5 0.4 +O 0.15 0.55 0.45 +Mg 0.1 0.5 0.5 +O 0.15 0.55 0.55 +Mg 0.1 0.5 0.6 +O 0.15 0.55 0.65 +Mg 0.1 0.5 0.7 +O 0.15 0.55 0.75 +Mg 0.1 0.5 0.8 +O 0.15 0.55 0.85 +Mg 0.1 0.5 0.9 +O 0.15 0.55 0.95 +Mg 0.1 0.6 0.0 +O 0.15 0.65 0.05 +Mg 0.1 0.6 0.1 +O 0.15 0.65 0.15 +Mg 0.1 0.6 0.2 +O 0.15 0.65 0.25 +Mg 0.1 0.6 0.3 +O 0.15 0.65 0.35 +Mg 0.1 0.6 0.4 +O 0.15 0.65 0.45 +Mg 0.1 0.6 0.5 +O 0.15 0.65 0.55 +Mg 0.1 0.6 0.6 +O 0.15 0.65 0.65 +Mg 0.1 0.6 0.7 +O 0.15 0.65 0.75 +Mg 0.1 0.6 0.8 +O 0.15 0.65 0.85 +Mg 0.1 0.6 0.9 +O 0.15 0.65 0.95 +Mg 0.1 0.7 0.0 +O 0.15 0.75 0.05 +Mg 0.1 0.7 0.1 +O 0.15 0.75 0.15 +Mg 0.1 0.7 0.2 +O 0.15 0.75 0.25 +Mg 0.1 0.7 0.3 +O 0.15 0.75 0.35 +Mg 0.1 0.7 0.4 +O 0.15 0.75 0.45 +Mg 0.1 0.7 0.5 +O 0.15 0.75 0.55 +Mg 0.1 0.7 0.6 +O 0.15 0.75 0.65 +Mg 0.1 0.7 0.7 +O 0.15 0.75 0.75 +Mg 0.1 0.7 0.8 +O 0.15 0.75 0.85 +Mg 0.1 0.7 0.9 +O 0.15 0.75 0.95 +Mg 0.1 0.8 0.0 +O 0.15 0.85 0.05 +Mg 0.1 0.8 0.1 +O 0.15 0.85 0.15 +Mg 0.1 0.8 0.2 +O 0.15 0.85 0.25 +Mg 0.1 0.8 0.3 +O 0.15 0.85 0.35 +Mg 0.1 0.8 0.4 +O 0.15 0.85 0.45 +Mg 0.1 0.8 0.5 +O 0.15 0.85 0.55 +Mg 0.1 0.8 0.6 +O 0.15 0.85 0.65 +Mg 0.1 0.8 0.7 +O 0.15 0.85 0.75 +Mg 0.1 0.8 0.8 +O 0.15 0.85 0.85 +Mg 0.1 0.8 0.9 +O 0.15 0.85 0.95 +Mg 0.1 0.9 0.0 +O 0.15 0.95 0.05 +Mg 0.1 0.9 0.1 +O 0.15 0.95 0.15 +Mg 0.1 0.9 0.2 +O 0.15 0.95 0.25 +Mg 0.1 0.9 0.3 +O 0.15 0.95 0.35 +Mg 0.1 0.9 0.4 +O 0.15 0.95 0.45 +Mg 0.1 0.9 0.5 +O 0.15 0.95 0.55 +Mg 0.1 0.9 0.6 +O 0.15 0.95 0.65 +Mg 0.1 0.9 0.7 +O 0.15 0.95 0.75 +Mg 0.1 0.9 0.8 +O 0.15 0.95 0.85 +Mg 0.1 0.9 0.9 +O 0.15 0.95 0.95 +Mg 0.2 0.0 0.0 +O 0.25 0.05 0.05 +Mg 0.2 0.0 0.1 +O 0.25 0.05 0.15 +Mg 0.2 0.0 0.2 +O 0.25 0.05 0.25 +Mg 0.2 0.0 0.3 +O 0.25 0.05 0.35 +Mg 0.2 0.0 0.4 +O 0.25 0.05 0.45 +Mg 0.2 0.0 0.5 +O 0.25 0.05 0.55 +Mg 0.2 0.0 0.6 +O 0.25 0.05 0.65 +Mg 0.2 0.0 0.7 +O 0.25 0.05 0.75 +Mg 0.2 0.0 0.8 +O 0.25 0.05 0.85 +Mg 0.2 0.0 0.9 +O 0.25 0.05 0.95 +Mg 0.2 0.1 0.0 +O 0.25 0.15 0.05 +Mg 0.2 0.1 0.1 +O 0.25 0.15 0.15 +Mg 0.2 0.1 0.2 +O 0.25 0.15 0.25 +Mg 0.2 0.1 0.3 +O 0.25 0.15 0.35 +Mg 0.2 0.1 0.4 +O 0.25 0.15 0.45 +Mg 0.2 0.1 0.5 +O 0.25 0.15 0.55 +Mg 0.2 0.1 0.6 +O 0.25 0.15 0.65 +Mg 0.2 0.1 0.7 +O 0.25 0.15 0.75 +Mg 0.2 0.1 0.8 +O 0.25 0.15 0.85 +Mg 0.2 0.1 0.9 +O 0.25 0.15 0.95 +Mg 0.2 0.2 0.0 +O 0.25 0.25 0.05 +Mg 0.2 0.2 0.1 +O 0.25 0.25 0.15 +Mg 0.2 0.2 0.2 +O 0.25 0.25 0.25 +Mg 0.2 0.2 0.3 +O 0.25 0.25 0.35 +Mg 0.2 0.2 0.4 +O 0.25 0.25 0.45 +Mg 0.2 0.2 0.5 +O 0.25 0.25 0.55 +Mg 0.2 0.2 0.6 +O 0.25 0.25 0.65 +Mg 0.2 0.2 0.7 +O 0.25 0.25 0.75 +Mg 0.2 0.2 0.8 +O 0.25 0.25 0.85 +Mg 0.2 0.2 0.9 +O 0.25 0.25 0.95 +Mg 0.2 0.3 0.0 +O 0.25 0.35 0.05 +Mg 0.2 0.3 0.1 +O 0.25 0.35 0.15 +Mg 0.2 0.3 0.2 +O 0.25 0.35 0.25 +Mg 0.2 0.3 0.3 +O 0.25 0.35 0.35 +Mg 0.2 0.3 0.4 +O 0.25 0.35 0.45 +Mg 0.2 0.3 0.5 +O 0.25 0.35 0.55 +Mg 0.2 0.3 0.6 +O 0.25 0.35 0.65 +Mg 0.2 0.3 0.7 +O 0.25 0.35 0.75 +Mg 0.2 0.3 0.8 +O 0.25 0.35 0.85 +Mg 0.2 0.3 0.9 +O 0.25 0.35 0.95 +Mg 0.2 0.4 0.0 +O 0.25 0.45 0.05 +Mg 0.2 0.4 0.1 +O 0.25 0.45 0.15 +Mg 0.2 0.4 0.2 +O 0.25 0.45 0.25 +Mg 0.2 0.4 0.3 +O 0.25 0.45 0.35 +Mg 0.2 0.4 0.4 +O 0.25 0.45 0.45 +Mg 0.2 0.4 0.5 +O 0.25 0.45 0.55 +Mg 0.2 0.4 0.6 +O 0.25 0.45 0.65 +Mg 0.2 0.4 0.7 +O 0.25 0.45 0.75 +Mg 0.2 0.4 0.8 +O 0.25 0.45 0.85 +Mg 0.2 0.4 0.9 +O 0.25 0.45 0.95 +Mg 0.2 0.5 0.0 +O 0.25 0.55 0.05 +Mg 0.2 0.5 0.1 +O 0.25 0.55 0.15 +Mg 0.2 0.5 0.2 +O 0.25 0.55 0.25 +Mg 0.2 0.5 0.3 +O 0.25 0.55 0.35 +Mg 0.2 0.5 0.4 +O 0.25 0.55 0.45 +Mg 0.2 0.5 0.5 +O 0.25 0.55 0.55 +Mg 0.2 0.5 0.6 +O 0.25 0.55 0.65 +Mg 0.2 0.5 0.7 +O 0.25 0.55 0.75 +Mg 0.2 0.5 0.8 +O 0.25 0.55 0.85 +Mg 0.2 0.5 0.9 +O 0.25 0.55 0.95 +Mg 0.2 0.6 0.0 +O 0.25 0.65 0.05 +Mg 0.2 0.6 0.1 +O 0.25 0.65 0.15 +Mg 0.2 0.6 0.2 +O 0.25 0.65 0.25 +Mg 0.2 0.6 0.3 +O 0.25 0.65 0.35 +Mg 0.2 0.6 0.4 +O 0.25 0.65 0.45 +Mg 0.2 0.6 0.5 +O 0.25 0.65 0.55 +Mg 0.2 0.6 0.6 +O 0.25 0.65 0.65 +Mg 0.2 0.6 0.7 +O 0.25 0.65 0.75 +Mg 0.2 0.6 0.8 +O 0.25 0.65 0.85 +Mg 0.2 0.6 0.9 +O 0.25 0.65 0.95 +Mg 0.2 0.7 0.0 +O 0.25 0.75 0.05 +Mg 0.2 0.7 0.1 +O 0.25 0.75 0.15 +Mg 0.2 0.7 0.2 +O 0.25 0.75 0.25 +Mg 0.2 0.7 0.3 +O 0.25 0.75 0.35 +Mg 0.2 0.7 0.4 +O 0.25 0.75 0.45 +Mg 0.2 0.7 0.5 +O 0.25 0.75 0.55 +Mg 0.2 0.7 0.6 +O 0.25 0.75 0.65 +Mg 0.2 0.7 0.7 +O 0.25 0.75 0.75 +Mg 0.2 0.7 0.8 +O 0.25 0.75 0.85 +Mg 0.2 0.7 0.9 +O 0.25 0.75 0.95 +Mg 0.2 0.8 0.0 +O 0.25 0.85 0.05 +Mg 0.2 0.8 0.1 +O 0.25 0.85 0.15 +Mg 0.2 0.8 0.2 +O 0.25 0.85 0.25 +Mg 0.2 0.8 0.3 +O 0.25 0.85 0.35 +Mg 0.2 0.8 0.4 +O 0.25 0.85 0.45 +Mg 0.2 0.8 0.5 +O 0.25 0.85 0.55 +Mg 0.2 0.8 0.6 +O 0.25 0.85 0.65 +Mg 0.2 0.8 0.7 +O 0.25 0.85 0.75 +Mg 0.2 0.8 0.8 +O 0.25 0.85 0.85 +Mg 0.2 0.8 0.9 +O 0.25 0.85 0.95 +Mg 0.2 0.9 0.0 +O 0.25 0.95 0.05 +Mg 0.2 0.9 0.1 +O 0.25 0.95 0.15 +Mg 0.2 0.9 0.2 +O 0.25 0.95 0.25 +Mg 0.2 0.9 0.3 +O 0.25 0.95 0.35 +Mg 0.2 0.9 0.4 +O 0.25 0.95 0.45 +Mg 0.2 0.9 0.5 +O 0.25 0.95 0.55 +Mg 0.2 0.9 0.6 +O 0.25 0.95 0.65 +Mg 0.2 0.9 0.7 +O 0.25 0.95 0.75 +Mg 0.2 0.9 0.8 +O 0.25 0.95 0.85 +Mg 0.2 0.9 0.9 +O 0.25 0.95 0.95 +Mg 0.3 0.0 0.0 +O 0.35 0.05 0.05 +Mg 0.3 0.0 0.1 +O 0.35 0.05 0.15 +Mg 0.3 0.0 0.2 +O 0.35 0.05 0.25 +Mg 0.3 0.0 0.3 +O 0.35 0.05 0.35 +Mg 0.3 0.0 0.4 +O 0.35 0.05 0.45 +Mg 0.3 0.0 0.5 +O 0.35 0.05 0.55 +Mg 0.3 0.0 0.6 +O 0.35 0.05 0.65 +Mg 0.3 0.0 0.7 +O 0.35 0.05 0.75 +Mg 0.3 0.0 0.8 +O 0.35 0.05 0.85 +Mg 0.3 0.0 0.9 +O 0.35 0.05 0.95 +Mg 0.3 0.1 0.0 +O 0.35 0.15 0.05 +Mg 0.3 0.1 0.1 +O 0.35 0.15 0.15 +Mg 0.3 0.1 0.2 +O 0.35 0.15 0.25 +Mg 0.3 0.1 0.3 +O 0.35 0.15 0.35 +Mg 0.3 0.1 0.4 +O 0.35 0.15 0.45 +Mg 0.3 0.1 0.5 +O 0.35 0.15 0.55 +Mg 0.3 0.1 0.6 +O 0.35 0.15 0.65 +Mg 0.3 0.1 0.7 +O 0.35 0.15 0.75 +Mg 0.3 0.1 0.8 +O 0.35 0.15 0.85 +Mg 0.3 0.1 0.9 +O 0.35 0.15 0.95 +Mg 0.3 0.2 0.0 +O 0.35 0.25 0.05 +Mg 0.3 0.2 0.1 +O 0.35 0.25 0.15 +Mg 0.3 0.2 0.2 +O 0.35 0.25 0.25 +Mg 0.3 0.2 0.3 +O 0.35 0.25 0.35 +Mg 0.3 0.2 0.4 +O 0.35 0.25 0.45 +Mg 0.3 0.2 0.5 +O 0.35 0.25 0.55 +Mg 0.3 0.2 0.6 +O 0.35 0.25 0.65 +Mg 0.3 0.2 0.7 +O 0.35 0.25 0.75 +Mg 0.3 0.2 0.8 +O 0.35 0.25 0.85 +Mg 0.3 0.2 0.9 +O 0.35 0.25 0.95 +Mg 0.3 0.3 0.0 +O 0.35 0.35 0.05 +Mg 0.3 0.3 0.1 +O 0.35 0.35 0.15 +Mg 0.3 0.3 0.2 +O 0.35 0.35 0.25 +Mg 0.3 0.3 0.3 +O 0.35 0.35 0.35 +Mg 0.3 0.3 0.4 +O 0.35 0.35 0.45 +Mg 0.3 0.3 0.5 +O 0.35 0.35 0.55 +Mg 0.3 0.3 0.6 +O 0.35 0.35 0.65 +Mg 0.3 0.3 0.7 +O 0.35 0.35 0.75 +Mg 0.3 0.3 0.8 +O 0.35 0.35 0.85 +Mg 0.3 0.3 0.9 +O 0.35 0.35 0.95 +Mg 0.3 0.4 0.0 +O 0.35 0.45 0.05 +Mg 0.3 0.4 0.1 +O 0.35 0.45 0.15 +Mg 0.3 0.4 0.2 +O 0.35 0.45 0.25 +Mg 0.3 0.4 0.3 +O 0.35 0.45 0.35 +Mg 0.3 0.4 0.4 +O 0.35 0.45 0.45 +Mg 0.3 0.4 0.5 +O 0.35 0.45 0.55 +Mg 0.3 0.4 0.6 +O 0.35 0.45 0.65 +Mg 0.3 0.4 0.7 +O 0.35 0.45 0.75 +Mg 0.3 0.4 0.8 +O 0.35 0.45 0.85 +Mg 0.3 0.4 0.9 +O 0.35 0.45 0.95 +Mg 0.3 0.5 0.0 +O 0.35 0.55 0.05 +Mg 0.3 0.5 0.1 +O 0.35 0.55 0.15 +Mg 0.3 0.5 0.2 +O 0.35 0.55 0.25 +Mg 0.3 0.5 0.3 +O 0.35 0.55 0.35 +Mg 0.3 0.5 0.4 +O 0.35 0.55 0.45 +Mg 0.3 0.5 0.5 +O 0.35 0.55 0.55 +Mg 0.3 0.5 0.6 +O 0.35 0.55 0.65 +Mg 0.3 0.5 0.7 +O 0.35 0.55 0.75 +Mg 0.3 0.5 0.8 +O 0.35 0.55 0.85 +Mg 0.3 0.5 0.9 +O 0.35 0.55 0.95 +Mg 0.3 0.6 0.0 +O 0.35 0.65 0.05 +Mg 0.3 0.6 0.1 +O 0.35 0.65 0.15 +Mg 0.3 0.6 0.2 +O 0.35 0.65 0.25 +Mg 0.3 0.6 0.3 +O 0.35 0.65 0.35 +Mg 0.3 0.6 0.4 +O 0.35 0.65 0.45 +Mg 0.3 0.6 0.5 +O 0.35 0.65 0.55 +Mg 0.3 0.6 0.6 +O 0.35 0.65 0.65 +Mg 0.3 0.6 0.7 +O 0.35 0.65 0.75 +Mg 0.3 0.6 0.8 +O 0.35 0.65 0.85 +Mg 0.3 0.6 0.9 +O 0.35 0.65 0.95 +Mg 0.3 0.7 0.0 +O 0.35 0.75 0.05 +Mg 0.3 0.7 0.1 +O 0.35 0.75 0.15 +Mg 0.3 0.7 0.2 +O 0.35 0.75 0.25 +Mg 0.3 0.7 0.3 +O 0.35 0.75 0.35 +Mg 0.3 0.7 0.4 +O 0.35 0.75 0.45 +Mg 0.3 0.7 0.5 +O 0.35 0.75 0.55 +Mg 0.3 0.7 0.6 +O 0.35 0.75 0.65 +Mg 0.3 0.7 0.7 +O 0.35 0.75 0.75 +Mg 0.3 0.7 0.8 +O 0.35 0.75 0.85 +Mg 0.3 0.7 0.9 +O 0.35 0.75 0.95 +Mg 0.3 0.8 0.0 +O 0.35 0.85 0.05 +Mg 0.3 0.8 0.1 +O 0.35 0.85 0.15 +Mg 0.3 0.8 0.2 +O 0.35 0.85 0.25 +Mg 0.3 0.8 0.3 +O 0.35 0.85 0.35 +Mg 0.3 0.8 0.4 +O 0.35 0.85 0.45 +Mg 0.3 0.8 0.5 +O 0.35 0.85 0.55 +Mg 0.3 0.8 0.6 +O 0.35 0.85 0.65 +Mg 0.3 0.8 0.7 +O 0.35 0.85 0.75 +Mg 0.3 0.8 0.8 +O 0.35 0.85 0.85 +Mg 0.3 0.8 0.9 +O 0.35 0.85 0.95 +Mg 0.3 0.9 0.0 +O 0.35 0.95 0.05 +Mg 0.3 0.9 0.1 +O 0.35 0.95 0.15 +Mg 0.3 0.9 0.2 +O 0.35 0.95 0.25 +Mg 0.3 0.9 0.3 +O 0.35 0.95 0.35 +Mg 0.3 0.9 0.4 +O 0.35 0.95 0.45 +Mg 0.3 0.9 0.5 +O 0.35 0.95 0.55 +Mg 0.3 0.9 0.6 +O 0.35 0.95 0.65 +Mg 0.3 0.9 0.7 +O 0.35 0.95 0.75 +Mg 0.3 0.9 0.8 +O 0.35 0.95 0.85 +Mg 0.3 0.9 0.9 +O 0.35 0.95 0.95 +Mg 0.4 0.0 0.0 +O 0.45 0.05 0.05 +Mg 0.4 0.0 0.1 +O 0.45 0.05 0.15 +Mg 0.4 0.0 0.2 +O 0.45 0.05 0.25 +Mg 0.4 0.0 0.3 +O 0.45 0.05 0.35 +Mg 0.4 0.0 0.4 +O 0.45 0.05 0.45 +Mg 0.4 0.0 0.5 +O 0.45 0.05 0.55 +Mg 0.4 0.0 0.6 +O 0.45 0.05 0.65 +Mg 0.4 0.0 0.7 +O 0.45 0.05 0.75 +Mg 0.4 0.0 0.8 +O 0.45 0.05 0.85 +Mg 0.4 0.0 0.9 +O 0.45 0.05 0.95 +Mg 0.4 0.1 0.0 +O 0.45 0.15 0.05 +Mg 0.4 0.1 0.1 +O 0.45 0.15 0.15 +Mg 0.4 0.1 0.2 +O 0.45 0.15 0.25 +Mg 0.4 0.1 0.3 +O 0.45 0.15 0.35 +Mg 0.4 0.1 0.4 +O 0.45 0.15 0.45 +Mg 0.4 0.1 0.5 +O 0.45 0.15 0.55 +Mg 0.4 0.1 0.6 +O 0.45 0.15 0.65 +Mg 0.4 0.1 0.7 +O 0.45 0.15 0.75 +Mg 0.4 0.1 0.8 +O 0.45 0.15 0.85 +Mg 0.4 0.1 0.9 +O 0.45 0.15 0.95 +Mg 0.4 0.2 0.0 +O 0.45 0.25 0.05 +Mg 0.4 0.2 0.1 +O 0.45 0.25 0.15 +Mg 0.4 0.2 0.2 +O 0.45 0.25 0.25 +Mg 0.4 0.2 0.3 +O 0.45 0.25 0.35 +Mg 0.4 0.2 0.4 +O 0.45 0.25 0.45 +Mg 0.4 0.2 0.5 +O 0.45 0.25 0.55 +Mg 0.4 0.2 0.6 +O 0.45 0.25 0.65 +Mg 0.4 0.2 0.7 +O 0.45 0.25 0.75 +Mg 0.4 0.2 0.8 +O 0.45 0.25 0.85 +Mg 0.4 0.2 0.9 +O 0.45 0.25 0.95 +Mg 0.4 0.3 0.0 +O 0.45 0.35 0.05 +Mg 0.4 0.3 0.1 +O 0.45 0.35 0.15 +Mg 0.4 0.3 0.2 +O 0.45 0.35 0.25 +Mg 0.4 0.3 0.3 +O 0.45 0.35 0.35 +Mg 0.4 0.3 0.4 +O 0.45 0.35 0.45 +Mg 0.4 0.3 0.5 +O 0.45 0.35 0.55 +Mg 0.4 0.3 0.6 +O 0.45 0.35 0.65 +Mg 0.4 0.3 0.7 +O 0.45 0.35 0.75 +Mg 0.4 0.3 0.8 +O 0.45 0.35 0.85 +Mg 0.4 0.3 0.9 +O 0.45 0.35 0.95 +Mg 0.4 0.4 0.0 +O 0.45 0.45 0.05 +Mg 0.4 0.4 0.1 +O 0.45 0.45 0.15 +Mg 0.4 0.4 0.2 +O 0.45 0.45 0.25 +Mg 0.4 0.4 0.3 +O 0.45 0.45 0.35 +Mg 0.4 0.4 0.4 +O 0.45 0.45 0.45 +Mg 0.4 0.4 0.5 +O 0.45 0.45 0.55 +Mg 0.4 0.4 0.6 +O 0.45 0.45 0.65 +Mg 0.4 0.4 0.7 +O 0.45 0.45 0.75 +Mg 0.4 0.4 0.8 +O 0.45 0.45 0.85 +Mg 0.4 0.4 0.9 +O 0.45 0.45 0.95 +Mg 0.4 0.5 0.0 +O 0.45 0.55 0.05 +Mg 0.4 0.5 0.1 +O 0.45 0.55 0.15 +Mg 0.4 0.5 0.2 +O 0.45 0.55 0.25 +Mg 0.4 0.5 0.3 +O 0.45 0.55 0.35 +Mg 0.4 0.5 0.4 +O 0.45 0.55 0.45 +Mg 0.4 0.5 0.5 +O 0.45 0.55 0.55 +Mg 0.4 0.5 0.6 +O 0.45 0.55 0.65 +Mg 0.4 0.5 0.7 +O 0.45 0.55 0.75 +Mg 0.4 0.5 0.8 +O 0.45 0.55 0.85 +Mg 0.4 0.5 0.9 +O 0.45 0.55 0.95 +Mg 0.4 0.6 0.0 +O 0.45 0.65 0.05 +Mg 0.4 0.6 0.1 +O 0.45 0.65 0.15 +Mg 0.4 0.6 0.2 +O 0.45 0.65 0.25 +Mg 0.4 0.6 0.3 +O 0.45 0.65 0.35 +Mg 0.4 0.6 0.4 +O 0.45 0.65 0.45 +Mg 0.4 0.6 0.5 +O 0.45 0.65 0.55 +Mg 0.4 0.6 0.6 +O 0.45 0.65 0.65 +Mg 0.4 0.6 0.7 +O 0.45 0.65 0.75 +Mg 0.4 0.6 0.8 +O 0.45 0.65 0.85 +Mg 0.4 0.6 0.9 +O 0.45 0.65 0.95 +Mg 0.4 0.7 0.0 +O 0.45 0.75 0.05 +Mg 0.4 0.7 0.1 +O 0.45 0.75 0.15 +Mg 0.4 0.7 0.2 +O 0.45 0.75 0.25 +Mg 0.4 0.7 0.3 +O 0.45 0.75 0.35 +Mg 0.4 0.7 0.4 +O 0.45 0.75 0.45 +Mg 0.4 0.7 0.5 +O 0.45 0.75 0.55 +Mg 0.4 0.7 0.6 +O 0.45 0.75 0.65 +Mg 0.4 0.7 0.7 +O 0.45 0.75 0.75 +Mg 0.4 0.7 0.8 +O 0.45 0.75 0.85 +Mg 0.4 0.7 0.9 +O 0.45 0.75 0.95 +Mg 0.4 0.8 0.0 +O 0.45 0.85 0.05 +Mg 0.4 0.8 0.1 +O 0.45 0.85 0.15 +Mg 0.4 0.8 0.2 +O 0.45 0.85 0.25 +Mg 0.4 0.8 0.3 +O 0.45 0.85 0.35 +Mg 0.4 0.8 0.4 +O 0.45 0.85 0.45 +Mg 0.4 0.8 0.5 +O 0.45 0.85 0.55 +Mg 0.4 0.8 0.6 +O 0.45 0.85 0.65 +Mg 0.4 0.8 0.7 +O 0.45 0.85 0.75 +Mg 0.4 0.8 0.8 +O 0.45 0.85 0.85 +Mg 0.4 0.8 0.9 +O 0.45 0.85 0.95 +Mg 0.4 0.9 0.0 +O 0.45 0.95 0.05 +Mg 0.4 0.9 0.1 +O 0.45 0.95 0.15 +Mg 0.4 0.9 0.2 +O 0.45 0.95 0.25 +Mg 0.4 0.9 0.3 +O 0.45 0.95 0.35 +Mg 0.4 0.9 0.4 +O 0.45 0.95 0.45 +Mg 0.4 0.9 0.5 +O 0.45 0.95 0.55 +Mg 0.4 0.9 0.6 +O 0.45 0.95 0.65 +Mg 0.4 0.9 0.7 +O 0.45 0.95 0.75 +Mg 0.4 0.9 0.8 +O 0.45 0.95 0.85 +Mg 0.4 0.9 0.9 +O 0.45 0.95 0.95 +Mg 0.5 0.0 0.0 +O 0.55 0.05 0.05 +Mg 0.5 0.0 0.1 +O 0.55 0.05 0.15 +Mg 0.5 0.0 0.2 +O 0.55 0.05 0.25 +Mg 0.5 0.0 0.3 +O 0.55 0.05 0.35 +Mg 0.5 0.0 0.4 +O 0.55 0.05 0.45 +Mg 0.5 0.0 0.5 +O 0.55 0.05 0.55 +Mg 0.5 0.0 0.6 +O 0.55 0.05 0.65 +Mg 0.5 0.0 0.7 +O 0.55 0.05 0.75 +Mg 0.5 0.0 0.8 +O 0.55 0.05 0.85 +Mg 0.5 0.0 0.9 +O 0.55 0.05 0.95 +Mg 0.5 0.1 0.0 +O 0.55 0.15 0.05 +Mg 0.5 0.1 0.1 +O 0.55 0.15 0.15 +Mg 0.5 0.1 0.2 +O 0.55 0.15 0.25 +Mg 0.5 0.1 0.3 +O 0.55 0.15 0.35 +Mg 0.5 0.1 0.4 +O 0.55 0.15 0.45 +Mg 0.5 0.1 0.5 +O 0.55 0.15 0.55 +Mg 0.5 0.1 0.6 +O 0.55 0.15 0.65 +Mg 0.5 0.1 0.7 +O 0.55 0.15 0.75 +Mg 0.5 0.1 0.8 +O 0.55 0.15 0.85 +Mg 0.5 0.1 0.9 +O 0.55 0.15 0.95 +Mg 0.5 0.2 0.0 +O 0.55 0.25 0.05 +Mg 0.5 0.2 0.1 +O 0.55 0.25 0.15 +Mg 0.5 0.2 0.2 +O 0.55 0.25 0.25 +Mg 0.5 0.2 0.3 +O 0.55 0.25 0.35 +Mg 0.5 0.2 0.4 +O 0.55 0.25 0.45 +Mg 0.5 0.2 0.5 +O 0.55 0.25 0.55 +Mg 0.5 0.2 0.6 +O 0.55 0.25 0.65 +Mg 0.5 0.2 0.7 +O 0.55 0.25 0.75 +Mg 0.5 0.2 0.8 +O 0.55 0.25 0.85 +Mg 0.5 0.2 0.9 +O 0.55 0.25 0.95 +Mg 0.5 0.3 0.0 +O 0.55 0.35 0.05 +Mg 0.5 0.3 0.1 +O 0.55 0.35 0.15 +Mg 0.5 0.3 0.2 +O 0.55 0.35 0.25 +Mg 0.5 0.3 0.3 +O 0.55 0.35 0.35 +Mg 0.5 0.3 0.4 +O 0.55 0.35 0.45 +Mg 0.5 0.3 0.5 +O 0.55 0.35 0.55 +Mg 0.5 0.3 0.6 +O 0.55 0.35 0.65 +Mg 0.5 0.3 0.7 +O 0.55 0.35 0.75 +Mg 0.5 0.3 0.8 +O 0.55 0.35 0.85 +Mg 0.5 0.3 0.9 +O 0.55 0.35 0.95 +Mg 0.5 0.4 0.0 +O 0.55 0.45 0.05 +Mg 0.5 0.4 0.1 +O 0.55 0.45 0.15 +Mg 0.5 0.4 0.2 +O 0.55 0.45 0.25 +Mg 0.5 0.4 0.3 +O 0.55 0.45 0.35 +Mg 0.5 0.4 0.4 +O 0.55 0.45 0.45 +Mg 0.5 0.4 0.5 +O 0.55 0.45 0.55 +Mg 0.5 0.4 0.6 +O 0.55 0.45 0.65 +Mg 0.5 0.4 0.7 +O 0.55 0.45 0.75 +Mg 0.5 0.4 0.8 +O 0.55 0.45 0.85 +Mg 0.5 0.4 0.9 +O 0.55 0.45 0.95 +Mg 0.5 0.5 0.0 +O 0.55 0.55 0.05 +Mg 0.5 0.5 0.1 +O 0.55 0.55 0.15 +Mg 0.5 0.5 0.2 +O 0.55 0.55 0.25 +Mg 0.5 0.5 0.3 +O 0.55 0.55 0.35 +Mg 0.5 0.5 0.4 +O 0.55 0.55 0.45 +Mg 0.5 0.5 0.5 +O 0.55 0.55 0.55 +Mg 0.5 0.5 0.6 +O 0.55 0.55 0.65 +Mg 0.5 0.5 0.7 +O 0.55 0.55 0.75 +Mg 0.5 0.5 0.8 +O 0.55 0.55 0.85 +Mg 0.5 0.5 0.9 +O 0.55 0.55 0.95 +Mg 0.5 0.6 0.0 +O 0.55 0.65 0.05 +Mg 0.5 0.6 0.1 +O 0.55 0.65 0.15 +Mg 0.5 0.6 0.2 +O 0.55 0.65 0.25 +Mg 0.5 0.6 0.3 +O 0.55 0.65 0.35 +Mg 0.5 0.6 0.4 +O 0.55 0.65 0.45 +Mg 0.5 0.6 0.5 +O 0.55 0.65 0.55 +Mg 0.5 0.6 0.6 +O 0.55 0.65 0.65 +Mg 0.5 0.6 0.7 +O 0.55 0.65 0.75 +Mg 0.5 0.6 0.8 +O 0.55 0.65 0.85 +Mg 0.5 0.6 0.9 +O 0.55 0.65 0.95 +Mg 0.5 0.7 0.0 +O 0.55 0.75 0.05 +Mg 0.5 0.7 0.1 +O 0.55 0.75 0.15 +Mg 0.5 0.7 0.2 +O 0.55 0.75 0.25 +Mg 0.5 0.7 0.3 +O 0.55 0.75 0.35 +Mg 0.5 0.7 0.4 +O 0.55 0.75 0.45 +Mg 0.5 0.7 0.5 +O 0.55 0.75 0.55 +Mg 0.5 0.7 0.6 +O 0.55 0.75 0.65 +Mg 0.5 0.7 0.7 +O 0.55 0.75 0.75 +Mg 0.5 0.7 0.8 +O 0.55 0.75 0.85 +Mg 0.5 0.7 0.9 +O 0.55 0.75 0.95 +Mg 0.5 0.8 0.0 +O 0.55 0.85 0.05 +Mg 0.5 0.8 0.1 +O 0.55 0.85 0.15 +Mg 0.5 0.8 0.2 +O 0.55 0.85 0.25 +Mg 0.5 0.8 0.3 +O 0.55 0.85 0.35 +Mg 0.5 0.8 0.4 +O 0.55 0.85 0.45 +Mg 0.5 0.8 0.5 +O 0.55 0.85 0.55 +Mg 0.5 0.8 0.6 +O 0.55 0.85 0.65 +Mg 0.5 0.8 0.7 +O 0.55 0.85 0.75 +Mg 0.5 0.8 0.8 +O 0.55 0.85 0.85 +Mg 0.5 0.8 0.9 +O 0.55 0.85 0.95 +Mg 0.5 0.9 0.0 +O 0.55 0.95 0.05 +Mg 0.5 0.9 0.1 +O 0.55 0.95 0.15 +Mg 0.5 0.9 0.2 +O 0.55 0.95 0.25 +Mg 0.5 0.9 0.3 +O 0.55 0.95 0.35 +Mg 0.5 0.9 0.4 +O 0.55 0.95 0.45 +Mg 0.5 0.9 0.5 +O 0.55 0.95 0.55 +Mg 0.5 0.9 0.6 +O 0.55 0.95 0.65 +Mg 0.5 0.9 0.7 +O 0.55 0.95 0.75 +Mg 0.5 0.9 0.8 +O 0.55 0.95 0.85 +Mg 0.5 0.9 0.9 +O 0.55 0.95 0.95 +Mg 0.6 0.0 0.0 +O 0.65 0.05 0.05 +Mg 0.6 0.0 0.1 +O 0.65 0.05 0.15 +Mg 0.6 0.0 0.2 +O 0.65 0.05 0.25 +Mg 0.6 0.0 0.3 +O 0.65 0.05 0.35 +Mg 0.6 0.0 0.4 +O 0.65 0.05 0.45 +Mg 0.6 0.0 0.5 +O 0.65 0.05 0.55 +Mg 0.6 0.0 0.6 +O 0.65 0.05 0.65 +Mg 0.6 0.0 0.7 +O 0.65 0.05 0.75 +Mg 0.6 0.0 0.8 +O 0.65 0.05 0.85 +Mg 0.6 0.0 0.9 +O 0.65 0.05 0.95 +Mg 0.6 0.1 0.0 +O 0.65 0.15 0.05 +Mg 0.6 0.1 0.1 +O 0.65 0.15 0.15 +Mg 0.6 0.1 0.2 +O 0.65 0.15 0.25 +Mg 0.6 0.1 0.3 +O 0.65 0.15 0.35 +Mg 0.6 0.1 0.4 +O 0.65 0.15 0.45 +Mg 0.6 0.1 0.5 +O 0.65 0.15 0.55 +Mg 0.6 0.1 0.6 +O 0.65 0.15 0.65 +Mg 0.6 0.1 0.7 +O 0.65 0.15 0.75 +Mg 0.6 0.1 0.8 +O 0.65 0.15 0.85 +Mg 0.6 0.1 0.9 +O 0.65 0.15 0.95 +Mg 0.6 0.2 0.0 +O 0.65 0.25 0.05 +Mg 0.6 0.2 0.1 +O 0.65 0.25 0.15 +Mg 0.6 0.2 0.2 +O 0.65 0.25 0.25 +Mg 0.6 0.2 0.3 +O 0.65 0.25 0.35 +Mg 0.6 0.2 0.4 +O 0.65 0.25 0.45 +Mg 0.6 0.2 0.5 +O 0.65 0.25 0.55 +Mg 0.6 0.2 0.6 +O 0.65 0.25 0.65 +Mg 0.6 0.2 0.7 +O 0.65 0.25 0.75 +Mg 0.6 0.2 0.8 +O 0.65 0.25 0.85 +Mg 0.6 0.2 0.9 +O 0.65 0.25 0.95 +Mg 0.6 0.3 0.0 +O 0.65 0.35 0.05 +Mg 0.6 0.3 0.1 +O 0.65 0.35 0.15 +Mg 0.6 0.3 0.2 +O 0.65 0.35 0.25 +Mg 0.6 0.3 0.3 +O 0.65 0.35 0.35 +Mg 0.6 0.3 0.4 +O 0.65 0.35 0.45 +Mg 0.6 0.3 0.5 +O 0.65 0.35 0.55 +Mg 0.6 0.3 0.6 +O 0.65 0.35 0.65 +Mg 0.6 0.3 0.7 +O 0.65 0.35 0.75 +Mg 0.6 0.3 0.8 +O 0.65 0.35 0.85 +Mg 0.6 0.3 0.9 +O 0.65 0.35 0.95 +Mg 0.6 0.4 0.0 +O 0.65 0.45 0.05 +Mg 0.6 0.4 0.1 +O 0.65 0.45 0.15 +Mg 0.6 0.4 0.2 +O 0.65 0.45 0.25 +Mg 0.6 0.4 0.3 +O 0.65 0.45 0.35 +Mg 0.6 0.4 0.4 +O 0.65 0.45 0.45 +Mg 0.6 0.4 0.5 +O 0.65 0.45 0.55 +Mg 0.6 0.4 0.6 +O 0.65 0.45 0.65 +Mg 0.6 0.4 0.7 +O 0.65 0.45 0.75 +Mg 0.6 0.4 0.8 +O 0.65 0.45 0.85 +Mg 0.6 0.4 0.9 +O 0.65 0.45 0.95 +Mg 0.6 0.5 0.0 +O 0.65 0.55 0.05 +Mg 0.6 0.5 0.1 +O 0.65 0.55 0.15 +Mg 0.6 0.5 0.2 +O 0.65 0.55 0.25 +Mg 0.6 0.5 0.3 +O 0.65 0.55 0.35 +Mg 0.6 0.5 0.4 +O 0.65 0.55 0.45 +Mg 0.6 0.5 0.5 +O 0.65 0.55 0.55 +Mg 0.6 0.5 0.6 +O 0.65 0.55 0.65 +Mg 0.6 0.5 0.7 +O 0.65 0.55 0.75 +Mg 0.6 0.5 0.8 +O 0.65 0.55 0.85 +Mg 0.6 0.5 0.9 +O 0.65 0.55 0.95 +Mg 0.6 0.6 0.0 +O 0.65 0.65 0.05 +Mg 0.6 0.6 0.1 +O 0.65 0.65 0.15 +Mg 0.6 0.6 0.2 +O 0.65 0.65 0.25 +Mg 0.6 0.6 0.3 +O 0.65 0.65 0.35 +Mg 0.6 0.6 0.4 +O 0.65 0.65 0.45 +Mg 0.6 0.6 0.5 +O 0.65 0.65 0.55 +Mg 0.6 0.6 0.6 +O 0.65 0.65 0.65 +Mg 0.6 0.6 0.7 +O 0.65 0.65 0.75 +Mg 0.6 0.6 0.8 +O 0.65 0.65 0.85 +Mg 0.6 0.6 0.9 +O 0.65 0.65 0.95 +Mg 0.6 0.7 0.0 +O 0.65 0.75 0.05 +Mg 0.6 0.7 0.1 +O 0.65 0.75 0.15 +Mg 0.6 0.7 0.2 +O 0.65 0.75 0.25 +Mg 0.6 0.7 0.3 +O 0.65 0.75 0.35 +Mg 0.6 0.7 0.4 +O 0.65 0.75 0.45 +Mg 0.6 0.7 0.5 +O 0.65 0.75 0.55 +Mg 0.6 0.7 0.6 +O 0.65 0.75 0.65 +Mg 0.6 0.7 0.7 +O 0.65 0.75 0.75 +Mg 0.6 0.7 0.8 +O 0.65 0.75 0.85 +Mg 0.6 0.7 0.9 +O 0.65 0.75 0.95 +Mg 0.6 0.8 0.0 +O 0.65 0.85 0.05 +Mg 0.6 0.8 0.1 +O 0.65 0.85 0.15 +Mg 0.6 0.8 0.2 +O 0.65 0.85 0.25 +Mg 0.6 0.8 0.3 +O 0.65 0.85 0.35 +Mg 0.6 0.8 0.4 +O 0.65 0.85 0.45 +Mg 0.6 0.8 0.5 +O 0.65 0.85 0.55 +Mg 0.6 0.8 0.6 +O 0.65 0.85 0.65 +Mg 0.6 0.8 0.7 +O 0.65 0.85 0.75 +Mg 0.6 0.8 0.8 +O 0.65 0.85 0.85 +Mg 0.6 0.8 0.9 +O 0.65 0.85 0.95 +Mg 0.6 0.9 0.0 +O 0.65 0.95 0.05 +Mg 0.6 0.9 0.1 +O 0.65 0.95 0.15 +Mg 0.6 0.9 0.2 +O 0.65 0.95 0.25 +Mg 0.6 0.9 0.3 +O 0.65 0.95 0.35 +Mg 0.6 0.9 0.4 +O 0.65 0.95 0.45 +Mg 0.6 0.9 0.5 +O 0.65 0.95 0.55 +Mg 0.6 0.9 0.6 +O 0.65 0.95 0.65 +Mg 0.6 0.9 0.7 +O 0.65 0.95 0.75 +Mg 0.6 0.9 0.8 +O 0.65 0.95 0.85 +Mg 0.6 0.9 0.9 +O 0.65 0.95 0.95 +Mg 0.7 0.0 0.0 +O 0.75 0.05 0.05 +Mg 0.7 0.0 0.1 +O 0.75 0.05 0.15 +Mg 0.7 0.0 0.2 +O 0.75 0.05 0.25 +Mg 0.7 0.0 0.3 +O 0.75 0.05 0.35 +Mg 0.7 0.0 0.4 +O 0.75 0.05 0.45 +Mg 0.7 0.0 0.5 +O 0.75 0.05 0.55 +Mg 0.7 0.0 0.6 +O 0.75 0.05 0.65 +Mg 0.7 0.0 0.7 +O 0.75 0.05 0.75 +Mg 0.7 0.0 0.8 +O 0.75 0.05 0.85 +Mg 0.7 0.0 0.9 +O 0.75 0.05 0.95 +Mg 0.7 0.1 0.0 +O 0.75 0.15 0.05 +Mg 0.7 0.1 0.1 +O 0.75 0.15 0.15 +Mg 0.7 0.1 0.2 +O 0.75 0.15 0.25 +Mg 0.7 0.1 0.3 +O 0.75 0.15 0.35 +Mg 0.7 0.1 0.4 +O 0.75 0.15 0.45 +Mg 0.7 0.1 0.5 +O 0.75 0.15 0.55 +Mg 0.7 0.1 0.6 +O 0.75 0.15 0.65 +Mg 0.7 0.1 0.7 +O 0.75 0.15 0.75 +Mg 0.7 0.1 0.8 +O 0.75 0.15 0.85 +Mg 0.7 0.1 0.9 +O 0.75 0.15 0.95 +Mg 0.7 0.2 0.0 +O 0.75 0.25 0.05 +Mg 0.7 0.2 0.1 +O 0.75 0.25 0.15 +Mg 0.7 0.2 0.2 +O 0.75 0.25 0.25 +Mg 0.7 0.2 0.3 +O 0.75 0.25 0.35 +Mg 0.7 0.2 0.4 +O 0.75 0.25 0.45 +Mg 0.7 0.2 0.5 +O 0.75 0.25 0.55 +Mg 0.7 0.2 0.6 +O 0.75 0.25 0.65 +Mg 0.7 0.2 0.7 +O 0.75 0.25 0.75 +Mg 0.7 0.2 0.8 +O 0.75 0.25 0.85 +Mg 0.7 0.2 0.9 +O 0.75 0.25 0.95 +Mg 0.7 0.3 0.0 +O 0.75 0.35 0.05 +Mg 0.7 0.3 0.1 +O 0.75 0.35 0.15 +Mg 0.7 0.3 0.2 +O 0.75 0.35 0.25 +Mg 0.7 0.3 0.3 +O 0.75 0.35 0.35 +Mg 0.7 0.3 0.4 +O 0.75 0.35 0.45 +Mg 0.7 0.3 0.5 +O 0.75 0.35 0.55 +Mg 0.7 0.3 0.6 +O 0.75 0.35 0.65 +Mg 0.7 0.3 0.7 +O 0.75 0.35 0.75 +Mg 0.7 0.3 0.8 +O 0.75 0.35 0.85 +Mg 0.7 0.3 0.9 +O 0.75 0.35 0.95 +Mg 0.7 0.4 0.0 +O 0.75 0.45 0.05 +Mg 0.7 0.4 0.1 +O 0.75 0.45 0.15 +Mg 0.7 0.4 0.2 +O 0.75 0.45 0.25 +Mg 0.7 0.4 0.3 +O 0.75 0.45 0.35 +Mg 0.7 0.4 0.4 +O 0.75 0.45 0.45 +Mg 0.7 0.4 0.5 +O 0.75 0.45 0.55 +Mg 0.7 0.4 0.6 +O 0.75 0.45 0.65 +Mg 0.7 0.4 0.7 +O 0.75 0.45 0.75 +Mg 0.7 0.4 0.8 +O 0.75 0.45 0.85 +Mg 0.7 0.4 0.9 +O 0.75 0.45 0.95 +Mg 0.7 0.5 0.0 +O 0.75 0.55 0.05 +Mg 0.7 0.5 0.1 +O 0.75 0.55 0.15 +Mg 0.7 0.5 0.2 +O 0.75 0.55 0.25 +Mg 0.7 0.5 0.3 +O 0.75 0.55 0.35 +Mg 0.7 0.5 0.4 +O 0.75 0.55 0.45 +Mg 0.7 0.5 0.5 +O 0.75 0.55 0.55 +Mg 0.7 0.5 0.6 +O 0.75 0.55 0.65 +Mg 0.7 0.5 0.7 +O 0.75 0.55 0.75 +Mg 0.7 0.5 0.8 +O 0.75 0.55 0.85 +Mg 0.7 0.5 0.9 +O 0.75 0.55 0.95 +Mg 0.7 0.6 0.0 +O 0.75 0.65 0.05 +Mg 0.7 0.6 0.1 +O 0.75 0.65 0.15 +Mg 0.7 0.6 0.2 +O 0.75 0.65 0.25 +Mg 0.7 0.6 0.3 +O 0.75 0.65 0.35 +Mg 0.7 0.6 0.4 +O 0.75 0.65 0.45 +Mg 0.7 0.6 0.5 +O 0.75 0.65 0.55 +Mg 0.7 0.6 0.6 +O 0.75 0.65 0.65 +Mg 0.7 0.6 0.7 +O 0.75 0.65 0.75 +Mg 0.7 0.6 0.8 +O 0.75 0.65 0.85 +Mg 0.7 0.6 0.9 +O 0.75 0.65 0.95 +Mg 0.7 0.7 0.0 +O 0.75 0.75 0.05 +Mg 0.7 0.7 0.1 +O 0.75 0.75 0.15 +Mg 0.7 0.7 0.2 +O 0.75 0.75 0.25 +Mg 0.7 0.7 0.3 +O 0.75 0.75 0.35 +Mg 0.7 0.7 0.4 +O 0.75 0.75 0.45 +Mg 0.7 0.7 0.5 +O 0.75 0.75 0.55 +Mg 0.7 0.7 0.6 +O 0.75 0.75 0.65 +Mg 0.7 0.7 0.7 +O 0.75 0.75 0.75 +Mg 0.7 0.7 0.8 +O 0.75 0.75 0.85 +Mg 0.7 0.7 0.9 +O 0.75 0.75 0.95 +Mg 0.7 0.8 0.0 +O 0.75 0.85 0.05 +Mg 0.7 0.8 0.1 +O 0.75 0.85 0.15 +Mg 0.7 0.8 0.2 +O 0.75 0.85 0.25 +Mg 0.7 0.8 0.3 +O 0.75 0.85 0.35 +Mg 0.7 0.8 0.4 +O 0.75 0.85 0.45 +Mg 0.7 0.8 0.5 +O 0.75 0.85 0.55 +Mg 0.7 0.8 0.6 +O 0.75 0.85 0.65 +Mg 0.7 0.8 0.7 +O 0.75 0.85 0.75 +Mg 0.7 0.8 0.8 +O 0.75 0.85 0.85 +Mg 0.7 0.8 0.9 +O 0.75 0.85 0.95 +Mg 0.7 0.9 0.0 +O 0.75 0.95 0.05 +Mg 0.7 0.9 0.1 +O 0.75 0.95 0.15 +Mg 0.7 0.9 0.2 +O 0.75 0.95 0.25 +Mg 0.7 0.9 0.3 +O 0.75 0.95 0.35 +Mg 0.7 0.9 0.4 +O 0.75 0.95 0.45 +Mg 0.7 0.9 0.5 +O 0.75 0.95 0.55 +Mg 0.7 0.9 0.6 +O 0.75 0.95 0.65 +Mg 0.7 0.9 0.7 +O 0.75 0.95 0.75 +Mg 0.7 0.9 0.8 +O 0.75 0.95 0.85 +Mg 0.7 0.9 0.9 +O 0.75 0.95 0.95 +Mg 0.8 0.0 0.0 +O 0.85 0.05 0.05 +Mg 0.8 0.0 0.1 +O 0.85 0.05 0.15 +Mg 0.8 0.0 0.2 +O 0.85 0.05 0.25 +Mg 0.8 0.0 0.3 +O 0.85 0.05 0.35 +Mg 0.8 0.0 0.4 +O 0.85 0.05 0.45 +Mg 0.8 0.0 0.5 +O 0.85 0.05 0.55 +Mg 0.8 0.0 0.6 +O 0.85 0.05 0.65 +Mg 0.8 0.0 0.7 +O 0.85 0.05 0.75 +Mg 0.8 0.0 0.8 +O 0.85 0.05 0.85 +Mg 0.8 0.0 0.9 +O 0.85 0.05 0.95 +Mg 0.8 0.1 0.0 +O 0.85 0.15 0.05 +Mg 0.8 0.1 0.1 +O 0.85 0.15 0.15 +Mg 0.8 0.1 0.2 +O 0.85 0.15 0.25 +Mg 0.8 0.1 0.3 +O 0.85 0.15 0.35 +Mg 0.8 0.1 0.4 +O 0.85 0.15 0.45 +Mg 0.8 0.1 0.5 +O 0.85 0.15 0.55 +Mg 0.8 0.1 0.6 +O 0.85 0.15 0.65 +Mg 0.8 0.1 0.7 +O 0.85 0.15 0.75 +Mg 0.8 0.1 0.8 +O 0.85 0.15 0.85 +Mg 0.8 0.1 0.9 +O 0.85 0.15 0.95 +Mg 0.8 0.2 0.0 +O 0.85 0.25 0.05 +Mg 0.8 0.2 0.1 +O 0.85 0.25 0.15 +Mg 0.8 0.2 0.2 +O 0.85 0.25 0.25 +Mg 0.8 0.2 0.3 +O 0.85 0.25 0.35 +Mg 0.8 0.2 0.4 +O 0.85 0.25 0.45 +Mg 0.8 0.2 0.5 +O 0.85 0.25 0.55 +Mg 0.8 0.2 0.6 +O 0.85 0.25 0.65 +Mg 0.8 0.2 0.7 +O 0.85 0.25 0.75 +Mg 0.8 0.2 0.8 +O 0.85 0.25 0.85 +Mg 0.8 0.2 0.9 +O 0.85 0.25 0.95 +Mg 0.8 0.3 0.0 +O 0.85 0.35 0.05 +Mg 0.8 0.3 0.1 +O 0.85 0.35 0.15 +Mg 0.8 0.3 0.2 +O 0.85 0.35 0.25 +Mg 0.8 0.3 0.3 +O 0.85 0.35 0.35 +Mg 0.8 0.3 0.4 +O 0.85 0.35 0.45 +Mg 0.8 0.3 0.5 +O 0.85 0.35 0.55 +Mg 0.8 0.3 0.6 +O 0.85 0.35 0.65 +Mg 0.8 0.3 0.7 +O 0.85 0.35 0.75 +Mg 0.8 0.3 0.8 +O 0.85 0.35 0.85 +Mg 0.8 0.3 0.9 +O 0.85 0.35 0.95 +Mg 0.8 0.4 0.0 +O 0.85 0.45 0.05 +Mg 0.8 0.4 0.1 +O 0.85 0.45 0.15 +Mg 0.8 0.4 0.2 +O 0.85 0.45 0.25 +Mg 0.8 0.4 0.3 +O 0.85 0.45 0.35 +Mg 0.8 0.4 0.4 +O 0.85 0.45 0.45 +Mg 0.8 0.4 0.5 +O 0.85 0.45 0.55 +Mg 0.8 0.4 0.6 +O 0.85 0.45 0.65 +Mg 0.8 0.4 0.7 +O 0.85 0.45 0.75 +Mg 0.8 0.4 0.8 +O 0.85 0.45 0.85 +Mg 0.8 0.4 0.9 +O 0.85 0.45 0.95 +Mg 0.8 0.5 0.0 +O 0.85 0.55 0.05 +Mg 0.8 0.5 0.1 +O 0.85 0.55 0.15 +Mg 0.8 0.5 0.2 +O 0.85 0.55 0.25 +Mg 0.8 0.5 0.3 +O 0.85 0.55 0.35 +Mg 0.8 0.5 0.4 +O 0.85 0.55 0.45 +Mg 0.8 0.5 0.5 +O 0.85 0.55 0.55 +Mg 0.8 0.5 0.6 +O 0.85 0.55 0.65 +Mg 0.8 0.5 0.7 +O 0.85 0.55 0.75 +Mg 0.8 0.5 0.8 +O 0.85 0.55 0.85 +Mg 0.8 0.5 0.9 +O 0.85 0.55 0.95 +Mg 0.8 0.6 0.0 +O 0.85 0.65 0.05 +Mg 0.8 0.6 0.1 +O 0.85 0.65 0.15 +Mg 0.8 0.6 0.2 +O 0.85 0.65 0.25 +Mg 0.8 0.6 0.3 +O 0.85 0.65 0.35 +Mg 0.8 0.6 0.4 +O 0.85 0.65 0.45 +Mg 0.8 0.6 0.5 +O 0.85 0.65 0.55 +Mg 0.8 0.6 0.6 +O 0.85 0.65 0.65 +Mg 0.8 0.6 0.7 +O 0.85 0.65 0.75 +Mg 0.8 0.6 0.8 +O 0.85 0.65 0.85 +Mg 0.8 0.6 0.9 +O 0.85 0.65 0.95 +Mg 0.8 0.7 0.0 +O 0.85 0.75 0.05 +Mg 0.8 0.7 0.1 +O 0.85 0.75 0.15 +Mg 0.8 0.7 0.2 +O 0.85 0.75 0.25 +Mg 0.8 0.7 0.3 +O 0.85 0.75 0.35 +Mg 0.8 0.7 0.4 +O 0.85 0.75 0.45 +Mg 0.8 0.7 0.5 +O 0.85 0.75 0.55 +Mg 0.8 0.7 0.6 +O 0.85 0.75 0.65 +Mg 0.8 0.7 0.7 +O 0.85 0.75 0.75 +Mg 0.8 0.7 0.8 +O 0.85 0.75 0.85 +Mg 0.8 0.7 0.9 +O 0.85 0.75 0.95 +Mg 0.8 0.8 0.0 +O 0.85 0.85 0.05 +Mg 0.8 0.8 0.1 +O 0.85 0.85 0.15 +Mg 0.8 0.8 0.2 +O 0.85 0.85 0.25 +Mg 0.8 0.8 0.3 +O 0.85 0.85 0.35 +Mg 0.8 0.8 0.4 +O 0.85 0.85 0.45 +Mg 0.8 0.8 0.5 +O 0.85 0.85 0.55 +Mg 0.8 0.8 0.6 +O 0.85 0.85 0.65 +Mg 0.8 0.8 0.7 +O 0.85 0.85 0.75 +Mg 0.8 0.8 0.8 +O 0.85 0.85 0.85 +Mg 0.8 0.8 0.9 +O 0.85 0.85 0.95 +Mg 0.8 0.9 0.0 +O 0.85 0.95 0.05 +Mg 0.8 0.9 0.1 +O 0.85 0.95 0.15 +Mg 0.8 0.9 0.2 +O 0.85 0.95 0.25 +Mg 0.8 0.9 0.3 +O 0.85 0.95 0.35 +Mg 0.8 0.9 0.4 +O 0.85 0.95 0.45 +Mg 0.8 0.9 0.5 +O 0.85 0.95 0.55 +Mg 0.8 0.9 0.6 +O 0.85 0.95 0.65 +Mg 0.8 0.9 0.7 +O 0.85 0.95 0.75 +Mg 0.8 0.9 0.8 +O 0.85 0.95 0.85 +Mg 0.8 0.9 0.9 +O 0.85 0.95 0.95 +Mg 0.9 0.0 0.0 +O 0.95 0.05 0.05 +Mg 0.9 0.0 0.1 +O 0.95 0.05 0.15 +Mg 0.9 0.0 0.2 +O 0.95 0.05 0.25 +Mg 0.9 0.0 0.3 +O 0.95 0.05 0.35 +Mg 0.9 0.0 0.4 +O 0.95 0.05 0.45 +Mg 0.9 0.0 0.5 +O 0.95 0.05 0.55 +Mg 0.9 0.0 0.6 +O 0.95 0.05 0.65 +Mg 0.9 0.0 0.7 +O 0.95 0.05 0.75 +Mg 0.9 0.0 0.8 +O 0.95 0.05 0.85 +Mg 0.9 0.0 0.9 +O 0.95 0.05 0.95 +Mg 0.9 0.1 0.0 +O 0.95 0.15 0.05 +Mg 0.9 0.1 0.1 +O 0.95 0.15 0.15 +Mg 0.9 0.1 0.2 +O 0.95 0.15 0.25 +Mg 0.9 0.1 0.3 +O 0.95 0.15 0.35 +Mg 0.9 0.1 0.4 +O 0.95 0.15 0.45 +Mg 0.9 0.1 0.5 +O 0.95 0.15 0.55 +Mg 0.9 0.1 0.6 +O 0.95 0.15 0.65 +Mg 0.9 0.1 0.7 +O 0.95 0.15 0.75 +Mg 0.9 0.1 0.8 +O 0.95 0.15 0.85 +Mg 0.9 0.1 0.9 +O 0.95 0.15 0.95 +Mg 0.9 0.2 0.0 +O 0.95 0.25 0.05 +Mg 0.9 0.2 0.1 +O 0.95 0.25 0.15 +Mg 0.9 0.2 0.2 +O 0.95 0.25 0.25 +Mg 0.9 0.2 0.3 +O 0.95 0.25 0.35 +Mg 0.9 0.2 0.4 +O 0.95 0.25 0.45 +Mg 0.9 0.2 0.5 +O 0.95 0.25 0.55 +Mg 0.9 0.2 0.6 +O 0.95 0.25 0.65 +Mg 0.9 0.2 0.7 +O 0.95 0.25 0.75 +Mg 0.9 0.2 0.8 +O 0.95 0.25 0.85 +Mg 0.9 0.2 0.9 +O 0.95 0.25 0.95 +Mg 0.9 0.3 0.0 +O 0.95 0.35 0.05 +Mg 0.9 0.3 0.1 +O 0.95 0.35 0.15 +Mg 0.9 0.3 0.2 +O 0.95 0.35 0.25 +Mg 0.9 0.3 0.3 +O 0.95 0.35 0.35 +Mg 0.9 0.3 0.4 +O 0.95 0.35 0.45 +Mg 0.9 0.3 0.5 +O 0.95 0.35 0.55 +Mg 0.9 0.3 0.6 +O 0.95 0.35 0.65 +Mg 0.9 0.3 0.7 +O 0.95 0.35 0.75 +Mg 0.9 0.3 0.8 +O 0.95 0.35 0.85 +Mg 0.9 0.3 0.9 +O 0.95 0.35 0.95 +Mg 0.9 0.4 0.0 +O 0.95 0.45 0.05 +Mg 0.9 0.4 0.1 +O 0.95 0.45 0.15 +Mg 0.9 0.4 0.2 +O 0.95 0.45 0.25 +Mg 0.9 0.4 0.3 +O 0.95 0.45 0.35 +Mg 0.9 0.4 0.4 +O 0.95 0.45 0.45 +Mg 0.9 0.4 0.5 +O 0.95 0.45 0.55 +Mg 0.9 0.4 0.6 +O 0.95 0.45 0.65 +Mg 0.9 0.4 0.7 +O 0.95 0.45 0.75 +Mg 0.9 0.4 0.8 +O 0.95 0.45 0.85 +Mg 0.9 0.4 0.9 +O 0.95 0.45 0.95 +Mg 0.9 0.5 0.0 +O 0.95 0.55 0.05 +Mg 0.9 0.5 0.1 +O 0.95 0.55 0.15 +Mg 0.9 0.5 0.2 +O 0.95 0.55 0.25 +Mg 0.9 0.5 0.3 +O 0.95 0.55 0.35 +Mg 0.9 0.5 0.4 +O 0.95 0.55 0.45 +Mg 0.9 0.5 0.5 +O 0.95 0.55 0.55 +Mg 0.9 0.5 0.6 +O 0.95 0.55 0.65 +Mg 0.9 0.5 0.7 +O 0.95 0.55 0.75 +Mg 0.9 0.5 0.8 +O 0.95 0.55 0.85 +Mg 0.9 0.5 0.9 +O 0.95 0.55 0.95 +Mg 0.9 0.6 0.0 +O 0.95 0.65 0.05 +Mg 0.9 0.6 0.1 +O 0.95 0.65 0.15 +Mg 0.9 0.6 0.2 +O 0.95 0.65 0.25 +Mg 0.9 0.6 0.3 +O 0.95 0.65 0.35 +Mg 0.9 0.6 0.4 +O 0.95 0.65 0.45 +Mg 0.9 0.6 0.5 +O 0.95 0.65 0.55 +Mg 0.9 0.6 0.6 +O 0.95 0.65 0.65 +Mg 0.9 0.6 0.7 +O 0.95 0.65 0.75 +Mg 0.9 0.6 0.8 +O 0.95 0.65 0.85 +Mg 0.9 0.6 0.9 +O 0.95 0.65 0.95 +Mg 0.9 0.7 0.0 +O 0.95 0.75 0.05 +Mg 0.9 0.7 0.1 +O 0.95 0.75 0.15 +Mg 0.9 0.7 0.2 +O 0.95 0.75 0.25 +Mg 0.9 0.7 0.3 +O 0.95 0.75 0.35 +Mg 0.9 0.7 0.4 +O 0.95 0.75 0.45 +Mg 0.9 0.7 0.5 +O 0.95 0.75 0.55 +Mg 0.9 0.7 0.6 +O 0.95 0.75 0.65 +Mg 0.9 0.7 0.7 +O 0.95 0.75 0.75 +Mg 0.9 0.7 0.8 +O 0.95 0.75 0.85 +Mg 0.9 0.7 0.9 +O 0.95 0.75 0.95 +Mg 0.9 0.8 0.0 +O 0.95 0.85 0.05 +Mg 0.9 0.8 0.1 +O 0.95 0.85 0.15 +Mg 0.9 0.8 0.2 +O 0.95 0.85 0.25 +Mg 0.9 0.8 0.3 +O 0.95 0.85 0.35 +Mg 0.9 0.8 0.4 +O 0.95 0.85 0.45 +Mg 0.9 0.8 0.5 +O 0.95 0.85 0.55 +Mg 0.9 0.8 0.6 +O 0.95 0.85 0.65 +Mg 0.9 0.8 0.7 +O 0.95 0.85 0.75 +Mg 0.9 0.8 0.8 +O 0.95 0.85 0.85 +Mg 0.9 0.8 0.9 +O 0.95 0.85 0.95 +Mg 0.9 0.9 0.0 +O 0.95 0.95 0.05 +Mg 0.9 0.9 0.1 +O 0.95 0.95 0.15 +Mg 0.9 0.9 0.2 +O 0.95 0.95 0.25 +Mg 0.9 0.9 0.3 +O 0.95 0.95 0.35 +Mg 0.9 0.9 0.4 +O 0.95 0.95 0.45 +Mg 0.9 0.9 0.5 +O 0.95 0.95 0.55 +Mg 0.9 0.9 0.6 +O 0.95 0.95 0.65 +Mg 0.9 0.9 0.7 +O 0.95 0.95 0.75 +Mg 0.9 0.9 0.8 +O 0.95 0.95 0.85 +Mg 0.9 0.9 0.9 +O 0.95 0.95 0.95 +K_POINTS automatic +1 1 1 1 1 1 diff --git a/tests/apps/miniDFT/tests/benchmark/run b/tests/apps/miniDFT/tests/benchmark/run new file mode 100755 index 0000000000..f2fe35ad36 --- /dev/null +++ b/tests/apps/miniDFT/tests/benchmark/run @@ -0,0 +1,38 @@ +#!/bin/sh + +. /opt/ohpc/pub/compiler/intel/composer_xe_2013_sp1.2.144/bin/compilervars.sh intel64 +. /opt/ohpc/pub/mpi/impi/4.1.3.048/bin64/mpivars.sh + +exe=../src/mini_dft +val=./validate_minidft.py +in=./single-node.in +out=./single-node.out +err=./single-node.err +log=./single-node.log + +num_ranks_per_node=8 +num_nodes=4 +num_threads=4 +num_iterations=3 + +if [ ! -f $exe ] +then + echo ERROR: $exe file does not exist + exit +fi + +export OMP_NUM_THREADS=$num_threads + +rm -f $out $log $err + +for i in $(seq 1 $num_iterations) +do + for j in $(seq 1 $num_nodes) + do + r=$((j*num_ranks_per_node)) + srun -N $j -n $r $exe -in $in >$out 2>>$err + $val $out >>$log + done +done + +grep "Benchmark_Time:" $log diff --git a/tests/apps/miniDFT/tests/benchmark/run-large.pbs b/tests/apps/miniDFT/tests/benchmark/run-large.pbs new file mode 100644 index 0000000000..0520c3ac26 --- /dev/null +++ b/tests/apps/miniDFT/tests/benchmark/run-large.pbs @@ -0,0 +1,17 @@ +#!/bin/bash + +#PBS -N MiniDFT_lg +#PBS -q regular +#PBS -l mppwidth=10000 +#PBS -l mppnppn=16 +#PBS -l walltime=0:30:00 +#PBS -V +#PBS -j oe + +cd $PBS_O_WORKDIR + +export OMP_NUM_THREADS=1 + +CMD="aprun -n 10000 -N 16 ../src/mini_dft -ntg 5 -in large.in > large.out" +echo $CMD; $CMD; echo + diff --git a/tests/apps/miniDFT/tests/benchmark/run-single.pbs b/tests/apps/miniDFT/tests/benchmark/run-single.pbs new file mode 100644 index 0000000000..8eed430748 --- /dev/null +++ b/tests/apps/miniDFT/tests/benchmark/run-single.pbs @@ -0,0 +1,11 @@ +#!/bin/csh +#PBS -q regular +#PBS -l mppwidth=48 +#PBS -j oe +#PBS -l walltime=00:10:00 +#PBS -N SingleNodeMiniDft +#PBS -V + +cd $PBS_O_WORKDIR + +aprun -n 40 ../src/mini_dft -ntg 5 -in single-node.in > single-node.out diff --git a/tests/apps/miniDFT/tests/benchmark/run_quick b/tests/apps/miniDFT/tests/benchmark/run_quick new file mode 100755 index 0000000000..ca634b1489 --- /dev/null +++ b/tests/apps/miniDFT/tests/benchmark/run_quick @@ -0,0 +1,9 @@ +#!/bin/sh + +. /opt/ohpc/pub/compiler/intel/composer_xe_2013_sp1.2.144/bin/compilervars.sh intel64 +. /opt/ohpc/pub/mpi/impi/4.1.3.048/bin64/mpivars.sh + +export OMP_NUM_THREADS=4 + +srun -n 32 -N 4 ../src/mini_dft -in single-node.in > single-node.out +./validate_minidft.py single-node.out diff --git a/tests/apps/miniDFT/tests/benchmark/single-node.in b/tests/apps/miniDFT/tests/benchmark/single-node.in new file mode 100644 index 0000000000..109ecf48cd --- /dev/null +++ b/tests/apps/miniDFT/tests/benchmark/single-node.in @@ -0,0 +1,203 @@ +&control +prefix = 'titania' +calculation = 'scf' +restart_mode = 'from_scratch' +wf_collect = .false. +disk_io = 'none' +tstress = .false. +tprnfor = .false. +outdir = './' +wfcdir = './' +pseudo_dir = './' +/ +&system +ibrav = 0 +celldm(1) = 8.7671 +nat = 162 +ntyp = 2 +nbnd = 648 +ecutwfc = 120 +/ +&electrons +startingwfc='atomic' +electron_maxstep = 1 +conv_thr = 1.0d-4 +mixing_mode = 'plain' +mixing_beta = 0.7 +mixing_ndim = 8 +diagonalization = 'david' +diago_david_ndim = 4 +diago_full_acc = .false. +/ +CELL_PARAMETERS +3.0 0.0 0.0 +0.0 3.0 0.0 +0.0 0.0 1.915764 +ATOMIC_SPECIES +Ti 47.867 Ti.pbe.nml +O 15.9994 O.pbe.nml +ATOMIC_POSITIONS crystal +Ti 0.0 0.0 0.0 +Ti 0.166666666667 0.166666666667 0.166666666667 +O 0.1016959 0.1016959 0.0 +O -0.1016959 -0.1016959 0.0 +O 0.268362566667 0.0649707666667 0.166666666667 +O 0.0649707666667 0.268362566667 0.166666666667 +Ti 0.0 0.0 0.333333333333 +Ti 0.166666666667 0.166666666667 0.5 +O 0.1016959 0.1016959 0.333333333333 +O -0.1016959 -0.1016959 0.333333333333 +O 0.268362566667 0.0649707666667 0.5 +O 0.0649707666667 0.268362566667 0.5 +Ti 0.0 0.0 0.666666666667 +Ti 0.166666666667 0.166666666667 0.833333333333 +O 0.1016959 0.1016959 0.666666666667 +O -0.1016959 -0.1016959 0.666666666667 +O 0.268362566667 0.0649707666667 0.833333333333 +O 0.0649707666667 0.268362566667 0.833333333333 +Ti 0.0 0.333333333333 0.0 +Ti 0.166666666667 0.5 0.166666666667 +O 0.1016959 0.435029233333 0.0 +O -0.1016959 0.231637433333 0.0 +O 0.268362566667 0.3983041 0.166666666667 +O 0.0649707666667 0.6016959 0.166666666667 +Ti 0.0 0.333333333333 0.333333333333 +Ti 0.166666666667 0.5 0.5 +O 0.1016959 0.435029233333 0.333333333333 +O -0.1016959 0.231637433333 0.333333333333 +O 0.268362566667 0.3983041 0.5 +O 0.0649707666667 0.6016959 0.5 +Ti 0.0 0.333333333333 0.666666666667 +Ti 0.166666666667 0.5 0.833333333333 +O 0.1016959 0.435029233333 0.666666666667 +O -0.1016959 0.231637433333 0.666666666667 +O 0.268362566667 0.3983041 0.833333333333 +O 0.0649707666667 0.6016959 0.833333333333 +Ti 0.0 0.666666666667 0.0 +Ti 0.166666666667 0.833333333333 0.166666666667 +O 0.1016959 0.768362566667 0.0 +O -0.1016959 0.564970766667 0.0 +O 0.268362566667 0.731637433333 0.166666666667 +O 0.0649707666667 0.935029233333 0.166666666667 +Ti 0.0 0.666666666667 0.333333333333 +Ti 0.166666666667 0.833333333333 0.5 +O 0.1016959 0.768362566667 0.333333333333 +O -0.1016959 0.564970766667 0.333333333333 +O 0.268362566667 0.731637433333 0.5 +O 0.0649707666667 0.935029233333 0.5 +Ti 0.0 0.666666666667 0.666666666667 +Ti 0.166666666667 0.833333333333 0.833333333333 +O 0.1016959 0.768362566667 0.666666666667 +O -0.1016959 0.564970766667 0.666666666667 +O 0.268362566667 0.731637433333 0.833333333333 +O 0.0649707666667 0.935029233333 0.833333333333 +Ti 0.333333333333 0.0 0.0 +Ti 0.5 0.166666666667 0.166666666667 +O 0.435029233333 0.1016959 0.0 +O 0.231637433333 -0.1016959 0.0 +O 0.6016959 0.0649707666667 0.166666666667 +O 0.3983041 0.268362566667 0.166666666667 +Ti 0.333333333333 0.0 0.333333333333 +Ti 0.5 0.166666666667 0.5 +O 0.435029233333 0.1016959 0.333333333333 +O 0.231637433333 -0.1016959 0.333333333333 +O 0.6016959 0.0649707666667 0.5 +O 0.3983041 0.268362566667 0.5 +Ti 0.333333333333 0.0 0.666666666667 +Ti 0.5 0.166666666667 0.833333333333 +O 0.435029233333 0.1016959 0.666666666667 +O 0.231637433333 -0.1016959 0.666666666667 +O 0.6016959 0.0649707666667 0.833333333333 +O 0.3983041 0.268362566667 0.833333333333 +Ti 0.333333333333 0.333333333333 0.0 +Ti 0.5 0.5 0.166666666667 +O 0.435029233333 0.435029233333 0.0 +O 0.231637433333 0.231637433333 0.0 +O 0.6016959 0.3983041 0.166666666667 +O 0.3983041 0.6016959 0.166666666667 +Ti 0.333333333333 0.333333333333 0.333333333333 +Ti 0.5 0.5 0.5 +O 0.435029233333 0.435029233333 0.333333333333 +O 0.231637433333 0.231637433333 0.333333333333 +O 0.6016959 0.3983041 0.5 +O 0.3983041 0.6016959 0.5 +Ti 0.333333333333 0.333333333333 0.666666666667 +Ti 0.5 0.5 0.833333333333 +O 0.435029233333 0.435029233333 0.666666666667 +O 0.231637433333 0.231637433333 0.666666666667 +O 0.6016959 0.3983041 0.833333333333 +O 0.3983041 0.6016959 0.833333333333 +Ti 0.333333333333 0.666666666667 0.0 +Ti 0.5 0.833333333333 0.166666666667 +O 0.435029233333 0.768362566667 0.0 +O 0.231637433333 0.564970766667 0.0 +O 0.6016959 0.731637433333 0.166666666667 +O 0.3983041 0.935029233333 0.166666666667 +Ti 0.333333333333 0.666666666667 0.333333333333 +Ti 0.5 0.833333333333 0.5 +O 0.435029233333 0.768362566667 0.333333333333 +O 0.231637433333 0.564970766667 0.333333333333 +O 0.6016959 0.731637433333 0.5 +O 0.3983041 0.935029233333 0.5 +Ti 0.333333333333 0.666666666667 0.666666666667 +Ti 0.5 0.833333333333 0.833333333333 +O 0.435029233333 0.768362566667 0.666666666667 +O 0.231637433333 0.564970766667 0.666666666667 +O 0.6016959 0.731637433333 0.833333333333 +O 0.3983041 0.935029233333 0.833333333333 +Ti 0.666666666667 0.0 0.0 +Ti 0.833333333333 0.166666666667 0.166666666667 +O 0.768362566667 0.1016959 0.0 +O 0.564970766667 -0.1016959 0.0 +O 0.935029233333 0.0649707666667 0.166666666667 +O 0.731637433333 0.268362566667 0.166666666667 +Ti 0.666666666667 0.0 0.333333333333 +Ti 0.833333333333 0.166666666667 0.5 +O 0.768362566667 0.1016959 0.333333333333 +O 0.564970766667 -0.1016959 0.333333333333 +O 0.935029233333 0.0649707666667 0.5 +O 0.731637433333 0.268362566667 0.5 +Ti 0.666666666667 0.0 0.666666666667 +Ti 0.833333333333 0.166666666667 0.833333333333 +O 0.768362566667 0.1016959 0.666666666667 +O 0.564970766667 -0.1016959 0.666666666667 +O 0.935029233333 0.0649707666667 0.833333333333 +O 0.731637433333 0.268362566667 0.833333333333 +Ti 0.666666666667 0.333333333333 0.0 +Ti 0.833333333333 0.5 0.166666666667 +O 0.768362566667 0.435029233333 0.0 +O 0.564970766667 0.231637433333 0.0 +O 0.935029233333 0.3983041 0.166666666667 +O 0.731637433333 0.6016959 0.166666666667 +Ti 0.666666666667 0.333333333333 0.333333333333 +Ti 0.833333333333 0.5 0.5 +O 0.768362566667 0.435029233333 0.333333333333 +O 0.564970766667 0.231637433333 0.333333333333 +O 0.935029233333 0.3983041 0.5 +O 0.731637433333 0.6016959 0.5 +Ti 0.666666666667 0.333333333333 0.666666666667 +Ti 0.833333333333 0.5 0.833333333333 +O 0.768362566667 0.435029233333 0.666666666667 +O 0.564970766667 0.231637433333 0.666666666667 +O 0.935029233333 0.3983041 0.833333333333 +O 0.731637433333 0.6016959 0.833333333333 +Ti 0.666666666667 0.666666666667 0.0 +Ti 0.833333333333 0.833333333333 0.166666666667 +O 0.768362566667 0.768362566667 0.0 +O 0.564970766667 0.564970766667 0.0 +O 0.935029233333 0.731637433333 0.166666666667 +O 0.731637433333 0.935029233333 0.166666666667 +Ti 0.666666666667 0.666666666667 0.333333333333 +Ti 0.833333333333 0.833333333333 0.5 +O 0.768362566667 0.768362566667 0.333333333333 +O 0.564970766667 0.564970766667 0.333333333333 +O 0.935029233333 0.731637433333 0.5 +O 0.731637433333 0.935029233333 0.5 +Ti 0.666666666667 0.666666666667 0.666666666667 +Ti 0.833333333333 0.833333333333 0.833333333333 +O 0.768362566667 0.768362566667 0.666666666667 +O 0.564970766667 0.564970766667 0.666666666667 +O 0.935029233333 0.731637433333 0.833333333333 +O 0.731637433333 0.935029233333 0.833333333333 +K_POINTS automatic +1 1 1 1 1 1 diff --git a/tests/apps/miniDFT/tests/benchmark/validate_minidft.py b/tests/apps/miniDFT/tests/benchmark/validate_minidft.py new file mode 100755 index 0000000000..32ea920312 --- /dev/null +++ b/tests/apps/miniDFT/tests/benchmark/validate_minidft.py @@ -0,0 +1,144 @@ +#!/usr/bin/env python +#usage: validate_minidft.py filename + +import sys + +#parse options (just filenames) +print_usage = False +if( len(sys.argv) < 2 ): + print "Please provide the name of the file you want to validate." + print_usage=True +else: + for a in sys.argv[1:]: + if( a=="-h" or a=="--help" ): print_usage=True +if( print_usage==True ): + print "Usage: validate_minidft.py filename" + print "Options:" + print " -h, --help: Show this help message" + exit(0) + +try: + fname = sys.argv[1] + f = open( fname, 'r' ) +except: + print "The requested file (", fname, ") cannot be opened." + exit(0) + +#determine which benchmark is being tested +measured = {} +for L in f: + + if( "number of atoms/cell" in L ): + measured['nat'] = int( L.split("=")[1] ) + continue + + if( "number of electrons" in L ): + measured['nel'] = float( L.split("=")[1] ) + continue + + if( "number of Kohn-Sham states" in L ): + measured['nks'] = int( L.split("=")[1] ) + continue + + if( "kinetic-energy cutoff" in L ): + measured['gcut'] = float( L.split("=")[1].split()[0] ) + continue + + if( "number of atomic types" in L ): + measured['nsp'] = int( L.split("=")[1] ) + continue + + if( "atomic species valence mass pseudopotential" in L ): + measured['sp'] = [] + for i in range( measured['nsp'] ): + L = f.next() + measured['sp'].append( L ) + #end for i + continue + + #Etot will be overwritten after each SCF cycle + if( "total energy" in L ): + if( "The total energy is the sum" in L ): continue + L = L[1:] #pop the leading "!" that appears when SCF converges + measured['Etot'] = float( L.split("=")[1].split()[0] ) + continue + + if( "Benchmark_Time" in L ): + Ntime_str = L.split()[4] + Ntime_h = 0.0 + if( 'h' in Ntime_str ): + Ntime_h, Ntime_str = Ntime_str.split('h') + Ntime_h = float(Ntime_h) + Ntime_m = 0.0 + if( 'm' in Ntime_str ): + Ntime_m, Ntime_str = Ntime_str.split('m') + Ntime_m = float(Ntime_m) + Ntime_s = 0.0 + if( 's' in Ntime_str ): + Ntime_s, Ntime_str = Ntime_str.split('s') + Ntime_s = float(Ntime_s) + measured['Ntime'] = ( ( Ntime_h ) * 60 + Ntime_m ) * 60 + Ntime_s + continue + +#end for L in f +f.close() + +#define reference cases +reference = {} + +reference['titania'] = { 'input': 'titania_3_120.in', + 'Etot': -9738.99021176, + 'nat' : 162, + 'nel' : 1296, + 'nks' : 648, + 'gcut': 120.0, + 'sp' : [' Ti 12.00 47.86700 Ti( 1.00)\n', + ' O 6.00 15.99940 O( 1.00)\n' ] + } + +reference['magnesia'] = { 'input': 'magnesia_10_130.in', + 'Etot': -33817.52389012, + 'nat' : 2000, + 'nel' : 8000, + 'nks' : 4000, + 'gcut': 130.0, + 'sp' : [' Mg 2.00 24.30500 Mg( 1.00)\n', + ' O 6.00 15.99900 O( 1.00)\n' ] + } + +#match job characteristics to benchmark +for refid in reference: + refdat = reference[refid] + + ref_eq_meas = True + for k in ['nat','nel','nks','gcut','sp']: + ref_eq_meas &= ( measured[k] == refdat[k] ) + + if( ref_eq_meas ): break +#end for refid + +if( ref_eq_meas ): + print "Identified benchmark:", refdat['input'] +else: + print "Error: could not find corresponding benchmark" + exit() + +#check accuracy ( computed, expected, difference, tolerance, pass/fail ) +dEtot = abs( refdat['Etot'] - measured['Etot'] ) +dEtol = 1.0e-6 +print "Reference Energy: %15.8f Ry" % refdat['Etot'] +print "Computed Energy: %15.8f Ry" % measured['Etot'] +print " Abs Err: %15.8f Ry" % dEtot +print " Tolerance: %15.8f Ry" % dEtol +if( dEtot < dEtol ): + print "PASS" +else: + print "FAIL" + +#print time +print "Benchmark_Time:", measured['Ntime'], "seconds" + + + + + diff --git a/tests/apps/miniDFT/tests/build b/tests/apps/miniDFT/tests/build new file mode 100755 index 0000000000..e49c499f25 --- /dev/null +++ b/tests/apps/miniDFT/tests/build @@ -0,0 +1,29 @@ +#!../../../common/bats/bin/bats +# -*-sh-*- + +load ../../../common/test_helper_functions || exit 1 +source ../../../common/functions || exit 1 + +if [ -s ./TEST_ENV ];then + source ./TEST_ENV +else + ERROR "missing TEST_ENV" +fi + +@test "[Apps/MiniDFT] build MiniDFT executable ($LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + # force delete exe + rm -f $TEST_EXE $TEST_EXE.$LMOD_FAMILY_COMPILER.$LMOD_FAMILY_MPI >& /dev/null + + # build exe + pushd src >& /dev/null + make -f Makefile.ohpc clean >& /dev/null + make -f Makefile.ohpc >& /dev/null + popd >& /dev/null + + if [ ! -s $TEST_EXE ];then + flunk "failed to create $TEST_EXE" + fi + + # rename exe + cp -f $TEST_EXE $TEST_EXE.$LMOD_FAMILY_COMPILER.$LMOD_FAMILY_MPI +} diff --git a/tests/apps/miniDFT/tests/espresso/README_espresso b/tests/apps/miniDFT/tests/espresso/README_espresso new file mode 100644 index 0000000000..ebb9466ad4 --- /dev/null +++ b/tests/apps/miniDFT/tests/espresso/README_espresso @@ -0,0 +1,11 @@ +This directory provides Quantum Espresso input files that are equivalent +to the MiniDFT benchmark calculations. Although the input options for +MiniDFT reproduce those of QE, MiniDFT uses a different format for +pseudopotential files because miniDFT does not include QE's I/O toolkit. + +MiniDFT developers should use these input files to ensure that the Mini-DFT mini-app reproduces both the physics and the computational profile of the full-application (i.e. Quantum Espresso.) + +The QE documention includes instructions for building QE. The README +file in this directory describes the procedure for running the miniDFT +benchmark calculations. The same instructions can be followed using the +pw.x executable from the QE package. diff --git a/tests/apps/miniDFT/tests/espresso/benchmark/Mg.pz-bhs.UPF b/tests/apps/miniDFT/tests/espresso/benchmark/Mg.pz-bhs.UPF new file mode 100644 index 0000000000..7f537b8500 --- /dev/null +++ b/tests/apps/miniDFT/tests/espresso/benchmark/Mg.pz-bhs.UPF @@ -0,0 +1,793 @@ + +Generated using BHS code +Author: BHS Generation date: 1982 +Info: See Bachelet-Hamann-Schlueter paper: PRB26, 4199 (1982) + 0 The Pseudo was generated with a Non-Relativistic Calculation + 0.00000000000E+00 Local Potential cutoff radius +nl pn l occ Rcut Rcut US E pseu +3S 0 0 2.00 0.00000000000 0.00000000000 0.00000000000 +3P 0 1 0.00 0.00000000000 0.00000000000 0.00000000000 + + + + + 0 Version Number + Mg Element + NC Norm - Conserving pseudopotential + F Nonlinear Core Correction + SLA PZ NOGX NOGC PZ Exchange-Correlation functional + 2.00000000000 Z valence + 0.00000000000 Total energy + 0.0000000 0.0000000 Suggested cutoff for wfc and rho + 0 Max angular momentum component + 425 Number of points in mesh + 2 1 Number of Wavefunctions, Number of Projectors + Wavefunctions nl l occ + 3S 0 2.00 + 3P 1 0.00 + + + + + + 1.52630324073E-03 1.56494179122E-03 1.60455848128E-03 1.64517807262E-03 + 1.68682595382E-03 1.72952815614E-03 1.77331136986E-03 1.81820296092E-03 + 1.86423098801E-03 1.91142422016E-03 1.95981215467E-03 2.00942503557E-03 + 2.06029387253E-03 2.11245046023E-03 2.16592739823E-03 2.22075811136E-03 + 2.27697687061E-03 2.33461881452E-03 2.39371997119E-03 2.45431728076E-03 + 2.51644861853E-03 2.58015281860E-03 2.64546969817E-03 2.71244008243E-03 + 2.78110583003E-03 2.85150985931E-03 2.92369617507E-03 2.99770989612E-03 + 3.07359728344E-03 3.15140576911E-03 3.23118398598E-03 3.31298179802E-03 + 3.39685033153E-03 3.48284200708E-03 3.57101057225E-03 3.66141113528E-03 + 3.75410019946E-03 3.84913569847E-03 3.94657703260E-03 4.04648510583E-03 + 4.14892236399E-03 4.25395283368E-03 4.36164216237E-03 4.47205765939E-03 + 4.58526833803E-03 4.70134495865E-03 4.82036007290E-03 4.94238806912E-03 + 5.06750521877E-03 5.19578972414E-03 5.32732176723E-03 5.46218355984E-03 + 5.60045939498E-03 5.74223569956E-03 5.88760108837E-03 6.03664641952E-03 + 6.18946485119E-03 6.34615189988E-03 6.50680550010E-03 6.67152606556E-03 + 6.84041655199E-03 7.01358252144E-03 7.19113220828E-03 7.37317658684E-03 + 7.55982944078E-03 7.75120743422E-03 7.94743018463E-03 8.14862033761E-03 + 8.35490364357E-03 8.56640903627E-03 8.78326871349E-03 9.00561821957E-03 + 9.23359653019E-03 9.46734613923E-03 9.70701314779E-03 9.95274735556E-03 + 1.02047023544E-02 1.04630356244E-02 1.07279086323E-02 1.09994869323E-02 + 1.12779402697E-02 1.15634426869E-02 1.18561726322E-02 1.21563130714E-02 + 1.24640516019E-02 1.27795805704E-02 1.31030971928E-02 1.34348036775E-02 + 1.37749073518E-02 1.41236207916E-02 1.44811619542E-02 1.48477543144E-02 + 1.52236270044E-02 1.56090149568E-02 1.60041590517E-02 1.64093062670E-02 + 1.68247098329E-02 1.72506293901E-02 1.76873311522E-02 1.81350880721E-02 + 1.85941800124E-02 1.90648939204E-02 1.95475240078E-02 2.00423719340E-02 + 2.05497469951E-02 2.10699663171E-02 2.16033550538E-02 2.21502465907E-02 + 2.27109827528E-02 2.32859140185E-02 2.38753997383E-02 2.44798083603E-02 + 2.50995176594E-02 2.57349149740E-02 2.63863974483E-02 2.70543722799E-02 + 2.77392569748E-02 2.84414796084E-02 2.91614790926E-02 2.98997054505E-02 + 3.06566200976E-02 3.14326961303E-02 3.22284186212E-02 3.30442849229E-02 + 3.38808049784E-02 3.47385016399E-02 3.56179109957E-02 3.65195827054E-02 + 3.74440803431E-02 3.83919817499E-02 3.93638793951E-02 4.03603807463E-02 + 4.13821086493E-02 4.24297017173E-02 4.35038147301E-02 4.46051190432E-02 + 4.57343030078E-02 4.68920724006E-02 4.80791508650E-02 4.92962803639E-02 + 5.05442216427E-02 5.18237547054E-02 5.31356793018E-02 5.44808154275E-02 + 5.58600038363E-02 5.72741065659E-02 5.87240074766E-02 6.02106128035E-02 + 6.17348517235E-02 6.32976769354E-02 6.49000652560E-02 6.65430182299E-02 + 6.82275627565E-02 6.99547517308E-02 7.17256647021E-02 7.35414085487E-02 + 7.54031181697E-02 7.73119571940E-02 7.92691187084E-02 8.12758260024E-02 + 8.33333333333E-02 8.54429267104E-02 8.76059246980E-02 8.98236792404E-02 + 9.20975765063E-02 9.44290377556E-02 9.68195202274E-02 9.92705180510E-02 + 1.01783563180E-01 1.04360226349E-01 1.07002118057E-01 1.09710889572E-01 + 1.12488233965E-01 1.15335887165E-01 1.18255629049E-01 1.21249284552E-01 + 1.24318724803E-01 1.27465868305E-01 1.30692682124E-01 1.34001183124E-01 + 1.37393439225E-01 1.40871570698E-01 1.44437751489E-01 1.48094210576E-01 + 1.51843233366E-01 1.55687163119E-01 1.59628402418E-01 1.63669414664E-01 + 1.67812725623E-01 1.72060924997E-01 1.76416668051E-01 1.80882677265E-01 + 1.85461744041E-01 1.90156730444E-01 1.94970570994E-01 1.99906274497E-01 + 2.04966925930E-01 2.10155688363E-01 2.15475804943E-01 2.20930600915E-01 + 2.26523485705E-01 2.32257955047E-01 2.38137593172E-01 2.44166075044E-01 + 2.50347168662E-01 2.56684737410E-01 2.63182742474E-01 2.69845245320E-01 + 2.76676410228E-01 2.83680506899E-01 2.90861913122E-01 2.98225117508E-01 + 3.05774722302E-01 3.13515446250E-01 3.21452127558E-01 3.29589726910E-01 + 3.37933330570E-01 3.46488153563E-01 3.55259542931E-01 3.64252981077E-01 + 3.73474089195E-01 3.82928630776E-01 3.92622515216E-01 4.02561801509E-01 + 4.12752702033E-01 4.23201586432E-01 4.33914985598E-01 4.44899595756E-01 + 4.56162282644E-01 4.67710085808E-01 4.79550223000E-01 4.91690094693E-01 + 5.04137288701E-01 5.16899584925E-01 5.29984960217E-01 5.43401593361E-01 + 5.57157870190E-01 5.71262388825E-01 5.85723965049E-01 6.00551637818E-01 + 6.15754674911E-01 6.31342578720E-01 6.47325092192E-01 6.63712204920E-01 + 6.80514159381E-01 6.97741457344E-01 7.15404866431E-01 7.33515426849E-01 + 7.52084458286E-01 7.71123566992E-01 7.90644653030E-01 8.10659917713E-01 + 8.31181871235E-01 8.52223340483E-01 8.73797477061E-01 8.95917765506E-01 + 9.18598031720E-01 9.41852451607E-01 9.65695559935E-01 9.90142259425E-01 + 1.01520783006E+00 1.04090793863E+00 1.06725864856E+00 1.09427642987E+00 + 1.12197816958E+00 1.15038118217E+00 1.17950322045E+00 1.20936248663E+00 + 1.23997764374E+00 1.27136782724E+00 1.30355265702E+00 1.33655224964E+00 + 1.37038723092E+00 1.40507874884E+00 1.44064848671E+00 1.47711867679E+00 + 1.51451211412E+00 1.55285217082E+00 1.59216281069E+00 1.63246860413E+00 + 1.67379474360E+00 1.71616705927E+00 1.75961203521E+00 1.80415682596E+00 + 1.84982927345E+00 1.89665792446E+00 1.94467204841E+00 1.99390165570E+00 + 2.04437751643E+00 2.09613117965E+00 2.14919499310E+00 2.20360212338E+00 + 2.25938657672E+00 2.31658322022E+00 2.37522780365E+00 2.43535698177E+00 + 2.49700833728E+00 2.56022040429E+00 2.62503269240E+00 2.69148571138E+00 + 2.75962099656E+00 2.82948113469E+00 2.90110979063E+00 2.97455173464E+00 + 3.04985287031E+00 3.12706026330E+00 3.20622217075E+00 3.28738807143E+00 + 3.37060869667E+00 3.45593606207E+00 3.54342350001E+00 3.63312569298E+00 + 3.72509870778E+00 3.81940003053E+00 3.91608860263E+00 4.01522485759E+00 + 4.11687075879E+00 4.22108983824E+00 4.32794723624E+00 4.43750974214E+00 + 4.54984583610E+00 4.66502573180E+00 4.78312142045E+00 4.90420671570E+00 + 5.02835729978E+00 5.15565077086E+00 5.28616669151E+00 5.41998663842E+00 + 5.55719425341E+00 5.69787529571E+00 5.84211769556E+00 5.99001160914E+00 + 6.14164947497E+00 6.29712607164E+00 6.45653857711E+00 6.61998662936E+00 + 6.78757238875E+00 6.95940060184E+00 7.13557866685E+00 7.31621670081E+00 + 7.50142760838E+00 7.69132715239E+00 7.88603402624E+00 8.08566992808E+00 + 8.29035963683E+00 8.50023109022E+00 8.71541546476E+00 8.93604725767E+00 + 9.16226437101E+00 9.39420819784E+00 9.63202371060E+00 9.87585955173E+00 + 1.01258681266E+01 1.03822056986E+01 1.06450324872E+01 1.09145127676E+01 + 1.11908149737E+01 1.14741118036E+01 1.17645803268E+01 1.20624020957E+01 + 1.23677632585E+01 1.26808546761E+01 1.30018720405E+01 1.33310159983E+01 + 1.36684922750E+01 1.40145118043E+01 1.43692908597E+01 1.47330511897E+01 + 1.51060201563E+01 1.54884308772E+01 1.58805223716E+01 1.62825397094E+01 + 1.66947341646E+01 1.71173633721E+01 1.75506914889E+01 1.79949893592E+01 + 1.84505346837E+01 1.89176121929E+01 1.93965138256E+01 1.98875389109E+01 + 2.03909943554E+01 2.09071948351E+01 2.14364629921E+01 2.19791296364E+01 + 2.25355339522E+01 2.31060237103E+01 2.36909554853E+01 2.42906948788E+01 + 2.49056167473E+01 2.55361054369E+01 2.61825550238E+01 2.68453695599E+01 + 2.75249633258E+01 2.82217610898E+01 2.89361983732E+01 2.96687217226E+01 + 3.04197889888E+01 3.11898696134E+01 3.19794449218E+01 3.27890084243E+01 + 3.36190661244E+01 3.44701368353E+01 3.53427525037E+01 3.62374585430E+01 + 3.71548141735E+01 3.80953927724E+01 3.90597822319E+01 4.00485853267E+01 + 4.10624200911E+01 4.21019202047E+01 4.31677353890E+01 4.42605318132E+01 + 4.53809925105E+01 4.65298178054E+01 4.77077257511E+01 4.89154525785E+01 + 5.01537531560E+01 5.14234014619E+01 5.27251910677E+01 5.40599356342E+01 + 5.54284694204E+01 5.68316478042E+01 5.82703478180E+01 5.97454686960E+01 + 6.12579324368E+01 + + + 3.81575810182E-05 3.91235447806E-05 4.01139620321E-05 4.11294518156E-05 + 4.21706488454E-05 4.32382039035E-05 4.43327842466E-05 4.54550740230E-05 + 4.66057747003E-05 4.77856055040E-05 4.89953038667E-05 5.02356258892E-05 + 5.15073468132E-05 5.28112615057E-05 5.41481849557E-05 5.55189527841E-05 + 5.69244217652E-05 5.83654703630E-05 5.98429992797E-05 6.13579320190E-05 + 6.29112154632E-05 6.45038204650E-05 6.61367424543E-05 6.78110020606E-05 + 6.95276457507E-05 7.12877464826E-05 7.30924043768E-05 7.49427474030E-05 + 7.68399320859E-05 7.87851442278E-05 8.07795996494E-05 8.28245449505E-05 + 8.49212582883E-05 8.70710501769E-05 8.92752643063E-05 9.15352783821E-05 + 9.38525049866E-05 9.62283924618E-05 9.86644258149E-05 1.01162127646E-04 + 1.03723059100E-04 1.06348820842E-04 1.09041054059E-04 1.11801441485E-04 + 1.14631708451E-04 1.17533623966E-04 1.20509001823E-04 1.23559701728E-04 + 1.26687630469E-04 1.29894743103E-04 1.33183044181E-04 1.36554588996E-04 + 1.40011484874E-04 1.43555892489E-04 1.47190027209E-04 1.50916160488E-04 + 1.54736621280E-04 1.58653797497E-04 1.62670137502E-04 1.66788151639E-04 + 1.71010413800E-04 1.75339563036E-04 1.79778305207E-04 1.84329414671E-04 + 1.88995736020E-04 1.93780185856E-04 1.98685754616E-04 2.03715508440E-04 + 2.08872591089E-04 2.14160225907E-04 2.19581717837E-04 2.25140455489E-04 + 2.30839913255E-04 2.36683653481E-04 2.42675328695E-04 2.48818683889E-04 + 2.55117558860E-04 2.61575890611E-04 2.68197715808E-04 2.74987173308E-04 + 2.81948506743E-04 2.89086067173E-04 2.96404315805E-04 3.03907826784E-04 + 3.11601290047E-04 3.19489514260E-04 3.27577429820E-04 3.35870091937E-04 + 3.44372683795E-04 3.53090519791E-04 3.62029048855E-04 3.71193857860E-04 + 3.80590675110E-04 3.90225373921E-04 4.00103976293E-04 4.10232656675E-04 + 4.20617745822E-04 4.31265734752E-04 4.42183278806E-04 4.53377201803E-04 + 4.64854500309E-04 4.76622348011E-04 4.88688100195E-04 5.01059298351E-04 + 5.13743674878E-04 5.26749157927E-04 5.40083876346E-04 5.53756164769E-04 + 5.67774568821E-04 5.82147850461E-04 5.96884993459E-04 6.11995209007E-04 + 6.27487941484E-04 6.43372874350E-04 6.59659936206E-04 6.76359306997E-04 + 6.93481424371E-04 7.11036990210E-04 7.29036977315E-04 7.47492636262E-04 + 7.66415502441E-04 7.85817403257E-04 8.05710465530E-04 8.26107123073E-04 + 8.47020124460E-04 8.68462540997E-04 8.90447774893E-04 9.12989567635E-04 + 9.36102008578E-04 9.59799543748E-04 9.84096984877E-04 1.00900951866E-03 + 1.03455271623E-03 1.06074254293E-03 1.08759536825E-03 1.11512797608E-03 + 1.14335757520E-03 1.17230181001E-03 1.20197877163E-03 1.23240700910E-03 + 1.26360554107E-03 1.29559386764E-03 1.32839198255E-03 1.36202038569E-03 + 1.39650009591E-03 1.43185266415E-03 1.46810018691E-03 1.50526532009E-03 + 1.54337129309E-03 1.58244192339E-03 1.62250163140E-03 1.66357545575E-03 + 1.70568906891E-03 1.74886879327E-03 1.79314161755E-03 1.83853521372E-03 + 1.88507795424E-03 1.93279892985E-03 1.98172796771E-03 2.03189565006E-03 + 2.08333333333E-03 2.13607316776E-03 2.19014811745E-03 2.24559198101E-03 + 2.30243941266E-03 2.36072594389E-03 2.42048800568E-03 2.48176295128E-03 + 2.54458907950E-03 2.60900565873E-03 2.67505295143E-03 2.74277223931E-03 + 2.81220584912E-03 2.88339717913E-03 2.95639072624E-03 3.03123211379E-03 + 3.10796812009E-03 3.18664670763E-03 3.26731705310E-03 3.35002957810E-03 + 3.43483598063E-03 3.52178926746E-03 3.61094378722E-03 3.70235526440E-03 + 3.79608083415E-03 3.89217907798E-03 3.99071006045E-03 4.09173536660E-03 + 4.19531814056E-03 4.30152312493E-03 4.41041670128E-03 4.52206693163E-03 + 4.63654360103E-03 4.75391826110E-03 4.87426427485E-03 4.99765686243E-03 + 5.12417314824E-03 5.25389220908E-03 5.38689512357E-03 5.52326502288E-03 + 5.66308714262E-03 5.80644887618E-03 5.95343982930E-03 6.10415187611E-03 + 6.25867921656E-03 6.41711843525E-03 6.57956856185E-03 6.74613113300E-03 + 6.91691025570E-03 7.09201267248E-03 7.27154782805E-03 7.45562793771E-03 + 7.64436805754E-03 7.83788615625E-03 8.03630318895E-03 8.23974317275E-03 + 8.44833326426E-03 8.66220383908E-03 8.88148857327E-03 9.10632452694E-03 + 9.33685222987E-03 9.57321576939E-03 9.81556288040E-03 1.00640450377E-02 + 1.03188175508E-02 1.05800396608E-02 1.08478746400E-02 1.11224898939E-02 + 1.14040570661E-02 1.16927521452E-02 1.19887555750E-02 1.22922523673E-02 + 1.26034322175E-02 1.29224896231E-02 1.32496240054E-02 1.35850398340E-02 + 1.39289467547E-02 1.42815597206E-02 1.46430991262E-02 1.50137909455E-02 + 1.53938668728E-02 1.57835644680E-02 1.61831273048E-02 1.65928051230E-02 + 1.70128539845E-02 1.74435364336E-02 1.78851216608E-02 1.83378856712E-02 + 1.88021114572E-02 1.92780891748E-02 1.97661163257E-02 2.02664979428E-02 + 2.07795467809E-02 2.13055835121E-02 2.18449369265E-02 2.23979441377E-02 + 2.29649507930E-02 2.35463112902E-02 2.41423889984E-02 2.47535564856E-02 + 2.53801957515E-02 2.60226984658E-02 2.66814662139E-02 2.73569107469E-02 + 2.80494542396E-02 2.87595295543E-02 2.94875805112E-02 3.02340621658E-02 + 3.09994410935E-02 3.17841956810E-02 3.25888164254E-02 3.34138062409E-02 + 3.42596807731E-02 3.51269687210E-02 3.60162121678E-02 3.69279669197E-02 + 3.78628028530E-02 3.88213042706E-02 3.98040702671E-02 4.08117151033E-02 + 4.18448685900E-02 4.29041764817E-02 4.39903008803E-02 4.51039206490E-02 + 4.62457318363E-02 4.74164481115E-02 4.86168012103E-02 4.98475413924E-02 + 5.11094379106E-02 5.24032794913E-02 5.37298748275E-02 5.50900530845E-02 + 5.64846644180E-02 5.79145805056E-02 5.93806950912E-02 6.08839245442E-02 + 6.24252084321E-02 6.40055101073E-02 6.56258173099E-02 6.72871427846E-02 + 6.89905249139E-02 7.07370283672E-02 7.25277447658E-02 7.43637933659E-02 + 7.62463217577E-02 7.81765065825E-02 8.01555542688E-02 8.21847017858E-02 + 8.42652174168E-02 8.63984015517E-02 8.85855875001E-02 9.08281423244E-02 + 9.31274676944E-02 9.54850007632E-02 9.79022150658E-02 1.00380621440E-01 + 1.02921768970E-01 1.05527245956E-01 1.08198680906E-01 1.10937743554E-01 + 1.13746145902E-01 1.16625643295E-01 1.19578035511E-01 1.22605167892E-01 + 1.25708932495E-01 1.28891269272E-01 1.32154167288E-01 1.35499665960E-01 + 1.38929856335E-01 1.42446882393E-01 1.46052942389E-01 1.49750290228E-01 + 1.53541236874E-01 1.57428151791E-01 1.61413464428E-01 1.65499665734E-01 + 1.69689309719E-01 1.73985015046E-01 1.78389466671E-01 1.82905417520E-01 + 1.87535690209E-01 1.92283178810E-01 1.97150850656E-01 2.02141748202E-01 + 2.07258990921E-01 2.12505777256E-01 2.17885386619E-01 2.23401181442E-01 + 2.29056609275E-01 2.34855204946E-01 2.40800592765E-01 2.46896488793E-01 + 2.53146703164E-01 2.59555142465E-01 2.66125812179E-01 2.72862819189E-01 + 2.79770374344E-01 2.86852795089E-01 2.94114508170E-01 3.01560052392E-01 + 3.09194081464E-01 3.17021366901E-01 3.25046801013E-01 3.33275399957E-01 + 3.41712306875E-01 3.50362795108E-01 3.59232271493E-01 3.68326279743E-01 + 3.77650503907E-01 3.87210771929E-01 3.97013059289E-01 4.07063492734E-01 + 4.17368354114E-01 4.27934084302E-01 4.38767287222E-01 4.49874733980E-01 + 4.61263367092E-01 4.72940304823E-01 4.84912845641E-01 4.97188472772E-01 + 5.09774858884E-01 5.22679870877E-01 5.35911574804E-01 5.49478240910E-01 + 5.63388348804E-01 5.77650592757E-01 5.92273887133E-01 6.07267371969E-01 + 6.22640418681E-01 6.38402635924E-01 6.54563875595E-01 6.71134238997E-01 + 6.88124083145E-01 7.05544027246E-01 7.23404959331E-01 7.41718043064E-01 + 7.60494724719E-01 7.79746740334E-01 7.99486123044E-01 8.19725210606E-01 + 8.40476653110E-01 8.61753420881E-01 8.83568812593E-01 9.05936463576E-01 + 9.28870354339E-01 9.52384819310E-01 9.76494555797E-01 1.00121463317E+00 + 1.02656050228E+00 1.05254800512E+00 1.07919338473E+00 1.10651329533E+00 + 1.13452481276E+00 1.16324544514E+00 1.19269314378E+00 1.22288631446E+00 + 1.25384382890E+00 1.28558503655E+00 1.31812977669E+00 1.35149839086E+00 + 1.38571173551E+00 1.42079119511E+00 1.45675869545E+00 1.49363671740E+00 + 1.53144831092E+00 + + + + + + -1.75981408371E+00 -1.75981414086E+00 -1.75981420095E+00 -1.75981426411E+00 + -1.75981433051E+00 -1.75981440032E+00 -1.75981447370E+00 -1.75981455085E+00 + -1.75981463195E+00 -1.75981471721E+00 -1.75981480684E+00 -1.75981490107E+00 + -1.75981500013E+00 -1.75981510427E+00 -1.75981521374E+00 -1.75981532883E+00 + -1.75981544983E+00 -1.75981557702E+00 -1.75981571073E+00 -1.75981585130E+00 + -1.75981599908E+00 -1.75981615444E+00 -1.75981631776E+00 -1.75981648945E+00 + -1.75981666994E+00 -1.75981685969E+00 -1.75981705917E+00 -1.75981726888E+00 + -1.75981748933E+00 -1.75981772109E+00 -1.75981796473E+00 -1.75981822087E+00 + -1.75981849013E+00 -1.75981877320E+00 -1.75981907078E+00 -1.75981938362E+00 + -1.75981971250E+00 -1.75982005824E+00 -1.75982042171E+00 -1.75982080381E+00 + -1.75982120550E+00 -1.75982162778E+00 -1.75982207172E+00 -1.75982253841E+00 + -1.75982302903E+00 -1.75982354481E+00 -1.75982408702E+00 -1.75982465704E+00 + -1.75982525628E+00 -1.75982588624E+00 -1.75982654850E+00 -1.75982724471E+00 + -1.75982797661E+00 -1.75982874603E+00 -1.75982955490E+00 -1.75983040524E+00 + -1.75983129917E+00 -1.75983223893E+00 -1.75983322687E+00 -1.75983426545E+00 + -1.75983535728E+00 -1.75983650507E+00 -1.75983771171E+00 -1.75983898021E+00 + -1.75984031374E+00 -1.75984171562E+00 -1.75984318938E+00 -1.75984473868E+00 + -1.75984636740E+00 -1.75984807961E+00 -1.75984987959E+00 -1.75985177184E+00 + -1.75985376109E+00 -1.75985585230E+00 -1.75985805071E+00 -1.75986036180E+00 + -1.75986279136E+00 -1.75986534545E+00 -1.75986803045E+00 -1.75987085307E+00 + -1.75987382037E+00 -1.75987693975E+00 -1.75988021901E+00 -1.75988366634E+00 + -1.75988729035E+00 -1.75989110009E+00 -1.75989510507E+00 -1.75989931530E+00 + -1.75990374130E+00 -1.75990839410E+00 -1.75991328534E+00 -1.75991842721E+00 + -1.75992383257E+00 -1.75992951489E+00 -1.75993548836E+00 -1.75994176790E+00 + -1.75994836916E+00 -1.75995530863E+00 -1.75996260361E+00 -1.75997027231E+00 + -1.75997833385E+00 -1.75998680834E+00 -1.75999571691E+00 -1.76000508177E+00 + -1.76001492627E+00 -1.76002527496E+00 -1.76003615361E+00 -1.76004758933E+00 + -1.76005961063E+00 -1.76007224743E+00 -1.76008553121E+00 -1.76009949505E+00 + -1.76011417370E+00 -1.76012960369E+00 -1.76014582342E+00 -1.76016287323E+00 + -1.76018079553E+00 -1.76019963486E+00 -1.76021943805E+00 -1.76024025431E+00 + -1.76026213533E+00 -1.76028513545E+00 -1.76030931174E+00 -1.76033472420E+00 + -1.76036143585E+00 -1.76038951291E+00 -1.76041902494E+00 -1.76045004505E+00 + -1.76048265003E+00 -1.76051692054E+00 -1.76055294135E+00 -1.76059080146E+00 + -1.76063059441E+00 -1.76067241841E+00 -1.76071637665E+00 -1.76076257748E+00 + -1.76081113471E+00 -1.76086216786E+00 -1.76091580245E+00 -1.76097217027E+00 + -1.76103140970E+00 -1.76109366607E+00 -1.76115909190E+00 -1.76122784737E+00 + -1.76130010057E+00 -1.76137602799E+00 -1.76145581482E+00 -1.76153965546E+00 + -1.76162775389E+00 -1.76172032413E+00 -1.76181759077E+00 -1.76191978939E+00 + -1.76202716712E+00 -1.76213998318E+00 -1.76225850940E+00 -1.76238303084E+00 + -1.76251384636E+00 -1.76265126928E+00 -1.76279562799E+00 -1.76294726666E+00 + -1.76310654592E+00 -1.76327384359E+00 -1.76344955543E+00 -1.76363409589E+00 + -1.76382789894E+00 -1.76403141888E+00 -1.76424513119E+00 -1.76446953339E+00 + -1.76470514594E+00 -1.76495251318E+00 -1.76521220423E+00 -1.76548481399E+00 + -1.76577096408E+00 -1.76607130387E+00 -1.76638651146E+00 -1.76671729472E+00 + -1.76706439231E+00 -1.76742857475E+00 -1.76781064540E+00 -1.76821144153E+00 + -1.76863183536E+00 -1.76907273506E+00 -1.76953508571E+00 -1.77001987034E+00 + -1.77052811081E+00 -1.77106086869E+00 -1.77161924614E+00 -1.77220438666E+00 + -1.77281747579E+00 -1.77345974171E+00 -1.77413245576E+00 -1.77483693284E+00 + -1.77557453167E+00 -1.77634665490E+00 -1.77715474907E+00 -1.77800030434E+00 + -1.77888485412E+00 -1.77980997434E+00 -1.78077728256E+00 -1.78178843679E+00 + -1.78284513400E+00 -1.78394910835E+00 -1.78510212902E+00 -1.78630599774E+00 + -1.78756254586E+00 -1.78887363111E+00 -1.79024113382E+00 -1.79166695277E+00 + -1.79315300052E+00 -1.79470119835E+00 -1.79631347058E+00 -1.79799173855E+00 + -1.79973791402E+00 -1.80155389217E+00 -1.80344154406E+00 -1.80540270879E+00 + -1.80743918520E+00 -1.80955272331E+00 -1.81174501543E+00 -1.81401768719E+00 + -1.81637228846E+00 -1.81881028430E+00 -1.82133304611E+00 -1.82394184308E+00 + -1.82663783413E+00 -1.82942206048E+00 -1.83229543907E+00 -1.83525875691E+00 + -1.83831266670E+00 -1.84145768373E+00 -1.84469418423E+00 -1.84802240541E+00 + -1.85144244698E+00 -1.85495427440E+00 -1.85855772352E+00 -1.86225250656E+00 + -1.86603821889E+00 -1.86991434611E+00 -1.87388027070E+00 -1.87793527713E+00 + -1.88207855424E+00 -1.88630919315E+00 -1.89062617891E+00 -1.89502837347E+00 + -1.89951448744E+00 -1.90408303754E+00 -1.90873228654E+00 -1.91346016205E+00 + -1.91826415043E+00 -1.92314116209E+00 -1.92808736460E+00 -1.93309798014E+00 + -1.93816704487E+00 -1.94328712822E+00 -1.94844901197E+00 -1.95364132998E+00 + -1.95885017225E+00 -1.96405865877E+00 -1.96924649198E+00 -1.97438949941E+00 + -1.97945918145E+00 -1.98442228235E+00 -1.98924040530E+00 -1.99386969497E+00 + -1.99826061187E+00 -2.00235782326E+00 -2.00610023343E+00 -2.00942117264E+00 + -2.01224875813E+00 -2.01450643258E+00 -2.01611367498E+00 -2.01698686749E+00 + -2.01704028887E+00 -2.01618719334E+00 -2.01434092310E+00 -2.01141599662E+00 + -2.00732911365E+00 -2.00200002427E+00 -1.99535222433E+00 -1.98731346328E+00 + -1.97781608235E+00 -1.96679723850E+00 -1.95419910913E+00 -1.93996920718E+00 + -1.92406096066E+00 -1.90643471590E+00 -1.88705930385E+00 -1.86591425895E+00 + -1.84299269913E+00 -1.81830476814E+00 -1.79188141725E+00 -1.76377817923E+00 + -1.73407848326E+00 -1.70289599844E+00 -1.67037549518E+00 -1.63669179314E+00 + -1.60204652322E+00 -1.56666265885E+00 -1.53077704225E+00 -1.49463140556E+00 + -1.45846262084E+00 -1.42249306163E+00 -1.38692199095E+00 -1.35191879176E+00 + -1.31761863630E+00 -1.28412088406E+00 -1.25149015557E+00 -1.21975970933E+00 + -1.18893650497E+00 -1.15900720417E+00 -1.12994435389E+00 -1.10171210194E+00 + -1.07427097867E+00 -1.04758149717E+00 -1.02160653345E+00 -9.96312613184E-01 + -9.71670334700E-01 -9.47654196909E-01 -9.24242086363E-01 -9.01414629360E-01 + -8.79154551753E-01 -8.57446127876E-01 -8.36274750675E-01 -8.15626621983E-01 + -7.95488543962E-01 -7.75847786631E-01 -7.56692007597E-01 -7.38009204856E-01 + -7.19787689072E-01 -7.02016066554E-01 -6.84683227767E-01 -6.67778338543E-01 + -6.51290832594E-01 -6.35210404636E-01 -6.19527003863E-01 -6.04230827637E-01 + -5.89312315347E-01 -5.74762142439E-01 -5.60571214579E-01 -5.46730661977E-01 + -5.33231833836E-01 -5.20066292949E-01 -5.07225810425E-01 -4.94702360544E-01 + -4.82488115742E-01 -4.70575441719E-01 -4.58956892666E-01 -4.47625206611E-01 + -4.36573300881E-01 -4.25794267677E-01 -4.15281369750E-01 -4.05028036198E-01 + -3.95027858353E-01 -3.85274585779E-01 -3.75762122363E-01 -3.66484522505E-01 + -3.57435987404E-01 -3.48610861431E-01 -3.40003628595E-01 -3.31608909094E-01 + -3.23421455956E-01 -3.15436151757E-01 -3.07648005420E-01 -3.00052149102E-01 + -2.92643835145E-01 -2.85418433111E-01 -2.78371426888E-01 -2.71498411870E-01 + -2.64795092197E-01 -2.58257278076E-01 -2.51880883161E-01 -2.45661921997E-01 + -2.39596507532E-01 -2.33680848683E-01 -2.27911247972E-01 -2.22284099210E-01 + -2.16795885245E-01 -2.11443175767E-01 -2.06222625156E-01 -2.01130970399E-01 + -1.96165029046E-01 -1.91321697222E-01 -1.86597947687E-01 -1.81990827943E-01 + -1.77497458391E-01 -1.73115030529E-01 -1.68840805196E-01 -1.64672110862E-01 + -1.60606341959E-01 -1.56640957247E-01 -1.52773478232E-01 -1.49001487615E-01 + -1.45322627778E-01 -1.41734599314E-01 -1.38235159588E-01 -1.34822121337E-01 + -1.31493351301E-01 -1.28246768890E-01 -1.25080344884E-01 -1.21992100165E-01 + -1.18980104480E-01 -1.16042475233E-01 -1.13177376312E-01 -1.10383016934E-01 + -1.07657650535E-01 -1.04999573673E-01 -1.02407124962E-01 -9.98786840376E-02 + -9.74126705422E-02 -9.50075431370E-02 -9.26617985389E-02 -9.03739705814E-02 + -8.81426292974E-02 -8.59663800260E-02 -8.38438625405E-02 -8.17737501985E-02 + -7.97547491123E-02 -7.77855973406E-02 -7.58650640993E-02 -7.39919489927E-02 + -7.21650812629E-02 -7.03833190581E-02 -6.86455487188E-02 -6.69506840820E-02 + -6.52976658023E-02 + + + + + + 1 0 Beta L + 353 + 7.63599747962E-04 7.82930437316E-04 8.02750467354E-04 8.23072238063E-04 + 8.43908493859E-04 8.65272208795E-04 8.87176739637E-04 9.09635825854E-04 + 9.32663436548E-04 9.56274038356E-04 9.80482327532E-04 1.00530345959E-03 + 1.03075297275E-03 1.05684671141E-03 1.08360105576E-03 1.11103273043E-03 + 1.13915880450E-03 1.16799692109E-03 1.19756510606E-03 1.22788180625E-03 + 1.25896600426E-03 1.29083710372E-03 1.32351504401E-03 1.35702026206E-03 + 1.39137369230E-03 1.42659680499E-03 1.46271164439E-03 1.49974071407E-03 + 1.53770724471E-03 1.57663492625E-03 1.61654806095E-03 1.65747167823E-03 + 1.69943130499E-03 1.74245319532E-03 1.78656425385E-03 1.83179199760E-03 + 1.87816478547E-03 1.92571151217E-03 1.97446199093E-03 2.02444664725E-03 + 2.07569674856E-03 2.12824432774E-03 2.18212222130E-03 2.23736414597E-03 + 2.29400458385E-03 2.35207901206E-03 2.41162374966E-03 2.47267595761E-03 + 2.53527383014E-03 2.59945651823E-03 2.66526412953E-03 2.73273788155E-03 + 2.80191987191E-03 2.87285342290E-03 2.94558285168E-03 3.02015366183E-03 + 3.09661246661E-03 3.17500710390E-03 3.25538655958E-03 3.33780115889E-03 + 3.42230241337E-03 3.50894313557E-03 3.59777755400E-03 3.68886123642E-03 + 3.78225116646E-03 3.87800570525E-03 3.97618482122E-03 4.07685001326E-03 + 4.18006366033E-03 4.28589120275E-03 4.39439846328E-03 4.50565317789E-03 + 4.61972499578E-03 4.73668586198E-03 4.85660810390E-03 4.97956711005E-03 + 5.10564018215E-03 5.23490576946E-03 5.36744499964E-03 5.50334091336E-03 + 5.64267846402E-03 5.78554451802E-03 5.93202938535E-03 6.08222414045E-03 + 6.23622291866E-03 6.39412215053E-03 6.55602132732E-03 6.72202108714E-03 + 6.89222551131E-03 7.06674174150E-03 7.24567883141E-03 7.42914927758E-03 + 7.61726748838E-03 7.81015169743E-03 8.00792281529E-03 8.21070519477E-03 + 8.41862548262E-03 8.63181453269E-03 8.85040587522E-03 9.07453686441E-03 + 9.30434829577E-03 9.53998402289E-03 9.78159248792E-03 1.00293251908E-02 + 1.02833378368E-02 1.05437899532E-02 1.08108456547E-02 1.10846728775E-02 + 1.13654433784E-02 1.16533342657E-02 1.19485264674E-02 1.22512058787E-02 + 1.25615633616E-02 1.28797947439E-02 1.32061000529E-02 1.35406854285E-02 + 1.38837619736E-02 1.42355465186E-02 1.45962604727E-02 1.49661328830E-02 + 1.53453969903E-02 1.57342925226E-02 1.61330664596E-02 1.65419707345E-02 + 1.69612645279E-02 1.73912146486E-02 1.78320932356E-02 1.82841804329E-02 + 1.87477640057E-02 1.92231389530E-02 1.97106082708E-02 2.02104821819E-02 + 2.07230800459E-02 2.12487295887E-02 2.17877665153E-02 2.23405360340E-02 + 2.29073924688E-02 2.34887003993E-02 2.40848323581E-02 2.46961726488E-02 + 2.53231146576E-02 2.59660639061E-02 2.66254353588E-02 2.73016560916E-02 + 2.79951648941E-02 2.87064122537E-02 2.94358614883E-02 3.01839879602E-02 + 3.09512805860E-02 3.17382421965E-02 3.25453895105E-02 3.33732534877E-02 + 3.42223800618E-02 3.50933308706E-02 3.59866828324E-02 3.69030307798E-02 + 3.78429847319E-02 3.88071740462E-02 3.97962446793E-02 4.08108614122E-02 + 4.18517089218E-02 4.29194978129E-02 4.40149492199E-02 4.51388061746E-02 + 4.62918487885E-02 4.74748635088E-02 4.86886697483E-02 4.99341082347E-02 + 5.12120484738E-02 5.25233808801E-02 5.38690280155E-02 5.52499443182E-02 + 5.66671119741E-02 5.81215329296E-02 5.96142591080E-02 6.11463652090E-02 + 6.27189597061E-02 6.43331919531E-02 6.59902439348E-02 6.76913410579E-02 + 6.94377399229E-02 7.12307504060E-02 7.30717155866E-02 7.49620259615E-02 + 7.69031220562E-02 7.88964854257E-02 8.09436485952E-02 8.30462009915E-02 + 8.52057755630E-02 8.74240695437E-02 8.97028305780E-02 9.20438654672E-02 + 9.44490371278E-02 9.69202726326E-02 9.94595670184E-02 1.02068971365E-01 + 1.04750607067E-01 1.07506656641E-01 1.10339384382E-01 1.13251106737E-01 + 1.16244222868E-01 1.19321194761E-01 1.22484553016E-01 1.25736901504E-01 + 1.29080909362E-01 1.32519316829E-01 1.36054924323E-01 1.39690595032E-01 + 1.43429244207E-01 1.47273849117E-01 1.51227418765E-01 1.55293017866E-01 + 1.59473723602E-01 1.63772639796E-01 1.68192873558E-01 1.72737515700E-01 + 1.77409639537E-01 1.82212257404E-01 1.87148317238E-01 1.92220667223E-01 + 1.97432014403E-01 2.02784906498E-01 2.08281680175E-01 2.13924423692E-01 + 2.19714904800E-01 2.25654537300E-01 2.31744292730E-01 2.37984645000E-01 + 2.44375462259E-01 2.50915933028E-01 2.57604448437E-01 2.64438483322E-01 + 2.71414474500E-01 2.78527655287E-01 2.85771895198E-01 2.93139531758E-01 + 3.00621129571E-01 3.08205288044E-01 3.15878358870E-01 3.23624173160E-01 + 3.31423730645E-01 3.39254843052E-01 3.47091744333E-01 3.54904660362E-01 + 3.62659436871E-01 3.70316850314E-01 3.77832218065E-01 3.85154756358E-01 + 3.92226954560E-01 3.98983914161E-01 4.05352671298E-01 4.11251583264E-01 + 4.16589666474E-01 4.21265968073E-01 4.25169213690E-01 4.28177473301E-01 + 4.30158130452E-01 4.30968182187E-01 4.30455131088E-01 4.28458238497E-01 + 4.24810741735E-01 4.19342833218E-01 4.11885770361E-01 4.02277109821E-01 + 3.90367419873E-01 3.76028188265E-01 3.59161189847E-01 3.39709094511E-01 + 3.17666906399E-01 2.93093870928E-01 2.66125127644E-01 2.36982072616E-01 + 2.05980453650E-01 1.73534737477E-01 1.40157450078E-01 1.06452191021E-01 + 7.30992377435E-02 4.08331385211E-02 1.04124327127E-02 -1.74175741760E-02 + -4.19669827173E-02 -6.26454699606E-02 -7.90046289100E-02 -9.07741956609E-02 + -9.78877805460E-02 -1.00494389337E-01 -9.89531972913E-02 -9.38107445113E-02 + -8.57618787601E-02 -7.55977830510E-02 -6.41462630795E-02 -5.22105962477E-02 + -4.05134867887E-02 -2.96520259767E-02 -2.00679917205E-02 -1.20356627562E-02 + -5.66693308393E-03 -9.31261208106E-04 2.31371381547E-03 4.28598935685E-03 + 5.24259346393E-03 5.44695513995E-03 5.14332536248E-03 4.53974181399E-03 + 3.79951321784E-03 3.04000366985E-03 2.33678618778E-03 1.73101138587E-03 + 1.23803518053E-03 8.55798788166E-04 5.72006169921E-04 3.69654543144E-04 + 2.30869458267E-04 1.39246805009E-04 8.10242478401E-05 4.54284907328E-05 + 2.45089063252E-05 1.27039699655E-05 6.31626367773E-06 3.00694184270E-06 + 1.36813343715E-06 5.93774253860E-07 2.45306518589E-07 9.62606139283E-08 + 3.57968755465E-08 1.25848460331E-08 4.17202291678E-09 1.30067197642E-09 + 3.80251145215E-10 1.03930709593E-10 2.64729969209E-11 6.26305557166E-12 + 1.37135744467E-12 2.76875462291E-13 5.13335331576E-14 8.70803717801E-15 + 1.35013311642E-15 1.85002779762E-16 2.24630980483E-17 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 + + + 1 Number of nonzero Dij + 1 1 2.17710200589E+01 + + + + + +3S 0 2.00 Wavefunction + 1.99521110000E-04 2.04572030000E-04 2.09750810000E-04 2.15060690000E-04 + 2.20505000000E-04 2.26087130000E-04 2.31810570000E-04 2.37678910000E-04 + 2.43695800000E-04 2.49865020000E-04 2.56190410000E-04 2.62675930000E-04 + 2.69325640000E-04 2.76143680000E-04 2.83134330000E-04 2.90301960000E-04 + 2.97651030000E-04 3.05186150000E-04 3.12912030000E-04 3.20833490000E-04 + 3.28955490000E-04 3.37283100000E-04 3.45821530000E-04 3.54576120000E-04 + 3.63552340000E-04 3.72755800000E-04 3.82192260000E-04 3.91867600000E-04 + 4.01787890000E-04 4.11959320000E-04 4.22388240000E-04 4.33081190000E-04 + 4.44044840000E-04 4.55286050000E-04 4.66811850000E-04 4.78629430000E-04 + 4.90746200000E-04 5.03169710000E-04 5.15907750000E-04 5.28968270000E-04 + 5.42359440000E-04 5.56089630000E-04 5.70167420000E-04 5.84601620000E-04 + 5.99401240000E-04 6.14575550000E-04 6.30134040000E-04 6.46086420000E-04 + 6.62442670000E-04 6.79213020000E-04 6.96407950000E-04 7.14038230000E-04 + 7.32114860000E-04 7.50649160000E-04 7.69652710000E-04 7.89137400000E-04 + 8.09115410000E-04 8.29599240000E-04 8.50601690000E-04 8.72135910000E-04 + 8.94215360000E-04 9.16853840000E-04 9.40065520000E-04 9.63864920000E-04 + 9.88266930000E-04 1.01328680000E-03 1.03894020000E-03 1.06524320000E-03 + 1.09221210000E-03 1.11986400000E-03 1.14821610000E-03 1.17728610000E-03 + 1.20709220000E-03 1.23765320000E-03 1.26898800000E-03 1.30111630000E-03 + 1.33405830000E-03 1.36783450000E-03 1.40246610000E-03 1.43797480000E-03 + 1.47438280000E-03 1.51171280000E-03 1.54998840000E-03 1.58923340000E-03 + 1.62947240000E-03 1.67073060000E-03 1.71303400000E-03 1.75640890000E-03 + 1.80088250000E-03 1.84648280000E-03 1.89323830000E-03 1.94117840000E-03 + 1.99033300000E-03 2.04073300000E-03 2.09241000000E-03 2.14539650000E-03 + 2.19972560000E-03 2.25543150000E-03 2.31254910000E-03 2.37111430000E-03 + 2.43116390000E-03 2.49273550000E-03 2.55586790000E-03 2.62060070000E-03 + 2.68697460000E-03 2.75503130000E-03 2.82481370000E-03 2.89636570000E-03 + 2.96973220000E-03 3.04495950000E-03 3.12209490000E-03 3.20118700000E-03 + 3.28228570000E-03 3.36544220000E-03 3.45070880000E-03 3.53813940000E-03 + 3.62778920000E-03 3.71971490000E-03 3.81397440000E-03 3.91062760000E-03 + 4.00973550000E-03 4.11136080000E-03 4.21556810000E-03 4.32242330000E-03 + 4.43199420000E-03 4.54435060000E-03 4.65956370000E-03 4.77770680000E-03 + 4.89885520000E-03 5.02308610000E-03 5.15047880000E-03 5.28111450000E-03 + 5.41507680000E-03 5.55245150000E-03 5.69332650000E-03 5.83779220000E-03 + 5.98594140000E-03 6.13786960000E-03 6.29367440000E-03 6.45345650000E-03 + 6.61731900000E-03 6.78536820000E-03 6.95771290000E-03 7.13446510000E-03 + 7.31573990000E-03 7.50165550000E-03 7.69233350000E-03 7.88789870000E-03 + 8.08847950000E-03 8.29420800000E-03 8.50522000000E-03 8.72165510000E-03 + 8.94365690000E-03 9.17137320000E-03 9.40495590000E-03 9.64456170000E-03 + 9.89035140000E-03 1.01424910000E-02 1.04011510000E-02 1.06665070000E-02 + 1.09387400000E-02 1.12180380000E-02 1.15045920000E-02 1.17985990000E-02 + 1.21002660000E-02 1.24098020000E-02 1.27274250000E-02 1.30533590000E-02 + 1.33878360000E-02 1.37310940000E-02 1.40833800000E-02 1.44449500000E-02 + 1.48160680000E-02 1.51970040000E-02 1.55880420000E-02 1.59894730000E-02 + 1.64015980000E-02 1.68247300000E-02 1.72591920000E-02 1.77053200000E-02 + 1.81634600000E-02 1.86339740000E-02 1.91172350000E-02 1.96136310000E-02 + 2.01235660000E-02 2.06474580000E-02 2.11857420000E-02 2.17388720000E-02 + 2.23073180000E-02 2.28915720000E-02 2.34921450000E-02 2.41095700000E-02 + 2.47444020000E-02 2.53972210000E-02 2.60686340000E-02 2.67592730000E-02 + 2.74698000000E-02 2.82009060000E-02 2.89533180000E-02 2.97277930000E-02 + 3.05251280000E-02 3.13461570000E-02 3.21917550000E-02 3.30628420000E-02 + 3.39603840000E-02 3.48853980000E-02 3.58389530000E-02 3.68221750000E-02 + 3.78362490000E-02 3.88824270000E-02 3.99620260000E-02 4.10764410000E-02 + 4.22271410000E-02 4.34156810000E-02 4.46437050000E-02 4.59129510000E-02 + 4.72252620000E-02 4.85825870000E-02 4.99869940000E-02 5.14406760000E-02 + 5.29459570000E-02 5.45053060000E-02 5.61213440000E-02 5.77968570000E-02 + 5.95348020000E-02 6.13383260000E-02 6.32107730000E-02 6.51557030000E-02 + 6.71769000000E-02 6.92783930000E-02 7.14644690000E-02 7.37396900000E-02 + 7.61089140000E-02 7.85773090000E-02 8.11503740000E-02 8.38339640000E-02 + 8.66343010000E-02 8.95580060000E-02 9.26121130000E-02 9.58040940000E-02 + 9.91418820000E-02 1.02633890000E-01 1.06289030000E-01 1.10116730000E-01 + 1.14126980000E-01 1.18330290000E-01 1.22737750000E-01 1.27361020000E-01 + 1.32212330000E-01 1.37304470000E-01 1.42650770000E-01 1.48265090000E-01 + 1.54161770000E-01 1.60355550000E-01 1.66861530000E-01 1.73695050000E-01 + 1.80871560000E-01 1.88406450000E-01 1.96314900000E-01 2.04611590000E-01 + 2.13310460000E-01 2.22424360000E-01 2.31964680000E-01 2.41940880000E-01 + 2.52360050000E-01 2.63226310000E-01 2.74540210000E-01 2.86298110000E-01 + 2.98491470000E-01 3.11106150000E-01 3.24121750000E-01 3.37510910000E-01 + 3.51238780000E-01 3.65262540000E-01 3.79531080000E-01 3.93984920000E-01 + 4.08556390000E-01 4.23170030000E-01 4.37743400000E-01 4.52188160000E-01 + 4.66411430000E-01 4.80317590000E-01 4.93810050000E-01 5.06793430000E-01 + 5.19175530000E-01 5.30869310000E-01 5.41794700000E-01 5.51879950000E-01 + 5.61062690000E-01 5.69290440000E-01 5.76520650000E-01 5.82720370000E-01 + 5.87865480000E-01 5.91939690000E-01 5.94933450000E-01 5.96842810000E-01 + 5.97668450000E-01 5.97414850000E-01 5.96089820000E-01 5.93704120000E-01 + 5.90271450000E-01 5.85808540000E-01 5.80335360000E-01 5.73875330000E-01 + 5.66455600000E-01 5.58107110000E-01 5.48864750000E-01 5.38767250000E-01 + 5.27857140000E-01 5.16180490000E-01 5.03786720000E-01 4.90728320000E-01 + 4.77060490000E-01 4.62840860000E-01 4.48129140000E-01 4.32986710000E-01 + 4.17476320000E-01 4.01661630000E-01 3.85606860000E-01 3.69376380000E-01 + 3.53034290000E-01 3.36644020000E-01 3.20267910000E-01 3.03966790000E-01 + 2.87799630000E-01 2.71823080000E-01 2.56091150000E-01 2.40654870000E-01 + 2.25561920000E-01 2.10856400000E-01 1.96578500000E-01 1.82764340000E-01 + 1.69445790000E-01 1.56650280000E-01 1.44400800000E-01 1.32715780000E-01 + 1.21609180000E-01 1.11090460000E-01 1.01164800000E-01 9.18331480000E-02 + 8.30924860000E-02 7.49360360000E-02 6.73535410000E-02 6.03315570000E-02 + 5.38537810000E-02 4.79013930000E-02 4.24534060000E-02 3.74870270000E-02 + 3.29780180000E-02 2.89010430000E-02 2.52300180000E-02 2.19384310000E-02 + 1.89996490000E-02 1.63872000000E-02 1.40750310000E-02 1.20377290000E-02 + 1.02507250000E-02 8.69045230000E-03 7.33448760000E-03 6.16165370000E-03 + 5.15209780000E-03 4.28734010000E-03 3.55029970000E-03 2.92529690000E-03 + 2.39803520000E-03 1.95556700000E-03 1.58624430000E-03 1.27965740000E-03 + 1.02656480000E-03 8.18816050000E-04 6.49270600000E-04 5.11713620000E-04 + 4.00781320000E-04 3.11953190000E-04 2.41277370000E-04 1.85404060000E-04 + 1.41522620000E-04 1.07290960000E-04 8.07710730000E-05 6.03708050000E-05 + 4.47916880000E-05 3.29826990000E-05 2.40996190000E-05 1.74696480000E-05 + 1.25609010000E-05 8.95633920000E-06 6.33171690000E-06 4.43710290000E-06 + 3.08154140000E-06 2.12044980000E-06 1.44536630000E-06 9.75694150000E-07 + 6.52121570000E-07 4.31432700000E-07 2.82458680000E-07 1.82952810000E-07 + 1.17205370000E-07 7.42436290000E-08 4.64889840000E-08 2.87668960000E-08 + 1.75856310000E-08 1.06172590000E-08 6.32882310000E-09 3.72357940000E-09 + 2.16180970000E-09 1.23840040000E-09 7.00352340000E-10 3.92000090000E-10 + 2.19213180000E-10 1.20759850000E-10 6.55071340000E-11 3.49780330000E-11 + 1.83767710000E-11 9.49580790000E-12 4.82392960000E-12 2.40818060000E-12 + 1.18087590000E-12 5.68525220000E-13 2.68610920000E-13 1.24485600000E-13 + 5.65618960000E-14 2.51837650000E-14 1.09821190000E-14 4.68804550000E-15 + 1.95795700000E-15 +3P 1 0.00 Wavefunction + 2.91543910000E-07 3.06491680000E-07 3.22205850000E-07 3.38725690000E-07 + 3.56092530000E-07 3.74349780000E-07 3.93543100000E-07 4.13720480000E-07 + 4.34932380000E-07 4.57231840000E-07 4.80674610000E-07 5.05319320000E-07 + 5.31227590000E-07 5.58464200000E-07 5.87097270000E-07 6.17198380000E-07 + 6.48842810000E-07 6.82109690000E-07 7.17082190000E-07 7.53847770000E-07 + 7.92498360000E-07 8.33130600000E-07 8.75846110000E-07 9.20751680000E-07 + 9.67959620000E-07 1.01758790000E-06 1.06976080000E-06 1.12460860000E-06 + 1.18226840000E-06 1.24288460000E-06 1.30660860000E-06 1.37359990000E-06 + 1.44402580000E-06 1.51806250000E-06 1.59589520000E-06 1.67771850000E-06 + 1.76373690000E-06 1.85416550000E-06 1.94923060000E-06 2.04916970000E-06 + 2.15423280000E-06 2.26468250000E-06 2.38079520000E-06 2.50286100000E-06 + 2.63118530000E-06 2.76608900000E-06 2.90790920000E-06 3.05700070000E-06 + 3.21373630000E-06 3.37850790000E-06 3.55172740000E-06 3.73382810000E-06 + 3.92526530000E-06 4.12651770000E-06 4.33808840000E-06 4.56050650000E-06 + 4.79432830000E-06 5.04013830000E-06 5.29855110000E-06 5.57021310000E-06 + 5.85580340000E-06 6.15603610000E-06 6.47166200000E-06 6.80347040000E-06 + 7.15229080000E-06 7.51899550000E-06 7.90450150000E-06 8.30977260000E-06 + 8.73582240000E-06 9.18371600000E-06 9.65457340000E-06 1.01495720000E-05 + 1.06699500000E-05 1.12170070000E-05 1.17921130000E-05 1.23967040000E-05 + 1.30322940000E-05 1.37004700000E-05 1.44029050000E-05 1.51413530000E-05 + 1.59176620000E-05 1.67337730000E-05 1.75917260000E-05 1.84936660000E-05 + 1.94418500000E-05 2.04386470000E-05 2.14865500000E-05 2.25881790000E-05 + 2.37462890000E-05 2.49637760000E-05 2.62436830000E-05 2.75892110000E-05 + 2.90037240000E-05 3.04907590000E-05 3.20540340000E-05 3.36974580000E-05 + 3.54251400000E-05 3.72414000000E-05 3.91507780000E-05 4.11580500000E-05 + 4.32682330000E-05 4.54866030000E-05 4.78187080000E-05 5.02703780000E-05 + 5.28477420000E-05 5.55572460000E-05 5.84056620000E-05 6.14001130000E-05 + 6.45480860000E-05 6.78574500000E-05 7.13364790000E-05 7.49938720000E-05 + 7.88387730000E-05 8.28807930000E-05 8.71300390000E-05 9.15971330000E-05 + 9.62932430000E-05 1.01230110000E-04 1.06420070000E-04 1.11876110000E-04 + 1.17611860000E-04 1.23641660000E-04 1.29980580000E-04 1.36644480000E-04 + 1.43650000000E-04 1.51014660000E-04 1.58756870000E-04 1.66895980000E-04 + 1.75452340000E-04 1.84447330000E-04 1.93903440000E-04 2.03844290000E-04 + 2.14294740000E-04 2.25280910000E-04 2.36830250000E-04 2.48971620000E-04 + 2.61735370000E-04 2.75153400000E-04 2.89259230000E-04 3.04088120000E-04 + 3.19677110000E-04 3.36065170000E-04 3.53293230000E-04 3.71404350000E-04 + 3.90443770000E-04 4.10459060000E-04 4.31500210000E-04 4.53619800000E-04 + 4.76873070000E-04 5.01318110000E-04 5.27015970000E-04 5.54030830000E-04 + 5.82430160000E-04 6.12284880000E-04 6.43669530000E-04 6.76662470000E-04 + 7.11346090000E-04 7.47806950000E-04 7.86136090000E-04 8.26429160000E-04 + 8.68786740000E-04 9.13314510000E-04 9.60123600000E-04 1.00933080000E-03 + 1.06105880000E-03 1.11543680000E-03 1.17260020000E-03 1.23269180000E-03 + 1.29586120000E-03 1.36226600000E-03 1.43207170000E-03 1.50545230000E-03 + 1.58259060000E-03 1.66367880000E-03 1.74891880000E-03 1.83852310000E-03 + 1.93271460000E-03 2.03172780000E-03 2.13580910000E-03 2.24521750000E-03 + 2.36022510000E-03 2.48111800000E-03 2.60819660000E-03 2.74177670000E-03 + 2.88219030000E-03 3.02978590000E-03 3.18493020000E-03 3.34800790000E-03 + 3.51942380000E-03 3.69960270000E-03 3.88899140000E-03 4.08805880000E-03 + 4.29729800000E-03 4.51722670000E-03 4.74838880000E-03 4.99135580000E-03 + 5.24672770000E-03 5.51513500000E-03 5.79723980000E-03 6.09373750000E-03 + 6.40535830000E-03 6.73286910000E-03 7.07707510000E-03 7.43882190000E-03 + 7.81899720000E-03 8.21853280000E-03 8.63840720000E-03 9.07964710000E-03 + 9.54333030000E-03 1.00305880000E-02 1.05426070000E-02 1.10806320000E-02 + 1.16459710000E-02 1.22399920000E-02 1.28641350000E-02 1.35199050000E-02 + 1.42088840000E-02 1.49327280000E-02 1.56931740000E-02 1.64920410000E-02 + 1.73312370000E-02 1.82127580000E-02 1.91386970000E-02 2.01112430000E-02 + 2.11326890000E-02 2.22054340000E-02 2.33319860000E-02 2.45149720000E-02 + 2.57571330000E-02 2.70613360000E-02 2.84305770000E-02 2.98679810000E-02 + 3.13768120000E-02 3.29604720000E-02 3.46225090000E-02 3.63666200000E-02 + 3.81966520000E-02 4.01166090000E-02 4.21306530000E-02 4.42431070000E-02 + 4.64584590000E-02 4.87813580000E-02 5.12166210000E-02 5.37692320000E-02 + 5.64443350000E-02 5.92472410000E-02 6.21834150000E-02 6.52584790000E-02 + 6.84781980000E-02 7.18484760000E-02 7.53753430000E-02 7.90649410000E-02 + 8.29235050000E-02 8.69573460000E-02 9.11728240000E-02 9.55763220000E-02 + 1.00174210000E-01 1.04972820000E-01 1.09978360000E-01 1.15196940000E-01 + 1.20634430000E-01 1.26296460000E-01 1.32188320000E-01 1.38314900000E-01 + 1.44680570000E-01 1.51289120000E-01 1.58143640000E-01 1.65246420000E-01 + 1.72598810000E-01 1.80201120000E-01 1.88052470000E-01 1.96150650000E-01 + 2.04492010000E-01 2.13071270000E-01 2.21881410000E-01 2.30913540000E-01 + 2.40156710000E-01 2.49597880000E-01 2.59221700000E-01 2.69010500000E-01 + 2.78944190000E-01 2.89000190000E-01 2.99153450000E-01 3.09376450000E-01 + 3.19639260000E-01 3.29909670000E-01 3.40153300000E-01 3.50333850000E-01 + 3.60413370000E-01 3.70352530000E-01 3.80111040000E-01 3.89648030000E-01 + 3.98922510000E-01 4.07893830000E-01 4.16522150000E-01 4.24768890000E-01 + 4.32597170000E-01 4.39972110000E-01 4.46861220000E-01 4.53234500000E-01 + 4.59064660000E-01 4.64327090000E-01 4.68999860000E-01 4.73063610000E-01 + 4.76501410000E-01 4.79298640000E-01 4.81442810000E-01 4.82923460000E-01 + 4.83732080000E-01 4.83862040000E-01 4.83308670000E-01 4.82069220000E-01 + 4.80143030000E-01 4.77531560000E-01 4.74238550000E-01 4.70270120000E-01 + 4.65634850000E-01 4.60343900000E-01 4.54411080000E-01 4.47852840000E-01 + 4.40688360000E-01 4.32939470000E-01 4.24630680000E-01 4.15789100000E-01 + 4.06444300000E-01 3.96628300000E-01 3.86375320000E-01 3.75721700000E-01 + 3.64705640000E-01 3.53367010000E-01 3.41747100000E-01 3.29888380000E-01 + 3.17834140000E-01 3.05628280000E-01 2.93314920000E-01 2.80938130000E-01 + 2.68541560000E-01 2.56168160000E-01 2.43859830000E-01 2.31657100000E-01 + 2.19598880000E-01 2.07722150000E-01 1.96061710000E-01 1.84649990000E-01 + 1.73516810000E-01 1.62689250000E-01 1.52191530000E-01 1.42044900000E-01 + 1.32267590000E-01 1.22874810000E-01 1.13878720000E-01 1.05288550000E-01 + 9.71106090000E-02 8.93484290000E-02 8.20028900000E-02 7.50723710000E-02 + 6.85529210000E-02 6.24384460000E-02 5.67209040000E-02 5.13905090000E-02 + 4.64359400000E-02 4.18445450000E-02 3.76025540000E-02 3.36952720000E-02 + 3.01072800000E-02 2.68226140000E-02 2.38249460000E-02 2.10977380000E-02 + 1.86243990000E-02 1.63884130000E-02 1.43734690000E-02 1.25635570000E-02 + 1.09433320000E-02 9.50025660000E-03 8.21946710000E-03 7.08656340000E-03 + 6.08795610000E-03 5.21087110000E-03 4.44334740000E-03 3.77423060000E-03 + 3.19316120000E-03 2.69055850000E-03 2.25760040000E-03 1.88619850000E-03 + 1.56897100000E-03 1.29921170000E-03 1.07085690000E-03 8.78450460000E-04 + 7.17106900000E-04 5.82473900000E-04 4.70694100000E-04 3.78366880000E-04 + 3.02510530000E-04 2.40525070000E-04 1.90156260000E-04 1.49460940000E-04 + 1.16774070000E-04 9.06775690000E-05 6.99712460000E-05 5.36457580000E-05 + 4.08578230000E-05 3.09076040000E-05 2.32182830000E-05 1.73177690000E-05 + 1.28224620000E-05 9.42295250000E-06 6.87155790000E-06 4.97153390000E-06 + 3.56783560000E-06 2.53926800000E-06 1.79188180000E-06 1.25346690000E-06 + 8.69005650000E-07 5.96952850000E-07 4.06223830000E-07 2.73778390000E-07 + 1.82703070000E-07 1.20704530000E-07 7.89383730000E-08 5.11087540000E-08 + 3.27840280000E-08 2.08831510000E-08 1.32958750000E-08 8.36699550000E-09 + 5.20265170000E-09 + + + + + 7.96173466713E-08 8.36994309166E-08 8.79908045913E-08 9.25022007666E-08 + 9.72449100500E-08 1.02230780703E-07 1.07472280727E-07 1.12982528518E-07 + 1.18775285875E-07 1.24865056439E-07 1.31267052352E-07 1.37997288403E-07 + 1.45072600723E-07 1.52510664008E-07 1.60330097649E-07 1.68550455960E-07 + 1.77192271320E-07 1.86277172304E-07 1.95827877037E-07 2.05868256611E-07 + 2.16423428802E-07 2.27519779091E-07 2.39185061223E-07 2.51448449749E-07 + 2.64340607839E-07 2.77893772867E-07 2.92141847208E-07 3.07120431860E-07 + 3.22867017101E-07 3.39420962670E-07 3.56823650581E-07 3.75118634264E-07 + 3.94351639861E-07 4.14570774649E-07 4.35826606601E-07 4.58172262524E-07 + 4.81663665629E-07 5.06359514123E-07 5.32321613020E-07 5.59614861334E-07 + 5.88307524314E-07 6.18471353187E-07 6.50181773659E-07 6.83518108213E-07 + 7.18563693027E-07 7.55406213316E-07 7.94137816733E-07 8.34855324217E-07 + 8.77660582073E-07 9.22660653075E-07 9.69968065646E-07 1.01970118780E-06 + 1.07198433647E-06 1.12694832282E-06 1.18473058802E-06 1.24547567216E-06 + 1.30933549340E-06 1.37646979802E-06 1.44704647006E-06 1.52124209102E-06 + 1.59924222012E-06 1.68124192785E-06 1.76744636379E-06 1.85807116801E-06 + 1.95334304986E-06 2.05350027811E-06 2.15879347835E-06 2.26948615029E-06 + 2.38585454277E-06 2.50819075699E-06 2.63680042460E-06 2.77200512251E-06 + 2.91414315860E-06 3.06357088694E-06 3.22066108829E-06 3.38580725225E-06 + 3.55942309560E-06 3.74194243878E-06 3.93382232330E-06 4.13554305087E-06 + 4.34760928187E-06 4.57055117937E-06 4.80492808027E-06 5.05132559935E-06 + 5.31036060472E-06 5.58268147555E-06 5.86897097031E-06 6.16994444800E-06 + 6.48635555761E-06 6.81899746139E-06 7.16870252117E-06 7.53634716125E-06 + 7.92285090178E-06 8.32918235458E-06 8.75635921620E-06 9.20545228442E-06 + 9.67758543059E-06 1.01739425024E-05 1.06957666798E-05 1.12443660473E-05 + 1.18211158173E-05 1.24274605459E-05 1.30649214445E-05 1.37350960577E-05 + 1.44396650021E-05 1.51803949280E-05 1.59591448794E-05 1.67778685363E-05 + 1.76386186794E-05 1.85435567133E-05 1.94949531292E-05 2.04951964179E-05 + 2.15467988328E-05 2.26524024031E-05 2.38147824448E-05 2.50368608277E-05 + 2.63217089593E-05 2.76725578746E-05 2.90928014477E-05 3.05860164518E-05 + 3.21559575599E-05 3.38065752556E-05 3.55420288115E-05 3.73666863688E-05 + 3.92851451777E-05 4.13022447514E-05 4.34230677487E-05 4.56529645335E-05 + 4.79975645411E-05 5.04627879360E-05 5.30548637385E-05 5.57803407242E-05 + 5.86461134998E-05 6.16594353197E-05 6.48279332712E-05 6.81596355408E-05 + 7.16629888885E-05 7.53468864532E-05 7.92206749064E-05 8.32942015948E-05 + 8.75778214955E-05 9.20824432191E-05 9.68195375977E-05 1.01801184526E-04 + 1.07040100569E-04 1.12549670481E-04 1.18343989350E-04 1.24437891803E-04 + 1.30847001244E-04 1.37587772695E-04 1.44677534497E-04 1.52134535367E-04 + 1.59977997490E-04 1.68228172747E-04 1.76906390962E-04 1.86035140770E-04 + 1.95638101631E-04 2.05740247370E-04 2.16367884250E-04 2.27548743162E-04 + 2.39312065575E-04 2.51688753139E-04 2.64711274173E-04 2.78413876726E-04 + 2.92832874542E-04 3.08006371358E-04 3.23974694261E-04 3.40780362366E-04 + 3.58468305526E-04 3.77085884874E-04 3.96683184449E-04 4.17313161005E-04 + 4.39031741961E-04 4.61897861152E-04 4.85974106788E-04 5.11326493635E-04 + 5.38024833907E-04 5.66143079146E-04 5.95759416986E-04 6.26956712605E-04 + 6.59822558343E-04 6.94449974065E-04 7.30937348090E-04 7.69389042008E-04 + 8.09915817113E-04 8.52635043724E-04 8.97671328181E-04 9.45157111665E-04 + 9.95232872706E-04 1.04804813726E-03 1.10376175340E-03 1.16254273117E-03 + 1.22457086068E-03 1.29003766905E-03 1.35914735725E-03 1.43211738298E-03 + 1.50917982408E-03 1.59058219844E-03 1.67658924642E-03 1.76748335330E-03 + 1.86356687883E-03 1.96516311734E-03 2.07261817996E-03 2.18630304223E-03 + 2.30661536285E-03 2.43398198724E-03 2.56886110427E-03 2.71174514346E-03 + 2.86316347678E-03 3.02368625882E-03 3.19392704405E-03 3.37454801045E-03 + 3.56626287407E-03 3.76984271339E-03 3.98612079225E-03 4.21599813906E-03 + 4.46045074194E-03 4.72053551923E-03 4.99739913831E-03 5.29228629467E-03 + 5.60654872529E-03 5.94165676431E-03 6.29921050473E-03 6.68095335816E-03 + 7.08878529836E-03 7.52478047296E-03 7.99120364652E-03 8.49053126685E-03 + 9.02547178722E-03 9.59899147332E-03 1.02143406589E-02 1.08750837626E-02 + 1.15851335805E-02 1.23487869794E-02 1.31707664007E-02 1.40562670399E-02 + 1.50110042195E-02 1.60412728774E-02 1.71540069486E-02 1.83568488543E-02 + 1.96582255330E-02 2.10674307531E-02 2.25947157967E-02 2.42513884518E-02 + 2.60499351278E-02 2.80041150630E-02 3.01291105501E-02 3.24416588309E-02 + 3.49602004081E-02 3.77050349640E-02 4.06984843632E-02 4.39650738254E-02 + 4.75317026591E-02 5.14278048316E-02 5.56855403879E-02 6.03399407890E-02 + 6.54290424337E-02 7.09939808032E-02 7.70790799240E-02 8.37318055247E-02 + 9.10027046908E-02 9.89451918428E-02 1.07615225535E-01 1.17070778830E-01 + 1.27371189672E-01 1.38576180552E-01 1.50744653814E-01 1.63933215579E-01 + 1.78194315326E-01 1.93574073136E-01 2.10109817646E-01 2.27827228738E-01 + 2.46737361152E-01 2.66833446255E-01 2.88087681372E-01 3.10448234375E-01 + 3.33836647620E-01 3.58145748580E-01 3.83238568487E-01 4.08948264088E-01 + 4.35079244069E-01 4.61409974527E-01 4.87696730962E-01 5.13679161382E-01 + 5.39086461902E-01 5.63644448600E-01 5.87082993896E-01 6.09142958424E-01 + 6.29582684220E-01 6.48183210151E-01 6.64752119753E-01 6.79126059226E-01 + 6.91171645151E-01 7.00785193195E-01 7.07891619858E-01 7.12442679697E-01 + 7.14415152251E-01 7.13809006001E-01 7.10646147015E-01 7.04969164210E-01 + 6.96840769370E-01 6.86343291074E-01 6.73578260133E-01 6.58665788765E-01 + 6.41743893543E-01 6.22967092465E-01 6.02505027585E-01 5.80540299345E-01 + 5.57266320498E-01 5.32884596513E-01 5.07602118497E-01 4.81628568100E-01 + 4.55173422238E-01 4.28443323371E-01 4.01639452234E-01 3.74954982073E-01 + 3.48572955521E-01 3.22664130029E-01 2.97385300958E-01 2.72877820204E-01 + 2.49266419832E-01 2.26658392404E-01 2.05143068352E-01 1.84791618846E-01 + 1.65657254056E-01 1.47775573641E-01 1.31165354217E-01 1.15829532909E-01 + 1.01756359508E-01 8.89208428419E-02 7.72862133245E-02 6.68056079513E-02 + 5.74237514974E-02 4.90786204482E-02 4.17031820813E-02 3.52269565220E-02 + 2.95775853205E-02 2.46821806060E-02 2.04686335181E-02 1.68666541432E-02 + 1.38087224593E-02 1.12308189828E-02 9.07299897048E-03 7.27979354009E-03 + 5.80045945599E-03 4.58908690268E-03 3.60458336200E-03 2.81055438660E-03 + 2.17509934242E-03 1.67054057298E-03 1.27310761656E-03 9.62589509484E-04 + 7.21973324246E-04 5.37080647680E-04 3.96212995302E-04 2.89813838955E-04 + 2.10154726051E-04 1.51047922357E-04 1.07589416709E-04 7.59319526374E-05 + 5.30882234815E-05 3.67625702661E-05 2.52092559196E-05 1.71147239063E-05 + 1.15011456409E-05 7.64848458298E-06 5.03234195856E-06 3.27504612275E-06 + 2.10767057720E-06 1.34091944748E-06 8.43104624049E-07 5.23701657787E-07 + 3.21251332922E-07 1.94629585502E-07 1.16429538548E-07 6.87493309290E-08 + 4.00573039433E-08 2.30227001954E-08 1.30479324671E-08 7.28926819270E-09 + 4.01259062778E-09 2.17571686665E-09 1.16158327189E-09 6.10377202488E-10 + 3.15552467864E-10 1.60432023731E-10 8.01812778035E-11 3.93757642904E-11 + 1.89917947998E-11 8.99261470864E-12 4.17816748235E-12 1.90395814869E-12 + 8.50525084119E-13 3.72268349259E-13 1.59565811815E-13 6.69434613738E-14 + 2.74741975137E-14 1.10242328942E-14 4.32245126670E-15 1.65506861095E-15 + 6.18508835336E-16 2.25452377346E-16 8.01080036622E-17 2.77300870962E-17 + 9.34684235803E-18 3.06727110144E-18 9.80986800287E-19 3.07328141120E-19 + 9.61088365714E-20 2.91658827440E-20 8.58236920979E-21 2.44692558510E-21 + 6.75411424773E-22 1.80340735347E-22 4.65405935715E-23 1.15986676044E-23 + 2.78893578240E-24 6.46441851552E-25 1.44303652686E-25 3.09933292147E-26 + 6.39849615823E-27 1.26844403915E-27 2.41213875460E-28 4.39555412201E-29 + 7.66719122770E-30 + diff --git a/tests/apps/miniDFT/tests/espresso/benchmark/O.pbe.UPF b/tests/apps/miniDFT/tests/espresso/benchmark/O.pbe.UPF new file mode 100644 index 0000000000..ebf8c52146 --- /dev/null +++ b/tests/apps/miniDFT/tests/espresso/benchmark/O.pbe.UPF @@ -0,0 +1,1998 @@ + + + Generated using "atomic" code by A. Dal Corso (Quantum ESPRESSO distribution) + Author: AM + Generation date: 15Dec2010 + Pseudopotential type: NC + Element: O + Functional: PBE + + Suggested minimum cutoff for wavefunctions: 0. Ry + Suggested minimum cutoff for charge density: 0. Ry + The Pseudo was generated with a Scalar-Relativistic Calculation + L component and cutoff radius for Local Potential: 1 1.0500 + + Valence configuration: + nl pn l occ Rcut Rcut US E pseu + 2S 1 0 2.00 1.050 1.050 -1.761170 + 2P 2 1 4.00 0.897 0.897 -0.663759 + Generation configuration: + 2S 1 0 2.00 1.050 1.050 -1.761143 + 2P 2 1 4.00 1.050 1.050 -0.663747 + + Pseudization used: troullier-martins + + + + + + + + 1.139852456943145E-004 1.154190035836278E-004 1.168707959270728E-004 1.183408495701567E-004 + 1.198293942117525E-004 1.213366624399886E-004 1.228628897685923E-004 1.244083146736889E-004 + 1.259731786310638E-004 1.275577261538943E-004 1.291622048309546E-004 1.307868653653023E-004 + 1.324319616134513E-004 1.340977506250371E-004 1.357844926829822E-004 1.374924513441648E-004 + 1.392218934806004E-004 1.409730893211415E-004 1.427463124937009E-004 1.445418400680072E-004 + 1.463599525988968E-004 1.482009341701516E-004 1.500650724388876E-004 1.519526586805018E-004 + 1.538639878341851E-004 1.557993585490062E-004 1.577590732305768E-004 1.597434380883031E-004 + 1.617527631832310E-004 1.637873624764950E-004 1.658475538783739E-004 1.679336592979659E-004 + 1.700460046934867E-004 1.721849201232021E-004 1.743507397969998E-004 1.765438021286102E-004 + 1.787644497884843E-004 1.810130297573369E-004 1.832898933803629E-004 1.855953964221359E-004 + 1.879298991221965E-004 1.902937662513414E-004 1.926873671686188E-004 1.951110758790415E-004 + 1.975652710920271E-004 2.000503362805705E-004 2.025666597411633E-004 2.051146346544658E-004 + 2.076946591467417E-004 2.103071363520676E-004 2.129524744753217E-004 2.156310868559678E-004 + 2.183433920326400E-004 2.210898138085401E-004 2.238707813176587E-004 2.266867290918269E-004 + 2.295380971286134E-004 2.324253309600751E-004 2.353488817223722E-004 2.383092062262596E-004 + 2.413067670284637E-004 2.443420325039584E-004 2.474154769191496E-004 2.505275805059799E-004 + 2.536788295369668E-004 2.568697164011824E-004 2.601007396811912E-004 2.633724042309543E-004 + 2.666852212547135E-004 2.700397083868693E-004 2.734363897728606E-004 2.768757961510646E-004 + 2.803584649357254E-004 2.838849403009259E-004 2.874557732656170E-004 2.910715217797142E-004 + 2.947327508112791E-004 2.984400324347967E-004 3.021939459205629E-004 3.059950778251979E-004 + 3.098440220832948E-004 3.137413801002248E-004 3.176877608461073E-004 3.216837809509625E-004 + 3.257300648010623E-004 3.298272446364902E-004 3.339759606499313E-004 3.381768610867033E-004 + 3.424306023460460E-004 3.467378490836861E-004 3.510992743156891E-004 3.555155595236209E-004 + 3.599873947610304E-004 3.645154787612710E-004 3.691005190466808E-004 3.737432320391325E-004 + 3.784443431719769E-004 3.832045870033929E-004 3.880247073311636E-004 3.929054573088975E-004 + 3.978475995637084E-004 4.028519063153783E-004 4.079191594970185E-004 4.130501508772477E-004 + 4.182456821839090E-004 4.235065652293390E-004 4.288336220372168E-004 4.342276849710067E-004 + 4.396895968640161E-004 4.452202111510912E-004 4.508203920019663E-004 4.564910144562929E-004 + 4.622329645603665E-004 4.680471395055725E-004 4.739344477685760E-004 4.798958092532704E-004 + 4.859321554345163E-004 4.920444295036854E-004 4.982335865160363E-004 5.045005935399448E-004 + 5.108464298080083E-004 5.172720868700546E-004 5.237785687480724E-004 5.303668920930925E-004 + 5.370380863440425E-004 5.437931938885961E-004 5.506332702260508E-004 5.575593841322502E-004 + 5.645726178265832E-004 5.716740671410841E-004 5.788648416916557E-004 5.861460650514514E-004 + 5.935188749264347E-004 6.009844233331482E-004 6.085438767787204E-004 6.161984164431315E-004 + 6.239492383637771E-004 6.317975536223518E-004 6.397445885340814E-004 6.477915848393406E-004 + 6.559397998976731E-004 6.641905068842594E-004 6.725449949888526E-004 6.810045696172156E-004 + 6.895705525950964E-004 6.982442823747625E-004 7.070271142441385E-004 7.159204205385731E-004 + 7.249255908552677E-004 7.340440322704065E-004 7.432771695590118E-004 7.526264454175699E-004 + 7.620933206894547E-004 7.716792745931876E-004 7.813858049535702E-004 7.912144284357184E-004 + 8.011666807820479E-004 8.112441170522359E-004 8.214483118662016E-004 8.317808596501467E-004 + 8.422433748856834E-004 8.528374923621034E-004 8.635648674318165E-004 8.744271762690013E-004 + 8.854261161315157E-004 8.965634056260874E-004 9.078407849768614E-004 9.192600162973045E-004 + 9.308228838655423E-004 9.425311944031595E-004 9.543867773574952E-004 9.663914851875088E-004 + 9.785471936532217E-004 9.908558021088118E-004 1.003319233799395E-003 1.015939436161526E-003 + 1.028718381127504E-003 1.041658065433476E-003 1.054760510931441E-003 1.068027764905168E-003 + 1.081461900390079E-003 1.095065016497179E-003 1.108839238741032E-003 1.122786719371889E-003 + 1.136909637711978E-003 1.151210200496018E-003 1.165690642216041E-003 1.180353225470526E-003 + 1.195200241317938E-003 1.210234009634712E-003 1.225456879477728E-003 1.240871229451376E-003 + 1.256479468079198E-003 1.272284034180234E-003 1.288287397250094E-003 1.304492057846813E-003 + 1.320900547981582E-003 1.337515431514366E-003 1.354339304554519E-003 1.371374795866436E-003 + 1.388624567280288E-003 1.406091314107958E-003 1.423777765564172E-003 1.441686685192953E-003 + 1.459820871299432E-003 1.478183157387077E-003 1.496776412600453E-003 1.515603542173512E-003 + 1.534667487883554E-003 1.553971228510887E-003 1.573517780304250E-003 1.593310197452134E-003 + 1.613351572559984E-003 1.633645037133435E-003 1.654193762067618E-003 1.675000958142604E-003 + 1.696069876525117E-003 1.717403809276518E-003 1.739006089867202E-003 1.760880093697467E-003 + 1.783029238624907E-003 1.805456985498485E-003 1.828166838699278E-003 1.851162346688050E-003 + 1.874447102559715E-003 1.898024744604743E-003 1.921898956877679E-003 1.946073469772761E-003 + 1.970552060606811E-003 1.995338554209453E-003 2.020436823520734E-003 2.045850790196303E-003 + 2.071584425220157E-003 2.097641749525120E-003 2.124026834621135E-003 2.150743803231423E-003 + 2.177796829936689E-003 2.205190141827395E-003 2.232928019164254E-003 2.261014796047039E-003 + 2.289454861091772E-003 2.318252658116486E-003 2.347412686835551E-003 2.376939503562782E-003 + 2.406837721923366E-003 2.437112013574749E-003 2.467767108936598E-003 2.498807797929929E-003 + 2.530238930725549E-003 2.562065418501907E-003 2.594292234212468E-003 2.626924413362754E-003 + 2.659967054797147E-003 2.693425321495596E-003 2.727304441380347E-003 2.761609708132805E-003 + 2.796346482020700E-003 2.831520190735621E-003 2.867136330241116E-003 2.903200465631447E-003 + 2.939718232001138E-003 2.976695335325485E-003 3.014137553352109E-003 3.052050736503754E-003 + 3.090440808792425E-003 3.129313768745018E-003 3.168675690340618E-003 3.208532723959554E-003 + 3.248891097344418E-003 3.289757116573164E-003 3.331137167044436E-003 3.373037714475311E-003 + 3.415465305911571E-003 3.458426570750697E-003 3.501928221777728E-003 3.545977056214138E-003 + 3.590579956779929E-003 3.635743892769060E-003 3.681475921138411E-003 3.727783187610464E-003 + 3.774672927789813E-003 3.822152468293762E-003 3.870229227897112E-003 3.918910718691361E-003 + 3.968204547258494E-003 4.018118415859508E-003 4.068660123637929E-003 4.119837567838421E-003 + 4.171658745040760E-003 4.224131752409320E-003 4.277264788958254E-003 4.331066156832628E-003 + 4.385544262605630E-003 4.440707618592121E-003 4.496564844178708E-003 4.553124667170529E-003 + 4.610395925155002E-003 4.668387566882703E-003 4.727108653665635E-003 4.786568360793083E-003 + 4.846775978965251E-003 4.907740915744977E-003 4.969472697027665E-003 5.031980968529731E-003 + 5.095275497295778E-003 5.159366173224694E-003 5.224263010614990E-003 5.289976149729540E-003 + 5.356515858380023E-003 5.423892533531297E-003 5.492116702925928E-003 5.561199026729190E-003 + 5.631150299194728E-003 5.701981450351176E-003 5.773703547710015E-003 5.846327797994873E-003 + 5.919865548892616E-003 5.994328290826434E-003 6.069727658751247E-003 6.146075433971698E-003 + 6.223383545982993E-003 6.301664074334922E-003 6.380929250519302E-003 6.461191459881176E-003 + 6.542463243554048E-003 6.624757300419475E-003 6.708086489091267E-003 6.792463829924687E-003 + 6.877902507050907E-003 6.964415870437050E-003 7.052017437972169E-003 7.140720897579412E-003 + 7.230540109354811E-003 7.321489107732945E-003 7.413582103679840E-003 7.506833486913493E-003 + 7.601257828152247E-003 7.696869881391529E-003 7.793684586209182E-003 7.891717070099797E-003 + 7.990982650838446E-003 8.091496838874069E-003 8.193275339753045E-003 8.296334056573205E-003 + 8.400689092468720E-003 8.506356753126275E-003 8.613353549332823E-003 8.721696199555458E-003 + 8.831401632553703E-003 8.942486990024652E-003 9.054969629281432E-003 9.168867125965267E-003 + 9.284197276791738E-003 9.400978102331554E-003 9.519227849826291E-003 9.638964996039589E-003 + 9.760208250144146E-003 9.882976556645086E-003 1.000728909834007E-002 1.013316529931665E-002 + 1.026062482798735E-002 1.038968760016282E-002 1.052037378216380E-002 1.065270379397211E-002 + 1.078669831242131E-002 1.092237827442755E-002 1.105976488026091E-002 1.119887959685809E-002 + 1.133974416117657E-002 1.148238058359111E-002 1.162681115133294E-002 1.177305843197209E-002 + 1.192114527694371E-002 1.207109482511861E-002 1.222293050641876E-002 1.237667604547829E-002 + 1.253235546535047E-002 1.268999309126139E-002 1.284961355441080E-002 1.301124179582083E-002 + 1.317490307023304E-002 1.334062295005453E-002 1.350842732935366E-002 1.367834242790612E-002 + 1.385039479529175E-002 1.402461131504297E-002 1.420101920884547E-002 1.437964604079155E-002 + 1.456051972168713E-002 1.474366851341282E-002 1.492912103333995E-002 1.511690625880209E-002 + 1.530705353162274E-002 1.549959256270016E-002 1.569455343664966E-002 1.589196661650445E-002 + 1.609186294847553E-002 1.629427366677146E-002 1.649923039847878E-002 1.670676516850381E-002 + 1.691691040457659E-002 1.712969894231781E-002 1.734516403036941E-002 1.756333933558977E-002 + 1.778425894831421E-002 1.800795738768166E-002 1.823446960702843E-002 1.846383099934961E-002 + 1.869607740282939E-002 1.893124510644083E-002 1.916937085561606E-002 1.941049185798788E-002 + 1.965464578920346E-002 1.990187079881129E-002 2.015220551622211E-002 2.040568905674480E-002 + 2.066236102769832E-002 2.092226153460032E-002 2.118543118743377E-002 2.145191110699236E-002 + 2.172174293130564E-002 2.199496882214519E-002 2.227163147161231E-002 2.255177410880886E-002 + 2.283544050659185E-002 2.312267498841303E-002 2.341352243524463E-002 2.370802829259192E-002 + 2.400623857759428E-002 2.430819988621546E-002 2.461395940052426E-002 2.492356489606690E-002 + 2.523706474933193E-002 2.555450794530926E-002 2.587594408514410E-002 2.620142339388723E-002 + 2.653099672834289E-002 2.686471558501508E-002 2.720263210815413E-002 2.754479909790425E-002 + 2.789127001855373E-002 2.824209900688886E-002 2.859734088065281E-002 2.895705114711111E-002 + 2.932128601172473E-002 2.969010238693227E-002 3.006355790104277E-002 3.044171090724010E-002 + 3.082462049270083E-002 3.121234648782671E-002 3.160494947559331E-002 3.200249080101626E-002 + 3.240503258073645E-002 3.281263771272593E-002 3.322536988611585E-002 3.364329359114798E-002 + 3.406647412925158E-002 3.449497762324665E-002 3.492887102767593E-002 3.536822213926663E-002 + 3.581309960752376E-002 3.626357294545692E-002 3.671971254044162E-002 3.718158966521759E-002 + 3.764927648902529E-002 3.812284608888241E-002 3.860237246100249E-002 3.908793053235673E-002 + 3.957959617238167E-002 4.007744620483386E-002 4.058155841979372E-002 4.109201158582052E-002 + 4.160888546225996E-002 4.213226081170681E-002 4.266221941262424E-002 4.319884407212182E-002 + 4.374221863889443E-002 4.429242801632360E-002 4.484955817574397E-002 4.541369616987644E-002 + 4.598493014643029E-002 4.656334936187663E-002 4.714904419539463E-002 4.774210616299364E-002 + 4.834262793181269E-002 4.895070333459987E-002 4.956642738437412E-002 5.018989628927085E-002 + 5.082120746757492E-002 5.146045956294235E-002 5.210775245981355E-002 5.276318729902069E-002 + 5.342686649359085E-002 5.409889374474844E-002 5.477937405811870E-002 5.546841376013498E-002 + 5.616612051465271E-002 5.687260333977171E-002 5.758797262487076E-002 5.831234014785609E-002 + 5.904581909262684E-002 5.978852406676052E-002 6.054057111942033E-002 6.130207775948830E-002 + 6.207316297392623E-002 6.285394724636761E-002 6.364455257594366E-002 6.444510249634554E-002 + 6.525572209512705E-002 6.607653803324971E-002 6.690767856487378E-002 6.774927355739840E-002 + 6.860145451175333E-002 6.946435458294646E-002 7.033810860086952E-002 7.122285309136538E-002 + 7.211872629756085E-002 7.302586820146700E-002 7.394442054585193E-002 7.487452685638822E-002 + 7.581633246407918E-002 7.676998452796724E-002 7.773563205812754E-002 7.871342593895130E-002 + 7.970351895272172E-002 8.070606580348651E-002 8.172122314123093E-002 8.274914958635428E-002 + 8.379000575445496E-002 8.484395428142685E-002 8.591115984887153E-002 8.699178920983026E-002 + 8.808601121483921E-002 8.919399683831286E-002 9.031591920525908E-002 9.145195361833022E-002 + 9.260227758521475E-002 9.376707084637276E-002 9.494651540312112E-002 9.614079554607138E-002 + 9.735009788392561E-002 9.857461137263460E-002 9.981452734492216E-002 1.010700395401816E-001 + 1.023413441347478E-001 1.036286397725500E-001 1.049321275961509E-001 1.062520112781748E-001 + 1.075884970531323E-001 1.089417937496448E-001 1.103121128230744E-001 1.116996683885645E-001 + 1.131046772544950E-001 1.145273589563598E-001 1.159679357910692E-001 1.174266328516845E-001 + 1.189036780625893E-001 1.203993022151028E-001 1.219137390035416E-001 1.234472250617353E-001 + 1.250000000000000E-001 1.265723064425793E-001 1.281643900655537E-001 1.297764996352282E-001 + 1.314088870470031E-001 1.330618073647324E-001 1.347355188605790E-001 1.364302830553690E-001 + 1.381463647594560E-001 1.398840321140977E-001 1.416435566333533E-001 1.434252132465091E-001 + 1.452292803410354E-001 1.470560398060864E-001 1.489057770765449E-001 1.507787811776226E-001 + 1.526753447700213E-001 1.545957641956607E-001 1.565403395239831E-001 1.585093745988400E-001 + 1.605031770859677E-001 1.625220585210614E-001 1.645663343584527E-001 1.666363240204004E-001 + 1.687323509470005E-001 1.708547426467245E-001 1.730038307475940E-001 1.751799510489967E-001 + 1.773834435741573E-001 1.796146526232657E-001 1.818739268272752E-001 1.841616192023770E-001 + 1.864780872051588E-001 1.888236927884592E-001 1.911988024579225E-001 1.936037873292666E-001 + 1.960390231862711E-001 1.985048905394930E-001 2.010017746857230E-001 2.035300657681889E-001 + 2.060901588375160E-001 2.086824539134554E-001 2.113073560473865E-001 2.139652753856082E-001 + 2.166566272334245E-001 2.193818321200373E-001 2.221413158642548E-001 2.249355096410262E-001 + 2.277648500488137E-001 2.306297791778126E-001 2.335307446790278E-001 2.364681998342213E-001 + 2.394426036267371E-001 2.424544208132194E-001 2.455041219962311E-001 2.485921836977865E-001 + 2.517190884338096E-001 2.548853247895270E-001 2.580913874958110E-001 2.613377775064821E-001 + 2.646250020765843E-001 2.679535748416449E-001 2.713240158979304E-001 2.747368518837129E-001 + 2.781926160615587E-001 2.816918484016511E-001 2.852350956661630E-001 2.888229114946881E-001 + 2.924558564907490E-001 2.961344983093927E-001 2.998594117458873E-001 3.036311788255361E-001 + 3.074503888946188E-001 3.113176387124790E-001 3.152335325447687E-001 3.191986822578659E-001 + 3.232137074144809E-001 3.272792353704627E-001 3.313959013728260E-001 3.355643486590090E-001 + 3.397852285573806E-001 3.440592005890134E-001 3.483869325707314E-001 3.527691007194624E-001 + 3.572063897578957E-001 3.616994930214701E-001 3.662491125667131E-001 3.708559592809336E-001 + 3.755207529933040E-001 3.802442225873332E-001 3.850271061147539E-001 3.898701509108494E-001 + 3.947741137112211E-001 3.997397607700343E-001 4.047678679797454E-001 4.098592209923342E-001 + 4.150146153420689E-001 4.202348565698038E-001 4.255207603488522E-001 4.308731526124346E-001 + 4.362928696827302E-001 4.417807584015592E-001 4.473376762626975E-001 4.529644915458676E-001 + 4.586620834524058E-001 4.644313422426380E-001 4.702731693749893E-001 4.761884776468328E-001 + 4.821781913371216E-001 4.882432463508068E-001 4.943845903650722E-001 5.006031829774161E-001 + 5.068999958555845E-001 5.132760128894014E-001 5.197322303445013E-001 5.262696570179950E-001 + 5.328893143961028E-001 5.395922368137556E-001 5.463794716162196E-001 5.532520793227422E-001 + 5.602111337922581E-001 5.672577223911884E-001 5.743929461633362E-001 5.816179200019336E-001 + 5.889337728238431E-001 5.963416477459503E-001 6.038427022637854E-001 6.114381084323758E-001 + 6.191290530493891E-001 6.269167378405703E-001 6.348023796475102E-001 6.427872106177864E-001 + 6.508724783974813E-001 6.590594463261362E-001 6.673493936341475E-001 6.757436156426458E-001 + 6.842434239659007E-001 6.928501467162530E-001 7.015651287116443E-001 7.103897316857435E-001 + 7.193253345007163E-001 7.283733333626849E-001 7.375351420398772E-001 7.468121920835402E-001 + 7.562059330516188E-001 7.657178327352483E-001 7.753493773881089E-001 7.851020719586458E-001 + 7.949774403252287E-001 8.049770255342580E-001 8.151023900412641E-001 8.253551159550543E-001 + 8.357368052849090E-001 8.462490801909092E-001 8.568935832373978E-001 8.676719776496294E-001 + 8.785859475736626E-001 8.896371983394996E-001 9.008274567275582E-001 9.121584712384796E-001 + 9.236320123663313E-001 9.352498728752607E-001 9.470138680796061E-001 9.589258361275534E-001 + 9.709876382883472E-001 9.832011592431115E-001 9.955683073793475E-001 1.008091015089109E+000 + 1.020771239070956E+000 1.033610960635684E+000 1.046612186015908E+000 1.059776946679548E+000 + 1.073107299647237E+000 1.086605327813750E+000 1.100273140273452E+000 1.114112872649842E+000 + 1.128126687429266E+000 1.142316774298791E+000 1.156685350488361E+000 1.171234661117242E+000 + 1.185966979544816E+000 1.200884607725814E+000 1.215989876569986E+000 1.231285146306323E+000 + 1.246772806851841E+000 1.262455278185007E+000 1.278335010723876E+000 1.294414485708962E+000 + 1.310696215590946E+000 1.327182744423251E+000 1.343876648259544E+000 1.360780535556269E+000 + 1.377897047580201E+000 1.395228858821171E+000 1.412778677409949E+000 1.430549245541390E+000 + 1.448543339902925E+000 1.466763772108402E+000 1.485213389137424E+000 1.503895073780192E+000 + 1.522811745087934E+000 1.541966358829033E+000 1.561361907950852E+000 1.581001423047403E+000 + 1.600887972832880E+000 1.621024664621142E+000 1.641414644811254E+000 1.662061099379099E+000 + 1.682967254375214E+000 1.704136376428846E+000 1.725571773258387E+000 1.747276794188206E+000 + 1.769254830671976E+000 1.791509316822619E+000 1.814043729948866E+000 1.836861591098618E+000 + 1.859966465609106E+000 1.883361963663974E+000 1.907051740857397E+000 1.931039498765253E+000 + 1.955328985523521E+000 1.979923996413929E+000 2.004828374456959E+000 2.030046011012357E+000 + 2.055580846387133E+000 2.081436870451268E+000 2.107618123261131E+000 2.134128695690733E+000 + 2.160972730070958E+000 2.188154420836786E+000 2.215678015182705E+000 2.243547813726332E+000 + 2.271768171180383E+000 2.300343497033134E+000 2.329278256237377E+000 2.358576969908110E+000 + 2.388244216028959E+000 2.418284630167477E+000 2.448702906199502E+000 2.479503797042542E+000 + 2.510692115398458E+000 2.542272734505453E+000 2.574250588899504E+000 2.606630675185429E+000 + 2.639418052817578E+000 2.672617844890418E+000 2.706235238939009E+000 2.740275487749559E+000 + 2.774743910180208E+000 2.809645891992078E+000 2.844986886690841E+000 2.880772416378825E+000 + 2.917008072617840E+000 2.953699517302906E+000 2.990852483546894E+000 3.028472776576372E+000 + 3.066566274638672E+000 3.105138929920356E+000 3.144196769477300E+000 3.183745896176387E+000 + 3.223792489649133E+000 3.264342807257249E+000 3.305403185070350E+000 3.346980038856020E+000 + 3.389079865082238E+000 3.431709241932512E+000 3.474874830333711E+000 3.518583374996832E+000 + 3.562841705470915E+000 3.607656737210129E+000 3.653035472654368E+000 3.698985002323373E+000 + 3.745512505924628E+000 3.792625253475245E+000 3.840330606437867E+000 3.888636018870958E+000 + 3.937549038593496E+000 3.987077308364313E+000 4.037228567076340E+000 4.088010650965772E+000 + 4.139431494836539E+000 4.191499133300121E+000 4.244221702030944E+000 4.297607439037654E+000 + 4.351664685950256E+000 4.406401889323567E+000 4.461827601956989E+000 4.517950484230867E+000 + 4.574779305459755E+000 4.632322945262574E+000 4.690590394950125E+000 4.749590758929975E+000 + 4.809333256129017E+000 4.869827221434003E+000 4.931082107150069E+000 4.993107484477742E+000 + 5.055913045008429E+000 5.119508602238725E+000 5.183904093103852E+000 5.249109579530251E+000 + 5.315135250007848E+000 5.381991421181995E+000 5.449688539465439E+000 5.518237182670661E+000 + 5.587648061662607E+000 5.657932022032345E+000 5.729100045791689E+000 5.801163253089122E+000 + 5.874132903947419E+000 5.948020400022963E+000 6.022837286387352E+000 6.098595253331307E+000 + 6.175306138191273E+000 6.252981927199102E+000 6.331634757354833E+000 6.411276918323213E+000 + 6.491920854353936E+000 6.573579166226057E+000 6.656264613216962E+000 6.739990115095946E+000 + 6.824768754143030E+000 6.910613777193061E+000 6.997538597705519E+000 7.085556797860484E+000 + 7.174682130680780E+000 7.264928522180998E+000 7.356310073543432E+000 7.448841063321374E+000 + 7.542535949670257E+000 7.637409372606672E+000 7.733476156295986E+000 7.830751311368615E+000 + 7.929250037265418E+000 8.028987724612744E+000 8.129979957627127E+000 8.232242516550462E+000 + 8.335791380115651E+000 8.440642728043269E+000 8.546812943569778E+000 8.654318616007330E+000 + 8.763176543335982E+000 8.873403734828367E+000 8.985017413707384E+000 9.098035019837468E+000 + 9.212474212449481E+000 9.328352872900114E+000 9.445689107465835E+000 9.564501250171986E+000 + 9.684807865657621E+000 9.806627752076144E+000 9.929979944032667E+000 1.005488371555816E+001 + 1.018135858312102E+001 1.030942430867664E+001 1.043910090275516E+001 1.057040862758825E+001 + 1.070336800027508E+001 1.083799979598811E+001 1.097432505121937E+001 1.111236506706729E+001 + 1.125214141256523E+001 1.139367592805156E+001 1.153699072858224E+001 1.168210820738647E+001 + 1.182905103936552E+001 1.197784218463586E+001 1.212850489211668E+001 1.228106270316251E+001 + 1.243553945524174E+001 1.259195928566114E+001 1.275034663533746E+001 1.291072625261636E+001 + 1.307312319713928E+001 1.323756284375925E+001 1.340407088650557E+001 1.357267334259870E+001 + 1.374339655651545E+001 1.391626720410529E+001 1.409131229675867E+001 1.426855918562738E+001 + 1.444803556589846E+001 1.462976948112149E+001 1.481378932759042E+001 1.500012385878069E+001 + 1.518880218984187E+001 1.537985380214707E+001 1.557330854789943E+001 1.576919665479652E+001 + 1.596754873075363E+001 1.616839576868612E+001 1.637176915135232E+001 1.657770065625708E+001 + 1.678622246061694E+001 1.699736714638814E+001 1.721116770535734E+001 1.742765754429690E+001 + 1.764687049018463E+001 1.786884079548925E+001 1.809360314352264E+001 1.832119265385890E+001 + 1.855164488782207E+001 1.878499585404262E+001 1.902128201408370E+001 1.926054028813861E+001 + 1.950280806079939E+001 1.974812318689843E+001 1.999652399742333E+001 2.024804930550604E+001 + 2.050273841248775E+001 2.076063111405951E+001 2.102176770648068E+001 2.128618899287514E+001 + 2.155393628960679E+001 2.182505143273556E+001 2.209957678455406E+001 2.237755524020708E+001 + 2.265903023439392E+001 2.294404574815500E+001 2.323264631574429E+001 2.352487703158756E+001 + 2.382078355732875E+001 2.412041212896457E+001 2.442380956406887E+001 2.473102326910822E+001 + 2.504210124684898E+001 2.535709210385811E+001 2.567604505809792E+001 2.599900994661633E+001 + 2.632603723333434E+001 2.665717801693076E+001 2.699248403882676E+001 2.733200769127052E+001 + 2.767580202552340E+001 2.802392076014966E+001 2.837641828940976E+001 2.873334969175986E+001 + 2.909477073845779E+001 2.946073790227733E+001 2.983130836633248E+001 3.020654003301210E+001 + 3.058649153302755E+001 3.097122223457379E+001 3.136079225260557E+001 3.175526245823091E+001 + 3.215469448822187E+001 3.255915075464585E+001 3.296869445461741E+001 3.338338958017277E+001 + 3.380330092826912E+001 3.422849411090882E+001 3.465903556539175E+001 3.509499256469619E+001 + 3.553643322799012E+001 3.598342653127542E+001 3.643604231816502E+001 3.689435131079654E+001 + 3.735842512088257E+001 3.782833626089998E+001 3.830415815542057E+001 3.878596515258330E+001 + 3.927383253571178E+001 3.976783653507726E+001 4.026805433980957E+001 4.077456410995854E+001 + 4.128744498870611E+001 4.180677711473313E+001 4.233264163474094E+001 4.286512071613055E+001 + 4.340429755984189E+001 4.395025641335360E+001 4.450308258384739E+001 4.506286245153721E+001 + 4.562968348316611E+001 4.620363424567365E+001 4.678480442003402E+001 4.737328481526944E+001 + 4.796916738263903E+001 4.857254523000610E+001 4.918351263638706E+001 4.980216506668199E+001 + 5.042859918659189E+001 5.106291287772257E+001 5.170520525287860E+001 5.235557667155054E+001 + 5.301412875559557E+001 5.368096440511674E+001 5.435618781454108E+001 5.503990448889986E+001 + 5.573222126031470E+001 5.643324630468944E+001 5.714308915861362E+001 5.786186073647745E+001 + 5.858967334780213E+001 5.932664071478911E+001 6.007287799008867E+001 6.082850177479340E+001 + 6.159363013665710E+001 6.236838262854275E+001 6.315288030710369E+001 6.394724575169803E+001 + 6.475160308354275E+001 6.556607798510755E+001 6.639079771975264E+001 6.722589115161468E+001 + 6.807148876574118E+001 6.892772268847985E+001 6.979472670812325E+001 7.067263629581315E+001 + 7.156158862670898E+001 7.246172260142080E+001 7.337317886771361E+001 7.429609984248353E+001 + 7.523062973401028E+001 7.617691456449101E+001 7.713510219285546E+001 7.810534233787011E+001 + 7.908778660153176E+001 8.008258849275511E+001 8.108990345135987E+001 8.210988887235747E+001 + 8.314270413054523E+001 8.418851060540868E+001 8.524747170633694E+001 8.631975289815679E+001 + 8.740552172698573E+001 8.850494784641242E+001 8.961820304400499E+001 9.074546126815267E+001 + 9.188689865524674E+001 9.304269355720088E+001 9.421302656932016E+001 9.539808055851896E+001 + 9.659804069189374E+001 9.781309446565707E+001 9.904343173443276E+001 + + + 1.424815571178932E-006 1.442737544795347E-006 1.460884949088410E-006 1.479260619626959E-006 + 1.497867427646906E-006 1.516708280499858E-006 1.535786122107404E-006 1.555103933421111E-006 + 1.574664732888298E-006 1.594471576923679E-006 1.614527560386933E-006 1.634835817066279E-006 + 1.655399520168141E-006 1.676221882812964E-006 1.697306158537278E-006 1.718655641802060E-006 + 1.740273668507505E-006 1.762163616514269E-006 1.784328906171262E-006 1.806773000850090E-006 + 1.829499407486210E-006 1.852511677126895E-006 1.875813405486095E-006 1.899408233506273E-006 + 1.923299847927314E-006 1.947491981862577E-006 1.971988415382210E-006 1.996792976103788E-006 + 2.021909539790388E-006 2.047342030956188E-006 2.073094423479674E-006 2.099170741224573E-006 + 2.125575058668584E-006 2.152311501540027E-006 2.179384247462498E-006 2.206797526607627E-006 + 2.234555622356054E-006 2.262662871966712E-006 2.291123667254536E-006 2.319942455276699E-006 + 2.349123739027457E-006 2.378672078141768E-006 2.408592089607735E-006 2.438888448488019E-006 + 2.469565888650339E-006 2.500629203507132E-006 2.532083246764542E-006 2.563932933180822E-006 + 2.596183239334272E-006 2.628839204400846E-006 2.661905930941522E-006 2.695388585699598E-006 + 2.729292400407999E-006 2.763622672606751E-006 2.798384766470734E-006 2.833584113647836E-006 + 2.869226214107668E-006 2.905316637000939E-006 2.941861021529652E-006 2.978865077828245E-006 + 3.016334587855796E-006 3.054275406299480E-006 3.092693461489370E-006 3.131594756324749E-006 + 3.170985369212085E-006 3.210871455014780E-006 3.251259246014890E-006 3.292155052886929E-006 + 3.333565265683919E-006 3.375496354835867E-006 3.417954872160758E-006 3.460947451888308E-006 + 3.504480811696568E-006 3.548561753761574E-006 3.593197165820213E-006 3.638394022246428E-006 + 3.684159385140989E-006 3.730500405434959E-006 3.777424324007037E-006 3.824938472814974E-006 + 3.873050276041185E-006 3.921767251252811E-006 3.971097010576341E-006 4.021047261887031E-006 + 4.071625810013278E-006 4.122840557956128E-006 4.174699508124142E-006 4.227210763583792E-006 + 4.280382529325576E-006 4.334223113546076E-006 4.388740928946114E-006 4.443944494045262E-006 + 4.499842434512880E-006 4.556443484515887E-006 4.613756488083511E-006 4.671790400489157E-006 + 4.730554289649712E-006 4.790057337542412E-006 4.850308841639545E-006 4.911318216361220E-006 + 4.973094994546355E-006 5.035648828942229E-006 5.098989493712732E-006 5.163126885965597E-006 + 5.228071027298863E-006 5.293832065366737E-006 5.360420275465210E-006 5.427846062137584E-006 + 5.496119960800201E-006 5.565252639388640E-006 5.635254900024580E-006 5.706137680703662E-006 + 5.777912057004582E-006 5.850589243819657E-006 5.924180597107200E-006 5.998697615665881E-006 + 6.074151942931454E-006 6.150555368796068E-006 6.227919831450454E-006 6.306257419249310E-006 + 6.385580372600104E-006 6.465901085875683E-006 6.547232109350906E-006 6.629586151163657E-006 + 6.712976079300532E-006 6.797414923607452E-006 6.882915877825635E-006 6.969492301653128E-006 + 7.057157722832291E-006 7.145925839263552E-006 7.235810521145697E-006 7.326825813143143E-006 + 7.418985936580434E-006 7.512305291664353E-006 7.606798459734005E-006 7.702480205539145E-006 + 7.799365479547215E-006 7.897469420279397E-006 7.996807356676018E-006 8.097394810491758E-006 + 8.199247498720913E-006 8.302381336053244E-006 8.406812437360658E-006 8.512557120215196E-006 + 8.619631907438707E-006 8.728053529684530E-006 8.837838928051731E-006 8.949005256732165E-006 + 9.061569885690847E-006 9.175550403380082E-006 9.290964619487647E-006 9.407830567719623E-006 + 9.526166508618185E-006 9.645990932414846E-006 9.767322561919628E-006 9.890180355446481E-006 + 1.001458350977560E-005 1.014055146315295E-005 1.026810389832752E-005 1.039726074562683E-005 + 1.052804218607104E-005 1.066046865452629E-005 1.079456084289771E-005 1.093033970336252E-005 + 1.106782645164395E-005 1.120704257032609E-005 1.134800981221077E-005 1.149075020371631E-005 + 1.163528604831928E-005 1.178163993003950E-005 1.192983471696869E-005 1.207989356484386E-005 + 1.223183992066527E-005 1.238569752636015E-005 1.254149042249244E-005 1.269924295201908E-005 + 1.285897976409380E-005 1.302072581791845E-005 1.318450638664302E-005 1.335034706131460E-005 + 1.351827375487599E-005 1.368831270621473E-005 1.386049048426290E-005 1.403483399214862E-005 + 1.421137047139973E-005 1.439012750620022E-005 1.457113302770051E-005 1.475441531838158E-005 + 1.494000301647423E-005 1.512792512043390E-005 1.531821099347161E-005 1.551089036814221E-005 + 1.570599335098998E-005 1.590355042725292E-005 1.610359246562617E-005 1.630615072308516E-005 + 1.651125684976977E-005 1.671894289392958E-005 1.692924130693149E-005 1.714218494833045E-005 + 1.735780709100360E-005 1.757614142634948E-005 1.779722206955215E-005 1.802108356491191E-005 + 1.824776089124290E-005 1.847728946733847E-005 1.870970515750566E-005 1.894504427716891E-005 + 1.918334359854443E-005 1.942464035638608E-005 1.966897225380312E-005 1.991637746815167E-005 + 2.016689465699980E-005 2.042056296416794E-005 2.067742202584522E-005 2.093751197678255E-005 + 2.120087345656396E-005 2.146754761595648E-005 2.173757612334003E-005 2.201100117121834E-005 + 2.228786548281134E-005 2.256821231873106E-005 2.285208548374097E-005 2.313952933360063E-005 + 2.343058878199644E-005 2.372530930755929E-005 2.402373696097099E-005 2.432591837215952E-005 + 2.463190075758514E-005 2.494173192761816E-005 2.525546029400918E-005 2.557313487745379E-005 + 2.589480531525196E-005 2.622052186906400E-005 2.655033543276419E-005 2.688429754039279E-005 + 2.722246037420862E-005 2.756487677284244E-005 2.791160023955318E-005 2.826268495058799E-005 + 2.861818576364716E-005 2.897815822645607E-005 2.934265858544439E-005 2.971174379453478E-005 + 3.008547152404208E-005 3.046390016968437E-005 3.084708886170747E-005 3.123509747412411E-005 + 3.162798663406936E-005 3.202581773127384E-005 3.242865292765585E-005 3.283655516703442E-005 + 3.324958818496434E-005 3.366781651869496E-005 3.409130551725433E-005 3.452012135166007E-005 + 3.495433102525876E-005 3.539400238419527E-005 3.583920412801396E-005 3.629000582039309E-005 + 3.674647790001423E-005 3.720869169156856E-005 3.767671941690137E-005 3.815063420629693E-005 + 3.863051010990531E-005 3.911642210931274E-005 3.960844612925773E-005 4.010665904949443E-005 + 4.061113871680524E-005 4.112196395716455E-005 4.163921458805545E-005 4.216297143094138E-005 + 4.269331632389464E-005 4.323033213438372E-005 4.377410277222160E-005 4.432471320267672E-005 + 4.488224945974912E-005 4.544679865961325E-005 4.601844901423014E-005 4.659728984513080E-005 + 4.718341159737266E-005 4.777690585367203E-005 4.837786534871390E-005 4.898638398364202E-005 + 4.960255684073118E-005 5.022648019824386E-005 5.085825154547411E-005 5.149796959798026E-005 + 5.214573431300950E-005 5.280164690511650E-005 5.346580986197818E-005 5.413832696040785E-005 + 5.481930328257037E-005 5.550884523240151E-005 5.620706055223386E-005 5.691405833963162E-005 + 5.762994906443753E-005 5.835484458603378E-005 5.908885817082044E-005 5.983210450991353E-005 + 6.058469973706564E-005 6.134676144681221E-005 6.211840871284581E-005 6.289976210662165E-005 + 6.369094371619722E-005 6.449207716530867E-005 6.530328763268737E-005 6.612470187161925E-005 + 6.695644822975030E-005 6.779865666914121E-005 6.865145878657410E-005 6.951498783411488E-005 + 7.038937873993410E-005 7.127476812938969E-005 7.217129434637519E-005 7.307909747493592E-005 + 7.399831936115771E-005 7.492910363533043E-005 7.587159573439059E-005 7.682594292464622E-005 + 7.779229432478742E-005 7.877080092918653E-005 7.976161563149129E-005 8.076489324851471E-005 + 8.178079054442560E-005 8.280946625524344E-005 8.385108111364084E-005 8.490579787405859E-005 + 8.597378133813635E-005 8.705519838046312E-005 8.815021797465211E-005 8.925901121974264E-005 + 9.038175136693514E-005 9.151861384666182E-005 9.266977629599800E-005 9.383541858641867E-005 + 9.501572285190309E-005 9.621087351739412E-005 9.742105732761478E-005 9.864646337624746E-005 + 9.988728313548058E-005 1.011437104859259E-004 1.024159417469131E-004 1.037041757071651E-004 + 1.050086136558590E-004 1.063294594140784E-004 1.076669193666603E-004 1.090212024944432E-004 + 1.103925204069213E-004 1.117810873753082E-004 1.131871203660179E-004 1.146108390745658E-004 + 1.160524659598967E-004 1.175122262791444E-004 1.189903481228286E-004 1.204870624504949E-004 + 1.220026031268018E-004 1.235372069580636E-004 1.250911137292509E-004 1.266645662414582E-004 + 1.282578103498419E-004 1.298710950020353E-004 1.315046722770475E-004 1.331587974246514E-004 + 1.348337289052664E-004 1.365297284303444E-004 1.382470610032614E-004 1.399859949607261E-004 + 1.417468020147071E-004 1.435297572948889E-004 1.453351393916617E-004 1.471632303996511E-004 + 1.490143159617964E-004 1.508886853139826E-004 1.527866313302345E-004 1.547084505684786E-004 + 1.566544433168809E-004 1.586249136407673E-004 1.606201694301351E-004 1.626405224477604E-004 + 1.646862883779130E-004 1.667577868756816E-004 1.688553416169208E-004 1.709792803488265E-004 + 1.731299349411468E-004 1.753076414380371E-004 1.775127401105684E-004 1.797455755098944E-004 + 1.820064965210891E-004 1.842958564176603E-004 1.866140129167494E-004 1.889613282350261E-004 + 1.913381691452843E-004 1.937449070337520E-004 1.961819179581208E-004 1.986495827063056E-004 + 2.011482868559441E-004 2.036784208346433E-004 2.062403799809848E-004 2.088345646062977E-004 + 2.114613800572074E-004 2.141212367789726E-004 2.168145503796177E-004 2.195417416948721E-004 + 2.223032368539276E-004 2.250994673460207E-004 2.279308700878554E-004 2.307978874918701E-004 + 2.337009675353674E-004 2.366405638305104E-004 2.396171356952008E-004 2.426311482248485E-004 + 2.456830723650432E-004 2.487733849851412E-004 2.519025689527764E-004 2.550711132093100E-004 + 2.582795128462290E-004 2.615282691825040E-004 2.648178898429222E-004 2.681488888374045E-004 + 2.715217866413205E-004 2.749371102768149E-004 2.783953933951539E-004 2.818971763601107E-004 + 2.854430063323981E-004 2.890334373551629E-004 2.926690304405579E-004 2.963503536573990E-004 + 3.000779822199285E-004 3.038524985776933E-004 3.076744925065532E-004 3.115445612008362E-004 + 3.154633093666492E-004 3.194313493163658E-004 3.234493010643013E-004 3.275177924235903E-004 + 3.316374591042861E-004 3.358089448126885E-004 3.400329013519266E-004 3.443099887238031E-004 + 3.486408752319216E-004 3.530262375861108E-004 3.574667610081602E-004 3.619631393388889E-004 + 3.665160751465591E-004 3.711262798366534E-004 3.757944737630347E-004 3.805213863405012E-004 + 3.853077561587603E-004 3.901543310978340E-004 3.950618684449164E-004 4.000311350127033E-004 + 4.050629072592057E-004 4.101579714090741E-004 4.153171235764481E-004 4.205411698893498E-004 + 4.258309266156448E-004 4.311872202905832E-004 4.366108878459491E-004 4.421027767408329E-004 + 4.476637450940471E-004 4.532946618182115E-004 4.589964067555203E-004 4.647698708152199E-004 + 4.706159561128161E-004 4.765355761110301E-004 4.825296557625311E-004 4.885991316544592E-004 + 4.947449521547709E-004 5.009680775604233E-004 5.072694802474214E-004 5.136501448227566E-004 + 5.201110682782494E-004 5.266532601463351E-004 5.332777426578031E-004 5.399855509015227E-004 + 5.467777329861804E-004 5.536553502040450E-004 5.606194771967997E-004 5.676712021234555E-004 + 5.748116268303787E-004 5.820418670234579E-004 5.893630524424330E-004 5.967763270374205E-004 + 6.042828491476587E-004 6.118837916824984E-004 6.195803423046766E-004 6.273737036158857E-004 + 6.352650933446865E-004 6.432557445367794E-004 6.513469057476694E-004 6.595398412377587E-004 + 6.678358311698857E-004 6.762361718093556E-004 6.847421757264837E-004 6.933551720016873E-004 + 7.020765064331589E-004 7.109075417471465E-004 7.198496578108846E-004 7.289042518482011E-004 + 7.380727386578355E-004 7.473565508345065E-004 7.567571389927542E-004 7.662759719936037E-004 + 7.759145371740779E-004 7.856743405795952E-004 7.955569071992958E-004 8.055637812043192E-004 + 8.156965261890882E-004 8.259567254156214E-004 8.363459820609223E-004 8.468659194674800E-004 + 8.575181813969166E-004 8.683044322868308E-004 8.792263575108690E-004 8.902856636420673E-004 + 9.014840787195107E-004 9.128233525183375E-004 9.243052568231492E-004 9.359315857048528E-004 + 9.477041558009898E-004 9.596248065995906E-004 9.716954007265943E-004 9.839178242368911E-004 + 9.962939869090216E-004 1.008825822543581E-003 1.021515289265387E-003 1.034364369829428E-003 + 1.047375071930687E-003 1.060549428517836E-003 1.073889498110894E-003 1.087397365122878E-003 + 1.101075140185490E-003 1.114924960478911E-003 1.128948990065739E-003 1.143149420229128E-003 + 1.157528469815184E-003 1.172088385579660E-003 1.186831442539014E-003 1.201759944325892E-003 + 1.216876223549070E-003 1.232182642157933E-003 1.247681591811527E-003 1.263375494252270E-003 + 1.279266801684348E-003 1.295357997156876E-003 1.311651594951887E-003 1.328150140977185E-003 + 1.344856213164154E-003 1.361772421870560E-003 1.378901410288430E-003 1.396245854857056E-003 + 1.413808465681187E-003 1.431591986954497E-003 1.449599197388365E-003 1.467832910646056E-003 + 1.486295975782366E-003 1.504991277688785E-003 1.523921737544271E-003 1.543090313271691E-003 + 1.562500000000000E-003 1.582153830532242E-003 1.602054875819421E-003 1.622206245440352E-003 + 1.642611088087539E-003 1.663272592059155E-003 1.684193985757237E-003 1.705378538192113E-003 + 1.726829559493200E-003 1.748550401426221E-003 1.770544457916916E-003 1.792815165581363E-003 + 1.815366004262943E-003 1.838200497576080E-003 1.861322213456811E-003 1.884734764720282E-003 + 1.908441809625266E-003 1.932447052445758E-003 1.956754244049789E-003 1.981367182485501E-003 + 2.006289713574596E-003 2.031525731513268E-003 2.057079179480659E-003 2.082954050255006E-003 + 2.109154386837506E-003 2.135684283084057E-003 2.162547884344924E-003 2.189749388112459E-003 + 2.217293044676966E-003 2.245183157790821E-003 2.273424085340940E-003 2.302020240029712E-003 + 2.330976090064486E-003 2.360296159855740E-003 2.389985030724031E-003 2.420047341615833E-003 + 2.450487789828390E-003 2.481311131743663E-003 2.512522183571537E-003 2.544125822102361E-003 + 2.576126985468951E-003 2.608530673918192E-003 2.641341950592331E-003 2.674565942320102E-003 + 2.708207840417807E-003 2.742272901500467E-003 2.776766448303186E-003 2.811693870512827E-003 + 2.847060625610172E-003 2.882872239722658E-003 2.919134308487848E-003 2.955852497927766E-003 + 2.993032545334214E-003 3.030680260165243E-003 3.068801524952888E-003 3.107402296222331E-003 + 3.146488605422621E-003 3.186066559869087E-003 3.226142343697637E-003 3.266722218831027E-003 + 3.307812525957304E-003 3.349419685520562E-003 3.391550198724130E-003 3.434210648546411E-003 + 3.477407700769483E-003 3.521148105020638E-003 3.565438695827038E-003 3.610286393683601E-003 + 3.655698206134363E-003 3.701681228867409E-003 3.748242646823591E-003 3.795389735319201E-003 + 3.843129861182736E-003 3.891470483905988E-003 3.940419156809609E-003 3.989983528223323E-003 + 4.040171342681011E-003 4.090990442130784E-003 4.142448767160325E-003 4.194554358237613E-003 + 4.247315356967258E-003 4.300740007362668E-003 4.354836657134143E-003 4.409613758993280E-003 + 4.465079871973697E-003 4.521243662768377E-003 4.578113907083914E-003 4.635699491011670E-003 + 4.694009412416301E-003 4.753052782341665E-003 4.812838826434424E-003 4.873376886385618E-003 + 4.934676421390265E-003 4.996747009625429E-003 5.059598349746818E-003 5.123240262404178E-003 + 5.187682691775861E-003 5.252935707122548E-003 5.319009504360653E-003 5.385914407655433E-003 + 5.453660871034128E-003 5.522259480019490E-003 5.591720953283720E-003 5.662056144323345E-003 + 5.733276043155073E-003 5.805391778032975E-003 5.878414617187367E-003 5.952355970585410E-003 + 6.027227391714021E-003 6.103040579385086E-003 6.179807379563402E-003 6.257539787217702E-003 + 6.336249948194807E-003 6.415950161117518E-003 6.496652879306267E-003 6.578370712724938E-003 + 6.661116429951285E-003 6.744902960171945E-003 6.829743395202745E-003 6.915650991534278E-003 + 7.002639172403226E-003 7.090721529889855E-003 7.179911827041703E-003 7.270224000024170E-003 + 7.361672160298038E-003 7.454270596824380E-003 7.548033778297318E-003 7.642976355404698E-003 + 7.739113163117365E-003 7.836459223007129E-003 7.935029745593878E-003 8.034840132722331E-003 + 8.135905979968517E-003 8.238243079076703E-003 8.341867420426844E-003 8.446795195533074E-003 + 8.553042799573758E-003 8.660626833953163E-003 8.769564108895555E-003 8.879871646071794E-003 + 8.991566681258955E-003 9.104666667033563E-003 9.219189275498465E-003 9.335152401044253E-003 + 9.452574163145235E-003 9.571472909190604E-003 9.691867217351362E-003 9.813775899483073E-003 + 9.937218004065359E-003 1.006221281917823E-002 1.018877987551580E-002 1.031693894943818E-002 + 1.044671006606136E-002 1.057811350238637E-002 1.071116979046747E-002 1.084589972062037E-002 + 1.098232434467078E-002 1.112046497924375E-002 1.126034320909448E-002 1.140198089048100E-002 + 1.154540015457914E-002 1.169062341094076E-002 1.183767335099508E-002 1.198657295159442E-002 + 1.213734547860434E-002 1.229001449053889E-002 1.244460384224184E-002 1.260113768861387E-002 + 1.275964048838695E-002 1.292013700794605E-002 1.308265232519885E-002 1.324721183349435E-002 + 1.341384124559046E-002 1.358256659767188E-002 1.375341425341815E-002 1.392641090812303E-002 + 1.410158359286583E-002 1.427895967873489E-002 1.445856688110451E-002 1.464043326396552E-002 + 1.482458724431020E-002 1.501105759657267E-002 1.519987345712483E-002 1.539106432882903E-002 + 1.558466008564801E-002 1.578069097731259E-002 1.597918763404845E-002 1.618018107136203E-002 + 1.638370269488683E-002 1.658978430529064E-002 1.679845810324430E-002 1.700975669445336E-002 + 1.722371309475251E-002 1.744036073526463E-002 1.765973346762436E-002 1.788186556926738E-002 + 1.810679174878657E-002 1.833454715135502E-002 1.856516736421781E-002 1.879868842225241E-002 + 1.903514681359918E-002 1.927457948536292E-002 1.951702384938565E-002 1.976251778809254E-002 + 2.001109966041100E-002 2.026280830776427E-002 2.051768306014067E-002 2.077576374223873E-002 + 2.103709067969017E-002 2.130170470536057E-002 2.156964716572984E-002 2.184095992735258E-002 + 2.211568538339970E-002 2.239386646028273E-002 2.267554662436082E-002 2.296076988873272E-002 + 2.324958082011383E-002 2.354202454579968E-002 2.383814676071747E-002 2.413799373456567E-002 + 2.444161231904402E-002 2.474904995517412E-002 2.506035468071199E-002 2.537557513765447E-002 + 2.569476057983916E-002 2.601796088064085E-002 2.634522654076414E-002 2.667660869613416E-002 + 2.701215912588698E-002 2.735193026045983E-002 2.769597518978382E-002 2.804434767157915E-002 + 2.839710213975479E-002 2.875429371291418E-002 2.911597820296721E-002 2.948221212385138E-002 + 2.985305270036198E-002 3.022855787709347E-002 3.060878632749378E-002 3.099379746303177E-002 + 3.138365144248073E-002 3.177840918131817E-002 3.217813236124380E-002 3.258288343981787E-002 + 3.299272566021973E-002 3.340772306113023E-002 3.382794048673762E-002 3.425344359686949E-002 + 3.468429887725260E-002 3.512057364990098E-002 3.556233608363552E-002 3.600965520473531E-002 + 3.646260090772301E-002 3.692124396628633E-002 3.738565604433618E-002 3.785590970720466E-002 + 3.833207843298340E-002 3.881423662400445E-002 3.930245961846625E-002 3.979682370220484E-002 + 4.029740612061417E-002 4.080428509071562E-002 4.131753981337938E-002 4.183725048570025E-002 + 4.236349831352798E-002 4.289636552415640E-002 4.343593537917140E-002 4.398229218746040E-002 + 4.453552131838644E-002 4.509570921512662E-002 4.566294340817960E-002 4.623731252904216E-002 + 4.681890632405786E-002 4.740781566844057E-002 4.800413258047334E-002 4.860795023588697E-002 + 4.921936298241870E-002 4.983846635455391E-002 5.046535708845426E-002 5.110013313707215E-002 + 5.174289368545674E-002 5.239373916625151E-002 5.305277127538680E-002 5.372009298797067E-002 + 5.439580857437820E-002 5.508002361654460E-002 5.577284502446236E-002 5.647438105288584E-002 + 5.718474131824694E-002 5.790403681578218E-002 5.863237993687657E-002 5.936988448662470E-002 + 6.011666570161272E-002 6.087284026792503E-002 6.163852633937587E-002 6.241384355597177E-002 + 6.319891306260537E-002 6.399385752798407E-002 6.479880116379814E-002 6.561386974412814E-002 + 6.643919062509811E-002 6.727489276477494E-002 6.812110674331799E-002 6.897796478338326E-002 + 6.984560077078260E-002 7.072415027540432E-002 7.161375057239612E-002 7.251454066361403E-002 + 7.342666129934274E-002 7.435025500028704E-002 7.528546607984191E-002 7.623244066664135E-002 + 7.719132672739093E-002 7.816227408998877E-002 7.914543446693542E-002 8.014096147904017E-002 + 8.114901067942420E-002 8.216973957782571E-002 8.320330766521203E-002 8.424987643869933E-002 + 8.530960942678788E-002 8.638267221491326E-002 8.746923247131899E-002 8.856945997325605E-002 + 8.968352663350976E-002 9.081160652726249E-002 9.195387591929291E-002 9.311051329151718E-002 + 9.428169937087821E-002 9.546761715758340E-002 9.666845195369983E-002 9.788439139210769E-002 + 9.911562546581773E-002 1.003623465576593E-001 1.016247494703391E-001 1.029030314568808E-001 + 1.041973922514456E-001 1.055080341005409E-001 1.068351617946222E-001 1.081789827000916E-001 + 1.095397067916998E-001 1.109175466853546E-001 1.123127176713423E-001 1.137254377479684E-001 + 1.151559276556185E-001 1.166044109112514E-001 1.180711138433229E-001 1.195562656271498E-001 + 1.210600983207203E-001 1.225828469009518E-001 1.241247493004083E-001 1.256860464444771E-001 + 1.272669822890127E-001 1.288678038584580E-001 1.304887612844395E-001 1.321301078448531E-001 + 1.337921000034385E-001 1.354749974498514E-001 1.371790631402421E-001 1.389045633383411E-001 + 1.406517676570653E-001 1.424209491006445E-001 1.442123841072780E-001 1.460263525923308E-001 + 1.478631379920690E-001 1.497230273079483E-001 1.516063111514585E-001 1.535132837895314E-001 + 1.554442431905218E-001 1.573994910707643E-001 1.593793329417183E-001 1.613840781577045E-001 + 1.634140399642410E-001 1.654695355469907E-001 1.675508860813196E-001 1.696584167824838E-001 + 1.717924569564432E-001 1.739533400513162E-001 1.761414037094833E-001 1.783569898203423E-001 + 1.806004445737307E-001 1.828721185140186E-001 1.851723665948802E-001 1.875015482347587E-001 + 1.898600273730234E-001 1.922481725268383E-001 1.946663568487429E-001 1.971149581849565E-001 + 1.995943591344204E-001 2.021049471085765E-001 2.046471143919041E-001 2.072212582032135E-001 + 2.098277807577118E-001 2.124670893298518E-001 2.151395963169668E-001 2.178457193037112E-001 + 2.205858811273078E-001 2.233605099436157E-001 2.261700392940330E-001 2.290149081732362E-001 + 2.318955610977760E-001 2.348124481755328E-001 2.377660251760463E-001 2.407567536017327E-001 + 2.437851007599924E-001 2.468515398362304E-001 2.499565499677917E-001 2.531006163188256E-001 + 2.562842301560969E-001 2.595078889257439E-001 2.627720963310085E-001 2.660773624109393E-001 + 2.694242036200849E-001 2.728131429091945E-001 2.762447098069257E-001 2.797194405025886E-001 + 2.832378779299240E-001 2.868005718519375E-001 2.904080789468036E-001 2.940609628948445E-001 + 2.977597944666094E-001 3.015051516120572E-001 3.052976195508609E-001 3.091377908638527E-001 + 3.130262655856123E-001 3.169636512982264E-001 3.209505632262240E-001 3.249876243327041E-001 + 3.290754654166793E-001 3.332147252116345E-001 3.374060504853346E-001 3.416500961408815E-001 + 3.459475253190425E-001 3.502990095018708E-001 3.547052286176220E-001 3.591668711469982E-001 + 3.636846342307223E-001 3.682592237784666E-001 3.728913545791561E-001 3.775817504126512E-001 + 3.823311441628444E-001 3.871402779321724E-001 3.920099031575697E-001 3.969407807278864E-001 + 4.019336811027734E-001 4.069893844330731E-001 4.121086806827176E-001 4.172923697521596E-001 + 4.225412616033641E-001 4.278561763863603E-001 4.332379445673968E-001 4.386874070587024E-001 + 4.442054153498765E-001 4.497928316409427E-001 4.554505289770628E-001 4.611793913849567E-001 + 4.669803140110322E-001 4.728542032612498E-001 4.788019769427572E-001 4.848245644072913E-001 + 4.909229066963972E-001 4.970979566884657E-001 5.033506792476196E-001 5.096820513744817E-001 + 5.160930623588265E-001 5.225847139341642E-001 5.291580204342619E-001 5.358140089516319E-001 + 5.425537194980236E-001 5.493782051669200E-001 5.562885322980924E-001 5.632857806442152E-001 + 5.703710435395765E-001 5.775454280709207E-001 5.848100552504253E-001 5.921660601908680E-001 + 5.996145922829879E-001 6.071568153750763E-001 6.147939079548382E-001 6.225270633335249E-001 + 6.303574898323987E-001 6.382864109715322E-001 6.463150656609825E-001 6.544447083943817E-001 + 6.626766094449447E-001 6.710120550639593E-001 6.794523476817635E-001 6.879988061112483E-001 + 6.966527657539338E-001 7.054155788086180E-001 7.142886144826703E-001 7.232732592059681E-001 + 7.323709168475266E-001 7.415830089348640E-001 7.509109748761085E-001 7.603562721849175E-001 + 7.699203767082138E-001 7.796047828567845E-001 7.894110038387961E-001 7.993405718962254E-001 + 8.093950385442844E-001 8.195759748138445E-001 8.298849714969081E-001 8.403236393951835E-001 + 8.508936095717647E-001 8.615965336059981E-001 8.724340838515406E-001 8.834079536976644E-001 + 8.945198578338623E-001 9.057715325177601E-001 9.171647358464201E-001 9.287012480310441E-001 + 9.403828716751286E-001 9.522114320561377E-001 9.641887774106932E-001 9.763167792233765E-001 + 9.885973325191471E-001 1.001032356159439E+000 1.013623793141998E+000 1.026373610904469E+000 + 1.039283801631815E+000 1.052356382567609E+000 1.065593396329212E+000 1.078996911226960E+000 + 1.092569021587322E+000 1.106311848080155E+000 1.120227538050062E+000 1.134318265851908E+000 + 1.148586233190584E+000 1.163033669465011E+000 1.177662832116502E+000 1.192476006981487E+000 + 1.207475508648672E+000 1.222663680820713E+000 1.238042896680410E+000 + + + +-3.959624422322239E+001 -3.959625385320293E+001 -3.959626365265639E+001 -3.959627363427202E+001 +-3.959628381049185E+001 -3.959629419351949E+001 -3.959630479532859E+001 -3.959631563552769E+001 +-3.959632679662119E+001 -3.959633824025218E+001 -3.959634895829286E+001 -3.959636096043304E+001 +-3.959637326635907E+001 -3.959638588377608E+001 -3.959639882055205E+001 -3.959641208478321E+001 +-3.959642482061974E+001 -3.959643874103972E+001 -3.959645301380638E+001 -3.959646764783876E+001 +-3.959648265226726E+001 -3.959649803652388E+001 -3.959651381012080E+001 -3.959652998296047E+001 +-3.959654656512785E+001 -3.959656228255710E+001 -3.959657968021117E+001 -3.959659751820813E+001 +-3.959661580762333E+001 -3.959663455995469E+001 -3.959665272687897E+001 -3.959667241201253E+001 +-3.959669259532957E+001 -3.959671328951007E+001 -3.959673450747822E+001 -3.959675626250315E+001 +-3.959677856807991E+001 -3.959680143816168E+001 -3.959682488712718E+001 -3.959684892956729E+001 +-3.959687358045201E+001 -3.959689885523004E+001 -3.959692476967803E+001 -3.959694964703533E+001 +-3.959697684508745E+001 -3.959700473148285E+001 -3.959703332357536E+001 -3.959706130022479E+001 +-3.959709132248835E+001 -3.959712210450277E+001 -3.959715366545179E+001 -3.959718602506627E+001 +-3.959721920363561E+001 -3.959725322174640E+001 -3.959728810073616E+001 -3.959732386241821E+001 +-3.959736052912092E+001 -3.959739812369802E+001 -3.959743666963212E+001 -3.959747619091922E+001 +-3.959751671224312E+001 -3.959755825884703E+001 -3.959760085672698E+001 -3.959764453234449E+001 +-3.959768931306181E+001 -3.959773522686079E+001 -3.959778230241007E+001 -3.959782809197516E+001 +-3.959787751601688E+001 -3.959792819061214E+001 -3.959797831202674E+001 -3.959803153579206E+001 +-3.959808610607536E+001 -3.959814205673877E+001 -3.959819942276579E+001 -3.959825824013600E+001 +-3.959831854558553E+001 -3.959838037659943E+001 -3.959844377170353E+001 -3.959850877077351E+001 +-3.959857541414056E+001 -3.959864374326736E+001 -3.959871380086004E+001 -3.959878563065821E+001 +-3.959885927754785E+001 -3.959893478716450E+001 -3.959901220673706E+001 -3.959909158449379E+001 +-3.959917296986502E+001 -3.959925641354704E+001 -3.959934196757856E+001 -3.959942968529555E+001 +-3.959951962136442E+001 -3.959961183181136E+001 -3.959970637415143E+001 -3.959980330736803E+001 +-3.959990269178395E+001 -3.960000458943888E+001 -3.960010906376169E+001 -3.960021617987327E+001 +-3.960032177447619E+001 -3.960043426779335E+001 -3.960054682068021E+001 -3.960066500283769E+001 +-3.960078617283736E+001 -3.960091040603426E+001 -3.960103777998404E+001 -3.960116837371622E+001 +-3.960130226827267E+001 -3.960143954748899E+001 -3.960158029639967E+001 -3.960172460295617E+001 +-3.960187255692673E+001 -3.960202425001235E+001 -3.960217977687456E+001 -3.960233923385778E+001 +-3.960250272014594E+001 -3.960267033772063E+001 -3.960284219049998E+001 -3.960301838570417E+001 +-3.960319903271947E+001 -3.960338424337389E+001 -3.960357413296531E+001 -3.960376881915365E+001 +-3.960396842292008E+001 -3.960417306819384E+001 -3.960438288197346E+001 -3.960459799453165E+001 +-3.960481853973278E+001 -3.960504465450713E+001 -3.960527647890746E+001 -3.960551415699551E+001 +-3.960575783565987E+001 -3.960600766615320E+001 -3.960626380373282E+001 -3.960652640650666E+001 +-3.960679563741736E+001 -3.960707166303802E+001 -3.960735465434943E+001 -3.960764478725350E+001 +-3.960794224096051E+001 -3.960824719981267E+001 -3.960855985230738E+001 -3.960888039140300E+001 +-3.960920901608949E+001 -3.960954592903887E+001 -3.960989133851782E+001 -3.961024545803881E+001 +-3.961060850604117E+001 -3.961098070732739E+001 -3.961136229162902E+001 -3.961175349450270E+001 +-3.961215455731018E+001 -3.961256572717987E+001 -3.961298725812046E+001 -3.961341940908272E+001 +-3.961385113269051E+001 -3.961429945781320E+001 -3.961476466031022E+001 -3.961524157870063E+001 +-3.961573050426911E+001 -3.961623173956241E+001 -3.961674559259257E+001 -3.961727237834213E+001 +-3.961781242133592E+001 -3.961836605106301E+001 -3.961893360900636E+001 -3.961951544408767E+001 +-3.962011191120283E+001 -3.962072337650537E+001 -3.962135021396065E+001 -3.962199280788710E+001 +-3.962265155098670E+001 -3.962332684672803E+001 -3.962401910839040E+001 -3.962472875705509E+001 +-3.962545622673819E+001 -3.962620196120464E+001 -3.962696641546403E+001 -3.962775005481082E+001 +-3.962855335624653E+001 -3.962937681062910E+001 -3.963022091545676E+001 -3.963108618400486E+001 +-3.963197314489632E+001 -3.963288233423840E+001 -3.963381430301356E+001 -3.963476961585763E+001 +-3.963574885210996E+001 -3.963675260455043E+001 -3.963778147779157E+001 -3.963883609429405E+001 +-3.963991708980490E+001 -3.964102511471709E+001 -3.964216083777580E+001 -3.964332494317706E+001 +-3.964451813116897E+001 -3.964574111566558E+001 -3.964699462966875E+001 -3.964827942659944E+001 +-3.964959627610289E+001 -3.965094596519575E+001 -3.965232929702616E+001 -3.965374709729971E+001 +-3.965520021295357E+001 -3.965668950747217E+001 -3.965821586612641E+001 -3.965978019465902E+001 +-3.966138342043062E+001 -3.966302649385507E+001 -3.966471038535632E+001 -3.966643608775642E+001 +-3.966820461817282E+001 -3.967001701891080E+001 -3.967187435440663E+001 -3.967377771278021E+001 +-3.967572821017840E+001 -3.967772698670711E+001 -3.967977520928349E+001 -3.968187407255830E+001 +-3.968402479531592E+001 -3.968622862692985E+001 -3.968848684422215E+001 -3.969080075207050E+001 +-3.969317168811222E+001 -3.969560101643839E+001 -3.969809013283709E+001 -3.970064046584488E+001 +-3.970325347490444E+001 -3.970593065129921E+001 -3.970867351798940E+001 -3.971148363535628E+001 +-3.971436259688690E+001 -3.971731202771502E+001 -3.972033359043128E+001 -3.972342898412528E+001 +-3.972659994610670E+001 -3.972984825047364E+001 -3.973317570677385E+001 -3.973658416300761E+001 +-3.974007550953901E+001 -3.974365167655071E+001 -3.974731463034571E+001 -3.975106638139673E+001 +-3.975490898213205E+001 -3.975884452604420E+001 -3.976287515117252E+001 -3.976700303664419E+001 +-3.977123040633841E+001 -3.977555953090206E+001 -3.977999272554747E+001 -3.978453235015787E+001 +-3.978918081022131E+001 -3.979394055963083E+001 -3.979881410065585E+001 -3.980380398150628E+001 +-3.980891279907638E+001 -3.981414320043779E+001 -3.981949788022260E+001 -3.982497958321085E+001 +-3.983059110611984E+001 -3.983633529525559E+001 -3.984221504646986E+001 -3.984823330790708E+001 +-3.985439307976844E+001 -3.986069741224780E+001 -3.986714940905466E+001 -3.987375222571273E+001 +-3.988050906805398E+001 -3.988742319644839E+001 -3.989449792250991E+001 -3.990173660753597E+001 +-3.990914266777280E+001 -3.991671957296776E+001 -3.992447084048937E+001 -3.993240004063362E+001 +-3.994051079586599E+001 -3.994880677534161E+001 -3.995729170107003E+001 -3.996596934425022E+001 +-3.997484352281001E+001 -3.998391810470068E+001 -3.999319700396335E+001 -4.000268417927282E+001 +-4.001238363466462E+001 -4.002229941785579E+001 -4.003243561752453E+001 -4.004279636378524E+001 +-4.005338582571950E+001 -4.006420820841491E+001 -4.007526775258853E+001 -4.008656873257435E+001 +-4.009811545434859E+001 -4.010991225140452E+001 -4.012196348320845E+001 -4.013427353249168E+001 +-4.014684680109113E+001 -4.015968771038958E+001 -4.017280069636121E+001 -4.018619020155356E+001 +-4.019986067752056E+001 -4.021381658169957E+001 -4.022806236655482E+001 -4.024260247832386E+001 +-4.025744135498729E+001 -4.027258342029845E+001 -4.028803307766791E+001 -4.030379470263949E+001 +-4.031987264126917E+001 -4.033627120446770E+001 -4.035299465862101E+001 -4.037004722113040E+001 +-4.038743305215781E+001 -4.040515625043559E+001 -4.042322084522425E+001 -4.044163078673675E+001 +-4.046038994077573E+001 -4.047950207780458E+001 -4.049897086704922E+001 -4.051879986679895E+001 +-4.053899251516101E+001 -4.055955212386759E+001 -4.058048186418223E+001 -4.060178475638114E+001 +-4.062346366315550E+001 -4.064552127967315E+001 -4.066796011952887E+001 -4.069078250402461E+001 +-4.071399055198499E+001 -4.073758616870347E+001 -4.076157103408228E+001 -4.078594658663473E+001 +-4.081071401578915E+001 -4.083587424746926E+001 -4.086142792880906E+001 -4.088737542223959E+001 +-4.091371678551491E+001 -4.094045175696474E+001 -4.096757974759171E+001 -4.099509982621129E+001 +-4.102301070524802E+001 -4.105131072504656E+001 -4.107999784004303E+001 -4.110906960641775E+001 +-4.113852316988388E+001 -4.116835525038687E+001 -4.119856212704838E+001 -4.122913962534739E+001 +-4.126008310281662E+001 -4.129138743910027E+001 -4.132304702158214E+001 -4.135505572989688E+001 +-4.138740692741445E+001 -4.142009344709812E+001 -4.145310758008198E+001 -4.148644106795610E+001 +-4.152008508728126E+001 -4.155403024093830E+001 -4.158826655276783E+001 -4.162278345547695E+001 +-4.165756978231397E+001 -4.169261376189576E+001 -4.172790301122655E+001 -4.176342452968175E+001 +-4.179916469568556E+001 -4.183510926462677E+001 -4.187124336365805E+001 -4.190755149117378E+001 +-4.194401751935484E+001 -4.198062469280887E+001 -4.201735563065912E+001 -4.205419233060698E+001 +-4.209111617592109E+001 -4.212810794112944E+001 -4.216514779731067E+001 -4.220221532371206E+001 +-4.223928951789279E+001 -4.227634880672285E+001 -4.231337106193568E+001 -4.235033361567424E+001 +-4.238721327475213E+001 -4.242398633869050E+001 -4.246062862193686E+001 -4.249711547483102E+001 +-4.253342180433381E+001 -4.256952209987960E+001 -4.260539046016859E+001 -4.264100061835472E+001 +-4.267632597178967E+001 -4.271133961131588E+001 -4.274601435359618E+001 -4.278032277487175E+001 +-4.281423724250126E+001 -4.284772995156664E+001 -4.288077296192242E+001 -4.291333823517571E+001 +-4.294539767292859E+001 -4.297692315614239E+001 -4.300788658632446E+001 -4.303825992551376E+001 +-4.306801523937721E+001 -4.309712473948586E+001 -4.312556082491562E+001 -4.315329612757731E+001 +-4.318030355517750E+001 -4.320655633619381E+001 -4.323202806416063E+001 -4.325669274043040E+001 +-4.328052482032509E+001 -4.330349925834413E+001 -4.332559155094251E+001 -4.334677778076352E+001 +-4.336703466143051E+001 -4.338633957940118E+001 -4.340467063703568E+001 -4.342200669662034E+001 +-4.343832742090601E+001 -4.345361331278325E+001 -4.346784575642702E+001 -4.348100705674133E+001 +-4.349308047724875E+001 -4.350405027717395E+001 -4.351390174774717E+001 -4.352262124726816E+001 +-4.353019623471035E+001 -4.353661530225310E+001 -4.354186820612621E+001 -4.354594589631882E+001 +-4.354884054514665E+001 -4.355054557350576E+001 -4.355105567568366E+001 -4.355036684343142E+001 +-4.354847638691513E+001 -4.354538295389044E+001 -4.354108654786082E+001 -4.353558854409998E+001 +-4.352889170317948E+001 -4.352100018156423E+001 -4.351191954147816E+001 -4.350165675795539E+001 +-4.349022022268107E+001 -4.347761974602678E+001 -4.346386655603686E+001 -4.344897329484915E+001 +-4.343295401254769E+001 -4.341582415797911E+001 -4.339760056595358E+001 -4.337830144219731E+001 +-4.335794634481226E+001 -4.333655616186607E+001 -4.331415308678017E+001 -4.329076058990246E+001 +-4.326640338607654E+001 -4.324110739928062E+001 -4.321489972368241E+001 -4.318780858134167E+001 +-4.315986327642790E+001 -4.313109414544411E+001 -4.310153250461207E+001 -4.307121059366671E+001 +-4.304016151628120E+001 -4.300841917769293E+001 -4.297601821893730E+001 -4.294299394848011E+001 +-4.290938227099564E+001 -4.287521961354832E+001 -4.284054284989391E+001 -4.280538922247148E+001 +-4.276979626250813E+001 -4.273380170905182E+001 -4.269744342678402E+001 -4.266075932266887E+001 +-4.262378726220760E+001 -4.258656498572839E+001 -4.254913002484299E+001 -4.251151961931686E+001 +-4.247377063487595E+001 -4.243591948232704E+001 -4.239800203835091E+001 -4.236005356821910E+001 +-4.232210865085646E+001 -4.228420110670304E+001 -4.224636392830116E+001 -4.220862921423593E+001 +-4.217102810678582E+001 -4.213359073321885E+001 -4.209634615111398E+001 -4.205932229788326E+001 +-4.202254594471989E+001 -4.198604265506128E+001 -4.194983674768567E+001 -4.191395126443923E+001 +-4.187840794271904E+001 -4.184322719278221E+001 -4.180842807964157E+001 -4.177402830971891E+001 +-4.174004422208472E+001 -4.170649078408281E+001 -4.167338159134914E+001 -4.164072887196771E+001 +-4.160854349461746E+001 -4.157683498049085E+001 -4.154561151871239E+001 -4.151487998508778E+001 +-4.148464596389050E+001 -4.145491377241514E+001 -4.142568648803468E+001 -4.139696597746462E+001 +-4.136875292797397E+001 -4.134104688023588E+001 -4.131384626254455E+001 -4.128714842611944E+001 +-4.126094968120724E+001 -4.123524533373017E+001 -4.121002972221524E+001 -4.118529625475959E+001 +-4.116103744579230E+001 -4.113724495240997E+001 -4.111390961008259E+001 -4.109102146753341E+001 +-4.106856982061737E+001 -4.104654324503528E+001 -4.102492962774496E+001 -4.100371619694189E+001 +-4.098288955049977E+001 -4.096243568278015E+001 -4.094234000973876E+001 -4.092258739227847E+001 +-4.090316215780146E+001 -4.088404811994393E+001 -4.086522859649053E+001 -4.084668642547640E+001 +-4.082840397951054E+001 -4.081036317835947E+001 -4.079254549984673E+001 -4.077493198914320E+001 +-4.075750326654364E+001 -4.074023953382294E+001 -4.072312057927762E+001 -4.070612578159226E+001 +-4.068923411266333E+001 -4.067242413952578E+001 -4.065567402555048E+001 -4.063896153107815E+001 +-4.062226401366831E+001 -4.060555842815108E+001 -4.058882132668231E+001 -4.057202885900578E+001 +-4.055515677312526E+001 -4.053818041660601E+001 -4.052107473872596E+001 -4.050381429369295E+001 +-4.048637324515210E+001 -4.046872537220580E+001 -4.045084407716515E+001 -4.043270239524563E+001 +-4.041427300641514E+001 -4.039552824959622E+001 -4.037644013940550E+001 -4.035698038560230E+001 +-4.033712041540193E+001 -4.031683139878376E+001 -4.029608427690121E+001 -4.027484979367080E+001 +-4.025309853058457E+001 -4.023080094475345E+001 -4.020792741014667E+001 -4.018444826194668E+001 +-4.016033384388997E+001 -4.013555455841021E+001 -4.011008091934276E+001 -4.008388360688748E+001 +-4.005693352446495E+001 -4.002920185703660E+001 -4.000066013038764E+001 -3.997128027081121E+001 +-3.994103466456078E+001 -3.990989621637193E+001 -3.987783840630577E+001 -3.984483534409548E+001 +-3.981086182013963E+001 -3.977589335224729E+001 -3.973990622719733E+001 -3.970287753617811E+001 +-3.966478520315997E+001 -3.962560800527201E+001 -3.958532558428436E+001 -3.954391844833957E+001 +-3.950136796317405E+001 -3.945765633214353E+001 -3.941276656447339E+001 -3.936668243129992E+001 +-3.931938840921839E+001 -3.927086961122075E+001 -3.922111170507708E+001 -3.917010081943430E+001 +-3.911782343807818E+001 -3.906426628300703E+001 -3.900941618720385E+001 -3.895325995813640E+001 +-3.889578423321370E+001 -3.883697532857892E+001 -3.877681908273917E+001 -3.871530069665008E+001 +-3.865240457189442E+001 -3.858811414863106E+001 -3.852241174494580E+001 -3.845527839913985E+001 +-3.838669371636971E+001 -3.831663572082950E+001 -3.824508071442265E+001 -3.817200314253141E+001 +-3.809737546713617E+001 -3.802116804710825E+001 -3.794334902496166E+001 -3.786388421884738E+001 +-3.778273701794684E+001 -3.769986827875206E+001 -3.761523621904136E+001 -3.752879630560395E+001 +-3.744050113100351E+001 -3.735030027385471E+001 -3.725814013633087E+001 -3.716396375186932E+001 +-3.706771055533252E+001 -3.696931610737339E+001 -3.686871176438089E+001 -3.676582428529409E+001 +-3.666057536693921E+001 -3.655288110036830E+001 -3.644265134218848E+001 -3.632978899726477E+001 +-3.621418921253964E+001 -3.609573848628547E+001 -3.597431370300207E+001 -3.584978111147404E+001 +-3.572199527224459E+001 -3.559079801080024E+001 -3.545601742378953E+001 -3.531746699710136E+001 +-3.517494490585584E+001 -3.502823357622079E+001 -3.487709959620228E+001 -3.472129406564835E+001 +-3.456055347302387E+001 -3.439460117666948E+001 -3.422314954999603E+001 -3.404590282285145E+001 +-3.386256061552667E+001 -3.367282211889420E+001 -3.347639082674549E+001 -3.327297967837047E+001 +-3.306231642557412E+001 -3.284414900390122E+001 -3.261825066777087E+001 -3.238442464744304E+001 +-3.214250810437295E+001 -3.189237520035545E+001 -3.163393915217515E+001 -3.136715321215296E+001 +-3.109201058918671E+001 -3.080854339700434E+001 -3.051682077906126E+001 -3.021694640683766E+001 +-2.990905557637376E+001 -2.959331213537850E+001 -2.926990546131848E+001 -2.893904768275773E+001 +-2.860097129647674E+001 -2.825592728675647E+001 -2.790418380569671E+001 -2.754602542884180E+001 +-2.718175296187562E+001 -2.681168374363328E+001 -2.643615236888547E+001 -2.605551174101892E+001 +-2.567013435888192E+001 -2.528041374229176E+001 -2.488676590544256E+001 -2.448963079518096E+001 +-2.408947362047910E+001 -2.368678600932860E+001 -2.328208693887347E+001 -2.287592339333025E+001 +-2.246887071177796E+001 -2.206153259407756E+001 -2.165454073798715E+001 -2.124855408404616E+001 +-2.084425764713963E+001 -2.044236091497493E+001 -2.004359579417128E+001 -1.964871408444628E+001 +-1.925848446062146E+001 -1.887368894100901E+001 -1.849511881933488E+001 -1.812357003581853E+001 +-1.775983796155302E+001 -1.740471156908653E+001 -1.705896696132256E+001 -1.672336023084910E+001 +-1.639861962292675E+001 -1.608543697810289E+001 -1.578445843537438E+001 -1.549627438472702E+001 +-1.522140866967019E+001 -1.496030705715428E+001 -1.471332501534683E+001 -1.448071487071766E+001 +-1.426261245655528E+001 -1.405902341752106E+001 -1.386980940147944E+001 -1.369467445324832E+001 +-1.353315202794706E+001 -1.338459316729963E+001 -1.324815653376933E+001 -1.312280117797825E+001 +-1.300728312774491E+001 -1.290015713544758E+001 -1.279978520739085E+001 -1.270435386757408E+001 +-1.261190248202305E+001 -1.252036539255855E+001 -1.242763108556672E+001 -1.233162215912159E+001 +-1.223040046110953E+001 -1.212230246700639E+001 -1.200611077036348E+001 -1.188126850144401E+001 +-1.174814460768029E+001 -1.160835944477409E+001 -1.146518402115629E+001 -1.132280407179867E+001 +-1.118218989168451E+001 -1.104331785872899E+001 -1.090616668641812E+001 -1.077071544792547E+001 +-1.063694343630547E+001 -1.050483016425221E+001 -1.037435536387954E+001 -1.024549898648309E+001 +-1.011824120225304E+001 -9.992562399913206E+000 -9.868443186270932E+000 -9.745864385665094E+000 +-9.624807039307031E+000 -9.505252404509125E+000 -9.387181953799780E+000 -9.270577373928035E+000 +-9.155420564758977E+000 -9.041693638065841E+000 -8.929378916223136E+000 -8.818458930806344E+000 +-8.708916421101794E+000 -8.600734333274142E+000 -8.493895816559178E+000 -8.388384222195361E+000 +-8.284183107116700E+000 -8.181276223554081E+000 -8.079647517800044E+000 -7.979281139011116E+000 +-7.880161428197857E+000 -7.782272914648133E+000 -7.685600318873758E+000 -7.590128548919757E+000 +-7.495842698362337E+000 -7.402728044281923E+000 -7.310770045201123E+000 -7.219954339049376E+000 +-7.130266741097813E+000 -7.041693241918789E+000 -6.954220005346530E+000 -6.867833366443412E+000 +-6.782519829475073E+000 -6.698266065896354E+000 -6.615058912350452E+000 -6.532885368681790E+000 +-6.451732595964483E+000 -6.371587914547370E+000 -6.292438802116163E+000 -6.214272891774091E+000 +-6.137077970141021E+000 -6.060841975472012E+000 -5.985552995795609E+000 -5.911199267071920E+000 +-5.837769171371101E+000 -5.765251235071945E+000 -5.693634127080952E+000 -5.622906657071764E+000 +-5.553057773744779E+000 -5.484076563107118E+000 -5.415952246772511E+000 -5.348674180281180E+000 +-5.282231851439473E+000 -5.216614878678951E+000 -5.151813009434896E+000 -5.087816118543952E+000 +-5.024614206660758E+000 -4.962197398693361E+000 -4.900555942257230E+000 -4.839680206147747E+000 +-4.779560678831080E+000 -4.720187966953350E+000 -4.661552793835557E+000 -4.603645998151747E+000 +-4.546458532352778E+000 -4.489981461093135E+000 -4.434205960236691E+000 -4.379123315283386E+000 +-4.324724919839739E+000 -4.271002274455124E+000 -4.217946985237782E+000 -4.165550762538802E+000 +-4.113805419653025E+000 -4.062702871536509E+000 -4.012235133540450E+000 -3.962394320161430E+000 +-3.913172643807676E+000 -3.864562413581273E+000 -3.816556034076072E+000 -3.769146004191123E+000 +-3.722324915959468E+000 -3.676085453391948E+000 -3.630420391335976E+000 -3.585322594349039E+000 +-3.540785015586642E+000 -3.496800695704459E+000 -3.453362761774627E+000 -3.410464426215798E+000 +-3.368098985736761E+000 -3.326259820293465E+000 -3.284940392059132E+000 -3.244134244407273E+000 +-3.203835000907359E+000 -3.164036364332936E+000 -3.124732115681998E+000 -3.085916113209257E+000 +-3.047582291470274E+000 -3.009724660377183E+000 -2.972337304265751E+000 -2.935414380973737E+000 +-2.898950120930256E+000 -2.862938826256054E+000 -2.827374869874560E+000 -2.792252694633524E+000 +-2.757566812437220E+000 -2.723311803388990E+000 -2.689482314944101E+000 -2.656073061072815E+000 +-2.623078821433511E+000 -2.590494440555879E+000 -2.558314827033982E+000 -2.526534952729197E+000 +-2.495149851982928E+000 -2.464154620838935E+000 -2.433544416275329E+000 -2.403314455446000E+000 +-2.373460014931491E+000 -2.343976429999216E+000 -2.314859093872842E+000 -2.286103457010875E+000 +-2.257705026394218E+000 -2.229659364822695E+000 -2.201962090220418E+000 -2.174608874949822E+000 +-2.147595445134400E+000 -2.120917579989881E+000 -2.094571111163854E+000 -2.068551922083709E+000 +-2.042855947312708E+000 -2.017479171914232E+000 -1.992417630823918E+000 -1.967667408229740E+000 +-1.943224636959844E+000 -1.919085497878015E+000 -1.895246219286778E+000 -1.871703076337889E+000 +-1.848452390450245E+000 -1.825490528735059E+000 -1.802813903428163E+000 -1.780418971329452E+000 +-1.758302233249252E+000 -1.736460233461611E+000 -1.714889559164406E+000 -1.693586839946112E+000 +-1.672548747259256E+000 -1.651771993900352E+000 -1.631253333496329E+000 -1.610989559997323E+000 +-1.590977507175718E+000 -1.571214048131446E+000 -1.551696094803352E+000 -1.532420597486635E+000 +-1.513384544356245E+000 -1.494584960996125E+000 -1.476018909934304E+000 -1.457683490183649E+000 +-1.439575836788294E+000 -1.421693120375618E+000 -1.404032546713658E+000 -1.386591356273957E+000 +-1.369366823799665E+000 -1.352356257878858E+000 -1.335557000523053E+000 -1.318966427020459E+000 +-1.302581944420165E+000 -1.286400992820359E+000 -1.270421043808944E+000 -1.254639600362399E+000 +-1.239054196452522E+000 -1.223662396657451E+000 -1.208461795776663E+000 -1.193450018449908E+000 +-1.178624719393483E+000 -1.163983580515975E+000 -1.149524314397601E+000 -1.135244661294176E+000 +-1.121142389443103E+000 -1.107215294698165E+000 -1.093461200163570E+000 -1.079877955891535E+000 +-1.066463437839677E+000 -1.053215552162067E+000 -1.040132217590330E+000 -1.027211850796977E+000 +-1.014451620253952E+000 -1.001849900379708E+000 -9.894047210561528E-001 -9.771141382321297E-001 +-9.649762314791170E-001 -9.529891042245537E-001 -9.411508834554730E-001 -9.294597195302924E-001 +-9.179137854626759E-001 -9.065112772914954E-001 -8.952504133516535E-001 -8.841294341102472E-001 +-8.731466018916424E-001 -8.623002006059632E-001 -8.515885354809387E-001 -8.410099327971033E-001 +-8.305627396262671E-001 -8.202453235732438E-001 -8.100560725207732E-001 -7.999933943774529E-001 +-7.900557168293979E-001 -7.802414870943259E-001 -7.705491716789135E-001 -7.609772561391901E-001 +-7.515242448438997E-001 -7.421886607408139E-001 -7.329690451259345E-001 -7.238639574155717E-001 +-7.148719749212562E-001 -7.059916926274302E-001 -6.972217229719252E-001 -6.885606956291402E-001 +-6.800072572959326E-001 -6.715600714801644E-001 -6.632178182914461E-001 -6.549791942366218E-001 +-6.468429120134611E-001 -6.388077003113125E-001 -6.308723036120029E-001 -6.230354819936503E-001 +-6.152960109369360E-001 -6.076526811337597E-001 -6.001042982982882E-001 -5.926496829803486E-001 +-5.852876703811285E-001 -5.780171101711836E-001 -5.708368663106879E-001 -5.637458168719287E-001 +-5.567428538640069E-001 -5.498268830597020E-001 -5.429968238245080E-001 -5.362516089477720E-001 +-5.295901844759453E-001 -5.230115095479038E-001 -5.165145562323030E-001 -5.100983093669719E-001 +-5.037617664002824E-001 -4.975039372345033E-001 -4.913238440710975E-001 -4.852205212579329E-001 +-4.791930151384047E-001 -4.732403839024175E-001 -4.673616974392293E-001 -4.615560371921216E-001 +-4.558224960148674E-001 -4.501601780299943E-001 -4.445681984887966E-001 -4.390456836330927E-001 +-4.335917705587028E-001 -4.282056070806111E-001 -4.228863515998176E-001 -4.176331729718307E-001 +-4.124452503768011E-001 -4.073217731912699E-001 -4.022619408615019E-001 -3.972649627784022E-001 +-3.923300581539789E-001 -3.874564558993426E-001 -3.826433945042280E-001 -3.778901219179976E-001 +-3.731958954321414E-001 -3.685599815642194E-001 -3.639816559432570E-001 -3.594602031965630E-001 +-3.549949168379451E-001 -3.505850991573267E-001 -3.462300611117225E-001 -3.419291222175767E-001 +-3.376816104444386E-001 -3.334868621099500E-001 -3.293442217761512E-001 -3.252530421470610E-001 +-3.212126839675380E-001 -3.172225159233980E-001 -3.132819145427642E-001 -3.093902640986557E-001 +-3.055469565127718E-001 -3.017513912604827E-001 -2.980029752769965E-001 -2.943011228646885E-001 +-2.906452556015889E-001 -2.870348022509996E-001 -2.834691986722382E-001 -2.799478877324925E-001 +-2.764703192197627E-001 -2.730359497568949E-001 -2.696442427166725E-001 -2.662946681379695E-001 +-2.629867026429443E-001 -2.597198293552571E-001 -2.564935378193113E-001 -2.533073239204900E-001 +-2.501606898063886E-001 -2.470531438090256E-001 -2.439842003680159E-001 -2.409533799547039E-001 +-2.379602089972332E-001 -2.350042198065516E-001 -2.320849505033352E-001 -2.292019449458151E-001 +-2.263547526585080E-001 -2.235429287618262E-001 -2.207660339025646E-001 -2.180236341852526E-001 +-2.153153011043542E-001 -2.126406114773162E-001 -2.099991473784422E-001 -2.073904960735922E-001 +-2.048142499556933E-001 -2.022700064810474E-001 -1.997573681064362E-001 -1.972759422270011E-001 +-1.948253411148996E-001 -1.924051818587228E-001 -1.900150863036626E-001 -1.876546809924264E-001 +-1.853235971068816E-001 -1.830214704104282E-001 -1.807479411910869E-001 -1.785026542052909E-001 +-1.762852586223813E-001 -1.740954079697865E-001 -1.719327600788865E-001 -1.697969770315491E-001 +-1.676877251073272E-001 -1.656046747313170E-001 -1.635475004226588E-001 -1.615158807436814E-001 +-1.595094982496771E-001 -1.575280394392986E-001 -1.555711947055760E-001 -1.536386582875383E-001 +-1.517301282224379E-001 -1.498453062985700E-001 -1.479838980086735E-001 -1.461456125039168E-001 +-1.443301625484495E-001 -1.425372644745219E-001 -1.407666381381631E-001 -1.390180068754051E-001 +-1.372910974590560E-001 -1.355856400560057E-001 -1.339013681850651E-001 -1.322380186753281E-001 +-1.305953316250492E-001 -1.289730503610352E-001 -1.273709213985379E-001 -1.257886944016469E-001 +-1.242261221441756E-001 -1.226829604710290E-001 -1.211589682600567E-001 + + + +-2.028817480728866E-003 -2.054336863470290E-003 -2.080177240545214E-003 -2.106342649565853E-003 +-2.132837178931358E-003 -2.159664968466627E-003 -2.186830210069168E-003 -2.214337148364096E-003 +-2.242190081367352E-003 -2.270393361157302E-003 -2.298951394554734E-003 -2.327868643811450E-003 +-2.357149627307494E-003 -2.386798920257165E-003 -2.416821155423910E-003 -2.447221023844192E-003 +-2.478003275560480E-003 -2.509172720363463E-003 -2.540734228543574E-003 -2.572692731652009E-003 +-2.605053223271271E-003 -2.637820759795437E-003 -2.671000461220237E-003 -2.704597511943056E-003 +-2.738617161573027E-003 -2.773064725751271E-003 -2.807945586981496E-003 -2.843265195471019E-003 +-2.879029069982379E-003 -2.915242798695658E-003 -2.951912040081643E-003 -2.989042523785979E-003 +-3.026640051524441E-003 -3.064710497989467E-003 -3.103259811768096E-003 -3.142294016271445E-003 +-3.181819210675887E-003 -3.221841570876060E-003 -3.262367350449866E-003 -3.303402881635622E-003 +-3.344954576321466E-003 -3.387028927047250E-003 -3.429632508019012E-003 -3.472771976136204E-003 +-3.516454072031877E-003 -3.560685621125887E-003 -3.605473534691413E-003 -3.650824810934851E-003 +-3.696746536089304E-003 -3.743245885521842E-003 -3.790330124854640E-003 -3.838006611100282E-003 +-3.886282793811303E-003 -3.935166216244200E-003 -3.984664516538107E-003 -4.034785428908252E-003 +-4.085536784854457E-003 -4.136926514384850E-003 -4.188962647254929E-003 -4.241653314222257E-003 +-4.295006748316907E-003 -4.349031286127890E-003 -4.403735369105789E-003 -4.459127544881754E-003 +-4.515216468603103E-003 -4.572010904285704E-003 -4.629519726183393E-003 -4.687751920174596E-003 +-4.746716585166404E-003 -4.806422934516322E-003 -4.866880297471865E-003 -4.928098120628293E-003 +-4.990085969404679E-003 -5.052853529538525E-003 -5.116410608599224E-003 -5.180767137520485E-003 +-5.245933172152101E-003 -5.311918894831213E-003 -5.378734615973324E-003 -5.446390775683360E-003 +-5.514897945386957E-003 -5.584266829482282E-003 -5.654508267012662E-003 -5.725633233360193E-003 +-5.797652841960722E-003 -5.870578346040340E-003 -5.944421140373740E-003 -6.019192763064720E-003 +-6.094904897349035E-003 -6.171569373419976E-003 -6.249198170276866E-003 -6.327803417596834E-003 +-6.407397397630138E-003 -6.487992547119303E-003 -6.569601459242458E-003 -6.652236885581017E-003 +-6.735911738112220E-003 -6.820639091226660E-003 -6.906432183771239E-003 -6.993304421117789E-003 +-7.081269377257732E-003 -7.170340796923071E-003 -7.260532597734082E-003 -7.351858872374007E-003 +-7.444333890791133E-003 -7.537972102428498E-003 -7.632788138481732E-003 -7.728796814185240E-003 +-7.826013131127171E-003 -7.924452279593512E-003 -8.024129640941628E-003 -8.125060790003684E-003 +-8.227261497520351E-003 -8.330747732605013E-003 -8.435535665239108E-003 -8.541641668798708E-003 +-8.649082322613013E-003 -8.757874414554967E-003 -8.868034943664451E-003 -8.979581122804534E-003 +-9.092530381351044E-003 -9.206900367916066E-003 -9.322708953105644E-003 -9.439974232312180E-003 +-9.558714528542000E-003 -9.678948395278412E-003 -9.800694619380853E-003 -9.923972224020470E-003 +-1.004880047165263E-002 -1.017519886702686E-002 -1.030318716023456E-002 -1.043278534979518E-002 +-1.056401368578109E-002 -1.069689267298186E-002 -1.083144307410834E-002 -1.096768591303696E-002 +-1.110564247809488E-002 -1.124533432538658E-002 -1.138678328216209E-002 -1.153001145022779E-002 +-1.167504120939999E-002 -1.182189522100198E-002 -1.197059643140512E-002 -1.212116807561443E-002 +-1.227363368089934E-002 -1.242801707046997E-002 -1.258434236719989E-002 -1.274263399739552E-002 +-1.290291669461302E-002 -1.306521550352319E-002 -1.322955578382503E-002 -1.339596321420846E-002 +-1.356446379636692E-002 -1.373508385906052E-002 -1.390785006223020E-002 -1.408278940116368E-002 +-1.425992921071388E-002 -1.443929716957031E-002 -1.462092130458430E-002 -1.480482999514860E-002 +-1.499105197763198E-002 -1.517961634986983E-002 -1.537055257571107E-002 -1.556389048962235E-002 +-1.575966030135019E-002 -1.595789260064164E-002 -1.615861836202459E-002 -1.636186894964791E-002 +-1.656767612218274E-002 -1.677607203778534E-002 -1.698708925912228E-002 -1.720076075845912E-002 +-1.741711992281281E-002 -1.763620055916910E-002 -1.785803689976567E-002 -1.808266360744130E-002 +-1.831011578105306E-002 -1.854042896096092E-002 -1.877363913458184E-002 -1.900978274201363E-002 +-1.924889668172941E-002 -1.949101831634404E-002 -1.973618547845269E-002 -1.998443647654330E-002 +-2.023581010098313E-002 -2.049034563008071E-002 -2.074808283622420E-002 -2.100906199209678E-002 +-2.127332387697039E-002 -2.154090978307872E-002 -2.181186152207005E-002 -2.208622143154184E-002 +-2.236403238165701E-002 -2.264533778184383E-002 -2.293018158758002E-002 -2.321860830726198E-002 +-2.351066300916109E-002 -2.380639132846672E-002 -2.410583947441852E-002 -2.440905423752830E-002 +-2.471608299689240E-002 -2.502697372759687E-002 -2.534177500821505E-002 -2.566053602839993E-002 +-2.598330659657214E-002 -2.631013714770420E-002 -2.664107875120346E-002 -2.697618311889355E-002 +-2.731550261309678E-002 -2.765909025481810E-002 -2.800699973203179E-002 -2.835928540807314E-002 +-2.871600233013491E-002 -2.907720623787139E-002 -2.944295357211053E-002 -2.981330148367548E-002 +-3.018830784231779E-002 -3.056803124576228E-002 -3.095253102886646E-002 -3.134186727289492E-002 +-3.173610081491029E-002 -3.213529325728297E-002 -3.253950697731998E-002 -3.294880513701542E-002 +-3.336325169292365E-002 -3.378291140615639E-002 -3.420784985250638E-002 -3.463813343269777E-002 +-3.507382938276605E-002 -3.551500578456857E-002 -3.596173157642715E-002 -3.641407656390524E-002 +-3.687211143072010E-002 -3.733590774979292E-002 -3.780553799443805E-002 -3.828107554969256E-002 +-3.876259472378949E-002 -3.925017075977456E-002 -3.974387984726980E-002 -4.024379913438537E-002 +-4.075000673978076E-002 -4.126258176487892E-002 -4.178160430623323E-002 -4.230715546805098E-002 +-4.283931737487418E-002 -4.337817318442032E-002 -4.392380710058483E-002 -4.447630438660732E-002 +-4.503575137840374E-002 -4.560223549806652E-002 -4.617584526753473E-002 -4.675667032243670E-002 +-4.734480142610662E-002 -4.794033048377836E-002 -4.854335055695773E-002 -4.915395587797592E-002 +-4.977224186472661E-002 -5.039830513558845E-002 -5.103224352453597E-002 -5.167415609644078E-002 +-5.232414316256564E-002 -5.298230629625397E-002 -5.364874834881699E-002 -5.432357346562136E-002 +-5.500688710237957E-002 -5.569879604164559E-002 -5.639940840951892E-002 -5.710883369255874E-002 +-5.782718275491189E-002 -5.855456785565671E-002 -5.929110266636529E-002 -6.003690228888801E-002 +-6.079208327336158E-002 -6.155676363644488E-002 -6.233106287978473E-002 -6.311510200871438E-002 +-6.390900355118846E-002 -6.471289157695638E-002 -6.552689171697795E-002 -6.635113118308440E-002 +-6.718573878788668E-002 -6.803084496493624E-002 -6.888658178913928E-002 -6.975308299742940E-002 +-7.063048400970137E-002 -7.151892195000864E-002 -7.241853566802933E-002 -7.332946576080276E-002 +-7.425185459474096E-002 -7.518584632791817E-002 -7.613158693264184E-002 -7.708922421830922E-002 +-7.805890785455229E-002 -7.904078939467564E-002 -8.003502229939079E-002 -8.104176196084992E-002 +-8.206116572698419E-002 -8.309339292614952E-002 -8.413860489208405E-002 -8.519696498918163E-002 +-8.626863863808441E-002 -8.735379334160023E-002 -8.845259871094702E-002 -8.956522649232987E-002 +-9.069185059385480E-002 -9.183264711278250E-002 -9.298779436312811E-002 -9.415747290360968E-002 +-9.534186556595135E-002 -9.654115748354489E-002 -9.775553612047413E-002 -9.898519130090784E-002 +-1.002303152388646E-001 -1.014911025683556E-001 -1.027677503739090E-001 -1.040604582214825E-001 +-1.053694281897671E-001 -1.066948649018881E-001 -1.080369755575096E-001 -1.093959699653452E-001 +-1.107720605760821E-001 -1.121654625157232E-001 -1.135763936193535E-001 -1.150050744653339E-001 +-1.164517284099313E-001 -1.179165816223882E-001 -1.193998631204377E-001 -1.209018048062717E-001 +-1.224226415029651E-001 -1.239626109913644E-001 -1.255219540474463E-001 -1.271009144801509E-001 +-1.286997391696972E-001 -1.303186781063877E-001 -1.319579844299060E-001 -1.336179144691172E-001 +-1.352987277823739E-001 -1.370006871983380E-001 -1.387240588573228E-001 -1.404691122531626E-001 +-1.422361202756182E-001 -1.440253592533226E-001 -1.458371089972762E-001 -1.476716528448984E-001 +-1.495292777046427E-001 -1.514102741011814E-001 -1.533149362211706E-001 -1.552435619595989E-001 +-1.571964529667325E-001 -1.591739146956594E-001 -1.611762564504451E-001 -1.632037914349051E-001 +-1.652568368020032E-001 -1.673357137038848E-001 -1.694407473425517E-001 -1.715722670211899E-001 +-1.737306061961553E-001 -1.759161025296298E-001 -1.781290979429542E-001 -1.803699386706483E-001 +-1.826389753151274E-001 -1.849365629021230E-001 -1.872630609368197E-001 -1.896188334607157E-001 +-1.920042491092182E-001 -1.944196811699826E-001 -1.968655076420062E-001 -1.993421112954861E-001 +-2.018498797324523E-001 -2.043892054481860E-001 -2.069604858934348E-001 -2.095641235374329E-001 +-2.122005259317415E-001 -2.148701057749170E-001 -2.175732809780196E-001 -2.203104747309757E-001 +-2.230821155698013E-001 -2.258886374447028E-001 -2.287304797890656E-001 -2.316080875893416E-001 +-2.345219114558501E-001 -2.374724076945028E-001 -2.404600383794669E-001 -2.434852714267795E-001 +-2.465485806689262E-001 -2.496504459303952E-001 -2.527913531042270E-001 -2.559717942295632E-001 +-2.591922675702193E-001 -2.624532776942890E-001 -2.657553355547955E-001 -2.690989585714083E-001 +-2.724846707132337E-001 -2.759130025827015E-001 -2.793844915005585E-001 -2.828996815919863E-001 +-2.864591238738595E-001 -2.900633763431580E-001 -2.937130040665553E-001 -2.974085792711925E-001 +-3.011506814366616E-001 -3.049398973882104E-001 -3.087768213911884E-001 -3.126620552467531E-001 +-3.165962083888506E-001 -3.205798979824931E-001 -3.246137490233517E-001 -3.286983944386766E-001 +-3.328344751895747E-001 -3.370226403746558E-001 -3.412635473350703E-001 -3.455578617609591E-001 +-3.499062577993325E-001 -3.543094181634051E-001 -3.587680342434013E-001 -3.632828062188553E-001 +-3.678544431724310E-001 -3.724836632052744E-001 -3.771711935539311E-001 -3.819177707088450E-001 +-3.867241405344626E-001 -3.915910583909683E-001 -3.965192892576697E-001 -4.015096078580608E-001 +-4.065627987865872E-001 -4.116796566371330E-001 -4.168609861332624E-001 -4.221076022602311E-001 +-4.274203303988018E-001 -4.328000064608846E-001 -4.382474770270289E-001 -4.437635994857964E-001 +-4.493492421750331E-001 -4.550052845250802E-001 -4.607326172039389E-001 -4.665321422644219E-001 +-4.724047732933221E-001 -4.783514355626163E-001 -4.843730661827447E-001 -4.904706142579840E-001 +-4.966450410439469E-001 -5.028973201072384E-001 -5.092284374872905E-001 -5.156393918604119E-001 +-5.221311947060761E-001 -5.287048704754802E-001 -5.353614567623987E-001 -5.421020044763651E-001 +-5.489275780182090E-001 -5.558392554579733E-001 -5.628381287152459E-001 -5.699253037419316E-001 +-5.771019007074855E-001 -5.843690541866460E-001 -5.917279133496873E-001 -5.991796421552178E-001 +-6.067254195455539E-001 -6.143664396446890E-001 -6.221039119588860E-001 -6.299390615799171E-001 +-6.378731293909664E-001 -6.459073722752278E-001 -6.540430633272033E-001 -6.622814920667364E-001 +-6.706239646557830E-001 -6.790718041179455E-001 -6.876263505607771E-001 -6.962889614008683E-001 +-7.050610115917270E-001 -7.139438938544570E-001 -7.229390189112367E-001 -7.320478157216037E-001 +-7.412717317215328E-001 -7.506122330653134E-001 -7.600708048702065E-001 -7.696489514638691E-001 +-7.793481966345362E-001 -7.891700838839144E-001 -7.991161766827856E-001 -8.091880587292627E-001 +-8.193873342096691E-001 -8.297156280619929E-001 -8.401745862418466E-001 -8.507658759908927E-001 +-8.614911861076410E-001 -8.723522272205507E-001 -8.833507320633417E-001 -8.944884557524108E-001 +-9.057671760662455E-001 -9.171886937267100E-001 -9.287548326820588E-001 -9.404674403915364E-001 +-9.523283881113831E-001 -9.643395711820728E-001 -9.765029093165835E-001 -9.888203468894696E-001 +-1.001293853226508E+000 -1.013925422894649E+000 -1.026717075991993E+000 -1.039670858437484E+000 +-1.052788842259979E+000 -1.066073125886349E+000 -1.079525834428184E+000 -1.093149119966715E+000 +-1.106945161835474E+000 -1.120916166900193E+000 -1.135064369835422E+000 -1.149392033397267E+000 +-1.163901448691655E+000 -1.178594935437428E+000 -1.193474842223565E+000 -1.208543546759753E+000 +-1.223803456119464E+000 -1.239257006974664E+000 -1.254906665821174E+000 -1.270754929193668E+000 +-1.286804323869197E+000 -1.303057407058045E+000 -1.319516766580669E+000 -1.336185021029349E+000 +-1.353064819913086E+000 -1.370158843784216E+000 -1.387469804345035E+000 -1.405000444532687E+000 +-1.422753538580389E+000 -1.440731892052960E+000 -1.458938341854480E+000 -1.477375756205747E+000 +-1.496047034589050E+000 -1.514955107657624E+000 -1.534102937106927E+000 -1.553493515504754E+000 +-1.573129866076947E+000 -1.593015042445283E+000 -1.613152128313870E+000 -1.633544237100173E+000 +-1.654194511506503E+000 -1.675106123027535E+000 -1.696282271389190E+000 -1.717726183913813E+000 +-1.739441114806355E+000 -1.761430344355871E+000 -1.783697178046282E+000 -1.806244945570003E+000 +-1.829076999737613E+000 -1.852196715276283E+000 -1.875607487509307E+000 -1.899312730908489E+000 +-1.923315877510741E+000 -1.947620375189636E+000 -1.972229685772121E+000 -1.997147282989995E+000 +-2.022376650255116E+000 -2.047921278246644E+000 -2.073784662297916E+000 -2.099970299569804E+000 +-2.126481685996620E+000 -2.153322312989809E+000 -2.180495663883817E+000 -2.208005210107558E+000 +-2.235854407064004E+000 -2.264046689699338E+000 -2.292585467742087E+000 -2.321474120591525E+000 +-2.350715991833440E+000 -2.380314383360134E+000 -2.410272549070232E+000 -2.440593688122476E+000 +-2.471280937716347E+000 -2.502337365370739E+000 -2.533765960670462E+000 -2.565569626448665E+000 +-2.597751169371538E+000 -2.630313289889977E+000 -2.663258571520923E+000 -2.696589469419258E+000 +-2.730308298199076E+000 -2.764417218961069E+000 -2.798918225480672E+000 -2.833813129509299E+000 +-2.869103545138713E+000 -2.904790872176232E+000 -2.940876278475934E+000 -2.977360681168561E+000 +-3.014244726730218E+000 -3.051528769827246E+000 -3.089212850872030E+000 -3.127296672221627E+000 +-3.165779572948441E+000 -3.204660502109164E+000 -3.243937990435502E+000 -3.283610120367262E+000 +-3.323674494345509E+000 -3.364128201280778E+000 -3.404967781108426E+000 -3.446189187340603E+000 +-3.487787747521684E+000 -3.529758121491481E+000 -3.572094257358363E+000 -3.614789345082161E+000 +-3.657835767565024E+000 -3.701225049146692E+000 -3.744947801399513E+000 -3.788993666117757E+000 +-3.833351255395430E+000 -3.878008088686955E+000 -3.922950526746200E+000 -3.968163702340630E+000 +-4.013631447640185E+000 -4.059336218183590E+000 -4.105259013329529E+000 -4.151379293105737E+000 +-4.197674891376169E+000 -4.244121925255153E+000 -4.290694700707675E+000 -4.337365614287368E+000 +-4.384105050978182E+000 -4.430881278122568E+000 -4.477660335438553E+000 -4.524405921150438E+000 +-4.571079274283605E+000 -4.617639053203084E+000 -4.664041210508705E+000 -4.710238864437144E+000 +-4.756182166963260E+000 -4.801818168840506E+000 -4.847090681872980E+000 -4.891940138770752E+000 +-4.936303451005698E+000 -4.980113865157736E+000 -5.023300818321835E+000 -5.065789793234936E+000 +-5.107502173879481E+000 -5.148355102427454E+000 -5.188261338506033E+000 -5.227129121894043E+000 +-5.264862039897698E+000 -5.301358900805475E+000 -5.336513614985766E+000 -5.370215085367773E+000 +-5.402347109236228E+000 -5.432788293474650E+000 -5.461411985609499E+000 -5.488086223239763E+000 +-5.512673704681952E+000 -5.535031783919887E+000 -5.555012493220594E+000 -5.572462597061281E+000 +-5.587223681306849E+000 -5.599132281879747E+000 -5.608020057473048E+000 -5.613714011169411E+000 +-5.616036766139668E+000 -5.614806900900751E+000 -5.609839349907543E+000 -5.600945875530880E+000 +-5.587935617726307E+000 -5.570615727916385E+000 -5.548792093782930E+000 -5.522270161782376E+000 +-5.490855864244049E+000 -5.454356657871933E+000 -5.412582680328250E+000 -5.365348031312682E+000 +-5.312472184143146E+000 -5.253781533269546E+000 -5.189111082385808E+000 -5.118306276821486E+000 +-5.041224982662988E+000 -4.957739613548365E+000 -4.867739404266456E+000 -4.771132828142540E+000 +-4.667850152678289E+000 -4.557846125005155E+000 -4.441102775384212E+000 -4.317632323218912E+000 +-4.187480165826401E+000 -4.050727925531830E+000 -3.907496525508104E+000 -3.757949259200408E+000 +-3.602294812176500E+000 -3.440790188880791E+000 -3.273743490111749E+000 -3.101516480177266E+000 +-2.924526875736115E+000 -2.743250281448280E+000 -2.558221690917394E+000 -2.370036465227355E+000 +-2.179350695899008E+000 -1.986880854608056E+000 -1.793402628823925E+000 -1.599748840998966E+000 +-1.406806349429889E+000 -1.215511831814062E+000 -1.026846358235834E+000 -8.418286692340908E-001 +-6.615070871057700E-001 -4.869500050415136E-001 -3.192349193700731E-001 -1.594359953524181E-001 +-8.610186768778678E-003 1.322180359484435E-001 2.620732551059956E-001 3.800468350433308E-001 + 4.853156257506865E-001 5.771614033658083E-001 6.549907547354812E-001 7.183550547961625E-001 + 7.669701244374719E-001 8.007350930489672E-001 8.197499241998965E-001 8.243309946289926E-001 + 8.150240452511116E-001 7.926137469786079E-001 7.581290418714822E-001 7.128433287356473E-001 + 6.582684581731046E-001 5.961413807492246E-001 5.284021480532008E-001 4.571617939999210E-001 + 3.846584164504213E-001 3.131995309440306E-001 2.450884737487775E-001 1.825322869711200E-001 + 1.275281233536325E-001 8.172476574990027E-002 4.625537401331255E-002 2.153706317589453E-002 + 7.032398260282550E-003 9.673799199547972E-004 4.204707118187760E-016 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + + + 1.950924612895554E+000 + + + + +-1.343341767730406E-004 -1.360238927306804E-004 -1.377348626995604E-004 -1.394673540222670E-004 +-1.412216374041445E-004 -1.429979869555922E-004 -1.447966802348953E-004 -1.466179982915941E-004 +-1.484622257103983E-004 -1.503296506556544E-004 -1.522205649163720E-004 -1.541352639518165E-004 +-1.560740469376748E-004 -1.580372168128028E-004 -1.600250803265604E-004 -1.620379480867414E-004 +-1.640761346081067E-004 -1.661399583615282E-004 -1.682297418237505E-004 -1.703458115277794E-004 +-1.724884981139020E-004 -1.746581363813510E-004 -1.768550653406180E-004 -1.790796282664244E-004 +-1.813321727513591E-004 -1.836130507601902E-004 -1.859226186848610E-004 -1.882612374001767E-004 +-1.906292723201926E-004 -1.930270934553101E-004 -1.954550754700921E-004 -1.979135977418060E-004 +-2.004030444197011E-004 -2.029238044850334E-004 -2.054762718118457E-004 -2.080608452285103E-004 +-2.106779285800479E-004 -2.133279307912287E-004 -2.160112659304679E-004 -2.187283532745262E-004 +-2.214796173740216E-004 -2.242654881197669E-004 -2.270864008099415E-004 -2.299427962181081E-004 +-2.328351206620845E-004 -2.357638260736817E-004 -2.387293700693197E-004 -2.417322160215316E-004 +-2.447728331313668E-004 -2.478516965017048E-004 -2.509692872114915E-004 -2.541260923909085E-004 +-2.573226052974898E-004 -2.605593253931940E-004 -2.638367584224469E-004 -2.671554164911648E-004 +-2.705158181467736E-004 -2.739184884592330E-004 -2.773639591030801E-004 -2.808527684405059E-004 +-2.843854616054749E-004 -2.879625905889052E-004 -2.915847143249170E-004 -2.952523987781696E-004 +-2.989662170322948E-004 -3.027267493794418E-004 -3.065345834109507E-004 -3.103903141091666E-004 +-3.142945439404053E-004 -3.182478829490929E-004 -3.222509488530862E-004 -3.263043671401920E-004 +-3.304087711659042E-004 -3.345648022523659E-004 -3.387731097885795E-004 -3.430343513318740E-004 +-3.473491927106527E-004 -3.517183081284310E-004 -3.561423802691822E-004 -3.606221004040108E-004 +-3.651581684991650E-004 -3.697512933254091E-004 -3.744021925687718E-004 -3.791115929426877E-004 +-3.838802303015495E-004 -3.887088497556878E-004 -3.935982057877966E-004 -3.985490623708253E-004 +-4.035621930873524E-004 -4.086383812504613E-004 -4.137784200261359E-004 -4.189831125571954E-004 +-4.242532720887905E-004 -4.295897220954751E-004 -4.349932964098789E-004 -4.404648393529963E-004 +-4.460052058661168E-004 -4.516152616444117E-004 -4.572958832722055E-004 -4.630479583599446E-004 +-4.688723856828906E-004 -4.747700753215599E-004 -4.807419488039268E-004 -4.867889392494163E-004 +-4.929119915147121E-004 -4.991120623413904E-004 -5.053901205054202E-004 -5.117471469685375E-004 +-5.181841350315272E-004 -5.247020904894296E-004 -5.313020317887044E-004 -5.379849901863664E-004 +-5.447520099111274E-004 -5.516041483265604E-004 -5.585424760963227E-004 -5.655680773514508E-004 +-5.726820498597631E-004 -5.798855051973932E-004 -5.871795689224807E-004 -5.945653807510482E-004 +-6.020440947350877E-004 -6.096168794428906E-004 -6.172849181416424E-004 -6.250494089823190E-004 +-6.329115651869045E-004 -6.408726152379667E-004 -6.489338030706159E-004 -6.570963882668802E-004 +-6.653616462525227E-004 -6.737308684963407E-004 -6.822053627119629E-004 -6.907864530621949E-004 +-6.994754803659280E-004 -7.082738023076526E-004 -7.171827936496104E-004 -7.262038464466119E-004 +-7.353383702635575E-004 -7.445877923956939E-004 -7.539535580916425E-004 -7.634371307792349E-004 +-7.730399922941846E-004 -7.827636431116409E-004 -7.926096025806524E-004 -8.025794091615805E-004 +-8.126746206664987E-004 -8.228968145026194E-004 -8.332475879187805E-004 -8.437285582550326E-004 +-8.543413631953652E-004 -8.650876610236155E-004 -8.759691308825965E-004 -8.869874730364788E-004 +-8.981444091364812E-004 -9.094416824898990E-004 -9.208810583325206E-004 -9.324643241044626E-004 +-9.441932897294870E-004 -9.560697878978243E-004 -9.680956743525547E-004 -9.802728281795997E-004 +-9.926031521013518E-004 -1.005088572774004E-003 -1.017731041088620E-003 -1.030532532475993E-003 +-1.043495047215334E-003 -1.056620610746852E-003 -1.069911273988257E-003 -1.083369113655256E-003 +-1.096996232586075E-003 -1.110794760070063E-003 -1.124766852180429E-003 -1.138914692111177E-003 +-1.153240490518262E-003 -1.167746485865051E-003 -1.182434944772134E-003 -1.197308162371514E-003 +-1.212368462665285E-003 -1.227618198888798E-003 -1.243059753878403E-003 -1.258695540443829E-003 +-1.274528001745228E-003 -1.290559611674986E-003 -1.306792875244323E-003 -1.323230328974759E-003 +-1.339874541294514E-003 -1.356728112939885E-003 -1.373793677361685E-003 -1.391073901136781E-003 +-1.408571484384823E-003 -1.426289161190218E-003 -1.444229700029399E-003 -1.462395904203493E-003 +-1.480790612276406E-003 -1.499416698518442E-003 -1.518277073355504E-003 -1.537374683823924E-003 +-1.556712514031054E-003 -1.576293585621622E-003 -1.596120958249969E-003 -1.616197730058228E-003 +-1.636527038160515E-003 -1.657112059133234E-003 -1.677956009511522E-003 -1.699062146291962E-003 +-1.720433767441618E-003 -1.742074212413470E-003 -1.763986862668355E-003 -1.786175142203455E-003 +-1.808642518087442E-003 -1.831392501002374E-003 -1.854428645792386E-003 -1.877754552019314E-003 +-1.901373864525288E-003 -1.925290274002420E-003 -1.949507517569666E-003 -1.974029379356932E-003 +-1.998859691096556E-003 -2.024002332722214E-003 -2.049461232975374E-003 -2.075240370019397E-003 +-2.101343772061337E-003 -2.127775517981606E-003 -2.154539737971532E-003 -2.181640614178973E-003 +-2.209082381362031E-003 -2.236869327551022E-003 -2.265005794718760E-003 -2.293496179459297E-003 +-2.322344933675189E-003 -2.351556565273446E-003 -2.381135638870200E-003 -2.411086776504296E-003 +-2.441414658359830E-003 -2.472124023497803E-003 -2.503219670596995E-003 -2.534706458704136E-003 +-2.566589307993574E-003 -2.598873200536467E-003 -2.631563181079685E-003 -2.664664357834527E-003 +-2.698181903275332E-003 -2.732121054948208E-003 -2.766487116289909E-003 -2.801285457457023E-003 +-2.836521516165635E-003 -2.872200798541536E-003 -2.908328879981168E-003 -2.944911406023396E-003 +-2.981954093232276E-003 -3.019462730090940E-003 -3.057443177906737E-003 -3.095901371727809E-003 +-3.134843321271165E-003 -3.174275111862500E-003 -3.214202905387825E-003 -3.254632941257112E-003 +-3.295571537380069E-003 -3.337025091154213E-003 -3.379000080465413E-003 -3.421503064701029E-003 +-3.464540685775821E-003 -3.508119669170813E-003 -3.552246824985231E-003 -3.596929049001704E-003 +-3.642173323764926E-003 -3.687986719673875E-003 -3.734376396087840E-003 -3.781349602446374E-003 +-3.828913679403396E-003 -3.877076059975570E-003 -3.925844270705183E-003 -3.975225932837700E-003 +-4.025228763514156E-003 -4.075860576978589E-003 -4.127129285800751E-003 -4.179042902114188E-003 +-4.231609538869981E-003 -4.284837411106308E-003 -4.338734837234003E-003 -4.393310240338375E-003 +-4.448572149497441E-003 -4.504529201116807E-003 -4.561190140281396E-003 -4.618563822124258E-003 +-4.676659213212666E-003 -4.735485392951686E-003 -4.795051555005526E-003 -4.855367008736793E-003 +-4.916441180663959E-003 -4.978283615937253E-003 -5.040903979833147E-003 -5.104312059267808E-003 +-5.168517764329612E-003 -5.233531129831068E-003 -5.299362316880353E-003 -5.366021614472704E-003 +-5.433519441101973E-003 -5.501866346392495E-003 -5.571073012751663E-003 -5.641150257043403E-003 +-5.712109032282768E-003 -5.783960429352039E-003 -5.856715678738515E-003 -5.930386152294316E-003 +-6.004983365018441E-003 -6.080518976861412E-003 -6.157004794552775E-003 -6.234452773451745E-003 +-6.312875019421284E-003 -6.392283790725939E-003 -6.472691499953744E-003 -6.554110715962464E-003 +-6.636554165850525E-003 -6.720034736952927E-003 -6.804565478862497E-003 -6.890159605476737E-003 +-6.976830497070714E-003 -7.064591702396193E-003 -7.153456940807449E-003 -7.243440104414092E-003 +-7.334555260261187E-003 -7.426816652537094E-003 -7.520238704809360E-003 -7.614836022289048E-003 +-7.710623394123832E-003 -7.807615795720261E-003 -7.905828391095542E-003 -8.005276535259280E-003 +-8.105975776625526E-003 -8.207941859455498E-003 -8.311190726331462E-003 -8.415738520662098E-003 +-8.521601589219789E-003 -8.628796484710264E-003 -8.737339968375028E-003 -8.847249012626927E-003 +-8.958540803719413E-003 -9.071232744449856E-003 -9.185342456897359E-003 -9.300887785195553E-003 +-9.417886798340856E-003 -9.536357793036595E-003 -9.656319296573542E-003 -9.777790069747268E-003 +-9.900789109812848E-003 -1.002533565347744E-002 -1.015144917993115E-002 -1.027914941391679E-002 +-1.040845632883900E-002 -1.053939014991316E-002 -1.067197135735493E-002 -1.080622068961051E-002 +-1.094215914662857E-002 -1.107980799317419E-002 -1.121918876218542E-002 -1.136032325817307E-002 +-1.150323356066418E-002 -1.164794202769003E-002 -1.179447129931897E-002 -1.194284430123489E-002 +-1.209308424836185E-002 -1.224521464853557E-002 -1.239925930622233E-002 -1.255524232628598E-002 +-1.271318811780371E-002 -1.287312139793126E-002 -1.303506719581814E-002 -1.319905085657380E-002 +-1.336509804528508E-002 -1.353323475108599E-002 -1.370348729128034E-002 -1.387588231551800E-002 +-1.405044681002559E-002 -1.422720810189228E-002 -1.440619386341146E-002 -1.458743211647914E-002 +-1.477095123704982E-002 -1.495677995965057E-002 -1.514494738195434E-002 -1.533548296941305E-002 +-1.552841655995161E-002 -1.572377836872344E-002 -1.592159899292858E-002 -1.612190941669514E-002 +-1.632474101602514E-002 -1.653012556380550E-002 -1.673809523488526E-002 -1.694868261121976E-002 +-1.716192068708311E-002 -1.737784287434954E-002 -1.759648300784496E-002 -1.781787535076952E-002 +-1.804205460019229E-002 -1.826905589261918E-002 -1.849891480963509E-002 -1.873166738362137E-002 +-1.896735010354992E-002 -1.920599992085465E-002 -1.944765425538185E-002 -1.969235100142053E-002 +-1.994012853381383E-002 -2.019102571415276E-002 -2.044508189705365E-002 -2.070233693652043E-002 +-2.096283119239310E-002 -2.122660553688366E-002 -2.149370136120097E-002 -2.176416058226563E-002 +-2.203802564951668E-002 -2.231533955181119E-002 -2.259614582441841E-002 -2.288048855610988E-002 +-2.316841239634700E-002 -2.345996256256758E-002 -2.375518484757309E-002 -2.405412562701807E-002 +-2.435683186700338E-002 -2.466335113177499E-002 -2.497373159152998E-002 -2.528802203033156E-002 +-2.560627185413480E-002 -2.592853109892501E-002 -2.625485043897054E-002 -2.658528119519186E-002 +-2.691987534364911E-002 -2.725868552414967E-002 -2.760176504897838E-002 -2.794916791175176E-002 +-2.830094879639898E-002 -2.865716308627151E-002 -2.901786687338350E-002 -2.938311696778557E-002 +-2.975297090707382E-002 -3.012748696603689E-002 -3.050672416644325E-002 -3.089074228697126E-002 +-3.127960187328468E-002 -3.167336424825604E-002 -3.207209152234049E-002 -3.247584660410328E-002 +-3.288469321090326E-002 -3.329869587973543E-002 -3.371791997823541E-002 -3.414243171584895E-002 +-3.457229815516954E-002 -3.500758722344730E-002 -3.544836772427231E-002 -3.589470934943583E-002 +-3.634668269097267E-002 -3.680435925338850E-002 -3.726781146607547E-002 -3.773711269591973E-002 +-3.821233726010490E-002 -3.869356043911537E-002 -3.918085848994318E-002 -3.967430865950272E-002 +-4.017398919825761E-002 -4.067997937406376E-002 -4.119235948623329E-002 -4.171121087982390E-002 +-4.223661596015815E-002 -4.276865820757778E-002 -4.330742219243747E-002 -4.385299359034405E-002 +-4.440545919764555E-002 -4.496490694717564E-002 -4.553142592425941E-002 -4.610510638298582E-002 +-4.668603976275272E-002 -4.727431870509049E-002 -4.787003707077069E-002 -4.847328995720573E-002 +-4.908417371614644E-002 -4.970278597168408E-002 -5.032922563856437E-002 -5.096359294081933E-002 +-5.160598943072616E-002 -5.225651800809897E-002 -5.291528293992279E-002 -5.358238988033640E-002 +-5.425794589097373E-002 -5.494205946167159E-002 -5.563484053155247E-002 -5.633640051049189E-002 +-5.704685230097965E-002 -5.776631032038453E-002 -5.849489052363259E-002 -5.923271042630884E-002 +-5.997988912819360E-002 -6.073654733724437E-002 -6.150280739403369E-002 -6.227879329665596E-002 +-6.306463072611396E-002 -6.386044707219839E-002 -6.466637145987264E-002 -6.548253477617653E-002 +-6.630906969766226E-002 -6.714611071837623E-002 -6.799379417840262E-002 -6.885225829298224E-002 +-6.972164318222282E-002 -7.060209090141677E-002 -7.149374547198259E-002 -7.239675291304726E-002 +-7.331126127368713E-002 -7.423742066584500E-002 -7.517538329794322E-002 -7.612530350921083E-002 +-7.708733780474604E-002 -7.806164489133356E-002 -7.904838571403887E-002 -8.004772349360183E-002 +-8.105982376465068E-002 -8.208485441476203E-002 -8.312298572438974E-002 -8.417439040768850E-002 +-8.523924365425763E-002 -8.631772317183181E-002 -8.741000922994682E-002 -8.851628470460833E-002 +-8.963673512399388E-002 -9.077154871521746E-002 -9.192091645218914E-002 -9.308503210460163E-002 +-9.426409228807775E-002 -9.545829651551274E-002 -9.666784724964805E-002 -9.789294995691214E-002 +-9.913381316256800E-002 -1.003906485072054E-001 -1.016636708046188E-001 -1.029530981011128E-001 +-1.042591517362778E-001 -1.055820564052813E-001 -1.069220402227198E-001 -1.082793347880785E-001 +-1.096541752528483E-001 -1.110468003893493E-001 -1.124574526613131E-001 -1.138863782962769E-001 +-1.153338273598445E-001 -1.168000538318700E-001 -1.182853156846220E-001 -1.197898749629893E-001 +-1.213139978667872E-001 -1.228579548352295E-001 -1.244220206336290E-001 -1.260064744423935E-001 +-1.276115999483860E-001 -1.292376854387174E-001 -1.308850238970439E-001 -1.325539131024416E-001 +-1.342446557309335E-001 -1.359575594597437E-001 -1.376929370743595E-001 -1.394511065784771E-001 +-1.412323913069146E-001 -1.430371200415725E-001 -1.448656271305261E-001 -1.467182526103343E-001 +-1.485953423316499E-001 -1.504972480882186E-001 -1.524243277493532E-001 -1.543769453959716E-001 +-1.563554714602859E-001 -1.583602828692315E-001 -1.603917631917235E-001 -1.624503027898280E-001 +-1.645362989739358E-001 -1.666501561620226E-001 -1.687922860430782E-001 -1.709631077447902E-001 +-1.731630480055541E-001 -1.753925413508926E-001 -1.776520302743476E-001 -1.799419654229164E-001 +-1.822628057870914E-001 -1.846150188955544E-001 -1.869990810145756E-001 -1.894154773521514E-001 +-1.918647022669111E-001 -1.943472594818079E-001 -1.968636623025951E-001 -1.994144338410785E-001 +-2.020001072431170E-001 -2.046212259213242E-001 -2.072783437924062E-001 -2.099720255190439E-001 +-2.127028467562058E-001 -2.154713944017491E-001 -2.182782668511313E-001 -2.211240742560274E-001 +-2.240094387865988E-001 -2.269349948971280E-001 -2.299013895946779E-001 -2.329092827103884E-001 +-2.359593471729623E-001 -2.390522692838330E-001 -2.421887489934342E-001 -2.453695001779210E-001 +-2.485952509156050E-001 -2.518667437622771E-001 -2.551847360244934E-001 -2.585500000297910E-001 +-2.619633233926832E-001 -2.654255092751541E-001 -2.689373766402322E-001 -2.724997604970685E-001 +-2.761135121357864E-001 -2.797794993501758E-001 -2.834986066461208E-001 -2.872717354334319E-001 +-2.910998041985192E-001 -2.949837486551022E-001 -2.989245218698726E-001 -3.029230943597349E-001 +-3.069804541569373E-001 -3.110976068380590E-001 -3.152755755124536E-001 -3.195154007653510E-001 +-3.238181405503909E-001 -3.281848700259100E-001 -3.326166813287906E-001 -3.371146832791777E-001 +-3.416800010087784E-001 -3.463137755048688E-001 -3.510171630614762E-001 -3.557913346285091E-001 +-3.606374750488890E-001 -3.655567821729291E-001 -3.705504658383966E-001 -3.756197467037999E-001 +-3.807658549215216E-001 -3.859900286364248E-001 -3.912935122945462E-001 -3.966775547453858E-001 +-4.021434071201876E-001 -4.076923204674194E-001 -4.133255431254338E-001 -4.190443178110296E-001 +-4.248498784013307E-001 -4.307434463850680E-001 -4.367262269579837E-001 -4.427994047357393E-001 +-4.489641390563032E-001 -4.552215588424716E-001 -4.615727569938498E-001 -4.680187842763319E-001 +-4.745606426759467E-001 -4.811992781828329E-001 -4.879355729701533E-001 -4.947703369319728E-001 +-5.017042985435504E-001 -5.087380950072008E-001 -5.158722616468592E-001 -5.231072205148974E-001 +-5.304432681755521E-001 -5.378805626306629E-001 -5.454191093553998E-001 -5.530587464142778E-001 +-5.607991286312247E-001 -5.686397107918219E-001 -5.765797298611999E-001 -5.846181862076426E-001 +-5.927538238297301E-001 -6.009851095941415E-001 -6.093102115020456E-001 -6.177269760145572E-001 +-6.262329044821788E-001 -6.348251287395797E-001 -6.435003859457005E-001 -6.522549927700850E-001 +-6.610848190496581E-001 -6.699852610660313E-001 -6.789512146217691E-001 -6.879770481250581E-001 +-6.970565759257246E-001 -7.061830321814734E-001 -7.153490455714928E-001 -7.245466152147064E-001 +-7.337670881918321E-001 -7.430011391133066E-001 -7.522387522184913E-001 -7.614692065346628E-001 +-7.706810646659225E-001 -7.798621658213950E-001 -7.889996237273751E-001 -7.980798300978947E-001 +-8.070884643607642E-001 -8.160105103493632E-001 -8.248302806722073E-001 -8.335314494601376E-001 +-8.420970941622983E-001 -8.505097470143839E-001 -8.587514567329982E-001 -8.668038608960573E-001 +-8.746482693482243E-001 -8.822657588202533E-001 -8.896372787700573E-001 -8.967437682397958E-001 +-9.035662832769381E-001 -9.100861341881950E-001 -9.162850315848636E-001 -9.221452398391382E-001 +-9.276497362072043E-001 -9.327823734922971E-001 -9.375280437265628E-001 -9.418728399538999E-001 +-9.458042128082130E-001 -9.493111182159253E-001 -9.523841522236746E-001 -9.550156686795271E-001 +-9.571998752985827E-001 -9.589329035441962E-001 -9.602128477790933E-001 -9.610397693151301E-001 +-9.614156613486091E-001 -9.613443713473649E-001 -9.608314783005553E-001 -9.598841234046865E-001 +-9.585107943040048E-001 -9.567210650083779E-001 -9.545252961738170E-001 -9.519343036693255E-001 +-9.489590074148099E-001 -9.456100775360472E-001 -9.418976011563676E-001 -9.378308008798133E-001 +-9.334178455035781E-001 -9.286658050494701E-001 -9.235808161782386E-001 -9.181685240272081E-001 +-9.124346672815121E-001 -9.063852569373805E-001 -9.000265812905375E-001 -8.933651972288702E-001 +-8.864079211543512E-001 -8.791618195540069E-001 -8.716341992401537E-001 -8.638325972804719E-001 +-8.557647706387311E-001 -8.474386855471916E-001 -8.388625066317926E-001 -8.300445858112979E-001 +-8.209934509915079E-001 -8.117177945755601E-001 -8.022264618111686E-001 -7.925284389953879E-001 +-7.826328415572246E-001 -7.725489020380335E-001 -7.622859579892582E-001 -7.518534398066152E-001 +-7.412608585193257E-001 -7.305177935523908E-001 -7.196338804795396E-001 -7.086187987839754E-001 +-6.974822596432481E-001 -6.862339937531152E-001 -6.748837392071335E-001 -6.634412294464763E-001 +-6.519161812921658E-001 -6.403182830748725E-001 -6.286571828758163E-001 -6.169424768906004E-001 +-6.051836979285409E-001 -5.933903040596173E-001 -5.815716674209338E-001 -5.697370631944647E-001 +-5.578956587678775E-001 -5.460565030902808E-001 -5.342285162349870E-001 -5.224204791816369E-001 +-5.106410238304739E-001 -4.988986232620392E-001 -4.872015822561386E-001 -4.755580280846278E-001 +-4.639759015932273E-001 -4.524629485883729E-001 -4.410267115458403E-001 -4.296745216586190E-001 +-4.184134912422039E-001 -4.072505065160498E-001 -3.961922207804165E-001 -3.852450480081402E-001 +-3.744151568709697E-001 -3.637084652200142E-001 -3.531306350394680E-001 -3.426870678921376E-001 +-3.323829008743592E-001 -3.222230030966390E-001 -3.122119727048064E-001 -3.023541344545974E-001 +-2.926535378504534E-001 -2.831139558569095E-001 -2.737388841882912E-001 -2.645315411796233E-001 +-2.554948682386357E-001 -2.466315308756733E-001 -2.379439203051605E-001 -2.294341556091086E-001 +-2.211040864500630E-001 -2.129552963178687E-001 -2.049891062917855E-001 -1.972065792968104E-001 +-1.896085248306009E-001 -1.821955041352593E-001 -1.749678357863328E-001 -1.679256016697070E-001 +-1.610686533158945E-001 -1.543966185602531E-001 -1.479089084970032E-001 -1.416047246946264E-001 +-1.354830666402364E-001 -1.295427393808110E-001 -1.237823613297505E-001 -1.182003722080803E-001 +-1.127950410906814E-001 -1.075644745292310E-001 -1.025066247250119E-001 -9.761929772637561E-002 +-9.290016162741550E-002 -8.834675474625679E-002 -8.395649376330105E-002 -7.972668180172075E-002 +-7.565451643445957E-002 -7.173709760392825E-002 -6.797143544245289E-002 -6.435445798330858E-002 +-6.088301875382573E-002 -5.755390424355815E-002 -5.436384124183465E-002 -5.130950404015087E-002 +-4.838752149578891E-002 -4.559448395376196E-002 -4.292695002467038E-002 -4.038145321632737E-002 +-3.795450841707079E-002 -3.564261822854464E-002 -3.344227914542700E-002 -3.134998757912572E-002 +-2.936224572189615E-002 -2.747556724718178E-002 -2.568648284128348E-002 -2.399154556075709E-002 +-2.238733600925974E-002 -2.087046732694841E-002 -1.943758998500702E-002 -1.808539637747108E-002 +-1.681062520225208E-002 -1.561006562315273E-002 -1.448056120472325E-002 -1.341901361203996E-002 +-1.242238606789364E-002 -1.148770656044913E-002 -1.061207079517089E-002 -9.792644885689291E-003 +-9.026667779289439E-003 -8.311453413823064E-003 -7.644392604050288E-003 -7.022954656691624E-003 +-6.444688714788650E-003 -5.907224833311778E-003 -5.408274789294695E-003 -4.945632631096857E-003 +-4.517174972678681E-003 -4.120861040002922E-003 -3.754732477833842E-003 -3.416912926281437E-003 +-3.105607377419731E-003 -2.819101323187450E-003 -2.555759706550025E-003 -2.314025688558795E-003 +-2.092419244484218E-003 -1.889535602623816E-003 -1.704043539692937E-003 -1.534683546899826E-003 +-1.380265880888705E-003 -1.239668513710815E-003 -1.111834995858471E-003 -9.957722461778529E-004 +-8.905482821692504E-004 -7.952899037961990E-004 -7.091803434652691E-004 -6.314568943142122E-004 +-5.614085283659309E-004 -4.983735154775734E-004 -4.417370533461015E-004 -3.909289181319930E-004 +-3.454211445391222E-004 -3.047257434488394E-004 -2.683924644570308E-004 -2.360066099112674E-004 +-2.071869062974215E-004 -1.815834380872262E-004 -1.588756484355621E-004 -1.387704104137109E-004 +-1.210001717867296E-004 -1.053211756933396E-004 -9.151175896858470E-005 -7.937072926575233E-005 +-6.871582158695160E-005 -5.938223432302902E-005 -5.122124443446146E-005 -4.409890097627817E-005 +-3.789479578226268E-005 -3.250090977725960E-005 -2.782053307866084E-005 -2.376725678240842E-005 +-2.026403409981320E-005 -1.724230832029450E-005 -1.464120491945796E-005 -1.240678500998552E-005 +-1.049135724264854E-005 -8.852845204233458E-006 -7.454207326496869E-006 -6.262906311616602E-006 +-5.250425095428936E-006 -4.391826404818577E-006 -3.665353019334035E-006 -3.052065916632148E-006 +-2.535517564511026E-006 -2.101457716929248E-006 -1.737569175549195E-006 -1.433234972024142E-006 +-1.179357491821685E-006 -9.680938665870723E-007 -7.927290867435514E-007 -6.475320778847807E-007 +-5.276241994739592E-007 -4.288634664203718E-007 -3.477429142387355E-007 -2.813016549911503E-007 +-2.270472942132721E-007 -1.828884985162440E-007 -1.470766197071458E-007 -1.181553945943181E-007 +-9.491785098811248E-008 -7.603486099146203E-008 -6.073410786127121E-008 -4.837176407915130E-008 +-3.841268784305750E-008 -3.041339494730827E-008 -2.400746312748265E-008 -1.889306111012390E-008 +-1.482232723113169E-008 -1.159235260051945E-008 -9.037551449695847E-009 -7.023226576899051E-009 +-5.440160800729992E-009 -4.200086148670443E-009 -3.231901265310047E-009 -2.478524349420220E-009 +-1.894283950261378E-009 -1.442763303955301E-009 -1.095025702674240E-009 -8.281587931342607E-010 +-6.240848232695148E-010 -4.685918190766918E-010 -3.505475937514400E-010 -2.612644781650944E-010 +-1.939878181760678E-010 -1.434857055851085E-010 -1.057211835543121E-010 -7.759137431860347E-011 +-5.672068993476343E-011 -4.129757138190283E-011 -2.994611644402046E-011 -2.162555489045767E-011 +-1.555185688846692E-011 -1.113685809016018E-011 -7.941188043387116E-012 -5.638028409742083E-012 +-3.985330634925237E-012 -2.804612126603285E-012 -1.964845211652283E-012 -1.370270763247127E-012 +-9.512224083674265E-013 -6.572493907689925E-013 -4.519862671303540E-013 -3.093437767727042E-013 +-2.106941451477993E-013 -1.428012490661483E-013 -9.630596371270093E-014 -6.462325628976713E-014 +-4.314311296477770E-014 -2.865452803592299E-014 -1.893241385479927E-014 -1.244288593339210E-014 +-8.134104444331886E-015 -5.288622806239492E-015 -3.419715906695803E-015 -2.198983844709001E-015 +-1.406074188714829E-015 -8.939595120262020E-016 -5.650927334900892E-016 -3.551258659022150E-016 +-2.218572638311016E-016 -1.377721435676700E-016 -8.503796136219608E-017 -5.216686759251185E-017 +-3.180340289702899E-017 -1.926705458191300E-017 -1.159806494042019E-017 -6.936643094270080E-018 +-4.121653351938615E-018 -2.432854448553694E-018 -1.426419090802075E-018 -8.306687184753300E-019 +-4.804200806911277E-019 -2.759239815798463E-019 -1.573601245826465E-019 -8.910423503063960E-020 +-5.009119545481726E-020 -2.795402398384776E-020 -1.548485530383899E-020 -8.513523557661048E-021 +-4.645258505188724E-021 -2.515169469966510E-021 -1.351261436236241E-021 -7.202507037771764E-022 +-3.808527169232365E-022 -1.997633533469661E-022 -1.039239783603225E-022 -5.361818660994457E-023 +-2.743213203276870E-023 -1.391592834130658E-023 -6.998798770266476E-024 -3.489365543082186E-024 +-1.724381727479561E-024 -8.445708424253111E-025 -4.099261481041813E-025 -1.971480786761189E-025 +-9.393918048290111E-026 -4.434223173923008E-026 -2.073258825278866E-026 -9.600695163851284E-027 +-4.402631669600770E-027 -1.999075569706327E-027 -8.986679546084488E-028 -3.999151024053201E-028 +-1.761487206505863E-028 -7.678533022386660E-029 -3.312129627341331E-029 -1.413543630349794E-029 +-5.967957584269283E-030 -2.492286225850680E-030 -1.029357200904571E-030 -4.204069307679108E-031 +-1.697649413446130E-031 -6.777016909086675E-032 -2.674107196085949E-032 -1.042810055079195E-032 +-4.018402491164044E-033 -1.529883459917130E-033 -5.753789899913789E-034 -2.137339932786416E-034 +-7.840604102092595E-035 -2.839967044606395E-035 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + + + 7.665845577818094E-008 7.859907375502957E-008 8.058881870625926E-008 8.262893428696254E-008 + 8.472069563550108E-008 8.686541017050790E-008 8.906441840806580E-008 9.131909479957289E-008 + 9.363084859081834E-008 9.600112470280620E-008 9.843140463487711E-008 1.009232073906926E-007 + 1.034780904276607E-007 1.060976506303967E-007 1.087835253088270E-007 1.115373932215592E-007 + 1.143609756251604E-007 1.172560373499968E-007 1.202243879033090E-007 1.232678826002116E-007 + 1.263884237233236E-007 1.295879617117556E-007 1.328684963801961E-007 1.362320781688588E-007 + 1.396808094250734E-007 1.432168457173177E-007 1.468423971825173E-007 1.505597299074503E-007 + 1.543711673451233E-007 1.582790917670029E-007 1.622859457520098E-007 1.663942337132082E-007 + 1.706065234631419E-007 1.749254478187987E-007 1.793537062472033E-007 1.838940665526687E-007 + 1.885493666067606E-007 1.933225161220564E-007 1.982164984708058E-007 2.032343725496321E-007 + 2.083792746914379E-007 2.136544206257113E-007 2.190631074884557E-007 2.246087158830036E-007 + 2.302947119929987E-007 2.361246497488672E-007 2.421021730491347E-007 2.482310180379762E-007 + 2.545150154404207E-007 2.609580929566736E-007 2.675642777170493E-007 2.743376987990522E-007 + 2.812825898081767E-007 2.884032915240410E-007 2.957042546135067E-007 3.031900424124816E-007 + 3.108653337781444E-007 3.187349260133733E-007 3.268037378652056E-007 3.350768125992052E-007 + 3.435593211516544E-007 3.522565653615474E-007 3.611739812843983E-007 3.703171425899414E-007 + 3.796917640458416E-007 3.893037050895951E-007 3.991589734908541E-007 4.092637291064621E-007 + 4.196242877305486E-007 4.302471250420881E-007 4.411388806523919E-007 4.523063622550611E-007 + 4.637565498809960E-007 4.754966002611220E-007 4.875338512995566E-007 4.998758266600134E-007 + 5.125302404683146E-007 5.255050021339406E-007 5.388082212936422E-007 5.524482128802000E-007 + 5.664335023194938E-007 5.807728308591428E-007 5.954751610320351E-007 6.105496822581647E-007 + 6.260058165882842E-007 6.418532245929505E-007 6.581018114006565E-007 6.747617328888145E-007 + 6.918434020314665E-007 7.093574954076821E-007 7.273149598747164E-007 7.457270194101004E-007 + 7.646051821269374E-007 7.839612474667863E-007 8.038073135746409E-007 8.241557848605929E-007 + 8.450193797529268E-007 8.664111386474821E-007 8.883444320582464E-007 9.108329689742843E-007 + 9.338908054282157E-007 9.575323532816102E-007 9.817723892327777E-007 1.006626064052585E-006 + 1.032108912054083E-006 1.058236860801849E-006 1.085026241067120E-006 1.112493797034941E-006 + 1.140656696769699E-006 1.169532542945594E-006 1.199139383848741E-006 1.229495724657797E-006 + 1.260620539010148E-006 1.292533280860885E-006 1.325253896642002E-006 1.358802837729378E-006 + 1.393201073225370E-006 1.428470103064996E-006 1.464631971453880E-006 1.501709280646393E-006 + 1.539725205072563E-006 1.578703505822614E-006 1.618668545498167E-006 1.659645303439402E-006 + 1.701659391337678E-006 1.744737069243382E-006 1.788905261979013E-006 1.834191575967749E-006 + 1.880624316488023E-006 1.928232505364894E-006 1.977045899109251E-006 2.027095007516207E-006 + 2.078411112734309E-006 2.131026288817461E-006 2.184973421771801E-006 2.240286230110033E-006 + 2.296999285926109E-006 2.355148036503370E-006 2.414768826469703E-006 2.475898920513528E-006 + 2.538576526674820E-006 2.602840820225746E-006 2.668731968155786E-006 2.736291154276705E-006 + 2.805560604963033E-006 2.876583615544113E-006 2.949404577364269E-006 3.024069005527973E-006 + 3.100623567347343E-006 3.179116111509772E-006 3.259595697983899E-006 3.342112628682614E-006 + 3.426718478902275E-006 3.513466129557763E-006 3.602409800233547E-006 3.693605083071373E-006 + 3.787108977515799E-006 3.882979925939263E-006 3.981277850168955E-006 4.082064188938316E-006 + 4.185401936286577E-006 4.291355680930314E-006 4.399991646631680E-006 4.511377733588424E-006 + 4.625583560871719E-006 4.742680509938168E-006 4.862741769243310E-006 4.985842379984391E-006 + 5.112059283001068E-006 5.241471366863320E-006 5.374159517176597E-006 5.510206667135079E-006 + 5.649697849354562E-006 5.792720249017394E-006 5.939363258362709E-006 6.089718532555913E-006 + 6.243880046972453E-006 6.401944155931558E-006 6.564009652916709E-006 6.730177832320453E-006 + 6.900552552752144E-006 7.075240301948204E-006 7.254350263325373E-006 7.437994384218608E-006 + 7.626287445846283E-006 7.819347135046295E-006 8.017294117828103E-006 8.220252114786410E-006 + 8.428347978423775E-006 8.641711772430475E-006 8.860476852970967E-006 9.084779952028033E-006 + 9.314761262856376E-006 9.550564527599255E-006 9.792337127122880E-006 1.004023017312461E-005 + 1.029439860257256E-005 1.055500127453561E-005 1.082220106946427E-005 1.109616499098463E-005 + 1.137706427026849E-005 1.166507447304566E-005 1.196037560932439E-005 1.226315224588923E-005 + 1.257359362164619E-005 1.289189376588728E-005 1.321825161954848E-005 1.355287115953675E-005 + 1.389596152620380E-005 1.424773715404625E-005 1.460841790571373E-005 1.497822920940884E-005 + 1.535740219976451E-005 1.574617386228707E-005 1.614478718145500E-005 1.655349129256584E-005 + 1.697254163742657E-005 1.740220012398394E-005 1.784273528999514E-005 1.829442247084069E-005 + 1.875754397158434E-005 1.923238924338770E-005 1.971925506438940E-005 2.021844572516209E-005 + 2.073027321886294E-005 2.125505743619629E-005 2.179312636531046E-005 2.234481629675338E-005 + 2.291047203361483E-005 2.349044710698710E-005 2.408510399687781E-005 2.469481435871375E-005 + 2.531995925557608E-005 2.596092939631298E-005 2.661812537967776E-005 2.729195794464479E-005 + 2.798284822706016E-005 2.869122802278655E-005 2.941754005750705E-005 3.016223826335633E-005 + 3.092578806255149E-005 3.170866665820024E-005 3.251136333246738E-005 3.333437975228585E-005 + 3.417823028280345E-005 3.504344230876052E-005 3.593055656399916E-005 3.684012746930993E-005 + 3.777272347882662E-005 3.872892743518532E-005 3.970933693366951E-005 4.071456469556821E-005 + 4.174523895098019E-005 4.280200383130345E-005 4.388551977165419E-005 4.499646392346700E-005 + 4.613553057753321E-005 4.730343159774157E-005 4.850089686579174E-005 4.972867473715774E-005 + 5.098753250858641E-005 5.227825689742175E-005 5.360165453305440E-005 5.495855246080287E-005 + 5.634979865854045E-005 5.777626256639033E-005 5.923883562981877E-005 6.073843185646511E-005 + 6.227598838705590E-005 6.385246608075901E-005 6.546885011534261E-005 6.712615060251298E-005 + 6.882540321881468E-005 7.056766985248653E-005 7.235403926667659E-005 7.418562777942860E-005 + 7.606357996086488E-005 7.798906934799866E-005 7.996329917762250E-005 8.198750313772851E-005 + 8.406294613792833E-005 8.619092509935366E-005 8.837276976452815E-005 9.060984352771546E-005 + 9.290354428626123E-005 9.525530531345749E-005 9.766659615347429E-005 1.001389235389148E-004 + 1.026738323315655E-004 1.052729064869269E-004 1.079377700431242E-004 1.106700881348145E-004 + 1.134715680327206E-004 1.163439602094376E-004 1.192890594321772E-004 1.223087058831258E-004 + 1.254047863081169E-004 1.285792351943300E-004 1.318340359777480E-004 1.351712222811242E-004 + 1.385928791832278E-004 1.421011445201588E-004 1.456982102195367E-004 1.493863236683960E-004 + 1.531677891156357E-004 1.570449691098942E-004 1.610202859737434E-004 1.650962233151153E-004 + 1.692753275769024E-004 1.735602096256898E-004 1.779535463806077E-004 1.824580824833145E-004 + 1.870766320101436E-004 1.918120802274800E-004 1.966673853914516E-004 2.016455805930524E-004 + 2.067497756498414E-004 2.119831590453876E-004 2.173489999176651E-004 2.228506500976287E-004 + 2.284915461992305E-004 2.342752117621743E-004 2.402052594487325E-004 2.462853932959856E-004 + 2.525194110248763E-004 2.589112064075063E-004 2.654647716941423E-004 2.721842001014254E-004 + 2.790736883633295E-004 2.861375393464367E-004 2.933801647311502E-004 3.008060877604971E-004 + 3.084199460582186E-004 3.162264945178863E-004 3.242306082648266E-004 3.324372856926803E-004 + 3.408516515764660E-004 3.494789602640685E-004 3.583245989481158E-004 3.673940910202609E-004 + 3.766930995099327E-004 3.862274306096670E-004 3.960030372891912E-004 4.060260230004837E-004 + 4.163026454760795E-004 4.268393206229595E-004 4.376426265144125E-004 4.487193074823195E-004 + 4.600762783123658E-004 4.717206285447627E-004 4.836596268831028E-004 4.959007257140523E-004 + 5.084515657406537E-004 5.213199807320611E-004 5.345140023926209E-004 5.480418653532712E-004 + 5.619120122883032E-004 5.761330991606169E-004 5.907140005986596E-004 6.056638154083323E-004 + 6.209918722232226E-004 6.367077352965939E-004 6.528212104386643E-004 6.693423511027813E-004 + 6.862814646241905E-004 7.036491186151821E-004 7.214561475204959E-004 7.397136593369630E-004 + 7.584330425014444E-004 7.776259729512414E-004 7.973044213612473E-004 8.174806605622047E-004 + 8.381672731445571E-004 8.593771592524673E-004 8.811235445727077E-004 9.034199885232317E-004 + 9.262803926463344E-004 9.497190092114670E-004 9.737504500328494E-004 9.983896955071711E-004 + 1.023652103876800E-003 1.049553420724025E-003 1.076109788702012E-003 1.103337757508283E-003 + 1.131254294106656E-003 1.159876793203726E-003 1.189223087986135E-003 1.219311461124969E-003 + 1.250160656053855E-003 1.281789888527381E-003 1.314218858466717E-003 1.347467762099406E-003 + 1.381557304400489E-003 1.416508711842271E-003 1.452343745460242E-003 1.489084714242809E-003 + 1.526754488852669E-003 1.565376515687860E-003 1.604974831290682E-003 1.645574077112896E-003 + 1.687199514645767E-003 1.729877040923753E-003 1.773633204410792E-003 1.818495221278398E-003 + 1.864490992084923E-003 1.911649118865606E-003 1.959998922643221E-003 2.009570461369329E-003 + 2.060394548306430E-003 2.112502770861452E-003 2.165927509881323E-003 2.220701959421548E-003 + 2.276860146998988E-003 2.334436954340269E-003 2.393468138637469E-003 2.453990354323055E-003 + 2.516041175376208E-003 2.579659118172986E-003 2.644883664893037E-003 2.711755287495827E-003 + 2.780315472279618E-003 2.850606745036722E-003 2.922672696818806E-003 2.996558010326347E-003 + 3.072308486936580E-003 3.149971074384632E-003 3.229593895112742E-003 3.311226275302832E-003 + 3.394918774608007E-003 3.480723216598775E-003 3.568692719940219E-003 3.658881730316523E-003 + 3.751346053119657E-003 3.846142886919362E-003 3.943330857731782E-003 4.042970054104544E-003 + 4.145122063036307E-003 4.249850006749174E-003 4.357218580332682E-003 4.467294090278448E-003 + 4.580144493924742E-003 4.695839439830812E-003 4.814450309100837E-003 4.936050257678019E-003 + 5.060714259629381E-003 5.188519151442292E-003 5.319543677354139E-003 5.453868535736681E-003 + 5.591576426557155E-003 5.732752099938386E-003 5.877482405840489E-003 6.025856344887143E-003 + 6.177965120359545E-003 6.333902191381683E-003 6.493763327320647E-003 6.657646663426045E-003 + 6.825652757732927E-003 6.997884649252809E-003 7.174447917477673E-003 7.355450743221994E-003 + 7.541003970828204E-003 7.731221171761058E-003 7.926218709616647E-003 8.126115806571958E-003 + 8.331034611301087E-003 8.541100268384189E-003 8.756440989235642E-003 8.977188124577574E-003 + 9.203476238485430E-003 9.435443184031979E-003 9.673230180556177E-003 9.916981892583429E-003 + 1.016684651042363E-002 1.042297583247312E-002 1.068552534924690E-002 1.095465432916686E-002 + 1.123052590613177E-002 1.151330716889449E-002 1.180316925227138E-002 1.210028743020859E-002 + 1.240484121072941E-002 1.271701443278645E-002 1.303699536504154E-002 1.336497680659586E-002 + 1.370115618969192E-002 1.404573568440823E-002 1.439892230536650E-002 1.476092802047021E-002 + 1.513196986169240E-002 1.551227003792912E-002 1.590205604993377E-002 1.630156080734609E-002 + 1.671102274782784E-002 1.713068595831576E-002 1.756080029840019E-002 1.800162152583623E-002 + 1.845341142419149E-002 1.891643793263275E-002 1.939097527785098E-002 1.987730410812164E-002 + 2.037571162949427E-002 2.088649174410215E-002 2.140994519057961E-002 2.194637968657111E-002 + 2.249611007331228E-002 2.305945846225881E-002 2.363675438373562E-002 2.422833493757292E-002 + 2.483454494569188E-002 2.545573710659706E-002 2.609227215172702E-002 2.674451900360889E-002 + 2.741285493575610E-002 2.809766573424257E-002 2.879934586087860E-002 2.951829861790682E-002 + 3.025493631412889E-002 3.100968043236422E-002 3.178296179813465E-002 3.257522074945809E-002 + 3.338690730762529E-002 3.421848134882293E-002 3.507041277645535E-002 3.594318169400511E-002 + 3.683727857826129E-002 3.775320445272989E-002 3.869147106102842E-002 3.965260104005155E-002 + 4.063712809267959E-002 4.164559715978541E-002 4.267856459127930E-002 4.373659831591253E-002 + 4.482027800954212E-002 4.593019526153991E-002 4.706695373900874E-002 4.823116934844586E-002 + 4.942347039447200E-002 5.064449773522049E-002 5.189490493395587E-002 5.317535840646507E-002 + 5.448653756373736E-002 5.582913494941994E-002 5.720385637150691E-002 5.861142102768711E-002 + 6.005256162374450E-002 6.152802448436957E-002 6.303856965570503E-002 6.458497099891178E-002 + 6.616801627400209E-002 6.778850721314644E-002 6.944725958261797E-002 7.114510323249472E-002 + 7.288288213319458E-002 7.466145439786916E-002 7.648169228963463E-002 7.834448221256564E-002 + 8.025072468532488E-002 8.220133429624706E-002 8.419723963863761E-002 8.623938322498852E-002 + 8.832872137875170E-002 9.046622410224822E-002 9.265287491922673E-002 9.488967069051711E-002 + 9.717762140115631E-002 9.951774991729473E-002 1.019110917111163E-001 1.043586945519326E-001 + 1.068616181615363E-001 1.094209338318197E-001 1.120377240025865E-001 1.147130817974062E-001 + 1.174481105152737E-001 1.202439230757616E-001 1.231016414152637E-001 1.260223958318478E-001 + 1.290073242761499E-001 1.320575715856594E-001 1.351742886596608E-001 1.383586315720151E-001 + 1.416117606188822E-001 1.449348392984068E-001 1.483290332193101E-001 1.517955089352606E-001 + 1.553354327018188E-001 1.589499691526909E-001 1.626402798919591E-001 1.664075219989039E-001 + 1.702528464419823E-001 1.741773963984853E-001 1.781823054763667E-001 1.822686958347090E-001 + 1.864376761992876E-001 1.906903397696904E-001 1.950277620144694E-001 1.994509983508329E-001 + 2.039610817054368E-001 2.085590199529010E-001 2.132457932287719E-001 2.180223511137642E-001 + 2.228896096862560E-001 2.278484484401818E-001 2.328997070656661E-001 2.380441820899775E-001 + 2.432826233766465E-001 2.486157304809067E-001 2.540441488599661E-001 2.595684659370132E-001 + 2.651892070183077E-001 2.709068310632072E-001 2.767217263075266E-001 2.826342057412518E-001 + 2.886445024422921E-001 2.947527647687105E-001 3.009590514126734E-001 3.072633263202531E-001 + 3.136654534821802E-001 3.201651916016834E-001 3.267621886466885E-001 3.334559762948593E-001 + 3.402459642812705E-001 3.471314346599030E-001 3.541115359916371E-001 3.611852774730137E-001 + 3.683515230217148E-001 3.756089853364961E-001 3.829562199511769E-001 3.903916193042677E-001 + 3.979134068478783E-001 4.055196312216885E-001 4.132081605200043E-001 4.209766766822230E-001 + 4.288226700393940E-001 4.367434340519974E-001 4.447360602765256E-001 4.527974336009458E-001 + 4.609242277916236E-001 4.691129013967908E-001 4.773596940540922E-001 4.856606232521545E-001 + 4.940114815984308E-001 5.024078346477732E-001 5.108450193482199E-001 5.193181431623477E-001 + 5.278220839241243E-001 5.363514904925549E-001 5.449007842644066E-001 5.534641616089078E-001 + 5.620355972875278E-001 5.706088489216128E-001 5.791774625698047E-001 5.877347794757054E-001 + 5.962739440440749E-001 6.047879131009948E-001 6.132694664897032E-001 6.217112190492741E-001 + 6.301056340178318E-001 6.384450378955052E-001 6.467216367948684E-001 6.549275342980052E-001 + 6.630547508296766E-001 6.710952445452277E-001 6.790409337198507E-001 6.868837206126970E-001 + 6.946155167649676E-001 7.022282696756653E-001 7.097139907821443E-001 7.170647846549725E-001 + 7.242728792981332E-001 7.313306574261527E-001 7.382306885696783E-001 7.449657618403384E-001 + 7.515289191646530E-001 7.579134887755096E-001 7.641131187284723E-001 7.701218101892403E-001 + 7.759339502181669E-001 7.815443437581194E-001 7.869482445135428E-001 7.921413843915441E-001 + 7.971200011606017E-001 8.018808639694039E-001 8.064212963576444E-001 8.107391963828360E-001 + 8.148330534824906E-001 8.187019616899143E-001 8.223456288245777E-001 8.257643812849331E-001 + 8.289591640830704E-001 8.319315357769358E-001 8.346836579774983E-001 8.372182791355227E-001 + 8.395387123458663E-001 8.416488069470521E-001 8.435529137405722E-001 8.452558437087386E-001 + 8.467628201724258E-001 8.480794244015744E-001 8.492115347728298E-001 8.501652596610415E-001 + 8.509468643558958E-001 8.515626924128870E-001 8.520190819805585E-001 8.523222777949709E-001 + 8.524783396989162E-001 8.524930487288551E-001 8.523718120175968E-001 8.521195679855572E-001 + 8.517406935373382E-001 8.512389152409462E-001 8.506172267401988E-001 8.498778149297702E-001 + 8.490219976965759E-001 8.480501762860863E-001 8.469618055672306E-001 8.457553856177569E-001 + 8.444284780978958E-001 8.429777507789424E-001 8.413990532888892E-001 8.396875265605782E-001 + 8.378377475360044E-001 8.358439092945040E-001 8.337000348163542E-001 8.314002199317713E-001 + 8.289388974818536E-001 8.263111101525510E-001 8.235127736265376E-001 8.205409043878643E-001 + 8.173937774235414E-001 8.140709678514479E-001 8.105732167495573E-001 8.069020591572043E-001 + 8.030593216888513E-001 7.990469613981120E-001 7.948670519901674E-001 7.905217812728413E-001 + 7.860134485042608E-001 7.813444616448012E-001 7.765173345210473E-001 7.715346839094472E-001 + 7.663992265472731E-001 7.611137760783988E-001 7.556812399412131E-001 7.501046162058302E-001 + 7.443869903674818E-001 7.385315321027277E-001 7.325414919947744E-001 7.264201982338454E-001 + 7.201710532981421E-001 7.137975306204994E-001 7.073031712453672E-001 7.006915804802668E-001 + 6.939664245453039E-001 6.871314272237905E-001 6.801903665163067E-001 6.731470713004929E-001 + 6.660054179976148E-001 6.587693272456999E-001 6.514427605807138E-001 6.440297171250563E-001 + 6.365342302803474E-001 6.289603644242312E-001 6.213122116093053E-001 6.135938882605348E-001 + 6.058095318681186E-001 5.979632976722536E-001 5.900593553359242E-001 5.821018856016384E-001 + 5.740950769279818E-001 5.660431221018718E-001 5.579502148225983E-001 5.498205462540190E-001 + 5.416583015417792E-001 5.334676562930365E-001 5.252527730169469E-001 5.170177975251524E-001 + 5.087668552925647E-001 5.005040477800344E-001 4.922334487218433E-001 4.839591003824619E-001 + 4.756850097886066E-001 4.674151449442462E-001 4.591534310378986E-001 4.509037466532046E-001 + 4.426699199953573E-001 4.344557251475037E-001 4.262648783725879E-001 4.181010344773167E-001 + 4.099677832559236E-001 4.018686460321251E-001 3.938070723181463E-001 3.857864366098324E-001 + 3.778100353367078E-001 3.698810839853502E-001 3.620027144136282E-001 3.541779723722111E-001 + 3.464098152483032E-001 3.387011100448278E-001 3.310546316062981E-001 3.234730611003961E-001 + 3.159589847618996E-001 3.085148929030589E-001 3.011431791919026E-001 2.938461401972797E-001 + 2.866259751967215E-001 2.794847862406287E-001 2.724245784637051E-001 2.654472606319701E-001 + 2.585546459115124E-001 2.517484528429970E-001 2.450303065039318E-001 2.384017398390409E-001 + 2.318641951376308E-001 2.254190256356494E-001 2.190674972192267E-001 2.128107902058801E-001 + 2.066500011792592E-001 2.005861448533150E-001 1.946201559421062E-001 1.887528910121040E-001 + 1.829851302948407E-001 1.773175794390326E-001 1.717508711829252E-001 1.662855669295232E-001 + 1.609221582095523E-001 1.556610680194724E-001 1.505026520245352E-001 1.454471996197649E-001 + 1.404949348447740E-001 1.356460171514417E-001 1.309005420266662E-001 1.262585414755402E-001 + 1.217199843733792E-001 1.172847766979537E-001 1.129527616559881E-001 1.087237197204416E-001 + 1.045973685972039E-001 1.005733631415905E-001 9.665129524637017E-002 9.283069372395293E-002 + 8.911102420583181E-002 8.549168908236296E-002 8.197202750552574E-002 7.855131547642989E-002 + 7.522876603806726E-002 7.200352959218535E-002 6.887469435722601E-002 6.584128698208899E-002 + 6.290227332809845E-002 6.005655942902325E-002 5.730299263640035E-002 5.464036295477426E-002 + 5.206740456885953E-002 4.958279756209537E-002 4.718516982363710E-002 4.487309913855610E-002 + 4.264511545391887E-002 4.049970331151843E-002 3.843530443634689E-002 3.645032046843749E-002 + 3.454311582447758E-002 3.271202067458982E-002 3.095533401890561E-002 2.927132684799373E-002 + 2.765824537085235E-002 2.611431429401181E-002 2.463774013530992E-002 2.322671455607900E-002 + 2.187941769580774E-002 2.059402149379099E-002 1.936869298284621E-002 1.820159754083533E-002 + 1.709090208647318E-002 1.603477820671338E-002 1.503140520386379E-002 1.407897305148863E-002 + 1.317568524908567E-002 1.231976156647928E-002 1.150944066983129E-002 1.074298262213307E-002 + 1.001867125199855E-002 9.334816385519761E-003 8.689755936870365E-003 8.081857854241981E-003 + 7.509521918569348E-003 6.971181393339760E-003 6.465304524586077E-003 5.990395890929348E-003 + 5.544997604263568E-003 5.127690362360200E-003 4.737094355312701E-003 4.371870028339719E-003 + 4.030718704020124E-003 3.712383067542550E-003 3.415647519016873E-003 3.139338397315258E-003 + 2.882324080285969E-003 2.643514966515268E-003 2.421863344101450E-003 2.216363152151600E-003 + 2.026049640917158E-003 1.849998936649522E-003 1.687327517383463E-003 1.537191605944728E-003 + 1.398786486529073E-003 1.271345751236721E-003 1.154140482891915E-003 1.046478380474082E-003 + 9.477028333932470E-004 8.571919507436638E-004 7.743575515435820E-004 6.986441218188300E-004 + 6.295277442159047E-004 5.665150056366306E-004 5.091418881989111E-004 4.569726485571144E-004 + 4.095986904270582E-004 3.666374348885819E-004 3.277311927836293E-004 2.925460432626300E-004 + 2.607707222606449E-004 2.321155244106597E-004 2.063112216398754E-004 1.831084964287518E-004 + 1.622808212987347E-004 1.436138682814248E-004 1.269093213725300E-004 1.119844867543084E-004 + 9.867134522126673E-005 8.681564161201218E-005 7.627601224021512E-005 6.692315121768971E-005 + 5.863901648117145E-005 5.131607628390857E-005 4.485659689741043E-005 3.917197229997181E-005 + 3.418209671117872E-005 2.981478097980356E-005 2.600521405957843E-005 2.264235810686479E-005 + 1.967911078948544E-005 1.707268946209148E-005 1.478430803601421E-005 1.277887047664681E-005 + 1.102468079733011E-005 9.493169344289565E-006 8.158635099126459E-006 6.998003663833427E-006 + 5.990600538332791E-006 5.117939252123248E-006 4.363523869697761E-006 3.712665353843395E-006 + 3.152311241579547E-006 2.670888064114003E-006 2.258155924539304E-006 1.905074634756673E-006 + 1.603680805976580E-006 1.346975284752027E-006 1.128820328483141E-006 9.438459203045262E-007 + 7.873646328387712E-007 6.552944630714146E-007 5.440890761835351E-007 4.506749141733107E-007 + 3.723946451312487E-007 3.069564507363943E-007 2.523886725625801E-007 2.069993617931601E-007 + 1.693403016292659E-007 1.381750967532339E-007 1.124509494124934E-007 9.127376678218614E-008 + 7.388626903504656E-008 5.964879180831758E-008 4.802250034874744E-008 3.855475540198857E-008 + 3.086639277973748E-008 2.464069939728511E-008 1.961388835768030E-008 1.556689431821548E-008 + 1.231832788039394E-008 9.718444082370497E-009 7.643995244230443E-009 5.993852435425499E-009 + 4.685292725419767E-009 3.650861177701284E-009 2.835727296130231E-009 2.195465379636327E-009 + 1.694197039769536E-009 1.303042042127807E-009 9.988307059456911E-010 7.630373958761852E-010 + 5.809002260612961E-010 4.406970280365319E-010 3.331519684707155E-010 2.509509957954725E-010 + 1.883475995294562E-010 1.408432328119249E-010 1.049292244965940E-010 7.787913603162730E-011 + 5.758234083600840E-011 4.241115718879405E-011 3.111518367133702E-011 2.273759960992745E-011 + 1.654912932217883E-011 1.199615289436188E-011 8.660099561380144E-012 6.225801804938767E-012 + 4.456935934997816E-012 3.177042913226915E-012 2.254924288500201E-012 1.593453350347535E-012 + 1.121040396905728E-012 7.851513927148686E-013 5.474080635022485E-013 3.799003715141809E-013 + 2.624241365304021E-013 1.804213125568504E-013 1.234514094982611E-013 8.406248969327576E-014 + 5.696130405120588E-014 3.840627996577907E-014 2.576570546069773E-014 1.719775647002971E-014 + 1.141993565744167E-014 7.543787000931954E-015 4.957018224268122E-015 3.239873334537814E-015 + 2.106117916343675E-015 1.361616541661726E-015 8.754158742394170E-016 5.596687774791476E-016 + 3.557738496160280E-016 2.248599350334098E-016 1.412907380306521E-016 8.825654175498248E-017 + 5.479984892717239E-017 3.382036544443760E-017 2.074486131787533E-017 1.264568878210174E-017 + 7.660200609161282E-018 4.610723270078356E-018 2.757365629964819E-018 1.638252103412378E-018 + 9.669242036342996E-019 5.668827549080152E-019 3.301007551131498E-019 1.909040442031113E-019 + 1.096380980150992E-019 6.252411483171713E-020 3.540256837295189E-020 1.990142283583697E-020 + 1.110596017813807E-020 6.151920545371780E-021 3.382263467019624E-021 1.845462581313459E-021 + 9.992234346395062E-022 5.368308675522184E-022 2.861457270940119E-022 1.513104237251728E-022 + 7.936674415213993E-023 4.129069625983690E-023 2.130418896870418E-023 1.090012891082889E-023 + 5.529758859420384E-024 2.781263951573173E-024 1.386732250404776E-024 6.853458205683369E-025 + 3.356954194190725E-025 1.629486246061723E-025 7.837474650878181E-026 3.734837175185186E-026 + 1.763138984248185E-026 8.244596671147523E-027 3.818284346403259E-027 1.751178618350454E-027 + 7.952480813317832E-028 3.575450974909615E-028 1.591330432405223E-028 7.010288551009714E-029 + 3.056337796645827E-029 1.318560263225846E-029 5.628262132627767E-030 2.376655069223483E-030 + 9.926966959452249E-031 4.100774711915087E-031 1.675150154163590E-031 6.765795898176817E-032 + 2.701465446675277E-032 1.066185055110814E-032 4.158674216369998E-033 1.602883773223423E-033 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + + + + 3.609136560465641E-008 3.700502349847288E-008 3.794181078396430E-008 3.890231298610786E-008 + 3.988713045260043E-008 4.089687872910136E-008 4.193218894397555E-008 4.299370820277606E-008 + 4.408209999271373E-008 4.519804459736596E-008 4.634223952188454E-008 4.751539992896743E-008 + 4.871825908586781E-008 4.995156882271954E-008 5.121610000246571E-008 5.251264300268332E-008 + 5.384200820960607E-008 5.520502652465381E-008 5.660254988378530E-008 5.803545178999899E-008 + 5.950462785931374E-008 6.101099638057250E-008 6.255549888941781E-008 6.413910075679799E-008 + 6.576279179237154E-008 6.742758686318798E-008 6.913452652803088E-008 7.088467768782046E-008 + 7.267913425248152E-008 7.451901782469357E-008 7.640547840095154E-008 7.833969509037485E-008 + 8.032287685171279E-008 8.235626324900934E-008 8.444112522639876E-008 8.657876590251505E-008 + 8.877052138501412E-008 9.101776160571547E-008 9.332189117688770E-008 9.568435026921260E-008 + 9.810661551197452E-008 1.005902009160404E-007 1.031366588202071E-007 1.057475808615058E-007 + 1.084245989700724E-007 1.111693863892033E-007 1.139836587212372E-007 1.168691749999141E-007 + 1.198277387898842E-007 1.228611993140515E-007 1.259714526094591E-007 1.291604427124371E-007 + 1.324301628737568E-007 1.357826568045469E-007 1.392200199537540E-007 1.427444008179427E-007 + 1.463580022842595E-007 1.500630830073941E-007 1.538619588214025E-007 1.577570041872742E-007 + 1.617506536771467E-007 1.658454034960982E-007 1.700438130424659E-007 1.743485065076710E-007 + 1.787621745165451E-007 1.832875758091859E-007 1.879275389653947E-007 1.926849641727740E-007 + 1.975628250395861E-007 2.025641704535135E-007 2.076921264874768E-007 2.129498983537038E-007 + 2.183407724072759E-007 2.238681182003968E-007 2.295353905886745E-007 2.353461318907275E-007 + 2.413039741024739E-007 2.474126411674809E-007 2.536759513047950E-007 2.600978193957126E-007 + 2.666822594309794E-007 2.734333870199497E-007 2.803554219632770E-007 2.874526908907423E-007 + 2.947296299658711E-007 3.021907876590275E-007 3.098408275907220E-007 3.176845314469127E-007 + 3.257268019681187E-007 3.339726660142199E-007 3.424272777068541E-007 3.510959216513808E-007 + 3.599840162404289E-007 3.690971170410852E-007 3.784409202678549E-007 3.880212663435526E-007 + 3.978441435503631E-007 4.079156917733456E-007 4.182422063387331E-007 4.288301419494155E-007 + 4.396861167200765E-007 4.508169163145097E-007 4.622294981876918E-007 4.739309959352753E-007 + 4.859287237532246E-007 4.982301810103663E-007 5.108430569367414E-007 5.237752354306696E-007 + 5.370347999875436E-007 5.506300387534312E-007 5.645694497066585E-007 5.788617459705973E-007 + 5.935158612609996E-007 6.085409554712686E-007 6.239464203991847E-007 6.397418856186405E-007 + 6.559372245000820E-007 6.725425603834132E-007 6.895682729072277E-007 7.070250044983322E-007 + 7.249236670256109E-007 7.432754486224128E-007 7.620918206817091E-007 7.813845450284254E-007 + 8.011656812734112E-007 8.214475943536650E-007 8.422429622635313E-007 8.635647839817064E-007 + 8.854263875990133E-007 9.078414386520461E-007 9.308239486678703E-007 9.543882839251741E-007 + 9.785491744373056E-007 1.003321723162854E-006 1.028721415449535E-006 1.054764128717280E-006 + 1.081466142386608E-006 1.108844148058481E-006 1.136915259952037E-006 1.165697025606720E-006 + 1.195207436855513E-006 1.225464941076158E-006 1.256488452727391E-006 1.288297365177427E-006 + 1.320911562832108E-006 1.354351433570306E-006 1.388637881494375E-006 1.423792340003632E-006 + 1.459836785199055E-006 1.496793749627622E-006 1.534686336374880E-006 1.573538233514568E-006 + 1.613373728924373E-006 1.654217725477091E-006 1.696095756616722E-006 1.739034002329223E-006 + 1.783059305518012E-006 1.828199188794402E-006 1.874481871693536E-006 1.921936288326632E-006 + 1.970592105480552E-006 2.020479741176088E-006 2.071630383696615E-006 2.124076011098988E-006 + 2.177849411218981E-006 2.232984202183777E-006 2.289514853444407E-006 2.347476707341301E-006 + 2.406906001216534E-006 2.467839890086576E-006 2.530316469889807E-006 2.594374801323450E-006 + 2.660054934284760E-006 2.727397932931887E-006 2.796445901380218E-006 2.867242010050127E-006 + 2.939830522682939E-006 3.014256824041857E-006 3.090567448315367E-006 3.168810108240985E-006 + 3.249033724967502E-006 3.331288458674702E-006 3.415625739969619E-006 3.502098302079136E-006 + 3.590760213859198E-006 3.681666913641318E-006 3.774875243937771E-006 3.870443487027127E-006 + 3.968431401442706E-006 4.068900259386821E-006 4.171912885094266E-006 4.277533694169413E-006 + 4.385828733921400E-006 4.496865724723075E-006 4.610714102419553E-006 4.727445061813140E-006 + 4.847131601252126E-006 4.969848568351363E-006 5.095672706873549E-006 5.224682704800764E-006 + 5.356959243626495E-006 5.492585048899422E-006 5.631644942050527E-006 5.774225893536518E-006 + 5.920417077332965E-006 6.070309926811504E-006 6.223998192036603E-006 6.381577998517732E-006 + 6.543147907454317E-006 6.708808977511507E-006 6.878664828165598E-006 7.052821704659508E-006 + 7.231388544608961E-006 7.414477046301830E-006 7.602201738733821E-006 7.794680053424522E-006 + 7.992032398059778E-006 8.194382232006544E-006 8.401856143748397E-006 8.614583930290654E-006 + 8.832698678585317E-006 9.056336849027820E-006 9.285638361078057E-006 9.520746681060576E-006 + 9.761808912199199E-006 1.000897588694358E-005 1.026240226164622E-005 1.052224661365012E-005 + 1.078867154084885E-005 1.106184376378244E-005 1.134193423033375E-005 1.162911822309260E-005 + 1.192357546945530E-005 1.222549025453041E-005 1.253505153692237E-005 1.285245306746673E-005 + 1.317789351099346E-005 1.351157657119514E-005 1.385371111868061E-005 1.420451132229561E-005 + 1.456419678379414E-005 1.493299267594759E-005 1.531112988417905E-005 1.569884515181429E-005 + 1.609638122904224E-005 1.650398702568067E-005 1.692191776784502E-005 1.735043515862121E-005 + 1.778980754284549E-005 1.824031007609759E-005 1.870222489801575E-005 1.917584131004566E-005 + 1.966145595773716E-005 2.015937301770727E-005 2.066990438938959E-005 2.119336989169430E-005 + 2.173009746470594E-005 2.228042337654926E-005 2.284469243555768E-005 2.342325820788152E-005 + 2.401648324067725E-005 2.462473929102320E-005 2.524840756071003E-005 2.588787893705895E-005 + 2.654355423992512E-005 2.721584447504630E-005 2.790517109390312E-005 2.861196626026023E-005 + 2.933667312356324E-005 3.007974609936976E-005 3.084165115699911E-005 3.162286611458957E-005 + 3.242388094175633E-005 3.324519807005011E-005 3.408733271142125E-005 3.495081318489806E-005 + 3.583618125169668E-005 3.674399245898348E-005 3.767481649251742E-005 3.862923753840710E-005 + 3.960785465422212E-005 4.061128214970596E-005 4.164014997734385E-005 4.269510413304654E-005 + 4.377680706721762E-005 4.488593810647901E-005 4.602319388633864E-005 4.718928879508947E-005 + 4.838495542923946E-005 4.961094506077940E-005 5.086802811660286E-005 5.215699467040461E-005 + 5.347865494738875E-005 5.483383984213057E-005 5.622340144994385E-005 5.764821361211571E-005 + 5.910917247538213E-005 6.060719706602523E-005 6.214322987898850E-005 6.371823748241361E-005 + 6.533321113801394E-005 6.698916743771619E-005 6.868714895700781E-005 7.042822492544501E-005 + 7.221349191478668E-005 7.404407454523442E-005 7.592112621027198E-005 7.784582982061198E-005 + 7.981939856777162E-005 8.184307670781642E-005 8.391814036582464E-005 8.604589836164195E-005 + 8.822769305751296E-005 9.046490122819277E-005 9.275893495416123E-005 9.511124253857752E-005 + 9.752330944863702E-005 9.999665928200572E-005 1.025328547590334E-004 1.051334987414646E-004 + 1.078002352783882E-004 1.105347506801894E-004 1.133387746212929E-004 1.162140812725056E-004 + 1.191624904637969E-004 1.221858688783746E-004 1.252861312789471E-004 1.284652417670851E-004 + 1.317252150766264E-004 1.350681179020965E-004 1.384960702631469E-004 1.420112469060468E-004 + 1.456158787432927E-004 1.493122543324367E-004 1.531027213952706E-004 1.569896883785311E-004 + 1.609756260573410E-004 1.650630691826276E-004 1.692546181738077E-004 1.735529408580661E-004 + 1.779607742575996E-004 1.824809264262410E-004 1.871162783369262E-004 1.918697858215109E-004 + 1.967444815644989E-004 2.017434771522913E-004 2.068699651796196E-004 2.121272214148816E-004 + 2.175186070261602E-004 2.230475708697518E-004 2.287176518431148E-004 2.345324813041874E-004 + 2.404957855591112E-004 2.466113884204555E-004 2.528832138381104E-004 2.593152886050956E-004 + 2.659117451405971E-004 2.726768243526493E-004 2.796148785829311E-004 2.867303746362573E-004 + 2.940278968974242E-004 3.015121505381664E-004 3.091879648170768E-004 3.170602964754454E-004 + 3.251342332320778E-004 3.334149973802628E-004 3.419079494901689E-004 3.506185922200816E-004 + 3.595525742399983E-004 3.687156942712364E-004 3.781139052458524E-004 3.877533185897831E-004 + 3.976402086337990E-004 4.077810171564779E-004 4.181823580635893E-004 4.288510222084276E-004 + 4.397939823578112E-004 4.510183983086402E-004 4.625316221600876E-004 4.743412037466947E-004 + 4.864548962378441E-004 4.988806619092847E-004 5.116266780926098E-004 5.247013433088203E-004 + 5.381132835923258E-004 5.518713590120023E-004 5.659846703961741E-004 5.804625662686488E-004 + 5.953146500032424E-004 6.105507872044865E-004 6.261811133225514E-004 6.422160415107092E-004 + 6.586662707340087E-004 6.755427941381870E-004 6.928569076881826E-004 7.106202190860157E-004 + 7.288446569781974E-004 7.475424804632057E-004 7.667262889100498E-004 7.864090320993605E-004 + 8.066040206989167E-004 8.273249370860166E-004 8.485858465296157E-004 8.704012087456853E-004 + 8.927858898398012E-004 9.157551746515588E-004 9.393247795160354E-004 9.635108654581228E-004 + 9.883300518362733E-004 1.013799430452847E-003 1.039936580149006E-003 1.066759581902865E-003 + 1.094287034450380E-003 1.122538070449303E-003 1.151532373207423E-003 1.181290193997177E-003 + 1.211832369979697E-003 1.243180342762345E-003 1.275356177614837E-003 1.308382583370115E-003 + 1.342282933037302E-003 1.377081285155238E-003 1.412802405916343E-003 1.449471792091848E-003 + 1.487115694790824E-003 1.525761144086813E-003 1.565435974547407E-003 1.606168851703612E-003 + 1.647989299497537E-003 1.690927728748604E-003 1.735015466680232E-003 1.780284787550913E-003 + 1.826768944435388E-003 1.874502202203847E-003 1.923519871749064E-003 1.973858345513693E-003 + 2.025555134372271E-003 2.078648905924871E-003 2.133179524261954E-003 2.189188091262641E-003 + 2.246716989491370E-003 2.305809926760901E-003 2.366511982432578E-003 2.428869655528109E-003 + 2.492930914730343E-003 2.558745250354075E-003 2.626363728371575E-003 2.695839046581347E-003 + 2.767225593012623E-003 2.840579506662359E-003 2.915958740665750E-003 2.993423128005959E-003 + 3.073034449873520E-003 3.154856506790907E-003 3.238955192622923E-003 3.325398571599097E-003 + 3.414256958480026E-003 3.505603002005498E-003 3.599511771768547E-003 3.696060848666139E-003 + 3.795330419083960E-003 3.897403372979965E-003 4.002365406038758E-003 4.110305126076788E-003 + 4.221314163886315E-003 4.335487288714699E-003 4.452922528584508E-003 4.573721295669107E-003 + 4.697988516948120E-003 4.825832770377320E-003 4.957366426818012E-003 5.092705797981995E-003 + 5.231971290659733E-003 5.375287567511346E-003 5.522783714712642E-003 5.674593416761197E-003 + 5.830855138761627E-003 5.991712316522815E-003 6.157313554815226E-003 6.327812834151410E-003 + 6.503369726469309E-003 6.684149620114510E-003 6.870323954535005E-003 7.062070465120482E-003 + 7.259573438636906E-003 7.463023979726964E-003 7.672620288967447E-003 7.888567952995921E-003 + 8.111080247241463E-003 8.340378451817185E-003 8.576692181156151E-003 8.820259727997607E-003 + 9.071328422355911E-003 9.330155006131850E-003 9.597006024053631E-003 9.872158231664140E-003 + 1.015589902110079E-002 1.044852686544547E-002 1.075035178245487E-002 1.106169581851408E-002 + 1.138289355369163E-002 1.171429262880962E-002 1.205625429547975E-002 1.240915399009420E-002 + 1.277338193279997E-002 1.314934375252582E-002 1.353746113917354E-002 1.393817252412780E-002 + 1.435193379028442E-002 1.477921901284206E-002 1.522052123215009E-002 1.567635325995385E-002 + 1.614724852042768E-002 1.663376192743827E-002 1.713647079953222E-002 1.765597581419560E-002 + 1.819290200298778E-002 1.874789978920739E-002 1.932164606980552E-002 1.991484534331826E-002 + 2.052823088564993E-002 2.116256597559716E-002 2.181864517206452E-002 2.249729564498249E-002 + 2.319937856200019E-002 2.392579053308560E-002 2.467746511522817E-002 2.545537437949900E-002 + 2.626053054278528E-002 2.709398766657503E-002 2.795684342522781E-002 2.885024094622466E-002 + 2.977537072494697E-002 3.073347261658875E-002 3.172583790785778E-002 3.275381147117142E-002 + 3.381879400409774E-002 3.492224435683498E-002 3.606568195056020E-002 3.725068928950943E-002 + 3.847891456967910E-002 3.975207438705763E-002 4.107195654830934E-002 4.244042298683642E-002 + 4.385941278714023E-002 4.533094532038730E-002 4.685712349405909E-002 4.844013711852421E-002 + 5.008226639332022E-002 5.178588551586097E-002 5.355346641520162E-002 5.538758261338862E-002 + 5.729091321679826E-002 5.926624703971987E-002 6.131648686227249E-002 6.344465382454365E-002 + 6.565389195861815E-002 6.794747285990792E-002 7.032880049890591E-002 7.280141617416545E-002 + 7.536900360694104E-002 7.803539417752645E-002 8.080457230287598E-002 8.368068095460071E-002 + 8.666802731588247E-002 8.977108857525092E-002 9.299451785450608E-002 9.634315026734788E-002 + 9.982200910448874E-002 1.034363121401628E-001 1.071914780540157E-001 1.110931329613471E-001 + 1.151471170435794E-001 1.193594912696478E-001 1.237365441977241E-001 1.282847988453197E-001 + 1.330110196143328E-001 1.379222192560181E-001 1.430256658591728E-001 1.483288898430092E-001 + 1.538396909342593E-001 1.595661451059983E-001 1.655166114534812E-001 1.716997389799749E-001 + 1.781244732631067E-001 1.848000629696567E-001 1.917360661839851E-001 1.989423565124028E-001 + 2.064291289227767E-001 2.142069052754886E-001 2.222865394985604E-001 2.306792223563129E-001 + 2.393964857573356E-001 2.484502065438389E-001 2.578526097006177E-001 2.676162709179110E-001 + 2.777541184383887E-001 2.882794341143586E-001 2.992058535970820E-001 3.105473655758195E-001 + 3.223183099799514E-001 3.345333750532178E-001 3.472075932048730E-001 3.603563355383553E-001 + 3.739953049539719E-001 3.881405277181692E-001 4.028083433881987E-001 4.180153929774969E-001 + 4.337786052439137E-001 4.501151809801064E-001 4.670425751830544E-001 4.845784769778242E-001 + 5.027407871694659E-001 5.215475932964281E-001 5.410171420591287E-001 5.611678089984991E-001 + 5.820180653015261E-001 6.035864416141057E-001 6.258914887461138E-001 6.489517351595169E-001 + 6.727856411377919E-001 6.974115495440167E-001 7.228476330857826E-001 7.491118380178721E-001 + 7.762218242283851E-001 8.041949016709219E-001 8.330479631246307E-001 8.627974132855047E-001 + 8.934590942164167E-001 9.250482072099495E-001 9.575792311474079E-001 9.910658374692892E-001 + 1.025520801907094E+000 1.060955913163621E+000 1.097381878768746E+000 1.134808228379969E+000 + 1.173243214841684E+000 1.212693713363879E+000 1.253165119229536E+000 1.294661244490107E+000 + 1.337184214159558E+000 1.380734362469229E+000 1.425310129797445E+000 1.470907960939005E+000 + 1.517522205429156E+000 1.565145020684281E+000 1.613766278765669E+000 1.663373477612796E+000 + 1.713951657627408E+000 1.765483324517950E+000 1.817948379334614E+000 1.871324056636980E+000 + 1.925584871737658E+000 1.980702577955337E+000 2.036646134787552E+000 2.093381687876581E+000 + 2.150872561589577E+000 2.209079264965329E+000 2.267959511694610E+000 2.327468254697324E+000 + 2.387557735738300E+000 2.448177550383690E+000 2.509274728442136E+000 2.570793829860394E+000 + 2.632677055852185E+000 2.694864374834480E+000 2.757293662529005E+000 2.819900855361307E+000 + 2.882620116059604E+000 2.945384010123923E+000 3.008123691608776E+000 3.070769096444430E+000 + 3.133249141319005E+000 3.195491925962894E+000 3.257424936524561E+000 3.318975247610346E+000 + 3.380069720487266E+000 3.440635194923278E+000 3.500598672171879E+000 3.559887486701184E+000 + 3.618429464428150E+000 3.676153065448613E+000 3.732987509555040E+000 3.788862883207004E+000 + 3.843710227059597E+000 3.897461603658929E+000 3.950050145471439E+000 4.001410084013723E+000 + 4.051476761477645E+000 4.100186626881940E+000 4.147477219406374E+000 4.193287142152820E+000 + 4.237556030102594E+000 4.280224516474528E+000 4.321234202002930E+000 4.360527631823709E+000 + 4.398048284653127E+000 4.433740578746577E+000 4.467549898719685E+000 4.499422646691922E+000 + 4.529306320378326E+000 4.557149619721167E+000 4.582902582448924E+000 4.606516747618394E+000 + 4.627945344793874E+000 4.647143505119919E+000 4.664068489236158E+000 4.678679925861220E+000 + 4.690940054041390E+000 4.700813961619072E+000 4.708269812522362E+000 4.713279056086011E+000 + 4.715816612833983E+000 4.715861032994853E+000 4.713394626438886E+000 4.708403565616320E+000 + 4.700877966263681E+000 4.690811953875819E+000 4.678203726888217E+000 4.663055629774454E+000 + 4.645374250379410E+000 4.625170555280406E+000 4.602460074282587E+000 4.577263139815198E+000 + 4.549605178541126E+000 4.519517040521623E+000 4.487035335432531E+000 4.452202725252361E+000 + 4.415068098091987E+000 4.375686517730733E+000 4.334118806871822E+000 4.290430609317148E+000 + 4.244691140719679E+000 4.196972654065107E+000 4.147350215417223E+000 4.095901497906700E+000 + 4.042706570288598E+000 3.987847680895041E+000 3.931409037816736E+000 3.873476586149655E+000 + 3.814137783141754E+000 3.753481372069180E+000 3.691597155661506E+000 3.628575769882482E+000 + 3.564508458855321E+000 3.499486851701232E+000 3.433602742035853E+000 3.366947870841330E+000 + 3.299613713402093E+000 3.231691270960034E+000 3.163270867710215E+000 3.094441953721816E+000 + 3.025292914330387E+000 2.955910886507720E+000 2.886381582674431E+000 2.816789122381812E+000 + 2.747215872242813E+000 2.677742294443709E+000 2.608446804144489E+000 2.539405636019624E+000 + 2.470692720135497E+000 2.402379567346552E+000 2.334535164342100E+000 2.267225878426545E+000 + 2.200515372086003E+000 2.134464527356235E+000 2.069131379971317E+000 2.004571063238839E+000 + 1.940835761555869E+000 1.877974673449710E+000 1.816033983999606E+000 1.755056846469013E+000 + 1.695083372953769E+000 1.636150633828657E+000 1.578292665753740E+000 1.521540487982517E+000 + 1.465922126695638E+000 1.411462647067365E+000 1.358184192756274E+000 1.306106032497134E+000 + 1.255244613457327E+000 1.205613621008161E+000 1.157224044549334E+000 1.110084249013178E+000 + 1.064200051664210E+000 1.019574803799170E+000 9.762094769427444E-001 9.341027531250303E-001 + 8.932511188184122E-001 8.536489621040070E-001 8.152886726316125E-001 7.781607439320264E-001 + 7.422538776372712E-001 7.075550891626070E-001 6.740498144046407E-001 6.417220170124964E-001 + 6.105542957940100E-001 5.805279918265505E-001 5.516232948523041E-001 5.238193485507716E-001 + 4.970943542969151E-001 4.714256730316063E-001 4.467899248918353E-001 4.231630862712558E-001 + 4.005205840067597E-001 3.788373864140822E-001 3.580880909240159E-001 3.382470081003345E-001 + 3.192882418517020E-001 3.011857656810514E-001 2.839134948471927E-001 2.674453543448088E-001 + 2.517553426397708E-001 2.368175911266718E-001 2.226064193043215E-001 2.090963856924619E-001 + 1.962623345388483E-001 1.840794383899594E-001 1.725232366207477E-001 1.615696700388903E-001 + 1.511951116968792E-001 1.413763940608610E-001 1.320908326984295E-001 1.233162466585174E-001 + 1.150309757251445E-001 1.072138947331223E-001 9.984442513788835E-002 9.290254403357785E-002 + 8.636879081330652E-002 8.022427166355021E-002 7.445066208063483E-002 6.903020759181530E-002 + 6.394572285643356E-002 5.918058931437520E-002 5.471875153969888E-002 5.054471244712146E-002 + 4.664352748820030E-002 4.300079796281249E-002 3.960266356008539E-002 3.643579423150409E-002 + 3.348738148771539E-002 3.074512919973049E-002 2.819724397497777E-002 2.583242516909822E-002 + 2.363985458562404E-002 2.160918590782129E-002 1.973053390005569E-002 1.799446341009169E-002 + 1.639197819875241E-002 1.491450961932547E-002 1.355390516595688E-002 1.230241690795810E-002 + 1.115268982538878E-002 1.009775006037289E-002 9.130993098265329E-003 8.246171892909172E-003 + 7.437384950707605E-003 6.699064388984371E-003 6.025963985028384E-003 5.413147233227065E-003 + 4.855975428714141E-003 4.350095796921757E-003 3.891429689281100E-003 3.476160866011855E-003 + 3.100723887444692E-003 2.761792635607746E-003 2.456268987860445E-003 2.181271664169866E-003 + 1.934125269195867E-003 1.712349549687695E-003 1.513648886810273E-003 1.335902041928791E-003 + 1.177152173107029E-003 1.035597138141127E-003 9.095800983813123E-004 7.975804359164222E-004 + 6.982049949357855E-004 6.101796562673717E-004 5.323412522454973E-004 4.636298272103285E-004 + 4.030812471082376E-004 3.498201598676332E-004 3.030533064886101E-004 2.620631811234451E-004 + 2.262020368533378E-004 1.948862323972449E-004 1.675909136311306E-004 1.438450225583165E-004 + 1.232266252593443E-004 1.053585493664076E-004 8.990432075449645E-005 7.656438841862418E-005 + 6.507262591203287E-005 5.519309725068169E-005 4.671707483999613E-005 3.946029674504452E-005 + 3.326045049833026E-005 2.797487061285973E-005 2.347843703406808E-005 1.966166191418986E-005 + 1.642895231811492E-005 1.369703676192384E-005 1.139354383544059E-005 9.455721559682359E-006 + 7.829286570680156E-006 6.467392695023346E-006 5.329708981121490E-006 4.381597768188554E-006 + 3.593383903842351E-006 2.939706756071335E-006 2.398947200293272E-006 1.952722292436584E-006 + 1.585440860103848E-006 1.283913752182306E-006 1.037012979688743E-006 8.353744541081522E-007 + 6.711394827256097E-007 5.377306109250567E-007 4.296578085190342E-007 3.423513799272013E-007 + 2.720183360519935E-007 2.155192989388144E-007 1.702633189914308E-007 1.341189941825629E-007 + 1.053430416137545E-007 8.250164706248678E-008 6.442516024375438E-008 5.016293969008727E-008 + 3.894469424568933E-008 3.014819036176702E-008 2.327236202334659E-008 1.791499093686525E-008 + 1.375424011646401E-008 1.053342563710948E-008 8.048500403931213E-009 6.137801576873579E-009 + 4.673680961086374E-009 3.555696222094797E-009 2.705092010401698E-009 2.050710202213143E-009 + 1.549072556928544E-009 1.165908751825222E-009 8.743042091315888E-010 6.531988365311785E-010 + 4.861747861348464E-010 3.604813255627143E-010 2.662534700774652E-010 1.958883197675274E-010 + 1.435492384301916E-010 1.047732440351428E-010 7.616138313606007E-011 5.513554840468232E-011 + 3.974827183177851E-011 2.853457636723849E-011 2.039707511629042E-011 1.451723882766705E-011 + 1.028716928879450E-011 7.257370110087801E-012 5.096941581754378E-012 3.563380621620248E-012 + 2.479772335443879E-012 1.717643374504510E-012 1.184131713642948E-012 8.124315251013267E-013 + 5.547110933241880E-013 3.768890540057167E-013 2.548001699451448E-013 1.713949440664316E-013 + 1.147045515072835E-013 7.636942969912139E-014 5.058086422120955E-014 3.332360207401035E-014 + 2.183672303944284E-014 1.423191347249975E-014 9.224642166703026E-015 5.945876660183951E-015 + 3.810936814741767E-015 2.428656268013420E-015 1.538818466438771E-015 9.693127950493447E-016 + 6.069648071643465E-016 3.777926215694329E-016 2.337226531938202E-016 1.437050680789771E-016 + 8.780787169520823E-017 5.331514935702778E-017 3.216539719278915E-017 1.928027293303637E-017 + 1.148121443838776E-017 6.791674254266361E-018 3.990651116583259E-018 2.328904270031712E-018 + 1.349780290556214E-018 7.768554820825256E-019 4.439609363842891E-019 2.519056091632093E-019 + 1.418992729941321E-019 7.934726491569431E-020 4.404056861384094E-020 2.426063931613628E-020 + 1.326290390461898E-020 7.194825016371130E-021 3.872618619604420E-021 2.067993744085588E-021 + 1.095494725288831E-021 5.756307370596395E-022 2.999892976520704E-022 1.550424324575166E-022 + 7.945711171469990E-023 4.037440668994160E-023 2.033873418747260E-023 1.015637431893515E-023 + 5.026926285978212E-024 2.465850837928393E-024 1.198622351949128E-024 5.772971691064510E-025 + 2.754657097349085E-025 1.302074000989469E-025 6.096100202842944E-026 2.826600869372837E-026 + 1.297836063685569E-026 5.900169363239212E-027 2.655486311549716E-027 1.183051310409795E-027 + 5.216597216804307E-028 2.276348892617197E-028 9.828811870290515E-029 4.198711689539671E-029 + 1.774293071017529E-029 7.415998426107355E-030 3.065411811481451E-030 1.252916561940014E-030 + 5.063001282824324E-031 2.022479615329171E-031 7.985229061298544E-032 3.115686865019586E-032 + 1.201209376976367E-032 4.575268475181235E-033 1.721397084391520E-033 6.396537790950949E-034 + 2.347146934903795E-034 8.503507629296820E-035 3.041226086924514E-035 1.073547981734032E-035 + 3.739769662295298E-036 1.285424231248403E-036 4.358660341050868E-037 1.457774163724139E-037 + 4.808205014547398E-038 1.563705974195900E-038 5.013367389606135E-039 1.584266523563092E-039 + 4.933694059135546E-040 1.513845055862697E-040 4.575882464134242E-041 1.362292855611254E-041 + 3.993789889331086E-042 1.152749521427470E-042 3.275175085366430E-043 9.157937731156533E-044 + 2.519632030924495E-044 6.819686390488435E-045 1.815473870457028E-045 4.752512410907514E-046 + 1.223129321733529E-046 3.094171667328168E-047 7.692105337250774E-048 1.878795575081948E-048 + 4.507656584757881E-049 1.062090170441730E-049 2.457040356126323E-050 5.579603490058104E-051 + 1.243463631110288E-051 2.718934970795873E-052 5.831718139995266E-053 1.226650621347121E-053 + 2.529678043447530E-054 5.113539869592847E-055 1.012933018039598E-055 1.965765822736715E-056 + 3.736480290882348E-057 6.954404671032851E-058 1.267093385342866E-058 2.259395727226271E-059 + 3.941786920562265E-060 6.726541295152905E-061 1.122451215597719E-061 1.831039765431450E-062 + 2.919166223832182E-063 4.547002286966594E-064 6.917828495160245E-065 1.027694556185183E-065 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + + diff --git a/tests/apps/miniDFT/tests/espresso/benchmark/O.pz-mt.UPF b/tests/apps/miniDFT/tests/espresso/benchmark/O.pz-mt.UPF new file mode 100644 index 0000000000..304659d49c --- /dev/null +++ b/tests/apps/miniDFT/tests/espresso/benchmark/O.pz-mt.UPF @@ -0,0 +1,1634 @@ + +Generated using JLMartins' code +Author: Renata Wentzcovitch Generation date: before 1998 +Info: Oxygen LDA 2s2 2p4 l=1 local Martins-Troullier + 0 The Pseudo was generated with a Non-Relativistic Calculation + 0.00000000000E+00 Local Potential cutoff radius +nl pn l occ Rcut Rcut US E pseu +2S 0 0 2.00 0.00000000000 0.00000000000 0.00000000000 +2P 0 1 4.00 0.00000000000 0.00000000000 0.00000000000 + + + + + 0 Version Number + O Element + NC Norm - Conserving pseudopotential + F Nonlinear Core Correction + SLA PZ NOGX NOGC PZ Exchange-Correlation functional + 6.00000000000 Z valence + 0.00000000000 Total energy + 0.0000000 0.0000000 Suggested cutoff for wfc and rho + 0 Max angular momentum component + 921 Number of points in mesh + 2 1 Number of Wavefunctions, Number of Projectors + Wavefunctions nl l occ + 2S 0 2.00 + 2P 1 4.00 + + + + + + 3.09844022083E-04 3.14212345306E-04 3.18642255154E-04 3.23134619905E-04 + 3.27690320075E-04 3.32310248597E-04 3.36995310992E-04 3.41746425546E-04 + 3.46564523494E-04 3.51450549198E-04 3.56405460335E-04 3.61430228083E-04 + 3.66525837313E-04 3.71693286780E-04 3.76933589321E-04 3.82247772053E-04 + 3.87636876572E-04 3.93101959159E-04 3.98644090989E-04 4.04264358337E-04 + 4.09963862793E-04 4.15743721479E-04 4.21605067265E-04 4.27549048994E-04 + 4.33576831706E-04 4.39689596864E-04 4.45888542591E-04 4.52174883900E-04 + 4.58549852934E-04 4.65014699206E-04 4.71570689849E-04 4.78219109856E-04 + 4.84961262340E-04 4.91798468784E-04 4.98732069302E-04 5.05763422903E-04 + 5.12893907753E-04 5.20124921451E-04 5.27457881299E-04 5.34894224581E-04 + 5.42435408842E-04 5.50082912181E-04 5.57838233531E-04 5.65702892961E-04 + 5.73678431968E-04 5.81766413785E-04 5.89968423682E-04 5.98286069278E-04 + 6.06720980859E-04 6.15274811695E-04 6.23949238364E-04 6.32745961081E-04 + 6.41666704031E-04 6.50713215710E-04 6.59887269263E-04 6.69190662832E-04 + 6.78625219914E-04 6.88192789712E-04 6.97895247500E-04 7.07734494990E-04 + 7.17712460707E-04 7.27831100364E-04 7.38092397246E-04 7.48498362602E-04 + 7.59051036032E-04 7.69752485896E-04 7.80604809711E-04 7.91610134568E-04 + 8.02770617546E-04 8.14088446134E-04 8.25565838664E-04 8.37205044742E-04 + 8.49008345688E-04 8.60978054988E-04 8.73116518743E-04 8.85426116132E-04 + 8.97909259873E-04 9.10568396704E-04 9.23406007855E-04 9.36424609541E-04 + 9.49626753447E-04 9.63015027238E-04 9.76592055056E-04 9.90360498044E-04 + 1.00432305486E-03 1.01848246221E-03 1.03284149538E-03 1.04740296880E-03 + 1.06216973654E-03 1.07714469296E-03 1.09233077318E-03 1.10773095374E-03 + 1.12334825310E-03 1.13918573232E-03 1.15524649559E-03 1.17153369088E-03 + 1.18805051051E-03 1.20480019185E-03 1.22178601788E-03 1.23901131789E-03 + 1.25647946808E-03 1.27419389227E-03 1.29215806254E-03 1.31037549992E-03 + 1.32884977510E-03 1.34758450909E-03 1.36658337396E-03 1.38585009354E-03 + 1.40538844418E-03 1.42520225546E-03 1.44529541093E-03 1.46567184894E-03 + 1.48633556332E-03 1.50729060423E-03 1.52854107892E-03 1.55009115256E-03 + 1.57194504902E-03 1.59410705175E-03 1.61658150456E-03 1.63937281252E-03 + 1.66248544281E-03 1.68592392556E-03 1.70969285479E-03 1.73379688931E-03 + 1.75824075356E-03 1.78302923862E-03 1.80816720313E-03 1.83365957420E-03 + 1.85951134841E-03 1.88572759280E-03 1.91231344584E-03 1.93927411843E-03 + 1.96661489496E-03 1.99434113431E-03 2.02245827090E-03 2.05097181579E-03 + 2.07988735772E-03 2.10921056422E-03 2.13894718276E-03 2.16910304178E-03 + 2.19968405195E-03 2.23069620724E-03 2.26214558612E-03 2.29403835278E-03 + 2.32638075830E-03 2.35917914189E-03 2.39243993215E-03 2.42616964830E-03 + 2.46037490147E-03 2.49506239599E-03 2.53023893073E-03 2.56591140039E-03 + 2.60208679691E-03 2.63877221077E-03 2.67597483244E-03 2.71370195373E-03 + 2.75196096930E-03 2.79075937802E-03 2.83010478452E-03 2.87000490062E-03 + 2.91046754686E-03 2.95150065406E-03 2.99311226484E-03 3.03531053521E-03 + 3.07810373615E-03 3.12150025528E-03 3.16550859846E-03 3.21013739145E-03 + 3.25539538166E-03 3.30129143977E-03 3.34783456158E-03 3.39503386968E-03 + 3.44289861529E-03 3.49143818004E-03 3.54066207786E-03 3.59057995678E-03 + 3.64120160087E-03 3.69253693212E-03 3.74459601244E-03 3.79738904556E-03 + 3.85092637909E-03 3.90521850652E-03 3.96027606928E-03 4.01610985883E-03 + 4.07273081877E-03 4.13015004699E-03 4.18837879783E-03 4.24742848433E-03 + 4.30731068041E-03 4.36803712318E-03 4.42961971520E-03 4.49207052687E-03 + 4.55540179874E-03 4.61962594395E-03 4.68475555063E-03 4.75080338440E-03 + 4.81778239084E-03 4.88570569805E-03 4.95458661922E-03 5.02443865523E-03 + 5.09527549730E-03 5.16711102967E-03 5.23995933236E-03 5.31383468384E-03 + 5.38875156394E-03 5.46472465659E-03 5.54176885278E-03 5.61989925339E-03 + 5.69913117225E-03 5.77948013907E-03 5.86096190250E-03 5.94359243322E-03 + 6.02738792709E-03 6.11236480828E-03 6.19853973255E-03 6.28592959045E-03 + 6.37455151067E-03 6.46442286339E-03 6.55556126370E-03 6.64798457499E-03 + 6.74171091254E-03 6.83675864702E-03 6.93314640808E-03 7.03089308803E-03 + 7.13001784553E-03 7.23054010935E-03 7.33247958219E-03 7.43585624450E-03 + 7.54069035843E-03 7.64700247182E-03 7.75481342217E-03 7.86414434078E-03 + 7.97501665685E-03 8.08745210172E-03 8.20147271310E-03 8.31710083938E-03 + 8.43435914405E-03 8.55327061011E-03 8.67385854460E-03 8.79614658313E-03 + 8.92015869455E-03 9.04591918563E-03 9.17345270583E-03 9.30278425212E-03 + 9.43393917392E-03 9.56694317799E-03 9.70182233355E-03 9.83860307735E-03 + 9.97731221885E-03 1.01179769455E-02 1.02606248280E-02 1.04052838258E-02 + 1.05519822926E-02 1.07007489816E-02 1.08516130518E-02 1.10046040728E-02 + 1.11597520315E-02 1.13170873372E-02 1.14766408284E-02 1.16384437778E-02 + 1.18025278995E-02 1.19689253545E-02 1.21376687571E-02 1.23087911817E-02 + 1.24823261688E-02 1.26583077317E-02 1.28367703635E-02 1.30177490434E-02 + 1.32012792438E-02 1.33873969371E-02 1.35761386031E-02 1.37675412358E-02 + 1.39616423506E-02 1.41584799919E-02 1.43580927407E-02 1.45605197217E-02 + 1.47658006111E-02 1.49739756447E-02 1.51850856255E-02 1.53991719317E-02 + 1.56162765248E-02 1.58364419582E-02 1.60597113849E-02 1.62861285664E-02 + 1.65157378812E-02 1.67485843336E-02 1.69847135621E-02 1.72241718488E-02 + 1.74670061284E-02 1.77132639971E-02 1.79629937222E-02 1.82162442516E-02 + 1.84730652232E-02 1.87335069747E-02 1.89976205536E-02 1.92654577269E-02 + 1.95370709916E-02 1.98125135847E-02 2.00918394940E-02 2.03751034681E-02 + 2.06623610277E-02 2.09536684762E-02 2.12490829108E-02 2.15486622337E-02 + 2.18524651634E-02 2.21605512462E-02 2.24729808680E-02 2.27898152660E-02 + 2.31111165408E-02 2.34369476683E-02 2.37673725127E-02 2.41024558381E-02 + 2.44422633221E-02 2.47868615679E-02 2.51363181179E-02 2.54907014668E-02 + 2.58500810747E-02 2.62145273813E-02 2.65841118192E-02 2.69589068281E-02 + 2.73389858690E-02 2.77244234387E-02 2.81152950842E-02 2.85116774175E-02 + 2.89136481308E-02 2.93212860117E-02 2.97346709586E-02 3.01538839961E-02 + 3.05790072915E-02 3.10101241702E-02 3.14473191325E-02 3.18906778700E-02 + 3.23402872825E-02 3.27962354948E-02 3.32586118742E-02 3.37275070481E-02 + 3.42030129213E-02 3.46852226945E-02 3.51742308825E-02 3.56701333323E-02 + 3.61730272424E-02 3.66830111816E-02 3.72001851085E-02 3.77246503908E-02 + 3.82565098253E-02 3.87958676582E-02 3.93428296053E-02 3.98975028731E-02 + 4.04599961791E-02 4.10304197738E-02 4.16088854623E-02 4.21955066254E-02 + 4.27903982430E-02 4.33936769156E-02 4.40054608877E-02 4.46258700711E-02 + 4.52550260679E-02 4.58930521947E-02 4.65400735066E-02 4.71962168220E-02 + 4.78616107469E-02 4.85363857007E-02 4.92206739416E-02 4.99146095920E-02 + 5.06183286658E-02 5.13319690940E-02 5.20556707525E-02 5.27895754892E-02 + 5.35338271516E-02 5.42885716155E-02 5.50539568132E-02 5.58301327628E-02 + 5.66172515971E-02 5.74154675939E-02 5.82249372062E-02 5.90458190926E-02 + 5.98782741486E-02 6.07224655380E-02 6.15785587250E-02 6.24467215067E-02 + 6.33271240457E-02 6.42199389037E-02 6.51253410754E-02 6.60435080224E-02 + 6.69746197084E-02 6.79188586343E-02 6.88764098739E-02 6.98474611104E-02 + 7.08322026728E-02 7.18308275737E-02 7.28435315467E-02 7.38705130852E-02 + 7.49119734807E-02 7.59681168628E-02 7.70391502390E-02 7.81252835353E-02 + 7.92267296373E-02 8.03437044319E-02 8.14764268498E-02 8.26251189082E-02 + 8.37900057545E-02 8.49713157100E-02 8.61692803155E-02 8.73841343758E-02 + 8.86161160062E-02 8.98654666790E-02 9.11324312710E-02 9.24172581112E-02 + 9.37201990299E-02 9.50415094076E-02 9.63814482254E-02 9.77402781157E-02 + 9.91182654133E-02 1.00515680208E-01 1.01932796398E-01 1.03369891743E-01 + 1.04827247917E-01 1.06305150568E-01 1.07803889368E-01 1.09323758075E-01 + 1.10865054590E-01 1.12428081009E-01 1.14013143693E-01 1.15620553318E-01 + 1.17250624941E-01 1.18903678063E-01 1.20580036685E-01 1.22280029381E-01 + 1.24003989355E-01 1.25752254507E-01 1.27525167503E-01 1.29323075841E-01 + 1.31146331916E-01 1.32995293091E-01 1.34870321770E-01 1.36771785463E-01 + 1.38700056864E-01 1.40655513921E-01 1.42638539908E-01 1.44649523506E-01 + 1.46688858874E-01 1.48756945728E-01 1.50854189419E-01 1.52981001014E-01 + 1.55137797375E-01 1.57325001241E-01 1.59543041311E-01 1.61792352328E-01 + 1.64073375164E-01 1.66386556907E-01 1.68732350947E-01 1.71111217068E-01 + 1.73523621536E-01 1.75970037189E-01 1.78450943533E-01 1.80966826833E-01 + 1.83518180210E-01 1.86105503738E-01 1.88729304541E-01 1.91390096892E-01 + 1.94088402314E-01 1.96824749684E-01 1.99599675336E-01 2.02413723163E-01 + 2.05267444727E-01 2.08161399368E-01 2.11096154310E-01 2.14072284773E-01 + 2.17090374090E-01 2.20151013815E-01 2.23254803844E-01 2.26402352529E-01 + 2.29594276799E-01 2.32831202283E-01 2.36113763428E-01 2.39442603627E-01 + 2.42818375342E-01 2.46241740236E-01 2.49713369300E-01 2.53233942984E-01 + 2.56804151330E-01 2.60424694113E-01 2.64096280970E-01 2.67819631543E-01 + 2.71595475621E-01 2.75424553282E-01 2.79307615037E-01 2.83245421979E-01 + 2.87238745930E-01 2.91288369595E-01 2.95395086713E-01 2.99559702214E-01 + 3.03783032375E-01 3.08065904983E-01 3.12409159495E-01 3.16813647202E-01 + 3.21280231398E-01 3.25809787549E-01 3.30403203460E-01 3.35061379457E-01 + 3.39785228557E-01 3.44575676650E-01 3.49433662679E-01 3.54360138824E-01 + 3.59356070690E-01 3.64422437497E-01 3.69560232268E-01 3.74770462028E-01 + 3.80054147999E-01 3.85412325799E-01 3.90846045648E-01 3.96356372574E-01 + 4.01944386618E-01 4.07611183048E-01 4.13357872575E-01 4.19185581569E-01 + 4.25095452278E-01 4.31088643057E-01 4.37166328590E-01 4.43329700123E-01 + 4.49579965696E-01 4.55918350382E-01 4.62346096524E-01 4.68864463981E-01 + 4.75474730375E-01 4.82178191337E-01 4.88976160769E-01 4.95869971093E-01 + 5.02860973520E-01 5.09950538306E-01 5.17140055031E-01 5.24430932863E-01 + 5.31824600836E-01 5.39322508133E-01 5.46926124369E-01 5.54636939875E-01 + 5.62456465998E-01 5.70386235389E-01 5.78427802307E-01 5.86582742927E-01 + 5.94852655642E-01 6.03239161382E-01 6.11743903929E-01 6.20368550240E-01 + 6.29114790772E-01 6.37984339817E-01 6.46978935835E-01 6.56100341796E-01 + 6.65350345525E-01 6.74730760051E-01 6.84243423966E-01 6.93890201783E-01 + 7.03672984300E-01 7.13593688976E-01 7.23654260298E-01 7.33856670173E-01 + 7.44202918304E-01 7.54695032590E-01 7.65335069518E-01 7.76125114569E-01 + 7.87067282628E-01 7.98163718394E-01 8.09416596804E-01 8.20828123458E-01 + 8.32400535053E-01 8.44136099816E-01 8.56037117958E-01 8.68105922116E-01 + 8.80344877813E-01 8.92756383924E-01 9.05342873145E-01 9.18106812467E-01 + 9.31050703664E-01 9.44177083779E-01 9.57488525626E-01 9.70987638288E-01 + 9.84677067637E-01 9.98559496842E-01 1.01263764691E+00 1.02691427719E+00 + 1.04139218596E+00 1.05607421093E+00 1.07096322983E+00 1.08606216095E+00 + 1.10137396373E+00 1.11690163934E+00 1.13264823124E+00 1.14861682582E+00 + 1.16481055297E+00 1.18123258672E+00 1.19788614585E+00 1.21477449449E+00 + 1.23190094282E+00 1.24926884767E+00 1.26688161323E+00 1.28474269163E+00 + 1.30285558371E+00 1.32122383966E+00 1.33985105972E+00 1.35874089487E+00 + 1.37789704758E+00 1.39732327253E+00 1.41702337731E+00 1.43700122321E+00 + 1.45726072595E+00 1.47780585646E+00 1.49864064164E+00 1.51976916519E+00 + 1.54119556836E+00 1.56292405080E+00 1.58495887135E+00 1.60730434892E+00 + 1.62996486329E+00 1.65294485598E+00 1.67624883116E+00 1.69988135648E+00 + 1.72384706398E+00 1.74815065103E+00 1.77279688120E+00 1.79779058524E+00 + 1.82313666199E+00 1.84884007935E+00 1.87490587530E+00 1.90133915879E+00 + 1.92814511085E+00 1.95532898552E+00 1.98289611094E+00 2.01085189034E+00 + 2.03920180314E+00 2.06795140603E+00 2.09710633402E+00 2.12667230156E+00 + 2.15665510368E+00 2.18706061710E+00 2.21789480141E+00 2.24916370019E+00 + 2.28087344227E+00 2.31303024284E+00 2.34564040474E+00 2.37871031967E+00 + 2.41224646944E+00 2.44625542724E+00 2.48074385893E+00 2.51571852436E+00 + 2.55118627868E+00 2.58715407367E+00 2.62362895915E+00 2.66061808430E+00 + 2.69812869911E+00 2.73616815579E+00 2.77474391018E+00 2.81386352326E+00 + 2.85353466260E+00 2.89376510387E+00 2.93456273237E+00 2.97593554455E+00 + 3.01789164963E+00 3.06043927114E+00 3.10358674853E+00 3.14734253887E+00 + 3.19171521842E+00 3.23671348437E+00 3.28234615652E+00 3.32862217903E+00 + 3.37555062215E+00 3.42314068399E+00 3.47140169236E+00 3.52034310658E+00 + 3.56997451932E+00 3.62030565849E+00 3.67134638916E+00 3.72310671548E+00 + 3.77559678263E+00 3.82882687884E+00 3.88280743737E+00 3.93754903859E+00 + 3.99306241203E+00 4.04935843849E+00 4.10644815216E+00 4.16434274282E+00 + 4.22305355798E+00 4.28259210516E+00 4.34297005411E+00 4.40419923909E+00 + 4.46629166122E+00 4.52925949081E+00 4.59311506976E+00 4.65787091397E+00 + 4.72353971579E+00 4.79013434652E+00 4.85766785892E+00 4.92615348976E+00 + 4.99560466246E+00 5.06603498967E+00 5.13745827595E+00 5.20988852050E+00 + 5.28333991988E+00 5.35782687080E+00 5.43336397294E+00 5.50996603181E+00 + 5.58764806166E+00 5.66642528842E+00 5.74631315268E+00 5.82732731271E+00 + 5.90948364755E+00 5.99279826010E+00 6.07728748030E+00 6.16296786830E+00 + 6.24985621773E+00 6.33796955899E+00 6.42732516257E+00 6.51794054245E+00 + 6.60983345956E+00 6.70302192518E+00 6.79752420455E+00 6.89335882043E+00 + 6.99054455671E+00 7.08910046210E+00 7.18904585388E+00 7.29040032166E+00 + 7.39318373124E+00 7.49741622849E+00 7.60311824334E+00 7.71031049370E+00 + 7.81901398959E+00 7.92925003727E+00 8.04104024333E+00 8.15440651902E+00 + 8.26937108450E+00 8.38595647318E+00 8.50418553618E+00 8.62408144676E+00 + 8.74566770492E+00 8.86896814195E+00 8.99400692513E+00 9.12080856245E+00 + 9.24939790746E+00 9.37980016406E+00 9.51204089153E+00 9.64614600946E+00 + 9.78214180289E+00 9.92005492742E+00 1.00599124145E+01 1.02017416766E+01 + 1.03455705127E+01 1.04914271138E+01 1.06393400682E+01 1.07893383672E+01 + 1.09414514112E+01 1.10957090146E+01 1.12521414126E+01 1.14107792662E+01 + 1.15716536692E+01 1.17347961533E+01 1.19002386950E+01 1.20680137216E+01 + 1.22381541175E+01 1.24106932308E+01 1.25856648798E+01 1.27631033593E+01 + 1.29430434479E+01 1.31255204145E+01 1.33105700251E+01 1.34982285501E+01 + 1.36885327710E+01 1.38815199882E+01 1.40772280278E+01 1.42756952491E+01 + 1.44769605524E+01 1.46810633863E+01 1.48880437556E+01 1.50979422292E+01 + 1.53107999477E+01 1.55266586321E+01 1.57455605913E+01 1.59675487308E+01 + 1.61926665609E+01 1.64209582055E+01 1.66524684105E+01 1.68872425526E+01 + 1.71253266483E+01 1.73667673629E+01 1.76116120194E+01 1.78599086083E+01 + 1.81117057965E+01 1.83670529370E+01 1.86260000786E+01 1.88885979759E+01 + 1.91548980989E+01 1.94249526432E+01 1.96988145404E+01 1.99765374684E+01 + 2.02581758616E+01 2.05437849221E+01 2.08334206303E+01 2.11271397556E+01 + 2.14249998679E+01 2.17270593488E+01 2.20333774029E+01 2.23440140695E+01 + 2.26590302344E+01 2.29784876417E+01 2.33024489062E+01 2.36309775253E+01 + 2.39641378916E+01 2.43019953057E+01 2.46446159886E+01 2.49920670952E+01 + 2.53444167269E+01 2.57017339455E+01 2.60640887861E+01 2.64315522717E+01 + 2.68041964260E+01 2.71820942887E+01 2.75653199289E+01 2.79539484601E+01 + 2.83480560546E+01 2.87477199589E+01 2.91530185083E+01 2.95640311427E+01 + 2.99808384218E+01 3.04035220412E+01 3.08321648483E+01 3.12668508584E+01 + 3.17076652714E+01 3.21546944882E+01 3.26080261281E+01 3.30677490456E+01 + 3.35339533477E+01 3.40067304120E+01 3.44861729043E+01 3.49723747970E+01 + 3.54654313870E+01 3.59654393152E+01 3.64724965846E+01 3.69867025801E+01 + 3.75081580877E+01 3.80369653143E+01 3.85732279079E+01 3.91170509777E+01 + 3.96685411147E+01 4.02278064128E+01 4.07949564897E+01 4.13701025087E+01 + 4.19533572002E+01 4.25448348840E+01 4.31446514916E+01 4.37529245891E+01 + 4.43697733999E+01 4.49953188282E+01 4.56296834832E+01 4.62729917021E+01 + 4.69253695756E+01 4.75869449717E+01 4.82578475614E+01 4.89382088437E+01 + 4.96281621716E+01 5.03278427782E+01 5.10373878031E+01 5.17569363194E+01 + 5.24866293608E+01 5.32266099497E+01 5.39770231245E+01 5.47380159687E+01 + 5.55097376392E+01 5.62923393960E+01 5.70859746315E+01 5.78907989008E+01 + 5.87069699520E+01 5.95346477573E+01 6.03739945441E+01 6.12251748271E+01 + 6.20883554404E+01 6.29637055702E+01 6.38513967878E+01 6.47516030835E+01 + 6.56645009008E+01 6.65902691705E+01 6.75290893461E+01 6.84811454394E+01 + 6.94466240564E+01 7.04257144341E+01 7.14186084773E+01 7.24255007963E+01 + 7.34465887454E+01 7.44820724610E+01 7.55321549012E+01 7.65970418857E+01 + 7.76769421355E+01 7.87720673147E+01 7.98826320712E+01 8.10088540793E+01 + 8.21509540822E+01 8.33091559351E+01 8.44836866493E+01 8.56747764365E+01 + 8.68826587541E+01 8.81075703510E+01 8.93497513138E+01 9.06094451139E+01 + 9.18868986552E+01 9.31823623229E+01 9.44960900319E+01 9.58283392771E+01 + 9.71793711835E+01 9.85494505578E+01 9.99388459399E+01 1.01347829656E+02 + 1.02776677871E+02 1.04225670643E+02 1.05695091981E+02 1.07185229896E+02 + 1.08696376458E+02 1.10228827858E+02 1.11782884462E+02 1.13358850868E+02 + 1.14957035973E+02 1.16577753024E+02 1.18221319688E+02 1.19888058110E+02 + 1.21578294974E+02 + + + 4.33781630917E-06 4.39897283428E-06 4.46099157216E-06 4.52388467866E-06 + 4.58766448105E-06 4.65234348036E-06 4.71793435388E-06 4.78444995765E-06 + 4.85190332892E-06 4.92030768877E-06 4.98967644469E-06 5.06002319316E-06 + 5.13136172238E-06 5.20370601492E-06 5.27707025050E-06 5.35146880874E-06 + 5.42691627200E-06 5.50342742822E-06 5.58101727384E-06 5.65970101671E-06 + 5.73949407910E-06 5.82041210070E-06 5.90247094171E-06 5.98568668592E-06 + 6.07007564388E-06 6.15565435610E-06 6.24243959628E-06 6.33044837460E-06 + 6.41969794107E-06 6.51020578889E-06 6.60198965789E-06 6.69506753799E-06 + 6.78945767277E-06 6.88517856298E-06 6.98224897023E-06 7.08068792064E-06 + 7.18051470854E-06 7.28174890032E-06 7.38441033819E-06 7.48851914413E-06 + 7.59409572379E-06 7.70116077053E-06 7.80973526943E-06 7.91984050145E-06 + 8.03149804756E-06 8.14472979300E-06 8.25955793155E-06 8.37600496990E-06 + 8.49409373203E-06 8.61384736373E-06 8.73528933709E-06 8.85844345513E-06 + 8.98333385644E-06 9.10998501994E-06 9.23842176968E-06 9.36866927965E-06 + 9.50075307880E-06 9.63469905597E-06 9.77053346499E-06 9.90828292986E-06 + 1.00479744499E-05 1.01896354051E-05 1.03332935614E-05 1.04789770764E-05 + 1.06267145045E-05 1.07765348025E-05 1.09284673360E-05 1.10825418840E-05 + 1.12387886456E-05 1.13972382459E-05 1.15579217413E-05 1.17208706264E-05 + 1.18861168396E-05 1.20536927698E-05 1.22236312624E-05 1.23959656258E-05 + 1.25707296382E-05 1.27479575539E-05 1.29276841100E-05 1.31099445336E-05 + 1.32947745483E-05 1.34822103813E-05 1.36722887708E-05 1.38650469726E-05 + 1.40605227680E-05 1.42587544709E-05 1.44597809354E-05 1.46636415631E-05 + 1.48703763116E-05 1.50800257014E-05 1.52926308246E-05 1.55082333523E-05 + 1.57268755434E-05 1.59486002525E-05 1.61734509383E-05 1.64014716723E-05 + 1.66327071472E-05 1.68672026859E-05 1.71050042504E-05 1.73461584505E-05 + 1.75907125531E-05 1.78387144917E-05 1.80902128755E-05 1.83452569989E-05 + 1.86038968514E-05 1.88661831273E-05 1.91321672354E-05 1.94019013096E-05 + 1.96754382186E-05 1.99528315764E-05 2.02341357531E-05 2.05194058851E-05 + 2.08086978865E-05 2.11020684592E-05 2.13995751049E-05 2.17012761358E-05 + 2.20072306863E-05 2.23174987245E-05 2.26321410638E-05 2.29512193753E-05 + 2.32747961993E-05 2.36029349578E-05 2.39356999671E-05 2.42731564503E-05 + 2.46153705498E-05 2.49624093407E-05 2.53143408438E-05 2.56712340388E-05 + 2.60331588778E-05 2.64001862993E-05 2.67723882418E-05 2.71498376581E-05 + 2.75326085295E-05 2.79207758803E-05 2.83144157926E-05 2.87136054210E-05 + 2.91184230080E-05 2.95289478991E-05 2.99452605586E-05 3.03674425850E-05 + 3.07955767273E-05 3.12297469013E-05 3.16700382057E-05 3.21165369389E-05 + 3.25693306162E-05 3.30285079865E-05 3.34941590502E-05 3.39663750762E-05 + 3.44452486205E-05 3.49308735438E-05 3.54233450302E-05 3.59227596055E-05 + 3.64292151568E-05 3.69428109508E-05 3.74636476541E-05 3.79918273522E-05 + 3.85274535702E-05 3.90706312923E-05 3.96214669833E-05 4.01800686086E-05 + 4.07465456561E-05 4.13210091569E-05 4.19035717078E-05 4.24943474929E-05 + 4.30934523061E-05 4.37010035740E-05 4.43171203784E-05 4.49419234804E-05 + 4.55755353432E-05 4.62180801568E-05 4.68696838621E-05 4.75304741755E-05 + 4.82005806140E-05 4.88801345206E-05 4.95692690900E-05 5.02681193949E-05 + 5.09768224121E-05 5.16955170497E-05 5.24243441741E-05 5.31634466379E-05 + 5.39129693073E-05 5.46730590913E-05 5.54438649700E-05 5.62255380237E-05 + 5.70182314628E-05 5.78221006578E-05 5.86373031697E-05 5.94639987807E-05 + 6.03023495258E-05 6.11525197245E-05 6.20146760128E-05 6.28889873761E-05 + 6.37756251824E-05 6.46747632153E-05 6.55865777088E-05 6.65112473816E-05 + 6.74489534717E-05 6.83998797727E-05 6.93642126690E-05 7.03421411732E-05 + 7.13338569621E-05 7.23395544154E-05 7.33594306530E-05 7.43936855738E-05 + 7.54425218952E-05 7.65061451923E-05 7.75847639389E-05 7.86785895475E-05 + 7.97878364116E-05 8.09127219470E-05 8.20534666350E-05 8.32102940651E-05 + 8.43834309792E-05 8.55731073160E-05 8.67795562557E-05 8.80030142663E-05 + 8.92437211494E-05 9.05019200875E-05 9.17778576917E-05 9.30717840499E-05 + 9.43839527756E-05 9.57146210583E-05 9.70640497131E-05 9.84325032324E-05 + 9.98202498374E-05 1.01227561531E-04 1.02654714151E-04 1.04101987423E-04 + 1.05569665018E-04 1.07058034605E-04 1.08567387910E-04 1.10098020771E-04 + 1.11650233196E-04 1.13224329424E-04 1.14820617983E-04 1.16439411751E-04 + 1.18081028017E-04 1.19745788542E-04 1.21434019624E-04 1.23146052164E-04 + 1.24882221724E-04 1.26642868599E-04 1.28428337882E-04 1.30238979530E-04 + 1.32075148435E-04 1.33937204492E-04 1.35825512670E-04 1.37740443083E-04 + 1.39682371064E-04 1.41651677237E-04 1.43648747592E-04 1.45673973561E-04 + 1.47727752096E-04 1.49810485743E-04 1.51922582725E-04 1.54064457019E-04 + 1.56236528440E-04 1.58439222721E-04 1.60672971597E-04 1.62938212890E-04 + 1.65235390594E-04 1.67564954963E-04 1.69927362600E-04 1.72323076544E-04 + 1.74752566363E-04 1.77216308244E-04 1.79714785089E-04 1.82248486608E-04 + 1.84817909413E-04 1.87423557120E-04 1.90065940444E-04 1.92745577301E-04 + 1.95462992908E-04 1.98218719887E-04 2.01013298370E-04 2.03847276104E-04 + 2.06721208555E-04 2.09635659026E-04 2.12591198757E-04 2.15588407043E-04 + 2.18627871348E-04 2.21710187415E-04 2.24835959388E-04 2.28005799929E-04 + 2.31220330337E-04 2.34480180670E-04 2.37785989869E-04 2.41138405884E-04 + 2.44538085798E-04 2.47985695959E-04 2.51481912111E-04 2.55027419523E-04 + 2.58622913125E-04 2.62269097646E-04 2.65966687750E-04 2.69716408176E-04 + 2.73518993882E-04 2.77375190186E-04 2.81285752916E-04 2.85251448553E-04 + 2.89273054388E-04 2.93351358667E-04 2.97487160752E-04 3.01681271272E-04 + 3.05934512288E-04 3.10247717447E-04 3.14621732152E-04 3.19057413724E-04 + 3.23555631571E-04 3.28117267357E-04 3.32743215178E-04 3.37434381734E-04 + 3.42191686509E-04 3.47016061951E-04 3.51908453651E-04 3.56869820535E-04 + 3.61901135046E-04 3.67003383338E-04 3.72177565469E-04 3.77424695593E-04 + 3.82745802166E-04 3.88141928142E-04 3.93614131178E-04 3.99163483844E-04 + 4.04791073831E-04 4.10498004164E-04 4.16285393420E-04 4.22154375946E-04 + 4.28106102081E-04 4.34141738383E-04 4.40262467855E-04 4.46469490180E-04 + 4.52764021954E-04 4.59147296927E-04 4.65620566239E-04 4.72185098673E-04 + 4.78842180898E-04 4.85593117724E-04 4.92439232355E-04 4.99381866652E-04 + 5.06422381393E-04 5.13562156543E-04 5.20802591519E-04 5.28145105471E-04 + 5.35591137554E-04 5.43142147215E-04 5.50799614475E-04 5.58565040223E-04 + 5.66439946507E-04 5.74425876834E-04 5.82524396472E-04 5.90737092756E-04 + 5.99065575402E-04 6.07511476818E-04 6.16076452428E-04 6.24762180996E-04 + 6.33570364951E-04 6.42502730726E-04 6.51561029093E-04 6.60747035508E-04 + 6.70062550456E-04 6.79509399810E-04 6.89089435182E-04 6.98804534289E-04 + 7.08656601321E-04 7.18647567317E-04 7.28779390536E-04 7.39054056848E-04 + 7.49473580122E-04 7.60040002617E-04 7.70755395385E-04 7.81621858679E-04 + 7.92641522359E-04 8.03816546315E-04 8.15149120887E-04 8.26641467297E-04 + 8.38295838080E-04 8.50114517532E-04 8.62099822150E-04 8.74254101094E-04 + 8.86579736640E-04 8.99079144652E-04 9.11754775056E-04 9.24609112314E-04 + 9.37644675918E-04 9.50864020880E-04 9.64269738235E-04 9.77864455545E-04 + 9.91650837419E-04 1.00563158603E-03 1.01980944165E-03 1.03418718319E-03 + 1.04876762873E-03 1.06355363608E-03 1.07854810335E-03 1.09375396949E-03 + 1.10917421492E-03 1.12481186205E-03 1.14066997590E-03 1.15675166472E-03 + 1.17306008056E-03 1.18959841994E-03 1.20636992442E-03 1.22337788126E-03 + 1.24062562409E-03 1.25811653351E-03 1.27585403779E-03 1.29384161356E-03 + 1.31208278642E-03 1.33058113171E-03 1.34934027516E-03 1.36836389362E-03 + 1.38765571579E-03 1.40721952292E-03 1.42705914958E-03 1.44717848440E-03 + 1.46758147084E-03 1.48827210795E-03 1.50925445115E-03 1.53053261306E-03 + 1.55211076426E-03 1.57399313413E-03 1.59618401170E-03 1.61868774645E-03 + 1.64150874918E-03 1.66465149288E-03 1.68812051360E-03 1.71192041134E-03 + 1.73605585096E-03 1.76053156309E-03 1.78535234505E-03 1.81052306177E-03 + 1.83604864682E-03 1.86193410327E-03 1.88818450478E-03 1.91480499648E-03 + 1.94180079610E-03 1.96917719489E-03 1.99693955872E-03 2.02509332909E-03 + 2.05364402424E-03 2.08259724019E-03 2.11195865186E-03 2.14173401419E-03 + 2.17192916325E-03 2.20255001738E-03 2.23360257836E-03 2.26509293259E-03 + 2.29702725229E-03 2.32941179669E-03 2.36225291326E-03 2.39555703896E-03 + 2.42933070151E-03 2.46358052065E-03 2.49831320946E-03 2.53353557566E-03 + 2.56925452294E-03 2.60547705234E-03 2.64221026358E-03 2.67946135648E-03 + 2.71723763239E-03 2.75554649558E-03 2.79439545470E-03 2.83379212428E-03 + 2.87374422618E-03 2.91425959116E-03 2.95534616034E-03 2.99701198683E-03 + 3.03926523726E-03 3.08211419341E-03 3.12556725381E-03 3.16963293540E-03 + 3.21431987519E-03 3.25963683197E-03 3.30559268800E-03 3.35219645077E-03 + 3.39945725479E-03 3.44738436331E-03 3.49598717020E-03 3.54527520177E-03 + 3.59525811863E-03 3.64594571759E-03 3.69734793358E-03 3.74947484160E-03 + 3.80233665869E-03 3.85594374595E-03 3.91030661052E-03 3.96543590770E-03 + 4.02134244302E-03 4.07803717433E-03 4.13553121399E-03 4.19383583099E-03 + 4.25296245325E-03 4.31292266977E-03 4.37372823293E-03 4.43539106083E-03 + 4.49792323958E-03 4.56133702568E-03 4.62564484844E-03 4.69085931240E-03 + 4.75699319980E-03 4.82405947310E-03 4.89207127750E-03 4.96104194353E-03 + 5.03098498966E-03 5.10191412496E-03 5.17384325176E-03 5.24678646840E-03 + 5.32075807198E-03 5.39577256118E-03 5.47184463908E-03 5.54898921604E-03 + 5.62722141265E-03 5.70655656267E-03 5.78701021605E-03 5.86859814196E-03 + 5.95133633189E-03 6.03524100280E-03 6.12032860026E-03 6.20661580172E-03 + 6.29411951975E-03 6.38285690535E-03 6.47284535134E-03 6.56410249574E-03 + 6.65664622525E-03 6.75049467872E-03 6.84566625076E-03 6.94217959531E-03 + 7.04005362927E-03 7.13930753629E-03 7.23996077044E-03 7.34203306008E-03 + 7.44554441170E-03 7.55051511386E-03 7.65696574116E-03 7.76491715826E-03 + 7.87439052397E-03 7.98540729544E-03 8.09798923230E-03 8.21215840098E-03 + 8.32793717899E-03 8.44534825935E-03 8.56441465501E-03 8.68515970335E-03 + 8.80760707081E-03 8.93178075744E-03 9.05770510170E-03 9.18540478515E-03 + 9.31490483735E-03 9.44623064071E-03 9.57940793552E-03 9.71446282496E-03 + 9.85142178020E-03 9.99031164566E-03 1.01311596442E-02 1.02739933824E-02 + 1.04188408563E-02 1.05657304563E-02 1.07146909732E-02 1.08657516040E-02 + 1.10189419568E-02 1.11742920575E-02 1.13318323553E-02 1.14915937284E-02 + 1.16536074907E-02 1.18179053974E-02 1.19845196514E-02 1.21534829096E-02 + 1.23248282894E-02 1.24985893749E-02 1.26748002240E-02 1.28534953745E-02 + 1.30347098513E-02 1.32184791729E-02 1.34048393588E-02 1.35938269360E-02 + 1.37854789469E-02 1.39798329558E-02 1.41769270567E-02 1.43767998807E-02 + 1.45794906035E-02 1.47850389531E-02 1.49934852177E-02 1.52048702533E-02 + 1.54192354923E-02 1.56366229507E-02 1.58570752373E-02 1.60806355614E-02 + 1.63073477416E-02 1.65372562141E-02 1.67704060418E-02 1.70068429228E-02 + 1.72466131994E-02 1.74897638674E-02 1.77363425852E-02 1.79863976828E-02 + 1.82399781720E-02 1.84971337553E-02 1.87579148360E-02 1.90223725281E-02 + 1.92905586661E-02 1.95625258154E-02 1.98383272823E-02 2.01180171249E-02 + 2.04016501633E-02 2.06892819904E-02 2.09809689830E-02 2.12767683127E-02 + 2.15767379571E-02 2.18809367112E-02 2.21894241990E-02 2.25022608849E-02 + 2.28195080860E-02 2.31412279838E-02 2.34674836363E-02 2.37983389907E-02 + 2.41338588958E-02 2.44741091144E-02 2.48191563368E-02 2.51690681933E-02 + 2.55239132678E-02 2.58837611109E-02 2.62486822541E-02 2.66187482231E-02 + 2.69940315519E-02 2.73746057973E-02 2.77605455531E-02 2.81519264647E-02 + 2.85488252440E-02 2.89513196845E-02 2.93594886762E-02 2.97734122218E-02 + 3.01931714515E-02 3.06188486394E-02 3.10505272197E-02 3.14882918027E-02 + 3.19322281917E-02 3.23824233997E-02 3.28389656663E-02 3.33019444754E-02 + 3.37714505721E-02 3.42475759813E-02 3.47304140250E-02 3.52200593411E-02 + 3.57166079015E-02 3.62201570314E-02 3.67308054281E-02 3.72486531802E-02 + 3.77738017876E-02 3.83063541810E-02 3.88464147425E-02 3.93940893257E-02 + 3.99494852765E-02 4.05127114542E-02 4.10838782532E-02 4.16630976238E-02 + 4.22504830948E-02 4.28461497959E-02 4.34502144795E-02 4.40627955442E-02 + 4.46840130579E-02 4.53139887812E-02 4.59528461913E-02 4.66007105065E-02 + 4.72577087101E-02 4.79239695758E-02 4.85996236931E-02 4.92848034921E-02 + 4.99796432705E-02 5.06842792189E-02 5.13988494483E-02 5.21234940167E-02 + 5.28583549568E-02 5.36035763037E-02 5.43593041232E-02 5.51256865403E-02 + 5.59028737685E-02 5.66910181388E-02 5.74902741302E-02 5.83007983994E-02 + 5.91227498117E-02 5.99562894723E-02 6.08015807575E-02 6.16587893472E-02 + 6.25280832570E-02 6.34096328713E-02 6.43036109767E-02 6.52101927956E-02 + 6.61295560211E-02 6.70618808513E-02 6.80073500248E-02 6.89661488567E-02 + 6.99384652745E-02 7.09244898554E-02 7.19244158633E-02 7.29384392871E-02 + 7.39667588784E-02 7.50095761912E-02 7.60670956212E-02 7.71395244453E-02 + 7.82270728633E-02 7.93299540379E-02 8.04483841375E-02 8.15825823779E-02 + 8.27327710657E-02 8.38991756414E-02 8.50820247242E-02 8.62815501562E-02 + 8.74979870482E-02 8.87315738258E-02 8.99825522759E-02 9.12511675944E-02 + 9.25376684338E-02 9.38423069525E-02 9.51653388637E-02 9.65070234861E-02 + 9.78676237940E-02 9.92474064694E-02 1.00646641954E-01 1.02065604503E-01 + 1.03504572237E-01 1.04963827199E-01 1.06443655407E-01 1.07944346912E-01 + 1.09466195854E-01 1.11009500522E-01 1.12574563407E-01 1.14161691266E-01 + 1.15771195183E-01 1.17403390625E-01 1.19058597506E-01 1.20737140255E-01 + 1.22439347869E-01 1.24165553987E-01 1.25916096952E-01 1.27691319874E-01 + 1.29491570704E-01 1.31317202297E-01 1.33168572481E-01 1.35046044132E-01 + 1.36949985240E-01 1.38880768984E-01 1.40838773803E-01 1.42824383472E-01 + 1.44837987178E-01 1.46879979593E-01 1.48950760954E-01 1.51050737141E-01 + 1.53180319757E-01 1.55339926205E-01 1.57529979776E-01 1.59750909727E-01 + 1.62003151369E-01 1.64287146146E-01 1.66603341730E-01 1.68952192102E-01 + 1.71334157645E-01 1.73749705232E-01 1.76199308317E-01 1.78683447030E-01 + 1.81202608271E-01 1.83757285803E-01 1.86347980352E-01 1.88975199701E-01 + 1.91639458794E-01 1.94341279835E-01 1.97081192389E-01 1.99859733487E-01 + 2.02677447733E-01 2.05534887408E-01 2.08432612578E-01 2.11371191208E-01 + 2.14351199268E-01 2.17373220850E-01 2.20437848278E-01 2.23545682231E-01 + 2.26697331852E-01 2.29893414877E-01 2.33134557747E-01 2.36421395736E-01 + 2.39754573076E-01 2.43134743080E-01 2.46562568272E-01 2.50038720517E-01 + 2.53563881151E-01 2.57138741117E-01 2.60764001101E-01 2.64440371663E-01 + 2.68168573384E-01 2.71949337005E-01 2.75783403566E-01 2.79671524557E-01 + 2.83614462062E-01 2.87612988910E-01 2.91667888824E-01 2.95779956579E-01 + 2.99949998151E-01 3.04178830884E-01 3.08467283641E-01 3.12816196973E-01 + 3.17226423282E-01 3.21698826984E-01 3.26234284687E-01 3.30833685354E-01 + 3.35497930483E-01 3.40227934279E-01 3.45024623841E-01 3.49888939333E-01 + 3.54821834177E-01 3.59824275236E-01 3.64897243006E-01 3.70041731803E-01 + 3.75258749965E-01 3.80549320042E-01 3.85914479005E-01 3.91355278441E-01 + 3.96872784764E-01 4.02468079424E-01 4.08142259116E-01 4.13896435997E-01 + 4.19731737905E-01 4.25649308577E-01 4.31650307876E-01 4.37735912018E-01 + 4.43907313799E-01 4.50165722835E-01 4.56512365794E-01 4.62948486638E-01 + 4.69475346868E-01 4.76094225768E-01 4.82806420661E-01 4.89613247158E-01 + 4.96516039419E-01 5.03516150413E-01 5.10614952184E-01 5.17813836121E-01 + 5.25114213227E-01 5.32517514400E-01 5.40025190711E-01 5.47638713688E-01 + 5.55359575606E-01 5.63189289779E-01 5.71129390856E-01 5.79181435121E-01 + 5.87347000802E-01 5.95627688376E-01 6.04025120883E-01 6.12540944247E-01 + 6.21176827598E-01 6.29934463595E-01 6.38815568764E-01 6.47821883830E-01 + 6.56955174058E-01 6.66217229604E-01 6.75609865860E-01 6.85134923812E-01 + 6.94794270403E-01 7.04589798895E-01 7.14523429243E-01 7.24597108471E-01 + 7.34812811052E-01 7.45172539296E-01 7.55678323743E-01 7.66332223561E-01 + 7.77136326948E-01 7.88092751543E-01 7.99203644841E-01 8.10471184611E-01 + 8.21897579328E-01 8.33485068602E-01 8.45235923617E-01 8.57152447580E-01 + 8.69236976166E-01 8.81491877982E-01 8.93919555029E-01 9.06522443170E-01 + 9.19303012611E-01 9.32263768387E-01 9.45407250845E-01 9.58736036151E-01 + 9.72252736790E-01 9.85960002077E-01 9.99860518682E-01 1.01395701115E+00 + 1.02825224244E+00 1.04274901445E+00 1.05745016862E+00 1.07235858640E+00 + 1.08747718990E+00 1.10280894241E+00 1.11835684900E+00 1.13412395711E+00 + 1.15011335715E+00 1.16632818309E+00 1.18277161309E+00 1.19944687011E+00 + 1.21635722256E+00 1.23350598491E+00 1.25089651839E+00 1.26853223159E+00 + 1.28641658117E+00 1.30455307252E+00 1.32294526045E+00 1.34159674988E+00 + 1.36051119657E+00 1.37969230781E+00 1.39914384316E+00 1.41886961518E+00 + 1.43887349019E+00 1.45915938901E+00 1.47973128774E+00 1.50059321854E+00 + 1.52174927041E+00 1.54320359002E+00 1.56496038247E+00 1.58702391216E+00 + 1.60939850362E+00 1.63208854234E+00 1.65509847564E+00 1.67843281353E+00 + 1.70209612964E+00 + + + + + + -3.03300020000E+01 -3.03300020000E+01 -3.03300020000E+01 -3.03300020000E+01 + -3.03300020000E+01 -3.03300020000E+01 -3.03300020000E+01 -3.03300020000E+01 + -3.03300020000E+01 -3.03300020000E+01 -3.03300020000E+01 -3.03300020000E+01 + -3.03300020000E+01 -3.03300020000E+01 -3.03300020000E+01 -3.03300020000E+01 + -3.03300020000E+01 -3.03300020000E+01 -3.03300020000E+01 -3.03300020000E+01 + -3.03300010000E+01 -3.03300010000E+01 -3.03300010000E+01 -3.03300010000E+01 + -3.03300010000E+01 -3.03300010000E+01 -3.03300010000E+01 -3.03300010000E+01 + -3.03300010000E+01 -3.03300010000E+01 -3.03300010000E+01 -3.03300010000E+01 + -3.03300010000E+01 -3.03300010000E+01 -3.03300010000E+01 -3.03300010000E+01 + -3.03300010000E+01 -3.03300010000E+01 -3.03300000000E+01 -3.03300000000E+01 + -3.03300000000E+01 -3.03300000000E+01 -3.03300000000E+01 -3.03300000000E+01 + -3.03300000000E+01 -3.03300000000E+01 -3.03300000000E+01 -3.03300000000E+01 + -3.03300000000E+01 -3.03299990000E+01 -3.03299990000E+01 -3.03299990000E+01 + -3.03299990000E+01 -3.03299990000E+01 -3.03299990000E+01 -3.03299990000E+01 + -3.03299990000E+01 -3.03299990000E+01 -3.03299980000E+01 -3.03299980000E+01 + -3.03299980000E+01 -3.03299980000E+01 -3.03299980000E+01 -3.03299980000E+01 + -3.03299980000E+01 -3.03299970000E+01 -3.03299970000E+01 -3.03299970000E+01 + -3.03299970000E+01 -3.03299970000E+01 -3.03299970000E+01 -3.03299960000E+01 + -3.03299960000E+01 -3.03299960000E+01 -3.03299960000E+01 -3.03299960000E+01 + -3.03299950000E+01 -3.03299950000E+01 -3.03299950000E+01 -3.03299950000E+01 + -3.03299940000E+01 -3.03299940000E+01 -3.03299940000E+01 -3.03299940000E+01 + -3.03299930000E+01 -3.03299930000E+01 -3.03299930000E+01 -3.03299930000E+01 + -3.03299920000E+01 -3.03299920000E+01 -3.03299920000E+01 -3.03299910000E+01 + -3.03299910000E+01 -3.03299910000E+01 -3.03299900000E+01 -3.03299900000E+01 + -3.03299900000E+01 -3.03299890000E+01 -3.03299890000E+01 -3.03299880000E+01 + -3.03299880000E+01 -3.03299870000E+01 -3.03299870000E+01 -3.03299870000E+01 + -3.03299860000E+01 -3.03299860000E+01 -3.03299850000E+01 -3.03299850000E+01 + -3.03299840000E+01 -3.03299840000E+01 -3.03299830000E+01 -3.03299820000E+01 + -3.03299820000E+01 -3.03299810000E+01 -3.03299810000E+01 -3.03299800000E+01 + -3.03299790000E+01 -3.03299790000E+01 -3.03299780000E+01 -3.03299770000E+01 + -3.03299760000E+01 -3.03299760000E+01 -3.03299750000E+01 -3.03299740000E+01 + -3.03299730000E+01 -3.03299720000E+01 -3.03299720000E+01 -3.03299710000E+01 + -3.03299700000E+01 -3.03299690000E+01 -3.03299680000E+01 -3.03299670000E+01 + -3.03299660000E+01 -3.03299650000E+01 -3.03299640000E+01 -3.03299630000E+01 + -3.03299610000E+01 -3.03299600000E+01 -3.03299590000E+01 -3.03299580000E+01 + -3.03299570000E+01 -3.03299550000E+01 -3.03299540000E+01 -3.03299520000E+01 + -3.03299510000E+01 -3.03299500000E+01 -3.03299480000E+01 -3.03299460000E+01 + -3.03299450000E+01 -3.03299430000E+01 -3.03299410000E+01 -3.03299400000E+01 + -3.03299380000E+01 -3.03299360000E+01 -3.03299340000E+01 -3.03299320000E+01 + -3.03299300000E+01 -3.03299280000E+01 -3.03299260000E+01 -3.03299240000E+01 + -3.03299220000E+01 -3.03299190000E+01 -3.03299170000E+01 -3.03299140000E+01 + -3.03299120000E+01 -3.03299090000E+01 -3.03299070000E+01 -3.03299040000E+01 + -3.03299010000E+01 -3.03298980000E+01 -3.03298950000E+01 -3.03298920000E+01 + -3.03298890000E+01 -3.03298860000E+01 -3.03298820000E+01 -3.03298790000E+01 + -3.03298750000E+01 -3.03298720000E+01 -3.03298680000E+01 -3.03298640000E+01 + -3.03298600000E+01 -3.03298560000E+01 -3.03298520000E+01 -3.03298480000E+01 + -3.03298430000E+01 -3.03298390000E+01 -3.03298340000E+01 -3.03298290000E+01 + -3.03298240000E+01 -3.03298190000E+01 -3.03298140000E+01 -3.03298090000E+01 + -3.03298030000E+01 -3.03297980000E+01 -3.03297920000E+01 -3.03297860000E+01 + -3.03297800000E+01 -3.03297730000E+01 -3.03297670000E+01 -3.03297600000E+01 + -3.03297530000E+01 -3.03297460000E+01 -3.03297390000E+01 -3.03297310000E+01 + -3.03297230000E+01 -3.03297160000E+01 -3.03297070000E+01 -3.03296990000E+01 + -3.03296900000E+01 -3.03296810000E+01 -3.03296720000E+01 -3.03296630000E+01 + -3.03296530000E+01 -3.03296430000E+01 -3.03296330000E+01 -3.03296230000E+01 + -3.03296120000E+01 -3.03296010000E+01 -3.03295890000E+01 -3.03295770000E+01 + -3.03295650000E+01 -3.03295530000E+01 -3.03295400000E+01 -3.03295270000E+01 + -3.03295130000E+01 -3.03295000000E+01 -3.03294850000E+01 -3.03294710000E+01 + -3.03294550000E+01 -3.03294400000E+01 -3.03294240000E+01 -3.03294070000E+01 + -3.03293910000E+01 -3.03293730000E+01 -3.03293550000E+01 -3.03293370000E+01 + -3.03293180000E+01 -3.03292990000E+01 -3.03292790000E+01 -3.03292580000E+01 + -3.03292370000E+01 -3.03292150000E+01 -3.03291930000E+01 -3.03291700000E+01 + -3.03291460000E+01 -3.03291220000E+01 -3.03290970000E+01 -3.03290710000E+01 + -3.03290440000E+01 -3.03290170000E+01 -3.03289890000E+01 -3.03289600000E+01 + -3.03289310000E+01 -3.03289000000E+01 -3.03288690000E+01 -3.03288370000E+01 + -3.03288040000E+01 -3.03287700000E+01 -3.03287350000E+01 -3.03286980000E+01 + -3.03286610000E+01 -3.03286230000E+01 -3.03285840000E+01 -3.03285440000E+01 + -3.03285020000E+01 -3.03284600000E+01 -3.03284160000E+01 -3.03283710000E+01 + -3.03283250000E+01 -3.03282770000E+01 -3.03282280000E+01 -3.03281770000E+01 + -3.03281260000E+01 -3.03280720000E+01 -3.03280170000E+01 -3.03279610000E+01 + -3.03279030000E+01 -3.03278430000E+01 -3.03277820000E+01 -3.03277190000E+01 + -3.03276540000E+01 -3.03275870000E+01 -3.03275190000E+01 -3.03274480000E+01 + -3.03273760000E+01 -3.03273010000E+01 -3.03272240000E+01 -3.03271450000E+01 + -3.03270640000E+01 -3.03269810000E+01 -3.03268950000E+01 -3.03268070000E+01 + -3.03267160000E+01 -3.03266220000E+01 -3.03265260000E+01 -3.03264280000E+01 + -3.03263260000E+01 -3.03262220000E+01 -3.03261140000E+01 -3.03260040000E+01 + -3.03258900000E+01 -3.03257730000E+01 -3.03256530000E+01 -3.03255300000E+01 + -3.03254030000E+01 -3.03252720000E+01 -3.03251380000E+01 -3.03249990000E+01 + -3.03248570000E+01 -3.03247110000E+01 -3.03245610000E+01 -3.03244060000E+01 + -3.03242470000E+01 -3.03240840000E+01 -3.03239150000E+01 -3.03237420000E+01 + -3.03235650000E+01 -3.03233820000E+01 -3.03231930000E+01 -3.03230000000E+01 + -3.03228010000E+01 -3.03225960000E+01 -3.03223860000E+01 -3.03221700000E+01 + -3.03219470000E+01 -3.03217180000E+01 -3.03214830000E+01 -3.03212400000E+01 + -3.03209910000E+01 -3.03207350000E+01 -3.03204720000E+01 -3.03202010000E+01 + -3.03199230000E+01 -3.03196360000E+01 -3.03193410000E+01 -3.03190380000E+01 + -3.03187270000E+01 -3.03184060000E+01 -3.03180770000E+01 -3.03177380000E+01 + -3.03173890000E+01 -3.03170300000E+01 -3.03166610000E+01 -3.03162820000E+01 + -3.03158920000E+01 -3.03154910000E+01 -3.03150780000E+01 -3.03146540000E+01 + -3.03142170000E+01 -3.03137680000E+01 -3.03133070000E+01 -3.03128320000E+01 + -3.03123430000E+01 -3.03118410000E+01 -3.03113240000E+01 -3.03107930000E+01 + -3.03102460000E+01 -3.03096840000E+01 -3.03091060000E+01 -3.03085110000E+01 + -3.03079000000E+01 -3.03072710000E+01 -3.03066230000E+01 -3.03059580000E+01 + -3.03052730000E+01 -3.03045690000E+01 -3.03038450000E+01 -3.03031000000E+01 + -3.03023340000E+01 -3.03015460000E+01 -3.03007350000E+01 -3.02999010000E+01 + -3.02990430000E+01 -3.02981610000E+01 -3.02972530000E+01 -3.02963200000E+01 + -3.02953590000E+01 -3.02943710000E+01 -3.02933550000E+01 -3.02923100000E+01 + -3.02912340000E+01 -3.02901280000E+01 -3.02889900000E+01 -3.02878190000E+01 + -3.02866140000E+01 -3.02853750000E+01 -3.02841000000E+01 -3.02827880000E+01 + -3.02814390000E+01 -3.02800500000E+01 -3.02786210000E+01 -3.02771520000E+01 + -3.02756390000E+01 -3.02740830000E+01 -3.02724820000E+01 -3.02708340000E+01 + -3.02691380000E+01 -3.02673940000E+01 -3.02655980000E+01 -3.02637510000E+01 + -3.02618490000E+01 -3.02598920000E+01 -3.02578780000E+01 -3.02558050000E+01 + -3.02536710000E+01 -3.02514750000E+01 -3.02492140000E+01 -3.02468870000E+01 + -3.02444910000E+01 -3.02420250000E+01 -3.02394860000E+01 -3.02368720000E+01 + -3.02341810000E+01 -3.02314090000E+01 -3.02285560000E+01 -3.02256170000E+01 + -3.02225910000E+01 -3.02194740000E+01 -3.02162640000E+01 -3.02129570000E+01 + -3.02095510000E+01 -3.02060420000E+01 -3.02024270000E+01 -3.01987030000E+01 + -3.01948650000E+01 -3.01909100000E+01 -3.01868350000E+01 -3.01826340000E+01 + -3.01783050000E+01 -3.01738420000E+01 -3.01692410000E+01 -3.01644970000E+01 + -3.01596060000E+01 -3.01545620000E+01 -3.01493590000E+01 -3.01439930000E+01 + -3.01384580000E+01 -3.01327470000E+01 -3.01268540000E+01 -3.01207730000E+01 + -3.01144970000E+01 -3.01080190000E+01 -3.01013310000E+01 -3.00944250000E+01 + -3.00872940000E+01 -3.00799300000E+01 -3.00723220000E+01 -3.00644630000E+01 + -3.00563420000E+01 -3.00479490000E+01 -3.00392740000E+01 -3.00303070000E+01 + -3.00210350000E+01 -3.00114460000E+01 -3.00015280000E+01 -2.99912690000E+01 + -2.99806530000E+01 -2.99696670000E+01 -2.99582960000E+01 -2.99465240000E+01 + -2.99343340000E+01 -2.99217100000E+01 -2.99086320000E+01 -2.98950840000E+01 + -2.98810440000E+01 -2.98664910000E+01 -2.98514060000E+01 -2.98357630000E+01 + -2.98195410000E+01 -2.98027130000E+01 -2.97852550000E+01 -2.97671380000E+01 + -2.97483340000E+01 -2.97288130000E+01 -2.97085440000E+01 -2.96874950000E+01 + -2.96656310000E+01 -2.96429160000E+01 -2.96193130000E+01 -2.95947830000E+01 + -2.95692840000E+01 -2.95427740000E+01 -2.95152080000E+01 -2.94865400000E+01 + -2.94567210000E+01 -2.94256990000E+01 -2.93934220000E+01 -2.93598330000E+01 + -2.93248750000E+01 -2.92884880000E+01 -2.92506080000E+01 -2.92111700000E+01 + -2.91701070000E+01 -2.91273450000E+01 -2.90828130000E+01 -2.90364310000E+01 + -2.89881210000E+01 -2.89378000000E+01 -2.88853810000E+01 -2.88307750000E+01 + -2.87738900000E+01 -2.87146300000E+01 -2.86528950000E+01 -2.85885820000E+01 + -2.85215860000E+01 -2.84517960000E+01 -2.83791010000E+01 -2.83033840000E+01 + -2.82245250000E+01 -2.81424020000E+01 -2.80568880000E+01 -2.79678550000E+01 + -2.78751690000E+01 -2.77786950000E+01 -2.76782970000E+01 -2.75738320000E+01 + -2.74651590000E+01 -2.73521320000E+01 -2.72346040000E+01 -2.71124280000E+01 + -2.69854550000E+01 -2.68535330000E+01 -2.67165140000E+01 -2.65742480000E+01 + -2.64265840000E+01 -2.62733760000E+01 -2.61144770000E+01 -2.59497460000E+01 + -2.57790430000E+01 -2.56022350000E+01 -2.54191920000E+01 -2.52297900000E+01 + -2.50339160000E+01 -2.48314610000E+01 -2.46223230000E+01 -2.44064220000E+01 + -2.41836820000E+01 -2.39540420000E+01 -2.37174580000E+01 -2.34738990000E+01 + -2.32233520000E+01 -2.29658270000E+01 -2.27013430000E+01 -2.24299570000E+01 + -2.21517460000E+01 -2.18668130000E+01 -2.15752840000E+01 -2.12773160000E+01 + -2.09730970000E+01 -2.06628450000E+01 -2.03468060000E+01 -2.00252610000E+01 + -1.96985460000E+01 -1.93670170000E+01 -1.90310690000E+01 -1.86911360000E+01 + -1.83476870000E+01 -1.80012310000E+01 -1.76523140000E+01 -1.73014990000E+01 + -1.69494300000E+01 -1.65967620000E+01 -1.62441850000E+01 -1.58924190000E+01 + -1.55422110000E+01 -1.51943360000E+01 -1.48495920000E+01 -1.45087830000E+01 + -1.41727460000E+01 -1.38423310000E+01 -1.35183810000E+01 -1.32017350000E+01 + -1.28932250000E+01 -1.25936660000E+01 -1.23038500000E+01 -1.20245360000E+01 + -1.17564420000E+01 -1.15002390000E+01 -1.12565330000E+01 -1.10258510000E+01 + -1.08086410000E+01 -1.06052480000E+01 -1.04159070000E+01 -1.02407270000E+01 + -1.00797070000E+01 -9.93263010000E+00 -9.79913280000E+00 -9.67858710000E+00 + -9.57027020000E+00 -9.47324580000E+00 -9.38630430000E+00 -9.30801740000E+00 + -9.23677610000E+00 -9.17069910000E+00 -9.10767730000E+00 -9.04550660000E+00 + -8.98190590000E+00 -8.91461020000E+00 -8.84149900000E+00 -8.76076660000E+00 + -8.67113700000E+00 -8.57207960000E+00 -8.46431740000E+00 -8.35032210000E+00 + -8.23463490000E+00 -8.12015220000E+00 -8.00726070000E+00 -7.89593840000E+00 + -7.78616360000E+00 -7.67791890000E+00 -7.57117890000E+00 -7.46592190000E+00 + -7.36212740000E+00 -7.25977530000E+00 -7.15884560000E+00 -7.05931870000E+00 + -6.96117530000E+00 -6.86439830000E+00 -6.76896840000E+00 -6.67486430000E+00 + -6.58206770000E+00 -6.49056060000E+00 -6.40032510000E+00 -6.31134380000E+00 + -6.22359930000E+00 -6.13707500000E+00 -6.05175680000E+00 -5.96762380000E+00 + -5.88465980000E+00 -5.80284850000E+00 -5.72217420000E+00 -5.64262100000E+00 + -5.56417360000E+00 -5.48681670000E+00 -5.41053780000E+00 -5.33531950000E+00 + -5.26114620000E+00 -5.18800350000E+00 -5.11587710000E+00 -5.04475320000E+00 + -4.97461780000E+00 -4.90545730000E+00 -4.83725960000E+00 -4.77001140000E+00 + -4.70369740000E+00 -4.63830470000E+00 -4.57382070000E+00 -4.51023290000E+00 + -4.44752880000E+00 -4.38569630000E+00 -4.32472360000E+00 -4.26460090000E+00 + -4.20531340000E+00 -4.14684960000E+00 -4.08919820000E+00 -4.03234800000E+00 + -3.97628780000E+00 -3.92100690000E+00 -3.86649440000E+00 -3.81274150000E+00 + -3.75973610000E+00 -3.70746700000E+00 -3.65592420000E+00 -3.60509770000E+00 + -3.55497750000E+00 -3.50555390000E+00 -3.45681740000E+00 -3.40875920000E+00 + -3.36137020000E+00 -3.31463950000E+00 -3.26855810000E+00 -3.22311700000E+00 + -3.17830740000E+00 -3.13412060000E+00 -3.09054800000E+00 -3.04758120000E+00 + -3.00521340000E+00 -2.96343430000E+00 -2.92223560000E+00 -2.88160930000E+00 + -2.84154760000E+00 -2.80204270000E+00 -2.76308690000E+00 -2.72467260000E+00 + -2.68679350000E+00 -2.64944120000E+00 -2.61260790000E+00 -2.57628630000E+00 + -2.54046940000E+00 -2.50515030000E+00 -2.47032210000E+00 -2.43597800000E+00 + -2.40211200000E+00 -2.36871750000E+00 -2.33578700000E+00 -2.30331400000E+00 + -2.27129220000E+00 -2.23971540000E+00 -2.20857750000E+00 -2.17787230000E+00 + -2.14759410000E+00 -2.11773810000E+00 -2.08829680000E+00 -2.05926460000E+00 + -2.03063580000E+00 -2.00240480000E+00 -1.97456610000E+00 -1.94711440000E+00 + -1.92004430000E+00 -1.89335140000E+00 -1.86702970000E+00 -1.84107360000E+00 + -1.81547830000E+00 -1.79023850000E+00 -1.76534960000E+00 -1.74080660000E+00 + -1.71660470000E+00 -1.69273970000E+00 -1.66920700000E+00 -1.64600130000E+00 + -1.62311790000E+00 -1.60055250000E+00 -1.57830080000E+00 -1.55635820000E+00 + -1.53472070000E+00 -1.51338400000E+00 -1.49234480000E+00 -1.47159790000E+00 + -1.45113920000E+00 -1.43096480000E+00 -1.41107080000E+00 -1.39145320000E+00 + -1.37210830000E+00 -1.35303240000E+00 -1.33422220000E+00 -1.31567360000E+00 + -1.29738270000E+00 -1.27934590000E+00 -1.26155980000E+00 -1.24402080000E+00 + -1.22672570000E+00 -1.20967090000E+00 -1.19285350000E+00 -1.17627030000E+00 + -1.15991750000E+00 -1.14379190000E+00 -1.12789030000E+00 -1.11220970000E+00 + -1.09674710000E+00 -1.08149940000E+00 -1.06646370000E+00 -1.05163760000E+00 + -1.03701750000E+00 -1.02260050000E+00 -1.00838390000E+00 -9.94364780000E-01 + -9.80540520000E-01 -9.66908410000E-01 -9.53465790000E-01 -9.40210460000E-01 + -9.27139490000E-01 -9.14250110000E-01 -9.01539820000E-01 -8.89006150000E-01 + -8.76646670000E-01 -8.64458970000E-01 -8.52440680000E-01 -8.40589660000E-01 + -8.28903670000E-01 -8.17380030000E-01 -8.06016500000E-01 -7.94810870000E-01 + -7.83760960000E-01 -7.72864630000E-01 -7.62119750000E-01 -7.51524250000E-01 + -7.41076500000E-01 -7.30773890000E-01 -7.20614410000E-01 -7.10596110000E-01 + -7.00717020000E-01 -6.90975230000E-01 -6.81368840000E-01 -6.71895990000E-01 + -6.62555110000E-01 -6.53344150000E-01 -6.44261160000E-01 -6.35304370000E-01 + -6.26472050000E-01 -6.17762470000E-01 -6.09173940000E-01 -6.00704790000E-01 + -5.92353520000E-01 -5.84118540000E-01 -5.75997970000E-01 -5.67990230000E-01 + -5.60093750000E-01 -5.52307010000E-01 -5.44628500000E-01 -5.37056710000E-01 + -5.29590190000E-01 -5.22227780000E-01 -5.14967650000E-01 -5.07808390000E-01 + -5.00748610000E-01 -4.93786940000E-01 -4.86922010000E-01 -4.80152510000E-01 + -4.73477100000E-01 -4.66894700000E-01 -4.60403840000E-01 -4.54002850000E-01 + -4.47691090000E-01 -4.41467090000E-01 -4.35329610000E-01 -4.29277460000E-01 + -4.23309450000E-01 -4.17424410000E-01 -4.11621180000E-01 -4.05898640000E-01 + -4.00255650000E-01 -3.94691110000E-01 -3.89203940000E-01 -3.83793050000E-01 + -3.78457380000E-01 -3.73195900000E-01 -3.68007560000E-01 -3.62891350000E-01 + -3.57846270000E-01 -3.52871320000E-01 -3.47965550000E-01 -3.43127970000E-01 + -3.38357650000E-01 -3.33653650000E-01 -3.29015040000E-01 -3.24440930000E-01 + -3.19930400000E-01 -3.15482580000E-01 -3.11096600000E-01 -3.06771590000E-01 + -3.02506710000E-01 -2.98301130000E-01 -2.94154010000E-01 -2.90064550000E-01 + -2.86031940000E-01 -2.82055390000E-01 -2.78134130000E-01 -2.74267380000E-01 + -2.70454390000E-01 -2.66694410000E-01 -2.62986700000E-01 -2.59330540000E-01 + -2.55725210000E-01 -2.52170000000E-01 -2.48664220000E-01 -2.45207180000E-01 + -2.41798190000E-01 -2.38436610000E-01 -2.35121750000E-01 -2.31852980000E-01 + -2.28629660000E-01 -2.25451140000E-01 -2.22316820000E-01 -2.19226070000E-01 + -2.16178290000E-01 -2.13172880000E-01 -2.10209250000E-01 -2.07286830000E-01 + -2.04405030000E-01 -2.01563300000E-01 -1.98761070000E-01 -1.95997810000E-01 + -1.93272960000E-01 -1.90585990000E-01 -1.87936370000E-01 -1.85323600000E-01 + -1.82747140000E-01 -1.80206510000E-01 -1.77701200000E-01 -1.75230710000E-01 + -1.72794580000E-01 -1.70392310000E-01 -1.68023440000E-01 -1.65687500000E-01 + -1.63384030000E-01 -1.61112600000E-01 -1.58872730000E-01 -1.56664010000E-01 + -1.54486000000E-01 -1.52338260000E-01 -1.50220390000E-01 -1.48131960000E-01 + -1.46072560000E-01 -1.44041790000E-01 -1.42039260000E-01 -1.40064560000E-01 + -1.38117320000E-01 -1.36197150000E-01 -1.34303680000E-01 -1.32436520000E-01 + -1.30595330000E-01 -1.28779740000E-01 -1.26989380000E-01 -1.25223920000E-01 + -1.23483000000E-01 -1.21766280000E-01 -1.20073430000E-01 -1.18404110000E-01 + -1.16758010000E-01 -1.15134780000E-01 -1.13534130000E-01 -1.11955720000E-01 + -1.10399260000E-01 -1.08864440000E-01 -1.07350960000E-01 -1.05858520000E-01 + -1.04386830000E-01 -1.02935590000E-01 -1.01504530000E-01 -1.00093370000E-01 + -9.87018280000E-02 + + + + + + 1 0 Beta L + 743 + 6.98359985901E-03 7.08205790622E-03 7.18190401282E-03 7.28315772892E-03 + 7.38583905239E-03 7.48996798107E-03 7.59556496050E-03 7.70265073474E-03 + 7.81124619704E-03 7.92137268839E-03 8.03305184825E-03 8.14630546532E-03 + 8.26115577601E-03 8.37762531520E-03 8.49573691625E-03 8.61551371100E-03 + 8.73697927900E-03 8.86015719979E-03 8.98507225195E-03 9.11174801327E-03 + 9.24020893327E-03 9.37048161195E-03 9.50259095838E-03 9.63656279069E-03 + 9.77242352393E-03 9.91019957317E-03 1.00499180997E-02 1.01916064139E-02 + 1.03352922741E-02 1.04810040354E-02 1.06287700529E-02 1.07786192788E-02 + 1.09305811129E-02 1.10846854026E-02 1.12409624433E-02 1.13994426795E-02 + 1.15601579271E-02 1.17231382862E-02 1.18884156610E-02 1.20560240180E-02 + 1.22259952548E-02 1.23983629497E-02 1.25731606812E-02 1.27504229233E-02 + 1.29301841499E-02 1.31124797302E-02 1.32973454813E-02 1.34848175188E-02 + 1.36749334713E-02 1.38677280487E-02 1.40632414584E-02 1.42615114368E-02 + 1.44625767856E-02 1.46664767544E-02 1.48732513387E-02 1.50829418775E-02 + 1.52955876202E-02 1.55112325867E-02 1.57299154454E-02 1.59516840857E-02 + 1.61765777623E-02 1.64046427391E-02 1.66359222948E-02 1.68704626931E-02 + 1.71083113442E-02 1.73495110725E-02 1.75941130732E-02 1.78421624637E-02 + 1.80937084923E-02 1.83488018998E-02 1.86074931815E-02 1.88698293377E-02 + 1.91358648497E-02 1.94056507039E-02 1.96792391334E-02 1.99566881857E-02 + 2.02380445901E-02 2.05233705607E-02 2.08127169937E-02 2.11061450763E-02 + 2.14037085343E-02 2.17054670626E-02 2.20114818487E-02 2.23218096028E-02 + 2.26365115125E-02 2.29556517499E-02 2.32792900101E-02 2.36074935395E-02 + 2.39403217646E-02 2.42778421110E-02 2.46201231384E-02 2.49672275266E-02 + 2.53192269098E-02 2.56761884449E-02 2.60381837658E-02 2.64052815220E-02 + 2.67775566343E-02 2.71550768460E-02 2.75379206667E-02 2.79261624132E-02 + 2.83198781967E-02 2.87191441283E-02 2.91240393042E-02 2.95346447992E-02 + 2.99510352645E-02 3.03732972257E-02 3.08015137691E-02 3.12357669755E-02 + 3.16761419102E-02 3.21227287760E-02 3.25756061810E-02 3.30348716175E-02 + 3.35006124756E-02 3.39729182980E-02 3.44518831042E-02 3.49376009142E-02 + 3.54301657475E-02 3.59296761011E-02 3.64362274870E-02 3.69499213868E-02 + 3.74708577898E-02 3.79991366851E-02 3.85348655240E-02 3.90781457879E-02 + 3.96290864204E-02 4.01877948726E-02 4.07543785956E-02 4.13289510099E-02 + 4.19116240440E-02 4.25025126106E-02 4.31017301305E-02 4.37093959938E-02 + 4.43256295906E-02 4.49505503109E-02 4.55842820221E-02 4.62269485915E-02 + 4.68786753785E-02 4.75395892353E-02 4.82098229833E-02 4.88895049670E-02 + 4.95787713299E-02 5.02777494043E-02 5.09865864553E-02 5.17054149669E-02 + 5.24343796997E-02 5.31736230078E-02 5.39232819472E-02 5.46835149525E-02 + 5.54544632210E-02 5.62362819599E-02 5.70291233917E-02 5.78331427234E-02 + 5.86484966547E-02 5.94753448698E-02 6.03138515301E-02 6.11641793046E-02 + 6.20264938472E-02 6.29009667812E-02 6.37877682374E-02 6.46870728239E-02 + 6.55990580520E-02 6.65238942972E-02 6.74617708468E-02 6.84128713445E-02 + 6.93773808450E-02 7.03554873879E-02 7.13473834896E-02 7.23532646515E-02 + 7.33733248825E-02 7.44077671459E-02 7.54567929124E-02 7.65206081300E-02 + 7.75994217314E-02 7.86934426494E-02 7.98028887709E-02 8.09279749981E-02 + 8.20689236952E-02 8.32259572261E-02 8.43993009398E-02 8.55891891394E-02 + 8.67958501585E-02 8.80195242697E-02 8.92604487608E-02 9.05188668893E-02 + 9.17950278819E-02 9.30891794733E-02 9.44015753674E-02 9.57324737454E-02 + 9.70821342807E-02 9.84508226164E-02 9.98388073802E-02 1.01246358692E-01 + 1.02673754135E-01 1.04121271290E-01 1.05589196693E-01 1.07077815389E-01 + 1.08587419883E-01 1.10118307159E-01 1.11670777183E-01 1.13245131417E-01 + 1.14841681766E-01 1.16460740138E-01 1.18102621423E-01 1.19767650960E-01 + 1.21456152595E-01 1.23168465888E-01 1.24904901865E-01 1.26665825547E-01 + 1.28451573419E-01 1.30262496191E-01 1.32098949047E-01 1.33961290159E-01 + 1.35849883665E-01 1.37765102661E-01 1.39707321732E-01 1.41676919943E-01 + 1.43674283818E-01 1.45699804361E-01 1.47753878543E-01 1.49836903743E-01 + 1.51949313024E-01 1.54091485176E-01 1.56263848105E-01 1.58466849523E-01 + 1.60700881604E-01 1.62966439289E-01 1.65263923063E-01 1.67593791407E-01 + 1.69956495570E-01 1.72352517429E-01 1.74782315304E-01 1.77246336419E-01 + 1.79745138736E-01 1.82279134338E-01 1.84848845047E-01 1.87454800506E-01 + 1.90097485889E-01 1.92777406065E-01 1.95495113214E-01 1.98251129668E-01 + 2.01045992682E-01 2.03880254435E-01 2.06754467108E-01 2.09669197803E-01 + 2.12624984451E-01 2.15622481670E-01 2.18662198897E-01 2.21744762318E-01 + 2.24870783468E-01 2.28040859569E-01 2.31255632344E-01 2.34515698742E-01 + 2.37821730333E-01 2.41174353916E-01 2.44574226135E-01 2.48022033485E-01 + 2.51518417686E-01 2.55064095080E-01 2.58659737235E-01 2.62306042917E-01 + 2.66003763371E-01 2.69753597604E-01 2.73556276883E-01 2.77412547395E-01 + 2.81323170251E-01 2.85288891641E-01 2.89310517447E-01 2.93388823704E-01 + 2.97524601373E-01 3.01718656337E-01 3.05971803823E-01 3.10284905355E-01 + 3.14658791369E-01 3.19094291139E-01 3.23592312705E-01 3.28153715483E-01 + 3.32779409824E-01 3.37470253616E-01 3.42227239971E-01 3.47051217993E-01 + 3.51943181750E-01 3.56904054439E-01 3.61934877850E-01 3.67036540612E-01 + 3.72210100449E-01 3.77456522634E-01 3.82776902056E-01 3.88172217504E-01 + 3.93643550371E-01 3.99191979368E-01 4.04818551877E-01 4.10524411204E-01 + 4.16310649880E-01 4.22178345534E-01 4.28128759652E-01 4.34162985573E-01 + 4.40282187695E-01 4.46487618506E-01 4.52780397060E-01 4.59161852682E-01 + 4.65633177780E-01 4.72195641346E-01 4.78850526803E-01 4.85599132500E-01 + 4.92442786631E-01 4.99382802466E-01 5.06420567894E-01 5.13557391621E-01 + 5.20794744796E-01 5.28134011223E-01 5.35576623558E-01 5.43123978067E-01 + 5.50777587547E-01 5.58538996677E-01 5.66409585509E-01 5.74391018345E-01 + 5.82484848814E-01 5.90692566349E-01 5.99015766093E-01 6.07456169321E-01 + 6.16015306888E-01 6.24694920165E-01 6.33496708061E-01 6.42422317351E-01 + 6.51473520971E-01 6.60652050498E-01 6.69959754763E-01 6.79398319678E-01 + 6.88969700505E-01 6.98675732628E-01 7.08518311247E-01 7.18499268492E-01 + 7.28620639940E-01 7.38884278752E-01 7.49292236046E-01 7.59846541266E-01 + 7.70549305330E-01 7.81402447549E-01 7.92408143928E-01 8.03568573100E-01 + 8.14885799401E-01 8.26362043919E-01 8.37999553984E-01 8.49800654633E-01 + 8.61767472971E-01 8.73902404279E-01 8.86207746758E-01 8.98685885326E-01 + 9.11339265891E-01 9.24170303409E-01 9.37181490168E-01 9.50375250249E-01 + 9.63754229025E-01 9.77320927285E-01 9.91077916738E-01 1.00502801972E+00 + 1.01917366635E+00 1.03351777112E+00 1.04806300891E+00 1.06281211032E+00 + 1.07776804834E+00 1.09293352589E+00 1.10831138653E+00 1.12390487582E+00 + 1.13971658359E+00 1.15574983496E+00 1.17200754564E+00 1.18849281161E+00 + 1.20520877342E+00 1.22215853425E+00 1.23934538841E+00 1.25677262497E+00 + 1.27444343241E+00 1.29236137341E+00 1.31052946322E+00 1.32895149923E+00 + 1.34763062057E+00 1.36657052522E+00 1.38577477991E+00 1.40524701069E+00 + 1.42499068206E+00 1.44500959761E+00 1.46530752722E+00 1.48588815559E+00 + 1.50675525080E+00 1.52791285195E+00 1.54936496592E+00 1.57111508501E+00 + 1.59316786215E+00 1.61552667383E+00 1.63819591361E+00 1.66118009136E+00 + 1.68448293821E+00 1.70810877015E+00 1.73206205351E+00 1.75634671315E+00 + 1.78096754806E+00 1.80592897766E+00 1.83123520089E+00 1.85689101683E+00 + 1.88290075477E+00 1.90926908374E+00 1.93600073604E+00 1.96310024296E+00 + 1.99057259669E+00 2.01842246719E+00 2.04665440855E+00 2.07527380388E+00 + 2.10428517008E+00 2.13369344648E+00 2.16350385505E+00 2.19372131980E+00 + 2.22435104269E+00 2.25539761227E+00 2.28686664797E+00 2.31876315068E+00 + 2.35109241393E+00 2.38385938437E+00 2.41706947921E+00 2.45072772843E+00 + 2.48483981104E+00 2.51941088087E+00 2.55444590664E+00 2.58995061470E+00 + 2.62593021112E+00 2.66238968436E+00 2.69933487810E+00 2.73677061310E+00 + 2.77470263213E+00 2.81313605891E+00 2.85207581277E+00 2.89152754618E+00 + 2.93149626755E+00 2.97198713300E+00 3.01300492770E+00 3.05455527482E+00 + 3.09664298158E+00 3.13927256541E+00 3.18244896232E+00 3.22617702432E+00 + 3.27046136809E+00 3.31530644765E+00 3.36071631042E+00 3.40669541008E+00 + 3.45324770392E+00 3.50037718343E+00 3.54808691772E+00 3.59638106798E+00 + 3.64526239257E+00 3.69473386512E+00 3.74479828573E+00 3.79545842463E+00 + 3.84671553541E+00 3.89857171108E+00 3.95102818520E+00 4.00408614829E+00 + 4.05774594362E+00 4.11200757286E+00 4.16687049160E+00 4.22233383625E+00 + 4.27839583019E+00 4.33505449600E+00 4.39230658910E+00 4.45014935363E+00 + 4.50857751817E+00 4.56758608551E+00 4.62717004771E+00 4.68732109344E+00 + 4.74803222594E+00 4.80929414102E+00 4.87109723506E+00 4.93342911751E+00 + 4.99627849038E+00 5.05963072067E+00 5.12347101002E+00 5.18778224834E+00 + 5.25254658561E+00 5.31774300740E+00 5.38335020819E+00 5.44934423116E+00 + 5.51569933282E+00 5.58238716636E+00 5.64937774663E+00 5.71663881316E+00 + 5.78413490927E+00 5.85182810844E+00 5.91967783803E+00 5.98764066704E+00 + 6.05566932294E+00 6.12371528822E+00 6.19172375783E+00 6.25963801315E+00 + 6.32739853048E+00 6.39493933345E+00 6.46219226537E+00 6.52908343674E+00 + 6.59553552636E+00 6.66146580668E+00 6.72678738314E+00 6.79140755847E+00 + 6.85522858302E+00 6.91814751809E+00 6.98005431200E+00 7.04083462757E+00 + 7.10036708778E+00 7.15852349280E+00 7.21517177202E+00 7.27017026890E+00 + 7.32337094084E+00 7.37462104371E+00 7.42375745272E+00 7.47061252155E+00 + 7.51501032559E+00 7.55676635577E+00 7.59569156636E+00 7.63158682847E+00 + 7.66424712604E+00 7.69345939430E+00 7.71900479298E+00 7.74065621861E+00 + 7.75818217417E+00 7.77134015845E+00 7.77988793687E+00 7.78357307618E+00 + 7.78214024571E+00 7.77533016517E+00 7.76287861153E+00 7.74452168347E+00 + 7.71999119652E+00 7.68902128726E+00 7.65134476989E+00 7.60669698005E+00 + 7.55481960829E+00 7.49545638911E+00 7.42835637144E+00 7.35328700551E+00 + 7.27002171668E+00 7.17834862530E+00 7.07807469155E+00 6.96902355653E+00 + 6.85103970627E+00 6.72399792893E+00 6.58779110655E+00 6.44235604384E+00 + 6.28766231236E+00 6.12371981646E+00 5.95057495688E+00 5.76832315428E+00 + 5.57711049640E+00 5.37713379939E+00 5.16864393118E+00 4.95194885983E+00 + 4.72744346291E+00 4.49557055145E+00 4.25684349888E+00 4.01184812974E+00 + 3.76124119011E+00 3.50575220721E+00 3.24618578831E+00 2.98339697280E+00 + 2.71836149478E+00 2.45209761662E+00 2.18569242074E+00 1.92029374533E+00 + 1.65710029136E+00 1.39736507094E+00 1.14238069362E+00 8.93456618220E-01 + 6.51943587432E-01 4.19200543411E-01 1.96570009216E-01 -1.46304175421E-02 + -2.13120522967E-01 -3.97676629999E-01 -5.67148962006E-01 -7.20482561608E-01 + -8.56732315206E-01 -9.75092119826E-01 -1.07491112558E+00 -1.15571803408E+00 + -1.21722913073E+00 -1.25937936553E+00 -1.28232928258E+00 -1.28648510802E+00 + -1.27245988118E+00 -1.24122482822E+00 -1.19399343687E+00 -1.13224094438E+00 + -1.05771424972E+00 -9.72415633859E-01 -8.78586861075E-01 -7.78682344846E-01 + -6.75275438935E-01 -5.71141826439E-01 -4.69158440253E-01 -3.72123230901E-01 + -2.82711323995E-01 -2.03353703636E-01 -1.36089025278E-01 -8.23874674137E-02 + -4.29513429209E-02 -1.75480459211E-02 -4.50214373218E-03 -4.23162034360E-04 + 6.95360655774E-08 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 6.32189811773E-08 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 5.80241241627E-08 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + + + 1 Number of nonzero Dij + 1 1 4.39844776150E-01 + + + + + +2S 0 2.00 Wavefunction + 4.67951610000E-04 4.74549010000E-04 4.81239420000E-04 4.88024150000E-04 + 4.94904540000E-04 5.01881930000E-04 5.08957690000E-04 5.16133210000E-04 + 5.23409890000E-04 5.30789160000E-04 5.38272470000E-04 5.45861280000E-04 + 5.53557080000E-04 5.61361380000E-04 5.69275710000E-04 5.77301620000E-04 + 5.85440690000E-04 5.93694500000E-04 6.02064670000E-04 6.10552860000E-04 + 6.19160710000E-04 6.27889920000E-04 6.36742200000E-04 6.45719280000E-04 + 6.54822930000E-04 6.64054920000E-04 6.73417070000E-04 6.82911210000E-04 + 6.92539200000E-04 7.02302940000E-04 7.12204330000E-04 7.22245310000E-04 + 7.32427850000E-04 7.42753950000E-04 7.53225640000E-04 7.63844960000E-04 + 7.74613990000E-04 7.85534850000E-04 7.96609680000E-04 8.07840650000E-04 + 8.19229950000E-04 8.30779830000E-04 8.42492540000E-04 8.54370390000E-04 + 8.66415690000E-04 8.78630810000E-04 8.91018150000E-04 9.03580130000E-04 + 9.16319210000E-04 9.29237900000E-04 9.42338710000E-04 9.55624230000E-04 + 9.69097060000E-04 9.82759830000E-04 9.96615220000E-04 1.01066600000E-03 + 1.02491480000E-03 1.03936450000E-03 1.05401790000E-03 1.06887800000E-03 + 1.08394750000E-03 1.09922950000E-03 1.11472690000E-03 1.13044280000E-03 + 1.14638030000E-03 1.16254250000E-03 1.17893260000E-03 1.19555370000E-03 + 1.21240910000E-03 1.22950220000E-03 1.24683630000E-03 1.26441480000E-03 + 1.28224110000E-03 1.30031870000E-03 1.31865110000E-03 1.33724210000E-03 + 1.35609510000E-03 1.37521400000E-03 1.39460230000E-03 1.41426410000E-03 + 1.43420300000E-03 1.45442300000E-03 1.47492820000E-03 1.49572240000E-03 + 1.51680970000E-03 1.53819440000E-03 1.55988050000E-03 1.58187240000E-03 + 1.60417440000E-03 1.62679070000E-03 1.64972600000E-03 1.67298450000E-03 + 1.69657100000E-03 1.72049000000E-03 1.74474630000E-03 1.76934450000E-03 + 1.79428950000E-03 1.81958620000E-03 1.84523950000E-03 1.87125450000E-03 + 1.89763630000E-03 1.92439000000E-03 1.95152090000E-03 1.97903430000E-03 + 2.00693560000E-03 2.03523020000E-03 2.06392380000E-03 2.09302190000E-03 + 2.12253020000E-03 2.15245460000E-03 2.18280080000E-03 2.21357490000E-03 + 2.24478290000E-03 2.27643080000E-03 2.30852490000E-03 2.34107150000E-03 + 2.37407690000E-03 2.40754770000E-03 2.44149030000E-03 2.47591150000E-03 + 2.51081800000E-03 2.54621650000E-03 2.58211420000E-03 2.61851790000E-03 + 2.65543490000E-03 2.69287240000E-03 2.73083760000E-03 2.76933810000E-03 + 2.80838140000E-03 2.84797520000E-03 2.88812710000E-03 2.92884510000E-03 + 2.97013720000E-03 3.01201140000E-03 3.05447600000E-03 3.09753930000E-03 + 3.14120970000E-03 3.18549570000E-03 3.23040620000E-03 3.27594980000E-03 + 3.32213540000E-03 3.36897220000E-03 3.41646940000E-03 3.46463610000E-03 + 3.51348200000E-03 3.56301640000E-03 3.61324920000E-03 3.66419030000E-03 + 3.71584940000E-03 3.76823690000E-03 3.82136300000E-03 3.87523810000E-03 + 3.92987270000E-03 3.98527750000E-03 4.04146350000E-03 4.09844160000E-03 + 4.15622290000E-03 4.21481890000E-03 4.27424100000E-03 4.33450090000E-03 + 4.39561020000E-03 4.45758120000E-03 4.52042570000E-03 4.58415630000E-03 + 4.64878540000E-03 4.71432560000E-03 4.78078980000E-03 4.84819110000E-03 + 4.91654250000E-03 4.98585760000E-03 5.05614990000E-03 5.12743320000E-03 + 5.19972150000E-03 5.27302880000E-03 5.34736970000E-03 5.42275860000E-03 + 5.49921040000E-03 5.57674000000E-03 5.65536250000E-03 5.73509360000E-03 + 5.81594860000E-03 5.89794360000E-03 5.98109450000E-03 6.06541760000E-03 + 6.15092960000E-03 6.23764710000E-03 6.32558710000E-03 6.41476690000E-03 + 6.50520390000E-03 6.59691590000E-03 6.68992090000E-03 6.78423700000E-03 + 6.87988280000E-03 6.97687690000E-03 7.07523850000E-03 7.17498670000E-03 + 7.27614110000E-03 7.37872160000E-03 7.48274830000E-03 7.58824140000E-03 + 7.69522180000E-03 7.80371040000E-03 7.91372830000E-03 8.02529730000E-03 + 8.13843910000E-03 8.25317590000E-03 8.36953020000E-03 8.48752480000E-03 + 8.60718280000E-03 8.72852770000E-03 8.85158330000E-03 8.97637360000E-03 + 9.10292300000E-03 9.23125650000E-03 9.36139920000E-03 9.49337650000E-03 + 9.62721430000E-03 9.76293880000E-03 9.90057660000E-03 1.00401550000E-02 + 1.01817010000E-02 1.03252420000E-02 1.04708060000E-02 1.06184230000E-02 + 1.07681200000E-02 1.09199280000E-02 1.10738760000E-02 1.12299940000E-02 + 1.13883130000E-02 1.15488630000E-02 1.17116770000E-02 1.18767850000E-02 + 1.20442220000E-02 1.22140180000E-02 1.23862080000E-02 1.25608250000E-02 + 1.27379040000E-02 1.29174780000E-02 1.30995840000E-02 1.32842570000E-02 + 1.34715330000E-02 1.36614490000E-02 1.38540420000E-02 1.40493500000E-02 + 1.42474100000E-02 1.44482630000E-02 1.46519460000E-02 1.48585010000E-02 + 1.50679670000E-02 1.52803850000E-02 1.54957980000E-02 1.57142460000E-02 + 1.59357740000E-02 1.61604240000E-02 1.63882400000E-02 1.66192680000E-02 + 1.68535510000E-02 1.70911370000E-02 1.73320710000E-02 1.75764010000E-02 + 1.78241750000E-02 1.80754410000E-02 1.83302480000E-02 1.85886460000E-02 + 1.88506860000E-02 1.91164180000E-02 1.93858960000E-02 1.96591720000E-02 + 1.99362990000E-02 2.02173310000E-02 2.05023240000E-02 2.07913330000E-02 + 2.10844150000E-02 2.13816270000E-02 2.16830270000E-02 2.19886740000E-02 + 2.22986290000E-02 2.26129510000E-02 2.29317020000E-02 2.32549450000E-02 + 2.35827420000E-02 2.39151580000E-02 2.42522580000E-02 2.45941080000E-02 + 2.49407740000E-02 2.52923240000E-02 2.56488280000E-02 2.60103550000E-02 + 2.63769740000E-02 2.67487590000E-02 2.71257820000E-02 2.75081160000E-02 + 2.78958360000E-02 2.82890180000E-02 2.86877390000E-02 2.90920760000E-02 + 2.95021090000E-02 2.99179180000E-02 3.03395840000E-02 3.07671880000E-02 + 3.12008160000E-02 3.16405510000E-02 3.20864790000E-02 3.25386870000E-02 + 3.29972640000E-02 3.34622980000E-02 3.39338820000E-02 3.44121060000E-02 + 3.48970640000E-02 3.53888510000E-02 3.58875630000E-02 3.63932960000E-02 + 3.69061490000E-02 3.74262230000E-02 3.79536180000E-02 3.84884380000E-02 + 3.90307870000E-02 3.95807700000E-02 4.01384940000E-02 4.07040690000E-02 + 4.12776030000E-02 4.18592100000E-02 4.24490010000E-02 4.30470920000E-02 + 4.36535990000E-02 4.42686410000E-02 4.48923360000E-02 4.55248060000E-02 + 4.61661730000E-02 4.68165630000E-02 4.74761030000E-02 4.81449190000E-02 + 4.88231410000E-02 4.95109030000E-02 5.02083360000E-02 5.09155760000E-02 + 5.16327610000E-02 5.23600300000E-02 5.30975220000E-02 5.38453830000E-02 + 5.46037550000E-02 5.53727870000E-02 5.61526260000E-02 5.69434240000E-02 + 5.77453350000E-02 5.85585120000E-02 5.93831130000E-02 6.02192980000E-02 + 6.10672270000E-02 6.19270660000E-02 6.27989780000E-02 6.36831340000E-02 + 6.45797030000E-02 6.54888570000E-02 6.64107730000E-02 6.73456270000E-02 + 6.82936000000E-02 6.92548740000E-02 7.02296330000E-02 7.12180650000E-02 + 7.22203600000E-02 7.32367090000E-02 7.42673080000E-02 7.53123550000E-02 + 7.63720490000E-02 7.74465930000E-02 7.85361930000E-02 7.96410570000E-02 + 8.07613960000E-02 8.18974240000E-02 8.30493570000E-02 8.42174160000E-02 + 8.54018210000E-02 8.66028000000E-02 8.78205790000E-02 8.90553900000E-02 + 9.03074680000E-02 9.15770500000E-02 9.28643760000E-02 9.41696900000E-02 + 9.54932380000E-02 9.68352700000E-02 9.81960400000E-02 9.95758030000E-02 + 1.00974820000E-01 1.02393350000E-01 1.03831670000E-01 1.05290030000E-01 + 1.06768730000E-01 1.08268020000E-01 1.09788190000E-01 1.11329530000E-01 + 1.12892330000E-01 1.14476860000E-01 1.16083430000E-01 1.17712330000E-01 + 1.19363870000E-01 1.21038350000E-01 1.22736080000E-01 1.24457370000E-01 + 1.26202540000E-01 1.27971900000E-01 1.29765790000E-01 1.31584520000E-01 + 1.33428440000E-01 1.35297870000E-01 1.37193150000E-01 1.39114640000E-01 + 1.41062670000E-01 1.43037590000E-01 1.45039760000E-01 1.47069540000E-01 + 1.49127300000E-01 1.51213390000E-01 1.53328190000E-01 1.55472080000E-01 + 1.57645430000E-01 1.59848630000E-01 1.62082050000E-01 1.64346100000E-01 + 1.66641170000E-01 1.68967660000E-01 1.71325960000E-01 1.73716490000E-01 + 1.76139660000E-01 1.78595880000E-01 1.81085560000E-01 1.83609140000E-01 + 1.86167040000E-01 1.88759690000E-01 1.91387510000E-01 1.94050960000E-01 + 1.96750460000E-01 1.99486470000E-01 2.02259430000E-01 2.05069800000E-01 + 2.07918030000E-01 2.10804570000E-01 2.13729890000E-01 2.16694460000E-01 + 2.19698740000E-01 2.22743200000E-01 2.25828320000E-01 2.28954570000E-01 + 2.32122440000E-01 2.35332400000E-01 2.38584930000E-01 2.41880530000E-01 + 2.45219680000E-01 2.48602870000E-01 2.52030590000E-01 2.55503340000E-01 + 2.59021600000E-01 2.62585870000E-01 2.66196660000E-01 2.69854440000E-01 + 2.73559730000E-01 2.77313010000E-01 2.81114780000E-01 2.84965540000E-01 + 2.88865770000E-01 2.92815980000E-01 2.96816640000E-01 3.00868260000E-01 + 3.04971310000E-01 3.09126270000E-01 3.13333630000E-01 3.17593860000E-01 + 3.21907430000E-01 3.26274800000E-01 3.30696430000E-01 3.35172770000E-01 + 3.39704280000E-01 3.44291380000E-01 3.48934510000E-01 3.53634080000E-01 + 3.58390510000E-01 3.63204190000E-01 3.68075510000E-01 3.73004850000E-01 + 3.77992570000E-01 3.83039010000E-01 3.88144510000E-01 3.93309370000E-01 + 3.98533900000E-01 4.03818370000E-01 4.09163030000E-01 4.14568130000E-01 + 4.20033860000E-01 4.25560420000E-01 4.31147970000E-01 4.36796620000E-01 + 4.42506490000E-01 4.48277650000E-01 4.54110120000E-01 4.60003910000E-01 + 4.65958970000E-01 4.71975220000E-01 4.78052550000E-01 4.84190780000E-01 + 4.90389690000E-01 4.96649020000E-01 5.02968450000E-01 5.09347600000E-01 + 5.15786020000E-01 5.22283220000E-01 5.28838630000E-01 5.35451610000E-01 + 5.42121430000E-01 5.48847320000E-01 5.55628380000E-01 5.62463660000E-01 + 5.69352090000E-01 5.76292510000E-01 5.83283680000E-01 5.90324210000E-01 + 5.97412620000E-01 6.04547310000E-01 6.11726550000E-01 6.18948470000E-01 + 6.26211070000E-01 6.33512180000E-01 6.40849500000E-01 6.48220550000E-01 + 6.55622680000E-01 6.63053060000E-01 6.70508680000E-01 6.77986310000E-01 + 6.85482520000E-01 6.92993680000E-01 7.00515880000E-01 7.08045030000E-01 + 7.15576750000E-01 7.23106410000E-01 7.30629090000E-01 7.38139610000E-01 + 7.45632470000E-01 7.53101870000E-01 7.60541680000E-01 7.67945450000E-01 + 7.75306370000E-01 7.82617270000E-01 7.89870620000E-01 7.97058500000E-01 + 8.04172600000E-01 8.11204220000E-01 8.18144240000E-01 8.24983110000E-01 + 8.31710880000E-01 8.38317140000E-01 8.44791090000E-01 8.51121450000E-01 + 8.57296540000E-01 8.63304250000E-01 8.69132020000E-01 8.74766910000E-01 + 8.80195580000E-01 8.85404320000E-01 8.90379050000E-01 8.95105380000E-01 + 8.99568640000E-01 9.03753900000E-01 9.07646030000E-01 9.11229780000E-01 + 9.14489780000E-01 9.17410670000E-01 9.19977140000E-01 9.22174040000E-01 + 9.23986450000E-01 9.25399770000E-01 9.26399870000E-01 9.26973170000E-01 + 9.27106770000E-01 9.26788560000E-01 9.26007380000E-01 9.24753130000E-01 + 9.23016930000E-01 9.20791220000E-01 9.18069900000E-01 9.14848490000E-01 + 9.11124200000E-01 9.06896070000E-01 9.02165050000E-01 8.96934080000E-01 + 8.91208160000E-01 8.84994340000E-01 8.78301750000E-01 8.71141600000E-01 + 8.63527050000E-01 8.55473140000E-01 8.46996680000E-01 8.38116000000E-01 + 8.28850800000E-01 8.19221870000E-01 8.09250770000E-01 7.98959530000E-01 + 7.88370300000E-01 7.77504970000E-01 7.66384840000E-01 7.55030260000E-01 + 7.43460400000E-01 7.31692960000E-01 7.19744170000E-01 7.07628820000E-01 + 6.95360660000E-01 6.82952940000E-01 6.70418850000E-01 6.57771550000E-01 + 6.45024170000E-01 6.32189810000E-01 6.19281470000E-01 6.06312070000E-01 + 5.93294430000E-01 5.80241240000E-01 5.67165040000E-01 5.54078220000E-01 + 5.40993000000E-01 5.27921370000E-01 5.14875160000E-01 5.01865930000E-01 + 4.88905030000E-01 4.76003540000E-01 4.63172270000E-01 4.50421780000E-01 + 4.37762290000E-01 4.25203760000E-01 4.12755790000E-01 4.00427700000E-01 + 3.88228420000E-01 3.76166580000E-01 3.64250430000E-01 3.52487860000E-01 + 3.40886410000E-01 3.29453210000E-01 3.18195050000E-01 3.07118290000E-01 + 2.96228940000E-01 2.85532570000E-01 2.75034400000E-01 2.64739230000E-01 + 2.54651450000E-01 2.44775070000E-01 2.35113690000E-01 2.25670510000E-01 + 2.16448350000E-01 2.07449610000E-01 1.98676330000E-01 1.90130130000E-01 + 1.81812290000E-01 1.73723690000E-01 1.65864850000E-01 1.58235920000E-01 + 1.50836710000E-01 1.43666680000E-01 1.36724950000E-01 1.30010340000E-01 + 1.23521320000E-01 1.17256090000E-01 1.11212520000E-01 1.05388250000E-01 + 9.97806130000E-02 9.43867020000E-02 8.92033670000E-02 8.42272350000E-02 + 7.94547140000E-02 7.48820180000E-02 7.05051740000E-02 6.63200380000E-02 + 6.23223110000E-02 5.85075550000E-02 5.48712040000E-02 5.14085790000E-02 + 4.81149090000E-02 4.49853370000E-02 4.20149380000E-02 3.91987350000E-02 + 3.65317090000E-02 3.40088170000E-02 3.16249980000E-02 2.93751940000E-02 + 2.72543560000E-02 2.52574620000E-02 2.33795210000E-02 2.16155880000E-02 + 1.99607770000E-02 1.84102640000E-02 1.69593010000E-02 1.56032230000E-02 + 1.43374560000E-02 1.31575260000E-02 1.20590600000E-02 1.10378000000E-02 + 1.00896000000E-02 9.21043840000E-03 8.39641600000E-03 7.64376220000E-03 + 6.94883750000E-03 6.30813490000E-03 5.71828230000E-03 5.17604280000E-03 + 4.67831570000E-03 4.22213600000E-03 3.80467390000E-03 3.42323390000E-03 + 3.07525340000E-03 2.75830040000E-03 2.47007180000E-03 2.20839040000E-03 + 1.97120200000E-03 1.75657250000E-03 1.56268410000E-03 1.38783170000E-03 + 1.23041940000E-03 1.08895610000E-03 9.62051520000E-04 8.48412120000E-04 + 7.46836650000E-04 6.56211890000E-04 5.75508350000E-04 5.03775930000E-04 + 4.40139630000E-04 3.83795320000E-04 3.34005580000E-04 2.90095600000E-04 + 2.51449240000E-04 2.17505100000E-04 1.87752850000E-04 1.61729570000E-04 + 1.39016310000E-04 1.19234810000E-04 1.02044250000E-04 8.71383590000E-05 + 7.42424710000E-05 6.31109030000E-05 5.35244000000E-05 4.52877740000E-05 + 3.82276840000E-05 3.21905750000E-05 2.70407600000E-05 2.26586440000E-05 + 1.89390870000E-05 1.57898960000E-05 1.31304420000E-05 1.08904000000E-05 + 9.00859070000E-06 7.43194340000E-06 6.11454290000E-06 5.01677720000E-06 + 4.10456830000E-06 3.34868310000E-06 2.72411650000E-06 2.20954220000E-06 + 1.78683160000E-06 1.44067320000E-06 1.15806430000E-06 9.28044670000E-07 + 7.41410930000E-07 5.90459230000E-07 4.68761830000E-07 3.70973300000E-07 + 2.92663360000E-07 2.30173040000E-07 1.80491380000E-07 1.41150330000E-07 + 1.10135460000E-07 8.58105290000E-08 6.68542420000E-08 5.18975940000E-08 + 4.01396130000E-08 3.09303190000E-08 2.37442300000E-08 1.81581310000E-08 + 1.38324830000E-08 1.04959390000E-08 7.93250830000E-09 5.97094990000E-09 + 4.47605270000E-09 3.34149420000E-09 2.48401680000E-09 1.83869950000E-09 + 1.35513710000E-09 9.94363940000E-10 7.26390590000E-10 5.28238960000E-10 + 3.82382780000E-10 2.75515350000E-10 1.97580630000E-10 1.41014930000E-10 + 1.00156410000E-10 7.07873250000E-11 4.97811920000E-11 3.48319290000E-11 + 2.42471780000E-11 1.67913230000E-11 1.15668950000E-11 7.92546080000E-12 + 5.40101390000E-12 3.66046190000E-12 2.46701950000E-12 1.65329820000E-12 + 1.10163330000E-12 7.29785140000E-13 4.80606280000E-13 3.14618440000E-13 + 2.04711650000E-13 1.32381530000E-13 8.50748100000E-14 5.43281740000E-14 + 3.44715630000E-14 2.17304780000E-14 1.36084960000E-14 8.46531540000E-15 + 5.23030780000E-15 3.20937810000E-15 1.95560840000E-15 1.18322550000E-15 + 7.10778640000E-16 4.23875660000E-16 2.50919990000E-16 1.47427830000E-16 + 8.59657100000E-17 4.97423280000E-17 2.85584640000E-17 1.62668570000E-17 + 9.19144980000E-18 5.15141760000E-18 2.86339970000E-18 1.57833470000E-18 + 8.62634530000E-19 4.67426310000E-19 2.51076060000E-19 1.33674870000E-19 + 7.05329940000E-20 3.68788970000E-20 1.91051650000E-20 9.80515250000E-21 + 4.98461040000E-21 2.50970810000E-21 1.25132840000E-21 6.17754180000E-22 + 3.01922630000E-22 1.46066190000E-22 6.99383530000E-23 3.31382420000E-23 + 1.55355890000E-23 7.20518410000E-24 3.30533560000E-24 1.49958890000E-24 + 6.72739920000E-25 2.98381340000E-25 1.30820500000E-25 5.66876990000E-26 + 2.42738680000E-26 1.02695980000E-26 4.29198740000E-27 1.77165460000E-27 + 7.22169940000E-28 2.90644760000E-28 1.15470290000E-28 4.52776120000E-29 + 1.75195110000E-29 6.68812270000E-30 2.51853340000E-30 9.35338210000E-31 + 3.42517070000E-31 1.23652310000E-31 4.39988560000E-32 1.54280530000E-32 + 5.32993190000E-33 1.81376870000E-33 6.07854340000E-34 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 +2P 1 4.00 Wavefunction + 4.28913950000E-07 4.41093260000E-07 4.53618400000E-07 4.66499200000E-07 + 4.79745760000E-07 4.93368470000E-07 5.07378000000E-07 5.21785340000E-07 + 5.36601790000E-07 5.51838960000E-07 5.67508810000E-07 5.83623600000E-07 + 6.00195990000E-07 6.17238960000E-07 6.34765880000E-07 6.52790490000E-07 + 6.71326910000E-07 6.90389700000E-07 7.09993780000E-07 7.30154530000E-07 + 7.50887760000E-07 7.72209730000E-07 7.94137150000E-07 8.16687210000E-07 + 8.39877590000E-07 8.63726480000E-07 8.88252580000E-07 9.13475110000E-07 + 9.39413850000E-07 9.66089140000E-07 9.93521890000E-07 1.02173360000E-06 + 1.05074640000E-06 1.08058310000E-06 1.11126700000E-06 1.14282210000E-06 + 1.17527330000E-06 1.20864600000E-06 1.24296630000E-06 1.27826120000E-06 + 1.31455830000E-06 1.35188600000E-06 1.39027370000E-06 1.42975150000E-06 + 1.47035020000E-06 1.51210180000E-06 1.55503890000E-06 1.59919530000E-06 + 1.64460550000E-06 1.69130520000E-06 1.73933090000E-06 1.78872040000E-06 + 1.83951230000E-06 1.89174640000E-06 1.94546380000E-06 2.00070660000E-06 + 2.05751790000E-06 2.11594250000E-06 2.17602610000E-06 2.23781580000E-06 + 2.30136010000E-06 2.36670870000E-06 2.43391290000E-06 2.50302550000E-06 + 2.57410050000E-06 2.64719380000E-06 2.72236260000E-06 2.79966590000E-06 + 2.87916420000E-06 2.96091990000E-06 3.04499720000E-06 3.13146180000E-06 + 3.22038170000E-06 3.31182650000E-06 3.40586800000E-06 3.50257980000E-06 + 3.60203780000E-06 3.70432000000E-06 3.80950650000E-06 3.91767990000E-06 + 4.02892490000E-06 4.14332880000E-06 4.26098120000E-06 4.38197450000E-06 + 4.50640340000E-06 4.63436560000E-06 4.76596130000E-06 4.90129380000E-06 + 5.04046910000E-06 5.18359640000E-06 5.33078780000E-06 5.48215880000E-06 + 5.63782810000E-06 5.79791770000E-06 5.96255320000E-06 6.13186350000E-06 + 6.30598160000E-06 6.48504370000E-06 6.66919050000E-06 6.85856620000E-06 + 7.05331930000E-06 7.25360250000E-06 7.45957290000E-06 7.67139190000E-06 + 7.88922560000E-06 8.11324490000E-06 8.34362520000E-06 8.58054730000E-06 + 8.82419700000E-06 9.07476510000E-06 9.33244830000E-06 9.59744850000E-06 + 9.86997360000E-06 1.01502370000E-05 1.04384590000E-05 1.07348650000E-05 + 1.10396870000E-05 1.13531650000E-05 1.16755440000E-05 1.20070780000E-05 + 1.23480250000E-05 1.26986540000E-05 1.30592390000E-05 1.34300630000E-05 + 1.38114170000E-05 1.42035990000E-05 1.46069180000E-05 1.50216890000E-05 + 1.54482370000E-05 1.58868970000E-05 1.63380140000E-05 1.68019400000E-05 + 1.72790390000E-05 1.77696850000E-05 1.82742640000E-05 1.87931700000E-05 + 1.93268110000E-05 1.98756040000E-05 2.04399810000E-05 2.10203830000E-05 + 2.16172660000E-05 2.22310980000E-05 2.28623590000E-05 2.35115450000E-05 + 2.41791650000E-05 2.48657420000E-05 2.55718140000E-05 2.62979360000E-05 + 2.70446750000E-05 2.78126180000E-05 2.86023680000E-05 2.94145420000E-05 + 3.02497770000E-05 3.11087290000E-05 3.19920710000E-05 3.29004960000E-05 + 3.38347150000E-05 3.47954610000E-05 3.57834880000E-05 3.67995690000E-05 + 3.78445020000E-05 3.89191050000E-05 4.00242220000E-05 4.11607180000E-05 + 4.23294840000E-05 4.35314370000E-05 4.47675200000E-05 4.60387000000E-05 + 4.73459750000E-05 4.86903700000E-05 5.00729380000E-05 5.14947630000E-05 + 5.29569600000E-05 5.44606760000E-05 5.60070880000E-05 5.75974100000E-05 + 5.92328890000E-05 6.09148050000E-05 6.26444780000E-05 6.44232640000E-05 + 6.62525570000E-05 6.81337910000E-05 7.00684410000E-05 7.20580240000E-05 + 7.41040990000E-05 7.62082700000E-05 7.83721860000E-05 8.05975440000E-05 + 8.28860890000E-05 8.52396140000E-05 8.76599640000E-05 9.01490370000E-05 + 9.27087830000E-05 9.53412100000E-05 9.80483800000E-05 1.00832420000E-04 + 1.03695500000E-04 1.06639880000E-04 1.09667850000E-04 1.12781800000E-04 + 1.15984170000E-04 1.19277450000E-04 1.22664250000E-04 1.26147200000E-04 + 1.29729050000E-04 1.33412590000E-04 1.37200720000E-04 1.41096400000E-04 + 1.45102700000E-04 1.49222730000E-04 1.53459750000E-04 1.57817060000E-04 + 1.62298090000E-04 1.66906340000E-04 1.71645420000E-04 1.76519060000E-04 + 1.81531070000E-04 1.86685370000E-04 1.91986010000E-04 1.97437140000E-04 + 2.03043040000E-04 2.08808090000E-04 2.14736820000E-04 2.20833870000E-04 + 2.27104010000E-04 2.33552170000E-04 2.40183390000E-04 2.47002870000E-04 + 2.54015960000E-04 2.61228140000E-04 2.68645070000E-04 2.76272570000E-04 + 2.84116610000E-04 2.92183330000E-04 3.00479050000E-04 3.09010280000E-04 + 3.17783690000E-04 3.26806170000E-04 3.36084770000E-04 3.45626780000E-04 + 3.55439660000E-04 3.65531100000E-04 3.75909000000E-04 3.86581500000E-04 + 3.97556960000E-04 4.08843970000E-04 4.20451370000E-04 4.32388260000E-04 + 4.44663980000E-04 4.57288160000E-04 4.70270660000E-04 4.83621670000E-04 + 4.97351640000E-04 5.11471320000E-04 5.25991760000E-04 5.40924350000E-04 + 5.56280760000E-04 5.72073030000E-04 5.88313510000E-04 6.05014930000E-04 + 6.22190360000E-04 6.39853250000E-04 6.58017420000E-04 6.76697090000E-04 + 6.95906880000E-04 7.15661830000E-04 7.35977410000E-04 7.56869500000E-04 + 7.78354470000E-04 8.00449120000E-04 8.23170750000E-04 8.46537130000E-04 + 8.70566550000E-04 8.95277810000E-04 9.20690240000E-04 9.46823710000E-04 + 9.73698690000E-04 1.00133620000E-03 1.02975780000E-03 1.05898580000E-03 + 1.08904300000E-03 1.11995290000E-03 1.15173970000E-03 1.18442820000E-03 + 1.21804410000E-03 1.25261350000E-03 1.28816350000E-03 1.32472190000E-03 + 1.36231730000E-03 1.40097900000E-03 1.44073720000E-03 1.48162310000E-03 + 1.52366850000E-03 1.56690630000E-03 1.61137030000E-03 1.65709510000E-03 + 1.70411660000E-03 1.75247130000E-03 1.80219710000E-03 1.85333280000E-03 + 1.90591830000E-03 1.95999470000E-03 2.01560400000E-03 2.07278980000E-03 + 2.13159660000E-03 2.19207030000E-03 2.25425800000E-03 2.31820830000E-03 + 2.38397100000E-03 2.45159740000E-03 2.52114020000E-03 2.59265350000E-03 + 2.66619310000E-03 2.74181620000E-03 2.81958190000E-03 2.89955050000E-03 + 2.98178440000E-03 3.06634770000E-03 3.15330600000E-03 3.24272700000E-03 + 3.33468040000E-03 3.42923760000E-03 3.52647210000E-03 3.62645950000E-03 + 3.72927760000E-03 3.83500620000E-03 3.94372740000E-03 4.05552570000E-03 + 4.17048780000E-03 4.28870300000E-03 4.41026300000E-03 4.53526210000E-03 + 4.66379710000E-03 4.79596780000E-03 4.93187660000E-03 5.07162870000E-03 + 5.21533230000E-03 5.36309880000E-03 5.51504240000E-03 5.67128060000E-03 + 5.83193440000E-03 5.99712770000E-03 6.16698840000E-03 6.34164750000E-03 + 6.52123990000E-03 6.70590420000E-03 6.89578270000E-03 7.09102190000E-03 + 7.29177220000E-03 7.49818810000E-03 7.71042870000E-03 7.92865700000E-03 + 8.15304100000E-03 8.38375310000E-03 8.62097040000E-03 8.86487510000E-03 + 9.11565410000E-03 9.37349990000E-03 9.63860990000E-03 9.91118710000E-03 + 1.01914400000E-02 1.04795830000E-02 1.07758360000E-02 1.10804250000E-02 + 1.13935830000E-02 1.17155490000E-02 1.20465670000E-02 1.23868890000E-02 + 1.27367740000E-02 1.30964890000E-02 1.34663050000E-02 1.38465040000E-02 + 1.42373730000E-02 1.46392090000E-02 1.50523140000E-02 1.54770010000E-02 + 1.59135900000E-02 1.63624100000E-02 1.68238000000E-02 1.72981050000E-02 + 1.77856820000E-02 1.82868960000E-02 1.88021230000E-02 1.93317490000E-02 + 1.98761680000E-02 2.04357860000E-02 2.10110210000E-02 2.16023000000E-02 + 2.22100620000E-02 2.28347580000E-02 2.34768490000E-02 2.41368110000E-02 + 2.48151290000E-02 2.55123030000E-02 2.62288460000E-02 2.69652820000E-02 + 2.77221510000E-02 2.85000060000E-02 2.92994130000E-02 3.01209540000E-02 + 3.09652240000E-02 3.18328360000E-02 3.27244160000E-02 3.36406060000E-02 + 3.45820640000E-02 3.55494660000E-02 3.65435030000E-02 3.75648830000E-02 + 3.86143340000E-02 3.96925970000E-02 4.08004360000E-02 4.19386310000E-02 + 4.31079810000E-02 4.43093040000E-02 4.55434370000E-02 4.68112390000E-02 + 4.81135870000E-02 4.94513790000E-02 5.08255340000E-02 5.22369930000E-02 + 5.36867170000E-02 5.51756890000E-02 5.67049150000E-02 5.82754230000E-02 + 5.98882630000E-02 6.15445100000E-02 6.32452590000E-02 6.49916320000E-02 + 6.67847720000E-02 6.86258480000E-02 7.05160510000E-02 7.24566000000E-02 + 7.44487340000E-02 7.64937210000E-02 7.85928500000E-02 8.07474380000E-02 + 8.29588250000E-02 8.52283770000E-02 8.75574850000E-02 8.99475650000E-02 + 9.24000570000E-02 9.49164270000E-02 9.74981640000E-02 1.00146780000E-01 + 1.02863830000E-01 1.05650850000E-01 1.08509440000E-01 1.11441210000E-01 + 1.14447790000E-01 1.17530830000E-01 1.20692010000E-01 1.23933010000E-01 + 1.27255560000E-01 1.30661380000E-01 1.34152230000E-01 1.37729870000E-01 + 1.41396080000E-01 1.45152660000E-01 1.49001410000E-01 1.52944150000E-01 + 1.56982710000E-01 1.61118910000E-01 1.65354590000E-01 1.69691600000E-01 + 1.74131770000E-01 1.78676940000E-01 1.83328940000E-01 1.88089580000E-01 + 1.92960690000E-01 1.97944050000E-01 2.03041430000E-01 2.08254600000E-01 + 2.13585270000E-01 2.19035140000E-01 2.24605870000E-01 2.30299070000E-01 + 2.36116300000E-01 2.42059100000E-01 2.48128910000E-01 2.54327130000E-01 + 2.60655090000E-01 2.67114030000E-01 2.73705110000E-01 2.80429410000E-01 + 2.87287880000E-01 2.94281400000E-01 3.01410700000E-01 3.08676400000E-01 + 3.16078990000E-01 3.23618790000E-01 3.31295990000E-01 3.39110600000E-01 + 3.47062460000E-01 3.55151220000E-01 3.63376330000E-01 3.71737020000E-01 + 3.80232300000E-01 3.88860960000E-01 3.97621510000E-01 4.06512230000E-01 + 4.15531100000E-01 4.24675810000E-01 4.33943770000E-01 4.43332050000E-01 + 4.52837400000E-01 4.62456210000E-01 4.72184550000E-01 4.82018060000E-01 + 4.91952060000E-01 5.01981410000E-01 5.12100610000E-01 5.22303700000E-01 + 5.32584310000E-01 5.42935610000E-01 5.53350330000E-01 5.63820730000E-01 + 5.74338590000E-01 5.84895220000E-01 5.95481450000E-01 6.06087620000E-01 + 6.16703600000E-01 6.27318740000E-01 6.37921950000E-01 6.48501640000E-01 + 6.59045740000E-01 6.69541730000E-01 6.79976670000E-01 6.90337150000E-01 + 7.00609390000E-01 7.10779200000E-01 7.20832030000E-01 7.30753040000E-01 + 7.40527060000E-01 7.50138690000E-01 7.59572310000E-01 7.68812160000E-01 + 7.77842360000E-01 7.86646960000E-01 7.95210050000E-01 8.03515780000E-01 + 8.11548430000E-01 8.19292510000E-01 8.26732820000E-01 8.33854500000E-01 + 8.40643160000E-01 8.47084950000E-01 8.53166610000E-01 8.58875600000E-01 + 8.64200170000E-01 8.69129440000E-01 8.73653480000E-01 8.77763420000E-01 + 8.81451510000E-01 8.84711200000E-01 8.87537200000E-01 8.89925570000E-01 + 8.91873770000E-01 8.93380690000E-01 8.94446710000E-01 8.95073750000E-01 + 8.95265250000E-01 8.95026200000E-01 8.94363150000E-01 8.93284170000E-01 + 8.91798810000E-01 8.89918090000E-01 8.87654410000E-01 8.85021460000E-01 + 8.82034180000E-01 8.78708580000E-01 8.75061690000E-01 8.71111360000E-01 + 8.66876150000E-01 8.62375110000E-01 8.57627670000E-01 8.52653400000E-01 + 8.47471850000E-01 8.42102280000E-01 8.36563510000E-01 8.30873700000E-01 + 8.25050060000E-01 8.19108750000E-01 8.13064560000E-01 8.06930810000E-01 + 8.00719070000E-01 7.94439100000E-01 7.88098610000E-01 7.81703230000E-01 + 7.75256420000E-01 7.68759450000E-01 7.62211420000E-01 7.55609390000E-01 + 7.48948530000E-01 7.42222330000E-01 7.35422950000E-01 7.28541630000E-01 + 7.21569140000E-01 7.14496330000E-01 7.07314720000E-01 7.00017090000E-01 + 6.92598040000E-01 6.85054450000E-01 6.77385780000E-01 6.69594010000E-01 + 6.61683160000E-01 6.53658210000E-01 6.45524330000E-01 6.37286780000E-01 + 6.28950840000E-01 6.20521820000E-01 6.12005060000E-01 6.03405940000E-01 + 5.94729830000E-01 5.85982150000E-01 5.77168290000E-01 5.68293680000E-01 + 5.59363720000E-01 5.50383850000E-01 5.41359450000E-01 5.32295920000E-01 + 5.23198640000E-01 5.14072960000E-01 5.04924210000E-01 4.95757690000E-01 + 4.86578680000E-01 4.77392420000E-01 4.68204090000E-01 4.59018850000E-01 + 4.49841800000E-01 4.40678010000E-01 4.31532460000E-01 4.22410110000E-01 + 4.13315830000E-01 4.04254450000E-01 3.95230710000E-01 3.86249300000E-01 + 3.77314810000E-01 3.68431770000E-01 3.59604620000E-01 3.50837710000E-01 + 3.42135320000E-01 3.33501630000E-01 3.24940700000E-01 3.16456530000E-01 + 3.08052990000E-01 2.99733850000E-01 2.91502780000E-01 2.83363320000E-01 + 2.75318920000E-01 2.67372890000E-01 2.59528430000E-01 2.51788600000E-01 + 2.44156360000E-01 2.36634510000E-01 2.29225730000E-01 2.21932570000E-01 + 2.14757440000E-01 2.07702590000E-01 2.00770170000E-01 1.93962130000E-01 + 1.87280330000E-01 1.80726440000E-01 1.74302010000E-01 1.68008410000E-01 + 1.61846890000E-01 1.55818520000E-01 1.49924240000E-01 1.44164830000E-01 + 1.38540920000E-01 1.33052980000E-01 1.27701320000E-01 1.22486130000E-01 + 1.17407430000E-01 1.12465090000E-01 1.07658830000E-01 1.02988240000E-01 + 9.84527730000E-02 9.40517150000E-02 8.97842350000E-02 8.56493650000E-02 + 8.16460050000E-02 7.77729300000E-02 7.40287920000E-02 7.04121240000E-02 + 6.69213460000E-02 6.35547660000E-02 6.03105900000E-02 5.71869240000E-02 + 5.41817770000E-02 5.12930730000E-02 4.85186490000E-02 4.58562680000E-02 + 4.33036160000E-02 4.08583180000E-02 3.85179340000E-02 3.62799730000E-02 + 3.41418950000E-02 3.21011160000E-02 3.01550190000E-02 2.83009550000E-02 + 2.65362500000E-02 2.48582140000E-02 2.32641430000E-02 2.17513260000E-02 + 2.03170530000E-02 1.89586150000E-02 1.76733160000E-02 1.64584720000E-02 + 1.53114200000E-02 1.42295230000E-02 1.32101690000E-02 1.22507830000E-02 + 1.13488260000E-02 1.05017990000E-02 9.70725030000E-03 8.96277390000E-03 + 8.26601620000E-03 7.61467740000E-03 7.00651410000E-03 6.43934170000E-03 + 5.91103620000E-03 5.41953630000E-03 4.96284450000E-03 4.53902890000E-03 + 4.14622330000E-03 3.78262870000E-03 3.44651330000E-03 3.13621300000E-03 + 2.85013150000E-03 2.58673980000E-03 2.34457630000E-03 2.12224570000E-03 + 1.91841890000E-03 1.73183170000E-03 1.56128380000E-03 1.40563810000E-03 + 1.26381870000E-03 1.13481010000E-03 1.01765570000E-03 9.11456310000E-04 + 8.15368270000E-04 7.28602340000E-04 6.50421910000E-04 5.80141470000E-04 + 5.17125120000E-04 4.60785120000E-04 4.10580560000E-04 3.65225860000E-04 + 3.24322970000E-04 2.87499170000E-04 2.54406210000E-04 2.24719310000E-04 + 1.98136210000E-04 1.74348160000E-04 1.53131590000E-04 1.34243870000E-04 + 1.17461250000E-04 1.02577770000E-04 8.94042710000E-05 7.77673630000E-05 + 6.75084480000E-05 5.84827640000E-05 5.05584630000E-05 4.36157200000E-05 + 3.75458790000E-05 3.22506290000E-05 2.76412240000E-05 2.36377310000E-05 + 2.01683250000E-05 1.71686170000E-05 1.45810210000E-05 1.23541600000E-05 + 1.04423060000E-05 8.80486340000E-06 7.40588130000E-06 6.21360240000E-06 + 5.20004640000E-06 4.34062540000E-06 3.61378860000E-06 3.00069820000E-06 + 2.48493270000E-06 2.05221570000E-06 1.69017070000E-06 1.38809830000E-06 + 1.13677520000E-06 9.28273770000E-07 7.55799980000E-07 6.13548480000E-07 + 4.96573730000E-07 4.00675560000E-07 3.22297810000E-07 2.58439040000E-07 + 2.06574040000E-07 1.64585130000E-07 1.30702150000E-07 1.03450350000E-07 + 8.16051810000E-08 6.41533420000E-08 5.02591970000E-08 3.92360360000E-08 + 3.05215330000E-08 2.36568680000E-08 1.82690330000E-08 1.40559020000E-08 + 1.07736720000E-08 8.22635500000E-09 6.25700140000E-09 4.74041390000E-09 + 3.57711790000E-09 2.68839250000E-09 2.01219300000E-09 1.49981900000E-09 + 1.11320390000E-09 8.22718470000E-10 6.05399610000E-10 4.43527620000E-10 + 3.23489190000E-10 2.34872390000E-10 1.69749860000E-10 1.22113570000E-10 + 8.74312710000E-11 6.23001400000E-11 4.41775030000E-11 3.11726240000E-11 + 2.18864510000E-11 1.52889060000E-11 1.06254030000E-11 7.34599770000E-12 + 5.05196730000E-12 3.45574890000E-12 2.35105500000E-12 1.59070270000E-12 + 1.07025430000E-12 7.16015370000E-13 4.76277790000E-13 3.14967410000E-13 + 2.07062950000E-13 1.35311410000E-13 8.78870330000E-14 5.67330670000E-14 + 3.63940970000E-14 2.31990630000E-14 1.46931820000E-14 9.24544240000E-15 + 5.77917610000E-15 3.58831010000E-15 2.21288400000E-15 1.35528380000E-15 + 8.24256530000E-16 4.97751060000E-16 2.98425620000E-16 1.77619230000E-16 + 1.04937100000E-16 6.15329830000E-17 3.58080480000E-17 2.06776140000E-17 + 1.18473150000E-17 6.73428090000E-18 3.79721850000E-18 2.12370230000E-18 + 1.17794590000E-18 6.47902910000E-19 3.53342520000E-19 1.91042980000E-19 + 1.02391170000E-19 5.43921800000E-20 2.86350910000E-20 1.49380380000E-20 + 7.72085680000E-21 3.95327990000E-21 2.00499000000E-21 1.00709640000E-21 + 5.00927460000E-22 2.46696840000E-22 1.20275270000E-22 5.80432120000E-23 + 2.77221040000E-23 1.31019860000E-23 6.12660480000E-24 2.83406030000E-24 + 1.29669720000E-24 5.86733910000E-25 2.62511790000E-25 1.16116090000E-25 + 5.07693880000E-26 2.19384710000E-26 9.36771530000E-27 3.95194480000E-27 + 1.64688720000E-27 6.77824910000E-28 2.75483590000E-28 1.10540450000E-28 + 4.37840240000E-29 1.71158970000E-29 6.60226040000E-30 2.51253970000E-30 + 9.43143280000E-31 3.49142640000E-31 1.27439300000E-31 4.58556410000E-32 + 1.62623550000E-32 5.68311680000E-33 1.95664510000E-33 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 + + + + + 4.37958154472E-07 4.50394304037E-07 4.63183581802E-07 4.76336012452E-07 + 4.89861928049E-07 5.03771916971E-07 5.18076890150E-07 5.32788069970E-07 + 5.47916977666E-07 5.63475482852E-07 5.79475792185E-07 5.95930436473E-07 + 6.12852322577E-07 6.30254721847E-07 6.48151279703E-07 6.66556025451E-07 + 6.85483405735E-07 7.04948225212E-07 7.24965750089E-07 7.45551722211E-07 + 7.66722224945E-07 7.88493888507E-07 8.10883781137E-07 8.33909445039E-07 + 8.57588960885E-07 8.81940857646E-07 9.06984256305E-07 9.32738779234E-07 + 9.59224617067E-07 9.86462572378E-07 1.01447396368E-06 1.04328075139E-06 + 1.07290552718E-06 1.10337153112E-06 1.13470266916E-06 1.16692347000E-06 + 1.20005919208E-06 1.23413584443E-06 1.26918014440E-06 1.30521956739E-06 + 1.34228233421E-06 1.38039756225E-06 1.41959509136E-06 1.45990570337E-06 + 1.50136094348E-06 1.54399334637E-06 1.58783635984E-06 1.63292433236E-06 + 1.67929260814E-06 1.72697759165E-06 1.77601658982E-06 1.82644813601E-06 + 1.87831175862E-06 1.93164808174E-06 1.98649893279E-06 2.04290753842E-06 + 2.10091762804E-06 2.16057503657E-06 2.22192640740E-06 2.28502038905E-06 + 2.34990555055E-06 2.41663339258E-06 2.48525581890E-06 2.55582690869E-06 + 2.62840208843E-06 2.70303815915E-06 2.77979379572E-06 2.85872865168E-06 + 2.93990480987E-06 3.02338638780E-06 3.10923860603E-06 3.19752879713E-06 + 3.28832596049E-06 3.38170131592E-06 3.47772784681E-06 3.57648194029E-06 + 3.67803973919E-06 3.78248197954E-06 3.88988919969E-06 4.00034728196E-06 + 4.11394141936E-06 4.23076119455E-06 4.35089901415E-06 4.47444780253E-06 + 4.60150456271E-06 4.73216993376E-06 4.86654520611E-06 5.00473667049E-06 + 5.14685263655E-06 5.29300344190E-06 5.44330541935E-06 5.59787449074E-06 + 5.75683345650E-06 5.92030614360E-06 6.08842151089E-06 6.26131031836E-06 + 6.43910868124E-06 6.62195610163E-06 6.80999553713E-06 7.00337496726E-06 + 7.20224605141E-06 7.40676420320E-06 7.61709022719E-06 7.83338892217E-06 + 8.05582996462E-06 8.28458723296E-06 8.51984136874E-06 8.76177585093E-06 + 9.01058036563E-06 9.26645101557E-06 9.52958704333E-06 9.80019611989E-06 + 1.00784902018E-05 1.03646864836E-05 1.06590102735E-05 1.09616924855E-05 + 1.12729697530E-05 1.15930874330E-05 1.19222950433E-05 1.22608521914E-05 + 1.26090239531E-05 1.29670819530E-05 1.33353096586E-05 1.37139934516E-05 + 1.41034320372E-05 1.45039304943E-05 1.49158014434E-05 1.53393696288E-05 + 1.57749667678E-05 1.62229350536E-05 1.66836240143E-05 1.71573964603E-05 + 1.76446242344E-05 1.81456883943E-05 1.86609830641E-05 1.91909121630E-05 + 1.97358908612E-05 2.02963458680E-05 2.08727196053E-05 2.14654616102E-05 + 2.20750364566E-05 2.27019242556E-05 2.33466170721E-05 2.40096177818E-05 + 2.46914500567E-05 2.53926449538E-05 2.61137552333E-05 2.68553474350E-05 + 2.76179991847E-05 2.84023128359E-05 2.92089027374E-05 3.00384015245E-05 + 3.08914590724E-05 3.17687445161E-05 3.26709484141E-05 3.35987768678E-05 + 3.45529567407E-05 3.55342396160E-05 3.65433940842E-05 3.75812129373E-05 + 3.86485068860E-05 3.97461190961E-05 4.08749047718E-05 4.20357547845E-05 + 4.32295785314E-05 4.44573116697E-05 4.57199187470E-05 4.70183921318E-05 + 4.83537468740E-05 4.97270350235E-05 5.11393328190E-05 5.25917492834E-05 + 5.40854251136E-05 5.56215293122E-05 5.72012725926E-05 5.88258915143E-05 + 6.04966641875E-05 6.22149005091E-05 6.39819473353E-05 6.57991986293E-05 + 6.76680738409E-05 6.95900462715E-05 7.15666211816E-05 7.35993507601E-05 + 7.56898355583E-05 7.78397134899E-05 8.00506731175E-05 8.23244526191E-05 + 8.46628359761E-05 8.70676619505E-05 8.95408203737E-05 9.20842507398E-05 + 9.46999543573E-05 9.73899823408E-05 1.00156453603E-04 1.03001536998E-04 + 1.05927469641E-04 1.08936553157E-04 1.12031152392E-04 1.15213694027E-04 + 1.18486686413E-04 1.21852700454E-04 1.25314377285E-04 1.28874445971E-04 + 1.32535700474E-04 1.36301020549E-04 1.40173367688E-04 1.44155787238E-04 + 1.48251410679E-04 1.52463461312E-04 1.56795253413E-04 1.61250190911E-04 + 1.65831776968E-04 1.70543624043E-04 1.75389438564E-04 1.80373030656E-04 + 1.85498324474E-04 1.90769353735E-04 1.96190268537E-04 2.01765350545E-04 + 2.07498976411E-04 2.13395647991E-04 2.19460004187E-04 2.25696884406E-04 + 2.32111121594E-04 2.38707841515E-04 2.45492211570E-04 2.52469572151E-04 + 2.59645442404E-04 2.67025433750E-04 2.74615436999E-04 2.82421350004E-04 + 2.90449456163E-04 2.98705955802E-04 3.07197447876E-04 3.15930598774E-04 + 3.24912342521E-04 3.34149684852E-04 3.43650013837E-04 3.53420799568E-04 + 3.63469752148E-04 3.73804829499E-04 3.84434189781E-04 3.95366251870E-04 + 4.06609589562E-04 4.18173221002E-04 4.30066160592E-04 4.42297942364E-04 + 4.54878163247E-04 4.67816781342E-04 4.81124129288E-04 4.94810614376E-04 + 5.08887220573E-04 5.23365019364E-04 5.38255489922E-04 5.53570534321E-04 + 5.69322155755E-04 5.85522998112E-04 6.02185821442E-04 6.19323916488E-04 + 6.36950912238E-04 6.55080783415E-04 6.73727931183E-04 6.92907196033E-04 + 7.12633870884E-04 7.32923561721E-04 7.53792578438E-04 7.75257493211E-04 + 7.97335378359E-04 8.20043820702E-04 8.43401019137E-04 8.67425556284E-04 + 8.92136656256E-04 9.17554035763E-04 9.43698001838E-04 9.70589469108E-04 + 9.98250067115E-04 1.02670180260E-03 1.05596751774E-03 1.08607073760E-03 + 1.11703549910E-03 1.14888674232E-03 1.18165005354E-03 1.21535177728E-03 + 1.25001894116E-03 1.28567946896E-03 1.32236221636E-03 1.36009668690E-03 + 1.39891314850E-03 1.43884318471E-03 1.47991899294E-03 1.52217371978E-03 + 1.56564159507E-03 1.61035786022E-03 1.65635879484E-03 1.70368162866E-03 + 1.75236492444E-03 1.80244825754E-03 1.85397237214E-03 1.90697908472E-03 + 1.96151193640E-03 2.01761525206E-03 2.07533490717E-03 2.13471813359E-03 + 2.19581367923E-03 2.25867146368E-03 2.32334341170E-03 2.38988243760E-03 + 2.45834342256E-03 2.52878286945E-03 2.60125894779E-03 2.67583139617E-03 + 2.75256201061E-03 2.83151456039E-03 2.91275440694E-03 2.99634929177E-03 + 3.08236882051E-03 3.17088466045E-03 3.26197075609E-03 3.35570357990E-03 + 3.45216139233E-03 3.55142560572E-03 3.65357939368E-03 3.75870909333E-03 + 3.86690345698E-03 3.97825424219E-03 4.09285560630E-03 4.21080507749E-03 + 4.33220293289E-03 4.45715303595E-03 4.58576239105E-03 4.71814086030E-03 + 4.85440220777E-03 4.99466426031E-03 5.13904763497E-03 5.28767742951E-03 + 5.44068278096E-03 5.59819679816E-03 5.76035645578E-03 5.92730423541E-03 + 6.09918595558E-03 6.27615324290E-03 6.45836179709E-03 6.64597304574E-03 + 6.83915370786E-03 7.03807525987E-03 7.24291549532E-03 7.45385806957E-03 + 7.67109219421E-03 7.89481430587E-03 8.12522611864E-03 8.36253751942E-03 + 8.60696438933E-03 8.85873004650E-03 9.11806606347E-03 9.38521099420E-03 + 9.66041220060E-03 9.94392514701E-03 1.02360139058E-02 1.05369520836E-02 + 1.08470225942E-02 1.11665177297E-02 1.14957406411E-02 1.18350049040E-02 + 1.21846346712E-02 1.25449658881E-02 1.29163463278E-02 1.32991359965E-02 + 1.36937078154E-02 1.41004482122E-02 1.45197568776E-02 1.49520490075E-02 + 1.53977532200E-02 1.58573156963E-02 1.63311968188E-02 1.68198752159E-02 + 1.73238469399E-02 1.78436260174E-02 1.83797456455E-02 1.89327587758E-02 + 1.95032389443E-02 2.00917812932E-02 2.06990038606E-02 2.13255471638E-02 + 2.19720767655E-02 2.26392816462E-02 2.33278834038E-02 2.40386182960E-02 + 2.47722708278E-02 2.55296330011E-02 2.63115430828E-02 2.71188710810E-02 + 2.79525188548E-02 2.88134133684E-02 2.97025348911E-02 3.06208910014E-02 + 3.15695375470E-02 3.25495657094E-02 3.35621130761E-02 3.46083613741E-02 + 3.56895425944E-02 3.68069321704E-02 3.79618701188E-02 3.91557332954E-02 + 4.03899738037E-02 4.16660853846E-02 4.29856312599E-02 4.43502478639E-02 + 4.57616208961E-02 4.72215133324E-02 4.87317662729E-02 5.02942942722E-02 + 5.19110953142E-02 5.35842363144E-02 5.53158863124E-02 5.71083037059E-02 + 5.89638322158E-02 6.08849245658E-02 6.28741214899E-02 6.49340949211E-02 + 6.70676134069E-02 6.92775668783E-02 7.15669586805E-02 7.39389374992E-02 + 7.63967758305E-02 7.89438835505E-02 8.15838112249E-02 8.43202815032E-02 + 8.71571566491E-02 9.00984691927E-02 9.31484117625E-02 9.63113856881E-02 + 9.95919429972E-02 1.02994860836E-01 1.06525098332E-01 1.10187840718E-01 + 1.13988480980E-01 1.17932638450E-01 1.22026184477E-01 1.26275235787E-01 + 1.30686154850E-01 1.35265578750E-01 1.40020428162E-01 1.44957900425E-01 + 1.50085524392E-01 1.55411085402E-01 1.60942731923E-01 1.66688954731E-01 + 1.72658569462E-01 1.78860757946E-01 1.85305081703E-01 1.92001477373E-01 + 1.98960288737E-01 2.06192263141E-01 2.13708606846E-01 2.21520905936E-01 + 2.29641257513E-01 2.38082189851E-01 2.46856719797E-01 2.55978370052E-01 + 2.65461151111E-01 2.75319608925E-01 2.85568797298E-01 2.96224376193E-01 + 3.07302493140E-01 3.18819897159E-01 3.30793928344E-01 3.43242480238E-01 + 3.56184098520E-01 3.69637877952E-01 3.83623546815E-01 3.98161485184E-01 + 4.13272665945E-01 4.28978678904E-01 4.45301771892E-01 4.62264771646E-01 + 4.79891143819E-01 4.98204998838E-01 5.17230986035E-01 5.36994392463E-01 + 5.57521069722E-01 5.78837386455E-01 6.00970270247E-01 6.23947137031E-01 + 6.47795842878E-01 6.72544721443E-01 6.98222410536E-01 7.24857948491E-01 + 7.52480598771E-01 7.81119827105E-01 8.10805276031E-01 8.41566570616E-01 + 8.73433391949E-01 9.06435259249E-01 9.40601430990E-01 9.75960842584E-01 + 1.01254193130E+00 1.05037260144E+00 1.08947994198E+00 1.12989019543E+00 + 1.17162847639E+00 1.21471867253E+00 1.25918330548E+00 1.30504318148E+00 + 1.35231728021E+00 1.40102250846E+00 1.45117359020E+00 1.50278249397E+00 + 1.55585860708E+00 1.61040810528E+00 1.66643393237E+00 1.72393535778E+00 + 1.78290779381E+00 1.84334242059E+00 1.90522605355E+00 1.96854060814E+00 + 2.03326294092E+00 2.09936457357E+00 2.16681137313E+00 2.23556322950E+00 + 2.30557392939E+00 2.37679057064E+00 2.44915382047E+00 2.52259727122E+00 + 2.59704734671E+00 2.67242323360E+00 2.74863686689E+00 2.82559239578E+00 + 2.90318663988E+00 2.98130876565E+00 3.05984025816E+00 3.13865555089E+00 + 3.21762147665E+00 3.29659797731E+00 3.37543811078E+00 3.45398871716E+00 + 3.53209050868E+00 3.60957861190E+00 3.68628338852E+00 3.76203086319E+00 + 3.83664335167E+00 3.90994045037E+00 3.98173981534E+00 4.05185781353E+00 + 4.12011083100E+00 4.18631622316E+00 4.25029305257E+00 4.31186344867E+00 + 4.37085371113E+00 4.42709518833E+00 4.48042558395E+00 4.53068993126E+00 + 4.57774177292E+00 4.62144408576E+00 4.66167006191E+00 4.69830437422E+00 + 4.73124380456E+00 4.76039784881E+00 4.78568937348E+00 4.80705535437E+00 + 4.82444694757E+00 4.83782981828E+00 4.84718440786E+00 4.85250585741E+00 + 4.85380358552E+00 4.85110150250E+00 4.84443728261E+00 4.83386185874E+00 + 4.81943909832E+00 4.80124454289E+00 4.77936528349E+00 4.75389852188E+00 + 4.72495096371E+00 4.69263739128E+00 4.65708021703E+00 4.61840798502E+00 + 4.57675465230E+00 4.53225794158E+00 4.48505870763E+00 4.43529994072E+00 + 4.38312502168E+00 4.32867754087E+00 4.27209946979E+00 4.21353081624E+00 + 4.15310808515E+00 4.09096389810E+00 4.02722560444E+00 3.96201513367E+00 + 3.89544799917E+00 3.82763295438E+00 3.75867174698E+00 3.68865905994E+00 + 3.61768289968E+00 3.54582489318E+00 3.47316127904E+00 3.39976428773E+00 + 3.32570355505E+00 3.25104797908E+00 3.17586789848E+00 3.10023709220E+00 + 3.02423491278E+00 2.94794757329E+00 2.87146932028E+00 2.79490164670E+00 + 2.71835131186E+00 2.64192565851E+00 2.56572951136E+00 2.48986458383E+00 + 2.41442899632E+00 2.33951722812E+00 2.26521985203E+00 2.19162356616E+00 + 2.11881084411E+00 2.04686011367E+00 1.97584530512E+00 1.90583617467E+00 + 1.83689793711E+00 1.76909147517E+00 1.70247307719E+00 1.63709460918E+00 + 1.57300352431E+00 1.51024277300E+00 1.44885093477E+00 1.38886230857E+00 + 1.33030689241E+00 1.27321056573E+00 1.21759496393E+00 1.16347790448E+00 + 1.11087319230E+00 1.05979102581E+00 1.01023780764E+00 9.62216587016E-01 + 9.15726990360E-01 8.70765476538E-01 8.27325436197E-01 7.85397375107E-01 + 7.44969033168E-01 7.06025573643E-01 6.68549773268E-01 6.32522114834E-01 + 5.97921030740E-01 5.64723018638E-01 5.32902728517E-01 5.02433299686E-01 + 4.73286355027E-01 4.45432204722E-01 4.18840051195E-01 3.93478017153E-01 + 3.69313448430E-01 3.46312890162E-01 3.24442320844E-01 3.03667209116E-01 + 2.83952738681E-01 2.65263795176E-01 2.47565165081E-01 2.30821639521E-01 + 2.14998065130E-01 2.00059444855E-01 1.85971093857E-01 1.72698597973E-01 + 1.60208029481E-01 1.48465883489E-01 1.37439244128E-01 1.27095757554E-01 + 1.17403766364E-01 1.08332277939E-01 9.98510700799E-02 9.19306877164E-02 + 8.45424869545E-02 7.76586499317E-02 7.12522065758E-02 6.52970921591E-02 + 5.97681074130E-02 5.46409469648E-02 4.98922047382E-02 4.54993919644E-02 + 4.14409255705E-02 3.76960996452E-02 3.42451164151E-02 3.10690589447E-02 + 2.81498803718E-02 2.54703933365E-02 2.30142521843E-02 2.07659361139E-02 + 1.87107314387E-02 1.68347087664E-02 1.51247048454E-02 1.35682982423E-02 + 1.21537851246E-02 1.08701583320E-02 9.70707905931E-03 8.65485531723E-03 + 7.70441269102E-03 6.84727295020E-03 6.07552456180E-03 5.38179996466E-03 + 4.75924866197E-03 4.20151172562E-03 3.70269818849E-03 3.25735905378E-03 + 2.86046353183E-03 2.50737607788E-03 2.19383248507E-03 1.91591779170E-03 + 1.67004493737E-03 1.45293277307E-03 1.26158690314E-03 1.09327917862E-03 + 9.45529604315E-04 8.16088393126E-04 7.02918223227E-04 6.04178890107E-04 + 5.18211270113E-04 4.43522779721E-04 3.78773919802E-04 3.22764870181E-04 + 2.74423625238E-04 2.32794475713E-04 1.97027379056E-04 1.66368066493E-04 + 1.40148841619E-04 1.17780092523E-04 9.87424215797E-05 8.25794443344E-05 + 6.88911240544E-05 5.73277364653E-05 4.75843179737E-05 3.93956408331E-05 + 3.25316493381E-05 2.67933250514E-05 2.20089781640E-05 1.80308934319E-05 + 1.47323481925E-05 1.20049301207E-05 9.75615813936E-06 7.90737583763E-06 + 6.39187353753E-06 5.15324831849E-06 4.14395490037E-06 3.32403724845E-06 + 2.66001904092E-06 2.12394412105E-06 1.69253946105E-06 1.34649370248E-06 + 1.06983586835E-06 8.49402174819E-07 6.74380360269E-07 5.33610051358E-07 + 4.20775250440E-07 3.30645518360E-07 2.58904920368E-07 2.02004837301E-07 + 1.57038216387E-07 1.21593274660E-07 9.37998176496E-08 7.20873890641E-08 + 5.51896803866E-08 4.20894928769E-08 3.19729341675E-08 2.41913262343E-08 + 1.82297335092E-08 1.36810406996E-08 1.02246978780E-08 7.60936397130E-09 + 5.63879637917E-09 4.16042701048E-09 3.05615799585E-09 2.23497469403E-09 + 1.62704855560E-09 1.17904755214E-09 8.50425821187E-10 6.10501736658E-10 + 4.36167401066E-10 3.10102698300E-10 2.19388437168E-10 1.54435490446E-10 + 1.08161970319E-10 7.53641377837E-11 5.22378845226E-11 3.60167655116E-11 + 2.46995657669E-11 1.68463590948E-11 1.14267090358E-11 7.70726811992E-12 + 5.16903171377E-12 3.44676892010E-12 2.28493451715E-12 1.50576698901E-12 + 9.86341897367E-13 6.42163627547E-13 4.15503518280E-13 2.67162952011E-13 + 1.70691337184E-13 1.08353060632E-13 6.83322083261E-14 4.28078997861E-14 + 2.66376223225E-14 1.64626051859E-14 1.01039475445E-14 6.15786608944E-15 + 3.72625590911E-15 2.23858961534E-15 1.33503026748E-15 7.90273524332E-16 + 4.64288033538E-16 2.70691666379E-16 1.56600266093E-16 8.98860957792E-17 + 5.11830898844E-17 2.89098169372E-17 1.61956826774E-17 8.99782813119E-18 + 4.95689169196E-18 2.70746272354E-18 1.46603475116E-18 7.86866998814E-19 + 4.18581024188E-19 2.20660158338E-19 1.15260059880E-19 5.96468959126E-20 + 3.05769085947E-20 1.55252297761E-20 7.80660708526E-21 3.88692994818E-21 + 1.91606694950E-21 9.35002586707E-22 4.51596755650E-22 2.15854728834E-22 + 1.02089494401E-22 4.77688018394E-23 2.21098384521E-23 1.01213403191E-23 + 4.58177706667E-24 2.05071204030E-24 9.07362132989E-25 3.96817877448E-25 + 1.71500261051E-25 7.32367107048E-26 3.08965222782E-26 1.28745635649E-26 + 5.29812118578E-27 2.15278609631E-27 8.63558389140E-28 3.41912820687E-28 + 1.33595505579E-28 5.15038774950E-29 1.95874223898E-29 7.34717671417E-30 + 2.71759530899E-30 9.91024470924E-31 3.56231402690E-31 1.26194363463E-31 + 4.40471798256E-32 1.51452319875E-32 5.12886520628E-33 1.71025488293E-33 + 5.61435490837E-34 1.81402156960E-34 5.76754733470E-35 1.80404458361E-35 + 5.55022617331E-36 1.67911272315E-36 4.99403745760E-37 1.45989680829E-37 + 4.19358067759E-38 1.18340369806E-38 3.27987374631E-39 8.92579917158E-40 + 2.38446518904E-40 6.25136878710E-41 1.60799396004E-41 4.05697263557E-42 + 1.00371328073E-42 2.43437323464E-43 5.78645622943E-44 1.34760578371E-44 + 3.07406020075E-45 6.86648148577E-46 1.50141145502E-46 3.21275911361E-47 + 6.72569451395E-48 1.37702672458E-48 2.75649759556E-49 5.39317854276E-50 + 1.03101230316E-50 1.92518603927E-51 3.51016359767E-52 6.24714708090E-53 + 1.08489497981E-53 1.83778643447E-54 3.03564833437E-55 4.88767643448E-56 + 7.66816303053E-57 1.17181572046E-57 1.74359369558E-58 2.52514229763E-59 + 3.55807698644E-60 4.87602332265E-61 6.49631007380E-62 8.41095924608E-63 + 1.05785676058E-63 1.29191266250E-64 1.53138401894E-65 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 0.00000000000E+00 + 0.00000000000E+00 + diff --git a/tests/apps/miniDFT/tests/espresso/benchmark/Ti.pbe.UPF b/tests/apps/miniDFT/tests/espresso/benchmark/Ti.pbe.UPF new file mode 100644 index 0000000000..6ed290fce4 --- /dev/null +++ b/tests/apps/miniDFT/tests/espresso/benchmark/Ti.pbe.UPF @@ -0,0 +1,2743 @@ + + + Generated using "atomic" code by A. Dal Corso (Quantum ESPRESSO distribution) + Author: AM + Generation date: 15Apr2011 + Pseudopotential type: NC + Element: Ti + Functional: PBE + + Suggested minimum cutoff for wavefunctions: 0. Ry + Suggested minimum cutoff for charge density: 0. Ry + The Pseudo was generated with a Scalar-Relativistic Calculation + L component and cutoff radius for Local Potential: 0 0.9000 + + Valence configuration: + nl pn l occ Rcut Rcut US E pseu + 3P 2 1 6.00 0.900 0.900 -6.571781 + 3D 3 2 0.00 1.000 1.000 -3.841409 + 3S 1 0 2.00 0.943 0.943 -8.373940 + Generation configuration: + 3P 2 1 6.00 0.900 0.900 -6.571733 + 3D 3 2 0.00 1.000 1.000 -3.841449 + 3S 1 0 2.00 0.900 0.900 -8.373822 + + Pseudization used: troullier-martins + + + + + + + + 4.144918025247801E-005 4.197054675768283E-005 4.249847124620828E-005 4.303303620732972E-005 + 4.357432516790999E-005 4.412242270545040E-005 4.467741446130630E-005 4.523938715406870E-005 + 4.580842859311411E-005 4.638462769232521E-005 4.696807448398350E-005 4.755886013283720E-005 + 4.815707695034592E-005 4.876281840910440E-005 4.937617915744808E-005 4.999725503424174E-005 + 5.062614308385469E-005 5.126294157132420E-005 5.190774999770943E-005 5.256066911563899E-005 + 5.322180094505338E-005 5.389124878914604E-005 5.456911725050459E-005 5.525551224745521E-005 + 5.595054103061277E-005 5.665431219963862E-005 5.736693572020975E-005 5.808852294120111E-005 + 5.881918661208400E-005 5.955904090054364E-005 6.030820141031780E-005 6.106678519926031E-005 + 6.183491079763153E-005 6.261269822661895E-005 6.340026901709085E-005 6.419774622858552E-005 + 6.500525446853975E-005 6.582291991175889E-005 6.665087032013196E-005 6.748923506259485E-005 + 6.833814513534419E-005 6.919773318230599E-005 7.006813351586138E-005 7.094948213783328E-005 + 7.184191676073714E-005 7.274557682929838E-005 7.366060354224122E-005 7.458713987435118E-005 + 7.552533059881518E-005 7.647532230984278E-005 7.743726344557155E-005 7.841130431126101E-005 + 7.939759710277816E-005 8.039629593037822E-005 8.140755684278499E-005 8.243153785157342E-005 + 8.346839895585942E-005 8.451830216730004E-005 8.558141153540807E-005 8.665789317318529E-005 + 8.774791528307769E-005 8.885164818325759E-005 8.996926433423621E-005 9.110093836581087E-005 + 9.224684710435155E-005 9.340716960042995E-005 9.458208715679679E-005 9.577178335671064E-005 + 9.697644409262310E-005 9.819625759522520E-005 9.943141446285842E-005 1.006821076912962E-004 + 1.019485327039001E-004 1.032308873821549E-004 1.045293720965880E-004 1.058441897380779E-004 + 1.071755457495560E-004 1.085236481581079E-004 1.098887076074774E-004 1.112709373909811E-004 + 1.126705534848345E-004 1.140877745818999E-004 1.155228221258572E-004 1.169759203458045E-004 + 1.184472962912954E-004 1.199371798678146E-004 1.214458038727023E-004 1.229734040315285E-004 + 1.245202190349258E-004 1.260864905758858E-004 1.276724633875233E-004 1.292783852813167E-004 + 1.309045071858292E-004 1.325510831859167E-004 1.342183705624294E-004 1.359066298324118E-004 + 1.376161247898098E-004 1.393471225466883E-004 1.410998935749686E-004 1.428747117486900E-004 + 1.446718543868030E-004 1.464916022965012E-004 1.483342398170977E-004 1.502000548644537E-004 + 1.520893389759669E-004 1.540023873561233E-004 1.559394989226243E-004 1.579009763530933E-004 + 1.598871261323695E-004 1.618982586003968E-004 1.639346880007150E-004 1.659967325295611E-004 + 1.680847143855878E-004 1.701989598202082E-004 1.723397991885731E-004 1.745075670011893E-004 + 1.767026019761877E-004 1.789252470922492E-004 1.811758496421950E-004 1.834547612872527E-004 + 1.857623381120030E-004 1.880989406800198E-004 1.904649340902081E-004 1.928606880338518E-004 + 1.952865768523791E-004 1.977429795958531E-004 2.002302800822003E-004 2.027488669571819E-004 + 2.052991337551212E-004 2.078814789603942E-004 2.104963060696930E-004 2.131440236550732E-004 + 2.158250454277944E-004 2.185397903029630E-004 2.212886824649892E-004 2.240721514338660E-004 + 2.268906321322826E-004 2.297445649535825E-004 2.326343958305751E-004 2.355605763052148E-004 + 2.385235635991538E-004 2.415238206851853E-004 2.445618163595828E-004 2.476380253153511E-004 + 2.507529282163987E-004 2.539070117726409E-004 2.571007688160504E-004 2.603346983776630E-004 + 2.636093057655519E-004 2.669251026437842E-004 2.702826071123679E-004 2.736823437882072E-004 + 2.771248438870744E-004 2.806106453066137E-004 2.841402927103891E-004 2.877143376129885E-004 + 2.913333384661993E-004 2.949978607462676E-004 2.987084770422551E-004 3.024657671455079E-004 + 3.062703181402485E-004 3.101227244953103E-004 3.140235881570242E-004 3.179735186432732E-004 + 3.219731331387330E-004 3.260230565913045E-004 3.301239218097678E-004 3.342763695626562E-004 + 3.384810486783790E-004 3.427386161466034E-004 3.470497372209074E-004 3.514150855227305E-004 + 3.558353431466261E-004 3.603112007668406E-004 3.648433577452346E-004 3.694325222405551E-004 + 3.740794113190923E-004 3.787847510667186E-004 3.835492767023423E-004 3.883737326927885E-004 + 3.932588728691197E-004 3.982054605444285E-004 4.032142686331026E-004 4.082860797715962E-004 + 4.134216864407193E-004 4.186218910894609E-004 4.238875062603785E-004 4.292193547165551E-004 + 4.346182695701593E-004 4.400850944126224E-004 4.456206834464467E-004 4.512259016186824E-004 + 4.569016247560721E-004 4.626487397019031E-004 4.684681444545795E-004 4.743607483079320E-004 + 4.803274719933025E-004 4.863692478234058E-004 4.924870198380069E-004 4.986817439514312E-004 + 5.049543881019231E-004 5.113059324028938E-004 5.177373692960626E-004 5.242497037065282E-004 + 5.308439531997933E-004 5.375211481407553E-004 5.442823318547100E-004 5.511285607903681E-004 + 5.580609046849289E-004 5.650804467312315E-004 5.721882837469999E-004 5.793855263462304E-004 + 5.866732991127215E-004 5.940527407757945E-004 6.015250043882246E-004 6.090912575064013E-004 + 6.167526823727698E-004 6.245104761005520E-004 6.323658508608008E-004 6.403200340718061E-004 + 6.483742685908753E-004 6.565298129085399E-004 6.647879413451919E-004 6.731499442502000E-004 + 6.816171282035326E-004 6.901908162199066E-004 6.988723479555197E-004 7.076630799173677E-004 + 7.165643856752040E-004 7.255776560761647E-004 7.347042994620852E-004 7.439457418895648E-004 + 7.533034273527843E-004 7.627788180091345E-004 7.723733944076856E-004 7.820886557205174E-004 + 7.919261199769780E-004 8.018873243008710E-004 8.119738251506379E-004 8.221871985625597E-004 + 8.325290403970082E-004 8.430009665878129E-004 8.536046133947459E-004 8.643416376591935E-004 + 8.752137170630423E-004 8.862225503908180E-004 8.973698577951265E-004 9.086573810654287E-004 + 9.200868839001996E-004 9.316601521825118E-004 9.433789942590792E-004 9.552452412228196E-004 + 9.672607471989625E-004 9.794273896347623E-004 9.917470695928533E-004 1.004221712048293E-003 + 1.016853266189346E-003 1.029643705722044E-003 1.042595029178588E-003 1.055709260229617E-003 + 1.068988448000414E-003 1.082434667391085E-003 1.096050019400767E-003 1.109836631455911E-003 + 1.123796657742700E-003 1.137932279543643E-003 1.152245705578407E-003 1.166739172348929E-003 + 1.181414944488879E-003 1.196275315117514E-003 1.211322606197977E-003 1.226559168900113E-003 + 1.241987383967844E-003 1.257609662091163E-003 1.273428444282810E-003 1.289446202259686E-003 + 1.305665438829065E-003 1.322088688279658E-003 1.338718516777604E-003 1.355557522767441E-003 + 1.372608337378114E-003 1.389873624834095E-003 1.407356082871677E-003 1.425058443160495E-003 + 1.442983471730361E-003 1.461133969403458E-003 1.479512772231974E-003 1.498122751941244E-003 + 1.516966816378458E-003 1.536047909967025E-003 1.555369014166638E-003 1.574933147939137E-003 + 1.594743368220229E-003 1.614802770397135E-003 1.635114488792258E-003 1.655681697152920E-003 + 1.676507609147273E-003 1.697595478866437E-003 1.718948601332958E-003 1.740570313015666E-003 + 1.762463992351000E-003 1.784633060270901E-003 1.807080980737333E-003 1.829811261283539E-003 + 1.852827453562101E-003 1.876133153899889E-003 1.899732003859996E-003 1.923627690810742E-003 + 1.947823948501827E-003 1.972324557647745E-003 1.997133346518519E-003 2.022254191537887E-003 + 2.047691017888992E-003 2.073447800127700E-003 2.099528562803642E-003 2.125937381089044E-003 + 2.152678381415497E-003 2.179755742118704E-003 2.207173694091362E-003 2.234936521444254E-003 + 2.263048562175634E-003 2.291514208849063E-003 2.320337909279746E-003 2.349524167229519E-003 + 2.379077543110563E-003 2.409002654697991E-003 2.439304177851370E-003 2.469986847245341E-003 + 2.501055457109421E-003 2.532514861977109E-003 2.564369977444425E-003 2.596625780937968E-003 + 2.629287312492658E-003 2.662359675539253E-003 2.695848037701760E-003 2.729757631604907E-003 + 2.764093755691726E-003 2.798861775051465E-003 2.834067122257884E-003 2.869715298218108E-003 + 2.905811873032162E-003 2.942362486863298E-003 2.979372850819289E-003 3.016848747844802E-003 + 3.054796033624989E-003 3.093220637500463E-003 3.132128563393754E-003 3.171525890747439E-003 + 3.211418775474074E-003 3.251813450918055E-003 3.292716228829612E-003 3.334133500351006E-003 + 3.376071737015178E-003 3.418537491756929E-003 3.461537399936833E-003 3.505078180378032E-003 + 3.549166636416053E-003 3.593809656961849E-003 3.639014217578208E-003 3.684787381569693E-003 + 3.731136301086309E-003 3.778068218241025E-003 3.825590466241382E-003 3.873710470535313E-003 + 3.922435749971386E-003 3.971773917973654E-003 4.021732683731242E-003 4.072319853402942E-003 + 4.123543331336934E-003 4.175411121305859E-003 4.227931327757431E-003 4.281112157080758E-003 + 4.334961918888621E-003 4.389489027315858E-003 4.444702002334093E-003 4.500609471083014E-003 + 4.557220169218352E-003 4.614542942276868E-003 4.672586747058474E-003 4.731360653025756E-003 + 4.790873843721106E-003 4.851135618201646E-003 4.912155392492241E-003 4.973942701056772E-003 + 5.036507198287908E-003 5.099858660015624E-003 5.164006985034717E-003 5.228962196651474E-003 + 5.294734444249865E-003 5.361334004877390E-003 5.428771284850892E-003 5.497056821382577E-003 + 5.566201284226452E-003 5.636215477345513E-003 5.707110340599878E-003 5.778896951456163E-003 + 5.851586526718374E-003 5.925190424280532E-003 5.999720144901377E-003 6.075187334001387E-003 + 6.151603783482396E-003 6.228981433570113E-003 6.307332374679786E-003 6.386668849305372E-003 + 6.467003253932440E-003 6.548348140975149E-003 6.630716220737610E-003 6.714120363399857E-003 + 6.798573601028869E-003 6.884089129614849E-003 6.970680311133112E-003 7.058360675631955E-003 + 7.147143923346712E-003 7.237043926840470E-003 7.328074733171677E-003 7.420250566089018E-003 + 7.513585828253935E-003 7.608095103491025E-003 7.703793159066827E-003 7.800694947997220E-003 + 7.898815611383871E-003 7.998170480780069E-003 8.098775080586295E-003 8.200645130475949E-003 + 8.303796547851581E-003 8.408245450332013E-003 8.514008158270775E-003 8.621101197306151E-003 + 8.729541300943373E-003 8.839345413169258E-003 8.950530691099729E-003 9.063114507660690E-003 + 9.177114454302521E-003 9.292548343748822E-003 9.409434212779672E-003 9.527790325049900E-003 + 9.647635173942869E-003 9.768987485460030E-003 9.891866221146954E-003 1.001629058105609E-002 + 1.014228000674681E-002 1.026985418432322E-002 1.039903304751011E-002 1.052983678076768E-002 + 1.066228582244536E-002 1.079640086797537E-002 1.093220287310646E-002 1.106971305717822E-002 + 1.120895290643666E-002 1.134994417739153E-002 1.149270890021575E-002 1.163726938218773E-002 + 1.178364821117689E-002 1.193186825917306E-002 1.208195268586031E-002 1.223392494223563E-002 + 1.238780877427330E-002 1.254362822663515E-002 1.270140764642761E-002 1.286117168700605E-002 + 1.302294531182682E-002 1.318675379834797E-002 1.335262274197877E-002 1.352057806007912E-002 + 1.369064599600919E-002 1.386285312322997E-002 1.403722634945545E-002 1.421379292085699E-002 + 1.439258042632061E-002 1.457361680175777E-002 1.475693033447044E-002 1.494254966757110E-002 + 1.513050380445817E-002 1.532082211334793E-002 1.551353433186336E-002 1.570867057168066E-002 + 1.590626132323434E-002 1.610633746048131E-002 1.630893024572508E-002 1.651407133450052E-002 + 1.672179278052011E-002 1.693212704068241E-002 1.714510698014350E-002 1.736076587745223E-002 + 1.757913742975007E-002 1.780025575803632E-002 1.802415541249968E-002 1.825087137791667E-002 + 1.848043907911815E-002 1.871289438652449E-002 1.894827362175038E-002 1.918661356328025E-002 + 1.942795145221485E-002 1.967232499809034E-002 1.991977238477044E-002 2.017033227641272E-002 + 2.042404382351008E-002 2.068094666900790E-002 2.094108095449846E-002 2.120448732649312E-002 + 2.147120694277339E-002 2.174128147882201E-002 2.201475313433467E-002 2.229166463981393E-002 + 2.257205926324590E-002 2.285598081686095E-002 2.314347366397951E-002 2.343458272594383E-002 + 2.372935348913711E-002 2.402783201209080E-002 2.433006493268138E-002 2.463609947541760E-002 + 2.494598345881939E-002 2.525976530288962E-002 2.557749403667983E-002 2.589921930595105E-002 + 2.622499138093122E-002 2.655486116416982E-002 2.688888019849161E-002 2.722710067505026E-002 + 2.756957544148334E-002 2.791635801016991E-002 2.826750256659183E-002 2.862306397780047E-002 + 2.898309780098972E-002 2.934766029217691E-002 2.971680841499307E-002 3.009059984958337E-002 + 3.046909300161998E-002 3.085234701142795E-002 3.124042176322601E-002 3.163337789448373E-002 + 3.203127680539607E-002 3.243418066847741E-002 3.284215243827603E-002 3.325525586121099E-002 + 3.367355548553264E-002 3.409711667140827E-002 3.452600560113495E-002 3.496028928948050E-002 + 3.540003559415477E-002 3.584531322641258E-002 3.629619176178988E-002 3.675274165097513E-002 + 3.721503423081739E-002 3.768314173547274E-002 3.815713730769125E-002 3.863709501024538E-002 + 3.912308983750265E-002 3.961519772714357E-002 4.011349557202706E-002 4.061806123220527E-002 + 4.112897354708908E-002 4.164631234776719E-002 4.217015846947970E-002 4.270059376424890E-002 + 4.323770111366882E-002 4.378156444185555E-002 4.433226872856060E-002 4.488990002244918E-002 + 4.545454545454546E-002 4.602629325184703E-002 4.660523275111042E-002 4.719145441281025E-002 + 4.778504983527385E-002 4.838611176899361E-002 4.899473413111963E-002 4.961101202013418E-002 + 5.023504173071128E-002 5.086692076876279E-002 5.150674786667393E-002 5.215462299873057E-002 + 5.281064739674016E-002 5.347492356584960E-002 5.414755530056177E-002 5.482864770095366E-002 + 5.551830718909864E-002 5.621664152569478E-002 5.692375982690296E-002 5.763977258139638E-002 + 5.836479166762461E-002 5.909893037129506E-002 5.984230340307373E-002 6.059502691650925E-002 + 6.135721852618201E-002 6.212899732608165E-002 6.291048390821598E-002 6.370180038145336E-002 + 6.450307039060264E-002 6.531441913573298E-002 6.613597339173642E-002 6.696786152813708E-002 + 6.781021352914868E-002 6.866316101398516E-002 6.952683725742635E-002 7.040137721064242E-002 + 7.128691752228042E-002 7.218359655981564E-002 7.309155443117199E-002 7.401093300661414E-002 + 7.494187594091492E-002 7.588452869580196E-002 7.683903856268599E-002 7.780555468567570E-002 + 7.878422808488166E-002 7.977521168001357E-002 8.077866031427448E-002 8.179473077855497E-002 + 8.282358183593228E-002 8.386537424647732E-002 8.492027079237374E-002 8.598843630335319E-002 + 8.707003768244985E-002 8.816524393207978E-002 8.927422618044766E-002 9.039715770828599E-002 + 9.153421397593077E-002 9.268557265073708E-002 9.385141363484034E-002 9.503191909326623E-002 + 9.622727348239431E-002 9.743766357877998E-002 9.866327850833832E-002 9.990430977589559E-002 + 1.011609512951122E-001 1.024333994187822E-001 1.037218529695138E-001 1.050265132707957E-001 + 1.063475841784542E-001 1.076852721125064E-001 1.090397860894135E-001 1.104113377547404E-001 + 1.118001414162250E-001 1.132064140772651E-001 1.146303754708250E-001 1.160722480937694E-001 + 1.175322572416294E-001 1.190106310438046E-001 1.205076004992094E-001 1.220233995123669E-001 + 1.235582649299566E-001 1.251124365778231E-001 1.266861572984478E-001 1.282796729888954E-001 + 1.298932326392348E-001 1.315270883714437E-001 1.331814954788048E-001 1.348567124657940E-001 + 1.365530010884742E-001 1.382706263953939E-001 1.400098567690014E-001 1.417709639675816E-001 + 1.435542231677168E-001 1.453599130072852E-001 1.471883156289983E-001 1.490397167244852E-001 + 1.509144055789342E-001 1.528126751162923E-001 1.547348219450372E-001 1.566811464045217E-001 + 1.586519526119019E-001 1.606475485096579E-001 1.626682459137082E-001 1.647143605621337E-001 + 1.667862121645112E-001 1.688841244518684E-001 1.710084252272688E-001 1.731594464170301E-001 + 1.753375241225897E-001 1.775429986730207E-001 1.797762146782081E-001 1.820375210826968E-001 + 1.843272712202126E-001 1.866458228688732E-001 1.889935383070914E-001 1.913707843701800E-001 + 1.937779325076737E-001 1.962153588413657E-001 1.986834442240799E-001 2.011825742991790E-001 + 2.037131395608211E-001 2.062755354149776E-001 2.088701622412132E-001 2.114974254552486E-001 + 2.141577355723066E-001 2.168515082712547E-001 2.195791644595584E-001 2.223411303390457E-001 + 2.251378374725052E-001 2.279697228511165E-001 2.308372289627310E-001 2.337408038610133E-001 + 2.366809012354477E-001 2.396579804822314E-001 2.426725067760536E-001 2.457249511427803E-001 + 2.488157905330548E-001 2.519455078968193E-001 2.551145922587797E-001 2.583235387948158E-001 + 2.615728489093514E-001 2.648630303137036E-001 2.681945971054099E-001 2.715680698485601E-001 + 2.749839756551341E-001 2.784428482673630E-001 2.819452281411305E-001 2.854916625304166E-001 + 2.890827055728104E-001 2.927189183760938E-001 2.964008691059142E-001 3.001291330745652E-001 + 3.039042928308760E-001 3.077269382512397E-001 3.115976666317810E-001 3.155170827816834E-001 + 3.194857991176955E-001 3.235044357598180E-001 3.275736206282029E-001 3.316939895412653E-001 + 3.358661863150296E-001 3.400908628637312E-001 3.443686793016749E-001 3.487003040463831E-001 + 3.530864139230354E-001 3.575276942702224E-001 3.620248390470355E-001 3.665785509414943E-001 + 3.711895414803476E-001 3.758585311402488E-001 3.805862494603302E-001 3.853734351561992E-001 + 3.902208362353589E-001 3.951292101140910E-001 4.000993237358006E-001 4.051319536908517E-001 + 4.102278863379150E-001 4.153879179268331E-001 4.206128547230404E-001 4.259035131335425E-001 + 4.312607198344784E-001 4.366853119002960E-001 4.421781369345403E-001 4.477400532022991E-001 + 4.533719297643058E-001 4.590746466127297E-001 4.648490948086823E-001 4.706961766214407E-001 + 4.766168056694350E-001 4.826119070630005E-001 4.886824175489252E-001 4.948292856568249E-001 + 5.010534718473457E-001 5.073559486622439E-001 5.137377008763450E-001 5.201997256514146E-001 + 5.267430326919729E-001 5.333686444030552E-001 5.400775960499725E-001 5.468709359200700E-001 + 5.537497254865215E-001 5.607150395741939E-001 5.677679665275824E-001 5.749096083808737E-001 + 5.821410810301383E-001 5.894635144076878E-001 5.968780526586377E-001 6.043858543196722E-001 + 6.119880925000777E-001 6.196859550650348E-001 6.274806448212316E-001 6.353733797048021E-001 + 6.433653929716276E-001 6.514579333900431E-001 6.596522654359511E-001 6.679496694904065E-001 + 6.763514420396750E-001 6.848588958778087E-001 6.934733603117809E-001 7.021961813691830E-001 + 7.110287220085533E-001 7.199723623323379E-001 7.290284998025307E-001 7.381985494590390E-001 + 7.474839441407756E-001 7.568861347095520E-001 7.664065902767749E-001 7.760467984329936E-001 + 7.858082654803483E-001 7.956925166679223E-001 8.057010964300747E-001 8.158355686277571E-001 + 8.260975167928667E-001 8.364885443756851E-001 8.470102749954098E-001 8.576643526938583E-001 + 8.684524421923485E-001 8.793762291518099E-001 8.904374204361827E-001 9.016377443791060E-001 + 9.129789510539849E-001 9.244628125474376E-001 9.360911232361834E-001 9.478657000674289E-001 + 9.597883828427558E-001 9.718610345056065E-001 9.840855414323670E-001 9.964638137271123E-001 + 1.008997785520076E+000 1.021689415269847E+000 1.034540686069397E+000 1.047553605955936E+000 + 1.060730208224669E+000 1.074072551746511E+000 1.087582721289780E+000 1.101262827845954E+000 + 1.115115008959517E+000 1.129141429061948E+000 1.143344279809927E+000 1.157725780427777E+000 + 1.172288178054230E+000 1.187033748093545E+000 1.201964794571037E+000 1.217083650493098E+000 + 1.232392678211723E+000 1.247894269793641E+000 1.263590847394077E+000 1.279484863635212E+000 + 1.295578801989423E+000 1.311875177167320E+000 1.328376535510679E+000 1.345085455390317E+000 + 1.362004547608956E+000 1.379136455809180E+000 1.396483856886497E+000 1.414049461407621E+000 + 1.431836014033999E+000 1.449846293950659E+000 1.468083115300487E+000 1.486549327623917E+000 + 1.505247816304196E+000 1.524181503018226E+000 1.543353346193071E+000 1.562766341468238E+000 + 1.582423522163730E+000 1.602327959754025E+000 1.622482764347996E+000 1.642891085174861E+000 + 1.663556111076274E+000 1.684481071004573E+000 1.705669234527318E+000 1.727123912338173E+000 + 1.748848456774188E+000 1.770846262339637E+000 1.793120766236389E+000 1.815675448900997E+000 + 1.838513834548520E+000 1.861639491723173E+000 1.885056033855946E+000 1.908767119829182E+000 + 1.932776454548308E+000 1.957087789520725E+000 1.981704923441978E+000 2.006631702789331E+000 + 2.031872022422766E+000 2.057429826193580E+000 2.083309107560614E+000 2.109513910214226E+000 + 2.136048328708152E+000 2.162916509099259E+000 2.190122649595401E+000 2.217671001211384E+000 + 2.245565868433190E+000 2.273811609890582E+000 2.302412639038121E+000 2.331373424844805E+000 + 2.360698492492340E+000 2.390392424082203E+000 2.420459859351622E+000 2.450905496398526E+000 + 2.481734092415647E+000 2.512950464433840E+000 2.544559490074734E+000 2.576566108312903E+000 + 2.608975320247556E+000 2.641792189883999E+000 2.675021844924884E+000 2.708669477571409E+000 + 2.742740345334639E+000 2.777239771856971E+000 2.812173147743995E+000 2.847545931406769E+000 + 2.883363649914697E+000 2.919631899859179E+000 2.956356348228046E+000 2.993542733291077E+000 + 3.031196865496601E+000 3.069324628379370E+000 3.107931979479919E+000 3.147024951275393E+000 + 3.186609652122175E+000 3.226692267210315E+000 3.267279059529958E+000 3.308376370849988E+000 + 3.349990622708902E+000 3.392128317418223E+000 3.434796039078485E+000 3.478000454607995E+000 + 3.521748314784590E+000 3.566046455300416E+000 3.610901797830060E+000 3.656321351112060E+000 + 3.702312212044006E+000 3.748881566791505E+000 3.796036691910967E+000 3.843784955486636E+000 + 3.892133818281848E+000 3.941090834904768E+000 3.990663654988860E+000 4.040860024388106E+000 + 4.091687786387355E+000 4.143154882927838E+000 4.195269355848086E+000 4.248039348140534E+000 + 4.301473105223825E+000 4.355578976231222E+000 4.410365415315156E+000 4.465840982968185E+000 + 4.522014347360634E+000 4.578894285694960E+000 4.636489685577259E+000 4.694809546405948E+000 + 4.753862980777919E+000 4.813659215912455E+000 4.874207595092934E+000 4.935517579126800E+000 + 4.997598747823800E+000 5.060460801492834E+000 5.124113562457697E+000 5.188566976591774E+000 + 5.253831114872167E+000 5.319916174953269E+000 5.386832482760152E+000 5.454590494102071E+000 + 5.523200796306135E+000 5.592674109871661E+000 5.663021290145248E+000 5.734253329016917E+000 + 5.806381356637683E+000 5.879416643158589E+000 5.953370600491755E+000 6.028254784093485E+000 + 6.104080894769797E+000 6.180860780504778E+000 6.258606438311760E+000 6.337330016107962E+000 + 6.417043814612591E+000 6.497760289268819E+000 6.579492052190052E+000 6.662251874130508E+000 + 6.746052686480755E+000 6.830907583288226E+000 6.916829823303164E+000 7.003832832050406E+000 + 7.091930203927050E+000 7.181135704326703E+000 7.271463271790304E+000 7.362927020184016E+000 + 7.455541240904636E+000 7.549320405112550E+000 7.644279165992975E+000 7.740432361045507E+000 + 7.837795014402470E+000 7.936382339176566E+000 8.036209739837838E+000 8.137292814620757E+000 + 8.239647357961426E+000 8.343289362965454E+000 8.448235023907015E+000 8.554500738759113E+000 + 8.662103111755910E+000 8.771058955987117E+000 8.881385296025043E+000 8.993099370584806E+000 + 9.106218635217811E+000 9.220760765039314E+000 9.336743657490153E+000 9.454185435133210E+000 + 9.573104448485216E+000 9.693519278883912E+000 9.815448741391551E+000 9.938911887734735E+000 + 1.006392800928123E+001 1.019051664005442E+001 1.031869755978537E+001 1.044849079700358E+001 + 1.057991663216647E+001 1.071299560082812E+001 1.084774849684818E+001 1.098419637564076E+001 + 1.112236055746456E+001 1.126226263075411E+001 1.140392445549294E+001 1.154736816662942E+001 + 1.169261617753523E+001 1.183969118350758E+001 1.198861616531542E+001 1.213941439279010E+001 + 1.229210942846150E+001 1.244672513123957E+001 1.260328566014245E+001 1.276181547807134E+001 + 1.292233935563277E+001 1.308488237500924E+001 1.324946993387819E+001 1.341612774938056E+001 + 1.358488186213912E+001 1.375575864032727E+001 1.392878478378930E+001 1.410398732821211E+001 + 1.428139364934974E+001 1.446103146730082E+001 1.464292885083984E+001 1.482711422180311E+001 + 1.501361635952949E+001 1.520246440535750E+001 1.539368786717853E+001 1.558731662404747E+001 + 1.578338093085159E+001 1.598191142303767E+001 1.618293912139905E+001 1.638649543692262E+001 + 1.659261217569677E+001 1.680132154388133E+001 1.701265615273964E+001 1.722664902373434E+001 + 1.744333359368692E+001 1.766274372000222E+001 1.788491368595893E+001 1.810987820606618E+001 + 1.833767243148796E+001 1.856833195553548E+001 1.880189281922858E+001 1.903839151692747E+001 + 1.927786500203475E+001 1.952035069276972E+001 1.976588647801494E+001 2.001451072323631E+001 + 2.026626227647807E+001 2.052118047443252E+001 2.077930514858677E+001 2.104067663144635E+001 + 2.130533576283714E+001 2.157332389628695E+001 2.184468290548679E+001 2.211945519083396E+001 + 2.239768368605712E+001 2.267941186492464E+001 2.296468374803770E+001 2.325354390970837E+001 + 2.354603748492464E+001 2.384221017640275E+001 2.414210826172823E+001 2.444577860058715E+001 + 2.475326864208770E+001 2.506462643217449E+001 2.537990062113573E+001 2.569914047120478E+001 + 2.602239586425781E+001 2.634971730960757E+001 2.668115595189586E+001 2.701676357908492E+001 + 2.735659263054919E+001 2.770069620526946E+001 2.804912807012926E+001 2.840194266831640E+001 + 2.875919512782973E+001 2.912094127009277E+001 2.948723761867632E+001 2.985814140812999E+001 + 3.023371059292554E+001 3.061400385651225E+001 3.099908062048616E+001 3.138900105387520E+001 + 3.178382608254026E+001 3.218361739869543E+001 3.258843747054727E+001 3.299834955205552E+001 + 3.341341769281700E+001 3.383370674807305E+001 3.425928238884369E+001 3.469021111218871E+001 + 3.512656025159772E+001 3.556839798751167E+001 3.601579335797555E+001 3.646881626942632E+001 + 3.692753750761563E+001 3.739202874867011E+001 3.786236257029131E+001 3.833861246309561E+001 + 3.882085284209780E+001 3.930915905833826E+001 3.980360741065663E+001 4.030427515761406E+001 + 4.081124052956447E+001 4.132458274087874E+001 4.184438200232186E+001 4.237071953358583E+001 + 4.290367757598090E+001 4.344333940528534E+001 4.398978934475803E+001 4.454311277831383E+001 + 4.510339616386483E+001 4.567072704683008E+001 4.624519407381415E+001 4.682688700645881E+001 + 4.741589673546837E+001 4.801231529481115E+001 4.861623587610064E+001 4.922775284315619E+001 + 4.984696174674811E+001 5.047395933952750E+001 5.110884359114366E+001 5.175171370355278E+001 + 5.240267012651766E+001 5.306181457330388E+001 5.372925003657236E+001 5.440508080447198E+001 + 5.508941247693538E+001 5.578235198217849E+001 5.648400759340890E+001 5.719448894574348E+001 + 5.791390705333882E+001 5.864237432673811E+001 5.938000459043467E+001 6.012691310065807E+001 + 6.088321656338269E+001 6.164903315256311E+001 6.242448252859965E+001 6.320968585703477E+001 + 6.400476582748617E+001 6.480984667281692E+001 6.562505418854684E+001 6.645051575250906E+001 + 6.728636034475211E+001 6.813271856769418E+001 6.898972266652969E+001 6.985750654989238E+001 + 7.073620581077982E+001 7.162595774773901E+001 7.252690138632042E+001 7.343917750080070E+001 + 7.436292863617849E+001 7.529829913044841E+001 7.624543513715288E+001 7.720448464822010E+001 + 7.817559751708747E+001 7.915892548211623E+001 8.015462219030179E+001 8.116284322128031E+001 + 8.218374611163924E+001 8.321749037953238E+001 8.426423754960447E+001 8.532415117823076E+001 + 8.639739687907185E+001 8.748414234895215E+001 8.858455739406249E+001 8.969881395649219E+001 + 9.082708614109640E+001 9.196955024269914E+001 9.312638477364081E+001 9.429777049167060E+001 + 9.548389042818989E+001 9.668492991685221E+001 9.790107662252090E+001 9.913252057059316E+001 + 1.003794541766914E+002 + + + 5.181147531559752E-007 5.246318344710354E-007 5.312308905776035E-007 5.379129525916215E-007 + 5.446790645988750E-007 5.515302838181300E-007 5.584676807663288E-007 5.654923394258587E-007 + 5.726053574139265E-007 5.798078461540652E-007 5.871009310497938E-007 5.944857516604651E-007 + 6.019634618793240E-007 6.095352301138051E-007 6.172022394681011E-007 6.249656879280218E-007 + 6.328267885481837E-007 6.407867696415525E-007 6.488468749713680E-007 6.570083639454874E-007 + 6.652725118131673E-007 6.736406098643256E-007 6.821139656313074E-007 6.906939030931902E-007 + 6.993817628826597E-007 7.081789024954827E-007 7.170866965026219E-007 7.261065367650139E-007 + 7.352398326510501E-007 7.444880112567955E-007 7.538525176289725E-007 7.633348149907539E-007 + 7.729363849703942E-007 7.826587278327370E-007 7.925033627136357E-007 8.024718278573191E-007 + 8.125656808567469E-007 8.227864988969862E-007 8.331358790016495E-007 8.436154382824357E-007 + 8.542268141918024E-007 8.649716647788249E-007 8.758516689482673E-007 8.868685267229160E-007 + 8.980239595092143E-007 9.093197103662298E-007 9.207575442780153E-007 9.323392484293898E-007 + 9.440666324851898E-007 9.559415288730349E-007 9.679657930696443E-007 9.801413038907627E-007 + 9.924699637847271E-007 1.004953699129728E-006 1.017594460534812E-006 1.030394223144668E-006 + 1.043354986948243E-006 1.056478777091251E-006 1.069767644192601E-006 1.083223664664816E-006 + 1.096848941038471E-006 1.110645602290720E-006 1.124615804177953E-006 1.138761729572636E-006 + 1.153085588804394E-006 1.167589620005375E-006 1.182276089459960E-006 1.197147291958883E-006 + 1.212205551157789E-006 1.227453219940315E-006 1.242892680785730E-006 1.258526346141203E-006 + 1.274356658798752E-006 1.290386092276936E-006 1.306617151207350E-006 1.323052371725974E-006 + 1.339694321869451E-006 1.356545601976349E-006 1.373608845093468E-006 1.390886717387263E-006 + 1.408381918560431E-006 1.426097182273749E-006 1.444035276573215E-006 1.462199004322557E-006 + 1.480591203641192E-006 1.499214748347683E-006 1.518072548408779E-006 1.537167550394106E-006 + 1.556502737936573E-006 1.576081132198573E-006 1.595905792344042E-006 1.615979816016459E-006 + 1.636306339822865E-006 1.656888539823959E-006 1.677729632030368E-006 1.698832872905148E-006 + 1.720201559872623E-006 1.741839031833604E-006 1.763748669687107E-006 1.785933896858625E-006 + 1.808398179835038E-006 1.831145028706265E-006 1.854177997713721E-006 1.877500685805672E-006 + 1.901116737199586E-006 1.925029841951541E-006 1.949243736532804E-006 1.973762204413667E-006 + 1.998589076654618E-006 2.023728232504960E-006 2.049183600008938E-006 2.074959156619513E-006 + 2.101058929819848E-006 2.127486997752602E-006 2.154247489857163E-006 2.181344587514866E-006 + 2.208782524702347E-006 2.236565588653116E-006 2.264698120527438E-006 2.293184516090658E-006 + 2.322029226400038E-006 2.351236758500248E-006 2.380811676127602E-006 2.410758600423148E-006 + 2.441082210654739E-006 2.471787244948164E-006 2.502878501027504E-006 2.534360836964774E-006 + 2.566239171939015E-006 2.598518487004928E-006 2.631203825871162E-006 2.664300295688415E-006 + 2.697813067847431E-006 2.731747378787037E-006 2.766108530812365E-006 2.800901892923325E-006 + 2.836132901653533E-006 2.871807061919781E-006 2.907929947882188E-006 2.944507203815185E-006 + 2.981544544989423E-006 3.019047758564816E-006 3.057022704494785E-006 3.095475316441889E-006 + 3.134411602704984E-006 3.173837647158011E-006 3.213759610200630E-006 3.254183729720787E-006 + 3.295116322069398E-006 3.336563783047303E-006 3.378532588904599E-006 3.421029297352591E-006 + 3.464060548588430E-006 3.507633066332671E-006 3.551753658879864E-006 3.596429220162356E-006 + 3.641666730827491E-006 3.687473259328345E-006 3.733855963028189E-006 3.780822089318849E-006 + 3.828378976753107E-006 3.876534056191379E-006 3.925294851962802E-006 3.974668983040915E-006 + 4.024664164234162E-006 4.075288207391306E-006 4.126549022622097E-006 4.178454619533203E-006 + 4.231013108479738E-006 4.284232701832543E-006 4.338121715261342E-006 4.392688569034131E-006 + 4.447941789332826E-006 4.503890009585508E-006 4.560541971815432E-006 4.617906528006938E-006 + 4.675992641488654E-006 4.734809388333983E-006 4.794365958779279E-006 4.854671658659856E-006 + 4.915735910863997E-006 4.977568256805357E-006 5.040178357913783E-006 5.103575997144953E-006 + 5.167771080508991E-006 5.232773638618262E-006 5.298593828254731E-006 5.365241933956938E-006 + 5.432728369626991E-006 5.501063680157780E-006 5.570258543080584E-006 5.640323770233530E-006 + 5.711270309450902E-006 5.783109246273789E-006 5.855851805682244E-006 5.929509353849151E-006 + 6.004093399916281E-006 6.079615597792573E-006 6.156087747975086E-006 6.233521799392891E-006 + 6.311929851274039E-006 6.391324155036173E-006 6.471717116200782E-006 6.553121296331603E-006 + 6.635549414997417E-006 6.719014351759442E-006 6.803529148183876E-006 6.889107009879602E-006 + 6.975761308561613E-006 7.063505584140393E-006 7.152353546837499E-006 7.242319079327880E-006 + 7.333416238909019E-006 7.425659259697432E-006 7.519062554852808E-006 7.613640718830016E-006 + 7.709408529659622E-006 7.806380951256900E-006 7.904573135760011E-006 8.004000425897576E-006 + 8.104678357385942E-006 8.206622661356749E-006 8.309849266814899E-006 8.414374303127500E-006 + 8.520214102544157E-006 8.627385202748832E-006 8.735904349443996E-006 8.845788498967097E-006 + 8.957054820940050E-006 9.069720700952058E-006 9.183803743276066E-006 9.299321773619562E-006 + 9.416292841909805E-006 9.534735225114182E-006 9.654667430096070E-006 9.776108196506468E-006 + 9.899076499712226E-006 1.002359155376089E-005 1.014967281438298E-005 1.027733998203200E-005 + 1.040661300496260E-005 1.053751208234766E-005 1.067005766743432E-005 1.080427047073992E-005 + 1.094017146328803E-005 1.107778187988523E-005 1.121712322243908E-005 1.135821726331786E-005 + 1.150108604875250E-005 1.164575190228140E-005 1.179223742823849E-005 1.194056551528525E-005 + 1.209075933998703E-005 1.224284237043453E-005 1.239683836991067E-005 1.255277140060366E-005 + 1.271066582736682E-005 1.287054632152555E-005 1.303243786473235E-005 1.319636575287021E-005 + 1.336235560000518E-005 1.353043334238857E-005 1.370062524250959E-005 1.387295789319888E-005 + 1.404745822178375E-005 1.422415349429554E-005 1.440307131973008E-005 1.458423965436161E-005 + 1.476768680611099E-005 1.495344143896893E-005 1.514153257747471E-005 1.533198961125141E-005 + 1.552484229959805E-005 1.572012077613954E-005 1.591785555353513E-005 1.611807752824608E-005 + 1.632081798536332E-005 1.652610860349572E-005 1.673398145972005E-005 1.694446903459302E-005 + 1.715760421722642E-005 1.737342031042619E-005 1.759195103589596E-005 1.781323053950619E-005 + 1.803729339662952E-005 1.826417461754322E-005 1.849390965289968E-005 1.872653439926555E-005 + 1.896208520473073E-005 1.920059887458782E-005 1.944211267708297E-005 1.968666434923922E-005 + 1.993429210275286E-005 2.018503462996419E-005 2.043893110990322E-005 2.069602121441150E-005 + 2.095634511434092E-005 2.121994348583047E-005 2.148685751666198E-005 2.175712891269583E-005 + 2.203079990438751E-005 2.230791325338626E-005 2.258851225921666E-005 2.287264076604424E-005 + 2.316034316952627E-005 2.345166442374861E-005 2.374665004824996E-005 2.404534613513427E-005 + 2.434779935627284E-005 2.465405697059681E-005 2.496416683148149E-005 2.527817739422359E-005 + 2.559613772361240E-005 2.591809750159625E-005 2.624410703504553E-005 2.657421726361306E-005 + 2.690847976769371E-005 2.724694677648379E-005 2.758967117614203E-005 2.793670651805318E-005 + 2.828810702719543E-005 2.864392761061328E-005 2.900422386599683E-005 2.936905209036899E-005 + 2.973846928888204E-005 3.011253318372489E-005 3.049130222314212E-005 3.087483559056676E-005 + 3.126319321386777E-005 3.165643577471386E-005 3.205462471805531E-005 3.245782226172460E-005 + 3.286609140615823E-005 3.327949594424066E-005 3.369810047127200E-005 3.412197039506133E-005 + 3.455117194614658E-005 3.498577218814332E-005 3.542583902822355E-005 3.587144122772635E-005 + 3.632264841290203E-005 3.677953108579122E-005 3.724216063524112E-005 3.771060934806003E-005 + 3.818495042031236E-005 3.866525796875580E-005 3.915160704242192E-005 3.964407363434300E-005 + 4.014273469342593E-005 4.064766813647569E-005 4.115895286037015E-005 4.167666875438758E-005 + 4.220089671268972E-005 4.273171864696161E-005 4.326921749921042E-005 4.381347725472541E-005 + 4.436458295520066E-005 4.492262071202312E-005 4.548767771972761E-005 4.605984226962116E-005 + 4.663920376357886E-005 4.722585272801282E-005 4.781988082801728E-005 4.842138088169141E-005 + 4.903044687464234E-005 4.964717397467068E-005 5.027165854664053E-005 5.090399816753677E-005 + 5.154429164171168E-005 5.219263901632324E-005 5.284914159696790E-005 5.351390196350948E-005 + 5.418702398610776E-005 5.486861284144823E-005 5.555877502917616E-005 5.625761838853768E-005 + 5.696525211522940E-005 5.768178677846085E-005 5.840733433823093E-005 5.914200816282196E-005 + 5.988592304651383E-005 6.063919522752057E-005 6.140194240615302E-005 6.217428376320966E-005 + 6.295633997859885E-005 6.374823325019531E-005 6.455008731293397E-005 6.536202745814343E-005 + 6.618418055312332E-005 6.701667506096738E-005 6.785964106063615E-005 6.871321026728221E-005 + 6.957751605283065E-005 7.045269346681892E-005 7.133887925749847E-005 7.223621189320204E-005 + 7.314483158397969E-005 7.406488030350666E-005 7.499650181126721E-005 7.593984167501734E-005 + 7.689504729352995E-005 7.786226791962642E-005 7.884165468349733E-005 7.983336061631716E-005 + 8.083754067415551E-005 8.185435176218937E-005 8.288395275922012E-005 8.392650454249822E-005 + 8.498217001286087E-005 8.605111412018561E-005 8.713350388916391E-005 8.822950844539944E-005 + 8.933929904183390E-005 9.046304908550589E-005 9.160093416464596E-005 9.275313207611274E-005 + 9.391982285317420E-005 9.510118879363782E-005 9.629741448833534E-005 9.750868684996525E-005 + 9.873519514229839E-005 9.997713100975087E-005 1.012346885073287E-004 1.025080641309494E-004 + 1.037974568481448E-004 1.051030681291502E-004 1.064251019783847E-004 1.077637649663269E-004 + 1.091192662617922E-004 1.104918176646157E-004 1.118816336387466E-004 1.132889313457586E-004 + 1.147139306787815E-004 1.161568542968603E-004 1.176179276597459E-004 1.190973790631237E-004 + 1.205954396742859E-004 1.221123435682504E-004 1.236483277643369E-004 1.252036322632011E-004 + 1.267785000843351E-004 1.283731773040403E-004 1.299879130938764E-004 1.316229597595960E-004 + 1.332785727805669E-004 1.349550108496921E-004 1.366525359138308E-004 1.383714132147277E-004 + 1.401119113304583E-004 1.418743022173942E-004 1.436588612526969E-004 1.454658672773466E-004 + 1.472956026397111E-004 1.491483532396633E-004 1.510244085732539E-004 1.529240617779454E-004 + 1.548476096784163E-004 1.567953528329393E-004 1.587675955803451E-004 1.607646460875756E-004 + 1.627868163978353E-004 1.648344224793497E-004 1.669077842747346E-004 1.690072257509891E-004 + 1.711330749501150E-004 1.732856640403746E-004 1.754653293681931E-004 1.776724115107124E-004 + 1.799072553290076E-004 1.821702100219721E-004 1.844616291808805E-004 1.867818708446387E-004 + 1.891312975557271E-004 1.915102764168491E-004 1.939191791482920E-004 1.963583821460082E-004 + 1.988282665404292E-004 2.013292182560164E-004 2.038616280715635E-004 2.064258916812565E-004 + 2.090224097565013E-004 2.116515880085301E-004 2.143138372517938E-004 2.170095734681529E-004 + 2.197392178718759E-004 2.225031969754540E-004 2.253019426562460E-004 2.281358922239584E-004 + 2.310054884889769E-004 2.339111798315561E-004 2.368534202718798E-004 2.398326695410031E-004 + 2.428493931526857E-004 2.459040624761293E-004 2.489971548096305E-004 2.521291534551590E-004 + 2.553005477938759E-004 2.585118333625987E-004 2.617635119312307E-004 2.650560915811640E-004 + 2.683900867846674E-004 2.717660184852751E-004 2.751844141791833E-004 2.786458079976741E-004 + 2.821507407905738E-004 2.856997602107619E-004 2.892934207997439E-004 2.929322840742979E-004 + 2.966169186142139E-004 3.003479001511351E-004 3.041258116585172E-004 3.079512434427201E-004 + 3.118247932352424E-004 3.157470662861203E-004 3.197186754584978E-004 3.237402413243881E-004 + 3.278123922616402E-004 3.319357645521228E-004 3.361110024811452E-004 3.403387584381283E-004 + 3.446196930185418E-004 3.489544751271238E-004 3.533437820823979E-004 3.577882997225059E-004 + 3.622887225123715E-004 3.668457536522114E-004 3.714601051874134E-004 3.761324981197922E-004 + 3.808636625202498E-004 3.856543376428494E-004 3.905052720403251E-004 3.954172236810467E-004 + 4.003909600674509E-004 4.054272583559676E-004 4.105269054784504E-004 4.156906982651374E-004 + 4.209194435691580E-004 4.262139583926034E-004 4.315750700141870E-004 4.370036161185063E-004 + 4.425004449269347E-004 4.480664153301573E-004 4.537023970223735E-004 4.594092706371892E-004 + 4.651879278852174E-004 4.710392716934093E-004 4.769642163461406E-004 4.829636876280673E-004 + 4.890386229687831E-004 4.951899715892946E-004 5.014186946503383E-004 5.077257654025659E-004 + 5.141121693386135E-004 5.205789043470899E-004 5.271269808684963E-004 5.337574220531113E-004 + 5.404712639208603E-004 5.472695555231945E-004 5.541533591070075E-004 5.611237502806148E-004 + 5.681818181818183E-004 5.753286656480879E-004 5.825654093888803E-004 5.898931801601282E-004 + 5.973131229409232E-004 6.048263971124201E-004 6.124341766389953E-004 6.201376502516774E-004 + 6.279380216338911E-004 6.358365096095349E-004 6.438343483334241E-004 6.519327874841322E-004 + 6.601330924592520E-004 6.684365445731200E-004 6.768444412570221E-004 6.853580962619208E-004 + 6.939788398637331E-004 7.027080190711849E-004 7.115469978362871E-004 7.204971572674548E-004 + 7.295598958453076E-004 7.387366296411883E-004 7.480287925384216E-004 7.574378364563657E-004 + 7.669652315772751E-004 7.766124665760207E-004 7.863810488526997E-004 7.962725047681670E-004 + 8.062883798825330E-004 8.164302391966623E-004 8.266996673967054E-004 8.370982691017136E-004 + 8.476276691143585E-004 8.582895126748145E-004 8.690854657178294E-004 8.800172151330303E-004 + 8.910864690285053E-004 9.022949569976956E-004 9.136444303896499E-004 9.251366625826768E-004 + 9.367734492614365E-004 9.485566086975246E-004 9.604879820335750E-004 9.725694335709462E-004 + 9.848028510610208E-004 9.971901460001696E-004 1.009733253928431E-003 1.022434134731937E-003 + 1.035294772949153E-003 1.048317178080966E-003 1.061503384904672E-003 1.074855453791915E-003 + 1.088375471030623E-003 1.102065549150997E-003 1.115927827255596E-003 1.129964471353575E-003 + 1.144177674699135E-003 1.158569658134213E-003 1.173142670435504E-003 1.187898988665828E-003 + 1.202840918529929E-003 1.217970794734750E-003 1.233290981354229E-003 1.248803872198695E-003 + 1.264511891188903E-003 1.280417492734778E-003 1.296523162118923E-003 1.312831415884946E-003 + 1.329344802230677E-003 1.346065901406330E-003 1.362997326117669E-003 1.380141721934255E-003 + 1.397501767702813E-003 1.415080175965814E-003 1.432879693385312E-003 1.450903101172117E-003 + 1.469153215520368E-003 1.487632888047558E-003 1.506345006240118E-003 1.525292493904587E-003 + 1.544478311624458E-003 1.563905457222788E-003 1.583576966230597E-003 1.603495912361193E-003 + 1.623665407990435E-003 1.644088604643046E-003 1.664768693485060E-003 1.685708905822425E-003 + 1.706912513605927E-003 1.728382829942424E-003 1.750123209612518E-003 1.772137049594770E-003 + 1.794427789596460E-003 1.816998912591065E-003 1.839853945362479E-003 1.862996459056064E-003 + 1.886430069736677E-003 1.910158438953654E-003 1.934185274312965E-003 1.958514330056521E-003 + 1.983149407648774E-003 2.008094356370723E-003 2.033353073921353E-003 2.058929507026671E-003 + 2.084827652056390E-003 2.111051555648355E-003 2.137605315340861E-003 2.164493080212876E-003 + 2.191719051532371E-003 2.219287483412759E-003 2.247202683477601E-003 2.275469013533710E-003 + 2.304090890252657E-003 2.333072785860916E-003 2.362419228838643E-003 2.392134804627250E-003 + 2.422224156345922E-003 2.452691985517071E-003 2.483543052800998E-003 2.514782178739738E-003 + 2.546414244510264E-003 2.578444192687220E-003 2.610877028015165E-003 2.643717818190608E-003 + 2.676971694653832E-003 2.710643853390683E-003 2.744739555744479E-003 2.779264129238072E-003 + 2.814222968406315E-003 2.849621535638956E-003 2.885465362034137E-003 2.921760048262666E-003 + 2.958511265443097E-003 2.995724756027892E-003 3.033406334700671E-003 3.071561889284754E-003 + 3.110197381663185E-003 3.149318848710241E-003 3.188932403234747E-003 3.229044234935198E-003 + 3.269660611366893E-003 3.310787878921295E-003 3.352432463817624E-003 3.394600873107001E-003 + 3.437299695689176E-003 3.480535603342038E-003 3.524315351764132E-003 3.568645781630208E-003 + 3.613533819660130E-003 3.658986479701173E-003 3.705010863823927E-003 3.751614163432065E-003 + 3.798803660385950E-003 3.846586728140497E-003 3.894970832897263E-003 3.943963534771043E-003 + 3.993572488971193E-003 4.043805446997725E-003 4.094670257852537E-003 4.146174869265817E-003 + 4.198327328937870E-003 4.251135785796640E-003 4.304608491270937E-003 4.358753800579789E-003 + 4.413580174037942E-003 4.469096178377779E-003 4.525310488087944E-003 4.582231886768679E-003 + 4.639869268504344E-003 4.698231639253110E-003 4.757328118254128E-003 4.817167939452490E-003 + 4.877760452941987E-003 4.939115126426138E-003 5.001241546697508E-003 5.064149421135647E-003 + 5.127848579223938E-003 5.192348974085414E-003 5.257660684038006E-003 5.323793914169282E-003 + 5.390758997930981E-003 5.458566398753700E-003 5.527226711681755E-003 5.596750665028739E-003 + 5.667149122053823E-003 5.738433082659122E-003 5.810613685108528E-003 5.883702207768009E-003 + 5.957710070867938E-003 6.032648838287507E-003 6.108530219361565E-003 6.185366070710312E-003 + 6.263168398091822E-003 6.341949358278049E-003 6.421721260954312E-003 6.502496570642682E-003 + 6.584287908649661E-003 6.667108055038191E-003 6.750969950624657E-003 6.835886699000875E-003 + 6.921871568581518E-003 7.008937994677424E-003 7.097099581594781E-003 7.186370104760921E-003 + 7.276763512876729E-003 7.368293930096099E-003 7.460975658232971E-003 7.554823178995903E-003 + 7.649851156250971E-003 7.746074438312935E-003 7.843508060265394E-003 7.942167246310026E-003 + 8.042067412145346E-003 8.143224167375540E-003 8.245653317949389E-003 8.349370868630081E-003 + 8.454393025495938E-003 8.560736198472609E-003 8.668417003897260E-003 8.777452267114788E-003 + 8.887859025106916E-003 8.999654529154223E-003 9.112856247531635E-003 9.227481868237988E-003 + 9.343549301759695E-003 9.461076683869401E-003 9.580082378459687E-003 9.700584980412421E-003 + 9.822603318504354E-003 9.946156458349030E-003 1.007126370537594E-002 1.019794460784696E-002 + 1.032621895991083E-002 1.045610680469606E-002 1.058762843744262E-002 1.072080440867323E-002 + 1.085565552740436E-002 1.099220286439762E-002 1.113046775545228E-002 1.127047180473883E-002 + 1.141223688817481E-002 1.155578515684297E-002 1.170113904045229E-002 1.184832125084286E-002 + 1.199735478553445E-002 1.214826293132008E-002 1.230106926790459E-002 1.245579767158891E-002 + 1.261247231900095E-002 1.277111769087308E-002 1.293175857586746E-002 1.309442007444921E-002 + 1.325912760280837E-002 1.342590689683139E-002 1.359478401612224E-002 1.376578534807442E-002 + 1.393893761199396E-002 1.411426786327435E-002 1.429180349762409E-002 1.447157225534721E-002 + 1.465360222567788E-002 1.483792185116931E-002 1.502455993213796E-002 1.521354563116373E-002 + 1.540490847764654E-002 1.559867837242051E-002 1.579488559242596E-002 1.599356079544014E-002 + 1.619473502486779E-002 1.639843971459150E-002 1.660470669388349E-002 1.681356819237897E-002 + 1.702505684511195E-002 1.723920569761475E-002 1.745604821108121E-002 1.767561826759526E-002 + 1.789795017542498E-002 1.812307867438324E-002 1.835103894125609E-002 1.858186659529896E-002 + 1.881559770380245E-002 1.905226878772782E-002 1.929191682741338E-002 1.953457926835297E-002 + 1.978029402704662E-002 2.002909949692531E-002 2.028103455434995E-002 2.053613856468576E-002 + 2.079445138845343E-002 2.105601338755716E-002 2.132086543159148E-002 2.158904890422716E-002 + 2.186060570967735E-002 2.213557827924547E-002 2.241400957795486E-002 2.269594311126246E-002 + 2.298142293185650E-002 2.327049364653966E-002 2.356320042319933E-002 2.385958899786478E-002 + 2.415970568185385E-002 2.446359736900907E-002 2.477131154302472E-002 2.508289628486664E-002 + 2.539840028028458E-002 2.571787282741975E-002 2.604136384450768E-002 2.636892387767783E-002 + 2.670060410885191E-002 2.703645636374074E-002 2.737653311994251E-002 2.772088751514231E-002 + 2.806957335541488E-002 2.842264512363228E-002 2.878015798797651E-002 2.914216781056006E-002 + 2.950873115615426E-002 2.987990530102753E-002 3.025574824189528E-002 3.063631870498158E-002 + 3.102167615519559E-002 3.141188080542300E-002 3.180699362593418E-002 3.220707635391129E-002 + 3.261219150309445E-002 3.302240237355000E-002 3.343777306156106E-002 3.385836846964261E-002 + 3.428425431668299E-002 3.471549714821214E-002 3.515216434679994E-002 3.559432414258461E-002 + 3.604204562393372E-002 3.649539874823975E-002 3.695445435285057E-002 3.741928416613847E-002 + 3.788996081870751E-002 3.836655785474213E-002 3.884914974349899E-002 3.933781189094241E-002 + 3.983262065152719E-002 4.033365334012894E-002 4.084098824412447E-002 4.135470463562486E-002 + 4.187488278386128E-002 4.240160396772780E-002 4.293495048848107E-002 4.347500568259994E-002 + 4.402185393480737E-002 4.457558069125520E-002 4.513627247287576E-002 4.570401688890074E-002 + 4.627890265055008E-002 4.686101958489382E-002 4.745045864888709E-002 4.804731194358296E-002 + 4.865167272852311E-002 4.926363543630961E-002 4.988329568736075E-002 5.051075030485133E-002 + 5.114609732984193E-002 5.178943603659798E-002 5.244086694810107E-002 5.310049185175667E-002 + 5.376841381529782E-002 5.444473720289027E-002 5.512956769143945E-002 5.582301228710232E-002 + 5.652517934200793E-002 5.723617857118701E-002 5.795612106971574E-002 5.868511933007436E-002 + 5.942328725972399E-002 6.017074019890570E-002 6.092759493866168E-002 6.169396973908500E-002 + 6.246998434779751E-002 6.325576001866043E-002 6.405141953072122E-002 6.485708720739718E-002 + 6.567288893590209E-002 6.649895218691586E-002 6.733540603450190E-002 6.818238117627588E-002 + 6.904000995382668E-002 6.990842637339577E-002 7.078776612681560E-002 7.167816661271147E-002 + 7.257976695797104E-002 7.349270803948237E-002 7.441713250614694E-002 7.535318480116857E-002 + 7.630101118462246E-002 7.726075975630974E-002 7.823258047889700E-002 7.921662520134953E-002 + 8.021304768265740E-002 8.122200361586024E-002 8.224365065237565E-002 8.327814842663135E-002 + 8.432565858100943E-002 8.538634479110284E-002 8.646037279128956E-002 8.754791040063008E-002 + 8.864912754908813E-002 8.976419630408379E-002 9.089329089737880E-002 9.203658775230021E-002 + 9.319426551130795E-002 9.436650506390688E-002 9.555348957491219E-002 9.675540451306884E-002 + 9.797243768003089E-002 9.920477923970708E-002 1.004526217479730E-001 1.017161601827595E-001 + 1.029955919745178E-001 1.042911170370682E-001 1.056029377988377E-001 1.069312592344889E-001 + 1.082762888969489E-001 1.096382369498390E-001 1.110173162003130E-001 1.124137421323101E-001 + 1.138277329402226E-001 1.152595095629914E-001 1.167092957186269E-001 1.181773179391651E-001 + 1.196638056060652E-001 1.211689909860489E-001 1.226931092673944E-001 1.242363985966842E-001 + 1.257991001160154E-001 1.273814580006803E-001 1.289837194973171E-001 1.306061349625448E-001 + 1.322489579020809E-001 1.339124450103515E-001 1.355968562106022E-001 1.373024546955095E-001 + 1.390295069683070E-001 1.407782828844263E-001 1.425490556936617E-001 1.443421020828678E-001 + 1.461577022191903E-001 1.479961397938448E-001 1.498577020664427E-001 1.517426799098762E-001 + 1.536513678557687E-001 1.555840641404946E-001 1.575410707517807E-001 1.595226934758918E-001 + 1.615292419454096E-001 1.635610296876155E-001 1.656183741734774E-001 1.677015968672570E-001 + 1.698110232767390E-001 1.719469830040908E-001 1.741098097973662E-001 1.762998416026514E-001 + 1.785174206168717E-001 1.807628933412603E-001 1.830366106354980E-001 1.853389277725388E-001 + 1.876702044941187E-001 1.900308050669688E-001 1.924210983397316E-001 1.948414578005934E-001 + 1.972922616356449E-001 1.997738927879709E-001 2.022867390174881E-001 2.048311929615328E-001 + 2.074076521962096E-001 2.100165192985166E-001 2.126582019092456E-001 2.153331127966793E-001 + 2.180416699210865E-001 2.207842965000277E-001 2.235614210744866E-001 2.263734775758273E-001 + 2.292209053935995E-001 2.321041494441935E-001 2.350236602403573E-001 2.379798939615934E-001 + 2.409733125254344E-001 2.440043836596216E-001 2.470735809751867E-001 2.501813840404539E-001 + 2.533282784559759E-001 2.565147559304066E-001 2.597413143573347E-001 2.630084578930793E-001 + 2.663166970354642E-001 2.696665487035869E-001 2.730585363185848E-001 2.764931898854245E-001 + 2.799710460757140E-001 2.834926483115580E-001 2.870585468504713E-001 2.906692988713547E-001 + 2.943254685615579E-001 2.980276272050343E-001 3.017763532716029E-001 3.055722325073394E-001 + 3.094158580260963E-001 3.133078304021811E-001 3.172487577641966E-001 3.212392558900598E-001 + 3.252799483032227E-001 3.293714663700946E-001 3.335144493986982E-001 3.377095447385615E-001 + 3.419574078818649E-001 3.462587025658683E-001 3.506141008766157E-001 3.550242833539551E-001 + 3.594899390978716E-001 3.640117658761596E-001 3.685904702334540E-001 3.732267676016249E-001 + 3.779213824115693E-001 3.826750482064031E-001 3.874885077560770E-001 3.923625131734400E-001 + 3.972978260317533E-001 4.022952174836928E-001 4.073554683818409E-001 4.124793694006940E-001 + 4.176677211602125E-001 4.229213343509131E-001 4.282410298605462E-001 4.336276389023589E-001 + 4.390820031449716E-001 4.446049748438958E-001 4.501974169746943E-001 4.558602033678290E-001 + 4.615942188451954E-001 4.674003593583764E-001 4.732795321286414E-001 4.792326557886952E-001 + 4.852606605262225E-001 4.913644882292283E-001 4.975450926332079E-001 5.038034394701757E-001 + 5.101405066195559E-001 5.165572842609842E-001 5.230547750290233E-001 5.296339941698229E-001 + 5.362959696997612E-001 5.430417425660669E-001 5.498723668094754E-001 5.567889097289228E-001 + 5.637924520483104E-001 5.708840880853761E-001 5.780649259226769E-001 5.853360875807352E-001 + 5.926987091933545E-001 6.001539411851393E-001 6.077029484512581E-001 6.153469105394525E-001 + 6.230870218343515E-001 6.309244917440938E-001 6.388605448892958E-001 6.468964212944098E-001 + 6.550333765814709E-001 6.632726821662985E-001 6.716156254571546E-001 6.800635100558998E-001 + 6.886176559616923E-001 6.972793997772312E-001 7.060500949176114E-001 7.149311118217936E-001 + 7.239238381667352E-001 7.330296790842263E-001 7.422500573804335E-001 7.515864137582259E-001 + 7.610402070422837E-001 7.706129144070388E-001 7.803060316074957E-001 7.901210732129347E-001 + 8.000595728435771E-001 8.101230834102116E-001 8.203131773568355E-001 8.306314469063634E-001 + 8.410795043094015E-001 8.516589820961773E-001 8.623715333316211E-001 8.732188318736548E-001 + 8.842025726347478E-001 8.953244718467377E-001 9.065862673290053E-001 9.179897187600088E-001 + 9.295366079522313E-001 9.412287391306052E-001 9.530679392144110E-001 9.650560581027513E-001 + 9.771949689635934E-001 9.894865685264529E-001 1.001932777378773E+000 1.014535540266004E+000 + 1.027296826395490E+000 1.040218629744155E+000 1.053302969370056E+000 1.066551889727885E+000 + 1.079967460988398E+000 1.093551779361902E+000 1.107306967425781E+000 1.121235174456152E+000 + 1.135338576763705E+000 1.149619378033739E+000 1.164079809670510E+000 1.178722131145883E+000 + 1.193548630352374E+000 1.208561623960653E+000 1.223763457781511E+000 1.239156507132415E+000 + 1.254743177208643E+000 + + + +-8.055763997176067E+000 -8.055770284309713E+000 -8.055776492429622E+000 -8.055782635699529E+000 +-8.055788727947256E+000 -8.055794782674921E+000 -8.055800813068915E+000 -8.055806832009555E+000 +-8.055812852080628E+000 -8.055818885578557E+000 -8.055824944521502E+000 -8.055831040658109E+000 +-8.055837185476090E+000 -8.055843390210656E+000 -8.055849665852616E+000 -8.055856023156451E+000 +-8.055862472648020E+000 -8.055869024632218E+000 -8.055875786323492E+000 -8.055880957778051E+000 +-8.055888255781426E+000 -8.055895738521572E+000 -8.055903410670915E+000 -8.055910500770020E+000 +-8.055918539459865E+000 -8.055926781636328E+000 -8.055933732892964E+000 -8.055942349812213E+000 +-8.055950325494775E+000 -8.055959355757739E+000 -8.055968614612315E+000 -8.055978107831075E+000 +-8.055986179639502E+000 -8.055995168393409E+000 -8.056005318409786E+000 -8.056015725356234E+000 +-8.056026395736705E+000 -8.056037336209732E+000 -8.056048553646777E+000 -8.056058894372564E+000 +-8.056068833223367E+000 -8.056080833725485E+000 -8.056093138001685E+000 -8.056105753715398E+000 +-8.056117441014869E+000 -8.056130666119138E+000 -8.056144226003958E+000 -8.056158129121872E+000 +-8.056170305625850E+000 -8.056184861610710E+000 -8.056199786048646E+000 -8.056213683567924E+000 +-8.056229332270723E+000 -8.056245377066464E+000 -8.056261828013028E+000 -8.056278695363121E+000 +-8.056295989662575E+000 -8.056311308702368E+000 -8.056327864385674E+000 -8.056346391794886E+000 +-8.056365388132622E+000 -8.056384865284496E+000 -8.056404835451019E+000 -8.056425311078010E+000 +-8.056446304991262E+000 -8.056467830309144E+000 -8.056487907759434E+000 -8.056507895677100E+000 +-8.056530969665275E+000 -8.056554627684640E+000 -8.056578884478045E+000 -8.056603755293423E+000 +-8.056629255618120E+000 -8.056655401351431E+000 -8.056682208838909E+000 -8.056707410160820E+000 +-8.056735529717889E+000 -8.056764361012098E+000 -8.056790882686061E+000 -8.056821110249331E+000 +-8.056852102862885E+000 -8.056883879887504E+000 -8.056916461128914E+000 -8.056949866915932E+000 +-8.056984118184808E+000 -8.057016599280104E+000 -8.057052535669714E+000 -8.057089381609739E+000 +-8.057127160017028E+000 -8.057165894591595E+000 -8.057205609523860E+000 -8.057242640425351E+000 +-8.057284293501564E+000 -8.057327000676521E+000 -8.057370788686713E+000 -8.057415684877620E+000 +-8.057461717355382E+000 -8.057505785038199E+000 -8.057554094432188E+000 -8.057603626444243E+000 +-8.057654411877275E+000 -8.057706482613458E+000 -8.057759871039002E+000 -8.057814610384508E+000 +-8.057870735043476E+000 -8.057928279948472E+000 -8.057982683490884E+000 -8.058043057792286E+000 +-8.058104959800618E+000 -8.058168428333472E+000 -8.058233502925214E+000 -8.058296436538917E+000 +-8.058364747390039E+000 -8.058434786724661E+000 -8.058506598313222E+000 -8.058580226852049E+000 +-8.058655718449852E+000 -8.058733120136056E+000 -8.058812480225988E+000 -8.058893848111486E+000 +-8.058977274619835E+000 -8.059062812079844E+000 -8.059150513641377E+000 -8.059240434059731E+000 +-8.059326640760066E+000 -8.059421014408453E+000 -8.059517775584620E+000 -8.059616984609740E+000 +-8.059713970819615E+000 -8.059818141275054E+000 -8.059924946909756E+000 -8.060034454468992E+000 +-8.060146732311573E+000 -8.060261850223874E+000 -8.060379880192535E+000 -8.060500896061528E+000 +-8.060624972962115E+000 -8.060752188255508E+000 -8.060882621167975E+000 -8.061016353115519E+000 +-8.061153467519699E+000 -8.061294049874293E+000 -8.061438187631106E+000 -8.061585970307490E+000 +-8.061737490543710E+000 -8.061892842564001E+000 -8.062052123528531E+000 -8.062215432190490E+000 +-8.062374189862231E+000 -8.062545640463858E+000 -8.062721426199841E+000 -8.062895228648394E+000 +-8.063079852403906E+000 -8.063269143457623E+000 -8.063463220918580E+000 -8.063662204772562E+000 +-8.063866219317672E+000 -8.064075391177889E+000 -8.064289850739073E+000 -8.064509732280227E+000 +-8.064735171773075E+000 -8.064966309937615E+000 -8.065203290314615E+000 -8.065446260261675E+000 +-8.065695371711440E+000 -8.065950778541785E+000 -8.066212639833262E+000 -8.066481118564878E+000 +-8.066756381733775E+000 -8.067038601130049E+000 -8.067327950949036E+000 -8.067624611486217E+000 +-8.067928767528162E+000 -8.068240607572196E+000 -8.068560325735179E+000 -8.068888119750081E+000 +-8.069224193565931E+000 -8.069568756496652E+000 -8.069922021563270E+000 -8.070284208511229E+000 +-8.070655541813448E+000 -8.071021532602344E+000 -8.071411484398544E+000 -8.071801593504279E+000 +-8.072211240020287E+000 -8.072631228099416E+000 -8.073061817288547E+000 -8.073503274954508E+000 +-8.073955874826144E+000 -8.074419898489086E+000 -8.074895632888396E+000 -8.075383373490329E+000 +-8.075883421439244E+000 -8.076396085580267E+000 -8.076921683239625E+000 -8.077460538145028E+000 +-8.078012984847202E+000 -8.078579364997298E+000 -8.079160029020674E+000 -8.079755336795762E+000 +-8.080365654433058E+000 -8.080991359586786E+000 -8.081632838110316E+000 -8.082290485742513E+000 +-8.082964709863244E+000 -8.083655924511158E+000 -8.084364557667751E+000 -8.085091045056265E+000 +-8.085835833756622E+000 -8.086599383809606E+000 -8.087382162550190E+000 -8.088184654604019E+000 +-8.089007352446467E+000 -8.089850761932739E+000 -8.090715403748630E+000 -8.091601805291555E+000 +-8.092510513735032E+000 -8.093442085943190E+000 -8.094397093433292E+000 -8.095376123977836E+000 +-8.096379775117413E+000 -8.097408664753631E+000 -8.098463421062721E+000 -8.099544689881078E+000 +-8.100653134946418E+000 -8.101789430066635E+000 -8.102954272797557E+000 -8.104148373834290E+000 +-8.105372459673982E+000 -8.106627280333120E+000 -8.107913597625009E+000 -8.109232197273366E+000 +-8.110583883165772E+000 -8.111969476920121E+000 -8.113389822905420E+000 -8.114845782571308E+000 +-8.116338238784705E+000 -8.117829060810639E+000 -8.119377002329319E+000 -8.120982993986647E+000 +-8.122629203183749E+000 -8.124316622092209E+000 -8.126046275105020E+000 -8.127819205572635E+000 +-8.129636481926894E+000 -8.131499202987589E+000 -8.133408490544179E+000 -8.135365489314340E+000 +-8.137371375974858E+000 -8.139427360173787E+000 -8.141534674271369E+000 -8.143694575809402E+000 +-8.145908358447567E+000 -8.148177346789625E+000 -8.150502898291913E+000 -8.152886403238590E+000 +-8.155329278444805E+000 -8.157832974116241E+000 -8.160398976944085E+000 -8.163028814842614E+000 +-8.165724049308198E+000 -8.168486268949763E+000 -8.171317111652971E+000 -8.174218250030080E+000 +-8.177191387248904E+000 -8.180238278474086E+000 -8.183360716494732E+000 -8.186560529076685E+000 +-8.189839588679295E+000 -8.193199815802563E+000 -8.196643172365874E+000 -8.200171661336041E+000 +-8.203787337651940E+000 -8.207492300236769E+000 -8.211288694737762E+000 -8.215178718842028E+000 +-8.219164619073441E+000 -8.223248690376231E+000 -8.227433274793011E+000 -8.231720775396150E+000 +-8.236113651131189E+000 -8.240614405874723E+000 -8.245225599249371E+000 -8.249949858001004E+000 +-8.254789858269049E+000 -8.259748327964488E+000 -8.264828070950657E+000 -8.270031945861543E+000 +-8.275362866667468E+000 -8.280823815869118E+000 -8.286417835442942E+000 -8.292148035815851E+000 +-8.298017597013043E+000 -8.304029759439384E+000 -8.310187832017403E+000 -8.316495196182933E+000 +-8.322955297073989E+000 -8.329571655433446E+000 -8.336347872601282E+000 -8.343287608214913E+000 +-8.350394597949697E+000 -8.357672666964801E+000 -8.365125706307957E+000 -8.372757676359193E+000 +-8.380572622239905E+000 -8.388574675345637E+000 -8.396768041685609E+000 -8.405157001499553E+000 +-8.413745923823019E+000 -8.422539260238848E+000 -8.431541537387577E+000 -8.440757367797755E+000 +-8.450191455804575E+000 -8.459848590108230E+000 -8.469733636165621E+000 -8.479851545155800E+000 +-8.490207364594411E+000 -8.500806226203718E+000 -8.511653339085720E+000 -8.522754007688111E+000 +-8.534113626226135E+000 -8.545737669716848E+000 -8.557631708247664E+000 -8.569801394607762E+000 +-8.582252465177573E+000 -8.594990749899655E+000 -8.608022162824174E+000 -8.621352702203660E+000 +-8.634988450962503E+000 -8.648935581921455E+000 -8.663200349006338E+000 -8.677789086359118E+000 +-8.692708211880561E+000 -8.707964215922553E+000 -8.723563670754650E+000 -8.739513232842173E+000 +-8.755819629911848E+000 -8.772489658139580E+000 -8.789530181631340E+000 -8.806948133262894E+000 +-8.824750513890395E+000 -8.842944386134457E+000 -8.861536866622762E+000 -8.880535124454862E+000 +-8.899946389123450E+000 -8.919777933547405E+000 -8.940037062821956E+000 -8.960731128631549E+000 +-8.981867518644961E+000 -9.003453642147077E+000 -9.025496931195747E+000 -9.048004833327438E+000 +-9.070984806147797E+000 -9.094444308293387E+000 -9.118390793523842E+000 -9.142831709980209E+000 +-9.167774480624097E+000 -9.193226494520635E+000 -9.219195108260498E+000 -9.245687637808242E+000 +-9.272711338199864E+000 -9.300273395703787E+000 -9.328380929286174E+000 -9.357040961912617E+000 +-9.386260414082154E+000 -9.416046108077545E+000 -9.446404731745067E+000 -9.477342834261302E+000 +-9.508866825110109E+000 -9.540982942946075E+000 -9.573697244768548E+000 -9.607015592408501E+000 +-9.640943642681018E+000 -9.675486824978821E+000 -9.710650320496535E+000 -9.746439058274891E+000 +-9.782857682248423E+000 -9.819910534967995E+000 -9.857601649423648E+000 -9.895934724341483E+000 +-9.934913102082835E+000 -9.974539742377488E+000 -1.001481720775979E+001 -1.005574765209258E+001 +-1.009733278417058E+001 -1.013957384337448E+001 -1.018247158952427E+001 -1.022602627255571E+001 +-1.027023760731241E+001 -1.031510474887048E+001 -1.036062627640271E+001 -1.040680016475738E+001 +-1.045362375222514E+001 -1.050109372529177E+001 -1.054920608987991E+001 -1.059795614600240E+001 +-1.064733846343896E+001 -1.069734685383724E+001 -1.074797434847863E+001 -1.079921317318857E+001 +-1.085105472211488E+001 -1.090348953363483E+001 -1.095650726529173E+001 -1.101009667208498E+001 +-1.106424557759697E+001 -1.111894085769401E+001 -1.117416842144439E+001 -1.122991317689045E+001 +-1.128615901830865E+001 -1.134288880542460E+001 -1.140008434370531E+001 -1.145772637029019E+001 +-1.151579453197092E+001 -1.157426737474377E+001 -1.163312232469947E+001 -1.169233567585004E+001 +-1.175188258762865E+001 -1.181173706633315E+001 -1.187187195717186E+001 -1.193225894337732E+001 +-1.199286854180911E+001 -1.205367009971575E+001 -1.211463179312866E+001 -1.217572063087328E+001 +-1.223690245649713E+001 -1.229814196067886E+001 -1.235940268808131E+001 -1.242064704374040E+001 +-1.248183631705532E+001 -1.254293069326405E+001 -1.260388927198389E+001 -1.266467009491749E+001 +-1.272523016388758E+001 -1.278552547200504E+001 -1.284551103565009E+001 -1.290514092776462E+001 +-1.296436831632722E+001 -1.302314549959704E+001 -1.308142395031486E+001 -1.313915435964418E+001 +-1.319628668608765E+001 -1.325277021257172E+001 -1.330855359467878E+001 -1.336358491319812E+001 +-1.341781173944171E+001 -1.347118119908575E+001 -1.352364003559137E+001 -1.357513467674197E+001 +-1.362561130447232E+001 -1.367501592920116E+001 -1.372329446549030E+001 -1.377039281016442E+001 +-1.381625691982922E+001 -1.386083289494457E+001 -1.390406706773376E+001 -1.394590608377310E+001 +-1.398629699072090E+001 -1.402518733153028E+001 -1.406252523412834E+001 -1.409825950574224E+001 +-1.413233973075262E+001 -1.416471636374759E+001 -1.419534082752325E+001 -1.422416561546239E+001 +-1.425114438806332E+001 -1.427623207505352E+001 -1.429938497838362E+001 -1.432056087232074E+001 +-1.433971910770477E+001 -1.435682071317947E+001 -1.437182849870193E+001 -1.438470715878316E+001 +-1.439542337417535E+001 -1.440394591451134E+001 -1.441024573652158E+001 -1.441429608529036E+001 +-1.441607259433224E+001 -1.441555337980003E+001 -1.441271913558736E+001 -1.440755322605094E+001 +-1.440004177566163E+001 -1.439017375516461E+001 -1.437794106363054E+001 -1.436333860882407E+001 +-1.434636438219002E+001 -1.432701952882549E+001 -1.430530841125816E+001 -1.428123866887018E+001 +-1.425482127149334E+001 -1.422607056433163E+001 -1.419500430704093E+001 -1.416164370438351E+001 +-1.412601342893987E+001 -1.408814163501600E+001 -1.404805996258293E+001 -1.400580353246496E+001 +-1.396141093058085E+001 -1.391492418065927E+001 -1.386638870748982E+001 -1.381585328846294E+001 +-1.376336999189896E+001 -1.370899410535785E+001 -1.365278405155915E+001 -1.359480129065470E+001 +-1.353511021118492E+001 -1.347377800956062E+001 -1.341087455712079E+001 -1.334647225486714E+001 +-1.328064587732172E+001 -1.321347240556882E+001 -1.314503084944953E+001 -1.307540206008800E+001 +-1.300466853339831E+001 -1.293291420526556E+001 -1.286022423895226E+001 -1.278668480641658E+001 +-1.271238286427913E+001 -1.263740592478950E+001 -1.256184182421756E+001 -1.248577848930240E+001 +-1.240930370255545E+001 -1.233250486823096E+001 -1.225546878008845E+001 -1.217828139226253E+001 +-1.210102759435813E+001 -1.202379099191798E+001 -1.194665369376763E+001 -1.186969610718727E+001 +-1.179299674194595E+001 -1.171663202426062E+001 -1.164067612160114E+001 -1.156520077921395E+001 +-1.149027516906040E+001 -1.141596575182828E+001 -1.134233615252144E+001 -1.126944705011086E+001 +-1.119735608154489E+001 -1.112611776030215E+001 -1.105578340959877E+001 -1.098640111024493E+001 +-1.091801566302331E+001 -1.085066856536233E+001 -1.078439800206024E+001 -1.071923884955533E+001 +-1.065522269331204E+001 -1.059237785782056E+001 -1.053072944850924E+001 -1.047029940494794E+001 +-1.041110656455967E+001 -1.035316673608812E+001 -1.029649278205090E+001 -1.024109470942810E+001 +-1.018697976756537E+001 -1.013415255247601E+001 -1.008261511697757E+001 -1.003236708545210E+001 +-9.983405772535807E+000 -9.935726305125749E+000 -9.889321746611463E+000 -9.844183222796007E+000 +-9.800300048720295E+000 -9.757659855668640E+000 -9.716248717840239E+000 -9.676051277960063E+000 +-9.637050871334512E+000 -9.599229647771670E+000 -9.562568690995423E+000 -9.527048135193324E+000 +-9.492647278116808E+000 -9.459344690535071E+000 -9.427118321785597E+000 -9.395945601070656E+000 +-9.365803534417072E+000 -9.336668797080284E+000 -9.308517821272860E+000 -9.281326879132708E+000 +-9.255072160847146E+000 -9.229729847950717E+000 -9.205276181783534E+000 -9.181687527184945E+000 +-9.158940431374281E+000 -9.137011678159345E+000 -9.115878337639932E+000 -9.095517811342237E+000 +-9.075907873049925E+000 -9.057026705469729E+000 -9.038852932746551E+000 -9.021365649177264E+000 +-9.004544444191115E+000 -8.988369423694435E+000 -8.972821228076237E+000 -8.957881046995908E+000 +-8.943530631161165E+000 -8.929752301220542E+000 -8.916528953957812E+000 -8.903844066026828E+000 +-8.891681695318272E+000 -8.880026480155749E+000 -8.868863636470666E+000 -8.858178953120127E+000 +-8.847958785505392E+000 -8.838190047611626E+000 -8.828860202651759E+000 -8.819957252367745E+000 +-8.811469725172648E+000 -8.803386663259079E+000 -8.795697608720873E+000 -8.788392588876089E+000 +-8.781462100837521E+000 -8.774897095432207E+000 -8.768688960544338E+000 -8.762829503984177E+000 +-8.757310935982117E+000 -8.752125851327975E+000 -8.747267211260372E+000 -8.742728325139746E+000 +-8.738502832009978E+000 -8.734584682101231E+000 -8.730968118282474E+000 -8.727647657589770E+000 +-8.724618072851070E+000 -8.721874374460281E+000 -8.719411792400074E+000 -8.717225758537170E+000 +-8.715311889264902E+000 -8.713665968562188E+000 -8.712283931561705E+000 -8.711161848700399E+000 +-8.710295910496116E+000 -8.709682413098740E+000 -8.709317744694058E+000 -8.709198372858058E+000 +-8.709320833019158E+000 -8.709681718106172E+000 -8.710277669552827E+000 -8.711105369816513E+000 +-8.712161536563439E+000 -8.713442918708921E+000 -8.714946294473593E+000 -8.716668471706974E+000 +-8.718606290663759E+000 -8.720756629472147E+000 -8.723116412564590E+000 -8.725682622267726E+000 +-8.728452313909155E+000 -8.731422634668757E+000 -8.734590846458955E+000 -8.737954353205991E+000 +-8.741510732754554E+000 -8.745257773804218E+000 -8.749193518150964E+000 -8.753316308527662E+000 +-8.757624842452856E+000 -8.762118232300979E+000 -8.766796071976172E+000 -8.771658510458844E+000 +-8.776706332452548E+000 -8.781941046450155E+000 -8.787364980368102E+000 -8.792981384990270E+000 +-8.798794545329867E+000 -8.804809899974808E+000 -8.811034168522955E+000 -8.817475487020811E+000 +-8.824143551344255E+000 -8.831049768352644E+000 -8.838207414560046E+000 -8.845631802017921E+000 +-8.853340450949318E+000 -8.861353268659975E+000 -8.869692734095642E+000 -8.878384087318247E+000 +-8.887455523120522E+000 -8.896938387831877E+000 -8.906867378336511E+000 -8.917280742189305E+000 +-8.928220477628996E+000 -8.939732532254727E+000 -8.951866999008118E+000 -8.964678308101051E+000 +-8.978225413461848E+000 -8.992571972252700E+000 -9.007786516045700E+000 -9.023942612221081E+000 +-9.041119014232269E+000 -9.059399799435017E+000 -9.078874493265170E+000 -9.099638178683817E+000 +-9.121791589927124E+000 -9.145441189772473E+000 -9.170699229700226E+000 -9.197683792520374E+000 +-9.226518817240889E+000 -9.257334106153120E+000 -9.290265314312474E+000 -9.325453921789713E+000 +-9.363047189246743E+000 -9.403198097542079E+000 -9.446065272208756E+000 -9.491812893723150E+000 +-9.540610594540652E+000 -9.592633343871304E+000 -9.648061321102626E+000 -9.707079778689137E+000 +-9.769878895127455E+000 -9.836653618436840E+000 -9.907603500279004E+000 -9.982932520489527E+000 +-1.006284890145290E+001 -1.014756491128332E+001 -1.023729665434115E+001 -1.033226384712945E+001 +-1.043268957707676E+001 -1.053880004124640E+001 -1.065082426144948E+001 -1.076899377176006E+001 +-1.089354227394288E+001 -1.102470525580413E+001 -1.116271956708029E+001 -1.130782294703174E+001 +-1.146025349757189E+001 -1.162024909543868E+001 -1.178804673661196E+001 -1.196388180599716E+001 +-1.214798726516655E+001 -1.234059275086763E+001 -1.254192357694165E+001 -1.275219963224807E+001 +-1.297163416731305E+001 -1.320043246250130E+001 -1.343879037073776E+001 -1.368689272811462E+001 +-1.394491162606845E+001 -1.421300453934361E+001 -1.449131230452925E+001 -1.477995694470620E+001 +-1.507903933661961E+001 -1.538863671777946E+001 -1.570880003211180E+001 -1.603955111410914E+001 +-1.638087971298054E+001 -1.673274036002423E+001 -1.709504908434793E+001 -1.746767998419723E+001 +-1.785046166340513E+001 -1.824317354498896E+001 -1.864554207655947E+001 -1.905723684498398E+001 +-1.947786662074713E+001 -1.990697535553421E+001 -2.034403815986398E+001 -2.078845729111545E+001 +-2.123955818611071E+001 -2.169658557676996E+001 -2.215869973243336E+001 -2.262497287872366E+001 +-2.309438585083860E+001 -2.356582504968371E+001 -2.403807978330937E+001 -2.450984009483394E+001 +-2.497969520278392E+001 -2.544613271180549E+001 -2.590753879197173E+001 -2.636219957367488E+001 +-2.680830406117869E+001 -2.724394892812452E+001 -2.766714561648865E+001 -2.807583020702422E+001 +-2.846787655072657E+001 -2.884111313089413E+001 -2.919334404650859E+001 -2.952237435499421E+001 +-2.982603977859174E+001 -3.010224046939931E+001 -3.034897816723853E+001 -3.056439571488066E+001 +-3.074681757522653E+001 -3.089478978832902E+001 -3.100711776564481E+001 -3.108290046970368E+001 +-3.112155985358311E+001 -3.112286487617053E+001 -3.108694987208094E+001 -3.101432743265543E+001 +-3.090589615426976E+001 -3.076294357692137E+001 -3.058714436299724E+001 -3.038055329172233E+001 +-3.014559203699602E+001 -2.988502803078262E+001 -2.960194305399332E+001 -2.929968857917834E+001 +-2.898182432174341E+001 -2.865203592024938E+001 -2.831402712580177E+001 -2.797138129280300E+001 +-2.762738628795404E+001 -2.728481662939762E+001 -2.694567186628333E+001 -2.661086240643594E+001 +-2.628038052151570E+001 -2.595411995036496E+001 -2.563199201460306E+001 -2.531391744225404E+001 +-2.499982438126566E+001 -2.468964707778963E+001 -2.438332476196889E+001 -2.408080072161843E+001 +-2.378202154107996E+001 -2.348693648195098E+001 -2.319549698359870E+001 -2.290765626340291E+001 +-2.262336899907351E+001 -2.234259107785765E+001 -2.206527939980480E+001 -2.179139172439187E+001 +-2.152088655169713E+001 -2.125372303092616E+001 -2.098986089046358E+001 -2.072926038476817E+001 +-2.047188225436555E+001 -2.021768769596601E+001 -1.996663834035521E+001 -1.971869623620574E+001 +-1.947382383837249E+001 -1.923198399592940E+001 -1.899313995717031E+001 -1.875725536177139E+001 +-1.852429421918500E+001 -1.829422091850869E+001 -1.806700025356700E+001 -1.784259740137339E+001 +-1.762097788624078E+001 -1.740210762097372E+001 -1.718595291046741E+001 -1.697248042788758E+001 +-1.676165722118234E+001 -1.655345071147621E+001 -1.634782869126039E+001 -1.614475932237413E+001 +-1.594421113379202E+001 -1.574615301924318E+001 -1.555055423469106E+001 -1.535738439570444E+001 +-1.516661347475099E+001 -1.497821179843881E+001 -1.479215004472817E+001 -1.460839924012838E+001 +-1.442693075688691E+001 -1.424771631017311E+001 -1.407072795525068E+001 -1.389593808463055E+001 +-1.372331942519179E+001 -1.355284503525716E+001 -1.338448830161204E+001 -1.321822293645549E+001 +-1.305402297427660E+001 -1.289186276865331E+001 -1.273171698897349E+001 -1.257356061708371E+001 +-1.241736894387344E+001 -1.226311756580531E+001 -1.211078238140469E+001 -1.196033958772152E+001 +-1.181176567677910E+001 -1.166503743202257E+001 -1.152013192477933E+001 -1.137702651074196E+001 +-1.123569882648163E+001 -1.109612678599939E+001 -1.095828857731882E+001 -1.082216265912407E+001 +-1.068772775744376E+001 -1.055496286238122E+001 -1.042384722489001E+001 -1.029436035359324E+001 +-1.016648201164381E+001 -1.004019221362317E+001 -9.915471222479313E+000 -9.792299546493824E+000 +-9.670657936284790E+000 -9.550527381836304E+000 -9.431889109558345E+000 -9.314724579373511E+000 +-9.199015481831388E+000 -9.084743735249603E+000 -8.971891482882855E+000 -8.860441090120039E+000 +-8.750375141710334E+000 -8.641676439019356E+000 -8.534327997315803E+000 -8.428313043089844E+000 +-8.323615011403607E+000 -8.220217543274172E+000 -8.118104483089860E+000 -8.017259876059391E+000 +-7.917667965694434E+000 -7.819313191325248E+000 -7.722180185648954E+000 -7.626253772310575E+000 +-7.531518963515921E+000 -7.437960957676301E+000 -7.345565137084280E+000 -7.254317065619902E+000 +-7.164202486487238E+000 -7.075207319980158E+000 -6.987317661277279E+000 -6.900519778265368E+000 +-6.814800109390507E+000 -6.730145261537054E+000 -6.646542007933245E+000 -6.563977286083675E+000 +-6.482438195727791E+000 -6.401911996823990E+000 -6.322386107559327E+000 -6.243848102383939E+000 +-6.166285710070168E+000 -6.089686811796084E+000 -6.014039439252619E+000 -5.939331772774660E+000 +-5.865552139495164E+000 -5.792689011522391E+000 -5.720731004139862E+000 -5.649666874028537E+000 +-5.579485517511340E+000 -5.510175968819317E+000 -5.441727398379454E+000 -5.374129111123812E+000 +-5.307370544819541E+000 -5.241441268419842E+000 -5.176330980435239E+000 -5.112029507325206E+000 +-5.048526801909794E+000 -4.985812941800837E+000 -4.923878127852904E+000 -4.862712682633193E+000 +-4.802307048910673E+000 -4.742651788163887E+000 -4.683737579107226E+000 -4.625555216235609E+000 +-4.568095608387134E+000 -4.511349777323604E+000 -4.455308856328672E+000 -4.399964088823396E+000 +-4.345306826998153E+000 -4.291328530478738E+000 -4.238020764629016E+000 -4.185375201171141E+000 +-4.133383611312292E+000 -4.082037633410822E+000 -4.031329747527034E+000 -3.981251765117995E+000 +-3.931795861398061E+000 -3.882954308781589E+000 -3.834719475676578E+000 -3.787083825292160E+000 +-3.740039914460994E+000 -3.693580392476275E+000 -3.647697999943111E+000 -3.602385567644295E+000 +-3.557636015420044E+000 -3.513442351061737E+000 -3.469797669219388E+000 -3.426695150322613E+000 +-3.384128059515133E+000 -3.342089745602362E+000 -3.300573639982462E+000 -3.259573255741968E+000 +-3.219082186454329E+000 -3.179094105307605E+000 -3.139602764082751E+000 -3.100601992177352E+000 +-3.062085695641461E+000 -3.024047856225367E+000 -2.986482530439292E+000 -2.949383848624644E+000 +-2.912746014036870E+000 -2.876563301939862E+000 -2.840830058711185E+000 -2.805540700958905E+000 +-2.770689714649065E+000 -2.736271654244146E+000 -2.702281141852195E+000 -2.668712866386488E+000 +-2.635561582735696E+000 -2.602822110944299E+000 -2.570489335403213E+000 -2.538558204050491E+000 +-2.507023727581883E+000 -2.475880978671295E+000 -2.445125091200843E+000 -2.414751259500531E+000 +-2.384754737597372E+000 -2.355130838473776E+000 -2.325874933335249E+000 -2.296982450887084E+000 +-2.268448876620115E+000 -2.240269752105315E+000 -2.212440674297141E+000 -2.184957294845578E+000 +-2.157815319416663E+000 -2.131010507021511E+000 -2.104538669353662E+000 -2.078395670134610E+000 +-2.052577424467550E+000 -2.027079898199066E+000 -2.001899107288795E+000 -1.977031117186939E+000 +-1.952472042219439E+000 -1.928218044980875E+000 -1.904265335734831E+000 -1.880610171821746E+000 +-1.857248857074147E+000 -1.834177741239061E+000 -1.811393219407713E+000 -1.788891731452205E+000 +-1.766669761469261E+000 -1.744723837230869E+000 -1.723050529641706E+000 -1.701646452203378E+000 +-1.680508260485233E+000 -1.659632651601807E+000 -1.639016363696745E+000 -1.618656175433110E+000 +-1.598548905490075E+000 -1.578691412065793E+000 -1.559080592386516E+000 -1.539713382221777E+000 +-1.520586755405577E+000 -1.501697723363573E+000 -1.483043334646071E+000 -1.464620674466879E+000 +-1.446426864247869E+000 -1.428459061169174E+000 -1.410714457725012E+000 -1.393190281284990E+000 +-1.375883793660883E+000 -1.358792290678796E+000 -1.341913101756608E+000 -1.325243589486717E+000 +-1.308781149223912E+000 -1.292523208678406E+000 -1.276467227513918E+000 -1.260610696950718E+000 +-1.244951139373652E+000 -1.229486107944987E+000 -1.214213186222093E+000 -1.199129987779885E+000 +-1.184234155837914E+000 -1.169523362892139E+000 -1.154995310351229E+000 -1.140647728177415E+000 +-1.126478374531797E+000 -1.112485035424036E+000 -1.098665524366429E+000 -1.085017682032258E+000 +-1.071539375918387E+000 -1.058228500012070E+000 -1.045082974461860E+000 -1.032100745252650E+000 +-1.019279783884710E+000 -1.006618087056741E+000 -9.941136763528576E-001 -9.817645979334413E-001 +-9.695689222298702E-001 -9.575247436430017E-001 -9.456301802454230E-001 -9.338833734874100E-001 +-9.222824879065024E-001 -9.108257108407315E-001 -8.995112521453683E-001 -8.883373439132202E-001 +-8.773022401983972E-001 -8.664042167434876E-001 -8.556415707101603E-001 -8.450126204130719E-001 +-8.345157050571125E-001 -8.241491844779059E-001 -8.139114388855168E-001 -8.038008686113709E-001 +-7.938158938582910E-001 -7.839549544536559E-001 -7.742165096056242E-001 -7.645990376623721E-001 +-7.551010358743462E-001 -7.457210201594401E-001 -7.364575248711132E-001 -7.273091025693836E-001 +-7.182743237946505E-001 -7.093517768443531E-001 -7.005400675523746E-001 -6.918378190712091E-001 +-6.832436716568303E-001 -6.747562824562154E-001 -6.663743252975396E-001 -6.580964904829402E-001 +-6.499214845838848E-001 -6.418480302390723E-001 -6.338748659548330E-001 -6.260007459080297E-001 +-6.182244397513825E-001 -6.105447324212323E-001 -6.029604239476875E-001 -5.954703292671153E-001 +-5.880732780369868E-001 -5.807681144529955E-001 -5.735536970684683E-001 -5.664288986160132E-001 +-5.593926058313736E-001 -5.524437192794903E-001 -5.455811531826993E-001 -5.388038352510860E-001 +-5.321107065149363E-001 -5.255007211592658E-001 -5.189728463604174E-001 -5.125260621246716E-001 +-5.061593611288735E-001 -4.998717485630419E-001 -4.936622419749195E-001 -4.875298711164701E-001 +-4.814736777922701E-001 -4.754927157097898E-001 -4.695860503315377E-001 -4.637527587290290E-001 +-4.579919294385851E-001 -4.523026623189080E-001 -4.466840684104339E-001 -4.411352697964357E-001 +-4.356553994658389E-001 -4.302436011777575E-001 -4.248990293276972E-001 -4.196208488154324E-001 +-4.144082349145212E-001 -4.092603731434346E-001 -4.041764591382990E-001 -3.991556985272073E-001 +-3.941973068060981E-001 -3.893005092161788E-001 -3.844645406228618E-001 -3.796886453962172E-001 +-3.749720772928981E-001 -3.703140993395420E-001 -3.657139837176182E-001 -3.611710116497004E-001 +-3.566844732871619E-001 -3.522536675992547E-001 -3.478779022635744E-001 -3.435564935578870E-001 +-3.392887662532884E-001 -3.350740535087058E-001 -3.309116967666975E-001 -3.268010456505532E-001 +-3.227414578626746E-001 -3.187322990842085E-001 -3.147729428759414E-001 -3.108627705804088E-001 +-3.070011712252340E-001 -3.031875414276625E-001 -2.994212853002783E-001 -2.957018143579003E-001 +-2.920285474256257E-001 -2.884009105480222E-001 -2.848183368994488E-001 -2.812802666954827E-001 +-2.777861471054577E-001 -2.743354321660782E-001 -2.709275826961138E-001 -2.675620662121524E-001 +-2.642383568453956E-001 -2.609559352594935E-001 -2.577142885693946E-001 -2.545129102612081E-001 +-2.513513001130608E-001 -2.482289641169340E-001 -2.451454144014766E-001 -2.421001691557716E-001 +-2.390927525540534E-001 + + + +-1.126741090995861E-007 -1.155264677465885E-007 -1.184510341962707E-007 -1.214496363978473E-007 +-1.245241485752880E-007 -1.276764923987662E-007 -1.309086381857674E-007 -1.342226061326007E-007 +-1.376204675770872E-007 -1.411043462932145E-007 -1.446764198185632E-007 -1.483389208153393E-007 +-1.520941384658608E-007 -1.559444199033706E-007 -1.598921716790725E-007 -1.639398612663019E-007 +-1.680900186027780E-007 -1.723452376718975E-007 -1.767081781240574E-007 -1.811815669390247E-007 +-1.857682001303858E-007 -1.904709444931463E-007 -1.952927393955716E-007 -2.002365986163871E-007 +-2.053056122284887E-007 -2.105029485303374E-007 -2.158318560262502E-007 -2.212956654568201E-007 +-2.268977918807371E-007 -2.326417368093126E-007 -2.385310903950352E-007 -2.445695336755341E-007 +-2.507608408743475E-007 -2.571088817599341E-007 -2.636176240644054E-007 -2.702911359634857E-007 +-2.771335886192552E-007 -2.841492587872611E-007 -2.913425314896293E-007 -2.987179027558464E-007 +-3.062799824329225E-007 -3.140334970666962E-007 -3.219832928560796E-007 -3.301343386820890E-007 +-3.384917292135598E-007 -3.470606880914757E-007 -3.558465711939171E-007 -3.648548699836575E-007 +-3.740912149405067E-007 -3.835613790805442E-007 -3.932712815644397E-007 -4.032269913971215E-007 +-4.134347312211035E-007 -4.239008812058353E-007 -4.346319830355191E-007 -4.456347439978720E-007 +-4.569160411763986E-007 -4.684829257487926E-007 -4.803426273941505E-007 -4.925025588117583E-007 +-5.049703203542654E-007 -5.177537047781533E-007 -5.308607021144617E-007 -5.442995046628150E-007 +-5.580785121118805E-007 -5.722063367894399E-007 -5.866918090453765E-007 -6.015439827709301E-007 +-6.167721410576722E-007 -6.323858019997415E-007 -6.483947246429569E-007 -6.648089150845408E-007 +-6.816386327272527E-007 -6.988943966918482E-007 -7.165869923918752E-007 -7.347274782748975E-007 +-7.533271927343912E-007 -7.723977611966030E-007 -7.919511033868196E-007 -8.119994407795859E-007 +-8.325553042375141E-007 -8.536315418434853E-007 -8.752413269311155E-007 -8.973981663185116E-007 +-9.201159087504795E-007 -9.434087535544262E-007 -9.672912595154064E-007 -9.917783539758304E-007 +-1.016885342165536E-006 -1.042627916768060E-006 -1.069022167729059E-006 -1.096084592313055E-006 +-1.123832105414757E-006 -1.152282050131415E-006 -1.181452208602822E-006 -1.211360813125716E-006 +-1.242026557549562E-006 -1.273468608960808E-006 -1.305706619662932E-006 -1.338760739459776E-006 +-1.372651628249807E-006 -1.407400468939232E-006 -1.443028980681992E-006 -1.479559432454936E-006 +-1.517014656976655E-006 -1.555418064978655E-006 -1.594793659837824E-006 -1.635166052579322E-006 +-1.676560477259250E-006 -1.719002806736771E-006 -1.762519568845451E-006 -1.807137962974031E-006 +-1.852885877066906E-006 -1.899791905054997E-006 -1.947885364727874E-006 -1.997196316058314E-006 +-2.047755579990749E-006 -2.099594757705353E-006 -2.152746250369784E-006 -2.207243279390969E-006 +-2.263119907179534E-006 -2.320411058439908E-006 -2.379152541999386E-006 -2.439381073189786E-006 +-2.501134296795729E-006 -2.564450810583805E-006 -2.629370189427427E-006 -2.695933010042398E-006 +-2.764180876348645E-006 -2.834156445474017E-006 -2.905903454416328E-006 -2.979466747380393E-006 +-3.054892303807087E-006 -3.132227267111951E-006 -3.211519974151359E-006 -3.292819985434555E-006 +-3.376178116100576E-006 -3.461646467679324E-006 -3.549278460656671E-006 -3.639128867863994E-006 +-3.731253848712889E-006 -3.825710984296624E-006 -3.922559313380125E-006 -4.021859369301091E-006 +-4.123673217805262E-006 -4.228064495839442E-006 -4.335098451326624E-006 -4.444841983948011E-006 +-4.557363686957414E-006 -4.672733890054247E-006 -4.791024703341732E-006 -4.912310062398063E-006 +-5.036665774488421E-006 -5.164169565946925E-006 -5.294901130758051E-006 -5.428942180367832E-006 +-5.566376494756115E-006 -5.707289974801660E-006 -5.851770695972884E-006 -5.999908963377817E-006 +-6.151797368207551E-006 -6.307530845608693E-006 -6.467206734020765E-006 -6.630924836015752E-006 +-6.798787480677884E-006 -6.970899587562368E-006 -7.147368732273535E-006 -7.328305213702788E-006 +-7.513822122968902E-006 -7.704035414103497E-006 -7.899063976525771E-006 -8.099029709352230E-006 +-8.304057597587260E-006 -8.514275790242638E-006 -8.729815680434690E-006 -8.950811987508826E-006 +-9.177402841243501E-006 -9.409729868185376E-006 -9.647938280170290E-006 -9.892176965085162E-006 +-1.014259857992728E-005 -1.039935964621977E-005 -1.066262064784216E-005 -1.093254613133767E-005 +-1.120930480875994E-005 -1.149306966312284E-005 -1.178401805652039E-005 -1.208233184098323E-005 +-1.238819747214158E-005 -1.270180612576571E-005 -1.302335381725628E-005 -1.335304152416014E-005 +-1.369107531178693E-005 -1.403766646200620E-005 -1.439303160530485E-005 -1.475739285618736E-005 +-1.513097795200422E-005 -1.551402039529414E-005 -1.590675959973014E-005 -1.630944103976013E-005 +-1.672231640403531E-005 -1.714564375272326E-005 -1.757968767880272E-005 -1.802471947344189E-005 +-1.848101729556336E-005 -1.894886634570106E-005 -1.942855904425918E-005 -1.992039521428286E-005 +-2.042468226885621E-005 -2.094173540324436E-005 -2.147187779189890E-005 -2.201544079045150E-005 +-2.257276414282003E-005 -2.314419619355805E-005 -2.373009410557996E-005 -2.433082408339723E-005 +-2.494676160200682E-005 -2.557829164157277E-005 -2.622580892804950E-005 -2.688971817989632E-005 +-2.757043436103682E-005 -2.826838294022305E-005 -2.898400015696434E-005 -2.971773329418861E-005 +-3.047004095780621E-005 -3.124139336334996E-005 -3.203227262987285E-005 -3.284317308128418E-005 +-3.367460155531496E-005 -3.452707772030455E-005 -3.540113440000587E-005 -3.629731790661434E-005 +-3.721618838222611E-005 -3.815832014894063E-005 -3.912430206782656E-005 -4.011473790697329E-005 +-4.113024671886154E-005 -4.217146322728517E-005 -4.323903822406878E-005 -4.433363897582811E-005 +-4.545594964102625E-005 -4.660667169758958E-005 -4.778652438134631E-005 -4.899624513556548E-005 +-5.023659007187540E-005 -5.150833444284968E-005 -5.281227312655719E-005 -5.414922112337751E-005 +-5.552001406539344E-005 -5.692550873867859E-005 -5.836658361880589E-005 -5.984413941991294E-005 +-6.135909965766582E-005 -6.291241122647466E-005 -6.450504499132077E-005 -6.613799639456562E-005 +-6.781228607812075E-005 -6.952896052136732E-005 -7.128909269522454E-005 -7.309378273277527E-005 +-7.494415861686761E-005 -7.684137688512348E-005 -7.878662335279278E-005 -8.078111385390712E-005 +-8.282609500119500E-005 -8.492284496523283E-005 -8.707267427332077E-005 -8.927692662858019E-005 +-9.153697974978674E-005 -9.385424623246267E-005 -9.623017443176662E-005 -9.866624936773362E-005 +-1.011639936534293E-004 -1.037249684466004E-004 -1.063507744254144E-004 -1.090430527888999E-004 +-1.118034862827112E-004 -1.146338002508588E-004 -1.175357637140640E-004 -1.205111904754107E-004 +-1.235619402539839E-004 -1.266899198472071E-004 -1.298970843226008E-004 -1.331854382397091E-004 +-1.365570369029594E-004 -1.400139876462333E-004 -1.435584511499577E-004 -1.471926427915334E-004 +-1.509188340299498E-004 -1.547393538254476E-004 -1.586565900951179E-004 -1.626729912053487E-004 +-1.667910675020478E-004 -1.710133928796028E-004 -1.753426063895554E-004 -1.797814138899956E-004 +-1.843325897367087E-004 -1.889989785171288E-004 -1.937834968281847E-004 -1.986891350991481E-004 +-2.037189594606228E-004 -2.088761136608441E-004 -2.141638210304836E-004 -2.195853864971896E-004 +-2.251441986511213E-004 -2.308437318627645E-004 -2.366875484543574E-004 -2.426793009262777E-004 +-2.488227342397870E-004 -2.551216881575557E-004 -2.615800996434309E-004 -2.682020053229497E-004 +-2.749915440061301E-004 -2.819529592741213E-004 -2.890906021313269E-004 -2.964089337246548E-004 +-3.039125281316018E-004 -3.116060752189026E-004 -3.194943835735405E-004 -3.275823835079457E-004 +-3.358751301412554E-004 -3.443778065585701E-004 -3.530957270501694E-004 -3.620343404327197E-004 +-3.711992334545408E-004 -3.805961342870695E-004 -3.902309161046849E-004 -4.001096007551504E-004 +-4.102383625229517E-004 -4.206235319878878E-004 -4.312715999813260E-004 -4.421892216425844E-004 +-4.533832205779889E-004 -4.648605931251907E-004 -4.766285127254138E-004 -4.886943344063674E-004 +-5.010655993786076E-004 -5.137500397482417E-004 -5.267555833489003E-004 -5.400903586960053E-004 +-5.537627000664258E-004 -5.677811527066875E-004 -5.821544781730031E-004 -5.968916598064452E-004 +-6.120019083466865E-004 -6.274946676878204E-004 -6.433796207798335E-004 -6.596666956794492E-004 +-6.763660717540897E-004 -6.934881860428506E-004 -7.110437397784567E-004 -7.290437050742551E-004 +-7.474993317804489E-004 -7.664221545138326E-004 -7.858239998654214E-004 -8.057169937904857E-004 +-8.261135691855849E-004 -8.470264736573529E-004 -8.684687774878709E-004 -8.904538818016055E-004 +-9.129955269390172E-004 -9.361078010420427E-004 -9.598051488568450E-004 -9.841023807593018E-004 +-1.009014682008871E-003 -1.034557622236620E-003 -1.060747165173318E-003 -1.087599678623690E-003 +-1.115131944693043E-003 -1.143361170272645E-003 -1.172304997790412E-003 -1.201981516233594E-003 +-1.232409272450357E-003 -1.263607282737307E-003 -1.295595044720174E-003 -1.328392549535106E-003 +-1.362020294318103E-003 -1.396499295010471E-003 -1.431851099488216E-003 -1.468097801023602E-003 +-1.505262052087265E-003 -1.543367078499480E-003 -1.582436693939420E-003 -1.622495314821466E-003 +-1.663567975547820E-003 -1.705680344146948E-003 -1.748858738307620E-003 -1.793130141818505E-003 +-1.838522221423618E-003 -1.885063344104095E-003 -1.932782594797085E-003 -1.981709794562812E-003 +-2.031875519211104E-003 -2.083311118399024E-003 -2.136048735211519E-003 -2.190121326237238E-003 +-2.245562682152102E-003 -2.302407448823381E-003 -2.360691148947477E-003 -2.420450204234881E-003 +-2.481721958156120E-003 -2.544544699262878E-003 -2.608957685098774E-003 -2.675001166714764E-003 +-2.742716413804366E-003 -2.812145740474394E-003 -2.883332531667261E-003 -2.956321270251241E-003 +-3.031157564795632E-003 -3.107888178048066E-003 -3.186561056131680E-003 -3.267225358480381E-003 +-3.349931488530724E-003 -3.434731125189629E-003 -3.521677255097413E-003 -3.610824205706251E-003 +-3.702227679194663E-003 -3.795944787239033E-003 -3.892034086663890E-003 -3.990555615993030E-003 +-4.091570932924264E-003 -4.195143152751053E-003 -4.301336987754880E-003 -4.410218787592905E-003 +-4.521856580705951E-003 -4.636320116772548E-003 -4.753680910235442E-003 -4.874012284927482E-003 +-4.997389419824772E-003 -5.123889395955340E-003 -5.253591244492503E-003 -5.386575996062808E-003 +-5.522926731299002E-003 -5.662728632669590E-003 -5.806069037616968E-003 -5.953037493037121E-003 +-6.103725811134781E-003 -6.258228126688368E-003 -6.416640955760596E-003 -6.579063255890776E-003 +-6.745596487806282E-003 -6.916344678691412E-003 -7.091414487052580E-003 -7.270915269220368E-003 +-7.454959147529204E-003 -7.643661080217131E-003 -7.837138933088772E-003 -8.035513552985691E-003 +-8.238908843109844E-003 -8.447451840246409E-003 -8.661272793933793E-003 -8.880505247629763E-003 +-9.105286121923642E-003 -9.335755799846121E-003 -9.572058214329200E-003 -9.814340937870182E-003 +-1.006275527445515E-002 -1.031745635379825E-002 -1.057860322795526E-002 -1.084635897037065E-002 +-1.112089077741906E-002 -1.140237007250406E-002 -1.169097261277757E-002 -1.198687859854627E-002 +-1.229027278543168E-002 -1.260134459935304E-002 -1.292028825440358E-002 -1.324730287369238E-002 +-1.358259261322613E-002 -1.392636678890651E-002 -1.427884000672113E-002 -1.464023229620789E-002 +-1.501076924727393E-002 -1.539068215045349E-002 -1.578020814068999E-002 -1.617959034473032E-002 +-1.658907803222132E-002 -1.700892677060048E-002 -1.743939858387554E-002 -1.788076211538966E-002 +-1.833329279467105E-002 -1.879727300846891E-002 -1.927299227607930E-002 -1.976074742906770E-002 +-2.026084279549734E-002 -2.077359038877481E-002 -2.129931010122775E-002 -2.183832990253121E-002 +-2.239098604310351E-002 -2.295762326259380E-002 -2.353859500358760E-002 -2.413426363065914E-002 +-2.474500065490221E-002 -2.537118696407504E-002 -2.601321305849749E-002 -2.667147929284188E-002 +-2.734639612396317E-002 -2.803838436491594E-002 -2.874787544531139E-002 -2.947531167816899E-002 +-3.022114653342246E-002 -3.098584491824331E-002 -3.176988346434785E-002 -3.257375082245979E-002 +-3.339794796410200E-002 -3.424298849089684E-002 -3.510939895155799E-002 -3.599771916676043E-002 +-3.690850256208100E-002 -3.784231650920470E-002 -3.879974267559762E-002 -3.978137738285134E-002 +-4.078783197390809E-002 -4.181973318938216E-002 -4.287772355319560E-002 -4.396246176775330E-002 +-4.507462311888651E-002 -4.621489989079868E-002 -4.738400179125393E-002 -4.858265638725238E-002 +-4.981160955144316E-002 -5.107162591953046E-002 -5.236348935893351E-002 -5.368800344896835E-002 +-5.504599197282353E-002 -5.643829942160779E-002 -5.786579151075542E-002 -5.932935570907750E-002 +-6.082990178075801E-002 -6.236836234059522E-002 -6.394569342279828E-002 -6.556287506365432E-002 +-6.722091189838549E-002 -6.892083377252693E-002 -7.066369636815682E-002 -7.245058184532156E-002 +-7.428259949900270E-002 -7.616088643197870E-002 -7.808660824394410E-002 -8.006095973725155E-002 +-8.208516563965239E-002 -8.416048134441551E-002 -8.628819366821151E-002 -8.846962162715780E-002 +-9.070611723142469E-002 -9.299906629880929E-002 -9.534988928769340E-002 -9.776004214980245E-002 +-1.002310172031969E-001 -1.027643440259263E-001 -1.053615903707868E-001 -1.080243631016288E-001 +-1.107543091516642E-001 -1.135531165042333E-001 -1.164225151964925E-001 -1.193642783464923E-001 +-1.223802232041193E-001 -1.254722122263776E-001 -1.286421541774958E-001 -1.318920052543448E-001 +-1.352237702376545E-001 -1.386395036695267E-001 -1.421413110577351E-001 -1.457313501073159E-001 +-1.494118319799436E-001 -1.531850225815944E-001 -1.570532438789984E-001 -1.610188752453756E-001 +-1.650843548359594E-001 -1.692521809937974E-001 -1.735249136863224E-001 -1.779051759731823E-001 +-1.823956555058033E-001 -1.869991060591663E-001 -1.917183490962529E-001 -1.965562753656202E-001 +-2.015158465325431E-001 -2.066000968441458E-001 -2.118121348289422E-001 -2.171551450311704E-001 +-2.226323897802931E-001 -2.282472109960173E-001 -2.340030320291451E-001 -2.399033595385603E-001 +-2.459517854046022E-001 -2.521519886790562E-001 -2.585077375719484E-001 -2.650228914752785E-001 +-2.717014030237953E-001 -2.785473201928535E-001 -2.855647884333330E-001 -2.927580528435526E-001 +-3.001314603780194E-001 -3.076894620928077E-001 -3.154366154272564E-001 -3.233775865215995E-001 +-3.315171525700458E-001 -3.398602042087123E-001 -3.484117479377188E-001 -3.571769085766132E-001 +-3.661609317521728E-001 -3.753691864174853E-001 -3.848071674010489E-001 -3.944804979844818E-001 +-4.043949325072282E-001 -4.145563589964751E-001 -4.249708018202722E-001 -4.356444243616172E-001 +-4.465835317110437E-001 -4.577945733749677E-001 -4.692841459967773E-001 -4.810589960873428E-001 +-4.931260227612987E-001 -5.054922804751051E-001 -5.181649817625070E-001 -5.311514999626180E-001 +-5.444593719354169E-001 -5.580963007589713E-001 -5.720701584022235E-001 -5.863889883666155E-001 +-6.010610082892727E-001 -6.160946124998485E-001 -6.314983745224546E-001 -6.472810495134315E-001 +-6.634515766249300E-001 -6.800190812834753E-001 -6.969928773718290E-001 -7.143824693015220E-001 +-7.321975539624719E-001 -7.504480225350139E-001 -7.691439621485667E-001 -7.882956573699483E-001 +-8.079135915030522E-001 -8.280084476802587E-001 -8.485911097244661E-001 -8.696726627590688E-001 +-8.912643935415702E-001 -9.133777904947027E-001 -9.360245434071000E-001 -9.592165427735089E-001 +-9.829658787424076E-001 -1.007284839636650E+000 -1.032185910010263E+000 -1.057681768202096E+000 +-1.083785283344119E+000 -1.110509511779402E+000 -1.137867692841724E+000 -1.165873243945404E+000 +-1.194539754930651E+000 -1.223880981605916E+000 -1.253910838424983E+000 -1.284643390232416E+000 +-1.316092843006576E+000 -1.348273533525015E+000 -1.381199917872077E+000 -1.414886558703548E+000 +-1.449348111177906E+000 -1.484599307457896E+000 -1.520654939680539E+000 -1.557529841287179E+000 +-1.595238866598869E+000 -1.633796868515583E+000 -1.673218674210389E+000 -1.713519058682669E+000 +-1.754712716026301E+000 -1.796814228260952E+000 -1.839838031566183E+000 -1.883798379749220E+000 +-1.928709304768570E+000 -1.974584574126090E+000 -2.021437644930801E+000 -2.069281614427988E+000 +-2.118129166776900E+000 -2.167992515850654E+000 -2.218883343821204E+000 -2.270812735282193E+000 +-2.323791106652117E+000 -2.377828130589610E+000 -2.432932655142984E+000 -2.489112617345668E+000 +-2.546374950959995E+000 -2.604725488062551E+000 -2.664168854155634E+000 -2.724708356482052E+000 +-2.786345865213372E+000 -2.849081687176533E+000 -2.912914431779668E+000 -2.977840868795389E+000 +-3.043855777660017E+000 -3.110951787948824E+000 -3.179119210692590E+000 -3.248345860208869E+000 +-3.318616866132800E+000 -3.389914475348846E+000 -3.462217843545019E+000 -3.535502816137835E+000 +-3.609741698348491E+000 -3.684903014249826E+000 -3.760951254651117E+000 -3.837846613743069E+000 +-3.915544714491052E+000 -3.993996322840904E+000 -4.073147050889369E+000 -4.152937049273103E+000 +-4.233300689145533E+000 -4.314166234242856E+000 -4.395455503689904E+000 -4.477083526364375E+000 +-4.558958187827582E+000 -4.640979871040733E+000 -4.723041092321791E+000 -4.805026134259753E+000 +-4.886810677592283E+000 -4.968261434372732E+000 -5.049235785102661E+000 -5.129581422890452E+000 +-5.209136008115400E+000 -5.287726837531200E+000 -5.365170532235695E+000 -5.441272749463348E+000 +-5.515827923726221E+000 -5.588619043436204E+000 -5.659417469785441E+000 -5.727982805342765E+000 +-5.794062820536998E+000 -5.857393446941189E+000 -5.917698847039297E+000 -5.974691570941305E+000 +-6.028072811307485E+000 -6.077532768534345E+000 -6.122751139033164E+000 -6.163397740179403E+000 +-6.199133286209296E+000 -6.229610329967048E+000 -6.254474385934661E+000 -6.273365250377884E+000 +-6.285918534680279E+000 -6.291767427973547E+000 -6.290544704961770E+000 -6.281884994329302E+000 +-6.265427322261502E+000 -6.240817944332982E+000 -6.207713477262783E+000 -6.165784339728400E+000 +-6.114718508494126E+000 -6.054225592464499E+000 -5.984041222837040E+000 -5.903931752218848E+000 +-5.813699249304765E+000 -5.713186768415940E+000 -5.602283864795304E+000 -5.480932316994045E+000 +-5.349132006921396E+000 -5.206946896150050E+000 -5.054511023888581E+000 -4.892034437699690E+000 +-4.719808952662309E+000 -4.538213618405452E+000 -4.347719756508491E+000 -4.148895413481021E+000 +-3.942409057304448E+000 -3.729032328850276E+000 -3.509641644014471E+000 -3.285218428876452E+000 +-3.056847759503075E+000 -2.825715171203143E+000 -2.593101400275251E+000 -2.360374825898332E+000 +-2.128981392221127E+000 -1.900431812463062E+000 -1.676285889540162E+000 -1.458133833015132E+000 +-1.247574511620703E+000 -1.046190655700902E+000 -8.555211159312436E-001 -6.770303945822398E-001 +-5.120757939464325E-001 -3.618726733811468E-001 -2.274584711259200E-001 -1.096563282906759E-001 +-9.039348041338267E-003 7.410326992805605E-002 1.397967647871462E-001 1.884063468964680E-001 + 2.206558375286447E-001 2.376373161189566E-001 2.408094755127621E-001 2.319821999300481E-001 + 2.132847099535964E-001 1.871144625013242E-001 1.560638466997885E-001 1.228215699029496E-001 + 9.004546833679371E-002 6.020328628778985E-002 3.537772559570571E-002 1.703175227548087E-002 + 5.729742392182262E-003 8.095496302189142E-004 1.197524714767390E-012 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 + + + 1.586013978883939E-011 1.646618740130396E-011 1.709539330318276E-011 1.774864241895137E-011 + 1.842685348781618E-011 1.913098035584250E-011 1.986201331745792E-011 2.062098050821685E-011 + 2.140894935078544E-011 2.222702805618081E-011 2.307636718237494E-011 2.395816125245651E-011 + 2.487365043462572E-011 2.582412228638502E-011 2.681091356537915E-011 2.783541210943035E-011 + 2.889905878841407E-011 3.000334953071957E-011 3.114983742714533E-011 3.234013491518928E-011 + 3.357591604680394E-011 3.485891884280802E-011 3.619094773726428E-011 3.757387611526205E-011 + 3.900964894767382E-011 4.050028552659021E-011 4.204788230528247E-011 4.365461584668472E-011 + 4.532274588454422E-011 4.705461850154410E-011 4.885266942886796E-011 5.071942747184822E-011 + 5.265751806651487E-011 5.466966697204701E-011 5.675870410432086E-011 5.892756751594414E-011 + 6.117930752837676E-011 6.351709102194719E-011 6.594420588979928E-011 6.846406566203364E-011 + 7.108021430654552E-011 7.379633121331323E-011 7.661623636914610E-011 7.954389573016909E-011 + 8.258342679960258E-011 8.573910441867708E-011 8.901536677883355E-011 9.241682166365993E-011 + 9.594825292934515E-011 9.961462723276443E-011 1.034211010166569E-010 1.073730277617223E-010 + 1.114759655158339E-010 1.157356847109572E-010 1.201581762787705E-010 1.247496600763967E-010 + 1.295165936341012E-010 1.344656812372558E-010 1.396038833553429E-010 1.449384264312614E-010 + 1.504768130446988E-010 1.562268324638687E-010 1.621965716004506E-010 1.683944263831379E-010 + 1.748291135657956E-010 1.815096829868258E-010 1.884455302969928E-010 1.956464101736008E-010 + 2.031224500396125E-010 2.108841643070039E-010 2.189424691643821E-010 2.273086979296707E-010 + 2.359946169894514E-010 2.450124423473775E-010 2.543748568049389E-010 2.640950277987325E-010 + 2.741866259193352E-010 2.846638441378176E-010 2.955414177669405E-010 3.068346451851115E-010 + 3.185594093522382E-010 3.307322001477523E-010 3.433701375622096E-010 3.564909957750865E-010 + 3.701132281526431E-010 3.842559932009926E-010 3.989391815109001E-010 4.141834437321885E-010 + 4.300102196171047E-010 4.464417681734935E-010 4.635011989701727E-010 4.812125046385609E-010 + 4.996005946162512E-010 5.186913301799916E-010 5.385115608173515E-010 5.590891619882112E-010 + 5.804530743292034E-010 6.026333443562245E-010 6.256611667222746E-010 6.495689280900572E-010 + 6.743902526810206E-010 7.001600495649388E-010 7.269145617565036E-010 7.546914171880051E-010 + 7.835296816297790E-010 8.134699136328360E-010 8.445542215709659E-010 8.768263228625394E-010 + 9.103316054552744E-010 9.451171916604785E-010 9.812320044264963E-010 1.018726836144615E-009 + 1.057654420084177E-009 1.098069504557354E-009 1.140028929917928E-009 1.183591708502319E-009 + 1.228819107625327E-009 1.275774735747314E-009 1.324524631933985E-009 1.375137358734623E-009 + 1.427684098609355E-009 1.482238754041116E-009 1.538878051473079E-009 1.597681649217730E-009 + 1.658732249489382E-009 1.722115714717629E-009 1.787921188305405E-009 1.856241220001421E-009 + 1.927171896063324E-009 2.000812974394682E-009 2.077268024845737E-009 2.156644574875407E-009 + 2.239054260779264E-009 2.324612984696231E-009 2.413441077614861E-009 2.505663468608297E-009 + 2.601409860536133E-009 2.700814912460123E-009 2.804018429030354E-009 2.911165557108273E-009 + 3.022406989902972E-009 3.137899178907999E-009 3.257804553936633E-009 3.382291751565150E-009 + 3.511535852305356E-009 3.645718626839882E-009 3.785028791666659E-009 3.929662274512048E-009 + 4.079822489885875E-009 4.235720625166030E-009 4.397575937614782E-009 4.565616062744776E-009 + 4.740077334468187E-009 4.921205117479458E-009 5.109254152338980E-009 5.304488913743019E-009 + 5.507183982483914E-009 5.717624431623507E-009 5.936106227423015E-009 6.162936645593218E-009 + 6.398434703450231E-009 6.642931608584921E-009 6.896771224676707E-009 7.160310555107004E-009 + 7.433920245052558E-009 7.717985102764368E-009 8.012904640766167E-009 8.319093637732581E-009 + 8.636982721838012E-009 8.967018976396368E-009 9.309666568643050E-009 9.665407402544475E-009 + 1.003474179655199E-008 1.041818918725448E-008 1.081628885991873E-008 1.122960070694469E-008 + 1.165870601530346E-008 1.210420828406395E-008 1.256673407315908E-008 1.304693388458507E-008 + 1.354548307727224E-008 1.406308281691569E-008 1.460046106209973E-008 1.515837358810450E-008 + 1.573760504983401E-008 1.633897008536003E-008 1.696331446163525E-008 1.761151626398539E-008 + 1.828448713105412E-008 1.898317353693780E-008 1.970855812231192E-008 2.046166107642346E-008 + 2.124354157189032E-008 2.205529925432772E-008 2.289807578889583E-008 2.377305646594267E-008 + 2.468147186800300E-008 2.562459960049441E-008 2.660376608854728E-008 2.762034844249469E-008 + 2.867577639464467E-008 2.977153431006161E-008 3.090916327418121E-008 3.209026326019762E-008 + 3.331649537927024E-008 3.458958421671312E-008 3.591132025745637E-008 3.728356240418596E-008 + 3.870824059170712E-008 4.018735850120688E-008 4.172299637823125E-008 4.331731395834431E-008 + 4.497255350457906E-008 4.669104296095499E-008 4.847519922649706E-008 5.032753155435772E-008 + 5.225064508082826E-008 5.424724448919493E-008 5.632013781359949E-008 5.847224038825013E-008 + 6.070657894753584E-008 6.302629588281576E-008 6.543465366186297E-008 6.793503941718336E-008 + 7.053096970966159E-008 7.322609547422915E-008 7.602420715451853E-008 7.892924003371443E-008 + 8.194527976910718E-008 8.507656813812880E-008 8.832750900394972E-008 9.170267450903398E-008 + 9.520681150535312E-008 9.884484823030884E-008 1.026219012377533E-007 1.065432825938464E-007 + 1.106145073478832E-007 1.148413012885835E-007 1.192296089967630E-007 1.237856022057056E-007 + 1.285156884809916E-007 1.334265202319982E-007 1.385250040677330E-007 1.438183105101670E-007 + 1.493138840787253E-007 1.550194537601130E-007 1.609430438782075E-007 1.670929853792966E-007 + 1.734779275485383E-007 1.801068501741177E-007 1.869890761762042E-007 1.941342847184770E-007 + 2.015525248206477E-007 2.092542294911316E-007 2.172502303997395E-007 2.255517731110223E-007 + 2.341705328996937E-007 2.431186311703705E-007 2.524086525047222E-007 2.620536623600034E-007 + 2.720672254438555E-007 2.824634247912215E-007 2.932568815701976E-007 3.044627756446775E-007 + 3.160968669227047E-007 3.281755175205491E-007 3.407157147736878E-007 3.537350951270368E-007 + 3.672519689380368E-007 3.812853462274728E-007 3.958549634142319E-007 4.109813110716065E-007 + 4.266856627441611E-007 4.429901048656969E-007 4.599175678203834E-007 4.774918581907269E-007 + 4.957376922377390E-007 5.146807306603671E-007 5.343476146830821E-007 5.547660035223640E-007 + 5.759646132847593E-007 5.979732573512298E-007 6.208228883045603E-007 6.445456414587929E-007 + 6.691748800519019E-007 6.947452421652374E-007 7.212926894357481E-007 7.488545576294337E-007 + 7.774696091471891E-007 8.071780875368395E-007 8.380217740880163E-007 8.700440465894848E-007 + 9.032899403314937E-007 9.378062114389718E-007 9.736414026245955E-007 1.010845911454179E-006 + 1.049472061220405E-006 1.089574174524503E-006 1.131208649669383E-006 1.174434039971609E-006 + 1.219311136103725E-006 1.265903051582747E-006 1.314275311524961E-006 1.364495944791878E-006 + 1.416635579656876E-006 1.470767543127010E-006 1.526967964059705E-006 1.585315880219235E-006 + 1.645893349423556E-006 1.708785564937752E-006 1.774080975276307E-006 1.841871408582670E-006 + 1.912252201760955E-006 1.985322334541336E-006 2.061184568667623E-006 2.139945592402673E-006 + 2.221716170554849E-006 2.306611300236357E-006 2.394750372572515E-006 2.486257340589264E-006 + 2.581260893514870E-006 2.679894637740998E-006 2.782297284697374E-006 2.888612845904284E-006 + 2.998990835477021E-006 3.113586480367033E-006 3.232560938635131E-006 3.356081526063840E-006 + 3.484321951427215E-006 3.617462560748939E-006 3.755690590892066E-006 3.899200432836712E-006 + 4.048193905015948E-006 4.202880537093972E-006 4.363477864585434E-006 4.530211734730099E-006 + 4.703316624052576E-006 4.883035968053675E-006 5.069622503496578E-006 5.263338623768967E-006 + 5.464456747820586E-006 5.673259703194540E-006 5.890041123690922E-006 6.115105862221395E-006 + 6.348770419434999E-006 6.591363388717607E-006 6.843225918190112E-006 7.104712190354873E-006 + 7.376189920064240E-006 7.658040871510874E-006 7.950661394966486E-006 8.254462984022794E-006 + 8.569872854118113E-006 8.897334543162154E-006 9.237308535102911E-006 9.590272907311905E-006 + 9.956724002697024E-006 1.033717712748754E-005 1.073216727567131E-005 1.114224988110205E-005 + 1.156800159833314E-005 1.201002111327470E-005 1.246892998481291E-005 1.294537351857361E-005 + 1.344002167405736E-005 1.395357000642046E-005 1.448674064422399E-005 1.504028330452487E-005 + 1.561497634673390E-005 1.621162786672126E-005 1.683107683270552E-005 1.747419426452138E-005 + 1.814188445792229E-005 1.883508625563666E-005 1.955477436696257E-005 2.030196073775388E-005 + 2.107769597272038E-005 2.188307081203995E-005 2.271921766435447E-005 2.358731219830231E-005 + 2.448857499482120E-005 2.542427326254004E-005 2.639572261866856E-005 2.740428893788336E-005 + 2.845139027180528E-005 2.953849884176187E-005 3.066714310763183E-005 3.183890991567286E-005 + 3.305544672834858E-005 3.431846393928144E-005 3.562973727657998E-005 3.699111029791221E-005 + 3.840449698082401E-005 3.987188441193720E-005 4.139533557879818E-005 4.297699226829296E-005 + 4.461907807569341E-005 4.632390152855319E-005 4.809385932983494E-005 4.993143972481513E-005 + 5.183922599648635E-005 5.381990009435810E-005 5.587624640174079E-005 5.801115564679544E-005 + 6.022762896282817E-005 6.252878210352094E-005 6.491784981900425E-005 6.739819039890219E-005 + 6.997329038871656E-005 7.264676948615471E-005 7.542238562426005E-005 7.830404024846537E-005 + 8.129578379495538E-005 8.440182137801406E-005 8.762651869431515E-005 9.097440815242398E-005 + 9.445019523608967E-005 9.805876511023125E-005 1.018051894788660E-004 1.056947337045723E-004 + 1.097328641994493E-004 1.139252560979108E-004 1.182778012220458E-004 1.227966163506835E-004 + 1.274880518037274E-004 1.323587003537566E-004 1.374154064773546E-004 1.426652759590899E-004 + 1.481156858615755E-004 1.537742948755323E-004 1.596490540643147E-004 1.657482180179088E-004 + 1.720803564319723E-004 1.786543661280895E-004 1.854794835320151E-004 1.925652976273241E-004 + 1.999217634025453E-004 2.075592158105296E-004 2.154883842595358E-004 2.237204076562314E-004 + 2.322668500215855E-004 2.411397167014225E-004 2.503514711942193E-004 2.599150526196005E-004 + 2.698438938518572E-004 2.801519403437415E-004 2.908536696667484E-004 3.019641117950709E-004 + 3.134988701614657E-004 3.254741435143099E-004 3.379067486062486E-004 3.508141437459808E-004 + 3.642144532459036E-004 3.781264927996036E-004 3.925697958244280E-004 4.075646408057202E-004 + 4.231320796806830E-004 4.392939673012357E-004 4.560729920167618E-004 4.734927074191344E-004 + 4.915775652940278E-004 5.103529498241859E-004 5.298452130919947E-004 5.500817119305486E-004 + 5.710908461741851E-004 5.929020983614146E-004 6.155460749451546E-004 6.390545490672062E-004 + 6.634605049561009E-004 6.887981840096069E-004 7.151031326255080E-004 7.424122518466542E-004 + 7.707638488887164E-004 8.001976906216913E-004 8.307550590788135E-004 8.624788090692873E-004 + 8.954134279741459E-004 9.296050978074120E-004 9.651017596279248E-004 1.001953180390257E-003 + 1.040211022326510E-003 1.079928914954175E-003 1.121162529808745E-003 1.163969658003522E-003 + 1.208410290722746E-003 1.254546702758210E-003 1.302443539203566E-003 1.352167905424709E-003 + 1.403789460429125E-003 1.457380513761508E-003 1.513016126057709E-003 1.570774213393985E-003 + 1.630735655573455E-003 1.692984408497032E-003 1.757607620771422E-003 1.824695754712404E-003 + 1.894342711907479E-003 1.966645963507826E-003 2.041706685425973E-003 2.119629898621814E-003 + 2.200524614666385E-003 2.284503986779767E-003 2.371685466546442E-003 2.462190966519141E-003 + 2.556147028929565E-003 2.653685000732500E-003 2.754941215218025E-003 2.860057180434828E-003 + 2.969179774676730E-003 3.082461449293338E-003 3.200060439095245E-003 3.322140980633984E-003 + 3.448873538646768E-003 3.580435040966832E-003 3.717009122210427E-003 3.858786376563098E-003 + 4.005964619999091E-003 4.158749162279537E-003 4.317353089087630E-003 4.481997554671334E-003 + 4.652912085377444E-003 4.830334894474282E-003 5.014513208674134E-003 5.205703606781248E-003 + 5.404172370905698E-003 5.610195850699025E-003 5.824060841083379E-003 6.046064973961917E-003 + 6.276517124415658E-003 6.515737831908668E-003 6.764059737041917E-003 7.021828034414337E-003 + 7.289400942168550E-003 7.567150188818754E-003 7.855461517977863E-003 8.154735211622273E-003 + 8.465386632553824E-003 8.787846786740260E-003 9.122562906238885E-003 9.469999053430486E-003 + 9.830636747315309E-003 1.020497561264699E-002 1.059353405270573E-002 1.099684994653808E-002 + 1.141548137151744E-002 1.185000735210598E-002 1.230102863572803E-002 1.276916849669199E-002 + 1.325507356912898E-002 1.375941470994536E-002 1.428288789281739E-002 1.482621513428825E-002 + 1.539014545305881E-002 1.597545586359806E-002 1.658295240523070E-002 1.721347120789546E-002 + 1.786787959580134E-002 1.854707723024472E-002 1.925199729288705E-002 1.998360771082872E-002 + 2.074291242485196E-002 2.153095270224428E-002 2.234880849565039E-002 2.319759984944155E-002 + 2.407848835512776E-002 2.499267865737929E-002 2.594142001226318E-002 2.692600789933873E-002 + 2.794778568929834E-002 2.900814636887709E-002 3.010853432479592E-002 3.125044718854243E-002 + 3.243543774383071E-002 3.366511589862359E-002 3.494115072363479E-002 3.626527255926863E-002 + 3.763927519298975E-002 3.906501810914944E-002 4.054442881333175E-002 4.207950523331111E-002 + 4.367231819874513E-002 4.532501400175497E-002 4.703981704056784E-002 4.881903254842358E-002 + 5.066504940996304E-002 5.258034306733327E-002 5.456747851825800E-002 5.662911340832629E-002 + 5.876800121975880E-002 6.098699455890712E-002 6.328904854473022E-002 6.567722430048371E-002 + 6.815469255082574E-002 7.072473732652348E-002 7.339075977889671E-002 7.615628210608991E-002 + 7.902495159320658E-002 8.200054476826422E-002 8.508697167585164E-002 8.828828027026882E-002 + 9.160866092982083E-002 9.505245109381047E-002 9.862414002362579E-002 1.023283736891636E-001 + 1.061699597816364E-001 1.101538728536122E-001 1.142852595869053E-001 1.185694441886741E-001 + 1.230119339158125E-001 1.276184247273954E-001 1.323948070646003E-001 1.373471717571457E-001 + 1.424818160548668E-001 1.478052497825975E-001 1.533242016160193E-001 1.590456254755947E-001 + 1.649767070351059E-001 1.711248703406627E-001 1.774977845353474E-001 1.841033706838816E-001 + 1.909498086908737E-001 1.980455443053014E-001 2.053992962028930E-001 2.130200631370275E-001 + 2.209171311476130E-001 2.291000808161766E-001 2.375787945540599E-001 2.463634639091740E-001 + 2.554645968752379E-001 2.648930251857339E-001 2.746599115730528E-001 2.847767569713646E-001 + 2.952554076396947E-001 3.061080621794893E-001 3.173472784185771E-001 3.289859801309166E-001 + 3.410374635588135E-001 3.535154037013953E-001 3.664338603300792E-001 3.798072836884516E-001 + 3.936505198305023E-001 4.079788155474377E-001 4.228078228293061E-001 4.381536028035404E-001 + 4.540326290879629E-001 4.704617904911644E-001 4.874583929881308E-001 5.050401608936693E-001 + 5.232252371506759E-001 5.420321826443093E-001 5.614799744469707E-001 5.815880028924906E-001 + 6.023760673709444E-001 6.238643707284807E-001 6.460735121488540E-001 6.690244783855609E-001 + 6.927386332052708E-001 7.172377048945515E-001 7.425437716731818E-001 7.686792448479188E-001 + 7.956668495311675E-001 8.235296027391584E-001 8.522907886739891E-001 8.819739309837126E-001 + 9.126027617838534E-001 9.442011872131006E-001 9.767932492850091E-001 1.010403083786419E+000 + 1.045054873962551E+000 1.080772799717534E+000 1.117580982048530E+000 1.155503422421071E+000 + 1.194563936782904E+000 1.234786083904216E+000 1.276193087722850E+000 1.318807753365018E+000 + 1.362652376504839E+000 1.407748645719751E+000 1.454117537494557E+000 1.501779203523582E+000 + 1.550752849959623E+000 1.601056608259620E+000 1.652707397280593E+000 1.705720776286531E+000 + 1.760110788536652E+000 1.815889795139622E+000 1.873068298876423E+000 1.931654757717142E+000 + 1.991655387785505E+000 2.053073955558424E+000 2.115911559128453E+000 2.180166398404413E+000 + 2.245833534180202E+000 2.312904636065721E+000 2.381367719345900E+000 2.451206870916462E+000 + 2.522401964537952E+000 2.594928365753463E+000 2.668756626932225E+000 2.743852173029744E+000 + 2.820174978797888E+000 2.897679238335086E+000 2.976313028037556E+000 3.056017964199745E+000 + 3.136728856713650E+000 3.218373360535287E+000 3.300871626820664E+000 3.384135955883575E+000 + 3.468070454393972E+000 3.552570699516445E+000 3.637523412984249E+000 3.722806148413395E+000 + 3.808286995481477E+000 3.893824304927217E+000 3.979266438663885E+000 4.064451549642516E+000 + 4.149207396444270E+000 4.233351197920884E+000 4.316689533535072E+000 4.399018295370902E+000 + 4.480122698083595E+000 4.559777353330997E+000 4.637746415466567E+000 4.713783805470111E+000 + 4.787633520234990E+000 4.859030034412503E+000 4.927698802022600E+000 4.993356864964404E+000 + 5.055713575389352E+000 5.114471438620295E+000 5.169327082900756E+000 5.219972361726859E+000 + 5.266095593837488E+000 5.307382945106167E+000 5.343519955578034E+000 5.374193213719792E+000 + 5.399092178590265E+000 5.417911149088861E+000 5.430351377695985E+000 5.436123324181819E+000 + 5.434949042632221E+000 5.426564692828907E+000 5.410723164537805E+000 5.387196800620468E+000 + 5.355780202110796E+000 5.316293095520185E+000 5.268583239681751E+000 5.212529346458149E+000 + 5.148043986661832E+000 5.075076449623605E+000 4.993615522049914E+000 4.903692149193208E+000 + 4.805381938988256E+000 4.698807467746647E+000 4.584140344323987E+000 4.461602988446097E+000 + 4.331470078172054E+000 4.194069621346860E+000 4.049783606412324E+000 3.899048189155459E+000 + 3.742353373917331E+000 3.580242150493290E+000 3.413309051444106E+000 3.242198098804681E+000 + 3.067600114211031E+000 2.890249372231510E+000 2.710919583137901E+000 2.530419198423502E+000 + 2.349586039988150E+000 2.169281261984241E+000 1.990382662755268E+000 1.813777373017099E+000 + 1.640353955346093E+000 1.470993959088717E+000 1.306562983963455E+000 1.147901314893992E+000 + 9.958142000657394E-001 8.510618539711469E-001 7.143492775377758E-001 5.863159986561808E-001 + 4.675258490132335E-001 3.584569077138738E-001 2.594917595319485E-001 1.709082367536493E-001 + 9.287083965571109E-002 2.542306310172526E-002 -3.151910282694076E-002 -7.817217999083925E-002 +-1.148883368712655E-001 -1.421561944320368E-001 -1.605987546408234E-001 -1.709677927764287E-001 +-1.741339244025560E-001 -1.710714065757611E-001 -1.628365601636454E-001 -1.505385069835973E-001 +-1.353007042597320E-001 -1.182115338424319E-001 -1.002619706487867E-001 -8.226510148249258E-002 +-6.486478244285586E-002 -4.867106843062511E-002 -3.425552340464791E-002 -2.211133100224610E-002 +-1.260371269767548E-002 -5.909259850195633E-003 -1.942647218801536E-003 -2.690080039601190E-004 + 8.391833212926056E-014 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 + + +-1.275816085584227E+000 0.000000000000000E+000 0.000000000000000E+000 -4.814177794229427E+000 + + + + + 5.713073518220381E-009 5.857700662653833E-009 6.005989060668534E-009 6.158031397339205E-009 + 6.313922704074705E-009 6.473760418015427E-009 6.637644442934680E-009 6.805677211681779E-009 + 6.977963750205942E-009 7.154611743200913E-009 7.335731601411389E-009 7.521436530643325E-009 + 7.711842602521241E-009 7.907068827036787E-009 8.107237226933830E-009 8.312472913976655E-009 + 8.522904167148867E-009 8.738662512831953E-009 8.959882807013523E-009 9.186703319576714E-009 + 9.419265820723326E-009 9.657715669584842E-009 9.902201905076596E-009 1.015287733905194E-008 + 1.040989865181461E-008 1.067342649004904E-008 1.094362556722973E-008 1.122066476657256E-008 + 1.150471724659222E-008 1.179596054933200E-008 1.209457671133326E-008 1.240075237741424E-008 + 1.271467891732910E-008 1.303655254538029E-008 1.336657444305878E-008 1.370495088478911E-008 + 1.405189336685755E-008 1.440761873960420E-008 1.477234934296146E-008 1.514631314542374E-008 + 1.552974388653514E-008 1.592288122298430E-008 1.632597087839757E-008 1.673926479692432E-008 + 1.716302130071017E-008 1.759750525135674E-008 1.804298821546874E-008 1.849974863439194E-008 + 1.896807199824803E-008 1.944825102437521E-008 1.994058584028609E-008 2.044538417125708E-008 + 2.096296153266663E-008 2.149364142720271E-008 2.203775554706244E-008 2.259564398127038E-008 + 2.316765542824532E-008 2.375414741374813E-008 2.435548651434685E-008 2.497204858653912E-008 + 2.560421900167446E-008 2.625239288682402E-008 2.691697537174777E-008 2.759838184211373E-008 + 2.829703819912758E-008 2.901338112573461E-008 2.974785835956074E-008 3.050092897276317E-008 + 3.127306365896521E-008 3.206474502745515E-008 3.287646790483272E-008 3.370873964429167E-008 + 3.456208044273207E-008 3.543702366589997E-008 3.633411618175872E-008 3.725391870229881E-008 + 3.819700613400114E-008 3.916396793717233E-008 4.015540849437620E-008 4.117194748819271E-008 + 4.221422028853945E-008 4.328287834979859E-008 4.437858961799687E-008 4.550203894829341E-008 + 4.665392853303653E-008 4.783497834065657E-008 4.904592656566941E-008 5.028753009007196E-008 + 5.156056495641797E-008 5.286582685286962E-008 5.420413161052841E-008 5.557631571335585E-008 + 5.698323682100320E-008 5.842577430487623E-008 5.990482979777100E-008 6.142132775742325E-008 + 6.297621604432445E-008 6.457046651416518E-008 6.620507562527624E-008 6.788106506144750E-008 + 6.959948237051308E-008 7.136140161910261E-008 7.316792406396731E-008 7.502017884030120E-008 + 7.691932366748701E-008 7.886654557270799E-008 8.086306163287817E-008 8.291011973535446E-008 + 8.500899935790682E-008 8.716101236843297E-008 8.936750384491775E-008 9.162985291615053E-008 + 9.394947362372469E-008 9.632781580585937E-008 9.876636600359513E-008 1.012666483899294E-007 + 1.038302257224736E-007 1.064587003202274E-007 1.091537150650789E-007 1.119169544286593E-007 + 1.147501455251907E-007 1.176550591909888E-007 1.206335110912917E-007 1.236873628551096E-007 + 1.268185232388017E-007 1.300289493191110E-007 1.333206477163988E-007 1.366956758488476E-007 + 1.401561432184126E-007 1.437042127293284E-007 1.473421020399928E-007 1.510720849490745E-007 + 1.548964928167094E-007 1.588177160216755E-007 1.628382054554560E-007 1.669604740541238E-007 + 1.711870983690070E-007 1.755207201771161E-007 1.799640481323377E-007 1.845198594584303E-007 + 1.891910016848763E-007 1.939803944266797E-007 1.988910312092166E-007 2.039259813392845E-007 + 2.090883918235168E-007 2.143814893353606E-007 2.198085822318499E-007 2.253730626214340E-007 + 2.310784084841524E-007 2.369281858454816E-007 2.429260510052138E-007 2.490757528227604E-007 + 2.553811350603057E-007 2.618461387852807E-007 2.684748048336534E-007 2.752712763355788E-007 + 2.822398013049851E-007 2.893847352947156E-007 2.967105441188855E-007 3.042218066441560E-007 + 3.119232176516694E-007 3.198195907714332E-007 3.279158614909901E-007 3.362170902402503E-007 + 3.447284655544195E-007 3.534553073169931E-007 3.624030700848499E-007 3.715773464975196E-007 + 3.809838707727543E-007 3.906285222905945E-007 4.005173292681603E-007 4.106564725274767E-007 + 4.210522893586751E-007 4.317112774809957E-007 4.426400991040630E-007 4.538455850919692E-007 + 4.653347392327757E-007 4.771147426160950E-007 4.891929581214888E-007 5.015769350204942E-007 + 5.142744136951472E-007 5.272933304759591E-007 5.406418226023604E-007 5.543282333087258E-007 + 5.683611170391443E-007 5.827492447942074E-007 5.975016096131481E-007 6.126274321947595E-007 + 6.281361666606086E-007 6.440375064641467E-007 6.603413904494048E-007 6.770580090630710E-007 + 6.941978107238163E-007 7.117715083528716E-007 7.297900860699198E-007 7.482648060584904E-007 + 7.672072156051603E-007 7.866291543169447E-007 8.065427615213961E-007 8.269604838540438E-007 + 8.478950830378973E-007 8.693596438598965E-007 8.913675823492812E-007 9.139326541629951E-007 + 9.370689631833687E-007 9.607909703334458E-007 9.851135026154782E-007 1.010051762378221E-006 + 1.035621336818827E-006 1.061838207725295E-006 1.088718761465526E-006 1.116279799229268E-006 + 1.144538547529328E-006 1.173512668968616E-006 1.203220273279767E-006 1.233679928644216E-006 + 1.264910673297822E-006 1.296932027430286E-006 1.329764005385799E-006 1.363427128172547E-006 + 1.397942436288887E-006 1.433331502874229E-006 1.469616447192817E-006 1.506819948458851E-006 + 1.544965260011594E-006 1.584076223849314E-006 1.624177285531154E-006 1.665293509456231E-006 + 1.707450594529532E-006 1.750674890224378E-006 1.794993413051513E-006 1.840433863445098E-006 + 1.887024643076173E-006 1.934794872604399E-006 1.983774409879188E-006 2.033993868601571E-006 + 2.085484637458510E-006 2.138278899741569E-006 2.192409653462230E-006 2.247910731976428E-006 + 2.304816825131168E-006 2.363163500946497E-006 2.422987227846298E-006 2.484325397451888E-006 + 2.547216347952607E-006 2.611699388068019E-006 2.677814821616719E-006 2.745603972707082E-006 + 2.815109211565691E-006 2.886373981019619E-006 2.959442823649079E-006 3.034361409627442E-006 + 3.111176565265995E-006 3.189936302281305E-006 3.270689847803454E-006 3.353487675143940E-006 + 3.438381535342424E-006 3.525424489512064E-006 3.614670942003660E-006 3.706176674409330E-006 + 3.799998880426937E-006 3.896196201607131E-006 3.994828764005244E-006 4.095958215761033E-006 + 4.199647765629724E-006 4.305962222488438E-006 4.414968035842662E-006 4.526733337358139E-006 + 4.641327983444084E-006 4.758823598914345E-006 4.879293621753842E-006 5.002813349018186E-006 + 5.129459983895199E-006 5.259312683957783E-006 5.392452610638234E-006 5.528962979954941E-006 + 5.668929114523199E-006 5.812438496882566E-006 5.959580824174193E-006 6.110448064202220E-006 + 6.265134512914285E-006 6.423736853337107E-006 6.586354216003922E-006 6.753088240911531E-006 + 6.924043141045772E-006 7.099325767514999E-006 7.279045676332327E-006 7.463315196888354E-006 + 7.652249502157200E-006 7.845966680679684E-006 8.044587810368610E-006 8.248237034182334E-006 + 8.457041637713870E-006 8.671132128744024E-006 8.890642318808284E-006 9.115709406828377E-006 + 9.346474064860870E-006 9.583080526016236E-006 9.825676674603501E-006 1.007441413855665E-005 + 1.032944838420064E-005 1.059093881341619E-005 1.085904886326406E-005 1.113394610813116E-005 + 1.141580236446217E-005 1.170479379814215E-005 1.200110103459743E-005 1.230490927168319E-005 + 1.261640839542871E-005 1.293579309871225E-005 1.326326300293989E-005 1.359902278280440E-005 + 1.394328229420183E-005 1.429625670538612E-005 1.465816663144336E-005 1.502923827216987E-005 + 1.540970355344020E-005 1.579980027215343E-005 1.619977224484822E-005 1.660986946007959E-005 + 1.703034823465251E-005 1.746147137380995E-005 1.790350833547557E-005 1.835673539865347E-005 + 1.882143583609033E-005 1.929790009130787E-005 1.978642596011597E-005 2.028731877672012E-005 + 2.080089160453927E-005 2.132746543185352E-005 2.186736937240354E-005 2.242094087106718E-005 + 2.298852591474199E-005 2.357047924856492E-005 2.416716459760458E-005 2.477895489416455E-005 + 2.540623251083947E-005 2.604938949946970E-005 2.670882783614387E-005 2.738495967240193E-005 + 2.807820759279626E-005 2.878900487897086E-005 2.951779578042449E-005 3.026503579212608E-005 + 3.103119193915635E-005 3.181674306855302E-005 3.262218014854190E-005 3.344800657534122E-005 + 3.429473848772997E-005 3.516290508957755E-005 3.605304898053553E-005 3.696572649509809E-005 + 3.790150805024330E-005 3.886097850187181E-005 3.984473751026571E-005 4.085339991479567E-005 + 4.188759611811052E-005 4.294797248004908E-005 4.403519172151960E-005 4.514993333860003E-005 + 4.629289402711687E-005 4.746478811796767E-005 4.866634802345915E-005 4.989832469493981E-005 + 5.116148809201185E-005 5.245662766361647E-005 5.378455284129158E-005 5.514609354491099E-005 + 5.654210070121964E-005 5.797344677548918E-005 5.944102631662573E-005 6.094575651606926E-005 + 6.248857778083441E-005 6.407045432104942E-005 6.569237475236050E-005 6.735535271357702E-005 + 6.906042749994296E-005 7.080866471243000E-005 7.260115692345682E-005 7.443902435945090E-005 + 7.632341560067733E-005 7.825550829877211E-005 8.023650991242716E-005 8.226765846168549E-005 + 8.435022330131840E-005 8.648550591376522E-005 8.867484072213113E-005 9.091959592374984E-005 + 9.322117434483113E-005 9.558101431672523E-005 9.800059057435196E-005 1.004814151773530E-004 + 1.030250384545423E-004 1.056330499722440E-004 1.083070795271204E-004 1.110487981641092E-004 + 1.138599192201045E-004 1.167421993940314E-004 1.196974398439822E-004 1.227274873120961E-004 + 1.258342352778855E-004 1.290196251407243E-004 1.322856474322381E-004 1.356343430593488E-004 + 1.390678045787496E-004 1.425881775036032E-004 1.461976616432769E-004 1.498985124769495E-004 + 1.536930425619438E-004 1.575836229776631E-004 1.615726848060283E-004 1.656627206493412E-004 + 1.698562861865117E-004 1.741560017686251E-004 1.785645540548358E-004 1.830846976896097E-004 + 1.877192570223554E-004 1.924711278705159E-004 1.973432793272153E-004 2.023387556145867E-004 + 2.074606779839320E-004 2.127122466638953E-004 2.180967428578607E-004 2.236175307918163E-004 + 2.292780598139555E-004 2.350818665473220E-004 2.410325770968345E-004 2.471339093120611E-004 + 2.533896751071516E-004 2.598037828393642E-004 2.663802397476657E-004 2.731231544529182E-004 + 2.800367395212030E-004 2.871253140918743E-004 2.943933065719702E-004 3.018452573986533E-004 + 3.094858218713963E-004 3.173197730556621E-004 3.253520047598863E-004 3.335875345876006E-004 + 3.420315070665914E-004 3.506891968570314E-004 3.595660120405682E-004 3.686674974924117E-004 + 3.779993383385032E-004 3.875673634999063E-004 3.973775493266154E-004 4.074360233230248E-004 + 4.177490679673661E-004 4.283231246274727E-004 4.391647975752925E-004 4.502808581026295E-004 + 4.616782487406539E-004 4.733640875857903E-004 4.853456727346490E-004 4.976304868307436E-004 + 5.102262017257931E-004 5.231406832584883E-004 5.363819961536640E-004 5.499584090448993E-004 + 5.638783996236400E-004 5.781506599180109E-004 5.927841017045704E-004 6.077878620563361E-004 + 6.231713090304942E-004 6.389440474992889E-004 6.551159251276757E-004 6.716970385014099E-004 + 6.886977394093370E-004 7.061286412837312E-004 7.240006258026451E-004 7.423248496583107E-004 + 7.611127514957392E-004 7.803760590257751E-004 8.001267963169563E-004 8.203772912706376E-004 + 8.411401832839652E-004 8.624284311053620E-004 8.842553208873406E-004 9.066344744415555E-004 + 9.295798577011283E-004 9.531057893954097E-004 9.772269499424601E-004 1.001958390564666E-003 + 1.027315542633046E-003 1.053314227245918E-003 1.079970665047754E-003 1.107301486294182E-003 + 1.135323741169258E-003 1.164054910361235E-003 1.193512915903265E-003 1.223716132285581E-003 + 1.254683397845882E-003 1.286434026444810E-003 1.318987819433567E-003 1.352365077920887E-003 + 1.386586615346769E-003 1.421673770370528E-003 1.457648420080926E-003 1.494532993536322E-003 + 1.532350485642965E-003 1.571124471379764E-003 1.610879120378044E-003 1.651639211865015E-003 + 1.693430149979899E-003 1.736277979471848E-003 1.780209401789016E-003 1.825251791568369E-003 + 1.871433213536035E-003 1.918782439828262E-003 1.967328967743211E-003 2.017103037934150E-003 + 2.068135653054780E-003 2.120458596867728E-003 2.174104453827462E-003 2.229106629149178E-003 + 2.285499369375459E-003 2.343317783452756E-003 2.402597864330085E-003 2.463376511092538E-003 + 2.525691551642581E-003 2.589581765942310E-003 2.655086909830236E-003 2.722247739426420E-003 + 2.791106036140081E-003 2.861704632294196E-003 2.934087437381839E-003 3.008299464969402E-003 + 3.084386860262169E-003 3.162396928348070E-003 3.242378163135729E-003 3.324380277003370E-003 + 3.408454231175433E-003 3.494652266844189E-003 3.583027937053955E-003 3.673636139365939E-003 + 3.766533149322130E-003 3.861776654726989E-003 3.959425790766217E-003 4.059541175982152E-003 + 4.162184949125875E-003 4.267420806906436E-003 4.375314042658120E-003 4.485931585947039E-003 + 4.599342043138836E-003 4.715615738949706E-003 4.834824759003379E-003 4.957042993417176E-003 + 5.082346181440796E-003 5.210811957171814E-003 5.342519896372436E-003 5.477551564412611E-003 + 5.615990565364862E-003 5.757922592276994E-003 5.903435478649066E-003 6.052619251141638E-003 + 6.205566183542861E-003 6.362370852022357E-003 6.523130191700438E-003 6.687943554561702E-003 + 6.856912768742575E-003 7.030142199222913E-003 7.207738809952163E-003 7.389812227441342E-003 + 7.576474805852377E-003 7.767841693617107E-003 7.964030901618501E-003 8.165163372967426E-003 + 8.371363054408641E-003 8.582756969390318E-003 8.799475292831834E-003 9.021651427625134E-003 + 9.249422082905422E-003 9.482927354127490E-003 9.722310804984388E-003 9.967719551205786E-003 + 1.021930434627354E-002 1.047721966909285E-002 1.074162381365745E-002 1.101267898074788E-002 + 1.129055137170239E-002 1.157541128430012E-002 1.186743321079685E-002 1.216679593815386E-002 + 1.247368265050078E-002 1.278828103387346E-002 1.311078338326844E-002 1.344138671205549E-002 + 1.378029286379032E-002 1.412770862646918E-002 1.448384584926761E-002 1.484892156180568E-002 + 1.522315809598153E-002 1.560678321041590E-002 1.600003021754945E-002 1.640313811343490E-002 + 1.681635171026592E-002 1.723992177168403E-002 1.767410515090491E-002 1.811916493170461E-002 + 1.857537057230618E-002 1.904299805220614E-002 1.952233002197979E-002 2.001365595610371E-002 + 2.051727230883233E-002 2.103348267316524E-002 2.156259794294008E-002 2.210493647808495E-002 + 2.266082427306302E-002 2.323059512853970E-002 2.381459082630222E-002 2.441316130745856E-002 + 2.502666485394111E-002 2.565546827333816E-002 2.629994708707389E-002 2.696048572195489E-002 + 2.763747770509827E-002 2.833132586225354E-002 2.904244251952696E-002 2.977124970851373E-002 + 3.051817937483866E-002 3.128367359010358E-002 3.206818476723304E-002 3.287217587920670E-002 + 3.369612068116147E-002 3.454050393583990E-002 3.540582164235696E-002 3.629258126824997E-002 + 3.720130198476997E-002 3.813251490536642E-002 3.908676332730810E-002 4.006460297637648E-002 + 4.106660225455796E-002 4.209334249065336E-002 4.314541819371209E-002 4.422343730918901E-002 + 4.532802147771082E-002 4.645980629632635E-002 4.761944158210428E-002 4.880759163792714E-002 + 5.002493552031765E-002 5.127216730911844E-002 5.254999637882981E-002 5.385914767139585E-002 + 5.520036197020921E-002 5.657439617508833E-002 5.798202357796120E-002 5.942403413896801E-002 + 6.090123476267542E-002 6.241444957407035E-002 6.396452019397830E-002 6.555230601352596E-002 + 6.717868446723950E-002 6.884455130434446E-002 7.055082085780030E-002 7.229842631057415E-002 + 7.408831995862353E-002 7.592147347002363E-002 7.779887813963982E-002 7.972154513870464E-002 + 8.169050575862108E-002 8.370681164827093E-002 8.577153504406060E-002 8.788576899189401E-002 + 9.005062756020821E-002 9.226724604316014E-002 9.453678115299718E-002 9.686041120058649E-002 + 9.923933626302071E-002 1.016747783371535E-001 1.041679814778539E-001 1.067202119197002E-001 + 1.093327581807613E-001 1.120069311470387E-001 1.147440641360644E-001 1.175455129380643E-001 + 1.204126558330166E-001 1.233468935818344E-001 1.263496493898189E-001 1.294223688404186E-001 + 1.325665197972350E-001 1.357835922721032E-001 1.390750982569593E-001 1.424425715170955E-001 + 1.458875673432704E-001 1.494116622600171E-001 1.530164536873567E-001 1.567035595529764E-001 + 1.604746178517895E-001 1.643312861496326E-001 1.682752410276975E-001 1.723081774641204E-001 + 1.764318081489735E-001 1.806478627287212E-001 1.849580869759995E-001 1.893642418803787E-001 + 1.938681026555545E-001 1.984714576581815E-001 2.031761072133378E-001 2.079838623413518E-001 + 2.128965433804712E-001 2.179159784995794E-001 2.230440020948770E-001 2.282824530641546E-001 + 2.336331729519603E-001 2.390980039586419E-001 2.446787868058939E-001 2.503773584510773E-001 + 2.561955496421954E-001 2.621351823050089E-001 2.681980667533456E-001 2.743859987132232E-001 + 2.807007561509228E-001 2.871440958946723E-001 2.937177500390677E-001 3.004234221208222E-001 + 3.072627830538615E-001 3.142374668111733E-001 3.213490658402017E-001 3.285991261978967E-001 + 3.359891423908508E-001 3.435205519052233E-001 3.511947294103880E-001 3.590129806194707E-001 + 3.669765357890997E-001 3.750865428398666E-001 3.833440600781134E-001 3.917500484987532E-001 + 4.003053636479501E-001 4.090107470235244E-001 4.178668169900496E-001 4.268740591846757E-001 + 4.360328163888140E-001 4.453432778399675E-001 4.548054679571731E-001 4.644192344528016E-001 + 4.741842358028488E-001 4.840999280473583E-001 4.941655508923467E-001 5.043801130845090E-001 + 5.147423770302204E-001 5.252508426309177E-001 5.359037303079197E-001 5.466989631912692E-001 + 5.576341484492779E-001 5.687065577382957E-001 5.799131067559328E-001 5.912503338856296E-001 + 6.027143779263657E-001 6.143009549084800E-001 6.260053340053687E-001 6.378223125614040E-001 + 6.497461902689722E-001 6.617707425425083E-001 6.738891931548775E-001 6.860941862219171E-001 + 6.983777576446752E-001 7.107313061461353E-001 7.231455640705178E-001 7.356105681487528E-001 + 7.481156304739432E-001 7.606493099757455E-001 7.731993847329376E-001 7.857528255192076E-001 + 7.982957710384382E-001 8.108135053724798E-001 8.232904382364516E-001 8.357100887134206E-001 + 8.480550732214085E-001 8.603070985497995E-001 8.724469608881676E-001 8.844545518561425E-001 + 8.963088726258920E-001 9.079880573057736E-001 9.194694068207137E-001 9.307294345771253E-001 + 9.417439252316196E-001 9.524880078864280E-001 9.629362450020343E-001 9.730627382392718E-001 + 9.828412523080385E-001 9.922453576951257E-001 1.001248592855112E+000 1.009824646060030E+000 + 1.017947556597752E+000 1.025591934366663E+000 1.032733196113644E+000 1.039347815581042E+000 + 1.045413583640763E+000 1.050909873072501E+000 1.055817900958262E+000 1.060120979682472E+000 + 1.063804745207637E+000 1.066857348594371E+000 1.069269593597920E+000 1.071034999536379E+000 + 1.072149764409427E+000 1.072612598354798E+000 1.072424391847801E+000 1.071587690426032E+000 + 1.070106118270693E+000 1.067984202196006E+000 1.065227351723261E+000 1.061841848932560E+000 + 1.057834836312705E+000 1.053214302726913E+000 1.047989067607154E+000 1.042168763484356E+000 + 1.035763816955753E+000 1.028785428184352E+000 1.021245549019500E+000 1.013156859821308E+000 + 1.004532745065794E+000 9.953872678016865E-001 9.857351430238847E-001 9.755917100227249E-001 + 9.649729037621617E-001 9.538952253338502E-001 9.423757115279076E-001 9.304319035546309E-001 + 9.180818149450930E-001 9.053438986518637E-001 8.922370133647387E-001 8.787803890501622E-001 + 8.649935917172931E-001 8.508964874088556E-001 8.365092054115097E-001 8.218521006761215E-001 + 8.069457154407494E-001 7.918107400541491E-001 7.764679729979741E-001 7.609382801129556E-001 + 7.452425530561088E-001 7.294016670367529E-001 7.134364378889109E-001 6.973675785709821E-001 + 6.812156552203880E-001 6.650010429212662E-001 6.487438813816720E-001 6.324640307551969E-001 + 6.161810278793450E-001 5.999140432373210E-001 5.836818389791119E-001 5.675027283596522E-001 + 5.513945369645278E-001 5.353745660955663E-001 5.194595586785719E-001 5.036656680328989E-001 + 4.880084298076144E-001 4.725027373423477E-001 4.571628206540134E-001 4.420022291852051E-001 + 4.270338183785754E-001 4.122697400665679E-001 3.977214365901936E-001 3.833996384871282E-001 + 3.693143655208982E-001 3.554749307620615E-001 3.418899473813509E-001 3.285673377757301E-001 + 3.155143446227681E-001 3.027375434476552E-001 2.902428562910548E-001 2.780355660845704E-001 + 2.661203313730894E-001 2.545012010681478E-001 2.431816289715946E-001 2.321644878716100E-001 + 2.214520830804775E-001 2.110461653521245E-001 2.009479431840698E-001 1.911580945698065E-001 + 1.816767783211351E-001 1.725036451232393E-001 1.636378485168610E-001 1.550780560209846E-001 + 1.468224606159177E-001 1.388687928012488E-001 1.312143334271021E-001 1.238559274721409E-001 + 1.167899989098829E-001 1.100125667682416E-001 1.035192624479151E-001 9.730534832530055E-002 + 9.136573762674108E-002 8.569501552456846E-002 8.028746137268214E-002 7.513707197108518E-002 + 7.023758572533338E-002 6.558250754842999E-002 6.116513433927525E-002 5.697858086311113E-002 + 5.301580585514614E-002 4.926963816823227E-002 4.573280278860544E-002 4.239794654977374E-002 + 3.925766338312286E-002 3.630451895422748E-002 3.353107454575449E-002 3.092991006081133E-002 + 2.849364603427643E-002 2.621496455373082E-002 2.408662900583072E-002 2.210150257809416E-002 + 2.025256545993835E-002 1.853293070024925E-002 1.693585869167060E-002 1.545477026407370E-002 + 1.408325838123921E-002 1.281509844559459E-002 1.164425722586924E-002 1.056490043172602E-002 + 9.571398967791302E-003 8.658333907028448E-003 7.820500230084950E-003 7.052909383099762E-003 + 6.350790711498487E-003 5.709591831549846E-003 5.124978004929267E-003 4.592830584262377E-003 + 4.109244599632740E-003 3.670525557367215E-003 3.273185523095274E-003 2.913938561153695E-003 + 2.589695601915163E-003 2.297558807601527E-003 2.034815505642234E-003 1.798931756701356E-003 + 1.587545622167612E-003 1.398460193226809E-003 1.229636440661425E-003 1.079185941292917E-003 + 9.453635335442980E-004 8.265599509974068E-004 7.212944790941751E-004 6.282076763252864E-004 + 5.460541974023030E-004 4.736957520579292E-004 4.100942292983616E-004 3.543050131738807E-004 + 3.054705124685239E-004 2.628139231632024E-004 2.256332391226233E-004 1.932955232151000E-004 + 1.652314480130730E-004 1.409301123549920E-004 1.199341373870588E-004 1.018350432542563E-004 + 8.626890537813499E-005 7.291233640150445E-005 6.147907744004595E-005 5.171549535898937E-005 + 4.339782795511430E-005 3.632921638739082E-005 3.033691447022094E-005 2.526972787969675E-005 + 2.099567181922993E-005 1.739983533262328E-005 1.438244023885100E-005 1.185708258120988E-005 + 9.749144521328623E-006 7.994364752793941E-006 6.537555746872585E-006 5.331456461151729E-006 + 4.335709528389563E-006 3.515952385446531E-006 2.843012289435873E-006 2.292195689473453E-006 + 1.842662967682300E-006 1.476880123333771E-006 1.180139540953571E-006 9.401425495972628E-007 + 7.466370398927241E-007 5.911039523531816E-007 4.664869802480603E-007 3.669603391777808E-007 + 2.877299404177229E-007 2.248637637934849E-007 1.751476567137884E-007 1.359631880161464E-007 + 1.051845580117335E-007 8.109190956092001E-008 6.229869958723697E-008 4.769107690389118E-008 + 3.637747162137628E-008 2.764683498609501E-008 2.093417769404813E-008 1.579224107433428E-008 + 1.186830066233223E-008 8.885247235514923E-009 6.626218021846809E-009 4.922162142119893E-009 + 3.641820995427706E-009 2.683687756578669E-009 1.969581860278122E-009 1.439535643347646E-009 + 1.047742449858767E-009 7.593596208553931E-010 5.479969346747525E-010 3.937521796580370E-010 + 2.816814747023348E-010 2.006134579316893E-010 1.422342052421618E-010 1.003843023343886E-010 + 7.052138454863003E-011 4.931111824374260E-011 3.431740362083495E-011 2.376885448501602E-011 + 1.638362916513345E-011 1.123867933374322E-011 7.672642966114915E-012 5.214094957198777E-012 + 3.528817082726973E-012 2.381267665705056E-012 1.606610446594055E-012 1.078256886535217E-012 + 7.198041870942759E-013 4.779228553322317E-013 3.155898280464901E-013 2.072430855648540E-013 + 1.353314306877513E-013 8.787153240779351E-014 5.672801387318032E-014 3.640955450006067E-014 + 2.323109714123703E-014 1.473426263149192E-014 9.288782155599184E-015 5.820064242028050E-015 + 3.624114725770366E-015 2.242576991226764E-015 1.378890353981225E-015 8.423921308768696E-016 + 5.112883268606081E-016 3.082824713341214E-016 1.846405501524063E-016 1.098409058846233E-016 + 6.489674298765667E-017 3.807728841250568E-017 2.218479982492339E-017 1.283373294676381E-017 + 7.370883977723126E-018 4.202578824714963E-018 2.378493684635331E-018 1.336095816291324E-018 + 7.448722400973624E-019 4.120910295415995E-019 2.262193762774352E-019 1.232109378229029E-019 + 6.657460053597807E-020 3.568323323569961E-020 1.897020761358039E-020 1.000201734219212E-020 + 5.229565096754398E-021 2.711191803593430E-021 1.393558756714095E-021 7.100906411562849E-022 + 3.586561278527761E-022 1.795438721015096E-022 8.907217994028038E-023 4.378682172295313E-023 + 2.132674992965308E-023 1.029047160316851E-023 4.918402076622400E-024 2.328300786043027E-024 + 1.091510579423154E-024 5.066843226623238E-025 2.328701444012627E-025 1.059503715396926E-025 + 4.771427112535666E-026 2.126646769693280E-026 9.379660074655577E-027 4.093230616476988E-027 + 1.767155174112370E-027 7.546642390310776E-028 3.187454398608921E-028 1.331328045537664E-028 + 5.498143627775605E-029 2.244787423740202E-029 9.059411034646792E-030 3.613491102970009E-030 + 1.424269509825342E-030 5.546647941388047E-031 2.133912065368205E-031 8.108926453879534E-032 + 3.043152537539202E-032 1.127689003239632E-032 4.125638003053172E-033 1.489906654045815E-033 + 5.310339718188228E-034 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 + + +-1.109914671868205E-012 -1.152326727870288E-012 -1.196359433208574E-012 -1.242074716145936E-012 +-1.289536871331851E-012 -1.338812650242699E-012 -1.389971355062025E-012 -1.443084936148156E-012 +-1.498228093226232E-012 -1.555478380447005E-012 -1.614916315460140E-012 -1.676625492655419E-012 +-1.740692700731117E-012 -1.807208044754909E-012 -1.876265072888960E-012 -1.947960907957430E-012 +-2.022396384041449E-012 -2.099676188293648E-012 -2.179909008171710E-012 -2.263207684298002E-012 +-2.349689369160283E-012 -2.439475691876691E-012 -2.532692929256706E-012 -2.629472183398720E-012 +-2.729949566073948E-012 -2.834266390156022E-012 -2.942569368365481E-012 -3.055010819608706E-012 +-3.171748883201442E-012 -3.292947741278269E-012 -3.418777849700744E-012 -3.549416177789040E-012 +-3.685046457214173E-012 -3.825859440400923E-012 -3.972053168804822E-012 -4.123833251440576E-012 +-4.281413154053562E-012 -4.445014499341196E-012 -4.614867378646326E-012 -4.791210675561068E-012 +-4.974292401896150E-012 -5.164370046488373E-012 -5.361710937336643E-012 -5.566592617575997E-012 +-5.779303235818310E-012 -6.000141951408667E-012 -6.229419355167470E-012 -6.467457906209882E-012 +-6.714592385457000E-012 -6.971170366476631E-012 -7.237552704315803E-012 -7.514114043012578E-012 +-7.801243342500821E-012 -8.099344425649154E-012 -8.408836546203285E-012 -8.730154978430543E-012 +-9.063751629295926E-012 -9.410095674030595E-012 -9.769674215986787E-012 -1.014299297170695E-011 +-1.053057698217080E-011 -1.093297135122061E-011 -1.135074201220309E-011 -1.178447652390622E-011 +-1.223478489691044E-011 -1.270230045151631E-011 -1.318768070845530E-011 -1.369160831363649E-011 +-1.421479199822950E-011 -1.475796757543427E-011 -1.532189897533935E-011 -1.590737931932406E-011 +-1.651523203551586E-011 -1.714631201687144E-011 -1.780150682351046E-011 -1.848173793099279E-011 +-1.918796202629486E-011 -1.992117235330807E-011 -2.068240010975102E-011 -2.147271589746076E-011 +-2.229323122810249E-011 -2.314510008641532E-011 -2.402952055319287E-011 -2.494773649028119E-011 +-2.590103928996368E-011 -2.689076969119345E-011 -2.791831966522755E-011 -2.898513437331523E-011 +-3.009271419919302E-011 -3.124261685924550E-011 -3.243645959329974E-011 -3.367592143913411E-011 +-3.496274559390068E-011 -3.629874186578200E-011 -3.768578921933093E-011 -3.912583841807252E-011 +-4.062091476808511E-011 -4.217312096641934E-011 -4.378464005836023E-011 -4.545773850769275E-011 +-4.719476938428780E-011 -4.899817567349233E-011 -5.087049371197791E-011 -5.281435675487957E-011 +-5.483249867924211E-011 -5.692775782898258E-011 -5.910308100677614E-011 -6.136152761847969E-011 +-6.370627397592253E-011 -6.614061776411417E-011 -6.866798267915393E-011 -7.129192324336335E-011 +-7.401612980441505E-011 -7.684443372548741E-011 -7.978081277374560E-011 -8.282939671472708E-011 +-8.599447312049908E-011 -8.928049339975802E-011 -9.269207905834959E-011 -9.623402819901681E-011 +-9.991132226951503E-011 -1.037291330685864E-010 -1.076928300196463E-010 -1.118079877224109E-010 +-1.160803937930876E-010 -1.205160570041543E-010 -1.251212157351757E-010 -1.299023467465412E-010 +-1.348661742884648E-010 -1.400196795580576E-010 -1.453701105177737E-010 -1.509249920890369E-010 +-1.566921367353869E-010 -1.626796554500271E-010 -1.688959691632289E-010 -1.753498205856329E-010 +-1.820502865041089E-010 -1.890067905474613E-010 -1.962291164399378E-010 -2.037274217611819E-010 +-2.115122522319764E-010 -2.195945565458756E-010 -2.279857017675807E-010 -2.366974893197187E-010 +-2.457421715805052E-010 -2.551324691156352E-010 -2.648815885686400E-010 -2.750032412348660E-010 +-2.855116623452028E-010 -2.964216310866792E-010 -3.077484913880821E-010 -3.195081734998356E-010 +-3.317172163984882E-010 -3.443927910473178E-010 -3.575527245457688E-010 -3.712155252016827E-010 +-3.854004085615900E-010 -4.001273244356655E-010 -4.154169849553591E-010 -4.312908937031633E-010 +-4.477713759554795E-010 -4.648816100811268E-010 -4.826456601396412E-010 -5.010885097252221E-010 +-5.202360971039142E-010 -5.401153516934474E-010 -5.607542319370465E-010 -5.821817646244585E-010 +-6.044280857155177E-010 -6.275244827236505E-010 -6.515034387189335E-010 -6.763986780125896E-010 +-7.022452135871754E-010 -7.290793963391566E-010 -7.569389662031409E-010 -7.858631052296501E-010 +-8.158924926911055E-010 -8.470693622935004E-010 -8.794375615742384E-010 -9.130426135696757E-010 +-9.479317808390810E-010 -9.841541319350821E-010 -1.021760610414045E-009 -1.060804106483487E-009 +-1.101339531387250E-009 -1.143423894633069E-009 -1.187116384171142E-009 -1.232478449636462E-009 +-1.279573888771996E-009 -1.328468937154233E-009 -1.379232361347305E-009 -1.431935555616695E-009 +-1.486652642338536E-009 -1.543460576245737E-009 -1.602439252657524E-009 -1.663671619844602E-009 +-1.727243795688015E-009 -1.793245188795714E-009 -1.861768624247205E-009 -1.932910474143117E-009 +-2.006770793143271E-009 -2.083453459183904E-009 -2.163066319571924E-009 -2.245721342661674E-009 +-2.331534775327502E-009 -2.420627306453629E-009 -2.513124236671231E-009 -2.609155654581438E-009 +-2.708856619712110E-009 -2.812367352465689E-009 -2.919833431325228E-009 -3.031405997596022E-009 +-3.147241967970711E-009 -3.267504255216809E-009 -3.392361997297108E-009 -3.521990795245027E-009 +-3.656572960129651E-009 -3.796297769457609E-009 -3.941361733372446E-009 -4.091968871025926E-009 +-4.248330997509826E-009 -4.410668021751880E-009 -4.579208255794682E-009 -4.754188735892643E-009 +-4.935855555878495E-009 -5.124464213268199E-009 -5.320279968591006E-009 -5.523578218450016E-009 +-5.734644882837889E-009 -5.953776807252394E-009 -6.181282180177324E-009 -6.417480966515964E-009 +-6.662705357586545E-009 -6.917300238312623E-009 -7.181623672265383E-009 -7.456047405240013E-009 +-7.740957388074396E-009 -8.036754319445223E-009 -8.343854209405098E-009 -8.662688964452967E-009 +-8.993706994960781E-009 -9.337373845810655E-009 -9.694172851129279E-009 -1.006460581404052E-008 +-1.044919371239202E-008 -1.084847743144834E-008 -1.126301852458107E-008 -1.169340000302564E-008 +-1.214022715581544E-008 -1.260412840104647E-008 -1.308575616966943E-008 -1.358578782305247E-008 +-1.410492660560463E-008 -1.464390263379978E-008 -1.520347392299212E-008 -1.578442745346678E-008 +-1.638758027722528E-008 -1.701378066706173E-008 -1.766390930954626E-008 -1.833888054359288E-008 +-1.903964364635380E-008 -1.976718416824852E-008 -2.052252531900485E-008 -2.130672940666162E-008 +-2.212089933155591E-008 -2.296618013739626E-008 -2.384376062160304E-008 -2.475487500718028E-008 +-2.570080467847019E-008 -2.668287998323128E-008 -2.770248210357426E-008 -2.876104499838657E-008 +-2.986005741997713E-008 -3.100106500777712E-008 -3.218567246204125E-008 -3.341554580060568E-008 +-3.469241470187672E-008 -3.601807493734452E-008 -3.739439089704267E-008 -3.882329821150491E-008 +-4.030680647390579E-008 -4.184700206621344E-008 -4.344605109332828E-008 -4.510620242933335E-008 +-4.682979088014072E-008 -4.861924046697992E-008 -5.047706783534655E-008 -5.240588579420400E-008 +-5.440840699041484E-008 -5.648744772356923E-008 -5.864593190657386E-008 -6.088689517757069E-008 +-6.321348916896752E-008 -6.562898593958285E-008 -6.813678257613720E-008 -7.074040597056072E-008 +-7.344351777983526E-008 -7.624991957534354E-008 -7.916355818896654E-008 -8.218853126344649E-008 +-8.532909301481786E-008 -8.858966021501038E-008 -9.197481840303482E-008 -9.548932833348504E-008 +-9.913813267142262E-008 -1.029263629430567E-007 -1.068593467519929E-007 -1.109426152711961E-007 +-1.151819110212008E-007 -1.195831959455045E-007 -1.241526597944992E-007 -1.288967288297264E-007 +-1.338220748606932E-007 -1.389356246269571E-007 -1.442445695386652E-007 -1.497563757892466E-007 +-1.554787948544711E-007 -1.614198743926371E-007 -1.675879695612115E-007 -1.739917547658307E-007 +-1.806402358581798E-007 -1.875427627998985E-007 -1.947090428103139E-007 -2.021491540164871E-007 +-2.098735596247572E-007 -2.178931226337076E-007 -2.262191211092353E-007 -2.348632640431957E-007 +-2.438377078179147E-007 -2.531550732997120E-007 -2.628284635854634E-007 -2.728714824271450E-007 +-2.832982533602601E-007 -2.941234395630308E-007 -3.053622644742722E-007 -3.170305331989269E-007 +-3.291446547313423E-007 -3.417216650275299E-007 -3.547792509588334E-007 -3.683357751806652E-007 +-3.824103019512718E-007 -3.970226239368060E-007 -4.121932900403800E-007 -4.279436342942080E-007 +-4.442958058554416E-007 -4.612728001478520E-007 -4.788984911931141E-007 -4.971976651771378E-007 +-5.161960552986004E-007 -5.359203779486576E-007 -5.563983702726666E-007 -5.776588291666999E-007 +-5.997316517636425E-007 -6.226478774657589E-007 -6.464397315827813E-007 -6.711406706368349E-007 +-6.967854293978464E-007 -7.234100697155143E-007 -7.510520312164484E-007 -7.797501839376902E-007 +-8.095448829705630E-007 -8.404780251916009E-007 -8.725931081602535E-007 -9.059352912660913E-007 +-9.405514592114056E-007 -9.764902879183558E-007 -1.013802312953252E-006 -1.052540000564045E-006 +-1.092757821430818E-006 -1.134512327232823E-006 -1.177862230139611E-006 -1.222868485337860E-006 +-1.269594376709812E-006 -1.318105605783591E-006 -1.368470384080320E-006 -1.420759528987680E-006 +-1.475046563294531E-006 -1.531407818526310E-006 -1.589922542226298E-006 -1.650673009333321E-006 +-1.713744637812268E-006 -1.779226108699681E-006 -1.847209490732967E-006 -1.917790369738086E-006 +-1.991067982957360E-006 -2.067145358505855E-006 -2.146129460152090E-006 -2.228131337626162E-006 +-2.313266282666246E-006 -2.401653991022370E-006 -2.493418730644751E-006 -2.588689516292659E-006 +-2.687600290808700E-006 -2.790290113312826E-006 -2.896903354580009E-006 -3.007589899875586E-006 +-3.122505359532750E-006 -3.241811287567424E-006 -3.365675408637110E-006 -3.494271853661897E-006 +-3.627781404437967E-006 -3.766391747586455E-006 -3.910297738193718E-006 -4.059701673512444E-006 +-4.214813577107255E-006 -4.375851493842956E-006 -4.543041796128763E-006 -4.716619501847624E-006 +-4.896828604416023E-006 -5.083922415436590E-006 -5.278163920423539E-006 -5.479826148099044E-006 +-5.689192553777761E-006 -5.906557417376366E-006 -6.132226256605240E-006 -6.366516255920829E-006 +-6.609756711839101E-006 -6.862289495233224E-006 -7.124469531262622E-006 -7.396665297604751E-006 +-7.679259341686719E-006 -7.972648817640326E-006 -8.277246043731435E-006 -8.593479081043327E-006 +-8.921792334223137E-006 -9.262647175131274E-006 -9.616522590265581E-006 -9.983915852865115E-006 +-1.036534322063276E-005 -1.076134066005144E-005 -1.117246459830585E-005 -1.159929270385994E-005 +-1.204242469678006E-005 -1.250248318993528E-005 -1.298011456224919E-005 -1.347598986522168E-005 +-1.399080576398618E-005 -1.452528551421461E-005 -1.508017997623328E-005 -1.565626866776367E-005 +-1.625436085675581E-005 -1.687529669583786E-005 -1.751994839996257E-005 -1.818922146889174E-005 +-1.888405595622147E-005 -1.960542778671531E-005 -2.035435012377961E-005 -2.113187478898429E-005 +-2.193909373560470E-005 -2.277714057823408E-005 -2.364719218059415E-005 -2.455047030375188E-005 +-2.548824331703256E-005 -2.646182797400761E-005 -2.747259125602342E-005 -2.852195228583163E-005 +-2.961138431397762E-005 -3.074241678070339E-005 -3.191663745622573E-005 -3.313569466235779E-005 +-3.440129957855380E-005 -3.571522863557279E-005 -3.707932600007716E-005 -3.849550615360676E-005 +-3.996575656949813E-005 -4.149214049145277E-005 -4.307679981759752E-005 -4.472195809402413E-005 +-4.642992362194448E-005 -4.820309268275291E-005 -5.004395288544889E-005 -5.195508664103849E-005 +-5.393917476870679E-005 -5.599900023873294E-005 -5.813745205730445E-005 -6.035752929858140E-005 +-6.266234528955890E-005 -6.505513195348601E-005 -6.753924431781150E-005 -7.011816519285037E-005 +-7.279551002759639E-005 -7.557503194934448E-005 -7.846062699403367E-005 -8.145633953448076E-005 +-8.456636791393803E-005 -8.779507029268650E-005 -9.114697071566104E-005 -9.462676540940080E-005 +-9.823932931692565E-005 -1.019897228794554E-004 -1.058831990742199E-004 -1.099252107179519E-004 +-1.141214180460019E-004 -1.184776965773876E-004 -1.230001452764674E-004 -1.276950950223183E-004 +-1.325691173973110E-004 -1.376290338067911E-004 -1.428819249422184E-004 -1.483351406005623E-004 +-1.539963098732239E-004 -1.598733517182401E-004 -1.659744859300237E-004 -1.723082445214180E-004 +-1.788834835333796E-004 -1.857093952881595E-004 -1.927955211024309E-004 -2.001517644774069E-004 +-2.077884047836091E-004 -2.157161114585890E-004 -2.239459587365560E-004 -2.324894409295671E-004 +-2.413584882806121E-004 -2.505654834096953E-004 -2.601232783747346E-004 -2.700452123699083E-004 +-2.803451300848720E-004 -2.910374007491100E-004 -3.021369378865511E-004 -3.136592198064641E-004 +-3.256203108575795E-004 -3.380368834733307E-004 -3.509262410370919E-004 -3.643063415973189E-004 +-3.781958224635301E-004 -3.926140257151664E-004 -4.075810246564821E-004 -4.231176512517721E-004 +-4.392455245764401E-004 -4.559870803206434E-004 -4.733656013835080E-004 -4.914052495972423E-004 +-5.101310986218039E-004 -5.295691680521814E-004 -5.497464587817915E-004 -5.706909896669606E-004 +-5.924318355390044E-004 -6.149991666119614E-004 -6.384242893356965E-004 -6.627396887457125E-004 +-6.879790723627608E-004 -7.141774156970851E-004 -7.413710094139555E-004 -7.695975082190248E-004 +-7.988959815239458E-004 -8.293069659546778E-004 -8.608725197669320E-004 -8.936362792352826E-004 +-9.276435170846195E-004 -9.629412030348161E-004 -9.995780665317182E-004 -1.037604661739899E-003 +-1.077073434874960E-003 -1.118038793955617E-003 -1.160557181058260E-003 -1.204687147159246E-003 +-1.250489429652756E-003 -1.298027032634730E-003 -1.347365310046105E-003 -1.398572051771327E-003 +-1.451717572790977E-003 -1.506874805490197E-003 -1.564119395227577E-003 -1.623529799272130E-003 +-1.685187389219019E-003 -1.749176556997832E-003 -1.815584824590297E-003 -1.884502957577516E-003 +-1.956025082640092E-003 -2.030248809137656E-003 -2.107275354897749E-003 -2.187209676347222E-003 +-2.270160603122759E-003 -2.356240977300412E-003 -2.445567797387572E-003 -2.538262367224019E-003 +-2.634450449942266E-003 -2.734262427140656E-003 -2.837833463426205E-003 -2.945303676487375E-003 +-3.056818312860455E-003 -3.172527929556371E-003 -3.292588581718029E-003 -3.417162016481457E-003 +-3.546415873217016E-003 -3.680523890330034E-003 -3.819666118802951E-003 -3.964029142663790E-003 +-4.113806306568509E-003 -4.269197950686902E-003 -4.430411653084150E-003 -4.597662479791959E-003 +-4.771173242765036E-003 -4.951174765920034E-003 -5.137906159455257E-003 -5.331615102650311E-003 +-5.532558135345192E-003 -5.741000958298393E-003 -5.957218742623273E-003 -6.181496448500787E-003 +-6.414129153365493E-003 -6.655422389759563E-003 -6.905692493046788E-003 -7.165266959175435E-003 +-7.434484812674378E-003 -7.713696985062252E-003 -8.003266703843496E-003 -8.303569892258162E-003 +-8.614995579944981E-003 -8.937946324667810E-003 -9.272838645245928E-003 -9.620103465816841E-003 +-9.980186571547769E-003 -1.035354907589778E-002 -1.074066789951627E-002 -1.114203626084673E-002 +-1.155816417848449E-002 -1.198957898531658E-002 -1.243682585444796E-002 -1.290046833689312E-002 +-1.338108891098384E-002 -1.387928954341365E-002 -1.439569226180608E-002 -1.493093973865805E-002 +-1.548569588647051E-002 -1.606064646383623E-002 -1.665649969220912E-002 -1.727398688302946E-002 +-1.791386307482755E-002 -1.857690767986958E-002 -1.926392513984924E-002 -1.997574559006194E-002 +-2.071322553142768E-002 -2.147724850965326E-002 -2.226872580074288E-002 -2.308859710197935E-002 +-2.393783122740654E-002 -2.481742680674327E-002 -2.572841298655550E-002 -2.667185013240022E-002 +-2.764883053053632E-002 -2.866047908767118E-002 -2.970795402707713E-002 -3.079244757927070E-002 +-3.191518666529630E-002 -3.307743357049753E-002 -3.428048660649127E-002 -3.552568075888173E-002 +-3.681438831806583E-002 -3.814801949028370E-002 -3.952802298586160E-002 -4.095588658137812E-002 +-4.243313765225470E-002 -4.396134367203627E-002 -4.554211267437402E-002 -4.717709367346578E-002 +-4.886797703843540E-002 -5.061649481684945E-002 -5.242442100227689E-002 -5.429357174049071E-002 +-5.622580546859501E-002 -5.822302298103475E-002 -6.028716741610696E-002 -6.242022415624730E-002 +-6.462422063500889E-002 -6.690122604328452E-002 -6.925335092695563E-002 -7.168274666776722E-002 +-7.419160483884985E-002 -7.678215642591707E-002 -7.945667090478138E-002 -8.221745516543870E-002 +-8.506685227258455E-002 -8.800724005204137E-002 -9.104102949219905E-002 -9.417066294920466E-002 +-9.739861214428548E-002 -1.007273759412508E-001 -1.041594778919085E-001 -1.076974635368411E-001 +-1.113438974487319E-001 -1.151013600052123E-001 -1.189724438780256E-001 -1.229597502251756E-001 +-1.270658845726585E-001 -1.312934523723746E-001 -1.356450542228826E-001 -1.401232807398072E-001 +-1.447307070629594E-001 -1.494698869875623E-001 -1.543433467074420E-001 -1.593535781586139E-001 +-1.645030319524126E-001 -1.697941098881814E-001 -1.752291570365528E-001 -1.808104533855603E-001 +-1.865402050432015E-001 -1.924205349916691E-001 -1.984534733902655E-001 -2.046409474260645E-001 +-2.109847707136547E-001 -2.174866322478557E-001 -2.241480849160995E-001 -2.309705335802841E-001 +-2.379552227412933E-001 -2.451032238030917E-001 -2.524154219573245E-001 -2.598925027137000E-001 +-2.675349381061115E-001 -2.753429726094589E-001 -2.833166088074742E-001 -2.914555928575161E-001 +-2.997593998042666E-001 -3.082272188005585E-001 -3.168579383001092E-001 -3.256501312937503E-001 +-3.346020406677969E-001 -3.437115647704025E-001 -3.529762432791173E-001 -3.623932434703024E-001 +-3.719593469984950E-001 -3.816709373012314E-001 -3.915239877520540E-001 -4.015140506914548E-001 +-4.116362474721451E-001 -4.218852596612518E-001 -4.322553215476302E-001 -4.427402141073426E-001 +-4.533332605843729E-001 -4.640273238465699E-001 -4.748148056785735E-001 -4.856876481738981E-001 +-4.966373373870987E-001 -5.076549094041326E-001 -5.187309589841382E-001 -5.298556509190070E-001 +-5.410187342479129E-001 -5.522095594523835E-001 -5.634170987433210E-001 -5.746299695344752E-001 +-5.858364611771563E-001 -5.970245650083612E-001 -6.081820077388723E-001 -6.192962881793401E-001 +-6.303547172708437E-001 -6.413444613520145E-001 -6.522525885576996E-001 -6.630661182044184E-001 +-6.737720729758485E-001 -6.843575336775426E-001 -6.948096962843713E-001 -7.051159309573447E-001 +-7.152638426587341E-001 -7.252413329467774E-001 -7.350366624838023E-001 -7.446385137454918E-001 +-7.540360533745870E-001 -7.632189935805899E-001 -7.721776519485309E-001 -7.809030089856367E-001 +-7.893867627053061E-001 -7.976213795242063E-001 -8.056001407310364E-001 -8.133171837755898E-001 +-8.207675376245243E-001 -8.279471514366898E-001 -8.348529158263155E-001 -8.414826760073750E-001 +-8.478352361477001E-001 -8.539103543070372E-001 -8.597087273899733E-001 -8.652319656127307E-001 +-8.704825560628994E-001 -8.754638150235704E-001 -8.801798288390974E-001 -8.846353832193903E-001 +-8.888358810145258E-001 -8.927872486428545E-001 -8.964958315253919E-001 -8.999682790689296E-001 +-9.032114199525165E-001 -9.062321287089610E-001 -9.090371848577464E-001 -9.116331261403675E-001 +-9.140260977362721E-001 -9.162216996982816E-001 -9.182248352410686E-001 -9.200395629425345E-001 +-9.216689563711850E-001 -9.231149751231017E-001 -9.243783517253741E-001 -9.254584993161499E-001 +-9.263534454138350E-001 -9.270597973958549E-001 -9.275727454643544E-001 -9.278861088093873E-001 +-9.279924302976509E-001 -9.278831242043520E-001 -9.275486801324053E-001 -9.269789241657663E-001 +-9.261633352981061E-001 -9.250914110493617E-001 -9.237530706909418E-001 -9.221390773713029E-001 +-9.202414513594849E-001 -9.180538352548725E-001 -9.155717579381163E-001 -9.127927267792610E-001 +-9.097160565922359E-001 -9.063423398303055E-001 -9.026727139724054E-001 -8.987086273391314E-001 +-8.944518219630417E-001 -8.899043331435215E-001 -8.850684889530842E-001 -8.799469096982419E-001 +-8.745425073307006E-001 -8.688584847972438E-001 -8.628983353085917E-001 -8.566658414992527E-001 +-8.501650744415801E-001 -8.434003924679242E-001 -8.363764397453113E-001 -8.290981445370745E-001 +-8.215707170759501E-001 -8.137996469633921E-001 -8.057907000010360E-001 -7.975499143495947E-001 +-7.890835959062666E-001 -7.803983127892100E-001 -7.715008888107032E-001 -7.623983958197820E-001 +-7.530981448092200E-001 -7.436076756952681E-001 -7.339347456824956E-001 -7.240873161543159E-001 +-7.140735380642140E-001 -7.039017358328595E-001 -6.935803897976979E-001 -6.831181173074616E-001 +-6.725236526003895E-001 -6.618058256565174E-001 -6.509735402608411E-001 -6.400357515596777E-001 +-6.290014434313818E-001 -6.178796060233140E-001 -6.066792138273228E-001 -5.954092046742873E-001 +-5.840784600232468E-001 -5.726957869016037E-001 -5.612699018199273E-001 -5.498094169384983E-001 +-5.383228287042219E-001 -5.268185091076159E-001 -5.153046996324402E-001 -5.037895078878736E-001 +-4.922809068277141E-001 -4.807867363761457E-001 -4.693147071982353E-001 -4.578724062788215E-001 +-4.464673039088998E-001 -4.351067616268594E-001 -4.237980406255449E-001 -4.125483101170280E-001 +-4.013646551465034E-001 -3.902540833654283E-001 -3.792235303114299E-001 -3.682798627973528E-001 +-3.574298800818383E-001 -3.466803125758676E-001 -3.360378179301381E-001 -3.255089744426692E-001 +-3.151002718204150E-001 -3.048180994186386E-001 -2.946687321635849E-001 -2.846583144344612E-001 +-2.747928422374927E-001 -2.650781440465027E-001 -2.555198607105285E-001 -2.461234248397772E-001 +-2.368940400779104E-001 -2.278366606528235E-001 -2.189559715719054E-001 -2.102563697934807E-001 +-2.017419466660726E-001 -1.934164718835521E-001 -1.852833791591224E-001 -1.773457537762140E-001 +-1.696063221311138E-001 -1.620674433416176E-001 -1.547311029589543E-001 -1.475989087871304E-001 +-1.406720887849459E-001 -1.339514910012340E-001 -1.274375854732643E-001 -1.211304680014735E-001 +-1.150298657004169E-001 -1.091351442157230E-001 -1.034453164894879E-001 -9.795905295158422E-002 +-9.267469301144352E-002 -8.759025772363760E-002 -8.270346350075999E-002 -7.801173674841895E-002 +-7.351222929936828E-002 -6.920183452674210E-002 -6.507720401985227E-002 -6.113476470993396E-002 +-5.737073633747431E-002 -5.378114915725080E-002 -5.036186178188148E-002 -4.710857906949086E-002 +-4.401686996599604E-002 -4.108218521748479E-002 -3.829987487317254E-002 -3.566520550447583E-002 +-3.317337707081166E-002 -3.081953936781888E-002 -2.859880799879171E-002 -2.650627981520616E-002 +-2.453704777730558E-002 -2.268621519077722E-002 -2.094890928059408E-002 -1.932029406810130E-002 +-1.779558252238292E-002 -1.637004796184315E-002 -1.503903468675808E-002 -1.379796782828773E-002 +-1.264236240406758E-002 -1.156783157500635E-002 -1.057009410228786E-002 -9.644981007790307E-003 +-8.788441445181578E-003 -7.996547792806395E-003 -7.265499983134135E-003 -6.591629086971412E-003 +-5.971400173844213E-003 -5.401414472909904E-003 -4.878410861456299E-003 -4.399266710473836E-003 +-3.960998118939320E-003 -3.560759570318517E-003 -3.195843046376001E-003 -2.863676634671122E-003 +-2.561822667118141E-003 -2.287975427698495E-003 -2.039958467836807E-003 -1.815721568097323E-003 +-1.613337384716016E-003 -1.430998782655097E-003 -1.267022571063318E-003 -1.119826547574266E-003 +-9.879349362533364E-004 -8.699751341658228E-004 -7.646731788142539E-004 -6.708491613069328E-004 +-5.874126133216343E-004 -5.133578943032382E-004 -4.477596035912395E-004 -3.897680403364035E-004 +-3.386047321579409E-004 -2.935580515355409E-004 -2.539789369461929E-004 -2.192767337646807E-004 +-1.889151679686942E-004 -1.624084637432234E-004 -1.393176141812738E-004 -1.192468124445447E-004 +-1.018400489921678E-004 -8.677787882045583E-005 -7.377436109117977E-005 -6.257417206942536E-005 +-5.294989095056281E-005 -4.469945693410428E-005 -3.764379480314594E-005 -3.162460529291852E-005 +-2.650231568034159E-005 -2.215418529658858E-005 -1.847256005335998E-005 -1.536326957650378E-005 +-1.274416015244275E-005 -1.054375640732146E-005 -8.700044448915566E-006 -7.159369099632709E-006 +-5.875437827464562E-006 -4.808424032357347E-006 -3.924162459875888E-006 -3.193429683991710E-006 +-2.591302818212762E-006 -2.096589871223049E-006 -1.691325452183817E-006 -1.360325844747599E-006 +-1.090797801014851E-006 -8.719957510085462E-007 -6.949224742043485E-007 -5.520686322653660E-007 +-4.371869120140136E-007 -3.450968710421046E-007 -2.715169120033581E-007 -2.129201328955733E-007 +-1.664111073959767E-007 -1.296209399291765E-007 -1.006182134440443E-007 -7.783370308727961E-008 +-5.999696568954515E-008 -4.608313315035403E-008 -3.526843762439058E-008 -2.689317831343778E-008 +-2.043100428606967E-008 -1.546353586641816E-008 -1.165947965482783E-008 -8.757510151408358E-009 +-6.552295286067967E-009 -4.883134980415364E-009 -3.624762247529381E-009 -2.679926330516297E-009 +-1.973438016213078E-009 -1.447409521495869E-009 -1.057466172048978E-009 -7.697453580531138E-010 +-5.585307822933948E-010 -4.043975826752679E-010 -2.927672322006930E-010 -2.110104068774647E-010 +-1.514008766225205E-010 -1.081362540220379E-010 -7.687898990091456E-011 -5.440165591463880E-011 +-3.831413652100477E-011 -2.685483485885377E-011 -1.873165597839108E-011 -1.300150108283056E-011 +-8.979404089981892E-012 -6.170366400492423E-012 -4.218481884127906E-012 -2.869163213666832E-012 +-1.941242686664061E-012 -1.306475444173300E-012 -8.745617472794965E-013 -5.822615533903831E-013 +-3.855266429409540E-013 -2.538453335796962E-013 -1.662003599358308E-013 -1.081961540176563E-013 +-7.002892929036021E-014 -4.506063082276571E-014 -2.882299377098421E-014 -1.832611749010484E-014 +-1.158133206366638E-014 -7.273943581026671E-015 -4.540158230107176E-015 -2.815966942507531E-015 +-1.735421788970751E-015 -1.062596701481423E-015 -6.463717373513866E-016 -3.905807546256023E-016 +-2.344323634682500E-016 -1.397544796638547E-016 -8.274049108676491E-017 -4.864485432788234E-017 +-2.839775276499848E-017 -1.645965058885180E-017 -9.471257672429394E-018 -5.410101768821290E-018 +-3.067423924651603E-018 -1.726124379547633E-018 -9.639602336304101E-019 -5.341868640756639E-019 +-2.937190597105946E-019 -1.602260577206541E-019 -8.670676345057177E-020 -4.654229417879687E-020 +-2.477839684004989E-020 -1.308230566069140E-020 -6.849132223806676E-021 -3.555338107683577E-021 +-1.829673986186490E-021 -9.333977082785868E-022 -4.719675366471804E-022 -2.365165163068151E-022 +-1.174534363997429E-022 -5.779299919727447E-023 -2.817342900020602E-023 -1.360530370443916E-023 +-6.507726268499191E-024 -3.082837380927308E-024 -1.446170177246042E-024 -6.717104584671616E-025 +-3.088762733403483E-025 -1.405956361551232E-025 -6.334151138001427E-026 -2.824086707163570E-026 +-1.245901429825813E-026 -5.438106480911005E-027 -2.348073472935556E-027 -1.002804934760990E-027 +-4.235475334978145E-028 -1.768919714268841E-028 -7.304204964305237E-029 -2.981497619736009E-029 +-1.202900508574428E-029 -4.796173934462246E-030 -1.889581210844481E-030 -7.354891252835701E-031 +-2.827878979037006E-031 -1.073871297146637E-031 -4.027009360460148E-032 -1.491019483411858E-032 +-5.449851818532516E-033 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 + + + 3.102279727032465E-005 3.141301602639238E-005 3.180814313032442E-005 3.220824032154230E-005 + 3.261337011605411E-005 3.302359581622266E-005 3.343898152065682E-005 3.385959213422685E-005 + 3.428549337820610E-005 3.471675180053999E-005 3.515343478624439E-005 3.559561056793451E-005 + 3.604334823648659E-005 3.649671775183337E-005 3.695578995389556E-005 3.742063657365070E-005 + 3.789133024434127E-005 3.836794451282392E-005 3.885055385106112E-005 3.933923366775784E-005 + 3.983406032014413E-005 4.033511112590609E-005 4.084246437526715E-005 4.135619934322087E-005 + 4.187639630191802E-005 4.240313653320917E-005 4.293650234134522E-005 4.347657706583761E-005 + 4.402344509448033E-005 4.457719187653570E-005 4.513790393608602E-005 4.570566888555325E-005 + 4.628057543938854E-005 4.686271342793412E-005 4.745217381145949E-005 4.804904869437420E-005 + 4.865343133961936E-005 4.926541618324029E-005 4.988509884914216E-005 5.051257616403184E-005 + 5.114794617254700E-005 5.179130815257592E-005 5.244276263076987E-005 5.310241139825066E-005 + 5.377035752651585E-005 5.444670538354384E-005 5.513156065010163E-005 5.582503033625770E-005 + 5.652722279810272E-005 5.723824775468042E-005 5.795821630513125E-005 5.868724094605229E-005 + 5.942543558907481E-005 6.017291557866344E-005 6.092979771013913E-005 6.169620024792846E-005 + 6.247224294404294E-005 6.325804705679062E-005 6.405373536972287E-005 6.485943221081993E-005 + 6.567526347191719E-005 6.650135662837616E-005 6.733784075900300E-005 6.818484656621750E-005 + 6.904250639647553E-005 6.991095426094858E-005 7.079032585646348E-005 7.168075858670538E-005 + 7.258239158368729E-005 7.349536572949023E-005 7.441982367827615E-005 7.535590987857809E-005 + 7.630377059587095E-005 7.726355393542578E-005 7.823540986545154E-005 7.921949024052809E-005 + 8.021594882533422E-005 8.122494131867372E-005 8.224662537780352E-005 8.328116064306869E-005 + 8.432870876284627E-005 8.538943341880359E-005 8.646350035147404E-005 8.755107738615449E-005 + 8.865233445912864E-005 8.976744364421994E-005 9.089657917967891E-005 9.203991749540847E-005 + 9.319763724053174E-005 9.436991931130642E-005 9.555694687939060E-005 9.675890542046375E-005 + 9.797598274320854E-005 9.920836901865599E-005 1.004562568099008E-004 1.017198411021896E-004 + 1.029993193333889E-004 1.042948914248346E-004 1.056067598125712E-004 1.069351294789829E-004 + 1.082802079848229E-004 1.096422055016457E-004 1.110213348446471E-004 1.124178115059178E-004 + 1.138318536881143E-004 1.152636823385547E-004 1.167135211837420E-004 1.181815967643229E-004 + 1.196681384704856E-004 1.211733785778028E-004 1.226975522835260E-004 1.242408977433361E-004 + 1.258036561085564E-004 1.273860715638335E-004 1.289883913652924E-004 1.306108658791716E-004 + 1.322537486209434E-004 1.339172962949278E-004 1.356017688344036E-004 1.373074294422240E-004 + 1.390345446319436E-004 1.407833842694624E-004 1.425542216151942E-004 1.443473333667647E-004 + 1.461629997022471E-004 1.480015043239414E-004 1.498631345027049E-004 1.517481811228393E-004 + 1.536569387275436E-004 1.555897055649380E-004 1.575467836346673E-004 1.595284787350897E-004 + 1.615351005110599E-004 1.635669625023135E-004 1.656243821924594E-004 1.677076810585881E-004 + 1.698171846215059E-004 1.719532224965984E-004 1.741161284453365E-004 1.763062404274281E-004 + 1.785239006536269E-004 1.807694556392054E-004 1.830432562581012E-004 1.853456577977428E-004 + 1.876770200145663E-004 1.900377071902303E-004 1.924280881885378E-004 1.948485365130743E-004 + 1.972994303655709E-004 1.997811527050015E-004 2.022940913074233E-004 2.048386388265705E-004 + 2.074151928552100E-004 2.100241559872691E-004 2.126659358807437E-004 2.153409453214002E-004 + 2.180496022872759E-004 2.207923300139936E-004 2.235695570608952E-004 2.263817173780098E-004 + 2.292292503738621E-004 2.321126009841350E-004 2.350322197411957E-004 2.379885628444967E-004 + 2.409820922318623E-004 2.440132756516711E-004 2.470825867359486E-004 2.501905050743764E-004 + 2.533375162892348E-004 2.565241121112885E-004 2.597507904566244E-004 2.630180555044589E-004 + 2.663264177759216E-004 2.696763942138320E-004 2.730685082634798E-004 2.765032899544190E-004 + 2.799812759832955E-004 2.835030097977109E-004 2.870690416811478E-004 2.906799288389586E-004 + 2.943362354854372E-004 2.980385329319892E-004 3.017873996764060E-004 3.055834214932679E-004 + 3.094271915254804E-004 3.133193103769627E-004 3.172603862065057E-004 3.212510348228054E-004 + 3.252918797806959E-004 3.293835524785938E-004 3.335266922571643E-004 3.377219464992341E-004 + 3.419699707309561E-004 3.462714287242521E-004 3.506269926005405E-004 3.550373429357691E-004 + 3.595031688667740E-004 3.640251681989710E-004 3.686040475154050E-004 3.732405222871733E-004 + 3.779353169852325E-004 3.826891651936203E-004 3.875028097240933E-004 3.923770027322138E-004 + 3.973125058348953E-004 4.023100902294255E-004 4.073705368139898E-004 4.124946363097088E-004 + 4.176831893842130E-004 4.229370067767737E-004 4.282569094250037E-004 4.336437285931586E-004 + 4.390983060020489E-004 4.446214939605869E-004 4.502141554989913E-004 4.558771645036664E-004 + 4.616114058537789E-004 4.674177755595530E-004 4.732971809023076E-004 4.792505405762555E-004 + 4.852787848320847E-004 4.913828556223505E-004 4.975637067486953E-004 5.038223040109204E-004 + 5.101596253579372E-004 5.165766610406156E-004 5.230744137665565E-004 5.296538988568126E-004 + 5.363161444045840E-004 5.430621914359089E-004 5.498930940723744E-004 5.568099196958840E-004 + 5.638137491154884E-004 5.709056767363251E-004 5.780868107306817E-004 5.853582732112090E-004 + 5.927212004063209E-004 6.001767428377987E-004 6.077260655006298E-004 6.153703480451159E-004 + 6.231107849612674E-004 6.309485857655278E-004 6.388849751898372E-004 6.469211933730878E-004 + 6.550584960549836E-004 6.632981547723421E-004 6.716414570578700E-004 6.800897066414392E-004 + 6.886442236538978E-004 6.973063448334491E-004 7.060774237346283E-004 7.149588309399134E-004 + 7.239519542739948E-004 7.330581990207509E-004 7.422789881429521E-004 7.516157625047328E-004 + 7.610699810968685E-004 7.706431212648849E-004 7.803366789400438E-004 7.901521688732392E-004 + 8.000911248718360E-004 8.101551000395018E-004 8.203456670190444E-004 8.306644182383246E-004 + 8.411129661592610E-004 8.516929435299652E-004 8.624060036400687E-004 8.732538205792533E-004 + 8.842380894990484E-004 8.953605268779219E-004 9.066228707897151E-004 9.180268811754618E-004 + 9.295743401186271E-004 9.412670521238233E-004 9.531068443990356E-004 9.650955671414020E-004 + 9.772350938266052E-004 9.895273215019009E-004 1.001974171082852E-003 1.014577587653796E-003 + 1.027339540772102E-003 1.040262024776275E-003 1.053347059097929E-003 1.066596688577704E-003 + 1.080012983785173E-003 1.093598041342770E-003 1.107353984253818E-003 1.121282962234684E-003 + 1.135387152051136E-003 1.149668757858933E-003 1.164130011548717E-003 1.178773173095260E-003 + 1.193600530911118E-003 1.208614402204741E-003 1.223817133343118E-003 1.239211100218982E-003 + 1.254798708622666E-003 1.270582394618645E-003 1.286564624926831E-003 1.302747897308703E-003 + 1.319134740958280E-003 1.335727716898063E-003 1.352529418379960E-003 1.369542471291288E-003 + 1.386769534565895E-003 1.404213300600480E-003 1.421876495676180E-003 1.439761880385481E-003 + 1.457872250064521E-003 1.476210435230868E-003 1.494779302026830E-003 1.513581752668364E-003 + 1.532620725899670E-003 1.551899197453534E-003 1.571420180517496E-003 1.591186726205911E-003 + 1.611201924037992E-003 1.631468902421888E-003 1.651990829144915E-003 1.672770911869969E-003 + 1.693812398638235E-003 1.715118578378271E-003 1.736692781421519E-003 1.758538380024371E-003 + 1.780658788896836E-003 1.803057465737914E-003 1.825737911777746E-003 1.848703672326651E-003 + 1.871958337331119E-003 1.895505541936850E-003 1.919348967058957E-003 1.943492339959377E-003 + 1.967939434831628E-003 1.992694073392988E-003 2.017760125484184E-003 2.043141509676711E-003 + 2.068842193887852E-003 2.094866196003525E-003 2.121217584509043E-003 2.147900479127892E-003 + 2.174919051468629E-003 2.202277525680014E-003 2.229980179114476E-003 2.258031343000027E-003 + 2.286435403120719E-003 2.315196800505787E-003 2.344320032127552E-003 2.373809651608225E-003 + 2.403670269935716E-003 2.433906556188586E-003 2.464523238270236E-003 2.495525103652454E-003 + 2.526917000128473E-003 2.558703836575636E-003 2.590890583727803E-003 2.623482274957632E-003 + 2.656484007068857E-003 2.689900941098708E-003 2.723738303130584E-003 2.758001385117140E-003 + 2.792695545713918E-003 2.827826211123641E-003 2.863398875951339E-003 2.899419104070451E-003 + 2.935892529500027E-003 2.972824857293185E-003 3.010221864436992E-003 3.048089400763902E-003 + 3.086433389874898E-003 3.125259830074536E-003 3.164574795318007E-003 3.204384436170389E-003 + 3.244694980778261E-003 3.285512735853858E-003 3.326844087671907E-003 3.368695503079339E-003 + 3.411073530518034E-003 3.453984801060803E-003 3.497436029460739E-003 3.541434015214178E-003 + 3.585985643637418E-003 3.631097886957390E-003 3.676777805416480E-003 3.723032548391675E-003 + 3.769869355528286E-003 3.817295557888366E-003 3.865318579114102E-003 3.913945936606334E-003 + 3.963185242718452E-003 4.013044205965857E-003 4.063530632251211E-003 4.114652426105722E-003 + 4.166417591946614E-003 4.218834235351114E-003 4.271910564347095E-003 4.325654890720672E-003 + 4.380075631340977E-003 4.435181309502314E-003 4.490980556284010E-003 4.547482111928156E-003 + 4.604694827235534E-003 4.662627664979973E-003 4.721289701341391E-003 4.780690127357821E-003 + 4.840838250396649E-003 4.901743495645386E-003 4.963415407622274E-003 5.025863651706935E-003 + 5.089098015691436E-003 5.153128411352047E-003 5.217964876041963E-003 5.283617574305369E-003 + 5.350096799513082E-003 5.417412975520185E-003 5.485576658345880E-003 5.554598537875995E-003 + 5.624489439588405E-003 5.695260326301745E-003 5.766922299947808E-003 5.839486603367893E-003 + 5.912964622133584E-003 5.987367886392237E-003 6.062708072737632E-003 6.138997006106120E-003 + 6.216246661698718E-003 6.294469166929479E-003 6.373676803400667E-003 6.453882008905017E-003 + 6.535097379455655E-003 6.617335671343984E-003 6.700609803226076E-003 6.784932858238033E-003 + 6.870318086140651E-003 6.956778905494068E-003 7.044328905862706E-003 7.132981850051073E-003 + 7.222751676371004E-003 7.313652500940703E-003 7.405698620016245E-003 7.498904512356032E-003 + 7.593284841618757E-003 7.688854458795456E-003 7.785628404676172E-003 7.883621912351946E-003 + 7.982850409752607E-003 8.083329522221032E-003 8.185075075124532E-003 8.288103096503964E-003 + 8.392429819761280E-003 8.498071686386176E-003 8.605045348722501E-003 8.713367672775189E-003 + 8.823055741058381E-003 8.934126855485542E-003 9.046598540302328E-003 9.160488545062928E-003 + 9.275814847650773E-003 9.392595657344309E-003 9.510849417928817E-003 9.630594810855046E-003 + 9.751850758445561E-003 9.874636427149737E-003 9.998971230848308E-003 1.012487483420845E-002 + 1.025236715609033E-002 1.038146837300613E-002 1.051219892263269E-002 1.064457950737857E-002 + 1.077863109800700E-002 1.091437493731539E-002 1.105183254387296E-002 1.119102571581731E-002 + 1.133197653471138E-002 1.147470736946197E-002 1.161924088030108E-002 1.176560002283128E-002 + 1.191380805213673E-002 1.206388852696084E-002 1.221586531395248E-002 1.236976259198170E-002 + 1.252560485652677E-002 1.268341692413410E-002 1.284322393695239E-002 1.300505136734297E-002 + 1.316892502256773E-002 1.333487104955648E-002 1.350291593975566E-002 1.367308653406000E-002 + 1.384541002782916E-002 1.401991397599131E-002 1.419662629823559E-002 1.437557528429559E-002 + 1.455678959932591E-002 1.474029828937399E-002 1.492613078694955E-002 1.511431691669394E-002 + 1.530488690115185E-002 1.549787136664758E-002 1.569330134926889E-002 1.589120830096071E-002 + 1.609162409573153E-002 1.629458103597533E-002 1.650011185891184E-002 1.670824974314821E-002 + 1.691902831536508E-002 1.713248165713030E-002 1.734864431184364E-002 1.756755129181559E-002 + 1.778923808548408E-002 1.801374066477267E-002 1.824109549259368E-002 1.847133953050051E-002 + 1.870451024649265E-002 1.894064562297800E-002 1.917978416489639E-002 1.942196490800874E-002 + 1.966722742735658E-002 1.991561184589636E-002 2.016715884331360E-002 2.042190966502176E-002 + 2.067990613135103E-002 2.094119064693245E-002 2.120580621028287E-002 2.147379642359644E-002 + 2.174520550274847E-002 2.202007828751805E-002 2.229846025203547E-002 2.258039751546118E-002 + 2.286593685290298E-002 2.315512570657847E-002 2.344801219723010E-002 2.374464513580023E-002 + 2.404507403537412E-002 2.434934912339867E-002 2.465752135418545E-002 2.496964242170665E-002 + 2.528576477269281E-002 2.560594162004158E-002 2.593022695654713E-002 2.625867556896023E-002 + 2.659134305238913E-002 2.692828582505205E-002 2.726956114339205E-002 2.761522711756618E-002 + 2.796534272732030E-002 2.831996783826213E-002 2.867916321854519E-002 2.904299055597674E-002 + 2.941151247556360E-002 2.978479255750973E-002 3.016289535568058E-002 3.054588641654931E-002 + 3.093383229864041E-002 3.132680059248768E-002 3.172485994112310E-002 3.212808006111434E-002 + 3.253653176416918E-002 3.295028697932578E-002 3.336941877574844E-002 3.379400138614945E-002 + 3.422411023085764E-002 3.465982194255644E-002 3.510121439171323E-002 3.554836671272441E-002 + 3.600135933080023E-002 3.646027398961512E-002 3.692519377974980E-002 3.739620316795252E-002 + 3.787338802724786E-002 3.835683566792297E-002 3.884663486942134E-002 3.934287591317659E-002 + 3.984565061641858E-002 4.035505236698692E-002 4.087117615918689E-002 4.139411863072514E-002 + 4.192397810076338E-002 4.246085460913013E-002 4.300484995673192E-002 4.355606774720685E-002 + 4.411461342986551E-002 4.468059434396542E-002 4.525411976436725E-002 4.583530094862342E-002 + 4.642425118555043E-002 4.702108584533973E-002 4.762592243126291E-002 4.823888063302965E-002 + 4.886008238185948E-002 4.948965190733012E-002 5.012771579606827E-002 5.077440305235072E-002 + 5.142984516068673E-002 5.209417615045547E-002 5.276753266267479E-002 5.345005401898112E-002 + 5.414188229290313E-002 5.484316238351509E-002 5.555404209155949E-002 5.627467219813144E-002 + 5.700520654602207E-002 5.774580212382119E-002 5.849661915288321E-002 5.925782117726581E-002 + 6.002957515675349E-002 6.081205156308428E-002 6.160542447950090E-002 6.240987170375379E-002 + 6.322557485468834E-002 6.405271948255341E-002 6.489149518317378E-002 6.574209571613567E-002 + 6.660471912713917E-002 6.747956787467875E-002 6.836684896121868E-002 6.926677406903689E-002 + 7.017955970091877E-002 7.110542732588769E-002 7.204460353016842E-002 7.299732017358666E-002 + 7.396381455161512E-002 7.494432956328698E-002 7.593911388520425E-002 7.694842215187828E-002 + 7.797251514265074E-002 7.901165997544940E-002 8.006613030764805E-002 8.113620654430505E-002 + 8.222217605407095E-002 8.332433339306280E-002 8.444298053701779E-002 8.557842712204741E-002 + 8.673099069432975E-002 8.790099696908700E-002 8.908878009921112E-002 9.029468295391253E-002 + 9.151905740778295E-002 9.276226464067579E-002 9.402467544882538E-002 9.530667056764004E-002 + 9.660864100661964E-002 9.793098839686776E-002 9.927412535168177E-002 1.006384758407249E-001 + 1.020244755782990E-001 1.034325724262577E-001 1.048632268121178E-001 1.063169121629432E-001 + 1.077941153555982E-001 1.092953371839859E-001 1.108210928439038E-001 1.123719124361755E-001 + 1.139483414887300E-001 1.155509414983271E-001 1.171802904926409E-001 1.188369836134404E-001 + 1.205216337216212E-001 1.222348720248617E-001 1.239773487287020E-001 1.257497337118523E-001 + 1.275527172265655E-001 1.293870106249177E-001 1.312533471118586E-001 1.331524825259081E-001 + 1.350851961483850E-001 1.370522915420646E-001 1.390545974201710E-001 1.410929685466124E-001 + 1.431682866683656E-001 1.452814614809221E-001 1.474334316276889E-001 1.496251657342372E-001 + 1.518576634782612E-001 1.541319566960984E-001 1.564491105266169E-001 1.588102245932458E-001 + 1.612164342248706E-001 1.636689117162529E-001 1.661688676285684E-001 1.687175521305641E-001 + 1.713162563807409E-001 1.739663139508535E-001 1.766691022908731E-001 1.794260442354202E-001 + 1.822386095514833E-001 1.851083165270388E-001 1.880367335999656E-001 1.910254810263713E-001 + 1.940762325871657E-001 1.971907173313712E-001 2.003707213542934E-001 2.036180896082514E-001 + 2.069347277430913E-001 2.103226039731896E-001 2.137837509670555E-001 2.173202677549937E-001 + 2.209343216495611E-001 2.246281501727394E-001 2.284040629828590E-001 2.322644437933164E-001 + 2.362117522740335E-001 2.402485259254101E-001 2.443773819131837E-001 2.486010188511636E-001 + 2.529222185171962E-001 2.573438474859663E-001 2.618688586603233E-001 2.665002926807098E-001 + 2.712412791899948E-001 2.760950379285097E-001 2.810648796313769E-001 2.861542066972859E-001 + 2.913665135946757E-001 2.967053869678588E-001 3.021745054018928E-001 3.077776388010388E-001 + 3.135186473313503E-001 3.194014798733729E-001 3.254301719260501E-001 3.316088428977522E-001 + 3.379416927148541E-001 3.444329976725061E-001 3.510871054461621E-001 3.579084291761078E-001 + 3.649014405306315E-001 3.720706616467189E-001 3.794206558402097E-001 3.869560169703218E-001 + 3.946813573364265E-001 4.026012939779812E-001 4.107204332417727E-001 4.190433534742154E-001 + 4.275745856905010E-001 4.363185920672075E-001 4.452797421006499E-001 4.544622862701623E-001 + 4.638703270438764E-001 4.735077870647562E-001 4.833783743570868E-001 4.934855443986670E-001 + 5.038324589121606E-001 5.144219412409149E-001 5.252564281906146E-001 5.363379182390805E-001 + 5.476679160429356E-001 5.592473732024855E-001 5.710766252857016E-001 5.831553251593200E-001 + 5.954823727305973E-001 6.080558412677388E-001 6.208729005411652E-001 6.339297371120794E-001 + 6.472214721895655E-001 6.607420775830255E-001 6.744842903929305E-001 6.884395272093994E-001 + 7.025977987242400E-001 7.169476258066074E-001 7.314759582437391E-001 7.461680975038831E-001 + 7.610076250356977E-001 7.759763377732493E-001 7.910541926637109E-001 8.062192621706391E-001 + 8.214477028228853E-001 8.367137389706949E-001 8.519896639683878E-001 8.672458610184260E-001 + 8.824508458756319E-001 8.975713335129963E-001 9.125723306826705E-001 9.274172560579630E-001 + 9.420680893062764E-001 9.564855500120574E-001 9.706293068379797E-001 9.844582166798372E-001 + 9.979305928370643E-001 1.011004500392217E+000 1.023638076079342E+000 1.035789868939150E+000 + 1.047419197030527E+000 1.058486514421847E+000 1.068953781657804E+000 1.078784831930711E+000 + 1.087945724329078E+000 1.096405074847486E+000 1.104134355382864E+000 1.111108150782237E+000 + 1.117304364220401E+000 1.122704361853143E+000 1.127293048899173E+000 1.131058871145640E+000 + 1.133993738451114E+000 1.136092870250939E+000 1.137354567483237E+000 1.137779920899827E+000 + 1.137372472579308E+000 1.136137855823249E+000 1.134083448726713E+000 1.131218089028614E+000 + 1.127551907423270E+000 1.123096275258521E+000 1.117863775300199E+000 1.111868170909520E+000 + 1.105124372237408E+000 1.097648399629170E+000 1.089457344430178E+000 1.080569327379441E+000 + 1.071003454773387E+000 1.060779772577310E+000 1.049919218656852E+000 1.038443573296780E+000 + 1.026375408169082E+000 1.013738033907219E+000 1.000555446437975E+000 9.868522722169372E-001 + 9.726537125079638E-001 9.579854868412035E-001 9.428737757782318E-001 9.273451631066473E-001 + 9.114265775802006E-001 8.951452343141411E-001 8.785285759391975E-001 8.616042136116356E-001 + 8.443998679712448E-001 8.269433101344728E-001 8.092623028066100E-001 7.913845415924180E-001 + 7.733375965872786E-001 7.551488543346035E-001 7.368454602353945E-001 7.184542615012670E-001 + 7.000017507616038E-001 6.815140104524251E-001 6.630166581206557E-001 6.445347928045041E-001 + 6.260929426795477E-001 6.077150141812961E-001 5.894242428420404E-001 5.712431461049957E-001 + 5.531934784011474E-001 5.352961887919081E-001 5.175713814920623E-001 5.000382795907281E-001 + 4.827151922818657E-001 4.656194858993049E-001 4.487675590238236E-001 4.321748218917089E-001 + 4.158556802861685E-001 3.998235240362504E-001 3.840907201844128E-001 3.686686108156938E-001 + 3.535675154711240E-001 3.387967379981137E-001 3.243645776236737E-001 3.102783439749737E-001 + 2.965443757181049E-001 2.831680624419676E-001 2.701538693814284E-001 2.575053645534048E-001 + 2.452252478719243E-001 2.333153818135218E-001 2.217768232221765E-001 2.106098558723177E-001 + 1.998140234477911E-001 1.893881626421260E-001 1.793304361386682E-001 1.696383652855472E-001 + 1.603088623373591E-001 1.513382621901360E-001 1.427223535861950E-001 1.344564098086119E-001 + 1.265352189197106E-001 1.189531136229617E-001 1.117040008425594E-001 1.047813911198507E-001 + 9.817842792138363E-002 9.188791694085419E-002 8.590235545817088E-002 8.021396179498538E-002 + 7.481470487921746E-002 6.969633390308712E-002 6.485040803162211E-002 6.026832609291344E-002 + 5.594135615866108E-002 5.186066490460264E-002 4.801734662574229E-002 4.440245177113330E-002 + 4.100701485729594E-002 3.782208161796510E-002 3.483873525040291E-002 3.204812162451574E-002 + 2.944147332996701E-002 2.701013244782631E-002 2.474557194649663E-002 2.263941561620319E-002 + 2.068345647172079E-002 1.886967356884173E-002 1.719024719596179E-002 1.563757241777112E-002 + 1.420427096311594E-002 1.288320146342933E-002 1.166746806155067E-002 1.055042742313738E-002 + 9.525694194129930E-003 8.587144957806467E-003 7.728920753825060E-003 6.945428229293332E-003 + 6.231339498337421E-003 5.581590791891885E-003 4.991379983538816E-003 4.456163080236202E-003 + 3.971649768751168E-003 3.533798109615193E-003 3.138808470514341E-003 2.783116790289441E-003 + 2.463387263222443E-003 2.176504531101053E-003 1.919565467759837E-003 1.689870637467344E-003 + 1.484915504740406E-003 1.302381468990903E-003 1.140126792918567E-003 9.961774888239687E-004 + 8.687182220941297E-004 7.560832860718610E-004 6.567476974169896E-004 5.693184559580960E-004 + 4.925260079673266E-004 4.252159468143393E-004 3.663409801098614E-004 3.149531877713059E-004 + 2.701965909645015E-004 2.313000476240357E-004 1.975704862526391E-004 1.683864859655072E-004 + 1.431922072920545E-004 1.214916750847441E-004 1.028434120176943E-004 8.685541858832078E-005 + 7.318049326149261E-005 6.151188441246691E-005 5.157926402436331E-005 4.314501166768967E-005 + 3.600079612086747E-005 2.996444106739203E-005 2.487706061129143E-005 2.060044987086265E-005 + 1.701471562316153E-005 1.401614131672755E-005 1.151532677031165E-005 9.435260714428836E-006 + 7.709863546780700E-006 6.282604913149372E-006 5.105261757484203E-006 4.136816253777973E-006 + 3.342481050620196E-006 2.692839944773491E-006 2.163092810257386E-006 1.732394333169708E-006 + 1.383276829898899E-006 1.101148148719979E-006 8.738563644221854E-007 6.913136661218984E-007 + 5.451725043978946E-007 4.285477010123506E-007 3.357788293871192E-007 2.622277442241839E-007 + 2.041066725413962E-007 1.583327750223259E-007 1.224055456771717E-007 9.430383966904383E-008 + 7.239970453681132E-008 5.538654009833634E-008 4.221942851941849E-008 3.206576010329060E-008 + 2.426453419268413E-008 1.829294020254460E-008 1.373902330688850E-008 1.027941480232691E-008 + 7.661260762713281E-009 5.687616336193724E-009 4.205688896200919E-009 3.097413126306717E-009 + 2.271926770909914E-009 1.659588875432048E-009 1.207244400941210E-009 8.744915299619239E-010 + 6.307520549801664E-010 4.529821050538525E-010 3.238911437424263E-010 2.305625726534095E-010 + 1.633902004816790E-010 1.152619884716914E-010 8.093646886672083E-011 5.656857884101943E-011 + 3.935080939745915E-011 2.724292072406716E-011 1.876934751153399E-011 1.286808303004662E-011 + 8.778517720021123E-012 5.958606305526235E-012 4.024003479984814E-012 2.703570370360052E-012 + 1.807016842167760E-012 1.201492968097707E-012 7.947448304965751E-013 5.230598125877196E-013 + 3.426880404867156E-013 2.237739823377289E-013 1.460924042942280E-013 9.483846805429423E-014 + 6.121380248919002E-014 3.928174903501038E-014 2.505977739431953E-014 1.589192246719863E-014 + 1.001742274253589E-014 6.276000806088283E-015 3.907725775108244E-015 2.417940018838314E-015 + 1.486665120009554E-015 9.082227287183137E-016 5.512493992953708E-016 3.323877152786612E-016 + 1.990888543805484E-016 1.184452646476372E-016 6.998748627073830E-017 4.106934035872895E-017 + 2.393161079662242E-017 1.384665155259462E-017 7.954218178951333E-018 4.536186755638886E-018 + 2.567942756611439E-018 1.442914274420416E-018 8.046662539811467E-019 4.453176301908563E-019 + 2.445462959022487E-019 1.332438333209888E-019 7.202531668521004E-020 3.862174774475969E-020 + 2.054203535559261E-020 1.083615944617791E-020 5.668689492124577E-021 2.940490324308670E-021 + 1.512308897738554E-021 7.710778163752447E-022 3.897135921998000E-022 1.952246437300173E-022 + 9.692079371653407E-023 4.768078619764643E-023 2.324150478364441E-023 1.122352064533745E-023 + 5.368921014151167E-024 2.543819687228981E-024 1.193643819302157E-024 5.546248972256990E-025 + 2.551564427003981E-025 1.162095991541221E-025 5.239028831501885E-026 2.337637884372209E-026 + 1.032202699265205E-026 4.509796878297719E-027 1.949375148292034E-027 8.335310996704759E-028 + 3.525144162093263E-028 1.474350199028789E-028 6.097227086231348E-029 2.492932509569204E-029 + 1.007564407698353E-029 4.024910134442564E-030 1.588900741491320E-030 6.197690540915147E-031 + 2.388306525464899E-031 9.090986116751324E-032 3.417633868134587E-032 1.268719750555362E-032 + 4.650103844226560E-033 1.682467486225844E-033 6.008239040580709E-034 2.117350460320250E-034 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 + + + + 1.924828096786578E-009 1.973555357624711E-009 2.023516155229837E-009 2.074741716748551E-009 + 2.127264059847182E-009 2.181116012723921E-009 2.236331234627599E-009 2.292944236895847E-009 + 2.350990404525897E-009 2.410506018291409E-009 2.471528277419223E-009 2.534095322840147E-009 + 2.598246261028380E-009 2.664021188444402E-009 2.731461216596668E-009 2.800608497737724E-009 + 2.871506251210836E-009 2.944198790463605E-009 3.018731550745399E-009 3.095151117506012E-009 + 3.173505255513174E-009 3.253842938707218E-009 3.336214380811547E-009 3.420671066717954E-009 + 3.507265784666526E-009 3.596052659240155E-009 3.687087185194331E-009 3.780426262143340E-009 + 3.876128230124562E-009 3.974252906063073E-009 4.074861621159373E-009 4.178017259223619E-009 + 4.283784295980228E-009 4.392228839367568E-009 4.503418670857797E-009 4.617423287822759E-009 + 4.734313946972354E-009 4.854163708892614E-009 4.977047483711198E-009 5.103042077919047E-009 + 5.232226242377202E-009 5.364680721539033E-009 5.500488303918495E-009 5.639733873836039E-009 + 5.782504464474480E-009 5.928889312277989E-009 6.078979912728211E-009 6.232870077532383E-009 + 6.390655993259219E-009 6.552436281459162E-009 6.718312060306545E-009 6.888387007802396E-009 + 7.062767426577094E-009 7.241562310333646E-009 7.424883411972967E-009 7.612845313443735E-009 + 7.805565497360595E-009 8.003164420435388E-009 8.205765588767313E-009 8.413495635039155E-009 + 8.626484397667665E-009 8.844865001957732E-009 9.068773943311068E-009 9.298351172541325E-009 + 9.533740183348953E-009 9.775088102010595E-009 1.002254577933903E-008 1.027626788497108E-008 + 1.053641300404250E-008 1.080314373631030E-008 1.107662679778427E-008 1.135703312493154E-008 + 1.164453798151903E-008 1.193932106816077E-008 1.224156663463838E-008 1.255146359506500E-008 + 1.286920564596494E-008 1.319499138734229E-008 1.352902444681450E-008 1.387151360688879E-008 + 1.422267293546026E-008 1.458272191961393E-008 1.495188560281400E-008 1.533039472556612E-008 + 1.571848586964070E-008 1.611640160594732E-008 1.652439064615275E-008 1.694270799813729E-008 + 1.737161512538665E-008 1.781138011041886E-008 1.826227782234865E-008 1.872459008869371E-008 + 1.919860587153067E-008 1.968462144811026E-008 2.018294059604526E-008 2.069387478318642E-008 + 2.121774336230555E-008 2.175487377070697E-008 2.230560173489242E-008 2.287027148040763E-008 + 2.344923594700070E-008 2.404285700922807E-008 2.465150570264520E-008 2.527556245572353E-008 + 2.591541732763866E-008 2.657147025207855E-008 2.724413128722402E-008 2.793382087205778E-008 + 2.864097008916248E-008 2.936602093417152E-008 3.010942659204165E-008 3.087165172031989E-008 + 3.165317273958143E-008 3.245447813122081E-008 3.327606874278202E-008 3.411845810101836E-008 + 3.498217273287800E-008 3.586775249461621E-008 3.677575090923912E-008 3.770673551249076E-008 + 3.866128820759920E-008 3.964000562900393E-008 4.064349951529180E-008 4.167239709157418E-008 + 4.272734146154518E-008 4.380899200946528E-008 4.491802481232230E-008 4.605513306242685E-008 + 4.722102750070706E-008 4.841643686097274E-008 4.964210832542753E-008 5.089880799171303E-008 + 5.218732135177739E-008 5.350845378286798E-008 5.486303105095463E-008 5.625189982689759E-008 + 5.767592821568510E-008 5.913600629906864E-008 6.063304669193755E-008 6.216798511277937E-008 + 6.374178096858277E-008 6.535541795454985E-008 6.700990466899161E-008 6.870627524379114E-008 + 7.044558999082939E-008 7.222893606477720E-008 7.405742814266830E-008 7.593220912067783E-008 + 7.785445082854273E-008 7.982535476206977E-008 8.184615283418981E-008 8.391810814502825E-008 + 8.604251577147282E-008 8.822070357673184E-008 9.045403304039014E-008 9.274390010948198E-008 + 9.509173607111105E-008 9.749900844716662E-008 9.996722191169170E-008 1.024979192314800E-007 + 1.050926822304878E-007 1.077531327786644E-007 1.104809338058207E-007 1.132777903411685E-007 + 1.161454505791813E-007 1.190857069724424E-007 1.221003973521664E-007 1.251914060770898E-007 + 1.283606652114554E-007 1.316101557328244E-007 1.349419087704687E-007 1.383580068751238E-007 + 1.418605853208917E-007 1.454518334401109E-007 1.491339959920282E-007 1.529093745661256E-007 + 1.567803290209857E-007 1.607492789595877E-007 1.648187052419668E-007 1.689911515361745E-007 + 1.732692259085130E-007 1.776556024540430E-007 1.821530229683757E-007 1.867642986618059E-007 + 1.914923119168488E-007 1.963400180902848E-007 2.013104473608433E-007 2.064067066236708E-007 + 2.116319814327806E-007 2.169895379926956E-007 2.224827252005220E-007 2.281149767397488E-007 + 2.338898132270645E-007 2.398108444135501E-007 2.458817714416173E-007 2.521063891591018E-007 + 2.584885884919745E-007 2.650323588771368E-007 2.717417907568350E-007 2.786210781362550E-007 + 2.856745212058874E-007 2.929065290303222E-007 3.003216223051349E-007 3.079244361836096E-007 + 3.157197231750579E-007 3.237123561165490E-007 3.319073312199147E-007 3.403097711959340E-007 + 3.489249284576564E-007 3.577581884048697E-007 3.668150727917610E-007 3.761012431798950E-007 + 3.856225044786585E-007 3.953848085753938E-007 4.053942580574961E-007 4.156571100288039E-007 + 4.261797800226729E-007 4.369688460141840E-007 4.480310525340035E-007 4.593733148864693E-007 + 4.710027234745406E-007 4.829265482343343E-007 4.951522431820145E-007 5.076874510758870E-007 + 5.205400081966296E-007 5.337179492486399E-007 5.472295123855825E-007 5.610831443632812E-007 + 5.752875058231937E-007 5.898514767097711E-007 6.047841618250958E-007 6.200948965243079E-007 + 6.357932525553473E-007 6.518890440467170E-007 6.683923336469977E-007 6.853134388199618E-007 + 7.026629382992586E-007 7.204516787066967E-007 7.386907813382832E-007 7.573916491222878E-007 + 7.765659737536781E-007 7.962257430094323E-007 8.163832482492757E-007 8.370510921066026E-007 + 8.582421963743735E-007 8.799698100909495E-007 9.022475178309505E-007 9.250892482063273E-007 + 9.485092825829974E-007 9.725222640185198E-007 9.971432064264182E-007 1.022387503972921E-006 + 1.048270940711994E-006 1.074809700464769E-006 1.102020376949533E-006 1.129919984168666E-006 + 1.158525967059071E-006 1.187856212412755E-006 1.217929060074468E-006 1.248763314423419E-006 + 1.280378256146307E-006 1.312793654309079E-006 1.346029778734964E-006 1.380107412696660E-006 + 1.415047865930592E-006 1.450872987981442E-006 1.487605181885414E-006 1.525267418200771E-006 + 1.563883249394554E-006 1.603476824594493E-006 1.644072904715453E-006 1.685696877969921E-006 + 1.728374775772321E-006 1.772133289047191E-006 1.816999784951523E-006 1.863002324021771E-006 + 1.910169677756421E-006 1.958531346645133E-006 2.008117578655937E-006 2.058959388192062E-006 + 2.111088575530458E-006 2.164537746754237E-006 2.219340334191665E-006 2.275530617374585E-006 + 2.333143744529621E-006 2.392215754615606E-006 2.452783599921358E-006 2.514885169237944E-006 + 2.578559311620240E-006 2.643845860752730E-006 2.710785659935064E-006 2.779420587703169E-006 + 2.849793584102175E-006 2.921948677627811E-006 2.995931012853381E-006 3.071786878759819E-006 + 3.149563737786891E-006 3.229310255623906E-006 3.311076331758920E-006 3.394913130805904E-006 + 3.480873114629670E-006 3.569010075289122E-006 3.659379168819755E-006 3.752036949876928E-006 + 3.847041407261963E-006 3.944452000353731E-006 4.044329696469005E-006 4.146737009175377E-006 + 4.251738037581177E-006 4.359398506627574E-006 4.469785808408544E-006 4.582969044545155E-006 + 4.699019069641280E-006 4.818008535848564E-006 4.940011938569251E-006 5.065105663326022E-006 + 5.193368033829081E-006 5.324879361271199E-006 5.459721994882516E-006 5.597980373777459E-006 + 5.739741080127186E-006 5.885092893691835E-006 6.034126847747533E-006 6.186936286444455E-006 + 6.343616923632686E-006 6.504266903194061E-006 6.668986860918780E-006 6.837879987966978E-006 + 7.011052095956234E-006 7.188611683717108E-006 7.370670005760185E-006 7.557341142498813E-006 + 7.748742072273251E-006 7.944992745223117E-006 8.146216159056029E-006 8.352538436761945E-006 + 8.564088906323770E-006 8.781000182476329E-006 9.003408250567046E-006 9.231452552573209E-006 + 9.465276075332146E-006 9.705025441042095E-006 9.950851000093268E-006 1.020290692629000E-005 + 1.046135131452659E-005 1.072634628098141E-005 1.099805806589492E-005 1.127665713899991E-005 + 1.156231830767333E-005 1.185522082788160E-005 1.215554851799278E-005 1.246348987553104E-005 + 1.277923819695146E-005 1.310299170051449E-005 1.343495365234237E-005 1.377533249574133E-005 + 1.412434198387655E-005 1.448220131588831E-005 1.484913527654105E-005 1.522537437949900E-005 + 1.561115501432515E-005 1.600671959730227E-005 1.641231672617843E-005 1.682820133894156E-005 + 1.725463487673087E-005 1.769188545099553E-005 1.814022801501507E-005 1.859994453989808E-005 + 1.907132419517954E-005 1.955466353414122E-005 2.005026668398146E-005 2.055844554096594E-005 + 2.107951997069371E-005 2.161381801361724E-005 2.216167609595868E-005 2.272343924616894E-005 + 2.329946131708038E-005 2.389010521390822E-005 2.449574312825994E-005 2.511675677831754E-005 + 2.575353765536105E-005 2.640648727680744E-005 2.707601744594401E-005 2.776255051854023E-005 + 2.846651967652840E-005 2.918836920894746E-005 2.992855480035189E-005 3.068754382689210E-005 + 3.146581566028001E-005 3.226386197985915E-005 3.308218709300538E-005 3.392130826409166E-005 + 3.478175605225580E-005 3.566407465821987E-005 3.656882228041479E-005 3.749657148067349E-005 + 3.844790955976296E-005 3.942343894303346E-005 4.042377757647331E-005 4.144955933346477E-005 + 4.250143443254719E-005 4.358006986650191E-005 4.468614984308396E-005 4.582037623773593E-005 + 4.698346905862870E-005 4.817616692438648E-005 4.939922755486414E-005 5.065342827535475E-005 + 5.193956653462071E-005 5.325846043715194E-005 5.461094929006781E-005 5.599789416509476E-005 + 5.742017847606269E-005 5.887870857238114E-005 6.037441434896712E-005 6.190824987311687E-005 + 6.348119402882512E-005 6.509425117907580E-005 6.674845184664435E-005 6.844485341396815E-005 + 7.018454084266403E-005 7.196862741328691E-005 7.379825548594735E-005 7.567459728242439E-005 + 7.759885569043322E-005 7.957226509072800E-005 8.159609220774714E-005 8.367163698452688E-005 + 8.580023348264177E-005 8.798325080794894E-005 9.022209406294692E-005 9.251820532658613E-005 + 9.487306466239268E-005 9.728819115580864E-005 9.976514398167201E-005 1.023055235028004E-004 + 1.049109724006768E-004 1.075831768392650E-004 1.103238676630287E-004 1.131348216302607E-004 + 1.160178626828718E-004 1.189748632538309E-004 1.220077456134894E-004 1.251184832560754E-004 + 1.283091023276808E-004 1.315816830971218E-004 1.349383614711027E-004 1.383813305551649E-004 + 1.419128422619623E-004 1.455352089684606E-004 1.492508052237176E-004 1.530620695089693E-004 + 1.569715060518079E-004 1.609816866963115E-004 1.650952528310539E-004 1.693149173769987E-004 + 1.736434668373622E-004 1.780837634116073E-004 1.826387471758206E-004 1.873114383318114E-004 + 1.921049395273632E-004 1.970224382501668E-004 2.020672092980664E-004 2.072426173283534E-004 + 2.125521194889520E-004 2.179992681344619E-004 2.235877136301349E-004 2.293212072469970E-004 + 2.352036041514522E-004 2.412388664928440E-004 2.474310665925947E-004 2.537843902386898E-004 + 2.603031400894350E-004 2.669917391905734E-004 2.738547346100261E-004 2.808968011946904E-004 + 2.881227454539258E-004 2.955375095745482E-004 3.031461755723603E-004 3.109539695854551E-004 + 3.189662663147558E-004 3.271885936174967E-004 3.356266372595768E-004 3.442862458329962E-004 + 3.531734358448333E-004 3.622943969845110E-004 3.716554975763972E-004 3.812632902250816E-004 + 3.911245176610001E-004 4.012461187944095E-004 4.116352349860760E-004 4.222992165433964E-004 + 4.332456294510666E-004 4.444822623458136E-004 4.560171337451309E-004 4.678584995404012E-004 + 4.800148607652521E-004 4.924949716504670E-004 5.053078479773158E-004 5.184627757416570E-004 + 5.319693201417565E-004 5.458373349033436E-004 5.600769719560261E-004 5.746986914758452E-004 + 5.897132723094166E-004 6.051318227958057E-004 6.209657920030377E-004 6.372269813968846E-004 + 6.539275569604295E-004 6.710800617837286E-004 6.886974291437725E-004 7.067929960959211E-004 + 7.253805175989150E-004 7.444741811966527E-004 7.640886222809351E-004 7.842389399605466E-004 + 8.049407135632276E-004 8.262100197982901E-004 8.480634506089848E-004 8.705181317450329E-004 + 8.935917420872118E-004 9.173025337573473E-004 9.416693530486545E-004 9.667116622130000E-004 + 9.924495621433901E-004 1.018903815991812E-003 1.046095873764423E-003 1.074047897938102E-003 + 1.102782790144440E-003 1.132324218969454E-003 1.162696648919579E-003 1.193925370606937E-003 + 1.226036532209351E-003 1.259057172263266E-003 1.293015253850478E-003 1.327939700242517E-003 + 1.363860432069561E-003 1.400808406083921E-003 1.438815655591595E-003 1.477915332628785E-003 + 1.518141751964067E-003 1.559530437010706E-003 1.602118167737684E-003 1.645943030672309E-003 + 1.691044471091680E-003 1.737463347504984E-003 1.785241988533543E-003 1.834424252300627E-003 + 1.885055588448501E-003 1.937183102905802E-003 1.990855625534287E-003 2.046123780790258E-003 + 2.103040061542420E-003 2.161658906194896E-003 2.222036779271190E-003 2.284232255622487E-003 + 2.348306108431564E-003 2.414321401191835E-003 2.482343583849788E-003 2.552440593308163E-003 + 2.624682958496659E-003 2.699143910227203E-003 2.775899496060976E-003 2.855028700425716E-003 + 2.936613570233089E-003 3.020739346258187E-003 3.107494600555753E-003 3.196971380201057E-003 + 3.289265357657271E-003 3.384475988085804E-003 3.482706673931231E-003 3.584064937128645E-003 + 3.688662599297827E-003 3.796615970306470E-003 3.908046045602871E-003 4.023078712738033E-003 + 4.141844967517167E-003 4.264481140241931E-003 4.391129132526848E-003 4.521936665196583E-003 + 4.657057537795245E-003 4.796651900264204E-003 4.940886537371732E-003 5.089935166505822E-003 + 5.243978749470586E-003 5.403205818957583E-003 5.567812820395269E-003 5.738004469913498E-003 + 5.913994129195173E-003 6.096004198023876E-003 6.284266525374865E-003 6.479022839937069E-003 + 6.680525200995912E-003 6.889036470650886E-003 7.104830808387874E-003 7.328194189074523E-003 + 7.559424945497336E-003 7.798834336611919E-003 8.046747142732989E-003 8.303502288948180E-003 + 8.569453498100265E-003 8.844969974744984E-003 9.130437121557486E-003 9.426257289729336E-003 + 9.732850564969298E-003 1.005065559079650E-002 1.038013043089228E-002 1.072175347235904E-002 + 1.107602437181945E-002 1.144346504637815E-002 1.182462071156092E-002 1.222006096844304E-002 + 1.263038094227914E-002 1.305620247505232E-002 1.349817537446949E-002 1.395697872204440E-002 + 1.443332224302847E-002 1.492794774107337E-002 1.544163060063848E-002 1.597518136029032E-002 + 1.652944736018039E-002 1.710531446713401E-002 1.770370888093242E-002 1.832559902552833E-002 + 1.897199752909819E-002 1.964396329700269E-002 2.034260368190491E-002 2.106907675547543E-002 + 2.182459368630558E-002 2.261042122884452E-002 2.342788432838032E-002 2.427836884729521E-002 + 2.516332441804422E-002 2.608426742853154E-002 2.704278414579301E-002 2.804053398413379E-002 + 2.907925292412102E-002 3.016075708908653E-002 3.128694648606255E-002 3.245980891834526E-002 + 3.368142407716346E-002 3.495396782022030E-002 3.627971664517301E-002 3.766105236642371E-002 + 3.910046700390658E-002 4.060056789288118E-002 4.216408302407083E-002 4.379386662382136E-002 + 4.549290498430305E-002 4.726432255412735E-002 4.911138830010943E-002 5.103752235127269E-002 + 5.304630293655802E-002 5.514147362807872E-002 5.732695090213600E-002 5.960683203059534E-002 + 6.198540331560547E-002 6.446714868102565E-002 6.705675863431551E-002 6.975913961301866E-002 + 7.257942373035620E-002 7.552297893481977E-002 7.859541959901917E-002 8.180261755340390E-002 + 8.515071358081930E-002 8.864612938819641E-002 9.229558007198978E-002 9.610608709427088E-002 + 1.000849917866600E-001 1.042399693995211E-001 1.085790437140559E-001 1.131106022351103E-001 + 1.178434119826307E-001 1.227866358998008E-001 1.279498498959067E-001 1.333430605419502E-001 + 1.389767234369271E-001 1.448617622624955E-001 1.510095885435023E-001 1.574321221314513E-001 + 1.641418124275277E-001 1.711516603611945E-001 1.784752411396232E-001 1.861267277823591E-001 + 1.941209154545394E-001 2.024732466107572E-001 2.111998369602188E-001 2.203175022621525E-001 + 2.298437859585225E-001 2.397969876488761E-001 2.501961924096580E-001 2.610613009574687E-001 + 2.724130606525119E-001 2.842730973348558E-001 2.966639479820164E-001 3.096090941717877E-001 + 3.231329963290912E-001 3.372611287298336E-001 3.520200152283500E-001 3.674372656677955E-001 + 3.835416129248559E-001 4.003629505312400E-001 4.179323708044811E-001 4.362822034096009E-001 + 4.554460542609243E-001 4.754588446598009E-001 4.963568505489453E-001 5.181777417474436E-001 + 5.409606210120491E-001 5.647460627499719E-001 5.895761511857931E-001 6.154945177602236E-001 + 6.425463775108318E-001 6.707785641545061E-001 7.002395635578308E-001 7.309795452445998E-001 + 7.630503915489855E-001 7.965057239780209E-001 8.314009262978587E-001 8.677931638040994E-001 + 9.057413981771985E-001 9.453063972589527E-001 9.865507390149431E-001 1.029538808870277E+000 + 1.074336789521270E+000 1.121012642233833E+000 1.169636078539463E+000 1.220278521131725E+000 + 1.273013052649753E+000 1.327914350909938E+000 1.385058609012993E+000 1.444523438610644E+000 + 1.506387754464574E+000 1.570731638270499E+000 1.637636179552902E+000 1.707183291262164E+000 + 1.779455497527176E+000 1.854535690834670E+000 1.932506855724619E+000 2.013451755911750E+000 + 2.097452581571277E+000 2.184590553367077E+000 2.274945479658786E+000 2.368595263208514E+000 + 2.465615353626132E+000 2.566078141755009E+000 2.670052292219319E+000 2.777602010442556E+000 + 2.888786240620720E+000 3.003657791408458E+000 3.122262386471839E+000 3.244637637597044E+000 + 3.370811938740718E+000 3.500803280289043E+000 3.634617983879301E+000 3.772249359453690E+000 + 3.913676287781124E+000 4.058861733516611E+000 4.207751195986397E+000 4.360271107297915E+000 + 4.516327190081499E+000 4.675802790167435E+000 4.838557202770031E+000 5.004424014258449E+000 + 5.173209485293118E+000 5.344691004931090E+000 5.518615649167344E+000 5.694698881171542E+000 + 5.872623434072649E+000 6.052038420379644E+000 6.232558714833202E+000 6.413764659462462E+000 + 6.595202140665742E+000 6.776383088023213E+000 6.956786443060965E+000 7.135859643106423E+000 + 7.313020660504220E+000 7.487660630631369E+000 7.659147093230540E+000 7.826827860492219E+000 + 7.990035512046748E+000 8.148092501630988E+000 8.300316842807096E+000 8.446028321949131E+000 + 8.584555166071841E+000 8.715241071330365E+000 8.837452475604078E+000 8.950585935987947E+000 + 9.054075449775638E+000 9.147399536175701E+000 9.230087876096249E+000 9.301727289372039E+000 + 9.361966813250383E+000 9.410521633168901E+000 9.447175607108328E+000 9.471782118196989E+000 + 9.484262986701477E+000 9.484605171765882E+000 9.472854994732511E+000 9.449109799526678E+000 + 9.413509234029927E+000 9.366232023840556E+000 9.307494705412942E+000 9.237550331830462E+000 + 9.156687001726613E+000 9.065226223228187E+000 8.963521125610381E+000 8.851954532041583E+000 + 8.730936907361560E+000 8.600904195285107E+000 8.462315559762876E+000 8.315651045460609E+000 + 8.161409172445017E+000 8.000104480190386E+000 7.832265035947301E+000 7.658429922349852E+000 + 7.479146718882118E+000 7.294968991485057E+000 7.106453804166978E+000 6.914159265988351E+000 + 6.718642126236371E+000 6.520455429987573E+000 6.320146245591683E+000 6.118253474901577E+000 + 5.915305756331610E+000 5.711819470060691E+000 5.508296853916888E+000 5.305224237657406E+000 + 5.103070402599875E+000 4.902285072796324E+000 4.703297543088516E+000 4.506515448586239E+000 + 4.312323679452144E+000 4.121083444141861E+000 3.933131483336672E+000 3.748779436122819E+000 + 3.568313359250326E+000 3.391993399440976E+000 3.220053617880767E+000 3.052701965138531E+000 + 2.890120403801799E+000 2.732465175110386E+000 2.579867204803431E+000 2.432432642286006E+000 + 2.290243526085393E+000 2.153358567430362E+000 2.021814042679622E+000 1.895624784284418E+000 + 1.774785259032304E+000 1.659270721521602E+000 1.549038430193564E+000 1.444028912829690E+000 + 1.344167268226764E+000 1.249364490803658E+000 1.159518805174173E+000 1.074516998232068E+000 + 9.942357370207028E-001 9.185428615760307E-001 8.472986430060530E-001 7.803569982657481E-001 + 7.175666543641025E-001 6.587722560579047E-001 6.038154124049805E-001 5.525356788289217E-001 + 5.047714725535263E-001 4.603609203686996E-001 4.191426386670396E-001 3.809564465256273E-001 + 3.456440132918931E-001 3.130494426644784E-001 2.830197956458146E-001 2.554055549945973E-001 + 2.300610339409994E-001 2.068447319660214E-001 1.856196404118320E-001 1.662535006055080E-001 + 1.486190170661049E-001 1.325940282439157E-001 1.180616371268363E-001 1.049103039536001E-001 + 9.303390320455152E-002 8.233174700068216E-002 7.270857703029772E-002 6.407452713633191E-002 + 5.634505873021127E-002 4.944087124323114E-002 4.328778987597293E-002 3.781663295290384E-002 + 3.296306122615431E-002 2.866741149387129E-002 2.487451690014486E-002 2.153351626236407E-002 + 1.859765472650161E-002 1.602407798106942E-002 1.377362216732735E-002 1.181060150871119E-002 + 1.010259554905065E-002 8.620237740176459E-003 7.337006958474213E-003 6.229023360461341E-003 + 5.274849813147058E-003 4.455299959214796E-003 3.753253803121763E-003 3.153481534878796E-003 + 2.642476146014689E-003 2.208295239094210E-003 1.840412289783223E-003 1.529577490068310E-003 + 1.267688183683547E-003 1.047668800557950E-003 8.633601063333917E-004 7.094175055890282E-004 + 5.812180729750608E-004 4.747759344326309E-004 3.866655803216977E-004 3.139526627340820E-004 + 2.541318095847459E-004 2.050709772452112E-004 1.649618604760847E-004 1.322758821971639E-004 + 1.057252951901019E-004 8.422894218525724E-005 6.688223901946445E-005 5.293096680755006E-005 + 4.174848256226919E-005 3.281598271727856E-005 2.570547992813738E-005 2.006517980020077E-005 + 1.560697035182976E-005 1.209576267509021E-005 9.340446084630689E-006 7.186244796280297E-006 + 5.508285658869842E-006 4.206207539618776E-006 3.199662547506633E-006 2.424577324875719E-006 + 1.830059135462381E-006 1.375846447336157E-006 1.030217196213786E-006 7.682799816371678E-007 + 5.705841731146864E-007 4.219943730985473E-007 3.107829925363915E-007 2.279019398336058E-007 + 1.664007031176535E-007 1.209635148673064E-007 8.754292015398305E-008 6.307101327734135E-008 + 4.523294530632377E-008 3.229015723197786E-008 2.294326727852911E-008 1.622500305085240E-008 + 1.141911281915015E-008 7.997814028920651E-009 5.574097672665867E-009 3.865581380118584E-009 + 2.667253769992346E-009 1.831028391550769E-009 1.250485464356297E-009 8.495448242769811E-010 + 5.741018229627817E-010 3.858842612951436E-010 2.579650607520829E-010 1.715023971528729E-010 + 1.133846888065112E-010 7.453883332444888E-011 4.872180811182958E-011 3.166249325272587E-011 + 2.045575994235830E-011 1.313718792748279E-011 8.386342251957678E-012 5.320994509732099E-012 + 3.355284650472650E-012 2.102558632573443E-012 1.309225576734737E-012 8.100157691188354E-013 + 4.979086469158939E-013 3.040515369267409E-013 1.844377314368409E-013 1.111272637104405E-013 + 6.650013729769101E-014 3.952008473659406E-014 2.332214345974806E-014 1.366582083366721E-014 + 7.950245951888975E-015 4.591593378961119E-015 2.632353652443102E-015 1.497898739771295E-015 + 8.459350599788174E-016 4.740960961923515E-016 2.636504025842742E-016 1.454723991197269E-016 + 7.963055369165518E-017 4.323965050083439E-017 2.328861765000499E-017 1.243997721903410E-017 + 6.589682419816772E-018 3.461246556173034E-018 1.802508419289567E-018 9.305758490344666E-019 + 4.762208438896140E-019 2.415455669980665E-019 1.214158000532303E-019 6.047666751646655E-020 + 2.984612469167028E-020 1.459240546539496E-020 7.067368386342975E-021 3.390297844314284E-021 + 1.610774697909853E-021 7.579476285905844E-022 3.532593864940209E-022 1.631387060061600E-022 + 7.472279427930461E-023 3.402570028600894E-023 1.548843874751700E-023 6.976332586563125E-024 + 3.108909104067513E-024 1.370540310265716E-024 5.976121780399459E-025 2.577098719545178E-025 + 1.098919971383199E-025 4.633008698321336E-026 1.930901309977488E-026 7.954154916543868E-027 + 3.238182519057423E-027 1.302619030324111E-027 5.176986401015360E-028 2.032422600694362E-028 + 7.880639071726435E-029 3.017529282899654E-029 1.140815818898848E-029 4.257788166960202E-030 + 1.568507707763523E-030 5.702326567944468E-031 2.045540915390602E-031 7.239054424891156E-032 + 2.526964310821747E-032 8.699314864933074E-033 2.953002434924013E-033 9.882311913719036E-034 + 3.259804276287660E-034 1.059702475123587E-034 3.394345751518204E-035 1.071092947483377E-035 + 3.329012498562380E-036 1.018915288893930E-036 3.070515409734788E-037 9.108568742051845E-038 + 2.659308340643082E-038 7.639763351834770E-039 2.159213741749150E-039 6.002423574159030E-040 + 1.640901642577767E-040 4.410337891727039E-041 1.165203890005834E-041 3.025372927164016E-042 + 7.718054384877018E-043 1.934160390645613E-043 4.760312492536675E-044 1.150371563249626E-044 + 2.728981788460229E-045 6.353628755702412E-046 1.451440815240682E-046 3.252590869127966E-047 + 7.148372318488842E-048 1.540374060464837E-048 3.253710323560254E-049 6.735288861933596E-050 + 1.365991021718147E-050 2.713575922227922E-051 5.278681437457383E-052 1.005272220462149E-052 + 1.873702457043289E-053 3.417108698563338E-054 6.095919349287256E-055 1.063460622120381E-055 + 1.813775005423663E-056 3.023442352330697E-057 4.924375704900590E-058 7.834390779712392E-059 + 1.217126181970872E-059 1.845918203142256E-060 2.732148421634400E-061 3.945281294065639E-062 + 5.556466420038769E-063 7.630094928165562E-064 1.021253335934194E-064 1.331893102661997E-065 + 1.691982475354046E-066 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 + + diff --git a/tests/apps/miniDFT/tests/espresso/benchmark/large.in b/tests/apps/miniDFT/tests/espresso/benchmark/large.in new file mode 100644 index 0000000000..359feab765 --- /dev/null +++ b/tests/apps/miniDFT/tests/espresso/benchmark/large.in @@ -0,0 +1,2042 @@ +&control +prefix = 'magnesia' +calculation = 'scf' +restart_mode = 'from_scratch' +wf_collect = .false. +disk_io = 'none' +tstress = .false. +tprnfor = .false. +outdir = './' +wfcdir = './' +pseudo_dir = './' +/ +&system +ibrav = 0 +celldm(1) = 7.93658 +nat = 2000 +ntyp = 2 +nbnd = 4000 +ecutwfc = 130 +/ +&electrons +electron_maxstep = 1 +conv_thr = 1.0d-10 +diago_thr_init=5.0d-4 +startingwfc='atomic' +mixing_mode = 'plain' +mixing_beta = 0.7 +mixing_ndim = 8 +diagonalization = 'david' +diago_david_ndim = 4 +diago_full_acc = .true. +/ +CELL_PARAMETERS +0.0 5.0 5.0 +5.0 0.0 5.0 +5.0 5.0 0.0 +ATOMIC_SPECIES +Mg 24.305 Mg.pz-bhs.UPF +O 15.999 O.pz-mt.UPF +ATOMIC_POSITIONS crystal +Mg 0.0 0.0 0.0 +O 0.05 0.05 0.05 +Mg 0.0 0.0 0.1 +O 0.05 0.05 0.15 +Mg 0.0 0.0 0.2 +O 0.05 0.05 0.25 +Mg 0.0 0.0 0.3 +O 0.05 0.05 0.35 +Mg 0.0 0.0 0.4 +O 0.05 0.05 0.45 +Mg 0.0 0.0 0.5 +O 0.05 0.05 0.55 +Mg 0.0 0.0 0.6 +O 0.05 0.05 0.65 +Mg 0.0 0.0 0.7 +O 0.05 0.05 0.75 +Mg 0.0 0.0 0.8 +O 0.05 0.05 0.85 +Mg 0.0 0.0 0.9 +O 0.05 0.05 0.95 +Mg 0.0 0.1 0.0 +O 0.05 0.15 0.05 +Mg 0.0 0.1 0.1 +O 0.05 0.15 0.15 +Mg 0.0 0.1 0.2 +O 0.05 0.15 0.25 +Mg 0.0 0.1 0.3 +O 0.05 0.15 0.35 +Mg 0.0 0.1 0.4 +O 0.05 0.15 0.45 +Mg 0.0 0.1 0.5 +O 0.05 0.15 0.55 +Mg 0.0 0.1 0.6 +O 0.05 0.15 0.65 +Mg 0.0 0.1 0.7 +O 0.05 0.15 0.75 +Mg 0.0 0.1 0.8 +O 0.05 0.15 0.85 +Mg 0.0 0.1 0.9 +O 0.05 0.15 0.95 +Mg 0.0 0.2 0.0 +O 0.05 0.25 0.05 +Mg 0.0 0.2 0.1 +O 0.05 0.25 0.15 +Mg 0.0 0.2 0.2 +O 0.05 0.25 0.25 +Mg 0.0 0.2 0.3 +O 0.05 0.25 0.35 +Mg 0.0 0.2 0.4 +O 0.05 0.25 0.45 +Mg 0.0 0.2 0.5 +O 0.05 0.25 0.55 +Mg 0.0 0.2 0.6 +O 0.05 0.25 0.65 +Mg 0.0 0.2 0.7 +O 0.05 0.25 0.75 +Mg 0.0 0.2 0.8 +O 0.05 0.25 0.85 +Mg 0.0 0.2 0.9 +O 0.05 0.25 0.95 +Mg 0.0 0.3 0.0 +O 0.05 0.35 0.05 +Mg 0.0 0.3 0.1 +O 0.05 0.35 0.15 +Mg 0.0 0.3 0.2 +O 0.05 0.35 0.25 +Mg 0.0 0.3 0.3 +O 0.05 0.35 0.35 +Mg 0.0 0.3 0.4 +O 0.05 0.35 0.45 +Mg 0.0 0.3 0.5 +O 0.05 0.35 0.55 +Mg 0.0 0.3 0.6 +O 0.05 0.35 0.65 +Mg 0.0 0.3 0.7 +O 0.05 0.35 0.75 +Mg 0.0 0.3 0.8 +O 0.05 0.35 0.85 +Mg 0.0 0.3 0.9 +O 0.05 0.35 0.95 +Mg 0.0 0.4 0.0 +O 0.05 0.45 0.05 +Mg 0.0 0.4 0.1 +O 0.05 0.45 0.15 +Mg 0.0 0.4 0.2 +O 0.05 0.45 0.25 +Mg 0.0 0.4 0.3 +O 0.05 0.45 0.35 +Mg 0.0 0.4 0.4 +O 0.05 0.45 0.45 +Mg 0.0 0.4 0.5 +O 0.05 0.45 0.55 +Mg 0.0 0.4 0.6 +O 0.05 0.45 0.65 +Mg 0.0 0.4 0.7 +O 0.05 0.45 0.75 +Mg 0.0 0.4 0.8 +O 0.05 0.45 0.85 +Mg 0.0 0.4 0.9 +O 0.05 0.45 0.95 +Mg 0.0 0.5 0.0 +O 0.05 0.55 0.05 +Mg 0.0 0.5 0.1 +O 0.05 0.55 0.15 +Mg 0.0 0.5 0.2 +O 0.05 0.55 0.25 +Mg 0.0 0.5 0.3 +O 0.05 0.55 0.35 +Mg 0.0 0.5 0.4 +O 0.05 0.55 0.45 +Mg 0.0 0.5 0.5 +O 0.05 0.55 0.55 +Mg 0.0 0.5 0.6 +O 0.05 0.55 0.65 +Mg 0.0 0.5 0.7 +O 0.05 0.55 0.75 +Mg 0.0 0.5 0.8 +O 0.05 0.55 0.85 +Mg 0.0 0.5 0.9 +O 0.05 0.55 0.95 +Mg 0.0 0.6 0.0 +O 0.05 0.65 0.05 +Mg 0.0 0.6 0.1 +O 0.05 0.65 0.15 +Mg 0.0 0.6 0.2 +O 0.05 0.65 0.25 +Mg 0.0 0.6 0.3 +O 0.05 0.65 0.35 +Mg 0.0 0.6 0.4 +O 0.05 0.65 0.45 +Mg 0.0 0.6 0.5 +O 0.05 0.65 0.55 +Mg 0.0 0.6 0.6 +O 0.05 0.65 0.65 +Mg 0.0 0.6 0.7 +O 0.05 0.65 0.75 +Mg 0.0 0.6 0.8 +O 0.05 0.65 0.85 +Mg 0.0 0.6 0.9 +O 0.05 0.65 0.95 +Mg 0.0 0.7 0.0 +O 0.05 0.75 0.05 +Mg 0.0 0.7 0.1 +O 0.05 0.75 0.15 +Mg 0.0 0.7 0.2 +O 0.05 0.75 0.25 +Mg 0.0 0.7 0.3 +O 0.05 0.75 0.35 +Mg 0.0 0.7 0.4 +O 0.05 0.75 0.45 +Mg 0.0 0.7 0.5 +O 0.05 0.75 0.55 +Mg 0.0 0.7 0.6 +O 0.05 0.75 0.65 +Mg 0.0 0.7 0.7 +O 0.05 0.75 0.75 +Mg 0.0 0.7 0.8 +O 0.05 0.75 0.85 +Mg 0.0 0.7 0.9 +O 0.05 0.75 0.95 +Mg 0.0 0.8 0.0 +O 0.05 0.85 0.05 +Mg 0.0 0.8 0.1 +O 0.05 0.85 0.15 +Mg 0.0 0.8 0.2 +O 0.05 0.85 0.25 +Mg 0.0 0.8 0.3 +O 0.05 0.85 0.35 +Mg 0.0 0.8 0.4 +O 0.05 0.85 0.45 +Mg 0.0 0.8 0.5 +O 0.05 0.85 0.55 +Mg 0.0 0.8 0.6 +O 0.05 0.85 0.65 +Mg 0.0 0.8 0.7 +O 0.05 0.85 0.75 +Mg 0.0 0.8 0.8 +O 0.05 0.85 0.85 +Mg 0.0 0.8 0.9 +O 0.05 0.85 0.95 +Mg 0.0 0.9 0.0 +O 0.05 0.95 0.05 +Mg 0.0 0.9 0.1 +O 0.05 0.95 0.15 +Mg 0.0 0.9 0.2 +O 0.05 0.95 0.25 +Mg 0.0 0.9 0.3 +O 0.05 0.95 0.35 +Mg 0.0 0.9 0.4 +O 0.05 0.95 0.45 +Mg 0.0 0.9 0.5 +O 0.05 0.95 0.55 +Mg 0.0 0.9 0.6 +O 0.05 0.95 0.65 +Mg 0.0 0.9 0.7 +O 0.05 0.95 0.75 +Mg 0.0 0.9 0.8 +O 0.05 0.95 0.85 +Mg 0.0 0.9 0.9 +O 0.05 0.95 0.95 +Mg 0.1 0.0 0.0 +O 0.15 0.05 0.05 +Mg 0.1 0.0 0.1 +O 0.15 0.05 0.15 +Mg 0.1 0.0 0.2 +O 0.15 0.05 0.25 +Mg 0.1 0.0 0.3 +O 0.15 0.05 0.35 +Mg 0.1 0.0 0.4 +O 0.15 0.05 0.45 +Mg 0.1 0.0 0.5 +O 0.15 0.05 0.55 +Mg 0.1 0.0 0.6 +O 0.15 0.05 0.65 +Mg 0.1 0.0 0.7 +O 0.15 0.05 0.75 +Mg 0.1 0.0 0.8 +O 0.15 0.05 0.85 +Mg 0.1 0.0 0.9 +O 0.15 0.05 0.95 +Mg 0.1 0.1 0.0 +O 0.15 0.15 0.05 +Mg 0.1 0.1 0.1 +O 0.15 0.15 0.15 +Mg 0.1 0.1 0.2 +O 0.15 0.15 0.25 +Mg 0.1 0.1 0.3 +O 0.15 0.15 0.35 +Mg 0.1 0.1 0.4 +O 0.15 0.15 0.45 +Mg 0.1 0.1 0.5 +O 0.15 0.15 0.55 +Mg 0.1 0.1 0.6 +O 0.15 0.15 0.65 +Mg 0.1 0.1 0.7 +O 0.15 0.15 0.75 +Mg 0.1 0.1 0.8 +O 0.15 0.15 0.85 +Mg 0.1 0.1 0.9 +O 0.15 0.15 0.95 +Mg 0.1 0.2 0.0 +O 0.15 0.25 0.05 +Mg 0.1 0.2 0.1 +O 0.15 0.25 0.15 +Mg 0.1 0.2 0.2 +O 0.15 0.25 0.25 +Mg 0.1 0.2 0.3 +O 0.15 0.25 0.35 +Mg 0.1 0.2 0.4 +O 0.15 0.25 0.45 +Mg 0.1 0.2 0.5 +O 0.15 0.25 0.55 +Mg 0.1 0.2 0.6 +O 0.15 0.25 0.65 +Mg 0.1 0.2 0.7 +O 0.15 0.25 0.75 +Mg 0.1 0.2 0.8 +O 0.15 0.25 0.85 +Mg 0.1 0.2 0.9 +O 0.15 0.25 0.95 +Mg 0.1 0.3 0.0 +O 0.15 0.35 0.05 +Mg 0.1 0.3 0.1 +O 0.15 0.35 0.15 +Mg 0.1 0.3 0.2 +O 0.15 0.35 0.25 +Mg 0.1 0.3 0.3 +O 0.15 0.35 0.35 +Mg 0.1 0.3 0.4 +O 0.15 0.35 0.45 +Mg 0.1 0.3 0.5 +O 0.15 0.35 0.55 +Mg 0.1 0.3 0.6 +O 0.15 0.35 0.65 +Mg 0.1 0.3 0.7 +O 0.15 0.35 0.75 +Mg 0.1 0.3 0.8 +O 0.15 0.35 0.85 +Mg 0.1 0.3 0.9 +O 0.15 0.35 0.95 +Mg 0.1 0.4 0.0 +O 0.15 0.45 0.05 +Mg 0.1 0.4 0.1 +O 0.15 0.45 0.15 +Mg 0.1 0.4 0.2 +O 0.15 0.45 0.25 +Mg 0.1 0.4 0.3 +O 0.15 0.45 0.35 +Mg 0.1 0.4 0.4 +O 0.15 0.45 0.45 +Mg 0.1 0.4 0.5 +O 0.15 0.45 0.55 +Mg 0.1 0.4 0.6 +O 0.15 0.45 0.65 +Mg 0.1 0.4 0.7 +O 0.15 0.45 0.75 +Mg 0.1 0.4 0.8 +O 0.15 0.45 0.85 +Mg 0.1 0.4 0.9 +O 0.15 0.45 0.95 +Mg 0.1 0.5 0.0 +O 0.15 0.55 0.05 +Mg 0.1 0.5 0.1 +O 0.15 0.55 0.15 +Mg 0.1 0.5 0.2 +O 0.15 0.55 0.25 +Mg 0.1 0.5 0.3 +O 0.15 0.55 0.35 +Mg 0.1 0.5 0.4 +O 0.15 0.55 0.45 +Mg 0.1 0.5 0.5 +O 0.15 0.55 0.55 +Mg 0.1 0.5 0.6 +O 0.15 0.55 0.65 +Mg 0.1 0.5 0.7 +O 0.15 0.55 0.75 +Mg 0.1 0.5 0.8 +O 0.15 0.55 0.85 +Mg 0.1 0.5 0.9 +O 0.15 0.55 0.95 +Mg 0.1 0.6 0.0 +O 0.15 0.65 0.05 +Mg 0.1 0.6 0.1 +O 0.15 0.65 0.15 +Mg 0.1 0.6 0.2 +O 0.15 0.65 0.25 +Mg 0.1 0.6 0.3 +O 0.15 0.65 0.35 +Mg 0.1 0.6 0.4 +O 0.15 0.65 0.45 +Mg 0.1 0.6 0.5 +O 0.15 0.65 0.55 +Mg 0.1 0.6 0.6 +O 0.15 0.65 0.65 +Mg 0.1 0.6 0.7 +O 0.15 0.65 0.75 +Mg 0.1 0.6 0.8 +O 0.15 0.65 0.85 +Mg 0.1 0.6 0.9 +O 0.15 0.65 0.95 +Mg 0.1 0.7 0.0 +O 0.15 0.75 0.05 +Mg 0.1 0.7 0.1 +O 0.15 0.75 0.15 +Mg 0.1 0.7 0.2 +O 0.15 0.75 0.25 +Mg 0.1 0.7 0.3 +O 0.15 0.75 0.35 +Mg 0.1 0.7 0.4 +O 0.15 0.75 0.45 +Mg 0.1 0.7 0.5 +O 0.15 0.75 0.55 +Mg 0.1 0.7 0.6 +O 0.15 0.75 0.65 +Mg 0.1 0.7 0.7 +O 0.15 0.75 0.75 +Mg 0.1 0.7 0.8 +O 0.15 0.75 0.85 +Mg 0.1 0.7 0.9 +O 0.15 0.75 0.95 +Mg 0.1 0.8 0.0 +O 0.15 0.85 0.05 +Mg 0.1 0.8 0.1 +O 0.15 0.85 0.15 +Mg 0.1 0.8 0.2 +O 0.15 0.85 0.25 +Mg 0.1 0.8 0.3 +O 0.15 0.85 0.35 +Mg 0.1 0.8 0.4 +O 0.15 0.85 0.45 +Mg 0.1 0.8 0.5 +O 0.15 0.85 0.55 +Mg 0.1 0.8 0.6 +O 0.15 0.85 0.65 +Mg 0.1 0.8 0.7 +O 0.15 0.85 0.75 +Mg 0.1 0.8 0.8 +O 0.15 0.85 0.85 +Mg 0.1 0.8 0.9 +O 0.15 0.85 0.95 +Mg 0.1 0.9 0.0 +O 0.15 0.95 0.05 +Mg 0.1 0.9 0.1 +O 0.15 0.95 0.15 +Mg 0.1 0.9 0.2 +O 0.15 0.95 0.25 +Mg 0.1 0.9 0.3 +O 0.15 0.95 0.35 +Mg 0.1 0.9 0.4 +O 0.15 0.95 0.45 +Mg 0.1 0.9 0.5 +O 0.15 0.95 0.55 +Mg 0.1 0.9 0.6 +O 0.15 0.95 0.65 +Mg 0.1 0.9 0.7 +O 0.15 0.95 0.75 +Mg 0.1 0.9 0.8 +O 0.15 0.95 0.85 +Mg 0.1 0.9 0.9 +O 0.15 0.95 0.95 +Mg 0.2 0.0 0.0 +O 0.25 0.05 0.05 +Mg 0.2 0.0 0.1 +O 0.25 0.05 0.15 +Mg 0.2 0.0 0.2 +O 0.25 0.05 0.25 +Mg 0.2 0.0 0.3 +O 0.25 0.05 0.35 +Mg 0.2 0.0 0.4 +O 0.25 0.05 0.45 +Mg 0.2 0.0 0.5 +O 0.25 0.05 0.55 +Mg 0.2 0.0 0.6 +O 0.25 0.05 0.65 +Mg 0.2 0.0 0.7 +O 0.25 0.05 0.75 +Mg 0.2 0.0 0.8 +O 0.25 0.05 0.85 +Mg 0.2 0.0 0.9 +O 0.25 0.05 0.95 +Mg 0.2 0.1 0.0 +O 0.25 0.15 0.05 +Mg 0.2 0.1 0.1 +O 0.25 0.15 0.15 +Mg 0.2 0.1 0.2 +O 0.25 0.15 0.25 +Mg 0.2 0.1 0.3 +O 0.25 0.15 0.35 +Mg 0.2 0.1 0.4 +O 0.25 0.15 0.45 +Mg 0.2 0.1 0.5 +O 0.25 0.15 0.55 +Mg 0.2 0.1 0.6 +O 0.25 0.15 0.65 +Mg 0.2 0.1 0.7 +O 0.25 0.15 0.75 +Mg 0.2 0.1 0.8 +O 0.25 0.15 0.85 +Mg 0.2 0.1 0.9 +O 0.25 0.15 0.95 +Mg 0.2 0.2 0.0 +O 0.25 0.25 0.05 +Mg 0.2 0.2 0.1 +O 0.25 0.25 0.15 +Mg 0.2 0.2 0.2 +O 0.25 0.25 0.25 +Mg 0.2 0.2 0.3 +O 0.25 0.25 0.35 +Mg 0.2 0.2 0.4 +O 0.25 0.25 0.45 +Mg 0.2 0.2 0.5 +O 0.25 0.25 0.55 +Mg 0.2 0.2 0.6 +O 0.25 0.25 0.65 +Mg 0.2 0.2 0.7 +O 0.25 0.25 0.75 +Mg 0.2 0.2 0.8 +O 0.25 0.25 0.85 +Mg 0.2 0.2 0.9 +O 0.25 0.25 0.95 +Mg 0.2 0.3 0.0 +O 0.25 0.35 0.05 +Mg 0.2 0.3 0.1 +O 0.25 0.35 0.15 +Mg 0.2 0.3 0.2 +O 0.25 0.35 0.25 +Mg 0.2 0.3 0.3 +O 0.25 0.35 0.35 +Mg 0.2 0.3 0.4 +O 0.25 0.35 0.45 +Mg 0.2 0.3 0.5 +O 0.25 0.35 0.55 +Mg 0.2 0.3 0.6 +O 0.25 0.35 0.65 +Mg 0.2 0.3 0.7 +O 0.25 0.35 0.75 +Mg 0.2 0.3 0.8 +O 0.25 0.35 0.85 +Mg 0.2 0.3 0.9 +O 0.25 0.35 0.95 +Mg 0.2 0.4 0.0 +O 0.25 0.45 0.05 +Mg 0.2 0.4 0.1 +O 0.25 0.45 0.15 +Mg 0.2 0.4 0.2 +O 0.25 0.45 0.25 +Mg 0.2 0.4 0.3 +O 0.25 0.45 0.35 +Mg 0.2 0.4 0.4 +O 0.25 0.45 0.45 +Mg 0.2 0.4 0.5 +O 0.25 0.45 0.55 +Mg 0.2 0.4 0.6 +O 0.25 0.45 0.65 +Mg 0.2 0.4 0.7 +O 0.25 0.45 0.75 +Mg 0.2 0.4 0.8 +O 0.25 0.45 0.85 +Mg 0.2 0.4 0.9 +O 0.25 0.45 0.95 +Mg 0.2 0.5 0.0 +O 0.25 0.55 0.05 +Mg 0.2 0.5 0.1 +O 0.25 0.55 0.15 +Mg 0.2 0.5 0.2 +O 0.25 0.55 0.25 +Mg 0.2 0.5 0.3 +O 0.25 0.55 0.35 +Mg 0.2 0.5 0.4 +O 0.25 0.55 0.45 +Mg 0.2 0.5 0.5 +O 0.25 0.55 0.55 +Mg 0.2 0.5 0.6 +O 0.25 0.55 0.65 +Mg 0.2 0.5 0.7 +O 0.25 0.55 0.75 +Mg 0.2 0.5 0.8 +O 0.25 0.55 0.85 +Mg 0.2 0.5 0.9 +O 0.25 0.55 0.95 +Mg 0.2 0.6 0.0 +O 0.25 0.65 0.05 +Mg 0.2 0.6 0.1 +O 0.25 0.65 0.15 +Mg 0.2 0.6 0.2 +O 0.25 0.65 0.25 +Mg 0.2 0.6 0.3 +O 0.25 0.65 0.35 +Mg 0.2 0.6 0.4 +O 0.25 0.65 0.45 +Mg 0.2 0.6 0.5 +O 0.25 0.65 0.55 +Mg 0.2 0.6 0.6 +O 0.25 0.65 0.65 +Mg 0.2 0.6 0.7 +O 0.25 0.65 0.75 +Mg 0.2 0.6 0.8 +O 0.25 0.65 0.85 +Mg 0.2 0.6 0.9 +O 0.25 0.65 0.95 +Mg 0.2 0.7 0.0 +O 0.25 0.75 0.05 +Mg 0.2 0.7 0.1 +O 0.25 0.75 0.15 +Mg 0.2 0.7 0.2 +O 0.25 0.75 0.25 +Mg 0.2 0.7 0.3 +O 0.25 0.75 0.35 +Mg 0.2 0.7 0.4 +O 0.25 0.75 0.45 +Mg 0.2 0.7 0.5 +O 0.25 0.75 0.55 +Mg 0.2 0.7 0.6 +O 0.25 0.75 0.65 +Mg 0.2 0.7 0.7 +O 0.25 0.75 0.75 +Mg 0.2 0.7 0.8 +O 0.25 0.75 0.85 +Mg 0.2 0.7 0.9 +O 0.25 0.75 0.95 +Mg 0.2 0.8 0.0 +O 0.25 0.85 0.05 +Mg 0.2 0.8 0.1 +O 0.25 0.85 0.15 +Mg 0.2 0.8 0.2 +O 0.25 0.85 0.25 +Mg 0.2 0.8 0.3 +O 0.25 0.85 0.35 +Mg 0.2 0.8 0.4 +O 0.25 0.85 0.45 +Mg 0.2 0.8 0.5 +O 0.25 0.85 0.55 +Mg 0.2 0.8 0.6 +O 0.25 0.85 0.65 +Mg 0.2 0.8 0.7 +O 0.25 0.85 0.75 +Mg 0.2 0.8 0.8 +O 0.25 0.85 0.85 +Mg 0.2 0.8 0.9 +O 0.25 0.85 0.95 +Mg 0.2 0.9 0.0 +O 0.25 0.95 0.05 +Mg 0.2 0.9 0.1 +O 0.25 0.95 0.15 +Mg 0.2 0.9 0.2 +O 0.25 0.95 0.25 +Mg 0.2 0.9 0.3 +O 0.25 0.95 0.35 +Mg 0.2 0.9 0.4 +O 0.25 0.95 0.45 +Mg 0.2 0.9 0.5 +O 0.25 0.95 0.55 +Mg 0.2 0.9 0.6 +O 0.25 0.95 0.65 +Mg 0.2 0.9 0.7 +O 0.25 0.95 0.75 +Mg 0.2 0.9 0.8 +O 0.25 0.95 0.85 +Mg 0.2 0.9 0.9 +O 0.25 0.95 0.95 +Mg 0.3 0.0 0.0 +O 0.35 0.05 0.05 +Mg 0.3 0.0 0.1 +O 0.35 0.05 0.15 +Mg 0.3 0.0 0.2 +O 0.35 0.05 0.25 +Mg 0.3 0.0 0.3 +O 0.35 0.05 0.35 +Mg 0.3 0.0 0.4 +O 0.35 0.05 0.45 +Mg 0.3 0.0 0.5 +O 0.35 0.05 0.55 +Mg 0.3 0.0 0.6 +O 0.35 0.05 0.65 +Mg 0.3 0.0 0.7 +O 0.35 0.05 0.75 +Mg 0.3 0.0 0.8 +O 0.35 0.05 0.85 +Mg 0.3 0.0 0.9 +O 0.35 0.05 0.95 +Mg 0.3 0.1 0.0 +O 0.35 0.15 0.05 +Mg 0.3 0.1 0.1 +O 0.35 0.15 0.15 +Mg 0.3 0.1 0.2 +O 0.35 0.15 0.25 +Mg 0.3 0.1 0.3 +O 0.35 0.15 0.35 +Mg 0.3 0.1 0.4 +O 0.35 0.15 0.45 +Mg 0.3 0.1 0.5 +O 0.35 0.15 0.55 +Mg 0.3 0.1 0.6 +O 0.35 0.15 0.65 +Mg 0.3 0.1 0.7 +O 0.35 0.15 0.75 +Mg 0.3 0.1 0.8 +O 0.35 0.15 0.85 +Mg 0.3 0.1 0.9 +O 0.35 0.15 0.95 +Mg 0.3 0.2 0.0 +O 0.35 0.25 0.05 +Mg 0.3 0.2 0.1 +O 0.35 0.25 0.15 +Mg 0.3 0.2 0.2 +O 0.35 0.25 0.25 +Mg 0.3 0.2 0.3 +O 0.35 0.25 0.35 +Mg 0.3 0.2 0.4 +O 0.35 0.25 0.45 +Mg 0.3 0.2 0.5 +O 0.35 0.25 0.55 +Mg 0.3 0.2 0.6 +O 0.35 0.25 0.65 +Mg 0.3 0.2 0.7 +O 0.35 0.25 0.75 +Mg 0.3 0.2 0.8 +O 0.35 0.25 0.85 +Mg 0.3 0.2 0.9 +O 0.35 0.25 0.95 +Mg 0.3 0.3 0.0 +O 0.35 0.35 0.05 +Mg 0.3 0.3 0.1 +O 0.35 0.35 0.15 +Mg 0.3 0.3 0.2 +O 0.35 0.35 0.25 +Mg 0.3 0.3 0.3 +O 0.35 0.35 0.35 +Mg 0.3 0.3 0.4 +O 0.35 0.35 0.45 +Mg 0.3 0.3 0.5 +O 0.35 0.35 0.55 +Mg 0.3 0.3 0.6 +O 0.35 0.35 0.65 +Mg 0.3 0.3 0.7 +O 0.35 0.35 0.75 +Mg 0.3 0.3 0.8 +O 0.35 0.35 0.85 +Mg 0.3 0.3 0.9 +O 0.35 0.35 0.95 +Mg 0.3 0.4 0.0 +O 0.35 0.45 0.05 +Mg 0.3 0.4 0.1 +O 0.35 0.45 0.15 +Mg 0.3 0.4 0.2 +O 0.35 0.45 0.25 +Mg 0.3 0.4 0.3 +O 0.35 0.45 0.35 +Mg 0.3 0.4 0.4 +O 0.35 0.45 0.45 +Mg 0.3 0.4 0.5 +O 0.35 0.45 0.55 +Mg 0.3 0.4 0.6 +O 0.35 0.45 0.65 +Mg 0.3 0.4 0.7 +O 0.35 0.45 0.75 +Mg 0.3 0.4 0.8 +O 0.35 0.45 0.85 +Mg 0.3 0.4 0.9 +O 0.35 0.45 0.95 +Mg 0.3 0.5 0.0 +O 0.35 0.55 0.05 +Mg 0.3 0.5 0.1 +O 0.35 0.55 0.15 +Mg 0.3 0.5 0.2 +O 0.35 0.55 0.25 +Mg 0.3 0.5 0.3 +O 0.35 0.55 0.35 +Mg 0.3 0.5 0.4 +O 0.35 0.55 0.45 +Mg 0.3 0.5 0.5 +O 0.35 0.55 0.55 +Mg 0.3 0.5 0.6 +O 0.35 0.55 0.65 +Mg 0.3 0.5 0.7 +O 0.35 0.55 0.75 +Mg 0.3 0.5 0.8 +O 0.35 0.55 0.85 +Mg 0.3 0.5 0.9 +O 0.35 0.55 0.95 +Mg 0.3 0.6 0.0 +O 0.35 0.65 0.05 +Mg 0.3 0.6 0.1 +O 0.35 0.65 0.15 +Mg 0.3 0.6 0.2 +O 0.35 0.65 0.25 +Mg 0.3 0.6 0.3 +O 0.35 0.65 0.35 +Mg 0.3 0.6 0.4 +O 0.35 0.65 0.45 +Mg 0.3 0.6 0.5 +O 0.35 0.65 0.55 +Mg 0.3 0.6 0.6 +O 0.35 0.65 0.65 +Mg 0.3 0.6 0.7 +O 0.35 0.65 0.75 +Mg 0.3 0.6 0.8 +O 0.35 0.65 0.85 +Mg 0.3 0.6 0.9 +O 0.35 0.65 0.95 +Mg 0.3 0.7 0.0 +O 0.35 0.75 0.05 +Mg 0.3 0.7 0.1 +O 0.35 0.75 0.15 +Mg 0.3 0.7 0.2 +O 0.35 0.75 0.25 +Mg 0.3 0.7 0.3 +O 0.35 0.75 0.35 +Mg 0.3 0.7 0.4 +O 0.35 0.75 0.45 +Mg 0.3 0.7 0.5 +O 0.35 0.75 0.55 +Mg 0.3 0.7 0.6 +O 0.35 0.75 0.65 +Mg 0.3 0.7 0.7 +O 0.35 0.75 0.75 +Mg 0.3 0.7 0.8 +O 0.35 0.75 0.85 +Mg 0.3 0.7 0.9 +O 0.35 0.75 0.95 +Mg 0.3 0.8 0.0 +O 0.35 0.85 0.05 +Mg 0.3 0.8 0.1 +O 0.35 0.85 0.15 +Mg 0.3 0.8 0.2 +O 0.35 0.85 0.25 +Mg 0.3 0.8 0.3 +O 0.35 0.85 0.35 +Mg 0.3 0.8 0.4 +O 0.35 0.85 0.45 +Mg 0.3 0.8 0.5 +O 0.35 0.85 0.55 +Mg 0.3 0.8 0.6 +O 0.35 0.85 0.65 +Mg 0.3 0.8 0.7 +O 0.35 0.85 0.75 +Mg 0.3 0.8 0.8 +O 0.35 0.85 0.85 +Mg 0.3 0.8 0.9 +O 0.35 0.85 0.95 +Mg 0.3 0.9 0.0 +O 0.35 0.95 0.05 +Mg 0.3 0.9 0.1 +O 0.35 0.95 0.15 +Mg 0.3 0.9 0.2 +O 0.35 0.95 0.25 +Mg 0.3 0.9 0.3 +O 0.35 0.95 0.35 +Mg 0.3 0.9 0.4 +O 0.35 0.95 0.45 +Mg 0.3 0.9 0.5 +O 0.35 0.95 0.55 +Mg 0.3 0.9 0.6 +O 0.35 0.95 0.65 +Mg 0.3 0.9 0.7 +O 0.35 0.95 0.75 +Mg 0.3 0.9 0.8 +O 0.35 0.95 0.85 +Mg 0.3 0.9 0.9 +O 0.35 0.95 0.95 +Mg 0.4 0.0 0.0 +O 0.45 0.05 0.05 +Mg 0.4 0.0 0.1 +O 0.45 0.05 0.15 +Mg 0.4 0.0 0.2 +O 0.45 0.05 0.25 +Mg 0.4 0.0 0.3 +O 0.45 0.05 0.35 +Mg 0.4 0.0 0.4 +O 0.45 0.05 0.45 +Mg 0.4 0.0 0.5 +O 0.45 0.05 0.55 +Mg 0.4 0.0 0.6 +O 0.45 0.05 0.65 +Mg 0.4 0.0 0.7 +O 0.45 0.05 0.75 +Mg 0.4 0.0 0.8 +O 0.45 0.05 0.85 +Mg 0.4 0.0 0.9 +O 0.45 0.05 0.95 +Mg 0.4 0.1 0.0 +O 0.45 0.15 0.05 +Mg 0.4 0.1 0.1 +O 0.45 0.15 0.15 +Mg 0.4 0.1 0.2 +O 0.45 0.15 0.25 +Mg 0.4 0.1 0.3 +O 0.45 0.15 0.35 +Mg 0.4 0.1 0.4 +O 0.45 0.15 0.45 +Mg 0.4 0.1 0.5 +O 0.45 0.15 0.55 +Mg 0.4 0.1 0.6 +O 0.45 0.15 0.65 +Mg 0.4 0.1 0.7 +O 0.45 0.15 0.75 +Mg 0.4 0.1 0.8 +O 0.45 0.15 0.85 +Mg 0.4 0.1 0.9 +O 0.45 0.15 0.95 +Mg 0.4 0.2 0.0 +O 0.45 0.25 0.05 +Mg 0.4 0.2 0.1 +O 0.45 0.25 0.15 +Mg 0.4 0.2 0.2 +O 0.45 0.25 0.25 +Mg 0.4 0.2 0.3 +O 0.45 0.25 0.35 +Mg 0.4 0.2 0.4 +O 0.45 0.25 0.45 +Mg 0.4 0.2 0.5 +O 0.45 0.25 0.55 +Mg 0.4 0.2 0.6 +O 0.45 0.25 0.65 +Mg 0.4 0.2 0.7 +O 0.45 0.25 0.75 +Mg 0.4 0.2 0.8 +O 0.45 0.25 0.85 +Mg 0.4 0.2 0.9 +O 0.45 0.25 0.95 +Mg 0.4 0.3 0.0 +O 0.45 0.35 0.05 +Mg 0.4 0.3 0.1 +O 0.45 0.35 0.15 +Mg 0.4 0.3 0.2 +O 0.45 0.35 0.25 +Mg 0.4 0.3 0.3 +O 0.45 0.35 0.35 +Mg 0.4 0.3 0.4 +O 0.45 0.35 0.45 +Mg 0.4 0.3 0.5 +O 0.45 0.35 0.55 +Mg 0.4 0.3 0.6 +O 0.45 0.35 0.65 +Mg 0.4 0.3 0.7 +O 0.45 0.35 0.75 +Mg 0.4 0.3 0.8 +O 0.45 0.35 0.85 +Mg 0.4 0.3 0.9 +O 0.45 0.35 0.95 +Mg 0.4 0.4 0.0 +O 0.45 0.45 0.05 +Mg 0.4 0.4 0.1 +O 0.45 0.45 0.15 +Mg 0.4 0.4 0.2 +O 0.45 0.45 0.25 +Mg 0.4 0.4 0.3 +O 0.45 0.45 0.35 +Mg 0.4 0.4 0.4 +O 0.45 0.45 0.45 +Mg 0.4 0.4 0.5 +O 0.45 0.45 0.55 +Mg 0.4 0.4 0.6 +O 0.45 0.45 0.65 +Mg 0.4 0.4 0.7 +O 0.45 0.45 0.75 +Mg 0.4 0.4 0.8 +O 0.45 0.45 0.85 +Mg 0.4 0.4 0.9 +O 0.45 0.45 0.95 +Mg 0.4 0.5 0.0 +O 0.45 0.55 0.05 +Mg 0.4 0.5 0.1 +O 0.45 0.55 0.15 +Mg 0.4 0.5 0.2 +O 0.45 0.55 0.25 +Mg 0.4 0.5 0.3 +O 0.45 0.55 0.35 +Mg 0.4 0.5 0.4 +O 0.45 0.55 0.45 +Mg 0.4 0.5 0.5 +O 0.45 0.55 0.55 +Mg 0.4 0.5 0.6 +O 0.45 0.55 0.65 +Mg 0.4 0.5 0.7 +O 0.45 0.55 0.75 +Mg 0.4 0.5 0.8 +O 0.45 0.55 0.85 +Mg 0.4 0.5 0.9 +O 0.45 0.55 0.95 +Mg 0.4 0.6 0.0 +O 0.45 0.65 0.05 +Mg 0.4 0.6 0.1 +O 0.45 0.65 0.15 +Mg 0.4 0.6 0.2 +O 0.45 0.65 0.25 +Mg 0.4 0.6 0.3 +O 0.45 0.65 0.35 +Mg 0.4 0.6 0.4 +O 0.45 0.65 0.45 +Mg 0.4 0.6 0.5 +O 0.45 0.65 0.55 +Mg 0.4 0.6 0.6 +O 0.45 0.65 0.65 +Mg 0.4 0.6 0.7 +O 0.45 0.65 0.75 +Mg 0.4 0.6 0.8 +O 0.45 0.65 0.85 +Mg 0.4 0.6 0.9 +O 0.45 0.65 0.95 +Mg 0.4 0.7 0.0 +O 0.45 0.75 0.05 +Mg 0.4 0.7 0.1 +O 0.45 0.75 0.15 +Mg 0.4 0.7 0.2 +O 0.45 0.75 0.25 +Mg 0.4 0.7 0.3 +O 0.45 0.75 0.35 +Mg 0.4 0.7 0.4 +O 0.45 0.75 0.45 +Mg 0.4 0.7 0.5 +O 0.45 0.75 0.55 +Mg 0.4 0.7 0.6 +O 0.45 0.75 0.65 +Mg 0.4 0.7 0.7 +O 0.45 0.75 0.75 +Mg 0.4 0.7 0.8 +O 0.45 0.75 0.85 +Mg 0.4 0.7 0.9 +O 0.45 0.75 0.95 +Mg 0.4 0.8 0.0 +O 0.45 0.85 0.05 +Mg 0.4 0.8 0.1 +O 0.45 0.85 0.15 +Mg 0.4 0.8 0.2 +O 0.45 0.85 0.25 +Mg 0.4 0.8 0.3 +O 0.45 0.85 0.35 +Mg 0.4 0.8 0.4 +O 0.45 0.85 0.45 +Mg 0.4 0.8 0.5 +O 0.45 0.85 0.55 +Mg 0.4 0.8 0.6 +O 0.45 0.85 0.65 +Mg 0.4 0.8 0.7 +O 0.45 0.85 0.75 +Mg 0.4 0.8 0.8 +O 0.45 0.85 0.85 +Mg 0.4 0.8 0.9 +O 0.45 0.85 0.95 +Mg 0.4 0.9 0.0 +O 0.45 0.95 0.05 +Mg 0.4 0.9 0.1 +O 0.45 0.95 0.15 +Mg 0.4 0.9 0.2 +O 0.45 0.95 0.25 +Mg 0.4 0.9 0.3 +O 0.45 0.95 0.35 +Mg 0.4 0.9 0.4 +O 0.45 0.95 0.45 +Mg 0.4 0.9 0.5 +O 0.45 0.95 0.55 +Mg 0.4 0.9 0.6 +O 0.45 0.95 0.65 +Mg 0.4 0.9 0.7 +O 0.45 0.95 0.75 +Mg 0.4 0.9 0.8 +O 0.45 0.95 0.85 +Mg 0.4 0.9 0.9 +O 0.45 0.95 0.95 +Mg 0.5 0.0 0.0 +O 0.55 0.05 0.05 +Mg 0.5 0.0 0.1 +O 0.55 0.05 0.15 +Mg 0.5 0.0 0.2 +O 0.55 0.05 0.25 +Mg 0.5 0.0 0.3 +O 0.55 0.05 0.35 +Mg 0.5 0.0 0.4 +O 0.55 0.05 0.45 +Mg 0.5 0.0 0.5 +O 0.55 0.05 0.55 +Mg 0.5 0.0 0.6 +O 0.55 0.05 0.65 +Mg 0.5 0.0 0.7 +O 0.55 0.05 0.75 +Mg 0.5 0.0 0.8 +O 0.55 0.05 0.85 +Mg 0.5 0.0 0.9 +O 0.55 0.05 0.95 +Mg 0.5 0.1 0.0 +O 0.55 0.15 0.05 +Mg 0.5 0.1 0.1 +O 0.55 0.15 0.15 +Mg 0.5 0.1 0.2 +O 0.55 0.15 0.25 +Mg 0.5 0.1 0.3 +O 0.55 0.15 0.35 +Mg 0.5 0.1 0.4 +O 0.55 0.15 0.45 +Mg 0.5 0.1 0.5 +O 0.55 0.15 0.55 +Mg 0.5 0.1 0.6 +O 0.55 0.15 0.65 +Mg 0.5 0.1 0.7 +O 0.55 0.15 0.75 +Mg 0.5 0.1 0.8 +O 0.55 0.15 0.85 +Mg 0.5 0.1 0.9 +O 0.55 0.15 0.95 +Mg 0.5 0.2 0.0 +O 0.55 0.25 0.05 +Mg 0.5 0.2 0.1 +O 0.55 0.25 0.15 +Mg 0.5 0.2 0.2 +O 0.55 0.25 0.25 +Mg 0.5 0.2 0.3 +O 0.55 0.25 0.35 +Mg 0.5 0.2 0.4 +O 0.55 0.25 0.45 +Mg 0.5 0.2 0.5 +O 0.55 0.25 0.55 +Mg 0.5 0.2 0.6 +O 0.55 0.25 0.65 +Mg 0.5 0.2 0.7 +O 0.55 0.25 0.75 +Mg 0.5 0.2 0.8 +O 0.55 0.25 0.85 +Mg 0.5 0.2 0.9 +O 0.55 0.25 0.95 +Mg 0.5 0.3 0.0 +O 0.55 0.35 0.05 +Mg 0.5 0.3 0.1 +O 0.55 0.35 0.15 +Mg 0.5 0.3 0.2 +O 0.55 0.35 0.25 +Mg 0.5 0.3 0.3 +O 0.55 0.35 0.35 +Mg 0.5 0.3 0.4 +O 0.55 0.35 0.45 +Mg 0.5 0.3 0.5 +O 0.55 0.35 0.55 +Mg 0.5 0.3 0.6 +O 0.55 0.35 0.65 +Mg 0.5 0.3 0.7 +O 0.55 0.35 0.75 +Mg 0.5 0.3 0.8 +O 0.55 0.35 0.85 +Mg 0.5 0.3 0.9 +O 0.55 0.35 0.95 +Mg 0.5 0.4 0.0 +O 0.55 0.45 0.05 +Mg 0.5 0.4 0.1 +O 0.55 0.45 0.15 +Mg 0.5 0.4 0.2 +O 0.55 0.45 0.25 +Mg 0.5 0.4 0.3 +O 0.55 0.45 0.35 +Mg 0.5 0.4 0.4 +O 0.55 0.45 0.45 +Mg 0.5 0.4 0.5 +O 0.55 0.45 0.55 +Mg 0.5 0.4 0.6 +O 0.55 0.45 0.65 +Mg 0.5 0.4 0.7 +O 0.55 0.45 0.75 +Mg 0.5 0.4 0.8 +O 0.55 0.45 0.85 +Mg 0.5 0.4 0.9 +O 0.55 0.45 0.95 +Mg 0.5 0.5 0.0 +O 0.55 0.55 0.05 +Mg 0.5 0.5 0.1 +O 0.55 0.55 0.15 +Mg 0.5 0.5 0.2 +O 0.55 0.55 0.25 +Mg 0.5 0.5 0.3 +O 0.55 0.55 0.35 +Mg 0.5 0.5 0.4 +O 0.55 0.55 0.45 +Mg 0.5 0.5 0.5 +O 0.55 0.55 0.55 +Mg 0.5 0.5 0.6 +O 0.55 0.55 0.65 +Mg 0.5 0.5 0.7 +O 0.55 0.55 0.75 +Mg 0.5 0.5 0.8 +O 0.55 0.55 0.85 +Mg 0.5 0.5 0.9 +O 0.55 0.55 0.95 +Mg 0.5 0.6 0.0 +O 0.55 0.65 0.05 +Mg 0.5 0.6 0.1 +O 0.55 0.65 0.15 +Mg 0.5 0.6 0.2 +O 0.55 0.65 0.25 +Mg 0.5 0.6 0.3 +O 0.55 0.65 0.35 +Mg 0.5 0.6 0.4 +O 0.55 0.65 0.45 +Mg 0.5 0.6 0.5 +O 0.55 0.65 0.55 +Mg 0.5 0.6 0.6 +O 0.55 0.65 0.65 +Mg 0.5 0.6 0.7 +O 0.55 0.65 0.75 +Mg 0.5 0.6 0.8 +O 0.55 0.65 0.85 +Mg 0.5 0.6 0.9 +O 0.55 0.65 0.95 +Mg 0.5 0.7 0.0 +O 0.55 0.75 0.05 +Mg 0.5 0.7 0.1 +O 0.55 0.75 0.15 +Mg 0.5 0.7 0.2 +O 0.55 0.75 0.25 +Mg 0.5 0.7 0.3 +O 0.55 0.75 0.35 +Mg 0.5 0.7 0.4 +O 0.55 0.75 0.45 +Mg 0.5 0.7 0.5 +O 0.55 0.75 0.55 +Mg 0.5 0.7 0.6 +O 0.55 0.75 0.65 +Mg 0.5 0.7 0.7 +O 0.55 0.75 0.75 +Mg 0.5 0.7 0.8 +O 0.55 0.75 0.85 +Mg 0.5 0.7 0.9 +O 0.55 0.75 0.95 +Mg 0.5 0.8 0.0 +O 0.55 0.85 0.05 +Mg 0.5 0.8 0.1 +O 0.55 0.85 0.15 +Mg 0.5 0.8 0.2 +O 0.55 0.85 0.25 +Mg 0.5 0.8 0.3 +O 0.55 0.85 0.35 +Mg 0.5 0.8 0.4 +O 0.55 0.85 0.45 +Mg 0.5 0.8 0.5 +O 0.55 0.85 0.55 +Mg 0.5 0.8 0.6 +O 0.55 0.85 0.65 +Mg 0.5 0.8 0.7 +O 0.55 0.85 0.75 +Mg 0.5 0.8 0.8 +O 0.55 0.85 0.85 +Mg 0.5 0.8 0.9 +O 0.55 0.85 0.95 +Mg 0.5 0.9 0.0 +O 0.55 0.95 0.05 +Mg 0.5 0.9 0.1 +O 0.55 0.95 0.15 +Mg 0.5 0.9 0.2 +O 0.55 0.95 0.25 +Mg 0.5 0.9 0.3 +O 0.55 0.95 0.35 +Mg 0.5 0.9 0.4 +O 0.55 0.95 0.45 +Mg 0.5 0.9 0.5 +O 0.55 0.95 0.55 +Mg 0.5 0.9 0.6 +O 0.55 0.95 0.65 +Mg 0.5 0.9 0.7 +O 0.55 0.95 0.75 +Mg 0.5 0.9 0.8 +O 0.55 0.95 0.85 +Mg 0.5 0.9 0.9 +O 0.55 0.95 0.95 +Mg 0.6 0.0 0.0 +O 0.65 0.05 0.05 +Mg 0.6 0.0 0.1 +O 0.65 0.05 0.15 +Mg 0.6 0.0 0.2 +O 0.65 0.05 0.25 +Mg 0.6 0.0 0.3 +O 0.65 0.05 0.35 +Mg 0.6 0.0 0.4 +O 0.65 0.05 0.45 +Mg 0.6 0.0 0.5 +O 0.65 0.05 0.55 +Mg 0.6 0.0 0.6 +O 0.65 0.05 0.65 +Mg 0.6 0.0 0.7 +O 0.65 0.05 0.75 +Mg 0.6 0.0 0.8 +O 0.65 0.05 0.85 +Mg 0.6 0.0 0.9 +O 0.65 0.05 0.95 +Mg 0.6 0.1 0.0 +O 0.65 0.15 0.05 +Mg 0.6 0.1 0.1 +O 0.65 0.15 0.15 +Mg 0.6 0.1 0.2 +O 0.65 0.15 0.25 +Mg 0.6 0.1 0.3 +O 0.65 0.15 0.35 +Mg 0.6 0.1 0.4 +O 0.65 0.15 0.45 +Mg 0.6 0.1 0.5 +O 0.65 0.15 0.55 +Mg 0.6 0.1 0.6 +O 0.65 0.15 0.65 +Mg 0.6 0.1 0.7 +O 0.65 0.15 0.75 +Mg 0.6 0.1 0.8 +O 0.65 0.15 0.85 +Mg 0.6 0.1 0.9 +O 0.65 0.15 0.95 +Mg 0.6 0.2 0.0 +O 0.65 0.25 0.05 +Mg 0.6 0.2 0.1 +O 0.65 0.25 0.15 +Mg 0.6 0.2 0.2 +O 0.65 0.25 0.25 +Mg 0.6 0.2 0.3 +O 0.65 0.25 0.35 +Mg 0.6 0.2 0.4 +O 0.65 0.25 0.45 +Mg 0.6 0.2 0.5 +O 0.65 0.25 0.55 +Mg 0.6 0.2 0.6 +O 0.65 0.25 0.65 +Mg 0.6 0.2 0.7 +O 0.65 0.25 0.75 +Mg 0.6 0.2 0.8 +O 0.65 0.25 0.85 +Mg 0.6 0.2 0.9 +O 0.65 0.25 0.95 +Mg 0.6 0.3 0.0 +O 0.65 0.35 0.05 +Mg 0.6 0.3 0.1 +O 0.65 0.35 0.15 +Mg 0.6 0.3 0.2 +O 0.65 0.35 0.25 +Mg 0.6 0.3 0.3 +O 0.65 0.35 0.35 +Mg 0.6 0.3 0.4 +O 0.65 0.35 0.45 +Mg 0.6 0.3 0.5 +O 0.65 0.35 0.55 +Mg 0.6 0.3 0.6 +O 0.65 0.35 0.65 +Mg 0.6 0.3 0.7 +O 0.65 0.35 0.75 +Mg 0.6 0.3 0.8 +O 0.65 0.35 0.85 +Mg 0.6 0.3 0.9 +O 0.65 0.35 0.95 +Mg 0.6 0.4 0.0 +O 0.65 0.45 0.05 +Mg 0.6 0.4 0.1 +O 0.65 0.45 0.15 +Mg 0.6 0.4 0.2 +O 0.65 0.45 0.25 +Mg 0.6 0.4 0.3 +O 0.65 0.45 0.35 +Mg 0.6 0.4 0.4 +O 0.65 0.45 0.45 +Mg 0.6 0.4 0.5 +O 0.65 0.45 0.55 +Mg 0.6 0.4 0.6 +O 0.65 0.45 0.65 +Mg 0.6 0.4 0.7 +O 0.65 0.45 0.75 +Mg 0.6 0.4 0.8 +O 0.65 0.45 0.85 +Mg 0.6 0.4 0.9 +O 0.65 0.45 0.95 +Mg 0.6 0.5 0.0 +O 0.65 0.55 0.05 +Mg 0.6 0.5 0.1 +O 0.65 0.55 0.15 +Mg 0.6 0.5 0.2 +O 0.65 0.55 0.25 +Mg 0.6 0.5 0.3 +O 0.65 0.55 0.35 +Mg 0.6 0.5 0.4 +O 0.65 0.55 0.45 +Mg 0.6 0.5 0.5 +O 0.65 0.55 0.55 +Mg 0.6 0.5 0.6 +O 0.65 0.55 0.65 +Mg 0.6 0.5 0.7 +O 0.65 0.55 0.75 +Mg 0.6 0.5 0.8 +O 0.65 0.55 0.85 +Mg 0.6 0.5 0.9 +O 0.65 0.55 0.95 +Mg 0.6 0.6 0.0 +O 0.65 0.65 0.05 +Mg 0.6 0.6 0.1 +O 0.65 0.65 0.15 +Mg 0.6 0.6 0.2 +O 0.65 0.65 0.25 +Mg 0.6 0.6 0.3 +O 0.65 0.65 0.35 +Mg 0.6 0.6 0.4 +O 0.65 0.65 0.45 +Mg 0.6 0.6 0.5 +O 0.65 0.65 0.55 +Mg 0.6 0.6 0.6 +O 0.65 0.65 0.65 +Mg 0.6 0.6 0.7 +O 0.65 0.65 0.75 +Mg 0.6 0.6 0.8 +O 0.65 0.65 0.85 +Mg 0.6 0.6 0.9 +O 0.65 0.65 0.95 +Mg 0.6 0.7 0.0 +O 0.65 0.75 0.05 +Mg 0.6 0.7 0.1 +O 0.65 0.75 0.15 +Mg 0.6 0.7 0.2 +O 0.65 0.75 0.25 +Mg 0.6 0.7 0.3 +O 0.65 0.75 0.35 +Mg 0.6 0.7 0.4 +O 0.65 0.75 0.45 +Mg 0.6 0.7 0.5 +O 0.65 0.75 0.55 +Mg 0.6 0.7 0.6 +O 0.65 0.75 0.65 +Mg 0.6 0.7 0.7 +O 0.65 0.75 0.75 +Mg 0.6 0.7 0.8 +O 0.65 0.75 0.85 +Mg 0.6 0.7 0.9 +O 0.65 0.75 0.95 +Mg 0.6 0.8 0.0 +O 0.65 0.85 0.05 +Mg 0.6 0.8 0.1 +O 0.65 0.85 0.15 +Mg 0.6 0.8 0.2 +O 0.65 0.85 0.25 +Mg 0.6 0.8 0.3 +O 0.65 0.85 0.35 +Mg 0.6 0.8 0.4 +O 0.65 0.85 0.45 +Mg 0.6 0.8 0.5 +O 0.65 0.85 0.55 +Mg 0.6 0.8 0.6 +O 0.65 0.85 0.65 +Mg 0.6 0.8 0.7 +O 0.65 0.85 0.75 +Mg 0.6 0.8 0.8 +O 0.65 0.85 0.85 +Mg 0.6 0.8 0.9 +O 0.65 0.85 0.95 +Mg 0.6 0.9 0.0 +O 0.65 0.95 0.05 +Mg 0.6 0.9 0.1 +O 0.65 0.95 0.15 +Mg 0.6 0.9 0.2 +O 0.65 0.95 0.25 +Mg 0.6 0.9 0.3 +O 0.65 0.95 0.35 +Mg 0.6 0.9 0.4 +O 0.65 0.95 0.45 +Mg 0.6 0.9 0.5 +O 0.65 0.95 0.55 +Mg 0.6 0.9 0.6 +O 0.65 0.95 0.65 +Mg 0.6 0.9 0.7 +O 0.65 0.95 0.75 +Mg 0.6 0.9 0.8 +O 0.65 0.95 0.85 +Mg 0.6 0.9 0.9 +O 0.65 0.95 0.95 +Mg 0.7 0.0 0.0 +O 0.75 0.05 0.05 +Mg 0.7 0.0 0.1 +O 0.75 0.05 0.15 +Mg 0.7 0.0 0.2 +O 0.75 0.05 0.25 +Mg 0.7 0.0 0.3 +O 0.75 0.05 0.35 +Mg 0.7 0.0 0.4 +O 0.75 0.05 0.45 +Mg 0.7 0.0 0.5 +O 0.75 0.05 0.55 +Mg 0.7 0.0 0.6 +O 0.75 0.05 0.65 +Mg 0.7 0.0 0.7 +O 0.75 0.05 0.75 +Mg 0.7 0.0 0.8 +O 0.75 0.05 0.85 +Mg 0.7 0.0 0.9 +O 0.75 0.05 0.95 +Mg 0.7 0.1 0.0 +O 0.75 0.15 0.05 +Mg 0.7 0.1 0.1 +O 0.75 0.15 0.15 +Mg 0.7 0.1 0.2 +O 0.75 0.15 0.25 +Mg 0.7 0.1 0.3 +O 0.75 0.15 0.35 +Mg 0.7 0.1 0.4 +O 0.75 0.15 0.45 +Mg 0.7 0.1 0.5 +O 0.75 0.15 0.55 +Mg 0.7 0.1 0.6 +O 0.75 0.15 0.65 +Mg 0.7 0.1 0.7 +O 0.75 0.15 0.75 +Mg 0.7 0.1 0.8 +O 0.75 0.15 0.85 +Mg 0.7 0.1 0.9 +O 0.75 0.15 0.95 +Mg 0.7 0.2 0.0 +O 0.75 0.25 0.05 +Mg 0.7 0.2 0.1 +O 0.75 0.25 0.15 +Mg 0.7 0.2 0.2 +O 0.75 0.25 0.25 +Mg 0.7 0.2 0.3 +O 0.75 0.25 0.35 +Mg 0.7 0.2 0.4 +O 0.75 0.25 0.45 +Mg 0.7 0.2 0.5 +O 0.75 0.25 0.55 +Mg 0.7 0.2 0.6 +O 0.75 0.25 0.65 +Mg 0.7 0.2 0.7 +O 0.75 0.25 0.75 +Mg 0.7 0.2 0.8 +O 0.75 0.25 0.85 +Mg 0.7 0.2 0.9 +O 0.75 0.25 0.95 +Mg 0.7 0.3 0.0 +O 0.75 0.35 0.05 +Mg 0.7 0.3 0.1 +O 0.75 0.35 0.15 +Mg 0.7 0.3 0.2 +O 0.75 0.35 0.25 +Mg 0.7 0.3 0.3 +O 0.75 0.35 0.35 +Mg 0.7 0.3 0.4 +O 0.75 0.35 0.45 +Mg 0.7 0.3 0.5 +O 0.75 0.35 0.55 +Mg 0.7 0.3 0.6 +O 0.75 0.35 0.65 +Mg 0.7 0.3 0.7 +O 0.75 0.35 0.75 +Mg 0.7 0.3 0.8 +O 0.75 0.35 0.85 +Mg 0.7 0.3 0.9 +O 0.75 0.35 0.95 +Mg 0.7 0.4 0.0 +O 0.75 0.45 0.05 +Mg 0.7 0.4 0.1 +O 0.75 0.45 0.15 +Mg 0.7 0.4 0.2 +O 0.75 0.45 0.25 +Mg 0.7 0.4 0.3 +O 0.75 0.45 0.35 +Mg 0.7 0.4 0.4 +O 0.75 0.45 0.45 +Mg 0.7 0.4 0.5 +O 0.75 0.45 0.55 +Mg 0.7 0.4 0.6 +O 0.75 0.45 0.65 +Mg 0.7 0.4 0.7 +O 0.75 0.45 0.75 +Mg 0.7 0.4 0.8 +O 0.75 0.45 0.85 +Mg 0.7 0.4 0.9 +O 0.75 0.45 0.95 +Mg 0.7 0.5 0.0 +O 0.75 0.55 0.05 +Mg 0.7 0.5 0.1 +O 0.75 0.55 0.15 +Mg 0.7 0.5 0.2 +O 0.75 0.55 0.25 +Mg 0.7 0.5 0.3 +O 0.75 0.55 0.35 +Mg 0.7 0.5 0.4 +O 0.75 0.55 0.45 +Mg 0.7 0.5 0.5 +O 0.75 0.55 0.55 +Mg 0.7 0.5 0.6 +O 0.75 0.55 0.65 +Mg 0.7 0.5 0.7 +O 0.75 0.55 0.75 +Mg 0.7 0.5 0.8 +O 0.75 0.55 0.85 +Mg 0.7 0.5 0.9 +O 0.75 0.55 0.95 +Mg 0.7 0.6 0.0 +O 0.75 0.65 0.05 +Mg 0.7 0.6 0.1 +O 0.75 0.65 0.15 +Mg 0.7 0.6 0.2 +O 0.75 0.65 0.25 +Mg 0.7 0.6 0.3 +O 0.75 0.65 0.35 +Mg 0.7 0.6 0.4 +O 0.75 0.65 0.45 +Mg 0.7 0.6 0.5 +O 0.75 0.65 0.55 +Mg 0.7 0.6 0.6 +O 0.75 0.65 0.65 +Mg 0.7 0.6 0.7 +O 0.75 0.65 0.75 +Mg 0.7 0.6 0.8 +O 0.75 0.65 0.85 +Mg 0.7 0.6 0.9 +O 0.75 0.65 0.95 +Mg 0.7 0.7 0.0 +O 0.75 0.75 0.05 +Mg 0.7 0.7 0.1 +O 0.75 0.75 0.15 +Mg 0.7 0.7 0.2 +O 0.75 0.75 0.25 +Mg 0.7 0.7 0.3 +O 0.75 0.75 0.35 +Mg 0.7 0.7 0.4 +O 0.75 0.75 0.45 +Mg 0.7 0.7 0.5 +O 0.75 0.75 0.55 +Mg 0.7 0.7 0.6 +O 0.75 0.75 0.65 +Mg 0.7 0.7 0.7 +O 0.75 0.75 0.75 +Mg 0.7 0.7 0.8 +O 0.75 0.75 0.85 +Mg 0.7 0.7 0.9 +O 0.75 0.75 0.95 +Mg 0.7 0.8 0.0 +O 0.75 0.85 0.05 +Mg 0.7 0.8 0.1 +O 0.75 0.85 0.15 +Mg 0.7 0.8 0.2 +O 0.75 0.85 0.25 +Mg 0.7 0.8 0.3 +O 0.75 0.85 0.35 +Mg 0.7 0.8 0.4 +O 0.75 0.85 0.45 +Mg 0.7 0.8 0.5 +O 0.75 0.85 0.55 +Mg 0.7 0.8 0.6 +O 0.75 0.85 0.65 +Mg 0.7 0.8 0.7 +O 0.75 0.85 0.75 +Mg 0.7 0.8 0.8 +O 0.75 0.85 0.85 +Mg 0.7 0.8 0.9 +O 0.75 0.85 0.95 +Mg 0.7 0.9 0.0 +O 0.75 0.95 0.05 +Mg 0.7 0.9 0.1 +O 0.75 0.95 0.15 +Mg 0.7 0.9 0.2 +O 0.75 0.95 0.25 +Mg 0.7 0.9 0.3 +O 0.75 0.95 0.35 +Mg 0.7 0.9 0.4 +O 0.75 0.95 0.45 +Mg 0.7 0.9 0.5 +O 0.75 0.95 0.55 +Mg 0.7 0.9 0.6 +O 0.75 0.95 0.65 +Mg 0.7 0.9 0.7 +O 0.75 0.95 0.75 +Mg 0.7 0.9 0.8 +O 0.75 0.95 0.85 +Mg 0.7 0.9 0.9 +O 0.75 0.95 0.95 +Mg 0.8 0.0 0.0 +O 0.85 0.05 0.05 +Mg 0.8 0.0 0.1 +O 0.85 0.05 0.15 +Mg 0.8 0.0 0.2 +O 0.85 0.05 0.25 +Mg 0.8 0.0 0.3 +O 0.85 0.05 0.35 +Mg 0.8 0.0 0.4 +O 0.85 0.05 0.45 +Mg 0.8 0.0 0.5 +O 0.85 0.05 0.55 +Mg 0.8 0.0 0.6 +O 0.85 0.05 0.65 +Mg 0.8 0.0 0.7 +O 0.85 0.05 0.75 +Mg 0.8 0.0 0.8 +O 0.85 0.05 0.85 +Mg 0.8 0.0 0.9 +O 0.85 0.05 0.95 +Mg 0.8 0.1 0.0 +O 0.85 0.15 0.05 +Mg 0.8 0.1 0.1 +O 0.85 0.15 0.15 +Mg 0.8 0.1 0.2 +O 0.85 0.15 0.25 +Mg 0.8 0.1 0.3 +O 0.85 0.15 0.35 +Mg 0.8 0.1 0.4 +O 0.85 0.15 0.45 +Mg 0.8 0.1 0.5 +O 0.85 0.15 0.55 +Mg 0.8 0.1 0.6 +O 0.85 0.15 0.65 +Mg 0.8 0.1 0.7 +O 0.85 0.15 0.75 +Mg 0.8 0.1 0.8 +O 0.85 0.15 0.85 +Mg 0.8 0.1 0.9 +O 0.85 0.15 0.95 +Mg 0.8 0.2 0.0 +O 0.85 0.25 0.05 +Mg 0.8 0.2 0.1 +O 0.85 0.25 0.15 +Mg 0.8 0.2 0.2 +O 0.85 0.25 0.25 +Mg 0.8 0.2 0.3 +O 0.85 0.25 0.35 +Mg 0.8 0.2 0.4 +O 0.85 0.25 0.45 +Mg 0.8 0.2 0.5 +O 0.85 0.25 0.55 +Mg 0.8 0.2 0.6 +O 0.85 0.25 0.65 +Mg 0.8 0.2 0.7 +O 0.85 0.25 0.75 +Mg 0.8 0.2 0.8 +O 0.85 0.25 0.85 +Mg 0.8 0.2 0.9 +O 0.85 0.25 0.95 +Mg 0.8 0.3 0.0 +O 0.85 0.35 0.05 +Mg 0.8 0.3 0.1 +O 0.85 0.35 0.15 +Mg 0.8 0.3 0.2 +O 0.85 0.35 0.25 +Mg 0.8 0.3 0.3 +O 0.85 0.35 0.35 +Mg 0.8 0.3 0.4 +O 0.85 0.35 0.45 +Mg 0.8 0.3 0.5 +O 0.85 0.35 0.55 +Mg 0.8 0.3 0.6 +O 0.85 0.35 0.65 +Mg 0.8 0.3 0.7 +O 0.85 0.35 0.75 +Mg 0.8 0.3 0.8 +O 0.85 0.35 0.85 +Mg 0.8 0.3 0.9 +O 0.85 0.35 0.95 +Mg 0.8 0.4 0.0 +O 0.85 0.45 0.05 +Mg 0.8 0.4 0.1 +O 0.85 0.45 0.15 +Mg 0.8 0.4 0.2 +O 0.85 0.45 0.25 +Mg 0.8 0.4 0.3 +O 0.85 0.45 0.35 +Mg 0.8 0.4 0.4 +O 0.85 0.45 0.45 +Mg 0.8 0.4 0.5 +O 0.85 0.45 0.55 +Mg 0.8 0.4 0.6 +O 0.85 0.45 0.65 +Mg 0.8 0.4 0.7 +O 0.85 0.45 0.75 +Mg 0.8 0.4 0.8 +O 0.85 0.45 0.85 +Mg 0.8 0.4 0.9 +O 0.85 0.45 0.95 +Mg 0.8 0.5 0.0 +O 0.85 0.55 0.05 +Mg 0.8 0.5 0.1 +O 0.85 0.55 0.15 +Mg 0.8 0.5 0.2 +O 0.85 0.55 0.25 +Mg 0.8 0.5 0.3 +O 0.85 0.55 0.35 +Mg 0.8 0.5 0.4 +O 0.85 0.55 0.45 +Mg 0.8 0.5 0.5 +O 0.85 0.55 0.55 +Mg 0.8 0.5 0.6 +O 0.85 0.55 0.65 +Mg 0.8 0.5 0.7 +O 0.85 0.55 0.75 +Mg 0.8 0.5 0.8 +O 0.85 0.55 0.85 +Mg 0.8 0.5 0.9 +O 0.85 0.55 0.95 +Mg 0.8 0.6 0.0 +O 0.85 0.65 0.05 +Mg 0.8 0.6 0.1 +O 0.85 0.65 0.15 +Mg 0.8 0.6 0.2 +O 0.85 0.65 0.25 +Mg 0.8 0.6 0.3 +O 0.85 0.65 0.35 +Mg 0.8 0.6 0.4 +O 0.85 0.65 0.45 +Mg 0.8 0.6 0.5 +O 0.85 0.65 0.55 +Mg 0.8 0.6 0.6 +O 0.85 0.65 0.65 +Mg 0.8 0.6 0.7 +O 0.85 0.65 0.75 +Mg 0.8 0.6 0.8 +O 0.85 0.65 0.85 +Mg 0.8 0.6 0.9 +O 0.85 0.65 0.95 +Mg 0.8 0.7 0.0 +O 0.85 0.75 0.05 +Mg 0.8 0.7 0.1 +O 0.85 0.75 0.15 +Mg 0.8 0.7 0.2 +O 0.85 0.75 0.25 +Mg 0.8 0.7 0.3 +O 0.85 0.75 0.35 +Mg 0.8 0.7 0.4 +O 0.85 0.75 0.45 +Mg 0.8 0.7 0.5 +O 0.85 0.75 0.55 +Mg 0.8 0.7 0.6 +O 0.85 0.75 0.65 +Mg 0.8 0.7 0.7 +O 0.85 0.75 0.75 +Mg 0.8 0.7 0.8 +O 0.85 0.75 0.85 +Mg 0.8 0.7 0.9 +O 0.85 0.75 0.95 +Mg 0.8 0.8 0.0 +O 0.85 0.85 0.05 +Mg 0.8 0.8 0.1 +O 0.85 0.85 0.15 +Mg 0.8 0.8 0.2 +O 0.85 0.85 0.25 +Mg 0.8 0.8 0.3 +O 0.85 0.85 0.35 +Mg 0.8 0.8 0.4 +O 0.85 0.85 0.45 +Mg 0.8 0.8 0.5 +O 0.85 0.85 0.55 +Mg 0.8 0.8 0.6 +O 0.85 0.85 0.65 +Mg 0.8 0.8 0.7 +O 0.85 0.85 0.75 +Mg 0.8 0.8 0.8 +O 0.85 0.85 0.85 +Mg 0.8 0.8 0.9 +O 0.85 0.85 0.95 +Mg 0.8 0.9 0.0 +O 0.85 0.95 0.05 +Mg 0.8 0.9 0.1 +O 0.85 0.95 0.15 +Mg 0.8 0.9 0.2 +O 0.85 0.95 0.25 +Mg 0.8 0.9 0.3 +O 0.85 0.95 0.35 +Mg 0.8 0.9 0.4 +O 0.85 0.95 0.45 +Mg 0.8 0.9 0.5 +O 0.85 0.95 0.55 +Mg 0.8 0.9 0.6 +O 0.85 0.95 0.65 +Mg 0.8 0.9 0.7 +O 0.85 0.95 0.75 +Mg 0.8 0.9 0.8 +O 0.85 0.95 0.85 +Mg 0.8 0.9 0.9 +O 0.85 0.95 0.95 +Mg 0.9 0.0 0.0 +O 0.95 0.05 0.05 +Mg 0.9 0.0 0.1 +O 0.95 0.05 0.15 +Mg 0.9 0.0 0.2 +O 0.95 0.05 0.25 +Mg 0.9 0.0 0.3 +O 0.95 0.05 0.35 +Mg 0.9 0.0 0.4 +O 0.95 0.05 0.45 +Mg 0.9 0.0 0.5 +O 0.95 0.05 0.55 +Mg 0.9 0.0 0.6 +O 0.95 0.05 0.65 +Mg 0.9 0.0 0.7 +O 0.95 0.05 0.75 +Mg 0.9 0.0 0.8 +O 0.95 0.05 0.85 +Mg 0.9 0.0 0.9 +O 0.95 0.05 0.95 +Mg 0.9 0.1 0.0 +O 0.95 0.15 0.05 +Mg 0.9 0.1 0.1 +O 0.95 0.15 0.15 +Mg 0.9 0.1 0.2 +O 0.95 0.15 0.25 +Mg 0.9 0.1 0.3 +O 0.95 0.15 0.35 +Mg 0.9 0.1 0.4 +O 0.95 0.15 0.45 +Mg 0.9 0.1 0.5 +O 0.95 0.15 0.55 +Mg 0.9 0.1 0.6 +O 0.95 0.15 0.65 +Mg 0.9 0.1 0.7 +O 0.95 0.15 0.75 +Mg 0.9 0.1 0.8 +O 0.95 0.15 0.85 +Mg 0.9 0.1 0.9 +O 0.95 0.15 0.95 +Mg 0.9 0.2 0.0 +O 0.95 0.25 0.05 +Mg 0.9 0.2 0.1 +O 0.95 0.25 0.15 +Mg 0.9 0.2 0.2 +O 0.95 0.25 0.25 +Mg 0.9 0.2 0.3 +O 0.95 0.25 0.35 +Mg 0.9 0.2 0.4 +O 0.95 0.25 0.45 +Mg 0.9 0.2 0.5 +O 0.95 0.25 0.55 +Mg 0.9 0.2 0.6 +O 0.95 0.25 0.65 +Mg 0.9 0.2 0.7 +O 0.95 0.25 0.75 +Mg 0.9 0.2 0.8 +O 0.95 0.25 0.85 +Mg 0.9 0.2 0.9 +O 0.95 0.25 0.95 +Mg 0.9 0.3 0.0 +O 0.95 0.35 0.05 +Mg 0.9 0.3 0.1 +O 0.95 0.35 0.15 +Mg 0.9 0.3 0.2 +O 0.95 0.35 0.25 +Mg 0.9 0.3 0.3 +O 0.95 0.35 0.35 +Mg 0.9 0.3 0.4 +O 0.95 0.35 0.45 +Mg 0.9 0.3 0.5 +O 0.95 0.35 0.55 +Mg 0.9 0.3 0.6 +O 0.95 0.35 0.65 +Mg 0.9 0.3 0.7 +O 0.95 0.35 0.75 +Mg 0.9 0.3 0.8 +O 0.95 0.35 0.85 +Mg 0.9 0.3 0.9 +O 0.95 0.35 0.95 +Mg 0.9 0.4 0.0 +O 0.95 0.45 0.05 +Mg 0.9 0.4 0.1 +O 0.95 0.45 0.15 +Mg 0.9 0.4 0.2 +O 0.95 0.45 0.25 +Mg 0.9 0.4 0.3 +O 0.95 0.45 0.35 +Mg 0.9 0.4 0.4 +O 0.95 0.45 0.45 +Mg 0.9 0.4 0.5 +O 0.95 0.45 0.55 +Mg 0.9 0.4 0.6 +O 0.95 0.45 0.65 +Mg 0.9 0.4 0.7 +O 0.95 0.45 0.75 +Mg 0.9 0.4 0.8 +O 0.95 0.45 0.85 +Mg 0.9 0.4 0.9 +O 0.95 0.45 0.95 +Mg 0.9 0.5 0.0 +O 0.95 0.55 0.05 +Mg 0.9 0.5 0.1 +O 0.95 0.55 0.15 +Mg 0.9 0.5 0.2 +O 0.95 0.55 0.25 +Mg 0.9 0.5 0.3 +O 0.95 0.55 0.35 +Mg 0.9 0.5 0.4 +O 0.95 0.55 0.45 +Mg 0.9 0.5 0.5 +O 0.95 0.55 0.55 +Mg 0.9 0.5 0.6 +O 0.95 0.55 0.65 +Mg 0.9 0.5 0.7 +O 0.95 0.55 0.75 +Mg 0.9 0.5 0.8 +O 0.95 0.55 0.85 +Mg 0.9 0.5 0.9 +O 0.95 0.55 0.95 +Mg 0.9 0.6 0.0 +O 0.95 0.65 0.05 +Mg 0.9 0.6 0.1 +O 0.95 0.65 0.15 +Mg 0.9 0.6 0.2 +O 0.95 0.65 0.25 +Mg 0.9 0.6 0.3 +O 0.95 0.65 0.35 +Mg 0.9 0.6 0.4 +O 0.95 0.65 0.45 +Mg 0.9 0.6 0.5 +O 0.95 0.65 0.55 +Mg 0.9 0.6 0.6 +O 0.95 0.65 0.65 +Mg 0.9 0.6 0.7 +O 0.95 0.65 0.75 +Mg 0.9 0.6 0.8 +O 0.95 0.65 0.85 +Mg 0.9 0.6 0.9 +O 0.95 0.65 0.95 +Mg 0.9 0.7 0.0 +O 0.95 0.75 0.05 +Mg 0.9 0.7 0.1 +O 0.95 0.75 0.15 +Mg 0.9 0.7 0.2 +O 0.95 0.75 0.25 +Mg 0.9 0.7 0.3 +O 0.95 0.75 0.35 +Mg 0.9 0.7 0.4 +O 0.95 0.75 0.45 +Mg 0.9 0.7 0.5 +O 0.95 0.75 0.55 +Mg 0.9 0.7 0.6 +O 0.95 0.75 0.65 +Mg 0.9 0.7 0.7 +O 0.95 0.75 0.75 +Mg 0.9 0.7 0.8 +O 0.95 0.75 0.85 +Mg 0.9 0.7 0.9 +O 0.95 0.75 0.95 +Mg 0.9 0.8 0.0 +O 0.95 0.85 0.05 +Mg 0.9 0.8 0.1 +O 0.95 0.85 0.15 +Mg 0.9 0.8 0.2 +O 0.95 0.85 0.25 +Mg 0.9 0.8 0.3 +O 0.95 0.85 0.35 +Mg 0.9 0.8 0.4 +O 0.95 0.85 0.45 +Mg 0.9 0.8 0.5 +O 0.95 0.85 0.55 +Mg 0.9 0.8 0.6 +O 0.95 0.85 0.65 +Mg 0.9 0.8 0.7 +O 0.95 0.85 0.75 +Mg 0.9 0.8 0.8 +O 0.95 0.85 0.85 +Mg 0.9 0.8 0.9 +O 0.95 0.85 0.95 +Mg 0.9 0.9 0.0 +O 0.95 0.95 0.05 +Mg 0.9 0.9 0.1 +O 0.95 0.95 0.15 +Mg 0.9 0.9 0.2 +O 0.95 0.95 0.25 +Mg 0.9 0.9 0.3 +O 0.95 0.95 0.35 +Mg 0.9 0.9 0.4 +O 0.95 0.95 0.45 +Mg 0.9 0.9 0.5 +O 0.95 0.95 0.55 +Mg 0.9 0.9 0.6 +O 0.95 0.95 0.65 +Mg 0.9 0.9 0.7 +O 0.95 0.95 0.75 +Mg 0.9 0.9 0.8 +O 0.95 0.95 0.85 +Mg 0.9 0.9 0.9 +O 0.95 0.95 0.95 +K_POINTS automatic +1 1 1 1 1 1 diff --git a/tests/apps/miniDFT/tests/espresso/benchmark/single-node.in b/tests/apps/miniDFT/tests/espresso/benchmark/single-node.in new file mode 100644 index 0000000000..4a9cbd33d6 --- /dev/null +++ b/tests/apps/miniDFT/tests/espresso/benchmark/single-node.in @@ -0,0 +1,203 @@ +&control +prefix = 'titania' +calculation = 'scf' +restart_mode = 'from_scratch' +wf_collect = .false. +disk_io = 'none' +tstress = .false. +tprnfor = .false. +outdir = './' +wfcdir = './' +pseudo_dir = './' +/ +&system +ibrav = 0 +celldm(1) = 8.7671 +nat = 162 +ntyp = 2 +nbnd = 648 +ecutwfc = 120 +/ +&electrons +startingwfc='atomic' +electron_maxstep = 1 +conv_thr = 1.0d-4 +mixing_mode = 'plain' +mixing_beta = 0.7 +mixing_ndim = 8 +diagonalization = 'david' +diago_david_ndim = 4 +diago_full_acc = .false. +/ +CELL_PARAMETERS +3.0 0.0 0.0 +0.0 3.0 0.0 +0.0 0.0 1.915764 +ATOMIC_SPECIES +Ti 47.867 Ti.pbe.UPF +O 15.9994 O.pbe.UPF +ATOMIC_POSITIONS crystal +Ti 0.0 0.0 0.0 +Ti 0.166666666667 0.166666666667 0.166666666667 +O 0.1016959 0.1016959 0.0 +O -0.1016959 -0.1016959 0.0 +O 0.268362566667 0.0649707666667 0.166666666667 +O 0.0649707666667 0.268362566667 0.166666666667 +Ti 0.0 0.0 0.333333333333 +Ti 0.166666666667 0.166666666667 0.5 +O 0.1016959 0.1016959 0.333333333333 +O -0.1016959 -0.1016959 0.333333333333 +O 0.268362566667 0.0649707666667 0.5 +O 0.0649707666667 0.268362566667 0.5 +Ti 0.0 0.0 0.666666666667 +Ti 0.166666666667 0.166666666667 0.833333333333 +O 0.1016959 0.1016959 0.666666666667 +O -0.1016959 -0.1016959 0.666666666667 +O 0.268362566667 0.0649707666667 0.833333333333 +O 0.0649707666667 0.268362566667 0.833333333333 +Ti 0.0 0.333333333333 0.0 +Ti 0.166666666667 0.5 0.166666666667 +O 0.1016959 0.435029233333 0.0 +O -0.1016959 0.231637433333 0.0 +O 0.268362566667 0.3983041 0.166666666667 +O 0.0649707666667 0.6016959 0.166666666667 +Ti 0.0 0.333333333333 0.333333333333 +Ti 0.166666666667 0.5 0.5 +O 0.1016959 0.435029233333 0.333333333333 +O -0.1016959 0.231637433333 0.333333333333 +O 0.268362566667 0.3983041 0.5 +O 0.0649707666667 0.6016959 0.5 +Ti 0.0 0.333333333333 0.666666666667 +Ti 0.166666666667 0.5 0.833333333333 +O 0.1016959 0.435029233333 0.666666666667 +O -0.1016959 0.231637433333 0.666666666667 +O 0.268362566667 0.3983041 0.833333333333 +O 0.0649707666667 0.6016959 0.833333333333 +Ti 0.0 0.666666666667 0.0 +Ti 0.166666666667 0.833333333333 0.166666666667 +O 0.1016959 0.768362566667 0.0 +O -0.1016959 0.564970766667 0.0 +O 0.268362566667 0.731637433333 0.166666666667 +O 0.0649707666667 0.935029233333 0.166666666667 +Ti 0.0 0.666666666667 0.333333333333 +Ti 0.166666666667 0.833333333333 0.5 +O 0.1016959 0.768362566667 0.333333333333 +O -0.1016959 0.564970766667 0.333333333333 +O 0.268362566667 0.731637433333 0.5 +O 0.0649707666667 0.935029233333 0.5 +Ti 0.0 0.666666666667 0.666666666667 +Ti 0.166666666667 0.833333333333 0.833333333333 +O 0.1016959 0.768362566667 0.666666666667 +O -0.1016959 0.564970766667 0.666666666667 +O 0.268362566667 0.731637433333 0.833333333333 +O 0.0649707666667 0.935029233333 0.833333333333 +Ti 0.333333333333 0.0 0.0 +Ti 0.5 0.166666666667 0.166666666667 +O 0.435029233333 0.1016959 0.0 +O 0.231637433333 -0.1016959 0.0 +O 0.6016959 0.0649707666667 0.166666666667 +O 0.3983041 0.268362566667 0.166666666667 +Ti 0.333333333333 0.0 0.333333333333 +Ti 0.5 0.166666666667 0.5 +O 0.435029233333 0.1016959 0.333333333333 +O 0.231637433333 -0.1016959 0.333333333333 +O 0.6016959 0.0649707666667 0.5 +O 0.3983041 0.268362566667 0.5 +Ti 0.333333333333 0.0 0.666666666667 +Ti 0.5 0.166666666667 0.833333333333 +O 0.435029233333 0.1016959 0.666666666667 +O 0.231637433333 -0.1016959 0.666666666667 +O 0.6016959 0.0649707666667 0.833333333333 +O 0.3983041 0.268362566667 0.833333333333 +Ti 0.333333333333 0.333333333333 0.0 +Ti 0.5 0.5 0.166666666667 +O 0.435029233333 0.435029233333 0.0 +O 0.231637433333 0.231637433333 0.0 +O 0.6016959 0.3983041 0.166666666667 +O 0.3983041 0.6016959 0.166666666667 +Ti 0.333333333333 0.333333333333 0.333333333333 +Ti 0.5 0.5 0.5 +O 0.435029233333 0.435029233333 0.333333333333 +O 0.231637433333 0.231637433333 0.333333333333 +O 0.6016959 0.3983041 0.5 +O 0.3983041 0.6016959 0.5 +Ti 0.333333333333 0.333333333333 0.666666666667 +Ti 0.5 0.5 0.833333333333 +O 0.435029233333 0.435029233333 0.666666666667 +O 0.231637433333 0.231637433333 0.666666666667 +O 0.6016959 0.3983041 0.833333333333 +O 0.3983041 0.6016959 0.833333333333 +Ti 0.333333333333 0.666666666667 0.0 +Ti 0.5 0.833333333333 0.166666666667 +O 0.435029233333 0.768362566667 0.0 +O 0.231637433333 0.564970766667 0.0 +O 0.6016959 0.731637433333 0.166666666667 +O 0.3983041 0.935029233333 0.166666666667 +Ti 0.333333333333 0.666666666667 0.333333333333 +Ti 0.5 0.833333333333 0.5 +O 0.435029233333 0.768362566667 0.333333333333 +O 0.231637433333 0.564970766667 0.333333333333 +O 0.6016959 0.731637433333 0.5 +O 0.3983041 0.935029233333 0.5 +Ti 0.333333333333 0.666666666667 0.666666666667 +Ti 0.5 0.833333333333 0.833333333333 +O 0.435029233333 0.768362566667 0.666666666667 +O 0.231637433333 0.564970766667 0.666666666667 +O 0.6016959 0.731637433333 0.833333333333 +O 0.3983041 0.935029233333 0.833333333333 +Ti 0.666666666667 0.0 0.0 +Ti 0.833333333333 0.166666666667 0.166666666667 +O 0.768362566667 0.1016959 0.0 +O 0.564970766667 -0.1016959 0.0 +O 0.935029233333 0.0649707666667 0.166666666667 +O 0.731637433333 0.268362566667 0.166666666667 +Ti 0.666666666667 0.0 0.333333333333 +Ti 0.833333333333 0.166666666667 0.5 +O 0.768362566667 0.1016959 0.333333333333 +O 0.564970766667 -0.1016959 0.333333333333 +O 0.935029233333 0.0649707666667 0.5 +O 0.731637433333 0.268362566667 0.5 +Ti 0.666666666667 0.0 0.666666666667 +Ti 0.833333333333 0.166666666667 0.833333333333 +O 0.768362566667 0.1016959 0.666666666667 +O 0.564970766667 -0.1016959 0.666666666667 +O 0.935029233333 0.0649707666667 0.833333333333 +O 0.731637433333 0.268362566667 0.833333333333 +Ti 0.666666666667 0.333333333333 0.0 +Ti 0.833333333333 0.5 0.166666666667 +O 0.768362566667 0.435029233333 0.0 +O 0.564970766667 0.231637433333 0.0 +O 0.935029233333 0.3983041 0.166666666667 +O 0.731637433333 0.6016959 0.166666666667 +Ti 0.666666666667 0.333333333333 0.333333333333 +Ti 0.833333333333 0.5 0.5 +O 0.768362566667 0.435029233333 0.333333333333 +O 0.564970766667 0.231637433333 0.333333333333 +O 0.935029233333 0.3983041 0.5 +O 0.731637433333 0.6016959 0.5 +Ti 0.666666666667 0.333333333333 0.666666666667 +Ti 0.833333333333 0.5 0.833333333333 +O 0.768362566667 0.435029233333 0.666666666667 +O 0.564970766667 0.231637433333 0.666666666667 +O 0.935029233333 0.3983041 0.833333333333 +O 0.731637433333 0.6016959 0.833333333333 +Ti 0.666666666667 0.666666666667 0.0 +Ti 0.833333333333 0.833333333333 0.166666666667 +O 0.768362566667 0.768362566667 0.0 +O 0.564970766667 0.564970766667 0.0 +O 0.935029233333 0.731637433333 0.166666666667 +O 0.731637433333 0.935029233333 0.166666666667 +Ti 0.666666666667 0.666666666667 0.333333333333 +Ti 0.833333333333 0.833333333333 0.5 +O 0.768362566667 0.768362566667 0.333333333333 +O 0.564970766667 0.564970766667 0.333333333333 +O 0.935029233333 0.731637433333 0.5 +O 0.731637433333 0.935029233333 0.5 +Ti 0.666666666667 0.666666666667 0.666666666667 +Ti 0.833333333333 0.833333333333 0.833333333333 +O 0.768362566667 0.768362566667 0.666666666667 +O 0.564970766667 0.564970766667 0.666666666667 +O 0.935029233333 0.731637433333 0.833333333333 +O 0.731637433333 0.935029233333 0.833333333333 +K_POINTS automatic +1 1 1 1 1 1 diff --git a/tests/apps/miniDFT/tests/espresso/benchmark/validate_minidft.py b/tests/apps/miniDFT/tests/espresso/benchmark/validate_minidft.py new file mode 100755 index 0000000000..de5cf7f9bb --- /dev/null +++ b/tests/apps/miniDFT/tests/espresso/benchmark/validate_minidft.py @@ -0,0 +1,128 @@ +#!/usr/bin/env python +#usage: validate_minidft.py filename + +import sys + +#parse options (just filenames) +fname = sys.argv[1] +f = open( fname, 'r' ) + +#determine which benchmark is being tested +measured = {} +for L in f: + + if( "number of atoms/cell" in L ): + measured['nat'] = int( L.split("=")[1] ) + continue + + if( "number of electrons" in L ): + measured['nel'] = float( L.split("=")[1] ) + continue + + if( "number of Kohn-Sham states" in L ): + measured['nks'] = int( L.split("=")[1] ) + continue + + if( "kinetic-energy cutoff" in L ): + measured['gcut'] = float( L.split("=")[1].split()[0] ) + continue + + if( "number of atomic types" in L ): + measured['nsp'] = int( L.split("=")[1] ) + continue + + if( "atomic species valence mass pseudopotential" in L ): + measured['sp'] = [] + for i in range( measured['nsp'] ): + L = f.next() + measured['sp'].append( L ) + #end for i + continue + + #Etot will be overwritten after each SCF cycle + if( "total energy" in L ): + if( "The total energy is the sum" in L ): continue + L = L[1:] #pop the leading "!" that appears when SCF converges + measured['Etot'] = float( L.split("=")[1].split()[0] ) + continue + + if( "Benchmark_Time" in L ): + Ntime_str = L.split()[4] + Ntime_h = 0.0 + if( 'h' in Ntime_str ): + Ntime_h, Ntime_str = Ntime_str.split('h') + Ntime_h = float(Ntime_h) + Ntime_m = 0.0 + if( 'm' in Ntime_str ): + Ntime_m, Ntime_str = Ntime_str.split('m') + Ntime_m = float(Ntime_m) + Ntime_s = 0.0 + if( 's' in Ntime_str ): + Ntime_s, Ntime_str = Ntime_str.split('s') + Ntime_s = float(Ntime_s) + measured['Ntime'] = ( ( Ntime_h ) * 60 + Ntime_m ) * 60 + Ntime_s + continue + +#end for L in f +f.close() + +#define reference cases +reference = {} + +reference['titania'] = { 'input': 'titania_3_120.in', + 'Etot': -9738.99021176, + 'nat' : 162, + 'nel' : 1296, + 'nks' : 648, + 'gcut': 120.0, + 'sp' : [' Ti 12.00 47.86700 Ti( 1.00)\n', + ' O 6.00 15.99940 O( 1.00)\n' ] + } + +reference['magnesia'] = { 'input': 'magnesia_10_130.in', + 'Etot': -33817.52389012, + 'nat' : 2000, + 'nel' : 8000, + 'nks' : 4000, + 'gcut': 130.0, + 'sp' : [' Mg 2.00 24.30500 Mg( 1.00)\n', + ' O 6.00 15.99900 O( 1.00)\n' ] + } + +#match job characteristics to benchmark +for refid in reference: + refdat = reference[refid] + + ref_eq_meas = True + for k in ['nat','nel','nks','gcut','sp']: + ref_eq_meas &= ( measured[k] == refdat[k] ) + + if( ref_eq_meas ): break +#end for refid + +if( ref_eq_meas ): + print "Identified benchmark:", refdat['input'] +else: + print "Error: could not find corresponding benchmark" + exit() + +#check accuracy ( computed, expected, difference, tolerance, pass/fail ) +dEtot = abs( refdat['Etot'] - measured['Etot'] ) +dEtol = 1.0e-6 +print "Reference Energy: %15.8f Ry" % refdat['Etot'] +print "Computed Energy: %15.8f Ry" % measured['Etot'] +print " Abs Err: %15.8f Ry" % dEtot +print " Tolerance: %15.8f Ry" % dEtol +if( dEtot < dEtol ): + print "PASS" +else: + print "FAIL" + +#print time +#QE does not print Benchmark_Time +#print "Benchmark_Time:", measured['Ntime'], "seconds" + + + + + diff --git a/tests/apps/miniDFT/tests/espresso/test/O.pbe.UPF b/tests/apps/miniDFT/tests/espresso/test/O.pbe.UPF new file mode 100644 index 0000000000..ebf8c52146 --- /dev/null +++ b/tests/apps/miniDFT/tests/espresso/test/O.pbe.UPF @@ -0,0 +1,1998 @@ + + + Generated using "atomic" code by A. Dal Corso (Quantum ESPRESSO distribution) + Author: AM + Generation date: 15Dec2010 + Pseudopotential type: NC + Element: O + Functional: PBE + + Suggested minimum cutoff for wavefunctions: 0. Ry + Suggested minimum cutoff for charge density: 0. Ry + The Pseudo was generated with a Scalar-Relativistic Calculation + L component and cutoff radius for Local Potential: 1 1.0500 + + Valence configuration: + nl pn l occ Rcut Rcut US E pseu + 2S 1 0 2.00 1.050 1.050 -1.761170 + 2P 2 1 4.00 0.897 0.897 -0.663759 + Generation configuration: + 2S 1 0 2.00 1.050 1.050 -1.761143 + 2P 2 1 4.00 1.050 1.050 -0.663747 + + Pseudization used: troullier-martins + + + + + + + + 1.139852456943145E-004 1.154190035836278E-004 1.168707959270728E-004 1.183408495701567E-004 + 1.198293942117525E-004 1.213366624399886E-004 1.228628897685923E-004 1.244083146736889E-004 + 1.259731786310638E-004 1.275577261538943E-004 1.291622048309546E-004 1.307868653653023E-004 + 1.324319616134513E-004 1.340977506250371E-004 1.357844926829822E-004 1.374924513441648E-004 + 1.392218934806004E-004 1.409730893211415E-004 1.427463124937009E-004 1.445418400680072E-004 + 1.463599525988968E-004 1.482009341701516E-004 1.500650724388876E-004 1.519526586805018E-004 + 1.538639878341851E-004 1.557993585490062E-004 1.577590732305768E-004 1.597434380883031E-004 + 1.617527631832310E-004 1.637873624764950E-004 1.658475538783739E-004 1.679336592979659E-004 + 1.700460046934867E-004 1.721849201232021E-004 1.743507397969998E-004 1.765438021286102E-004 + 1.787644497884843E-004 1.810130297573369E-004 1.832898933803629E-004 1.855953964221359E-004 + 1.879298991221965E-004 1.902937662513414E-004 1.926873671686188E-004 1.951110758790415E-004 + 1.975652710920271E-004 2.000503362805705E-004 2.025666597411633E-004 2.051146346544658E-004 + 2.076946591467417E-004 2.103071363520676E-004 2.129524744753217E-004 2.156310868559678E-004 + 2.183433920326400E-004 2.210898138085401E-004 2.238707813176587E-004 2.266867290918269E-004 + 2.295380971286134E-004 2.324253309600751E-004 2.353488817223722E-004 2.383092062262596E-004 + 2.413067670284637E-004 2.443420325039584E-004 2.474154769191496E-004 2.505275805059799E-004 + 2.536788295369668E-004 2.568697164011824E-004 2.601007396811912E-004 2.633724042309543E-004 + 2.666852212547135E-004 2.700397083868693E-004 2.734363897728606E-004 2.768757961510646E-004 + 2.803584649357254E-004 2.838849403009259E-004 2.874557732656170E-004 2.910715217797142E-004 + 2.947327508112791E-004 2.984400324347967E-004 3.021939459205629E-004 3.059950778251979E-004 + 3.098440220832948E-004 3.137413801002248E-004 3.176877608461073E-004 3.216837809509625E-004 + 3.257300648010623E-004 3.298272446364902E-004 3.339759606499313E-004 3.381768610867033E-004 + 3.424306023460460E-004 3.467378490836861E-004 3.510992743156891E-004 3.555155595236209E-004 + 3.599873947610304E-004 3.645154787612710E-004 3.691005190466808E-004 3.737432320391325E-004 + 3.784443431719769E-004 3.832045870033929E-004 3.880247073311636E-004 3.929054573088975E-004 + 3.978475995637084E-004 4.028519063153783E-004 4.079191594970185E-004 4.130501508772477E-004 + 4.182456821839090E-004 4.235065652293390E-004 4.288336220372168E-004 4.342276849710067E-004 + 4.396895968640161E-004 4.452202111510912E-004 4.508203920019663E-004 4.564910144562929E-004 + 4.622329645603665E-004 4.680471395055725E-004 4.739344477685760E-004 4.798958092532704E-004 + 4.859321554345163E-004 4.920444295036854E-004 4.982335865160363E-004 5.045005935399448E-004 + 5.108464298080083E-004 5.172720868700546E-004 5.237785687480724E-004 5.303668920930925E-004 + 5.370380863440425E-004 5.437931938885961E-004 5.506332702260508E-004 5.575593841322502E-004 + 5.645726178265832E-004 5.716740671410841E-004 5.788648416916557E-004 5.861460650514514E-004 + 5.935188749264347E-004 6.009844233331482E-004 6.085438767787204E-004 6.161984164431315E-004 + 6.239492383637771E-004 6.317975536223518E-004 6.397445885340814E-004 6.477915848393406E-004 + 6.559397998976731E-004 6.641905068842594E-004 6.725449949888526E-004 6.810045696172156E-004 + 6.895705525950964E-004 6.982442823747625E-004 7.070271142441385E-004 7.159204205385731E-004 + 7.249255908552677E-004 7.340440322704065E-004 7.432771695590118E-004 7.526264454175699E-004 + 7.620933206894547E-004 7.716792745931876E-004 7.813858049535702E-004 7.912144284357184E-004 + 8.011666807820479E-004 8.112441170522359E-004 8.214483118662016E-004 8.317808596501467E-004 + 8.422433748856834E-004 8.528374923621034E-004 8.635648674318165E-004 8.744271762690013E-004 + 8.854261161315157E-004 8.965634056260874E-004 9.078407849768614E-004 9.192600162973045E-004 + 9.308228838655423E-004 9.425311944031595E-004 9.543867773574952E-004 9.663914851875088E-004 + 9.785471936532217E-004 9.908558021088118E-004 1.003319233799395E-003 1.015939436161526E-003 + 1.028718381127504E-003 1.041658065433476E-003 1.054760510931441E-003 1.068027764905168E-003 + 1.081461900390079E-003 1.095065016497179E-003 1.108839238741032E-003 1.122786719371889E-003 + 1.136909637711978E-003 1.151210200496018E-003 1.165690642216041E-003 1.180353225470526E-003 + 1.195200241317938E-003 1.210234009634712E-003 1.225456879477728E-003 1.240871229451376E-003 + 1.256479468079198E-003 1.272284034180234E-003 1.288287397250094E-003 1.304492057846813E-003 + 1.320900547981582E-003 1.337515431514366E-003 1.354339304554519E-003 1.371374795866436E-003 + 1.388624567280288E-003 1.406091314107958E-003 1.423777765564172E-003 1.441686685192953E-003 + 1.459820871299432E-003 1.478183157387077E-003 1.496776412600453E-003 1.515603542173512E-003 + 1.534667487883554E-003 1.553971228510887E-003 1.573517780304250E-003 1.593310197452134E-003 + 1.613351572559984E-003 1.633645037133435E-003 1.654193762067618E-003 1.675000958142604E-003 + 1.696069876525117E-003 1.717403809276518E-003 1.739006089867202E-003 1.760880093697467E-003 + 1.783029238624907E-003 1.805456985498485E-003 1.828166838699278E-003 1.851162346688050E-003 + 1.874447102559715E-003 1.898024744604743E-003 1.921898956877679E-003 1.946073469772761E-003 + 1.970552060606811E-003 1.995338554209453E-003 2.020436823520734E-003 2.045850790196303E-003 + 2.071584425220157E-003 2.097641749525120E-003 2.124026834621135E-003 2.150743803231423E-003 + 2.177796829936689E-003 2.205190141827395E-003 2.232928019164254E-003 2.261014796047039E-003 + 2.289454861091772E-003 2.318252658116486E-003 2.347412686835551E-003 2.376939503562782E-003 + 2.406837721923366E-003 2.437112013574749E-003 2.467767108936598E-003 2.498807797929929E-003 + 2.530238930725549E-003 2.562065418501907E-003 2.594292234212468E-003 2.626924413362754E-003 + 2.659967054797147E-003 2.693425321495596E-003 2.727304441380347E-003 2.761609708132805E-003 + 2.796346482020700E-003 2.831520190735621E-003 2.867136330241116E-003 2.903200465631447E-003 + 2.939718232001138E-003 2.976695335325485E-003 3.014137553352109E-003 3.052050736503754E-003 + 3.090440808792425E-003 3.129313768745018E-003 3.168675690340618E-003 3.208532723959554E-003 + 3.248891097344418E-003 3.289757116573164E-003 3.331137167044436E-003 3.373037714475311E-003 + 3.415465305911571E-003 3.458426570750697E-003 3.501928221777728E-003 3.545977056214138E-003 + 3.590579956779929E-003 3.635743892769060E-003 3.681475921138411E-003 3.727783187610464E-003 + 3.774672927789813E-003 3.822152468293762E-003 3.870229227897112E-003 3.918910718691361E-003 + 3.968204547258494E-003 4.018118415859508E-003 4.068660123637929E-003 4.119837567838421E-003 + 4.171658745040760E-003 4.224131752409320E-003 4.277264788958254E-003 4.331066156832628E-003 + 4.385544262605630E-003 4.440707618592121E-003 4.496564844178708E-003 4.553124667170529E-003 + 4.610395925155002E-003 4.668387566882703E-003 4.727108653665635E-003 4.786568360793083E-003 + 4.846775978965251E-003 4.907740915744977E-003 4.969472697027665E-003 5.031980968529731E-003 + 5.095275497295778E-003 5.159366173224694E-003 5.224263010614990E-003 5.289976149729540E-003 + 5.356515858380023E-003 5.423892533531297E-003 5.492116702925928E-003 5.561199026729190E-003 + 5.631150299194728E-003 5.701981450351176E-003 5.773703547710015E-003 5.846327797994873E-003 + 5.919865548892616E-003 5.994328290826434E-003 6.069727658751247E-003 6.146075433971698E-003 + 6.223383545982993E-003 6.301664074334922E-003 6.380929250519302E-003 6.461191459881176E-003 + 6.542463243554048E-003 6.624757300419475E-003 6.708086489091267E-003 6.792463829924687E-003 + 6.877902507050907E-003 6.964415870437050E-003 7.052017437972169E-003 7.140720897579412E-003 + 7.230540109354811E-003 7.321489107732945E-003 7.413582103679840E-003 7.506833486913493E-003 + 7.601257828152247E-003 7.696869881391529E-003 7.793684586209182E-003 7.891717070099797E-003 + 7.990982650838446E-003 8.091496838874069E-003 8.193275339753045E-003 8.296334056573205E-003 + 8.400689092468720E-003 8.506356753126275E-003 8.613353549332823E-003 8.721696199555458E-003 + 8.831401632553703E-003 8.942486990024652E-003 9.054969629281432E-003 9.168867125965267E-003 + 9.284197276791738E-003 9.400978102331554E-003 9.519227849826291E-003 9.638964996039589E-003 + 9.760208250144146E-003 9.882976556645086E-003 1.000728909834007E-002 1.013316529931665E-002 + 1.026062482798735E-002 1.038968760016282E-002 1.052037378216380E-002 1.065270379397211E-002 + 1.078669831242131E-002 1.092237827442755E-002 1.105976488026091E-002 1.119887959685809E-002 + 1.133974416117657E-002 1.148238058359111E-002 1.162681115133294E-002 1.177305843197209E-002 + 1.192114527694371E-002 1.207109482511861E-002 1.222293050641876E-002 1.237667604547829E-002 + 1.253235546535047E-002 1.268999309126139E-002 1.284961355441080E-002 1.301124179582083E-002 + 1.317490307023304E-002 1.334062295005453E-002 1.350842732935366E-002 1.367834242790612E-002 + 1.385039479529175E-002 1.402461131504297E-002 1.420101920884547E-002 1.437964604079155E-002 + 1.456051972168713E-002 1.474366851341282E-002 1.492912103333995E-002 1.511690625880209E-002 + 1.530705353162274E-002 1.549959256270016E-002 1.569455343664966E-002 1.589196661650445E-002 + 1.609186294847553E-002 1.629427366677146E-002 1.649923039847878E-002 1.670676516850381E-002 + 1.691691040457659E-002 1.712969894231781E-002 1.734516403036941E-002 1.756333933558977E-002 + 1.778425894831421E-002 1.800795738768166E-002 1.823446960702843E-002 1.846383099934961E-002 + 1.869607740282939E-002 1.893124510644083E-002 1.916937085561606E-002 1.941049185798788E-002 + 1.965464578920346E-002 1.990187079881129E-002 2.015220551622211E-002 2.040568905674480E-002 + 2.066236102769832E-002 2.092226153460032E-002 2.118543118743377E-002 2.145191110699236E-002 + 2.172174293130564E-002 2.199496882214519E-002 2.227163147161231E-002 2.255177410880886E-002 + 2.283544050659185E-002 2.312267498841303E-002 2.341352243524463E-002 2.370802829259192E-002 + 2.400623857759428E-002 2.430819988621546E-002 2.461395940052426E-002 2.492356489606690E-002 + 2.523706474933193E-002 2.555450794530926E-002 2.587594408514410E-002 2.620142339388723E-002 + 2.653099672834289E-002 2.686471558501508E-002 2.720263210815413E-002 2.754479909790425E-002 + 2.789127001855373E-002 2.824209900688886E-002 2.859734088065281E-002 2.895705114711111E-002 + 2.932128601172473E-002 2.969010238693227E-002 3.006355790104277E-002 3.044171090724010E-002 + 3.082462049270083E-002 3.121234648782671E-002 3.160494947559331E-002 3.200249080101626E-002 + 3.240503258073645E-002 3.281263771272593E-002 3.322536988611585E-002 3.364329359114798E-002 + 3.406647412925158E-002 3.449497762324665E-002 3.492887102767593E-002 3.536822213926663E-002 + 3.581309960752376E-002 3.626357294545692E-002 3.671971254044162E-002 3.718158966521759E-002 + 3.764927648902529E-002 3.812284608888241E-002 3.860237246100249E-002 3.908793053235673E-002 + 3.957959617238167E-002 4.007744620483386E-002 4.058155841979372E-002 4.109201158582052E-002 + 4.160888546225996E-002 4.213226081170681E-002 4.266221941262424E-002 4.319884407212182E-002 + 4.374221863889443E-002 4.429242801632360E-002 4.484955817574397E-002 4.541369616987644E-002 + 4.598493014643029E-002 4.656334936187663E-002 4.714904419539463E-002 4.774210616299364E-002 + 4.834262793181269E-002 4.895070333459987E-002 4.956642738437412E-002 5.018989628927085E-002 + 5.082120746757492E-002 5.146045956294235E-002 5.210775245981355E-002 5.276318729902069E-002 + 5.342686649359085E-002 5.409889374474844E-002 5.477937405811870E-002 5.546841376013498E-002 + 5.616612051465271E-002 5.687260333977171E-002 5.758797262487076E-002 5.831234014785609E-002 + 5.904581909262684E-002 5.978852406676052E-002 6.054057111942033E-002 6.130207775948830E-002 + 6.207316297392623E-002 6.285394724636761E-002 6.364455257594366E-002 6.444510249634554E-002 + 6.525572209512705E-002 6.607653803324971E-002 6.690767856487378E-002 6.774927355739840E-002 + 6.860145451175333E-002 6.946435458294646E-002 7.033810860086952E-002 7.122285309136538E-002 + 7.211872629756085E-002 7.302586820146700E-002 7.394442054585193E-002 7.487452685638822E-002 + 7.581633246407918E-002 7.676998452796724E-002 7.773563205812754E-002 7.871342593895130E-002 + 7.970351895272172E-002 8.070606580348651E-002 8.172122314123093E-002 8.274914958635428E-002 + 8.379000575445496E-002 8.484395428142685E-002 8.591115984887153E-002 8.699178920983026E-002 + 8.808601121483921E-002 8.919399683831286E-002 9.031591920525908E-002 9.145195361833022E-002 + 9.260227758521475E-002 9.376707084637276E-002 9.494651540312112E-002 9.614079554607138E-002 + 9.735009788392561E-002 9.857461137263460E-002 9.981452734492216E-002 1.010700395401816E-001 + 1.023413441347478E-001 1.036286397725500E-001 1.049321275961509E-001 1.062520112781748E-001 + 1.075884970531323E-001 1.089417937496448E-001 1.103121128230744E-001 1.116996683885645E-001 + 1.131046772544950E-001 1.145273589563598E-001 1.159679357910692E-001 1.174266328516845E-001 + 1.189036780625893E-001 1.203993022151028E-001 1.219137390035416E-001 1.234472250617353E-001 + 1.250000000000000E-001 1.265723064425793E-001 1.281643900655537E-001 1.297764996352282E-001 + 1.314088870470031E-001 1.330618073647324E-001 1.347355188605790E-001 1.364302830553690E-001 + 1.381463647594560E-001 1.398840321140977E-001 1.416435566333533E-001 1.434252132465091E-001 + 1.452292803410354E-001 1.470560398060864E-001 1.489057770765449E-001 1.507787811776226E-001 + 1.526753447700213E-001 1.545957641956607E-001 1.565403395239831E-001 1.585093745988400E-001 + 1.605031770859677E-001 1.625220585210614E-001 1.645663343584527E-001 1.666363240204004E-001 + 1.687323509470005E-001 1.708547426467245E-001 1.730038307475940E-001 1.751799510489967E-001 + 1.773834435741573E-001 1.796146526232657E-001 1.818739268272752E-001 1.841616192023770E-001 + 1.864780872051588E-001 1.888236927884592E-001 1.911988024579225E-001 1.936037873292666E-001 + 1.960390231862711E-001 1.985048905394930E-001 2.010017746857230E-001 2.035300657681889E-001 + 2.060901588375160E-001 2.086824539134554E-001 2.113073560473865E-001 2.139652753856082E-001 + 2.166566272334245E-001 2.193818321200373E-001 2.221413158642548E-001 2.249355096410262E-001 + 2.277648500488137E-001 2.306297791778126E-001 2.335307446790278E-001 2.364681998342213E-001 + 2.394426036267371E-001 2.424544208132194E-001 2.455041219962311E-001 2.485921836977865E-001 + 2.517190884338096E-001 2.548853247895270E-001 2.580913874958110E-001 2.613377775064821E-001 + 2.646250020765843E-001 2.679535748416449E-001 2.713240158979304E-001 2.747368518837129E-001 + 2.781926160615587E-001 2.816918484016511E-001 2.852350956661630E-001 2.888229114946881E-001 + 2.924558564907490E-001 2.961344983093927E-001 2.998594117458873E-001 3.036311788255361E-001 + 3.074503888946188E-001 3.113176387124790E-001 3.152335325447687E-001 3.191986822578659E-001 + 3.232137074144809E-001 3.272792353704627E-001 3.313959013728260E-001 3.355643486590090E-001 + 3.397852285573806E-001 3.440592005890134E-001 3.483869325707314E-001 3.527691007194624E-001 + 3.572063897578957E-001 3.616994930214701E-001 3.662491125667131E-001 3.708559592809336E-001 + 3.755207529933040E-001 3.802442225873332E-001 3.850271061147539E-001 3.898701509108494E-001 + 3.947741137112211E-001 3.997397607700343E-001 4.047678679797454E-001 4.098592209923342E-001 + 4.150146153420689E-001 4.202348565698038E-001 4.255207603488522E-001 4.308731526124346E-001 + 4.362928696827302E-001 4.417807584015592E-001 4.473376762626975E-001 4.529644915458676E-001 + 4.586620834524058E-001 4.644313422426380E-001 4.702731693749893E-001 4.761884776468328E-001 + 4.821781913371216E-001 4.882432463508068E-001 4.943845903650722E-001 5.006031829774161E-001 + 5.068999958555845E-001 5.132760128894014E-001 5.197322303445013E-001 5.262696570179950E-001 + 5.328893143961028E-001 5.395922368137556E-001 5.463794716162196E-001 5.532520793227422E-001 + 5.602111337922581E-001 5.672577223911884E-001 5.743929461633362E-001 5.816179200019336E-001 + 5.889337728238431E-001 5.963416477459503E-001 6.038427022637854E-001 6.114381084323758E-001 + 6.191290530493891E-001 6.269167378405703E-001 6.348023796475102E-001 6.427872106177864E-001 + 6.508724783974813E-001 6.590594463261362E-001 6.673493936341475E-001 6.757436156426458E-001 + 6.842434239659007E-001 6.928501467162530E-001 7.015651287116443E-001 7.103897316857435E-001 + 7.193253345007163E-001 7.283733333626849E-001 7.375351420398772E-001 7.468121920835402E-001 + 7.562059330516188E-001 7.657178327352483E-001 7.753493773881089E-001 7.851020719586458E-001 + 7.949774403252287E-001 8.049770255342580E-001 8.151023900412641E-001 8.253551159550543E-001 + 8.357368052849090E-001 8.462490801909092E-001 8.568935832373978E-001 8.676719776496294E-001 + 8.785859475736626E-001 8.896371983394996E-001 9.008274567275582E-001 9.121584712384796E-001 + 9.236320123663313E-001 9.352498728752607E-001 9.470138680796061E-001 9.589258361275534E-001 + 9.709876382883472E-001 9.832011592431115E-001 9.955683073793475E-001 1.008091015089109E+000 + 1.020771239070956E+000 1.033610960635684E+000 1.046612186015908E+000 1.059776946679548E+000 + 1.073107299647237E+000 1.086605327813750E+000 1.100273140273452E+000 1.114112872649842E+000 + 1.128126687429266E+000 1.142316774298791E+000 1.156685350488361E+000 1.171234661117242E+000 + 1.185966979544816E+000 1.200884607725814E+000 1.215989876569986E+000 1.231285146306323E+000 + 1.246772806851841E+000 1.262455278185007E+000 1.278335010723876E+000 1.294414485708962E+000 + 1.310696215590946E+000 1.327182744423251E+000 1.343876648259544E+000 1.360780535556269E+000 + 1.377897047580201E+000 1.395228858821171E+000 1.412778677409949E+000 1.430549245541390E+000 + 1.448543339902925E+000 1.466763772108402E+000 1.485213389137424E+000 1.503895073780192E+000 + 1.522811745087934E+000 1.541966358829033E+000 1.561361907950852E+000 1.581001423047403E+000 + 1.600887972832880E+000 1.621024664621142E+000 1.641414644811254E+000 1.662061099379099E+000 + 1.682967254375214E+000 1.704136376428846E+000 1.725571773258387E+000 1.747276794188206E+000 + 1.769254830671976E+000 1.791509316822619E+000 1.814043729948866E+000 1.836861591098618E+000 + 1.859966465609106E+000 1.883361963663974E+000 1.907051740857397E+000 1.931039498765253E+000 + 1.955328985523521E+000 1.979923996413929E+000 2.004828374456959E+000 2.030046011012357E+000 + 2.055580846387133E+000 2.081436870451268E+000 2.107618123261131E+000 2.134128695690733E+000 + 2.160972730070958E+000 2.188154420836786E+000 2.215678015182705E+000 2.243547813726332E+000 + 2.271768171180383E+000 2.300343497033134E+000 2.329278256237377E+000 2.358576969908110E+000 + 2.388244216028959E+000 2.418284630167477E+000 2.448702906199502E+000 2.479503797042542E+000 + 2.510692115398458E+000 2.542272734505453E+000 2.574250588899504E+000 2.606630675185429E+000 + 2.639418052817578E+000 2.672617844890418E+000 2.706235238939009E+000 2.740275487749559E+000 + 2.774743910180208E+000 2.809645891992078E+000 2.844986886690841E+000 2.880772416378825E+000 + 2.917008072617840E+000 2.953699517302906E+000 2.990852483546894E+000 3.028472776576372E+000 + 3.066566274638672E+000 3.105138929920356E+000 3.144196769477300E+000 3.183745896176387E+000 + 3.223792489649133E+000 3.264342807257249E+000 3.305403185070350E+000 3.346980038856020E+000 + 3.389079865082238E+000 3.431709241932512E+000 3.474874830333711E+000 3.518583374996832E+000 + 3.562841705470915E+000 3.607656737210129E+000 3.653035472654368E+000 3.698985002323373E+000 + 3.745512505924628E+000 3.792625253475245E+000 3.840330606437867E+000 3.888636018870958E+000 + 3.937549038593496E+000 3.987077308364313E+000 4.037228567076340E+000 4.088010650965772E+000 + 4.139431494836539E+000 4.191499133300121E+000 4.244221702030944E+000 4.297607439037654E+000 + 4.351664685950256E+000 4.406401889323567E+000 4.461827601956989E+000 4.517950484230867E+000 + 4.574779305459755E+000 4.632322945262574E+000 4.690590394950125E+000 4.749590758929975E+000 + 4.809333256129017E+000 4.869827221434003E+000 4.931082107150069E+000 4.993107484477742E+000 + 5.055913045008429E+000 5.119508602238725E+000 5.183904093103852E+000 5.249109579530251E+000 + 5.315135250007848E+000 5.381991421181995E+000 5.449688539465439E+000 5.518237182670661E+000 + 5.587648061662607E+000 5.657932022032345E+000 5.729100045791689E+000 5.801163253089122E+000 + 5.874132903947419E+000 5.948020400022963E+000 6.022837286387352E+000 6.098595253331307E+000 + 6.175306138191273E+000 6.252981927199102E+000 6.331634757354833E+000 6.411276918323213E+000 + 6.491920854353936E+000 6.573579166226057E+000 6.656264613216962E+000 6.739990115095946E+000 + 6.824768754143030E+000 6.910613777193061E+000 6.997538597705519E+000 7.085556797860484E+000 + 7.174682130680780E+000 7.264928522180998E+000 7.356310073543432E+000 7.448841063321374E+000 + 7.542535949670257E+000 7.637409372606672E+000 7.733476156295986E+000 7.830751311368615E+000 + 7.929250037265418E+000 8.028987724612744E+000 8.129979957627127E+000 8.232242516550462E+000 + 8.335791380115651E+000 8.440642728043269E+000 8.546812943569778E+000 8.654318616007330E+000 + 8.763176543335982E+000 8.873403734828367E+000 8.985017413707384E+000 9.098035019837468E+000 + 9.212474212449481E+000 9.328352872900114E+000 9.445689107465835E+000 9.564501250171986E+000 + 9.684807865657621E+000 9.806627752076144E+000 9.929979944032667E+000 1.005488371555816E+001 + 1.018135858312102E+001 1.030942430867664E+001 1.043910090275516E+001 1.057040862758825E+001 + 1.070336800027508E+001 1.083799979598811E+001 1.097432505121937E+001 1.111236506706729E+001 + 1.125214141256523E+001 1.139367592805156E+001 1.153699072858224E+001 1.168210820738647E+001 + 1.182905103936552E+001 1.197784218463586E+001 1.212850489211668E+001 1.228106270316251E+001 + 1.243553945524174E+001 1.259195928566114E+001 1.275034663533746E+001 1.291072625261636E+001 + 1.307312319713928E+001 1.323756284375925E+001 1.340407088650557E+001 1.357267334259870E+001 + 1.374339655651545E+001 1.391626720410529E+001 1.409131229675867E+001 1.426855918562738E+001 + 1.444803556589846E+001 1.462976948112149E+001 1.481378932759042E+001 1.500012385878069E+001 + 1.518880218984187E+001 1.537985380214707E+001 1.557330854789943E+001 1.576919665479652E+001 + 1.596754873075363E+001 1.616839576868612E+001 1.637176915135232E+001 1.657770065625708E+001 + 1.678622246061694E+001 1.699736714638814E+001 1.721116770535734E+001 1.742765754429690E+001 + 1.764687049018463E+001 1.786884079548925E+001 1.809360314352264E+001 1.832119265385890E+001 + 1.855164488782207E+001 1.878499585404262E+001 1.902128201408370E+001 1.926054028813861E+001 + 1.950280806079939E+001 1.974812318689843E+001 1.999652399742333E+001 2.024804930550604E+001 + 2.050273841248775E+001 2.076063111405951E+001 2.102176770648068E+001 2.128618899287514E+001 + 2.155393628960679E+001 2.182505143273556E+001 2.209957678455406E+001 2.237755524020708E+001 + 2.265903023439392E+001 2.294404574815500E+001 2.323264631574429E+001 2.352487703158756E+001 + 2.382078355732875E+001 2.412041212896457E+001 2.442380956406887E+001 2.473102326910822E+001 + 2.504210124684898E+001 2.535709210385811E+001 2.567604505809792E+001 2.599900994661633E+001 + 2.632603723333434E+001 2.665717801693076E+001 2.699248403882676E+001 2.733200769127052E+001 + 2.767580202552340E+001 2.802392076014966E+001 2.837641828940976E+001 2.873334969175986E+001 + 2.909477073845779E+001 2.946073790227733E+001 2.983130836633248E+001 3.020654003301210E+001 + 3.058649153302755E+001 3.097122223457379E+001 3.136079225260557E+001 3.175526245823091E+001 + 3.215469448822187E+001 3.255915075464585E+001 3.296869445461741E+001 3.338338958017277E+001 + 3.380330092826912E+001 3.422849411090882E+001 3.465903556539175E+001 3.509499256469619E+001 + 3.553643322799012E+001 3.598342653127542E+001 3.643604231816502E+001 3.689435131079654E+001 + 3.735842512088257E+001 3.782833626089998E+001 3.830415815542057E+001 3.878596515258330E+001 + 3.927383253571178E+001 3.976783653507726E+001 4.026805433980957E+001 4.077456410995854E+001 + 4.128744498870611E+001 4.180677711473313E+001 4.233264163474094E+001 4.286512071613055E+001 + 4.340429755984189E+001 4.395025641335360E+001 4.450308258384739E+001 4.506286245153721E+001 + 4.562968348316611E+001 4.620363424567365E+001 4.678480442003402E+001 4.737328481526944E+001 + 4.796916738263903E+001 4.857254523000610E+001 4.918351263638706E+001 4.980216506668199E+001 + 5.042859918659189E+001 5.106291287772257E+001 5.170520525287860E+001 5.235557667155054E+001 + 5.301412875559557E+001 5.368096440511674E+001 5.435618781454108E+001 5.503990448889986E+001 + 5.573222126031470E+001 5.643324630468944E+001 5.714308915861362E+001 5.786186073647745E+001 + 5.858967334780213E+001 5.932664071478911E+001 6.007287799008867E+001 6.082850177479340E+001 + 6.159363013665710E+001 6.236838262854275E+001 6.315288030710369E+001 6.394724575169803E+001 + 6.475160308354275E+001 6.556607798510755E+001 6.639079771975264E+001 6.722589115161468E+001 + 6.807148876574118E+001 6.892772268847985E+001 6.979472670812325E+001 7.067263629581315E+001 + 7.156158862670898E+001 7.246172260142080E+001 7.337317886771361E+001 7.429609984248353E+001 + 7.523062973401028E+001 7.617691456449101E+001 7.713510219285546E+001 7.810534233787011E+001 + 7.908778660153176E+001 8.008258849275511E+001 8.108990345135987E+001 8.210988887235747E+001 + 8.314270413054523E+001 8.418851060540868E+001 8.524747170633694E+001 8.631975289815679E+001 + 8.740552172698573E+001 8.850494784641242E+001 8.961820304400499E+001 9.074546126815267E+001 + 9.188689865524674E+001 9.304269355720088E+001 9.421302656932016E+001 9.539808055851896E+001 + 9.659804069189374E+001 9.781309446565707E+001 9.904343173443276E+001 + + + 1.424815571178932E-006 1.442737544795347E-006 1.460884949088410E-006 1.479260619626959E-006 + 1.497867427646906E-006 1.516708280499858E-006 1.535786122107404E-006 1.555103933421111E-006 + 1.574664732888298E-006 1.594471576923679E-006 1.614527560386933E-006 1.634835817066279E-006 + 1.655399520168141E-006 1.676221882812964E-006 1.697306158537278E-006 1.718655641802060E-006 + 1.740273668507505E-006 1.762163616514269E-006 1.784328906171262E-006 1.806773000850090E-006 + 1.829499407486210E-006 1.852511677126895E-006 1.875813405486095E-006 1.899408233506273E-006 + 1.923299847927314E-006 1.947491981862577E-006 1.971988415382210E-006 1.996792976103788E-006 + 2.021909539790388E-006 2.047342030956188E-006 2.073094423479674E-006 2.099170741224573E-006 + 2.125575058668584E-006 2.152311501540027E-006 2.179384247462498E-006 2.206797526607627E-006 + 2.234555622356054E-006 2.262662871966712E-006 2.291123667254536E-006 2.319942455276699E-006 + 2.349123739027457E-006 2.378672078141768E-006 2.408592089607735E-006 2.438888448488019E-006 + 2.469565888650339E-006 2.500629203507132E-006 2.532083246764542E-006 2.563932933180822E-006 + 2.596183239334272E-006 2.628839204400846E-006 2.661905930941522E-006 2.695388585699598E-006 + 2.729292400407999E-006 2.763622672606751E-006 2.798384766470734E-006 2.833584113647836E-006 + 2.869226214107668E-006 2.905316637000939E-006 2.941861021529652E-006 2.978865077828245E-006 + 3.016334587855796E-006 3.054275406299480E-006 3.092693461489370E-006 3.131594756324749E-006 + 3.170985369212085E-006 3.210871455014780E-006 3.251259246014890E-006 3.292155052886929E-006 + 3.333565265683919E-006 3.375496354835867E-006 3.417954872160758E-006 3.460947451888308E-006 + 3.504480811696568E-006 3.548561753761574E-006 3.593197165820213E-006 3.638394022246428E-006 + 3.684159385140989E-006 3.730500405434959E-006 3.777424324007037E-006 3.824938472814974E-006 + 3.873050276041185E-006 3.921767251252811E-006 3.971097010576341E-006 4.021047261887031E-006 + 4.071625810013278E-006 4.122840557956128E-006 4.174699508124142E-006 4.227210763583792E-006 + 4.280382529325576E-006 4.334223113546076E-006 4.388740928946114E-006 4.443944494045262E-006 + 4.499842434512880E-006 4.556443484515887E-006 4.613756488083511E-006 4.671790400489157E-006 + 4.730554289649712E-006 4.790057337542412E-006 4.850308841639545E-006 4.911318216361220E-006 + 4.973094994546355E-006 5.035648828942229E-006 5.098989493712732E-006 5.163126885965597E-006 + 5.228071027298863E-006 5.293832065366737E-006 5.360420275465210E-006 5.427846062137584E-006 + 5.496119960800201E-006 5.565252639388640E-006 5.635254900024580E-006 5.706137680703662E-006 + 5.777912057004582E-006 5.850589243819657E-006 5.924180597107200E-006 5.998697615665881E-006 + 6.074151942931454E-006 6.150555368796068E-006 6.227919831450454E-006 6.306257419249310E-006 + 6.385580372600104E-006 6.465901085875683E-006 6.547232109350906E-006 6.629586151163657E-006 + 6.712976079300532E-006 6.797414923607452E-006 6.882915877825635E-006 6.969492301653128E-006 + 7.057157722832291E-006 7.145925839263552E-006 7.235810521145697E-006 7.326825813143143E-006 + 7.418985936580434E-006 7.512305291664353E-006 7.606798459734005E-006 7.702480205539145E-006 + 7.799365479547215E-006 7.897469420279397E-006 7.996807356676018E-006 8.097394810491758E-006 + 8.199247498720913E-006 8.302381336053244E-006 8.406812437360658E-006 8.512557120215196E-006 + 8.619631907438707E-006 8.728053529684530E-006 8.837838928051731E-006 8.949005256732165E-006 + 9.061569885690847E-006 9.175550403380082E-006 9.290964619487647E-006 9.407830567719623E-006 + 9.526166508618185E-006 9.645990932414846E-006 9.767322561919628E-006 9.890180355446481E-006 + 1.001458350977560E-005 1.014055146315295E-005 1.026810389832752E-005 1.039726074562683E-005 + 1.052804218607104E-005 1.066046865452629E-005 1.079456084289771E-005 1.093033970336252E-005 + 1.106782645164395E-005 1.120704257032609E-005 1.134800981221077E-005 1.149075020371631E-005 + 1.163528604831928E-005 1.178163993003950E-005 1.192983471696869E-005 1.207989356484386E-005 + 1.223183992066527E-005 1.238569752636015E-005 1.254149042249244E-005 1.269924295201908E-005 + 1.285897976409380E-005 1.302072581791845E-005 1.318450638664302E-005 1.335034706131460E-005 + 1.351827375487599E-005 1.368831270621473E-005 1.386049048426290E-005 1.403483399214862E-005 + 1.421137047139973E-005 1.439012750620022E-005 1.457113302770051E-005 1.475441531838158E-005 + 1.494000301647423E-005 1.512792512043390E-005 1.531821099347161E-005 1.551089036814221E-005 + 1.570599335098998E-005 1.590355042725292E-005 1.610359246562617E-005 1.630615072308516E-005 + 1.651125684976977E-005 1.671894289392958E-005 1.692924130693149E-005 1.714218494833045E-005 + 1.735780709100360E-005 1.757614142634948E-005 1.779722206955215E-005 1.802108356491191E-005 + 1.824776089124290E-005 1.847728946733847E-005 1.870970515750566E-005 1.894504427716891E-005 + 1.918334359854443E-005 1.942464035638608E-005 1.966897225380312E-005 1.991637746815167E-005 + 2.016689465699980E-005 2.042056296416794E-005 2.067742202584522E-005 2.093751197678255E-005 + 2.120087345656396E-005 2.146754761595648E-005 2.173757612334003E-005 2.201100117121834E-005 + 2.228786548281134E-005 2.256821231873106E-005 2.285208548374097E-005 2.313952933360063E-005 + 2.343058878199644E-005 2.372530930755929E-005 2.402373696097099E-005 2.432591837215952E-005 + 2.463190075758514E-005 2.494173192761816E-005 2.525546029400918E-005 2.557313487745379E-005 + 2.589480531525196E-005 2.622052186906400E-005 2.655033543276419E-005 2.688429754039279E-005 + 2.722246037420862E-005 2.756487677284244E-005 2.791160023955318E-005 2.826268495058799E-005 + 2.861818576364716E-005 2.897815822645607E-005 2.934265858544439E-005 2.971174379453478E-005 + 3.008547152404208E-005 3.046390016968437E-005 3.084708886170747E-005 3.123509747412411E-005 + 3.162798663406936E-005 3.202581773127384E-005 3.242865292765585E-005 3.283655516703442E-005 + 3.324958818496434E-005 3.366781651869496E-005 3.409130551725433E-005 3.452012135166007E-005 + 3.495433102525876E-005 3.539400238419527E-005 3.583920412801396E-005 3.629000582039309E-005 + 3.674647790001423E-005 3.720869169156856E-005 3.767671941690137E-005 3.815063420629693E-005 + 3.863051010990531E-005 3.911642210931274E-005 3.960844612925773E-005 4.010665904949443E-005 + 4.061113871680524E-005 4.112196395716455E-005 4.163921458805545E-005 4.216297143094138E-005 + 4.269331632389464E-005 4.323033213438372E-005 4.377410277222160E-005 4.432471320267672E-005 + 4.488224945974912E-005 4.544679865961325E-005 4.601844901423014E-005 4.659728984513080E-005 + 4.718341159737266E-005 4.777690585367203E-005 4.837786534871390E-005 4.898638398364202E-005 + 4.960255684073118E-005 5.022648019824386E-005 5.085825154547411E-005 5.149796959798026E-005 + 5.214573431300950E-005 5.280164690511650E-005 5.346580986197818E-005 5.413832696040785E-005 + 5.481930328257037E-005 5.550884523240151E-005 5.620706055223386E-005 5.691405833963162E-005 + 5.762994906443753E-005 5.835484458603378E-005 5.908885817082044E-005 5.983210450991353E-005 + 6.058469973706564E-005 6.134676144681221E-005 6.211840871284581E-005 6.289976210662165E-005 + 6.369094371619722E-005 6.449207716530867E-005 6.530328763268737E-005 6.612470187161925E-005 + 6.695644822975030E-005 6.779865666914121E-005 6.865145878657410E-005 6.951498783411488E-005 + 7.038937873993410E-005 7.127476812938969E-005 7.217129434637519E-005 7.307909747493592E-005 + 7.399831936115771E-005 7.492910363533043E-005 7.587159573439059E-005 7.682594292464622E-005 + 7.779229432478742E-005 7.877080092918653E-005 7.976161563149129E-005 8.076489324851471E-005 + 8.178079054442560E-005 8.280946625524344E-005 8.385108111364084E-005 8.490579787405859E-005 + 8.597378133813635E-005 8.705519838046312E-005 8.815021797465211E-005 8.925901121974264E-005 + 9.038175136693514E-005 9.151861384666182E-005 9.266977629599800E-005 9.383541858641867E-005 + 9.501572285190309E-005 9.621087351739412E-005 9.742105732761478E-005 9.864646337624746E-005 + 9.988728313548058E-005 1.011437104859259E-004 1.024159417469131E-004 1.037041757071651E-004 + 1.050086136558590E-004 1.063294594140784E-004 1.076669193666603E-004 1.090212024944432E-004 + 1.103925204069213E-004 1.117810873753082E-004 1.131871203660179E-004 1.146108390745658E-004 + 1.160524659598967E-004 1.175122262791444E-004 1.189903481228286E-004 1.204870624504949E-004 + 1.220026031268018E-004 1.235372069580636E-004 1.250911137292509E-004 1.266645662414582E-004 + 1.282578103498419E-004 1.298710950020353E-004 1.315046722770475E-004 1.331587974246514E-004 + 1.348337289052664E-004 1.365297284303444E-004 1.382470610032614E-004 1.399859949607261E-004 + 1.417468020147071E-004 1.435297572948889E-004 1.453351393916617E-004 1.471632303996511E-004 + 1.490143159617964E-004 1.508886853139826E-004 1.527866313302345E-004 1.547084505684786E-004 + 1.566544433168809E-004 1.586249136407673E-004 1.606201694301351E-004 1.626405224477604E-004 + 1.646862883779130E-004 1.667577868756816E-004 1.688553416169208E-004 1.709792803488265E-004 + 1.731299349411468E-004 1.753076414380371E-004 1.775127401105684E-004 1.797455755098944E-004 + 1.820064965210891E-004 1.842958564176603E-004 1.866140129167494E-004 1.889613282350261E-004 + 1.913381691452843E-004 1.937449070337520E-004 1.961819179581208E-004 1.986495827063056E-004 + 2.011482868559441E-004 2.036784208346433E-004 2.062403799809848E-004 2.088345646062977E-004 + 2.114613800572074E-004 2.141212367789726E-004 2.168145503796177E-004 2.195417416948721E-004 + 2.223032368539276E-004 2.250994673460207E-004 2.279308700878554E-004 2.307978874918701E-004 + 2.337009675353674E-004 2.366405638305104E-004 2.396171356952008E-004 2.426311482248485E-004 + 2.456830723650432E-004 2.487733849851412E-004 2.519025689527764E-004 2.550711132093100E-004 + 2.582795128462290E-004 2.615282691825040E-004 2.648178898429222E-004 2.681488888374045E-004 + 2.715217866413205E-004 2.749371102768149E-004 2.783953933951539E-004 2.818971763601107E-004 + 2.854430063323981E-004 2.890334373551629E-004 2.926690304405579E-004 2.963503536573990E-004 + 3.000779822199285E-004 3.038524985776933E-004 3.076744925065532E-004 3.115445612008362E-004 + 3.154633093666492E-004 3.194313493163658E-004 3.234493010643013E-004 3.275177924235903E-004 + 3.316374591042861E-004 3.358089448126885E-004 3.400329013519266E-004 3.443099887238031E-004 + 3.486408752319216E-004 3.530262375861108E-004 3.574667610081602E-004 3.619631393388889E-004 + 3.665160751465591E-004 3.711262798366534E-004 3.757944737630347E-004 3.805213863405012E-004 + 3.853077561587603E-004 3.901543310978340E-004 3.950618684449164E-004 4.000311350127033E-004 + 4.050629072592057E-004 4.101579714090741E-004 4.153171235764481E-004 4.205411698893498E-004 + 4.258309266156448E-004 4.311872202905832E-004 4.366108878459491E-004 4.421027767408329E-004 + 4.476637450940471E-004 4.532946618182115E-004 4.589964067555203E-004 4.647698708152199E-004 + 4.706159561128161E-004 4.765355761110301E-004 4.825296557625311E-004 4.885991316544592E-004 + 4.947449521547709E-004 5.009680775604233E-004 5.072694802474214E-004 5.136501448227566E-004 + 5.201110682782494E-004 5.266532601463351E-004 5.332777426578031E-004 5.399855509015227E-004 + 5.467777329861804E-004 5.536553502040450E-004 5.606194771967997E-004 5.676712021234555E-004 + 5.748116268303787E-004 5.820418670234579E-004 5.893630524424330E-004 5.967763270374205E-004 + 6.042828491476587E-004 6.118837916824984E-004 6.195803423046766E-004 6.273737036158857E-004 + 6.352650933446865E-004 6.432557445367794E-004 6.513469057476694E-004 6.595398412377587E-004 + 6.678358311698857E-004 6.762361718093556E-004 6.847421757264837E-004 6.933551720016873E-004 + 7.020765064331589E-004 7.109075417471465E-004 7.198496578108846E-004 7.289042518482011E-004 + 7.380727386578355E-004 7.473565508345065E-004 7.567571389927542E-004 7.662759719936037E-004 + 7.759145371740779E-004 7.856743405795952E-004 7.955569071992958E-004 8.055637812043192E-004 + 8.156965261890882E-004 8.259567254156214E-004 8.363459820609223E-004 8.468659194674800E-004 + 8.575181813969166E-004 8.683044322868308E-004 8.792263575108690E-004 8.902856636420673E-004 + 9.014840787195107E-004 9.128233525183375E-004 9.243052568231492E-004 9.359315857048528E-004 + 9.477041558009898E-004 9.596248065995906E-004 9.716954007265943E-004 9.839178242368911E-004 + 9.962939869090216E-004 1.008825822543581E-003 1.021515289265387E-003 1.034364369829428E-003 + 1.047375071930687E-003 1.060549428517836E-003 1.073889498110894E-003 1.087397365122878E-003 + 1.101075140185490E-003 1.114924960478911E-003 1.128948990065739E-003 1.143149420229128E-003 + 1.157528469815184E-003 1.172088385579660E-003 1.186831442539014E-003 1.201759944325892E-003 + 1.216876223549070E-003 1.232182642157933E-003 1.247681591811527E-003 1.263375494252270E-003 + 1.279266801684348E-003 1.295357997156876E-003 1.311651594951887E-003 1.328150140977185E-003 + 1.344856213164154E-003 1.361772421870560E-003 1.378901410288430E-003 1.396245854857056E-003 + 1.413808465681187E-003 1.431591986954497E-003 1.449599197388365E-003 1.467832910646056E-003 + 1.486295975782366E-003 1.504991277688785E-003 1.523921737544271E-003 1.543090313271691E-003 + 1.562500000000000E-003 1.582153830532242E-003 1.602054875819421E-003 1.622206245440352E-003 + 1.642611088087539E-003 1.663272592059155E-003 1.684193985757237E-003 1.705378538192113E-003 + 1.726829559493200E-003 1.748550401426221E-003 1.770544457916916E-003 1.792815165581363E-003 + 1.815366004262943E-003 1.838200497576080E-003 1.861322213456811E-003 1.884734764720282E-003 + 1.908441809625266E-003 1.932447052445758E-003 1.956754244049789E-003 1.981367182485501E-003 + 2.006289713574596E-003 2.031525731513268E-003 2.057079179480659E-003 2.082954050255006E-003 + 2.109154386837506E-003 2.135684283084057E-003 2.162547884344924E-003 2.189749388112459E-003 + 2.217293044676966E-003 2.245183157790821E-003 2.273424085340940E-003 2.302020240029712E-003 + 2.330976090064486E-003 2.360296159855740E-003 2.389985030724031E-003 2.420047341615833E-003 + 2.450487789828390E-003 2.481311131743663E-003 2.512522183571537E-003 2.544125822102361E-003 + 2.576126985468951E-003 2.608530673918192E-003 2.641341950592331E-003 2.674565942320102E-003 + 2.708207840417807E-003 2.742272901500467E-003 2.776766448303186E-003 2.811693870512827E-003 + 2.847060625610172E-003 2.882872239722658E-003 2.919134308487848E-003 2.955852497927766E-003 + 2.993032545334214E-003 3.030680260165243E-003 3.068801524952888E-003 3.107402296222331E-003 + 3.146488605422621E-003 3.186066559869087E-003 3.226142343697637E-003 3.266722218831027E-003 + 3.307812525957304E-003 3.349419685520562E-003 3.391550198724130E-003 3.434210648546411E-003 + 3.477407700769483E-003 3.521148105020638E-003 3.565438695827038E-003 3.610286393683601E-003 + 3.655698206134363E-003 3.701681228867409E-003 3.748242646823591E-003 3.795389735319201E-003 + 3.843129861182736E-003 3.891470483905988E-003 3.940419156809609E-003 3.989983528223323E-003 + 4.040171342681011E-003 4.090990442130784E-003 4.142448767160325E-003 4.194554358237613E-003 + 4.247315356967258E-003 4.300740007362668E-003 4.354836657134143E-003 4.409613758993280E-003 + 4.465079871973697E-003 4.521243662768377E-003 4.578113907083914E-003 4.635699491011670E-003 + 4.694009412416301E-003 4.753052782341665E-003 4.812838826434424E-003 4.873376886385618E-003 + 4.934676421390265E-003 4.996747009625429E-003 5.059598349746818E-003 5.123240262404178E-003 + 5.187682691775861E-003 5.252935707122548E-003 5.319009504360653E-003 5.385914407655433E-003 + 5.453660871034128E-003 5.522259480019490E-003 5.591720953283720E-003 5.662056144323345E-003 + 5.733276043155073E-003 5.805391778032975E-003 5.878414617187367E-003 5.952355970585410E-003 + 6.027227391714021E-003 6.103040579385086E-003 6.179807379563402E-003 6.257539787217702E-003 + 6.336249948194807E-003 6.415950161117518E-003 6.496652879306267E-003 6.578370712724938E-003 + 6.661116429951285E-003 6.744902960171945E-003 6.829743395202745E-003 6.915650991534278E-003 + 7.002639172403226E-003 7.090721529889855E-003 7.179911827041703E-003 7.270224000024170E-003 + 7.361672160298038E-003 7.454270596824380E-003 7.548033778297318E-003 7.642976355404698E-003 + 7.739113163117365E-003 7.836459223007129E-003 7.935029745593878E-003 8.034840132722331E-003 + 8.135905979968517E-003 8.238243079076703E-003 8.341867420426844E-003 8.446795195533074E-003 + 8.553042799573758E-003 8.660626833953163E-003 8.769564108895555E-003 8.879871646071794E-003 + 8.991566681258955E-003 9.104666667033563E-003 9.219189275498465E-003 9.335152401044253E-003 + 9.452574163145235E-003 9.571472909190604E-003 9.691867217351362E-003 9.813775899483073E-003 + 9.937218004065359E-003 1.006221281917823E-002 1.018877987551580E-002 1.031693894943818E-002 + 1.044671006606136E-002 1.057811350238637E-002 1.071116979046747E-002 1.084589972062037E-002 + 1.098232434467078E-002 1.112046497924375E-002 1.126034320909448E-002 1.140198089048100E-002 + 1.154540015457914E-002 1.169062341094076E-002 1.183767335099508E-002 1.198657295159442E-002 + 1.213734547860434E-002 1.229001449053889E-002 1.244460384224184E-002 1.260113768861387E-002 + 1.275964048838695E-002 1.292013700794605E-002 1.308265232519885E-002 1.324721183349435E-002 + 1.341384124559046E-002 1.358256659767188E-002 1.375341425341815E-002 1.392641090812303E-002 + 1.410158359286583E-002 1.427895967873489E-002 1.445856688110451E-002 1.464043326396552E-002 + 1.482458724431020E-002 1.501105759657267E-002 1.519987345712483E-002 1.539106432882903E-002 + 1.558466008564801E-002 1.578069097731259E-002 1.597918763404845E-002 1.618018107136203E-002 + 1.638370269488683E-002 1.658978430529064E-002 1.679845810324430E-002 1.700975669445336E-002 + 1.722371309475251E-002 1.744036073526463E-002 1.765973346762436E-002 1.788186556926738E-002 + 1.810679174878657E-002 1.833454715135502E-002 1.856516736421781E-002 1.879868842225241E-002 + 1.903514681359918E-002 1.927457948536292E-002 1.951702384938565E-002 1.976251778809254E-002 + 2.001109966041100E-002 2.026280830776427E-002 2.051768306014067E-002 2.077576374223873E-002 + 2.103709067969017E-002 2.130170470536057E-002 2.156964716572984E-002 2.184095992735258E-002 + 2.211568538339970E-002 2.239386646028273E-002 2.267554662436082E-002 2.296076988873272E-002 + 2.324958082011383E-002 2.354202454579968E-002 2.383814676071747E-002 2.413799373456567E-002 + 2.444161231904402E-002 2.474904995517412E-002 2.506035468071199E-002 2.537557513765447E-002 + 2.569476057983916E-002 2.601796088064085E-002 2.634522654076414E-002 2.667660869613416E-002 + 2.701215912588698E-002 2.735193026045983E-002 2.769597518978382E-002 2.804434767157915E-002 + 2.839710213975479E-002 2.875429371291418E-002 2.911597820296721E-002 2.948221212385138E-002 + 2.985305270036198E-002 3.022855787709347E-002 3.060878632749378E-002 3.099379746303177E-002 + 3.138365144248073E-002 3.177840918131817E-002 3.217813236124380E-002 3.258288343981787E-002 + 3.299272566021973E-002 3.340772306113023E-002 3.382794048673762E-002 3.425344359686949E-002 + 3.468429887725260E-002 3.512057364990098E-002 3.556233608363552E-002 3.600965520473531E-002 + 3.646260090772301E-002 3.692124396628633E-002 3.738565604433618E-002 3.785590970720466E-002 + 3.833207843298340E-002 3.881423662400445E-002 3.930245961846625E-002 3.979682370220484E-002 + 4.029740612061417E-002 4.080428509071562E-002 4.131753981337938E-002 4.183725048570025E-002 + 4.236349831352798E-002 4.289636552415640E-002 4.343593537917140E-002 4.398229218746040E-002 + 4.453552131838644E-002 4.509570921512662E-002 4.566294340817960E-002 4.623731252904216E-002 + 4.681890632405786E-002 4.740781566844057E-002 4.800413258047334E-002 4.860795023588697E-002 + 4.921936298241870E-002 4.983846635455391E-002 5.046535708845426E-002 5.110013313707215E-002 + 5.174289368545674E-002 5.239373916625151E-002 5.305277127538680E-002 5.372009298797067E-002 + 5.439580857437820E-002 5.508002361654460E-002 5.577284502446236E-002 5.647438105288584E-002 + 5.718474131824694E-002 5.790403681578218E-002 5.863237993687657E-002 5.936988448662470E-002 + 6.011666570161272E-002 6.087284026792503E-002 6.163852633937587E-002 6.241384355597177E-002 + 6.319891306260537E-002 6.399385752798407E-002 6.479880116379814E-002 6.561386974412814E-002 + 6.643919062509811E-002 6.727489276477494E-002 6.812110674331799E-002 6.897796478338326E-002 + 6.984560077078260E-002 7.072415027540432E-002 7.161375057239612E-002 7.251454066361403E-002 + 7.342666129934274E-002 7.435025500028704E-002 7.528546607984191E-002 7.623244066664135E-002 + 7.719132672739093E-002 7.816227408998877E-002 7.914543446693542E-002 8.014096147904017E-002 + 8.114901067942420E-002 8.216973957782571E-002 8.320330766521203E-002 8.424987643869933E-002 + 8.530960942678788E-002 8.638267221491326E-002 8.746923247131899E-002 8.856945997325605E-002 + 8.968352663350976E-002 9.081160652726249E-002 9.195387591929291E-002 9.311051329151718E-002 + 9.428169937087821E-002 9.546761715758340E-002 9.666845195369983E-002 9.788439139210769E-002 + 9.911562546581773E-002 1.003623465576593E-001 1.016247494703391E-001 1.029030314568808E-001 + 1.041973922514456E-001 1.055080341005409E-001 1.068351617946222E-001 1.081789827000916E-001 + 1.095397067916998E-001 1.109175466853546E-001 1.123127176713423E-001 1.137254377479684E-001 + 1.151559276556185E-001 1.166044109112514E-001 1.180711138433229E-001 1.195562656271498E-001 + 1.210600983207203E-001 1.225828469009518E-001 1.241247493004083E-001 1.256860464444771E-001 + 1.272669822890127E-001 1.288678038584580E-001 1.304887612844395E-001 1.321301078448531E-001 + 1.337921000034385E-001 1.354749974498514E-001 1.371790631402421E-001 1.389045633383411E-001 + 1.406517676570653E-001 1.424209491006445E-001 1.442123841072780E-001 1.460263525923308E-001 + 1.478631379920690E-001 1.497230273079483E-001 1.516063111514585E-001 1.535132837895314E-001 + 1.554442431905218E-001 1.573994910707643E-001 1.593793329417183E-001 1.613840781577045E-001 + 1.634140399642410E-001 1.654695355469907E-001 1.675508860813196E-001 1.696584167824838E-001 + 1.717924569564432E-001 1.739533400513162E-001 1.761414037094833E-001 1.783569898203423E-001 + 1.806004445737307E-001 1.828721185140186E-001 1.851723665948802E-001 1.875015482347587E-001 + 1.898600273730234E-001 1.922481725268383E-001 1.946663568487429E-001 1.971149581849565E-001 + 1.995943591344204E-001 2.021049471085765E-001 2.046471143919041E-001 2.072212582032135E-001 + 2.098277807577118E-001 2.124670893298518E-001 2.151395963169668E-001 2.178457193037112E-001 + 2.205858811273078E-001 2.233605099436157E-001 2.261700392940330E-001 2.290149081732362E-001 + 2.318955610977760E-001 2.348124481755328E-001 2.377660251760463E-001 2.407567536017327E-001 + 2.437851007599924E-001 2.468515398362304E-001 2.499565499677917E-001 2.531006163188256E-001 + 2.562842301560969E-001 2.595078889257439E-001 2.627720963310085E-001 2.660773624109393E-001 + 2.694242036200849E-001 2.728131429091945E-001 2.762447098069257E-001 2.797194405025886E-001 + 2.832378779299240E-001 2.868005718519375E-001 2.904080789468036E-001 2.940609628948445E-001 + 2.977597944666094E-001 3.015051516120572E-001 3.052976195508609E-001 3.091377908638527E-001 + 3.130262655856123E-001 3.169636512982264E-001 3.209505632262240E-001 3.249876243327041E-001 + 3.290754654166793E-001 3.332147252116345E-001 3.374060504853346E-001 3.416500961408815E-001 + 3.459475253190425E-001 3.502990095018708E-001 3.547052286176220E-001 3.591668711469982E-001 + 3.636846342307223E-001 3.682592237784666E-001 3.728913545791561E-001 3.775817504126512E-001 + 3.823311441628444E-001 3.871402779321724E-001 3.920099031575697E-001 3.969407807278864E-001 + 4.019336811027734E-001 4.069893844330731E-001 4.121086806827176E-001 4.172923697521596E-001 + 4.225412616033641E-001 4.278561763863603E-001 4.332379445673968E-001 4.386874070587024E-001 + 4.442054153498765E-001 4.497928316409427E-001 4.554505289770628E-001 4.611793913849567E-001 + 4.669803140110322E-001 4.728542032612498E-001 4.788019769427572E-001 4.848245644072913E-001 + 4.909229066963972E-001 4.970979566884657E-001 5.033506792476196E-001 5.096820513744817E-001 + 5.160930623588265E-001 5.225847139341642E-001 5.291580204342619E-001 5.358140089516319E-001 + 5.425537194980236E-001 5.493782051669200E-001 5.562885322980924E-001 5.632857806442152E-001 + 5.703710435395765E-001 5.775454280709207E-001 5.848100552504253E-001 5.921660601908680E-001 + 5.996145922829879E-001 6.071568153750763E-001 6.147939079548382E-001 6.225270633335249E-001 + 6.303574898323987E-001 6.382864109715322E-001 6.463150656609825E-001 6.544447083943817E-001 + 6.626766094449447E-001 6.710120550639593E-001 6.794523476817635E-001 6.879988061112483E-001 + 6.966527657539338E-001 7.054155788086180E-001 7.142886144826703E-001 7.232732592059681E-001 + 7.323709168475266E-001 7.415830089348640E-001 7.509109748761085E-001 7.603562721849175E-001 + 7.699203767082138E-001 7.796047828567845E-001 7.894110038387961E-001 7.993405718962254E-001 + 8.093950385442844E-001 8.195759748138445E-001 8.298849714969081E-001 8.403236393951835E-001 + 8.508936095717647E-001 8.615965336059981E-001 8.724340838515406E-001 8.834079536976644E-001 + 8.945198578338623E-001 9.057715325177601E-001 9.171647358464201E-001 9.287012480310441E-001 + 9.403828716751286E-001 9.522114320561377E-001 9.641887774106932E-001 9.763167792233765E-001 + 9.885973325191471E-001 1.001032356159439E+000 1.013623793141998E+000 1.026373610904469E+000 + 1.039283801631815E+000 1.052356382567609E+000 1.065593396329212E+000 1.078996911226960E+000 + 1.092569021587322E+000 1.106311848080155E+000 1.120227538050062E+000 1.134318265851908E+000 + 1.148586233190584E+000 1.163033669465011E+000 1.177662832116502E+000 1.192476006981487E+000 + 1.207475508648672E+000 1.222663680820713E+000 1.238042896680410E+000 + + + +-3.959624422322239E+001 -3.959625385320293E+001 -3.959626365265639E+001 -3.959627363427202E+001 +-3.959628381049185E+001 -3.959629419351949E+001 -3.959630479532859E+001 -3.959631563552769E+001 +-3.959632679662119E+001 -3.959633824025218E+001 -3.959634895829286E+001 -3.959636096043304E+001 +-3.959637326635907E+001 -3.959638588377608E+001 -3.959639882055205E+001 -3.959641208478321E+001 +-3.959642482061974E+001 -3.959643874103972E+001 -3.959645301380638E+001 -3.959646764783876E+001 +-3.959648265226726E+001 -3.959649803652388E+001 -3.959651381012080E+001 -3.959652998296047E+001 +-3.959654656512785E+001 -3.959656228255710E+001 -3.959657968021117E+001 -3.959659751820813E+001 +-3.959661580762333E+001 -3.959663455995469E+001 -3.959665272687897E+001 -3.959667241201253E+001 +-3.959669259532957E+001 -3.959671328951007E+001 -3.959673450747822E+001 -3.959675626250315E+001 +-3.959677856807991E+001 -3.959680143816168E+001 -3.959682488712718E+001 -3.959684892956729E+001 +-3.959687358045201E+001 -3.959689885523004E+001 -3.959692476967803E+001 -3.959694964703533E+001 +-3.959697684508745E+001 -3.959700473148285E+001 -3.959703332357536E+001 -3.959706130022479E+001 +-3.959709132248835E+001 -3.959712210450277E+001 -3.959715366545179E+001 -3.959718602506627E+001 +-3.959721920363561E+001 -3.959725322174640E+001 -3.959728810073616E+001 -3.959732386241821E+001 +-3.959736052912092E+001 -3.959739812369802E+001 -3.959743666963212E+001 -3.959747619091922E+001 +-3.959751671224312E+001 -3.959755825884703E+001 -3.959760085672698E+001 -3.959764453234449E+001 +-3.959768931306181E+001 -3.959773522686079E+001 -3.959778230241007E+001 -3.959782809197516E+001 +-3.959787751601688E+001 -3.959792819061214E+001 -3.959797831202674E+001 -3.959803153579206E+001 +-3.959808610607536E+001 -3.959814205673877E+001 -3.959819942276579E+001 -3.959825824013600E+001 +-3.959831854558553E+001 -3.959838037659943E+001 -3.959844377170353E+001 -3.959850877077351E+001 +-3.959857541414056E+001 -3.959864374326736E+001 -3.959871380086004E+001 -3.959878563065821E+001 +-3.959885927754785E+001 -3.959893478716450E+001 -3.959901220673706E+001 -3.959909158449379E+001 +-3.959917296986502E+001 -3.959925641354704E+001 -3.959934196757856E+001 -3.959942968529555E+001 +-3.959951962136442E+001 -3.959961183181136E+001 -3.959970637415143E+001 -3.959980330736803E+001 +-3.959990269178395E+001 -3.960000458943888E+001 -3.960010906376169E+001 -3.960021617987327E+001 +-3.960032177447619E+001 -3.960043426779335E+001 -3.960054682068021E+001 -3.960066500283769E+001 +-3.960078617283736E+001 -3.960091040603426E+001 -3.960103777998404E+001 -3.960116837371622E+001 +-3.960130226827267E+001 -3.960143954748899E+001 -3.960158029639967E+001 -3.960172460295617E+001 +-3.960187255692673E+001 -3.960202425001235E+001 -3.960217977687456E+001 -3.960233923385778E+001 +-3.960250272014594E+001 -3.960267033772063E+001 -3.960284219049998E+001 -3.960301838570417E+001 +-3.960319903271947E+001 -3.960338424337389E+001 -3.960357413296531E+001 -3.960376881915365E+001 +-3.960396842292008E+001 -3.960417306819384E+001 -3.960438288197346E+001 -3.960459799453165E+001 +-3.960481853973278E+001 -3.960504465450713E+001 -3.960527647890746E+001 -3.960551415699551E+001 +-3.960575783565987E+001 -3.960600766615320E+001 -3.960626380373282E+001 -3.960652640650666E+001 +-3.960679563741736E+001 -3.960707166303802E+001 -3.960735465434943E+001 -3.960764478725350E+001 +-3.960794224096051E+001 -3.960824719981267E+001 -3.960855985230738E+001 -3.960888039140300E+001 +-3.960920901608949E+001 -3.960954592903887E+001 -3.960989133851782E+001 -3.961024545803881E+001 +-3.961060850604117E+001 -3.961098070732739E+001 -3.961136229162902E+001 -3.961175349450270E+001 +-3.961215455731018E+001 -3.961256572717987E+001 -3.961298725812046E+001 -3.961341940908272E+001 +-3.961385113269051E+001 -3.961429945781320E+001 -3.961476466031022E+001 -3.961524157870063E+001 +-3.961573050426911E+001 -3.961623173956241E+001 -3.961674559259257E+001 -3.961727237834213E+001 +-3.961781242133592E+001 -3.961836605106301E+001 -3.961893360900636E+001 -3.961951544408767E+001 +-3.962011191120283E+001 -3.962072337650537E+001 -3.962135021396065E+001 -3.962199280788710E+001 +-3.962265155098670E+001 -3.962332684672803E+001 -3.962401910839040E+001 -3.962472875705509E+001 +-3.962545622673819E+001 -3.962620196120464E+001 -3.962696641546403E+001 -3.962775005481082E+001 +-3.962855335624653E+001 -3.962937681062910E+001 -3.963022091545676E+001 -3.963108618400486E+001 +-3.963197314489632E+001 -3.963288233423840E+001 -3.963381430301356E+001 -3.963476961585763E+001 +-3.963574885210996E+001 -3.963675260455043E+001 -3.963778147779157E+001 -3.963883609429405E+001 +-3.963991708980490E+001 -3.964102511471709E+001 -3.964216083777580E+001 -3.964332494317706E+001 +-3.964451813116897E+001 -3.964574111566558E+001 -3.964699462966875E+001 -3.964827942659944E+001 +-3.964959627610289E+001 -3.965094596519575E+001 -3.965232929702616E+001 -3.965374709729971E+001 +-3.965520021295357E+001 -3.965668950747217E+001 -3.965821586612641E+001 -3.965978019465902E+001 +-3.966138342043062E+001 -3.966302649385507E+001 -3.966471038535632E+001 -3.966643608775642E+001 +-3.966820461817282E+001 -3.967001701891080E+001 -3.967187435440663E+001 -3.967377771278021E+001 +-3.967572821017840E+001 -3.967772698670711E+001 -3.967977520928349E+001 -3.968187407255830E+001 +-3.968402479531592E+001 -3.968622862692985E+001 -3.968848684422215E+001 -3.969080075207050E+001 +-3.969317168811222E+001 -3.969560101643839E+001 -3.969809013283709E+001 -3.970064046584488E+001 +-3.970325347490444E+001 -3.970593065129921E+001 -3.970867351798940E+001 -3.971148363535628E+001 +-3.971436259688690E+001 -3.971731202771502E+001 -3.972033359043128E+001 -3.972342898412528E+001 +-3.972659994610670E+001 -3.972984825047364E+001 -3.973317570677385E+001 -3.973658416300761E+001 +-3.974007550953901E+001 -3.974365167655071E+001 -3.974731463034571E+001 -3.975106638139673E+001 +-3.975490898213205E+001 -3.975884452604420E+001 -3.976287515117252E+001 -3.976700303664419E+001 +-3.977123040633841E+001 -3.977555953090206E+001 -3.977999272554747E+001 -3.978453235015787E+001 +-3.978918081022131E+001 -3.979394055963083E+001 -3.979881410065585E+001 -3.980380398150628E+001 +-3.980891279907638E+001 -3.981414320043779E+001 -3.981949788022260E+001 -3.982497958321085E+001 +-3.983059110611984E+001 -3.983633529525559E+001 -3.984221504646986E+001 -3.984823330790708E+001 +-3.985439307976844E+001 -3.986069741224780E+001 -3.986714940905466E+001 -3.987375222571273E+001 +-3.988050906805398E+001 -3.988742319644839E+001 -3.989449792250991E+001 -3.990173660753597E+001 +-3.990914266777280E+001 -3.991671957296776E+001 -3.992447084048937E+001 -3.993240004063362E+001 +-3.994051079586599E+001 -3.994880677534161E+001 -3.995729170107003E+001 -3.996596934425022E+001 +-3.997484352281001E+001 -3.998391810470068E+001 -3.999319700396335E+001 -4.000268417927282E+001 +-4.001238363466462E+001 -4.002229941785579E+001 -4.003243561752453E+001 -4.004279636378524E+001 +-4.005338582571950E+001 -4.006420820841491E+001 -4.007526775258853E+001 -4.008656873257435E+001 +-4.009811545434859E+001 -4.010991225140452E+001 -4.012196348320845E+001 -4.013427353249168E+001 +-4.014684680109113E+001 -4.015968771038958E+001 -4.017280069636121E+001 -4.018619020155356E+001 +-4.019986067752056E+001 -4.021381658169957E+001 -4.022806236655482E+001 -4.024260247832386E+001 +-4.025744135498729E+001 -4.027258342029845E+001 -4.028803307766791E+001 -4.030379470263949E+001 +-4.031987264126917E+001 -4.033627120446770E+001 -4.035299465862101E+001 -4.037004722113040E+001 +-4.038743305215781E+001 -4.040515625043559E+001 -4.042322084522425E+001 -4.044163078673675E+001 +-4.046038994077573E+001 -4.047950207780458E+001 -4.049897086704922E+001 -4.051879986679895E+001 +-4.053899251516101E+001 -4.055955212386759E+001 -4.058048186418223E+001 -4.060178475638114E+001 +-4.062346366315550E+001 -4.064552127967315E+001 -4.066796011952887E+001 -4.069078250402461E+001 +-4.071399055198499E+001 -4.073758616870347E+001 -4.076157103408228E+001 -4.078594658663473E+001 +-4.081071401578915E+001 -4.083587424746926E+001 -4.086142792880906E+001 -4.088737542223959E+001 +-4.091371678551491E+001 -4.094045175696474E+001 -4.096757974759171E+001 -4.099509982621129E+001 +-4.102301070524802E+001 -4.105131072504656E+001 -4.107999784004303E+001 -4.110906960641775E+001 +-4.113852316988388E+001 -4.116835525038687E+001 -4.119856212704838E+001 -4.122913962534739E+001 +-4.126008310281662E+001 -4.129138743910027E+001 -4.132304702158214E+001 -4.135505572989688E+001 +-4.138740692741445E+001 -4.142009344709812E+001 -4.145310758008198E+001 -4.148644106795610E+001 +-4.152008508728126E+001 -4.155403024093830E+001 -4.158826655276783E+001 -4.162278345547695E+001 +-4.165756978231397E+001 -4.169261376189576E+001 -4.172790301122655E+001 -4.176342452968175E+001 +-4.179916469568556E+001 -4.183510926462677E+001 -4.187124336365805E+001 -4.190755149117378E+001 +-4.194401751935484E+001 -4.198062469280887E+001 -4.201735563065912E+001 -4.205419233060698E+001 +-4.209111617592109E+001 -4.212810794112944E+001 -4.216514779731067E+001 -4.220221532371206E+001 +-4.223928951789279E+001 -4.227634880672285E+001 -4.231337106193568E+001 -4.235033361567424E+001 +-4.238721327475213E+001 -4.242398633869050E+001 -4.246062862193686E+001 -4.249711547483102E+001 +-4.253342180433381E+001 -4.256952209987960E+001 -4.260539046016859E+001 -4.264100061835472E+001 +-4.267632597178967E+001 -4.271133961131588E+001 -4.274601435359618E+001 -4.278032277487175E+001 +-4.281423724250126E+001 -4.284772995156664E+001 -4.288077296192242E+001 -4.291333823517571E+001 +-4.294539767292859E+001 -4.297692315614239E+001 -4.300788658632446E+001 -4.303825992551376E+001 +-4.306801523937721E+001 -4.309712473948586E+001 -4.312556082491562E+001 -4.315329612757731E+001 +-4.318030355517750E+001 -4.320655633619381E+001 -4.323202806416063E+001 -4.325669274043040E+001 +-4.328052482032509E+001 -4.330349925834413E+001 -4.332559155094251E+001 -4.334677778076352E+001 +-4.336703466143051E+001 -4.338633957940118E+001 -4.340467063703568E+001 -4.342200669662034E+001 +-4.343832742090601E+001 -4.345361331278325E+001 -4.346784575642702E+001 -4.348100705674133E+001 +-4.349308047724875E+001 -4.350405027717395E+001 -4.351390174774717E+001 -4.352262124726816E+001 +-4.353019623471035E+001 -4.353661530225310E+001 -4.354186820612621E+001 -4.354594589631882E+001 +-4.354884054514665E+001 -4.355054557350576E+001 -4.355105567568366E+001 -4.355036684343142E+001 +-4.354847638691513E+001 -4.354538295389044E+001 -4.354108654786082E+001 -4.353558854409998E+001 +-4.352889170317948E+001 -4.352100018156423E+001 -4.351191954147816E+001 -4.350165675795539E+001 +-4.349022022268107E+001 -4.347761974602678E+001 -4.346386655603686E+001 -4.344897329484915E+001 +-4.343295401254769E+001 -4.341582415797911E+001 -4.339760056595358E+001 -4.337830144219731E+001 +-4.335794634481226E+001 -4.333655616186607E+001 -4.331415308678017E+001 -4.329076058990246E+001 +-4.326640338607654E+001 -4.324110739928062E+001 -4.321489972368241E+001 -4.318780858134167E+001 +-4.315986327642790E+001 -4.313109414544411E+001 -4.310153250461207E+001 -4.307121059366671E+001 +-4.304016151628120E+001 -4.300841917769293E+001 -4.297601821893730E+001 -4.294299394848011E+001 +-4.290938227099564E+001 -4.287521961354832E+001 -4.284054284989391E+001 -4.280538922247148E+001 +-4.276979626250813E+001 -4.273380170905182E+001 -4.269744342678402E+001 -4.266075932266887E+001 +-4.262378726220760E+001 -4.258656498572839E+001 -4.254913002484299E+001 -4.251151961931686E+001 +-4.247377063487595E+001 -4.243591948232704E+001 -4.239800203835091E+001 -4.236005356821910E+001 +-4.232210865085646E+001 -4.228420110670304E+001 -4.224636392830116E+001 -4.220862921423593E+001 +-4.217102810678582E+001 -4.213359073321885E+001 -4.209634615111398E+001 -4.205932229788326E+001 +-4.202254594471989E+001 -4.198604265506128E+001 -4.194983674768567E+001 -4.191395126443923E+001 +-4.187840794271904E+001 -4.184322719278221E+001 -4.180842807964157E+001 -4.177402830971891E+001 +-4.174004422208472E+001 -4.170649078408281E+001 -4.167338159134914E+001 -4.164072887196771E+001 +-4.160854349461746E+001 -4.157683498049085E+001 -4.154561151871239E+001 -4.151487998508778E+001 +-4.148464596389050E+001 -4.145491377241514E+001 -4.142568648803468E+001 -4.139696597746462E+001 +-4.136875292797397E+001 -4.134104688023588E+001 -4.131384626254455E+001 -4.128714842611944E+001 +-4.126094968120724E+001 -4.123524533373017E+001 -4.121002972221524E+001 -4.118529625475959E+001 +-4.116103744579230E+001 -4.113724495240997E+001 -4.111390961008259E+001 -4.109102146753341E+001 +-4.106856982061737E+001 -4.104654324503528E+001 -4.102492962774496E+001 -4.100371619694189E+001 +-4.098288955049977E+001 -4.096243568278015E+001 -4.094234000973876E+001 -4.092258739227847E+001 +-4.090316215780146E+001 -4.088404811994393E+001 -4.086522859649053E+001 -4.084668642547640E+001 +-4.082840397951054E+001 -4.081036317835947E+001 -4.079254549984673E+001 -4.077493198914320E+001 +-4.075750326654364E+001 -4.074023953382294E+001 -4.072312057927762E+001 -4.070612578159226E+001 +-4.068923411266333E+001 -4.067242413952578E+001 -4.065567402555048E+001 -4.063896153107815E+001 +-4.062226401366831E+001 -4.060555842815108E+001 -4.058882132668231E+001 -4.057202885900578E+001 +-4.055515677312526E+001 -4.053818041660601E+001 -4.052107473872596E+001 -4.050381429369295E+001 +-4.048637324515210E+001 -4.046872537220580E+001 -4.045084407716515E+001 -4.043270239524563E+001 +-4.041427300641514E+001 -4.039552824959622E+001 -4.037644013940550E+001 -4.035698038560230E+001 +-4.033712041540193E+001 -4.031683139878376E+001 -4.029608427690121E+001 -4.027484979367080E+001 +-4.025309853058457E+001 -4.023080094475345E+001 -4.020792741014667E+001 -4.018444826194668E+001 +-4.016033384388997E+001 -4.013555455841021E+001 -4.011008091934276E+001 -4.008388360688748E+001 +-4.005693352446495E+001 -4.002920185703660E+001 -4.000066013038764E+001 -3.997128027081121E+001 +-3.994103466456078E+001 -3.990989621637193E+001 -3.987783840630577E+001 -3.984483534409548E+001 +-3.981086182013963E+001 -3.977589335224729E+001 -3.973990622719733E+001 -3.970287753617811E+001 +-3.966478520315997E+001 -3.962560800527201E+001 -3.958532558428436E+001 -3.954391844833957E+001 +-3.950136796317405E+001 -3.945765633214353E+001 -3.941276656447339E+001 -3.936668243129992E+001 +-3.931938840921839E+001 -3.927086961122075E+001 -3.922111170507708E+001 -3.917010081943430E+001 +-3.911782343807818E+001 -3.906426628300703E+001 -3.900941618720385E+001 -3.895325995813640E+001 +-3.889578423321370E+001 -3.883697532857892E+001 -3.877681908273917E+001 -3.871530069665008E+001 +-3.865240457189442E+001 -3.858811414863106E+001 -3.852241174494580E+001 -3.845527839913985E+001 +-3.838669371636971E+001 -3.831663572082950E+001 -3.824508071442265E+001 -3.817200314253141E+001 +-3.809737546713617E+001 -3.802116804710825E+001 -3.794334902496166E+001 -3.786388421884738E+001 +-3.778273701794684E+001 -3.769986827875206E+001 -3.761523621904136E+001 -3.752879630560395E+001 +-3.744050113100351E+001 -3.735030027385471E+001 -3.725814013633087E+001 -3.716396375186932E+001 +-3.706771055533252E+001 -3.696931610737339E+001 -3.686871176438089E+001 -3.676582428529409E+001 +-3.666057536693921E+001 -3.655288110036830E+001 -3.644265134218848E+001 -3.632978899726477E+001 +-3.621418921253964E+001 -3.609573848628547E+001 -3.597431370300207E+001 -3.584978111147404E+001 +-3.572199527224459E+001 -3.559079801080024E+001 -3.545601742378953E+001 -3.531746699710136E+001 +-3.517494490585584E+001 -3.502823357622079E+001 -3.487709959620228E+001 -3.472129406564835E+001 +-3.456055347302387E+001 -3.439460117666948E+001 -3.422314954999603E+001 -3.404590282285145E+001 +-3.386256061552667E+001 -3.367282211889420E+001 -3.347639082674549E+001 -3.327297967837047E+001 +-3.306231642557412E+001 -3.284414900390122E+001 -3.261825066777087E+001 -3.238442464744304E+001 +-3.214250810437295E+001 -3.189237520035545E+001 -3.163393915217515E+001 -3.136715321215296E+001 +-3.109201058918671E+001 -3.080854339700434E+001 -3.051682077906126E+001 -3.021694640683766E+001 +-2.990905557637376E+001 -2.959331213537850E+001 -2.926990546131848E+001 -2.893904768275773E+001 +-2.860097129647674E+001 -2.825592728675647E+001 -2.790418380569671E+001 -2.754602542884180E+001 +-2.718175296187562E+001 -2.681168374363328E+001 -2.643615236888547E+001 -2.605551174101892E+001 +-2.567013435888192E+001 -2.528041374229176E+001 -2.488676590544256E+001 -2.448963079518096E+001 +-2.408947362047910E+001 -2.368678600932860E+001 -2.328208693887347E+001 -2.287592339333025E+001 +-2.246887071177796E+001 -2.206153259407756E+001 -2.165454073798715E+001 -2.124855408404616E+001 +-2.084425764713963E+001 -2.044236091497493E+001 -2.004359579417128E+001 -1.964871408444628E+001 +-1.925848446062146E+001 -1.887368894100901E+001 -1.849511881933488E+001 -1.812357003581853E+001 +-1.775983796155302E+001 -1.740471156908653E+001 -1.705896696132256E+001 -1.672336023084910E+001 +-1.639861962292675E+001 -1.608543697810289E+001 -1.578445843537438E+001 -1.549627438472702E+001 +-1.522140866967019E+001 -1.496030705715428E+001 -1.471332501534683E+001 -1.448071487071766E+001 +-1.426261245655528E+001 -1.405902341752106E+001 -1.386980940147944E+001 -1.369467445324832E+001 +-1.353315202794706E+001 -1.338459316729963E+001 -1.324815653376933E+001 -1.312280117797825E+001 +-1.300728312774491E+001 -1.290015713544758E+001 -1.279978520739085E+001 -1.270435386757408E+001 +-1.261190248202305E+001 -1.252036539255855E+001 -1.242763108556672E+001 -1.233162215912159E+001 +-1.223040046110953E+001 -1.212230246700639E+001 -1.200611077036348E+001 -1.188126850144401E+001 +-1.174814460768029E+001 -1.160835944477409E+001 -1.146518402115629E+001 -1.132280407179867E+001 +-1.118218989168451E+001 -1.104331785872899E+001 -1.090616668641812E+001 -1.077071544792547E+001 +-1.063694343630547E+001 -1.050483016425221E+001 -1.037435536387954E+001 -1.024549898648309E+001 +-1.011824120225304E+001 -9.992562399913206E+000 -9.868443186270932E+000 -9.745864385665094E+000 +-9.624807039307031E+000 -9.505252404509125E+000 -9.387181953799780E+000 -9.270577373928035E+000 +-9.155420564758977E+000 -9.041693638065841E+000 -8.929378916223136E+000 -8.818458930806344E+000 +-8.708916421101794E+000 -8.600734333274142E+000 -8.493895816559178E+000 -8.388384222195361E+000 +-8.284183107116700E+000 -8.181276223554081E+000 -8.079647517800044E+000 -7.979281139011116E+000 +-7.880161428197857E+000 -7.782272914648133E+000 -7.685600318873758E+000 -7.590128548919757E+000 +-7.495842698362337E+000 -7.402728044281923E+000 -7.310770045201123E+000 -7.219954339049376E+000 +-7.130266741097813E+000 -7.041693241918789E+000 -6.954220005346530E+000 -6.867833366443412E+000 +-6.782519829475073E+000 -6.698266065896354E+000 -6.615058912350452E+000 -6.532885368681790E+000 +-6.451732595964483E+000 -6.371587914547370E+000 -6.292438802116163E+000 -6.214272891774091E+000 +-6.137077970141021E+000 -6.060841975472012E+000 -5.985552995795609E+000 -5.911199267071920E+000 +-5.837769171371101E+000 -5.765251235071945E+000 -5.693634127080952E+000 -5.622906657071764E+000 +-5.553057773744779E+000 -5.484076563107118E+000 -5.415952246772511E+000 -5.348674180281180E+000 +-5.282231851439473E+000 -5.216614878678951E+000 -5.151813009434896E+000 -5.087816118543952E+000 +-5.024614206660758E+000 -4.962197398693361E+000 -4.900555942257230E+000 -4.839680206147747E+000 +-4.779560678831080E+000 -4.720187966953350E+000 -4.661552793835557E+000 -4.603645998151747E+000 +-4.546458532352778E+000 -4.489981461093135E+000 -4.434205960236691E+000 -4.379123315283386E+000 +-4.324724919839739E+000 -4.271002274455124E+000 -4.217946985237782E+000 -4.165550762538802E+000 +-4.113805419653025E+000 -4.062702871536509E+000 -4.012235133540450E+000 -3.962394320161430E+000 +-3.913172643807676E+000 -3.864562413581273E+000 -3.816556034076072E+000 -3.769146004191123E+000 +-3.722324915959468E+000 -3.676085453391948E+000 -3.630420391335976E+000 -3.585322594349039E+000 +-3.540785015586642E+000 -3.496800695704459E+000 -3.453362761774627E+000 -3.410464426215798E+000 +-3.368098985736761E+000 -3.326259820293465E+000 -3.284940392059132E+000 -3.244134244407273E+000 +-3.203835000907359E+000 -3.164036364332936E+000 -3.124732115681998E+000 -3.085916113209257E+000 +-3.047582291470274E+000 -3.009724660377183E+000 -2.972337304265751E+000 -2.935414380973737E+000 +-2.898950120930256E+000 -2.862938826256054E+000 -2.827374869874560E+000 -2.792252694633524E+000 +-2.757566812437220E+000 -2.723311803388990E+000 -2.689482314944101E+000 -2.656073061072815E+000 +-2.623078821433511E+000 -2.590494440555879E+000 -2.558314827033982E+000 -2.526534952729197E+000 +-2.495149851982928E+000 -2.464154620838935E+000 -2.433544416275329E+000 -2.403314455446000E+000 +-2.373460014931491E+000 -2.343976429999216E+000 -2.314859093872842E+000 -2.286103457010875E+000 +-2.257705026394218E+000 -2.229659364822695E+000 -2.201962090220418E+000 -2.174608874949822E+000 +-2.147595445134400E+000 -2.120917579989881E+000 -2.094571111163854E+000 -2.068551922083709E+000 +-2.042855947312708E+000 -2.017479171914232E+000 -1.992417630823918E+000 -1.967667408229740E+000 +-1.943224636959844E+000 -1.919085497878015E+000 -1.895246219286778E+000 -1.871703076337889E+000 +-1.848452390450245E+000 -1.825490528735059E+000 -1.802813903428163E+000 -1.780418971329452E+000 +-1.758302233249252E+000 -1.736460233461611E+000 -1.714889559164406E+000 -1.693586839946112E+000 +-1.672548747259256E+000 -1.651771993900352E+000 -1.631253333496329E+000 -1.610989559997323E+000 +-1.590977507175718E+000 -1.571214048131446E+000 -1.551696094803352E+000 -1.532420597486635E+000 +-1.513384544356245E+000 -1.494584960996125E+000 -1.476018909934304E+000 -1.457683490183649E+000 +-1.439575836788294E+000 -1.421693120375618E+000 -1.404032546713658E+000 -1.386591356273957E+000 +-1.369366823799665E+000 -1.352356257878858E+000 -1.335557000523053E+000 -1.318966427020459E+000 +-1.302581944420165E+000 -1.286400992820359E+000 -1.270421043808944E+000 -1.254639600362399E+000 +-1.239054196452522E+000 -1.223662396657451E+000 -1.208461795776663E+000 -1.193450018449908E+000 +-1.178624719393483E+000 -1.163983580515975E+000 -1.149524314397601E+000 -1.135244661294176E+000 +-1.121142389443103E+000 -1.107215294698165E+000 -1.093461200163570E+000 -1.079877955891535E+000 +-1.066463437839677E+000 -1.053215552162067E+000 -1.040132217590330E+000 -1.027211850796977E+000 +-1.014451620253952E+000 -1.001849900379708E+000 -9.894047210561528E-001 -9.771141382321297E-001 +-9.649762314791170E-001 -9.529891042245537E-001 -9.411508834554730E-001 -9.294597195302924E-001 +-9.179137854626759E-001 -9.065112772914954E-001 -8.952504133516535E-001 -8.841294341102472E-001 +-8.731466018916424E-001 -8.623002006059632E-001 -8.515885354809387E-001 -8.410099327971033E-001 +-8.305627396262671E-001 -8.202453235732438E-001 -8.100560725207732E-001 -7.999933943774529E-001 +-7.900557168293979E-001 -7.802414870943259E-001 -7.705491716789135E-001 -7.609772561391901E-001 +-7.515242448438997E-001 -7.421886607408139E-001 -7.329690451259345E-001 -7.238639574155717E-001 +-7.148719749212562E-001 -7.059916926274302E-001 -6.972217229719252E-001 -6.885606956291402E-001 +-6.800072572959326E-001 -6.715600714801644E-001 -6.632178182914461E-001 -6.549791942366218E-001 +-6.468429120134611E-001 -6.388077003113125E-001 -6.308723036120029E-001 -6.230354819936503E-001 +-6.152960109369360E-001 -6.076526811337597E-001 -6.001042982982882E-001 -5.926496829803486E-001 +-5.852876703811285E-001 -5.780171101711836E-001 -5.708368663106879E-001 -5.637458168719287E-001 +-5.567428538640069E-001 -5.498268830597020E-001 -5.429968238245080E-001 -5.362516089477720E-001 +-5.295901844759453E-001 -5.230115095479038E-001 -5.165145562323030E-001 -5.100983093669719E-001 +-5.037617664002824E-001 -4.975039372345033E-001 -4.913238440710975E-001 -4.852205212579329E-001 +-4.791930151384047E-001 -4.732403839024175E-001 -4.673616974392293E-001 -4.615560371921216E-001 +-4.558224960148674E-001 -4.501601780299943E-001 -4.445681984887966E-001 -4.390456836330927E-001 +-4.335917705587028E-001 -4.282056070806111E-001 -4.228863515998176E-001 -4.176331729718307E-001 +-4.124452503768011E-001 -4.073217731912699E-001 -4.022619408615019E-001 -3.972649627784022E-001 +-3.923300581539789E-001 -3.874564558993426E-001 -3.826433945042280E-001 -3.778901219179976E-001 +-3.731958954321414E-001 -3.685599815642194E-001 -3.639816559432570E-001 -3.594602031965630E-001 +-3.549949168379451E-001 -3.505850991573267E-001 -3.462300611117225E-001 -3.419291222175767E-001 +-3.376816104444386E-001 -3.334868621099500E-001 -3.293442217761512E-001 -3.252530421470610E-001 +-3.212126839675380E-001 -3.172225159233980E-001 -3.132819145427642E-001 -3.093902640986557E-001 +-3.055469565127718E-001 -3.017513912604827E-001 -2.980029752769965E-001 -2.943011228646885E-001 +-2.906452556015889E-001 -2.870348022509996E-001 -2.834691986722382E-001 -2.799478877324925E-001 +-2.764703192197627E-001 -2.730359497568949E-001 -2.696442427166725E-001 -2.662946681379695E-001 +-2.629867026429443E-001 -2.597198293552571E-001 -2.564935378193113E-001 -2.533073239204900E-001 +-2.501606898063886E-001 -2.470531438090256E-001 -2.439842003680159E-001 -2.409533799547039E-001 +-2.379602089972332E-001 -2.350042198065516E-001 -2.320849505033352E-001 -2.292019449458151E-001 +-2.263547526585080E-001 -2.235429287618262E-001 -2.207660339025646E-001 -2.180236341852526E-001 +-2.153153011043542E-001 -2.126406114773162E-001 -2.099991473784422E-001 -2.073904960735922E-001 +-2.048142499556933E-001 -2.022700064810474E-001 -1.997573681064362E-001 -1.972759422270011E-001 +-1.948253411148996E-001 -1.924051818587228E-001 -1.900150863036626E-001 -1.876546809924264E-001 +-1.853235971068816E-001 -1.830214704104282E-001 -1.807479411910869E-001 -1.785026542052909E-001 +-1.762852586223813E-001 -1.740954079697865E-001 -1.719327600788865E-001 -1.697969770315491E-001 +-1.676877251073272E-001 -1.656046747313170E-001 -1.635475004226588E-001 -1.615158807436814E-001 +-1.595094982496771E-001 -1.575280394392986E-001 -1.555711947055760E-001 -1.536386582875383E-001 +-1.517301282224379E-001 -1.498453062985700E-001 -1.479838980086735E-001 -1.461456125039168E-001 +-1.443301625484495E-001 -1.425372644745219E-001 -1.407666381381631E-001 -1.390180068754051E-001 +-1.372910974590560E-001 -1.355856400560057E-001 -1.339013681850651E-001 -1.322380186753281E-001 +-1.305953316250492E-001 -1.289730503610352E-001 -1.273709213985379E-001 -1.257886944016469E-001 +-1.242261221441756E-001 -1.226829604710290E-001 -1.211589682600567E-001 + + + +-2.028817480728866E-003 -2.054336863470290E-003 -2.080177240545214E-003 -2.106342649565853E-003 +-2.132837178931358E-003 -2.159664968466627E-003 -2.186830210069168E-003 -2.214337148364096E-003 +-2.242190081367352E-003 -2.270393361157302E-003 -2.298951394554734E-003 -2.327868643811450E-003 +-2.357149627307494E-003 -2.386798920257165E-003 -2.416821155423910E-003 -2.447221023844192E-003 +-2.478003275560480E-003 -2.509172720363463E-003 -2.540734228543574E-003 -2.572692731652009E-003 +-2.605053223271271E-003 -2.637820759795437E-003 -2.671000461220237E-003 -2.704597511943056E-003 +-2.738617161573027E-003 -2.773064725751271E-003 -2.807945586981496E-003 -2.843265195471019E-003 +-2.879029069982379E-003 -2.915242798695658E-003 -2.951912040081643E-003 -2.989042523785979E-003 +-3.026640051524441E-003 -3.064710497989467E-003 -3.103259811768096E-003 -3.142294016271445E-003 +-3.181819210675887E-003 -3.221841570876060E-003 -3.262367350449866E-003 -3.303402881635622E-003 +-3.344954576321466E-003 -3.387028927047250E-003 -3.429632508019012E-003 -3.472771976136204E-003 +-3.516454072031877E-003 -3.560685621125887E-003 -3.605473534691413E-003 -3.650824810934851E-003 +-3.696746536089304E-003 -3.743245885521842E-003 -3.790330124854640E-003 -3.838006611100282E-003 +-3.886282793811303E-003 -3.935166216244200E-003 -3.984664516538107E-003 -4.034785428908252E-003 +-4.085536784854457E-003 -4.136926514384850E-003 -4.188962647254929E-003 -4.241653314222257E-003 +-4.295006748316907E-003 -4.349031286127890E-003 -4.403735369105789E-003 -4.459127544881754E-003 +-4.515216468603103E-003 -4.572010904285704E-003 -4.629519726183393E-003 -4.687751920174596E-003 +-4.746716585166404E-003 -4.806422934516322E-003 -4.866880297471865E-003 -4.928098120628293E-003 +-4.990085969404679E-003 -5.052853529538525E-003 -5.116410608599224E-003 -5.180767137520485E-003 +-5.245933172152101E-003 -5.311918894831213E-003 -5.378734615973324E-003 -5.446390775683360E-003 +-5.514897945386957E-003 -5.584266829482282E-003 -5.654508267012662E-003 -5.725633233360193E-003 +-5.797652841960722E-003 -5.870578346040340E-003 -5.944421140373740E-003 -6.019192763064720E-003 +-6.094904897349035E-003 -6.171569373419976E-003 -6.249198170276866E-003 -6.327803417596834E-003 +-6.407397397630138E-003 -6.487992547119303E-003 -6.569601459242458E-003 -6.652236885581017E-003 +-6.735911738112220E-003 -6.820639091226660E-003 -6.906432183771239E-003 -6.993304421117789E-003 +-7.081269377257732E-003 -7.170340796923071E-003 -7.260532597734082E-003 -7.351858872374007E-003 +-7.444333890791133E-003 -7.537972102428498E-003 -7.632788138481732E-003 -7.728796814185240E-003 +-7.826013131127171E-003 -7.924452279593512E-003 -8.024129640941628E-003 -8.125060790003684E-003 +-8.227261497520351E-003 -8.330747732605013E-003 -8.435535665239108E-003 -8.541641668798708E-003 +-8.649082322613013E-003 -8.757874414554967E-003 -8.868034943664451E-003 -8.979581122804534E-003 +-9.092530381351044E-003 -9.206900367916066E-003 -9.322708953105644E-003 -9.439974232312180E-003 +-9.558714528542000E-003 -9.678948395278412E-003 -9.800694619380853E-003 -9.923972224020470E-003 +-1.004880047165263E-002 -1.017519886702686E-002 -1.030318716023456E-002 -1.043278534979518E-002 +-1.056401368578109E-002 -1.069689267298186E-002 -1.083144307410834E-002 -1.096768591303696E-002 +-1.110564247809488E-002 -1.124533432538658E-002 -1.138678328216209E-002 -1.153001145022779E-002 +-1.167504120939999E-002 -1.182189522100198E-002 -1.197059643140512E-002 -1.212116807561443E-002 +-1.227363368089934E-002 -1.242801707046997E-002 -1.258434236719989E-002 -1.274263399739552E-002 +-1.290291669461302E-002 -1.306521550352319E-002 -1.322955578382503E-002 -1.339596321420846E-002 +-1.356446379636692E-002 -1.373508385906052E-002 -1.390785006223020E-002 -1.408278940116368E-002 +-1.425992921071388E-002 -1.443929716957031E-002 -1.462092130458430E-002 -1.480482999514860E-002 +-1.499105197763198E-002 -1.517961634986983E-002 -1.537055257571107E-002 -1.556389048962235E-002 +-1.575966030135019E-002 -1.595789260064164E-002 -1.615861836202459E-002 -1.636186894964791E-002 +-1.656767612218274E-002 -1.677607203778534E-002 -1.698708925912228E-002 -1.720076075845912E-002 +-1.741711992281281E-002 -1.763620055916910E-002 -1.785803689976567E-002 -1.808266360744130E-002 +-1.831011578105306E-002 -1.854042896096092E-002 -1.877363913458184E-002 -1.900978274201363E-002 +-1.924889668172941E-002 -1.949101831634404E-002 -1.973618547845269E-002 -1.998443647654330E-002 +-2.023581010098313E-002 -2.049034563008071E-002 -2.074808283622420E-002 -2.100906199209678E-002 +-2.127332387697039E-002 -2.154090978307872E-002 -2.181186152207005E-002 -2.208622143154184E-002 +-2.236403238165701E-002 -2.264533778184383E-002 -2.293018158758002E-002 -2.321860830726198E-002 +-2.351066300916109E-002 -2.380639132846672E-002 -2.410583947441852E-002 -2.440905423752830E-002 +-2.471608299689240E-002 -2.502697372759687E-002 -2.534177500821505E-002 -2.566053602839993E-002 +-2.598330659657214E-002 -2.631013714770420E-002 -2.664107875120346E-002 -2.697618311889355E-002 +-2.731550261309678E-002 -2.765909025481810E-002 -2.800699973203179E-002 -2.835928540807314E-002 +-2.871600233013491E-002 -2.907720623787139E-002 -2.944295357211053E-002 -2.981330148367548E-002 +-3.018830784231779E-002 -3.056803124576228E-002 -3.095253102886646E-002 -3.134186727289492E-002 +-3.173610081491029E-002 -3.213529325728297E-002 -3.253950697731998E-002 -3.294880513701542E-002 +-3.336325169292365E-002 -3.378291140615639E-002 -3.420784985250638E-002 -3.463813343269777E-002 +-3.507382938276605E-002 -3.551500578456857E-002 -3.596173157642715E-002 -3.641407656390524E-002 +-3.687211143072010E-002 -3.733590774979292E-002 -3.780553799443805E-002 -3.828107554969256E-002 +-3.876259472378949E-002 -3.925017075977456E-002 -3.974387984726980E-002 -4.024379913438537E-002 +-4.075000673978076E-002 -4.126258176487892E-002 -4.178160430623323E-002 -4.230715546805098E-002 +-4.283931737487418E-002 -4.337817318442032E-002 -4.392380710058483E-002 -4.447630438660732E-002 +-4.503575137840374E-002 -4.560223549806652E-002 -4.617584526753473E-002 -4.675667032243670E-002 +-4.734480142610662E-002 -4.794033048377836E-002 -4.854335055695773E-002 -4.915395587797592E-002 +-4.977224186472661E-002 -5.039830513558845E-002 -5.103224352453597E-002 -5.167415609644078E-002 +-5.232414316256564E-002 -5.298230629625397E-002 -5.364874834881699E-002 -5.432357346562136E-002 +-5.500688710237957E-002 -5.569879604164559E-002 -5.639940840951892E-002 -5.710883369255874E-002 +-5.782718275491189E-002 -5.855456785565671E-002 -5.929110266636529E-002 -6.003690228888801E-002 +-6.079208327336158E-002 -6.155676363644488E-002 -6.233106287978473E-002 -6.311510200871438E-002 +-6.390900355118846E-002 -6.471289157695638E-002 -6.552689171697795E-002 -6.635113118308440E-002 +-6.718573878788668E-002 -6.803084496493624E-002 -6.888658178913928E-002 -6.975308299742940E-002 +-7.063048400970137E-002 -7.151892195000864E-002 -7.241853566802933E-002 -7.332946576080276E-002 +-7.425185459474096E-002 -7.518584632791817E-002 -7.613158693264184E-002 -7.708922421830922E-002 +-7.805890785455229E-002 -7.904078939467564E-002 -8.003502229939079E-002 -8.104176196084992E-002 +-8.206116572698419E-002 -8.309339292614952E-002 -8.413860489208405E-002 -8.519696498918163E-002 +-8.626863863808441E-002 -8.735379334160023E-002 -8.845259871094702E-002 -8.956522649232987E-002 +-9.069185059385480E-002 -9.183264711278250E-002 -9.298779436312811E-002 -9.415747290360968E-002 +-9.534186556595135E-002 -9.654115748354489E-002 -9.775553612047413E-002 -9.898519130090784E-002 +-1.002303152388646E-001 -1.014911025683556E-001 -1.027677503739090E-001 -1.040604582214825E-001 +-1.053694281897671E-001 -1.066948649018881E-001 -1.080369755575096E-001 -1.093959699653452E-001 +-1.107720605760821E-001 -1.121654625157232E-001 -1.135763936193535E-001 -1.150050744653339E-001 +-1.164517284099313E-001 -1.179165816223882E-001 -1.193998631204377E-001 -1.209018048062717E-001 +-1.224226415029651E-001 -1.239626109913644E-001 -1.255219540474463E-001 -1.271009144801509E-001 +-1.286997391696972E-001 -1.303186781063877E-001 -1.319579844299060E-001 -1.336179144691172E-001 +-1.352987277823739E-001 -1.370006871983380E-001 -1.387240588573228E-001 -1.404691122531626E-001 +-1.422361202756182E-001 -1.440253592533226E-001 -1.458371089972762E-001 -1.476716528448984E-001 +-1.495292777046427E-001 -1.514102741011814E-001 -1.533149362211706E-001 -1.552435619595989E-001 +-1.571964529667325E-001 -1.591739146956594E-001 -1.611762564504451E-001 -1.632037914349051E-001 +-1.652568368020032E-001 -1.673357137038848E-001 -1.694407473425517E-001 -1.715722670211899E-001 +-1.737306061961553E-001 -1.759161025296298E-001 -1.781290979429542E-001 -1.803699386706483E-001 +-1.826389753151274E-001 -1.849365629021230E-001 -1.872630609368197E-001 -1.896188334607157E-001 +-1.920042491092182E-001 -1.944196811699826E-001 -1.968655076420062E-001 -1.993421112954861E-001 +-2.018498797324523E-001 -2.043892054481860E-001 -2.069604858934348E-001 -2.095641235374329E-001 +-2.122005259317415E-001 -2.148701057749170E-001 -2.175732809780196E-001 -2.203104747309757E-001 +-2.230821155698013E-001 -2.258886374447028E-001 -2.287304797890656E-001 -2.316080875893416E-001 +-2.345219114558501E-001 -2.374724076945028E-001 -2.404600383794669E-001 -2.434852714267795E-001 +-2.465485806689262E-001 -2.496504459303952E-001 -2.527913531042270E-001 -2.559717942295632E-001 +-2.591922675702193E-001 -2.624532776942890E-001 -2.657553355547955E-001 -2.690989585714083E-001 +-2.724846707132337E-001 -2.759130025827015E-001 -2.793844915005585E-001 -2.828996815919863E-001 +-2.864591238738595E-001 -2.900633763431580E-001 -2.937130040665553E-001 -2.974085792711925E-001 +-3.011506814366616E-001 -3.049398973882104E-001 -3.087768213911884E-001 -3.126620552467531E-001 +-3.165962083888506E-001 -3.205798979824931E-001 -3.246137490233517E-001 -3.286983944386766E-001 +-3.328344751895747E-001 -3.370226403746558E-001 -3.412635473350703E-001 -3.455578617609591E-001 +-3.499062577993325E-001 -3.543094181634051E-001 -3.587680342434013E-001 -3.632828062188553E-001 +-3.678544431724310E-001 -3.724836632052744E-001 -3.771711935539311E-001 -3.819177707088450E-001 +-3.867241405344626E-001 -3.915910583909683E-001 -3.965192892576697E-001 -4.015096078580608E-001 +-4.065627987865872E-001 -4.116796566371330E-001 -4.168609861332624E-001 -4.221076022602311E-001 +-4.274203303988018E-001 -4.328000064608846E-001 -4.382474770270289E-001 -4.437635994857964E-001 +-4.493492421750331E-001 -4.550052845250802E-001 -4.607326172039389E-001 -4.665321422644219E-001 +-4.724047732933221E-001 -4.783514355626163E-001 -4.843730661827447E-001 -4.904706142579840E-001 +-4.966450410439469E-001 -5.028973201072384E-001 -5.092284374872905E-001 -5.156393918604119E-001 +-5.221311947060761E-001 -5.287048704754802E-001 -5.353614567623987E-001 -5.421020044763651E-001 +-5.489275780182090E-001 -5.558392554579733E-001 -5.628381287152459E-001 -5.699253037419316E-001 +-5.771019007074855E-001 -5.843690541866460E-001 -5.917279133496873E-001 -5.991796421552178E-001 +-6.067254195455539E-001 -6.143664396446890E-001 -6.221039119588860E-001 -6.299390615799171E-001 +-6.378731293909664E-001 -6.459073722752278E-001 -6.540430633272033E-001 -6.622814920667364E-001 +-6.706239646557830E-001 -6.790718041179455E-001 -6.876263505607771E-001 -6.962889614008683E-001 +-7.050610115917270E-001 -7.139438938544570E-001 -7.229390189112367E-001 -7.320478157216037E-001 +-7.412717317215328E-001 -7.506122330653134E-001 -7.600708048702065E-001 -7.696489514638691E-001 +-7.793481966345362E-001 -7.891700838839144E-001 -7.991161766827856E-001 -8.091880587292627E-001 +-8.193873342096691E-001 -8.297156280619929E-001 -8.401745862418466E-001 -8.507658759908927E-001 +-8.614911861076410E-001 -8.723522272205507E-001 -8.833507320633417E-001 -8.944884557524108E-001 +-9.057671760662455E-001 -9.171886937267100E-001 -9.287548326820588E-001 -9.404674403915364E-001 +-9.523283881113831E-001 -9.643395711820728E-001 -9.765029093165835E-001 -9.888203468894696E-001 +-1.001293853226508E+000 -1.013925422894649E+000 -1.026717075991993E+000 -1.039670858437484E+000 +-1.052788842259979E+000 -1.066073125886349E+000 -1.079525834428184E+000 -1.093149119966715E+000 +-1.106945161835474E+000 -1.120916166900193E+000 -1.135064369835422E+000 -1.149392033397267E+000 +-1.163901448691655E+000 -1.178594935437428E+000 -1.193474842223565E+000 -1.208543546759753E+000 +-1.223803456119464E+000 -1.239257006974664E+000 -1.254906665821174E+000 -1.270754929193668E+000 +-1.286804323869197E+000 -1.303057407058045E+000 -1.319516766580669E+000 -1.336185021029349E+000 +-1.353064819913086E+000 -1.370158843784216E+000 -1.387469804345035E+000 -1.405000444532687E+000 +-1.422753538580389E+000 -1.440731892052960E+000 -1.458938341854480E+000 -1.477375756205747E+000 +-1.496047034589050E+000 -1.514955107657624E+000 -1.534102937106927E+000 -1.553493515504754E+000 +-1.573129866076947E+000 -1.593015042445283E+000 -1.613152128313870E+000 -1.633544237100173E+000 +-1.654194511506503E+000 -1.675106123027535E+000 -1.696282271389190E+000 -1.717726183913813E+000 +-1.739441114806355E+000 -1.761430344355871E+000 -1.783697178046282E+000 -1.806244945570003E+000 +-1.829076999737613E+000 -1.852196715276283E+000 -1.875607487509307E+000 -1.899312730908489E+000 +-1.923315877510741E+000 -1.947620375189636E+000 -1.972229685772121E+000 -1.997147282989995E+000 +-2.022376650255116E+000 -2.047921278246644E+000 -2.073784662297916E+000 -2.099970299569804E+000 +-2.126481685996620E+000 -2.153322312989809E+000 -2.180495663883817E+000 -2.208005210107558E+000 +-2.235854407064004E+000 -2.264046689699338E+000 -2.292585467742087E+000 -2.321474120591525E+000 +-2.350715991833440E+000 -2.380314383360134E+000 -2.410272549070232E+000 -2.440593688122476E+000 +-2.471280937716347E+000 -2.502337365370739E+000 -2.533765960670462E+000 -2.565569626448665E+000 +-2.597751169371538E+000 -2.630313289889977E+000 -2.663258571520923E+000 -2.696589469419258E+000 +-2.730308298199076E+000 -2.764417218961069E+000 -2.798918225480672E+000 -2.833813129509299E+000 +-2.869103545138713E+000 -2.904790872176232E+000 -2.940876278475934E+000 -2.977360681168561E+000 +-3.014244726730218E+000 -3.051528769827246E+000 -3.089212850872030E+000 -3.127296672221627E+000 +-3.165779572948441E+000 -3.204660502109164E+000 -3.243937990435502E+000 -3.283610120367262E+000 +-3.323674494345509E+000 -3.364128201280778E+000 -3.404967781108426E+000 -3.446189187340603E+000 +-3.487787747521684E+000 -3.529758121491481E+000 -3.572094257358363E+000 -3.614789345082161E+000 +-3.657835767565024E+000 -3.701225049146692E+000 -3.744947801399513E+000 -3.788993666117757E+000 +-3.833351255395430E+000 -3.878008088686955E+000 -3.922950526746200E+000 -3.968163702340630E+000 +-4.013631447640185E+000 -4.059336218183590E+000 -4.105259013329529E+000 -4.151379293105737E+000 +-4.197674891376169E+000 -4.244121925255153E+000 -4.290694700707675E+000 -4.337365614287368E+000 +-4.384105050978182E+000 -4.430881278122568E+000 -4.477660335438553E+000 -4.524405921150438E+000 +-4.571079274283605E+000 -4.617639053203084E+000 -4.664041210508705E+000 -4.710238864437144E+000 +-4.756182166963260E+000 -4.801818168840506E+000 -4.847090681872980E+000 -4.891940138770752E+000 +-4.936303451005698E+000 -4.980113865157736E+000 -5.023300818321835E+000 -5.065789793234936E+000 +-5.107502173879481E+000 -5.148355102427454E+000 -5.188261338506033E+000 -5.227129121894043E+000 +-5.264862039897698E+000 -5.301358900805475E+000 -5.336513614985766E+000 -5.370215085367773E+000 +-5.402347109236228E+000 -5.432788293474650E+000 -5.461411985609499E+000 -5.488086223239763E+000 +-5.512673704681952E+000 -5.535031783919887E+000 -5.555012493220594E+000 -5.572462597061281E+000 +-5.587223681306849E+000 -5.599132281879747E+000 -5.608020057473048E+000 -5.613714011169411E+000 +-5.616036766139668E+000 -5.614806900900751E+000 -5.609839349907543E+000 -5.600945875530880E+000 +-5.587935617726307E+000 -5.570615727916385E+000 -5.548792093782930E+000 -5.522270161782376E+000 +-5.490855864244049E+000 -5.454356657871933E+000 -5.412582680328250E+000 -5.365348031312682E+000 +-5.312472184143146E+000 -5.253781533269546E+000 -5.189111082385808E+000 -5.118306276821486E+000 +-5.041224982662988E+000 -4.957739613548365E+000 -4.867739404266456E+000 -4.771132828142540E+000 +-4.667850152678289E+000 -4.557846125005155E+000 -4.441102775384212E+000 -4.317632323218912E+000 +-4.187480165826401E+000 -4.050727925531830E+000 -3.907496525508104E+000 -3.757949259200408E+000 +-3.602294812176500E+000 -3.440790188880791E+000 -3.273743490111749E+000 -3.101516480177266E+000 +-2.924526875736115E+000 -2.743250281448280E+000 -2.558221690917394E+000 -2.370036465227355E+000 +-2.179350695899008E+000 -1.986880854608056E+000 -1.793402628823925E+000 -1.599748840998966E+000 +-1.406806349429889E+000 -1.215511831814062E+000 -1.026846358235834E+000 -8.418286692340908E-001 +-6.615070871057700E-001 -4.869500050415136E-001 -3.192349193700731E-001 -1.594359953524181E-001 +-8.610186768778678E-003 1.322180359484435E-001 2.620732551059956E-001 3.800468350433308E-001 + 4.853156257506865E-001 5.771614033658083E-001 6.549907547354812E-001 7.183550547961625E-001 + 7.669701244374719E-001 8.007350930489672E-001 8.197499241998965E-001 8.243309946289926E-001 + 8.150240452511116E-001 7.926137469786079E-001 7.581290418714822E-001 7.128433287356473E-001 + 6.582684581731046E-001 5.961413807492246E-001 5.284021480532008E-001 4.571617939999210E-001 + 3.846584164504213E-001 3.131995309440306E-001 2.450884737487775E-001 1.825322869711200E-001 + 1.275281233536325E-001 8.172476574990027E-002 4.625537401331255E-002 2.153706317589453E-002 + 7.032398260282550E-003 9.673799199547972E-004 4.204707118187760E-016 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + + + 1.950924612895554E+000 + + + + +-1.343341767730406E-004 -1.360238927306804E-004 -1.377348626995604E-004 -1.394673540222670E-004 +-1.412216374041445E-004 -1.429979869555922E-004 -1.447966802348953E-004 -1.466179982915941E-004 +-1.484622257103983E-004 -1.503296506556544E-004 -1.522205649163720E-004 -1.541352639518165E-004 +-1.560740469376748E-004 -1.580372168128028E-004 -1.600250803265604E-004 -1.620379480867414E-004 +-1.640761346081067E-004 -1.661399583615282E-004 -1.682297418237505E-004 -1.703458115277794E-004 +-1.724884981139020E-004 -1.746581363813510E-004 -1.768550653406180E-004 -1.790796282664244E-004 +-1.813321727513591E-004 -1.836130507601902E-004 -1.859226186848610E-004 -1.882612374001767E-004 +-1.906292723201926E-004 -1.930270934553101E-004 -1.954550754700921E-004 -1.979135977418060E-004 +-2.004030444197011E-004 -2.029238044850334E-004 -2.054762718118457E-004 -2.080608452285103E-004 +-2.106779285800479E-004 -2.133279307912287E-004 -2.160112659304679E-004 -2.187283532745262E-004 +-2.214796173740216E-004 -2.242654881197669E-004 -2.270864008099415E-004 -2.299427962181081E-004 +-2.328351206620845E-004 -2.357638260736817E-004 -2.387293700693197E-004 -2.417322160215316E-004 +-2.447728331313668E-004 -2.478516965017048E-004 -2.509692872114915E-004 -2.541260923909085E-004 +-2.573226052974898E-004 -2.605593253931940E-004 -2.638367584224469E-004 -2.671554164911648E-004 +-2.705158181467736E-004 -2.739184884592330E-004 -2.773639591030801E-004 -2.808527684405059E-004 +-2.843854616054749E-004 -2.879625905889052E-004 -2.915847143249170E-004 -2.952523987781696E-004 +-2.989662170322948E-004 -3.027267493794418E-004 -3.065345834109507E-004 -3.103903141091666E-004 +-3.142945439404053E-004 -3.182478829490929E-004 -3.222509488530862E-004 -3.263043671401920E-004 +-3.304087711659042E-004 -3.345648022523659E-004 -3.387731097885795E-004 -3.430343513318740E-004 +-3.473491927106527E-004 -3.517183081284310E-004 -3.561423802691822E-004 -3.606221004040108E-004 +-3.651581684991650E-004 -3.697512933254091E-004 -3.744021925687718E-004 -3.791115929426877E-004 +-3.838802303015495E-004 -3.887088497556878E-004 -3.935982057877966E-004 -3.985490623708253E-004 +-4.035621930873524E-004 -4.086383812504613E-004 -4.137784200261359E-004 -4.189831125571954E-004 +-4.242532720887905E-004 -4.295897220954751E-004 -4.349932964098789E-004 -4.404648393529963E-004 +-4.460052058661168E-004 -4.516152616444117E-004 -4.572958832722055E-004 -4.630479583599446E-004 +-4.688723856828906E-004 -4.747700753215599E-004 -4.807419488039268E-004 -4.867889392494163E-004 +-4.929119915147121E-004 -4.991120623413904E-004 -5.053901205054202E-004 -5.117471469685375E-004 +-5.181841350315272E-004 -5.247020904894296E-004 -5.313020317887044E-004 -5.379849901863664E-004 +-5.447520099111274E-004 -5.516041483265604E-004 -5.585424760963227E-004 -5.655680773514508E-004 +-5.726820498597631E-004 -5.798855051973932E-004 -5.871795689224807E-004 -5.945653807510482E-004 +-6.020440947350877E-004 -6.096168794428906E-004 -6.172849181416424E-004 -6.250494089823190E-004 +-6.329115651869045E-004 -6.408726152379667E-004 -6.489338030706159E-004 -6.570963882668802E-004 +-6.653616462525227E-004 -6.737308684963407E-004 -6.822053627119629E-004 -6.907864530621949E-004 +-6.994754803659280E-004 -7.082738023076526E-004 -7.171827936496104E-004 -7.262038464466119E-004 +-7.353383702635575E-004 -7.445877923956939E-004 -7.539535580916425E-004 -7.634371307792349E-004 +-7.730399922941846E-004 -7.827636431116409E-004 -7.926096025806524E-004 -8.025794091615805E-004 +-8.126746206664987E-004 -8.228968145026194E-004 -8.332475879187805E-004 -8.437285582550326E-004 +-8.543413631953652E-004 -8.650876610236155E-004 -8.759691308825965E-004 -8.869874730364788E-004 +-8.981444091364812E-004 -9.094416824898990E-004 -9.208810583325206E-004 -9.324643241044626E-004 +-9.441932897294870E-004 -9.560697878978243E-004 -9.680956743525547E-004 -9.802728281795997E-004 +-9.926031521013518E-004 -1.005088572774004E-003 -1.017731041088620E-003 -1.030532532475993E-003 +-1.043495047215334E-003 -1.056620610746852E-003 -1.069911273988257E-003 -1.083369113655256E-003 +-1.096996232586075E-003 -1.110794760070063E-003 -1.124766852180429E-003 -1.138914692111177E-003 +-1.153240490518262E-003 -1.167746485865051E-003 -1.182434944772134E-003 -1.197308162371514E-003 +-1.212368462665285E-003 -1.227618198888798E-003 -1.243059753878403E-003 -1.258695540443829E-003 +-1.274528001745228E-003 -1.290559611674986E-003 -1.306792875244323E-003 -1.323230328974759E-003 +-1.339874541294514E-003 -1.356728112939885E-003 -1.373793677361685E-003 -1.391073901136781E-003 +-1.408571484384823E-003 -1.426289161190218E-003 -1.444229700029399E-003 -1.462395904203493E-003 +-1.480790612276406E-003 -1.499416698518442E-003 -1.518277073355504E-003 -1.537374683823924E-003 +-1.556712514031054E-003 -1.576293585621622E-003 -1.596120958249969E-003 -1.616197730058228E-003 +-1.636527038160515E-003 -1.657112059133234E-003 -1.677956009511522E-003 -1.699062146291962E-003 +-1.720433767441618E-003 -1.742074212413470E-003 -1.763986862668355E-003 -1.786175142203455E-003 +-1.808642518087442E-003 -1.831392501002374E-003 -1.854428645792386E-003 -1.877754552019314E-003 +-1.901373864525288E-003 -1.925290274002420E-003 -1.949507517569666E-003 -1.974029379356932E-003 +-1.998859691096556E-003 -2.024002332722214E-003 -2.049461232975374E-003 -2.075240370019397E-003 +-2.101343772061337E-003 -2.127775517981606E-003 -2.154539737971532E-003 -2.181640614178973E-003 +-2.209082381362031E-003 -2.236869327551022E-003 -2.265005794718760E-003 -2.293496179459297E-003 +-2.322344933675189E-003 -2.351556565273446E-003 -2.381135638870200E-003 -2.411086776504296E-003 +-2.441414658359830E-003 -2.472124023497803E-003 -2.503219670596995E-003 -2.534706458704136E-003 +-2.566589307993574E-003 -2.598873200536467E-003 -2.631563181079685E-003 -2.664664357834527E-003 +-2.698181903275332E-003 -2.732121054948208E-003 -2.766487116289909E-003 -2.801285457457023E-003 +-2.836521516165635E-003 -2.872200798541536E-003 -2.908328879981168E-003 -2.944911406023396E-003 +-2.981954093232276E-003 -3.019462730090940E-003 -3.057443177906737E-003 -3.095901371727809E-003 +-3.134843321271165E-003 -3.174275111862500E-003 -3.214202905387825E-003 -3.254632941257112E-003 +-3.295571537380069E-003 -3.337025091154213E-003 -3.379000080465413E-003 -3.421503064701029E-003 +-3.464540685775821E-003 -3.508119669170813E-003 -3.552246824985231E-003 -3.596929049001704E-003 +-3.642173323764926E-003 -3.687986719673875E-003 -3.734376396087840E-003 -3.781349602446374E-003 +-3.828913679403396E-003 -3.877076059975570E-003 -3.925844270705183E-003 -3.975225932837700E-003 +-4.025228763514156E-003 -4.075860576978589E-003 -4.127129285800751E-003 -4.179042902114188E-003 +-4.231609538869981E-003 -4.284837411106308E-003 -4.338734837234003E-003 -4.393310240338375E-003 +-4.448572149497441E-003 -4.504529201116807E-003 -4.561190140281396E-003 -4.618563822124258E-003 +-4.676659213212666E-003 -4.735485392951686E-003 -4.795051555005526E-003 -4.855367008736793E-003 +-4.916441180663959E-003 -4.978283615937253E-003 -5.040903979833147E-003 -5.104312059267808E-003 +-5.168517764329612E-003 -5.233531129831068E-003 -5.299362316880353E-003 -5.366021614472704E-003 +-5.433519441101973E-003 -5.501866346392495E-003 -5.571073012751663E-003 -5.641150257043403E-003 +-5.712109032282768E-003 -5.783960429352039E-003 -5.856715678738515E-003 -5.930386152294316E-003 +-6.004983365018441E-003 -6.080518976861412E-003 -6.157004794552775E-003 -6.234452773451745E-003 +-6.312875019421284E-003 -6.392283790725939E-003 -6.472691499953744E-003 -6.554110715962464E-003 +-6.636554165850525E-003 -6.720034736952927E-003 -6.804565478862497E-003 -6.890159605476737E-003 +-6.976830497070714E-003 -7.064591702396193E-003 -7.153456940807449E-003 -7.243440104414092E-003 +-7.334555260261187E-003 -7.426816652537094E-003 -7.520238704809360E-003 -7.614836022289048E-003 +-7.710623394123832E-003 -7.807615795720261E-003 -7.905828391095542E-003 -8.005276535259280E-003 +-8.105975776625526E-003 -8.207941859455498E-003 -8.311190726331462E-003 -8.415738520662098E-003 +-8.521601589219789E-003 -8.628796484710264E-003 -8.737339968375028E-003 -8.847249012626927E-003 +-8.958540803719413E-003 -9.071232744449856E-003 -9.185342456897359E-003 -9.300887785195553E-003 +-9.417886798340856E-003 -9.536357793036595E-003 -9.656319296573542E-003 -9.777790069747268E-003 +-9.900789109812848E-003 -1.002533565347744E-002 -1.015144917993115E-002 -1.027914941391679E-002 +-1.040845632883900E-002 -1.053939014991316E-002 -1.067197135735493E-002 -1.080622068961051E-002 +-1.094215914662857E-002 -1.107980799317419E-002 -1.121918876218542E-002 -1.136032325817307E-002 +-1.150323356066418E-002 -1.164794202769003E-002 -1.179447129931897E-002 -1.194284430123489E-002 +-1.209308424836185E-002 -1.224521464853557E-002 -1.239925930622233E-002 -1.255524232628598E-002 +-1.271318811780371E-002 -1.287312139793126E-002 -1.303506719581814E-002 -1.319905085657380E-002 +-1.336509804528508E-002 -1.353323475108599E-002 -1.370348729128034E-002 -1.387588231551800E-002 +-1.405044681002559E-002 -1.422720810189228E-002 -1.440619386341146E-002 -1.458743211647914E-002 +-1.477095123704982E-002 -1.495677995965057E-002 -1.514494738195434E-002 -1.533548296941305E-002 +-1.552841655995161E-002 -1.572377836872344E-002 -1.592159899292858E-002 -1.612190941669514E-002 +-1.632474101602514E-002 -1.653012556380550E-002 -1.673809523488526E-002 -1.694868261121976E-002 +-1.716192068708311E-002 -1.737784287434954E-002 -1.759648300784496E-002 -1.781787535076952E-002 +-1.804205460019229E-002 -1.826905589261918E-002 -1.849891480963509E-002 -1.873166738362137E-002 +-1.896735010354992E-002 -1.920599992085465E-002 -1.944765425538185E-002 -1.969235100142053E-002 +-1.994012853381383E-002 -2.019102571415276E-002 -2.044508189705365E-002 -2.070233693652043E-002 +-2.096283119239310E-002 -2.122660553688366E-002 -2.149370136120097E-002 -2.176416058226563E-002 +-2.203802564951668E-002 -2.231533955181119E-002 -2.259614582441841E-002 -2.288048855610988E-002 +-2.316841239634700E-002 -2.345996256256758E-002 -2.375518484757309E-002 -2.405412562701807E-002 +-2.435683186700338E-002 -2.466335113177499E-002 -2.497373159152998E-002 -2.528802203033156E-002 +-2.560627185413480E-002 -2.592853109892501E-002 -2.625485043897054E-002 -2.658528119519186E-002 +-2.691987534364911E-002 -2.725868552414967E-002 -2.760176504897838E-002 -2.794916791175176E-002 +-2.830094879639898E-002 -2.865716308627151E-002 -2.901786687338350E-002 -2.938311696778557E-002 +-2.975297090707382E-002 -3.012748696603689E-002 -3.050672416644325E-002 -3.089074228697126E-002 +-3.127960187328468E-002 -3.167336424825604E-002 -3.207209152234049E-002 -3.247584660410328E-002 +-3.288469321090326E-002 -3.329869587973543E-002 -3.371791997823541E-002 -3.414243171584895E-002 +-3.457229815516954E-002 -3.500758722344730E-002 -3.544836772427231E-002 -3.589470934943583E-002 +-3.634668269097267E-002 -3.680435925338850E-002 -3.726781146607547E-002 -3.773711269591973E-002 +-3.821233726010490E-002 -3.869356043911537E-002 -3.918085848994318E-002 -3.967430865950272E-002 +-4.017398919825761E-002 -4.067997937406376E-002 -4.119235948623329E-002 -4.171121087982390E-002 +-4.223661596015815E-002 -4.276865820757778E-002 -4.330742219243747E-002 -4.385299359034405E-002 +-4.440545919764555E-002 -4.496490694717564E-002 -4.553142592425941E-002 -4.610510638298582E-002 +-4.668603976275272E-002 -4.727431870509049E-002 -4.787003707077069E-002 -4.847328995720573E-002 +-4.908417371614644E-002 -4.970278597168408E-002 -5.032922563856437E-002 -5.096359294081933E-002 +-5.160598943072616E-002 -5.225651800809897E-002 -5.291528293992279E-002 -5.358238988033640E-002 +-5.425794589097373E-002 -5.494205946167159E-002 -5.563484053155247E-002 -5.633640051049189E-002 +-5.704685230097965E-002 -5.776631032038453E-002 -5.849489052363259E-002 -5.923271042630884E-002 +-5.997988912819360E-002 -6.073654733724437E-002 -6.150280739403369E-002 -6.227879329665596E-002 +-6.306463072611396E-002 -6.386044707219839E-002 -6.466637145987264E-002 -6.548253477617653E-002 +-6.630906969766226E-002 -6.714611071837623E-002 -6.799379417840262E-002 -6.885225829298224E-002 +-6.972164318222282E-002 -7.060209090141677E-002 -7.149374547198259E-002 -7.239675291304726E-002 +-7.331126127368713E-002 -7.423742066584500E-002 -7.517538329794322E-002 -7.612530350921083E-002 +-7.708733780474604E-002 -7.806164489133356E-002 -7.904838571403887E-002 -8.004772349360183E-002 +-8.105982376465068E-002 -8.208485441476203E-002 -8.312298572438974E-002 -8.417439040768850E-002 +-8.523924365425763E-002 -8.631772317183181E-002 -8.741000922994682E-002 -8.851628470460833E-002 +-8.963673512399388E-002 -9.077154871521746E-002 -9.192091645218914E-002 -9.308503210460163E-002 +-9.426409228807775E-002 -9.545829651551274E-002 -9.666784724964805E-002 -9.789294995691214E-002 +-9.913381316256800E-002 -1.003906485072054E-001 -1.016636708046188E-001 -1.029530981011128E-001 +-1.042591517362778E-001 -1.055820564052813E-001 -1.069220402227198E-001 -1.082793347880785E-001 +-1.096541752528483E-001 -1.110468003893493E-001 -1.124574526613131E-001 -1.138863782962769E-001 +-1.153338273598445E-001 -1.168000538318700E-001 -1.182853156846220E-001 -1.197898749629893E-001 +-1.213139978667872E-001 -1.228579548352295E-001 -1.244220206336290E-001 -1.260064744423935E-001 +-1.276115999483860E-001 -1.292376854387174E-001 -1.308850238970439E-001 -1.325539131024416E-001 +-1.342446557309335E-001 -1.359575594597437E-001 -1.376929370743595E-001 -1.394511065784771E-001 +-1.412323913069146E-001 -1.430371200415725E-001 -1.448656271305261E-001 -1.467182526103343E-001 +-1.485953423316499E-001 -1.504972480882186E-001 -1.524243277493532E-001 -1.543769453959716E-001 +-1.563554714602859E-001 -1.583602828692315E-001 -1.603917631917235E-001 -1.624503027898280E-001 +-1.645362989739358E-001 -1.666501561620226E-001 -1.687922860430782E-001 -1.709631077447902E-001 +-1.731630480055541E-001 -1.753925413508926E-001 -1.776520302743476E-001 -1.799419654229164E-001 +-1.822628057870914E-001 -1.846150188955544E-001 -1.869990810145756E-001 -1.894154773521514E-001 +-1.918647022669111E-001 -1.943472594818079E-001 -1.968636623025951E-001 -1.994144338410785E-001 +-2.020001072431170E-001 -2.046212259213242E-001 -2.072783437924062E-001 -2.099720255190439E-001 +-2.127028467562058E-001 -2.154713944017491E-001 -2.182782668511313E-001 -2.211240742560274E-001 +-2.240094387865988E-001 -2.269349948971280E-001 -2.299013895946779E-001 -2.329092827103884E-001 +-2.359593471729623E-001 -2.390522692838330E-001 -2.421887489934342E-001 -2.453695001779210E-001 +-2.485952509156050E-001 -2.518667437622771E-001 -2.551847360244934E-001 -2.585500000297910E-001 +-2.619633233926832E-001 -2.654255092751541E-001 -2.689373766402322E-001 -2.724997604970685E-001 +-2.761135121357864E-001 -2.797794993501758E-001 -2.834986066461208E-001 -2.872717354334319E-001 +-2.910998041985192E-001 -2.949837486551022E-001 -2.989245218698726E-001 -3.029230943597349E-001 +-3.069804541569373E-001 -3.110976068380590E-001 -3.152755755124536E-001 -3.195154007653510E-001 +-3.238181405503909E-001 -3.281848700259100E-001 -3.326166813287906E-001 -3.371146832791777E-001 +-3.416800010087784E-001 -3.463137755048688E-001 -3.510171630614762E-001 -3.557913346285091E-001 +-3.606374750488890E-001 -3.655567821729291E-001 -3.705504658383966E-001 -3.756197467037999E-001 +-3.807658549215216E-001 -3.859900286364248E-001 -3.912935122945462E-001 -3.966775547453858E-001 +-4.021434071201876E-001 -4.076923204674194E-001 -4.133255431254338E-001 -4.190443178110296E-001 +-4.248498784013307E-001 -4.307434463850680E-001 -4.367262269579837E-001 -4.427994047357393E-001 +-4.489641390563032E-001 -4.552215588424716E-001 -4.615727569938498E-001 -4.680187842763319E-001 +-4.745606426759467E-001 -4.811992781828329E-001 -4.879355729701533E-001 -4.947703369319728E-001 +-5.017042985435504E-001 -5.087380950072008E-001 -5.158722616468592E-001 -5.231072205148974E-001 +-5.304432681755521E-001 -5.378805626306629E-001 -5.454191093553998E-001 -5.530587464142778E-001 +-5.607991286312247E-001 -5.686397107918219E-001 -5.765797298611999E-001 -5.846181862076426E-001 +-5.927538238297301E-001 -6.009851095941415E-001 -6.093102115020456E-001 -6.177269760145572E-001 +-6.262329044821788E-001 -6.348251287395797E-001 -6.435003859457005E-001 -6.522549927700850E-001 +-6.610848190496581E-001 -6.699852610660313E-001 -6.789512146217691E-001 -6.879770481250581E-001 +-6.970565759257246E-001 -7.061830321814734E-001 -7.153490455714928E-001 -7.245466152147064E-001 +-7.337670881918321E-001 -7.430011391133066E-001 -7.522387522184913E-001 -7.614692065346628E-001 +-7.706810646659225E-001 -7.798621658213950E-001 -7.889996237273751E-001 -7.980798300978947E-001 +-8.070884643607642E-001 -8.160105103493632E-001 -8.248302806722073E-001 -8.335314494601376E-001 +-8.420970941622983E-001 -8.505097470143839E-001 -8.587514567329982E-001 -8.668038608960573E-001 +-8.746482693482243E-001 -8.822657588202533E-001 -8.896372787700573E-001 -8.967437682397958E-001 +-9.035662832769381E-001 -9.100861341881950E-001 -9.162850315848636E-001 -9.221452398391382E-001 +-9.276497362072043E-001 -9.327823734922971E-001 -9.375280437265628E-001 -9.418728399538999E-001 +-9.458042128082130E-001 -9.493111182159253E-001 -9.523841522236746E-001 -9.550156686795271E-001 +-9.571998752985827E-001 -9.589329035441962E-001 -9.602128477790933E-001 -9.610397693151301E-001 +-9.614156613486091E-001 -9.613443713473649E-001 -9.608314783005553E-001 -9.598841234046865E-001 +-9.585107943040048E-001 -9.567210650083779E-001 -9.545252961738170E-001 -9.519343036693255E-001 +-9.489590074148099E-001 -9.456100775360472E-001 -9.418976011563676E-001 -9.378308008798133E-001 +-9.334178455035781E-001 -9.286658050494701E-001 -9.235808161782386E-001 -9.181685240272081E-001 +-9.124346672815121E-001 -9.063852569373805E-001 -9.000265812905375E-001 -8.933651972288702E-001 +-8.864079211543512E-001 -8.791618195540069E-001 -8.716341992401537E-001 -8.638325972804719E-001 +-8.557647706387311E-001 -8.474386855471916E-001 -8.388625066317926E-001 -8.300445858112979E-001 +-8.209934509915079E-001 -8.117177945755601E-001 -8.022264618111686E-001 -7.925284389953879E-001 +-7.826328415572246E-001 -7.725489020380335E-001 -7.622859579892582E-001 -7.518534398066152E-001 +-7.412608585193257E-001 -7.305177935523908E-001 -7.196338804795396E-001 -7.086187987839754E-001 +-6.974822596432481E-001 -6.862339937531152E-001 -6.748837392071335E-001 -6.634412294464763E-001 +-6.519161812921658E-001 -6.403182830748725E-001 -6.286571828758163E-001 -6.169424768906004E-001 +-6.051836979285409E-001 -5.933903040596173E-001 -5.815716674209338E-001 -5.697370631944647E-001 +-5.578956587678775E-001 -5.460565030902808E-001 -5.342285162349870E-001 -5.224204791816369E-001 +-5.106410238304739E-001 -4.988986232620392E-001 -4.872015822561386E-001 -4.755580280846278E-001 +-4.639759015932273E-001 -4.524629485883729E-001 -4.410267115458403E-001 -4.296745216586190E-001 +-4.184134912422039E-001 -4.072505065160498E-001 -3.961922207804165E-001 -3.852450480081402E-001 +-3.744151568709697E-001 -3.637084652200142E-001 -3.531306350394680E-001 -3.426870678921376E-001 +-3.323829008743592E-001 -3.222230030966390E-001 -3.122119727048064E-001 -3.023541344545974E-001 +-2.926535378504534E-001 -2.831139558569095E-001 -2.737388841882912E-001 -2.645315411796233E-001 +-2.554948682386357E-001 -2.466315308756733E-001 -2.379439203051605E-001 -2.294341556091086E-001 +-2.211040864500630E-001 -2.129552963178687E-001 -2.049891062917855E-001 -1.972065792968104E-001 +-1.896085248306009E-001 -1.821955041352593E-001 -1.749678357863328E-001 -1.679256016697070E-001 +-1.610686533158945E-001 -1.543966185602531E-001 -1.479089084970032E-001 -1.416047246946264E-001 +-1.354830666402364E-001 -1.295427393808110E-001 -1.237823613297505E-001 -1.182003722080803E-001 +-1.127950410906814E-001 -1.075644745292310E-001 -1.025066247250119E-001 -9.761929772637561E-002 +-9.290016162741550E-002 -8.834675474625679E-002 -8.395649376330105E-002 -7.972668180172075E-002 +-7.565451643445957E-002 -7.173709760392825E-002 -6.797143544245289E-002 -6.435445798330858E-002 +-6.088301875382573E-002 -5.755390424355815E-002 -5.436384124183465E-002 -5.130950404015087E-002 +-4.838752149578891E-002 -4.559448395376196E-002 -4.292695002467038E-002 -4.038145321632737E-002 +-3.795450841707079E-002 -3.564261822854464E-002 -3.344227914542700E-002 -3.134998757912572E-002 +-2.936224572189615E-002 -2.747556724718178E-002 -2.568648284128348E-002 -2.399154556075709E-002 +-2.238733600925974E-002 -2.087046732694841E-002 -1.943758998500702E-002 -1.808539637747108E-002 +-1.681062520225208E-002 -1.561006562315273E-002 -1.448056120472325E-002 -1.341901361203996E-002 +-1.242238606789364E-002 -1.148770656044913E-002 -1.061207079517089E-002 -9.792644885689291E-003 +-9.026667779289439E-003 -8.311453413823064E-003 -7.644392604050288E-003 -7.022954656691624E-003 +-6.444688714788650E-003 -5.907224833311778E-003 -5.408274789294695E-003 -4.945632631096857E-003 +-4.517174972678681E-003 -4.120861040002922E-003 -3.754732477833842E-003 -3.416912926281437E-003 +-3.105607377419731E-003 -2.819101323187450E-003 -2.555759706550025E-003 -2.314025688558795E-003 +-2.092419244484218E-003 -1.889535602623816E-003 -1.704043539692937E-003 -1.534683546899826E-003 +-1.380265880888705E-003 -1.239668513710815E-003 -1.111834995858471E-003 -9.957722461778529E-004 +-8.905482821692504E-004 -7.952899037961990E-004 -7.091803434652691E-004 -6.314568943142122E-004 +-5.614085283659309E-004 -4.983735154775734E-004 -4.417370533461015E-004 -3.909289181319930E-004 +-3.454211445391222E-004 -3.047257434488394E-004 -2.683924644570308E-004 -2.360066099112674E-004 +-2.071869062974215E-004 -1.815834380872262E-004 -1.588756484355621E-004 -1.387704104137109E-004 +-1.210001717867296E-004 -1.053211756933396E-004 -9.151175896858470E-005 -7.937072926575233E-005 +-6.871582158695160E-005 -5.938223432302902E-005 -5.122124443446146E-005 -4.409890097627817E-005 +-3.789479578226268E-005 -3.250090977725960E-005 -2.782053307866084E-005 -2.376725678240842E-005 +-2.026403409981320E-005 -1.724230832029450E-005 -1.464120491945796E-005 -1.240678500998552E-005 +-1.049135724264854E-005 -8.852845204233458E-006 -7.454207326496869E-006 -6.262906311616602E-006 +-5.250425095428936E-006 -4.391826404818577E-006 -3.665353019334035E-006 -3.052065916632148E-006 +-2.535517564511026E-006 -2.101457716929248E-006 -1.737569175549195E-006 -1.433234972024142E-006 +-1.179357491821685E-006 -9.680938665870723E-007 -7.927290867435514E-007 -6.475320778847807E-007 +-5.276241994739592E-007 -4.288634664203718E-007 -3.477429142387355E-007 -2.813016549911503E-007 +-2.270472942132721E-007 -1.828884985162440E-007 -1.470766197071458E-007 -1.181553945943181E-007 +-9.491785098811248E-008 -7.603486099146203E-008 -6.073410786127121E-008 -4.837176407915130E-008 +-3.841268784305750E-008 -3.041339494730827E-008 -2.400746312748265E-008 -1.889306111012390E-008 +-1.482232723113169E-008 -1.159235260051945E-008 -9.037551449695847E-009 -7.023226576899051E-009 +-5.440160800729992E-009 -4.200086148670443E-009 -3.231901265310047E-009 -2.478524349420220E-009 +-1.894283950261378E-009 -1.442763303955301E-009 -1.095025702674240E-009 -8.281587931342607E-010 +-6.240848232695148E-010 -4.685918190766918E-010 -3.505475937514400E-010 -2.612644781650944E-010 +-1.939878181760678E-010 -1.434857055851085E-010 -1.057211835543121E-010 -7.759137431860347E-011 +-5.672068993476343E-011 -4.129757138190283E-011 -2.994611644402046E-011 -2.162555489045767E-011 +-1.555185688846692E-011 -1.113685809016018E-011 -7.941188043387116E-012 -5.638028409742083E-012 +-3.985330634925237E-012 -2.804612126603285E-012 -1.964845211652283E-012 -1.370270763247127E-012 +-9.512224083674265E-013 -6.572493907689925E-013 -4.519862671303540E-013 -3.093437767727042E-013 +-2.106941451477993E-013 -1.428012490661483E-013 -9.630596371270093E-014 -6.462325628976713E-014 +-4.314311296477770E-014 -2.865452803592299E-014 -1.893241385479927E-014 -1.244288593339210E-014 +-8.134104444331886E-015 -5.288622806239492E-015 -3.419715906695803E-015 -2.198983844709001E-015 +-1.406074188714829E-015 -8.939595120262020E-016 -5.650927334900892E-016 -3.551258659022150E-016 +-2.218572638311016E-016 -1.377721435676700E-016 -8.503796136219608E-017 -5.216686759251185E-017 +-3.180340289702899E-017 -1.926705458191300E-017 -1.159806494042019E-017 -6.936643094270080E-018 +-4.121653351938615E-018 -2.432854448553694E-018 -1.426419090802075E-018 -8.306687184753300E-019 +-4.804200806911277E-019 -2.759239815798463E-019 -1.573601245826465E-019 -8.910423503063960E-020 +-5.009119545481726E-020 -2.795402398384776E-020 -1.548485530383899E-020 -8.513523557661048E-021 +-4.645258505188724E-021 -2.515169469966510E-021 -1.351261436236241E-021 -7.202507037771764E-022 +-3.808527169232365E-022 -1.997633533469661E-022 -1.039239783603225E-022 -5.361818660994457E-023 +-2.743213203276870E-023 -1.391592834130658E-023 -6.998798770266476E-024 -3.489365543082186E-024 +-1.724381727479561E-024 -8.445708424253111E-025 -4.099261481041813E-025 -1.971480786761189E-025 +-9.393918048290111E-026 -4.434223173923008E-026 -2.073258825278866E-026 -9.600695163851284E-027 +-4.402631669600770E-027 -1.999075569706327E-027 -8.986679546084488E-028 -3.999151024053201E-028 +-1.761487206505863E-028 -7.678533022386660E-029 -3.312129627341331E-029 -1.413543630349794E-029 +-5.967957584269283E-030 -2.492286225850680E-030 -1.029357200904571E-030 -4.204069307679108E-031 +-1.697649413446130E-031 -6.777016909086675E-032 -2.674107196085949E-032 -1.042810055079195E-032 +-4.018402491164044E-033 -1.529883459917130E-033 -5.753789899913789E-034 -2.137339932786416E-034 +-7.840604102092595E-035 -2.839967044606395E-035 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + + + 7.665845577818094E-008 7.859907375502957E-008 8.058881870625926E-008 8.262893428696254E-008 + 8.472069563550108E-008 8.686541017050790E-008 8.906441840806580E-008 9.131909479957289E-008 + 9.363084859081834E-008 9.600112470280620E-008 9.843140463487711E-008 1.009232073906926E-007 + 1.034780904276607E-007 1.060976506303967E-007 1.087835253088270E-007 1.115373932215592E-007 + 1.143609756251604E-007 1.172560373499968E-007 1.202243879033090E-007 1.232678826002116E-007 + 1.263884237233236E-007 1.295879617117556E-007 1.328684963801961E-007 1.362320781688588E-007 + 1.396808094250734E-007 1.432168457173177E-007 1.468423971825173E-007 1.505597299074503E-007 + 1.543711673451233E-007 1.582790917670029E-007 1.622859457520098E-007 1.663942337132082E-007 + 1.706065234631419E-007 1.749254478187987E-007 1.793537062472033E-007 1.838940665526687E-007 + 1.885493666067606E-007 1.933225161220564E-007 1.982164984708058E-007 2.032343725496321E-007 + 2.083792746914379E-007 2.136544206257113E-007 2.190631074884557E-007 2.246087158830036E-007 + 2.302947119929987E-007 2.361246497488672E-007 2.421021730491347E-007 2.482310180379762E-007 + 2.545150154404207E-007 2.609580929566736E-007 2.675642777170493E-007 2.743376987990522E-007 + 2.812825898081767E-007 2.884032915240410E-007 2.957042546135067E-007 3.031900424124816E-007 + 3.108653337781444E-007 3.187349260133733E-007 3.268037378652056E-007 3.350768125992052E-007 + 3.435593211516544E-007 3.522565653615474E-007 3.611739812843983E-007 3.703171425899414E-007 + 3.796917640458416E-007 3.893037050895951E-007 3.991589734908541E-007 4.092637291064621E-007 + 4.196242877305486E-007 4.302471250420881E-007 4.411388806523919E-007 4.523063622550611E-007 + 4.637565498809960E-007 4.754966002611220E-007 4.875338512995566E-007 4.998758266600134E-007 + 5.125302404683146E-007 5.255050021339406E-007 5.388082212936422E-007 5.524482128802000E-007 + 5.664335023194938E-007 5.807728308591428E-007 5.954751610320351E-007 6.105496822581647E-007 + 6.260058165882842E-007 6.418532245929505E-007 6.581018114006565E-007 6.747617328888145E-007 + 6.918434020314665E-007 7.093574954076821E-007 7.273149598747164E-007 7.457270194101004E-007 + 7.646051821269374E-007 7.839612474667863E-007 8.038073135746409E-007 8.241557848605929E-007 + 8.450193797529268E-007 8.664111386474821E-007 8.883444320582464E-007 9.108329689742843E-007 + 9.338908054282157E-007 9.575323532816102E-007 9.817723892327777E-007 1.006626064052585E-006 + 1.032108912054083E-006 1.058236860801849E-006 1.085026241067120E-006 1.112493797034941E-006 + 1.140656696769699E-006 1.169532542945594E-006 1.199139383848741E-006 1.229495724657797E-006 + 1.260620539010148E-006 1.292533280860885E-006 1.325253896642002E-006 1.358802837729378E-006 + 1.393201073225370E-006 1.428470103064996E-006 1.464631971453880E-006 1.501709280646393E-006 + 1.539725205072563E-006 1.578703505822614E-006 1.618668545498167E-006 1.659645303439402E-006 + 1.701659391337678E-006 1.744737069243382E-006 1.788905261979013E-006 1.834191575967749E-006 + 1.880624316488023E-006 1.928232505364894E-006 1.977045899109251E-006 2.027095007516207E-006 + 2.078411112734309E-006 2.131026288817461E-006 2.184973421771801E-006 2.240286230110033E-006 + 2.296999285926109E-006 2.355148036503370E-006 2.414768826469703E-006 2.475898920513528E-006 + 2.538576526674820E-006 2.602840820225746E-006 2.668731968155786E-006 2.736291154276705E-006 + 2.805560604963033E-006 2.876583615544113E-006 2.949404577364269E-006 3.024069005527973E-006 + 3.100623567347343E-006 3.179116111509772E-006 3.259595697983899E-006 3.342112628682614E-006 + 3.426718478902275E-006 3.513466129557763E-006 3.602409800233547E-006 3.693605083071373E-006 + 3.787108977515799E-006 3.882979925939263E-006 3.981277850168955E-006 4.082064188938316E-006 + 4.185401936286577E-006 4.291355680930314E-006 4.399991646631680E-006 4.511377733588424E-006 + 4.625583560871719E-006 4.742680509938168E-006 4.862741769243310E-006 4.985842379984391E-006 + 5.112059283001068E-006 5.241471366863320E-006 5.374159517176597E-006 5.510206667135079E-006 + 5.649697849354562E-006 5.792720249017394E-006 5.939363258362709E-006 6.089718532555913E-006 + 6.243880046972453E-006 6.401944155931558E-006 6.564009652916709E-006 6.730177832320453E-006 + 6.900552552752144E-006 7.075240301948204E-006 7.254350263325373E-006 7.437994384218608E-006 + 7.626287445846283E-006 7.819347135046295E-006 8.017294117828103E-006 8.220252114786410E-006 + 8.428347978423775E-006 8.641711772430475E-006 8.860476852970967E-006 9.084779952028033E-006 + 9.314761262856376E-006 9.550564527599255E-006 9.792337127122880E-006 1.004023017312461E-005 + 1.029439860257256E-005 1.055500127453561E-005 1.082220106946427E-005 1.109616499098463E-005 + 1.137706427026849E-005 1.166507447304566E-005 1.196037560932439E-005 1.226315224588923E-005 + 1.257359362164619E-005 1.289189376588728E-005 1.321825161954848E-005 1.355287115953675E-005 + 1.389596152620380E-005 1.424773715404625E-005 1.460841790571373E-005 1.497822920940884E-005 + 1.535740219976451E-005 1.574617386228707E-005 1.614478718145500E-005 1.655349129256584E-005 + 1.697254163742657E-005 1.740220012398394E-005 1.784273528999514E-005 1.829442247084069E-005 + 1.875754397158434E-005 1.923238924338770E-005 1.971925506438940E-005 2.021844572516209E-005 + 2.073027321886294E-005 2.125505743619629E-005 2.179312636531046E-005 2.234481629675338E-005 + 2.291047203361483E-005 2.349044710698710E-005 2.408510399687781E-005 2.469481435871375E-005 + 2.531995925557608E-005 2.596092939631298E-005 2.661812537967776E-005 2.729195794464479E-005 + 2.798284822706016E-005 2.869122802278655E-005 2.941754005750705E-005 3.016223826335633E-005 + 3.092578806255149E-005 3.170866665820024E-005 3.251136333246738E-005 3.333437975228585E-005 + 3.417823028280345E-005 3.504344230876052E-005 3.593055656399916E-005 3.684012746930993E-005 + 3.777272347882662E-005 3.872892743518532E-005 3.970933693366951E-005 4.071456469556821E-005 + 4.174523895098019E-005 4.280200383130345E-005 4.388551977165419E-005 4.499646392346700E-005 + 4.613553057753321E-005 4.730343159774157E-005 4.850089686579174E-005 4.972867473715774E-005 + 5.098753250858641E-005 5.227825689742175E-005 5.360165453305440E-005 5.495855246080287E-005 + 5.634979865854045E-005 5.777626256639033E-005 5.923883562981877E-005 6.073843185646511E-005 + 6.227598838705590E-005 6.385246608075901E-005 6.546885011534261E-005 6.712615060251298E-005 + 6.882540321881468E-005 7.056766985248653E-005 7.235403926667659E-005 7.418562777942860E-005 + 7.606357996086488E-005 7.798906934799866E-005 7.996329917762250E-005 8.198750313772851E-005 + 8.406294613792833E-005 8.619092509935366E-005 8.837276976452815E-005 9.060984352771546E-005 + 9.290354428626123E-005 9.525530531345749E-005 9.766659615347429E-005 1.001389235389148E-004 + 1.026738323315655E-004 1.052729064869269E-004 1.079377700431242E-004 1.106700881348145E-004 + 1.134715680327206E-004 1.163439602094376E-004 1.192890594321772E-004 1.223087058831258E-004 + 1.254047863081169E-004 1.285792351943300E-004 1.318340359777480E-004 1.351712222811242E-004 + 1.385928791832278E-004 1.421011445201588E-004 1.456982102195367E-004 1.493863236683960E-004 + 1.531677891156357E-004 1.570449691098942E-004 1.610202859737434E-004 1.650962233151153E-004 + 1.692753275769024E-004 1.735602096256898E-004 1.779535463806077E-004 1.824580824833145E-004 + 1.870766320101436E-004 1.918120802274800E-004 1.966673853914516E-004 2.016455805930524E-004 + 2.067497756498414E-004 2.119831590453876E-004 2.173489999176651E-004 2.228506500976287E-004 + 2.284915461992305E-004 2.342752117621743E-004 2.402052594487325E-004 2.462853932959856E-004 + 2.525194110248763E-004 2.589112064075063E-004 2.654647716941423E-004 2.721842001014254E-004 + 2.790736883633295E-004 2.861375393464367E-004 2.933801647311502E-004 3.008060877604971E-004 + 3.084199460582186E-004 3.162264945178863E-004 3.242306082648266E-004 3.324372856926803E-004 + 3.408516515764660E-004 3.494789602640685E-004 3.583245989481158E-004 3.673940910202609E-004 + 3.766930995099327E-004 3.862274306096670E-004 3.960030372891912E-004 4.060260230004837E-004 + 4.163026454760795E-004 4.268393206229595E-004 4.376426265144125E-004 4.487193074823195E-004 + 4.600762783123658E-004 4.717206285447627E-004 4.836596268831028E-004 4.959007257140523E-004 + 5.084515657406537E-004 5.213199807320611E-004 5.345140023926209E-004 5.480418653532712E-004 + 5.619120122883032E-004 5.761330991606169E-004 5.907140005986596E-004 6.056638154083323E-004 + 6.209918722232226E-004 6.367077352965939E-004 6.528212104386643E-004 6.693423511027813E-004 + 6.862814646241905E-004 7.036491186151821E-004 7.214561475204959E-004 7.397136593369630E-004 + 7.584330425014444E-004 7.776259729512414E-004 7.973044213612473E-004 8.174806605622047E-004 + 8.381672731445571E-004 8.593771592524673E-004 8.811235445727077E-004 9.034199885232317E-004 + 9.262803926463344E-004 9.497190092114670E-004 9.737504500328494E-004 9.983896955071711E-004 + 1.023652103876800E-003 1.049553420724025E-003 1.076109788702012E-003 1.103337757508283E-003 + 1.131254294106656E-003 1.159876793203726E-003 1.189223087986135E-003 1.219311461124969E-003 + 1.250160656053855E-003 1.281789888527381E-003 1.314218858466717E-003 1.347467762099406E-003 + 1.381557304400489E-003 1.416508711842271E-003 1.452343745460242E-003 1.489084714242809E-003 + 1.526754488852669E-003 1.565376515687860E-003 1.604974831290682E-003 1.645574077112896E-003 + 1.687199514645767E-003 1.729877040923753E-003 1.773633204410792E-003 1.818495221278398E-003 + 1.864490992084923E-003 1.911649118865606E-003 1.959998922643221E-003 2.009570461369329E-003 + 2.060394548306430E-003 2.112502770861452E-003 2.165927509881323E-003 2.220701959421548E-003 + 2.276860146998988E-003 2.334436954340269E-003 2.393468138637469E-003 2.453990354323055E-003 + 2.516041175376208E-003 2.579659118172986E-003 2.644883664893037E-003 2.711755287495827E-003 + 2.780315472279618E-003 2.850606745036722E-003 2.922672696818806E-003 2.996558010326347E-003 + 3.072308486936580E-003 3.149971074384632E-003 3.229593895112742E-003 3.311226275302832E-003 + 3.394918774608007E-003 3.480723216598775E-003 3.568692719940219E-003 3.658881730316523E-003 + 3.751346053119657E-003 3.846142886919362E-003 3.943330857731782E-003 4.042970054104544E-003 + 4.145122063036307E-003 4.249850006749174E-003 4.357218580332682E-003 4.467294090278448E-003 + 4.580144493924742E-003 4.695839439830812E-003 4.814450309100837E-003 4.936050257678019E-003 + 5.060714259629381E-003 5.188519151442292E-003 5.319543677354139E-003 5.453868535736681E-003 + 5.591576426557155E-003 5.732752099938386E-003 5.877482405840489E-003 6.025856344887143E-003 + 6.177965120359545E-003 6.333902191381683E-003 6.493763327320647E-003 6.657646663426045E-003 + 6.825652757732927E-003 6.997884649252809E-003 7.174447917477673E-003 7.355450743221994E-003 + 7.541003970828204E-003 7.731221171761058E-003 7.926218709616647E-003 8.126115806571958E-003 + 8.331034611301087E-003 8.541100268384189E-003 8.756440989235642E-003 8.977188124577574E-003 + 9.203476238485430E-003 9.435443184031979E-003 9.673230180556177E-003 9.916981892583429E-003 + 1.016684651042363E-002 1.042297583247312E-002 1.068552534924690E-002 1.095465432916686E-002 + 1.123052590613177E-002 1.151330716889449E-002 1.180316925227138E-002 1.210028743020859E-002 + 1.240484121072941E-002 1.271701443278645E-002 1.303699536504154E-002 1.336497680659586E-002 + 1.370115618969192E-002 1.404573568440823E-002 1.439892230536650E-002 1.476092802047021E-002 + 1.513196986169240E-002 1.551227003792912E-002 1.590205604993377E-002 1.630156080734609E-002 + 1.671102274782784E-002 1.713068595831576E-002 1.756080029840019E-002 1.800162152583623E-002 + 1.845341142419149E-002 1.891643793263275E-002 1.939097527785098E-002 1.987730410812164E-002 + 2.037571162949427E-002 2.088649174410215E-002 2.140994519057961E-002 2.194637968657111E-002 + 2.249611007331228E-002 2.305945846225881E-002 2.363675438373562E-002 2.422833493757292E-002 + 2.483454494569188E-002 2.545573710659706E-002 2.609227215172702E-002 2.674451900360889E-002 + 2.741285493575610E-002 2.809766573424257E-002 2.879934586087860E-002 2.951829861790682E-002 + 3.025493631412889E-002 3.100968043236422E-002 3.178296179813465E-002 3.257522074945809E-002 + 3.338690730762529E-002 3.421848134882293E-002 3.507041277645535E-002 3.594318169400511E-002 + 3.683727857826129E-002 3.775320445272989E-002 3.869147106102842E-002 3.965260104005155E-002 + 4.063712809267959E-002 4.164559715978541E-002 4.267856459127930E-002 4.373659831591253E-002 + 4.482027800954212E-002 4.593019526153991E-002 4.706695373900874E-002 4.823116934844586E-002 + 4.942347039447200E-002 5.064449773522049E-002 5.189490493395587E-002 5.317535840646507E-002 + 5.448653756373736E-002 5.582913494941994E-002 5.720385637150691E-002 5.861142102768711E-002 + 6.005256162374450E-002 6.152802448436957E-002 6.303856965570503E-002 6.458497099891178E-002 + 6.616801627400209E-002 6.778850721314644E-002 6.944725958261797E-002 7.114510323249472E-002 + 7.288288213319458E-002 7.466145439786916E-002 7.648169228963463E-002 7.834448221256564E-002 + 8.025072468532488E-002 8.220133429624706E-002 8.419723963863761E-002 8.623938322498852E-002 + 8.832872137875170E-002 9.046622410224822E-002 9.265287491922673E-002 9.488967069051711E-002 + 9.717762140115631E-002 9.951774991729473E-002 1.019110917111163E-001 1.043586945519326E-001 + 1.068616181615363E-001 1.094209338318197E-001 1.120377240025865E-001 1.147130817974062E-001 + 1.174481105152737E-001 1.202439230757616E-001 1.231016414152637E-001 1.260223958318478E-001 + 1.290073242761499E-001 1.320575715856594E-001 1.351742886596608E-001 1.383586315720151E-001 + 1.416117606188822E-001 1.449348392984068E-001 1.483290332193101E-001 1.517955089352606E-001 + 1.553354327018188E-001 1.589499691526909E-001 1.626402798919591E-001 1.664075219989039E-001 + 1.702528464419823E-001 1.741773963984853E-001 1.781823054763667E-001 1.822686958347090E-001 + 1.864376761992876E-001 1.906903397696904E-001 1.950277620144694E-001 1.994509983508329E-001 + 2.039610817054368E-001 2.085590199529010E-001 2.132457932287719E-001 2.180223511137642E-001 + 2.228896096862560E-001 2.278484484401818E-001 2.328997070656661E-001 2.380441820899775E-001 + 2.432826233766465E-001 2.486157304809067E-001 2.540441488599661E-001 2.595684659370132E-001 + 2.651892070183077E-001 2.709068310632072E-001 2.767217263075266E-001 2.826342057412518E-001 + 2.886445024422921E-001 2.947527647687105E-001 3.009590514126734E-001 3.072633263202531E-001 + 3.136654534821802E-001 3.201651916016834E-001 3.267621886466885E-001 3.334559762948593E-001 + 3.402459642812705E-001 3.471314346599030E-001 3.541115359916371E-001 3.611852774730137E-001 + 3.683515230217148E-001 3.756089853364961E-001 3.829562199511769E-001 3.903916193042677E-001 + 3.979134068478783E-001 4.055196312216885E-001 4.132081605200043E-001 4.209766766822230E-001 + 4.288226700393940E-001 4.367434340519974E-001 4.447360602765256E-001 4.527974336009458E-001 + 4.609242277916236E-001 4.691129013967908E-001 4.773596940540922E-001 4.856606232521545E-001 + 4.940114815984308E-001 5.024078346477732E-001 5.108450193482199E-001 5.193181431623477E-001 + 5.278220839241243E-001 5.363514904925549E-001 5.449007842644066E-001 5.534641616089078E-001 + 5.620355972875278E-001 5.706088489216128E-001 5.791774625698047E-001 5.877347794757054E-001 + 5.962739440440749E-001 6.047879131009948E-001 6.132694664897032E-001 6.217112190492741E-001 + 6.301056340178318E-001 6.384450378955052E-001 6.467216367948684E-001 6.549275342980052E-001 + 6.630547508296766E-001 6.710952445452277E-001 6.790409337198507E-001 6.868837206126970E-001 + 6.946155167649676E-001 7.022282696756653E-001 7.097139907821443E-001 7.170647846549725E-001 + 7.242728792981332E-001 7.313306574261527E-001 7.382306885696783E-001 7.449657618403384E-001 + 7.515289191646530E-001 7.579134887755096E-001 7.641131187284723E-001 7.701218101892403E-001 + 7.759339502181669E-001 7.815443437581194E-001 7.869482445135428E-001 7.921413843915441E-001 + 7.971200011606017E-001 8.018808639694039E-001 8.064212963576444E-001 8.107391963828360E-001 + 8.148330534824906E-001 8.187019616899143E-001 8.223456288245777E-001 8.257643812849331E-001 + 8.289591640830704E-001 8.319315357769358E-001 8.346836579774983E-001 8.372182791355227E-001 + 8.395387123458663E-001 8.416488069470521E-001 8.435529137405722E-001 8.452558437087386E-001 + 8.467628201724258E-001 8.480794244015744E-001 8.492115347728298E-001 8.501652596610415E-001 + 8.509468643558958E-001 8.515626924128870E-001 8.520190819805585E-001 8.523222777949709E-001 + 8.524783396989162E-001 8.524930487288551E-001 8.523718120175968E-001 8.521195679855572E-001 + 8.517406935373382E-001 8.512389152409462E-001 8.506172267401988E-001 8.498778149297702E-001 + 8.490219976965759E-001 8.480501762860863E-001 8.469618055672306E-001 8.457553856177569E-001 + 8.444284780978958E-001 8.429777507789424E-001 8.413990532888892E-001 8.396875265605782E-001 + 8.378377475360044E-001 8.358439092945040E-001 8.337000348163542E-001 8.314002199317713E-001 + 8.289388974818536E-001 8.263111101525510E-001 8.235127736265376E-001 8.205409043878643E-001 + 8.173937774235414E-001 8.140709678514479E-001 8.105732167495573E-001 8.069020591572043E-001 + 8.030593216888513E-001 7.990469613981120E-001 7.948670519901674E-001 7.905217812728413E-001 + 7.860134485042608E-001 7.813444616448012E-001 7.765173345210473E-001 7.715346839094472E-001 + 7.663992265472731E-001 7.611137760783988E-001 7.556812399412131E-001 7.501046162058302E-001 + 7.443869903674818E-001 7.385315321027277E-001 7.325414919947744E-001 7.264201982338454E-001 + 7.201710532981421E-001 7.137975306204994E-001 7.073031712453672E-001 7.006915804802668E-001 + 6.939664245453039E-001 6.871314272237905E-001 6.801903665163067E-001 6.731470713004929E-001 + 6.660054179976148E-001 6.587693272456999E-001 6.514427605807138E-001 6.440297171250563E-001 + 6.365342302803474E-001 6.289603644242312E-001 6.213122116093053E-001 6.135938882605348E-001 + 6.058095318681186E-001 5.979632976722536E-001 5.900593553359242E-001 5.821018856016384E-001 + 5.740950769279818E-001 5.660431221018718E-001 5.579502148225983E-001 5.498205462540190E-001 + 5.416583015417792E-001 5.334676562930365E-001 5.252527730169469E-001 5.170177975251524E-001 + 5.087668552925647E-001 5.005040477800344E-001 4.922334487218433E-001 4.839591003824619E-001 + 4.756850097886066E-001 4.674151449442462E-001 4.591534310378986E-001 4.509037466532046E-001 + 4.426699199953573E-001 4.344557251475037E-001 4.262648783725879E-001 4.181010344773167E-001 + 4.099677832559236E-001 4.018686460321251E-001 3.938070723181463E-001 3.857864366098324E-001 + 3.778100353367078E-001 3.698810839853502E-001 3.620027144136282E-001 3.541779723722111E-001 + 3.464098152483032E-001 3.387011100448278E-001 3.310546316062981E-001 3.234730611003961E-001 + 3.159589847618996E-001 3.085148929030589E-001 3.011431791919026E-001 2.938461401972797E-001 + 2.866259751967215E-001 2.794847862406287E-001 2.724245784637051E-001 2.654472606319701E-001 + 2.585546459115124E-001 2.517484528429970E-001 2.450303065039318E-001 2.384017398390409E-001 + 2.318641951376308E-001 2.254190256356494E-001 2.190674972192267E-001 2.128107902058801E-001 + 2.066500011792592E-001 2.005861448533150E-001 1.946201559421062E-001 1.887528910121040E-001 + 1.829851302948407E-001 1.773175794390326E-001 1.717508711829252E-001 1.662855669295232E-001 + 1.609221582095523E-001 1.556610680194724E-001 1.505026520245352E-001 1.454471996197649E-001 + 1.404949348447740E-001 1.356460171514417E-001 1.309005420266662E-001 1.262585414755402E-001 + 1.217199843733792E-001 1.172847766979537E-001 1.129527616559881E-001 1.087237197204416E-001 + 1.045973685972039E-001 1.005733631415905E-001 9.665129524637017E-002 9.283069372395293E-002 + 8.911102420583181E-002 8.549168908236296E-002 8.197202750552574E-002 7.855131547642989E-002 + 7.522876603806726E-002 7.200352959218535E-002 6.887469435722601E-002 6.584128698208899E-002 + 6.290227332809845E-002 6.005655942902325E-002 5.730299263640035E-002 5.464036295477426E-002 + 5.206740456885953E-002 4.958279756209537E-002 4.718516982363710E-002 4.487309913855610E-002 + 4.264511545391887E-002 4.049970331151843E-002 3.843530443634689E-002 3.645032046843749E-002 + 3.454311582447758E-002 3.271202067458982E-002 3.095533401890561E-002 2.927132684799373E-002 + 2.765824537085235E-002 2.611431429401181E-002 2.463774013530992E-002 2.322671455607900E-002 + 2.187941769580774E-002 2.059402149379099E-002 1.936869298284621E-002 1.820159754083533E-002 + 1.709090208647318E-002 1.603477820671338E-002 1.503140520386379E-002 1.407897305148863E-002 + 1.317568524908567E-002 1.231976156647928E-002 1.150944066983129E-002 1.074298262213307E-002 + 1.001867125199855E-002 9.334816385519761E-003 8.689755936870365E-003 8.081857854241981E-003 + 7.509521918569348E-003 6.971181393339760E-003 6.465304524586077E-003 5.990395890929348E-003 + 5.544997604263568E-003 5.127690362360200E-003 4.737094355312701E-003 4.371870028339719E-003 + 4.030718704020124E-003 3.712383067542550E-003 3.415647519016873E-003 3.139338397315258E-003 + 2.882324080285969E-003 2.643514966515268E-003 2.421863344101450E-003 2.216363152151600E-003 + 2.026049640917158E-003 1.849998936649522E-003 1.687327517383463E-003 1.537191605944728E-003 + 1.398786486529073E-003 1.271345751236721E-003 1.154140482891915E-003 1.046478380474082E-003 + 9.477028333932470E-004 8.571919507436638E-004 7.743575515435820E-004 6.986441218188300E-004 + 6.295277442159047E-004 5.665150056366306E-004 5.091418881989111E-004 4.569726485571144E-004 + 4.095986904270582E-004 3.666374348885819E-004 3.277311927836293E-004 2.925460432626300E-004 + 2.607707222606449E-004 2.321155244106597E-004 2.063112216398754E-004 1.831084964287518E-004 + 1.622808212987347E-004 1.436138682814248E-004 1.269093213725300E-004 1.119844867543084E-004 + 9.867134522126673E-005 8.681564161201218E-005 7.627601224021512E-005 6.692315121768971E-005 + 5.863901648117145E-005 5.131607628390857E-005 4.485659689741043E-005 3.917197229997181E-005 + 3.418209671117872E-005 2.981478097980356E-005 2.600521405957843E-005 2.264235810686479E-005 + 1.967911078948544E-005 1.707268946209148E-005 1.478430803601421E-005 1.277887047664681E-005 + 1.102468079733011E-005 9.493169344289565E-006 8.158635099126459E-006 6.998003663833427E-006 + 5.990600538332791E-006 5.117939252123248E-006 4.363523869697761E-006 3.712665353843395E-006 + 3.152311241579547E-006 2.670888064114003E-006 2.258155924539304E-006 1.905074634756673E-006 + 1.603680805976580E-006 1.346975284752027E-006 1.128820328483141E-006 9.438459203045262E-007 + 7.873646328387712E-007 6.552944630714146E-007 5.440890761835351E-007 4.506749141733107E-007 + 3.723946451312487E-007 3.069564507363943E-007 2.523886725625801E-007 2.069993617931601E-007 + 1.693403016292659E-007 1.381750967532339E-007 1.124509494124934E-007 9.127376678218614E-008 + 7.388626903504656E-008 5.964879180831758E-008 4.802250034874744E-008 3.855475540198857E-008 + 3.086639277973748E-008 2.464069939728511E-008 1.961388835768030E-008 1.556689431821548E-008 + 1.231832788039394E-008 9.718444082370497E-009 7.643995244230443E-009 5.993852435425499E-009 + 4.685292725419767E-009 3.650861177701284E-009 2.835727296130231E-009 2.195465379636327E-009 + 1.694197039769536E-009 1.303042042127807E-009 9.988307059456911E-010 7.630373958761852E-010 + 5.809002260612961E-010 4.406970280365319E-010 3.331519684707155E-010 2.509509957954725E-010 + 1.883475995294562E-010 1.408432328119249E-010 1.049292244965940E-010 7.787913603162730E-011 + 5.758234083600840E-011 4.241115718879405E-011 3.111518367133702E-011 2.273759960992745E-011 + 1.654912932217883E-011 1.199615289436188E-011 8.660099561380144E-012 6.225801804938767E-012 + 4.456935934997816E-012 3.177042913226915E-012 2.254924288500201E-012 1.593453350347535E-012 + 1.121040396905728E-012 7.851513927148686E-013 5.474080635022485E-013 3.799003715141809E-013 + 2.624241365304021E-013 1.804213125568504E-013 1.234514094982611E-013 8.406248969327576E-014 + 5.696130405120588E-014 3.840627996577907E-014 2.576570546069773E-014 1.719775647002971E-014 + 1.141993565744167E-014 7.543787000931954E-015 4.957018224268122E-015 3.239873334537814E-015 + 2.106117916343675E-015 1.361616541661726E-015 8.754158742394170E-016 5.596687774791476E-016 + 3.557738496160280E-016 2.248599350334098E-016 1.412907380306521E-016 8.825654175498248E-017 + 5.479984892717239E-017 3.382036544443760E-017 2.074486131787533E-017 1.264568878210174E-017 + 7.660200609161282E-018 4.610723270078356E-018 2.757365629964819E-018 1.638252103412378E-018 + 9.669242036342996E-019 5.668827549080152E-019 3.301007551131498E-019 1.909040442031113E-019 + 1.096380980150992E-019 6.252411483171713E-020 3.540256837295189E-020 1.990142283583697E-020 + 1.110596017813807E-020 6.151920545371780E-021 3.382263467019624E-021 1.845462581313459E-021 + 9.992234346395062E-022 5.368308675522184E-022 2.861457270940119E-022 1.513104237251728E-022 + 7.936674415213993E-023 4.129069625983690E-023 2.130418896870418E-023 1.090012891082889E-023 + 5.529758859420384E-024 2.781263951573173E-024 1.386732250404776E-024 6.853458205683369E-025 + 3.356954194190725E-025 1.629486246061723E-025 7.837474650878181E-026 3.734837175185186E-026 + 1.763138984248185E-026 8.244596671147523E-027 3.818284346403259E-027 1.751178618350454E-027 + 7.952480813317832E-028 3.575450974909615E-028 1.591330432405223E-028 7.010288551009714E-029 + 3.056337796645827E-029 1.318560263225846E-029 5.628262132627767E-030 2.376655069223483E-030 + 9.926966959452249E-031 4.100774711915087E-031 1.675150154163590E-031 6.765795898176817E-032 + 2.701465446675277E-032 1.066185055110814E-032 4.158674216369998E-033 1.602883773223423E-033 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + + + + 3.609136560465641E-008 3.700502349847288E-008 3.794181078396430E-008 3.890231298610786E-008 + 3.988713045260043E-008 4.089687872910136E-008 4.193218894397555E-008 4.299370820277606E-008 + 4.408209999271373E-008 4.519804459736596E-008 4.634223952188454E-008 4.751539992896743E-008 + 4.871825908586781E-008 4.995156882271954E-008 5.121610000246571E-008 5.251264300268332E-008 + 5.384200820960607E-008 5.520502652465381E-008 5.660254988378530E-008 5.803545178999899E-008 + 5.950462785931374E-008 6.101099638057250E-008 6.255549888941781E-008 6.413910075679799E-008 + 6.576279179237154E-008 6.742758686318798E-008 6.913452652803088E-008 7.088467768782046E-008 + 7.267913425248152E-008 7.451901782469357E-008 7.640547840095154E-008 7.833969509037485E-008 + 8.032287685171279E-008 8.235626324900934E-008 8.444112522639876E-008 8.657876590251505E-008 + 8.877052138501412E-008 9.101776160571547E-008 9.332189117688770E-008 9.568435026921260E-008 + 9.810661551197452E-008 1.005902009160404E-007 1.031366588202071E-007 1.057475808615058E-007 + 1.084245989700724E-007 1.111693863892033E-007 1.139836587212372E-007 1.168691749999141E-007 + 1.198277387898842E-007 1.228611993140515E-007 1.259714526094591E-007 1.291604427124371E-007 + 1.324301628737568E-007 1.357826568045469E-007 1.392200199537540E-007 1.427444008179427E-007 + 1.463580022842595E-007 1.500630830073941E-007 1.538619588214025E-007 1.577570041872742E-007 + 1.617506536771467E-007 1.658454034960982E-007 1.700438130424659E-007 1.743485065076710E-007 + 1.787621745165451E-007 1.832875758091859E-007 1.879275389653947E-007 1.926849641727740E-007 + 1.975628250395861E-007 2.025641704535135E-007 2.076921264874768E-007 2.129498983537038E-007 + 2.183407724072759E-007 2.238681182003968E-007 2.295353905886745E-007 2.353461318907275E-007 + 2.413039741024739E-007 2.474126411674809E-007 2.536759513047950E-007 2.600978193957126E-007 + 2.666822594309794E-007 2.734333870199497E-007 2.803554219632770E-007 2.874526908907423E-007 + 2.947296299658711E-007 3.021907876590275E-007 3.098408275907220E-007 3.176845314469127E-007 + 3.257268019681187E-007 3.339726660142199E-007 3.424272777068541E-007 3.510959216513808E-007 + 3.599840162404289E-007 3.690971170410852E-007 3.784409202678549E-007 3.880212663435526E-007 + 3.978441435503631E-007 4.079156917733456E-007 4.182422063387331E-007 4.288301419494155E-007 + 4.396861167200765E-007 4.508169163145097E-007 4.622294981876918E-007 4.739309959352753E-007 + 4.859287237532246E-007 4.982301810103663E-007 5.108430569367414E-007 5.237752354306696E-007 + 5.370347999875436E-007 5.506300387534312E-007 5.645694497066585E-007 5.788617459705973E-007 + 5.935158612609996E-007 6.085409554712686E-007 6.239464203991847E-007 6.397418856186405E-007 + 6.559372245000820E-007 6.725425603834132E-007 6.895682729072277E-007 7.070250044983322E-007 + 7.249236670256109E-007 7.432754486224128E-007 7.620918206817091E-007 7.813845450284254E-007 + 8.011656812734112E-007 8.214475943536650E-007 8.422429622635313E-007 8.635647839817064E-007 + 8.854263875990133E-007 9.078414386520461E-007 9.308239486678703E-007 9.543882839251741E-007 + 9.785491744373056E-007 1.003321723162854E-006 1.028721415449535E-006 1.054764128717280E-006 + 1.081466142386608E-006 1.108844148058481E-006 1.136915259952037E-006 1.165697025606720E-006 + 1.195207436855513E-006 1.225464941076158E-006 1.256488452727391E-006 1.288297365177427E-006 + 1.320911562832108E-006 1.354351433570306E-006 1.388637881494375E-006 1.423792340003632E-006 + 1.459836785199055E-006 1.496793749627622E-006 1.534686336374880E-006 1.573538233514568E-006 + 1.613373728924373E-006 1.654217725477091E-006 1.696095756616722E-006 1.739034002329223E-006 + 1.783059305518012E-006 1.828199188794402E-006 1.874481871693536E-006 1.921936288326632E-006 + 1.970592105480552E-006 2.020479741176088E-006 2.071630383696615E-006 2.124076011098988E-006 + 2.177849411218981E-006 2.232984202183777E-006 2.289514853444407E-006 2.347476707341301E-006 + 2.406906001216534E-006 2.467839890086576E-006 2.530316469889807E-006 2.594374801323450E-006 + 2.660054934284760E-006 2.727397932931887E-006 2.796445901380218E-006 2.867242010050127E-006 + 2.939830522682939E-006 3.014256824041857E-006 3.090567448315367E-006 3.168810108240985E-006 + 3.249033724967502E-006 3.331288458674702E-006 3.415625739969619E-006 3.502098302079136E-006 + 3.590760213859198E-006 3.681666913641318E-006 3.774875243937771E-006 3.870443487027127E-006 + 3.968431401442706E-006 4.068900259386821E-006 4.171912885094266E-006 4.277533694169413E-006 + 4.385828733921400E-006 4.496865724723075E-006 4.610714102419553E-006 4.727445061813140E-006 + 4.847131601252126E-006 4.969848568351363E-006 5.095672706873549E-006 5.224682704800764E-006 + 5.356959243626495E-006 5.492585048899422E-006 5.631644942050527E-006 5.774225893536518E-006 + 5.920417077332965E-006 6.070309926811504E-006 6.223998192036603E-006 6.381577998517732E-006 + 6.543147907454317E-006 6.708808977511507E-006 6.878664828165598E-006 7.052821704659508E-006 + 7.231388544608961E-006 7.414477046301830E-006 7.602201738733821E-006 7.794680053424522E-006 + 7.992032398059778E-006 8.194382232006544E-006 8.401856143748397E-006 8.614583930290654E-006 + 8.832698678585317E-006 9.056336849027820E-006 9.285638361078057E-006 9.520746681060576E-006 + 9.761808912199199E-006 1.000897588694358E-005 1.026240226164622E-005 1.052224661365012E-005 + 1.078867154084885E-005 1.106184376378244E-005 1.134193423033375E-005 1.162911822309260E-005 + 1.192357546945530E-005 1.222549025453041E-005 1.253505153692237E-005 1.285245306746673E-005 + 1.317789351099346E-005 1.351157657119514E-005 1.385371111868061E-005 1.420451132229561E-005 + 1.456419678379414E-005 1.493299267594759E-005 1.531112988417905E-005 1.569884515181429E-005 + 1.609638122904224E-005 1.650398702568067E-005 1.692191776784502E-005 1.735043515862121E-005 + 1.778980754284549E-005 1.824031007609759E-005 1.870222489801575E-005 1.917584131004566E-005 + 1.966145595773716E-005 2.015937301770727E-005 2.066990438938959E-005 2.119336989169430E-005 + 2.173009746470594E-005 2.228042337654926E-005 2.284469243555768E-005 2.342325820788152E-005 + 2.401648324067725E-005 2.462473929102320E-005 2.524840756071003E-005 2.588787893705895E-005 + 2.654355423992512E-005 2.721584447504630E-005 2.790517109390312E-005 2.861196626026023E-005 + 2.933667312356324E-005 3.007974609936976E-005 3.084165115699911E-005 3.162286611458957E-005 + 3.242388094175633E-005 3.324519807005011E-005 3.408733271142125E-005 3.495081318489806E-005 + 3.583618125169668E-005 3.674399245898348E-005 3.767481649251742E-005 3.862923753840710E-005 + 3.960785465422212E-005 4.061128214970596E-005 4.164014997734385E-005 4.269510413304654E-005 + 4.377680706721762E-005 4.488593810647901E-005 4.602319388633864E-005 4.718928879508947E-005 + 4.838495542923946E-005 4.961094506077940E-005 5.086802811660286E-005 5.215699467040461E-005 + 5.347865494738875E-005 5.483383984213057E-005 5.622340144994385E-005 5.764821361211571E-005 + 5.910917247538213E-005 6.060719706602523E-005 6.214322987898850E-005 6.371823748241361E-005 + 6.533321113801394E-005 6.698916743771619E-005 6.868714895700781E-005 7.042822492544501E-005 + 7.221349191478668E-005 7.404407454523442E-005 7.592112621027198E-005 7.784582982061198E-005 + 7.981939856777162E-005 8.184307670781642E-005 8.391814036582464E-005 8.604589836164195E-005 + 8.822769305751296E-005 9.046490122819277E-005 9.275893495416123E-005 9.511124253857752E-005 + 9.752330944863702E-005 9.999665928200572E-005 1.025328547590334E-004 1.051334987414646E-004 + 1.078002352783882E-004 1.105347506801894E-004 1.133387746212929E-004 1.162140812725056E-004 + 1.191624904637969E-004 1.221858688783746E-004 1.252861312789471E-004 1.284652417670851E-004 + 1.317252150766264E-004 1.350681179020965E-004 1.384960702631469E-004 1.420112469060468E-004 + 1.456158787432927E-004 1.493122543324367E-004 1.531027213952706E-004 1.569896883785311E-004 + 1.609756260573410E-004 1.650630691826276E-004 1.692546181738077E-004 1.735529408580661E-004 + 1.779607742575996E-004 1.824809264262410E-004 1.871162783369262E-004 1.918697858215109E-004 + 1.967444815644989E-004 2.017434771522913E-004 2.068699651796196E-004 2.121272214148816E-004 + 2.175186070261602E-004 2.230475708697518E-004 2.287176518431148E-004 2.345324813041874E-004 + 2.404957855591112E-004 2.466113884204555E-004 2.528832138381104E-004 2.593152886050956E-004 + 2.659117451405971E-004 2.726768243526493E-004 2.796148785829311E-004 2.867303746362573E-004 + 2.940278968974242E-004 3.015121505381664E-004 3.091879648170768E-004 3.170602964754454E-004 + 3.251342332320778E-004 3.334149973802628E-004 3.419079494901689E-004 3.506185922200816E-004 + 3.595525742399983E-004 3.687156942712364E-004 3.781139052458524E-004 3.877533185897831E-004 + 3.976402086337990E-004 4.077810171564779E-004 4.181823580635893E-004 4.288510222084276E-004 + 4.397939823578112E-004 4.510183983086402E-004 4.625316221600876E-004 4.743412037466947E-004 + 4.864548962378441E-004 4.988806619092847E-004 5.116266780926098E-004 5.247013433088203E-004 + 5.381132835923258E-004 5.518713590120023E-004 5.659846703961741E-004 5.804625662686488E-004 + 5.953146500032424E-004 6.105507872044865E-004 6.261811133225514E-004 6.422160415107092E-004 + 6.586662707340087E-004 6.755427941381870E-004 6.928569076881826E-004 7.106202190860157E-004 + 7.288446569781974E-004 7.475424804632057E-004 7.667262889100498E-004 7.864090320993605E-004 + 8.066040206989167E-004 8.273249370860166E-004 8.485858465296157E-004 8.704012087456853E-004 + 8.927858898398012E-004 9.157551746515588E-004 9.393247795160354E-004 9.635108654581228E-004 + 9.883300518362733E-004 1.013799430452847E-003 1.039936580149006E-003 1.066759581902865E-003 + 1.094287034450380E-003 1.122538070449303E-003 1.151532373207423E-003 1.181290193997177E-003 + 1.211832369979697E-003 1.243180342762345E-003 1.275356177614837E-003 1.308382583370115E-003 + 1.342282933037302E-003 1.377081285155238E-003 1.412802405916343E-003 1.449471792091848E-003 + 1.487115694790824E-003 1.525761144086813E-003 1.565435974547407E-003 1.606168851703612E-003 + 1.647989299497537E-003 1.690927728748604E-003 1.735015466680232E-003 1.780284787550913E-003 + 1.826768944435388E-003 1.874502202203847E-003 1.923519871749064E-003 1.973858345513693E-003 + 2.025555134372271E-003 2.078648905924871E-003 2.133179524261954E-003 2.189188091262641E-003 + 2.246716989491370E-003 2.305809926760901E-003 2.366511982432578E-003 2.428869655528109E-003 + 2.492930914730343E-003 2.558745250354075E-003 2.626363728371575E-003 2.695839046581347E-003 + 2.767225593012623E-003 2.840579506662359E-003 2.915958740665750E-003 2.993423128005959E-003 + 3.073034449873520E-003 3.154856506790907E-003 3.238955192622923E-003 3.325398571599097E-003 + 3.414256958480026E-003 3.505603002005498E-003 3.599511771768547E-003 3.696060848666139E-003 + 3.795330419083960E-003 3.897403372979965E-003 4.002365406038758E-003 4.110305126076788E-003 + 4.221314163886315E-003 4.335487288714699E-003 4.452922528584508E-003 4.573721295669107E-003 + 4.697988516948120E-003 4.825832770377320E-003 4.957366426818012E-003 5.092705797981995E-003 + 5.231971290659733E-003 5.375287567511346E-003 5.522783714712642E-003 5.674593416761197E-003 + 5.830855138761627E-003 5.991712316522815E-003 6.157313554815226E-003 6.327812834151410E-003 + 6.503369726469309E-003 6.684149620114510E-003 6.870323954535005E-003 7.062070465120482E-003 + 7.259573438636906E-003 7.463023979726964E-003 7.672620288967447E-003 7.888567952995921E-003 + 8.111080247241463E-003 8.340378451817185E-003 8.576692181156151E-003 8.820259727997607E-003 + 9.071328422355911E-003 9.330155006131850E-003 9.597006024053631E-003 9.872158231664140E-003 + 1.015589902110079E-002 1.044852686544547E-002 1.075035178245487E-002 1.106169581851408E-002 + 1.138289355369163E-002 1.171429262880962E-002 1.205625429547975E-002 1.240915399009420E-002 + 1.277338193279997E-002 1.314934375252582E-002 1.353746113917354E-002 1.393817252412780E-002 + 1.435193379028442E-002 1.477921901284206E-002 1.522052123215009E-002 1.567635325995385E-002 + 1.614724852042768E-002 1.663376192743827E-002 1.713647079953222E-002 1.765597581419560E-002 + 1.819290200298778E-002 1.874789978920739E-002 1.932164606980552E-002 1.991484534331826E-002 + 2.052823088564993E-002 2.116256597559716E-002 2.181864517206452E-002 2.249729564498249E-002 + 2.319937856200019E-002 2.392579053308560E-002 2.467746511522817E-002 2.545537437949900E-002 + 2.626053054278528E-002 2.709398766657503E-002 2.795684342522781E-002 2.885024094622466E-002 + 2.977537072494697E-002 3.073347261658875E-002 3.172583790785778E-002 3.275381147117142E-002 + 3.381879400409774E-002 3.492224435683498E-002 3.606568195056020E-002 3.725068928950943E-002 + 3.847891456967910E-002 3.975207438705763E-002 4.107195654830934E-002 4.244042298683642E-002 + 4.385941278714023E-002 4.533094532038730E-002 4.685712349405909E-002 4.844013711852421E-002 + 5.008226639332022E-002 5.178588551586097E-002 5.355346641520162E-002 5.538758261338862E-002 + 5.729091321679826E-002 5.926624703971987E-002 6.131648686227249E-002 6.344465382454365E-002 + 6.565389195861815E-002 6.794747285990792E-002 7.032880049890591E-002 7.280141617416545E-002 + 7.536900360694104E-002 7.803539417752645E-002 8.080457230287598E-002 8.368068095460071E-002 + 8.666802731588247E-002 8.977108857525092E-002 9.299451785450608E-002 9.634315026734788E-002 + 9.982200910448874E-002 1.034363121401628E-001 1.071914780540157E-001 1.110931329613471E-001 + 1.151471170435794E-001 1.193594912696478E-001 1.237365441977241E-001 1.282847988453197E-001 + 1.330110196143328E-001 1.379222192560181E-001 1.430256658591728E-001 1.483288898430092E-001 + 1.538396909342593E-001 1.595661451059983E-001 1.655166114534812E-001 1.716997389799749E-001 + 1.781244732631067E-001 1.848000629696567E-001 1.917360661839851E-001 1.989423565124028E-001 + 2.064291289227767E-001 2.142069052754886E-001 2.222865394985604E-001 2.306792223563129E-001 + 2.393964857573356E-001 2.484502065438389E-001 2.578526097006177E-001 2.676162709179110E-001 + 2.777541184383887E-001 2.882794341143586E-001 2.992058535970820E-001 3.105473655758195E-001 + 3.223183099799514E-001 3.345333750532178E-001 3.472075932048730E-001 3.603563355383553E-001 + 3.739953049539719E-001 3.881405277181692E-001 4.028083433881987E-001 4.180153929774969E-001 + 4.337786052439137E-001 4.501151809801064E-001 4.670425751830544E-001 4.845784769778242E-001 + 5.027407871694659E-001 5.215475932964281E-001 5.410171420591287E-001 5.611678089984991E-001 + 5.820180653015261E-001 6.035864416141057E-001 6.258914887461138E-001 6.489517351595169E-001 + 6.727856411377919E-001 6.974115495440167E-001 7.228476330857826E-001 7.491118380178721E-001 + 7.762218242283851E-001 8.041949016709219E-001 8.330479631246307E-001 8.627974132855047E-001 + 8.934590942164167E-001 9.250482072099495E-001 9.575792311474079E-001 9.910658374692892E-001 + 1.025520801907094E+000 1.060955913163621E+000 1.097381878768746E+000 1.134808228379969E+000 + 1.173243214841684E+000 1.212693713363879E+000 1.253165119229536E+000 1.294661244490107E+000 + 1.337184214159558E+000 1.380734362469229E+000 1.425310129797445E+000 1.470907960939005E+000 + 1.517522205429156E+000 1.565145020684281E+000 1.613766278765669E+000 1.663373477612796E+000 + 1.713951657627408E+000 1.765483324517950E+000 1.817948379334614E+000 1.871324056636980E+000 + 1.925584871737658E+000 1.980702577955337E+000 2.036646134787552E+000 2.093381687876581E+000 + 2.150872561589577E+000 2.209079264965329E+000 2.267959511694610E+000 2.327468254697324E+000 + 2.387557735738300E+000 2.448177550383690E+000 2.509274728442136E+000 2.570793829860394E+000 + 2.632677055852185E+000 2.694864374834480E+000 2.757293662529005E+000 2.819900855361307E+000 + 2.882620116059604E+000 2.945384010123923E+000 3.008123691608776E+000 3.070769096444430E+000 + 3.133249141319005E+000 3.195491925962894E+000 3.257424936524561E+000 3.318975247610346E+000 + 3.380069720487266E+000 3.440635194923278E+000 3.500598672171879E+000 3.559887486701184E+000 + 3.618429464428150E+000 3.676153065448613E+000 3.732987509555040E+000 3.788862883207004E+000 + 3.843710227059597E+000 3.897461603658929E+000 3.950050145471439E+000 4.001410084013723E+000 + 4.051476761477645E+000 4.100186626881940E+000 4.147477219406374E+000 4.193287142152820E+000 + 4.237556030102594E+000 4.280224516474528E+000 4.321234202002930E+000 4.360527631823709E+000 + 4.398048284653127E+000 4.433740578746577E+000 4.467549898719685E+000 4.499422646691922E+000 + 4.529306320378326E+000 4.557149619721167E+000 4.582902582448924E+000 4.606516747618394E+000 + 4.627945344793874E+000 4.647143505119919E+000 4.664068489236158E+000 4.678679925861220E+000 + 4.690940054041390E+000 4.700813961619072E+000 4.708269812522362E+000 4.713279056086011E+000 + 4.715816612833983E+000 4.715861032994853E+000 4.713394626438886E+000 4.708403565616320E+000 + 4.700877966263681E+000 4.690811953875819E+000 4.678203726888217E+000 4.663055629774454E+000 + 4.645374250379410E+000 4.625170555280406E+000 4.602460074282587E+000 4.577263139815198E+000 + 4.549605178541126E+000 4.519517040521623E+000 4.487035335432531E+000 4.452202725252361E+000 + 4.415068098091987E+000 4.375686517730733E+000 4.334118806871822E+000 4.290430609317148E+000 + 4.244691140719679E+000 4.196972654065107E+000 4.147350215417223E+000 4.095901497906700E+000 + 4.042706570288598E+000 3.987847680895041E+000 3.931409037816736E+000 3.873476586149655E+000 + 3.814137783141754E+000 3.753481372069180E+000 3.691597155661506E+000 3.628575769882482E+000 + 3.564508458855321E+000 3.499486851701232E+000 3.433602742035853E+000 3.366947870841330E+000 + 3.299613713402093E+000 3.231691270960034E+000 3.163270867710215E+000 3.094441953721816E+000 + 3.025292914330387E+000 2.955910886507720E+000 2.886381582674431E+000 2.816789122381812E+000 + 2.747215872242813E+000 2.677742294443709E+000 2.608446804144489E+000 2.539405636019624E+000 + 2.470692720135497E+000 2.402379567346552E+000 2.334535164342100E+000 2.267225878426545E+000 + 2.200515372086003E+000 2.134464527356235E+000 2.069131379971317E+000 2.004571063238839E+000 + 1.940835761555869E+000 1.877974673449710E+000 1.816033983999606E+000 1.755056846469013E+000 + 1.695083372953769E+000 1.636150633828657E+000 1.578292665753740E+000 1.521540487982517E+000 + 1.465922126695638E+000 1.411462647067365E+000 1.358184192756274E+000 1.306106032497134E+000 + 1.255244613457327E+000 1.205613621008161E+000 1.157224044549334E+000 1.110084249013178E+000 + 1.064200051664210E+000 1.019574803799170E+000 9.762094769427444E-001 9.341027531250303E-001 + 8.932511188184122E-001 8.536489621040070E-001 8.152886726316125E-001 7.781607439320264E-001 + 7.422538776372712E-001 7.075550891626070E-001 6.740498144046407E-001 6.417220170124964E-001 + 6.105542957940100E-001 5.805279918265505E-001 5.516232948523041E-001 5.238193485507716E-001 + 4.970943542969151E-001 4.714256730316063E-001 4.467899248918353E-001 4.231630862712558E-001 + 4.005205840067597E-001 3.788373864140822E-001 3.580880909240159E-001 3.382470081003345E-001 + 3.192882418517020E-001 3.011857656810514E-001 2.839134948471927E-001 2.674453543448088E-001 + 2.517553426397708E-001 2.368175911266718E-001 2.226064193043215E-001 2.090963856924619E-001 + 1.962623345388483E-001 1.840794383899594E-001 1.725232366207477E-001 1.615696700388903E-001 + 1.511951116968792E-001 1.413763940608610E-001 1.320908326984295E-001 1.233162466585174E-001 + 1.150309757251445E-001 1.072138947331223E-001 9.984442513788835E-002 9.290254403357785E-002 + 8.636879081330652E-002 8.022427166355021E-002 7.445066208063483E-002 6.903020759181530E-002 + 6.394572285643356E-002 5.918058931437520E-002 5.471875153969888E-002 5.054471244712146E-002 + 4.664352748820030E-002 4.300079796281249E-002 3.960266356008539E-002 3.643579423150409E-002 + 3.348738148771539E-002 3.074512919973049E-002 2.819724397497777E-002 2.583242516909822E-002 + 2.363985458562404E-002 2.160918590782129E-002 1.973053390005569E-002 1.799446341009169E-002 + 1.639197819875241E-002 1.491450961932547E-002 1.355390516595688E-002 1.230241690795810E-002 + 1.115268982538878E-002 1.009775006037289E-002 9.130993098265329E-003 8.246171892909172E-003 + 7.437384950707605E-003 6.699064388984371E-003 6.025963985028384E-003 5.413147233227065E-003 + 4.855975428714141E-003 4.350095796921757E-003 3.891429689281100E-003 3.476160866011855E-003 + 3.100723887444692E-003 2.761792635607746E-003 2.456268987860445E-003 2.181271664169866E-003 + 1.934125269195867E-003 1.712349549687695E-003 1.513648886810273E-003 1.335902041928791E-003 + 1.177152173107029E-003 1.035597138141127E-003 9.095800983813123E-004 7.975804359164222E-004 + 6.982049949357855E-004 6.101796562673717E-004 5.323412522454973E-004 4.636298272103285E-004 + 4.030812471082376E-004 3.498201598676332E-004 3.030533064886101E-004 2.620631811234451E-004 + 2.262020368533378E-004 1.948862323972449E-004 1.675909136311306E-004 1.438450225583165E-004 + 1.232266252593443E-004 1.053585493664076E-004 8.990432075449645E-005 7.656438841862418E-005 + 6.507262591203287E-005 5.519309725068169E-005 4.671707483999613E-005 3.946029674504452E-005 + 3.326045049833026E-005 2.797487061285973E-005 2.347843703406808E-005 1.966166191418986E-005 + 1.642895231811492E-005 1.369703676192384E-005 1.139354383544059E-005 9.455721559682359E-006 + 7.829286570680156E-006 6.467392695023346E-006 5.329708981121490E-006 4.381597768188554E-006 + 3.593383903842351E-006 2.939706756071335E-006 2.398947200293272E-006 1.952722292436584E-006 + 1.585440860103848E-006 1.283913752182306E-006 1.037012979688743E-006 8.353744541081522E-007 + 6.711394827256097E-007 5.377306109250567E-007 4.296578085190342E-007 3.423513799272013E-007 + 2.720183360519935E-007 2.155192989388144E-007 1.702633189914308E-007 1.341189941825629E-007 + 1.053430416137545E-007 8.250164706248678E-008 6.442516024375438E-008 5.016293969008727E-008 + 3.894469424568933E-008 3.014819036176702E-008 2.327236202334659E-008 1.791499093686525E-008 + 1.375424011646401E-008 1.053342563710948E-008 8.048500403931213E-009 6.137801576873579E-009 + 4.673680961086374E-009 3.555696222094797E-009 2.705092010401698E-009 2.050710202213143E-009 + 1.549072556928544E-009 1.165908751825222E-009 8.743042091315888E-010 6.531988365311785E-010 + 4.861747861348464E-010 3.604813255627143E-010 2.662534700774652E-010 1.958883197675274E-010 + 1.435492384301916E-010 1.047732440351428E-010 7.616138313606007E-011 5.513554840468232E-011 + 3.974827183177851E-011 2.853457636723849E-011 2.039707511629042E-011 1.451723882766705E-011 + 1.028716928879450E-011 7.257370110087801E-012 5.096941581754378E-012 3.563380621620248E-012 + 2.479772335443879E-012 1.717643374504510E-012 1.184131713642948E-012 8.124315251013267E-013 + 5.547110933241880E-013 3.768890540057167E-013 2.548001699451448E-013 1.713949440664316E-013 + 1.147045515072835E-013 7.636942969912139E-014 5.058086422120955E-014 3.332360207401035E-014 + 2.183672303944284E-014 1.423191347249975E-014 9.224642166703026E-015 5.945876660183951E-015 + 3.810936814741767E-015 2.428656268013420E-015 1.538818466438771E-015 9.693127950493447E-016 + 6.069648071643465E-016 3.777926215694329E-016 2.337226531938202E-016 1.437050680789771E-016 + 8.780787169520823E-017 5.331514935702778E-017 3.216539719278915E-017 1.928027293303637E-017 + 1.148121443838776E-017 6.791674254266361E-018 3.990651116583259E-018 2.328904270031712E-018 + 1.349780290556214E-018 7.768554820825256E-019 4.439609363842891E-019 2.519056091632093E-019 + 1.418992729941321E-019 7.934726491569431E-020 4.404056861384094E-020 2.426063931613628E-020 + 1.326290390461898E-020 7.194825016371130E-021 3.872618619604420E-021 2.067993744085588E-021 + 1.095494725288831E-021 5.756307370596395E-022 2.999892976520704E-022 1.550424324575166E-022 + 7.945711171469990E-023 4.037440668994160E-023 2.033873418747260E-023 1.015637431893515E-023 + 5.026926285978212E-024 2.465850837928393E-024 1.198622351949128E-024 5.772971691064510E-025 + 2.754657097349085E-025 1.302074000989469E-025 6.096100202842944E-026 2.826600869372837E-026 + 1.297836063685569E-026 5.900169363239212E-027 2.655486311549716E-027 1.183051310409795E-027 + 5.216597216804307E-028 2.276348892617197E-028 9.828811870290515E-029 4.198711689539671E-029 + 1.774293071017529E-029 7.415998426107355E-030 3.065411811481451E-030 1.252916561940014E-030 + 5.063001282824324E-031 2.022479615329171E-031 7.985229061298544E-032 3.115686865019586E-032 + 1.201209376976367E-032 4.575268475181235E-033 1.721397084391520E-033 6.396537790950949E-034 + 2.347146934903795E-034 8.503507629296820E-035 3.041226086924514E-035 1.073547981734032E-035 + 3.739769662295298E-036 1.285424231248403E-036 4.358660341050868E-037 1.457774163724139E-037 + 4.808205014547398E-038 1.563705974195900E-038 5.013367389606135E-039 1.584266523563092E-039 + 4.933694059135546E-040 1.513845055862697E-040 4.575882464134242E-041 1.362292855611254E-041 + 3.993789889331086E-042 1.152749521427470E-042 3.275175085366430E-043 9.157937731156533E-044 + 2.519632030924495E-044 6.819686390488435E-045 1.815473870457028E-045 4.752512410907514E-046 + 1.223129321733529E-046 3.094171667328168E-047 7.692105337250774E-048 1.878795575081948E-048 + 4.507656584757881E-049 1.062090170441730E-049 2.457040356126323E-050 5.579603490058104E-051 + 1.243463631110288E-051 2.718934970795873E-052 5.831718139995266E-053 1.226650621347121E-053 + 2.529678043447530E-054 5.113539869592847E-055 1.012933018039598E-055 1.965765822736715E-056 + 3.736480290882348E-057 6.954404671032851E-058 1.267093385342866E-058 2.259395727226271E-059 + 3.941786920562265E-060 6.726541295152905E-061 1.122451215597719E-061 1.831039765431450E-062 + 2.919166223832182E-063 4.547002286966594E-064 6.917828495160245E-065 1.027694556185183E-065 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + + diff --git a/tests/apps/miniDFT/tests/espresso/test/QE_Si_333.in b/tests/apps/miniDFT/tests/espresso/test/QE_Si_333.in new file mode 100644 index 0000000000..79c9051603 --- /dev/null +++ b/tests/apps/miniDFT/tests/espresso/test/QE_Si_333.in @@ -0,0 +1,93 @@ +&control +prefix = 'silicon' +calculation = 'scf' +restart_mode = 'from_scratch' +wf_collect = .false. +disk_io = 'none' +tstress = .true. +tprnfor = .true. +outdir = './' +wfcdir = './' +pseudo_dir = './' +/ +&system +ibrav = 0 +celldm(1) = 10.2612 +nat = 54 +ntyp = 1 +nbnd = 108 +ecutwfc = 30 +/ +&electrons +electron_maxstep = 100 +conv_thr = 1.0d-10 +mixing_mode = 'plain' +mixing_beta = 0.7 +mixing_ndim = 8 +diagonalization = 'david' +diago_david_ndim = 4 +diago_full_acc = .true. +/ +CELL_PARAMETERS +0.0 1.5 1.5 +1.5 0.0 1.5 +1.5 1.5 0.0 +ATOMIC_SPECIES +Si 28.086 Si.lda.UPF +ATOMIC_POSITIONS crystal +Si 0.0 0.0 0.0 +Si 0.0833333333333 0.0833333333333 0.0833333333333 +Si 0.0 0.0 0.333333333333 +Si 0.0833333333333 0.0833333333333 0.416666666667 +Si 0.0 0.0 0.666666666667 +Si 0.0833333333333 0.0833333333333 0.75 +Si 0.0 0.333333333333 0.0 +Si 0.0833333333333 0.416666666667 0.0833333333333 +Si 0.0 0.333333333333 0.333333333333 +Si 0.0833333333333 0.416666666667 0.416666666667 +Si 0.0 0.333333333333 0.666666666667 +Si 0.0833333333333 0.416666666667 0.75 +Si 0.0 0.666666666667 0.0 +Si 0.0833333333333 0.75 0.0833333333333 +Si 0.0 0.666666666667 0.333333333333 +Si 0.0833333333333 0.75 0.416666666667 +Si 0.0 0.666666666667 0.666666666667 +Si 0.0833333333333 0.75 0.75 +Si 0.333333333333 0.0 0.0 +Si 0.416666666667 0.0833333333333 0.0833333333333 +Si 0.333333333333 0.0 0.333333333333 +Si 0.416666666667 0.0833333333333 0.416666666667 +Si 0.333333333333 0.0 0.666666666667 +Si 0.416666666667 0.0833333333333 0.75 +Si 0.333333333333 0.333333333333 0.0 +Si 0.416666666667 0.416666666667 0.0833333333333 +Si 0.333333333333 0.333333333333 0.333333333333 +Si 0.416666666667 0.416666666667 0.416666666667 +Si 0.333333333333 0.333333333333 0.666666666667 +Si 0.416666666667 0.416666666667 0.75 +Si 0.333333333333 0.666666666667 0.0 +Si 0.416666666667 0.75 0.0833333333333 +Si 0.333333333333 0.666666666667 0.333333333333 +Si 0.416666666667 0.75 0.416666666667 +Si 0.333333333333 0.666666666667 0.666666666667 +Si 0.416666666667 0.75 0.75 +Si 0.666666666667 0.0 0.0 +Si 0.75 0.0833333333333 0.0833333333333 +Si 0.666666666667 0.0 0.333333333333 +Si 0.75 0.0833333333333 0.416666666667 +Si 0.666666666667 0.0 0.666666666667 +Si 0.75 0.0833333333333 0.75 +Si 0.666666666667 0.333333333333 0.0 +Si 0.75 0.416666666667 0.0833333333333 +Si 0.666666666667 0.333333333333 0.333333333333 +Si 0.75 0.416666666667 0.416666666667 +Si 0.666666666667 0.333333333333 0.666666666667 +Si 0.75 0.416666666667 0.75 +Si 0.666666666667 0.666666666667 0.0 +Si 0.75 0.75 0.0833333333333 +Si 0.666666666667 0.666666666667 0.333333333333 +Si 0.75 0.75 0.416666666667 +Si 0.666666666667 0.666666666667 0.666666666667 +Si 0.75 0.75 0.75 +K_POINTS automatic +1 1 1 1 1 1 diff --git a/tests/apps/miniDFT/tests/espresso/test/QE_Si_333.out.ref b/tests/apps/miniDFT/tests/espresso/test/QE_Si_333.out.ref new file mode 100644 index 0000000000..b4f40d2890 --- /dev/null +++ b/tests/apps/miniDFT/tests/espresso/test/QE_Si_333.out.ref @@ -0,0 +1,425 @@ + + Program PWSCF v.5.0 starts on 2Nov2012 at 14:58:27 + + This program is part of the open-source Quantum ESPRESSO suite + for quantum simulation of materials; please cite + "P. Giannozzi et al., J. Phys.:Condens. Matter 21 395502 (2009); + URL http://www.quantum-espresso.org", + in publications or presentations arising from this work. More details at + http://www.quantum-espresso.org/quote.php + + Parallel version (MPI), running on 24 processors + R & G space division: proc/pool = 24 + + Current dimensions of program PWSCF are: + Max number of different atomic species (ntypx) = 10 + Max number of k-points (npk) = 40000 + Max angular momentum in pseudopotentials (lmaxx) = 3 + Reading input from QE_Si_333.in + + Subspace diagonalization in iterative solution of the eigenvalue problem: + scalapack distributed-memory algorithm (size of sub-group: 3* 3 procs) + + Found symmetry operation: I + ( 0.0000 0.0000 0.3333) + This is a supercell, fractional translations are disabled + + Parallelization info + -------------------- + sticks: dense smooth PW G-vecs: dense smooth PW + Min 162 162 43 6733 6733 924 + Max 163 163 44 6739 6739 928 + Sum 3901 3901 1039 161653 161653 22219 + + + + bravais-lattice index = 0 + lattice parameter (alat) = 10.2612 a.u. + unit-cell volume = 7292.8659 (a.u.)^3 + number of atoms/cell = 54 + number of atomic types = 1 + number of electrons = 216.00 + number of Kohn-Sham states= 108 + kinetic-energy cutoff = 30.0000 Ry + charge density cutoff = 120.0000 Ry + convergence threshold = 1.0E-10 + mixing beta = 0.7000 + number of iterations used = 8 plain mixing + Exchange-correlation = PZ ( 1 1 0 0 0) + EXX-fraction = 0.00 + + celldm(1)= 10.261200 celldm(2)= 0.000000 celldm(3)= 0.000000 + celldm(4)= 0.000000 celldm(5)= 0.000000 celldm(6)= 0.000000 + + crystal axes: (cart. coord. in units of alat) + a(1) = ( 0.000000 1.500000 1.500000 ) + a(2) = ( 1.500000 0.000000 1.500000 ) + a(3) = ( 1.500000 1.500000 0.000000 ) + + reciprocal axes: (cart. coord. in units 2 pi/alat) + b(1) = ( -0.333333 0.333333 0.333333 ) + b(2) = ( 0.333333 -0.333333 0.333333 ) + b(3) = ( 0.333333 0.333333 -0.333333 ) + + + PseudoPot. # 1 for Si read from file: + ./Si.UPF + MD5 check sum: 2b84a5024e7ea64828ec672373b6cfd7 + Pseudo is Norm-conserving, Zval = 4.0 + Generated using "atomic" code by A. Dal Corso (Quantum ESPRESSO distribution) + Using radial grid of 1141 points, 2 beta functions with: + l(1) = 0 + l(2) = 1 + + atomic species valence mass pseudopotential + Si 4.00 28.08600 Si( 1.00) + + 24 Sym. Ops. (no inversion) found + + + + Cartesian axes + + site n. atom positions (alat units) + 1 Si tau( 1) = ( 0.0000000 0.0000000 0.0000000 ) + 2 Si tau( 2) = ( 0.2500000 0.2500000 0.2500000 ) + 3 Si tau( 3) = ( 0.5000000 0.5000000 0.0000000 ) + 4 Si tau( 4) = ( 0.7500000 0.7500000 0.2500000 ) + 5 Si tau( 5) = ( 1.0000000 1.0000000 0.0000000 ) + 6 Si tau( 6) = ( 1.2500000 1.2500000 0.2500000 ) + 7 Si tau( 7) = ( 0.5000000 0.0000000 0.5000000 ) + 8 Si tau( 8) = ( 0.7500000 0.2500000 0.7500000 ) + 9 Si tau( 9) = ( 1.0000000 0.5000000 0.5000000 ) + 10 Si tau( 10) = ( 1.2500000 0.7500000 0.7500000 ) + 11 Si tau( 11) = ( 1.5000000 1.0000000 0.5000000 ) + 12 Si tau( 12) = ( 1.7500000 1.2500000 0.7500000 ) + 13 Si tau( 13) = ( 1.0000000 0.0000000 1.0000000 ) + 14 Si tau( 14) = ( 1.2500000 0.2500000 1.2500000 ) + 15 Si tau( 15) = ( 1.5000000 0.5000000 1.0000000 ) + 16 Si tau( 16) = ( 1.7500000 0.7500000 1.2500000 ) + 17 Si tau( 17) = ( 2.0000000 1.0000000 1.0000000 ) + 18 Si tau( 18) = ( 2.2500000 1.2500000 1.2500000 ) + 19 Si tau( 19) = ( 0.0000000 0.5000000 0.5000000 ) + 20 Si tau( 20) = ( 0.2500000 0.7500000 0.7500000 ) + 21 Si tau( 21) = ( 0.5000000 1.0000000 0.5000000 ) + 22 Si tau( 22) = ( 0.7500000 1.2500000 0.7500000 ) + 23 Si tau( 23) = ( 1.0000000 1.5000000 0.5000000 ) + 24 Si tau( 24) = ( 1.2500000 1.7500000 0.7500000 ) + 25 Si tau( 25) = ( 0.5000000 0.5000000 1.0000000 ) + 26 Si tau( 26) = ( 0.7500000 0.7500000 1.2500000 ) + 27 Si tau( 27) = ( 1.0000000 1.0000000 1.0000000 ) + 28 Si tau( 28) = ( 1.2500000 1.2500000 1.2500000 ) + 29 Si tau( 29) = ( 1.5000000 1.5000000 1.0000000 ) + 30 Si tau( 30) = ( 1.7500000 1.7500000 1.2500000 ) + 31 Si tau( 31) = ( 1.0000000 0.5000000 1.5000000 ) + 32 Si tau( 32) = ( 1.2500000 0.7500000 1.7500000 ) + 33 Si tau( 33) = ( 1.5000000 1.0000000 1.5000000 ) + 34 Si tau( 34) = ( 1.7500000 1.2500000 1.7500000 ) + 35 Si tau( 35) = ( 2.0000000 1.5000000 1.5000000 ) + 36 Si tau( 36) = ( 2.2500000 1.7500000 1.7500000 ) + 37 Si tau( 37) = ( 0.0000000 1.0000000 1.0000000 ) + 38 Si tau( 38) = ( 0.2500000 1.2500000 1.2500000 ) + 39 Si tau( 39) = ( 0.5000000 1.5000000 1.0000000 ) + 40 Si tau( 40) = ( 0.7500000 1.7500000 1.2500000 ) + 41 Si tau( 41) = ( 1.0000000 2.0000000 1.0000000 ) + 42 Si tau( 42) = ( 1.2500000 2.2500000 1.2500000 ) + 43 Si tau( 43) = ( 0.5000000 1.0000000 1.5000000 ) + 44 Si tau( 44) = ( 0.7500000 1.2500000 1.7500000 ) + 45 Si tau( 45) = ( 1.0000000 1.5000000 1.5000000 ) + 46 Si tau( 46) = ( 1.2500000 1.7500000 1.7500000 ) + 47 Si tau( 47) = ( 1.5000000 2.0000000 1.5000000 ) + 48 Si tau( 48) = ( 1.7500000 2.2500000 1.7500000 ) + 49 Si tau( 49) = ( 1.0000000 1.0000000 2.0000000 ) + 50 Si tau( 50) = ( 1.2500000 1.2500000 2.2500000 ) + 51 Si tau( 51) = ( 1.5000000 1.5000000 2.0000000 ) + 52 Si tau( 52) = ( 1.7500000 1.7500000 2.2500000 ) + 53 Si tau( 53) = ( 2.0000000 2.0000000 2.0000000 ) + 54 Si tau( 54) = ( 2.2500000 2.2500000 2.2500000 ) + + number of k points= 1 + cart. coord. in units 2pi/alat + k( 1) = ( -0.1666667 -0.1666667 -0.1666667), wk = 2.0000000 + + Dense grid: 161653 G-vectors FFT dimensions: ( 75, 75, 75) + + Largest allocated arrays est. size (Mb) dimensions + Kohn-Sham Wavefunctions 1.40 Mb ( 851, 108) + NL pseudopotentials 2.80 Mb ( 851, 216) + Each V/rho on FFT grid 0.34 Mb ( 22500) + Each G-vector array 0.05 Mb ( 6734) + G-vector shells 0.01 Mb ( 931) + Largest temporary arrays est. size (Mb) dimensions + Auxiliary wavefunctions 5.61 Mb ( 851, 432) + Each subspace H/S matrix 0.32 Mb ( 144, 144) + Each matrix 0.36 Mb ( 216, 108) + Arrays for rho mixing 2.75 Mb ( 22500, 8) + writing wfc files to a dedicated directory + + Initial potential from superposition of free atoms + + starting charge 215.97322, renormalised to 216.00000 + Starting wfc are 216 randomized atomic wfcs + + total cpu time spent up to now is 1.5 secs + + per-process dynamical memory: 13.0 Mb + + Self-consistent Calculation + + iteration # 1 ecut= 30.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 1.00E-02, avg # of iterations = 2.0 + + Threshold (ethr) on eigenvalues was too large: + Diagonalizing with lowered threshold + + Davidson diagonalization with overlap + ethr = 7.73E-04, avg # of iterations = 1.0 + + total cpu time spent up to now is 4.5 secs + + total energy = -428.20916922 Ry + Harris-Foulkes estimate = -428.74955308 Ry + estimated scf accuracy < 1.63888300 Ry + + iteration # 2 ecut= 30.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 7.59E-04, avg # of iterations = 1.0 + + total cpu time spent up to now is 5.7 secs + + total energy = -428.28529928 Ry + Harris-Foulkes estimate = -428.29401272 Ry + estimated scf accuracy < 0.06080148 Ry + + iteration # 3 ecut= 30.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 2.81E-05, avg # of iterations = 3.0 + + total cpu time spent up to now is 7.5 secs + + total energy = -428.29570367 Ry + Harris-Foulkes estimate = -428.29646513 Ry + estimated scf accuracy < 0.00178094 Ry + + iteration # 4 ecut= 30.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 8.25E-07, avg # of iterations = 4.0 + + total cpu time spent up to now is 9.5 secs + + total energy = -428.29615816 Ry + Harris-Foulkes estimate = -428.29622435 Ry + estimated scf accuracy < 0.00014192 Ry + + iteration # 5 ecut= 30.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 6.57E-08, avg # of iterations = 3.0 + + total cpu time spent up to now is 11.4 secs + + total energy = -428.29618044 Ry + Harris-Foulkes estimate = -428.29618761 Ry + estimated scf accuracy < 0.00002129 Ry + + iteration # 6 ecut= 30.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 9.86E-09, avg # of iterations = 3.0 + + total cpu time spent up to now is 13.6 secs + + total energy = -428.29618340 Ry + Harris-Foulkes estimate = -428.29618391 Ry + estimated scf accuracy < 0.00000153 Ry + + iteration # 7 ecut= 30.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 7.09E-10, avg # of iterations = 2.0 + + total cpu time spent up to now is 15.1 secs + + total energy = -428.29618341 Ry + Harris-Foulkes estimate = -428.29618355 Ry + estimated scf accuracy < 0.00000030 Ry + + iteration # 8 ecut= 30.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 1.38E-10, avg # of iterations = 2.0 + + total cpu time spent up to now is 16.8 secs + + total energy = -428.29618346 Ry + Harris-Foulkes estimate = -428.29618346 Ry + estimated scf accuracy < 0.00000002 Ry + + iteration # 9 ecut= 30.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 7.87E-12, avg # of iterations = 4.0 + + total cpu time spent up to now is 18.5 secs + + total energy = -428.29618346 Ry + Harris-Foulkes estimate = -428.29618346 Ry + estimated scf accuracy < 4.7E-09 Ry + + iteration # 10 ecut= 30.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 2.19E-12, avg # of iterations = 2.0 + + total cpu time spent up to now is 19.8 secs + + total energy = -428.29618346 Ry + Harris-Foulkes estimate = -428.29618346 Ry + estimated scf accuracy < 8.6E-10 Ry + + iteration # 11 ecut= 30.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 3.98E-13, avg # of iterations = 3.0 + + total cpu time spent up to now is 21.6 secs + + End of self-consistent calculation + + k =-0.1667-0.1667-0.1667 ( 20214 PWs) bands (ev): + + -5.5353 -5.5353 -4.5952 -4.5952 -4.5952 -4.5952 -4.5952 -4.5952 + -3.7845 -3.7845 -3.7845 -3.7845 -3.7845 -3.7845 -3.5509 -2.8242 + -2.8242 -2.8242 -2.8242 -2.8242 -2.8242 -2.6110 -2.6110 -2.6110 + -2.6110 -2.6110 -2.6110 -0.9456 -0.7878 -0.7878 -0.7878 -0.7878 + -0.7878 -0.7878 -0.5016 -0.5016 -0.5016 -0.5016 -0.5016 -0.5016 + 0.0323 0.0323 0.0323 0.0323 0.0323 0.0323 1.6042 1.6042 + 1.6042 1.6042 1.6042 1.6042 1.9956 1.9956 1.9956 1.9956 + 1.9956 1.9956 2.3733 2.3733 2.3733 2.3733 2.3733 2.3733 + 2.9660 2.9660 2.9660 2.9660 2.9660 2.9660 3.2487 3.2487 + 3.2487 3.2487 3.2487 3.2487 3.4660 3.4660 3.4660 3.4660 + 3.4660 3.4660 3.6432 3.6432 4.0230 4.0230 4.0230 4.0230 + 4.0230 4.0230 4.2730 4.2730 4.2730 4.2730 4.2730 4.2730 + 4.7224 4.7224 4.7224 4.7224 4.7224 4.7224 4.8213 4.8213 + 5.5652 5.5652 5.5652 5.5652 + +! total energy = -428.29618346 Ry + Harris-Foulkes estimate = -428.29618346 Ry + estimated scf accuracy < 6.0E-11 Ry + + The total energy is the sum of the following terms: + + one-electron contribution = 125.18806103 Ry + hartree contribution = 29.53512379 Ry + xc contribution = -129.44731918 Ry + ewald contribution = -453.57204910 Ry + + convergence has been achieved in 11 iterations + + Forces acting on atoms (Ry/au): + + atom 1 type 1 force = 0.00000000 0.00000000 0.00000000 + atom 2 type 1 force = -0.00000002 -0.00000002 -0.00000002 + atom 3 type 1 force = 0.00000002 0.00000002 0.00000011 + atom 4 type 1 force = 0.00000000 0.00000000 -0.00000011 + atom 5 type 1 force = -0.00000002 -0.00000002 0.00000011 + atom 6 type 1 force = 0.00000002 0.00000002 -0.00000002 + atom 7 type 1 force = 0.00000002 0.00000011 0.00000002 + atom 8 type 1 force = 0.00000000 -0.00000011 0.00000000 + atom 9 type 1 force = -0.00000004 0.00000004 0.00000004 + atom 10 type 1 force = 0.00000011 0.00000000 0.00000000 + atom 11 type 1 force = -0.00000011 -0.00000002 0.00000002 + atom 12 type 1 force = 0.00000009 -0.00000009 0.00000003 + atom 13 type 1 force = -0.00000002 0.00000011 -0.00000002 + atom 14 type 1 force = 0.00000002 -0.00000002 0.00000002 + atom 15 type 1 force = -0.00000011 0.00000002 -0.00000002 + atom 16 type 1 force = 0.00000009 0.00000003 -0.00000009 + atom 17 type 1 force = -0.00000003 0.00000003 0.00000003 + atom 18 type 1 force = -0.00000003 -0.00000009 -0.00000009 + atom 19 type 1 force = 0.00000011 0.00000002 0.00000002 + atom 20 type 1 force = -0.00000011 0.00000000 0.00000000 + atom 21 type 1 force = 0.00000004 -0.00000004 0.00000004 + atom 22 type 1 force = 0.00000000 0.00000011 0.00000000 + atom 23 type 1 force = -0.00000002 -0.00000011 0.00000002 + atom 24 type 1 force = -0.00000009 0.00000009 0.00000003 + atom 25 type 1 force = 0.00000004 0.00000004 -0.00000004 + atom 26 type 1 force = 0.00000000 0.00000000 0.00000011 + atom 27 type 1 force = -0.00000004 -0.00000004 -0.00000004 + atom 28 type 1 force = 0.00000007 0.00000007 0.00000007 + atom 29 type 1 force = 0.00000000 0.00000000 0.00000014 + atom 30 type 1 force = -0.00000007 -0.00000007 0.00000007 + atom 31 type 1 force = -0.00000002 0.00000002 -0.00000011 + atom 32 type 1 force = -0.00000009 0.00000003 0.00000009 + atom 33 type 1 force = 0.00000000 0.00000014 0.00000000 + atom 34 type 1 force = -0.00000007 0.00000007 -0.00000007 + atom 35 type 1 force = -0.00000014 0.00000000 0.00000000 + atom 36 type 1 force = -0.00000003 0.00000009 0.00000009 + atom 37 type 1 force = 0.00000011 -0.00000002 -0.00000002 + atom 38 type 1 force = -0.00000002 0.00000002 0.00000002 + atom 39 type 1 force = 0.00000002 -0.00000011 -0.00000002 + atom 40 type 1 force = 0.00000003 0.00000009 -0.00000009 + atom 41 type 1 force = 0.00000003 -0.00000003 0.00000003 + atom 42 type 1 force = -0.00000009 -0.00000003 -0.00000009 + atom 43 type 1 force = 0.00000002 -0.00000002 -0.00000011 + atom 44 type 1 force = 0.00000003 -0.00000009 0.00000009 + atom 45 type 1 force = 0.00000014 0.00000000 0.00000000 + atom 46 type 1 force = 0.00000007 -0.00000007 -0.00000007 + atom 47 type 1 force = 0.00000000 -0.00000014 0.00000000 + atom 48 type 1 force = 0.00000009 -0.00000003 0.00000009 + atom 49 type 1 force = 0.00000003 0.00000003 -0.00000003 + atom 50 type 1 force = -0.00000009 -0.00000009 -0.00000003 + atom 51 type 1 force = 0.00000000 0.00000000 -0.00000014 + atom 52 type 1 force = 0.00000009 0.00000009 -0.00000003 + atom 53 type 1 force = -0.00000003 -0.00000003 -0.00000003 + atom 54 type 1 force = 0.00000000 0.00000000 0.00000000 + + Total force = 0.000001 Total SCF correction = 0.000016 + SCF correction compared to forces is large: reduce conv_thr to get better values + + + entering subroutine stress ... + + total stress (Ry/bohr**3) (kbar) P= -29.12 + -0.00019795 0.00000000 0.00000000 -29.12 0.00 0.00 + 0.00000000 -0.00019795 0.00000000 0.00 -29.12 0.00 + 0.00000000 0.00000000 -0.00019795 0.00 0.00 -29.12 + + + init_run : 1.26s CPU 1.36s WALL ( 1 calls) + electrons : 18.41s CPU 20.07s WALL ( 1 calls) + forces : 0.20s CPU 0.20s WALL ( 1 calls) + stress : 0.72s CPU 0.72s WALL ( 1 calls) + + Called by init_run: + wfcinit : 0.90s CPU 0.92s WALL ( 1 calls) + potinit : 0.05s CPU 0.05s WALL ( 1 calls) + + Called by electrons: + c_bands : 16.23s CPU 16.49s WALL ( 12 calls) + sum_band : 1.86s CPU 1.89s WALL ( 12 calls) + v_of_rho : 0.09s CPU 0.09s WALL ( 12 calls) + mix_rho : 0.07s CPU 0.07s WALL ( 12 calls) + + Called by c_bands: + init_us_2 : 0.05s CPU 0.09s WALL ( 25 calls) + cegterg : 16.11s CPU 16.38s WALL ( 12 calls) + + Called by *egterg: + h_psi : 11.99s CPU 12.10s WALL ( 43 calls) + g_psi : 0.03s CPU 0.03s WALL ( 30 calls) + cdiaghg : 2.14s CPU 2.17s WALL ( 41 calls) + + Called by h_psi: + add_vuspsi : 0.72s CPU 0.79s WALL ( 43 calls) + + General routines + calbec : 0.96s CPU 0.95s WALL ( 45 calls) + fft : 0.16s CPU 0.14s WALL ( 54 calls) + fftw : 11.71s CPU 11.49s WALL ( 8390 calls) + + Parallel routines + fft_scatter : 7.48s CPU 5.37s WALL ( 8444 calls) + EXX routines + + PWSCF : 20.69s CPU 23.64s WALL + + + This run was terminated on: 14:58:51 2Nov2012 + +=------------------------------------------------------------------------------= + JOB DONE. +=------------------------------------------------------------------------------= +Application 12692069 resources: utime ~530s, stime ~12s Rss ~36652 inblocks ~44174 outblocks ~110200 diff --git a/tests/apps/miniDFT/tests/espresso/test/QE_TiO2_222.in b/tests/apps/miniDFT/tests/espresso/test/QE_TiO2_222.in new file mode 100644 index 0000000000..0d0d1eb4ae --- /dev/null +++ b/tests/apps/miniDFT/tests/espresso/test/QE_TiO2_222.in @@ -0,0 +1,88 @@ +&control +prefix = 'titania' +calculation = 'scf' +restart_mode = 'from_scratch' +wf_collect = .false. +disk_io = 'none' +tstress = .true. +tprnfor = .true. +outdir = './' +wfcdir = './' +pseudo_dir = './' +/ +&system +ibrav = 0 +celldm(1) = 8.7671 +nat = 48 +ntyp = 2 +nbnd = 192 +ecutwfc = 100 +/ +&electrons +electron_maxstep = 100 +conv_thr = 1.0d-10 +mixing_mode = 'plain' +mixing_beta = 0.7 +mixing_ndim = 8 +diagonalization = 'david' +diago_david_ndim = 4 +diago_full_acc = .true. +/ +CELL_PARAMETERS +2.0 0.0 0.0 +0.0 2.0 0.0 +0.0 0.0 1.277176 +ATOMIC_SPECIES +Ti 47.867 Ti.pbe.UPF +O 15.9994 O.pbe.UPF +ATOMIC_POSITIONS crystal +Ti 0.0 0.0 0.0 +Ti 0.25 0.25 0.25 +O 0.15254385 0.15254385 0.0 +O -0.15254385 -0.15254385 0.0 +O 0.40254385 0.09745615 0.25 +O 0.09745615 0.40254385 0.25 +Ti 0.0 0.0 0.5 +Ti 0.25 0.25 0.75 +O 0.15254385 0.15254385 0.5 +O -0.15254385 -0.15254385 0.5 +O 0.40254385 0.09745615 0.75 +O 0.09745615 0.40254385 0.75 +Ti 0.0 0.5 0.0 +Ti 0.25 0.75 0.25 +O 0.15254385 0.65254385 0.0 +O -0.15254385 0.34745615 0.0 +O 0.40254385 0.59745615 0.25 +O 0.09745615 0.90254385 0.25 +Ti 0.0 0.5 0.5 +Ti 0.25 0.75 0.75 +O 0.15254385 0.65254385 0.5 +O -0.15254385 0.34745615 0.5 +O 0.40254385 0.59745615 0.75 +O 0.09745615 0.90254385 0.75 +Ti 0.5 0.0 0.0 +Ti 0.75 0.25 0.25 +O 0.65254385 0.15254385 0.0 +O 0.34745615 -0.15254385 0.0 +O 0.90254385 0.09745615 0.25 +O 0.59745615 0.40254385 0.25 +Ti 0.5 0.0 0.5 +Ti 0.75 0.25 0.75 +O 0.65254385 0.15254385 0.5 +O 0.34745615 -0.15254385 0.5 +O 0.90254385 0.09745615 0.75 +O 0.59745615 0.40254385 0.75 +Ti 0.5 0.5 0.0 +Ti 0.75 0.75 0.25 +O 0.65254385 0.65254385 0.0 +O 0.34745615 0.34745615 0.0 +O 0.90254385 0.59745615 0.25 +O 0.59745615 0.90254385 0.25 +Ti 0.5 0.5 0.5 +Ti 0.75 0.75 0.75 +O 0.65254385 0.65254385 0.5 +O 0.34745615 0.34745615 0.5 +O 0.90254385 0.59745615 0.75 +O 0.59745615 0.90254385 0.75 +K_POINTS automatic +1 1 1 1 1 1 diff --git a/tests/apps/miniDFT/tests/espresso/test/QE_TiO2_222.out.ref b/tests/apps/miniDFT/tests/espresso/test/QE_TiO2_222.out.ref new file mode 100644 index 0000000000..c4ff46f229 --- /dev/null +++ b/tests/apps/miniDFT/tests/espresso/test/QE_TiO2_222.out.ref @@ -0,0 +1,665 @@ + + Program PWSCF v.5.0 starts on 2Nov2012 at 15: 0:10 + + This program is part of the open-source Quantum ESPRESSO suite + for quantum simulation of materials; please cite + "P. Giannozzi et al., J. Phys.:Condens. Matter 21 395502 (2009); + URL http://www.quantum-espresso.org", + in publications or presentations arising from this work. More details at + http://www.quantum-espresso.org/quote.php + + Parallel version (MPI), running on 24 processors + R & G space division: proc/pool = 24 + + Current dimensions of program PWSCF are: + Max number of different atomic species (ntypx) = 10 + Max number of k-points (npk) = 40000 + Max angular momentum in pseudopotentials (lmaxx) = 3 + Reading input from QE_TiO2_2.in + + Subspace diagonalization in iterative solution of the eigenvalue problem: + scalapack distributed-memory algorithm (size of sub-group: 3* 3 procs) + + Found symmetry operation: I + ( 0.0000 0.0000 -0.5000) + This is a supercell, fractional translations are disabled + + Parallelization info + -------------------- + sticks: dense smooth PW G-vecs: dense smooth PW + Min 407 407 109 19381 19381 2703 + Max 408 408 110 19384 19384 2706 + Sum 9777 9777 2617 465167 465167 64917 + + + + bravais-lattice index = 0 + lattice parameter (alat) = 8.7671 a.u. + unit-cell volume = 3442.5370 (a.u.)^3 + number of atoms/cell = 48 + number of atomic types = 2 + number of electrons = 384.00 + number of Kohn-Sham states= 192 + kinetic-energy cutoff = 100.0000 Ry + charge density cutoff = 400.0000 Ry + convergence threshold = 1.0E-10 + mixing beta = 0.7000 + number of iterations used = 8 plain mixing + Exchange-correlation = PBE ( 1 4 3 4 0) + EXX-fraction = 0.00 + + celldm(1)= 8.767100 celldm(2)= 0.000000 celldm(3)= 0.000000 + celldm(4)= 0.000000 celldm(5)= 0.000000 celldm(6)= 0.000000 + + crystal axes: (cart. coord. in units of alat) + a(1) = ( 2.000000 0.000000 0.000000 ) + a(2) = ( 0.000000 2.000000 0.000000 ) + a(3) = ( 0.000000 0.000000 1.277176 ) + + reciprocal axes: (cart. coord. in units 2 pi/alat) + b(1) = ( 0.500000 0.000000 0.000000 ) + b(2) = ( 0.000000 0.500000 0.000000 ) + b(3) = ( 0.000000 0.000000 0.782977 ) + + + PseudoPot. # 1 for Ti read from file: + ./Ti.UPF + MD5 check sum: 62dbf2fbf73916fd320f8d494e62af35 + Pseudo is Norm-conserving, Zval = 12.0 + Generated using "atomic" code by A. Dal Corso (Quantum ESPRESSO distribution) + Using radial grid of 1177 points, 2 beta functions with: + l(1) = 1 + l(2) = 2 + + PseudoPot. # 2 for O read from file: + ./O.UPF + MD5 check sum: da7678121fb76f7377a20687ab6aa51b + Pseudo is Norm-conserving, Zval = 6.0 + Generated using "atomic" code by A. Dal Corso (Quantum ESPRESSO distribution) + Using radial grid of 1095 points, 1 beta functions with: + l(1) = 0 + + atomic species valence mass pseudopotential + Ti 12.00 47.86700 Ti( 1.00) + O 6.00 15.99940 O( 1.00) + + 8 Sym. Ops., with inversion, found + + + + Cartesian axes + + site n. atom positions (alat units) + 1 Ti tau( 1) = ( 0.0000000 0.0000000 0.0000000 ) + 2 Ti tau( 2) = ( 0.5000000 0.5000000 0.3192940 ) + 3 O tau( 3) = ( 0.3050877 0.3050877 0.0000000 ) + 4 O tau( 4) = ( -0.3050877 -0.3050877 0.0000000 ) + 5 O tau( 5) = ( 0.8050877 0.1949123 0.3192940 ) + 6 O tau( 6) = ( 0.1949123 0.8050877 0.3192940 ) + 7 Ti tau( 7) = ( 0.0000000 0.0000000 0.6385880 ) + 8 Ti tau( 8) = ( 0.5000000 0.5000000 0.9578820 ) + 9 O tau( 9) = ( 0.3050877 0.3050877 0.6385880 ) + 10 O tau( 10) = ( -0.3050877 -0.3050877 0.6385880 ) + 11 O tau( 11) = ( 0.8050877 0.1949123 0.9578820 ) + 12 O tau( 12) = ( 0.1949123 0.8050877 0.9578820 ) + 13 Ti tau( 13) = ( 0.0000000 1.0000000 0.0000000 ) + 14 Ti tau( 14) = ( 0.5000000 1.5000000 0.3192940 ) + 15 O tau( 15) = ( 0.3050877 1.3050877 0.0000000 ) + 16 O tau( 16) = ( -0.3050877 0.6949123 0.0000000 ) + 17 O tau( 17) = ( 0.8050877 1.1949123 0.3192940 ) + 18 O tau( 18) = ( 0.1949123 1.8050877 0.3192940 ) + 19 Ti tau( 19) = ( 0.0000000 1.0000000 0.6385880 ) + 20 Ti tau( 20) = ( 0.5000000 1.5000000 0.9578820 ) + 21 O tau( 21) = ( 0.3050877 1.3050877 0.6385880 ) + 22 O tau( 22) = ( -0.3050877 0.6949123 0.6385880 ) + 23 O tau( 23) = ( 0.8050877 1.1949123 0.9578820 ) + 24 O tau( 24) = ( 0.1949123 1.8050877 0.9578820 ) + 25 Ti tau( 25) = ( 1.0000000 0.0000000 0.0000000 ) + 26 Ti tau( 26) = ( 1.5000000 0.5000000 0.3192940 ) + 27 O tau( 27) = ( 1.3050877 0.3050877 0.0000000 ) + 28 O tau( 28) = ( 0.6949123 -0.3050877 0.0000000 ) + 29 O tau( 29) = ( 1.8050877 0.1949123 0.3192940 ) + 30 O tau( 30) = ( 1.1949123 0.8050877 0.3192940 ) + 31 Ti tau( 31) = ( 1.0000000 0.0000000 0.6385880 ) + 32 Ti tau( 32) = ( 1.5000000 0.5000000 0.9578820 ) + 33 O tau( 33) = ( 1.3050877 0.3050877 0.6385880 ) + 34 O tau( 34) = ( 0.6949123 -0.3050877 0.6385880 ) + 35 O tau( 35) = ( 1.8050877 0.1949123 0.9578820 ) + 36 O tau( 36) = ( 1.1949123 0.8050877 0.9578820 ) + 37 Ti tau( 37) = ( 1.0000000 1.0000000 0.0000000 ) + 38 Ti tau( 38) = ( 1.5000000 1.5000000 0.3192940 ) + 39 O tau( 39) = ( 1.3050877 1.3050877 0.0000000 ) + 40 O tau( 40) = ( 0.6949123 0.6949123 0.0000000 ) + 41 O tau( 41) = ( 1.8050877 1.1949123 0.3192940 ) + 42 O tau( 42) = ( 1.1949123 1.8050877 0.3192940 ) + 43 Ti tau( 43) = ( 1.0000000 1.0000000 0.6385880 ) + 44 Ti tau( 44) = ( 1.5000000 1.5000000 0.9578820 ) + 45 O tau( 45) = ( 1.3050877 1.3050877 0.6385880 ) + 46 O tau( 46) = ( 0.6949123 0.6949123 0.6385880 ) + 47 O tau( 47) = ( 1.8050877 1.1949123 0.9578820 ) + 48 O tau( 48) = ( 1.1949123 1.8050877 0.9578820 ) + + number of k points= 1 + cart. coord. in units 2pi/alat + k( 1) = ( -0.2500000 -0.2500000 -0.3914887), wk = 2.0000000 + + Dense grid: 465167 G-vectors FFT dimensions: ( 120, 120, 72) + + Largest allocated arrays est. size (Mb) dimensions + Kohn-Sham Wavefunctions 7.14 Mb ( 2436, 192) + NL pseudopotentials 5.95 Mb ( 2436, 160) + Each V/rho on FFT grid 0.66 Mb ( 43200) + Each G-vector array 0.15 Mb ( 19383) + G-vector shells 0.06 Mb ( 7897) + Largest temporary arrays est. size (Mb) dimensions + Auxiliary wavefunctions 28.55 Mb ( 2436, 768) + Each subspace H/S matrix 1.00 Mb ( 256, 256) + Each matrix 0.47 Mb ( 160, 192) + Arrays for rho mixing 5.27 Mb ( 43200, 8) + writing wfc files to a dedicated directory + + Initial potential from superposition of free atoms + + starting charge 319.99995, renormalised to 384.00000 + Starting wfc are 272 randomized atomic wfcs + + total cpu time spent up to now is 5.1 secs + + per-process dynamical memory: 36.5 Mb + + Self-consistent Calculation + + iteration # 1 ecut= 100.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 1.00E-02, avg # of iterations = 2.0 + + total cpu time spent up to now is 13.5 secs + + total energy = -2884.42141711 Ry + Harris-Foulkes estimate = -2906.91049596 Ry + estimated scf accuracy < 31.81354340 Ry + + iteration # 2 ecut= 100.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 8.28E-03, avg # of iterations = 2.0 + + total cpu time spent up to now is 21.5 secs + + total energy = -2892.13100419 Ry + Harris-Foulkes estimate = -2893.85752594 Ry + estimated scf accuracy < 2.81830807 Ry + + iteration # 3 ecut= 100.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 7.34E-04, avg # of iterations = 5.0 + + total cpu time spent up to now is 34.2 secs + + total energy = -2892.40618315 Ry + Harris-Foulkes estimate = -2896.56363395 Ry + estimated scf accuracy < 27.57647255 Ry + + iteration # 4 ecut= 100.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 7.34E-04, avg # of iterations = 5.0 + + total cpu time spent up to now is 45.4 secs + + total energy = -2893.65314169 Ry + Harris-Foulkes estimate = -2894.01604806 Ry + estimated scf accuracy < 1.76379667 Ry + + iteration # 5 ecut= 100.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 4.59E-04, avg # of iterations = 1.0 + + total cpu time spent up to now is 50.3 secs + + total energy = -2893.51723641 Ry + Harris-Foulkes estimate = -2893.69978961 Ry + estimated scf accuracy < 0.77822505 Ry + + iteration # 6 ecut= 100.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 2.03E-04, avg # of iterations = 4.0 + + total cpu time spent up to now is 59.4 secs + + total energy = -2893.74503872 Ry + Harris-Foulkes estimate = -2893.75696816 Ry + estimated scf accuracy < 0.05309055 Ry + + iteration # 7 ecut= 100.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 1.38E-05, avg # of iterations = 2.0 + + total cpu time spent up to now is 65.0 secs + + total energy = -2893.73983165 Ry + Harris-Foulkes estimate = -2893.74801239 Ry + estimated scf accuracy < 0.02242147 Ry + + iteration # 8 ecut= 100.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 5.84E-06, avg # of iterations = 4.0 + + total cpu time spent up to now is 75.1 secs + + total energy = -2893.74900970 Ry + Harris-Foulkes estimate = -2893.74956765 Ry + estimated scf accuracy < 0.00722472 Ry + + iteration # 9 ecut= 100.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 1.88E-06, avg # of iterations = 1.0 + + total cpu time spent up to now is 80.0 secs + + total energy = -2893.74814739 Ry + Harris-Foulkes estimate = -2893.74906370 Ry + estimated scf accuracy < 0.00588493 Ry + + iteration # 10 ecut= 100.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 1.53E-06, avg # of iterations = 1.0 + + total cpu time spent up to now is 84.9 secs + + total energy = -2893.74811231 Ry + Harris-Foulkes estimate = -2893.74827486 Ry + estimated scf accuracy < 0.00310783 Ry + + iteration # 11 ecut= 100.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 8.09E-07, avg # of iterations = 1.0 + + total cpu time spent up to now is 89.9 secs + + total energy = -2893.74799681 Ry + Harris-Foulkes estimate = -2893.74818422 Ry + estimated scf accuracy < 0.00265147 Ry + + iteration # 12 ecut= 100.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 6.90E-07, avg # of iterations = 3.0 + + total cpu time spent up to now is 95.2 secs + + total energy = -2893.74818471 Ry + Harris-Foulkes estimate = -2893.74808635 Ry + estimated scf accuracy < 0.00169862 Ry + + iteration # 13 ecut= 100.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 4.42E-07, avg # of iterations = 3.0 + + total cpu time spent up to now is 100.6 secs + + total energy = -2893.74808241 Ry + Harris-Foulkes estimate = -2893.74823701 Ry + estimated scf accuracy < 0.00167293 Ry + + iteration # 14 ecut= 100.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 4.36E-07, avg # of iterations = 3.0 + + total cpu time spent up to now is 106.3 secs + + total energy = -2893.74852071 Ry + Harris-Foulkes estimate = -2893.74818549 Ry + estimated scf accuracy < 0.00068989 Ry + + iteration # 15 ecut= 100.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 1.80E-07, avg # of iterations = 4.0 + + total cpu time spent up to now is 113.6 secs + + total energy = -2893.74846301 Ry + Harris-Foulkes estimate = -2893.74862653 Ry + estimated scf accuracy < 0.00200325 Ry + + iteration # 16 ecut= 100.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 1.80E-07, avg # of iterations = 1.0 + + total cpu time spent up to now is 118.5 secs + + total energy = -2893.74805819 Ry + Harris-Foulkes estimate = -2893.74847641 Ry + estimated scf accuracy < 0.00162460 Ry + + iteration # 17 ecut= 100.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 1.80E-07, avg # of iterations = 4.0 + + total cpu time spent up to now is 128.0 secs + + total energy = -2893.74825070 Ry + Harris-Foulkes estimate = -2893.74827960 Ry + estimated scf accuracy < 0.00011797 Ry + + iteration # 18 ecut= 100.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 3.07E-08, avg # of iterations = 4.0 + + total cpu time spent up to now is 134.3 secs + + total energy = -2893.74824977 Ry + Harris-Foulkes estimate = -2893.74826067 Ry + estimated scf accuracy < 0.00003128 Ry + + iteration # 19 ecut= 100.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 8.15E-09, avg # of iterations = 5.0 + + total cpu time spent up to now is 144.3 secs + + total energy = -2893.74826174 Ry + Harris-Foulkes estimate = -2893.74826276 Ry + estimated scf accuracy < 0.00001338 Ry + + iteration # 20 ecut= 100.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 3.48E-09, avg # of iterations = 5.0 + + total cpu time spent up to now is 154.0 secs + + total energy = -2893.74826019 Ry + Harris-Foulkes estimate = -2893.74826605 Ry + estimated scf accuracy < 0.00003018 Ry + + iteration # 21 ecut= 100.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 3.48E-09, avg # of iterations = 4.0 + + total cpu time spent up to now is 161.9 secs + + total energy = -2893.74826286 Ry + Harris-Foulkes estimate = -2893.74826246 Ry + estimated scf accuracy < 0.00001174 Ry + + iteration # 22 ecut= 100.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 3.06E-09, avg # of iterations = 4.0 + + total cpu time spent up to now is 168.0 secs + + total energy = -2893.74826016 Ry + Harris-Foulkes estimate = -2893.74826372 Ry + estimated scf accuracy < 0.00001543 Ry + + iteration # 23 ecut= 100.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 3.06E-09, avg # of iterations = 4.0 + + total cpu time spent up to now is 174.3 secs + + total energy = -2893.74826006 Ry + Harris-Foulkes estimate = -2893.74826111 Ry + estimated scf accuracy < 0.00000582 Ry + + iteration # 24 ecut= 100.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 1.52E-09, avg # of iterations = 4.0 + + total cpu time spent up to now is 180.6 secs + + total energy = -2893.74826020 Ry + Harris-Foulkes estimate = -2893.74826058 Ry + estimated scf accuracy < 0.00000247 Ry + + iteration # 25 ecut= 100.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 6.43E-10, avg # of iterations = 4.0 + + total cpu time spent up to now is 188.0 secs + + total energy = -2893.74826020 Ry + Harris-Foulkes estimate = -2893.74826058 Ry + estimated scf accuracy < 0.00000090 Ry + + iteration # 26 ecut= 100.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 2.33E-10, avg # of iterations = 5.0 + + total cpu time spent up to now is 198.5 secs + + total energy = -2893.74826046 Ry + Harris-Foulkes estimate = -2893.74826059 Ry + estimated scf accuracy < 0.00000064 Ry + + iteration # 27 ecut= 100.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 1.66E-10, avg # of iterations = 4.0 + + total cpu time spent up to now is 204.2 secs + + total energy = -2893.74826039 Ry + Harris-Foulkes estimate = -2893.74826049 Ry + estimated scf accuracy < 0.00000031 Ry + + iteration # 28 ecut= 100.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 8.12E-11, avg # of iterations = 4.0 + + total cpu time spent up to now is 213.5 secs + + total energy = -2893.74826046 Ry + Harris-Foulkes estimate = -2893.74826048 Ry + estimated scf accuracy < 0.00000009 Ry + + iteration # 29 ecut= 100.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 2.26E-11, avg # of iterations = 4.0 + + total cpu time spent up to now is 220.7 secs + + total energy = -2893.74826047 Ry + Harris-Foulkes estimate = -2893.74826047 Ry + estimated scf accuracy < 0.00000003 Ry + + iteration # 30 ecut= 100.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 8.38E-12, avg # of iterations = 4.0 + + total cpu time spent up to now is 228.2 secs + + total energy = -2893.74826047 Ry + Harris-Foulkes estimate = -2893.74826047 Ry + estimated scf accuracy < 0.00000001 Ry + + iteration # 31 ecut= 100.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 3.37E-12, avg # of iterations = 5.0 + + total cpu time spent up to now is 235.5 secs + + total energy = -2893.74826047 Ry + Harris-Foulkes estimate = -2893.74826047 Ry + estimated scf accuracy < 1.9E-09 Ry + + iteration # 32 ecut= 100.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 4.87E-13, avg # of iterations = 5.0 + + total cpu time spent up to now is 246.2 secs + + total energy = -2893.74826047 Ry + Harris-Foulkes estimate = -2893.74826047 Ry + estimated scf accuracy < 2.5E-09 Ry + + iteration # 33 ecut= 100.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 4.87E-13, avg # of iterations = 4.0 + + total cpu time spent up to now is 254.8 secs + + total energy = -2893.74826047 Ry + Harris-Foulkes estimate = -2893.74826047 Ry + estimated scf accuracy < 7.9E-10 Ry + + iteration # 34 ecut= 100.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 2.07E-13, avg # of iterations = 5.0 + + total cpu time spent up to now is 262.4 secs + + total energy = -2893.74826047 Ry + Harris-Foulkes estimate = -2893.74826047 Ry + estimated scf accuracy < 1.0E-10 Ry + + iteration # 35 ecut= 100.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 1.00E-13, avg # of iterations = 4.0 + + total cpu time spent up to now is 269.6 secs + + End of self-consistent calculation + + k =-0.2500-0.2500-0.3915 ( 58152 PWs) bands (ev): + + -48.4006 -48.4006 -48.4006 -48.4006 -48.4006 -48.4006 -48.4006 -48.4006 + -48.3971 -48.3971 -48.3971 -48.3971 -48.3971 -48.3971 -48.3971 -48.3971 + -24.8741 -24.8741 -24.8741 -24.8741 -24.8740 -24.8740 -24.8740 -24.8740 + -24.8617 -24.8617 -24.8617 -24.8617 -24.8617 -24.8617 -24.8617 -24.8617 + -24.7917 -24.7917 -24.7917 -24.7917 -24.7916 -24.7916 -24.7916 -24.7916 + -24.7474 -24.7474 -24.7474 -24.7474 -24.7474 -24.7474 -24.7474 -24.7474 + -24.7217 -24.7217 -24.7217 -24.7217 -24.7217 -24.7217 -24.7217 -24.7217 + -24.6898 -24.6898 -24.6898 -24.6898 -24.6898 -24.6898 -24.6898 -24.6898 + -8.4145 -8.4145 -8.4145 -8.4145 -8.4145 -8.4145 -8.4145 -8.4145 + -7.9030 -7.9030 -7.9030 -7.9030 -7.9030 -7.9030 -7.9030 -7.9030 + -7.7726 -7.7726 -7.7726 -7.7726 -7.7726 -7.7726 -7.7726 -7.7726 + -7.6940 -7.6940 -7.6940 -7.6940 -7.6940 -7.6940 -7.6940 -7.6940 + 4.0450 4.0450 4.0450 4.0450 4.0450 4.0450 4.0450 4.0450 + 4.4378 4.4378 4.4378 4.4378 4.4378 4.4378 4.4378 4.4378 + 4.6427 4.6427 4.6427 4.6427 4.6427 4.6427 4.6427 4.6427 + 4.8490 4.8490 4.8490 4.8490 4.8490 4.8490 4.8490 4.8490 + 5.3577 5.3577 5.3577 5.3577 5.3577 5.3577 5.3577 5.3577 + 5.8577 5.8577 5.8577 5.8577 5.8577 5.8577 5.8577 5.8577 + 6.0689 6.0689 6.0689 6.0689 6.0689 6.0689 6.0689 6.0689 + 6.5671 6.5671 6.5671 6.5671 6.5671 6.5671 6.5671 6.5671 + 7.1172 7.1172 7.1172 7.1172 7.1172 7.1172 7.1172 7.1172 + 7.3176 7.3176 7.3176 7.3176 7.3176 7.3176 7.3177 7.3177 + 7.6762 7.6762 7.6762 7.6762 7.6762 7.6762 7.6762 7.6762 + 8.2575 8.2575 8.2575 8.2575 8.2575 8.2575 8.2575 8.2575 + +! total energy = -2893.74826047 Ry + Harris-Foulkes estimate = -2893.74826047 Ry + estimated scf accuracy < 6.9E-11 Ry + + The total energy is the sum of the following terms: + + one-electron contribution = -1031.00495247 Ry + hartree contribution = 692.51164607 Ry + xc contribution = -457.83735245 Ry + ewald contribution = -2097.41760163 Ry + + convergence has been achieved in 35 iterations + + Forces acting on atoms (Ry/au): + + atom 1 type 1 force = 0.00000000 0.00000000 0.00000000 + atom 2 type 1 force = 0.00000066 0.00000066 -0.00000030 + atom 3 type 2 force = 0.00767316 0.00767316 0.00000000 + atom 4 type 2 force = -0.00767316 -0.00767316 0.00000000 + atom 5 type 2 force = 0.00767277 -0.00767280 -0.00000033 + atom 6 type 2 force = -0.00767280 0.00767277 -0.00000033 + atom 7 type 1 force = 0.00000000 0.00000000 0.00000000 + atom 8 type 1 force = 0.00000066 0.00000066 0.00000030 + atom 9 type 2 force = 0.00767309 0.00767309 0.00000000 + atom 10 type 2 force = -0.00767309 -0.00767309 0.00000000 + atom 11 type 2 force = 0.00767277 -0.00767280 0.00000033 + atom 12 type 2 force = -0.00767280 0.00767277 0.00000033 + atom 13 type 1 force = 0.00000000 0.00000000 0.00000000 + atom 14 type 1 force = 0.00000005 -0.00000005 -0.00000130 + atom 15 type 2 force = 0.00767283 0.00767254 0.00000000 + atom 16 type 2 force = -0.00767283 -0.00767254 0.00000000 + atom 17 type 2 force = 0.00767313 -0.00767313 0.00000058 + atom 18 type 2 force = -0.00767285 0.00767285 0.00000017 + atom 19 type 1 force = 0.00000000 0.00000000 0.00000000 + atom 20 type 1 force = 0.00000005 -0.00000005 0.00000130 + atom 21 type 2 force = 0.00767283 0.00767291 0.00000000 + atom 22 type 2 force = -0.00767283 -0.00767291 0.00000000 + atom 23 type 2 force = 0.00767313 -0.00767313 -0.00000058 + atom 24 type 2 force = -0.00767285 0.00767285 -0.00000017 + atom 25 type 1 force = 0.00000000 0.00000000 0.00000000 + atom 26 type 1 force = -0.00000005 0.00000005 -0.00000130 + atom 27 type 2 force = 0.00767254 0.00767283 0.00000000 + atom 28 type 2 force = -0.00767254 -0.00767283 0.00000000 + atom 29 type 2 force = 0.00767285 -0.00767285 0.00000017 + atom 30 type 2 force = -0.00767313 0.00767313 0.00000058 + atom 31 type 1 force = 0.00000000 0.00000000 0.00000000 + atom 32 type 1 force = -0.00000005 0.00000005 0.00000130 + atom 33 type 2 force = 0.00767291 0.00767283 0.00000000 + atom 34 type 2 force = -0.00767291 -0.00767283 0.00000000 + atom 35 type 2 force = 0.00767285 -0.00767285 -0.00000017 + atom 36 type 2 force = -0.00767313 0.00767313 -0.00000058 + atom 37 type 1 force = 0.00000000 0.00000000 0.00000000 + atom 38 type 1 force = -0.00000066 -0.00000066 -0.00000030 + atom 39 type 2 force = 0.00767311 0.00767311 0.00000000 + atom 40 type 2 force = -0.00767311 -0.00767311 0.00000000 + atom 41 type 2 force = 0.00767280 -0.00767277 -0.00000033 + atom 42 type 2 force = -0.00767277 0.00767280 -0.00000033 + atom 43 type 1 force = 0.00000000 0.00000000 0.00000000 + atom 44 type 1 force = -0.00000066 -0.00000066 0.00000030 + atom 45 type 2 force = 0.00767284 0.00767284 0.00000000 + atom 46 type 2 force = -0.00767284 -0.00767284 0.00000000 + atom 47 type 2 force = 0.00767280 -0.00767277 0.00000033 + atom 48 type 2 force = -0.00767277 0.00767280 0.00000033 + + Total force = 0.061383 Total SCF correction = 0.000021 + + + entering subroutine stress ... + + total stress (Ry/bohr**3) (kbar) P= -247.07 + -0.00160285 0.00000000 0.00000000 -235.79 0.00 0.00 + 0.00000000 -0.00160285 0.00000000 0.00 -235.79 0.00 + 0.00000000 0.00000000 -0.00183290 0.00 0.00 -269.63 + + + init_run : 4.58s CPU 4.79s WALL ( 1 calls) + electrons : 256.40s CPU 264.47s WALL ( 1 calls) + forces : 1.08s CPU 1.08s WALL ( 1 calls) + stress : 3.10s CPU 3.11s WALL ( 1 calls) + + Called by init_run: + wfcinit : 2.45s CPU 2.55s WALL ( 1 calls) + potinit : 0.67s CPU 0.69s WALL ( 1 calls) + + Called by electrons: + c_bands : 228.20s CPU 231.32s WALL ( 35 calls) + sum_band : 22.97s CPU 24.00s WALL ( 35 calls) + v_of_rho : 3.44s CPU 3.54s WALL ( 36 calls) + mix_rho : 0.78s CPU 0.85s WALL ( 35 calls) + + Called by c_bands: + init_us_2 : 0.33s CPU 1.41s WALL ( 71 calls) + cegterg : 227.33s CPU 230.40s WALL ( 35 calls) + + Called by *egterg: + h_psi : 124.45s CPU 124.74s WALL ( 160 calls) + g_psi : 0.41s CPU 0.41s WALL ( 124 calls) + cdiaghg : 38.02s CPU 38.62s WALL ( 159 calls) + + Called by h_psi: + add_vuspsi : 7.63s CPU 7.82s WALL ( 160 calls) + + General routines + calbec : 8.66s CPU 8.58s WALL ( 162 calls) + fft : 2.28s CPU 2.34s WALL ( 403 calls) + fftw : 124.66s CPU 120.32s WALL ( 42816 calls) + + Parallel routines + fft_scatter : 91.90s CPU 59.67s WALL ( 43219 calls) + EXX routines + + PWSCF : 4m25.32s CPU 4m34.35s WALL + + + This run was terminated on: 15: 4:45 2Nov2012 + +=------------------------------------------------------------------------------= + JOB DONE. +=------------------------------------------------------------------------------= +Application 12692097 resources: utime ~6453s, stime ~115s Rss ~136416 inblocks ~70076 outblocks ~595905 diff --git a/tests/apps/miniDFT/tests/espresso/test/Si.lda.UPF b/tests/apps/miniDFT/tests/espresso/test/Si.lda.UPF new file mode 100644 index 0000000000..a77e2cc106 --- /dev/null +++ b/tests/apps/miniDFT/tests/espresso/test/Si.lda.UPF @@ -0,0 +1,2373 @@ + + + Generated using "atomic" code by A. Dal Corso (Quantum ESPRESSO distribution) + Author: anonymous + Generation date: 18Feb2011 + Pseudopotential type: NC + Element: Si + Functional: PZ + + Suggested minimum cutoff for wavefunctions: 0. Ry + Suggested minimum cutoff for charge density: 0. Ry + The Pseudo was generated with a Non-Relativistic Calculation + L component and cutoff radius for Local Potential: 2 2.0700 + + Valence configuration: + nl pn l occ Rcut Rcut US E pseu + 3S 1 0 2.00 1.750 1.750 -0.796627 + 3P 2 1 2.00 1.930 1.930 -0.307052 + Generation configuration: + 3S 1 0 2.00 1.750 1.750 -0.796627 + 3P 2 1 2.00 1.930 1.930 -0.307052 + 3D 3 2 0.00 2.070 2.070 -0.306000 + + Pseudization used: troullier-martins + Comment: + + + + + + + + 6.513442611103688E-005 6.595371633350160E-005 6.678331195832731E-005 6.762334261151814E-005 + 6.847393954957285E-005 6.933523567999349E-005 7.020736558205276E-005 7.109046552782222E-005 + 7.198467350346503E-005 7.289012923079676E-005 7.380697418911693E-005 7.473535163731562E-005 + 7.567540663625787E-005 7.662728607144977E-005 7.759113867598985E-005 7.856711505380845E-005 + 7.955536770320024E-005 8.055605104065229E-005 8.156932142497194E-005 8.259533718171841E-005 + 8.363425862794104E-005 8.468624809722948E-005 8.575146996507863E-005 8.683009067457247E-005 + 8.792227876239150E-005 8.902820488514639E-005 9.014804184604389E-005 9.128196462188746E-005 + 9.243015039041771E-005 9.359277855799713E-005 9.477003078764225E-005 9.596209102740905E-005 + 9.716914553913527E-005 9.839138292754407E-005 9.962899416971422E-005 1.008821726449201E-004 + 1.021511141648482E-004 1.034360170041926E-004 1.047370819316360E-004 1.060545122412205E-004 + 1.073885137841123E-004 1.087392950007665E-004 1.101070669534965E-004 1.114920433594523E-004 + 1.128944406240155E-004 1.143144778746117E-004 1.157523769949505E-004 1.172083626596947E-004 + 1.186826623695667E-004 1.201755064868958E-004 1.216871282716124E-004 1.232177639176959E-004 + 1.247676525900800E-004 1.263370364620229E-004 1.279261607529478E-004 1.295352737667582E-004 + 1.311646269306362E-004 1.328144748343287E-004 1.344850752699270E-004 1.361766892721483E-004 + 1.378895811591221E-004 1.396240185736905E-004 1.413802725252283E-004 1.431586174319885E-004 + 1.449593311639810E-004 1.467826950863899E-004 1.486289941035378E-004 1.504985167034024E-004 + 1.523915550026935E-004 1.543084047924968E-004 1.562493655844918E-004 1.582147406577512E-004 + 1.602048371061288E-004 1.622199658862433E-004 1.642604418660669E-004 1.663265838741224E-004 + 1.684187147493024E-004 1.705371613913124E-004 1.726822548117502E-004 1.748543301858273E-004 + 1.770537269047399E-004 1.792807886286999E-004 1.815358633406327E-004 1.838193034005500E-004 + 1.861314656006070E-004 1.884727112208516E-004 1.908434060856750E-004 1.932439206209733E-004 + 1.956746299120263E-004 1.981359137621063E-004 2.006281567518223E-004 2.031517482992120E-004 + 2.057070827205888E-004 2.082945592921548E-004 2.109145823123890E-004 2.135675611652186E-004 + 2.162539103839868E-004 2.189740497162245E-004 2.217284041892364E-004 2.245174041765129E-004 + 2.273414854649762E-004 2.302010893230733E-004 2.330966625697249E-004 2.360286576441416E-004 + 2.389975326765194E-004 2.420037515596223E-004 2.450477840212667E-004 2.481301056977181E-004 + 2.512511982080092E-004 2.544115492291950E-004 2.576116525725522E-004 2.608520082607388E-004 + 2.641331226059237E-004 2.674555082888986E-004 2.708196844391863E-004 2.742261767161545E-004 + 2.776755173911522E-004 2.811682454306774E-004 2.847049065805922E-004 2.882860534513970E-004 + 2.919122456045762E-004 2.955840496400312E-004 2.993020392846129E-004 3.030667954817672E-004 + 3.068789064823100E-004 3.107389679363406E-004 3.146475829863146E-004 3.186053623612859E-004 + 3.226129244723333E-004 3.266708955091909E-004 3.307799095380890E-004 3.349406086008293E-004 + 3.391536428151055E-004 3.434196704760847E-004 3.477393581592688E-004 3.521133808246465E-004 + 3.565424219221584E-004 3.610271734984867E-004 3.655683363051894E-004 3.701666199081946E-004 + 3.748227427986703E-004 3.795374325052911E-004 3.843114257079158E-004 3.891454683526947E-004 + 3.940403157686265E-004 3.989967327855786E-004 4.040154938537935E-004 4.090973831648989E-004 + 4.142431947744387E-004 4.194537327259466E-004 4.247298111765782E-004 4.300722545243257E-004 + 4.354818975368313E-004 4.409595854818215E-004 4.465061742591829E-004 4.521225305346962E-004 + 4.578095318754559E-004 4.635680668869920E-004 4.693990353521151E-004 4.753033483715124E-004 + 4.812819285061048E-004 4.873357099212019E-004 4.934656385324665E-004 4.996726721537150E-004 + 5.059577806465804E-004 5.123219460720500E-004 5.187661628439208E-004 5.252914378841740E-004 + 5.318987907803099E-004 5.385892539446626E-004 5.453638727757115E-004 5.522237058214337E-004 + 5.591698249446982E-004 5.662033154907496E-004 5.733252764567971E-004 5.805368206637293E-004 + 5.878390749300021E-004 5.952331802477007E-004 6.027202919608236E-004 6.103015799458105E-004 + 6.179782287943310E-004 6.257514379983876E-004 6.336224221377328E-004 6.415924110696512E-004 + 6.496626501211302E-004 6.578344002834385E-004 6.661089384091661E-004 6.744875574117294E-004 + 6.829715664673932E-004 6.915622912198352E-004 7.002610739872734E-004 7.090692739722151E-004 + 7.179882674738274E-004 7.270194481029906E-004 7.361642270000536E-004 7.454240330553219E-004 + 7.548003131323325E-004 7.642945322939235E-004 7.739081740311538E-004 7.836427404951063E-004 + 7.934997527315935E-004 8.034807509188332E-004 8.135872946080984E-004 8.238209629674016E-004 + 8.341833550282468E-004 8.446760899354727E-004 8.553008072002587E-004 8.660591669562928E-004 + 8.769528502191741E-004 8.879835591490780E-004 8.991530173167141E-004 9.104629699726479E-004 + 9.219151843199911E-004 9.335114497905343E-004 9.452535783243529E-004 9.571434046529162E-004 + 9.691827865857810E-004 9.813736053008674E-004 9.937177656384013E-004 1.006217196398553E-003 + 1.018873850642804E-003 1.031689705999134E-003 1.044666764971016E-003 1.057807055250314E-003 + 1.071112630034123E-003 1.084585568345567E-003 1.098227975358674E-003 1.112041982727292E-003 + 1.126029748918178E-003 1.140193459548259E-003 1.154535327726134E-003 1.169057594397888E-003 + 1.183762528697233E-003 1.198652428300069E-003 1.213729619783506E-003 1.228996458989385E-003 + 1.244455331392394E-003 1.260108652472797E-003 1.275958868093860E-003 1.292008454884022E-003 + 1.308259920623870E-003 1.324715804637992E-003 1.341378678191744E-003 1.358251144893018E-003 + 1.375335841099066E-003 1.392635436328428E-003 1.410152633678056E-003 1.427890170245674E-003 + 1.445850817557457E-003 1.464037382001090E-003 1.482452705264267E-003 1.501099664778717E-003 + 1.519981174169798E-003 1.539100183711769E-003 1.558459680788769E-003 1.578062690361603E-003 + 1.597912275440400E-003 1.618011537563212E-003 1.638363617280638E-003 1.658971694646541E-003 + 1.679838989714936E-003 1.700968763043134E-003 1.722364316201205E-003 1.744028992287860E-003 + 1.765966176452814E-003 1.788179296425725E-003 1.810671823051782E-003 1.833447270834031E-003 + 1.856509198482525E-003 1.879861209470379E-003 1.903506952596820E-003 1.927450122557321E-003 + 1.951694460520898E-003 1.976243754714684E-003 2.001101841015845E-003 2.026272603550936E-003 + 2.051759975302817E-003 2.077567938725177E-003 2.103700526364807E-003 2.130161821491694E-003 + 2.156955958737036E-003 2.184087124739293E-003 2.211559558798350E-003 2.239377553537921E-003 + 2.267545455576282E-003 2.296067666205433E-003 2.324948642078817E-003 2.354192895907669E-003 + 2.383804997166149E-003 2.413789572805326E-003 2.444151307976146E-003 2.474894946761502E-003 + 2.506025292917502E-003 2.537547210624069E-003 2.569465625244976E-003 2.601785524097445E-003 + 2.634511957231429E-003 2.667650038218687E-003 2.701204944951792E-003 2.735181920453190E-003 + 2.769586273694429E-003 2.804423380425701E-003 2.839698684015808E-003 2.875417696302704E-003 + 2.911585998454730E-003 2.948209241842682E-003 2.985293148922851E-003 3.022843514131166E-003 + 3.060866204788585E-003 3.099367162017884E-003 3.138352401671959E-003 3.177828015273824E-003 + 3.217800170968416E-003 3.258275114486386E-003 3.299259170120009E-003 3.340758741711356E-003 + 3.382780313652924E-003 3.425330451900819E-003 3.468415805000712E-003 3.512043105126685E-003 + 3.556219169133139E-003 3.600950899619956E-003 3.646245286011030E-003 3.692109405646387E-003 + 3.738550424888027E-003 3.785575600239700E-003 3.833192279480724E-003 3.881407902814107E-003 + 3.930230004029090E-003 3.979666211678314E-003 4.029724250269811E-003 4.080411941473949E-003 + 4.131737205345606E-003 4.183708061561682E-003 4.236332630674195E-003 4.289619135379139E-003 + 4.343575901801284E-003 4.398211360795159E-003 4.453534049262390E-003 4.509552611485598E-003 + 4.566275800479113E-003 4.623712479356611E-003 4.681871622716024E-003 4.740762318041832E-003 + 4.800393767124983E-003 4.860775287500728E-003 4.921916313904469E-003 4.983826399745975E-003 + 5.046515218602116E-003 5.109992565728373E-003 5.174268359589390E-003 5.239352643408724E-003 + 5.305255586738136E-003 5.371987487046604E-003 5.439558771329309E-003 5.507979997736908E-003 + 5.577261857225227E-003 5.647415175225763E-003 5.718450913337185E-003 5.790380171038089E-003 + 5.863214187421343E-003 5.936964342950183E-003 6.011642161236457E-003 6.087259310841205E-003 + 6.163827607097892E-003 6.241359013958599E-003 6.319865645863380E-003 6.399359769633193E-003 + 6.479853806386611E-003 6.561360333480635E-003 6.643892086475964E-003 6.727461961126907E-003 + 6.812083015396403E-003 6.897768471496347E-003 6.984531717953575E-003 7.072386311701879E-003 + 7.161345980200268E-003 7.251424623577934E-003 7.342636316806176E-003 7.434995311897618E-003 + 7.528516040133167E-003 7.623213114316872E-003 7.719101331059236E-003 7.816195673089213E-003 + 7.914511311595282E-003 8.014063608595981E-003 8.114868119340268E-003 8.216940594738030E-003 + 8.320296983821215E-003 8.424953436235899E-003 8.530926304765688E-003 8.638232147886909E-003 + 8.746887732355853E-003 8.856910035828664E-003 8.968316249514094E-003 9.081123780859682E-003 + 9.195350256271731E-003 9.311013523869408E-003 9.428131656273592E-003 9.546722953430753E-003 + 9.666805945472336E-003 9.788399395610176E-003 9.911522303068234E-003 1.003619390605130E-002 + 1.016243368475098E-002 1.029026136438952E-002 1.041969691830196E-002 1.055076057105692E-002 + 1.068347280161680E-002 1.081785434653762E-002 1.095392620320918E-002 1.109170963313593E-002 + 1.123122616525912E-002 1.137249759932074E-002 1.151554600926978E-002 1.166039374671131E-002 + 1.180706344439904E-002 1.195557801977161E-002 1.210596067853358E-002 1.225823491828135E-002 + 1.241242453217465E-002 1.256855361265440E-002 1.272664655520704E-002 1.288672806217649E-002 + 1.304882314662391E-002 1.321295713623602E-002 1.337915567728265E-002 1.354744473862395E-002 + 1.371785061576816E-002 1.389039993498026E-002 1.406511965744243E-002 1.424203708346680E-002 + 1.442117985676110E-002 1.460257596874815E-002 1.478625376293949E-002 1.497224193936413E-002 + 1.516056955905308E-002 1.535126604858005E-002 1.554436120465950E-002 1.573988519880243E-002 + 1.593786858203070E-002 1.613834228965078E-002 1.634133764608732E-002 1.654688636977778E-002 + 1.675502057812842E-002 1.696577279253272E-002 1.717917594345301E-002 1.739526337556577E-002 + 1.761406885297190E-002 1.783562656447241E-002 1.805997112891046E-002 1.828713760058072E-002 + 1.851716147470654E-002 1.875007869298625E-002 1.898592564920906E-002 1.922473919494171E-002 + 1.946655664528662E-002 1.971141578471237E-002 1.995935487295767E-002 2.021041265100950E-002 + 2.046462834715643E-002 2.072204168311824E-002 2.098269288025235E-002 2.124662266583862E-002 + 2.151387227944302E-002 2.178448347936138E-002 2.205849854914428E-002 2.233596030420385E-002 + 2.261691209850381E-002 2.290139783133363E-002 2.318946195416784E-002 2.348114947761173E-002 + 2.377650597843426E-002 2.407557760668960E-002 2.437841109292813E-002 2.468505375549818E-002 + 2.499555350793967E-002 2.530995886647063E-002 2.562831895756798E-002 2.595068352564368E-002 + 2.627710294081731E-002 2.660762820678665E-002 2.694231096879693E-002 2.728120352171065E-002 + 2.762435881817868E-002 2.797183047691421E-002 2.832367279107093E-002 2.867994073672620E-002 + 2.904068998147138E-002 2.940597689310991E-002 2.977585854846488E-002 3.015039274229754E-002 + 3.052963799633763E-002 3.091365356842768E-002 3.130249946178211E-002 3.169623643436285E-002 + 3.209492600837298E-002 3.249863047986955E-002 3.290741292849757E-002 3.332133722734634E-002 + 3.374046805292962E-002 3.416487089529173E-002 3.459461206824019E-002 3.502975871970760E-002 + 3.547037884224356E-002 3.591654128363864E-002 3.636831575768208E-002 3.682577285505458E-002 + 3.728898405435831E-002 3.775802173328555E-002 3.823295917992788E-002 3.871387060422766E-002 + 3.920083114957333E-002 3.969391690454083E-002 4.019320491478257E-002 4.069877319506593E-002 + 4.121070074146334E-002 4.172906754369543E-002 4.225395459762966E-002 4.278544391793613E-002 + 4.332361855090239E-002 4.386856258740985E-002 4.442036117607288E-002 4.497910053654360E-002 + 4.554486797298384E-002 4.611775188770657E-002 4.669784179498910E-002 4.728522833505959E-002 + 4.788000328825998E-002 4.848225958938678E-002 4.909209134221231E-002 4.970959383418872E-002 + 5.033486355133670E-002 5.096799819332164E-002 5.160909668871948E-002 5.225825921047441E-002 + 5.291558719155128E-002 5.358118334078444E-002 5.425515165892635E-002 5.493759745489792E-002 + 5.562862736224321E-002 5.632834935579120E-002 5.703687276852695E-002 5.775430830867521E-002 + 5.848076807699875E-002 5.921636558431431E-002 5.996121576922910E-002 6.071543501609988E-002 + 6.147914117321845E-002 6.225245357122561E-002 6.303549304175680E-002 6.382838193632255E-002 + 6.463124414542570E-002 6.544420511791986E-002 6.626739188061097E-002 6.710093305810541E-002 + 6.794495889290816E-002 6.879960126577302E-002 6.966499371630951E-002 7.054127146384873E-002 + 7.142857142857143E-002 7.232703225290246E-002 7.323679432317351E-002 7.415799979155897E-002 + 7.509079259828748E-002 7.603531849413282E-002 7.699172506318798E-002 7.796016174592516E-002 + 7.894077986254630E-002 7.993373263662724E-002 8.093917521905902E-002 8.195726471229088E-002 + 8.298816019487740E-002 8.403202274633508E-002 8.508901547231136E-002 8.615930353007006E-002 + 8.724305415429787E-002 8.834043668323464E-002 8.945162258513320E-002 9.057678548505145E-002 + 9.171610119198152E-002 9.286974772632081E-002 9.403790534768730E-002 9.522075658308596E-002 + 9.641848625542886E-002 9.763128151241403E-002 9.885933185576798E-002 1.001028291708553E-001 + 1.013619677566613E-001 1.026369443561518E-001 1.039279581870144E-001 1.052352109727869E-001 + 1.065589069743765E-001 1.078992530219767E-001 1.092564585473843E-001 1.106307356167238E-001 + 1.120222989635835E-001 1.134313660225674E-001 1.148581569632703E-001 1.163028947246794E-001 + 1.177658050500092E-001 1.192471165219745E-001 1.207470605985066E-001 1.222658716489190E-001 + 1.238037869905283E-001 1.253610469257356E-001 1.269378947795742E-001 1.285345769377292E-001 + 1.301513428850364E-001 1.317884452444644E-001 1.334461398165873E-001 1.351246856195550E-001 + 1.368243449295641E-001 1.385453833218396E-001 1.402880697121320E-001 1.420526763987351E-001 + 1.438394791050341E-001 1.456487570225868E-001 1.474807928547491E-001 1.493358728608469E-001 + 1.512142869009054E-001 1.531163284809400E-001 1.550422947988174E-001 1.569924867906931E-001 + 1.589672091780335E-001 1.609667705152292E-001 1.629914832378074E-001 1.650416637112503E-001 + 1.671176322804280E-001 1.692197133196529E-001 1.713482352833641E-001 1.735035307574492E-001 + 1.756859365112107E-001 1.778957935499880E-001 1.801334471684393E-001 1.823992470044948E-001 + 1.846935470939890E-001 1.870167059259787E-001 1.893690864987578E-001 1.917510563765766E-001 + 1.941629877470747E-001 1.966052574794362E-001 1.990782471832751E-001 2.015823432682642E-001 + 2.041179370045119E-001 2.066854245836972E-001 2.092852071809789E-001 2.119176910176763E-001 + 2.145832874247451E-001 2.172824129070476E-001 2.200154892084308E-001 2.227829433776283E-001 + 2.255852078349835E-001 2.284227204400196E-001 2.312959245598545E-001 2.342052691384767E-001 + 2.371512087668965E-001 2.401342037541736E-001 2.431547201993441E-001 2.462132300642484E-001 + 2.493102112472744E-001 2.524461476580338E-001 2.556215292929701E-001 2.588368523119243E-001 + 2.620926191156605E-001 2.653893384243646E-001 2.687275253571367E-001 2.721077015124759E-001 + 2.755303950497838E-001 2.789961407718896E-001 2.825054802086126E-001 2.860589617013806E-001 + 2.896571404889054E-001 2.933005787939437E-001 2.969898459111436E-001 3.007255182959971E-001 + 3.045081796549159E-001 3.083384210364318E-001 3.122168409235541E-001 3.161440453272812E-001 + 3.201206478812903E-001 3.241472699378220E-001 3.282245406647636E-001 3.323530971439621E-001 + 3.365335844707675E-001 3.407666558548287E-001 3.450529727221632E-001 3.493932048185005E-001 + 3.537880303139366E-001 3.582381359088974E-001 3.627442169414344E-001 3.673069774958780E-001 + 3.719271305128465E-001 3.766053979006493E-001 3.813425106480843E-001 3.861392089386548E-001 + 3.909962422662289E-001 3.959143695521447E-001 4.008943592637967E-001 4.059369895347106E-001 + 4.110430482861237E-001 4.162133333501057E-001 4.214486525942157E-001 4.267498240477373E-001 + 4.321176760294965E-001 4.375530472772847E-001 4.430567870789194E-001 4.486297554049404E-001 + 4.542728230429878E-001 4.599868717338617E-001 4.657727943092938E-001 4.716314948314596E-001 + 4.775638887342337E-001 4.835709029662338E-001 4.896534761356559E-001 4.958125586569311E-001 + 5.020491128992358E-001 5.083641133368569E-001 5.147585467014618E-001 5.212334121362741E-001 + 5.277897213521893E-001 5.344284987858633E-001 5.411507817597749E-001 5.479576206443163E-001 + 5.548500790219126E-001 5.618292338532066E-001 5.688961756453415E-001 5.760520086223482E-001 + 5.832978508976890E-001 5.906348346489624E-001 5.980641062948047E-001 6.055868266740273E-001 + 6.132041712269928E-001 6.209173301792859E-001 6.287275087276868E-001 6.366359272284811E-001 + 6.446438213881521E-001 6.527524424564518E-001 6.609630574219206E-001 6.692769492098526E-001 + 6.776954168827519E-001 6.862197758433223E-001 6.948513580399921E-001 7.035915121750415E-001 + 7.124416039153376E-001 7.214030161057181E-001 7.304771489850721E-001 7.396654204051211E-001 + 7.489692660519693E-001 7.583901396704293E-001 7.679295132911682E-001 7.775888774607249E-001 + 7.873697414744004E-001 7.972736336120975E-001 8.073021013771136E-001 8.174567117379372E-001 + 8.277390513731001E-001 8.381507269190867E-001 8.486933652213854E-001 8.593686135886813E-001 + 8.701781400502482E-001 8.811236336165903E-001 8.922068045433438E-001 9.034293845985159E-001 + 9.147931273330744E-001 9.262998083549381E-001 9.379512256064306E-001 9.497491996451991E-001 + 9.616955739286935E-001 9.737922151021975E-001 9.860410132905068E-001 9.984438823932605E-001 + 1.011002760383986E+000 1.023719609612925E+000 1.036596417113638E+000 1.049635194913496E+000 + 1.062837980348061E+000 1.076206836379414E+000 1.089743851918513E+000 1.103451142151573E+000 + 1.117330848870584E+000 1.131385140807959E+000 1.145616213975405E+000 1.160026292007061E+000 + 1.174617626506933E+000 1.189392497400724E+000 1.204353213292075E+000 1.219502111823276E+000 + 1.234841560040547E+000 1.250373954763878E+000 1.266101722961546E+000 1.282027322129333E+000 + 1.298153240674505E+000 1.314481998304648E+000 1.331016146421358E+000 1.347758268518920E+000 + 1.364710980587976E+000 1.381876931524273E+000 1.399258803542573E+000 1.416859312595738E+000 + 1.434681208799119E+000 1.452727276860259E+000 1.471000336514003E+000 1.489503242963103E+000 + 1.508238887324330E+000 1.527210197080239E+000 1.546420136536577E+000 1.565871707285462E+000 + 1.585567948674405E+000 1.605511938281188E+000 1.625706792394766E+000 1.646155666502186E+000 + 1.666861755781623E+000 1.687828295601661E+000 1.709058562026797E+000 1.730555872329356E+000 + 1.752323585507812E+000 1.774365102811632E+000 1.796683868272743E+000 1.819283369243650E+000 + 1.842167136942362E+000 1.865338747004142E+000 1.888801820040200E+000 1.912560022203440E+000 + 1.936617065761279E+000 1.960976709675721E+000 1.985642760190692E+000 2.010619071426761E+000 + 2.035909545983380E+000 2.061518135548645E+000 2.087448841516781E+000 2.113705715613356E+000 + 2.140292860528359E+000 2.167214430557283E+000 2.194474632250210E+000 2.222077725069119E+000 + 2.250028022053426E+000 2.278329890493893E+000 2.306987752615052E+000 2.336006086266155E+000 + 2.365389425620879E+000 2.395142361885783E+000 2.425269544017683E+000 2.455775679450088E+000 + 2.486665534828718E+000 2.517943936756325E+000 2.549615772546851E+000 2.581685990989066E+000 + 2.614159603119860E+000 2.647041683007185E+000 2.680337368542928E+000 2.714051862245700E+000 + 2.748190432073724E+000 2.782758412248001E+000 2.817761204085753E+000 2.853204276844424E+000 + 2.889093168576245E+000 2.925433486993557E+000 2.962230910345058E+000 2.999491188303001E+000 + 3.037220142861627E+000 3.075423669246854E+000 3.114107736837394E+000 3.153278390097521E+000 + 3.192941749521490E+000 3.233104012589912E+000 3.273771454738108E+000 3.314950430336641E+000 + 3.356647373684239E+000 3.398868800013122E+000 3.441621306507058E+000 3.484911573332176E+000 + 3.528746364680728E+000 3.573132529828058E+000 3.618077004202762E+000 3.663586810470407E+000 + 3.709669059630821E+000 3.756330952129175E+000 3.803579778981121E+000 3.851422922911969E+000 + 3.899867859510303E+000 3.948922158396035E+000 3.998593484403154E+000 4.048889598777420E+000 + 4.099818360389017E+000 4.151387726960571E+000 4.203605756310533E+000 4.256480607612214E+000 + 4.310020542668719E+000 4.364233927203812E+000 4.419129232169135E+000 4.474715035067780E+000 + 4.531000021294525E+000 4.587992985492996E+000 4.645702832929787E+000 4.704138580885979E+000 + 4.763309360066087E+000 4.823224416024724E+000 4.883893110611302E+000 4.945324923432760E+000 + 5.007529453334847E+000 5.070516419901924E+000 5.134295664975647E+000 5.198877154192838E+000 + 5.264270978542561E+000 5.330487355942922E+000 5.397536632837620E+000 5.465429285812563E+000 + 5.534175923232927E+000 5.603787286900654E+000 5.674274253732953E+000 5.745647837461808E+000 + 5.817919190354867E+000 5.891099604958079E+000 5.965200515860090E+000 6.040233501479000E+000 + 6.116210285871476E+000 6.193142740564634E+000 6.271042886411067E+000 6.349922895467024E+000 + 6.429795092894416E+000 6.510671958886604E+000 6.592566130618422E+000 6.675490404220839E+000 + 6.759457736780297E+000 6.844481248363350E+000 6.930574224066675E+000 7.017750116092862E+000 + 7.106022545852425E+000 7.195405306092080E+000 7.285912363049978E+000 7.377557858637919E+000 + 7.470356112651017E+000 7.564321625005287E+000 7.659469078003183E+000 7.755813338627829E+000 + 7.853369460865973E+000 7.952152688060167E+000 8.052178455290667E+000 8.153462391787075E+000 + 8.256020323370548E+000 8.359868274926566E+000 8.465022472908810E+000 8.571499347874683E+000 + 8.679315537052498E+000 8.788487886941182E+000 8.899033455942533E+000 9.010969517026583E+000 + 9.124313560430645E+000 9.239083296392069E+000 9.355296657915615E+000 9.472971803575474E+000 + 9.592127120352538E+000 9.712781226507508E+000 9.834952974489909E+000 9.958661453883940E+000 + 1.008392599439121E+001 1.021076616885100E+001 1.033920179629865E+001 1.046925294506223E+001 + 1.060093993589833E+001 1.073428334516721E+001 1.086930400804783E+001 1.100602302179350E+001 + 1.114446174902822E+001 1.128464182108482E+001 1.142658514138476E+001 1.157031388886060E+001 + 1.171585052142157E+001 1.186321777946258E+001 1.201243868941753E+001 1.216353656735723E+001 + 1.231653502263245E+001 1.247145796156318E+001 1.262832959117375E+001 1.278717442297548E+001 + 1.294801727679653E+001 1.311088328466000E+001 1.327579789471102E+001 1.344278687519289E+001 + 1.361187631847357E+001 1.378309264512262E+001 1.395646260803935E+001 1.413201329663327E+001 + 1.430977214105656E+001 1.448976691649035E+001 1.467202574748453E+001 1.485657711235219E+001 + 1.504344984761963E+001 1.523267315253186E+001 1.542427659361529E+001 1.561829010929744E+001 + 1.581474401458480E+001 1.601366900579981E+001 1.621509616537701E+001 1.641905696671991E+001 + 1.662558327911874E+001 1.683470737272990E+001 1.704646192361856E+001 1.726088001886405E+001 + 1.747799516173003E+001 1.769784127689931E+001 1.792045271577461E+001 1.814586426184624E+001 + 1.837411113612678E+001 1.860522900265477E+001 1.883925397406709E+001 1.907622261724158E+001 + 1.931617195901093E+001 1.955913949194790E+001 1.980516318022385E+001 2.005428146554068E+001 + 2.030653327313721E+001 2.056195801787166E+001 2.082059561038001E+001 2.108248646331230E+001 + 2.134767149764718E+001 2.161619214908570E+001 2.188809037452604E+001 2.216340865861903E+001 + 2.244219002040673E+001 2.272447802004415E+001 2.301031676560547E+001 2.329975091997631E+001 + 2.359282570783207E+001 2.388958692270465E+001 2.419008093413768E+001 2.449435469493174E+001 + 2.480245574848107E+001 2.511443223620206E+001 2.543033290505565E+001 2.575020711516412E+001 + 2.607410484752350E+001 2.640207671181352E+001 2.673417395430516E+001 2.707044846586825E+001 + 2.741095279007945E+001 2.775574013143206E+001 2.810486436364974E+001 2.845838003810399E+001 + 2.881634239233822E+001 2.917880735869861E+001 2.954583157307349E+001 2.991747238374317E+001 + 3.029378786034033E+001 3.067483680292385E+001 3.106067875116633E+001 3.145137399365706E+001 + 3.184698357732268E+001 3.224756931696539E+001 3.265319380492206E+001 3.306392042084426E+001 + 3.347981334160122E+001 3.390093755130807E+001 3.432735885147924E+001 3.475914387131051E+001 + 3.519636007808977E+001 3.563907578773871E+001 3.608736017548782E+001 3.654128328668459E+001 + 3.700091604773871E+001 3.746633027720431E+001 3.793759869700151E+001 3.841479494377982E+001 + 3.889799358042353E+001 3.938727010770277E+001 3.988270097607043E+001 4.038436359760750E+001 + 4.089233635811942E+001 4.140669862938331E+001 4.192753078155063E+001 4.245491419570487E+001 + 4.298893127657730E+001 4.352966546542344E+001 4.407720125306027E+001 4.463162419306865E+001 + 4.519302091516101E+001 4.576147913871721E+001 4.633708768649136E+001 4.691993649848997E+001 + 4.751011664602584E+001 4.810772034594782E+001 4.871284097504968E+001 4.932557308466102E+001 + 4.994601241542041E+001 5.057425591223567E+001 5.121040173943143E+001 5.185454929608725E+001 + 5.250679923156957E+001 5.316725346125764E+001 5.383601518246866E+001 5.451318889058226E+001 + 5.519888039536786E+001 5.589319683751832E+001 5.659624670539014E+001 5.730813985195564E+001 + 5.802898751196743E+001 5.875890231933875E+001 5.949799832474348E+001 6.024639101343598E+001 + 6.100419732329654E+001 6.177153566310299E+001 6.254852593103185E+001 6.333528953339351E+001 + 6.413194940360131E+001 6.493863002138087E+001 6.575545743222007E+001 6.658255926706345E+001 + 6.742006476225569E+001 6.826810477973412E+001 6.912681182747690E+001 6.999632008020744E+001 + 7.087676540035901E+001 7.176828535930441E+001 7.267101925885081E+001 7.358510815300670E+001 + 7.451069487002171E+001 7.544792403470322E+001 7.639694209101528E+001 7.735789732495972E+001 + 7.833093988774705E+001 7.931622181925751E+001 8.031389707179719E+001 8.132412153415434E+001 + 8.234705305595631E+001 8.338285147233465E+001 8.443167862889943E+001 8.549369840702740E+001 + 8.656907674946989E+001 8.765798168628048E+001 8.876058336107113E+001 8.987705405759688E+001 + 9.100756822667528E+001 9.215230251344561E+001 9.331143578496878E+001 9.448514915817695E+001 + 9.567362602817279E+001 9.687705209688488E+001 9.809561540208516E+001 9.932950634676892E+001 + 1.005789177289068E+002 + + + 8.141803263879611E-007 8.244214541687700E-007 8.347913994790914E-007 8.452917826439767E-007 + 8.559242443696606E-007 8.666904459999187E-007 8.775920697756596E-007 8.886308190977778E-007 + 8.998084187933129E-007 9.111266153849596E-007 9.225871773639616E-007 9.341918954664452E-007 + 9.459425829532234E-007 9.578410758931221E-007 9.698892334498732E-007 9.820889381726056E-007 + 9.944420962900031E-007 1.006950638008154E-006 1.019616517812149E-006 1.032441714771480E-006 + 1.045428232849263E-006 1.058578101215369E-006 1.071893374563483E-006 1.085376133432156E-006 + 1.099028484529894E-006 1.112852561064330E-006 1.126850523075549E-006 1.141024557773593E-006 + 1.155376879880222E-006 1.169909731974964E-006 1.184625384845528E-006 1.199526137842613E-006 + 1.214614319239191E-006 1.229892286594301E-006 1.245362427121428E-006 1.261027158061502E-006 + 1.276888927060602E-006 1.292950212552407E-006 1.309213524145450E-006 1.325681403015256E-006 + 1.342356422301404E-006 1.359241187509582E-006 1.376338336918706E-006 1.393650541993154E-006 + 1.411180507800194E-006 1.428930973432647E-006 1.446904712436881E-006 1.465104533246184E-006 + 1.483533279619584E-006 1.502193831086197E-006 1.521089103395155E-006 1.540222048971199E-006 + 1.559595657376000E-006 1.579212955775286E-006 1.599077009411848E-006 1.619190922084478E-006 + 1.639557836632953E-006 1.660180935429108E-006 1.681063440874087E-006 1.702208615901854E-006 + 1.723619764489026E-006 1.745300232171131E-006 1.767253406565354E-006 1.789482717899856E-006 + 1.811991639549763E-006 1.834783688579874E-006 1.857862426294223E-006 1.881231458792531E-006 + 1.904894437533668E-006 1.928855059906210E-006 1.953117069806148E-006 1.977684258221890E-006 + 2.002560463826610E-006 2.027749573578042E-006 2.053255523325836E-006 2.079082298426530E-006 + 2.105233934366279E-006 2.131714517391405E-006 2.158528185146878E-006 2.185679127322842E-006 + 2.213171586309249E-006 2.241009857858749E-006 2.269198291757910E-006 2.297741292506875E-006 + 2.326643320007588E-006 2.355908890260644E-006 2.385542576070938E-006 2.415549007762167E-006 + 2.445932873900329E-006 2.476698922026329E-006 2.507851959397779E-006 2.539396853740150E-006 + 2.571338534007360E-006 2.603681991151935E-006 2.636432278904863E-006 2.669594514565233E-006 + 2.703173879799835E-006 2.737175621452806E-006 2.771605052365455E-006 2.806467552206411E-006 + 2.841768568312203E-006 2.877513616538416E-006 2.913708282121561E-006 2.950358220551770E-006 + 2.987469158456493E-006 3.025046894495278E-006 3.063097300265834E-006 3.101626321221476E-006 + 3.140639977600115E-006 3.180144365364937E-006 3.220145657156903E-006 3.260650103259236E-006 + 3.301664032574047E-006 3.343193853611233E-006 3.385246055489828E-006 3.427827208951931E-006 + 3.470943967389402E-006 3.514603067883468E-006 3.558811332257402E-006 3.603575668142463E-006 + 3.648903070057203E-006 3.694800620500390E-006 3.741275491057661E-006 3.788334943522090E-006 + 3.835986331028874E-006 3.884237099204258E-006 3.933094787328933E-006 3.982567029516073E-006 + 4.032661555904166E-006 4.083386193864887E-006 4.134748869226113E-006 4.186757607510367E-006 + 4.239420535188819E-006 4.292745880951059E-006 4.346741976990860E-006 4.401417260308082E-006 + 4.456780274026979E-006 4.512839668731084E-006 4.569604203814868E-006 4.627082748852433E-006 + 4.685284284983378E-006 4.744217906316140E-006 4.803892821348948E-006 4.864318354408684E-006 + 4.925503947107832E-006 4.987459159819732E-006 5.050193673172419E-006 5.113717289561237E-006 + 5.178039934680484E-006 5.243171659074332E-006 5.309122639707228E-006 5.375903181554071E-006 + 5.443523719210392E-006 5.511994818522769E-006 5.581327178239786E-006 5.651531631683702E-006 + 5.722619148443200E-006 5.794600836087401E-006 5.867487941901439E-006 5.941291854643906E-006 + 6.016024106326311E-006 6.091696374015025E-006 6.168320481655831E-006 6.245908401921438E-006 + 6.324472258082256E-006 6.404024325900625E-006 6.484577035549010E-006 6.566142973552175E-006 + 6.648734884753874E-006 6.732365674308284E-006 6.817048409696394E-006 6.902796322767921E-006 + 6.989622811808727E-006 7.077541443634370E-006 7.166565955709964E-006 7.256710258296617E-006 + 7.347988436625027E-006 7.440414753096259E-006 7.534003649510296E-006 7.628769749322631E-006 + 7.724727859929137E-006 7.821892974979846E-006 7.920280276721661E-006 8.019905138370640E-006 + 8.120783126514127E-006 8.222930003542982E-006 8.326361730114578E-006 8.431094467646617E-006 + 8.537144580842415E-006 8.644528640247941E-006 8.753263424840918E-006 8.863365924652690E-006 + 8.974853343422843E-006 9.087743101287382E-006 9.202052837500671E-006 9.317800413191524E-006 + 9.435003914154157E-006 9.553681653674044E-006 9.673852175389423E-006 9.795534256188829E-006 + 9.918746909144919E-006 1.004350938648542E-005 1.016984118260123E-005 1.029776203709252E-005 + 1.042729193785309E-005 1.055845112419341E-005 1.069126009000324E-005 1.082573958695366E-005 + 1.096191062773968E-005 1.109979448936348E-005 1.123941271645893E-005 1.138078712465810E-005 + 1.152393980399989E-005 1.166889312238168E-005 1.181566972905441E-005 1.196429255816145E-005 + 1.211478483232226E-005 1.226717006626084E-005 1.242147207048002E-005 1.257771495498191E-005 + 1.273592313303505E-005 1.289612132498918E-005 1.305833456213770E-005 1.322258819062893E-005 + 1.338890787542653E-005 1.355731960431959E-005 1.372784969198342E-005 1.390052478409115E-005 + 1.407537186147722E-005 1.425241824435323E-005 1.443169159657668E-005 1.461321992997360E-005 + 1.479703160871541E-005 1.498315535375086E-005 1.517162024729383E-005 1.536245573736731E-005 + 1.555569164240493E-005 1.575135815590997E-005 1.594948585117325E-005 1.615010568605028E-005 + 1.635324900779837E-005 1.655894755797490E-005 1.676723347739679E-005 1.697813931116273E-005 + 1.719169801373833E-005 1.740794295410535E-005 1.762690792097570E-005 1.784862712807092E-005 + 1.807313521946821E-005 1.830046727501363E-005 1.853065881580334E-005 1.876374580973396E-005 + 1.899976467712248E-005 1.923875229639712E-005 1.948074600985962E-005 1.972578362952004E-005 + 1.997390344300500E-005 2.022514421954015E-005 2.047954521600798E-005 2.073714618308176E-005 + 2.099798737143671E-005 2.126210953803918E-005 2.152955395251506E-005 2.180036240359825E-005 + 2.207457720566018E-005 2.235224120532156E-005 2.263339778814727E-005 2.291809088542539E-005 + 2.320636498103156E-005 2.349826511837974E-005 2.379383690746026E-005 2.409312653196651E-005 + 2.439618075651123E-005 2.470304693393355E-005 2.501377301269806E-005 2.532840754438670E-005 + 2.564699969128521E-005 2.596959923406471E-005 2.629625657956009E-005 2.662702276864618E-005 + 2.696194948421295E-005 2.730108905924116E-005 2.764449448497937E-005 2.799221941922401E-005 + 2.834431819470353E-005 2.870084582756792E-005 2.906185802598521E-005 2.942741119884586E-005 + 2.979756246457686E-005 3.017236966006657E-005 3.055189134970183E-005 3.093618683451877E-005 + 3.132531616146878E-005 3.171934013280086E-005 3.211832031556220E-005 3.252231905121807E-005 + 3.293139946539287E-005 3.334562547773359E-005 3.376506181189740E-005 3.418977400566488E-005 + 3.461982842118036E-005 3.505529225532126E-005 3.549623355019761E-005 3.594272120378380E-005 + 3.639482498068413E-005 3.685261552303353E-005 3.731616436153564E-005 3.778554392663957E-005 + 3.826082755985731E-005 3.874208952522355E-005 3.922940502089949E-005 3.972285019092280E-005 + 4.022250213710520E-005 4.072843893107983E-005 4.124073962650011E-005 4.175948427139195E-005 + 4.228475392066155E-005 4.281663064876024E-005 4.335519756250890E-005 4.390053881408356E-005 + 4.445273961416424E-005 4.501188624524945E-005 4.557806607513788E-005 4.615136757057984E-005 + 4.673188031110035E-005 4.731969500299625E-005 4.791490349350905E-005 4.851759878517634E-005 + 4.912787505036363E-005 4.974582764597893E-005 5.037155312837264E-005 5.100514926842437E-005 + 5.164671506682007E-005 5.229635076952103E-005 5.295415788342744E-005 5.362023919223924E-005 + 5.429469877251605E-005 5.497764200993949E-005 5.566917561577987E-005 5.636940764356998E-005 + 5.707844750598891E-005 5.779640599195764E-005 5.852339528395031E-005 5.925952897552290E-005 + 6.000492208906228E-005 6.075969109375911E-005 6.152395392380587E-005 6.229782999682469E-005 + 6.308144023252646E-005 6.387490707160467E-005 6.467835449486737E-005 6.549190804260906E-005 + 6.631569483422671E-005 6.714984358808254E-005 6.799448464161636E-005 6.884974997171135E-005 + 6.971577321531534E-005 7.059268969032204E-005 7.148063641671481E-005 7.237975213797611E-005 + 7.329017734276679E-005 7.421205428687729E-005 7.514552701545572E-005 7.609074138551506E-005 + 7.704784508872366E-005 7.801698767448249E-005 7.899832057329226E-005 7.999199712041492E-005 + 8.099817257983264E-005 8.201700416850794E-005 8.304865108094955E-005 8.409327451408635E-005 + 8.515103769245505E-005 8.622210589370434E-005 8.730664647441969E-005 8.840482889627349E-005 + 8.951682475250335E-005 9.064280779472418E-005 9.178295396007720E-005 9.293744139872022E-005 + 9.410645050166459E-005 9.529016392896091E-005 9.648876663824046E-005 9.770244591361516E-005 + 9.893139139494103E-005 1.001757951074498E-004 1.014358514917534E-004 1.027117574342254E-004 + 1.040037122977652E-004 1.053119179529487E-004 1.066365788095711E-004 1.079779018485864E-004 + 1.093360966544482E-004 1.107113754478583E-004 1.121039531189262E-004 1.135140472607460E-004 + 1.149418782033966E-004 1.163876690483676E-004 1.178516457034199E-004 1.193340369178844E-004 + 1.208350743184042E-004 1.223549924451272E-004 1.238940287883529E-004 1.254524238256412E-004 + 1.270304210593872E-004 1.286282670548690E-004 1.302462114787745E-004 1.318845071382115E-004 + 1.335434100202099E-004 1.352231793317203E-004 1.369240775401147E-004 1.386463704141991E-004 + 1.403903270657390E-004 1.421562199915092E-004 1.439443251158722E-004 1.457549218338914E-004 + 1.475882930549880E-004 1.494447252471452E-004 1.513245084816698E-004 1.532279364785168E-004 + 1.551553066521832E-004 1.571069201581800E-004 1.590830819400880E-004 1.610841007772061E-004 + 1.631102893327989E-004 1.651619642029503E-004 1.672394459660331E-004 1.693430592327994E-004 + 1.714731326971020E-004 1.736299991872533E-004 1.758139957180304E-004 1.780254635433350E-004 + 1.802647482095138E-004 1.825321996093519E-004 1.848281720367436E-004 1.871530242420516E-004 + 1.895071194881635E-004 1.918908256072506E-004 1.943045150582437E-004 1.967485649850304E-004 + 1.992233572753838E-004 2.017292786206348E-004 2.042667205760916E-004 2.068360796222222E-004 + 2.094377572266052E-004 2.120721599066591E-004 2.147396992931627E-004 2.174407921945722E-004 + 2.201758606621488E-004 2.229453320559051E-004 2.257496391113808E-004 2.285892200072590E-004 + 2.314645184338317E-004 2.343759836623281E-004 2.373240706151133E-004 2.403092399367714E-004 + 2.433319580660827E-004 2.463926973089046E-004 2.494919359119709E-004 2.526301581376188E-004 + 2.558078543394555E-004 2.590255210389779E-004 2.622836610031544E-004 2.655827833229828E-004 + 2.689234034930378E-004 2.723060434920173E-004 2.757312318643035E-004 2.791995038025481E-004 + 2.827114012312976E-004 2.862674728916704E-004 2.898682744270980E-004 2.935143684701466E-004 + 2.972063247304283E-004 3.009447200836201E-004 3.047301386616017E-004 3.085631719437273E-004 + 3.124444188492459E-004 3.163744858308829E-004 3.203539869695998E-004 3.243835440705460E-004 + 3.284637867602164E-004 3.325953525848331E-004 3.367788871099617E-004 3.410150440213832E-004 + 3.453044852272335E-004 3.496478809614277E-004 3.540459098883866E-004 3.584992592090775E-004 + 3.630086247683923E-004 3.675747111638740E-004 3.721982318558110E-004 3.768799092787193E-004 + 3.816204749542204E-004 3.864206696053460E-004 3.912812432722764E-004 3.962029554295356E-004 + 4.011865751046622E-004 4.062328809983694E-004 4.113426616062197E-004 4.165167153418292E-004 + 4.217558506616203E-004 4.270608861911467E-004 4.324326508530024E-004 4.378719839963450E-004 + 4.433797355280445E-004 4.489567660454830E-004 4.546039469710261E-004 4.603221606881823E-004 + 4.661123006794789E-004 4.719752716660694E-004 4.779119897490985E-004 4.839233825528458E-004 + 4.900103893696666E-004 4.961739613067605E-004 5.024150614347822E-004 5.087346649383242E-004 + 5.151337592682918E-004 5.216133442961929E-004 5.281744324703708E-004 5.348180489742016E-004 + 5.415452318862799E-004 5.483570323426231E-004 5.552545147009109E-004 5.622387567067949E-004 + 5.693108496622981E-004 5.764718985963322E-004 5.837230224373638E-004 5.910653541882449E-004 + 5.985000411032498E-004 6.060282448673347E-004 6.136511417776539E-004 6.213699229273591E-004 + 6.291857943917088E-004 6.370999774165205E-004 6.451137086089936E-004 6.532282401309302E-004 + 6.614448398943911E-004 6.697647917598055E-004 6.781893957365794E-004 6.867199681862240E-004 + 6.953578420280401E-004 7.041043669473900E-004 7.129609096065869E-004 7.219288538584402E-004 + 7.310096009624844E-004 7.402045698039289E-004 7.495151971153638E-004 7.589429377012485E-004 + 7.684892646652306E-004 7.781556696403202E-004 7.879436630219601E-004 7.978547742040319E-004 + 8.078905518178214E-004 8.180525639739983E-004 8.283423985076372E-004 8.387616632263177E-004 + 8.493119861613521E-004 8.599950158221627E-004 8.708124214538689E-004 8.817658932981092E-004 + 8.928571428571428E-004 9.040879031612808E-004 9.154599290396690E-004 9.269749973944872E-004 + 9.386349074785935E-004 9.504414811766604E-004 9.623965632898498E-004 9.745020218240645E-004 + 9.867597482818289E-004 9.991716579578406E-004 1.011739690238238E-003 1.024465808903636E-003 + 1.037352002435968E-003 1.050400284329188E-003 1.063612693403892E-003 1.076991294125876E-003 + 1.090538176928724E-003 1.104255458540433E-003 1.118145282314165E-003 1.132209818563143E-003 + 1.146451264899769E-003 1.160871846579010E-003 1.175473816846091E-003 1.190259457288575E-003 + 1.205231078192861E-003 1.220391018905176E-003 1.235741648197100E-003 1.251285364635691E-003 + 1.267024596958266E-003 1.282961804451898E-003 1.299099477337680E-003 1.315440137159836E-003 + 1.331986337179706E-003 1.348740662774709E-003 1.365705731842303E-003 1.382884195209047E-003 + 1.400278737044794E-003 1.417892075282093E-003 1.435726962040878E-003 1.453786184058492E-003 + 1.472072563125115E-003 1.490588956524681E-003 1.509338257481332E-003 1.528323395611487E-003 + 1.547547337381604E-003 1.567013086571695E-003 1.586723684744678E-003 1.606682211721616E-003 + 1.626891786062956E-003 1.647355565555805E-003 1.668076747707342E-003 1.689058570244438E-003 + 1.710304311619551E-003 1.731817291522996E-003 1.753600871401651E-003 1.775658454984190E-003 + 1.797993488812926E-003 1.820609462782336E-003 1.843509910684364E-003 1.866698410760587E-003 + 1.890178586261317E-003 1.913954106011750E-003 1.938028684985218E-003 1.962406084883664E-003 + 1.987090114725418E-003 2.012084631440365E-003 2.037393540472593E-003 2.063020796390629E-003 + 2.088970403505350E-003 2.115246416495662E-003 2.141852941042052E-003 2.168794134468115E-003 + 2.196074206390134E-003 2.223697419374851E-003 2.251668089605491E-003 2.279990587556185E-003 + 2.308669338674863E-003 2.337708824074734E-003 2.367113581234472E-003 2.396888204707207E-003 + 2.427037346838433E-003 2.457565718492953E-003 2.488478089790939E-003 2.519779290853303E-003 + 2.551474212556399E-003 2.583567807296216E-003 2.616065089762237E-003 2.648971137720954E-003 + 2.682291092809314E-003 2.716030161338095E-003 2.750193615105385E-003 2.784786792220353E-003 + 2.819815097937294E-003 2.855284005500245E-003 2.891199056998181E-003 2.927565864230959E-003 + 2.964390109586207E-003 3.001677546927170E-003 3.039434002491802E-003 3.077665375803105E-003 + 3.116377640590930E-003 3.155576845725423E-003 3.195269116162126E-003 3.235460653899054E-003 + 3.276157738945756E-003 3.317366730304557E-003 3.359094066964209E-003 3.401346268905949E-003 + 3.444129938122298E-003 3.487451759648620E-003 3.531318502607658E-003 3.575737021267258E-003 + 3.620714256111318E-003 3.666257234924296E-003 3.712373073889295E-003 3.759068978699964E-003 + 3.806352245686449E-003 3.854230262955398E-003 3.902710511544426E-003 3.951800566591015E-003 + 4.001508098516129E-003 4.051840874222774E-003 4.102806758309545E-003 4.154413714299526E-003 + 4.206669805884594E-003 4.259583198185360E-003 4.313162159027040E-003 4.367415060231256E-003 + 4.422350378924208E-003 4.477976698861217E-003 4.534302711767930E-003 4.591337218698475E-003 + 4.649089131410582E-003 4.707567473758116E-003 4.766781383101054E-003 4.826740111733185E-003 + 4.887453028327862E-003 4.948929619401809E-003 5.011179490797459E-003 5.074212369183883E-003 + 5.138038103576546E-003 5.202666666876321E-003 5.268108157427696E-003 5.334372800596717E-003 + 5.401470950368707E-003 5.469413090966059E-003 5.538209838486493E-003 5.607871942561756E-003 + 5.678410288037348E-003 5.749835896673272E-003 5.822159928866173E-003 5.895393685393245E-003 + 5.969548609177922E-003 6.044636287077923E-003 6.120668451695699E-003 6.197656983211640E-003 + 6.275613911240448E-003 6.354551416710712E-003 6.434481833768273E-003 6.515417651703426E-003 + 6.597371516902366E-003 6.680356234823291E-003 6.764384771997187E-003 6.849470258053954E-003 + 6.935625987773909E-003 7.022865423165083E-003 7.111202195566768E-003 7.200650107779353E-003 + 7.291223136221114E-003 7.382935433112030E-003 7.475801328685059E-003 7.569835333425342E-003 + 7.665052140337410E-003 7.761466627241073E-003 7.859093859096085E-003 7.957949090356013E-003 + 8.058047767351901E-003 8.159405530705648E-003 8.262038217774008E-003 8.365961865123157E-003 + 8.471192711034399E-003 8.577747198041530E-003 8.685641975499902E-003 8.794893902188019E-003 + 8.905520048941721E-003 9.017537701321477E-003 9.130964362313402E-003 9.245817755064013E-003 + 9.362115825649617E-003 9.479876745880368E-003 9.599118916139604E-003 9.719860968259062E-003 + 9.842121768430006E-003 9.965920420151219E-003 1.009127626721392E-002 1.021820889672422E-002 + 1.034673814216375E-002 1.047688408648858E-002 1.060866706526732E-002 1.074210766985852E-002 + 1.087722675062810E-002 1.101404542020738E-002 1.115258505679180E-002 1.129286730748145E-002 + 1.143491409166343E-002 1.157874760443673E-002 1.172439032008038E-002 1.187186499556499E-002 + 1.202119467410867E-002 1.217240268877747E-002 1.232551266613133E-002 1.248054852991576E-002 + 1.263753450479983E-002 1.279649512016156E-002 1.295745521392047E-002 1.312043993641870E-002 + 1.328547475435076E-002 1.345258545474267E-002 1.362179814898141E-002 1.379313927689467E-002 + 1.396663561088230E-002 1.414231426009949E-002 1.432020267469257E-002 1.450032865008826E-002 + 1.468272033133666E-002 1.486740621750906E-002 1.505441516615094E-002 1.524377639779095E-002 + 1.543551950050684E-002 1.562967443454847E-002 1.582627153701932E-002 1.602534152661666E-002 + 1.622691550843131E-002 1.643102497880810E-002 1.663770183026698E-002 1.684697835648650E-002 + 1.705888725734970E-002 1.727346164405341E-002 1.749073504428216E-002 1.771074140744673E-002 + 1.793351510998899E-002 1.815909096075324E-002 1.838750420642503E-002 1.861879053703878E-002 + 1.885298609155413E-002 1.909012746350298E-002 1.933025170670721E-002 1.957339634106828E-002 + 1.981959935843006E-002 2.006889922851485E-002 2.032133490493458E-002 2.057694583127732E-002 + 2.083577194727029E-002 2.109785369502076E-002 2.136323202533496E-002 2.163194840411695E-002 + 2.190404481884765E-002 2.217956378514540E-002 2.245854835340928E-002 2.274104211554562E-002 + 2.302708921177952E-002 2.331673433755178E-002 2.361002275050250E-002 2.390700027754300E-002 + 2.420771332201599E-002 2.451220887094652E-002 2.482053450238365E-002 2.513273839283451E-002 + 2.544886932479225E-002 2.576897669435807E-002 2.609311051895977E-002 2.642132144516695E-002 + 2.675366075660449E-002 2.709018038196604E-002 2.743093290312762E-002 2.777597156336398E-002 + 2.812535027566783E-002 2.847912363117366E-002 2.883734690768815E-002 2.920007607832694E-002 + 2.956736782026100E-002 2.993927952357229E-002 3.031586930022104E-002 3.069719599312611E-002 + 3.108331918535897E-002 3.147429920945406E-002 3.187019715683564E-002 3.227107488736333E-002 + 3.267699503899825E-002 3.308802103758982E-002 3.350421710678660E-002 3.392564827807126E-002 + 3.435238040092156E-002 3.478448015310002E-002 3.522201505107191E-002 3.566505346055530E-002 + 3.611366460720307E-002 3.656791858741947E-002 3.702788637931322E-002 3.749363985378751E-002 + 3.796525178577034E-002 3.844279586558567E-002 3.892634671046742E-002 3.941597987621902E-002 + 3.991177186901863E-002 4.041380015737391E-002 4.092214318422635E-002 4.143688037920802E-002 + 4.195809217105299E-002 4.248586000016402E-002 4.302026633133824E-002 4.356139466665221E-002 + 4.410932955850910E-002 4.466415662285073E-002 4.522596255253453E-002 4.579483513088009E-002 + 4.637086324538526E-002 4.695413690161469E-002 4.754474723726401E-002 4.814278653639961E-002 + 4.874834824387878E-002 4.936152697995044E-002 4.998241855503943E-002 5.061111998471775E-002 + 5.124772950486272E-002 5.189234658700714E-002 5.254507195388167E-002 5.320600759515268E-002 + 5.387525678335899E-002 5.455292409004765E-002 5.523911540211419E-002 5.593393793834725E-002 + 5.663750026618156E-002 5.734991231866246E-002 5.807128541162233E-002 5.880173226107474E-002 + 5.954136700082609E-002 6.029030520030905E-002 6.104866388264128E-002 6.181656154290950E-002 + 6.259411816668559E-002 6.338145524877405E-002 6.417869581219558E-002 6.498596442741048E-002 + 6.580338723178202E-002 6.663109194928653E-002 6.746920791047026E-002 6.831786607265704E-002 + 6.917719904041159E-002 7.004734108625818E-002 7.092842817166191E-002 7.182059796827260E-002 + 7.272398987943583E-002 7.363874506197599E-002 7.456500644825113E-002 7.550291876848751E-002 + 7.645262857339347E-002 7.741428425705793E-002 7.838803608013834E-002 7.937403619333780E-002 + 8.037243866118021E-002 8.138339948608256E-002 8.240707663273028E-002 8.344363005276050E-002 + 8.449322170975371E-002 8.555601560454187E-002 8.663217780083345E-002 8.772187645116078E-002 + 8.882528182315531E-002 8.994256632615100E-002 9.107390453812474E-002 9.221947323297398E-002 + 9.337945140813772E-002 9.455402031256610E-002 9.574336347503980E-002 9.694766673284787E-002 + 9.816711826082467E-002 9.940190860075210E-002 1.006522306911333E-001 1.019182798973384E-001 + 1.032002540421318E-001 1.044983534365821E-001 1.058127809113601E-001 1.071437418484336E-001 + 1.084914442131562E-001 1.098560985867648E-001 1.112379181992817E-001 1.126371189628323E-001 + 1.140539195053831E-001 1.154885412049009E-001 1.169412082239452E-001 1.184121475446934E-001 + 1.199015890044067E-001 1.214097653313438E-001 1.229369121811239E-001 1.244832681735493E-001 + 1.260490749298902E-001 1.276345771106375E-001 1.292400224537331E-001 1.308656618132778E-001 + 1.325117491987291E-001 1.341785418145902E-001 1.358663001005979E-001 1.375752877724187E-001 + 1.393057718628528E-001 1.410580227635603E-001 1.428323142673096E-001 1.446289236107575E-001 + 1.464481315177696E-001 1.482902222432822E-001 1.501554836177192E-001 1.520442070919653E-001 + 1.539566877829057E-001 1.558932245195397E-001 1.578541198896719E-001 1.598396802871935E-001 + 1.618502159599566E-001 1.638860410582500E-001 1.659474736838878E-001 1.680348359399112E-001 + 1.701484539809197E-001 1.722886580640327E-001 1.744557826004919E-001 1.766501662079159E-001 + 1.788721517632070E-001 1.811220864561294E-001 1.834003218435566E-001 1.857072139044024E-001 + 1.880431230952453E-001 1.904084144066482E-001 1.928034574201912E-001 1.952286263662180E-001 + 1.976843001823100E-001 2.001708625724976E-001 2.026887020672126E-001 2.052382120839990E-001 + 2.078197909889842E-001 2.104338421591238E-001 2.130807740452320E-001 2.157610002358007E-001 + 2.184749395216254E-001 2.212230159612414E-001 2.240056589471827E-001 2.268233032730780E-001 + 2.296763892015848E-001 2.325653625331846E-001 2.354906746758386E-001 2.384527827155198E-001 + 2.414521494876367E-001 2.444892436493487E-001 2.475645397527982E-001 2.506785183192585E-001 + 2.538316659142151E-001 2.570244752233958E-001 2.602574451297501E-001 2.635310807914038E-001 + 2.668458937205898E-001 2.702024018635713E-001 2.736011296815755E-001 2.770426082327379E-001 + 2.805273752550841E-001 2.840559752505519E-001 2.876289595700683E-001 2.912468864997039E-001 + 2.949103213479009E-001 2.986198365338081E-001 3.023760116767211E-001 3.061794336866468E-001 + 3.100306968560134E-001 3.139304029525257E-001 3.178791613131957E-001 3.218775889395515E-001 + 3.259263105940438E-001 3.300259588976690E-001 3.341771744288145E-001 3.383806058233532E-001 + 3.426369098759932E-001 3.469467516429007E-001 3.513108045456218E-001 3.557297504763000E-001 + 3.602042799042278E-001 3.647350919837327E-001 3.693228946634186E-001 3.739684047967896E-001 + 3.786723482542541E-001 3.834354600365482E-001 3.882584843895791E-001 3.931421749207134E-001 + 3.980872947165335E-001 4.030946164620674E-001 4.081649225615258E-001 4.132990052605532E-001 + 4.184976667700152E-001 4.237617193913509E-001 4.290919856434905E-001 4.344892983913815E-001 + 4.399545009761221E-001 4.454884473467339E-001 4.510920021935978E-001 4.567660410835574E-001 + 4.625114505967339E-001 4.683291284650539E-001 4.742199837125189E-001 4.801849367972477E-001 + 4.862249197552941E-001 4.923408763462847E-001 4.985337622008804E-001 5.048045449700939E-001 + 5.111542044764927E-001 5.175837328672914E-001 5.240941347693829E-001 5.306864274463109E-001 + 5.373616409572163E-001 5.441208183177929E-001 5.509650156632534E-001 5.578953024133581E-001 + 5.649127614395126E-001 5.720184892339651E-001 5.792135960811420E-001 5.864992062311247E-001 + 5.938764580753231E-001 6.013465043243478E-001 6.089105121881211E-001 6.165696635582628E-001 + 6.243251551927552E-001 6.321781989029459E-001 6.401300217428929E-001 6.481818662010906E-001 + 6.563349903946196E-001 6.645906682657206E-001 6.729501897808583E-001 6.814148611322783E-001 + 6.899860049420983E-001 6.986649604689790E-001 7.074530838173767E-001 7.163517481494455E-001 + 7.253623438995929E-001 7.344862789917344E-001 7.437249790592935E-001 7.530798876679498E-001 + 7.625524665412068E-001 7.721441957887874E-001 7.818565741378982E-001 7.916911191674190E-001 + 8.016493675450165E-001 8.117328752672610E-001 8.219432179027509E-001 8.322819908382931E-001 + 8.427508095281961E-001 8.533513097466765E-001 8.640851478434612E-001 8.749540010025930E-001 + 8.859595675044876E-001 8.971035669913052E-001 9.083877407356351E-001 9.198138519125838E-001 + 9.313836858752714E-001 9.430990504337903E-001 9.549617761376910E-001 9.669737165619966E-001 + 9.791367485968382E-001 9.914527727407189E-001 1.003923713397465E+000 1.016551519176929E+000 + 1.029338163199454E+000 1.042285643404183E+000 1.055395982861243E+000 1.068671230087843E+000 + 1.082113459368374E+000 1.095724771078506E+000 1.109507292013389E+000 1.123463175719961E+000 + 1.137594602833441E+000 1.151903781418070E+000 1.166392947312110E+000 1.181064364477212E+000 + 1.195920325352160E+000 1.210963151211061E+000 1.226195192526065E+000 1.241618829334612E+000 + 1.257236471611336E+000 + + + +-1.277124356888939E+001 -1.277124356882264E+001 -1.277124356875419E+001 -1.277124356868401E+001 +-1.277124356861206E+001 -1.277124356853828E+001 -1.277124356846264E+001 -1.277124356838508E+001 +-1.277124356830557E+001 -1.277124356822403E+001 -1.277124356814044E+001 -1.277124356805473E+001 +-1.277124356796685E+001 -1.277124356787675E+001 -1.277124356778436E+001 -1.277124356768963E+001 +-1.277124356759252E+001 -1.277124356749293E+001 -1.277124356739083E+001 -1.277124356728614E+001 +-1.277124356717881E+001 -1.277124356706875E+001 -1.277124356695591E+001 -1.277124356684021E+001 +-1.277124356672158E+001 -1.277124356659995E+001 -1.277124356647524E+001 -1.277124356634738E+001 +-1.277124356621627E+001 -1.277124356608185E+001 -1.277124356594402E+001 -1.277124356580270E+001 +-1.277124356565781E+001 -1.277124356550925E+001 -1.277124356535692E+001 -1.277124356520075E+001 +-1.277124356504061E+001 -1.277124356487642E+001 -1.277124356470808E+001 -1.277124356453547E+001 +-1.277124356435849E+001 -1.277124356417704E+001 -1.277124356399098E+001 -1.277124356380022E+001 +-1.277124356360464E+001 -1.277124356340409E+001 -1.277124356319848E+001 -1.277124356298765E+001 +-1.277124356277149E+001 -1.277124356254986E+001 -1.277124356232261E+001 -1.277124356208962E+001 +-1.277124356185072E+001 -1.277124356160578E+001 -1.277124356135463E+001 -1.277124356109713E+001 +-1.277124356083311E+001 -1.277124356056240E+001 -1.277124356028484E+001 -1.277124356000025E+001 +-1.277124355970846E+001 -1.277124355940929E+001 -1.277124355910253E+001 -1.277124355878802E+001 +-1.277124355846554E+001 -1.277124355813490E+001 -1.277124355779588E+001 -1.277124355744828E+001 +-1.277124355709189E+001 -1.277124355672647E+001 -1.277124355635180E+001 -1.277124355596765E+001 +-1.277124355557377E+001 -1.277124355516992E+001 -1.277124355475585E+001 -1.277124355433129E+001 +-1.277124355389598E+001 -1.277124355344966E+001 -1.277124355299203E+001 -1.277124355252282E+001 +-1.277124355204174E+001 -1.277124355154847E+001 -1.277124355104271E+001 -1.277124355052416E+001 +-1.277124354999247E+001 -1.277124354944733E+001 -1.277124354888838E+001 -1.277124354831529E+001 +-1.277124354772768E+001 -1.277124354712520E+001 -1.277124354650747E+001 -1.277124354587410E+001 +-1.277124354522469E+001 -1.277124354455885E+001 -1.277124354387615E+001 -1.277124354317616E+001 +-1.277124354245846E+001 -1.277124354172258E+001 -1.277124354096808E+001 -1.277124354019448E+001 +-1.277124353940129E+001 -1.277124353858802E+001 -1.277124353775417E+001 -1.277124353689920E+001 +-1.277124353602259E+001 -1.277124353512379E+001 -1.277124353420224E+001 -1.277124353325735E+001 +-1.277124353228855E+001 -1.277124353129522E+001 -1.277124353027675E+001 -1.277124352923249E+001 +-1.277124352816179E+001 -1.277124352706399E+001 -1.277124352593840E+001 -1.277124352478431E+001 +-1.277124352360101E+001 -1.277124352238775E+001 -1.277124352114378E+001 -1.277124351986832E+001 +-1.277124351856056E+001 -1.277124351721971E+001 -1.277124351584490E+001 -1.277124351443530E+001 +-1.277124351299001E+001 -1.277124351150813E+001 -1.277124350998874E+001 -1.277124350843088E+001 +-1.277124350683358E+001 -1.277124350519586E+001 -1.277124350351666E+001 -1.277124350179497E+001 +-1.277124350002968E+001 -1.277124349821971E+001 -1.277124349636392E+001 -1.277124349446114E+001 +-1.277124349251020E+001 -1.277124349050987E+001 -1.277124348845890E+001 -1.277124348635602E+001 +-1.277124348419989E+001 -1.277124348198918E+001 -1.277124347972251E+001 -1.277124347739846E+001 +-1.277124347501557E+001 -1.277124347257236E+001 -1.277124347006730E+001 -1.277124346749882E+001 +-1.277124346486532E+001 -1.277124346216515E+001 -1.277124345939663E+001 -1.277124345655802E+001 +-1.277124345364755E+001 -1.277124345066341E+001 -1.277124344760371E+001 -1.277124344446656E+001 +-1.277124344125000E+001 -1.277124343795200E+001 -1.277124343457052E+001 -1.277124343110343E+001 +-1.277124342754857E+001 -1.277124342390372E+001 -1.277124342016660E+001 -1.277124341633487E+001 +-1.277124341240614E+001 -1.277124340837796E+001 -1.277124340424780E+001 -1.277124340001309E+001 +-1.277124339567117E+001 -1.277124339121933E+001 -1.277124338665480E+001 -1.277124338197471E+001 +-1.277124337717614E+001 -1.277124337225610E+001 -1.277124336721151E+001 -1.277124336203921E+001 +-1.277124335673597E+001 -1.277124335129848E+001 -1.277124334572334E+001 -1.277124334000705E+001 +-1.277124333414606E+001 -1.277124332813670E+001 -1.277124332197521E+001 -1.277124331565774E+001 +-1.277124330918034E+001 -1.277124330253896E+001 -1.277124329572945E+001 -1.277124328874756E+001 +-1.277124328158892E+001 -1.277124327424905E+001 -1.277124326672337E+001 -1.277124325900718E+001 +-1.277124325109566E+001 -1.277124324298385E+001 -1.277124323466667E+001 -1.277124322613896E+001 +-1.277124321739536E+001 -1.277124320843041E+001 -1.277124319923851E+001 -1.277124318981391E+001 +-1.277124318015073E+001 -1.277124317024291E+001 -1.277124316008428E+001 -1.277124314966848E+001 +-1.277124313898900E+001 -1.277124312803916E+001 -1.277124311681212E+001 -1.277124310530087E+001 +-1.277124309349820E+001 -1.277124308139674E+001 -1.277124306898893E+001 -1.277124305626701E+001 +-1.277124304322303E+001 -1.277124302984883E+001 -1.277124301613606E+001 -1.277124300207614E+001 +-1.277124298766029E+001 -1.277124297287949E+001 -1.277124295772451E+001 -1.277124294218587E+001 +-1.277124292625386E+001 -1.277124290991852E+001 -1.277124289316965E+001 -1.277124287599677E+001 +-1.277124285838914E+001 -1.277124284033578E+001 -1.277124282182537E+001 -1.277124280284636E+001 +-1.277124278338689E+001 -1.277124276343479E+001 -1.277124274297758E+001 -1.277124272200249E+001 +-1.277124270049640E+001 -1.277124267844586E+001 -1.277124265583710E+001 -1.277124263265599E+001 +-1.277124260888802E+001 -1.277124258451835E+001 -1.277124255953174E+001 -1.277124253391258E+001 +-1.277124250764485E+001 -1.277124248071212E+001 -1.277124245309757E+001 -1.277124242478393E+001 +-1.277124239575351E+001 -1.277124236598815E+001 -1.277124233546926E+001 -1.277124230417775E+001 +-1.277124227209406E+001 -1.277124223919815E+001 -1.277124220546943E+001 -1.277124217088685E+001 +-1.277124213542876E+001 -1.277124209907302E+001 -1.277124206179688E+001 -1.277124202357707E+001 +-1.277124198438967E+001 -1.277124194421019E+001 -1.277124190301352E+001 -1.277124186077390E+001 +-1.277124181746494E+001 -1.277124177305954E+001 -1.277124172752997E+001 -1.277124168084775E+001 +-1.277124163298370E+001 -1.277124158390791E+001 -1.277124153358969E+001 -1.277124148199759E+001 +-1.277124142909935E+001 -1.277124137486191E+001 -1.277124131925136E+001 -1.277124126223294E+001 +-1.277124120377100E+001 -1.277124114382899E+001 -1.277124108236944E+001 -1.277124101935393E+001 +-1.277124095474307E+001 -1.277124088849646E+001 -1.277124082057268E+001 -1.277124075092928E+001 +-1.277124067952272E+001 -1.277124060630834E+001 -1.277124053124038E+001 -1.277124045427192E+001 +-1.277124037535482E+001 -1.277124029443975E+001 -1.277124021147613E+001 -1.277124012641208E+001 +-1.277124003919442E+001 -1.277123994976863E+001 -1.277123985807879E+001 -1.277123976406757E+001 +-1.277123966767621E+001 -1.277123956884442E+001 -1.277123946751043E+001 -1.277123936361087E+001 +-1.277123925708078E+001 -1.277123914785355E+001 -1.277123903586089E+001 -1.277123892103277E+001 +-1.277123880329740E+001 -1.277123868258115E+001 -1.277123855880856E+001 -1.277123843190222E+001 +-1.277123830178278E+001 -1.277123816836889E+001 -1.277123803157711E+001 -1.277123789132191E+001 +-1.277123774751559E+001 -1.277123760006821E+001 -1.277123744888758E+001 -1.277123729387917E+001 +-1.277123713494602E+001 -1.277123697198877E+001 -1.277123680490549E+001 -1.277123663359171E+001 +-1.277123645794028E+001 -1.277123627784135E+001 -1.277123609318229E+001 -1.277123590384763E+001 +-1.277123570971893E+001 -1.277123551067480E+001 -1.277123530659074E+001 -1.277123509733911E+001 +-1.277123488278903E+001 -1.277123466280631E+001 -1.277123443725336E+001 -1.277123420598909E+001 +-1.277123396886885E+001 -1.277123372574432E+001 -1.277123347646342E+001 -1.277123322087023E+001 +-1.277123295880484E+001 -1.277123269010332E+001 -1.277123241459759E+001 -1.277123213211529E+001 +-1.277123184247969E+001 -1.277123154550961E+001 -1.277123124101924E+001 -1.277123092881808E+001 +-1.277123060871080E+001 -1.277123028049712E+001 -1.277122994397168E+001 -1.277122959892391E+001 +-1.277122924513791E+001 -1.277122888239228E+001 -1.277122851046006E+001 -1.277122812910848E+001 +-1.277122773809890E+001 -1.277122733718661E+001 -1.277122692612072E+001 -1.277122650464395E+001 +-1.277122607249251E+001 -1.277122562939592E+001 -1.277122517507682E+001 -1.277122470925085E+001 +-1.277122423162641E+001 -1.277122374190451E+001 -1.277122323977858E+001 -1.277122272493427E+001 +-1.277122219704925E+001 -1.277122165579302E+001 -1.277122110082668E+001 -1.277122053180274E+001 +-1.277121994836491E+001 -1.277121935014782E+001 -1.277121873677685E+001 -1.277121810786787E+001 +-1.277121746302700E+001 -1.277121680185036E+001 -1.277121612392382E+001 -1.277121542882272E+001 +-1.277121471611163E+001 -1.277121398534408E+001 -1.277121323606223E+001 -1.277121246779662E+001 +-1.277121168006590E+001 -1.277121087237645E+001 -1.277121004422213E+001 -1.277120919508395E+001 +-1.277120832442973E+001 -1.277120743171374E+001 -1.277120651637642E+001 -1.277120557784397E+001 +-1.277120461552801E+001 -1.277120362882521E+001 -1.277120261711689E+001 -1.277120157976865E+001 +-1.277120051612996E+001 -1.277119942553374E+001 -1.277119830729594E+001 -1.277119716071513E+001 +-1.277119598507202E+001 -1.277119477962902E+001 -1.277119354362979E+001 -1.277119227629871E+001 +-1.277119097684046E+001 -1.277118964443943E+001 -1.277118827825928E+001 -1.277118687744238E+001 +-1.277118544110921E+001 -1.277118396835791E+001 -1.277118245826361E+001 -1.277118090987788E+001 +-1.277117932222813E+001 -1.277117769431698E+001 -1.277117602512163E+001 -1.277117431359319E+001 +-1.277117255865605E+001 -1.277117075920715E+001 -1.277116891411528E+001 -1.277116702222040E+001 +-1.277116508233285E+001 -1.277116309323260E+001 -1.277116105366849E+001 -1.277115896235740E+001 +-1.277115681798345E+001 -1.277115461919713E+001 -1.277115236461447E+001 -1.277115005281612E+001 +-1.277114768234643E+001 -1.277114525171257E+001 -1.277114275938349E+001 -1.277114020378901E+001 +-1.277113758331872E+001 -1.277113489632105E+001 -1.277113214110210E+001 -1.277112931592462E+001 +-1.277112641900683E+001 -1.277112344852132E+001 -1.277112040259381E+001 -1.277111727930200E+001 +-1.277111407667425E+001 -1.277111079268835E+001 -1.277110742527019E+001 -1.277110397229242E+001 +-1.277110043157302E+001 -1.277109680087394E+001 -1.277109307789960E+001 -1.277108926029540E+001 +-1.277108534564617E+001 -1.277108133147461E+001 -1.277107721523962E+001 -1.277107299433470E+001 +-1.277106866608617E+001 -1.277106422775145E+001 -1.277105967651725E+001 -1.277105500949769E+001 +-1.277105022373242E+001 -1.277104531618462E+001 -1.277104028373907E+001 -1.277103512320000E+001 +-1.277102983128898E+001 -1.277102440464279E+001 -1.277101883981114E+001 -1.277101313325435E+001 +-1.277100728134104E+001 -1.277100128034562E+001 -1.277099512644589E+001 -1.277098881572038E+001 +-1.277098234414578E+001 -1.277097570759416E+001 -1.277096890183027E+001 -1.277096192250859E+001 +-1.277095476517045E+001 -1.277094742524094E+001 -1.277093989802587E+001 -1.277093217870850E+001 +-1.277092426234630E+001 -1.277091614386754E+001 -1.277090781806781E+001 -1.277089927960647E+001 +-1.277089052300294E+001 -1.277088154263293E+001 -1.277087233272454E+001 -1.277086288735426E+001 +-1.277085320044284E+001 -1.277084326575109E+001 -1.277083307687547E+001 -1.277082262724361E+001 +-1.277081191010973E+001 -1.277080091854986E+001 -1.277078964545695E+001 -1.277077808353583E+001 +-1.277076622529806E+001 -1.277075406305656E+001 -1.277074158892014E+001 -1.277072879478781E+001 +-1.277071567234303E+001 -1.277070221304762E+001 -1.277068840813567E+001 -1.277067424860712E+001 +-1.277065972522124E+001 -1.277064482848984E+001 -1.277062954867037E+001 -1.277061387575871E+001 +-1.277059779948182E+001 -1.277058130929007E+001 -1.277056439434947E+001 -1.277054704353353E+001 +-1.277052924541493E+001 -1.277051098825696E+001 -1.277049226000460E+001 -1.277047304827543E+001 +-1.277045334035017E+001 -1.277043312316297E+001 -1.277041238329137E+001 -1.277039110694596E+001 +-1.277036927995970E+001 -1.277034688777690E+001 -1.277032391544181E+001 -1.277030034758693E+001 +-1.277027616842086E+001 -1.277025136171580E+001 -1.277022591079461E+001 -1.277019979851748E+001 +-1.277017300726813E+001 -1.277014551893959E+001 -1.277011731491946E+001 -1.277008837607474E+001 +-1.277005868273612E+001 -1.277002821468173E+001 -1.276999695112037E+001 -1.276996487067412E+001 +-1.276993195136048E+001 -1.276989817057377E+001 -1.276986350506594E+001 -1.276982793092673E+001 +-1.276979142356317E+001 -1.276975395767832E+001 -1.276971550724926E+001 -1.276967604550438E+001 +-1.276963554489980E+001 -1.276959397709504E+001 -1.276955131292771E+001 -1.276950752238739E+001 +-1.276946257458860E+001 -1.276941643774270E+001 -1.276936907912885E+001 -1.276932046506391E+001 +-1.276927056087121E+001 -1.276921933084826E+001 -1.276916673823317E+001 -1.276911274516994E+001 +-1.276905731267236E+001 -1.276900040058668E+001 -1.276894196755282E+001 -1.276888197096413E+001 +-1.276882036692566E+001 -1.276875711021090E+001 -1.276869215421673E+001 -1.276862545091686E+001 +-1.276855695081331E+001 -1.276848660288618E+001 -1.276841435454135E+001 -1.276834015155629E+001 +-1.276826393802364E+001 -1.276818565629268E+001 -1.276810524690852E+001 -1.276802264854881E+001 +-1.276793779795806E+001 -1.276785062987929E+001 -1.276776107698300E+001 -1.276766906979330E+001 +-1.276757453661113E+001 -1.276747740343427E+001 -1.276737759387429E+001 -1.276727502907004E+001 +-1.276716962759763E+001 -1.276706130537680E+001 -1.276694997557344E+001 -1.276683554849809E+001 +-1.276671793150024E+001 -1.276659702885843E+001 -1.276647274166553E+001 -1.276634496770953E+001 +-1.276621360134917E+001 -1.276607853338445E+001 -1.276593965092170E+001 -1.276579683723298E+001 +-1.276564997160953E+001 -1.276549892920907E+001 -1.276534358089653E+001 -1.276518379307809E+001 +-1.276501942752813E+001 -1.276485034120869E+001 -1.276467638608134E+001 -1.276449740891079E+001 +-1.276431325106017E+001 -1.276412374827737E+001 -1.276392873047219E+001 -1.276372802148375E+001 +-1.276352143883785E+001 -1.276330879349363E+001 -1.276308988957932E+001 -1.276286452411621E+001 +-1.276263248673068E+001 -1.276239355935346E+001 -1.276214751590563E+001 -1.276189412197083E+001 +-1.276163313445287E+001 -1.276136430121820E+001 -1.276108736072254E+001 -1.276080204162084E+001 +-1.276050806235991E+001 -1.276020513075287E+001 -1.275989294353455E+001 -1.275957118589704E+001 +-1.275923953100440E+001 -1.275889763948563E+001 -1.275854515890482E+001 -1.275818172320755E+001 +-1.275780695214229E+001 -1.275742045065578E+001 -1.275702180826116E+001 -1.275661059837749E+001 +-1.275618637763958E+001 -1.275574868517647E+001 -1.275529704185744E+001 -1.275483094950369E+001 +-1.275434989006460E+001 -1.275385332475639E+001 -1.275334069316200E+001 -1.275281141229007E+001 +-1.275226487559121E+001 -1.275170045192987E+001 -1.275111748450941E+001 -1.275051528974858E+001 +-1.274989315610706E+001 -1.274925034285780E+001 -1.274858607880378E+001 -1.274789956093669E+001 +-1.274718995303495E+001 -1.274645638419835E+001 -1.274569794731653E+001 -1.274491369746833E+001 +-1.274410265024896E+001 -1.274326378002194E+001 -1.274239601809231E+001 -1.274149825079783E+001 +-1.274056931751463E+001 -1.273960800857342E+001 -1.273861306308270E+001 -1.273758316665471E+001 +-1.273651694903020E+001 -1.273541298159759E+001 -1.273426977480213E+001 -1.273308577544054E+001 +-1.273185936383610E+001 -1.273058885088970E+001 -1.272927247500126E+001 -1.272790839885665E+001 +-1.272649470607445E+001 -1.272502939770705E+001 -1.272351038859025E+001 -1.272193550353545E+001 +-1.272030247335823E+001 -1.271860893073716E+001 -1.271685240589616E+001 -1.271503032210404E+001 +-1.271313999098416E+001 -1.271117860762734E+001 -1.270914324550104E+001 -1.270703085114733E+001 +-1.270483823866231E+001 -1.270256208394960E+001 -1.270019891873995E+001 -1.269774512436958E+001 +-1.269519692530900E+001 -1.269255038243476E+001 -1.268980138603590E+001 -1.268694564854723E+001 +-1.268397869700134E+001 -1.268089586519148E+001 -1.267769228553724E+001 -1.267436288064526E+001 +-1.267090235455722E+001 -1.266730518367769E+001 -1.266356560737423E+001 -1.265967761824297E+001 +-1.265563495203283E+001 -1.265143107722195E+001 -1.264705918424054E+001 -1.264251217433474E+001 +-1.263778264806681E+001 -1.263286289344747E+001 -1.262774487369725E+001 -1.262242021463448E+001 +-1.261688019168843E+001 -1.261111571653766E+001 -1.260511732337433E+001 -1.259887515479711E+001 +-1.259237894733663E+001 -1.258561801661921E+001 -1.257858124217644E+001 -1.257125705191036E+001 +-1.256363340622614E+001 -1.255569778184685E+001 -1.254743715532722E+001 -1.253883798628690E+001 +-1.252988620038624E+001 -1.252056717207160E+001 -1.251086570712071E+001 -1.250076602502287E+001 +-1.249025174123291E+001 -1.247930584934294E+001 -1.246791070322054E+001 -1.245604799916803E+001 +-1.244369875816276E+001 -1.243084330824511E+001 -1.241746126712718E+001 -1.240353152510242E+001 +-1.238903222834412E+001 -1.237394076268828E+001 -1.235823373800549E+001 -1.234188697327472E+001 +-1.232487548248208E+001 -1.230717346147690E+001 -1.228875427592849E+001 -1.226959045053753E+001 +-1.224965365966774E+001 -1.222891471957501E+001 -1.220734358242418E+001 -1.218490933229575E+001 +-1.216158018339876E+001 -1.213732348071909E+001 -1.211210570334676E+001 -1.208589247074001E+001 +-1.205864855219816E+001 -1.203033787983002E+001 -1.200092356531940E+001 -1.197036792080329E+001 +-1.193863248419349E+001 -1.190567804928569E+001 -1.187146470101453E+001 -1.183595185622540E+001 +-1.179909831034634E+001 -1.176086229035472E+001 -1.172120151444275E+001 -1.168007325879487E+001 +-1.163743443189621E+001 -1.159324165679604E+001 -1.154745136175229E+001 -1.150001987968215E+001 +-1.145090355684038E+001 -1.140005887113927E+001 -1.134744256051268E+001 -1.129301176171125E+001 +-1.123672415989464E+001 -1.117853814936085E+001 -1.111841300572088E+001 -1.105630906978814E+001 +-1.099218794340770E+001 -1.092601269739696E+001 -1.085774809170990E+001 -1.078736080786763E+001 +-1.071481969362083E+001 -1.064009601972317E+001 -1.056316374859844E+001 -1.048399981457835E+001 +-1.040258441527242E+001 -1.031890131350480E+001 -1.023293814911772E+001 -1.014468675979461E+001 +-1.005414350990080E+001 -9.961309626174650E+000 -9.866191538928128E+000 -9.768801227234874E+000 +-9.669156566394230E+000 -9.567281675765864E+000 -9.463207264869311E+000 -9.356970975440390E+000 +-9.248617716931001E+000 -9.138199992733354E+000 -9.025778214205740E+000 -8.911420999374256E+000 +-8.795205452987883E+000 -8.677217424410793E+000 -8.557551739648625E+000 -8.436312403624998E+000 +-8.313612768647932E+000 -8.189575664835715E+000 -8.064333488101877E+000 -7.938028241128460E+000 +-7.810811522580501E+000 -7.682844459624465E+000 -7.554297578604327E+000 -7.425350608488743E+000 +-7.296192211421459E+000 -7.167019634373293E+000 -7.038038275491284E+000 -6.909461158259147E+000 +-6.781508306006524E+000 -6.654406008623335E+000 -6.528385972542961E+000 -6.403684344150157E+000 +-6.280540595757564E+000 -6.159196262195297E+000 -6.039893514910228E+000 -5.922873559334354E+000 +-5.808374840239878E+000 -5.696631038977804E+000 -5.587868846057559E+000 -5.482305492685192E+000 +-5.380146025910751E+000 -5.281580314282541E+000 -5.186779774789438E+000 -5.095893817892459E+000 +-5.009046016200565E+000 -4.926330014521985E+000 -4.847805215407886E+000 -4.773492295784210E+000 +-4.703368637813538E+000 -4.637363791799418E+000 -4.575355131873899E+000 -4.517163917584973E+000 +-4.462552037574826E+000 -4.411219789591163E+000 -4.362805179098640E+000 -4.316885410419743E+000 +-4.272981242721826E+000 -4.230565032363103E+000 -4.189073474351396E+000 -4.147926251685524E+000 +-4.106552025447234E+000 -4.064423458549986E+000 -4.021103263966626E+000 -3.976303618721876E+000 +-3.929961753350966E+000 -3.882335041899741E+000 -3.834119538413978E+000 -3.786292384905248E+000 +-3.739083612690033E+000 -3.692482769808510E+000 -3.646479827485071E+000 -3.601065146483959E+000 +-3.556229446324951E+000 -3.511963777149560E+000 -3.468259494038068E+000 -3.425108233588893E+000 +-3.382501892581600E+000 -3.340432608556286E+000 -3.298892742152442E+000 -3.257874861060433E+000 +-3.217371725449445E+000 -3.177376274744606E+000 -3.137881615635904E+000 -3.098881011209789E+000 +-3.060367871102846E+000 -3.022335742584919E+000 -2.984778302486022E+000 -2.947689349888694E+000 +-2.911062799513726E+000 -2.874892675733059E+000 -2.839173107149732E+000 -2.803898321689321E+000 +-2.769062642152790E+000 -2.734660482184725E+000 -2.700686342615113E+000 -2.667134808136921E+000 +-2.634000544284845E+000 -2.601278294684165E+000 -2.568962878541468E+000 -2.537049188351623E+000 +-2.505532187798232E+000 -2.474406909826540E+000 -2.443668454870453E+000 -2.413311989216751E+000 +-2.383332743491449E+000 -2.353726011255088E+000 -2.324487147694571E+000 -2.295611568401196E+000 +-2.267094748225114E+000 -2.238932220197621E+000 -2.211119574514008E+000 -2.183652457569932E+000 +-2.156526571045638E+000 -2.129737671032649E+000 -2.103281567198256E+000 -2.077154121983877E+000 +-2.051351249833504E+000 -2.025868916449244E+000 -2.000703138071108E+000 -1.975849980778585E+000 +-1.951305559812019E+000 -1.927066038911758E+000 -1.903127629673630E+000 -1.879486590919267E+000 +-1.856139228079977E+000 -1.833081892593306E+000 -1.810310981311120E+000 -1.787822935918618E+000 +-1.765614242363474E+000 -1.743681430294482E+000 -1.722021072509295E+000 -1.700629784410651E+000 +-1.679504223470833E+000 -1.658641088703957E+000 -1.638037120145700E+000 -1.617689098340410E+000 +-1.597593843835129E+000 -1.577748216680503E+000 -1.558149115938332E+000 -1.538793479195519E+000 +-1.519678282084445E+000 -1.500800537809447E+000 -1.482157296679409E+000 -1.463745645646324E+000 +-1.445562707849644E+000 -1.427605642166471E+000 -1.409871642767327E+000 -1.392357938677561E+000 +-1.375061793344250E+000 -1.357980504208459E+000 -1.341111402282937E+000 -1.324451851734981E+000 +-1.307999249474581E+000 -1.291751024747661E+000 -1.275704638734358E+000 -1.259857584152371E+000 +-1.244207384865156E+000 -1.228751595495052E+000 -1.213487801041216E+000 -1.198413616502259E+000 +-1.183526686503632E+000 -1.168824684929586E+000 -1.154305314559742E+000 -1.139966306710184E+000 +-1.125805420878949E+000 -1.111820444396003E+000 -1.098009192077494E+000 -1.084369505884341E+000 +-1.070899254585061E+000 -1.057596333422753E+000 -1.044458663786263E+000 -1.031484192885383E+000 +-1.018670893430130E+000 -1.006016763313991E+000 -9.935198253010711E-001 -9.811781267171947E-001 +-9.689897391447654E-001 -9.569527581214714E-001 -9.450653028427273E-001 -9.333255158677639E-001 +-9.217315628294428E-001 -9.102816321476016E-001 -8.989739347460087E-001 -8.878067037728255E-001 +-8.767781943245053E-001 -8.658866831731832E-001 -8.551304684973862E-001 -8.445078696161305E-001 +-8.340172267263215E-001 -8.236569006433788E-001 -8.134252725451333E-001 -8.033207437188564E-001 +-7.933417353114651E-001 -7.834866880828257E-001 -7.737540621620971E-001 -7.641423368071382E-001 +-7.546500101668671E-001 -7.452755990465945E-001 -7.360176386762768E-001 -7.268746824816166E-001 +-7.178453018580517E-001 -7.089280859475032E-001 -7.001216414179381E-001 -6.914245922456492E-001 +-6.828355795002348E-001 -6.743532611322722E-001 -6.659763117636006E-001 -6.577034224802302E-001 +-6.495333006278192E-001 -6.414646696096783E-001 -6.334962686873108E-001 -6.256268527834000E-001 +-6.178551922872620E-001 -6.101800728627249E-001 -6.026002959623741E-001 -5.951146757610200E-001 +-5.877220433892063E-001 -5.804212437343833E-001 -5.732111360330748E-001 -5.660905936926098E-001 +-5.590585041151065E-001 -5.521137685236074E-001 -5.452553017903943E-001 -5.384820322674389E-001 +-5.317929016189360E-001 -5.251868646559518E-001 -5.186628896054093E-001 -5.122199561828820E-001 +-5.058570581399915E-001 -4.995732012620703E-001 -4.933674036847828E-001 -4.872386957406930E-001 +-4.811861327727236E-001 -4.752087340482719E-001 -4.693055964215468E-001 -4.634757887440984E-001 +-4.577184000968071E-001 -4.520325308761718E-001 -4.464172926537530E-001 -4.408718080373355E-001 +-4.353952105338542E-001 -4.299866444139855E-001 -4.246452645784444E-001 -4.193702364259423E-001 +-4.141607357227643E-001 -4.090159484739971E-001 -4.039350707963250E-001 -3.989173087924296E-001 +-3.939618784269454E-001 -3.890680054039408E-001 -3.842349253728886E-001 -3.794618824726567E-001 +-3.747481312635833E-001 -3.700929352124546E-001 -3.654955669354135E-001 -3.609553080843156E-001 +-3.564714492344773E-001 -3.520432897738292E-001 -3.476701377934487E-001 -3.433513099794393E-001 +-3.390861315061706E-001 -3.348739359308274E-001 -3.307140650892796E-001 -3.266058689932480E-001 +-3.225487057285594E-001 -3.185419413555606E-001 -3.145849498089774E-001 -3.106771128008286E-001 +-3.068178197236337E-001 -3.030064675549949E-001 -2.992424607633844E-001 -2.955252112150816E-001 +-2.918541380822807E-001 -2.882286677523381E-001 -2.846482337381362E-001 -2.811122765895786E-001 +-2.776202438061652E-001 -2.741715897506682E-001 -2.707657755638772E-001 -2.674022690803943E-001 +-2.640805447454903E-001 -2.608000835329790E-001 -2.575603728641206E-001 -2.543609065275336E-001 +-2.512011846000917E-001 -2.480807133688174E-001 -2.449990052537311E-001 -2.419555787316690E-001 +-2.389499582610472E-001 -2.359816742075500E-001 -2.330502627707574E-001 -2.301552659116670E-001 +-2.272962312811287E-001 -2.244727121491669E-001 -2.216842673351705E-001 -2.189304611389667E-001 +-2.162108632727331E-001 -2.135250487937694E-001 -2.108725980381005E-001 -2.082530965548979E-001 +-2.056661350417272E-001 -2.031113092805875E-001 -2.005882200747553E-001 -1.980964731864106E-001 +-1.956356792750307E-001 -1.932054538365622E-001 -1.908054171433353E-001 -1.884351941847327E-001 +-1.860944146085966E-001 -1.837827126633547E-001 -1.814997271408756E-001 -1.792451013200265E-001 +-1.770184829109350E-001 -1.748195239999457E-001 -1.726478809952539E-001 -1.705032145732231E-001 +-1.683851896253610E-001 -1.662934752059592E-001 -1.642277444803857E-001 -1.621876746740107E-001 +-1.601729470217773E-001 -1.581832467183905E-001 -1.562182628691292E-001 -1.542776884412703E-001 +-1.523612202161101E-001 -1.504685587415907E-001 -1.485994082855051E-001 -1.467534767892915E-001 +-1.449304758223989E-001 -1.431301205372164E-001 -1.413521296245690E-001 -1.395962252697584E-001 +-1.378621331091563E-001 -1.361495821873359E-001 -1.344583049147300E-001 -1.327880370258252E-001 +-1.311385175378650E-001 -1.295094887100731E-001 -1.279006960033815E-001 -1.263118880406561E-001 +-1.247428165674210E-001 -1.231932364130658E-001 -1.216629054525382E-001 -1.201515845685132E-001 +-1.186590376140268E-001 -1.171850313755816E-001 -1.157293355367038E-001 -1.142917226419563E-001 +-1.128719680614003E-001 -1.114698499554932E-001 -1.100851492404293E-001 -1.087176495539041E-001 +-1.073671372213092E-001 -1.060334012223455E-001 -1.047162331580491E-001 -1.034154272182308E-001 +-1.021307801493157E-001 -1.008620912225853E-001 -9.960916220281425E-002 -9.837179731729347E-002 +-9.714980322524283E-002 -9.594298898759891E-002 -9.475116603718146E-002 -9.357414814923039E-002 +-9.241175141230545E-002 -9.126379419955218E-002 -9.013009714032008E-002 -8.901048309213711E-002 +-8.790477711303071E-002 -8.681280643419158E-002 -8.573440043298015E-002 -8.466939060626430E-002 +-8.361761054409164E-002 -8.257889590368808E-002 -8.155308438377726E-002 -8.054001569922280E-002 +-7.953953155598111E-002 + + + + 3.075797279882494E-004 3.114486047166302E-004 3.153661459244108E-004 3.193329637354234E-004 + 3.233496779730725E-004 3.274169162571814E-004 3.315353141020609E-004 3.357055150158096E-004 + 3.399281706008627E-004 3.442039406558072E-004 3.485334932784765E-004 3.529175049703414E-004 + 3.573566607422158E-004 3.618516542212906E-004 3.664031877595161E-004 3.710119725433431E-004 + 3.756787287048496E-004 3.804041854342618E-004 3.851890810938928E-004 3.900341633335129E-004 + 3.949401892071706E-004 3.999079252914851E-004 4.049381478054248E-004 4.100316427315942E-004 + 4.151892059390451E-004 4.204116433076318E-004 4.256997708539326E-004 4.310544148587548E-004 + 4.364764119962410E-004 4.419666094646043E-004 4.475258651185019E-004 4.531550476030780E-004 + 4.588550364896921E-004 4.646267224133531E-004 4.704710072118849E-004 4.763888040668373E-004 + 4.823810376461755E-004 4.884486442487609E-004 4.945925719506491E-004 5.008137807532308E-004 + 5.071132427332315E-004 5.134919421946036E-004 5.199508758223238E-004 5.264910528381289E-004 + 5.331134951582095E-004 5.398192375528850E-004 5.466093278082901E-004 5.534848268900931E-004 + 5.604468091092752E-004 5.674963622899950E-004 5.746345879395607E-004 5.818626014205451E-004 + 5.891815321250646E-004 5.965925236512465E-004 6.040967339819234E-004 6.116953356655663E-004 + 6.193895159995005E-004 6.271804772154239E-004 6.350694366672571E-004 6.430576270213606E-004 + 6.511462964491389E-004 6.593367088220725E-004 6.676301439091999E-004 6.760278975770854E-004 + 6.845312819923025E-004 6.931416258264602E-004 7.018602744638141E-004 7.106885902114848E-004 + 7.196279525123232E-004 7.286797581604509E-004 7.378454215195129E-004 7.471263747436767E-004 + 7.565240680014084E-004 7.660399697020662E-004 7.756755667253461E-004 7.854323646536056E-004 + 7.953118880071188E-004 8.053156804822851E-004 8.154453051928364E-004 8.257023449140806E-004 + 8.360884023302095E-004 8.466051002847259E-004 8.572540820340177E-004 8.680370115041197E-004 + 8.789555735507095E-004 8.900114742223674E-004 9.012064410271536E-004 9.125422232025372E-004 + 9.240205919887161E-004 9.356433409053853E-004 9.474122860319710E-004 9.593292662914052E-004 + 9.713961437374607E-004 9.836148038457006E-004 9.959871558080961E-004 1.008515132831335E-003 + 1.021200692438897E-003 1.034045816776924E-003 1.047052512923929E-003 1.060222813204422E-003 + 1.073558775506451E-003 1.087062483603169E-003 1.100736047478419E-003 1.114581603656432E-003 + 1.128601315535666E-003 1.142797373726842E-003 1.157171996395237E-003 1.171727429607276E-003 + 1.186465947681493E-003 1.201389853543900E-003 1.216501479087824E-003 1.231803185538277E-003 + 1.247297363820906E-003 1.262986434935583E-003 1.278872850334697E-003 1.294959092306200E-003 + 1.311247674361478E-003 1.327741141628091E-003 1.344442071247466E-003 1.361353072777585E-003 + 1.378476788600728E-003 1.395815894336376E-003 1.413373099259266E-003 1.431151146722743E-003 + 1.449152814587415E-003 1.467380915655202E-003 1.485838298108855E-003 1.504527845956991E-003 + 1.523452479484738E-003 1.542615155710042E-003 1.562018868845709E-003 1.581666650767270E-003 + 1.601561571486729E-003 1.621706739632255E-003 1.642105302933940E-003 1.662760448715625E-003 + 1.683675404392953E-003 1.704853437977660E-003 1.726297858588220E-003 1.748012016966921E-003 + 1.769999306003421E-003 1.792263161264917E-003 1.814807061532969E-003 1.837634529347075E-003 + 1.860749131555096E-003 1.884154479870589E-003 1.907854231437162E-003 1.931852089399923E-003 + 1.956151803484120E-003 1.980757170581064E-003 2.005672035341406E-003 2.030900290775896E-003 + 2.056445878863692E-003 2.082312791168315E-003 2.108505069461365E-003 2.135026806354071E-003 + 2.161882145936788E-003 2.189075284426545E-003 2.216610470822731E-003 2.244492007571041E-003 + 2.272724251235753E-003 2.301311613180480E-003 2.330258560257485E-003 2.359569615505651E-003 + 2.389249358857263E-003 2.419302427853625E-003 2.449733518369755E-003 2.480547385348129E-003 + 2.511748843541689E-003 2.543342768266200E-003 2.575334096162042E-003 2.607727825965633E-003 + 2.640529019290502E-003 2.673742801418233E-003 2.707374362099343E-003 2.741428956364201E-003 + 2.775911905344229E-003 2.810828597103344E-003 2.846184487479917E-003 2.881985100939313E-003 + 2.918236031437130E-003 2.954942943293338E-003 2.992111572077390E-003 3.029747725504454E-003 + 3.067857284342975E-003 3.106446203333572E-003 3.145520512119582E-003 3.185086316189243E-003 + 3.225149797829766E-003 3.265717217093409E-003 3.306794912775663E-003 3.348389303405826E-003 + 3.390506888249946E-003 3.433154248326451E-003 3.476338047434524E-003 3.520065033195413E-003 + 3.564342038106878E-003 3.609175980610847E-003 3.654573866174548E-003 3.700542788385247E-003 + 3.747089930058697E-003 3.794222564361629E-003 3.841948055948277E-003 3.890273862111248E-003 + 3.939207533946881E-003 3.988756717535204E-003 4.038929155134841E-003 4.089732686392846E-003 + 4.141175249569818E-003 4.193264882780451E-003 4.246009725249597E-003 4.299418018584264E-003 + 4.353498108061498E-003 4.408258443932552E-003 4.463707582743426E-003 4.519854188672017E-003 + 4.576707034882132E-003 4.634275004894495E-003 4.692567093975021E-003 4.751592410540588E-003 + 4.811360177582418E-003 4.871879734107483E-003 4.933160536597938E-003 4.995212160488980E-003 + 5.058044301665315E-003 5.121666777976370E-003 5.186089530770707E-003 5.251322626449613E-003 + 5.317376258040319E-003 5.384260746789015E-003 5.451986543773834E-003 5.520564231538272E-003 + 5.590004525745017E-003 5.660318276850680E-003 5.731516471801612E-003 5.803610235750958E-003 + 5.876610833797475E-003 5.950529672746085E-003 6.025378302890687E-003 6.101168419819381E-003 + 6.177911866242340E-003 6.255620633842836E-003 6.334306865151408E-003 6.413982855443720E-003 + 6.494661054662270E-003 6.576354069362285E-003 6.659074664682125E-003 6.742835766338462E-003 + 6.827650462646603E-003 6.913532006566238E-003 7.000493817772906E-003 7.088549484755597E-003 + 7.177712766940693E-003 7.267997596842699E-003 7.359418082242024E-003 7.451988508390178E-003 + 7.545723340242751E-003 7.640637224720464E-003 7.736744992998733E-003 7.834061662826037E-003 + 7.932602440871463E-003 8.032382725101827E-003 8.133418107188727E-003 8.235724374945894E-003 + 8.339317514797232E-003 8.444213714275943E-003 8.550429364555127E-003 8.657981063010233E-003 + 8.766885615813784E-003 8.877160040562802E-003 8.988821568939286E-003 9.101887649404226E-003 + 9.216375949925521E-003 9.332304360740279E-003 9.449690997151920E-003 9.568554202362446E-003 + 9.688912550340489E-003 9.810784848725381E-003 9.934190141767883E-003 1.005914771330795E-002 + 1.018567708978994E-002 1.031379804331597E-002 1.044353059473752E-002 1.057489501678619E-002 + 1.070791183724382E-002 1.084260184215250E-002 1.097898607906520E-002 1.111708586033714E-002 + 1.125692276645886E-002 1.139851864943112E-002 1.154189563618246E-002 1.168707613202978E-002 + 1.183408282418253E-002 1.198293868529111E-002 1.213366697703999E-002 1.228629125378613E-002 + 1.244083536624325E-002 1.259732346521261E-002 1.275578000536074E-002 1.291622974904494E-002 + 1.307869777018687E-002 1.324320945819517E-002 1.340979052193737E-002 1.357846699376201E-002 + 1.374926523357152E-002 1.392221193294640E-002 1.409733411932148E-002 1.427465916021485E-002 + 1.445421476751018E-002 1.463602900179308E-002 1.482013027674213E-002 1.500654736357542E-002 + 1.519530939555313E-002 1.538644587253704E-002 1.557998666560749E-002 1.577596202173874E-002 + 1.597440256853330E-002 1.617533931901608E-002 1.637880367648908E-002 1.658482743944740E-002 + 1.679344280655732E-002 1.700468238169732E-002 1.721857917906279E-002 1.743516662833519E-002 + 1.765447857991658E-002 1.787654931023036E-002 1.810141352708889E-002 1.832910637512909E-002 + 1.855966344131668E-002 1.879312076052009E-002 1.902951482115493E-002 1.926888257089959E-002 + 1.951126142248348E-002 1.975668925954828E-002 2.000520444258349E-002 2.025684581493703E-002 + 2.051165270890196E-002 2.076966495188021E-002 2.103092287262450E-002 2.129546730755906E-002 + 2.156333960718081E-002 2.183458164254113E-002 2.210923581181020E-002 2.238734504692436E-002 + 2.266895282031766E-002 2.295410315173893E-002 2.324284061515517E-002 2.353521034574253E-002 + 2.383125804696606E-002 2.413102999774909E-002 2.443457305973394E-002 2.474193468463447E-002 + 2.505316292168216E-002 2.536830642516677E-002 2.568741446207267E-002 2.601053691981249E-002 + 2.633772431405864E-002 2.666902779667478E-002 2.700449916374794E-002 2.734419086372289E-002 + 2.768815600564013E-002 2.803644836747833E-002 2.838912240460352E-002 2.874623325832547E-002 + 2.910783676456328E-002 2.947398946262136E-002 2.984474860407720E-002 3.022017216178258E-002 + 3.060031883897957E-002 3.098524807853281E-002 3.137502007227975E-002 3.176969577050010E-002 + 3.216933689150647E-002 3.257400593135746E-002 3.298376617369483E-002 3.339868169970683E-002 + 3.381881739821851E-002 3.424423897591163E-002 3.467501296767524E-002 3.511120674708880E-002 + 3.555288853704005E-002 3.600012742047843E-002 3.645299335130698E-002 3.691155716541390E-002 + 3.737589059184562E-002 3.784606626412364E-002 3.832215773170683E-002 3.880423947160104E-002 + 3.929238690011817E-002 3.978667638478679E-002 4.028718525641607E-002 4.079399182131539E-002 + 4.130717537367133E-002 4.182681620808477E-002 4.235299563226963E-002 4.288579597991581E-002 + 4.342530062371876E-002 4.397159398857718E-002 4.452476156496206E-002 4.508488992245882E-002 + 4.565206672348508E-002 4.622638073718677E-002 4.680792185351407E-002 4.739678109748118E-002 + 4.799305064361089E-002 4.859682383056777E-002 4.920819517598181E-002 4.982726039146531E-002 + 5.045411639782604E-002 5.108886134047905E-002 5.173159460506016E-002 5.238241683324373E-002 + 5.304142993876769E-002 5.370873712366888E-002 5.438444289473150E-002 5.506865308015165E-002 + 5.576147484642157E-002 5.646301671543545E-002 5.717338858182168E-002 5.789270173050334E-002 + 5.862106885449102E-002 5.935860407291115E-002 6.010542294927287E-002 6.086164250997743E-002 + 6.162738126307345E-002 6.240275921726147E-002 6.318789790115190E-002 6.398292038277904E-002 + 6.478795128937655E-002 6.560311682741678E-002 6.642854480291859E-002 6.726436464202770E-002 + 6.811070741187314E-002 6.896770584170447E-002 6.983549434431376E-002 7.071420903774668E-002 + 7.160398776730706E-002 7.250497012785916E-002 7.341729748643280E-002 7.434111300513531E-002 + 7.527656166437557E-002 7.622379028640471E-002 7.718294755917808E-002 7.815418406054424E-002 + 7.913765228276554E-002 8.013350665737555E-002 8.114190358037905E-002 8.216300143779921E-002 + 8.319696063157846E-002 8.424394360583797E-002 8.530411487350215E-002 8.637764104329347E-002 + 8.746469084710351E-002 8.856543516774738E-002 8.968004706710675E-002 9.080870181466824E-002 + 9.195157691646413E-002 9.310885214442095E-002 9.428070956612447E-002 9.546733357500627E-002 + 9.666891092096018E-002 9.788563074139631E-002 9.911768459273788E-002 1.003652664823713E-001 + 1.016285729010555E-001 1.029078028557989E-001 1.042031579032127E-001 1.055148421833474E-001 + 1.068430624540236E-001 1.081880281256625E-001 1.095499512966284E-001 1.109290467890902E-001 + 1.123255321854112E-001 1.137396278650787E-001 1.151715570421814E-001 1.166215458034443E-001 + 1.180898231468349E-001 1.195766210207459E-001 1.210821743637697E-001 1.226067211450736E-001 + 1.241505024053882E-001 1.257137622986198E-001 1.272967481340981E-001 1.288997104194740E-001 + 1.305229029042771E-001 1.321665826241483E-001 1.338310099457588E-001 1.355164486124293E-001 + 1.372231657904659E-001 1.389514321162222E-001 1.407015217439072E-001 1.424737123941509E-001 + 1.442682854033439E-001 1.460855257737672E-001 1.479257222245282E-001 1.497891672433193E-001 + 1.516761571390179E-001 1.535869920951418E-001 1.555219762241831E-001 1.574814176228351E-001 + 1.594656284281328E-001 1.614749248745287E-001 1.635096273519187E-001 1.655700604646461E-001 + 1.676565530914986E-001 1.697694384467248E-001 1.719090541420902E-001 1.740757422499964E-001 + 1.762698493676887E-001 1.784917266825752E-001 1.807417300386832E-001 1.830202200042800E-001 + 1.853275619406815E-001 1.876641260722816E-001 1.900302875578248E-001 1.924264265629557E-001 + 1.948529283340741E-001 1.973101832735244E-001 1.997985870161547E-001 2.023185405072767E-001 + 2.048704500820581E-001 2.074547275463878E-001 2.100717902592422E-001 2.127220612165962E-001 + 2.154059691369125E-001 2.181239485482507E-001 2.208764398770355E-001 2.236638895385233E-001 + 2.264867500290155E-001 2.293454800198564E-001 2.322405444532643E-001 2.351724146400431E-001 + 2.381415683592184E-001 2.411484899596529E-001 2.441936704636885E-001 2.472776076728687E-001 + 2.504008062757975E-001 2.535637779581845E-001 2.567670415151424E-001 2.600111229657885E-001 + 2.632965556702168E-001 2.666238804488993E-001 2.699936457045836E-001 2.734064075467542E-001 + 2.768627299187236E-001 2.803631847274272E-001 2.839083519759935E-001 2.874988198991631E-001 + 2.911351851016374E-001 2.948180526994351E-001 2.985480364643377E-001 3.023257589715117E-001 + 3.061518517503893E-001 3.100269554389052E-001 3.139517199411740E-001 3.179268045887093E-001 + 3.219528783052802E-001 3.260306197755040E-001 3.301607176172848E-001 3.343438705581986E-001 + 3.385807876159393E-001 3.428721882829373E-001 3.472188027152659E-001 3.516213719259585E-001 + 3.560806479828572E-001 3.605973942111205E-001 3.651723854005217E-001 3.698064080176682E-001 + 3.745002604232842E-001 3.792547530946962E-001 3.840707088536637E-001 3.889489630997133E-001 + 3.938903640491147E-001 3.988957729796740E-001 4.039660644814900E-001 4.091021267138489E-001 + 4.143048616684249E-001 4.195751854389572E-001 4.249140284975871E-001 4.303223359780379E-001 + 4.358010679658182E-001 4.413511997956521E-001 4.469737223563176E-001 4.526696424031092E-001 + 4.584399828781190E-001 4.642857832385487E-001 4.702080997932701E-001 4.762080060478453E-001 + 4.822865930582366E-001 4.884449697934268E-001 4.946842635071849E-001 5.010056201192101E-001 + 5.074102046058918E-001 5.138992014009314E-001 5.204738148060675E-001 5.271352694121583E-001 + 5.338848105308713E-001 5.407237046372303E-001 5.476532398232882E-001 5.546747262631759E-001 + 5.617894966897900E-001 5.689989068833873E-001 5.763043361723385E-001 5.837071879463163E-001 + 5.912088901821715E-001 5.988108959827627E-001 6.065146841289980E-001 6.143217596453439E-001 + 6.222336543790568E-001 6.302519275933839E-001 6.383781665749740E-001 6.466139872557378E-001 + 6.549610348493751E-001 6.634209845027963E-001 6.719955419626363E-001 6.806864442570526E-001 + 6.894954603929883E-001 6.984243920690495E-001 7.074750744041507E-001 7.166493766820304E-001 + 7.259492031117417E-001 7.353764936041746E-001 7.449332245646467E-001 7.546214097015647E-001 + 7.644431008511167E-001 7.744003888179122E-001 7.844954042314520E-001 7.947303184182392E-001 + 8.051073442893110E-001 8.156287372428873E-001 8.262967960817775E-001 8.371138639451131E-001 + 8.480823292538769E-001 8.592046266696434E-001 8.704832380658135E-001 8.819206935105410E-001 + 8.935195722604379E-001 9.052825037640000E-001 9.172121686735850E-001 9.293112998646089E-001 + 9.415826834604762E-001 9.540291598615819E-001 9.666536247765268E-001 9.794590302535229E-001 + 9.924483857096761E-001 1.005624758955655E+000 1.018991277212988E+000 1.032551128120894E+000 + 1.046307560729341E+000 1.060263886474619E+000 1.074423480133389E+000 1.088789780750837E+000 + 1.103366292538021E+000 1.118156585733235E+000 1.133164297421561E+000 1.148393132306357E+000 + 1.163846863425896E+000 1.179529332807651E+000 1.195444452052236E+000 1.211596202838153E+000 + 1.227988637337876E+000 1.244625878534935E+000 1.261512120430771E+000 1.278651628129293E+000 + 1.296048737785944E+000 1.313707856407093E+000 1.331633461484418E+000 1.349830100447584E+000 + 1.368302389917371E+000 1.387055014739795E+000 1.406092726780330E+000 1.425420343455702E+000 + 1.445042745978853E+000 1.464964877290938E+000 1.485191739652021E+000 1.505728391860105E+000 + 1.526579946065746E+000 1.547751564146985E+000 1.569248453606783E+000 1.591075862952170E+000 + 1.613239076511393E+000 1.635743408642106E+000 1.658594197280094E+000 1.681796796774524E+000 + 1.705356569951618E+000 1.729278879344592E+000 1.753569077523282E+000 1.778232496452048E+000 + 1.803274435799736E+000 1.828700150120007E+000 1.854514834814824E+000 1.880723610787987E+000 + 1.907331507689192E+000 1.934343445642659E+000 1.961764215347239E+000 1.989598456427679E+000 + 2.017850633909027E+000 2.046525012678004E+000 2.075625629786886E+000 2.105156264446524E+000 + 2.135120405546036E+000 2.165521216527314E+000 2.196361497432507E+000 2.227643643932817E+000 + 2.259369603136411E+000 2.291540825962834E+000 2.324158215860734E+000 2.357222073634758E+000 + 2.390732038137102E+000 2.424687022568335E+000 2.459085146122029E+000 2.493923660697798E+000 + 2.529198872397979E+000 2.564906057514829E+000 2.601039372707564E+000 2.637591759062492E+000 + 2.674554839725089E+000 2.711918810790263E+000 2.749672325137254E+000 2.787802368898396E+000 + 2.826294130257447E+000 2.865130860283830E+000 2.904293725524212E+000 2.943761652094140E+000 + 2.983511161039548E+000 3.023516194773074E+000 3.063747934433562E+000 3.104174608070248E+000 + 3.144761289617693E+000 3.185469688704282E+000 3.226257931428352E+000 3.267080332343103E+000 + 3.307887158016029E+000 3.348624382673619E+000 3.389233436608260E+000 3.429650948215268E+000 + 3.469808480745272E+000 3.509632265103197E+000 3.549042930303255E+000 3.587955233500538E+000 + 3.626277791868118E+000 3.663912818975205E+000 3.700755868749009E+000 3.736695590573131E+000 + 3.771613499588751E+000 3.805383766822990E+000 3.837873034371597E+000 3.868940261508750E+000 + 3.898436608283991E+000 3.926205363890317E+000 3.952081927843322E+000 3.975893852790803E+000 + 3.997460958565001E+000 4.016595527882590E+000 4.033102594873306E+000 4.046780338356693E+000 + 4.057420592462114E+000 4.064809487770518E+000 4.068728236612259E+000 4.068954076442616E+000 + 4.065261385289282E+000 4.057422983071095E+000 4.045211632066242E+000 4.028401748896859E+000 + 4.006771339025895E+000 3.980104162858274E+000 3.948192140025416E+000 3.910837995234068E+000 + 3.867858145102059E+000 3.819085820616837E+000 3.764374414177209E+000 3.703601033570708E+000 + 3.636670237673134E+000 3.563517920136270E+000 3.484115297891471E+000 3.398472951019091E+000 + 3.306644849547645E+000 3.208732291238676E+000 3.104887662638749E+000 2.995317923966189E+000 + 2.880287707149558E+000 2.760121906033574E+000 2.635207628975264E+000 2.505995377402686E+000 + 2.372999310094681E+000 2.236796452696228E+000 2.098024716067414E+000 1.957379596212463E+000 + 1.815609443439404E+000 1.673509209655465E+000 1.531912610756213E+000 1.391682676180116E+000 + 1.253700699891358E+000 1.118853656067123E+000 9.880201980393709E-001 8.620554197025262E-001 + 7.417746234871715E-001 6.279364067111378E-001 5.212254471026790E-001 4.222354369738667E-001 + 3.314526824815972E-001 2.492409485889171E-001 1.758281912536422E-001 1.112958763910707E-001 + 5.557164170709673E-002 8.426115250977995E-003 -3.052523249311788E-002 -6.181425265832750E-002 +-8.610525746664197E-002 -1.041719801039226E-001 -1.168650549810820E-001 -1.250685370290415E-001 +-1.296437578493815E-001 -1.313585569019249E-001 -1.307996329927177E-001 -1.282654455890776E-001 +-1.236367700602208E-001 -1.164848148323806E-001 -1.069952681991816E-001 -9.562285469468815E-002 +-8.289014444846655E-002 -6.937569655146257E-002 -5.569676116848803E-002 -4.248545568044745E-002 +-3.035719789100982E-002 -1.987003691617276E-002 -1.147336603830714E-002 -5.444325797909452E-003 +-1.810002679679951E-003 -2.532902842563463E-004 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 + + +-4.280971527514776E-008 -4.389344837610757E-008 -4.500461631109104E-008 -4.614391359622576E-008 +-4.731205232939891E-008 -4.850976263534117E-008 -4.973779312197860E-008 -5.099691134833722E-008 +-5.228790430429188E-008 -5.361157890246114E-008 -5.496876248255344E-008 -5.636030332848145E-008 +-5.778707119856716E-008 -5.924995786916914E-008 -6.074987769207190E-008 -6.228776816598528E-008 +-6.386459052251169E-008 -6.548133032694716E-008 -6.713899809429184E-008 -6.883862992085485E-008 +-7.058128813184761E-008 -7.236806194537223E-008 -7.420006815321807E-008 -7.607845181889279E-008 +-7.800438699332487E-008 -7.997907744868277E-008 -8.200375743077227E-008 -8.407969243048025E-008 +-8.620817997474716E-008 -8.839055043756454E-008 -9.062816787150101E-008 -9.292243086027996E-008 +-9.527477339294001E-008 -9.768666576012424E-008 -1.001596154730608E-007 -1.026951682058051E-007 +-1.052949087613370E-007 -1.079604620621146E-007 -1.106934941657028E-007 -1.134957133061144E-007 +-1.163688709615109E-007 -1.193147629489343E-007 -1.223352305467504E-007 -1.254321616455077E-007 +-1.286074919279315E-007 -1.318632060787869E-007 -1.352013390253724E-007 -1.386239772094152E-007 +-1.421332598911650E-007 -1.457313804865025E-007 -1.494205879378938E-007 -1.532031881200533E-007 +-1.570815452811908E-007 -1.610580835207428E-007 -1.651352883045146E-007 -1.693157080181757E-007 +-1.736019555600847E-007 -1.779967099744352E-007 -1.825027181257457E-007 -1.871227964157402E-007 +-1.918598325436890E-007 -1.967167873113156E-007 -2.016966964733939E-007 -2.068026726351937E-007 +-2.120379071979606E-007 -2.174056723536442E-007 -2.229093231301253E-007 -2.285522994882171E-007 +-2.343381284717528E-007 -2.402704264121029E-007 -2.463529011884984E-007 -2.525893545455772E-007 +-2.589836844695972E-007 -2.655398876248044E-007 -2.722620618514792E-007 -2.791544087272175E-007 +-2.862212361930550E-007 -2.934669612460684E-007 -3.008961127001441E-007 -3.085133340166335E-007 +-3.163233862066656E-007 -3.243311508069348E-007 -3.325416329308198E-007 -3.409599643967414E-007 +-3.495914069357176E-007 -3.584413554801125E-007 -3.675153415356476E-007 -3.768190366387711E-007 +-3.863582559015508E-007 -3.961389616463130E-007 -4.061672671322801E-007 -4.164494403765618E-007 +-4.269919080718659E-007 -4.378012596033909E-007 -4.488842511674078E-007 -4.602478099940965E-007 +-4.718990386772946E-007 -4.838452196138456E-007 -4.960938195553340E-007 -5.086524942750497E-007 +-5.215290933530899E-007 -5.347316650826045E-007 -5.482684615002386E-007 -5.621479435439226E-007 +-5.763787863412366E-007 -5.909698846316402E-007 -6.059303583259765E-007 -6.212695582067112E-007 +-6.369970717724737E-007 -6.531227292305568E-007 -6.696566096411118E-007 -6.866090472168880E-007 +-7.039906377824501E-007 -7.218122453969136E-007 -7.400850091443320E-007 -7.588203500959845E-007 +-7.780299784489147E-007 -7.977259008451835E-007 -8.179204278764072E-007 -8.386261817782814E-007 +-8.598561043198767E-007 -8.816234648926712E-007 -9.039418688043436E-007 -9.268252657825315E-007 +-9.502879586938697E-007 -9.743446124837284E-007 -9.990102633422930E-007 -1.024300328102658E-006 +-1.050230613876850E-006 -1.076817327935787E-006 -1.104077087839336E-006 -1.132026931822833E-006 +-1.160684329446523E-006 -1.190067192514604E-006 -1.220193886270683E-006 -1.251083240876637E-006 +-1.282754563182081E-006 -1.315227648791763E-006 -1.348522794438458E-006 -1.382660810669089E-006 +-1.417663034851967E-006 -1.453551344513355E-006 -1.490348171011612E-006 -1.528076513557517E-006 +-1.566759953589526E-006 -1.606422669512911E-006 -1.647089451812051E-006 -1.688785718545280E-006 +-1.731537531231987E-006 -1.775371611141915E-006 -1.820315355996788E-006 -1.866396857094788E-006 +-1.913644916868507E-006 -1.962089066887391E-006 -2.011759586315929E-006 -2.062687520839080E-006 +-2.114904702066837E-006 -2.168443767429995E-006 -2.223338180579585E-006 -2.279622252302752E-006 +-2.337331161968052E-006 -2.396500979513714E-006 -2.457168687992488E-006 -2.519372206687242E-006 +-2.583150414811724E-006 -2.648543175811288E-006 -2.715591362278859E-006 -2.784336881501567E-006 +-2.854822701654150E-006 -2.927092878655452E-006 -3.001192583704717E-006 -3.077168131515098E-006 +-3.155067009261756E-006 -3.234937906262893E-006 -3.316830744412122E-006 -3.400796709381183E-006 +-3.486888282612685E-006 -3.575159274122608E-006 -3.665664856133283E-006 -3.758461597557804E-006 +-3.853607499357322E-006 -3.951162030793551E-006 -4.051186166598878E-006 -4.153742425087497E-006 +-4.258894907231379E-006 -4.366709336725288E-006 -4.477253101066287E-006 -4.590595293672928E-006 +-4.706806757070860E-006 -4.825960127171655E-006 -4.948129878672423E-006 -5.073392371604971E-006 +-5.201825899063074E-006 -5.333510736138190E-006 -5.468529190093881E-006 -5.606965651810350E-006 +-5.748906648531482E-006 -5.894440897946956E-006 -6.043659363643590E-006 -6.196655311960465E-006 +-6.353524370283130E-006 -6.514364586813836E-006 -6.679276491854579E-006 -6.848363160641669E-006 +-7.021730277770980E-006 -7.199486203253938E-006 -7.381742040246028E-006 -7.568611704489536E-006 +-7.760211995514414E-006 -7.956662669641630E-006 -8.158086514834348E-006 -8.364609427444358E-006 +-8.576360490900950E-006 -8.793472056392048E-006 -9.016079825587756E-006 -9.244322935457857E-006 +-9.478344045236817E-006 -9.718289425589929E-006 -9.964309050036949E-006 -1.021655668869010E-005 +-1.047519000436483E-005 -1.074037065112396E-005 -1.101226437531619E-005 -1.129104111917247E-005 +-1.157687512702507E-005 -1.186994505421520E-005 -1.217043407875817E-005 -1.247853001583477E-005 +-1.279442543518140E-005 -1.311831778145183E-005 -1.345040949762570E-005 -1.379090815154151E-005 +-1.414002656563231E-005 -1.449798294994597E-005 -1.486500103853289E-005 -1.524131022928583E-005 +-1.562714572732065E-005 -1.602274869198581E-005 -1.642836638759400E-005 -1.684425233796944E-005 +-1.727066648490706E-005 -1.770787535064392E-005 -1.815615220444267E-005 -1.861577723339261E-005 +-1.908703771753447E-005 -1.957022820941821E-005 -2.006565071820666E-005 -2.057361489843932E-005 +-2.109443824357500E-005 -2.162844628443389E-005 -2.217597279266295E-005 -2.273735998935236E-005 +-2.331295875893258E-005 -2.390312886848669E-005 -2.450823919261415E-005 -2.512866794398717E-005 +-2.576480290974350E-005 -2.641704169386334E-005 -2.708579196568224E-005 -2.777147171469477E-005 +-2.847450951180854E-005 -2.919534477721186E-005 -2.993442805502237E-005 -3.069222129488834E-005 +-3.146919814071850E-005 -3.226584422672110E-005 -3.308265748093717E-005 -3.392014843645731E-005 +-3.477884055051720E-005 -3.565927053167065E-005 -3.656198867524503E-005 -3.748755920728860E-005 +-3.843656063722457E-005 -3.940958611943276E-005 -4.040724382398436E-005 -4.143015731676157E-005 +-4.247896594920013E-005 -4.355432525789758E-005 -4.465690737433766E-005 -4.578740144498683E-005 +-4.694651406202485E-005 -4.813496970497963E-005 -4.935351119354125E-005 -5.060290015183918E-005 +-5.188391748447233E-005 -5.319736386458908E-005 -5.454406023432356E-005 -5.592484831789924E-005 +-5.734059114772200E-005 -5.879217360379095E-005 -6.028050296676348E-005 -6.180650948502148E-005 +-6.337114695609173E-005 -6.497539332278509E-005 -6.662025128442607E-005 -6.830674892355541E-005 +-7.003594034849718E-005 -7.180890635219153E-005 -7.362675508770559E-005 -7.549062276084436E-005 +-7.740167434029395E-005 -7.936110428574209E-005 -8.137013729442942E-005 -8.343002906659987E-005 +-8.554206709032715E-005 -8.770757144620814E-005 -8.992789563242667E-005 -9.220442741070248E-005 +-9.453858967365437E-005 -9.693184133412022E-005 -9.938567823698803E-005 -1.019016340941099E-004 +-1.044812814428811E-004 -1.071262326290853E-004 -1.098381408146185E-004 -1.126187010107222E-004 +-1.154696511373715E-004 -1.183927731094797E-004 -1.213898939505996E-004 -1.244628869348148E-004 +-1.276136727575371E-004 -1.308442207359407E-004 -1.341565500397831E-004 -1.375527309533823E-004 +-1.410348861695377E-004 -1.446051921162070E-004 -1.482658803167615E-004 -1.520192387846763E-004 +-1.558676134535240E-004 -1.598134096431647E-004 -1.638590935630514E-004 -1.680071938535854E-004 +-1.722603031664907E-004 -1.766210797851900E-004 -1.810922492861979E-004 -1.856766062425679E-004 +-1.903770159704571E-004 -1.951964163199024E-004 -2.001378195109240E-004 -2.052043140161053E-004 +-2.103990664908282E-004 -2.157253237523602E-004 -2.211864148090429E-004 -2.267857529408406E-004 +-2.325268378325510E-004 -2.384132577610142E-004 -2.444486918376801E-004 -2.506369123079422E-004 +-2.569817869086704E-004 -2.634872812854144E-004 -2.701574614707956E-004 -2.769964964256233E-004 +-2.840086606443347E-004 -2.911983368263805E-004 -2.985700186152244E-004 -3.061283134066741E-004 +-3.138779452282857E-004 -3.218237576916554E-004 -3.299707170194321E-004 -3.383239151489446E-004 +-3.468885729143873E-004 -3.556700433095404E-004 -3.646738148330771E-004 -3.739055149185375E-004 +-3.833709134511147E-004 -3.930759263734528E-004 -4.030266193826997E-004 -4.132292117211390E-004 +-4.236900800627543E-004 -4.344157624981610E-004 -4.454129626203963E-004 -4.566885537141079E-004 +-4.682495830507758E-004 -4.801032762926324E-004 -4.922570420080427E-004 -5.047184763011618E-004 +-5.174953675587550E-004 -5.305957013171550E-004 -5.440276652523898E-004 -5.577996542965942E-004 +-5.719202758839141E-004 -5.863983553291547E-004 -6.012429413425584E-004 -6.164633116841403E-004 +-6.320689789611118E-004 -6.480696965720176E-004 -6.644754648012991E-004 -6.812965370680790E-004 +-6.985434263330791E-004 -7.162269116676690E-004 -7.343580449891395E-004 -7.529481579664222E-004 +-7.720088691005384E-004 -7.915520909842332E-004 -8.115900377452905E-004 -8.321352326782047E-004 +-8.532005160689592E-004 -8.747990532177813E-004 -8.969443426649184E-004 -9.196502246245312E-004 +-9.429308896319895E-004 -9.668008874099666E-004 -9.912751359588442E-004 -1.016368930877131E-003 +-1.042097954917690E-003 -1.068478287785743E-003 -1.095526416184772E-003 -1.123259244116567E-003 +-1.151694103441869E-003 -1.180848764708189E-003 -1.210741448251540E-003 -1.241390835579045E-003 +-1.272816081039473E-003 -1.305036823789030E-003 -1.338073200059831E-003 -1.371945855738728E-003 +-1.406675959264332E-003 -1.442285214850255E-003 -1.478795876042851E-003 -1.516230759621879E-003 +-1.554613259852765E-003 -1.593967363099375E-003 -1.634317662806338E-003 -1.675689374860352E-003 +-1.718108353339964E-003 -1.761601106663704E-003 -1.806194814146601E-003 -1.851917342975388E-003 +-1.898797265613030E-003 -1.946863877643356E-003 -1.996147216066948E-003 -2.046678078059686E-003 +-2.098488040205611E-003 -2.151609478216113E-003 -2.206075587147701E-003 -2.261920402130972E-003 +-2.319178819623677E-003 -2.377886619201081E-003 -2.438080485897257E-003 -2.499798033111154E-003 +-2.563077826091739E-003 -2.627959406016816E-003 -2.694483314680485E-003 -2.762691119804651E-003 +-2.832625440990287E-003 -2.904329976324626E-003 -2.977849529660816E-003 -3.053230038586989E-003 +-3.130518603102194E-003 -3.209763515016945E-003 -3.291014288096745E-003 -3.374321688967273E-003 +-3.459737768800410E-003 -3.547315895800912E-003 -3.637110788513778E-003 -3.729178549973105E-003 +-3.823576702713613E-003 -3.920364224666527E-003 -4.019601585962216E-003 -4.121350786662333E-003 +-4.225675395444930E-003 -4.332640589266597E-003 -4.442313194026090E-003 -4.554761726254851E-003 +-4.670056435860175E-003 -4.788269349947538E-003 -4.909474317749312E-003 -5.033747056687619E-003 +-5.161165199599980E-003 -5.291808343156936E-003 -5.425758097501686E-003 -5.563098137142474E-003 +-5.703914253129162E-003 -5.848294406546420E-003 -5.996328783356535E-003 -6.148109850625765E-003 +-6.303732414169138E-003 -6.463293677649112E-003 -6.626893303164882E-003 -6.794633473369584E-003 +-6.966618955153854E-003 -7.142957164935132E-003 -7.323758235592772E-003 -7.509135085090594E-003 +-7.699203486829029E-003 -7.894082141770205E-003 -8.093892752380615E-003 -8.298760098436702E-003 +-8.508812114740316E-003 -8.724179970791666E-003 -8.944998152468976E-003 -9.171404545765066E-003 +-9.403540522632188E-003 -9.641551028988168E-003 -9.885584674937751E-003 -1.013579382726455E-002 +-1.039233470425053E-002 -1.065536747288093E-002 -1.092505634849455E-002 -1.120156969694030E-002 +-1.148508013930248E-002 -1.177576465925931E-002 -1.207380471313981E-002 -1.237938634274690E-002 +-1.269270029101531E-002 -1.301394212057501E-002 -1.334331233529273E-002 -1.368101650486523E-002 +-1.402726539254080E-002 -1.438227508604642E-002 -1.474626713180037E-002 -1.511946867249200E-002 +-1.550211258811192E-002 -1.589443764051876E-002 -1.629668862162967E-002 -1.670911650532483E-002 +-1.713197860315758E-002 -1.756553872396456E-002 -1.801006733747233E-002 -1.846584174199927E-002 +-1.893314623635373E-002 -1.941227229603236E-002 -1.990351875382417E-002 -2.040719198492934E-002 +-2.092360609670390E-002 -2.145308312314362E-002 -2.199595322422448E-002 -2.255255489021774E-002 +-2.312323515110306E-002 -2.370834979120344E-002 -2.430826356917065E-002 -2.492335044345160E-002 +-2.555399380336952E-002 -2.620058670595733E-002 -2.686353211868313E-002 -2.754324316821126E-002 +-2.824014339534626E-002 -2.895466701630850E-002 -2.968725919049682E-002 -3.043837629489383E-002 +-3.120848620527550E-002 -3.199806858438846E-002 -3.280761517726370E-002 -3.363763011383802E-002 +-3.448863021905908E-002 -3.536114533065304E-002 -3.625571862473926E-002 -3.717290694947804E-002 +-3.811328116694433E-002 -3.907742650342264E-002 -4.006594290832277E-002 -4.107944542192165E-002 +-4.211856455213803E-002 -4.318394666055553E-002 -4.427625435790931E-002 -4.539616690925962E-002 +-4.654438064907875E-002 -4.772160940648147E-002 -4.892858494083677E-002 -5.016605738799987E-002 +-5.143479571741054E-002 -5.273558820030848E-002 -5.406924288931931E-002 -5.543658810967297E-002 +-5.683847296231786E-002 -5.827576783920127E-002 -5.974936495099070E-002 -6.126017886751497E-002 +-6.280914707121069E-002 -6.439723052386290E-002 -6.602541424693427E-002 -6.769470791578296E-002 +-6.940614646807086E-002 -7.116079072667443E-002 -7.295972803740897E-002 -7.480407292188543E-002 +-7.669496774582370E-002 -7.863358340314634E-002 -8.062112001618854E-002 -8.265880765235616E-002 +-8.474790705757344E-002 -8.688971040686472E-002 -8.908554207241295E-002 -9.133675940945142E-002 +-9.364475356033727E-002 -9.601095027716472E-002 -9.843681076327830E-002 -1.009238325340428E-001 +-1.034735502972372E-001 -1.060875368534324E-001 -1.087674040167194E-001 -1.115148035561523E-001 +-1.143314281582678E-001 -1.172190124110495E-001 -1.201793338096931E-001 -1.232142137845352E-001 +-1.263255187515009E-001 -1.295151611854186E-001 -1.327851007165525E-001 -1.361373452506919E-001 +-1.395739521131263E-001 -1.430970292168360E-001 -1.467087362552066E-001 -1.504112859195739E-001 +-1.542069451418864E-001 -1.580980363627614E-001 -1.620869388251907E-001 -1.661760898941367E-001 +-1.703679864022375E-001 -1.746651860218158E-001 -1.790703086633613E-001 -1.835860379006301E-001 +-1.882151224224672E-001 -1.929603775114339E-001 -1.978246865492747E-001 -2.028110025492214E-001 +-2.079223497150899E-001 -2.131618250270668E-001 -2.185325998540422E-001 -2.240379215922732E-001 +-2.296811153301114E-001 -2.354655855384484E-001 -2.413948177864630E-001 -2.474723804821754E-001 +-2.537019266372200E-001 -2.600871956551562E-001 -2.666320151425341E-001 -2.733403027418152E-001 +-2.802160679851412E-001 -2.872634141677971E-001 -2.944865402400877E-001 -3.018897427161930E-001 +-3.094774175983972E-001 -3.172540623149314E-001 -3.252242776694561E-001 -3.333927698000296E-001 +-3.417643521451813E-001 -3.503439474144735E-001 -3.591365895606938E-001 -3.681474257505437E-001 +-3.773817183304076E-001 -3.868448467834706E-001 -3.965423096741227E-001 -4.064797265752543E-001 +-4.166628399736285E-001 -4.270975171481409E-001 -4.377897520153515E-001 -4.487456669361574E-001 +-4.599715144770581E-001 -4.714736791188545E-001 -4.832586789051082E-001 -4.953331670220955E-001 +-5.077039333012635E-001 -5.203779056346382E-001 -5.333621512927730E-001 -5.466638781341299E-001 +-5.602904356939449E-001 -5.742493161396886E-001 -5.885481550793883E-001 -6.031947322079778E-001 +-6.181969717758451E-001 -6.335629428626217E-001 -6.493008594379871E-001 -6.654190801900982E-001 +-6.819261081008085E-001 -6.988305897454583E-001 -7.161413142935392E-001 -7.338672121848237E-001 +-7.520173534540068E-001 -7.706009456749776E-001 -7.896273314940270E-001 -8.091059857193129E-001 +-8.290465119317017E-001 -8.494586385800420E-001 -8.703522145214219E-001 -8.917372039646383E-001 +-9.136236807724841E-001 -9.360218220756904E-001 -9.589419011486532E-001 -9.823942794939543E-001 +-1.006389398079675E+000 -1.030937767670249E+000 -1.056049958188116E+000 -1.081736587040064E+000 +-1.108008306338321E+000 -1.134875788942740E+000 -1.162349713246484E+000 -1.190440746623429E+000 +-1.219159527451446E+000 -1.248516645621245E+000 -1.278522621436077E+000 -1.309187882803090E+000 +-1.340522740612328E+000 -1.372537362194844E+000 -1.405241742746414E+000 -1.438645674598624E+000 +-1.472758714214314E+000 -1.507590146779331E+000 -1.543148948258046E+000 -1.579443744775154E+000 +-1.616482769181824E+000 -1.654273814659949E+000 -1.692824185213875E+000 -1.732140642895386E+000 +-1.772229351604022E+000 -1.813095817301815E+000 -1.854744824479118E+000 -1.897180368705997E+000 +-1.940405585102878E+000 -1.984422672563450E+000 -2.029232813563646E+000 -2.074836089392387E+000 +-2.121231390642506E+000 -2.168416322805135E+000 -2.216387106816625E+000 -2.265138474415183E+000 +-2.314663558174465E+000 -2.364953776093370E+000 -2.415998710636432E+000 -2.467785982136537E+000 +-2.520301116492536E+000 -2.573527407118540E+000 -2.627445771129216E+000 -2.682034599777791E+000 +-2.737269603199404E+000 -2.793123649553989E+000 -2.849566598709223E+000 -2.906565130656050E+000 +-2.964082568907745E+000 -3.022078699197878E+000 -3.080509583864390E+000 -3.139327372386151E+000 +-3.198480108624966E+000 -3.257911535421704E+000 -3.317560897298813E+000 -3.377362742134766E+000 +-3.437246722798709E+000 -3.497137399865629E+000 -3.556954046675513E+000 -3.616610458152174E+000 +-3.676014764961200E+000 -3.735069254760133E+000 -3.793670202477827E+000 -3.851707711754598E+000 +-3.909065569878354E+000 -3.965621118765052E+000 -4.021245144753420E+000 -4.075801790211995E+000 +-4.129148490191599E+000 -4.181135937594688E+000 -4.231608080574318E+000 -4.280402156116430E+000 +-4.327348763996949E+000 -4.372271985537566E+000 -4.414989551805687E+000 -4.455313066112370E+000 +-4.493048285850980E+000 -4.527995468883971E+000 -4.559949789819850E+000 -4.588701831619567E+000 +-4.614038158025029E+000 -4.635741972303426E+000 -4.653593867741125E+000 -4.667372675191550E+000 +-4.676856412771619E+000 -4.681823342501818E+000 -4.682053138284346E+000 -4.677328169100658E+000 +-4.667434900673019E+000 -4.652165418062082E+000 -4.631319070752564E+000 -4.604704240699860E+000 +-4.572140232560480E+000 -4.533459283897804E+000 -4.488508691531225E+000 -4.437153048372119E+000 +-4.379276583056396E+000 -4.314785592433352E+000 -4.243610954499535E+000 -4.165710706671606E+000 +-4.081072671371463E+000 -3.989717107753898E+000 -3.891699365043773E+000 -3.787112509374679E+000 +-3.676089892244952E+000 -3.558807624741808E+000 -3.435486917551135E+000 -3.306396242488577E+000 +-3.171853266886182E+000 -3.032226507681965E+000 -2.887936647526053E+000 -2.739457450689569E+000 +-2.587316212099967E+000 -2.432093668506068E+000 -2.274423296692659E+000 -2.114989919933567E+000 +-1.954527540644367E+000 -1.793816314653481E+000 -1.633678580887233E+000 -1.474973859850492E+000 +-1.318592735437162E+000 -1.165449537772878E+000 -1.016473750514458E+000 -8.726000749698608E-001 +-7.347570963473823E-001 -6.038545153285990E-001 -4.807689320855421E-001 -3.663282010900124E-001 +-2.612944150345410E-001 -1.663456265122479E-001 -8.205647856564720E-002 -8.877991741091574E-003 + 5.288315206949503E-002 1.030853778072129E-001 1.417724548589676E-001 1.691924674011923E-001 + 1.858146016629774E-001 1.923426279096748E-001 1.897237189148411E-001 1.791509784390031E-001 + 1.620577497945949E-001 1.401014322419140E-001 1.151341468282651E-001 8.915715666037022E-002 + 6.425545030375676E-002 4.235655674850899E-002 2.463412529326869E-002 1.177513228287110E-002 + 3.943917392410514E-003 5.560911616415589E-004 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 + + + 6.749115800389129E-001 0.000000000000000E+000 0.000000000000000E+000 2.681987499466206E-001 + + + + + 1.588529165901082E-005 1.608510403164364E-005 1.628742973457217E-005 1.649230038160163E-005 + 1.669974798419004E-005 1.690980495645004E-005 1.712250412021369E-005 1.733787871016099E-005 + 1.755596237901280E-005 1.777678920278922E-005 1.800039368613398E-005 1.822681076770591E-005 + 1.845607582563815E-005 1.868822468306608E-005 1.892329361372477E-005 1.916131934761678E-005 + 1.940233907675137E-005 1.964639046095580E-005 1.989351163375976E-005 2.014374120835385E-005 + 2.039711828362291E-005 2.065368245025533E-005 2.091347379692926E-005 2.117653291657641E-005 + 2.144290091272493E-005 2.171261940592186E-005 2.198573054023641E-005 2.226227698984515E-005 + 2.254230196569982E-005 2.282584922227927E-005 2.311296306442607E-005 2.340368835426934E-005 + 2.369807051823450E-005 2.399615555414131E-005 2.429799003839108E-005 2.460362113324433E-005 + 2.491309659419003E-005 2.522646477740759E-005 2.554377464732240E-005 2.586507578425691E-005 + 2.619041839217741E-005 2.651985330653871E-005 2.685343200222718E-005 2.719120660160391E-005 + 2.753322988264889E-005 2.787955528720770E-005 2.823023692934195E-005 2.858532960378468E-005 + 2.894488879450220E-005 2.930897068336365E-005 2.967763215891943E-005 3.005093082529024E-005 + 3.042892501116789E-005 3.081167377892925E-005 3.119923693386494E-005 3.159167503352393E-005 + 3.198904939717597E-005 3.239142211539273E-005 3.279885605974977E-005 3.321141489265016E-005 + 3.362916307727211E-005 3.405216588764136E-005 3.448048941883048E-005 3.491420059728628E-005 + 3.535336719128748E-005 3.579805782153343E-005 3.624834197186633E-005 3.670429000012832E-005 + 3.716597314915503E-005 3.763346355790750E-005 3.810683427274398E-005 3.858615925883378E-005 + 3.907151341171437E-005 3.956297256899412E-005 4.006061352220206E-005 4.056451402878668E-005 + 4.107475282426596E-005 4.159140963452983E-005 4.211456518829770E-005 4.264430122973235E-005 + 4.318070053121286E-005 4.372384690626792E-005 4.427382522267201E-005 4.483072141570621E-005 + 4.539462250158579E-005 4.596561659105676E-005 4.654379290316343E-005 4.712924177918919E-005 + 4.772205469677249E-005 4.832232428420068E-005 4.893014433488335E-005 4.954560982200767E-005 + 5.016881691337852E-005 5.079986298644491E-005 5.143884664351543E-005 5.208586772716509E-005 + 5.274102733583636E-005 5.340442783963578E-005 5.407617289632990E-005 5.475636746754197E-005 + 5.544511783515249E-005 5.614253161790622E-005 5.684871778822796E-005 5.756378668924963E-005 + 5.828785005205225E-005 5.902102101312385E-005 5.976341413203765E-005 6.051514540935224E-005 + 6.127633230473725E-005 6.204709375532680E-005 6.282755019430369E-005 6.361782356971785E-005 + 6.441803736354086E-005 6.522831661096045E-005 6.604878791991811E-005 6.687957949089174E-005 + 6.772082113692753E-005 6.857264430392372E-005 6.943518209116963E-005 7.030856927214297E-005 + 7.119294231556850E-005 7.208843940674227E-005 7.299520046912326E-005 7.391336718619711E-005 + 7.484308302361489E-005 7.578449325161008E-005 7.673774496769773E-005 7.770298711965918E-005 + 7.868037052881564E-005 7.967004791359498E-005 8.067217391339438E-005 8.168690511274363E-005 + 8.271440006577244E-005 8.375481932098477E-005 8.480832544634577E-005 8.587508305468351E-005 + 8.695525882941070E-005 8.804902155056995E-005 8.915654212120621E-005 9.027799359407200E-005 + 9.141355119866682E-005 9.256339236861826E-005 9.372769676940704E-005 9.490664632644060E-005 + 9.610042525348003E-005 9.730922008142463E-005 9.853321968745823E-005 9.977261532456285E-005 + 1.010276006514024E-004 1.022983717625839E-004 1.035851272192976E-004 1.048880680803442E-004 + 1.062073979335512E-004 1.075433229275850E-004 1.088960518041630E-004 1.102657959306710E-004 + 1.116527693331905E-004 1.130571887299423E-004 1.144792735651499E-004 1.159192460433295E-004 + 1.173773311640109E-004 1.188537567568957E-004 1.203487535174575E-004 1.218625550429894E-004 + 1.233953978691059E-004 1.249475215067034E-004 1.265191684793860E-004 1.281105843613616E-004 + 1.297220178158152E-004 1.313537206337647E-004 1.330059477734052E-004 1.346789573999494E-004 + 1.363730109259673E-004 1.380883730522352E-004 1.398253118090980E-004 1.415840985983507E-004 + 1.433650082356483E-004 1.451683189934486E-004 1.469943126444949E-004 1.488432745058471E-004 + 1.507154934834635E-004 1.526112621173481E-004 1.545308766272620E-004 1.564746369590113E-004 + 1.584428468313175E-004 1.604358137832770E-004 1.624538492224182E-004 1.644972684733634E-004 + 1.665663908271010E-004 1.686615395908805E-004 1.707830421387325E-004 1.729312299626266E-004 + 1.751064387242708E-004 1.773090083075636E-004 1.795392828717069E-004 1.817976109049841E-004 + 1.840843452792192E-004 1.863998433049171E-004 1.887444667870996E-004 1.911185820818437E-004 + 1.935225601535302E-004 1.959567766328143E-004 1.984216118753233E-004 2.009174510210955E-004 + 2.034446840547645E-004 2.060037058665013E-004 2.085949163137254E-004 2.112187202835884E-004 + 2.138755277562467E-004 2.165657538689300E-004 2.192898189808136E-004 2.220481487387104E-004 + 2.248411741435866E-004 2.276693316179159E-004 2.305330630738806E-004 2.334328159824303E-004 + 2.363690434432109E-004 2.393422042553721E-004 2.423527629892664E-004 2.454011900590513E-004 + 2.484879617962022E-004 2.516135605239543E-004 2.547784746326773E-004 2.579831986562020E-004 + 2.612282333491037E-004 2.645140857649617E-004 2.678412693356017E-004 2.712103039513347E-004 + 2.746217160422073E-004 2.780760386602737E-004 2.815738115629020E-004 2.851155812971321E-004 + 2.887019012850911E-004 2.923333319104854E-004 2.960104406061827E-004 2.997338019428931E-004 + 3.035039977189694E-004 3.073216170513359E-004 3.111872564675619E-004 3.151015199990936E-004 + 3.190650192756587E-004 3.230783736208633E-004 3.271422101489858E-004 3.312571638629937E-004 + 3.354238777537926E-004 3.396430029007234E-004 3.439151985733270E-004 3.482411323343870E-004 + 3.526214801442716E-004 3.570569264665876E-004 3.615481643751653E-004 3.660958956623891E-004 + 3.707008309488938E-004 3.753636897946380E-004 3.800852008113810E-004 3.848661017765708E-004 + 3.897071397486692E-004 3.946090711839270E-004 3.995726620546306E-004 4.045986879688354E-004 + 4.096879342916087E-004 4.148411962677992E-004 4.200592791463502E-004 4.253429983061806E-004 + 4.306931793836486E-004 4.361106584016229E-004 4.415962819001778E-004 4.471509070689325E-004 + 4.527754018810608E-004 4.584706452289857E-004 4.642375270617835E-004 4.700769485243189E-004 + 4.759898220981310E-004 4.819770717440949E-004 4.880396330468821E-004 4.941784533612368E-004 + 5.003944919600973E-004 5.066887201845818E-004 5.130621215958652E-004 5.195156921289681E-004 + 5.260504402484814E-004 5.326673871062587E-004 5.393675667010887E-004 5.461520260403839E-004 + 5.530218253039050E-004 5.599780380095485E-004 5.670217511812229E-004 5.741540655188425E-004 + 5.813760955704620E-004 5.886889699065811E-004 5.960938312966429E-004 6.035918368877635E-004 + 6.111841583857091E-004 6.188719822381565E-004 6.266565098202630E-004 6.345389576225772E-004 + 6.425205574413181E-004 6.506025565710537E-004 6.587862179998086E-004 6.670728206066323E-004 + 6.754636593616597E-004 6.839600455286942E-004 6.925633068703435E-004 7.012747878557504E-004 + 7.100958498709329E-004 7.190278714317889E-004 7.280722483997816E-004 7.372303942003470E-004 + 7.465037400440596E-004 7.558937351505871E-004 7.654018469754724E-004 7.750295614397786E-004 + 7.847783831626288E-004 7.946498356966873E-004 8.046454617666113E-004 8.147668235105115E-004 + 8.250155027244622E-004 8.353931011101009E-004 8.459012405253535E-004 8.565415632383276E-004 + 8.673157321844120E-004 8.782254312266261E-004 8.892723654192560E-004 9.004582612748233E-004 + 9.117848670344280E-004 9.232539529415100E-004 9.348673115190682E-004 9.466267578503855E-004 + 9.585341298633053E-004 9.705912886180984E-004 9.828001185989770E-004 9.951625280092903E-004 + 1.007680449070459E-003 1.020355838324687E-003 1.033190676941511E-003 1.046186971028226E-003 + 1.059346751944234E-003 1.072672076619387E-003 1.086165027876348E-003 1.099827714757043E-003 + 1.113662272853243E-003 1.127670864641341E-003 1.141855679821359E-003 1.156218935660263E-003 + 1.170762877339627E-003 1.185489778307705E-003 1.200401940635959E-003 1.215501695380130E-003 + 1.230791402945865E-003 1.246273453459003E-003 1.261950267140548E-003 1.277824294686412E-003 + 1.293898017651969E-003 1.310173948841509E-003 1.326654632702620E-003 1.343342645725602E-003 + 1.360240596847937E-003 1.377351127863922E-003 1.394676913839494E-003 1.412220663532343E-003 + 1.429985119817365E-003 1.447973060117535E-003 1.466187296840259E-003 1.484630677819292E-003 + 1.503306086762268E-003 1.522216443703965E-003 1.541364705465313E-003 1.560753866118283E-003 + 1.580386957456686E-003 1.600267049472993E-003 1.620397250841236E-003 1.640780709406078E-003 + 1.661420612678126E-003 1.682320188335585E-003 1.703482704732310E-003 1.724911471412375E-003 + 1.746609839631206E-003 1.768581202883398E-003 1.790828997437293E-003 1.813356702876393E-003 + 1.836167842647734E-003 1.859265984617268E-003 1.882654741632391E-003 1.906337772091683E-003 + 1.930318780521966E-003 1.954601518162775E-003 1.979189783558353E-003 2.004087423157244E-003 + 2.029298331919617E-003 2.054826453932410E-003 2.080675783032391E-003 2.106850363437271E-003 + 2.133354290384927E-003 2.160191710780910E-003 2.187366823854295E-003 2.214883881822025E-003 + 2.242747190561830E-003 2.270961110293874E-003 2.299530056271213E-003 2.328458499479217E-003 + 2.357750967344054E-003 2.387412044450384E-003 2.417446373268354E-003 2.447858654890072E-003 + 2.478653649775645E-003 2.509836178508941E-003 2.541411122563195E-003 2.573383425076610E-003 + 2.605758091638078E-003 2.638540191083167E-003 2.671734856300534E-003 2.705347285048886E-003 + 2.739382740784648E-003 2.773846553500481E-003 2.808744120574842E-003 2.844080907632671E-003 + 2.879862449417439E-003 2.916094350674661E-003 2.952782287047084E-003 2.989932005981677E-003 + 3.027549327648609E-003 3.065640145872421E-003 3.104210429075494E-003 3.143266221234074E-003 + 3.182813642846971E-003 3.222858891917166E-003 3.263408244946470E-003 3.304468057943473E-003 + 3.346044767444943E-003 3.388144891550892E-003 3.430775030973515E-003 3.473941870100193E-003 + 3.517652178070783E-003 3.561912809869405E-003 3.606730707430938E-003 3.652112900762478E-003 + 3.698066509079949E-003 3.744598741960090E-003 3.791716900508123E-003 3.839428378541259E-003 + 3.887740663788321E-003 3.936661339105771E-003 3.986198083710309E-003 4.036358674428421E-003 + 4.087150986962996E-003 4.138582997177442E-003 4.190662782397439E-003 4.243398522730695E-003 + 4.296798502404968E-003 4.350871111124635E-003 4.405624845446120E-003 4.461068310172487E-003 + 4.517210219767505E-003 4.574059399789524E-003 4.631624788345443E-003 4.689915437565156E-003 + 4.748940515096783E-003 4.808709305623022E-003 4.869231212399025E-003 4.930515758812113E-003 + 4.992572589963741E-003 5.055411474274063E-003 5.119042305109477E-003 5.183475102433573E-003 + 5.248720014481912E-003 5.314787319460987E-003 5.381687427271826E-003 5.449430881258691E-003 + 5.518028359983281E-003 5.587490679024933E-003 5.657828792807236E-003 5.729053796451602E-003 + 5.801176927658225E-003 5.874209568614983E-003 5.948163247934728E-003 6.023049642621564E-003 + 6.098880580066623E-003 6.175668040073841E-003 6.253424156916410E-003 6.332161221424409E-003 + 6.411891683104199E-003 6.492628152290287E-003 6.574383402330132E-003 6.657170371802731E-003 + 6.741002166771474E-003 6.825892063072034E-003 6.911853508636005E-003 6.998900125850900E-003 + 7.087045713957378E-003 7.176304251484370E-003 7.266689898722872E-003 7.358217000239269E-003 + 7.450900087428897E-003 7.544753881110831E-003 7.639793294164633E-003 7.736033434210024E-003 + 7.833489606330329E-003 7.932177315840698E-003 8.032112271102045E-003 8.133310386381671E-003 + 8.235787784761634E-003 8.339560801095909E-003 8.444645985017369E-003 8.551060103995754E-003 + 8.658820146447808E-003 8.767943324900654E-003 8.878447079209701E-003 8.990349079832326E-003 + 9.103667231158614E-003 9.218419674900464E-003 9.334624793540428E-003 9.452301213841779E-003 + 9.571467810421093E-003 9.692143709385009E-003 9.814348292032598E-003 9.938101198625007E-003 + 1.006342233222396E-002 1.019033186260083E-002 1.031885023021802E-002 1.044899815028452E-002 + 1.058079661688733E-002 1.071426690720092E-002 1.084943058577639E-002 1.098630950891267E-002 + 1.112492582911163E-002 1.126530199961949E-002 1.140746077905657E-002 1.155142523613781E-002 + 1.169721875448643E-002 1.184486503754327E-002 1.199438811357422E-002 1.214581234077847E-002 + 1.229916241250035E-002 1.245446336254743E-002 1.261174057061796E-002 1.277101976784053E-002 + 1.293232704242915E-002 1.309568884545689E-002 1.326113199675144E-002 1.342868369091604E-002 + 1.359837150347929E-002 1.377022339717756E-002 1.394426772837375E-002 1.412053325361650E-002 + 1.429904913634355E-002 1.447984495373387E-002 1.466295070371267E-002 1.484839681211385E-002 + 1.503621414000465E-002 1.522643399117707E-002 1.541908811981144E-002 1.561420873831690E-002 + 1.581182852535450E-002 1.601198063404821E-002 1.621469870038971E-002 1.642001685184291E-002 + 1.662796971615423E-002 1.683859243037519E-002 1.705192065010381E-002 1.726799055895172E-002 + 1.748683887824392E-002 1.770850287695881E-002 1.793302038191582E-002 1.816042978821874E-002 + 1.839077006996282E-002 1.862408079121403E-002 1.886040211726949E-002 1.909977482620794E-002 + 1.934224032073988E-002 1.958784064036700E-002 1.983661847386117E-002 2.008861717207336E-002 + 2.034388076108364E-002 2.060245395570321E-002 2.086438217334059E-002 2.112971154824390E-002 + 2.139848894613183E-002 2.167076197922651E-002 2.194657902170178E-002 2.222598922556104E-002 + 2.250904253695920E-002 2.279578971298392E-002 2.308628233891193E-002 2.338057284595673E-002 + 2.367871452952463E-002 2.398076156799675E-002 2.428676904205517E-002 2.459679295457235E-002 + 2.491089025108317E-002 2.522911884086053E-002 2.555153761861524E-002 2.587820648684238E-002 + 2.620918637883717E-002 2.654453928240392E-002 2.688432826428277E-002 2.722861749531975E-002 + 2.757747227640692E-002 2.793095906522004E-002 2.828914550378255E-002 2.865210044688568E-002 + 2.901989399139573E-002 2.939259750648041E-002 2.977028366478785E-002 3.015302647461306E-002 + 3.054090131308787E-002 3.093398496043154E-002 3.133235563530165E-002 3.173609303128478E-002 + 3.214527835457003E-002 3.255999436284841E-002 3.298032540548383E-002 3.340635746500287E-002 + 3.383817819995216E-002 3.427587698917476E-002 3.471954497755828E-002 3.516927512331000E-002 + 3.562516224681624E-002 3.608730308114531E-002 3.655579632425633E-002 3.703074269297810E-002 + 3.751224497882487E-002 3.800040810571872E-002 3.849533918969075E-002 3.899714760063636E-002 + 3.950594502620294E-002 4.002184553789078E-002 4.054496565945242E-002 4.107542443767773E-002 + 4.161334351565634E-002 4.215884720861259E-002 4.271206258241132E-002 4.327311953483778E-002 + 4.384215087975776E-002 4.441929243426975E-002 4.500468310896374E-002 4.559846500140734E-002 + 4.620078349298348E-002 4.681178734920947E-002 4.743162882367243E-002 4.806046376572067E-002 + 4.869845173205725E-002 4.934575610238687E-002 5.000254419927290E-002 5.066898741236842E-002 + 5.134526132719069E-002 5.203154585861577E-002 5.272802538927680E-002 5.343488891305462E-002 + 5.415233018386047E-002 5.488054786991462E-002 5.561974571373342E-002 5.637013269804769E-002 + 5.713192321787967E-002 5.790533725901802E-002 5.869060058313692E-002 5.948794491981513E-002 + 6.029760816572110E-002 6.111983459123801E-002 6.195487505481420E-002 6.280298722533377E-002 + 6.366443581281241E-002 6.453949280773520E-002 6.542843772936223E-002 6.633155788334029E-002 + 6.724914862896936E-002 6.818151365648449E-002 6.912896527472563E-002 7.009182470957727E-002 + 7.107042241357520E-002 7.206509838708554E-002 7.307620251147579E-002 7.410409489470854E-002 + 7.514914622979774E-002 7.621173816658353E-002 7.729226369728727E-002 7.839112755632256E-002 + 7.950874663484810E-002 8.064555041055484E-002 8.180198139319281E-002 8.297849558634772E-002 + 8.417556296598543E-002 8.539366797628918E-002 8.663331004331666E-002 8.789500410700926E-002 + 8.917928117208242E-002 9.048668887832935E-002 9.181779209086323E-002 9.317317351081539E-002 + 9.455343430700160E-002 9.595919476904721E-002 9.739109498245070E-002 9.884979552603931E-002 + 1.003359781922411E-001 1.018503467305673E-001 1.033936276146549E-001 1.049665708331725E-001 + 1.065699507048367E-001 1.082045667177188E-001 1.098712443929483E-001 1.115708361728288E-001 + 1.133042223332832E-001 1.150723119204342E-001 1.168760437109878E-001 1.187163871959503E-001 + 1.205943435870358E-001 1.225109468449371E-001 1.244672647284223E-001 1.264643998629819E-001 + 1.285034908274922E-001 1.305857132570591E-001 1.327122809598846E-001 1.348844470456321E-001 + 1.371035050623572E-001 1.393707901386296E-001 1.416876801269654E-001 1.440555967441484E-001 + 1.464760067034094E-001 1.489504228327623E-001 1.514804051730706E-001 1.540675620486026E-001 + 1.567135511019550E-001 1.594200802842598E-001 1.621889087905253E-001 1.650218479288173E-001 + 1.679207619107228E-001 1.708875685491768E-001 1.739242398482532E-001 1.770328024679073E-001 + 1.802153380449329E-001 1.834739833495163E-001 1.868109302547606E-001 1.902284254943944E-001 + 1.937287701815613E-001 1.973143190591231E-001 2.009874794492807E-001 2.047507098675329E-001 + 2.086065182630612E-001 2.125574598445265E-001 2.166061344470464E-001 2.207551833927419E-001 + 2.250072857937791E-001 2.293651542432474E-001 2.338315298355891E-001 2.384091764546271E-001 + 2.431008742635857E-001 2.479094123279243E-001 2.528375802983519E-001 2.578881590781559E-001 + 2.630639103960439E-001 2.683675652031689E-001 2.738018108110112E-001 2.793692766854718E-001 + 2.850725188120368E-001 2.909140025474080E-001 2.968960838747436E-001 3.030209889828561E-001 + 3.092907920946371E-001 3.157073914768611E-001 3.222724835727047E-001 3.289875352101008E-001 + 3.358537538537729E-001 3.428720558868242E-001 3.500430329294393E-001 3.573669162279834E-001 + 3.648435391778648E-001 3.724722980783504E-001 3.802521112573288E-001 3.881813767490903E-001 + 3.962579287586712E-001 4.044789932022479E-001 4.128411426744247E-001 4.213402512597623E-001 + 4.299714496771207E-001 4.387290813206923E-001 4.476066598399679E-001 4.565968289811138E-001 + 4.656913254926538E-001 4.748809459769732E-001 4.841555186435170E-001 4.935038809867748E-001 + 5.029138644689165E-001 5.123722873294058E-001 5.218649566679666E-001 5.313766809482996E-001 + 5.408912940430808E-001 5.503916918811030E-001 5.598598826598388E-001 5.692770514465103E-001 + 5.786236398034933E-001 5.878794408359337E-001 5.970237097682299E-001 6.060352898101882E-001 + 6.148927526738127E-001 6.235745526504718E-001 6.320591926606709E-001 6.403254001531565E-001 + 6.483523101676865E-001 6.561196523015754E-001 6.636079377527033E-001 6.707986420737744E-001 + 6.776743787912428E-001 6.842190586487578E-001 6.904180289652696E-001 6.962581874930431E-001 + 7.017280652671564E-001 7.068178733086412E-001 7.115195087385942E-001 7.158265169505379E-001 + 7.197340080549429E-001 7.232385279502981E-001 7.263378872058027E-001 7.290309546013406E-001 + 7.313174268294337E-001 7.331975917228782E-001 7.346721096699950E-001 7.357418468966542E-001 + 7.364078053523058E-001 7.366712001205062E-001 7.365336531300881E-001 7.359972616161919E-001 + 7.350646016162605E-001 7.337387252635462E-001 7.320231569827874E-001 7.299218885969601E-001 + 7.274393733587045E-001 7.245805189244857E-001 7.213506792937806E-001 7.177556457395435E-001 + 7.138016367599475E-001 7.094952870847986E-001 7.048436357732473E-001 6.998541134422532E-001 + 6.945345286679207E-001 6.888930536041369E-001 6.829382088649658E-001 6.766788477190460E-001 + 6.701241396457004E-001 6.632835533036831E-001 6.561668389644452E-001 6.487840104624525E-001 + 6.411453267155719E-001 6.332612728686871E-001 6.251425411137189E-001 6.168000112389631E-001 + 6.082447309602020E-001 5.994878960854659E-001 5.905408305644568E-001 5.814149664727547E-001 + 5.721218239798104E-001 5.626729913485116E-001 5.530801050128057E-001 5.433548297784722E-001 + 5.335088391904511E-001 5.235537961090977E-001 5.135013335354446E-001 5.033630357244393E-001 + 4.931504196232514E-001 4.828749166701086E-001 4.725478549874551E-001 4.621804420015295E-001 + 4.517837475188348E-001 4.413686872883016E-001 4.309460070763507E-001 4.205262672804651E-001 + 4.101198281053169E-001 3.997368353239816E-001 3.893872066452604E-001 3.790806187066820E-001 + 3.688264947113148E-001 3.586339927251102E-001 3.485119946501274E-001 3.384690958876178E-001 + 3.285135957036090E-001 3.186534883083033E-001 3.088964546592616E-001 2.992498549970498E-001 + 2.897207221206751E-001 2.803157554088234E-001 2.710413155915648E-001 2.619034202758264E-001 + 2.529077402265608E-001 2.440595964041316E-001 2.353639577570055E-001 2.268254397673898E-001 + 2.184483037459554E-001 2.102364568702774E-001 2.021934529600691E-001 1.943224939807120E-001 + 1.866264322649802E-001 1.791077734412255E-001 1.717686800546473E-001 1.646109758666012E-001 + 1.576361508152328E-001 1.508453666190459E-001 1.442394630033393E-001 1.378189645277900E-001 + 1.315840879918216E-001 1.255347503927814E-001 1.196705774103887E-001 1.139909123893872E-001 + 1.084948257908776E-001 1.031811250814147E-001 9.804836502763829E-002 9.309485836299414E-002 + 8.831868679197147E-002 8.371771229628611E-002 7.928958870654039E-002 7.503177350213859E-002 + 7.094153980161332E-002 6.701598850504237E-002 6.325206054991552E-002 5.964654924164186E-002 + 5.619611261989008E-002 5.289728582211954E-002 4.974649340599153E-002 4.674006159286147E-002 + 4.387423039522645E-002 4.114516559185161E-002 3.854897051531502E-002 3.608169761788820E-002 + 3.373935978300986E-002 3.151794135109916E-002 2.941340883009200E-002 2.742172126285428E-002 + 2.553884022552387E-002 2.376073943284547E-002 2.208341392867616E-002 2.050288884204493E-002 + 1.901522769142856E-002 1.761654022224722E-002 1.630298976497101E-002 1.507080010364494E-002 + 1.391626184707343E-002 1.283573829733650E-002 1.182567081272356E-002 1.088258366455324E-002 + 1.000308838968117E-002 9.183887642768500E-003 8.421778554577857E-003 7.713655604666343E-003 + 7.056513018845533E-003 6.447446703662645E-003 5.883655731916885E-003 5.362443394849369E-003 + 4.881217838126296E-003 4.437492300067055E-003 4.028884971745255E-003 3.653118499608320E-003 + 3.308019152116994E-003 2.991515672598816E-003 2.701637841040463E-003 2.436514767912972E-003 + 2.194372943335833E-003 1.973534064943884E-003 1.772412667730752E-003 1.589513578910996E-003 + 1.423429220477136E-003 1.272836781636439E-003 1.136495282704425E-003 1.013242551317782E-003 + 9.019921310190163E-004 8.017301413695556E-004 7.115121077783850E-004 6.304597782008045E-004 + 5.577579427779516E-004 4.926512713635611E-004 4.344411827309878E-004 3.824827580816849E-004 + 3.361817102962881E-004 2.949914191911462E-004 2.584100418758076E-004 2.259777061592516E-004 + 1.972737938325041E-004 1.719143195698943E-004 1.495494101470335E-004 1.298608876762683E-004 + 1.125599596146904E-004 9.738501740981253E-005 8.409954481679814E-005 7.249013615070973E-005 + 6.236462403594673E-005 5.355031555977357E-005 4.589233517116013E-005 3.925207214500177E-005 + 3.350572998058010E-005 2.854297471249878E-005 2.426567878080439E-005 2.058675683233549E-005 + 1.742908960473579E-005 1.472453187492391E-005 1.241300033177604E-005 1.044163715475333E-005 + 8.764045043335358E-006 7.339589439673769E-006 6.132763720356013E-006 5.112613193217919E-006 + 4.252213821007427E-006 3.528222380305141E-006 2.920616041294306E-006 2.411906776373607E-006 + 1.987014872013707E-006 1.632988459009587E-006 1.338730613959724E-006 1.094757357181618E-006 + 8.929836245874746E-007 7.265344921001121E-007 5.895791278288569E-007 4.771851382682925E-007 + 3.851911592308438E-007 3.100957192546507E-007 2.489605721848046E-007 1.993268560094532E-007 + 1.591425864889990E-007 1.267001364269900E-007 1.005824844970287E-007 7.961714137129975E-008 + 6.283677560884652E-008 4.944566751216675E-008 3.879121627006786E-008 3.033981442931589E-008 + 2.365648448215618E-008 1.838774551331859E-008 1.424724384992783E-008 1.100374094936707E-008 + 8.471104801663469E-009 6.499998375045360E-009 4.971000553000014E-009 3.788932046557330E-009 + 2.878191351444311E-009 2.178934374203365E-009 1.643956272901467E-009 1.236155723981352E-009 + 9.264805921802551E-010 6.922701779305991E-010 5.159231572545170E-010 3.838323039321710E-010 + 2.855373667464862E-010 2.116093609559551E-010 1.562199673285571E-010 1.148806629640611E-010 + 8.414818733147046E-011 6.139153448278705E-011 4.460836270686672E-011 3.228093117107701E-011 + 2.326351994595866E-011 1.669482034103586E-011 1.193004500600970E-011 8.488543852452095E-012 + 6.013558967365646E-012 4.241440692241636E-012 2.978204778620418E-012 2.081759850248197E-012 + 1.448494631977936E-012 1.003201806536586E-012 6.915435323151619E-013 4.744439091836144E-013 + 3.239353683141249E-013 2.200967768432197E-013 1.488072766359538E-013 1.001066298347484E-013 + 6.700425371936056E-014 4.461851391802407E-014 2.955786119549046E-014 1.947815052667691E-014 + 1.276763660589752E-014 8.324004480768487E-015 5.397388030762797E-015 3.480444392961142E-015 + 2.231800039612262E-015 1.423032466552632E-015 9.021574095936393E-016 5.686256742348749E-016 + 3.562997322729821E-016 2.219306418024968E-016 1.374039553923409E-016 8.455288574211672E-017 + 5.170963769977019E-017 3.142639924105276E-017 1.897857507863960E-017 1.138790362505613E-017 + 6.788910480721983E-018 4.020656525520265E-018 2.365366746570649E-018 1.382191432528311E-018 + 8.021751803439640E-019 4.623429209424552E-019 2.646155466148649E-019 1.503780192723965E-019 + 8.484621071494828E-020 4.752480772711412E-020 2.642459606940622E-020 1.458331185767110E-020 + 7.987723532141401E-021 4.341778552548209E-021 2.341791918238171E-021 1.253206411695263E-021 + 6.653462819271870E-022 3.504130662200751E-022 1.830527869760250E-022 9.483996986362925E-023 + 4.872820686196173E-023 2.482548833174067E-023 1.253999401982792E-023 6.279603886173609E-024 + 3.117132073469060E-024 1.533621681525724E-024 7.477782031401515E-025 3.613014660818033E-025 + 1.729653942735454E-025 8.203343231630381E-026 3.854017342124809E-026 1.793394687391563E-026 + 8.264663755132737E-027 3.771452133028719E-027 1.704011219210066E-027 7.621885175062694E-028 + 3.374608807858094E-028 1.478767303460541E-028 6.412615495653270E-029 2.751518234516415E-029 + 1.168028887750573E-029 4.904787514876242E-030 2.037102732491102E-030 8.367037856743614E-031 + 3.398097214233594E-031 1.364405796775704E-031 5.415426407443244E-032 2.124418022042571E-032 + 8.235720283488727E-033 3.154661482704268E-033 1.193790067153356E-033 4.462321068436429E-034 + 1.647343338101190E-034 6.005232710715924E-035 2.161369733443872E-035 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 + + + 1.577903055421536E-009 1.617847861414176E-009 1.658803874983275E-009 1.700796694970694E-009 + 1.743852568255793E-009 1.787998406160837E-009 1.833261801271459E-009 1.879671044682913E-009 + 1.927255143682936E-009 1.976043839882247E-009 2.026067627804019E-009 2.077357773943944E-009 + 2.129946336312821E-009 2.183866184473845E-009 2.239151020087163E-009 2.295835397974495E-009 + 2.353954747717039E-009 2.413545395800098E-009 2.474644588318326E-009 2.537290514255736E-009 + 2.601522329355068E-009 2.667380180591398E-009 2.734905231265310E-009 2.804139686731286E-009 + 2.875126820777438E-009 2.947911002673022E-009 3.022537724900687E-009 3.099053631590740E-009 + 3.177506547675259E-009 3.257945508780235E-009 3.340420791874424E-009 3.424983946694083E-009 + 3.511687827963241E-009 3.600586628429621E-009 3.691735912736865E-009 3.785192652154245E-009 + 3.881015260185565E-009 3.979263629079487E-009 4.079999167264154E-009 4.183284837729446E-009 + 4.289185197380886E-009 4.397766437389812E-009 4.509096424565024E-009 4.623244743771733E-009 + 4.740282741424374E-009 4.860283570080425E-009 4.983322234163139E-009 5.109475636841748E-009 + 5.238822628098439E-009 5.371444054012177E-009 5.507422807290104E-009 5.646843879078202E-009 + 5.789794412083506E-009 5.936363755041128E-009 6.086643518560138E-009 6.240727632383148E-009 + 6.398712404095485E-009 6.560696579320536E-009 6.726781403438979E-009 6.897070684870464E-009 + 7.071670859957205E-009 7.250691059490183E-009 7.434243176919430E-009 7.622441938291058E-009 + 7.815404973954807E-009 8.013252892086790E-009 8.216109354073547E-009 8.424101151804413E-009 + 8.637358286920597E-009 8.856014052070415E-009 9.080205114221523E-009 9.310071600082209E-009 + 9.545757183685151E-009 9.787409176188355E-009 1.003517861794939E-008 1.028922037293055E-008 + 1.054969322549386E-008 1.081675997964640E-008 1.109058756079819E-008 1.137134712009591E-008 + 1.165921414139799E-008 1.195436855095768E-008 1.225699482988277E-008 1.256728212944237E-008 + 1.288542438929253E-008 1.321162045869477E-008 1.354607422080343E-008 1.388899472009917E-008 + 1.424059629304863E-008 1.460109870207163E-008 1.497072727289983E-008 1.534971303541262E-008 + 1.573829286803829E-008 1.613670964581069E-008 1.654521239217412E-008 1.696405643463094E-008 + 1.739350356432958E-008 1.783382219969255E-008 1.828528755418657E-008 1.874818180834001E-008 + 1.922279428611478E-008 1.970942163574318E-008 2.020836801514278E-008 2.071994528202484E-008 + 2.124447318881559E-008 2.178227958251177E-008 2.233370060959573E-008 2.289908092613771E-008 + 2.347877391321721E-008 2.407314189779758E-008 2.468255637919204E-008 2.530739826126277E-008 + 2.594805809049827E-008 2.660493630011744E-008 2.727844346035337E-008 2.796900053507301E-008 + 2.867703914489320E-008 2.940300183695751E-008 3.014734236154256E-008 3.091052595566656E-008 + 3.169302963387753E-008 3.249534248640282E-008 3.331796598484630E-008 3.416141429562430E-008 + 3.502621460133627E-008 3.591290743027087E-008 3.682204699425373E-008 3.775420153504764E-008 + 3.870995367952201E-008 3.968990080381356E-008 4.069465540670558E-008 4.172484549245946E-008 + 4.278111496333765E-008 4.386412402206329E-008 4.497454958446833E-008 4.611308570258756E-008 + 4.728044399846358E-008 4.847735410893351E-008 4.970456414167553E-008 5.096284114280043E-008 + 5.225297157627982E-008 5.357576181551155E-008 5.493203864732908E-008 5.632264978876980E-008 + 5.774846441692554E-008 5.921037371220609E-008 6.070929141535558E-008 6.224615439856986E-008 + 6.382192325107179E-008 6.543758287951015E-008 6.709414312355809E-008 6.879263938709525E-008 + 7.053413328536828E-008 7.231971330853470E-008 7.415049550200377E-008 7.602762416400101E-008 + 7.795227256079087E-008 7.992564366000582E-008 8.194897088253985E-008 8.402351887347576E-008 + 8.615058429252851E-008 8.833149662449938E-008 9.056761901024631E-008 9.286034909869046E-008 + 9.521111992039143E-008 9.762140078323660E-008 1.000926981908062E-007 1.026265567839853E-007 + 1.052245603064139E-007 1.078883325943771E-007 1.106195385917543E-007 1.134198853906621E-007 + 1.162911232984409E-007 1.192350469316529E-007 1.222534963377745E-007 1.253483581452833E-007 + 1.285215667428618E-007 1.317751054884510E-007 1.351110079489118E-007 1.385313591710692E-007 + 1.420382969849316E-007 1.456340133399026E-007 1.493207556748182E-007 1.531008283226666E-007 + 1.569765939508701E-007 1.609504750380248E-007 1.650249553880274E-007 1.692025816825296E-007 + 1.734859650726949E-007 1.778777828112490E-007 1.823807799258471E-007 1.869977709348020E-007 + 1.917316416062458E-007 1.965853507618254E-007 2.015619321260580E-007 2.066644962225039E-007 + 2.118962323179396E-007 2.172604104157495E-007 2.227603832997785E-007 2.283995886299272E-007 + 2.341815510907943E-007 2.401098845947152E-007 2.461882945405670E-007 2.524205801297580E-007 + 2.588106367408456E-007 2.653624583642667E-007 2.720801400987067E-007 2.789678807106584E-007 + 2.860299852587817E-007 2.932708677846970E-007 3.006950540718946E-007 3.083071844744881E-007 + 3.161120168175764E-007 3.241144293710283E-007 3.323194238985507E-007 3.407321287839395E-007 + 3.493578022364769E-007 3.582018355774689E-007 3.672697566099831E-007 3.765672330738929E-007 + 3.861000761883820E-007 3.958742442841320E-007 4.058958465274558E-007 4.161711467387088E-007 + 4.267065673073612E-007 4.375086932061814E-007 4.485842761070398E-007 4.599402386009002E-007 + 4.715836785246438E-007 4.835218733974251E-007 4.957622849693308E-007 5.083125638851949E-007 + 5.211805544664711E-007 5.343742996141612E-007 5.479020458358604E-007 5.617722484000587E-007 + 5.759935766209310E-007 5.905749192769005E-007 6.055253901663810E-007 6.208543338041589E-007 + 6.365713312619758E-007 6.526862061569727E-007 6.692090307917207E-007 6.861501324496947E-007 + 7.035200998501091E-007 7.213297897661621E-007 7.395903338108175E-007 7.583131453943663E-007 + 7.775099268581208E-007 7.971926767886955E-007 8.173736975174457E-007 8.380656028097557E-007 + 8.592813257489801E-007 8.810341268199626E-007 9.033376021971907E-007 9.262056922427598E-007 + 9.496526902194645E-007 9.736932512244572E-007 9.983424013490631E-007 1.023615547070470E-006 + 1.049528484881168E-006 1.076097411162156E-006 1.103338932306086E-006 1.131270075096672E-006 + 1.159908297350844E-006 1.189271498830320E-006 1.219378032429384E-006 1.250246715645887E-006 + 1.281896842342634E-006 1.314348194806500E-006 1.347621056112825E-006 1.381736222802804E-006 + 1.416715017881802E-006 1.452579304146712E-006 1.489351497850699E-006 1.527054582713853E-006 + 1.565712124288515E-006 1.605348284688257E-006 1.645987837689719E-006 1.687656184216742E-006 + 1.730379368216473E-006 1.774184092937363E-006 1.819097737619240E-006 1.865148374605872E-006 + 1.912364786890735E-006 1.960776486106934E-006 2.010413730972527E-006 2.061307546202790E-006 + 2.113489741901222E-006 2.166992933441429E-006 2.221850561852302E-006 2.278096914719230E-006 + 2.335767147614404E-006 2.394897306069632E-006 2.455524348105354E-006 2.517686167329985E-006 + 2.581421616623985E-006 2.646770532423468E-006 2.713773759618541E-006 2.782473177081912E-006 + 2.852911723843736E-006 2.925133425929059E-006 2.999183423874604E-006 3.075108000942139E-006 + 3.152954612046029E-006 3.232771913413050E-006 3.314609792993029E-006 3.398519401639266E-006 + 3.484553185078275E-006 3.572764916688799E-006 3.663209731110573E-006 3.755944158703871E-006 + 3.851026160881318E-006 3.948515166334119E-006 4.048472108175281E-006 4.150959462023063E-006 + 4.256041285048475E-006 4.363783256011173E-006 4.474252716308832E-006 4.587518712065608E-006 + 4.703652037285994E-006 4.822725278101051E-006 4.944812858134676E-006 5.069991085018197E-006 + 5.198338198082431E-006 5.329934417256988E-006 5.464861993207333E-006 5.603205258740995E-006 + 5.745050681515017E-006 5.890486918077606E-006 6.039604869277683E-006 6.192497737077054E-006 + 6.349261082800642E-006 6.509992886861188E-006 6.674793609995744E-006 6.843766256052212E-006 + 7.017016436365184E-006 7.194652435761303E-006 7.376785280235343E-006 7.563528806339356E-006 + 7.754999732328222E-006 7.951317731106025E-006 8.152605505018859E-006 8.358988862540824E-006 + 8.570596796901051E-006 8.787561566700978E-006 9.010018778572141E-006 9.238107471926210E-006 + 9.471970205850160E-006 9.711753148200947E-006 9.957606166955226E-006 1.020968292387131E-005 + 1.046814097052181E-005 1.073314184675699E-005 1.100485118166029E-005 1.128343879705924E-005 + 1.156907881365615E-005 1.186194975984520E-005 1.216223468328374E-005 1.247012126528744E-005 + 1.278580193812088E-005 1.310947400525680E-005 1.344133976467912E-005 1.378160663530684E-005 + 1.413048728661760E-005 1.448819977155200E-005 1.485496766278179E-005 1.523102019242685E-005 + 1.561659239530833E-005 1.601192525582744E-005 1.641726585856167E-005 1.683286754267221E-005 + 1.725899006021952E-005 1.769589973848545E-005 1.814386964640358E-005 1.860317976520160E-005 + 1.907411716336224E-005 1.955697617601225E-005 2.005205858885126E-005 2.055967382673527E-005 + 2.108013914703300E-005 2.161377983787526E-005 2.216092942142153E-005 2.272192986227055E-005 + 2.329713178114507E-005 2.388689467398413E-005 2.449158713657985E-005 2.511158709489865E-005 + 2.574728204123101E-005 2.639906927631719E-005 2.706735615759973E-005 2.775256035375827E-005 + 2.845511010568492E-005 2.917544449406379E-005 2.991401371372125E-005 3.067127935491815E-005 + 3.144771469176010E-005 3.224380497790505E-005 3.306004774975342E-005 3.389695313730970E-005 + 3.475504418290950E-005 3.563485716801110E-005 3.653694194825533E-005 3.746186229700293E-005 + 3.841019625756378E-005 3.938253650433762E-005 4.037949071309196E-005 4.140168194060764E-005 + 4.244974901392968E-005 4.352434692946543E-005 4.462614726217957E-005 4.575583858514106E-005 + 4.691412689968350E-005 4.810173607644779E-005 4.931940830758154E-005 5.056790457037773E-005 + 5.184800510264155E-005 5.316050989008167E-005 5.450623916603059E-005 5.588603392380470E-005 + 5.730075644202422E-005 5.875129082322058E-005 6.023854354606610E-005 6.176344403157156E-005 + 6.332694522360339E-005 6.493002418408338E-005 6.657368270324081E-005 6.825894792529815E-005 + 6.998687298998018E-005 7.175853769024546E-005 7.357504914665102E-005 7.543754249876980E-005 + 7.734718161409153E-005 7.930515981484922E-005 8.131270062322316E-005 8.337105852538727E-005 + 8.548151975487334E-005 8.764540309574075E-005 8.986406070605191E-005 9.213887896216646E-005 + 9.447127932437930E-005 9.686271922444161E-005 9.931469297551652E-005 1.018287327051375E-004 + 1.044064093117478E-004 1.070493334454173E-004 1.097591565133470E-004 1.125375717107858E-004 + 1.153863150780016E-004 1.183071665839641E-004 1.213019512374115E-004 1.243725402259947E-004 + 1.275208520842038E-004 1.307488538908062E-004 1.340585624965380E-004 1.374520457828120E-004 + 1.409314239522259E-004 1.444988708516698E-004 1.481566153288573E-004 1.519069426231201E-004 + 1.557521957913326E-004 1.596947771698489E-004 1.637371498733600E-004 1.678818393316040E-004 + 1.721314348648793E-004 1.764885912993399E-004 1.809560306230749E-004 1.855365436839975E-004 + 1.902329919305986E-004 1.950483091966415E-004 1.999855035309047E-004 2.050476590731081E-004 + 2.102379379771807E-004 2.155595823830653E-004 2.210159164382775E-004 2.266103483704721E-004 + 2.323463726123002E-004 2.382275719798691E-004 2.442576199061544E-004 2.504402827307451E-004 + 2.567794220473374E-004 2.632789971104261E-004 2.699430673026828E-004 2.767757946645448E-004 + 2.837814464875744E-004 2.909643979731923E-004 2.983291349584221E-004 3.058802567103329E-004 + 3.136224787908972E-004 3.215606359940348E-004 3.296996853566474E-004 3.380447092455074E-004 + 3.466009185218915E-004 3.553736557859145E-004 3.643683987025558E-004 3.735907634114270E-004 + 3.830465080223739E-004 3.927415361990644E-004 4.026819008327601E-004 4.128738078085302E-004 + 4.233236198662182E-004 4.340378605585305E-004 4.450232183086713E-004 4.562865505700129E-004 + 4.678348880903487E-004 4.796754392833414E-004 4.918155947098366E-004 5.042629316717857E-004 + 5.170252189215868E-004 5.301104214897180E-004 5.435267056336109E-004 5.572824439107844E-004 + 5.713862203793311E-004 5.858468359289286E-004 6.006733137456163E-004 6.158749049136681E-004 + 6.314610941579671E-004 6.474416057303668E-004 6.638264094436211E-004 6.806257268565415E-004 + 6.978500376141252E-004 7.155100859465097E-004 7.336168873306692E-004 7.521817353189044E-004 + 7.712162085382300E-004 7.907321778649051E-004 8.107418137784237E-004 8.312575938993972E-004 + 8.522923107158791E-004 8.738590795027659E-004 8.959713464390429E-004 9.186428969277458E-004 + 9.418878641236229E-004 9.657207376736167E-004 9.901563726753861E-004 1.015209998859228E-003 + 1.040897229998879E-003 1.067234073556809E-003 1.094236940569759E-003 1.121922655780385E-003 + 1.150308468021046E-003 1.179412060855886E-003 1.209251563487516E-003 1.239845561934749E-003 + 1.271213110487996E-003 1.303373743449076E-003 1.336347487162345E-003 1.370154872344237E-003 + 1.404816946718443E-003 1.440355287964135E-003 1.476792016984818E-003 1.514149811505554E-003 + 1.552451920006485E-003 1.591722176000761E-003 1.631985012665172E-003 1.673265477831969E-003 + 1.715589249350538E-003 1.758982650827794E-003 1.803472667756371E-003 1.849086964039880E-003 + 1.895853898924691E-003 1.943802544347971E-003 1.992962702711819E-003 2.043364925093693E-003 + 2.095040529903396E-003 2.148021621997245E-003 2.202341112260197E-003 2.258032737666976E-003 + 2.315131081833460E-003 2.373671596069855E-003 2.433690620947388E-003 2.495225408390566E-003 + 2.558314144307208E-003 2.622995971768838E-003 2.689311014754143E-003 2.757300402468581E-003 + 2.827006294253453E-003 2.898471905098001E-003 2.971741531768400E-003 3.046860579567800E-003 + 3.123875589741788E-003 3.202834267544053E-003 3.283785510977154E-003 3.366779440223780E-003 + 3.451867427783997E-003 3.539102129334416E-003 3.628537515325447E-003 3.720228903333114E-003 + 3.814232991182209E-003 3.910607890857928E-003 4.009413163223342E-003 4.110709853560442E-003 + 4.214560527952781E-003 4.321029310528057E-003 4.430181921579271E-003 4.542085716583446E-003 + 4.656809726137186E-003 4.774424696828639E-003 4.895003133065816E-003 5.018619339881431E-003 + 5.145349466734828E-003 5.275271552331781E-003 5.408465570483348E-003 5.545013477025172E-003 + 5.684999257818952E-003 5.828508977858155E-003 5.975630831500194E-003 6.126455193847701E-003 + 6.281074673301744E-003 6.439584165310056E-003 6.602080907333675E-003 6.768664535055601E-003 + 6.939437139855249E-003 7.114503327572816E-003 7.293970278587789E-003 7.477947809236011E-003 + 7.666548434589950E-003 7.859887432626925E-003 8.058082909810190E-003 8.261255868107862E-003 + 8.469530273474852E-003 8.683033125822888E-003 8.901894530503865E-003 9.126247771331699E-003 + 9.356229385167928E-003 9.591979238096083E-003 9.833640603209971E-003 1.008136024004053E-002 + 1.033528847564633E-002 1.059557928739176E-002 1.086239038743754E-002 1.113588330896714E-002 + 1.141622349417275E-002 1.170358038402396E-002 1.199812750984142E-002 1.230004258669788E-002 + 1.260950760866773E-002 1.292670894594570E-002 1.325183744385468E-002 1.358508852376154E-002 + 1.392666228591908E-002 1.427676361425080E-002 1.463560228309447E-002 1.500339306591889E-002 + 1.538035584602674E-002 1.576671572925529E-002 1.616270315868472E-002 1.656855403136198E-002 + 1.698450981704654E-002 1.741081767898188E-002 1.784773059669438E-002 1.829550749081922E-002 + 1.875441334994932E-002 1.922471935950184E-002 1.970670303259234E-002 2.020064834290437E-002 + 2.070684585953855E-002 2.122559288382104E-002 2.175719358804785E-002 2.230195915613681E-002 + 2.286020792615417E-002 2.343226553467888E-002 2.401846506296082E-002 2.461914718482542E-002 + 2.523466031626953E-002 2.586536076668806E-002 2.651161289166427E-002 2.717378924724796E-002 + 2.785227074564058E-002 2.854744681219558E-002 2.925971554363547E-002 2.998948386737716E-002 + 3.073716770184722E-002 3.150319211765890E-002 3.228799149951136E-002 3.309200970865957E-002 + 3.391570024579209E-002 3.475952641413888E-002 3.562396148261984E-002 3.650948884882749E-002 + 3.741660220162345E-002 3.834580568311085E-002 3.929761404972712E-002 4.027255283218398E-002 + 4.127115849396046E-002 4.229397858803463E-002 4.334157191151818E-002 4.441450865783279E-002 + 4.551337056604517E-002 4.663875106694874E-002 4.779125542545400E-002 4.897150087882031E-002 + 5.018011677022966E-002 5.141774467717192E-002 5.268503853407496E-002 5.398266474857719E-002 + 5.531130231080233E-002 5.667164289495277E-002 5.806439095249828E-002 5.949026379618844E-002 + 6.094999167406966E-002 6.244431783263871E-002 6.397399856820800E-002 6.553980326550404E-002 + 6.714251442245865E-002 6.878292766009073E-002 7.046185171631017E-002 7.218010842240280E-002 + 7.393853266088557E-002 7.573797230333852E-002 7.757928812674148E-002 7.946335370675607E-002 + 8.139105528629972E-002 8.336329161766772E-002 8.538097377635248E-002 8.744502494460762E-002 + 8.955638016269027E-002 9.171598604559862E-002 9.392480046299835E-002 9.618379217990176E-002 + 9.849394045552883E-002 1.008562345976374E-001 1.032716734694586E-001 1.057412649462221E-001 + 1.082660253180882E-001 1.108469786361390E-001 1.134851559979004E-001 1.161815947686841E-001 + 1.189373377348462E-001 1.217534321848601E-001 1.246309289138993E-001 1.275708811474056E-001 + 1.305743433789050E-001 1.336423701171055E-001 1.367760145370776E-001 1.399763270300838E-001 + 1.432443536463820E-001 1.465811344250791E-001 1.499877016048694E-001 1.534650777092395E-001 + 1.570142734994751E-001 1.606362857885637E-001 1.643320951088398E-001 1.681026632259941E-001 + 1.719489304918413E-001 1.758718130280329E-001 1.798721997327160E-001 1.839509491019652E-001 + 1.881088858576796E-001 1.923467973735228E-001 1.966654298904307E-001 2.010654845131795E-001 + 2.055476129795466E-001 2.101124131937078E-001 2.147604245156737E-001 2.194921227988476E-001 + 2.243079151681422E-001 2.292081345315625E-001 2.341930338187743E-001 2.392627799409159E-001 + 2.444174474668233E-001 2.496570120119229E-001 2.549813433373393E-001 2.603901981582799E-001 + 2.658832126625087E-001 2.714598947417635E-001 2.771196159412913E-001 2.828616031353239E-001 + 2.886849299393283E-001 2.945885078732261E-001 3.005710772935848E-001 3.066311981169812E-001 + 3.127672403614247E-001 3.189773745378901E-001 3.252595619296622E-001 3.316115448033972E-001 + 3.380308366025138E-001 3.445147121807927E-001 3.510601981418685E-001 3.576640633586105E-001 + 3.643228097552380E-001 3.710326634442953E-001 3.777895663203246E-001 3.845891682221245E-001 + 3.914268197857564E-001 3.982975661208894E-001 4.051961414534429E-001 4.121169648876636E-001 + 4.190541374505458E-001 4.260014405905602E-001 4.329523363107982E-001 4.398999691234277E-001 + 4.468371700175050E-001 4.537564626351866E-001 4.606500718518267E-001 4.675099349527580E-001 + 4.743277155932024E-001 4.810948207171196E-001 4.878024205952470E-001 4.944414721214269E-001 + 5.010027454788979E-001 5.074768542538054E-001 5.138542890311405E-001 5.201254544579512E-001 + 5.262807096993817E-001 5.323104121443913E-001 5.382049641393932E-001 5.439548624393071E-001 + 5.495507499664489E-001 5.549834693583401E-001 5.602441176662698E-001 5.653241014377306E-001 + 5.702151912786471E-001 5.749095748467827E-001 5.793999070774426E-001 5.836793562887164E-001 + 5.877416446584863E-001 5.915810814124811E-001 5.951925869155470E-001 5.985717057216498E-001 + 6.017146065174847E-001 6.046180667967075E-001 6.072794400349817E-001 6.096966031103946E-001 + 6.118678817419258E-001 6.137919538543997E-001 6.154677563023413E-001 6.168944597638472E-001 + 6.180714683936587E-001 6.189984208809787E-001 6.196751910569864E-001 6.201018880591097E-001 + 6.202788560606851E-001 6.202066735760820E-001 6.198861523526406E-001 6.193183358619818E-001 + 6.185044974042379E-001 6.174461378396950E-001 6.161449829630873E-001 6.146029805364046E-001 + 6.128222969965976E-001 6.108053138549023E-001 6.085546238047563E-001 6.060730265554011E-001 + 6.033635244082312E-001 6.004293175928707E-001 5.972737993796965E-001 5.939005509852285E-001 + 5.903133362863758E-001 5.865160963590396E-001 5.825129438559972E-001 5.783081572383583E-001 + 5.739061748741781E-001 5.693115890171104E-001 5.645291396771567E-001 5.595637083948324E-001 + 5.544203119291992E-001 5.491040958694315E-001 5.436203281787576E-001 5.379743926787960E-001 + 5.321717824815573E-001 5.262180933755841E-001 5.201190171720245E-001 5.138803350157403E-001 + 5.075079106659202E-001 5.010076837501298E-001 4.943856629951898E-001 4.876479194378606E-001 + 4.808005796179269E-001 4.738498187560097E-001 4.668018539180295E-001 4.596629371685451E-001 + 4.524393487145099E-001 4.451373900414571E-001 4.377633770439929E-001 4.303236331526906E-001 + 4.228244824596602E-001 4.152722428453744E-001 4.076732191096794E-001 4.000336961103134E-001 + 3.923599319127295E-001 3.846581509555139E-001 3.769345372362556E-001 3.691952275233029E-001 + 3.614463045994553E-001 3.536937905442903E-001 3.459436400624694E-001 3.382017338660334E-001 + 3.304738721193691E-001 3.227657679561715E-001 3.150830410783917E-001 3.074312114477593E-001 + 2.998156930810821E-001 2.922417879610730E-001 2.847146800749726E-001 2.772394295937039E-001 + 2.698209672047020E-001 2.624640886119114E-001 2.551734492167302E-001 2.479535589938745E-001 + 2.408087775762869E-001 2.337433095632411E-001 2.267612000657723E-001 2.198663305034370E-001 + 2.130624146661792E-001 2.063529950547889E-001 1.997414395130172E-001 1.932309381639311E-001 + 1.868245006624922E-001 1.805249537756576E-001 1.743349393005320E-001 1.682569123302291E-001 + 1.622931398761502E-001 1.564456998543577E-001 1.507164804426051E-001 1.451071798134084E-001 + 1.396193062472871E-001 1.342541786289978E-001 1.290129273282249E-001 1.238964954647761E-001 + 1.189056405569013E-001 1.140409365498711E-001 1.093027762204688E-001 1.046913739515532E-001 + 1.002067688693456E-001 9.584882833461772E-002 9.161725177748464E-002 8.751157486407736E-002 + 8.353117398197475E-002 7.967527102993222E-002 7.594293849616381E-002 7.233310480822103E-002 + 6.884455993637896E-002 6.547596123139368E-002 6.222583947654103E-002 5.909260513299887E-002 + 5.607455475688900E-002 5.316987756566781E-002 5.037666213104334E-002 4.769290317520403E-002 + 4.511650844688288E-002 4.264530565363874E-002 4.027704942672563E-002 3.800942829503649E-002 + 3.584007164484614E-002 3.376655664244430E-002 3.178641509723130E-002 2.989714024344968E-002 + 2.809619341943642E-002 2.638101062409461E-002 2.474900893119986E-002 2.319759274316022E-002 + 2.172415986693833E-002 2.032610739600727E-002 1.900083738344047E-002 1.774576229252109E-002 + 1.655831021258838E-002 1.543592982920690E-002 1.437609513914006E-002 1.337630990202217E-002 + 1.243411182204313E-002 1.154707645437688E-002 1.071282083249091E-002 9.929006813859029E-003 + 9.193344142954949E-003 8.503593231722830E-003 7.857567658993985E-003 7.253136391540225E-003 + 6.688225730617569E-003 6.160820988952760E-003 5.668967904155693E-003 5.210773795497540E-003 + 4.784408471874968E-003 4.388104899581836E-003 4.020159639228954E-003 3.678933061789227E-003 + 3.362849354298264E-003 3.070396326209784E-003 2.800125027786895E-003 2.550649192192210E-003 + 2.320644513345346E-003 2.108847771354928E-003 1.914055817824106E-003 1.735124433127180E-003 + 1.570967067711931E-003 1.420553479352623E-003 1.282908278082261E-003 1.157109390279502E-003 + 1.042286453079549E-003 9.376191499237130E-004 8.423354976624892E-004 7.557100951825338E-004 + 6.770623430985579E-004 6.057546434425459E-004 5.411905878531138E-004 4.828131421575197E-004 + 4.301028346434114E-004 3.825781930576345E-004 3.398117011094828E-004 3.013847912329459E-004 + 2.669076982590956E-004 2.360203274043297E-004 2.083905077967938E-004 1.837123044204780E-004 + 1.617043901167716E-004 1.421084789464991E-004 1.246878218882345E-004 1.092257655327250E-004 + 9.552437413004071E-005 8.340311505700941E-005 7.269760749879939E-005 6.325843388122335E-005 + 5.495001335033167E-005 4.764953637384113E-005 4.124595933534801E-005 3.563905780725368E-005 + 3.073853702578912E-005 2.646319793804598E-005 2.274015707059596E-005 1.950411835685986E-005 + 1.669669497021196E-005 1.426577913694524E-005 1.216495784732646E-005 1.035297234336883E-005 + 8.793219237798165E-006 7.453291109060571E-006 6.304554421127137E-006 5.321762633258999E-006 + 4.482702392729612E-006 3.767870741664740E-006 3.160181316547951E-006 2.644697574445437E-006 + 2.208391142535025E-006 1.839923456012333E-006 1.529448922854011E-006 1.268437931248235E-006 + 1.049518095808051E-006 8.663322210708545E-007 7.134115444241307E-007 5.860629047146004E-007 + 4.802685666941419E-007 3.925975144994612E-007 3.201271089935193E-007 2.603740835268644E-007 + 2.112339300901159E-007 1.709278025806593E-007 1.379561357240166E-007 1.110582468714152E-007 + 8.917725330877020E-008 7.142969979997985E-008 5.707934986545572E-008 4.551464986192195E-008 + 3.622942746808152E-008 2.880643598331435E-008 2.290340333058542E-008 1.815648567286021E-008 + 1.435055361489514E-008 1.130821943298445E-008 8.883659714755097E-009 6.957367093463197E-009 + 5.431705689151051E-009 4.227159420228528E-009 3.279175580837433E-009 2.535518056366668E-009 + 1.954055341662703E-009 1.500918207427419E-009 1.148970505772449E-009 8.765442924859939E-010 + 6.663972475039818E-010 5.048563712659407E-010 3.811171958146592E-010 2.866723455592033E-010 + 2.148472800801603E-010 1.604245129562488E-010 1.193405850251163E-010 8.844263223247733E-011 + 6.529357745632072E-011 4.801683831862637E-011 3.517302071384679E-011 2.566239821929154E-011 + 1.864809444413071E-011 1.349581877858071E-011 9.726782538027792E-012 6.981065582877742E-012 + 4.989233627595460E-012 3.550441456298912E-012 2.515612550416466E-012 1.774574457411287E-012 + 1.246262915808455E-012 8.712959287384343E-013 6.063697832789212E-013 4.200492847859669E-013 + 2.896199292534681E-013 1.987451217921522E-013 1.357307900804507E-013 9.224606287294589E-014 + 6.238472023882325E-014 4.198001491112858E-014 2.810694243983057E-014 1.872249104534209E-014 + 1.240693981841664E-014 8.178777441400386E-015 5.362978724732693E-015 3.497749186885351E-015 + 2.268854960661859E-015 1.463627249516655E-015 9.389225102431991E-016 5.989271196265383E-016 + 3.798675846477310E-016 2.395373276263683E-016 1.501637681608985E-016 9.357848185976881E-017 + 5.796598178367465E-017 3.568813352242357E-017 2.183708044936421E-017 1.327858065253249E-017 + 8.023445352594695E-018 4.817122528400369E-018 2.873405991445026E-018 1.702759503555861E-018 + 1.002353062172416E-018 5.860880089590191E-019 3.403633713359319E-019 1.963013836977289E-019 + 1.124259839336527E-019 6.393439789669635E-020 3.609842732347367E-020 2.023431890619292E-020 + 1.125889580827295E-020 6.218271868698249E-021 3.408549441249149E-021 1.854190085369063E-021 + 1.000879827736919E-021 5.360562689643373E-022 2.848372526087288E-022 1.501404903456802E-022 + 7.849999461276401E-023 4.070687374462147E-023 2.093375862121131E-023 1.067486668664398E-023 + 5.397185790573233E-024 + + + + 5.046849871632335E-010 5.174611486524602E-010 5.305607402205121E-010 5.439919495393732E-010 + 5.577631715529621E-010 5.718830137242411E-010 5.863603014151670E-010 6.012040834028339E-010 + 6.164236375352503E-010 6.320284765303051E-010 6.480283539215239E-010 6.644332701543506E-010 + 6.812534788367524E-010 6.984994931480633E-010 7.161820924100679E-010 7.343123288244266E-010 + 7.529015343806723E-010 7.719613279390731E-010 7.915036224928017E-010 8.115406326139526E-010 + 8.320848820880447E-010 8.531492117418044E-010 8.747467874691067E-010 8.968911084600868E-010 + 9.195960156385878E-010 9.428757003131874E-010 9.667447130472368E-010 9.912179727534440E-010 + 1.016310776018684E-009 1.042038806664872E-009 1.068418145551870E-009 1.095465280628555E-009 + 1.123197117238333E-009 1.151630988685542E-009 1.180784667069332E-009 1.210676374391821E-009 + 1.241324793947445E-009 1.272749082000649E-009 1.304968879759168E-009 1.338004325650450E-009 + 1.371876067908828E-009 1.406605277481363E-009 1.442213661260379E-009 1.478723475651000E-009 + 1.516157540482141E-009 1.554539253269655E-009 1.593892603840564E-009 1.634242189327501E-009 + 1.675613229542722E-009 1.718031582741362E-009 1.761523761783669E-009 1.806116950706450E-009 + 1.851839021713996E-009 1.898718552599142E-009 1.946784844605343E-009 1.996067940740921E-009 + 2.046598644556970E-009 2.098408539400586E-009 2.151530008155544E-009 2.205996253482658E-009 + 2.261841318572581E-009 2.319100108423934E-009 2.377808411660105E-009 2.438002922898334E-009 + 2.499721265685114E-009 2.563002016012145E-009 2.627884726427638E-009 2.694409950758000E-009 + 2.762619269455342E-009 2.832555315586673E-009 2.904261801481000E-009 2.977783546051034E-009 + 3.053166502806512E-009 3.130457788576719E-009 3.209705712960096E-009 3.290959808519374E-009 + 3.374270861741143E-009 3.459690944779115E-009 3.547273448001017E-009 3.637073113359376E-009 + 3.729146068607123E-009 3.823549862379364E-009 3.920343500163261E-009 4.019587481178479E-009 + 4.121343836191281E-009 4.225676166285895E-009 4.332649682617387E-009 4.442331247170892E-009 + 4.554789414552656E-009 4.670094474839069E-009 4.788318497510383E-009 4.909535376496626E-009 + 5.033820876363914E-009 5.161252679669948E-009 5.291910435518302E-009 5.425875809341896E-009 + 5.563232533946810E-009 5.704066461848158E-009 5.848465618931010E-009 5.996520259469618E-009 + 6.148322922539530E-009 6.303968489857803E-009 6.463554245087447E-009 6.627179934643131E-009 + 6.794947830036336E-009 6.966962791798623E-009 7.143332335023240E-009 7.324166696565904E-009 + 7.509578903946822E-009 7.699684845996950E-009 7.894603345292678E-009 8.094456232424308E-009 + 8.299368422144529E-009 8.509467991444670E-009 8.724886259607598E-009 8.945757870286994E-009 + 9.172220875664610E-009 9.404416822737919E-009 9.642490841792270E-009 9.886591737112682E-009 + 1.013687207999198E-008 1.039348830409367E-008 1.065660080322870E-008 1.092637403160765E-008 + 1.120297660663084E-008 1.148658141428051E-008 1.177736571718113E-008 1.207551126539531E-008 + 1.238120441002447E-008 1.269463621968549E-008 1.301600259993585E-008 1.334550441572223E-008 + 1.368334761692891E-008 1.402974336710436E-008 1.438490817544682E-008 1.474906403213093E-008 + 1.512243854706039E-008 1.550526509213318E-008 1.589778294710823E-008 1.630023744916497E-008 + 1.671288014624864E-008 1.713596895429806E-008 1.756976831845357E-008 1.801454937834592E-008 + 1.847059013756969E-008 1.893817563744698E-008 1.941759813518994E-008 1.990915728657386E-008 + 2.041316033323428E-008 2.092992229470616E-008 2.145976616532423E-008 2.200302311610830E-008 + 2.256003270175930E-008 2.313114307289550E-008 2.371671119366187E-008 2.431710306484802E-008 + 2.493269395265486E-008 2.556386862325261E-008 2.621102158327650E-008 2.687455732641136E-008 + 2.755489058621810E-008 2.825244659536124E-008 2.896766135139869E-008 2.970098188930008E-008 + 3.045286656086462E-008 3.122378532121198E-008 3.201422002252697E-008 3.282466471523939E-008 + 3.365562595682951E-008 3.450762312845084E-008 3.538118875956823E-008 3.627686886081558E-008 + 3.719522326527872E-008 3.813682597841940E-008 3.910226553685772E-008 4.009214537623677E-008 + 4.110708420840124E-008 4.214771640812415E-008 4.321469240962398E-008 4.430867911312084E-008 + 4.543036030168350E-008 4.658043706863155E-008 4.775962825575630E-008 4.896867090263603E-008 + 5.020832070732679E-008 5.147935249871549E-008 5.278256072083219E-008 5.411875992942288E-008 + 5.548878530109324E-008 5.689349315534353E-008 5.833376148981790E-008 5.981049052910635E-008 + 6.132460328743837E-008 6.287704614562359E-008 6.446878944259855E-008 6.610082808194801E-008 + 6.777418215378411E-008 6.948989757236718E-008 7.124904672986983E-008 7.305272916669305E-008 + 7.490207225875120E-008 7.679823192215871E-008 7.874239333575562E-008 8.073577168192719E-008 + 8.277961290617725E-008 8.487519449593262E-008 8.702382627906544E-008 8.922685124263044E-008 + 9.148564637233106E-008 9.380162351323974E-008 9.617623025230706E-008 9.861095082321688E-008 + 1.011073070341476E-007 1.036668592190238E-007 1.062912072128507E-007 1.089819913517415E-007 + 1.117408934982650E-007 1.145696380927506E-007 1.174699932312113E-007 1.204437717705593E-007 + 1.234928324617994E-007 1.266190811119178E-007 1.298244717751841E-007 1.331110079746175E-007 + 1.364807439543767E-007 1.399357859638603E-007 1.434782935743182E-007 1.471104810287969E-007 + 1.508346186262652E-007 1.546530341407842E-007 1.585681142766077E-007 1.625823061601283E-007 + 1.666981188695937E-007 1.709181250035562E-007 1.752449622890364E-007 1.796813352304010E-007 + 1.842300167999930E-007 1.888938501715665E-007 1.936757504976125E-007 1.985787067316860E-007 + 2.036057834968724E-007 2.087601230015717E-007 2.140449470037801E-007 2.194635588251170E-007 + 2.250193454158442E-007 2.307157794721728E-007 2.365564216071856E-007 2.425449225767250E-007 + 2.486850255616466E-007 2.549805685078602E-007 2.614354865256259E-007 2.680538143496029E-007 + 2.748396888611943E-007 2.817973516747557E-007 2.889311517893027E-007 2.962455483073563E-007 + 3.037451132226416E-007 3.114345342783780E-007 3.193186178979487E-007 3.274022921897824E-007 + 3.356906100283321E-007 3.441887522130739E-007 3.529020307075018E-007 3.618358919601487E-007 + 3.709959203097079E-007 3.803878414763898E-007 3.900175261416945E-007 3.998909936188382E-007 + 4.100144156161411E-007 4.203941200957194E-007 4.310365952299022E-007 4.419484934578491E-007 + 4.531366356449045E-007 4.646080153472944E-007 4.763698031848389E-007 4.884293513244053E-007 + 5.007941980769200E-007 5.134720726108092E-007 5.264708997848245E-007 5.397988051032738E-007 + 5.534641197967580E-007 5.674753860316090E-007 5.818413622512649E-007 5.965710286529509E-007 + 6.116735928030818E-007 6.271584953949035E-007 6.430354161519808E-007 6.593142798812306E-007 + 6.760052626792881E-007 6.931187982960903E-007 7.106655846596594E-007 7.286565905661947E-007 + 7.471030625396309E-007 7.660165318649834E-007 7.854088217998751E-007 8.052920549687680E-007 + 8.256786609445298E-007 8.465813840220849E-007 8.680132911890196E-007 8.899877802981390E-007 + 9.125185884470966E-007 9.356198005703457E-007 9.593058582487913E-007 9.835915687426903E-007 + 1.008492114253416E-006 1.034023061419947E-006 1.060200371055986E-006 1.087040408133845E-006 + 1.114559952021337E-006 1.142776206978112E-006 1.171706812917997E-006 1.201369856444118E-006 + 1.231783882163683E-006 1.262967904289582E-006 1.294941418536028E-006 1.327724414315729E-006 + 1.361337387246234E-006 1.395801351973314E-006 1.431137855319403E-006 1.467368989765383E-006 + 1.504517407274141E-006 1.542606333464603E-006 1.581659582145122E-006 1.621701570215360E-006 + 1.662757332946022E-006 1.704852539646032E-006 1.748013509726991E-006 1.792267229175008E-006 + 1.837641367440274E-006 1.884164294754946E-006 1.931865099890281E-006 1.980773608364130E-006 + 2.030920401110278E-006 2.082336833621322E-006 2.135055055577189E-006 2.189108030971562E-006 + 2.244529558748933E-006 2.301354293965240E-006 2.359617769485398E-006 2.419356418231407E-006 + 2.480607595995000E-006 2.543409604829220E-006 2.607801717033634E-006 2.673824199748311E-006 + 2.741518340172035E-006 2.810926471420679E-006 2.882091999041933E-006 2.955059428203267E-006 + 3.029874391570063E-006 3.106583677891681E-006 3.185235261313354E-006 3.265878331432464E-006 + 3.348563324118145E-006 3.433341953113710E-006 3.520267242441710E-006 3.609393559632293E-006 + 3.700776649795659E-006 3.794473670560248E-006 3.890543227898693E-006 3.989045412864203E-006 + 4.090041839260570E-006 4.193595682269667E-006 4.299771718060832E-006 4.408636364407239E-006 + 4.520257722334879E-006 4.634705618830731E-006 4.752051650636867E-006 4.872369229158539E-006 + 4.995733626514482E-006 5.122222022758793E-006 5.251913554304211E-006 5.384889363577642E-006 + 5.521232649939315E-006 5.661028721898062E-006 5.804365050655705E-006 5.951331325014762E-006 + 6.102019507684216E-006 6.256523893019272E-006 6.414941166231823E-006 6.577370464109210E-006 + 6.743913437280186E-006 6.914674314067396E-006 7.089759965967495E-006 7.269279974800292E-006 + 7.453346701570075E-006 7.642075357082783E-006 7.835584074364461E-006 8.033993982926933E-006 + 8.237429284928498E-006 8.446017333278196E-006 8.659888711733634E-006 8.879177317043897E-006 + 9.104020443189804E-006 9.334558867775956E-006 9.570936940629783E-006 9.813302674664540E-006 + 1.006180783906464E-005 1.031660805485327E-005 1.057786289290381E-005 1.084573597445800E-005 + 1.112039507421596E-005 1.140201222606429E-005 1.169076383151050E-005 1.198683077089399E-005 + 1.229039851744534E-005 1.260165725426776E-005 1.292080199431633E-005 1.324803270345307E-005 + 1.358355442665733E-005 1.392757741747367E-005 1.428031727078140E-005 1.464199505897202E-005 + 1.501283747162314E-005 1.539307695876013E-005 1.578295187779910E-005 1.618270664426663E-005 + 1.659259188639547E-005 1.701286460369689E-005 1.744378832961407E-005 1.788563329836270E-005 + 1.833867661606875E-005 1.880320243631615E-005 1.927950214021923E-005 1.976787452113955E-005 + 2.026862597416832E-005 2.078207069050018E-005 2.130853085682654E-005 2.184833685988116E-005 + 2.240182749627320E-005 2.296935018774770E-005 2.355126120201651E-005 2.414792587930696E-005 + 2.475971886477954E-005 2.538702434697003E-005 2.603023630241583E-005 2.668975874663073E-005 + 2.736600599159673E-005 2.805940290994581E-005 2.877038520601101E-005 2.949939969392873E-005 + 3.024690458298088E-005 3.101336977037119E-005 3.179927714163313E-005 3.260512087887578E-005 + 3.343140777707593E-005 3.427865756863465E-005 3.514740325641914E-005 3.603819145551922E-005 + 3.695158274395372E-005 3.788815202256808E-005 3.884848888437230E-005 3.983319799357496E-005 + 4.084289947457655E-005 4.187822931119332E-005 4.293983975638921E-005 4.402839975280370E-005 + 4.514459536436980E-005 4.628913021932571E-005 4.746272596493317E-005 4.866612273422338E-005 + 4.990007962510215E-005 5.116537519215436E-005 5.246280795149839E-005 5.379319689905220E-005 + 5.515738204258329E-005 5.655622494792425E-005 5.799060929974901E-005 5.946144147731616E-005 + 6.096965114559730E-005 6.251619186222195E-005 6.410204170068218E-005 6.572820389025576E-005 + 6.739570747311804E-005 6.910560797912998E-005 7.085898811880093E-005 7.265695849494469E-005 + 7.450065833355977E-005 7.639125623448179E-005 7.832995094237587E-005 8.031797213865062E-005 + 8.235658125489553E-005 8.444707230846371E-005 8.659077276083739E-005 8.878904439944062E-005 + 9.104328424357657E-005 9.335492547519538E-005 9.572543839521777E-005 9.815633140616183E-005 + 1.006491520218492E-004 1.032054879049871E-004 1.058269679334506E-004 1.085152632961181E-004 + 1.112720886191363E-004 1.140992031235272E-004 1.169984118150719E-004 1.199715667074433E-004 + 1.230205680795868E-004 1.261473657683875E-004 1.293539604976927E-004 1.326424052447966E-004 + 1.360148066455312E-004 1.394733264391473E-004 1.430201829542076E-004 1.466576526367579E-004 + 1.503880716220899E-004 1.542138373514432E-004 1.581374102350541E-004 1.621613153630004E-004 + 1.662881442653441E-004 1.705205567231280E-004 1.748612826318332E-004 1.793131239189719E-004 + 1.838789565175330E-004 1.885617323970787E-004 1.933644816543386E-004 1.982903146652284E-004 + 2.033424243002783E-004 2.085240882055367E-004 2.138386711510906E-004 2.192896274494164E-004 + 2.248805034458649E-004 2.306149400836640E-004 2.364966755459139E-004 2.425295479771445E-004 + 2.487174982870944E-004 2.550645730394835E-004 2.615749274286451E-004 2.682528283469937E-004 + 2.751026575464290E-004 2.821289148968889E-004 2.893362217453805E-004 2.967293243789648E-004 + 3.043130975952895E-004 3.120925483844180E-004 3.200728197258415E-004 3.282591945047145E-004 + 3.366570995515272E-004 3.452721098095694E-004 3.541099526347446E-004 3.631765122324554E-004 + 3.724778342364770E-004 3.820201304349370E-004 3.918097836487255E-004 4.018533527678773E-004 + 4.121575779516877E-004 4.227293859985692E-004 4.335758958919057E-004 4.447044245284030E-004 + 4.561224926357259E-004 4.678378308864775E-004 4.798583862158806E-004 4.921923283508280E-004 + 5.048480565582919E-004 5.178342066214146E-004 5.311596580519671E-004 5.448335415482187E-004 + 5.588652467076584E-004 5.732644300044034E-004 5.880410230415619E-004 6.032052410892560E-004 + 6.187675919194622E-004 6.347388849493441E-004 6.511302407052170E-004 6.679531006198516E-004 + 6.852192371763567E-004 7.029407644124698E-004 7.211301487997098E-004 7.398002205124443E-004 + 7.589641851026538E-004 7.786356355968039E-004 7.988285650320353E-004 8.195573794495973E-004 + 8.408369113643027E-004 8.626824337295726E-004 8.851096744185813E-004 9.081348312428897E-004 + 9.317745875309495E-004 9.560461282898637E-004 9.809671569748759E-004 1.006555912892160E-003 + 1.032831189261646E-003 1.059812351967876E-003 1.087519359028121E-003 1.115972780808405E-003 + 1.145193821019434E-003 1.175204338525938E-003 1.206026870004507E-003 1.237684653486590E-003 + 1.270201652825066E-003 1.303602583124608E-003 1.337912937177877E-003 1.373159012951620E-003 + 1.409367942168803E-003 1.446567720035055E-003 1.484787236160002E-003 1.524056306726448E-003 + 1.564405707962877E-003 1.605867210977370E-003 1.648473618013809E-003 1.692258800194118E-003 + 1.737257736813349E-003 1.783506556257599E-003 1.831042578618076E-003 1.879904360078214E-003 + 1.930131739154349E-003 1.981765884874356E-003 2.034849346982790E-003 2.089426108265172E-003 + 2.145541639088762E-003 2.203242954261664E-003 2.262578672317164E-003 2.323599077335345E-003 + 2.386356183419441E-003 2.450903801950169E-003 2.517297611747228E-003 2.585595232273459E-003 + 2.655856300023790E-003 2.728142548248012E-003 2.802517890163776E-003 2.879048505823796E-003 + 2.957802932809357E-003 3.038852160930621E-003 3.122269731123110E-003 3.208131838739109E-003 + 3.296517441442497E-003 3.387508371925709E-003 3.481189455678551E-003 3.577648634049685E-003 + 3.676977092853691E-003 3.779269396789094E-003 3.884623629945832E-003 3.993141542694584E-003 + 4.104928705264693E-003 4.220094668332969E-003 4.338753130961321E-003 4.461022116238303E-003 + 4.587024154997168E-003 4.716886478001600E-003 4.850741217009963E-003 4.988725615149173E-003 + 5.130982247051100E-003 5.277659249226893E-003 5.428910561178319E-003 5.584896177770424E-003 + 5.745782413415826E-003 5.911742178648765E-003 6.082955269695952E-003 6.259608671681297E-003 + 6.441896876134392E-003 6.630022213505477E-003 6.824195201425095E-003 7.024634909484255E-003 + 7.231569341348912E-003 7.445235835064450E-003 7.665881482448191E-003 7.893763568513287E-003 + 8.129150031915049E-003 8.372319947460016E-003 8.623564031770859E-003 8.883185173254862E-003 + 9.151498987581426E-003 9.428834399934806E-003 9.715534255371401E-003 1.001195595867804E-002 + 1.031847214519744E-002 1.063547138416061E-002 1.096335891614336E-002 1.130255742634391E-002 + 1.165350785546496E-002 1.201667025007091E-002 1.239252465438537E-002 1.278157204559129E-002 + 1.318433531479801E-002 1.360136029594802E-002 1.403321684504702E-002 1.448049997221931E-002 + 1.494383102921378E-002 1.542385895511312E-002 1.592126158313489E-002 1.643674701155238E-002 + 1.697105504191022E-002 1.752495868786323E-002 1.809926575812548E-002 1.869482051718445E-002 + 1.931250542760588E-002 1.995324297793741E-002 2.061799760040458E-002 2.130777768278643E-002 + 2.202363767906123E-002 2.276668032361750E-002 2.353805895404344E-002 2.433897994772816E-002 + 2.517070527773553E-002 2.603455519364724E-002 2.693191103330980E-002 2.786421817166538E-002 + 2.883298911309656E-002 2.983980673396460E-002 3.088632768227906E-002 3.197428594168857E-002 + 3.310549656723848E-002 3.428185960059462E-002 3.550536417267561E-002 3.677809280187951E-002 + 3.810222589631622E-002 3.948004646867255E-002 4.091394507253290E-002 4.240642496914802E-002 + 4.396010753379243E-002 4.557773791095227E-002 4.726219092765466E-002 4.901647727426189E-002 + 5.084374996200262E-002 5.274731106639648E-002 5.473061876551891E-002 5.679729468175152E-002 + 5.895113153524306E-002 6.119610111675022E-002 6.353636258682338E-002 6.597627110741305E-002 + 6.852038681088463E-002 7.117348411010697E-002 7.394056135168761E-002 7.682685081253769E-002 + 7.983782903770917E-002 8.297922751482054E-002 8.625704367732098E-002 8.967755222527163E-002 + 9.324731674820461E-002 9.697320162986382E-002 1.008623842091810E-001 1.049223671656037E-001 + 1.091609910897848E-001 1.135864471925657E-001 1.182072900960438E-001 1.230324506401832E-001 + 1.280712486268132E-001 1.333334054098012E-001 1.388290562256065E-001 1.445687621421321E-001 + 1.505635214857027E-001 1.568247805859475E-001 1.633644436562255E-001 1.701948816028910E-001 + 1.773289395300156E-001 1.847799426770883E-001 1.925617004956232E-001 2.006885085364681E-001 + 2.091751477829507E-001 2.180368810258563E-001 2.272894458347534E-001 2.369490436365667E-001 + 2.470323243668571E-001 2.575563661124735E-001 2.685386491166223E-001 2.799970234697851E-001 + 2.919496697632131E-001 3.044150519371258E-001 3.174118615147216E-001 3.309589523773449E-001 + 3.450752652077360E-001 3.597797407095578E-001 3.750912207051093E-001 3.910283362224135E-001 + 4.076093817111340E-001 4.248521745779537E-001 4.427738993102096E-001 4.613909355662093E-001 + 4.807186697563740E-001 5.007712898257558E-001 5.215615631803017E-001 5.431005979805901E-001 + 5.653975883614919E-001 5.884595445271681E-001 6.122910091195369E-001 6.368937617650079E-001 + 6.622665142666004E-001 6.884045995219988E-001 7.152996579047618E-001 7.429393255344019E-001 + 7.713069295660222E-001 8.003811963314698E-001 8.301359788371152E-001 8.605400107388330E-001 + 8.915566944383790E-001 9.231439313391348E-001 9.552540025212939E-001 9.878335081037051E-001 + 1.020823373307727E+000 1.054158928685605E+000 1.087770071084796E+000 1.121581510660223E+000 + 1.155513107600062E+000 1.189480300192867E+000 1.223394623447904E+000 1.257164314721664E+000 + 1.290694999759284E+000 1.323890449314355E+000 1.356653393173956E+000 1.388886375123247E+000 + 1.420492629294980E+000 1.451376955643061E+000 1.481446570151974E+000 1.510611904052376E+000 + 1.538787325970543E+000 1.565891761811764E+000 1.591849189479792E+000 1.616588989481809E+000 + 1.640046138279038E+000 1.662161239145468E+000 1.682880395540493E+000 1.702154944866639E+000 + 1.719941086298736E+000 1.736199455517474E+000 1.750894722096620E+000 1.763995312465020E+000 + 1.775473393299324E+000 1.785305265944295E+000 1.793472075424748E+000 1.799960111994117E+000 + 1.804760872491526E+000 1.807871047296723E+000 1.809292441296495E+000 1.809031822594614E+000 + 1.807100693239712E+000 1.803514982042557E+000 1.798294723130874E+000 1.791463882956636E+000 + 1.783050233366947E+000 1.773085214897372E+000 1.761603786603125E+000 1.748644263353030E+000 + 1.734248141575846E+000 1.718459914504682E+000 1.701326878012498E+000 1.682898928170461E+000 + 1.663228351690318E+000 1.642369610432631E+000 1.620379121174350E+000 1.597315031831952E+000 + 1.573236995330807E+000 1.548205942297311E+000 1.522283853728533E+000 1.495533534764818E+000 + 1.468018390654342E+000 1.439802205956037E+000 1.410948927978433E+000 1.381522455398145E+000 + 1.351586432943074E+000 1.321204052962657E+000 1.290437864641512E+000 1.259349591544036E+000 + 1.227999958106107E+000 1.196448525618868E+000 1.164753538174621E+000 1.132971778972600E+000 + 1.101158437308519E+000 1.069366986499500E+000 1.037649072924850E+000 1.006054416293697E+000 + 9.746307211835203E-001 9.434235998288670E-001 9.124765060780856E-001 8.818306803774612E-001 + 8.515251055872445E-001 8.215964733830041E-001 7.920791609483842E-001 7.630052176222300E-001 + 7.344043611239399E-001 7.063039829461153E-001 6.787291624726396E-001 6.517026893547904E-001 + 6.252450936546483E-001 5.993746832479405E-001 5.741075879640448E-001 5.494578099309735E-001 + 5.254372795868099E-001 5.020559168164938E-001 4.793216966737097E-001 4.572407191517094E-001 + 4.358172824741345E-001 4.150539593869250E-001 3.949516759451033E-001 3.755097923033063E-001 + 3.567261850361748E-001 3.385973305339127E-001 3.211183890391742E-001 3.042832889137503E-001 + 2.880848107470487E-001 2.725146709428210E-001 2.575636044458465E-001 2.432214462959833E-001 + 2.294772117230648E-001 2.163191745222383E-001 2.037349434753714E-001 1.917115366099091E-001 + 1.802354531118406E-001 1.692927427341184E-001 1.588690725657981E-001 1.489497910501874E-001 + 1.395199891623570E-001 1.305645586772874E-001 1.220682474797245E-001 1.140157118853451E-001 + 1.063915659600825E-001 9.918042784041092E-002 9.236696307196925E-002 8.593592499717839E-002 + 7.987219223442689E-002 7.416080330202256E-002 6.878698844946070E-002 6.373619876667602E-002 + 5.899413264889403E-002 5.454675970053358E-002 5.038034216639702E-002 4.648145398221064E-002 + 4.283699753949430E-002 3.943421826185548E-002 3.626071709117693E-002 3.330446098288402E-002 + 3.055379150962879E-002 2.799743167236609E-002 2.562449101701602E-002 2.342446915376327E-002 + 2.138725777459859E-002 1.950314126302919E-002 1.776279598800852E-002 1.615728837212054E-002 + 1.467807182192761E-002 1.331698260619042E-002 1.206623476541774E-002 1.091841413392222E-002 + 9.866471553259973E-003 8.903715353625359E-003 8.023803177462307E-003 7.220733217241051E-003 + 6.488834937030233E-003 5.822759345166202E-003 5.217468882975287E-003 4.668226992133573E-003 + 4.170587420845582E-003 3.720383326577685E-003 3.313716230589235E-003 2.946944876956968E-003 + 2.616674046181893E-003 2.319743370801108E-003 2.053216197698097E-003 1.814368539017358E-003 + 1.600678150746310E-003 1.409813775135994E-003 1.239624580201504E-003 1.088129826583556E-003 + 9.535087890774768E-004 8.340909571590310E-004 7.283465358733627E-004 6.348772655204114E-004 + 5.524075756840336E-004 4.797760863297722E-004 4.159274659544316E-004 3.599046541254746E-004 + 3.108414532149859E-004 2.679554917256107E-004 2.305415593371328E-004 1.979653116831761E-004 + 1.696573409070719E-004 1.451076062515569E-004 1.238602173138418E-004 1.055085611490299E-004 + 8.969076313206532E-005 7.608547039063454E-005 6.440794569617929E-005 5.440645894304968E-005 + 4.585896275096406E-005 3.857003828601460E-005 3.236809710192160E-005 2.710282464654785E-005 + 2.264285104842542E-005 1.887363488323690E-005 1.569554580935390E-005 1.302213224293984E-005 + 1.077856060730201E-005 8.900213118090400E-006 7.331431560347542E-006 6.024395047205188E-006 + 4.938120323553907E-006 4.037573778212563E-006 3.292884946277367E-006 2.678651911259750E-006 + 2.173329646875193E-006 1.758692964285204E-006 1.419366346399100E-006 1.142413551494532E-006 + 9.169804498552619E-007 7.339851152506977E-007 5.858497263432973E-007 4.662693381073615E-007 + 3.700130593813546E-007 2.927570443128190E-007 2.309610444179623E-007 1.816772193616487E-007 + 1.424873352361400E-007 1.114165231987084E-007 8.685679187892468E-008 6.750281857830697E-008 + 5.229821440558170E-008 4.039069528171155E-008 3.109480106156011E-008 2.386099112373199E-008 + 1.825010885033028E-008 1.391235152113570E-008 1.057000823483199E-008 8.003338376601263E-009 + 6.039058587128927E-009 4.540988739133159E-009 3.402478556658738E-009 2.540297560555940E-009 + 1.889723213892355E-009 1.400606579964474E-009 1.034232496707670E-009 7.608231067654750E-010 + 5.575603651151189E-010 4.070255849865741E-010 2.959728048223740E-010 2.143683148497494E-010 + 1.546415526472006E-010 1.111031812127605E-010 7.949486231960045E-011 5.664234376151561E-011 + 4.018925805153849E-011 2.839370934729641E-011 1.997349731210194E-011 1.398885357671710E-011 + 9.753984593586880E-012 6.770637606444734E-012 4.678428547591994E-012 3.217869865513079E-012 + 2.202976629920291E-012 1.501063124088163E-012 1.017912112244603E-012 6.869394829601630E-013 + 4.613158064707257E-013 3.082656243201503E-013 2.049627358049093E-013 1.355893288290261E-013 + 8.923954752501466E-014 5.843262794753973E-014 3.806379105245852E-014 2.466786854041518E-014 + 1.590516508771892E-014 1.020440406301012E-014 6.516104379865606E-015 4.143166712774151E-015 + 2.625142833526234E-015 1.659621510134403E-015 1.049131769203407E-015 6.593159444277503E-016 + 4.118767783178281E-016 2.557516535859395E-016 1.578388198994124E-016 9.680991376645175E-017 + 5.900685339609091E-017 3.573775353203519E-017 2.150598498166837E-017 1.285770362908161E-017 + 7.636664556887111E-018 4.505510930912853E-018 2.640266446328257E-018 1.536659793403770E-018 + 8.881705829717282E-019 5.097599112196767E-019 2.905006338928864E-019 1.643620674174772E-019 + 9.231870751593957E-020 5.147204871459775E-020 2.848435046831179E-020 1.564419839243277E-020 + 8.526502514094453E-021 4.611233524236187E-021 2.474282772274110E-021 1.317117364731254E-021 + 6.955028527945292E-022 3.642742490086157E-022 1.892205970841759E-022 9.747055334488411E-023 + 4.978490438145999E-023 2.521126906921231E-023 1.265661300762581E-023 6.298229009793170E-024 + 3.106342510638801E-024 1.518313190872346E-024 7.353686281474532E-025 3.528828032984050E-025 + 1.677594068415678E-025 7.899924687235486E-026 3.684569475172676E-026 1.701867223111898E-026 + 7.783706638552488E-027 3.524643303877156E-027 1.580000426631898E-027 7.010633418858296E-028 + 3.078643113156248E-028 1.337848008719197E-028 5.752308160387099E-029 2.446849874871427E-029 + 1.029540566503985E-029 4.284409451055378E-030 1.763150960482781E-030 7.174273892482835E-031 + 2.885987637322021E-031 1.147562626527642E-031 4.509831453656017E-032 1.751386453435816E-032 + 6.720110088290602E-033 2.547285748628666E-033 9.537161651040087E-034 3.526414082916201E-034 + 1.287513506521468E-034 4.640933890724472E-035 1.651292398334435E-035 5.798779853899606E-036 + 2.009423322492838E-036 6.869983084910944E-037 2.316944490943229E-037 7.706846648328600E-038 + 2.527920372689988E-038 8.175214468826181E-039 2.606192910456221E-039 8.188553231950328E-040 + 2.535254696430923E-040 7.733381006608802E-041 2.323641858687977E-041 6.876041745361868E-042 + 2.003520859141368E-042 5.747126469919319E-043 1.622645209473776E-043 4.508433368248258E-044 + 1.232449830840796E-044 3.314099140121106E-045 8.764445000222776E-046 2.279055575552430E-046 + 5.825922891593123E-047 + + diff --git a/tests/apps/miniDFT/tests/espresso/test/Ti.pbe.UPF b/tests/apps/miniDFT/tests/espresso/test/Ti.pbe.UPF new file mode 100644 index 0000000000..6ed290fce4 --- /dev/null +++ b/tests/apps/miniDFT/tests/espresso/test/Ti.pbe.UPF @@ -0,0 +1,2743 @@ + + + Generated using "atomic" code by A. Dal Corso (Quantum ESPRESSO distribution) + Author: AM + Generation date: 15Apr2011 + Pseudopotential type: NC + Element: Ti + Functional: PBE + + Suggested minimum cutoff for wavefunctions: 0. Ry + Suggested minimum cutoff for charge density: 0. Ry + The Pseudo was generated with a Scalar-Relativistic Calculation + L component and cutoff radius for Local Potential: 0 0.9000 + + Valence configuration: + nl pn l occ Rcut Rcut US E pseu + 3P 2 1 6.00 0.900 0.900 -6.571781 + 3D 3 2 0.00 1.000 1.000 -3.841409 + 3S 1 0 2.00 0.943 0.943 -8.373940 + Generation configuration: + 3P 2 1 6.00 0.900 0.900 -6.571733 + 3D 3 2 0.00 1.000 1.000 -3.841449 + 3S 1 0 2.00 0.900 0.900 -8.373822 + + Pseudization used: troullier-martins + + + + + + + + 4.144918025247801E-005 4.197054675768283E-005 4.249847124620828E-005 4.303303620732972E-005 + 4.357432516790999E-005 4.412242270545040E-005 4.467741446130630E-005 4.523938715406870E-005 + 4.580842859311411E-005 4.638462769232521E-005 4.696807448398350E-005 4.755886013283720E-005 + 4.815707695034592E-005 4.876281840910440E-005 4.937617915744808E-005 4.999725503424174E-005 + 5.062614308385469E-005 5.126294157132420E-005 5.190774999770943E-005 5.256066911563899E-005 + 5.322180094505338E-005 5.389124878914604E-005 5.456911725050459E-005 5.525551224745521E-005 + 5.595054103061277E-005 5.665431219963862E-005 5.736693572020975E-005 5.808852294120111E-005 + 5.881918661208400E-005 5.955904090054364E-005 6.030820141031780E-005 6.106678519926031E-005 + 6.183491079763153E-005 6.261269822661895E-005 6.340026901709085E-005 6.419774622858552E-005 + 6.500525446853975E-005 6.582291991175889E-005 6.665087032013196E-005 6.748923506259485E-005 + 6.833814513534419E-005 6.919773318230599E-005 7.006813351586138E-005 7.094948213783328E-005 + 7.184191676073714E-005 7.274557682929838E-005 7.366060354224122E-005 7.458713987435118E-005 + 7.552533059881518E-005 7.647532230984278E-005 7.743726344557155E-005 7.841130431126101E-005 + 7.939759710277816E-005 8.039629593037822E-005 8.140755684278499E-005 8.243153785157342E-005 + 8.346839895585942E-005 8.451830216730004E-005 8.558141153540807E-005 8.665789317318529E-005 + 8.774791528307769E-005 8.885164818325759E-005 8.996926433423621E-005 9.110093836581087E-005 + 9.224684710435155E-005 9.340716960042995E-005 9.458208715679679E-005 9.577178335671064E-005 + 9.697644409262310E-005 9.819625759522520E-005 9.943141446285842E-005 1.006821076912962E-004 + 1.019485327039001E-004 1.032308873821549E-004 1.045293720965880E-004 1.058441897380779E-004 + 1.071755457495560E-004 1.085236481581079E-004 1.098887076074774E-004 1.112709373909811E-004 + 1.126705534848345E-004 1.140877745818999E-004 1.155228221258572E-004 1.169759203458045E-004 + 1.184472962912954E-004 1.199371798678146E-004 1.214458038727023E-004 1.229734040315285E-004 + 1.245202190349258E-004 1.260864905758858E-004 1.276724633875233E-004 1.292783852813167E-004 + 1.309045071858292E-004 1.325510831859167E-004 1.342183705624294E-004 1.359066298324118E-004 + 1.376161247898098E-004 1.393471225466883E-004 1.410998935749686E-004 1.428747117486900E-004 + 1.446718543868030E-004 1.464916022965012E-004 1.483342398170977E-004 1.502000548644537E-004 + 1.520893389759669E-004 1.540023873561233E-004 1.559394989226243E-004 1.579009763530933E-004 + 1.598871261323695E-004 1.618982586003968E-004 1.639346880007150E-004 1.659967325295611E-004 + 1.680847143855878E-004 1.701989598202082E-004 1.723397991885731E-004 1.745075670011893E-004 + 1.767026019761877E-004 1.789252470922492E-004 1.811758496421950E-004 1.834547612872527E-004 + 1.857623381120030E-004 1.880989406800198E-004 1.904649340902081E-004 1.928606880338518E-004 + 1.952865768523791E-004 1.977429795958531E-004 2.002302800822003E-004 2.027488669571819E-004 + 2.052991337551212E-004 2.078814789603942E-004 2.104963060696930E-004 2.131440236550732E-004 + 2.158250454277944E-004 2.185397903029630E-004 2.212886824649892E-004 2.240721514338660E-004 + 2.268906321322826E-004 2.297445649535825E-004 2.326343958305751E-004 2.355605763052148E-004 + 2.385235635991538E-004 2.415238206851853E-004 2.445618163595828E-004 2.476380253153511E-004 + 2.507529282163987E-004 2.539070117726409E-004 2.571007688160504E-004 2.603346983776630E-004 + 2.636093057655519E-004 2.669251026437842E-004 2.702826071123679E-004 2.736823437882072E-004 + 2.771248438870744E-004 2.806106453066137E-004 2.841402927103891E-004 2.877143376129885E-004 + 2.913333384661993E-004 2.949978607462676E-004 2.987084770422551E-004 3.024657671455079E-004 + 3.062703181402485E-004 3.101227244953103E-004 3.140235881570242E-004 3.179735186432732E-004 + 3.219731331387330E-004 3.260230565913045E-004 3.301239218097678E-004 3.342763695626562E-004 + 3.384810486783790E-004 3.427386161466034E-004 3.470497372209074E-004 3.514150855227305E-004 + 3.558353431466261E-004 3.603112007668406E-004 3.648433577452346E-004 3.694325222405551E-004 + 3.740794113190923E-004 3.787847510667186E-004 3.835492767023423E-004 3.883737326927885E-004 + 3.932588728691197E-004 3.982054605444285E-004 4.032142686331026E-004 4.082860797715962E-004 + 4.134216864407193E-004 4.186218910894609E-004 4.238875062603785E-004 4.292193547165551E-004 + 4.346182695701593E-004 4.400850944126224E-004 4.456206834464467E-004 4.512259016186824E-004 + 4.569016247560721E-004 4.626487397019031E-004 4.684681444545795E-004 4.743607483079320E-004 + 4.803274719933025E-004 4.863692478234058E-004 4.924870198380069E-004 4.986817439514312E-004 + 5.049543881019231E-004 5.113059324028938E-004 5.177373692960626E-004 5.242497037065282E-004 + 5.308439531997933E-004 5.375211481407553E-004 5.442823318547100E-004 5.511285607903681E-004 + 5.580609046849289E-004 5.650804467312315E-004 5.721882837469999E-004 5.793855263462304E-004 + 5.866732991127215E-004 5.940527407757945E-004 6.015250043882246E-004 6.090912575064013E-004 + 6.167526823727698E-004 6.245104761005520E-004 6.323658508608008E-004 6.403200340718061E-004 + 6.483742685908753E-004 6.565298129085399E-004 6.647879413451919E-004 6.731499442502000E-004 + 6.816171282035326E-004 6.901908162199066E-004 6.988723479555197E-004 7.076630799173677E-004 + 7.165643856752040E-004 7.255776560761647E-004 7.347042994620852E-004 7.439457418895648E-004 + 7.533034273527843E-004 7.627788180091345E-004 7.723733944076856E-004 7.820886557205174E-004 + 7.919261199769780E-004 8.018873243008710E-004 8.119738251506379E-004 8.221871985625597E-004 + 8.325290403970082E-004 8.430009665878129E-004 8.536046133947459E-004 8.643416376591935E-004 + 8.752137170630423E-004 8.862225503908180E-004 8.973698577951265E-004 9.086573810654287E-004 + 9.200868839001996E-004 9.316601521825118E-004 9.433789942590792E-004 9.552452412228196E-004 + 9.672607471989625E-004 9.794273896347623E-004 9.917470695928533E-004 1.004221712048293E-003 + 1.016853266189346E-003 1.029643705722044E-003 1.042595029178588E-003 1.055709260229617E-003 + 1.068988448000414E-003 1.082434667391085E-003 1.096050019400767E-003 1.109836631455911E-003 + 1.123796657742700E-003 1.137932279543643E-003 1.152245705578407E-003 1.166739172348929E-003 + 1.181414944488879E-003 1.196275315117514E-003 1.211322606197977E-003 1.226559168900113E-003 + 1.241987383967844E-003 1.257609662091163E-003 1.273428444282810E-003 1.289446202259686E-003 + 1.305665438829065E-003 1.322088688279658E-003 1.338718516777604E-003 1.355557522767441E-003 + 1.372608337378114E-003 1.389873624834095E-003 1.407356082871677E-003 1.425058443160495E-003 + 1.442983471730361E-003 1.461133969403458E-003 1.479512772231974E-003 1.498122751941244E-003 + 1.516966816378458E-003 1.536047909967025E-003 1.555369014166638E-003 1.574933147939137E-003 + 1.594743368220229E-003 1.614802770397135E-003 1.635114488792258E-003 1.655681697152920E-003 + 1.676507609147273E-003 1.697595478866437E-003 1.718948601332958E-003 1.740570313015666E-003 + 1.762463992351000E-003 1.784633060270901E-003 1.807080980737333E-003 1.829811261283539E-003 + 1.852827453562101E-003 1.876133153899889E-003 1.899732003859996E-003 1.923627690810742E-003 + 1.947823948501827E-003 1.972324557647745E-003 1.997133346518519E-003 2.022254191537887E-003 + 2.047691017888992E-003 2.073447800127700E-003 2.099528562803642E-003 2.125937381089044E-003 + 2.152678381415497E-003 2.179755742118704E-003 2.207173694091362E-003 2.234936521444254E-003 + 2.263048562175634E-003 2.291514208849063E-003 2.320337909279746E-003 2.349524167229519E-003 + 2.379077543110563E-003 2.409002654697991E-003 2.439304177851370E-003 2.469986847245341E-003 + 2.501055457109421E-003 2.532514861977109E-003 2.564369977444425E-003 2.596625780937968E-003 + 2.629287312492658E-003 2.662359675539253E-003 2.695848037701760E-003 2.729757631604907E-003 + 2.764093755691726E-003 2.798861775051465E-003 2.834067122257884E-003 2.869715298218108E-003 + 2.905811873032162E-003 2.942362486863298E-003 2.979372850819289E-003 3.016848747844802E-003 + 3.054796033624989E-003 3.093220637500463E-003 3.132128563393754E-003 3.171525890747439E-003 + 3.211418775474074E-003 3.251813450918055E-003 3.292716228829612E-003 3.334133500351006E-003 + 3.376071737015178E-003 3.418537491756929E-003 3.461537399936833E-003 3.505078180378032E-003 + 3.549166636416053E-003 3.593809656961849E-003 3.639014217578208E-003 3.684787381569693E-003 + 3.731136301086309E-003 3.778068218241025E-003 3.825590466241382E-003 3.873710470535313E-003 + 3.922435749971386E-003 3.971773917973654E-003 4.021732683731242E-003 4.072319853402942E-003 + 4.123543331336934E-003 4.175411121305859E-003 4.227931327757431E-003 4.281112157080758E-003 + 4.334961918888621E-003 4.389489027315858E-003 4.444702002334093E-003 4.500609471083014E-003 + 4.557220169218352E-003 4.614542942276868E-003 4.672586747058474E-003 4.731360653025756E-003 + 4.790873843721106E-003 4.851135618201646E-003 4.912155392492241E-003 4.973942701056772E-003 + 5.036507198287908E-003 5.099858660015624E-003 5.164006985034717E-003 5.228962196651474E-003 + 5.294734444249865E-003 5.361334004877390E-003 5.428771284850892E-003 5.497056821382577E-003 + 5.566201284226452E-003 5.636215477345513E-003 5.707110340599878E-003 5.778896951456163E-003 + 5.851586526718374E-003 5.925190424280532E-003 5.999720144901377E-003 6.075187334001387E-003 + 6.151603783482396E-003 6.228981433570113E-003 6.307332374679786E-003 6.386668849305372E-003 + 6.467003253932440E-003 6.548348140975149E-003 6.630716220737610E-003 6.714120363399857E-003 + 6.798573601028869E-003 6.884089129614849E-003 6.970680311133112E-003 7.058360675631955E-003 + 7.147143923346712E-003 7.237043926840470E-003 7.328074733171677E-003 7.420250566089018E-003 + 7.513585828253935E-003 7.608095103491025E-003 7.703793159066827E-003 7.800694947997220E-003 + 7.898815611383871E-003 7.998170480780069E-003 8.098775080586295E-003 8.200645130475949E-003 + 8.303796547851581E-003 8.408245450332013E-003 8.514008158270775E-003 8.621101197306151E-003 + 8.729541300943373E-003 8.839345413169258E-003 8.950530691099729E-003 9.063114507660690E-003 + 9.177114454302521E-003 9.292548343748822E-003 9.409434212779672E-003 9.527790325049900E-003 + 9.647635173942869E-003 9.768987485460030E-003 9.891866221146954E-003 1.001629058105609E-002 + 1.014228000674681E-002 1.026985418432322E-002 1.039903304751011E-002 1.052983678076768E-002 + 1.066228582244536E-002 1.079640086797537E-002 1.093220287310646E-002 1.106971305717822E-002 + 1.120895290643666E-002 1.134994417739153E-002 1.149270890021575E-002 1.163726938218773E-002 + 1.178364821117689E-002 1.193186825917306E-002 1.208195268586031E-002 1.223392494223563E-002 + 1.238780877427330E-002 1.254362822663515E-002 1.270140764642761E-002 1.286117168700605E-002 + 1.302294531182682E-002 1.318675379834797E-002 1.335262274197877E-002 1.352057806007912E-002 + 1.369064599600919E-002 1.386285312322997E-002 1.403722634945545E-002 1.421379292085699E-002 + 1.439258042632061E-002 1.457361680175777E-002 1.475693033447044E-002 1.494254966757110E-002 + 1.513050380445817E-002 1.532082211334793E-002 1.551353433186336E-002 1.570867057168066E-002 + 1.590626132323434E-002 1.610633746048131E-002 1.630893024572508E-002 1.651407133450052E-002 + 1.672179278052011E-002 1.693212704068241E-002 1.714510698014350E-002 1.736076587745223E-002 + 1.757913742975007E-002 1.780025575803632E-002 1.802415541249968E-002 1.825087137791667E-002 + 1.848043907911815E-002 1.871289438652449E-002 1.894827362175038E-002 1.918661356328025E-002 + 1.942795145221485E-002 1.967232499809034E-002 1.991977238477044E-002 2.017033227641272E-002 + 2.042404382351008E-002 2.068094666900790E-002 2.094108095449846E-002 2.120448732649312E-002 + 2.147120694277339E-002 2.174128147882201E-002 2.201475313433467E-002 2.229166463981393E-002 + 2.257205926324590E-002 2.285598081686095E-002 2.314347366397951E-002 2.343458272594383E-002 + 2.372935348913711E-002 2.402783201209080E-002 2.433006493268138E-002 2.463609947541760E-002 + 2.494598345881939E-002 2.525976530288962E-002 2.557749403667983E-002 2.589921930595105E-002 + 2.622499138093122E-002 2.655486116416982E-002 2.688888019849161E-002 2.722710067505026E-002 + 2.756957544148334E-002 2.791635801016991E-002 2.826750256659183E-002 2.862306397780047E-002 + 2.898309780098972E-002 2.934766029217691E-002 2.971680841499307E-002 3.009059984958337E-002 + 3.046909300161998E-002 3.085234701142795E-002 3.124042176322601E-002 3.163337789448373E-002 + 3.203127680539607E-002 3.243418066847741E-002 3.284215243827603E-002 3.325525586121099E-002 + 3.367355548553264E-002 3.409711667140827E-002 3.452600560113495E-002 3.496028928948050E-002 + 3.540003559415477E-002 3.584531322641258E-002 3.629619176178988E-002 3.675274165097513E-002 + 3.721503423081739E-002 3.768314173547274E-002 3.815713730769125E-002 3.863709501024538E-002 + 3.912308983750265E-002 3.961519772714357E-002 4.011349557202706E-002 4.061806123220527E-002 + 4.112897354708908E-002 4.164631234776719E-002 4.217015846947970E-002 4.270059376424890E-002 + 4.323770111366882E-002 4.378156444185555E-002 4.433226872856060E-002 4.488990002244918E-002 + 4.545454545454546E-002 4.602629325184703E-002 4.660523275111042E-002 4.719145441281025E-002 + 4.778504983527385E-002 4.838611176899361E-002 4.899473413111963E-002 4.961101202013418E-002 + 5.023504173071128E-002 5.086692076876279E-002 5.150674786667393E-002 5.215462299873057E-002 + 5.281064739674016E-002 5.347492356584960E-002 5.414755530056177E-002 5.482864770095366E-002 + 5.551830718909864E-002 5.621664152569478E-002 5.692375982690296E-002 5.763977258139638E-002 + 5.836479166762461E-002 5.909893037129506E-002 5.984230340307373E-002 6.059502691650925E-002 + 6.135721852618201E-002 6.212899732608165E-002 6.291048390821598E-002 6.370180038145336E-002 + 6.450307039060264E-002 6.531441913573298E-002 6.613597339173642E-002 6.696786152813708E-002 + 6.781021352914868E-002 6.866316101398516E-002 6.952683725742635E-002 7.040137721064242E-002 + 7.128691752228042E-002 7.218359655981564E-002 7.309155443117199E-002 7.401093300661414E-002 + 7.494187594091492E-002 7.588452869580196E-002 7.683903856268599E-002 7.780555468567570E-002 + 7.878422808488166E-002 7.977521168001357E-002 8.077866031427448E-002 8.179473077855497E-002 + 8.282358183593228E-002 8.386537424647732E-002 8.492027079237374E-002 8.598843630335319E-002 + 8.707003768244985E-002 8.816524393207978E-002 8.927422618044766E-002 9.039715770828599E-002 + 9.153421397593077E-002 9.268557265073708E-002 9.385141363484034E-002 9.503191909326623E-002 + 9.622727348239431E-002 9.743766357877998E-002 9.866327850833832E-002 9.990430977589559E-002 + 1.011609512951122E-001 1.024333994187822E-001 1.037218529695138E-001 1.050265132707957E-001 + 1.063475841784542E-001 1.076852721125064E-001 1.090397860894135E-001 1.104113377547404E-001 + 1.118001414162250E-001 1.132064140772651E-001 1.146303754708250E-001 1.160722480937694E-001 + 1.175322572416294E-001 1.190106310438046E-001 1.205076004992094E-001 1.220233995123669E-001 + 1.235582649299566E-001 1.251124365778231E-001 1.266861572984478E-001 1.282796729888954E-001 + 1.298932326392348E-001 1.315270883714437E-001 1.331814954788048E-001 1.348567124657940E-001 + 1.365530010884742E-001 1.382706263953939E-001 1.400098567690014E-001 1.417709639675816E-001 + 1.435542231677168E-001 1.453599130072852E-001 1.471883156289983E-001 1.490397167244852E-001 + 1.509144055789342E-001 1.528126751162923E-001 1.547348219450372E-001 1.566811464045217E-001 + 1.586519526119019E-001 1.606475485096579E-001 1.626682459137082E-001 1.647143605621337E-001 + 1.667862121645112E-001 1.688841244518684E-001 1.710084252272688E-001 1.731594464170301E-001 + 1.753375241225897E-001 1.775429986730207E-001 1.797762146782081E-001 1.820375210826968E-001 + 1.843272712202126E-001 1.866458228688732E-001 1.889935383070914E-001 1.913707843701800E-001 + 1.937779325076737E-001 1.962153588413657E-001 1.986834442240799E-001 2.011825742991790E-001 + 2.037131395608211E-001 2.062755354149776E-001 2.088701622412132E-001 2.114974254552486E-001 + 2.141577355723066E-001 2.168515082712547E-001 2.195791644595584E-001 2.223411303390457E-001 + 2.251378374725052E-001 2.279697228511165E-001 2.308372289627310E-001 2.337408038610133E-001 + 2.366809012354477E-001 2.396579804822314E-001 2.426725067760536E-001 2.457249511427803E-001 + 2.488157905330548E-001 2.519455078968193E-001 2.551145922587797E-001 2.583235387948158E-001 + 2.615728489093514E-001 2.648630303137036E-001 2.681945971054099E-001 2.715680698485601E-001 + 2.749839756551341E-001 2.784428482673630E-001 2.819452281411305E-001 2.854916625304166E-001 + 2.890827055728104E-001 2.927189183760938E-001 2.964008691059142E-001 3.001291330745652E-001 + 3.039042928308760E-001 3.077269382512397E-001 3.115976666317810E-001 3.155170827816834E-001 + 3.194857991176955E-001 3.235044357598180E-001 3.275736206282029E-001 3.316939895412653E-001 + 3.358661863150296E-001 3.400908628637312E-001 3.443686793016749E-001 3.487003040463831E-001 + 3.530864139230354E-001 3.575276942702224E-001 3.620248390470355E-001 3.665785509414943E-001 + 3.711895414803476E-001 3.758585311402488E-001 3.805862494603302E-001 3.853734351561992E-001 + 3.902208362353589E-001 3.951292101140910E-001 4.000993237358006E-001 4.051319536908517E-001 + 4.102278863379150E-001 4.153879179268331E-001 4.206128547230404E-001 4.259035131335425E-001 + 4.312607198344784E-001 4.366853119002960E-001 4.421781369345403E-001 4.477400532022991E-001 + 4.533719297643058E-001 4.590746466127297E-001 4.648490948086823E-001 4.706961766214407E-001 + 4.766168056694350E-001 4.826119070630005E-001 4.886824175489252E-001 4.948292856568249E-001 + 5.010534718473457E-001 5.073559486622439E-001 5.137377008763450E-001 5.201997256514146E-001 + 5.267430326919729E-001 5.333686444030552E-001 5.400775960499725E-001 5.468709359200700E-001 + 5.537497254865215E-001 5.607150395741939E-001 5.677679665275824E-001 5.749096083808737E-001 + 5.821410810301383E-001 5.894635144076878E-001 5.968780526586377E-001 6.043858543196722E-001 + 6.119880925000777E-001 6.196859550650348E-001 6.274806448212316E-001 6.353733797048021E-001 + 6.433653929716276E-001 6.514579333900431E-001 6.596522654359511E-001 6.679496694904065E-001 + 6.763514420396750E-001 6.848588958778087E-001 6.934733603117809E-001 7.021961813691830E-001 + 7.110287220085533E-001 7.199723623323379E-001 7.290284998025307E-001 7.381985494590390E-001 + 7.474839441407756E-001 7.568861347095520E-001 7.664065902767749E-001 7.760467984329936E-001 + 7.858082654803483E-001 7.956925166679223E-001 8.057010964300747E-001 8.158355686277571E-001 + 8.260975167928667E-001 8.364885443756851E-001 8.470102749954098E-001 8.576643526938583E-001 + 8.684524421923485E-001 8.793762291518099E-001 8.904374204361827E-001 9.016377443791060E-001 + 9.129789510539849E-001 9.244628125474376E-001 9.360911232361834E-001 9.478657000674289E-001 + 9.597883828427558E-001 9.718610345056065E-001 9.840855414323670E-001 9.964638137271123E-001 + 1.008997785520076E+000 1.021689415269847E+000 1.034540686069397E+000 1.047553605955936E+000 + 1.060730208224669E+000 1.074072551746511E+000 1.087582721289780E+000 1.101262827845954E+000 + 1.115115008959517E+000 1.129141429061948E+000 1.143344279809927E+000 1.157725780427777E+000 + 1.172288178054230E+000 1.187033748093545E+000 1.201964794571037E+000 1.217083650493098E+000 + 1.232392678211723E+000 1.247894269793641E+000 1.263590847394077E+000 1.279484863635212E+000 + 1.295578801989423E+000 1.311875177167320E+000 1.328376535510679E+000 1.345085455390317E+000 + 1.362004547608956E+000 1.379136455809180E+000 1.396483856886497E+000 1.414049461407621E+000 + 1.431836014033999E+000 1.449846293950659E+000 1.468083115300487E+000 1.486549327623917E+000 + 1.505247816304196E+000 1.524181503018226E+000 1.543353346193071E+000 1.562766341468238E+000 + 1.582423522163730E+000 1.602327959754025E+000 1.622482764347996E+000 1.642891085174861E+000 + 1.663556111076274E+000 1.684481071004573E+000 1.705669234527318E+000 1.727123912338173E+000 + 1.748848456774188E+000 1.770846262339637E+000 1.793120766236389E+000 1.815675448900997E+000 + 1.838513834548520E+000 1.861639491723173E+000 1.885056033855946E+000 1.908767119829182E+000 + 1.932776454548308E+000 1.957087789520725E+000 1.981704923441978E+000 2.006631702789331E+000 + 2.031872022422766E+000 2.057429826193580E+000 2.083309107560614E+000 2.109513910214226E+000 + 2.136048328708152E+000 2.162916509099259E+000 2.190122649595401E+000 2.217671001211384E+000 + 2.245565868433190E+000 2.273811609890582E+000 2.302412639038121E+000 2.331373424844805E+000 + 2.360698492492340E+000 2.390392424082203E+000 2.420459859351622E+000 2.450905496398526E+000 + 2.481734092415647E+000 2.512950464433840E+000 2.544559490074734E+000 2.576566108312903E+000 + 2.608975320247556E+000 2.641792189883999E+000 2.675021844924884E+000 2.708669477571409E+000 + 2.742740345334639E+000 2.777239771856971E+000 2.812173147743995E+000 2.847545931406769E+000 + 2.883363649914697E+000 2.919631899859179E+000 2.956356348228046E+000 2.993542733291077E+000 + 3.031196865496601E+000 3.069324628379370E+000 3.107931979479919E+000 3.147024951275393E+000 + 3.186609652122175E+000 3.226692267210315E+000 3.267279059529958E+000 3.308376370849988E+000 + 3.349990622708902E+000 3.392128317418223E+000 3.434796039078485E+000 3.478000454607995E+000 + 3.521748314784590E+000 3.566046455300416E+000 3.610901797830060E+000 3.656321351112060E+000 + 3.702312212044006E+000 3.748881566791505E+000 3.796036691910967E+000 3.843784955486636E+000 + 3.892133818281848E+000 3.941090834904768E+000 3.990663654988860E+000 4.040860024388106E+000 + 4.091687786387355E+000 4.143154882927838E+000 4.195269355848086E+000 4.248039348140534E+000 + 4.301473105223825E+000 4.355578976231222E+000 4.410365415315156E+000 4.465840982968185E+000 + 4.522014347360634E+000 4.578894285694960E+000 4.636489685577259E+000 4.694809546405948E+000 + 4.753862980777919E+000 4.813659215912455E+000 4.874207595092934E+000 4.935517579126800E+000 + 4.997598747823800E+000 5.060460801492834E+000 5.124113562457697E+000 5.188566976591774E+000 + 5.253831114872167E+000 5.319916174953269E+000 5.386832482760152E+000 5.454590494102071E+000 + 5.523200796306135E+000 5.592674109871661E+000 5.663021290145248E+000 5.734253329016917E+000 + 5.806381356637683E+000 5.879416643158589E+000 5.953370600491755E+000 6.028254784093485E+000 + 6.104080894769797E+000 6.180860780504778E+000 6.258606438311760E+000 6.337330016107962E+000 + 6.417043814612591E+000 6.497760289268819E+000 6.579492052190052E+000 6.662251874130508E+000 + 6.746052686480755E+000 6.830907583288226E+000 6.916829823303164E+000 7.003832832050406E+000 + 7.091930203927050E+000 7.181135704326703E+000 7.271463271790304E+000 7.362927020184016E+000 + 7.455541240904636E+000 7.549320405112550E+000 7.644279165992975E+000 7.740432361045507E+000 + 7.837795014402470E+000 7.936382339176566E+000 8.036209739837838E+000 8.137292814620757E+000 + 8.239647357961426E+000 8.343289362965454E+000 8.448235023907015E+000 8.554500738759113E+000 + 8.662103111755910E+000 8.771058955987117E+000 8.881385296025043E+000 8.993099370584806E+000 + 9.106218635217811E+000 9.220760765039314E+000 9.336743657490153E+000 9.454185435133210E+000 + 9.573104448485216E+000 9.693519278883912E+000 9.815448741391551E+000 9.938911887734735E+000 + 1.006392800928123E+001 1.019051664005442E+001 1.031869755978537E+001 1.044849079700358E+001 + 1.057991663216647E+001 1.071299560082812E+001 1.084774849684818E+001 1.098419637564076E+001 + 1.112236055746456E+001 1.126226263075411E+001 1.140392445549294E+001 1.154736816662942E+001 + 1.169261617753523E+001 1.183969118350758E+001 1.198861616531542E+001 1.213941439279010E+001 + 1.229210942846150E+001 1.244672513123957E+001 1.260328566014245E+001 1.276181547807134E+001 + 1.292233935563277E+001 1.308488237500924E+001 1.324946993387819E+001 1.341612774938056E+001 + 1.358488186213912E+001 1.375575864032727E+001 1.392878478378930E+001 1.410398732821211E+001 + 1.428139364934974E+001 1.446103146730082E+001 1.464292885083984E+001 1.482711422180311E+001 + 1.501361635952949E+001 1.520246440535750E+001 1.539368786717853E+001 1.558731662404747E+001 + 1.578338093085159E+001 1.598191142303767E+001 1.618293912139905E+001 1.638649543692262E+001 + 1.659261217569677E+001 1.680132154388133E+001 1.701265615273964E+001 1.722664902373434E+001 + 1.744333359368692E+001 1.766274372000222E+001 1.788491368595893E+001 1.810987820606618E+001 + 1.833767243148796E+001 1.856833195553548E+001 1.880189281922858E+001 1.903839151692747E+001 + 1.927786500203475E+001 1.952035069276972E+001 1.976588647801494E+001 2.001451072323631E+001 + 2.026626227647807E+001 2.052118047443252E+001 2.077930514858677E+001 2.104067663144635E+001 + 2.130533576283714E+001 2.157332389628695E+001 2.184468290548679E+001 2.211945519083396E+001 + 2.239768368605712E+001 2.267941186492464E+001 2.296468374803770E+001 2.325354390970837E+001 + 2.354603748492464E+001 2.384221017640275E+001 2.414210826172823E+001 2.444577860058715E+001 + 2.475326864208770E+001 2.506462643217449E+001 2.537990062113573E+001 2.569914047120478E+001 + 2.602239586425781E+001 2.634971730960757E+001 2.668115595189586E+001 2.701676357908492E+001 + 2.735659263054919E+001 2.770069620526946E+001 2.804912807012926E+001 2.840194266831640E+001 + 2.875919512782973E+001 2.912094127009277E+001 2.948723761867632E+001 2.985814140812999E+001 + 3.023371059292554E+001 3.061400385651225E+001 3.099908062048616E+001 3.138900105387520E+001 + 3.178382608254026E+001 3.218361739869543E+001 3.258843747054727E+001 3.299834955205552E+001 + 3.341341769281700E+001 3.383370674807305E+001 3.425928238884369E+001 3.469021111218871E+001 + 3.512656025159772E+001 3.556839798751167E+001 3.601579335797555E+001 3.646881626942632E+001 + 3.692753750761563E+001 3.739202874867011E+001 3.786236257029131E+001 3.833861246309561E+001 + 3.882085284209780E+001 3.930915905833826E+001 3.980360741065663E+001 4.030427515761406E+001 + 4.081124052956447E+001 4.132458274087874E+001 4.184438200232186E+001 4.237071953358583E+001 + 4.290367757598090E+001 4.344333940528534E+001 4.398978934475803E+001 4.454311277831383E+001 + 4.510339616386483E+001 4.567072704683008E+001 4.624519407381415E+001 4.682688700645881E+001 + 4.741589673546837E+001 4.801231529481115E+001 4.861623587610064E+001 4.922775284315619E+001 + 4.984696174674811E+001 5.047395933952750E+001 5.110884359114366E+001 5.175171370355278E+001 + 5.240267012651766E+001 5.306181457330388E+001 5.372925003657236E+001 5.440508080447198E+001 + 5.508941247693538E+001 5.578235198217849E+001 5.648400759340890E+001 5.719448894574348E+001 + 5.791390705333882E+001 5.864237432673811E+001 5.938000459043467E+001 6.012691310065807E+001 + 6.088321656338269E+001 6.164903315256311E+001 6.242448252859965E+001 6.320968585703477E+001 + 6.400476582748617E+001 6.480984667281692E+001 6.562505418854684E+001 6.645051575250906E+001 + 6.728636034475211E+001 6.813271856769418E+001 6.898972266652969E+001 6.985750654989238E+001 + 7.073620581077982E+001 7.162595774773901E+001 7.252690138632042E+001 7.343917750080070E+001 + 7.436292863617849E+001 7.529829913044841E+001 7.624543513715288E+001 7.720448464822010E+001 + 7.817559751708747E+001 7.915892548211623E+001 8.015462219030179E+001 8.116284322128031E+001 + 8.218374611163924E+001 8.321749037953238E+001 8.426423754960447E+001 8.532415117823076E+001 + 8.639739687907185E+001 8.748414234895215E+001 8.858455739406249E+001 8.969881395649219E+001 + 9.082708614109640E+001 9.196955024269914E+001 9.312638477364081E+001 9.429777049167060E+001 + 9.548389042818989E+001 9.668492991685221E+001 9.790107662252090E+001 9.913252057059316E+001 + 1.003794541766914E+002 + + + 5.181147531559752E-007 5.246318344710354E-007 5.312308905776035E-007 5.379129525916215E-007 + 5.446790645988750E-007 5.515302838181300E-007 5.584676807663288E-007 5.654923394258587E-007 + 5.726053574139265E-007 5.798078461540652E-007 5.871009310497938E-007 5.944857516604651E-007 + 6.019634618793240E-007 6.095352301138051E-007 6.172022394681011E-007 6.249656879280218E-007 + 6.328267885481837E-007 6.407867696415525E-007 6.488468749713680E-007 6.570083639454874E-007 + 6.652725118131673E-007 6.736406098643256E-007 6.821139656313074E-007 6.906939030931902E-007 + 6.993817628826597E-007 7.081789024954827E-007 7.170866965026219E-007 7.261065367650139E-007 + 7.352398326510501E-007 7.444880112567955E-007 7.538525176289725E-007 7.633348149907539E-007 + 7.729363849703942E-007 7.826587278327370E-007 7.925033627136357E-007 8.024718278573191E-007 + 8.125656808567469E-007 8.227864988969862E-007 8.331358790016495E-007 8.436154382824357E-007 + 8.542268141918024E-007 8.649716647788249E-007 8.758516689482673E-007 8.868685267229160E-007 + 8.980239595092143E-007 9.093197103662298E-007 9.207575442780153E-007 9.323392484293898E-007 + 9.440666324851898E-007 9.559415288730349E-007 9.679657930696443E-007 9.801413038907627E-007 + 9.924699637847271E-007 1.004953699129728E-006 1.017594460534812E-006 1.030394223144668E-006 + 1.043354986948243E-006 1.056478777091251E-006 1.069767644192601E-006 1.083223664664816E-006 + 1.096848941038471E-006 1.110645602290720E-006 1.124615804177953E-006 1.138761729572636E-006 + 1.153085588804394E-006 1.167589620005375E-006 1.182276089459960E-006 1.197147291958883E-006 + 1.212205551157789E-006 1.227453219940315E-006 1.242892680785730E-006 1.258526346141203E-006 + 1.274356658798752E-006 1.290386092276936E-006 1.306617151207350E-006 1.323052371725974E-006 + 1.339694321869451E-006 1.356545601976349E-006 1.373608845093468E-006 1.390886717387263E-006 + 1.408381918560431E-006 1.426097182273749E-006 1.444035276573215E-006 1.462199004322557E-006 + 1.480591203641192E-006 1.499214748347683E-006 1.518072548408779E-006 1.537167550394106E-006 + 1.556502737936573E-006 1.576081132198573E-006 1.595905792344042E-006 1.615979816016459E-006 + 1.636306339822865E-006 1.656888539823959E-006 1.677729632030368E-006 1.698832872905148E-006 + 1.720201559872623E-006 1.741839031833604E-006 1.763748669687107E-006 1.785933896858625E-006 + 1.808398179835038E-006 1.831145028706265E-006 1.854177997713721E-006 1.877500685805672E-006 + 1.901116737199586E-006 1.925029841951541E-006 1.949243736532804E-006 1.973762204413667E-006 + 1.998589076654618E-006 2.023728232504960E-006 2.049183600008938E-006 2.074959156619513E-006 + 2.101058929819848E-006 2.127486997752602E-006 2.154247489857163E-006 2.181344587514866E-006 + 2.208782524702347E-006 2.236565588653116E-006 2.264698120527438E-006 2.293184516090658E-006 + 2.322029226400038E-006 2.351236758500248E-006 2.380811676127602E-006 2.410758600423148E-006 + 2.441082210654739E-006 2.471787244948164E-006 2.502878501027504E-006 2.534360836964774E-006 + 2.566239171939015E-006 2.598518487004928E-006 2.631203825871162E-006 2.664300295688415E-006 + 2.697813067847431E-006 2.731747378787037E-006 2.766108530812365E-006 2.800901892923325E-006 + 2.836132901653533E-006 2.871807061919781E-006 2.907929947882188E-006 2.944507203815185E-006 + 2.981544544989423E-006 3.019047758564816E-006 3.057022704494785E-006 3.095475316441889E-006 + 3.134411602704984E-006 3.173837647158011E-006 3.213759610200630E-006 3.254183729720787E-006 + 3.295116322069398E-006 3.336563783047303E-006 3.378532588904599E-006 3.421029297352591E-006 + 3.464060548588430E-006 3.507633066332671E-006 3.551753658879864E-006 3.596429220162356E-006 + 3.641666730827491E-006 3.687473259328345E-006 3.733855963028189E-006 3.780822089318849E-006 + 3.828378976753107E-006 3.876534056191379E-006 3.925294851962802E-006 3.974668983040915E-006 + 4.024664164234162E-006 4.075288207391306E-006 4.126549022622097E-006 4.178454619533203E-006 + 4.231013108479738E-006 4.284232701832543E-006 4.338121715261342E-006 4.392688569034131E-006 + 4.447941789332826E-006 4.503890009585508E-006 4.560541971815432E-006 4.617906528006938E-006 + 4.675992641488654E-006 4.734809388333983E-006 4.794365958779279E-006 4.854671658659856E-006 + 4.915735910863997E-006 4.977568256805357E-006 5.040178357913783E-006 5.103575997144953E-006 + 5.167771080508991E-006 5.232773638618262E-006 5.298593828254731E-006 5.365241933956938E-006 + 5.432728369626991E-006 5.501063680157780E-006 5.570258543080584E-006 5.640323770233530E-006 + 5.711270309450902E-006 5.783109246273789E-006 5.855851805682244E-006 5.929509353849151E-006 + 6.004093399916281E-006 6.079615597792573E-006 6.156087747975086E-006 6.233521799392891E-006 + 6.311929851274039E-006 6.391324155036173E-006 6.471717116200782E-006 6.553121296331603E-006 + 6.635549414997417E-006 6.719014351759442E-006 6.803529148183876E-006 6.889107009879602E-006 + 6.975761308561613E-006 7.063505584140393E-006 7.152353546837499E-006 7.242319079327880E-006 + 7.333416238909019E-006 7.425659259697432E-006 7.519062554852808E-006 7.613640718830016E-006 + 7.709408529659622E-006 7.806380951256900E-006 7.904573135760011E-006 8.004000425897576E-006 + 8.104678357385942E-006 8.206622661356749E-006 8.309849266814899E-006 8.414374303127500E-006 + 8.520214102544157E-006 8.627385202748832E-006 8.735904349443996E-006 8.845788498967097E-006 + 8.957054820940050E-006 9.069720700952058E-006 9.183803743276066E-006 9.299321773619562E-006 + 9.416292841909805E-006 9.534735225114182E-006 9.654667430096070E-006 9.776108196506468E-006 + 9.899076499712226E-006 1.002359155376089E-005 1.014967281438298E-005 1.027733998203200E-005 + 1.040661300496260E-005 1.053751208234766E-005 1.067005766743432E-005 1.080427047073992E-005 + 1.094017146328803E-005 1.107778187988523E-005 1.121712322243908E-005 1.135821726331786E-005 + 1.150108604875250E-005 1.164575190228140E-005 1.179223742823849E-005 1.194056551528525E-005 + 1.209075933998703E-005 1.224284237043453E-005 1.239683836991067E-005 1.255277140060366E-005 + 1.271066582736682E-005 1.287054632152555E-005 1.303243786473235E-005 1.319636575287021E-005 + 1.336235560000518E-005 1.353043334238857E-005 1.370062524250959E-005 1.387295789319888E-005 + 1.404745822178375E-005 1.422415349429554E-005 1.440307131973008E-005 1.458423965436161E-005 + 1.476768680611099E-005 1.495344143896893E-005 1.514153257747471E-005 1.533198961125141E-005 + 1.552484229959805E-005 1.572012077613954E-005 1.591785555353513E-005 1.611807752824608E-005 + 1.632081798536332E-005 1.652610860349572E-005 1.673398145972005E-005 1.694446903459302E-005 + 1.715760421722642E-005 1.737342031042619E-005 1.759195103589596E-005 1.781323053950619E-005 + 1.803729339662952E-005 1.826417461754322E-005 1.849390965289968E-005 1.872653439926555E-005 + 1.896208520473073E-005 1.920059887458782E-005 1.944211267708297E-005 1.968666434923922E-005 + 1.993429210275286E-005 2.018503462996419E-005 2.043893110990322E-005 2.069602121441150E-005 + 2.095634511434092E-005 2.121994348583047E-005 2.148685751666198E-005 2.175712891269583E-005 + 2.203079990438751E-005 2.230791325338626E-005 2.258851225921666E-005 2.287264076604424E-005 + 2.316034316952627E-005 2.345166442374861E-005 2.374665004824996E-005 2.404534613513427E-005 + 2.434779935627284E-005 2.465405697059681E-005 2.496416683148149E-005 2.527817739422359E-005 + 2.559613772361240E-005 2.591809750159625E-005 2.624410703504553E-005 2.657421726361306E-005 + 2.690847976769371E-005 2.724694677648379E-005 2.758967117614203E-005 2.793670651805318E-005 + 2.828810702719543E-005 2.864392761061328E-005 2.900422386599683E-005 2.936905209036899E-005 + 2.973846928888204E-005 3.011253318372489E-005 3.049130222314212E-005 3.087483559056676E-005 + 3.126319321386777E-005 3.165643577471386E-005 3.205462471805531E-005 3.245782226172460E-005 + 3.286609140615823E-005 3.327949594424066E-005 3.369810047127200E-005 3.412197039506133E-005 + 3.455117194614658E-005 3.498577218814332E-005 3.542583902822355E-005 3.587144122772635E-005 + 3.632264841290203E-005 3.677953108579122E-005 3.724216063524112E-005 3.771060934806003E-005 + 3.818495042031236E-005 3.866525796875580E-005 3.915160704242192E-005 3.964407363434300E-005 + 4.014273469342593E-005 4.064766813647569E-005 4.115895286037015E-005 4.167666875438758E-005 + 4.220089671268972E-005 4.273171864696161E-005 4.326921749921042E-005 4.381347725472541E-005 + 4.436458295520066E-005 4.492262071202312E-005 4.548767771972761E-005 4.605984226962116E-005 + 4.663920376357886E-005 4.722585272801282E-005 4.781988082801728E-005 4.842138088169141E-005 + 4.903044687464234E-005 4.964717397467068E-005 5.027165854664053E-005 5.090399816753677E-005 + 5.154429164171168E-005 5.219263901632324E-005 5.284914159696790E-005 5.351390196350948E-005 + 5.418702398610776E-005 5.486861284144823E-005 5.555877502917616E-005 5.625761838853768E-005 + 5.696525211522940E-005 5.768178677846085E-005 5.840733433823093E-005 5.914200816282196E-005 + 5.988592304651383E-005 6.063919522752057E-005 6.140194240615302E-005 6.217428376320966E-005 + 6.295633997859885E-005 6.374823325019531E-005 6.455008731293397E-005 6.536202745814343E-005 + 6.618418055312332E-005 6.701667506096738E-005 6.785964106063615E-005 6.871321026728221E-005 + 6.957751605283065E-005 7.045269346681892E-005 7.133887925749847E-005 7.223621189320204E-005 + 7.314483158397969E-005 7.406488030350666E-005 7.499650181126721E-005 7.593984167501734E-005 + 7.689504729352995E-005 7.786226791962642E-005 7.884165468349733E-005 7.983336061631716E-005 + 8.083754067415551E-005 8.185435176218937E-005 8.288395275922012E-005 8.392650454249822E-005 + 8.498217001286087E-005 8.605111412018561E-005 8.713350388916391E-005 8.822950844539944E-005 + 8.933929904183390E-005 9.046304908550589E-005 9.160093416464596E-005 9.275313207611274E-005 + 9.391982285317420E-005 9.510118879363782E-005 9.629741448833534E-005 9.750868684996525E-005 + 9.873519514229839E-005 9.997713100975087E-005 1.012346885073287E-004 1.025080641309494E-004 + 1.037974568481448E-004 1.051030681291502E-004 1.064251019783847E-004 1.077637649663269E-004 + 1.091192662617922E-004 1.104918176646157E-004 1.118816336387466E-004 1.132889313457586E-004 + 1.147139306787815E-004 1.161568542968603E-004 1.176179276597459E-004 1.190973790631237E-004 + 1.205954396742859E-004 1.221123435682504E-004 1.236483277643369E-004 1.252036322632011E-004 + 1.267785000843351E-004 1.283731773040403E-004 1.299879130938764E-004 1.316229597595960E-004 + 1.332785727805669E-004 1.349550108496921E-004 1.366525359138308E-004 1.383714132147277E-004 + 1.401119113304583E-004 1.418743022173942E-004 1.436588612526969E-004 1.454658672773466E-004 + 1.472956026397111E-004 1.491483532396633E-004 1.510244085732539E-004 1.529240617779454E-004 + 1.548476096784163E-004 1.567953528329393E-004 1.587675955803451E-004 1.607646460875756E-004 + 1.627868163978353E-004 1.648344224793497E-004 1.669077842747346E-004 1.690072257509891E-004 + 1.711330749501150E-004 1.732856640403746E-004 1.754653293681931E-004 1.776724115107124E-004 + 1.799072553290076E-004 1.821702100219721E-004 1.844616291808805E-004 1.867818708446387E-004 + 1.891312975557271E-004 1.915102764168491E-004 1.939191791482920E-004 1.963583821460082E-004 + 1.988282665404292E-004 2.013292182560164E-004 2.038616280715635E-004 2.064258916812565E-004 + 2.090224097565013E-004 2.116515880085301E-004 2.143138372517938E-004 2.170095734681529E-004 + 2.197392178718759E-004 2.225031969754540E-004 2.253019426562460E-004 2.281358922239584E-004 + 2.310054884889769E-004 2.339111798315561E-004 2.368534202718798E-004 2.398326695410031E-004 + 2.428493931526857E-004 2.459040624761293E-004 2.489971548096305E-004 2.521291534551590E-004 + 2.553005477938759E-004 2.585118333625987E-004 2.617635119312307E-004 2.650560915811640E-004 + 2.683900867846674E-004 2.717660184852751E-004 2.751844141791833E-004 2.786458079976741E-004 + 2.821507407905738E-004 2.856997602107619E-004 2.892934207997439E-004 2.929322840742979E-004 + 2.966169186142139E-004 3.003479001511351E-004 3.041258116585172E-004 3.079512434427201E-004 + 3.118247932352424E-004 3.157470662861203E-004 3.197186754584978E-004 3.237402413243881E-004 + 3.278123922616402E-004 3.319357645521228E-004 3.361110024811452E-004 3.403387584381283E-004 + 3.446196930185418E-004 3.489544751271238E-004 3.533437820823979E-004 3.577882997225059E-004 + 3.622887225123715E-004 3.668457536522114E-004 3.714601051874134E-004 3.761324981197922E-004 + 3.808636625202498E-004 3.856543376428494E-004 3.905052720403251E-004 3.954172236810467E-004 + 4.003909600674509E-004 4.054272583559676E-004 4.105269054784504E-004 4.156906982651374E-004 + 4.209194435691580E-004 4.262139583926034E-004 4.315750700141870E-004 4.370036161185063E-004 + 4.425004449269347E-004 4.480664153301573E-004 4.537023970223735E-004 4.594092706371892E-004 + 4.651879278852174E-004 4.710392716934093E-004 4.769642163461406E-004 4.829636876280673E-004 + 4.890386229687831E-004 4.951899715892946E-004 5.014186946503383E-004 5.077257654025659E-004 + 5.141121693386135E-004 5.205789043470899E-004 5.271269808684963E-004 5.337574220531113E-004 + 5.404712639208603E-004 5.472695555231945E-004 5.541533591070075E-004 5.611237502806148E-004 + 5.681818181818183E-004 5.753286656480879E-004 5.825654093888803E-004 5.898931801601282E-004 + 5.973131229409232E-004 6.048263971124201E-004 6.124341766389953E-004 6.201376502516774E-004 + 6.279380216338911E-004 6.358365096095349E-004 6.438343483334241E-004 6.519327874841322E-004 + 6.601330924592520E-004 6.684365445731200E-004 6.768444412570221E-004 6.853580962619208E-004 + 6.939788398637331E-004 7.027080190711849E-004 7.115469978362871E-004 7.204971572674548E-004 + 7.295598958453076E-004 7.387366296411883E-004 7.480287925384216E-004 7.574378364563657E-004 + 7.669652315772751E-004 7.766124665760207E-004 7.863810488526997E-004 7.962725047681670E-004 + 8.062883798825330E-004 8.164302391966623E-004 8.266996673967054E-004 8.370982691017136E-004 + 8.476276691143585E-004 8.582895126748145E-004 8.690854657178294E-004 8.800172151330303E-004 + 8.910864690285053E-004 9.022949569976956E-004 9.136444303896499E-004 9.251366625826768E-004 + 9.367734492614365E-004 9.485566086975246E-004 9.604879820335750E-004 9.725694335709462E-004 + 9.848028510610208E-004 9.971901460001696E-004 1.009733253928431E-003 1.022434134731937E-003 + 1.035294772949153E-003 1.048317178080966E-003 1.061503384904672E-003 1.074855453791915E-003 + 1.088375471030623E-003 1.102065549150997E-003 1.115927827255596E-003 1.129964471353575E-003 + 1.144177674699135E-003 1.158569658134213E-003 1.173142670435504E-003 1.187898988665828E-003 + 1.202840918529929E-003 1.217970794734750E-003 1.233290981354229E-003 1.248803872198695E-003 + 1.264511891188903E-003 1.280417492734778E-003 1.296523162118923E-003 1.312831415884946E-003 + 1.329344802230677E-003 1.346065901406330E-003 1.362997326117669E-003 1.380141721934255E-003 + 1.397501767702813E-003 1.415080175965814E-003 1.432879693385312E-003 1.450903101172117E-003 + 1.469153215520368E-003 1.487632888047558E-003 1.506345006240118E-003 1.525292493904587E-003 + 1.544478311624458E-003 1.563905457222788E-003 1.583576966230597E-003 1.603495912361193E-003 + 1.623665407990435E-003 1.644088604643046E-003 1.664768693485060E-003 1.685708905822425E-003 + 1.706912513605927E-003 1.728382829942424E-003 1.750123209612518E-003 1.772137049594770E-003 + 1.794427789596460E-003 1.816998912591065E-003 1.839853945362479E-003 1.862996459056064E-003 + 1.886430069736677E-003 1.910158438953654E-003 1.934185274312965E-003 1.958514330056521E-003 + 1.983149407648774E-003 2.008094356370723E-003 2.033353073921353E-003 2.058929507026671E-003 + 2.084827652056390E-003 2.111051555648355E-003 2.137605315340861E-003 2.164493080212876E-003 + 2.191719051532371E-003 2.219287483412759E-003 2.247202683477601E-003 2.275469013533710E-003 + 2.304090890252657E-003 2.333072785860916E-003 2.362419228838643E-003 2.392134804627250E-003 + 2.422224156345922E-003 2.452691985517071E-003 2.483543052800998E-003 2.514782178739738E-003 + 2.546414244510264E-003 2.578444192687220E-003 2.610877028015165E-003 2.643717818190608E-003 + 2.676971694653832E-003 2.710643853390683E-003 2.744739555744479E-003 2.779264129238072E-003 + 2.814222968406315E-003 2.849621535638956E-003 2.885465362034137E-003 2.921760048262666E-003 + 2.958511265443097E-003 2.995724756027892E-003 3.033406334700671E-003 3.071561889284754E-003 + 3.110197381663185E-003 3.149318848710241E-003 3.188932403234747E-003 3.229044234935198E-003 + 3.269660611366893E-003 3.310787878921295E-003 3.352432463817624E-003 3.394600873107001E-003 + 3.437299695689176E-003 3.480535603342038E-003 3.524315351764132E-003 3.568645781630208E-003 + 3.613533819660130E-003 3.658986479701173E-003 3.705010863823927E-003 3.751614163432065E-003 + 3.798803660385950E-003 3.846586728140497E-003 3.894970832897263E-003 3.943963534771043E-003 + 3.993572488971193E-003 4.043805446997725E-003 4.094670257852537E-003 4.146174869265817E-003 + 4.198327328937870E-003 4.251135785796640E-003 4.304608491270937E-003 4.358753800579789E-003 + 4.413580174037942E-003 4.469096178377779E-003 4.525310488087944E-003 4.582231886768679E-003 + 4.639869268504344E-003 4.698231639253110E-003 4.757328118254128E-003 4.817167939452490E-003 + 4.877760452941987E-003 4.939115126426138E-003 5.001241546697508E-003 5.064149421135647E-003 + 5.127848579223938E-003 5.192348974085414E-003 5.257660684038006E-003 5.323793914169282E-003 + 5.390758997930981E-003 5.458566398753700E-003 5.527226711681755E-003 5.596750665028739E-003 + 5.667149122053823E-003 5.738433082659122E-003 5.810613685108528E-003 5.883702207768009E-003 + 5.957710070867938E-003 6.032648838287507E-003 6.108530219361565E-003 6.185366070710312E-003 + 6.263168398091822E-003 6.341949358278049E-003 6.421721260954312E-003 6.502496570642682E-003 + 6.584287908649661E-003 6.667108055038191E-003 6.750969950624657E-003 6.835886699000875E-003 + 6.921871568581518E-003 7.008937994677424E-003 7.097099581594781E-003 7.186370104760921E-003 + 7.276763512876729E-003 7.368293930096099E-003 7.460975658232971E-003 7.554823178995903E-003 + 7.649851156250971E-003 7.746074438312935E-003 7.843508060265394E-003 7.942167246310026E-003 + 8.042067412145346E-003 8.143224167375540E-003 8.245653317949389E-003 8.349370868630081E-003 + 8.454393025495938E-003 8.560736198472609E-003 8.668417003897260E-003 8.777452267114788E-003 + 8.887859025106916E-003 8.999654529154223E-003 9.112856247531635E-003 9.227481868237988E-003 + 9.343549301759695E-003 9.461076683869401E-003 9.580082378459687E-003 9.700584980412421E-003 + 9.822603318504354E-003 9.946156458349030E-003 1.007126370537594E-002 1.019794460784696E-002 + 1.032621895991083E-002 1.045610680469606E-002 1.058762843744262E-002 1.072080440867323E-002 + 1.085565552740436E-002 1.099220286439762E-002 1.113046775545228E-002 1.127047180473883E-002 + 1.141223688817481E-002 1.155578515684297E-002 1.170113904045229E-002 1.184832125084286E-002 + 1.199735478553445E-002 1.214826293132008E-002 1.230106926790459E-002 1.245579767158891E-002 + 1.261247231900095E-002 1.277111769087308E-002 1.293175857586746E-002 1.309442007444921E-002 + 1.325912760280837E-002 1.342590689683139E-002 1.359478401612224E-002 1.376578534807442E-002 + 1.393893761199396E-002 1.411426786327435E-002 1.429180349762409E-002 1.447157225534721E-002 + 1.465360222567788E-002 1.483792185116931E-002 1.502455993213796E-002 1.521354563116373E-002 + 1.540490847764654E-002 1.559867837242051E-002 1.579488559242596E-002 1.599356079544014E-002 + 1.619473502486779E-002 1.639843971459150E-002 1.660470669388349E-002 1.681356819237897E-002 + 1.702505684511195E-002 1.723920569761475E-002 1.745604821108121E-002 1.767561826759526E-002 + 1.789795017542498E-002 1.812307867438324E-002 1.835103894125609E-002 1.858186659529896E-002 + 1.881559770380245E-002 1.905226878772782E-002 1.929191682741338E-002 1.953457926835297E-002 + 1.978029402704662E-002 2.002909949692531E-002 2.028103455434995E-002 2.053613856468576E-002 + 2.079445138845343E-002 2.105601338755716E-002 2.132086543159148E-002 2.158904890422716E-002 + 2.186060570967735E-002 2.213557827924547E-002 2.241400957795486E-002 2.269594311126246E-002 + 2.298142293185650E-002 2.327049364653966E-002 2.356320042319933E-002 2.385958899786478E-002 + 2.415970568185385E-002 2.446359736900907E-002 2.477131154302472E-002 2.508289628486664E-002 + 2.539840028028458E-002 2.571787282741975E-002 2.604136384450768E-002 2.636892387767783E-002 + 2.670060410885191E-002 2.703645636374074E-002 2.737653311994251E-002 2.772088751514231E-002 + 2.806957335541488E-002 2.842264512363228E-002 2.878015798797651E-002 2.914216781056006E-002 + 2.950873115615426E-002 2.987990530102753E-002 3.025574824189528E-002 3.063631870498158E-002 + 3.102167615519559E-002 3.141188080542300E-002 3.180699362593418E-002 3.220707635391129E-002 + 3.261219150309445E-002 3.302240237355000E-002 3.343777306156106E-002 3.385836846964261E-002 + 3.428425431668299E-002 3.471549714821214E-002 3.515216434679994E-002 3.559432414258461E-002 + 3.604204562393372E-002 3.649539874823975E-002 3.695445435285057E-002 3.741928416613847E-002 + 3.788996081870751E-002 3.836655785474213E-002 3.884914974349899E-002 3.933781189094241E-002 + 3.983262065152719E-002 4.033365334012894E-002 4.084098824412447E-002 4.135470463562486E-002 + 4.187488278386128E-002 4.240160396772780E-002 4.293495048848107E-002 4.347500568259994E-002 + 4.402185393480737E-002 4.457558069125520E-002 4.513627247287576E-002 4.570401688890074E-002 + 4.627890265055008E-002 4.686101958489382E-002 4.745045864888709E-002 4.804731194358296E-002 + 4.865167272852311E-002 4.926363543630961E-002 4.988329568736075E-002 5.051075030485133E-002 + 5.114609732984193E-002 5.178943603659798E-002 5.244086694810107E-002 5.310049185175667E-002 + 5.376841381529782E-002 5.444473720289027E-002 5.512956769143945E-002 5.582301228710232E-002 + 5.652517934200793E-002 5.723617857118701E-002 5.795612106971574E-002 5.868511933007436E-002 + 5.942328725972399E-002 6.017074019890570E-002 6.092759493866168E-002 6.169396973908500E-002 + 6.246998434779751E-002 6.325576001866043E-002 6.405141953072122E-002 6.485708720739718E-002 + 6.567288893590209E-002 6.649895218691586E-002 6.733540603450190E-002 6.818238117627588E-002 + 6.904000995382668E-002 6.990842637339577E-002 7.078776612681560E-002 7.167816661271147E-002 + 7.257976695797104E-002 7.349270803948237E-002 7.441713250614694E-002 7.535318480116857E-002 + 7.630101118462246E-002 7.726075975630974E-002 7.823258047889700E-002 7.921662520134953E-002 + 8.021304768265740E-002 8.122200361586024E-002 8.224365065237565E-002 8.327814842663135E-002 + 8.432565858100943E-002 8.538634479110284E-002 8.646037279128956E-002 8.754791040063008E-002 + 8.864912754908813E-002 8.976419630408379E-002 9.089329089737880E-002 9.203658775230021E-002 + 9.319426551130795E-002 9.436650506390688E-002 9.555348957491219E-002 9.675540451306884E-002 + 9.797243768003089E-002 9.920477923970708E-002 1.004526217479730E-001 1.017161601827595E-001 + 1.029955919745178E-001 1.042911170370682E-001 1.056029377988377E-001 1.069312592344889E-001 + 1.082762888969489E-001 1.096382369498390E-001 1.110173162003130E-001 1.124137421323101E-001 + 1.138277329402226E-001 1.152595095629914E-001 1.167092957186269E-001 1.181773179391651E-001 + 1.196638056060652E-001 1.211689909860489E-001 1.226931092673944E-001 1.242363985966842E-001 + 1.257991001160154E-001 1.273814580006803E-001 1.289837194973171E-001 1.306061349625448E-001 + 1.322489579020809E-001 1.339124450103515E-001 1.355968562106022E-001 1.373024546955095E-001 + 1.390295069683070E-001 1.407782828844263E-001 1.425490556936617E-001 1.443421020828678E-001 + 1.461577022191903E-001 1.479961397938448E-001 1.498577020664427E-001 1.517426799098762E-001 + 1.536513678557687E-001 1.555840641404946E-001 1.575410707517807E-001 1.595226934758918E-001 + 1.615292419454096E-001 1.635610296876155E-001 1.656183741734774E-001 1.677015968672570E-001 + 1.698110232767390E-001 1.719469830040908E-001 1.741098097973662E-001 1.762998416026514E-001 + 1.785174206168717E-001 1.807628933412603E-001 1.830366106354980E-001 1.853389277725388E-001 + 1.876702044941187E-001 1.900308050669688E-001 1.924210983397316E-001 1.948414578005934E-001 + 1.972922616356449E-001 1.997738927879709E-001 2.022867390174881E-001 2.048311929615328E-001 + 2.074076521962096E-001 2.100165192985166E-001 2.126582019092456E-001 2.153331127966793E-001 + 2.180416699210865E-001 2.207842965000277E-001 2.235614210744866E-001 2.263734775758273E-001 + 2.292209053935995E-001 2.321041494441935E-001 2.350236602403573E-001 2.379798939615934E-001 + 2.409733125254344E-001 2.440043836596216E-001 2.470735809751867E-001 2.501813840404539E-001 + 2.533282784559759E-001 2.565147559304066E-001 2.597413143573347E-001 2.630084578930793E-001 + 2.663166970354642E-001 2.696665487035869E-001 2.730585363185848E-001 2.764931898854245E-001 + 2.799710460757140E-001 2.834926483115580E-001 2.870585468504713E-001 2.906692988713547E-001 + 2.943254685615579E-001 2.980276272050343E-001 3.017763532716029E-001 3.055722325073394E-001 + 3.094158580260963E-001 3.133078304021811E-001 3.172487577641966E-001 3.212392558900598E-001 + 3.252799483032227E-001 3.293714663700946E-001 3.335144493986982E-001 3.377095447385615E-001 + 3.419574078818649E-001 3.462587025658683E-001 3.506141008766157E-001 3.550242833539551E-001 + 3.594899390978716E-001 3.640117658761596E-001 3.685904702334540E-001 3.732267676016249E-001 + 3.779213824115693E-001 3.826750482064031E-001 3.874885077560770E-001 3.923625131734400E-001 + 3.972978260317533E-001 4.022952174836928E-001 4.073554683818409E-001 4.124793694006940E-001 + 4.176677211602125E-001 4.229213343509131E-001 4.282410298605462E-001 4.336276389023589E-001 + 4.390820031449716E-001 4.446049748438958E-001 4.501974169746943E-001 4.558602033678290E-001 + 4.615942188451954E-001 4.674003593583764E-001 4.732795321286414E-001 4.792326557886952E-001 + 4.852606605262225E-001 4.913644882292283E-001 4.975450926332079E-001 5.038034394701757E-001 + 5.101405066195559E-001 5.165572842609842E-001 5.230547750290233E-001 5.296339941698229E-001 + 5.362959696997612E-001 5.430417425660669E-001 5.498723668094754E-001 5.567889097289228E-001 + 5.637924520483104E-001 5.708840880853761E-001 5.780649259226769E-001 5.853360875807352E-001 + 5.926987091933545E-001 6.001539411851393E-001 6.077029484512581E-001 6.153469105394525E-001 + 6.230870218343515E-001 6.309244917440938E-001 6.388605448892958E-001 6.468964212944098E-001 + 6.550333765814709E-001 6.632726821662985E-001 6.716156254571546E-001 6.800635100558998E-001 + 6.886176559616923E-001 6.972793997772312E-001 7.060500949176114E-001 7.149311118217936E-001 + 7.239238381667352E-001 7.330296790842263E-001 7.422500573804335E-001 7.515864137582259E-001 + 7.610402070422837E-001 7.706129144070388E-001 7.803060316074957E-001 7.901210732129347E-001 + 8.000595728435771E-001 8.101230834102116E-001 8.203131773568355E-001 8.306314469063634E-001 + 8.410795043094015E-001 8.516589820961773E-001 8.623715333316211E-001 8.732188318736548E-001 + 8.842025726347478E-001 8.953244718467377E-001 9.065862673290053E-001 9.179897187600088E-001 + 9.295366079522313E-001 9.412287391306052E-001 9.530679392144110E-001 9.650560581027513E-001 + 9.771949689635934E-001 9.894865685264529E-001 1.001932777378773E+000 1.014535540266004E+000 + 1.027296826395490E+000 1.040218629744155E+000 1.053302969370056E+000 1.066551889727885E+000 + 1.079967460988398E+000 1.093551779361902E+000 1.107306967425781E+000 1.121235174456152E+000 + 1.135338576763705E+000 1.149619378033739E+000 1.164079809670510E+000 1.178722131145883E+000 + 1.193548630352374E+000 1.208561623960653E+000 1.223763457781511E+000 1.239156507132415E+000 + 1.254743177208643E+000 + + + +-8.055763997176067E+000 -8.055770284309713E+000 -8.055776492429622E+000 -8.055782635699529E+000 +-8.055788727947256E+000 -8.055794782674921E+000 -8.055800813068915E+000 -8.055806832009555E+000 +-8.055812852080628E+000 -8.055818885578557E+000 -8.055824944521502E+000 -8.055831040658109E+000 +-8.055837185476090E+000 -8.055843390210656E+000 -8.055849665852616E+000 -8.055856023156451E+000 +-8.055862472648020E+000 -8.055869024632218E+000 -8.055875786323492E+000 -8.055880957778051E+000 +-8.055888255781426E+000 -8.055895738521572E+000 -8.055903410670915E+000 -8.055910500770020E+000 +-8.055918539459865E+000 -8.055926781636328E+000 -8.055933732892964E+000 -8.055942349812213E+000 +-8.055950325494775E+000 -8.055959355757739E+000 -8.055968614612315E+000 -8.055978107831075E+000 +-8.055986179639502E+000 -8.055995168393409E+000 -8.056005318409786E+000 -8.056015725356234E+000 +-8.056026395736705E+000 -8.056037336209732E+000 -8.056048553646777E+000 -8.056058894372564E+000 +-8.056068833223367E+000 -8.056080833725485E+000 -8.056093138001685E+000 -8.056105753715398E+000 +-8.056117441014869E+000 -8.056130666119138E+000 -8.056144226003958E+000 -8.056158129121872E+000 +-8.056170305625850E+000 -8.056184861610710E+000 -8.056199786048646E+000 -8.056213683567924E+000 +-8.056229332270723E+000 -8.056245377066464E+000 -8.056261828013028E+000 -8.056278695363121E+000 +-8.056295989662575E+000 -8.056311308702368E+000 -8.056327864385674E+000 -8.056346391794886E+000 +-8.056365388132622E+000 -8.056384865284496E+000 -8.056404835451019E+000 -8.056425311078010E+000 +-8.056446304991262E+000 -8.056467830309144E+000 -8.056487907759434E+000 -8.056507895677100E+000 +-8.056530969665275E+000 -8.056554627684640E+000 -8.056578884478045E+000 -8.056603755293423E+000 +-8.056629255618120E+000 -8.056655401351431E+000 -8.056682208838909E+000 -8.056707410160820E+000 +-8.056735529717889E+000 -8.056764361012098E+000 -8.056790882686061E+000 -8.056821110249331E+000 +-8.056852102862885E+000 -8.056883879887504E+000 -8.056916461128914E+000 -8.056949866915932E+000 +-8.056984118184808E+000 -8.057016599280104E+000 -8.057052535669714E+000 -8.057089381609739E+000 +-8.057127160017028E+000 -8.057165894591595E+000 -8.057205609523860E+000 -8.057242640425351E+000 +-8.057284293501564E+000 -8.057327000676521E+000 -8.057370788686713E+000 -8.057415684877620E+000 +-8.057461717355382E+000 -8.057505785038199E+000 -8.057554094432188E+000 -8.057603626444243E+000 +-8.057654411877275E+000 -8.057706482613458E+000 -8.057759871039002E+000 -8.057814610384508E+000 +-8.057870735043476E+000 -8.057928279948472E+000 -8.057982683490884E+000 -8.058043057792286E+000 +-8.058104959800618E+000 -8.058168428333472E+000 -8.058233502925214E+000 -8.058296436538917E+000 +-8.058364747390039E+000 -8.058434786724661E+000 -8.058506598313222E+000 -8.058580226852049E+000 +-8.058655718449852E+000 -8.058733120136056E+000 -8.058812480225988E+000 -8.058893848111486E+000 +-8.058977274619835E+000 -8.059062812079844E+000 -8.059150513641377E+000 -8.059240434059731E+000 +-8.059326640760066E+000 -8.059421014408453E+000 -8.059517775584620E+000 -8.059616984609740E+000 +-8.059713970819615E+000 -8.059818141275054E+000 -8.059924946909756E+000 -8.060034454468992E+000 +-8.060146732311573E+000 -8.060261850223874E+000 -8.060379880192535E+000 -8.060500896061528E+000 +-8.060624972962115E+000 -8.060752188255508E+000 -8.060882621167975E+000 -8.061016353115519E+000 +-8.061153467519699E+000 -8.061294049874293E+000 -8.061438187631106E+000 -8.061585970307490E+000 +-8.061737490543710E+000 -8.061892842564001E+000 -8.062052123528531E+000 -8.062215432190490E+000 +-8.062374189862231E+000 -8.062545640463858E+000 -8.062721426199841E+000 -8.062895228648394E+000 +-8.063079852403906E+000 -8.063269143457623E+000 -8.063463220918580E+000 -8.063662204772562E+000 +-8.063866219317672E+000 -8.064075391177889E+000 -8.064289850739073E+000 -8.064509732280227E+000 +-8.064735171773075E+000 -8.064966309937615E+000 -8.065203290314615E+000 -8.065446260261675E+000 +-8.065695371711440E+000 -8.065950778541785E+000 -8.066212639833262E+000 -8.066481118564878E+000 +-8.066756381733775E+000 -8.067038601130049E+000 -8.067327950949036E+000 -8.067624611486217E+000 +-8.067928767528162E+000 -8.068240607572196E+000 -8.068560325735179E+000 -8.068888119750081E+000 +-8.069224193565931E+000 -8.069568756496652E+000 -8.069922021563270E+000 -8.070284208511229E+000 +-8.070655541813448E+000 -8.071021532602344E+000 -8.071411484398544E+000 -8.071801593504279E+000 +-8.072211240020287E+000 -8.072631228099416E+000 -8.073061817288547E+000 -8.073503274954508E+000 +-8.073955874826144E+000 -8.074419898489086E+000 -8.074895632888396E+000 -8.075383373490329E+000 +-8.075883421439244E+000 -8.076396085580267E+000 -8.076921683239625E+000 -8.077460538145028E+000 +-8.078012984847202E+000 -8.078579364997298E+000 -8.079160029020674E+000 -8.079755336795762E+000 +-8.080365654433058E+000 -8.080991359586786E+000 -8.081632838110316E+000 -8.082290485742513E+000 +-8.082964709863244E+000 -8.083655924511158E+000 -8.084364557667751E+000 -8.085091045056265E+000 +-8.085835833756622E+000 -8.086599383809606E+000 -8.087382162550190E+000 -8.088184654604019E+000 +-8.089007352446467E+000 -8.089850761932739E+000 -8.090715403748630E+000 -8.091601805291555E+000 +-8.092510513735032E+000 -8.093442085943190E+000 -8.094397093433292E+000 -8.095376123977836E+000 +-8.096379775117413E+000 -8.097408664753631E+000 -8.098463421062721E+000 -8.099544689881078E+000 +-8.100653134946418E+000 -8.101789430066635E+000 -8.102954272797557E+000 -8.104148373834290E+000 +-8.105372459673982E+000 -8.106627280333120E+000 -8.107913597625009E+000 -8.109232197273366E+000 +-8.110583883165772E+000 -8.111969476920121E+000 -8.113389822905420E+000 -8.114845782571308E+000 +-8.116338238784705E+000 -8.117829060810639E+000 -8.119377002329319E+000 -8.120982993986647E+000 +-8.122629203183749E+000 -8.124316622092209E+000 -8.126046275105020E+000 -8.127819205572635E+000 +-8.129636481926894E+000 -8.131499202987589E+000 -8.133408490544179E+000 -8.135365489314340E+000 +-8.137371375974858E+000 -8.139427360173787E+000 -8.141534674271369E+000 -8.143694575809402E+000 +-8.145908358447567E+000 -8.148177346789625E+000 -8.150502898291913E+000 -8.152886403238590E+000 +-8.155329278444805E+000 -8.157832974116241E+000 -8.160398976944085E+000 -8.163028814842614E+000 +-8.165724049308198E+000 -8.168486268949763E+000 -8.171317111652971E+000 -8.174218250030080E+000 +-8.177191387248904E+000 -8.180238278474086E+000 -8.183360716494732E+000 -8.186560529076685E+000 +-8.189839588679295E+000 -8.193199815802563E+000 -8.196643172365874E+000 -8.200171661336041E+000 +-8.203787337651940E+000 -8.207492300236769E+000 -8.211288694737762E+000 -8.215178718842028E+000 +-8.219164619073441E+000 -8.223248690376231E+000 -8.227433274793011E+000 -8.231720775396150E+000 +-8.236113651131189E+000 -8.240614405874723E+000 -8.245225599249371E+000 -8.249949858001004E+000 +-8.254789858269049E+000 -8.259748327964488E+000 -8.264828070950657E+000 -8.270031945861543E+000 +-8.275362866667468E+000 -8.280823815869118E+000 -8.286417835442942E+000 -8.292148035815851E+000 +-8.298017597013043E+000 -8.304029759439384E+000 -8.310187832017403E+000 -8.316495196182933E+000 +-8.322955297073989E+000 -8.329571655433446E+000 -8.336347872601282E+000 -8.343287608214913E+000 +-8.350394597949697E+000 -8.357672666964801E+000 -8.365125706307957E+000 -8.372757676359193E+000 +-8.380572622239905E+000 -8.388574675345637E+000 -8.396768041685609E+000 -8.405157001499553E+000 +-8.413745923823019E+000 -8.422539260238848E+000 -8.431541537387577E+000 -8.440757367797755E+000 +-8.450191455804575E+000 -8.459848590108230E+000 -8.469733636165621E+000 -8.479851545155800E+000 +-8.490207364594411E+000 -8.500806226203718E+000 -8.511653339085720E+000 -8.522754007688111E+000 +-8.534113626226135E+000 -8.545737669716848E+000 -8.557631708247664E+000 -8.569801394607762E+000 +-8.582252465177573E+000 -8.594990749899655E+000 -8.608022162824174E+000 -8.621352702203660E+000 +-8.634988450962503E+000 -8.648935581921455E+000 -8.663200349006338E+000 -8.677789086359118E+000 +-8.692708211880561E+000 -8.707964215922553E+000 -8.723563670754650E+000 -8.739513232842173E+000 +-8.755819629911848E+000 -8.772489658139580E+000 -8.789530181631340E+000 -8.806948133262894E+000 +-8.824750513890395E+000 -8.842944386134457E+000 -8.861536866622762E+000 -8.880535124454862E+000 +-8.899946389123450E+000 -8.919777933547405E+000 -8.940037062821956E+000 -8.960731128631549E+000 +-8.981867518644961E+000 -9.003453642147077E+000 -9.025496931195747E+000 -9.048004833327438E+000 +-9.070984806147797E+000 -9.094444308293387E+000 -9.118390793523842E+000 -9.142831709980209E+000 +-9.167774480624097E+000 -9.193226494520635E+000 -9.219195108260498E+000 -9.245687637808242E+000 +-9.272711338199864E+000 -9.300273395703787E+000 -9.328380929286174E+000 -9.357040961912617E+000 +-9.386260414082154E+000 -9.416046108077545E+000 -9.446404731745067E+000 -9.477342834261302E+000 +-9.508866825110109E+000 -9.540982942946075E+000 -9.573697244768548E+000 -9.607015592408501E+000 +-9.640943642681018E+000 -9.675486824978821E+000 -9.710650320496535E+000 -9.746439058274891E+000 +-9.782857682248423E+000 -9.819910534967995E+000 -9.857601649423648E+000 -9.895934724341483E+000 +-9.934913102082835E+000 -9.974539742377488E+000 -1.001481720775979E+001 -1.005574765209258E+001 +-1.009733278417058E+001 -1.013957384337448E+001 -1.018247158952427E+001 -1.022602627255571E+001 +-1.027023760731241E+001 -1.031510474887048E+001 -1.036062627640271E+001 -1.040680016475738E+001 +-1.045362375222514E+001 -1.050109372529177E+001 -1.054920608987991E+001 -1.059795614600240E+001 +-1.064733846343896E+001 -1.069734685383724E+001 -1.074797434847863E+001 -1.079921317318857E+001 +-1.085105472211488E+001 -1.090348953363483E+001 -1.095650726529173E+001 -1.101009667208498E+001 +-1.106424557759697E+001 -1.111894085769401E+001 -1.117416842144439E+001 -1.122991317689045E+001 +-1.128615901830865E+001 -1.134288880542460E+001 -1.140008434370531E+001 -1.145772637029019E+001 +-1.151579453197092E+001 -1.157426737474377E+001 -1.163312232469947E+001 -1.169233567585004E+001 +-1.175188258762865E+001 -1.181173706633315E+001 -1.187187195717186E+001 -1.193225894337732E+001 +-1.199286854180911E+001 -1.205367009971575E+001 -1.211463179312866E+001 -1.217572063087328E+001 +-1.223690245649713E+001 -1.229814196067886E+001 -1.235940268808131E+001 -1.242064704374040E+001 +-1.248183631705532E+001 -1.254293069326405E+001 -1.260388927198389E+001 -1.266467009491749E+001 +-1.272523016388758E+001 -1.278552547200504E+001 -1.284551103565009E+001 -1.290514092776462E+001 +-1.296436831632722E+001 -1.302314549959704E+001 -1.308142395031486E+001 -1.313915435964418E+001 +-1.319628668608765E+001 -1.325277021257172E+001 -1.330855359467878E+001 -1.336358491319812E+001 +-1.341781173944171E+001 -1.347118119908575E+001 -1.352364003559137E+001 -1.357513467674197E+001 +-1.362561130447232E+001 -1.367501592920116E+001 -1.372329446549030E+001 -1.377039281016442E+001 +-1.381625691982922E+001 -1.386083289494457E+001 -1.390406706773376E+001 -1.394590608377310E+001 +-1.398629699072090E+001 -1.402518733153028E+001 -1.406252523412834E+001 -1.409825950574224E+001 +-1.413233973075262E+001 -1.416471636374759E+001 -1.419534082752325E+001 -1.422416561546239E+001 +-1.425114438806332E+001 -1.427623207505352E+001 -1.429938497838362E+001 -1.432056087232074E+001 +-1.433971910770477E+001 -1.435682071317947E+001 -1.437182849870193E+001 -1.438470715878316E+001 +-1.439542337417535E+001 -1.440394591451134E+001 -1.441024573652158E+001 -1.441429608529036E+001 +-1.441607259433224E+001 -1.441555337980003E+001 -1.441271913558736E+001 -1.440755322605094E+001 +-1.440004177566163E+001 -1.439017375516461E+001 -1.437794106363054E+001 -1.436333860882407E+001 +-1.434636438219002E+001 -1.432701952882549E+001 -1.430530841125816E+001 -1.428123866887018E+001 +-1.425482127149334E+001 -1.422607056433163E+001 -1.419500430704093E+001 -1.416164370438351E+001 +-1.412601342893987E+001 -1.408814163501600E+001 -1.404805996258293E+001 -1.400580353246496E+001 +-1.396141093058085E+001 -1.391492418065927E+001 -1.386638870748982E+001 -1.381585328846294E+001 +-1.376336999189896E+001 -1.370899410535785E+001 -1.365278405155915E+001 -1.359480129065470E+001 +-1.353511021118492E+001 -1.347377800956062E+001 -1.341087455712079E+001 -1.334647225486714E+001 +-1.328064587732172E+001 -1.321347240556882E+001 -1.314503084944953E+001 -1.307540206008800E+001 +-1.300466853339831E+001 -1.293291420526556E+001 -1.286022423895226E+001 -1.278668480641658E+001 +-1.271238286427913E+001 -1.263740592478950E+001 -1.256184182421756E+001 -1.248577848930240E+001 +-1.240930370255545E+001 -1.233250486823096E+001 -1.225546878008845E+001 -1.217828139226253E+001 +-1.210102759435813E+001 -1.202379099191798E+001 -1.194665369376763E+001 -1.186969610718727E+001 +-1.179299674194595E+001 -1.171663202426062E+001 -1.164067612160114E+001 -1.156520077921395E+001 +-1.149027516906040E+001 -1.141596575182828E+001 -1.134233615252144E+001 -1.126944705011086E+001 +-1.119735608154489E+001 -1.112611776030215E+001 -1.105578340959877E+001 -1.098640111024493E+001 +-1.091801566302331E+001 -1.085066856536233E+001 -1.078439800206024E+001 -1.071923884955533E+001 +-1.065522269331204E+001 -1.059237785782056E+001 -1.053072944850924E+001 -1.047029940494794E+001 +-1.041110656455967E+001 -1.035316673608812E+001 -1.029649278205090E+001 -1.024109470942810E+001 +-1.018697976756537E+001 -1.013415255247601E+001 -1.008261511697757E+001 -1.003236708545210E+001 +-9.983405772535807E+000 -9.935726305125749E+000 -9.889321746611463E+000 -9.844183222796007E+000 +-9.800300048720295E+000 -9.757659855668640E+000 -9.716248717840239E+000 -9.676051277960063E+000 +-9.637050871334512E+000 -9.599229647771670E+000 -9.562568690995423E+000 -9.527048135193324E+000 +-9.492647278116808E+000 -9.459344690535071E+000 -9.427118321785597E+000 -9.395945601070656E+000 +-9.365803534417072E+000 -9.336668797080284E+000 -9.308517821272860E+000 -9.281326879132708E+000 +-9.255072160847146E+000 -9.229729847950717E+000 -9.205276181783534E+000 -9.181687527184945E+000 +-9.158940431374281E+000 -9.137011678159345E+000 -9.115878337639932E+000 -9.095517811342237E+000 +-9.075907873049925E+000 -9.057026705469729E+000 -9.038852932746551E+000 -9.021365649177264E+000 +-9.004544444191115E+000 -8.988369423694435E+000 -8.972821228076237E+000 -8.957881046995908E+000 +-8.943530631161165E+000 -8.929752301220542E+000 -8.916528953957812E+000 -8.903844066026828E+000 +-8.891681695318272E+000 -8.880026480155749E+000 -8.868863636470666E+000 -8.858178953120127E+000 +-8.847958785505392E+000 -8.838190047611626E+000 -8.828860202651759E+000 -8.819957252367745E+000 +-8.811469725172648E+000 -8.803386663259079E+000 -8.795697608720873E+000 -8.788392588876089E+000 +-8.781462100837521E+000 -8.774897095432207E+000 -8.768688960544338E+000 -8.762829503984177E+000 +-8.757310935982117E+000 -8.752125851327975E+000 -8.747267211260372E+000 -8.742728325139746E+000 +-8.738502832009978E+000 -8.734584682101231E+000 -8.730968118282474E+000 -8.727647657589770E+000 +-8.724618072851070E+000 -8.721874374460281E+000 -8.719411792400074E+000 -8.717225758537170E+000 +-8.715311889264902E+000 -8.713665968562188E+000 -8.712283931561705E+000 -8.711161848700399E+000 +-8.710295910496116E+000 -8.709682413098740E+000 -8.709317744694058E+000 -8.709198372858058E+000 +-8.709320833019158E+000 -8.709681718106172E+000 -8.710277669552827E+000 -8.711105369816513E+000 +-8.712161536563439E+000 -8.713442918708921E+000 -8.714946294473593E+000 -8.716668471706974E+000 +-8.718606290663759E+000 -8.720756629472147E+000 -8.723116412564590E+000 -8.725682622267726E+000 +-8.728452313909155E+000 -8.731422634668757E+000 -8.734590846458955E+000 -8.737954353205991E+000 +-8.741510732754554E+000 -8.745257773804218E+000 -8.749193518150964E+000 -8.753316308527662E+000 +-8.757624842452856E+000 -8.762118232300979E+000 -8.766796071976172E+000 -8.771658510458844E+000 +-8.776706332452548E+000 -8.781941046450155E+000 -8.787364980368102E+000 -8.792981384990270E+000 +-8.798794545329867E+000 -8.804809899974808E+000 -8.811034168522955E+000 -8.817475487020811E+000 +-8.824143551344255E+000 -8.831049768352644E+000 -8.838207414560046E+000 -8.845631802017921E+000 +-8.853340450949318E+000 -8.861353268659975E+000 -8.869692734095642E+000 -8.878384087318247E+000 +-8.887455523120522E+000 -8.896938387831877E+000 -8.906867378336511E+000 -8.917280742189305E+000 +-8.928220477628996E+000 -8.939732532254727E+000 -8.951866999008118E+000 -8.964678308101051E+000 +-8.978225413461848E+000 -8.992571972252700E+000 -9.007786516045700E+000 -9.023942612221081E+000 +-9.041119014232269E+000 -9.059399799435017E+000 -9.078874493265170E+000 -9.099638178683817E+000 +-9.121791589927124E+000 -9.145441189772473E+000 -9.170699229700226E+000 -9.197683792520374E+000 +-9.226518817240889E+000 -9.257334106153120E+000 -9.290265314312474E+000 -9.325453921789713E+000 +-9.363047189246743E+000 -9.403198097542079E+000 -9.446065272208756E+000 -9.491812893723150E+000 +-9.540610594540652E+000 -9.592633343871304E+000 -9.648061321102626E+000 -9.707079778689137E+000 +-9.769878895127455E+000 -9.836653618436840E+000 -9.907603500279004E+000 -9.982932520489527E+000 +-1.006284890145290E+001 -1.014756491128332E+001 -1.023729665434115E+001 -1.033226384712945E+001 +-1.043268957707676E+001 -1.053880004124640E+001 -1.065082426144948E+001 -1.076899377176006E+001 +-1.089354227394288E+001 -1.102470525580413E+001 -1.116271956708029E+001 -1.130782294703174E+001 +-1.146025349757189E+001 -1.162024909543868E+001 -1.178804673661196E+001 -1.196388180599716E+001 +-1.214798726516655E+001 -1.234059275086763E+001 -1.254192357694165E+001 -1.275219963224807E+001 +-1.297163416731305E+001 -1.320043246250130E+001 -1.343879037073776E+001 -1.368689272811462E+001 +-1.394491162606845E+001 -1.421300453934361E+001 -1.449131230452925E+001 -1.477995694470620E+001 +-1.507903933661961E+001 -1.538863671777946E+001 -1.570880003211180E+001 -1.603955111410914E+001 +-1.638087971298054E+001 -1.673274036002423E+001 -1.709504908434793E+001 -1.746767998419723E+001 +-1.785046166340513E+001 -1.824317354498896E+001 -1.864554207655947E+001 -1.905723684498398E+001 +-1.947786662074713E+001 -1.990697535553421E+001 -2.034403815986398E+001 -2.078845729111545E+001 +-2.123955818611071E+001 -2.169658557676996E+001 -2.215869973243336E+001 -2.262497287872366E+001 +-2.309438585083860E+001 -2.356582504968371E+001 -2.403807978330937E+001 -2.450984009483394E+001 +-2.497969520278392E+001 -2.544613271180549E+001 -2.590753879197173E+001 -2.636219957367488E+001 +-2.680830406117869E+001 -2.724394892812452E+001 -2.766714561648865E+001 -2.807583020702422E+001 +-2.846787655072657E+001 -2.884111313089413E+001 -2.919334404650859E+001 -2.952237435499421E+001 +-2.982603977859174E+001 -3.010224046939931E+001 -3.034897816723853E+001 -3.056439571488066E+001 +-3.074681757522653E+001 -3.089478978832902E+001 -3.100711776564481E+001 -3.108290046970368E+001 +-3.112155985358311E+001 -3.112286487617053E+001 -3.108694987208094E+001 -3.101432743265543E+001 +-3.090589615426976E+001 -3.076294357692137E+001 -3.058714436299724E+001 -3.038055329172233E+001 +-3.014559203699602E+001 -2.988502803078262E+001 -2.960194305399332E+001 -2.929968857917834E+001 +-2.898182432174341E+001 -2.865203592024938E+001 -2.831402712580177E+001 -2.797138129280300E+001 +-2.762738628795404E+001 -2.728481662939762E+001 -2.694567186628333E+001 -2.661086240643594E+001 +-2.628038052151570E+001 -2.595411995036496E+001 -2.563199201460306E+001 -2.531391744225404E+001 +-2.499982438126566E+001 -2.468964707778963E+001 -2.438332476196889E+001 -2.408080072161843E+001 +-2.378202154107996E+001 -2.348693648195098E+001 -2.319549698359870E+001 -2.290765626340291E+001 +-2.262336899907351E+001 -2.234259107785765E+001 -2.206527939980480E+001 -2.179139172439187E+001 +-2.152088655169713E+001 -2.125372303092616E+001 -2.098986089046358E+001 -2.072926038476817E+001 +-2.047188225436555E+001 -2.021768769596601E+001 -1.996663834035521E+001 -1.971869623620574E+001 +-1.947382383837249E+001 -1.923198399592940E+001 -1.899313995717031E+001 -1.875725536177139E+001 +-1.852429421918500E+001 -1.829422091850869E+001 -1.806700025356700E+001 -1.784259740137339E+001 +-1.762097788624078E+001 -1.740210762097372E+001 -1.718595291046741E+001 -1.697248042788758E+001 +-1.676165722118234E+001 -1.655345071147621E+001 -1.634782869126039E+001 -1.614475932237413E+001 +-1.594421113379202E+001 -1.574615301924318E+001 -1.555055423469106E+001 -1.535738439570444E+001 +-1.516661347475099E+001 -1.497821179843881E+001 -1.479215004472817E+001 -1.460839924012838E+001 +-1.442693075688691E+001 -1.424771631017311E+001 -1.407072795525068E+001 -1.389593808463055E+001 +-1.372331942519179E+001 -1.355284503525716E+001 -1.338448830161204E+001 -1.321822293645549E+001 +-1.305402297427660E+001 -1.289186276865331E+001 -1.273171698897349E+001 -1.257356061708371E+001 +-1.241736894387344E+001 -1.226311756580531E+001 -1.211078238140469E+001 -1.196033958772152E+001 +-1.181176567677910E+001 -1.166503743202257E+001 -1.152013192477933E+001 -1.137702651074196E+001 +-1.123569882648163E+001 -1.109612678599939E+001 -1.095828857731882E+001 -1.082216265912407E+001 +-1.068772775744376E+001 -1.055496286238122E+001 -1.042384722489001E+001 -1.029436035359324E+001 +-1.016648201164381E+001 -1.004019221362317E+001 -9.915471222479313E+000 -9.792299546493824E+000 +-9.670657936284790E+000 -9.550527381836304E+000 -9.431889109558345E+000 -9.314724579373511E+000 +-9.199015481831388E+000 -9.084743735249603E+000 -8.971891482882855E+000 -8.860441090120039E+000 +-8.750375141710334E+000 -8.641676439019356E+000 -8.534327997315803E+000 -8.428313043089844E+000 +-8.323615011403607E+000 -8.220217543274172E+000 -8.118104483089860E+000 -8.017259876059391E+000 +-7.917667965694434E+000 -7.819313191325248E+000 -7.722180185648954E+000 -7.626253772310575E+000 +-7.531518963515921E+000 -7.437960957676301E+000 -7.345565137084280E+000 -7.254317065619902E+000 +-7.164202486487238E+000 -7.075207319980158E+000 -6.987317661277279E+000 -6.900519778265368E+000 +-6.814800109390507E+000 -6.730145261537054E+000 -6.646542007933245E+000 -6.563977286083675E+000 +-6.482438195727791E+000 -6.401911996823990E+000 -6.322386107559327E+000 -6.243848102383939E+000 +-6.166285710070168E+000 -6.089686811796084E+000 -6.014039439252619E+000 -5.939331772774660E+000 +-5.865552139495164E+000 -5.792689011522391E+000 -5.720731004139862E+000 -5.649666874028537E+000 +-5.579485517511340E+000 -5.510175968819317E+000 -5.441727398379454E+000 -5.374129111123812E+000 +-5.307370544819541E+000 -5.241441268419842E+000 -5.176330980435239E+000 -5.112029507325206E+000 +-5.048526801909794E+000 -4.985812941800837E+000 -4.923878127852904E+000 -4.862712682633193E+000 +-4.802307048910673E+000 -4.742651788163887E+000 -4.683737579107226E+000 -4.625555216235609E+000 +-4.568095608387134E+000 -4.511349777323604E+000 -4.455308856328672E+000 -4.399964088823396E+000 +-4.345306826998153E+000 -4.291328530478738E+000 -4.238020764629016E+000 -4.185375201171141E+000 +-4.133383611312292E+000 -4.082037633410822E+000 -4.031329747527034E+000 -3.981251765117995E+000 +-3.931795861398061E+000 -3.882954308781589E+000 -3.834719475676578E+000 -3.787083825292160E+000 +-3.740039914460994E+000 -3.693580392476275E+000 -3.647697999943111E+000 -3.602385567644295E+000 +-3.557636015420044E+000 -3.513442351061737E+000 -3.469797669219388E+000 -3.426695150322613E+000 +-3.384128059515133E+000 -3.342089745602362E+000 -3.300573639982462E+000 -3.259573255741968E+000 +-3.219082186454329E+000 -3.179094105307605E+000 -3.139602764082751E+000 -3.100601992177352E+000 +-3.062085695641461E+000 -3.024047856225367E+000 -2.986482530439292E+000 -2.949383848624644E+000 +-2.912746014036870E+000 -2.876563301939862E+000 -2.840830058711185E+000 -2.805540700958905E+000 +-2.770689714649065E+000 -2.736271654244146E+000 -2.702281141852195E+000 -2.668712866386488E+000 +-2.635561582735696E+000 -2.602822110944299E+000 -2.570489335403213E+000 -2.538558204050491E+000 +-2.507023727581883E+000 -2.475880978671295E+000 -2.445125091200843E+000 -2.414751259500531E+000 +-2.384754737597372E+000 -2.355130838473776E+000 -2.325874933335249E+000 -2.296982450887084E+000 +-2.268448876620115E+000 -2.240269752105315E+000 -2.212440674297141E+000 -2.184957294845578E+000 +-2.157815319416663E+000 -2.131010507021511E+000 -2.104538669353662E+000 -2.078395670134610E+000 +-2.052577424467550E+000 -2.027079898199066E+000 -2.001899107288795E+000 -1.977031117186939E+000 +-1.952472042219439E+000 -1.928218044980875E+000 -1.904265335734831E+000 -1.880610171821746E+000 +-1.857248857074147E+000 -1.834177741239061E+000 -1.811393219407713E+000 -1.788891731452205E+000 +-1.766669761469261E+000 -1.744723837230869E+000 -1.723050529641706E+000 -1.701646452203378E+000 +-1.680508260485233E+000 -1.659632651601807E+000 -1.639016363696745E+000 -1.618656175433110E+000 +-1.598548905490075E+000 -1.578691412065793E+000 -1.559080592386516E+000 -1.539713382221777E+000 +-1.520586755405577E+000 -1.501697723363573E+000 -1.483043334646071E+000 -1.464620674466879E+000 +-1.446426864247869E+000 -1.428459061169174E+000 -1.410714457725012E+000 -1.393190281284990E+000 +-1.375883793660883E+000 -1.358792290678796E+000 -1.341913101756608E+000 -1.325243589486717E+000 +-1.308781149223912E+000 -1.292523208678406E+000 -1.276467227513918E+000 -1.260610696950718E+000 +-1.244951139373652E+000 -1.229486107944987E+000 -1.214213186222093E+000 -1.199129987779885E+000 +-1.184234155837914E+000 -1.169523362892139E+000 -1.154995310351229E+000 -1.140647728177415E+000 +-1.126478374531797E+000 -1.112485035424036E+000 -1.098665524366429E+000 -1.085017682032258E+000 +-1.071539375918387E+000 -1.058228500012070E+000 -1.045082974461860E+000 -1.032100745252650E+000 +-1.019279783884710E+000 -1.006618087056741E+000 -9.941136763528576E-001 -9.817645979334413E-001 +-9.695689222298702E-001 -9.575247436430017E-001 -9.456301802454230E-001 -9.338833734874100E-001 +-9.222824879065024E-001 -9.108257108407315E-001 -8.995112521453683E-001 -8.883373439132202E-001 +-8.773022401983972E-001 -8.664042167434876E-001 -8.556415707101603E-001 -8.450126204130719E-001 +-8.345157050571125E-001 -8.241491844779059E-001 -8.139114388855168E-001 -8.038008686113709E-001 +-7.938158938582910E-001 -7.839549544536559E-001 -7.742165096056242E-001 -7.645990376623721E-001 +-7.551010358743462E-001 -7.457210201594401E-001 -7.364575248711132E-001 -7.273091025693836E-001 +-7.182743237946505E-001 -7.093517768443531E-001 -7.005400675523746E-001 -6.918378190712091E-001 +-6.832436716568303E-001 -6.747562824562154E-001 -6.663743252975396E-001 -6.580964904829402E-001 +-6.499214845838848E-001 -6.418480302390723E-001 -6.338748659548330E-001 -6.260007459080297E-001 +-6.182244397513825E-001 -6.105447324212323E-001 -6.029604239476875E-001 -5.954703292671153E-001 +-5.880732780369868E-001 -5.807681144529955E-001 -5.735536970684683E-001 -5.664288986160132E-001 +-5.593926058313736E-001 -5.524437192794903E-001 -5.455811531826993E-001 -5.388038352510860E-001 +-5.321107065149363E-001 -5.255007211592658E-001 -5.189728463604174E-001 -5.125260621246716E-001 +-5.061593611288735E-001 -4.998717485630419E-001 -4.936622419749195E-001 -4.875298711164701E-001 +-4.814736777922701E-001 -4.754927157097898E-001 -4.695860503315377E-001 -4.637527587290290E-001 +-4.579919294385851E-001 -4.523026623189080E-001 -4.466840684104339E-001 -4.411352697964357E-001 +-4.356553994658389E-001 -4.302436011777575E-001 -4.248990293276972E-001 -4.196208488154324E-001 +-4.144082349145212E-001 -4.092603731434346E-001 -4.041764591382990E-001 -3.991556985272073E-001 +-3.941973068060981E-001 -3.893005092161788E-001 -3.844645406228618E-001 -3.796886453962172E-001 +-3.749720772928981E-001 -3.703140993395420E-001 -3.657139837176182E-001 -3.611710116497004E-001 +-3.566844732871619E-001 -3.522536675992547E-001 -3.478779022635744E-001 -3.435564935578870E-001 +-3.392887662532884E-001 -3.350740535087058E-001 -3.309116967666975E-001 -3.268010456505532E-001 +-3.227414578626746E-001 -3.187322990842085E-001 -3.147729428759414E-001 -3.108627705804088E-001 +-3.070011712252340E-001 -3.031875414276625E-001 -2.994212853002783E-001 -2.957018143579003E-001 +-2.920285474256257E-001 -2.884009105480222E-001 -2.848183368994488E-001 -2.812802666954827E-001 +-2.777861471054577E-001 -2.743354321660782E-001 -2.709275826961138E-001 -2.675620662121524E-001 +-2.642383568453956E-001 -2.609559352594935E-001 -2.577142885693946E-001 -2.545129102612081E-001 +-2.513513001130608E-001 -2.482289641169340E-001 -2.451454144014766E-001 -2.421001691557716E-001 +-2.390927525540534E-001 + + + +-1.126741090995861E-007 -1.155264677465885E-007 -1.184510341962707E-007 -1.214496363978473E-007 +-1.245241485752880E-007 -1.276764923987662E-007 -1.309086381857674E-007 -1.342226061326007E-007 +-1.376204675770872E-007 -1.411043462932145E-007 -1.446764198185632E-007 -1.483389208153393E-007 +-1.520941384658608E-007 -1.559444199033706E-007 -1.598921716790725E-007 -1.639398612663019E-007 +-1.680900186027780E-007 -1.723452376718975E-007 -1.767081781240574E-007 -1.811815669390247E-007 +-1.857682001303858E-007 -1.904709444931463E-007 -1.952927393955716E-007 -2.002365986163871E-007 +-2.053056122284887E-007 -2.105029485303374E-007 -2.158318560262502E-007 -2.212956654568201E-007 +-2.268977918807371E-007 -2.326417368093126E-007 -2.385310903950352E-007 -2.445695336755341E-007 +-2.507608408743475E-007 -2.571088817599341E-007 -2.636176240644054E-007 -2.702911359634857E-007 +-2.771335886192552E-007 -2.841492587872611E-007 -2.913425314896293E-007 -2.987179027558464E-007 +-3.062799824329225E-007 -3.140334970666962E-007 -3.219832928560796E-007 -3.301343386820890E-007 +-3.384917292135598E-007 -3.470606880914757E-007 -3.558465711939171E-007 -3.648548699836575E-007 +-3.740912149405067E-007 -3.835613790805442E-007 -3.932712815644397E-007 -4.032269913971215E-007 +-4.134347312211035E-007 -4.239008812058353E-007 -4.346319830355191E-007 -4.456347439978720E-007 +-4.569160411763986E-007 -4.684829257487926E-007 -4.803426273941505E-007 -4.925025588117583E-007 +-5.049703203542654E-007 -5.177537047781533E-007 -5.308607021144617E-007 -5.442995046628150E-007 +-5.580785121118805E-007 -5.722063367894399E-007 -5.866918090453765E-007 -6.015439827709301E-007 +-6.167721410576722E-007 -6.323858019997415E-007 -6.483947246429569E-007 -6.648089150845408E-007 +-6.816386327272527E-007 -6.988943966918482E-007 -7.165869923918752E-007 -7.347274782748975E-007 +-7.533271927343912E-007 -7.723977611966030E-007 -7.919511033868196E-007 -8.119994407795859E-007 +-8.325553042375141E-007 -8.536315418434853E-007 -8.752413269311155E-007 -8.973981663185116E-007 +-9.201159087504795E-007 -9.434087535544262E-007 -9.672912595154064E-007 -9.917783539758304E-007 +-1.016885342165536E-006 -1.042627916768060E-006 -1.069022167729059E-006 -1.096084592313055E-006 +-1.123832105414757E-006 -1.152282050131415E-006 -1.181452208602822E-006 -1.211360813125716E-006 +-1.242026557549562E-006 -1.273468608960808E-006 -1.305706619662932E-006 -1.338760739459776E-006 +-1.372651628249807E-006 -1.407400468939232E-006 -1.443028980681992E-006 -1.479559432454936E-006 +-1.517014656976655E-006 -1.555418064978655E-006 -1.594793659837824E-006 -1.635166052579322E-006 +-1.676560477259250E-006 -1.719002806736771E-006 -1.762519568845451E-006 -1.807137962974031E-006 +-1.852885877066906E-006 -1.899791905054997E-006 -1.947885364727874E-006 -1.997196316058314E-006 +-2.047755579990749E-006 -2.099594757705353E-006 -2.152746250369784E-006 -2.207243279390969E-006 +-2.263119907179534E-006 -2.320411058439908E-006 -2.379152541999386E-006 -2.439381073189786E-006 +-2.501134296795729E-006 -2.564450810583805E-006 -2.629370189427427E-006 -2.695933010042398E-006 +-2.764180876348645E-006 -2.834156445474017E-006 -2.905903454416328E-006 -2.979466747380393E-006 +-3.054892303807087E-006 -3.132227267111951E-006 -3.211519974151359E-006 -3.292819985434555E-006 +-3.376178116100576E-006 -3.461646467679324E-006 -3.549278460656671E-006 -3.639128867863994E-006 +-3.731253848712889E-006 -3.825710984296624E-006 -3.922559313380125E-006 -4.021859369301091E-006 +-4.123673217805262E-006 -4.228064495839442E-006 -4.335098451326624E-006 -4.444841983948011E-006 +-4.557363686957414E-006 -4.672733890054247E-006 -4.791024703341732E-006 -4.912310062398063E-006 +-5.036665774488421E-006 -5.164169565946925E-006 -5.294901130758051E-006 -5.428942180367832E-006 +-5.566376494756115E-006 -5.707289974801660E-006 -5.851770695972884E-006 -5.999908963377817E-006 +-6.151797368207551E-006 -6.307530845608693E-006 -6.467206734020765E-006 -6.630924836015752E-006 +-6.798787480677884E-006 -6.970899587562368E-006 -7.147368732273535E-006 -7.328305213702788E-006 +-7.513822122968902E-006 -7.704035414103497E-006 -7.899063976525771E-006 -8.099029709352230E-006 +-8.304057597587260E-006 -8.514275790242638E-006 -8.729815680434690E-006 -8.950811987508826E-006 +-9.177402841243501E-006 -9.409729868185376E-006 -9.647938280170290E-006 -9.892176965085162E-006 +-1.014259857992728E-005 -1.039935964621977E-005 -1.066262064784216E-005 -1.093254613133767E-005 +-1.120930480875994E-005 -1.149306966312284E-005 -1.178401805652039E-005 -1.208233184098323E-005 +-1.238819747214158E-005 -1.270180612576571E-005 -1.302335381725628E-005 -1.335304152416014E-005 +-1.369107531178693E-005 -1.403766646200620E-005 -1.439303160530485E-005 -1.475739285618736E-005 +-1.513097795200422E-005 -1.551402039529414E-005 -1.590675959973014E-005 -1.630944103976013E-005 +-1.672231640403531E-005 -1.714564375272326E-005 -1.757968767880272E-005 -1.802471947344189E-005 +-1.848101729556336E-005 -1.894886634570106E-005 -1.942855904425918E-005 -1.992039521428286E-005 +-2.042468226885621E-005 -2.094173540324436E-005 -2.147187779189890E-005 -2.201544079045150E-005 +-2.257276414282003E-005 -2.314419619355805E-005 -2.373009410557996E-005 -2.433082408339723E-005 +-2.494676160200682E-005 -2.557829164157277E-005 -2.622580892804950E-005 -2.688971817989632E-005 +-2.757043436103682E-005 -2.826838294022305E-005 -2.898400015696434E-005 -2.971773329418861E-005 +-3.047004095780621E-005 -3.124139336334996E-005 -3.203227262987285E-005 -3.284317308128418E-005 +-3.367460155531496E-005 -3.452707772030455E-005 -3.540113440000587E-005 -3.629731790661434E-005 +-3.721618838222611E-005 -3.815832014894063E-005 -3.912430206782656E-005 -4.011473790697329E-005 +-4.113024671886154E-005 -4.217146322728517E-005 -4.323903822406878E-005 -4.433363897582811E-005 +-4.545594964102625E-005 -4.660667169758958E-005 -4.778652438134631E-005 -4.899624513556548E-005 +-5.023659007187540E-005 -5.150833444284968E-005 -5.281227312655719E-005 -5.414922112337751E-005 +-5.552001406539344E-005 -5.692550873867859E-005 -5.836658361880589E-005 -5.984413941991294E-005 +-6.135909965766582E-005 -6.291241122647466E-005 -6.450504499132077E-005 -6.613799639456562E-005 +-6.781228607812075E-005 -6.952896052136732E-005 -7.128909269522454E-005 -7.309378273277527E-005 +-7.494415861686761E-005 -7.684137688512348E-005 -7.878662335279278E-005 -8.078111385390712E-005 +-8.282609500119500E-005 -8.492284496523283E-005 -8.707267427332077E-005 -8.927692662858019E-005 +-9.153697974978674E-005 -9.385424623246267E-005 -9.623017443176662E-005 -9.866624936773362E-005 +-1.011639936534293E-004 -1.037249684466004E-004 -1.063507744254144E-004 -1.090430527888999E-004 +-1.118034862827112E-004 -1.146338002508588E-004 -1.175357637140640E-004 -1.205111904754107E-004 +-1.235619402539839E-004 -1.266899198472071E-004 -1.298970843226008E-004 -1.331854382397091E-004 +-1.365570369029594E-004 -1.400139876462333E-004 -1.435584511499577E-004 -1.471926427915334E-004 +-1.509188340299498E-004 -1.547393538254476E-004 -1.586565900951179E-004 -1.626729912053487E-004 +-1.667910675020478E-004 -1.710133928796028E-004 -1.753426063895554E-004 -1.797814138899956E-004 +-1.843325897367087E-004 -1.889989785171288E-004 -1.937834968281847E-004 -1.986891350991481E-004 +-2.037189594606228E-004 -2.088761136608441E-004 -2.141638210304836E-004 -2.195853864971896E-004 +-2.251441986511213E-004 -2.308437318627645E-004 -2.366875484543574E-004 -2.426793009262777E-004 +-2.488227342397870E-004 -2.551216881575557E-004 -2.615800996434309E-004 -2.682020053229497E-004 +-2.749915440061301E-004 -2.819529592741213E-004 -2.890906021313269E-004 -2.964089337246548E-004 +-3.039125281316018E-004 -3.116060752189026E-004 -3.194943835735405E-004 -3.275823835079457E-004 +-3.358751301412554E-004 -3.443778065585701E-004 -3.530957270501694E-004 -3.620343404327197E-004 +-3.711992334545408E-004 -3.805961342870695E-004 -3.902309161046849E-004 -4.001096007551504E-004 +-4.102383625229517E-004 -4.206235319878878E-004 -4.312715999813260E-004 -4.421892216425844E-004 +-4.533832205779889E-004 -4.648605931251907E-004 -4.766285127254138E-004 -4.886943344063674E-004 +-5.010655993786076E-004 -5.137500397482417E-004 -5.267555833489003E-004 -5.400903586960053E-004 +-5.537627000664258E-004 -5.677811527066875E-004 -5.821544781730031E-004 -5.968916598064452E-004 +-6.120019083466865E-004 -6.274946676878204E-004 -6.433796207798335E-004 -6.596666956794492E-004 +-6.763660717540897E-004 -6.934881860428506E-004 -7.110437397784567E-004 -7.290437050742551E-004 +-7.474993317804489E-004 -7.664221545138326E-004 -7.858239998654214E-004 -8.057169937904857E-004 +-8.261135691855849E-004 -8.470264736573529E-004 -8.684687774878709E-004 -8.904538818016055E-004 +-9.129955269390172E-004 -9.361078010420427E-004 -9.598051488568450E-004 -9.841023807593018E-004 +-1.009014682008871E-003 -1.034557622236620E-003 -1.060747165173318E-003 -1.087599678623690E-003 +-1.115131944693043E-003 -1.143361170272645E-003 -1.172304997790412E-003 -1.201981516233594E-003 +-1.232409272450357E-003 -1.263607282737307E-003 -1.295595044720174E-003 -1.328392549535106E-003 +-1.362020294318103E-003 -1.396499295010471E-003 -1.431851099488216E-003 -1.468097801023602E-003 +-1.505262052087265E-003 -1.543367078499480E-003 -1.582436693939420E-003 -1.622495314821466E-003 +-1.663567975547820E-003 -1.705680344146948E-003 -1.748858738307620E-003 -1.793130141818505E-003 +-1.838522221423618E-003 -1.885063344104095E-003 -1.932782594797085E-003 -1.981709794562812E-003 +-2.031875519211104E-003 -2.083311118399024E-003 -2.136048735211519E-003 -2.190121326237238E-003 +-2.245562682152102E-003 -2.302407448823381E-003 -2.360691148947477E-003 -2.420450204234881E-003 +-2.481721958156120E-003 -2.544544699262878E-003 -2.608957685098774E-003 -2.675001166714764E-003 +-2.742716413804366E-003 -2.812145740474394E-003 -2.883332531667261E-003 -2.956321270251241E-003 +-3.031157564795632E-003 -3.107888178048066E-003 -3.186561056131680E-003 -3.267225358480381E-003 +-3.349931488530724E-003 -3.434731125189629E-003 -3.521677255097413E-003 -3.610824205706251E-003 +-3.702227679194663E-003 -3.795944787239033E-003 -3.892034086663890E-003 -3.990555615993030E-003 +-4.091570932924264E-003 -4.195143152751053E-003 -4.301336987754880E-003 -4.410218787592905E-003 +-4.521856580705951E-003 -4.636320116772548E-003 -4.753680910235442E-003 -4.874012284927482E-003 +-4.997389419824772E-003 -5.123889395955340E-003 -5.253591244492503E-003 -5.386575996062808E-003 +-5.522926731299002E-003 -5.662728632669590E-003 -5.806069037616968E-003 -5.953037493037121E-003 +-6.103725811134781E-003 -6.258228126688368E-003 -6.416640955760596E-003 -6.579063255890776E-003 +-6.745596487806282E-003 -6.916344678691412E-003 -7.091414487052580E-003 -7.270915269220368E-003 +-7.454959147529204E-003 -7.643661080217131E-003 -7.837138933088772E-003 -8.035513552985691E-003 +-8.238908843109844E-003 -8.447451840246409E-003 -8.661272793933793E-003 -8.880505247629763E-003 +-9.105286121923642E-003 -9.335755799846121E-003 -9.572058214329200E-003 -9.814340937870182E-003 +-1.006275527445515E-002 -1.031745635379825E-002 -1.057860322795526E-002 -1.084635897037065E-002 +-1.112089077741906E-002 -1.140237007250406E-002 -1.169097261277757E-002 -1.198687859854627E-002 +-1.229027278543168E-002 -1.260134459935304E-002 -1.292028825440358E-002 -1.324730287369238E-002 +-1.358259261322613E-002 -1.392636678890651E-002 -1.427884000672113E-002 -1.464023229620789E-002 +-1.501076924727393E-002 -1.539068215045349E-002 -1.578020814068999E-002 -1.617959034473032E-002 +-1.658907803222132E-002 -1.700892677060048E-002 -1.743939858387554E-002 -1.788076211538966E-002 +-1.833329279467105E-002 -1.879727300846891E-002 -1.927299227607930E-002 -1.976074742906770E-002 +-2.026084279549734E-002 -2.077359038877481E-002 -2.129931010122775E-002 -2.183832990253121E-002 +-2.239098604310351E-002 -2.295762326259380E-002 -2.353859500358760E-002 -2.413426363065914E-002 +-2.474500065490221E-002 -2.537118696407504E-002 -2.601321305849749E-002 -2.667147929284188E-002 +-2.734639612396317E-002 -2.803838436491594E-002 -2.874787544531139E-002 -2.947531167816899E-002 +-3.022114653342246E-002 -3.098584491824331E-002 -3.176988346434785E-002 -3.257375082245979E-002 +-3.339794796410200E-002 -3.424298849089684E-002 -3.510939895155799E-002 -3.599771916676043E-002 +-3.690850256208100E-002 -3.784231650920470E-002 -3.879974267559762E-002 -3.978137738285134E-002 +-4.078783197390809E-002 -4.181973318938216E-002 -4.287772355319560E-002 -4.396246176775330E-002 +-4.507462311888651E-002 -4.621489989079868E-002 -4.738400179125393E-002 -4.858265638725238E-002 +-4.981160955144316E-002 -5.107162591953046E-002 -5.236348935893351E-002 -5.368800344896835E-002 +-5.504599197282353E-002 -5.643829942160779E-002 -5.786579151075542E-002 -5.932935570907750E-002 +-6.082990178075801E-002 -6.236836234059522E-002 -6.394569342279828E-002 -6.556287506365432E-002 +-6.722091189838549E-002 -6.892083377252693E-002 -7.066369636815682E-002 -7.245058184532156E-002 +-7.428259949900270E-002 -7.616088643197870E-002 -7.808660824394410E-002 -8.006095973725155E-002 +-8.208516563965239E-002 -8.416048134441551E-002 -8.628819366821151E-002 -8.846962162715780E-002 +-9.070611723142469E-002 -9.299906629880929E-002 -9.534988928769340E-002 -9.776004214980245E-002 +-1.002310172031969E-001 -1.027643440259263E-001 -1.053615903707868E-001 -1.080243631016288E-001 +-1.107543091516642E-001 -1.135531165042333E-001 -1.164225151964925E-001 -1.193642783464923E-001 +-1.223802232041193E-001 -1.254722122263776E-001 -1.286421541774958E-001 -1.318920052543448E-001 +-1.352237702376545E-001 -1.386395036695267E-001 -1.421413110577351E-001 -1.457313501073159E-001 +-1.494118319799436E-001 -1.531850225815944E-001 -1.570532438789984E-001 -1.610188752453756E-001 +-1.650843548359594E-001 -1.692521809937974E-001 -1.735249136863224E-001 -1.779051759731823E-001 +-1.823956555058033E-001 -1.869991060591663E-001 -1.917183490962529E-001 -1.965562753656202E-001 +-2.015158465325431E-001 -2.066000968441458E-001 -2.118121348289422E-001 -2.171551450311704E-001 +-2.226323897802931E-001 -2.282472109960173E-001 -2.340030320291451E-001 -2.399033595385603E-001 +-2.459517854046022E-001 -2.521519886790562E-001 -2.585077375719484E-001 -2.650228914752785E-001 +-2.717014030237953E-001 -2.785473201928535E-001 -2.855647884333330E-001 -2.927580528435526E-001 +-3.001314603780194E-001 -3.076894620928077E-001 -3.154366154272564E-001 -3.233775865215995E-001 +-3.315171525700458E-001 -3.398602042087123E-001 -3.484117479377188E-001 -3.571769085766132E-001 +-3.661609317521728E-001 -3.753691864174853E-001 -3.848071674010489E-001 -3.944804979844818E-001 +-4.043949325072282E-001 -4.145563589964751E-001 -4.249708018202722E-001 -4.356444243616172E-001 +-4.465835317110437E-001 -4.577945733749677E-001 -4.692841459967773E-001 -4.810589960873428E-001 +-4.931260227612987E-001 -5.054922804751051E-001 -5.181649817625070E-001 -5.311514999626180E-001 +-5.444593719354169E-001 -5.580963007589713E-001 -5.720701584022235E-001 -5.863889883666155E-001 +-6.010610082892727E-001 -6.160946124998485E-001 -6.314983745224546E-001 -6.472810495134315E-001 +-6.634515766249300E-001 -6.800190812834753E-001 -6.969928773718290E-001 -7.143824693015220E-001 +-7.321975539624719E-001 -7.504480225350139E-001 -7.691439621485667E-001 -7.882956573699483E-001 +-8.079135915030522E-001 -8.280084476802587E-001 -8.485911097244661E-001 -8.696726627590688E-001 +-8.912643935415702E-001 -9.133777904947027E-001 -9.360245434071000E-001 -9.592165427735089E-001 +-9.829658787424076E-001 -1.007284839636650E+000 -1.032185910010263E+000 -1.057681768202096E+000 +-1.083785283344119E+000 -1.110509511779402E+000 -1.137867692841724E+000 -1.165873243945404E+000 +-1.194539754930651E+000 -1.223880981605916E+000 -1.253910838424983E+000 -1.284643390232416E+000 +-1.316092843006576E+000 -1.348273533525015E+000 -1.381199917872077E+000 -1.414886558703548E+000 +-1.449348111177906E+000 -1.484599307457896E+000 -1.520654939680539E+000 -1.557529841287179E+000 +-1.595238866598869E+000 -1.633796868515583E+000 -1.673218674210389E+000 -1.713519058682669E+000 +-1.754712716026301E+000 -1.796814228260952E+000 -1.839838031566183E+000 -1.883798379749220E+000 +-1.928709304768570E+000 -1.974584574126090E+000 -2.021437644930801E+000 -2.069281614427988E+000 +-2.118129166776900E+000 -2.167992515850654E+000 -2.218883343821204E+000 -2.270812735282193E+000 +-2.323791106652117E+000 -2.377828130589610E+000 -2.432932655142984E+000 -2.489112617345668E+000 +-2.546374950959995E+000 -2.604725488062551E+000 -2.664168854155634E+000 -2.724708356482052E+000 +-2.786345865213372E+000 -2.849081687176533E+000 -2.912914431779668E+000 -2.977840868795389E+000 +-3.043855777660017E+000 -3.110951787948824E+000 -3.179119210692590E+000 -3.248345860208869E+000 +-3.318616866132800E+000 -3.389914475348846E+000 -3.462217843545019E+000 -3.535502816137835E+000 +-3.609741698348491E+000 -3.684903014249826E+000 -3.760951254651117E+000 -3.837846613743069E+000 +-3.915544714491052E+000 -3.993996322840904E+000 -4.073147050889369E+000 -4.152937049273103E+000 +-4.233300689145533E+000 -4.314166234242856E+000 -4.395455503689904E+000 -4.477083526364375E+000 +-4.558958187827582E+000 -4.640979871040733E+000 -4.723041092321791E+000 -4.805026134259753E+000 +-4.886810677592283E+000 -4.968261434372732E+000 -5.049235785102661E+000 -5.129581422890452E+000 +-5.209136008115400E+000 -5.287726837531200E+000 -5.365170532235695E+000 -5.441272749463348E+000 +-5.515827923726221E+000 -5.588619043436204E+000 -5.659417469785441E+000 -5.727982805342765E+000 +-5.794062820536998E+000 -5.857393446941189E+000 -5.917698847039297E+000 -5.974691570941305E+000 +-6.028072811307485E+000 -6.077532768534345E+000 -6.122751139033164E+000 -6.163397740179403E+000 +-6.199133286209296E+000 -6.229610329967048E+000 -6.254474385934661E+000 -6.273365250377884E+000 +-6.285918534680279E+000 -6.291767427973547E+000 -6.290544704961770E+000 -6.281884994329302E+000 +-6.265427322261502E+000 -6.240817944332982E+000 -6.207713477262783E+000 -6.165784339728400E+000 +-6.114718508494126E+000 -6.054225592464499E+000 -5.984041222837040E+000 -5.903931752218848E+000 +-5.813699249304765E+000 -5.713186768415940E+000 -5.602283864795304E+000 -5.480932316994045E+000 +-5.349132006921396E+000 -5.206946896150050E+000 -5.054511023888581E+000 -4.892034437699690E+000 +-4.719808952662309E+000 -4.538213618405452E+000 -4.347719756508491E+000 -4.148895413481021E+000 +-3.942409057304448E+000 -3.729032328850276E+000 -3.509641644014471E+000 -3.285218428876452E+000 +-3.056847759503075E+000 -2.825715171203143E+000 -2.593101400275251E+000 -2.360374825898332E+000 +-2.128981392221127E+000 -1.900431812463062E+000 -1.676285889540162E+000 -1.458133833015132E+000 +-1.247574511620703E+000 -1.046190655700902E+000 -8.555211159312436E-001 -6.770303945822398E-001 +-5.120757939464325E-001 -3.618726733811468E-001 -2.274584711259200E-001 -1.096563282906759E-001 +-9.039348041338267E-003 7.410326992805605E-002 1.397967647871462E-001 1.884063468964680E-001 + 2.206558375286447E-001 2.376373161189566E-001 2.408094755127621E-001 2.319821999300481E-001 + 2.132847099535964E-001 1.871144625013242E-001 1.560638466997885E-001 1.228215699029496E-001 + 9.004546833679371E-002 6.020328628778985E-002 3.537772559570571E-002 1.703175227548087E-002 + 5.729742392182262E-003 8.095496302189142E-004 1.197524714767390E-012 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 + + + 1.586013978883939E-011 1.646618740130396E-011 1.709539330318276E-011 1.774864241895137E-011 + 1.842685348781618E-011 1.913098035584250E-011 1.986201331745792E-011 2.062098050821685E-011 + 2.140894935078544E-011 2.222702805618081E-011 2.307636718237494E-011 2.395816125245651E-011 + 2.487365043462572E-011 2.582412228638502E-011 2.681091356537915E-011 2.783541210943035E-011 + 2.889905878841407E-011 3.000334953071957E-011 3.114983742714533E-011 3.234013491518928E-011 + 3.357591604680394E-011 3.485891884280802E-011 3.619094773726428E-011 3.757387611526205E-011 + 3.900964894767382E-011 4.050028552659021E-011 4.204788230528247E-011 4.365461584668472E-011 + 4.532274588454422E-011 4.705461850154410E-011 4.885266942886796E-011 5.071942747184822E-011 + 5.265751806651487E-011 5.466966697204701E-011 5.675870410432086E-011 5.892756751594414E-011 + 6.117930752837676E-011 6.351709102194719E-011 6.594420588979928E-011 6.846406566203364E-011 + 7.108021430654552E-011 7.379633121331323E-011 7.661623636914610E-011 7.954389573016909E-011 + 8.258342679960258E-011 8.573910441867708E-011 8.901536677883355E-011 9.241682166365993E-011 + 9.594825292934515E-011 9.961462723276443E-011 1.034211010166569E-010 1.073730277617223E-010 + 1.114759655158339E-010 1.157356847109572E-010 1.201581762787705E-010 1.247496600763967E-010 + 1.295165936341012E-010 1.344656812372558E-010 1.396038833553429E-010 1.449384264312614E-010 + 1.504768130446988E-010 1.562268324638687E-010 1.621965716004506E-010 1.683944263831379E-010 + 1.748291135657956E-010 1.815096829868258E-010 1.884455302969928E-010 1.956464101736008E-010 + 2.031224500396125E-010 2.108841643070039E-010 2.189424691643821E-010 2.273086979296707E-010 + 2.359946169894514E-010 2.450124423473775E-010 2.543748568049389E-010 2.640950277987325E-010 + 2.741866259193352E-010 2.846638441378176E-010 2.955414177669405E-010 3.068346451851115E-010 + 3.185594093522382E-010 3.307322001477523E-010 3.433701375622096E-010 3.564909957750865E-010 + 3.701132281526431E-010 3.842559932009926E-010 3.989391815109001E-010 4.141834437321885E-010 + 4.300102196171047E-010 4.464417681734935E-010 4.635011989701727E-010 4.812125046385609E-010 + 4.996005946162512E-010 5.186913301799916E-010 5.385115608173515E-010 5.590891619882112E-010 + 5.804530743292034E-010 6.026333443562245E-010 6.256611667222746E-010 6.495689280900572E-010 + 6.743902526810206E-010 7.001600495649388E-010 7.269145617565036E-010 7.546914171880051E-010 + 7.835296816297790E-010 8.134699136328360E-010 8.445542215709659E-010 8.768263228625394E-010 + 9.103316054552744E-010 9.451171916604785E-010 9.812320044264963E-010 1.018726836144615E-009 + 1.057654420084177E-009 1.098069504557354E-009 1.140028929917928E-009 1.183591708502319E-009 + 1.228819107625327E-009 1.275774735747314E-009 1.324524631933985E-009 1.375137358734623E-009 + 1.427684098609355E-009 1.482238754041116E-009 1.538878051473079E-009 1.597681649217730E-009 + 1.658732249489382E-009 1.722115714717629E-009 1.787921188305405E-009 1.856241220001421E-009 + 1.927171896063324E-009 2.000812974394682E-009 2.077268024845737E-009 2.156644574875407E-009 + 2.239054260779264E-009 2.324612984696231E-009 2.413441077614861E-009 2.505663468608297E-009 + 2.601409860536133E-009 2.700814912460123E-009 2.804018429030354E-009 2.911165557108273E-009 + 3.022406989902972E-009 3.137899178907999E-009 3.257804553936633E-009 3.382291751565150E-009 + 3.511535852305356E-009 3.645718626839882E-009 3.785028791666659E-009 3.929662274512048E-009 + 4.079822489885875E-009 4.235720625166030E-009 4.397575937614782E-009 4.565616062744776E-009 + 4.740077334468187E-009 4.921205117479458E-009 5.109254152338980E-009 5.304488913743019E-009 + 5.507183982483914E-009 5.717624431623507E-009 5.936106227423015E-009 6.162936645593218E-009 + 6.398434703450231E-009 6.642931608584921E-009 6.896771224676707E-009 7.160310555107004E-009 + 7.433920245052558E-009 7.717985102764368E-009 8.012904640766167E-009 8.319093637732581E-009 + 8.636982721838012E-009 8.967018976396368E-009 9.309666568643050E-009 9.665407402544475E-009 + 1.003474179655199E-008 1.041818918725448E-008 1.081628885991873E-008 1.122960070694469E-008 + 1.165870601530346E-008 1.210420828406395E-008 1.256673407315908E-008 1.304693388458507E-008 + 1.354548307727224E-008 1.406308281691569E-008 1.460046106209973E-008 1.515837358810450E-008 + 1.573760504983401E-008 1.633897008536003E-008 1.696331446163525E-008 1.761151626398539E-008 + 1.828448713105412E-008 1.898317353693780E-008 1.970855812231192E-008 2.046166107642346E-008 + 2.124354157189032E-008 2.205529925432772E-008 2.289807578889583E-008 2.377305646594267E-008 + 2.468147186800300E-008 2.562459960049441E-008 2.660376608854728E-008 2.762034844249469E-008 + 2.867577639464467E-008 2.977153431006161E-008 3.090916327418121E-008 3.209026326019762E-008 + 3.331649537927024E-008 3.458958421671312E-008 3.591132025745637E-008 3.728356240418596E-008 + 3.870824059170712E-008 4.018735850120688E-008 4.172299637823125E-008 4.331731395834431E-008 + 4.497255350457906E-008 4.669104296095499E-008 4.847519922649706E-008 5.032753155435772E-008 + 5.225064508082826E-008 5.424724448919493E-008 5.632013781359949E-008 5.847224038825013E-008 + 6.070657894753584E-008 6.302629588281576E-008 6.543465366186297E-008 6.793503941718336E-008 + 7.053096970966159E-008 7.322609547422915E-008 7.602420715451853E-008 7.892924003371443E-008 + 8.194527976910718E-008 8.507656813812880E-008 8.832750900394972E-008 9.170267450903398E-008 + 9.520681150535312E-008 9.884484823030884E-008 1.026219012377533E-007 1.065432825938464E-007 + 1.106145073478832E-007 1.148413012885835E-007 1.192296089967630E-007 1.237856022057056E-007 + 1.285156884809916E-007 1.334265202319982E-007 1.385250040677330E-007 1.438183105101670E-007 + 1.493138840787253E-007 1.550194537601130E-007 1.609430438782075E-007 1.670929853792966E-007 + 1.734779275485383E-007 1.801068501741177E-007 1.869890761762042E-007 1.941342847184770E-007 + 2.015525248206477E-007 2.092542294911316E-007 2.172502303997395E-007 2.255517731110223E-007 + 2.341705328996937E-007 2.431186311703705E-007 2.524086525047222E-007 2.620536623600034E-007 + 2.720672254438555E-007 2.824634247912215E-007 2.932568815701976E-007 3.044627756446775E-007 + 3.160968669227047E-007 3.281755175205491E-007 3.407157147736878E-007 3.537350951270368E-007 + 3.672519689380368E-007 3.812853462274728E-007 3.958549634142319E-007 4.109813110716065E-007 + 4.266856627441611E-007 4.429901048656969E-007 4.599175678203834E-007 4.774918581907269E-007 + 4.957376922377390E-007 5.146807306603671E-007 5.343476146830821E-007 5.547660035223640E-007 + 5.759646132847593E-007 5.979732573512298E-007 6.208228883045603E-007 6.445456414587929E-007 + 6.691748800519019E-007 6.947452421652374E-007 7.212926894357481E-007 7.488545576294337E-007 + 7.774696091471891E-007 8.071780875368395E-007 8.380217740880163E-007 8.700440465894848E-007 + 9.032899403314937E-007 9.378062114389718E-007 9.736414026245955E-007 1.010845911454179E-006 + 1.049472061220405E-006 1.089574174524503E-006 1.131208649669383E-006 1.174434039971609E-006 + 1.219311136103725E-006 1.265903051582747E-006 1.314275311524961E-006 1.364495944791878E-006 + 1.416635579656876E-006 1.470767543127010E-006 1.526967964059705E-006 1.585315880219235E-006 + 1.645893349423556E-006 1.708785564937752E-006 1.774080975276307E-006 1.841871408582670E-006 + 1.912252201760955E-006 1.985322334541336E-006 2.061184568667623E-006 2.139945592402673E-006 + 2.221716170554849E-006 2.306611300236357E-006 2.394750372572515E-006 2.486257340589264E-006 + 2.581260893514870E-006 2.679894637740998E-006 2.782297284697374E-006 2.888612845904284E-006 + 2.998990835477021E-006 3.113586480367033E-006 3.232560938635131E-006 3.356081526063840E-006 + 3.484321951427215E-006 3.617462560748939E-006 3.755690590892066E-006 3.899200432836712E-006 + 4.048193905015948E-006 4.202880537093972E-006 4.363477864585434E-006 4.530211734730099E-006 + 4.703316624052576E-006 4.883035968053675E-006 5.069622503496578E-006 5.263338623768967E-006 + 5.464456747820586E-006 5.673259703194540E-006 5.890041123690922E-006 6.115105862221395E-006 + 6.348770419434999E-006 6.591363388717607E-006 6.843225918190112E-006 7.104712190354873E-006 + 7.376189920064240E-006 7.658040871510874E-006 7.950661394966486E-006 8.254462984022794E-006 + 8.569872854118113E-006 8.897334543162154E-006 9.237308535102911E-006 9.590272907311905E-006 + 9.956724002697024E-006 1.033717712748754E-005 1.073216727567131E-005 1.114224988110205E-005 + 1.156800159833314E-005 1.201002111327470E-005 1.246892998481291E-005 1.294537351857361E-005 + 1.344002167405736E-005 1.395357000642046E-005 1.448674064422399E-005 1.504028330452487E-005 + 1.561497634673390E-005 1.621162786672126E-005 1.683107683270552E-005 1.747419426452138E-005 + 1.814188445792229E-005 1.883508625563666E-005 1.955477436696257E-005 2.030196073775388E-005 + 2.107769597272038E-005 2.188307081203995E-005 2.271921766435447E-005 2.358731219830231E-005 + 2.448857499482120E-005 2.542427326254004E-005 2.639572261866856E-005 2.740428893788336E-005 + 2.845139027180528E-005 2.953849884176187E-005 3.066714310763183E-005 3.183890991567286E-005 + 3.305544672834858E-005 3.431846393928144E-005 3.562973727657998E-005 3.699111029791221E-005 + 3.840449698082401E-005 3.987188441193720E-005 4.139533557879818E-005 4.297699226829296E-005 + 4.461907807569341E-005 4.632390152855319E-005 4.809385932983494E-005 4.993143972481513E-005 + 5.183922599648635E-005 5.381990009435810E-005 5.587624640174079E-005 5.801115564679544E-005 + 6.022762896282817E-005 6.252878210352094E-005 6.491784981900425E-005 6.739819039890219E-005 + 6.997329038871656E-005 7.264676948615471E-005 7.542238562426005E-005 7.830404024846537E-005 + 8.129578379495538E-005 8.440182137801406E-005 8.762651869431515E-005 9.097440815242398E-005 + 9.445019523608967E-005 9.805876511023125E-005 1.018051894788660E-004 1.056947337045723E-004 + 1.097328641994493E-004 1.139252560979108E-004 1.182778012220458E-004 1.227966163506835E-004 + 1.274880518037274E-004 1.323587003537566E-004 1.374154064773546E-004 1.426652759590899E-004 + 1.481156858615755E-004 1.537742948755323E-004 1.596490540643147E-004 1.657482180179088E-004 + 1.720803564319723E-004 1.786543661280895E-004 1.854794835320151E-004 1.925652976273241E-004 + 1.999217634025453E-004 2.075592158105296E-004 2.154883842595358E-004 2.237204076562314E-004 + 2.322668500215855E-004 2.411397167014225E-004 2.503514711942193E-004 2.599150526196005E-004 + 2.698438938518572E-004 2.801519403437415E-004 2.908536696667484E-004 3.019641117950709E-004 + 3.134988701614657E-004 3.254741435143099E-004 3.379067486062486E-004 3.508141437459808E-004 + 3.642144532459036E-004 3.781264927996036E-004 3.925697958244280E-004 4.075646408057202E-004 + 4.231320796806830E-004 4.392939673012357E-004 4.560729920167618E-004 4.734927074191344E-004 + 4.915775652940278E-004 5.103529498241859E-004 5.298452130919947E-004 5.500817119305486E-004 + 5.710908461741851E-004 5.929020983614146E-004 6.155460749451546E-004 6.390545490672062E-004 + 6.634605049561009E-004 6.887981840096069E-004 7.151031326255080E-004 7.424122518466542E-004 + 7.707638488887164E-004 8.001976906216913E-004 8.307550590788135E-004 8.624788090692873E-004 + 8.954134279741459E-004 9.296050978074120E-004 9.651017596279248E-004 1.001953180390257E-003 + 1.040211022326510E-003 1.079928914954175E-003 1.121162529808745E-003 1.163969658003522E-003 + 1.208410290722746E-003 1.254546702758210E-003 1.302443539203566E-003 1.352167905424709E-003 + 1.403789460429125E-003 1.457380513761508E-003 1.513016126057709E-003 1.570774213393985E-003 + 1.630735655573455E-003 1.692984408497032E-003 1.757607620771422E-003 1.824695754712404E-003 + 1.894342711907479E-003 1.966645963507826E-003 2.041706685425973E-003 2.119629898621814E-003 + 2.200524614666385E-003 2.284503986779767E-003 2.371685466546442E-003 2.462190966519141E-003 + 2.556147028929565E-003 2.653685000732500E-003 2.754941215218025E-003 2.860057180434828E-003 + 2.969179774676730E-003 3.082461449293338E-003 3.200060439095245E-003 3.322140980633984E-003 + 3.448873538646768E-003 3.580435040966832E-003 3.717009122210427E-003 3.858786376563098E-003 + 4.005964619999091E-003 4.158749162279537E-003 4.317353089087630E-003 4.481997554671334E-003 + 4.652912085377444E-003 4.830334894474282E-003 5.014513208674134E-003 5.205703606781248E-003 + 5.404172370905698E-003 5.610195850699025E-003 5.824060841083379E-003 6.046064973961917E-003 + 6.276517124415658E-003 6.515737831908668E-003 6.764059737041917E-003 7.021828034414337E-003 + 7.289400942168550E-003 7.567150188818754E-003 7.855461517977863E-003 8.154735211622273E-003 + 8.465386632553824E-003 8.787846786740260E-003 9.122562906238885E-003 9.469999053430486E-003 + 9.830636747315309E-003 1.020497561264699E-002 1.059353405270573E-002 1.099684994653808E-002 + 1.141548137151744E-002 1.185000735210598E-002 1.230102863572803E-002 1.276916849669199E-002 + 1.325507356912898E-002 1.375941470994536E-002 1.428288789281739E-002 1.482621513428825E-002 + 1.539014545305881E-002 1.597545586359806E-002 1.658295240523070E-002 1.721347120789546E-002 + 1.786787959580134E-002 1.854707723024472E-002 1.925199729288705E-002 1.998360771082872E-002 + 2.074291242485196E-002 2.153095270224428E-002 2.234880849565039E-002 2.319759984944155E-002 + 2.407848835512776E-002 2.499267865737929E-002 2.594142001226318E-002 2.692600789933873E-002 + 2.794778568929834E-002 2.900814636887709E-002 3.010853432479592E-002 3.125044718854243E-002 + 3.243543774383071E-002 3.366511589862359E-002 3.494115072363479E-002 3.626527255926863E-002 + 3.763927519298975E-002 3.906501810914944E-002 4.054442881333175E-002 4.207950523331111E-002 + 4.367231819874513E-002 4.532501400175497E-002 4.703981704056784E-002 4.881903254842358E-002 + 5.066504940996304E-002 5.258034306733327E-002 5.456747851825800E-002 5.662911340832629E-002 + 5.876800121975880E-002 6.098699455890712E-002 6.328904854473022E-002 6.567722430048371E-002 + 6.815469255082574E-002 7.072473732652348E-002 7.339075977889671E-002 7.615628210608991E-002 + 7.902495159320658E-002 8.200054476826422E-002 8.508697167585164E-002 8.828828027026882E-002 + 9.160866092982083E-002 9.505245109381047E-002 9.862414002362579E-002 1.023283736891636E-001 + 1.061699597816364E-001 1.101538728536122E-001 1.142852595869053E-001 1.185694441886741E-001 + 1.230119339158125E-001 1.276184247273954E-001 1.323948070646003E-001 1.373471717571457E-001 + 1.424818160548668E-001 1.478052497825975E-001 1.533242016160193E-001 1.590456254755947E-001 + 1.649767070351059E-001 1.711248703406627E-001 1.774977845353474E-001 1.841033706838816E-001 + 1.909498086908737E-001 1.980455443053014E-001 2.053992962028930E-001 2.130200631370275E-001 + 2.209171311476130E-001 2.291000808161766E-001 2.375787945540599E-001 2.463634639091740E-001 + 2.554645968752379E-001 2.648930251857339E-001 2.746599115730528E-001 2.847767569713646E-001 + 2.952554076396947E-001 3.061080621794893E-001 3.173472784185771E-001 3.289859801309166E-001 + 3.410374635588135E-001 3.535154037013953E-001 3.664338603300792E-001 3.798072836884516E-001 + 3.936505198305023E-001 4.079788155474377E-001 4.228078228293061E-001 4.381536028035404E-001 + 4.540326290879629E-001 4.704617904911644E-001 4.874583929881308E-001 5.050401608936693E-001 + 5.232252371506759E-001 5.420321826443093E-001 5.614799744469707E-001 5.815880028924906E-001 + 6.023760673709444E-001 6.238643707284807E-001 6.460735121488540E-001 6.690244783855609E-001 + 6.927386332052708E-001 7.172377048945515E-001 7.425437716731818E-001 7.686792448479188E-001 + 7.956668495311675E-001 8.235296027391584E-001 8.522907886739891E-001 8.819739309837126E-001 + 9.126027617838534E-001 9.442011872131006E-001 9.767932492850091E-001 1.010403083786419E+000 + 1.045054873962551E+000 1.080772799717534E+000 1.117580982048530E+000 1.155503422421071E+000 + 1.194563936782904E+000 1.234786083904216E+000 1.276193087722850E+000 1.318807753365018E+000 + 1.362652376504839E+000 1.407748645719751E+000 1.454117537494557E+000 1.501779203523582E+000 + 1.550752849959623E+000 1.601056608259620E+000 1.652707397280593E+000 1.705720776286531E+000 + 1.760110788536652E+000 1.815889795139622E+000 1.873068298876423E+000 1.931654757717142E+000 + 1.991655387785505E+000 2.053073955558424E+000 2.115911559128453E+000 2.180166398404413E+000 + 2.245833534180202E+000 2.312904636065721E+000 2.381367719345900E+000 2.451206870916462E+000 + 2.522401964537952E+000 2.594928365753463E+000 2.668756626932225E+000 2.743852173029744E+000 + 2.820174978797888E+000 2.897679238335086E+000 2.976313028037556E+000 3.056017964199745E+000 + 3.136728856713650E+000 3.218373360535287E+000 3.300871626820664E+000 3.384135955883575E+000 + 3.468070454393972E+000 3.552570699516445E+000 3.637523412984249E+000 3.722806148413395E+000 + 3.808286995481477E+000 3.893824304927217E+000 3.979266438663885E+000 4.064451549642516E+000 + 4.149207396444270E+000 4.233351197920884E+000 4.316689533535072E+000 4.399018295370902E+000 + 4.480122698083595E+000 4.559777353330997E+000 4.637746415466567E+000 4.713783805470111E+000 + 4.787633520234990E+000 4.859030034412503E+000 4.927698802022600E+000 4.993356864964404E+000 + 5.055713575389352E+000 5.114471438620295E+000 5.169327082900756E+000 5.219972361726859E+000 + 5.266095593837488E+000 5.307382945106167E+000 5.343519955578034E+000 5.374193213719792E+000 + 5.399092178590265E+000 5.417911149088861E+000 5.430351377695985E+000 5.436123324181819E+000 + 5.434949042632221E+000 5.426564692828907E+000 5.410723164537805E+000 5.387196800620468E+000 + 5.355780202110796E+000 5.316293095520185E+000 5.268583239681751E+000 5.212529346458149E+000 + 5.148043986661832E+000 5.075076449623605E+000 4.993615522049914E+000 4.903692149193208E+000 + 4.805381938988256E+000 4.698807467746647E+000 4.584140344323987E+000 4.461602988446097E+000 + 4.331470078172054E+000 4.194069621346860E+000 4.049783606412324E+000 3.899048189155459E+000 + 3.742353373917331E+000 3.580242150493290E+000 3.413309051444106E+000 3.242198098804681E+000 + 3.067600114211031E+000 2.890249372231510E+000 2.710919583137901E+000 2.530419198423502E+000 + 2.349586039988150E+000 2.169281261984241E+000 1.990382662755268E+000 1.813777373017099E+000 + 1.640353955346093E+000 1.470993959088717E+000 1.306562983963455E+000 1.147901314893992E+000 + 9.958142000657394E-001 8.510618539711469E-001 7.143492775377758E-001 5.863159986561808E-001 + 4.675258490132335E-001 3.584569077138738E-001 2.594917595319485E-001 1.709082367536493E-001 + 9.287083965571109E-002 2.542306310172526E-002 -3.151910282694076E-002 -7.817217999083925E-002 +-1.148883368712655E-001 -1.421561944320368E-001 -1.605987546408234E-001 -1.709677927764287E-001 +-1.741339244025560E-001 -1.710714065757611E-001 -1.628365601636454E-001 -1.505385069835973E-001 +-1.353007042597320E-001 -1.182115338424319E-001 -1.002619706487867E-001 -8.226510148249258E-002 +-6.486478244285586E-002 -4.867106843062511E-002 -3.425552340464791E-002 -2.211133100224610E-002 +-1.260371269767548E-002 -5.909259850195633E-003 -1.942647218801536E-003 -2.690080039601190E-004 + 8.391833212926056E-014 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 + + +-1.275816085584227E+000 0.000000000000000E+000 0.000000000000000E+000 -4.814177794229427E+000 + + + + + 5.713073518220381E-009 5.857700662653833E-009 6.005989060668534E-009 6.158031397339205E-009 + 6.313922704074705E-009 6.473760418015427E-009 6.637644442934680E-009 6.805677211681779E-009 + 6.977963750205942E-009 7.154611743200913E-009 7.335731601411389E-009 7.521436530643325E-009 + 7.711842602521241E-009 7.907068827036787E-009 8.107237226933830E-009 8.312472913976655E-009 + 8.522904167148867E-009 8.738662512831953E-009 8.959882807013523E-009 9.186703319576714E-009 + 9.419265820723326E-009 9.657715669584842E-009 9.902201905076596E-009 1.015287733905194E-008 + 1.040989865181461E-008 1.067342649004904E-008 1.094362556722973E-008 1.122066476657256E-008 + 1.150471724659222E-008 1.179596054933200E-008 1.209457671133326E-008 1.240075237741424E-008 + 1.271467891732910E-008 1.303655254538029E-008 1.336657444305878E-008 1.370495088478911E-008 + 1.405189336685755E-008 1.440761873960420E-008 1.477234934296146E-008 1.514631314542374E-008 + 1.552974388653514E-008 1.592288122298430E-008 1.632597087839757E-008 1.673926479692432E-008 + 1.716302130071017E-008 1.759750525135674E-008 1.804298821546874E-008 1.849974863439194E-008 + 1.896807199824803E-008 1.944825102437521E-008 1.994058584028609E-008 2.044538417125708E-008 + 2.096296153266663E-008 2.149364142720271E-008 2.203775554706244E-008 2.259564398127038E-008 + 2.316765542824532E-008 2.375414741374813E-008 2.435548651434685E-008 2.497204858653912E-008 + 2.560421900167446E-008 2.625239288682402E-008 2.691697537174777E-008 2.759838184211373E-008 + 2.829703819912758E-008 2.901338112573461E-008 2.974785835956074E-008 3.050092897276317E-008 + 3.127306365896521E-008 3.206474502745515E-008 3.287646790483272E-008 3.370873964429167E-008 + 3.456208044273207E-008 3.543702366589997E-008 3.633411618175872E-008 3.725391870229881E-008 + 3.819700613400114E-008 3.916396793717233E-008 4.015540849437620E-008 4.117194748819271E-008 + 4.221422028853945E-008 4.328287834979859E-008 4.437858961799687E-008 4.550203894829341E-008 + 4.665392853303653E-008 4.783497834065657E-008 4.904592656566941E-008 5.028753009007196E-008 + 5.156056495641797E-008 5.286582685286962E-008 5.420413161052841E-008 5.557631571335585E-008 + 5.698323682100320E-008 5.842577430487623E-008 5.990482979777100E-008 6.142132775742325E-008 + 6.297621604432445E-008 6.457046651416518E-008 6.620507562527624E-008 6.788106506144750E-008 + 6.959948237051308E-008 7.136140161910261E-008 7.316792406396731E-008 7.502017884030120E-008 + 7.691932366748701E-008 7.886654557270799E-008 8.086306163287817E-008 8.291011973535446E-008 + 8.500899935790682E-008 8.716101236843297E-008 8.936750384491775E-008 9.162985291615053E-008 + 9.394947362372469E-008 9.632781580585937E-008 9.876636600359513E-008 1.012666483899294E-007 + 1.038302257224736E-007 1.064587003202274E-007 1.091537150650789E-007 1.119169544286593E-007 + 1.147501455251907E-007 1.176550591909888E-007 1.206335110912917E-007 1.236873628551096E-007 + 1.268185232388017E-007 1.300289493191110E-007 1.333206477163988E-007 1.366956758488476E-007 + 1.401561432184126E-007 1.437042127293284E-007 1.473421020399928E-007 1.510720849490745E-007 + 1.548964928167094E-007 1.588177160216755E-007 1.628382054554560E-007 1.669604740541238E-007 + 1.711870983690070E-007 1.755207201771161E-007 1.799640481323377E-007 1.845198594584303E-007 + 1.891910016848763E-007 1.939803944266797E-007 1.988910312092166E-007 2.039259813392845E-007 + 2.090883918235168E-007 2.143814893353606E-007 2.198085822318499E-007 2.253730626214340E-007 + 2.310784084841524E-007 2.369281858454816E-007 2.429260510052138E-007 2.490757528227604E-007 + 2.553811350603057E-007 2.618461387852807E-007 2.684748048336534E-007 2.752712763355788E-007 + 2.822398013049851E-007 2.893847352947156E-007 2.967105441188855E-007 3.042218066441560E-007 + 3.119232176516694E-007 3.198195907714332E-007 3.279158614909901E-007 3.362170902402503E-007 + 3.447284655544195E-007 3.534553073169931E-007 3.624030700848499E-007 3.715773464975196E-007 + 3.809838707727543E-007 3.906285222905945E-007 4.005173292681603E-007 4.106564725274767E-007 + 4.210522893586751E-007 4.317112774809957E-007 4.426400991040630E-007 4.538455850919692E-007 + 4.653347392327757E-007 4.771147426160950E-007 4.891929581214888E-007 5.015769350204942E-007 + 5.142744136951472E-007 5.272933304759591E-007 5.406418226023604E-007 5.543282333087258E-007 + 5.683611170391443E-007 5.827492447942074E-007 5.975016096131481E-007 6.126274321947595E-007 + 6.281361666606086E-007 6.440375064641467E-007 6.603413904494048E-007 6.770580090630710E-007 + 6.941978107238163E-007 7.117715083528716E-007 7.297900860699198E-007 7.482648060584904E-007 + 7.672072156051603E-007 7.866291543169447E-007 8.065427615213961E-007 8.269604838540438E-007 + 8.478950830378973E-007 8.693596438598965E-007 8.913675823492812E-007 9.139326541629951E-007 + 9.370689631833687E-007 9.607909703334458E-007 9.851135026154782E-007 1.010051762378221E-006 + 1.035621336818827E-006 1.061838207725295E-006 1.088718761465526E-006 1.116279799229268E-006 + 1.144538547529328E-006 1.173512668968616E-006 1.203220273279767E-006 1.233679928644216E-006 + 1.264910673297822E-006 1.296932027430286E-006 1.329764005385799E-006 1.363427128172547E-006 + 1.397942436288887E-006 1.433331502874229E-006 1.469616447192817E-006 1.506819948458851E-006 + 1.544965260011594E-006 1.584076223849314E-006 1.624177285531154E-006 1.665293509456231E-006 + 1.707450594529532E-006 1.750674890224378E-006 1.794993413051513E-006 1.840433863445098E-006 + 1.887024643076173E-006 1.934794872604399E-006 1.983774409879188E-006 2.033993868601571E-006 + 2.085484637458510E-006 2.138278899741569E-006 2.192409653462230E-006 2.247910731976428E-006 + 2.304816825131168E-006 2.363163500946497E-006 2.422987227846298E-006 2.484325397451888E-006 + 2.547216347952607E-006 2.611699388068019E-006 2.677814821616719E-006 2.745603972707082E-006 + 2.815109211565691E-006 2.886373981019619E-006 2.959442823649079E-006 3.034361409627442E-006 + 3.111176565265995E-006 3.189936302281305E-006 3.270689847803454E-006 3.353487675143940E-006 + 3.438381535342424E-006 3.525424489512064E-006 3.614670942003660E-006 3.706176674409330E-006 + 3.799998880426937E-006 3.896196201607131E-006 3.994828764005244E-006 4.095958215761033E-006 + 4.199647765629724E-006 4.305962222488438E-006 4.414968035842662E-006 4.526733337358139E-006 + 4.641327983444084E-006 4.758823598914345E-006 4.879293621753842E-006 5.002813349018186E-006 + 5.129459983895199E-006 5.259312683957783E-006 5.392452610638234E-006 5.528962979954941E-006 + 5.668929114523199E-006 5.812438496882566E-006 5.959580824174193E-006 6.110448064202220E-006 + 6.265134512914285E-006 6.423736853337107E-006 6.586354216003922E-006 6.753088240911531E-006 + 6.924043141045772E-006 7.099325767514999E-006 7.279045676332327E-006 7.463315196888354E-006 + 7.652249502157200E-006 7.845966680679684E-006 8.044587810368610E-006 8.248237034182334E-006 + 8.457041637713870E-006 8.671132128744024E-006 8.890642318808284E-006 9.115709406828377E-006 + 9.346474064860870E-006 9.583080526016236E-006 9.825676674603501E-006 1.007441413855665E-005 + 1.032944838420064E-005 1.059093881341619E-005 1.085904886326406E-005 1.113394610813116E-005 + 1.141580236446217E-005 1.170479379814215E-005 1.200110103459743E-005 1.230490927168319E-005 + 1.261640839542871E-005 1.293579309871225E-005 1.326326300293989E-005 1.359902278280440E-005 + 1.394328229420183E-005 1.429625670538612E-005 1.465816663144336E-005 1.502923827216987E-005 + 1.540970355344020E-005 1.579980027215343E-005 1.619977224484822E-005 1.660986946007959E-005 + 1.703034823465251E-005 1.746147137380995E-005 1.790350833547557E-005 1.835673539865347E-005 + 1.882143583609033E-005 1.929790009130787E-005 1.978642596011597E-005 2.028731877672012E-005 + 2.080089160453927E-005 2.132746543185352E-005 2.186736937240354E-005 2.242094087106718E-005 + 2.298852591474199E-005 2.357047924856492E-005 2.416716459760458E-005 2.477895489416455E-005 + 2.540623251083947E-005 2.604938949946970E-005 2.670882783614387E-005 2.738495967240193E-005 + 2.807820759279626E-005 2.878900487897086E-005 2.951779578042449E-005 3.026503579212608E-005 + 3.103119193915635E-005 3.181674306855302E-005 3.262218014854190E-005 3.344800657534122E-005 + 3.429473848772997E-005 3.516290508957755E-005 3.605304898053553E-005 3.696572649509809E-005 + 3.790150805024330E-005 3.886097850187181E-005 3.984473751026571E-005 4.085339991479567E-005 + 4.188759611811052E-005 4.294797248004908E-005 4.403519172151960E-005 4.514993333860003E-005 + 4.629289402711687E-005 4.746478811796767E-005 4.866634802345915E-005 4.989832469493981E-005 + 5.116148809201185E-005 5.245662766361647E-005 5.378455284129158E-005 5.514609354491099E-005 + 5.654210070121964E-005 5.797344677548918E-005 5.944102631662573E-005 6.094575651606926E-005 + 6.248857778083441E-005 6.407045432104942E-005 6.569237475236050E-005 6.735535271357702E-005 + 6.906042749994296E-005 7.080866471243000E-005 7.260115692345682E-005 7.443902435945090E-005 + 7.632341560067733E-005 7.825550829877211E-005 8.023650991242716E-005 8.226765846168549E-005 + 8.435022330131840E-005 8.648550591376522E-005 8.867484072213113E-005 9.091959592374984E-005 + 9.322117434483113E-005 9.558101431672523E-005 9.800059057435196E-005 1.004814151773530E-004 + 1.030250384545423E-004 1.056330499722440E-004 1.083070795271204E-004 1.110487981641092E-004 + 1.138599192201045E-004 1.167421993940314E-004 1.196974398439822E-004 1.227274873120961E-004 + 1.258342352778855E-004 1.290196251407243E-004 1.322856474322381E-004 1.356343430593488E-004 + 1.390678045787496E-004 1.425881775036032E-004 1.461976616432769E-004 1.498985124769495E-004 + 1.536930425619438E-004 1.575836229776631E-004 1.615726848060283E-004 1.656627206493412E-004 + 1.698562861865117E-004 1.741560017686251E-004 1.785645540548358E-004 1.830846976896097E-004 + 1.877192570223554E-004 1.924711278705159E-004 1.973432793272153E-004 2.023387556145867E-004 + 2.074606779839320E-004 2.127122466638953E-004 2.180967428578607E-004 2.236175307918163E-004 + 2.292780598139555E-004 2.350818665473220E-004 2.410325770968345E-004 2.471339093120611E-004 + 2.533896751071516E-004 2.598037828393642E-004 2.663802397476657E-004 2.731231544529182E-004 + 2.800367395212030E-004 2.871253140918743E-004 2.943933065719702E-004 3.018452573986533E-004 + 3.094858218713963E-004 3.173197730556621E-004 3.253520047598863E-004 3.335875345876006E-004 + 3.420315070665914E-004 3.506891968570314E-004 3.595660120405682E-004 3.686674974924117E-004 + 3.779993383385032E-004 3.875673634999063E-004 3.973775493266154E-004 4.074360233230248E-004 + 4.177490679673661E-004 4.283231246274727E-004 4.391647975752925E-004 4.502808581026295E-004 + 4.616782487406539E-004 4.733640875857903E-004 4.853456727346490E-004 4.976304868307436E-004 + 5.102262017257931E-004 5.231406832584883E-004 5.363819961536640E-004 5.499584090448993E-004 + 5.638783996236400E-004 5.781506599180109E-004 5.927841017045704E-004 6.077878620563361E-004 + 6.231713090304942E-004 6.389440474992889E-004 6.551159251276757E-004 6.716970385014099E-004 + 6.886977394093370E-004 7.061286412837312E-004 7.240006258026451E-004 7.423248496583107E-004 + 7.611127514957392E-004 7.803760590257751E-004 8.001267963169563E-004 8.203772912706376E-004 + 8.411401832839652E-004 8.624284311053620E-004 8.842553208873406E-004 9.066344744415555E-004 + 9.295798577011283E-004 9.531057893954097E-004 9.772269499424601E-004 1.001958390564666E-003 + 1.027315542633046E-003 1.053314227245918E-003 1.079970665047754E-003 1.107301486294182E-003 + 1.135323741169258E-003 1.164054910361235E-003 1.193512915903265E-003 1.223716132285581E-003 + 1.254683397845882E-003 1.286434026444810E-003 1.318987819433567E-003 1.352365077920887E-003 + 1.386586615346769E-003 1.421673770370528E-003 1.457648420080926E-003 1.494532993536322E-003 + 1.532350485642965E-003 1.571124471379764E-003 1.610879120378044E-003 1.651639211865015E-003 + 1.693430149979899E-003 1.736277979471848E-003 1.780209401789016E-003 1.825251791568369E-003 + 1.871433213536035E-003 1.918782439828262E-003 1.967328967743211E-003 2.017103037934150E-003 + 2.068135653054780E-003 2.120458596867728E-003 2.174104453827462E-003 2.229106629149178E-003 + 2.285499369375459E-003 2.343317783452756E-003 2.402597864330085E-003 2.463376511092538E-003 + 2.525691551642581E-003 2.589581765942310E-003 2.655086909830236E-003 2.722247739426420E-003 + 2.791106036140081E-003 2.861704632294196E-003 2.934087437381839E-003 3.008299464969402E-003 + 3.084386860262169E-003 3.162396928348070E-003 3.242378163135729E-003 3.324380277003370E-003 + 3.408454231175433E-003 3.494652266844189E-003 3.583027937053955E-003 3.673636139365939E-003 + 3.766533149322130E-003 3.861776654726989E-003 3.959425790766217E-003 4.059541175982152E-003 + 4.162184949125875E-003 4.267420806906436E-003 4.375314042658120E-003 4.485931585947039E-003 + 4.599342043138836E-003 4.715615738949706E-003 4.834824759003379E-003 4.957042993417176E-003 + 5.082346181440796E-003 5.210811957171814E-003 5.342519896372436E-003 5.477551564412611E-003 + 5.615990565364862E-003 5.757922592276994E-003 5.903435478649066E-003 6.052619251141638E-003 + 6.205566183542861E-003 6.362370852022357E-003 6.523130191700438E-003 6.687943554561702E-003 + 6.856912768742575E-003 7.030142199222913E-003 7.207738809952163E-003 7.389812227441342E-003 + 7.576474805852377E-003 7.767841693617107E-003 7.964030901618501E-003 8.165163372967426E-003 + 8.371363054408641E-003 8.582756969390318E-003 8.799475292831834E-003 9.021651427625134E-003 + 9.249422082905422E-003 9.482927354127490E-003 9.722310804984388E-003 9.967719551205786E-003 + 1.021930434627354E-002 1.047721966909285E-002 1.074162381365745E-002 1.101267898074788E-002 + 1.129055137170239E-002 1.157541128430012E-002 1.186743321079685E-002 1.216679593815386E-002 + 1.247368265050078E-002 1.278828103387346E-002 1.311078338326844E-002 1.344138671205549E-002 + 1.378029286379032E-002 1.412770862646918E-002 1.448384584926761E-002 1.484892156180568E-002 + 1.522315809598153E-002 1.560678321041590E-002 1.600003021754945E-002 1.640313811343490E-002 + 1.681635171026592E-002 1.723992177168403E-002 1.767410515090491E-002 1.811916493170461E-002 + 1.857537057230618E-002 1.904299805220614E-002 1.952233002197979E-002 2.001365595610371E-002 + 2.051727230883233E-002 2.103348267316524E-002 2.156259794294008E-002 2.210493647808495E-002 + 2.266082427306302E-002 2.323059512853970E-002 2.381459082630222E-002 2.441316130745856E-002 + 2.502666485394111E-002 2.565546827333816E-002 2.629994708707389E-002 2.696048572195489E-002 + 2.763747770509827E-002 2.833132586225354E-002 2.904244251952696E-002 2.977124970851373E-002 + 3.051817937483866E-002 3.128367359010358E-002 3.206818476723304E-002 3.287217587920670E-002 + 3.369612068116147E-002 3.454050393583990E-002 3.540582164235696E-002 3.629258126824997E-002 + 3.720130198476997E-002 3.813251490536642E-002 3.908676332730810E-002 4.006460297637648E-002 + 4.106660225455796E-002 4.209334249065336E-002 4.314541819371209E-002 4.422343730918901E-002 + 4.532802147771082E-002 4.645980629632635E-002 4.761944158210428E-002 4.880759163792714E-002 + 5.002493552031765E-002 5.127216730911844E-002 5.254999637882981E-002 5.385914767139585E-002 + 5.520036197020921E-002 5.657439617508833E-002 5.798202357796120E-002 5.942403413896801E-002 + 6.090123476267542E-002 6.241444957407035E-002 6.396452019397830E-002 6.555230601352596E-002 + 6.717868446723950E-002 6.884455130434446E-002 7.055082085780030E-002 7.229842631057415E-002 + 7.408831995862353E-002 7.592147347002363E-002 7.779887813963982E-002 7.972154513870464E-002 + 8.169050575862108E-002 8.370681164827093E-002 8.577153504406060E-002 8.788576899189401E-002 + 9.005062756020821E-002 9.226724604316014E-002 9.453678115299718E-002 9.686041120058649E-002 + 9.923933626302071E-002 1.016747783371535E-001 1.041679814778539E-001 1.067202119197002E-001 + 1.093327581807613E-001 1.120069311470387E-001 1.147440641360644E-001 1.175455129380643E-001 + 1.204126558330166E-001 1.233468935818344E-001 1.263496493898189E-001 1.294223688404186E-001 + 1.325665197972350E-001 1.357835922721032E-001 1.390750982569593E-001 1.424425715170955E-001 + 1.458875673432704E-001 1.494116622600171E-001 1.530164536873567E-001 1.567035595529764E-001 + 1.604746178517895E-001 1.643312861496326E-001 1.682752410276975E-001 1.723081774641204E-001 + 1.764318081489735E-001 1.806478627287212E-001 1.849580869759995E-001 1.893642418803787E-001 + 1.938681026555545E-001 1.984714576581815E-001 2.031761072133378E-001 2.079838623413518E-001 + 2.128965433804712E-001 2.179159784995794E-001 2.230440020948770E-001 2.282824530641546E-001 + 2.336331729519603E-001 2.390980039586419E-001 2.446787868058939E-001 2.503773584510773E-001 + 2.561955496421954E-001 2.621351823050089E-001 2.681980667533456E-001 2.743859987132232E-001 + 2.807007561509228E-001 2.871440958946723E-001 2.937177500390677E-001 3.004234221208222E-001 + 3.072627830538615E-001 3.142374668111733E-001 3.213490658402017E-001 3.285991261978967E-001 + 3.359891423908508E-001 3.435205519052233E-001 3.511947294103880E-001 3.590129806194707E-001 + 3.669765357890997E-001 3.750865428398666E-001 3.833440600781134E-001 3.917500484987532E-001 + 4.003053636479501E-001 4.090107470235244E-001 4.178668169900496E-001 4.268740591846757E-001 + 4.360328163888140E-001 4.453432778399675E-001 4.548054679571731E-001 4.644192344528016E-001 + 4.741842358028488E-001 4.840999280473583E-001 4.941655508923467E-001 5.043801130845090E-001 + 5.147423770302204E-001 5.252508426309177E-001 5.359037303079197E-001 5.466989631912692E-001 + 5.576341484492779E-001 5.687065577382957E-001 5.799131067559328E-001 5.912503338856296E-001 + 6.027143779263657E-001 6.143009549084800E-001 6.260053340053687E-001 6.378223125614040E-001 + 6.497461902689722E-001 6.617707425425083E-001 6.738891931548775E-001 6.860941862219171E-001 + 6.983777576446752E-001 7.107313061461353E-001 7.231455640705178E-001 7.356105681487528E-001 + 7.481156304739432E-001 7.606493099757455E-001 7.731993847329376E-001 7.857528255192076E-001 + 7.982957710384382E-001 8.108135053724798E-001 8.232904382364516E-001 8.357100887134206E-001 + 8.480550732214085E-001 8.603070985497995E-001 8.724469608881676E-001 8.844545518561425E-001 + 8.963088726258920E-001 9.079880573057736E-001 9.194694068207137E-001 9.307294345771253E-001 + 9.417439252316196E-001 9.524880078864280E-001 9.629362450020343E-001 9.730627382392718E-001 + 9.828412523080385E-001 9.922453576951257E-001 1.001248592855112E+000 1.009824646060030E+000 + 1.017947556597752E+000 1.025591934366663E+000 1.032733196113644E+000 1.039347815581042E+000 + 1.045413583640763E+000 1.050909873072501E+000 1.055817900958262E+000 1.060120979682472E+000 + 1.063804745207637E+000 1.066857348594371E+000 1.069269593597920E+000 1.071034999536379E+000 + 1.072149764409427E+000 1.072612598354798E+000 1.072424391847801E+000 1.071587690426032E+000 + 1.070106118270693E+000 1.067984202196006E+000 1.065227351723261E+000 1.061841848932560E+000 + 1.057834836312705E+000 1.053214302726913E+000 1.047989067607154E+000 1.042168763484356E+000 + 1.035763816955753E+000 1.028785428184352E+000 1.021245549019500E+000 1.013156859821308E+000 + 1.004532745065794E+000 9.953872678016865E-001 9.857351430238847E-001 9.755917100227249E-001 + 9.649729037621617E-001 9.538952253338502E-001 9.423757115279076E-001 9.304319035546309E-001 + 9.180818149450930E-001 9.053438986518637E-001 8.922370133647387E-001 8.787803890501622E-001 + 8.649935917172931E-001 8.508964874088556E-001 8.365092054115097E-001 8.218521006761215E-001 + 8.069457154407494E-001 7.918107400541491E-001 7.764679729979741E-001 7.609382801129556E-001 + 7.452425530561088E-001 7.294016670367529E-001 7.134364378889109E-001 6.973675785709821E-001 + 6.812156552203880E-001 6.650010429212662E-001 6.487438813816720E-001 6.324640307551969E-001 + 6.161810278793450E-001 5.999140432373210E-001 5.836818389791119E-001 5.675027283596522E-001 + 5.513945369645278E-001 5.353745660955663E-001 5.194595586785719E-001 5.036656680328989E-001 + 4.880084298076144E-001 4.725027373423477E-001 4.571628206540134E-001 4.420022291852051E-001 + 4.270338183785754E-001 4.122697400665679E-001 3.977214365901936E-001 3.833996384871282E-001 + 3.693143655208982E-001 3.554749307620615E-001 3.418899473813509E-001 3.285673377757301E-001 + 3.155143446227681E-001 3.027375434476552E-001 2.902428562910548E-001 2.780355660845704E-001 + 2.661203313730894E-001 2.545012010681478E-001 2.431816289715946E-001 2.321644878716100E-001 + 2.214520830804775E-001 2.110461653521245E-001 2.009479431840698E-001 1.911580945698065E-001 + 1.816767783211351E-001 1.725036451232393E-001 1.636378485168610E-001 1.550780560209846E-001 + 1.468224606159177E-001 1.388687928012488E-001 1.312143334271021E-001 1.238559274721409E-001 + 1.167899989098829E-001 1.100125667682416E-001 1.035192624479151E-001 9.730534832530055E-002 + 9.136573762674108E-002 8.569501552456846E-002 8.028746137268214E-002 7.513707197108518E-002 + 7.023758572533338E-002 6.558250754842999E-002 6.116513433927525E-002 5.697858086311113E-002 + 5.301580585514614E-002 4.926963816823227E-002 4.573280278860544E-002 4.239794654977374E-002 + 3.925766338312286E-002 3.630451895422748E-002 3.353107454575449E-002 3.092991006081133E-002 + 2.849364603427643E-002 2.621496455373082E-002 2.408662900583072E-002 2.210150257809416E-002 + 2.025256545993835E-002 1.853293070024925E-002 1.693585869167060E-002 1.545477026407370E-002 + 1.408325838123921E-002 1.281509844559459E-002 1.164425722586924E-002 1.056490043172602E-002 + 9.571398967791302E-003 8.658333907028448E-003 7.820500230084950E-003 7.052909383099762E-003 + 6.350790711498487E-003 5.709591831549846E-003 5.124978004929267E-003 4.592830584262377E-003 + 4.109244599632740E-003 3.670525557367215E-003 3.273185523095274E-003 2.913938561153695E-003 + 2.589695601915163E-003 2.297558807601527E-003 2.034815505642234E-003 1.798931756701356E-003 + 1.587545622167612E-003 1.398460193226809E-003 1.229636440661425E-003 1.079185941292917E-003 + 9.453635335442980E-004 8.265599509974068E-004 7.212944790941751E-004 6.282076763252864E-004 + 5.460541974023030E-004 4.736957520579292E-004 4.100942292983616E-004 3.543050131738807E-004 + 3.054705124685239E-004 2.628139231632024E-004 2.256332391226233E-004 1.932955232151000E-004 + 1.652314480130730E-004 1.409301123549920E-004 1.199341373870588E-004 1.018350432542563E-004 + 8.626890537813499E-005 7.291233640150445E-005 6.147907744004595E-005 5.171549535898937E-005 + 4.339782795511430E-005 3.632921638739082E-005 3.033691447022094E-005 2.526972787969675E-005 + 2.099567181922993E-005 1.739983533262328E-005 1.438244023885100E-005 1.185708258120988E-005 + 9.749144521328623E-006 7.994364752793941E-006 6.537555746872585E-006 5.331456461151729E-006 + 4.335709528389563E-006 3.515952385446531E-006 2.843012289435873E-006 2.292195689473453E-006 + 1.842662967682300E-006 1.476880123333771E-006 1.180139540953571E-006 9.401425495972628E-007 + 7.466370398927241E-007 5.911039523531816E-007 4.664869802480603E-007 3.669603391777808E-007 + 2.877299404177229E-007 2.248637637934849E-007 1.751476567137884E-007 1.359631880161464E-007 + 1.051845580117335E-007 8.109190956092001E-008 6.229869958723697E-008 4.769107690389118E-008 + 3.637747162137628E-008 2.764683498609501E-008 2.093417769404813E-008 1.579224107433428E-008 + 1.186830066233223E-008 8.885247235514923E-009 6.626218021846809E-009 4.922162142119893E-009 + 3.641820995427706E-009 2.683687756578669E-009 1.969581860278122E-009 1.439535643347646E-009 + 1.047742449858767E-009 7.593596208553931E-010 5.479969346747525E-010 3.937521796580370E-010 + 2.816814747023348E-010 2.006134579316893E-010 1.422342052421618E-010 1.003843023343886E-010 + 7.052138454863003E-011 4.931111824374260E-011 3.431740362083495E-011 2.376885448501602E-011 + 1.638362916513345E-011 1.123867933374322E-011 7.672642966114915E-012 5.214094957198777E-012 + 3.528817082726973E-012 2.381267665705056E-012 1.606610446594055E-012 1.078256886535217E-012 + 7.198041870942759E-013 4.779228553322317E-013 3.155898280464901E-013 2.072430855648540E-013 + 1.353314306877513E-013 8.787153240779351E-014 5.672801387318032E-014 3.640955450006067E-014 + 2.323109714123703E-014 1.473426263149192E-014 9.288782155599184E-015 5.820064242028050E-015 + 3.624114725770366E-015 2.242576991226764E-015 1.378890353981225E-015 8.423921308768696E-016 + 5.112883268606081E-016 3.082824713341214E-016 1.846405501524063E-016 1.098409058846233E-016 + 6.489674298765667E-017 3.807728841250568E-017 2.218479982492339E-017 1.283373294676381E-017 + 7.370883977723126E-018 4.202578824714963E-018 2.378493684635331E-018 1.336095816291324E-018 + 7.448722400973624E-019 4.120910295415995E-019 2.262193762774352E-019 1.232109378229029E-019 + 6.657460053597807E-020 3.568323323569961E-020 1.897020761358039E-020 1.000201734219212E-020 + 5.229565096754398E-021 2.711191803593430E-021 1.393558756714095E-021 7.100906411562849E-022 + 3.586561278527761E-022 1.795438721015096E-022 8.907217994028038E-023 4.378682172295313E-023 + 2.132674992965308E-023 1.029047160316851E-023 4.918402076622400E-024 2.328300786043027E-024 + 1.091510579423154E-024 5.066843226623238E-025 2.328701444012627E-025 1.059503715396926E-025 + 4.771427112535666E-026 2.126646769693280E-026 9.379660074655577E-027 4.093230616476988E-027 + 1.767155174112370E-027 7.546642390310776E-028 3.187454398608921E-028 1.331328045537664E-028 + 5.498143627775605E-029 2.244787423740202E-029 9.059411034646792E-030 3.613491102970009E-030 + 1.424269509825342E-030 5.546647941388047E-031 2.133912065368205E-031 8.108926453879534E-032 + 3.043152537539202E-032 1.127689003239632E-032 4.125638003053172E-033 1.489906654045815E-033 + 5.310339718188228E-034 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 + + +-1.109914671868205E-012 -1.152326727870288E-012 -1.196359433208574E-012 -1.242074716145936E-012 +-1.289536871331851E-012 -1.338812650242699E-012 -1.389971355062025E-012 -1.443084936148156E-012 +-1.498228093226232E-012 -1.555478380447005E-012 -1.614916315460140E-012 -1.676625492655419E-012 +-1.740692700731117E-012 -1.807208044754909E-012 -1.876265072888960E-012 -1.947960907957430E-012 +-2.022396384041449E-012 -2.099676188293648E-012 -2.179909008171710E-012 -2.263207684298002E-012 +-2.349689369160283E-012 -2.439475691876691E-012 -2.532692929256706E-012 -2.629472183398720E-012 +-2.729949566073948E-012 -2.834266390156022E-012 -2.942569368365481E-012 -3.055010819608706E-012 +-3.171748883201442E-012 -3.292947741278269E-012 -3.418777849700744E-012 -3.549416177789040E-012 +-3.685046457214173E-012 -3.825859440400923E-012 -3.972053168804822E-012 -4.123833251440576E-012 +-4.281413154053562E-012 -4.445014499341196E-012 -4.614867378646326E-012 -4.791210675561068E-012 +-4.974292401896150E-012 -5.164370046488373E-012 -5.361710937336643E-012 -5.566592617575997E-012 +-5.779303235818310E-012 -6.000141951408667E-012 -6.229419355167470E-012 -6.467457906209882E-012 +-6.714592385457000E-012 -6.971170366476631E-012 -7.237552704315803E-012 -7.514114043012578E-012 +-7.801243342500821E-012 -8.099344425649154E-012 -8.408836546203285E-012 -8.730154978430543E-012 +-9.063751629295926E-012 -9.410095674030595E-012 -9.769674215986787E-012 -1.014299297170695E-011 +-1.053057698217080E-011 -1.093297135122061E-011 -1.135074201220309E-011 -1.178447652390622E-011 +-1.223478489691044E-011 -1.270230045151631E-011 -1.318768070845530E-011 -1.369160831363649E-011 +-1.421479199822950E-011 -1.475796757543427E-011 -1.532189897533935E-011 -1.590737931932406E-011 +-1.651523203551586E-011 -1.714631201687144E-011 -1.780150682351046E-011 -1.848173793099279E-011 +-1.918796202629486E-011 -1.992117235330807E-011 -2.068240010975102E-011 -2.147271589746076E-011 +-2.229323122810249E-011 -2.314510008641532E-011 -2.402952055319287E-011 -2.494773649028119E-011 +-2.590103928996368E-011 -2.689076969119345E-011 -2.791831966522755E-011 -2.898513437331523E-011 +-3.009271419919302E-011 -3.124261685924550E-011 -3.243645959329974E-011 -3.367592143913411E-011 +-3.496274559390068E-011 -3.629874186578200E-011 -3.768578921933093E-011 -3.912583841807252E-011 +-4.062091476808511E-011 -4.217312096641934E-011 -4.378464005836023E-011 -4.545773850769275E-011 +-4.719476938428780E-011 -4.899817567349233E-011 -5.087049371197791E-011 -5.281435675487957E-011 +-5.483249867924211E-011 -5.692775782898258E-011 -5.910308100677614E-011 -6.136152761847969E-011 +-6.370627397592253E-011 -6.614061776411417E-011 -6.866798267915393E-011 -7.129192324336335E-011 +-7.401612980441505E-011 -7.684443372548741E-011 -7.978081277374560E-011 -8.282939671472708E-011 +-8.599447312049908E-011 -8.928049339975802E-011 -9.269207905834959E-011 -9.623402819901681E-011 +-9.991132226951503E-011 -1.037291330685864E-010 -1.076928300196463E-010 -1.118079877224109E-010 +-1.160803937930876E-010 -1.205160570041543E-010 -1.251212157351757E-010 -1.299023467465412E-010 +-1.348661742884648E-010 -1.400196795580576E-010 -1.453701105177737E-010 -1.509249920890369E-010 +-1.566921367353869E-010 -1.626796554500271E-010 -1.688959691632289E-010 -1.753498205856329E-010 +-1.820502865041089E-010 -1.890067905474613E-010 -1.962291164399378E-010 -2.037274217611819E-010 +-2.115122522319764E-010 -2.195945565458756E-010 -2.279857017675807E-010 -2.366974893197187E-010 +-2.457421715805052E-010 -2.551324691156352E-010 -2.648815885686400E-010 -2.750032412348660E-010 +-2.855116623452028E-010 -2.964216310866792E-010 -3.077484913880821E-010 -3.195081734998356E-010 +-3.317172163984882E-010 -3.443927910473178E-010 -3.575527245457688E-010 -3.712155252016827E-010 +-3.854004085615900E-010 -4.001273244356655E-010 -4.154169849553591E-010 -4.312908937031633E-010 +-4.477713759554795E-010 -4.648816100811268E-010 -4.826456601396412E-010 -5.010885097252221E-010 +-5.202360971039142E-010 -5.401153516934474E-010 -5.607542319370465E-010 -5.821817646244585E-010 +-6.044280857155177E-010 -6.275244827236505E-010 -6.515034387189335E-010 -6.763986780125896E-010 +-7.022452135871754E-010 -7.290793963391566E-010 -7.569389662031409E-010 -7.858631052296501E-010 +-8.158924926911055E-010 -8.470693622935004E-010 -8.794375615742384E-010 -9.130426135696757E-010 +-9.479317808390810E-010 -9.841541319350821E-010 -1.021760610414045E-009 -1.060804106483487E-009 +-1.101339531387250E-009 -1.143423894633069E-009 -1.187116384171142E-009 -1.232478449636462E-009 +-1.279573888771996E-009 -1.328468937154233E-009 -1.379232361347305E-009 -1.431935555616695E-009 +-1.486652642338536E-009 -1.543460576245737E-009 -1.602439252657524E-009 -1.663671619844602E-009 +-1.727243795688015E-009 -1.793245188795714E-009 -1.861768624247205E-009 -1.932910474143117E-009 +-2.006770793143271E-009 -2.083453459183904E-009 -2.163066319571924E-009 -2.245721342661674E-009 +-2.331534775327502E-009 -2.420627306453629E-009 -2.513124236671231E-009 -2.609155654581438E-009 +-2.708856619712110E-009 -2.812367352465689E-009 -2.919833431325228E-009 -3.031405997596022E-009 +-3.147241967970711E-009 -3.267504255216809E-009 -3.392361997297108E-009 -3.521990795245027E-009 +-3.656572960129651E-009 -3.796297769457609E-009 -3.941361733372446E-009 -4.091968871025926E-009 +-4.248330997509826E-009 -4.410668021751880E-009 -4.579208255794682E-009 -4.754188735892643E-009 +-4.935855555878495E-009 -5.124464213268199E-009 -5.320279968591006E-009 -5.523578218450016E-009 +-5.734644882837889E-009 -5.953776807252394E-009 -6.181282180177324E-009 -6.417480966515964E-009 +-6.662705357586545E-009 -6.917300238312623E-009 -7.181623672265383E-009 -7.456047405240013E-009 +-7.740957388074396E-009 -8.036754319445223E-009 -8.343854209405098E-009 -8.662688964452967E-009 +-8.993706994960781E-009 -9.337373845810655E-009 -9.694172851129279E-009 -1.006460581404052E-008 +-1.044919371239202E-008 -1.084847743144834E-008 -1.126301852458107E-008 -1.169340000302564E-008 +-1.214022715581544E-008 -1.260412840104647E-008 -1.308575616966943E-008 -1.358578782305247E-008 +-1.410492660560463E-008 -1.464390263379978E-008 -1.520347392299212E-008 -1.578442745346678E-008 +-1.638758027722528E-008 -1.701378066706173E-008 -1.766390930954626E-008 -1.833888054359288E-008 +-1.903964364635380E-008 -1.976718416824852E-008 -2.052252531900485E-008 -2.130672940666162E-008 +-2.212089933155591E-008 -2.296618013739626E-008 -2.384376062160304E-008 -2.475487500718028E-008 +-2.570080467847019E-008 -2.668287998323128E-008 -2.770248210357426E-008 -2.876104499838657E-008 +-2.986005741997713E-008 -3.100106500777712E-008 -3.218567246204125E-008 -3.341554580060568E-008 +-3.469241470187672E-008 -3.601807493734452E-008 -3.739439089704267E-008 -3.882329821150491E-008 +-4.030680647390579E-008 -4.184700206621344E-008 -4.344605109332828E-008 -4.510620242933335E-008 +-4.682979088014072E-008 -4.861924046697992E-008 -5.047706783534655E-008 -5.240588579420400E-008 +-5.440840699041484E-008 -5.648744772356923E-008 -5.864593190657386E-008 -6.088689517757069E-008 +-6.321348916896752E-008 -6.562898593958285E-008 -6.813678257613720E-008 -7.074040597056072E-008 +-7.344351777983526E-008 -7.624991957534354E-008 -7.916355818896654E-008 -8.218853126344649E-008 +-8.532909301481786E-008 -8.858966021501038E-008 -9.197481840303482E-008 -9.548932833348504E-008 +-9.913813267142262E-008 -1.029263629430567E-007 -1.068593467519929E-007 -1.109426152711961E-007 +-1.151819110212008E-007 -1.195831959455045E-007 -1.241526597944992E-007 -1.288967288297264E-007 +-1.338220748606932E-007 -1.389356246269571E-007 -1.442445695386652E-007 -1.497563757892466E-007 +-1.554787948544711E-007 -1.614198743926371E-007 -1.675879695612115E-007 -1.739917547658307E-007 +-1.806402358581798E-007 -1.875427627998985E-007 -1.947090428103139E-007 -2.021491540164871E-007 +-2.098735596247572E-007 -2.178931226337076E-007 -2.262191211092353E-007 -2.348632640431957E-007 +-2.438377078179147E-007 -2.531550732997120E-007 -2.628284635854634E-007 -2.728714824271450E-007 +-2.832982533602601E-007 -2.941234395630308E-007 -3.053622644742722E-007 -3.170305331989269E-007 +-3.291446547313423E-007 -3.417216650275299E-007 -3.547792509588334E-007 -3.683357751806652E-007 +-3.824103019512718E-007 -3.970226239368060E-007 -4.121932900403800E-007 -4.279436342942080E-007 +-4.442958058554416E-007 -4.612728001478520E-007 -4.788984911931141E-007 -4.971976651771378E-007 +-5.161960552986004E-007 -5.359203779486576E-007 -5.563983702726666E-007 -5.776588291666999E-007 +-5.997316517636425E-007 -6.226478774657589E-007 -6.464397315827813E-007 -6.711406706368349E-007 +-6.967854293978464E-007 -7.234100697155143E-007 -7.510520312164484E-007 -7.797501839376902E-007 +-8.095448829705630E-007 -8.404780251916009E-007 -8.725931081602535E-007 -9.059352912660913E-007 +-9.405514592114056E-007 -9.764902879183558E-007 -1.013802312953252E-006 -1.052540000564045E-006 +-1.092757821430818E-006 -1.134512327232823E-006 -1.177862230139611E-006 -1.222868485337860E-006 +-1.269594376709812E-006 -1.318105605783591E-006 -1.368470384080320E-006 -1.420759528987680E-006 +-1.475046563294531E-006 -1.531407818526310E-006 -1.589922542226298E-006 -1.650673009333321E-006 +-1.713744637812268E-006 -1.779226108699681E-006 -1.847209490732967E-006 -1.917790369738086E-006 +-1.991067982957360E-006 -2.067145358505855E-006 -2.146129460152090E-006 -2.228131337626162E-006 +-2.313266282666246E-006 -2.401653991022370E-006 -2.493418730644751E-006 -2.588689516292659E-006 +-2.687600290808700E-006 -2.790290113312826E-006 -2.896903354580009E-006 -3.007589899875586E-006 +-3.122505359532750E-006 -3.241811287567424E-006 -3.365675408637110E-006 -3.494271853661897E-006 +-3.627781404437967E-006 -3.766391747586455E-006 -3.910297738193718E-006 -4.059701673512444E-006 +-4.214813577107255E-006 -4.375851493842956E-006 -4.543041796128763E-006 -4.716619501847624E-006 +-4.896828604416023E-006 -5.083922415436590E-006 -5.278163920423539E-006 -5.479826148099044E-006 +-5.689192553777761E-006 -5.906557417376366E-006 -6.132226256605240E-006 -6.366516255920829E-006 +-6.609756711839101E-006 -6.862289495233224E-006 -7.124469531262622E-006 -7.396665297604751E-006 +-7.679259341686719E-006 -7.972648817640326E-006 -8.277246043731435E-006 -8.593479081043327E-006 +-8.921792334223137E-006 -9.262647175131274E-006 -9.616522590265581E-006 -9.983915852865115E-006 +-1.036534322063276E-005 -1.076134066005144E-005 -1.117246459830585E-005 -1.159929270385994E-005 +-1.204242469678006E-005 -1.250248318993528E-005 -1.298011456224919E-005 -1.347598986522168E-005 +-1.399080576398618E-005 -1.452528551421461E-005 -1.508017997623328E-005 -1.565626866776367E-005 +-1.625436085675581E-005 -1.687529669583786E-005 -1.751994839996257E-005 -1.818922146889174E-005 +-1.888405595622147E-005 -1.960542778671531E-005 -2.035435012377961E-005 -2.113187478898429E-005 +-2.193909373560470E-005 -2.277714057823408E-005 -2.364719218059415E-005 -2.455047030375188E-005 +-2.548824331703256E-005 -2.646182797400761E-005 -2.747259125602342E-005 -2.852195228583163E-005 +-2.961138431397762E-005 -3.074241678070339E-005 -3.191663745622573E-005 -3.313569466235779E-005 +-3.440129957855380E-005 -3.571522863557279E-005 -3.707932600007716E-005 -3.849550615360676E-005 +-3.996575656949813E-005 -4.149214049145277E-005 -4.307679981759752E-005 -4.472195809402413E-005 +-4.642992362194448E-005 -4.820309268275291E-005 -5.004395288544889E-005 -5.195508664103849E-005 +-5.393917476870679E-005 -5.599900023873294E-005 -5.813745205730445E-005 -6.035752929858140E-005 +-6.266234528955890E-005 -6.505513195348601E-005 -6.753924431781150E-005 -7.011816519285037E-005 +-7.279551002759639E-005 -7.557503194934448E-005 -7.846062699403367E-005 -8.145633953448076E-005 +-8.456636791393803E-005 -8.779507029268650E-005 -9.114697071566104E-005 -9.462676540940080E-005 +-9.823932931692565E-005 -1.019897228794554E-004 -1.058831990742199E-004 -1.099252107179519E-004 +-1.141214180460019E-004 -1.184776965773876E-004 -1.230001452764674E-004 -1.276950950223183E-004 +-1.325691173973110E-004 -1.376290338067911E-004 -1.428819249422184E-004 -1.483351406005623E-004 +-1.539963098732239E-004 -1.598733517182401E-004 -1.659744859300237E-004 -1.723082445214180E-004 +-1.788834835333796E-004 -1.857093952881595E-004 -1.927955211024309E-004 -2.001517644774069E-004 +-2.077884047836091E-004 -2.157161114585890E-004 -2.239459587365560E-004 -2.324894409295671E-004 +-2.413584882806121E-004 -2.505654834096953E-004 -2.601232783747346E-004 -2.700452123699083E-004 +-2.803451300848720E-004 -2.910374007491100E-004 -3.021369378865511E-004 -3.136592198064641E-004 +-3.256203108575795E-004 -3.380368834733307E-004 -3.509262410370919E-004 -3.643063415973189E-004 +-3.781958224635301E-004 -3.926140257151664E-004 -4.075810246564821E-004 -4.231176512517721E-004 +-4.392455245764401E-004 -4.559870803206434E-004 -4.733656013835080E-004 -4.914052495972423E-004 +-5.101310986218039E-004 -5.295691680521814E-004 -5.497464587817915E-004 -5.706909896669606E-004 +-5.924318355390044E-004 -6.149991666119614E-004 -6.384242893356965E-004 -6.627396887457125E-004 +-6.879790723627608E-004 -7.141774156970851E-004 -7.413710094139555E-004 -7.695975082190248E-004 +-7.988959815239458E-004 -8.293069659546778E-004 -8.608725197669320E-004 -8.936362792352826E-004 +-9.276435170846195E-004 -9.629412030348161E-004 -9.995780665317182E-004 -1.037604661739899E-003 +-1.077073434874960E-003 -1.118038793955617E-003 -1.160557181058260E-003 -1.204687147159246E-003 +-1.250489429652756E-003 -1.298027032634730E-003 -1.347365310046105E-003 -1.398572051771327E-003 +-1.451717572790977E-003 -1.506874805490197E-003 -1.564119395227577E-003 -1.623529799272130E-003 +-1.685187389219019E-003 -1.749176556997832E-003 -1.815584824590297E-003 -1.884502957577516E-003 +-1.956025082640092E-003 -2.030248809137656E-003 -2.107275354897749E-003 -2.187209676347222E-003 +-2.270160603122759E-003 -2.356240977300412E-003 -2.445567797387572E-003 -2.538262367224019E-003 +-2.634450449942266E-003 -2.734262427140656E-003 -2.837833463426205E-003 -2.945303676487375E-003 +-3.056818312860455E-003 -3.172527929556371E-003 -3.292588581718029E-003 -3.417162016481457E-003 +-3.546415873217016E-003 -3.680523890330034E-003 -3.819666118802951E-003 -3.964029142663790E-003 +-4.113806306568509E-003 -4.269197950686902E-003 -4.430411653084150E-003 -4.597662479791959E-003 +-4.771173242765036E-003 -4.951174765920034E-003 -5.137906159455257E-003 -5.331615102650311E-003 +-5.532558135345192E-003 -5.741000958298393E-003 -5.957218742623273E-003 -6.181496448500787E-003 +-6.414129153365493E-003 -6.655422389759563E-003 -6.905692493046788E-003 -7.165266959175435E-003 +-7.434484812674378E-003 -7.713696985062252E-003 -8.003266703843496E-003 -8.303569892258162E-003 +-8.614995579944981E-003 -8.937946324667810E-003 -9.272838645245928E-003 -9.620103465816841E-003 +-9.980186571547769E-003 -1.035354907589778E-002 -1.074066789951627E-002 -1.114203626084673E-002 +-1.155816417848449E-002 -1.198957898531658E-002 -1.243682585444796E-002 -1.290046833689312E-002 +-1.338108891098384E-002 -1.387928954341365E-002 -1.439569226180608E-002 -1.493093973865805E-002 +-1.548569588647051E-002 -1.606064646383623E-002 -1.665649969220912E-002 -1.727398688302946E-002 +-1.791386307482755E-002 -1.857690767986958E-002 -1.926392513984924E-002 -1.997574559006194E-002 +-2.071322553142768E-002 -2.147724850965326E-002 -2.226872580074288E-002 -2.308859710197935E-002 +-2.393783122740654E-002 -2.481742680674327E-002 -2.572841298655550E-002 -2.667185013240022E-002 +-2.764883053053632E-002 -2.866047908767118E-002 -2.970795402707713E-002 -3.079244757927070E-002 +-3.191518666529630E-002 -3.307743357049753E-002 -3.428048660649127E-002 -3.552568075888173E-002 +-3.681438831806583E-002 -3.814801949028370E-002 -3.952802298586160E-002 -4.095588658137812E-002 +-4.243313765225470E-002 -4.396134367203627E-002 -4.554211267437402E-002 -4.717709367346578E-002 +-4.886797703843540E-002 -5.061649481684945E-002 -5.242442100227689E-002 -5.429357174049071E-002 +-5.622580546859501E-002 -5.822302298103475E-002 -6.028716741610696E-002 -6.242022415624730E-002 +-6.462422063500889E-002 -6.690122604328452E-002 -6.925335092695563E-002 -7.168274666776722E-002 +-7.419160483884985E-002 -7.678215642591707E-002 -7.945667090478138E-002 -8.221745516543870E-002 +-8.506685227258455E-002 -8.800724005204137E-002 -9.104102949219905E-002 -9.417066294920466E-002 +-9.739861214428548E-002 -1.007273759412508E-001 -1.041594778919085E-001 -1.076974635368411E-001 +-1.113438974487319E-001 -1.151013600052123E-001 -1.189724438780256E-001 -1.229597502251756E-001 +-1.270658845726585E-001 -1.312934523723746E-001 -1.356450542228826E-001 -1.401232807398072E-001 +-1.447307070629594E-001 -1.494698869875623E-001 -1.543433467074420E-001 -1.593535781586139E-001 +-1.645030319524126E-001 -1.697941098881814E-001 -1.752291570365528E-001 -1.808104533855603E-001 +-1.865402050432015E-001 -1.924205349916691E-001 -1.984534733902655E-001 -2.046409474260645E-001 +-2.109847707136547E-001 -2.174866322478557E-001 -2.241480849160995E-001 -2.309705335802841E-001 +-2.379552227412933E-001 -2.451032238030917E-001 -2.524154219573245E-001 -2.598925027137000E-001 +-2.675349381061115E-001 -2.753429726094589E-001 -2.833166088074742E-001 -2.914555928575161E-001 +-2.997593998042666E-001 -3.082272188005585E-001 -3.168579383001092E-001 -3.256501312937503E-001 +-3.346020406677969E-001 -3.437115647704025E-001 -3.529762432791173E-001 -3.623932434703024E-001 +-3.719593469984950E-001 -3.816709373012314E-001 -3.915239877520540E-001 -4.015140506914548E-001 +-4.116362474721451E-001 -4.218852596612518E-001 -4.322553215476302E-001 -4.427402141073426E-001 +-4.533332605843729E-001 -4.640273238465699E-001 -4.748148056785735E-001 -4.856876481738981E-001 +-4.966373373870987E-001 -5.076549094041326E-001 -5.187309589841382E-001 -5.298556509190070E-001 +-5.410187342479129E-001 -5.522095594523835E-001 -5.634170987433210E-001 -5.746299695344752E-001 +-5.858364611771563E-001 -5.970245650083612E-001 -6.081820077388723E-001 -6.192962881793401E-001 +-6.303547172708437E-001 -6.413444613520145E-001 -6.522525885576996E-001 -6.630661182044184E-001 +-6.737720729758485E-001 -6.843575336775426E-001 -6.948096962843713E-001 -7.051159309573447E-001 +-7.152638426587341E-001 -7.252413329467774E-001 -7.350366624838023E-001 -7.446385137454918E-001 +-7.540360533745870E-001 -7.632189935805899E-001 -7.721776519485309E-001 -7.809030089856367E-001 +-7.893867627053061E-001 -7.976213795242063E-001 -8.056001407310364E-001 -8.133171837755898E-001 +-8.207675376245243E-001 -8.279471514366898E-001 -8.348529158263155E-001 -8.414826760073750E-001 +-8.478352361477001E-001 -8.539103543070372E-001 -8.597087273899733E-001 -8.652319656127307E-001 +-8.704825560628994E-001 -8.754638150235704E-001 -8.801798288390974E-001 -8.846353832193903E-001 +-8.888358810145258E-001 -8.927872486428545E-001 -8.964958315253919E-001 -8.999682790689296E-001 +-9.032114199525165E-001 -9.062321287089610E-001 -9.090371848577464E-001 -9.116331261403675E-001 +-9.140260977362721E-001 -9.162216996982816E-001 -9.182248352410686E-001 -9.200395629425345E-001 +-9.216689563711850E-001 -9.231149751231017E-001 -9.243783517253741E-001 -9.254584993161499E-001 +-9.263534454138350E-001 -9.270597973958549E-001 -9.275727454643544E-001 -9.278861088093873E-001 +-9.279924302976509E-001 -9.278831242043520E-001 -9.275486801324053E-001 -9.269789241657663E-001 +-9.261633352981061E-001 -9.250914110493617E-001 -9.237530706909418E-001 -9.221390773713029E-001 +-9.202414513594849E-001 -9.180538352548725E-001 -9.155717579381163E-001 -9.127927267792610E-001 +-9.097160565922359E-001 -9.063423398303055E-001 -9.026727139724054E-001 -8.987086273391314E-001 +-8.944518219630417E-001 -8.899043331435215E-001 -8.850684889530842E-001 -8.799469096982419E-001 +-8.745425073307006E-001 -8.688584847972438E-001 -8.628983353085917E-001 -8.566658414992527E-001 +-8.501650744415801E-001 -8.434003924679242E-001 -8.363764397453113E-001 -8.290981445370745E-001 +-8.215707170759501E-001 -8.137996469633921E-001 -8.057907000010360E-001 -7.975499143495947E-001 +-7.890835959062666E-001 -7.803983127892100E-001 -7.715008888107032E-001 -7.623983958197820E-001 +-7.530981448092200E-001 -7.436076756952681E-001 -7.339347456824956E-001 -7.240873161543159E-001 +-7.140735380642140E-001 -7.039017358328595E-001 -6.935803897976979E-001 -6.831181173074616E-001 +-6.725236526003895E-001 -6.618058256565174E-001 -6.509735402608411E-001 -6.400357515596777E-001 +-6.290014434313818E-001 -6.178796060233140E-001 -6.066792138273228E-001 -5.954092046742873E-001 +-5.840784600232468E-001 -5.726957869016037E-001 -5.612699018199273E-001 -5.498094169384983E-001 +-5.383228287042219E-001 -5.268185091076159E-001 -5.153046996324402E-001 -5.037895078878736E-001 +-4.922809068277141E-001 -4.807867363761457E-001 -4.693147071982353E-001 -4.578724062788215E-001 +-4.464673039088998E-001 -4.351067616268594E-001 -4.237980406255449E-001 -4.125483101170280E-001 +-4.013646551465034E-001 -3.902540833654283E-001 -3.792235303114299E-001 -3.682798627973528E-001 +-3.574298800818383E-001 -3.466803125758676E-001 -3.360378179301381E-001 -3.255089744426692E-001 +-3.151002718204150E-001 -3.048180994186386E-001 -2.946687321635849E-001 -2.846583144344612E-001 +-2.747928422374927E-001 -2.650781440465027E-001 -2.555198607105285E-001 -2.461234248397772E-001 +-2.368940400779104E-001 -2.278366606528235E-001 -2.189559715719054E-001 -2.102563697934807E-001 +-2.017419466660726E-001 -1.934164718835521E-001 -1.852833791591224E-001 -1.773457537762140E-001 +-1.696063221311138E-001 -1.620674433416176E-001 -1.547311029589543E-001 -1.475989087871304E-001 +-1.406720887849459E-001 -1.339514910012340E-001 -1.274375854732643E-001 -1.211304680014735E-001 +-1.150298657004169E-001 -1.091351442157230E-001 -1.034453164894879E-001 -9.795905295158422E-002 +-9.267469301144352E-002 -8.759025772363760E-002 -8.270346350075999E-002 -7.801173674841895E-002 +-7.351222929936828E-002 -6.920183452674210E-002 -6.507720401985227E-002 -6.113476470993396E-002 +-5.737073633747431E-002 -5.378114915725080E-002 -5.036186178188148E-002 -4.710857906949086E-002 +-4.401686996599604E-002 -4.108218521748479E-002 -3.829987487317254E-002 -3.566520550447583E-002 +-3.317337707081166E-002 -3.081953936781888E-002 -2.859880799879171E-002 -2.650627981520616E-002 +-2.453704777730558E-002 -2.268621519077722E-002 -2.094890928059408E-002 -1.932029406810130E-002 +-1.779558252238292E-002 -1.637004796184315E-002 -1.503903468675808E-002 -1.379796782828773E-002 +-1.264236240406758E-002 -1.156783157500635E-002 -1.057009410228786E-002 -9.644981007790307E-003 +-8.788441445181578E-003 -7.996547792806395E-003 -7.265499983134135E-003 -6.591629086971412E-003 +-5.971400173844213E-003 -5.401414472909904E-003 -4.878410861456299E-003 -4.399266710473836E-003 +-3.960998118939320E-003 -3.560759570318517E-003 -3.195843046376001E-003 -2.863676634671122E-003 +-2.561822667118141E-003 -2.287975427698495E-003 -2.039958467836807E-003 -1.815721568097323E-003 +-1.613337384716016E-003 -1.430998782655097E-003 -1.267022571063318E-003 -1.119826547574266E-003 +-9.879349362533364E-004 -8.699751341658228E-004 -7.646731788142539E-004 -6.708491613069328E-004 +-5.874126133216343E-004 -5.133578943032382E-004 -4.477596035912395E-004 -3.897680403364035E-004 +-3.386047321579409E-004 -2.935580515355409E-004 -2.539789369461929E-004 -2.192767337646807E-004 +-1.889151679686942E-004 -1.624084637432234E-004 -1.393176141812738E-004 -1.192468124445447E-004 +-1.018400489921678E-004 -8.677787882045583E-005 -7.377436109117977E-005 -6.257417206942536E-005 +-5.294989095056281E-005 -4.469945693410428E-005 -3.764379480314594E-005 -3.162460529291852E-005 +-2.650231568034159E-005 -2.215418529658858E-005 -1.847256005335998E-005 -1.536326957650378E-005 +-1.274416015244275E-005 -1.054375640732146E-005 -8.700044448915566E-006 -7.159369099632709E-006 +-5.875437827464562E-006 -4.808424032357347E-006 -3.924162459875888E-006 -3.193429683991710E-006 +-2.591302818212762E-006 -2.096589871223049E-006 -1.691325452183817E-006 -1.360325844747599E-006 +-1.090797801014851E-006 -8.719957510085462E-007 -6.949224742043485E-007 -5.520686322653660E-007 +-4.371869120140136E-007 -3.450968710421046E-007 -2.715169120033581E-007 -2.129201328955733E-007 +-1.664111073959767E-007 -1.296209399291765E-007 -1.006182134440443E-007 -7.783370308727961E-008 +-5.999696568954515E-008 -4.608313315035403E-008 -3.526843762439058E-008 -2.689317831343778E-008 +-2.043100428606967E-008 -1.546353586641816E-008 -1.165947965482783E-008 -8.757510151408358E-009 +-6.552295286067967E-009 -4.883134980415364E-009 -3.624762247529381E-009 -2.679926330516297E-009 +-1.973438016213078E-009 -1.447409521495869E-009 -1.057466172048978E-009 -7.697453580531138E-010 +-5.585307822933948E-010 -4.043975826752679E-010 -2.927672322006930E-010 -2.110104068774647E-010 +-1.514008766225205E-010 -1.081362540220379E-010 -7.687898990091456E-011 -5.440165591463880E-011 +-3.831413652100477E-011 -2.685483485885377E-011 -1.873165597839108E-011 -1.300150108283056E-011 +-8.979404089981892E-012 -6.170366400492423E-012 -4.218481884127906E-012 -2.869163213666832E-012 +-1.941242686664061E-012 -1.306475444173300E-012 -8.745617472794965E-013 -5.822615533903831E-013 +-3.855266429409540E-013 -2.538453335796962E-013 -1.662003599358308E-013 -1.081961540176563E-013 +-7.002892929036021E-014 -4.506063082276571E-014 -2.882299377098421E-014 -1.832611749010484E-014 +-1.158133206366638E-014 -7.273943581026671E-015 -4.540158230107176E-015 -2.815966942507531E-015 +-1.735421788970751E-015 -1.062596701481423E-015 -6.463717373513866E-016 -3.905807546256023E-016 +-2.344323634682500E-016 -1.397544796638547E-016 -8.274049108676491E-017 -4.864485432788234E-017 +-2.839775276499848E-017 -1.645965058885180E-017 -9.471257672429394E-018 -5.410101768821290E-018 +-3.067423924651603E-018 -1.726124379547633E-018 -9.639602336304101E-019 -5.341868640756639E-019 +-2.937190597105946E-019 -1.602260577206541E-019 -8.670676345057177E-020 -4.654229417879687E-020 +-2.477839684004989E-020 -1.308230566069140E-020 -6.849132223806676E-021 -3.555338107683577E-021 +-1.829673986186490E-021 -9.333977082785868E-022 -4.719675366471804E-022 -2.365165163068151E-022 +-1.174534363997429E-022 -5.779299919727447E-023 -2.817342900020602E-023 -1.360530370443916E-023 +-6.507726268499191E-024 -3.082837380927308E-024 -1.446170177246042E-024 -6.717104584671616E-025 +-3.088762733403483E-025 -1.405956361551232E-025 -6.334151138001427E-026 -2.824086707163570E-026 +-1.245901429825813E-026 -5.438106480911005E-027 -2.348073472935556E-027 -1.002804934760990E-027 +-4.235475334978145E-028 -1.768919714268841E-028 -7.304204964305237E-029 -2.981497619736009E-029 +-1.202900508574428E-029 -4.796173934462246E-030 -1.889581210844481E-030 -7.354891252835701E-031 +-2.827878979037006E-031 -1.073871297146637E-031 -4.027009360460148E-032 -1.491019483411858E-032 +-5.449851818532516E-033 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 + + + 3.102279727032465E-005 3.141301602639238E-005 3.180814313032442E-005 3.220824032154230E-005 + 3.261337011605411E-005 3.302359581622266E-005 3.343898152065682E-005 3.385959213422685E-005 + 3.428549337820610E-005 3.471675180053999E-005 3.515343478624439E-005 3.559561056793451E-005 + 3.604334823648659E-005 3.649671775183337E-005 3.695578995389556E-005 3.742063657365070E-005 + 3.789133024434127E-005 3.836794451282392E-005 3.885055385106112E-005 3.933923366775784E-005 + 3.983406032014413E-005 4.033511112590609E-005 4.084246437526715E-005 4.135619934322087E-005 + 4.187639630191802E-005 4.240313653320917E-005 4.293650234134522E-005 4.347657706583761E-005 + 4.402344509448033E-005 4.457719187653570E-005 4.513790393608602E-005 4.570566888555325E-005 + 4.628057543938854E-005 4.686271342793412E-005 4.745217381145949E-005 4.804904869437420E-005 + 4.865343133961936E-005 4.926541618324029E-005 4.988509884914216E-005 5.051257616403184E-005 + 5.114794617254700E-005 5.179130815257592E-005 5.244276263076987E-005 5.310241139825066E-005 + 5.377035752651585E-005 5.444670538354384E-005 5.513156065010163E-005 5.582503033625770E-005 + 5.652722279810272E-005 5.723824775468042E-005 5.795821630513125E-005 5.868724094605229E-005 + 5.942543558907481E-005 6.017291557866344E-005 6.092979771013913E-005 6.169620024792846E-005 + 6.247224294404294E-005 6.325804705679062E-005 6.405373536972287E-005 6.485943221081993E-005 + 6.567526347191719E-005 6.650135662837616E-005 6.733784075900300E-005 6.818484656621750E-005 + 6.904250639647553E-005 6.991095426094858E-005 7.079032585646348E-005 7.168075858670538E-005 + 7.258239158368729E-005 7.349536572949023E-005 7.441982367827615E-005 7.535590987857809E-005 + 7.630377059587095E-005 7.726355393542578E-005 7.823540986545154E-005 7.921949024052809E-005 + 8.021594882533422E-005 8.122494131867372E-005 8.224662537780352E-005 8.328116064306869E-005 + 8.432870876284627E-005 8.538943341880359E-005 8.646350035147404E-005 8.755107738615449E-005 + 8.865233445912864E-005 8.976744364421994E-005 9.089657917967891E-005 9.203991749540847E-005 + 9.319763724053174E-005 9.436991931130642E-005 9.555694687939060E-005 9.675890542046375E-005 + 9.797598274320854E-005 9.920836901865599E-005 1.004562568099008E-004 1.017198411021896E-004 + 1.029993193333889E-004 1.042948914248346E-004 1.056067598125712E-004 1.069351294789829E-004 + 1.082802079848229E-004 1.096422055016457E-004 1.110213348446471E-004 1.124178115059178E-004 + 1.138318536881143E-004 1.152636823385547E-004 1.167135211837420E-004 1.181815967643229E-004 + 1.196681384704856E-004 1.211733785778028E-004 1.226975522835260E-004 1.242408977433361E-004 + 1.258036561085564E-004 1.273860715638335E-004 1.289883913652924E-004 1.306108658791716E-004 + 1.322537486209434E-004 1.339172962949278E-004 1.356017688344036E-004 1.373074294422240E-004 + 1.390345446319436E-004 1.407833842694624E-004 1.425542216151942E-004 1.443473333667647E-004 + 1.461629997022471E-004 1.480015043239414E-004 1.498631345027049E-004 1.517481811228393E-004 + 1.536569387275436E-004 1.555897055649380E-004 1.575467836346673E-004 1.595284787350897E-004 + 1.615351005110599E-004 1.635669625023135E-004 1.656243821924594E-004 1.677076810585881E-004 + 1.698171846215059E-004 1.719532224965984E-004 1.741161284453365E-004 1.763062404274281E-004 + 1.785239006536269E-004 1.807694556392054E-004 1.830432562581012E-004 1.853456577977428E-004 + 1.876770200145663E-004 1.900377071902303E-004 1.924280881885378E-004 1.948485365130743E-004 + 1.972994303655709E-004 1.997811527050015E-004 2.022940913074233E-004 2.048386388265705E-004 + 2.074151928552100E-004 2.100241559872691E-004 2.126659358807437E-004 2.153409453214002E-004 + 2.180496022872759E-004 2.207923300139936E-004 2.235695570608952E-004 2.263817173780098E-004 + 2.292292503738621E-004 2.321126009841350E-004 2.350322197411957E-004 2.379885628444967E-004 + 2.409820922318623E-004 2.440132756516711E-004 2.470825867359486E-004 2.501905050743764E-004 + 2.533375162892348E-004 2.565241121112885E-004 2.597507904566244E-004 2.630180555044589E-004 + 2.663264177759216E-004 2.696763942138320E-004 2.730685082634798E-004 2.765032899544190E-004 + 2.799812759832955E-004 2.835030097977109E-004 2.870690416811478E-004 2.906799288389586E-004 + 2.943362354854372E-004 2.980385329319892E-004 3.017873996764060E-004 3.055834214932679E-004 + 3.094271915254804E-004 3.133193103769627E-004 3.172603862065057E-004 3.212510348228054E-004 + 3.252918797806959E-004 3.293835524785938E-004 3.335266922571643E-004 3.377219464992341E-004 + 3.419699707309561E-004 3.462714287242521E-004 3.506269926005405E-004 3.550373429357691E-004 + 3.595031688667740E-004 3.640251681989710E-004 3.686040475154050E-004 3.732405222871733E-004 + 3.779353169852325E-004 3.826891651936203E-004 3.875028097240933E-004 3.923770027322138E-004 + 3.973125058348953E-004 4.023100902294255E-004 4.073705368139898E-004 4.124946363097088E-004 + 4.176831893842130E-004 4.229370067767737E-004 4.282569094250037E-004 4.336437285931586E-004 + 4.390983060020489E-004 4.446214939605869E-004 4.502141554989913E-004 4.558771645036664E-004 + 4.616114058537789E-004 4.674177755595530E-004 4.732971809023076E-004 4.792505405762555E-004 + 4.852787848320847E-004 4.913828556223505E-004 4.975637067486953E-004 5.038223040109204E-004 + 5.101596253579372E-004 5.165766610406156E-004 5.230744137665565E-004 5.296538988568126E-004 + 5.363161444045840E-004 5.430621914359089E-004 5.498930940723744E-004 5.568099196958840E-004 + 5.638137491154884E-004 5.709056767363251E-004 5.780868107306817E-004 5.853582732112090E-004 + 5.927212004063209E-004 6.001767428377987E-004 6.077260655006298E-004 6.153703480451159E-004 + 6.231107849612674E-004 6.309485857655278E-004 6.388849751898372E-004 6.469211933730878E-004 + 6.550584960549836E-004 6.632981547723421E-004 6.716414570578700E-004 6.800897066414392E-004 + 6.886442236538978E-004 6.973063448334491E-004 7.060774237346283E-004 7.149588309399134E-004 + 7.239519542739948E-004 7.330581990207509E-004 7.422789881429521E-004 7.516157625047328E-004 + 7.610699810968685E-004 7.706431212648849E-004 7.803366789400438E-004 7.901521688732392E-004 + 8.000911248718360E-004 8.101551000395018E-004 8.203456670190444E-004 8.306644182383246E-004 + 8.411129661592610E-004 8.516929435299652E-004 8.624060036400687E-004 8.732538205792533E-004 + 8.842380894990484E-004 8.953605268779219E-004 9.066228707897151E-004 9.180268811754618E-004 + 9.295743401186271E-004 9.412670521238233E-004 9.531068443990356E-004 9.650955671414020E-004 + 9.772350938266052E-004 9.895273215019009E-004 1.001974171082852E-003 1.014577587653796E-003 + 1.027339540772102E-003 1.040262024776275E-003 1.053347059097929E-003 1.066596688577704E-003 + 1.080012983785173E-003 1.093598041342770E-003 1.107353984253818E-003 1.121282962234684E-003 + 1.135387152051136E-003 1.149668757858933E-003 1.164130011548717E-003 1.178773173095260E-003 + 1.193600530911118E-003 1.208614402204741E-003 1.223817133343118E-003 1.239211100218982E-003 + 1.254798708622666E-003 1.270582394618645E-003 1.286564624926831E-003 1.302747897308703E-003 + 1.319134740958280E-003 1.335727716898063E-003 1.352529418379960E-003 1.369542471291288E-003 + 1.386769534565895E-003 1.404213300600480E-003 1.421876495676180E-003 1.439761880385481E-003 + 1.457872250064521E-003 1.476210435230868E-003 1.494779302026830E-003 1.513581752668364E-003 + 1.532620725899670E-003 1.551899197453534E-003 1.571420180517496E-003 1.591186726205911E-003 + 1.611201924037992E-003 1.631468902421888E-003 1.651990829144915E-003 1.672770911869969E-003 + 1.693812398638235E-003 1.715118578378271E-003 1.736692781421519E-003 1.758538380024371E-003 + 1.780658788896836E-003 1.803057465737914E-003 1.825737911777746E-003 1.848703672326651E-003 + 1.871958337331119E-003 1.895505541936850E-003 1.919348967058957E-003 1.943492339959377E-003 + 1.967939434831628E-003 1.992694073392988E-003 2.017760125484184E-003 2.043141509676711E-003 + 2.068842193887852E-003 2.094866196003525E-003 2.121217584509043E-003 2.147900479127892E-003 + 2.174919051468629E-003 2.202277525680014E-003 2.229980179114476E-003 2.258031343000027E-003 + 2.286435403120719E-003 2.315196800505787E-003 2.344320032127552E-003 2.373809651608225E-003 + 2.403670269935716E-003 2.433906556188586E-003 2.464523238270236E-003 2.495525103652454E-003 + 2.526917000128473E-003 2.558703836575636E-003 2.590890583727803E-003 2.623482274957632E-003 + 2.656484007068857E-003 2.689900941098708E-003 2.723738303130584E-003 2.758001385117140E-003 + 2.792695545713918E-003 2.827826211123641E-003 2.863398875951339E-003 2.899419104070451E-003 + 2.935892529500027E-003 2.972824857293185E-003 3.010221864436992E-003 3.048089400763902E-003 + 3.086433389874898E-003 3.125259830074536E-003 3.164574795318007E-003 3.204384436170389E-003 + 3.244694980778261E-003 3.285512735853858E-003 3.326844087671907E-003 3.368695503079339E-003 + 3.411073530518034E-003 3.453984801060803E-003 3.497436029460739E-003 3.541434015214178E-003 + 3.585985643637418E-003 3.631097886957390E-003 3.676777805416480E-003 3.723032548391675E-003 + 3.769869355528286E-003 3.817295557888366E-003 3.865318579114102E-003 3.913945936606334E-003 + 3.963185242718452E-003 4.013044205965857E-003 4.063530632251211E-003 4.114652426105722E-003 + 4.166417591946614E-003 4.218834235351114E-003 4.271910564347095E-003 4.325654890720672E-003 + 4.380075631340977E-003 4.435181309502314E-003 4.490980556284010E-003 4.547482111928156E-003 + 4.604694827235534E-003 4.662627664979973E-003 4.721289701341391E-003 4.780690127357821E-003 + 4.840838250396649E-003 4.901743495645386E-003 4.963415407622274E-003 5.025863651706935E-003 + 5.089098015691436E-003 5.153128411352047E-003 5.217964876041963E-003 5.283617574305369E-003 + 5.350096799513082E-003 5.417412975520185E-003 5.485576658345880E-003 5.554598537875995E-003 + 5.624489439588405E-003 5.695260326301745E-003 5.766922299947808E-003 5.839486603367893E-003 + 5.912964622133584E-003 5.987367886392237E-003 6.062708072737632E-003 6.138997006106120E-003 + 6.216246661698718E-003 6.294469166929479E-003 6.373676803400667E-003 6.453882008905017E-003 + 6.535097379455655E-003 6.617335671343984E-003 6.700609803226076E-003 6.784932858238033E-003 + 6.870318086140651E-003 6.956778905494068E-003 7.044328905862706E-003 7.132981850051073E-003 + 7.222751676371004E-003 7.313652500940703E-003 7.405698620016245E-003 7.498904512356032E-003 + 7.593284841618757E-003 7.688854458795456E-003 7.785628404676172E-003 7.883621912351946E-003 + 7.982850409752607E-003 8.083329522221032E-003 8.185075075124532E-003 8.288103096503964E-003 + 8.392429819761280E-003 8.498071686386176E-003 8.605045348722501E-003 8.713367672775189E-003 + 8.823055741058381E-003 8.934126855485542E-003 9.046598540302328E-003 9.160488545062928E-003 + 9.275814847650773E-003 9.392595657344309E-003 9.510849417928817E-003 9.630594810855046E-003 + 9.751850758445561E-003 9.874636427149737E-003 9.998971230848308E-003 1.012487483420845E-002 + 1.025236715609033E-002 1.038146837300613E-002 1.051219892263269E-002 1.064457950737857E-002 + 1.077863109800700E-002 1.091437493731539E-002 1.105183254387296E-002 1.119102571581731E-002 + 1.133197653471138E-002 1.147470736946197E-002 1.161924088030108E-002 1.176560002283128E-002 + 1.191380805213673E-002 1.206388852696084E-002 1.221586531395248E-002 1.236976259198170E-002 + 1.252560485652677E-002 1.268341692413410E-002 1.284322393695239E-002 1.300505136734297E-002 + 1.316892502256773E-002 1.333487104955648E-002 1.350291593975566E-002 1.367308653406000E-002 + 1.384541002782916E-002 1.401991397599131E-002 1.419662629823559E-002 1.437557528429559E-002 + 1.455678959932591E-002 1.474029828937399E-002 1.492613078694955E-002 1.511431691669394E-002 + 1.530488690115185E-002 1.549787136664758E-002 1.569330134926889E-002 1.589120830096071E-002 + 1.609162409573153E-002 1.629458103597533E-002 1.650011185891184E-002 1.670824974314821E-002 + 1.691902831536508E-002 1.713248165713030E-002 1.734864431184364E-002 1.756755129181559E-002 + 1.778923808548408E-002 1.801374066477267E-002 1.824109549259368E-002 1.847133953050051E-002 + 1.870451024649265E-002 1.894064562297800E-002 1.917978416489639E-002 1.942196490800874E-002 + 1.966722742735658E-002 1.991561184589636E-002 2.016715884331360E-002 2.042190966502176E-002 + 2.067990613135103E-002 2.094119064693245E-002 2.120580621028287E-002 2.147379642359644E-002 + 2.174520550274847E-002 2.202007828751805E-002 2.229846025203547E-002 2.258039751546118E-002 + 2.286593685290298E-002 2.315512570657847E-002 2.344801219723010E-002 2.374464513580023E-002 + 2.404507403537412E-002 2.434934912339867E-002 2.465752135418545E-002 2.496964242170665E-002 + 2.528576477269281E-002 2.560594162004158E-002 2.593022695654713E-002 2.625867556896023E-002 + 2.659134305238913E-002 2.692828582505205E-002 2.726956114339205E-002 2.761522711756618E-002 + 2.796534272732030E-002 2.831996783826213E-002 2.867916321854519E-002 2.904299055597674E-002 + 2.941151247556360E-002 2.978479255750973E-002 3.016289535568058E-002 3.054588641654931E-002 + 3.093383229864041E-002 3.132680059248768E-002 3.172485994112310E-002 3.212808006111434E-002 + 3.253653176416918E-002 3.295028697932578E-002 3.336941877574844E-002 3.379400138614945E-002 + 3.422411023085764E-002 3.465982194255644E-002 3.510121439171323E-002 3.554836671272441E-002 + 3.600135933080023E-002 3.646027398961512E-002 3.692519377974980E-002 3.739620316795252E-002 + 3.787338802724786E-002 3.835683566792297E-002 3.884663486942134E-002 3.934287591317659E-002 + 3.984565061641858E-002 4.035505236698692E-002 4.087117615918689E-002 4.139411863072514E-002 + 4.192397810076338E-002 4.246085460913013E-002 4.300484995673192E-002 4.355606774720685E-002 + 4.411461342986551E-002 4.468059434396542E-002 4.525411976436725E-002 4.583530094862342E-002 + 4.642425118555043E-002 4.702108584533973E-002 4.762592243126291E-002 4.823888063302965E-002 + 4.886008238185948E-002 4.948965190733012E-002 5.012771579606827E-002 5.077440305235072E-002 + 5.142984516068673E-002 5.209417615045547E-002 5.276753266267479E-002 5.345005401898112E-002 + 5.414188229290313E-002 5.484316238351509E-002 5.555404209155949E-002 5.627467219813144E-002 + 5.700520654602207E-002 5.774580212382119E-002 5.849661915288321E-002 5.925782117726581E-002 + 6.002957515675349E-002 6.081205156308428E-002 6.160542447950090E-002 6.240987170375379E-002 + 6.322557485468834E-002 6.405271948255341E-002 6.489149518317378E-002 6.574209571613567E-002 + 6.660471912713917E-002 6.747956787467875E-002 6.836684896121868E-002 6.926677406903689E-002 + 7.017955970091877E-002 7.110542732588769E-002 7.204460353016842E-002 7.299732017358666E-002 + 7.396381455161512E-002 7.494432956328698E-002 7.593911388520425E-002 7.694842215187828E-002 + 7.797251514265074E-002 7.901165997544940E-002 8.006613030764805E-002 8.113620654430505E-002 + 8.222217605407095E-002 8.332433339306280E-002 8.444298053701779E-002 8.557842712204741E-002 + 8.673099069432975E-002 8.790099696908700E-002 8.908878009921112E-002 9.029468295391253E-002 + 9.151905740778295E-002 9.276226464067579E-002 9.402467544882538E-002 9.530667056764004E-002 + 9.660864100661964E-002 9.793098839686776E-002 9.927412535168177E-002 1.006384758407249E-001 + 1.020244755782990E-001 1.034325724262577E-001 1.048632268121178E-001 1.063169121629432E-001 + 1.077941153555982E-001 1.092953371839859E-001 1.108210928439038E-001 1.123719124361755E-001 + 1.139483414887300E-001 1.155509414983271E-001 1.171802904926409E-001 1.188369836134404E-001 + 1.205216337216212E-001 1.222348720248617E-001 1.239773487287020E-001 1.257497337118523E-001 + 1.275527172265655E-001 1.293870106249177E-001 1.312533471118586E-001 1.331524825259081E-001 + 1.350851961483850E-001 1.370522915420646E-001 1.390545974201710E-001 1.410929685466124E-001 + 1.431682866683656E-001 1.452814614809221E-001 1.474334316276889E-001 1.496251657342372E-001 + 1.518576634782612E-001 1.541319566960984E-001 1.564491105266169E-001 1.588102245932458E-001 + 1.612164342248706E-001 1.636689117162529E-001 1.661688676285684E-001 1.687175521305641E-001 + 1.713162563807409E-001 1.739663139508535E-001 1.766691022908731E-001 1.794260442354202E-001 + 1.822386095514833E-001 1.851083165270388E-001 1.880367335999656E-001 1.910254810263713E-001 + 1.940762325871657E-001 1.971907173313712E-001 2.003707213542934E-001 2.036180896082514E-001 + 2.069347277430913E-001 2.103226039731896E-001 2.137837509670555E-001 2.173202677549937E-001 + 2.209343216495611E-001 2.246281501727394E-001 2.284040629828590E-001 2.322644437933164E-001 + 2.362117522740335E-001 2.402485259254101E-001 2.443773819131837E-001 2.486010188511636E-001 + 2.529222185171962E-001 2.573438474859663E-001 2.618688586603233E-001 2.665002926807098E-001 + 2.712412791899948E-001 2.760950379285097E-001 2.810648796313769E-001 2.861542066972859E-001 + 2.913665135946757E-001 2.967053869678588E-001 3.021745054018928E-001 3.077776388010388E-001 + 3.135186473313503E-001 3.194014798733729E-001 3.254301719260501E-001 3.316088428977522E-001 + 3.379416927148541E-001 3.444329976725061E-001 3.510871054461621E-001 3.579084291761078E-001 + 3.649014405306315E-001 3.720706616467189E-001 3.794206558402097E-001 3.869560169703218E-001 + 3.946813573364265E-001 4.026012939779812E-001 4.107204332417727E-001 4.190433534742154E-001 + 4.275745856905010E-001 4.363185920672075E-001 4.452797421006499E-001 4.544622862701623E-001 + 4.638703270438764E-001 4.735077870647562E-001 4.833783743570868E-001 4.934855443986670E-001 + 5.038324589121606E-001 5.144219412409149E-001 5.252564281906146E-001 5.363379182390805E-001 + 5.476679160429356E-001 5.592473732024855E-001 5.710766252857016E-001 5.831553251593200E-001 + 5.954823727305973E-001 6.080558412677388E-001 6.208729005411652E-001 6.339297371120794E-001 + 6.472214721895655E-001 6.607420775830255E-001 6.744842903929305E-001 6.884395272093994E-001 + 7.025977987242400E-001 7.169476258066074E-001 7.314759582437391E-001 7.461680975038831E-001 + 7.610076250356977E-001 7.759763377732493E-001 7.910541926637109E-001 8.062192621706391E-001 + 8.214477028228853E-001 8.367137389706949E-001 8.519896639683878E-001 8.672458610184260E-001 + 8.824508458756319E-001 8.975713335129963E-001 9.125723306826705E-001 9.274172560579630E-001 + 9.420680893062764E-001 9.564855500120574E-001 9.706293068379797E-001 9.844582166798372E-001 + 9.979305928370643E-001 1.011004500392217E+000 1.023638076079342E+000 1.035789868939150E+000 + 1.047419197030527E+000 1.058486514421847E+000 1.068953781657804E+000 1.078784831930711E+000 + 1.087945724329078E+000 1.096405074847486E+000 1.104134355382864E+000 1.111108150782237E+000 + 1.117304364220401E+000 1.122704361853143E+000 1.127293048899173E+000 1.131058871145640E+000 + 1.133993738451114E+000 1.136092870250939E+000 1.137354567483237E+000 1.137779920899827E+000 + 1.137372472579308E+000 1.136137855823249E+000 1.134083448726713E+000 1.131218089028614E+000 + 1.127551907423270E+000 1.123096275258521E+000 1.117863775300199E+000 1.111868170909520E+000 + 1.105124372237408E+000 1.097648399629170E+000 1.089457344430178E+000 1.080569327379441E+000 + 1.071003454773387E+000 1.060779772577310E+000 1.049919218656852E+000 1.038443573296780E+000 + 1.026375408169082E+000 1.013738033907219E+000 1.000555446437975E+000 9.868522722169372E-001 + 9.726537125079638E-001 9.579854868412035E-001 9.428737757782318E-001 9.273451631066473E-001 + 9.114265775802006E-001 8.951452343141411E-001 8.785285759391975E-001 8.616042136116356E-001 + 8.443998679712448E-001 8.269433101344728E-001 8.092623028066100E-001 7.913845415924180E-001 + 7.733375965872786E-001 7.551488543346035E-001 7.368454602353945E-001 7.184542615012670E-001 + 7.000017507616038E-001 6.815140104524251E-001 6.630166581206557E-001 6.445347928045041E-001 + 6.260929426795477E-001 6.077150141812961E-001 5.894242428420404E-001 5.712431461049957E-001 + 5.531934784011474E-001 5.352961887919081E-001 5.175713814920623E-001 5.000382795907281E-001 + 4.827151922818657E-001 4.656194858993049E-001 4.487675590238236E-001 4.321748218917089E-001 + 4.158556802861685E-001 3.998235240362504E-001 3.840907201844128E-001 3.686686108156938E-001 + 3.535675154711240E-001 3.387967379981137E-001 3.243645776236737E-001 3.102783439749737E-001 + 2.965443757181049E-001 2.831680624419676E-001 2.701538693814284E-001 2.575053645534048E-001 + 2.452252478719243E-001 2.333153818135218E-001 2.217768232221765E-001 2.106098558723177E-001 + 1.998140234477911E-001 1.893881626421260E-001 1.793304361386682E-001 1.696383652855472E-001 + 1.603088623373591E-001 1.513382621901360E-001 1.427223535861950E-001 1.344564098086119E-001 + 1.265352189197106E-001 1.189531136229617E-001 1.117040008425594E-001 1.047813911198507E-001 + 9.817842792138363E-002 9.188791694085419E-002 8.590235545817088E-002 8.021396179498538E-002 + 7.481470487921746E-002 6.969633390308712E-002 6.485040803162211E-002 6.026832609291344E-002 + 5.594135615866108E-002 5.186066490460264E-002 4.801734662574229E-002 4.440245177113330E-002 + 4.100701485729594E-002 3.782208161796510E-002 3.483873525040291E-002 3.204812162451574E-002 + 2.944147332996701E-002 2.701013244782631E-002 2.474557194649663E-002 2.263941561620319E-002 + 2.068345647172079E-002 1.886967356884173E-002 1.719024719596179E-002 1.563757241777112E-002 + 1.420427096311594E-002 1.288320146342933E-002 1.166746806155067E-002 1.055042742313738E-002 + 9.525694194129930E-003 8.587144957806467E-003 7.728920753825060E-003 6.945428229293332E-003 + 6.231339498337421E-003 5.581590791891885E-003 4.991379983538816E-003 4.456163080236202E-003 + 3.971649768751168E-003 3.533798109615193E-003 3.138808470514341E-003 2.783116790289441E-003 + 2.463387263222443E-003 2.176504531101053E-003 1.919565467759837E-003 1.689870637467344E-003 + 1.484915504740406E-003 1.302381468990903E-003 1.140126792918567E-003 9.961774888239687E-004 + 8.687182220941297E-004 7.560832860718610E-004 6.567476974169896E-004 5.693184559580960E-004 + 4.925260079673266E-004 4.252159468143393E-004 3.663409801098614E-004 3.149531877713059E-004 + 2.701965909645015E-004 2.313000476240357E-004 1.975704862526391E-004 1.683864859655072E-004 + 1.431922072920545E-004 1.214916750847441E-004 1.028434120176943E-004 8.685541858832078E-005 + 7.318049326149261E-005 6.151188441246691E-005 5.157926402436331E-005 4.314501166768967E-005 + 3.600079612086747E-005 2.996444106739203E-005 2.487706061129143E-005 2.060044987086265E-005 + 1.701471562316153E-005 1.401614131672755E-005 1.151532677031165E-005 9.435260714428836E-006 + 7.709863546780700E-006 6.282604913149372E-006 5.105261757484203E-006 4.136816253777973E-006 + 3.342481050620196E-006 2.692839944773491E-006 2.163092810257386E-006 1.732394333169708E-006 + 1.383276829898899E-006 1.101148148719979E-006 8.738563644221854E-007 6.913136661218984E-007 + 5.451725043978946E-007 4.285477010123506E-007 3.357788293871192E-007 2.622277442241839E-007 + 2.041066725413962E-007 1.583327750223259E-007 1.224055456771717E-007 9.430383966904383E-008 + 7.239970453681132E-008 5.538654009833634E-008 4.221942851941849E-008 3.206576010329060E-008 + 2.426453419268413E-008 1.829294020254460E-008 1.373902330688850E-008 1.027941480232691E-008 + 7.661260762713281E-009 5.687616336193724E-009 4.205688896200919E-009 3.097413126306717E-009 + 2.271926770909914E-009 1.659588875432048E-009 1.207244400941210E-009 8.744915299619239E-010 + 6.307520549801664E-010 4.529821050538525E-010 3.238911437424263E-010 2.305625726534095E-010 + 1.633902004816790E-010 1.152619884716914E-010 8.093646886672083E-011 5.656857884101943E-011 + 3.935080939745915E-011 2.724292072406716E-011 1.876934751153399E-011 1.286808303004662E-011 + 8.778517720021123E-012 5.958606305526235E-012 4.024003479984814E-012 2.703570370360052E-012 + 1.807016842167760E-012 1.201492968097707E-012 7.947448304965751E-013 5.230598125877196E-013 + 3.426880404867156E-013 2.237739823377289E-013 1.460924042942280E-013 9.483846805429423E-014 + 6.121380248919002E-014 3.928174903501038E-014 2.505977739431953E-014 1.589192246719863E-014 + 1.001742274253589E-014 6.276000806088283E-015 3.907725775108244E-015 2.417940018838314E-015 + 1.486665120009554E-015 9.082227287183137E-016 5.512493992953708E-016 3.323877152786612E-016 + 1.990888543805484E-016 1.184452646476372E-016 6.998748627073830E-017 4.106934035872895E-017 + 2.393161079662242E-017 1.384665155259462E-017 7.954218178951333E-018 4.536186755638886E-018 + 2.567942756611439E-018 1.442914274420416E-018 8.046662539811467E-019 4.453176301908563E-019 + 2.445462959022487E-019 1.332438333209888E-019 7.202531668521004E-020 3.862174774475969E-020 + 2.054203535559261E-020 1.083615944617791E-020 5.668689492124577E-021 2.940490324308670E-021 + 1.512308897738554E-021 7.710778163752447E-022 3.897135921998000E-022 1.952246437300173E-022 + 9.692079371653407E-023 4.768078619764643E-023 2.324150478364441E-023 1.122352064533745E-023 + 5.368921014151167E-024 2.543819687228981E-024 1.193643819302157E-024 5.546248972256990E-025 + 2.551564427003981E-025 1.162095991541221E-025 5.239028831501885E-026 2.337637884372209E-026 + 1.032202699265205E-026 4.509796878297719E-027 1.949375148292034E-027 8.335310996704759E-028 + 3.525144162093263E-028 1.474350199028789E-028 6.097227086231348E-029 2.492932509569204E-029 + 1.007564407698353E-029 4.024910134442564E-030 1.588900741491320E-030 6.197690540915147E-031 + 2.388306525464899E-031 9.090986116751324E-032 3.417633868134587E-032 1.268719750555362E-032 + 4.650103844226560E-033 1.682467486225844E-033 6.008239040580709E-034 2.117350460320250E-034 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 + + + + 1.924828096786578E-009 1.973555357624711E-009 2.023516155229837E-009 2.074741716748551E-009 + 2.127264059847182E-009 2.181116012723921E-009 2.236331234627599E-009 2.292944236895847E-009 + 2.350990404525897E-009 2.410506018291409E-009 2.471528277419223E-009 2.534095322840147E-009 + 2.598246261028380E-009 2.664021188444402E-009 2.731461216596668E-009 2.800608497737724E-009 + 2.871506251210836E-009 2.944198790463605E-009 3.018731550745399E-009 3.095151117506012E-009 + 3.173505255513174E-009 3.253842938707218E-009 3.336214380811547E-009 3.420671066717954E-009 + 3.507265784666526E-009 3.596052659240155E-009 3.687087185194331E-009 3.780426262143340E-009 + 3.876128230124562E-009 3.974252906063073E-009 4.074861621159373E-009 4.178017259223619E-009 + 4.283784295980228E-009 4.392228839367568E-009 4.503418670857797E-009 4.617423287822759E-009 + 4.734313946972354E-009 4.854163708892614E-009 4.977047483711198E-009 5.103042077919047E-009 + 5.232226242377202E-009 5.364680721539033E-009 5.500488303918495E-009 5.639733873836039E-009 + 5.782504464474480E-009 5.928889312277989E-009 6.078979912728211E-009 6.232870077532383E-009 + 6.390655993259219E-009 6.552436281459162E-009 6.718312060306545E-009 6.888387007802396E-009 + 7.062767426577094E-009 7.241562310333646E-009 7.424883411972967E-009 7.612845313443735E-009 + 7.805565497360595E-009 8.003164420435388E-009 8.205765588767313E-009 8.413495635039155E-009 + 8.626484397667665E-009 8.844865001957732E-009 9.068773943311068E-009 9.298351172541325E-009 + 9.533740183348953E-009 9.775088102010595E-009 1.002254577933903E-008 1.027626788497108E-008 + 1.053641300404250E-008 1.080314373631030E-008 1.107662679778427E-008 1.135703312493154E-008 + 1.164453798151903E-008 1.193932106816077E-008 1.224156663463838E-008 1.255146359506500E-008 + 1.286920564596494E-008 1.319499138734229E-008 1.352902444681450E-008 1.387151360688879E-008 + 1.422267293546026E-008 1.458272191961393E-008 1.495188560281400E-008 1.533039472556612E-008 + 1.571848586964070E-008 1.611640160594732E-008 1.652439064615275E-008 1.694270799813729E-008 + 1.737161512538665E-008 1.781138011041886E-008 1.826227782234865E-008 1.872459008869371E-008 + 1.919860587153067E-008 1.968462144811026E-008 2.018294059604526E-008 2.069387478318642E-008 + 2.121774336230555E-008 2.175487377070697E-008 2.230560173489242E-008 2.287027148040763E-008 + 2.344923594700070E-008 2.404285700922807E-008 2.465150570264520E-008 2.527556245572353E-008 + 2.591541732763866E-008 2.657147025207855E-008 2.724413128722402E-008 2.793382087205778E-008 + 2.864097008916248E-008 2.936602093417152E-008 3.010942659204165E-008 3.087165172031989E-008 + 3.165317273958143E-008 3.245447813122081E-008 3.327606874278202E-008 3.411845810101836E-008 + 3.498217273287800E-008 3.586775249461621E-008 3.677575090923912E-008 3.770673551249076E-008 + 3.866128820759920E-008 3.964000562900393E-008 4.064349951529180E-008 4.167239709157418E-008 + 4.272734146154518E-008 4.380899200946528E-008 4.491802481232230E-008 4.605513306242685E-008 + 4.722102750070706E-008 4.841643686097274E-008 4.964210832542753E-008 5.089880799171303E-008 + 5.218732135177739E-008 5.350845378286798E-008 5.486303105095463E-008 5.625189982689759E-008 + 5.767592821568510E-008 5.913600629906864E-008 6.063304669193755E-008 6.216798511277937E-008 + 6.374178096858277E-008 6.535541795454985E-008 6.700990466899161E-008 6.870627524379114E-008 + 7.044558999082939E-008 7.222893606477720E-008 7.405742814266830E-008 7.593220912067783E-008 + 7.785445082854273E-008 7.982535476206977E-008 8.184615283418981E-008 8.391810814502825E-008 + 8.604251577147282E-008 8.822070357673184E-008 9.045403304039014E-008 9.274390010948198E-008 + 9.509173607111105E-008 9.749900844716662E-008 9.996722191169170E-008 1.024979192314800E-007 + 1.050926822304878E-007 1.077531327786644E-007 1.104809338058207E-007 1.132777903411685E-007 + 1.161454505791813E-007 1.190857069724424E-007 1.221003973521664E-007 1.251914060770898E-007 + 1.283606652114554E-007 1.316101557328244E-007 1.349419087704687E-007 1.383580068751238E-007 + 1.418605853208917E-007 1.454518334401109E-007 1.491339959920282E-007 1.529093745661256E-007 + 1.567803290209857E-007 1.607492789595877E-007 1.648187052419668E-007 1.689911515361745E-007 + 1.732692259085130E-007 1.776556024540430E-007 1.821530229683757E-007 1.867642986618059E-007 + 1.914923119168488E-007 1.963400180902848E-007 2.013104473608433E-007 2.064067066236708E-007 + 2.116319814327806E-007 2.169895379926956E-007 2.224827252005220E-007 2.281149767397488E-007 + 2.338898132270645E-007 2.398108444135501E-007 2.458817714416173E-007 2.521063891591018E-007 + 2.584885884919745E-007 2.650323588771368E-007 2.717417907568350E-007 2.786210781362550E-007 + 2.856745212058874E-007 2.929065290303222E-007 3.003216223051349E-007 3.079244361836096E-007 + 3.157197231750579E-007 3.237123561165490E-007 3.319073312199147E-007 3.403097711959340E-007 + 3.489249284576564E-007 3.577581884048697E-007 3.668150727917610E-007 3.761012431798950E-007 + 3.856225044786585E-007 3.953848085753938E-007 4.053942580574961E-007 4.156571100288039E-007 + 4.261797800226729E-007 4.369688460141840E-007 4.480310525340035E-007 4.593733148864693E-007 + 4.710027234745406E-007 4.829265482343343E-007 4.951522431820145E-007 5.076874510758870E-007 + 5.205400081966296E-007 5.337179492486399E-007 5.472295123855825E-007 5.610831443632812E-007 + 5.752875058231937E-007 5.898514767097711E-007 6.047841618250958E-007 6.200948965243079E-007 + 6.357932525553473E-007 6.518890440467170E-007 6.683923336469977E-007 6.853134388199618E-007 + 7.026629382992586E-007 7.204516787066967E-007 7.386907813382832E-007 7.573916491222878E-007 + 7.765659737536781E-007 7.962257430094323E-007 8.163832482492757E-007 8.370510921066026E-007 + 8.582421963743735E-007 8.799698100909495E-007 9.022475178309505E-007 9.250892482063273E-007 + 9.485092825829974E-007 9.725222640185198E-007 9.971432064264182E-007 1.022387503972921E-006 + 1.048270940711994E-006 1.074809700464769E-006 1.102020376949533E-006 1.129919984168666E-006 + 1.158525967059071E-006 1.187856212412755E-006 1.217929060074468E-006 1.248763314423419E-006 + 1.280378256146307E-006 1.312793654309079E-006 1.346029778734964E-006 1.380107412696660E-006 + 1.415047865930592E-006 1.450872987981442E-006 1.487605181885414E-006 1.525267418200771E-006 + 1.563883249394554E-006 1.603476824594493E-006 1.644072904715453E-006 1.685696877969921E-006 + 1.728374775772321E-006 1.772133289047191E-006 1.816999784951523E-006 1.863002324021771E-006 + 1.910169677756421E-006 1.958531346645133E-006 2.008117578655937E-006 2.058959388192062E-006 + 2.111088575530458E-006 2.164537746754237E-006 2.219340334191665E-006 2.275530617374585E-006 + 2.333143744529621E-006 2.392215754615606E-006 2.452783599921358E-006 2.514885169237944E-006 + 2.578559311620240E-006 2.643845860752730E-006 2.710785659935064E-006 2.779420587703169E-006 + 2.849793584102175E-006 2.921948677627811E-006 2.995931012853381E-006 3.071786878759819E-006 + 3.149563737786891E-006 3.229310255623906E-006 3.311076331758920E-006 3.394913130805904E-006 + 3.480873114629670E-006 3.569010075289122E-006 3.659379168819755E-006 3.752036949876928E-006 + 3.847041407261963E-006 3.944452000353731E-006 4.044329696469005E-006 4.146737009175377E-006 + 4.251738037581177E-006 4.359398506627574E-006 4.469785808408544E-006 4.582969044545155E-006 + 4.699019069641280E-006 4.818008535848564E-006 4.940011938569251E-006 5.065105663326022E-006 + 5.193368033829081E-006 5.324879361271199E-006 5.459721994882516E-006 5.597980373777459E-006 + 5.739741080127186E-006 5.885092893691835E-006 6.034126847747533E-006 6.186936286444455E-006 + 6.343616923632686E-006 6.504266903194061E-006 6.668986860918780E-006 6.837879987966978E-006 + 7.011052095956234E-006 7.188611683717108E-006 7.370670005760185E-006 7.557341142498813E-006 + 7.748742072273251E-006 7.944992745223117E-006 8.146216159056029E-006 8.352538436761945E-006 + 8.564088906323770E-006 8.781000182476329E-006 9.003408250567046E-006 9.231452552573209E-006 + 9.465276075332146E-006 9.705025441042095E-006 9.950851000093268E-006 1.020290692629000E-005 + 1.046135131452659E-005 1.072634628098141E-005 1.099805806589492E-005 1.127665713899991E-005 + 1.156231830767333E-005 1.185522082788160E-005 1.215554851799278E-005 1.246348987553104E-005 + 1.277923819695146E-005 1.310299170051449E-005 1.343495365234237E-005 1.377533249574133E-005 + 1.412434198387655E-005 1.448220131588831E-005 1.484913527654105E-005 1.522537437949900E-005 + 1.561115501432515E-005 1.600671959730227E-005 1.641231672617843E-005 1.682820133894156E-005 + 1.725463487673087E-005 1.769188545099553E-005 1.814022801501507E-005 1.859994453989808E-005 + 1.907132419517954E-005 1.955466353414122E-005 2.005026668398146E-005 2.055844554096594E-005 + 2.107951997069371E-005 2.161381801361724E-005 2.216167609595868E-005 2.272343924616894E-005 + 2.329946131708038E-005 2.389010521390822E-005 2.449574312825994E-005 2.511675677831754E-005 + 2.575353765536105E-005 2.640648727680744E-005 2.707601744594401E-005 2.776255051854023E-005 + 2.846651967652840E-005 2.918836920894746E-005 2.992855480035189E-005 3.068754382689210E-005 + 3.146581566028001E-005 3.226386197985915E-005 3.308218709300538E-005 3.392130826409166E-005 + 3.478175605225580E-005 3.566407465821987E-005 3.656882228041479E-005 3.749657148067349E-005 + 3.844790955976296E-005 3.942343894303346E-005 4.042377757647331E-005 4.144955933346477E-005 + 4.250143443254719E-005 4.358006986650191E-005 4.468614984308396E-005 4.582037623773593E-005 + 4.698346905862870E-005 4.817616692438648E-005 4.939922755486414E-005 5.065342827535475E-005 + 5.193956653462071E-005 5.325846043715194E-005 5.461094929006781E-005 5.599789416509476E-005 + 5.742017847606269E-005 5.887870857238114E-005 6.037441434896712E-005 6.190824987311687E-005 + 6.348119402882512E-005 6.509425117907580E-005 6.674845184664435E-005 6.844485341396815E-005 + 7.018454084266403E-005 7.196862741328691E-005 7.379825548594735E-005 7.567459728242439E-005 + 7.759885569043322E-005 7.957226509072800E-005 8.159609220774714E-005 8.367163698452688E-005 + 8.580023348264177E-005 8.798325080794894E-005 9.022209406294692E-005 9.251820532658613E-005 + 9.487306466239268E-005 9.728819115580864E-005 9.976514398167201E-005 1.023055235028004E-004 + 1.049109724006768E-004 1.075831768392650E-004 1.103238676630287E-004 1.131348216302607E-004 + 1.160178626828718E-004 1.189748632538309E-004 1.220077456134894E-004 1.251184832560754E-004 + 1.283091023276808E-004 1.315816830971218E-004 1.349383614711027E-004 1.383813305551649E-004 + 1.419128422619623E-004 1.455352089684606E-004 1.492508052237176E-004 1.530620695089693E-004 + 1.569715060518079E-004 1.609816866963115E-004 1.650952528310539E-004 1.693149173769987E-004 + 1.736434668373622E-004 1.780837634116073E-004 1.826387471758206E-004 1.873114383318114E-004 + 1.921049395273632E-004 1.970224382501668E-004 2.020672092980664E-004 2.072426173283534E-004 + 2.125521194889520E-004 2.179992681344619E-004 2.235877136301349E-004 2.293212072469970E-004 + 2.352036041514522E-004 2.412388664928440E-004 2.474310665925947E-004 2.537843902386898E-004 + 2.603031400894350E-004 2.669917391905734E-004 2.738547346100261E-004 2.808968011946904E-004 + 2.881227454539258E-004 2.955375095745482E-004 3.031461755723603E-004 3.109539695854551E-004 + 3.189662663147558E-004 3.271885936174967E-004 3.356266372595768E-004 3.442862458329962E-004 + 3.531734358448333E-004 3.622943969845110E-004 3.716554975763972E-004 3.812632902250816E-004 + 3.911245176610001E-004 4.012461187944095E-004 4.116352349860760E-004 4.222992165433964E-004 + 4.332456294510666E-004 4.444822623458136E-004 4.560171337451309E-004 4.678584995404012E-004 + 4.800148607652521E-004 4.924949716504670E-004 5.053078479773158E-004 5.184627757416570E-004 + 5.319693201417565E-004 5.458373349033436E-004 5.600769719560261E-004 5.746986914758452E-004 + 5.897132723094166E-004 6.051318227958057E-004 6.209657920030377E-004 6.372269813968846E-004 + 6.539275569604295E-004 6.710800617837286E-004 6.886974291437725E-004 7.067929960959211E-004 + 7.253805175989150E-004 7.444741811966527E-004 7.640886222809351E-004 7.842389399605466E-004 + 8.049407135632276E-004 8.262100197982901E-004 8.480634506089848E-004 8.705181317450329E-004 + 8.935917420872118E-004 9.173025337573473E-004 9.416693530486545E-004 9.667116622130000E-004 + 9.924495621433901E-004 1.018903815991812E-003 1.046095873764423E-003 1.074047897938102E-003 + 1.102782790144440E-003 1.132324218969454E-003 1.162696648919579E-003 1.193925370606937E-003 + 1.226036532209351E-003 1.259057172263266E-003 1.293015253850478E-003 1.327939700242517E-003 + 1.363860432069561E-003 1.400808406083921E-003 1.438815655591595E-003 1.477915332628785E-003 + 1.518141751964067E-003 1.559530437010706E-003 1.602118167737684E-003 1.645943030672309E-003 + 1.691044471091680E-003 1.737463347504984E-003 1.785241988533543E-003 1.834424252300627E-003 + 1.885055588448501E-003 1.937183102905802E-003 1.990855625534287E-003 2.046123780790258E-003 + 2.103040061542420E-003 2.161658906194896E-003 2.222036779271190E-003 2.284232255622487E-003 + 2.348306108431564E-003 2.414321401191835E-003 2.482343583849788E-003 2.552440593308163E-003 + 2.624682958496659E-003 2.699143910227203E-003 2.775899496060976E-003 2.855028700425716E-003 + 2.936613570233089E-003 3.020739346258187E-003 3.107494600555753E-003 3.196971380201057E-003 + 3.289265357657271E-003 3.384475988085804E-003 3.482706673931231E-003 3.584064937128645E-003 + 3.688662599297827E-003 3.796615970306470E-003 3.908046045602871E-003 4.023078712738033E-003 + 4.141844967517167E-003 4.264481140241931E-003 4.391129132526848E-003 4.521936665196583E-003 + 4.657057537795245E-003 4.796651900264204E-003 4.940886537371732E-003 5.089935166505822E-003 + 5.243978749470586E-003 5.403205818957583E-003 5.567812820395269E-003 5.738004469913498E-003 + 5.913994129195173E-003 6.096004198023876E-003 6.284266525374865E-003 6.479022839937069E-003 + 6.680525200995912E-003 6.889036470650886E-003 7.104830808387874E-003 7.328194189074523E-003 + 7.559424945497336E-003 7.798834336611919E-003 8.046747142732989E-003 8.303502288948180E-003 + 8.569453498100265E-003 8.844969974744984E-003 9.130437121557486E-003 9.426257289729336E-003 + 9.732850564969298E-003 1.005065559079650E-002 1.038013043089228E-002 1.072175347235904E-002 + 1.107602437181945E-002 1.144346504637815E-002 1.182462071156092E-002 1.222006096844304E-002 + 1.263038094227914E-002 1.305620247505232E-002 1.349817537446949E-002 1.395697872204440E-002 + 1.443332224302847E-002 1.492794774107337E-002 1.544163060063848E-002 1.597518136029032E-002 + 1.652944736018039E-002 1.710531446713401E-002 1.770370888093242E-002 1.832559902552833E-002 + 1.897199752909819E-002 1.964396329700269E-002 2.034260368190491E-002 2.106907675547543E-002 + 2.182459368630558E-002 2.261042122884452E-002 2.342788432838032E-002 2.427836884729521E-002 + 2.516332441804422E-002 2.608426742853154E-002 2.704278414579301E-002 2.804053398413379E-002 + 2.907925292412102E-002 3.016075708908653E-002 3.128694648606255E-002 3.245980891834526E-002 + 3.368142407716346E-002 3.495396782022030E-002 3.627971664517301E-002 3.766105236642371E-002 + 3.910046700390658E-002 4.060056789288118E-002 4.216408302407083E-002 4.379386662382136E-002 + 4.549290498430305E-002 4.726432255412735E-002 4.911138830010943E-002 5.103752235127269E-002 + 5.304630293655802E-002 5.514147362807872E-002 5.732695090213600E-002 5.960683203059534E-002 + 6.198540331560547E-002 6.446714868102565E-002 6.705675863431551E-002 6.975913961301866E-002 + 7.257942373035620E-002 7.552297893481977E-002 7.859541959901917E-002 8.180261755340390E-002 + 8.515071358081930E-002 8.864612938819641E-002 9.229558007198978E-002 9.610608709427088E-002 + 1.000849917866600E-001 1.042399693995211E-001 1.085790437140559E-001 1.131106022351103E-001 + 1.178434119826307E-001 1.227866358998008E-001 1.279498498959067E-001 1.333430605419502E-001 + 1.389767234369271E-001 1.448617622624955E-001 1.510095885435023E-001 1.574321221314513E-001 + 1.641418124275277E-001 1.711516603611945E-001 1.784752411396232E-001 1.861267277823591E-001 + 1.941209154545394E-001 2.024732466107572E-001 2.111998369602188E-001 2.203175022621525E-001 + 2.298437859585225E-001 2.397969876488761E-001 2.501961924096580E-001 2.610613009574687E-001 + 2.724130606525119E-001 2.842730973348558E-001 2.966639479820164E-001 3.096090941717877E-001 + 3.231329963290912E-001 3.372611287298336E-001 3.520200152283500E-001 3.674372656677955E-001 + 3.835416129248559E-001 4.003629505312400E-001 4.179323708044811E-001 4.362822034096009E-001 + 4.554460542609243E-001 4.754588446598009E-001 4.963568505489453E-001 5.181777417474436E-001 + 5.409606210120491E-001 5.647460627499719E-001 5.895761511857931E-001 6.154945177602236E-001 + 6.425463775108318E-001 6.707785641545061E-001 7.002395635578308E-001 7.309795452445998E-001 + 7.630503915489855E-001 7.965057239780209E-001 8.314009262978587E-001 8.677931638040994E-001 + 9.057413981771985E-001 9.453063972589527E-001 9.865507390149431E-001 1.029538808870277E+000 + 1.074336789521270E+000 1.121012642233833E+000 1.169636078539463E+000 1.220278521131725E+000 + 1.273013052649753E+000 1.327914350909938E+000 1.385058609012993E+000 1.444523438610644E+000 + 1.506387754464574E+000 1.570731638270499E+000 1.637636179552902E+000 1.707183291262164E+000 + 1.779455497527176E+000 1.854535690834670E+000 1.932506855724619E+000 2.013451755911750E+000 + 2.097452581571277E+000 2.184590553367077E+000 2.274945479658786E+000 2.368595263208514E+000 + 2.465615353626132E+000 2.566078141755009E+000 2.670052292219319E+000 2.777602010442556E+000 + 2.888786240620720E+000 3.003657791408458E+000 3.122262386471839E+000 3.244637637597044E+000 + 3.370811938740718E+000 3.500803280289043E+000 3.634617983879301E+000 3.772249359453690E+000 + 3.913676287781124E+000 4.058861733516611E+000 4.207751195986397E+000 4.360271107297915E+000 + 4.516327190081499E+000 4.675802790167435E+000 4.838557202770031E+000 5.004424014258449E+000 + 5.173209485293118E+000 5.344691004931090E+000 5.518615649167344E+000 5.694698881171542E+000 + 5.872623434072649E+000 6.052038420379644E+000 6.232558714833202E+000 6.413764659462462E+000 + 6.595202140665742E+000 6.776383088023213E+000 6.956786443060965E+000 7.135859643106423E+000 + 7.313020660504220E+000 7.487660630631369E+000 7.659147093230540E+000 7.826827860492219E+000 + 7.990035512046748E+000 8.148092501630988E+000 8.300316842807096E+000 8.446028321949131E+000 + 8.584555166071841E+000 8.715241071330365E+000 8.837452475604078E+000 8.950585935987947E+000 + 9.054075449775638E+000 9.147399536175701E+000 9.230087876096249E+000 9.301727289372039E+000 + 9.361966813250383E+000 9.410521633168901E+000 9.447175607108328E+000 9.471782118196989E+000 + 9.484262986701477E+000 9.484605171765882E+000 9.472854994732511E+000 9.449109799526678E+000 + 9.413509234029927E+000 9.366232023840556E+000 9.307494705412942E+000 9.237550331830462E+000 + 9.156687001726613E+000 9.065226223228187E+000 8.963521125610381E+000 8.851954532041583E+000 + 8.730936907361560E+000 8.600904195285107E+000 8.462315559762876E+000 8.315651045460609E+000 + 8.161409172445017E+000 8.000104480190386E+000 7.832265035947301E+000 7.658429922349852E+000 + 7.479146718882118E+000 7.294968991485057E+000 7.106453804166978E+000 6.914159265988351E+000 + 6.718642126236371E+000 6.520455429987573E+000 6.320146245591683E+000 6.118253474901577E+000 + 5.915305756331610E+000 5.711819470060691E+000 5.508296853916888E+000 5.305224237657406E+000 + 5.103070402599875E+000 4.902285072796324E+000 4.703297543088516E+000 4.506515448586239E+000 + 4.312323679452144E+000 4.121083444141861E+000 3.933131483336672E+000 3.748779436122819E+000 + 3.568313359250326E+000 3.391993399440976E+000 3.220053617880767E+000 3.052701965138531E+000 + 2.890120403801799E+000 2.732465175110386E+000 2.579867204803431E+000 2.432432642286006E+000 + 2.290243526085393E+000 2.153358567430362E+000 2.021814042679622E+000 1.895624784284418E+000 + 1.774785259032304E+000 1.659270721521602E+000 1.549038430193564E+000 1.444028912829690E+000 + 1.344167268226764E+000 1.249364490803658E+000 1.159518805174173E+000 1.074516998232068E+000 + 9.942357370207028E-001 9.185428615760307E-001 8.472986430060530E-001 7.803569982657481E-001 + 7.175666543641025E-001 6.587722560579047E-001 6.038154124049805E-001 5.525356788289217E-001 + 5.047714725535263E-001 4.603609203686996E-001 4.191426386670396E-001 3.809564465256273E-001 + 3.456440132918931E-001 3.130494426644784E-001 2.830197956458146E-001 2.554055549945973E-001 + 2.300610339409994E-001 2.068447319660214E-001 1.856196404118320E-001 1.662535006055080E-001 + 1.486190170661049E-001 1.325940282439157E-001 1.180616371268363E-001 1.049103039536001E-001 + 9.303390320455152E-002 8.233174700068216E-002 7.270857703029772E-002 6.407452713633191E-002 + 5.634505873021127E-002 4.944087124323114E-002 4.328778987597293E-002 3.781663295290384E-002 + 3.296306122615431E-002 2.866741149387129E-002 2.487451690014486E-002 2.153351626236407E-002 + 1.859765472650161E-002 1.602407798106942E-002 1.377362216732735E-002 1.181060150871119E-002 + 1.010259554905065E-002 8.620237740176459E-003 7.337006958474213E-003 6.229023360461341E-003 + 5.274849813147058E-003 4.455299959214796E-003 3.753253803121763E-003 3.153481534878796E-003 + 2.642476146014689E-003 2.208295239094210E-003 1.840412289783223E-003 1.529577490068310E-003 + 1.267688183683547E-003 1.047668800557950E-003 8.633601063333917E-004 7.094175055890282E-004 + 5.812180729750608E-004 4.747759344326309E-004 3.866655803216977E-004 3.139526627340820E-004 + 2.541318095847459E-004 2.050709772452112E-004 1.649618604760847E-004 1.322758821971639E-004 + 1.057252951901019E-004 8.422894218525724E-005 6.688223901946445E-005 5.293096680755006E-005 + 4.174848256226919E-005 3.281598271727856E-005 2.570547992813738E-005 2.006517980020077E-005 + 1.560697035182976E-005 1.209576267509021E-005 9.340446084630689E-006 7.186244796280297E-006 + 5.508285658869842E-006 4.206207539618776E-006 3.199662547506633E-006 2.424577324875719E-006 + 1.830059135462381E-006 1.375846447336157E-006 1.030217196213786E-006 7.682799816371678E-007 + 5.705841731146864E-007 4.219943730985473E-007 3.107829925363915E-007 2.279019398336058E-007 + 1.664007031176535E-007 1.209635148673064E-007 8.754292015398305E-008 6.307101327734135E-008 + 4.523294530632377E-008 3.229015723197786E-008 2.294326727852911E-008 1.622500305085240E-008 + 1.141911281915015E-008 7.997814028920651E-009 5.574097672665867E-009 3.865581380118584E-009 + 2.667253769992346E-009 1.831028391550769E-009 1.250485464356297E-009 8.495448242769811E-010 + 5.741018229627817E-010 3.858842612951436E-010 2.579650607520829E-010 1.715023971528729E-010 + 1.133846888065112E-010 7.453883332444888E-011 4.872180811182958E-011 3.166249325272587E-011 + 2.045575994235830E-011 1.313718792748279E-011 8.386342251957678E-012 5.320994509732099E-012 + 3.355284650472650E-012 2.102558632573443E-012 1.309225576734737E-012 8.100157691188354E-013 + 4.979086469158939E-013 3.040515369267409E-013 1.844377314368409E-013 1.111272637104405E-013 + 6.650013729769101E-014 3.952008473659406E-014 2.332214345974806E-014 1.366582083366721E-014 + 7.950245951888975E-015 4.591593378961119E-015 2.632353652443102E-015 1.497898739771295E-015 + 8.459350599788174E-016 4.740960961923515E-016 2.636504025842742E-016 1.454723991197269E-016 + 7.963055369165518E-017 4.323965050083439E-017 2.328861765000499E-017 1.243997721903410E-017 + 6.589682419816772E-018 3.461246556173034E-018 1.802508419289567E-018 9.305758490344666E-019 + 4.762208438896140E-019 2.415455669980665E-019 1.214158000532303E-019 6.047666751646655E-020 + 2.984612469167028E-020 1.459240546539496E-020 7.067368386342975E-021 3.390297844314284E-021 + 1.610774697909853E-021 7.579476285905844E-022 3.532593864940209E-022 1.631387060061600E-022 + 7.472279427930461E-023 3.402570028600894E-023 1.548843874751700E-023 6.976332586563125E-024 + 3.108909104067513E-024 1.370540310265716E-024 5.976121780399459E-025 2.577098719545178E-025 + 1.098919971383199E-025 4.633008698321336E-026 1.930901309977488E-026 7.954154916543868E-027 + 3.238182519057423E-027 1.302619030324111E-027 5.176986401015360E-028 2.032422600694362E-028 + 7.880639071726435E-029 3.017529282899654E-029 1.140815818898848E-029 4.257788166960202E-030 + 1.568507707763523E-030 5.702326567944468E-031 2.045540915390602E-031 7.239054424891156E-032 + 2.526964310821747E-032 8.699314864933074E-033 2.953002434924013E-033 9.882311913719036E-034 + 3.259804276287660E-034 1.059702475123587E-034 3.394345751518204E-035 1.071092947483377E-035 + 3.329012498562380E-036 1.018915288893930E-036 3.070515409734788E-037 9.108568742051845E-038 + 2.659308340643082E-038 7.639763351834770E-039 2.159213741749150E-039 6.002423574159030E-040 + 1.640901642577767E-040 4.410337891727039E-041 1.165203890005834E-041 3.025372927164016E-042 + 7.718054384877018E-043 1.934160390645613E-043 4.760312492536675E-044 1.150371563249626E-044 + 2.728981788460229E-045 6.353628755702412E-046 1.451440815240682E-046 3.252590869127966E-047 + 7.148372318488842E-048 1.540374060464837E-048 3.253710323560254E-049 6.735288861933596E-050 + 1.365991021718147E-050 2.713575922227922E-051 5.278681437457383E-052 1.005272220462149E-052 + 1.873702457043289E-053 3.417108698563338E-054 6.095919349287256E-055 1.063460622120381E-055 + 1.813775005423663E-056 3.023442352330697E-057 4.924375704900590E-058 7.834390779712392E-059 + 1.217126181970872E-059 1.845918203142256E-060 2.732148421634400E-061 3.945281294065639E-062 + 5.556466420038769E-063 7.630094928165562E-064 1.021253335934194E-064 1.331893102661997E-065 + 1.691982475354046E-066 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 + + diff --git a/tests/apps/miniDFT/tests/rm_execution_multi_host b/tests/apps/miniDFT/tests/rm_execution_multi_host new file mode 100755 index 0000000000..403136f94f --- /dev/null +++ b/tests/apps/miniDFT/tests/rm_execution_multi_host @@ -0,0 +1,83 @@ +#!../../../common/bats/bin/bats +# -*-sh-*- + +load ../../../common/test_helper_functions || exit 1 +source ../../../common/functions || exit 1 + +if [ -s ./TEST_ENV ];then + . ./TEST_ENV +else + ERROR "TEST_ENV does not exist" +fi + +rm=$RESOURCE_MANAGER + +# init run options +tdir=./test +sample="Si_333" +ifile=$sample.in +ofile=$sample.out +rfile=QE_$sample.out.ref +rtext="! total energy" + +NODES=$((NUM_COMPUTES < TEST_MAX_COMPUTES ? NUM_COMPUTES : TEST_MAX_COMPUTES)) +TASKS=$((NODES*TEST_NUM_RANKS)) +ARGS="-in $ifile" +EXE=$TEST_EXE.$LMOD_FAMILY_COMPILER.$LMOD_FAMILY_MPI + +# set global env settings +export OMP_NUM_THREADS=$TEST_NUM_THREADS +if [ $LMOD_FAMILY_MPI == "mvapich2" ];then + export MV2_ENABLE_AFFINITY=0 + export IPATH_NO_CPUAFFINITY=1 + # temporary workaround pending investigation on issue related to IB registration cache + if [ $LMOD_FAMILY_COMPILER == "gnu" ];then + export MV2_VBUF_TOTAL_SIZE=8000000 + export MV2_IBA_EAGER_THRESHOLD=8000000 + fi +fi + +@test "[Apps/miniDFT] run miniDFT on multi nodes under resource manager ($rm/$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + rm -f $tdir/$ofile $tdir/job.*.out + + if [ ! -x $EXE ];then + flunk "missing $EXE" + fi + + if [ ! -s $tdir/$ifile ];then + flunk "missing $ifile" + fi + + pushd $tdir >& /dev/null + run_mpi_binary -t $CMD_TIMEOUT -o $ofile ../$EXE "$ARGS" $NODES $TASKS + assert_success + popd >& /dev/null +} + +if [ "$TEST_VERIFY"=="1" ];then +@test "[Apps/miniDFT] validate miniDFT multi node output ($rm/$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + diff <(grep "$rtext" $tdir/$rfile) <(grep "$rtext" $tdir/$ofile) + assert_success +} +fi + +@test "[Apps/miniDFT] log miniDFT multi node results ($rm/$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + run_tag=miniDFT.${sample}.P${TASKS} + wfile=$run_tag.$LMOD_FAMILY_COMPILER.$LMOD_FAMILY_MPI.out + mv $tdir/$ofile $tdir/$wfile || exit 1 + + str="Benchmark_Time" + ref_time=`grep $str $tdir/ref/$wfile | sed 's/.*CPU \(.*\)s WALL.*/\1/'` + cur_time=`grep $str $tdir/$wfile | sed 's/.*CPU \(.*\)s WALL.*/\1/'` + + if [ -z $ref_time ];then + ref_time="?" + fi + + if [ -z $cur_time ];then + cur_time="?" + fi + + fmt="%-24s %-10s %-10s %16s %16s\n" + printf "$fmt" $run_tag $LMOD_FAMILY_COMPILER $LMOD_FAMILY_MPI $ref_time $cur_time >>$TEST_PERFLOG +} diff --git a/tests/apps/miniDFT/tests/rm_execution_single_host b/tests/apps/miniDFT/tests/rm_execution_single_host new file mode 100755 index 0000000000..0632994ead --- /dev/null +++ b/tests/apps/miniDFT/tests/rm_execution_single_host @@ -0,0 +1,79 @@ +#!../../../common/bats/bin/bats +# -*-sh-*- + +load ../../../common/test_helper_functions || exit 1 +source ../../../common/functions || exit 1 + +if [ -s ./TEST_ENV ];then + . ./TEST_ENV +else + ERROR "TEST_ENV does not exist" +fi + +check_rms +rm=$RESOURCE_MANAGER + +# init run options +tdir=./test +sample="Si_333" +ifile=$sample.in +ofile=$sample.out +rfile=QE_$sample.out.ref +rtext="! total energy" + +NODES=1 +TASKS=$((NODES*TEST_NUM_RANKS)) +ARGS="-in $ifile" +EXE=$TEST_EXE.$LMOD_FAMILY_COMPILER.$LMOD_FAMILY_MPI + +# set global env settings +export OMP_NUM_THREADS=$TEST_NUM_THREADS +if [ $LMOD_FAMILY_MPI == "mvapich2" ];then + export MV2_ENABLE_AFFINITY=0 + export IPATH_NO_CPUAFFINITY=1 +fi + +@test "[Apps/miniDFT] run miniDFT on single node under resource manager ($RMS/$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + rm -f $tdir/$ofile + + if [ ! -x $EXE ];then + flunk "missing $EXE" + fi + + if [ ! -s $tdir/$ifile ];then + flunk "missing $ifile" + fi + + pushd $tdir >& /dev/null + run_mpi_binary -t $CMD_TIMEOUT -o $ofile ../$EXE "$ARGS" $NODES $TASKS + assert_success + popd >& /dev/null +} + +if [ "$TEST_VERIFY"=="1" ];then +@test "[Apps/miniDFT] validate miniDFT single node output ($RMS/$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + diff <(grep "$rtext" $tdir/$rfile) <(grep "$rtext" $tdir/$ofile) + assert_success +} +fi + +@test "[Apps/miniDFT] log miniDFT single node results ($RMS/$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + run_tag=miniDFT.${sample}.P${TASKS} + wfile=$run_tag.$LMOD_FAMILY_COMPILER.$LMOD_FAMILY_MPI.out + mv $tdir/$ofile $tdir/$wfile || exit 1 + + str="Benchmark_Time" + ref_time=`grep $str $tdir/ref/$wfile | sed 's/.*CPU \(.*\)s WALL.*/\1/'` + cur_time=`grep $str $tdir/$wfile | sed 's/.*CPU \(.*\)s WALL.*/\1/'` + + if [ -z $ref_time ];then + ref_time="?" + fi + + if [ -z $cur_time ];then + cur_time="?" + fi + + fmt="%-24s %-10s %-10s %16s %16s\n" + printf "$fmt" $run_tag $LMOD_FAMILY_COMPILER $LMOD_FAMILY_MPI $ref_time $cur_time >>$TEST_PERFLOG +} diff --git a/tests/apps/miniDFT/tests/sample_outputs/MiniDFT_capability.out.ref b/tests/apps/miniDFT/tests/sample_outputs/MiniDFT_capability.out.ref new file mode 100644 index 0000000000..13c3a9b9f2 --- /dev/null +++ b/tests/apps/miniDFT/tests/sample_outputs/MiniDFT_capability.out.ref @@ -0,0 +1,2191 @@ + + Program MiniDFT v.1.0 starts on 24May2013 at 21:38:23 + + This is mini-DFT, a mini-application for plane-wave density functional + theory calculations. Mini-DFT was extracted from + the open-source Quantum ESPRESSO suite by B. Austin (2013). + + To acknowledge Quantum ESPRESSO, please cite + P. Giannozzi et al., J. Phys.:Condens. Matter 21 395502 (2009); + URL http://www.quantum-espresso.org + + Parallel version (MPI), running on 100200 processors + K-points division: npool = 10 + R & G space division: proc/pool = 10020 + wavefunctions fft division: fft/group = 5 + + Current dimensions of program MiniDFT are: + Max number of different atomic species (ntypx) = 10 + Max number of k-points (npk) = 40000 + Max angular momentum in pseudopotentials (lmaxx) = 3 + Reading input from capability.in + + Subspace diagonalization in iterative solution of the eigenvalue problem: + scalapack distributed-memory algorithm (size of sub-group: 70* 70 procs) + + Found symmetry operation: I + ( 0.0000 0.0000 0.1000) + This is a supercell, fractional translations are disabled + + Task Groups are in USE + groups and procs/group : 5 2004 + + Parallelization info + -------------------- + sticks: dense smooth PW G-vecs: dense smooth PW + Min 11 11 2 2479 2479 267 + Max 12 12 3 2513 2513 347 + Sum 112831 112831 28261 25025493 25025493 3142337 + + + + bravais-lattice index = 0 + lattice parameter (alat) = 7.9366 a.u. + unit-cell volume = 124979.9088 (a.u.)^3 + number of atoms/cell = 2000 + number of atomic types = 2 + number of electrons = 8000.00 + number of Kohn-Sham states= 4000 + kinetic-energy cutoff = 130.0000 Ry + charge density cutoff = 520.0000 Ry + convergence threshold = 1.0E-10 + mixing beta = 0.7000 + number of iterations used = 8 plain mixing + Exchange-correlation = PZ ( 1 1 0 0 0) + + celldm(1)= 7.936580 celldm(2)= 0.000000 celldm(3)= 0.000000 + celldm(4)= 0.000000 celldm(5)= 0.000000 celldm(6)= 0.000000 + + crystal axes: (cart. coord. in units of alat) + a(1) = ( 0.000000 5.000000 5.000000 ) + a(2) = ( 5.000000 0.000000 5.000000 ) + a(3) = ( 5.000000 5.000000 0.000000 ) + + reciprocal axes: (cart. coord. in units 2 pi/alat) + b(1) = ( -0.100000 0.100000 0.100000 ) + b(2) = ( 0.100000 -0.100000 0.100000 ) + b(3) = ( 0.100000 0.100000 -0.100000 ) + + + PseudoPot. # 1 for Mg read from file: + ./Mg.pz.nml + MD5 check sum: f0361a84b86a1a82c6b5f2c54d8a9b88 + Pseudo is Norm-conserving, Zval = 2.0 + Generated using BHS code + Using radial grid of 425 points, 1 beta functions with: + l(1) = 0 + + PseudoPot. # 2 for O read from file: + ./O.pz.nml + MD5 check sum: 02e36e55e29b8f2f4a0748c6f080d52f + Pseudo is Norm-conserving, Zval = 6.0 + Generated using JLMartins code + Using radial grid of 921 points, 1 beta functions with: + l(1) = 0 + + atomic species valence mass pseudopotential + Mg 2.00 24.30500 Mg( 1.00) + O 6.00 15.99900 O( 1.00) + + 48 Sym. Ops., with inversion, found + + + + Cartesian axes + + site n. atom positions (alat units) + 1 Mg tau( 1) = ( 0.0000000 0.0000000 0.0000000 ) + 2 O tau( 2) = ( 0.5000000 0.5000000 0.5000000 ) + 3 Mg tau( 3) = ( 0.5000000 0.5000000 0.0000000 ) + 4 O tau( 4) = ( 1.0000000 1.0000000 0.5000000 ) + 5 Mg tau( 5) = ( 1.0000000 1.0000000 0.0000000 ) + 6 O tau( 6) = ( 1.5000000 1.5000000 0.5000000 ) + 7 Mg tau( 7) = ( 1.5000000 1.5000000 0.0000000 ) + 8 O tau( 8) = ( 2.0000000 2.0000000 0.5000000 ) + 9 Mg tau( 9) = ( 2.0000000 2.0000000 0.0000000 ) + 10 O tau( 10) = ( 2.5000000 2.5000000 0.5000000 ) + 11 Mg tau( 11) = ( 2.5000000 2.5000000 0.0000000 ) + 12 O tau( 12) = ( 3.0000000 3.0000000 0.5000000 ) + 13 Mg tau( 13) = ( 3.0000000 3.0000000 0.0000000 ) + 14 O tau( 14) = ( 3.5000000 3.5000000 0.5000000 ) + 15 Mg tau( 15) = ( 3.5000000 3.5000000 0.0000000 ) + 16 O tau( 16) = ( 4.0000000 4.0000000 0.5000000 ) + 17 Mg tau( 17) = ( 4.0000000 4.0000000 0.0000000 ) + 18 O tau( 18) = ( 4.5000000 4.5000000 0.5000000 ) + 19 Mg tau( 19) = ( 4.5000000 4.5000000 0.0000000 ) + 20 O tau( 20) = ( 5.0000000 5.0000000 0.5000000 ) + 21 Mg tau( 21) = ( 0.5000000 0.0000000 0.5000000 ) + 22 O tau( 22) = ( 1.0000000 0.5000000 1.0000000 ) + 23 Mg tau( 23) = ( 1.0000000 0.5000000 0.5000000 ) + 24 O tau( 24) = ( 1.5000000 1.0000000 1.0000000 ) + 25 Mg tau( 25) = ( 1.5000000 1.0000000 0.5000000 ) + 26 O tau( 26) = ( 2.0000000 1.5000000 1.0000000 ) + 27 Mg tau( 27) = ( 2.0000000 1.5000000 0.5000000 ) + 28 O tau( 28) = ( 2.5000000 2.0000000 1.0000000 ) + 29 Mg tau( 29) = ( 2.5000000 2.0000000 0.5000000 ) + 30 O tau( 30) = ( 3.0000000 2.5000000 1.0000000 ) + 31 Mg tau( 31) = ( 3.0000000 2.5000000 0.5000000 ) + 32 O tau( 32) = ( 3.5000000 3.0000000 1.0000000 ) + 33 Mg tau( 33) = ( 3.5000000 3.0000000 0.5000000 ) + 34 O tau( 34) = ( 4.0000000 3.5000000 1.0000000 ) + 35 Mg tau( 35) = ( 4.0000000 3.5000000 0.5000000 ) + 36 O tau( 36) = ( 4.5000000 4.0000000 1.0000000 ) + 37 Mg tau( 37) = ( 4.5000000 4.0000000 0.5000000 ) + 38 O tau( 38) = ( 5.0000000 4.5000000 1.0000000 ) + 39 Mg tau( 39) = ( 5.0000000 4.5000000 0.5000000 ) + 40 O tau( 40) = ( 5.5000000 5.0000000 1.0000000 ) + 41 Mg tau( 41) = ( 1.0000000 0.0000000 1.0000000 ) + 42 O tau( 42) = ( 1.5000000 0.5000000 1.5000000 ) + 43 Mg tau( 43) = ( 1.5000000 0.5000000 1.0000000 ) + 44 O tau( 44) = ( 2.0000000 1.0000000 1.5000000 ) + 45 Mg tau( 45) = ( 2.0000000 1.0000000 1.0000000 ) + 46 O tau( 46) = ( 2.5000000 1.5000000 1.5000000 ) + 47 Mg tau( 47) = ( 2.5000000 1.5000000 1.0000000 ) + 48 O tau( 48) = ( 3.0000000 2.0000000 1.5000000 ) + 49 Mg tau( 49) = ( 3.0000000 2.0000000 1.0000000 ) + 50 O tau( 50) = ( 3.5000000 2.5000000 1.5000000 ) + 51 Mg tau( 51) = ( 3.5000000 2.5000000 1.0000000 ) + 52 O tau( 52) = ( 4.0000000 3.0000000 1.5000000 ) + 53 Mg tau( 53) = ( 4.0000000 3.0000000 1.0000000 ) + 54 O tau( 54) = ( 4.5000000 3.5000000 1.5000000 ) + 55 Mg tau( 55) = ( 4.5000000 3.5000000 1.0000000 ) + 56 O tau( 56) = ( 5.0000000 4.0000000 1.5000000 ) + 57 Mg tau( 57) = ( 5.0000000 4.0000000 1.0000000 ) + 58 O tau( 58) = ( 5.5000000 4.5000000 1.5000000 ) + 59 Mg tau( 59) = ( 5.5000000 4.5000000 1.0000000 ) + 60 O tau( 60) = ( 6.0000000 5.0000000 1.5000000 ) + 61 Mg tau( 61) = ( 1.5000000 0.0000000 1.5000000 ) + 62 O tau( 62) = ( 2.0000000 0.5000000 2.0000000 ) + 63 Mg tau( 63) = ( 2.0000000 0.5000000 1.5000000 ) + 64 O tau( 64) = ( 2.5000000 1.0000000 2.0000000 ) + 65 Mg tau( 65) = ( 2.5000000 1.0000000 1.5000000 ) + 66 O tau( 66) = ( 3.0000000 1.5000000 2.0000000 ) + 67 Mg tau( 67) = ( 3.0000000 1.5000000 1.5000000 ) + 68 O tau( 68) = ( 3.5000000 2.0000000 2.0000000 ) + 69 Mg tau( 69) = ( 3.5000000 2.0000000 1.5000000 ) + 70 O tau( 70) = ( 4.0000000 2.5000000 2.0000000 ) + 71 Mg tau( 71) = ( 4.0000000 2.5000000 1.5000000 ) + 72 O tau( 72) = ( 4.5000000 3.0000000 2.0000000 ) + 73 Mg tau( 73) = ( 4.5000000 3.0000000 1.5000000 ) + 74 O tau( 74) = ( 5.0000000 3.5000000 2.0000000 ) + 75 Mg tau( 75) = ( 5.0000000 3.5000000 1.5000000 ) + 76 O tau( 76) = ( 5.5000000 4.0000000 2.0000000 ) + 77 Mg tau( 77) = ( 5.5000000 4.0000000 1.5000000 ) + 78 O tau( 78) = ( 6.0000000 4.5000000 2.0000000 ) + 79 Mg tau( 79) = ( 6.0000000 4.5000000 1.5000000 ) + 80 O tau( 80) = ( 6.5000000 5.0000000 2.0000000 ) + 81 Mg tau( 81) = ( 2.0000000 0.0000000 2.0000000 ) + 82 O tau( 82) = ( 2.5000000 0.5000000 2.5000000 ) + 83 Mg tau( 83) = ( 2.5000000 0.5000000 2.0000000 ) + 84 O tau( 84) = ( 3.0000000 1.0000000 2.5000000 ) + 85 Mg tau( 85) = ( 3.0000000 1.0000000 2.0000000 ) + 86 O tau( 86) = ( 3.5000000 1.5000000 2.5000000 ) + 87 Mg tau( 87) = ( 3.5000000 1.5000000 2.0000000 ) + 88 O tau( 88) = ( 4.0000000 2.0000000 2.5000000 ) + 89 Mg tau( 89) = ( 4.0000000 2.0000000 2.0000000 ) + 90 O tau( 90) = ( 4.5000000 2.5000000 2.5000000 ) + 91 Mg tau( 91) = ( 4.5000000 2.5000000 2.0000000 ) + 92 O tau( 92) = ( 5.0000000 3.0000000 2.5000000 ) + 93 Mg tau( 93) = ( 5.0000000 3.0000000 2.0000000 ) + 94 O tau( 94) = ( 5.5000000 3.5000000 2.5000000 ) + 95 Mg tau( 95) = ( 5.5000000 3.5000000 2.0000000 ) + 96 O tau( 96) = ( 6.0000000 4.0000000 2.5000000 ) + 97 Mg tau( 97) = ( 6.0000000 4.0000000 2.0000000 ) + 98 O tau( 98) = ( 6.5000000 4.5000000 2.5000000 ) + 99 Mg tau( 99) = ( 6.5000000 4.5000000 2.0000000 ) + 100 O tau( 100) = ( 7.0000000 5.0000000 2.5000000 ) + 101 Mg tau( 101) = ( 2.5000000 0.0000000 2.5000000 ) + 102 O tau( 102) = ( 3.0000000 0.5000000 3.0000000 ) + 103 Mg tau( 103) = ( 3.0000000 0.5000000 2.5000000 ) + 104 O tau( 104) = ( 3.5000000 1.0000000 3.0000000 ) + 105 Mg tau( 105) = ( 3.5000000 1.0000000 2.5000000 ) + 106 O tau( 106) = ( 4.0000000 1.5000000 3.0000000 ) + 107 Mg tau( 107) = ( 4.0000000 1.5000000 2.5000000 ) + 108 O tau( 108) = ( 4.5000000 2.0000000 3.0000000 ) + 109 Mg tau( 109) = ( 4.5000000 2.0000000 2.5000000 ) + 110 O tau( 110) = ( 5.0000000 2.5000000 3.0000000 ) + 111 Mg tau( 111) = ( 5.0000000 2.5000000 2.5000000 ) + 112 O tau( 112) = ( 5.5000000 3.0000000 3.0000000 ) + 113 Mg tau( 113) = ( 5.5000000 3.0000000 2.5000000 ) + 114 O tau( 114) = ( 6.0000000 3.5000000 3.0000000 ) + 115 Mg tau( 115) = ( 6.0000000 3.5000000 2.5000000 ) + 116 O tau( 116) = ( 6.5000000 4.0000000 3.0000000 ) + 117 Mg tau( 117) = ( 6.5000000 4.0000000 2.5000000 ) + 118 O tau( 118) = ( 7.0000000 4.5000000 3.0000000 ) + 119 Mg tau( 119) = ( 7.0000000 4.5000000 2.5000000 ) + 120 O tau( 120) = ( 7.5000000 5.0000000 3.0000000 ) + 121 Mg tau( 121) = ( 3.0000000 0.0000000 3.0000000 ) + 122 O tau( 122) = ( 3.5000000 0.5000000 3.5000000 ) + 123 Mg tau( 123) = ( 3.5000000 0.5000000 3.0000000 ) + 124 O tau( 124) = ( 4.0000000 1.0000000 3.5000000 ) + 125 Mg tau( 125) = ( 4.0000000 1.0000000 3.0000000 ) + 126 O tau( 126) = ( 4.5000000 1.5000000 3.5000000 ) + 127 Mg tau( 127) = ( 4.5000000 1.5000000 3.0000000 ) + 128 O tau( 128) = ( 5.0000000 2.0000000 3.5000000 ) + 129 Mg tau( 129) = ( 5.0000000 2.0000000 3.0000000 ) + 130 O tau( 130) = ( 5.5000000 2.5000000 3.5000000 ) + 131 Mg tau( 131) = ( 5.5000000 2.5000000 3.0000000 ) + 132 O tau( 132) = ( 6.0000000 3.0000000 3.5000000 ) + 133 Mg tau( 133) = ( 6.0000000 3.0000000 3.0000000 ) + 134 O tau( 134) = ( 6.5000000 3.5000000 3.5000000 ) + 135 Mg tau( 135) = ( 6.5000000 3.5000000 3.0000000 ) + 136 O tau( 136) = ( 7.0000000 4.0000000 3.5000000 ) + 137 Mg tau( 137) = ( 7.0000000 4.0000000 3.0000000 ) + 138 O tau( 138) = ( 7.5000000 4.5000000 3.5000000 ) + 139 Mg tau( 139) = ( 7.5000000 4.5000000 3.0000000 ) + 140 O tau( 140) = ( 8.0000000 5.0000000 3.5000000 ) + 141 Mg tau( 141) = ( 3.5000000 0.0000000 3.5000000 ) + 142 O tau( 142) = ( 4.0000000 0.5000000 4.0000000 ) + 143 Mg tau( 143) = ( 4.0000000 0.5000000 3.5000000 ) + 144 O tau( 144) = ( 4.5000000 1.0000000 4.0000000 ) + 145 Mg tau( 145) = ( 4.5000000 1.0000000 3.5000000 ) + 146 O tau( 146) = ( 5.0000000 1.5000000 4.0000000 ) + 147 Mg tau( 147) = ( 5.0000000 1.5000000 3.5000000 ) + 148 O tau( 148) = ( 5.5000000 2.0000000 4.0000000 ) + 149 Mg tau( 149) = ( 5.5000000 2.0000000 3.5000000 ) + 150 O tau( 150) = ( 6.0000000 2.5000000 4.0000000 ) + 151 Mg tau( 151) = ( 6.0000000 2.5000000 3.5000000 ) + 152 O tau( 152) = ( 6.5000000 3.0000000 4.0000000 ) + 153 Mg tau( 153) = ( 6.5000000 3.0000000 3.5000000 ) + 154 O tau( 154) = ( 7.0000000 3.5000000 4.0000000 ) + 155 Mg tau( 155) = ( 7.0000000 3.5000000 3.5000000 ) + 156 O tau( 156) = ( 7.5000000 4.0000000 4.0000000 ) + 157 Mg tau( 157) = ( 7.5000000 4.0000000 3.5000000 ) + 158 O tau( 158) = ( 8.0000000 4.5000000 4.0000000 ) + 159 Mg tau( 159) = ( 8.0000000 4.5000000 3.5000000 ) + 160 O tau( 160) = ( 8.5000000 5.0000000 4.0000000 ) + 161 Mg tau( 161) = ( 4.0000000 0.0000000 4.0000000 ) + 162 O tau( 162) = ( 4.5000000 0.5000000 4.5000000 ) + 163 Mg tau( 163) = ( 4.5000000 0.5000000 4.0000000 ) + 164 O tau( 164) = ( 5.0000000 1.0000000 4.5000000 ) + 165 Mg tau( 165) = ( 5.0000000 1.0000000 4.0000000 ) + 166 O tau( 166) = ( 5.5000000 1.5000000 4.5000000 ) + 167 Mg tau( 167) = ( 5.5000000 1.5000000 4.0000000 ) + 168 O tau( 168) = ( 6.0000000 2.0000000 4.5000000 ) + 169 Mg tau( 169) = ( 6.0000000 2.0000000 4.0000000 ) + 170 O tau( 170) = ( 6.5000000 2.5000000 4.5000000 ) + 171 Mg tau( 171) = ( 6.5000000 2.5000000 4.0000000 ) + 172 O tau( 172) = ( 7.0000000 3.0000000 4.5000000 ) + 173 Mg tau( 173) = ( 7.0000000 3.0000000 4.0000000 ) + 174 O tau( 174) = ( 7.5000000 3.5000000 4.5000000 ) + 175 Mg tau( 175) = ( 7.5000000 3.5000000 4.0000000 ) + 176 O tau( 176) = ( 8.0000000 4.0000000 4.5000000 ) + 177 Mg tau( 177) = ( 8.0000000 4.0000000 4.0000000 ) + 178 O tau( 178) = ( 8.5000000 4.5000000 4.5000000 ) + 179 Mg tau( 179) = ( 8.5000000 4.5000000 4.0000000 ) + 180 O tau( 180) = ( 9.0000000 5.0000000 4.5000000 ) + 181 Mg tau( 181) = ( 4.5000000 0.0000000 4.5000000 ) + 182 O tau( 182) = ( 5.0000000 0.5000000 5.0000000 ) + 183 Mg tau( 183) = ( 5.0000000 0.5000000 4.5000000 ) + 184 O tau( 184) = ( 5.5000000 1.0000000 5.0000000 ) + 185 Mg tau( 185) = ( 5.5000000 1.0000000 4.5000000 ) + 186 O tau( 186) = ( 6.0000000 1.5000000 5.0000000 ) + 187 Mg tau( 187) = ( 6.0000000 1.5000000 4.5000000 ) + 188 O tau( 188) = ( 6.5000000 2.0000000 5.0000000 ) + 189 Mg tau( 189) = ( 6.5000000 2.0000000 4.5000000 ) + 190 O tau( 190) = ( 7.0000000 2.5000000 5.0000000 ) + 191 Mg tau( 191) = ( 7.0000000 2.5000000 4.5000000 ) + 192 O tau( 192) = ( 7.5000000 3.0000000 5.0000000 ) + 193 Mg tau( 193) = ( 7.5000000 3.0000000 4.5000000 ) + 194 O tau( 194) = ( 8.0000000 3.5000000 5.0000000 ) + 195 Mg tau( 195) = ( 8.0000000 3.5000000 4.5000000 ) + 196 O tau( 196) = ( 8.5000000 4.0000000 5.0000000 ) + 197 Mg tau( 197) = ( 8.5000000 4.0000000 4.5000000 ) + 198 O tau( 198) = ( 9.0000000 4.5000000 5.0000000 ) + 199 Mg tau( 199) = ( 9.0000000 4.5000000 4.5000000 ) + 200 O tau( 200) = ( 9.5000000 5.0000000 5.0000000 ) + 201 Mg tau( 201) = ( 0.0000000 0.5000000 0.5000000 ) + 202 O tau( 202) = ( 0.5000000 1.0000000 1.0000000 ) + 203 Mg tau( 203) = ( 0.5000000 1.0000000 0.5000000 ) + 204 O tau( 204) = ( 1.0000000 1.5000000 1.0000000 ) + 205 Mg tau( 205) = ( 1.0000000 1.5000000 0.5000000 ) + 206 O tau( 206) = ( 1.5000000 2.0000000 1.0000000 ) + 207 Mg tau( 207) = ( 1.5000000 2.0000000 0.5000000 ) + 208 O tau( 208) = ( 2.0000000 2.5000000 1.0000000 ) + 209 Mg tau( 209) = ( 2.0000000 2.5000000 0.5000000 ) + 210 O tau( 210) = ( 2.5000000 3.0000000 1.0000000 ) + 211 Mg tau( 211) = ( 2.5000000 3.0000000 0.5000000 ) + 212 O tau( 212) = ( 3.0000000 3.5000000 1.0000000 ) + 213 Mg tau( 213) = ( 3.0000000 3.5000000 0.5000000 ) + 214 O tau( 214) = ( 3.5000000 4.0000000 1.0000000 ) + 215 Mg tau( 215) = ( 3.5000000 4.0000000 0.5000000 ) + 216 O tau( 216) = ( 4.0000000 4.5000000 1.0000000 ) + 217 Mg tau( 217) = ( 4.0000000 4.5000000 0.5000000 ) + 218 O tau( 218) = ( 4.5000000 5.0000000 1.0000000 ) + 219 Mg tau( 219) = ( 4.5000000 5.0000000 0.5000000 ) + 220 O tau( 220) = ( 5.0000000 5.5000000 1.0000000 ) + 221 Mg tau( 221) = ( 0.5000000 0.5000000 1.0000000 ) + 222 O tau( 222) = ( 1.0000000 1.0000000 1.5000000 ) + 223 Mg tau( 223) = ( 1.0000000 1.0000000 1.0000000 ) + 224 O tau( 224) = ( 1.5000000 1.5000000 1.5000000 ) + 225 Mg tau( 225) = ( 1.5000000 1.5000000 1.0000000 ) + 226 O tau( 226) = ( 2.0000000 2.0000000 1.5000000 ) + 227 Mg tau( 227) = ( 2.0000000 2.0000000 1.0000000 ) + 228 O tau( 228) = ( 2.5000000 2.5000000 1.5000000 ) + 229 Mg tau( 229) = ( 2.5000000 2.5000000 1.0000000 ) + 230 O tau( 230) = ( 3.0000000 3.0000000 1.5000000 ) + 231 Mg tau( 231) = ( 3.0000000 3.0000000 1.0000000 ) + 232 O tau( 232) = ( 3.5000000 3.5000000 1.5000000 ) + 233 Mg tau( 233) = ( 3.5000000 3.5000000 1.0000000 ) + 234 O tau( 234) = ( 4.0000000 4.0000000 1.5000000 ) + 235 Mg tau( 235) = ( 4.0000000 4.0000000 1.0000000 ) + 236 O tau( 236) = ( 4.5000000 4.5000000 1.5000000 ) + 237 Mg tau( 237) = ( 4.5000000 4.5000000 1.0000000 ) + 238 O tau( 238) = ( 5.0000000 5.0000000 1.5000000 ) + 239 Mg tau( 239) = ( 5.0000000 5.0000000 1.0000000 ) + 240 O tau( 240) = ( 5.5000000 5.5000000 1.5000000 ) + 241 Mg tau( 241) = ( 1.0000000 0.5000000 1.5000000 ) + 242 O tau( 242) = ( 1.5000000 1.0000000 2.0000000 ) + 243 Mg tau( 243) = ( 1.5000000 1.0000000 1.5000000 ) + 244 O tau( 244) = ( 2.0000000 1.5000000 2.0000000 ) + 245 Mg tau( 245) = ( 2.0000000 1.5000000 1.5000000 ) + 246 O tau( 246) = ( 2.5000000 2.0000000 2.0000000 ) + 247 Mg tau( 247) = ( 2.5000000 2.0000000 1.5000000 ) + 248 O tau( 248) = ( 3.0000000 2.5000000 2.0000000 ) + 249 Mg tau( 249) = ( 3.0000000 2.5000000 1.5000000 ) + 250 O tau( 250) = ( 3.5000000 3.0000000 2.0000000 ) + 251 Mg tau( 251) = ( 3.5000000 3.0000000 1.5000000 ) + 252 O tau( 252) = ( 4.0000000 3.5000000 2.0000000 ) + 253 Mg tau( 253) = ( 4.0000000 3.5000000 1.5000000 ) + 254 O tau( 254) = ( 4.5000000 4.0000000 2.0000000 ) + 255 Mg tau( 255) = ( 4.5000000 4.0000000 1.5000000 ) + 256 O tau( 256) = ( 5.0000000 4.5000000 2.0000000 ) + 257 Mg tau( 257) = ( 5.0000000 4.5000000 1.5000000 ) + 258 O tau( 258) = ( 5.5000000 5.0000000 2.0000000 ) + 259 Mg tau( 259) = ( 5.5000000 5.0000000 1.5000000 ) + 260 O tau( 260) = ( 6.0000000 5.5000000 2.0000000 ) + 261 Mg tau( 261) = ( 1.5000000 0.5000000 2.0000000 ) + 262 O tau( 262) = ( 2.0000000 1.0000000 2.5000000 ) + 263 Mg tau( 263) = ( 2.0000000 1.0000000 2.0000000 ) + 264 O tau( 264) = ( 2.5000000 1.5000000 2.5000000 ) + 265 Mg tau( 265) = ( 2.5000000 1.5000000 2.0000000 ) + 266 O tau( 266) = ( 3.0000000 2.0000000 2.5000000 ) + 267 Mg tau( 267) = ( 3.0000000 2.0000000 2.0000000 ) + 268 O tau( 268) = ( 3.5000000 2.5000000 2.5000000 ) + 269 Mg tau( 269) = ( 3.5000000 2.5000000 2.0000000 ) + 270 O tau( 270) = ( 4.0000000 3.0000000 2.5000000 ) + 271 Mg tau( 271) = ( 4.0000000 3.0000000 2.0000000 ) + 272 O tau( 272) = ( 4.5000000 3.5000000 2.5000000 ) + 273 Mg tau( 273) = ( 4.5000000 3.5000000 2.0000000 ) + 274 O tau( 274) = ( 5.0000000 4.0000000 2.5000000 ) + 275 Mg tau( 275) = ( 5.0000000 4.0000000 2.0000000 ) + 276 O tau( 276) = ( 5.5000000 4.5000000 2.5000000 ) + 277 Mg tau( 277) = ( 5.5000000 4.5000000 2.0000000 ) + 278 O tau( 278) = ( 6.0000000 5.0000000 2.5000000 ) + 279 Mg tau( 279) = ( 6.0000000 5.0000000 2.0000000 ) + 280 O tau( 280) = ( 6.5000000 5.5000000 2.5000000 ) + 281 Mg tau( 281) = ( 2.0000000 0.5000000 2.5000000 ) + 282 O tau( 282) = ( 2.5000000 1.0000000 3.0000000 ) + 283 Mg tau( 283) = ( 2.5000000 1.0000000 2.5000000 ) + 284 O tau( 284) = ( 3.0000000 1.5000000 3.0000000 ) + 285 Mg tau( 285) = ( 3.0000000 1.5000000 2.5000000 ) + 286 O tau( 286) = ( 3.5000000 2.0000000 3.0000000 ) + 287 Mg tau( 287) = ( 3.5000000 2.0000000 2.5000000 ) + 288 O tau( 288) = ( 4.0000000 2.5000000 3.0000000 ) + 289 Mg tau( 289) = ( 4.0000000 2.5000000 2.5000000 ) + 290 O tau( 290) = ( 4.5000000 3.0000000 3.0000000 ) + 291 Mg tau( 291) = ( 4.5000000 3.0000000 2.5000000 ) + 292 O tau( 292) = ( 5.0000000 3.5000000 3.0000000 ) + 293 Mg tau( 293) = ( 5.0000000 3.5000000 2.5000000 ) + 294 O tau( 294) = ( 5.5000000 4.0000000 3.0000000 ) + 295 Mg tau( 295) = ( 5.5000000 4.0000000 2.5000000 ) + 296 O tau( 296) = ( 6.0000000 4.5000000 3.0000000 ) + 297 Mg tau( 297) = ( 6.0000000 4.5000000 2.5000000 ) + 298 O tau( 298) = ( 6.5000000 5.0000000 3.0000000 ) + 299 Mg tau( 299) = ( 6.5000000 5.0000000 2.5000000 ) + 300 O tau( 300) = ( 7.0000000 5.5000000 3.0000000 ) + 301 Mg tau( 301) = ( 2.5000000 0.5000000 3.0000000 ) + 302 O tau( 302) = ( 3.0000000 1.0000000 3.5000000 ) + 303 Mg tau( 303) = ( 3.0000000 1.0000000 3.0000000 ) + 304 O tau( 304) = ( 3.5000000 1.5000000 3.5000000 ) + 305 Mg tau( 305) = ( 3.5000000 1.5000000 3.0000000 ) + 306 O tau( 306) = ( 4.0000000 2.0000000 3.5000000 ) + 307 Mg tau( 307) = ( 4.0000000 2.0000000 3.0000000 ) + 308 O tau( 308) = ( 4.5000000 2.5000000 3.5000000 ) + 309 Mg tau( 309) = ( 4.5000000 2.5000000 3.0000000 ) + 310 O tau( 310) = ( 5.0000000 3.0000000 3.5000000 ) + 311 Mg tau( 311) = ( 5.0000000 3.0000000 3.0000000 ) + 312 O tau( 312) = ( 5.5000000 3.5000000 3.5000000 ) + 313 Mg tau( 313) = ( 5.5000000 3.5000000 3.0000000 ) + 314 O tau( 314) = ( 6.0000000 4.0000000 3.5000000 ) + 315 Mg tau( 315) = ( 6.0000000 4.0000000 3.0000000 ) + 316 O tau( 316) = ( 6.5000000 4.5000000 3.5000000 ) + 317 Mg tau( 317) = ( 6.5000000 4.5000000 3.0000000 ) + 318 O tau( 318) = ( 7.0000000 5.0000000 3.5000000 ) + 319 Mg tau( 319) = ( 7.0000000 5.0000000 3.0000000 ) + 320 O tau( 320) = ( 7.5000000 5.5000000 3.5000000 ) + 321 Mg tau( 321) = ( 3.0000000 0.5000000 3.5000000 ) + 322 O tau( 322) = ( 3.5000000 1.0000000 4.0000000 ) + 323 Mg tau( 323) = ( 3.5000000 1.0000000 3.5000000 ) + 324 O tau( 324) = ( 4.0000000 1.5000000 4.0000000 ) + 325 Mg tau( 325) = ( 4.0000000 1.5000000 3.5000000 ) + 326 O tau( 326) = ( 4.5000000 2.0000000 4.0000000 ) + 327 Mg tau( 327) = ( 4.5000000 2.0000000 3.5000000 ) + 328 O tau( 328) = ( 5.0000000 2.5000000 4.0000000 ) + 329 Mg tau( 329) = ( 5.0000000 2.5000000 3.5000000 ) + 330 O tau( 330) = ( 5.5000000 3.0000000 4.0000000 ) + 331 Mg tau( 331) = ( 5.5000000 3.0000000 3.5000000 ) + 332 O tau( 332) = ( 6.0000000 3.5000000 4.0000000 ) + 333 Mg tau( 333) = ( 6.0000000 3.5000000 3.5000000 ) + 334 O tau( 334) = ( 6.5000000 4.0000000 4.0000000 ) + 335 Mg tau( 335) = ( 6.5000000 4.0000000 3.5000000 ) + 336 O tau( 336) = ( 7.0000000 4.5000000 4.0000000 ) + 337 Mg tau( 337) = ( 7.0000000 4.5000000 3.5000000 ) + 338 O tau( 338) = ( 7.5000000 5.0000000 4.0000000 ) + 339 Mg tau( 339) = ( 7.5000000 5.0000000 3.5000000 ) + 340 O tau( 340) = ( 8.0000000 5.5000000 4.0000000 ) + 341 Mg tau( 341) = ( 3.5000000 0.5000000 4.0000000 ) + 342 O tau( 342) = ( 4.0000000 1.0000000 4.5000000 ) + 343 Mg tau( 343) = ( 4.0000000 1.0000000 4.0000000 ) + 344 O tau( 344) = ( 4.5000000 1.5000000 4.5000000 ) + 345 Mg tau( 345) = ( 4.5000000 1.5000000 4.0000000 ) + 346 O tau( 346) = ( 5.0000000 2.0000000 4.5000000 ) + 347 Mg tau( 347) = ( 5.0000000 2.0000000 4.0000000 ) + 348 O tau( 348) = ( 5.5000000 2.5000000 4.5000000 ) + 349 Mg tau( 349) = ( 5.5000000 2.5000000 4.0000000 ) + 350 O tau( 350) = ( 6.0000000 3.0000000 4.5000000 ) + 351 Mg tau( 351) = ( 6.0000000 3.0000000 4.0000000 ) + 352 O tau( 352) = ( 6.5000000 3.5000000 4.5000000 ) + 353 Mg tau( 353) = ( 6.5000000 3.5000000 4.0000000 ) + 354 O tau( 354) = ( 7.0000000 4.0000000 4.5000000 ) + 355 Mg tau( 355) = ( 7.0000000 4.0000000 4.0000000 ) + 356 O tau( 356) = ( 7.5000000 4.5000000 4.5000000 ) + 357 Mg tau( 357) = ( 7.5000000 4.5000000 4.0000000 ) + 358 O tau( 358) = ( 8.0000000 5.0000000 4.5000000 ) + 359 Mg tau( 359) = ( 8.0000000 5.0000000 4.0000000 ) + 360 O tau( 360) = ( 8.5000000 5.5000000 4.5000000 ) + 361 Mg tau( 361) = ( 4.0000000 0.5000000 4.5000000 ) + 362 O tau( 362) = ( 4.5000000 1.0000000 5.0000000 ) + 363 Mg tau( 363) = ( 4.5000000 1.0000000 4.5000000 ) + 364 O tau( 364) = ( 5.0000000 1.5000000 5.0000000 ) + 365 Mg tau( 365) = ( 5.0000000 1.5000000 4.5000000 ) + 366 O tau( 366) = ( 5.5000000 2.0000000 5.0000000 ) + 367 Mg tau( 367) = ( 5.5000000 2.0000000 4.5000000 ) + 368 O tau( 368) = ( 6.0000000 2.5000000 5.0000000 ) + 369 Mg tau( 369) = ( 6.0000000 2.5000000 4.5000000 ) + 370 O tau( 370) = ( 6.5000000 3.0000000 5.0000000 ) + 371 Mg tau( 371) = ( 6.5000000 3.0000000 4.5000000 ) + 372 O tau( 372) = ( 7.0000000 3.5000000 5.0000000 ) + 373 Mg tau( 373) = ( 7.0000000 3.5000000 4.5000000 ) + 374 O tau( 374) = ( 7.5000000 4.0000000 5.0000000 ) + 375 Mg tau( 375) = ( 7.5000000 4.0000000 4.5000000 ) + 376 O tau( 376) = ( 8.0000000 4.5000000 5.0000000 ) + 377 Mg tau( 377) = ( 8.0000000 4.5000000 4.5000000 ) + 378 O tau( 378) = ( 8.5000000 5.0000000 5.0000000 ) + 379 Mg tau( 379) = ( 8.5000000 5.0000000 4.5000000 ) + 380 O tau( 380) = ( 9.0000000 5.5000000 5.0000000 ) + 381 Mg tau( 381) = ( 4.5000000 0.5000000 5.0000000 ) + 382 O tau( 382) = ( 5.0000000 1.0000000 5.5000000 ) + 383 Mg tau( 383) = ( 5.0000000 1.0000000 5.0000000 ) + 384 O tau( 384) = ( 5.5000000 1.5000000 5.5000000 ) + 385 Mg tau( 385) = ( 5.5000000 1.5000000 5.0000000 ) + 386 O tau( 386) = ( 6.0000000 2.0000000 5.5000000 ) + 387 Mg tau( 387) = ( 6.0000000 2.0000000 5.0000000 ) + 388 O tau( 388) = ( 6.5000000 2.5000000 5.5000000 ) + 389 Mg tau( 389) = ( 6.5000000 2.5000000 5.0000000 ) + 390 O tau( 390) = ( 7.0000000 3.0000000 5.5000000 ) + 391 Mg tau( 391) = ( 7.0000000 3.0000000 5.0000000 ) + 392 O tau( 392) = ( 7.5000000 3.5000000 5.5000000 ) + 393 Mg tau( 393) = ( 7.5000000 3.5000000 5.0000000 ) + 394 O tau( 394) = ( 8.0000000 4.0000000 5.5000000 ) + 395 Mg tau( 395) = ( 8.0000000 4.0000000 5.0000000 ) + 396 O tau( 396) = ( 8.5000000 4.5000000 5.5000000 ) + 397 Mg tau( 397) = ( 8.5000000 4.5000000 5.0000000 ) + 398 O tau( 398) = ( 9.0000000 5.0000000 5.5000000 ) + 399 Mg tau( 399) = ( 9.0000000 5.0000000 5.0000000 ) + 400 O tau( 400) = ( 9.5000000 5.5000000 5.5000000 ) + 401 Mg tau( 401) = ( 0.0000000 1.0000000 1.0000000 ) + 402 O tau( 402) = ( 0.5000000 1.5000000 1.5000000 ) + 403 Mg tau( 403) = ( 0.5000000 1.5000000 1.0000000 ) + 404 O tau( 404) = ( 1.0000000 2.0000000 1.5000000 ) + 405 Mg tau( 405) = ( 1.0000000 2.0000000 1.0000000 ) + 406 O tau( 406) = ( 1.5000000 2.5000000 1.5000000 ) + 407 Mg tau( 407) = ( 1.5000000 2.5000000 1.0000000 ) + 408 O tau( 408) = ( 2.0000000 3.0000000 1.5000000 ) + 409 Mg tau( 409) = ( 2.0000000 3.0000000 1.0000000 ) + 410 O tau( 410) = ( 2.5000000 3.5000000 1.5000000 ) + 411 Mg tau( 411) = ( 2.5000000 3.5000000 1.0000000 ) + 412 O tau( 412) = ( 3.0000000 4.0000000 1.5000000 ) + 413 Mg tau( 413) = ( 3.0000000 4.0000000 1.0000000 ) + 414 O tau( 414) = ( 3.5000000 4.5000000 1.5000000 ) + 415 Mg tau( 415) = ( 3.5000000 4.5000000 1.0000000 ) + 416 O tau( 416) = ( 4.0000000 5.0000000 1.5000000 ) + 417 Mg tau( 417) = ( 4.0000000 5.0000000 1.0000000 ) + 418 O tau( 418) = ( 4.5000000 5.5000000 1.5000000 ) + 419 Mg tau( 419) = ( 4.5000000 5.5000000 1.0000000 ) + 420 O tau( 420) = ( 5.0000000 6.0000000 1.5000000 ) + 421 Mg tau( 421) = ( 0.5000000 1.0000000 1.5000000 ) + 422 O tau( 422) = ( 1.0000000 1.5000000 2.0000000 ) + 423 Mg tau( 423) = ( 1.0000000 1.5000000 1.5000000 ) + 424 O tau( 424) = ( 1.5000000 2.0000000 2.0000000 ) + 425 Mg tau( 425) = ( 1.5000000 2.0000000 1.5000000 ) + 426 O tau( 426) = ( 2.0000000 2.5000000 2.0000000 ) + 427 Mg tau( 427) = ( 2.0000000 2.5000000 1.5000000 ) + 428 O tau( 428) = ( 2.5000000 3.0000000 2.0000000 ) + 429 Mg tau( 429) = ( 2.5000000 3.0000000 1.5000000 ) + 430 O tau( 430) = ( 3.0000000 3.5000000 2.0000000 ) + 431 Mg tau( 431) = ( 3.0000000 3.5000000 1.5000000 ) + 432 O tau( 432) = ( 3.5000000 4.0000000 2.0000000 ) + 433 Mg tau( 433) = ( 3.5000000 4.0000000 1.5000000 ) + 434 O tau( 434) = ( 4.0000000 4.5000000 2.0000000 ) + 435 Mg tau( 435) = ( 4.0000000 4.5000000 1.5000000 ) + 436 O tau( 436) = ( 4.5000000 5.0000000 2.0000000 ) + 437 Mg tau( 437) = ( 4.5000000 5.0000000 1.5000000 ) + 438 O tau( 438) = ( 5.0000000 5.5000000 2.0000000 ) + 439 Mg tau( 439) = ( 5.0000000 5.5000000 1.5000000 ) + 440 O tau( 440) = ( 5.5000000 6.0000000 2.0000000 ) + 441 Mg tau( 441) = ( 1.0000000 1.0000000 2.0000000 ) + 442 O tau( 442) = ( 1.5000000 1.5000000 2.5000000 ) + 443 Mg tau( 443) = ( 1.5000000 1.5000000 2.0000000 ) + 444 O tau( 444) = ( 2.0000000 2.0000000 2.5000000 ) + 445 Mg tau( 445) = ( 2.0000000 2.0000000 2.0000000 ) + 446 O tau( 446) = ( 2.5000000 2.5000000 2.5000000 ) + 447 Mg tau( 447) = ( 2.5000000 2.5000000 2.0000000 ) + 448 O tau( 448) = ( 3.0000000 3.0000000 2.5000000 ) + 449 Mg tau( 449) = ( 3.0000000 3.0000000 2.0000000 ) + 450 O tau( 450) = ( 3.5000000 3.5000000 2.5000000 ) + 451 Mg tau( 451) = ( 3.5000000 3.5000000 2.0000000 ) + 452 O tau( 452) = ( 4.0000000 4.0000000 2.5000000 ) + 453 Mg tau( 453) = ( 4.0000000 4.0000000 2.0000000 ) + 454 O tau( 454) = ( 4.5000000 4.5000000 2.5000000 ) + 455 Mg tau( 455) = ( 4.5000000 4.5000000 2.0000000 ) + 456 O tau( 456) = ( 5.0000000 5.0000000 2.5000000 ) + 457 Mg tau( 457) = ( 5.0000000 5.0000000 2.0000000 ) + 458 O tau( 458) = ( 5.5000000 5.5000000 2.5000000 ) + 459 Mg tau( 459) = ( 5.5000000 5.5000000 2.0000000 ) + 460 O tau( 460) = ( 6.0000000 6.0000000 2.5000000 ) + 461 Mg tau( 461) = ( 1.5000000 1.0000000 2.5000000 ) + 462 O tau( 462) = ( 2.0000000 1.5000000 3.0000000 ) + 463 Mg tau( 463) = ( 2.0000000 1.5000000 2.5000000 ) + 464 O tau( 464) = ( 2.5000000 2.0000000 3.0000000 ) + 465 Mg tau( 465) = ( 2.5000000 2.0000000 2.5000000 ) + 466 O tau( 466) = ( 3.0000000 2.5000000 3.0000000 ) + 467 Mg tau( 467) = ( 3.0000000 2.5000000 2.5000000 ) + 468 O tau( 468) = ( 3.5000000 3.0000000 3.0000000 ) + 469 Mg tau( 469) = ( 3.5000000 3.0000000 2.5000000 ) + 470 O tau( 470) = ( 4.0000000 3.5000000 3.0000000 ) + 471 Mg tau( 471) = ( 4.0000000 3.5000000 2.5000000 ) + 472 O tau( 472) = ( 4.5000000 4.0000000 3.0000000 ) + 473 Mg tau( 473) = ( 4.5000000 4.0000000 2.5000000 ) + 474 O tau( 474) = ( 5.0000000 4.5000000 3.0000000 ) + 475 Mg tau( 475) = ( 5.0000000 4.5000000 2.5000000 ) + 476 O tau( 476) = ( 5.5000000 5.0000000 3.0000000 ) + 477 Mg tau( 477) = ( 5.5000000 5.0000000 2.5000000 ) + 478 O tau( 478) = ( 6.0000000 5.5000000 3.0000000 ) + 479 Mg tau( 479) = ( 6.0000000 5.5000000 2.5000000 ) + 480 O tau( 480) = ( 6.5000000 6.0000000 3.0000000 ) + 481 Mg tau( 481) = ( 2.0000000 1.0000000 3.0000000 ) + 482 O tau( 482) = ( 2.5000000 1.5000000 3.5000000 ) + 483 Mg tau( 483) = ( 2.5000000 1.5000000 3.0000000 ) + 484 O tau( 484) = ( 3.0000000 2.0000000 3.5000000 ) + 485 Mg tau( 485) = ( 3.0000000 2.0000000 3.0000000 ) + 486 O tau( 486) = ( 3.5000000 2.5000000 3.5000000 ) + 487 Mg tau( 487) = ( 3.5000000 2.5000000 3.0000000 ) + 488 O tau( 488) = ( 4.0000000 3.0000000 3.5000000 ) + 489 Mg tau( 489) = ( 4.0000000 3.0000000 3.0000000 ) + 490 O tau( 490) = ( 4.5000000 3.5000000 3.5000000 ) + 491 Mg tau( 491) = ( 4.5000000 3.5000000 3.0000000 ) + 492 O tau( 492) = ( 5.0000000 4.0000000 3.5000000 ) + 493 Mg tau( 493) = ( 5.0000000 4.0000000 3.0000000 ) + 494 O tau( 494) = ( 5.5000000 4.5000000 3.5000000 ) + 495 Mg tau( 495) = ( 5.5000000 4.5000000 3.0000000 ) + 496 O tau( 496) = ( 6.0000000 5.0000000 3.5000000 ) + 497 Mg tau( 497) = ( 6.0000000 5.0000000 3.0000000 ) + 498 O tau( 498) = ( 6.5000000 5.5000000 3.5000000 ) + 499 Mg tau( 499) = ( 6.5000000 5.5000000 3.0000000 ) + 500 O tau( 500) = ( 7.0000000 6.0000000 3.5000000 ) + 501 Mg tau( 501) = ( 2.5000000 1.0000000 3.5000000 ) + 502 O tau( 502) = ( 3.0000000 1.5000000 4.0000000 ) + 503 Mg tau( 503) = ( 3.0000000 1.5000000 3.5000000 ) + 504 O tau( 504) = ( 3.5000000 2.0000000 4.0000000 ) + 505 Mg tau( 505) = ( 3.5000000 2.0000000 3.5000000 ) + 506 O tau( 506) = ( 4.0000000 2.5000000 4.0000000 ) + 507 Mg tau( 507) = ( 4.0000000 2.5000000 3.5000000 ) + 508 O tau( 508) = ( 4.5000000 3.0000000 4.0000000 ) + 509 Mg tau( 509) = ( 4.5000000 3.0000000 3.5000000 ) + 510 O tau( 510) = ( 5.0000000 3.5000000 4.0000000 ) + 511 Mg tau( 511) = ( 5.0000000 3.5000000 3.5000000 ) + 512 O tau( 512) = ( 5.5000000 4.0000000 4.0000000 ) + 513 Mg tau( 513) = ( 5.5000000 4.0000000 3.5000000 ) + 514 O tau( 514) = ( 6.0000000 4.5000000 4.0000000 ) + 515 Mg tau( 515) = ( 6.0000000 4.5000000 3.5000000 ) + 516 O tau( 516) = ( 6.5000000 5.0000000 4.0000000 ) + 517 Mg tau( 517) = ( 6.5000000 5.0000000 3.5000000 ) + 518 O tau( 518) = ( 7.0000000 5.5000000 4.0000000 ) + 519 Mg tau( 519) = ( 7.0000000 5.5000000 3.5000000 ) + 520 O tau( 520) = ( 7.5000000 6.0000000 4.0000000 ) + 521 Mg tau( 521) = ( 3.0000000 1.0000000 4.0000000 ) + 522 O tau( 522) = ( 3.5000000 1.5000000 4.5000000 ) + 523 Mg tau( 523) = ( 3.5000000 1.5000000 4.0000000 ) + 524 O tau( 524) = ( 4.0000000 2.0000000 4.5000000 ) + 525 Mg tau( 525) = ( 4.0000000 2.0000000 4.0000000 ) + 526 O tau( 526) = ( 4.5000000 2.5000000 4.5000000 ) + 527 Mg tau( 527) = ( 4.5000000 2.5000000 4.0000000 ) + 528 O tau( 528) = ( 5.0000000 3.0000000 4.5000000 ) + 529 Mg tau( 529) = ( 5.0000000 3.0000000 4.0000000 ) + 530 O tau( 530) = ( 5.5000000 3.5000000 4.5000000 ) + 531 Mg tau( 531) = ( 5.5000000 3.5000000 4.0000000 ) + 532 O tau( 532) = ( 6.0000000 4.0000000 4.5000000 ) + 533 Mg tau( 533) = ( 6.0000000 4.0000000 4.0000000 ) + 534 O tau( 534) = ( 6.5000000 4.5000000 4.5000000 ) + 535 Mg tau( 535) = ( 6.5000000 4.5000000 4.0000000 ) + 536 O tau( 536) = ( 7.0000000 5.0000000 4.5000000 ) + 537 Mg tau( 537) = ( 7.0000000 5.0000000 4.0000000 ) + 538 O tau( 538) = ( 7.5000000 5.5000000 4.5000000 ) + 539 Mg tau( 539) = ( 7.5000000 5.5000000 4.0000000 ) + 540 O tau( 540) = ( 8.0000000 6.0000000 4.5000000 ) + 541 Mg tau( 541) = ( 3.5000000 1.0000000 4.5000000 ) + 542 O tau( 542) = ( 4.0000000 1.5000000 5.0000000 ) + 543 Mg tau( 543) = ( 4.0000000 1.5000000 4.5000000 ) + 544 O tau( 544) = ( 4.5000000 2.0000000 5.0000000 ) + 545 Mg tau( 545) = ( 4.5000000 2.0000000 4.5000000 ) + 546 O tau( 546) = ( 5.0000000 2.5000000 5.0000000 ) + 547 Mg tau( 547) = ( 5.0000000 2.5000000 4.5000000 ) + 548 O tau( 548) = ( 5.5000000 3.0000000 5.0000000 ) + 549 Mg tau( 549) = ( 5.5000000 3.0000000 4.5000000 ) + 550 O tau( 550) = ( 6.0000000 3.5000000 5.0000000 ) + 551 Mg tau( 551) = ( 6.0000000 3.5000000 4.5000000 ) + 552 O tau( 552) = ( 6.5000000 4.0000000 5.0000000 ) + 553 Mg tau( 553) = ( 6.5000000 4.0000000 4.5000000 ) + 554 O tau( 554) = ( 7.0000000 4.5000000 5.0000000 ) + 555 Mg tau( 555) = ( 7.0000000 4.5000000 4.5000000 ) + 556 O tau( 556) = ( 7.5000000 5.0000000 5.0000000 ) + 557 Mg tau( 557) = ( 7.5000000 5.0000000 4.5000000 ) + 558 O tau( 558) = ( 8.0000000 5.5000000 5.0000000 ) + 559 Mg tau( 559) = ( 8.0000000 5.5000000 4.5000000 ) + 560 O tau( 560) = ( 8.5000000 6.0000000 5.0000000 ) + 561 Mg tau( 561) = ( 4.0000000 1.0000000 5.0000000 ) + 562 O tau( 562) = ( 4.5000000 1.5000000 5.5000000 ) + 563 Mg tau( 563) = ( 4.5000000 1.5000000 5.0000000 ) + 564 O tau( 564) = ( 5.0000000 2.0000000 5.5000000 ) + 565 Mg tau( 565) = ( 5.0000000 2.0000000 5.0000000 ) + 566 O tau( 566) = ( 5.5000000 2.5000000 5.5000000 ) + 567 Mg tau( 567) = ( 5.5000000 2.5000000 5.0000000 ) + 568 O tau( 568) = ( 6.0000000 3.0000000 5.5000000 ) + 569 Mg tau( 569) = ( 6.0000000 3.0000000 5.0000000 ) + 570 O tau( 570) = ( 6.5000000 3.5000000 5.5000000 ) + 571 Mg tau( 571) = ( 6.5000000 3.5000000 5.0000000 ) + 572 O tau( 572) = ( 7.0000000 4.0000000 5.5000000 ) + 573 Mg tau( 573) = ( 7.0000000 4.0000000 5.0000000 ) + 574 O tau( 574) = ( 7.5000000 4.5000000 5.5000000 ) + 575 Mg tau( 575) = ( 7.5000000 4.5000000 5.0000000 ) + 576 O tau( 576) = ( 8.0000000 5.0000000 5.5000000 ) + 577 Mg tau( 577) = ( 8.0000000 5.0000000 5.0000000 ) + 578 O tau( 578) = ( 8.5000000 5.5000000 5.5000000 ) + 579 Mg tau( 579) = ( 8.5000000 5.5000000 5.0000000 ) + 580 O tau( 580) = ( 9.0000000 6.0000000 5.5000000 ) + 581 Mg tau( 581) = ( 4.5000000 1.0000000 5.5000000 ) + 582 O tau( 582) = ( 5.0000000 1.5000000 6.0000000 ) + 583 Mg tau( 583) = ( 5.0000000 1.5000000 5.5000000 ) + 584 O tau( 584) = ( 5.5000000 2.0000000 6.0000000 ) + 585 Mg tau( 585) = ( 5.5000000 2.0000000 5.5000000 ) + 586 O tau( 586) = ( 6.0000000 2.5000000 6.0000000 ) + 587 Mg tau( 587) = ( 6.0000000 2.5000000 5.5000000 ) + 588 O tau( 588) = ( 6.5000000 3.0000000 6.0000000 ) + 589 Mg tau( 589) = ( 6.5000000 3.0000000 5.5000000 ) + 590 O tau( 590) = ( 7.0000000 3.5000000 6.0000000 ) + 591 Mg tau( 591) = ( 7.0000000 3.5000000 5.5000000 ) + 592 O tau( 592) = ( 7.5000000 4.0000000 6.0000000 ) + 593 Mg tau( 593) = ( 7.5000000 4.0000000 5.5000000 ) + 594 O tau( 594) = ( 8.0000000 4.5000000 6.0000000 ) + 595 Mg tau( 595) = ( 8.0000000 4.5000000 5.5000000 ) + 596 O tau( 596) = ( 8.5000000 5.0000000 6.0000000 ) + 597 Mg tau( 597) = ( 8.5000000 5.0000000 5.5000000 ) + 598 O tau( 598) = ( 9.0000000 5.5000000 6.0000000 ) + 599 Mg tau( 599) = ( 9.0000000 5.5000000 5.5000000 ) + 600 O tau( 600) = ( 9.5000000 6.0000000 6.0000000 ) + 601 Mg tau( 601) = ( 0.0000000 1.5000000 1.5000000 ) + 602 O tau( 602) = ( 0.5000000 2.0000000 2.0000000 ) + 603 Mg tau( 603) = ( 0.5000000 2.0000000 1.5000000 ) + 604 O tau( 604) = ( 1.0000000 2.5000000 2.0000000 ) + 605 Mg tau( 605) = ( 1.0000000 2.5000000 1.5000000 ) + 606 O tau( 606) = ( 1.5000000 3.0000000 2.0000000 ) + 607 Mg tau( 607) = ( 1.5000000 3.0000000 1.5000000 ) + 608 O tau( 608) = ( 2.0000000 3.5000000 2.0000000 ) + 609 Mg tau( 609) = ( 2.0000000 3.5000000 1.5000000 ) + 610 O tau( 610) = ( 2.5000000 4.0000000 2.0000000 ) + 611 Mg tau( 611) = ( 2.5000000 4.0000000 1.5000000 ) + 612 O tau( 612) = ( 3.0000000 4.5000000 2.0000000 ) + 613 Mg tau( 613) = ( 3.0000000 4.5000000 1.5000000 ) + 614 O tau( 614) = ( 3.5000000 5.0000000 2.0000000 ) + 615 Mg tau( 615) = ( 3.5000000 5.0000000 1.5000000 ) + 616 O tau( 616) = ( 4.0000000 5.5000000 2.0000000 ) + 617 Mg tau( 617) = ( 4.0000000 5.5000000 1.5000000 ) + 618 O tau( 618) = ( 4.5000000 6.0000000 2.0000000 ) + 619 Mg tau( 619) = ( 4.5000000 6.0000000 1.5000000 ) + 620 O tau( 620) = ( 5.0000000 6.5000000 2.0000000 ) + 621 Mg tau( 621) = ( 0.5000000 1.5000000 2.0000000 ) + 622 O tau( 622) = ( 1.0000000 2.0000000 2.5000000 ) + 623 Mg tau( 623) = ( 1.0000000 2.0000000 2.0000000 ) + 624 O tau( 624) = ( 1.5000000 2.5000000 2.5000000 ) + 625 Mg tau( 625) = ( 1.5000000 2.5000000 2.0000000 ) + 626 O tau( 626) = ( 2.0000000 3.0000000 2.5000000 ) + 627 Mg tau( 627) = ( 2.0000000 3.0000000 2.0000000 ) + 628 O tau( 628) = ( 2.5000000 3.5000000 2.5000000 ) + 629 Mg tau( 629) = ( 2.5000000 3.5000000 2.0000000 ) + 630 O tau( 630) = ( 3.0000000 4.0000000 2.5000000 ) + 631 Mg tau( 631) = ( 3.0000000 4.0000000 2.0000000 ) + 632 O tau( 632) = ( 3.5000000 4.5000000 2.5000000 ) + 633 Mg tau( 633) = ( 3.5000000 4.5000000 2.0000000 ) + 634 O tau( 634) = ( 4.0000000 5.0000000 2.5000000 ) + 635 Mg tau( 635) = ( 4.0000000 5.0000000 2.0000000 ) + 636 O tau( 636) = ( 4.5000000 5.5000000 2.5000000 ) + 637 Mg tau( 637) = ( 4.5000000 5.5000000 2.0000000 ) + 638 O tau( 638) = ( 5.0000000 6.0000000 2.5000000 ) + 639 Mg tau( 639) = ( 5.0000000 6.0000000 2.0000000 ) + 640 O tau( 640) = ( 5.5000000 6.5000000 2.5000000 ) + 641 Mg tau( 641) = ( 1.0000000 1.5000000 2.5000000 ) + 642 O tau( 642) = ( 1.5000000 2.0000000 3.0000000 ) + 643 Mg tau( 643) = ( 1.5000000 2.0000000 2.5000000 ) + 644 O tau( 644) = ( 2.0000000 2.5000000 3.0000000 ) + 645 Mg tau( 645) = ( 2.0000000 2.5000000 2.5000000 ) + 646 O tau( 646) = ( 2.5000000 3.0000000 3.0000000 ) + 647 Mg tau( 647) = ( 2.5000000 3.0000000 2.5000000 ) + 648 O tau( 648) = ( 3.0000000 3.5000000 3.0000000 ) + 649 Mg tau( 649) = ( 3.0000000 3.5000000 2.5000000 ) + 650 O tau( 650) = ( 3.5000000 4.0000000 3.0000000 ) + 651 Mg tau( 651) = ( 3.5000000 4.0000000 2.5000000 ) + 652 O tau( 652) = ( 4.0000000 4.5000000 3.0000000 ) + 653 Mg tau( 653) = ( 4.0000000 4.5000000 2.5000000 ) + 654 O tau( 654) = ( 4.5000000 5.0000000 3.0000000 ) + 655 Mg tau( 655) = ( 4.5000000 5.0000000 2.5000000 ) + 656 O tau( 656) = ( 5.0000000 5.5000000 3.0000000 ) + 657 Mg tau( 657) = ( 5.0000000 5.5000000 2.5000000 ) + 658 O tau( 658) = ( 5.5000000 6.0000000 3.0000000 ) + 659 Mg tau( 659) = ( 5.5000000 6.0000000 2.5000000 ) + 660 O tau( 660) = ( 6.0000000 6.5000000 3.0000000 ) + 661 Mg tau( 661) = ( 1.5000000 1.5000000 3.0000000 ) + 662 O tau( 662) = ( 2.0000000 2.0000000 3.5000000 ) + 663 Mg tau( 663) = ( 2.0000000 2.0000000 3.0000000 ) + 664 O tau( 664) = ( 2.5000000 2.5000000 3.5000000 ) + 665 Mg tau( 665) = ( 2.5000000 2.5000000 3.0000000 ) + 666 O tau( 666) = ( 3.0000000 3.0000000 3.5000000 ) + 667 Mg tau( 667) = ( 3.0000000 3.0000000 3.0000000 ) + 668 O tau( 668) = ( 3.5000000 3.5000000 3.5000000 ) + 669 Mg tau( 669) = ( 3.5000000 3.5000000 3.0000000 ) + 670 O tau( 670) = ( 4.0000000 4.0000000 3.5000000 ) + 671 Mg tau( 671) = ( 4.0000000 4.0000000 3.0000000 ) + 672 O tau( 672) = ( 4.5000000 4.5000000 3.5000000 ) + 673 Mg tau( 673) = ( 4.5000000 4.5000000 3.0000000 ) + 674 O tau( 674) = ( 5.0000000 5.0000000 3.5000000 ) + 675 Mg tau( 675) = ( 5.0000000 5.0000000 3.0000000 ) + 676 O tau( 676) = ( 5.5000000 5.5000000 3.5000000 ) + 677 Mg tau( 677) = ( 5.5000000 5.5000000 3.0000000 ) + 678 O tau( 678) = ( 6.0000000 6.0000000 3.5000000 ) + 679 Mg tau( 679) = ( 6.0000000 6.0000000 3.0000000 ) + 680 O tau( 680) = ( 6.5000000 6.5000000 3.5000000 ) + 681 Mg tau( 681) = ( 2.0000000 1.5000000 3.5000000 ) + 682 O tau( 682) = ( 2.5000000 2.0000000 4.0000000 ) + 683 Mg tau( 683) = ( 2.5000000 2.0000000 3.5000000 ) + 684 O tau( 684) = ( 3.0000000 2.5000000 4.0000000 ) + 685 Mg tau( 685) = ( 3.0000000 2.5000000 3.5000000 ) + 686 O tau( 686) = ( 3.5000000 3.0000000 4.0000000 ) + 687 Mg tau( 687) = ( 3.5000000 3.0000000 3.5000000 ) + 688 O tau( 688) = ( 4.0000000 3.5000000 4.0000000 ) + 689 Mg tau( 689) = ( 4.0000000 3.5000000 3.5000000 ) + 690 O tau( 690) = ( 4.5000000 4.0000000 4.0000000 ) + 691 Mg tau( 691) = ( 4.5000000 4.0000000 3.5000000 ) + 692 O tau( 692) = ( 5.0000000 4.5000000 4.0000000 ) + 693 Mg tau( 693) = ( 5.0000000 4.5000000 3.5000000 ) + 694 O tau( 694) = ( 5.5000000 5.0000000 4.0000000 ) + 695 Mg tau( 695) = ( 5.5000000 5.0000000 3.5000000 ) + 696 O tau( 696) = ( 6.0000000 5.5000000 4.0000000 ) + 697 Mg tau( 697) = ( 6.0000000 5.5000000 3.5000000 ) + 698 O tau( 698) = ( 6.5000000 6.0000000 4.0000000 ) + 699 Mg tau( 699) = ( 6.5000000 6.0000000 3.5000000 ) + 700 O tau( 700) = ( 7.0000000 6.5000000 4.0000000 ) + 701 Mg tau( 701) = ( 2.5000000 1.5000000 4.0000000 ) + 702 O tau( 702) = ( 3.0000000 2.0000000 4.5000000 ) + 703 Mg tau( 703) = ( 3.0000000 2.0000000 4.0000000 ) + 704 O tau( 704) = ( 3.5000000 2.5000000 4.5000000 ) + 705 Mg tau( 705) = ( 3.5000000 2.5000000 4.0000000 ) + 706 O tau( 706) = ( 4.0000000 3.0000000 4.5000000 ) + 707 Mg tau( 707) = ( 4.0000000 3.0000000 4.0000000 ) + 708 O tau( 708) = ( 4.5000000 3.5000000 4.5000000 ) + 709 Mg tau( 709) = ( 4.5000000 3.5000000 4.0000000 ) + 710 O tau( 710) = ( 5.0000000 4.0000000 4.5000000 ) + 711 Mg tau( 711) = ( 5.0000000 4.0000000 4.0000000 ) + 712 O tau( 712) = ( 5.5000000 4.5000000 4.5000000 ) + 713 Mg tau( 713) = ( 5.5000000 4.5000000 4.0000000 ) + 714 O tau( 714) = ( 6.0000000 5.0000000 4.5000000 ) + 715 Mg tau( 715) = ( 6.0000000 5.0000000 4.0000000 ) + 716 O tau( 716) = ( 6.5000000 5.5000000 4.5000000 ) + 717 Mg tau( 717) = ( 6.5000000 5.5000000 4.0000000 ) + 718 O tau( 718) = ( 7.0000000 6.0000000 4.5000000 ) + 719 Mg tau( 719) = ( 7.0000000 6.0000000 4.0000000 ) + 720 O tau( 720) = ( 7.5000000 6.5000000 4.5000000 ) + 721 Mg tau( 721) = ( 3.0000000 1.5000000 4.5000000 ) + 722 O tau( 722) = ( 3.5000000 2.0000000 5.0000000 ) + 723 Mg tau( 723) = ( 3.5000000 2.0000000 4.5000000 ) + 724 O tau( 724) = ( 4.0000000 2.5000000 5.0000000 ) + 725 Mg tau( 725) = ( 4.0000000 2.5000000 4.5000000 ) + 726 O tau( 726) = ( 4.5000000 3.0000000 5.0000000 ) + 727 Mg tau( 727) = ( 4.5000000 3.0000000 4.5000000 ) + 728 O tau( 728) = ( 5.0000000 3.5000000 5.0000000 ) + 729 Mg tau( 729) = ( 5.0000000 3.5000000 4.5000000 ) + 730 O tau( 730) = ( 5.5000000 4.0000000 5.0000000 ) + 731 Mg tau( 731) = ( 5.5000000 4.0000000 4.5000000 ) + 732 O tau( 732) = ( 6.0000000 4.5000000 5.0000000 ) + 733 Mg tau( 733) = ( 6.0000000 4.5000000 4.5000000 ) + 734 O tau( 734) = ( 6.5000000 5.0000000 5.0000000 ) + 735 Mg tau( 735) = ( 6.5000000 5.0000000 4.5000000 ) + 736 O tau( 736) = ( 7.0000000 5.5000000 5.0000000 ) + 737 Mg tau( 737) = ( 7.0000000 5.5000000 4.5000000 ) + 738 O tau( 738) = ( 7.5000000 6.0000000 5.0000000 ) + 739 Mg tau( 739) = ( 7.5000000 6.0000000 4.5000000 ) + 740 O tau( 740) = ( 8.0000000 6.5000000 5.0000000 ) + 741 Mg tau( 741) = ( 3.5000000 1.5000000 5.0000000 ) + 742 O tau( 742) = ( 4.0000000 2.0000000 5.5000000 ) + 743 Mg tau( 743) = ( 4.0000000 2.0000000 5.0000000 ) + 744 O tau( 744) = ( 4.5000000 2.5000000 5.5000000 ) + 745 Mg tau( 745) = ( 4.5000000 2.5000000 5.0000000 ) + 746 O tau( 746) = ( 5.0000000 3.0000000 5.5000000 ) + 747 Mg tau( 747) = ( 5.0000000 3.0000000 5.0000000 ) + 748 O tau( 748) = ( 5.5000000 3.5000000 5.5000000 ) + 749 Mg tau( 749) = ( 5.5000000 3.5000000 5.0000000 ) + 750 O tau( 750) = ( 6.0000000 4.0000000 5.5000000 ) + 751 Mg tau( 751) = ( 6.0000000 4.0000000 5.0000000 ) + 752 O tau( 752) = ( 6.5000000 4.5000000 5.5000000 ) + 753 Mg tau( 753) = ( 6.5000000 4.5000000 5.0000000 ) + 754 O tau( 754) = ( 7.0000000 5.0000000 5.5000000 ) + 755 Mg tau( 755) = ( 7.0000000 5.0000000 5.0000000 ) + 756 O tau( 756) = ( 7.5000000 5.5000000 5.5000000 ) + 757 Mg tau( 757) = ( 7.5000000 5.5000000 5.0000000 ) + 758 O tau( 758) = ( 8.0000000 6.0000000 5.5000000 ) + 759 Mg tau( 759) = ( 8.0000000 6.0000000 5.0000000 ) + 760 O tau( 760) = ( 8.5000000 6.5000000 5.5000000 ) + 761 Mg tau( 761) = ( 4.0000000 1.5000000 5.5000000 ) + 762 O tau( 762) = ( 4.5000000 2.0000000 6.0000000 ) + 763 Mg tau( 763) = ( 4.5000000 2.0000000 5.5000000 ) + 764 O tau( 764) = ( 5.0000000 2.5000000 6.0000000 ) + 765 Mg tau( 765) = ( 5.0000000 2.5000000 5.5000000 ) + 766 O tau( 766) = ( 5.5000000 3.0000000 6.0000000 ) + 767 Mg tau( 767) = ( 5.5000000 3.0000000 5.5000000 ) + 768 O tau( 768) = ( 6.0000000 3.5000000 6.0000000 ) + 769 Mg tau( 769) = ( 6.0000000 3.5000000 5.5000000 ) + 770 O tau( 770) = ( 6.5000000 4.0000000 6.0000000 ) + 771 Mg tau( 771) = ( 6.5000000 4.0000000 5.5000000 ) + 772 O tau( 772) = ( 7.0000000 4.5000000 6.0000000 ) + 773 Mg tau( 773) = ( 7.0000000 4.5000000 5.5000000 ) + 774 O tau( 774) = ( 7.5000000 5.0000000 6.0000000 ) + 775 Mg tau( 775) = ( 7.5000000 5.0000000 5.5000000 ) + 776 O tau( 776) = ( 8.0000000 5.5000000 6.0000000 ) + 777 Mg tau( 777) = ( 8.0000000 5.5000000 5.5000000 ) + 778 O tau( 778) = ( 8.5000000 6.0000000 6.0000000 ) + 779 Mg tau( 779) = ( 8.5000000 6.0000000 5.5000000 ) + 780 O tau( 780) = ( 9.0000000 6.5000000 6.0000000 ) + 781 Mg tau( 781) = ( 4.5000000 1.5000000 6.0000000 ) + 782 O tau( 782) = ( 5.0000000 2.0000000 6.5000000 ) + 783 Mg tau( 783) = ( 5.0000000 2.0000000 6.0000000 ) + 784 O tau( 784) = ( 5.5000000 2.5000000 6.5000000 ) + 785 Mg tau( 785) = ( 5.5000000 2.5000000 6.0000000 ) + 786 O tau( 786) = ( 6.0000000 3.0000000 6.5000000 ) + 787 Mg tau( 787) = ( 6.0000000 3.0000000 6.0000000 ) + 788 O tau( 788) = ( 6.5000000 3.5000000 6.5000000 ) + 789 Mg tau( 789) = ( 6.5000000 3.5000000 6.0000000 ) + 790 O tau( 790) = ( 7.0000000 4.0000000 6.5000000 ) + 791 Mg tau( 791) = ( 7.0000000 4.0000000 6.0000000 ) + 792 O tau( 792) = ( 7.5000000 4.5000000 6.5000000 ) + 793 Mg tau( 793) = ( 7.5000000 4.5000000 6.0000000 ) + 794 O tau( 794) = ( 8.0000000 5.0000000 6.5000000 ) + 795 Mg tau( 795) = ( 8.0000000 5.0000000 6.0000000 ) + 796 O tau( 796) = ( 8.5000000 5.5000000 6.5000000 ) + 797 Mg tau( 797) = ( 8.5000000 5.5000000 6.0000000 ) + 798 O tau( 798) = ( 9.0000000 6.0000000 6.5000000 ) + 799 Mg tau( 799) = ( 9.0000000 6.0000000 6.0000000 ) + 800 O tau( 800) = ( 9.5000000 6.5000000 6.5000000 ) + 801 Mg tau( 801) = ( 0.0000000 2.0000000 2.0000000 ) + 802 O tau( 802) = ( 0.5000000 2.5000000 2.5000000 ) + 803 Mg tau( 803) = ( 0.5000000 2.5000000 2.0000000 ) + 804 O tau( 804) = ( 1.0000000 3.0000000 2.5000000 ) + 805 Mg tau( 805) = ( 1.0000000 3.0000000 2.0000000 ) + 806 O tau( 806) = ( 1.5000000 3.5000000 2.5000000 ) + 807 Mg tau( 807) = ( 1.5000000 3.5000000 2.0000000 ) + 808 O tau( 808) = ( 2.0000000 4.0000000 2.5000000 ) + 809 Mg tau( 809) = ( 2.0000000 4.0000000 2.0000000 ) + 810 O tau( 810) = ( 2.5000000 4.5000000 2.5000000 ) + 811 Mg tau( 811) = ( 2.5000000 4.5000000 2.0000000 ) + 812 O tau( 812) = ( 3.0000000 5.0000000 2.5000000 ) + 813 Mg tau( 813) = ( 3.0000000 5.0000000 2.0000000 ) + 814 O tau( 814) = ( 3.5000000 5.5000000 2.5000000 ) + 815 Mg tau( 815) = ( 3.5000000 5.5000000 2.0000000 ) + 816 O tau( 816) = ( 4.0000000 6.0000000 2.5000000 ) + 817 Mg tau( 817) = ( 4.0000000 6.0000000 2.0000000 ) + 818 O tau( 818) = ( 4.5000000 6.5000000 2.5000000 ) + 819 Mg tau( 819) = ( 4.5000000 6.5000000 2.0000000 ) + 820 O tau( 820) = ( 5.0000000 7.0000000 2.5000000 ) + 821 Mg tau( 821) = ( 0.5000000 2.0000000 2.5000000 ) + 822 O tau( 822) = ( 1.0000000 2.5000000 3.0000000 ) + 823 Mg tau( 823) = ( 1.0000000 2.5000000 2.5000000 ) + 824 O tau( 824) = ( 1.5000000 3.0000000 3.0000000 ) + 825 Mg tau( 825) = ( 1.5000000 3.0000000 2.5000000 ) + 826 O tau( 826) = ( 2.0000000 3.5000000 3.0000000 ) + 827 Mg tau( 827) = ( 2.0000000 3.5000000 2.5000000 ) + 828 O tau( 828) = ( 2.5000000 4.0000000 3.0000000 ) + 829 Mg tau( 829) = ( 2.5000000 4.0000000 2.5000000 ) + 830 O tau( 830) = ( 3.0000000 4.5000000 3.0000000 ) + 831 Mg tau( 831) = ( 3.0000000 4.5000000 2.5000000 ) + 832 O tau( 832) = ( 3.5000000 5.0000000 3.0000000 ) + 833 Mg tau( 833) = ( 3.5000000 5.0000000 2.5000000 ) + 834 O tau( 834) = ( 4.0000000 5.5000000 3.0000000 ) + 835 Mg tau( 835) = ( 4.0000000 5.5000000 2.5000000 ) + 836 O tau( 836) = ( 4.5000000 6.0000000 3.0000000 ) + 837 Mg tau( 837) = ( 4.5000000 6.0000000 2.5000000 ) + 838 O tau( 838) = ( 5.0000000 6.5000000 3.0000000 ) + 839 Mg tau( 839) = ( 5.0000000 6.5000000 2.5000000 ) + 840 O tau( 840) = ( 5.5000000 7.0000000 3.0000000 ) + 841 Mg tau( 841) = ( 1.0000000 2.0000000 3.0000000 ) + 842 O tau( 842) = ( 1.5000000 2.5000000 3.5000000 ) + 843 Mg tau( 843) = ( 1.5000000 2.5000000 3.0000000 ) + 844 O tau( 844) = ( 2.0000000 3.0000000 3.5000000 ) + 845 Mg tau( 845) = ( 2.0000000 3.0000000 3.0000000 ) + 846 O tau( 846) = ( 2.5000000 3.5000000 3.5000000 ) + 847 Mg tau( 847) = ( 2.5000000 3.5000000 3.0000000 ) + 848 O tau( 848) = ( 3.0000000 4.0000000 3.5000000 ) + 849 Mg tau( 849) = ( 3.0000000 4.0000000 3.0000000 ) + 850 O tau( 850) = ( 3.5000000 4.5000000 3.5000000 ) + 851 Mg tau( 851) = ( 3.5000000 4.5000000 3.0000000 ) + 852 O tau( 852) = ( 4.0000000 5.0000000 3.5000000 ) + 853 Mg tau( 853) = ( 4.0000000 5.0000000 3.0000000 ) + 854 O tau( 854) = ( 4.5000000 5.5000000 3.5000000 ) + 855 Mg tau( 855) = ( 4.5000000 5.5000000 3.0000000 ) + 856 O tau( 856) = ( 5.0000000 6.0000000 3.5000000 ) + 857 Mg tau( 857) = ( 5.0000000 6.0000000 3.0000000 ) + 858 O tau( 858) = ( 5.5000000 6.5000000 3.5000000 ) + 859 Mg tau( 859) = ( 5.5000000 6.5000000 3.0000000 ) + 860 O tau( 860) = ( 6.0000000 7.0000000 3.5000000 ) + 861 Mg tau( 861) = ( 1.5000000 2.0000000 3.5000000 ) + 862 O tau( 862) = ( 2.0000000 2.5000000 4.0000000 ) + 863 Mg tau( 863) = ( 2.0000000 2.5000000 3.5000000 ) + 864 O tau( 864) = ( 2.5000000 3.0000000 4.0000000 ) + 865 Mg tau( 865) = ( 2.5000000 3.0000000 3.5000000 ) + 866 O tau( 866) = ( 3.0000000 3.5000000 4.0000000 ) + 867 Mg tau( 867) = ( 3.0000000 3.5000000 3.5000000 ) + 868 O tau( 868) = ( 3.5000000 4.0000000 4.0000000 ) + 869 Mg tau( 869) = ( 3.5000000 4.0000000 3.5000000 ) + 870 O tau( 870) = ( 4.0000000 4.5000000 4.0000000 ) + 871 Mg tau( 871) = ( 4.0000000 4.5000000 3.5000000 ) + 872 O tau( 872) = ( 4.5000000 5.0000000 4.0000000 ) + 873 Mg tau( 873) = ( 4.5000000 5.0000000 3.5000000 ) + 874 O tau( 874) = ( 5.0000000 5.5000000 4.0000000 ) + 875 Mg tau( 875) = ( 5.0000000 5.5000000 3.5000000 ) + 876 O tau( 876) = ( 5.5000000 6.0000000 4.0000000 ) + 877 Mg tau( 877) = ( 5.5000000 6.0000000 3.5000000 ) + 878 O tau( 878) = ( 6.0000000 6.5000000 4.0000000 ) + 879 Mg tau( 879) = ( 6.0000000 6.5000000 3.5000000 ) + 880 O tau( 880) = ( 6.5000000 7.0000000 4.0000000 ) + 881 Mg tau( 881) = ( 2.0000000 2.0000000 4.0000000 ) + 882 O tau( 882) = ( 2.5000000 2.5000000 4.5000000 ) + 883 Mg tau( 883) = ( 2.5000000 2.5000000 4.0000000 ) + 884 O tau( 884) = ( 3.0000000 3.0000000 4.5000000 ) + 885 Mg tau( 885) = ( 3.0000000 3.0000000 4.0000000 ) + 886 O tau( 886) = ( 3.5000000 3.5000000 4.5000000 ) + 887 Mg tau( 887) = ( 3.5000000 3.5000000 4.0000000 ) + 888 O tau( 888) = ( 4.0000000 4.0000000 4.5000000 ) + 889 Mg tau( 889) = ( 4.0000000 4.0000000 4.0000000 ) + 890 O tau( 890) = ( 4.5000000 4.5000000 4.5000000 ) + 891 Mg tau( 891) = ( 4.5000000 4.5000000 4.0000000 ) + 892 O tau( 892) = ( 5.0000000 5.0000000 4.5000000 ) + 893 Mg tau( 893) = ( 5.0000000 5.0000000 4.0000000 ) + 894 O tau( 894) = ( 5.5000000 5.5000000 4.5000000 ) + 895 Mg tau( 895) = ( 5.5000000 5.5000000 4.0000000 ) + 896 O tau( 896) = ( 6.0000000 6.0000000 4.5000000 ) + 897 Mg tau( 897) = ( 6.0000000 6.0000000 4.0000000 ) + 898 O tau( 898) = ( 6.5000000 6.5000000 4.5000000 ) + 899 Mg tau( 899) = ( 6.5000000 6.5000000 4.0000000 ) + 900 O tau( 900) = ( 7.0000000 7.0000000 4.5000000 ) + 901 Mg tau( 901) = ( 2.5000000 2.0000000 4.5000000 ) + 902 O tau( 902) = ( 3.0000000 2.5000000 5.0000000 ) + 903 Mg tau( 903) = ( 3.0000000 2.5000000 4.5000000 ) + 904 O tau( 904) = ( 3.5000000 3.0000000 5.0000000 ) + 905 Mg tau( 905) = ( 3.5000000 3.0000000 4.5000000 ) + 906 O tau( 906) = ( 4.0000000 3.5000000 5.0000000 ) + 907 Mg tau( 907) = ( 4.0000000 3.5000000 4.5000000 ) + 908 O tau( 908) = ( 4.5000000 4.0000000 5.0000000 ) + 909 Mg tau( 909) = ( 4.5000000 4.0000000 4.5000000 ) + 910 O tau( 910) = ( 5.0000000 4.5000000 5.0000000 ) + 911 Mg tau( 911) = ( 5.0000000 4.5000000 4.5000000 ) + 912 O tau( 912) = ( 5.5000000 5.0000000 5.0000000 ) + 913 Mg tau( 913) = ( 5.5000000 5.0000000 4.5000000 ) + 914 O tau( 914) = ( 6.0000000 5.5000000 5.0000000 ) + 915 Mg tau( 915) = ( 6.0000000 5.5000000 4.5000000 ) + 916 O tau( 916) = ( 6.5000000 6.0000000 5.0000000 ) + 917 Mg tau( 917) = ( 6.5000000 6.0000000 4.5000000 ) + 918 O tau( 918) = ( 7.0000000 6.5000000 5.0000000 ) + 919 Mg tau( 919) = ( 7.0000000 6.5000000 4.5000000 ) + 920 O tau( 920) = ( 7.5000000 7.0000000 5.0000000 ) + 921 Mg tau( 921) = ( 3.0000000 2.0000000 5.0000000 ) + 922 O tau( 922) = ( 3.5000000 2.5000000 5.5000000 ) + 923 Mg tau( 923) = ( 3.5000000 2.5000000 5.0000000 ) + 924 O tau( 924) = ( 4.0000000 3.0000000 5.5000000 ) + 925 Mg tau( 925) = ( 4.0000000 3.0000000 5.0000000 ) + 926 O tau( 926) = ( 4.5000000 3.5000000 5.5000000 ) + 927 Mg tau( 927) = ( 4.5000000 3.5000000 5.0000000 ) + 928 O tau( 928) = ( 5.0000000 4.0000000 5.5000000 ) + 929 Mg tau( 929) = ( 5.0000000 4.0000000 5.0000000 ) + 930 O tau( 930) = ( 5.5000000 4.5000000 5.5000000 ) + 931 Mg tau( 931) = ( 5.5000000 4.5000000 5.0000000 ) + 932 O tau( 932) = ( 6.0000000 5.0000000 5.5000000 ) + 933 Mg tau( 933) = ( 6.0000000 5.0000000 5.0000000 ) + 934 O tau( 934) = ( 6.5000000 5.5000000 5.5000000 ) + 935 Mg tau( 935) = ( 6.5000000 5.5000000 5.0000000 ) + 936 O tau( 936) = ( 7.0000000 6.0000000 5.5000000 ) + 937 Mg tau( 937) = ( 7.0000000 6.0000000 5.0000000 ) + 938 O tau( 938) = ( 7.5000000 6.5000000 5.5000000 ) + 939 Mg tau( 939) = ( 7.5000000 6.5000000 5.0000000 ) + 940 O tau( 940) = ( 8.0000000 7.0000000 5.5000000 ) + 941 Mg tau( 941) = ( 3.5000000 2.0000000 5.5000000 ) + 942 O tau( 942) = ( 4.0000000 2.5000000 6.0000000 ) + 943 Mg tau( 943) = ( 4.0000000 2.5000000 5.5000000 ) + 944 O tau( 944) = ( 4.5000000 3.0000000 6.0000000 ) + 945 Mg tau( 945) = ( 4.5000000 3.0000000 5.5000000 ) + 946 O tau( 946) = ( 5.0000000 3.5000000 6.0000000 ) + 947 Mg tau( 947) = ( 5.0000000 3.5000000 5.5000000 ) + 948 O tau( 948) = ( 5.5000000 4.0000000 6.0000000 ) + 949 Mg tau( 949) = ( 5.5000000 4.0000000 5.5000000 ) + 950 O tau( 950) = ( 6.0000000 4.5000000 6.0000000 ) + 951 Mg tau( 951) = ( 6.0000000 4.5000000 5.5000000 ) + 952 O tau( 952) = ( 6.5000000 5.0000000 6.0000000 ) + 953 Mg tau( 953) = ( 6.5000000 5.0000000 5.5000000 ) + 954 O tau( 954) = ( 7.0000000 5.5000000 6.0000000 ) + 955 Mg tau( 955) = ( 7.0000000 5.5000000 5.5000000 ) + 956 O tau( 956) = ( 7.5000000 6.0000000 6.0000000 ) + 957 Mg tau( 957) = ( 7.5000000 6.0000000 5.5000000 ) + 958 O tau( 958) = ( 8.0000000 6.5000000 6.0000000 ) + 959 Mg tau( 959) = ( 8.0000000 6.5000000 5.5000000 ) + 960 O tau( 960) = ( 8.5000000 7.0000000 6.0000000 ) + 961 Mg tau( 961) = ( 4.0000000 2.0000000 6.0000000 ) + 962 O tau( 962) = ( 4.5000000 2.5000000 6.5000000 ) + 963 Mg tau( 963) = ( 4.5000000 2.5000000 6.0000000 ) + 964 O tau( 964) = ( 5.0000000 3.0000000 6.5000000 ) + 965 Mg tau( 965) = ( 5.0000000 3.0000000 6.0000000 ) + 966 O tau( 966) = ( 5.5000000 3.5000000 6.5000000 ) + 967 Mg tau( 967) = ( 5.5000000 3.5000000 6.0000000 ) + 968 O tau( 968) = ( 6.0000000 4.0000000 6.5000000 ) + 969 Mg tau( 969) = ( 6.0000000 4.0000000 6.0000000 ) + 970 O tau( 970) = ( 6.5000000 4.5000000 6.5000000 ) + 971 Mg tau( 971) = ( 6.5000000 4.5000000 6.0000000 ) + 972 O tau( 972) = ( 7.0000000 5.0000000 6.5000000 ) + 973 Mg tau( 973) = ( 7.0000000 5.0000000 6.0000000 ) + 974 O tau( 974) = ( 7.5000000 5.5000000 6.5000000 ) + 975 Mg tau( 975) = ( 7.5000000 5.5000000 6.0000000 ) + 976 O tau( 976) = ( 8.0000000 6.0000000 6.5000000 ) + 977 Mg tau( 977) = ( 8.0000000 6.0000000 6.0000000 ) + 978 O tau( 978) = ( 8.5000000 6.5000000 6.5000000 ) + 979 Mg tau( 979) = ( 8.5000000 6.5000000 6.0000000 ) + 980 O tau( 980) = ( 9.0000000 7.0000000 6.5000000 ) + 981 Mg tau( 981) = ( 4.5000000 2.0000000 6.5000000 ) + 982 O tau( 982) = ( 5.0000000 2.5000000 7.0000000 ) + 983 Mg tau( 983) = ( 5.0000000 2.5000000 6.5000000 ) + 984 O tau( 984) = ( 5.5000000 3.0000000 7.0000000 ) + 985 Mg tau( 985) = ( 5.5000000 3.0000000 6.5000000 ) + 986 O tau( 986) = ( 6.0000000 3.5000000 7.0000000 ) + 987 Mg tau( 987) = ( 6.0000000 3.5000000 6.5000000 ) + 988 O tau( 988) = ( 6.5000000 4.0000000 7.0000000 ) + 989 Mg tau( 989) = ( 6.5000000 4.0000000 6.5000000 ) + 990 O tau( 990) = ( 7.0000000 4.5000000 7.0000000 ) + 991 Mg tau( 991) = ( 7.0000000 4.5000000 6.5000000 ) + 992 O tau( 992) = ( 7.5000000 5.0000000 7.0000000 ) + 993 Mg tau( 993) = ( 7.5000000 5.0000000 6.5000000 ) + 994 O tau( 994) = ( 8.0000000 5.5000000 7.0000000 ) + 995 Mg tau( 995) = ( 8.0000000 5.5000000 6.5000000 ) + 996 O tau( 996) = ( 8.5000000 6.0000000 7.0000000 ) + 997 Mg tau( 997) = ( 8.5000000 6.0000000 6.5000000 ) + 998 O tau( 998) = ( 9.0000000 6.5000000 7.0000000 ) + 999 Mg tau( 999) = ( 9.0000000 6.5000000 6.5000000 ) + 1000 O tau(1000) = ( 9.5000000 7.0000000 7.0000000 ) + 1001 Mg tau(1001) = ( 0.0000000 2.5000000 2.5000000 ) + 1002 O tau(1002) = ( 0.5000000 3.0000000 3.0000000 ) + 1003 Mg tau(1003) = ( 0.5000000 3.0000000 2.5000000 ) + 1004 O tau(1004) = ( 1.0000000 3.5000000 3.0000000 ) + 1005 Mg tau(1005) = ( 1.0000000 3.5000000 2.5000000 ) + 1006 O tau(1006) = ( 1.5000000 4.0000000 3.0000000 ) + 1007 Mg tau(1007) = ( 1.5000000 4.0000000 2.5000000 ) + 1008 O tau(1008) = ( 2.0000000 4.5000000 3.0000000 ) + 1009 Mg tau(1009) = ( 2.0000000 4.5000000 2.5000000 ) + 1010 O tau(1010) = ( 2.5000000 5.0000000 3.0000000 ) + 1011 Mg tau(1011) = ( 2.5000000 5.0000000 2.5000000 ) + 1012 O tau(1012) = ( 3.0000000 5.5000000 3.0000000 ) + 1013 Mg tau(1013) = ( 3.0000000 5.5000000 2.5000000 ) + 1014 O tau(1014) = ( 3.5000000 6.0000000 3.0000000 ) + 1015 Mg tau(1015) = ( 3.5000000 6.0000000 2.5000000 ) + 1016 O tau(1016) = ( 4.0000000 6.5000000 3.0000000 ) + 1017 Mg tau(1017) = ( 4.0000000 6.5000000 2.5000000 ) + 1018 O tau(1018) = ( 4.5000000 7.0000000 3.0000000 ) + 1019 Mg tau(1019) = ( 4.5000000 7.0000000 2.5000000 ) + 1020 O tau(1020) = ( 5.0000000 7.5000000 3.0000000 ) + 1021 Mg tau(1021) = ( 0.5000000 2.5000000 3.0000000 ) + 1022 O tau(1022) = ( 1.0000000 3.0000000 3.5000000 ) + 1023 Mg tau(1023) = ( 1.0000000 3.0000000 3.0000000 ) + 1024 O tau(1024) = ( 1.5000000 3.5000000 3.5000000 ) + 1025 Mg tau(1025) = ( 1.5000000 3.5000000 3.0000000 ) + 1026 O tau(1026) = ( 2.0000000 4.0000000 3.5000000 ) + 1027 Mg tau(1027) = ( 2.0000000 4.0000000 3.0000000 ) + 1028 O tau(1028) = ( 2.5000000 4.5000000 3.5000000 ) + 1029 Mg tau(1029) = ( 2.5000000 4.5000000 3.0000000 ) + 1030 O tau(1030) = ( 3.0000000 5.0000000 3.5000000 ) + 1031 Mg tau(1031) = ( 3.0000000 5.0000000 3.0000000 ) + 1032 O tau(1032) = ( 3.5000000 5.5000000 3.5000000 ) + 1033 Mg tau(1033) = ( 3.5000000 5.5000000 3.0000000 ) + 1034 O tau(1034) = ( 4.0000000 6.0000000 3.5000000 ) + 1035 Mg tau(1035) = ( 4.0000000 6.0000000 3.0000000 ) + 1036 O tau(1036) = ( 4.5000000 6.5000000 3.5000000 ) + 1037 Mg tau(1037) = ( 4.5000000 6.5000000 3.0000000 ) + 1038 O tau(1038) = ( 5.0000000 7.0000000 3.5000000 ) + 1039 Mg tau(1039) = ( 5.0000000 7.0000000 3.0000000 ) + 1040 O tau(1040) = ( 5.5000000 7.5000000 3.5000000 ) + 1041 Mg tau(1041) = ( 1.0000000 2.5000000 3.5000000 ) + 1042 O tau(1042) = ( 1.5000000 3.0000000 4.0000000 ) + 1043 Mg tau(1043) = ( 1.5000000 3.0000000 3.5000000 ) + 1044 O tau(1044) = ( 2.0000000 3.5000000 4.0000000 ) + 1045 Mg tau(1045) = ( 2.0000000 3.5000000 3.5000000 ) + 1046 O tau(1046) = ( 2.5000000 4.0000000 4.0000000 ) + 1047 Mg tau(1047) = ( 2.5000000 4.0000000 3.5000000 ) + 1048 O tau(1048) = ( 3.0000000 4.5000000 4.0000000 ) + 1049 Mg tau(1049) = ( 3.0000000 4.5000000 3.5000000 ) + 1050 O tau(1050) = ( 3.5000000 5.0000000 4.0000000 ) + 1051 Mg tau(1051) = ( 3.5000000 5.0000000 3.5000000 ) + 1052 O tau(1052) = ( 4.0000000 5.5000000 4.0000000 ) + 1053 Mg tau(1053) = ( 4.0000000 5.5000000 3.5000000 ) + 1054 O tau(1054) = ( 4.5000000 6.0000000 4.0000000 ) + 1055 Mg tau(1055) = ( 4.5000000 6.0000000 3.5000000 ) + 1056 O tau(1056) = ( 5.0000000 6.5000000 4.0000000 ) + 1057 Mg tau(1057) = ( 5.0000000 6.5000000 3.5000000 ) + 1058 O tau(1058) = ( 5.5000000 7.0000000 4.0000000 ) + 1059 Mg tau(1059) = ( 5.5000000 7.0000000 3.5000000 ) + 1060 O tau(1060) = ( 6.0000000 7.5000000 4.0000000 ) + 1061 Mg tau(1061) = ( 1.5000000 2.5000000 4.0000000 ) + 1062 O tau(1062) = ( 2.0000000 3.0000000 4.5000000 ) + 1063 Mg tau(1063) = ( 2.0000000 3.0000000 4.0000000 ) + 1064 O tau(1064) = ( 2.5000000 3.5000000 4.5000000 ) + 1065 Mg tau(1065) = ( 2.5000000 3.5000000 4.0000000 ) + 1066 O tau(1066) = ( 3.0000000 4.0000000 4.5000000 ) + 1067 Mg tau(1067) = ( 3.0000000 4.0000000 4.0000000 ) + 1068 O tau(1068) = ( 3.5000000 4.5000000 4.5000000 ) + 1069 Mg tau(1069) = ( 3.5000000 4.5000000 4.0000000 ) + 1070 O tau(1070) = ( 4.0000000 5.0000000 4.5000000 ) + 1071 Mg tau(1071) = ( 4.0000000 5.0000000 4.0000000 ) + 1072 O tau(1072) = ( 4.5000000 5.5000000 4.5000000 ) + 1073 Mg tau(1073) = ( 4.5000000 5.5000000 4.0000000 ) + 1074 O tau(1074) = ( 5.0000000 6.0000000 4.5000000 ) + 1075 Mg tau(1075) = ( 5.0000000 6.0000000 4.0000000 ) + 1076 O tau(1076) = ( 5.5000000 6.5000000 4.5000000 ) + 1077 Mg tau(1077) = ( 5.5000000 6.5000000 4.0000000 ) + 1078 O tau(1078) = ( 6.0000000 7.0000000 4.5000000 ) + 1079 Mg tau(1079) = ( 6.0000000 7.0000000 4.0000000 ) + 1080 O tau(1080) = ( 6.5000000 7.5000000 4.5000000 ) + 1081 Mg tau(1081) = ( 2.0000000 2.5000000 4.5000000 ) + 1082 O tau(1082) = ( 2.5000000 3.0000000 5.0000000 ) + 1083 Mg tau(1083) = ( 2.5000000 3.0000000 4.5000000 ) + 1084 O tau(1084) = ( 3.0000000 3.5000000 5.0000000 ) + 1085 Mg tau(1085) = ( 3.0000000 3.5000000 4.5000000 ) + 1086 O tau(1086) = ( 3.5000000 4.0000000 5.0000000 ) + 1087 Mg tau(1087) = ( 3.5000000 4.0000000 4.5000000 ) + 1088 O tau(1088) = ( 4.0000000 4.5000000 5.0000000 ) + 1089 Mg tau(1089) = ( 4.0000000 4.5000000 4.5000000 ) + 1090 O tau(1090) = ( 4.5000000 5.0000000 5.0000000 ) + 1091 Mg tau(1091) = ( 4.5000000 5.0000000 4.5000000 ) + 1092 O tau(1092) = ( 5.0000000 5.5000000 5.0000000 ) + 1093 Mg tau(1093) = ( 5.0000000 5.5000000 4.5000000 ) + 1094 O tau(1094) = ( 5.5000000 6.0000000 5.0000000 ) + 1095 Mg tau(1095) = ( 5.5000000 6.0000000 4.5000000 ) + 1096 O tau(1096) = ( 6.0000000 6.5000000 5.0000000 ) + 1097 Mg tau(1097) = ( 6.0000000 6.5000000 4.5000000 ) + 1098 O tau(1098) = ( 6.5000000 7.0000000 5.0000000 ) + 1099 Mg tau(1099) = ( 6.5000000 7.0000000 4.5000000 ) + 1100 O tau(1100) = ( 7.0000000 7.5000000 5.0000000 ) + 1101 Mg tau(1101) = ( 2.5000000 2.5000000 5.0000000 ) + 1102 O tau(1102) = ( 3.0000000 3.0000000 5.5000000 ) + 1103 Mg tau(1103) = ( 3.0000000 3.0000000 5.0000000 ) + 1104 O tau(1104) = ( 3.5000000 3.5000000 5.5000000 ) + 1105 Mg tau(1105) = ( 3.5000000 3.5000000 5.0000000 ) + 1106 O tau(1106) = ( 4.0000000 4.0000000 5.5000000 ) + 1107 Mg tau(1107) = ( 4.0000000 4.0000000 5.0000000 ) + 1108 O tau(1108) = ( 4.5000000 4.5000000 5.5000000 ) + 1109 Mg tau(1109) = ( 4.5000000 4.5000000 5.0000000 ) + 1110 O tau(1110) = ( 5.0000000 5.0000000 5.5000000 ) + 1111 Mg tau(1111) = ( 5.0000000 5.0000000 5.0000000 ) + 1112 O tau(1112) = ( 5.5000000 5.5000000 5.5000000 ) + 1113 Mg tau(1113) = ( 5.5000000 5.5000000 5.0000000 ) + 1114 O tau(1114) = ( 6.0000000 6.0000000 5.5000000 ) + 1115 Mg tau(1115) = ( 6.0000000 6.0000000 5.0000000 ) + 1116 O tau(1116) = ( 6.5000000 6.5000000 5.5000000 ) + 1117 Mg tau(1117) = ( 6.5000000 6.5000000 5.0000000 ) + 1118 O tau(1118) = ( 7.0000000 7.0000000 5.5000000 ) + 1119 Mg tau(1119) = ( 7.0000000 7.0000000 5.0000000 ) + 1120 O tau(1120) = ( 7.5000000 7.5000000 5.5000000 ) + 1121 Mg tau(1121) = ( 3.0000000 2.5000000 5.5000000 ) + 1122 O tau(1122) = ( 3.5000000 3.0000000 6.0000000 ) + 1123 Mg tau(1123) = ( 3.5000000 3.0000000 5.5000000 ) + 1124 O tau(1124) = ( 4.0000000 3.5000000 6.0000000 ) + 1125 Mg tau(1125) = ( 4.0000000 3.5000000 5.5000000 ) + 1126 O tau(1126) = ( 4.5000000 4.0000000 6.0000000 ) + 1127 Mg tau(1127) = ( 4.5000000 4.0000000 5.5000000 ) + 1128 O tau(1128) = ( 5.0000000 4.5000000 6.0000000 ) + 1129 Mg tau(1129) = ( 5.0000000 4.5000000 5.5000000 ) + 1130 O tau(1130) = ( 5.5000000 5.0000000 6.0000000 ) + 1131 Mg tau(1131) = ( 5.5000000 5.0000000 5.5000000 ) + 1132 O tau(1132) = ( 6.0000000 5.5000000 6.0000000 ) + 1133 Mg tau(1133) = ( 6.0000000 5.5000000 5.5000000 ) + 1134 O tau(1134) = ( 6.5000000 6.0000000 6.0000000 ) + 1135 Mg tau(1135) = ( 6.5000000 6.0000000 5.5000000 ) + 1136 O tau(1136) = ( 7.0000000 6.5000000 6.0000000 ) + 1137 Mg tau(1137) = ( 7.0000000 6.5000000 5.5000000 ) + 1138 O tau(1138) = ( 7.5000000 7.0000000 6.0000000 ) + 1139 Mg tau(1139) = ( 7.5000000 7.0000000 5.5000000 ) + 1140 O tau(1140) = ( 8.0000000 7.5000000 6.0000000 ) + 1141 Mg tau(1141) = ( 3.5000000 2.5000000 6.0000000 ) + 1142 O tau(1142) = ( 4.0000000 3.0000000 6.5000000 ) + 1143 Mg tau(1143) = ( 4.0000000 3.0000000 6.0000000 ) + 1144 O tau(1144) = ( 4.5000000 3.5000000 6.5000000 ) + 1145 Mg tau(1145) = ( 4.5000000 3.5000000 6.0000000 ) + 1146 O tau(1146) = ( 5.0000000 4.0000000 6.5000000 ) + 1147 Mg tau(1147) = ( 5.0000000 4.0000000 6.0000000 ) + 1148 O tau(1148) = ( 5.5000000 4.5000000 6.5000000 ) + 1149 Mg tau(1149) = ( 5.5000000 4.5000000 6.0000000 ) + 1150 O tau(1150) = ( 6.0000000 5.0000000 6.5000000 ) + 1151 Mg tau(1151) = ( 6.0000000 5.0000000 6.0000000 ) + 1152 O tau(1152) = ( 6.5000000 5.5000000 6.5000000 ) + 1153 Mg tau(1153) = ( 6.5000000 5.5000000 6.0000000 ) + 1154 O tau(1154) = ( 7.0000000 6.0000000 6.5000000 ) + 1155 Mg tau(1155) = ( 7.0000000 6.0000000 6.0000000 ) + 1156 O tau(1156) = ( 7.5000000 6.5000000 6.5000000 ) + 1157 Mg tau(1157) = ( 7.5000000 6.5000000 6.0000000 ) + 1158 O tau(1158) = ( 8.0000000 7.0000000 6.5000000 ) + 1159 Mg tau(1159) = ( 8.0000000 7.0000000 6.0000000 ) + 1160 O tau(1160) = ( 8.5000000 7.5000000 6.5000000 ) + 1161 Mg tau(1161) = ( 4.0000000 2.5000000 6.5000000 ) + 1162 O tau(1162) = ( 4.5000000 3.0000000 7.0000000 ) + 1163 Mg tau(1163) = ( 4.5000000 3.0000000 6.5000000 ) + 1164 O tau(1164) = ( 5.0000000 3.5000000 7.0000000 ) + 1165 Mg tau(1165) = ( 5.0000000 3.5000000 6.5000000 ) + 1166 O tau(1166) = ( 5.5000000 4.0000000 7.0000000 ) + 1167 Mg tau(1167) = ( 5.5000000 4.0000000 6.5000000 ) + 1168 O tau(1168) = ( 6.0000000 4.5000000 7.0000000 ) + 1169 Mg tau(1169) = ( 6.0000000 4.5000000 6.5000000 ) + 1170 O tau(1170) = ( 6.5000000 5.0000000 7.0000000 ) + 1171 Mg tau(1171) = ( 6.5000000 5.0000000 6.5000000 ) + 1172 O tau(1172) = ( 7.0000000 5.5000000 7.0000000 ) + 1173 Mg tau(1173) = ( 7.0000000 5.5000000 6.5000000 ) + 1174 O tau(1174) = ( 7.5000000 6.0000000 7.0000000 ) + 1175 Mg tau(1175) = ( 7.5000000 6.0000000 6.5000000 ) + 1176 O tau(1176) = ( 8.0000000 6.5000000 7.0000000 ) + 1177 Mg tau(1177) = ( 8.0000000 6.5000000 6.5000000 ) + 1178 O tau(1178) = ( 8.5000000 7.0000000 7.0000000 ) + 1179 Mg tau(1179) = ( 8.5000000 7.0000000 6.5000000 ) + 1180 O tau(1180) = ( 9.0000000 7.5000000 7.0000000 ) + 1181 Mg tau(1181) = ( 4.5000000 2.5000000 7.0000000 ) + 1182 O tau(1182) = ( 5.0000000 3.0000000 7.5000000 ) + 1183 Mg tau(1183) = ( 5.0000000 3.0000000 7.0000000 ) + 1184 O tau(1184) = ( 5.5000000 3.5000000 7.5000000 ) + 1185 Mg tau(1185) = ( 5.5000000 3.5000000 7.0000000 ) + 1186 O tau(1186) = ( 6.0000000 4.0000000 7.5000000 ) + 1187 Mg tau(1187) = ( 6.0000000 4.0000000 7.0000000 ) + 1188 O tau(1188) = ( 6.5000000 4.5000000 7.5000000 ) + 1189 Mg tau(1189) = ( 6.5000000 4.5000000 7.0000000 ) + 1190 O tau(1190) = ( 7.0000000 5.0000000 7.5000000 ) + 1191 Mg tau(1191) = ( 7.0000000 5.0000000 7.0000000 ) + 1192 O tau(1192) = ( 7.5000000 5.5000000 7.5000000 ) + 1193 Mg tau(1193) = ( 7.5000000 5.5000000 7.0000000 ) + 1194 O tau(1194) = ( 8.0000000 6.0000000 7.5000000 ) + 1195 Mg tau(1195) = ( 8.0000000 6.0000000 7.0000000 ) + 1196 O tau(1196) = ( 8.5000000 6.5000000 7.5000000 ) + 1197 Mg tau(1197) = ( 8.5000000 6.5000000 7.0000000 ) + 1198 O tau(1198) = ( 9.0000000 7.0000000 7.5000000 ) + 1199 Mg tau(1199) = ( 9.0000000 7.0000000 7.0000000 ) + 1200 O tau(1200) = ( 9.5000000 7.5000000 7.5000000 ) + 1201 Mg tau(1201) = ( 0.0000000 3.0000000 3.0000000 ) + 1202 O tau(1202) = ( 0.5000000 3.5000000 3.5000000 ) + 1203 Mg tau(1203) = ( 0.5000000 3.5000000 3.0000000 ) + 1204 O tau(1204) = ( 1.0000000 4.0000000 3.5000000 ) + 1205 Mg tau(1205) = ( 1.0000000 4.0000000 3.0000000 ) + 1206 O tau(1206) = ( 1.5000000 4.5000000 3.5000000 ) + 1207 Mg tau(1207) = ( 1.5000000 4.5000000 3.0000000 ) + 1208 O tau(1208) = ( 2.0000000 5.0000000 3.5000000 ) + 1209 Mg tau(1209) = ( 2.0000000 5.0000000 3.0000000 ) + 1210 O tau(1210) = ( 2.5000000 5.5000000 3.5000000 ) + 1211 Mg tau(1211) = ( 2.5000000 5.5000000 3.0000000 ) + 1212 O tau(1212) = ( 3.0000000 6.0000000 3.5000000 ) + 1213 Mg tau(1213) = ( 3.0000000 6.0000000 3.0000000 ) + 1214 O tau(1214) = ( 3.5000000 6.5000000 3.5000000 ) + 1215 Mg tau(1215) = ( 3.5000000 6.5000000 3.0000000 ) + 1216 O tau(1216) = ( 4.0000000 7.0000000 3.5000000 ) + 1217 Mg tau(1217) = ( 4.0000000 7.0000000 3.0000000 ) + 1218 O tau(1218) = ( 4.5000000 7.5000000 3.5000000 ) + 1219 Mg tau(1219) = ( 4.5000000 7.5000000 3.0000000 ) + 1220 O tau(1220) = ( 5.0000000 8.0000000 3.5000000 ) + 1221 Mg tau(1221) = ( 0.5000000 3.0000000 3.5000000 ) + 1222 O tau(1222) = ( 1.0000000 3.5000000 4.0000000 ) + 1223 Mg tau(1223) = ( 1.0000000 3.5000000 3.5000000 ) + 1224 O tau(1224) = ( 1.5000000 4.0000000 4.0000000 ) + 1225 Mg tau(1225) = ( 1.5000000 4.0000000 3.5000000 ) + 1226 O tau(1226) = ( 2.0000000 4.5000000 4.0000000 ) + 1227 Mg tau(1227) = ( 2.0000000 4.5000000 3.5000000 ) + 1228 O tau(1228) = ( 2.5000000 5.0000000 4.0000000 ) + 1229 Mg tau(1229) = ( 2.5000000 5.0000000 3.5000000 ) + 1230 O tau(1230) = ( 3.0000000 5.5000000 4.0000000 ) + 1231 Mg tau(1231) = ( 3.0000000 5.5000000 3.5000000 ) + 1232 O tau(1232) = ( 3.5000000 6.0000000 4.0000000 ) + 1233 Mg tau(1233) = ( 3.5000000 6.0000000 3.5000000 ) + 1234 O tau(1234) = ( 4.0000000 6.5000000 4.0000000 ) + 1235 Mg tau(1235) = ( 4.0000000 6.5000000 3.5000000 ) + 1236 O tau(1236) = ( 4.5000000 7.0000000 4.0000000 ) + 1237 Mg tau(1237) = ( 4.5000000 7.0000000 3.5000000 ) + 1238 O tau(1238) = ( 5.0000000 7.5000000 4.0000000 ) + 1239 Mg tau(1239) = ( 5.0000000 7.5000000 3.5000000 ) + 1240 O tau(1240) = ( 5.5000000 8.0000000 4.0000000 ) + 1241 Mg tau(1241) = ( 1.0000000 3.0000000 4.0000000 ) + 1242 O tau(1242) = ( 1.5000000 3.5000000 4.5000000 ) + 1243 Mg tau(1243) = ( 1.5000000 3.5000000 4.0000000 ) + 1244 O tau(1244) = ( 2.0000000 4.0000000 4.5000000 ) + 1245 Mg tau(1245) = ( 2.0000000 4.0000000 4.0000000 ) + 1246 O tau(1246) = ( 2.5000000 4.5000000 4.5000000 ) + 1247 Mg tau(1247) = ( 2.5000000 4.5000000 4.0000000 ) + 1248 O tau(1248) = ( 3.0000000 5.0000000 4.5000000 ) + 1249 Mg tau(1249) = ( 3.0000000 5.0000000 4.0000000 ) + 1250 O tau(1250) = ( 3.5000000 5.5000000 4.5000000 ) + 1251 Mg tau(1251) = ( 3.5000000 5.5000000 4.0000000 ) + 1252 O tau(1252) = ( 4.0000000 6.0000000 4.5000000 ) + 1253 Mg tau(1253) = ( 4.0000000 6.0000000 4.0000000 ) + 1254 O tau(1254) = ( 4.5000000 6.5000000 4.5000000 ) + 1255 Mg tau(1255) = ( 4.5000000 6.5000000 4.0000000 ) + 1256 O tau(1256) = ( 5.0000000 7.0000000 4.5000000 ) + 1257 Mg tau(1257) = ( 5.0000000 7.0000000 4.0000000 ) + 1258 O tau(1258) = ( 5.5000000 7.5000000 4.5000000 ) + 1259 Mg tau(1259) = ( 5.5000000 7.5000000 4.0000000 ) + 1260 O tau(1260) = ( 6.0000000 8.0000000 4.5000000 ) + 1261 Mg tau(1261) = ( 1.5000000 3.0000000 4.5000000 ) + 1262 O tau(1262) = ( 2.0000000 3.5000000 5.0000000 ) + 1263 Mg tau(1263) = ( 2.0000000 3.5000000 4.5000000 ) + 1264 O tau(1264) = ( 2.5000000 4.0000000 5.0000000 ) + 1265 Mg tau(1265) = ( 2.5000000 4.0000000 4.5000000 ) + 1266 O tau(1266) = ( 3.0000000 4.5000000 5.0000000 ) + 1267 Mg tau(1267) = ( 3.0000000 4.5000000 4.5000000 ) + 1268 O tau(1268) = ( 3.5000000 5.0000000 5.0000000 ) + 1269 Mg tau(1269) = ( 3.5000000 5.0000000 4.5000000 ) + 1270 O tau(1270) = ( 4.0000000 5.5000000 5.0000000 ) + 1271 Mg tau(1271) = ( 4.0000000 5.5000000 4.5000000 ) + 1272 O tau(1272) = ( 4.5000000 6.0000000 5.0000000 ) + 1273 Mg tau(1273) = ( 4.5000000 6.0000000 4.5000000 ) + 1274 O tau(1274) = ( 5.0000000 6.5000000 5.0000000 ) + 1275 Mg tau(1275) = ( 5.0000000 6.5000000 4.5000000 ) + 1276 O tau(1276) = ( 5.5000000 7.0000000 5.0000000 ) + 1277 Mg tau(1277) = ( 5.5000000 7.0000000 4.5000000 ) + 1278 O tau(1278) = ( 6.0000000 7.5000000 5.0000000 ) + 1279 Mg tau(1279) = ( 6.0000000 7.5000000 4.5000000 ) + 1280 O tau(1280) = ( 6.5000000 8.0000000 5.0000000 ) + 1281 Mg tau(1281) = ( 2.0000000 3.0000000 5.0000000 ) + 1282 O tau(1282) = ( 2.5000000 3.5000000 5.5000000 ) + 1283 Mg tau(1283) = ( 2.5000000 3.5000000 5.0000000 ) + 1284 O tau(1284) = ( 3.0000000 4.0000000 5.5000000 ) + 1285 Mg tau(1285) = ( 3.0000000 4.0000000 5.0000000 ) + 1286 O tau(1286) = ( 3.5000000 4.5000000 5.5000000 ) + 1287 Mg tau(1287) = ( 3.5000000 4.5000000 5.0000000 ) + 1288 O tau(1288) = ( 4.0000000 5.0000000 5.5000000 ) + 1289 Mg tau(1289) = ( 4.0000000 5.0000000 5.0000000 ) + 1290 O tau(1290) = ( 4.5000000 5.5000000 5.5000000 ) + 1291 Mg tau(1291) = ( 4.5000000 5.5000000 5.0000000 ) + 1292 O tau(1292) = ( 5.0000000 6.0000000 5.5000000 ) + 1293 Mg tau(1293) = ( 5.0000000 6.0000000 5.0000000 ) + 1294 O tau(1294) = ( 5.5000000 6.5000000 5.5000000 ) + 1295 Mg tau(1295) = ( 5.5000000 6.5000000 5.0000000 ) + 1296 O tau(1296) = ( 6.0000000 7.0000000 5.5000000 ) + 1297 Mg tau(1297) = ( 6.0000000 7.0000000 5.0000000 ) + 1298 O tau(1298) = ( 6.5000000 7.5000000 5.5000000 ) + 1299 Mg tau(1299) = ( 6.5000000 7.5000000 5.0000000 ) + 1300 O tau(1300) = ( 7.0000000 8.0000000 5.5000000 ) + 1301 Mg tau(1301) = ( 2.5000000 3.0000000 5.5000000 ) + 1302 O tau(1302) = ( 3.0000000 3.5000000 6.0000000 ) + 1303 Mg tau(1303) = ( 3.0000000 3.5000000 5.5000000 ) + 1304 O tau(1304) = ( 3.5000000 4.0000000 6.0000000 ) + 1305 Mg tau(1305) = ( 3.5000000 4.0000000 5.5000000 ) + 1306 O tau(1306) = ( 4.0000000 4.5000000 6.0000000 ) + 1307 Mg tau(1307) = ( 4.0000000 4.5000000 5.5000000 ) + 1308 O tau(1308) = ( 4.5000000 5.0000000 6.0000000 ) + 1309 Mg tau(1309) = ( 4.5000000 5.0000000 5.5000000 ) + 1310 O tau(1310) = ( 5.0000000 5.5000000 6.0000000 ) + 1311 Mg tau(1311) = ( 5.0000000 5.5000000 5.5000000 ) + 1312 O tau(1312) = ( 5.5000000 6.0000000 6.0000000 ) + 1313 Mg tau(1313) = ( 5.5000000 6.0000000 5.5000000 ) + 1314 O tau(1314) = ( 6.0000000 6.5000000 6.0000000 ) + 1315 Mg tau(1315) = ( 6.0000000 6.5000000 5.5000000 ) + 1316 O tau(1316) = ( 6.5000000 7.0000000 6.0000000 ) + 1317 Mg tau(1317) = ( 6.5000000 7.0000000 5.5000000 ) + 1318 O tau(1318) = ( 7.0000000 7.5000000 6.0000000 ) + 1319 Mg tau(1319) = ( 7.0000000 7.5000000 5.5000000 ) + 1320 O tau(1320) = ( 7.5000000 8.0000000 6.0000000 ) + 1321 Mg tau(1321) = ( 3.0000000 3.0000000 6.0000000 ) + 1322 O tau(1322) = ( 3.5000000 3.5000000 6.5000000 ) + 1323 Mg tau(1323) = ( 3.5000000 3.5000000 6.0000000 ) + 1324 O tau(1324) = ( 4.0000000 4.0000000 6.5000000 ) + 1325 Mg tau(1325) = ( 4.0000000 4.0000000 6.0000000 ) + 1326 O tau(1326) = ( 4.5000000 4.5000000 6.5000000 ) + 1327 Mg tau(1327) = ( 4.5000000 4.5000000 6.0000000 ) + 1328 O tau(1328) = ( 5.0000000 5.0000000 6.5000000 ) + 1329 Mg tau(1329) = ( 5.0000000 5.0000000 6.0000000 ) + 1330 O tau(1330) = ( 5.5000000 5.5000000 6.5000000 ) + 1331 Mg tau(1331) = ( 5.5000000 5.5000000 6.0000000 ) + 1332 O tau(1332) = ( 6.0000000 6.0000000 6.5000000 ) + 1333 Mg tau(1333) = ( 6.0000000 6.0000000 6.0000000 ) + 1334 O tau(1334) = ( 6.5000000 6.5000000 6.5000000 ) + 1335 Mg tau(1335) = ( 6.5000000 6.5000000 6.0000000 ) + 1336 O tau(1336) = ( 7.0000000 7.0000000 6.5000000 ) + 1337 Mg tau(1337) = ( 7.0000000 7.0000000 6.0000000 ) + 1338 O tau(1338) = ( 7.5000000 7.5000000 6.5000000 ) + 1339 Mg tau(1339) = ( 7.5000000 7.5000000 6.0000000 ) + 1340 O tau(1340) = ( 8.0000000 8.0000000 6.5000000 ) + 1341 Mg tau(1341) = ( 3.5000000 3.0000000 6.5000000 ) + 1342 O tau(1342) = ( 4.0000000 3.5000000 7.0000000 ) + 1343 Mg tau(1343) = ( 4.0000000 3.5000000 6.5000000 ) + 1344 O tau(1344) = ( 4.5000000 4.0000000 7.0000000 ) + 1345 Mg tau(1345) = ( 4.5000000 4.0000000 6.5000000 ) + 1346 O tau(1346) = ( 5.0000000 4.5000000 7.0000000 ) + 1347 Mg tau(1347) = ( 5.0000000 4.5000000 6.5000000 ) + 1348 O tau(1348) = ( 5.5000000 5.0000000 7.0000000 ) + 1349 Mg tau(1349) = ( 5.5000000 5.0000000 6.5000000 ) + 1350 O tau(1350) = ( 6.0000000 5.5000000 7.0000000 ) + 1351 Mg tau(1351) = ( 6.0000000 5.5000000 6.5000000 ) + 1352 O tau(1352) = ( 6.5000000 6.0000000 7.0000000 ) + 1353 Mg tau(1353) = ( 6.5000000 6.0000000 6.5000000 ) + 1354 O tau(1354) = ( 7.0000000 6.5000000 7.0000000 ) + 1355 Mg tau(1355) = ( 7.0000000 6.5000000 6.5000000 ) + 1356 O tau(1356) = ( 7.5000000 7.0000000 7.0000000 ) + 1357 Mg tau(1357) = ( 7.5000000 7.0000000 6.5000000 ) + 1358 O tau(1358) = ( 8.0000000 7.5000000 7.0000000 ) + 1359 Mg tau(1359) = ( 8.0000000 7.5000000 6.5000000 ) + 1360 O tau(1360) = ( 8.5000000 8.0000000 7.0000000 ) + 1361 Mg tau(1361) = ( 4.0000000 3.0000000 7.0000000 ) + 1362 O tau(1362) = ( 4.5000000 3.5000000 7.5000000 ) + 1363 Mg tau(1363) = ( 4.5000000 3.5000000 7.0000000 ) + 1364 O tau(1364) = ( 5.0000000 4.0000000 7.5000000 ) + 1365 Mg tau(1365) = ( 5.0000000 4.0000000 7.0000000 ) + 1366 O tau(1366) = ( 5.5000000 4.5000000 7.5000000 ) + 1367 Mg tau(1367) = ( 5.5000000 4.5000000 7.0000000 ) + 1368 O tau(1368) = ( 6.0000000 5.0000000 7.5000000 ) + 1369 Mg tau(1369) = ( 6.0000000 5.0000000 7.0000000 ) + 1370 O tau(1370) = ( 6.5000000 5.5000000 7.5000000 ) + 1371 Mg tau(1371) = ( 6.5000000 5.5000000 7.0000000 ) + 1372 O tau(1372) = ( 7.0000000 6.0000000 7.5000000 ) + 1373 Mg tau(1373) = ( 7.0000000 6.0000000 7.0000000 ) + 1374 O tau(1374) = ( 7.5000000 6.5000000 7.5000000 ) + 1375 Mg tau(1375) = ( 7.5000000 6.5000000 7.0000000 ) + 1376 O tau(1376) = ( 8.0000000 7.0000000 7.5000000 ) + 1377 Mg tau(1377) = ( 8.0000000 7.0000000 7.0000000 ) + 1378 O tau(1378) = ( 8.5000000 7.5000000 7.5000000 ) + 1379 Mg tau(1379) = ( 8.5000000 7.5000000 7.0000000 ) + 1380 O tau(1380) = ( 9.0000000 8.0000000 7.5000000 ) + 1381 Mg tau(1381) = ( 4.5000000 3.0000000 7.5000000 ) + 1382 O tau(1382) = ( 5.0000000 3.5000000 8.0000000 ) + 1383 Mg tau(1383) = ( 5.0000000 3.5000000 7.5000000 ) + 1384 O tau(1384) = ( 5.5000000 4.0000000 8.0000000 ) + 1385 Mg tau(1385) = ( 5.5000000 4.0000000 7.5000000 ) + 1386 O tau(1386) = ( 6.0000000 4.5000000 8.0000000 ) + 1387 Mg tau(1387) = ( 6.0000000 4.5000000 7.5000000 ) + 1388 O tau(1388) = ( 6.5000000 5.0000000 8.0000000 ) + 1389 Mg tau(1389) = ( 6.5000000 5.0000000 7.5000000 ) + 1390 O tau(1390) = ( 7.0000000 5.5000000 8.0000000 ) + 1391 Mg tau(1391) = ( 7.0000000 5.5000000 7.5000000 ) + 1392 O tau(1392) = ( 7.5000000 6.0000000 8.0000000 ) + 1393 Mg tau(1393) = ( 7.5000000 6.0000000 7.5000000 ) + 1394 O tau(1394) = ( 8.0000000 6.5000000 8.0000000 ) + 1395 Mg tau(1395) = ( 8.0000000 6.5000000 7.5000000 ) + 1396 O tau(1396) = ( 8.5000000 7.0000000 8.0000000 ) + 1397 Mg tau(1397) = ( 8.5000000 7.0000000 7.5000000 ) + 1398 O tau(1398) = ( 9.0000000 7.5000000 8.0000000 ) + 1399 Mg tau(1399) = ( 9.0000000 7.5000000 7.5000000 ) + 1400 O tau(1400) = ( 9.5000000 8.0000000 8.0000000 ) + 1401 Mg tau(1401) = ( 0.0000000 3.5000000 3.5000000 ) + 1402 O tau(1402) = ( 0.5000000 4.0000000 4.0000000 ) + 1403 Mg tau(1403) = ( 0.5000000 4.0000000 3.5000000 ) + 1404 O tau(1404) = ( 1.0000000 4.5000000 4.0000000 ) + 1405 Mg tau(1405) = ( 1.0000000 4.5000000 3.5000000 ) + 1406 O tau(1406) = ( 1.5000000 5.0000000 4.0000000 ) + 1407 Mg tau(1407) = ( 1.5000000 5.0000000 3.5000000 ) + 1408 O tau(1408) = ( 2.0000000 5.5000000 4.0000000 ) + 1409 Mg tau(1409) = ( 2.0000000 5.5000000 3.5000000 ) + 1410 O tau(1410) = ( 2.5000000 6.0000000 4.0000000 ) + 1411 Mg tau(1411) = ( 2.5000000 6.0000000 3.5000000 ) + 1412 O tau(1412) = ( 3.0000000 6.5000000 4.0000000 ) + 1413 Mg tau(1413) = ( 3.0000000 6.5000000 3.5000000 ) + 1414 O tau(1414) = ( 3.5000000 7.0000000 4.0000000 ) + 1415 Mg tau(1415) = ( 3.5000000 7.0000000 3.5000000 ) + 1416 O tau(1416) = ( 4.0000000 7.5000000 4.0000000 ) + 1417 Mg tau(1417) = ( 4.0000000 7.5000000 3.5000000 ) + 1418 O tau(1418) = ( 4.5000000 8.0000000 4.0000000 ) + 1419 Mg tau(1419) = ( 4.5000000 8.0000000 3.5000000 ) + 1420 O tau(1420) = ( 5.0000000 8.5000000 4.0000000 ) + 1421 Mg tau(1421) = ( 0.5000000 3.5000000 4.0000000 ) + 1422 O tau(1422) = ( 1.0000000 4.0000000 4.5000000 ) + 1423 Mg tau(1423) = ( 1.0000000 4.0000000 4.0000000 ) + 1424 O tau(1424) = ( 1.5000000 4.5000000 4.5000000 ) + 1425 Mg tau(1425) = ( 1.5000000 4.5000000 4.0000000 ) + 1426 O tau(1426) = ( 2.0000000 5.0000000 4.5000000 ) + 1427 Mg tau(1427) = ( 2.0000000 5.0000000 4.0000000 ) + 1428 O tau(1428) = ( 2.5000000 5.5000000 4.5000000 ) + 1429 Mg tau(1429) = ( 2.5000000 5.5000000 4.0000000 ) + 1430 O tau(1430) = ( 3.0000000 6.0000000 4.5000000 ) + 1431 Mg tau(1431) = ( 3.0000000 6.0000000 4.0000000 ) + 1432 O tau(1432) = ( 3.5000000 6.5000000 4.5000000 ) + 1433 Mg tau(1433) = ( 3.5000000 6.5000000 4.0000000 ) + 1434 O tau(1434) = ( 4.0000000 7.0000000 4.5000000 ) + 1435 Mg tau(1435) = ( 4.0000000 7.0000000 4.0000000 ) + 1436 O tau(1436) = ( 4.5000000 7.5000000 4.5000000 ) + 1437 Mg tau(1437) = ( 4.5000000 7.5000000 4.0000000 ) + 1438 O tau(1438) = ( 5.0000000 8.0000000 4.5000000 ) + 1439 Mg tau(1439) = ( 5.0000000 8.0000000 4.0000000 ) + 1440 O tau(1440) = ( 5.5000000 8.5000000 4.5000000 ) + 1441 Mg tau(1441) = ( 1.0000000 3.5000000 4.5000000 ) + 1442 O tau(1442) = ( 1.5000000 4.0000000 5.0000000 ) + 1443 Mg tau(1443) = ( 1.5000000 4.0000000 4.5000000 ) + 1444 O tau(1444) = ( 2.0000000 4.5000000 5.0000000 ) + 1445 Mg tau(1445) = ( 2.0000000 4.5000000 4.5000000 ) + 1446 O tau(1446) = ( 2.5000000 5.0000000 5.0000000 ) + 1447 Mg tau(1447) = ( 2.5000000 5.0000000 4.5000000 ) + 1448 O tau(1448) = ( 3.0000000 5.5000000 5.0000000 ) + 1449 Mg tau(1449) = ( 3.0000000 5.5000000 4.5000000 ) + 1450 O tau(1450) = ( 3.5000000 6.0000000 5.0000000 ) + 1451 Mg tau(1451) = ( 3.5000000 6.0000000 4.5000000 ) + 1452 O tau(1452) = ( 4.0000000 6.5000000 5.0000000 ) + 1453 Mg tau(1453) = ( 4.0000000 6.5000000 4.5000000 ) + 1454 O tau(1454) = ( 4.5000000 7.0000000 5.0000000 ) + 1455 Mg tau(1455) = ( 4.5000000 7.0000000 4.5000000 ) + 1456 O tau(1456) = ( 5.0000000 7.5000000 5.0000000 ) + 1457 Mg tau(1457) = ( 5.0000000 7.5000000 4.5000000 ) + 1458 O tau(1458) = ( 5.5000000 8.0000000 5.0000000 ) + 1459 Mg tau(1459) = ( 5.5000000 8.0000000 4.5000000 ) + 1460 O tau(1460) = ( 6.0000000 8.5000000 5.0000000 ) + 1461 Mg tau(1461) = ( 1.5000000 3.5000000 5.0000000 ) + 1462 O tau(1462) = ( 2.0000000 4.0000000 5.5000000 ) + 1463 Mg tau(1463) = ( 2.0000000 4.0000000 5.0000000 ) + 1464 O tau(1464) = ( 2.5000000 4.5000000 5.5000000 ) + 1465 Mg tau(1465) = ( 2.5000000 4.5000000 5.0000000 ) + 1466 O tau(1466) = ( 3.0000000 5.0000000 5.5000000 ) + 1467 Mg tau(1467) = ( 3.0000000 5.0000000 5.0000000 ) + 1468 O tau(1468) = ( 3.5000000 5.5000000 5.5000000 ) + 1469 Mg tau(1469) = ( 3.5000000 5.5000000 5.0000000 ) + 1470 O tau(1470) = ( 4.0000000 6.0000000 5.5000000 ) + 1471 Mg tau(1471) = ( 4.0000000 6.0000000 5.0000000 ) + 1472 O tau(1472) = ( 4.5000000 6.5000000 5.5000000 ) + 1473 Mg tau(1473) = ( 4.5000000 6.5000000 5.0000000 ) + 1474 O tau(1474) = ( 5.0000000 7.0000000 5.5000000 ) + 1475 Mg tau(1475) = ( 5.0000000 7.0000000 5.0000000 ) + 1476 O tau(1476) = ( 5.5000000 7.5000000 5.5000000 ) + 1477 Mg tau(1477) = ( 5.5000000 7.5000000 5.0000000 ) + 1478 O tau(1478) = ( 6.0000000 8.0000000 5.5000000 ) + 1479 Mg tau(1479) = ( 6.0000000 8.0000000 5.0000000 ) + 1480 O tau(1480) = ( 6.5000000 8.5000000 5.5000000 ) + 1481 Mg tau(1481) = ( 2.0000000 3.5000000 5.5000000 ) + 1482 O tau(1482) = ( 2.5000000 4.0000000 6.0000000 ) + 1483 Mg tau(1483) = ( 2.5000000 4.0000000 5.5000000 ) + 1484 O tau(1484) = ( 3.0000000 4.5000000 6.0000000 ) + 1485 Mg tau(1485) = ( 3.0000000 4.5000000 5.5000000 ) + 1486 O tau(1486) = ( 3.5000000 5.0000000 6.0000000 ) + 1487 Mg tau(1487) = ( 3.5000000 5.0000000 5.5000000 ) + 1488 O tau(1488) = ( 4.0000000 5.5000000 6.0000000 ) + 1489 Mg tau(1489) = ( 4.0000000 5.5000000 5.5000000 ) + 1490 O tau(1490) = ( 4.5000000 6.0000000 6.0000000 ) + 1491 Mg tau(1491) = ( 4.5000000 6.0000000 5.5000000 ) + 1492 O tau(1492) = ( 5.0000000 6.5000000 6.0000000 ) + 1493 Mg tau(1493) = ( 5.0000000 6.5000000 5.5000000 ) + 1494 O tau(1494) = ( 5.5000000 7.0000000 6.0000000 ) + 1495 Mg tau(1495) = ( 5.5000000 7.0000000 5.5000000 ) + 1496 O tau(1496) = ( 6.0000000 7.5000000 6.0000000 ) + 1497 Mg tau(1497) = ( 6.0000000 7.5000000 5.5000000 ) + 1498 O tau(1498) = ( 6.5000000 8.0000000 6.0000000 ) + 1499 Mg tau(1499) = ( 6.5000000 8.0000000 5.5000000 ) + 1500 O tau(1500) = ( 7.0000000 8.5000000 6.0000000 ) + 1501 Mg tau(1501) = ( 2.5000000 3.5000000 6.0000000 ) + 1502 O tau(1502) = ( 3.0000000 4.0000000 6.5000000 ) + 1503 Mg tau(1503) = ( 3.0000000 4.0000000 6.0000000 ) + 1504 O tau(1504) = ( 3.5000000 4.5000000 6.5000000 ) + 1505 Mg tau(1505) = ( 3.5000000 4.5000000 6.0000000 ) + 1506 O tau(1506) = ( 4.0000000 5.0000000 6.5000000 ) + 1507 Mg tau(1507) = ( 4.0000000 5.0000000 6.0000000 ) + 1508 O tau(1508) = ( 4.5000000 5.5000000 6.5000000 ) + 1509 Mg tau(1509) = ( 4.5000000 5.5000000 6.0000000 ) + 1510 O tau(1510) = ( 5.0000000 6.0000000 6.5000000 ) + 1511 Mg tau(1511) = ( 5.0000000 6.0000000 6.0000000 ) + 1512 O tau(1512) = ( 5.5000000 6.5000000 6.5000000 ) + 1513 Mg tau(1513) = ( 5.5000000 6.5000000 6.0000000 ) + 1514 O tau(1514) = ( 6.0000000 7.0000000 6.5000000 ) + 1515 Mg tau(1515) = ( 6.0000000 7.0000000 6.0000000 ) + 1516 O tau(1516) = ( 6.5000000 7.5000000 6.5000000 ) + 1517 Mg tau(1517) = ( 6.5000000 7.5000000 6.0000000 ) + 1518 O tau(1518) = ( 7.0000000 8.0000000 6.5000000 ) + 1519 Mg tau(1519) = ( 7.0000000 8.0000000 6.0000000 ) + 1520 O tau(1520) = ( 7.5000000 8.5000000 6.5000000 ) + 1521 Mg tau(1521) = ( 3.0000000 3.5000000 6.5000000 ) + 1522 O tau(1522) = ( 3.5000000 4.0000000 7.0000000 ) + 1523 Mg tau(1523) = ( 3.5000000 4.0000000 6.5000000 ) + 1524 O tau(1524) = ( 4.0000000 4.5000000 7.0000000 ) + 1525 Mg tau(1525) = ( 4.0000000 4.5000000 6.5000000 ) + 1526 O tau(1526) = ( 4.5000000 5.0000000 7.0000000 ) + 1527 Mg tau(1527) = ( 4.5000000 5.0000000 6.5000000 ) + 1528 O tau(1528) = ( 5.0000000 5.5000000 7.0000000 ) + 1529 Mg tau(1529) = ( 5.0000000 5.5000000 6.5000000 ) + 1530 O tau(1530) = ( 5.5000000 6.0000000 7.0000000 ) + 1531 Mg tau(1531) = ( 5.5000000 6.0000000 6.5000000 ) + 1532 O tau(1532) = ( 6.0000000 6.5000000 7.0000000 ) + 1533 Mg tau(1533) = ( 6.0000000 6.5000000 6.5000000 ) + 1534 O tau(1534) = ( 6.5000000 7.0000000 7.0000000 ) + 1535 Mg tau(1535) = ( 6.5000000 7.0000000 6.5000000 ) + 1536 O tau(1536) = ( 7.0000000 7.5000000 7.0000000 ) + 1537 Mg tau(1537) = ( 7.0000000 7.5000000 6.5000000 ) + 1538 O tau(1538) = ( 7.5000000 8.0000000 7.0000000 ) + 1539 Mg tau(1539) = ( 7.5000000 8.0000000 6.5000000 ) + 1540 O tau(1540) = ( 8.0000000 8.5000000 7.0000000 ) + 1541 Mg tau(1541) = ( 3.5000000 3.5000000 7.0000000 ) + 1542 O tau(1542) = ( 4.0000000 4.0000000 7.5000000 ) + 1543 Mg tau(1543) = ( 4.0000000 4.0000000 7.0000000 ) + 1544 O tau(1544) = ( 4.5000000 4.5000000 7.5000000 ) + 1545 Mg tau(1545) = ( 4.5000000 4.5000000 7.0000000 ) + 1546 O tau(1546) = ( 5.0000000 5.0000000 7.5000000 ) + 1547 Mg tau(1547) = ( 5.0000000 5.0000000 7.0000000 ) + 1548 O tau(1548) = ( 5.5000000 5.5000000 7.5000000 ) + 1549 Mg tau(1549) = ( 5.5000000 5.5000000 7.0000000 ) + 1550 O tau(1550) = ( 6.0000000 6.0000000 7.5000000 ) + 1551 Mg tau(1551) = ( 6.0000000 6.0000000 7.0000000 ) + 1552 O tau(1552) = ( 6.5000000 6.5000000 7.5000000 ) + 1553 Mg tau(1553) = ( 6.5000000 6.5000000 7.0000000 ) + 1554 O tau(1554) = ( 7.0000000 7.0000000 7.5000000 ) + 1555 Mg tau(1555) = ( 7.0000000 7.0000000 7.0000000 ) + 1556 O tau(1556) = ( 7.5000000 7.5000000 7.5000000 ) + 1557 Mg tau(1557) = ( 7.5000000 7.5000000 7.0000000 ) + 1558 O tau(1558) = ( 8.0000000 8.0000000 7.5000000 ) + 1559 Mg tau(1559) = ( 8.0000000 8.0000000 7.0000000 ) + 1560 O tau(1560) = ( 8.5000000 8.5000000 7.5000000 ) + 1561 Mg tau(1561) = ( 4.0000000 3.5000000 7.5000000 ) + 1562 O tau(1562) = ( 4.5000000 4.0000000 8.0000000 ) + 1563 Mg tau(1563) = ( 4.5000000 4.0000000 7.5000000 ) + 1564 O tau(1564) = ( 5.0000000 4.5000000 8.0000000 ) + 1565 Mg tau(1565) = ( 5.0000000 4.5000000 7.5000000 ) + 1566 O tau(1566) = ( 5.5000000 5.0000000 8.0000000 ) + 1567 Mg tau(1567) = ( 5.5000000 5.0000000 7.5000000 ) + 1568 O tau(1568) = ( 6.0000000 5.5000000 8.0000000 ) + 1569 Mg tau(1569) = ( 6.0000000 5.5000000 7.5000000 ) + 1570 O tau(1570) = ( 6.5000000 6.0000000 8.0000000 ) + 1571 Mg tau(1571) = ( 6.5000000 6.0000000 7.5000000 ) + 1572 O tau(1572) = ( 7.0000000 6.5000000 8.0000000 ) + 1573 Mg tau(1573) = ( 7.0000000 6.5000000 7.5000000 ) + 1574 O tau(1574) = ( 7.5000000 7.0000000 8.0000000 ) + 1575 Mg tau(1575) = ( 7.5000000 7.0000000 7.5000000 ) + 1576 O tau(1576) = ( 8.0000000 7.5000000 8.0000000 ) + 1577 Mg tau(1577) = ( 8.0000000 7.5000000 7.5000000 ) + 1578 O tau(1578) = ( 8.5000000 8.0000000 8.0000000 ) + 1579 Mg tau(1579) = ( 8.5000000 8.0000000 7.5000000 ) + 1580 O tau(1580) = ( 9.0000000 8.5000000 8.0000000 ) + 1581 Mg tau(1581) = ( 4.5000000 3.5000000 8.0000000 ) + 1582 O tau(1582) = ( 5.0000000 4.0000000 8.5000000 ) + 1583 Mg tau(1583) = ( 5.0000000 4.0000000 8.0000000 ) + 1584 O tau(1584) = ( 5.5000000 4.5000000 8.5000000 ) + 1585 Mg tau(1585) = ( 5.5000000 4.5000000 8.0000000 ) + 1586 O tau(1586) = ( 6.0000000 5.0000000 8.5000000 ) + 1587 Mg tau(1587) = ( 6.0000000 5.0000000 8.0000000 ) + 1588 O tau(1588) = ( 6.5000000 5.5000000 8.5000000 ) + 1589 Mg tau(1589) = ( 6.5000000 5.5000000 8.0000000 ) + 1590 O tau(1590) = ( 7.0000000 6.0000000 8.5000000 ) + 1591 Mg tau(1591) = ( 7.0000000 6.0000000 8.0000000 ) + 1592 O tau(1592) = ( 7.5000000 6.5000000 8.5000000 ) + 1593 Mg tau(1593) = ( 7.5000000 6.5000000 8.0000000 ) + 1594 O tau(1594) = ( 8.0000000 7.0000000 8.5000000 ) + 1595 Mg tau(1595) = ( 8.0000000 7.0000000 8.0000000 ) + 1596 O tau(1596) = ( 8.5000000 7.5000000 8.5000000 ) + 1597 Mg tau(1597) = ( 8.5000000 7.5000000 8.0000000 ) + 1598 O tau(1598) = ( 9.0000000 8.0000000 8.5000000 ) + 1599 Mg tau(1599) = ( 9.0000000 8.0000000 8.0000000 ) + 1600 O tau(1600) = ( 9.5000000 8.5000000 8.5000000 ) + 1601 Mg tau(1601) = ( 0.0000000 4.0000000 4.0000000 ) + 1602 O tau(1602) = ( 0.5000000 4.5000000 4.5000000 ) + 1603 Mg tau(1603) = ( 0.5000000 4.5000000 4.0000000 ) + 1604 O tau(1604) = ( 1.0000000 5.0000000 4.5000000 ) + 1605 Mg tau(1605) = ( 1.0000000 5.0000000 4.0000000 ) + 1606 O tau(1606) = ( 1.5000000 5.5000000 4.5000000 ) + 1607 Mg tau(1607) = ( 1.5000000 5.5000000 4.0000000 ) + 1608 O tau(1608) = ( 2.0000000 6.0000000 4.5000000 ) + 1609 Mg tau(1609) = ( 2.0000000 6.0000000 4.0000000 ) + 1610 O tau(1610) = ( 2.5000000 6.5000000 4.5000000 ) + 1611 Mg tau(1611) = ( 2.5000000 6.5000000 4.0000000 ) + 1612 O tau(1612) = ( 3.0000000 7.0000000 4.5000000 ) + 1613 Mg tau(1613) = ( 3.0000000 7.0000000 4.0000000 ) + 1614 O tau(1614) = ( 3.5000000 7.5000000 4.5000000 ) + 1615 Mg tau(1615) = ( 3.5000000 7.5000000 4.0000000 ) + 1616 O tau(1616) = ( 4.0000000 8.0000000 4.5000000 ) + 1617 Mg tau(1617) = ( 4.0000000 8.0000000 4.0000000 ) + 1618 O tau(1618) = ( 4.5000000 8.5000000 4.5000000 ) + 1619 Mg tau(1619) = ( 4.5000000 8.5000000 4.0000000 ) + 1620 O tau(1620) = ( 5.0000000 9.0000000 4.5000000 ) + 1621 Mg tau(1621) = ( 0.5000000 4.0000000 4.5000000 ) + 1622 O tau(1622) = ( 1.0000000 4.5000000 5.0000000 ) + 1623 Mg tau(1623) = ( 1.0000000 4.5000000 4.5000000 ) + 1624 O tau(1624) = ( 1.5000000 5.0000000 5.0000000 ) + 1625 Mg tau(1625) = ( 1.5000000 5.0000000 4.5000000 ) + 1626 O tau(1626) = ( 2.0000000 5.5000000 5.0000000 ) + 1627 Mg tau(1627) = ( 2.0000000 5.5000000 4.5000000 ) + 1628 O tau(1628) = ( 2.5000000 6.0000000 5.0000000 ) + 1629 Mg tau(1629) = ( 2.5000000 6.0000000 4.5000000 ) + 1630 O tau(1630) = ( 3.0000000 6.5000000 5.0000000 ) + 1631 Mg tau(1631) = ( 3.0000000 6.5000000 4.5000000 ) + 1632 O tau(1632) = ( 3.5000000 7.0000000 5.0000000 ) + 1633 Mg tau(1633) = ( 3.5000000 7.0000000 4.5000000 ) + 1634 O tau(1634) = ( 4.0000000 7.5000000 5.0000000 ) + 1635 Mg tau(1635) = ( 4.0000000 7.5000000 4.5000000 ) + 1636 O tau(1636) = ( 4.5000000 8.0000000 5.0000000 ) + 1637 Mg tau(1637) = ( 4.5000000 8.0000000 4.5000000 ) + 1638 O tau(1638) = ( 5.0000000 8.5000000 5.0000000 ) + 1639 Mg tau(1639) = ( 5.0000000 8.5000000 4.5000000 ) + 1640 O tau(1640) = ( 5.5000000 9.0000000 5.0000000 ) + 1641 Mg tau(1641) = ( 1.0000000 4.0000000 5.0000000 ) + 1642 O tau(1642) = ( 1.5000000 4.5000000 5.5000000 ) + 1643 Mg tau(1643) = ( 1.5000000 4.5000000 5.0000000 ) + 1644 O tau(1644) = ( 2.0000000 5.0000000 5.5000000 ) + 1645 Mg tau(1645) = ( 2.0000000 5.0000000 5.0000000 ) + 1646 O tau(1646) = ( 2.5000000 5.5000000 5.5000000 ) + 1647 Mg tau(1647) = ( 2.5000000 5.5000000 5.0000000 ) + 1648 O tau(1648) = ( 3.0000000 6.0000000 5.5000000 ) + 1649 Mg tau(1649) = ( 3.0000000 6.0000000 5.0000000 ) + 1650 O tau(1650) = ( 3.5000000 6.5000000 5.5000000 ) + 1651 Mg tau(1651) = ( 3.5000000 6.5000000 5.0000000 ) + 1652 O tau(1652) = ( 4.0000000 7.0000000 5.5000000 ) + 1653 Mg tau(1653) = ( 4.0000000 7.0000000 5.0000000 ) + 1654 O tau(1654) = ( 4.5000000 7.5000000 5.5000000 ) + 1655 Mg tau(1655) = ( 4.5000000 7.5000000 5.0000000 ) + 1656 O tau(1656) = ( 5.0000000 8.0000000 5.5000000 ) + 1657 Mg tau(1657) = ( 5.0000000 8.0000000 5.0000000 ) + 1658 O tau(1658) = ( 5.5000000 8.5000000 5.5000000 ) + 1659 Mg tau(1659) = ( 5.5000000 8.5000000 5.0000000 ) + 1660 O tau(1660) = ( 6.0000000 9.0000000 5.5000000 ) + 1661 Mg tau(1661) = ( 1.5000000 4.0000000 5.5000000 ) + 1662 O tau(1662) = ( 2.0000000 4.5000000 6.0000000 ) + 1663 Mg tau(1663) = ( 2.0000000 4.5000000 5.5000000 ) + 1664 O tau(1664) = ( 2.5000000 5.0000000 6.0000000 ) + 1665 Mg tau(1665) = ( 2.5000000 5.0000000 5.5000000 ) + 1666 O tau(1666) = ( 3.0000000 5.5000000 6.0000000 ) + 1667 Mg tau(1667) = ( 3.0000000 5.5000000 5.5000000 ) + 1668 O tau(1668) = ( 3.5000000 6.0000000 6.0000000 ) + 1669 Mg tau(1669) = ( 3.5000000 6.0000000 5.5000000 ) + 1670 O tau(1670) = ( 4.0000000 6.5000000 6.0000000 ) + 1671 Mg tau(1671) = ( 4.0000000 6.5000000 5.5000000 ) + 1672 O tau(1672) = ( 4.5000000 7.0000000 6.0000000 ) + 1673 Mg tau(1673) = ( 4.5000000 7.0000000 5.5000000 ) + 1674 O tau(1674) = ( 5.0000000 7.5000000 6.0000000 ) + 1675 Mg tau(1675) = ( 5.0000000 7.5000000 5.5000000 ) + 1676 O tau(1676) = ( 5.5000000 8.0000000 6.0000000 ) + 1677 Mg tau(1677) = ( 5.5000000 8.0000000 5.5000000 ) + 1678 O tau(1678) = ( 6.0000000 8.5000000 6.0000000 ) + 1679 Mg tau(1679) = ( 6.0000000 8.5000000 5.5000000 ) + 1680 O tau(1680) = ( 6.5000000 9.0000000 6.0000000 ) + 1681 Mg tau(1681) = ( 2.0000000 4.0000000 6.0000000 ) + 1682 O tau(1682) = ( 2.5000000 4.5000000 6.5000000 ) + 1683 Mg tau(1683) = ( 2.5000000 4.5000000 6.0000000 ) + 1684 O tau(1684) = ( 3.0000000 5.0000000 6.5000000 ) + 1685 Mg tau(1685) = ( 3.0000000 5.0000000 6.0000000 ) + 1686 O tau(1686) = ( 3.5000000 5.5000000 6.5000000 ) + 1687 Mg tau(1687) = ( 3.5000000 5.5000000 6.0000000 ) + 1688 O tau(1688) = ( 4.0000000 6.0000000 6.5000000 ) + 1689 Mg tau(1689) = ( 4.0000000 6.0000000 6.0000000 ) + 1690 O tau(1690) = ( 4.5000000 6.5000000 6.5000000 ) + 1691 Mg tau(1691) = ( 4.5000000 6.5000000 6.0000000 ) + 1692 O tau(1692) = ( 5.0000000 7.0000000 6.5000000 ) + 1693 Mg tau(1693) = ( 5.0000000 7.0000000 6.0000000 ) + 1694 O tau(1694) = ( 5.5000000 7.5000000 6.5000000 ) + 1695 Mg tau(1695) = ( 5.5000000 7.5000000 6.0000000 ) + 1696 O tau(1696) = ( 6.0000000 8.0000000 6.5000000 ) + 1697 Mg tau(1697) = ( 6.0000000 8.0000000 6.0000000 ) + 1698 O tau(1698) = ( 6.5000000 8.5000000 6.5000000 ) + 1699 Mg tau(1699) = ( 6.5000000 8.5000000 6.0000000 ) + 1700 O tau(1700) = ( 7.0000000 9.0000000 6.5000000 ) + 1701 Mg tau(1701) = ( 2.5000000 4.0000000 6.5000000 ) + 1702 O tau(1702) = ( 3.0000000 4.5000000 7.0000000 ) + 1703 Mg tau(1703) = ( 3.0000000 4.5000000 6.5000000 ) + 1704 O tau(1704) = ( 3.5000000 5.0000000 7.0000000 ) + 1705 Mg tau(1705) = ( 3.5000000 5.0000000 6.5000000 ) + 1706 O tau(1706) = ( 4.0000000 5.5000000 7.0000000 ) + 1707 Mg tau(1707) = ( 4.0000000 5.5000000 6.5000000 ) + 1708 O tau(1708) = ( 4.5000000 6.0000000 7.0000000 ) + 1709 Mg tau(1709) = ( 4.5000000 6.0000000 6.5000000 ) + 1710 O tau(1710) = ( 5.0000000 6.5000000 7.0000000 ) + 1711 Mg tau(1711) = ( 5.0000000 6.5000000 6.5000000 ) + 1712 O tau(1712) = ( 5.5000000 7.0000000 7.0000000 ) + 1713 Mg tau(1713) = ( 5.5000000 7.0000000 6.5000000 ) + 1714 O tau(1714) = ( 6.0000000 7.5000000 7.0000000 ) + 1715 Mg tau(1715) = ( 6.0000000 7.5000000 6.5000000 ) + 1716 O tau(1716) = ( 6.5000000 8.0000000 7.0000000 ) + 1717 Mg tau(1717) = ( 6.5000000 8.0000000 6.5000000 ) + 1718 O tau(1718) = ( 7.0000000 8.5000000 7.0000000 ) + 1719 Mg tau(1719) = ( 7.0000000 8.5000000 6.5000000 ) + 1720 O tau(1720) = ( 7.5000000 9.0000000 7.0000000 ) + 1721 Mg tau(1721) = ( 3.0000000 4.0000000 7.0000000 ) + 1722 O tau(1722) = ( 3.5000000 4.5000000 7.5000000 ) + 1723 Mg tau(1723) = ( 3.5000000 4.5000000 7.0000000 ) + 1724 O tau(1724) = ( 4.0000000 5.0000000 7.5000000 ) + 1725 Mg tau(1725) = ( 4.0000000 5.0000000 7.0000000 ) + 1726 O tau(1726) = ( 4.5000000 5.5000000 7.5000000 ) + 1727 Mg tau(1727) = ( 4.5000000 5.5000000 7.0000000 ) + 1728 O tau(1728) = ( 5.0000000 6.0000000 7.5000000 ) + 1729 Mg tau(1729) = ( 5.0000000 6.0000000 7.0000000 ) + 1730 O tau(1730) = ( 5.5000000 6.5000000 7.5000000 ) + 1731 Mg tau(1731) = ( 5.5000000 6.5000000 7.0000000 ) + 1732 O tau(1732) = ( 6.0000000 7.0000000 7.5000000 ) + 1733 Mg tau(1733) = ( 6.0000000 7.0000000 7.0000000 ) + 1734 O tau(1734) = ( 6.5000000 7.5000000 7.5000000 ) + 1735 Mg tau(1735) = ( 6.5000000 7.5000000 7.0000000 ) + 1736 O tau(1736) = ( 7.0000000 8.0000000 7.5000000 ) + 1737 Mg tau(1737) = ( 7.0000000 8.0000000 7.0000000 ) + 1738 O tau(1738) = ( 7.5000000 8.5000000 7.5000000 ) + 1739 Mg tau(1739) = ( 7.5000000 8.5000000 7.0000000 ) + 1740 O tau(1740) = ( 8.0000000 9.0000000 7.5000000 ) + 1741 Mg tau(1741) = ( 3.5000000 4.0000000 7.5000000 ) + 1742 O tau(1742) = ( 4.0000000 4.5000000 8.0000000 ) + 1743 Mg tau(1743) = ( 4.0000000 4.5000000 7.5000000 ) + 1744 O tau(1744) = ( 4.5000000 5.0000000 8.0000000 ) + 1745 Mg tau(1745) = ( 4.5000000 5.0000000 7.5000000 ) + 1746 O tau(1746) = ( 5.0000000 5.5000000 8.0000000 ) + 1747 Mg tau(1747) = ( 5.0000000 5.5000000 7.5000000 ) + 1748 O tau(1748) = ( 5.5000000 6.0000000 8.0000000 ) + 1749 Mg tau(1749) = ( 5.5000000 6.0000000 7.5000000 ) + 1750 O tau(1750) = ( 6.0000000 6.5000000 8.0000000 ) + 1751 Mg tau(1751) = ( 6.0000000 6.5000000 7.5000000 ) + 1752 O tau(1752) = ( 6.5000000 7.0000000 8.0000000 ) + 1753 Mg tau(1753) = ( 6.5000000 7.0000000 7.5000000 ) + 1754 O tau(1754) = ( 7.0000000 7.5000000 8.0000000 ) + 1755 Mg tau(1755) = ( 7.0000000 7.5000000 7.5000000 ) + 1756 O tau(1756) = ( 7.5000000 8.0000000 8.0000000 ) + 1757 Mg tau(1757) = ( 7.5000000 8.0000000 7.5000000 ) + 1758 O tau(1758) = ( 8.0000000 8.5000000 8.0000000 ) + 1759 Mg tau(1759) = ( 8.0000000 8.5000000 7.5000000 ) + 1760 O tau(1760) = ( 8.5000000 9.0000000 8.0000000 ) + 1761 Mg tau(1761) = ( 4.0000000 4.0000000 8.0000000 ) + 1762 O tau(1762) = ( 4.5000000 4.5000000 8.5000000 ) + 1763 Mg tau(1763) = ( 4.5000000 4.5000000 8.0000000 ) + 1764 O tau(1764) = ( 5.0000000 5.0000000 8.5000000 ) + 1765 Mg tau(1765) = ( 5.0000000 5.0000000 8.0000000 ) + 1766 O tau(1766) = ( 5.5000000 5.5000000 8.5000000 ) + 1767 Mg tau(1767) = ( 5.5000000 5.5000000 8.0000000 ) + 1768 O tau(1768) = ( 6.0000000 6.0000000 8.5000000 ) + 1769 Mg tau(1769) = ( 6.0000000 6.0000000 8.0000000 ) + 1770 O tau(1770) = ( 6.5000000 6.5000000 8.5000000 ) + 1771 Mg tau(1771) = ( 6.5000000 6.5000000 8.0000000 ) + 1772 O tau(1772) = ( 7.0000000 7.0000000 8.5000000 ) + 1773 Mg tau(1773) = ( 7.0000000 7.0000000 8.0000000 ) + 1774 O tau(1774) = ( 7.5000000 7.5000000 8.5000000 ) + 1775 Mg tau(1775) = ( 7.5000000 7.5000000 8.0000000 ) + 1776 O tau(1776) = ( 8.0000000 8.0000000 8.5000000 ) + 1777 Mg tau(1777) = ( 8.0000000 8.0000000 8.0000000 ) + 1778 O tau(1778) = ( 8.5000000 8.5000000 8.5000000 ) + 1779 Mg tau(1779) = ( 8.5000000 8.5000000 8.0000000 ) + 1780 O tau(1780) = ( 9.0000000 9.0000000 8.5000000 ) + 1781 Mg tau(1781) = ( 4.5000000 4.0000000 8.5000000 ) + 1782 O tau(1782) = ( 5.0000000 4.5000000 9.0000000 ) + 1783 Mg tau(1783) = ( 5.0000000 4.5000000 8.5000000 ) + 1784 O tau(1784) = ( 5.5000000 5.0000000 9.0000000 ) + 1785 Mg tau(1785) = ( 5.5000000 5.0000000 8.5000000 ) + 1786 O tau(1786) = ( 6.0000000 5.5000000 9.0000000 ) + 1787 Mg tau(1787) = ( 6.0000000 5.5000000 8.5000000 ) + 1788 O tau(1788) = ( 6.5000000 6.0000000 9.0000000 ) + 1789 Mg tau(1789) = ( 6.5000000 6.0000000 8.5000000 ) + 1790 O tau(1790) = ( 7.0000000 6.5000000 9.0000000 ) + 1791 Mg tau(1791) = ( 7.0000000 6.5000000 8.5000000 ) + 1792 O tau(1792) = ( 7.5000000 7.0000000 9.0000000 ) + 1793 Mg tau(1793) = ( 7.5000000 7.0000000 8.5000000 ) + 1794 O tau(1794) = ( 8.0000000 7.5000000 9.0000000 ) + 1795 Mg tau(1795) = ( 8.0000000 7.5000000 8.5000000 ) + 1796 O tau(1796) = ( 8.5000000 8.0000000 9.0000000 ) + 1797 Mg tau(1797) = ( 8.5000000 8.0000000 8.5000000 ) + 1798 O tau(1798) = ( 9.0000000 8.5000000 9.0000000 ) + 1799 Mg tau(1799) = ( 9.0000000 8.5000000 8.5000000 ) + 1800 O tau(1800) = ( 9.5000000 9.0000000 9.0000000 ) + 1801 Mg tau(1801) = ( 0.0000000 4.5000000 4.5000000 ) + 1802 O tau(1802) = ( 0.5000000 5.0000000 5.0000000 ) + 1803 Mg tau(1803) = ( 0.5000000 5.0000000 4.5000000 ) + 1804 O tau(1804) = ( 1.0000000 5.5000000 5.0000000 ) + 1805 Mg tau(1805) = ( 1.0000000 5.5000000 4.5000000 ) + 1806 O tau(1806) = ( 1.5000000 6.0000000 5.0000000 ) + 1807 Mg tau(1807) = ( 1.5000000 6.0000000 4.5000000 ) + 1808 O tau(1808) = ( 2.0000000 6.5000000 5.0000000 ) + 1809 Mg tau(1809) = ( 2.0000000 6.5000000 4.5000000 ) + 1810 O tau(1810) = ( 2.5000000 7.0000000 5.0000000 ) + 1811 Mg tau(1811) = ( 2.5000000 7.0000000 4.5000000 ) + 1812 O tau(1812) = ( 3.0000000 7.5000000 5.0000000 ) + 1813 Mg tau(1813) = ( 3.0000000 7.5000000 4.5000000 ) + 1814 O tau(1814) = ( 3.5000000 8.0000000 5.0000000 ) + 1815 Mg tau(1815) = ( 3.5000000 8.0000000 4.5000000 ) + 1816 O tau(1816) = ( 4.0000000 8.5000000 5.0000000 ) + 1817 Mg tau(1817) = ( 4.0000000 8.5000000 4.5000000 ) + 1818 O tau(1818) = ( 4.5000000 9.0000000 5.0000000 ) + 1819 Mg tau(1819) = ( 4.5000000 9.0000000 4.5000000 ) + 1820 O tau(1820) = ( 5.0000000 9.5000000 5.0000000 ) + 1821 Mg tau(1821) = ( 0.5000000 4.5000000 5.0000000 ) + 1822 O tau(1822) = ( 1.0000000 5.0000000 5.5000000 ) + 1823 Mg tau(1823) = ( 1.0000000 5.0000000 5.0000000 ) + 1824 O tau(1824) = ( 1.5000000 5.5000000 5.5000000 ) + 1825 Mg tau(1825) = ( 1.5000000 5.5000000 5.0000000 ) + 1826 O tau(1826) = ( 2.0000000 6.0000000 5.5000000 ) + 1827 Mg tau(1827) = ( 2.0000000 6.0000000 5.0000000 ) + 1828 O tau(1828) = ( 2.5000000 6.5000000 5.5000000 ) + 1829 Mg tau(1829) = ( 2.5000000 6.5000000 5.0000000 ) + 1830 O tau(1830) = ( 3.0000000 7.0000000 5.5000000 ) + 1831 Mg tau(1831) = ( 3.0000000 7.0000000 5.0000000 ) + 1832 O tau(1832) = ( 3.5000000 7.5000000 5.5000000 ) + 1833 Mg tau(1833) = ( 3.5000000 7.5000000 5.0000000 ) + 1834 O tau(1834) = ( 4.0000000 8.0000000 5.5000000 ) + 1835 Mg tau(1835) = ( 4.0000000 8.0000000 5.0000000 ) + 1836 O tau(1836) = ( 4.5000000 8.5000000 5.5000000 ) + 1837 Mg tau(1837) = ( 4.5000000 8.5000000 5.0000000 ) + 1838 O tau(1838) = ( 5.0000000 9.0000000 5.5000000 ) + 1839 Mg tau(1839) = ( 5.0000000 9.0000000 5.0000000 ) + 1840 O tau(1840) = ( 5.5000000 9.5000000 5.5000000 ) + 1841 Mg tau(1841) = ( 1.0000000 4.5000000 5.5000000 ) + 1842 O tau(1842) = ( 1.5000000 5.0000000 6.0000000 ) + 1843 Mg tau(1843) = ( 1.5000000 5.0000000 5.5000000 ) + 1844 O tau(1844) = ( 2.0000000 5.5000000 6.0000000 ) + 1845 Mg tau(1845) = ( 2.0000000 5.5000000 5.5000000 ) + 1846 O tau(1846) = ( 2.5000000 6.0000000 6.0000000 ) + 1847 Mg tau(1847) = ( 2.5000000 6.0000000 5.5000000 ) + 1848 O tau(1848) = ( 3.0000000 6.5000000 6.0000000 ) + 1849 Mg tau(1849) = ( 3.0000000 6.5000000 5.5000000 ) + 1850 O tau(1850) = ( 3.5000000 7.0000000 6.0000000 ) + 1851 Mg tau(1851) = ( 3.5000000 7.0000000 5.5000000 ) + 1852 O tau(1852) = ( 4.0000000 7.5000000 6.0000000 ) + 1853 Mg tau(1853) = ( 4.0000000 7.5000000 5.5000000 ) + 1854 O tau(1854) = ( 4.5000000 8.0000000 6.0000000 ) + 1855 Mg tau(1855) = ( 4.5000000 8.0000000 5.5000000 ) + 1856 O tau(1856) = ( 5.0000000 8.5000000 6.0000000 ) + 1857 Mg tau(1857) = ( 5.0000000 8.5000000 5.5000000 ) + 1858 O tau(1858) = ( 5.5000000 9.0000000 6.0000000 ) + 1859 Mg tau(1859) = ( 5.5000000 9.0000000 5.5000000 ) + 1860 O tau(1860) = ( 6.0000000 9.5000000 6.0000000 ) + 1861 Mg tau(1861) = ( 1.5000000 4.5000000 6.0000000 ) + 1862 O tau(1862) = ( 2.0000000 5.0000000 6.5000000 ) + 1863 Mg tau(1863) = ( 2.0000000 5.0000000 6.0000000 ) + 1864 O tau(1864) = ( 2.5000000 5.5000000 6.5000000 ) + 1865 Mg tau(1865) = ( 2.5000000 5.5000000 6.0000000 ) + 1866 O tau(1866) = ( 3.0000000 6.0000000 6.5000000 ) + 1867 Mg tau(1867) = ( 3.0000000 6.0000000 6.0000000 ) + 1868 O tau(1868) = ( 3.5000000 6.5000000 6.5000000 ) + 1869 Mg tau(1869) = ( 3.5000000 6.5000000 6.0000000 ) + 1870 O tau(1870) = ( 4.0000000 7.0000000 6.5000000 ) + 1871 Mg tau(1871) = ( 4.0000000 7.0000000 6.0000000 ) + 1872 O tau(1872) = ( 4.5000000 7.5000000 6.5000000 ) + 1873 Mg tau(1873) = ( 4.5000000 7.5000000 6.0000000 ) + 1874 O tau(1874) = ( 5.0000000 8.0000000 6.5000000 ) + 1875 Mg tau(1875) = ( 5.0000000 8.0000000 6.0000000 ) + 1876 O tau(1876) = ( 5.5000000 8.5000000 6.5000000 ) + 1877 Mg tau(1877) = ( 5.5000000 8.5000000 6.0000000 ) + 1878 O tau(1878) = ( 6.0000000 9.0000000 6.5000000 ) + 1879 Mg tau(1879) = ( 6.0000000 9.0000000 6.0000000 ) + 1880 O tau(1880) = ( 6.5000000 9.5000000 6.5000000 ) + 1881 Mg tau(1881) = ( 2.0000000 4.5000000 6.5000000 ) + 1882 O tau(1882) = ( 2.5000000 5.0000000 7.0000000 ) + 1883 Mg tau(1883) = ( 2.5000000 5.0000000 6.5000000 ) + 1884 O tau(1884) = ( 3.0000000 5.5000000 7.0000000 ) + 1885 Mg tau(1885) = ( 3.0000000 5.5000000 6.5000000 ) + 1886 O tau(1886) = ( 3.5000000 6.0000000 7.0000000 ) + 1887 Mg tau(1887) = ( 3.5000000 6.0000000 6.5000000 ) + 1888 O tau(1888) = ( 4.0000000 6.5000000 7.0000000 ) + 1889 Mg tau(1889) = ( 4.0000000 6.5000000 6.5000000 ) + 1890 O tau(1890) = ( 4.5000000 7.0000000 7.0000000 ) + 1891 Mg tau(1891) = ( 4.5000000 7.0000000 6.5000000 ) + 1892 O tau(1892) = ( 5.0000000 7.5000000 7.0000000 ) + 1893 Mg tau(1893) = ( 5.0000000 7.5000000 6.5000000 ) + 1894 O tau(1894) = ( 5.5000000 8.0000000 7.0000000 ) + 1895 Mg tau(1895) = ( 5.5000000 8.0000000 6.5000000 ) + 1896 O tau(1896) = ( 6.0000000 8.5000000 7.0000000 ) + 1897 Mg tau(1897) = ( 6.0000000 8.5000000 6.5000000 ) + 1898 O tau(1898) = ( 6.5000000 9.0000000 7.0000000 ) + 1899 Mg tau(1899) = ( 6.5000000 9.0000000 6.5000000 ) + 1900 O tau(1900) = ( 7.0000000 9.5000000 7.0000000 ) + 1901 Mg tau(1901) = ( 2.5000000 4.5000000 7.0000000 ) + 1902 O tau(1902) = ( 3.0000000 5.0000000 7.5000000 ) + 1903 Mg tau(1903) = ( 3.0000000 5.0000000 7.0000000 ) + 1904 O tau(1904) = ( 3.5000000 5.5000000 7.5000000 ) + 1905 Mg tau(1905) = ( 3.5000000 5.5000000 7.0000000 ) + 1906 O tau(1906) = ( 4.0000000 6.0000000 7.5000000 ) + 1907 Mg tau(1907) = ( 4.0000000 6.0000000 7.0000000 ) + 1908 O tau(1908) = ( 4.5000000 6.5000000 7.5000000 ) + 1909 Mg tau(1909) = ( 4.5000000 6.5000000 7.0000000 ) + 1910 O tau(1910) = ( 5.0000000 7.0000000 7.5000000 ) + 1911 Mg tau(1911) = ( 5.0000000 7.0000000 7.0000000 ) + 1912 O tau(1912) = ( 5.5000000 7.5000000 7.5000000 ) + 1913 Mg tau(1913) = ( 5.5000000 7.5000000 7.0000000 ) + 1914 O tau(1914) = ( 6.0000000 8.0000000 7.5000000 ) + 1915 Mg tau(1915) = ( 6.0000000 8.0000000 7.0000000 ) + 1916 O tau(1916) = ( 6.5000000 8.5000000 7.5000000 ) + 1917 Mg tau(1917) = ( 6.5000000 8.5000000 7.0000000 ) + 1918 O tau(1918) = ( 7.0000000 9.0000000 7.5000000 ) + 1919 Mg tau(1919) = ( 7.0000000 9.0000000 7.0000000 ) + 1920 O tau(1920) = ( 7.5000000 9.5000000 7.5000000 ) + 1921 Mg tau(1921) = ( 3.0000000 4.5000000 7.5000000 ) + 1922 O tau(1922) = ( 3.5000000 5.0000000 8.0000000 ) + 1923 Mg tau(1923) = ( 3.5000000 5.0000000 7.5000000 ) + 1924 O tau(1924) = ( 4.0000000 5.5000000 8.0000000 ) + 1925 Mg tau(1925) = ( 4.0000000 5.5000000 7.5000000 ) + 1926 O tau(1926) = ( 4.5000000 6.0000000 8.0000000 ) + 1927 Mg tau(1927) = ( 4.5000000 6.0000000 7.5000000 ) + 1928 O tau(1928) = ( 5.0000000 6.5000000 8.0000000 ) + 1929 Mg tau(1929) = ( 5.0000000 6.5000000 7.5000000 ) + 1930 O tau(1930) = ( 5.5000000 7.0000000 8.0000000 ) + 1931 Mg tau(1931) = ( 5.5000000 7.0000000 7.5000000 ) + 1932 O tau(1932) = ( 6.0000000 7.5000000 8.0000000 ) + 1933 Mg tau(1933) = ( 6.0000000 7.5000000 7.5000000 ) + 1934 O tau(1934) = ( 6.5000000 8.0000000 8.0000000 ) + 1935 Mg tau(1935) = ( 6.5000000 8.0000000 7.5000000 ) + 1936 O tau(1936) = ( 7.0000000 8.5000000 8.0000000 ) + 1937 Mg tau(1937) = ( 7.0000000 8.5000000 7.5000000 ) + 1938 O tau(1938) = ( 7.5000000 9.0000000 8.0000000 ) + 1939 Mg tau(1939) = ( 7.5000000 9.0000000 7.5000000 ) + 1940 O tau(1940) = ( 8.0000000 9.5000000 8.0000000 ) + 1941 Mg tau(1941) = ( 3.5000000 4.5000000 8.0000000 ) + 1942 O tau(1942) = ( 4.0000000 5.0000000 8.5000000 ) + 1943 Mg tau(1943) = ( 4.0000000 5.0000000 8.0000000 ) + 1944 O tau(1944) = ( 4.5000000 5.5000000 8.5000000 ) + 1945 Mg tau(1945) = ( 4.5000000 5.5000000 8.0000000 ) + 1946 O tau(1946) = ( 5.0000000 6.0000000 8.5000000 ) + 1947 Mg tau(1947) = ( 5.0000000 6.0000000 8.0000000 ) + 1948 O tau(1948) = ( 5.5000000 6.5000000 8.5000000 ) + 1949 Mg tau(1949) = ( 5.5000000 6.5000000 8.0000000 ) + 1950 O tau(1950) = ( 6.0000000 7.0000000 8.5000000 ) + 1951 Mg tau(1951) = ( 6.0000000 7.0000000 8.0000000 ) + 1952 O tau(1952) = ( 6.5000000 7.5000000 8.5000000 ) + 1953 Mg tau(1953) = ( 6.5000000 7.5000000 8.0000000 ) + 1954 O tau(1954) = ( 7.0000000 8.0000000 8.5000000 ) + 1955 Mg tau(1955) = ( 7.0000000 8.0000000 8.0000000 ) + 1956 O tau(1956) = ( 7.5000000 8.5000000 8.5000000 ) + 1957 Mg tau(1957) = ( 7.5000000 8.5000000 8.0000000 ) + 1958 O tau(1958) = ( 8.0000000 9.0000000 8.5000000 ) + 1959 Mg tau(1959) = ( 8.0000000 9.0000000 8.0000000 ) + 1960 O tau(1960) = ( 8.5000000 9.5000000 8.5000000 ) + 1961 Mg tau(1961) = ( 4.0000000 4.5000000 8.5000000 ) + 1962 O tau(1962) = ( 4.5000000 5.0000000 9.0000000 ) + 1963 Mg tau(1963) = ( 4.5000000 5.0000000 8.5000000 ) + 1964 O tau(1964) = ( 5.0000000 5.5000000 9.0000000 ) + 1965 Mg tau(1965) = ( 5.0000000 5.5000000 8.5000000 ) + 1966 O tau(1966) = ( 5.5000000 6.0000000 9.0000000 ) + 1967 Mg tau(1967) = ( 5.5000000 6.0000000 8.5000000 ) + 1968 O tau(1968) = ( 6.0000000 6.5000000 9.0000000 ) + 1969 Mg tau(1969) = ( 6.0000000 6.5000000 8.5000000 ) + 1970 O tau(1970) = ( 6.5000000 7.0000000 9.0000000 ) + 1971 Mg tau(1971) = ( 6.5000000 7.0000000 8.5000000 ) + 1972 O tau(1972) = ( 7.0000000 7.5000000 9.0000000 ) + 1973 Mg tau(1973) = ( 7.0000000 7.5000000 8.5000000 ) + 1974 O tau(1974) = ( 7.5000000 8.0000000 9.0000000 ) + 1975 Mg tau(1975) = ( 7.5000000 8.0000000 8.5000000 ) + 1976 O tau(1976) = ( 8.0000000 8.5000000 9.0000000 ) + 1977 Mg tau(1977) = ( 8.0000000 8.5000000 8.5000000 ) + 1978 O tau(1978) = ( 8.5000000 9.0000000 9.0000000 ) + 1979 Mg tau(1979) = ( 8.5000000 9.0000000 8.5000000 ) + 1980 O tau(1980) = ( 9.0000000 9.5000000 9.0000000 ) + 1981 Mg tau(1981) = ( 4.5000000 4.5000000 9.0000000 ) + 1982 O tau(1982) = ( 5.0000000 5.0000000 9.5000000 ) + 1983 Mg tau(1983) = ( 5.0000000 5.0000000 9.0000000 ) + 1984 O tau(1984) = ( 5.5000000 5.5000000 9.5000000 ) + 1985 Mg tau(1985) = ( 5.5000000 5.5000000 9.0000000 ) + 1986 O tau(1986) = ( 6.0000000 6.0000000 9.5000000 ) + 1987 Mg tau(1987) = ( 6.0000000 6.0000000 9.0000000 ) + 1988 O tau(1988) = ( 6.5000000 6.5000000 9.5000000 ) + 1989 Mg tau(1989) = ( 6.5000000 6.5000000 9.0000000 ) + 1990 O tau(1990) = ( 7.0000000 7.0000000 9.5000000 ) + 1991 Mg tau(1991) = ( 7.0000000 7.0000000 9.0000000 ) + 1992 O tau(1992) = ( 7.5000000 7.5000000 9.5000000 ) + 1993 Mg tau(1993) = ( 7.5000000 7.5000000 9.0000000 ) + 1994 O tau(1994) = ( 8.0000000 8.0000000 9.5000000 ) + 1995 Mg tau(1995) = ( 8.0000000 8.0000000 9.0000000 ) + 1996 O tau(1996) = ( 8.5000000 8.5000000 9.5000000 ) + 1997 Mg tau(1997) = ( 8.5000000 8.5000000 9.0000000 ) + 1998 O tau(1998) = ( 9.0000000 9.0000000 9.5000000 ) + 1999 Mg tau(1999) = ( 9.0000000 9.0000000 9.0000000 ) + 2000 O tau(2000) = ( 9.5000000 9.5000000 9.5000000 ) + + number of k points= 10 + cart. coord. in units 2pi/alat + k( 1) = ( 0.0125000 0.0125000 0.0125000), wk = 0.0625000 + k( 2) = ( 0.0375000 0.0375000 -0.0125000), wk = 0.1875000 + k( 3) = ( -0.0375000 -0.0375000 0.0625000), wk = 0.1875000 + k( 4) = ( -0.0125000 -0.0125000 0.0375000), wk = 0.1875000 + k( 5) = ( 0.0625000 0.0125000 0.0125000), wk = 0.1875000 + k( 6) = ( -0.0125000 -0.0625000 0.0875000), wk = 0.3750000 + k( 7) = ( 0.0125000 -0.0375000 0.0625000), wk = 0.3750000 + k( 8) = ( -0.0875000 0.0125000 0.0125000), wk = 0.1875000 + k( 9) = ( 0.0375000 0.0375000 0.0375000), wk = 0.0625000 + k( 10) = ( -0.0375000 -0.0375000 0.1125000), wk = 0.1875000 + + Dense grid: 25025493 G-vectors FFT dimensions: ( 432, 432, 432) + + Largest allocated arrays est. size (Mb) dimensions + Kohn-Sham Wavefunctions 21.18 Mb ( 347, 4000) + NL pseudopotentials 10.59 Mb ( 347, 2000) + Each V/rho on FFT grid 2.85 Mb ( 186624) + Each G-vector array 0.02 Mb ( 2501) + G-vector shells 0.01 Mb ( 1744) + Largest temporary arrays est. size (Mb) dimensions + Auxiliary wavefunctions 84.72 Mb ( 347,16000) + Each subspace H/S matrix 0.79 Mb ( 228, 228) + Each matrix 122.07 Mb ( 2000, 4000) + Arrays for rho mixing 22.78 Mb ( 186624, 8) + + Initial potential from superposition of free atoms + + starting charge 7999.37722, renormalised to 8000.00000 + Starting wfc are 8000 atomic wfcs + + total cpu time spent up to now is 641.0 secs + + Self-consistent Calculation + + iteration # 1 ecut= 130.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 5.00E-04, avg # of iterations = 3.0 + + total cpu time spent up to now is 1633.7 secs + + total energy = -33817.29583839 Ry + Harris-Foulkes estimate = -34104.57686800 Ry + estimated scf accuracy < 398.35057286 Ry + + End of self-consistent calculation + + convergence NOT achieved after 1 iterations: stopping + + init_run : 561.35s CPU 596.07s WALL ( 1 calls) + electrons : 909.50s CPU 992.68s WALL ( 1 calls) + + Called by init_run: + wfcinit : 458.28s CPU 487.75s WALL ( 1 calls) + potinit : 0.98s CPU 0.99s WALL ( 1 calls) + + Called by electrons: + c_bands : 784.14s CPU 857.69s WALL ( 1 calls) + sum_band : 118.26s CPU 127.85s WALL ( 1 calls) + v_of_rho : 0.73s CPU 0.73s WALL ( 2 calls) + mix_rho : 0.30s CPU 0.30s WALL ( 1 calls) + + Called by c_bands: + init_us_2 : 0.04s CPU 0.07s WALL ( 3 calls) + cegterg : 784.07s CPU 857.27s WALL ( 1 calls) + + Called by *egterg: + h_psi : 948.09s CPU 1048.59s WALL ( 5 calls) + g_psi : 0.05s CPU 0.05s WALL ( 3 calls) + cdiaghg : 72.18s CPU 72.37s WALL ( 4 calls) + + Called by h_psi: + add_vuspsi : 20.61s CPU 21.96s WALL ( 5 calls) + + General routines + calbec : 22.46s CPU 22.50s WALL ( 5 calls) + fft : 4.79s CPU 7.96s WALL ( 8 calls) + fftw : 964.99s CPU 1073.46s WALL ( 8870 calls) + + Parallel routines + fft_scatter : 830.15s CPU 900.02s WALL ( 8878 calls) + ALLTOALL : 25.09s CPU 25.68s WALL ( 8870 calls) + EXX routines + + MiniDFT : 24m46.40s CPU 27m13.76s WALL + + + This run was terminated on: 22: 5:36 24May2013 + +=------------------------------------------------------------------------------= + JOB DONE. + Benchmark_Time : 909.55s CPU 992.73s WALL ( 1 calls) +=------------------------------------------------------------------------------= +Application 17694693 resources: utime ~150934552s, stime ~13956728s, Rss ~1078192, inblocks ~5428007278, outblocks ~207838243 diff --git a/tests/apps/miniDFT/tests/sample_outputs/large.out.ref b/tests/apps/miniDFT/tests/sample_outputs/large.out.ref new file mode 100644 index 0000000000..d4c0931ef2 --- /dev/null +++ b/tests/apps/miniDFT/tests/sample_outputs/large.out.ref @@ -0,0 +1,2182 @@ + + Program MiniDFT v.1.0 starts on 23Apr2013 at 13: 0:43 + + This is mini-DFT, a mini-application for plane-wave density functional + theory calculations. Mini-DFT was extracted from + the open-source Quantum ESPRESSO suite by B. Austin (2013). + + To acknowledge Quantum ESPRESSO, please cite + P. Giannozzi et al., J. Phys.:Condens. Matter 21 395502 (2009); + URL http://www.quantum-espresso.org + + Parallel version (MPI), running on 10000 processors + R & G space division: proc/pool = **** + wavefunctions fft division: fft/group = 5 + + Current dimensions of program MiniDFT are: + Max number of different atomic species (ntypx) = 10 + Max number of k-points (npk) = 40000 + Max angular momentum in pseudopotentials (lmaxx) = 3 + Reading input from magnesia_10_130.in + + Subspace diagonalization in iterative solution of the eigenvalue problem: + scalapack distributed-memory algorithm (size of sub-group: 70* 70 procs) + + Found symmetry operation: I + ( 0.0000 0.0000 0.1000) + This is a supercell, fractional translations are disabled + + Task Groups are in USE + groups and procs/group : 5 2000 + + Parallelization info + -------------------- + sticks: dense smooth PW G-vecs: dense smooth PW + Min 11 11 2 2485 2485 269 + Max 12 12 3 2519 2519 351 + Sum 112831 112831 28579 25025493 25025493 3185117 + + + + bravais-lattice index = 0 + lattice parameter (alat) = 7.9366 a.u. + unit-cell volume = 124979.9088 (a.u.)^3 + number of atoms/cell = 2000 + number of atomic types = 2 + number of electrons = 8000.00 + number of Kohn-Sham states= 4000 + kinetic-energy cutoff = 130.0000 Ry + charge density cutoff = 520.0000 Ry + convergence threshold = 1.0E-10 + mixing beta = 0.7000 + number of iterations used = 8 plain mixing + Exchange-correlation = PZ ( 1 1 0 0 0) + + celldm(1)= 7.936580 celldm(2)= 0.000000 celldm(3)= 0.000000 + celldm(4)= 0.000000 celldm(5)= 0.000000 celldm(6)= 0.000000 + + crystal axes: (cart. coord. in units of alat) + a(1) = ( 0.000000 5.000000 5.000000 ) + a(2) = ( 5.000000 0.000000 5.000000 ) + a(3) = ( 5.000000 5.000000 0.000000 ) + + reciprocal axes: (cart. coord. in units 2 pi/alat) + b(1) = ( -0.100000 0.100000 0.100000 ) + b(2) = ( 0.100000 -0.100000 0.100000 ) + b(3) = ( 0.100000 0.100000 -0.100000 ) + + + PseudoPot. # 1 for Mg read from file: + ./Mg.pz.nml + MD5 check sum: f0361a84b86a1a82c6b5f2c54d8a9b88 + Pseudo is Norm-conserving, Zval = 2.0 + Generated using BHS code + Using radial grid of 425 points, 1 beta functions with: + l(1) = 0 + + PseudoPot. # 2 for O read from file: + ./O.pz.nml + MD5 check sum: 02e36e55e29b8f2f4a0748c6f080d52f + Pseudo is Norm-conserving, Zval = 6.0 + Generated using JLMartins code + Using radial grid of 921 points, 1 beta functions with: + l(1) = 0 + + atomic species valence mass pseudopotential + Mg 2.00 24.30500 Mg( 1.00) + O 6.00 15.99900 O( 1.00) + + 48 Sym. Ops., with inversion, found + + + + Cartesian axes + + site n. atom positions (alat units) + 1 Mg tau( 1) = ( 0.0000000 0.0000000 0.0000000 ) + 2 O tau( 2) = ( 0.5000000 0.5000000 0.5000000 ) + 3 Mg tau( 3) = ( 0.5000000 0.5000000 0.0000000 ) + 4 O tau( 4) = ( 1.0000000 1.0000000 0.5000000 ) + 5 Mg tau( 5) = ( 1.0000000 1.0000000 0.0000000 ) + 6 O tau( 6) = ( 1.5000000 1.5000000 0.5000000 ) + 7 Mg tau( 7) = ( 1.5000000 1.5000000 0.0000000 ) + 8 O tau( 8) = ( 2.0000000 2.0000000 0.5000000 ) + 9 Mg tau( 9) = ( 2.0000000 2.0000000 0.0000000 ) + 10 O tau( 10) = ( 2.5000000 2.5000000 0.5000000 ) + 11 Mg tau( 11) = ( 2.5000000 2.5000000 0.0000000 ) + 12 O tau( 12) = ( 3.0000000 3.0000000 0.5000000 ) + 13 Mg tau( 13) = ( 3.0000000 3.0000000 0.0000000 ) + 14 O tau( 14) = ( 3.5000000 3.5000000 0.5000000 ) + 15 Mg tau( 15) = ( 3.5000000 3.5000000 0.0000000 ) + 16 O tau( 16) = ( 4.0000000 4.0000000 0.5000000 ) + 17 Mg tau( 17) = ( 4.0000000 4.0000000 0.0000000 ) + 18 O tau( 18) = ( 4.5000000 4.5000000 0.5000000 ) + 19 Mg tau( 19) = ( 4.5000000 4.5000000 0.0000000 ) + 20 O tau( 20) = ( 5.0000000 5.0000000 0.5000000 ) + 21 Mg tau( 21) = ( 0.5000000 0.0000000 0.5000000 ) + 22 O tau( 22) = ( 1.0000000 0.5000000 1.0000000 ) + 23 Mg tau( 23) = ( 1.0000000 0.5000000 0.5000000 ) + 24 O tau( 24) = ( 1.5000000 1.0000000 1.0000000 ) + 25 Mg tau( 25) = ( 1.5000000 1.0000000 0.5000000 ) + 26 O tau( 26) = ( 2.0000000 1.5000000 1.0000000 ) + 27 Mg tau( 27) = ( 2.0000000 1.5000000 0.5000000 ) + 28 O tau( 28) = ( 2.5000000 2.0000000 1.0000000 ) + 29 Mg tau( 29) = ( 2.5000000 2.0000000 0.5000000 ) + 30 O tau( 30) = ( 3.0000000 2.5000000 1.0000000 ) + 31 Mg tau( 31) = ( 3.0000000 2.5000000 0.5000000 ) + 32 O tau( 32) = ( 3.5000000 3.0000000 1.0000000 ) + 33 Mg tau( 33) = ( 3.5000000 3.0000000 0.5000000 ) + 34 O tau( 34) = ( 4.0000000 3.5000000 1.0000000 ) + 35 Mg tau( 35) = ( 4.0000000 3.5000000 0.5000000 ) + 36 O tau( 36) = ( 4.5000000 4.0000000 1.0000000 ) + 37 Mg tau( 37) = ( 4.5000000 4.0000000 0.5000000 ) + 38 O tau( 38) = ( 5.0000000 4.5000000 1.0000000 ) + 39 Mg tau( 39) = ( 5.0000000 4.5000000 0.5000000 ) + 40 O tau( 40) = ( 5.5000000 5.0000000 1.0000000 ) + 41 Mg tau( 41) = ( 1.0000000 0.0000000 1.0000000 ) + 42 O tau( 42) = ( 1.5000000 0.5000000 1.5000000 ) + 43 Mg tau( 43) = ( 1.5000000 0.5000000 1.0000000 ) + 44 O tau( 44) = ( 2.0000000 1.0000000 1.5000000 ) + 45 Mg tau( 45) = ( 2.0000000 1.0000000 1.0000000 ) + 46 O tau( 46) = ( 2.5000000 1.5000000 1.5000000 ) + 47 Mg tau( 47) = ( 2.5000000 1.5000000 1.0000000 ) + 48 O tau( 48) = ( 3.0000000 2.0000000 1.5000000 ) + 49 Mg tau( 49) = ( 3.0000000 2.0000000 1.0000000 ) + 50 O tau( 50) = ( 3.5000000 2.5000000 1.5000000 ) + 51 Mg tau( 51) = ( 3.5000000 2.5000000 1.0000000 ) + 52 O tau( 52) = ( 4.0000000 3.0000000 1.5000000 ) + 53 Mg tau( 53) = ( 4.0000000 3.0000000 1.0000000 ) + 54 O tau( 54) = ( 4.5000000 3.5000000 1.5000000 ) + 55 Mg tau( 55) = ( 4.5000000 3.5000000 1.0000000 ) + 56 O tau( 56) = ( 5.0000000 4.0000000 1.5000000 ) + 57 Mg tau( 57) = ( 5.0000000 4.0000000 1.0000000 ) + 58 O tau( 58) = ( 5.5000000 4.5000000 1.5000000 ) + 59 Mg tau( 59) = ( 5.5000000 4.5000000 1.0000000 ) + 60 O tau( 60) = ( 6.0000000 5.0000000 1.5000000 ) + 61 Mg tau( 61) = ( 1.5000000 0.0000000 1.5000000 ) + 62 O tau( 62) = ( 2.0000000 0.5000000 2.0000000 ) + 63 Mg tau( 63) = ( 2.0000000 0.5000000 1.5000000 ) + 64 O tau( 64) = ( 2.5000000 1.0000000 2.0000000 ) + 65 Mg tau( 65) = ( 2.5000000 1.0000000 1.5000000 ) + 66 O tau( 66) = ( 3.0000000 1.5000000 2.0000000 ) + 67 Mg tau( 67) = ( 3.0000000 1.5000000 1.5000000 ) + 68 O tau( 68) = ( 3.5000000 2.0000000 2.0000000 ) + 69 Mg tau( 69) = ( 3.5000000 2.0000000 1.5000000 ) + 70 O tau( 70) = ( 4.0000000 2.5000000 2.0000000 ) + 71 Mg tau( 71) = ( 4.0000000 2.5000000 1.5000000 ) + 72 O tau( 72) = ( 4.5000000 3.0000000 2.0000000 ) + 73 Mg tau( 73) = ( 4.5000000 3.0000000 1.5000000 ) + 74 O tau( 74) = ( 5.0000000 3.5000000 2.0000000 ) + 75 Mg tau( 75) = ( 5.0000000 3.5000000 1.5000000 ) + 76 O tau( 76) = ( 5.5000000 4.0000000 2.0000000 ) + 77 Mg tau( 77) = ( 5.5000000 4.0000000 1.5000000 ) + 78 O tau( 78) = ( 6.0000000 4.5000000 2.0000000 ) + 79 Mg tau( 79) = ( 6.0000000 4.5000000 1.5000000 ) + 80 O tau( 80) = ( 6.5000000 5.0000000 2.0000000 ) + 81 Mg tau( 81) = ( 2.0000000 0.0000000 2.0000000 ) + 82 O tau( 82) = ( 2.5000000 0.5000000 2.5000000 ) + 83 Mg tau( 83) = ( 2.5000000 0.5000000 2.0000000 ) + 84 O tau( 84) = ( 3.0000000 1.0000000 2.5000000 ) + 85 Mg tau( 85) = ( 3.0000000 1.0000000 2.0000000 ) + 86 O tau( 86) = ( 3.5000000 1.5000000 2.5000000 ) + 87 Mg tau( 87) = ( 3.5000000 1.5000000 2.0000000 ) + 88 O tau( 88) = ( 4.0000000 2.0000000 2.5000000 ) + 89 Mg tau( 89) = ( 4.0000000 2.0000000 2.0000000 ) + 90 O tau( 90) = ( 4.5000000 2.5000000 2.5000000 ) + 91 Mg tau( 91) = ( 4.5000000 2.5000000 2.0000000 ) + 92 O tau( 92) = ( 5.0000000 3.0000000 2.5000000 ) + 93 Mg tau( 93) = ( 5.0000000 3.0000000 2.0000000 ) + 94 O tau( 94) = ( 5.5000000 3.5000000 2.5000000 ) + 95 Mg tau( 95) = ( 5.5000000 3.5000000 2.0000000 ) + 96 O tau( 96) = ( 6.0000000 4.0000000 2.5000000 ) + 97 Mg tau( 97) = ( 6.0000000 4.0000000 2.0000000 ) + 98 O tau( 98) = ( 6.5000000 4.5000000 2.5000000 ) + 99 Mg tau( 99) = ( 6.5000000 4.5000000 2.0000000 ) + 100 O tau( 100) = ( 7.0000000 5.0000000 2.5000000 ) + 101 Mg tau( 101) = ( 2.5000000 0.0000000 2.5000000 ) + 102 O tau( 102) = ( 3.0000000 0.5000000 3.0000000 ) + 103 Mg tau( 103) = ( 3.0000000 0.5000000 2.5000000 ) + 104 O tau( 104) = ( 3.5000000 1.0000000 3.0000000 ) + 105 Mg tau( 105) = ( 3.5000000 1.0000000 2.5000000 ) + 106 O tau( 106) = ( 4.0000000 1.5000000 3.0000000 ) + 107 Mg tau( 107) = ( 4.0000000 1.5000000 2.5000000 ) + 108 O tau( 108) = ( 4.5000000 2.0000000 3.0000000 ) + 109 Mg tau( 109) = ( 4.5000000 2.0000000 2.5000000 ) + 110 O tau( 110) = ( 5.0000000 2.5000000 3.0000000 ) + 111 Mg tau( 111) = ( 5.0000000 2.5000000 2.5000000 ) + 112 O tau( 112) = ( 5.5000000 3.0000000 3.0000000 ) + 113 Mg tau( 113) = ( 5.5000000 3.0000000 2.5000000 ) + 114 O tau( 114) = ( 6.0000000 3.5000000 3.0000000 ) + 115 Mg tau( 115) = ( 6.0000000 3.5000000 2.5000000 ) + 116 O tau( 116) = ( 6.5000000 4.0000000 3.0000000 ) + 117 Mg tau( 117) = ( 6.5000000 4.0000000 2.5000000 ) + 118 O tau( 118) = ( 7.0000000 4.5000000 3.0000000 ) + 119 Mg tau( 119) = ( 7.0000000 4.5000000 2.5000000 ) + 120 O tau( 120) = ( 7.5000000 5.0000000 3.0000000 ) + 121 Mg tau( 121) = ( 3.0000000 0.0000000 3.0000000 ) + 122 O tau( 122) = ( 3.5000000 0.5000000 3.5000000 ) + 123 Mg tau( 123) = ( 3.5000000 0.5000000 3.0000000 ) + 124 O tau( 124) = ( 4.0000000 1.0000000 3.5000000 ) + 125 Mg tau( 125) = ( 4.0000000 1.0000000 3.0000000 ) + 126 O tau( 126) = ( 4.5000000 1.5000000 3.5000000 ) + 127 Mg tau( 127) = ( 4.5000000 1.5000000 3.0000000 ) + 128 O tau( 128) = ( 5.0000000 2.0000000 3.5000000 ) + 129 Mg tau( 129) = ( 5.0000000 2.0000000 3.0000000 ) + 130 O tau( 130) = ( 5.5000000 2.5000000 3.5000000 ) + 131 Mg tau( 131) = ( 5.5000000 2.5000000 3.0000000 ) + 132 O tau( 132) = ( 6.0000000 3.0000000 3.5000000 ) + 133 Mg tau( 133) = ( 6.0000000 3.0000000 3.0000000 ) + 134 O tau( 134) = ( 6.5000000 3.5000000 3.5000000 ) + 135 Mg tau( 135) = ( 6.5000000 3.5000000 3.0000000 ) + 136 O tau( 136) = ( 7.0000000 4.0000000 3.5000000 ) + 137 Mg tau( 137) = ( 7.0000000 4.0000000 3.0000000 ) + 138 O tau( 138) = ( 7.5000000 4.5000000 3.5000000 ) + 139 Mg tau( 139) = ( 7.5000000 4.5000000 3.0000000 ) + 140 O tau( 140) = ( 8.0000000 5.0000000 3.5000000 ) + 141 Mg tau( 141) = ( 3.5000000 0.0000000 3.5000000 ) + 142 O tau( 142) = ( 4.0000000 0.5000000 4.0000000 ) + 143 Mg tau( 143) = ( 4.0000000 0.5000000 3.5000000 ) + 144 O tau( 144) = ( 4.5000000 1.0000000 4.0000000 ) + 145 Mg tau( 145) = ( 4.5000000 1.0000000 3.5000000 ) + 146 O tau( 146) = ( 5.0000000 1.5000000 4.0000000 ) + 147 Mg tau( 147) = ( 5.0000000 1.5000000 3.5000000 ) + 148 O tau( 148) = ( 5.5000000 2.0000000 4.0000000 ) + 149 Mg tau( 149) = ( 5.5000000 2.0000000 3.5000000 ) + 150 O tau( 150) = ( 6.0000000 2.5000000 4.0000000 ) + 151 Mg tau( 151) = ( 6.0000000 2.5000000 3.5000000 ) + 152 O tau( 152) = ( 6.5000000 3.0000000 4.0000000 ) + 153 Mg tau( 153) = ( 6.5000000 3.0000000 3.5000000 ) + 154 O tau( 154) = ( 7.0000000 3.5000000 4.0000000 ) + 155 Mg tau( 155) = ( 7.0000000 3.5000000 3.5000000 ) + 156 O tau( 156) = ( 7.5000000 4.0000000 4.0000000 ) + 157 Mg tau( 157) = ( 7.5000000 4.0000000 3.5000000 ) + 158 O tau( 158) = ( 8.0000000 4.5000000 4.0000000 ) + 159 Mg tau( 159) = ( 8.0000000 4.5000000 3.5000000 ) + 160 O tau( 160) = ( 8.5000000 5.0000000 4.0000000 ) + 161 Mg tau( 161) = ( 4.0000000 0.0000000 4.0000000 ) + 162 O tau( 162) = ( 4.5000000 0.5000000 4.5000000 ) + 163 Mg tau( 163) = ( 4.5000000 0.5000000 4.0000000 ) + 164 O tau( 164) = ( 5.0000000 1.0000000 4.5000000 ) + 165 Mg tau( 165) = ( 5.0000000 1.0000000 4.0000000 ) + 166 O tau( 166) = ( 5.5000000 1.5000000 4.5000000 ) + 167 Mg tau( 167) = ( 5.5000000 1.5000000 4.0000000 ) + 168 O tau( 168) = ( 6.0000000 2.0000000 4.5000000 ) + 169 Mg tau( 169) = ( 6.0000000 2.0000000 4.0000000 ) + 170 O tau( 170) = ( 6.5000000 2.5000000 4.5000000 ) + 171 Mg tau( 171) = ( 6.5000000 2.5000000 4.0000000 ) + 172 O tau( 172) = ( 7.0000000 3.0000000 4.5000000 ) + 173 Mg tau( 173) = ( 7.0000000 3.0000000 4.0000000 ) + 174 O tau( 174) = ( 7.5000000 3.5000000 4.5000000 ) + 175 Mg tau( 175) = ( 7.5000000 3.5000000 4.0000000 ) + 176 O tau( 176) = ( 8.0000000 4.0000000 4.5000000 ) + 177 Mg tau( 177) = ( 8.0000000 4.0000000 4.0000000 ) + 178 O tau( 178) = ( 8.5000000 4.5000000 4.5000000 ) + 179 Mg tau( 179) = ( 8.5000000 4.5000000 4.0000000 ) + 180 O tau( 180) = ( 9.0000000 5.0000000 4.5000000 ) + 181 Mg tau( 181) = ( 4.5000000 0.0000000 4.5000000 ) + 182 O tau( 182) = ( 5.0000000 0.5000000 5.0000000 ) + 183 Mg tau( 183) = ( 5.0000000 0.5000000 4.5000000 ) + 184 O tau( 184) = ( 5.5000000 1.0000000 5.0000000 ) + 185 Mg tau( 185) = ( 5.5000000 1.0000000 4.5000000 ) + 186 O tau( 186) = ( 6.0000000 1.5000000 5.0000000 ) + 187 Mg tau( 187) = ( 6.0000000 1.5000000 4.5000000 ) + 188 O tau( 188) = ( 6.5000000 2.0000000 5.0000000 ) + 189 Mg tau( 189) = ( 6.5000000 2.0000000 4.5000000 ) + 190 O tau( 190) = ( 7.0000000 2.5000000 5.0000000 ) + 191 Mg tau( 191) = ( 7.0000000 2.5000000 4.5000000 ) + 192 O tau( 192) = ( 7.5000000 3.0000000 5.0000000 ) + 193 Mg tau( 193) = ( 7.5000000 3.0000000 4.5000000 ) + 194 O tau( 194) = ( 8.0000000 3.5000000 5.0000000 ) + 195 Mg tau( 195) = ( 8.0000000 3.5000000 4.5000000 ) + 196 O tau( 196) = ( 8.5000000 4.0000000 5.0000000 ) + 197 Mg tau( 197) = ( 8.5000000 4.0000000 4.5000000 ) + 198 O tau( 198) = ( 9.0000000 4.5000000 5.0000000 ) + 199 Mg tau( 199) = ( 9.0000000 4.5000000 4.5000000 ) + 200 O tau( 200) = ( 9.5000000 5.0000000 5.0000000 ) + 201 Mg tau( 201) = ( 0.0000000 0.5000000 0.5000000 ) + 202 O tau( 202) = ( 0.5000000 1.0000000 1.0000000 ) + 203 Mg tau( 203) = ( 0.5000000 1.0000000 0.5000000 ) + 204 O tau( 204) = ( 1.0000000 1.5000000 1.0000000 ) + 205 Mg tau( 205) = ( 1.0000000 1.5000000 0.5000000 ) + 206 O tau( 206) = ( 1.5000000 2.0000000 1.0000000 ) + 207 Mg tau( 207) = ( 1.5000000 2.0000000 0.5000000 ) + 208 O tau( 208) = ( 2.0000000 2.5000000 1.0000000 ) + 209 Mg tau( 209) = ( 2.0000000 2.5000000 0.5000000 ) + 210 O tau( 210) = ( 2.5000000 3.0000000 1.0000000 ) + 211 Mg tau( 211) = ( 2.5000000 3.0000000 0.5000000 ) + 212 O tau( 212) = ( 3.0000000 3.5000000 1.0000000 ) + 213 Mg tau( 213) = ( 3.0000000 3.5000000 0.5000000 ) + 214 O tau( 214) = ( 3.5000000 4.0000000 1.0000000 ) + 215 Mg tau( 215) = ( 3.5000000 4.0000000 0.5000000 ) + 216 O tau( 216) = ( 4.0000000 4.5000000 1.0000000 ) + 217 Mg tau( 217) = ( 4.0000000 4.5000000 0.5000000 ) + 218 O tau( 218) = ( 4.5000000 5.0000000 1.0000000 ) + 219 Mg tau( 219) = ( 4.5000000 5.0000000 0.5000000 ) + 220 O tau( 220) = ( 5.0000000 5.5000000 1.0000000 ) + 221 Mg tau( 221) = ( 0.5000000 0.5000000 1.0000000 ) + 222 O tau( 222) = ( 1.0000000 1.0000000 1.5000000 ) + 223 Mg tau( 223) = ( 1.0000000 1.0000000 1.0000000 ) + 224 O tau( 224) = ( 1.5000000 1.5000000 1.5000000 ) + 225 Mg tau( 225) = ( 1.5000000 1.5000000 1.0000000 ) + 226 O tau( 226) = ( 2.0000000 2.0000000 1.5000000 ) + 227 Mg tau( 227) = ( 2.0000000 2.0000000 1.0000000 ) + 228 O tau( 228) = ( 2.5000000 2.5000000 1.5000000 ) + 229 Mg tau( 229) = ( 2.5000000 2.5000000 1.0000000 ) + 230 O tau( 230) = ( 3.0000000 3.0000000 1.5000000 ) + 231 Mg tau( 231) = ( 3.0000000 3.0000000 1.0000000 ) + 232 O tau( 232) = ( 3.5000000 3.5000000 1.5000000 ) + 233 Mg tau( 233) = ( 3.5000000 3.5000000 1.0000000 ) + 234 O tau( 234) = ( 4.0000000 4.0000000 1.5000000 ) + 235 Mg tau( 235) = ( 4.0000000 4.0000000 1.0000000 ) + 236 O tau( 236) = ( 4.5000000 4.5000000 1.5000000 ) + 237 Mg tau( 237) = ( 4.5000000 4.5000000 1.0000000 ) + 238 O tau( 238) = ( 5.0000000 5.0000000 1.5000000 ) + 239 Mg tau( 239) = ( 5.0000000 5.0000000 1.0000000 ) + 240 O tau( 240) = ( 5.5000000 5.5000000 1.5000000 ) + 241 Mg tau( 241) = ( 1.0000000 0.5000000 1.5000000 ) + 242 O tau( 242) = ( 1.5000000 1.0000000 2.0000000 ) + 243 Mg tau( 243) = ( 1.5000000 1.0000000 1.5000000 ) + 244 O tau( 244) = ( 2.0000000 1.5000000 2.0000000 ) + 245 Mg tau( 245) = ( 2.0000000 1.5000000 1.5000000 ) + 246 O tau( 246) = ( 2.5000000 2.0000000 2.0000000 ) + 247 Mg tau( 247) = ( 2.5000000 2.0000000 1.5000000 ) + 248 O tau( 248) = ( 3.0000000 2.5000000 2.0000000 ) + 249 Mg tau( 249) = ( 3.0000000 2.5000000 1.5000000 ) + 250 O tau( 250) = ( 3.5000000 3.0000000 2.0000000 ) + 251 Mg tau( 251) = ( 3.5000000 3.0000000 1.5000000 ) + 252 O tau( 252) = ( 4.0000000 3.5000000 2.0000000 ) + 253 Mg tau( 253) = ( 4.0000000 3.5000000 1.5000000 ) + 254 O tau( 254) = ( 4.5000000 4.0000000 2.0000000 ) + 255 Mg tau( 255) = ( 4.5000000 4.0000000 1.5000000 ) + 256 O tau( 256) = ( 5.0000000 4.5000000 2.0000000 ) + 257 Mg tau( 257) = ( 5.0000000 4.5000000 1.5000000 ) + 258 O tau( 258) = ( 5.5000000 5.0000000 2.0000000 ) + 259 Mg tau( 259) = ( 5.5000000 5.0000000 1.5000000 ) + 260 O tau( 260) = ( 6.0000000 5.5000000 2.0000000 ) + 261 Mg tau( 261) = ( 1.5000000 0.5000000 2.0000000 ) + 262 O tau( 262) = ( 2.0000000 1.0000000 2.5000000 ) + 263 Mg tau( 263) = ( 2.0000000 1.0000000 2.0000000 ) + 264 O tau( 264) = ( 2.5000000 1.5000000 2.5000000 ) + 265 Mg tau( 265) = ( 2.5000000 1.5000000 2.0000000 ) + 266 O tau( 266) = ( 3.0000000 2.0000000 2.5000000 ) + 267 Mg tau( 267) = ( 3.0000000 2.0000000 2.0000000 ) + 268 O tau( 268) = ( 3.5000000 2.5000000 2.5000000 ) + 269 Mg tau( 269) = ( 3.5000000 2.5000000 2.0000000 ) + 270 O tau( 270) = ( 4.0000000 3.0000000 2.5000000 ) + 271 Mg tau( 271) = ( 4.0000000 3.0000000 2.0000000 ) + 272 O tau( 272) = ( 4.5000000 3.5000000 2.5000000 ) + 273 Mg tau( 273) = ( 4.5000000 3.5000000 2.0000000 ) + 274 O tau( 274) = ( 5.0000000 4.0000000 2.5000000 ) + 275 Mg tau( 275) = ( 5.0000000 4.0000000 2.0000000 ) + 276 O tau( 276) = ( 5.5000000 4.5000000 2.5000000 ) + 277 Mg tau( 277) = ( 5.5000000 4.5000000 2.0000000 ) + 278 O tau( 278) = ( 6.0000000 5.0000000 2.5000000 ) + 279 Mg tau( 279) = ( 6.0000000 5.0000000 2.0000000 ) + 280 O tau( 280) = ( 6.5000000 5.5000000 2.5000000 ) + 281 Mg tau( 281) = ( 2.0000000 0.5000000 2.5000000 ) + 282 O tau( 282) = ( 2.5000000 1.0000000 3.0000000 ) + 283 Mg tau( 283) = ( 2.5000000 1.0000000 2.5000000 ) + 284 O tau( 284) = ( 3.0000000 1.5000000 3.0000000 ) + 285 Mg tau( 285) = ( 3.0000000 1.5000000 2.5000000 ) + 286 O tau( 286) = ( 3.5000000 2.0000000 3.0000000 ) + 287 Mg tau( 287) = ( 3.5000000 2.0000000 2.5000000 ) + 288 O tau( 288) = ( 4.0000000 2.5000000 3.0000000 ) + 289 Mg tau( 289) = ( 4.0000000 2.5000000 2.5000000 ) + 290 O tau( 290) = ( 4.5000000 3.0000000 3.0000000 ) + 291 Mg tau( 291) = ( 4.5000000 3.0000000 2.5000000 ) + 292 O tau( 292) = ( 5.0000000 3.5000000 3.0000000 ) + 293 Mg tau( 293) = ( 5.0000000 3.5000000 2.5000000 ) + 294 O tau( 294) = ( 5.5000000 4.0000000 3.0000000 ) + 295 Mg tau( 295) = ( 5.5000000 4.0000000 2.5000000 ) + 296 O tau( 296) = ( 6.0000000 4.5000000 3.0000000 ) + 297 Mg tau( 297) = ( 6.0000000 4.5000000 2.5000000 ) + 298 O tau( 298) = ( 6.5000000 5.0000000 3.0000000 ) + 299 Mg tau( 299) = ( 6.5000000 5.0000000 2.5000000 ) + 300 O tau( 300) = ( 7.0000000 5.5000000 3.0000000 ) + 301 Mg tau( 301) = ( 2.5000000 0.5000000 3.0000000 ) + 302 O tau( 302) = ( 3.0000000 1.0000000 3.5000000 ) + 303 Mg tau( 303) = ( 3.0000000 1.0000000 3.0000000 ) + 304 O tau( 304) = ( 3.5000000 1.5000000 3.5000000 ) + 305 Mg tau( 305) = ( 3.5000000 1.5000000 3.0000000 ) + 306 O tau( 306) = ( 4.0000000 2.0000000 3.5000000 ) + 307 Mg tau( 307) = ( 4.0000000 2.0000000 3.0000000 ) + 308 O tau( 308) = ( 4.5000000 2.5000000 3.5000000 ) + 309 Mg tau( 309) = ( 4.5000000 2.5000000 3.0000000 ) + 310 O tau( 310) = ( 5.0000000 3.0000000 3.5000000 ) + 311 Mg tau( 311) = ( 5.0000000 3.0000000 3.0000000 ) + 312 O tau( 312) = ( 5.5000000 3.5000000 3.5000000 ) + 313 Mg tau( 313) = ( 5.5000000 3.5000000 3.0000000 ) + 314 O tau( 314) = ( 6.0000000 4.0000000 3.5000000 ) + 315 Mg tau( 315) = ( 6.0000000 4.0000000 3.0000000 ) + 316 O tau( 316) = ( 6.5000000 4.5000000 3.5000000 ) + 317 Mg tau( 317) = ( 6.5000000 4.5000000 3.0000000 ) + 318 O tau( 318) = ( 7.0000000 5.0000000 3.5000000 ) + 319 Mg tau( 319) = ( 7.0000000 5.0000000 3.0000000 ) + 320 O tau( 320) = ( 7.5000000 5.5000000 3.5000000 ) + 321 Mg tau( 321) = ( 3.0000000 0.5000000 3.5000000 ) + 322 O tau( 322) = ( 3.5000000 1.0000000 4.0000000 ) + 323 Mg tau( 323) = ( 3.5000000 1.0000000 3.5000000 ) + 324 O tau( 324) = ( 4.0000000 1.5000000 4.0000000 ) + 325 Mg tau( 325) = ( 4.0000000 1.5000000 3.5000000 ) + 326 O tau( 326) = ( 4.5000000 2.0000000 4.0000000 ) + 327 Mg tau( 327) = ( 4.5000000 2.0000000 3.5000000 ) + 328 O tau( 328) = ( 5.0000000 2.5000000 4.0000000 ) + 329 Mg tau( 329) = ( 5.0000000 2.5000000 3.5000000 ) + 330 O tau( 330) = ( 5.5000000 3.0000000 4.0000000 ) + 331 Mg tau( 331) = ( 5.5000000 3.0000000 3.5000000 ) + 332 O tau( 332) = ( 6.0000000 3.5000000 4.0000000 ) + 333 Mg tau( 333) = ( 6.0000000 3.5000000 3.5000000 ) + 334 O tau( 334) = ( 6.5000000 4.0000000 4.0000000 ) + 335 Mg tau( 335) = ( 6.5000000 4.0000000 3.5000000 ) + 336 O tau( 336) = ( 7.0000000 4.5000000 4.0000000 ) + 337 Mg tau( 337) = ( 7.0000000 4.5000000 3.5000000 ) + 338 O tau( 338) = ( 7.5000000 5.0000000 4.0000000 ) + 339 Mg tau( 339) = ( 7.5000000 5.0000000 3.5000000 ) + 340 O tau( 340) = ( 8.0000000 5.5000000 4.0000000 ) + 341 Mg tau( 341) = ( 3.5000000 0.5000000 4.0000000 ) + 342 O tau( 342) = ( 4.0000000 1.0000000 4.5000000 ) + 343 Mg tau( 343) = ( 4.0000000 1.0000000 4.0000000 ) + 344 O tau( 344) = ( 4.5000000 1.5000000 4.5000000 ) + 345 Mg tau( 345) = ( 4.5000000 1.5000000 4.0000000 ) + 346 O tau( 346) = ( 5.0000000 2.0000000 4.5000000 ) + 347 Mg tau( 347) = ( 5.0000000 2.0000000 4.0000000 ) + 348 O tau( 348) = ( 5.5000000 2.5000000 4.5000000 ) + 349 Mg tau( 349) = ( 5.5000000 2.5000000 4.0000000 ) + 350 O tau( 350) = ( 6.0000000 3.0000000 4.5000000 ) + 351 Mg tau( 351) = ( 6.0000000 3.0000000 4.0000000 ) + 352 O tau( 352) = ( 6.5000000 3.5000000 4.5000000 ) + 353 Mg tau( 353) = ( 6.5000000 3.5000000 4.0000000 ) + 354 O tau( 354) = ( 7.0000000 4.0000000 4.5000000 ) + 355 Mg tau( 355) = ( 7.0000000 4.0000000 4.0000000 ) + 356 O tau( 356) = ( 7.5000000 4.5000000 4.5000000 ) + 357 Mg tau( 357) = ( 7.5000000 4.5000000 4.0000000 ) + 358 O tau( 358) = ( 8.0000000 5.0000000 4.5000000 ) + 359 Mg tau( 359) = ( 8.0000000 5.0000000 4.0000000 ) + 360 O tau( 360) = ( 8.5000000 5.5000000 4.5000000 ) + 361 Mg tau( 361) = ( 4.0000000 0.5000000 4.5000000 ) + 362 O tau( 362) = ( 4.5000000 1.0000000 5.0000000 ) + 363 Mg tau( 363) = ( 4.5000000 1.0000000 4.5000000 ) + 364 O tau( 364) = ( 5.0000000 1.5000000 5.0000000 ) + 365 Mg tau( 365) = ( 5.0000000 1.5000000 4.5000000 ) + 366 O tau( 366) = ( 5.5000000 2.0000000 5.0000000 ) + 367 Mg tau( 367) = ( 5.5000000 2.0000000 4.5000000 ) + 368 O tau( 368) = ( 6.0000000 2.5000000 5.0000000 ) + 369 Mg tau( 369) = ( 6.0000000 2.5000000 4.5000000 ) + 370 O tau( 370) = ( 6.5000000 3.0000000 5.0000000 ) + 371 Mg tau( 371) = ( 6.5000000 3.0000000 4.5000000 ) + 372 O tau( 372) = ( 7.0000000 3.5000000 5.0000000 ) + 373 Mg tau( 373) = ( 7.0000000 3.5000000 4.5000000 ) + 374 O tau( 374) = ( 7.5000000 4.0000000 5.0000000 ) + 375 Mg tau( 375) = ( 7.5000000 4.0000000 4.5000000 ) + 376 O tau( 376) = ( 8.0000000 4.5000000 5.0000000 ) + 377 Mg tau( 377) = ( 8.0000000 4.5000000 4.5000000 ) + 378 O tau( 378) = ( 8.5000000 5.0000000 5.0000000 ) + 379 Mg tau( 379) = ( 8.5000000 5.0000000 4.5000000 ) + 380 O tau( 380) = ( 9.0000000 5.5000000 5.0000000 ) + 381 Mg tau( 381) = ( 4.5000000 0.5000000 5.0000000 ) + 382 O tau( 382) = ( 5.0000000 1.0000000 5.5000000 ) + 383 Mg tau( 383) = ( 5.0000000 1.0000000 5.0000000 ) + 384 O tau( 384) = ( 5.5000000 1.5000000 5.5000000 ) + 385 Mg tau( 385) = ( 5.5000000 1.5000000 5.0000000 ) + 386 O tau( 386) = ( 6.0000000 2.0000000 5.5000000 ) + 387 Mg tau( 387) = ( 6.0000000 2.0000000 5.0000000 ) + 388 O tau( 388) = ( 6.5000000 2.5000000 5.5000000 ) + 389 Mg tau( 389) = ( 6.5000000 2.5000000 5.0000000 ) + 390 O tau( 390) = ( 7.0000000 3.0000000 5.5000000 ) + 391 Mg tau( 391) = ( 7.0000000 3.0000000 5.0000000 ) + 392 O tau( 392) = ( 7.5000000 3.5000000 5.5000000 ) + 393 Mg tau( 393) = ( 7.5000000 3.5000000 5.0000000 ) + 394 O tau( 394) = ( 8.0000000 4.0000000 5.5000000 ) + 395 Mg tau( 395) = ( 8.0000000 4.0000000 5.0000000 ) + 396 O tau( 396) = ( 8.5000000 4.5000000 5.5000000 ) + 397 Mg tau( 397) = ( 8.5000000 4.5000000 5.0000000 ) + 398 O tau( 398) = ( 9.0000000 5.0000000 5.5000000 ) + 399 Mg tau( 399) = ( 9.0000000 5.0000000 5.0000000 ) + 400 O tau( 400) = ( 9.5000000 5.5000000 5.5000000 ) + 401 Mg tau( 401) = ( 0.0000000 1.0000000 1.0000000 ) + 402 O tau( 402) = ( 0.5000000 1.5000000 1.5000000 ) + 403 Mg tau( 403) = ( 0.5000000 1.5000000 1.0000000 ) + 404 O tau( 404) = ( 1.0000000 2.0000000 1.5000000 ) + 405 Mg tau( 405) = ( 1.0000000 2.0000000 1.0000000 ) + 406 O tau( 406) = ( 1.5000000 2.5000000 1.5000000 ) + 407 Mg tau( 407) = ( 1.5000000 2.5000000 1.0000000 ) + 408 O tau( 408) = ( 2.0000000 3.0000000 1.5000000 ) + 409 Mg tau( 409) = ( 2.0000000 3.0000000 1.0000000 ) + 410 O tau( 410) = ( 2.5000000 3.5000000 1.5000000 ) + 411 Mg tau( 411) = ( 2.5000000 3.5000000 1.0000000 ) + 412 O tau( 412) = ( 3.0000000 4.0000000 1.5000000 ) + 413 Mg tau( 413) = ( 3.0000000 4.0000000 1.0000000 ) + 414 O tau( 414) = ( 3.5000000 4.5000000 1.5000000 ) + 415 Mg tau( 415) = ( 3.5000000 4.5000000 1.0000000 ) + 416 O tau( 416) = ( 4.0000000 5.0000000 1.5000000 ) + 417 Mg tau( 417) = ( 4.0000000 5.0000000 1.0000000 ) + 418 O tau( 418) = ( 4.5000000 5.5000000 1.5000000 ) + 419 Mg tau( 419) = ( 4.5000000 5.5000000 1.0000000 ) + 420 O tau( 420) = ( 5.0000000 6.0000000 1.5000000 ) + 421 Mg tau( 421) = ( 0.5000000 1.0000000 1.5000000 ) + 422 O tau( 422) = ( 1.0000000 1.5000000 2.0000000 ) + 423 Mg tau( 423) = ( 1.0000000 1.5000000 1.5000000 ) + 424 O tau( 424) = ( 1.5000000 2.0000000 2.0000000 ) + 425 Mg tau( 425) = ( 1.5000000 2.0000000 1.5000000 ) + 426 O tau( 426) = ( 2.0000000 2.5000000 2.0000000 ) + 427 Mg tau( 427) = ( 2.0000000 2.5000000 1.5000000 ) + 428 O tau( 428) = ( 2.5000000 3.0000000 2.0000000 ) + 429 Mg tau( 429) = ( 2.5000000 3.0000000 1.5000000 ) + 430 O tau( 430) = ( 3.0000000 3.5000000 2.0000000 ) + 431 Mg tau( 431) = ( 3.0000000 3.5000000 1.5000000 ) + 432 O tau( 432) = ( 3.5000000 4.0000000 2.0000000 ) + 433 Mg tau( 433) = ( 3.5000000 4.0000000 1.5000000 ) + 434 O tau( 434) = ( 4.0000000 4.5000000 2.0000000 ) + 435 Mg tau( 435) = ( 4.0000000 4.5000000 1.5000000 ) + 436 O tau( 436) = ( 4.5000000 5.0000000 2.0000000 ) + 437 Mg tau( 437) = ( 4.5000000 5.0000000 1.5000000 ) + 438 O tau( 438) = ( 5.0000000 5.5000000 2.0000000 ) + 439 Mg tau( 439) = ( 5.0000000 5.5000000 1.5000000 ) + 440 O tau( 440) = ( 5.5000000 6.0000000 2.0000000 ) + 441 Mg tau( 441) = ( 1.0000000 1.0000000 2.0000000 ) + 442 O tau( 442) = ( 1.5000000 1.5000000 2.5000000 ) + 443 Mg tau( 443) = ( 1.5000000 1.5000000 2.0000000 ) + 444 O tau( 444) = ( 2.0000000 2.0000000 2.5000000 ) + 445 Mg tau( 445) = ( 2.0000000 2.0000000 2.0000000 ) + 446 O tau( 446) = ( 2.5000000 2.5000000 2.5000000 ) + 447 Mg tau( 447) = ( 2.5000000 2.5000000 2.0000000 ) + 448 O tau( 448) = ( 3.0000000 3.0000000 2.5000000 ) + 449 Mg tau( 449) = ( 3.0000000 3.0000000 2.0000000 ) + 450 O tau( 450) = ( 3.5000000 3.5000000 2.5000000 ) + 451 Mg tau( 451) = ( 3.5000000 3.5000000 2.0000000 ) + 452 O tau( 452) = ( 4.0000000 4.0000000 2.5000000 ) + 453 Mg tau( 453) = ( 4.0000000 4.0000000 2.0000000 ) + 454 O tau( 454) = ( 4.5000000 4.5000000 2.5000000 ) + 455 Mg tau( 455) = ( 4.5000000 4.5000000 2.0000000 ) + 456 O tau( 456) = ( 5.0000000 5.0000000 2.5000000 ) + 457 Mg tau( 457) = ( 5.0000000 5.0000000 2.0000000 ) + 458 O tau( 458) = ( 5.5000000 5.5000000 2.5000000 ) + 459 Mg tau( 459) = ( 5.5000000 5.5000000 2.0000000 ) + 460 O tau( 460) = ( 6.0000000 6.0000000 2.5000000 ) + 461 Mg tau( 461) = ( 1.5000000 1.0000000 2.5000000 ) + 462 O tau( 462) = ( 2.0000000 1.5000000 3.0000000 ) + 463 Mg tau( 463) = ( 2.0000000 1.5000000 2.5000000 ) + 464 O tau( 464) = ( 2.5000000 2.0000000 3.0000000 ) + 465 Mg tau( 465) = ( 2.5000000 2.0000000 2.5000000 ) + 466 O tau( 466) = ( 3.0000000 2.5000000 3.0000000 ) + 467 Mg tau( 467) = ( 3.0000000 2.5000000 2.5000000 ) + 468 O tau( 468) = ( 3.5000000 3.0000000 3.0000000 ) + 469 Mg tau( 469) = ( 3.5000000 3.0000000 2.5000000 ) + 470 O tau( 470) = ( 4.0000000 3.5000000 3.0000000 ) + 471 Mg tau( 471) = ( 4.0000000 3.5000000 2.5000000 ) + 472 O tau( 472) = ( 4.5000000 4.0000000 3.0000000 ) + 473 Mg tau( 473) = ( 4.5000000 4.0000000 2.5000000 ) + 474 O tau( 474) = ( 5.0000000 4.5000000 3.0000000 ) + 475 Mg tau( 475) = ( 5.0000000 4.5000000 2.5000000 ) + 476 O tau( 476) = ( 5.5000000 5.0000000 3.0000000 ) + 477 Mg tau( 477) = ( 5.5000000 5.0000000 2.5000000 ) + 478 O tau( 478) = ( 6.0000000 5.5000000 3.0000000 ) + 479 Mg tau( 479) = ( 6.0000000 5.5000000 2.5000000 ) + 480 O tau( 480) = ( 6.5000000 6.0000000 3.0000000 ) + 481 Mg tau( 481) = ( 2.0000000 1.0000000 3.0000000 ) + 482 O tau( 482) = ( 2.5000000 1.5000000 3.5000000 ) + 483 Mg tau( 483) = ( 2.5000000 1.5000000 3.0000000 ) + 484 O tau( 484) = ( 3.0000000 2.0000000 3.5000000 ) + 485 Mg tau( 485) = ( 3.0000000 2.0000000 3.0000000 ) + 486 O tau( 486) = ( 3.5000000 2.5000000 3.5000000 ) + 487 Mg tau( 487) = ( 3.5000000 2.5000000 3.0000000 ) + 488 O tau( 488) = ( 4.0000000 3.0000000 3.5000000 ) + 489 Mg tau( 489) = ( 4.0000000 3.0000000 3.0000000 ) + 490 O tau( 490) = ( 4.5000000 3.5000000 3.5000000 ) + 491 Mg tau( 491) = ( 4.5000000 3.5000000 3.0000000 ) + 492 O tau( 492) = ( 5.0000000 4.0000000 3.5000000 ) + 493 Mg tau( 493) = ( 5.0000000 4.0000000 3.0000000 ) + 494 O tau( 494) = ( 5.5000000 4.5000000 3.5000000 ) + 495 Mg tau( 495) = ( 5.5000000 4.5000000 3.0000000 ) + 496 O tau( 496) = ( 6.0000000 5.0000000 3.5000000 ) + 497 Mg tau( 497) = ( 6.0000000 5.0000000 3.0000000 ) + 498 O tau( 498) = ( 6.5000000 5.5000000 3.5000000 ) + 499 Mg tau( 499) = ( 6.5000000 5.5000000 3.0000000 ) + 500 O tau( 500) = ( 7.0000000 6.0000000 3.5000000 ) + 501 Mg tau( 501) = ( 2.5000000 1.0000000 3.5000000 ) + 502 O tau( 502) = ( 3.0000000 1.5000000 4.0000000 ) + 503 Mg tau( 503) = ( 3.0000000 1.5000000 3.5000000 ) + 504 O tau( 504) = ( 3.5000000 2.0000000 4.0000000 ) + 505 Mg tau( 505) = ( 3.5000000 2.0000000 3.5000000 ) + 506 O tau( 506) = ( 4.0000000 2.5000000 4.0000000 ) + 507 Mg tau( 507) = ( 4.0000000 2.5000000 3.5000000 ) + 508 O tau( 508) = ( 4.5000000 3.0000000 4.0000000 ) + 509 Mg tau( 509) = ( 4.5000000 3.0000000 3.5000000 ) + 510 O tau( 510) = ( 5.0000000 3.5000000 4.0000000 ) + 511 Mg tau( 511) = ( 5.0000000 3.5000000 3.5000000 ) + 512 O tau( 512) = ( 5.5000000 4.0000000 4.0000000 ) + 513 Mg tau( 513) = ( 5.5000000 4.0000000 3.5000000 ) + 514 O tau( 514) = ( 6.0000000 4.5000000 4.0000000 ) + 515 Mg tau( 515) = ( 6.0000000 4.5000000 3.5000000 ) + 516 O tau( 516) = ( 6.5000000 5.0000000 4.0000000 ) + 517 Mg tau( 517) = ( 6.5000000 5.0000000 3.5000000 ) + 518 O tau( 518) = ( 7.0000000 5.5000000 4.0000000 ) + 519 Mg tau( 519) = ( 7.0000000 5.5000000 3.5000000 ) + 520 O tau( 520) = ( 7.5000000 6.0000000 4.0000000 ) + 521 Mg tau( 521) = ( 3.0000000 1.0000000 4.0000000 ) + 522 O tau( 522) = ( 3.5000000 1.5000000 4.5000000 ) + 523 Mg tau( 523) = ( 3.5000000 1.5000000 4.0000000 ) + 524 O tau( 524) = ( 4.0000000 2.0000000 4.5000000 ) + 525 Mg tau( 525) = ( 4.0000000 2.0000000 4.0000000 ) + 526 O tau( 526) = ( 4.5000000 2.5000000 4.5000000 ) + 527 Mg tau( 527) = ( 4.5000000 2.5000000 4.0000000 ) + 528 O tau( 528) = ( 5.0000000 3.0000000 4.5000000 ) + 529 Mg tau( 529) = ( 5.0000000 3.0000000 4.0000000 ) + 530 O tau( 530) = ( 5.5000000 3.5000000 4.5000000 ) + 531 Mg tau( 531) = ( 5.5000000 3.5000000 4.0000000 ) + 532 O tau( 532) = ( 6.0000000 4.0000000 4.5000000 ) + 533 Mg tau( 533) = ( 6.0000000 4.0000000 4.0000000 ) + 534 O tau( 534) = ( 6.5000000 4.5000000 4.5000000 ) + 535 Mg tau( 535) = ( 6.5000000 4.5000000 4.0000000 ) + 536 O tau( 536) = ( 7.0000000 5.0000000 4.5000000 ) + 537 Mg tau( 537) = ( 7.0000000 5.0000000 4.0000000 ) + 538 O tau( 538) = ( 7.5000000 5.5000000 4.5000000 ) + 539 Mg tau( 539) = ( 7.5000000 5.5000000 4.0000000 ) + 540 O tau( 540) = ( 8.0000000 6.0000000 4.5000000 ) + 541 Mg tau( 541) = ( 3.5000000 1.0000000 4.5000000 ) + 542 O tau( 542) = ( 4.0000000 1.5000000 5.0000000 ) + 543 Mg tau( 543) = ( 4.0000000 1.5000000 4.5000000 ) + 544 O tau( 544) = ( 4.5000000 2.0000000 5.0000000 ) + 545 Mg tau( 545) = ( 4.5000000 2.0000000 4.5000000 ) + 546 O tau( 546) = ( 5.0000000 2.5000000 5.0000000 ) + 547 Mg tau( 547) = ( 5.0000000 2.5000000 4.5000000 ) + 548 O tau( 548) = ( 5.5000000 3.0000000 5.0000000 ) + 549 Mg tau( 549) = ( 5.5000000 3.0000000 4.5000000 ) + 550 O tau( 550) = ( 6.0000000 3.5000000 5.0000000 ) + 551 Mg tau( 551) = ( 6.0000000 3.5000000 4.5000000 ) + 552 O tau( 552) = ( 6.5000000 4.0000000 5.0000000 ) + 553 Mg tau( 553) = ( 6.5000000 4.0000000 4.5000000 ) + 554 O tau( 554) = ( 7.0000000 4.5000000 5.0000000 ) + 555 Mg tau( 555) = ( 7.0000000 4.5000000 4.5000000 ) + 556 O tau( 556) = ( 7.5000000 5.0000000 5.0000000 ) + 557 Mg tau( 557) = ( 7.5000000 5.0000000 4.5000000 ) + 558 O tau( 558) = ( 8.0000000 5.5000000 5.0000000 ) + 559 Mg tau( 559) = ( 8.0000000 5.5000000 4.5000000 ) + 560 O tau( 560) = ( 8.5000000 6.0000000 5.0000000 ) + 561 Mg tau( 561) = ( 4.0000000 1.0000000 5.0000000 ) + 562 O tau( 562) = ( 4.5000000 1.5000000 5.5000000 ) + 563 Mg tau( 563) = ( 4.5000000 1.5000000 5.0000000 ) + 564 O tau( 564) = ( 5.0000000 2.0000000 5.5000000 ) + 565 Mg tau( 565) = ( 5.0000000 2.0000000 5.0000000 ) + 566 O tau( 566) = ( 5.5000000 2.5000000 5.5000000 ) + 567 Mg tau( 567) = ( 5.5000000 2.5000000 5.0000000 ) + 568 O tau( 568) = ( 6.0000000 3.0000000 5.5000000 ) + 569 Mg tau( 569) = ( 6.0000000 3.0000000 5.0000000 ) + 570 O tau( 570) = ( 6.5000000 3.5000000 5.5000000 ) + 571 Mg tau( 571) = ( 6.5000000 3.5000000 5.0000000 ) + 572 O tau( 572) = ( 7.0000000 4.0000000 5.5000000 ) + 573 Mg tau( 573) = ( 7.0000000 4.0000000 5.0000000 ) + 574 O tau( 574) = ( 7.5000000 4.5000000 5.5000000 ) + 575 Mg tau( 575) = ( 7.5000000 4.5000000 5.0000000 ) + 576 O tau( 576) = ( 8.0000000 5.0000000 5.5000000 ) + 577 Mg tau( 577) = ( 8.0000000 5.0000000 5.0000000 ) + 578 O tau( 578) = ( 8.5000000 5.5000000 5.5000000 ) + 579 Mg tau( 579) = ( 8.5000000 5.5000000 5.0000000 ) + 580 O tau( 580) = ( 9.0000000 6.0000000 5.5000000 ) + 581 Mg tau( 581) = ( 4.5000000 1.0000000 5.5000000 ) + 582 O tau( 582) = ( 5.0000000 1.5000000 6.0000000 ) + 583 Mg tau( 583) = ( 5.0000000 1.5000000 5.5000000 ) + 584 O tau( 584) = ( 5.5000000 2.0000000 6.0000000 ) + 585 Mg tau( 585) = ( 5.5000000 2.0000000 5.5000000 ) + 586 O tau( 586) = ( 6.0000000 2.5000000 6.0000000 ) + 587 Mg tau( 587) = ( 6.0000000 2.5000000 5.5000000 ) + 588 O tau( 588) = ( 6.5000000 3.0000000 6.0000000 ) + 589 Mg tau( 589) = ( 6.5000000 3.0000000 5.5000000 ) + 590 O tau( 590) = ( 7.0000000 3.5000000 6.0000000 ) + 591 Mg tau( 591) = ( 7.0000000 3.5000000 5.5000000 ) + 592 O tau( 592) = ( 7.5000000 4.0000000 6.0000000 ) + 593 Mg tau( 593) = ( 7.5000000 4.0000000 5.5000000 ) + 594 O tau( 594) = ( 8.0000000 4.5000000 6.0000000 ) + 595 Mg tau( 595) = ( 8.0000000 4.5000000 5.5000000 ) + 596 O tau( 596) = ( 8.5000000 5.0000000 6.0000000 ) + 597 Mg tau( 597) = ( 8.5000000 5.0000000 5.5000000 ) + 598 O tau( 598) = ( 9.0000000 5.5000000 6.0000000 ) + 599 Mg tau( 599) = ( 9.0000000 5.5000000 5.5000000 ) + 600 O tau( 600) = ( 9.5000000 6.0000000 6.0000000 ) + 601 Mg tau( 601) = ( 0.0000000 1.5000000 1.5000000 ) + 602 O tau( 602) = ( 0.5000000 2.0000000 2.0000000 ) + 603 Mg tau( 603) = ( 0.5000000 2.0000000 1.5000000 ) + 604 O tau( 604) = ( 1.0000000 2.5000000 2.0000000 ) + 605 Mg tau( 605) = ( 1.0000000 2.5000000 1.5000000 ) + 606 O tau( 606) = ( 1.5000000 3.0000000 2.0000000 ) + 607 Mg tau( 607) = ( 1.5000000 3.0000000 1.5000000 ) + 608 O tau( 608) = ( 2.0000000 3.5000000 2.0000000 ) + 609 Mg tau( 609) = ( 2.0000000 3.5000000 1.5000000 ) + 610 O tau( 610) = ( 2.5000000 4.0000000 2.0000000 ) + 611 Mg tau( 611) = ( 2.5000000 4.0000000 1.5000000 ) + 612 O tau( 612) = ( 3.0000000 4.5000000 2.0000000 ) + 613 Mg tau( 613) = ( 3.0000000 4.5000000 1.5000000 ) + 614 O tau( 614) = ( 3.5000000 5.0000000 2.0000000 ) + 615 Mg tau( 615) = ( 3.5000000 5.0000000 1.5000000 ) + 616 O tau( 616) = ( 4.0000000 5.5000000 2.0000000 ) + 617 Mg tau( 617) = ( 4.0000000 5.5000000 1.5000000 ) + 618 O tau( 618) = ( 4.5000000 6.0000000 2.0000000 ) + 619 Mg tau( 619) = ( 4.5000000 6.0000000 1.5000000 ) + 620 O tau( 620) = ( 5.0000000 6.5000000 2.0000000 ) + 621 Mg tau( 621) = ( 0.5000000 1.5000000 2.0000000 ) + 622 O tau( 622) = ( 1.0000000 2.0000000 2.5000000 ) + 623 Mg tau( 623) = ( 1.0000000 2.0000000 2.0000000 ) + 624 O tau( 624) = ( 1.5000000 2.5000000 2.5000000 ) + 625 Mg tau( 625) = ( 1.5000000 2.5000000 2.0000000 ) + 626 O tau( 626) = ( 2.0000000 3.0000000 2.5000000 ) + 627 Mg tau( 627) = ( 2.0000000 3.0000000 2.0000000 ) + 628 O tau( 628) = ( 2.5000000 3.5000000 2.5000000 ) + 629 Mg tau( 629) = ( 2.5000000 3.5000000 2.0000000 ) + 630 O tau( 630) = ( 3.0000000 4.0000000 2.5000000 ) + 631 Mg tau( 631) = ( 3.0000000 4.0000000 2.0000000 ) + 632 O tau( 632) = ( 3.5000000 4.5000000 2.5000000 ) + 633 Mg tau( 633) = ( 3.5000000 4.5000000 2.0000000 ) + 634 O tau( 634) = ( 4.0000000 5.0000000 2.5000000 ) + 635 Mg tau( 635) = ( 4.0000000 5.0000000 2.0000000 ) + 636 O tau( 636) = ( 4.5000000 5.5000000 2.5000000 ) + 637 Mg tau( 637) = ( 4.5000000 5.5000000 2.0000000 ) + 638 O tau( 638) = ( 5.0000000 6.0000000 2.5000000 ) + 639 Mg tau( 639) = ( 5.0000000 6.0000000 2.0000000 ) + 640 O tau( 640) = ( 5.5000000 6.5000000 2.5000000 ) + 641 Mg tau( 641) = ( 1.0000000 1.5000000 2.5000000 ) + 642 O tau( 642) = ( 1.5000000 2.0000000 3.0000000 ) + 643 Mg tau( 643) = ( 1.5000000 2.0000000 2.5000000 ) + 644 O tau( 644) = ( 2.0000000 2.5000000 3.0000000 ) + 645 Mg tau( 645) = ( 2.0000000 2.5000000 2.5000000 ) + 646 O tau( 646) = ( 2.5000000 3.0000000 3.0000000 ) + 647 Mg tau( 647) = ( 2.5000000 3.0000000 2.5000000 ) + 648 O tau( 648) = ( 3.0000000 3.5000000 3.0000000 ) + 649 Mg tau( 649) = ( 3.0000000 3.5000000 2.5000000 ) + 650 O tau( 650) = ( 3.5000000 4.0000000 3.0000000 ) + 651 Mg tau( 651) = ( 3.5000000 4.0000000 2.5000000 ) + 652 O tau( 652) = ( 4.0000000 4.5000000 3.0000000 ) + 653 Mg tau( 653) = ( 4.0000000 4.5000000 2.5000000 ) + 654 O tau( 654) = ( 4.5000000 5.0000000 3.0000000 ) + 655 Mg tau( 655) = ( 4.5000000 5.0000000 2.5000000 ) + 656 O tau( 656) = ( 5.0000000 5.5000000 3.0000000 ) + 657 Mg tau( 657) = ( 5.0000000 5.5000000 2.5000000 ) + 658 O tau( 658) = ( 5.5000000 6.0000000 3.0000000 ) + 659 Mg tau( 659) = ( 5.5000000 6.0000000 2.5000000 ) + 660 O tau( 660) = ( 6.0000000 6.5000000 3.0000000 ) + 661 Mg tau( 661) = ( 1.5000000 1.5000000 3.0000000 ) + 662 O tau( 662) = ( 2.0000000 2.0000000 3.5000000 ) + 663 Mg tau( 663) = ( 2.0000000 2.0000000 3.0000000 ) + 664 O tau( 664) = ( 2.5000000 2.5000000 3.5000000 ) + 665 Mg tau( 665) = ( 2.5000000 2.5000000 3.0000000 ) + 666 O tau( 666) = ( 3.0000000 3.0000000 3.5000000 ) + 667 Mg tau( 667) = ( 3.0000000 3.0000000 3.0000000 ) + 668 O tau( 668) = ( 3.5000000 3.5000000 3.5000000 ) + 669 Mg tau( 669) = ( 3.5000000 3.5000000 3.0000000 ) + 670 O tau( 670) = ( 4.0000000 4.0000000 3.5000000 ) + 671 Mg tau( 671) = ( 4.0000000 4.0000000 3.0000000 ) + 672 O tau( 672) = ( 4.5000000 4.5000000 3.5000000 ) + 673 Mg tau( 673) = ( 4.5000000 4.5000000 3.0000000 ) + 674 O tau( 674) = ( 5.0000000 5.0000000 3.5000000 ) + 675 Mg tau( 675) = ( 5.0000000 5.0000000 3.0000000 ) + 676 O tau( 676) = ( 5.5000000 5.5000000 3.5000000 ) + 677 Mg tau( 677) = ( 5.5000000 5.5000000 3.0000000 ) + 678 O tau( 678) = ( 6.0000000 6.0000000 3.5000000 ) + 679 Mg tau( 679) = ( 6.0000000 6.0000000 3.0000000 ) + 680 O tau( 680) = ( 6.5000000 6.5000000 3.5000000 ) + 681 Mg tau( 681) = ( 2.0000000 1.5000000 3.5000000 ) + 682 O tau( 682) = ( 2.5000000 2.0000000 4.0000000 ) + 683 Mg tau( 683) = ( 2.5000000 2.0000000 3.5000000 ) + 684 O tau( 684) = ( 3.0000000 2.5000000 4.0000000 ) + 685 Mg tau( 685) = ( 3.0000000 2.5000000 3.5000000 ) + 686 O tau( 686) = ( 3.5000000 3.0000000 4.0000000 ) + 687 Mg tau( 687) = ( 3.5000000 3.0000000 3.5000000 ) + 688 O tau( 688) = ( 4.0000000 3.5000000 4.0000000 ) + 689 Mg tau( 689) = ( 4.0000000 3.5000000 3.5000000 ) + 690 O tau( 690) = ( 4.5000000 4.0000000 4.0000000 ) + 691 Mg tau( 691) = ( 4.5000000 4.0000000 3.5000000 ) + 692 O tau( 692) = ( 5.0000000 4.5000000 4.0000000 ) + 693 Mg tau( 693) = ( 5.0000000 4.5000000 3.5000000 ) + 694 O tau( 694) = ( 5.5000000 5.0000000 4.0000000 ) + 695 Mg tau( 695) = ( 5.5000000 5.0000000 3.5000000 ) + 696 O tau( 696) = ( 6.0000000 5.5000000 4.0000000 ) + 697 Mg tau( 697) = ( 6.0000000 5.5000000 3.5000000 ) + 698 O tau( 698) = ( 6.5000000 6.0000000 4.0000000 ) + 699 Mg tau( 699) = ( 6.5000000 6.0000000 3.5000000 ) + 700 O tau( 700) = ( 7.0000000 6.5000000 4.0000000 ) + 701 Mg tau( 701) = ( 2.5000000 1.5000000 4.0000000 ) + 702 O tau( 702) = ( 3.0000000 2.0000000 4.5000000 ) + 703 Mg tau( 703) = ( 3.0000000 2.0000000 4.0000000 ) + 704 O tau( 704) = ( 3.5000000 2.5000000 4.5000000 ) + 705 Mg tau( 705) = ( 3.5000000 2.5000000 4.0000000 ) + 706 O tau( 706) = ( 4.0000000 3.0000000 4.5000000 ) + 707 Mg tau( 707) = ( 4.0000000 3.0000000 4.0000000 ) + 708 O tau( 708) = ( 4.5000000 3.5000000 4.5000000 ) + 709 Mg tau( 709) = ( 4.5000000 3.5000000 4.0000000 ) + 710 O tau( 710) = ( 5.0000000 4.0000000 4.5000000 ) + 711 Mg tau( 711) = ( 5.0000000 4.0000000 4.0000000 ) + 712 O tau( 712) = ( 5.5000000 4.5000000 4.5000000 ) + 713 Mg tau( 713) = ( 5.5000000 4.5000000 4.0000000 ) + 714 O tau( 714) = ( 6.0000000 5.0000000 4.5000000 ) + 715 Mg tau( 715) = ( 6.0000000 5.0000000 4.0000000 ) + 716 O tau( 716) = ( 6.5000000 5.5000000 4.5000000 ) + 717 Mg tau( 717) = ( 6.5000000 5.5000000 4.0000000 ) + 718 O tau( 718) = ( 7.0000000 6.0000000 4.5000000 ) + 719 Mg tau( 719) = ( 7.0000000 6.0000000 4.0000000 ) + 720 O tau( 720) = ( 7.5000000 6.5000000 4.5000000 ) + 721 Mg tau( 721) = ( 3.0000000 1.5000000 4.5000000 ) + 722 O tau( 722) = ( 3.5000000 2.0000000 5.0000000 ) + 723 Mg tau( 723) = ( 3.5000000 2.0000000 4.5000000 ) + 724 O tau( 724) = ( 4.0000000 2.5000000 5.0000000 ) + 725 Mg tau( 725) = ( 4.0000000 2.5000000 4.5000000 ) + 726 O tau( 726) = ( 4.5000000 3.0000000 5.0000000 ) + 727 Mg tau( 727) = ( 4.5000000 3.0000000 4.5000000 ) + 728 O tau( 728) = ( 5.0000000 3.5000000 5.0000000 ) + 729 Mg tau( 729) = ( 5.0000000 3.5000000 4.5000000 ) + 730 O tau( 730) = ( 5.5000000 4.0000000 5.0000000 ) + 731 Mg tau( 731) = ( 5.5000000 4.0000000 4.5000000 ) + 732 O tau( 732) = ( 6.0000000 4.5000000 5.0000000 ) + 733 Mg tau( 733) = ( 6.0000000 4.5000000 4.5000000 ) + 734 O tau( 734) = ( 6.5000000 5.0000000 5.0000000 ) + 735 Mg tau( 735) = ( 6.5000000 5.0000000 4.5000000 ) + 736 O tau( 736) = ( 7.0000000 5.5000000 5.0000000 ) + 737 Mg tau( 737) = ( 7.0000000 5.5000000 4.5000000 ) + 738 O tau( 738) = ( 7.5000000 6.0000000 5.0000000 ) + 739 Mg tau( 739) = ( 7.5000000 6.0000000 4.5000000 ) + 740 O tau( 740) = ( 8.0000000 6.5000000 5.0000000 ) + 741 Mg tau( 741) = ( 3.5000000 1.5000000 5.0000000 ) + 742 O tau( 742) = ( 4.0000000 2.0000000 5.5000000 ) + 743 Mg tau( 743) = ( 4.0000000 2.0000000 5.0000000 ) + 744 O tau( 744) = ( 4.5000000 2.5000000 5.5000000 ) + 745 Mg tau( 745) = ( 4.5000000 2.5000000 5.0000000 ) + 746 O tau( 746) = ( 5.0000000 3.0000000 5.5000000 ) + 747 Mg tau( 747) = ( 5.0000000 3.0000000 5.0000000 ) + 748 O tau( 748) = ( 5.5000000 3.5000000 5.5000000 ) + 749 Mg tau( 749) = ( 5.5000000 3.5000000 5.0000000 ) + 750 O tau( 750) = ( 6.0000000 4.0000000 5.5000000 ) + 751 Mg tau( 751) = ( 6.0000000 4.0000000 5.0000000 ) + 752 O tau( 752) = ( 6.5000000 4.5000000 5.5000000 ) + 753 Mg tau( 753) = ( 6.5000000 4.5000000 5.0000000 ) + 754 O tau( 754) = ( 7.0000000 5.0000000 5.5000000 ) + 755 Mg tau( 755) = ( 7.0000000 5.0000000 5.0000000 ) + 756 O tau( 756) = ( 7.5000000 5.5000000 5.5000000 ) + 757 Mg tau( 757) = ( 7.5000000 5.5000000 5.0000000 ) + 758 O tau( 758) = ( 8.0000000 6.0000000 5.5000000 ) + 759 Mg tau( 759) = ( 8.0000000 6.0000000 5.0000000 ) + 760 O tau( 760) = ( 8.5000000 6.5000000 5.5000000 ) + 761 Mg tau( 761) = ( 4.0000000 1.5000000 5.5000000 ) + 762 O tau( 762) = ( 4.5000000 2.0000000 6.0000000 ) + 763 Mg tau( 763) = ( 4.5000000 2.0000000 5.5000000 ) + 764 O tau( 764) = ( 5.0000000 2.5000000 6.0000000 ) + 765 Mg tau( 765) = ( 5.0000000 2.5000000 5.5000000 ) + 766 O tau( 766) = ( 5.5000000 3.0000000 6.0000000 ) + 767 Mg tau( 767) = ( 5.5000000 3.0000000 5.5000000 ) + 768 O tau( 768) = ( 6.0000000 3.5000000 6.0000000 ) + 769 Mg tau( 769) = ( 6.0000000 3.5000000 5.5000000 ) + 770 O tau( 770) = ( 6.5000000 4.0000000 6.0000000 ) + 771 Mg tau( 771) = ( 6.5000000 4.0000000 5.5000000 ) + 772 O tau( 772) = ( 7.0000000 4.5000000 6.0000000 ) + 773 Mg tau( 773) = ( 7.0000000 4.5000000 5.5000000 ) + 774 O tau( 774) = ( 7.5000000 5.0000000 6.0000000 ) + 775 Mg tau( 775) = ( 7.5000000 5.0000000 5.5000000 ) + 776 O tau( 776) = ( 8.0000000 5.5000000 6.0000000 ) + 777 Mg tau( 777) = ( 8.0000000 5.5000000 5.5000000 ) + 778 O tau( 778) = ( 8.5000000 6.0000000 6.0000000 ) + 779 Mg tau( 779) = ( 8.5000000 6.0000000 5.5000000 ) + 780 O tau( 780) = ( 9.0000000 6.5000000 6.0000000 ) + 781 Mg tau( 781) = ( 4.5000000 1.5000000 6.0000000 ) + 782 O tau( 782) = ( 5.0000000 2.0000000 6.5000000 ) + 783 Mg tau( 783) = ( 5.0000000 2.0000000 6.0000000 ) + 784 O tau( 784) = ( 5.5000000 2.5000000 6.5000000 ) + 785 Mg tau( 785) = ( 5.5000000 2.5000000 6.0000000 ) + 786 O tau( 786) = ( 6.0000000 3.0000000 6.5000000 ) + 787 Mg tau( 787) = ( 6.0000000 3.0000000 6.0000000 ) + 788 O tau( 788) = ( 6.5000000 3.5000000 6.5000000 ) + 789 Mg tau( 789) = ( 6.5000000 3.5000000 6.0000000 ) + 790 O tau( 790) = ( 7.0000000 4.0000000 6.5000000 ) + 791 Mg tau( 791) = ( 7.0000000 4.0000000 6.0000000 ) + 792 O tau( 792) = ( 7.5000000 4.5000000 6.5000000 ) + 793 Mg tau( 793) = ( 7.5000000 4.5000000 6.0000000 ) + 794 O tau( 794) = ( 8.0000000 5.0000000 6.5000000 ) + 795 Mg tau( 795) = ( 8.0000000 5.0000000 6.0000000 ) + 796 O tau( 796) = ( 8.5000000 5.5000000 6.5000000 ) + 797 Mg tau( 797) = ( 8.5000000 5.5000000 6.0000000 ) + 798 O tau( 798) = ( 9.0000000 6.0000000 6.5000000 ) + 799 Mg tau( 799) = ( 9.0000000 6.0000000 6.0000000 ) + 800 O tau( 800) = ( 9.5000000 6.5000000 6.5000000 ) + 801 Mg tau( 801) = ( 0.0000000 2.0000000 2.0000000 ) + 802 O tau( 802) = ( 0.5000000 2.5000000 2.5000000 ) + 803 Mg tau( 803) = ( 0.5000000 2.5000000 2.0000000 ) + 804 O tau( 804) = ( 1.0000000 3.0000000 2.5000000 ) + 805 Mg tau( 805) = ( 1.0000000 3.0000000 2.0000000 ) + 806 O tau( 806) = ( 1.5000000 3.5000000 2.5000000 ) + 807 Mg tau( 807) = ( 1.5000000 3.5000000 2.0000000 ) + 808 O tau( 808) = ( 2.0000000 4.0000000 2.5000000 ) + 809 Mg tau( 809) = ( 2.0000000 4.0000000 2.0000000 ) + 810 O tau( 810) = ( 2.5000000 4.5000000 2.5000000 ) + 811 Mg tau( 811) = ( 2.5000000 4.5000000 2.0000000 ) + 812 O tau( 812) = ( 3.0000000 5.0000000 2.5000000 ) + 813 Mg tau( 813) = ( 3.0000000 5.0000000 2.0000000 ) + 814 O tau( 814) = ( 3.5000000 5.5000000 2.5000000 ) + 815 Mg tau( 815) = ( 3.5000000 5.5000000 2.0000000 ) + 816 O tau( 816) = ( 4.0000000 6.0000000 2.5000000 ) + 817 Mg tau( 817) = ( 4.0000000 6.0000000 2.0000000 ) + 818 O tau( 818) = ( 4.5000000 6.5000000 2.5000000 ) + 819 Mg tau( 819) = ( 4.5000000 6.5000000 2.0000000 ) + 820 O tau( 820) = ( 5.0000000 7.0000000 2.5000000 ) + 821 Mg tau( 821) = ( 0.5000000 2.0000000 2.5000000 ) + 822 O tau( 822) = ( 1.0000000 2.5000000 3.0000000 ) + 823 Mg tau( 823) = ( 1.0000000 2.5000000 2.5000000 ) + 824 O tau( 824) = ( 1.5000000 3.0000000 3.0000000 ) + 825 Mg tau( 825) = ( 1.5000000 3.0000000 2.5000000 ) + 826 O tau( 826) = ( 2.0000000 3.5000000 3.0000000 ) + 827 Mg tau( 827) = ( 2.0000000 3.5000000 2.5000000 ) + 828 O tau( 828) = ( 2.5000000 4.0000000 3.0000000 ) + 829 Mg tau( 829) = ( 2.5000000 4.0000000 2.5000000 ) + 830 O tau( 830) = ( 3.0000000 4.5000000 3.0000000 ) + 831 Mg tau( 831) = ( 3.0000000 4.5000000 2.5000000 ) + 832 O tau( 832) = ( 3.5000000 5.0000000 3.0000000 ) + 833 Mg tau( 833) = ( 3.5000000 5.0000000 2.5000000 ) + 834 O tau( 834) = ( 4.0000000 5.5000000 3.0000000 ) + 835 Mg tau( 835) = ( 4.0000000 5.5000000 2.5000000 ) + 836 O tau( 836) = ( 4.5000000 6.0000000 3.0000000 ) + 837 Mg tau( 837) = ( 4.5000000 6.0000000 2.5000000 ) + 838 O tau( 838) = ( 5.0000000 6.5000000 3.0000000 ) + 839 Mg tau( 839) = ( 5.0000000 6.5000000 2.5000000 ) + 840 O tau( 840) = ( 5.5000000 7.0000000 3.0000000 ) + 841 Mg tau( 841) = ( 1.0000000 2.0000000 3.0000000 ) + 842 O tau( 842) = ( 1.5000000 2.5000000 3.5000000 ) + 843 Mg tau( 843) = ( 1.5000000 2.5000000 3.0000000 ) + 844 O tau( 844) = ( 2.0000000 3.0000000 3.5000000 ) + 845 Mg tau( 845) = ( 2.0000000 3.0000000 3.0000000 ) + 846 O tau( 846) = ( 2.5000000 3.5000000 3.5000000 ) + 847 Mg tau( 847) = ( 2.5000000 3.5000000 3.0000000 ) + 848 O tau( 848) = ( 3.0000000 4.0000000 3.5000000 ) + 849 Mg tau( 849) = ( 3.0000000 4.0000000 3.0000000 ) + 850 O tau( 850) = ( 3.5000000 4.5000000 3.5000000 ) + 851 Mg tau( 851) = ( 3.5000000 4.5000000 3.0000000 ) + 852 O tau( 852) = ( 4.0000000 5.0000000 3.5000000 ) + 853 Mg tau( 853) = ( 4.0000000 5.0000000 3.0000000 ) + 854 O tau( 854) = ( 4.5000000 5.5000000 3.5000000 ) + 855 Mg tau( 855) = ( 4.5000000 5.5000000 3.0000000 ) + 856 O tau( 856) = ( 5.0000000 6.0000000 3.5000000 ) + 857 Mg tau( 857) = ( 5.0000000 6.0000000 3.0000000 ) + 858 O tau( 858) = ( 5.5000000 6.5000000 3.5000000 ) + 859 Mg tau( 859) = ( 5.5000000 6.5000000 3.0000000 ) + 860 O tau( 860) = ( 6.0000000 7.0000000 3.5000000 ) + 861 Mg tau( 861) = ( 1.5000000 2.0000000 3.5000000 ) + 862 O tau( 862) = ( 2.0000000 2.5000000 4.0000000 ) + 863 Mg tau( 863) = ( 2.0000000 2.5000000 3.5000000 ) + 864 O tau( 864) = ( 2.5000000 3.0000000 4.0000000 ) + 865 Mg tau( 865) = ( 2.5000000 3.0000000 3.5000000 ) + 866 O tau( 866) = ( 3.0000000 3.5000000 4.0000000 ) + 867 Mg tau( 867) = ( 3.0000000 3.5000000 3.5000000 ) + 868 O tau( 868) = ( 3.5000000 4.0000000 4.0000000 ) + 869 Mg tau( 869) = ( 3.5000000 4.0000000 3.5000000 ) + 870 O tau( 870) = ( 4.0000000 4.5000000 4.0000000 ) + 871 Mg tau( 871) = ( 4.0000000 4.5000000 3.5000000 ) + 872 O tau( 872) = ( 4.5000000 5.0000000 4.0000000 ) + 873 Mg tau( 873) = ( 4.5000000 5.0000000 3.5000000 ) + 874 O tau( 874) = ( 5.0000000 5.5000000 4.0000000 ) + 875 Mg tau( 875) = ( 5.0000000 5.5000000 3.5000000 ) + 876 O tau( 876) = ( 5.5000000 6.0000000 4.0000000 ) + 877 Mg tau( 877) = ( 5.5000000 6.0000000 3.5000000 ) + 878 O tau( 878) = ( 6.0000000 6.5000000 4.0000000 ) + 879 Mg tau( 879) = ( 6.0000000 6.5000000 3.5000000 ) + 880 O tau( 880) = ( 6.5000000 7.0000000 4.0000000 ) + 881 Mg tau( 881) = ( 2.0000000 2.0000000 4.0000000 ) + 882 O tau( 882) = ( 2.5000000 2.5000000 4.5000000 ) + 883 Mg tau( 883) = ( 2.5000000 2.5000000 4.0000000 ) + 884 O tau( 884) = ( 3.0000000 3.0000000 4.5000000 ) + 885 Mg tau( 885) = ( 3.0000000 3.0000000 4.0000000 ) + 886 O tau( 886) = ( 3.5000000 3.5000000 4.5000000 ) + 887 Mg tau( 887) = ( 3.5000000 3.5000000 4.0000000 ) + 888 O tau( 888) = ( 4.0000000 4.0000000 4.5000000 ) + 889 Mg tau( 889) = ( 4.0000000 4.0000000 4.0000000 ) + 890 O tau( 890) = ( 4.5000000 4.5000000 4.5000000 ) + 891 Mg tau( 891) = ( 4.5000000 4.5000000 4.0000000 ) + 892 O tau( 892) = ( 5.0000000 5.0000000 4.5000000 ) + 893 Mg tau( 893) = ( 5.0000000 5.0000000 4.0000000 ) + 894 O tau( 894) = ( 5.5000000 5.5000000 4.5000000 ) + 895 Mg tau( 895) = ( 5.5000000 5.5000000 4.0000000 ) + 896 O tau( 896) = ( 6.0000000 6.0000000 4.5000000 ) + 897 Mg tau( 897) = ( 6.0000000 6.0000000 4.0000000 ) + 898 O tau( 898) = ( 6.5000000 6.5000000 4.5000000 ) + 899 Mg tau( 899) = ( 6.5000000 6.5000000 4.0000000 ) + 900 O tau( 900) = ( 7.0000000 7.0000000 4.5000000 ) + 901 Mg tau( 901) = ( 2.5000000 2.0000000 4.5000000 ) + 902 O tau( 902) = ( 3.0000000 2.5000000 5.0000000 ) + 903 Mg tau( 903) = ( 3.0000000 2.5000000 4.5000000 ) + 904 O tau( 904) = ( 3.5000000 3.0000000 5.0000000 ) + 905 Mg tau( 905) = ( 3.5000000 3.0000000 4.5000000 ) + 906 O tau( 906) = ( 4.0000000 3.5000000 5.0000000 ) + 907 Mg tau( 907) = ( 4.0000000 3.5000000 4.5000000 ) + 908 O tau( 908) = ( 4.5000000 4.0000000 5.0000000 ) + 909 Mg tau( 909) = ( 4.5000000 4.0000000 4.5000000 ) + 910 O tau( 910) = ( 5.0000000 4.5000000 5.0000000 ) + 911 Mg tau( 911) = ( 5.0000000 4.5000000 4.5000000 ) + 912 O tau( 912) = ( 5.5000000 5.0000000 5.0000000 ) + 913 Mg tau( 913) = ( 5.5000000 5.0000000 4.5000000 ) + 914 O tau( 914) = ( 6.0000000 5.5000000 5.0000000 ) + 915 Mg tau( 915) = ( 6.0000000 5.5000000 4.5000000 ) + 916 O tau( 916) = ( 6.5000000 6.0000000 5.0000000 ) + 917 Mg tau( 917) = ( 6.5000000 6.0000000 4.5000000 ) + 918 O tau( 918) = ( 7.0000000 6.5000000 5.0000000 ) + 919 Mg tau( 919) = ( 7.0000000 6.5000000 4.5000000 ) + 920 O tau( 920) = ( 7.5000000 7.0000000 5.0000000 ) + 921 Mg tau( 921) = ( 3.0000000 2.0000000 5.0000000 ) + 922 O tau( 922) = ( 3.5000000 2.5000000 5.5000000 ) + 923 Mg tau( 923) = ( 3.5000000 2.5000000 5.0000000 ) + 924 O tau( 924) = ( 4.0000000 3.0000000 5.5000000 ) + 925 Mg tau( 925) = ( 4.0000000 3.0000000 5.0000000 ) + 926 O tau( 926) = ( 4.5000000 3.5000000 5.5000000 ) + 927 Mg tau( 927) = ( 4.5000000 3.5000000 5.0000000 ) + 928 O tau( 928) = ( 5.0000000 4.0000000 5.5000000 ) + 929 Mg tau( 929) = ( 5.0000000 4.0000000 5.0000000 ) + 930 O tau( 930) = ( 5.5000000 4.5000000 5.5000000 ) + 931 Mg tau( 931) = ( 5.5000000 4.5000000 5.0000000 ) + 932 O tau( 932) = ( 6.0000000 5.0000000 5.5000000 ) + 933 Mg tau( 933) = ( 6.0000000 5.0000000 5.0000000 ) + 934 O tau( 934) = ( 6.5000000 5.5000000 5.5000000 ) + 935 Mg tau( 935) = ( 6.5000000 5.5000000 5.0000000 ) + 936 O tau( 936) = ( 7.0000000 6.0000000 5.5000000 ) + 937 Mg tau( 937) = ( 7.0000000 6.0000000 5.0000000 ) + 938 O tau( 938) = ( 7.5000000 6.5000000 5.5000000 ) + 939 Mg tau( 939) = ( 7.5000000 6.5000000 5.0000000 ) + 940 O tau( 940) = ( 8.0000000 7.0000000 5.5000000 ) + 941 Mg tau( 941) = ( 3.5000000 2.0000000 5.5000000 ) + 942 O tau( 942) = ( 4.0000000 2.5000000 6.0000000 ) + 943 Mg tau( 943) = ( 4.0000000 2.5000000 5.5000000 ) + 944 O tau( 944) = ( 4.5000000 3.0000000 6.0000000 ) + 945 Mg tau( 945) = ( 4.5000000 3.0000000 5.5000000 ) + 946 O tau( 946) = ( 5.0000000 3.5000000 6.0000000 ) + 947 Mg tau( 947) = ( 5.0000000 3.5000000 5.5000000 ) + 948 O tau( 948) = ( 5.5000000 4.0000000 6.0000000 ) + 949 Mg tau( 949) = ( 5.5000000 4.0000000 5.5000000 ) + 950 O tau( 950) = ( 6.0000000 4.5000000 6.0000000 ) + 951 Mg tau( 951) = ( 6.0000000 4.5000000 5.5000000 ) + 952 O tau( 952) = ( 6.5000000 5.0000000 6.0000000 ) + 953 Mg tau( 953) = ( 6.5000000 5.0000000 5.5000000 ) + 954 O tau( 954) = ( 7.0000000 5.5000000 6.0000000 ) + 955 Mg tau( 955) = ( 7.0000000 5.5000000 5.5000000 ) + 956 O tau( 956) = ( 7.5000000 6.0000000 6.0000000 ) + 957 Mg tau( 957) = ( 7.5000000 6.0000000 5.5000000 ) + 958 O tau( 958) = ( 8.0000000 6.5000000 6.0000000 ) + 959 Mg tau( 959) = ( 8.0000000 6.5000000 5.5000000 ) + 960 O tau( 960) = ( 8.5000000 7.0000000 6.0000000 ) + 961 Mg tau( 961) = ( 4.0000000 2.0000000 6.0000000 ) + 962 O tau( 962) = ( 4.5000000 2.5000000 6.5000000 ) + 963 Mg tau( 963) = ( 4.5000000 2.5000000 6.0000000 ) + 964 O tau( 964) = ( 5.0000000 3.0000000 6.5000000 ) + 965 Mg tau( 965) = ( 5.0000000 3.0000000 6.0000000 ) + 966 O tau( 966) = ( 5.5000000 3.5000000 6.5000000 ) + 967 Mg tau( 967) = ( 5.5000000 3.5000000 6.0000000 ) + 968 O tau( 968) = ( 6.0000000 4.0000000 6.5000000 ) + 969 Mg tau( 969) = ( 6.0000000 4.0000000 6.0000000 ) + 970 O tau( 970) = ( 6.5000000 4.5000000 6.5000000 ) + 971 Mg tau( 971) = ( 6.5000000 4.5000000 6.0000000 ) + 972 O tau( 972) = ( 7.0000000 5.0000000 6.5000000 ) + 973 Mg tau( 973) = ( 7.0000000 5.0000000 6.0000000 ) + 974 O tau( 974) = ( 7.5000000 5.5000000 6.5000000 ) + 975 Mg tau( 975) = ( 7.5000000 5.5000000 6.0000000 ) + 976 O tau( 976) = ( 8.0000000 6.0000000 6.5000000 ) + 977 Mg tau( 977) = ( 8.0000000 6.0000000 6.0000000 ) + 978 O tau( 978) = ( 8.5000000 6.5000000 6.5000000 ) + 979 Mg tau( 979) = ( 8.5000000 6.5000000 6.0000000 ) + 980 O tau( 980) = ( 9.0000000 7.0000000 6.5000000 ) + 981 Mg tau( 981) = ( 4.5000000 2.0000000 6.5000000 ) + 982 O tau( 982) = ( 5.0000000 2.5000000 7.0000000 ) + 983 Mg tau( 983) = ( 5.0000000 2.5000000 6.5000000 ) + 984 O tau( 984) = ( 5.5000000 3.0000000 7.0000000 ) + 985 Mg tau( 985) = ( 5.5000000 3.0000000 6.5000000 ) + 986 O tau( 986) = ( 6.0000000 3.5000000 7.0000000 ) + 987 Mg tau( 987) = ( 6.0000000 3.5000000 6.5000000 ) + 988 O tau( 988) = ( 6.5000000 4.0000000 7.0000000 ) + 989 Mg tau( 989) = ( 6.5000000 4.0000000 6.5000000 ) + 990 O tau( 990) = ( 7.0000000 4.5000000 7.0000000 ) + 991 Mg tau( 991) = ( 7.0000000 4.5000000 6.5000000 ) + 992 O tau( 992) = ( 7.5000000 5.0000000 7.0000000 ) + 993 Mg tau( 993) = ( 7.5000000 5.0000000 6.5000000 ) + 994 O tau( 994) = ( 8.0000000 5.5000000 7.0000000 ) + 995 Mg tau( 995) = ( 8.0000000 5.5000000 6.5000000 ) + 996 O tau( 996) = ( 8.5000000 6.0000000 7.0000000 ) + 997 Mg tau( 997) = ( 8.5000000 6.0000000 6.5000000 ) + 998 O tau( 998) = ( 9.0000000 6.5000000 7.0000000 ) + 999 Mg tau( 999) = ( 9.0000000 6.5000000 6.5000000 ) + 1000 O tau(1000) = ( 9.5000000 7.0000000 7.0000000 ) + 1001 Mg tau(1001) = ( 0.0000000 2.5000000 2.5000000 ) + 1002 O tau(1002) = ( 0.5000000 3.0000000 3.0000000 ) + 1003 Mg tau(1003) = ( 0.5000000 3.0000000 2.5000000 ) + 1004 O tau(1004) = ( 1.0000000 3.5000000 3.0000000 ) + 1005 Mg tau(1005) = ( 1.0000000 3.5000000 2.5000000 ) + 1006 O tau(1006) = ( 1.5000000 4.0000000 3.0000000 ) + 1007 Mg tau(1007) = ( 1.5000000 4.0000000 2.5000000 ) + 1008 O tau(1008) = ( 2.0000000 4.5000000 3.0000000 ) + 1009 Mg tau(1009) = ( 2.0000000 4.5000000 2.5000000 ) + 1010 O tau(1010) = ( 2.5000000 5.0000000 3.0000000 ) + 1011 Mg tau(1011) = ( 2.5000000 5.0000000 2.5000000 ) + 1012 O tau(1012) = ( 3.0000000 5.5000000 3.0000000 ) + 1013 Mg tau(1013) = ( 3.0000000 5.5000000 2.5000000 ) + 1014 O tau(1014) = ( 3.5000000 6.0000000 3.0000000 ) + 1015 Mg tau(1015) = ( 3.5000000 6.0000000 2.5000000 ) + 1016 O tau(1016) = ( 4.0000000 6.5000000 3.0000000 ) + 1017 Mg tau(1017) = ( 4.0000000 6.5000000 2.5000000 ) + 1018 O tau(1018) = ( 4.5000000 7.0000000 3.0000000 ) + 1019 Mg tau(1019) = ( 4.5000000 7.0000000 2.5000000 ) + 1020 O tau(1020) = ( 5.0000000 7.5000000 3.0000000 ) + 1021 Mg tau(1021) = ( 0.5000000 2.5000000 3.0000000 ) + 1022 O tau(1022) = ( 1.0000000 3.0000000 3.5000000 ) + 1023 Mg tau(1023) = ( 1.0000000 3.0000000 3.0000000 ) + 1024 O tau(1024) = ( 1.5000000 3.5000000 3.5000000 ) + 1025 Mg tau(1025) = ( 1.5000000 3.5000000 3.0000000 ) + 1026 O tau(1026) = ( 2.0000000 4.0000000 3.5000000 ) + 1027 Mg tau(1027) = ( 2.0000000 4.0000000 3.0000000 ) + 1028 O tau(1028) = ( 2.5000000 4.5000000 3.5000000 ) + 1029 Mg tau(1029) = ( 2.5000000 4.5000000 3.0000000 ) + 1030 O tau(1030) = ( 3.0000000 5.0000000 3.5000000 ) + 1031 Mg tau(1031) = ( 3.0000000 5.0000000 3.0000000 ) + 1032 O tau(1032) = ( 3.5000000 5.5000000 3.5000000 ) + 1033 Mg tau(1033) = ( 3.5000000 5.5000000 3.0000000 ) + 1034 O tau(1034) = ( 4.0000000 6.0000000 3.5000000 ) + 1035 Mg tau(1035) = ( 4.0000000 6.0000000 3.0000000 ) + 1036 O tau(1036) = ( 4.5000000 6.5000000 3.5000000 ) + 1037 Mg tau(1037) = ( 4.5000000 6.5000000 3.0000000 ) + 1038 O tau(1038) = ( 5.0000000 7.0000000 3.5000000 ) + 1039 Mg tau(1039) = ( 5.0000000 7.0000000 3.0000000 ) + 1040 O tau(1040) = ( 5.5000000 7.5000000 3.5000000 ) + 1041 Mg tau(1041) = ( 1.0000000 2.5000000 3.5000000 ) + 1042 O tau(1042) = ( 1.5000000 3.0000000 4.0000000 ) + 1043 Mg tau(1043) = ( 1.5000000 3.0000000 3.5000000 ) + 1044 O tau(1044) = ( 2.0000000 3.5000000 4.0000000 ) + 1045 Mg tau(1045) = ( 2.0000000 3.5000000 3.5000000 ) + 1046 O tau(1046) = ( 2.5000000 4.0000000 4.0000000 ) + 1047 Mg tau(1047) = ( 2.5000000 4.0000000 3.5000000 ) + 1048 O tau(1048) = ( 3.0000000 4.5000000 4.0000000 ) + 1049 Mg tau(1049) = ( 3.0000000 4.5000000 3.5000000 ) + 1050 O tau(1050) = ( 3.5000000 5.0000000 4.0000000 ) + 1051 Mg tau(1051) = ( 3.5000000 5.0000000 3.5000000 ) + 1052 O tau(1052) = ( 4.0000000 5.5000000 4.0000000 ) + 1053 Mg tau(1053) = ( 4.0000000 5.5000000 3.5000000 ) + 1054 O tau(1054) = ( 4.5000000 6.0000000 4.0000000 ) + 1055 Mg tau(1055) = ( 4.5000000 6.0000000 3.5000000 ) + 1056 O tau(1056) = ( 5.0000000 6.5000000 4.0000000 ) + 1057 Mg tau(1057) = ( 5.0000000 6.5000000 3.5000000 ) + 1058 O tau(1058) = ( 5.5000000 7.0000000 4.0000000 ) + 1059 Mg tau(1059) = ( 5.5000000 7.0000000 3.5000000 ) + 1060 O tau(1060) = ( 6.0000000 7.5000000 4.0000000 ) + 1061 Mg tau(1061) = ( 1.5000000 2.5000000 4.0000000 ) + 1062 O tau(1062) = ( 2.0000000 3.0000000 4.5000000 ) + 1063 Mg tau(1063) = ( 2.0000000 3.0000000 4.0000000 ) + 1064 O tau(1064) = ( 2.5000000 3.5000000 4.5000000 ) + 1065 Mg tau(1065) = ( 2.5000000 3.5000000 4.0000000 ) + 1066 O tau(1066) = ( 3.0000000 4.0000000 4.5000000 ) + 1067 Mg tau(1067) = ( 3.0000000 4.0000000 4.0000000 ) + 1068 O tau(1068) = ( 3.5000000 4.5000000 4.5000000 ) + 1069 Mg tau(1069) = ( 3.5000000 4.5000000 4.0000000 ) + 1070 O tau(1070) = ( 4.0000000 5.0000000 4.5000000 ) + 1071 Mg tau(1071) = ( 4.0000000 5.0000000 4.0000000 ) + 1072 O tau(1072) = ( 4.5000000 5.5000000 4.5000000 ) + 1073 Mg tau(1073) = ( 4.5000000 5.5000000 4.0000000 ) + 1074 O tau(1074) = ( 5.0000000 6.0000000 4.5000000 ) + 1075 Mg tau(1075) = ( 5.0000000 6.0000000 4.0000000 ) + 1076 O tau(1076) = ( 5.5000000 6.5000000 4.5000000 ) + 1077 Mg tau(1077) = ( 5.5000000 6.5000000 4.0000000 ) + 1078 O tau(1078) = ( 6.0000000 7.0000000 4.5000000 ) + 1079 Mg tau(1079) = ( 6.0000000 7.0000000 4.0000000 ) + 1080 O tau(1080) = ( 6.5000000 7.5000000 4.5000000 ) + 1081 Mg tau(1081) = ( 2.0000000 2.5000000 4.5000000 ) + 1082 O tau(1082) = ( 2.5000000 3.0000000 5.0000000 ) + 1083 Mg tau(1083) = ( 2.5000000 3.0000000 4.5000000 ) + 1084 O tau(1084) = ( 3.0000000 3.5000000 5.0000000 ) + 1085 Mg tau(1085) = ( 3.0000000 3.5000000 4.5000000 ) + 1086 O tau(1086) = ( 3.5000000 4.0000000 5.0000000 ) + 1087 Mg tau(1087) = ( 3.5000000 4.0000000 4.5000000 ) + 1088 O tau(1088) = ( 4.0000000 4.5000000 5.0000000 ) + 1089 Mg tau(1089) = ( 4.0000000 4.5000000 4.5000000 ) + 1090 O tau(1090) = ( 4.5000000 5.0000000 5.0000000 ) + 1091 Mg tau(1091) = ( 4.5000000 5.0000000 4.5000000 ) + 1092 O tau(1092) = ( 5.0000000 5.5000000 5.0000000 ) + 1093 Mg tau(1093) = ( 5.0000000 5.5000000 4.5000000 ) + 1094 O tau(1094) = ( 5.5000000 6.0000000 5.0000000 ) + 1095 Mg tau(1095) = ( 5.5000000 6.0000000 4.5000000 ) + 1096 O tau(1096) = ( 6.0000000 6.5000000 5.0000000 ) + 1097 Mg tau(1097) = ( 6.0000000 6.5000000 4.5000000 ) + 1098 O tau(1098) = ( 6.5000000 7.0000000 5.0000000 ) + 1099 Mg tau(1099) = ( 6.5000000 7.0000000 4.5000000 ) + 1100 O tau(1100) = ( 7.0000000 7.5000000 5.0000000 ) + 1101 Mg tau(1101) = ( 2.5000000 2.5000000 5.0000000 ) + 1102 O tau(1102) = ( 3.0000000 3.0000000 5.5000000 ) + 1103 Mg tau(1103) = ( 3.0000000 3.0000000 5.0000000 ) + 1104 O tau(1104) = ( 3.5000000 3.5000000 5.5000000 ) + 1105 Mg tau(1105) = ( 3.5000000 3.5000000 5.0000000 ) + 1106 O tau(1106) = ( 4.0000000 4.0000000 5.5000000 ) + 1107 Mg tau(1107) = ( 4.0000000 4.0000000 5.0000000 ) + 1108 O tau(1108) = ( 4.5000000 4.5000000 5.5000000 ) + 1109 Mg tau(1109) = ( 4.5000000 4.5000000 5.0000000 ) + 1110 O tau(1110) = ( 5.0000000 5.0000000 5.5000000 ) + 1111 Mg tau(1111) = ( 5.0000000 5.0000000 5.0000000 ) + 1112 O tau(1112) = ( 5.5000000 5.5000000 5.5000000 ) + 1113 Mg tau(1113) = ( 5.5000000 5.5000000 5.0000000 ) + 1114 O tau(1114) = ( 6.0000000 6.0000000 5.5000000 ) + 1115 Mg tau(1115) = ( 6.0000000 6.0000000 5.0000000 ) + 1116 O tau(1116) = ( 6.5000000 6.5000000 5.5000000 ) + 1117 Mg tau(1117) = ( 6.5000000 6.5000000 5.0000000 ) + 1118 O tau(1118) = ( 7.0000000 7.0000000 5.5000000 ) + 1119 Mg tau(1119) = ( 7.0000000 7.0000000 5.0000000 ) + 1120 O tau(1120) = ( 7.5000000 7.5000000 5.5000000 ) + 1121 Mg tau(1121) = ( 3.0000000 2.5000000 5.5000000 ) + 1122 O tau(1122) = ( 3.5000000 3.0000000 6.0000000 ) + 1123 Mg tau(1123) = ( 3.5000000 3.0000000 5.5000000 ) + 1124 O tau(1124) = ( 4.0000000 3.5000000 6.0000000 ) + 1125 Mg tau(1125) = ( 4.0000000 3.5000000 5.5000000 ) + 1126 O tau(1126) = ( 4.5000000 4.0000000 6.0000000 ) + 1127 Mg tau(1127) = ( 4.5000000 4.0000000 5.5000000 ) + 1128 O tau(1128) = ( 5.0000000 4.5000000 6.0000000 ) + 1129 Mg tau(1129) = ( 5.0000000 4.5000000 5.5000000 ) + 1130 O tau(1130) = ( 5.5000000 5.0000000 6.0000000 ) + 1131 Mg tau(1131) = ( 5.5000000 5.0000000 5.5000000 ) + 1132 O tau(1132) = ( 6.0000000 5.5000000 6.0000000 ) + 1133 Mg tau(1133) = ( 6.0000000 5.5000000 5.5000000 ) + 1134 O tau(1134) = ( 6.5000000 6.0000000 6.0000000 ) + 1135 Mg tau(1135) = ( 6.5000000 6.0000000 5.5000000 ) + 1136 O tau(1136) = ( 7.0000000 6.5000000 6.0000000 ) + 1137 Mg tau(1137) = ( 7.0000000 6.5000000 5.5000000 ) + 1138 O tau(1138) = ( 7.5000000 7.0000000 6.0000000 ) + 1139 Mg tau(1139) = ( 7.5000000 7.0000000 5.5000000 ) + 1140 O tau(1140) = ( 8.0000000 7.5000000 6.0000000 ) + 1141 Mg tau(1141) = ( 3.5000000 2.5000000 6.0000000 ) + 1142 O tau(1142) = ( 4.0000000 3.0000000 6.5000000 ) + 1143 Mg tau(1143) = ( 4.0000000 3.0000000 6.0000000 ) + 1144 O tau(1144) = ( 4.5000000 3.5000000 6.5000000 ) + 1145 Mg tau(1145) = ( 4.5000000 3.5000000 6.0000000 ) + 1146 O tau(1146) = ( 5.0000000 4.0000000 6.5000000 ) + 1147 Mg tau(1147) = ( 5.0000000 4.0000000 6.0000000 ) + 1148 O tau(1148) = ( 5.5000000 4.5000000 6.5000000 ) + 1149 Mg tau(1149) = ( 5.5000000 4.5000000 6.0000000 ) + 1150 O tau(1150) = ( 6.0000000 5.0000000 6.5000000 ) + 1151 Mg tau(1151) = ( 6.0000000 5.0000000 6.0000000 ) + 1152 O tau(1152) = ( 6.5000000 5.5000000 6.5000000 ) + 1153 Mg tau(1153) = ( 6.5000000 5.5000000 6.0000000 ) + 1154 O tau(1154) = ( 7.0000000 6.0000000 6.5000000 ) + 1155 Mg tau(1155) = ( 7.0000000 6.0000000 6.0000000 ) + 1156 O tau(1156) = ( 7.5000000 6.5000000 6.5000000 ) + 1157 Mg tau(1157) = ( 7.5000000 6.5000000 6.0000000 ) + 1158 O tau(1158) = ( 8.0000000 7.0000000 6.5000000 ) + 1159 Mg tau(1159) = ( 8.0000000 7.0000000 6.0000000 ) + 1160 O tau(1160) = ( 8.5000000 7.5000000 6.5000000 ) + 1161 Mg tau(1161) = ( 4.0000000 2.5000000 6.5000000 ) + 1162 O tau(1162) = ( 4.5000000 3.0000000 7.0000000 ) + 1163 Mg tau(1163) = ( 4.5000000 3.0000000 6.5000000 ) + 1164 O tau(1164) = ( 5.0000000 3.5000000 7.0000000 ) + 1165 Mg tau(1165) = ( 5.0000000 3.5000000 6.5000000 ) + 1166 O tau(1166) = ( 5.5000000 4.0000000 7.0000000 ) + 1167 Mg tau(1167) = ( 5.5000000 4.0000000 6.5000000 ) + 1168 O tau(1168) = ( 6.0000000 4.5000000 7.0000000 ) + 1169 Mg tau(1169) = ( 6.0000000 4.5000000 6.5000000 ) + 1170 O tau(1170) = ( 6.5000000 5.0000000 7.0000000 ) + 1171 Mg tau(1171) = ( 6.5000000 5.0000000 6.5000000 ) + 1172 O tau(1172) = ( 7.0000000 5.5000000 7.0000000 ) + 1173 Mg tau(1173) = ( 7.0000000 5.5000000 6.5000000 ) + 1174 O tau(1174) = ( 7.5000000 6.0000000 7.0000000 ) + 1175 Mg tau(1175) = ( 7.5000000 6.0000000 6.5000000 ) + 1176 O tau(1176) = ( 8.0000000 6.5000000 7.0000000 ) + 1177 Mg tau(1177) = ( 8.0000000 6.5000000 6.5000000 ) + 1178 O tau(1178) = ( 8.5000000 7.0000000 7.0000000 ) + 1179 Mg tau(1179) = ( 8.5000000 7.0000000 6.5000000 ) + 1180 O tau(1180) = ( 9.0000000 7.5000000 7.0000000 ) + 1181 Mg tau(1181) = ( 4.5000000 2.5000000 7.0000000 ) + 1182 O tau(1182) = ( 5.0000000 3.0000000 7.5000000 ) + 1183 Mg tau(1183) = ( 5.0000000 3.0000000 7.0000000 ) + 1184 O tau(1184) = ( 5.5000000 3.5000000 7.5000000 ) + 1185 Mg tau(1185) = ( 5.5000000 3.5000000 7.0000000 ) + 1186 O tau(1186) = ( 6.0000000 4.0000000 7.5000000 ) + 1187 Mg tau(1187) = ( 6.0000000 4.0000000 7.0000000 ) + 1188 O tau(1188) = ( 6.5000000 4.5000000 7.5000000 ) + 1189 Mg tau(1189) = ( 6.5000000 4.5000000 7.0000000 ) + 1190 O tau(1190) = ( 7.0000000 5.0000000 7.5000000 ) + 1191 Mg tau(1191) = ( 7.0000000 5.0000000 7.0000000 ) + 1192 O tau(1192) = ( 7.5000000 5.5000000 7.5000000 ) + 1193 Mg tau(1193) = ( 7.5000000 5.5000000 7.0000000 ) + 1194 O tau(1194) = ( 8.0000000 6.0000000 7.5000000 ) + 1195 Mg tau(1195) = ( 8.0000000 6.0000000 7.0000000 ) + 1196 O tau(1196) = ( 8.5000000 6.5000000 7.5000000 ) + 1197 Mg tau(1197) = ( 8.5000000 6.5000000 7.0000000 ) + 1198 O tau(1198) = ( 9.0000000 7.0000000 7.5000000 ) + 1199 Mg tau(1199) = ( 9.0000000 7.0000000 7.0000000 ) + 1200 O tau(1200) = ( 9.5000000 7.5000000 7.5000000 ) + 1201 Mg tau(1201) = ( 0.0000000 3.0000000 3.0000000 ) + 1202 O tau(1202) = ( 0.5000000 3.5000000 3.5000000 ) + 1203 Mg tau(1203) = ( 0.5000000 3.5000000 3.0000000 ) + 1204 O tau(1204) = ( 1.0000000 4.0000000 3.5000000 ) + 1205 Mg tau(1205) = ( 1.0000000 4.0000000 3.0000000 ) + 1206 O tau(1206) = ( 1.5000000 4.5000000 3.5000000 ) + 1207 Mg tau(1207) = ( 1.5000000 4.5000000 3.0000000 ) + 1208 O tau(1208) = ( 2.0000000 5.0000000 3.5000000 ) + 1209 Mg tau(1209) = ( 2.0000000 5.0000000 3.0000000 ) + 1210 O tau(1210) = ( 2.5000000 5.5000000 3.5000000 ) + 1211 Mg tau(1211) = ( 2.5000000 5.5000000 3.0000000 ) + 1212 O tau(1212) = ( 3.0000000 6.0000000 3.5000000 ) + 1213 Mg tau(1213) = ( 3.0000000 6.0000000 3.0000000 ) + 1214 O tau(1214) = ( 3.5000000 6.5000000 3.5000000 ) + 1215 Mg tau(1215) = ( 3.5000000 6.5000000 3.0000000 ) + 1216 O tau(1216) = ( 4.0000000 7.0000000 3.5000000 ) + 1217 Mg tau(1217) = ( 4.0000000 7.0000000 3.0000000 ) + 1218 O tau(1218) = ( 4.5000000 7.5000000 3.5000000 ) + 1219 Mg tau(1219) = ( 4.5000000 7.5000000 3.0000000 ) + 1220 O tau(1220) = ( 5.0000000 8.0000000 3.5000000 ) + 1221 Mg tau(1221) = ( 0.5000000 3.0000000 3.5000000 ) + 1222 O tau(1222) = ( 1.0000000 3.5000000 4.0000000 ) + 1223 Mg tau(1223) = ( 1.0000000 3.5000000 3.5000000 ) + 1224 O tau(1224) = ( 1.5000000 4.0000000 4.0000000 ) + 1225 Mg tau(1225) = ( 1.5000000 4.0000000 3.5000000 ) + 1226 O tau(1226) = ( 2.0000000 4.5000000 4.0000000 ) + 1227 Mg tau(1227) = ( 2.0000000 4.5000000 3.5000000 ) + 1228 O tau(1228) = ( 2.5000000 5.0000000 4.0000000 ) + 1229 Mg tau(1229) = ( 2.5000000 5.0000000 3.5000000 ) + 1230 O tau(1230) = ( 3.0000000 5.5000000 4.0000000 ) + 1231 Mg tau(1231) = ( 3.0000000 5.5000000 3.5000000 ) + 1232 O tau(1232) = ( 3.5000000 6.0000000 4.0000000 ) + 1233 Mg tau(1233) = ( 3.5000000 6.0000000 3.5000000 ) + 1234 O tau(1234) = ( 4.0000000 6.5000000 4.0000000 ) + 1235 Mg tau(1235) = ( 4.0000000 6.5000000 3.5000000 ) + 1236 O tau(1236) = ( 4.5000000 7.0000000 4.0000000 ) + 1237 Mg tau(1237) = ( 4.5000000 7.0000000 3.5000000 ) + 1238 O tau(1238) = ( 5.0000000 7.5000000 4.0000000 ) + 1239 Mg tau(1239) = ( 5.0000000 7.5000000 3.5000000 ) + 1240 O tau(1240) = ( 5.5000000 8.0000000 4.0000000 ) + 1241 Mg tau(1241) = ( 1.0000000 3.0000000 4.0000000 ) + 1242 O tau(1242) = ( 1.5000000 3.5000000 4.5000000 ) + 1243 Mg tau(1243) = ( 1.5000000 3.5000000 4.0000000 ) + 1244 O tau(1244) = ( 2.0000000 4.0000000 4.5000000 ) + 1245 Mg tau(1245) = ( 2.0000000 4.0000000 4.0000000 ) + 1246 O tau(1246) = ( 2.5000000 4.5000000 4.5000000 ) + 1247 Mg tau(1247) = ( 2.5000000 4.5000000 4.0000000 ) + 1248 O tau(1248) = ( 3.0000000 5.0000000 4.5000000 ) + 1249 Mg tau(1249) = ( 3.0000000 5.0000000 4.0000000 ) + 1250 O tau(1250) = ( 3.5000000 5.5000000 4.5000000 ) + 1251 Mg tau(1251) = ( 3.5000000 5.5000000 4.0000000 ) + 1252 O tau(1252) = ( 4.0000000 6.0000000 4.5000000 ) + 1253 Mg tau(1253) = ( 4.0000000 6.0000000 4.0000000 ) + 1254 O tau(1254) = ( 4.5000000 6.5000000 4.5000000 ) + 1255 Mg tau(1255) = ( 4.5000000 6.5000000 4.0000000 ) + 1256 O tau(1256) = ( 5.0000000 7.0000000 4.5000000 ) + 1257 Mg tau(1257) = ( 5.0000000 7.0000000 4.0000000 ) + 1258 O tau(1258) = ( 5.5000000 7.5000000 4.5000000 ) + 1259 Mg tau(1259) = ( 5.5000000 7.5000000 4.0000000 ) + 1260 O tau(1260) = ( 6.0000000 8.0000000 4.5000000 ) + 1261 Mg tau(1261) = ( 1.5000000 3.0000000 4.5000000 ) + 1262 O tau(1262) = ( 2.0000000 3.5000000 5.0000000 ) + 1263 Mg tau(1263) = ( 2.0000000 3.5000000 4.5000000 ) + 1264 O tau(1264) = ( 2.5000000 4.0000000 5.0000000 ) + 1265 Mg tau(1265) = ( 2.5000000 4.0000000 4.5000000 ) + 1266 O tau(1266) = ( 3.0000000 4.5000000 5.0000000 ) + 1267 Mg tau(1267) = ( 3.0000000 4.5000000 4.5000000 ) + 1268 O tau(1268) = ( 3.5000000 5.0000000 5.0000000 ) + 1269 Mg tau(1269) = ( 3.5000000 5.0000000 4.5000000 ) + 1270 O tau(1270) = ( 4.0000000 5.5000000 5.0000000 ) + 1271 Mg tau(1271) = ( 4.0000000 5.5000000 4.5000000 ) + 1272 O tau(1272) = ( 4.5000000 6.0000000 5.0000000 ) + 1273 Mg tau(1273) = ( 4.5000000 6.0000000 4.5000000 ) + 1274 O tau(1274) = ( 5.0000000 6.5000000 5.0000000 ) + 1275 Mg tau(1275) = ( 5.0000000 6.5000000 4.5000000 ) + 1276 O tau(1276) = ( 5.5000000 7.0000000 5.0000000 ) + 1277 Mg tau(1277) = ( 5.5000000 7.0000000 4.5000000 ) + 1278 O tau(1278) = ( 6.0000000 7.5000000 5.0000000 ) + 1279 Mg tau(1279) = ( 6.0000000 7.5000000 4.5000000 ) + 1280 O tau(1280) = ( 6.5000000 8.0000000 5.0000000 ) + 1281 Mg tau(1281) = ( 2.0000000 3.0000000 5.0000000 ) + 1282 O tau(1282) = ( 2.5000000 3.5000000 5.5000000 ) + 1283 Mg tau(1283) = ( 2.5000000 3.5000000 5.0000000 ) + 1284 O tau(1284) = ( 3.0000000 4.0000000 5.5000000 ) + 1285 Mg tau(1285) = ( 3.0000000 4.0000000 5.0000000 ) + 1286 O tau(1286) = ( 3.5000000 4.5000000 5.5000000 ) + 1287 Mg tau(1287) = ( 3.5000000 4.5000000 5.0000000 ) + 1288 O tau(1288) = ( 4.0000000 5.0000000 5.5000000 ) + 1289 Mg tau(1289) = ( 4.0000000 5.0000000 5.0000000 ) + 1290 O tau(1290) = ( 4.5000000 5.5000000 5.5000000 ) + 1291 Mg tau(1291) = ( 4.5000000 5.5000000 5.0000000 ) + 1292 O tau(1292) = ( 5.0000000 6.0000000 5.5000000 ) + 1293 Mg tau(1293) = ( 5.0000000 6.0000000 5.0000000 ) + 1294 O tau(1294) = ( 5.5000000 6.5000000 5.5000000 ) + 1295 Mg tau(1295) = ( 5.5000000 6.5000000 5.0000000 ) + 1296 O tau(1296) = ( 6.0000000 7.0000000 5.5000000 ) + 1297 Mg tau(1297) = ( 6.0000000 7.0000000 5.0000000 ) + 1298 O tau(1298) = ( 6.5000000 7.5000000 5.5000000 ) + 1299 Mg tau(1299) = ( 6.5000000 7.5000000 5.0000000 ) + 1300 O tau(1300) = ( 7.0000000 8.0000000 5.5000000 ) + 1301 Mg tau(1301) = ( 2.5000000 3.0000000 5.5000000 ) + 1302 O tau(1302) = ( 3.0000000 3.5000000 6.0000000 ) + 1303 Mg tau(1303) = ( 3.0000000 3.5000000 5.5000000 ) + 1304 O tau(1304) = ( 3.5000000 4.0000000 6.0000000 ) + 1305 Mg tau(1305) = ( 3.5000000 4.0000000 5.5000000 ) + 1306 O tau(1306) = ( 4.0000000 4.5000000 6.0000000 ) + 1307 Mg tau(1307) = ( 4.0000000 4.5000000 5.5000000 ) + 1308 O tau(1308) = ( 4.5000000 5.0000000 6.0000000 ) + 1309 Mg tau(1309) = ( 4.5000000 5.0000000 5.5000000 ) + 1310 O tau(1310) = ( 5.0000000 5.5000000 6.0000000 ) + 1311 Mg tau(1311) = ( 5.0000000 5.5000000 5.5000000 ) + 1312 O tau(1312) = ( 5.5000000 6.0000000 6.0000000 ) + 1313 Mg tau(1313) = ( 5.5000000 6.0000000 5.5000000 ) + 1314 O tau(1314) = ( 6.0000000 6.5000000 6.0000000 ) + 1315 Mg tau(1315) = ( 6.0000000 6.5000000 5.5000000 ) + 1316 O tau(1316) = ( 6.5000000 7.0000000 6.0000000 ) + 1317 Mg tau(1317) = ( 6.5000000 7.0000000 5.5000000 ) + 1318 O tau(1318) = ( 7.0000000 7.5000000 6.0000000 ) + 1319 Mg tau(1319) = ( 7.0000000 7.5000000 5.5000000 ) + 1320 O tau(1320) = ( 7.5000000 8.0000000 6.0000000 ) + 1321 Mg tau(1321) = ( 3.0000000 3.0000000 6.0000000 ) + 1322 O tau(1322) = ( 3.5000000 3.5000000 6.5000000 ) + 1323 Mg tau(1323) = ( 3.5000000 3.5000000 6.0000000 ) + 1324 O tau(1324) = ( 4.0000000 4.0000000 6.5000000 ) + 1325 Mg tau(1325) = ( 4.0000000 4.0000000 6.0000000 ) + 1326 O tau(1326) = ( 4.5000000 4.5000000 6.5000000 ) + 1327 Mg tau(1327) = ( 4.5000000 4.5000000 6.0000000 ) + 1328 O tau(1328) = ( 5.0000000 5.0000000 6.5000000 ) + 1329 Mg tau(1329) = ( 5.0000000 5.0000000 6.0000000 ) + 1330 O tau(1330) = ( 5.5000000 5.5000000 6.5000000 ) + 1331 Mg tau(1331) = ( 5.5000000 5.5000000 6.0000000 ) + 1332 O tau(1332) = ( 6.0000000 6.0000000 6.5000000 ) + 1333 Mg tau(1333) = ( 6.0000000 6.0000000 6.0000000 ) + 1334 O tau(1334) = ( 6.5000000 6.5000000 6.5000000 ) + 1335 Mg tau(1335) = ( 6.5000000 6.5000000 6.0000000 ) + 1336 O tau(1336) = ( 7.0000000 7.0000000 6.5000000 ) + 1337 Mg tau(1337) = ( 7.0000000 7.0000000 6.0000000 ) + 1338 O tau(1338) = ( 7.5000000 7.5000000 6.5000000 ) + 1339 Mg tau(1339) = ( 7.5000000 7.5000000 6.0000000 ) + 1340 O tau(1340) = ( 8.0000000 8.0000000 6.5000000 ) + 1341 Mg tau(1341) = ( 3.5000000 3.0000000 6.5000000 ) + 1342 O tau(1342) = ( 4.0000000 3.5000000 7.0000000 ) + 1343 Mg tau(1343) = ( 4.0000000 3.5000000 6.5000000 ) + 1344 O tau(1344) = ( 4.5000000 4.0000000 7.0000000 ) + 1345 Mg tau(1345) = ( 4.5000000 4.0000000 6.5000000 ) + 1346 O tau(1346) = ( 5.0000000 4.5000000 7.0000000 ) + 1347 Mg tau(1347) = ( 5.0000000 4.5000000 6.5000000 ) + 1348 O tau(1348) = ( 5.5000000 5.0000000 7.0000000 ) + 1349 Mg tau(1349) = ( 5.5000000 5.0000000 6.5000000 ) + 1350 O tau(1350) = ( 6.0000000 5.5000000 7.0000000 ) + 1351 Mg tau(1351) = ( 6.0000000 5.5000000 6.5000000 ) + 1352 O tau(1352) = ( 6.5000000 6.0000000 7.0000000 ) + 1353 Mg tau(1353) = ( 6.5000000 6.0000000 6.5000000 ) + 1354 O tau(1354) = ( 7.0000000 6.5000000 7.0000000 ) + 1355 Mg tau(1355) = ( 7.0000000 6.5000000 6.5000000 ) + 1356 O tau(1356) = ( 7.5000000 7.0000000 7.0000000 ) + 1357 Mg tau(1357) = ( 7.5000000 7.0000000 6.5000000 ) + 1358 O tau(1358) = ( 8.0000000 7.5000000 7.0000000 ) + 1359 Mg tau(1359) = ( 8.0000000 7.5000000 6.5000000 ) + 1360 O tau(1360) = ( 8.5000000 8.0000000 7.0000000 ) + 1361 Mg tau(1361) = ( 4.0000000 3.0000000 7.0000000 ) + 1362 O tau(1362) = ( 4.5000000 3.5000000 7.5000000 ) + 1363 Mg tau(1363) = ( 4.5000000 3.5000000 7.0000000 ) + 1364 O tau(1364) = ( 5.0000000 4.0000000 7.5000000 ) + 1365 Mg tau(1365) = ( 5.0000000 4.0000000 7.0000000 ) + 1366 O tau(1366) = ( 5.5000000 4.5000000 7.5000000 ) + 1367 Mg tau(1367) = ( 5.5000000 4.5000000 7.0000000 ) + 1368 O tau(1368) = ( 6.0000000 5.0000000 7.5000000 ) + 1369 Mg tau(1369) = ( 6.0000000 5.0000000 7.0000000 ) + 1370 O tau(1370) = ( 6.5000000 5.5000000 7.5000000 ) + 1371 Mg tau(1371) = ( 6.5000000 5.5000000 7.0000000 ) + 1372 O tau(1372) = ( 7.0000000 6.0000000 7.5000000 ) + 1373 Mg tau(1373) = ( 7.0000000 6.0000000 7.0000000 ) + 1374 O tau(1374) = ( 7.5000000 6.5000000 7.5000000 ) + 1375 Mg tau(1375) = ( 7.5000000 6.5000000 7.0000000 ) + 1376 O tau(1376) = ( 8.0000000 7.0000000 7.5000000 ) + 1377 Mg tau(1377) = ( 8.0000000 7.0000000 7.0000000 ) + 1378 O tau(1378) = ( 8.5000000 7.5000000 7.5000000 ) + 1379 Mg tau(1379) = ( 8.5000000 7.5000000 7.0000000 ) + 1380 O tau(1380) = ( 9.0000000 8.0000000 7.5000000 ) + 1381 Mg tau(1381) = ( 4.5000000 3.0000000 7.5000000 ) + 1382 O tau(1382) = ( 5.0000000 3.5000000 8.0000000 ) + 1383 Mg tau(1383) = ( 5.0000000 3.5000000 7.5000000 ) + 1384 O tau(1384) = ( 5.5000000 4.0000000 8.0000000 ) + 1385 Mg tau(1385) = ( 5.5000000 4.0000000 7.5000000 ) + 1386 O tau(1386) = ( 6.0000000 4.5000000 8.0000000 ) + 1387 Mg tau(1387) = ( 6.0000000 4.5000000 7.5000000 ) + 1388 O tau(1388) = ( 6.5000000 5.0000000 8.0000000 ) + 1389 Mg tau(1389) = ( 6.5000000 5.0000000 7.5000000 ) + 1390 O tau(1390) = ( 7.0000000 5.5000000 8.0000000 ) + 1391 Mg tau(1391) = ( 7.0000000 5.5000000 7.5000000 ) + 1392 O tau(1392) = ( 7.5000000 6.0000000 8.0000000 ) + 1393 Mg tau(1393) = ( 7.5000000 6.0000000 7.5000000 ) + 1394 O tau(1394) = ( 8.0000000 6.5000000 8.0000000 ) + 1395 Mg tau(1395) = ( 8.0000000 6.5000000 7.5000000 ) + 1396 O tau(1396) = ( 8.5000000 7.0000000 8.0000000 ) + 1397 Mg tau(1397) = ( 8.5000000 7.0000000 7.5000000 ) + 1398 O tau(1398) = ( 9.0000000 7.5000000 8.0000000 ) + 1399 Mg tau(1399) = ( 9.0000000 7.5000000 7.5000000 ) + 1400 O tau(1400) = ( 9.5000000 8.0000000 8.0000000 ) + 1401 Mg tau(1401) = ( 0.0000000 3.5000000 3.5000000 ) + 1402 O tau(1402) = ( 0.5000000 4.0000000 4.0000000 ) + 1403 Mg tau(1403) = ( 0.5000000 4.0000000 3.5000000 ) + 1404 O tau(1404) = ( 1.0000000 4.5000000 4.0000000 ) + 1405 Mg tau(1405) = ( 1.0000000 4.5000000 3.5000000 ) + 1406 O tau(1406) = ( 1.5000000 5.0000000 4.0000000 ) + 1407 Mg tau(1407) = ( 1.5000000 5.0000000 3.5000000 ) + 1408 O tau(1408) = ( 2.0000000 5.5000000 4.0000000 ) + 1409 Mg tau(1409) = ( 2.0000000 5.5000000 3.5000000 ) + 1410 O tau(1410) = ( 2.5000000 6.0000000 4.0000000 ) + 1411 Mg tau(1411) = ( 2.5000000 6.0000000 3.5000000 ) + 1412 O tau(1412) = ( 3.0000000 6.5000000 4.0000000 ) + 1413 Mg tau(1413) = ( 3.0000000 6.5000000 3.5000000 ) + 1414 O tau(1414) = ( 3.5000000 7.0000000 4.0000000 ) + 1415 Mg tau(1415) = ( 3.5000000 7.0000000 3.5000000 ) + 1416 O tau(1416) = ( 4.0000000 7.5000000 4.0000000 ) + 1417 Mg tau(1417) = ( 4.0000000 7.5000000 3.5000000 ) + 1418 O tau(1418) = ( 4.5000000 8.0000000 4.0000000 ) + 1419 Mg tau(1419) = ( 4.5000000 8.0000000 3.5000000 ) + 1420 O tau(1420) = ( 5.0000000 8.5000000 4.0000000 ) + 1421 Mg tau(1421) = ( 0.5000000 3.5000000 4.0000000 ) + 1422 O tau(1422) = ( 1.0000000 4.0000000 4.5000000 ) + 1423 Mg tau(1423) = ( 1.0000000 4.0000000 4.0000000 ) + 1424 O tau(1424) = ( 1.5000000 4.5000000 4.5000000 ) + 1425 Mg tau(1425) = ( 1.5000000 4.5000000 4.0000000 ) + 1426 O tau(1426) = ( 2.0000000 5.0000000 4.5000000 ) + 1427 Mg tau(1427) = ( 2.0000000 5.0000000 4.0000000 ) + 1428 O tau(1428) = ( 2.5000000 5.5000000 4.5000000 ) + 1429 Mg tau(1429) = ( 2.5000000 5.5000000 4.0000000 ) + 1430 O tau(1430) = ( 3.0000000 6.0000000 4.5000000 ) + 1431 Mg tau(1431) = ( 3.0000000 6.0000000 4.0000000 ) + 1432 O tau(1432) = ( 3.5000000 6.5000000 4.5000000 ) + 1433 Mg tau(1433) = ( 3.5000000 6.5000000 4.0000000 ) + 1434 O tau(1434) = ( 4.0000000 7.0000000 4.5000000 ) + 1435 Mg tau(1435) = ( 4.0000000 7.0000000 4.0000000 ) + 1436 O tau(1436) = ( 4.5000000 7.5000000 4.5000000 ) + 1437 Mg tau(1437) = ( 4.5000000 7.5000000 4.0000000 ) + 1438 O tau(1438) = ( 5.0000000 8.0000000 4.5000000 ) + 1439 Mg tau(1439) = ( 5.0000000 8.0000000 4.0000000 ) + 1440 O tau(1440) = ( 5.5000000 8.5000000 4.5000000 ) + 1441 Mg tau(1441) = ( 1.0000000 3.5000000 4.5000000 ) + 1442 O tau(1442) = ( 1.5000000 4.0000000 5.0000000 ) + 1443 Mg tau(1443) = ( 1.5000000 4.0000000 4.5000000 ) + 1444 O tau(1444) = ( 2.0000000 4.5000000 5.0000000 ) + 1445 Mg tau(1445) = ( 2.0000000 4.5000000 4.5000000 ) + 1446 O tau(1446) = ( 2.5000000 5.0000000 5.0000000 ) + 1447 Mg tau(1447) = ( 2.5000000 5.0000000 4.5000000 ) + 1448 O tau(1448) = ( 3.0000000 5.5000000 5.0000000 ) + 1449 Mg tau(1449) = ( 3.0000000 5.5000000 4.5000000 ) + 1450 O tau(1450) = ( 3.5000000 6.0000000 5.0000000 ) + 1451 Mg tau(1451) = ( 3.5000000 6.0000000 4.5000000 ) + 1452 O tau(1452) = ( 4.0000000 6.5000000 5.0000000 ) + 1453 Mg tau(1453) = ( 4.0000000 6.5000000 4.5000000 ) + 1454 O tau(1454) = ( 4.5000000 7.0000000 5.0000000 ) + 1455 Mg tau(1455) = ( 4.5000000 7.0000000 4.5000000 ) + 1456 O tau(1456) = ( 5.0000000 7.5000000 5.0000000 ) + 1457 Mg tau(1457) = ( 5.0000000 7.5000000 4.5000000 ) + 1458 O tau(1458) = ( 5.5000000 8.0000000 5.0000000 ) + 1459 Mg tau(1459) = ( 5.5000000 8.0000000 4.5000000 ) + 1460 O tau(1460) = ( 6.0000000 8.5000000 5.0000000 ) + 1461 Mg tau(1461) = ( 1.5000000 3.5000000 5.0000000 ) + 1462 O tau(1462) = ( 2.0000000 4.0000000 5.5000000 ) + 1463 Mg tau(1463) = ( 2.0000000 4.0000000 5.0000000 ) + 1464 O tau(1464) = ( 2.5000000 4.5000000 5.5000000 ) + 1465 Mg tau(1465) = ( 2.5000000 4.5000000 5.0000000 ) + 1466 O tau(1466) = ( 3.0000000 5.0000000 5.5000000 ) + 1467 Mg tau(1467) = ( 3.0000000 5.0000000 5.0000000 ) + 1468 O tau(1468) = ( 3.5000000 5.5000000 5.5000000 ) + 1469 Mg tau(1469) = ( 3.5000000 5.5000000 5.0000000 ) + 1470 O tau(1470) = ( 4.0000000 6.0000000 5.5000000 ) + 1471 Mg tau(1471) = ( 4.0000000 6.0000000 5.0000000 ) + 1472 O tau(1472) = ( 4.5000000 6.5000000 5.5000000 ) + 1473 Mg tau(1473) = ( 4.5000000 6.5000000 5.0000000 ) + 1474 O tau(1474) = ( 5.0000000 7.0000000 5.5000000 ) + 1475 Mg tau(1475) = ( 5.0000000 7.0000000 5.0000000 ) + 1476 O tau(1476) = ( 5.5000000 7.5000000 5.5000000 ) + 1477 Mg tau(1477) = ( 5.5000000 7.5000000 5.0000000 ) + 1478 O tau(1478) = ( 6.0000000 8.0000000 5.5000000 ) + 1479 Mg tau(1479) = ( 6.0000000 8.0000000 5.0000000 ) + 1480 O tau(1480) = ( 6.5000000 8.5000000 5.5000000 ) + 1481 Mg tau(1481) = ( 2.0000000 3.5000000 5.5000000 ) + 1482 O tau(1482) = ( 2.5000000 4.0000000 6.0000000 ) + 1483 Mg tau(1483) = ( 2.5000000 4.0000000 5.5000000 ) + 1484 O tau(1484) = ( 3.0000000 4.5000000 6.0000000 ) + 1485 Mg tau(1485) = ( 3.0000000 4.5000000 5.5000000 ) + 1486 O tau(1486) = ( 3.5000000 5.0000000 6.0000000 ) + 1487 Mg tau(1487) = ( 3.5000000 5.0000000 5.5000000 ) + 1488 O tau(1488) = ( 4.0000000 5.5000000 6.0000000 ) + 1489 Mg tau(1489) = ( 4.0000000 5.5000000 5.5000000 ) + 1490 O tau(1490) = ( 4.5000000 6.0000000 6.0000000 ) + 1491 Mg tau(1491) = ( 4.5000000 6.0000000 5.5000000 ) + 1492 O tau(1492) = ( 5.0000000 6.5000000 6.0000000 ) + 1493 Mg tau(1493) = ( 5.0000000 6.5000000 5.5000000 ) + 1494 O tau(1494) = ( 5.5000000 7.0000000 6.0000000 ) + 1495 Mg tau(1495) = ( 5.5000000 7.0000000 5.5000000 ) + 1496 O tau(1496) = ( 6.0000000 7.5000000 6.0000000 ) + 1497 Mg tau(1497) = ( 6.0000000 7.5000000 5.5000000 ) + 1498 O tau(1498) = ( 6.5000000 8.0000000 6.0000000 ) + 1499 Mg tau(1499) = ( 6.5000000 8.0000000 5.5000000 ) + 1500 O tau(1500) = ( 7.0000000 8.5000000 6.0000000 ) + 1501 Mg tau(1501) = ( 2.5000000 3.5000000 6.0000000 ) + 1502 O tau(1502) = ( 3.0000000 4.0000000 6.5000000 ) + 1503 Mg tau(1503) = ( 3.0000000 4.0000000 6.0000000 ) + 1504 O tau(1504) = ( 3.5000000 4.5000000 6.5000000 ) + 1505 Mg tau(1505) = ( 3.5000000 4.5000000 6.0000000 ) + 1506 O tau(1506) = ( 4.0000000 5.0000000 6.5000000 ) + 1507 Mg tau(1507) = ( 4.0000000 5.0000000 6.0000000 ) + 1508 O tau(1508) = ( 4.5000000 5.5000000 6.5000000 ) + 1509 Mg tau(1509) = ( 4.5000000 5.5000000 6.0000000 ) + 1510 O tau(1510) = ( 5.0000000 6.0000000 6.5000000 ) + 1511 Mg tau(1511) = ( 5.0000000 6.0000000 6.0000000 ) + 1512 O tau(1512) = ( 5.5000000 6.5000000 6.5000000 ) + 1513 Mg tau(1513) = ( 5.5000000 6.5000000 6.0000000 ) + 1514 O tau(1514) = ( 6.0000000 7.0000000 6.5000000 ) + 1515 Mg tau(1515) = ( 6.0000000 7.0000000 6.0000000 ) + 1516 O tau(1516) = ( 6.5000000 7.5000000 6.5000000 ) + 1517 Mg tau(1517) = ( 6.5000000 7.5000000 6.0000000 ) + 1518 O tau(1518) = ( 7.0000000 8.0000000 6.5000000 ) + 1519 Mg tau(1519) = ( 7.0000000 8.0000000 6.0000000 ) + 1520 O tau(1520) = ( 7.5000000 8.5000000 6.5000000 ) + 1521 Mg tau(1521) = ( 3.0000000 3.5000000 6.5000000 ) + 1522 O tau(1522) = ( 3.5000000 4.0000000 7.0000000 ) + 1523 Mg tau(1523) = ( 3.5000000 4.0000000 6.5000000 ) + 1524 O tau(1524) = ( 4.0000000 4.5000000 7.0000000 ) + 1525 Mg tau(1525) = ( 4.0000000 4.5000000 6.5000000 ) + 1526 O tau(1526) = ( 4.5000000 5.0000000 7.0000000 ) + 1527 Mg tau(1527) = ( 4.5000000 5.0000000 6.5000000 ) + 1528 O tau(1528) = ( 5.0000000 5.5000000 7.0000000 ) + 1529 Mg tau(1529) = ( 5.0000000 5.5000000 6.5000000 ) + 1530 O tau(1530) = ( 5.5000000 6.0000000 7.0000000 ) + 1531 Mg tau(1531) = ( 5.5000000 6.0000000 6.5000000 ) + 1532 O tau(1532) = ( 6.0000000 6.5000000 7.0000000 ) + 1533 Mg tau(1533) = ( 6.0000000 6.5000000 6.5000000 ) + 1534 O tau(1534) = ( 6.5000000 7.0000000 7.0000000 ) + 1535 Mg tau(1535) = ( 6.5000000 7.0000000 6.5000000 ) + 1536 O tau(1536) = ( 7.0000000 7.5000000 7.0000000 ) + 1537 Mg tau(1537) = ( 7.0000000 7.5000000 6.5000000 ) + 1538 O tau(1538) = ( 7.5000000 8.0000000 7.0000000 ) + 1539 Mg tau(1539) = ( 7.5000000 8.0000000 6.5000000 ) + 1540 O tau(1540) = ( 8.0000000 8.5000000 7.0000000 ) + 1541 Mg tau(1541) = ( 3.5000000 3.5000000 7.0000000 ) + 1542 O tau(1542) = ( 4.0000000 4.0000000 7.5000000 ) + 1543 Mg tau(1543) = ( 4.0000000 4.0000000 7.0000000 ) + 1544 O tau(1544) = ( 4.5000000 4.5000000 7.5000000 ) + 1545 Mg tau(1545) = ( 4.5000000 4.5000000 7.0000000 ) + 1546 O tau(1546) = ( 5.0000000 5.0000000 7.5000000 ) + 1547 Mg tau(1547) = ( 5.0000000 5.0000000 7.0000000 ) + 1548 O tau(1548) = ( 5.5000000 5.5000000 7.5000000 ) + 1549 Mg tau(1549) = ( 5.5000000 5.5000000 7.0000000 ) + 1550 O tau(1550) = ( 6.0000000 6.0000000 7.5000000 ) + 1551 Mg tau(1551) = ( 6.0000000 6.0000000 7.0000000 ) + 1552 O tau(1552) = ( 6.5000000 6.5000000 7.5000000 ) + 1553 Mg tau(1553) = ( 6.5000000 6.5000000 7.0000000 ) + 1554 O tau(1554) = ( 7.0000000 7.0000000 7.5000000 ) + 1555 Mg tau(1555) = ( 7.0000000 7.0000000 7.0000000 ) + 1556 O tau(1556) = ( 7.5000000 7.5000000 7.5000000 ) + 1557 Mg tau(1557) = ( 7.5000000 7.5000000 7.0000000 ) + 1558 O tau(1558) = ( 8.0000000 8.0000000 7.5000000 ) + 1559 Mg tau(1559) = ( 8.0000000 8.0000000 7.0000000 ) + 1560 O tau(1560) = ( 8.5000000 8.5000000 7.5000000 ) + 1561 Mg tau(1561) = ( 4.0000000 3.5000000 7.5000000 ) + 1562 O tau(1562) = ( 4.5000000 4.0000000 8.0000000 ) + 1563 Mg tau(1563) = ( 4.5000000 4.0000000 7.5000000 ) + 1564 O tau(1564) = ( 5.0000000 4.5000000 8.0000000 ) + 1565 Mg tau(1565) = ( 5.0000000 4.5000000 7.5000000 ) + 1566 O tau(1566) = ( 5.5000000 5.0000000 8.0000000 ) + 1567 Mg tau(1567) = ( 5.5000000 5.0000000 7.5000000 ) + 1568 O tau(1568) = ( 6.0000000 5.5000000 8.0000000 ) + 1569 Mg tau(1569) = ( 6.0000000 5.5000000 7.5000000 ) + 1570 O tau(1570) = ( 6.5000000 6.0000000 8.0000000 ) + 1571 Mg tau(1571) = ( 6.5000000 6.0000000 7.5000000 ) + 1572 O tau(1572) = ( 7.0000000 6.5000000 8.0000000 ) + 1573 Mg tau(1573) = ( 7.0000000 6.5000000 7.5000000 ) + 1574 O tau(1574) = ( 7.5000000 7.0000000 8.0000000 ) + 1575 Mg tau(1575) = ( 7.5000000 7.0000000 7.5000000 ) + 1576 O tau(1576) = ( 8.0000000 7.5000000 8.0000000 ) + 1577 Mg tau(1577) = ( 8.0000000 7.5000000 7.5000000 ) + 1578 O tau(1578) = ( 8.5000000 8.0000000 8.0000000 ) + 1579 Mg tau(1579) = ( 8.5000000 8.0000000 7.5000000 ) + 1580 O tau(1580) = ( 9.0000000 8.5000000 8.0000000 ) + 1581 Mg tau(1581) = ( 4.5000000 3.5000000 8.0000000 ) + 1582 O tau(1582) = ( 5.0000000 4.0000000 8.5000000 ) + 1583 Mg tau(1583) = ( 5.0000000 4.0000000 8.0000000 ) + 1584 O tau(1584) = ( 5.5000000 4.5000000 8.5000000 ) + 1585 Mg tau(1585) = ( 5.5000000 4.5000000 8.0000000 ) + 1586 O tau(1586) = ( 6.0000000 5.0000000 8.5000000 ) + 1587 Mg tau(1587) = ( 6.0000000 5.0000000 8.0000000 ) + 1588 O tau(1588) = ( 6.5000000 5.5000000 8.5000000 ) + 1589 Mg tau(1589) = ( 6.5000000 5.5000000 8.0000000 ) + 1590 O tau(1590) = ( 7.0000000 6.0000000 8.5000000 ) + 1591 Mg tau(1591) = ( 7.0000000 6.0000000 8.0000000 ) + 1592 O tau(1592) = ( 7.5000000 6.5000000 8.5000000 ) + 1593 Mg tau(1593) = ( 7.5000000 6.5000000 8.0000000 ) + 1594 O tau(1594) = ( 8.0000000 7.0000000 8.5000000 ) + 1595 Mg tau(1595) = ( 8.0000000 7.0000000 8.0000000 ) + 1596 O tau(1596) = ( 8.5000000 7.5000000 8.5000000 ) + 1597 Mg tau(1597) = ( 8.5000000 7.5000000 8.0000000 ) + 1598 O tau(1598) = ( 9.0000000 8.0000000 8.5000000 ) + 1599 Mg tau(1599) = ( 9.0000000 8.0000000 8.0000000 ) + 1600 O tau(1600) = ( 9.5000000 8.5000000 8.5000000 ) + 1601 Mg tau(1601) = ( 0.0000000 4.0000000 4.0000000 ) + 1602 O tau(1602) = ( 0.5000000 4.5000000 4.5000000 ) + 1603 Mg tau(1603) = ( 0.5000000 4.5000000 4.0000000 ) + 1604 O tau(1604) = ( 1.0000000 5.0000000 4.5000000 ) + 1605 Mg tau(1605) = ( 1.0000000 5.0000000 4.0000000 ) + 1606 O tau(1606) = ( 1.5000000 5.5000000 4.5000000 ) + 1607 Mg tau(1607) = ( 1.5000000 5.5000000 4.0000000 ) + 1608 O tau(1608) = ( 2.0000000 6.0000000 4.5000000 ) + 1609 Mg tau(1609) = ( 2.0000000 6.0000000 4.0000000 ) + 1610 O tau(1610) = ( 2.5000000 6.5000000 4.5000000 ) + 1611 Mg tau(1611) = ( 2.5000000 6.5000000 4.0000000 ) + 1612 O tau(1612) = ( 3.0000000 7.0000000 4.5000000 ) + 1613 Mg tau(1613) = ( 3.0000000 7.0000000 4.0000000 ) + 1614 O tau(1614) = ( 3.5000000 7.5000000 4.5000000 ) + 1615 Mg tau(1615) = ( 3.5000000 7.5000000 4.0000000 ) + 1616 O tau(1616) = ( 4.0000000 8.0000000 4.5000000 ) + 1617 Mg tau(1617) = ( 4.0000000 8.0000000 4.0000000 ) + 1618 O tau(1618) = ( 4.5000000 8.5000000 4.5000000 ) + 1619 Mg tau(1619) = ( 4.5000000 8.5000000 4.0000000 ) + 1620 O tau(1620) = ( 5.0000000 9.0000000 4.5000000 ) + 1621 Mg tau(1621) = ( 0.5000000 4.0000000 4.5000000 ) + 1622 O tau(1622) = ( 1.0000000 4.5000000 5.0000000 ) + 1623 Mg tau(1623) = ( 1.0000000 4.5000000 4.5000000 ) + 1624 O tau(1624) = ( 1.5000000 5.0000000 5.0000000 ) + 1625 Mg tau(1625) = ( 1.5000000 5.0000000 4.5000000 ) + 1626 O tau(1626) = ( 2.0000000 5.5000000 5.0000000 ) + 1627 Mg tau(1627) = ( 2.0000000 5.5000000 4.5000000 ) + 1628 O tau(1628) = ( 2.5000000 6.0000000 5.0000000 ) + 1629 Mg tau(1629) = ( 2.5000000 6.0000000 4.5000000 ) + 1630 O tau(1630) = ( 3.0000000 6.5000000 5.0000000 ) + 1631 Mg tau(1631) = ( 3.0000000 6.5000000 4.5000000 ) + 1632 O tau(1632) = ( 3.5000000 7.0000000 5.0000000 ) + 1633 Mg tau(1633) = ( 3.5000000 7.0000000 4.5000000 ) + 1634 O tau(1634) = ( 4.0000000 7.5000000 5.0000000 ) + 1635 Mg tau(1635) = ( 4.0000000 7.5000000 4.5000000 ) + 1636 O tau(1636) = ( 4.5000000 8.0000000 5.0000000 ) + 1637 Mg tau(1637) = ( 4.5000000 8.0000000 4.5000000 ) + 1638 O tau(1638) = ( 5.0000000 8.5000000 5.0000000 ) + 1639 Mg tau(1639) = ( 5.0000000 8.5000000 4.5000000 ) + 1640 O tau(1640) = ( 5.5000000 9.0000000 5.0000000 ) + 1641 Mg tau(1641) = ( 1.0000000 4.0000000 5.0000000 ) + 1642 O tau(1642) = ( 1.5000000 4.5000000 5.5000000 ) + 1643 Mg tau(1643) = ( 1.5000000 4.5000000 5.0000000 ) + 1644 O tau(1644) = ( 2.0000000 5.0000000 5.5000000 ) + 1645 Mg tau(1645) = ( 2.0000000 5.0000000 5.0000000 ) + 1646 O tau(1646) = ( 2.5000000 5.5000000 5.5000000 ) + 1647 Mg tau(1647) = ( 2.5000000 5.5000000 5.0000000 ) + 1648 O tau(1648) = ( 3.0000000 6.0000000 5.5000000 ) + 1649 Mg tau(1649) = ( 3.0000000 6.0000000 5.0000000 ) + 1650 O tau(1650) = ( 3.5000000 6.5000000 5.5000000 ) + 1651 Mg tau(1651) = ( 3.5000000 6.5000000 5.0000000 ) + 1652 O tau(1652) = ( 4.0000000 7.0000000 5.5000000 ) + 1653 Mg tau(1653) = ( 4.0000000 7.0000000 5.0000000 ) + 1654 O tau(1654) = ( 4.5000000 7.5000000 5.5000000 ) + 1655 Mg tau(1655) = ( 4.5000000 7.5000000 5.0000000 ) + 1656 O tau(1656) = ( 5.0000000 8.0000000 5.5000000 ) + 1657 Mg tau(1657) = ( 5.0000000 8.0000000 5.0000000 ) + 1658 O tau(1658) = ( 5.5000000 8.5000000 5.5000000 ) + 1659 Mg tau(1659) = ( 5.5000000 8.5000000 5.0000000 ) + 1660 O tau(1660) = ( 6.0000000 9.0000000 5.5000000 ) + 1661 Mg tau(1661) = ( 1.5000000 4.0000000 5.5000000 ) + 1662 O tau(1662) = ( 2.0000000 4.5000000 6.0000000 ) + 1663 Mg tau(1663) = ( 2.0000000 4.5000000 5.5000000 ) + 1664 O tau(1664) = ( 2.5000000 5.0000000 6.0000000 ) + 1665 Mg tau(1665) = ( 2.5000000 5.0000000 5.5000000 ) + 1666 O tau(1666) = ( 3.0000000 5.5000000 6.0000000 ) + 1667 Mg tau(1667) = ( 3.0000000 5.5000000 5.5000000 ) + 1668 O tau(1668) = ( 3.5000000 6.0000000 6.0000000 ) + 1669 Mg tau(1669) = ( 3.5000000 6.0000000 5.5000000 ) + 1670 O tau(1670) = ( 4.0000000 6.5000000 6.0000000 ) + 1671 Mg tau(1671) = ( 4.0000000 6.5000000 5.5000000 ) + 1672 O tau(1672) = ( 4.5000000 7.0000000 6.0000000 ) + 1673 Mg tau(1673) = ( 4.5000000 7.0000000 5.5000000 ) + 1674 O tau(1674) = ( 5.0000000 7.5000000 6.0000000 ) + 1675 Mg tau(1675) = ( 5.0000000 7.5000000 5.5000000 ) + 1676 O tau(1676) = ( 5.5000000 8.0000000 6.0000000 ) + 1677 Mg tau(1677) = ( 5.5000000 8.0000000 5.5000000 ) + 1678 O tau(1678) = ( 6.0000000 8.5000000 6.0000000 ) + 1679 Mg tau(1679) = ( 6.0000000 8.5000000 5.5000000 ) + 1680 O tau(1680) = ( 6.5000000 9.0000000 6.0000000 ) + 1681 Mg tau(1681) = ( 2.0000000 4.0000000 6.0000000 ) + 1682 O tau(1682) = ( 2.5000000 4.5000000 6.5000000 ) + 1683 Mg tau(1683) = ( 2.5000000 4.5000000 6.0000000 ) + 1684 O tau(1684) = ( 3.0000000 5.0000000 6.5000000 ) + 1685 Mg tau(1685) = ( 3.0000000 5.0000000 6.0000000 ) + 1686 O tau(1686) = ( 3.5000000 5.5000000 6.5000000 ) + 1687 Mg tau(1687) = ( 3.5000000 5.5000000 6.0000000 ) + 1688 O tau(1688) = ( 4.0000000 6.0000000 6.5000000 ) + 1689 Mg tau(1689) = ( 4.0000000 6.0000000 6.0000000 ) + 1690 O tau(1690) = ( 4.5000000 6.5000000 6.5000000 ) + 1691 Mg tau(1691) = ( 4.5000000 6.5000000 6.0000000 ) + 1692 O tau(1692) = ( 5.0000000 7.0000000 6.5000000 ) + 1693 Mg tau(1693) = ( 5.0000000 7.0000000 6.0000000 ) + 1694 O tau(1694) = ( 5.5000000 7.5000000 6.5000000 ) + 1695 Mg tau(1695) = ( 5.5000000 7.5000000 6.0000000 ) + 1696 O tau(1696) = ( 6.0000000 8.0000000 6.5000000 ) + 1697 Mg tau(1697) = ( 6.0000000 8.0000000 6.0000000 ) + 1698 O tau(1698) = ( 6.5000000 8.5000000 6.5000000 ) + 1699 Mg tau(1699) = ( 6.5000000 8.5000000 6.0000000 ) + 1700 O tau(1700) = ( 7.0000000 9.0000000 6.5000000 ) + 1701 Mg tau(1701) = ( 2.5000000 4.0000000 6.5000000 ) + 1702 O tau(1702) = ( 3.0000000 4.5000000 7.0000000 ) + 1703 Mg tau(1703) = ( 3.0000000 4.5000000 6.5000000 ) + 1704 O tau(1704) = ( 3.5000000 5.0000000 7.0000000 ) + 1705 Mg tau(1705) = ( 3.5000000 5.0000000 6.5000000 ) + 1706 O tau(1706) = ( 4.0000000 5.5000000 7.0000000 ) + 1707 Mg tau(1707) = ( 4.0000000 5.5000000 6.5000000 ) + 1708 O tau(1708) = ( 4.5000000 6.0000000 7.0000000 ) + 1709 Mg tau(1709) = ( 4.5000000 6.0000000 6.5000000 ) + 1710 O tau(1710) = ( 5.0000000 6.5000000 7.0000000 ) + 1711 Mg tau(1711) = ( 5.0000000 6.5000000 6.5000000 ) + 1712 O tau(1712) = ( 5.5000000 7.0000000 7.0000000 ) + 1713 Mg tau(1713) = ( 5.5000000 7.0000000 6.5000000 ) + 1714 O tau(1714) = ( 6.0000000 7.5000000 7.0000000 ) + 1715 Mg tau(1715) = ( 6.0000000 7.5000000 6.5000000 ) + 1716 O tau(1716) = ( 6.5000000 8.0000000 7.0000000 ) + 1717 Mg tau(1717) = ( 6.5000000 8.0000000 6.5000000 ) + 1718 O tau(1718) = ( 7.0000000 8.5000000 7.0000000 ) + 1719 Mg tau(1719) = ( 7.0000000 8.5000000 6.5000000 ) + 1720 O tau(1720) = ( 7.5000000 9.0000000 7.0000000 ) + 1721 Mg tau(1721) = ( 3.0000000 4.0000000 7.0000000 ) + 1722 O tau(1722) = ( 3.5000000 4.5000000 7.5000000 ) + 1723 Mg tau(1723) = ( 3.5000000 4.5000000 7.0000000 ) + 1724 O tau(1724) = ( 4.0000000 5.0000000 7.5000000 ) + 1725 Mg tau(1725) = ( 4.0000000 5.0000000 7.0000000 ) + 1726 O tau(1726) = ( 4.5000000 5.5000000 7.5000000 ) + 1727 Mg tau(1727) = ( 4.5000000 5.5000000 7.0000000 ) + 1728 O tau(1728) = ( 5.0000000 6.0000000 7.5000000 ) + 1729 Mg tau(1729) = ( 5.0000000 6.0000000 7.0000000 ) + 1730 O tau(1730) = ( 5.5000000 6.5000000 7.5000000 ) + 1731 Mg tau(1731) = ( 5.5000000 6.5000000 7.0000000 ) + 1732 O tau(1732) = ( 6.0000000 7.0000000 7.5000000 ) + 1733 Mg tau(1733) = ( 6.0000000 7.0000000 7.0000000 ) + 1734 O tau(1734) = ( 6.5000000 7.5000000 7.5000000 ) + 1735 Mg tau(1735) = ( 6.5000000 7.5000000 7.0000000 ) + 1736 O tau(1736) = ( 7.0000000 8.0000000 7.5000000 ) + 1737 Mg tau(1737) = ( 7.0000000 8.0000000 7.0000000 ) + 1738 O tau(1738) = ( 7.5000000 8.5000000 7.5000000 ) + 1739 Mg tau(1739) = ( 7.5000000 8.5000000 7.0000000 ) + 1740 O tau(1740) = ( 8.0000000 9.0000000 7.5000000 ) + 1741 Mg tau(1741) = ( 3.5000000 4.0000000 7.5000000 ) + 1742 O tau(1742) = ( 4.0000000 4.5000000 8.0000000 ) + 1743 Mg tau(1743) = ( 4.0000000 4.5000000 7.5000000 ) + 1744 O tau(1744) = ( 4.5000000 5.0000000 8.0000000 ) + 1745 Mg tau(1745) = ( 4.5000000 5.0000000 7.5000000 ) + 1746 O tau(1746) = ( 5.0000000 5.5000000 8.0000000 ) + 1747 Mg tau(1747) = ( 5.0000000 5.5000000 7.5000000 ) + 1748 O tau(1748) = ( 5.5000000 6.0000000 8.0000000 ) + 1749 Mg tau(1749) = ( 5.5000000 6.0000000 7.5000000 ) + 1750 O tau(1750) = ( 6.0000000 6.5000000 8.0000000 ) + 1751 Mg tau(1751) = ( 6.0000000 6.5000000 7.5000000 ) + 1752 O tau(1752) = ( 6.5000000 7.0000000 8.0000000 ) + 1753 Mg tau(1753) = ( 6.5000000 7.0000000 7.5000000 ) + 1754 O tau(1754) = ( 7.0000000 7.5000000 8.0000000 ) + 1755 Mg tau(1755) = ( 7.0000000 7.5000000 7.5000000 ) + 1756 O tau(1756) = ( 7.5000000 8.0000000 8.0000000 ) + 1757 Mg tau(1757) = ( 7.5000000 8.0000000 7.5000000 ) + 1758 O tau(1758) = ( 8.0000000 8.5000000 8.0000000 ) + 1759 Mg tau(1759) = ( 8.0000000 8.5000000 7.5000000 ) + 1760 O tau(1760) = ( 8.5000000 9.0000000 8.0000000 ) + 1761 Mg tau(1761) = ( 4.0000000 4.0000000 8.0000000 ) + 1762 O tau(1762) = ( 4.5000000 4.5000000 8.5000000 ) + 1763 Mg tau(1763) = ( 4.5000000 4.5000000 8.0000000 ) + 1764 O tau(1764) = ( 5.0000000 5.0000000 8.5000000 ) + 1765 Mg tau(1765) = ( 5.0000000 5.0000000 8.0000000 ) + 1766 O tau(1766) = ( 5.5000000 5.5000000 8.5000000 ) + 1767 Mg tau(1767) = ( 5.5000000 5.5000000 8.0000000 ) + 1768 O tau(1768) = ( 6.0000000 6.0000000 8.5000000 ) + 1769 Mg tau(1769) = ( 6.0000000 6.0000000 8.0000000 ) + 1770 O tau(1770) = ( 6.5000000 6.5000000 8.5000000 ) + 1771 Mg tau(1771) = ( 6.5000000 6.5000000 8.0000000 ) + 1772 O tau(1772) = ( 7.0000000 7.0000000 8.5000000 ) + 1773 Mg tau(1773) = ( 7.0000000 7.0000000 8.0000000 ) + 1774 O tau(1774) = ( 7.5000000 7.5000000 8.5000000 ) + 1775 Mg tau(1775) = ( 7.5000000 7.5000000 8.0000000 ) + 1776 O tau(1776) = ( 8.0000000 8.0000000 8.5000000 ) + 1777 Mg tau(1777) = ( 8.0000000 8.0000000 8.0000000 ) + 1778 O tau(1778) = ( 8.5000000 8.5000000 8.5000000 ) + 1779 Mg tau(1779) = ( 8.5000000 8.5000000 8.0000000 ) + 1780 O tau(1780) = ( 9.0000000 9.0000000 8.5000000 ) + 1781 Mg tau(1781) = ( 4.5000000 4.0000000 8.5000000 ) + 1782 O tau(1782) = ( 5.0000000 4.5000000 9.0000000 ) + 1783 Mg tau(1783) = ( 5.0000000 4.5000000 8.5000000 ) + 1784 O tau(1784) = ( 5.5000000 5.0000000 9.0000000 ) + 1785 Mg tau(1785) = ( 5.5000000 5.0000000 8.5000000 ) + 1786 O tau(1786) = ( 6.0000000 5.5000000 9.0000000 ) + 1787 Mg tau(1787) = ( 6.0000000 5.5000000 8.5000000 ) + 1788 O tau(1788) = ( 6.5000000 6.0000000 9.0000000 ) + 1789 Mg tau(1789) = ( 6.5000000 6.0000000 8.5000000 ) + 1790 O tau(1790) = ( 7.0000000 6.5000000 9.0000000 ) + 1791 Mg tau(1791) = ( 7.0000000 6.5000000 8.5000000 ) + 1792 O tau(1792) = ( 7.5000000 7.0000000 9.0000000 ) + 1793 Mg tau(1793) = ( 7.5000000 7.0000000 8.5000000 ) + 1794 O tau(1794) = ( 8.0000000 7.5000000 9.0000000 ) + 1795 Mg tau(1795) = ( 8.0000000 7.5000000 8.5000000 ) + 1796 O tau(1796) = ( 8.5000000 8.0000000 9.0000000 ) + 1797 Mg tau(1797) = ( 8.5000000 8.0000000 8.5000000 ) + 1798 O tau(1798) = ( 9.0000000 8.5000000 9.0000000 ) + 1799 Mg tau(1799) = ( 9.0000000 8.5000000 8.5000000 ) + 1800 O tau(1800) = ( 9.5000000 9.0000000 9.0000000 ) + 1801 Mg tau(1801) = ( 0.0000000 4.5000000 4.5000000 ) + 1802 O tau(1802) = ( 0.5000000 5.0000000 5.0000000 ) + 1803 Mg tau(1803) = ( 0.5000000 5.0000000 4.5000000 ) + 1804 O tau(1804) = ( 1.0000000 5.5000000 5.0000000 ) + 1805 Mg tau(1805) = ( 1.0000000 5.5000000 4.5000000 ) + 1806 O tau(1806) = ( 1.5000000 6.0000000 5.0000000 ) + 1807 Mg tau(1807) = ( 1.5000000 6.0000000 4.5000000 ) + 1808 O tau(1808) = ( 2.0000000 6.5000000 5.0000000 ) + 1809 Mg tau(1809) = ( 2.0000000 6.5000000 4.5000000 ) + 1810 O tau(1810) = ( 2.5000000 7.0000000 5.0000000 ) + 1811 Mg tau(1811) = ( 2.5000000 7.0000000 4.5000000 ) + 1812 O tau(1812) = ( 3.0000000 7.5000000 5.0000000 ) + 1813 Mg tau(1813) = ( 3.0000000 7.5000000 4.5000000 ) + 1814 O tau(1814) = ( 3.5000000 8.0000000 5.0000000 ) + 1815 Mg tau(1815) = ( 3.5000000 8.0000000 4.5000000 ) + 1816 O tau(1816) = ( 4.0000000 8.5000000 5.0000000 ) + 1817 Mg tau(1817) = ( 4.0000000 8.5000000 4.5000000 ) + 1818 O tau(1818) = ( 4.5000000 9.0000000 5.0000000 ) + 1819 Mg tau(1819) = ( 4.5000000 9.0000000 4.5000000 ) + 1820 O tau(1820) = ( 5.0000000 9.5000000 5.0000000 ) + 1821 Mg tau(1821) = ( 0.5000000 4.5000000 5.0000000 ) + 1822 O tau(1822) = ( 1.0000000 5.0000000 5.5000000 ) + 1823 Mg tau(1823) = ( 1.0000000 5.0000000 5.0000000 ) + 1824 O tau(1824) = ( 1.5000000 5.5000000 5.5000000 ) + 1825 Mg tau(1825) = ( 1.5000000 5.5000000 5.0000000 ) + 1826 O tau(1826) = ( 2.0000000 6.0000000 5.5000000 ) + 1827 Mg tau(1827) = ( 2.0000000 6.0000000 5.0000000 ) + 1828 O tau(1828) = ( 2.5000000 6.5000000 5.5000000 ) + 1829 Mg tau(1829) = ( 2.5000000 6.5000000 5.0000000 ) + 1830 O tau(1830) = ( 3.0000000 7.0000000 5.5000000 ) + 1831 Mg tau(1831) = ( 3.0000000 7.0000000 5.0000000 ) + 1832 O tau(1832) = ( 3.5000000 7.5000000 5.5000000 ) + 1833 Mg tau(1833) = ( 3.5000000 7.5000000 5.0000000 ) + 1834 O tau(1834) = ( 4.0000000 8.0000000 5.5000000 ) + 1835 Mg tau(1835) = ( 4.0000000 8.0000000 5.0000000 ) + 1836 O tau(1836) = ( 4.5000000 8.5000000 5.5000000 ) + 1837 Mg tau(1837) = ( 4.5000000 8.5000000 5.0000000 ) + 1838 O tau(1838) = ( 5.0000000 9.0000000 5.5000000 ) + 1839 Mg tau(1839) = ( 5.0000000 9.0000000 5.0000000 ) + 1840 O tau(1840) = ( 5.5000000 9.5000000 5.5000000 ) + 1841 Mg tau(1841) = ( 1.0000000 4.5000000 5.5000000 ) + 1842 O tau(1842) = ( 1.5000000 5.0000000 6.0000000 ) + 1843 Mg tau(1843) = ( 1.5000000 5.0000000 5.5000000 ) + 1844 O tau(1844) = ( 2.0000000 5.5000000 6.0000000 ) + 1845 Mg tau(1845) = ( 2.0000000 5.5000000 5.5000000 ) + 1846 O tau(1846) = ( 2.5000000 6.0000000 6.0000000 ) + 1847 Mg tau(1847) = ( 2.5000000 6.0000000 5.5000000 ) + 1848 O tau(1848) = ( 3.0000000 6.5000000 6.0000000 ) + 1849 Mg tau(1849) = ( 3.0000000 6.5000000 5.5000000 ) + 1850 O tau(1850) = ( 3.5000000 7.0000000 6.0000000 ) + 1851 Mg tau(1851) = ( 3.5000000 7.0000000 5.5000000 ) + 1852 O tau(1852) = ( 4.0000000 7.5000000 6.0000000 ) + 1853 Mg tau(1853) = ( 4.0000000 7.5000000 5.5000000 ) + 1854 O tau(1854) = ( 4.5000000 8.0000000 6.0000000 ) + 1855 Mg tau(1855) = ( 4.5000000 8.0000000 5.5000000 ) + 1856 O tau(1856) = ( 5.0000000 8.5000000 6.0000000 ) + 1857 Mg tau(1857) = ( 5.0000000 8.5000000 5.5000000 ) + 1858 O tau(1858) = ( 5.5000000 9.0000000 6.0000000 ) + 1859 Mg tau(1859) = ( 5.5000000 9.0000000 5.5000000 ) + 1860 O tau(1860) = ( 6.0000000 9.5000000 6.0000000 ) + 1861 Mg tau(1861) = ( 1.5000000 4.5000000 6.0000000 ) + 1862 O tau(1862) = ( 2.0000000 5.0000000 6.5000000 ) + 1863 Mg tau(1863) = ( 2.0000000 5.0000000 6.0000000 ) + 1864 O tau(1864) = ( 2.5000000 5.5000000 6.5000000 ) + 1865 Mg tau(1865) = ( 2.5000000 5.5000000 6.0000000 ) + 1866 O tau(1866) = ( 3.0000000 6.0000000 6.5000000 ) + 1867 Mg tau(1867) = ( 3.0000000 6.0000000 6.0000000 ) + 1868 O tau(1868) = ( 3.5000000 6.5000000 6.5000000 ) + 1869 Mg tau(1869) = ( 3.5000000 6.5000000 6.0000000 ) + 1870 O tau(1870) = ( 4.0000000 7.0000000 6.5000000 ) + 1871 Mg tau(1871) = ( 4.0000000 7.0000000 6.0000000 ) + 1872 O tau(1872) = ( 4.5000000 7.5000000 6.5000000 ) + 1873 Mg tau(1873) = ( 4.5000000 7.5000000 6.0000000 ) + 1874 O tau(1874) = ( 5.0000000 8.0000000 6.5000000 ) + 1875 Mg tau(1875) = ( 5.0000000 8.0000000 6.0000000 ) + 1876 O tau(1876) = ( 5.5000000 8.5000000 6.5000000 ) + 1877 Mg tau(1877) = ( 5.5000000 8.5000000 6.0000000 ) + 1878 O tau(1878) = ( 6.0000000 9.0000000 6.5000000 ) + 1879 Mg tau(1879) = ( 6.0000000 9.0000000 6.0000000 ) + 1880 O tau(1880) = ( 6.5000000 9.5000000 6.5000000 ) + 1881 Mg tau(1881) = ( 2.0000000 4.5000000 6.5000000 ) + 1882 O tau(1882) = ( 2.5000000 5.0000000 7.0000000 ) + 1883 Mg tau(1883) = ( 2.5000000 5.0000000 6.5000000 ) + 1884 O tau(1884) = ( 3.0000000 5.5000000 7.0000000 ) + 1885 Mg tau(1885) = ( 3.0000000 5.5000000 6.5000000 ) + 1886 O tau(1886) = ( 3.5000000 6.0000000 7.0000000 ) + 1887 Mg tau(1887) = ( 3.5000000 6.0000000 6.5000000 ) + 1888 O tau(1888) = ( 4.0000000 6.5000000 7.0000000 ) + 1889 Mg tau(1889) = ( 4.0000000 6.5000000 6.5000000 ) + 1890 O tau(1890) = ( 4.5000000 7.0000000 7.0000000 ) + 1891 Mg tau(1891) = ( 4.5000000 7.0000000 6.5000000 ) + 1892 O tau(1892) = ( 5.0000000 7.5000000 7.0000000 ) + 1893 Mg tau(1893) = ( 5.0000000 7.5000000 6.5000000 ) + 1894 O tau(1894) = ( 5.5000000 8.0000000 7.0000000 ) + 1895 Mg tau(1895) = ( 5.5000000 8.0000000 6.5000000 ) + 1896 O tau(1896) = ( 6.0000000 8.5000000 7.0000000 ) + 1897 Mg tau(1897) = ( 6.0000000 8.5000000 6.5000000 ) + 1898 O tau(1898) = ( 6.5000000 9.0000000 7.0000000 ) + 1899 Mg tau(1899) = ( 6.5000000 9.0000000 6.5000000 ) + 1900 O tau(1900) = ( 7.0000000 9.5000000 7.0000000 ) + 1901 Mg tau(1901) = ( 2.5000000 4.5000000 7.0000000 ) + 1902 O tau(1902) = ( 3.0000000 5.0000000 7.5000000 ) + 1903 Mg tau(1903) = ( 3.0000000 5.0000000 7.0000000 ) + 1904 O tau(1904) = ( 3.5000000 5.5000000 7.5000000 ) + 1905 Mg tau(1905) = ( 3.5000000 5.5000000 7.0000000 ) + 1906 O tau(1906) = ( 4.0000000 6.0000000 7.5000000 ) + 1907 Mg tau(1907) = ( 4.0000000 6.0000000 7.0000000 ) + 1908 O tau(1908) = ( 4.5000000 6.5000000 7.5000000 ) + 1909 Mg tau(1909) = ( 4.5000000 6.5000000 7.0000000 ) + 1910 O tau(1910) = ( 5.0000000 7.0000000 7.5000000 ) + 1911 Mg tau(1911) = ( 5.0000000 7.0000000 7.0000000 ) + 1912 O tau(1912) = ( 5.5000000 7.5000000 7.5000000 ) + 1913 Mg tau(1913) = ( 5.5000000 7.5000000 7.0000000 ) + 1914 O tau(1914) = ( 6.0000000 8.0000000 7.5000000 ) + 1915 Mg tau(1915) = ( 6.0000000 8.0000000 7.0000000 ) + 1916 O tau(1916) = ( 6.5000000 8.5000000 7.5000000 ) + 1917 Mg tau(1917) = ( 6.5000000 8.5000000 7.0000000 ) + 1918 O tau(1918) = ( 7.0000000 9.0000000 7.5000000 ) + 1919 Mg tau(1919) = ( 7.0000000 9.0000000 7.0000000 ) + 1920 O tau(1920) = ( 7.5000000 9.5000000 7.5000000 ) + 1921 Mg tau(1921) = ( 3.0000000 4.5000000 7.5000000 ) + 1922 O tau(1922) = ( 3.5000000 5.0000000 8.0000000 ) + 1923 Mg tau(1923) = ( 3.5000000 5.0000000 7.5000000 ) + 1924 O tau(1924) = ( 4.0000000 5.5000000 8.0000000 ) + 1925 Mg tau(1925) = ( 4.0000000 5.5000000 7.5000000 ) + 1926 O tau(1926) = ( 4.5000000 6.0000000 8.0000000 ) + 1927 Mg tau(1927) = ( 4.5000000 6.0000000 7.5000000 ) + 1928 O tau(1928) = ( 5.0000000 6.5000000 8.0000000 ) + 1929 Mg tau(1929) = ( 5.0000000 6.5000000 7.5000000 ) + 1930 O tau(1930) = ( 5.5000000 7.0000000 8.0000000 ) + 1931 Mg tau(1931) = ( 5.5000000 7.0000000 7.5000000 ) + 1932 O tau(1932) = ( 6.0000000 7.5000000 8.0000000 ) + 1933 Mg tau(1933) = ( 6.0000000 7.5000000 7.5000000 ) + 1934 O tau(1934) = ( 6.5000000 8.0000000 8.0000000 ) + 1935 Mg tau(1935) = ( 6.5000000 8.0000000 7.5000000 ) + 1936 O tau(1936) = ( 7.0000000 8.5000000 8.0000000 ) + 1937 Mg tau(1937) = ( 7.0000000 8.5000000 7.5000000 ) + 1938 O tau(1938) = ( 7.5000000 9.0000000 8.0000000 ) + 1939 Mg tau(1939) = ( 7.5000000 9.0000000 7.5000000 ) + 1940 O tau(1940) = ( 8.0000000 9.5000000 8.0000000 ) + 1941 Mg tau(1941) = ( 3.5000000 4.5000000 8.0000000 ) + 1942 O tau(1942) = ( 4.0000000 5.0000000 8.5000000 ) + 1943 Mg tau(1943) = ( 4.0000000 5.0000000 8.0000000 ) + 1944 O tau(1944) = ( 4.5000000 5.5000000 8.5000000 ) + 1945 Mg tau(1945) = ( 4.5000000 5.5000000 8.0000000 ) + 1946 O tau(1946) = ( 5.0000000 6.0000000 8.5000000 ) + 1947 Mg tau(1947) = ( 5.0000000 6.0000000 8.0000000 ) + 1948 O tau(1948) = ( 5.5000000 6.5000000 8.5000000 ) + 1949 Mg tau(1949) = ( 5.5000000 6.5000000 8.0000000 ) + 1950 O tau(1950) = ( 6.0000000 7.0000000 8.5000000 ) + 1951 Mg tau(1951) = ( 6.0000000 7.0000000 8.0000000 ) + 1952 O tau(1952) = ( 6.5000000 7.5000000 8.5000000 ) + 1953 Mg tau(1953) = ( 6.5000000 7.5000000 8.0000000 ) + 1954 O tau(1954) = ( 7.0000000 8.0000000 8.5000000 ) + 1955 Mg tau(1955) = ( 7.0000000 8.0000000 8.0000000 ) + 1956 O tau(1956) = ( 7.5000000 8.5000000 8.5000000 ) + 1957 Mg tau(1957) = ( 7.5000000 8.5000000 8.0000000 ) + 1958 O tau(1958) = ( 8.0000000 9.0000000 8.5000000 ) + 1959 Mg tau(1959) = ( 8.0000000 9.0000000 8.0000000 ) + 1960 O tau(1960) = ( 8.5000000 9.5000000 8.5000000 ) + 1961 Mg tau(1961) = ( 4.0000000 4.5000000 8.5000000 ) + 1962 O tau(1962) = ( 4.5000000 5.0000000 9.0000000 ) + 1963 Mg tau(1963) = ( 4.5000000 5.0000000 8.5000000 ) + 1964 O tau(1964) = ( 5.0000000 5.5000000 9.0000000 ) + 1965 Mg tau(1965) = ( 5.0000000 5.5000000 8.5000000 ) + 1966 O tau(1966) = ( 5.5000000 6.0000000 9.0000000 ) + 1967 Mg tau(1967) = ( 5.5000000 6.0000000 8.5000000 ) + 1968 O tau(1968) = ( 6.0000000 6.5000000 9.0000000 ) + 1969 Mg tau(1969) = ( 6.0000000 6.5000000 8.5000000 ) + 1970 O tau(1970) = ( 6.5000000 7.0000000 9.0000000 ) + 1971 Mg tau(1971) = ( 6.5000000 7.0000000 8.5000000 ) + 1972 O tau(1972) = ( 7.0000000 7.5000000 9.0000000 ) + 1973 Mg tau(1973) = ( 7.0000000 7.5000000 8.5000000 ) + 1974 O tau(1974) = ( 7.5000000 8.0000000 9.0000000 ) + 1975 Mg tau(1975) = ( 7.5000000 8.0000000 8.5000000 ) + 1976 O tau(1976) = ( 8.0000000 8.5000000 9.0000000 ) + 1977 Mg tau(1977) = ( 8.0000000 8.5000000 8.5000000 ) + 1978 O tau(1978) = ( 8.5000000 9.0000000 9.0000000 ) + 1979 Mg tau(1979) = ( 8.5000000 9.0000000 8.5000000 ) + 1980 O tau(1980) = ( 9.0000000 9.5000000 9.0000000 ) + 1981 Mg tau(1981) = ( 4.5000000 4.5000000 9.0000000 ) + 1982 O tau(1982) = ( 5.0000000 5.0000000 9.5000000 ) + 1983 Mg tau(1983) = ( 5.0000000 5.0000000 9.0000000 ) + 1984 O tau(1984) = ( 5.5000000 5.5000000 9.5000000 ) + 1985 Mg tau(1985) = ( 5.5000000 5.5000000 9.0000000 ) + 1986 O tau(1986) = ( 6.0000000 6.0000000 9.5000000 ) + 1987 Mg tau(1987) = ( 6.0000000 6.0000000 9.0000000 ) + 1988 O tau(1988) = ( 6.5000000 6.5000000 9.5000000 ) + 1989 Mg tau(1989) = ( 6.5000000 6.5000000 9.0000000 ) + 1990 O tau(1990) = ( 7.0000000 7.0000000 9.5000000 ) + 1991 Mg tau(1991) = ( 7.0000000 7.0000000 9.0000000 ) + 1992 O tau(1992) = ( 7.5000000 7.5000000 9.5000000 ) + 1993 Mg tau(1993) = ( 7.5000000 7.5000000 9.0000000 ) + 1994 O tau(1994) = ( 8.0000000 8.0000000 9.5000000 ) + 1995 Mg tau(1995) = ( 8.0000000 8.0000000 9.0000000 ) + 1996 O tau(1996) = ( 8.5000000 8.5000000 9.5000000 ) + 1997 Mg tau(1997) = ( 8.5000000 8.5000000 9.0000000 ) + 1998 O tau(1998) = ( 9.0000000 9.0000000 9.5000000 ) + 1999 Mg tau(1999) = ( 9.0000000 9.0000000 9.0000000 ) + 2000 O tau(2000) = ( 9.5000000 9.5000000 9.5000000 ) + + number of k points= 1 + cart. coord. in units 2pi/alat + k( 1) = ( -0.0500000 -0.0500000 -0.0500000), wk = 2.0000000 + + Dense grid: 25025493 G-vectors FFT dimensions: ( 432, 432, 432) + + Largest allocated arrays est. size (Mb) dimensions + Kohn-Sham Wavefunctions 21.06 Mb ( 345, 4000) + NL pseudopotentials 10.53 Mb ( 345, 2000) + Each V/rho on FFT grid 2.85 Mb ( 186624) + Each G-vector array 0.02 Mb ( 2508) + G-vector shells 0.01 Mb ( 1928) + Largest temporary arrays est. size (Mb) dimensions + Auxiliary wavefunctions 84.23 Mb ( 345,16000) + Each subspace H/S matrix 0.79 Mb ( 228, 228) + Each matrix 122.07 Mb ( 2000, 4000) + Arrays for rho mixing 22.78 Mb ( 186624, 8) + + Initial potential from superposition of free atoms + + starting charge 7999.37722, renormalised to 8000.00000 + Starting wfc are 8000 atomic wfcs + + total cpu time spent up to now is 572.1 secs + + Self-consistent Calculation + + iteration # 1 ecut= 130.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 5.00E-04, avg # of iterations = 3.0 + + total cpu time spent up to now is 1497.2 secs + + total energy = -33817.52389012 Ry + Harris-Foulkes estimate = -34104.58300919 Ry + estimated scf accuracy < 398.04836151 Ry + + End of self-consistent calculation + + convergence NOT achieved after 1 iterations: stopping + + init_run : 484.96s CPU 555.36s WALL ( 1 calls) + electrons : 845.70s CPU 925.10s WALL ( 1 calls) + + Called by init_run: + wfcinit : 428.45s CPU 495.57s WALL ( 1 calls) + potinit : 1.08s CPU 1.09s WALL ( 1 calls) + + Called by electrons: + c_bands : 746.01s CPU 815.28s WALL ( 1 calls) + sum_band : 92.59s CPU 102.68s WALL ( 1 calls) + v_of_rho : 0.71s CPU 0.71s WALL ( 2 calls) + mix_rho : 0.30s CPU 0.30s WALL ( 1 calls) + + Called by c_bands: + init_us_2 : 0.04s CPU 0.07s WALL ( 3 calls) + cegterg : 745.95s CPU 814.85s WALL ( 1 calls) + + Called by *egterg: + h_psi : 879.85s CPU 1013.76s WALL ( 5 calls) + g_psi : 0.04s CPU 0.05s WALL ( 3 calls) + cdiaghg : 71.20s CPU 71.32s WALL ( 4 calls) + + Called by h_psi: + add_vuspsi : 21.27s CPU 22.66s WALL ( 5 calls) + + General routines + calbec : 22.95s CPU 22.98s WALL ( 5 calls) + fft : 4.92s CPU 6.62s WALL ( 8 calls) + fftw : 868.45s CPU 1010.60s WALL ( 8870 calls) + + Parallel routines + fft_scatter : 718.84s CPU 794.27s WALL ( 8878 calls) + ALLTOALL : 38.99s CPU 39.22s WALL ( 8870 calls) + EXX routines + + MiniDFT : 22m16.56s CPU 24m57.16s WALL + + + This run was terminated on: 13:25:40 23Apr2013 + +=------------------------------------------------------------------------------= + JOB DONE. + Benchmark_Time : 845.70s CPU 906.24s WALL ( 1 calls) +=------------------------------------------------------------------------------= + 1 +Application 16792099 resources: utime ~13488975s, stime ~1386191s, Rss ~912592, inblocks ~185537906, outblocks ~18690009 diff --git a/tests/apps/miniDFT/tests/sample_outputs/single-node.out.ref b/tests/apps/miniDFT/tests/sample_outputs/single-node.out.ref new file mode 100644 index 0000000000..77dec25699 --- /dev/null +++ b/tests/apps/miniDFT/tests/sample_outputs/single-node.out.ref @@ -0,0 +1,367 @@ + + Program PWSCF v.5.0 starts on 20Dec2012 at 16:22: 8 + + This program is part of the open-source Quantum ESPRESSO suite + for quantum simulation of materials; please cite + "P. Giannozzi et al., J. Phys.:Condens. Matter 21 395502 (2009); + URL http://www.quantum-espresso.org", + in publications or presentations arising from this work. More details at + http://www.quantum-espresso.org/quote.php + + Parallel version (MPI), running on 40 processors + R & G space division: proc/pool = 40 + wavefunctions fft division: fft/group = 4 + + Current dimensions of program PWSCF are: + Max number of different atomic species (ntypx) = 10 + Max number of k-points (npk) = 40000 + Max angular momentum in pseudopotentials (lmaxx) = 3 + Reading input from titania_3_120.in + Message from routine upf.f90:59: + replacing read_upf_v2 with upf_nml_read to avoit iotk + Message from routine upf.f90:59: + replacing read_upf_v2 with upf_nml_read to avoit iotk + + Subspace diagonalization in iterative solution of the eigenvalue problem: + scalapack distributed-memory algorithm (size of sub-group: 4* 4 procs) + + Found symmetry operation: I + ( 0.0000 0.0000 0.3333) + This is a supercell, fractional translations are disabled + + Task Groups are in USE + groups and procs/group : 4 10 + + Parallelization info + -------------------- + sticks: dense smooth PW G-vecs: dense smooth PW + Min 660 660 172 51580 51580 6900 + Max 661 661 173 51583 51583 6903 + Sum 26429 26429 6909 2063233 2063233 276071 + + + + bravais-lattice index = 0 + lattice parameter (alat) = 8.7671 a.u. + unit-cell volume = 11618.5625 (a.u.)^3 + number of atoms/cell = 162 + number of atomic types = 2 + number of electrons = 1296.00 + number of Kohn-Sham states= 648 + kinetic-energy cutoff = 120.0000 Ry + charge density cutoff = 480.0000 Ry + convergence threshold = 1.0E-04 + mixing beta = 0.7000 + number of iterations used = 8 plain mixing + Exchange-correlation = PBE ( 1 4 3 4 0) + + celldm(1)= 8.767100 celldm(2)= 0.000000 celldm(3)= 0.000000 + celldm(4)= 0.000000 celldm(5)= 0.000000 celldm(6)= 0.000000 + + crystal axes: (cart. coord. in units of alat) + a(1) = ( 3.000000 0.000000 0.000000 ) + a(2) = ( 0.000000 3.000000 0.000000 ) + a(3) = ( 0.000000 0.000000 1.915764 ) + + reciprocal axes: (cart. coord. in units 2 pi/alat) + b(1) = ( 0.333333 0.000000 0.000000 ) + b(2) = ( 0.000000 0.333333 0.000000 ) + b(3) = ( 0.000000 0.000000 0.521985 ) + + + PseudoPot. # 1 for Ti read from file: + ./Ti.pbe.nml + MD5 check sum: 6ed49f7d399b24f59f924a2d8bad0db9 + Pseudo is Norm-conserving, Zval = 12.0 + Generated using "atomic" code by A. Dal Corso (Quantum ESPRESSO distribution) + Using radial grid of 1177 points, 2 beta functions with: + l(1) = 1 + l(2) = 2 + + PseudoPot. # 2 for O read from file: + ./O.pbe.nml + MD5 check sum: 198e56c2ed007f5cae81829e0da21478 + Pseudo is Norm-conserving, Zval = 6.0 + Generated using "atomic" code by A. Dal Corso (Quantum ESPRESSO distribution) + Using radial grid of 1095 points, 1 beta functions with: + l(1) = 0 + + atomic species valence mass pseudopotential + Ti 12.00 47.86700 Ti( 1.00) + O 6.00 15.99940 O( 1.00) + + 8 Sym. Ops., with inversion, found + + + + Cartesian axes + + site n. atom positions (alat units) + 1 Ti tau( 1) = ( 0.0000000 0.0000000 0.0000000 ) + 2 Ti tau( 2) = ( 0.5000000 0.5000000 0.3192940 ) + 3 O tau( 3) = ( 0.3050877 0.3050877 0.0000000 ) + 4 O tau( 4) = ( -0.3050877 -0.3050877 0.0000000 ) + 5 O tau( 5) = ( 0.8050877 0.1949123 0.3192940 ) + 6 O tau( 6) = ( 0.1949123 0.8050877 0.3192940 ) + 7 Ti tau( 7) = ( 0.0000000 0.0000000 0.6385880 ) + 8 Ti tau( 8) = ( 0.5000000 0.5000000 0.9578820 ) + 9 O tau( 9) = ( 0.3050877 0.3050877 0.6385880 ) + 10 O tau( 10) = ( -0.3050877 -0.3050877 0.6385880 ) + 11 O tau( 11) = ( 0.8050877 0.1949123 0.9578820 ) + 12 O tau( 12) = ( 0.1949123 0.8050877 0.9578820 ) + 13 Ti tau( 13) = ( 0.0000000 0.0000000 1.2771760 ) + 14 Ti tau( 14) = ( 0.5000000 0.5000000 1.5964700 ) + 15 O tau( 15) = ( 0.3050877 0.3050877 1.2771760 ) + 16 O tau( 16) = ( -0.3050877 -0.3050877 1.2771760 ) + 17 O tau( 17) = ( 0.8050877 0.1949123 1.5964700 ) + 18 O tau( 18) = ( 0.1949123 0.8050877 1.5964700 ) + 19 Ti tau( 19) = ( 0.0000000 1.0000000 0.0000000 ) + 20 Ti tau( 20) = ( 0.5000000 1.5000000 0.3192940 ) + 21 O tau( 21) = ( 0.3050877 1.3050877 0.0000000 ) + 22 O tau( 22) = ( -0.3050877 0.6949123 0.0000000 ) + 23 O tau( 23) = ( 0.8050877 1.1949123 0.3192940 ) + 24 O tau( 24) = ( 0.1949123 1.8050877 0.3192940 ) + 25 Ti tau( 25) = ( 0.0000000 1.0000000 0.6385880 ) + 26 Ti tau( 26) = ( 0.5000000 1.5000000 0.9578820 ) + 27 O tau( 27) = ( 0.3050877 1.3050877 0.6385880 ) + 28 O tau( 28) = ( -0.3050877 0.6949123 0.6385880 ) + 29 O tau( 29) = ( 0.8050877 1.1949123 0.9578820 ) + 30 O tau( 30) = ( 0.1949123 1.8050877 0.9578820 ) + 31 Ti tau( 31) = ( 0.0000000 1.0000000 1.2771760 ) + 32 Ti tau( 32) = ( 0.5000000 1.5000000 1.5964700 ) + 33 O tau( 33) = ( 0.3050877 1.3050877 1.2771760 ) + 34 O tau( 34) = ( -0.3050877 0.6949123 1.2771760 ) + 35 O tau( 35) = ( 0.8050877 1.1949123 1.5964700 ) + 36 O tau( 36) = ( 0.1949123 1.8050877 1.5964700 ) + 37 Ti tau( 37) = ( 0.0000000 2.0000000 0.0000000 ) + 38 Ti tau( 38) = ( 0.5000000 2.5000000 0.3192940 ) + 39 O tau( 39) = ( 0.3050877 2.3050877 0.0000000 ) + 40 O tau( 40) = ( -0.3050877 1.6949123 0.0000000 ) + 41 O tau( 41) = ( 0.8050877 2.1949123 0.3192940 ) + 42 O tau( 42) = ( 0.1949123 2.8050877 0.3192940 ) + 43 Ti tau( 43) = ( 0.0000000 2.0000000 0.6385880 ) + 44 Ti tau( 44) = ( 0.5000000 2.5000000 0.9578820 ) + 45 O tau( 45) = ( 0.3050877 2.3050877 0.6385880 ) + 46 O tau( 46) = ( -0.3050877 1.6949123 0.6385880 ) + 47 O tau( 47) = ( 0.8050877 2.1949123 0.9578820 ) + 48 O tau( 48) = ( 0.1949123 2.8050877 0.9578820 ) + 49 Ti tau( 49) = ( 0.0000000 2.0000000 1.2771760 ) + 50 Ti tau( 50) = ( 0.5000000 2.5000000 1.5964700 ) + 51 O tau( 51) = ( 0.3050877 2.3050877 1.2771760 ) + 52 O tau( 52) = ( -0.3050877 1.6949123 1.2771760 ) + 53 O tau( 53) = ( 0.8050877 2.1949123 1.5964700 ) + 54 O tau( 54) = ( 0.1949123 2.8050877 1.5964700 ) + 55 Ti tau( 55) = ( 1.0000000 0.0000000 0.0000000 ) + 56 Ti tau( 56) = ( 1.5000000 0.5000000 0.3192940 ) + 57 O tau( 57) = ( 1.3050877 0.3050877 0.0000000 ) + 58 O tau( 58) = ( 0.6949123 -0.3050877 0.0000000 ) + 59 O tau( 59) = ( 1.8050877 0.1949123 0.3192940 ) + 60 O tau( 60) = ( 1.1949123 0.8050877 0.3192940 ) + 61 Ti tau( 61) = ( 1.0000000 0.0000000 0.6385880 ) + 62 Ti tau( 62) = ( 1.5000000 0.5000000 0.9578820 ) + 63 O tau( 63) = ( 1.3050877 0.3050877 0.6385880 ) + 64 O tau( 64) = ( 0.6949123 -0.3050877 0.6385880 ) + 65 O tau( 65) = ( 1.8050877 0.1949123 0.9578820 ) + 66 O tau( 66) = ( 1.1949123 0.8050877 0.9578820 ) + 67 Ti tau( 67) = ( 1.0000000 0.0000000 1.2771760 ) + 68 Ti tau( 68) = ( 1.5000000 0.5000000 1.5964700 ) + 69 O tau( 69) = ( 1.3050877 0.3050877 1.2771760 ) + 70 O tau( 70) = ( 0.6949123 -0.3050877 1.2771760 ) + 71 O tau( 71) = ( 1.8050877 0.1949123 1.5964700 ) + 72 O tau( 72) = ( 1.1949123 0.8050877 1.5964700 ) + 73 Ti tau( 73) = ( 1.0000000 1.0000000 0.0000000 ) + 74 Ti tau( 74) = ( 1.5000000 1.5000000 0.3192940 ) + 75 O tau( 75) = ( 1.3050877 1.3050877 0.0000000 ) + 76 O tau( 76) = ( 0.6949123 0.6949123 0.0000000 ) + 77 O tau( 77) = ( 1.8050877 1.1949123 0.3192940 ) + 78 O tau( 78) = ( 1.1949123 1.8050877 0.3192940 ) + 79 Ti tau( 79) = ( 1.0000000 1.0000000 0.6385880 ) + 80 Ti tau( 80) = ( 1.5000000 1.5000000 0.9578820 ) + 81 O tau( 81) = ( 1.3050877 1.3050877 0.6385880 ) + 82 O tau( 82) = ( 0.6949123 0.6949123 0.6385880 ) + 83 O tau( 83) = ( 1.8050877 1.1949123 0.9578820 ) + 84 O tau( 84) = ( 1.1949123 1.8050877 0.9578820 ) + 85 Ti tau( 85) = ( 1.0000000 1.0000000 1.2771760 ) + 86 Ti tau( 86) = ( 1.5000000 1.5000000 1.5964700 ) + 87 O tau( 87) = ( 1.3050877 1.3050877 1.2771760 ) + 88 O tau( 88) = ( 0.6949123 0.6949123 1.2771760 ) + 89 O tau( 89) = ( 1.8050877 1.1949123 1.5964700 ) + 90 O tau( 90) = ( 1.1949123 1.8050877 1.5964700 ) + 91 Ti tau( 91) = ( 1.0000000 2.0000000 0.0000000 ) + 92 Ti tau( 92) = ( 1.5000000 2.5000000 0.3192940 ) + 93 O tau( 93) = ( 1.3050877 2.3050877 0.0000000 ) + 94 O tau( 94) = ( 0.6949123 1.6949123 0.0000000 ) + 95 O tau( 95) = ( 1.8050877 2.1949123 0.3192940 ) + 96 O tau( 96) = ( 1.1949123 2.8050877 0.3192940 ) + 97 Ti tau( 97) = ( 1.0000000 2.0000000 0.6385880 ) + 98 Ti tau( 98) = ( 1.5000000 2.5000000 0.9578820 ) + 99 O tau( 99) = ( 1.3050877 2.3050877 0.6385880 ) + 100 O tau( 100) = ( 0.6949123 1.6949123 0.6385880 ) + 101 O tau( 101) = ( 1.8050877 2.1949123 0.9578820 ) + 102 O tau( 102) = ( 1.1949123 2.8050877 0.9578820 ) + 103 Ti tau( 103) = ( 1.0000000 2.0000000 1.2771760 ) + 104 Ti tau( 104) = ( 1.5000000 2.5000000 1.5964700 ) + 105 O tau( 105) = ( 1.3050877 2.3050877 1.2771760 ) + 106 O tau( 106) = ( 0.6949123 1.6949123 1.2771760 ) + 107 O tau( 107) = ( 1.8050877 2.1949123 1.5964700 ) + 108 O tau( 108) = ( 1.1949123 2.8050877 1.5964700 ) + 109 Ti tau( 109) = ( 2.0000000 0.0000000 0.0000000 ) + 110 Ti tau( 110) = ( 2.5000000 0.5000000 0.3192940 ) + 111 O tau( 111) = ( 2.3050877 0.3050877 0.0000000 ) + 112 O tau( 112) = ( 1.6949123 -0.3050877 0.0000000 ) + 113 O tau( 113) = ( 2.8050877 0.1949123 0.3192940 ) + 114 O tau( 114) = ( 2.1949123 0.8050877 0.3192940 ) + 115 Ti tau( 115) = ( 2.0000000 0.0000000 0.6385880 ) + 116 Ti tau( 116) = ( 2.5000000 0.5000000 0.9578820 ) + 117 O tau( 117) = ( 2.3050877 0.3050877 0.6385880 ) + 118 O tau( 118) = ( 1.6949123 -0.3050877 0.6385880 ) + 119 O tau( 119) = ( 2.8050877 0.1949123 0.9578820 ) + 120 O tau( 120) = ( 2.1949123 0.8050877 0.9578820 ) + 121 Ti tau( 121) = ( 2.0000000 0.0000000 1.2771760 ) + 122 Ti tau( 122) = ( 2.5000000 0.5000000 1.5964700 ) + 123 O tau( 123) = ( 2.3050877 0.3050877 1.2771760 ) + 124 O tau( 124) = ( 1.6949123 -0.3050877 1.2771760 ) + 125 O tau( 125) = ( 2.8050877 0.1949123 1.5964700 ) + 126 O tau( 126) = ( 2.1949123 0.8050877 1.5964700 ) + 127 Ti tau( 127) = ( 2.0000000 1.0000000 0.0000000 ) + 128 Ti tau( 128) = ( 2.5000000 1.5000000 0.3192940 ) + 129 O tau( 129) = ( 2.3050877 1.3050877 0.0000000 ) + 130 O tau( 130) = ( 1.6949123 0.6949123 0.0000000 ) + 131 O tau( 131) = ( 2.8050877 1.1949123 0.3192940 ) + 132 O tau( 132) = ( 2.1949123 1.8050877 0.3192940 ) + 133 Ti tau( 133) = ( 2.0000000 1.0000000 0.6385880 ) + 134 Ti tau( 134) = ( 2.5000000 1.5000000 0.9578820 ) + 135 O tau( 135) = ( 2.3050877 1.3050877 0.6385880 ) + 136 O tau( 136) = ( 1.6949123 0.6949123 0.6385880 ) + 137 O tau( 137) = ( 2.8050877 1.1949123 0.9578820 ) + 138 O tau( 138) = ( 2.1949123 1.8050877 0.9578820 ) + 139 Ti tau( 139) = ( 2.0000000 1.0000000 1.2771760 ) + 140 Ti tau( 140) = ( 2.5000000 1.5000000 1.5964700 ) + 141 O tau( 141) = ( 2.3050877 1.3050877 1.2771760 ) + 142 O tau( 142) = ( 1.6949123 0.6949123 1.2771760 ) + 143 O tau( 143) = ( 2.8050877 1.1949123 1.5964700 ) + 144 O tau( 144) = ( 2.1949123 1.8050877 1.5964700 ) + 145 Ti tau( 145) = ( 2.0000000 2.0000000 0.0000000 ) + 146 Ti tau( 146) = ( 2.5000000 2.5000000 0.3192940 ) + 147 O tau( 147) = ( 2.3050877 2.3050877 0.0000000 ) + 148 O tau( 148) = ( 1.6949123 1.6949123 0.0000000 ) + 149 O tau( 149) = ( 2.8050877 2.1949123 0.3192940 ) + 150 O tau( 150) = ( 2.1949123 2.8050877 0.3192940 ) + 151 Ti tau( 151) = ( 2.0000000 2.0000000 0.6385880 ) + 152 Ti tau( 152) = ( 2.5000000 2.5000000 0.9578820 ) + 153 O tau( 153) = ( 2.3050877 2.3050877 0.6385880 ) + 154 O tau( 154) = ( 1.6949123 1.6949123 0.6385880 ) + 155 O tau( 155) = ( 2.8050877 2.1949123 0.9578820 ) + 156 O tau( 156) = ( 2.1949123 2.8050877 0.9578820 ) + 157 Ti tau( 157) = ( 2.0000000 2.0000000 1.2771760 ) + 158 Ti tau( 158) = ( 2.5000000 2.5000000 1.5964700 ) + 159 O tau( 159) = ( 2.3050877 2.3050877 1.2771760 ) + 160 O tau( 160) = ( 1.6949123 1.6949123 1.2771760 ) + 161 O tau( 161) = ( 2.8050877 2.1949123 1.5964700 ) + 162 O tau( 162) = ( 2.1949123 2.8050877 1.5964700 ) + + number of k points= 1 + cart. coord. in units 2pi/alat + k( 1) = ( -0.1666667 -0.1666667 -0.2609925), wk = 2.0000000 + + Dense grid: 2063233 G-vectors FFT dimensions: ( 192, 192, 120) + + Largest allocated arrays est. size (Mb) dimensions + Kohn-Sham Wavefunctions 63.82 Mb ( 6454, 648) + NL pseudopotentials 53.18 Mb ( 6454, 540) + Each V/rho on FFT grid 1.69 Mb ( 110592) + Each G-vector array 0.39 Mb ( 51583) + G-vector shells 0.17 Mb ( 22937) + Largest temporary arrays est. size (Mb) dimensions + Auxiliary wavefunctions 255.26 Mb ( 6454, 2592) + Each subspace H/S matrix 6.41 Mb ( 648, 648) + Each matrix 5.34 Mb ( 540, 648) + Arrays for rho mixing 13.50 Mb ( 110592, 8) + + Initial potential from superposition of free atoms + + starting charge 1079.99984, renormalised to 1296.00000 + Starting wfc are 918 atomic wfcs + + total cpu time spent up to now is 53.1 secs + + Self-consistent Calculation + + iteration # 1 ecut= 120.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 1.00E-02, avg # of iterations = 2.0 + Message from routine electrons.f90:275: + skipping write_rho; not implemented + + total cpu time spent up to now is 209.3 secs + + total energy = -9738.99021176 Ry + Harris-Foulkes estimate = -9812.90797112 Ry + estimated scf accuracy < 104.84528289 Ry + + End of self-consistent calculation + + convergence NOT achieved after 1 iterations: stopping + + init_run : 51.99s CPU 52.85s WALL ( 1 calls) + electrons : 154.54s CPU 156.24s WALL ( 1 calls) + + Called by init_run: + wfcinit : 46.58s CPU 47.30s WALL ( 1 calls) + potinit : 2.07s CPU 2.09s WALL ( 1 calls) + + Called by electrons: + c_bands : 143.65s CPU 145.27s WALL ( 1 calls) + sum_band : 10.45s CPU 10.52s WALL ( 1 calls) + v_of_rho : 0.66s CPU 0.67s WALL ( 2 calls) + mix_rho : 0.06s CPU 0.06s WALL ( 1 calls) + + Called by c_bands: + init_us_2 : 0.18s CPU 0.23s WALL ( 3 calls) + cegterg : 143.36s CPU 144.99s WALL ( 1 calls) + + Called by *egterg: + h_psi : 103.25s CPU 103.49s WALL ( 4 calls) + g_psi : 0.13s CPU 0.13s WALL ( 2 calls) + cdiaghg : 16.62s CPU 16.74s WALL ( 3 calls) + + Called by h_psi: + add_vuspsi : 10.44s CPU 10.45s WALL ( 4 calls) + + General routines + calbec : 10.62s CPU 10.62s WALL ( 4 calls) + fft : 0.56s CPU 0.58s WALL ( 22 calls) + fftw : 80.02s CPU 79.64s WALL ( 1594 calls) + + Parallel routines + fft_scatter : 34.67s CPU 35.18s WALL ( 1616 calls) + ALLTOALL : 5.01s CPU 3.13s WALL ( 1594 calls) + EXX routines + + PWSCF : 3m26.60s CPU 3m29.30s WALL + + + This run was terminated on: 16:25:38 20Dec2012 + +=------------------------------------------------------------------------------= + JOB DONE. + Benchmark_Time : 209.53s CPU 217.06s WALL ( 1 calls) +=------------------------------------------------------------------------------= +##IPM2v0.xx######################################################## +# +# command : ./mini_dft -ntg 4 -in titania_3_120.in +# start : Thu Dec 20 16:22:08 2012 host : nid01866 +# stop : Thu Dec 20 16:25:38 2012 wallclock : 209.62 +# mpi_tasks : 40 on 2 nodes %comm : 16.15 +# mem [GB] : 29.07 gflop/sec : 140.93 +# +# : [total] min max +# wallclock : 8383.25 209.58 209.54 209.62 +# MPI : 1353.60 33.84 24.28 50.38 +# %wall : +# MPI : 16.15 11.58 24.04 +# #calls : +# MPI : 965104 24127 7273 62393 +# mem [GB] : 29.07 0.73 0.72 0.74 +# +################################################################### +Application 14275400 resources: utime ~8336s, stime ~101s Rss ~775044 inblocks ~1571323 outblocks ~81310 diff --git a/tests/apps/miniDFT/tests/sample_outputs/small.XC30.out b/tests/apps/miniDFT/tests/sample_outputs/small.XC30.out new file mode 100644 index 0000000000..577575a67e --- /dev/null +++ b/tests/apps/miniDFT/tests/sample_outputs/small.XC30.out @@ -0,0 +1,366 @@ + + Program MiniDFT v.1.0 starts on 25Apr2013 at 10:29:52 + + This is mini-DFT, a mini-application for plane-wave density functional + theory calculations. Mini-DFT was extracted from + the open-source Quantum ESPRESSO suite by B. Austin (2013). + + To acknowledge Quantum ESPRESSO, please cite + P. Giannozzi et al., J. Phys.:Condens. Matter 21 395502 (2009); + URL http://www.quantum-espresso.org + + Parallel version (MPI), running on 40 processors + R & G space division: proc/pool = 40 + wavefunctions fft division: fft/group = 5 + + Current dimensions of program MiniDFT are: + Max number of different atomic species (ntypx) = 10 + Max number of k-points (npk) = 40000 + Max angular momentum in pseudopotentials (lmaxx) = 3 + Reading input from titania_3_120.in + + Subspace diagonalization in iterative solution of the eigenvalue problem: + scalapack distributed-memory algorithm (size of sub-group: 4* 4 procs) + + Found symmetry operation: I + ( 0.0000 0.0000 0.3333) + This is a supercell, fractional translations are disabled + + Task Groups are in USE + groups and procs/group : 5 8 + + Parallelization info + -------------------- + sticks: dense smooth PW G-vecs: dense smooth PW + Min 660 660 172 51580 51580 6900 + Max 661 661 173 51583 51583 6903 + Sum 26429 26429 6909 2063233 2063233 276071 + + + + bravais-lattice index = 0 + lattice parameter (alat) = 8.7671 a.u. + unit-cell volume = 11618.5625 (a.u.)^3 + number of atoms/cell = 162 + number of atomic types = 2 + number of electrons = 1296.00 + number of Kohn-Sham states= 648 + kinetic-energy cutoff = 120.0000 Ry + charge density cutoff = 480.0000 Ry + convergence threshold = 1.0E-04 + mixing beta = 0.7000 + number of iterations used = 8 plain mixing + Exchange-correlation = PBE ( 1 4 3 4 0) + + celldm(1)= 8.767100 celldm(2)= 0.000000 celldm(3)= 0.000000 + celldm(4)= 0.000000 celldm(5)= 0.000000 celldm(6)= 0.000000 + + crystal axes: (cart. coord. in units of alat) + a(1) = ( 3.000000 0.000000 0.000000 ) + a(2) = ( 0.000000 3.000000 0.000000 ) + a(3) = ( 0.000000 0.000000 1.915764 ) + + reciprocal axes: (cart. coord. in units 2 pi/alat) + b(1) = ( 0.333333 0.000000 0.000000 ) + b(2) = ( 0.000000 0.333333 0.000000 ) + b(3) = ( 0.000000 0.000000 0.521985 ) + + + PseudoPot. # 1 for Ti read from file: + ./Ti.pbe.nml + MD5 check sum: 6ed49f7d399b24f59f924a2d8bad0db9 + Pseudo is Norm-conserving, Zval = 12.0 + Generated using "atomic" code by A. Dal Corso (Quantum ESPRESSO distribution) + Using radial grid of 1177 points, 2 beta functions with: + l(1) = 1 + l(2) = 2 + + PseudoPot. # 2 for O read from file: + ./O.pbe.nml + MD5 check sum: 198e56c2ed007f5cae81829e0da21478 + Pseudo is Norm-conserving, Zval = 6.0 + Generated using "atomic" code by A. Dal Corso (Quantum ESPRESSO distribution) + Using radial grid of 1095 points, 1 beta functions with: + l(1) = 0 + + atomic species valence mass pseudopotential + Ti 12.00 47.86700 Ti( 1.00) + O 6.00 15.99940 O( 1.00) + + 8 Sym. Ops., with inversion, found + + + + Cartesian axes + + site n. atom positions (alat units) + 1 Ti tau( 1) = ( 0.0000000 0.0000000 0.0000000 ) + 2 Ti tau( 2) = ( 0.5000000 0.5000000 0.3192940 ) + 3 O tau( 3) = ( 0.3050877 0.3050877 0.0000000 ) + 4 O tau( 4) = ( -0.3050877 -0.3050877 0.0000000 ) + 5 O tau( 5) = ( 0.8050877 0.1949123 0.3192940 ) + 6 O tau( 6) = ( 0.1949123 0.8050877 0.3192940 ) + 7 Ti tau( 7) = ( 0.0000000 0.0000000 0.6385880 ) + 8 Ti tau( 8) = ( 0.5000000 0.5000000 0.9578820 ) + 9 O tau( 9) = ( 0.3050877 0.3050877 0.6385880 ) + 10 O tau( 10) = ( -0.3050877 -0.3050877 0.6385880 ) + 11 O tau( 11) = ( 0.8050877 0.1949123 0.9578820 ) + 12 O tau( 12) = ( 0.1949123 0.8050877 0.9578820 ) + 13 Ti tau( 13) = ( 0.0000000 0.0000000 1.2771760 ) + 14 Ti tau( 14) = ( 0.5000000 0.5000000 1.5964700 ) + 15 O tau( 15) = ( 0.3050877 0.3050877 1.2771760 ) + 16 O tau( 16) = ( -0.3050877 -0.3050877 1.2771760 ) + 17 O tau( 17) = ( 0.8050877 0.1949123 1.5964700 ) + 18 O tau( 18) = ( 0.1949123 0.8050877 1.5964700 ) + 19 Ti tau( 19) = ( 0.0000000 1.0000000 0.0000000 ) + 20 Ti tau( 20) = ( 0.5000000 1.5000000 0.3192940 ) + 21 O tau( 21) = ( 0.3050877 1.3050877 0.0000000 ) + 22 O tau( 22) = ( -0.3050877 0.6949123 0.0000000 ) + 23 O tau( 23) = ( 0.8050877 1.1949123 0.3192940 ) + 24 O tau( 24) = ( 0.1949123 1.8050877 0.3192940 ) + 25 Ti tau( 25) = ( 0.0000000 1.0000000 0.6385880 ) + 26 Ti tau( 26) = ( 0.5000000 1.5000000 0.9578820 ) + 27 O tau( 27) = ( 0.3050877 1.3050877 0.6385880 ) + 28 O tau( 28) = ( -0.3050877 0.6949123 0.6385880 ) + 29 O tau( 29) = ( 0.8050877 1.1949123 0.9578820 ) + 30 O tau( 30) = ( 0.1949123 1.8050877 0.9578820 ) + 31 Ti tau( 31) = ( 0.0000000 1.0000000 1.2771760 ) + 32 Ti tau( 32) = ( 0.5000000 1.5000000 1.5964700 ) + 33 O tau( 33) = ( 0.3050877 1.3050877 1.2771760 ) + 34 O tau( 34) = ( -0.3050877 0.6949123 1.2771760 ) + 35 O tau( 35) = ( 0.8050877 1.1949123 1.5964700 ) + 36 O tau( 36) = ( 0.1949123 1.8050877 1.5964700 ) + 37 Ti tau( 37) = ( 0.0000000 2.0000000 0.0000000 ) + 38 Ti tau( 38) = ( 0.5000000 2.5000000 0.3192940 ) + 39 O tau( 39) = ( 0.3050877 2.3050877 0.0000000 ) + 40 O tau( 40) = ( -0.3050877 1.6949123 0.0000000 ) + 41 O tau( 41) = ( 0.8050877 2.1949123 0.3192940 ) + 42 O tau( 42) = ( 0.1949123 2.8050877 0.3192940 ) + 43 Ti tau( 43) = ( 0.0000000 2.0000000 0.6385880 ) + 44 Ti tau( 44) = ( 0.5000000 2.5000000 0.9578820 ) + 45 O tau( 45) = ( 0.3050877 2.3050877 0.6385880 ) + 46 O tau( 46) = ( -0.3050877 1.6949123 0.6385880 ) + 47 O tau( 47) = ( 0.8050877 2.1949123 0.9578820 ) + 48 O tau( 48) = ( 0.1949123 2.8050877 0.9578820 ) + 49 Ti tau( 49) = ( 0.0000000 2.0000000 1.2771760 ) + 50 Ti tau( 50) = ( 0.5000000 2.5000000 1.5964700 ) + 51 O tau( 51) = ( 0.3050877 2.3050877 1.2771760 ) + 52 O tau( 52) = ( -0.3050877 1.6949123 1.2771760 ) + 53 O tau( 53) = ( 0.8050877 2.1949123 1.5964700 ) + 54 O tau( 54) = ( 0.1949123 2.8050877 1.5964700 ) + 55 Ti tau( 55) = ( 1.0000000 0.0000000 0.0000000 ) + 56 Ti tau( 56) = ( 1.5000000 0.5000000 0.3192940 ) + 57 O tau( 57) = ( 1.3050877 0.3050877 0.0000000 ) + 58 O tau( 58) = ( 0.6949123 -0.3050877 0.0000000 ) + 59 O tau( 59) = ( 1.8050877 0.1949123 0.3192940 ) + 60 O tau( 60) = ( 1.1949123 0.8050877 0.3192940 ) + 61 Ti tau( 61) = ( 1.0000000 0.0000000 0.6385880 ) + 62 Ti tau( 62) = ( 1.5000000 0.5000000 0.9578820 ) + 63 O tau( 63) = ( 1.3050877 0.3050877 0.6385880 ) + 64 O tau( 64) = ( 0.6949123 -0.3050877 0.6385880 ) + 65 O tau( 65) = ( 1.8050877 0.1949123 0.9578820 ) + 66 O tau( 66) = ( 1.1949123 0.8050877 0.9578820 ) + 67 Ti tau( 67) = ( 1.0000000 0.0000000 1.2771760 ) + 68 Ti tau( 68) = ( 1.5000000 0.5000000 1.5964700 ) + 69 O tau( 69) = ( 1.3050877 0.3050877 1.2771760 ) + 70 O tau( 70) = ( 0.6949123 -0.3050877 1.2771760 ) + 71 O tau( 71) = ( 1.8050877 0.1949123 1.5964700 ) + 72 O tau( 72) = ( 1.1949123 0.8050877 1.5964700 ) + 73 Ti tau( 73) = ( 1.0000000 1.0000000 0.0000000 ) + 74 Ti tau( 74) = ( 1.5000000 1.5000000 0.3192940 ) + 75 O tau( 75) = ( 1.3050877 1.3050877 0.0000000 ) + 76 O tau( 76) = ( 0.6949123 0.6949123 0.0000000 ) + 77 O tau( 77) = ( 1.8050877 1.1949123 0.3192940 ) + 78 O tau( 78) = ( 1.1949123 1.8050877 0.3192940 ) + 79 Ti tau( 79) = ( 1.0000000 1.0000000 0.6385880 ) + 80 Ti tau( 80) = ( 1.5000000 1.5000000 0.9578820 ) + 81 O tau( 81) = ( 1.3050877 1.3050877 0.6385880 ) + 82 O tau( 82) = ( 0.6949123 0.6949123 0.6385880 ) + 83 O tau( 83) = ( 1.8050877 1.1949123 0.9578820 ) + 84 O tau( 84) = ( 1.1949123 1.8050877 0.9578820 ) + 85 Ti tau( 85) = ( 1.0000000 1.0000000 1.2771760 ) + 86 Ti tau( 86) = ( 1.5000000 1.5000000 1.5964700 ) + 87 O tau( 87) = ( 1.3050877 1.3050877 1.2771760 ) + 88 O tau( 88) = ( 0.6949123 0.6949123 1.2771760 ) + 89 O tau( 89) = ( 1.8050877 1.1949123 1.5964700 ) + 90 O tau( 90) = ( 1.1949123 1.8050877 1.5964700 ) + 91 Ti tau( 91) = ( 1.0000000 2.0000000 0.0000000 ) + 92 Ti tau( 92) = ( 1.5000000 2.5000000 0.3192940 ) + 93 O tau( 93) = ( 1.3050877 2.3050877 0.0000000 ) + 94 O tau( 94) = ( 0.6949123 1.6949123 0.0000000 ) + 95 O tau( 95) = ( 1.8050877 2.1949123 0.3192940 ) + 96 O tau( 96) = ( 1.1949123 2.8050877 0.3192940 ) + 97 Ti tau( 97) = ( 1.0000000 2.0000000 0.6385880 ) + 98 Ti tau( 98) = ( 1.5000000 2.5000000 0.9578820 ) + 99 O tau( 99) = ( 1.3050877 2.3050877 0.6385880 ) + 100 O tau( 100) = ( 0.6949123 1.6949123 0.6385880 ) + 101 O tau( 101) = ( 1.8050877 2.1949123 0.9578820 ) + 102 O tau( 102) = ( 1.1949123 2.8050877 0.9578820 ) + 103 Ti tau( 103) = ( 1.0000000 2.0000000 1.2771760 ) + 104 Ti tau( 104) = ( 1.5000000 2.5000000 1.5964700 ) + 105 O tau( 105) = ( 1.3050877 2.3050877 1.2771760 ) + 106 O tau( 106) = ( 0.6949123 1.6949123 1.2771760 ) + 107 O tau( 107) = ( 1.8050877 2.1949123 1.5964700 ) + 108 O tau( 108) = ( 1.1949123 2.8050877 1.5964700 ) + 109 Ti tau( 109) = ( 2.0000000 0.0000000 0.0000000 ) + 110 Ti tau( 110) = ( 2.5000000 0.5000000 0.3192940 ) + 111 O tau( 111) = ( 2.3050877 0.3050877 0.0000000 ) + 112 O tau( 112) = ( 1.6949123 -0.3050877 0.0000000 ) + 113 O tau( 113) = ( 2.8050877 0.1949123 0.3192940 ) + 114 O tau( 114) = ( 2.1949123 0.8050877 0.3192940 ) + 115 Ti tau( 115) = ( 2.0000000 0.0000000 0.6385880 ) + 116 Ti tau( 116) = ( 2.5000000 0.5000000 0.9578820 ) + 117 O tau( 117) = ( 2.3050877 0.3050877 0.6385880 ) + 118 O tau( 118) = ( 1.6949123 -0.3050877 0.6385880 ) + 119 O tau( 119) = ( 2.8050877 0.1949123 0.9578820 ) + 120 O tau( 120) = ( 2.1949123 0.8050877 0.9578820 ) + 121 Ti tau( 121) = ( 2.0000000 0.0000000 1.2771760 ) + 122 Ti tau( 122) = ( 2.5000000 0.5000000 1.5964700 ) + 123 O tau( 123) = ( 2.3050877 0.3050877 1.2771760 ) + 124 O tau( 124) = ( 1.6949123 -0.3050877 1.2771760 ) + 125 O tau( 125) = ( 2.8050877 0.1949123 1.5964700 ) + 126 O tau( 126) = ( 2.1949123 0.8050877 1.5964700 ) + 127 Ti tau( 127) = ( 2.0000000 1.0000000 0.0000000 ) + 128 Ti tau( 128) = ( 2.5000000 1.5000000 0.3192940 ) + 129 O tau( 129) = ( 2.3050877 1.3050877 0.0000000 ) + 130 O tau( 130) = ( 1.6949123 0.6949123 0.0000000 ) + 131 O tau( 131) = ( 2.8050877 1.1949123 0.3192940 ) + 132 O tau( 132) = ( 2.1949123 1.8050877 0.3192940 ) + 133 Ti tau( 133) = ( 2.0000000 1.0000000 0.6385880 ) + 134 Ti tau( 134) = ( 2.5000000 1.5000000 0.9578820 ) + 135 O tau( 135) = ( 2.3050877 1.3050877 0.6385880 ) + 136 O tau( 136) = ( 1.6949123 0.6949123 0.6385880 ) + 137 O tau( 137) = ( 2.8050877 1.1949123 0.9578820 ) + 138 O tau( 138) = ( 2.1949123 1.8050877 0.9578820 ) + 139 Ti tau( 139) = ( 2.0000000 1.0000000 1.2771760 ) + 140 Ti tau( 140) = ( 2.5000000 1.5000000 1.5964700 ) + 141 O tau( 141) = ( 2.3050877 1.3050877 1.2771760 ) + 142 O tau( 142) = ( 1.6949123 0.6949123 1.2771760 ) + 143 O tau( 143) = ( 2.8050877 1.1949123 1.5964700 ) + 144 O tau( 144) = ( 2.1949123 1.8050877 1.5964700 ) + 145 Ti tau( 145) = ( 2.0000000 2.0000000 0.0000000 ) + 146 Ti tau( 146) = ( 2.5000000 2.5000000 0.3192940 ) + 147 O tau( 147) = ( 2.3050877 2.3050877 0.0000000 ) + 148 O tau( 148) = ( 1.6949123 1.6949123 0.0000000 ) + 149 O tau( 149) = ( 2.8050877 2.1949123 0.3192940 ) + 150 O tau( 150) = ( 2.1949123 2.8050877 0.3192940 ) + 151 Ti tau( 151) = ( 2.0000000 2.0000000 0.6385880 ) + 152 Ti tau( 152) = ( 2.5000000 2.5000000 0.9578820 ) + 153 O tau( 153) = ( 2.3050877 2.3050877 0.6385880 ) + 154 O tau( 154) = ( 1.6949123 1.6949123 0.6385880 ) + 155 O tau( 155) = ( 2.8050877 2.1949123 0.9578820 ) + 156 O tau( 156) = ( 2.1949123 2.8050877 0.9578820 ) + 157 Ti tau( 157) = ( 2.0000000 2.0000000 1.2771760 ) + 158 Ti tau( 158) = ( 2.5000000 2.5000000 1.5964700 ) + 159 O tau( 159) = ( 2.3050877 2.3050877 1.2771760 ) + 160 O tau( 160) = ( 1.6949123 1.6949123 1.2771760 ) + 161 O tau( 161) = ( 2.8050877 2.1949123 1.5964700 ) + 162 O tau( 162) = ( 2.1949123 2.8050877 1.5964700 ) + + number of k points= 1 + cart. coord. in units 2pi/alat + k( 1) = ( -0.1666667 -0.1666667 -0.2609925), wk = 2.0000000 + + Dense grid: 2063233 G-vectors FFT dimensions: ( 192, 192, 120) + + Largest allocated arrays est. size (Mb) dimensions + Kohn-Sham Wavefunctions 63.82 Mb ( 6454, 648) + NL pseudopotentials 53.18 Mb ( 6454, 540) + Each V/rho on FFT grid 1.69 Mb ( 110592) + Each G-vector array 0.39 Mb ( 51583) + G-vector shells 0.17 Mb ( 22937) + Largest temporary arrays est. size (Mb) dimensions + Auxiliary wavefunctions 255.26 Mb ( 6454, 2592) + Each subspace H/S matrix 6.41 Mb ( 648, 648) + Each matrix 5.34 Mb ( 540, 648) + Arrays for rho mixing 13.50 Mb ( 110592, 8) + + Initial potential from superposition of free atoms + + starting charge 1079.99984, renormalised to 1296.00000 + Starting wfc are 918 atomic wfcs + + total cpu time spent up to now is 19.5 secs + + Self-consistent Calculation + + iteration # 1 ecut= 120.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 1.00E-02, avg # of iterations = 2.0 + + total cpu time spent up to now is 75.9 secs + + total energy = -9738.99021176 Ry + Harris-Foulkes estimate = -9812.90797112 Ry + estimated scf accuracy < 104.84528289 Ry + + End of self-consistent calculation + + convergence NOT achieved after 1 iterations: stopping + + init_run : 19.14s CPU 19.40s WALL ( 1 calls) + electrons : 55.96s CPU 56.48s WALL ( 1 calls) + + Called by init_run: + wfcinit : 16.64s CPU 16.85s WALL ( 1 calls) + potinit : 0.74s CPU 0.76s WALL ( 1 calls) + + Called by electrons: + c_bands : 52.05s CPU 52.52s WALL ( 1 calls) + sum_band : 3.74s CPU 3.77s WALL ( 1 calls) + v_of_rho : 0.24s CPU 0.25s WALL ( 2 calls) + mix_rho : 0.02s CPU 0.02s WALL ( 1 calls) + + Called by c_bands: + init_us_2 : 0.04s CPU 0.08s WALL ( 3 calls) + cegterg : 51.96s CPU 52.42s WALL ( 1 calls) + + Called by *egterg: + h_psi : 36.60s CPU 36.72s WALL ( 4 calls) + g_psi : 0.09s CPU 0.09s WALL ( 2 calls) + cdiaghg : 5.74s CPU 5.78s WALL ( 3 calls) + + Called by h_psi: + add_vuspsi : 3.77s CPU 3.78s WALL ( 4 calls) + + General routines + calbec : 3.86s CPU 3.87s WALL ( 4 calls) + fft : 0.28s CPU 0.30s WALL ( 22 calls) + fftw : 26.90s CPU 26.94s WALL ( 1278 calls) + + Parallel routines + fft_scatter : 15.18s CPU 15.20s WALL ( 1300 calls) + ALLTOALL : 1.28s CPU 1.24s WALL ( 1278 calls) + EXX routines + + MiniDFT : 1m15.12s CPU 1m15.95s WALL + + + This run was terminated on: 10:31: 8 25Apr2013 + +=------------------------------------------------------------------------------= + JOB DONE. + Benchmark_Time : 55.96s CPU 56.48s WALL ( 1 calls) +=------------------------------------------------------------------------------= + +Application 293879 exit codes: 1 +Application 293879 resources: utime ~3029s, stime ~30s, Rss ~755152, inblocks ~190815, outblocks ~262038 + + + -------------------------------------------------------------------------- + + Job name: tesdft + + Job Id: 76137.edison06 + + System: edison + + Queued Time: Thu Apr 25 10:29:05 2013 + + Start Time: Thu Apr 25 10:29:45 2013 + + Completion Time: Thu Apr 25 10:31:22 2013 + + User: hjw + + Group: hjw + + MOM Host: nid00705 + + Queue: reg_small + + Req. Resources: walltime=00:09:00 + + Used Resources: cput=00:00:02,mem=11072kb,vmem=164544kb,walltime=00:01:38 + + Acct String: darpa + + PBS_O_WORKDIR: /scratch1/scratchdirs/hjw/miniDFT/benchmark + + Submit Args: run.pbs + + Job Exit: 1 + + -------------------------------------------------------------------------- + diff --git a/tests/apps/miniDFT/tests/sample_outputs/small.XE6.out b/tests/apps/miniDFT/tests/sample_outputs/small.XE6.out new file mode 100644 index 0000000000..c47a0395b8 --- /dev/null +++ b/tests/apps/miniDFT/tests/sample_outputs/small.XE6.out @@ -0,0 +1,343 @@ + + Program MiniDFT v.1.0 starts on 25Apr2013 at 18:20: 8 + + This is mini-DFT, a mini-application for plane-wave density functional + theory calculations. Mini-DFT was extracted from + the open-source Quantum ESPRESSO suite by B. Austin (2013). + + To acknowledge Quantum ESPRESSO, please cite + P. Giannozzi et al., J. Phys.:Condens. Matter 21 395502 (2009); + URL http://www.quantum-espresso.org + + Parallel version (MPI), running on 40 processors + R & G space division: proc/pool = 40 + wavefunctions fft division: fft/group = 5 + + Current dimensions of program MiniDFT are: + Max number of different atomic species (ntypx) = 10 + Max number of k-points (npk) = 40000 + Max angular momentum in pseudopotentials (lmaxx) = 3 + Reading input from single-node.in + + Subspace diagonalization in iterative solution of the eigenvalue problem: + scalapack distributed-memory algorithm (size of sub-group: 4* 4 procs) + + Found symmetry operation: I + ( 0.0000 0.0000 0.3333) + This is a supercell, fractional translations are disabled + + Task Groups are in USE + groups and procs/group : 5 8 + + Parallelization info + -------------------- + sticks: dense smooth PW G-vecs: dense smooth PW + Min 660 660 172 51580 51580 6900 + Max 661 661 173 51583 51583 6903 + Sum 26429 26429 6909 2063233 2063233 276071 + + + + bravais-lattice index = 0 + lattice parameter (alat) = 8.7671 a.u. + unit-cell volume = 11618.5625 (a.u.)^3 + number of atoms/cell = 162 + number of atomic types = 2 + number of electrons = 1296.00 + number of Kohn-Sham states= 648 + kinetic-energy cutoff = 120.0000 Ry + charge density cutoff = 480.0000 Ry + convergence threshold = 1.0E-04 + mixing beta = 0.7000 + number of iterations used = 8 plain mixing + Exchange-correlation = PBE ( 1 4 3 4 0) + + celldm(1)= 8.767100 celldm(2)= 0.000000 celldm(3)= 0.000000 + celldm(4)= 0.000000 celldm(5)= 0.000000 celldm(6)= 0.000000 + + crystal axes: (cart. coord. in units of alat) + a(1) = ( 3.000000 0.000000 0.000000 ) + a(2) = ( 0.000000 3.000000 0.000000 ) + a(3) = ( 0.000000 0.000000 1.915764 ) + + reciprocal axes: (cart. coord. in units 2 pi/alat) + b(1) = ( 0.333333 0.000000 0.000000 ) + b(2) = ( 0.000000 0.333333 0.000000 ) + b(3) = ( 0.000000 0.000000 0.521985 ) + + + PseudoPot. # 1 for Ti read from file: + ./Ti.pbe.nml + MD5 check sum: 6ed49f7d399b24f59f924a2d8bad0db9 + Pseudo is Norm-conserving, Zval = 12.0 + Generated using "atomic" code by A. Dal Corso (Quantum ESPRESSO distribution) + Using radial grid of 1177 points, 2 beta functions with: + l(1) = 1 + l(2) = 2 + + PseudoPot. # 2 for O read from file: + ./O.pbe.nml + MD5 check sum: 198e56c2ed007f5cae81829e0da21478 + Pseudo is Norm-conserving, Zval = 6.0 + Generated using "atomic" code by A. Dal Corso (Quantum ESPRESSO distribution) + Using radial grid of 1095 points, 1 beta functions with: + l(1) = 0 + + atomic species valence mass pseudopotential + Ti 12.00 47.86700 Ti( 1.00) + O 6.00 15.99940 O( 1.00) + + 8 Sym. Ops., with inversion, found + + + + Cartesian axes + + site n. atom positions (alat units) + 1 Ti tau( 1) = ( 0.0000000 0.0000000 0.0000000 ) + 2 Ti tau( 2) = ( 0.5000000 0.5000000 0.3192940 ) + 3 O tau( 3) = ( 0.3050877 0.3050877 0.0000000 ) + 4 O tau( 4) = ( -0.3050877 -0.3050877 0.0000000 ) + 5 O tau( 5) = ( 0.8050877 0.1949123 0.3192940 ) + 6 O tau( 6) = ( 0.1949123 0.8050877 0.3192940 ) + 7 Ti tau( 7) = ( 0.0000000 0.0000000 0.6385880 ) + 8 Ti tau( 8) = ( 0.5000000 0.5000000 0.9578820 ) + 9 O tau( 9) = ( 0.3050877 0.3050877 0.6385880 ) + 10 O tau( 10) = ( -0.3050877 -0.3050877 0.6385880 ) + 11 O tau( 11) = ( 0.8050877 0.1949123 0.9578820 ) + 12 O tau( 12) = ( 0.1949123 0.8050877 0.9578820 ) + 13 Ti tau( 13) = ( 0.0000000 0.0000000 1.2771760 ) + 14 Ti tau( 14) = ( 0.5000000 0.5000000 1.5964700 ) + 15 O tau( 15) = ( 0.3050877 0.3050877 1.2771760 ) + 16 O tau( 16) = ( -0.3050877 -0.3050877 1.2771760 ) + 17 O tau( 17) = ( 0.8050877 0.1949123 1.5964700 ) + 18 O tau( 18) = ( 0.1949123 0.8050877 1.5964700 ) + 19 Ti tau( 19) = ( 0.0000000 1.0000000 0.0000000 ) + 20 Ti tau( 20) = ( 0.5000000 1.5000000 0.3192940 ) + 21 O tau( 21) = ( 0.3050877 1.3050877 0.0000000 ) + 22 O tau( 22) = ( -0.3050877 0.6949123 0.0000000 ) + 23 O tau( 23) = ( 0.8050877 1.1949123 0.3192940 ) + 24 O tau( 24) = ( 0.1949123 1.8050877 0.3192940 ) + 25 Ti tau( 25) = ( 0.0000000 1.0000000 0.6385880 ) + 26 Ti tau( 26) = ( 0.5000000 1.5000000 0.9578820 ) + 27 O tau( 27) = ( 0.3050877 1.3050877 0.6385880 ) + 28 O tau( 28) = ( -0.3050877 0.6949123 0.6385880 ) + 29 O tau( 29) = ( 0.8050877 1.1949123 0.9578820 ) + 30 O tau( 30) = ( 0.1949123 1.8050877 0.9578820 ) + 31 Ti tau( 31) = ( 0.0000000 1.0000000 1.2771760 ) + 32 Ti tau( 32) = ( 0.5000000 1.5000000 1.5964700 ) + 33 O tau( 33) = ( 0.3050877 1.3050877 1.2771760 ) + 34 O tau( 34) = ( -0.3050877 0.6949123 1.2771760 ) + 35 O tau( 35) = ( 0.8050877 1.1949123 1.5964700 ) + 36 O tau( 36) = ( 0.1949123 1.8050877 1.5964700 ) + 37 Ti tau( 37) = ( 0.0000000 2.0000000 0.0000000 ) + 38 Ti tau( 38) = ( 0.5000000 2.5000000 0.3192940 ) + 39 O tau( 39) = ( 0.3050877 2.3050877 0.0000000 ) + 40 O tau( 40) = ( -0.3050877 1.6949123 0.0000000 ) + 41 O tau( 41) = ( 0.8050877 2.1949123 0.3192940 ) + 42 O tau( 42) = ( 0.1949123 2.8050877 0.3192940 ) + 43 Ti tau( 43) = ( 0.0000000 2.0000000 0.6385880 ) + 44 Ti tau( 44) = ( 0.5000000 2.5000000 0.9578820 ) + 45 O tau( 45) = ( 0.3050877 2.3050877 0.6385880 ) + 46 O tau( 46) = ( -0.3050877 1.6949123 0.6385880 ) + 47 O tau( 47) = ( 0.8050877 2.1949123 0.9578820 ) + 48 O tau( 48) = ( 0.1949123 2.8050877 0.9578820 ) + 49 Ti tau( 49) = ( 0.0000000 2.0000000 1.2771760 ) + 50 Ti tau( 50) = ( 0.5000000 2.5000000 1.5964700 ) + 51 O tau( 51) = ( 0.3050877 2.3050877 1.2771760 ) + 52 O tau( 52) = ( -0.3050877 1.6949123 1.2771760 ) + 53 O tau( 53) = ( 0.8050877 2.1949123 1.5964700 ) + 54 O tau( 54) = ( 0.1949123 2.8050877 1.5964700 ) + 55 Ti tau( 55) = ( 1.0000000 0.0000000 0.0000000 ) + 56 Ti tau( 56) = ( 1.5000000 0.5000000 0.3192940 ) + 57 O tau( 57) = ( 1.3050877 0.3050877 0.0000000 ) + 58 O tau( 58) = ( 0.6949123 -0.3050877 0.0000000 ) + 59 O tau( 59) = ( 1.8050877 0.1949123 0.3192940 ) + 60 O tau( 60) = ( 1.1949123 0.8050877 0.3192940 ) + 61 Ti tau( 61) = ( 1.0000000 0.0000000 0.6385880 ) + 62 Ti tau( 62) = ( 1.5000000 0.5000000 0.9578820 ) + 63 O tau( 63) = ( 1.3050877 0.3050877 0.6385880 ) + 64 O tau( 64) = ( 0.6949123 -0.3050877 0.6385880 ) + 65 O tau( 65) = ( 1.8050877 0.1949123 0.9578820 ) + 66 O tau( 66) = ( 1.1949123 0.8050877 0.9578820 ) + 67 Ti tau( 67) = ( 1.0000000 0.0000000 1.2771760 ) + 68 Ti tau( 68) = ( 1.5000000 0.5000000 1.5964700 ) + 69 O tau( 69) = ( 1.3050877 0.3050877 1.2771760 ) + 70 O tau( 70) = ( 0.6949123 -0.3050877 1.2771760 ) + 71 O tau( 71) = ( 1.8050877 0.1949123 1.5964700 ) + 72 O tau( 72) = ( 1.1949123 0.8050877 1.5964700 ) + 73 Ti tau( 73) = ( 1.0000000 1.0000000 0.0000000 ) + 74 Ti tau( 74) = ( 1.5000000 1.5000000 0.3192940 ) + 75 O tau( 75) = ( 1.3050877 1.3050877 0.0000000 ) + 76 O tau( 76) = ( 0.6949123 0.6949123 0.0000000 ) + 77 O tau( 77) = ( 1.8050877 1.1949123 0.3192940 ) + 78 O tau( 78) = ( 1.1949123 1.8050877 0.3192940 ) + 79 Ti tau( 79) = ( 1.0000000 1.0000000 0.6385880 ) + 80 Ti tau( 80) = ( 1.5000000 1.5000000 0.9578820 ) + 81 O tau( 81) = ( 1.3050877 1.3050877 0.6385880 ) + 82 O tau( 82) = ( 0.6949123 0.6949123 0.6385880 ) + 83 O tau( 83) = ( 1.8050877 1.1949123 0.9578820 ) + 84 O tau( 84) = ( 1.1949123 1.8050877 0.9578820 ) + 85 Ti tau( 85) = ( 1.0000000 1.0000000 1.2771760 ) + 86 Ti tau( 86) = ( 1.5000000 1.5000000 1.5964700 ) + 87 O tau( 87) = ( 1.3050877 1.3050877 1.2771760 ) + 88 O tau( 88) = ( 0.6949123 0.6949123 1.2771760 ) + 89 O tau( 89) = ( 1.8050877 1.1949123 1.5964700 ) + 90 O tau( 90) = ( 1.1949123 1.8050877 1.5964700 ) + 91 Ti tau( 91) = ( 1.0000000 2.0000000 0.0000000 ) + 92 Ti tau( 92) = ( 1.5000000 2.5000000 0.3192940 ) + 93 O tau( 93) = ( 1.3050877 2.3050877 0.0000000 ) + 94 O tau( 94) = ( 0.6949123 1.6949123 0.0000000 ) + 95 O tau( 95) = ( 1.8050877 2.1949123 0.3192940 ) + 96 O tau( 96) = ( 1.1949123 2.8050877 0.3192940 ) + 97 Ti tau( 97) = ( 1.0000000 2.0000000 0.6385880 ) + 98 Ti tau( 98) = ( 1.5000000 2.5000000 0.9578820 ) + 99 O tau( 99) = ( 1.3050877 2.3050877 0.6385880 ) + 100 O tau( 100) = ( 0.6949123 1.6949123 0.6385880 ) + 101 O tau( 101) = ( 1.8050877 2.1949123 0.9578820 ) + 102 O tau( 102) = ( 1.1949123 2.8050877 0.9578820 ) + 103 Ti tau( 103) = ( 1.0000000 2.0000000 1.2771760 ) + 104 Ti tau( 104) = ( 1.5000000 2.5000000 1.5964700 ) + 105 O tau( 105) = ( 1.3050877 2.3050877 1.2771760 ) + 106 O tau( 106) = ( 0.6949123 1.6949123 1.2771760 ) + 107 O tau( 107) = ( 1.8050877 2.1949123 1.5964700 ) + 108 O tau( 108) = ( 1.1949123 2.8050877 1.5964700 ) + 109 Ti tau( 109) = ( 2.0000000 0.0000000 0.0000000 ) + 110 Ti tau( 110) = ( 2.5000000 0.5000000 0.3192940 ) + 111 O tau( 111) = ( 2.3050877 0.3050877 0.0000000 ) + 112 O tau( 112) = ( 1.6949123 -0.3050877 0.0000000 ) + 113 O tau( 113) = ( 2.8050877 0.1949123 0.3192940 ) + 114 O tau( 114) = ( 2.1949123 0.8050877 0.3192940 ) + 115 Ti tau( 115) = ( 2.0000000 0.0000000 0.6385880 ) + 116 Ti tau( 116) = ( 2.5000000 0.5000000 0.9578820 ) + 117 O tau( 117) = ( 2.3050877 0.3050877 0.6385880 ) + 118 O tau( 118) = ( 1.6949123 -0.3050877 0.6385880 ) + 119 O tau( 119) = ( 2.8050877 0.1949123 0.9578820 ) + 120 O tau( 120) = ( 2.1949123 0.8050877 0.9578820 ) + 121 Ti tau( 121) = ( 2.0000000 0.0000000 1.2771760 ) + 122 Ti tau( 122) = ( 2.5000000 0.5000000 1.5964700 ) + 123 O tau( 123) = ( 2.3050877 0.3050877 1.2771760 ) + 124 O tau( 124) = ( 1.6949123 -0.3050877 1.2771760 ) + 125 O tau( 125) = ( 2.8050877 0.1949123 1.5964700 ) + 126 O tau( 126) = ( 2.1949123 0.8050877 1.5964700 ) + 127 Ti tau( 127) = ( 2.0000000 1.0000000 0.0000000 ) + 128 Ti tau( 128) = ( 2.5000000 1.5000000 0.3192940 ) + 129 O tau( 129) = ( 2.3050877 1.3050877 0.0000000 ) + 130 O tau( 130) = ( 1.6949123 0.6949123 0.0000000 ) + 131 O tau( 131) = ( 2.8050877 1.1949123 0.3192940 ) + 132 O tau( 132) = ( 2.1949123 1.8050877 0.3192940 ) + 133 Ti tau( 133) = ( 2.0000000 1.0000000 0.6385880 ) + 134 Ti tau( 134) = ( 2.5000000 1.5000000 0.9578820 ) + 135 O tau( 135) = ( 2.3050877 1.3050877 0.6385880 ) + 136 O tau( 136) = ( 1.6949123 0.6949123 0.6385880 ) + 137 O tau( 137) = ( 2.8050877 1.1949123 0.9578820 ) + 138 O tau( 138) = ( 2.1949123 1.8050877 0.9578820 ) + 139 Ti tau( 139) = ( 2.0000000 1.0000000 1.2771760 ) + 140 Ti tau( 140) = ( 2.5000000 1.5000000 1.5964700 ) + 141 O tau( 141) = ( 2.3050877 1.3050877 1.2771760 ) + 142 O tau( 142) = ( 1.6949123 0.6949123 1.2771760 ) + 143 O tau( 143) = ( 2.8050877 1.1949123 1.5964700 ) + 144 O tau( 144) = ( 2.1949123 1.8050877 1.5964700 ) + 145 Ti tau( 145) = ( 2.0000000 2.0000000 0.0000000 ) + 146 Ti tau( 146) = ( 2.5000000 2.5000000 0.3192940 ) + 147 O tau( 147) = ( 2.3050877 2.3050877 0.0000000 ) + 148 O tau( 148) = ( 1.6949123 1.6949123 0.0000000 ) + 149 O tau( 149) = ( 2.8050877 2.1949123 0.3192940 ) + 150 O tau( 150) = ( 2.1949123 2.8050877 0.3192940 ) + 151 Ti tau( 151) = ( 2.0000000 2.0000000 0.6385880 ) + 152 Ti tau( 152) = ( 2.5000000 2.5000000 0.9578820 ) + 153 O tau( 153) = ( 2.3050877 2.3050877 0.6385880 ) + 154 O tau( 154) = ( 1.6949123 1.6949123 0.6385880 ) + 155 O tau( 155) = ( 2.8050877 2.1949123 0.9578820 ) + 156 O tau( 156) = ( 2.1949123 2.8050877 0.9578820 ) + 157 Ti tau( 157) = ( 2.0000000 2.0000000 1.2771760 ) + 158 Ti tau( 158) = ( 2.5000000 2.5000000 1.5964700 ) + 159 O tau( 159) = ( 2.3050877 2.3050877 1.2771760 ) + 160 O tau( 160) = ( 1.6949123 1.6949123 1.2771760 ) + 161 O tau( 161) = ( 2.8050877 2.1949123 1.5964700 ) + 162 O tau( 162) = ( 2.1949123 2.8050877 1.5964700 ) + + number of k points= 1 + cart. coord. in units 2pi/alat + k( 1) = ( -0.1666667 -0.1666667 -0.2609925), wk = 2.0000000 + + Dense grid: 2063233 G-vectors FFT dimensions: ( 192, 192, 120) + + Largest allocated arrays est. size (Mb) dimensions + Kohn-Sham Wavefunctions 63.82 Mb ( 6454, 648) + NL pseudopotentials 53.18 Mb ( 6454, 540) + Each V/rho on FFT grid 1.69 Mb ( 110592) + Each G-vector array 0.39 Mb ( 51583) + G-vector shells 0.17 Mb ( 22937) + Largest temporary arrays est. size (Mb) dimensions + Auxiliary wavefunctions 255.26 Mb ( 6454, 2592) + Each subspace H/S matrix 6.41 Mb ( 648, 648) + Each matrix 5.34 Mb ( 540, 648) + Arrays for rho mixing 13.50 Mb ( 110592, 8) + + Initial potential from superposition of free atoms + + starting charge 1079.99984, renormalised to 1296.00000 + Starting wfc are 918 atomic wfcs + + total cpu time spent up to now is 53.0 secs + + Self-consistent Calculation + + iteration # 1 ecut= 120.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 1.00E-02, avg # of iterations = 2.0 + + total cpu time spent up to now is 208.1 secs + + total energy = -9738.99021176 Ry + Harris-Foulkes estimate = -9812.90797112 Ry + estimated scf accuracy < 104.84528289 Ry + + End of self-consistent calculation + + convergence NOT achieved after 1 iterations: stopping + + init_run : 51.97s CPU 52.83s WALL ( 1 calls) + electrons : 153.48s CPU 155.13s WALL ( 1 calls) + + Called by init_run: + wfcinit : 46.27s CPU 47.03s WALL ( 1 calls) + potinit : 2.04s CPU 2.06s WALL ( 1 calls) + + Called by electrons: + c_bands : 142.62s CPU 144.23s WALL ( 1 calls) + sum_band : 10.43s CPU 10.46s WALL ( 1 calls) + v_of_rho : 0.62s CPU 0.64s WALL ( 2 calls) + mix_rho : 0.06s CPU 0.06s WALL ( 1 calls) + + Called by c_bands: + init_us_2 : 0.18s CPU 0.24s WALL ( 3 calls) + cegterg : 142.34s CPU 143.95s WALL ( 1 calls) + + Called by *egterg: + h_psi : 103.06s CPU 103.37s WALL ( 4 calls) + g_psi : 0.14s CPU 0.13s WALL ( 2 calls) + cdiaghg : 15.97s CPU 16.02s WALL ( 3 calls) + + Called by h_psi: + add_vuspsi : 10.47s CPU 10.47s WALL ( 4 calls) + + General routines + calbec : 10.51s CPU 10.52s WALL ( 4 calls) + fft : 0.51s CPU 0.53s WALL ( 22 calls) + fftw : 79.15s CPU 79.26s WALL ( 1278 calls) + + Parallel routines + fft_scatter : 33.66s CPU 33.99s WALL ( 1300 calls) + ALLTOALL : 3.82s CPU 3.76s WALL ( 1278 calls) + EXX routines + + MiniDFT : 3m25.50s CPU 3m28.08s WALL + + + This run was terminated on: 18:23:36 25Apr2013 + +=------------------------------------------------------------------------------= + JOB DONE. + Benchmark_Time : 153.48s CPU 155.13s WALL ( 1 calls) +=------------------------------------------------------------------------------= diff --git a/tests/apps/miniDFT/tests/sample_outputs/small.nehalemIB.out b/tests/apps/miniDFT/tests/sample_outputs/small.nehalemIB.out new file mode 100644 index 0000000000..50fbe0e947 --- /dev/null +++ b/tests/apps/miniDFT/tests/sample_outputs/small.nehalemIB.out @@ -0,0 +1,433 @@ + + Program MiniDFT v.1.0 starts on 25Apr2013 at 11:32:42 + + This is mini-DFT, a mini-application for plane-wave density functional + theory calculations. Mini-DFT was extracted from + the open-source Quantum ESPRESSO suite by B. Austin (2013). + + To acknowledge Quantum ESPRESSO, please cite + P. Giannozzi et al., J. Phys.:Condens. Matter 21 395502 (2009); + URL http://www.quantum-espresso.org + + Parallel version (MPI), running on 40 processors + R & G space division: proc/pool = 40 + wavefunctions fft division: fft/group = 5 + + Current dimensions of program MiniDFT are: + Max number of different atomic species (ntypx) = 10 + Max number of k-points (npk) = 40000 + Max angular momentum in pseudopotentials (lmaxx) = 3 + Reading input from single-node.in + + Subspace diagonalization in iterative solution of the eigenvalue problem: + scalapack distributed-memory algorithm (size of sub-group: 4* 4 procs) + + Found symmetry operation: I + ( 0.0000 0.0000 0.3333) + This is a supercell, fractional translations are disabled + + Task Groups are in USE + groups and procs/group : 5 8 + + Parallelization info + -------------------- + sticks: dense smooth PW G-vecs: dense smooth PW + Min 660 660 172 51580 51580 6900 + Max 661 661 173 51583 51583 6903 + Sum 26429 26429 6909 2063233 2063233 276071 + + + + bravais-lattice index = 0 + lattice parameter (alat) = 8.7671 a.u. + unit-cell volume = 11618.5625 (a.u.)^3 + number of atoms/cell = 162 + number of atomic types = 2 + number of electrons = 1296.00 + number of Kohn-Sham states= 648 + kinetic-energy cutoff = 120.0000 Ry + charge density cutoff = 480.0000 Ry + convergence threshold = 1.0E-04 + mixing beta = 0.7000 + number of iterations used = 8 plain mixing + Exchange-correlation = PBE ( 1 4 3 4 0) + + celldm(1)= 8.767100 celldm(2)= 0.000000 celldm(3)= 0.000000 + celldm(4)= 0.000000 celldm(5)= 0.000000 celldm(6)= 0.000000 + + crystal axes: (cart. coord. in units of alat) + a(1) = ( 3.000000 0.000000 0.000000 ) + a(2) = ( 0.000000 3.000000 0.000000 ) + a(3) = ( 0.000000 0.000000 1.915764 ) + + reciprocal axes: (cart. coord. in units 2 pi/alat) + b(1) = ( 0.333333 0.000000 0.000000 ) + b(2) = ( 0.000000 0.333333 0.000000 ) + b(3) = ( 0.000000 0.000000 0.521985 ) + + + PseudoPot. # 1 for Ti read from file: + ./Ti.pbe.nml + MD5 check sum: 6ed49f7d399b24f59f924a2d8bad0db9 + Pseudo is Norm-conserving, Zval = 12.0 + Generated using "atomic" code by A. Dal Corso (Quantum ESPRESSO distribution) + Using radial grid of 1177 points, 2 beta functions with: + l(1) = 1 + l(2) = 2 + + PseudoPot. # 2 for O read from file: + ./O.pbe.nml + MD5 check sum: 198e56c2ed007f5cae81829e0da21478 + Pseudo is Norm-conserving, Zval = 6.0 + Generated using "atomic" code by A. Dal Corso (Quantum ESPRESSO distribution) + Using radial grid of 1095 points, 1 beta functions with: + l(1) = 0 + + atomic species valence mass pseudopotential + Ti 12.00 47.86700 Ti( 1.00) + O 6.00 15.99940 O( 1.00) + + 8 Sym. Ops., with inversion, found + + + + Cartesian axes + + site n. atom positions (alat units) + 1 Ti tau( 1) = ( 0.0000000 0.0000000 0.0000000 ) + 2 Ti tau( 2) = ( 0.5000000 0.5000000 0.3192940 ) + 3 O tau( 3) = ( 0.3050877 0.3050877 0.0000000 ) + 4 O tau( 4) = ( -0.3050877 -0.3050877 0.0000000 ) + 5 O tau( 5) = ( 0.8050877 0.1949123 0.3192940 ) + 6 O tau( 6) = ( 0.1949123 0.8050877 0.3192940 ) + 7 Ti tau( 7) = ( 0.0000000 0.0000000 0.6385880 ) + 8 Ti tau( 8) = ( 0.5000000 0.5000000 0.9578820 ) + 9 O tau( 9) = ( 0.3050877 0.3050877 0.6385880 ) + 10 O tau( 10) = ( -0.3050877 -0.3050877 0.6385880 ) + 11 O tau( 11) = ( 0.8050877 0.1949123 0.9578820 ) + 12 O tau( 12) = ( 0.1949123 0.8050877 0.9578820 ) + 13 Ti tau( 13) = ( 0.0000000 0.0000000 1.2771760 ) + 14 Ti tau( 14) = ( 0.5000000 0.5000000 1.5964700 ) + 15 O tau( 15) = ( 0.3050877 0.3050877 1.2771760 ) + 16 O tau( 16) = ( -0.3050877 -0.3050877 1.2771760 ) + 17 O tau( 17) = ( 0.8050877 0.1949123 1.5964700 ) + 18 O tau( 18) = ( 0.1949123 0.8050877 1.5964700 ) + 19 Ti tau( 19) = ( 0.0000000 1.0000000 0.0000000 ) + 20 Ti tau( 20) = ( 0.5000000 1.5000000 0.3192940 ) + 21 O tau( 21) = ( 0.3050877 1.3050877 0.0000000 ) + 22 O tau( 22) = ( -0.3050877 0.6949123 0.0000000 ) + 23 O tau( 23) = ( 0.8050877 1.1949123 0.3192940 ) + 24 O tau( 24) = ( 0.1949123 1.8050877 0.3192940 ) + 25 Ti tau( 25) = ( 0.0000000 1.0000000 0.6385880 ) + 26 Ti tau( 26) = ( 0.5000000 1.5000000 0.9578820 ) + 27 O tau( 27) = ( 0.3050877 1.3050877 0.6385880 ) + 28 O tau( 28) = ( -0.3050877 0.6949123 0.6385880 ) + 29 O tau( 29) = ( 0.8050877 1.1949123 0.9578820 ) + 30 O tau( 30) = ( 0.1949123 1.8050877 0.9578820 ) + 31 Ti tau( 31) = ( 0.0000000 1.0000000 1.2771760 ) + 32 Ti tau( 32) = ( 0.5000000 1.5000000 1.5964700 ) + 33 O tau( 33) = ( 0.3050877 1.3050877 1.2771760 ) + 34 O tau( 34) = ( -0.3050877 0.6949123 1.2771760 ) + 35 O tau( 35) = ( 0.8050877 1.1949123 1.5964700 ) + 36 O tau( 36) = ( 0.1949123 1.8050877 1.5964700 ) + 37 Ti tau( 37) = ( 0.0000000 2.0000000 0.0000000 ) + 38 Ti tau( 38) = ( 0.5000000 2.5000000 0.3192940 ) + 39 O tau( 39) = ( 0.3050877 2.3050877 0.0000000 ) + 40 O tau( 40) = ( -0.3050877 1.6949123 0.0000000 ) + 41 O tau( 41) = ( 0.8050877 2.1949123 0.3192940 ) + 42 O tau( 42) = ( 0.1949123 2.8050877 0.3192940 ) + 43 Ti tau( 43) = ( 0.0000000 2.0000000 0.6385880 ) + 44 Ti tau( 44) = ( 0.5000000 2.5000000 0.9578820 ) + 45 O tau( 45) = ( 0.3050877 2.3050877 0.6385880 ) + 46 O tau( 46) = ( -0.3050877 1.6949123 0.6385880 ) + 47 O tau( 47) = ( 0.8050877 2.1949123 0.9578820 ) + 48 O tau( 48) = ( 0.1949123 2.8050877 0.9578820 ) + 49 Ti tau( 49) = ( 0.0000000 2.0000000 1.2771760 ) + 50 Ti tau( 50) = ( 0.5000000 2.5000000 1.5964700 ) + 51 O tau( 51) = ( 0.3050877 2.3050877 1.2771760 ) + 52 O tau( 52) = ( -0.3050877 1.6949123 1.2771760 ) + 53 O tau( 53) = ( 0.8050877 2.1949123 1.5964700 ) + 54 O tau( 54) = ( 0.1949123 2.8050877 1.5964700 ) + 55 Ti tau( 55) = ( 1.0000000 0.0000000 0.0000000 ) + 56 Ti tau( 56) = ( 1.5000000 0.5000000 0.3192940 ) + 57 O tau( 57) = ( 1.3050877 0.3050877 0.0000000 ) + 58 O tau( 58) = ( 0.6949123 -0.3050877 0.0000000 ) + 59 O tau( 59) = ( 1.8050877 0.1949123 0.3192940 ) + 60 O tau( 60) = ( 1.1949123 0.8050877 0.3192940 ) + 61 Ti tau( 61) = ( 1.0000000 0.0000000 0.6385880 ) + 62 Ti tau( 62) = ( 1.5000000 0.5000000 0.9578820 ) + 63 O tau( 63) = ( 1.3050877 0.3050877 0.6385880 ) + 64 O tau( 64) = ( 0.6949123 -0.3050877 0.6385880 ) + 65 O tau( 65) = ( 1.8050877 0.1949123 0.9578820 ) + 66 O tau( 66) = ( 1.1949123 0.8050877 0.9578820 ) + 67 Ti tau( 67) = ( 1.0000000 0.0000000 1.2771760 ) + 68 Ti tau( 68) = ( 1.5000000 0.5000000 1.5964700 ) + 69 O tau( 69) = ( 1.3050877 0.3050877 1.2771760 ) + 70 O tau( 70) = ( 0.6949123 -0.3050877 1.2771760 ) + 71 O tau( 71) = ( 1.8050877 0.1949123 1.5964700 ) + 72 O tau( 72) = ( 1.1949123 0.8050877 1.5964700 ) + 73 Ti tau( 73) = ( 1.0000000 1.0000000 0.0000000 ) + 74 Ti tau( 74) = ( 1.5000000 1.5000000 0.3192940 ) + 75 O tau( 75) = ( 1.3050877 1.3050877 0.0000000 ) + 76 O tau( 76) = ( 0.6949123 0.6949123 0.0000000 ) + 77 O tau( 77) = ( 1.8050877 1.1949123 0.3192940 ) + 78 O tau( 78) = ( 1.1949123 1.8050877 0.3192940 ) + 79 Ti tau( 79) = ( 1.0000000 1.0000000 0.6385880 ) + 80 Ti tau( 80) = ( 1.5000000 1.5000000 0.9578820 ) + 81 O tau( 81) = ( 1.3050877 1.3050877 0.6385880 ) + 82 O tau( 82) = ( 0.6949123 0.6949123 0.6385880 ) + 83 O tau( 83) = ( 1.8050877 1.1949123 0.9578820 ) + 84 O tau( 84) = ( 1.1949123 1.8050877 0.9578820 ) + 85 Ti tau( 85) = ( 1.0000000 1.0000000 1.2771760 ) + 86 Ti tau( 86) = ( 1.5000000 1.5000000 1.5964700 ) + 87 O tau( 87) = ( 1.3050877 1.3050877 1.2771760 ) + 88 O tau( 88) = ( 0.6949123 0.6949123 1.2771760 ) + 89 O tau( 89) = ( 1.8050877 1.1949123 1.5964700 ) + 90 O tau( 90) = ( 1.1949123 1.8050877 1.5964700 ) + 91 Ti tau( 91) = ( 1.0000000 2.0000000 0.0000000 ) + 92 Ti tau( 92) = ( 1.5000000 2.5000000 0.3192940 ) + 93 O tau( 93) = ( 1.3050877 2.3050877 0.0000000 ) + 94 O tau( 94) = ( 0.6949123 1.6949123 0.0000000 ) + 95 O tau( 95) = ( 1.8050877 2.1949123 0.3192940 ) + 96 O tau( 96) = ( 1.1949123 2.8050877 0.3192940 ) + 97 Ti tau( 97) = ( 1.0000000 2.0000000 0.6385880 ) + 98 Ti tau( 98) = ( 1.5000000 2.5000000 0.9578820 ) + 99 O tau( 99) = ( 1.3050877 2.3050877 0.6385880 ) + 100 O tau( 100) = ( 0.6949123 1.6949123 0.6385880 ) + 101 O tau( 101) = ( 1.8050877 2.1949123 0.9578820 ) + 102 O tau( 102) = ( 1.1949123 2.8050877 0.9578820 ) + 103 Ti tau( 103) = ( 1.0000000 2.0000000 1.2771760 ) + 104 Ti tau( 104) = ( 1.5000000 2.5000000 1.5964700 ) + 105 O tau( 105) = ( 1.3050877 2.3050877 1.2771760 ) + 106 O tau( 106) = ( 0.6949123 1.6949123 1.2771760 ) + 107 O tau( 107) = ( 1.8050877 2.1949123 1.5964700 ) + 108 O tau( 108) = ( 1.1949123 2.8050877 1.5964700 ) + 109 Ti tau( 109) = ( 2.0000000 0.0000000 0.0000000 ) + 110 Ti tau( 110) = ( 2.5000000 0.5000000 0.3192940 ) + 111 O tau( 111) = ( 2.3050877 0.3050877 0.0000000 ) + 112 O tau( 112) = ( 1.6949123 -0.3050877 0.0000000 ) + 113 O tau( 113) = ( 2.8050877 0.1949123 0.3192940 ) + 114 O tau( 114) = ( 2.1949123 0.8050877 0.3192940 ) + 115 Ti tau( 115) = ( 2.0000000 0.0000000 0.6385880 ) + 116 Ti tau( 116) = ( 2.5000000 0.5000000 0.9578820 ) + 117 O tau( 117) = ( 2.3050877 0.3050877 0.6385880 ) + 118 O tau( 118) = ( 1.6949123 -0.3050877 0.6385880 ) + 119 O tau( 119) = ( 2.8050877 0.1949123 0.9578820 ) + 120 O tau( 120) = ( 2.1949123 0.8050877 0.9578820 ) + 121 Ti tau( 121) = ( 2.0000000 0.0000000 1.2771760 ) + 122 Ti tau( 122) = ( 2.5000000 0.5000000 1.5964700 ) + 123 O tau( 123) = ( 2.3050877 0.3050877 1.2771760 ) + 124 O tau( 124) = ( 1.6949123 -0.3050877 1.2771760 ) + 125 O tau( 125) = ( 2.8050877 0.1949123 1.5964700 ) + 126 O tau( 126) = ( 2.1949123 0.8050877 1.5964700 ) + 127 Ti tau( 127) = ( 2.0000000 1.0000000 0.0000000 ) + 128 Ti tau( 128) = ( 2.5000000 1.5000000 0.3192940 ) + 129 O tau( 129) = ( 2.3050877 1.3050877 0.0000000 ) + 130 O tau( 130) = ( 1.6949123 0.6949123 0.0000000 ) + 131 O tau( 131) = ( 2.8050877 1.1949123 0.3192940 ) + 132 O tau( 132) = ( 2.1949123 1.8050877 0.3192940 ) + 133 Ti tau( 133) = ( 2.0000000 1.0000000 0.6385880 ) + 134 Ti tau( 134) = ( 2.5000000 1.5000000 0.9578820 ) + 135 O tau( 135) = ( 2.3050877 1.3050877 0.6385880 ) + 136 O tau( 136) = ( 1.6949123 0.6949123 0.6385880 ) + 137 O tau( 137) = ( 2.8050877 1.1949123 0.9578820 ) + 138 O tau( 138) = ( 2.1949123 1.8050877 0.9578820 ) + 139 Ti tau( 139) = ( 2.0000000 1.0000000 1.2771760 ) + 140 Ti tau( 140) = ( 2.5000000 1.5000000 1.5964700 ) + 141 O tau( 141) = ( 2.3050877 1.3050877 1.2771760 ) + 142 O tau( 142) = ( 1.6949123 0.6949123 1.2771760 ) + 143 O tau( 143) = ( 2.8050877 1.1949123 1.5964700 ) + 144 O tau( 144) = ( 2.1949123 1.8050877 1.5964700 ) + 145 Ti tau( 145) = ( 2.0000000 2.0000000 0.0000000 ) + 146 Ti tau( 146) = ( 2.5000000 2.5000000 0.3192940 ) + 147 O tau( 147) = ( 2.3050877 2.3050877 0.0000000 ) + 148 O tau( 148) = ( 1.6949123 1.6949123 0.0000000 ) + 149 O tau( 149) = ( 2.8050877 2.1949123 0.3192940 ) + 150 O tau( 150) = ( 2.1949123 2.8050877 0.3192940 ) + 151 Ti tau( 151) = ( 2.0000000 2.0000000 0.6385880 ) + 152 Ti tau( 152) = ( 2.5000000 2.5000000 0.9578820 ) + 153 O tau( 153) = ( 2.3050877 2.3050877 0.6385880 ) + 154 O tau( 154) = ( 1.6949123 1.6949123 0.6385880 ) + 155 O tau( 155) = ( 2.8050877 2.1949123 0.9578820 ) + 156 O tau( 156) = ( 2.1949123 2.8050877 0.9578820 ) + 157 Ti tau( 157) = ( 2.0000000 2.0000000 1.2771760 ) + 158 Ti tau( 158) = ( 2.5000000 2.5000000 1.5964700 ) + 159 O tau( 159) = ( 2.3050877 2.3050877 1.2771760 ) + 160 O tau( 160) = ( 1.6949123 1.6949123 1.2771760 ) + 161 O tau( 161) = ( 2.8050877 2.1949123 1.5964700 ) + 162 O tau( 162) = ( 2.1949123 2.8050877 1.5964700 ) + + number of k points= 1 + cart. coord. in units 2pi/alat + k( 1) = ( -0.1666667 -0.1666667 -0.2609925), wk = 2.0000000 + + Dense grid: 2063233 G-vectors FFT dimensions: ( 192, 192, 120) + + Largest allocated arrays est. size (Mb) dimensions + Kohn-Sham Wavefunctions 63.82 Mb ( 6454, 648) + NL pseudopotentials 53.18 Mb ( 6454, 540) + Each V/rho on FFT grid 1.69 Mb ( 110592) + Each G-vector array 0.39 Mb ( 51583) + G-vector shells 0.17 Mb ( 22937) + Largest temporary arrays est. size (Mb) dimensions + Auxiliary wavefunctions 255.26 Mb ( 6454, 2592) + Each subspace H/S matrix 6.41 Mb ( 648, 648) + Each matrix 5.34 Mb ( 540, 648) + Arrays for rho mixing 13.50 Mb ( 110592, 8) + + Initial potential from superposition of free atoms + + starting charge 1079.99984, renormalised to 1296.00000 + Starting wfc are 918 atomic wfcs + + total cpu time spent up to now is 39.4 secs + + Self-consistent Calculation + + iteration # 1 ecut= 120.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 1.00E-02, avg # of iterations = 2.0 + + total cpu time spent up to now is 156.9 secs + + total energy = -9738.99021176 Ry + Harris-Foulkes estimate = -9812.90797112 Ry + estimated scf accuracy < 104.84528289 Ry + + End of self-consistent calculation + + convergence NOT achieved after 1 iterations: stopping + + init_run : 36.49s CPU 39.33s WALL ( 1 calls) + electrons : 111.08s CPU 117.48s WALL ( 1 calls) + + Called by init_run: + wfcinit : 33.20s CPU 35.72s WALL ( 1 calls) + potinit : 1.43s CPU 1.51s WALL ( 1 calls) + + Called by electrons: + c_bands : 103.87s CPU 109.29s WALL ( 1 calls) + sum_band : 6.81s CPU 7.70s WALL ( 1 calls) + v_of_rho : 0.64s CPU 0.77s WALL ( 2 calls) + mix_rho : 0.05s CPU 0.06s WALL ( 1 calls) + + Called by c_bands: + init_us_2 : 0.09s CPU 0.11s WALL ( 3 calls) + cegterg : 103.72s CPU 109.14s WALL ( 1 calls) + + Called by *egterg: + h_psi : 71.64s CPU 78.82s WALL ( 4 calls) + g_psi : 0.12s CPU 0.12s WALL ( 2 calls) + cdiaghg : 10.69s CPU 10.83s WALL ( 3 calls) + + Called by h_psi: + add_vuspsi : 8.15s CPU 8.17s WALL ( 4 calls) + + General routines + calbec : 8.21s CPU 8.22s WALL ( 4 calls) + fft : 0.77s CPU 0.97s WALL ( 22 calls) + fftw : 55.31s CPU 63.27s WALL ( 1278 calls) + + Parallel routines + fft_scatter : 21.49s CPU 25.49s WALL ( 1300 calls) + ALLTOALL : 7.81s CPU 8.24s WALL ( 1278 calls) + EXX routines + + MiniDFT : 2m27.63s CPU 2m36.89s WALL + + + This run was terminated on: 11:35:19 25Apr2013 + +=------------------------------------------------------------------------------= + JOB DONE. + Benchmark_Time : 111.08s CPU 117.48s WALL ( 1 calls) +=------------------------------------------------------------------------------= +Warning: ieee_inexact is signaling + 1 +Warning: ieee_inexact is signaling + 1 +Warning: ieee_inexact is signaling + 1 +Warning: ieee_inexact is signaling + 1 +Warning: ieee_inexact is signaling + 1 +Warning: ieee_inexact is signaling + 1 +Warning: ieee_inexact is signaling + 1 +Warning: ieee_inexact is signaling + 1 +Warning: ieee_inexact is signaling + 1 +Warning: ieee_underflow is signaling +Warning: ieee_inexact is signaling + 1 +Warning: ieee_inexact is signaling + 1 +Warning: ieee_inexact is signaling + 1 +Warning: ieee_inexact is signaling + 1 +Warning: ieee_underflow is signaling +Warning: ieee_inexact is signaling + 1 +Warning: ieee_inexact is signaling + 1 +Warning: ieee_inexact is signaling + 1 +Warning: ieee_inexact is signaling + 1 +Warning: ieee_inexact is signaling + 1 +Warning: ieee_inexact is signaling + 1 +Warning: ieee_inexact is signaling + 1 +Warning: ieee_underflow is signaling +Warning: ieee_inexact is signaling + 1 +Warning: ieee_inexact is signaling + 1 +Warning: ieee_inexact is signaling + 1 +Warning: ieee_inexact is signaling + 1 +Warning: ieee_underflow is signaling +Warning: ieee_inexact is signaling + 1 +Warning: ieee_inexact is signaling + 1 +Warning: ieee_underflow is signaling +Warning: ieee_inexact is signaling + 1 +Warning: ieee_inexact is signaling + 1 +Warning: ieee_inexact is signaling + 1 +Warning: ieee_underflow is signaling +Warning: ieee_inexact is signaling + 1 +Warning: ieee_inexact is signaling + 1 +Warning: ieee_inexact is signaling + 1 +Warning: ieee_inexact is signaling + 1 +Warning: ieee_inexact is signaling + 1 +Warning: ieee_inexact is signaling + 1 +Warning: ieee_underflow is signaling +Warning: ieee_inexact is signaling + 1 +Warning: ieee_inexact is signaling + 1 +Warning: ieee_underflow is signaling +Warning: ieee_inexact is signaling + 1 +Warning: ieee_underflow is signaling +Warning: ieee_inexact is signaling + 1 +Warning: ieee_underflow is signaling +Warning: ieee_inexact is signaling + 1 diff --git a/tests/apps/miniDFT/tests/src/.gitignore b/tests/apps/miniDFT/tests/src/.gitignore new file mode 100644 index 0000000000..f110dd210d --- /dev/null +++ b/tests/apps/miniDFT/tests/src/.gitignore @@ -0,0 +1,5 @@ +*~ +*.o +*.mod +mini_dft +mini_dft.* \ No newline at end of file diff --git a/tests/apps/miniDFT/tests/src/MQEoptions.f90 b/tests/apps/miniDFT/tests/src/MQEoptions.f90 new file mode 100644 index 0000000000..e35a6acacf --- /dev/null +++ b/tests/apps/miniDFT/tests/src/MQEoptions.f90 @@ -0,0 +1,67 @@ +#include "config.f" + +module MQEoptions + + type :: MQEoptions_t + character*256 :: infile = ' ' + integer :: npool + integer :: ntg + integer :: ndiag + end type MQEoptions_t + + type( MQEoptions_t ) :: MQEo + +end module MQEoptions + +subroutine MQEoptions_read() + + use MQEoptions, only: MQEo + integer, DECLARE_IARGC :: iargc + + integer :: iarg, narg + character*80 :: arg_i + + !set default options + MQEo%infile = "pw.in" + MQEo%npool = 1 + MQEo%ntg = 1 + MQEo%ndiag = 0 + + iarg = 1 + narg = iargc() + do while( iarg .le. narg ) + + call getarg( iarg, arg_i ) + + select case( arg_i ) + + case("-in") + iarg = iarg + 1 + call getarg( iarg, arg_i ) + read(arg_i,*) MQEo%infile + + case("-npool") + iarg = iarg + 1 + call getarg( iarg, arg_i ) + read(arg_i,*) MQEo%npool + + case("-ntg") + iarg = iarg + 1 + call getarg( iarg, arg_i ) + read(arg_i,*) MQEo%ntg + + case("-ndiag") + iarg = iarg + 1 + call getarg( iarg, arg_i ) + read(arg_i,*) MQEo%ndiag + + case default + write(*,*)"Error: Unrecognized option: ", trim(arg_i) + stop + + end select + + iarg = iarg + 1 + end do + +end subroutine MQEoptions_read diff --git a/tests/apps/miniDFT/tests/src/Makefile.base b/tests/apps/miniDFT/tests/src/Makefile.base new file mode 100644 index 0000000000..4b757a1d84 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/Makefile.base @@ -0,0 +1,224 @@ + +LIBS = $(FFTW_LIBS) $(SCALAPACK_LIBS) $(BLAS_LIBS) + +DFLAGS += -D__FFTW3 -D__MPI -D__SCALAPACK + +CFLAGS += $(DFLAGS) + +FFLAGS += $(FFTW_INCL) $(DFLAGS) + +OBJECTS = \ + kind.o \ + constants.o \ + radial_grids.o \ + atom.o \ + io_global.o \ + parallel_include.o \ + mp.o \ + mp_global.o \ + parser.o \ + parameters.o \ + input_parameters.o \ + io_files.o \ + control_flags.o \ + cell_base.o \ + check_stop.o \ + clocks.o \ + fft_types.o \ + fft_base.o \ + random_numbers.o \ + ions_base.o \ + descriptors.o \ + electrons_base.o \ + version.o \ + environment.o \ + error_handler.o \ + fft_scalar.o \ + fft_custom.o \ + fft_parallel.o \ + fft_interfaces.o \ + wrappers.o \ + recvec.o \ + funct.o \ + griddim.o \ + image_io_routines.o \ + mp_base.o \ + mp_image_global_module.o \ + pseudo_types.o \ + zhpev_drv.o \ + ptoolkit.o \ + read_cards.o \ + read_namelists.o \ + uspp.o \ + upf_nml.o \ + upf.o \ + upf_to_internal.o \ + read_pseudo.o \ + recvec_subs.o \ + run_info.o \ + set_signal.o \ + splinelib.o \ + stick_base.o \ + stick_set.o \ + wavefunctions.o \ + \ + c_mkdir.o \ + cptimer.o \ + customize_signals.o \ + eval_infix.o \ + fft_stick.o \ + md5.o \ + md5_from_file.o \ + memstat.o \ + stack.o \ + \ + atomic_number.o \ + capital.o \ + cryst_to_car.o \ + date_and_tim.o \ + distools.o \ + dylmr2.o \ + erf.o \ + find_free_unit.o \ + flush_unit.o \ + functionals.o \ + inpfile.o \ + int_to_char.o \ + invmat.o \ + latgen.o \ + lsda_functionals.o \ + matches.o \ + recips.o \ + remove_tot_torque.o \ + rgen.o \ + simpsn.o \ + sort.o \ + sph_bes.o \ + trimcheck.o \ + volume.o \ + ylmr2.o \ + \ + pwcom.o \ + symm_base.o \ + start_k.o \ + scf_mod.o \ + a2fmod.o \ + buffers.o \ + input.o \ + becmod.o \ + add_vuspsi.o \ + allocate_fft.o \ + allocate_locpot.o \ + allocate_nlpot.o \ + allocate_wfc.o \ + atomic_rho.o \ + atomic_wfc.o \ + g_psi_mod.o \ + c_bands.o \ + ccgdiagg.o \ + cdiaghg.o \ + cegterg.o \ + symme.o \ + close_files.o \ + coset.o \ + data_structure.o \ + deriv_drhoc.o \ + divide.o \ + divide_et_impera.o \ + drhoc.o \ + dvloc_of_g.o \ + clean_pw.o \ + compute_deff.o \ + newd.o \ + electrons.o \ + eqvect.o \ + ewald.o \ + force_cc.o \ + force_corr.o \ + force_ew.o \ + force_lc.o \ + force_us.o \ + forces.o \ + g2_kin.o \ + g_psi.o \ + gen_us_dj.o \ + gen_us_dy.o \ + gk_sort.o \ + gradcorr.o \ + h_1psi.o \ + h_psi.o \ + hinit0.o \ + init_at_1.o \ + openfil.o \ + init_run.o \ + init_us_1.o \ + init_us_2.o \ + init_vloc.o \ + interpolate.o \ + irrek.o \ + iweights.o \ + kpoint_grid.o \ + lchk_tauxk.o \ + memory_report.o \ + mix_rho.o \ + multable.o \ + n_plane_waves.o \ + para.o \ + potinit.o \ + print_clock_pw.o \ + print_ks_energies.o \ + punch.o \ + read_input.o \ + pwscf.o \ + remove_atomic_rho.o \ + rotate_wfc.o \ + rotate_wfc_k.o \ + s_1psi.o \ + s_psi.o \ + save_in_cbands.o \ + save_in_electrons.o \ + save_in_ions.o \ + set_kup_and_kdw.o \ + set_rhoc.o \ + set_vrs.o \ + setlocal.o \ + setup.o \ + stop_run.o \ + stres_cc.o \ + stres_ewa.o \ + stres_gradcorr.o \ + stres_har.o \ + stres_knl.o \ + stres_loc.o \ + stres_us.o \ + stress.o \ + struct_fact.o \ + sum_band.o \ + summary.o \ + usnldiag.o \ + v_of_rho.o \ + vloc_of_g.o \ + vloc_psi.o \ + weights.o \ + wfcinit.o + + +all: mini_dft $(if $(USE_HPCTK), mini_dft.hpcstruct) + +%.o : %.f90 + $(FC) $(FFLAGS) -c $< + +mini_dft: $(OBJECTS) + $(LD) $(LDFLAGS) -o $@ $(OBJECTS) $(LIBS) $(IPM) + -rm -f mini_dft.hpcstruct + +mini_dft.hpcstruct: mini_dft + hpcstruct $< + +.PHONY = clean +clean: + -rm -f *~ *.o *.mod mini_dft + +.PHONY = tarball +tarball: + tar -czf mini_dft.tar.gz Makefile *.UPF *.UPF.nml *.h *.c *.f *.f90 diff --git a/tests/apps/miniDFT/tests/src/Makefile.carver.pgi b/tests/apps/miniDFT/tests/src/Makefile.carver.pgi new file mode 100644 index 0000000000..39ba080a03 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/Makefile.carver.pgi @@ -0,0 +1,33 @@ +#Uncomment the following line to enable OpenMP +USE_OPENMP = TRUE + +FFTW_INCL = -I/usr/common/usg/fftw/3.2.2/include + FFTW_LIBS = -L/usr/common/usg/fftw/3.2.2/lib -lfftw3_threads -lfftw3 +BLAS_LIBS = +SCALAPACK_LIBS = $(MKL) -L$(MKL_LIBDIR) -lmkl_scalapack_lp64 -lmkl_blacs_openmpi_lp64 + +DFLAGS = -D__PGI + +CC = mpicc +CFLAGS = + +FC = mpif90 +FFLAGS = -fast -Mcache_align -r8 -Mpreprocess + +LD = mpif90 +LDFLAGS = + +ifeq ($(USE_OPENMP), TRUE) + + #note that this overrides the earlier definition of FFTW_LIBS + FFTW_LIBS = -L/opt/fftw/3.3.0.1/x86_64/lib -lfftw3_threads -lfftw3 -lm + FFTW_LIBS = -L/usr/common/usg/fftw/3.2.2/lib -lfftw3_threads -lfftw3 + + DFLAGS += + + FFLAGS += -mp + LDFLAGS += -mp + +endif + +include Makefile.base diff --git a/tests/apps/miniDFT/tests/src/Makefile.hopper.cray b/tests/apps/miniDFT/tests/src/Makefile.hopper.cray new file mode 100644 index 0000000000..49983cf9a8 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/Makefile.hopper.cray @@ -0,0 +1,38 @@ +#Uncomment the following line to enable OpenMP +#USE_OPENMP = TRUE + +FFTW_INCL = -I/opt/fftw/3.3.0.1/x86_64/include +#FFTW_LIBS = -L/opt/fftw/3.3.0.1/x86_64/lib -lfftw3 +FFTW_LIBS = -L/opt/fftw/3.3.0.1/x86_64/lib -lfftw3_threads -lfftw3 -lm +BLAS_LIBS = +SCALAPACK_LIBS = + +DFLAGS = -D__CRAY +#DFLAGS += -D__IPM + +CC = cc +CFLAGS = -O2 + +FC = ftn +FFLAGS = -O2 -e F + +LD = ftn +LDFLAGS = + +ifeq ($(USE_OPENMP), TRUE) + + #note that this overrides the earlier definition of FFTW_LIBS + FFTW_LIBS = -L/opt/fftw/3.3.0.1/x86_64/lib -lfftw3_threads -lfftw3 -lm + + DFLAGS += + + FFLAGS += + LDFLAGS += + +else + + FFLAGS += -h noomp + +endif + +include Makefile.base diff --git a/tests/apps/miniDFT/tests/src/Makefile.hopper.gnu b/tests/apps/miniDFT/tests/src/Makefile.hopper.gnu new file mode 100644 index 0000000000..0ae238f9a5 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/Makefile.hopper.gnu @@ -0,0 +1,33 @@ +#Uncomment the following line to enable OpenMP +#USE_OPENMP = TRUE + +FFTW_INCL = -I/opt/fftw/3.3.0.1/x86_64/include +FFTW_LIBS = -L/opt/fftw/3.3.0.1/x86_64/lib -lfftw3 +BLAS_LIBS = +SCALAPACK_LIBS = + +DFLAGS = -D__GFORTRAN +#DFLAGS += -D__IPM + +CC = cc +CFLAGS = -O3 + +FC = ftn +FFLAGS = -O3 -cpp -x f95-cpp-input + +LD = ftn +LDFLAGS = + +ifeq ($(USE_OPENMP), TRUE) + + #note that this overrides the earlier definition of FFTW_LIBS + FFTW_LIBS = -L/opt/fftw/3.3.0.1/x86_64/lib -lfftw3_threads -lfftw3 -lm + + DFLAGS += + + FFLAGS += -fopenmp + LDFLAGS += -fopenmp + +endif + +include Makefile.base diff --git a/tests/apps/miniDFT/tests/src/Makefile.hopper.hpctk b/tests/apps/miniDFT/tests/src/Makefile.hopper.hpctk new file mode 100644 index 0000000000..f90bdfb939 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/Makefile.hopper.hpctk @@ -0,0 +1,34 @@ +#Uncomment the following line to enable OpenMP +#USE_OPENMP = TRUE +FFTW_INCL = -I/opt/fftw/3.3.0.1/x86_64/include +FFTW_LIBS = -L/opt/fftw/3.3.0.1/x86_64/lib -lfftw3 +BLAS_LIBS = +SCALAPACK_LIBS = + +DFLAGS = -D__PGI +#DFLAGS += -D__IPM +USE_HPCTK = TRUE +DFLAGS += -D__HPCTK + +CC = cc +CFLAGS = + +FC = ftn +FFLAGS = -gopt -fast -Mcache_align -r8 -Mpreprocess + +LD = hpclink ftn +LDFLAGS = + +ifeq ($(USE_OPENMP), TRUE) + + #note that this overrides the earlier definition of FFTW_LIBS + FFTW_LIBS = -L/opt/fftw/3.3.0.1/x86_64/lib -lfftw3_threads -lfftw3 -lm + + DFLAGS += + + FFLAGS += -mp + LDFLAGS += -mp + +endif + +include Makefile.base diff --git a/tests/apps/miniDFT/tests/src/Makefile.hopper.intel b/tests/apps/miniDFT/tests/src/Makefile.hopper.intel new file mode 100644 index 0000000000..b9274bebc4 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/Makefile.hopper.intel @@ -0,0 +1,34 @@ +#Uncomment the following line to enable OpenMP +#USE_OPENMP = TRUE + +FFTW_INCL = -I/opt/fftw/3.3.0.1/x86_64/include +FFTW_LIBS = -L/opt/fftw/3.3.0.1/x86_64/lib -lfftw3 +BLAS_LIBS = +SCALAPACK_LIBS = + +DFLAGS = -D__INTEL +#DFLAGS += -D__IPM + +CC = cc +CFLAGS = -O2 + +FC = ftn +FFLAGS = -fpp -O2 + +LD = ftn +LDFLAGS = + +ifeq ($(USE_OPENMP), TRUE) + + #note that this overrides the earlier definition of FFTW_LIBS + FFTW_LIBS = -L/opt/fftw/3.3.0.1/x86_64/lib -lfftw3_threads -lfftw3 -lm + + #ifort -openmp defines _OPENMP instead of__OPENMP + DFLAGS += -D__OPENMP + + FFLAGS += -openmp + LDFLAGS += -openmp + +endif + +include Makefile.base diff --git a/tests/apps/miniDFT/tests/src/Makefile.hopper.pgi b/tests/apps/miniDFT/tests/src/Makefile.hopper.pgi new file mode 100644 index 0000000000..016f39dfbf --- /dev/null +++ b/tests/apps/miniDFT/tests/src/Makefile.hopper.pgi @@ -0,0 +1,33 @@ +#Uncomment the following line to enable OpenMP +#USE_OPENMP = TRUE + +FFTW_INCL = -I/opt/fftw/3.3.0.1/x86_64/include +FFTW_LIBS = -L/opt/fftw/3.3.0.1/x86_64/lib -lfftw3 +BLAS_LIBS = +SCALAPACK_LIBS = + +DFLAGS = -D__PGI +#DFLAGS += -D__IPM + +CC = cc +CFLAGS = + +FC = ftn +FFLAGS = -fast -Mcache_align -r8 -Mpreprocess + +LD = ftn +LDFLAGS = + +ifeq ($(USE_OPENMP), TRUE) + + #note that this overrides the earlier definition of FFTW_LIBS + FFTW_LIBS = -L/opt/fftw/3.3.0.1/x86_64/lib -lfftw3_threads -lfftw3 -lm + + DFLAGS += + + FFLAGS += -mp + LDFLAGS += -mp + +endif + +include Makefile.base diff --git a/tests/apps/miniDFT/tests/src/Makefile.ohpc b/tests/apps/miniDFT/tests/src/Makefile.ohpc new file mode 100644 index 0000000000..0a0d7169d1 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/Makefile.ohpc @@ -0,0 +1,45 @@ +USE_OPENMP = TRUE + +FFTW_INCL = -I${MKLROOT}/include/fftw + +ifeq ($(LMOD_FAMILY_COMPILER),gnu) + FFTW_LIBS = -L${MKLROOT}/lib/intel64 -lmkl_intel_lp64 -lmkl_gnu_thread -lmkl_core -ldl + CFLAGS = -O3 + DFLAGS = -D__GFORTRAN + FFLAGS = -O3 -cpp -x f95-cpp-input + LDFLAGS = +else + FFTW_LIBS = -mkl + CFLAGS = -O3 + DFLAGS = -D__INTEL + FFLAGS = -fpp -O3 + LDFLAGS = +endif + +ifeq ($(LMOD_FAMILY_MPI),openmpi) + BLAS_LIBS = -lmkl_blacs_openmpi_lp64 +else + BLAS_LIBS = -lmkl_blacs_intelmpi_lp64 +endif + +SCALAPACK_LIBS = -lmkl_scalapack_lp64 + +CC = mpicc +FC = mpif90 +LD = mpif90 + +ifeq ($(USE_OPENMP), TRUE) + FFTW_LIBS += -lpthread -lm + + ifeq ($(LMOD_FAMILY_COMPILER),gnu) + DFLAGS += + FFLAGS += -fopenmp + LDFLAGS += -fopenmp + else + DFLAGS += -D__OPENMP + FFLAGS += -openmp + LDFLAGS += -openmp + endif +endif + +include Makefile.base diff --git a/tests/apps/miniDFT/tests/src/a2fmod.f90 b/tests/apps/miniDFT/tests/src/a2fmod.f90 new file mode 100644 index 0000000000..9b05d5299d --- /dev/null +++ b/tests/apps/miniDFT/tests/src/a2fmod.f90 @@ -0,0 +1,60 @@ +! +! Copyright (C) 2006 Malgorzata Wierbowska and Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +MODULE a2F + ! + ! This module contains a routine saving variables needed for the + ! electron-phonon calculation (new algorithm implemeted by MW) + ! + USE kinds, ONLY : DP + ! + LOGICAL :: la2F = .FALSE. + ! + PRIVATE + PUBLIC :: la2F, a2Fsave + CONTAINS + ! + SUBROUTINE a2Fsave + + USE kinds, ONLY : DP + USE klist, ONLY : nks, nkstot, xk, wk + USE ions_base, ONLY : nat + USE wvfct, ONLY : et, nbnd + USE start_k, ONLY : nk1, nk2, nk3 + USE symm_base, ONLY : s, nsym, irt + USE io_global, ONLY : ionode + USE io_files, ONLY : seqopn + implicit none + ! + INTEGER :: iuna2Fsave = 40, i, j, ik, ns, na + logical :: exst + ! + ! parallel case: only first node writes + IF ( ionode ) THEN + ! + CALL seqopn( iuna2Fsave, 'a2Fsave', 'FORMATTED', exst ) + !=========================================== + ! + WRITE( iuna2Fsave, * ) nbnd, nkstot + WRITE( iuna2Fsave, * ) et + WRITE( iuna2Fsave, * ) ((xk(i,ik), i=1,3), ik=1,nkstot) + WRITE( iuna2Fsave, * ) wk(1:nkstot) + WRITE( iuna2Fsave, * ) nk1, nk2, nk3 + ! + WRITE( iuna2Fsave, * ) nsym + do ns=1,nsym + WRITE( iuna2Fsave, * ) ((s(i,j,ns),j=1,3),i=1,3) + enddo + WRITE( iuna2Fsave, * ) ((irt(ns,na),ns=1,nsym),na=1,nat) + ! + CLOSE( UNIT = iuna2Fsave, STATUS = 'KEEP' ) + ! + END IF + ! + RETURN + END SUBROUTINE a2Fsave + END MODULE a2F diff --git a/tests/apps/miniDFT/tests/src/add_vuspsi.f90 b/tests/apps/miniDFT/tests/src/add_vuspsi.f90 new file mode 100644 index 0000000000..e84e16f56c --- /dev/null +++ b/tests/apps/miniDFT/tests/src/add_vuspsi.f90 @@ -0,0 +1,119 @@ +! +! Copyright (C) 2001-2003 PWSCF group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +!---------------------------------------------------------------------------- +SUBROUTINE add_vuspsi( lda, n, m, hpsi ) + !---------------------------------------------------------------------------- + ! + ! This routine applies the Ultra-Soft Hamiltonian to a + ! vector psi and puts the result in hpsi. + ! Requires the products of psi with all beta functions + ! in array becp(nkb,m) (calculated by calbec) + ! input: + ! lda leading dimension of arrays psi, spsi + ! n true dimension of psi, spsi + ! m number of states psi + ! output: + ! hpsi V_US|psi> is added to hpsi + ! + USE kinds, ONLY: DP + USE ions_base, ONLY: nat, ntyp => nsp, ityp + USE lsda_mod, ONLY: current_spin + USE uspp, ONLY: vkb, nkb, deeq, deeq_nc + USE uspp_param, ONLY: nh + USE becmod, ONLY: bec_type, becp + ! + IMPLICIT NONE + ! + ! ... I/O variables + ! + integer, parameter :: npol=1 !subsitute for noncollin_module%npol + INTEGER, INTENT(IN) :: lda, n, m + COMPLEX(DP), INTENT(INOUT) :: hpsi(lda*npol,m) + ! + ! ... here the local variables + ! + INTEGER :: jkb, ikb, ih, jh, na, nt, ijkb0, ibnd + ! counters + ! + ! + CALL start_clock( 'add_vuspsi' ) + ! + CALL add_vuspsi_k() + ! + CALL stop_clock( 'add_vuspsi' ) + ! + RETURN + ! + CONTAINS + ! + !----------------------------------------------------------------------- + ! + !----------------------------------------------------------------------- + SUBROUTINE add_vuspsi_k() + !----------------------------------------------------------------------- + ! + IMPLICIT NONE + COMPLEX(DP), ALLOCATABLE :: ps (:,:) + INTEGER :: ierr + ! + IF ( nkb == 0 ) RETURN + ! + ALLOCATE (ps (nkb,m), STAT=ierr ) + IF( ierr /= 0 ) & + CALL errore( ' add_vuspsi_k ', ' cannot allocate ps ', ABS( ierr ) ) + ps(:,:) = ( 0.D0, 0.D0 ) + ! + ijkb0 = 0 + ! + DO nt = 1, ntyp + ! + DO na = 1, nat + ! + IF ( ityp(na) == nt ) THEN + ! + DO ibnd = 1, m + ! + DO jh = 1, nh(nt) + ! + jkb = ijkb0 + jh + ! + DO ih = 1, nh(nt) + ! + ikb = ijkb0 + ih + ! + ps(ikb,ibnd) = ps(ikb,ibnd) + & + deeq(ih,jh,na,current_spin) * becp%k(jkb,ibnd) + ! + END DO + ! + END DO + ! + END DO + ! + ijkb0 = ijkb0 + nh(nt) + ! + END IF + ! + END DO + ! + END DO + ! + CALL ZGEMM( 'N', 'N', n, m, nkb, ( 1.D0, 0.D0 ) , vkb, & + lda, ps, nkb, ( 1.D0, 0.D0 ) , hpsi, lda ) + ! + DEALLOCATE (ps) + ! + RETURN + ! + END SUBROUTINE add_vuspsi_k + ! + !----------------------------------------------------------------------- + ! + ! +END SUBROUTINE add_vuspsi diff --git a/tests/apps/miniDFT/tests/src/allocate_fft.f90 b/tests/apps/miniDFT/tests/src/allocate_fft.f90 new file mode 100644 index 0000000000..192cd77928 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/allocate_fft.f90 @@ -0,0 +1,78 @@ +! +! Copyright (C) 2001-2010 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +!----------------------------------------------------------------------- +SUBROUTINE allocate_fft + !----------------------------------------------------------------------- + ! This routine computes the data structure associated to the FFT + ! grid and allocate memory for all the arrays which depend upon + ! these dimensions + ! + USE io_global, ONLY : stdout + USE gvect, ONLY : ngm, g, gg, nl, nlm, mill, igtongl + USE gvecs, ONLY : ngms, nls, nlsm + USE fft_base, ONLY : dfftp, dffts +! DCC +! USE gcoarse, ONLY : nr1c,nr2c,nr3c,nnr,ngmc, nlc, nlcm +! USE ee_mod, ONLY : do_coarse + USE ions_base, ONLY : nat + USE lsda_mod, ONLY : nspin + USE spin_orb, ONLY : domag + USE scf, ONLY : rho, v, vnew, vltot, vrs, rho_core, rhog_core, & + kedtau, create_scf_type + USE wavefunctions_module, ONLY : psic, psic_nc + IMPLICIT NONE + ! + ! determines the data structure for fft arrays + ! + CALL data_structure( .false. ) + ! +! DCC +! IF( do_coarse ) CALL data_structure_coarse( gamma_only, nr1,nr2,nr3, ecutwfc ) + ! + + IF (dfftp%nnr.lt.ngm) THEN + WRITE( stdout, '(/,4x," nr1=",i4," nr2= ", i4, " nr3=",i4, & + &" nrxx = ",i8," ngm=",i8)') dfftp%nr1, dfftp%nr2, dfftp%nr3, dfftp%nnr, ngm + CALL errore ('allocate_fft', 'the nr"s are too small!', 1) + + ENDIF + IF (dffts%nnr.lt.ngms) THEN + WRITE( stdout, '(/,4x," nr1s=",i4," nr2s= ", i4, " nr3s=",i4, & + &" nrxxs = ",i8," ngms=",i8)') dffts%nr1, dffts%nr2, dffts%nr3, dffts%nnr, ngms + CALL errore ('allocate_fft', 'the nrs"s are too small!', 1) + + ENDIF + IF (ngm <= 0) CALL errore ('allocate_fft', 'wrong ngm', 1) + IF (ngms <= 0) CALL errore ('allocate_fft', 'wrong ngms', 1) + IF (dfftp%nnr <= 0) CALL errore ('allocate_fft', 'wrong nnr', 1) + IF (dffts%nnr<= 0) CALL errore ('allocate_fft', 'wrong smooth nnr', 1) + IF (nspin<= 0) CALL errore ('allocate_fft', 'wrong nspin', 1) + ! + ! Allocate memory for all kind of stuff. + ! + CALL create_scf_type(rho) + CALL create_scf_type(v, do_not_allocate_becsum = .true.) + CALL create_scf_type(vnew, do_not_allocate_becsum = .true.) + ALLOCATE (vltot( dfftp%nnr)) + ALLOCATE (rho_core( dfftp%nnr)) + ALLOCATE ( kedtau(1,nspin) ) + ALLOCATE( rhog_core( ngm ) ) + ALLOCATE (psic( dfftp%nnr)) + ALLOCATE (vrs( dfftp%nnr, nspin)) + +! DCC +! IF( do_coarse ) THEN +! ALLOCATE (nlc( ngmc)) +! IF (gamma_only) ALLOCATE (nlcm(ngmc)) +! ENDIF + + + + RETURN +END SUBROUTINE allocate_fft diff --git a/tests/apps/miniDFT/tests/src/allocate_locpot.f90 b/tests/apps/miniDFT/tests/src/allocate_locpot.f90 new file mode 100644 index 0000000000..b887c60376 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/allocate_locpot.f90 @@ -0,0 +1,32 @@ + +! Copyright (C) 2001 PWSCF group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +!----------------------------------------------------------------------- +subroutine allocate_locpot + !----------------------------------------------------------------------- + ! + ! dynamical allocation of arrays: + ! local potential for each kind of atom, structure factor + ! + USE ions_base, ONLY : nat, ntyp => nsp + USE vlocal, ONLY : vloc, strf + USE gvect, ONLY : eigts1, eigts2, eigts3, ngm, ngl + USE fft_base , ONLY : dfftp + ! + implicit none + ! + allocate (vloc( ngl, ntyp)) + allocate (strf( ngm, ntyp)) + + allocate( eigts1(-dfftp%nr1:dfftp%nr1,nat) ) + allocate( eigts2(-dfftp%nr2:dfftp%nr2,nat) ) + allocate( eigts3(-dfftp%nr3:dfftp%nr3,nat) ) + + return +end subroutine allocate_locpot + diff --git a/tests/apps/miniDFT/tests/src/allocate_nlpot.f90 b/tests/apps/miniDFT/tests/src/allocate_nlpot.f90 new file mode 100644 index 0000000000..8b477aa7ec --- /dev/null +++ b/tests/apps/miniDFT/tests/src/allocate_nlpot.f90 @@ -0,0 +1,105 @@ +! +! Copyright (C) 2001-2007 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +!----------------------------------------------------------------------- +subroutine allocate_nlpot + !----------------------------------------------------------------------- + ! + ! This routine computes the dimension of the Hamiltonian matrix and + ! allocates arrays containing the non-local part of the pseudopotential + ! + ! It computes the following global quantities: + ! + ! ngk ! number of plane waves (for each k point) + ! npwx ! maximum number of plane waves + ! nqx ! number of points of the interpolation table + ! nqxq ! as above, for q-function interpolation table + ! + ! + use kinds, only : dp + USE ions_base, ONLY : nat, nsp, ityp + USE cell_base, ONLY : tpiba2 + USE gvect, ONLY : ngm, gcutm, g + USE klist, ONLY : xk, wk, ngk, nks, qnorm + USE lsda_mod, ONLY : nspin + USE scf, ONLY : rho + USE wvfct, ONLY : npwx, npw, igk, g2kin, ecutwfc + USE us, ONLY : qrad, tab, tab_d2y, tab_at, dq, nqx, & + nqxq, spline_ps + USE uspp, ONLY : indv, nhtol, nhtolm, ijtoh, qq, dvan, deeq, vkb, & + nkb, nkbus, nhtoj, becsum, qq_so, dvan_so, deeq_nc + USE uspp_param, ONLY : upf, lmaxq, lmaxkb, nh, nhm, nbetam + USE spin_orb, ONLY : lspinorb, fcoef + USE control_flags, ONLY : program_name + USE io_global, ONLY : stdout + ! + implicit none + real(dp), parameter :: cell_factor=1.0_dp + ! a few local variables + ! + integer :: nwfcm + ! counters on atom type, atoms, beta functions + ! + ! calculate number of PWs for all kpoints + ! + allocate (ngk( nks )) + ! + call n_plane_waves (ecutwfc, tpiba2, nks, xk, g, ngm, npwx, ngk) + ! + ! igk relates the index of PW k+G to index in the list of G vector + ! + allocate (igk( npwx ), g2kin ( npwx ) ) + ! + ! Note: computation of the number of beta functions for + ! each atomic type and the maximum number of beta functions + ! and the number of beta functions of the solid has been + ! moved to init_run.f90 : pre_init() + ! + allocate (indv( nhm, nsp)) + allocate (nhtol(nhm, nsp)) + allocate (nhtolm(nhm, nsp)) + allocate (nhtoj(nhm, nsp)) + allocate (ijtoh(nhm, nhm, nsp)) + allocate (deeq( nhm, nhm, nat, nspin)) + allocate (qq( nhm, nhm, nsp)) + if (lspinorb) then + allocate (qq_so(nhm, nhm, 4, nsp)) + allocate (dvan_so( nhm, nhm, nspin, nsp)) + allocate (fcoef(nhm,nhm,2,2,nsp)) + else + allocate (dvan( nhm, nhm, nsp)) + endif + ! + ! This routine is called also by the phonon code, in which case it should + ! allocate an array that includes q+G vectors up to |q+G|_max <= |Gmax|+|q| + ! + nqxq = INT( ( (sqrt(gcutm) + qnorm ) / dq + 4) * cell_factor ) + lmaxq = 2*lmaxkb+1 + ! + if (lmaxq > 0) allocate (qrad( nqxq, nbetam*(nbetam+1)/2, lmaxq, nsp)) + if (nkb > 0) allocate (vkb( npwx, nkb)) + allocate (becsum( nhm * (nhm + 1)/2, nat, nspin)) + ! + ! Calculate dimensions for array tab (including a possible factor + ! coming from cell contraction during variable cell relaxation/MD) + ! + nqx = INT( (sqrt (ecutwfc) / dq + 4) * cell_factor ) + + allocate (tab( nqx , nbetam , nsp)) + + ! d2y is for the cubic splines + if (spline_ps) then + allocate (tab_d2y( nqx , nbetam , nsp)) + endif + + nwfcm = MAXVAL ( upf(1:nsp)%nwfc ) + allocate (tab_at( nqx , nwfcm , nsp)) + + return +end subroutine allocate_nlpot + diff --git a/tests/apps/miniDFT/tests/src/allocate_wfc.f90 b/tests/apps/miniDFT/tests/src/allocate_wfc.f90 new file mode 100644 index 0000000000..17216d403b --- /dev/null +++ b/tests/apps/miniDFT/tests/src/allocate_wfc.f90 @@ -0,0 +1,29 @@ +! +! Copyright (C) 2001-2008 PWSCF group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +!---------------------------------------------------------------------------- +SUBROUTINE allocate_wfc() + !---------------------------------------------------------------------------- + ! + ! ... dynamical allocation of arrays: wavefunctions + ! ... must be called after allocate_nlpot + ! + USE io_global, ONLY : stdout + USE wvfct, ONLY : npwx, nbnd + USE basis, ONLY : natomwfc + USE fixed_occ, ONLY : one_atom_occupations + USE wavefunctions_module, ONLY : evc + ! + IMPLICIT NONE + ! + ! + ALLOCATE( evc( npwx, nbnd ) ) + ! + RETURN + ! +END subroutine allocate_wfc diff --git a/tests/apps/miniDFT/tests/src/atom.f90 b/tests/apps/miniDFT/tests/src/atom.f90 new file mode 100644 index 0000000000..60f66d0e68 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/atom.f90 @@ -0,0 +1,25 @@ +! +! Copyright (C) 2004-2007 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +!-------------------------------------------------------------------------- +! +MODULE atom + ! + ! ... The variables needed to describe the atoms and related quantities + ! + USE radial_grids, ONLY : radial_grid_type + ! + SAVE + ! + type(radial_grid_type), allocatable, target :: & + rgrid(:) ! the information on atomic radial grids. + ! NB: some of the subsequent data are therefore redundant + ! and will be eliminated in due course asap + INTEGER, ALLOCATABLE :: & + msh(:) ! the point at rcut + ! +END MODULE atom diff --git a/tests/apps/miniDFT/tests/src/atomic_number.f90 b/tests/apps/miniDFT/tests/src/atomic_number.f90 new file mode 100644 index 0000000000..9c14c033e2 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/atomic_number.f90 @@ -0,0 +1,152 @@ +! +! Copyright (C) 2004-2007 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! ------------------------------------------------------------------ +function atomic_number(atm) + ! ------------------------------------------------------------------ + ! + implicit none + character(len=*) :: atm + integer :: atomic_number + + character(len=2) :: elements(103), atom + data elements/' H', 'He', & + 'Li','Be',' B',' C',' N',' O',' F','Ne', & + 'Na','Mg','Al','Si',' P',' S','Cl','Ar', & + ' K','Ca','Sc','Ti',' V','Cr','Mn', & + 'Fe','Co','Ni','Cu','Zn', & + 'Ga','Ge','As','Se','Br','Kr', & + 'Rb','Sr',' Y','Zr','Nb','Mo','Tc', & + 'Ru','Rh','Pd','Ag','Cd', & + 'In','Sn','Sb','Te',' I','Xe', & + 'Cs','Ba','La','Ce','Pr','Nd','Pm','Sm','Eu','Gd', & + 'Tb','Dy','Ho','Er','Tm','Yb','Lu', & + 'Hf','Ta',' W','Re','Os', & + 'Ir','Pt','Au','Hg', & + 'Tl','Pb','Bi','Po','At','Rn', & + 'Fr','Ra','Ac','Th','Pa',' U','Np','Pu', & + 'Am','Cm','Bk','Cf','Es','Fm','Md','No', 'Lr' / + character(len=1), external :: capital, lowercase + logical, external :: isnumeric + integer :: n + + atom=' ' + if ( len(atm) == 1 ) then +! +! Case : atm='X' +! + atom(2:2)=capital(atm(1:1)) + else if ( ( len_trim(atm) == 1 ) .or. ( isnumeric(atm(2:2)) ) .or. & + ( atm(2:2) == '-' ) .or. ( atm(2:2) == '_' ) ) then +! +! Case : atm='X ', 'X_*', 'X-*', 'X[0-9]* ' +! + atom(2:2)=capital(atm(1:1)) + else if (atm(1:1) == ' ') then +! +! Case : atm=' X*' +! + atom(2:2)=capital(atm(2:2)) + else +! +! Case : atm='XY*' +! + atom(1:1)=capital(atm(1:1)) + atom(2:2)=lowercase(atm(2:2)) + end if + + do n=1, 103 + if ( atom == elements(n) ) then + atomic_number=n + return + end if + end do + + atomic_number = 0 + print '(''Atom '',a2,'' not found'')', atom + stop + +end function atomic_number +! ------------------------------------------------------------------ +function atom_name(atomic_number) + ! ------------------------------------------------------------------ + ! + integer :: atomic_number + character(len=2) :: atom_name + + character(len=2) :: elements(103) + data elements/' H', 'He', & + 'Li','Be',' B',' C',' N',' O',' F','Ne', & + 'Na','Mg','Al','Si',' P',' S','Cl','Ar', & + ' K','Ca','Sc','Ti',' V','Cr','Mn', & + 'Fe','Co','Ni','Cu','Zn', & + 'Ga','Ge','As','Se','Br','Kr', & + 'Rb','Sr',' Y','Zr','Nb','Mo','Tc', & + 'Ru','Rh','Pd','Ag','Cd', & + 'In','Sn','Sb','Te',' I','Xe', & + 'Cs','Ba','La','Ce','Pr','Nd','Pm','Sm','Eu','Gd', & + 'Tb','Dy','Ho','Er','Tm','Yb','Lu', & + 'Hf','Ta',' W','Re','Os', & + 'Ir','Pt','Au','Hg', & + 'Tl','Pb','Bi','Po','At','Rn', & + 'Fr','Ra','Ac','Th','Pa',' U','Np','Pu', & + 'Am','Cm','Bk','Cf','Es','Fm','Md','No', 'Lr' / + + if (atomic_number < 1 .or. atomic_number > 103) then + call errore('atom_name','invalid atomic number',1000+atomic_number) + else + atom_name=elements(atomic_number) + end if + return + +end function atom_name + +! ------------------------------------------------------------------ +function atom_weight(atomic_number) + ! ------------------------------------------------------------------ + ! + USE kinds, ONLY : DP + implicit none + integer :: atomic_number + real(DP) :: atom_weight + + real(DP) :: weights(103) + data weights/ 1.00794_DP, 4.00260_DP, & + 6.941_DP,9.01218_DP,10.811_DP,12.0107_DP,14.00674_DP, & + 15.9994_DP,18.99840_DP,20.1797_DP, & + 22.98977_DP,24.3050_DP,26.98154_DP,28.0855_DP,30.97376_DP, & + 32.066_DP,35.4527_DP,39.948_DP, & + 39.0983_DP,40.078_DP,44.95591_DP,47.867_DP,50.9415_DP, & + 51.9961_DP,54.93805_DP, 55.845_DP, & + 58.93320_DP,58.6934_DP,63.546_DP,65.39_DP, & + 69.723_DP,72.61_DP,74.92160_DP,78.96_DP,79.904_DP,83.80_DP, & + 85.4678_DP,87.62_DP,88.90585_DP,91.224_DP,92.90638_DP, & + 95.94_DP,98._DP, & + 101.07_DP,102.90550_DP,106.42_DP,107.8682_DP,112.411_DP, & + 114.818_DP,118.710_DP,121.760_DP,127.60_DP,126.90447_DP, & + 131.29_DP, & + 132.90545_DP,137.327_DP,138.9055_DP,140.116_DP,140.90765_DP, & + 144.24_DP,145._DP,150.36_DP,151.964_DP,157.25_DP, & + 158.92534_DP,162.50_DP,164.93032_DP,167.26_DP, & + 168.93421_DP,173.04_DP,174.967_DP, & + 178.49_DP,180.9479_DP,183.84_DP,186.207_DP,190.23_DP, & + 192.217_DP,195.078_DP,196.96655_DP,200.59_DP, & + 204.3833_DP,207.2_DP,208.98038_DP,209._DP,210._DP,222._DP, & + 223._DP,226._DP,227._DP,232.0381_DP,231.03588_DP, & + 238.0289_DP,237._DP,244._DP, & + 243._DP,247._DP,247._DP,251._DP,252._DP,257._DP, & + 258._DP,259._DP, 262._DP / + + if (atomic_number < 1 .or. atomic_number > 103) then + call errore('atom_name','invalid atomic number',1000+atomic_number) + else + atom_weight=weights(atomic_number) + end if + return + +end function atom_weight +! diff --git a/tests/apps/miniDFT/tests/src/atomic_rho.f90 b/tests/apps/miniDFT/tests/src/atomic_rho.f90 new file mode 100644 index 0000000000..2f9c188451 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/atomic_rho.f90 @@ -0,0 +1,170 @@ +! +! Copyright (C) 2001-2007 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +!----------------------------------------------------------------------- +subroutine atomic_rho (rhoa, nspina) + !----------------------------------------------------------------------- + ! This routine calculates rhoa as the superposition of atomic charges. + ! + ! nspina is the number of spin components to be calculated + ! + ! if nspina = 1 the total atomic charge density is calculated + ! if nspina = 2 the spin up and spin down atomic charge densities are + ! calculated assuming an uniform atomic spin-polarization + ! equal to starting_magnetization(nt) + ! if nspina = 4 noncollinear case. The total density is calculated + ! in the first component and the magnetization vector + ! in the other three. + ! + ! NB: nspina may not be equal to nspin because in some cases (as in update) + ! the total charge only could be needed, even in a LSDA calculation. + ! + ! + USE kinds, ONLY : DP + USE io_global, ONLY : stdout + USE atom, ONLY : rgrid, msh + USE ions_base, ONLY : ntyp => nsp + USE cell_base, ONLY : tpiba, omega + USE gvect, ONLY : ngm, ngl, gstart, nl, nlm, gl, igtongl + USE lsda_mod, ONLY : starting_magnetization, lsda + USE vlocal, ONLY : strf + USE wavefunctions_module, ONLY : psic + USE uspp_param, ONLY : upf + USE mp_global, ONLY : intra_bgrp_comm + USE mp, ONLY : mp_sum + USE fft_base, ONLY : dfftp + USE fft_interfaces, ONLY : invfft + + ! + implicit none + ! + integer :: nspina + ! the number of spin polarizations + real(DP) :: rhoa (dfftp%nnr, nspina) + ! the output atomic charge + ! + ! local variables + ! + real(DP) :: rhoneg, rhoima, gx + real(DP), allocatable :: rhocgnt (:), aux (:) + complex(DP), allocatable :: rhocg (:,:) + integer :: ir, is, ig, igl, nt, ndm + ! + ! superposition of atomic charges contained in the array rho_at + ! (read from pseudopotential files) + ! + ! allocate work space (psic must already be allocated) + ! + allocate (rhocg( ngm, nspina)) + ndm = MAXVAL ( msh(1:ntyp) ) + allocate (aux(ndm)) + allocate (rhocgnt( ngl)) + rhoa(:,:) = 0.d0 + rhocg(:,:) = (0.d0,0.d0) + + do nt = 1, ntyp + ! + ! Here we compute the G=0 term + ! + if (gstart == 2) then + do ir = 1, msh (nt) + aux (ir) = upf(nt)%rho_at (ir) + enddo + call simpson (msh (nt), aux, rgrid(nt)%rab, rhocgnt (1) ) + endif + ! + ! Here we compute the G<>0 term + ! + do igl = gstart, ngl + gx = sqrt (gl (igl) ) * tpiba + do ir = 1, msh (nt) + if (rgrid(nt)%r(ir) < 1.0d-8) then + aux(ir) = upf(nt)%rho_at(ir) + else + aux(ir) = upf(nt)%rho_at(ir) * & + sin(gx*rgrid(nt)%r(ir)) / (rgrid(nt)%r(ir)*gx) + endif + enddo + call simpson (msh (nt), aux, rgrid(nt)%rab, rhocgnt (igl) ) + enddo + ! + ! we compute the 3D atomic charge in reciprocal space + ! + if (nspina == 1) then + do ig = 1, ngm + rhocg(ig,1) = rhocg(ig,1) + & + strf(ig,nt) * rhocgnt(igtongl(ig)) / omega + enddo + else if (nspina == 2) then + do ig = 1, ngm + rhocg(ig,1) = rhocg(ig,1) + & + 0.5d0 * ( 1.d0 + starting_magnetization(nt) ) * & + strf(ig,nt) * rhocgnt(igtongl(ig)) / omega + rhocg(ig,2) = rhocg(ig,2) + & + 0.5d0 * ( 1.d0 - starting_magnetization(nt) ) * & + strf(ig,nt) * rhocgnt(igtongl(ig)) / omega + enddo + endif + enddo + + deallocate (rhocgnt) + deallocate (aux) + + do is = 1, nspina + ! + ! and we return to real space + ! + psic(:) = (0.d0,0.d0) + psic (nl (:) ) = rhocg (:, is) + CALL invfft ('Dense', psic, dfftp) + ! + ! we check that everything is correct + ! + rhoneg = 0.d0 + rhoima = 0.d0 + do ir = 1, dfftp%nnr + rhoneg = rhoneg + MIN (0.d0, DBLE (psic (ir)) ) + rhoima = rhoima + abs (AIMAG (psic (ir) ) ) + enddo + rhoneg = omega * rhoneg / (dfftp%nr1 * dfftp%nr2 * dfftp%nr3) + rhoima = omega * rhoima / (dfftp%nr1 * dfftp%nr2 * dfftp%nr3) + ! + call mp_sum( rhoneg, intra_bgrp_comm ) + call mp_sum( rhoima, intra_bgrp_comm ) + ! + IF ( rhoima > 1.0d-4 ) THEN + WRITE( stdout,'(5x,"Check: imaginary charge or magnetization=",& + & f12.6," (component ",i1,") set to zero")') rhoima, is + END IF + IF ( (is == 1) .OR. lsda ) THEN + ! + IF ( (rhoneg < -1.0d-4) ) THEN + IF ( lsda ) THEN + WRITE( stdout,'(5x,"Check: negative starting charge=", & + &"(component",i1,"):",f12.6)') is, rhoneg + ELSE + WRITE( stdout,'(5x,"Check: negative starting charge=", & + & f12.6)') rhoneg + END IF + END IF + END IF + ! + ! set imaginary terms to zero - negative terms are not set to zero + ! because it is basically useless to do it in real space: negative + ! charge will re-appear when Fourier-transformed back and forth + ! + DO ir = 1, dfftp%nnr + rhoa (ir, is) = DBLE (psic (ir)) + END DO + ! + enddo + + deallocate (rhocg) + return +end subroutine atomic_rho + diff --git a/tests/apps/miniDFT/tests/src/atomic_wfc.f90 b/tests/apps/miniDFT/tests/src/atomic_wfc.f90 new file mode 100644 index 0000000000..a97d6d4dcf --- /dev/null +++ b/tests/apps/miniDFT/tests/src/atomic_wfc.f90 @@ -0,0 +1,165 @@ +! +! Copyright (C) 2001-2007 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +!----------------------------------------------------------------------- +SUBROUTINE atomic_wfc (ik, wfcatom) + !----------------------------------------------------------------------- + ! + ! This routine computes the superposition of atomic wavefunctions + ! for k-point "ik" - output in "wfcatom" + ! + USE kinds, ONLY : DP + USE constants, ONLY : tpi, fpi, pi + USE cell_base, ONLY : omega, tpiba + USE ions_base, ONLY : nat, ntyp => nsp, ityp, tau + USE basis, ONLY : natomwfc + USE gvect, ONLY : mill, eigts1, eigts2, eigts3, g + USE klist, ONLY : xk + USE wvfct, ONLY : npwx, npw, nbnd, igk + USE us, ONLY : tab_at, dq + USE uspp_param, ONLY : upf + USE spin_orb, ONLY : lspinorb, rot_ylm, fcoef, lmaxx, domag, & + starting_spin_angle + ! + implicit none + ! + integer, parameter :: npol=1 !substitute for noncollin_module%npol + integer, intent(in) :: ik + complex(DP), intent(out) :: wfcatom (npwx, npol, natomwfc) + ! + integer :: n_starting_wfc, lmax_wfc, nt, l, nb, na, m, lm, ig, iig, & + i0, i1, i2, i3, nwfcm + real(DP), allocatable :: qg(:), ylm (:,:), chiq (:,:,:), gk (:,:) + complex(DP), allocatable :: sk (:), aux(:) + complex(DP) :: kphase, lphase + real(DP) :: arg, px, ux, vx, wx + + call start_clock ('atomic_wfc') + + ! calculate max angular momentum required in wavefunctions + lmax_wfc = 0 + do nt = 1, ntyp + lmax_wfc = MAX ( lmax_wfc, MAXVAL (upf(nt)%lchi(1:upf(nt)%nwfc) ) ) + enddo + ! + nwfcm = MAXVAL ( upf(1:ntyp)%nwfc ) + ! + allocate ( ylm (npw,(lmax_wfc+1)**2), chiq(npw,nwfcm,ntyp), & + sk(npw), gk(3,npw), qg(npw) ) + ! + do ig = 1, npw + gk (1,ig) = xk(1, ik) + g(1, igk(ig) ) + gk (2,ig) = xk(2, ik) + g(2, igk(ig) ) + gk (3,ig) = xk(3, ik) + g(3, igk(ig) ) + qg(ig) = gk(1, ig)**2 + gk(2, ig)**2 + gk(3, ig)**2 + enddo + ! + ! ylm = spherical harmonics + ! + call ylmr2 ((lmax_wfc+1)**2, npw, gk, qg, ylm) + ! + ! set now q=|k+G| in atomic units + ! + do ig = 1, npw + qg(ig) = sqrt(qg(ig))*tpiba + enddo + ! + n_starting_wfc = 0 + ! + ! chiq = radial fourier transform of atomic orbitals chi + ! + do nt = 1, ntyp + do nb = 1, upf(nt)%nwfc + if ( upf(nt)%oc (nb) >= 0.d0) then + do ig = 1, npw + px = qg (ig) / dq - int (qg (ig) / dq) + ux = 1.d0 - px + vx = 2.d0 - px + wx = 3.d0 - px + i0 = INT( qg (ig) / dq ) + 1 + i1 = i0 + 1 + i2 = i0 + 2 + i3 = i0 + 3 + chiq (ig, nb, nt) = & + tab_at (i0, nb, nt) * ux * vx * wx / 6.d0 + & + tab_at (i1, nb, nt) * px * vx * wx / 2.d0 - & + tab_at (i2, nb, nt) * px * ux * wx / 2.d0 + & + tab_at (i3, nb, nt) * px * ux * vx / 6.d0 + enddo + endif + enddo + enddo + + deallocate (qg, gk) + allocate ( aux(npw) ) + ! + wfcatom(:,:,:) = (0.0_dp, 0.0_dp) + ! + do na = 1, nat + arg = (xk(1,ik)*tau(1,na) + xk(2,ik)*tau(2,na) + xk(3,ik)*tau(3,na)) * tpi + kphase = CMPLX(cos (arg), - sin (arg) ,kind=DP) + ! + ! sk is the structure factor + ! + do ig = 1, npw + iig = igk (ig) + sk (ig) = kphase * eigts1 (mill (1,iig), na) * & + eigts2 (mill (2,iig), na) * & + eigts3 (mill (3,iig), na) + enddo + ! + nt = ityp (na) + do nb = 1, upf(nt)%nwfc + if (upf(nt)%oc(nb) >= 0.d0) then + l = upf(nt)%lchi(nb) + lphase = (0.d0,1.d0)**l + ! + ! the factor i^l MUST BE PRESENT in order to produce + ! wavefunctions for k=0 that are real in real space + ! + ! + call atomic_wfc___ ( ) + ! + ! + END IF + ! + END DO + ! + END DO + + if (n_starting_wfc /= natomwfc) call errore ('atomic_wfc', & + 'internal error: some wfcs were lost ', 1) + + deallocate(aux, sk, chiq, ylm) + + call stop_clock ('atomic_wfc') + return + +CONTAINS + + + SUBROUTINE atomic_wfc___( ) + ! + ! ... LSDA or nonmagnetic case + ! + DO m = 1, 2 * l + 1 + lm = l**2 + m + n_starting_wfc = n_starting_wfc + 1 + if (n_starting_wfc > natomwfc) call errore & + ('atomic_wfc___', 'internal error: too many wfcs', 1) + ! + DO ig = 1, npw + wfcatom (ig, 1, n_starting_wfc) = lphase * & + sk (ig) * ylm (ig, lm) * chiq (ig, nb, nt) + ENDDO + ! + END DO + ! + END SUBROUTINE atomic_wfc___ + ! +END SUBROUTINE atomic_wfc diff --git a/tests/apps/miniDFT/tests/src/becmod.f90 b/tests/apps/miniDFT/tests/src/becmod.f90 new file mode 100644 index 0000000000..54a1c225ab --- /dev/null +++ b/tests/apps/miniDFT/tests/src/becmod.f90 @@ -0,0 +1,372 @@ +! +! Copyright (C) 2001-2007 PWSCF group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +!---------------------------------------------------------------------------- +! +MODULE becmod + ! + ! ... *bec* contain - used in h_psi, s_psi, many other places + ! ... calbec( npw, beta, psi, betapsi [, nbnd ] ) is an interface calculating + ! ... betapsi(i,j) = (the sum is over npw components) + ! ... or betapsi(i,s,j)= (s=polarization index) + ! + USE kinds, ONLY : DP + USE gvect, ONLY : gstart + ! + SAVE + ! +#ifdef __STD_F95 + TYPE bec_type + REAL(DP), POINTER :: r(:,:) ! appropriate for gammaonly + COMPLEX(DP),POINTER :: k(:,:) ! appropriate for generic k + COMPLEX(DP),POINTER :: nc(:,:,:) ! appropriate for noncolin + INTEGER :: comm + INTEGER :: nbnd + INTEGER :: nproc + INTEGER :: mype + INTEGER :: nbnd_loc + INTEGER :: ibnd_begin + END TYPE bec_type +#else + TYPE bec_type + REAL(DP), ALLOCATABLE :: r(:,:) ! appropriate for gammaonly + COMPLEX(DP),ALLOCATABLE :: k(:,:) ! appropriate for generic k + COMPLEX(DP),ALLOCATABLE :: nc(:,:,:) ! appropriate for noncolin + INTEGER :: comm + INTEGER :: nbnd + INTEGER :: nproc + INTEGER :: mype + INTEGER :: nbnd_loc + INTEGER :: ibnd_begin + END TYPE bec_type +#endif + ! + TYPE (bec_type) :: becp ! + + PRIVATE + + REAL(DP), ALLOCATABLE :: & + becp_r(:,:) ! for real (at Gamma) wavefunctions + COMPLEX(DP), ALLOCATABLE :: & + becp_k (:,:), & ! as above for complex wavefunctions + becp_nc(:,:,:) ! as above for spinors + ! + INTERFACE calbec + ! + MODULE PROCEDURE calbec_k, calbec_bec_type + ! + END INTERFACE + + ! + PUBLIC :: bec_type, becp, allocate_bec_type, deallocate_bec_type, calbec, & + beccopy, becscal + ! +CONTAINS + !----------------------------------------------------------------------- + SUBROUTINE calbec_bec_type ( npw, beta, psi, betapsi, nbnd ) + !----------------------------------------------------------------------- + !_ + USE mp_global, ONLY: intra_bgrp_comm + USE mp, ONLY: mp_size, mp_rank, mp_get_comm_null + ! + IMPLICIT NONE + COMPLEX (DP), INTENT (in) :: beta(:,:), psi(:,:) + TYPE (bec_type), INTENT (inout) :: betapsi ! NB: must be INOUT otherwise + ! the allocatd array is lost + INTEGER, INTENT (in) :: npw + INTEGER, OPTIONAL :: nbnd + ! + INTEGER :: local_nbnd + INTEGER, EXTERNAL :: ldim_block, lind_block, gind_block + INTEGER :: nproc, mype, m_loc, m_begin, m_max, ip + INTEGER :: ibnd, ibnd_loc + REAL(DP), ALLOCATABLE :: dtmp(:,:) + ! + IF ( present (nbnd) ) THEN + local_nbnd = nbnd + ELSE + local_nbnd = size ( psi, 2) + ENDIF + + ! + CALL calbec_k ( npw, beta, psi, betapsi%k, local_nbnd ) + ! + ! + RETURN + ! + END SUBROUTINE calbec_bec_type + !----------------------------------------------------------------------- + SUBROUTINE calbec_gamma_nocomm ( npw, beta, psi, betapsi, nbnd ) + !----------------------------------------------------------------------- + USE mp_global, ONLY: intra_bgrp_comm + IMPLICIT NONE + COMPLEX (DP), INTENT (in) :: beta(:,:), psi(:,:) + REAL (DP), INTENT (out) :: betapsi(:,:) + INTEGER, INTENT (in) :: npw + INTEGER, OPTIONAL :: nbnd + INTEGER :: m + IF ( present (nbnd) ) THEN + m = nbnd + ELSE + m = size ( psi, 2) + ENDIF + CALL calbec_gamma ( npw, beta, psi, betapsi, m, intra_bgrp_comm ) + RETURN + ! + END SUBROUTINE calbec_gamma_nocomm + !----------------------------------------------------------------------- + SUBROUTINE calbec_gamma ( npw, beta, psi, betapsi, nbnd, comm ) + !----------------------------------------------------------------------- + ! + ! ... matrix times matrix with summation index (k=1,npw) running on + ! ... half of the G-vectors or PWs - assuming k=0 is the G=0 component: + ! ... betapsi(i,j) = 2Re(\sum_k beta^*(i,k)psi(k,j)) + beta^*(i,0)psi(0,j) + ! + USE mp, ONLY : mp_sum + + IMPLICIT NONE + COMPLEX (DP), INTENT (in) :: beta(:,:), psi(:,:) + REAL (DP), INTENT (out) :: betapsi(:,:) + INTEGER, INTENT (in) :: npw + INTEGER, INTENT (in) :: nbnd + INTEGER, INTENT (in) :: comm + ! + INTEGER :: nkb, npwx, m + ! + m = nbnd + ! + nkb = size (beta, 2) + IF ( nkb == 0 ) RETURN + ! + CALL start_clock( 'calbec' ) + npwx= size (beta, 1) + IF ( npwx /= size (psi, 1) ) CALL errore ('calbec', 'size mismatch', 1) + IF ( npwx < npw ) CALL errore ('calbec', 'size mismatch', 2) +#ifdef DEBUG + WRITE (*,*) 'calbec gamma' + WRITE (*,*) nkb, size (betapsi,1) , m , size (betapsi, 2) +#endif + IF ( nkb /= size (betapsi,1) .or. m > size (betapsi, 2) ) & + CALL errore ('calbec', 'size mismatch', 3) + ! + IF ( m == 1 ) THEN + ! + CALL DGEMV( 'C', 2*npw, nkb, 2.0_DP, beta, 2*npwx, psi, 1, 0.0_DP, & + betapsi, 1 ) + IF ( gstart == 2 ) betapsi(:,1) = betapsi(:,1) - beta(1,:)*psi(1,1) + ! + ELSE + ! + CALL DGEMM( 'C', 'N', nkb, m, 2*npw, 2.0_DP, beta, 2*npwx, psi, & + 2*npwx, 0.0_DP, betapsi, nkb ) + IF ( gstart == 2 ) & + CALL DGER( nkb, m, -1.0_DP, beta, 2*npwx, psi, 2*npwx, betapsi, nkb ) + ! + ENDIF + ! + CALL mp_sum( betapsi( :, 1:m ), comm ) + ! + CALL stop_clock( 'calbec' ) + ! + RETURN + ! + END SUBROUTINE calbec_gamma + ! + !----------------------------------------------------------------------- + SUBROUTINE calbec_k ( npw, beta, psi, betapsi, nbnd ) + !----------------------------------------------------------------------- + ! + ! ... matrix times matrix with summation index (k=1,npw) running on + ! ... G-vectors or PWs : betapsi(i,j) = \sum_k beta^*(i,k) psi(k,j) + ! + USE mp_global, ONLY : intra_bgrp_comm + USE mp, ONLY : mp_sum + + IMPLICIT NONE + COMPLEX (DP), INTENT (in) :: beta(:,:), psi(:,:) + COMPLEX (DP), INTENT (out) :: betapsi(:,:) + INTEGER, INTENT (in) :: npw + INTEGER, OPTIONAL :: nbnd + ! + INTEGER :: nkb, npwx, m + ! + nkb = size (beta, 2) + IF ( nkb == 0 ) RETURN + ! + CALL start_clock( 'calbec' ) + npwx= size (beta, 1) + IF ( npwx /= size (psi, 1) ) CALL errore ('calbec', 'size mismatch', 1) + IF ( npwx < npw ) CALL errore ('calbec', 'size mismatch', 2) + IF ( present (nbnd) ) THEN + m = nbnd + ELSE + m = size ( psi, 2) + ENDIF +#ifdef DEBUG + WRITE (*,*) 'calbec k' + WRITE (*,*) nkb, size (betapsi,1) , m , size (betapsi, 2) +#endif + IF ( nkb /= size (betapsi,1) .or. m > size (betapsi, 2) ) & + CALL errore ('calbec', 'size mismatch', 3) + ! + IF ( m == 1 ) THEN + ! + CALL ZGEMV( 'C', npw, nkb, (1.0_DP,0.0_DP), beta, npwx, psi, 1, & + (0.0_DP, 0.0_DP), betapsi, 1 ) + ! + ELSE + ! + CALL ZGEMM( 'C', 'N', nkb, m, npw, (1.0_DP,0.0_DP), & + beta, npwx, psi, npwx, (0.0_DP,0.0_DP), betapsi, nkb ) + ! + ENDIF + ! + CALL mp_sum( betapsi( :, 1:m ), intra_bgrp_comm ) + ! + CALL stop_clock( 'calbec' ) + ! + RETURN + ! + END SUBROUTINE calbec_k + ! + !----------------------------------------------------------------------- + SUBROUTINE calbec_nc ( npw, beta, psi, betapsi, nbnd ) + !----------------------------------------------------------------------- + ! + ! ... matrix times matrix with summation index (k below) running on + ! ... G-vectors or PWs corresponding to two different polarizations: + ! ... betapsi(i,1,j) = \sum_k=1,npw beta^*(i,k) psi(k,j) + ! ... betapsi(i,2,j) = \sum_k=1,npw beta^*(i,k) psi(k+npwx,j) + ! + USE mp_global, ONLY : intra_bgrp_comm + USE mp, ONLY : mp_sum + + IMPLICIT NONE + COMPLEX (DP), INTENT (in) :: beta(:,:), psi(:,:) + COMPLEX (DP), INTENT (out) :: betapsi(:,:,:) + INTEGER, INTENT (in) :: npw + INTEGER, OPTIONAL :: nbnd + ! + INTEGER :: nkb, npwx, npol, m + ! + nkb = size (beta, 2) + IF ( nkb == 0 ) RETURN + ! + CALL start_clock ('calbec') + npwx= size (beta, 1) + IF ( 2*npwx /= size (psi, 1) ) CALL errore ('calbec', 'size mismatch', 1) + IF ( npwx < npw ) CALL errore ('calbec', 'size mismatch', 2) + IF ( present (nbnd) ) THEN + m = nbnd + ELSE + m = size ( psi, 2) + ENDIF + npol= size (betapsi, 2) +#ifdef DEBUG + WRITE (*,*) 'calbec nc' + WRITE (*,*) nkb, size (betapsi,1) , m , size (betapsi, 3) +#endif + IF ( nkb /= size (betapsi,1) .or. m > size (betapsi, 3) ) & + CALL errore ('calbec', 'size mismatch', 3) + ! + CALL ZGEMM ('C', 'N', nkb, m*npol, npw, (1.0_DP, 0.0_DP), beta, & + npwx, psi, npwx, (0.0_DP, 0.0_DP), betapsi, nkb) + ! + CALL mp_sum( betapsi( :, :, 1:m ), intra_bgrp_comm ) + ! + CALL stop_clock( 'calbec' ) + ! + RETURN + ! + END SUBROUTINE calbec_nc + ! + !----------------------------------------------------------------------- + SUBROUTINE allocate_bec_type ( nkb, nbnd, bec, comm ) + !----------------------------------------------------------------------- + USE mp, ONLY: mp_size, mp_rank, mp_get_comm_null + IMPLICIT NONE + TYPE (bec_type) :: bec + INTEGER, INTENT (in) :: nkb, nbnd + INTEGER, INTENT (in), OPTIONAL :: comm + INTEGER :: ierr, nbnd_siz + INTEGER, EXTERNAL :: ldim_block, lind_block, gind_block + ! +#ifdef __STD_F95 + NULLIFY(bec%r) + NULLIFY(bec%nc) + NULLIFY(bec%k) +#endif + ! + nbnd_siz = nbnd + bec%comm = mp_get_comm_null() + bec%nbnd = nbnd + bec%mype = 0 + bec%nproc = 1 + bec%nbnd_loc = nbnd + bec%ibnd_begin = 1 + ! + ! + ALLOCATE( bec%k( nkb, nbnd_siz ), STAT=ierr ) + IF( ierr /= 0 ) & + CALL errore( ' allocate_bec_type ', ' cannot allocate bec%k ', ABS(ierr) ) + ! + bec%k(:,:)=(0.0D0,0.0D0) + ! + ! + RETURN + ! + END SUBROUTINE allocate_bec_type + ! + !----------------------------------------------------------------------- + SUBROUTINE deallocate_bec_type (bec) + !----------------------------------------------------------------------- + ! + USE mp, ONLY: mp_get_comm_null + IMPLICIT NONE + TYPE (bec_type) :: bec + ! + bec%comm = mp_get_comm_null() + bec%nbnd = 0 + ! +#ifdef __STD_F95 + IF (associated(bec%r)) DEALLOCATE(bec%r) + IF (associated(bec%nc)) DEALLOCATE(bec%nc) + IF (associated(bec%k)) DEALLOCATE(bec%k) +#else + IF (allocated(bec%r)) DEALLOCATE(bec%r) + IF (allocated(bec%nc)) DEALLOCATE(bec%nc) + IF (allocated(bec%k)) DEALLOCATE(bec%k) +#endif + ! + RETURN + ! + END SUBROUTINE deallocate_bec_type + + SUBROUTINE beccopy(bec, bec1, nkb, nbnd) + IMPLICIT NONE + TYPE(bec_type), INTENT(in) :: bec + TYPE(bec_type) :: bec1 + INTEGER, INTENT(in) :: nkb, nbnd + + CALL zcopy(nkb*nbnd, bec%k, 1, bec1%k, 1) + + RETURN + END SUBROUTINE beccopy + + SUBROUTINE becscal_nck(alpha, bec, nkb, nbnd) + IMPLICIT NONE + TYPE(bec_type), INTENT(INOUT) :: bec + COMPLEX(DP), INTENT(IN) :: alpha + INTEGER, INTENT(IN) :: nkb, nbnd + + CALL zscal(nkb*nbnd, alpha, bec%k, 1) + + RETURN + END SUBROUTINE becscal_nck + + +END MODULE becmod diff --git a/tests/apps/miniDFT/tests/src/buffers.f90 b/tests/apps/miniDFT/tests/src/buffers.f90 new file mode 100644 index 0000000000..67b2bf855b --- /dev/null +++ b/tests/apps/miniDFT/tests/src/buffers.f90 @@ -0,0 +1,272 @@ +! +! Copyright (C) 2007 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +!---------------------------------------------------------------------------- +MODULE buffers + !---------------------------------------------------------------------------- + ! + USE kinds, ONLY : DP + ! + PRIVATE + PUBLIC :: open_buffer, init_buffer, get_buffer, save_buffer, close_buffer + ! + SAVE + ! + ! ... global variables + ! + COMPLEX(DP), ALLOCATABLE :: buffer1(:,:) + INTEGER :: nword_ + CHARACTER(LEN=80) :: extension_ + ! + INTEGER, EXTERNAL :: find_free_unit + ! + CONTAINS + !----------------------------------------------------------------------- + SUBROUTINE open_buffer (unit, extension, nword, maxrec, exst) + !----------------------------------------------------------------------- + ! + ! unit > 6 : connect unit "unit" to a file "prefix"."extension" in + ! tmp_dir for direct I/O access, record length nword complex numbers; + ! maxrec is ignored, exst=T(F) if the file (does not) exists + ! + ! unit =-1 : allocate a buffer for storing up to maxrec records + ! of length nword complex numbers; extension is saved but ignored + ! exst=T(F) if the buffer is already allocated + ! + USE io_files, ONLY : diropn + ! + IMPLICIT NONE + ! + CHARACTER(LEN=*), INTENT(IN) :: extension + INTEGER, INTENT(IN) :: unit, nword, maxrec + LOGICAL, INTENT(OUT) :: exst + ! + INTEGER :: ierr + ! + exst = .FALSE. + IF ( unit == -1 ) THEN + ! + exst = ALLOCATED ( buffer1 ) + ! + IF ( exst ) THEN + ! + CALL infomsg ('open_buffer', 'buffer already allocated') + ! + ELSE + ! + nword_ = nword + extension_ = extension + ALLOCATE ( buffer1 ( nword, maxrec ) ) + ! + END IF + ! + ELSE IF ( unit > 6 ) THEN + ! + CALL diropn (unit, extension, 2*nword, exst) + ! + ELSE + ! + CALL errore ('open_buffer', 'incorrect unit specified', ABS(unit)) + ! + END IF + ! + RETURN + ! +END SUBROUTINE open_buffer +! +!---------------------------------------------------------------------------- +SUBROUTINE save_buffer( vect, nword, unit, nrec ) + !---------------------------------------------------------------------------- + ! + ! ... copy vect(1:nword) into the "nrec"-th record of + ! ... - a previously allocated buffer, if unit = -1 + ! ... - a previously opened direct-access file with unit > 6 + ! + IMPLICIT NONE + ! + INTEGER, INTENT(IN) :: nword, unit, nrec + COMPLEX(DP), INTENT(IN) :: vect(nword) + ! + IF ( unit == -1 ) THEN + ! + IF ( ALLOCATED ( buffer1 ) ) THEN + ! + IF ( nrec > SIZE ( buffer1, 2) ) & + CALL errore ('save_buffer', 'too many records', ABS(nrec)) + ! + IF ( nword /= SIZE ( buffer1, 1) ) & + CALL errore ('save_buffer', 'record length mismatch', ABS(nword)) + ! + buffer1(:,nrec) = vect(:) + ! + ELSE + ! + CALL errore ('save_buffer', 'buffer not allocated', ABS(unit)) + ! + END IF + ! + ELSE IF ( unit > 6 ) THEN + ! + CALL davcio ( vect, 2*nword, unit, nrec, +1 ) + ! + ELSE + ! + CALL errore ('save_buffer', 'incorrect unit specified', ABS(unit)) + ! + END IF + ! + RETURN + ! +END SUBROUTINE save_buffer +! +!---------------------------------------------------------------------------- +SUBROUTINE get_buffer( vect, nword, unit, nrec ) + !---------------------------------------------------------------------------- + ! + ! ... copy vect(1:nword) from the "nrec"-th record of + ! ... - a previously allocated buffer, if unit = -1 + ! ... - a previously opened direct-access file with unit > 6 + ! + IMPLICIT NONE + ! + INTEGER, INTENT(IN) :: nword, unit, nrec + COMPLEX(DP), INTENT(OUT) :: vect(nword) + ! + IF ( unit == -1 ) THEN + ! + IF ( ALLOCATED ( buffer1 ) ) THEN + ! + IF ( nrec > SIZE ( buffer1, 2) ) & + CALL errore ('get_buffer', 'no such record', ABS(nrec)) + ! + IF ( nword /= SIZE ( buffer1, 1) ) & + CALL errore ('get_buffer', 'record length mismatch', ABS(nword)) + ! + vect(:) = buffer1(:,nrec) + ! + ELSE + ! + CALL errore ('get_buffer', 'buffer not allocated', ABS(unit)) + ! + END IF + ! + ELSE IF ( unit > 6 ) THEN + ! + CALL davcio ( vect, 2*nword, unit, nrec, -1 ) + ! + ELSE + ! + CALL errore ('get_buffer', 'incorrect unit specified', ABS(unit)) + ! + END IF + ! + RETURN + ! +END SUBROUTINE get_buffer +! +SUBROUTINE close_buffer ( unit, status ) + ! + ! unit > 6 : close unit with status "status" ('keep' or 'delete') + ! unit =-1 : deallocate buffer; if "status='keep'" save to file + ! (using saved value of extension) + ! + USE io_files, ONLY : diropn + ! + IMPLICIT NONE + ! + INTEGER, INTENT(IN) :: unit + CHARACTER(LEN=*), INTENT(IN) :: status + ! + INTEGER :: unit_, i + LOGICAL :: exst, opnd + ! + IF ( unit == -1 ) THEN + ! + IF ( ALLOCATED ( buffer1 ) ) THEN + ! + IF ( TRIM(status) == 'KEEP' .OR. TRIM(status) == 'keep') THEN + ! + unit_ = find_free_unit () + CALL diropn (unit_, extension_, 2*nword_, exst) + DO i = 1, SIZE (buffer1, 2) + CALL davcio ( buffer1(1,i), 2*nword_, unit_, i, +1 ) + END DO + CLOSE( UNIT = unit_, STATUS = status ) + ! + END IF + ! + DEALLOCATE (buffer1) + ! + ELSE + ! + CALL infomsg ('close_buffer', 'buffer not allocated') + ! + END IF + ! + ELSE IF ( unit > 6 ) THEN + ! + INQUIRE( UNIT = unit, OPENED = opnd ) + ! + IF ( opnd ) CLOSE( UNIT = unit, STATUS = status ) + ! + ELSE + ! + CALL infomsg ('get_buffer', 'incorrect unit specified') + ! + END IF + ! +END SUBROUTINE close_buffer +! +SUBROUTINE init_buffer ( unit, exst, ierr ) + ! + ! unit > 6 : ignored + ! unit =-1 : read into buffer the array previously saved to file + ! when the buffer was closed (used in NEB calculations) + ! exst : T if the file where to read from is present + ! ierr : 0 if everything ok, 1 otherwise + ! + USE io_files, ONLY : diropn + ! + IMPLICIT NONE + ! + INTEGER, INTENT(IN) :: unit + INTEGER, INTENT(OUT) :: ierr + LOGICAL, INTENT(OUT) :: exst + ! + INTEGER :: unit_, i + ! + ierr = 1 + ! + IF ( unit == -1 ) THEN + ! + IF ( .NOT. ALLOCATED ( buffer1 ) ) THEN + CALL infomsg ('init_buffer', 'buffer not allocated') + RETURN + END IF + ! + unit_ = find_free_unit () + CALL diropn (unit_, extension_, 2*nword_, exst) + IF ( .NOT. exst ) THEN + CLOSE (UNIT = unit_ , STATUS = 'delete') + RETURN + END IF + ! + DO i = 1, SIZE (buffer1, 2) + CALL davcio ( buffer1(1,i), 2*nword_, unit_, i, -1 ) + END DO + CLOSE( UNIT = unit_, STATUS = 'keep' ) + ierr = 0 + ! + ELSE + ! + CALL infomsg ('init_buffer', 'incorrect unit specified') + ! + END IF + ! +END SUBROUTINE init_buffer +! +END MODULE buffers diff --git a/tests/apps/miniDFT/tests/src/c_bands.f90 b/tests/apps/miniDFT/tests/src/c_bands.f90 new file mode 100644 index 0000000000..19d7b18fcd --- /dev/null +++ b/tests/apps/miniDFT/tests/src/c_bands.f90 @@ -0,0 +1,376 @@ + +! Copyright (C) 2001-2011 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +!---------------------------------------------------------------------------- +SUBROUTINE c_bands( iter, ik_, dr2 ) + !---------------------------------------------------------------------------- + ! + ! ... Driver routine for Hamiltonian diagonalization routines + ! ... It reads the Hamiltonian and an initial guess of the wavefunctions + ! ... from a file and computes initialization quantities for the + ! ... diagonalization routines. + ! + USE kinds, ONLY : DP + USE io_global, ONLY : stdout + USE io_files, ONLY : iunigk, nwordatwfc, iunsat, iunwfc, & + nwordwfc + USE buffers, ONLY : get_buffer, save_buffer + USE klist, ONLY : nkstot, nks, xk, ngk + USE uspp, ONLY : vkb, nkb + USE gvect, ONLY : g + USE wvfct, ONLY : et, nbnd, npwx, igk, npw, current_k + USE control_flags, ONLY : ethr, isolve, io_level + USE lsda_mod, ONLY : current_spin, lsda, isk + USE wavefunctions_module, ONLY : evc + USE mp_global, ONLY : inter_pool_comm + USE mp, ONLY : mp_sum + ! + IMPLICIT NONE + ! + ! ... First the I/O variables + ! + INTEGER :: ik_, iter + ! k-point already done + ! current iterations + REAL(DP),INTENT(IN) :: dr2 + ! current accuracy of self-consistency + ! + ! ... local variables + ! + REAL(DP) :: avg_iter + ! average number of H*psi products + INTEGER :: ik + ! counter on k points + ! + IF ( ik_ == nks ) THEN + ! + ik_ = 0 + ! + RETURN + ! + END IF + ! + CALL start_clock( 'c_bands' ) + ! + IF ( isolve == 0 ) THEN + ! + WRITE( stdout, '(5X,"Davidson diagonalization with overlap")' ) + ! + ELSE IF ( isolve == 1 ) THEN + ! + WRITE( stdout, '(5X,"CG style diagonalization")') + ! + ELSE + ! + CALL errore ( 'c_bands', 'invalid type of diagonalization', isolve) + !!! WRITE( stdout, '(5X,"DIIS style diagonalization")') + ! + END IF + ! + avg_iter = 0.D0 + ! +#ifdef __IGKIO + if ( nks > 1 ) REWIND( iunigk ) !BMA: eliminate fs activity for miniDFT +#endif + ! + ! ... For each k point diagonalizes the hamiltonian + ! + k_loop: DO ik = 1, nks + ! + current_k = ik + ! + IF ( lsda ) current_spin = isk(ik) + ! + ! ... Reads the list of indices k+G <-> G of this k point + ! +#ifdef __IGKIO + IF ( nks > 1 ) READ( iunigk ) igk !BMA: eliminate fs activity for miniDFT +#endif + ! + npw = ngk(ik) + ! + ! ... do not recalculate k-points if restored from a previous run + ! + IF ( ik <= ik_ ) THEN + ! + CYCLE k_loop + ! + END IF + ! + ! ... various initializations + ! + IF ( nkb > 0 ) CALL init_us_2( npw, igk, xk(1,ik), vkb ) + ! + ! ... kinetic energy + ! + call g2_kin( ik ) + ! + ! ... read in wavefunctions from the previous iteration + ! +#ifdef __IGKIO + IF ( nks > 1 .OR. (io_level > 1) ) & + CALL get_buffer ( evc, nwordwfc, iunwfc, ik ) +#endif + ! ... Needed for LDA+U + ! + ! + ! ... diagonalization of bands for k-point ik + ! + call diag_bands ( iter, ik, avg_iter ) + ! + ! ... save wave-functions to be used as input for the + ! ... iterative diagonalization of the next scf iteration + ! ... and for rho calculation + ! +#ifdef __IGKIO + IF ( nks > 1 .OR. (io_level > 1) ) & + CALL save_buffer ( evc, nwordwfc, iunwfc, ik ) +#endif + ! ... save restart information + ! + IF ( io_level > 1 ) CALL save_in_cbands( iter, ik, dr2 ) + ! + END DO k_loop + ! + ik_ = 0 + ! + CALL mp_sum( avg_iter, inter_pool_comm ) + ! + avg_iter = avg_iter / nkstot + ! + WRITE( stdout, & + '( 5X,"ethr = ",1PE9.2,", avg # of iterations =",0PF5.1 )' ) & + ethr, avg_iter + ! + CALL stop_clock( 'c_bands' ) + ! + RETURN + ! +END SUBROUTINE c_bands +! +!---------------------------------------------------------------------------- +SUBROUTINE diag_bands( iter, ik, avg_iter ) + !---------------------------------------------------------------------------- + ! + ! ... Driver routine for diagonalization at each k-point + ! ... Two types of iterative diagonalizations are currently used: + ! ... a) Davidson algorithm (all-band) + ! ... b) Conjugate Gradient (band-by-band) + ! ... + ! ... internal procedures : + ! + ! ... c_bands_gamma() : optimized algorithms for gamma sampling of the BZ + ! ... (real Hamiltonian) + ! ... c_bands_k() : general algorithm for arbitrary BZ sampling + ! ... (complex Hamiltonian) + ! ... test_exit_cond() : the test on the iterative diagonalization + ! + ! + USE kinds, ONLY : DP + USE io_global, ONLY : stdout + USE io_files, ONLY : nwordwfc, iunefieldp, iunefieldm + USE uspp, ONLY : vkb, nkb, okvan + USE gvect, ONLY : gstart + USE wvfct, ONLY : g2kin, nbndx, et, nbnd, npwx, npw, & + current_k, btype + USE control_flags, ONLY : ethr, lscf, max_cg_iter, isolve, istep + USE wavefunctions_module, ONLY : evc + USE g_psi_mod, ONLY : h_diag, s_diag + USE scf, ONLY : v_of_0 + USE becmod, ONLY : bec_type, becp, calbec, & + allocate_bec_type, deallocate_bec_type + USE klist, ONLY : nks + USE mp_global, ONLY : nproc_bgrp, intra_bgrp_comm + ! + IMPLICIT NONE + ! + integer, parameter :: npol=1 !substitute for noncollin_module%npol + INTEGER, INTENT(IN) :: iter, ik + ! + REAL (KIND=DP), INTENT(INOUT) :: avg_iter + ! + REAL (KIND=DP) :: cg_iter + ! (weighted) number of iterations in Conjugate-Gradient + INTEGER :: ig, dav_iter, ntry, notconv + ! number of iterations in Davidson + ! number or repeated call to diagonalization in case of non convergence + ! number of notconverged elements + INTEGER :: ierr + ! + LOGICAL :: lrot + ! .TRUE. if the wfc have already be rotated + ! + ALLOCATE( h_diag( npwx, npol ), STAT=ierr ) + IF( ierr /= 0 ) & + CALL errore( ' diag_bands ', ' cannot allocate h_diag ', ABS(ierr) ) + ! + ALLOCATE( s_diag( npwx, npol ), STAT=ierr ) + IF( ierr /= 0 ) & + CALL errore( ' diag_bands ', ' cannot allocate s_diag ', ABS(ierr) ) + ! + ! ... allocate space for - used in h_psi and s_psi + ! + IF ( nbndx > npwx*nproc_bgrp ) & + CALL errore ( 'diag_bands', 'too many bands, or too few plane waves',1) + ! + CALL allocate_bec_type ( nkb, nbnd, becp, intra_bgrp_comm ) + ! + ! + CALL c_bands_k() + ! + ! + ! ... deallocate work space + ! + CALL deallocate_bec_type ( becp ) + DEALLOCATE( s_diag ) + DEALLOCATE( h_diag ) + ! + IF ( notconv > MAX( 5, nbnd / 4 ) ) THEN + ! + CALL errore( 'c_bands', & + & 'too many bands are not converged', 1 ) + ! + ELSE IF ( notconv > 0 ) THEN + ! + WRITE( stdout, '(5X,"c_bands: ",I2, & + & " eigenvalues not converged")' ) notconv + ! + END IF + ! + RETURN + ! +CONTAINS + ! + ! ... internal procedures + ! + !----------------------------------------------------------------------- + ! + !----------------------------------------------------------------------- + SUBROUTINE c_bands_k() + !----------------------------------------------------------------------- + ! + ! ... Complex Hamiltonian diagonalization + ! + IMPLICIT NONE + ! + ! ... here the local variables + ! + INTEGER :: ipol, ierr + ! + ! + IF ( isolve == 1 ) THEN + ! + ! ... Conjugate-Gradient diagonalization + ! + ! ... h_diag is the precondition matrix + ! + h_diag = 1.D0 + ! + FORALL( ig = 1 : npwx ) + ! + h_diag(ig,:) = 1.D0 + g2kin(ig) + & + SQRT( 1.D0 + ( g2kin(ig) - 1.D0 )**2 ) + ! + END FORALL + ! + ntry = 0 + ! + CG_loop : DO + ! + lrot = ( iter == 1 .AND. istep ==0 .AND. ntry == 0 ) + ! + IF ( .NOT. lrot ) THEN + ! + CALL rotate_wfc ( npwx, npw, nbnd, gstart, nbnd, & + evc, npol, okvan, evc, et(1,ik) ) + ! + avg_iter = avg_iter + 1.D0 + ! + END IF + ! + CALL ccgdiagg( npwx, npw, nbnd, npol, evc, et(1,ik), btype(1,ik), & + h_diag, ethr, max_cg_iter, .NOT. lscf, notconv, cg_iter ) + ! + avg_iter = avg_iter + cg_iter + ! + ntry = ntry + 1 + ! + ! ... exit condition + ! + IF ( test_exit_cond() ) EXIT CG_loop + ! + END DO CG_loop + ! + ELSE + ! + ! ... Davidson diagonalization + ! + ! ... h_diag are the diagonal matrix elements of the + ! ... hamiltonian used in g_psi to evaluate the correction + ! ... to the trial eigenvectors + ! + DO ipol = 1, npol + ! + h_diag(1:npw, ipol) = g2kin(1:npw) + v_of_0 + ! + END DO + ! + CALL usnldiag( h_diag, s_diag ) + ! + ntry = 0 + ! + david_loop: DO + ! + lrot = ( iter == 1 ) + ! + ! + CALL pcegterg( npw, npwx, nbnd, nbndx, npol, evc, ethr, & + okvan, et(1,ik), btype(1,ik), & + notconv, lrot, dav_iter ) + ! + avg_iter = avg_iter + dav_iter + ! + ! ... save wave-functions to be used as input for the + ! ... iterative diagonalization of the next scf iteration + ! ... and for rho calculation + ! + ntry = ntry + 1 + ! + ! ... exit condition + ! + IF ( test_exit_cond() ) EXIT david_loop + ! + END DO david_loop + ! + END IF + ! + ! + RETURN + ! + END SUBROUTINE c_bands_k + ! + !----------------------------------------------------------------------- + FUNCTION test_exit_cond() + !----------------------------------------------------------------------- + ! + ! ... this logical function is .TRUE. when iterative diagonalization + ! ... is converged + ! + IMPLICIT NONE + ! + LOGICAL :: test_exit_cond + ! + ! + test_exit_cond = .NOT. ( ( ntry <= 5 ) .AND. & + ( ( .NOT. lscf .AND. ( notconv > 0 ) ) .OR. & + ( lscf .AND. ( notconv > 5 ) ) ) ) + ! + END FUNCTION test_exit_cond + ! +END SUBROUTINE diag_bands +! diff --git a/tests/apps/miniDFT/tests/src/c_defs.h b/tests/apps/miniDFT/tests/src/c_defs.h new file mode 100644 index 0000000000..8159f7cd34 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/c_defs.h @@ -0,0 +1,22 @@ +/* include/c_defs.h. Generated from c_defs.h.in by configure. */ +/* +Copyright (C) 2006 Quantum-ESPRESSO group +This file is distributed under the terms of the +GNU General Public License. See the file `License' +in the root directory of the present distribution, +or http://www.gnu.org/copyleft/gpl.txt . +*/ + +/* File c_defs.h.in is used by configure to generate c_defs.h + Variables that configure defines should be #undef-ined in + include/c_defs.h.in !!! */ + +/* fortran-to-C naming convention, for functions with and without + underscores in the name (some compilers treat them differently) */ + +#define F77_FUNC(name,NAME) name ## _ +#define F77_FUNC_(name,NAME) name ## _ + +/* do we have the mallinfo structure (see clib/memstat.c) ? */ + +/* #undef HAVE_MALLINFO */ diff --git a/tests/apps/miniDFT/tests/src/c_mkdir.c b/tests/apps/miniDFT/tests/src/c_mkdir.c new file mode 100644 index 0000000000..9ba52b47d0 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/c_mkdir.c @@ -0,0 +1,175 @@ +/* + Copyright (C) 2003-2007 Quantum ESPRESSO group + This file is distributed under the terms of the + GNU General Public License. See the file `License' + in the root directory of the present distribution, + or http://www.gnu.org/copyleft/gpl.txt . +*/ + +#include +#include +#include +#include +#include +#include +#include +#include "c_defs.h" + +static void fatal ( const char * msg ) +{ + + fprintf( stderr , "fatal: %s" , *msg ? msg : "Oops!" ) ; + exit( -1 ) ; + +} /* fatal */ + + +static void * xcmalloc ( size_t size ) +{ + + register void * ptr = malloc( size ) ; + + if ( ptr == NULL ) + fatal( "c_mkdir: virtual memory exhausted" ) ; + else + memset( ptr , 0 , size ) ; + + return ptr ; + +} /* xcmalloc */ + + +int F77_FUNC_(c_mkdir_int,C_MKDIR_INT)( const int * dirname , const int * length ) +{ + + int i, retval = -1 ; + + mode_t mode = 0777 ; + + char * ldir = ( char * ) xcmalloc( (*length) + 1 ) ; + + for( i = 0; i < * length; i++ ) ldir[ i ] = (char)dirname[ i ]; + + ldir[*length] = '\0' ; /* memset() in xcmalloc() already do this */ + + retval = mkdir( ldir , mode ) ; + + if ( retval == -1 && errno != EEXIST ) { + fprintf( stderr , "mkdir fail: [%d] %s\n" , errno , strerror( errno ) ) ; + } + else { + retval = 0 ; + } + + + free( ldir ) ; + + return retval ; + +} /* end of c_mkdir */ + +int c_mkdir_safe( const char * dirname ) +{ + int i, retval = -1 ; + + mode_t mode = 0777 ; + retval = mkdir( dirname , mode ) ; + + if ( retval == -1 && errno != EEXIST ) { + fprintf( stderr , "mkdir fail: [%d] %s\n" , errno , strerror( errno ) ) ; + } + else { + retval = 0 ; + } + return retval ; +} + +int F77_FUNC_(c_chdir_int,C_CHDIR_INT)( const int * dirname , const int * length ) +{ + + int i, retval = -1 ; + + char * ldir = ( char * ) xcmalloc( (*length) + 1 ) ; + + for( i = 0; i < * length; i++ ) ldir[ i ] = (char)dirname[ i ]; + + ldir[*length] = '\0' ; /* memset() in xcmalloc() already do this */ + + retval = chdir( ldir ) ; + + if ( retval == -1 && errno != EEXIST ) { + fprintf( stderr , "chdir fail: [%d] %s\n" , errno , strerror( errno ) ) ; + } + else { + retval = 0 ; + } + + + free( ldir ) ; + + return retval ; + +} /* end of c_chdir */ + +/* c_rename: call from fortran as + ios = c_remame ( integer old-file-name(:), integer old-file-name, & + integer new-file-name(:), integer new-file-name ) + renames file old-file-name into new-file-name (don't try this on open files!) + ios should return 0 if everything is ok, -1 otherwise. + Written by PG by imitating "c_mkdir" without really understanding it */ + +int F77_FUNC_(c_rename_int,C_RENAME_INT)( const int * oldname, const int * oldlength , + const int * newname, const int * newlength ) +{ + + int i, retval = -1 ; + + char * oldname_ = ( char * ) xcmalloc( (*oldlength) + 1 ) ; + char * newname_ = ( char * ) xcmalloc( (*newlength) + 1 ) ; + + for( i = 0; i < * oldlength; i++ ) oldname_[ i ] = (char)oldname[ i ]; + for( i = 0; i < * newlength; i++ ) newname_[ i ] = (char)newname[ i ]; + + oldname_[*oldlength] = '\0' ; + newname_[*newlength] = '\0' ; + + retval = rename( oldname_, newname_ ) ; + + if ( retval == -1 ) + fprintf( stderr , "mv fail: [%d] %s\n" , errno , strerror( errno ) ) ; + + free( oldname_ ) ; + free( newname_ ) ; + + return retval ; + +} /* c_rename */ + +int F77_FUNC_(c_link_int,C_LINK_INT)( const int * oldname, const int * oldlength , + const int * newname, const int * newlength ) +{ + + int i, retval = -1 ; + + char * oldname_ = ( char * ) xcmalloc( (*oldlength) + 1 ) ; + char * newname_ = ( char * ) xcmalloc( (*newlength) + 1 ) ; + + for( i = 0; i < * oldlength; i++ ) oldname_[ i ] = (char)oldname[ i ]; + for( i = 0; i < * newlength; i++ ) newname_[ i ] = (char)newname[ i ]; + + oldname_[*oldlength] = '\0' ; + newname_[*newlength] = '\0' ; + + retval = symlink( oldname_, newname_ ) ; + + if ( retval == -1 ) + fprintf( stderr , "ln fail: [%d] %s\n" , errno , strerror( errno ) ) ; + + free( oldname_ ) ; + free( newname_ ) ; + + return retval ; + +} /* c_link */ + +/* EOF */ diff --git a/tests/apps/miniDFT/tests/src/capital.f90 b/tests/apps/miniDFT/tests/src/capital.f90 new file mode 100644 index 0000000000..2a9d4f7bde --- /dev/null +++ b/tests/apps/miniDFT/tests/src/capital.f90 @@ -0,0 +1,97 @@ +! +! Copyright (C) 2001-2008 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +!----------------------------------------------------------------------- +FUNCTION capital( in_char ) + !----------------------------------------------------------------------- + ! + ! ... converts character to capital if lowercase + ! ... copy character to output in all other cases + ! + IMPLICIT NONE + ! + CHARACTER(LEN=1), INTENT(IN) :: in_char + CHARACTER(LEN=1) :: capital + CHARACTER(LEN=26), PARAMETER :: lower = 'abcdefghijklmnopqrstuvwxyz', & + upper = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' + INTEGER :: i + ! + ! + DO i=1, 26 + ! + IF ( in_char == lower(i:i) ) THEN + ! + capital = upper(i:i) + ! + RETURN + ! + END IF + ! + END DO + ! + capital = in_char + ! + RETURN + ! +END FUNCTION capital +! +!----------------------------------------------------------------------- +FUNCTION lowercase( in_char ) + !----------------------------------------------------------------------- + ! + ! ... converts character to lowercase if capital + ! ... copy character to output in all other cases + ! + IMPLICIT NONE + ! + CHARACTER(LEN=1), INTENT(IN) :: in_char + CHARACTER(LEN=1) :: lowercase + CHARACTER(LEN=26), PARAMETER :: lower = 'abcdefghijklmnopqrstuvwxyz', & + upper = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' + INTEGER :: i + ! + ! + DO i=1, 26 + ! + IF ( in_char == upper(i:i) ) THEN + ! + lowercase = lower(i:i) + ! + RETURN + ! + END IF + ! + END DO + ! + lowercase = in_char + ! + RETURN + ! +END FUNCTION lowercase +! +!----------------------------------------------------------------------- +LOGICAL FUNCTION isnumeric ( in_char ) + !----------------------------------------------------------------------- + ! + ! ... check if a character is a number + ! + IMPLICIT NONE + ! + CHARACTER(LEN=1), INTENT(IN) :: in_char + CHARACTER(LEN=10), PARAMETER :: numbers = '0123456789' + INTEGER :: i + ! + ! + DO i=1, 10 + ! + isnumeric = ( in_char == numbers(i:i) ) + IF ( isnumeric ) RETURN + ! + END DO + RETURN + ! +END FUNCTION isnumeric diff --git a/tests/apps/miniDFT/tests/src/ccgdiagg.f90 b/tests/apps/miniDFT/tests/src/ccgdiagg.f90 new file mode 100644 index 0000000000..7318484454 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/ccgdiagg.f90 @@ -0,0 +1,379 @@ +! +! Copyright (C) 2001-2007 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +#define ZERO ( 0.D0, 0.D0 ) +#define ONE ( 1.D0, 0.D0 ) +! +!---------------------------------------------------------------------------- +SUBROUTINE ccgdiagg( npwx, npw, nbnd, npol, psi, e, btype, precondition, & + ethr, maxter, reorder, notconv, avg_iter ) + !---------------------------------------------------------------------------- + ! + ! ... "poor man" iterative diagonalization of a complex hermitian matrix + ! ... through preconditioned conjugate gradient algorithm + ! ... Band-by-band algorithm with minimal use of memory + ! ... Calls h_1psi and s_1psi to calculate H|psi> and S|psi> + ! ... Works for generalized eigenvalue problem (US pseudopotentials) as well + ! + USE constants, ONLY : pi + USE kinds, ONLY : DP + USE mp_global, ONLY : intra_bgrp_comm + USE mp, ONLY : mp_sum + ! + IMPLICIT NONE + ! + ! ... I/O variables + ! + INTEGER, INTENT(IN) :: npwx, npw, nbnd, npol, maxter + INTEGER, INTENT(IN) :: btype(nbnd) + REAL(DP), INTENT(IN) :: precondition(npwx*npol), ethr + COMPLEX(DP), INTENT(INOUT) :: psi(npwx*npol,nbnd) + REAL(DP), INTENT(INOUT) :: e(nbnd) + INTEGER, INTENT(OUT) :: notconv + REAL(DP), INTENT(OUT) :: avg_iter + ! + ! ... local variables + ! + INTEGER :: i, j, m, iter, moved + COMPLEX(DP), ALLOCATABLE :: hpsi(:), spsi(:), lagrange(:), & + g(:), cg(:), scg(:), ppsi(:), g0(:) + REAL(DP) :: psi_norm, a0, b0, gg0, gamma, gg, gg1, & + cg0, e0, es(2) + REAL(DP) :: theta, cost, sint, cos2t, sin2t + LOGICAL :: reorder + INTEGER :: kdim, kdmx, kdim2 + REAL(DP) :: empty_ethr, ethr_m + ! + ! ... external functions + ! + REAL (DP), EXTERNAL :: ddot + ! + ! + CALL start_clock( 'ccgdiagg' ) + ! + empty_ethr = MAX( ( ethr * 5.D0 ), 1.D-5 ) + ! + IF ( npol == 1 ) THEN + ! + kdim = npw + kdmx = npwx + ! + ELSE + ! + kdim = npwx * npol + kdmx = npwx * npol + ! + END IF + ! + kdim2 = 2 * kdim + ! + ALLOCATE( spsi( kdmx ) ) + ALLOCATE( scg( kdmx ) ) + ALLOCATE( hpsi( kdmx ) ) + ALLOCATE( g( kdmx ) ) + ALLOCATE( cg( kdmx ) ) + ALLOCATE( g0( kdmx ) ) + ALLOCATE( ppsi( kdmx ) ) + ! + ALLOCATE( lagrange( nbnd ) ) + ! + avg_iter = 0.D0 + notconv = 0 + moved = 0 + ! + ! ... every eigenfunction is calculated separately + ! + DO m = 1, nbnd + ! + IF ( btype(m) == 1 ) THEN + ! + ethr_m = ethr + ! + ELSE + ! + ethr_m = empty_ethr + ! + END IF + ! + spsi = ZERO + scg = ZERO + hpsi = ZERO + g = ZERO + cg = ZERO + g0 = ZERO + ppsi = ZERO + lagrange = ZERO + ! + ! ... calculate S|psi> + ! + CALL s_1psi( npwx, npw, psi(1,m), spsi ) + ! + ! ... orthogonalize starting eigenfunction to those already calculated + ! + CALL ZGEMV( 'C', kdim, m, ONE, psi, kdmx, spsi, 1, ZERO, lagrange, 1 ) + ! + CALL mp_sum( lagrange( 1:m ), intra_bgrp_comm ) + ! + psi_norm = DBLE( lagrange(m) ) + ! + DO j = 1, m - 1 + ! + psi(:,m) = psi(:,m) - lagrange(j) * psi(:,j) + ! + psi_norm = psi_norm - & + ( DBLE( lagrange(j) )**2 + AIMAG( lagrange(j) )**2 ) + ! + END DO + ! + psi_norm = SQRT( psi_norm ) + ! + psi(:,m) = psi(:,m) / psi_norm + ! + ! ... calculate starting gradient (|hpsi> = H|psi>) ... + ! + CALL h_1psi( npwx, npw, psi(1,m), hpsi, spsi ) + ! + ! ... and starting eigenvalue (e = = ) + ! + ! ... NB: ddot(2*npw,a,1,b,1) = REAL( zdotc(npw,a,1,b,1) ) + ! + e(m) = ddot( kdim2, psi(1,m), 1, hpsi, 1 ) + ! + CALL mp_sum( e(m), intra_bgrp_comm ) + ! + ! ... start iteration for this band + ! + iterate: DO iter = 1, maxter + ! + ! ... calculate P (PHP)|y> + ! ... ( P = preconditioning matrix, assumed diagonal ) + ! + g(:) = hpsi(:) / precondition(:) + ppsi(:) = spsi(:) / precondition(:) + ! + ! ... ppsi is now S P(P^2)|y> = S P^2|psi>) + ! + es(1) = ddot( kdim2, spsi(1), 1, g(1), 1 ) + es(2) = ddot( kdim2, spsi(1), 1, ppsi(1), 1 ) + ! + CALL mp_sum( es , intra_bgrp_comm ) + ! + es(1) = es(1) / es(2) + ! + g(:) = g(:) - es(1) * ppsi(:) + ! + ! ... e1 = / ensures that + ! ... = 0 + ! ... orthogonalize to lowest eigenfunctions (already calculated) + ! + ! ... scg is used as workspace + ! + CALL s_1psi( npwx, npw, g(1), scg(1) ) + ! + CALL ZGEMV( 'C', kdim, ( m - 1 ), ONE, psi, & + kdmx, scg, 1, ZERO, lagrange, 1 ) + ! + CALL mp_sum( lagrange( 1:m-1 ), intra_bgrp_comm ) + ! + DO j = 1, ( m - 1 ) + ! + g(:) = g(:) - lagrange(j) * psi(:,j) + scg(:) = scg(:) - lagrange(j) * psi(:,j) + ! + END DO + ! + IF ( iter /= 1 ) THEN + ! + ! ... gg1 is (used in Polak-Ribiere formula) + ! + gg1 = ddot( kdim2, g(1), 1, g0(1), 1 ) + ! + CALL mp_sum( gg1, intra_bgrp_comm ) + ! + END IF + ! + ! ... gg is + ! + g0(:) = scg(:) + ! + g0(:) = g0(:) * precondition(:) + ! + gg = ddot( kdim2, g(1), 1, g0(1), 1 ) + ! + CALL mp_sum( gg, intra_bgrp_comm ) + ! + IF ( iter == 1 ) THEN + ! + ! ... starting iteration, the conjugate gradient |cg> = |g> + ! + gg0 = gg + ! + cg(:) = g(:) + ! + ELSE + ! + ! ... |cg(n+1)> = |g(n+1)> + gamma(n) * |cg(n)> + ! + ! ... Polak-Ribiere formula : + ! + gamma = ( gg - gg1 ) / gg0 + gg0 = gg + ! + cg(:) = cg(:) * gamma + cg(:) = g + cg(:) + ! + ! ... The following is needed because + ! ... is not 0. In fact : + ! ... = sin(theta)* + ! + psi_norm = gamma * cg0 * sint + ! + cg(:) = cg(:) - psi_norm * psi(:,m) + ! + END IF + ! + ! ... |cg> contains now the conjugate gradient + ! + ! ... |scg> is S|cg> + ! + CALL h_1psi( npwx, npw, cg(1), ppsi(1), scg(1) ) + ! + cg0 = ddot( kdim2, cg(1), 1, scg(1), 1 ) + ! + CALL mp_sum( cg0 , intra_bgrp_comm ) + ! + cg0 = SQRT( cg0 ) + ! + ! ... |ppsi> contains now HP|cg> + ! ... minimize , where : + ! ... |y(t)> = cos(t)|y> + sin(t)/cg0 |cg> + ! ... Note that = 1, = 0 , + ! ... = cg0^2 + ! ... so that the result is correctly normalized : + ! ... = 1 + ! + a0 = 2.D0 * ddot( kdim2, psi(1,m), 1, ppsi(1), 1 ) / cg0 + ! + CALL mp_sum( a0 , intra_bgrp_comm ) + ! + b0 = ddot( kdim2, cg(1), 1, ppsi(1), 1 ) / cg0**2 + ! + CALL mp_sum( b0 , intra_bgrp_comm ) + ! + e0 = e(m) + ! + theta = 0.5D0 * ATAN( a0 / ( e0 - b0 ) ) + ! + cost = COS( theta ) + sint = SIN( theta ) + ! + cos2t = cost*cost - sint*sint + sin2t = 2.D0*cost*sint + ! + es(1) = 0.5D0 * ( ( e0 - b0 ) * cos2t + a0 * sin2t + e0 + b0 ) + es(2) = 0.5D0 * ( - ( e0 - b0 ) * cos2t - a0 * sin2t + e0 + b0 ) + ! + ! ... there are two possible solutions, choose the minimum + ! + IF ( es(2) < es(1) ) THEN + ! + theta = theta + 0.5D0 * pi + ! + cost = COS( theta ) + sint = SIN( theta ) + ! + END IF + ! + ! ... new estimate of the eigenvalue + ! + e(m) = MIN( es(1), es(2) ) + ! + ! ... upgrade |psi> + ! + psi(:,m) = cost * psi(:,m) + sint / cg0 * cg(:) + ! + ! ... here one could test convergence on the energy + ! + IF ( ABS( e(m) - e0 ) < ethr_m ) EXIT iterate + ! + ! ... upgrade H|psi> and S|psi> + ! + spsi(:) = cost * spsi(:) + sint / cg0 * scg(:) + ! + hpsi(:) = cost * hpsi(:) + sint / cg0 * ppsi(:) + ! + END DO iterate + ! + IF ( iter >= maxter ) notconv = notconv + 1 + ! + avg_iter = avg_iter + iter + 1 + ! + ! ... reorder eigenvalues if they are not in the right order + ! ... ( this CAN and WILL happen in not-so-special cases ) + ! + IF ( m > 1 .AND. reorder ) THEN + ! + IF ( e(m) - e(m-1) < - 2.D0 * ethr_m ) THEN + ! + ! ... if the last calculated eigenvalue is not the largest... + ! + DO i = m - 2, 1, - 1 + ! + IF ( e(m) - e(i) > 2.D0 * ethr_m ) EXIT + ! + END DO + ! + i = i + 1 + ! + moved = moved + 1 + ! + ! ... last calculated eigenvalue should be in the + ! ... i-th position: reorder + ! + e0 = e(m) + ! + ppsi(:) = psi(:,m) + ! + DO j = m, i + 1, - 1 + ! + e(j) = e(j-1) + ! + psi(:,j) = psi(:,j-1) + ! + END DO + ! + e(i) = e0 + ! + psi(:,i) = ppsi(:) + ! + ! ... this procedure should be good if only a few inversions occur, + ! ... extremely inefficient if eigenvectors are often in bad order + ! ... ( but this should not happen ) + ! + END IF + ! + END IF + ! + END DO + ! + avg_iter = avg_iter / DBLE( nbnd ) + ! + DEALLOCATE( lagrange ) + DEALLOCATE( ppsi ) + DEALLOCATE( g0 ) + DEALLOCATE( cg ) + DEALLOCATE( g ) + DEALLOCATE( hpsi ) + DEALLOCATE( scg ) + DEALLOCATE( spsi ) + ! + CALL stop_clock( 'ccgdiagg' ) + ! + RETURN + ! +END SUBROUTINE ccgdiagg diff --git a/tests/apps/miniDFT/tests/src/cdiaghg.f90 b/tests/apps/miniDFT/tests/src/cdiaghg.f90 new file mode 100644 index 0000000000..f82bad284a --- /dev/null +++ b/tests/apps/miniDFT/tests/src/cdiaghg.f90 @@ -0,0 +1,171 @@ +! +! Copyright (C) 2001-2006 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +#define ZERO ( 0.D0, 0.D0 ) +#define ONE ( 1.D0, 0.D0 ) +! +!---------------------------------------------------------------------------- +! +!---------------------------------------------------------------------------- +SUBROUTINE pcdiaghg( n, h, s, ldh, e, v, desc ) + !---------------------------------------------------------------------------- + ! + ! ... calculates eigenvalues and eigenvectors of the generalized problem + ! ... Hv=eSv, with H hermitean matrix, S overlap matrix. + ! ... On output both matrix are unchanged + ! + ! ... Parallel version, with full data distribution + ! + USE kinds, ONLY : DP + USE mp, ONLY : mp_bcast + USE mp_global, ONLY : root_bgrp, intra_bgrp_comm + USE zhpev_module, ONLY : pzhpev_drv, zhpev_drv + USE descriptors, ONLY : la_descriptor +!!$ USE parallel_toolkit, ONLY : zsqmdst, zsqmcll + USE mp_global, ONLY : ortho_cntx, me_blacs, np_ortho, me_ortho + USE zhpev_module, ONLY : pzheevd_drv + + ! + IMPLICIT NONE + ! + INTEGER, INTENT(IN) :: n, ldh + ! dimension of the matrix to be diagonalized + ! leading dimension of h, as declared in the calling pgm unit + COMPLEX(DP), INTENT(INOUT) :: h(ldh,ldh), s(ldh,ldh) + ! actually intent(in) but compilers don't know and complain + ! matrix to be diagonalized + ! overlap matrix + REAL(DP), INTENT(OUT) :: e(n) + ! eigenvalues + COMPLEX(DP), INTENT(OUT) :: v(ldh,ldh) + ! eigenvectors (column-wise) + TYPE(la_descriptor), INTENT(IN) :: desc + ! + INTEGER :: nx + INTEGER :: descsca( 16 ), info + ! local block size + COMPLEX(DP), ALLOCATABLE :: ss(:,:), hh(:,:), tt(:,:) + ! work space used only in parallel diagonalization + ! + ! ... input s and h are copied so that they are not destroyed + ! + CALL start_clock( 'cdiaghg' ) + ! + IF( desc%active_node > 0 ) THEN + ! + nx = desc%nrcx + ! + IF( nx /= ldh ) & + CALL errore(" pcdiaghg ", " inconsistent leading dimension ", ldh ) + ! + ALLOCATE( hh( nx, nx ) ) + ALLOCATE( ss( nx, nx ) ) + ! + hh(1:nx,1:nx) = h(1:nx,1:nx) + ss(1:nx,1:nx) = s(1:nx,1:nx) + ! + END IF + + CALL start_clock( 'cdiaghg:choldc' ) + ! + ! ... Cholesky decomposition of sl ( L is stored in sl ) + ! + IF( desc%active_node > 0 ) THEN + ! + CALL descinit( descsca, n, n, desc%nrcx, desc%nrcx, 0, 0, ortho_cntx, SIZE( ss, 1 ) , info ) + ! + IF( info /= 0 ) CALL errore( ' cdiaghg ', ' desckinit ', ABS( info ) ) + ! + + CALL pzpotrf( 'L', n, ss, 1, 1, descsca, info ) + + IF( info /= 0 ) CALL errore( ' cdiaghg ', ' problems computing cholesky ', ABS( info ) ) + ! + END IF + ! + CALL stop_clock( 'cdiaghg:choldc' ) + ! + ! ... L is inverted ( sl = L^-1 ) + ! + CALL start_clock( 'cdiaghg:inversion' ) + ! + IF( desc%active_node > 0 ) THEN + ! + !CALL clear_upper_tr( ss ) + ! set to zero the upper triangle of ss + ! + CALL sqr_zsetmat( 'U', n, ZERO, ss, size(ss,1), desc ) + ! + CALL pztrtri( 'L', 'N', n, ss, 1, 1, descsca, info ) + ! + IF( info /= 0 ) CALL errore( ' cdiaghg ', ' problems computing inverse ', ABS( info ) ) + ! + END IF + ! + CALL stop_clock( 'cdiaghg:inversion' ) + ! + ! ... vl = L^-1*H + ! + CALL start_clock( 'cdiaghg:paragemm' ) + ! + IF( desc%active_node > 0 ) THEN + ! + CALL sqr_zmm_cannon( 'N', 'N', n, ONE, ss, nx, hh, nx, ZERO, v, nx, desc ) + ! + END IF + ! + ! ... hl = ( L^-1*H )*(L^-1)^T + ! + IF( desc%active_node > 0 ) THEN + ! + CALL sqr_zmm_cannon( 'N', 'C', n, ONE, v, nx, ss, nx, ZERO, hh, nx, desc ) + ! + ! ensure that "hh" is really Hermitian, it is sufficient to set the diagonal + ! properly, because only the lower triangle of hh will be used + ! + CALL sqr_zsetmat( 'H', n, ZERO, hh, size(hh,1), desc ) + ! + END IF + ! + CALL stop_clock( 'cdiaghg:paragemm' ) + ! + ! + IF ( desc%active_node > 0 ) THEN + ! + + ! + CALL pzheevd_drv( .true., n, desc%nrcx, hh, e, ortho_cntx ) + ! + ! + END IF + ! + ! ... v = (L^T)^-1 v + ! + CALL start_clock( 'cdiaghg:paragemm' ) + ! + IF ( desc%active_node > 0 ) THEN + ! + CALL sqr_zmm_cannon( 'C', 'N', n, ONE, ss, nx, hh, nx, ZERO, v, nx, desc ) + ! + END IF + ! + CALL mp_bcast( e, root_bgrp, intra_bgrp_comm ) + ! + CALL stop_clock( 'cdiaghg:paragemm' ) + ! + IF ( desc%active_node > 0 ) THEN + DEALLOCATE( ss, hh ) + END IF + ! + CALL stop_clock( 'cdiaghg' ) + ! + RETURN + ! + ! +END SUBROUTINE pcdiaghg +! diff --git a/tests/apps/miniDFT/tests/src/cegterg.f90 b/tests/apps/miniDFT/tests/src/cegterg.f90 new file mode 100644 index 0000000000..f0bc2e1786 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/cegterg.f90 @@ -0,0 +1,994 @@ +! +! Copyright (C) 2001-2007 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +#define ZERO ( 0.D0, 0.D0 ) +#define ONE ( 1.D0, 0.D0 ) +! +! +!---------------------------------------------------------------------------- + +! +! Subroutine with distributed matrixes +! (written by Carlo Cavazzoni) +! +!---------------------------------------------------------------------------- +SUBROUTINE pcegterg( npw, npwx, nvec, nvecx, npol, evc, ethr, & + uspp, e, btype, notcnv, lrot, dav_iter ) + !---------------------------------------------------------------------------- + ! + ! ... iterative solution of the eigenvalue problem: + ! + ! ... ( H - e S ) * evc = 0 + ! + ! ... where H is an hermitean operator, e is a real scalar, + ! ... S is an uspp matrix, evc is a complex vector + ! + USE kinds, ONLY : DP + USE io_global, ONLY : stdout + USE mp_global, ONLY : nbgrp, nproc_bgrp, me_bgrp, & + intra_bgrp_comm, root_bgrp, & + ortho_comm, np_ortho, me_ortho, ortho_comm_id, & + leg_ortho + USE descriptors, ONLY : la_descriptor, descla_init , descla_local_dims + USE parallel_toolkit, ONLY : zsqmred, zsqmher + USE mp, ONLY : mp_bcast, mp_root_sum, mp_sum, mp_barrier + ! + IMPLICIT NONE + ! + INTEGER, INTENT(IN) :: npw, npwx, nvec, nvecx, npol + ! dimension of the matrix to be diagonalized + ! leading dimension of matrix evc, as declared in the calling pgm unit + ! integer number of searched low-lying roots + ! maximum dimension of the reduced basis set + ! (the basis set is refreshed when its dimension would exceed nvecx) + ! number of spin polarizations + COMPLEX(DP), INTENT(INOUT) :: evc(npwx,npol,nvec) + ! evc contains the refined estimates of the eigenvectors + REAL(DP), INTENT(IN) :: ethr + ! energy threshold for convergence: root improvement is stopped, + ! when two consecutive estimates of the root differ by less than ethr. + LOGICAL, INTENT(IN) :: uspp + ! if .FALSE. : S|psi> not needed + INTEGER, INTENT(IN) :: btype(nvec) + ! band type ( 1 = occupied, 0 = empty ) + LOGICAL, INTENT(IN) :: lrot + ! .TRUE. if the wfc have already been rotated + REAL(DP), INTENT(OUT) :: e(nvec) + ! contains the estimated roots. + INTEGER, INTENT(OUT) :: dav_iter, notcnv + ! integer number of iterations performed + ! number of unconverged roots + ! + ! ... LOCAL variables + ! + INTEGER, PARAMETER :: maxter = 20 + ! maximum number of iterations + ! + INTEGER :: kter, nbase, np, kdim, kdmx, n, nb1, nbn + ! counter on iterations + ! dimension of the reduced basis + ! counter on the reduced basis vectors + ! do-loop counters + INTEGER :: ierr + REAL(DP), ALLOCATABLE :: ew(:) + COMPLEX(DP), ALLOCATABLE :: hl(:,:), sl(:,:), vl(:,:) + ! Hamiltonian on the reduced basis + ! S matrix on the reduced basis + ! eigenvectors of the Hamiltonian + ! eigenvalues of the reduced hamiltonian + COMPLEX(DP), ALLOCATABLE :: psi(:,:,:), hpsi(:,:,:), spsi(:,:,:) + ! work space, contains psi + ! the product of H and psi + ! the product of S and psi + LOGICAL, ALLOCATABLE :: conv(:) + ! true if the root is converged + REAL(DP) :: empty_ethr + ! threshold for empty bands + TYPE(la_descriptor) :: desc, desc_old + INTEGER, ALLOCATABLE :: irc_ip( : ) + INTEGER, ALLOCATABLE :: nrc_ip( : ) + INTEGER, ALLOCATABLE :: rank_ip( :, : ) + ! matrix distribution descriptors + INTEGER :: nx + ! maximum local block dimension + LOGICAL :: la_proc + ! flag to distinguish procs involved in linear algebra + INTEGER, ALLOCATABLE :: notcnv_ip( : ) + INTEGER, ALLOCATABLE :: ic_notcnv( : ) + ! + REAL(DP), EXTERNAL :: ddot + ! + ! EXTERNAL h_psi, s_psi, g_psi + ! h_psi(npwx,npw,nvec,psi,hpsi) + ! calculates H|psi> + ! s_psi(npwx,npw,nvec,psi,spsi) + ! calculates S|psi> (if needed) + ! Vectors psi,hpsi,spsi are dimensioned (npwx,nvec) + ! g_psi(npwx,npw,notcnv,psi,e) + ! calculates (diag(h)-e)^-1 * psi, diagonal approx. to (h-e)^-1*psi + ! the first nvec columns contain the trial eigenvectors + ! + ! + CALL start_clock( 'cegterg' ) + ! + IF ( nvec > nvecx / 2 ) CALL errore( 'regter', 'nvecx is too small', 1 ) + ! + ! ... threshold for empty bands + ! + empty_ethr = MAX( ( ethr * 5.D0 ), 1.D-5 ) + ! + IF ( npol == 1 ) THEN + ! + kdim = npw + kdmx = npwx + ! + ELSE + ! + kdim = npwx*npol + kdmx = npwx*npol + ! + END IF + + ALLOCATE( psi( npwx, npol, nvecx ), STAT=ierr ) + IF( ierr /= 0 ) & + CALL errore( ' pcegterg ',' cannot allocate psi ', ABS(ierr) ) + ! + ALLOCATE( hpsi( npwx, npol, nvecx ), STAT=ierr ) + IF( ierr /= 0 ) & + CALL errore( ' pcegterg ',' cannot allocate hpsi ', ABS(ierr) ) + ! + IF ( uspp ) THEN + ALLOCATE( spsi( npwx, npol, nvecx ), STAT=ierr ) + IF( ierr /= 0 ) & + CALL errore( ' pcegterg ',' cannot allocate spsi ', ABS(ierr) ) + END IF + ! + ! ... Initialize the matrix descriptor + ! + ALLOCATE( ic_notcnv( np_ortho(2) ), STAT=ierr ) + IF( ierr /= 0 ) & + CALL errore( ' pcegterg ',' cannot allocate ic_notcnv ', ABS(ierr) ) + ! + ALLOCATE( notcnv_ip( np_ortho(2) ), STAT=ierr ) + IF( ierr /= 0 ) & + CALL errore( ' pcegterg ',' cannot allocate notcnv_ip ', ABS(ierr) ) + ! + ALLOCATE( irc_ip( np_ortho(1) ), STAT=ierr ) + IF( ierr /= 0 ) & + CALL errore( ' pcegterg ',' cannot allocate irc_ip ', ABS(ierr) ) + ! + ALLOCATE( nrc_ip( np_ortho(1) ), STAT=ierr ) + IF( ierr /= 0 ) & + CALL errore( ' pcegterg ',' cannot allocate nrc_ip ', ABS(ierr) ) + ! + ALLOCATE( rank_ip( np_ortho(1), np_ortho(2) ), STAT=ierr ) + IF( ierr /= 0 ) & + CALL errore( ' pcegterg ',' cannot allocate rank_ip ', ABS(ierr) ) + ! + CALL desc_init( nvec, desc, irc_ip, nrc_ip ) + ! + IF( la_proc ) THEN + ! + ! only procs involved in the diagonalization need to allocate local + ! matrix block. + ! + ALLOCATE( vl( nx , nx ), STAT=ierr ) + IF( ierr /= 0 ) & + CALL errore( ' pcegterg ',' cannot allocate vl ', ABS(ierr) ) + ! + ALLOCATE( sl( nx , nx ), STAT=ierr ) + IF( ierr /= 0 ) & + CALL errore( ' pcegterg ',' cannot allocate sl ', ABS(ierr) ) + ! + ALLOCATE( hl( nx , nx ), STAT=ierr ) + IF( ierr /= 0 ) & + CALL errore( ' pcegterg ',' cannot allocate hl ', ABS(ierr) ) + ! + ELSE + ! + ALLOCATE( vl( 1 , 1 ), STAT=ierr ) + IF( ierr /= 0 ) & + CALL errore( ' pcegterg ',' cannot allocate vl ', ABS(ierr) ) + ! + ALLOCATE( sl( 1 , 1 ), STAT=ierr ) + IF( ierr /= 0 ) & + CALL errore( ' pcegterg ',' cannot allocate sl ', ABS(ierr) ) + ! + ALLOCATE( hl( 1 , 1 ), STAT=ierr ) + IF( ierr /= 0 ) & + CALL errore( ' pcegterg ',' cannot allocate hl ', ABS(ierr) ) + ! + END IF + ! + ALLOCATE( ew( nvecx ), STAT=ierr ) + IF( ierr /= 0 ) & + CALL errore( ' pcegterg ',' cannot allocate ew ', ABS(ierr) ) + ! + ALLOCATE( conv( nvec ), STAT=ierr ) + IF( ierr /= 0 ) & + CALL errore( ' pcegterg ',' cannot allocate conv ', ABS(ierr) ) + ! + notcnv = nvec + nbase = nvec + conv = .FALSE. + ! + IF ( uspp ) spsi = ZERO + ! + hpsi = ZERO + psi = ZERO + psi(:,:,1:nvec) = evc(:,:,1:nvec) + ! + ! ... hpsi contains h times the basis vectors + ! + CALL h_psi( npwx, npw, nvec, psi, hpsi ) + ! + IF ( uspp ) CALL s_psi( npwx, npw, nvec, psi, spsi ) + ! + ! ... hl contains the projection of the hamiltonian onto the reduced + ! ... space, vl contains the eigenvectors of hl. Remember hl, vl and sl + ! ... are all distributed across processors, global replicated matrixes + ! ... here are never allocated + ! + CALL compute_distmat( hl, psi, hpsi ) + ! + IF ( uspp ) THEN + ! + CALL compute_distmat( sl, psi, spsi ) + ! + ELSE + ! + CALL compute_distmat( sl, psi, psi ) + ! + END IF + ! + IF ( lrot ) THEN + ! + CALL set_e_from_h() + ! + CALL set_to_identity( vl, desc ) + ! + ELSE + ! + ! ... diagonalize the reduced hamiltonian + ! Calling block parallel algorithm + ! + CALL pcdiaghg( nbase, hl, sl, nx, ew, vl, desc ) + ! + e(1:nvec) = ew(1:nvec) + ! + END IF + ! + ! ... iterate + ! + iterate: DO kter = 1, maxter + ! + dav_iter = kter + ! + CALL start_clock( 'cegterg:update' ) + ! + CALL reorder_v() + ! + nb1 = nbase + 1 + ! + ! ... expand the basis set with new basis vectors ( H - e*S )|psi> ... + ! + CALL hpsi_dot_v() + ! + CALL stop_clock( 'cegterg:update' ) + ! + ! ... approximate inverse iteration + ! + CALL g_psi( npwx, npw, notcnv, npol, psi(1,1,nb1), ew(nb1) ) + ! + ! ... "normalize" correction vectors psi(:,nb1:nbase+notcnv) in + ! ... order to improve numerical stability of subspace diagonalization + ! ... (cdiaghg) ew is used as work array : + ! + ! ... ew = , i = nbase + 1, nbase + notcnv + ! + DO n = 1, notcnv + ! + nbn = nbase + n + ! + IF ( npol == 1 ) THEN + ! + ew(n) = ddot( 2*npw, psi(1,1,nbn), 1, psi(1,1,nbn), 1 ) + ! + ELSE + ! + ew(n) = ddot( 2*npw, psi(1,1,nbn), 1, psi(1,1,nbn), 1 ) + & + ddot( 2*npw, psi(1,2,nbn), 1, psi(1,2,nbn), 1 ) + ! + END IF + ! + END DO + ! + CALL mp_sum( ew( 1:notcnv ), intra_bgrp_comm ) + ! + DO n = 1, notcnv + ! + psi(:,:,nbase+n) = psi(:,:,nbase+n) / SQRT( ew(n) ) + ! + END DO + ! + ! ... here compute the hpsi and spsi of the new functions + ! + CALL h_psi( npwx, npw, notcnv, psi(1,1,nb1), hpsi(1,1,nb1) ) + ! + IF ( uspp ) & + CALL s_psi( npwx, npw, notcnv, psi(1,1,nb1), spsi(1,1,nb1) ) + ! + ! ... update the reduced hamiltonian + ! + ! we need to save the old descriptor in order to redistribute matrices + ! + desc_old = desc + ! + ! ... RE-Initialize the matrix descriptor + ! + CALL desc_init( nbase+notcnv, desc, irc_ip, nrc_ip ) + ! + IF( la_proc ) THEN + + ! redistribute hl and sl (see dsqmred), since the dimension of the subspace has changed + ! + vl = hl + DEALLOCATE( hl ) + ALLOCATE( hl( nx , nx ), STAT=ierr ) + IF( ierr /= 0 ) & + CALL errore( ' pcegterg ',' cannot allocate hl ', ABS(ierr) ) + + CALL zsqmred( nbase, vl, desc_old%nrcx, desc_old, nbase+notcnv, hl, nx, desc ) + + vl = sl + DEALLOCATE( sl ) + ALLOCATE( sl( nx , nx ), STAT=ierr ) + IF( ierr /= 0 ) & + CALL errore( ' pcegterg ',' cannot allocate sl ', ABS(ierr) ) + + CALL zsqmred( nbase, vl, desc_old%nrcx, desc_old, nbase+notcnv, sl, nx, desc ) + + DEALLOCATE( vl ) + ALLOCATE( vl( nx , nx ), STAT=ierr ) + IF( ierr /= 0 ) & + CALL errore( ' pcegterg ',' cannot allocate vl ', ABS(ierr) ) + + END IF + ! + CALL start_clock( 'cegterg:overlap' ) + ! + CALL update_distmat( hl, psi, hpsi ) + ! + IF ( uspp ) THEN + ! + CALL update_distmat( sl, psi, spsi ) + ! + ELSE + ! + CALL update_distmat( sl, psi, psi ) + ! + END IF + ! + CALL stop_clock( 'cegterg:overlap' ) + ! + nbase = nbase + notcnv + ! + ! ... diagonalize the reduced hamiltonian + ! Call block parallel algorithm + ! + CALL pcdiaghg( nbase, hl, sl, nx, ew, vl, desc ) + ! + ! ... test for convergence + ! + WHERE( btype(1:nvec) == 1 ) + ! + conv(1:nvec) = ( ( ABS( ew(1:nvec) - e(1:nvec) ) < ethr ) ) + ! + ELSEWHERE + ! + conv(1:nvec) = ( ( ABS( ew(1:nvec) - e(1:nvec) ) < empty_ethr ) ) + ! + END WHERE + ! + notcnv = COUNT( .NOT. conv(:) ) + ! + e(1:nvec) = ew(1:nvec) + ! + ! ... if overall convergence has been achieved, or the dimension of + ! ... the reduced basis set is becoming too large, or in any case if + ! ... we are at the last iteration refresh the basis set. i.e. replace + ! ... the first nvec elements with the current estimate of the + ! ... eigenvectors; set the basis dimension to nvec. + ! + IF ( notcnv == 0 .OR. nbase+notcnv > nvecx .OR. dav_iter == maxter ) THEN + ! + CALL start_clock( 'cegterg:last' ) + ! + CALL refresh_evc() + ! + IF ( notcnv == 0 ) THEN + ! + ! ... all roots converged: return + ! + CALL stop_clock( 'cegterg:last' ) + ! + EXIT iterate + ! + ELSE IF ( dav_iter == maxter ) THEN + ! + ! ... last iteration, some roots not converged: return + ! + !!!WRITE( stdout, '(5X,"WARNING: ",I5, & + !!! & " eigenvalues not converged")' ) notcnv + ! + CALL stop_clock( 'cegterg:last' ) + ! + EXIT iterate + ! + END IF + ! + ! ... refresh psi, H*psi and S*psi + ! + psi(:,:,1:nvec) = evc(:,:,1:nvec) + ! + IF ( uspp ) THEN + ! + CALL refresh_spsi() + ! + END IF + ! + CALL refresh_hpsi() + ! + ! ... refresh the reduced hamiltonian + ! + nbase = nvec + ! + CALL desc_init( nvec, desc, irc_ip, nrc_ip ) + ! + IF( la_proc ) THEN + ! + ! note that nx has been changed by desc_init + ! we need to re-alloc with the new size. + ! + DEALLOCATE( vl, hl, sl ) + ALLOCATE( vl( nx, nx ), STAT=ierr ) + IF( ierr /= 0 ) & + CALL errore( ' pcegterg ',' cannot allocate vl ', ABS(ierr) ) + ALLOCATE( hl( nx, nx ), STAT=ierr ) + IF( ierr /= 0 ) & + CALL errore( ' pcegterg ',' cannot allocate hl ', ABS(ierr) ) + ALLOCATE( sl( nx, nx ), STAT=ierr ) + IF( ierr /= 0 ) & + CALL errore( ' pcegterg ',' cannot allocate sl ', ABS(ierr) ) + ! + END IF + ! + CALL set_h_from_e( ) + ! + CALL set_to_identity( vl, desc ) + CALL set_to_identity( sl, desc ) + ! + CALL stop_clock( 'cegterg:last' ) + ! + END IF + ! + END DO iterate + ! + DEALLOCATE( vl, hl, sl ) + ! + DEALLOCATE( rank_ip ) + DEALLOCATE( ic_notcnv ) + DEALLOCATE( irc_ip ) + DEALLOCATE( nrc_ip ) + DEALLOCATE( notcnv_ip ) + DEALLOCATE( conv ) + DEALLOCATE( ew ) + ! + IF ( uspp ) DEALLOCATE( spsi ) + ! + DEALLOCATE( hpsi ) + DEALLOCATE( psi ) + ! + CALL stop_clock( 'cegterg' ) + ! + RETURN + ! + ! +CONTAINS + ! + ! + SUBROUTINE desc_init( nsiz, desc, irc_ip, nrc_ip ) + ! + INTEGER, INTENT(IN) :: nsiz + TYPE(la_descriptor), INTENT(OUT) :: desc + INTEGER, INTENT(OUT) :: irc_ip(:) + INTEGER, INTENT(OUT) :: nrc_ip(:) + INTEGER :: i, j, rank + ! + CALL descla_init( desc, nsiz, nsiz, np_ortho, me_ortho, ortho_comm, ortho_comm_id ) + ! + nx = desc%nrcx + ! + DO j = 0, desc%npc - 1 + CALL descla_local_dims( irc_ip( j + 1 ), nrc_ip( j + 1 ), desc%n, desc%nx, np_ortho(1), j ) + DO i = 0, desc%npr - 1 + CALL GRID2D_RANK( 'R', desc%npr, desc%npc, i, j, rank ) + rank_ip( i+1, j+1 ) = rank * leg_ortho + END DO + END DO + ! + la_proc = .FALSE. + IF( desc%active_node > 0 ) la_proc = .TRUE. + ! + RETURN + END SUBROUTINE desc_init + ! + ! + SUBROUTINE set_to_identity( distmat, desc ) + TYPE(la_descriptor), INTENT(IN) :: desc + COMPLEX(DP), INTENT(OUT) :: distmat(:,:) + INTEGER :: i + distmat = ( 0_DP , 0_DP ) + IF( desc%myc == desc%myr .AND. desc%active_node > 0 ) THEN + DO i = 1, desc%nc + distmat( i, i ) = ( 1_DP , 0_DP ) + END DO + END IF + RETURN + END SUBROUTINE set_to_identity + ! + ! + SUBROUTINE reorder_v() + ! + INTEGER :: ipc + INTEGER :: nc, ic + INTEGER :: nl, npl + ! + np = 0 + ! + notcnv_ip = 0 + ! + n = 0 + ! + DO ipc = 1, desc%npc + ! + nc = nrc_ip( ipc ) + ic = irc_ip( ipc ) + ! + npl = 0 + ! + IF( ic <= nvec ) THEN + ! + DO nl = 1, min( nvec - ic + 1, nc ) + ! + n = n + 1 + ! + IF ( .NOT. conv(n) ) THEN + ! + ! ... this root not yet converged ... + ! + np = np + 1 + npl = npl + 1 + IF( npl == 1 ) ic_notcnv( ipc ) = np + ! + ! ... reorder eigenvectors so that coefficients for unconverged + ! ... roots come first. This allows to use quick matrix-matrix + ! ... multiplications to set a new basis vector (see below) + ! + notcnv_ip( ipc ) = notcnv_ip( ipc ) + 1 + ! + IF ( npl /= nl ) THEN + IF( la_proc .AND. desc%myc == ipc-1 ) THEN + vl( :, npl) = vl( :, nl ) + END IF + END IF + ! + ! ... for use in g_psi + ! + ew(nbase+np) = e(n) + ! + END IF + ! + END DO + ! + END IF + ! + END DO + ! + END SUBROUTINE reorder_v + ! + ! + SUBROUTINE hpsi_dot_v() + ! + INTEGER :: ipc, ipr + INTEGER :: nr, ir, ic, notcl, root, np + COMPLEX(DP), ALLOCATABLE :: vtmp( :, : ) + COMPLEX(DP), ALLOCATABLE :: ptmp( :, :, : ) + COMPLEX(DP) :: beta + + ALLOCATE( vtmp( nx, nx ) ) + ALLOCATE( ptmp( npwx, npol, nx ) ) + + DO ipc = 1, desc%npc + ! + IF( notcnv_ip( ipc ) > 0 ) THEN + + notcl = notcnv_ip( ipc ) + ic = ic_notcnv( ipc ) + + ptmp = ZERO + beta = ZERO + + DO ipr = 1, desc%npr + ! + nr = nrc_ip( ipr ) + ir = irc_ip( ipr ) + ! + root = rank_ip( ipr, ipc ) + + IF( ipr-1 == desc%myr .AND. ipc-1 == desc%myc .AND. la_proc ) THEN + vtmp(:,1:notcl) = vl(:,1:notcl) + END IF + + CALL mp_bcast( vtmp(:,1:notcl), root, intra_bgrp_comm ) + ! + IF ( uspp ) THEN + ! + CALL ZGEMM( 'N', 'N', kdim, notcl, nr, ONE, & + spsi( 1, 1, ir ), kdmx, vtmp, nx, beta, psi(1,1,nb1+ic-1), kdmx ) + ! + ELSE + ! + CALL ZGEMM( 'N', 'N', kdim, notcl, nr, ONE, & + psi( 1, 1, ir ), kdmx, vtmp, nx, beta, psi(1,1,nb1+ic-1), kdmx ) + ! + END IF + ! + CALL ZGEMM( 'N', 'N', kdim, notcl, nr, ONE, & + hpsi( 1, 1, ir ), kdmx, vtmp, nx, ONE, ptmp, kdmx ) + + beta = ONE + + END DO + + DO np = 1, notcl + ! + psi(:,:,nbase+np+ic-1) = ptmp(:,:,np) - ew(nbase+np+ic-1) * psi(:,:,nbase+np+ic-1) + ! + END DO + ! + END IF + ! + END DO + + DEALLOCATE( vtmp ) + DEALLOCATE( ptmp ) + + RETURN + END SUBROUTINE hpsi_dot_v + ! + ! + SUBROUTINE refresh_spsi( ) + ! + INTEGER :: ipc, ipr + INTEGER :: nr, nc, ir, ic, root + COMPLEX(DP), ALLOCATABLE :: vtmp( :, : ) + COMPLEX(DP) :: beta + + ALLOCATE( vtmp( nx, nx ) ) + ! + DO ipc = 1, desc%npc + ! + nc = nrc_ip( ipc ) + ic = irc_ip( ipc ) + ! + IF( ic <= nvec ) THEN + ! + nc = min( nc, nvec - ic + 1 ) + ! + beta = ZERO + ! + DO ipr = 1, desc%npr + ! + nr = nrc_ip( ipr ) + ir = irc_ip( ipr ) + ! + root = rank_ip( ipr, ipc ) + + IF( ipr-1 == desc%myr .AND. ipc-1 == desc%myc .AND. la_proc ) THEN + ! + ! this proc sends his block + ! + CALL mp_bcast( vl(:,1:nc), root, intra_bgrp_comm ) + CALL ZGEMM( 'N', 'N', kdim, nc, nr, ONE, & + spsi(1,1,ir), kdmx, vl, nx, beta, psi(1,1,nvec+ic), kdmx ) + ELSE + ! + ! all other procs receive + ! + CALL mp_bcast( vtmp(:,1:nc), root, intra_bgrp_comm ) + CALL ZGEMM( 'N', 'N', kdim, nc, nr, ONE, & + spsi(1,1,ir), kdmx, vtmp, nx, beta, psi(1,1,nvec+ic), kdmx ) + END IF + ! + beta = ONE + + END DO + ! + END IF + ! + END DO + ! + spsi(:,:,1:nvec) = psi(:,:,nvec+1:nvec+nvec) + ! + DEALLOCATE( vtmp ) + + RETURN + END SUBROUTINE refresh_spsi + ! + ! + ! + SUBROUTINE refresh_hpsi( ) + ! + INTEGER :: ipc, ipr + INTEGER :: nr, nc, ir, ic, root + COMPLEX(DP), ALLOCATABLE :: vtmp( :, : ) + COMPLEX(DP) :: beta + + ALLOCATE( vtmp( nx, nx ) ) + ! + DO ipc = 1, desc%npc + ! + nc = nrc_ip( ipc ) + ic = irc_ip( ipc ) + ! + IF( ic <= nvec ) THEN + ! + nc = min( nc, nvec - ic + 1 ) + ! + beta = ZERO + ! + DO ipr = 1, desc%npr + ! + nr = nrc_ip( ipr ) + ir = irc_ip( ipr ) + ! + root = rank_ip( ipr, ipc ) + + IF( ipr-1 == desc%myr .AND. ipc-1 == desc%myc .AND. la_proc ) THEN + ! + ! this proc sends his block + ! + CALL mp_bcast( vl(:,1:nc), root, intra_bgrp_comm ) + CALL ZGEMM( 'N', 'N', kdim, nc, nr, ONE, & + hpsi(1,1,ir), kdmx, vl, nx, beta, psi(1,1,nvec+ic), kdmx ) + ELSE + ! + ! all other procs receive + ! + CALL mp_bcast( vtmp(:,1:nc), root, intra_bgrp_comm ) + CALL ZGEMM( 'N', 'N', kdim, nc, nr, ONE, & + hpsi(1,1,ir), kdmx, vtmp, nx, beta, psi(1,1,nvec+ic), kdmx ) + END IF + ! + beta = ONE + + END DO + ! + END IF + ! + END DO + ! + DEALLOCATE( vtmp ) + + hpsi(:,:,1:nvec) = psi(:,:,nvec+1:nvec+nvec) + + RETURN + END SUBROUTINE refresh_hpsi + ! + ! + + SUBROUTINE compute_distmat( dm, v, w ) + ! + ! This subroutine compute and store the + ! result in distributed matrix dm + ! + INTEGER :: ipc, ipr + INTEGER :: nr, nc, ir, ic, root + COMPLEX(DP), INTENT(OUT) :: dm( :, : ) + COMPLEX(DP) :: v(:,:,:), w(:,:,:) + COMPLEX(DP), ALLOCATABLE :: work( :, : ) + ! + ALLOCATE( work( nx, nx ) ) + ! + work = ZERO + ! + ! Only upper triangle is computed, then the matrix is hermitianized + ! + DO ipc = 1, desc%npc ! loop on column procs + ! + nc = nrc_ip( ipc ) + ic = irc_ip( ipc ) + ! + DO ipr = 1, ipc ! desc%npr ! ipc ! use symmetry for the loop on row procs + ! + nr = nrc_ip( ipr ) + ir = irc_ip( ipr ) + ! + ! rank of the processor for which this block (ipr,ipc) is destinated + ! + root = rank_ip( ipr, ipc ) + + ! use blas subs. on the matrix block + + CALL ZGEMM( 'C', 'N', nr, nc, kdim, ONE , & + v(1,1,ir), kdmx, w(1,1,ic), kdmx, ZERO, work, nx ) + + ! accumulate result on dm of root proc. + + CALL mp_root_sum( work, dm, root, intra_bgrp_comm ) + + END DO + ! + END DO + ! + ! The matrix is hermitianized using upper triangle + ! + CALL zsqmher( nbase, dm, nx, desc ) + ! + DEALLOCATE( work ) + ! + RETURN + END SUBROUTINE compute_distmat + ! + ! + SUBROUTINE update_distmat( dm, v, w ) + ! + INTEGER :: ipc, ipr + INTEGER :: nr, nc, ir, ic, root, icc, ii + COMPLEX(DP) :: dm( :, : ) + COMPLEX(DP) :: v(:,:,:), w(:,:,:) + COMPLEX(DP), ALLOCATABLE :: vtmp( :, : ) + + ALLOCATE( vtmp( nx, nx ) ) + ! + vtmp = ZERO + ! + DO ipc = 1, desc%npc + ! + nc = nrc_ip( ipc ) + ic = irc_ip( ipc ) + ! + IF( ic+nc-1 >= nb1 ) THEN + + nc = MIN( nc, ic+nc-1 - nb1 + 1 ) + IF( ic >= nb1 ) THEN + ii = ic + icc = 1 + ELSE + ii = nb1 + icc = nb1-ic+1 + END IF + + DO ipr = 1, ipc ! desc%npr use symmetry + ! + nr = nrc_ip( ipr ) + ir = irc_ip( ipr ) + ! + root = rank_ip( ipr, ipc ) + + CALL ZGEMM( 'C', 'N', nr, nc, kdim, ONE, v( 1, 1, ir ), & + kdmx, w(1,1,ii), kdmx, ZERO, vtmp, nx ) + ! + IF( (desc%active_node > 0) .AND. (ipr-1 == desc%myr) .AND. (ipc-1 == desc%myc) ) THEN + CALL mp_root_sum( vtmp(:,1:nc), dm(:,icc:icc+nc-1), root, intra_bgrp_comm ) + ELSE + CALL mp_root_sum( vtmp(:,1:nc), dm, root, intra_bgrp_comm ) + END IF + + END DO + ! + END IF + ! + END DO + ! + CALL zsqmher( nbase+notcnv, dm, nx, desc ) + ! + DEALLOCATE( vtmp ) + RETURN + END SUBROUTINE update_distmat + ! + ! + ! + SUBROUTINE set_e_from_h() + INTEGER :: nc, ic, i + e(1:nbase) = 0_DP + IF( desc%myc == desc%myr .AND. la_proc ) THEN + nc = desc%nc + ic = desc%ic + DO i = 1, nc + e( i + ic - 1 ) = REAL( hl( i, i ) ) + END DO + END IF + CALL mp_sum( e(1:nbase), intra_bgrp_comm ) + RETURN + END SUBROUTINE set_e_from_h + ! + SUBROUTINE set_h_from_e() + INTEGER :: nc, ic, i + IF( la_proc ) THEN + hl = ZERO + IF( desc%myc == desc%myr ) THEN + nc = desc%nc + ic = desc%ic + DO i = 1, nc + hl(i,i) = CMPLX( e( i + ic - 1 ), 0_DP ,kind=DP) + END DO + END IF + END IF + RETURN + END SUBROUTINE set_h_from_e + ! + SUBROUTINE refresh_evc( ) + ! + INTEGER :: ipc, ipr + INTEGER :: nr, nc, ir, ic, root + COMPLEX(DP), ALLOCATABLE :: vtmp( :, : ) + COMPLEX(DP) :: beta + + ALLOCATE( vtmp( nx, nx ) ) + ! + DO ipc = 1, desc%npc + ! + nc = nrc_ip( ipc ) + ic = irc_ip( ipc ) + ! + IF( ic <= nvec ) THEN + ! + nc = min( nc, nvec - ic + 1 ) + ! + beta = ZERO + + DO ipr = 1, desc%npr + ! + nr = nrc_ip( ipr ) + ir = irc_ip( ipr ) + ! + root = rank_ip( ipr, ipc ) + + IF( ipr-1 == desc%myr .AND. ipc-1 == desc%myc .AND. la_proc ) THEN + ! + ! this proc sends his block + ! + CALL mp_bcast( vl(:,1:nc), root, intra_bgrp_comm ) + CALL ZGEMM( 'N', 'N', kdim, nc, nr, ONE, & + psi(1,1,ir), kdmx, vl, nx, beta, evc(1,1,ic), kdmx ) + ELSE + ! + ! all other procs receive + ! + CALL mp_bcast( vtmp(:,1:nc), root, intra_bgrp_comm ) + CALL ZGEMM( 'N', 'N', kdim, nc, nr, ONE, & + psi(1,1,ir), kdmx, vtmp, nx, beta, evc(1,1,ic), kdmx ) + END IF + ! + + beta = ONE + + END DO + ! + END IF + ! + END DO + ! + DEALLOCATE( vtmp ) + + RETURN + END SUBROUTINE refresh_evc + ! + ! +END SUBROUTINE pcegterg diff --git a/tests/apps/miniDFT/tests/src/cell_base.f90 b/tests/apps/miniDFT/tests/src/cell_base.f90 new file mode 100644 index 0000000000..fb27b25e61 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/cell_base.f90 @@ -0,0 +1,938 @@ +! +! Copyright (C) 2002-2011 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! + +!------------------------------------------------------------------------------! + MODULE cell_base +!------------------------------------------------------------------------------! + + USE kinds, ONLY : DP + USE constants, ONLY : pi, bohr_radius_angs + USE io_global, ONLY : stdout +! + IMPLICIT NONE + SAVE + ! + ! ibrav: index of the bravais lattice (see latgen.f90) + INTEGER :: ibrav + ! celldm: old-style parameters of the simulation cell (se latgen.f90) + REAL(DP) :: celldm(6) = (/ 0.0_DP,0.0_DP,0.0_DP,0.0_DP,0.0_DP,0.0_DP /) + ! traditional crystallographic cell parameters (alpha=cosbc and so on) + REAL(DP) :: a, b, c, cosab, cosac, cosbc + ! alat: lattice parameter - often used to scale quantities, or + ! in combination to other parameters/constants to define new units + REAL(DP) :: alat = 0.0_DP + ! omega: volume of the simulation cell + REAl(DP) :: omega = 0.0_DP + ! tpiba: 2 PI/alat, tpiba2=tpiba^2 + REAL(DP) :: tpiba = 0.0_DP, tpiba2 = 0.0_DP + ! direct and reciprocal lattice primitive vectors + ! at(:,i) are the lattice vectors of the simulation cell, a_i, + ! in alat units: a_i(:) = at(:,i)/alat + ! bg(:,i) are the reciprocal lattice vectors, b_i, + ! in tpiba=2pi/alat units: b_i(:) = bg(:,i)/tpiba + REAL(DP) :: at(3,3) = RESHAPE( (/ 0.0_DP /), (/ 3, 3 /), (/ 0.0_DP /) ) + REAL(DP) :: bg(3,3) = RESHAPE( (/ 0.0_DP /), (/ 3, 3 /), (/ 0.0_DP /) ) + ! +! ------------------------------------------------------------------------- +! ... periodicity box +! ... In the matrix "a" every row is the vector of each side of +! ... the cell in the real space + + TYPE boxdimensions + REAL(DP) :: a(3,3) ! direct lattice generators + REAL(DP) :: m1(3,3) ! reciprocal lattice generators + REAL(DP) :: omega ! cell volume = determinant of a + REAL(DP) :: g(3,3) ! metric tensor + REAL(DP) :: gvel(3,3) ! metric velocity + REAL(DP) :: pail(3,3) ! stress tensor ( scaled coor. ) + REAL(DP) :: paiu(3,3) ! stress tensor ( cartesian coor. ) + REAL(DP) :: hmat(3,3) ! cell parameters ( transpose of "a" ) + REAL(DP) :: hvel(3,3) ! cell velocity + REAL(DP) :: hinv(3,3) + REAL(DP) :: deth + INTEGER :: perd(3) + END TYPE boxdimensions + + ! The following relations should always be kept valid: + ! h = at*alat; ainv = h^(-1); ht=transpose(h) + REAL(DP) :: h(3,3) = 0.0_DP ! simulation cell at time t + REAL(DP) :: ainv(3,3) = 0.0_DP + REAL(DP) :: hold(3,3) = 0.0_DP ! simulation cell at time t-delt + REAL(DP) :: hnew(3,3) = 0.0_DP ! simulation cell at time t+delt + REAL(DP) :: velh(3,3) = 0.0_DP ! simulation cell velocity + REAL(DP) :: deth = 0.0_DP ! determinant of h ( cell volume ) + + INTEGER :: iforceh(3,3) = 1 ! if iforceh( i, j ) = 0 then h( i, j ) + ! is not allowed to move + LOGICAL :: fix_volume = .FALSE. ! True if cell volume is kept fixed + + REAL(DP) :: wmass = 0.0_DP ! cell fictitious mass + REAL(DP) :: press = 0.0_DP ! external pressure + + REAL(DP) :: frich = 0.0_DP ! friction parameter for cell damped dynamics + REAL(DP) :: greash = 1.0_DP ! greas parameter for damped dynamics + + LOGICAL :: tcell_base_init = .FALSE. + + INTERFACE cell_init + MODULE PROCEDURE cell_init_ht, cell_init_a + END INTERFACE + + INTERFACE pbcs + MODULE PROCEDURE pbcs_components, pbcs_vectors + END INTERFACE + + INTERFACE s_to_r + MODULE PROCEDURE s_to_r1, s_to_r1b, s_to_r3 + END INTERFACE + + INTERFACE r_to_s + MODULE PROCEDURE r_to_s1, r_to_s1b, r_to_s3 + END INTERFACE +!------------------------------------------------------------------------------! + CONTAINS +!------------------------------------------------------------------------------! +! + SUBROUTINE cell_base_init( ibrav_, celldm_, a_, b_, c_, cosab_, cosac_, & + cosbc_, trd_ht, rd_ht, cell_units ) + ! + ! ... initialize cell_base module variables, set up crystal lattice + ! + + IMPLICIT NONE + INTEGER, INTENT(IN) :: ibrav_ + REAL(DP), INTENT(IN) :: celldm_ (6) + LOGICAL, INTENT(IN) :: trd_ht + REAL(DP), INTENT(IN) :: rd_ht (3,3) + CHARACTER(LEN=*), INTENT(IN) :: cell_units + REAL(DP), INTENT(IN) :: a_ , b_ , c_ , cosab_, cosac_, cosbc_ + + REAL(DP) :: units + ! + IF ( ibrav_ == 0 .and. .not. trd_ht ) THEN + CALL errore('cell_base_init', 'ibrav=0: must read cell parameters', 1) + ELSE IF ( ibrav /= 0 .and. trd_ht ) THEN + CALL errore('cell_base_init', 'redundant data for cell parameters', 2) + END IF + ! + ibrav = ibrav_ + celldm = celldm_ + a = a_ ; b = b_ ; c = c_ ; cosab = cosab_ ; cosac = cosac_ ; cosbc = cosbc_ + ! + IF ( trd_ht ) THEN + ! + ! ... crystal lattice vectors read from input: find units + ! + SELECT CASE ( TRIM( cell_units ) ) + CASE ( 'bohr' ) + units = 1.0_DP + CASE ( 'angstrom' ) + units = 1.0_DP / bohr_radius_angs + CASE DEFAULT + IF( celldm( 1 ) /= 0.0_DP ) THEN + units = celldm( 1 ) + ELSE IF ( a /= 0.0_dp ) THEN + units = a / bohr_radius_angs + ELSE + units = 1.0_DP + END IF + END SELECT + ! + ! ... Beware the transpose operation between matrices ht and at! + ! + at = TRANSPOSE( rd_ht ) * units + ! + ! ... at is in atomic units: find alat, bring at to alat units, find omega + ! + IF( celldm( 1 ) /= 0.0_DP ) THEN + alat = celldm( 1 ) + ELSE IF ( a /= 0.0_dp ) THEN + alat = a / bohr_radius_angs + ELSE + alat = SQRT ( at(1,1)**2+at(2,1)**2+at(3,1)**2 ) + END IF + at(:,:) = at(:,:) / alat + CALL volume( alat, at(1,1), at(1,2), at(1,3), omega ) + ! + ELSE + ! ... crystal lattice via celldm or crystallographica parameters + ! + IF ( celldm(1) == 0.D0 .and. a /= 0.D0 ) THEN + ! + celldm(1) = a / bohr_radius_angs + celldm(2) = b / a + celldm(3) = c / a + ! + IF ( ibrav == 14 ) THEN + ! + ! ... triclinic lattice + ! + celldm(4) = cosbc + celldm(5) = cosac + celldm(6) = cosab + ! + ELSE IF ( ibrav ==-12 ) THEN + ! + ! ... monoclinic P lattice, unique axis b + ! + celldm(5) = cosac + ! + ELSE + ! + ! ... trigonal and monoclinic lattices, unique axis c + ! + celldm(4) = cosab + ! + ENDIF + ! + ELSE IF ( celldm(1) /= 0.D0 .and. a /= 0.D0 ) THEN + ! + CALL errore( 'input', 'do not specify both celldm and a,b,c!', 1 ) + ! + END IF + ! + ! ... generate at (in atomic units) from ibrav and celldm + ! + CALL latgen( ibrav, celldm, at(1,1), at(1,2), at(1,3), omega ) + ! + ! ... define lattice constants alat, divide at by alat + ! + alat = celldm(1) + at(:,:) = at(:,:) / alat + ! + END IF + ! + ! ... Generate the reciprocal lattice vectors + ! + CALL recips( at(1,1), at(1,2), at(1,3), bg(1,1), bg(1,2), bg(1,3) ) + ! + tpiba = 2.0_DP * pi / alat + tpiba2 = tpiba * tpiba + RETURN + ! + END SUBROUTINE cell_base_init + +!------------------------------------------------------------------------------! +! ... set box +! ... box%m1(i,1) == b1(i) COLUMN are B vectors +! ... box%a(1,i) == a1(i) ROW are A vector +! ... box%omega == volume +! ... box%g(i,j) == metric tensor G +!------------------------------------------------------------------------------! + + SUBROUTINE cell_init_ht( what, box, hval ) + TYPE (boxdimensions) :: box + REAL(DP), INTENT(IN) :: hval(3,3) + CHARACTER, INTENT(IN) :: what + IF( what == 't' .OR. what == 'T' ) THEN + ! hval == ht + box%a = hval + box%hmat = TRANSPOSE( hval ) + ELSE + ! hval == hmat + box%hmat = hval + box%a = TRANSPOSE( hval ) + END IF + CALL gethinv( box ) + box%g = MATMUL( box%a(:,:), box%hmat(:,:) ) + box%gvel = 0.0_DP + box%hvel = 0.0_DP + box%pail = 0.0_DP + box%paiu = 0.0_DP + RETURN + END SUBROUTINE cell_init_ht + +!------------------------------------------------------------------------------! + + SUBROUTINE cell_init_a( alat, at, box ) + TYPE (boxdimensions) :: box + REAL(DP), INTENT(IN) :: alat, at(3,3) + INTEGER :: i + DO i=1,3 + ! this is HT: the rows are the lattice vectors + box%a(1,i) = at(i,1)*alat + box%a(2,i) = at(i,2)*alat + box%a(3,i) = at(i,3)*alat + ! this is H : the column are the lattice vectors + box%hmat(i,1) = at(i,1)*alat + box%hmat(i,2) = at(i,2)*alat + box%hmat(i,3) = at(i,3)*alat + END DO + box%pail = 0.0_DP + box%paiu = 0.0_DP + box%hvel = 0.0_DP + CALL gethinv(box) + box%g = MATMUL( box%a(:,:), box%hmat(:,:) ) + box%gvel = 0.0_DP + RETURN + END SUBROUTINE cell_init_a + +!------------------------------------------------------------------------------! + + SUBROUTINE r_to_s1 (r,s,box) + REAL(DP), intent(out) :: S(3) + REAL(DP), intent(in) :: R(3) + type (boxdimensions), intent(in) :: box + integer i,j + DO I=1,3 + S(I) = 0.0_DP + DO J=1,3 + S(I) = S(I) + R(J)*box%m1(J,I) + END DO + END DO + RETURN + END SUBROUTINE r_to_s1 + +!------------------------------------------------------------------------------! + + SUBROUTINE r_to_s3 ( r, s, na, nsp, hinv ) + REAL(DP), intent(out) :: S(:,:) + INTEGER, intent(in) :: na(:), nsp + REAL(DP), intent(in) :: R(:,:) + REAL(DP), intent(in) :: hinv(:,:) ! hinv = TRANSPOSE( box%m1 ) + integer :: i, j, ia, is, isa + isa = 0 + DO is = 1, nsp + DO ia = 1, na(is) + isa = isa + 1 + DO I=1,3 + S(I,isa) = 0.0_DP + DO J=1,3 + S(I,isa) = S(I,isa) + R(J,isa)*hinv(i,j) + END DO + END DO + END DO + END DO + RETURN + END SUBROUTINE r_to_s3 + +!------------------------------------------------------------------------------! + + SUBROUTINE r_to_s1b ( r, s, hinv ) + REAL(DP), intent(out) :: S(:) + REAL(DP), intent(in) :: R(:) + REAL(DP), intent(in) :: hinv(:,:) ! hinv = TRANSPOSE( box%m1 ) + integer :: i, j + DO I=1,3 + S(I) = 0.0_DP + DO J=1,3 + S(I) = S(I) + R(J)*hinv(i,j) + END DO + END DO + RETURN + END SUBROUTINE r_to_s1b + + +!------------------------------------------------------------------------------! + + SUBROUTINE s_to_r1 (S,R,box) + REAL(DP), intent(in) :: S(3) + REAL(DP), intent(out) :: R(3) + type (boxdimensions), intent(in) :: box + integer i,j + DO I=1,3 + R(I) = 0.0_DP + DO J=1,3 + R(I) = R(I) + S(J)*box%a(J,I) + END DO + END DO + RETURN + END SUBROUTINE s_to_r1 + +!------------------------------------------------------------------------------! + + SUBROUTINE s_to_r1b (S,R,h) + REAL(DP), intent(in) :: S(3) + REAL(DP), intent(out) :: R(3) + REAL(DP), intent(in) :: h(:,:) ! h = TRANSPOSE( box%a ) + integer i,j + DO I=1,3 + R(I) = 0.0_DP + DO J=1,3 + R(I) = R(I) + S(J)*h(I,j) + END DO + END DO + RETURN + END SUBROUTINE s_to_r1b + +!------------------------------------------------------------------------------! + + SUBROUTINE s_to_r3 ( S, R, na, nsp, h ) + REAL(DP), intent(in) :: S(:,:) + INTEGER, intent(in) :: na(:), nsp + REAL(DP), intent(out) :: R(:,:) + REAL(DP), intent(in) :: h(:,:) ! h = TRANSPOSE( box%a ) + integer :: i, j, ia, is, isa + isa = 0 + DO is = 1, nsp + DO ia = 1, na(is) + isa = isa + 1 + DO I = 1, 3 + R(I,isa) = 0.0_DP + DO J = 1, 3 + R(I,isa) = R(I,isa) + S(J,isa) * h(I,j) + END DO + END DO + END DO + END DO + RETURN + END SUBROUTINE s_to_r3 + + +! +!------------------------------------------------------------------------------! +! + + SUBROUTINE gethinv(box) + IMPLICIT NONE + TYPE (boxdimensions), INTENT (INOUT) :: box + ! + CALL invmat( 3, box%a, box%m1, box%omega ) + box%deth = box%omega + box%hinv = TRANSPOSE( box%m1 ) + ! + RETURN + END SUBROUTINE gethinv + + + FUNCTION get_volume( hmat ) + IMPLICIT NONE + REAL(DP) :: get_volume + REAL(DP) :: hmat( 3, 3 ) + get_volume = hmat(1,1)*(hmat(2,2)*hmat(3,3)-hmat(2,3)*hmat(3,2)) + & + hmat(1,2)*(hmat(2,3)*hmat(3,1)-hmat(2,1)*hmat(3,3)) + & + hmat(1,3)*(hmat(2,1)*hmat(3,2)-hmat(2,2)*hmat(3,1)) + RETURN + END FUNCTION get_volume +! +!------------------------------------------------------------------------------! +! + FUNCTION pbc(rin,box,nl) RESULT (rout) + IMPLICIT NONE + TYPE (boxdimensions) :: box + REAL (DP) :: rin(3) + REAL (DP) :: rout(3), s(3) + INTEGER, OPTIONAL :: nl(3) + + s = matmul(box%hinv(:,:),rin) + s = s - box%perd*nint(s) + rout = matmul(box%hmat(:,:),s) + IF (present(nl)) THEN + s = REAL( nl, DP ) + rout = rout + matmul(box%hmat(:,:),s) + END IF + END FUNCTION pbc + +! +!------------------------------------------------------------------------------! +! + FUNCTION saw(emaxpos,eopreg,x) RESULT (sawout) + IMPLICIT NONE + REAL(DP) :: emaxpos,eopreg,x + REAL(DP) :: y, sawout, z + + z = x - emaxpos + y = z - floor(z) + + if (y.le.eopreg) then + + sawout = (0.5_DP - y/eopreg) * (1._DP-eopreg) + + else +! +! I would use: sawout = y - 0.5_DP * ( 1.0_DP + eopreg ) +! + sawout = (-0.5_DP + (y-eopreg)/(1._DP-eopreg)) * (1._DP-eopreg) + + end if + + END FUNCTION saw + +! +!------------------------------------------------------------------------------! +! + SUBROUTINE get_cell_param(box,cell,ang) + IMPLICIT NONE + TYPE(boxdimensions), INTENT(in) :: box + REAL(DP), INTENT(out), DIMENSION(3) :: cell + REAL(DP), INTENT(out), DIMENSION(3), OPTIONAL :: ang +! This code gets the cell parameters given the h-matrix: +! a + cell(1)=sqrt(box%hmat(1,1)*box%hmat(1,1)+box%hmat(2,1)*box%hmat(2,1) & + +box%hmat(3,1)*box%hmat(3,1)) +! b + cell(2)=sqrt(box%hmat(1,2)*box%hmat(1,2)+box%hmat(2,2)*box%hmat(2,2) & + +box%hmat(3,2)*box%hmat(3,2)) +! c + cell(3)=sqrt(box%hmat(1,3)*box%hmat(1,3)+box%hmat(2,3)*box%hmat(2,3) & + +box%hmat(3,3)*box%hmat(3,3)) + IF (PRESENT(ang)) THEN +! gamma + ang(1)=acos((box%hmat(1,1)*box%hmat(1,2)+ & + box%hmat(2,1)*box%hmat(2,2) & + +box%hmat(3,1)*box%hmat(3,2))/(cell(1)*cell(2))) +! beta + ang(2)=acos((box%hmat(1,1)*box%hmat(1,3)+ & + box%hmat(2,1)*box%hmat(2,3) & + +box%hmat(3,1)*box%hmat(3,3))/(cell(1)*cell(3))) +! alpha + ang(3)=acos((box%hmat(1,2)*box%hmat(1,3)+ & + box%hmat(2,2)*box%hmat(2,3) & + +box%hmat(3,2)*box%hmat(3,3))/(cell(2)*cell(3))) +! ang=ang*180.0_DP/pi + + ENDIF + END SUBROUTINE get_cell_param + +!------------------------------------------------------------------------------! + + SUBROUTINE pbcs_components(x1, y1, z1, x2, y2, z2, m) +! ... This subroutine compute the periodic boundary conditions in the scaled +! ... variables system + USE kinds + INTEGER, INTENT(IN) :: M + REAL(DP), INTENT(IN) :: X1,Y1,Z1 + REAL(DP), INTENT(OUT) :: X2,Y2,Z2 + REAL(DP) MIC + MIC = REAL( M, DP ) + X2 = X1 - DNINT(X1/MIC)*MIC + Y2 = Y1 - DNINT(Y1/MIC)*MIC + Z2 = Z1 - DNINT(Z1/MIC)*MIC + RETURN + END SUBROUTINE pbcs_components + +!------------------------------------------------------------------------------! + + SUBROUTINE pbcs_vectors(v, w, m) +! ... This subroutine compute the periodic boundary conditions in the scaled +! ... variables system + USE kinds + INTEGER, INTENT(IN) :: m + REAL(DP), INTENT(IN) :: v(3) + REAL(DP), INTENT(OUT) :: w(3) + REAL(DP) :: MIC + MIC = REAL( M, DP ) + w(1) = v(1) - DNINT(v(1)/MIC)*MIC + w(2) = v(2) - DNINT(v(2)/MIC)*MIC + w(3) = v(3) - DNINT(v(3)/MIC)*MIC + RETURN + END SUBROUTINE pbcs_vectors + +!------------------------------------------------------------------------------! + + SUBROUTINE cell_dyn_init( trd_ht, rd_ht, wc_ , total_ions_mass , press_ , & + frich_ , greash_ , cell_dofree ) + + USE constants, ONLY: au_gpa, amu_au + USE io_global, ONLY: stdout + + IMPLICIT NONE + CHARACTER(LEN=*), INTENT(IN) :: cell_dofree + LOGICAL, INTENT(IN) :: trd_ht + REAL(DP), INTENT(IN) :: rd_ht (3,3) + REAL(DP), INTENT(IN) :: wc_ , frich_ , greash_ , total_ions_mass + REAL(DP), INTENT(IN) :: press_ ! external pressure from input + ! ( in KBar = 0.1 GPa ) + INTEGER :: i,j + ! + press = press_ / 10.0_DP ! convert press in KBar to GPa + press = press / au_gpa ! convert to AU + ! frich = frich_ ! for the time being this is set elsewhere + greash = greash_ + + WRITE( stdout, 105 ) + WRITE( stdout, 110 ) press_ +105 format(/,3X,'Simulation Cell Parameters (from input)') +110 format( 3X,'external pressure = ',f15.2,' [KBar]') + + wmass = wc_ + IF( wmass == 0.0_DP ) THEN + wmass = 3.0_DP / (4.0_DP * pi**2 ) * total_ions_mass + wmass = wmass * AMU_AU + WRITE( stdout,130) wmass + ELSE + WRITE( stdout,120) wmass + END IF +120 format(3X,'wmass (read from input) = ',f15.2,' [AU]') +130 format(3X,'wmass (calculated) = ',f15.2,' [AU]') + + IF( wmass <= 0.0_DP ) & + CALL errore(' cell_dyn_init',' wmass out of range ',0) + + IF ( trd_ht ) THEN + ! + WRITE( stdout, 210 ) + WRITE( stdout, 220 ) ( rd_ht( 1, j ), j = 1, 3 ) + WRITE( stdout, 220 ) ( rd_ht( 2, j ), j = 1, 3 ) + WRITE( stdout, 220 ) ( rd_ht( 3, j ), j = 1, 3 ) + ! +210 format(3X,'initial cell from CELL_PARAMETERS card') +220 format(3X,3F14.8) + ! + END IF + ! + ainv(1,:) = bg(:,1)/alat + ainv(2,:) = bg(:,2)/alat + ainv(3,:) = bg(:,3)/alat + ! + CALL init_dofree ( cell_dofree ) + ! + tcell_base_init = .TRUE. + + WRITE( stdout, 300 ) ibrav + WRITE( stdout, 305 ) alat + WRITE( stdout, 310 ) at(:,1)*alat + WRITE( stdout, 320 ) at(:,2)*alat + WRITE( stdout, 330 ) at(:,3)*alat + WRITE( stdout, * ) + WRITE( stdout, 350 ) bg(:,1)/alat + WRITE( stdout, 360 ) bg(:,2)/alat + WRITE( stdout, 370 ) bg(:,3)/alat + WRITE( stdout, 340 ) omega +300 FORMAT( 3X, 'ibrav = ',I4) +305 FORMAT( 3X, 'alat = ',F14.8) +310 FORMAT( 3X, 'a1 = ',3F14.8) +320 FORMAT( 3X, 'a2 = ',3F14.8) +330 FORMAT( 3X, 'a3 = ',3F14.8) +350 FORMAT( 3X, 'b1 = ',3F14.8) +360 FORMAT( 3X, 'b2 = ',3F14.8) +370 FORMAT( 3X, 'b3 = ',3F14.8) +340 FORMAT( 3X, 'omega = ',F16.8) + + + RETURN + END SUBROUTINE cell_dyn_init + +!------------------------------------------------------------------------------! + SUBROUTINE init_dofree ( cell_dofree ) + + ! set constraints on cell dynamics/optimization + + CHARACTER(LEN=*), INTENT(IN) :: cell_dofree + + SELECT CASE ( TRIM( cell_dofree ) ) + + CASE ( 'all', 'default' ) + iforceh = 1 + CASE ( 'shape' ) + iforceh = 1 + fix_volume = .true. + CASE ( 'volume' ) + CALL errore(' init_dofree ', & + ' cell_dofree = '//TRIM(cell_dofree)//' not yet implemented ', 1 ) + CASE ('x') + iforceh = 0 + iforceh(1,1) = 1 + CASE ('y') + iforceh = 0 + iforceh(2,2) = 1 + CASE ('z') + iforceh = 0 + iforceh(3,3) = 1 + CASE ('xy') + iforceh = 0 + iforceh(1,1) = 1 + iforceh(2,2) = 1 + ! ... if you want the entire xy plane to be free, uncomment: + ! iforceh(1,2) = 1 + ! iforceh(2,1) = 1 + CASE ('xz') + iforceh = 0 + iforceh(1,1) = 1 + iforceh(3,3) = 1 + CASE ('yz') + iforceh = 0 + iforceh(2,2) = 1 + iforceh(3,3) = 1 + CASE ('xyz') + iforceh = 0 + iforceh(1,1) = 1 + iforceh(2,2) = 1 + iforceh(3,3) = 1 + CASE DEFAULT + CALL errore(' init_dofree ',' unknown cell_dofree '//TRIM(cell_dofree), 1 ) + + END SELECT + END SUBROUTINE init_dofree + +!------------------------------------------------------------------------------! + + SUBROUTINE cell_base_reinit( ht ) + + USE control_flags, ONLY: iverbosity + + IMPLICIT NONE + REAL(DP), INTENT(IN) :: ht (3,3) + + INTEGER :: j + + alat = sqrt( ht(1,1)*ht(1,1) + ht(1,2)*ht(1,2) + ht(1,3)*ht(1,3) ) + tpiba = 2.0_DP * pi / alat + tpiba2 = tpiba * tpiba + ! + IF( iverbosity > 3 ) THEN + WRITE( stdout, 210 ) + WRITE( stdout, 220 ) ( ht( 1, j ), j = 1, 3 ) + WRITE( stdout, 220 ) ( ht( 2, j ), j = 1, 3 ) + WRITE( stdout, 220 ) ( ht( 3, j ), j = 1, 3 ) + END IF +210 format(3X,'Simulation cell parameters with the new cell:') +220 format(3X,3F14.8) + + ! matrix "ht" used in CP is the transpose of matrix "at" + ! times the lattice parameter "alat"; matrix "ainv" is "bg" divided alat + ! + at = TRANSPOSE( ht ) / alat + ! + CALL recips( at(1,1), at(1,2), at(1,3), bg(1,1), bg(1,2), bg(1,3) ) + CALL volume( alat, at(1,1), at(1,2), at(1,3), deth ) + omega = deth + ! + ainv(1,:) = bg(:,1)/alat + ainv(2,:) = bg(:,2)/alat + ainv(3,:) = bg(:,3)/alat + ! + IF( iverbosity > 3 ) THEN + WRITE( stdout, 305 ) alat + WRITE( stdout, 310 ) at(:,1)*alat + WRITE( stdout, 320 ) at(:,2)*alat + WRITE( stdout, 330 ) at(:,3)*alat + WRITE( stdout, * ) + WRITE( stdout, 350 ) bg(:,1)/alat + WRITE( stdout, 360 ) bg(:,2)/alat + WRITE( stdout, 370 ) bg(:,3)/alat + WRITE( stdout, 340 ) omega + END IF + +300 FORMAT( 3X, 'ibrav = ',I4) +305 FORMAT( 3X, 'alat = ',F14.8) +310 FORMAT( 3X, 'a1 = ',3F14.8) +320 FORMAT( 3X, 'a2 = ',3F14.8) +330 FORMAT( 3X, 'a3 = ',3F14.8) +350 FORMAT( 3X, 'b1 = ',3F14.8) +360 FORMAT( 3X, 'b2 = ',3F14.8) +370 FORMAT( 3X, 'b3 = ',3F14.8) +340 FORMAT( 3X, 'omega = ',F14.8) + + + RETURN + END SUBROUTINE cell_base_reinit + + + +!------------------------------------------------------------------------------! + + SUBROUTINE cell_steepest( hnew, h, delt, iforceh, fcell ) + REAL(DP), INTENT(OUT) :: hnew(3,3) + REAL(DP), INTENT(IN) :: h(3,3), fcell(3,3) + INTEGER, INTENT(IN) :: iforceh(3,3) + REAL(DP), INTENT(IN) :: delt + INTEGER :: i, j + REAL(DP) :: dt2 + dt2 = delt * delt + DO j=1,3 + DO i=1,3 + hnew(i,j) = h(i,j) + dt2 * fcell(i,j) * REAL( iforceh(i,j), DP ) + ENDDO + ENDDO + RETURN + END SUBROUTINE cell_steepest + + +!------------------------------------------------------------------------------! + + SUBROUTINE cell_verlet( hnew, h, hold, delt, iforceh, fcell, frich, tnoseh, hnos ) + REAL(DP), INTENT(OUT) :: hnew(3,3) + REAL(DP), INTENT(IN) :: h(3,3), hold(3,3), hnos(3,3), fcell(3,3) + INTEGER, INTENT(IN) :: iforceh(3,3) + REAL(DP), INTENT(IN) :: frich, delt + LOGICAL, INTENT(IN) :: tnoseh + + REAL(DP) :: htmp(3,3) + REAL(DP) :: verl1, verl2, verl3, dt2, ftmp, v1, v2, v3 + INTEGER :: i, j + + dt2 = delt * delt + + IF( tnoseh ) THEN + ftmp = 0.0_DP + htmp = hnos + ELSE + ftmp = frich + htmp = 0.0_DP + END IF + + verl1 = 2.0_DP / ( 1.0_DP + ftmp ) + verl2 = 1.0_DP - verl1 + verl3 = dt2 / ( 1.0_DP + ftmp ) + verl1 = verl1 - 1.0_DP + + + DO j=1,3 + DO i=1,3 + v1 = verl1 * h(i,j) + v2 = verl2 * hold(i,j) + v3 = verl3 * ( fcell(i,j) - htmp(i,j) ) + hnew(i,j) = h(i,j) + ( v1 + v2 + v3 ) * REAL( iforceh(i,j), DP ) + ENDDO + ENDDO + RETURN + END SUBROUTINE cell_verlet + +!------------------------------------------------------------------------------! + + subroutine cell_hmove( h, hold, delt, iforceh, fcell ) + REAL(DP), intent(out) :: h(3,3) + REAL(DP), intent(in) :: hold(3,3), fcell(3,3) + REAL(DP), intent(in) :: delt + integer, intent(in) :: iforceh(3,3) + REAL(DP) :: dt2by2, fac + integer :: i, j + dt2by2 = 0.5_DP * delt * delt + fac = dt2by2 + do i=1,3 + do j=1,3 + h(i,j) = hold(i,j) + fac * iforceh(i,j) * fcell(i,j) + end do + end do + return + end subroutine cell_hmove + +!------------------------------------------------------------------------------! + + subroutine cell_force( fcell, ainv, stress, omega, press, wmassIN ) + USE constants, ONLY : eps8 + REAL(DP), intent(out) :: fcell(3,3) + REAL(DP), intent(in) :: stress(3,3), ainv(3,3) + REAL(DP), intent(in) :: omega, press + REAL(DP), intent(in), optional :: wmassIN + integer :: i, j + REAL(DP) :: wmass + IF (.not. present(wmassIN)) THEN + wmass = 1.0 + ELSE + wmass = wmassIN + END IF + do j=1,3 + do i=1,3 + fcell(i,j) = ainv(j,1)*stress(i,1) + ainv(j,2)*stress(i,2) + ainv(j,3)*stress(i,3) + end do + end do + do j=1,3 + do i=1,3 + fcell(i,j) = fcell(i,j) - ainv(j,i) * press + end do + end do + IF( wmass < eps8 ) & + CALL errore( ' movecell ',' cell mass is less than 0 ! ', 1 ) + fcell = omega * fcell / wmass + return + end subroutine cell_force + +!------------------------------------------------------------------------------! + + subroutine cell_move( hnew, h, hold, delt, iforceh, fcell, frich, tnoseh, vnhh, velh, tsdc ) + REAL(DP), intent(out) :: hnew(3,3) + REAL(DP), intent(in) :: h(3,3), hold(3,3), fcell(3,3) + REAL(DP), intent(in) :: vnhh(3,3), velh(3,3) + integer, intent(in) :: iforceh(3,3) + REAL(DP), intent(in) :: frich, delt + logical, intent(in) :: tnoseh, tsdc + + REAL(DP) :: hnos(3,3) + + hnew = 0.0 + + if( tnoseh ) then + hnos = vnhh * velh + else + hnos = 0.0_DP + end if +! + IF( tsdc ) THEN + call cell_steepest( hnew, h, delt, iforceh, fcell ) + ELSE + call cell_verlet( hnew, h, hold, delt, iforceh, fcell, frich, tnoseh, hnos ) + END IF + + return + end subroutine cell_move + +!------------------------------------------------------------------------------! + + SUBROUTINE cell_gamma( hgamma, ainv, h, velh ) + ! + ! Compute hgamma = g^-1 * dg/dt + ! that enters in the ions equation of motion + ! + IMPLICIT NONE + REAL(DP), INTENT(OUT) :: hgamma(3,3) + REAL(DP), INTENT(IN) :: ainv(3,3), h(3,3), velh(3,3) + REAL(DP) :: gm1(3,3), gdot(3,3) + ! + ! g^-1 inverse of metric tensor = (ht*h)^-1 = ht^-1 * h^-1 + ! + gm1 = MATMUL( ainv, TRANSPOSE( ainv ) ) + ! + ! dg/dt = d(ht*h)/dt = dht/dt*h + ht*dh/dt ! derivative of metrix tensor + ! + gdot = MATMUL( TRANSPOSE( velh ), h ) + MATMUL( TRANSPOSE( h ), velh ) + ! + hgamma = MATMUL( gm1, gdot ) + ! + RETURN + END SUBROUTINE cell_gamma + +!------------------------------------------------------------------------------! + + SUBROUTINE cell_update_vel( htp, ht0, htm, delt, velh ) + ! + IMPLICIT NONE + TYPE (boxdimensions) :: htp, ht0, htm + REAL(DP), INTENT(IN) :: delt + REAL(DP), INTENT(OUT) :: velh( 3, 3 ) + + velh(:,:) = ( htp%hmat(:,:) - htm%hmat(:,:) ) / ( 2.0d0 * delt ) + htp%gvel = ( htp%g(:,:) - htm%g(:,:) ) / ( 2.0d0 * delt ) + ht0%hvel = velh + + RETURN + END SUBROUTINE cell_update_vel + + +!------------------------------------------------------------------------------! + + subroutine cell_kinene( ekinh, temphh, velh ) + use constants, only: k_boltzmann_au + implicit none + REAL(DP), intent(out) :: ekinh, temphh(3,3) + REAL(DP), intent(in) :: velh(3,3) + integer :: i,j + ekinh = 0.0_DP + do j=1,3 + do i=1,3 + ekinh = ekinh + 0.5_DP*wmass*velh(i,j)*velh(i,j) + temphh(i,j) = wmass*velh(i,j)*velh(i,j)/k_boltzmann_au + end do + end do + return + end subroutine cell_kinene + +!------------------------------------------------------------------------------! + + function cell_alat( ) + real(DP) :: cell_alat + if( .NOT. tcell_base_init ) & + call errore( ' cell_alat ', ' alat has not been set ', 1 ) + cell_alat = alat + return + end function cell_alat +! +!------------------------------------------------------------------------------! + END MODULE cell_base +!------------------------------------------------------------------------------! diff --git a/tests/apps/miniDFT/tests/src/check_stop.f90 b/tests/apps/miniDFT/tests/src/check_stop.f90 new file mode 100644 index 0000000000..7ba344064c --- /dev/null +++ b/tests/apps/miniDFT/tests/src/check_stop.f90 @@ -0,0 +1,167 @@ +! +! Copyright (C) 2002-2010 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +! ... This module contains functions to check if the code should +! ... be smoothly stopped. +! ... In particular the function check_stop_now returns .TRUE. if +! ... either the user has created a given file or if the +! ... elapsed time is larger than max_seconds +! +!------------------------------------------------------------------------------! +MODULE check_stop +!------------------------------------------------------------------------------! + ! + USE kinds + ! + IMPLICIT NONE + ! + SAVE + ! + REAL(DP) :: max_seconds = 1.E+7_DP + ! + LOGICAL, PRIVATE :: tinit = .FALSE. + ! + REAL(DP) :: init_second + ! + CONTAINS + ! + ! ... internal procedures + ! + !----------------------------------------------------------------------- + SUBROUTINE check_stop_init() + !----------------------------------------------------------------------- + ! + USE input_parameters, ONLY : max_seconds_ => max_seconds + USE io_global, ONLY : stdout + USE io_files, ONLY : prefix, exit_file +#if defined __TRAP_SIGUSR1 + USE set_signal, ONLY : signal_trap_init +#endif + + ! + IMPLICIT NONE + ! + REAL(DP), EXTERNAL :: cclock + ! + IF ( tinit ) & + WRITE( UNIT = stdout, & + FMT = '(/,5X,"WARNING: check_stop already initialized")' ) + ! + ! ... the exit_file name is set here + ! + exit_file = TRIM( prefix ) // '.EXIT' + ! + IF ( max_seconds_ > 0.0_DP ) max_seconds = max_seconds_ + ! + init_second = cclock() + tinit = .TRUE. + ! +#if defined __TRAP_SIGUSR1 + CALL signal_trap_init ( ) +#endif + ! + RETURN + ! + END SUBROUTINE check_stop_init + ! + !----------------------------------------------------------------------- + FUNCTION check_stop_now( inunit ) + !----------------------------------------------------------------------- + ! + USE mp, ONLY : mp_bcast + USE mp_global, ONLY : intra_image_comm + USE io_global, ONLY : ionode, ionode_id, meta_ionode, stdout + USE io_files, ONLY : exit_file, iunexit +#if defined __TRAP_SIGUSR1 + USE set_signal, ONLY : signal_detected +#endif + ! KNK_image + ! USE mp_global, ONLY : mpime, root, world_comm + ! + IMPLICIT NONE + ! + INTEGER, OPTIONAL, INTENT(IN) :: inunit + ! + INTEGER :: unit + LOGICAL :: check_stop_now, tex + LOGICAL :: signaled + REAL(DP) :: seconds + REAL(DP), EXTERNAL :: cclock + ! + ! + ! ... cclock is a C function returning the elapsed solar + ! ... time in seconds since the Epoch ( 00:00:00 1/1/1970 ) + ! + IF ( .NOT. tinit ) & + CALL errore( 'check_stop_now', 'check_stop not initialized', 1 ) + ! + unit = stdout + IF ( PRESENT( inunit ) ) unit = inunit + ! + check_stop_now = .FALSE. + ! + signaled = .FALSE. + ! + ! KNK_image + ! IF ( mpime == root ) THEN + IF ( ionode ) THEN + ! + INQUIRE( FILE = TRIM( exit_file ), EXIST = tex ) + ! + IF ( tex ) THEN + ! + check_stop_now = .TRUE. + ! + OPEN( UNIT = iunexit, FILE = TRIM( exit_file ) ) + CLOSE( UNIT = iunexit, STATUS = 'DELETE' ) + ! + ELSE + ! + seconds = cclock() - init_second + ! + check_stop_now = ( seconds > max_seconds ) + ! + END IF + ! + END IF + ! +#if defined __TRAP_SIGUSR1 + signaled = signal_detected() + check_stop_now = check_stop_now .OR. signaled + tex = tex .OR. signaled +#endif + ! + ! KNK_image + ! CALL mp_bcast( check_stop_now, root, world_comm ) + CALL mp_bcast( check_stop_now, ionode_id, intra_image_comm ) + ! + IF ( check_stop_now .AND. meta_ionode ) THEN + ! + IF ( tex ) THEN + ! + WRITE( UNIT = unit, & + FMT = '(/,5X,"Program stopped by user request")' ) + ! + ELSE + ! + WRITE( UNIT = unit, & + FMT = '(/,5X,"Maximum CPU time exceeded")' ) + WRITE( UNIT = unit, & + FMT = '(/,5X,"max_seconds = ",F10.2)' ) max_seconds + WRITE( UNIT = unit, & + FMT = '(5X,"elapsed seconds = ",F10.2)' ) seconds + ! + END IF + ! + END IF + ! + RETURN + ! + END FUNCTION check_stop_now + ! +END MODULE check_stop diff --git a/tests/apps/miniDFT/tests/src/clean_pw.f90 b/tests/apps/miniDFT/tests/src/clean_pw.f90 new file mode 100644 index 0000000000..0962e580e8 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/clean_pw.f90 @@ -0,0 +1,166 @@ + +! Copyright (C) 2001-2012 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +!---------------------------------------------------------------------- +SUBROUTINE clean_pw( lflag ) + !---------------------------------------------------------------------- + ! + ! ... This routine deallocates dynamically allocated arrays + ! ... if lflag=.TRUE. all arrays are deallocated (end of calculation) + ! ... if lflag=.FALSE. ion-related variables and arrays allocated + ! ... at the very beginning of the calculation (routines iosys, read_file, + ! ... setup, read_pseudo) are not deallocated; all others arrayes are. + ! ... This is used when a new calculation has to be performed (e.g. in neb, + ! ... phonon, vc-relax). Beware: the new calculation should not call any + ! ... of the routines mentioned above + ! + USE ions_base, ONLY : deallocate_ions_base + USE gvect, ONLY : g, gg, gl, nl, nlm, igtongl, mill, & + eigts1, eigts2, eigts3 + USE gvecs, ONLY : nls, nlsm + USE fixed_occ, ONLY : f_inp + USE ktetra, ONLY : tetra + USE klist, ONLY : ngk + USE gvect, ONLY : ig_l2g + USE vlocal, ONLY : strf, vloc + USE wvfct, ONLY : igk, g2kin, et, wg, btype + USE force_mod, ONLY : force + USE scf, ONLY : rho, v, vltot, rho_core, rhog_core, & + vrs, kedtau, destroy_scf_type, vnew + USE symm_base, ONLY : irt + USE symme, ONLY : sym_rho_deallocate + USE wavefunctions_module, ONLY : evc, psic, psic_nc + USE us, ONLY : qrad, tab, tab_at, tab_d2y, spline_ps + USE uspp, ONLY : deallocate_uspp + USE uspp_param, ONLY : upf + USE extfield, ONLY : forcefield + USE fft_base, ONLY : dfftp, dffts + USE stick_base, ONLY : sticks_deallocate + USE fft_types, ONLY : fft_dlay_deallocate + USE spin_orb, ONLY : lspinorb, fcoef + USE atom, ONLY : msh, rgrid + USE radial_grids, ONLY : deallocate_radial_grid + ! + USE pseudo_types, ONLY : deallocate_pseudo_upf + ! + IMPLICIT NONE + ! + LOGICAL, INTENT(IN) :: lflag + ! + INTEGER :: nt + ! + IF ( lflag ) THEN + ! + ! ... arrays allocated at the very beginning of the calculation + ! + IF( ALLOCATED( upf ) ) THEN + DO nt = 1, SIZE( upf ) + CALL deallocate_pseudo_upf( upf( nt ) ) + END DO + DEALLOCATE( upf ) + END IF + DEALLOCATE (msh) + CALL deallocate_radial_grid(rgrid) + ! + CALL deallocate_ions_base() + ! + IF ( ALLOCATED( force ) ) DEALLOCATE( force ) + IF ( ALLOCATED( forcefield ) ) DEALLOCATE( forcefield ) + IF ( ALLOCATED (irt) ) DEALLOCATE (irt) + ! + ! + END IF + ! + IF ( ALLOCATED( f_inp ) ) DEALLOCATE( f_inp ) + IF ( ALLOCATED( tetra ) ) DEALLOCATE( tetra ) + ! + ! ... arrays allocated in ggen.f90 + ! + IF ( ALLOCATED( ig_l2g ) ) DEALLOCATE( ig_l2g ) + IF ( ASSOCIATED( gl ) ) DEALLOCATE ( gl ) + ! + CALL sym_rho_deallocate ( ) + ! + ! ... arrays allocated in allocate_fft.f90 ( and never deallocated ) + ! + IF ( ALLOCATED( g ) ) DEALLOCATE( g ) + IF ( ALLOCATED( gg ) ) DEALLOCATE( gg ) + IF ( ALLOCATED( nl ) ) DEALLOCATE( nl ) + IF ( ALLOCATED( nlm ) ) DEALLOCATE( nlm ) + IF ( ALLOCATED( igtongl ) ) DEALLOCATE( igtongl ) + IF ( ALLOCATED( mill ) ) DEALLOCATE( mill ) + call destroy_scf_type(rho) + call destroy_scf_type(v) + call destroy_scf_type(vnew) + IF ( ALLOCATED( kedtau ) ) DEALLOCATE( kedtau ) + IF ( ALLOCATED( vltot ) ) DEALLOCATE( vltot ) + IF ( ALLOCATED( rho_core ) ) DEALLOCATE( rho_core ) + IF ( ALLOCATED( rhog_core ) ) DEALLOCATE( rhog_core ) + IF ( ALLOCATED( psic ) ) DEALLOCATE( psic ) + IF ( ALLOCATED( psic_nc ) ) DEALLOCATE( psic_nc ) + IF ( ALLOCATED( vrs ) ) DEALLOCATE( vrs ) + if (spline_ps) then + IF ( ALLOCATED( tab_d2y) ) DEALLOCATE( tab_d2y ) + endif + IF ( ALLOCATED( nls ) ) DEALLOCATE( nls ) + IF ( ALLOCATED( nlsm ) ) DEALLOCATE( nlsm ) + ! + ! ... arrays allocated in allocate_locpot.f90 ( and never deallocated ) + ! + IF ( ALLOCATED( vloc ) ) DEALLOCATE( vloc ) + IF ( ALLOCATED( strf ) ) DEALLOCATE( strf ) + IF ( ALLOCATED( eigts1 ) ) DEALLOCATE( eigts1 ) + IF ( ALLOCATED( eigts2 ) ) DEALLOCATE( eigts2 ) + IF ( ALLOCATED( eigts3 ) ) DEALLOCATE( eigts3 ) + ! + ! ... arrays allocated in allocate_nlpot.f90 ( and never deallocated ) + ! + IF ( ALLOCATED( ngk ) ) DEALLOCATE( ngk ) + IF ( ALLOCATED( igk ) ) DEALLOCATE( igk ) + IF ( ALLOCATED( g2kin ) ) DEALLOCATE( g2kin ) + IF ( ALLOCATED( qrad ) ) DEALLOCATE( qrad ) + IF ( ALLOCATED( tab ) ) DEALLOCATE( tab ) + IF ( ALLOCATED( tab_at ) ) DEALLOCATE( tab_at ) + IF ( lspinorb ) THEN + IF ( ALLOCATED( fcoef ) ) DEALLOCATE( fcoef ) + END IF + ! + CALL deallocate_uspp() + ! + ! ... arrays allocated in init_run.f90 ( and never deallocated ) + ! + IF ( ALLOCATED( et ) ) DEALLOCATE( et ) + IF ( ALLOCATED( wg ) ) DEALLOCATE( wg ) + IF ( ALLOCATED( btype ) ) DEALLOCATE( btype ) + ! + ! ... arrays allocated in allocate_wfc.f90 ( and never deallocated ) + ! + IF ( ALLOCATED( evc ) ) DEALLOCATE( evc ) + ! + ! ... fft structures allocated in data_structure.f90 + ! + CALL fft_dlay_deallocate( dfftp ) + CALL fft_dlay_deallocate( dffts ) + ! + ! ... stick-owner matrix allocated in sticks_base + ! + CALL sticks_deallocate() + ! + ! ... arrays allocated for dynamics + ! + ! + ! ... additional arrays for PAW + ! + ! + ! ... arrays for real-space algorithm + ! + ! + ! + ! + RETURN + ! +END SUBROUTINE clean_pw diff --git a/tests/apps/miniDFT/tests/src/clocks.f90 b/tests/apps/miniDFT/tests/src/clocks.f90 new file mode 100644 index 0000000000..f3b84076ff --- /dev/null +++ b/tests/apps/miniDFT/tests/src/clocks.f90 @@ -0,0 +1,480 @@ +! +! Copyright (C) 2001-2007 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! ... Time-printing utilities - Contains the following subroutines: +! init_clocks( go ) initialization - must be called first +! go = .TRUE. : up to "maxclock" clocks can be started +! go = .FALSE.: only clock #1 can be started +! start_clock( label ) starts clock "label" (max 14 characters) +! if "label" has never been started, initializes it +! issues warning if "label" already started +! stop_clock( label ) stops clock "label" +! issues warning if "label" is either not running +! or has never been started +! print_clock( label ) print cpu and wall time measured by clock "label" +! clock "label" may be running or stopped +! and remains in the same state +! issues warning if "label" has never been started +! ... and the following function (real(kind=dp): +! get_clock( label ) return wall time measured by clock "label" +! returns -1 if "label" has never been started +! ... All output and warnings are written to stdout +! ... Clocks should be started, read, stopped either on all processors, or +! ... only on one, but not half and half! For parallel debugging, uncomment: +!#define __TRACE +! ... See also comments in subroutine print_this_clock about parallel case +! +!---------------------------------------------------------------------------- +MODULE mytime + !---------------------------------------------------------------------------- + ! + USE kinds, ONLY : DP + ! + IMPLICIT NONE + ! + SAVE + ! + INTEGER, PARAMETER :: maxclock = 100 + REAL(DP), PARAMETER :: notrunning = - 1.0_DP + ! + REAL(DP) :: cputime(maxclock), t0cpu(maxclock) + REAL(DP) :: walltime(maxclock), t0wall(maxclock) + CHARACTER(len=14) :: clock_label(maxclock) + INTEGER :: called(maxclock) + ! + INTEGER :: nclock = 0 + LOGICAL :: no + INTEGER :: trace_depth = 0 + ! +END MODULE mytime +! +!---------------------------------------------------------------------------- +SUBROUTINE init_clocks( go ) + !---------------------------------------------------------------------------- + ! + ! ... go = .TRUE. : clocks will run + ! ... go = .FALSE. : only clock #1 will run + ! + USE kinds, ONLY : DP + USE mytime, ONLY : called, t0cpu, cputime, no, notrunning, maxclock, & + clock_label, walltime, t0wall + ! + IMPLICIT NONE + ! + LOGICAL :: go + INTEGER :: n + ! + ! + no = .not. go + ! + DO n = 1, maxclock + ! + called(n) = 0 + cputime(n) = 0.0_DP + t0cpu(n) = notrunning + walltime(n) = 0.0_DP + t0wall(n) = notrunning + clock_label(n) = ' ' + ! + ENDDO + ! + RETURN + ! +END SUBROUTINE init_clocks +! +!---------------------------------------------------------------------------- +SUBROUTINE start_clock( label ) + !---------------------------------------------------------------------------- + ! + USE kinds, ONLY : DP + USE io_global, ONLY : stdout +#if defined (__TRACE) + USE mp_global, ONLY : mpime +#endif + USE mytime, ONLY : nclock, clock_label, notrunning, no, maxclock, & + t0cpu, t0wall, trace_depth + ! + IMPLICIT NONE + ! + CHARACTER(len=*) :: label + ! + CHARACTER(len=14) :: label_ + INTEGER :: n + REAL(DP), EXTERNAL :: scnds, cclock + ! +#if defined (__TRACE) + WRITE( stdout, '("mpime = ",I2,", TRACE (depth=",I2,") Start: ",A14)') mpime, trace_depth, label + trace_depth = trace_depth + 1 +#endif + ! + IF ( no .and. ( nclock == 1 ) ) RETURN + ! + ! ... prevent trouble if label is longer than 14 characters + ! + label_ = trim ( label ) + ! + DO n = 1, nclock + ! + IF ( clock_label(n) == label_ ) THEN + ! + ! ... found previously defined clock: check if not already started, + ! ... store in t0cpu the starting time + ! + IF ( t0cpu(n) /= notrunning ) THEN +! WRITE( stdout, '("start_clock: clock # ",I2," for ",A14, & +! & " already started")' ) n, label_ + ELSE + t0cpu(n) = scnds() + t0wall(n) = cclock() + ENDIF + ! + RETURN + ! + ENDIF + ! + ENDDO + ! + ! ... clock not found : add new clock for given label + ! + IF ( nclock == maxclock ) THEN + ! + WRITE( stdout, '("start_clock: Too many clocks! call ignored")' ) + ! + ELSE + ! + nclock = nclock + 1 + clock_label(nclock) = label_ + t0cpu(nclock) = scnds() + t0wall(nclock) = cclock() + ! + ENDIF + ! + RETURN + ! +END SUBROUTINE start_clock +! +!---------------------------------------------------------------------------- +SUBROUTINE stop_clock( label ) + !---------------------------------------------------------------------------- + ! + USE kinds, ONLY : DP + USE io_global, ONLY : stdout +#if defined (__TRACE) + USE mp_global, ONLY : mpime +#endif + USE mytime, ONLY : no, nclock, clock_label, cputime, walltime, & + notrunning, called, t0cpu, t0wall, trace_depth + ! + IMPLICIT NONE + ! + CHARACTER(len=*) :: label + ! + CHARACTER(len=14) :: label_ + INTEGER :: n + REAL(DP), EXTERNAL :: scnds, cclock + ! +#if defined (__TRACE) + trace_depth = trace_depth - 1 + WRITE( *, '("mpime = ",I2,", TRACE (depth=",I2,") End: ",A14)') mpime, trace_depth, label +#endif + ! + IF ( no ) RETURN + ! + ! ... prevent trouble if label is longer than 14 characters + ! + label_ = trim ( label ) + ! + DO n = 1, nclock + ! + IF ( clock_label(n) == label_ ) THEN + ! + ! ... found previously defined clock : check if properly initialised, + ! ... add elapsed time, increase the counter of calls + ! + IF ( t0cpu(n) == notrunning ) THEN + ! + WRITE( stdout, '("stop_clock: clock # ",I2," for ",A14, & + & " not running")' ) n, label + ! + ELSE + ! + cputime(n) = cputime(n) + scnds() - t0cpu(n) + walltime(n) = walltime(n) + cclock() - t0wall(n) + t0cpu(n) = notrunning + t0wall(n) = notrunning + called(n) = called(n) + 1 + ! + ENDIF + ! + RETURN + ! + ENDIF + ! + ENDDO + ! + ! ... clock not found + ! + WRITE( stdout, '("stop_clock: no clock for ",A14," found !")' ) label + ! + RETURN + ! +END SUBROUTINE stop_clock +! +!---------------------------------------------------------------------------- +SUBROUTINE print_clock( label ) + !---------------------------------------------------------------------------- + ! + USE kinds, ONLY : DP + USE io_global, ONLY : stdout + USE mytime, ONLY : nclock, clock_label + ! + IMPLICIT NONE + ! + CHARACTER(len=*) :: label + ! + CHARACTER(len=14) :: label_ + INTEGER :: n + ! + IF ( label == ' ' ) THEN + ! + WRITE( stdout, * ) + ! + DO n = 1, nclock + ! + CALL print_this_clock( n ) + ! + ENDDO + ! + ELSE + ! + ! ... prevent trouble if label is longer than 14 characters + ! + label_ = trim ( label ) + ! + DO n = 1, nclock + ! + IF ( clock_label(n) == label_ ) THEN + ! + CALL print_this_clock( n ) + ! + exit + ! + ENDIF + ! + ENDDO + ! + ENDIF + ! + RETURN + ! +END SUBROUTINE print_clock +! +!---------------------------------------------------------------------------- +SUBROUTINE print_this_clock( n ) + !---------------------------------------------------------------------------- + ! + USE kinds, ONLY : DP + USE io_global, ONLY : stdout + USE mytime, ONLY : no, nclock, clock_label, cputime, walltime, & + notrunning, called, t0cpu, t0wall +! +! ... See comments below about parallel case +! +! USE mp, ONLY : mp_max +! USE mp_global, ONLY : intra_image_comm, my_image_id + ! + IMPLICIT NONE + ! + INTEGER :: n + REAL(DP) :: elapsed_cpu_time, elapsed_wall_time, nsec, msec + INTEGER :: nday, nhour, nmin, nmax, mday, mhour, mmin + ! + REAL(DP), EXTERNAL :: scnds, cclock + ! + ! + IF ( t0cpu(n) == notrunning ) THEN + ! + ! ... clock stopped, print the stored value for the cpu time + ! + elapsed_cpu_time = cputime(n) + elapsed_wall_time= walltime(n) + ! + ELSE + ! + ! ... clock not stopped, print the current value of the cpu time + ! + elapsed_cpu_time = cputime(n) + scnds() - t0cpu(n) + elapsed_wall_time = walltime(n) + cclock() - t0wall(n) + called(n) = called(n) + 1 + ! + ENDIF + ! + nmax = called(n) + ! + ! ... In the parallel case there are several possible approaches + ! ... The safest one is to leave each clock independent from the others + ! ... Another possibility is to print the maximum across all processors + ! ... This is done by uncommenting the following lines + ! + ! CALL mp_max( elapsed_cpu_time, intra_image_comm ) + ! CALL mp_max( elapsed_wall_time, intra_image_comm ) + ! CALL mp_max( nmax, intra_image_comm ) + ! + ! ... In the last line we assume that the maximum cpu time + ! ... is associated to the maximum number of calls + ! ... NOTA BENE: by uncommenting the above lines you may run into + ! ... serious trouble if clocks are not started on all nodes + ! + IF ( n == 1 ) THEN + ! + ! ... The first clock is written as days/hour/min/sec + ! + nday = elapsed_cpu_time / 86400 + nsec = elapsed_cpu_time - 86400 * nday + nhour = nsec / 3600 + nsec = nsec - 3600 * nhour + nmin = nsec / 60 + nsec = nsec - 60 * nmin + ! + ! ... The first clock writes elapsed (wall) time as well + ! + mday = elapsed_wall_time / 86400 + msec = elapsed_wall_time - 86400 * mday + mhour = msec / 3600 + msec = msec - 3600 * mhour + mmin = msec / 60 + msec = msec - 60 * mmin + ! + IF ( nday > 0 .or. mday > 0 ) THEN + ! + WRITE( stdout, & + '(5X,A14," : ",3X,I2,"d",3X,I2,"h",I2, "m CPU ", & + & " ",3X,I2,"d",3X,I2,"h",I2, "m WALL"/)' ) & + clock_label(n), nday, nhour, nmin, mday, mhour, mmin + ! + ELSEIF ( nhour > 0 .or. mhour > 0 ) THEN + ! + WRITE( stdout, & + '(5X,A14," : ",3X,I2,"h",I2,"m CPU ", & + & " ",3X,I2,"h",I2,"m WALL"/)' ) & + clock_label(n), nhour, nmin, mhour, mmin + ! + ELSEIF ( nmin > 0 .or. mmin > 0 ) THEN + ! + WRITE( stdout, & + '(5X,A14," : ",I2,"m",F5.2,"s CPU ", & + & " ",I2,"m",F5.2,"s WALL"/)' ) & + clock_label(n), nmin, nsec, mmin, msec + ! + ELSE + ! + WRITE( stdout, & + '(5X,A14," : ",3X,F5.2,"s CPU ",7X,F5.2,"s WALL"/)' )& + clock_label(n), nsec, msec + ! + ENDIF + ! + ELSEIF ( nmax == 1 .or. t0cpu(n) /= notrunning ) THEN + ! + ! ... for clocks that have been called only once + ! + WRITE( stdout, & + '(5X,A14," : ",F9.2,"s CPU ",F9.2,"s WALL (",I8," calls)")' ) & + clock_label(n), elapsed_cpu_time, elapsed_wall_time, nmax + ! + ELSEIF ( nmax == 0 ) THEN + ! + ! ... for clocks that have never been called + ! + WRITE( stdout, & + '("print_this: clock # ",I2," for ",A14," never called !"/)' ) & + n, clock_label(n) + ! + ELSE + ! + ! ... for all other clocks + ! + WRITE( stdout, & + '(5X,A14," : ",F9.2,"s CPU ",F9.2,"s WALL (",I8," calls)")' ) & + clock_label(n), elapsed_cpu_time, elapsed_wall_time, nmax + ! + ENDIF + ! + RETURN + ! +END SUBROUTINE print_this_clock +! +!---------------------------------------------------------------------------- +FUNCTION get_clock( label ) + !---------------------------------------------------------------------------- + ! + USE kinds, ONLY : DP + USE io_global, ONLY : stdout + USE mytime, ONLY : no, nclock, clock_label, walltime, & + notrunning, called, t0wall, t0cpu +! +! ... See comments in subroutine print_this_clock about parallel case +! +! USE mp, ONLY : mp_max +! USE mp_global, ONLY : intra_image_comm + ! + IMPLICIT NONE + ! + REAL(DP) :: get_clock + CHARACTER(len=*) :: label + INTEGER :: n + ! + REAL(DP), EXTERNAL :: cclock + ! + ! + IF ( no ) THEN + ! + IF ( label == clock_label(1) ) THEN + ! + get_clock = cclock() + ! + ELSE + ! + get_clock = notrunning + ! + ENDIF + ! + RETURN + ! + ENDIF + ! + DO n = 1, nclock + ! + IF ( label == clock_label(n) ) THEN + ! + IF ( t0cpu(n) == notrunning ) THEN + ! + get_clock = walltime(n) + ! + ELSE + ! + get_clock = walltime(n) + cclock() - t0wall(n) + ! + ENDIF + ! + ! ... See comments in subroutine print_this_clock about parallel case + ! + ! CALL mp_max( get_clock, intra_image_comm ) + ! + RETURN + ! + ENDIF + ! + ENDDO + ! + ! ... clock not found + ! + get_clock = notrunning + ! + RETURN + ! +END FUNCTION get_clock diff --git a/tests/apps/miniDFT/tests/src/close_files.f90 b/tests/apps/miniDFT/tests/src/close_files.f90 new file mode 100644 index 0000000000..8189cfbb45 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/close_files.f90 @@ -0,0 +1,62 @@ +! +! Copyright (C) 2001-2003 PWSCF group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +!---------------------------------------------------------------------------- +SUBROUTINE close_files(lflag) + !---------------------------------------------------------------------------- + ! + ! ... Close all files and synchronize processes for a new scf calculation. + ! + USE control_flags, ONLY : twfcollect, io_level + USE fixed_occ, ONLY : one_atom_occupations + USE io_files, ONLY : prefix, iunwfc, iunigk, iunat, iunsat, & + iunefield, iunefieldm, iunefieldp + USE buffers, ONLY : close_buffer + USE mp_global, ONLY : intra_image_comm + USE mp, ONLY : mp_barrier + ! + IMPLICIT NONE + ! + LOGICAL, intent(in) :: lflag + ! + LOGICAL :: opnd + ! ... close buffer/file containing wavefunctions: discard if + ! ... wavefunctions are written in xml format, save otherwise + ! + !BMA: eliminiate filesystem activity for miniDFT + !IF ( lflag .AND. (twfcollect .OR. io_level < 0 )) THEN + ! CALL close_buffer ( iunwfc, 'DELETE' ) + !ELSE + ! CALL close_buffer ( iunwfc, 'KEEP' ) + !END IF + ! + ! ... iunigk is kept open during the execution - close and remove + ! + ! BMA: eliminating filesystem ops that arent used by mini-app + !INQUIRE( UNIT = iunigk, OPENED = opnd ) + !IF ( opnd ) CLOSE( UNIT = iunigk, STATUS = 'DELETE' ) + ! + ! ... iunat contains the (orthogonalized) atomic wfcs + ! ... iunsat contains the (orthogonalized) atomic wfcs * S + ! + IF ( one_atom_occupations) THEN + ! + INQUIRE( UNIT = iunat, OPENED = opnd ) + IF ( opnd ) CLOSE( UNIT = iunat, STATUS = 'KEEP' ) + INQUIRE( UNIT = iunsat, OPENED = opnd ) + IF ( opnd ) CLOSE( UNIT = iunsat, STATUS = 'KEEP' ) + ! + END IF + ! + ! ... close unit for electric field if needed + ! + ! + CALL mp_barrier( intra_image_comm ) + ! + RETURN + ! +END SUBROUTINE close_files diff --git a/tests/apps/miniDFT/tests/src/compute_deff.f90 b/tests/apps/miniDFT/tests/src/compute_deff.f90 new file mode 100644 index 0000000000..91c4a4ee83 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/compute_deff.f90 @@ -0,0 +1,28 @@ +! +! Copyright (C) 2009-2010 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +!--------------------------------------------------------------------------- +SUBROUTINE compute_deff(deff, et) +! +! This routine computes the effective value of the D-eS coefficients +! which appear often in many expressions in the US or PAW case. +! This routine is for the collinear case. +! +USE kinds, ONLY : DP +USE ions_base, ONLY : nsp, nat, ityp +USE uspp, ONLY : deeq, qq, okvan +USE uspp_param, ONLY : nhm +USE lsda_mod, ONLY : current_spin +IMPLICIT NONE + +INTEGER :: nt, na, is +REAL(DP), INTENT(OUT) :: deff(nhm, nhm, nat) +REAL(DP), INTENT(IN) :: et + +deff(:,:,:) = deeq(:,:,:,current_spin) +RETURN +END SUBROUTINE compute_deff diff --git a/tests/apps/miniDFT/tests/src/config.f b/tests/apps/miniDFT/tests/src/config.f new file mode 100644 index 0000000000..94291ac64f --- /dev/null +++ b/tests/apps/miniDFT/tests/src/config.f @@ -0,0 +1,5 @@ +#if defined(__PGI) || defined(__CRAY) +#define DECLARE_IARGC external +#else +#define DECLARE_IARGC intrinsic +#endif diff --git a/tests/apps/miniDFT/tests/src/constants.f90 b/tests/apps/miniDFT/tests/src/constants.f90 new file mode 100644 index 0000000000..f2864a10a3 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/constants.f90 @@ -0,0 +1,150 @@ +! +! Copyright (C) 2002-2006 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +!---------------------------------------------------------------------------- +MODULE constants + !---------------------------------------------------------------------------- + ! + USE kinds, ONLY : DP + ! + ! ... The constants needed everywhere + ! + IMPLICIT NONE + ! + SAVE + ! + ! ... Mathematical constants + ! + REAL(DP), PARAMETER :: pi = 3.14159265358979323846_DP + REAL(DP), PARAMETER :: tpi = 2.0_DP * pi + REAL(DP), PARAMETER :: fpi = 4.0_DP * pi + REAL(DP), PARAMETER :: sqrtpi = 1.77245385090551602729_DP + REAL(DP), PARAMETER :: sqrtpm1= 1.0_DP / sqrtpi + REAL(DP), PARAMETER :: sqrt2 = 1.41421356237309504880_DP + ! + ! ... Physical constants, SI (NIST CODATA 2006), Web Version 5.1 + ! http://physics.nist.gov/constants + REAL(DP), PARAMETER :: H_PLANCK_SI = 6.62606896E-34_DP ! J s + REAL(DP), PARAMETER :: K_BOLTZMANN_SI = 1.3806504E-23_DP ! J K^-1 + REAL(DP), PARAMETER :: ELECTRON_SI = 1.602176487E-19_DP ! C + REAL(DP), PARAMETER :: ELECTRONVOLT_SI = 1.602176487E-19_DP ! J + REAL(DP), PARAMETER :: ELECTRONMASS_SI = 9.10938215E-31_DP ! Kg + REAL(DP), PARAMETER :: HARTREE_SI = 4.35974394E-18_DP ! J + REAL(DP), PARAMETER :: RYDBERG_SI = HARTREE_SI/2.0_DP ! J + REAL(DP), PARAMETER :: BOHR_RADIUS_SI = 0.52917720859E-10_DP ! m + REAL(DP), PARAMETER :: AMU_SI = 1.660538782E-27_DP ! Kg + REAL(DP), PARAMETER :: C_SI = 2.99792458E+8_DP ! m sec^-1 + ! + ! ... Physical constants, atomic units: + ! ... AU for "Hartree" atomic units (e = m = hbar = 1) + ! ... RY for "Rydberg" atomic units (e^2=2, m=1/2, hbar=1) + ! + REAL(DP), PARAMETER :: K_BOLTZMANN_AU = K_BOLTZMANN_SI / HARTREE_SI + REAL(DP), PARAMETER :: K_BOLTZMANN_RY = K_BOLTZMANN_SI / RYDBERG_SI + ! + ! ... Unit conversion factors: energy and masses + ! + REAL(DP), PARAMETER :: AUTOEV = HARTREE_SI / ELECTRONVOLT_SI + REAL(DP), PARAMETER :: RYTOEV = AUTOEV / 2.0_DP + REAL(DP), PARAMETER :: AMU_AU = AMU_SI / ELECTRONMASS_SI + REAL(DP), PARAMETER :: AMU_RY = AMU_AU / 2.0_DP + ! + ! ... Unit conversion factors: atomic unit of time, in s and ps + ! + REAL(DP), PARAMETER :: AU_SEC = H_PLANCK_SI/tpi/HARTREE_SI + REAL(DP), PARAMETER :: AU_PS = AU_SEC * 1.0E+12_DP + ! + ! ... Unit conversion factors: pressure (1 Pa = 1 J/m^3, 1GPa = 10 Kbar ) + ! + REAL(DP), PARAMETER :: AU_GPA = HARTREE_SI / BOHR_RADIUS_SI ** 3 & + / 1.0E+9_DP + REAL(DP), PARAMETER :: RY_KBAR = 10.0_DP * AU_GPA / 2.0_DP + ! + ! ... Unit conversion factors: 1 debye = 10^-18 esu*cm + ! ... = 3.3356409519*10^-30 C*m + ! ... = 0.208194346 e*A + ! ... ( 1 esu = (0.1/c) Am, c=299792458 m/s) + ! + REAL(DP), PARAMETER :: DEBYE_SI = 3.3356409519_DP * 1.0E-30_DP ! C*m + REAL(DP), PARAMETER :: AU_DEBYE = ELECTRON_SI * BOHR_RADIUS_SI / & + DEBYE_SI + ! + REAL(DP), PARAMETER :: eV_to_kelvin = ELECTRONVOLT_SI / K_BOLTZMANN_SI + REAL(DP), PARAMETER :: ry_to_kelvin = RYDBERG_SI / K_BOLTZMANN_SI + ! + ! .. Unit conversion factors: Energy to wavelength + ! + REAL(DP), PARAMETER :: EVTONM = 1E+9_DP * H_PLANCK_SI * C_SI / & + &ELECTRONVOLT_SI + REAL(DP), PARAMETER :: RYTONM = 1E+9_DP * H_PLANCK_SI * C_SI / RYDBERG_SI + ! + ! Speed of light in atomic units + ! + REAL(DP), PARAMETER :: C_AU = C_SI / BOHR_RADIUS_SI * AU_SEC + ! + ! ... zero up to a given accuracy + ! + REAL(DP), PARAMETER :: eps4 = 1.0E-4_DP + REAL(DP), PARAMETER :: eps6 = 1.0E-6_DP + REAL(DP), PARAMETER :: eps8 = 1.0E-8_DP + REAL(DP), PARAMETER :: eps12 = 1.0E-12_DP + REAL(DP), PARAMETER :: eps14 = 1.0E-14_DP + REAL(DP), PARAMETER :: eps16 = 1.0E-16_DP + REAL(DP), PARAMETER :: eps24 = 1.0E-24_DP + REAL(DP), PARAMETER :: eps32 = 1.0E-32_DP + ! + REAL(DP), PARAMETER :: gsmall = 1.0E-12_DP + ! + REAL(DP), PARAMETER :: e2 = 2.0_DP ! the square of the electron charge + REAL(DP), PARAMETER :: degspin = 2.0_DP ! the number of spins per level + ! + !!!!!! COMPATIBIILITY + ! + REAL(DP), PARAMETER :: amconv = AMU_RY + REAL(DP), PARAMETER :: bohr_radius_cm = bohr_radius_si * 100.0_DP + REAL(DP), PARAMETER :: BOHR_RADIUS_ANGS = bohr_radius_cm * 1.0E8_DP + REAL(DP), PARAMETER :: ANGSTROM_AU = 1.0_DP/BOHR_RADIUS_ANGS + REAL(DP), PARAMETER :: DIP_DEBYE = AU_DEBYE + REAL(DP), PARAMETER :: AU_TERAHERTZ = AU_PS + REAL(DP), PARAMETER :: AU_TO_OHMCMM1 = 46000.0_DP ! (ohm cm)^-1 + REAL(DP), PARAMETER :: RY_TO_THZ = 1.0_DP / AU_TERAHERTZ / FPI + REAL(DP), PARAMETER :: RY_TO_CMM1 = 1.E+10_DP * RY_TO_THZ / C_SI + ! + +END MODULE constants + +! perl script to create a program to list the available constants: +! extract with: grep '^!XX!' constants.f90 | sed 's,!XX!,,' > mkconstlist.pl +! then run: perl mkconstlist.pl constants.f90 > testme.f90 +! and compile and run: testme.f90 +!XX!#!/usr/bin/perl -w +!XX! +!XX!use strict; +!XX! +!XX!print <) { +!XX! if ( /REAL\s*\(DP\)\s*,\s*PARAMETER\s*::\s*([a-zA-Z_0-9]+)\s*=.*$/ ) { +!XX! print " WRITE (*,'(A18,G24.17)') '$1:',$1\n"; +!XX! } +!XX!} +!XX! +!XX!print < 1" and "electron_dynamics = 'md' | 'sd' ", ions are + ! ... propagated every "ion_nstep" electronic step only if the electronic + ! ... "ekin" is lower than "ekin_conv_thr" + ! + LOGICAL :: tionstep = .FALSE. + INTEGER :: nstepe = 1 + ! parameters to control how many electronic steps + ! between ions move + + LOGICAL :: tsteepdesc = .FALSE. + ! parameters for electronic steepest desceent + + INTEGER :: nbeg = 0 ! internal code for initialization ( -1, 0, 1, 2, .. ) + INTEGER :: ndw = 0 ! + INTEGER :: ndr = 0 ! + INTEGER :: nomore = 0 ! + INTEGER :: iprint =10 ! print output every iprint step + INTEGER :: isave = 0 ! write restart to ndr unit every isave step + INTEGER :: nv0rd = 0 ! + ! + ! ... .TRUE. if only gamma point is used + ! + LOGICAL :: gamma_only = .TRUE. + ! + ! This variable is used whenever a timestep change is requested + ! + REAL(DP) :: dt_old = -1.0_DP + ! + ! ... Wave function randomization + ! + LOGICAL :: trane = .FALSE. + REAL(DP) :: ampre = 0.0_DP + ! + ! ... Ionic position randomization + ! + LOGICAL :: tranp(nsx) = .FALSE. + REAL(DP) :: amprp(nsx) = 0.0_DP + ! + ! ... Read the cell from standard input + ! + LOGICAL :: tbeg = .FALSE. + ! + ! ... This flags control the calculation of the Dipole Moments + ! + LOGICAL :: tdipole = .FALSE. + ! + ! ... Flags that controls DIIS electronic minimization + ! + LOGICAL :: t_diis = .FALSE. + LOGICAL :: t_diis_simple = .FALSE. + LOGICAL :: t_diis_rot = .FALSE. + ! + ! ... Flag controlling the Nose thermostat for electrons + ! + LOGICAL :: tnosee = .FALSE. + ! + ! ... Flag controlling the Nose thermostat for the cell + ! + LOGICAL :: tnoseh = .FALSE. + ! + ! ... Flag controlling the Nose thermostat for ions + ! + LOGICAL :: tnosep = .FALSE. + LOGICAL :: tcap = .FALSE. + LOGICAL :: tcp = .FALSE. + REAL(DP) :: tolp = 0.0_DP ! tolerance for temperature variation + ! + REAL(DP), PUBLIC :: & + ekin_conv_thr = 0.0_DP, &! conv. threshold for fictitious e. kinetic energy + etot_conv_thr = 0.0_DP, &! conv. threshold for DFT energy + forc_conv_thr = 0.0_DP ! conv. threshold for atomic forces + INTEGER, PUBLIC :: & + ekin_maxiter = 100, &! max number of iter. for ekin convergence + etot_maxiter = 100, &! max number of iter. for etot convergence + forc_maxiter = 100 ! max number of iter. for atomic forces conv. + ! + ! ... Several variables controlling the run ( used mainly in PW calculations ) + ! + ! ... logical flags controlling the execution + ! + LOGICAL, PUBLIC :: & + lfixatom=.FALSE., &! if .TRUE. some atom is kept fixed + lscf =.FALSE., &! if .TRUE. the calc. is selfconsistent + lbfgs =.FALSE., &! if .TRUE. the calc. is a relaxation based on BFGS + lmd =.FALSE., &! if .TRUE. the calc. is a dynamics + llang =.FALSE., &! if .TRUE. the calc. is Langevin dynamics + lpath =.FALSE., &! if .TRUE. the calc. is a path optimizations + lneb =.FALSE., &! if .TRUE. the calc. is NEB dynamics + lsmd =.FALSE., &! if .TRUE. the calc. is string dynamics + lwf =.FALSE., &! if .TRUE. the calc. is with wannier functions + !================================================================= + ! Lingzhu Kong + lwfnscf =.FALSE., & + lwfpbe0 =.FALSE., &! if .TRUE. the calc. is with wannier functions and with PBE0 functional + lwfpbe0nscf=.FALSE.,& + !================================================================= + lbands =.FALSE., &! if .TRUE. the calc. is band structure + lconstrain=.FALSE.,&! if .TRUE. the calc. is constraint + ldamped =.FALSE., &! if .TRUE. the calc. is a damped dynamics + llondon =.FALSE., & ! if .TRUE. compute semi-empirical dispersion correction + restart =.FALSE. ! if .TRUE. restart from results of a preceding run + ! + ! ... pw self-consistency + ! + INTEGER, PUBLIC :: & + ngm0, &! used in mix_rho + niter, &! the maximum number of iteration + nmix, &! the number of iteration kept in the history + imix ! the type of mixing (0=plain,1=TF,2=local-TF) + REAL(DP), PUBLIC :: & + mixing_beta, &! the mixing parameter + tr2 ! the convergence threshold for potential + + LOGICAL, PUBLIC :: & + conv_elec ! if .TRUE. electron convergence has been reached + ! next 3 variables used for EXX calculations + LOGICAL, PUBLIC :: & + adapt_thr ! if .TRUE. an adaptive convergence threshold is used + ! for the scf cycle in an EXX calculation. + REAL(DP), PUBLIC :: & + tr2_init, &! initial value of tr2 for adaptive thresholds + tr2_multi ! the dexx multiplier for adaptive thresholds + ! tr2 = tr2_multi * dexx after each V_exx update + ! + ! ... pw diagonalization + ! + REAL(DP), PUBLIC :: & + ethr ! the convergence threshold for eigenvalues + INTEGER, PUBLIC :: & + david, &! max dimension of subspace in Davidson diagonalization + isolve, &! Davidson or CG or DIIS diagonalization + max_cg_iter, &! maximum number of iterations in a CG di + diis_buff, &! dimension of the buffer in diis + diis_ndim ! dimension of reduced basis in DIIS + LOGICAL, PUBLIC :: & + diago_full_acc = .FALSE. ! if true, empty eigenvalues have the same + ! accuracy of the occupied ones + ! + ! ... wfc and rho extrapolation + ! + REAL(DP), PUBLIC :: & + alpha0, &! the mixing parameters for the extrapolation + beta0 ! of the starting potential + INTEGER, PUBLIC :: & + history, &! number of old steps available for potential updating + pot_order = 0, &! type of potential updating ( see update_pot ) + wfc_order = 0 ! type of wavefunctions updating ( see update_pot ) + ! + ! ... ionic dynamics + ! + INTEGER, PUBLIC :: & + nstep = 1, &! number of ionic steps + istep = 0 ! current ionic step + LOGICAL, PUBLIC :: & + conv_ions ! if .TRUE. ionic convergence has been reached + REAL(DP), PUBLIC :: & + upscale ! maximum reduction of convergence threshold + ! + ! ... system's symmetries + ! + LOGICAL, PUBLIC :: & + noinv = .FALSE. ! if .TRUE. q=>-q symmetry not used in k-point generation + ! + ! ... phonon calculation + ! + INTEGER, PUBLIC :: & + modenum ! for single mode phonon calculation + ! + ! ... printout control + ! + INTEGER, PUBLIC :: & + io_level = 1 ! variable controlling the amount of I/O to file + INTEGER, PUBLIC :: & ! variable controlling the amount of I/O to output + iverbosity = 0 ! -2 minimal, -1 low, 0 medium, 1 high, 2 debug + ! + ! ... miscellany + ! + LOGICAL, PUBLIC :: & + use_para_diag = .FALSE. ! if .TRUE. a fully distributed memory iteration + ! algorithm and parallel Householder algorithm are used + ! + LOGICAL, PUBLIC :: & + remove_rigid_rot = .FALSE. ! if .TRUE. the total torque acting on the atoms + ! is removed + LOGICAL, PUBLIC :: & + do_makov_payne = .FALSE. ! if .TRUE. makov-payne correction for isolated + ! system is used + ! + INTEGER :: ortho_max = 0 ! maximum number of iterations in routine ortho + REAL(DP) :: ortho_eps = 0.0_DP ! threshold for convergence in routine ortho + ! + ! ... Number of neighbouring cell to consider in ewald sum + ! + INTEGER, PUBLIC :: iesr = 1 + ! + ! ... Real-sapce algorithms + ! + LOGICAL, PUBLIC :: tqr=.FALSE. ! if true the Q are in real space + + !LOGICAL, PUBLIC :: real_space=.false. ! beta functions in real space + ! + ! ... External Forces on Ions + ! + LOGICAL, PUBLIC :: textfor = .FALSE. + + ! + ! ... end of module-scope declarations + ! + !=--------------------------------------------------------------------------=! + CONTAINS + !=--------------------------------------------------------------------------=! + ! + !------------------------------------------------------------------------ + SUBROUTINE fix_dependencies() + !------------------------------------------------------------------------ + ! + IMPLICIT NONE + ! + ! ... Car Parrinello simulation + ! + tcarpar = .TRUE. + ! + IF ( t_diis .OR. tsteepdesc ) THEN + ! + tcarpar = .FALSE. + ! + END IF + ! + ! ... if thdyn = .FALSE. set TSDC and TZEROC to .FALSE. too. + ! + IF ( .NOT. thdyn ) THEN + ! + tsdc = .FALSE. + tzeroc = .FALSE. + ! + END IF + ! + IF ( .NOT. tfor ) THEN + ! + tzerop = .FALSE. + tv0rd = .FALSE. + tsdp = .FALSE. + tcp = .FALSE. + tcap = .FALSE. + tnosep = .FALSE. + ! + ELSE + ! + IF ( tsdp ) THEN + ! + tcp = .FALSE. + tcap = .FALSE. + tnosep = .FALSE. + tv0rd = .FALSE. + ! + END IF + ! + IF ( tv0rd ) tzerop = .TRUE. + ! + END IF + ! + IF ( tsde ) tnosee = .FALSE. + ! + CALL check_flags() + ! + RETURN + ! + END SUBROUTINE fix_dependencies + ! + !------------------------------------------------------------------------ + SUBROUTINE check_flags() + !------------------------------------------------------------------------ + ! + ! ... do some checks for consistency + ! + IF ( tnosee .AND. t_diis ) & + CALL errore( ' control_flags ', 'DIIS + ELECT. NOSE ? ', 0 ) + ! + !IF ( tortho .AND. t_diis ) & + ! CALL errore(' control_flags ','DIIS, ORTHO NOT PERMITTED',0) + ! + IF ( tnosep .AND. tcp ) & + CALL errore( ' control_flags ', ' TCP AND TNOSEP BOTH TRUE', 0 ) + ! + IF ( tnosep .AND. tcap ) & + CALL errore( ' control_flags ', ' TCAP AND TNOSEP BOTH TRUE', 0 ) + ! + IF ( tcp .AND. tcap ) & + CALL errore( ' control_flags ', ' TCP AND TCAP BOTH TRUE', 0 ) + ! + IF ( tdipole .AND. thdyn ) & + CALL errore( ' control_flags ', ' DIPOLE WITH CELL DYNAMICS ', 0 ) + ! + IF ( tv0rd .AND. tsdp ) & + CALL errore( ' control_flags ', & + & ' READING IONS VELOCITY WITH STEEPEST D.', 0 ) + ! + RETURN + ! + END SUBROUTINE check_flags + ! +END MODULE control_flags + diff --git a/tests/apps/miniDFT/tests/src/coset.f90 b/tests/apps/miniDFT/tests/src/coset.f90 new file mode 100644 index 0000000000..b2ab104cc9 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/coset.f90 @@ -0,0 +1,86 @@ +! +! Copyright (C) 2001 PWSCF group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +!----------------------------------------------------------------------- +subroutine coset (nrot, table, sym, nsym, irg) + !----------------------------------------------------------------------- + ! + ! Divides the elements of a given group into left cosets of one + ! of its subgroups. + ! The input is the array sym which is true only for the + ! operations of the subgroup, the output is nsym, and the array irg, + ! which contains as its first elements the indices of the subgroup, + ! and then its right cosets. + ! + ! revised layout 1 may 1995 by A. Dal Corso + ! + USE kinds + implicit none + ! + ! first the dummy variables + ! + integer :: nrot, table (48, 48), nsym, irg (48) + ! input: order of the group + ! input: multiplication table of the group + ! output: order of the subgroup + ! output: gives the correspondence of symme + ! operations forming a n-th coset + ! input: flag indicating if an operations + logical :: sym (48) + ! belongs to the subgroup + ! + ! here the local variables + ! + logical :: done (48) + ! if true the operation has been already ch + + integer :: irot, ncos, isym, nc, nelm + ! counter on rotations + ! number of cosets (=nrot/nsym) + ! counter on symmetries + ! counter on cosets + ! counter on the number of elements + ! + ! here we count the elements of the subgroup and set the first part o + ! irg which contain the subgroup + ! + nsym = 0 + do irot = 1, nrot + done (irot) = sym (irot) + if (sym (irot) ) then + nsym = nsym + 1 + irg (nsym) = irot + endif + enddo + ! + ! we check that the order of the subgroup is a divisor of the order + ! total group. ncos is the number of cosets + ! + IF ( nsym == 0 ) CALL errore( 'coset', 'nsym == 0', 1 ) + ! + ncos = nrot / nsym + if (ncos * nsym.ne.nrot) call errore ('coset', & + 'The order'//' of the group is not a multiple of that of the subgroup', 1) + ! + ! here we set the other elements of irg, by using the multiplication + ! + nelm = nsym + do nc = 2, ncos + do irot = 1, nrot + if (.not.done (irot) ) then + do isym = 1, nsym + nelm = nelm + 1 + irg (nelm) = table (irot, irg (isym) ) + done (irg (nelm) ) = .true. + enddo + endif + enddo + + enddo + return +end subroutine coset diff --git a/tests/apps/miniDFT/tests/src/cptimer.c b/tests/apps/miniDFT/tests/src/cptimer.c new file mode 100644 index 0000000000..3adeaf9253 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/cptimer.c @@ -0,0 +1,42 @@ +/* + Copyright (C) 2002-2006 Quantum ESPRESSO group + This file is distributed under the terms of the + GNU General Public License. See the file `License' + in the root directory of the present distribution, + or http://www.gnu.org/copyleft/gpl.txt . +*/ + +#include +#include +#include + +#include "c_defs.h" + +double F77_FUNC(cclock,CCLOCK)() + +/* Return the second elapsed since Epoch (00:00:00 UTC, January 1, 1970) +*/ + +{ + + struct timeval tmp; + double sec; + gettimeofday( &tmp, (struct timezone *)0 ); + sec = tmp.tv_sec + ((double)tmp.tv_usec)/1000000.0; + return sec; + +} + +double F77_FUNC(scnds,SCNDS) ( ) + +/* Return the cpu time associated to the current process +*/ + +{ + static struct rusage T; + + getrusage(RUSAGE_SELF, &T); + + return ((double)T.ru_utime.tv_sec + ((double)T.ru_utime.tv_usec)/1000000.0); +} + diff --git a/tests/apps/miniDFT/tests/src/cryst_to_car.f90 b/tests/apps/miniDFT/tests/src/cryst_to_car.f90 new file mode 100644 index 0000000000..1093868481 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/cryst_to_car.f90 @@ -0,0 +1,66 @@ +! +! Copyright (C) 2001-2003 PWSCF group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +!----------------------------------------------------------------------- +subroutine cryst_to_cart (nvec, vec, trmat, iflag) + !----------------------------------------------------------------------- + ! + ! This routine transforms the atomic positions or the k-point + ! components from crystallographic to cartesian coordinates + ! ( iflag=1 ) and viceversa ( iflag=-1 ). + ! Output cartesian coordinates are stored in the input ('vec') array + ! + ! + USE kinds, ONLY : DP + implicit none + ! + integer, intent(in) :: nvec, iflag + ! nvec: number of vectors (atomic positions or k-points) + ! to be transformed from crystal to cartesian and vice versa + ! iflag: gives the direction of the transformation + real(DP), intent(in) :: trmat (3, 3) + ! trmat: transformation matrix + ! if iflag=1: + ! trmat = at , basis of the real-space lattice, for atoms or + ! = bg , basis of the reciprocal-space lattice, for k-points + ! if iflag=-1: the opposite + real(DP), intent(inout) :: vec (3, nvec) + ! coordinates of the vector (atomic positions or k-points) to be + ! transformed - overwritten on output + ! + ! local variables + ! + integer :: nv, kpol + ! counter on vectors + ! counter on polarizations + real(DP) :: vau (3) + ! workspace + ! + ! Compute the cartesian coordinates of each vectors + ! (atomic positions or k-points components) + ! + do nv = 1, nvec + if (iflag.eq.1) then + do kpol = 1, 3 + vau (kpol) = trmat (kpol, 1) * vec (1, nv) + trmat (kpol, 2) & + * vec (2, nv) + trmat (kpol, 3) * vec (3, nv) + enddo + else + do kpol = 1, 3 + vau (kpol) = trmat (1, kpol) * vec (1, nv) + trmat (2, kpol) & + * vec (2, nv) + trmat (3, kpol) * vec (3, nv) + enddo + endif + do kpol = 1, 3 + vec (kpol, nv) = vau (kpol) + enddo + enddo + ! + return +end subroutine cryst_to_cart + diff --git a/tests/apps/miniDFT/tests/src/customize_signals.c b/tests/apps/miniDFT/tests/src/customize_signals.c new file mode 100644 index 0000000000..ee24814c37 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/customize_signals.c @@ -0,0 +1,28 @@ + +#ifdef __TRAP_SIGUSR1 +#include +#include +#include + +int init_signal(int signum, void (*new_handler)(int)) +{ + static struct sigaction action; + + action.sa_handler = new_handler; + // Don't block anything. + // Not sure if it's the correct behavior (or even if there is one) + sigemptyset(&action.sa_mask); + // This will probably make MPI happy + action.sa_flags = SA_RESTART; + + return sigaction(signum, &action, NULL); +} + + +int init_signal_USR1(void (*new_handler)(int)) +{ + return init_signal(SIGUSR1, new_handler); +} +#else + void dummy ( ) { } +#endif diff --git a/tests/apps/miniDFT/tests/src/data_structure.f90 b/tests/apps/miniDFT/tests/src/data_structure.f90 new file mode 100644 index 0000000000..087e31b2ef --- /dev/null +++ b/tests/apps/miniDFT/tests/src/data_structure.f90 @@ -0,0 +1,81 @@ +! +! Copyright (C) 2001-2010 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +!----------------------------------------------------------------------- +SUBROUTINE data_structure( gamma_only ) + !----------------------------------------------------------------------- + ! this routine sets the data structure for the fft arrays + ! (both the smooth and the dense grid) + ! In the parallel case, it distributes columns to processes, too + ! + USE kinds, ONLY : DP + USE io_global, ONLY : stdout + USE mp, ONLY : mp_max + USE mp_global, ONLY : me_bgrp, nproc_bgrp, inter_bgrp_comm, intra_bgrp_comm, root_bgrp + USE mp_global, ONLY : get_ntask_groups + USE fft_base, ONLY : dfftp, dffts + USE cell_base, ONLY : bg, tpiba + USE klist, ONLY : xk, nks + USE gvect, ONLY : gcutm, gvect_init + USE gvecs, ONLY : gcutms, gvecs_init + USE stick_set, ONLY : pstickset + USE wvfct, ONLY : ecutwfc + + + ! + IMPLICIT NONE + LOGICAL, INTENT(in) :: gamma_only + REAL (DP) :: gkcut + INTEGER :: ik, ngm_, ngs_, ngw_ , nogrp + INTEGER :: me, nproc, inter_comm, intra_comm, root + me = me_bgrp + nproc = nproc_bgrp + inter_comm = inter_bgrp_comm + intra_comm = intra_bgrp_comm + root = root_bgrp + ! + ! ... calculate gkcut = max |k+G|^2, in (2pi/a)^2 units + ! + IF (nks == 0) THEN + ! + ! if k-points are automatically generated (which happens later) + ! use max(bg)/2 as an estimate of the largest k-point + ! + gkcut = 0.5d0 * max ( & + sqrt (sum(bg (1:3, 1)**2) ), & + sqrt (sum(bg (1:3, 2)**2) ), & + sqrt (sum(bg (1:3, 3)**2) ) ) + ELSE + gkcut = 0.0d0 + DO ik = 1, nks + gkcut = max (gkcut, sqrt ( sum(xk (1:3, ik)**2) ) ) + ENDDO + ENDIF + gkcut = (sqrt (ecutwfc) / tpiba + gkcut)**2 + ! + ! ... find maximum value among all the processors + ! + CALL mp_max (gkcut, inter_comm ) + ! + ! ... set up fft descriptors, including parallel stuff: sticks, planes, etc. + ! + nogrp = get_ntask_groups() + ! + CALL pstickset( gamma_only, bg, gcutm, gkcut, gcutms, & + dfftp, dffts, ngw_ , ngm_ , ngs_ , me, root, nproc, intra_comm, & + nogrp ) + ! + ! on output, ngm_ and ngs_ contain the local number of G-vectors + ! for the two grids. Initialize local and global number of G-vectors + ! + call gvect_init ( ngm_ , intra_comm ) + call gvecs_init ( ngs_ , intra_comm ); + ! + +END SUBROUTINE data_structure + diff --git a/tests/apps/miniDFT/tests/src/date_and_tim.f90 b/tests/apps/miniDFT/tests/src/date_and_tim.f90 new file mode 100644 index 0000000000..c8ccd3d8ec --- /dev/null +++ b/tests/apps/miniDFT/tests/src/date_and_tim.f90 @@ -0,0 +1,26 @@ +! +! Copyright (C) 2001 PWSCF group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +subroutine date_and_tim (cdate, ctime) + ! + ! Returns two strings containing the date and the time + ! in human-readable format. Uses a standard f90 call. + ! + implicit none + character (len=9) :: cdate, ctime + ! + character(len=3), dimension(12) :: months + data months /'Jan','Feb','Mar','Apr','May','Jun', & + 'Jul','Aug','Sep','Oct','Nov','Dec'/ + INTEGER date_time(8) + ! + call date_and_time(values=date_time) + ! + write (cdate,'(i2,a3,i4)') date_time(3), months(date_time(2)), date_time(1) + write (ctime,'(i2,":",i2,":",i2)') date_time(5), date_time(6), date_time(7) + +end subroutine date_and_tim diff --git a/tests/apps/miniDFT/tests/src/deriv_drhoc.f90 b/tests/apps/miniDFT/tests/src/deriv_drhoc.f90 new file mode 100644 index 0000000000..f307e6f542 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/deriv_drhoc.f90 @@ -0,0 +1,72 @@ +! +! Copyright (C) 2001-2007 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +!----------------------------------------------------------------------- +subroutine deriv_drhoc (ngl, gl, omega, tpiba2, mesh, r, rab, rhoc, drhocg) + !----------------------------------------------------------------------- + USE kinds + USE constants, ONLY : pi, fpi + implicit none + ! + ! first the dummy variables + ! + + integer :: ngl, mesh + ! input: the number of g shell + ! input: the number of radial mesh points + + real(DP), intent(in) :: gl (ngl), r (mesh), rab (mesh), rhoc (mesh), & + omega, tpiba2 + real(DP), intent(out) :: drhocg (ngl) + ! input: the number of G shells + ! input: the radial mesh + ! input: the derivative of the radial mesh + ! input: the radial core charge + ! input: the volume of the unit cell + ! input: 2 times pi / alat + ! output: fourier transform of d Rho_c/dG + ! + ! here the local variables + ! + real(DP) :: gx, rhocg1 + ! the modulus of g for a given shell + ! the fourier transform + real(DP), allocatable :: aux (:) + ! auxiliary memory for integration + + integer :: ir, igl, igl0 + ! counter on radial mesh points + ! counter on g shells + ! lower limit for loop on ngl + + ! + ! G=0 term + ! + if (gl (1) < 1.0d-8) then + drhocg (1) = 0.0d0 + igl0 = 2 + else + igl0 = 1 + endif + ! + ! G <> 0 term + ! + allocate (aux( mesh)) + do igl = igl0, ngl + gx = sqrt (gl (igl) * tpiba2) + do ir = 1, mesh + aux (ir) = r (ir) * rhoc (ir) * (r (ir) * cos (gx * r (ir) ) & + / gx - sin (gx * r (ir) ) / gx**2) + enddo + call simpson (mesh, aux, rab, rhocg1) + drhocg (igl) = fpi / omega * rhocg1 + enddo + deallocate (aux) + + return +end subroutine deriv_drhoc + diff --git a/tests/apps/miniDFT/tests/src/descriptors.f90 b/tests/apps/miniDFT/tests/src/descriptors.f90 new file mode 100644 index 0000000000..4297531f80 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/descriptors.f90 @@ -0,0 +1,168 @@ +! +! Copyright (C) 2002 FPMD group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! + + MODULE descriptors + ! + IMPLICIT NONE + SAVE + + INTEGER ldim_block, ldim_cyclic, ldim_block_cyclic, ldim_block_sca + INTEGER gind_block, gind_cyclic, gind_block_cyclic, gind_block_sca + EXTERNAL ldim_block, ldim_cyclic, ldim_block_cyclic, ldim_block_sca + EXTERNAL gind_block, gind_cyclic, gind_block_cyclic, gind_block_sca + + ! Descriptor for linear algebra data distribution (like in Cannon's algorithm) + ! + ! Remember here we use square matrixes block distributed on a square grid of processors + ! + TYPE la_descriptor + INTEGER :: ir = 0 ! globla index of the first row in the local block of the distributed matrix + INTEGER :: nr = 0 ! number of row in the local block of the distributed matrix + INTEGER :: ic = 0 ! global index of the first column in the local block of the distributed matrix + INTEGER :: nc = 0 ! number of column in the local block of the distributed matrix + INTEGER :: nrcx = 0 ! leading dimension of the distribute matrix (greather than nr and nc) + INTEGER :: active_node = 0 ! if > 0 the proc holds a block of the lambda matrix + INTEGER :: n = 0 ! global dimension of the matrix + INTEGER :: nx = 0 ! global leading dimension ( >= n ) + INTEGER :: npr = 0 ! number of row processors + INTEGER :: npc = 0 ! number of column processors + INTEGER :: myr = 0 ! processor row index + INTEGER :: myc = 0 ! processor column index + INTEGER :: comm = 0 ! communicator + INTEGER :: mype = 0 ! processor index ( from 0 to desc( la_npr_ ) * desc( la_npc_ ) - 1 ) + INTEGER :: nrl = 0 ! number of local rows, when the matrix rows are cyclically distributed across proc + INTEGER :: nrlx = 0 ! leading dimension, when the matrix is distributed by row + END TYPE + ! + CONTAINS + + !------------------------------------------------------------------------ + ! + SUBROUTINE descla_local_dims( i2g, nl, n, nx, np, me ) + IMPLICIT NONE + INTEGER, INTENT(OUT) :: i2g ! global index of the first local element + INTEGER, INTENT(OUT) :: nl ! local number of elements + INTEGER, INTENT(IN) :: n ! number of actual element in the global array + INTEGER, INTENT(IN) :: nx ! dimension of the global array (nx>=n) to be distributed + INTEGER, INTENT(IN) :: np ! number of processors + INTEGER, INTENT(IN) :: me ! taskid for which i2g and nl are computed + ! + ! note that we can distribute a global array larger than the + ! number of actual elements. This could be required for performance + ! reasons, and to have an equal partition of matrix having different size + ! like matrixes of spin-up and spin-down + ! + nl = ldim_block_sca( nx, np, me ) + i2g = gind_block_sca( 1, nx, np, me ) + ! This is to try to keep a matrix N * N into the same + ! distribution of a matrix NX * NX, useful to have + ! the matrix of spin-up distributed in the same way + ! of the matrix of spin-down + ! + IF( i2g + nl - 1 > n ) nl = n - i2g + 1 + IF( nl < 0 ) nl = 0 + RETURN + ! + END SUBROUTINE descla_local_dims + ! + ! + SUBROUTINE descla_init( descla, n, nx, np, me, comm, includeme ) + ! + IMPLICIT NONE + TYPE(la_descriptor), INTENT(OUT) :: descla + INTEGER, INTENT(IN) :: n ! the size of this matrix + INTEGER, INTENT(IN) :: nx ! the max among different matrixes sharing + ! this descriptor or the same data distribution + INTEGER, INTENT(IN) :: np(2), me(2), comm + INTEGER, INTENT(IN) :: includeme + INTEGER :: ir, nr, ic, nc, lnode, nrcx, nrl, nrlx + INTEGER :: ip, npp + + IF( np(1) /= np(2) ) & + CALL errore( ' descla_init ', ' only square grid of proc are allowed ', 2 ) + IF( n < 0 ) & + CALL errore( ' descla_init ', ' dummy argument n less than 1 ', 3 ) + IF( nx < n ) & + CALL errore( ' descla_init ', ' dummy argument nx less than n ', 4 ) + IF( np(1) < 1 ) & + CALL errore( ' descla_init ', ' dummy argument np less than 1 ', 5 ) + + ! find the block maximum dimensions + + nrcx = ldim_block_sca( nx, np(1), 0 ) + ! + ! find local dimensions, if appropriate + ! + IF( includeme == 1 ) THEN + ! + CALL descla_local_dims( ir, nr, n, nx, np(1), me(1) ) + CALL descla_local_dims( ic, nc, n, nx, np(2), me(2) ) + ! + lnode = 1 + ! + ELSE + ! + nr = 0 + nc = 0 + ! + ir = 0 + ic = 0 + ! + lnode = -1 + ! + END IF + + descla%ir = ir ! globla index of the first row in the local block of lambda + descla%nr = nr ! number of row in the local block of lambda ( the "2" accounts for spin) + descla%ic = ic ! global index of the first column in the local block of lambda + descla%nc = nc ! number of column in the local block of lambda + descla%nrcx = nrcx ! leading dimension of the distribute lambda matrix + descla%active_node = lnode + ! if > 0 the proc holds a block of the lambda matrix + descla%n = n ! global dimension of the matrix + descla%nx = nx ! global leading dimension + descla%npr = np(1) ! number of row processors + descla%npc = np(2) ! number of column processors + descla%myr = me(1) ! processor row index + descla%myc = me(2) ! processor column index + descla%comm = comm ! communicator + descla%mype = descla%myc + descla%myr * descla%npr + ! processor index ( from 0 to desc( la_npr_ ) * desc( la_npc_ ) - 1 ) + + npp = np(1) * np(2) + + ! Compute local dimension of the cyclically distributed matrix + ! + IF( includeme == 1 ) THEN + nrl = ldim_cyclic( n, npp, descla%mype ) + ELSE + nrl = 0 + END IF + nrlx = n / npp + 1 + + descla%nrl = nrl ! number of local rows, when the matrix rows are cyclically distributed across procs + descla%nrlx = nrlx ! leading dimension + + IF( nr < 0 .OR. nc < 0 ) & + CALL errore( ' descla_init ', ' wrong valune for computed nr and nc ', 1 ) + IF( nrcx < 1 ) & + CALL errore( ' descla_init ', ' wrong value for computed nrcx ', 2 ) + IF( nrcx < nr ) & + CALL errore( ' descla_init ', ' nrcx < nr ', ( nr - nrcx ) ) + IF( nrcx < nc ) & + CALL errore( ' descla_init ', ' nrcx < nc ', ( nc - nrcx ) ) + IF( nrlx < nrl ) & + CALL errore( ' descla_init ', ' nrlx < nrl ', ( nrl - nrlx ) ) + IF( nrl < 0 ) & + CALL errore( ' descla_init ', ' nrl < 0 ', ABS( nrl ) ) + + + RETURN + END SUBROUTINE descla_init + + END MODULE descriptors diff --git a/tests/apps/miniDFT/tests/src/distools.f90 b/tests/apps/miniDFT/tests/src/distools.f90 new file mode 100644 index 0000000000..591da04e5f --- /dev/null +++ b/tests/apps/miniDFT/tests/src/distools.f90 @@ -0,0 +1,640 @@ +! +! Copyright (C) 2001-2009 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +!----------------------------------------------------------------------- +! +SUBROUTINE block_distribute( nat, me_image, nproc_image, ia_s, ia_e, mykey ) + INTEGER, INTENT(IN) :: nat, me_image, nproc_image + INTEGER, INTENT(OUT) :: ia_s, ia_e, mykey + INTEGER :: na_loc, r, nproc_ia + + INTEGER, EXTERNAL :: ldim_block, gind_block + + ! Parallel: divide among processors for the same image + ! + ! compute how many processors we have for a given atom + ! + nproc_ia = nproc_image / nat + ! + IF( nproc_ia == 0 ) THEN + ! + ! here we have less than one processor per atom + ! + mykey = 0 + na_loc = ldim_block( nat, nproc_image, me_image) + ia_s = gind_block( 1, nat, nproc_image, me_image ) + ia_e = ia_s + na_loc - 1 + ! + ELSE + ! + ! here we have more than one proc per atom + ! + r = MOD( nproc_image, nat ) + ! + IF( me_image < (nproc_ia + 1)*r ) THEN + ! processors that do the work, more procs work on a single atom + ia_s = me_image/(nproc_ia + 1) + 1 + mykey = MOD( me_image, nproc_ia + 1 ) + ELSE + ia_s = ( me_image - (nproc_ia + 1)*r ) / nproc_ia + 1 + r + mykey = MOD( me_image - (nproc_ia + 1)*r , nproc_ia ) + END IF + ! + ia_e = ia_s + ! + END IF + + RETURN + +END SUBROUTINE +! + +! +SUBROUTINE GRID2D_DIMS( grid_shape, nproc, nprow, npcol ) + ! + ! This subroutine factorizes the number of processors (NPROC) + ! into NPROW and NPCOL according to the shape + ! + ! Written by Carlo Cavazzoni + ! + IMPLICIT NONE + CHARACTER, INTENT(IN) :: grid_shape + INTEGER, INTENT(IN) :: nproc + INTEGER, INTENT(OUT) :: nprow, npcol + INTEGER :: sqrtnp, i + ! + sqrtnp = INT( SQRT( REAL( nproc ) + 0.1 ) ) + ! + IF( grid_shape == 'S' ) THEN + ! Square grid + nprow = sqrtnp + npcol = sqrtnp + ELSE + ! Rectangular grid + DO i = 1, sqrtnp + 1 + IF( MOD( nproc, i ) == 0 ) nprow = i + end do + npcol = nproc / nprow + END IF + RETURN +END SUBROUTINE + +SUBROUTINE GRID2D_COORDS( order, rank, nprow, npcol, row, col ) + ! + ! this subroutine compute the cartesian coordinetes "row" and "col" + ! of the processor whose MPI task id is "rank". + ! Note that if the rank is larger that the grid size + ! all processors whose MPI task id is greather or equal + ! than nprow * npcol are placed on the diagonal extension of the grid itself + ! + IMPLICIT NONE + CHARACTER, INTENT(IN) :: order + INTEGER, INTENT(IN) :: rank ! process index starting from 0 + INTEGER, INTENT(IN) :: nprow, npcol ! dimensions of the processor grid + INTEGER, INTENT(OUT) :: row, col + IF( rank >= 0 .AND. rank < nprow * npcol ) THEN + IF( order == 'C' .OR. order == 'c' ) THEN + ! grid in COLUMN MAJOR ORDER + row = MOD( rank, nprow ) + col = rank / nprow + ELSE + ! grid in ROW MAJOR ORDER + row = rank / npcol + col = MOD( rank, npcol ) + END IF + ELSE + row = rank + col = rank + END IF + RETURN +END SUBROUTINE + +SUBROUTINE GRID2D_RANK( order, nprow, npcol, row, col, rank ) + ! + ! this subroutine compute the processor MPI task id "rank" of the processor + ! whose cartesian coordinate are "row" and "col". + ! Note that the subroutine assume cyclic indexing ( row = nprow = 0 ) + ! + IMPLICIT NONE + CHARACTER, INTENT(IN) :: order + INTEGER, INTENT(OUT) :: rank ! process index starting from 0 + INTEGER, INTENT(IN) :: nprow, npcol ! dimensions of the processor grid + INTEGER, INTENT(IN) :: row, col + + IF( order == 'C' .OR. order == 'c' ) THEN + ! grid in COLUMN MAJOR ORDER + rank = MOD( row + nprow, nprow ) + MOD( col + npcol, npcol ) * nprow + ELSE + ! grid in ROW MAJOR ORDER + rank = MOD( col + npcol, npcol ) + MOD( row + nprow, nprow ) * npcol + END IF + ! + RETURN +END SUBROUTINE +! +! Copyright (C) 2002 FPMD group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! + + + INTEGER FUNCTION ldim_cyclic(gdim, np, me) + +! gdim = global dimension of distributed array +! np = number of processors +! me = index of the calling processor (starting from 0) +! +! this function return the number of elements of the distributed array +! stored in the local memory of the processor "me" for a cyclic +! data distribution. +! Example of the cyclic distribution of a 10 elements array on 4 processors +! array elements | PEs +! a(1) | 0 +! a(2) | 1 +! a(3) | 2 +! a(4) | 3 +! a(5) | 0 +! a(6) | 1 +! a(7) | 2 +! a(8) | 3 +! a(9) | 0 +! a(10) | 1 + + IMPLICIT NONE + INTEGER :: gdim, np, me, r, q + + IF( me >= np .OR. me < 0 ) THEN + WRITE(6,*) ' ** ldim_cyclic: arg no. 3 out of range ' + STOP + END IF + + q = INT(gdim / np) + r = MOD(gdim, np) + + IF( me .LT. r ) THEN + ldim_cyclic = q+1 + ELSE + ldim_cyclic = q + END IF + + RETURN + END FUNCTION ldim_cyclic + +!=----------------------------------------------------------------------------=! + + INTEGER FUNCTION ldim_block(gdim, np, me) + +! gdim = global dimension of distributed array +! np = number of processors +! me = index of the calling processor (starting from 0) +! +! this function return the number of elements of the distributed array +! stored in the local memory of the processor "me" for a balanced block +! data distribution, with the larger block on the lower index processors. +! Example of the block distribution of 10 elements array a on 4 processors +! array elements | PEs +! a(1) | 0 +! a(2) | 0 +! a(3) | 0 +! a(4) | 1 +! a(5) | 1 +! a(6) | 1 +! a(7) | 2 +! a(8) | 2 +! a(9) | 3 +! a(10) | 3 + + IMPLICIT NONE + INTEGER :: gdim, np, me, r, q + + IF( me >= np .OR. me < 0 ) THEN + WRITE(6,*) ' ** ldim_block: arg no. 3 out of range ' + STOP + END IF + + q = INT(gdim / np) + r = MOD(gdim, np) + + IF( me .LT. r ) THEN +! ... if my index is less than the reminder I got an extra element + ldim_block = q+1 + ELSE + ldim_block = q + END IF + + RETURN + END FUNCTION ldim_block + +!=----------------------------------------------------------------------------=! + + INTEGER FUNCTION ldim_block_sca( gdim, np, me ) + +! gdim = global dimension of distributed array +! np = number of processors +! me = index of the calling processor (starting from 0) +! +! this function return the number of elements of the distributed array +! stored in the local memory of the processor "me" for equal block +! data distribution, all block have the same size but the last one. +! Example of the block distribution of 10 elements array a on 4 processors +! array elements | PEs +! a(1) | 0 +! a(2) | 0 +! a(3) | 0 +! a(4) | 1 +! a(5) | 1 +! a(6) | 1 +! a(7) | 2 +! a(8) | 2 +! a(9) | 2 +! a(10) | 3 + + IMPLICIT NONE + INTEGER :: gdim, np, me, nb + + IF( me >= np .OR. me < 0 ) THEN + WRITE(6,*) ' ** ldim_block: arg no. 3 out of range ' + STOP + END IF + + nb = INT( gdim / np ) + IF( MOD( gdim, np ) /= 0 ) THEN + nb = nb+1 + ! ... last processor take the rest + IF( me == ( np - 1 ) ) nb = gdim - (np-1)*nb + END IF + + ldim_block_sca = nb + + + RETURN + END FUNCTION ldim_block_sca + +!=----------------------------------------------------------------------------=! + + + + INTEGER FUNCTION ldim_block_cyclic( N, NB, NPROCS, IPROC ) + +! -- Derived from: NUMROC( N, NB, IPROC, ISRCPROC, NPROCS ) +! -- ScaLAPACK tools routine (version 1.5) -- +! University of Tennessee, Knoxville, Oak Ridge National Laboratory, +! and University of California, Berkeley. +! May 1, 1997 +! +! .. Scalar Arguments .. + IMPLICIT NONE + INTEGER IPROC, ISRCPROC, N, NB, NPROCS, NUMROC +! .. +! +! Purpose +! ======= +! +! NUMROC computes the NUMber of Rows Or Columns of a distributed +! matrix owned by the process indicated by IPROC. +! +! Arguments +! ========= +! +! N (global input) INTEGER +! The number of rows/columns in distributed matrix. +! +! NB (global input) INTEGER +! Block size, size of the blocks the distributed matrix is +! split into. +! +! IPROC (local input) INTEGER +! The coordinate of the process whose local array row or +! column is to be determined. +! +! ISRCPROC (global input) INTEGER +! The coordinate of the process that possesses the first +! row or column of the distributed matrix. +! +! NPROCS (global input) INTEGER +! The total number processes over which the matrix is +! distributed. +! +! ===================================================================== +! +! .. Local Scalars .. + INTEGER EXTRABLKS, MYDIST, NBLOCKS +! .. +! .. Intrinsic Functions .. + INTRINSIC MOD +! .. +! .. Executable Statements .. +! +! Figure PROC's distance from source process +! + ISRCPROC = 0 + MYDIST = MOD( NPROCS+IPROC-ISRCPROC, NPROCS ) +! +! Figure the total number of whole NB blocks N is split up into +! + NBLOCKS = N / NB +! +! Figure the minimum number of rows/cols a process can have +! + NUMROC = (NBLOCKS/NPROCS) * NB +! +! See if there are any extra blocks +! + EXTRABLKS = MOD( NBLOCKS, NPROCS ) +! +! If I have an extra block +! + IF( MYDIST.LT.EXTRABLKS ) THEN + NUMROC = NUMROC + NB +! +! If I have last block, it may be a partial block +! + ELSE IF( MYDIST.EQ.EXTRABLKS ) THEN + NUMROC = NUMROC + MOD( N, NB ) + END IF +! + + ldim_block_cyclic = numroc + RETURN +! +! End of NUMROC +! + END FUNCTION ldim_block_cyclic +! +! Copyright (C) 2002 FPMD group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! + + + INTEGER FUNCTION lind_block(ig, nx, np, me) +! +! INPUT : +! ig global index of the x dimension of array element +! nx dimension of the global array +! np number of processor in the x dimension of the processors grid +! me index of the local processor in the processor grid +! (starting from zero) +! +! OUTPUT : +! +! lind_block return the local index corresponding to the +! global index "ig" for a balanced block distribution +! + + IMPLICIT NONE + + INTEGER :: ig, nx, np, me, r, q + + q = INT(nx/np) + r = MOD(nx,np) + + IF( me < r ) THEN + lind_block = ig - (q+1) * me + ELSE + lind_block = ig - (q+1) * r - q * (me - r) + END IF + + RETURN + END FUNCTION lind_block + + +!=----------------------------------------------------------------------------=! + + + INTEGER FUNCTION lind_block_sca(ig, nx, np, me) +! +! INPUT : +! ig global index of the x dimension of array element +! nx dimension of the global array +! np number of processor in the x dimension of the processors grid +! me index of the local processor in the processor grid +! (starting from zero) +! +! OUTPUT : +! +! lind_block_sca return the local index corresponding to the +! global index "ig" for an equal block distribution +! + + IMPLICIT NONE + + INTEGER :: ig, nx, np, me, nb + + nb = INT( nx / np ) + IF( MOD( nx, np ) /= 0 ) nb = nb+1 + + lind_block_sca = ig - me * nb + + RETURN + END FUNCTION lind_block_sca + + +!=----------------------------------------------------------------------------=! + + + + INTEGER FUNCTION lind_cyclic(ig, nx, np, me) +! +! INPUT : +! ig global index of the x dimension of array element +! nx dimension of the global array +! np number of processor in the x dimension of the processors grid +! me index of the local processor in the processor grid +! (starting from zero) +! +! OUTPUT : +! +! lind_cyclic return the local index corresponding to the +! global index "ig" for a cyclic distribution +! + + IMPLICIT NONE + + INTEGER :: ig, nx, np, me + + lind_cyclic = (ig-1)/np + 1 + + RETURN + END FUNCTION lind_cyclic + + +!=----------------------------------------------------------------------------=! + + + INTEGER FUNCTION lind_block_cyclic( INDXGLOB, NB, NPROCS, IPROC ) + +! Derived from: INDXG2L( INDXGLOB, NB, IPROC, ISRCPROC, NPROCS ) +! -- ScaLAPACK tools routine (version 1.5) -- +! University of Tennessee, Knoxville, Oak Ridge National Laboratory, +! and University of California, Berkeley. +! May 1, 1997 +! +! .. Scalar Arguments .. + IMPLICIT NONE + INTEGER INDXGLOB, IPROC, ISRCPROC, NB, NPROCS, INDXG2L +! .. +! +! Purpose +! ======= +! +! INDXG2L computes the local index of a distributed matrix entry +! pointed to by the global index INDXGLOB. +! +! Arguments +! ========= +! +! INDXGLOB (global input) INTEGER +! The global index of the distributed matrix entry. +! +! NB (global input) INTEGER +! Block size, size of the blocks the distributed matrix is +! split into. +! +! IPROC (local dummy) INTEGER +! Dummy argument in this case in order to unify the calling +! sequence of the tool-routines. +! +! ISRCPROC (local dummy) INTEGER +! Dummy argument in this case in order to unify the calling +! sequence of the tool-routines. +! +! NPROCS (global input) INTEGER +! The total number processes over which the distributed +! matrix is distributed. +! +! ===================================================================== +! +! .. Intrinsic Functions .. + INTRINSIC MOD +! .. +! .. Executable Statements .. +! + ISRCPROC = 0 + INDXG2L = NB*((INDXGLOB-1)/(NB*NPROCS))+MOD(INDXGLOB-1,NB)+1 + lind_block_cyclic = INDXG2L +! + RETURN +! +! End of INDXG2L +! + END FUNCTION lind_block_cyclic + + +!=----------------------------------------------------------------------------=! + + + INTEGER FUNCTION gind_cyclic( lind, n, np, me ) + +! This function computes the global index of a distributed array entry +! pointed to by the local index lind of the process indicated by me. +! lind local index of the distributed matrix entry. +! N is the size of the global array. +! me The coordinate of the process whose local array row or +! column is to be determined. +! np The total number processes over which the distributed +! matrix is distributed. +! + + INTEGER, INTENT(IN) :: lind, n, me, np + INTEGER r, q + + gind_cyclic = (lind-1) * np + me + 1 + + RETURN + END FUNCTION gind_cyclic + + +!=----------------------------------------------------------------------------=! + + + INTEGER FUNCTION gind_block( lind, n, np, me ) + +! This function computes the global index of a distributed array entry +! pointed to by the local index lind of the process indicated by me. +! lind local index of the distributed matrix entry. +! N is the size of the global array. +! me The coordinate of the process whose local array row or +! column is to be determined. +! np The total number processes over which the distributed +! matrix is distributed. + + + INTEGER, INTENT(IN) :: lind, n, me, np + INTEGER r, q + + q = INT(n/np) + r = MOD(n,np) + IF( me < r ) THEN + gind_block = (Q+1)*me + lind + ELSE + gind_block = Q*me + R + lind + END IF + + RETURN + END FUNCTION gind_block + +!=----------------------------------------------------------------------------=! + + INTEGER FUNCTION gind_block_sca( lind, n, np, me ) + +! This function computes the global index of a distributed array entry +! pointed to by the local index lind of the process indicated by me. +! lind local index of the distributed matrix entry. +! N is the size of the global array. +! me The coordinate of the process whose local array row or +! column is to be determined. +! np The total number processes over which the distributed +! matrix is distributed. + + + INTEGER, INTENT(IN) :: lind, n, me, np + INTEGER nb + + IF( me >= np .OR. me < 0 ) THEN + WRITE(6,*) ' ** ldim_block: arg no. 3 out of range ' + STOP + END IF + + nb = INT( n / np ) + IF( MOD( n, np ) /= 0 ) nb = nb+1 + + gind_block_sca = lind + me * nb + + RETURN + + END FUNCTION gind_block_sca + + +!=----------------------------------------------------------------------------=! + + INTEGER FUNCTION gind_block_cyclic( lind, n, nb, np, me ) + +! This function computes the global index of a distributed array entry +! pointed to by the local index lind of the process indicated by me. +! lind local index of the distributed matrix entry. +! N is the size of the global array. +! NB size of the blocks the distributed matrix is split into. +! me The coordinate of the process whose local array row or +! column is to be determined. +! np The total number processes over which the distributed +! matrix is distributed. + + + INTEGER, INTENT(IN) :: lind, n, nb, me, np + INTEGER r, q, isrc + + isrc = 0 + gind_block_cyclic = np*NB*((lind-1)/NB) + & + MOD(lind-1,NB) + MOD(np+me-isrc, np)*NB + 1 + + RETURN + END FUNCTION gind_block_cyclic + diff --git a/tests/apps/miniDFT/tests/src/divide.f90 b/tests/apps/miniDFT/tests/src/divide.f90 new file mode 100644 index 0000000000..fa0d3f5687 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/divide.f90 @@ -0,0 +1,55 @@ +! +! Copyright (C) 2012 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +!----------------------------------------------------------------------- +SUBROUTINE divide (comm, ntodiv, startn, lastn) + !----------------------------------------------------------------------- + ! Divide ntodiv poins across processors belonging to communicator comm + ! Each processor gets points from startn to lastn + ! + ! + USE mp, ONLY : mp_size, mp_rank + IMPLICIT NONE + ! + INTEGER, INTENT(in) :: comm + INTEGER, INTENT(in) :: ntodiv + INTEGER, INTENT(out):: startn, lastn + ! + INTEGER :: me_comm, nproc_comm + ! + INTEGER :: nb, resto, idx, ip + ! number of bands per processor + ! one additional band if me_pool+1 <= resto + ! counter on bands + ! counter on processors + ! + nproc_comm = mp_size(comm) + me_comm = mp_rank(comm) + ! + nb = ntodiv / nproc_comm + resto = ntodiv - nb * nproc_comm + idx = 0 + DO ip = 1, nproc_comm + IF (ip <= resto) THEN + IF (me_comm+1 == ip) THEN + startn = idx + 1 + lastn = startn + nb + ENDIF + idx = idx + nb + 1 + ELSE + IF (me_comm+1 == ip) THEN + startn = idx + 1 + lastn = startn + nb - 1 + ENDIF + idx = idx + nb + ENDIF + ENDDO + RETURN + +END SUBROUTINE divide + diff --git a/tests/apps/miniDFT/tests/src/divide_et_impera.f90 b/tests/apps/miniDFT/tests/src/divide_et_impera.f90 new file mode 100644 index 0000000000..ba73068c94 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/divide_et_impera.f90 @@ -0,0 +1,77 @@ +! +! Copyright (C) 2001-2008 PWSCF group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +!---------------------------------------------------------------------------- +SUBROUTINE divide_et_impera( xk, wk, isk, lsda, nkstot, nks ) + !---------------------------------------------------------------------------- + ! + ! ... This routine divides the k points across nodes, sets the variable + ! ... nks equal to the local (on this processors) number of k-points + ! ... (nkstot on input is the total number of k-points) + ! ... The distributed has "granularity kunit", that is, kunit consecutive + ! ... points stay on the same processor. Usually kunit=1; kunit=2 is used + ! ... in phonon calculations, when one has interspersed k_i and k_i+q and + ! ... it is needed that they stay on the same processor + ! + USE io_global, only : stdout + USE kinds, ONLY : DP + USE mp_global, ONLY : my_pool_id, npool, kunit + ! + IMPLICIT NONE + ! + LOGICAL, INTENT(IN) :: lsda + ! logical for local spin density approx. + INTEGER, INTENT(IN) :: nkstot + ! total number of k-points + INTEGER, INTENT(INOUT) :: isk(nkstot) + ! spin index of each kpoint (when lsda=.t.) + INTEGER, INTENT(OUT) :: nks + ! number of k-points per pool + REAL (DP), INTENT(INOUT) :: xk(3,nkstot), wk(nkstot) + ! k-points + ! k-point weights + ! + ! + INTEGER :: ik, nbase, rest + ! + ! + IF ( MOD( nkstot, kunit ) /= 0 ) & + CALL errore( 'd_&_i', ' nkstot/kunit is not an integer', nkstot ) + ! + nks = kunit * ( nkstot / kunit / npool ) + ! + IF ( nks == 0 ) CALL errore( 'd_&_i', ' some nodes have no k-points', 1 ) + ! + rest = ( nkstot - nks * npool ) / kunit + ! + IF ( ( my_pool_id + 1 ) <= rest ) nks = nks + kunit + ! + ! ... calculates nbase = the position in the list of the first point that + ! ... belong to this npool - 1 + ! + nbase = nks * my_pool_id + ! + IF ( ( my_pool_id + 1 ) > rest ) nbase = nbase + rest * kunit + ! + ! ... displaces these points in the first positions of the list + ! + IF ( nbase > 0 ) THEN + ! + xk(:,1:nks) = xk(:,nbase+1:nbase+nks) + ! + wk(1:nks) = wk(nbase+1:nbase+nks) + ! + IF ( lsda ) isk(1:nks) = isk(nbase+1:nbase+nks) + ! + ! + END IF + ! + ! + RETURN + ! +END SUBROUTINE divide_et_impera diff --git a/tests/apps/miniDFT/tests/src/dqvan2.f90 b/tests/apps/miniDFT/tests/src/dqvan2.f90 new file mode 100644 index 0000000000..13402c6120 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/dqvan2.f90 @@ -0,0 +1,169 @@ +! +! Copyright (C) 2001 PWSCF group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +!----------------------------------------------------------------------- +subroutine dqvan2 (ngy, ih, jh, np, qmod, dqg, ylmk0, dylmk0, ipol) + !----------------------------------------------------------------------- + ! + ! This routine computes the derivatives of the fourier transform of + ! the Q function needed in stress assuming that the radial fourier + ! trasform is already computed and stored in table qrad. + ! + ! The formula implemented here is + ! + ! dq(g,l,k) = sum_lm (-i)^l ap(lm,l,k) * + ! ( yr_lm(g^) dqrad(g,l,l,k) + dyr_lm(g^) qrad(g,l,l,k)) + ! + ! here the dummy variables + ! + USE kinds, ONLY: DP + USE gvect, ONLY: g + USE us, ONLY: dq, qrad + USE uspp_param, ONLY: lmaxq, nbetam + USE uspp, ONLY: nlx, lpl, lpx, ap, indv, nhtol, nhtolm + implicit none + integer :: ngy, ih, jh, np, ipol + ! input: the number of G vectors to compute + ! input: the first index of Q + ! input: the second index of Q + ! input: the number of the pseudopotential + ! input: the polarization of the derivative + + real(DP) :: ylmk0 (ngy, lmaxq * lmaxq), dylmk0 (ngy, lmaxq * lmaxq), & + qmod (ngy) + ! the spherical harmonics + ! the spherical harmonics derivetives + ! input: moduli of the q+g vectors + complex(DP) :: dqg (ngy) + ! output: the fourier transform of interest + ! + ! here the local variables + ! + + complex(DP) :: sig + ! (-i)^L + + integer :: nb, mb, ijv, ivl, jvl, ig, lp, l, lm, i0, i1, i2, i3 + ! the atomic index corresponding to ih + ! the atomic index corresponding to jh + ! combined index (nb,mb) + ! the lm corresponding to ih + ! the lm corresponding to jh + ! counter on g vectors + ! the actual LM + ! the angular momentum L + ! the possible LM's compatible with ih,j + ! counters for interpolation table + + real(DP) :: sixth, dqi, qm, px, ux, vx, wx, uvx, pwx, work, work1, qm1 + ! 1 divided by six + ! 1 divided dq + ! qmod/dq + ! measures for interpolation table + ! auxiliary variables for intepolation + ! auxiliary variable + ! auxiliary variable + ! + ! compute the indices which correspond to ih,jh + ! + sixth = 1.d0 / 6.d0 + dqi = 1 / dq + nb = indv (ih, np) + mb = indv (jh, np) + if (nb.ge.mb) then + ijv = nb * (nb - 1) / 2 + mb + else + ijv = mb * (mb - 1) / 2 + nb + endif + ivl = nhtolm (ih, np) + jvl = nhtolm (jh, np) + + if (nb > nbetam .OR. mb > nbetam) & + call errore (' dqvan2 ', ' wrong dimensions (1)', MAX(nb,mb)) + if (ivl > nlx .OR. jvl > nlx) & + call errore (' dqvan2 ', ' wrong dimensions (2)', MAX(ivl,jvl)) + + dqg(:) = (0.d0,0.d0) + ! + ! and make the sum over the non zero LM + ! + do lm = 1, lpx (ivl, jvl) + lp = lpl (ivl, jvl, lm) + ! + ! extraction of angular momentum l from lp: + ! + if (lp.eq.1) then + l = 1 + elseif ( (lp.ge.2) .and. (lp.le.4) ) then + l = 2 + elseif ( (lp.ge.5) .and. (lp.le.9) ) then + l = 3 + elseif ( (lp.ge.10) .and. (lp.le.16) ) then + l = 4 + elseif ( (lp.ge.17) .and. (lp.le.25) ) then + l = 5 + elseif ( (lp.ge.26) .and. (lp.le.36) ) then + l = 6 + elseif ( (lp.ge.37) .and. (lp.le.49) ) then + l = 7 + else + call errore (' qvan ', ' lp.gt.49 ', lp) + endif + + sig = (0.d0, -1.d0) ** (l - 1) + sig = sig * ap (lp, ivl, jvl) + ! + qm1 = -1.0_dp ! any number smaller than qmod(1) + ! +!$OMP PARALLEL DO DEFAULT(SHARED) PRIVATE(qm,px,ux,vx,wx,i0,i1,i2,i3,uvx,pwx,work,work1) + do ig = 1, ngy + ! + ! calculate quantites depending on the module of G only when needed + ! +#if !defined(__OPENMP) + IF ( ABS( qmod(ig) - qm1 ) > 1.0D-6 ) THEN +#endif + qm = qmod (ig) * dqi + px = qm - int (qm) + ux = 1.d0 - px + vx = 2.d0 - px + wx = 3.d0 - px + i0 = qm + 1 + i1 = qm + 2 + i2 = qm + 3 + i3 = qm + 4 + uvx = ux * vx * sixth + + pwx = px * wx * 0.5d0 + + work = qrad (i0, ijv, l, np) * uvx * wx + & + qrad (i1, ijv, l, np) * pwx * vx - & + qrad (i2, ijv, l, np) * pwx * ux + & + qrad (i3, ijv, l, np) * px * uvx + work1 = - qrad(i0, ijv, l, np) * (ux*vx + vx*wx + ux*wx) * sixth & + + qrad(i1, ijv, l, np) * (wx*vx - px*wx - px*vx) * 0.5d0 & + - qrad(i2, ijv, l, np) * (wx*ux - px*wx - px*ux) * 0.5d0 & + + qrad(i3, ijv, l, np) * (ux*vx - px*ux - px*vx) * sixth + + work1 = work1 * dqi + +#if !defined(__OPENMP) + qm1 = qmod(ig) + END IF +#endif + + dqg (ig) = dqg (ig) + sig * dylmk0 (ig, lp) * work + if (qmod (ig) > 1.d-9) dqg (ig) = dqg (ig) + & + sig * ylmk0 (ig, lp) * work1 * g (ipol, ig) / qmod (ig) + enddo +!$OMP END PARALLEL DO + + enddo + return + +end subroutine dqvan2 + diff --git a/tests/apps/miniDFT/tests/src/drhoc.f90 b/tests/apps/miniDFT/tests/src/drhoc.f90 new file mode 100644 index 0000000000..c378899ea2 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/drhoc.f90 @@ -0,0 +1,76 @@ +! +! Copyright (C) 2001-2007 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +!----------------------------------------------------------------------- +subroutine drhoc (ngl, gl, omega, tpiba2, mesh, r, rab, rhoc, rhocg) + !----------------------------------------------------------------------- + ! + USE kinds + USE constants, ONLY : pi, fpi + implicit none + ! + ! first the dummy variables + ! + integer :: ngl, mesh + ! input: the number of g shell + ! input: the number of radial mesh points + + real(DP) :: gl (ngl), r (mesh), rab (mesh), rhoc (mesh), omega, & + tpiba2, rhocg (ngl) + ! input: the number of G shells + ! input: the radial mesh + ! input: the derivative of the radial mesh + ! input: the radial core charge + ! input: the volume of the unit cell + ! input: 2 times pi / alat + ! output: the fourier transform of the core charge + ! + ! here the local variables + ! + real(DP) :: gx, rhocg1 + ! the modulus of g for a given shell + ! the fourier transform + real(DP), allocatable :: aux (:) + ! auxiliary memory for integration + + integer :: ir, igl, igl0 + ! counter on radial mesh points + ! counter on g shells + ! lower limit for loop on ngl + + allocate (aux( mesh)) + ! + ! G=0 term + ! + if (gl (1) < 1.0d-8) then + do ir = 1, mesh + aux (ir) = r (ir) **2 * rhoc (ir) + enddo + call simpson (mesh, aux, rab, rhocg1) + rhocg (1) = fpi * rhocg1 / omega + igl0 = 2 + else + igl0 = 1 + endif + ! + ! G <> 0 term + ! + do igl = igl0, ngl + gx = sqrt (gl (igl) * tpiba2) + call sph_bes (mesh, r, gx, 0, aux) + do ir = 1, mesh + aux (ir) = r (ir) **2 * rhoc (ir) * aux (ir) + enddo + call simpson (mesh, aux, rab, rhocg1) + rhocg (igl) = fpi * rhocg1 / omega + enddo + deallocate(aux) + ! + return +end subroutine drhoc + diff --git a/tests/apps/miniDFT/tests/src/dvloc_of_g.f90 b/tests/apps/miniDFT/tests/src/dvloc_of_g.f90 new file mode 100644 index 0000000000..9b9f53a3b9 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/dvloc_of_g.f90 @@ -0,0 +1,132 @@ +! +! Copyright (C) 2001-2007 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +!---------------------------------------------------------------------- +subroutine dvloc_of_g (mesh, msh, rab, r, vloc_at, zp, tpiba2, ngl, gl, & + omega, dvloc) + !---------------------------------------------------------------------- + ! + ! dvloc = D Vloc (g^2) / D g^2 = (1/2g) * D Vloc(g) / D g + ! + USE kinds + USE constants , ONLY : pi, fpi, e2, eps8 + implicit none + ! + ! first the dummy variables + ! + integer, intent(in) :: ngl, mesh, msh + ! the number of shell of G vectors + ! max number of mesh points + ! number of mesh points for radial integration + + real(DP), intent(in) :: zp, rab (mesh), r (mesh), vloc_at (mesh), & + tpiba2, omega, gl (ngl) + ! valence pseudocharge + ! the derivative of the radial grid + ! the radial grid + ! the pseudo on the radial grid + ! 2 pi / alat + ! the volume of the unit cell + ! the moduli of g vectors for each s + ! + real(DP), intent(out) :: dvloc (ngl) + ! the fourier transform dVloc/dG + ! + real(DP) :: vlcp, g2a, gx + real(DP), allocatable :: aux (:), aux1 (:) + real(DP), external :: qe_erf + + integer :: i, igl, igl0 + ! counter on erf functions or gaussians + ! counter on g shells vectors + ! first shell with g != 0 + + ! the G=0 component is not computed + if (gl (1) < eps8) then + dvloc (1) = 0.0d0 + igl0 = 2 + else + igl0 = 1 + endif + + ! Pseudopotentials in numerical form (Vloc contains the local part) + ! In order to perform the Fourier transform, a term erf(r)/r is + ! subtracted in real space and added again in G space + + allocate (aux( mesh)) + allocate (aux1( mesh)) + ! + ! This is the part of the integrand function + ! indipendent of |G| in real space + ! + do i = 1, msh + aux1 (i) = r (i) * vloc_at (i) + zp * e2 * qe_erf (r (i) ) + enddo + do igl = igl0, ngl + gx = sqrt (gl (igl) * tpiba2) + ! + ! and here we perform the integral, after multiplying for the |G| + ! dependent part + ! + ! DV(g)/Dg = Integral of r (Dj_0(gr)/Dg) V(r) dr + do i = 1, msh + aux (i) = aux1 (i) * (r (i) * cos (gx * r (i) ) / gx - sin (gx & + * r (i) ) / gx**2) + enddo + call simpson (msh, aux, rab, vlcp) + ! DV(g^2)/Dg^2 = (DV(g)/Dg)/2g + vlcp = fpi / omega / 2.0d0 / gx * vlcp + ! subtract the long-range term + g2a = gl (igl) * tpiba2 / 4.d0 + vlcp = vlcp + fpi / omega * zp * e2 * exp ( - g2a) * (g2a + & + 1.d0) / (gl (igl) * tpiba2) **2 + dvloc (igl) = vlcp + enddo + deallocate (aux1) + deallocate (aux) + + return +end subroutine dvloc_of_g +! +!---------------------------------------------------------------------- +subroutine dvloc_coul (zp, tpiba2, ngl, gl, omega, dvloc) + !---------------------------------------------------------------------- + ! + ! Fourier transform of the Coulomb potential - For all-electron + ! calculations, in specific cases only, for testing purposes + ! + USE kinds + USE constants , ONLY : fpi, e2, eps8 + implicit none + ! + integer, intent(in) :: ngl + ! the number of shell of G vectors + real(DP), intent(in) :: zp, tpiba2, omega, gl (ngl) + ! valence pseudocharge + ! 2 pi / alat + ! the volume of the unit cell + ! the moduli of g vectors for each s + real(DP), intent(out) :: dvloc (ngl) + ! fourier transform: dvloc = D Vloc (g^2) / D g^2 = 4pi e^2/omegai /G^4 + ! + integer :: igl0 + ! first shell with g != 0 + + ! the G=0 component is 0 + if (gl (1) < eps8) then + dvloc (1) = 0.0d0 + igl0 = 2 + else + igl0 = 1 + endif + + dvloc (igl0:ngl) = fpi * zp * e2 / omega / ( tpiba2 * gl (igl0:ngl) ) ** 2 + +return +end subroutine dvloc_coul + diff --git a/tests/apps/miniDFT/tests/src/dylmr2.f90 b/tests/apps/miniDFT/tests/src/dylmr2.f90 new file mode 100644 index 0000000000..63e1495ada --- /dev/null +++ b/tests/apps/miniDFT/tests/src/dylmr2.f90 @@ -0,0 +1,95 @@ +! +! Copyright (C) 2001 PWSCF group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +!----------------------------------------------------------------------- +subroutine dylmr2 (nylm, ngy, g, gg, dylm, ipol) + !----------------------------------------------------------------------- + ! + ! compute \partial Y_lm(G) \over \partial (G)_ipol + ! using simple numerical derivation (SdG) + ! The spherical harmonics are calculated in ylmr2 + ! + USE kinds, ONLY : DP + implicit none + ! + ! here the I/O variables + ! + integer :: nylm, ngy, ipol + ! input: number of spherical harmonics + ! input: the number of g vectors to compute + ! input: desired polarization + real(DP) :: g (3, ngy), gg (ngy), dylm (ngy, nylm) + ! input: the coordinates of g vectors + ! input: the moduli of g vectors + ! output: the spherical harmonics derivatives + ! + ! and here the local variables + ! + integer :: ig, lm + ! counter on g vectors + ! counter on l,m component + + real(DP), parameter :: delta = 1.d-6 + real(DP), allocatable :: dg (:), dgi (:), gx (:,:), ggx (:), ylmaux (:,:) + ! dg is the finite increment for numerical derivation: + ! dg = delta |G| = delta * sqrt(gg) + ! dgi= 1 /(delta * sqrt(gg)) + ! gx = g +/- dg + ! ggx = gx^2 + ! + allocate ( gx(3,ngy), ggx(ngy), dg(ngy), dgi(ngy), ylmaux(ngy,nylm) ) + +!$OMP PARALLEL DO DEFAULT(SHARED) PRIVATE(ig) + do ig = 1, ngy + dg (ig) = delta * sqrt (gg (ig) ) + if (gg (ig) .gt. 1.d-9) then + dgi (ig) = 1.d0 / dg (ig) + else + dgi (ig) = 0.d0 + endif + enddo +!$OMP END PARALLEL DO + + call dcopy (3 * ngy, g, 1, gx, 1) + +!$OMP PARALLEL DO DEFAULT(SHARED) PRIVATE(ig) + do ig = 1, ngy + gx (ipol, ig) = g (ipol, ig) + dg (ig) + ggx (ig) = gx (1, ig) * gx (1, ig) + & + gx (2, ig) * gx (2, ig) + & + gx (3, ig) * gx (3, ig) + enddo +!$OMP END PARALLEL DO + + call ylmr2 (nylm, ngy, gx, ggx, dylm) + +!$OMP PARALLEL DO DEFAULT(SHARED) PRIVATE(ig) + do ig = 1, ngy + gx (ipol, ig) = g (ipol, ig) - dg (ig) + ggx (ig) = gx (1, ig) * gx (1, ig) + & + gx (2, ig) * gx (2, ig) + & + gx (3, ig) * gx (3, ig) + enddo +!$OMP END PARALLEL DO + + call ylmr2 (nylm, ngy, gx, ggx, ylmaux) + + call daxpy (ngy * nylm, - 1.d0, ylmaux, 1, dylm, 1) + + do lm = 1, nylm +!$OMP PARALLEL DO DEFAULT(SHARED) PRIVATE(ig) + do ig = 1, ngy + dylm (ig, lm) = dylm (ig, lm) * 0.5d0 * dgi (ig) + enddo +!$OMP END PARALLEL DO + enddo + + deallocate ( gx, ggx, dg, dgi, ylmaux ) + + return +end subroutine dylmr2 + diff --git a/tests/apps/miniDFT/tests/src/electrons.f90 b/tests/apps/miniDFT/tests/src/electrons.f90 new file mode 100644 index 0000000000..700f2f3fb0 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/electrons.f90 @@ -0,0 +1,579 @@ +! +! Copyright (C) 2001-2011 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +!---------------------------------------------------------------------------- +SUBROUTINE electrons() + !---------------------------------------------------------------------------- + ! + ! ... This routine is a driver of the self-consistent cycle. + ! ... It uses the routine c_bands for computing the bands at fixed + ! ... Hamiltonian, the routine sum_band to compute the charge density, + ! ... the routine v_of_rho to compute the new potential and the routine + ! ... mix_rho to mix input and output charge densities. + ! ... It prints on output the total energy and its decomposition in + ! ... the separate contributions. + ! + USE kinds, ONLY : DP + USE constants, ONLY : eps8, pi + USE io_global, ONLY : stdout, ionode + USE cell_base, ONLY : at, bg, alat, omega, tpiba2 + USE ions_base, ONLY : zv, nat, nsp, ityp, tau, compute_eextfor + USE basis, ONLY : starting_pot, starting_wfc + USE fft_base, ONLY : dfftp + USE gvect, ONLY : ngm, gstart, nl, nlm, g, gg, gcutm + USE gvecs, ONLY : doublegrid, ngms + USE klist, ONLY : xk, wk, nelec, ngk, nks, nkstot, lgauss + USE lsda_mod, ONLY : lsda, nspin, magtot, absmag, isk + USE vlocal, ONLY : strf + USE wvfct, ONLY : nbnd, et, npwx, ecutwfc + USE ener, ONLY : etot, hwf_energy, eband, deband, ehart, & + vtxc, etxc, etxcc, ewld, demet, epaw + USE scf, ONLY : scf_type, scf_type_COPY, & + create_scf_type, destroy_scf_type, & + rho, rho_core, rhog_core, & + v, vltot, vrs, kedtau, vnew + USE control_flags, ONLY : mixing_beta, tr2, ethr, niter, nmix, & + iprint, istep, lscf, lmd, conv_elec, & + restart, io_level, do_makov_payne, & + iverbosity, textfor + USE io_files, ONLY : iunwfc, iunocc, nwordwfc, output_drho, & + iunefield, iunpaw + USE buffers, ONLY : save_buffer + USE extfield, ONLY : tefield, etotefield + USE wavefunctions_module, ONLY : evc, psic + USE spin_orb, ONLY : domag + USE control_flags, ONLY : adapt_thr, tr2_init, tr2_multi + USE mp_global, ONLY : intra_bgrp_comm, nbgrp, mpime, & + inter_bgrp_comm, my_bgrp_id + USE mp, ONLY : mp_sum + ! + ! + USE uspp_param, ONLY : nh, nhm ! used for PAW + USE dfunct, only : newd + ! + ! + IMPLICIT NONE + ! + ! ... a few local variables + ! + real(dp) :: v_kin_r !subsitute dummy variable for v%kin_r + real(dp) :: eth !usbsitutue dummy variable for ldaU%eth + REAL(DP) :: & + dr2, &! the norm of the diffence between potential + charge, &! the total charge + deband_hwf, &! deband for the Harris-Weinert-Foulkes functional + mag ! local magnetization + INTEGER :: & + i, &! counter on polarization + idum, &! dummy counter on iterations + iter, &! counter on iterations + ik_, &! used to read ik from restart file + kilobytes + REAL(DP) :: & + tr2_min, &! estimated error on energy coming from diagonalization + descf, &! correction for variational energy + en_el=0.0_DP,&! electric field contribution to the total energy + eext=0.0_DP ! external forces contribution to the total energy + LOGICAL :: & + first + ! + ! ... auxiliary variables for calculating and storing temporary copies of + ! ... the charge density and of the HXC-potential + ! + type (scf_type), save :: rhoin ! used to store rho_in of current/next iteration + ! + ! ... external functions + ! + REAL(DP), EXTERNAL :: ewald, get_clock + REAL(DP) :: tr2_final ! final threshold for exx minimization + ! when using adaptive thresholds. + iter = 0 + ik_ = 0 + dr2 = 0.0_dp + tr2_final = tr2 + ! + WRITE( stdout, 9000 ) get_clock( 'MiniDFT' ) + ! + CALL memstat( kilobytes ) + ! + IF ( kilobytes > 0 ) WRITE( stdout, 9001 ) kilobytes/1000.0 + ! + CALL flush_unit( stdout ) + ! + ! + CALL start_clock( 'electrons' ) + ! + ! + CALL flush_unit( stdout ) + ! + ! ... calculates the ewald contribution to total energy + ! + ewld = ewald( alat, nat, nsp, ityp, zv, at, bg, tau, & + omega, g, gg, ngm, gcutm, gstart, .false., strf ) + ! + call create_scf_type ( rhoin ) + ! +10 CONTINUE + ! + ! ... Convergence threshold for iterative diagonalization + ! + ! ... for the first scf iteration of each ionic step (after the first), + ! ... the threshold is fixed to a default value of 1.D-6 + ! + IF ( istep > 0 ) ethr = 1.D-6 + ! + WRITE( stdout, 9002 ) + ! + CALL flush_unit( stdout ) + + ! + !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + !%%%%%%%%%%%%%%%%%%%% iterate ! %%%%%%%%%%%%%%%%%%%%% + !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + ! + DO idum = 1, niter + ! + IF ( check_stop_now() ) RETURN + ! + iter = iter + 1 + ! + WRITE( stdout, 9010 ) iter, ecutwfc, mixing_beta + ! + CALL flush_unit( stdout ) + ! + ! ... Convergence threshold for iterative diagonalization is + ! ... automatically updated during self consistency + ! + IF ( iter > 1 .AND. ik_ == 0 ) THEN + ! + IF ( iter == 2 ) ethr = 1.D-2 + ethr = MIN( ethr, 0.1D0*dr2 / MAX( 1.D0, nelec ) ) + ! ... do not allow convergence threshold to become too small: + ! ... iterative diagonalization may become unstable + ethr = MAX( ethr, 1.D-13 ) + ! + END IF + ! + first = ( iter == 1 ) + ! + ! ... deband = - \sum_v <\psi_v | V_h + V_xc |\psi_v> is calculated a + ! ... first time here using the input density and potential ( to be + ! ... used to calculate the Harris-Weinert-Foulkes energy ) + ! + deband_hwf = delta_e() + ! + ! save input current density in rhoin + call scf_type_COPY( rho, rhoin ) + ! + scf_step: DO + ! + ! ... tr2_min is set to an estimate of the error on the energy + ! ... due to diagonalization - used only for the first scf iteration + ! + tr2_min = 0.D0 + ! + IF ( first ) tr2_min = ethr*MAX( 1.D0, nelec ) + ! + ! ... diagonalization of the KS hamiltonian + ! + ! + CALL c_bands( iter, ik_, dr2 ) + ! + ! + IF ( check_stop_now() ) RETURN + ! + ! ... xk, wk, isk, et, wg are distributed across pools; + ! ... the first node has a complete copy of xk, wk, isk, + ! ... while eigenvalues et and weights wg must be + ! ... explicitely collected to the first node + ! ... this is done here for et, in sum_band for wg + ! + CALL poolrecover( et, nbnd, nkstot, nks ) + ! + ! ... the new density is computed here + CALL sum_band() + ! PAW : sum_band computes new becsum (stored in uspp modules) and a + ! subtly different copy in rho%bec (scf module) + ! + ! ... the Harris-Weinert-Foulkes energy is computed here using only + ! ... quantities obtained from the input density + ! + hwf_energy = eband + deband_hwf + (etxc - etxcc) + ewld + ehart + demet + ! + ! + ! ... calculate total and absolute magnetization + ! + ! + ! ... eband = \sum_v \epsilon_v is calculated by sum_band + ! ... deband = - \sum_v <\psi_v | V_h + V_xc |\psi_v> + ! ... eband + deband = \sum_v <\psi_v | T + Vion |\psi_v> + ! + deband = delta_e() + ! + ! ... mix_rho mixes several quantities: rho in g-space, tauk (for meta-gga) + ! ... ns (for lda+u) and becsum (for paw) + ! + CALL mix_rho( rho, rhoin, mixing_beta, dr2, tr2_min, iter, nmix, conv_elec ) + ! + ! ... if convergence is achieved or if the self-consistency error + ! ... (dr2) is smaller than the estimated error due to diagonalization + ! ... (tr2_min), rhoin and rho are unchanged: rhoin contains the input + ! ... density and rho contains the output density + ! ... In the other cases rhoin contains the mixed charge density + ! ... (the new input density) while rho is unchanged + ! + IF ( first .and. nat > 0) THEN + ! + ! ... first scf iteration: check if the threshold on diagonalization + ! ... (ethr) was small enough wrt the error in self-consistency (dr2) + ! ... if not, perform a new diagonalization with reduced threshold + ! + first = .FALSE. + ! + IF ( dr2 < tr2_min ) THEN + ! + WRITE( stdout, '(/,5X,"Threshold (ethr) on eigenvalues was ", & + & "too large:",/,5X, & + & "Diagonalizing with lowered threshold",/)' ) + ! + ethr = 0.1D0*dr2 / MAX( 1.D0, nelec ) + ! + CYCLE scf_step + ! + END IF + ! + END IF + ! + not_converged_electrons : & + IF ( .NOT. conv_elec ) THEN + ! ... no convergence yet: calculate new potential from mixed + ! ... charge density (i.e. the new estimate) + ! + CALL v_of_rho( rhoin, rho_core, rhog_core, & + ehart, etxc, vtxc, eth, etotefield, charge, v) + ! + ! ... estimate correction needed to have variational energy: + ! ... T + E_ion (eband + deband) are calculated in sum_band + ! ... and delta_e using the output charge density rho; + ! ... E_H (ehart) and E_xc (etxc) are calculated in v_of_rho + ! ... above, using the mixed charge density rhoin%of_r. + ! ... delta_escf corrects for this difference at first order + ! + descf = delta_escf() + ! + ! ... now copy the mixed charge density in R- and G-space in rho + ! + CALL scf_type_COPY( rhoin, rho ) + ! + ! ... write the charge density to file + ! ... also write ldaU ns coeffs and PAW becsum + !call infomsg( "electrons.f90:275","skipping write_rho; not implemented") + !CALL write_rho( rho, nspin ) + ! + ELSE not_converged_electrons + ! + ! ... convergence reached: + ! ... 1) the output HXC-potential is saved in vr + ! ... 2) vnew contains V(out)-V(in) ( used to correct the forces ). + ! + vnew%of_r(:,:) = v%of_r(:,:) + ! + CALL v_of_rho( rho,rho_core,rhog_core, & + ehart, etxc, vtxc, eth, etotefield, charge, v) + ! + + ! + vnew%of_r(:,:) = v%of_r(:,:) - vnew%of_r(:,:) + ! + ! ... note that rho is here the output, not mixed, charge density + ! ... so correction for variational energy is no longer needed + ! + descf = 0._dp + ! + END IF not_converged_electrons + ! + ! + ! ... if we didn't cycle before we can exit the do-loop + ! + EXIT scf_step + ! + END DO scf_step + ! + ! + ! ... define the total local potential (external + scf) + ! + CALL set_vrs( vrs, vltot, v%of_r, kedtau, v_kin_r, dfftp%nnr, nspin, doublegrid ) + ! + ! ... in the US case we have to recompute the self-consistent + ! ... term in the nonlocal potential + ! + ! ... PAW: newd contains PAW updates of NL coefficients + !write(*,*) "electrons.f90:480 this call to newd() might be moot if .not.okpaw" + CALL newd() + ! + ! ... save converged wfc if they have not been written previously + ! + !BMA: eliminiate filesystem activity for miniDFT + !IF ( nks == 1 .AND. (io_level < 2) ) & + ! CALL save_buffer ( evc, nwordwfc, iunwfc, nks ) + ! + ! ... calculate the polarization + ! + en_el=0.d0 + ! + ! ... write recover file + ! + CALL save_in_electrons( iter, dr2 ) + ! + ! + WRITE( stdout, 9000 ) get_clock( 'MiniDFT' ) + ! + IF ( conv_elec ) WRITE( stdout, 9101 ) + ! + IF ( conv_elec .OR. MOD( iter, iprint ) == 0 ) THEN + ! + CALL print_ks_energies() + ! + END IF + ! + IF ( ABS( charge - nelec ) / charge > 1.D-7 ) THEN + WRITE( stdout, 9050 ) charge, nelec + IF ( ABS( charge - nelec ) / charge > 1.D-3 ) THEN + IF (.not.lgauss) THEN + CALL errore( 'electrons', 'charge is wrong: smearing is needed', 1 ) + ELSE + CALL errore( 'electrons', 'charge is wrong', 1 ) + END IF + END IF + END IF + ! + etot = eband + ( etxc - etxcc ) + ewld + ehart + deband + demet + descf +en_el + IF( textfor ) THEN + eext = compute_eextfor() + etot = etot + eext + END IF + ! + etot = etot + hwf_energy = hwf_energy + ! + IF ( tefield ) THEN + etot = etot + etotefield + hwf_energy = hwf_energy + etotefield + END IF + ! + ! + IF ( ( conv_elec .OR. MOD( iter, iprint ) == 0 ) .AND. .NOT. lmd ) THEN + ! + IF ( dr2 > eps8 ) THEN + WRITE( stdout, 9081 ) etot, hwf_energy, dr2 + ELSE + WRITE( stdout, 9083 ) etot, hwf_energy, dr2 + END IF + ! + WRITE( stdout, 9060 ) & + ( eband + deband ), ehart, ( etxc - etxcc ), ewld + ! + ! + IF ( textfor) WRITE( stdout, & + '(/5x,"Energy of the external Forces = ", F18.8)' ) eext + IF ( tefield ) WRITE( stdout, 9061 ) etotefield + IF ( ABS (descf) > eps8 ) WRITE( stdout, 9069 ) descf + ! + ! ... With Fermi-Dirac population factor, etot is the electronic + ! ... free energy F = E - TS , demet is the -TS contribution + ! + IF ( lgauss ) WRITE( stdout, 9070 ) demet + ! + ELSE IF ( conv_elec .AND. lmd ) THEN + ! + IF ( dr2 > eps8 ) THEN + WRITE( stdout, 9081 ) etot, hwf_energy, dr2 + ELSE + WRITE( stdout, 9083 ) etot, hwf_energy, dr2 + END IF + ! + ELSE + ! + IF ( dr2 > eps8 ) THEN + WRITE( stdout, 9080 ) etot, hwf_energy, dr2 + ELSE + WRITE( stdout, 9082 ) etot, hwf_energy, dr2 + END IF + END IF + ! + ! + IF ( lsda ) WRITE( stdout, 9017 ) magtot, absmag + ! + ! + ! + CALL flush_unit( stdout ) + ! + IF ( conv_elec ) THEN + ! + ! + ! ... if system is charged add a Makov-Payne correction to the energy + ! + ! + ! ... print out ESM potentials if desired + ! + ! + WRITE( stdout, 9110 ) iter + ! + ! ... jump to the end + ! + IF ( output_drho /= ' ' ) CALL remove_atomic_rho() + ! + CALL stop_clock( 'electrons' ) + ! + call destroy_scf_type ( rhoin ) + ! + RETURN + ! + END IF + ! + ! ... uncomment the following line if you wish to monitor the evolution + ! ... of the force calculation during self-consistency + ! + !CALL forces() + ! + END DO + ! + WRITE( stdout, 9101 ) + WRITE( stdout, 9120 ) iter + ! + CALL flush_unit( stdout ) + ! + IF ( output_drho /= ' ' ) CALL remove_atomic_rho() + ! + CALL stop_clock( 'electrons' ) + ! + RETURN + ! + ! ... formats + ! +9000 FORMAT(/' total cpu time spent up to now is ',F10.1,' secs' ) +9001 FORMAT(/' per-process dynamical memory: ',f7.1,' Mb' ) +9002 FORMAT(/' Self-consistent Calculation' ) +9010 FORMAT(/' iteration #',I3,' ecut=', F9.2,' Ry',5X,'beta=',F4.2 ) +9017 FORMAT(/' total magnetization =', F9.2,' Bohr mag/cell', & + /' absolute magnetization =', F9.2,' Bohr mag/cell' ) +9018 FORMAT(/' total magnetization =',3F9.2,' Bohr mag/cell' & + & ,/' absolute magnetization =', F9.2,' Bohr mag/cell' ) +9050 FORMAT(/' WARNING: integrated charge=',F15.8,', expected=',F15.8 ) +9060 FORMAT(/' The total energy is the sum of the following terms:',/,& + /' one-electron contribution =',F17.8,' Ry' & + /' hartree contribution =',F17.8,' Ry' & + /' xc contribution =',F17.8,' Ry' & + /' ewald contribution =',F17.8,' Ry' ) +9061 FORMAT( ' electric field correction =',F17.8,' Ry' ) +9062 FORMAT( ' - averaged Fock potential =',F17.8,' Ry' ) +9064 FORMAT( ' + Fock energy =',F17.8,' Ry' ) +9065 FORMAT( ' Hubbard energy =',F17.8,' Ry' ) +9066 FORMAT( ' est. exchange err (dexx) =',F17.8,' Ry' ) +9069 FORMAT( ' scf correction =',F17.8,' Ry' ) +9070 FORMAT( ' smearing contrib. (-TS) =',F17.8,' Ry' ) +9071 FORMAT( ' Magnetic field =',3F12.7,' Ry' ) +9072 FORMAT( ' Magnetic field =',F12.7, ' Ry' ) +9073 FORMAT( ' lambda =',F11.2,' Ry' ) +9074 FORMAT( ' Dispersion Correction =',F17.8,' Ry' ) +9080 FORMAT(/' total energy =',0PF17.8,' Ry' & + /' Harris-Foulkes estimate =',0PF17.8,' Ry' & + /' estimated scf accuracy <',0PF17.8,' Ry' ) +9081 FORMAT(/'! total energy =',0PF17.8,' Ry' & + /' Harris-Foulkes estimate =',0PF17.8,' Ry' & + /' estimated scf accuracy <',0PF17.8,' Ry' ) +9082 FORMAT(/' total energy =',0PF17.8,' Ry' & + /' Harris-Foulkes estimate =',0PF17.8,' Ry' & + /' estimated scf accuracy <',1PE17.1,' Ry' ) +9083 FORMAT(/'! total energy =',0PF17.8,' Ry' & + /' Harris-Foulkes estimate =',0PF17.8,' Ry' & + /' estimated scf accuracy <',1PE17.1,' Ry' ) +9085 FORMAT(/' total all-electron energy =',0PF17.6,' Ry' ) +9101 FORMAT(/' End of self-consistent calculation' ) +9110 FORMAT(/' convergence has been achieved in ',i3,' iterations' ) +9120 FORMAT(/' convergence NOT achieved after ',i3,' iterations: stopping' ) +9121 FORMAT(/' scf convergence threshold =',1PE17.1,' Ry' ) + ! + CONTAINS + ! + !----------------------------------------------------------------------- + ! + !----------------------------------------------------------------------- + FUNCTION check_stop_now() + !----------------------------------------------------------------------- + ! + USE check_stop, ONLY : global_check_stop_now => check_stop_now + ! + IMPLICIT NONE + ! + LOGICAL :: check_stop_now + INTEGER :: unit + ! + unit = stdout + ! + check_stop_now = global_check_stop_now( unit ) + ! + IF ( check_stop_now ) conv_elec = .FALSE. + ! + RETURN + ! + END FUNCTION check_stop_now + ! + !----------------------------------------------------------------------- + FUNCTION delta_e() + !----------------------------------------------------------------------- + ! ... delta_e = - \int rho%of_r(r) v%of_r(r) + ! - \int rho%kin_r(r) v%kin_r(r) [for Meta-GGA] + ! - \sum rho%ns v%ns [for LDA+U] + ! - \sum becsum D1_Hxc [for PAW] + IMPLICIT NONE + REAL(DP) :: delta_e, delta_e_hub + ! + delta_e = - SUM( rho%of_r(:,:)*v%of_r(:,:) ) + ! + ! + delta_e = omega * delta_e / ( dfftp%nr1*dfftp%nr2*dfftp%nr3 ) + ! + CALL mp_sum( delta_e, intra_bgrp_comm ) + ! + ! + ! + RETURN + ! + END FUNCTION delta_e + ! + !----------------------------------------------------------------------- + FUNCTION delta_escf() + !----------------------------------------------------------------------- + ! + ! ... delta_escf = - \int \delta rho%of_r(r) v%of_r(r) + ! - \int \delta rho%kin_r(r) v%kin_r(r) [for Meta-GGA] + ! - \sum \delta rho%ns v%ns [for LDA+U] + ! - \sum \delta becsum D1 [for PAW] + ! ... calculates the difference between the Hartree and XC energy + ! ... at first order in the charge density difference \delta rho(r) + IMPLICIT NONE + ! + REAL(DP) :: delta_escf, delta_escf_hub + ! + delta_escf = - SUM( ( rhoin%of_r(:,:)-rho%of_r(:,:) )*v%of_r(:,:) ) + ! + ! + delta_escf = omega * delta_escf / ( dfftp%nr1*dfftp%nr2*dfftp%nr3 ) + ! + CALL mp_sum( delta_escf, intra_bgrp_comm ) + ! + + + RETURN + ! + END FUNCTION delta_escf + ! + !----------------------------------------------------------------------- + ! +END SUBROUTINE electrons diff --git a/tests/apps/miniDFT/tests/src/electrons_base.f90 b/tests/apps/miniDFT/tests/src/electrons_base.f90 new file mode 100644 index 0000000000..6215a24145 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/electrons_base.f90 @@ -0,0 +1,465 @@ +! +! Copyright (C) 2002-2009 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +!------------------------------------------------------------------------------! + MODULE electrons_base +!------------------------------------------------------------------------------! + + USE kinds, ONLY: DP +! + IMPLICIT NONE + SAVE + + INTEGER :: nbnd = 0 ! number electronic bands, each band contains + ! two spin states + INTEGER :: nbndx = 0 ! array dimension nbndx >= nbnd + INTEGER :: nspin = 0 ! nspin = number of spins (1=no spin, 2=LSDA) + INTEGER :: nel(2) = 0 ! number of electrons (up, down) + INTEGER :: nelt = 0 ! total number of electrons ( up + down ) + INTEGER :: nupdwn(2) = 0 ! number of states with spin up (1) and down (2) + INTEGER :: iupdwn(2) = 0 ! first state with spin (1) and down (2) + INTEGER :: nudx = 0 ! max (nupdw(1),nupdw(2)) + INTEGER :: nbsp = 0 ! total number of electronic states + ! (nupdwn(1)+nupdwn(2)) + INTEGER :: nbspx = 0 ! array dimension nbspx >= nbsp + ! + INTEGER :: nupdwn_bgrp(2) = 0 ! number of states with spin up (1) and down (2) in this band group + INTEGER :: iupdwn_bgrp(2) = 0 ! first state with spin (1) and down (2) in this band group + INTEGER :: nudx_bgrp = 0 ! max (nupdw_bgrp(1),nupdw_bgrp(2)) in this band group + INTEGER :: nbsp_bgrp = 0 ! total number of electronic states + ! (nupdwn_bgrp(1)+nupdwn_bgrp(2)) in this band group + INTEGER :: nbspx_bgrp = 0 ! array dimension nbspx_bgrp >= nbsp_bgrp local to the band group + INTEGER :: i2gupdwn_bgrp(2)= 0 ! global index of the first local band + + LOGICAL :: telectrons_base_initval = .FALSE. + LOGICAL :: keep_occ = .FALSE. ! if .true. when reading restart file keep + ! the occupations calculated in initval + + REAL(DP), ALLOCATABLE :: f(:) ! occupation numbers ( at gamma ) + REAL(DP) :: qbac = 0.0_DP ! background neutralizing charge + INTEGER, ALLOCATABLE :: ispin(:) ! spin of each state + + REAL(DP), ALLOCATABLE :: f_bgrp(:) ! occupation numbers ( at gamma ) + INTEGER, ALLOCATABLE :: ispin_bgrp(:) ! spin of each state + INTEGER, ALLOCATABLE :: ibgrp_g2l(:) ! local index of the i-th global band index +! +!------------------------------------------------------------------------------! + CONTAINS +!------------------------------------------------------------------------------! + + + SUBROUTINE electrons_base_initval( zv_ , na_ , nsp_ , nbnd_ , nspin_ , & + occupations_ , f_inp, tot_charge_, tot_magnetization_ ) + + USE constants, ONLY : eps8 + USE io_global, ONLY : stdout + + REAL(DP), INTENT(IN) :: zv_ (:), tot_charge_ + REAL(DP), INTENT(IN) :: f_inp(:,:) + REAL(DP), INTENT(IN) :: tot_magnetization_ + INTEGER, INTENT(IN) :: na_ (:) , nsp_ + INTEGER, INTENT(IN) :: nbnd_ , nspin_ + CHARACTER(LEN=*), INTENT(IN) :: occupations_ + + REAL(DP) :: nelec, nelup, neldw, ocp, fsum + INTEGER :: iss, i, in + + nspin = nspin_ + ! + ! ... set nelec + ! + nelec = 0.0_DP + DO i = 1, nsp_ + nelec = nelec + na_ ( i ) * zv_ ( i ) + END DO + nelec = nelec - tot_charge_ + ! + ! ... set nelup/neldw + ! + nelup = 0._dp + neldw = 0._dp + call set_nelup_neldw (tot_magnetization_, nelec, nelup, neldw ) + + IF( ABS( nelec - ( nelup + neldw ) ) > eps8 ) THEN + CALL errore(' electrons_base_initval ',' inconsistent n. of electrons ', 2 ) + END IF + ! + ! Compute the number of bands + ! + IF( nbnd_ /= 0 ) THEN + nbnd = nbnd_ ! nbnd is given from input + ELSE + nbnd = NINT( MAX( nelup, neldw ) ) ! take the maximum between up and down states + END IF + + + IF( nelec < 1 ) THEN + CALL errore(' electrons_base_initval ',' nelec less than 1 ', 1 ) + END IF + ! + IF( ABS( NINT( nelec ) - nelec ) > eps8 ) THEN + CALL errore(' electrons_base_initval ',' nelec must be integer', 2 ) + END IF + ! + IF( nbnd < 1 ) & + CALL errore(' electrons_base_initval ',' nbnd out of range ', 1 ) + ! + + IF ( nspin /= 1 .AND. nspin /= 2 ) THEN + WRITE( stdout, * ) 'nspin = ', nspin + CALL errore( ' electrons_base_initval ', ' nspin out of range ', 1 ) + END IF + + IF( MOD( nbnd, 2 ) == 0 ) THEN + nbspx = nbnd * nspin + ELSE + nbspx = ( nbnd + 1 ) * nspin + END IF + + ALLOCATE( f ( nbspx ) ) + ALLOCATE( ispin ( nbspx ) ) + f = 0.0_DP + ispin = 0 + + iupdwn ( 1 ) = 1 + nel = 0 + + SELECT CASE ( TRIM(occupations_) ) + CASE ('bogus') + ! + ! bogus to ensure \sum_i f_i = Nelec (nelec is integer) + ! + f ( : ) = nelec / nbspx + nel (1) = nint( nelec ) + nupdwn (1) = nbspx + if ( nspin == 2 ) then + ! + ! bogus to ensure Nelec = Nup + Ndw + ! + nel (1) = ( nint(nelec) + 1 ) / 2 + nel (2) = nint(nelec) / 2 + nupdwn (1)=nbnd + nupdwn (2)=nbnd + iupdwn (2)=nbnd+1 + end if + ! + keep_occ = .true. + ! + CASE ('from_input') + ! + ! occupancies have been read from input + ! + ! count electrons + ! + IF( nspin == 1 ) THEN + nelec = SUM( f_inp( :, 1 ) ) + nelup = nelec / 2.0_DP + neldw = nelec / 2.0_DP + ELSE + nelup = SUM ( f_inp ( :, 1 ) ) + neldw = SUM ( f_inp ( :, 2 ) ) + nelec = nelup + neldw + END IF + ! + ! consistency check + ! + IF( nspin == 1 ) THEN + IF( f_inp( 1, 1 ) <= 0.0_DP ) & + CALL errore(' electrons_base_initval ',' Zero or negative occupation are not allowed ', 1 ) + ELSE + IF( f_inp( 1, 1 ) < 0.0_DP ) & + CALL errore(' electrons_base_initval ',' Zero or negative occupation are not allowed ', 1 ) + IF( f_inp( 1, 2 ) < 0.0_DP ) & + CALL errore(' electrons_base_initval ',' Zero or negative occupation are not allowed ', 1 ) + IF( ( f_inp( 1, 1 ) + f_inp( 1, 2 ) ) == 0.0_DP ) & + CALL errore(' electrons_base_initval ',' Zero or negative occupation are not allowed ', 1 ) + END IF + DO i = 2, nbnd + IF( nspin == 1 ) THEN + IF( f_inp( i, 1 ) > 0.0_DP .AND. f_inp( i-1, 1 ) <= 0.0_DP ) & + CALL errore(' electrons_base_initval ',' Zero or negative occupation are not allowed ', 1 ) + ELSE + IF( f_inp( i, 1 ) > 0.0_DP .AND. f_inp( i-1, 1 ) <= 0.0_DP ) & + CALL errore(' electrons_base_initval ',' Zero or negative occupation are not allowed ', 1 ) + IF( f_inp( i, 2 ) > 0.0_DP .AND. f_inp( i-1, 2 ) <= 0.0_DP ) & + CALL errore(' electrons_base_initval ',' Zero or negative occupation are not allowed ', 1 ) + END IF + END DO + ! + ! count bands + ! + nupdwn (1) = 0 + nupdwn (2) = 0 + DO i = 1, nbnd + IF( nspin == 1 ) THEN + IF( f_inp( i, 1 ) > 0.0_DP ) nupdwn (1) = nupdwn (1) + 1 + ELSE + IF( f_inp( i, 1 ) > 0.0_DP ) nupdwn (1) = nupdwn (1) + 1 + IF( f_inp( i, 2 ) > 0.0_DP ) nupdwn (2) = nupdwn (2) + 1 + END IF + END DO + ! + if( nspin == 1 ) then + nel (1) = nint( nelec ) + iupdwn (1) = 1 + else + nel (1) = nint(nelup) + nel (2) = nint(neldw) + iupdwn (1) = 1 + iupdwn (2) = nupdwn (1) + 1 + end if + ! + DO iss = 1, nspin + DO in = iupdwn ( iss ), iupdwn ( iss ) - 1 + nupdwn ( iss ) + f( in ) = f_inp( in - iupdwn ( iss ) + 1, iss ) + END DO + END DO + ! + CASE ('fixed') + + if( nspin == 1 ) then + nel(1) = nint(nelec) + nupdwn(1) = nbnd + iupdwn(1) = 1 + else + IF ( nelup + neldw /= nelec ) THEN + CALL errore(' electrons_base_initval ',' wrong # of up and down spin', 1 ) + END IF + nel(1) = nint(nelup) + nel(2) = nint(neldw) + nupdwn(1) = nint(nelup) + nupdwn(2) = nint(neldw) + iupdwn(1) = 1 + iupdwn(2) = nupdwn(1) + 1 + end if + +! if( (nspin == 1) .and. MOD( nint(nelec), 2 ) /= 0 ) & +! CALL errore(' electrons_base_initval ', & +! ' must use nspin=2 for odd number of electrons', 1 ) + + ! ocp = 2 for spinless systems, ocp = 1 for spin-polarized systems + ocp = 2.0_DP / nspin + ! + ! default filling: attribute ocp electrons to each states + ! until the good number of electrons is reached + do iss = 1, nspin + fsum = 0.0_DP + do in = iupdwn ( iss ), iupdwn ( iss ) - 1 + nupdwn ( iss ) + if ( fsum + ocp < nel ( iss ) + 0.0001_DP ) then + f (in) = ocp + else + f (in) = max( nel ( iss ) - fsum, 0.0_DP ) + end if + fsum = fsum + f(in) + end do + end do + ! + CASE ('ensemble','ensemble-dft','edft') + + if ( nspin == 1 ) then + ! + f ( : ) = nelec / nbnd + nel (1) = nint(nelec) + nupdwn (1) = nbnd + ! + else + ! + if (nelup.ne.0) then + if ((nelup+neldw).ne.nelec) then + CALL errore(' electrons_base_initval ',' nelup+neldw .ne. nelec', 1 ) + end if + nel (1) = nelup + nel (2) = neldw + else + nel (1) = ( nint(nelec) + 1 ) / 2 + nel (2) = nint(nelec) / 2 + end if + ! + nupdwn (1) = nbnd + nupdwn (2) = nbnd + iupdwn (2) = nbnd+1 + ! + do iss = 1, nspin + do i = iupdwn ( iss ), iupdwn ( iss ) - 1 + nupdwn ( iss ) + f (i) = nel (iss) / DBLE (nupdwn (iss)) + end do + end do + ! + end if + + CASE DEFAULT + CALL errore(' electrons_base_initval ',' occupation method not implemented', 1 ) + END SELECT + + + do iss = 1, nspin + do in = iupdwn(iss), iupdwn(iss) - 1 + nupdwn(iss) + ispin(in) = iss + end do + end do + + nbndx = nupdwn (1) + nudx = nupdwn (1) + nbsp = nupdwn (1) + nupdwn (2) + + IF ( nspin == 1 ) THEN + nelt = nel(1) + ELSE + nelt = nel(1) + nel(2) + END IF + + IF( nupdwn(1) < nupdwn(2) ) & + CALL errore(' electrons_base_initval ',' nupdwn(1) should be greater or equal nupdwn(2) ', 1 ) + + IF( nbnd < nupdwn(1) ) & + CALL errore(' electrons_base_initval ',' inconsistent nbnd, should be .GE. than nupdwn(1) ', 1 ) + + IF( nbspx < ( nupdwn(1) * nspin ) ) & + CALL errore(' electrons_base_initval ',' inconsistent nbspx, should be .GE. than nspin * nupdwn(1) ', 1 ) + + IF( ( 2 * nbnd ) < nelt ) & + CALL errore(' electrons_base_initval ',' too few states ', 1 ) + + IF( nbsp < INT( nelec * nspin / 2.0_DP ) ) & + CALL errore(' electrons_base_initval ',' too many electrons ', 1 ) + + telectrons_base_initval = .TRUE. + + RETURN + + END SUBROUTINE electrons_base_initval + +!---------------------------------------------------------------------------- +! + subroutine set_nelup_neldw ( tot_magnetization_, nelec_, nelup_, neldw_ ) + ! + USE kinds, ONLY : DP + USE constants, ONLY : eps8 + ! + REAL (KIND=DP), intent(IN) :: tot_magnetization_ + REAL (KIND=DP), intent(IN) :: nelec_ + REAL (KIND=DP), intent(OUT) :: nelup_, neldw_ + LOGICAL :: integer_charge, integer_magnetization + ! + integer_charge = ( ABS (nelec_ - NINT(nelec_)) < eps8 ) + ! + IF ( tot_magnetization_ < 0 ) THEN + ! default when tot_magnetization is unspecified + IF ( integer_charge) THEN + nelup_ = INT( nelec_ + 1 ) / 2 + neldw_ = nelec_ - nelup_ + ELSE + nelup_ = nelec_ / 2 + neldw_ = nelup_ + END IF + ELSE + ! tot_magnetization specified in input + ! + if ( (tot_magnetization_ > 0) .and. (nspin==1) ) & + CALL errore(' set_nelup_neldw ', & + 'tot_magnetization is inconsistent with nspin=1 ', 2 ) + integer_magnetization = ( ABS( tot_magnetization_ - & + NINT(tot_magnetization_) ) < eps8 ) + IF ( integer_charge .AND. integer_magnetization) THEN + ! + ! odd tot_magnetization requires an odd number of electrons + ! even tot_magnetization requires an even number of electrons + ! + if ( ((MOD(NINT(tot_magnetization_),2) == 0) .and. & + (MOD(NINT(nelec_),2)==1)) .or. & + ((MOD(NINT(tot_magnetization_),2) == 1) .and. & + (MOD(NINT(nelec_),2)==0)) ) & + CALL infomsg(' set_nelup_neldw ', & + 'BEWARE: non-integer number of up and down electrons!' ) + ! + ! ... setting nelup/neldw + ! + nelup_ = ( INT(nelec_) + tot_magnetization_ ) / 2 + neldw_ = ( INT(nelec_) - tot_magnetization_ ) / 2 + ELSE + ! + nelup_ = ( nelec_ + tot_magnetization_ ) / 2 + neldw_ = ( nelec_ - tot_magnetization_ ) / 2 + END IF + END IF + + return + end subroutine set_nelup_neldw + +!---------------------------------------------------------------------------- + + + SUBROUTINE deallocate_elct() + IF( ALLOCATED( f ) ) DEALLOCATE( f ) + IF( ALLOCATED( ispin ) ) DEALLOCATE( ispin ) + IF( ALLOCATED( f_bgrp ) ) DEALLOCATE( f_bgrp ) + IF( ALLOCATED( ispin_bgrp ) ) DEALLOCATE( ispin_bgrp ) + IF( ALLOCATED( ibgrp_g2l ) ) DEALLOCATE( ibgrp_g2l ) + telectrons_base_initval = .FALSE. + RETURN + END SUBROUTINE deallocate_elct + +!---------------------------------------------------------------------------- + + SUBROUTINE distribute_bands( nbgrp, my_bgrp_id ) + INTEGER, INTENT(IN) :: nbgrp, my_bgrp_id + INTEGER, EXTERNAL :: ldim_block, gind_block + INTEGER :: iss, n1, n2, m1, m2, ilocal, iglobal + ! + IF( .NOT. telectrons_base_initval ) & + CALL errore( ' distribute_bands ', ' electrons_base_initval not yet called ', 1 ) + + nupdwn_bgrp = nupdwn + iupdwn_bgrp = iupdwn + nudx_bgrp = nudx + nbsp_bgrp = nbsp + nbspx_bgrp = nbspx + i2gupdwn_bgrp= 1 + + DO iss = 1, nspin + nupdwn_bgrp( iss ) = ldim_block( nupdwn( iss ), nbgrp, my_bgrp_id ) + i2gupdwn_bgrp( iss ) = gind_block( 1, nupdwn( iss ), nbgrp, my_bgrp_id ) + END DO + ! + iupdwn_bgrp(1) = 1 + IF( nspin > 1 ) THEN + iupdwn_bgrp(2) = iupdwn_bgrp(1) + nupdwn_bgrp( 1 ) + END IF + nudx_bgrp = nupdwn_bgrp( 1 ) + nbsp_bgrp = nupdwn_bgrp( 1 ) + nupdwn_bgrp ( 2 ) + nbspx_bgrp = nbsp_bgrp + IF( MOD( nbspx_bgrp, 2 ) /= 0 ) nbspx_bgrp = nbspx_bgrp + 1 + + ALLOCATE( f_bgrp ( nbspx_bgrp ) ) + ALLOCATE( ispin_bgrp ( nbspx_bgrp ) ) + ALLOCATE( ibgrp_g2l ( nbspx ) ) + f_bgrp = 0.0 + ispin_bgrp = 0 + ibgrp_g2l = 0 + ! + DO iss = 1, nspin + n1 = iupdwn_bgrp(iss) + n2 = n1 + nupdwn_bgrp(iss) - 1 + m1 = iupdwn(iss)+i2gupdwn_bgrp(iss) - 1 + m2 = m1 + nupdwn_bgrp(iss) - 1 + f_bgrp(n1:n2) = f(m1:m2) + ispin_bgrp(n1:n2) = ispin(m1:m2) + ilocal = n1 + DO iglobal = m1, m2 + ibgrp_g2l( iglobal ) = ilocal + ilocal = ilocal + 1 + END DO + END DO + + RETURN + + END SUBROUTINE distribute_bands + + +!------------------------------------------------------------------------------! + END MODULE electrons_base +!------------------------------------------------------------------------------! diff --git a/tests/apps/miniDFT/tests/src/environment.f90 b/tests/apps/miniDFT/tests/src/environment.f90 new file mode 100644 index 0000000000..27a9c8ec35 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/environment.f90 @@ -0,0 +1,200 @@ +! +! Copyright (C) 2002-2011 Quantum ESPRESSO groups +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +!==-----------------------------------------------------------------------==! +MODULE environment + !==-----------------------------------------------------------------------==! + + USE kinds, ONLY: DP + USE io_files, ONLY: crash_file, crashunit, nd_nmbr + USE io_global, ONLY: stdout, meta_ionode + USE mp_global, ONLY: me_image, my_image_id, root_image, nimage, & + nproc_image, nproc, npool, nproc_pool, nbgrp, get_ntask_groups + USE global_version, ONLY: version_number + + IMPLICIT NONE + + ! ... title of the simulation + CHARACTER(LEN=75) :: title + + SAVE + + PRIVATE + + PUBLIC :: environment_start + PUBLIC :: environment_end + + !==-----------------------------------------------------------------------==! +CONTAINS + !==-----------------------------------------------------------------------==! + + SUBROUTINE environment_start( code ) + + CHARACTER(LEN=*), INTENT(IN) :: code + + LOGICAL :: exst, debug = .false. + CHARACTER(LEN=80) :: code_version, uname + CHARACTER(LEN=6), EXTERNAL :: int_to_char + INTEGER :: iost + + ! ... Intel compilers v .ge.8 allocate a lot of stack space + ! ... Stack limit is often small, thus causing SIGSEGV and crash + + CALL remove_stack_limit ( ) + + ! ... use ".FALSE." to disable all clocks except the total cpu time clock + ! ... use ".TRUE." to enable clocks + + CALL init_clocks( .TRUE. ) + CALL start_clock( TRIM(code) ) + + code_version = TRIM (code) // " v." // TRIM (version_number) + + ! ... for compatibility with PWSCF + + nd_nmbr = TRIM ( int_to_char( me_image+1 )) + + IF( meta_ionode ) THEN + + ! ... search for file CRASH and delete it + + INQUIRE( FILE=TRIM(crash_file), EXIST=exst ) + IF( exst ) THEN + OPEN( UNIT=crashunit, FILE=TRIM(crash_file), STATUS='OLD',IOSTAT=iost ) + IF(iost==0) CLOSE( UNIT=crashunit, STATUS='DELETE', IOSTAT=iost ) + IF(iost/=0) WRITE(stdout,'(5x,"Remark: CRASH file could not ne deleted")') + END IF + + ELSE + ! ... one processor per image (other than meta_ionode) + ! ... or, for debugging purposes, all processors, + ! ... open their own standard output file +#if defined(DEBUG) + debug = .true. +#endif + IF (me_image == root_image .OR. debug ) THEN + uname = 'out.' // trim(int_to_char( my_image_id )) // '_' // & + trim(int_to_char( me_image)) + OPEN ( unit = stdout, file = TRIM(uname),status='unknown') + ELSE + OPEN ( unit = stdout, file='/dev/null', status='unknown' ) + END IF + + END IF + ! + CALL opening_message( code_version ) + CALL parallel_info ( ) + END SUBROUTINE environment_start + + !==-----------------------------------------------------------------------==! + + SUBROUTINE environment_end( code ) + + CHARACTER(LEN=*), INTENT(IN) :: code + + IF ( meta_ionode ) WRITE( stdout, * ) + + CALL stop_clock( TRIM(code) ) + CALL print_clock( TRIM(code) ) + + CALL closing_message( ) + + IF( meta_ionode ) THEN + WRITE( stdout,'(A)') ' JOB DONE.' + call print_clock( 'Benchmark_Time' ) + WRITE( stdout,3335) + END IF +3335 FORMAT('=',78('-'),'=') + + RETURN + END SUBROUTINE environment_end + + !==-----------------------------------------------------------------------==! + + SUBROUTINE opening_message( code_version ) + + CHARACTER(LEN=*), INTENT(IN) :: code_version + CHARACTER(LEN=9) :: cdate, ctime + + CALL date_and_tim( cdate, ctime ) + ! + WRITE( stdout, '(/5X,"Program ",A18," starts on ",A9," at ",A9)' ) & + code_version, cdate, ctime + ! + WRITE (stdout, & + '(/5X,"This is mini-DFT, a mini-application for plane-wave density functional",& + &/5X,"theory calculations. Mini-DFT was extracted from",& + &/5X,"the open-source Quantum ESPRESSO suite by B. Austin (2013). ")') + ! + WRITE( stdout, '(/5X,"To acknowledge Quantum ESPRESSO, please cite", & + &/9X,"P. Giannozzi et al., J. Phys.:Condens. Matter 21 395502 (2009);", & + &/9X,"URL http://www.quantum-espresso.org" )' ) + + RETURN + END SUBROUTINE opening_message + + !==-----------------------------------------------------------------------==! + + SUBROUTINE closing_message( ) + + CHARACTER(LEN=9) :: cdate, ctime + CHARACTER(LEN=80) :: time_str + + CALL date_and_tim( cdate, ctime ) + + time_str = 'This run was terminated on: ' // ctime // ' ' // cdate + + IF( meta_ionode ) THEN + WRITE( stdout,*) + WRITE( stdout,3334) time_str + WRITE( stdout,3335) + END IF + +3334 FORMAT(3X,A60,/) +3335 FORMAT('=',78('-'),'=') + + RETURN + END SUBROUTINE closing_message + + !==-----------------------------------------------------------------------==! + SUBROUTINE parallel_info ( ) + ! +#if defined(__OPENMP) || defined(_OPENMP) + INTEGER, EXTERNAL :: omp_get_max_threads +#endif + ! +#if defined(__OPENMP) || defined(_OPENMP) + WRITE( stdout, '(/5X,"Parallel version (MPI & OpenMP), running on ",& + &I8," processor cores")' ) nproc * omp_get_max_threads() + ! + WRITE( stdout, '(5X,"Number of MPI processes: ",I8)' ) nproc + ! + WRITE( stdout, '(5X,"Threads/MPI process: ",I6)' ) & + omp_get_max_threads() +#else + WRITE( stdout, '(/5X,"Parallel version (MPI), running on ",& + &I8," processors")' ) nproc +#endif + ! + IF ( nimage > 1 ) WRITE( stdout, & + '(5X,"path-images division: nimage = ",I8)' ) nimage + IF ( nbgrp > 1 ) WRITE( stdout, & + '(5X,"band groups division: nbgrp = ",I8)' ) nbgrp + IF ( npool > 1 ) WRITE( stdout, & + '(5X,"K-points division: npool = ",I8)' ) npool + IF ( nproc_pool > 1 ) WRITE( stdout, & + '(5X,"R & G space division: proc/pool = ",I8)' ) nproc_pool + IF ( get_ntask_groups() > 1 ) WRITE( stdout, & + '(5X,"wavefunctions fft division: fft/group = ",I8)' ) & + get_ntask_groups() + ! + END SUBROUTINE parallel_info + + !==-----------------------------------------------------------------------==! +END MODULE environment +!==-----------------------------------------------------------------------==! diff --git a/tests/apps/miniDFT/tests/src/eqvect.f90 b/tests/apps/miniDFT/tests/src/eqvect.f90 new file mode 100644 index 0000000000..6490ed60d4 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/eqvect.f90 @@ -0,0 +1,26 @@ +! +! Copyright (C) 2001-2008 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +!----------------------------------------------------------------------- +logical function eqvect (x, y, f) + !----------------------------------------------------------------------- + ! + ! This function test if the difference x-y-f is an integer. + ! x, y = 3d vectors in crystal axis, f = fractionary translation + ! + USE kinds + implicit none + real(DP), intent(in) :: x (3), y (3), f (3) + ! + real(DP), parameter :: accep = 1.0d-5 ! acceptance parameter + ! + eqvect = abs( x(1)-y(1)-f(1) - nint(x(1)-y(1)-f(1)) ) < accep .and. & + abs( x(2)-y(2)-f(2) - nint(x(2)-y(2)-f(2)) ) < accep .and. & + abs( x(3)-y(3)-f(3) - nint(x(3)-y(3)-f(3)) ) < accep + ! + return +end function eqvect diff --git a/tests/apps/miniDFT/tests/src/erf.f90 b/tests/apps/miniDFT/tests/src/erf.f90 new file mode 100644 index 0000000000..5050abcea5 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/erf.f90 @@ -0,0 +1,127 @@ +! +! Copyright (C) 2002-2009 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +!--------------------------------------------------------------------- +function qe_erf (x) + !--------------------------------------------------------------------- + ! + ! Error function - computed from the rational approximations of + ! W. J. Cody, Math. Comp. 22 (1969), pages 631-637. + ! + ! for abs(x) le 0.47 erf is calculated directly + ! for abs(x) gt 0.47 erf is calculated via erf(x)=1-erfc(x) + ! + use kinds, only : DP + implicit none + real(DP), intent(in) :: x + real(DP) :: x2, p1 (4), q1 (4) + real(DP), external :: qe_erfc + real(DP) :: qe_erf + data p1 / 2.426679552305318E2_DP, 2.197926161829415E1_DP, & + 6.996383488619136_DP, -3.560984370181538E-2_DP / + data q1 / 2.150588758698612E2_DP, 9.116490540451490E1_DP, & + 1.508279763040779E1_DP, 1.000000000000000_DP / + ! + if (abs (x) > 6.0_DP) then + ! + ! erf(6)=1-10^(-17) cannot be distinguished from 1 + ! + qe_erf = sign (1.0_DP, x) + else + if (abs (x) <= 0.47_DP) then + x2 = x**2 + qe_erf=x *(p1 (1) + x2 * (p1 (2) + x2 * (p1 (3) + x2 * p1 (4) ) ) ) & + / (q1 (1) + x2 * (q1 (2) + x2 * (q1 (3) + x2 * q1 (4) ) ) ) + else + qe_erf = 1.0_DP - qe_erfc (x) + endif + endif + ! + return +end function qe_erf +! +!--------------------------------------------------------------------- +function qe_erfc (x) + !--------------------------------------------------------------------- + ! + ! erfc(x) = 1-erf(x) - See comments in erf + ! + use kinds, only : DP + implicit none + real(DP),intent(in) :: x + real(DP) :: qe_erfc + real(DP) :: ax, x2, xm2, p2 (8), q2 (8), p3 (5), q3 (5), pim1 + real(DP), external :: qe_erf + data p2 / 3.004592610201616E2_DP, 4.519189537118719E2_DP, & + 3.393208167343437E2_DP, 1.529892850469404E2_DP, & + 4.316222722205674E1_DP, 7.211758250883094_DP, & + 5.641955174789740E-1_DP,-1.368648573827167E-7_DP / + data q2 / 3.004592609569833E2_DP, 7.909509253278980E2_DP, & + 9.313540948506096E2_DP, 6.389802644656312E2_DP, & + 2.775854447439876E2_DP, 7.700015293522947E1_DP, & + 1.278272731962942E1_DP, 1.000000000000000_DP / + data p3 /-2.996107077035422E-3_DP,-4.947309106232507E-2_DP, & + -2.269565935396869E-1_DP,-2.786613086096478E-1_DP, & + -2.231924597341847E-2_DP / + data q3 / 1.062092305284679E-2_DP, 1.913089261078298E-1_DP, & + 1.051675107067932_DP, 1.987332018171353_DP, & + 1.000000000000000_DP / + + data pim1 / 0.56418958354775629_DP / + ! ( pim1= sqrt(1/pi) ) + ax = abs (x) + if (ax > 26.0_DP) then + ! + ! erfc(26.0)=10^(-296); erfc( 9.0)=10^(-37); + ! + qe_erfc = 0.0_DP + elseif (ax > 4.0_DP) then + x2 = x**2 + xm2 = (1.0_DP / ax) **2 + qe_erfc = (1.0_DP / ax) * exp ( - x2) * (pim1 + xm2 * (p3 (1) & + + xm2 * (p3 (2) + xm2 * (p3 (3) + xm2 * (p3 (4) + xm2 * p3 (5) & + ) ) ) ) / (q3 (1) + xm2 * (q3 (2) + xm2 * (q3 (3) + xm2 * & + (q3 (4) + xm2 * q3 (5) ) ) ) ) ) + elseif (ax > 0.47_DP) then + x2 = x**2 + qe_erfc = exp ( - x2) * (p2 (1) + ax * (p2 (2) + ax * (p2 (3) & + + ax * (p2 (4) + ax * (p2 (5) + ax * (p2 (6) + ax * (p2 (7) & + + ax * p2 (8) ) ) ) ) ) ) ) / (q2 (1) + ax * (q2 (2) + ax * & + (q2 (3) + ax * (q2 (4) + ax * (q2 (5) + ax * (q2 (6) + ax * & + (q2 (7) + ax * q2 (8) ) ) ) ) ) ) ) + else + qe_erfc = 1.0_DP - qe_erf (ax) + endif + ! + ! erf(-x)=-erf(x) => erfc(-x) = 2-erfc(x) + ! + if (x < 0.0_DP) qe_erfc = 2.0_DP - qe_erfc + ! + return +end function qe_erfc +! +!--------------------------------------------------------------------- +function gauss_freq (x) + !--------------------------------------------------------------------- + ! + ! gauss_freq(x) = (1+erf(x/sqrt(2)))/2 = erfc(-x/sqrt(2))/2 + ! - See comments in erf + ! + use kinds, only : DP + implicit none + real(DP),intent(in) :: x + real(DP) :: gauss_freq + real(DP), parameter :: c = 0.7071067811865475_DP + ! ( c= sqrt(1/2) ) + real(DP), external :: qe_erfc + ! + gauss_freq = 0.5_DP * qe_erfc ( - x * c) + ! + return +end function gauss_freq + + diff --git a/tests/apps/miniDFT/tests/src/error_handler.f90 b/tests/apps/miniDFT/tests/src/error_handler.f90 new file mode 100644 index 0000000000..1ad507fe04 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/error_handler.f90 @@ -0,0 +1,232 @@ +! +! Copyright (C) 2001-2007 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +!---------------------------------------------------------------------------- +SUBROUTINE errore( calling_routine, message, ierr ) + !---------------------------------------------------------------------------- + ! + ! ... This is a simple routine which writes an error message to output: + ! ... if ierr <= 0 it does nothing, + ! ... if ierr > 0 it stops. + ! + ! ... **** Important note for parallel execution *** + ! + ! ... in parallel execution unit 6 is written only by the first node; + ! ... all other nodes have unit 6 redirected to nothing (/dev/null). + ! ... As a consequence an error not occurring on the first node + ! ... will be invisible. For T3E and ORIGIN machines, this problem + ! ... is solved by writing an error message to unit * instead of 6. + ! ... Whenever possible (IBM SP machines), we write to the standard + ! ... error, unit 0 (the message will appear in the error files + ! ... produced by loadleveler). + ! + USE io_global, ONLY : stdout + USE io_files, ONLY : crashunit, crash_file + USE parallel_include + ! + IMPLICIT NONE + ! + CHARACTER(LEN=*), INTENT(IN) :: calling_routine, message + ! the name of the calling calling_routinee + ! the output messagee + INTEGER, INTENT(IN) :: ierr + ! the error flag + INTEGER :: mpime, mpierr + ! the task id + ! + ! + IF ( ierr <= 0 ) RETURN + ! + ! ... the error message is written un the "*" unit + ! + WRITE( UNIT = *, FMT = '(/,1X,78("%"))' ) + WRITE( UNIT = *, & + FMT = '(5X,"from ",A," : error #",I10)' ) calling_routine, ierr + WRITE( UNIT = *, FMT = '(5X,A)' ) message + WRITE( UNIT = *, FMT = '(1X,78("%"),/)' ) + ! + ! + WRITE( *, '(" stopping ...")' ) + ! + CALL flush_unit( stdout ) + ! + ! + mpime = 0 + ! + CALL MPI_COMM_RANK( MPI_COMM_WORLD, mpime, mpierr ) + ! + ! .. write the message to a file and close it before exiting + ! .. this will prevent loss of information on systems that + ! .. do not flush the open streams + ! .. added by C.C. + ! + OPEN( UNIT = crashunit, FILE = crash_file, & + POSITION = 'APPEND', STATUS = 'UNKNOWN' ) + ! + WRITE( UNIT = crashunit, FMT = '(/,1X,78("%"))' ) + WRITE( UNIT = crashunit, FMT = '(5X,"task #",I10)' ) mpime + WRITE( UNIT = crashunit, & + FMT = '(5X,"from ",A," : error #",I10)' ) calling_routine, ierr + WRITE( UNIT = crashunit, FMT = '(5X,A)' ) message + WRITE( UNIT = crashunit, FMT = '(1X,78("%"),/)' ) + ! + CLOSE( UNIT = crashunit ) + ! + ! ... try to exit in a smooth way + ! + CALL MPI_ABORT( MPI_COMM_WORLD, mpierr ) + ! + CALL MPI_FINALIZE( mpierr ) + ! + ! + STOP 2 + ! + RETURN + ! +END SUBROUTINE errore +! +!---------------------------------------------------------------------- +SUBROUTINE infomsg( routine, message ) + !---------------------------------------------------------------------- + ! + ! ... This is a simple routine which writes an info message + ! ... from a given routine to output. + ! + USE io_global, ONLY : stdout, ionode + ! + IMPLICIT NONE + ! + CHARACTER (LEN=*) :: routine, message + ! the name of the calling routine + ! the output message + ! + IF ( ionode ) THEN + ! + WRITE( stdout , '(5X,"Message from routine ",A,":")' ) routine + WRITE( stdout , '(5X,A)' ) message + ! + END IF + ! + RETURN + ! +END SUBROUTINE infomsg +! +module error_handler + implicit none + private + + public :: init_error, add_name, chop_name, error_mem, warning + + type chain + character (len=35) :: routine_name + type(chain), pointer :: previous_link + end type chain + + type(chain), pointer :: routine_chain + +contains + + subroutine init_error(routine_name) + implicit none + character (len=*), intent(in) :: routine_name + + allocate(routine_chain) + + routine_chain%routine_name = routine_name + nullify(routine_chain%previous_link) + + return + end subroutine init_error + + subroutine add_name(routine_name) + implicit none + character (len=*), intent(in) :: routine_name + type(chain), pointer :: new_link + + allocate(new_link) + new_link%routine_name = routine_name + new_link%previous_link => routine_chain + routine_chain => new_link + + return + end subroutine add_name + + subroutine chop_name + implicit none + type(chain), pointer :: chopped_chain + + chopped_chain => routine_chain%previous_link + deallocate(routine_chain) + routine_chain => chopped_chain + + return + end subroutine chop_name + + recursive subroutine trace_back(error_code) + + implicit none + integer :: error_code + + write(unit=*,fmt=*) " Called by ", routine_chain%routine_name + if (.not.associated(routine_chain%previous_link)) then + write(unit=*,fmt=*) & + " +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++" + write(unit=*,fmt=*) " " + if( error_code > 0 ) then + stop + else + return + end if + end if + + routine_chain => routine_chain%previous_link + call trace_back(error_code) + + end subroutine trace_back + + subroutine error_mem(message,error_code) + character (len=*), intent(in) :: message + integer, intent(in), optional :: error_code + integer :: action_code + type(chain), pointer :: save_chain + + if (present(error_code)) then + action_code = error_code + else + action_code = 1 + end if + + if( action_code /= 0 ) then + write(unit=*,fmt=*) " " + write(unit=*,fmt=*) & + " +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++" + + if( action_code > 0 ) then + write(unit=*,fmt=*) " Fatal error in routine `", & + trim(routine_chain%routine_name),"': ",message + else + write(unit=*,fmt=*) " Warning from routine `", & + trim(routine_chain%routine_name),"': ",message + save_chain => routine_chain + end if + write(unit=*,fmt=*) & + " +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++" + routine_chain => routine_chain%previous_link + call trace_back(action_code) + routine_chain => save_chain + end if + + return + end subroutine error_mem + + subroutine warning(message) + character (len=*), intent(in) :: message + call error_mem(message,-1) + return + end subroutine warning + +end module error_handler diff --git a/tests/apps/miniDFT/tests/src/eval_infix.c b/tests/apps/miniDFT/tests/src/eval_infix.c new file mode 100644 index 0000000000..2a56514992 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/eval_infix.c @@ -0,0 +1,729 @@ +/* Copyright (C) 2008 by www.guidealgoritmi.it + Author: Vincenzo Lo Cicero. + e-mail: vincenzolocicero@guidealgoritmi.it + http://www.guidealgoritmi.it + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ + + +/* + +This version of EvalInfix includes a wrapper to allow calls from +fortran code (written by Lorenzo Paulatto, 2008). + +An example F90 program follows: + +PROGRAM use_ex + implicit none + character(len=256) :: expr + integer :: ierr + real(8) :: result + real(8),external :: eval_infix + + expr = "3 * 3" + result = eval_infix(ierr, expr) + if (ierr == 0) then + write(*,*) result, expr + else + stop + endif +END PROGRAM + +*/ + +#include +#include +#include +#include +#include + +#include "c_defs.h" + +/* #pragma warning( disable : 4996 ) */ + +#define MAXOP 100 /* dimensione massima di un operando o operatore */ +#define MAXSTACK 100 /* dimensione massima dello stack */ + + +typedef int BOOL; + +#ifndef FALSE +#define FALSE 0 +#endif + +#ifndef TRUE +#define TRUE 1 +#endif + + +typedef enum tagTokenType +{ + EOL, UNKNOWN, VALUE, OPAREN, CPAREN, EXP, UPLUS, UMINUS, MULT, DIV, PLUS, MINUS +}TokenTypeEnum; + +typedef struct tagToken +{ + TokenTypeEnum Type; + char str[54]; + double Value; +}Token; + +struct Precedence +{ + int inputSymbol; + int topOfStack; +} PREC_TABLE [ ] = +{ + { 0, -1 }, {-1, -1}, { 0, 0 }, /* EOL, UNKNOWN, VALUE */ + { 100, 0 }, { 0, 99 }, /* OPAREN, CPAREN */ + { 6, 5 }, {6, 5}, {6, 5}, /* EXP, UPLUS, UMINUS */ + { 3, 4 }, { 3, 4 }, /* MULT, DIV */ + { 1, 2 }, { 1, 2 } /* PLUS, MINUS */ +}; + +int nNextPos = 0; +TokenTypeEnum PreviousTokenType = EOL; + +int sp_op = 0; +Token stack_op[MAXSTACK]; /* stack degli operatori */ + +/* Operazioni sullo stack degli operatori */ +void push_op(Token, char *); +Token pop_op(char *); +Token top_op(char *); +BOOL is_empty_op(); + +int sp_val = 0; +double stack_val[MAXSTACK]; /* stack degli operandi */ + +/* Operazioni sullo stack degli operandi */ +void push_val(double, char *); +double pop_val(char *); +double top_val(char *); +BOOL is_empty_val(); + +TokenTypeEnum GetNextToken(const char *str, Token *token, BOOL bIsInfix); + +double BinaryOperation(double left, double right, char op, char *strError); +/*BOOL InfixToPostfix(const char *strInfix, char *strPostfix, char *strError); + double EvalPostfix(const char *strExpression, char *strError); */ +double EvalInfix(const char *strExpression, char *strError); + +/* inserisce un elemento nello stack degli operatori */ +/* In caso di errore viene riportato un messaggio nel parametro strError */ +/* In assenza di errori, il parametro strError è impostato ala stringa vuota = "" */ +void push_op(Token Tok, char *strError) +{ + strcpy(strError, ""); + + if (sp_op < MAXSTACK) + stack_op[sp_op++] = Tok; + else + sprintf(strError, "Error: operators stack is full, cannot add more elements %c\n", Tok.str[0]); +} + +/* Estrae e ritorna un elemento dallo stack degli operatori */ +/* In caso di errore viene riportato un messaggio nel parametro strError */ +/* In assenza di errori, il parametro strError è impostato ala stringa vuota = "" */ +Token pop_op(char *strError) +{ + Token tok_temp; + + strcpy(strError, ""); + + if (sp_op > 0) + return stack_op[--sp_op]; + else + { + sprintf(strError, "Error: missing operator\n"); + strcpy(tok_temp.str, ""); + tok_temp.Type = UNKNOWN; + return tok_temp; + } +} + +/* Ritorna il valore in cima allo stack degli operatori senza estrarlo */ +/* In caso di errore viene riportato un messaggio nel parametro strError */ +/* In assenza di errori, il parametro strError è impostato ala stringa vuota = "" */ +Token top_op(char *strError) +{ + Token tok_temp; + + strcpy(strError, ""); + + if (sp_op >= 0) + return stack_op[sp_op - 1]; + else + { + sprintf(strError, "Error: missing operator\n"); + strcpy(tok_temp.str, ""); + tok_temp.Type = UNKNOWN; + return tok_temp; + } +} + +/* Ritorna un valore diverso da zero se lo stack degli operatori è vuoto */ +BOOL is_empty_op() +{ + if ( sp_op > 0 ) + return FALSE; + else + return TRUE; +} + +/* Inserisce un elemento nello stack degli operandi */ +/* In caso di errore viene riportato un messaggio nel parametro strError */ +/* In assenza di errori, il parametro strError è impostato ala stringa vuota = "" */ +void push_val(double c, char *strError) +{ + strcpy(strError, ""); + + if (sp_val < MAXSTACK) + stack_val[sp_val++] = c; + else + sprintf(strError, "Error: values stack is full: cannot add more elements %g\n", c); +} + +/* Estrae e ritorna un elemento dallo stack degli operandi */ +/* In caso di errore viene riportato un messaggio nel parametro strError */ +/* In assenza di errori, il parametro strError è impostato ala stringa vuota = "" */ +double pop_val(char *strError) +{ + strcpy(strError, ""); + + if (sp_val > 0) + return stack_val[--sp_val]; + else + { + sprintf(strError, "Error: missing operand\n"); + return 0; + } +} + +/* ritorna il valore in cima allo stack degli operandi senza estrarlo */ +/* In caso di errore viene riportato un messaggio nel parametro strError */ +/* In assenza di errori, il parametro strError è impostato ala stringa vuota = "" */ +double top_val(char *strError) +{ + strcpy(strError, ""); + + if (sp_val > 0) + return stack_val[sp_val - 1]; + else + { + sprintf(strError, "Error top: values stack is empty\n"); + return 0; + } +} + +/* ritorna un valore diverso da zero se lo stack degli operandi è vuoto */ +BOOL is_empty_val() +{ + if ( sp_val > 0 ) + return FALSE; + else + return TRUE; +} +/* ritorna un valore diverso da zero per "e", "E", "d o "D", o se il carattere prima lo era */ +BOOL is_scientific(char strChar) +{ + BOOL static was_scientific = FALSE; + + if (was_scientific) + { + was_scientific = FALSE; + return TRUE; + } + else if (strChar == 'e' || strChar == 'E'|| + strChar == 'd' || strChar == 'D') + { + was_scientific = TRUE; + return TRUE; + } + else if ( isdigit(strChar) ){ + was_scientific = FALSE; + return TRUE; + } + else + { + was_scientific = FALSE; + return FALSE; + } +} + + +/* Analizzatore lessicale */ +TokenTypeEnum GetNextToken(const char *str, Token *token, BOOL bIsInfix) +{ + int i; + char strToken[MAXOP]; + + while ( 1 ) + { + while ( str[nNextPos++] == ' ' ) + ; + --nNextPos; + + if ( str[nNextPos] == '\0' ) + { + token->Type = EOL; + strcpy(token->str, "\n"); + nNextPos = 0; + PreviousTokenType = EOL; + return EOL; + } + else if ( is_scientific(str[nNextPos]) ) + { + i = 0; + while ( is_scientific(strToken[i++] = str[nNextPos++]) ) + if (strToken[i-1] == 'd' || strToken[i-1] == 'D') strToken[i-1] = 'e'; + if ( str[nNextPos - 1] == '.' ) + { + while ( is_scientific(strToken[i++] = str[nNextPos++]) ) + if (strToken[i-1] == 'd' || strToken[i-1] == 'D') strToken[i-1] = 'e'; + strToken[i - 1] = '\0'; + --nNextPos; + token->Type = VALUE; + strcpy(token->str, strToken); + token->Value = atof(strToken); + return VALUE; + } + else + { + strToken[i - 1] = '\0'; + --nNextPos; + token->Type = VALUE; + strcpy(token->str, strToken); + token->Value = atof(strToken); + return VALUE; + } + } + else if ( str[nNextPos] == '.' ) + { + i = 0; + strToken[i++] = str[nNextPos++]; + while ( is_scientific(strToken[i++] = str[nNextPos++]) ) + if (strToken[i-1] == 'd' || strToken[i-1] == 'D') strToken[i-1] = 'e'; + strToken[i - 1] = '\0'; + --nNextPos; + token->Type = VALUE; + strcpy(token->str, strToken); + token->Value = atof(strToken); + return VALUE; + } + else if ( str[nNextPos] == '(' ) + { + token->Type = OPAREN; + strcpy(token->str, "("); + ++nNextPos; + return OPAREN; + } + else if ( str[nNextPos] == ')' ) + { + token->Type = CPAREN; + strcpy(token->str, ")"); + ++nNextPos; + return CPAREN; + } + else if ( str[nNextPos] == '+' ) + { + strcpy(token->str, "+"); + ++nNextPos; + if ( !bIsInfix ) + { + token->Type = PLUS; + return PLUS; + } + else + { + if ( PreviousTokenType == CPAREN || PreviousTokenType == VALUE ) + { + token->Type = PLUS; + return PLUS; + } + else + { + token->Type = UPLUS; + return UPLUS; + } + } + } + else if ( str[nNextPos] == '-' ) + { + strcpy(token->str, "-"); + ++nNextPos; + if ( !bIsInfix ) + { + token->Type = MINUS; + return MINUS; + } + else + { + if ( PreviousTokenType == CPAREN || PreviousTokenType == VALUE ) + { + token->Type = MINUS; + return MINUS; + } + else + { + token->Type = UMINUS; + return UMINUS; + } + } + } + else if ( str[nNextPos] == '~' ) + { + strcpy(token->str, "~"); + ++nNextPos; + if ( !bIsInfix ) + { + token->Type = UMINUS; + return UMINUS; + } + else + { + token->Type = UNKNOWN; + return UNKNOWN; + } + } + else if ( str[nNextPos] == '*' ) + { + token->Type = MULT; + strcpy(token->str, "*"); + ++nNextPos; + return MULT; + } + else if ( str[nNextPos] == '/' ) + { + token->Type = DIV; + strcpy(token->str, "/"); + ++nNextPos; + return DIV; + } + else if ( str[nNextPos] == '^' ) + { + token->Type = EXP; + strcpy(token->str, "^"); + ++nNextPos; + return EXP; + } + else + { + token->Type = UNKNOWN; + token->str[0] = str[nNextPos]; + token->str[1] = '\0'; + ++nNextPos; + return UNKNOWN; + } + } + + return EOL; +} + +/* Ritorna il risultato di un'operazione binaria */ +/* In caso di errore viene riportato un messaggio nel parametro strError */ +/* In assenza di errori, il parametro strError è impostato ala stringa vuota = "" */ +double BinaryOperation(double left, double right, char op, char* strError) +{ + strcpy(strError, ""); + + switch ( op ) + { + case '-': + return left - right; + case '+': + return left + right; + case '*': + return left * right; + case '/': + if ( right == 0 ) + { + sprintf(strError, "Error: division by zero!\n"); + return 0.0; + } + else + return left / right; + case '^': + return pow(left, right); + default: + if ( op == '(' ) + sprintf(strError, "Error: unbalanced brackets.\n"); + else + sprintf(strError, "Error: unknown operator: %c\n", op); + return 0.0; + } +} + +/* Calcola e restituisce il risultato di un'espressione in forma infissa */ +double EvalInfix(const char *strExpression, char * strError) +{ + int i = 0; + Token tok; + Token tok_temp; + double left, right; + double dblRet; + + strcpy(strError, ""); + + tok_temp.Type = EOL; + tok_temp.str[0] = '@'; + tok_temp.str[1] = '\0'; + push_op(tok_temp, strError); + if ( strError[0] != '\0' ) + return 0.0; + + while ( (PreviousTokenType = GetNextToken(strExpression, &tok, TRUE)) != EOL ) + { + if ( tok.Type == UNKNOWN ) + { + sprintf(strError, "Error: invalid token: %s\n", tok.str); + return 0.0; + } + else if ( tok.Type == VALUE ) + { + push_val(tok.Value, strError); + if ( strError[0] != '\0' ) + return 0.0; + } + else if ( tok.Type == OPAREN || tok.Type == UMINUS || tok.Type == UPLUS ) + { + push_op(tok, strError); + if ( strError[0] != '\0' ) + return 0.0; + } + else if ( tok.Type == CPAREN ) + { + while ( top_op(strError).Type != OPAREN ) + { + if ( strError[0] != '\0' ) + return 0.0; + + tok_temp = pop_op(strError); + if ( strError[0] != '\0' ) + return 0.0; + + if ( (tok_temp.Type == EOL) || (is_empty_op()) ) + { + sprintf(strError, "Error: unbalanced brackets.\n"); + return 0.0; + } + + right = pop_val(strError); + if ( strError[0] != '\0' ) + return 0.0; + + if ( tok_temp.Type != UMINUS ) + { + left = pop_val(strError); + if ( strError[0] != '\0' ) + return 0.0; + + dblRet = BinaryOperation(left, right, tok_temp.str[0], strError); + if ( strError[0] != '\0' ) + return 0.0; + + push_val(dblRet, strError); + if ( strError[0] != '\0' ) + return 0.0; + } + else + { + push_val( -1 * right, strError ); + if ( strError[0] != '\0' ) + return 0.0; + } + } + pop_op(strError); + if ( strError[0] != '\0' ) + return 0.0; + } + else + { + while ( PREC_TABLE[ top_op(strError).Type ].topOfStack >= PREC_TABLE[ tok.Type ].inputSymbol ) + { + if ( strError[0] != '\0' ) + return 0.0; + + if ( top_op(strError).Type != UMINUS && top_op(strError).Type != UPLUS ) + { + if ( strError[0] != '\0' ) + return 0.0; + + right = pop_val(strError); + if ( strError[0] != '\0' ) + return 0.0; + + left = pop_val(strError); + if ( strError[0] != '\0' ) + return 0.0; + + tok_temp = pop_op(strError); + if ( strError[0] != '\0' ) + return 0.0; + + dblRet = BinaryOperation(left, right, tok_temp.str[0], strError); + if ( strError[0] != '\0' ) + return 0.0; + + push_val(dblRet, strError); + if ( strError[0] != '\0' ) + return 0.0; + } + else + { + if ( top_op(strError).Type == UMINUS ) + { + if ( strError[0] != '\0' ) + return 0.0; + + right = pop_val(strError); + if ( strError[0] != '\0' ) + return 0.0; + + pop_op(strError); + if ( strError[0] != '\0' ) + return 0.0; + + push_val(-1 * right, strError); + if ( strError[0] != '\0' ) + return 0.0; + } + else + { + pop_op(strError); + if ( strError[0] != '\0' ) + return 0.0; + } + } + } + + if ( tok.Type != EOL ) + { + push_op(tok, strError); + if ( strError[0] != '\0' ) + return 0.0; + } + } + } + + while ( 1 ) + { + tok_temp = pop_op(strError); + if ( strError[0] != '\0' ) + return 0.0; + + if ( tok_temp.Type == EOL ) + break; + + if ( tok_temp.Type != UPLUS ) + { + right = pop_val(strError); + if ( strError[0] != '\0' ) + return 0.0; + } + + if ( tok_temp.Type != UMINUS && tok_temp.Type != UPLUS ) + { + left = pop_val(strError); + if ( strError[0] != '\0' ) + return 0.0; + + dblRet = BinaryOperation(left, right, tok_temp.str[0], strError); + if ( strError[0] != '\0' ) + return 0.0; + + push_val(dblRet, strError); + if ( strError[0] != '\0' ) + return 0.0; + } + else + { + push_val( -1 * right, strError ); + if ( strError[0] != '\0' ) + return 0.0; + } + } + + dblRet = pop_val(strError); + if ( strError[0] != '\0' ) + return 0.0; + + if ( is_empty_val() ) + { + return dblRet; + } + else + { + sprintf(strError, "Error: malformed expression.\n"); + return 0.0; + } +} + +double eval_infix( int *ierr, const char *strExpression, int len ) +{ + double result = 0.0; + char strHelper[257]; + char strError[257]; + int i; + + /* maximum length of strExpression is 256 chars */ + if (len>256) { + printf("[eval_infix.c] expression longer than 256 characters\n"); + ierr[0] = 1; + return result; + } + + /* it's safer to reformat strings for C, with null terminator '\0' */ + for(i=0;i 256 ) { + *ierr = 3; + } else { + for( i = 0; i < *len; i ++ ) { + tmp[i] = (char)strExpression[i]; + } + result = eval_infix( ierr, tmp, *len ); + } + return result; +} diff --git a/tests/apps/miniDFT/tests/src/ewald.f90 b/tests/apps/miniDFT/tests/src/ewald.f90 new file mode 100644 index 0000000000..d38fe00bb5 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/ewald.f90 @@ -0,0 +1,164 @@ +! +! Copyright (C) 2001 PWSCF group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +!----------------------------------------------------------------------- +function ewald (alat, nat, ntyp, ityp, zv, at, bg, tau, omega, g, & + gg, ngm, gcutm, gstart, gamma_only, strf) + !----------------------------------------------------------------------- + ! + ! Calculates Ewald energy with both G- and R-space terms. + ! Determines optimal alpha. Should hopefully work for any structure. + ! + ! + USE kinds + USE constants, ONLY : tpi, e2 + USE mp_global, ONLY : intra_bgrp_comm + USE mp, ONLY : mp_sum + implicit none + ! + ! first the dummy variables + ! + + integer :: nat, ntyp, ityp (nat), ngm, gstart + ! input: number of atoms in the unit cell + ! input: number of different types of atoms + ! input: the type of each atom + ! input: number of plane waves for G sum + ! input: first non-zero G vector + + logical :: gamma_only + + real(DP) :: tau (3, nat), g (3, ngm), gg (ngm), zv (ntyp), & + at (3, 3), bg (3, 3), omega, alat, gcutm + ! input: the positions of the atoms in the cell + ! input: the coordinates of G vectors + ! input: the square moduli of G vectors + ! input: the charge of each type of atoms + ! input: the direct lattice vectors + ! input: the reciprocal lattice vectors + ! input: the volume of the unit cell + ! input: lattice parameter + ! input: cut-off of g vectors + complex(DP) :: strf (ngm, ntyp) + ! input: structure factor + real(DP) :: ewald + ! output: the ewald energy + ! + ! here the local variables + ! + integer, parameter :: mxr = 50 + ! the maximum number of R vectors included in r + integer :: ng, nr, na, nb, nt, nrm + ! counter over reciprocal G vectors + ! counter over direct vectors + ! counter on atoms + ! counter on atoms + ! counter on atomic types + ! number of R vectors included in r sum + + real(DP) :: charge, tpiba2, ewaldg, ewaldr, dtau (3), alpha, & + r (3, mxr), r2 (mxr), rmax, rr, upperbound, fact + ! total ionic charge in the cell + ! length in reciprocal space + ! ewald energy computed in reciprocal space + ! ewald energy computed in real space + ! the difference tau_s - tau_s' + ! alpha term in ewald sum + ! input of the rgen routine ( not used here ) + ! the square modulus of R_j-tau_s-tau_s' + ! the maximum radius to consider real space sum + ! buffer variable + ! used to optimize alpha + complex(DP) :: rhon + real(DP), external :: qe_erfc + + tpiba2 = (tpi / alat) **2 + charge = 0.d0 + do na = 1, nat + charge = charge+zv (ityp (na) ) + enddo + alpha = 2.9d0 +100 alpha = alpha - 0.1d0 + ! + ! choose alpha in order to have convergence in the sum over G + ! upperbound is a safe upper bound for the error in the sum over G + ! + if (alpha.le.0.d0) call errore ('ewald', 'optimal alpha not found', 1) + upperbound = 2.d0 * charge**2 * sqrt (2.d0 * alpha / tpi) * qe_erfc ( & + sqrt (tpiba2 * gcutm / 4.d0 / alpha) ) + if (upperbound.gt.1.0d-7) goto 100 + ! + ! G-space sum here. + ! Determine if this processor contains G=0 and set the constant term + ! + if (gstart==2) then + ewaldg = - charge**2 / alpha / 4.0d0 + else + ewaldg = 0.0d0 + endif + if (gamma_only) then + fact = 2.d0 + else + fact = 1.d0 + end if + do ng = gstart, ngm + rhon = (0.d0, 0.d0) + do nt = 1, ntyp + rhon = rhon + zv (nt) * CONJG(strf (ng, nt) ) + enddo + ewaldg = ewaldg + fact * abs (rhon) **2 * exp ( - gg (ng) * tpiba2 / & + alpha / 4.d0) / gg (ng) / tpiba2 + enddo + ewaldg = 2.d0 * tpi / omega * ewaldg + ! + ! Here add the other constant term + ! + if (gstart.eq.2) then + do na = 1, nat + ewaldg = ewaldg - zv (ityp (na) ) **2 * sqrt (8.d0 / tpi * & + alpha) + enddo + endif + ! + ! R-space sum here (only for the processor that contains G=0) + ! + ewaldr = 0.d0 + if (gstart.eq.2) then + rmax = 4.d0 / sqrt (alpha) / alat + ! + ! with this choice terms up to ZiZj*erfc(4) are counted (erfc(4)=2x10^-8 + ! + do na = 1, nat + do nb = 1, nat + dtau (:) = tau (:, na) - tau (:, nb) + ! + ! generates nearest-neighbors shells + ! + call rgen (dtau, rmax, mxr, at, bg, r, r2, nrm) + ! + ! and sum to the real space part + ! + do nr = 1, nrm + rr = sqrt (r2 (nr) ) * alat + ewaldr = ewaldr + zv (ityp (na) ) * zv (ityp (nb) ) * qe_erfc ( & + sqrt (alpha) * rr) / rr + enddo + enddo + enddo + endif + ewald = 0.5d0 * e2 * (ewaldg + ewaldr) + ! + call mp_sum( ewald, intra_bgrp_comm ) + ! call mp_sum( ewaldr, intra_bgrp_comm ) + ! call mp_sum( ewaldg, intra_bgrp_comm ) + ! WRITE( stdout,'(/5x,"alpha used in ewald term: ",f4.2/ + ! + 5x,"R-space term: ",f12.7,5x,"G-space term: ",f12.7/)') + ! + alpha, ewaldr, ewaldg + return +end function ewald + diff --git a/tests/apps/miniDFT/tests/src/fft_base.f90 b/tests/apps/miniDFT/tests/src/fft_base.f90 new file mode 100644 index 0000000000..1454766840 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/fft_base.f90 @@ -0,0 +1,1559 @@ +! +! Copyright (C) 2006-2010 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +! +!---------------------------------------------------------------------- +! FFT base Module. +! Written by Carlo Cavazzoni +!---------------------------------------------------------------------- +! +!=----------------------------------------------------------------------=! + MODULE fft_base +!=----------------------------------------------------------------------=! + + USE kinds, ONLY: DP + USE parallel_include + + USE fft_types, ONLY: fft_dlay_descriptor + + IMPLICIT NONE + + ! ... data structure containing all information + ! ... about fft data distribution for a given + ! ... potential grid, and its wave functions sub-grid. + + TYPE ( fft_dlay_descriptor ) :: dfftp ! descriptor for dense grid + ! Dimensions of the 3D real and reciprocal space FFT grid + ! relative to the charge density and potential ("dense" grid) + TYPE ( fft_dlay_descriptor ) :: dffts ! descriptor for smooth grid + ! Dimensions of the 3D real and reciprocal space + ! FFT grid relative to the smooth part of the charge density + ! (may differ from the full charge density grid for USPP ) + TYPE ( fft_dlay_descriptor ) :: dfftb ! descriptor for box grids + ! Dimensions of the 3D real and reciprocal space + ! FFT grid relative to the "small box" computation + ! of the atomic augmentation part of the + ! charge density used in USPP (to speed up CPV iterations) + + SAVE + + PRIVATE + + PUBLIC :: fft_scatter, grid_gather, grid_scatter + PUBLIC :: dfftp, dffts, dfftb, fft_dlay_descriptor + PUBLIC :: cgather_sym, cgather_smooth, cgather_custom + PUBLIC :: cscatter_sym, cscatter_smooth, cscatter_custom + PUBLIC :: gather_smooth, scatter_smooth + PUBLIC :: tg_gather + + + +!=----------------------------------------------------------------------=! + CONTAINS +!=----------------------------------------------------------------------=! +! +! +! +#if defined __NONBLOCKING_FFT +! +! NON BLOCKING SCATTER, should be better on switched network +! like infiniband, ethernet, myrinet +! +!----------------------------------------------------------------------- +SUBROUTINE fft_scatter ( dfft, f_in, nr3x, nxx_, f_aux, ncp_, npp_, isgn, use_tg ) + !----------------------------------------------------------------------- + ! + ! transpose the fft grid across nodes + ! a) From columns to planes (isgn > 0) + ! + ! "columns" (or "pencil") representation: + ! processor "me" has ncp_(me) contiguous columns along z + ! Each column has nr3x elements for a fft of order nr3 + ! nr3x can be =nr3+1 in order to reduce memory conflicts. + ! + ! The transpose take places in two steps: + ! 1) on each processor the columns are divided into slices along z + ! that are stored contiguously. On processor "me", slices for + ! processor "proc" are npp_(proc)*ncp_(me) big + ! 2) all processors communicate to exchange slices + ! (all columns with z in the slice belonging to "me" + ! must be received, all the others must be sent to "proc") + ! Finally one gets the "planes" representation: + ! processor "me" has npp_(me) complete xy planes + ! + ! b) From planes to columns (isgn < 0) + ! + ! Quite the same in the opposite direction + ! + ! The output is overwritten on f_in ; f_aux is used as work space + ! + ! If optional argument "use_tg" is true the subroutines performs + ! the trasposition using the Task Groups distribution + ! + USE parallel_include + USE kinds, ONLY : DP + + IMPLICIT NONE + + TYPE (fft_dlay_descriptor), INTENT(in) :: dfft + + INTEGER, INTENT(in) :: nr3x, nxx_, isgn, ncp_ (:), npp_ (:) + COMPLEX (DP), INTENT(inout) :: f_in (nxx_), f_aux (nxx_) + LOGICAL, OPTIONAL, INTENT(in) :: use_tg + + + INTEGER :: dest, from, k, ip, proc, ierr, me, ipoffset, nprocp, gproc, gcomm, i, kdest, kfrom + INTEGER :: sendcount(dfft%nproc), sdispls(dfft%nproc), recvcount(dfft%nproc), rdispls(dfft%nproc) + INTEGER :: offset(dfft%nproc) + INTEGER :: sh(dfft%nproc), rh(dfft%nproc) + ! + LOGICAL :: use_tg_ , lrcv, lsnd + LOGICAL :: tsts(dfft%nproc), tstr(dfft%nproc) + INTEGER :: istat( MPI_STATUS_SIZE ) + + INTEGER :: me_p, nppx, mc, j, npp, nnp, ii, it, ip, ioff + +#if defined __HPM + ! CALL f_hpmstart( 10, 'scatter' ) +#endif + + ! + ! Task Groups + + use_tg_ = .false. + + IF( present( use_tg ) ) use_tg_ = use_tg + + me = dfft%mype + 1 + ! + IF( use_tg_ ) THEN + ! This is the number of procs. in the plane-wave group + nprocp = dfft%npgrp + ipoffset = dfft%me_pgrp + gcomm = dfft%pgrp_comm + ELSE + nprocp = dfft%nproc + ipoffset = dfft%mype + gcomm = dfft%comm + ENDIF + ! + IF ( nprocp == 1 ) RETURN + ! + CALL start_clock ('fft_scatter') + ! + ! sendcount(proc): amount of data processor "me" must send to processor + ! recvcount(proc): amount of data processor "me" must receive from + ! + ! offset is used to locate the slices to be sent to proc + ! sdispls+1 is the beginning of data that must be sent to proc + ! rdispls+1 is the beginning of data that must be received from pr + ! + IF( use_tg_ ) THEN + DO proc = 1, nprocp + gproc = dfft%nplist( proc ) + 1 + sendcount (proc) = npp_ ( gproc ) * ncp_ (me) + recvcount (proc) = npp_ (me) * ncp_ ( gproc ) + ENDDO + offset(1) = 0 + DO proc = 2, nprocp + gproc = dfft%nplist( proc - 1 ) + 1 + offset(proc) = offset(proc - 1) + npp_ ( gproc ) + ENDDO + ELSE + DO proc = 1, nprocp + sendcount (proc) = npp_ (proc) * ncp_ (me) + recvcount (proc) = npp_ (me) * ncp_ (proc) + ENDDO + offset(1) = 0 + DO proc = 2, nprocp + offset(proc) = offset(proc - 1) + npp_ (proc - 1) + ENDDO + ENDIF + ! + sdispls (1) = 0 + rdispls (1) = 0 + DO proc = 2, nprocp + sdispls (proc) = sdispls (proc - 1) + sendcount (proc - 1) + rdispls (proc) = rdispls (proc - 1) + recvcount (proc - 1) + ENDDO + ! + ierr = 0 + ! + IF ( isgn > 0 ) THEN + ! + ! "forward" scatter from columns to planes + ! + ! step one: store contiguously the slices and send + ! + DO ip = 1, nprocp + + ! the following two lines make the loop iterations different on each + ! proc in order to avoid that all procs send a msg at the same proc + ! at the same time. + ! + proc = ipoffset + 1 + ip + IF( proc > nprocp ) proc = proc - nprocp + + gproc = proc + IF( use_tg_ ) gproc = dfft%nplist( proc ) + 1 + ! + from = 1 + offset( proc ) + dest = 1 + sdispls( proc ) + ! + ! optimize for large parallel execution, where npp_ ( gproc ) ~ 1 + ! + SELECT CASE ( npp_ ( gproc ) ) + CASE ( 1 ) + DO k = 1, ncp_ (me) + f_aux (dest + (k - 1) ) = f_in (from + (k - 1) * nr3x ) + ENDDO + CASE ( 2 ) + DO k = 1, ncp_ (me) + f_aux ( dest + (k - 1) * 2 - 1 + 1 ) = f_in ( from + (k - 1) * nr3x - 1 + 1 ) + f_aux ( dest + (k - 1) * 2 - 1 + 2 ) = f_in ( from + (k - 1) * nr3x - 1 + 2 ) + ENDDO + CASE ( 3 ) + DO k = 1, ncp_ (me) + f_aux ( dest + (k - 1) * 3 - 1 + 1 ) = f_in ( from + (k - 1) * nr3x - 1 + 1 ) + f_aux ( dest + (k - 1) * 3 - 1 + 2 ) = f_in ( from + (k - 1) * nr3x - 1 + 2 ) + f_aux ( dest + (k - 1) * 3 - 1 + 3 ) = f_in ( from + (k - 1) * nr3x - 1 + 3 ) + ENDDO + CASE ( 4 ) + DO k = 1, ncp_ (me) + f_aux ( dest + (k - 1) * 4 - 1 + 1 ) = f_in ( from + (k - 1) * nr3x - 1 + 1 ) + f_aux ( dest + (k - 1) * 4 - 1 + 2 ) = f_in ( from + (k - 1) * nr3x - 1 + 2 ) + f_aux ( dest + (k - 1) * 4 - 1 + 3 ) = f_in ( from + (k - 1) * nr3x - 1 + 3 ) + f_aux ( dest + (k - 1) * 4 - 1 + 4 ) = f_in ( from + (k - 1) * nr3x - 1 + 4 ) + ENDDO + CASE DEFAULT + DO k = 1, ncp_ (me) + kdest = dest + (k - 1) * npp_ ( gproc ) - 1 + kfrom = from + (k - 1) * nr3x - 1 + DO i = 1, npp_ ( gproc ) + f_aux ( kdest + i ) = f_in ( kfrom + i ) + ENDDO + ENDDO + END SELECT + ! + ! post the non-blocking send, f_aux can't be overwritten until operation has completed + ! + CALL mpi_isend( f_aux( sdispls( proc ) + 1 ), sendcount( proc ), MPI_DOUBLE_COMPLEX, & + proc-1, me, gcomm, sh( proc ), ierr ) + ! + IF( abs(ierr) /= 0 ) CALL errore ('fft_scatter', ' forward send info<>0', abs(ierr) ) + ! + ! + ENDDO + ! + ! step two: receive + ! + DO ip = 1, nprocp + ! + proc = ipoffset + 1 - ip + IF( proc < 1 ) proc = proc + nprocp + ! + ! now post the receive + ! + CALL mpi_irecv( f_in( rdispls( proc ) + 1 ), recvcount( proc ), MPI_DOUBLE_COMPLEX, & + proc-1, MPI_ANY_TAG, gcomm, rh( proc ), ierr ) + ! + IF( abs(ierr) /= 0 ) CALL errore ('fft_scatter', ' forward receive info<>0', abs(ierr) ) + ! + tstr( proc ) = .false. + tsts( proc ) = .false. + ! + ENDDO + ! + ! maybe useless; ensures that no garbage is present in the output + ! + f_in( rdispls( nprocp ) + recvcount( nprocp ) + 1 : size( f_in ) ) = 0.0_DP + ! + lrcv = .false. + lsnd = .false. + ! + ! exit only when all test are true: message operation have completed + ! + DO WHILE ( .not. lrcv .or. .not. lsnd ) + lrcv = .true. + lsnd = .true. + DO proc = 1, nprocp + ! + IF( .not. tstr( proc ) ) THEN + CALL mpi_test( rh( proc ), tstr( proc ), istat, ierr ) + ENDIF + ! + IF( .not. tsts( proc ) ) THEN + CALL mpi_test( sh( proc ), tsts( proc ), istat, ierr ) + ENDIF + ! + lrcv = lrcv .and. tstr( proc ) + lsnd = lsnd .and. tsts( proc ) + ! + ENDDO + ! + ENDDO + ! + IF( isgn == 1 ) THEN + + me_p = dfft%mype + 1 + + IF ( dfft%nproc == 1 ) THEN + nppx = dfft%nr3x + ELSE + nppx = dfft%npp( me_p ) + ENDIF + +!$omp parallel default(shared) +!$omp do + DO i = 1, size(f_aux) + f_aux(i) = (0.d0, 0.d0) + ENDDO + ! +!$omp do private(mc,j) + DO i = 1, dfft%nst + mc = dfft%ismap( i ) + DO j = 1, dfft%npp( me_p ) + f_aux( mc + ( j - 1 ) * dfft%nnp ) = f_in( j + ( i - 1 ) * nppx ) + ENDDO + ENDDO +!$omp end parallel + + ELSE + + me_p = dfft%mype + 1 + + IF( use_tg_ ) THEN + ! + nppx = dfft%tg_npp( me_p ) + npp = dfft%tg_npp( me_p ) + nnp = dfft%nr1x * dfft%nr2x + ! + ELSE + ! + nppx = dfft%npp( me_p ) + IF( dfft%nproc == 1 ) nppx = dfft%nr3x + npp = dfft%npp( me_p ) + nnp = dfft%nnp + ! + ENDIF + ! +!$omp parallel default(shared), private( ii, mc, j, i, ioff, ip, it ) +!$omp do + DO i = 1, size( f_aux ) + f_aux(i) = (0.d0, 0.d0) + ENDDO + ! + ii = 0 + ! + DO ip = 1, dfft%nproc + ! + ioff = dfft%iss( ip ) + ! +!$omp do + DO i = 1, dfft%nsw( ip ) + ! + mc = dfft%ismap( i + ioff ) + ! + it = ( ii + i - 1 ) * nppx + ! + DO j = 1, npp + f_aux( mc + ( j - 1 ) * nnp ) = f_in( j + it ) + ENDDO + ! + ENDDO + ! + ii = ii + dfft%nsw( ip ) + ! + ENDDO +!$omp end parallel + + END IF + ! + ELSE + ! + ! "backward" scatter from planes to columns + ! + IF( isgn == -1 ) THEN + me_p = dfft%mype + 1 + IF ( dfft%nproc == 1 ) THEN + nppx = dfft%nr3x + ELSE + nppx = dfft%npp( me_p ) + ENDIF +!$omp parallel default(shared), private( mc, j, i ) +!$omp do + DO i = 1, dfft%nst + mc = dfft%ismap( i ) + DO j = 1, dfft%npp( me_p ) + f_in( j + ( i - 1 ) * nppx ) = f_aux( mc + ( j - 1 ) * dfft%nnp ) + ENDDO + ENDDO +!$omp end parallel + + ELSE + + me_p = dfft%mype + 1 + + IF( use_tg_ ) THEN + ! + nppx = dfft%tg_npp( me_p ) + npp = dfft%tg_npp( me_p ) + nnp = dfft%nr1x * dfft%nr2x + ! + ELSE + ! + nppx = dfft%npp( me_p ) + IF( dfft%nproc == 1 ) nppx = dfft%nr3x + npp = dfft%npp( me_p ) + nnp = dfft%nnp + ! + ENDIF + +!$omp parallel default(shared), private( mc, j, i, ii, ip, it ) + ii = 0 + DO ip = 1, dfft%nproc +!$omp do + DO i = 1, dfft%nsw( ip ) + mc = dfft%ismap( i + dfft%iss( ip ) ) + it = (ii + i - 1)*nppx + DO j = 1, npp + f_in( j + it ) = f_aux( mc + ( j - 1 ) * nnp ) + ENDDO + ENDDO + ii = ii + dfft%nsw( ip ) + ENDDO +!$omp end parallel + + END IF + ! + DO ip = 1, nprocp + + ! post the non blocking send + + proc = ipoffset + 1 + ip + IF( proc > nprocp ) proc = proc - nprocp + + CALL mpi_isend( f_in( rdispls( proc ) + 1 ), recvcount( proc ), MPI_DOUBLE_COMPLEX, & + proc-1, me, gcomm, sh( proc ), ierr ) + IF( abs(ierr) /= 0 ) CALL errore ('fft_scatter', ' backward send info<>0', abs(ierr) ) + + ! post the non blocking receive + + proc = ipoffset + 1 - ip + IF( proc < 1 ) proc = proc + nprocp + + CALL mpi_irecv( f_aux( sdispls( proc ) + 1 ), sendcount( proc ), MPI_DOUBLE_COMPLEX, & + proc-1, MPI_ANY_TAG, gcomm, rh(proc), ierr ) + IF( abs(ierr) /= 0 ) CALL errore ('fft_scatter', ' backward receive info<>0', abs(ierr) ) + + tstr( ip ) = .false. + tsts( ip ) = .false. + + ENDDO + ! + lrcv = .false. + lsnd = .false. + ! + ! exit only when all test are true: message hsve been sent and received + ! + DO WHILE ( .not. lsnd ) + ! + lsnd = .true. + ! + DO proc = 1, nprocp + ! + IF( .not. tsts( proc ) ) THEN + CALL mpi_test( sh( proc ), tsts( proc ), istat, ierr ) + ENDIF + + lsnd = lsnd .and. tsts( proc ) + + ENDDO + + ENDDO + ! + lrcv = .false. + ! + DO WHILE ( .not. lrcv ) + ! + lrcv = .true. + ! + DO proc = 1, nprocp + + gproc = proc + IF( use_tg_ ) gproc = dfft%nplist(proc)+1 + + IF( .not. tstr( proc ) ) THEN + + CALL mpi_test( rh( proc ), tstr( proc ), istat, ierr ) + + IF( tstr( proc ) ) THEN + + from = 1 + sdispls( proc ) + dest = 1 + offset( proc ) + ! + ! optimize for large parallel execution, where npp_ ( gproc ) ~ 1 + ! + SELECT CASE ( npp_ ( gproc ) ) + CASE ( 1 ) + DO k = 1, ncp_ (me) + f_in ( dest + (k - 1) * nr3x ) = f_aux ( from + k - 1 ) + ENDDO + CASE ( 2 ) + DO k = 1, ncp_ ( me ) + f_in ( dest + (k - 1) * nr3x - 1 + 1 ) = f_aux( from + (k - 1) * 2 - 1 + 1 ) + f_in ( dest + (k - 1) * nr3x - 1 + 2 ) = f_aux( from + (k - 1) * 2 - 1 + 2 ) + ENDDO + CASE ( 3 ) + DO k = 1, ncp_ ( me ) + f_in ( dest + (k - 1) * nr3x - 1 + 1 ) = f_aux( from + (k - 1) * 3 - 1 + 1 ) + f_in ( dest + (k - 1) * nr3x - 1 + 2 ) = f_aux( from + (k - 1) * 3 - 1 + 2 ) + f_in ( dest + (k - 1) * nr3x - 1 + 3 ) = f_aux( from + (k - 1) * 3 - 1 + 3 ) + ENDDO + CASE ( 4 ) + DO k = 1, ncp_ ( me ) + f_in ( dest + (k - 1) * nr3x - 1 + 1 ) = f_aux( from + (k - 1) * 4 - 1 + 1 ) + f_in ( dest + (k - 1) * nr3x - 1 + 2 ) = f_aux( from + (k - 1) * 4 - 1 + 2 ) + f_in ( dest + (k - 1) * nr3x - 1 + 3 ) = f_aux( from + (k - 1) * 4 - 1 + 3 ) + f_in ( dest + (k - 1) * nr3x - 1 + 4 ) = f_aux( from + (k - 1) * 4 - 1 + 4 ) + ENDDO + CASE DEFAULT + DO k = 1, ncp_ ( me ) + kdest = dest + (k - 1) * nr3x - 1 + kfrom = from + (k - 1) * npp_ ( gproc ) - 1 + DO i = 1, npp_ ( gproc ) + f_in ( kdest + i ) = f_aux( kfrom + i ) + ENDDO + ENDDO + END SELECT + + ENDIF + + ENDIF + + lrcv = lrcv .and. tstr( proc ) + + ENDDO + + ENDDO + + ENDIF + + CALL stop_clock ('fft_scatter') + + +#if defined __HPM + ! CALL f_hpmstop( 10 ) +#endif + + RETURN + +END SUBROUTINE fft_scatter +! +! +! +#else +! +! ALLTOALL based SCATTER, should be better on network +! with a defined topology, like on bluegene and cray machine +! +!----------------------------------------------------------------------- +SUBROUTINE fft_scatter ( dfft, f_in, nr3x, nxx_, f_aux, ncp_, npp_, isgn, use_tg ) + !----------------------------------------------------------------------- + ! + ! transpose the fft grid across nodes + ! a) From columns to planes (isgn > 0) + ! + ! "columns" (or "pencil") representation: + ! processor "me" has ncp_(me) contiguous columns along z + ! Each column has nr3x elements for a fft of order nr3 + ! nr3x can be =nr3+1 in order to reduce memory conflicts. + ! + ! The transpose take places in two steps: + ! 1) on each processor the columns are divided into slices along z + ! that are stored contiguously. On processor "me", slices for + ! processor "proc" are npp_(proc)*ncp_(me) big + ! 2) all processors communicate to exchange slices + ! (all columns with z in the slice belonging to "me" + ! must be received, all the others must be sent to "proc") + ! Finally one gets the "planes" representation: + ! processor "me" has npp_(me) complete xy planes + ! + ! b) From planes to columns (isgn < 0) + ! + ! Quite the same in the opposite direction + ! + ! The output is overwritten on f_in ; f_aux is used as work space + ! + ! If optional argument "use_tg" is true the subroutines performs + ! the trasposition using the Task Groups distribution + ! + USE parallel_include + USE kinds, ONLY : DP + + IMPLICIT NONE + + TYPE (fft_dlay_descriptor), INTENT(in) :: dfft + INTEGER, INTENT(in) :: nr3x, nxx_, isgn, ncp_ (:), npp_ (:) + COMPLEX (DP), INTENT(inout) :: f_in (nxx_), f_aux (nxx_) + LOGICAL, OPTIONAL, INTENT(in) :: use_tg + + + INTEGER :: dest, from, k, offset, proc, ierr, me, nprocp, gproc, gcomm, i, kdest, kfrom + INTEGER :: sendcount (dfft%nproc), sdispls (dfft%nproc), recvcount (dfft%nproc), rdispls (dfft%nproc) + INTEGER :: me_p, nppx, mc, j, npp, nnp, ii, it, ip, ioff + ! + LOGICAL :: use_tg_ + +#if defined __HPM + ! CALL f_hpmstart( 10, 'scatter' ) +#endif + + ! + ! Task Groups + + use_tg_ = .false. + + IF( present( use_tg ) ) use_tg_ = use_tg + + me = dfft%mype + 1 + ! + IF( use_tg_ ) THEN + ! This is the number of procs. in the plane-wave group + nprocp = dfft%npgrp + ELSE + nprocp = dfft%nproc + ENDIF + ! + CALL start_clock ('fft_scatter') + ! + ! sendcount(proc): amount of data processor "me" must send to processor + ! recvcount(proc): amount of data processor "me" must receive from + ! offset1(proc) is used to locate the slices to be sent to proc + ! sdispls(proc)+1 is the beginning of data that must be sent to proc + ! rdispls(proc)+1 is the beginning of data that must be received from pr + ! + ! + IF( use_tg_ ) THEN + DO proc = 1, nprocp + gproc = dfft%nplist( proc ) + 1 + sendcount (proc) = npp_ ( gproc ) * ncp_ (me) + recvcount (proc) = npp_ (me) * ncp_ ( gproc ) + ENDDO + ELSE + DO proc = 1, nprocp + sendcount (proc) = npp_ (proc) * ncp_ (me) + recvcount (proc) = npp_ (me) * ncp_ (proc) + ENDDO + ENDIF + ! + sdispls (1) = 0 + rdispls (1) = 0 + DO proc = 2, nprocp + sdispls (proc) = sdispls (proc - 1) + sendcount (proc - 1) + rdispls (proc) = rdispls (proc - 1) + recvcount (proc - 1) + ENDDO + ! + + ierr = 0 + IF (isgn.gt.0) THEN + + IF( nprocp < 2 ) GO TO 10 + ! + ! "forward" scatter from columns to planes + ! + ! step one: store contiguously the slices + ! + offset = 1 + + DO proc = 1, nprocp + from = offset + dest = 1 + sdispls (proc) + IF( use_tg_ ) THEN + gproc = dfft%nplist(proc)+1 + ELSE + gproc = proc + ENDIF + ! + DO k = 1, ncp_ (me) + kdest = dest + (k - 1) * npp_ ( gproc ) - 1 + kfrom = from + (k - 1) * nr3x - 1 + DO i = 1, npp_ ( gproc ) + f_aux ( kdest + i ) = f_in ( kfrom + i ) + ENDDO + ENDDO + offset = offset + npp_ ( gproc ) + ENDDO + + ! + ! maybe useless; ensures that no garbage is present in the output + ! + f_in = 0.0_DP + ! + ! step two: communication + ! + IF( use_tg_ ) THEN + gcomm = dfft%pgrp_comm + ELSE + gcomm = dfft%comm + ENDIF + + CALL mpi_barrier (gcomm, ierr) ! why barrier? for buggy openmpi over ib + + CALL mpi_alltoallv (f_aux(1), sendcount, sdispls, MPI_DOUBLE_COMPLEX, f_in(1), & + recvcount, rdispls, MPI_DOUBLE_COMPLEX, gcomm, ierr) + + IF( abs(ierr) /= 0 ) CALL errore ('fft_scatter', 'info<>0', abs(ierr) ) + ! +10 CONTINUE + + IF( isgn == 1 ) THEN + + me_p = dfft%mype + 1 + + IF ( dfft%nproc == 1 ) THEN + nppx = dfft%nr3x + ELSE + nppx = dfft%npp( me_p ) + ENDIF + +!$omp parallel default(shared) +!$omp do + DO i = 1, size(f_aux) + f_aux(i) = (0.d0, 0.d0) + ENDDO + ! +!$omp do private(mc,j) + DO i = 1, dfft%nst + mc = dfft%ismap( i ) + DO j = 1, dfft%npp( me_p ) + f_aux( mc + ( j - 1 ) * dfft%nnp ) = f_in( j + ( i - 1 ) * nppx ) + ENDDO + ENDDO +!$omp end parallel + + ELSE + + me_p = dfft%mype + 1 + + IF( use_tg_ ) THEN + ! + nppx = dfft%tg_npp( me_p ) + npp = dfft%tg_npp( me_p ) + nnp = dfft%nr1x * dfft%nr2x + ! + ELSE + ! + nppx = dfft%npp( me_p ) + IF( dfft%nproc == 1 ) nppx = dfft%nr3x + npp = dfft%npp( me_p ) + nnp = dfft%nnp + ! + ENDIF + ! +!$omp parallel default(shared), private( ii, mc, j, i, ioff, ip, it ) +!$omp do + DO i = 1, size( f_aux ) + f_aux(i) = (0.d0, 0.d0) + ENDDO + ! + ii = 0 + ! + DO ip = 1, dfft%nproc + ! + ioff = dfft%iss( ip ) + ! +!$omp do + DO i = 1, dfft%nsw( ip ) + ! + mc = dfft%ismap( i + ioff ) + ! + it = ( ii + i - 1 ) * nppx + ! + DO j = 1, npp + f_aux( mc + ( j - 1 ) * nnp ) = f_in( j + it ) + ENDDO + ! + ENDDO + ! + ii = ii + dfft%nsw( ip ) + ! + ENDDO +!$omp end parallel + + + END IF + + ELSE + ! + ! "backward" scatter from planes to columns + ! + IF( isgn == -1 ) THEN + me_p = dfft%mype + 1 + IF ( dfft%nproc == 1 ) THEN + nppx = dfft%nr3x + ELSE + nppx = dfft%npp( me_p ) + ENDIF +!$omp parallel default(shared), private( mc, j, i ) +!$omp do + DO i = 1, dfft%nst + mc = dfft%ismap( i ) + DO j = 1, dfft%npp( me_p ) + f_in( j + ( i - 1 ) * nppx ) = f_aux( mc + ( j - 1 ) * dfft%nnp ) + ENDDO + ENDDO +!$omp end parallel + + ELSE + + me_p = dfft%mype + 1 + + IF( use_tg_ ) THEN + ! + nppx = dfft%tg_npp( me_p ) + npp = dfft%tg_npp( me_p ) + nnp = dfft%nr1x * dfft%nr2x + ! + ELSE + ! + nppx = dfft%npp( me_p ) + IF( dfft%nproc == 1 ) nppx = dfft%nr3x + npp = dfft%npp( me_p ) + nnp = dfft%nnp + ! + ENDIF + +!$omp parallel default(shared), private( mc, j, i, ii, ip, it ) + ii = 0 + DO ip = 1, dfft%nproc +!$omp do + DO i = 1, dfft%nsw( ip ) + mc = dfft%ismap( i + dfft%iss( ip ) ) + it = (ii + i - 1)*nppx + DO j = 1, npp + f_in( j + it ) = f_aux( mc + ( j - 1 ) * nnp ) + ENDDO + ENDDO + ii = ii + dfft%nsw( ip ) + ENDDO +!$omp end parallel + + END IF + + IF( nprocp < 2 ) GO TO 20 + ! + ! step two: communication + ! + IF( use_tg_ ) THEN + gcomm = dfft%pgrp_comm + ELSE + gcomm = dfft%comm + ENDIF + + CALL mpi_barrier (gcomm, ierr) ! why barrier? for buggy openmpi over ib + + CALL mpi_alltoallv (f_in(1), recvcount, rdispls, MPI_DOUBLE_COMPLEX, f_aux(1), & + sendcount, sdispls, MPI_DOUBLE_COMPLEX, gcomm, ierr) + + IF( abs(ierr) /= 0 ) CALL errore ('fft_scatter', 'info<>0', abs(ierr) ) + ! + ! step one: store contiguously the columns + ! + f_in = 0.0_DP + ! + offset = 1 + ! + DO proc = 1, nprocp + from = 1 + sdispls (proc) + dest = offset + IF( use_tg_ ) THEN + gproc = dfft%nplist(proc)+1 + ELSE + gproc = proc + ENDIF + ! + DO k = 1, ncp_ (me) + kdest = dest + (k - 1) * nr3x - 1 + kfrom = from + (k - 1) * npp_ ( gproc ) - 1 + DO i = 1, npp_ ( gproc ) + f_in ( kdest + i ) = f_aux( kfrom + i ) + ENDDO + ENDDO + ! + offset = offset + npp_ ( gproc ) + ! + ENDDO + +20 CONTINUE + + ENDIF + + CALL stop_clock ('fft_scatter') + + +#if defined __HPM + ! CALL f_hpmstop( 10 ) +#endif + + RETURN + +END SUBROUTINE fft_scatter + +#endif + +!---------------------------------------------------------------------------- +SUBROUTINE grid_gather( f_in, f_out ) + !---------------------------------------------------------------------------- + ! + ! ... gathers nproc distributed data on the first processor of every pool + ! + ! ... REAL*8 f_in = distributed variable (nxx) + ! ... REAL*8 f_out = gathered variable (nr1x*nr2x*nr3x) + ! + USE kinds, ONLY : DP + USE parallel_include + ! + IMPLICIT NONE + ! + REAL(DP) :: f_in( : ), f_out( : ) + ! + ! + INTEGER :: proc, info + INTEGER :: displs(0:dfftp%nproc-1), recvcount(0:dfftp%nproc-1) + ! + IF( size( f_in ) < dfftp%nnr ) & + CALL errore( ' grid_gather ', ' f_in too small ', dfftp%nnr - size( f_in ) ) + ! + CALL start_clock( 'gather' ) + ! + DO proc = 0, ( dfftp%nproc - 1 ) + ! + recvcount(proc) = dfftp%nnp * dfftp%npp(proc+1) + ! + IF ( proc == 0 ) THEN + ! + displs(proc) = 0 + ! + ELSE + ! + displs(proc) = displs(proc-1) + recvcount(proc-1) + ! + ENDIF + ! + ENDDO + ! + info = size( f_out ) - displs( dfftp%nproc - 1 ) - recvcount( dfftp%nproc - 1 ) + ! + IF( info < 0 ) & + CALL errore( ' grid_gather ', ' f_out too small ', -info ) + ! + info = 0 + ! + CALL MPI_GATHERV( f_in, recvcount(dfftp%mype), MPI_DOUBLE_PRECISION, f_out, & + recvcount, displs, MPI_DOUBLE_PRECISION, dfftp%root, & + dfftp%comm, info ) + ! + CALL errore( 'gather', 'info<>0', info ) + ! + CALL stop_clock( 'gather' ) + ! + ! + RETURN + ! +END SUBROUTINE grid_gather + + +!---------------------------------------------------------------------------- +SUBROUTINE grid_scatter( f_in, f_out ) + !---------------------------------------------------------------------------- + ! + ! ... scatters data from the first processor of every pool + ! + ! ... REAL*8 f_in = gathered variable (nr1x*nr2x*nr3x) + ! ... REAL*8 f_out = distributed variable (nxx) + ! + USE kinds, ONLY : DP + USE parallel_include + ! + IMPLICIT NONE + ! + REAL(DP) :: f_in( : ), f_out( : ) + ! + ! + INTEGER :: proc, info + INTEGER :: displs(0:dfftp%nproc-1), sendcount(0:dfftp%nproc-1) + ! + IF( size( f_out ) < dfftp%nnr ) & + CALL errore( ' grid_scatter ', ' f_out too small ', dfftp%nnr - size( f_in ) ) + ! + CALL start_clock( 'scatter' ) + ! + DO proc = 0, ( dfftp%nproc - 1 ) + ! + sendcount(proc) = dfftp%nnp * dfftp%npp(proc+1) + ! + IF ( proc == 0 ) THEN + ! + displs(proc) = 0 + ! + ELSE + ! + displs(proc) = displs(proc-1) + sendcount(proc-1) + ! + ENDIF + ! + ENDDO + ! + info = size( f_in ) - displs( dfftp%nproc - 1 ) - sendcount( dfftp%nproc - 1 ) + ! + IF( info < 0 ) & + CALL errore( ' grid_scatter ', ' f_in too small ', -info ) + ! + info = 0 + ! + CALL MPI_SCATTERV( f_in, sendcount, displs, MPI_DOUBLE_PRECISION, & + f_out, sendcount(dfftp%mype), MPI_DOUBLE_PRECISION, & + dfftp%root, dfftp%comm, info ) + ! + CALL errore( 'scatter', 'info<>0', info ) + ! + IF ( sendcount(dfftp%mype) /= dfftp%nnr ) f_out(sendcount(dfftp%mype)+1:dfftp%nnr) = 0.D0 + ! + CALL stop_clock( 'scatter' ) + ! + ! + RETURN + ! +END SUBROUTINE grid_scatter +! +! ... "gather"-like subroutines +! +!----------------------------------------------------------------------- +SUBROUTINE cgather_sym( f_in, f_out ) + !----------------------------------------------------------------------- + ! + ! ... gather complex data for symmetrization (in phonon code) + ! ... COMPLEX*16 f_in = distributed variable (nrxx) + ! ... COMPLEX*16 f_out = gathered variable (nr1x*nr2x*nr3x) + ! + USE mp, ONLY : mp_barrier + USE parallel_include + ! + IMPLICIT NONE + ! + COMPLEX(DP) :: f_in( : ), f_out(:) + ! + ! + INTEGER :: proc, info + INTEGER :: displs(0:dfftp%nproc-1), recvcount(0:dfftp%nproc-1) + ! + ! + CALL start_clock( 'cgather' ) + ! + DO proc = 0, ( dfftp%nproc - 1 ) + ! + recvcount(proc) = 2 * dfftp%nnp * dfftp%npp(proc+1) + ! + IF ( proc == 0 ) THEN + ! + displs(proc) = 0 + ! + ELSE + ! + displs(proc) = displs(proc-1) + recvcount(proc-1) + ! + ENDIF + ! + ENDDO + ! + CALL mp_barrier( dfftp%comm ) + ! + CALL MPI_ALLGATHERV( f_in, recvcount(dfftp%mype), MPI_DOUBLE_PRECISION, & + f_out, recvcount, displs, MPI_DOUBLE_PRECISION, & + dfftp%comm, info ) + ! + CALL errore( 'cgather_sym', 'info<>0', info ) + ! +! CALL mp_barrier( dfftp%comm ) + ! + CALL stop_clock( 'cgather' ) + ! + ! + RETURN + ! +END SUBROUTINE cgather_sym +! +!---------------------------------------------------------------------------- +SUBROUTINE cgather_smooth ( f_in, f_out ) + !---------------------------------------------------------------------------- + ! + ! ... gathers data on the smooth AND complex fft grid + ! + ! ... gathers nproc distributed data on the first processor of every pool + ! + ! ... COMPLEX*16 f_in = distributed variable ( dffts%nnr ) + ! ... COMPLEX*16 f_out = gathered variable (nr1sx*nr2sx*nr3sx) + ! + USE mp, ONLY : mp_barrier + USE kinds, ONLY : DP + USE parallel_include + ! + IMPLICIT NONE + ! + COMPLEX(DP) :: f_in(:), f_out(:) + ! + ! + INTEGER :: proc, info + INTEGER :: displs(0:dfftp%nproc-1), recvcount(0:dfftp%nproc-1) + ! + ! + CALL start_clock( 'gather' ) + ! + DO proc = 0, ( dfftp%nproc - 1 ) + ! + recvcount(proc) = 2 * dffts%nnp * dffts%npp(proc+1) + ! + IF ( proc == 0 ) THEN + ! + displs(proc) = 0 + ! + ELSE + ! + displs(proc) = displs(proc-1) + recvcount(proc-1) + ! + ENDIF + ! + ENDDO + ! + CALL mp_barrier( dfftp%comm ) + ! + CALL MPI_GATHERV( f_in, recvcount(dfftp%mype), MPI_DOUBLE_PRECISION, f_out, & + recvcount, displs, MPI_DOUBLE_PRECISION, dfftp%root, & + dfftp%comm, info ) + ! + CALL errore( 'gather', 'info<>0', info ) + ! + CALL stop_clock( 'gather' ) + ! + ! + RETURN + ! +END SUBROUTINE cgather_smooth +! +!---------------------------------------------------------------------------- +SUBROUTINE cgather_custom ( f_in, f_out, dfftt ) + !---------------------------------------------------------------------------- + ! + ! ... gathers data on the custom AND complex fft grid + ! + ! ... gathers nproc distributed data on the first processor of every pool + ! + ! ... COMPLEX*16 f_in = distributed variable ( dfftt%nnr ) + ! ... COMPLEX*16 f_out = gathered variable (nr1sx*nr2sx*nr3sx) + ! + USE mp, ONLY : mp_barrier + USE kinds, ONLY : DP + USE parallel_include + ! + IMPLICIT NONE + ! + COMPLEX(DP) :: f_in(:), f_out(:) + TYPE ( fft_dlay_descriptor ), INTENT(IN) :: dfftt + ! + ! + INTEGER :: proc, info + INTEGER :: displs(0:dfftp%nproc-1), recvcount(0:dfftp%nproc-1) + ! + ! + CALL start_clock( 'gather' ) + ! + DO proc = 0, ( dfftp%nproc - 1 ) + ! + recvcount(proc) = 2 * dfftt%nnp * dfftt%npp(proc+1) + ! + IF ( proc == 0 ) THEN + ! + displs(proc) = 0 + ! + ELSE + ! + displs(proc) = displs(proc-1) + recvcount(proc-1) + ! + ENDIF + ! + ENDDO + ! + CALL mp_barrier( dfftp%comm ) + ! + CALL MPI_GATHERV( f_in, recvcount(dfftp%mype), MPI_DOUBLE_PRECISION, f_out, & + recvcount, displs, MPI_DOUBLE_PRECISION, dfftp%root, & + dfftp%comm, info ) + ! + CALL errore( 'gather', 'info<>0', info ) + ! + CALL stop_clock( 'gather' ) + ! + ! + RETURN + ! +END SUBROUTINE cgather_custom +! +! ... "scatter"-like subroutines +! +!---------------------------------------------------------------------------- +SUBROUTINE cscatter_sym( f_in, f_out ) + !---------------------------------------------------------------------------- + ! + ! ... scatters data from the first processor of every pool + ! + ! ... COMPLEX*16 f_in = gathered variable (nr1x*nr2x*nr3x) + ! ... COMPLEX*16 f_out = distributed variable (nxx) + ! + USE mp, ONLY : mp_barrier + USE kinds, ONLY : DP + USE parallel_include + ! + IMPLICIT NONE + ! + COMPLEX(DP) :: f_in(:), f_out(:) + ! + ! + INTEGER :: proc, info + INTEGER :: displs(0:dfftp%nproc-1), sendcount(0:dfftp%nproc-1) + ! + ! + CALL start_clock( 'cscatter_sym' ) + ! + DO proc = 0, ( dfftp%nproc - 1 ) + ! + sendcount(proc) = 2 * dfftp%nnp * dfftp%npp(proc+1) + ! + IF ( proc == 0 ) THEN + ! + displs(proc) = 0 + ! + ELSE + ! + displs(proc) = displs(proc-1) + sendcount(proc-1) + ! + ENDIF + ! + ENDDO + ! + CALL mp_barrier( dfftp%comm ) + ! + CALL MPI_SCATTERV( f_in, sendcount, displs, MPI_DOUBLE_PRECISION, & + f_out, sendcount(dfftp%mype), MPI_DOUBLE_PRECISION, & + dfftp%root, dfftp%comm, info ) + ! + CALL errore( 'cscatter_sym', 'info<>0', info ) + ! + IF ( sendcount(dfftp%mype) /= dfftp%nnr ) f_out(sendcount(dfftp%mype)+1: dfftp%nnr ) = 0.D0 + ! + CALL stop_clock( 'cscatter_sym' ) + ! + ! + RETURN + ! +END SUBROUTINE cscatter_sym +! +!---------------------------------------------------------------------------- +SUBROUTINE cscatter_smooth( f_in, f_out ) + !---------------------------------------------------------------------------- + ! + ! ... scatters data on the smooth AND complex fft grid + ! ... scatters data from the first processor of every pool + ! + ! ... COMPLEX*16 f_in = gathered variable (nr1sx*nr2sx*nr3sx) + ! ... COMPLEX*16 f_out = distributed variable ( dffts%nnr) + ! + USE mp, ONLY : mp_barrier + USE kinds, ONLY : DP + USE parallel_include + ! + IMPLICIT NONE + ! + COMPLEX(DP) :: f_in(:), f_out(:) + ! + ! + INTEGER :: proc, info + INTEGER :: displs(0:dfftp%nproc-1), sendcount(0:dfftp%nproc-1) + ! + ! + CALL start_clock( 'scatter' ) + ! + DO proc = 0, ( dfftp%nproc - 1 ) + ! + sendcount(proc) = 2 * dffts%nnp * dffts%npp(proc+1) + ! + IF ( proc == 0 ) THEN + ! + displs(proc) = 0 + ! + ELSE + ! + displs(proc) = displs(proc-1) + sendcount(proc-1) + ! + ENDIF + ! + ENDDO + ! + CALL mp_barrier( dfftp%comm ) + ! + CALL MPI_SCATTERV( f_in, sendcount, displs, MPI_DOUBLE_PRECISION, & + f_out, sendcount(dfftp%mype), MPI_DOUBLE_PRECISION, & + dfftp%root, dfftp%comm, info ) + ! + CALL errore( 'scatter', 'info<>0', info ) + ! + IF ( sendcount(dfftp%mype) /= dffts%nnr ) f_out(sendcount(dfftp%mype)+1: dffts%nnr ) = 0.D0 + ! + CALL stop_clock( 'scatter' ) + ! + ! + RETURN + ! +END SUBROUTINE cscatter_smooth +! +!---------------------------------------------------------------------------- +SUBROUTINE cscatter_custom( f_in, f_out, dfftt ) + !---------------------------------------------------------------------------- + ! + ! ... scatters data on the custom AND complex fft grid + ! ... scatters data from the first processor of every pool + ! + ! ... COMPLEX*16 f_in = gathered variable (nr1sx*nr2sx*nr3sx) + ! ... COMPLEX*16 f_out = distributed variable ( dfftt%nnr) + ! + USE mp, ONLY : mp_barrier + USE kinds, ONLY : DP + USE parallel_include + ! + IMPLICIT NONE + ! + COMPLEX(DP) :: f_in(:), f_out(:) + TYPE ( fft_dlay_descriptor ), INTENT(IN) :: dfftt + ! + ! + INTEGER :: proc, info + INTEGER :: displs(0:dfftp%nproc-1), sendcount(0:dfftp%nproc-1) + ! + ! + CALL start_clock( 'scatter' ) + ! + DO proc = 0, ( dfftp%nproc - 1 ) + ! + sendcount(proc) = 2 * dfftt%nnp * dfftt%npp(proc+1) + ! + IF ( proc == 0 ) THEN + ! + displs(proc) = 0 + ! + ELSE + ! + displs(proc) = displs(proc-1) + sendcount(proc-1) + ! + ENDIF + ! + ENDDO + ! + CALL mp_barrier( dfftp%comm ) + ! + CALL MPI_SCATTERV( f_in, sendcount, displs, MPI_DOUBLE_PRECISION, & + f_out, sendcount(dfftp%mype), MPI_DOUBLE_PRECISION, & + dfftp%root, dfftp%comm, info ) + ! + CALL errore( 'scatter', 'info<>0', info ) + ! + IF ( sendcount(dfftp%mype) /= dfftt%nnr ) f_out(sendcount(dfftp%mype)+1: dfftt%nnr ) = 0.D0 + ! + CALL stop_clock( 'scatter' ) + ! + ! + RETURN + ! +END SUBROUTINE cscatter_custom +! +!---------------------------------------------------------------------------- +SUBROUTINE gather_smooth ( f_in, f_out ) + !---------------------------------------------------------------------------- + ! + ! ... gathers data on the smooth AND real fft grid + ! + ! ... gathers nproc distributed data on the first processor of every pool + ! + ! ... REAL*8 f_in = distributed variable ( dffts%nnr ) + ! ... REAL*8 f_out = gathered variable (nr1sx*nr2sx*nr3sx) + ! + USE mp, ONLY : mp_barrier + USE kinds, ONLY : DP + USE parallel_include + ! + IMPLICIT NONE + ! + REAL(DP) :: f_in(:), f_out(:) + ! + ! + INTEGER :: proc, info + INTEGER :: displs(0:dffts%nproc-1), recvcount(0:dffts%nproc-1) + ! + ! + CALL start_clock( 'gather' ) + ! + DO proc = 0, ( dffts%nproc - 1 ) + ! + recvcount(proc) = dffts%nnp * dffts%npp(proc+1) + ! + IF ( proc == 0 ) THEN + ! + displs(proc) = 0 + ! + ELSE + ! + displs(proc) = displs(proc-1) + recvcount(proc-1) + ! + ENDIF + ! + ENDDO + ! + CALL mp_barrier( dffts%comm ) + ! + CALL MPI_GATHERV( f_in, recvcount(dffts%mype), MPI_DOUBLE_PRECISION, f_out, & + recvcount, displs, MPI_DOUBLE_PRECISION, dffts%root, & + dffts%comm, info ) + ! + CALL errore( 'gather', 'info<>0', info ) + ! + CALL stop_clock( 'gather' ) + ! + ! + RETURN + ! +END SUBROUTINE gather_smooth +! +!---------------------------------------------------------------------------- +SUBROUTINE scatter_smooth( f_in, f_out ) + !---------------------------------------------------------------------------- + ! + ! ... scatters data on the smooth AND real fft grid + ! ... scatters data from the first processor of every pool + ! + ! ... REAL*8 f_in = gathered variable (nr1sx*nr2sx*nr3sx) + ! ... REAL*8 f_out = distributed variable ( dffts%nnr) + ! + USE mp, ONLY : mp_barrier + USE kinds, ONLY : DP + USE parallel_include + ! + IMPLICIT NONE + ! + REAL(DP) :: f_in(:), f_out(:) + ! + ! + INTEGER :: proc, info + INTEGER :: displs(0:dffts%nproc-1), sendcount(0:dffts%nproc-1) + ! + ! + CALL start_clock( 'scatter' ) + ! + DO proc = 0, ( dffts%nproc - 1 ) + ! + sendcount(proc) = dffts%nnp * dffts%npp(proc+1) + ! + IF ( proc == 0 ) THEN + ! + displs(proc) = 0 + ! + ELSE + ! + displs(proc) = displs(proc-1) + sendcount(proc-1) + ! + ENDIF + ! + ENDDO + ! + CALL mp_barrier( dffts%comm ) + ! + CALL MPI_SCATTERV( f_in, sendcount, displs, MPI_DOUBLE_PRECISION, & + f_out, sendcount(dffts%mype), MPI_DOUBLE_PRECISION, & + dffts%root, dffts%comm, info ) + ! + CALL errore( 'scatter', 'info<>0', info ) + ! + IF ( sendcount(dffts%mype) /= dffts%nnr ) f_out(sendcount(dffts%mype)+1: dffts%nnr ) = 0.D0 + ! + CALL stop_clock( 'scatter' ) + ! + ! + RETURN + ! +END SUBROUTINE scatter_smooth + + +! +SUBROUTINE tg_gather( dffts, v, tg_v ) + ! + USE parallel_include + ! + USE fft_types, ONLY : fft_dlay_descriptor + + ! T.G. + ! NOGRP: Number of processors per orbital task group + + IMPLICIT NONE + + TYPE(fft_dlay_descriptor), INTENT(in) :: dffts + + REAL(DP) :: v(:) + REAL(DP) :: tg_v(:) + + INTEGER :: nsiz, i, ierr, nsiz_tg + INTEGER :: recv_cnt( dffts%nogrp ), recv_displ( dffts%nogrp ) + + nsiz_tg = dffts%tg_nnr * dffts%nogrp + + IF( size( tg_v ) < nsiz_tg ) & + CALL errore( ' tg_gather ', ' tg_v too small ', ( nsiz_tg - size( tg_v ) ) ) + + nsiz = dffts%npp( dffts%mype+1 ) * dffts%nr1x * dffts%nr2x + + IF( size( v ) < nsiz ) & + CALL errore( ' tg_gather ', ' v too small ', ( nsiz - size( v ) ) ) + + ! + ! The potential in v is distributed accros all processors + ! We need to redistribute it so that it is completely contained in the + ! processors of an orbital TASK-GROUP + ! + recv_cnt(1) = dffts%npp( dffts%nolist(1) + 1 ) * dffts%nr1x * dffts%nr2x + recv_displ(1) = 0 + DO i = 2, dffts%nogrp + recv_cnt(i) = dffts%npp( dffts%nolist(i) + 1 ) * dffts%nr1x * dffts%nr2x + recv_displ(i) = recv_displ(i-1) + recv_cnt(i-1) + ENDDO + + ! clean only elements that will not be overwritten + ! + DO i = recv_displ(dffts%nogrp) + recv_cnt( dffts%nogrp ) + 1, size( tg_v ) + tg_v( i ) = 0.0d0 + ENDDO + + + CALL MPI_Allgatherv( v(1), nsiz, MPI_DOUBLE_PRECISION, & + tg_v(1), recv_cnt, recv_displ, MPI_DOUBLE_PRECISION, dffts%ogrp_comm, IERR) + + IF( ierr /= 0 ) & + CALL errore( ' tg_gather ', ' MPI_Allgatherv ', abs( ierr ) ) + + +END SUBROUTINE tg_gather + +!=----------------------------------------------------------------------=! + END MODULE fft_base +!=----------------------------------------------------------------------=! diff --git a/tests/apps/miniDFT/tests/src/fft_custom.f90 b/tests/apps/miniDFT/tests/src/fft_custom.f90 new file mode 100644 index 0000000000..cf89d57a0c --- /dev/null +++ b/tests/apps/miniDFT/tests/src/fft_custom.f90 @@ -0,0 +1,368 @@ +! +! Copyright (C) 2011 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +!-------------------------------------------------------------------- +! Module containing routines for fft with an custom energy cutoff +!-------------------------------------------------------------------- +! +MODULE fft_custom + + USE kinds, ONLY: DP + USE parallel_include + + USE fft_types, ONLY: fft_dlay_descriptor + + IMPLICIT NONE + + TYPE fft_cus + + ! ... data structure containing all information + ! ... about fft data distribution for a given + ! ... potential grid, and its wave functions sub-grid. + + TYPE ( fft_dlay_descriptor ) :: dfftt + ! descriptor for the custom grid + + REAL(kind=DP) :: ecutt + ! Custom cutoff (rydberg) + REAL(kind=DP) :: dual_t + ! Dual factor + REAL(kind=DP) :: gcutmt + INTEGER :: nr1t,nr2t,nr3t + INTEGER :: nrx1t,nrx2t,nrx3t + INTEGER :: nrxxt + INTEGER :: ngmt,ngmt_l,ngmt_g + INTEGER, DIMENSION(:), POINTER :: nlt,nltm + REAL(kind=DP), DIMENSION(:), POINTER :: ggt + REAL(kind=DP), DIMENSION(:,:),POINTER :: gt + INTEGER, DIMENSION(:), POINTER :: ig_l2gt + INTEGER :: gstart_t + INTEGER, DIMENSION(:), POINTER :: ig1t,ig2t,ig3t + INTEGER :: nlgt + INTEGER :: npwt,npwxt + LOGICAL :: initalized = .FALSE. + + END TYPE fft_cus + + +!-------------------------------------------------------------------- +CONTAINS +!=----------------------------------------------------------------------------=! + + SUBROUTINE gvec_init( fc, ngm_, comm ) + ! + ! Set local and global dimensions, allocate arrays + ! + USE mp, ONLY: mp_max, mp_sum + IMPLICIT NONE + INTEGER, INTENT(IN) :: ngm_ + INTEGER, INTENT(IN) :: comm ! communicator of the group on which g-vecs are distributed + TYPE(fft_cus), INTENT(INOUT) :: fc + ! + fc%ngmt = ngm_ + ! + ! calculate maximum over all processors + ! + fc%ngmt_l = ngm_ + CALL mp_max( fc%ngmt_l, comm ) + ! + ! calculate sum over all processors + ! + fc%ngmt_g = ngm_ + CALL mp_sum( fc%ngmt_g, comm ) + ! + ! allocate arrays - only those that are always kept until the end + ! + ALLOCATE( fc%ggt(fc%ngmt) ) + ALLOCATE( fc%gt (3, fc%ngmt) ) +! ALLOCATE( mill(3, fc%ngmt) ) + ALLOCATE( fc%nlt (fc%ngmt) ) + ALLOCATE( fc%nltm(fc%ngmt) ) + ALLOCATE( fc%ig_l2gt(fc%ngmt) ) +! ALLOCATE( igtongl(fc%ngmt) ) + ! + RETURN + ! + END SUBROUTINE gvec_init + + + + !-------------------------------------------------------------------- + ! + SUBROUTINE set_custom_grid(fc) + !----------------------------------------------------------------------- + ! This routine computes the dimensions of the minimum FFT grid + ! compatible with the input cut-off + ! + ! NB: The values of nr1, nr2, nr3 are computed only if they are not + ! given as input parameters. Input values are kept otherwise. + ! + USE cell_base, ONLY : at, tpiba2 + USE fft_scalar, ONLY : allowed + + IMPLICIT NONE + + TYPE(fft_cus) :: fc + + INTEGER, PARAMETER :: nmax = 5000 + ! an unreasonably big number for a FFT grid + ! + ! the values of nr1, nr2, nr3 are computed only if they are not given + ! as input parameters + ! + + fc%nr1t=0 + fc%nr2t=0 + fc%nr3t=0 + + IF (fc%nr1t == 0) THEN + ! + ! estimate nr1 and check if it is an allowed value for FFT + ! + fc%nr1t = INT(2 * SQRT(fc%gcutmt) * SQRT(at(1, 1)**2 + & + &at(2, 1)**2 + at(3, 1)**2) ) + 1 +10 CONTINUE + IF (fc%nr1t > nmax) & + CALL errore ('set_fft_dim', 'nr1 is unreasonably large', fc%nr1t) + IF (allowed (fc%nr1t) ) GOTO 15 + fc%nr1t = fc%nr1t + 1 + GOTO 10 + ELSE + IF (.NOT.allowed (fc%nr1t) ) CALL errore ('set_fft_dim', & + 'input nr1t value not allowed', 1) + ENDIF +15 CONTINUE + ! + IF (fc%nr2t == 0) THEN + ! + ! estimate nr1 and check if it is an allowed value for FFT + ! + fc%nr2t = INT(2 * SQRT(fc%gcutmt) * SQRT(at(1, 2)**2 + & + &at(2, 2)**2 + at(3, 2)**2) ) + 1 +20 CONTINUE + IF (fc%nr2t > nmax) & + CALL errore ('set_fft_dim', 'nr2t is unreasonably large', fc%nr2t) + IF (allowed (fc%nr2t) ) GOTO 25 + fc%nr2t = fc%nr2t + 1 + GOTO 20 + ELSE + IF (.NOT.allowed (fc%nr2t) ) CALL errore ('set_fft_dim', & + 'input nr2t value not allowed', 2) + ENDIF +25 CONTINUE + ! + IF (fc%nr3t == 0) THEN + ! + ! estimate nr3 and check if it is an allowed value for FFT + ! + fc%nr3t = INT(2 * SQRT(fc%gcutmt) * SQRT(at(1, 3) **2 + & + &at(2, 3)**2 + at(3, 3) **2) ) + 1 +30 CONTINUE + IF (fc%nr3t > nmax) & + CALL errore ('set_fft_dim', 'nr3 is unreasonably large', fc%nr3t) + IF (allowed (fc%nr3t) ) GOTO 35 + fc%nr3t = fc%nr3t + 1 + GOTO 30 + ELSE + IF (.NOT.allowed (fc%nr3t) ) CALL errore ('set_fft_dim', & + 'input nr3t value not allowed', 3) + ENDIF +35 CONTINUE + ! + ! here we compute nr3s if it is not in input + ! + RETURN + END SUBROUTINE set_custom_grid + + SUBROUTINE ggent(fc) + USE kinds, ONLY : DP + USE cell_base, ONLY : at, bg, tpiba2 + USE constants, ONLY : eps8 + + IMPLICIT NONE + + TYPE(fft_cus) :: fc + + ! + REAL(DP) :: t (3), tt, swap + ! + INTEGER :: ngmx, n1, n2, n3, n1s, n2s, n3s + ! + REAL(DP), ALLOCATABLE :: g2sort_g(:) + ! array containing all g vectors, on all processors: replicated data + INTEGER, ALLOCATABLE :: mill_g(:,:), mill_unsorted(:,:) + ! array containing all g vectors generators, on all processors: + ! replicated data + INTEGER, ALLOCATABLE :: igsrt(:) + ! + + INTEGER :: m1, m2, mc + ! + INTEGER :: i, j, k, ipol, ng, igl, iswap, indsw, ni, nj, nk + + +! ALLOCATE( fc%gt(3,fc%ngmt), fc%ggt(fc%ngmt) ) +! ALLOCATE( fc%ig_l2gt( fc%ngmt_l ) ) + ALLOCATE( mill_g( 3, fc%ngmt_g ), mill_unsorted( 3, fc%ngmt_g ) ) + ALLOCATE( igsrt( fc%ngmt_g ) ) + ALLOCATE( g2sort_g( fc%ngmt_g ) ) + ALLOCATE( fc%ig1t(fc%ngmt), fc%ig2t(fc%ngmt), fc%ig3t(fc%ngmt) ) + + g2sort_g(:) = 1.0d20 + ! + ! save present value of ngm in ngmx variable + ! + ngmx = fc%ngmt + ! + fc%ngmt = 0 + ! + ! max miller indices (same convention as in module stick_set) + ! + ni = (fc%dfftt%nr1-1)/2 + nj = (fc%dfftt%nr2-1)/2 + nk = (fc%dfftt%nr3-1)/2 + ! + iloop: DO i = -ni, ni + ! + ! gamma-only: exclude space with x < 0 + ! + jloop: DO j = -nj, nj + ! + ! gamma-only: exclude plane with x = 0, y < 0 + ! + kloop: DO k = -nk, nk + ! + ! gamma-only: exclude line with x = 0, y = 0, z < 0 + ! + t(:) = i * bg (:,1) + j * bg (:,2) + k * bg (:,3) + tt = SUM(t(:)**2) + IF (tt <= fc%gcutmt) THEN + fc%ngmt = fc%ngmt + 1 + IF (fc%ngmt > fc%ngmt_g) CALL errore ('ggent', 'too ma& + &ny g-vectors', fc%ngmt) + mill_unsorted( :, fc%ngmt ) = (/ i,j,k /) + IF ( tt > eps8 ) THEN + g2sort_g(fc%ngmt) = tt + ELSE + g2sort_g(fc%ngmt) = 0.d0 + ENDIF + ENDIF + ENDDO kloop + ENDDO jloop + ENDDO iloop + + IF (fc%ngmt /= fc%ngmt_g ) & + CALL errore ('ggen', 'g-vectors missing !', ABS(fc%ngmt - fc%ngmt_g)) + + igsrt(1) = 0 + CALL hpsort_eps( fc%ngmt_g, g2sort_g, igsrt, eps8 ) + mill_g(1,:) = mill_unsorted(1,igsrt(:)) + mill_g(2,:) = mill_unsorted(2,igsrt(:)) + mill_g(3,:) = mill_unsorted(3,igsrt(:)) + DEALLOCATE( g2sort_g, igsrt, mill_unsorted ) + fc%ngmt = 0 + + ngloop: DO ng = 1, fc%ngmt_g + + i = mill_g(1, ng) + j = mill_g(2, ng) + k = mill_g(3, ng) + + m1 = MOD (i, fc%dfftt%nr1) + 1 + IF (m1 < 1) m1 = m1 + fc%dfftt%nr1 + m2 = MOD (j, fc%dfftt%nr2) + 1 + IF (m2 < 1) m2 = m2 + fc%dfftt%nr2 + mc = m1 + (m2 - 1) * fc%dfftt%nr1x + IF ( fc%dfftt%isind ( mc ) == 0) CYCLE ngloop + + fc%ngmt = fc%ngmt + 1 + + ! Here map local and global g index !!! + ! N.B. the global G vectors arrangement depends on the number of processors + ! + fc%ig_l2gt( fc%ngmt ) = ng + + fc%gt (1:3, fc%ngmt) = i * bg (:, 1) + j * bg (:, 2) + k * bg (:, 3) + fc%ggt (fc%ngmt) = SUM(fc%gt (1:3, fc%ngmt)**2) + + IF (fc%ngmt > ngmx) CALL errore ('ggen', 'too many g-vectors', fc%ngmt) + ENDDO ngloop + + IF (fc%ngmt /= ngmx) & + CALL errore ('ggent', 'g-vectors missing !', ABS(fc%ngmt - ngmx)) + ! + ! determine first nonzero g vector + ! + IF (fc%ggt(1).LE.eps8) THEN + fc%gstart_t=2 + ELSE + fc%gstart_t=1 + ENDIF + ! + ! Now set nl and nls with the correct fft correspondence + ! + DO ng = 1, fc%ngmt + n1 = NINT (SUM(fc%gt (:, ng) * at (:, 1))) + 1 + fc%ig1t (ng) = n1 - 1 + IF (n1<1) n1 = n1 + fc%dfftt%nr1 + + + n2 = NINT (SUM(fc%gt (:, ng) * at (:, 2))) + 1 + fc%ig2t (ng) = n2 - 1 + IF (n2<1) n2 = n2 + fc%dfftt%nr2 + + + n3 = NINT (SUM(fc%gt (:, ng) * at (:, 3))) + 1 + fc%ig3t (ng) = n3 - 1 + IF (n3<1) n3 = n3 + fc%dfftt%nr3 + + + IF (n1>fc%dfftt%nr1 .OR. n2>fc%dfftt%nr2 .OR. n3>fc%dfftt%nr3) & + CALL errore('ggent','Mesh too small?',ng) + + fc%nlt (ng) = n3 + ( fc%dfftt%isind (n1 + (n2 - 1) * fc%dfftt%nr1x)& + & - 1) * fc%dfftt%nr3x + ENDDO + ! + DEALLOCATE( mill_g ) + ! + ! calculate number of G shells: ngl + + + + !set npwt,npwxt + !This should eventually be calcualted somewhere else with + !n_plane_waves() but it is good enough for gamma_only + +! IF( ALLOCATED( ngmpe ) ) DEALLOCATE( ngmpe ) + + RETURN + + END SUBROUTINE ggent + !----------------------------------------------------------------------- + + SUBROUTINE deallocate_fft_custom(fc) + !this subroutine deallocates all the fft custom stuff + USE fft_types, ONLY : fft_dlay_deallocate + + IMPLICIT NONE + + TYPE(fft_cus) :: fc + + IF(.NOT. fc%initalized) RETURN + + DEALLOCATE(fc%nlt,fc%nltm) + CALL fft_dlay_deallocate(fc%dfftt) + DEALLOCATE(fc%ig_l2gt,fc%ggt,fc%gt) + DEALLOCATE(fc%ig1t,fc%ig2t,fc%ig3t) + fc%initalized=.FALSE. + + RETURN + + END SUBROUTINE deallocate_fft_custom + +END MODULE fft_custom diff --git a/tests/apps/miniDFT/tests/src/fft_defs.h b/tests/apps/miniDFT/tests/src/fft_defs.h new file mode 100644 index 0000000000..b3c479d8b5 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/fft_defs.h @@ -0,0 +1,2 @@ + +#define C_POINTER integer*8 diff --git a/tests/apps/miniDFT/tests/src/fft_interfaces.f90 b/tests/apps/miniDFT/tests/src/fft_interfaces.f90 new file mode 100644 index 0000000000..a7ba95d4e2 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/fft_interfaces.f90 @@ -0,0 +1,264 @@ +! +! Copyright (C) 2010 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! Extracted from "cp_interfaces", written by Carlo Cavazzoni + +!=----------------------------------------------------------------------------=! + MODULE fft_interfaces +!=----------------------------------------------------------------------------=! + + IMPLICIT NONE + PRIVATE + + PUBLIC :: fwfft, invfft + + INTERFACE invfft + SUBROUTINE invfft_x( grid_type, f, dfft, ia ) + USE fft_types, only: fft_dlay_descriptor + USE kinds, ONLY: DP + IMPLICIT NONE + INTEGER, OPTIONAL, INTENT(IN) :: ia + CHARACTER(LEN=*), INTENT(IN) :: grid_type + TYPE(fft_dlay_descriptor), INTENT(IN) :: dfft + COMPLEX(DP) :: f(:) + END SUBROUTINE + END INTERFACE + + INTERFACE fwfft + SUBROUTINE fwfft_x( grid_type, f, dfft ) + USE fft_types, only: fft_dlay_descriptor + USE kinds, ONLY: DP + IMPLICIT NONE + CHARACTER(LEN=*), INTENT(IN) :: grid_type + TYPE(fft_dlay_descriptor), INTENT(IN) :: dfft + COMPLEX(DP) :: f(:) + END SUBROUTINE + END INTERFACE + +!=----------------------------------------------------------------------------=! + END MODULE +!=----------------------------------------------------------------------------=! +! +! +! Copyright (C) 2002-2010 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! ---------------------------------------------- +! These subroutines written by Carlo Cavazzoni +! Last modified August 2010 by Paolo Giannozzi +! ---------------------------------------------- + +!----------------------------------------------------------------------- + subroutine invfft_x( grid_type, f, dfft, ia ) +!----------------------------------------------------------------------- +! grid_type = 'Dense' +! inverse fourier transform of potentials and charge density +! on the dense grid . On output, f is overwritten +! grid_type = 'Smooth' +! inverse fourier transform of potentials and charge density +! on the smooth grid . On output, f is overwritten +! grid_type = 'Wave' +! inverse fourier transform of wave functions +! on the smooth grid . On output, f is overwritten +! grid_type = 'Box' +! not-so-parallel 3d fft for box grid, implemented only for sign=1 +! G-space to R-space, output = \sum_G f(G)exp(+iG*R) +! The array f (overwritten on output) is NOT distributed: +! a copy is present on each processor. +! The fft along z is done on the entire grid. +! The fft along xy is done only on planes that have components on the +! dense grid for each processor. Note that the final array will no +! longer be the same on all processors. +! grid_type = 'Custom' +! inverse fourier transform of potentials and charge density +! on a custom defined grid specified by dfft. On output, f +! is overwritten +! grid_type = 'CustomWave' +! inverse fourier transform of wave functions +! on a custom defined grid specified by dfft. On output, f +! is overwritten +! +! + USE kinds, ONLY: DP + use fft_base, only: dfftp, dffts, dfftb + use fft_scalar, only: cft_b + use fft_parallel, only: tg_cft3s + USE fft_types, only: fft_dlay_descriptor + + IMPLICIT none + + TYPE(fft_dlay_descriptor), INTENT(IN) :: dfft + INTEGER, OPTIONAL, INTENT(IN) :: ia + CHARACTER(LEN=*), INTENT(IN) :: grid_type + COMPLEX(DP) :: f(:) + ! + INTEGER :: imin3, imax3, np3 + + IF( grid_type == 'Dense' ) THEN + IF( dfft%nr1 /= dfftp%nr1 .OR. dfft%nr2 /= dfftp%nr2 .OR. & + dfft%nr3 /= dfftp%nr3 .OR. dfft%nr1x /= dfftp%nr1x .OR. & + dfft%nr2x /= dfftp%nr2x .OR. dfft%nr3x /= dfftp%nr3x ) & + CALL errore( ' invfft ', ' inconsistent descriptor for Dense fft ', 1 ) + call start_clock( 'fft' ) + ELSE IF( grid_type == 'Smooth' ) THEN + IF( dfft%nr1 /= dffts%nr1 .OR. dfft%nr2 /= dffts%nr2 .OR. & + dfft%nr3 /= dffts%nr3 .OR. dfft%nr1x /= dffts%nr1x .OR. & + dfft%nr2x /= dffts%nr2x .OR. dfft%nr3x /= dffts%nr3x ) & + CALL errore( ' invfft ', ' inconsistent descriptor for Smooth fft ', 1) + call start_clock( 'ffts' ) + ELSE IF( grid_type == 'Wave' ) THEN + IF( dfft%nr1 /= dffts%nr1 .OR. dfft%nr2 /= dffts%nr2 .OR. & + dfft%nr3 /= dffts%nr3 .OR. dfft%nr1x /= dffts%nr1x .OR. & + dfft%nr2x /= dffts%nr2x .OR. dfft%nr3x /= dffts%nr3x ) & + CALL errore( ' invfft ', ' inconsistent descriptor for Wave fft ' , 1 ) + call start_clock('fftw') + ELSE IF( grid_type == 'Box' ) THEN + IF( dfft%nr1 /= dfftb%nr1 .OR. dfft%nr2 /= dfftb%nr2 .OR. & + dfft%nr3 /= dfftb%nr3 .OR. dfft%nr1x /= dfftb%nr1x .OR. & + dfft%nr2x /= dfftb%nr2x .OR. dfft%nr3x /= dfftb%nr3x ) & + CALL errore( ' invfft ', ' inconsistent descriptor for Box fft ', 1 ) +!$omp master + ! + ! clocks called inside a parallel region do not work properly! + ! in the future we probably need a thread safe version of the clock + ! + call start_clock( 'fftb' ) +!$omp end master + ELSE IF( grid_type == 'Custom' ) THEN + call start_clock('fftc') + ELSE IF( grid_type == 'CustomWave' ) THEN + call start_clock('fftcw') + ELSE + call errore( ' invfft ', ' unknown grid: '//grid_type , 1 ) + END IF + + + IF( grid_type == 'Dense' ) THEN + call tg_cft3s( f, dfftp, 1 ) + ELSE IF( grid_type == 'Smooth' ) THEN + call tg_cft3s( f, dffts, 1 ) + ELSE IF( grid_type == 'Wave' ) THEN + call tg_cft3s( f, dffts, 2, dffts%have_task_groups ) + ELSE IF( grid_type == 'Custom' ) THEN + CALL tg_cft3s( f, dfft, 1 ) + ELSE IF( grid_type == 'CustomWave' ) THEN + CALL tg_cft3s( f, dfft, 2, dfft%have_task_groups ) + ELSE IF( grid_type == 'Box' .AND. dfftb%np3( ia ) > 0 ) THEN + call cft_b( f, dfftb%nr1, dfftb%nr2, dfftb%nr3, & + dfftb%nr1x, dfftb%nr2x, dfftb%nr3x, & + dfftb%imin3( ia ), dfftb%imax3( ia ), 1 ) + END IF + + + IF( grid_type == 'Dense' ) THEN + call stop_clock( 'fft' ) + ELSE IF( grid_type == 'Smooth' ) THEN + call stop_clock( 'ffts' ) + ELSE IF( grid_type == 'Wave' ) THEN + call stop_clock('fftw') + ELSE IF( grid_type == 'Box' ) THEN +!$omp master + call stop_clock( 'fftb' ) +!$omp end master + ELSE IF( grid_type == 'Custom' ) THEN + call stop_clock('fftc') + ELSE IF( grid_type == 'CustomWave' ) THEN + call stop_clock('fftcw') + END IF +! + return + end subroutine invfft_x + +!----------------------------------------------------------------------- + subroutine fwfft_x( grid_type, f, dfft ) +!----------------------------------------------------------------------- +! grid_type = 'Dense' +! forward fourier transform of potentials and charge density +! on the dense grid . On output, f is overwritten +! grid_type = 'Smooth' +! forward fourier transform of potentials and charge density +! on the smooth grid . On output, f is overwritten +! grid_type = 'Wave' +! forward fourier transform of wave functions +! on the smooth grid . On output, f is overwritten +! grid_type = 'Custom' +! forward fourier transform of potentials and charge density +! on a custom defined grid specified by dfft. On output, f +! is overwritten +! grid_type = 'CustomWave' +! forward fourier transform of wave functions +! on a custom defined grid specified by dfft. On output, f +! is overwritten +! + USE kinds, ONLY: DP + use fft_base, only: dfftp, dffts + use fft_parallel, only: tg_cft3s + USE fft_types, only: fft_dlay_descriptor + + implicit none + + TYPE(fft_dlay_descriptor), INTENT(IN) :: dfft + CHARACTER(LEN=*), INTENT(IN) :: grid_type + COMPLEX(DP) :: f(:) + + IF( grid_type == 'Dense' ) THEN + IF( dfft%nr1 /= dfftp%nr1 .OR. dfft%nr2 /= dfftp%nr2 .OR. & + dfft%nr3 /= dfftp%nr3 .OR. dfft%nr1x /= dfftp%nr1x .OR. & + dfft%nr2x /= dfftp%nr2x .OR. dfft%nr3x /= dfftp%nr3x ) & + CALL errore( ' fwfft ', ' inconsistent descriptor for Dense fft ', 1 ) + call start_clock( 'fft' ) + ELSE IF( grid_type == 'Smooth' ) THEN + IF( dfft%nr1 /= dffts%nr1 .OR. dfft%nr2 /= dffts%nr2 .OR. & + dfft%nr3 /= dffts%nr3 .OR. dfft%nr1x /= dffts%nr1x .OR. & + dfft%nr2x /= dffts%nr2x .OR. dfft%nr3x /= dffts%nr3x ) & + CALL errore( ' fwfft ', ' inconsistent descriptor for Smooth fft ', 1 ) + call start_clock( 'ffts' ) + ELSE IF( grid_type == 'Wave' ) THEN + IF( dfft%nr1 /= dffts%nr1 .OR. dfft%nr2 /= dffts%nr2 .OR. & + dfft%nr3 /= dffts%nr3 .OR. dfft%nr1x /= dffts%nr1x .OR. & + dfft%nr2x /= dffts%nr2x .OR. dfft%nr3x /= dffts%nr3x ) & + CALL errore( ' fwfft ', ' inconsistent descriptor for Wave fft ', 1 ) + call start_clock( 'fftw' ) + ELSE IF( grid_type == 'Custom' ) THEN + call start_clock('fftc') + ELSE IF( grid_type == 'CustomWave' ) THEN + call start_clock('fftcw') + ELSE + call errore( ' fwfft ', ' unknown grid: '//grid_type , 1 ) + END IF + + + IF( grid_type == 'Dense' ) THEN + call tg_cft3s(f,dfftp,-1) + ELSE IF( grid_type == 'Smooth' ) THEN + call tg_cft3s(f,dffts,-1) + ELSE IF( grid_type == 'Wave' ) THEN + call tg_cft3s(f,dffts,-2, dffts%have_task_groups ) + ELSE IF( grid_type == 'Custom' ) THEN + CALL tg_cft3s( f, dfft, -1 ) + ELSE IF( grid_type == 'CustomWave' ) THEN + CALL tg_cft3s( f, dfft, -2, dfft%have_task_groups ) + END IF + + + IF( grid_type == 'Dense' ) THEN + call stop_clock( 'fft' ) + ELSE IF( grid_type == 'Smooth' ) THEN + call stop_clock( 'ffts' ) + ELSE IF( grid_type == 'Wave' ) THEN + call stop_clock( 'fftw' ) + ELSE IF( grid_type == 'Custom' ) THEN + call stop_clock('fftc') + ELSE IF( grid_type == 'CustomWave' ) THEN + call stop_clock('fftcw') + END IF + + return + end subroutine fwfft_x diff --git a/tests/apps/miniDFT/tests/src/fft_parallel.f90 b/tests/apps/miniDFT/tests/src/fft_parallel.f90 new file mode 100644 index 0000000000..b177dcc765 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/fft_parallel.f90 @@ -0,0 +1,328 @@ +! +! Copyright (C) 2001-2009 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +!=---------------------------------------------------------------------==! +! +! +! Parallel 3D FFT high level Driver +! ( Charge density and Wave Functions ) +! +! Written and maintained by Carlo Cavazzoni +! Last update Apr. 2009 +! +!=---------------------------------------------------------------------==! +! +MODULE fft_parallel +! + IMPLICIT NONE + SAVE +! +CONTAINS +! +! General purpose driver, including Task groups parallelization +! +!---------------------------------------------------------------------------- +SUBROUTINE tg_cft3s( f, dfft, isgn, use_task_groups ) + !---------------------------------------------------------------------------- + ! + ! ... isgn = +-1 : parallel 3d fft for rho and for the potential + ! NOT IMPLEMENTED WITH TASK GROUPS + ! ... isgn = +-2 : parallel 3d fft for wavefunctions + ! + ! ... isgn = + : G-space to R-space, output = \sum_G f(G)exp(+iG*R) + ! ... fft along z using pencils (cft_1z) + ! ... transpose across nodes (fft_scatter) + ! ... and reorder + ! ... fft along y (using planes) and x (cft_2xy) + ! ... isgn = - : R-space to G-space, output = \int_R f(R)exp(-iG*R)/Omega + ! ... fft along x and y(using planes) (cft_2xy) + ! ... transpose across nodes (fft_scatter) + ! ... and reorder + ! ... fft along z using pencils (cft_1z) + ! + ! ... The array "planes" signals whether a fft is needed along y : + ! ... planes(i)=0 : column f(i,*,*) empty , don't do fft along y + ! ... planes(i)=1 : column f(i,*,*) filled, fft along y needed + ! ... "empty" = no active components are present in f(i,*,*) + ! ... after (isgn>0) or before (isgn<0) the fft on z direction + ! + ! ... Note that if isgn=+/-1 (fft on rho and pot.) all fft's are needed + ! ... and all planes(i) are set to 1 + ! + ! This driver is based on code written by Stefano de Gironcoli for PWSCF. + ! Task Group added by Costas Bekas, Oct. 2005, adapted from the CPMD code + ! (Alessandro Curioni) and revised by Carlo Cavazzoni 2007. + ! + USE fft_scalar, ONLY : cft_1z, cft_2xy + USE fft_base, ONLY : fft_scatter + USE kinds, ONLY : DP + USE fft_types, ONLY : fft_dlay_descriptor + USE parallel_include + + ! + IMPLICIT NONE + ! + COMPLEX(DP), INTENT(inout) :: f( : ) ! array containing data to be transformed + TYPE (fft_dlay_descriptor), INTENT(in) :: dfft + ! descriptor of fft data layout + INTEGER, INTENT(in) :: isgn ! fft direction + LOGICAL, OPTIONAL, INTENT(in) :: use_task_groups + ! specify if you want to use task groups parallelization + ! + INTEGER :: me_p + INTEGER :: n1, n2, n3, nx1, nx2, nx3 + COMPLEX(DP), ALLOCATABLE :: yf(:), aux (:) + INTEGER :: planes( dfft%nr1x ) + LOGICAL :: use_tg + ! + ! + IF( present( use_task_groups ) ) THEN + use_tg = use_task_groups + ELSE + use_tg = .false. + ENDIF + ! + IF( use_tg .and. .not. dfft%have_task_groups ) & + CALL errore( ' tg_cft3s ', ' call requiring task groups for a descriptor without task groups ', 1 ) + ! + n1 = dfft%nr1 + n2 = dfft%nr2 + n3 = dfft%nr3 + nx1 = dfft%nr1x + nx2 = dfft%nr2x + nx3 = dfft%nr3x + ! + IF( use_tg ) THEN + ALLOCATE( aux( dfft%nogrp * dfft%tg_nnr ) ) + ALLOCATE( YF ( dfft%nogrp * dfft%tg_nnr ) ) + ELSE + ALLOCATE( aux( dfft%tg_nnr ) ) + ENDIF + ! + me_p = dfft%mype + 1 + ! + IF ( isgn > 0 ) THEN + ! + IF ( isgn /= 2 ) THEN + ! + IF( use_tg ) & + CALL errore( ' tg_cfft ', ' task groups on large mesh not implemented ', 1 ) + ! + CALL cft_1z( f, dfft%nsp( me_p ), n3, nx3, isgn, aux ) + ! + planes = dfft%iplp + ! + ELSE + ! + CALL pack_group_sticks() + ! + IF( use_tg ) THEN + CALL cft_1z( yf, dfft%tg_nsw( me_p ), n3, nx3, isgn, aux ) + ELSE + CALL cft_1z( f, dfft%nsw( me_p ), n3, nx3, isgn, aux ) + ENDIF + ! + planes = dfft%iplw + ! + ENDIF + ! + CALL fw_scatter( isgn ) ! forwart scatter from stick to planes + ! + IF( use_tg ) THEN + CALL cft_2xy( f, dfft%tg_npp( me_p ), n1, n2, nx1, nx2, isgn, planes ) + ELSE + CALL cft_2xy( f, dfft%npp( me_p ), n1, n2, nx1, nx2, isgn, planes ) + ENDIF + ! + ELSE + ! + IF ( isgn /= -2 ) THEN + ! + IF( use_tg ) & + CALL errore( ' tg_cfft ', ' task groups on large mesh not implemented ', 1 ) + ! + planes = dfft%iplp + ! + ELSE + ! + planes = dfft%iplw + ! + ENDIF + + IF( use_tg ) THEN + CALL cft_2xy( f, dfft%tg_npp( me_p ), n1, n2, nx1, nx2, isgn, planes ) + ELSE + CALL cft_2xy( f, dfft%npp( me_p ), n1, n2, nx1, nx2, isgn, planes) + ENDIF + ! + CALL bw_scatter( isgn ) + ! + IF ( isgn /= -2 ) THEN + ! + CALL cft_1z( aux, dfft%nsp( me_p ), n3, nx3, isgn, f ) + ! + ELSE + ! + IF( use_tg ) THEN + CALL cft_1z( aux, dfft%tg_nsw( me_p ), n3, nx3, isgn, yf ) + ELSE + CALL cft_1z( aux, dfft%nsw( me_p ), n3, nx3, isgn, f ) + ENDIF + ! + CALL unpack_group_sticks() + ! + ENDIF + ! + ENDIF + ! + DEALLOCATE( aux ) + ! + IF( use_tg ) THEN + DEALLOCATE( yf ) + ENDIF + ! + RETURN + ! +CONTAINS + ! + + SUBROUTINE pack_group_sticks() + + INTEGER :: ierr + ! + IF( .not. use_tg ) RETURN + ! + IF( dfft%tg_rdsp(dfft%nogrp) + dfft%tg_rcv(dfft%nogrp) > size( yf ) ) THEN + CALL errore( ' tg_cfft ', ' inconsistent size ', 1 ) + ENDIF + IF( dfft%tg_psdsp(dfft%nogrp) + dfft%tg_snd(dfft%nogrp) > size( f ) ) THEN + CALL errore( ' tg_cfft ', ' inconsistent size ', 2 ) + ENDIF + + CALL start_clock( 'ALLTOALL' ) + ! + ! Collect all the sticks of the different states, + ! in "yf" processors will have all the sticks of the OGRP + + + CALL MPI_ALLTOALLV( f(1), dfft%tg_snd, dfft%tg_psdsp, MPI_DOUBLE_COMPLEX, yf(1), dfft%tg_rcv, & + & dfft%tg_rdsp, MPI_DOUBLE_COMPLEX, dfft%ogrp_comm, IERR) + IF( ierr /= 0 ) THEN + CALL errore( ' tg_cfft ', ' alltoall error 1 ', abs(ierr) ) + ENDIF + + + CALL stop_clock( 'ALLTOALL' ) + ! + !YF Contains all ( ~ NOGRP*dfft%nsw(me) ) Z-sticks + ! + RETURN + END SUBROUTINE pack_group_sticks + + ! + + SUBROUTINE unpack_group_sticks() + ! + ! Bring pencils back to their original distribution + ! + INTEGER :: ierr + ! + IF( .not. use_tg ) RETURN + ! + IF( dfft%tg_usdsp(dfft%nogrp) + dfft%tg_snd(dfft%nogrp) > size( f ) ) THEN + CALL errore( ' tg_cfft ', ' inconsistent size ', 3 ) + ENDIF + IF( dfft%tg_rdsp(dfft%nogrp) + dfft%tg_rcv(dfft%nogrp) > size( yf ) ) THEN + CALL errore( ' tg_cfft ', ' inconsistent size ', 4 ) + ENDIF + + CALL start_clock( 'ALLTOALL' ) + + CALL MPI_Alltoallv( yf(1), & + dfft%tg_rcv, dfft%tg_rdsp, MPI_DOUBLE_COMPLEX, f(1), & + dfft%tg_snd, dfft%tg_usdsp, MPI_DOUBLE_COMPLEX, dfft%ogrp_comm, IERR) + IF( ierr /= 0 ) THEN + CALL errore( ' tg_cfft ', ' alltoall error 2 ', abs(ierr) ) + ENDIF + + CALL stop_clock( 'ALLTOALL' ) + + RETURN + END SUBROUTINE unpack_group_sticks + + ! + + SUBROUTINE fw_scatter( iopt ) + + !Transpose data for the 2-D FFT on the x-y plane + ! + !NOGRP*dfft%nnr: The length of aux and f + !nr3x: The length of each Z-stick + !aux: input - output + !f: working space + !isgn: type of scatter + !dfft%nsw(me) holds the number of Z-sticks proc. me has. + !dfft%npp: number of planes per processor + ! + ! + USE fft_base, ONLY: fft_scatter + ! + INTEGER, INTENT(in) :: iopt + ! + IF( iopt == 2 ) THEN + ! + IF( use_tg ) THEN + ! + CALL fft_scatter( dfft, aux, nx3, dfft%nogrp*dfft%tg_nnr, f, dfft%tg_nsw, dfft%tg_npp, iopt, use_tg ) + ! + ELSE + ! + CALL fft_scatter( dfft, aux, nx3, dfft%nnr, f, dfft%nsw, dfft%npp, iopt ) + ! + ENDIF + ! + ELSEIF( iopt == 1 ) THEN + ! + CALL fft_scatter( dfft, aux, nx3, dfft%nnr, f, dfft%nsp, dfft%npp, iopt ) + ! + ENDIF + ! + RETURN + END SUBROUTINE fw_scatter + + ! + + SUBROUTINE bw_scatter( iopt ) + ! + USE fft_base, ONLY: fft_scatter + ! + INTEGER, INTENT(in) :: iopt + ! + IF( iopt == -2 ) THEN + ! + IF( use_tg ) THEN + ! + CALL fft_scatter( dfft, aux, nx3, dfft%nogrp*dfft%tg_nnr, f, dfft%tg_nsw, dfft%tg_npp, iopt, use_tg ) + ! + ELSE + ! + CALL fft_scatter( dfft, aux, nx3, dfft%nnr, f, dfft%nsw, dfft%npp, iopt ) + ! + ENDIF + ! + ELSEIF( iopt == -1 ) THEN + ! + CALL fft_scatter( dfft, aux, nx3, dfft%nnr, f, dfft%nsp, dfft%npp, iopt ) + ! + ENDIF + ! + RETURN + END SUBROUTINE bw_scatter + ! +END SUBROUTINE tg_cft3s +! +END MODULE fft_parallel diff --git a/tests/apps/miniDFT/tests/src/fft_scalar.f90 b/tests/apps/miniDFT/tests/src/fft_scalar.f90 new file mode 100644 index 0000000000..d94594957f --- /dev/null +++ b/tests/apps/miniDFT/tests/src/fft_scalar.f90 @@ -0,0 +1,619 @@ +! +! Copyright (C) 2001-2012 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +!--------------------------------------------------------------------------! +! FFT scalar drivers Module - contains machine-dependent routines for: ! +! FFTW, FFTW3, ESSL, LINUX_ESSL, SCSL, SUNPERF, NEC ASL libraries ! +! (both 3d for serial execution and 1d+2d FFTs for parallel execution, ! +! excepted NEC ASL, 3d only, no parallel execution) ! +! Written by Carlo Cavazzoni, modified by P. Giannozzi, contributions ! +! by Martin Hilgemans, Guido Roma, Pascal Thibaudeau, Stephane Lefranc, ! +! Nicolas Lacorne, Filippo Spiga - Last update Aug 2012 ! +!--------------------------------------------------------------------------! + +#include "fft_defs.h" +!=----------------------------------------------------------------------=! + MODULE fft_scalar +!=----------------------------------------------------------------------=! + USE kinds + + IMPLICIT NONE + SAVE + + PRIVATE + PUBLIC :: cft_1z, cft_2xy + PUBLIC :: good_fft_dimension, allowed, good_fft_order + PUBLIC :: cft_b + +! ... Local Parameter + + ! ndims Number of different FFT tables that the module + ! could keep into memory without reinitialization + ! nfftx Max allowed fft dimension + + INTEGER, PARAMETER :: ndims = 3, nfftx = 2049 + + ! Workspace that is statically allocated is defined here + ! in order to avoid multiple copies of the same workspace + ! lwork: Dimension of the work space array (if any) + + + ! Only FFTW_ESTIMATE is actually used + +#define FFTW_MEASURE 0 +#define FFTW_ESTIMATE 64 + + + +!=----------------------------------------------------------------------=! + CONTAINS +!=----------------------------------------------------------------------=! + +! +!=----------------------------------------------------------------------=! +! +! +! +! FFT along "z" +! +! +! +!=----------------------------------------------------------------------=! +! + + SUBROUTINE cft_1z(c, nsl, nz, ldz, isign, cout) + +! driver routine for nsl 1d complex fft's of length nz +! ldz >= nz is the distance between sequences to be transformed +! (ldz>nz is used on some architectures to reduce memory conflicts) +! input : c(ldz*nsl) (complex) +! output : cout(ldz*nsl) (complex - NOTA BENE: transform is not in-place!) +! isign > 0 : forward (f(G)=>f(R)), isign <0 backward (f(R) => f(G)) +! Up to "ndims" initializations (for different combinations of input +! parameters nz, nsl, ldz) are stored and re-used if available + + INTEGER, INTENT(IN) :: isign + INTEGER, INTENT(IN) :: nsl, nz, ldz + + COMPLEX (DP) :: c(:), cout(:) + + REAL (DP) :: tscale + INTEGER :: i, err, idir, ip + INTEGER, SAVE :: zdims( 3, ndims ) = -1 + INTEGER, SAVE :: icurrent = 1 + LOGICAL :: done + +#if defined __HPM + INTEGER :: OMP_GET_THREAD_NUM +#endif + INTEGER :: tid + + ! ... Machine-Dependent parameters, work arrays and tables of factors + + ! ltabl Dimension of the tables of factors calculated at the + ! initialization stage + +#if defined __OPENMP + INTEGER :: offset, ldz_t + INTEGER :: omp_get_max_threads + EXTERNAL :: omp_get_max_threads +#endif + + + + ! Pointers to the "C" structures containing FFT factors ( PLAN ) + ! C_POINTER is defined in include/fft_defs.h + ! for 32bit executables, C_POINTER is integer(4) + ! for 64bit executables, C_POINTER is integer(8) + + C_POINTER, SAVE :: fw_planz( ndims ) = 0 + C_POINTER, SAVE :: bw_planz( ndims ) = 0 + + + IF( nsl < 0 ) THEN + CALL errore(" fft_scalar: cft_1z ", " nsl out of range ", nsl) + END IF + + ! + ! Here initialize table only if necessary + ! + + DO ip = 1, ndims + + ! first check if there is already a table initialized + ! for this combination of parameters + + done = ( nz == zdims(1,ip) ) + + done = done .AND. ( nsl == zdims(2,ip) ) .AND. ( ldz == zdims(3,ip) ) + IF (done) EXIT + END DO + + IF( .NOT. done ) THEN + + ! no table exist for these parameters + ! initialize a new one + + ! WRITE( stdout, fmt="('DEBUG cft_1z, reinitializing tables ', I3)" ) icurrent + + + + IF( fw_planz( icurrent) /= 0 ) CALL dfftw_destroy_plan( fw_planz( icurrent) ) + IF( bw_planz( icurrent) /= 0 ) CALL dfftw_destroy_plan( bw_planz( icurrent) ) + idir = -1 + CALL dfftw_plan_many_dft( fw_planz( icurrent), 1, nz, nsl, c, & + (/SIZE(c)/), 1, ldz, cout, (/SIZE(cout)/), 1, ldz, idir, FFTW_ESTIMATE) + idir = 1 + CALL dfftw_plan_many_dft( bw_planz( icurrent), 1, nz, nsl, c, & + (/SIZE(c)/), 1, ldz, cout, (/SIZE(cout)/), 1, ldz, idir, FFTW_ESTIMATE) + + + zdims(1,icurrent) = nz; zdims(2,icurrent) = nsl; zdims(3,icurrent) = ldz; + ip = icurrent + icurrent = MOD( icurrent, ndims ) + 1 + + END IF + + ! + ! Now perform the FFTs using machine specific drivers + ! + +#if defined __FFT_CLOCKS + CALL start_clock( 'cft_1z' ) +#endif + + + IF (isign < 0) THEN + CALL dfftw_execute_dft( fw_planz( ip), c, cout) + tscale = 1.0_DP / nz + cout( 1 : ldz * nsl ) = cout( 1 : ldz * nsl ) * tscale + ELSE IF (isign > 0) THEN + CALL dfftw_execute_dft( bw_planz( ip), c, cout) + END IF + + +#if defined __FFT_CLOCKS + CALL stop_clock( 'cft_1z' ) +#endif + + RETURN + END SUBROUTINE cft_1z + +! +! +!=----------------------------------------------------------------------=! +! +! +! +! FFT along "x" and "y" direction +! +! +! +!=----------------------------------------------------------------------=! +! +! + + SUBROUTINE cft_2xy(r, nzl, nx, ny, ldx, ldy, isign, pl2ix) + +! driver routine for nzl 2d complex fft's of lengths nx and ny +! input : r(ldx*ldy) complex, transform is in-place +! ldx >= nx, ldy >= ny are the physical dimensions of the equivalent +! 2d array: r2d(ldx, ldy) (x first dimension, y second dimension) +! (ldx>nx, ldy>ny used on some architectures to reduce memory conflicts) +! pl2ix(nx) (optional) is 1 for columns along y to be transformed +! isign > 0 : forward (f(G)=>f(R)), isign <0 backward (f(R) => f(G)) +! Up to "ndims" initializations (for different combinations of input +! parameters nx,ny,nzl,ldx) are stored and re-used if available + + IMPLICIT NONE + + INTEGER, INTENT(IN) :: isign, ldx, ldy, nx, ny, nzl + INTEGER, OPTIONAL, INTENT(IN) :: pl2ix(:) + COMPLEX (DP) :: r( : ) + INTEGER :: i, k, j, err, idir, ip, kk + REAL(DP) :: tscale + INTEGER, SAVE :: icurrent = 1 + INTEGER, SAVE :: dims( 4, ndims) = -1 + LOGICAL :: dofft( nfftx ), done + INTEGER, PARAMETER :: stdout = 6 + +#if defined __HPM + INTEGER :: OMP_GET_THREAD_NUM +#endif +#if defined __OPENMP + INTEGER :: offset + INTEGER :: nx_t, ny_t, nzl_t, ldx_t, ldy_t + INTEGER :: itid, mytid, ntids + INTEGER :: omp_get_thread_num, omp_get_num_threads + EXTERNAL :: omp_get_thread_num, omp_get_num_threads +#endif + + + C_POINTER, SAVE :: fw_plan( 2, ndims ) = 0 + C_POINTER, SAVE :: bw_plan( 2, ndims ) = 0 + + + + + dofft( 1 : nx ) = .TRUE. + IF( PRESENT( pl2ix ) ) THEN + IF( SIZE( pl2ix ) < nx ) & + CALL errore( ' cft_2xy ', ' wrong dimension for arg no. 8 ', 1 ) + DO i = 1, nx + IF( pl2ix(i) < 1 ) dofft( i ) = .FALSE. + END DO + END IF + + ! WRITE( stdout,*) 'DEBUG: ', COUNT( dofft ) + + ! + ! Here initialize table only if necessary + ! + + DO ip = 1, ndims + + ! first check if there is already a table initialized + ! for this combination of parameters + + done = ( ny == dims(1,ip) ) .AND. ( nx == dims(3,ip) ) + ! The initialization in ESSL and FFTW v.3 depends on all four parameters + done = done .AND. ( ldx == dims(2,ip) ) .AND. ( nzl == dims(4,ip) ) + IF (done) EXIT + END DO + + IF( .NOT. done ) THEN + + ! no table exist for these parameters + ! initialize a new one + + ! WRITE( stdout, fmt="('DEBUG cft_2xy, reinitializing tables ', I3)" ) icurrent + + + IF ( ldx /= nx .OR. ldy /= ny ) THEN + IF( fw_plan(2,icurrent) /= 0 ) CALL dfftw_destroy_plan( fw_plan(2,icurrent) ) + IF( bw_plan(2,icurrent) /= 0 ) CALL dfftw_destroy_plan( bw_plan(2,icurrent) ) + idir = -1 + CALL dfftw_plan_many_dft( fw_plan(2,icurrent), 1, ny, 1, r(1:), & + (/ldx*ldy/), ldx, 1, r(1:), (/ldx*ldy/), ldx, 1, idir, & + FFTW_ESTIMATE) + idir = 1 + CALL dfftw_plan_many_dft( bw_plan(2,icurrent), 1, ny, 1, r(1:), & + (/ldx*ldy/), ldx, 1, r(1:), (/ldx*ldy/), ldx, 1, idir, & + FFTW_ESTIMATE) + + IF( fw_plan(1,icurrent) /= 0 ) CALL dfftw_destroy_plan( fw_plan(1,icurrent) ) + IF( bw_plan(1,icurrent) /= 0 ) CALL dfftw_destroy_plan( bw_plan(1,icurrent) ) + idir = -1 + CALL dfftw_plan_many_dft( fw_plan(1,icurrent), 1, nx, ny, r(1:), & + (/ldx*ldy/), 1, ldx, r(1:), (/ldx*ldy/), 1, ldx, idir, & + FFTW_ESTIMATE) + idir = 1 + CALL dfftw_plan_many_dft( bw_plan(1,icurrent), 1, nx, ny, r(1:), & + (/ldx*ldy/), 1, ldx, r(1:), (/ldx*ldy/), 1, ldx, idir, & + FFTW_ESTIMATE) + ELSE + IF( fw_plan( 1, icurrent) /= 0 ) CALL dfftw_destroy_plan( fw_plan( 1, icurrent) ) + IF( bw_plan( 1, icurrent) /= 0 ) CALL dfftw_destroy_plan( bw_plan( 1, icurrent) ) + idir = -1 + CALL dfftw_plan_many_dft( fw_plan( 1, icurrent), 2, (/nx, ny/), nzl,& + r(1:), (/nx, ny/), 1, nx*ny, r(1:), (/nx, ny/), 1, nx*ny, idir,& + FFTW_ESTIMATE) + idir = 1 + CALL dfftw_plan_many_dft( bw_plan( 1, icurrent), 2, (/nx, ny/), nzl,& + r(1:), (/nx, ny/), 1, nx*ny, r(1:), (/nx, ny/), 1, nx*ny, idir,& + FFTW_ESTIMATE) + END IF + + + dims(1,icurrent) = ny; dims(2,icurrent) = ldx; + dims(3,icurrent) = nx; dims(4,icurrent) = nzl; + ip = icurrent + icurrent = MOD( icurrent, ndims ) + 1 + + END IF + + ! + ! Now perform the FFTs using machine specific drivers + ! + +#if defined __FFT_CLOCKS + CALL start_clock( 'cft_2xy' ) +#endif + + + + IF ( ldx /= nx .OR. ldy /= ny ) THEN + IF( isign < 0 ) THEN + do j = 0, nzl-1 + CALL dfftw_execute_dft( fw_plan (1, ip), & + r(1+j*ldx*ldy:), r(1+j*ldx*ldy:)) + end do + do i = 1, nx + do k = 1, nzl + IF( dofft( i ) ) THEN + j = i + ldx*ldy * ( k - 1 ) + call dfftw_execute_dft( fw_plan ( 2, ip), r(j:), r(j:)) + END IF + end do + end do + tscale = 1.0_DP / ( nx * ny ) + CALL ZDSCAL( ldx * ldy * nzl, tscale, r(1), 1) + ELSE IF( isign > 0 ) THEN + do i = 1, nx + do k = 1, nzl + IF( dofft( i ) ) THEN + j = i + ldx*ldy * ( k - 1 ) + call dfftw_execute_dft( bw_plan ( 2, ip), r(j:), r(j:)) + END IF + end do + end do + do j = 0, nzl-1 + CALL dfftw_execute_dft( bw_plan( 1, ip), & + r(1+j*ldx*ldy:), r(1+j*ldx*ldy:)) + end do + END IF + ELSE + IF( isign < 0 ) THEN + call dfftw_execute_dft( fw_plan( 1, ip), r(1:), r(1:)) + tscale = 1.0_DP / ( nx * ny ) + CALL ZDSCAL( ldx * ldy * nzl, tscale, r(1), 1) + ELSE IF( isign > 0 ) THEN + call dfftw_execute_dft( bw_plan( 1, ip), r(1:), r(1:)) + END IF + END IF + + +#if defined __FFT_CLOCKS + CALL stop_clock( 'cft_2xy' ) +#endif + + RETURN + + END SUBROUTINE cft_2xy + + + SUBROUTINE cft_b ( f, nx, ny, nz, ldx, ldy, ldz, imin3, imax3, sgn ) + +! driver routine for 3d complex fft's on box grid, parallel case +! fft along xy is done only on planes that correspond to dense grid +! planes on the current processor, i.e. planes with imin3 <= nz <= imax3 +! implemented for essl, fftw, scsl, complib, only for sgn=1 (f(R) => f(G)) +! (beware: here the "essl" convention for the sign of the fft is used!) +! + implicit none + integer nx,ny,nz,ldx,ldy,ldz,imin3,imax3,sgn + complex(dp) :: f(:) + + integer isign, naux, ibid, nplanes, nstart, k + real(DP) :: tscale + + integer :: ip, i + integer, save :: icurrent = 1 + integer, save :: dims( 4, ndims ) = -1 + + + C_POINTER, save :: bw_planz( ndims ) = 0 + C_POINTER, save :: bw_planx( ndims ) = 0 + C_POINTER, save :: bw_plany( ndims ) = 0 + C_POINTER, save :: bw_planxy( ndims ) = 0 + + + isign = -sgn + tscale = 1.0_DP + + if ( isign > 0 ) then + call errore('cft_b','not implemented',isign) + end if +! +! 2d fft on xy planes - only needed planes are transformed +! note that all others are left in an unusable state +! + nplanes = imax3 - imin3 + 1 + nstart = ( imin3 - 1 ) * ldx * ldy + 1 + + ! + ! Here initialize table only if necessary + ! + + ip = -1 + DO i = 1, ndims + + ! first check if there is already a table initialized + ! for this combination of parameters + + IF ( ( nx == dims(1,i) ) .and. ( ny == dims(2,i) ) .and. & + ( nz == dims(3,i) ) .and. ( nplanes == dims(4,i) ) ) THEN + ip = i + EXIT + END IF + + END DO + + IF( ip == -1 ) THEN + + ! no table exist for these parameters + ! initialize a new one + + + if ( bw_planz(icurrent) /= 0 ) & + call dfftw_destroy_plan(bw_planz(icurrent)) + call dfftw_plan_many_dft( bw_planz(icurrent), 1, nz, ldx*ldy, & + f(1:), (/SIZE(f)/), ldx*ldy, 1, f(1:), (/SIZE(f)/), ldx*ldy, 1, & + 1, FFTW_ESTIMATE ) + + if ( bw_planxy(icurrent) /= 0 ) & + call dfftw_destroy_plan(bw_planxy(icurrent)) + call dfftw_plan_many_dft( bw_planxy(icurrent), 2, (/nx, ny/), nplanes,& + f(nstart:), (/ldx, ldy/), 1, ldx*ldy, f(nstart:), (/ldx, ldy/), & + 1, ldx*ldy, 1, FFTW_ESTIMATE ) + + + dims(1,icurrent) = nx; dims(2,icurrent) = ny + dims(3,icurrent) = nz; dims(4,icurrent) = nplanes + ip = icurrent + icurrent = MOD( icurrent, ndims ) + 1 + + END IF + + + + call dfftw_execute_dft(bw_planz(ip), f(1:), f(1:)) + call dfftw_execute_dft(bw_planxy(ip), f(nstart:), f(nstart:)) + + RETURN + END SUBROUTINE cft_b +!!$ +!!$! +!!$!=----------------------------------------------------------------------=! +!!$! +!!$! +!!$! +!!$! 3D parallel FFT on sub-grids, to be called inside OpenMP region +!!$! +!!$! +!!$! +!!$!=----------------------------------------------------------------------=! +!!$! + + +! +!=----------------------------------------------------------------------=! +! +! +! +! FFT support Functions/Subroutines +! +! +! +!=----------------------------------------------------------------------=! +! + +! +integer & +function good_fft_dimension (n) + ! + ! Determines the optimal maximum dimensions of fft arrays + ! Useful on some machines to avoid memory conflicts + ! + USE kinds, only : DP + IMPLICIT NONE + INTEGER :: n, nx + REAL(DP) :: log2n + ! + ! this is the default: max dimension = fft dimension + nx = n + ! + ! + good_fft_dimension = nx + return +end function good_fft_dimension + + +!=----------------------------------------------------------------------=! + +function allowed (nr) + + + ! find if the fft dimension is a good one + ! a "bad one" is either not implemented (as on IBM with ESSL) + ! or implemented but with awful performances (most other cases) + + USE kinds + + implicit none + integer :: nr + + logical :: allowed + integer :: pwr (5) + integer :: mr, i, fac, p, maxpwr + integer :: factors( 5 ) = (/ 2, 3, 5, 7, 11 /) + + ! find the factors of the fft dimension + + mr = nr + pwr = 0 + factors_loop: do i = 1, 5 + fac = factors (i) + maxpwr = NINT ( LOG( DBLE (mr) ) / LOG( DBLE (fac) ) ) + 1 + do p = 1, maxpwr + if ( mr == 1 ) EXIT factors_loop + if ( MOD (mr, fac) == 0 ) then + mr = mr / fac + pwr (i) = pwr (i) + 1 + endif + enddo + end do factors_loop + + IF ( nr /= ( mr * 2**pwr (1) * 3**pwr (2) * 5**pwr (3) * 7**pwr (4) * 11**pwr (5) ) ) & + CALL errore (' allowed ', ' what ?!? ', 1 ) + + if ( mr /= 1 ) then + + ! fft dimension contains factors > 11 : no good in any case + + allowed = .false. + + else + + + ! fftw and all other cases: no factors 7 and 11 + + allowed = ( ( pwr(4) == 0 ) .and. ( pwr(5) == 0 ) ) + + + endif + + return +end function allowed + +!=----------------------------------------------------------------------=! + + INTEGER & + FUNCTION good_fft_order( nr, np ) + +! +! This function find a "good" fft order value greater or equal to "nr" +! +! nr (input) tentative order n of a fft +! +! np (optional input) if present restrict the search of the order +! in the ensamble of multiples of np +! +! Output: the same if n is a good number +! the closest higher number that is good +! an fft order is not good if not implemented (as on IBM with ESSL) +! or implemented but with awful performances (most other cases) +! + + IMPLICIT NONE + INTEGER, INTENT(IN) :: nr + INTEGER, OPTIONAL, INTENT(IN) :: np + INTEGER :: new + + new = nr + IF( PRESENT( np ) ) THEN + DO WHILE( ( ( .NOT. allowed( new ) ) .OR. ( MOD( new, np ) /= 0 ) ) .AND. ( new <= nfftx ) ) + new = new + 1 + END DO + ELSE + DO WHILE( ( .NOT. allowed( new ) ) .AND. ( new <= nfftx ) ) + new = new + 1 + END DO + END IF + + IF( new > nfftx ) & + CALL errore( ' good_fft_order ', ' fft order too large ', new ) + + good_fft_order = new + + RETURN + END FUNCTION good_fft_order + + +!=----------------------------------------------------------------------=! + END MODULE fft_scalar +!=----------------------------------------------------------------------=! diff --git a/tests/apps/miniDFT/tests/src/fft_stick.c b/tests/apps/miniDFT/tests/src/fft_stick.c new file mode 100644 index 0000000000..7d743cff4d --- /dev/null +++ b/tests/apps/miniDFT/tests/src/fft_stick.c @@ -0,0 +1,214 @@ +/* + Copyright (C) 2002 FPMD group + This file is distributed under the terms of the + GNU General Public License. See the file `License' + in the root directory of the present distribution, + or http://www.gnu.org/copyleft/gpl.txt . +*/ + +#include "c_defs.h" + +#if defined __FFTW +# include "fftw.c" + +int F77_FUNC_ (create_plan_1d, CREATE_PLAN_1D)(fftw_plan *p, int *n, int *idir) +{ + fftw_direction dir = ( (*idir < 0) ? FFTW_FORWARD : FFTW_BACKWARD ); + *p = fftw_create_plan(*n, dir, FFTW_ESTIMATE | FFTW_IN_PLACE); + if( *p == NULL ) fprintf(stderr," *** CREATE_PLAN: warning empty plan ***\n"); +/* printf(" pointer size = %d, value = %d\n", sizeof ( *p ), *p ); */ + return 0; +} + + +int F77_FUNC_ (destroy_plan_1d, DESTROY_PLAN_1D)(fftw_plan *p) +{ + if ( *p != NULL ) fftw_destroy_plan(*p); + else fprintf(stderr," *** DESTROY_PLAN: warning empty plan ***\n"); + return 0; +} + +int F77_FUNC_ (create_plan_2d, CREATE_PLAN_2D) + (fftwnd_plan *p, int *n, int *m, int *idir) +{ + fftw_direction dir = ( (*idir < 0) ? FFTW_FORWARD : FFTW_BACKWARD ); + *p = fftw2d_create_plan(*m, *n, dir, FFTW_ESTIMATE | FFTW_IN_PLACE); + if( *p == NULL ) fprintf(stderr," *** CREATE_PLAN_2D: warning empty plan ***\n"); +/* printf(" pointer size = %d, value = %d\n", sizeof ( *p ), *p ); */ + return 0; +} + +int F77_FUNC_ (destroy_plan_2d, DESTROY_PLAN_2D)(fftwnd_plan *p) +{ + if ( *p != NULL ) fftwnd_destroy_plan(*p); + else fprintf(stderr," *** DESTROY_PLAN_2D: warning empty plan ***\n"); + return 0; +} + +int F77_FUNC_ (create_plan_3d, CREATE_PLAN_3D) + (fftwnd_plan *p, int *n, int *m, int *l, int *idir) +{ + fftw_direction dir = ( (*idir < 0) ? FFTW_FORWARD : FFTW_BACKWARD ); + *p = fftw3d_create_plan(*l, *m, *n, dir, FFTW_ESTIMATE | FFTW_IN_PLACE); + if( *p == NULL ) { + fprintf(stderr," *** CREATE_PLAN_3D: warning empty plan ***\n"); + fprintf(stderr," *** input was (n,m,l,dir): %d %d %d %d ***\n", *l, *m, *n, *idir); + } +/* printf(" pointer size = %d, value = %d\n", sizeof ( *p ), *p ); */ + return 0; +} + +int F77_FUNC_ (destroy_plan_3d, DESTROY_PLAN_3D)(fftwnd_plan *p) + +{ + if ( *p != NULL ) fftwnd_destroy_plan(*p); + else fprintf(stderr," *** DESTROY_PLAN_3D: warning empty plan ***\n"); + return 0; +} + + +int F77_FUNC_ (fft_x_stick, FFT_X_STICK) +(fftw_plan *p, FFTW_COMPLEX *a, int *nx, int *ny, int *nz, int *ldx, int *ldy ) +{ + + int i, j, ind; + int xstride, bigstride; + int xhowmany, xidist; + double * ptr; + +/* trasform along x and y */ + bigstride = (*ldx) * (*ldy); + + xhowmany = (*ny); + xstride = 1; + xidist = (*ldx); + + /* ptr = (double *)a; */ + + for(i = 0; i < *nz ; i++) { + /* trasform along x */ + fftw(*p,xhowmany,&a[i*bigstride],xstride,xidist,0,0,0); + } + return 0; +} + +int F77_FUNC_ (fft_y_stick, FFT_Y_STICK) + (fftw_plan *p, FFTW_COMPLEX *a, int *ny, int *ldx ) +{ + fftw(*p, 1, a, (*ldx), 1, 0, 0, 0); + return 0; +} + + +int F77_FUNC_ (fft_z_stick, FFT_Z_STICK) + (fftw_plan *p, FFTW_COMPLEX *zstick, int *ldz, int *nstick_l) +{ + int howmany, idist; + howmany = (*nstick_l) ; + idist = (*ldz); + fftw(*p, howmany, zstick, 1, idist, 0, 0, 0); + return 0; +} + +int F77_FUNC_ ( fftw_inplace_drv_1d, FFTW_INPLACE_DRV_1D ) + (fftw_plan *p, int *nfft, FFTW_COMPLEX *a, int *inca, int *idist) +{ + fftw(*p, (*nfft), a, (*inca), (*idist), 0, 0, 0); + return 0; +} + +int F77_FUNC_ ( fftw_inplace_drv_2d, FFTW_INPLACE_DRV_2D ) + ( fftwnd_plan *p, int *nfft, FFTW_COMPLEX *a, int *inca, int *idist) +{ + fftwnd( *p, (*nfft), a, (*inca), (*idist), 0, 0, 0 ); + return 0; +} + +int F77_FUNC_ ( fftw_inplace_drv_3d, FFTW_INPLACE_DRV_3D ) + ( fftwnd_plan *p, int *nfft, FFTW_COMPLEX *a, int *inca, int *idist) +{ + fftwnd( *p, (*nfft), a, (*inca), (*idist), 0, 0, 0 ); + return 0; +} + +int F77_FUNC_ (fft_x_stick_single, FFT_X_STICK_SINGLE) +(fftw_plan *p, FFTW_COMPLEX *a, int *nx, int *ny, int *nz, int *ldx, int *ldy ) +{ + + int i, j, ind; + int xstride, bigstride; + int xhowmany, xidist; + double * ptr; + +/* trasform along x and y */ + bigstride = (*ldx) * (*ldy); + + xhowmany = (*ny); + xstride = 1; + xidist = (*ldx); + + fftw(*p,xhowmany,a,xstride,xidist,0,0,0); + + return 0; +} + + +int F77_FUNC_ (fft_z_stick_single, FFT_Z_STICK_SINGLE) + (fftw_plan *p, FFTW_COMPLEX *a, int *ldz) +{ + fftw(*p, 1,a, 1, 0, 0, 0, 0); + + return 0; +} + +/* Computing the N-Dimensional FFT +void fftwnd(fftwnd_plan plan, int howmany, + FFTW_COMPLEX *in, int istride, int idist, + FFTW_COMPLEX *out, int ostride, int odist); +*/ + + +/* +void fftw(fftw_plan plan, int howmany, + fftw_complex *in, int istride, int idist, + fftw_complex *out, int ostride, int odist); + +The function fftw computes the one-dimensional Fourier transform, +using a plan created by fftw_create_plan (See Section Plan Creation for +One-dimensional Transforms.) The function fftw_one provides a simplified +interface for the common case of single input array of stride 1. + +Arguments +plan is the plan created by fftw_create_plan +howmany is the number of transforms fftw will compute. It is faster to + tell FFTW to compute many transforms, instead of simply calling fftw + many times. +in, istride and idist describe the input array(s). + There are howmany input arrays; the first one is pointed to by in, + the second one is pointed to by in + idist, and so on, up to + in + (howmany - 1) * idist. Each input array consists of complex numbers, + which are not necessarily contiguous in memory. Specifically, in[0] is + the first element of the first array, in[istride] is the second element + of the first array, and so on. In general, the i-th element of the j-th + input array will be in position in[i * istride + j * idist]. +out, ostride and odist describe the output array(s). + The format is the same as for the input array. + +In-place transforms: If the plan specifies an in-place transform, ostride +and odist are always ignored. If out is NULL, out is ignored, too. Otherwise, +out is interpreted as a pointer to an array of n complex numbers, that FFTW +will use as temporary space to perform the in-place computation. out is used +as scratch space and its contents destroyed. In this case, out must be an +ordinary array whose elements are contiguous in memory (no striding). + +*/ + +#else + +/* This dummy subroutine is there for compilers that dislike empty files */ + +int dumfftwdrv() { + return 0; +} + +#endif diff --git a/tests/apps/miniDFT/tests/src/fft_types.f90 b/tests/apps/miniDFT/tests/src/fft_types.f90 new file mode 100644 index 0000000000..e69b46bca4 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/fft_types.f90 @@ -0,0 +1,595 @@ +! +! Copyright (C) 2002 FPMD group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! + +MODULE fft_types + + USE io_global, ONLY : stdout + + IMPLICIT NONE + SAVE + + + TYPE fft_dlay_descriptor + INTEGER :: nst ! total number of sticks + INTEGER, POINTER :: nsp(:) ! number of sticks per processor ( potential ) + ! using proc index starting from 1 !! + ! on proc mpime -> nsp( mpime + 1 ) + INTEGER, POINTER :: nsw(:) ! number of sticks per processor ( wave func ) + ! using proc index as above + INTEGER :: nr1 = 0 ! + INTEGER :: nr2 = 0 ! effective FFT dimensions of the 3D grid (global) + INTEGER :: nr3 = 0 ! + INTEGER :: nr1x = 0 ! FFT grids leading dimensions + INTEGER :: nr2x = 0 ! dimensions of the arrays for the 3D grid (global) + INTEGER :: nr3x = 0 ! may differ from nr1 ,nr2 ,nr3 in order to boost performances + INTEGER :: npl = 0 ! number of "Z" planes for this processor = npp( mpime + 1 ) + INTEGER :: nnp = 0 ! number of 0 and non 0 sticks in a plane ( ~nr1*nr2/nproc ) + INTEGER :: nnr = 0 ! local number of FFT grid elements ( ~nr1*nr2*nr3/proc ) + ! size of the arrays allocated for the FFT, local to each processor: + ! in parallel execution may differ from nr1x*nr2x*nr3x + ! Not to be confused either with nr1*nr2*nr3 + INTEGER, POINTER :: ngl(:) ! per proc. no. of non zero charge density/potential components + INTEGER, POINTER :: nwl(:) ! per proc. no. of non zero wave function plane components + INTEGER, POINTER :: npp(:) ! number of "Z" planes per processor + INTEGER, POINTER :: ipp(:) ! offset of the first "Z" plane on each proc ( 0 on the first proc!!!) + INTEGER, POINTER :: iss(:) ! index of the first stick on each proc + INTEGER, POINTER :: isind(:) ! for each position in the plane indicate the stick index + INTEGER, POINTER :: ismap(:) ! for each stick in the plane indicate the position + INTEGER, POINTER :: iplp(:) ! indicate which "Y" plane should be FFTed ( potential ) + INTEGER, POINTER :: iplw(:) ! indicate which "Y" plane should be FFTed ( wave func ) + ! + ! descriptor id and pointer, for future use + ! + INTEGER :: id + INTEGER :: tptr + ! + ! Sub (box) grid descriptor + ! + INTEGER, POINTER :: irb(:,:) ! the offset of the box corner + INTEGER, POINTER :: imin3(:) ! the starting local plane + INTEGER, POINTER :: imax3(:) ! the last local plane + INTEGER, POINTER :: np3(:) ! number of local plane for the box fft + ! + ! fft parallelization + ! + INTEGER :: mype ! my processor id (starting from 0) in the fft group + INTEGER :: comm ! communicator of the fft gruop + INTEGER :: nproc ! number of processor in the fft group + INTEGER :: root ! root processor + ! + ! task groups + ! + LOGICAL :: have_task_groups + ! + INTEGER :: me_pgrp ! task id for plane wave task group + INTEGER :: nogrp ! number of proc. in an orbital "task group" + INTEGER :: npgrp ! number of proc. in a plane-wave "task group" + INTEGER :: ogrp_comm ! orbital group communicator + INTEGER :: pgrp_comm ! plane-wave group communicator + INTEGER, POINTER :: nolist(:) ! list of pes in orbital group + INTEGER, POINTER :: nplist(:) ! list of pes in pw group + ! + INTEGER :: tg_nnr ! maximum among nnr + INTEGER, POINTER :: tg_nsw(:) ! number of sticks per task group ( wave func ) + INTEGER, POINTER :: tg_npp(:) ! number of "Z" planes per task group + INTEGER, POINTER :: tg_snd(:) ! number of element to be sent in group redist + INTEGER, POINTER :: tg_rcv(:) ! number of element to be received in group redist + INTEGER, POINTER :: tg_psdsp(:)! send displacement for all to all (pack) + INTEGER, POINTER :: tg_usdsp(:)! send displacement for all to all (unpack) + INTEGER, POINTER :: tg_rdsp(:)! receive displacement for all to all + ! + END TYPE + + + INTEGER, PRIVATE :: icount = 0 + + +CONTAINS + + SUBROUTINE fft_dlay_allocate( desc, mype, root, nproc, comm, nogrp, nx, ny ) + TYPE (fft_dlay_descriptor) :: desc + INTEGER, INTENT(in) :: mype, root, nproc, comm, nx, ny ! mype starting from 0 + INTEGER, INTENT(in) :: nogrp ! number of task groups + ALLOCATE( desc%nsp( nproc ) ) + ALLOCATE( desc%nsw( nproc ) ) + ALLOCATE( desc%ngl( nproc ) ) + ALLOCATE( desc%nwl( nproc ) ) + ALLOCATE( desc%npp( nproc ) ) + ALLOCATE( desc%ipp( nproc ) ) + ALLOCATE( desc%iss( nproc ) ) + ALLOCATE( desc%isind( nx * ny ) ) + ALLOCATE( desc%ismap( nx * ny ) ) + ALLOCATE( desc%iplp( nx ) ) + ALLOCATE( desc%iplw( nx ) ) + + desc%nsp = 0 + desc%nsw = 0 + desc%ngl = 0 + desc%nwl = 0 + desc%npp = 0 + desc%ipp = 0 + desc%iss = 0 + desc%isind = 0 + desc%ismap = 0 + desc%iplp = 0 + desc%iplw = 0 + + desc%id = 0 + + desc%mype = mype + desc%comm = comm + desc%nproc = nproc + desc%root = root + desc%have_task_groups = .false. + IF( nogrp > 1 ) & + desc%have_task_groups = .true. + desc%me_pgrp = 0 + ! + IF( MOD( nproc, MAX( 1, nogrp ) ) /= 0 ) & + CALL errore( " fft_dlay_allocate ", "the number of task groups should be a divisor of nproc ", 1 ) + + desc%nogrp = MAX( 1, nogrp ) + desc%npgrp = nproc / MAX( 1, nogrp ) + desc%ogrp_comm = 0 + desc%pgrp_comm = 0 + ALLOCATE( desc%nolist( desc%nogrp ) ) + ALLOCATE( desc%nplist( desc%npgrp ) ) + desc%nolist = 0 + desc%nplist = 0 + NULLIFY( desc%tg_nsw ) + NULLIFY( desc%tg_npp ) + NULLIFY( desc%tg_snd ) + NULLIFY( desc%tg_rcv ) + NULLIFY( desc%tg_psdsp ) + NULLIFY( desc%tg_usdsp ) + NULLIFY( desc%tg_rdsp ) + + END SUBROUTINE fft_dlay_allocate + + + SUBROUTINE fft_dlay_deallocate( desc ) + TYPE (fft_dlay_descriptor) :: desc + IF ( associated( desc%nsp ) ) DEALLOCATE( desc%nsp ) + IF ( associated( desc%nsw ) ) DEALLOCATE( desc%nsw ) + IF ( associated( desc%ngl ) ) DEALLOCATE( desc%ngl ) + IF ( associated( desc%nwl ) ) DEALLOCATE( desc%nwl ) + IF ( associated( desc%npp ) ) DEALLOCATE( desc%npp ) + IF ( associated( desc%ipp ) ) DEALLOCATE( desc%ipp ) + IF ( associated( desc%iss ) ) DEALLOCATE( desc%iss ) + IF ( associated( desc%isind ) ) DEALLOCATE( desc%isind ) + IF ( associated( desc%ismap ) ) DEALLOCATE( desc%ismap ) + IF ( associated( desc%iplp ) ) DEALLOCATE( desc%iplp ) + IF ( associated( desc%iplw ) ) DEALLOCATE( desc%iplw ) + IF ( associated( desc%nolist ) ) DEALLOCATE( desc%nolist ) + IF ( associated( desc%nplist ) ) DEALLOCATE( desc%nplist ) + desc%id = 0 + IF( desc%have_task_groups ) THEN + IF ( associated( desc%tg_nsw ) ) DEALLOCATE( desc%tg_nsw ) + IF ( associated( desc%tg_npp ) ) DEALLOCATE( desc%tg_npp ) + IF ( associated( desc%tg_snd ) ) DEALLOCATE( desc%tg_snd ) + IF ( associated( desc%tg_rcv ) ) DEALLOCATE( desc%tg_rcv ) + IF ( associated( desc%tg_psdsp ) ) DEALLOCATE( desc%tg_psdsp ) + IF ( associated( desc%tg_usdsp ) ) DEALLOCATE( desc%tg_usdsp ) + IF ( associated( desc%tg_rdsp ) ) DEALLOCATE( desc%tg_rdsp ) + ENDIF + desc%have_task_groups = .false. + END SUBROUTINE fft_dlay_deallocate + +!=----------------------------------------------------------------------------=! + + SUBROUTINE fft_box_allocate( desc, mype, root, nproc, comm, nat ) + TYPE (fft_dlay_descriptor) :: desc + INTEGER, INTENT(in) :: nat, nproc, mype, root, comm ! mype starting from 0 + ALLOCATE( desc%irb( 3, nat ) ) + ALLOCATE( desc%imin3( nat ) ) + ALLOCATE( desc%imax3( nat ) ) + ALLOCATE( desc%npp( nproc ) ) + ALLOCATE( desc%ipp( nproc ) ) + ALLOCATE( desc%np3( nat ) ) + desc%irb = 0 + desc%imin3 = 0 + desc%imax3 = 0 + desc%npp = 0 + desc%ipp = 0 + desc%np3 = 0 + desc%mype = mype + desc%nproc = nproc + desc%comm = comm + desc%root = root + desc%have_task_groups = .false. + END SUBROUTINE fft_box_allocate + + SUBROUTINE fft_box_deallocate( desc ) + TYPE (fft_dlay_descriptor) :: desc + IF( associated( desc%irb ) ) DEALLOCATE( desc%irb ) + IF( associated( desc%imin3 ) ) DEALLOCATE( desc%imin3 ) + IF( associated( desc%imax3 ) ) DEALLOCATE( desc%imax3 ) + IF( associated( desc%npp ) ) DEALLOCATE( desc%npp ) + IF( associated( desc%ipp ) ) DEALLOCATE( desc%ipp ) + IF( associated( desc%np3 ) ) DEALLOCATE( desc%np3 ) + desc%have_task_groups = .false. + END SUBROUTINE fft_box_deallocate + + +!=----------------------------------------------------------------------------=! + + SUBROUTINE fft_dlay_set( desc, tk, nst, nr1, nr2, nr3, nr1x, nr2x, nr3x, & + ub, lb, idx, in1, in2, ncp, ncpw, ngp, ngpw, st, stw ) + + TYPE (fft_dlay_descriptor) :: desc + + LOGICAL, INTENT(in) :: tk + INTEGER, INTENT(in) :: nst + INTEGER, INTENT(in) :: nr1, nr2, nr3 ! size of real space grid + INTEGER, INTENT(in) :: nr1x, nr2x, nr3x ! padded size of real space grid + INTEGER, INTENT(in) :: ub(3), lb(3) ! upper and lower bound of real space indices + INTEGER, INTENT(in) :: idx(:) + INTEGER, INTENT(in) :: in1(:) + INTEGER, INTENT(in) :: in2(:) + INTEGER, INTENT(in) :: ncp(:) + INTEGER, INTENT(in) :: ncpw(:) + INTEGER, INTENT(in) :: ngp(:) + INTEGER, INTENT(in) :: ngpw(:) + INTEGER, INTENT(in) :: st( lb(1) : ub(1), lb(2) : ub(2) ) + INTEGER, INTENT(in) :: stw( lb(1) : ub(1), lb(2) : ub(2) ) + + INTEGER :: npp( desc%nproc ), n3( desc%nproc ), nsp( desc%nproc ) + INTEGER :: np, nq, i, is, iss, i1, i2, m1, m2, n1, n2, ip + + ! Task-grouping C. Bekas + ! + INTEGER :: sm + + IF( ( size( desc%ngl ) < desc%nproc ) .or. ( size( desc%npp ) < desc%nproc ) .or. & + ( size( desc%ipp ) < desc%nproc ) .or. ( size( desc%iss ) < desc%nproc ) ) & + CALL errore( ' fft_dlay_set ', ' wrong descriptor dimensions ', 1 ) + + IF( ( nr1 > nr1x ) .or. ( nr2 > nr2x ) .or. ( nr3 > nr3x ) ) & + CALL errore( ' fft_dlay_set ', ' wrong fft dimensions ', 2 ) + + IF( ( size( idx ) < nst ) .or. ( size( in1 ) < nst ) .or. ( size( in2 ) < nst ) ) & + CALL errore( ' fft_dlay_set ', ' wrong number of stick dimensions ', 3 ) + + IF( ( size( ncp ) < desc%nproc ) .or. ( size( ngp ) < desc%nproc ) ) & + CALL errore( ' fft_dlay_set ', ' wrong stick dimensions ', 4 ) + + ! Set the number of "xy" planes for each processor + ! in other word do a slab partition along the z axis + + sm = 0 + npp = 0 + IF ( desc%nproc == 1 ) THEN + npp(1) = nr3 + ELSEIF( desc%nproc <= nr3 ) THEN + np = nr3 / desc%nproc + nq = nr3 - np * desc%nproc + DO i = 1, desc%nproc + npp(i) = np + IF ( i <= nq ) npp(i) = np + 1 + ENDDO + ELSE + DO ip = 1, nr3 ! some compiler complains for empty DO loops + DO i = 1, desc%nproc, desc%nogrp + npp(i) = npp(i) + 1 + sm = sm + 1 + IF ( sm == nr3 ) exit + ENDDO + IF ( sm == nr3 ) exit + ENDDO + ENDIF + + desc%npp( 1:desc%nproc ) = npp + desc%npl = npp( desc%mype + 1 ) + + ! Find out the index of the starting plane on each proc + + n3 = 0 + DO i = 2, desc%nproc + n3(i) = n3(i-1) + npp(i-1) + ENDDO + + desc%ipp( 1:desc%nproc ) = n3 + + ! Set the proper number of sticks + + IF( .not. tk ) THEN + desc%nst = 2*nst - 1 + ELSE + desc%nst = nst + ENDIF + + ! Set fft actual and leading dimensions + + desc%nr1 = nr1 + desc%nr2 = nr2 + desc%nr3 = nr3 + desc%nr1x = nr1x + desc%nr2x = nr2x + desc%nr3x = nr3x + desc%nnp = nr1x * nr2x ! see ncplane + + ! Set fft local workspace dimension + + IF ( desc%nproc == 1 ) THEN + desc%nnr = nr1x * nr2x * nr3x + desc%tg_nnr = desc%nnr + ELSE + desc%nnr = max( nr3x * ncp( 1 ), nr1x * nr2x * npp( 1 ) ) + DO i = 2, desc%nproc + desc%nnr = max( desc%nnr, nr3x * ncp( i ) ) + desc%nnr = max( desc%nnr, nr1x * nr2x * npp( i ) ) + END DO + desc%nnr = max( 1, desc%nnr ) ! ensure that desc%nrr > 0 ( for extreme parallelism ) + desc%tg_nnr = desc%nnr + DO i = 1, desc%nproc + desc%tg_nnr = max( desc%tg_nnr, nr3x * ncp( i ) ) + desc%tg_nnr = max( desc%tg_nnr, nr1x * nr2x * npp( i ) ) + ENDDO + desc%tg_nnr = max( 1, desc%tg_nnr ) ! ensure that desc%nrr > 0 ( for extreme parallelism ) + ENDIF + + + + desc%ngl( 1:desc%nproc ) = ngp( 1:desc%nproc ) + desc%nwl( 1:desc%nproc ) = ngpw( 1:desc%nproc ) + + IF( size( desc%isind ) < ( nr1x * nr2x ) ) & + CALL errore( ' fft_dlay_set ', ' wrong descriptor dimensions, isind ', 5 ) + + IF( size( desc%iplp ) < ( nr1x ) .or. size( desc%iplw ) < ( nr1x ) ) & + CALL errore( ' fft_dlay_set ', ' wrong descriptor dimensions, ipl ', 5 ) + + ! + ! 1. Temporarily store in the array "desc%isind" the index of the processor + ! that own the corresponding stick (index of proc starting from 1) + ! 2. Set the array elements of "desc%iplw" and "desc%iplp" to one + ! for that index corresponding to YZ planes containing at least one stick + ! this are used in the FFT transform along Y + ! + + desc%isind = 0 + desc%iplp = 0 + desc%iplw = 0 + + DO iss = 1, nst + is = idx( iss ) + i1 = in1( is ) + i2 = in2( is ) + IF( st( i1, i2 ) > 0 ) THEN + m1 = i1 + 1; IF ( m1 < 1 ) m1 = m1 + nr1 + m2 = i2 + 1; IF ( m2 < 1 ) m2 = m2 + nr2 + IF( stw( i1, i2 ) > 0 ) THEN + desc%isind( m1 + ( m2 - 1 ) * nr1x ) = st( i1, i2 ) + desc%iplw( m1 ) = 1 + ELSE + desc%isind( m1 + ( m2 - 1 ) * nr1x ) = -st( i1, i2 ) + ENDIF + desc%iplp( m1 ) = 1 + IF( .not. tk ) THEN + n1 = -i1 + 1; IF ( n1 < 1 ) n1 = n1 + nr1 + n2 = -i2 + 1; IF ( n2 < 1 ) n2 = n2 + nr2 + IF( stw( -i1, -i2 ) > 0 ) THEN + desc%isind( n1 + ( n2 - 1 ) * nr1x ) = st( -i1, -i2 ) + desc%iplw( n1 ) = 1 + ELSE + desc%isind( n1 + ( n2 - 1 ) * nr1x ) = -st( -i1, -i2 ) + ENDIF + desc%iplp( n1 ) = 1 + ENDIF + ENDIF + ENDDO + + ! + ! Compute for each proc the global index ( starting from 0 ) of the first + ! local stick ( desc%iss ) + ! + + DO i = 1, desc%nproc + IF( i == 1 ) THEN + desc%iss( i ) = 0 + ELSE + desc%iss( i ) = desc%iss( i - 1 ) + ncp( i - 1 ) + ENDIF + ENDDO + + IF( size( desc%ismap ) < ( nst ) ) & + CALL errore( ' fft_dlay_set ', ' wrong descriptor dimensions ', 6 ) + + ! + ! 1. Set the array desc%ismap which maps stick indexes to + ! position in the palne ( iss ) + ! 2. Re-set the array "desc%isind", that maps position + ! in the plane with stick indexes (it is the inverse of desc%ismap ) + ! + + ! wave function sticks first + + desc%ismap = 0 + nsp = 0 + DO iss = 1, size( desc%isind ) + ip = desc%isind( iss ) + IF( ip > 0 ) THEN + nsp( ip ) = nsp( ip ) + 1 + desc%ismap( nsp( ip ) + desc%iss( ip ) ) = iss + IF( ip == ( desc%mype + 1 ) ) THEN + desc%isind( iss ) = nsp( ip ) + ELSE + desc%isind( iss ) = 0 + ENDIF + ENDIF + ENDDO + + ! chack number of stick against the input value + + IF( any( nsp( 1:desc%nproc ) /= ncpw( 1:desc%nproc ) ) ) THEN + DO ip = 1, desc%nproc + WRITE( stdout,*) ' * ', ip, ' * ', nsp( ip ), ' /= ', ncpw( ip ) + ENDDO + CALL errore( ' fft_dlay_set ', ' inconsistent number of sticks ', 7 ) + ENDIF + + desc%nsw( 1:desc%nproc ) = nsp( 1:desc%nproc ) + + ! then add pseudopotential stick + + DO iss = 1, size( desc%isind ) + ip = desc%isind( iss ) + IF( ip < 0 ) THEN + nsp( -ip ) = nsp( -ip ) + 1 + desc%ismap( nsp( -ip ) + desc%iss( -ip ) ) = iss + IF( -ip == ( desc%mype + 1 ) ) THEN + desc%isind( iss ) = nsp( -ip ) + ELSE + desc%isind( iss ) = 0 + ENDIF + ENDIF + ENDDO + + ! chack number of stick against the input value + + IF( any( nsp( 1:desc%nproc ) /= ncp( 1:desc%nproc ) ) ) THEN + DO ip = 1, desc%nproc + WRITE( stdout,*) ' * ', ip, ' * ', nsp( ip ), ' /= ', ncp( ip ) + ENDDO + CALL errore( ' fft_dlay_set ', ' inconsistent number of sticks ', 8 ) + ENDIF + + desc%nsp( 1:desc%nproc ) = nsp( 1:desc%nproc ) + + icount = icount + 1 + desc%id = icount + + ! Initialize the pointer to the fft tables + + desc%tptr = icount + + RETURN + END SUBROUTINE fft_dlay_set + +!=----------------------------------------------------------------------------=! + + SUBROUTINE fft_box_set( desc, nr1b, nr2b, nr3b, nr1bx, nr2bx, nr3bx, nat, & + irb, npp, ipp ) + + IMPLICIT NONE + + TYPE (fft_dlay_descriptor) :: desc + + INTEGER, INTENT(in) :: nat + INTEGER, INTENT(in) :: irb( :, : ) + INTEGER, INTENT(in) :: npp( : ) + INTEGER, INTENT(in) :: ipp( : ) + INTEGER, INTENT(in) :: nr1b, nr2b, nr3b, nr1bx, nr2bx, nr3bx + + INTEGER :: ir3, ibig3, irb3, imin3, imax3, nr3, isa + + IF( nat > size( desc%irb, 2 ) ) THEN + WRITE( stdout, fmt="( ///,'NAT, SIZE = ',2I10)" ) nat, size( desc%irb, 2 ) + CALL errore(" fft_box_set ", " inconsistent dimensions ", 1 ) + ENDIF + + IF( desc%nproc > size( desc%npp ) ) & + CALL errore(" fft_box_set ", " inconsistent dimensions ", 2 ) + + desc%nr1 = nr1b + desc%nr2 = nr2b + desc%nr3 = nr3b + desc%nr1x = nr1bx + desc%nr2x = nr2bx + desc%nr3x = nr3bx + + desc%irb( 1:3, 1:nat ) = irb( 1:3, 1:nat ) + desc%npp( 1:desc%nproc ) = npp( 1:desc%nproc ) + desc%ipp( 1:desc%nproc ) = ipp( 1:desc%nproc ) + + nr3 = sum( npp( 1:desc%nproc ) ) + + DO isa = 1, nat + + imin3 = nr3b + imax3 = 1 + irb3 = irb( 3, isa ) + + DO ir3 = 1, nr3b + ibig3 = 1 + mod( irb3 + ir3 - 2, nr3 ) + IF( ibig3 < 1 .or. ibig3 > nr3 ) & + & CALL errore(' fft_box_set ',' ibig3 wrong ', ibig3 ) + ibig3 = ibig3 - ipp( desc%mype + 1 ) + IF ( ibig3 > 0 .and. ibig3 <= npp(desc%mype + 1) ) THEN + imin3 = min( imin3, ir3 ) + imax3 = max( imax3, ir3 ) + ENDIF + ENDDO + + desc%imin3( isa ) = imin3 + desc%imax3( isa ) = imax3 + desc%np3( isa ) = imax3 - imin3 + 1 + + ENDDO + + desc%have_task_groups = .false. + + END SUBROUTINE fft_box_set + + +!=----------------------------------------------------------------------------=! + + SUBROUTINE fft_dlay_scalar( desc, ub, lb, nr1, nr2, nr3, nr1x, nr2x, nr3x, stw ) + + IMPLICIT NONE + + TYPE (fft_dlay_descriptor) :: desc + INTEGER, INTENT(in) :: lb(:), ub(:) + INTEGER, INTENT(in) :: stw( lb(2) : ub(2), lb(3) : ub(3) ) + + INTEGER :: nr1, nr2, nr3, nr1x, nr2x, nr3x + INTEGER :: m1, m2, i2, i3 + + IF( size( desc%iplw ) < nr3x .or. size( desc%isind ) < nr2x * nr3x ) & + CALL errore(' fft_dlay_scalar ', ' wrong dimensions ', 1 ) + + desc%isind = 0 + desc%iplw = 0 + desc%iplp = 1 + desc%nr1 = nr1 + desc%nr2 = nr2 + desc%nr3 = nr3 + desc%nr1x = nr1x + desc%nr2x = nr2x + desc%nr3x = nr3x + + ! here we are setting parameter as if we were + ! in a serial code, sticks are along X dimension + ! and not along Z + + DO i2 = lb( 2 ), ub( 2 ) + DO i3 = lb( 3 ), ub( 3 ) + m1 = i2 + 1; IF ( m1 < 1 ) m1 = m1 + nr2 + m2 = i3 + 1; IF ( m2 < 1 ) m2 = m2 + nr3 + IF( stw( i2, i3 ) > 0 ) THEN + desc%isind( m1 + ( m2 - 1 ) * nr2x ) = 1 ! st( i1, i2 ) + desc%iplw( m2 ) = 1 + ENDIF + ENDDO + ENDDO + + desc%nnr = nr1x * nr2x * nr3x + desc%npl = nr3 + desc%nnp = nr1x * nr2x + desc%npp = nr3 + desc%ipp = 0 + desc%tg_nnr = desc%nnr + ! + desc%have_task_groups = .false. + + RETURN + END SUBROUTINE fft_dlay_scalar + + + +END MODULE fft_types diff --git a/tests/apps/miniDFT/tests/src/find_free_unit.f90 b/tests/apps/miniDFT/tests/src/find_free_unit.f90 new file mode 100644 index 0000000000..b1f3b971ad --- /dev/null +++ b/tests/apps/miniDFT/tests/src/find_free_unit.f90 @@ -0,0 +1,38 @@ +! +! Copyright (C) 2002-2009 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! + !-------------------------------------------------------------------------- + FUNCTION find_free_unit() + !-------------------------------------------------------------------------- + ! + IMPLICIT NONE + ! + INTEGER :: find_free_unit + INTEGER :: iunit + LOGICAL :: opnd + ! + ! + unit_loop: DO iunit = 99, 1, -1 + ! + INQUIRE( UNIT = iunit, OPENED = opnd ) + ! + IF ( .NOT. opnd ) THEN + ! + find_free_unit = iunit + ! + RETURN + ! + END IF + ! + END DO unit_loop + ! + CALL errore( 'find_free_unit()', 'free unit not found ?!?', 1 ) + ! + RETURN + ! + END FUNCTION find_free_unit + ! diff --git a/tests/apps/miniDFT/tests/src/flush_unit.f90 b/tests/apps/miniDFT/tests/src/flush_unit.f90 new file mode 100644 index 0000000000..12596983f1 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/flush_unit.f90 @@ -0,0 +1,28 @@ +! +! Copyright (C) 2005 PWSCF-FPMD-CPV groups +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +#if defined(__XLF) || defined(__ABSOFT) + #define flush flush_ +#endif +! +!---------------------------------------------------------------------------- +SUBROUTINE flush_unit( unit_tobeflushed ) + !---------------------------------------------------------------------------- + ! + ! ... this is a wrapper to the standard flush routine + ! + INTEGER, INTENT(IN) :: unit_tobeflushed + LOGICAL :: opnd + ! + ! + INQUIRE( UNIT = unit_tobeflushed, OPENED = opnd ) + ! + IF ( opnd ) CALL flush( unit_tobeflushed ) + ! + RETURN + ! +END SUBROUTINE diff --git a/tests/apps/miniDFT/tests/src/force_cc.f90 b/tests/apps/miniDFT/tests/src/force_cc.f90 new file mode 100644 index 0000000000..b0023f6e1c --- /dev/null +++ b/tests/apps/miniDFT/tests/src/force_cc.f90 @@ -0,0 +1,109 @@ +! +! Copyright (C) 2001-2007 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +!----------------------------------------------------------------------- +subroutine force_cc (forcecc) + !---------------------------------------------------------------------- + ! + USE kinds, ONLY : DP + USE constants, ONLY : tpi + USE atom, ONLY : rgrid + USE uspp_param, ONLY : upf + USE ions_base, ONLY : nat, ntyp => nsp, ityp, tau + USE cell_base, ONLY : alat, omega, tpiba, tpiba2 + USE fft_base, ONLY : dfftp + USE fft_interfaces, ONLY : fwfft + USE gvect, ONLY : ngm, gstart, nl, g, gg, ngl, gl, igtongl + USE ener, ONLY : etxc, vtxc + USE lsda_mod, ONLY : nspin + USE scf, ONLY : rho, rho_core, rhog_core + USE wavefunctions_module, ONLY : psic + USE mp_global, ONLY : intra_bgrp_comm + USE mp, ONLY : mp_sum + ! + implicit none + ! + ! first the dummy variable + ! + real(DP) :: forcecc (3, nat) + ! output: the local forces on atoms + + integer :: ipol, ig, ir, nt, na + ! counter on polarizations + ! counter on G vectors + ! counter on FFT grid points + ! counter on types of atoms + ! counter on atoms + + + real(DP), allocatable :: vxc (:,:), rhocg (:) + ! exchange-correlation potential + ! radial fourier trasform of rho core + real(DP) :: arg, fact + + ! + forcecc(:,:) = 0.d0 + if ( ANY ( upf(1:ntyp)%nlcc ) ) go to 15 + return + ! +15 continue + fact = 1.d0 + ! + ! recalculate the exchange-correlation potential + ! + allocate ( vxc(dfftp%nnr,nspin) ) + ! + call v_xc (rho, rho_core, rhog_core, etxc, vtxc, vxc) + ! + psic=(0.0_DP,0.0_DP) + if (nspin == 1 .or. nspin == 4) then + do ir = 1, dfftp%nnr + psic (ir) = vxc (ir, 1) + enddo + else + do ir = 1, dfftp%nnr + psic (ir) = 0.5d0 * (vxc (ir, 1) + vxc (ir, 2) ) + enddo + endif + deallocate (vxc) + CALL fwfft ('Dense', psic, dfftp) + ! + ! psic contains now Vxc(G) + ! + allocate ( rhocg(ngl) ) + ! + ! core correction term: sum on g of omega*ig*exp(-i*r_i*g)*n_core(g)*vxc + ! g = 0 term gives no contribution + ! + do nt = 1, ntyp + if ( upf(nt)%nlcc ) then + + call drhoc (ngl, gl, omega, tpiba2, rgrid(nt)%mesh, rgrid(nt)%r,& + rgrid(nt)%rab, upf(nt)%rho_atc, rhocg) + do na = 1, nat + if (nt.eq.ityp (na) ) then + do ig = gstart, ngm + arg = (g (1, ig) * tau (1, na) + g (2, ig) * tau (2, na) & + + g (3, ig) * tau (3, na) ) * tpi + do ipol = 1, 3 + forcecc (ipol, na) = forcecc (ipol, na) + tpiba * omega * & + rhocg (igtongl (ig) ) * CONJG(psic (nl (ig) ) ) * & + CMPLX( sin (arg), cos (arg) ,kind=DP) * g (ipol, ig) * fact + enddo + enddo + endif + enddo + endif + enddo + ! + call mp_sum( forcecc, intra_bgrp_comm ) + ! + deallocate (rhocg) + ! + return +end subroutine force_cc diff --git a/tests/apps/miniDFT/tests/src/force_corr.f90 b/tests/apps/miniDFT/tests/src/force_corr.f90 new file mode 100644 index 0000000000..94d53f7512 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/force_corr.f90 @@ -0,0 +1,102 @@ +! +! Copyright (C) 2001-2007 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +!----------------------------------------------------------------------- +subroutine force_corr (forcescc) + !----------------------------------------------------------------------- + ! This routine calculates the force term vanishing at full + ! self-consistency. It follows the suggestion of Chan-Bohnen-Ho + ! (PRB 47, 4771 (1993)). The true charge density is approximated + ! by means of a free atom superposition. + ! (alessio f.) + ! Uses superposition of atomic charges contained in the array rho_at + ! and read from pseudopotential files + ! + USE kinds, ONLY : DP + USE constants, ONLY : tpi + USE atom, ONLY : msh, rgrid + USE uspp_param, ONLY : upf + USE ions_base, ONLY : nat, ntyp => nsp, ityp, tau + USE cell_base, ONLY : tpiba + USE fft_base, ONLY : dfftp + USE fft_interfaces, ONLY : fwfft + USE gvect, ONLY : ngm, gstart, nl, g, ngl, gl, igtongl + USE lsda_mod, ONLY : nspin + USE scf, ONLY : vnew + USE wavefunctions_module, ONLY : psic + USE mp_global, ONLY : intra_bgrp_comm + USE mp, ONLY : mp_sum + ! + implicit none + ! + real(DP) :: forcescc (3, nat) + ! + real(DP), allocatable :: rhocgnt (:), aux (:) + ! work space + real(DP) :: gx, arg, fact + ! temp factors + integer :: ir, isup, isdw, ig, nt, na, ipol, ndm + ! counters + ! + ! vnew is V_out - V_in, psic is the temp space + ! + if (nspin == 1 .or. nspin == 4) then + psic(:) = vnew%of_r (:, 1) + else + isup = 1 + isdw = 2 + psic(:) = (vnew%of_r (:, isup) + vnew%of_r (:, isdw)) * 0.5d0 + end if + ! + ndm = MAXVAL ( msh(1:ntyp) ) + allocate ( aux(ndm), rhocgnt(ngl) ) + + forcescc(:,:) = 0.d0 + + CALL fwfft ('Dense', psic, dfftp) + + fact = 1.d0 + + do nt = 1, ntyp + ! + ! Here we compute the G.ne.0 term + ! + do ig = gstart, ngl + gx = sqrt (gl (ig) ) * tpiba + do ir = 1, msh (nt) + if (rgrid(nt)%r(ir) .lt.1.0d-8) then + aux (ir) = upf(nt)%rho_at (ir) + else + aux (ir) = upf(nt)%rho_at (ir) * & + sin(gx*rgrid(nt)%r(ir)) / (rgrid(nt)%r(ir)*gx) + endif + enddo + call simpson (msh (nt), aux, rgrid(nt)%rab, rhocgnt (ig) ) + enddo + do na = 1, nat + if (nt.eq.ityp (na) ) then + do ig = gstart, ngm + arg = (g (1, ig) * tau (1, na) + g (2, ig) * tau (2, na) & + + g (3, ig) * tau (3, na) ) * tpi + do ipol = 1, 3 + forcescc (ipol, na) = forcescc (ipol, na) + fact * & + rhocgnt (igtongl(ig) ) * CMPLX(sin(arg),cos(arg),kind=DP) * & + g(ipol,ig) * tpiba * CONJG(psic(nl(ig))) + enddo + enddo + endif + enddo + enddo + ! + call mp_sum( forcescc, intra_bgrp_comm ) + ! + deallocate ( aux, rhocgnt ) + + return +end subroutine force_corr + diff --git a/tests/apps/miniDFT/tests/src/force_ew.f90 b/tests/apps/miniDFT/tests/src/force_ew.f90 new file mode 100644 index 0000000000..2a94308ad2 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/force_ew.f90 @@ -0,0 +1,167 @@ +! +! Copyright (C) 2001-2009 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +!----------------------------------------------------------------------- +subroutine force_ew (alat, nat, ntyp, ityp, zv, at, bg, tau, & + omega, g, gg, ngm, gstart, gamma_only, gcutm, strf, forceion) + !----------------------------------------------------------------------- + ! + ! This routine computes the Ewald contribution to the forces, + ! both the real- and reciprocal-space terms are present + ! + USE kinds + USE constants, ONLY : tpi, e2 + USE mp_global, ONLY : intra_bgrp_comm + USE mp, ONLY : mp_sum + implicit none + ! + ! First the dummy variables + ! + + integer :: nat, ntyp, ngm, ityp (nat), gstart + ! input: the number of atoms + ! input: the number of types of atom + ! input: the number of G vectors + ! input: the type of each atom + ! input: first non-zero G vector + logical :: gamma_only + + real(DP) :: factor, tau (3, nat), g (3, ngm), gg (ngm), zv (ntyp), & + at (3, 3), bg (3, 3), omega, gcutm, alat + ! input: the coordinates of the atoms + ! input: the G vectors + ! input: the moduli of G vectors + ! input: the charge of the atoms + ! input: the direct lattice vectors + ! input: the reciprocal lattice vectors + ! input: the volume of the unit cell + ! input: cut-off of g vectors + ! input: the edge of the cell + ! + complex(DP) :: strf (ngm, ntyp) + ! input: the structure factor on the potential + ! + real(DP) :: forceion (3, nat) + ! output: the ewald part of the forces + ! + integer, parameter :: mxr=50 + ! the maximum number of R vectors + + integer :: ig, n, na, nb, nt, nrm, ipol + ! counter on G vectos + ! counter on r vectors + ! counter on atoms + ! counter on atoms + ! counter on atomic types + ! the number of R vectors for real space su + ! counter on polarization + + real(DP) :: sumnb, arg, tpiba2, alpha, dtau (3), r (3, mxr), & + r2 (mxr), rmax, rr, charge, upperbound, fact + ! auxiliary variable for speed + ! the argument of the exponential + ! 2 pi /alat + ! the alpha parameter + ! the difference of two tau + ! the position of the atoms in the shell + ! the square of r + ! the maximum r + ! the modulus of the r vectors + ! the total charge + ! used to determine alpha + + complex(DP), allocatable :: aux (:) + ! auxiliary space + real(DP), external :: qe_erfc + ! + forceion(:,:) = 0.d0 + tpiba2 = (tpi / alat) **2 + charge = 0.d0 + do na = 1, nat + charge = charge+zv (ityp (na) ) + enddo + ! + ! choose alpha in order to have convergence in the sum over G + ! upperbound is a safe upper bound for the error ON THE ENERGY + ! + alpha = 1.1d0 +10 alpha = alpha - 0.1d0 + if (alpha.eq.0.d0) call errore ('force_ew', 'optimal alpha not found', 1) + upperbound = e2 * charge**2 * sqrt (2.d0 * alpha / tpi) * & + qe_erfc ( sqrt (tpiba2 * gcutm / 4.d0 / alpha) ) + if (upperbound > 1.0d-6) goto 10 + ! + ! G-space sum here + ! + allocate(aux(ngm)) + aux(:) = (0.d0, 0.d0) + + do nt = 1, ntyp + do ig = gstart, ngm + aux (ig) = aux (ig) + zv (nt) * CONJG(strf (ig, nt) ) + enddo + enddo + do ig = gstart, ngm + aux (ig) = aux (ig) * exp ( - gg (ig) * tpiba2 / alpha / 4.d0) & + / (gg (ig) * tpiba2) + enddo + if (gamma_only) then + fact = 4.d0 + else + fact = 2.d0 + end if + do na = 1, nat + do ig = gstart, ngm + arg = tpi * (g (1, ig) * tau (1, na) + g (2, ig) * tau (2, na) & + + g (3, ig) * tau (3, na) ) + sumnb = cos (arg) * AIMAG (aux(ig)) - sin (arg) * DBLE (aux(ig) ) + forceion (1, na) = forceion (1, na) + g (1, ig) * sumnb + forceion (2, na) = forceion (2, na) + g (2, ig) * sumnb + forceion (3, na) = forceion (3, na) + g (3, ig) * sumnb + enddo + do ipol = 1, 3 + forceion (ipol, na) = - zv (ityp (na) ) * fact * e2 * tpi**2 / & + omega / alat * forceion (ipol, na) + enddo + enddo + deallocate (aux) + if (gstart == 1) goto 100 + ! + ! R-space sum here (only for the processor that contains G=0) + ! + rmax = 5.d0 / (sqrt (alpha) * alat) + ! + ! with this choice terms up to ZiZj*erfc(5) are counted (erfc(5)=2x10^-1 + ! + do na = 1, nat + do nb = 1, nat + if (nb.eq.na) goto 50 + dtau (:) = tau (:, na) - tau (:, nb) + ! + ! generates nearest-neighbors shells r(i)=R(i)-dtau(i) + ! + call rgen (dtau, rmax, mxr, at, bg, r, r2, nrm) + do n = 1, nrm + rr = sqrt (r2 (n) ) * alat + factor = zv (ityp (na) ) * zv (ityp (nb) ) * e2 / rr**2 * & + (qe_erfc (sqrt (alpha) * rr) / rr + & + sqrt (8.0d0 * alpha / tpi) * exp ( - alpha * rr**2) ) * alat + do ipol = 1, 3 + forceion (ipol, na) = forceion (ipol, na) - factor * r (ipol, n) + enddo + enddo +50 continue + enddo + enddo +100 continue + ! + CALL mp_sum( forceion, intra_bgrp_comm ) + ! + return +end subroutine force_ew + diff --git a/tests/apps/miniDFT/tests/src/force_lc.f90 b/tests/apps/miniDFT/tests/src/force_lc.f90 new file mode 100644 index 0000000000..7ea2a26927 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/force_lc.f90 @@ -0,0 +1,98 @@ +! +! Copyright (C) 2001-2011 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +!---------------------------------------------------------------------- +subroutine force_lc (nat, tau, ityp, alat, omega, ngm, ngl, & + igtongl, g, rho, nl, nspin, gstart, gamma_only, vloc, forcelc) + !---------------------------------------------------------------------- + ! + USE kinds + USE constants, ONLY : tpi + USE mp_global, ONLY : intra_bgrp_comm + USE mp, ONLY : mp_sum + USE fft_base, ONLY : dfftp + USE fft_interfaces, ONLY : fwfft + implicit none + ! + ! first the dummy variables + ! + integer, intent(in) :: nat, ngm, nspin, ngl, gstart, & + igtongl (ngm), nl (ngm), ityp (nat) + ! nat: number of atoms in the cell + ! ngm: number of G vectors + ! nspin: number of spin polarizations + ! ngl: number of shells + ! igtongl correspondence G <-> shell of G + ! nl: correspondence fft mesh <-> G vec + ! ityp: types of atoms + + logical, intent(in) :: gamma_only + + real(DP), intent(in) :: tau (3, nat), g (3, ngm), vloc (ngl, * ), & + rho (dfftp%nnr, nspin), alat, omega + ! tau: coordinates of the atoms + ! g: coordinates of G vectors + ! vloc: local potential + ! rho: valence charge + ! alat: lattice parameter + ! omega: unit cell volume + + real(DP), intent(out) :: forcelc (3, nat) + ! the local-potential contribution to forces on atoms + + integer :: ipol, ig, na + ! counter on polarizations + ! counter on G vectors + ! counter on atoms + + complex(DP), allocatable :: aux (:) + ! auxiliary space for FFT + real(DP) :: arg, fact + ! + ! contribution to the force from the local part of the bare potential + ! F_loc = Omega \Sum_G n*(G) d V_loc(G)/d R_i + ! + allocate (aux(dfftp%nnr)) + if ( nspin == 2) then + aux(:) = CMPLX( rho(:,1)+rho(:,2), 0.0_dp, kind=dp ) + else + aux(:) = CMPLX( rho(:,1), 0.0_dp, kind=dp ) + end if + CALL fwfft ('Dense', aux, dfftp) + ! + ! aux contains now n(G) + ! + if (gamma_only) then + fact = 2.d0 + else + fact = 1.d0 + end if + do na = 1, nat + do ipol = 1, 3 + forcelc (ipol, na) = 0.d0 + enddo + ! contribution from G=0 is zero + do ig = gstart, ngm + arg = (g (1, ig) * tau (1, na) + g (2, ig) * tau (2, na) + & + g (3, ig) * tau (3, na) ) * tpi + do ipol = 1, 3 + forcelc (ipol, na) = forcelc (ipol, na) + & + g (ipol, ig) * vloc (igtongl (ig), ityp (na) ) * & + (sin(arg)*DBLE(aux(nl(ig))) + cos(arg)*AIMAG(aux(nl(ig))) ) + enddo + enddo + do ipol = 1, 3 + forcelc (ipol, na) = fact * forcelc (ipol, na) * omega * tpi / alat + enddo + enddo + ! + call mp_sum( forcelc, intra_bgrp_comm ) + ! + deallocate (aux) + return +end subroutine force_lc diff --git a/tests/apps/miniDFT/tests/src/force_us.f90 b/tests/apps/miniDFT/tests/src/force_us.f90 new file mode 100644 index 0000000000..40f9aad512 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/force_us.f90 @@ -0,0 +1,182 @@ +! +! Copyright (C) 2001-2007 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +!---------------------------------------------------------------------------- +SUBROUTINE force_us( forcenl ) + !---------------------------------------------------------------------------- + ! + ! ... nonlocal potential contribution to forces + ! ... wrapper + ! + USE kinds, ONLY : DP + USE cell_base, ONLY : at, bg, tpiba + USE ions_base, ONLY : nat, ntyp => nsp, ityp + USE klist, ONLY : nks, xk, ngk + USE gvect, ONLY : g + USE uspp, ONLY : nkb, vkb, qq, deeq, qq_so, deeq_nc + USE uspp_param, ONLY : upf, nh, newpseudo, nhm + USE wvfct, ONLY : nbnd, npw, npwx, igk, wg, et + USE lsda_mod, ONLY : lsda, current_spin, isk, nspin + USE symme, ONLY : symvector + USE wavefunctions_module, ONLY : evc + USE spin_orb, ONLY : lspinorb + USE io_files, ONLY : iunwfc, nwordwfc, iunigk + USE buffers, ONLY : get_buffer + USE becmod, ONLY : bec_type, becp, allocate_bec_type, deallocate_bec_type + USE mp_global, ONLY : inter_pool_comm, intra_bgrp_comm + USE mp, ONLY : mp_sum, mp_get_comm_null + ! + IMPLICIT NONE + ! + ! ... the dummy variable + ! + REAL(DP) :: forcenl(3,nat) + ! output: the nonlocal contribution + ! + CALL allocate_bec_type ( nkb, nbnd, becp, intra_bgrp_comm ) + ! + ! + CALL force_us_k( forcenl ) + ! + ! + CALL deallocate_bec_type ( becp ) + ! + RETURN + ! + CONTAINS + ! + !----------------------------------------------------------------------- + ! + !----------------------------------------------------------------------- + SUBROUTINE force_us_k( forcenl ) + !----------------------------------------------------------------------- + ! + USE becmod, ONLY : calbec + IMPLICIT NONE + ! + REAL(DP) :: forcenl(3,nat) + COMPLEX(DP), ALLOCATABLE :: dbecp(:,:,:), dbecp_nc(:,:,:,:) + ! auxiliary variable contains and + COMPLEX(DP), ALLOCATABLE :: vkb1(:,:) + ! auxiliary variable contains g*|beta> + COMPLEX(DP) :: psc(2,2), fac + COMPLEX(DP), ALLOCATABLE :: deff_nc(:,:,:,:) + REAL(DP), ALLOCATABLE :: deff(:,:,:) + REAL(DP) :: ps + INTEGER :: ik, ipol, ibnd, ig, ih, jh, na, nt, ikb, jkb, ijkb0, & + is, js, ijs + ! counters + ! + ! + forcenl(:,:) = 0.D0 + ! + ALLOCATE( dbecp( nkb, nbnd, 3 ) ) + ALLOCATE( deff(nhm,nhm,nat) ) + ALLOCATE( vkb1( npwx, nkb ) ) + ! + ! BMA: eliminate filesystem activity for miniDFT + !IF ( nks > 1 ) REWIND iunigk + ! + ! ... the forces are a sum over the K points and the bands + ! + DO ik = 1, nks + IF ( lsda ) current_spin = isk(ik) + ! + npw = ngk(ik) + IF ( nks > 1 ) THEN + !READ( iunigk ) igk + !CALL get_buffer ( evc, nwordwfc, iunwfc, ik ) + IF ( nkb > 0 ) & + CALL init_us_2( npw, igk, xk(1,ik), vkb ) + END IF + ! + CALL calbec ( npw, vkb, evc, becp) + ! + DO ipol = 1, 3 + DO jkb = 1, nkb +!$OMP PARALLEL DO DEFAULT(SHARED) PRIVATE(ig) + DO ig = 1, npw + vkb1(ig,jkb) = vkb(ig,jkb)*(0.D0,-1.D0)*g(ipol,igk(ig)) + END DO +!$OMP END PARALLEL DO + END DO + ! + IF ( nkb > 0 ) & + CALL ZGEMM( 'C', 'N', nkb, nbnd, npw, ( 1.D0, 0.D0 ), & + vkb1, npwx, evc, npwx, ( 0.D0, 0.D0 ), & + dbecp(1,1,ipol), nkb ) + END DO + ! + DO ibnd = 1, nbnd + CALL compute_deff(deff,et(ibnd,ik)) + fac=wg(ibnd,ik)*tpiba + ijkb0 = 0 + DO nt = 1, ntyp + DO na = 1, nat + IF ( ityp(na) == nt ) THEN + DO ih = 1, nh(nt) + ikb = ijkb0 + ih + DO ipol=1,3 + forcenl(ipol,na) = forcenl(ipol,na) - & + 2.D0 * fac * deff(ih,ih,na)*& + DBLE( CONJG( dbecp(ikb,ibnd,ipol) ) * & + becp%k(ikb,ibnd) ) + END DO + ! + IF ( newpseudo(nt) ) THEN + ! + ! ... in US case there is a contribution for jh<>ih. + ! ... We use here the symmetry in the interchange + ! ... of ih and jh + ! + DO jh = ( ih + 1 ), nh(nt) + jkb = ijkb0 + jh + DO ipol = 1, 3 + forcenl(ipol,na) = forcenl (ipol,na) - & + 2.D0 * fac * deff(ih,jh,na)* & + DBLE( CONJG( dbecp(ikb,ibnd,ipol) ) * & + becp%k(jkb,ibnd) + & + dbecp(jkb,ibnd,ipol) * & + CONJG( becp%k(ikb,ibnd) ) ) + END DO + END DO !jh + END IF ! newpseudo(nt) + END DO ! ih = 1, nh(nt) + ijkb0 = ijkb0 + nh(nt) + END IF ! ityp(na) == nt + END DO ! nat + END DO ! ntyp + END DO ! nbnd + END DO ! nks + ! + CALL mp_sum( forcenl , intra_bgrp_comm ) + ! + DEALLOCATE( vkb1 ) + DEALLOCATE( dbecp ) + DEALLOCATE( deff ) + ! + ! ... The total D matrix depends on the ionic position via the + ! ... augmentation part \int V_eff Q dr, the term deriving from the + ! ... derivative of Q is added in the routine addusforce + ! + ! + ! + ! ... collect contributions across pools + ! + CALL mp_sum( forcenl, inter_pool_comm ) + ! + ! ... Since our summation over k points was only on the irreducible + ! ... BZ we have to symmetrize the forces. + ! + CALL symvector ( nat, forcenl ) + ! + RETURN + ! + END SUBROUTINE force_us_k + ! +END SUBROUTINE force_us diff --git a/tests/apps/miniDFT/tests/src/forces.f90 b/tests/apps/miniDFT/tests/src/forces.f90 new file mode 100644 index 0000000000..5ca140996d --- /dev/null +++ b/tests/apps/miniDFT/tests/src/forces.f90 @@ -0,0 +1,218 @@ +! +! Copyright (C) 2001-2011 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +!---------------------------------------------------------------------------- +SUBROUTINE forces() + !---------------------------------------------------------------------------- + ! + ! ... This routine is a driver routine which computes the forces + ! ... acting on the atoms. The complete expression of the forces + ! ... contains four parts which are computed by different routines: + ! + ! ... a) force_lc, local contribution to the forces + ! ... b) force_cc, contribution due to NLCC + ! ... c) force_ew, contribution due to the electrostatic ewald term + ! ... d) force_us, contribution due to the non-local potential + ! ... e) force_corr, correction term for incomplete self-consistency + ! ... f) force_hub, contribution due to the Hubbard term + ! ... g) force_london, semi-empirical correction for dispersion forces + ! + ! + USE kinds, ONLY : DP + USE io_global, ONLY : stdout + USE cell_base, ONLY : at, bg, alat, omega + USE ions_base, ONLY : nat, ntyp => nsp, ityp, tau, zv, amass, extfor + USE fft_base, ONLY : dfftp + USE gvect, ONLY : ngm, gstart, ngl, nl, igtongl, g, gg, gcutm + USE lsda_mod, ONLY : nspin + USE symme, ONLY : symvector + USE vlocal, ONLY : strf, vloc + USE force_mod, ONLY : force, lforce + USE scf, ONLY : rho + USE ions_base, ONLY : if_pos + USE extfield, ONLY : tefield, forcefield + USE control_flags, ONLY : remove_rigid_rot, textfor, iverbosity + ! + IMPLICIT NONE + ! + REAL(DP), ALLOCATABLE :: forcenl(:,:), & + forcelc(:,:), & + forcecc(:,:), & + forceion(:,:), & + force_disp(:,:),& + force_mt(:,:), & + forcescc(:,:), & + forces_bp_efield(:,:), & + forceh(:,:) + ! nonlocal, local, core-correction, ewald, scf correction terms, and hubbard + + REAL(DP) :: sumfor, sumscf, sum_mm + REAL(DP),PARAMETER :: eps = 1.e-12_dp + INTEGER :: ipol, na + ! counter on polarization + ! counter on atoms + ! + ! + CALL start_clock( 'forces' ) + ! + ALLOCATE( forcenl( 3, nat ), forcelc( 3, nat ), forcecc( 3, nat ), & + forceh( 3, nat ), forceion( 3, nat ), forcescc( 3, nat ) ) + ! + forcescc(:,:) = 0.D0 + forceh(:,:) = 0.D0 + ! + WRITE( stdout, '(/,5x,"Forces acting on atoms (Ry/au):", / )') + ! + ! ... The nonlocal contribution is computed here + ! + CALL force_us( forcenl ) + ! + ! ... The local contribution + ! + CALL force_lc( nat, tau, ityp, alat, omega, ngm, ngl, igtongl, & + g, rho%of_r, nl, nspin, gstart, .false., vloc, & + forcelc ) + ! + ! ... The NLCC contribution + ! + CALL force_cc( forcecc ) + ! + ! ... The Hubbard contribution + ! + ! + ! ... The ionic contribution is computed here + ! + CALL force_ew( alat, nat, ntyp, ityp, zv, at, bg, tau, omega, g, & + gg, ngm, gstart, .false., gcutm, strf, forceion ) + + ! + ! ... The SCF contribution + ! + CALL force_corr( forcescc ) + ! + ! + ! ... here we sum all the contributions and compute the total force acting + ! ... on the crstal + ! + DO ipol = 1, 3 + ! + sumfor = 0.D0 + ! + DO na = 1, nat + ! + force(ipol,na) = forcenl(ipol,na) + & + forceion(ipol,na) + & + forcelc(ipol,na) + & + forcecc(ipol,na) + & + forceh(ipol,na) + & + forcescc(ipol,na) + ! + IF ( tefield ) force(ipol,na) = force(ipol,na) + forcefield(ipol,na) +! DCC +! IF (do_comp) force(ipol,na) = force(ipol,na) + force_vcorr(ipol,na) + + sumfor = sumfor + force(ipol,na) + ! + END DO + ! + ! ... impose total force = 0 + ! + DO na = 1, nat + ! + force(ipol,na) = force(ipol,na) - sumfor / DBLE( nat ) + ! + END DO + ! + ! + END DO + ! + ! ... resymmetrize (should not be needed, but ...) + ! + CALL symvector ( nat, force ) + ! + IF ( remove_rigid_rot ) & + CALL remove_tot_torque( nat, tau, amass(ityp(:)), force ) + ! + IF( textfor ) force(:,:) = force(:,:) + extfor(:,:) + ! + ! + ! ... write on output the forces + ! + DO na = 1, nat + ! + WRITE( stdout, 9035) na, ityp(na), force(:,na) + ! + END DO + ! + ! ... forces on fixed coordinates are set to zero ( C.S. 15/10/2003 ) + ! + force(:,:) = force(:,:) * DBLE( if_pos ) + forcescc(:,:) = forcescc(:,:) * DBLE( if_pos ) + ! + IF ( iverbosity > 0 ) THEN + ! + WRITE( stdout, '(5x,"The non-local contrib. to forces")') + DO na = 1, nat + WRITE( stdout, 9035) na, ityp(na), ( forcenl(ipol,na), ipol = 1, 3 ) + END DO + WRITE( stdout, '(5x,"The ionic contribution to forces")') + DO na = 1, nat + WRITE( stdout, 9035) na, ityp(na), ( forceion(ipol,na), ipol = 1, 3 ) + END DO + WRITE( stdout, '(5x,"The local contribution to forces")') + DO na = 1, nat + WRITE( stdout, 9035) na, ityp(na), ( forcelc(ipol,na), ipol = 1, 3 ) + END DO + WRITE( stdout, '(5x,"The core correction contribution to forces")') + DO na = 1, nat + WRITE( stdout, 9035) na, ityp(na), ( forcecc(ipol,na), ipol = 1, 3 ) + END DO + WRITE( stdout, '(5x,"The Hubbard contrib. to forces")') + DO na = 1, nat + WRITE( stdout, 9035) na, ityp(na), ( forceh(ipol,na), ipol = 1, 3 ) + END DO + WRITE( stdout, '(5x,"The SCF correction term to forces")') + DO na = 1, nat + WRITE( stdout, 9035) na, ityp(na), ( forcescc(ipol,na), ipol = 1, 3 ) + END DO + ! + END IF + ! + sumfor = 0.D0 + sumscf = 0.D0 + ! + DO na = 1, nat + ! + sumfor = sumfor + force(1,na)**2 + force(2,na)**2 + force(3,na)**2 + sumscf = sumscf + forcescc(1,na)**2 + forcescc(2,na)**2+ forcescc(3,na)**2 + ! + END DO + ! + sumfor = SQRT( sumfor ) + sumscf = SQRT( sumscf ) + ! + WRITE( stdout, '(/5x,"Total force = ",F12.6,5X, & + & "Total SCF correction = ",F12.6)') sumfor, sumscf + ! + ! + DEALLOCATE( forcenl, forcelc, forcecc, forceh, forceion, forcescc ) + ! + lforce = .TRUE. + ! + CALL stop_clock( 'forces' ) + ! + IF ( ( sumfor < 10.D0*sumscf ) .AND. ( sumfor > eps ) ) & + WRITE( stdout,'(5x,"SCF correction compared to forces is large: ", & + & "reduce conv_thr to get better values")') + ! + + RETURN + ! +9035 FORMAT(5X,'atom ',I4,' type ',I2,' force = ',3F14.8) + ! +END SUBROUTINE forces diff --git a/tests/apps/miniDFT/tests/src/funct.f90 b/tests/apps/miniDFT/tests/src/funct.f90 new file mode 100644 index 0000000000..b0e9a4fa57 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/funct.f90 @@ -0,0 +1,1055 @@ +! +! Copyright (C) 2004-2011 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +!------------------------------------------------------------------- +module funct +!------------------------------------------------------------------- +! This module contains data defining the DFT functional in use +! and a number of functions and subroutines to manage them. +! Data are PRIVATE and are accessed and set only by function calls. +! Basic drivers to compute XC quantities are also included. +! +! setting routines: set_dft_from_name (previously which_dft) +! set_dft_from_indices +! enforce_input_dft +! start_exx +! stop_exx +! set_finite_size_volume +! retrieve functions: get_dft_name +! get_iexch +! get_icorr +! get_igcx +! get_igcc +! get_exx_fraction +! dft_name +! write_dft_name +! logical functions: dft_is_gradient +! dft_is_meta +! dft_is_hybrid +! dft_is_nonlocc +! exx_is_active +! dft_has_finite_size_correction +! +! XC computation drivers: xc, xc_spin, gcxc, gcx_spin, gcc_spin, gcc_spin_more +! derivatives of XC computation drivers: dmxc, dmxc_spin, dmxc_nc, dgcxc, +! dgcxc_spin +! + USE io_global, ONLY: stdout + USE kinds, ONLY: DP + IMPLICIT NONE + PRIVATE + SAVE + ! subroutines/functions managing dft name and indices + PUBLIC :: set_dft_from_indices, set_dft_from_name + PUBLIC :: enforce_input_dft, write_dft_name, dft_name + PUBLIC :: get_dft_name, get_iexch, get_icorr, get_igcx, get_igcc, get_inlc + PUBLIC :: dft_is_gradient + + ! additional subroutines/functions for hybrid functionals + ! additional subroutines/functions for finite size corrections + ! driver subroutines computing XC + PUBLIC :: xc, xc_spin, gcxc, gcx_spin, gcc_spin + PUBLIC :: dmxc, dmxc_spin + PUBLIC :: dgcxc, dgcxc_spin + ! + ! PRIVATE variables defining the DFT functional + ! + PRIVATE :: dft, dft_shortname, iexch, icorr, igcx, igcc, inlc + PRIVATE :: discard_input_dft + PRIVATE :: isgradient, ismeta, ishybrid + PRIVATE :: exx_fraction, exx_started + PRIVATE :: has_finite_size_correction, & + finite_size_cell_volume, finite_size_cell_volume_set + ! + character (len=25) :: dft = 'not set' + character (len=6) :: dft_shortname = ' ' + ! + ! dft is the exchange-correlation functional, described by + ! one of the following keywords ("dft_shortname"): + ! "pz" = "sla+pz" = Perdew-Zunger LDA + ! "pbe" = "sla+pw+pbx+pbc" = PBE + ! References: + ! pz J.P.Perdew and A.Zunger, PRB 23, 5048 (1981) + ! pbe J.P.Perdew, K.Burke, M.Ernzerhof, PRL 77, 3865 (1996) + ! + integer, parameter:: notset = -1 + ! + integer :: iexch = notset + integer :: icorr = notset + integer :: igcx = notset + integer :: igcc = notset + integer :: inlc = notset + real(DP):: exx_fraction = 0.0_DP + real(DP):: screening_parameter = 0.0_DP + logical :: isgradient = .false. + logical :: ismeta = .false. + logical :: ishybrid = .false. + logical :: exx_started = .false. + logical :: has_finite_size_correction = .false. + logical :: finite_size_cell_volume_set = .false. + real(DP):: finite_size_cell_volume = notset + + logical :: isnonlocc = .false. + + logical :: discard_input_dft = .false. + ! + ! internal indices for exchange-correlation + ! iexch: type of exchange + ! icorr: type of correlation + ! igcx: type of gradient correction on exchange + ! igcc: type of gradient correction on correlation + ! inlc: type of non local correction on correlation + ! + ! ismeta: .TRUE. if gradient correction is of meta-gga type + ! ishybrid: .TRUE. if the xc functional is an HF+DFT hybrid like + ! PBE0, B3LYP, HSE or HF itself + ! + ! see comments above and routine "set_dft_from_name" below + ! + ! data + integer :: nxc, ncc, ngcx, ngcc, ncnl + + parameter (nxc = 8, ncc =11, ngcx =16, ngcc = 10, ncnl=2) + + character (len=4) :: exc, corr + character (len=4) :: gradx, gradc, nonlocc + dimension exc (0:nxc), corr (0:ncc), gradx (0:ngcx), gradc (0: ngcc), nonlocc (0: ncnl) + + data exc / 'NOX', 'SLA', 'SL1', 'RXC', 'OEP', 'HF', 'PB0X', 'B3LP', 'KZK' / + data corr / 'NOC', 'PZ', 'VWN', 'LYP', 'PW', 'WIG', 'HL', 'OBZ', & + 'OBW', 'GL' , 'B3LP', 'KZK' / + data gradx / 'NOGX', 'B88', 'GGX', 'PBX', 'RPB', 'HCTH', 'OPTX',& + 'META', 'PB0X', 'B3LP','PSX', 'WCX', 'HSE', 'RW86', 'PBE', & + 'TPSS', 'C09X' / + + data gradc / 'NOGC', 'P86', 'GGC', 'BLYP', 'PBC', 'HCTH', 'META',& + 'B3LP', 'PSC', 'PBE', 'TPSS' / + + data nonlocc / ' ', 'VDW1', 'VDW2' / + +CONTAINS + !----------------------------------------------------------------------- + subroutine set_dft_from_name( dft_ ) + !----------------------------------------------------------------------- + ! + ! translates a string containing the exchange-correlation name + ! into internal indices iexch, icorr, igcx, igcc + ! + implicit none + ! input + character(len=*) :: dft_ + ! local + integer :: len, l, i + character (len=50):: dftout + logical :: dft_defined = .false. + logical, external :: matches + character (len=1), external :: capital + integer :: save_iexch, save_icorr, save_igcx, save_igcc, save_inlc + + ! + ! + ! Exit if discard_input_dft + ! + if ( discard_input_dft ) return + ! + ! save current status of XC indices + ! + save_iexch = iexch + save_icorr = icorr + save_igcx = igcx + save_igcc = igcc + save_inlc = inlc + ! + ! convert to uppercase + ! + len = len_trim(dft_) + dftout = ' ' + do l = 1, len + dftout (l:l) = capital (dft_(l:l) ) + enddo + ! + ! ---------------------------------------------- + ! FIRST WE CHECK ALL THE SPECIAL NAMES + ! Note: comparison is now done via exact matching + ! not using function "matches" + ! ---------------------------------------------- + ! + if ('PBE' .EQ. TRIM(dftout) ) then + ! special case : PBE + call set_dft_value (iexch,1) !Default + call set_dft_value (icorr,4) + call set_dft_value (igcx, 3) + call set_dft_value (igcc, 4) + call set_dft_value (inlc,0) !Default + dft_defined = .true. + + + ! special cases : PZ (LDA is equivalent to PZ) + else IF (('PZ' .EQ. TRIM(dftout) ).OR.('LDA' .EQ. TRIM(dftout) )) THEN + call set_dft_value (iexch,1) + call set_dft_value (icorr, 1) + CALL set_dft_value( igcx, 0) + call set_dft_value (igcc, 0) + call set_dft_value (inlc,0) + dft_defined = .true. + + else + + call errore('set_dft_from_name','only LDA and PZ functionals are supported in mini_DFT',1) + + END IF + + ! + ! Fill variables and exit + ! + dft = dftout + + dftout = exc (iexch) //'-'//corr (icorr) //'-'//gradx (igcx) //'-' & + &//gradc (igcc) //'-'// nonlocc(inlc) + + + call set_auxiliary_flags + ! + ! check dft has not been previously set differently + ! + if (save_iexch .ne. notset .and. save_iexch .ne. iexch) then + write (stdout,*) iexch, save_iexch + call errore('set_dft_from_name',' conflicting values for iexch',1) + end if + if (save_icorr .ne. notset .and. save_icorr .ne. icorr) then + write (stdout,*) icorr, save_icorr + call errore('set_dft_from_name',' conflicting values for icorr',1) + end if + if (save_igcx .ne. notset .and. save_igcx .ne. igcx) then + write (stdout,*) igcx, save_igcx + call errore('set_dft_from_name',' conflicting values for igcx',1) + end if + if (save_igcc .ne. notset .and. save_igcc .ne. igcc) then + write (stdout,*) igcc, save_igcc + call errore('set_dft_from_name',' conflicting values for igcc',1) + end if + if (save_inlc .ne. notset .and. save_inlc .ne. inlc) then + write (stdout,*) inlc, save_inlc + call errore('set_dft_from_name',' conflicting values for inlc',1) + end if + + return + end subroutine set_dft_from_name + ! + !----------------------------------------------------------------------- + subroutine set_auxiliary_flags + !----------------------------------------------------------------------- + ! set logical flags describing the complexity of the xc functional + ! define the fraction of exact exchange used by hybrid fuctionals + ! + logical, external :: matches + + !! Reversed as before VDW + isgradient = ( (igcx > 0) .or. ( igcc > 0) ) + + isnonlocc = (inlc > 0) + + ismeta = (igcx == 7) + + ishybrid = ( exx_fraction /= 0.0_DP ) + + has_finite_size_correction = ( iexch==8 .or. icorr==11) + + return + end subroutine set_auxiliary_flags + ! + !----------------------------------------------------------------------- + subroutine set_dft_value (m, i) + !----------------------------------------------------------------------- + ! + implicit none + integer :: m, i + ! local + + if ( m /= notset .and. m /= i) then + write(*, '(A,2I4)') "parameters", m, i + call errore ('set_dft_value', 'two conflicting matching values', 1) + end if + m = i + return + + end subroutine set_dft_value + + !----------------------------------------------------------------------- + subroutine enforce_input_dft (dft_, nomsg) + ! + ! translates a string containing the exchange-correlation name + ! into internal indices and force any subsequent call to set_dft_from_name + ! to return without changing them + ! + implicit none + character(len=*), intent(in) :: dft_ + logical, intent(in), optional :: nomsg + + call set_dft_from_name (dft_) + if (dft == 'not set') call errore('enforce_input_dft','cannot fix unset dft',1) + discard_input_dft = .true. + + if ( present (nomsg) ) return + + write (stdout,'(/,5x,a)') "IMPORTANT: XC functional enforced from input :" + call write_dft_name + write (stdout,'(5x,a)') "Any further DFT definition will be discarded" + write (stdout,'(5x,a/)') "Please, verify this is what you really want" + + return + end subroutine enforce_input_dft + + !----------------------------------------------------------------------- + function get_iexch () + integer get_iexch + get_iexch = iexch + return + end function get_iexch + !----------------------------------------------------------------------- + function get_icorr () + integer get_icorr + get_icorr = icorr + return + end function get_icorr + !----------------------------------------------------------------------- + function get_igcx () + integer get_igcx + get_igcx = igcx + return + end function get_igcx + !----------------------------------------------------------------------- + function get_igcc () + integer get_igcc + get_igcc = igcc + return + end function get_igcc + !----------------------------------------------------------------------- + function get_inlc () + integer get_inlc + get_inlc = inlc + return + end function get_inlc + function get_dft_name () + character (len=25) :: get_dft_name + get_dft_name = dft + return + end function get_dft_name + !----------------------------------------------------------------------- + function dft_is_gradient () + logical :: dft_is_gradient + dft_is_gradient = isgradient + return + end function dft_is_gradient + + !----------------------------------------------------------------------- + subroutine set_dft_from_indices(iexch_,icorr_,igcx_,igcc_, inlc_) + integer :: iexch_, icorr_, igcx_, igcc_, inlc_ + if ( discard_input_dft ) return + if (iexch == notset) iexch = iexch_ + if (iexch /= iexch_) then + write (stdout,*) iexch, iexch_ + call errore('set_dft',' conflicting values for iexch',1) + end if + if (icorr == notset) icorr = icorr_ + if (icorr /= icorr_) then + write (stdout,*) icorr, icorr_ + call errore('set_dft',' conflicting values for icorr',1) + end if + if (igcx == notset) igcx = igcx_ + if (igcx /= igcx_) then + write (stdout,*) igcx, igcx_ + call errore('set_dft',' conflicting values for igcx',1) + end if + if (igcc == notset) igcc = igcc_ + if (igcc /= igcc_) then + write (stdout,*) igcc, igcc_ + call errore('set_dft',' conflicting values for igcc',1) + end if + if (inlc == notset) inlc = inlc_ + if (inlc /= inlc_) then + write (stdout,*) inlc, inlc_ + call errore('set_dft',' conflicting values for inlc',1) + end if + dft = exc (iexch) //'-'//corr (icorr) //'-'//gradx (igcx) //'-' & + &//gradc (igcc)//'-'//nonlocc (inlc) + ! WRITE( stdout,'(a)') dft + call set_auxiliary_flags + return + end subroutine set_dft_from_indices + !--------------------------------------------------------------------- + subroutine dft_name(iexch_, icorr_, igcx_, igcc_, inlc_, longname_, shortname_) + !--------------------------------------------------------------------- + ! convert the four indices iexch, icorr, igcx, igcc + ! into user-readable strings + ! + implicit none + integer iexch_, icorr_, igcx_, igcc_, inlc_ + character (len=6) :: shortname_ + character (len=25):: longname_ + ! + if (iexch_==1.and.igcx_==0.and.igcc_==0) then + shortname_ = corr(icorr_) + else if (iexch_==1.and.icorr_==4.and.igcx_==3.and.igcc_==4) then + shortname_ = 'PBE' + else + shortname_ = ' ' + end if + write(longname_,'(5a5)') exc(iexch_),corr(icorr_),gradx(igcx_),gradc(igcc_),nonlocc(inlc_) + + return +end subroutine dft_name + +subroutine write_dft_name +!----------------------------------------------------------------------- + WRITE( stdout, '(5X,"Exchange-correlation = ",A, & + & " (",5I2,")")') TRIM( dft ), iexch, icorr, igcx, igcc, inlc + return +end subroutine write_dft_name + +! +!----------------------------------------------------------------------- +!------- LDA DRIVERS -------------------------------------------------- +!----------------------------------------------------------------------- +! +!----------------------------------------------------------------------- +subroutine xc (rho, ex, ec, vx, vc) + !----------------------------------------------------------------------- + ! lda exchange and correlation functionals - Hartree a.u. + ! + ! exchange : Slater, relativistic Slater + ! correlation: Ceperley-Alder (Perdew-Zunger parameters) + ! + ! input : rho=rho(r) + ! definitions: E_x = \int E_x(rho) dr, E_x(rho) = rho\epsilon_c(rho) + ! same for correlation + ! output: ex = \epsilon_x(rho) ( NOT E_x(rho) ) + ! vx = dE_x(rho)/drho ( NOT d\epsilon_x(rho)/drho ) + ! ec, vc as above for correlation + ! + implicit none + + real(DP) :: rho, ec, vc, ex, vx + ! + real(DP), parameter :: small = 1.E-10_DP, third = 1.0_DP / 3.0_DP, & + pi34 = 0.6203504908994_DP ! pi34=(3/4pi)^(1/3) + real(DP) :: rs + ! + if (rho <= small) then + ec = 0.0_DP + vc = 0.0_DP + ex = 0.0_DP + vx = 0.0_DP + return + else + rs = pi34 / rho**third + ! rs as in the theory of metals: rs=(3/(4pi rho))^(1/3) + endif + !..exchange + if (iexch == 1) THEN ! 'sla' + call slater (rs, ex, vx) + else + ex = 0.0_DP + vx = 0.0_DP + endif + !..correlation + if (icorr == 1) then + call pz (rs, 1, ec, vc) + elseif (icorr == 4) then + call pw (rs, 1, ec, vc) + else + ec = 0.0_DP + vc = 0.0_DP + endif + ! + return +end subroutine xc +!!!!!!!!!!!!!!SPIN +!----------------------------------------------------------------------- +subroutine xc_spin (rho, zeta, ex, ec, vxup, vxdw, vcup, vcdw) + !----------------------------------------------------------------------- + ! lsd exchange and correlation functionals - Hartree a.u. + ! + ! exchange : Slater (alpha=2/3) + ! correlation: Ceperley & Alder (Perdew-Zunger parameters) + ! Perdew & Wang + ! + ! input : rho = rhoup(r)+rhodw(r) + ! zeta=(rhoup(r)-rhodw(r))/rho + ! + implicit none + + real(DP) :: rho, zeta, ex, ec, vxup, vxdw, vcup, vcdw + ! + real(DP), parameter :: small= 1.E-10_DP, third = 1.0_DP/3.0_DP, & + pi34= 0.6203504908994_DP ! pi34=(3/4pi)^(1/3) + real(DP) :: rs + ! + if (rho <= small) then + ec = 0.0_DP + vcup = 0.0_DP + vcdw = 0.0_DP + ex = 0.0_DP + vxup = 0.0_DP + vxdw = 0.0_DP + return + else + rs = pi34 / rho**third + endif + !..exchange + IF (iexch == 1) THEN ! 'sla' + call slater_spin (rho, zeta, ex, vxup, vxdw) + ELSE + ex = 0.0_DP + vxup = 0.0_DP + vxdw = 0.0_DP + ENDIF + !..correlation +if (icorr == 1) then + call pz_spin (rs, zeta, ec, vcup, vcdw) + elseif (icorr == 4) then + call pw_spin (rs, zeta, ec, vcup, vcdw) + else + call errore ('lsda_functional (xc_spin)', 'not implemented', icorr) + endif + ! + return +end subroutine xc_spin +! +!----------------------------------------------------------------------- +! +!----------------------------------------------------------------------- +!------- GRADIENT CORRECTIONS DRIVERS ---------------------------------- +!----------------------------------------------------------------------- +! +!----------------------------------------------------------------------- +subroutine gcxc (rho, grho, sx, sc, v1x, v2x, v1c, v2c) + !----------------------------------------------------------------------- + ! gradient corrections for exchange and correlation - Hartree a.u. + ! See comments at the beginning of module for implemented cases + ! + ! input: rho, grho=|\nabla rho|^2 + ! definition: E_x = \int E_x(rho,grho) dr + ! output: sx = E_x(rho,grho) + ! v1x= D(E_x)/D(rho) + ! v2x= D(E_x)/D( D rho/D r_alpha ) / |\nabla rho| + ! sc, v1c, v2c as above for correlation + ! + implicit none + + real(DP) :: rho, grho, sx, sc, v1x, v2x, v1c, v2c + real(DP) :: sxsr, v1xsr, v2xsr + real(DP), parameter:: small = 1.E-10_DP + + ! exchange + if (rho <= small) then + sx = 0.0_DP + v1x = 0.0_DP + v2x = 0.0_DP + elseif (igcx == 3) then + call pbex (rho, grho, 1, sx, v1x, v2x) + else + sx = 0.0_DP + v1x = 0.0_DP + v2x = 0.0_DP + endif + ! correlation + if (rho.le.small) then + sc = 0.0_DP + v1c = 0.0_DP + v2c = 0.0_DP + elseif (igcc == 4) then + call pbec (rho, grho, 1, sc, v1c, v2c) + else + sc = 0.0_DP + v1c = 0.0_DP + v2c = 0.0_DP + endif + ! + return +end subroutine gcxc +! +!!!!!!!!!!!!!!SPIN +!----------------------------------------------------------------------- +subroutine gcx_spin (rhoup, rhodw, grhoup2, grhodw2, & + sx, v1xup, v1xdw, v2xup, v2xdw) + !----------------------------------------------------------------------- + ! gradient corrections for exchange - Hartree a.u. + ! + implicit none + ! + ! dummy arguments + ! + real(DP) :: rhoup, rhodw, grhoup2, grhodw2, sx, v1xup, v1xdw, & + v2xup, v2xdw + ! up and down charge + ! up and down gradient of the charge + ! exchange and correlation energies + ! derivatives of exchange wr. rho + ! derivatives of exchange wr. grho + ! + real(DP) :: sxsr, v1xupsr, v2xupsr, v1xdwsr, v2xdwsr + real(DP), parameter :: small = 1.E-10_DP + real(DP) :: rho, sxup, sxdw + integer :: iflag + ! + ! + ! exchange + rho = rhoup + rhodw + if (rho <= small .or. igcx == 0) then + sx = 0.0_DP + v1xup = 0.0_DP + v2xup = 0.0_DP + v1xdw = 0.0_DP + v2xdw = 0.0_DP + elseif (igcx == 3 .or. igcx == 4 .or. igcx == 8 .or. & + igcx == 10 .or. igcx == 12) then + ! igcx=3: PBE, igcx=4: revised PBE, igcx=8 PBE0, igcx=10: PBEsol + ! igcx=12: HSE + if (rhoup > small .and. sqrt (abs (grhoup2) ) > small) then + call pbex (2.0_DP * rhoup, 4.0_DP * grhoup2, iflag, sxup, v1xup, v2xup) + else + sxup = 0.0_DP + v1xup = 0.0_DP + v2xup = 0.0_DP + endif + if (rhodw > small .and. sqrt (abs (grhodw2) ) > small) then + call pbex (2.0_DP * rhodw, 4.0_DP * grhodw2, iflag, sxdw, v1xdw, v2xdw) + else + sxdw = 0.0_DP + v1xdw = 0.0_DP + v2xdw = 0.0_DP + endif + sx = 0.5_DP * (sxup + sxdw) + v2xup = 2.0_DP * v2xup + v2xdw = 2.0_DP * v2xdw + if (igcx == 8 .and. exx_started ) then + sx = (1.0_DP - exx_fraction) * sx + v1xup = (1.0_DP - exx_fraction) * v1xup + v1xdw = (1.0_DP - exx_fraction) * v1xdw + v2xup = (1.0_DP - exx_fraction) * v2xup + v2xdw = (1.0_DP - exx_fraction) * v2xdw + end if + else + call errore ('gcx_spin', 'not implemented', igcx) + endif + ! + return +end subroutine gcx_spin +! +!----------------------------------------------------------------------- +! +!----------------------------------------------------------------------- +subroutine gcc_spin (rho, zeta, grho, sc, v1cup, v1cdw, v2c) + !----------------------------------------------------------------------- + ! gradient corrections for correlations - Hartree a.u. + ! Implemented: Perdew86, GGA (PW91), PBE + ! + implicit none + ! + ! dummy arguments + ! + real(DP) :: rho, zeta, grho, sc, v1cup, v1cdw, v2c + ! the total charge + ! the magnetization + ! the gradient of the charge squared + ! exchange and correlation energies + ! derivatives of correlation wr. rho + ! derivatives of correlation wr. grho + + real(DP), parameter :: small = 1.E-10_DP, epsr=1.E-6_DP + ! + ! + if ( abs(zeta) > 1.0_DP ) then + sc = 0.0_DP + v1cup = 0.0_DP + v1cdw = 0.0_DP + v2c = 0.0_DP + return + else + ! + ! ... ( - 1.0 + epsr ) < zeta < ( 1.0 - epsr ) + zeta = SIGN( MIN( ABS( zeta ), ( 1.0_DP - epsr ) ) , zeta ) + endif + + if (igcc == 0 .or. rho <= small .or. sqrt(abs(grho)) <= small) then + sc = 0.0_DP + v1cup = 0.0_DP + v1cdw = 0.0_DP + v2c = 0.0_DP + elseif (igcc == 4) then + call pbec_spin (rho, zeta, grho, 1, sc, v1cup, v1cdw, v2c) + else + call errore ('lsda_functionals (gcc_spin)', 'not implemented', igcc) + endif + ! + return +end subroutine gcc_spin + +!----------------------------------------------------------------------- +!------- DRIVERS FOR DERIVATIVES OF XC POTENTIAL ----------------------- +!----------------------------------------------------------------------- +! + !----------------------------------------------------------------------- + function dmxc (rho) + !----------------------------------------------------------------------- + ! + ! derivative of the xc potential with respect to the local density + ! + ! + implicit none + ! + real(DP), intent(in) :: rho + ! input: the charge density ( positive ) + real(DP) :: dmxc + ! output: the derivative of the xc potential + ! + ! local variables + ! + real(DP) :: dr, vxp, vcp, vxm, vcm, vx, ex, ec, rs + real(DP), external :: dpz + integer :: iflg + ! + real(DP), parameter :: small = 1.E-30_DP, e2 = 2.0_DP, & + pi34 = 0.75_DP / 3.141592653589793_DP, third = 1.0_DP /3.0_DP + ! + dmxc = 0.0_DP + if (rho < small) then + return + endif + ! + ! first case: analytical derivatives available + ! + if (get_iexch() == 1 .and. get_icorr() == 1) then + rs = (pi34 / rho) **third + !..exchange + call slater (rs, ex, vx) + dmxc = vx / (3.0_DP * rho) + !..correlation + iflg = 2 + if (rs < 1.0_DP) iflg = 1 + dmxc = dmxc + dpz (rs, iflg) + else + ! + ! second case: numerical derivatives + ! + dr = min (1.E-6_DP, 1.E-4_DP * rho) + call xc (rho + dr, ex, ec, vxp, vcp) + call xc (rho - dr, ex, ec, vxm, vcm) + dmxc = (vxp + vcp - vxm - vcm) / (2.0_DP * dr) + endif + ! + ! bring to rydberg units + ! + dmxc = e2 * dmxc + return + ! + end function dmxc + ! + !----------------------------------------------------------------------- + subroutine dmxc_spin (rhoup, rhodw, dmuxc_uu, dmuxc_ud, dmuxc_du, & + dmuxc_dd) + !----------------------------------------------------------------------- + ! derivative of the xc potential with respect to the local density + ! spin-polarized case + ! + implicit none + ! + real(DP), intent(in) :: rhoup, rhodw + ! input: spin-up and spin-down charge density + real(DP), intent(out) :: dmuxc_uu, dmuxc_ud, dmuxc_du, dmuxc_dd + ! output: up-up, up-down, down-up, down-down derivatives of the + ! XC functional + ! + ! local variables + ! + real(DP) :: rhotot, rs, zeta, fz, fz1, fz2, ex, vx, ecu, ecp, vcu, & + vcp, dmcu, dmcp, aa, bb, cc, dr, dz, ec, vxupm, vxdwm, vcupm, & + vcdwm, rho, vxupp, vxdwp, vcupp, vcdwp, zeta_eff + real(DP), external :: dpz, dpz_polarized + integer :: iflg + ! + real(DP), parameter :: small = 1.E-30_DP, e2 = 2.0_DP, & + pi34 = 0.75_DP / 3.141592653589793_DP, third = 1.0_DP/3.0_DP, & + p43 = 4.0_DP / 3.0_DP, p49 = 4.0_DP / 9.0_DP, m23 = -2.0_DP / 3.0_DP + ! + dmuxc_uu = 0.0_DP + dmuxc_du = 0.0_DP + dmuxc_ud = 0.0_DP + dmuxc_dd = 0.0_DP + ! + rhotot = rhoup + rhodw + if (rhotot <= small) return + zeta = (rhoup - rhodw) / rhotot + + if (abs (zeta) > 1.0_DP) return + if (get_iexch() == 1 .and. get_icorr() == 1) then + ! + ! first case: analytical derivative available + ! + !..exchange + rs = (pi34 / (2.0_DP * rhoup) ) **third + call slater (rs, ex, vx) + dmuxc_uu = vx / (3.0_DP * rhoup) + rs = (pi34 / (2.0_DP * rhodw) ) **third + call slater (rs, ex, vx) + dmuxc_dd = vx / (3.0_DP * rhodw) + !..correlation + rs = (pi34 / rhotot) **third + iflg = 2 + if (rs < 1.0_DP) iflg = 1 + dmcu = dpz (rs, iflg) + dmcp = dpz_polarized (rs, iflg) + call pz (rs, 1, ecu, vcu) + call pz_polarized (rs, ecp, vcp) + fz = ( (1.0_DP + zeta) **p43 + (1.0_DP - zeta) **p43 - 2.0_DP) & + / (2.0_DP**p43 - 2.0_DP) + fz1 = p43 * ( (1.0_DP + zeta) **third- (1.0_DP - zeta) **third) & + / (2.0_DP**p43 - 2.0_DP) + fz2 = p49 * ( (1.0_DP + zeta) **m23 + (1.0_DP - zeta) **m23) & + / (2.0_DP**p43 - 2.0_DP) + aa = dmcu + fz * (dmcp - dmcu) + bb = 2.0_DP * fz1 * (vcp - vcu - (ecp - ecu) ) / rhotot + cc = fz2 * (ecp - ecu) / rhotot + dmuxc_uu = dmuxc_uu + aa + (1.0_DP - zeta) * bb + (1.0_DP - zeta)**2 * cc + dmuxc_du = dmuxc_du + aa + ( - zeta) * bb + (zeta**2 - 1.0_DP) * cc + dmuxc_ud = dmuxc_du + dmuxc_dd = dmuxc_dd+aa - (1.0_DP + zeta) * bb + (1.0_DP + zeta)**2 * cc + + else + + rho = rhoup + rhodw + dr = min (1.E-6_DP, 1.E-4_DP * rho) + call xc_spin (rho - dr, zeta, ex, ec, vxupm, vxdwm, vcupm, vcdwm) + call xc_spin (rho + dr, zeta, ex, ec, vxupp, vxdwp, vcupp, vcdwp) + dmuxc_uu = (vxupp + vcupp - vxupm - vcupm) / (2.0_DP * dr) + dmuxc_ud = dmuxc_uu + dmuxc_dd = (vxdwp + vcdwp - vxdwm - vcdwm) / (2.0_DP * dr) + dmuxc_du = dmuxc_dd + ! dz = min (1.d-6, 1.d-4 * abs (zeta) ) + dz = 1.E-6_DP +! +! If zeta is too close to +-1, the derivative is computed at a slightly +! smaller zeta +! + zeta_eff = SIGN( MIN( ABS( zeta ), ( 1.0_DP - 2.0_DP*dz ) ) , zeta ) + + call xc_spin (rho, zeta_eff - dz, ex, ec, vxupm, vxdwm, vcupm, vcdwm) + call xc_spin (rho, zeta_eff + dz, ex, ec, vxupp, vxdwp, vcupp, vcdwp) + dmuxc_uu = dmuxc_uu + (vxupp + vcupp - vxupm - vcupm) * & + (1.0_DP - zeta) / rho / (2.0_DP * dz) + dmuxc_ud = dmuxc_ud- (vxupp + vcupp - vxupm - vcupm) * & + (1.0_DP + zeta) / rho / (2.0_DP * dz) + dmuxc_du = dmuxc_du + (vxdwp + vcdwp - vxdwm - vcdwm) * & + (1.0_DP - zeta) / rho / (2.0_DP * dz) + dmuxc_dd = dmuxc_dd- (vxdwp + vcdwp - vxdwm - vcdwm) * & + (1.0_DP + zeta) / rho / (2.0_DP * dz) + endif + ! + ! bring to rydberg units + ! + dmuxc_uu = e2 * dmuxc_uu + dmuxc_du = e2 * dmuxc_du + dmuxc_ud = e2 * dmuxc_ud + dmuxc_dd = e2 * dmuxc_dd + ! + return + + end subroutine dmxc_spin + + ! + !----------------------------------------------------------------------- + subroutine dgcxc (r, s2, vrrx, vsrx, vssx, vrrc, vsrc, vssc) + !----------------------------------------------------------------------- + USE kinds, only : DP + implicit none + real(DP) :: r, s2, vrrx, vsrx, vssx, vrrc, vsrc, vssc + real(DP) :: dr, s, ds + + real(DP) :: sx, sc, v1xp, v2xp, v1cp, v2cp, v1xm, v2xm, v1cm, & + v2cm + s = sqrt (s2) + dr = min (1.d-4, 1.d-2 * r) + + ds = min (1.d-4, 1.d-2 * s) + call gcxc (r + dr, s2, sx, sc, v1xp, v2xp, v1cp, v2cp) + + call gcxc (r - dr, s2, sx, sc, v1xm, v2xm, v1cm, v2cm) + vrrx = 0.5d0 * (v1xp - v1xm) / dr + + vrrc = 0.5d0 * (v1cp - v1cm) / dr + vsrx = 0.25d0 * (v2xp - v2xm) / dr + + vsrc = 0.25d0 * (v2cp - v2cm) / dr + call gcxc (r, (s + ds) **2, sx, sc, v1xp, v2xp, v1cp, v2cp) + + call gcxc (r, (s - ds) **2, sx, sc, v1xm, v2xm, v1cm, v2cm) + vsrx = vsrx + 0.25d0 * (v1xp - v1xm) / ds / s + + vsrc = vsrc + 0.25d0 * (v1cp - v1cm) / ds / s + vssx = 0.5d0 * (v2xp - v2xm) / ds / s + + vssc = 0.5d0 * (v2cp - v2cm) / ds / s + return + end subroutine dgcxc + ! + !----------------------------------------------------------------------- + subroutine dgcxc_spin (rup, rdw, gup, gdw, vrrxup, vrrxdw, vrsxup, & + vrsxdw, vssxup, vssxdw, vrrcup, vrrcdw, vrscup, vrscdw, vssc, & + vrzcup, vrzcdw) + !----------------------------------------------------------------------- + ! + ! This routine computes the derivative of the exchange and correlatio + ! potentials with respect to the density, the gradient and zeta + ! + USE kinds, only : DP + implicit none + real(DP), intent(in) :: rup, rdw, gup (3), gdw (3) + ! input: the charges and the gradient + real(DP), intent(out):: vrrxup, vrrxdw, vrsxup, vrsxdw, vssxup, & + vssxdw, vrrcup, vrrcdw, vrscup, vrscdw, vssc, vrzcup, vrzcdw + ! output: derivatives of the exchange and of the correlation + ! + ! local variables + ! + real(DP) :: r, zeta, sup2, sdw2, s2, s, sup, sdw, dr, dzeta, ds, & + drup, drdw, dsup, dsdw, sx, sc, v1xupp, v1xdwp, v2xupp, v2xdwp, & + v1xupm, v1xdwm, v2xupm, v2xdwm, v1cupp, v1cdwp, v2cp, v1cupm, & + v1cdwm, v2cm + ! charge densities and square gradients + ! delta charge densities and gra + ! delta gradients + ! energies + ! exchange potentials + ! exchange potentials + ! coorelation potentials + ! coorelation potentials + real(DP), parameter :: eps = 1.d-6 + ! + r = rup + rdw + if (r.gt.eps) then + zeta = (rup - rdw) / r + else + zeta = 2.d0 + endif + sup2 = gup (1) **2 + gup (2) **2 + gup (3) **2 + sdw2 = gdw (1) **2 + gdw (2) **2 + gdw (3) **2 + + s2 = (gup (1) + gdw (1) ) **2 + (gup (2) + gdw (2) ) **2 + & + (gup (3) + gdw (3) ) **2 + sup = sqrt (sup2) + sdw = sqrt (sdw2) + s = sqrt (s2) + ! + ! up part of exchange + ! + + if (rup.gt.eps.and.sup.gt.eps) then + drup = min (1.d-4, 1.d-2 * rup) + dsup = min (1.d-4, 1.d-2 * sdw) + ! + ! derivatives of exchange: up part + ! + call gcx_spin (rup + drup, rdw, sup2, sdw2, sx, v1xupp, v1xdwp, & + v2xupp, v2xdwp) + + call gcx_spin (rup - drup, rdw, sup2, sdw2, sx, v1xupm, v1xdwm, & + v2xupm, v2xdwm) + vrrxup = 0.5d0 * (v1xupp - v1xupm) / drup + vrsxup = 0.25d0 * (v2xupp - v2xupm) / drup + + call gcx_spin (rup, rdw, (sup + dsup) **2, sdw2, sx, v1xupp, & + v1xdwp, v2xupp, v2xdwp) + + call gcx_spin (rup, rdw, (sup - dsup) **2, sdw2, sx, v1xupm, & + v1xdwm, v2xupm, v2xdwm) + vrsxup = vrsxup + 0.25d0 * (v1xupp - v1xupm) / dsup / sup + vssxup = 0.5d0 * (v2xupp - v2xupm) / dsup / sup + else + vrrxup = 0.d0 + vrsxup = 0.d0 + vssxup = 0.d0 + endif + + if (rdw.gt.eps.and.sdw.gt.eps) then + drdw = min (1.d-4, 1.d-2 * rdw) + dsdw = min (1.d-4, 1.d-2 * sdw) + ! + ! derivatives of exchange: down part + ! + call gcx_spin (rup, rdw + drdw, sup2, sdw2, sx, v1xupp, v1xdwp, & + v2xupp, v2xdwp) + + call gcx_spin (rup, rdw - drdw, sup2, sdw2, sx, v1xupm, v1xdwm, & + v2xupm, v2xdwm) + vrrxdw = 0.5d0 * (v1xdwp - v1xdwm) / drdw + + vrsxdw = 0.25d0 * (v2xdwp - v2xdwm) / drdw + call gcx_spin (rup, rdw, sup2, (sdw + dsdw) **2, sx, v1xupp, & + v1xdwp, v2xupp, v2xdwp) + + call gcx_spin (rup, rdw, sup2, (sdw - dsdw) **2, sx, v1xupm, & + v1xdwm, v2xupm, v2xdwm) + vrsxdw = vrsxdw + 0.25d0 * (v1xdwp - v1xdwm) / dsdw / sdw + vssxdw = 0.5d0 * (v2xdwp - v2xdwm) / dsdw / sdw + else + vrrxdw = 0.d0 + vrsxdw = 0.d0 + vssxdw = 0.d0 + endif + ! + ! derivatives of correlation + ! + + if (r.gt.eps.and.abs (zeta) .le.1.d0.and.s.gt.eps) then + + dr = min (1.d-4, 1.d-2 * r) + call gcc_spin (r + dr, zeta, s2, sc, v1cupp, v1cdwp, v2cp) + + call gcc_spin (r - dr, zeta, s2, sc, v1cupm, v1cdwm, v2cm) + vrrcup = 0.5d0 * (v1cupp - v1cupm) / dr + + vrrcdw = 0.5d0 * (v1cdwp - v1cdwm) / dr + + ds = min (1.d-4, 1.d-2 * s) + call gcc_spin (r, zeta, (s + ds) **2, sc, v1cupp, v1cdwp, v2cp) + + call gcc_spin (r, zeta, (s - ds) **2, sc, v1cupm, v1cdwm, v2cm) + vrscup = 0.5d0 * (v1cupp - v1cupm) / ds / s + vrscdw = 0.5d0 * (v1cdwp - v1cdwm) / ds / s + + vssc = 0.5d0 * (v2cp - v2cm) / ds / s +! dzeta = min (1.d-4, 1.d-2 * abs (zeta) ) + + dzeta = 1.d-6 +! +! If zeta is too close to +-1 the derivative is evaluated at a slightly +! smaller value +! + zeta = SIGN( MIN( ABS( zeta ), ( 1.0_DP - 2.0_DP*dzeta ) ) , zeta ) + + call gcc_spin (r, zeta + dzeta, s2, sc, v1cupp, v1cdwp, v2cp) + + call gcc_spin (r, zeta - dzeta, s2, sc, v1cupm, v1cdwm, v2cm) + vrzcup = 0.5d0 * (v1cupp - v1cupm) / dzeta + vrzcdw = 0.5d0 * (v1cdwp - v1cdwm) / dzeta + else + vrrcup = 0.d0 + vrrcdw = 0.d0 + vrscup = 0.d0 + vrscdw = 0.d0 + vssc = 0.d0 + vrzcup = 0.d0 + vrzcdw = 0.d0 + + endif + return + end subroutine dgcxc_spin + + + +end module funct diff --git a/tests/apps/miniDFT/tests/src/functionals.f90 b/tests/apps/miniDFT/tests/src/functionals.f90 new file mode 100644 index 0000000000..a27c9b1bbf --- /dev/null +++ b/tests/apps/miniDFT/tests/src/functionals.f90 @@ -0,0 +1,267 @@ +! +! Copyright (C) 2001-2009 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +!----------------------------------------------------------------------- +! +!----------------------------------------------------------------------- +subroutine slater (rs, ex, vx) + !----------------------------------------------------------------------- + ! Slater exchange with alpha=2/3 + ! + USE kinds, ONLY : DP + implicit none + real(DP) :: rs, ex, vx + real(DP), parameter :: f= -0.687247939924714d0, alpha = 2.0d0/3.0d0 + ! f = -9/8*(3/2pi)^(2/3) + ! + ex = f * alpha / rs + vx = 4.d0 / 3.d0 * f * alpha / rs + ! + return +end subroutine slater +subroutine pz (rs, iflag, ec, vc) + !----------------------------------------------------------------------- + ! LDA parameterization from Monte Carlo data + ! iflag=1: J.P. Perdew and A. Zunger, PRB 23, 5048 (1981) + ! iflag=2: G. Ortiz and P. Ballone, PRB 50, 1391 (1994) + ! + USE kinds, ONLY : DP + implicit none + real(DP) :: rs, ec, vc + integer :: iflag + ! + real(DP) :: a (2), b (2), c (2), d (2), gc (2), b1 (2), b2 (2) + real(DP) :: lnrs, rs12, ox, dox + ! + data a / 0.0311d0, 0.031091d0 /, b / -0.048d0, -0.046644d0 /, & + c / 0.0020d0, 0.00419d0 /, d / -0.0116d0, -0.00983d0 / + data gc / -0.1423d0, -0.103756d0 /, b1 / 1.0529d0, 0.56371d0 /, & + b2 / 0.3334d0, 0.27358d0 / + ! + if (rs.lt.1.0d0) then + ! high density formula + lnrs = log (rs) + ec = a (iflag) * lnrs + b (iflag) + c (iflag) * rs * lnrs + d ( & + iflag) * rs + vc = a (iflag) * lnrs + (b (iflag) - a (iflag) / 3.d0) + 2.d0 / & + 3.d0 * c (iflag) * rs * lnrs + (2.d0 * d (iflag) - c (iflag) ) & + / 3.d0 * rs + else + ! interpolation formula + rs12 = sqrt (rs) + ox = 1.d0 + b1 (iflag) * rs12 + b2 (iflag) * rs + dox = 1.d0 + 7.d0 / 6.d0 * b1 (iflag) * rs12 + 4.d0 / 3.d0 * & + b2 (iflag) * rs + ec = gc (iflag) / ox + vc = ec * dox / ox + endif + ! + return +end subroutine pz +! +!----------------------------------------------------------------------- +! +!----------------------------------------------------------------------- +subroutine pw (rs, iflag, ec, vc) + !----------------------------------------------------------------------- + ! iflag=1: J.P. Perdew and Y. Wang, PRB 45, 13244 (1992) + ! iflag=2: G. Ortiz and P. Ballone, PRB 50, 1391 (1994) + ! + USE kinds, ONLY : DP + implicit none + real(DP) :: rs, ec, vc + integer :: iflag + ! + real(DP) :: a, b1, b2, c0, c1, c2, c3, d0, d1 + parameter (a = 0.031091d0, b1 = 7.5957d0, b2 = 3.5876d0, c0 = a, & + c1 = 0.046644d0, c2 = 0.00664d0, c3 = 0.01043d0, d0 = 0.4335d0, & + d1 = 1.4408d0) + real(DP) :: lnrs, rs12, rs32, rs2, om, dom, olog + real(DP) :: a1 (2), b3 (2), b4 (2) + data a1 / 0.21370d0, 0.026481d0 /, b3 / 1.6382d0, -0.46647d0 /, & + b4 / 0.49294d0, 0.13354d0 / + ! + ! high- and low-density formulae implemented but not used in PW case + ! (reason: inconsistencies in PBE/PW91 functionals) + ! + if (rs.lt.1d0.and.iflag.eq.2) then + ! high density formula + lnrs = log (rs) + ec = c0 * lnrs - c1 + c2 * rs * lnrs - c3 * rs + vc = c0 * lnrs - (c1 + c0 / 3.d0) + 2.d0 / 3.d0 * c2 * rs * & + lnrs - (2.d0 * c3 + c2) / 3.d0 * rs + elseif (rs.gt.100.d0.and.iflag.eq.2) then + ! low density formula + ec = - d0 / rs + d1 / rs**1.5d0 + vc = - 4.d0 / 3.d0 * d0 / rs + 1.5d0 * d1 / rs**1.5d0 + else + ! interpolation formula + rs12 = sqrt (rs) + rs32 = rs * rs12 + rs2 = rs**2 + om = 2.d0 * a * (b1 * rs12 + b2 * rs + b3 (iflag) * rs32 + b4 ( & + iflag) * rs2) + dom = 2.d0 * a * (0.5d0 * b1 * rs12 + b2 * rs + 1.5d0 * b3 ( & + iflag) * rs32 + 2.d0 * b4 (iflag) * rs2) + olog = log (1.d0 + 1.0d0 / om) + ec = - 2.d0 * a * (1.d0 + a1 (iflag) * rs) * olog + vc = - 2.d0 * a * (1.d0 + 2.d0 / 3.d0 * a1 (iflag) * rs) & + * olog - 2.d0 / 3.d0 * a * (1.d0 + a1 (iflag) * rs) * dom / & + (om * (om + 1.d0) ) + endif + ! + return +end subroutine pw +! +!--------------------------------------------------------------- +subroutine pbex (rho, grho, iflag, sx, v1x, v2x) + !--------------------------------------------------------------- + ! + ! PBE exchange (without Slater exchange): + ! iflag=1 J.P.Perdew, K.Burke, M.Ernzerhof, PRL 77, 3865 (1996) + ! iflag=2 "revised' PBE: Y. Zhang et al., PRL 80, 890 (1998) + ! iflag=3 PBEsol: J.P.Perdew et al., PRL 100, 136406 (2008) + ! + USE kinds, ONLY : DP + USE constants, ONLY : pi + implicit none + real(DP) :: rho, grho, sx, v1x, v2x + ! input: charge and squared gradient + ! output: energy + ! output: potential + integer :: iflag + ! local variables + real(DP) :: kf, agrho, s1, s2, ds, dsg, exunif, fx + ! (3*pi2*|rho|)^(1/3) + ! |grho| + ! |grho|/(2*kf*|rho|) + ! s^2 + ! n*ds/dn + ! n*ds/d(gn) + ! exchange energy LDA part + ! exchange energy gradient part + real(DP) :: dxunif, dfx, f1, f2, f3, dfx1 + ! numerical coefficients (NB: c2=(3 pi^2)^(1/3) ) + real(DP) :: third, c1, c2, c5 + parameter (third = 1.d0 / 3.d0, c1 = 0.75d0 / pi , & + c2 = 3.093667726280136d0, c5 = 4.d0 * third) + ! parameters of the functional + real(DP) :: k (3), mu(3) + data k / 0.804d0, 1.2450D0, 0.804d0 /, & + mu/ 0.21951d0, 0.21951d0, 0.12345679012345679012d0 / + ! + agrho = sqrt (grho) + kf = c2 * rho**third + dsg = 0.5d0 / kf + s1 = agrho * dsg / rho + s2 = s1 * s1 + ds = - c5 * s1 + ! + ! Energy + ! + f1 = s2 * mu(iflag) / k (iflag) + f2 = 1.d0 + f1 + f3 = k (iflag) / f2 + fx = k (iflag) - f3 + exunif = - c1 * kf + sx = exunif * fx + ! + ! Potential + ! + dxunif = exunif * third + dfx1 = f2 * f2 + dfx = 2.d0 * mu(iflag) * s1 / dfx1 + v1x = sx + dxunif * fx + exunif * dfx * ds + v2x = exunif * dfx * dsg / agrho + + sx = sx * rho + return +end subroutine pbex +! +!--------------------------------------------------------------- +subroutine pbec (rho, grho, iflag, sc, v1c, v2c) + !--------------------------------------------------------------- + ! + ! PBE correlation (without LDA part) + ! iflag=1: J.P.Perdew, K.Burke, M.Ernzerhof, PRL 77, 3865 (1996). + ! iflag=2: J.P.Perdew et al., PRL 100, 136406 (2008). + ! + USE kinds, ONLY : DP + implicit none + integer, intent(in) :: iflag + real(DP) :: rho, grho, sc, v1c, v2c + real(DP) :: ga, be (2) + parameter (ga = 0.031091d0) + data be / 0.066725d0, 0.046d0 / + real(DP) :: third, pi34, xkf, xks + parameter (third = 1.d0 / 3.d0, pi34 = 0.6203504908994d0) + parameter (xkf = 1.919158292677513d0, xks = 1.128379167095513d0) + ! pi34=(3/4pi)^(1/3), xkf=(9 pi/4)^(1/3), xks= sqrt(4/pi) + real(DP) :: kf, ks, rs, ec, vc, t, expe, af, bf, y, xy, qy + real(DP) :: s1, h0, dh0, ddh0 + ! + rs = pi34 / rho**third + call pw (rs, 1, ec, vc) + kf = xkf / rs + ks = xks * sqrt (kf) + t = sqrt (grho) / (2.d0 * ks * rho) + expe = exp ( - ec / ga) + af = be(iflag) / ga * (1.d0 / (expe-1.d0) ) + bf = expe * (vc - ec) + y = af * t * t + xy = (1.d0 + y) / (1.d0 + y + y * y) + qy = y * y * (2.d0 + y) / (1.d0 + y + y * y) **2 + s1 = 1.d0 + be(iflag) / ga * t * t * xy + h0 = ga * log (s1) + dh0 = be(iflag) * t * t / s1 * ( - 7.d0 / 3.d0 * xy - qy * (af * bf / & + be(iflag)-7.d0 / 3.d0) ) + ddh0 = be(iflag) / (2.d0 * ks * ks * rho) * (xy - qy) / s1 + sc = rho * h0 + v1c = h0 + dh0 + v2c = ddh0 + ! + return +end subroutine pbec +! +!----------------------------------------------------------------------- +function dpz (rs, iflg) + !----------------------------------------------------------------------- + ! derivative of the correlation potential with respect to local density + ! Perdew and Zunger parameterization of the Ceperley-Alder functional + ! + use kinds, only: DP + USE constants, ONLY: pi, fpi + ! + implicit none + ! + real(DP), intent (in) :: rs + integer, intent(in) :: iflg + real(DP) :: dpz + ! + ! local variables + ! a,b,c,d,gc,b1,b2 are the parameters defining the functional + ! + real(DP), parameter :: a = 0.0311d0, b = -0.048d0, c = 0.0020d0, & + d = -0.0116d0, gc = -0.1423d0, b1 = 1.0529d0, b2 = 0.3334d0,& + a1 = 7.0d0 * b1 / 6.d0, a2 = 4.d0 * b2 / 3.d0 + real(DP) :: x, den, dmx, dmrs + ! + ! + if (iflg == 1) then + dmrs = a / rs + 2.d0 / 3.d0 * c * (log (rs) + 1.d0) + & + (2.d0 * d-c) / 3.d0 + else + x = sqrt (rs) + den = 1.d0 + x * (b1 + x * b2) + dmx = gc * ( (a1 + 2.d0 * a2 * x) * den - 2.d0 * (b1 + 2.d0 * & + b2 * x) * (1.d0 + x * (a1 + x * a2) ) ) / den**3 + dmrs = 0.5d0 * dmx / x + endif + ! + dpz = - fpi * rs**4.d0 / 9.d0 * dmrs + return + ! +end function dpz diff --git a/tests/apps/miniDFT/tests/src/g2_kin.f90 b/tests/apps/miniDFT/tests/src/g2_kin.f90 new file mode 100644 index 0000000000..cef2b1fce4 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/g2_kin.f90 @@ -0,0 +1,49 @@ +! +! Copyright (C) 2007 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +!---------------------------------------------------------------------------- +SUBROUTINE g2_kin ( ik ) + !---------------------------------------------------------------------------- + ! + ! ... Calculation of kinetic energy - includes the case of the modified + ! ... kinetic energy functional for variable-cell calculations + ! + USE kinds, ONLY : DP + USE cell_base, ONLY : tpiba2 + USE klist, ONLY : xk + USE gvect, ONLY : g + USE wvfct, ONLY : g2kin, igk, npw, ecfixed, qcutz, q2sigma + ! + IMPLICIT NONE + ! + INTEGER, INTENT (IN) :: ik + ! + ! ... local variables + ! + INTEGER :: ig + REAL(DP), EXTERNAL :: qe_erf + ! + ! + g2kin(1:npw) = ( ( xk(1,ik) + g(1,igk(1:npw)) )**2 + & + ( xk(2,ik) + g(2,igk(1:npw)) )**2 + & + ( xk(3,ik) + g(3,igk(1:npw)) )**2 ) * tpiba2 + ! + IF ( qcutz > 0.D0 ) THEN + ! + DO ig = 1, npw + ! + g2kin(ig) = g2kin(ig) + qcutz * & + ( 1.D0 + qe_erf( ( g2kin(ig) - ecfixed ) / q2sigma ) ) + ! + END DO + ! + END IF + ! + RETURN + ! +END SUBROUTINE g2_kin diff --git a/tests/apps/miniDFT/tests/src/g_psi.f90 b/tests/apps/miniDFT/tests/src/g_psi.f90 new file mode 100644 index 0000000000..eddf14b9d1 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/g_psi.f90 @@ -0,0 +1,74 @@ +! +! Copyright (C) 2001-2003 PWSCF group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +#define TEST_NEW_PRECONDITIONING +! +!----------------------------------------------------------------------- +subroutine g_psi (lda, n, m, npol, psi, e) + !----------------------------------------------------------------------- + ! + ! This routine computes an estimate of the inverse Hamiltonian + ! and applies it to m wavefunctions + ! + USE kinds + USE g_psi_mod + implicit none + integer :: lda, n, m, npol, ipol + ! input: the leading dimension of psi + ! input: the real dimension of psi + ! input: the number of bands + ! input: the number of coordinates of psi + ! local variable: counter of coordinates of psi + real(DP) :: e (m) + ! input: the eigenvectors + complex(DP) :: psi (lda, npol, m) + ! inp/out: the psi vector + ! + ! Local variables + ! + real(DP), parameter :: eps = 1.0d-4 + ! a small number + real(DP) :: x, scala, denm + integer :: k, i + ! counter on psi functions + ! counter on G vectors + ! + call start_clock ('g_psi') + ! +#ifdef TEST_NEW_PRECONDITIONING + scala = 1.d0 + do ipol=1,npol + do k = 1, m + do i = 1, n + x = (h_diag(i,ipol) - e(k)*s_diag(i,ipol))*scala + denm = (1.d0+x+sqrt(1.d0+(x-1)*(x-1.d0)))/scala + ! denm = 1.d0 + 16*x*x*x*x/(27.d0+18*x+12*x*x+8*x*x*x) + psi (i, ipol, k) = psi (i, ipol, k) / denm + enddo + enddo + enddo +#else + do ipol=1,npol + do k = 1, m + do i = 1, n + denm = h_diag (i,ipol) - e (k) * s_diag (i,ipol) + ! + ! denm = g2+v(g=0) - e(k) + ! + if (abs (denm) < eps) denm = sign (eps, denm) + ! + ! denm = sign( max( abs(denm),eps ), denm ) + ! + psi (i, ipol, k) = psi (i, ipol, k) / denm + enddo + enddo + enddo +#endif + + call stop_clock ('g_psi') + return +end subroutine g_psi diff --git a/tests/apps/miniDFT/tests/src/g_psi_mod.f90 b/tests/apps/miniDFT/tests/src/g_psi_mod.f90 new file mode 100644 index 0000000000..b407d23474 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/g_psi_mod.f90 @@ -0,0 +1,20 @@ +! +! Copyright (C) 2001-2007 PWSCF group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +MODULE g_psi_mod + ! + ! ... These are the variables needed in g_psi + ! + USE kinds, only : DP + ! + IMPLICIT NONE + ! + REAL(DP), ALLOCATABLE :: & + h_diag (:,:),& ! diagonal part of the Hamiltonian + s_diag (:,:) ! diagonal part of the overlap matrix + ! +END MODULE g_psi_mod diff --git a/tests/apps/miniDFT/tests/src/gen_us_dj.f90 b/tests/apps/miniDFT/tests/src/gen_us_dj.f90 new file mode 100644 index 0000000000..946235e551 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/gen_us_dj.f90 @@ -0,0 +1,159 @@ +! +! Copyright (C) 2001 PWSCF group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +!---------------------------------------------------------------------- +subroutine gen_us_dj (ik, dvkb) + !---------------------------------------------------------------------- + ! + ! Calculates the beta function pseudopotentials with + ! the derivative of the Bessel functions + ! + USE kinds, ONLY : DP + USE constants, ONLY : tpi + USE ions_base, ONLY : nat, ntyp => nsp, ityp, tau + USE cell_base, ONLY : tpiba + USE klist, ONLY : xk + USE gvect, ONLY : mill, eigts1, eigts2, eigts3, g + USE wvfct, ONLY : npw, npwx, igk + USE uspp, ONLY : nkb, indv, nhtol, nhtolm + USE us, ONLY : nqx, tab, tab_d2y, dq, spline_ps + USE splinelib + USE uspp_param, ONLY : upf, lmaxkb, nbetam, nh + ! + implicit none + ! + integer :: ik + complex(DP) :: dvkb (npwx, nkb) + ! + ! local variables + ! + integer :: ikb, nb, ih, ig, i0, i1, i2, i3 , nt + ! counter on beta functions + ! counter on beta functions + ! counter on beta functions + ! counter on G vectors + ! index of the first nonzero point in the r + ! counter on atomic type + + real(DP) :: arg, px, ux, vx, wx + ! argument of the atomic phase factor + + complex(DP) :: phase, pref + ! atomic phase factor + ! prefactor + + integer :: na, l, iig, lm + real(DP), allocatable :: djl (:,:,:), ylm (:,:), q (:), gk (:,:) + real(DP) :: qt, eps + parameter (eps = 1.0d-8) + + complex(DP), allocatable :: sk (:) + + integer :: iq + real(DP), allocatable :: xdata(:) + + if (nkb.eq.0) return + + call start_clock('stres_us31') + + allocate (djl( npw , nbetam , ntyp)) + allocate (ylm( npw ,(lmaxkb + 1) **2)) + allocate (gk( 3, npw)) + allocate (q( npw)) + do ig = 1, npw + gk (1,ig) = xk (1, ik) + g(1, igk(ig) ) + gk (2,ig) = xk (2, ik) + g(2, igk(ig) ) + gk (3,ig) = xk (3, ik) + g(3, igk(ig) ) + q (ig) = gk(1, ig)**2 + gk(2, ig)**2 + gk(3, ig)**2 + enddo + + call stop_clock('stres_us31') + call start_clock('stres_us32') + call ylmr2 ((lmaxkb+1)**2, npw, gk, q, ylm) + call stop_clock('stres_us32') + call start_clock('stres_us33') + + + if (spline_ps) then + allocate(xdata(nqx)) + do iq = 1, nqx + xdata(iq) = (iq - 1) * dq + enddo + endif + + do nt = 1, ntyp + do nb = 1, upf(nt)%nbeta + do ig = 1, npw + qt = sqrt(q (ig)) * tpiba + if (spline_ps) then + djl(ig,nb,nt) = splint_deriv(xdata, tab(:,nb,nt), & + tab_d2y(:,nb,nt), qt) + else + px = qt / dq - int (qt / dq) + ux = 1.d0 - px + vx = 2.d0 - px + wx = 3.d0 - px + i0 = qt / dq + 1 + i1 = i0 + 1 + i2 = i0 + 2 + i3 = i0 + 3 + djl(ig,nb,nt) = ( tab (i0, nb, nt) * (-vx*wx-ux*wx-ux*vx)/6.d0 + & + tab (i1, nb, nt) * (+vx*wx-px*wx-px*vx)/2.d0 - & + tab (i2, nb, nt) * (+ux*wx-px*wx-px*ux)/2.d0 + & + tab (i3, nb, nt) * (+ux*vx-px*vx-px*ux)/6.d0 )/dq + endif + enddo + enddo + enddo + call stop_clock('stres_us33') + call start_clock('stres_us34') + + deallocate (q) + deallocate (gk) + + allocate (sk( npw)) + ikb = 0 + do nt = 1, ntyp + do na = 1, nat + if (ityp (na) .eq.nt) then + arg = (xk (1, ik) * tau(1,na) + & + xk (2, ik) * tau(2,na) + & + xk (3, ik) * tau(3,na) ) * tpi + phase = CMPLX(cos (arg), - sin (arg) ,kind=DP) + do ig = 1, npw + iig = igk (ig) + sk (ig) = eigts1 (mill (1,iig), na) * & + eigts2 (mill (2,iig), na) * & + eigts3 (mill (3,iig), na) * phase + enddo + do ih = 1, nh (nt) + nb = indv (ih, nt) + l = nhtol (ih, nt) + lm= nhtolm(ih, nt) + ikb = ikb + 1 + pref = (0.d0, -1.d0) **l + ! + do ig = 1, npw + dvkb (ig, ikb) = djl (ig, nb, nt) * sk (ig) * ylm (ig, lm) & + * pref + enddo + enddo + endif + enddo + + enddo + call stop_clock('stres_us34') + + if (ikb.ne.nkb) call errore ('gen_us_dj', 'unexpected error', 1) + deallocate (sk) + deallocate (ylm) + deallocate (djl) + if (spline_ps) deallocate(xdata) + return +end subroutine gen_us_dj + diff --git a/tests/apps/miniDFT/tests/src/gen_us_dy.f90 b/tests/apps/miniDFT/tests/src/gen_us_dy.f90 new file mode 100644 index 0000000000..4f3c1c73e9 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/gen_us_dy.f90 @@ -0,0 +1,150 @@ +! +! Copyright (C) 2001 PWSCF group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +!---------------------------------------------------------------------- +subroutine gen_us_dy (ik, u, dvkb) + !---------------------------------------------------------------------- + ! + ! Calculates the kleinman-bylander pseudopotentials with the + ! derivative of the spherical harmonics projected on vector u + ! + USE kinds, ONLY : DP + USE io_global, ONLY : stdout + USE constants, ONLY : tpi + USE ions_base, ONLY : nat, ntyp => nsp, ityp, tau + USE cell_base, ONLY : tpiba + USE klist, ONLY : xk + USE gvect, ONLY : mill, eigts1, eigts2, eigts3, g + USE wvfct, ONLY : npw, npwx, igk + USE uspp, ONLY : nkb, indv, nhtol, nhtolm + USE us, ONLY : nqx, tab, tab_d2y, dq, spline_ps + USE splinelib + USE uspp_param, ONLY : upf, lmaxkb, nbetam, nh + ! + implicit none + ! + integer :: ik + real(DP) :: u (3) + + complex(DP) :: dvkb (npwx, nkb) + integer :: na, nt, nb, ih, l, lm, ikb, iig, ipol, i0, i1, i2, & + i3, ig + real(DP), allocatable :: gk(:,:), q (:) + real(DP) :: px, ux, vx, wx, arg + + real(DP), allocatable :: vkb0 (:,:,:), dylm (:,:), dylm_u (:,:) + ! dylm = d Y_lm/dr_i in cartesian axes + ! dylm_u as above projected on u + + complex(DP), allocatable :: sk (:) + complex(DP) :: phase, pref + + integer :: iq + real(DP), allocatable :: xdata(:) + + dvkb(:,:) = (0.d0, 0.d0) + if (lmaxkb.le.0) return + + allocate ( vkb0(npw,nbetam,ntyp), dylm_u(npw,(lmaxkb+1)**2), gk(3,npw) ) + allocate ( q(npw) ) + + do ig = 1, npw + gk (1, ig) = xk (1, ik) + g (1, igk (ig) ) + gk (2, ig) = xk (2, ik) + g (2, igk (ig) ) + gk (3, ig) = xk (3, ik) + g (3, igk (ig) ) + q (ig) = gk(1, ig)**2 + gk(2, ig)**2 + gk(3, ig)**2 + enddo + + allocate ( dylm(npw,(lmaxkb+1)**2) ) + dylm_u(:,:) = 0.d0 + do ipol = 1, 3 + call dylmr2 ((lmaxkb+1)**2, npw, gk, q, dylm, ipol) + call daxpy (npw * (lmaxkb + 1) **2, u (ipol), dylm, 1, dylm_u, 1) + enddo + deallocate (dylm) + + do ig = 1, npw + q (ig) = sqrt ( q(ig) ) * tpiba + end do + + if (spline_ps) then + allocate(xdata(nqx)) + do iq = 1, nqx + xdata(iq) = (iq - 1) * dq + enddo + endif + + do nt = 1, ntyp + ! calculate beta in G-space using an interpolation table + do nb = 1, upf(nt)%nbeta + do ig = 1, npw + if (spline_ps) then + vkb0(ig,nb,nt) = splint(xdata, tab(:,nb,nt), & + tab_d2y(:,nb,nt), q(ig)) + else + px = q (ig) / dq - int (q (ig) / dq) + ux = 1.d0 - px + vx = 2.d0 - px + wx = 3.d0 - px + i0 = q (ig) / dq + 1 + i1 = i0 + 1 + i2 = i0 + 2 + i3 = i0 + 3 + vkb0 (ig, nb, nt) = tab (i0, nb, nt) * ux * vx * wx / 6.d0 + & + tab (i1, nb, nt) * px * vx * wx / 2.d0 - & + tab (i2, nb, nt) * px * ux * wx / 2.d0 + & + tab (i3, nb, nt) * px * ux * vx / 6.d0 + endif + enddo + enddo + enddo + + deallocate (q) + allocate ( sk(npw) ) + + ikb = 0 + do nt = 1, ntyp + do na = 1, nat + if (ityp (na) .eq.nt) then + arg = (xk (1, ik) * tau (1, na) + xk (2, ik) * tau (2, na) & + + xk (3, ik) * tau (3, na) ) * tpi + phase = CMPLX(cos (arg), - sin (arg) ,kind=DP) + do ig = 1, npw + iig = igk (ig) + sk (ig) = eigts1 (mill (1,iig), na) * & + eigts2 (mill (2,iig), na) * & + eigts3 (mill (3,iig), na) * phase + enddo + do ih = 1, nh (nt) + nb = indv (ih, nt) + l = nhtol (ih, nt) + lm = nhtolm(ih, nt) + ikb = ikb + 1 + pref = (0.d0, -1.d0) **l + ! + do ig = 1, npw + dvkb (ig, ikb) = vkb0(ig, nb, nt) * sk(ig) * dylm_u(ig, lm) & + * pref / tpiba + enddo + enddo + endif + enddo + enddo + + if (ikb.ne.nkb) then + WRITE( stdout, * ) ikb, nkb + call errore ('gen_us_dy', 'unexpected error', 1) + endif + + deallocate ( sk ) + deallocate ( vkb0, dylm_u, gk ) + if (spline_ps) deallocate(xdata) + + return +end subroutine gen_us_dy + diff --git a/tests/apps/miniDFT/tests/src/gk_sort.f90 b/tests/apps/miniDFT/tests/src/gk_sort.f90 new file mode 100644 index 0000000000..9926f5180a --- /dev/null +++ b/tests/apps/miniDFT/tests/src/gk_sort.f90 @@ -0,0 +1,77 @@ +! +! Copyright (C) 2001-2010 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +!---------------------------------------------------------------------------- +SUBROUTINE gk_sort( k, ngm, g, ecut, ngk, igk, gk ) + !---------------------------------------------------------------------------- + ! + ! ... sorts k+g in order of increasing magnitude, up to ecut + ! ... NB: this version should yield the same ordering for different ecut + ! ... and the same ordering in all machines + ! + USE kinds, ONLY : DP + USE constants, ONLY : eps8 + USE wvfct, ONLY : npwx + ! + IMPLICIT NONE + ! + REAL(DP), INTENT(in) :: k(3) ! the k point + INTEGER, INTENT(in) :: ngm ! the number of g vectors + REAL(DP), INTENT(in) :: g(3,ngm) ! the coordinates of G vectors + REAL(DP), INTENT(in) :: ecut ! the cut-off energy + INTEGER, INTENT(out) :: ngk ! the number of k+G vectors inside the "ecut sphere" + INTEGER, INTENT(out) :: igk(npwx) ! the correspondence k+G <-> G + REAL(DP), INTENT(out) :: gk(npwx) ! the moduli of k+G + ! + INTEGER :: ng ! counter on G vectors + INTEGER :: nk ! counter on k+G vectors + REAL(DP) :: q ! |k+G|^2 + REAL(DP) :: q2x ! upper bound for |G| + ! + ! ... first we count the number of k+G vectors inside the cut-off sphere + ! + q2x = ( sqrt( sum(k(:)**2) ) + sqrt( ecut ) )**2 + ! + ngk = 0 + igk(:) = 0 + gk (:) = 0.0_dp + ! + DO ng = 1, ngm + q = sum( ( k(:) + g(:,ng) )**2 ) + IF(q<=eps8) q=0.d0 + ! + ! ... here if |k+G|^2 <= Ecut + ! + IF ( q <= ecut ) THEN + ngk = ngk + 1 + IF ( ngk > npwx ) & + CALL errore( 'gk_sort', 'array gk out-of-bounds', 1 ) + ! + gk(ngk) = q + ! + ! set the initial value of index array + igk(ngk) = ng + ELSE + ! if |G| > |k| + SQRT( Ecut ) stop search and order vectors + IF ( sum( g(:,ng)**2 ) > ( q2x + eps8 ) ) exit + ENDIF + ENDDO + ! + IF ( ng > ngm ) & + CALL infomsg( 'gk_sort', 'unexpected exit from do-loop') + ! + ! ... order vector gk keeping initial position in index + ! + CALL hpsort_eps( ngk, gk, igk, eps8 ) + ! + ! ... now order true |k+G| + ! + DO nk = 1, ngk + gk(nk) = sum( (k(:) + g(:,igk(nk)) )**2 ) + ENDDO + ! +END SUBROUTINE gk_sort diff --git a/tests/apps/miniDFT/tests/src/gradcorr.f90 b/tests/apps/miniDFT/tests/src/gradcorr.f90 new file mode 100644 index 0000000000..ca765373c7 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/gradcorr.f90 @@ -0,0 +1,413 @@ +! +! Copyright (C) 2001-2008 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +!---------------------------------------------------------------------------- +SUBROUTINE gradcorr( rho, rhog, rho_core, rhog_core, etxc, vtxc, v ) + !---------------------------------------------------------------------------- + ! + USE constants, ONLY : e2 + USE kinds, ONLY : DP + USE gvect, ONLY : nl, ngm, g + USE lsda_mod, ONLY : nspin + USE cell_base, ONLY : omega, alat + USE funct, ONLY : gcxc, gcx_spin, gcc_spin, & + dft_is_gradient, get_igcc + USE spin_orb, ONLY : domag + USE wavefunctions_module, ONLY : psic + USE fft_base, ONLY : dfftp + USE fft_interfaces, ONLY : fwfft + + ! + IMPLICIT NONE + ! + REAL(DP), INTENT(IN) :: rho(dfftp%nnr,nspin), rho_core(dfftp%nnr) + COMPLEX(DP), INTENT(IN) :: rhog(ngm,nspin), rhog_core(ngm) + REAL(DP), INTENT(INOUT) :: v(dfftp%nnr,nspin) + REAL(DP), INTENT(INOUT) :: vtxc, etxc + ! + INTEGER :: k, ipol, is, nspin0, ir, jpol + ! + REAL(DP), ALLOCATABLE :: grho(:,:,:), h(:,:,:), dh(:) + REAL(DP), ALLOCATABLE :: rhoout(:,:), segni(:), vgg(:,:), vsave(:,:) + REAL(DP), ALLOCATABLE :: gmag(:,:,:) + + COMPLEX(DP), ALLOCATABLE :: rhogsum(:,:) + ! + LOGICAL :: igcc_is_lyp + REAL(DP) :: grho2(2), sx, sc, v1x, v2x, v1c, v2c, & + v1xup, v1xdw, v2xup, v2xdw, v1cup, v1cdw , & + etxcgc, vtxcgc, segno, arho, fac, zeta, rh, grh2, amag + REAL(DP) :: v2cup, v2cdw, v2cud, rup, rdw, & + grhoup, grhodw, grhoud, grup, grdw, seg + ! + REAL(DP), PARAMETER :: epsr = 1.D-6, epsg = 1.D-10 + ! + ! + IF ( .NOT. dft_is_gradient() ) RETURN + + igcc_is_lyp = (get_igcc() == 3 .or. get_igcc() == 7) + ! + etxcgc = 0.D0 + vtxcgc = 0.D0 + ! + nspin0=nspin + if (nspin==4) nspin0=1 + if (nspin==4.and.domag) nspin0=2 + fac = 1.D0 / DBLE( nspin0 ) + ! + ALLOCATE( h( 3, dfftp%nnr, nspin0) ) + ALLOCATE( grho( 3, dfftp%nnr, nspin0) ) + ALLOCATE( rhoout( dfftp%nnr, nspin0) ) + IF (nspin==4.AND.domag) THEN + ALLOCATE( vgg( dfftp%nnr, nspin0 ) ) + ALLOCATE( vsave( dfftp%nnr, nspin ) ) + ALLOCATE( segni( dfftp%nnr ) ) + vsave=v + v=0.d0 + ENDIF + ! + ALLOCATE( rhogsum( ngm, nspin0 ) ) + ! + ! ... calculate the gradient of rho + rho_core in real space + ! + IF ( nspin == 4 .AND. domag ) THEN + ! + write(*,*) "gradcor.f90:81 skipping compute_rho; shouldnt get here unless noncolin" + !!$ CALL compute_rho(rho,rhoout,segni,dfftp%nnr) + ! + ! ... bring starting rhoout to G-space + ! + DO is = 1, nspin0 + ! + psic(:) = rhoout(:,is) + ! + CALL fwfft ('Dense', psic, dfftp) + ! + rhogsum(:,is) = psic(nl(:)) + ! + END DO + ELSE + ! + rhoout(:,1:nspin0) = rho(:,1:nspin0) + rhogsum(:,1:nspin0) = rhog(:,1:nspin0) + ! + ENDIF + DO is = 1, nspin0 + ! + rhoout(:,is) = fac * rho_core(:) + rhoout(:,is) + rhogsum(:,is) = fac * rhog_core(:) + rhogsum(:,is) + ! + CALL gradrho( dfftp%nnr, rhogsum(1,is), ngm, g, nl, grho(1,1,is) ) + ! + END DO + ! + DEALLOCATE( rhogsum ) + ! + IF ( nspin0 == 1 ) THEN + ! + ! ... This is the spin-unpolarised case + ! + DO k = 1, dfftp%nnr + ! + arho = ABS( rhoout(k,1) ) + ! + IF ( arho > epsr ) THEN + ! + grho2(1) = grho(1,k,1)**2 + grho(2,k,1)**2 + grho(3,k,1)**2 + ! + IF ( grho2(1) > epsg ) THEN + ! + segno = SIGN( 1.D0, rhoout(k,1) ) + ! + CALL gcxc( arho, grho2(1), sx, sc, v1x, v2x, v1c, v2c ) + ! + ! ... first term of the gradient correction : D(rho*Exc)/D(rho) + ! + v(k,1) = v(k,1) + e2 * ( v1x + v1c ) + ! + ! ... h contains : + ! + ! ... D(rho*Exc) / D(|grad rho|) * (grad rho) / |grad rho| + ! + h(:,k,1) = e2 * ( v2x + v2c ) * grho(:,k,1) + ! + vtxcgc = vtxcgc+e2*( v1x + v1c ) * ( rhoout(k,1) - rho_core(k) ) + etxcgc = etxcgc+e2*( sx + sc ) * segno + ! + ELSE + h(:,k,1)=0.D0 + END IF + ! + ELSE + ! + h(:,k,1) = 0.D0 + ! + END IF + ! + END DO + ! + ELSE + ! + ! ... spin-polarised case + ! +!$omp parallel do private( rh, grho2, sx, v1xup, v1xdw, v2xup, v2xdw, rup, rdw, & +!$omp grhoup, grhodw, grhoud, sc, v1cup, v1cdw, v2cup, v2cdw, v2cud, & +!$omp zeta, grh2, v2c, grup, grdw ), & +!$omp reduction(+:etxcgc,vtxcgc) + DO k = 1, dfftp%nnr + ! + rh = rhoout(k,1) + rhoout(k,2) + ! + grho2(:) = grho(1,k,:)**2 + grho(2,k,:)**2 + grho(3,k,:)**2 + ! + CALL gcx_spin( rhoout(k,1), rhoout(k,2), grho2(1), & + grho2(2), sx, v1xup, v1xdw, v2xup, v2xdw ) + ! + IF ( rh > epsr ) THEN + ! + IF ( igcc_is_lyp ) THEN + ! + call errore('gradcorr','lyp type functionals not available in mini_DFT', 1 ) +!!$ rup = rhoout(k,1) +!!$ rdw = rhoout(k,2) +!!$ ! +!!$ grhoup = grho(1,k,1)**2 + grho(2,k,1)**2 + grho(3,k,1)**2 +!!$ grhodw = grho(1,k,2)**2 + grho(2,k,2)**2 + grho(3,k,2)**2 +!!$ ! +!!$ grhoud = grho(1,k,1) * grho(1,k,2) + & +!!$ grho(2,k,1) * grho(2,k,2) + & +!!$ grho(3,k,1) * grho(3,k,2) +!!$ ! +!!$ CALL gcc_spin_more( rup, rdw, grhoup, grhodw, grhoud, & +!!$ sc, v1cup, v1cdw, v2cup, v2cdw, v2cud ) + ! + ELSE + ! + zeta = ( rhoout(k,1) - rhoout(k,2) ) / rh + if (nspin.eq.4.and.domag) zeta=abs(zeta)*segni(k) + ! + grh2 = ( grho(1,k,1) + grho(1,k,2) )**2 + & + ( grho(2,k,1) + grho(2,k,2) )**2 + & + ( grho(3,k,1) + grho(3,k,2) )**2 + ! + CALL gcc_spin( rh, zeta, grh2, sc, v1cup, v1cdw, v2c ) + ! + v2cup = v2c + v2cdw = v2c + v2cud = v2c + ! + END IF + ! + ELSE + ! + sc = 0.D0 + v1cup = 0.D0 + v1cdw = 0.D0 + v2c = 0.D0 + v2cup = 0.D0 + v2cdw = 0.D0 + v2cud = 0.D0 + ! + ENDIF + ! + ! ... first term of the gradient correction : D(rho*Exc)/D(rho) + ! + v(k,1) = v(k,1) + e2 * ( v1xup + v1cup ) + v(k,2) = v(k,2) + e2 * ( v1xdw + v1cdw ) + ! + ! ... h contains D(rho*Exc)/D(|grad rho|) * (grad rho) / |grad rho| + ! + DO ipol = 1, 3 + ! + grup = grho(ipol,k,1) + grdw = grho(ipol,k,2) + h(ipol,k,1) = e2 * ( ( v2xup + v2cup ) * grup + v2cud * grdw ) + h(ipol,k,2) = e2 * ( ( v2xdw + v2cdw ) * grdw + v2cud * grup ) + ! + END DO + ! + vtxcgc = vtxcgc + & + e2 * ( v1xup + v1cup ) * ( rhoout(k,1) - rho_core(k) * fac ) + vtxcgc = vtxcgc + & + e2 * ( v1xdw + v1cdw ) * ( rhoout(k,2) - rho_core(k) * fac ) + etxcgc = etxcgc + e2 * ( sx + sc ) + ! + END DO +!$omp end parallel do + ! + END IF + ! + DO is = 1, nspin0 + ! + rhoout(:,is) = rhoout(:,is) - fac * rho_core(:) + ! + END DO + ! + DEALLOCATE( grho ) + ! + ALLOCATE( dh( dfftp%nnr ) ) + ! + ! ... second term of the gradient correction : + ! ... \sum_alpha (D / D r_alpha) ( D(rho*Exc)/D(grad_alpha rho) ) + ! + DO is = 1, nspin0 + ! + CALL grad_dot( dfftp%nnr, h(1,1,is), ngm, g, nl, alat, dh ) + ! + v(:,is) = v(:,is) - dh(:) + ! + vtxcgc = vtxcgc - SUM( dh(:) * rhoout(:,is) ) + ! + END DO + ! + vtxc = vtxc + omega * vtxcgc / ( dfftp%nr1 * dfftp%nr2 * dfftp%nr3 ) + etxc = etxc + omega * etxcgc / ( dfftp%nr1 * dfftp%nr2 * dfftp%nr3 ) + + IF (nspin==4.AND.domag) THEN + DO is=1,nspin0 + vgg(:,is)=v(:,is) + ENDDO + v=vsave + DO k=1,dfftp%nnr + v(k,1)=v(k,1)+0.5d0*(vgg(k,1)+vgg(k,2)) + amag=sqrt(rho(k,2)**2+rho(k,3)**2+rho(k,4)**2) + IF (amag.GT.1.d-12) THEN + v(k,2)=v(k,2)+segni(k)*0.5d0*(vgg(k,1)-vgg(k,2))*rho(k,2)/amag + v(k,3)=v(k,3)+segni(k)*0.5d0*(vgg(k,1)-vgg(k,2))*rho(k,3)/amag + v(k,4)=v(k,4)+segni(k)*0.5d0*(vgg(k,1)-vgg(k,2))*rho(k,4)/amag + ENDIF + ENDDO + ENDIF + ! + DEALLOCATE( dh ) + DEALLOCATE( h ) + DEALLOCATE( rhoout ) + IF (nspin==4.and.domag) THEN + DEALLOCATE( vgg ) + DEALLOCATE( vsave ) + DEALLOCATE( segni ) + ENDIF + ! + RETURN + ! +END SUBROUTINE gradcorr +! +!---------------------------------------------------------------------------- +SUBROUTINE gradrho( nrxx, a, ngm, g, nl, ga ) + !---------------------------------------------------------------------------- + ! + ! ... Calculates ga = \grad a in R-space (a is in G-space) + ! + USE kinds, ONLY : DP + USE constants, ONLY : tpi + USE cell_base, ONLY : tpiba + USE gvect, ONLY : nlm + USE fft_base, ONLY : dfftp + USE fft_interfaces,ONLY : invfft + + ! + IMPLICIT NONE + ! + INTEGER, INTENT(IN) :: nrxx + INTEGER, INTENT(IN) :: ngm, nl(ngm) + COMPLEX(DP), INTENT(IN) :: a(ngm) + REAL(DP), INTENT(IN) :: g(3,ngm) + REAL(DP), INTENT(OUT) :: ga(3,nrxx) + ! + INTEGER :: ipol + COMPLEX(DP), ALLOCATABLE :: gaux(:) + ! + ! + ALLOCATE( gaux( nrxx ) ) + ! + ! ... multiply by (iG) to get (\grad_ipol a)(G) ... + ! + ga(:,:) = 0.D0 + ! + DO ipol = 1, 3 + ! + gaux(:) = CMPLX(0.d0,0.d0,kind=dp) + ! + gaux(nl(:)) = g(ipol,:) * CMPLX( -AIMAG( a(:) ), REAL( a(:) ) ,kind=DP) + ! + ! + ! ... bring back to R-space, (\grad_ipol a)(r) ... + ! + CALL invfft ('Dense', gaux, dfftp) + ! + ! ...and add the factor 2\pi/a missing in the definition of G + ! + ga(ipol,:) = ga(ipol,:) + tpiba * REAL( gaux(:) ) + ! + END DO + ! + DEALLOCATE( gaux ) + ! + RETURN + ! +END SUBROUTINE gradrho +! +!---------------------------------------------------------------------------- +SUBROUTINE grad_dot( nrxx, a, ngm, g, nl, alat, da ) + !---------------------------------------------------------------------------- + ! + ! ... Calculates da = \sum_i \grad_i a_i in R-space + ! + USE constants, ONLY : tpi + USE cell_base, ONLY : tpiba + USE kinds, ONLY : DP + USE gvect, ONLY : nlm +!!$ USE control_flags, ONLY : gamma_only + USE fft_base, ONLY : dfftp + USE fft_interfaces,ONLY : fwfft, invfft + ! + IMPLICIT NONE + ! + INTEGER, INTENT(IN) :: nrxx, ngm, nl(ngm) + REAL(DP), INTENT(IN) :: a(3,nrxx), g(3,ngm), alat + REAL(DP), INTENT(OUT) :: da(nrxx) + ! + INTEGER :: n, ipol + COMPLEX(DP), ALLOCATABLE :: aux(:), gaux(:) + ! + ! + ALLOCATE( aux( nrxx ), gaux( nrxx ) ) + ! + gaux(:) = CMPLX(0.d0,0.d0, kind=dp) + ! + DO ipol = 1, 3 + ! + aux = CMPLX( a(ipol,:), 0.D0 ,kind=DP) + ! + ! ... bring a(ipol,r) to G-space, a(G) ... + ! + CALL fwfft ('Dense', aux, dfftp) + ! + DO n = 1, ngm + ! + gaux(nl(n)) = gaux(nl(n)) + g(ipol,n) * & + CMPLX( -AIMAG( aux(nl(n)) ), REAL( aux(nl(n)) ) ,kind=DP) + ! + END DO + ! + END DO + ! + ! + ! ... bring back to R-space, (\grad_ipol a)(r) ... + ! + CALL invfft ('Dense', gaux, dfftp) + ! + ! ... add the factor 2\pi/a missing in the definition of G and sum + ! + da(:) = tpiba * REAL( gaux(:) ) + ! + DEALLOCATE( aux, gaux ) + ! + RETURN + ! +END SUBROUTINE grad_dot diff --git a/tests/apps/miniDFT/tests/src/griddim.f90 b/tests/apps/miniDFT/tests/src/griddim.f90 new file mode 100644 index 0000000000..9bb0aeb820 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/griddim.f90 @@ -0,0 +1,280 @@ +! +! Copyright (C) 2002-2010 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! + +!=----------------------------------------------------------------------------=! + MODULE grid_subroutines +!=----------------------------------------------------------------------------=! + + ! This module contains subroutines that are related to grids + ! parameters + + USE kinds, ONLY: DP + USE fft_types, ONLY: fft_dlay_descriptor + + IMPLICIT NONE + SAVE + + PRIVATE + PUBLIC :: realspace_grids_init, realspace_grid_init_custom, realspace_grids_info + + CONTAINS + + + SUBROUTINE realspace_grids_init( dfftp, dffts, at, bg, gcutm, gcuts ) + ! + USE fft_scalar, only: good_fft_dimension, good_fft_order + USE io_global, only: stdout + ! + IMPLICIT NONE + ! + REAL(DP), INTENT(IN) :: at(3,3), bg(3,3) + REAL(DP), INTENT(IN) :: gcutm, gcuts + TYPE(fft_dlay_descriptor), INTENT(INOUT) :: dfftp, dffts + ! + IF( dfftp%nr1 == 0 .OR. dfftp%nr2 == 0 .OR. dfftp%nr3 == 0 ) THEN + ! + ! ... calculate the size of the real-space dense grid for FFT + ! ... first, an estimate of nr1,nr2,nr3, based on the max values + ! ... of n_i indices in: G = i*b_1 + j*b_2 + k*b_3 + ! ... We use G*a_i = n_i => n_i .le. |Gmax||a_i| + ! + dfftp%nr1 = int ( sqrt (gcutm) * & + sqrt (at(1, 1)**2 + at(2, 1)**2 + at(3, 1)**2) ) + 1 + dfftp%nr2 = int ( sqrt (gcutm) * & + sqrt (at(1, 2)**2 + at(2, 2)**2 + at(3, 2)**2) ) + 1 + dfftp%nr3 = int ( sqrt (gcutm) * & + sqrt (at(1, 3)**2 + at(2, 3)**2 + at(3, 3)**2) ) + 1 + ! + CALL grid_set( bg, gcutm, dfftp%nr1, dfftp%nr2, dfftp%nr3 ) + ! + ELSE + WRITE( stdout, '( /, 3X,"Info: using nr1, nr2, nr3 values from input" )' ) + END IF + + dfftp%nr1 = good_fft_order( dfftp%nr1 ) + dfftp%nr2 = good_fft_order( dfftp%nr2 ) + dfftp%nr3 = good_fft_order( dfftp%nr3 ) + + dfftp%nr1x = good_fft_dimension( dfftp%nr1 ) + dfftp%nr2x = dfftp%nr2 + dfftp%nr3x = good_fft_dimension( dfftp%nr3 ) + + ! ... As above, for the smooth grid + + IF( dffts%nr1 == 0 .OR. dffts%nr2 == 0 .OR. dffts%nr3 == 0 ) THEN + ! + IF ( gcuts == gcutm ) THEN + ! ... No double grid, the two grids are the same + dffts%nr1 = dfftp%nr1 ; dffts%nr2 = dfftp%nr2 ; dffts%nr3 = dfftp%nr3 + dffts%nr1x= dfftp%nr1x; dffts%nr2x= dfftp%nr2x; dffts%nr3x= dfftp%nr3x + RETURN + END IF + ! + dffts%nr1= int (2 * sqrt (gcuts) * & + sqrt (at(1, 1)**2 + at(2, 1)**2 + at(3, 1)**2) ) + 1 + dffts%nr2= int (2 * sqrt (gcuts) * & + sqrt (at(1, 2)**2 + at(2, 2)**2 + at(3, 2)**2) ) + 1 + dffts%nr3= int (2 * sqrt (gcuts) * & + sqrt (at(1, 3)**2 + at(2, 3)**2 + at(3, 3)**2) ) + 1 + ! + CALL grid_set( bg, gcuts, dffts%nr1, dffts%nr2, dffts%nr3 ) + ! + ELSE + WRITE( stdout, '( /, 3X,"Info: using nr1s, nr2s, nr3s values from input" )' ) + END IF + + dffts%nr1 = good_fft_order( dffts%nr1 ) + dffts%nr2 = good_fft_order( dffts%nr2 ) + dffts%nr3 = good_fft_order( dffts%nr3 ) + + dffts%nr1x = good_fft_dimension(dffts%nr1) + dffts%nr2x = dffts%nr2 + dffts%nr3x = good_fft_dimension(dffts%nr3) + + IF ( dffts%nr1 > dfftp%nr1 .or. dffts%nr2 > dfftp%nr2 .or. dffts%nr3 > dfftp%nr3 ) THEN + CALL errore(' realspace_grids_init ', ' smooth grid larger than dense grid?',1) + END IF + + RETURN + + END SUBROUTINE realspace_grids_init + +!=----------------------------------------------------------------------------=! + + SUBROUTINE realspace_grid_init_custom( dfftp, at, bg, gcutm ) + ! + USE fft_scalar, only: good_fft_dimension, good_fft_order + USE io_global, only: stdout + ! + IMPLICIT NONE + ! + REAL(DP), INTENT(IN) :: at(3,3), bg(3,3) + REAL(DP), INTENT(IN) :: gcutm + TYPE(fft_dlay_descriptor), INTENT(INOUT) :: dfftp + ! + IF( dfftp%nr1 == 0 .OR. dfftp%nr2 == 0 .OR. dfftp%nr3 == 0 ) THEN + ! + ! ... calculate the size of the real-space dense grid for FFT + ! ... first, an estimate of nr1,nr2,nr3, based on the max values + ! ... of n_i indices in: G = i*b_1 + j*b_2 + k*b_3 + ! ... We use G*a_i = n_i => n_i .le. |Gmax||a_i| + ! + dfftp%nr1 = int ( sqrt (gcutm) * & + sqrt (at(1, 1)**2 + at(2, 1)**2 + at(3, 1)**2) ) + 1 + dfftp%nr2 = int ( sqrt (gcutm) * & + sqrt (at(1, 2)**2 + at(2, 2)**2 + at(3, 2)**2) ) + 1 + dfftp%nr3 = int ( sqrt (gcutm) * & + sqrt (at(1, 3)**2 + at(2, 3)**2 + at(3, 3)**2) ) + 1 + ! + CALL grid_set( bg, gcutm, dfftp%nr1, dfftp%nr2, dfftp%nr3 ) + ! + ELSE + WRITE( stdout, '( /, 3X,"Info: using nr1, nr2, nr3 values from input" )' ) + END IF + + dfftp%nr1 = good_fft_order( dfftp%nr1 ) + dfftp%nr2 = good_fft_order( dfftp%nr2 ) + dfftp%nr3 = good_fft_order( dfftp%nr3 ) + + dfftp%nr1x = good_fft_dimension( dfftp%nr1 ) + dfftp%nr2x = dfftp%nr2 + dfftp%nr3x = good_fft_dimension( dfftp%nr3 ) + + RETURN + + END SUBROUTINE realspace_grid_init_custom + +!=----------------------------------------------------------------------------=! + + SUBROUTINE realspace_grids_info ( dfftp, dffts, nproc_ ) + + ! Print info on local and global dimensions for real space grids + + USE io_global, ONLY: ionode, stdout + USE fft_types, ONLY: fft_dlay_descriptor + + IMPLICIT NONE + + TYPE(fft_dlay_descriptor), INTENT(IN) :: dfftp, dffts + INTEGER, INTENT(IN) :: nproc_ + + INTEGER :: i + + IF(ionode) THEN + + WRITE( stdout,*) + WRITE( stdout,*) ' Real Mesh' + WRITE( stdout,*) ' ---------' + WRITE( stdout,1000) dfftp%nr1, dfftp%nr2, dfftp%nr3, dfftp%nr1, dfftp%nr2, dfftp%npl, 1, 1, nproc_ + WRITE( stdout,1010) dfftp%nr1x, dfftp%nr2x, dfftp%nr3x + WRITE( stdout,1020) dfftp%nnr + WRITE( stdout,*) ' Number of x-y planes for each processors: ' + WRITE( stdout, fmt = '( 3X, "nr3l = ", 10I5 )' ) & + ( dfftp%npp( i ), i = 1, nproc_ ) + + WRITE( stdout,*) + WRITE( stdout,*) ' Smooth Real Mesh' + WRITE( stdout,*) ' ----------------' + WRITE( stdout,1000) dffts%nr1, dffts%nr2, dffts%nr3, dffts%nr1, dffts%nr2, dffts%npl,1,1, nproc_ + WRITE( stdout,1010) dffts%nr1x, dffts%nr2x, dffts%nr3x + WRITE( stdout,1020) dffts%nnr + WRITE( stdout,*) ' Number of x-y planes for each processors: ' + WRITE( stdout, fmt = '( 3X, "nr3sl = ", 10I5 )' ) & + ( dffts%npp( i ), i = 1, nproc_ ) + + END IF + +1000 FORMAT(3X, & + 'Global Dimensions Local Dimensions Processor Grid',/,3X, & + '.X. .Y. .Z. .X. .Y. .Z. .X. .Y. .Z.',/, & + 3(1X,I5),2X,3(1X,I5),2X,3(1X,I5) ) +1010 FORMAT(3X, 'Array leading dimensions ( nr1x, nr2x, nr3x ) = ', 3(1X,I5) ) +1020 FORMAT(3X, 'Local number of cell to store the grid ( nrxx ) = ', 1X, I9 ) + + RETURN + END SUBROUTINE realspace_grids_info + + + SUBROUTINE grid_set( bg, gcut, nr1, nr2, nr3 ) + +! this routine returns in nr1, nr2, nr3 the minimal 3D real-space FFT +! grid required to fit the G-vector sphere with G^2 <= gcut +! On input, nr1,nr2,nr3 must be set to values that match or exceed +! the largest i,j,k (Miller) indices in G(i,j,k) = i*b1 + j*b2 + k*b3 +! ---------------------------------------------- + +! ... declare modules + USE kinds, ONLY: DP + USE mp, ONLY: mp_max, mp_min, mp_sum + USE mp_global, ONLY: me_image, nproc_image, intra_image_comm + + IMPLICIT NONE + +! ... declare arguments + INTEGER, INTENT(INOUT) :: nr1, nr2, nr3 + REAL(DP), INTENT(IN) :: bg(3,3), gcut + +! ... declare other variables + INTEGER :: i, j, k, nr, nb(3) + REAL(DP) :: gsq, g(3) + +! ---------------------------------------------- + + nb = 0 + +! ... calculate moduli of G vectors and the range of indices where +! ... |G|^2 < gcut (in parallel whenever possible) + + DO k = -nr3, nr3 + ! + ! ... me_image = processor number, starting from 0 + ! + IF( MOD( k + nr3, nproc_image ) == me_image ) THEN + DO j = -nr2, nr2 + DO i = -nr1, nr1 + + g( 1 ) = DBLE(i)*bg(1,1) + DBLE(j)*bg(1,2) + DBLE(k)*bg(1,3) + g( 2 ) = DBLE(i)*bg(2,1) + DBLE(j)*bg(2,2) + DBLE(k)*bg(2,3) + g( 3 ) = DBLE(i)*bg(3,1) + DBLE(j)*bg(3,2) + DBLE(k)*bg(3,3) + +! ... calculate modulus + + gsq = g( 1 )**2 + g( 2 )**2 + g( 3 )**2 + + IF( gsq < gcut ) THEN + +! ... calculate maximum index + nb(1) = MAX( nb(1), ABS( i ) ) + nb(2) = MAX( nb(2), ABS( j ) ) + nb(3) = MAX( nb(3), ABS( k ) ) + END IF + + END DO + END DO + END IF + END DO + + CALL mp_max( nb, intra_image_comm ) + +! ... the size of the required (3-dimensional) matrix depends on the +! ... maximum indices. Note that the following choice is slightly +! ... "small": 2*nb+2 would be needed in order to guarantee that the +! ... sphere in G-space never overlaps its periodic image + + nr1 = 2 * nb(1) + 1 + nr2 = 2 * nb(2) + 1 + nr3 = 2 * nb(3) + 1 + + RETURN + + END SUBROUTINE grid_set + +!=----------------------------------------------------------------------------=! + END MODULE grid_subroutines +!=----------------------------------------------------------------------------=! + diff --git a/tests/apps/miniDFT/tests/src/h_1psi.f90 b/tests/apps/miniDFT/tests/src/h_1psi.f90 new file mode 100644 index 0000000000..8ca1eebbc3 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/h_1psi.f90 @@ -0,0 +1,38 @@ +! +! Copyright (C) 2001 PWSCF group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +!---------------------------------------------------------------------------- +SUBROUTINE h_1psi( lda, n, psi, hpsi, spsi ) + !---------------------------------------------------------------------------- + ! + ! ... This routine applies the Hamiltonian and the S matrix + ! ... to a vector psi and puts the result in hpsi and spsi + ! ... Wrapper routine - calls h_psi and s_psi + ! + USE kinds, ONLY: DP + + ! + IMPLICIT NONE + ! + integer, parameter :: npol=1 !substitute for noncollin_module%npol + INTEGER :: lda, n + COMPLEX (DP) :: psi(lda*npol,1), hpsi(n), spsi(n,1) + ! + ! + CALL start_clock( 'h_1psi' ) + ! + !OBM: I know this form is somewhat inelegant but, leaving the pre-real_space part intact + ! makes it easier to debug probable errors, please do not "beautify" + CALL h_psi( lda, n, 1, psi, hpsi ) + CALL s_psi( lda, n, 1, psi, spsi ) + ! + CALL stop_clock( 'h_1psi' ) + ! + RETURN + ! +END SUBROUTINE h_1psi diff --git a/tests/apps/miniDFT/tests/src/h_psi.f90 b/tests/apps/miniDFT/tests/src/h_psi.f90 new file mode 100644 index 0000000000..7c125fa766 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/h_psi.f90 @@ -0,0 +1,78 @@ + +! Copyright (C) 2002-2009 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +!---------------------------------------------------------------------------- +SUBROUTINE h_psi( lda, n, m, psi, hpsi ) + !---------------------------------------------------------------------------- + ! + ! ... This routine computes the product of the Hamiltonian + ! ... matrix with m wavefunctions contained in psi + ! + ! ... input: + ! ... lda leading dimension of arrays psi, spsi, hpsi + ! ... n true dimension of psi, spsi, hpsi + ! ... m number of states psi + ! ... psi + ! + ! ... output: + ! ... hpsi H*psi + ! + USE kinds, ONLY : DP + USE becmod, ONLY : bec_type, becp, calbec + USE lsda_mod, ONLY : current_spin + USE scf, ONLY : vrs + USE wvfct, ONLY : g2kin + USE uspp, ONLY : vkb, nkb + USE gvect, ONLY : gstart + USE fft_base, ONLY : dffts + ! + IMPLICIT NONE + ! + integer, parameter :: npol=1 !substitute for noncollin_module%npol + INTEGER, INTENT(IN) :: lda, n, m + COMPLEX(DP), INTENT(IN) :: psi(lda*npol,m) + COMPLEX(DP), INTENT(OUT) :: hpsi(lda*npol,m) + ! + INTEGER :: ipol, ibnd, incr + ! + CALL start_clock( 'h_psi' ) + ! + ! ... Here we apply the kinetic energy (k+G)^2 psi + ! + DO ibnd = 1, m + hpsi (1:n, ibnd) = g2kin (1:n) * psi (1:n, ibnd) + hpsi (n+1:lda,ibnd) = (0.0_dp, 0.0_dp) + END DO + ! + ! + ! + ! ... the local potential V_Loc psi + ! + CALL start_clock( 'h_psi:vloc' ) + ! + CALL vloc_psi_k ( lda, n, m, psi, vrs(1,current_spin), hpsi ) + ! + CALL stop_clock( 'h_psi:vloc' ) + ! + ! ... Here the product with the non local potential V_NL psi + ! ... (not in the real-space case: it is done together with V_loc) + ! + ! + CALL start_clock( 'h_psi:vnl' ) + CALL calbec ( n, vkb, psi, becp, m ) + CALL add_vuspsi( lda, n, m, hpsi ) + CALL stop_clock( 'h_psi:vnl' ) + ! + ! + ! ... electric enthalpy if required + ! + ! + CALL stop_clock( 'h_psi' ) + ! + RETURN + ! +END SUBROUTINE h_psi diff --git a/tests/apps/miniDFT/tests/src/hinit0.f90 b/tests/apps/miniDFT/tests/src/hinit0.f90 new file mode 100644 index 0000000000..ea11753425 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/hinit0.f90 @@ -0,0 +1,81 @@ +! +! Copyright (C) 2001-2005 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +!----------------------------------------------------------------------- +SUBROUTINE hinit0() + !----------------------------------------------------------------------- + ! + ! ... hamiltonian initialization: + ! ... atomic position independent initialization for nonlocal PP, + ! ... structure factors, local potential, core charge + ! + USE ions_base, ONLY : nat, nsp, ityp, tau + USE basis, ONLY : startingconfig + USE cell_base, ONLY : at, bg, omega, tpiba2 + USE klist, ONLY : nks, xk + USE fft_base, ONLY : dfftp + USE gvect, ONLY : ngm, ig_l2g, g, eigts1, eigts2, eigts3 + USE vlocal, ONLY : strf + USE wvfct, ONLY : npw, g2kin, igk, ecutwfc + USE io_files, ONLY : iunigk + USE control_flags, ONLY : tqr + USE io_global, ONLY : stdout + ! + IMPLICIT NONE + ! + INTEGER :: ik + ! counter on k points + ! + ! ... calculate the Fourier coefficients of the local part of the PP + ! + CALL init_vloc() + ! + ! ... k-point independent parameters of non-local pseudopotentials + ! + CALL init_us_1() + CALL init_at_1() + ! +#ifdef __IGKIO + REWIND( iunigk ) +#endif + ! + ! ... The following loop must NOT be called more than once in a run + ! ... or else there will be problems with variable-cell calculations + ! + DO ik = 1, nks + ! + ! ... g2kin is used here as work space + ! + CALL gk_sort( xk(1,ik), ngm, g, ecutwfc / tpiba2, npw, igk, g2kin ) + ! + ! ... if there is only one k-point npw and igk stay in memory + ! +#ifdef __IGKIO + IF ( nks > 1 ) WRITE( iunigk ) igk +#endif __IGKIO + ! + END DO + ! + ! + ! ... initialize the structure factor + ! + CALL struc_fact( nat, tau, nsp, ityp, ngm, g, bg, & + dfftp%nr1, dfftp%nr2, dfftp%nr3, strf, eigts1, eigts2, eigts3 ) + ! + ! ... calculate the total local potential + ! + CALL setlocal() + ! + ! ... calculate the core charge (if any) for the nonlinear core correction + ! + CALL set_rhoc() + ! + ! + RETURN + ! +END SUBROUTINE hinit0 + diff --git a/tests/apps/miniDFT/tests/src/image_io_routines.f90 b/tests/apps/miniDFT/tests/src/image_io_routines.f90 new file mode 100644 index 0000000000..99c3e246e4 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/image_io_routines.f90 @@ -0,0 +1,69 @@ +! +! Copyright (C) 2002-2006 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +!---------------------------------------------------------------------------- +MODULE image_io_routines + !---------------------------------------------------------------------------- + ! + ! ... This module contains all subroutines used for I/O in image + ! ... parallelization + ! + ! ... from the orignal path_io Written by Carlo Sbraccia ( 2003-2006 ) + ! + USE kinds, ONLY : DP + USE io_global, ONLY : meta_ionode, meta_ionode_id + ! + IMPLICIT NONE + ! + PRIVATE + ! + PUBLIC :: io_image_start, io_image_stop + ! + CONTAINS + ! + !----------------------------------------------------------------------- + SUBROUTINE io_image_start() + !----------------------------------------------------------------------- + ! + USE io_global, ONLY : ionode, ionode_id + USE mp_global, ONLY : me_image, root_image + ! + IMPLICIT NONE + ! + ! + ! ... the I/O node is set again according to the number of parallel + ! ... images that have been required: for each parallel image there + ! ... is only one node that does I/O + ! + ionode = ( me_image == root_image ) + ionode_id = root_image + ! + RETURN + ! + END SUBROUTINE io_image_start + ! + ! + !----------------------------------------------------------------------- + SUBROUTINE io_image_stop() + !----------------------------------------------------------------------- + ! + USE io_global, ONLY : io_global_start + USE mp_global, ONLY : mpime, root + ! + IMPLICIT NONE + ! + ! + ! ... the original I/O node is set again + ! + CALL io_global_start( mpime, root ) + ! + RETURN + ! + END SUBROUTINE io_image_stop + ! +END MODULE image_io_routines diff --git a/tests/apps/miniDFT/tests/src/init_at_1.f90 b/tests/apps/miniDFT/tests/src/init_at_1.f90 new file mode 100644 index 0000000000..9bd5d389ca --- /dev/null +++ b/tests/apps/miniDFT/tests/src/init_at_1.f90 @@ -0,0 +1,70 @@ +! +! Copyright (C) 2001-2007 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +!----------------------------------------------------------------------- +subroutine init_at_1() + !----------------------------------------------------------------------- + ! + ! This routine computes a table with the radial Fourier transform + ! of the atomic wavefunctions. + ! + USE kinds, ONLY : dp + USE atom, ONLY : rgrid, msh + USE constants, ONLY : fpi + USE cell_base, ONLY : omega + USE ions_base, ONLY : ntyp => nsp + USE us, ONLY : tab_at, nqx, dq + USE uspp_param, ONLY : upf + USE mp_global, ONLY : intra_bgrp_comm + USE mp, ONLY : mp_sum + ! + implicit none + ! + integer :: nt, nb, iq, ir, l, startq, lastq, ndm + ! + real(DP), allocatable :: aux (:), vchi (:) + real(DP) :: vqint, pref, q + + call start_clock ('init_at_1') + + ndm = MAXVAL (msh(1:ntyp)) + allocate (aux(ndm),vchi(ndm)) + + ! + ! chiq = radial fourier transform of atomic orbitals chi + ! + pref = fpi/sqrt(omega) + ! needed to normalize atomic wfcs (not a bad idea in general and + ! necessary to compute correctly lda+U projections) + call divide (intra_bgrp_comm, nqx, startq, lastq) + tab_at(:,:,:) = 0.d0 + do nt = 1, ntyp + do nb = 1, upf(nt)%nwfc + if (upf(nt)%oc(nb) >= 0.d0) then + l = upf(nt)%lchi (nb) + do iq = startq, lastq + q = dq * (iq - 1) + call sph_bes (msh(nt), rgrid(nt)%r, q, l, aux) + do ir = 1, msh(nt) + vchi(ir) = upf(nt)%chi(ir,nb) * aux(ir) * rgrid(nt)%r(ir) + enddo + call simpson (msh(nt), vchi, rgrid(nt)%rab, vqint) + tab_at (iq, nb, nt) = vqint * pref + enddo + endif + enddo + enddo + call mp_sum ( tab_at, intra_bgrp_comm ) + + deallocate(aux ,vchi) + + call stop_clock ('init_at_1') + return + +end subroutine init_at_1 + diff --git a/tests/apps/miniDFT/tests/src/init_run.f90 b/tests/apps/miniDFT/tests/src/init_run.f90 new file mode 100644 index 0000000000..e3ca2f2633 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/init_run.f90 @@ -0,0 +1,133 @@ +! +! Copyright (C) 2001-2006 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +!---------------------------------------------------------------------------- +SUBROUTINE init_run() + !---------------------------------------------------------------------------- + ! + USE klist, ONLY : nkstot, nks + USE symme, ONLY : sym_rho_init + USE wvfct, ONLY : nbnd, et, wg, btype + USE control_flags, ONLY : lmd !!$, gamma_only + USE cell_base, ONLY : at, bg + USE recvec_subs, ONLY : ggen + USE dfunct, ONLY : newd + ! + IMPLICIT NONE + ! + ! + CALL start_clock( 'init_run' ) + ! + ! ... calculate limits of some indices, used in subsequent allocations + ! + CALL pre_init() + ! + ! ... allocate memory for G- and R-space fft arrays + ! + CALL allocate_fft() + ! + ! ... generate reciprocal-lattice vectors and fft indices + ! + CALL ggen ( .false. , at, bg ) + CALL gshells ( .false. ) + ! + ! ... variable initialization for parallel symmetrization + ! + CALL sym_rho_init (.false.) + ! + CALL summary() + ! +#ifndef __IGKIO + if( nks .ne. 1 )then + !bma 20May2013 + ! A small amount of file I/O is required for multiple k-points per pool. + ! MiniDFT skips this I/O (a feature), which introduces a bug if nks>1 + ! Stop here to count k-points without manually cancelling the job. + ! To enable multiple k-points per pool, recompile with -D__IGKIO + write(*,*) "================================" + write(*,*) "This job uses multiple k-points." + write(*,*) "Please restart with -npool",nkstot + stop + end if +#endif + ! + ! ... allocate memory for all other arrays (potentials, wavefunctions etc) + ! + CALL allocate_nlpot() + CALL allocate_locpot() + CALL allocate_wfc() + ! + CALL memory_report() + ! + ALLOCATE( et( nbnd, nkstot ) , wg( nbnd, nkstot ), btype( nbnd, nkstot ) ) + ! + et(:,:) = 0.D0 + wg(:,:) = 0.D0 + ! + btype(:,:) = 1 + ! + CALL openfil() + ! + CALL hinit0() + ! + CALL potinit() + ! + CALL newd() + ! + CALL wfcinit() + ! + ! + CALL stop_clock( 'init_run' ) + ! + + RETURN + ! +END SUBROUTINE init_run + ! +!---------------------------------------------------------------------------- +SUBROUTINE pre_init() + !---------------------------------------------------------------------------- + ! + USE ions_base, ONLY : nat, nsp, ityp + USE uspp_param, ONLY : upf, lmaxkb, nh, nhm, nbetam + USE uspp, ONLY : nkb, nkbus + IMPLICIT NONE + INTEGER :: na, nt, nb + ! + ! calculate the number of beta functions for each atomic type + ! + lmaxkb = - 1 + DO nt = 1, nsp + ! + nh (nt) = 0 + ! + ! do not add any beta projector if pseudo in 1/r fmt (AF) + IF ( upf(nt)%tcoulombp ) CYCLE + ! + DO nb = 1, upf(nt)%nbeta + nh (nt) = nh (nt) + 2 * upf(nt)%lll(nb) + 1 + lmaxkb = MAX (lmaxkb, upf(nt)%lll(nb) ) + ENDDO + ! + ENDDO + ! + ! calculate the maximum number of beta functions + ! + nhm = MAXVAL (nh (1:nsp)) + nbetam = MAXVAL (upf(:)%nbeta) + ! + ! calculate the number of beta functions of the solid + ! + nkb = 0 + nkbus = 0 + do na = 1, nat + nt = ityp(na) + nkb = nkb + nh (nt) + enddo + + +END SUBROUTINE pre_init diff --git a/tests/apps/miniDFT/tests/src/init_us_1.f90 b/tests/apps/miniDFT/tests/src/init_us_1.f90 new file mode 100644 index 0000000000..db9859b289 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/init_us_1.f90 @@ -0,0 +1,235 @@ + +! Copyright (C) 2001-2007 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +!---------------------------------------------------------------------- +subroutine init_us_1 + !---------------------------------------------------------------------- + ! + ! This routine performs the following tasks: + ! a) For each non vanderbilt pseudopotential it computes the D and + ! the betar in the same form of the Vanderbilt pseudopotential. + ! b) It computes the indices indv which establish the correspondence + ! nh <-> beta in the atom + ! c) It computes the indices nhtol which establish the correspondence + ! nh <-> angular momentum of the beta function + ! d) It computes the indices nhtolm which establish the correspondence + ! nh <-> combined (l,m) index for the beta function. + ! e) It computes the coefficients c_{LM}^{nm} which relates the + ! spherical harmonics in the Q expansion + ! f) It computes the radial fourier transform of the Q function on + ! all the g vectors + ! g) It computes the q terms which define the S matrix. + ! h) It fills the interpolation table for the beta functions + ! + USE kinds, ONLY : DP + USE parameters, ONLY : lmaxx + USE constants, ONLY : fpi, sqrt2 + USE atom, ONLY : rgrid + USE ions_base, ONLY : ntyp => nsp + USE cell_base, ONLY : omega, tpiba + USE gvect, ONLY : g, gg + USE lsda_mod, ONLY : nspin + USE us, ONLY : nqxq, dq, nqx, tab, tab_d2y, qrad, spline_ps + USE splinelib + USE uspp, ONLY : nhtol, nhtoj, nhtolm, ijtoh, dvan, qq, indv,& + ap, aainit, qq_so, dvan_so, okvan + USE uspp_param, ONLY : upf, lmaxq, nbetam, nh, nhm, lmaxkb + USE spin_orb, ONLY : lspinorb, rot_ylm, fcoef + USE mp_global, ONLY : intra_bgrp_comm + USE mp, ONLY : mp_sum + ! + implicit none + ! + ! here a few local variables + ! + integer :: nt, ih, jh, nb, mb, ijv, l, m, ir, iq, is, startq, & + lastq, ilast, ndm + ! various counters + real(DP), allocatable :: aux (:), aux1 (:), besr (:), qtot (:,:) + ! various work space + real(DP) :: prefr, pref, q, qi + ! the prefactor of the q functions + ! the prefactor of the beta functions + ! the modulus of g for each shell + ! q-point grid for interpolation + real(DP), allocatable :: ylmk0 (:) + ! the spherical harmonics + real(DP) :: vqint, j + ! interpolated value + ! J=L+S (noninteger!) + integer :: n1, m0, m1, n, li, mi, vi, vj, ijs, is1, is2, & + lk, mk, vk, kh, lh + integer, external :: sph_ind + complex(DP) :: coeff, qgm(1) + real(DP) :: spinor, ji, jk + ! + real(DP), allocatable :: xdata(:) + real(DP) :: d1 + ! + call start_clock ('init_us_1') + ! + ! Initialization of the variables + ! + ndm = MAXVAL ( upf(:)%kkbeta ) + allocate (aux ( ndm)) + allocate (aux1( ndm)) + allocate (besr( ndm)) + allocate (qtot( ndm , nbetam*(nbetam+1)/2 )) + allocate (ylmk0( lmaxq * lmaxq)) + ap (:,:,:) = 0.d0 + if (lmaxq > 0) qrad(:,:,:,:)= 0.d0 + ! + ! the following prevents an out-of-bound error: upf(nt)%nqlc=2*lmax+1 + ! but in some versions of the PP files lmax is not set to the maximum + ! l of the beta functions but includes the l of the local potential + ! + do nt=1,ntyp + upf(nt)%nqlc = MIN ( upf(nt)%nqlc, lmaxq ) + IF ( upf(nt)%nqlc < 0 ) upf(nt)%nqlc = 0 + end do + + prefr = fpi / omega + if (lspinorb) then +! +! In the spin-orbit case we need the unitary matrix u which rotates the +! real spherical harmonics and yields the complex ones. +! + rot_ylm=(0.d0,0.d0) + l=lmaxx + rot_ylm(l+1,1)=(1.d0,0.d0) + do n1=2,2*l+1,2 + m=n1/2 + n=l+1-m + rot_ylm(n,n1)=CMPLX((-1.d0)**m/sqrt2,0.0_dp,kind=DP) + rot_ylm(n,n1+1)=CMPLX(0.d0,-(-1.d0)**m/sqrt2,kind=DP) + n=l+1+m + rot_ylm(n,n1)=CMPLX(1.0_dp/sqrt2,0.d0,kind=DP) + rot_ylm(n,n1+1)=CMPLX(0.d0, 1.0_dp/sqrt2,kind=DP) + enddo + fcoef=(0.d0,0.d0) + dvan_so = (0.d0,0.d0) + qq_so=(0.d0,0.d0) + qq = 0.d0 + else + qq = 0.d0 + dvan = 0.d0 + endif + ! + ! For each pseudopotential we initialize the indices nhtol, nhtolm, + ! nhtoj, indv, and if the pseudopotential is of KB type we initialize the + ! atomic D terms + ! + do nt = 1, ntyp + ih = 1 + do nb = 1, upf(nt)%nbeta + l = upf(nt)%lll (nb) + do m = 1, 2 * l + 1 + nhtol (ih, nt) = l + nhtolm(ih, nt) = l*l+m + indv (ih, nt) = nb + ih = ih + 1 + enddo + enddo + ! ijtoh map augmentation channel indexes ih and jh to composite + ! "triangular" index ijh + ijtoh(:,:,nt) = -1 + ijv = 0 + do ih = 1,nh(nt) + do jh = ih,nh(nt) + ijv = ijv+1 + ijtoh(ih,jh,nt) = ijv + ijtoh(jh,ih,nt) = ijv + enddo + enddo + ! + ! From now on the only difference between KB and US pseudopotentials + ! is in the presence of the q and Q functions. + ! + ! Here we initialize the D of the solid + ! + do ih = 1, nh (nt) + do jh = 1, nh (nt) + if (nhtol (ih, nt) == nhtol (jh, nt) .and. & + nhtolm(ih, nt) == nhtolm(jh, nt) ) then + ir = indv (ih, nt) + is = indv (jh, nt) + if (lspinorb) then + dvan_so (ih, jh, 1, nt) = upf(nt)%dion (ir, is) + dvan_so (ih, jh, 4, nt) = upf(nt)%dion (ir, is) + else + dvan (ih, jh, nt) = upf(nt)%dion (ir, is) + endif + endif + enddo + enddo + enddo + ! + ! here for the US types we compute the Fourier transform of the + ! Q functions. + ! + call divide (intra_bgrp_comm, nqxq, startq, lastq) + ! + do nt = 1, ntyp + ! ntyp + enddo + ! + ! and finally we compute the qq coefficients by integrating the Q. + ! q are the g=0 components of Q. + ! + if (gg (1) > 1.0d-8) goto 100 + call ylmr2 (lmaxq * lmaxq, 1, g, gg, ylmk0) +100 continue + call mp_sum( qq , intra_bgrp_comm ) + ! + ! fill the interpolation table tab + ! + pref = fpi / sqrt (omega) + call divide (intra_bgrp_comm, nqx, startq, lastq) + tab (:,:,:) = 0.d0 + do nt = 1, ntyp + do nb = 1, upf(nt)%nbeta + l = upf(nt)%lll (nb) + do iq = startq, lastq + qi = (iq - 1) * dq + call sph_bes (upf(nt)%kkbeta, rgrid(nt)%r, qi, l, besr) + do ir = 1, upf(nt)%kkbeta + aux (ir) = upf(nt)%beta (ir, nb) * besr (ir) * rgrid(nt)%r(ir) + enddo + call simpson (upf(nt)%kkbeta, aux, rgrid(nt)%rab, vqint) + tab (iq, nb, nt) = vqint * pref + enddo + enddo + enddo + + call mp_sum( tab, intra_bgrp_comm ) + + ! initialize spline interpolation + if (spline_ps) then + allocate( xdata(nqx) ) + do iq = 1, nqx + xdata(iq) = (iq - 1) * dq + enddo + do nt = 1, ntyp + do nb = 1, upf(nt)%nbeta + d1 = (tab(2,nb,nt) - tab(1,nb,nt)) / dq + call spline(xdata, tab(:,nb,nt), 0.d0, d1, tab_d2y(:,nb,nt)) + enddo + enddo + deallocate(xdata) + endif + + deallocate (ylmk0) + deallocate (qtot) + deallocate (besr) + deallocate (aux1) + deallocate (aux) + + call stop_clock ('init_us_1') + return +end subroutine init_us_1 + diff --git a/tests/apps/miniDFT/tests/src/init_us_2.f90 b/tests/apps/miniDFT/tests/src/init_us_2.f90 new file mode 100644 index 0000000000..473f06643e --- /dev/null +++ b/tests/apps/miniDFT/tests/src/init_us_2.f90 @@ -0,0 +1,154 @@ +! +! Copyright (C) 2001 PWSCF group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +!---------------------------------------------------------------------- +subroutine init_us_2 (npw_, igk_, q_, vkb_) + !---------------------------------------------------------------------- + ! + ! Calculates beta functions (Kleinman-Bylander projectors), with + ! structure factor, for all atoms, in reciprocal space. On input: + ! npw_ : number of PWs + ! igk_(npw_) : indices of G in the list of q+G vectors + ! q_(3) : q vector (2pi/a units) + ! On output: + ! vkb_(npwx,nkb) : beta functions (npw_ <= npwx) + ! + USE kinds, ONLY : DP + USE ions_base, ONLY : nat, ntyp => nsp, ityp, tau + USE cell_base, ONLY : tpiba + USE constants, ONLY : tpi + USE gvect, ONLY : eigts1, eigts2, eigts3, mill, g + USE wvfct, ONLY : npwx + USE us, ONLY : nqx, dq, tab, tab_d2y, spline_ps + USE splinelib + USE uspp, ONLY : nkb, nhtol, nhtolm, indv + USE uspp_param, ONLY : upf, lmaxkb, nhm, nh + ! + implicit none + ! + INTEGER, INTENT (IN) :: npw_, igk_ (npw_) + REAL(dp), INTENT(IN) :: q_(3) + COMPLEX(dp), INTENT(OUT) :: vkb_ (npwx, nkb) + ! + ! Local variables + ! + integer :: i0,i1,i2,i3, ig, l, lm, na, nt, nb, ih, jkb + + real(DP) :: px, ux, vx, wx, arg + real(DP), allocatable :: gk (:,:), qg (:), vq (:), ylm (:,:), vkb1(:,:) + + complex(DP) :: phase, pref + complex(DP), allocatable :: sk(:) + + real(DP), allocatable :: xdata(:) + integer :: iq + + ! + ! + if (lmaxkb.lt.0) return + call start_clock ('init_us_2') + allocate (vkb1( npw_,nhm)) + allocate ( sk( npw_)) + allocate ( qg( npw_)) + allocate ( vq( npw_)) + allocate ( ylm( npw_, (lmaxkb + 1) **2)) + allocate ( gk( 3, npw_)) + ! + do ig = 1, npw_ + gk (1,ig) = q_(1) + g(1, igk_(ig) ) + gk (2,ig) = q_(2) + g(2, igk_(ig) ) + gk (3,ig) = q_(3) + g(3, igk_(ig) ) + qg (ig) = gk(1, ig)**2 + gk(2, ig)**2 + gk(3, ig)**2 + enddo + ! + call ylmr2 ((lmaxkb+1)**2, npw_, gk, qg, ylm) + ! + ! set now qg=|q+G| in atomic units + ! + do ig = 1, npw_ + qg(ig) = sqrt(qg(ig))*tpiba + enddo + + if (spline_ps) then + allocate(xdata(nqx)) + do iq = 1, nqx + xdata(iq) = (iq - 1) * dq + enddo + endif + ! |beta_lm(q)> = (4pi/omega).Y_lm(q).f_l(q).(i^l).S(q) + jkb = 0 + do nt = 1, ntyp + ! calculate beta in G-space using an interpolation table f_l(q)=\int _0 ^\infty dr r^2 f_l(r) j_l(q.r) + do nb = 1, upf(nt)%nbeta + do ig = 1, npw_ + if (spline_ps) then + vq(ig) = splint(xdata, tab(:,nb,nt), tab_d2y(:,nb,nt), qg(ig)) + else + px = qg (ig) / dq - int (qg (ig) / dq) + ux = 1.d0 - px + vx = 2.d0 - px + wx = 3.d0 - px + i0 = INT( qg (ig) / dq ) + 1 + i1 = i0 + 1 + i2 = i0 + 2 + i3 = i0 + 3 + vq (ig) = tab (i0, nb, nt) * ux * vx * wx / 6.d0 + & + tab (i1, nb, nt) * px * vx * wx / 2.d0 - & + tab (i2, nb, nt) * px * ux * wx / 2.d0 + & + tab (i3, nb, nt) * px * ux * vx / 6.d0 + endif + enddo + ! add spherical harmonic part (Y_lm(q)*f_l(q)) + do ih = 1, nh (nt) + if (nb.eq.indv (ih, nt) ) then + l = nhtol (ih, nt) + lm =nhtolm (ih, nt) + do ig = 1, npw_ + vkb1 (ig,ih) = ylm (ig, lm) * vq (ig) + enddo + endif + enddo + enddo + ! + ! vkb1 contains all betas including angular part for type nt + ! now add the structure factor and factor (-i)^l + ! + do na = 1, nat + ! ordering: first all betas for atoms of type 1 + ! then all betas for atoms of type 2 and so on + if (ityp (na) .eq.nt) then + arg = (q_(1) * tau (1, na) + & + q_(2) * tau (2, na) + & + q_(3) * tau (3, na) ) * tpi + phase = CMPLX(cos (arg), - sin (arg) ,kind=DP) + do ig = 1, npw_ + sk (ig) = eigts1 (mill(1,igk_(ig)), na) * & + eigts2 (mill(2,igk_(ig)), na) * & + eigts3 (mill(3,igk_(ig)), na) + enddo + do ih = 1, nh (nt) + jkb = jkb + 1 + pref = (0.d0, -1.d0) **nhtol (ih, nt) * phase + do ig = 1, npw_ + vkb_(ig, jkb) = vkb1 (ig,ih) * sk (ig) * pref + enddo + enddo + endif + enddo + enddo + deallocate (gk) + deallocate (ylm) + deallocate (vq) + deallocate (qg) + deallocate (sk) + deallocate (vkb1) + + call stop_clock ('init_us_2') + return +end subroutine init_us_2 + diff --git a/tests/apps/miniDFT/tests/src/init_vloc.f90 b/tests/apps/miniDFT/tests/src/init_vloc.f90 new file mode 100644 index 0000000000..82df4d1a5d --- /dev/null +++ b/tests/apps/miniDFT/tests/src/init_vloc.f90 @@ -0,0 +1,53 @@ +! +! Copyright (C) 2001-2007 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +!---------------------------------------------------------------------- +subroutine init_vloc() + !---------------------------------------------------------------------- + ! + ! This routine computes the fourier coefficient of the local + ! potential vloc(ig,it) for each type of atom + ! + USE atom, ONLY : msh, rgrid + USE kinds, ONLY : dp + USE uspp_param, ONLY : upf + USE ions_base, ONLY : ntyp => nsp + USE cell_base, ONLY : omega, tpiba2 + USE vlocal, ONLY : vloc + USE gvect, ONLY : ngl, gl + ! + implicit none + ! + integer :: nt + ! counter on atomic types + ! + call start_clock ('init_vloc') + vloc(:,:) = 0._dp + do nt = 1, ntyp + ! + ! compute V_loc(G) for a given type of atom + ! + IF ( .NOT. ASSOCIATED ( upf(nt)%vloc ) ) THEN + ! + ! special case: pseudopotential is coulomb 1/r potential + ! + call vloc_coul (upf(nt)%zp, tpiba2, ngl, gl, omega, vloc (1, nt) ) + ! + ELSE + ! + ! normal case + ! + call vloc_of_g (rgrid(nt)%mesh, msh (nt), rgrid(nt)%rab, rgrid(nt)%r, & + upf(nt)%vloc(1), upf(nt)%zp, tpiba2, ngl, gl, omega, vloc (1, nt) ) + ! + END IF + enddo + call stop_clock ('init_vloc') + return +end subroutine init_vloc + diff --git a/tests/apps/miniDFT/tests/src/inpfile.f90 b/tests/apps/miniDFT/tests/src/inpfile.f90 new file mode 100644 index 0000000000..aa1f12a40b --- /dev/null +++ b/tests/apps/miniDFT/tests/src/inpfile.f90 @@ -0,0 +1,267 @@ +! +! Copyright (C) 2002-2009 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +#if defined(__ABSOFT) +# define getenv getenv_ +# define getarg getarg_ +# define iargc iargc_ +#endif +! +!---------------------------------------------------------------------------- +SUBROUTINE input_from_file( ierr ) + ! + ! This subroutine checks program arguments and, if input file is present, + ! attach input unit ( 5 ) to the specified file + ! + ! + IMPLICIT NONE + ! + INTEGER :: stdin = 5, stderr = 6, & + ilen, iiarg, nargs, ierr + ! do not define iargc as external: g95 does not like it + INTEGER :: iargc + CHARACTER (LEN=256) :: input_file + ! + ! ... Input from file ? + ! + nargs = iargc() + ! + ierr = -1 + ! + DO iiarg = 1, ( nargs - 1 ) + ! + CALL getarg( iiarg, input_file ) + ! + IF ( TRIM( input_file ) == '-input' .OR. & + TRIM( input_file ) == '-inp' .OR. & + TRIM( input_file ) == '-in' ) THEN + ! + CALL getarg( ( iiarg + 1 ) , input_file ) + ! + WRITE(*, '(5x,a)') "Reading input from "//TRIM( input_file ) + + OPEN ( UNIT = stdin, FILE = input_file, FORM = 'FORMATTED', & + STATUS = 'OLD', IOSTAT = ierr ) + ! + ! TODO: return error code ierr (-1 no file, 0 file opened, > 1 error) + ! do not call "errore" here: it may hang in parallel execution + ! if this routine ois called by ionode only + ! + IF ( ierr > 0 ) WRITE (stderr, & + '(" *** input file ",A," not found ***")' ) TRIM( input_file ) + ! + END IF + ! + END DO + +END SUBROUTINE input_from_file +! +!---------------------------------------------------------------------------- +! +SUBROUTINE get_file( input_file ) + ! + ! This subroutine reads, either from command line or from terminal, + ! the name of a file to be opened + ! TODO: return error code if an error occurs + ! + IMPLICIT NONE + ! + CHARACTER (LEN=*) :: input_file + ! + CHARACTER (LEN=256) :: prgname + ! do not define iargc as external: g95 does not like it + INTEGER :: nargs, iargc + LOGICAL :: exst + ! + nargs = iargc() + CALL getarg (0,prgname) + ! + IF ( nargs == 0 ) THEN +10 PRINT '("Input file > ",$)' + READ (5,'(a)', end = 20, err=20) input_file + IF ( input_file == ' ') GO TO 10 + INQUIRE ( FILE = input_file, EXIST = exst ) + IF ( .NOT. exst) THEN + PRINT '(A,": file not found")', TRIM(input_file) + GO TO 10 + END IF + ELSE IF ( nargs == 1 ) then + CALL getarg (1,input_file) + ELSE + PRINT '(A,": too many arguments ",i4)', TRIM(prgname), nargs + END IF + RETURN +20 PRINT '(A,": reading file name ",A)', TRIM(prgname), TRIM(input_file) + ! +END SUBROUTINE get_file +! +!---------------------------------------------------------------------------- +! +SUBROUTINE get_arg_npool( npool ) + ! + IMPLICIT NONE + ! + INTEGER :: npool + ! + INTEGER :: nargs, iiarg + CHARACTER(LEN=10) :: np + INTEGER :: iargc + ! + npool = 1 + nargs = iargc() + ! + DO iiarg = 1, ( nargs - 1 ) + ! + CALL getarg( iiarg, np ) + ! + IF ( TRIM( np ) == '-npool' .OR. TRIM( np ) == '-npools' ) THEN + ! + CALL getarg( ( iiarg + 1 ), np ) + READ( np, * ) npool + ! + END IF + ! + END DO + ! + RETURN +END SUBROUTINE get_arg_npool +! +!---------------------------------------------------------------------------- +! +SUBROUTINE get_arg_nimage( nimage ) + ! + IMPLICIT NONE + ! + INTEGER :: nimage + ! + INTEGER :: nargs, iiarg + CHARACTER(LEN=10) :: np + INTEGER :: iargc + ! + nimage = 1 + nargs = iargc() + ! + DO iiarg = 1, ( nargs - 1 ) + ! + CALL getarg( iiarg, np ) + ! + IF ( TRIM( np ) == '-nimage' .OR. TRIM( np ) == '-nimages' ) THEN + ! + CALL getarg( ( iiarg + 1 ), np ) + READ( np, * ) nimage + ! + END IF + ! + END DO + ! + RETURN +END SUBROUTINE get_arg_nimage +! +!---------------------------------------------------------------------------- +! +SUBROUTINE get_arg_ntg( ntask_groups ) + ! + IMPLICIT NONE + ! + INTEGER :: ntask_groups + ! + INTEGER :: nargs, iiarg + CHARACTER(LEN=20) :: np + INTEGER :: iargc + ! + ntask_groups = 0 + nargs = iargc() + ! + DO iiarg = 1, ( nargs - 1 ) + ! + CALL getarg( iiarg, np ) + ! + IF ( TRIM( np ) == '-ntg' .OR. TRIM( np ) == '-ntask_groups' ) THEN + ! + CALL getarg( ( iiarg + 1 ), np ) + READ( np, * ) ntask_groups + ! + END IF + ! + END DO + ! + RETURN +END SUBROUTINE get_arg_ntg +! +!---------------------------------------------------------------------------- +! +SUBROUTINE get_arg_nbgrp( nbgrp ) + ! + IMPLICIT NONE + ! + INTEGER :: nbgrp + ! + INTEGER :: nargs, iiarg + CHARACTER(LEN=20) :: np + INTEGER :: iargc + ! + nbgrp = 0 + nargs = iargc() + ! + DO iiarg = 1, ( nargs - 1 ) + ! + CALL getarg( iiarg, np ) + ! + IF ( TRIM( np ) == '-nbgrp' .OR. TRIM( np ) == '-nband_group' .OR. & + TRIM( np ) == '-nb' .OR. TRIM( np ) == '-nband' ) THEN + ! + CALL getarg( ( iiarg + 1 ), np ) + READ( np, * ) nbgrp + ! + END IF + ! + END DO + ! + RETURN +END SUBROUTINE get_arg_nbgrp +! +!---------------------------------------------------------------------------- +! +SUBROUTINE get_arg_northo( nproc_ortho ) + ! + IMPLICIT NONE + ! + INTEGER :: nproc_ortho + ! + INTEGER :: nargs, iiarg + CHARACTER(LEN=20) :: np + INTEGER :: iargc + ! + nproc_ortho = 0 + nargs = iargc() + ! + DO iiarg = 1, ( nargs - 1 ) + ! + CALL getarg( iiarg, np ) + ! + IF ( TRIM( np ) == '-nproc_ortho' .OR. TRIM( np ) == '-nproc_diag' .OR. & + TRIM( np ) == '-northo' .OR. TRIM( np ) == '-ndiag' ) THEN + ! + CALL getarg( ( iiarg + 1 ), np ) + READ( np, * ) nproc_ortho + ! + END IF + ! + END DO + ! + RETURN +END SUBROUTINE get_arg_northo + +SUBROUTINE get_env ( variable_name, variable_value ) + ! + ! Wrapper for intrinsic getenv - all machine-dependent stuff here + ! + CHARACTER (LEN=*) :: variable_name, variable_value + ! + CALL getenv ( variable_name, variable_value) + ! +END SUBROUTINE get_env diff --git a/tests/apps/miniDFT/tests/src/input.f90 b/tests/apps/miniDFT/tests/src/input.f90 new file mode 100644 index 0000000000..8e6bc666dd --- /dev/null +++ b/tests/apps/miniDFT/tests/src/input.f90 @@ -0,0 +1,1040 @@ + +! Copyright (C) 2002-2011 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +!---------------------------------------------------------------------------- +SUBROUTINE iosys() + !----------------------------------------------------------------------------- + ! + ! ... this subroutine reads input data from standard input ( unit 5 ) + ! ... Use "-input filename" to read input from file "filename": + ! ... may be useful if you have trouble reading from standard input + ! ... --------------------------------------------------------------- + ! + ! ... access the modules renaming the variables that have the same name + ! ... as the input parameters, this is required in order to use a code + ! ... independent input parser + ! + ! + USE kinds, ONLY : DP + USE control_flags, ONLY: adapt_thr, tr2_init, tr2_multi + USE constants, ONLY : autoev, eV_to_kelvin, pi, rytoev, & + ry_kbar, amconv, bohr_radius_angs, eps8 + USE mp_global, ONLY : npool, nproc_pool + ! + USE io_global, ONLY : stdout, ionode, ionode_id + ! + ! + USE mp, ONLY : mp_bcast + ! + ! + USE cell_base, ONLY : at, alat, omega, & + cell_base_init, init_dofree + ! + USE ions_base, ONLY : if_pos, ityp, tau, extfor, & + ntyp_ => nsp, & + nat_ => nat, & + amass, tau_format + ! + USE basis, ONLY : startingconfig, starting_wfc, starting_pot + ! + USE run_info, ONLY : title_ => title + ! + ! + USE extfield, ONLY : tefield_ => tefield, & + dipfield_ => dipfield, & + edir_ => edir, & + emaxpos_ => emaxpos, & + eopreg_ => eopreg, & + eamp_ => eamp, & + forcefield + ! + USE io_files, ONLY : input_drho, output_drho, & + psfile, tmp_dir, wfc_dir, & + prefix_ => prefix, & + pseudo_dir_ => pseudo_dir + ! + USE force_mod, ONLY : lforce, lstres, force + ! + USE gvecs, ONLY : dual + USE gvect, ONLY : ecutrho_ => ecutrho + ! + USE fft_base, ONLY : dfftp + USE fft_base, ONLY : dffts + ! + USE klist, ONLY : lgauss, ngauss, two_fermi_energies, & + smearing_ => smearing, & + degauss_ => degauss, & + tot_charge_ => tot_charge, & + tot_magnetization_ => tot_magnetization + ! + USE ktetra, ONLY : ltetra + USE start_k, ONLY : init_start_k + ! + ! + USE a2F, ONLY : la2F_ => la2F + ! + ! + ! + USE lsda_mod, ONLY : nspin_ => nspin, & + starting_magnetization_ => starting_magnetization, & + lsda + ! + USE relax, ONLY : epse, epsf, epsp, starting_scf_threshold + ! + USE control_flags, ONLY : isolve, max_cg_iter, david, tr2, imix, gamma_only,& + nmix, iverbosity, niter, pot_order, wfc_order, & + remove_rigid_rot_ => remove_rigid_rot, & + diago_full_acc_ => diago_full_acc, & + tolp_ => tolp, & + upscale_ => upscale, & + mixing_beta_ => mixing_beta, & + nstep_ => nstep, & + iprint_ => iprint, & + noinv_ => noinv, & + lkpoint_dir_ => lkpoint_dir, & + tqr_ => tqr, & + io_level, ethr, lscf, lbfgs, lmd, & + ldamped, lbands, llang, & + lconstrain, restart, twfcollect, & + lecrpa_ => lecrpa + ! + USE wvfct, ONLY : nbnd_ => nbnd, & + ecutwfc_ => ecutwfc, & + ecfixed_ => ecfixed, & + qcutz_ => qcutz, & + q2sigma_ => q2sigma + ! + USE fixed_occ, ONLY : tfixed_occ, f_inp, & + one_atom_occupations_ => one_atom_occupations + ! + ! + USE spin_orb, ONLY : lspinorb_ => lspinorb, & + starting_spin_angle_ => starting_spin_angle + + ! + USE symm_base, ONLY : no_t_rev_ => no_t_rev, nofrac, allfrac, & + nosym_ => nosym, nosym_evc_=> nosym_evc + ! + + USE read_pseudo_mod, ONLY : readpp + + ! + ! ... CONTROL namelist + ! + USE input_parameters, ONLY : title, calculation, verbosity, restart_mode, & + nstep, iprint, tstress, tprnfor, dt, outdir, & + wfcdir, prefix, etot_conv_thr, forc_conv_thr, & + pseudo_dir, disk_io, tefield, dipfield, & + wf_collect, & + lkpoint_dir, lecrpa + ! + ! ... SYSTEM namelist + ! + USE input_parameters, ONLY : ibrav, celldm, a, b, c, cosab, cosac, cosbc, & + nat, ntyp, nbnd,tot_charge,tot_magnetization,& + ecutwfc, ecutrho, nr1, nr2, nr3, nr1s, nr2s, & + nr3s, noinv, nosym, nosym_evc, no_t_rev, & + use_all_frac, force_symmorphic, & + starting_magnetization, & + occupations, degauss, smearing, nspin, & + ecfixed, qcutz, q2sigma, lda_plus_U, & + lda_plus_U_kind, Hubbard_U, Hubbard_J, & + Hubbard_alpha, input_dft, la2F, & + starting_ns_eigenvalue, U_projection_type, & + x_gamma_extrapolation, nqx1, nqx2, nqx3, & + exxdiv_treatment, yukawa, ecutvcut, & + exx_fraction, screening_parameter, ecutfock, & + edir, emaxpos, eopreg, eamp, & + constrained_magnetization, & + B_field, fixed_magnetization, lspinorb,& + starting_spin_angle, & + assume_isolated, spline_ps, & + one_atom_occupations + ! + ! ... ELECTRONS namelist + ! + USE input_parameters, ONLY : electron_maxstep, mixing_mode, mixing_beta, & + mixing_ndim, mixing_fixed_ns, conv_thr, & + tqr, diago_thr_init, diago_cg_maxiter, & + diago_david_ndim, diagonalization, & + diago_full_acc, startingwfc, startingpot, & + real_space + USE input_parameters, ONLY : adaptive_thr, conv_thr_init, conv_thr_multi + ! + ! ... IONS namelist + ! + USE input_parameters, ONLY : phase_space, ion_dynamics, ion_positions, tolp, & + tempw, delta_t, nraise, ion_temperature, & + refold_pos, remove_rigid_rot, upscale, & + pot_extrapolation, wfc_extrapolation, & + w_1, w_2, trust_radius_max, trust_radius_min, & + trust_radius_ini, bfgs_ndim + ! + ! ... CELL namelist + ! + USE input_parameters, ONLY : cell_parameters, cell_dynamics, press, wmass, & + cell_temperature, cell_factor, press_conv_thr, & + cell_dofree + ! + ! ... CARDS + ! + USE input_parameters, ONLY : k_points, xk, wk, nk1, nk2, nk3, & + k1, k2, k3, nkstot + USE input_parameters, ONLY : nconstr_inp, trd_ht, rd_ht, cell_units + ! + USE read_namelists_module, ONLY : read_namelists, sm_not_set + USE us, ONLY : spline_ps_ => spline_ps + ! + USE input_parameters, ONLY : deallocate_input_parameters + ! + IMPLICIT NONE + ! + CHARACTER(LEN=256), EXTERNAL :: trimcheck + ! + INTEGER :: ia, image, nt, inlc + REAL(DP) :: theta, phi + ! + ! + ! ... various initializations of control variables + ! + lforce = tprnfor + ! + SELECT CASE( trim( calculation ) ) + CASE( 'scf' ) + ! + lscf = .true. + nstep = 1 + ! + CASE( 'nscf' ) + ! + lforce = .false. + nstep = 1 + ! + CASE( 'bands' ) + ! + lforce = .false. + lbands = .true. + nstep = 1 + ! + CASE( 'relax' ) + ! + lscf = .true. + lforce = .true. + ! + epse = etot_conv_thr + epsf = forc_conv_thr + ! + SELECT CASE( trim( ion_dynamics ) ) + CASE( 'bfgs' ) + ! + lbfgs = .true. + ! + CASE ( 'damp' ) + ! + lmd = .true. + ldamped = .true. + ! + ! + CASE DEFAULT + ! + CALL errore( 'iosys', 'calculation=' // trim( calculation ) // & + & ': ion_dynamics=' // trim( ion_dynamics ) // & + & ' not supported', 1 ) + ! + END SELECT + ! + ! + CASE( 'vc-relax' ) + ! + lscf = .true. + lmd = .true. + lforce = .true. + ldamped = .true. + ! + epse = etot_conv_thr + epsf = forc_conv_thr + epsp = press_conv_thr + ! + SELECT CASE( trim( cell_dynamics ) ) + CASE( 'none' ) + ! + ! + CASE( 'damp-pr' ) + ! + ! + CASE( 'damp-w' ) + ! + ! + CASE( 'bfgs' ) + ! + lbfgs = .true. + lmd = .false. + ldamped = .false. + ! + CASE DEFAULT + ! + CALL errore( 'iosys', 'calculation=' // trim( calculation ) // & + & ': cell_dynamics=' // trim( cell_dynamics ) // & + & ' not supported', 1 ) + ! + END SELECT + ! + IF ( .not. ldamped .and. .not. lbfgs) & + CALL errore( 'iosys', 'calculation='// trim( calculation ) // & + & ': incompatible ion (' // trim( ion_dynamics )// & + & ') and cell dynamics ('// trim(cell_dynamics )// ')', 1 ) + ! + CASE( 'vc-md' ) + ! + lscf = .true. + lmd = .true. + lforce = .true. + ! + ! + SELECT CASE( trim( cell_dynamics ) ) + CASE( 'none' ) + ! + ! + CASE( 'pr' ) + ! + ! + CASE( 'w' ) + ! + ! + CASE DEFAULT + ! + CALL errore( 'iosys', 'calculation=' // trim( calculation ) // & + & ': ion_dynamics=' // trim( ion_dynamics ) // & + & ' not supported', 1 ) + ! + END SELECT + ! + IF ( trim( ion_dynamics ) /= 'beeman' ) & + CALL errore( 'iosys', 'calculation=' // trim( calculation ) // & + & ': ion_dynamics=' // trim( ion_dynamics ) // & + & ' not supported', 1 ) + ! + CASE DEFAULT + ! + CALL errore( 'iosys', 'calculation ' // & + & trim( calculation ) // ' not implemented', 1 ) + ! + END SELECT + ! + lstres = ( tstress .and. lscf ) + ! + IF ( tefield .and. ( .not. nosym ) ) THEN + nosym = .true. + WRITE( stdout, & + '(5x,"Presently no symmetry can be used with electric field",/)' ) + ENDIF + IF ( tefield .and. tstress ) THEN + tstress = .false. + WRITE( stdout, & + '(5x,"Presently stress not available with electric field",/)' ) + ENDIF + IF ( tefield .and. ( nspin > 2 ) ) THEN + CALL errore( 'iosys', 'LSDA not available with electric field' , 1 ) + ENDIF + ! + twfcollect = wf_collect + ! + ! ... Set Values for electron and bands + ! + tfixed_occ = .false. + ltetra = .false. + lgauss = .false. + ! + SELECT CASE( trim( occupations ) ) + CASE( 'fixed' ) + ! + ngauss = 0 + IF ( degauss /= 0.D0 ) THEN + CALL errore( ' iosys ', & + & ' fixed occupations, gauss. broadening ignored', -1 ) + degauss = 0.D0 + ENDIF + ! + CASE( 'smearing' ) + ! + lgauss = ( degauss > 0.0_dp ) + IF ( .NOT. lgauss ) & + CALL errore( ' iosys ', & + & ' smearing requires gaussian broadening', 1 ) + ! + SELECT CASE ( trim( smearing ) ) + CASE ( 'gaussian', 'gauss', 'Gaussian', 'Gauss' ) + ngauss = 0 + smearing_ = 'gaussian' + CASE ( 'methfessel-paxton', 'm-p', 'mp', 'Methfessel-Paxton', 'M-P', 'MP' ) + ngauss = 1 + smearing_ = 'Methfessel-Paxton' + CASE ( 'marzari-vanderbilt', 'cold', 'm-v', 'mv', 'Marzari-Vanderbilt', 'M-V', 'MV') + ngauss = -1 + smearing_ = 'Marzari-Vanderbilt' + CASE ( 'fermi-dirac', 'f-d', 'fd', 'Fermi-Dirac', 'F-D', 'FD') + ngauss = -99 + smearing_ = 'Fermi-Dirac' + CASE DEFAULT + CALL errore( ' iosys ', ' smearing '//trim(smearing)//' unknown', 1 ) + END SELECT + ! + CASE( 'tetrahedra' ) + ! + ! replace "errore" with "infomsg" in the next line if you really want + ! to perform a calculation with forces using tetrahedra + ! + IF( lforce ) CALL errore( 'iosys', & + 'force calculation with tetrahedra not recommanded: use smearing',1) + ! + ! as above, for stress + ! + IF( lstres ) CALL errore( 'iosys', & + 'stress calculation with tetrahedra not recommanded: use smearing',1) + ngauss = 0 + ltetra = .true. + ! + CASE( 'from_input' ) + ! + ngauss = 0 + tfixed_occ = .true. + ! + CASE DEFAULT + ! + CALL errore( 'iosys','occupations ' // trim( occupations ) // & + & 'not implemented', 1 ) + ! + END SELECT + ! + IF( nbnd < 1 ) & + CALL errore( 'iosys', 'nbnd less than 1', nbnd ) + ! + SELECT CASE( nspin ) + CASE( 1 ) + ! + lsda = .false. + ! + CASE( 2 ) + ! + lsda = .true. + ! + CASE( 4 ) + ! + lsda = .false. + ! + CASE DEFAULT + ! + CALL errore( 'iosys', 'wrong input value for nspin', 1 ) + ! + END SELECT + ! + two_fermi_energies = ( tot_magnetization /= -1._DP) + IF ( two_fermi_energies .and. tot_magnetization < 0._DP) & + CALL errore( 'iosys', 'tot_magnetization only takes positive values', 1 ) + IF ( two_fermi_energies .and. .not. lsda ) & + CALL errore( 'iosys', 'tot_magnetization requires nspin=2', 1 ) + ! + IF ( occupations == 'fixed' .and. lsda .and. lscf ) THEN + ! + IF ( two_fermi_energies ) THEN + ! + IF ( abs( nint(tot_magnetization ) - tot_magnetization ) > eps8 ) & + CALL errore( 'iosys', & + & 'fixed occupations requires integer tot_magnetization', 1 ) + IF ( abs( nint(tot_charge ) - tot_charge ) > eps8 ) & + CALL errore( 'iosys', & + & 'fixed occupations requires integer charge', 1 ) + ! + ELSE + ! + CALL errore( 'iosys', & + & 'fixed occupations and lsda need tot_magnetization', 1 ) + ! + ENDIF + ! + ENDIF + ! + ! + SELECT CASE( trim( constrained_magnetization ) ) + CASE( 'none' ) + ! + ! ... starting_magnetization(nt) = sm_not_set means "not set" + ! ... if no constraints are imposed on the magnetization, + ! ... starting_magnetization must be set for at least one atomic type + ! + IF ( lscf .AND. lsda .AND. ( .NOT. tfixed_occ ) .AND. & + ( .not. two_fermi_energies ) .AND. & + ALL (starting_magnetization(1:ntyp) == sm_not_set) ) & + CALL errore('iosys','some starting_magnetization MUST be set', 1 ) + ! + ! ... bring starting_magnetization between -1 and 1 + ! + DO nt = 1, ntyp + ! + IF ( starting_magnetization(nt) == sm_not_set ) THEN + starting_magnetization(nt) = 0.0_dp + ELSEIF ( starting_magnetization(nt) > 1.0_dp ) THEN + starting_magnetization(nt) = 1.0_dp + ELSEIF ( starting_magnetization(nt) <-1.0_dp ) THEN + starting_magnetization(nt) =-1.0_dp + ENDIF + ! + ENDDO + ! + ! + CASE( 'atomic' ) + ! + IF ( nspin == 1 ) & + CALL errore( 'iosys','constrained atomic magnetizations ' // & + & 'require nspin=2 or 4 ', 1 ) + IF ( ALL (starting_magnetization(1:ntyp) == sm_not_set) ) & + CALL errore( 'iosys','constrained atomic magnetizations ' // & + & 'require that some starting_magnetization is set', 1 ) + ! + ! + CASE( 'atomic direction' ) + ! + IF ( nspin == 1 ) & + CALL errore( 'iosys','constrained atomic magnetization ' // & + & 'directions require nspin=2 or 4 ', 1 ) + ! + CASE( 'total' ) + ! + IF ( nspin == 4 ) THEN + ! + ! + ELSE + ! + CALL errore( 'iosys','constrained total magnetization ' // & + & 'requires nspin= 4 ', 1 ) + ! + ENDIF + ! + CASE( 'total direction' ) + ! + CASE DEFAULT + ! + CALL errore( 'iosys','constrained magnetization ' // & + & trim( constrained_magnetization ) // 'not implemented', 1 ) + ! + END SELECT + ! + ! + IF ( ecutrho <= 0.D0 ) THEN + ! + dual = 4.D0 + ecutrho = dual*ecutwfc + ! + ELSE + ! + dual = ecutrho / ecutwfc + IF ( dual <= 1.D0 ) & + CALL errore( 'iosys', 'invalid dual?', 1 ) + ! + ENDIF + ! + SELECT CASE( trim( restart_mode ) ) + CASE( 'from_scratch' ) + ! + restart = .false. + IF ( lscf ) THEN + startingconfig = 'input' + ELSE + startingconfig = 'file' + ENDIF + ! + CASE DEFAULT + ! + CALL errore( 'iosys', & + & 'unknown restart_mode ' // trim( restart_mode ), 1 ) + ! + END SELECT + ! + SELECT CASE( trim( disk_io ) ) + CASE( 'high' ) + ! + io_level = 2 + ! + CASE ( 'low' ) + ! + io_level = 0 + restart = .false. + ! + CASE ( 'none' ) + ! + io_level = -1 + restart = .false. + IF ( twfcollect ) THEN + CALL infomsg('iosys', 'minimal I/O required, wf_collect reset to FALSE') + twfcollect= .false. + ENDIF + ! + CASE DEFAULT + ! + io_level = 1 + ! + IF ( lscf ) restart = .false. + ! + END SELECT + ! + Hubbard_U(:) = Hubbard_U(:) / rytoev + Hubbard_J(:,:) = Hubbard_J(:,:) / rytoev + Hubbard_alpha(:)= Hubbard_alpha(:) / rytoev + ! + ethr = diago_thr_init + ! + IF ( startingpot /= 'atomic' .and. startingpot /= 'file' ) THEN + ! + CALL infomsg( 'iosys', 'wrong startingpot: use default (1)' ) + ! + IF ( lscf ) THEN + startingpot = 'atomic' + ELSE + startingpot = 'file' + END IF + ! + ENDIF + ! + IF ( .not. lscf .and. startingpot /= 'file' ) THEN + ! + CALL infomsg( 'iosys', 'wrong startingpot: use default (2)' ) + ! + startingpot = 'file' + ! + ENDIF + ! + IF ( startingwfc /= 'atomic' .and. & + startingwfc /= 'random' .and. & + startingwfc /= 'atomic+random' .and. & + startingwfc /= 'file' ) THEN + ! + CALL infomsg( 'iosys', 'wrong startingwfc: use default' ) + ! + startingwfc = 'atomic' + ! + ENDIF + ! + SELECT CASE( trim( diagonalization ) ) + CASE ( 'cg' ) + ! + isolve = 1 + max_cg_iter = diago_cg_maxiter + ! + CASE ( 'david', 'davidson' ) + ! + isolve = 0 + david = diago_david_ndim + ! + CASE DEFAULT + ! + CALL errore( 'iosys', 'diagonalization ' // & + & trim( diagonalization ) // ' not implemented', 1 ) + ! + END SELECT + ! + tr2 = conv_thr + niter = electron_maxstep + adapt_thr = adaptive_thr + tr2_init = conv_thr_init + tr2_multi = conv_thr_multi + ! + pot_order = 1 + SELECT CASE( trim( pot_extrapolation ) ) + CASE( 'from_wfcs', 'from-wfcs' ) + ! not actually implemented + pot_order =-1 + ! + CASE( 'none' ) + ! + pot_order = 0 + ! + CASE( 'first_order', 'first-order', 'first order' ) + ! + IF ( lmd ) THEN + pot_order = 2 + ELSE + CALL infomsg('iosys', "pot_extrapolation='"//trim(pot_extrapolation)//& + "' not available, using 'atomic'") + ENDIF + ! + CASE( 'second_order', 'second-order', 'second order' ) + ! + IF ( lmd ) THEN + pot_order = 3 + ELSE + CALL infomsg('iosys', "pot_extrapolation='"//trim(pot_extrapolation)//& + "' not available, using 'atomic'") + ENDIF + ! + CASE DEFAULT + ! + pot_order = 1 + ! + END SELECT + ! + wfc_order = 0 + SELECT CASE( trim( wfc_extrapolation ) ) + ! + CASE( 'first_order', 'first-order', 'first order' ) + ! + IF ( lmd ) THEN + wfc_order = 2 + ELSE + CALL infomsg('iosys', "wfc_extrapolation='"//trim(pot_extrapolation)//& + "' not available, using 'atomic'") + ENDIF + ! + CASE( 'second_order', 'second-order', 'second order' ) + ! + IF ( lmd ) THEN + wfc_order = 3 + ELSE + CALL infomsg('iosys', "wfc_extrapolation='"//trim(pot_extrapolation)//& + "' not available, using 'atomic'") + ENDIF + ! + END SELECT + ! + SELECT CASE( trim( mixing_mode ) ) + CASE( 'plain' ) + ! + imix = 0 + ! + CASE( 'TF' ) + ! + imix = 1 + ! + CASE( 'local-TF' ) + ! + imix = 2 + ! + CASE( 'potential' ) + ! + CALL errore( 'iosys', 'potential mixing no longer implemented', 1 ) + ! + CASE DEFAULT + ! + CALL errore( 'iosys', 'unknown mixing ' // trim( mixing_mode ), 1 ) + ! + END SELECT + ! + starting_scf_threshold = tr2 + nmix = mixing_ndim + ! + IF ( ion_dynamics == ' bfgs' .and. epse <= 20.D0 * ( tr2 / upscale ) ) & + CALL errore( 'iosys', 'required etot_conv_thr is too small:' // & + & ' conv_thr must be reduced', 1 ) + ! + SELECT CASE( trim( verbosity ) ) + CASE( 'debug', 'high', 'medium' ) + ! + iverbosity = 1 + ! + CASE( 'low', 'default', 'minimal' ) + ! + iverbosity = 0 + ! + CASE DEFAULT + ! + iverbosity = 0 + ! + END SELECT + ! + tmp_dir = trimcheck ( outdir ) + ! + + ! + ! ... Copy values from input module to PW internals + ! + tqr_ = tqr + ! + title_ = title + lkpoint_dir_=lkpoint_dir + tefield_ = tefield + dipfield_ = dipfield + prefix_ = trim( prefix ) + pseudo_dir_ = trimcheck( pseudo_dir ) + nstep_ = nstep + iprint_ = iprint + lecrpa_ = lecrpa + ! + nat_ = nat + ntyp_ = ntyp + edir_ = edir + emaxpos_ = emaxpos + eopreg_ = eopreg + eamp_ = eamp + dfftp%nr1 = nr1 + dfftp%nr2 = nr2 + dfftp%nr3 = nr3 + ecutrho_ = ecutrho + ecutwfc_ = ecutwfc + ecfixed_ = ecfixed + qcutz_ = qcutz + q2sigma_ = q2sigma + dffts%nr1 = nr1s + dffts%nr2 = nr2s + dffts%nr3 = nr3s + degauss_ = degauss + ! + tot_charge_ = tot_charge + tot_magnetization_ = tot_magnetization + ! + lspinorb_ = lspinorb + starting_spin_angle_ = starting_spin_angle + one_atom_occupations_ = one_atom_occupations + ! + no_t_rev_ = no_t_rev + allfrac = use_all_frac + ! + spline_ps_ = spline_ps + ! + la2F_ = la2F + nspin_ = nspin + starting_magnetization_ = starting_magnetization + noinv_ = noinv + nosym_ = nosym + nosym_evc_ = nosym_evc + nofrac = force_symmorphic + nbnd_ = nbnd + ! + ! + ! + diago_full_acc_ = diago_full_acc + starting_wfc = startingwfc + starting_pot = startingpot + mixing_beta_ = mixing_beta + ! + remove_rigid_rot_ = remove_rigid_rot + upscale_ = upscale + ! + IF (trim(occupations) /= 'from_input') one_atom_occupations_=.false. + ! + ! + SELECT CASE( trim( assume_isolated ) ) + ! + CASE( 'none' ) + ! + ! + CASE DEFAULT + ! + call errore ('iosys','unrecognized value for assume_isolated',1) + END SELECT + ! + ! ... read following cards + ! + ALLOCATE( ityp( nat_ ) ) + ALLOCATE( tau( 3, nat_ ) ) + ALLOCATE( force( 3, nat_ ) ) + ALLOCATE( if_pos( 3, nat_ ) ) + ALLOCATE( extfor( 3, nat_ ) ) + IF ( tfixed_occ ) THEN + IF ( nspin_ == 4 ) THEN + ALLOCATE( f_inp( nbnd_, 1 ) ) + ELSE + ALLOCATE( f_inp( nbnd_, nspin_ ) ) + ENDIF + ENDIF + ! + IF ( tefield ) ALLOCATE( forcefield( 3, nat_ ) ) + ! + ! ... note that read_cards_pw no longer reads cards! + ! + CALL read_cards_pw ( psfile, tau_format ) + ! + ! ... set up atomic positions and crystal lattice + ! + call cell_base_init ( ibrav, celldm, a, b, c, cosab, cosac, cosbc, & + trd_ht, rd_ht, cell_units ) + ! + ! ... set up k-points + ! + CALL init_start_k ( nk1, nk2, nk3, k1, k2, k3, k_points, nkstot, xk, wk ) + gamma_only = ( k_points == 'gamma' ) + if( gamma_only ) call errore('iosys','kpoints=gamma calculations not available for mini_DFT',1) + ! + ! + CALL convert_tau ( tau_format, nat_, tau) + ! + IF ( wmass == 0.D0 ) THEN + ! + ! ... set default value of wmass + ! +#if defined __PGI + DO ia = 1, nat_ + wmass = wmass + amass( ityp(ia) ) + ENDDO +#else + wmass = sum( amass(ityp(:)) ) +#endif + ! + wmass = wmass * amconv + ! + ELSE + ! + ! ... wmass is given in amu, Renata's dynamics uses masses in atomic units + ! + ! + ENDIF + ! + ! ... unit conversion for pressure + ! + ! + ! ... set constraints for cell dynamics/optimization + ! + CALL init_dofree ( cell_dofree ) + ! + ! ... read pseudopotentials (also sets DFT) + ! + CALL readpp ( input_dft ) + ! + ! + ! ... variables for constrained dynamics are set here + ! + lconstrain = ( nconstr_inp > 0 ) + ! + ! ... Files + ! + input_drho = ' ' + output_drho = ' ' + ! + IF (real_space ) THEN + CALL errore ('iosys', 'Real space only with Gamma point', 1) + ENDIF + ! + ! Deallocation of temp input arrays + ! + CALL deallocate_input_parameters () + ! + RETURN + ! +END SUBROUTINE iosys +! +!---------------------------------------------------------------------------- +SUBROUTINE read_cards_pw ( psfile, tau_format ) + !---------------------------------------------------------------------------- + ! + USE kinds, ONLY : DP + USE input_parameters, ONLY : atom_label, atom_pfile, atom_mass, taspc, & + tapos, rd_pos, atomic_positions, if_pos, & + sp_pos, f_inp, rd_for, tavel, sp_vel, rd_vel + USE cell_base, ONLY : at, ibrav + USE ions_base, ONLY : nat, ntyp => nsp, ityp, tau, atm, extfor + USE fixed_occ, ONLY : tfixed_occ, f_inp_ => f_inp + USE ions_base, ONLY : if_pos_ => if_pos, amass, fixatom + USE control_flags, ONLY : lfixatom, textfor + ! + IMPLICIT NONE + ! + CHARACTER (len=256) :: psfile(ntyp) + CHARACTER (len=80) :: tau_format + INTEGER, EXTERNAL :: atomic_number + REAL(DP), EXTERNAL :: atom_weight + ! + INTEGER :: is, ia + ! + ! + amass = 0 + ! + IF ( .not. taspc ) & + CALL errore( 'read_cards_pw', 'atomic species info missing', 1 ) + IF ( .not. tapos ) & + CALL errore( 'read_cards_pw', 'atomic position info missing', 1 ) + ! + DO is = 1, ntyp + ! + amass(is) = atom_mass(is) + psfile(is) = atom_pfile(is) + atm(is) = atom_label(is) + ! + IF ( amass(is) <= 0.0_DP ) amass(is)= & + atom_weight(atomic_number(trim(atm(is)))) + + IF ( amass(is) <= 0.D0 ) CALL errore( 'read_cards_pw', 'invalid mass', is ) + ! + ENDDO + ! + textfor = .false. + IF( any( rd_for /= 0.0_DP ) ) textfor = .true. + ! + DO ia = 1, nat + ! + tau(:,ia) = rd_pos(:,ia) + ityp(ia) = sp_pos(ia) + extfor(:,ia) = rd_for(:,ia) + ! + ENDDO + ! + ! ... The constrain on fixed coordinates is implemented using the array + ! ... if_pos whose value is 0 when the coordinate is to be kept fixed, 1 + ! ... otherwise. + ! + if_pos_(:,:) = if_pos(:,1:nat) + fixatom = COUNT( if_pos_(1,:)==0 .AND. if_pos_(2,:)==0 .AND. if_pos_(3,:)==0 ) + lfixatom = ANY ( if_pos_ == 0 ) + ! + tau_format = trim( atomic_positions ) + ! + IF ( tfixed_occ ) THEN + ! + f_inp_ = f_inp + ! + DEALLOCATE ( f_inp ) + ! + ENDIF + ! + RETURN + ! +END SUBROUTINE read_cards_pw +! +!----------------------------------------------------------------------- +SUBROUTINE convert_tau (tau_format, nat_, tau) +!----------------------------------------------------------------------- + ! + ! ... convert input atomic positions to internally used format: + ! ... tau in a0 units + ! + USE kinds, ONLY : DP + USE constants, ONLY : bohr_radius_angs + USE cell_base, ONLY : at, alat + IMPLICIT NONE + CHARACTER (len=*), INTENT(in) :: tau_format + INTEGER, INTENT(in) :: nat_ + REAL (DP), INTENT(inout) :: tau(3,nat_) + ! + SELECT CASE( tau_format ) + CASE( 'alat' ) + ! + ! ... input atomic positions are divided by a0: do nothing + ! + CASE( 'bohr' ) + ! + ! ... input atomic positions are in a.u.: divide by alat + ! + tau = tau / alat + ! + CASE( 'crystal' ) + ! + ! ... input atomic positions are in crystal axis + ! + CALL cryst_to_cart( nat_, tau, at, 1 ) + ! + CASE( 'angstrom' ) + ! + ! ... atomic positions in A: convert to a.u. and divide by alat + ! + tau = tau / bohr_radius_angs / alat + ! + CASE DEFAULT + ! + CALL errore( 'iosys','tau_format=' // & + & trim( tau_format ) // ' not implemented', 1 ) + ! + END SELECT + ! +END SUBROUTINE convert_tau diff --git a/tests/apps/miniDFT/tests/src/input_parameters.f90 b/tests/apps/miniDFT/tests/src/input_parameters.f90 new file mode 100644 index 0000000000..4618e71148 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/input_parameters.f90 @@ -0,0 +1,1380 @@ +! +! Copyright (C) 2002-2008 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +!=----------------------------------------------------------------------------=! +! +MODULE input_parameters +! +!=----------------------------------------------------------------------------=! +! +! this module contains +! 1) the definitions of all input parameters +! (both those read from namelists and those read from cards) +! 2) the definitions of all namelists +! 3) routines that allocate data needed in input +! Note that all values are initialized, but the default values should be +! set in the appropriate routines contained in module "read_namelists" +! The documentation of input variables can be found in Doc/INPUT_PW.* +! (for pw.x) or in Doc/INPUT_CP (for cp.x) +! Originally written by Carlo Cavazzoni for FPMD +! +!=----------------------------------------------------------------------------=! + ! + USE kinds, ONLY : DP + USE parameters, ONLY : nsx, lqmax + ! + IMPLICIT NONE + ! + SAVE + ! +!=----------------------------------------------------------------------------=! +! BEGIN manual +! +! +! * DESCRIPTION OF THE INPUT FILE +! (to be given as standard input) +! +! The input file has the following layout: +! +! &CONTROL +! control_parameter_1, +! control_parameter_2, +! ....... +! control_parameter_Lastone +! / +! &SYSTEM +! sistem_parameter_1, +! sistem_parameter_2, +! ....... +! sistem_parameter_Lastone +! / +! &ELECTRONS +! electrons_parameter_1, +! electrons_parameter_2, +! ....... +! electrons_parameter_Lastone +! / +! &IONS +! ions_parameter_1, +! ions_parameter_2, +! ....... +! ions_parameter_Lastone +! / +! &CELL +! cell_parameter_1, +! cell_parameter_2, +! ....... +! cell_parameter_Lastone +! / +! ATOMIC_SPECIES +! slabel_1 mass_1 pseudo_file_1 +! slabel_2 mass_2 pseudo_file_2 +! ..... +! ATOMIC_POSITIONS +! alabel_1 px_1 py_1 pz_1 +! alabel_2 px_2 py_2 pz_2 +! ..... +! CARD_3 +! .... +! CARD_N +! +! -- end of input file -- +! +!=----------------------------------------------------------------------------=! +! CONTROL Namelist Input Parameters +!=----------------------------------------------------------------------------=! +! + CHARACTER(len=80) :: title = ' ' + ! a string describing the current job + + CHARACTER(len=80) :: calculation = 'none' + ! Specify the type of the simulation + ! See below for allowed values + CHARACTER(len=80) :: calculation_allowed(15) + DATA calculation_allowed / 'scf', 'nscf', 'relax', 'md', 'cp', & + 'vc-relax', 'vc-md', 'vc-cp', 'bands', 'neb', 'smd', 'cp-wf', & + 'cp-wf-nscf','cp-wf-pbe0', 'pbe0-nscf'/ ! Lingzhu Kong + CHARACTER(len=80) :: verbosity = 'default' + ! define the verbosity of the code output + CHARACTER(len=80) :: verbosity_allowed(6) + DATA verbosity_allowed / 'debug', 'high', 'medium', 'default', & + 'low', 'minimal' / + + CHARACTER(len=80) :: restart_mode = 'restart' + ! specify how to start/restart the simulation + CHARACTER(len=80) :: restart_mode_allowed(3) + DATA restart_mode_allowed / 'from_scratch', 'restart', 'reset_counters' / + + INTEGER :: nstep = 10 + ! number of simulation steps, see "restart_mode" + + INTEGER :: iprint = 10 + ! number of steps/scf iterations between successive writings + ! of relevant physical quantities to standard output + + INTEGER :: isave = 100 + ! number of steps between successive savings of + ! information needed to restart the run (see "ndr", "ndw") + ! used only in CP + + LOGICAL :: tstress = .true. + ! .TRUE. calculate the stress tensor + ! .FALSE. do not calculate the stress tensor + + LOGICAL :: tprnfor = .true. + ! .TRUE. calculate the atomic forces + ! .FALSE. do not calculate the atomic forces + + REAL(DP) :: dt = 1.0_DP + ! time step for molecular dynamics simulation, in atomic units + ! CP: 1 a.u. of time = 2.4189 * 10^-17 s, PW: twice that much + ! Typical values for CP simulations are between 1 and 10 a.u. + ! For Born-Oppenheimer simulations, larger values can be used, + ! since it mostly depends only upon the mass of ions. + + INTEGER :: ndr = 50 + ! Fortran unit from which the code reads the restart file + + INTEGER :: ndw = 50 + ! Fortran unit to which the code writes the restart file + + CHARACTER(len=256) :: outdir = './' + ! specify the directory where the code opens output and restart + ! files. When possible put this directory in the fastest available + ! filesystem ( not NFS! ) + + CHARACTER(len=256) :: prefix = 'prefix' + ! specify the prefix for the output file, if not specified the + ! files are opened as standard fortran units. + + CHARACTER(len=256) :: pseudo_dir = './' + ! specify the directory containing the pseudopotentials + + REAL(DP) :: refg = 0.05_DP + ! Accurancy of the interpolation table, interval between + ! table values in Rydberg + + CHARACTER(len=256) :: wfcdir = 'undefined' + ! scratch directory that is hopefully local to the node + ! to store large, usually temporary files. + + REAL(DP) :: max_seconds = 1.0E+7_DP + ! smoothly terminate program after the specified number of seconds + ! this parameter is typically used to prevent an hard kill from + ! the queuing system. + + REAL(DP) :: ekin_conv_thr = 1.0E-5_DP + ! convergence criterion for electron minimization + ! this criterion is met when "ekin < ekin_conv_thr" + ! convergence is achieved when all criteria are met + + REAL(DP) :: etot_conv_thr = 1.0E-4_DP + ! convergence criterion for ion minimization + ! this criterion is met when "etot(n+1)-etot(n) < etot_conv_thr", + ! where "n" is the step index, "etot" the DFT energy + ! convergence is achieved when all criteria are met + + REAL(DP) :: forc_conv_thr = 1.0E-3_DP + ! convergence criterion for ion minimization + ! this criterion is met when "MAXVAL(fion) < forc_conv_thr", + ! where fion are the atomic forces + ! convergence is achieved when all criteria are met + + CHARACTER(len=80) :: disk_io = 'default' + ! Specify the amount of I/O activities + + LOGICAL :: tefield = .false. + ! if .TRUE. a sawtooth potential simulating a finite electric field + ! is added to the local potential = only used in PW + + LOGICAL :: tefield2 = .false. + ! if .TRUE. a second finite electric field is added to the local potential + ! only used in CP + + LOGICAL :: lelfield = .false. + ! if .TRUE. a static homogeneous electric field is present + ! via the modern theory of polarizability - differs from tefield! + + LOGICAL :: dipfield = .false. + ! if .TRUE. the dipole field is subtracted + ! only used in PW for surface calculations + + LOGICAL :: lberry = .false. + ! if .TRUE., use modern theory of the polarization + + INTEGER :: gdir = 0 + ! G-vector for polarization calculation ( related to lberry ) + ! only used in PW + + INTEGER :: nppstr = 0 + ! number of k-points (parallel vector) ( related to lberry ) + ! only used in PW + + INTEGER :: nberrycyc = 1 + !number of covergence cycles on electric field + + LOGICAL :: wf_collect = .false. + ! This flag controls the way wavefunctions are stored to disk: + ! .TRUE. collect wavefunctions from all processors, store them + ! into a single restart file on a single processors + ! .FALSE. do not collect wavefunctions, store them into distributed + ! files + ! Only for PW and only in the parallel case + + INTEGER :: printwfc=1 + ! if <0 do nothing, if==0 print rho and fort.47, if == nband print band + + LOGICAL :: saverho = .true. + ! This flag controls the saving of charge density in CP codes: + ! .TRUE. save charge density to restart dir + ! .FALSE. do not save charge density + + LOGICAL :: tabps = .false. ! for ab-initio pressure and/or surface + ! calculations + + LOGICAL :: lkpoint_dir = .true. ! opens a directory for each k point + + + LOGICAL :: lecrpa = .FALSE. + ! if true symmetry in scf run is neglected for RPA Ec calculation + ! + + CHARACTER(len=256) :: vdw_table_name = ' ' + + NAMELIST / control / title, calculation, verbosity, restart_mode, & + nstep, iprint, isave, tstress, tprnfor, dt, ndr, ndw, outdir, & + prefix, wfcdir, max_seconds, ekin_conv_thr, etot_conv_thr, & + forc_conv_thr, pseudo_dir, disk_io, tefield, dipfield, lberry, & + gdir, nppstr, wf_collect, printwfc, lelfield, nberrycyc, refg, & + tefield2, saverho, tabps, lkpoint_dir, lecrpa, & + vdw_table_name + + + +! +!=----------------------------------------------------------------------------=! +! SYSTEM Namelist Input Parameters +!=----------------------------------------------------------------------------=! +! + INTEGER :: ibrav = 14 + ! index of the the Bravais lattice + ! Note: in variable cell CP molecular dynamics, usually one does + ! not want to put constraints on the cell symmetries, thus + ! ibrav = 14 is used + + REAL(DP) :: celldm(6) = 0.0_DP + ! dimensions of the cell (lattice parameters and angles) + + REAL(DP) :: a = 0.0_DP + REAL(DP) :: c = 0.0_DP + REAL(DP) :: b = 0.0_DP + REAL(DP) :: cosab = 0.0_DP + REAL(DP) :: cosac = 0.0_DP + REAL(DP) :: cosbc = 0.0_DP + ! Alternate definition of the cell - use either this or celldm + + INTEGER :: nat = 0 + ! total number of atoms + + INTEGER :: ntyp = 0 + ! number of atomic species + + INTEGER :: nbnd = 0 + ! number of electronic states, this parameter is MANDATORY in CP + + REAL(DP):: tot_charge = 0.0_DP + ! total system charge + + REAL(DP) :: tot_magnetization = -1.0_DP + ! majority - minority spin. + ! A value < 0 means unspecified + + REAL(DP) :: ecutwfc = 0.0_DP + ! energy cutoff for wave functions in k-space ( in Rydberg ) + ! this parameter is MANDATORY + + REAL(DP) :: ecutrho = 0.0_DP + ! energy cutoff for charge density in k-space ( in Rydberg ) + ! by default its value is "4 * ecutwfc" + + INTEGER :: nr1 = 0 + INTEGER :: nr2 = 0 + INTEGER :: nr3 = 0 + ! dimensions of the real space grid for charge and potentials + ! presently NOT used in CP + + INTEGER :: nr1s = 0 + INTEGER :: nr2s = 0 + INTEGER :: nr3s = 0 + ! dimensions of the real space grid for wavefunctions + ! presently NOT used in CP + + INTEGER :: nr1b = 0 + INTEGER :: nr2b = 0 + INTEGER :: nr3b = 0 + ! dimensions of the "box" grid for Ultrasoft pseudopotentials + + CHARACTER(len=80) :: occupations = 'fixed' + ! select the way electronic states are filled + ! See card 'OCCUPATIONS' if ocupations='from_input' + + CHARACTER(len=80) :: smearing = 'gaussian' + ! select the way electronic states are filled for metalic systems + + REAL(DP) :: degauss = 0.0_DP + ! parameter for the smearing functions - NOT used in CP + + INTEGER :: nspin = 1 + ! number of spinors + ! "nspin = 1" for LDA simulations + ! "nspin = 2" for LSD simulations + ! "nspin = 4" for NON COLLINEAR simulations + + + LOGICAL :: nosym = .true., noinv = .false. + ! (do not) use symmetry, q => -q symmetry in k-point generation + LOGICAL :: nosym_evc = .false. + ! if .true. use symmetry only to symmetrize k points + LOGICAL :: force_symmorphic = .false. + ! if .true. disable fractionary translations (nonsymmorphic groups) + LOGICAL :: use_all_frac = .false. + ! if .true. enable usage of all fractionary translations, + ! disabling check if they are commensurate with FFT grid + + REAL(DP) :: ecfixed = 0.0_DP, qcutz = 0.0_DP, q2sigma = 0.0_DP + ! parameters for modified kinetic energy functional to be used + ! in variable-cell constant cut-off simulations + + CHARACTER(len=80) :: input_dft = 'none' + ! Variable used to overwrite dft definition contained in + ! pseudopotential files; 'none' means DFT is read from pseudos. + ! Only used in PW - allowed values: any legal DFT value + + REAL(DP) :: starting_magnetization( nsx ) = 0.0_DP + ! ONLY PW + + LOGICAL :: lda_plus_u = .false. + ! Use DFT+U method - following are the needed parameters + INTEGER :: lda_plus_u_kind = 0 + INTEGER, PARAMETER :: nspinx=2 + REAL(DP) :: starting_ns_eigenvalue(lqmax,nspinx,nsx) = -1.0_DP + REAL(DP) :: hubbard_u(nsx) = 0.0_DP + REAL(DP) :: hubbard_j(3,nsx) = 0.0_DP + REAL(DP) :: hubbard_alpha(nsx) = 0.0_DP + CHARACTER(len=80) :: U_projection_type = 'atomic' + + LOGICAL :: la2F = .false. + ! For electron-phonon calculations + ! + LOGICAL :: step_pen=.false. + REAL(DP) :: A_pen(10,nspinx) = 0.0_DP + REAL(DP) :: sigma_pen(10) = 0.01_DP + REAL(DP) :: alpha_pen(10) = 0.0_DP + + ! next group of variables PWSCF ONLY + ! + INTEGER :: nqx1 = 1, nqx2 = 1, nqx3=1 + ! + REAL(DP) :: exx_fraction = -1.0_DP ! if negative, use defaults + REAL(DP) :: screening_parameter = -1.0_DP + ! + CHARACTER(len=80) :: exxdiv_treatment = 'gygi-baldereschi' + ! define how ro cure the Coulomb divergence in EXX + ! Allowed values are: + CHARACTER(len=80) :: exxdiv_treatment_allowed(6) + DATA exxdiv_treatment_allowed / 'gygi-baldereschi', 'gygi-bald', 'g-b',& + 'vcut_ws', 'vcut_spherical', 'none' / + ! + LOGICAL :: x_gamma_extrapolation = .true. + REAL(DP) :: yukawa = 0.0_DP + REAL(DP) :: ecutvcut = 0.0_DP + ! auxiliary variables to define exxdiv treatment + LOGICAL :: adaptive_thr = .FALSE. + REAL(DP) :: conv_thr_init = 0.001_DP + REAL(DP) :: conv_thr_multi = 0.1_DP + REAL(DP) :: ecutfock = -1.d0 + + ! parameters for external electric field + INTEGER :: edir = 0 + REAL(DP) :: emaxpos = 0.0_DP + REAL(DP) :: eopreg = 0.0_DP + REAL(DP) :: eamp = 0.0_DP + + ! Various parameters for noncollinear calculations + LOGICAL :: noncolin = .false. + LOGICAL :: lspinorb = .false. + LOGICAL :: starting_spin_angle=.FALSE. + REAL(DP) :: lambda = 1.0_DP + REAL(DP) :: fixed_magnetization(3) = 0.0_DP + REAL(DP) :: angle1(nsx) = 0.0_DP + REAL(DP) :: angle2(nsx) = 0.0_DP + INTEGER :: report = 1 + LOGICAL :: no_t_rev = .FALSE. + + CHARACTER(len=80) :: constrained_magnetization = 'none' + REAL(DP) :: B_field(3) = 0.0_DP + ! A fixed magnetic field defined by the vector B_field is added + ! to the exchange and correlation magnetic field. + + CHARACTER(len=80) :: sic = 'none' + ! CP only - SIC correction (D'avezac Mauri) + ! Parameters for SIC calculation + REAL(DP) :: sic_epsilon = 0.0_DP + REAL(DP) :: sic_alpha = 0.0_DP + LOGICAL :: force_pairing = .false. + + LOGICAL :: spline_ps = .false. + ! use spline interpolation for pseudopotential + LOGICAL :: one_atom_occupations=.false. + + CHARACTER(len=80) :: assume_isolated = 'none' + ! used to define corrections for isolated systems + ! other possibilities: + ! 'makov-payne', 'martyna-tuckerman`, `dcc`, 'esm' + + NAMELIST / system / ibrav, celldm, a, b, c, cosab, cosac, cosbc, nat, & + ntyp, nbnd, ecutwfc, ecutrho, nr1, nr2, nr3, nr1s, nr2s, & + nr3s, nr1b, nr2b, nr3b, nosym, nosym_evc, noinv, use_all_frac, & + force_symmorphic, starting_magnetization, & + occupations, degauss, nspin, ecfixed, & + qcutz, q2sigma, lda_plus_U, lda_plus_u_kind, & + Hubbard_U, Hubbard_J, Hubbard_alpha, & + edir, emaxpos, eopreg, eamp, smearing, starting_ns_eigenvalue, & + U_projection_type, input_dft, la2F, assume_isolated, & + nqx1, nqx2, nqx3, ecutfock, & + exxdiv_treatment, x_gamma_extrapolation, yukawa, ecutvcut, & + exx_fraction, screening_parameter, & + noncolin, lspinorb, starting_spin_angle, lambda, angle1, angle2, & + report, & + constrained_magnetization, B_field, fixed_magnetization, & + sic, sic_epsilon, force_pairing, sic_alpha, & + tot_charge, tot_magnetization, & + spline_ps, one_atom_occupations, & + step_pen, A_pen, sigma_pen, alpha_pen, no_t_rev +! +!=----------------------------------------------------------------------------=! +! EE Namelist Input Parameters +!=----------------------------------------------------------------------------=! +! +! kinetic energy cutoff for the coarse (MultiGrid) grid + REAL(DP) :: ecutcoarse = 100.0d0 +! amount of "new" correction introduced when mixing + REAL(DP) :: mixing_charge_compensation = 1.0 +! error tolerance for the multigrid solver + REAL(DP) :: errtol = 1.d-22 +! how early in scf itarations should the corrective pot start being calculated + REAL(DP) :: comp_thr = 1.d-2 +! nlev number of grid levels in the multigrid solver + INTEGER :: nlev = 2 +! itmax maximum number of iterations in the multigrid solver + INTEGER :: itmax = 1000 +! whichbc 0 if aperiodic + INTEGER :: whichbc(3) = 0 +! sets after how many scf cycles the corrective potential should be calculated + INTEGER :: n_charge_compensation = 5 +! + INTEGER :: ncompx = 1 + INTEGER :: ncompy = 1 + INTEGER :: ncompz = 1 + ! ONLY PWSCF +! + INTEGER :: mr1 = 0 + INTEGER :: mr2 = 0 + INTEGER :: mr3 = 0 + + REAL(DP) :: cellmin( 3 ) = 0.D0 + ! ONLY PWSCF + + REAL(DP) :: cellmax( 3 ) = 1.D0 + + NAMELIST / ee / comp_thr, & + ncompx,n_charge_compensation, & + ncompy, ncompz,mixing_charge_compensation, & + mr1, mr2, mr3, ecutcoarse, & + errtol, nlev, itmax, whichbc, & + cellmin, cellmax + +!=----------------------------------------------------------------------------=! +! ELECTRONS Namelist Input Parameters +!=----------------------------------------------------------------------------=! + + REAL(DP) :: emass = 0.0_DP + ! effective electron mass in the CP Lagrangian, + ! in atomic units ( 1 a.u. of mass = 1/1822.9 a.m.u. = 9.10939 * 10^-31 kg ) + ! Typical values in CP simulation are between 100. and 1000. + + REAL(DP) :: emass_cutoff = 0.0_DP + ! mass cut-off (in Rydbergs) for the Fourier acceleration + ! effective mass is rescaled for "G" vector components with kinetic + ! energy above "emass_cutoff" + ! Use a value grether than "ecutwfc" to disable Fourier acceleration. + + CHARACTER(len=80) :: orthogonalization = 'ortho' + ! orthogonalization = 'Gram-Schmidt' | 'ortho'* + ! selects the orthonormalization method for electronic wave functions + ! 'Gram-Schmidt' use Gram-Schmidt algorithm + ! 'ortho' use iterative algorithm + + REAL(DP) :: ortho_eps = 1.E-8_DP + ! meaningful only if orthogonalization = 'ortho' + ! tolerance for iterative orthonormalization, + ! a value of 1.d-8 is usually sufficent + + INTEGER :: ortho_max = 20 + ! meaningful only if orthogonalization = 'ortho' + ! maximum number of iterations for orthonormalization + ! usually between 15 and 30. + + INTEGER :: electron_maxstep = 1000 + ! maximum number of steps in electronic minimization + ! This parameter apply only when using 'cg' electronic or + ! ionic dynamics + + CHARACTER(len=80) :: electron_dynamics = 'none' + ! set how electrons should be moved + CHARACTER(len=80) :: electron_dynamics_allowed(6) + DATA electron_dynamics_allowed & + / 'default', 'sd', 'cg', 'damp', 'verlet', 'none' / + + REAL(DP) :: electron_damping = 0.0_DP + ! meaningful only if " electron_dynamics = 'damp' " + ! damping frequency times delta t, optimal values could be + ! calculated with the formula + ! sqrt(0.5*log((E1-E2)/(E2-E3))) + ! where E1 E2 E3 are successive values of the DFT total energy + ! in a steepest descent simulations + + CHARACTER(len=80) :: electron_velocities = 'default' + ! electron_velocities = 'zero' | 'default'* + ! 'zero' restart setting electronic velocities to zero + ! 'default' restart using electronic velocities of the previous run + + CHARACTER(len=80) :: electron_temperature = 'not_controlled' + ! electron_temperature = 'nose' | 'not_controlled'* | 'rescaling' + ! 'nose' control electronic temperature using Nose thermostat + ! see parameter "fnosee" and "ekincw" + ! 'rescaling' control electronic temperature via velocities rescaling + ! 'not_controlled' electronic temperature is not controlled + + REAL(DP) :: ekincw = 0.0_DP + ! meaningful only with "electron_temperature /= 'not_controlled' " + ! value of the average kinetic energy (in atomic units) forced + ! by the temperature control + + REAL(DP) :: fnosee = 0.0_DP + ! meaningful only with "electron_temperature = 'nose' " + ! oscillation frequency of the nose thermostat (in terahertz) + + CHARACTER(len=80) :: startingwfc = 'random' + ! startingwfc = 'atomic' | 'atomic+random' | 'random' | 'file' + ! define how the code should initialize the wave function + ! 'atomic' start from superposition of atomic wave functions + ! 'atomic+random' as above, plus randomization + ! 'random' start from random wave functions + ! 'file' read wavefunctions from file + + REAL(DP) :: ampre = 0.0_DP + ! meaningful only if "startingwfc = 'random'", amplitude of the + ! randomization ( allowed values: 0.0 - 1.0 ) + + REAL(DP) :: grease = 0.0_DP + ! a number <= 1, very close to 1: the damping in electronic + ! damped dynamics is multiplied at each time step by "grease" + ! (avoids overdamping close to convergence: Obsolete ?) + ! grease = 1 : normal damped dynamics + ! used only in CP + + INTEGER :: diis_size = 0 + ! meaningful only with " electron_dynamics = 'diis' " + ! size of the matrix used for the inversion in the iterative subspace + ! default is 4, allowed value 1-5 + + INTEGER :: diis_nreset = 0 + ! meaningful only with " electron_dynamics = 'diis' " + ! number of steepest descendent step after a reset of the diis + ! iteration, default value is 3 + + REAL(DP) :: diis_hcut = 0.0_DP + ! meaningful only with " electron_dynamics = 'diis' " + ! energy cutoff (a.u.), above which an approximate diagonal + ! hamiltonian is used in finding the direction to the minimum + ! default is "1.0" + + REAL(DP) :: diis_wthr = 1.E-4_DP + ! meaningful only with " electron_dynamics = 'diis' " + ! convergence threshold for wave function + ! this criterion is satisfied when the maximum change + ! in the wave functions component between two diis steps + ! is less than this threshold + ! default value is ekin_conv_thr + + REAL(DP) :: diis_delt = 1.0_DP + ! meaningful only with " electron_dynamics = 'diis' " + ! electronic time step used in the steepest descendent step + ! default is "dt" + + INTEGER :: diis_maxstep = 100 + ! meaningful only with " electron_dynamics = 'diis' " + ! maximum number of iteration in the diis minimization + ! default is electron_maxstep + + LOGICAL :: diis_rot = .false. + ! meaningful only with " electron_dynamics = 'diis' " + ! if "diis_rot = .TRUE." enable diis with charge mixing and rotations + ! default is "diis_rot = .FALSE." + + REAL(DP) :: diis_fthr = 1.E-3_DP + ! meaningful only with "electron_dynamics='diis' " and "diis_rot=.TRUE." + ! convergence threshold for ionic force + ! this criterion is satisfied when the maximum change + ! in the atomic force between two diis steps + ! is less than this threshold + ! default value is "0.0" + + REAL(DP) :: diis_temp = 0.0_DP + ! meaningful only with "electron_dynamics='diis' " and "diis_rot=.TRUE." + ! electronic temperature, significant only if ??? + + REAL(DP) :: diis_achmix = 0.0_DP + ! meaningful only with "electron_dynamics='diis' " and "diis_rot=.TRUE." + ! "A" parameter in the charge mixing formula + ! chmix = A * G^2 / (G^2 + G0^2) , G represents reciprocal lattice vectors + + REAL(DP) :: diis_g0chmix = 0.0_DP + ! meaningful only with "electron_dynamics='diis' " and "diis_rot=.TRUE." + ! "G0^2" parameter in the charge mixing formula + + INTEGER :: diis_nchmix = 0 + ! meaningful only with "electron_dynamics='diis' " and "diis_rot=.TRUE." + ! dimension of the charge mixing + + REAL(DP) :: diis_g1chmix = 0.0_DP + ! meaningful only with "electron_dynamics='diis' " and "diis_rot=.TRUE." + ! "G1^2" parameter in the charge mixing formula + ! metric = (G^2 + G1^2) / G^2 , G represents reciprocal lattice vectors + + INTEGER :: diis_nrot(3) = 0 + ! meaningful only with "electron_dynamics='diis' " and "diis_rot=.TRUE." + ! start upgrading the charge density every "diis_nrot(1)" steps, + ! then every "diis_nrot(2)", and at the end every "diis_nrot(3)", + ! depending on "diis_rothr" + + REAL(DP) :: diis_rothr(3) = 1.E-4_DP + ! meaningful only with "electron_dynamics='diis' " and "diis_rot=.TRUE." + ! threshold on the charge difference between two diis step + ! when max charge difference is less than "diis_rothr(1)", switch + ! between the "diis_nrot(1)" upgrade frequency to "diis_nrot(2)", + ! then when the max charge difference is less than "diis_rothr(2)", + ! switch between "diis_nrot(2)" and "diis_nrot(3)", upgrade frequency, + ! finally when the max charge difference is less than "diis_nrot(3)" + ! convergence is achieved + + REAL(DP) :: diis_ethr = 1.E-4_DP + ! meaningful only with "electron_dynamics='diis' " and "diis_rot=.TRUE." + ! convergence threshold for energy + ! this criterion is satisfied when the change + ! in the energy between two diis steps + ! is less than this threshold + ! default value is etot_conv_thr + + LOGICAL :: diis_chguess = .false. + ! meaningful only with "electron_dynamics='diis' " and "diis_rot=.TRUE." + ! if "diis_chguess = .TRUE." enable charge density guess + ! between two diis step, defaut value is "diis_chguess = .FALSE." + + CHARACTER(len=80) :: mixing_mode = 'default' + ! type of mixing algorithm for charge self-consistency + ! used only in PWscf + + REAL(DP) :: mixing_beta = 0.0_DP + ! parameter for mixing algorithm + ! used only in PWscf + + INTEGER :: mixing_ndim = 0 + ! dimension of mixing subspace + ! used only in PWscf + + CHARACTER(len=80) :: diagonalization = 'david' + ! diagonalization = 'david' or 'cg' + ! algorithm used by PWscf for iterative diagonalization + + REAL(DP) :: diago_thr_init = 0.0_DP + ! convergence threshold for the first iterative diagonalization. + ! used only in PWscf + + INTEGER :: diago_cg_maxiter = 100 + ! max number of iterations for the first iterative diagonalization + ! using conjugate-gradient algorithm - used only in PWscf + + INTEGER :: diago_david_ndim = 4 + ! dimension of the subspace used in Davidson diagonalization + ! used only in PWscf + + LOGICAL :: diago_full_acc = .false. + + REAL(DP) :: conv_thr = 1.E-6_DP + ! convergence threshold in electronic ONLY minimizations + ! used only in PWscf + + INTEGER :: mixing_fixed_ns = 0 + ! For DFT+U calculations, PWscf only + + CHARACTER(len=80) :: startingpot = 'potfile' + ! specify the file containing the DFT potential of the system + ! used only in PWscf + + INTEGER :: n_inner = 2 + ! number of inner loop per CG iteration. + ! used only in CP + + INTEGER :: niter_cold_restart = 1 + !frequency of full cold smearing inner cycle (in iterations) + + REAL(DP) :: lambda_cold + !step for not complete cold smearing inner cycle + + LOGICAL :: tgrand = .false. + ! whether to do grand-canonical calculations. + + REAL(DP) :: fermi_energy = 0.0_DP + ! chemical potential of the grand-canonical ensemble. + + CHARACTER(len=80) :: rotation_dynamics = "line-minimization" + ! evolution the rotational degrees of freedom. + + CHARACTER(len=80) :: occupation_dynamics = "line-minimization" + ! evolution of the occupational degrees of freedom. + + REAL(DP) :: rotmass = 0 + ! mass for the rotational degrees of freedom. + + REAL(DP) :: occmass = 0 + ! mass for the occupational degrees of freedom. + + REAL(DP) :: occupation_damping = 0 + ! damping for the rotational degrees of freedom. + + REAL(DP) :: rotation_damping = 0 + ! damping for the occupational degrees of freedom. + + LOGICAL :: tcg = .true. + ! if true perform in cpv conjugate gradient minimization of electron energy + + INTEGER :: maxiter = 100 + ! max number of conjugate gradient iterations + + REAL(DP) :: etresh =1.0E-7_DP + ! treshhold on energy + + REAL(DP) :: passop =0.3_DP + ! small step for parabolic interpolation + + INTEGER :: niter_cg_restart + !frequency of restart for the conjugate gradient algorithm in iterations + + INTEGER :: epol = 3 + ! electric field direction + + REAL(DP) :: efield =0.0_DP + ! electric field intensity in atomic units + + ! real_space routines for US pps + LOGICAL :: real_space = .false. + + + REAL(DP) :: efield_cart(3) + ! electric field vector in cartesian system of reference + + INTEGER :: epol2 = 3 + ! electric field direction + + REAL(DP) :: efield2 =0.0_DP + ! electric field intensity in atomic units + + LOGICAL :: tqr = .false. + ! US contributions are added in real space + + LOGICAL :: occupation_constraints = .false. + ! If true perform CP dynamics with constrained occupations + ! to be used together with penalty functional ... + + NAMELIST / electrons / emass, emass_cutoff, orthogonalization, & + electron_maxstep, ortho_eps, ortho_max, electron_dynamics, & + electron_damping, electron_velocities, electron_temperature, & + ekincw, fnosee, ampre, grease, & + diis_size, diis_nreset, diis_hcut, & + diis_wthr, diis_delt, diis_maxstep, diis_rot, diis_fthr, & + diis_temp, diis_achmix, diis_g0chmix, diis_g1chmix, & + diis_nchmix, diis_nrot, diis_rothr, diis_ethr, diis_chguess, & + mixing_mode, mixing_beta, mixing_ndim, mixing_fixed_ns, & + tqr, diago_cg_maxiter, diago_david_ndim, diagonalization , & + startingpot, startingwfc , conv_thr, & + adaptive_thr, conv_thr_init, conv_thr_multi, & + diago_thr_init, n_inner, fermi_energy, rotmass, occmass, & + rotation_damping, occupation_damping, rotation_dynamics, & + occupation_dynamics, tcg, maxiter, etresh, passop, epol, & + efield, epol2, efield2, diago_full_acc, & + occupation_constraints, niter_cg_restart, & + niter_cold_restart, lambda_cold, efield_cart, real_space + +! +!=----------------------------------------------------------------------------=! +! IONS Namelist Input Parameters +!=----------------------------------------------------------------------------=! +! + CHARACTER(len=80) :: phase_space = 'full' + ! phase_space = 'full' | 'coarse-grained' + ! 'full' the full phase-space is used for the ionic + ! dynamics + ! 'coarse-grained' a coarse-grained phase-space, defined by a set + ! of constraints, is used for the ionic dynamics + +! CHARACTER(len=80) :: phase_space_allowed(2) +! DATA phase_space_allowed / 'full', 'coarse-grained' / + CHARACTER(len=80) :: phase_space_allowed(1) + DATA phase_space_allowed / 'full' / + + CHARACTER(len=80) :: ion_dynamics = 'none' + ! set how ions should be moved + CHARACTER(len=80) :: ion_dynamics_allowed(8) + DATA ion_dynamics_allowed / 'none', 'sd', 'cg', 'langevin', & + 'damp', 'verlet', 'bfgs', 'beeman' / + + REAL(DP) :: ion_radius(nsx) = 0.5_DP + ! pseudo-atomic radius of the i-th atomic species + ! (for Ewald summation), values between 0.5 and 2.0 are usually used. + + REAL(DP) :: ion_damping = 0.2_DP + ! meaningful only if " ion_dynamics = 'damp' " + ! damping frequency times delta t, optimal values could be + ! calculated with the formula + ! sqrt(0.5*log((E1-E2)/(E2-E3))) + ! where E1 E2 E3 are successive values of the DFT total energy + ! in a ionic steepest descent simulation + + CHARACTER(len=80) :: ion_positions = 'default' + ! ion_positions = 'default'* | 'from_input' + ! 'default' restart the simulation with atomic positions read + ! from the restart file + ! 'from_input' restart the simulation with atomic positions read + ! from standard input ( see the card 'ATOMIC_POSITIONS' ) + + CHARACTER(len=80) :: ion_velocities = 'default' + ! ion_velocities = 'zero' | 'default'* | 'random' | 'from_input' + ! 'default' restart the simulation with atomic velocities read + ! from the restart file + ! 'random' start the simulation with random atomic velocities + ! 'from_input' restart the simulation with atomic velocities read + ! from standard input (see the card 'ATOMIC_VELOCITIES' ) + ! 'zero' restart the simulation with atomic velocities set to zero + + CHARACTER(len=80) :: ion_temperature = 'not_controlled' + ! ion_temperature = 'nose' | 'not_controlled'* | 'rescaling' | + ! 'berendsen' | 'andersen' | 'rescale-v' | 'rescale-T' | 'reduce-T' + ! + ! 'nose' control ionic temperature using Nose thermostat + ! see parameters "fnosep" and "tempw" + ! 'rescaling' control ionic temperature via velocity rescaling + ! see parameters "tempw" and "tolp" + ! 'rescale-v' control ionic temperature via velocity rescaling + ! see parameters "tempw" and "nraise" + ! 'rescale-T' control ionic temperature via velocity rescaling + ! see parameter "delta_t" + ! 'reduce-T' reduce ionic temperature + ! see parameters "nraise", delta_t" + ! 'berendsen' control ionic temperature using "soft" velocity + ! rescaling - see parameters "tempw" and "nraise" + ! 'andersen' control ionic temperature using Andersen thermostat + ! see parameters "tempw" and "nraise" + ! 'not_controlled' ionic temperature is not controlled + + REAL(DP) :: tempw = 300.0_DP + ! meaningful only with "ion_temperature /= 'not_controlled' " + ! value of the ionic temperature (in Kelvin) forced + ! by the temperature control + + INTEGER, PARAMETER :: nhclm = 4 + REAL(DP) :: fnosep( nhclm ) = 50.0_DP + ! meaningful only with "ion_temperature = 'nose' " + ! oscillation frequency of the nose thermostat (in terahertz) + ! nhclm is the max length for the chain; it can be easily increased + ! since the restart file should be able to handle it + ! perhaps better to align nhclm by 4 + + INTEGER :: nhpcl = 0 + ! non-zero only with "ion_temperature = 'nose' " + ! this defines the length of the Nose-Hoover chain + + INTEGER :: nhptyp = 0 + ! this parameter set the nose hoover thermostat to more than one + + INTEGER :: nhgrp(nsx)=0 + ! this is the array to assign thermostats to atomic types + ! allows to use various thermostat setups + + INTEGER :: ndega = 0 + ! this is the parameter to control active degrees of freedom + ! used for temperature control and the Nose-Hoover chains + + REAL(DP) :: tolp = 50.0_DP + ! meaningful only with "ion_temperature = 'rescaling' " + ! tolerance (in Kelvin) of the rescaling. When ionic temperature + ! differs from "tempw" more than "tolp" apply rescaling. + + REAL(DP) :: fnhscl(nsx)=-1.0_DP + ! this is to scale the target energy, in case there are constraints + ! the dimension is the same as nhgrp, meaning that atomic type + ! i with a group nhgrp(i) is scaled by fnhscl(i) + + LOGICAL :: tranp(nsx) = .false. + ! tranp(i) control the randomization of the i-th atomic specie + ! .TRUE. randomize ionic positions ( see "amprp" ) + ! .FALSE. do nothing + + REAL(DP) :: amprp(nsx) = 0.0_DP + ! amprp(i) meaningful only if "tranp(i) = .TRUE.", amplitude of the + ! randomization ( allowed values: 0.0 - 1.0 ) for the i-th atomic specie. + ! Add to the positions a random displacements vector ( in bohr radius ) + ! defined as: amprp( i ) * ( X, Y, Z ) + ! where X, Y, Z are pseudo random number in the interval [ -0.5 , 0.5 ] + + REAL(DP) :: greasp = 0.0_DP + ! same as "grease", for ionic damped dynamics + ! NOT used in FPMD + + INTEGER :: ion_nstepe = 1 + ! number of electronic steps for each ionic step + + INTEGER :: ion_maxstep = 1000 + ! maximum number of step in ionic minimization + + REAL(DP) :: upscale = 100.0_DP + ! Max reduction allowed in scf threshold during optimization + + CHARACTER(len=80) :: pot_extrapolation = 'default', & + wfc_extrapolation = 'default' + ! These variables are used only by PWSCF + + LOGICAL :: refold_pos + LOGICAL :: remove_rigid_rot = .false. + + ! + ! ... delta_T, nraise, tolp are used to change temperature in PWscf + ! + + REAL(DP) :: delta_t = 1.0_DP + + INTEGER :: nraise = 1 + + ! + ! ... variables added for new BFGS algorithm + ! + + INTEGER :: bfgs_ndim = 1 + + REAL(DP) :: trust_radius_max = 0.8_DP + REAL(DP) :: trust_radius_min = 1.E-3_DP + REAL(DP) :: trust_radius_ini = 0.5_DP + + REAL(DP) :: w_1 = 0.5E-1_DP + REAL(DP) :: w_2 = 0.5_DP + + REAL(DP) :: sic_rloc = 0.0_DP + + ! + ! ... variable for meta-dynamics + ! + INTEGER, PARAMETER :: max_nconstr = 100 + INTEGER :: fe_nstep = 100 + INTEGER :: sw_nstep = 10 + INTEGER :: eq_nstep = 0 + REAL(DP) :: g_amplitude = 0.005_DP + ! + REAL(DP) :: fe_step( max_nconstr ) = 0.4_DP + ! + NAMELIST / ions / phase_space, ion_dynamics, ion_radius, ion_damping, & + ion_positions, ion_velocities, ion_temperature, & + tempw, fnosep, nhgrp, fnhscl, nhpcl, nhptyp, ndega, tranp, & + amprp, greasp, tolp, ion_nstepe, ion_maxstep, & + refold_pos, upscale, delta_t, pot_extrapolation, & + wfc_extrapolation, nraise, remove_rigid_rot, & + trust_radius_max, trust_radius_min, & + trust_radius_ini, w_1, w_2, bfgs_ndim, sic_rloc, & + fe_step, fe_nstep, sw_nstep, eq_nstep, g_amplitude + + +!=----------------------------------------------------------------------------=! +! CELL Namelist Input Parameters +!=----------------------------------------------------------------------------=! +! + CHARACTER(len=80) :: cell_parameters = 'default' + ! cell_parameters = 'default'* | 'from_input' + ! 'default' restart the simulation with cell parameters read + ! from the restart file or "celldm" if + ! "restart = 'from_scratch'" + ! 'from_input' restart the simulation with cell parameters + ! from standard input ( see the card 'CELL_PARAMETERS' ) + + CHARACTER(len=80) :: cell_dynamics = 'none' + ! set how the cell should be moved + CHARACTER(len=80) :: cell_dynamics_allowed(7) + DATA cell_dynamics_allowed / 'sd', 'pr', 'none', 'w', 'damp-pr', & + 'damp-w', 'bfgs' / + + CHARACTER(len=80) :: cell_velocities = 'default' + ! cell_velocities = 'zero' | 'default'* + ! 'zero' restart setting cell velocitiy to zero + ! 'default' restart using cell velocity of the previous run + + REAL(DP) :: press = 0.0_DP + ! external pressure (in GPa, remember 1 kbar = 10^8 Pa) + + REAL(DP) :: wmass = 0.0_DP + ! effective cell mass in the Parrinello-Rahman Lagrangian (in atomic units) + ! of the order of magnitude of the total atomic mass + ! (sum of the mass of the atoms) within the simulation cell. + ! if you do not specify this parameters, the code will compute + ! its value based on some physical consideration + + CHARACTER(len=80) :: cell_temperature = 'not_controlled' + ! cell_temperature = 'nose' | 'not_controlled'* | 'rescaling' + ! 'nose' control cell temperature using Nose thermostat + ! see parameters "fnoseh" and "temph" + ! 'rescaling' control cell temperature via velocities rescaling + ! 'not_controlled' cell temperature is not controlled + ! NOT used in FPMD + + REAL(DP) :: temph = 0.0_DP + ! meaningful only with "cell_temperature /= 'not_controlled' " + ! value of the cell temperature (in Kelvin) forced + ! by the temperature control + + REAL(DP) :: fnoseh = 1.0_DP + ! meaningful only with "cell_temperature = 'nose' " + ! oscillation frequency of the nose thermostat (in terahertz) + + REAL(DP) :: greash = 0.0_DP + ! same as "grease", for cell damped dynamics + + CHARACTER(len=80) :: cell_dofree = 'all' + ! cell_dofree = 'all'* | 'volume' | 'x' | 'y' | 'z' | 'xy' | 'xz' | 'yz' | 'xyz' + ! select which of the cell parameters should be moved + ! 'all' all axis and angles are propagated (default) + ! 'volume' the cell is simply rescaled, without changing the shape + ! 'x' only the "x" axis is moved + ! 'y' only the "y" axis is moved + ! 'z' only the "z" axis is moved + ! 'xy' only the "x" and "y" axis are moved, angles are unchanged + ! 'xz' only the "x" and "z" axis are moved, angles are unchanged + ! 'yz' only the "y" and "z" axis are moved, angles are unchanged + ! 'xyz' "x", "y" and "z" axis are moved, angles are unchanged + + REAL(DP) :: cell_factor = 0.0_DP + ! NOT used in FPMD + + INTEGER :: cell_nstepe = 1 + ! number of electronic steps for each cell step + + REAL(DP) :: cell_damping = 0.0_DP + ! meaningful only if " cell_dynamics = 'damp' " + ! damping frequency times delta t, optimal values could be + ! calculated with the formula + ! sqrt(0.5*log((E1-E2)/(E2-E3))) + ! where E1 E2 E3 are successive values of the DFT total energy + ! in a ionic steepest descent simulation + + REAL(DP) :: press_conv_thr = 0.5_DP + + NAMELIST / cell / cell_parameters, cell_dynamics, cell_velocities, & + press, wmass, cell_temperature, temph, fnoseh, & + cell_dofree, greash, cell_factor, cell_nstepe, & + cell_damping, press_conv_thr + +! +!=----------------------------------------------------------------------------=!! +! PRESS_AI Namelist Input Parameters +!=----------------------------------------------------------------------------=! +! +! + LOGICAL :: abivol = .false. + LOGICAL :: abisur = .false. + LOGICAL :: pvar = .false. + LOGICAL :: fill_vac=.false. + LOGICAL :: scale_at=.false. + LOGICAL :: t_gauss =.false. + LOGICAL :: jellium= .false. + LOGICAL :: cntr(nsx)=.false. + REAL(DP) :: P_ext = 0.0_DP + REAL(DP) :: P_in = 0.0_DP + REAL(DP) :: P_fin = 0.0_DP + REAL(DP) :: rho_thr = 0.0_DP + REAL(DP) :: step_rad(nsx) = 0.0_DP + REAL(DP) :: Surf_t = 0.0_DP + REAL(DP) :: dthr = 0.0_DP + REAL(DP) :: R_j = 0.0_DP + REAL(DP) :: h_j = 0.0_DP + REAL(DP) :: delta_eps = 0.0_DP + REAL(DP) :: delta_sigma=0.0_DP + INTEGER :: n_cntr = 0 + INTEGER :: axis = 0 + + NAMELIST / press_ai / abivol, P_ext, pvar, P_in, P_fin, rho_thr, & + & step_rad, delta_eps, delta_sigma, n_cntr, & + & fill_vac, scale_at, t_gauss, abisur, & + & Surf_t, dthr, cntr, axis, jellium, R_j, h_j + +!=============================================================================== +! END manual +! ---------------------------------------------------------------------- + + +! END manual +! ---------------------------------------------------------------------- + + +! ---------------------------------------------------------------- +! BEGIN manual +! +!=----------------------------------------------------------------------------=! +! CARDS parameters +!=----------------------------------------------------------------------------=! +! +! Note: See file read_cards.f90 for card syntax and usage +! +! ATOMIC_SPECIES +! + CHARACTER(len=3) :: atom_label(nsx) = 'XX' ! label of the atomic species being read + CHARACTER(len=80) :: atom_pfile(nsx) = 'YY' ! pseudopotential file name + REAL(DP) :: atom_mass(nsx) = 0.0_DP ! atomic mass of the i-th atomic species + ! in atomic mass units: 1 a.m.u. = 1822.9 a.u. = 1.6605 * 10^-27 kg + LOGICAL :: taspc = .false. + LOGICAL :: tkpoints = .false. + LOGICAL :: tforces = .false. + LOGICAL :: tocc = .false. + LOGICAL :: tcell = .false. + LOGICAL :: tdipole = .false. + LOGICAL :: tionvel = .false. + LOGICAL :: tconstr = .false. + LOGICAL :: tesr = .false. + LOGICAL :: tksout = .false. + LOGICAL :: ttemplate = .false. + +! +! ATOMIC_POSITIONS +! + REAL(DP), ALLOCATABLE :: rd_pos(:,:) ! unsorted positions from input + INTEGER, ALLOCATABLE :: sp_pos(:) + INTEGER, ALLOCATABLE :: if_pos(:,:) + INTEGER, ALLOCATABLE :: id_loc(:) + INTEGER, ALLOCATABLE :: na_inp(:) + LOGICAL :: tapos = .false. + CHARACTER(len=80) :: atomic_positions = 'crystal' + ! atomic_positions = 'bohr' | 'angstrong' | 'crystal' | 'alat' + ! select the units for the atomic positions being read from stdin + + ! + ! ... variable added for NEB ( C.S. 17/10/2003 ) + ! + ! +! +! ION_VELOCITIES +! + REAL(DP), ALLOCATABLE :: rd_vel(:,:) ! unsorted velocities from input + INTEGER, ALLOCATABLE :: sp_vel(:) + LOGICAL :: tavel = .false. +! +! ATOMIC_FORCES +! + REAL(DP), ALLOCATABLE :: rd_for(:,:) ! external forces applied to single atoms + +! +! KPOINTS +! +! ... k-points inputs + LOGICAL :: tk_inp = .false. + REAL(DP), ALLOCATABLE :: xk(:,:), wk(:) + INTEGER :: nkstot = 0, nk1 = 0, nk2 = 0, nk3 = 0, k1 = 0, k2 = 0, k3 = 0 + CHARACTER(len=80) :: k_points = 'gamma' + ! k_points = 'automatic' | 'crystal' | 'tpiba' | 'gamma'* + ! k_points = 'crystal_b' | 'tpiba_b' + ! select the k points mesh + ! 'automatic' k points mesh is generated automatically + ! with Monkhorst-Pack algorithm + ! 'crystal' k points mesh is given in stdin in scaled units + ! 'tpiba' k points mesh is given in stdin in units of ( 2 PI / alat ) + ! 'gamma' only gamma point is used ( default in CPMD simulation ) + ! _b means that a band input is given. The weights is a integer + ! number that gives the number of points between the present point + ! and the next. The weight of the last point is not used. +! +! OCCUPATIONS +! + REAL(DP), ALLOCATABLE :: f_inp(:,:) + LOGICAL :: tf_inp = .false. + +! +! DIPOLE +! + LOGICAL :: tdipole_card = .false. + +! +! ESR +! + INTEGER :: iesr_inp = 1 + +! +! CELL_PARAMETERS +! + REAL(DP) :: rd_ht(3,3) = 0.0_DP + CHARACTER(len=80) :: cell_units = 'alat' + LOGICAL :: trd_ht = .false. + +! +! CONSTRAINTS +! + INTEGER :: nc_fields = 4 ! max number of fields that is allowed to + ! define a constraint + + INTEGER :: nconstr_inp = 0 + REAL(DP) :: constr_tol_inp = 1.E-6_DP + ! + CHARACTER(len=20), ALLOCATABLE :: constr_type_inp(:) + REAL(DP), ALLOCATABLE :: constr_inp(:,:) + REAL(DP), ALLOCATABLE :: constr_target_inp(:) + LOGICAL, ALLOCATABLE :: constr_target_set(:) + +! +! KOHN_SHAM +! + INTEGER, ALLOCATABLE :: iprnks( :, : ) + INTEGER :: nprnks( nspinx ) = 0 + ! logical mask used to specify which kohn sham orbital should be + ! written to files 'KS.' + +! +! CLIMBING_IMAGES +! + ! + ! ... variable added for NEB ( C.S. 20/11/2003 ) + ! + LOGICAL, ALLOCATABLE :: climbing( : ) + +! +! PLOT_WANNIER +! + + +! END manual +! ---------------------------------------------------------------------- + + LOGICAL :: xmloutput = .false. + ! if .true. PW produce an xml output +CONTAINS + + SUBROUTINE allocate_input_ions( ntyp, nat ) + ! + INTEGER, INTENT(in) :: ntyp, nat + ! + IF ( allocated( rd_pos ) ) DEALLOCATE( rd_pos ) + IF ( allocated( sp_pos ) ) DEALLOCATE( sp_pos ) + IF ( allocated( if_pos ) ) DEALLOCATE( if_pos ) + IF ( allocated( id_loc ) ) DEALLOCATE( id_loc ) + IF ( allocated( na_inp ) ) DEALLOCATE( na_inp ) + IF ( allocated( rd_vel ) ) DEALLOCATE( rd_vel ) + IF ( allocated( sp_vel ) ) DEALLOCATE( sp_vel ) + IF ( allocated( rd_for ) ) DEALLOCATE( rd_for ) + ! + ALLOCATE( rd_pos( 3, nat ) ) + ALLOCATE( sp_pos( nat) ) + ALLOCATE( if_pos( 3, nat ) ) + ALLOCATE( id_loc( nat) ) + ALLOCATE( na_inp( ntyp) ) + ALLOCATE( rd_vel( 3, nat ) ) + ALLOCATE( sp_vel( nat) ) + ALLOCATE( rd_for( 3, nat ) ) + ! + rd_pos = 0.0_DP + sp_pos = 0 + if_pos = 1 + id_loc = 0 + na_inp = 0 + rd_vel = 0.0_DP + sp_vel = 0 + rd_for = 0.0_DP + ! + RETURN + ! + END SUBROUTINE allocate_input_ions + + SUBROUTINE allocate_input_constr() + ! + IF ( allocated( constr_type_inp ) ) DEALLOCATE( constr_type_inp ) + IF ( allocated( constr_inp ) ) DEALLOCATE( constr_inp ) + IF ( allocated( constr_target_inp ) ) DEALLOCATE( constr_target_inp ) + IF ( allocated( constr_target_set ) ) DEALLOCATE( constr_target_set ) + ! + ALLOCATE( constr_type_inp( nconstr_inp ) ) + ALLOCATE( constr_target_inp( nconstr_inp ) ) + ALLOCATE( constr_target_set( nconstr_inp ) ) + ! + ALLOCATE( constr_inp( nc_fields, nconstr_inp ) ) + ! + constr_type_inp = ' ' + constr_inp = 0.0_DP + constr_target_inp = 0.0_DP + constr_target_set = .false. + ! + RETURN + ! + END SUBROUTINE allocate_input_constr + + SUBROUTINE allocate_input_iprnks( nksx, nspin ) + ! + INTEGER, INTENT(in) :: nksx, nspin + ! + IF( allocated( iprnks ) ) DEALLOCATE( iprnks ) + ! + ALLOCATE( iprnks( max( 1, nksx), nspin ) ) + ! + iprnks = 0 + ! + RETURN + ! + END SUBROUTINE allocate_input_iprnks + + + SUBROUTINE deallocate_input_parameters() + ! + IF ( allocated( xk ) ) DEALLOCATE( xk ) + IF ( allocated( wk ) ) DEALLOCATE( wk ) + IF ( allocated( rd_pos ) ) DEALLOCATE( rd_pos ) + IF ( allocated( sp_pos ) ) DEALLOCATE( sp_pos ) + IF ( allocated( if_pos ) ) DEALLOCATE( if_pos ) + IF ( allocated( id_loc ) ) DEALLOCATE( id_loc ) + IF ( allocated( na_inp ) ) DEALLOCATE( na_inp ) + IF ( allocated( rd_vel ) ) DEALLOCATE( rd_vel ) + IF ( allocated( sp_vel ) ) DEALLOCATE( sp_vel ) + IF ( allocated( rd_for ) ) DEALLOCATE( rd_for ) + ! + ! + IF ( allocated( constr_type_inp ) ) DEALLOCATE( constr_type_inp ) + IF ( allocated( constr_inp ) ) DEALLOCATE( constr_inp ) + IF ( allocated( constr_target_inp ) ) DEALLOCATE( constr_target_inp ) + IF ( allocated( constr_target_set ) ) DEALLOCATE( constr_target_set ) + ! + IF ( allocated( iprnks ) ) DEALLOCATE( iprnks ) + ! + RETURN + ! + END SUBROUTINE deallocate_input_parameters + ! +!=----------------------------------------------------------------------------=! +! +END MODULE input_parameters +! +!=----------------------------------------------------------------------------=! diff --git a/tests/apps/miniDFT/tests/src/int_to_char.f90 b/tests/apps/miniDFT/tests/src/int_to_char.f90 new file mode 100644 index 0000000000..305f7436a2 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/int_to_char.f90 @@ -0,0 +1,62 @@ +! +! Copyright (C) 2009 Quantum ESPRESSO groups +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! + !----------------------------------------------------------------------- + FUNCTION int_to_char( i ) + !----------------------------------------------------------------------- + ! + ! ... converts an integer number of up to 6 figures + ! ... into a left-justifed character variable + ! + IMPLICIT NONE + ! + INTEGER, INTENT(IN) :: i + CHARACTER (LEN=6) :: int_to_char + CHARACTER :: c + INTEGER :: n, j, nc + LOGICAL :: neg + ! + nc = 6 + ! + IF( i < 0 ) then + nc = nc - 1 + n = -i + neg = .true. + ELSE + n = i + neg = .false. + END IF + ! + j = 1 + DO WHILE( j <= nc ) + int_to_char(j:j) = CHAR( MOD( n, 10 ) + ICHAR( '0' ) ) + n = n / 10 + IF( n == 0 ) EXIT + j = j + 1 + END DO + ! + IF( j <= nc ) THEN + DO n = 1, j/2 + c = int_to_char( n : n ) + int_to_char( n : n ) = int_to_char( j-n+1 : j-n+1 ) + int_to_char( j-n+1 : j-n+1 ) = c + END DO + IF( j < nc ) int_to_char(j+1:nc) = ' ' + ELSE + int_to_char(:) = '*' + END IF + ! + IF( neg ) THEN + DO n = nc+1, 2, -1 + int_to_char(n:n) = int_to_char(n-1:n-1) + END DO + int_to_char(1:1) = '-' + END IF + ! + RETURN + ! + END FUNCTION int_to_char diff --git a/tests/apps/miniDFT/tests/src/interpolate.f90 b/tests/apps/miniDFT/tests/src/interpolate.f90 new file mode 100644 index 0000000000..e6be1ddd03 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/interpolate.f90 @@ -0,0 +1,157 @@ +! +! Copyright (C) 2001-2003 PWSCF group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +subroutine interpolate (v, vs, iflag) + ! + ! This subroutine interpolates : + ! from the smooth mesh (vs) to a thicker mesh (v) (iflag>0) + ! vs is unchanged on output + ! from the thick mesh (v ) to a smoother mesh (vs) (iflag<=0) + ! v is unchanged on output + ! V and Vs are real and in real space . V and Vs may coincide + ! + USE kinds, ONLY: DP + USE gvect, ONLY: nl, nlm + USE gvecs,ONLY: ngms, nls, nlsm, doublegrid + USE fft_base, ONLY : dfftp, dffts + USE fft_interfaces,ONLY : fwfft, invfft + ! + implicit none + real(DP) :: v (dfftp%nnr), vs (dffts%nnr) + ! function on thick mesh + ! function on smooth mesh + + complex(DP), allocatable :: aux (:), auxs (:) + ! work array on thick mesh + ! work array on smooth mesh + + integer :: iflag + ! gives the direction of the interpolation + + integer :: ig, ir + + call start_clock ('interpolate') + if (iflag <= 0) then + ! + ! from thick to smooth + ! + if (doublegrid) then + allocate (aux( dfftp%nnr)) + allocate (auxs(dffts%nnr)) + aux (:) = v (:) + CALL fwfft ('Dense', aux, dfftp) + auxs (:) = (0.d0, 0.d0) + do ig = 1, ngms + auxs (nls (ig) ) = aux (nl (ig) ) + enddo + CALL invfft ('Smooth', auxs, dffts) + vs (:) = auxs (:) + deallocate (auxs) + deallocate (aux) + else + do ir = 1, dfftp%nnr + vs (ir) = v (ir) + enddo + endif + else + ! + ! from smooth to thick + ! + if (doublegrid) then + allocate (aux( dfftp%nnr)) + allocate (auxs(dffts%nnr)) + auxs (:) = vs (:) + CALL fwfft ('Smooth', auxs, dffts) + aux (:) = (0.d0, 0.d0) + do ig = 1, ngms + aux (nl (ig) ) = auxs (nls (ig) ) + enddo + CALL invfft ('Dense', aux, dfftp) + v (:) = aux (:) + deallocate (auxs) + deallocate (aux) + else + do ir = 1, dfftp%nnr + v (ir) = vs (ir) + enddo + endif + endif + call stop_clock ('interpolate') + return +end subroutine interpolate +! +subroutine cinterpolate (v, vs, iflag) + ! + ! This subroutine interpolates : + ! from the smooth mesh (vs) to a thicker mesh (v) (iflag>0) + ! vs is unchanged on output + ! from the thick mesh (v ) to a smoother mesh (vs) (iflag<=0) + ! v is unchanged on output + ! V and Vs are complex and in real space . V and Vs may coincide + ! + USE kinds, ONLY: DP + USE gvect, ONLY: nl, nlm + USE gvecs,ONLY: ngms, nls, nlsm, doublegrid +!!$ USE control_flags, ONLY: gamma_only + USE fft_base, ONLY : dfftp, dffts + USE fft_interfaces,ONLY : fwfft, invfft + ! + IMPLICIT NONE + complex(DP) :: v (dfftp%nnr), vs (dffts%nnr) + ! function on thick mesh + ! function on smooth mesh + + integer :: iflag + ! gives the direction of the interpolation + + complex(DP), allocatable :: aux (:), auxs (:) + ! work array on thick mesh + ! work array on smooth mesh + + integer :: ig + +!!$ if (gamma_only) call errore ('cinterpolate','not allowed', 1) + call start_clock ('cinterpolate') + if (iflag <= 0) then + ! + ! from thick to smooth + ! + if (doublegrid) then + allocate (aux ( dfftp%nnr)) + aux (:) = v(:) + CALL fwfft ('Dense', aux, dfftp) + vs (:) = (0.d0, 0.d0) + do ig = 1, ngms + vs (nls (ig) ) = aux (nl (ig) ) + enddo + CALL invfft ('Smooth', vs, dffts) + deallocate (aux) + else + call zcopy (dfftp%nnr, v, 1, vs, 1) + endif + else + ! + ! from smooth to thick + ! + if (doublegrid) then + allocate (auxs (dffts%nnr)) + auxs (:) = vs(:) + CALL fwfft ('Smooth', auxs, dffts) + v (:) = (0.d0, 0.d0) + do ig = 1, ngms + v (nl (ig) ) = auxs (nls (ig) ) + enddo + CALL invfft ('Dense', v, dfftp) + deallocate (auxs) + else + call zcopy (dfftp%nnr, vs, 1, v, 1) + endif + endif + call stop_clock ('cinterpolate') + return +end subroutine cinterpolate diff --git a/tests/apps/miniDFT/tests/src/invmat.f90 b/tests/apps/miniDFT/tests/src/invmat.f90 new file mode 100644 index 0000000000..0d537e76dd --- /dev/null +++ b/tests/apps/miniDFT/tests/src/invmat.f90 @@ -0,0 +1,48 @@ +! +! Copyright (C) 2004 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +subroutine invmat (n, a, a_inv, da) + !----------------------------------------------------------------------- + ! computes the inverse "a_inv" of matrix "a", both dimensioned (n,n) + ! if the matrix is dimensioned 3x3, it also computes determinant "da" + ! matrix "a" is unchanged on output - LAPACK + ! + USE kinds, ONLY : DP + implicit none + integer :: n + real(DP), DIMENSION (n,n) :: a, a_inv + real(DP) :: da + ! + integer :: info, lda, lwork, ipiv (n) + ! info=0: inversion was successful + ! lda : leading dimension (the same as n) + ! ipiv : work space for pivoting (assumed of length lwork=n) + real(DP) :: work (n) + ! more work space + ! + lda = n + lwork=n + ! + a_inv(:,:) = a(:,:) + ! + call dgetrf (n, n, a_inv, lda, ipiv, info) + call errore ('invmat', 'error in DGETRF', abs (info) ) + call dgetri (n, a_inv, lda, ipiv, work, lwork, info) + call errore ('invmat', 'error in DGETRI', abs (info) ) + ! + if (n == 3) then + da = a(1,1)*(a(2,2)*a(3,3)-a(2,3)*a(3,2)) + & + a(1,2)*(a(2,3)*a(3,1)-a(2,1)*a(3,3)) + & + a(1,3)*(a(2,1)*a(3,2)-a(3,1)*a(2,2)) + IF (ABS(da) < 1.d-10) CALL errore(' invmat ',' singular matrix ', 1) + else + da = 0.d0 + end if + + return +end subroutine invmat + diff --git a/tests/apps/miniDFT/tests/src/io_files.f90 b/tests/apps/miniDFT/tests/src/io_files.f90 new file mode 100644 index 0000000000..f9cd1f40e6 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/io_files.f90 @@ -0,0 +1,392 @@ +! +! Copyright (C) 2002-2010 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +!=----------------------------------------------------------------------------=! +MODULE io_files +!=----------------------------------------------------------------------------=! + ! + USE parameters, ONLY: ntypx + ! + ! ... The name of the files + ! + IMPLICIT NONE + ! + SAVE + ! + CHARACTER(len=256) :: tmp_dir = './' ! directory for temporary files + CHARACTER(len=256) :: wfc_dir = 'undefined' ! directory for large files on each node, should be kept 'undefined' if not known + CHARACTER(len=256) :: prefix = 'os' ! prepended to file names + CHARACTER(len=6) :: nd_nmbr = '000000' ! node number (used only in parallel case) + CHARACTER(len=256) :: pseudo_dir = './' ! original location of PP files + CHARACTER(len=256) :: pseudo_dir_cur = ' ' ! current location when restarting + CHARACTER(len=256) :: psfile( ntypx ) = 'UPF' + CHARACTER(len=256) :: outdir = './' + ! + CHARACTER(len=256) :: qexml_version = ' ' ! the format of the current qexml datafile + LOGICAL :: qexml_version_init = .FALSE. ! whether the fmt has been read or not + ! + CHARACTER(LEN=256) :: input_drho = ' ' ! name of the file with the input drho + CHARACTER(LEN=256) :: output_drho = ' ' ! name of the file with the output drho + ! + CHARACTER(LEN=5 ), PARAMETER :: crash_file = 'CRASH' + CHARACTER (LEN=261) :: & + exit_file = "os.EXIT" ! file required for a soft exit + ! + CHARACTER (LEN=9), PARAMETER :: xmlpun_base = 'data-file' + CHARACTER (LEN=13), PARAMETER :: xmlpun = xmlpun_base // '.xml' + ! + ! ... The units where various variables are saved + ! + INTEGER :: rhounit = 17 + INTEGER :: crashunit = 15 + INTEGER :: pseudounit = 10 + INTEGER :: opt_unit = 20 ! optional unit + ! + ! ... units in pwscf + ! + INTEGER :: iunres = 1 ! unit for the restart of the run + INTEGER :: iunpun = 4 ! unit for saving the final results + INTEGER :: iunwfc = 10 ! unit with wavefunctions + INTEGER :: iunoldwfc = 11 ! unit with old wavefunctions + INTEGER :: iunoldwfc2 = 12 ! as above at step -2 + INTEGER :: iunat = 13 ! unit for saving (orthogonal) atomic wfcs + INTEGER :: iunsat = 14 ! unit for saving (orthogonal) atomic wfcs * S + INTEGER :: iunocc = 15 ! unit for saving the atomic n_{ij} + INTEGER :: iunigk = 16 ! unit for saving indices + INTEGER :: iunpaw = 17 ! unit for saving paw becsum and D_Hxc + ! + INTEGER :: iunexit = 26 ! unit for a soft exit + INTEGER :: iunupdate = 27 ! unit for saving old positions (extrapolation) + INTEGER :: iunnewimage = 28 ! unit for parallelization among images + INTEGER :: iunlock = 29 ! as above (locking file) + ! + INTEGER :: iunbfgs = 30 ! unit for the bfgs restart file + INTEGER :: iunatsicwfc = 31 ! unit for sic wfc + ! + INTEGER :: iuntmp = 90 ! temporary unit, when used must be closed ASAP + ! + INTEGER :: nwordwfc = 2 ! length of record in wavefunction file + INTEGER :: nwordatwfc = 2 ! length of record in atomic wfc file + INTEGER :: nwordwann = 2 ! length of record in sic wfc file + ! + ! ... "path" specific + ! + !... finite electric field (Umari) + ! + INTEGER :: iunefield = 31 ! unit to store wavefunction for calculatin electric field operator + ! + INTEGER :: iunefieldm = 32 !unit to store projectors for hermitean electric field potential + ! + INTEGER :: iunefieldp = 33 !unit to store projectors for hermitean electric field potential + ! + ! ... For Wannier Hamiltonian + ! + INTEGER :: iunwpp = 113 + INTEGER :: iunwf = 114 + INTEGER :: nwordwpp = 2 + INTEGER :: nwordwf = 2 + ! + INTEGER, EXTERNAL :: find_free_unit +CONTAINS + ! + !-------------------------------------------------------------------------- + SUBROUTINE delete_if_present( filename, in_warning ) + !-------------------------------------------------------------------------- + ! + USE io_global, ONLY : ionode, stdout + ! + IMPLICIT NONE + ! + CHARACTER(LEN=*), INTENT(IN) :: filename + LOGICAL, OPTIONAL, INTENT(IN) :: in_warning + LOGICAL :: exst, warning + INTEGER :: iunit + ! + IF ( .NOT. ionode ) RETURN + ! + INQUIRE( FILE = filename, EXIST = exst ) + ! + IF ( exst ) THEN + ! + iunit = find_free_unit() + ! + warning = .FALSE. + ! + IF ( PRESENT( in_warning ) ) warning = in_warning + ! + OPEN( UNIT = iunit, FILE = filename , STATUS = 'OLD' ) + CLOSE( UNIT = iunit, STATUS = 'DELETE' ) + ! + IF ( warning ) & + WRITE( UNIT = stdout, FMT = '(/,5X,"WARNING: ",A, & + & " file was present; old file deleted")' ) filename + ! + END IF + ! + RETURN + ! + END SUBROUTINE delete_if_present + ! + !-------------------------------------------------------------------------- + FUNCTION check_writable ( file_path, process_id ) RESULT ( ios ) + !-------------------------------------------------------------------------- + ! + ! ... if run by multiple processes, specific "process_id" to avoid + ! ... opening, closing, deleting the same file from different processes + ! + ! + IMPLICIT NONE + ! + CHARACTER(LEN=*), INTENT(IN) :: file_path + INTEGER, OPTIONAL, INTENT(IN) :: process_id + ! + INTEGER :: ios + ! + CHARACTER(LEN=6), EXTERNAL :: int_to_char + ! + ! ... check whether the scratch directory is writable + ! ... note that file_path should end by a "/" + ! + IF ( PRESENT (process_id ) ) THEN + OPEN( UNIT = 4, FILE = TRIM(file_path) // 'test' // & + & TRIM( int_to_char ( process_id ) ), & + & STATUS = 'UNKNOWN', FORM = 'UNFORMATTED', IOSTAT = ios ) + ELSE + OPEN( UNIT = 4, FILE = TRIM(file_path) // 'test', & + STATUS = 'UNKNOWN', FORM = 'UNFORMATTED', IOSTAT = ios ) + END IF + ! + CLOSE( UNIT = 4, STATUS = 'DELETE' ) + ! + !----------------------------------------------------------------------- + END FUNCTION check_writable +!----------------------------------------------------------------------- +! +!----------------------------------------------------------------------- +subroutine diropn (unit, extension, recl, exst, tmp_dir_) + !----------------------------------------------------------------------- + ! + ! this routine opens a file named "prefix"."extension" in tmp_dir + ! for direct I/O access + ! If appropriate, the node number is added to the file name + ! +#if defined(__SX6) +# define DIRECT_IO_FACTOR 1 +#else +# define DIRECT_IO_FACTOR 8 +#endif + ! + ! the record length in direct-access I/O is given by the number of + ! real*8 words times DIRECT_IO_FACTOR (may depend on the compiler) + ! + USE kinds + implicit none + ! + ! first the input variables + ! + character(len=*) :: extension + ! input: name of the file to open + character(len=*), optional :: tmp_dir_ + ! optional variable, if present it is used as tmp_dir + integer :: unit, recl + ! input: unit of the file to open + ! input: length of the records + logical :: exst + ! output: if true the file exists + ! + ! local variables + ! + character(len=256) :: tempfile, filename + ! complete file name + integer :: ios + integer*8 :: unf_recl + ! used to check I/O operations + ! length of the record + logical :: opnd + + ! Check if the optional variable tmp_dir is included + ! + + ! if true the file is already opened + ! + if (unit < 0) call errore ('diropn', 'wrong unit', 1) + ! + ! we first check that the file is not already openend + ! + ios = 0 + inquire (unit = unit, opened = opnd) + if (opnd) call errore ('diropn', "can't open a connected unit", abs(unit)) + ! + ! then we check the filename extension + ! + if (extension == ' ') call errore ('diropn','filename extension not given',2) + filename = trim(prefix) // "." // trim(extension) + if (present(tmp_dir_)) then + tempfile = trim(tmp_dir_) // trim(filename) //nd_nmbr + else + tempfile = trim(tmp_dir) // trim(filename) //nd_nmbr + endif + + inquire (file = tempfile, exist = exst) + ! + ! the unit for record length is unfortunately machine-dependent + ! + unf_recl = DIRECT_IO_FACTOR * int(recl, kind=kind(unf_recl)) + if (unf_recl <= 0) call errore ('diropn', 'wrong record length', 3) + ! + open (unit, file = trim(adjustl(tempfile)), iostat = ios, form = 'unformatted', & + status = 'unknown', access = 'direct', recl = unf_recl) + + if (ios /= 0) call errore ('diropn', 'error opening '//trim(tempfile), unit) + return + !----------------------------------------------------------------------- +end subroutine diropn +!----------------------------------------------------------------------- +! +!----------------------------------------------------------------------- +subroutine seqopn (unit, extension, formatt, exst, tmp_dir_) + !----------------------------------------------------------------------- + ! + ! this routine opens a file named "prefix"."extension" + ! in tmp_dir for sequential I/O access + ! If appropriate, the node number is added to the file name + ! + implicit none + ! + ! first the dummy variables + ! + character(len=*) :: formatt, extension + ! input: name of the file to connect + ! input: 'formatted' or 'unformatted' + character(len=*), optional :: tmp_dir_ + ! optional variable, if present it is used as tmp_dir + integer :: unit + ! input: unit to connect + logical :: exst + ! output: true if the file already exist + ! + ! here the local variables + ! + character(len=256) :: tempfile, filename + ! complete file name + integer :: ios + ! integer variable to test I/O status + logical :: opnd + ! true if the file is already opened + + + if (unit < 1) call errore ('seqopn', 'wrong unit', 1) + ! + ! test if the file is already opened + ! + ios = 0 + inquire (unit = unit, opened = opnd) + if (opnd) call errore ('seqopn', "can't open a connected unit", & + abs (unit) ) + ! + ! then we check the extension of the filename + ! + if (extension.eq.' ') call errore ('seqopn','filename extension not given',2) + filename = trim(prefix) // "." // trim(extension) + ! Use the tmp_dir from input, if available + if ( present(tmp_dir_) ) then + tempfile = trim(tmp_dir_) // trim(filename) + else + tempfile = trim(tmp_dir) // trim(filename) + end if + if ( trim(nd_nmbr) == '1' .or. trim(nd_nmbr) == '01'.or. & + trim(nd_nmbr) == '001' .or. trim(nd_nmbr) == '0001'.or. & + trim(nd_nmbr) == '00001' .or. trim(nd_nmbr) == '000001' ) then + ! + ! do not add processor number to files opened by processor 1 + ! in parallel execution: if only the first processor writes, + ! we do not want the filename to be dependent on the number + ! of processors + ! + !tempfile = tempfile + else + tempfile = trim(tempfile) // nd_nmbr + end if + inquire (file = tempfile, exist = exst) + ! + ! Open the file + ! + + open (unit = unit, file = tempfile, form = formatt, status = & + 'unknown', iostat = ios) + + if (ios /= 0) call errore ('seqopn', 'error opening '//trim(tempfile), unit) + return + !----------------------------------------------------------------------- +end subroutine seqopn +!----------------------------------------------------------------------- +! +!=----------------------------------------------------------------------------=! +END MODULE io_files +!=----------------------------------------------------------------------------=! +! +!---------------------------------------------------------------------------- +SUBROUTINE davcio( vect, nword, unit, nrec, io ) + !---------------------------------------------------------------------------- + ! + ! ... direct-access vector input/output + ! ... read/write nword words starting from the address specified by vect + ! + USE io_global, ONLY : stdout + USE kinds, ONLY : DP + ! + IMPLICIT NONE + ! + INTEGER, INTENT(IN) :: nword, unit, nrec, io + ! input: the dimension of vect + ! input: the unit where to read/write + ! input: the record where to read/write + ! input: flag if < 0 reading if > 0 writing + REAL(DP), INTENT(INOUT) :: vect(nword) + ! input/output: the vector to read/write + ! + INTEGER :: ios + ! integer variable for I/O control + LOGICAL :: opnd + ! + ! + CALL start_clock( 'davcio' ) + ! + INQUIRE( UNIT = unit ) + ! + IF ( unit <= 0 ) CALL errore( 'davcio', 'wrong unit', 1 ) + IF ( nrec <= 0 ) CALL errore( 'davcio', 'wrong record number', 2 ) + IF ( nword <= 0 ) CALL errore( 'davcio', 'wrong record length', 3 ) + IF ( io == 0 ) CALL infomsg( 'davcio', 'nothing to do?' ) + ! + INQUIRE( UNIT = unit, OPENED = opnd ) + ! + IF ( .NOT. opnd ) & + CALL errore( 'davcio', 'unit is not opened', unit ) + ! + ios = 0 + ! + IF ( io < 0 ) THEN + ! + READ( UNIT = unit, REC = nrec, IOSTAT = ios ) vect + IF ( ios /= 0 ) & + CALL errore( 'davcio', 'error while reading from file', unit ) + ! + ELSE IF ( io > 0 ) THEN + ! + WRITE( UNIT = unit, REC = nrec, IOSTAT = ios ) vect + IF ( ios /= 0 ) & + CALL errore( 'davcio', 'error while writing to file', unit ) + ! + END IF + ! + CALL stop_clock( 'davcio' ) + ! + RETURN + ! +END SUBROUTINE davcio + diff --git a/tests/apps/miniDFT/tests/src/io_global.f90 b/tests/apps/miniDFT/tests/src/io_global.f90 new file mode 100644 index 0000000000..812b074450 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/io_global.f90 @@ -0,0 +1,137 @@ +! +! Copyright (C) 2002-2004 FPMD & PWSCF group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +!---------------------------------------------------------------------------- +MODULE io_global + !---------------------------------------------------------------------------- + ! + IMPLICIT NONE + ! + PRIVATE + SAVE + ! + PUBLIC :: io_global_start, meta_io_global_start, io_global_getionode, io_global_getmeta + PUBLIC :: stdout, ionode, ionode_id, meta_ionode, meta_ionode_id + PUBLIC :: xmlinputunit, xmloutputunit, xmltmpunit + ! + INTEGER :: stdout = 6 ! unit connected to standard output + INTEGER :: ionode_id = 0 ! index of the i/o node + LOGICAL :: ionode = .TRUE. ! identifies the i/o node + INTEGER :: meta_ionode_id = 0 ! index of the i/o node for meta-codes + LOGICAL :: meta_ionode = .TRUE. ! identifies the i/o node for meta-codes + LOGICAL :: first = .TRUE. + INTEGER :: xmlinputunit ! unit connected to the xml input + INTEGER :: xmloutputunit = 51 ! unit connected to the xml output + INTEGER :: xmltmpunit = 52 ! unit connected to the temp xml output + ! + CONTAINS + ! + !----------------------------------------------------------------------- + SUBROUTINE io_global_start( mpime, ionode_set ) + !----------------------------------------------------------------------- + ! + IMPLICIT NONE + ! + INTEGER, INTENT(IN) :: mpime, ionode_set + ! + ! + IF ( mpime == ionode_set ) THEN + ! + ionode = .TRUE. + ! + ELSE + ! + ionode = .FALSE. + ! + END IF + ! + ionode_id = ionode_set + ! + first = .FALSE. + ! + RETURN + ! + END SUBROUTINE io_global_start + ! + !----------------------------------------------------------------------- + SUBROUTINE meta_io_global_start( mpime, ionode_set ) + !----------------------------------------------------------------------- + ! + IMPLICIT NONE + ! + INTEGER, INTENT(IN) :: mpime, ionode_set + ! + ! + IF ( mpime == ionode_set ) THEN + ! + meta_ionode = .TRUE. + ! + ELSE + ! + meta_ionode = .FALSE. + ! + END IF + ! + meta_ionode_id = ionode_set + ! + first = .FALSE. + ! + RETURN + ! + END SUBROUTINE meta_io_global_start + ! + ! + ! + !----------------------------------------------------------------------- + SUBROUTINE io_global_getionode( ionode_out, ionode_id_out ) + !----------------------------------------------------------------------- + ! + IMPLICIT NONE + ! + LOGICAL, INTENT(OUT) :: ionode_out + INTEGER, INTENT(OUT) :: ionode_id_out + ! + ! + IF ( first ) & + CALL errore( ' io_global_getionode ', ' ionode not yet defined ', 1 ) + ! + ionode_out = ionode + ionode_id_out = ionode_id + ! + RETURN + ! + END SUBROUTINE io_global_getionode + ! + ! + !----------------------------------------------------------------------- + SUBROUTINE io_global_getmeta( myrank, root ) + !----------------------------------------------------------------------- + ! + ! ... writes in module variables meta_ionode_id and meta_ionode + ! + IMPLICIT NONE + ! + INTEGER, INTENT(IN) :: myrank, root + ! + ! + IF(myrank == root) THEN + ! + meta_ionode = .true. + ! + ELSE + meta_ionode = .false. + ! + ENDIF + ! + meta_ionode_id = root + ! + RETURN + ! + END SUBROUTINE io_global_getmeta + ! + ! +END MODULE io_global diff --git a/tests/apps/miniDFT/tests/src/ions_base.f90 b/tests/apps/miniDFT/tests/src/ions_base.f90 new file mode 100644 index 0000000000..fb5a2963c7 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/ions_base.f90 @@ -0,0 +1,861 @@ +! +! Copyright (C) 2002-2011 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +!------------------------------------------------------------------------------! + MODULE ions_base +!------------------------------------------------------------------------------! + + USE kinds, ONLY : DP + USE parameters, ONLY : ntypx +! + IMPLICIT NONE + SAVE + + ! nsp = number of species + ! na(is) = number of atoms of species is + ! nax = max number of atoms of a given species + ! nat = total number of atoms of all species + + INTEGER :: nsp = 0 + INTEGER :: na(ntypx) = 0 + INTEGER :: nax = 0 + INTEGER :: nat = 0 + + ! zv(is) = (pseudo-)atomic charge + ! amass(is) = mass of ions, in atomic mass units + ! rcmax(is) = Ewald radius (for ion-ion interactions) + + REAL(DP) :: zv(ntypx) = 0.0_DP + REAL(DP) :: amass(ntypx) = 0.0_DP + REAL(DP) :: rcmax(ntypx) = 0.0_DP + + ! ityp( i ) = the type of i-th atom in stdin + ! atm( j ) = name of the type of the j-th atomic specie + ! tau( 1:3, i ) = position of the i-th atom + + INTEGER, ALLOCATABLE :: ityp(:) + REAL(DP), ALLOCATABLE :: tau(:,:) ! initial positions read from stdin (in bohr) + REAL(DP), ALLOCATABLE :: vel(:,:) ! initial velocities read from stdin (in bohr) + REAL(DP), ALLOCATABLE :: tau_srt(:,:) ! tau sorted by specie in bohr + REAL(DP), ALLOCATABLE :: vel_srt(:,:) ! vel sorted by specie in bohr + INTEGER, ALLOCATABLE :: ind_srt(:) ! index of tau sorted by specie + INTEGER, ALLOCATABLE :: ind_bck(:) ! reverse of ind_srt + CHARACTER(LEN=3) :: atm( ntypx ) + CHARACTER(LEN=3), ALLOCATABLE :: label_srt( : ) + CHARACTER(LEN=80) :: tau_format ! format of input atomic positions: + ! 'alat','crystal','bohr','angstrom' + + ! if_pos( x, i ) = 0 : x coordinate of i-th atom will be kept fixed + INTEGER, ALLOCATABLE :: if_pos(:,:) ! allowed values: 0 or 1 only + INTEGER, ALLOCATABLE :: iforce(:,:) ! if_pos sorted by specie + INTEGER :: fixatom = 0 ! number of frozen atoms + INTEGER :: ndofp =-1 ! ionic degree of freedom + INTEGER :: ndfrz = 0 ! frozen degrees of freedom + + REAL(DP) :: fricp ! friction parameter for damped dynamics + REAL(DP) :: greasp ! friction parameter for damped dynamics + + ! ... taui = real ionic positions in the center of mass reference + ! ... system at istep = 0 + ! ... this array is used to compute mean square displacements, + ! ... it is initialized when NBEG = -1, NBEG = 0 and TAURDR = .TRUE. + ! ... first index: x,y,z, second index: atom sortred by specie with respect input + ! ... this array is saved in the restart file + + REAL(DP), ALLOCATABLE :: taui(:,:) + + ! ... cdmi = center of mass reference system (related to the taui) + ! ... this vector is computed when NBEG = -1, NBEG = 0 and TAURDR = .TRUE. + ! ... this array is saved in the restart file + + REAL(DP) :: cdmi(3), cdm(3) + + ! ... cdms = center of mass computed for scaled positions (taus) + + REAL(DP) :: cdms(3) + ! + REAL(DP), ALLOCATABLE :: extfor(:,:) ! external forces on atoms + + LOGICAL :: tions_base_init = .FALSE. + LOGICAL, PRIVATE :: tdebug = .FALSE. + + + INTERFACE ions_vel + MODULE PROCEDURE ions_vel3, ions_vel2 + END INTERFACE ions_vel + + +!------------------------------------------------------------------------------! + CONTAINS +!------------------------------------------------------------------------------! + + SUBROUTINE packtau( taup, tau, na, nsp ) + IMPLICIT NONE + REAL(DP), INTENT(OUT) :: taup( :, : ) + REAL(DP), INTENT(IN) :: tau( :, :, : ) + INTEGER, INTENT(IN) :: na( : ), nsp + INTEGER :: is, ia, isa + isa = 0 + DO is = 1, nsp + DO ia = 1, na( is ) + isa = isa + 1 + taup( :, isa ) = tau( :, ia, is ) + END DO + END DO + RETURN + END SUBROUTINE packtau + +!------------------------------------------------------------------------------! + + SUBROUTINE unpacktau( tau, taup, na, nsp ) + IMPLICIT NONE + REAL(DP), INTENT(IN) :: taup( :, : ) + REAL(DP), INTENT(OUT) :: tau( :, :, : ) + INTEGER, INTENT(IN) :: na( : ), nsp + INTEGER :: is, ia, isa + isa = 0 + DO is = 1, nsp + DO ia = 1, na( is ) + isa = isa + 1 + tau( :, ia, is ) = taup( :, isa ) + END DO + END DO + RETURN + END SUBROUTINE unpacktau + +!------------------------------------------------------------------------------! + + SUBROUTINE sort_tau( tausrt, isrt, tau, isp, nat, nsp ) + IMPLICIT NONE + REAL(DP), INTENT(OUT) :: tausrt( :, : ) + INTEGER, INTENT(OUT) :: isrt( : ) + REAL(DP), INTENT(IN) :: tau( :, : ) + INTEGER, INTENT(IN) :: nat, nsp, isp( : ) + INTEGER :: ina( nsp ), na( nsp ) + INTEGER :: is, ia + + ! ... count the atoms for each specie + na = 0 + DO ia = 1, nat + is = isp( ia ) + IF( is < 1 .OR. is > nsp ) & + CALL errore(' sorttau ', ' wrong species index for positions ', ia ) + na( is ) = na( is ) + 1 + END DO + + ! ... compute the index of the first atom in each specie + ina( 1 ) = 0 + DO is = 2, nsp + ina( is ) = ina( is - 1 ) + na( is - 1 ) + END DO + + ! ... sort the position according to atomic specie + na = 0 + DO ia = 1, nat + is = isp( ia ) + na( is ) = na( is ) + 1 + tausrt( :, na(is) + ina(is) ) = tau(:, ia ) + isrt ( na(is) + ina(is) ) = ia + END DO + RETURN + END SUBROUTINE sort_tau + +!------------------------------------------------------------------------------! + + SUBROUTINE unsort_tau( tau, tausrt, isrt, nat ) + IMPLICIT NONE + REAL(DP), INTENT(IN) :: tausrt( :, : ) + INTEGER, INTENT(IN) :: isrt( : ) + REAL(DP), INTENT(OUT) :: tau( :, : ) + INTEGER, INTENT(IN) :: nat + INTEGER :: isa, ia + DO isa = 1, nat + ia = isrt( isa ) + tau( :, ia ) = tausrt( :, isa ) + END DO + RETURN + END SUBROUTINE unsort_tau + + !------------------------------------------------------------------------- + SUBROUTINE ions_base_init( nsp_, nat_, na_, ityp_, tau_, vel_, amass_,& + atm_, if_pos_, tau_format_, alat_, at_, & + rcmax_ , extfor_ ) + !------------------------------------------------------------------------- + ! + USE constants, ONLY: amu_au, bohr_radius_angs + USE io_global, ONLY: stdout + ! + IMPLICIT NONE + ! + INTEGER, INTENT(IN) :: nsp_, nat_, na_(:), ityp_(:) + REAL(DP), INTENT(IN) :: tau_(:,:) + REAL(DP), INTENT(IN) :: vel_(:,:) + REAL(DP), INTENT(IN) :: amass_(:) + CHARACTER(LEN=*), INTENT(IN) :: atm_(:) + CHARACTER(LEN=*), INTENT(IN) :: tau_format_ + INTEGER, INTENT(IN) :: if_pos_(:,:) + REAL(DP), INTENT(IN) :: alat_, at_(3,3) + REAL(DP), INTENT(IN) :: rcmax_(:) + REAL(DP), INTENT(IN) :: extfor_(:,:) + ! + INTEGER :: i, ia, is + ! + ! + nsp = nsp_ + nat = nat_ + ! + IF ( nat < 1 ) & + CALL errore( 'ions_base_init ', 'nax out of range', 1 ) + IF ( nsp < 1 ) & + CALL errore( 'ions_base_init ', 'nsp out of range', 1 ) + IF ( nsp > SIZE( na ) ) & + CALL errore( 'ions_base_init ', & + & 'nsp too large, increase ntypx parameter ', 1 ) + ! + na(1:nsp) = na_(1:nsp) + nax = MAXVAL( na(1:nsp) ) + ! + atm(1:nsp) = atm_(1:nsp) + tau_format = TRIM( tau_format_ ) + ! + IF ( nat /= SUM( na(1:nsp) ) ) & + CALL errore( 'ions_base_init ','inconsistent nat and na ', 1 ) + ! + CALL deallocate_ions_base() + ! + ALLOCATE( ityp( nat ) ) + ALLOCATE( tau( 3, nat ) ) + ALLOCATE( vel( 3, nat ) ) + ALLOCATE( tau_srt( 3, nat ) ) + ALLOCATE( vel_srt( 3, nat ) ) + ALLOCATE( ind_srt( nat ) ) + ALLOCATE( ind_bck( nat ) ) + ALLOCATE( if_pos( 3, nat ) ) + ALLOCATE( iforce( 3, nat ) ) + ALLOCATE( taui( 3, nat ) ) + ALLOCATE( label_srt( nat ) ) + ALLOCATE( extfor( 3, nat ) ) + ! + ityp(1:nat) = ityp_(1:nat) + vel(:,1:nat) = vel_(:,1:nat) + if_pos(:,1:nat) = if_pos_(:,1:nat) + ! + ! ... radii, masses + ! + DO is = 1, nsp_ + ! + rcmax(is) = rcmax_(is) + ! + IF( rcmax(is) <= 0.0_DP ) & + CALL errore( 'ions_base_init ', 'invalid rcmax', is ) + ! + END DO + ! + SELECT CASE ( TRIM( tau_format ) ) + ! + ! ... convert input atomic positions to internally used format: + ! ... tau in atomic units + ! + CASE( 'alat' ) + ! + ! ... input atomic positions are divided by a0 + ! + tau(:,1:nat) = tau_(:,1:nat) * alat_ + vel(:,1:nat) = vel_(:,1:nat) * alat_ + ! + CASE( 'bohr' ) + ! + ! ... input atomic positions are in a.u.: do nothing + ! + tau(:,1:nat) = tau_(:,1:nat) + vel(:,1:nat) = vel_(:,1:nat) + ! + CASE( 'crystal' ) + ! + ! ... input atomic positions are in crystal axis ("scaled") + ! + DO ia = 1, nat + ! + DO i = 1, 3 + ! + tau(i,ia) = at_(i,1)*alat_ * tau_(1,ia) + & + at_(i,2)*alat_ * tau_(2,ia) + & + at_(i,3)*alat_ * tau_(3,ia) + ! + vel(i,ia) = at_(i,1)*alat_ * vel_(1,ia) + & + at_(i,2)*alat_ * vel_(2,ia) + & + at_(i,3)*alat_ * vel_(3,ia) + + END DO + ! + END DO + ! + CASE( 'angstrom' ) + ! + ! ... atomic positions in A + ! + tau(:,1:nat) = tau_(:,1:nat) / bohr_radius_angs + vel(:,1:nat) = vel_(:,1:nat) / bohr_radius_angs + ! + CASE DEFAULT + ! + CALL errore( 'ions_base_init',' tau_format = ' // & + & TRIM( tau_format ) // ' not implemented ', 1 ) + ! + END SELECT + ! + ! ... tau_srt : atomic species are ordered according to + ! ... the ATOMIC_SPECIES input card. Within each specie atoms are ordered + ! ... according to the ATOMIC_POSITIONS input card. + ! ... ind_srt : can be used to restore the original position + ! + CALL sort_tau( tau_srt, ind_srt, tau, ityp, nat, nsp ) + ! + vel_srt(:,:) = vel(:,ind_srt(:)) + ! + DO ia = 1, nat + ! + label_srt( ia ) = atm( ityp( ind_srt( ia ) ) ) + ! + END DO + ! + ! ... generate ind_bck from ind_srt (reverse sort list) + ! + DO ia = 1, nat + ! + ind_bck(ind_srt(ia)) = ia + ! + END DO + ! + DO ia = 1, nat + ! + extfor( :, ia ) = extfor_( :, ind_srt( ia ) ) + ! + END DO + ! + IF( tdebug ) THEN + WRITE( stdout, * ) 'ions_base_init: unsorted position and velocities' + DO ia = 1, nat + WRITE( stdout, fmt="(A3,3D12.4,3X,3D12.4)") & + atm( ityp( ia ) ), tau(1:3, ia), vel(1:3,ia) + END DO + WRITE( stdout, * ) 'ions_base_init: sorted position and velocities' + DO ia = 1, nat + WRITE( stdout, fmt="(A3,3D12.4,3X,3D12.4)") & + atm( ityp( ind_srt( ia ) ) ), tau_srt(1:3, ia), vel_srt(1:3,ia) + END DO + END IF + ! + ! ... The constrain on fixed coordinates is implemented using the array + ! ... if_pos whose value is 0 when the coordinate is to be kept fixed, 1 + ! ... otherwise. + ! + if_pos = 1 + if_pos(:,:) = if_pos_(:,1:nat) + ! + iforce = 0 + iforce(:,:) = if_pos(:,ind_srt(:)) + ! + fixatom=COUNT( if_pos(1,:)==0 .AND. if_pos(2,:)==0 .AND. if_pos(3,:)==0 ) + ndofp = COUNT( iforce == 1 ) + ndfrz = 3*nat - ndofp + ! + amass(1:nsp) = amass_(1:nsp) + ! + IF ( ANY( amass(1:nsp) <= 0.0_DP ) ) & + CALL errore( 'ions_base_init ', 'invalid mass', 1 ) + ! + CALL ions_cofmass( tau_srt, amass, na, nsp, cdmi ) + ! + DO ia = 1, nat + ! + taui(1:3,ia) = tau_srt(1:3,ia) - cdmi(1:3) + ! + END DO + ! + tions_base_init = .TRUE. + ! + RETURN + ! + END SUBROUTINE ions_base_init + ! + !------------------------------------------------------------------------- + SUBROUTINE deallocate_ions_base() + !------------------------------------------------------------------------- + ! + IMPLICIT NONE + ! + IF ( ALLOCATED( ityp ) ) DEALLOCATE( ityp ) + IF ( ALLOCATED( tau ) ) DEALLOCATE( tau ) + IF ( ALLOCATED( vel ) ) DEALLOCATE( vel ) + IF ( ALLOCATED( tau_srt ) ) DEALLOCATE( tau_srt ) + IF ( ALLOCATED( vel_srt ) ) DEALLOCATE( vel_srt ) + IF ( ALLOCATED( ind_srt ) ) DEALLOCATE( ind_srt ) + IF ( ALLOCATED( ind_bck ) ) DEALLOCATE( ind_bck ) + IF ( ALLOCATED( if_pos ) ) DEALLOCATE( if_pos ) + IF ( ALLOCATED( iforce ) ) DEALLOCATE( iforce ) + IF ( ALLOCATED( taui ) ) DEALLOCATE( taui ) + IF ( ALLOCATED( label_srt ) ) DEALLOCATE( label_srt ) + IF ( ALLOCATED( extfor ) ) DEALLOCATE( extfor ) + ! + tions_base_init = .FALSE. + ! + RETURN + ! + END SUBROUTINE deallocate_ions_base + ! + !------------------------------------------------------------------------- + SUBROUTINE ions_vel3( vel, taup, taum, na, nsp, dt ) + !------------------------------------------------------------------------- + USE constants, ONLY : eps8 + IMPLICIT NONE + REAL(DP) :: vel(:,:), taup(:,:), taum(:,:) + INTEGER :: na(:), nsp + REAL(DP) :: dt + INTEGER :: ia, is, i, isa + REAL(DP) :: fac + IF( dt < eps8 ) & + CALL errore( ' ions_vel3 ', ' dt <= 0 ', 1 ) + fac = 1.0_DP / ( dt * 2.0_DP ) + isa = 0 + DO is = 1, nsp + DO ia = 1, na(is) + isa = isa + 1 + DO i = 1, 3 + vel(i,isa) = ( taup(i,isa) - taum(i,isa) ) * fac + END DO + END DO + END DO + RETURN + END SUBROUTINE ions_vel3 + +!------------------------------------------------------------------------------! + + SUBROUTINE ions_vel2( vel, taup, taum, nat, dt ) + USE constants, ONLY : eps8 + IMPLICIT NONE + REAL(DP) :: vel(:,:), taup(:,:), taum(:,:) + INTEGER :: nat + REAL(DP) :: dt + INTEGER :: ia, i + REAL(DP) :: fac + IF( dt < eps8 ) & + CALL errore( ' ions_vel3 ', ' dt <= 0 ', 1 ) + fac = 1.0_DP / ( dt * 2.0_DP ) + DO ia = 1, nat + DO i = 1, 3 + vel(i,ia) = ( taup(i,ia) - taum(i,ia) ) * fac + END DO + END DO + RETURN + END SUBROUTINE ions_vel2 + +!------------------------------------------------------------------------------! + + SUBROUTINE ions_cofmass( tau, pmass, na, nsp, cdm ) + USE constants, ONLY : eps8 + IMPLICIT NONE + REAL(DP), INTENT(IN) :: tau(:,:), pmass(:) + REAL(DP), INTENT(OUT) :: cdm(3) + INTEGER, INTENT(IN) :: na(:), nsp + + REAL(DP) :: tmas + INTEGER :: is, i, ia, isa +! + tmas=0.0_DP + do is=1,nsp + tmas=tmas+na(is)*pmass(is) + end do + + if( tmas < eps8 ) & + call errore(' ions_cofmass ', ' total mass <= 0 ', 1 ) +! + do i=1,3 + cdm(i)=0.0_DP + isa = 0 + do is=1,nsp + do ia=1,na(is) + isa = isa + 1 + cdm(i)=cdm(i)+tau(i,isa)*pmass(is) + end do + end do + cdm(i)=cdm(i)/tmas + end do +! + RETURN + END SUBROUTINE ions_cofmass + +!------------------------------------------------------------------------------! + + SUBROUTINE randpos(tau, na, nsp, tranp, amprp, hinv, ifor ) + + USE cell_base, ONLY: r_to_s + USE io_global, ONLY: stdout + USE random_numbers, ONLY: randy + + IMPLICIT NONE + REAL(DP) :: hinv(3,3) + REAL(DP) :: tau(:,:) + INTEGER, INTENT(IN) :: ifor(:,:), na(:), nsp + LOGICAL, INTENT(IN) :: tranp(:) + REAL(DP), INTENT(IN) :: amprp(:) + REAL(DP) :: oldp(3), rand_disp(3), rdisp(3) + INTEGER :: k, is, isa, isa_s, isa_e, isat + + WRITE( stdout, 600 ) + + isat = 0 + DO is = 1, nsp + isa_s = isat + 1 + isa_e = isat + na(is) + IF( tranp(is) ) THEN + WRITE( stdout,610) is, na(is) + WRITE( stdout,615) + DO isa = isa_s, isa_e + oldp = tau(:,isa) + rand_disp(1) = randy () + rand_disp(2) = randy () + rand_disp(3) = randy () + rand_disp = amprp(is) * ( rand_disp - 0.5_DP ) + rdisp = rand_disp + CALL r_to_s( rdisp(:), rand_disp(:), hinv ) + DO k = 1, 3 + tau(k,isa) = tau(k,isa) + rand_disp(k) * ifor(k,isa) + END DO + WRITE( stdout,620) (oldp(k),k=1,3), (tau(k,isa),k=1,3) + END DO + END IF + isat = isat + na(is) + END DO + + 600 FORMAT(//,3X,'Randomization of SCALED ionic coordinates') + 610 FORMAT( 3X,'Species ',I3,' atoms = ',I4) + 615 FORMAT( 3X,' Old Positions New Positions') + 620 FORMAT( 3X,3F10.6,2X,3F10.6) + RETURN + END SUBROUTINE randpos + +!------------------------------------------------------------------------------! + + SUBROUTINE ions_kinene( ekinp, vels, na, nsp, h, pmass ) + IMPLICIT NONE + REAL(DP), intent(out) :: ekinp ! ionic kinetic energy + REAL(DP), intent(in) :: vels(:,:) ! scaled ionic velocities + REAL(DP), intent(in) :: pmass(:) ! ionic masses + REAL(DP), intent(in) :: h(:,:) ! simulation cell + integer, intent(in) :: na(:), nsp + integer :: i, j, is, ia, ii, isa + ekinp = 0.0_DP + isa = 0 + do is=1,nsp + do ia=1,na(is) + isa = isa + 1 + do j=1,3 + do i=1,3 + do ii=1,3 + ekinp=ekinp+pmass(is)* h(j,i)*vels(i,isa)* h(j,ii)*vels(ii,isa) + end do + end do + end do + end do + end do + ekinp=0.5_DP*ekinp + return + END SUBROUTINE ions_kinene + +!------------------------------------------------------------------------------! + + subroutine ions_temp( tempp, temps, ekinpr, vels, na, nsp, h, pmass, ndega, nhpdim, atm2nhp, ekin2nhp ) + ! + use constants, only: k_boltzmann_au + ! + implicit none + ! + REAL(DP), intent(out) :: ekinpr, tempp + REAL(DP), intent(out) :: temps(:) + REAL(DP), intent(out) :: ekin2nhp(:) + REAL(DP), intent(in) :: vels(:,:) + REAL(DP), intent(in) :: pmass(:) + REAL(DP), intent(in) :: h(:,:) + integer, intent(in) :: na(:), nsp, ndega, nhpdim, atm2nhp(:) + ! + integer :: nat, i, j, is, ia, ii, isa + REAL(DP) :: cdmvel(3), eks, eks1 + ! + call ions_cofmass( vels, pmass, na, nsp, cdmvel ) + ! + nat = SUM( na(1:nsp) ) + ! + ekinpr = 0.0_DP + temps( 1:nsp ) = 0.0_DP + ekin2nhp(1:nhpdim) = 0.0_DP + ! + do i=1,3 + do j=1,3 + do ii=1,3 + isa = 0 + do is=1,nsp + eks = 0.0_DP + do ia=1,na(is) + isa = isa + 1 + eks1 = pmass(is)*h(j,i)*(vels(i,isa)-cdmvel(i))*h(j,ii)*(vels(ii,isa)-cdmvel(ii)) + eks=eks+eks1 + ekin2nhp(atm2nhp(isa)) = ekin2nhp(atm2nhp(isa)) + eks1 + end do + ekinpr = ekinpr + eks + temps(is) = temps(is) + eks + end do + end do + end do + end do + ! + do is = 1, nhpdim + ekin2nhp(is) = ekin2nhp(is) * 0.5_DP + enddo + ! + ! + do is = 1, nsp + if( na(is) < 1 ) call errore(' ions_temp ', ' 0 number of atoms ', 1 ) + temps( is ) = temps( is ) * 0.5_DP + temps( is ) = temps( is ) / k_boltzmann_au / ( 1.5_DP * na(is) ) + end do + ! + ekinpr = 0.5_DP * ekinpr + ! + IF( ndega < 1 ) THEN + tempp = 0.0_DP + ELSE + tempp = ekinpr / k_boltzmann_au * 2.0_DP / DBLE( ndega ) + END IF + ! + return + end subroutine ions_temp + +!------------------------------------------------------------------------------! + + subroutine ions_thermal_stress( stress, pmass, omega, h, vels, nsp, na ) + USE constants, ONLY : eps8 + REAL(DP), intent(inout) :: stress(3,3) + REAL(DP), intent(in) :: pmass(:), omega, h(3,3), vels(:,:) + integer, intent(in) :: nsp, na(:) + integer :: i, j, is, ia, isa + isa = 0 + if( omega < eps8 ) call errore(' ions_thermal_stress ', ' omega <= 0 ', 1 ) + do is = 1, nsp + do ia = 1, na(is) + isa = isa + 1 + do i = 1, 3 + do j = 1, 3 + stress(i,j) = stress(i,j) + pmass(is) / omega * & + & ( (h(i,1)*vels(1,isa)+h(i,2)*vels(2,isa)+h(i,3)*vels(3,isa)) * & + (h(j,1)*vels(1,isa)+h(j,2)*vels(2,isa)+h(j,3)*vels(3,isa)) ) + enddo + enddo + enddo + enddo + return + end subroutine ions_thermal_stress + +!------------------------------------------------------------------------------! + + subroutine ions_vrescal( tcap, tempw, tempp, taup, tau0, taum, na, nsp, fion, iforce, & + pmass, delt ) + use constants, only: pi, k_boltzmann_au, eps8 + USE random_numbers, ONLY : randy + implicit none + logical, intent(in) :: tcap + REAL(DP), intent(inout) :: taup(:,:) + REAL(DP), intent(in) :: tau0(:,:), taum(:,:), fion(:,:) + REAL(DP), intent(in) :: delt, pmass(:), tempw, tempp + integer, intent(in) :: na(:), nsp + integer, intent(in) :: iforce(:,:) + + REAL(DP) :: alfap, qr(3), alfar, gausp + REAL(DP) :: dt2by2 + integer :: i, ia, is, nat, isa + + dt2by2 = 0.5_DP * delt * delt + gausp = delt * sqrt( tempw * k_boltzmann_au ) + nat = SUM( na( 1:nsp ) ) + + if(.not.tcap) then + if( tempp < eps8 ) call errore(' ions_vrescal ', ' tempp <= 0 ', 1 ) + alfap = 0.5_DP * sqrt(tempw/tempp) + isa = 0 + do is=1,nsp + do ia=1,na(is) + isa = isa + 1 + do i=1,3 + taup(i,isa) = tau0(i,isa) + & + & alfap*(taup(i,isa)-taum(i,isa)) + & + & dt2by2/pmass(is)*fion(i,isa)*iforce(i,isa) + end do + end do + end do + else + do i=1,3 + qr(i)=0.0_DP + isa = 0 + do is=1,nsp + do ia=1,na(is) + isa = isa + 1 + alfar=gausp/sqrt(pmass(is))*cos(2.0_DP*pi*randy())*sqrt(-2.0_DP*log(randy())) + taup(i,isa)=alfar + qr(i)=qr(i)+alfar + end do + end do + qr(i)=qr(i)/nat + end do + isa = 0 + do is=1,nsp + do ia=1,na(is) + isa = isa + 1 + do i=1,3 + alfar=taup(i,isa)-qr(i) + taup(i,isa)=tau0(i,isa)+iforce(i,isa)* & + & (alfar+dt2by2/pmass(is)*fion(i,isa)) + end do + end do + end do + end if + return + end subroutine ions_vrescal + +!------------------------------------------------------------------------------! + + subroutine ions_shiftvar( varp, var0, varm ) + implicit none + REAL(DP), intent(in) :: varp(:,:) + REAL(DP), intent(out) :: varm(:,:), var0(:,:) + varm = var0 + var0 = varp + return + end subroutine ions_shiftvar + +!------------------------------------------------------------------------------! + + SUBROUTINE ions_reference_positions( tau ) + + ! Calculate the real position of atoms relative to the center of mass (cdm) + ! and store them in taui + ! cdmi: initial position of the center of mass (cdm) in cartesian coor. + + IMPLICIT NONE + + REAL(DP) :: tau( :, : ) + + INTEGER :: isa + + CALL ions_cofmass( tau, amass, na, nsp, cdmi ) + DO isa = 1, nat + taui(:,isa) = tau(:,isa) - cdmi(:) + END DO + + RETURN + END SUBROUTINE ions_reference_positions + + +!------------------------------------------------------------------------------! + + + SUBROUTINE ions_displacement( dis, tau ) + + ! Calculate the sum of the quadratic displacements of the atoms in the ref. + ! of cdm respect to the initial positions. + ! taui: initial positions in real units in the ref. of cdm + + ! ---------------------------------------------- + ! att! tau_ref: starting position in center-of-mass ref. in real units + ! ---------------------------------------------- + + IMPLICIT NONE + + REAL (DP), INTENT(OUT) :: dis(:) + REAL (DP), INTENT(IN) :: tau(:,:) + + REAL(DP) :: rdist(3), r2, cdm(3) + INTEGER :: is, ia, isa + + ! ... Compute the current value of cdm "Center of Mass" + ! + CALL ions_cofmass(tau, amass, na, nsp, cdm ) + ! + IF( SIZE( dis ) < nsp ) & + CALL errore(' displacement ',' size of dis too small ', 1) + isa = 0 + DO is = 1, nsp + dis(is) = 0.0_DP + r2 = 0.0_DP + DO ia = 1, na(is) + isa = isa + 1 + rdist = tau(:,isa) - cdm + r2 = r2 + SUM( ( rdist(:) - taui(:,isa) )**2 ) + END DO + dis(is) = dis(is) + r2 / DBLE(na(is)) + END DO + + RETURN + END SUBROUTINE ions_displacement + + !-------------------------------------------------------------------------- + SUBROUTINE ions_cofmsub( tausp, iforce, nat, cdm, cdm0 ) + !-------------------------------------------------------------------------- + ! + IMPLICIT NONE + ! + REAL(DP), INTENT(INOUT) :: tausp(:,:) + INTEGER, INTENT(IN) :: iforce(:,:) + INTEGER, INTENT(IN) :: nat + REAL(DP), INTENT(IN) :: cdm(:), cdm0(:) + ! + INTEGER :: i, ia + ! + DO ia = 1, nat + ! + DO i = 1, 3 + ! + tausp(i,ia) = tausp(i,ia) + DBLE( iforce(i,ia) ) * ( cdm0(i) - cdm(i) ) + ! + END DO + ! + END DO + ! + RETURN + ! + END SUBROUTINE ions_cofmsub + + + REAL(DP) & + FUNCTION compute_eextfor( tau0 ) + IMPLICIT NONE + REAL(DP), OPTIONAL, INTENT(IN) :: tau0(:,:) + INTEGER :: i + REAL(DP) :: e + compute_eextfor = 0.0d0 + e = 0.0d0 + IF( PRESENT( tau0 ) ) THEN + DO i = 1, SIZE( extfor,2 ) + e = e + extfor( 3, i ) * tau0( 3, i ) & + + extfor( 2, i ) * tau0( 2, i ) & + + extfor( 1, i ) * tau0( 1, i ) + END DO + ELSE + DO i = 1, SIZE( extfor,2 ) + e = e + extfor( 3, i ) * tau( 3, i ) & + + extfor( 2, i ) * tau( 2, i ) & + + extfor( 1, i ) * tau( 1, i ) + END DO + END IF + compute_eextfor = - e + RETURN + END FUNCTION compute_eextfor + + + +!------------------------------------------------------------------------------! + END MODULE ions_base +!------------------------------------------------------------------------------! diff --git a/tests/apps/miniDFT/tests/src/irrek.f90 b/tests/apps/miniDFT/tests/src/irrek.f90 new file mode 100644 index 0000000000..b9a578f359 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/irrek.f90 @@ -0,0 +1,349 @@ +! +! Copyright (C) 2001-2011 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +!----------------------------------------------------------------------- +subroutine irreducible_BZ (nrot, s, nsym, minus_q, magnetic_sym, at, bg, & + npk, nks, xk, wk, t_rev) + !----------------------------------------------------------------------- + ! + ! This routine finds the special points in the irreducible wedge of + ! the true point group (or small group of q) of the crystal, + ! starting from the points in the irreducible BZ wedge + ! of the point group of the Bravais lattice. + ! + USE kinds, only : DP + implicit none + ! + integer, intent(in) :: nrot, nsym, npk, s(3,3,48), t_rev(48) + real(DP), intent(in) :: at (3,3), bg (3,3) + logical, intent(in) :: minus_q, magnetic_sym + integer, intent(inout) :: nks + real(DP), intent(inout) :: xk (3, npk), wk (npk) + ! + integer :: table (48, 48), invs (3, 3, 48), irg (48) + ! table: multiplication table of the group + ! invs : contains the inverse of each rotation + ! irg : gives the correspondence of symmetry operations forming a n-th coset + integer :: isym, jsym + logical :: sym(48) + ! + ! We compute the multiplication table of the group + ! + call multable (nrot, s, table) + ! + ! And we set the matrices of the inverse + ! + DO isym = 1, nrot + DO jsym = 1, nrot + IF (table (isym, jsym)==1) invs (:,:,isym) = s(:,:,jsym) + ENDDO + ENDDO + ! + ! Find the coset in the point group of the Bravais lattice + ! + IF ( magnetic_sym ) THEN + call irrek_nc(at, bg, nrot, invs, nsym, irg, npk, nks, xk, & + wk, t_rev) + ELSE + sym(1:nsym) = .true. + sym(nsym+1:)= .false. + call coset (nrot, table, sym, nsym, irg) + ! + ! here we set the k-points in the irreducible wedge of the point grou + ! of the crystal + ! + call irrek (at, bg, nrot, invs, nsym, irg, minus_q, npk, nks, xk, & + wk, t_rev) + ENDIF + ! + return + ! +end subroutine irreducible_BZ +! +!----------------------------------------------------------------------- +subroutine irrek (at, bg, nrot, invs, nsym, irg, minus_q, npk, & + nks, xk, wk, t_rev) + !----------------------------------------------------------------------- + ! + ! Given a set of special points in the Irreducible Wedge of some + ! group, finds the equivalent special points in the IW of one of + ! its subgroups. + ! + USE kinds, only : DP + implicit none + ! + integer, intent(in) :: npk, nrot, nsym, invs (3, 3, 48), irg (nrot) + ! maximum number of special points + ! order of the parent point group + ! order of the subgroup + ! inverse of the elements of the symmetry group + ! partition of the elements of the symmetry group into left cosets, + ! as given by SUBROUTINE COSET + integer, intent(inout) :: nks + ! number of special points + integer, intent(in) :: t_rev(48) + real(DP), intent(in) :: at (3, 3), bg (3, 3) + ! basis vectors of the Bravais and reciprocal lattice + real(DP), intent(inout) :: xk (3, npk), wk (npk) + ! special points and weights + logical, intent(in) :: minus_q + ! .true. if symmetries q = -q+G are acceptable + ! + ! here the local variables + ! + integer :: nks0, jk, kpol, irot, jrot, ncos, jc, ic, isym + ! nks0: used to save the initial number of k-points + ! ncos: total number of cosets + real(DP) :: xkg (3), xks (3, 48), w (48), sw, one + ! coordinates of the k point in crystal axis + ! coordinates of the rotated k point + ! weight of each coset + ! buffer which contains the weight of k points + ! total weight of k-points + logical :: latm, satm + ! true if a k-point is equivalent to a previous one + ! true if equivalent point found + + nks0 = nks + do jk = 1, nks0 + ! + ! The k point is first computed in crystal axis + ! + do kpol = 1, 3 + ! xkg are the components ofx k in the crystal RL base + xkg (kpol) = at (1, kpol) * xk (1, jk) + & + at (2, kpol) * xk (2, jk) + & + at (3, kpol) * xk (3, jk) + enddo + ! + ! Then it is rotated with each symmetry of the global group. Note that + ! the irg vector is used to divide all the rotated vector in cosets + ! + do irot = 1, nrot + jrot = irg (irot) + do kpol = 1, 3 + ! the rotated of xkg with respect to the group operations + xks (kpol, irot) = invs (kpol, 1, jrot) * xkg (1) + & + invs (kpol, 2, jrot) * xkg (2) + & + invs (kpol, 3, jrot) * xkg (3) + enddo + IF (t_rev(jrot)==1) xks (:, irot)=-xks(:, irot) + enddo + ! + ! For each coset one point is tested with all the preceding + ! + ncos = nrot / nsym + do ic = 1, ncos + irot = (ic - 1) * nsym + 1 + latm = .false. + ! + ! latm = .true. if the present k-vector is equivalent to some previous + ! + do jc = 1, ic - 1 + do isym = 1, nsym + ! + ! satm = .true. if the present symmetry operation makes + ! the ir and ik k-vectors equivalent ... + ! + jrot = (jc - 1) * nsym + isym + satm = abs (xks (1, irot) - xks (1, jrot) - & + nint (xks (1, irot) - xks (1, jrot) ) ) < 1.0d-5 .and. & + abs (xks (2, irot) - xks (2, jrot) - & + nint (xks (2, irot) - xks (2, jrot) ) ) < 1.0d-5 .and. & + abs (xks (3, irot) - xks (3, jrot) - & + nint (xks (3, irot) - xks (3, jrot) ) ) < 1.0d-5 + ! + ! .... or equivalent to minus each other when minus_q=.t. + ! + if (minus_q) satm = satm .or. & + abs (xks (1, irot) + xks (1, jrot) - & + nint (xks (1, irot) + xks (1, jrot) ) ) < 1.0d-5 .and. & + abs (xks (2, irot) + xks (2, jrot) - & + nint (xks (2, irot) + xks (2, jrot) ) ) < 1.0d-5 .and. & + abs (xks (3, irot) + xks (3, jrot) - & + nint (xks (3, irot) + xks (3, jrot) ) ) < 1.0d-5 + latm = latm .or. satm + if (satm .and. w (jc) /= 0.d0) then + w (jc) = w (jc) + 1.d0 + goto 100 + endif + enddo + + enddo +100 continue + if (latm) then + w (ic) = 0.d0 + else + w (ic) = 1.d0 + endif + enddo + ! + ! here the k-point list is updated + ! + sw = wk (jk) / SUM (w(1:ncos)) + wk (jk) = sw * w (1) + do ic = 2, ncos + irot = (ic - 1) * nsym + 1 + if (w (ic) /= 0.d0) then + nks = nks + 1 + if (nks > npk) call errore ('irrek', 'too many k-points', nks) + wk (nks) = sw * w (ic) + do kpol = 1, 3 + xk (kpol, nks) = bg (kpol, 1) * xks (1, irot) + & + bg (kpol, 2) * xks (2, irot) + & + bg (kpol, 3) * xks (3, irot) + enddo + endif + enddo + + enddo + ! + ! normalize weights to one + ! + one = SUM (wk(1:nks)) + if ( one > 0.d0 ) wk(1:nks) = wk(1:nks) / one + ! + return +end subroutine irrek +!----------------------------------------------------------------------- +subroutine irrek_nc (at, bg, nrot, invs, nsym, irg, npk, & + nks, xk, wk, t_rev) + !----------------------------------------------------------------------- + ! + ! Given a set of special points in the Irreducible Wedge of some + ! group, finds the equivalent special points in the IW of one of + ! its subgroups. + ! + USE kinds, only : DP + implicit none + ! + integer, intent(in) :: npk, nrot, nsym, invs (3, 3, 48), irg (nrot) + ! maximum number of special points + ! order of the parent point group + ! order of the subgroup + ! inverse of the elements of the symmetry group + ! partition of the elements of the symmetry group into left cosets, + ! as given by SUBROUTINE COSET + integer, intent(inout) :: nks + ! number of special points + integer, intent(in) :: t_rev(48) + real(DP), intent(in) :: at (3, 3), bg (3, 3) + ! basis vectors of the Bravais and reciprocal lattice + real(DP), intent(inout) :: xk (3, npk), wk (npk) + ! special points and weights + ! + ! here the local variables + ! + integer :: nks0, jk, kpol, irot, jrot, isym, ik, iks, start_k + ! nks0: used to save the initial number of k-points + ! ncos: total number of cosets + real(DP) :: xkg (3), xks (3), xkn(3), one, xk_new(3,npk), wk_new(npk), & + xk_cart(3) + ! coordinates of the k point in crystal axis + ! coordinates of the rotated k point + ! weight of each coset + ! buffer which contains the weight of k points + ! total weight of k-points + logical :: satm + ! true if equivalent point found + + nks0 = nks + nks=0 + start_k=0 + DO jk = 1, nks0 + ! + ! The k point is first computed in crystal axis + ! + ! xkg are the components of xk in the crystal base + xkg (:) = at (1, :) * xk (1, jk) + & + at (2, :) * xk (2, jk) + & + at (3, :) * xk (3, jk) + ! + ! Then it is rotated with each symmetry of the global group. + ! + DO irot = 1, nrot + xks (:) = invs (:, 1, irot) * xkg (1) + & + invs (:, 2, irot) * xkg (2) + & + invs (:, 3, irot) * xkg (3) + ! + ! Now check if there is an operation of the subgroup that + ! makes xks equivalent to some other already found k point + ! + DO jrot=1,nsym + xkn (:) = invs (:, 1, jrot) * xks (1) + & + invs (:, 2, jrot) * xks (2) + & + invs (:, 3, jrot) * xks (3) + IF (t_rev(jrot)==1) xkn =-xkn + DO ik = start_k+1, nks + satm = abs (xk_new (1, ik) - xkn (1) - & + nint (xk_new (1, ik) - xkn (1) ) ) < 1.0d-5 .and. & + abs (xk_new (2, ik) - xkn (2) - & + nint (xk_new (2, ik) - xkn (2) ) ) < 1.0d-5 .and. & + abs (xk_new (3, ik) - xkn (3) - & + nint (xk_new (3, ik) - xkn (3) ) ) < 1.0d-5 + IF ( satm ) THEN + wk_new(ik) = wk_new(ik) + wk(jk) + GOTO 100 + ENDIF + END DO + END DO + nks=nks+1 + IF (nks > npk) CALL errore('irrek_nc','too many k points',1) + xk_new(:,nks)=xks + wk_new(nks)=wk(jk) +100 CONTINUE + ENDDO + start_k=nks + ENDDO + ! + ! The order of the original k points is preserved + ! + iks=nks0 + DO ik = 1, nks + ! + ! for each new k point found, check if it was in the original list + ! + DO jk=1, nks0 + xkg (:) = at (1, :) * xk (1, jk) + & + at (2, :) * xk (2, jk) + & + at (3, :) * xk (3, jk) + satm = abs (xk_new (1, ik) - xkg (1) - & + nint (xk_new (1, ik) - xkg (1) ) ) < 1.0d-5 .and. & + abs (xk_new (2, ik) - xkg (2) - & + nint (xk_new (2, ik) - xkg (2) ) ) < 1.0d-5 .and. & + abs (xk_new (3, ik) - xkg (3) - & + nint (xk_new (3, ik) - xkg (3) ) ) < 1.0d-5 + IF (satm) THEN +! +! If it was, just update the weight +! + wk(jk)=wk_new(ik) + goto 200 + ENDIF + ENDDO +! +! If it was not, bring xk_new in cartesian coodinates and copy it in the +! first free place available +! + iks=iks+1 + xk_cart (:) = bg (:, 1) * xk_new (1, ik) + & + bg (:, 2) * xk_new (2, ik) + & + bg (:, 3) * xk_new (3, ik) + xk(:,iks)=xk_cart(:) + wk(iks)=wk_new(ik) +200 CONTINUE + ENDDO + IF (iks /= nks ) CALL errore('irrek_nc','Internal problem with k points',1) + ! + ! normalize weights to one + ! + one = SUM (wk(1:nks)) + IF ( one > 0.d0 ) wk(1:nks) = wk(1:nks) / one + ! + RETURN +END SUBROUTINE irrek_nc diff --git a/tests/apps/miniDFT/tests/src/iweights.f90 b/tests/apps/miniDFT/tests/src/iweights.f90 new file mode 100644 index 0000000000..c991408609 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/iweights.f90 @@ -0,0 +1,48 @@ +! +! Copyright (C) 2001 PWSCF group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +!-------------------------------------------------------------------- +subroutine iweights (nks, wk, nbnd, nelec, et, Ef, wg, is, isk) + !-------------------------------------------------------------------- + ! calculates weights for semiconductors and insulators + ! (bands are either empty or filled) + ! On output, Ef is the highest occupied Kohn-Sham level + USE kinds + USE mp, ONLY : mp_max + USE mp_global, ONLY : inter_pool_comm + implicit none + ! + integer, intent(in) :: nks, nbnd, is, isk(nks) + real(DP), intent(in) :: wk (nks), et(nbnd, nks), nelec + real(DP), intent(out) :: wg (nbnd, nks), Ef + real(DP) :: degspin + integer :: kpoint, ibnd + + degspin=2.d0 + if (is /= 0) degspin = 1.d0 + Ef = - 1.0d+20 + do kpoint = 1, nks + if (is /= 0) then + if (isk(kpoint) .ne. is ) cycle + end if + do ibnd = 1, nbnd + if (ibnd <= nint (nelec) / degspin) then + wg (ibnd, kpoint) = wk (kpoint) + Ef = MAX (Ef, et (ibnd, kpoint) ) + else + wg (ibnd, kpoint) = 0.d0 + endif + enddo + enddo + ! + ! find max across pools + ! + CALL mp_max( ef, inter_pool_comm ) + + return +end subroutine iweights diff --git a/tests/apps/miniDFT/tests/src/kind.f90 b/tests/apps/miniDFT/tests/src/kind.f90 new file mode 100644 index 0000000000..229c7d03f0 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/kind.f90 @@ -0,0 +1,64 @@ +! +! Copyright (C) 2002-2004 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +!------------------------------------------------------------------------------! + MODULE kinds +!------------------------------------------------------------------------------! + + IMPLICIT NONE + SAVE +! ... kind definitions + INTEGER, PARAMETER :: DP = selected_real_kind(14,200) + INTEGER, PARAMETER :: sgl = selected_real_kind(6,30) + INTEGER, PARAMETER :: i4b = selected_int_kind(9) + PRIVATE + PUBLIC :: i4b, sgl, DP, print_kind_info +! +!------------------------------------------------------------------------------! +! + CONTAINS +! +!------------------------------------------------------------------------------! +! +!! Print information about the used data types. +! + SUBROUTINE print_kind_info (stdout) +! +!------------------------------------------------------------------------------! +! + IMPLICIT NONE + INTEGER, INTENT(IN) :: stdout +! + WRITE( stdout,'(/,T2,A)') 'DATA TYPE INFORMATION:' +! + WRITE( stdout,'(/,T2,A,T78,A,2(/,T2,A,T75,I6),3(/,T2,A,T67,E14.8))') & + 'REAL: Data type name:', 'DP', ' Kind value:', kind(0.0_DP), & + ' Precision:', precision(0.0_DP), & + ' Smallest nonnegligible quantity relative to 1:', & + epsilon(0.0_DP), ' Smallest positive number:', tiny(0.0_DP), & + ' Largest representable number:', huge(0.0_DP) + WRITE( stdout,'(/,T2,A,T78,A,2(/,T2,A,T75,I6),3(/,T2,A,T67,E14.8))') & + ' Data type name:', 'sgl', ' Kind value:', kind(0.0_sgl), & + ' Precision:', precision(0.0_sgl), & + ' Smallest nonnegligible quantity relative to 1:', & + epsilon(0.0_sgl), ' Smallest positive number:', tiny(0.0_sgl), & + ' Largest representable number:', huge(0.0_sgl) + WRITE( stdout,'(/,T2,A,T72,A,4(/,T2,A,T61,I20))') & + 'INTEGER: Data type name:', '(default)', ' Kind value:', & + kind(0), ' Bit size:', bit_size(0), & + ' Largest representable number:', huge(0) + WRITE( stdout,'(/,T2,A,T72,A,/,T2,A,T75,I6,/)') 'LOGICAL: Data type name:', & + '(default)', ' Kind value:', kind(.TRUE.) + WRITE( stdout,'(/,T2,A,T72,A,/,T2,A,T75,I6,/)') & + 'CHARACTER: Data type name:', '(default)', ' Kind value:', & + kind('C') +! + END SUBROUTINE print_kind_info +! +!------------------------------------------------------------------------------! + END MODULE kinds +!------------------------------------------------------------------------------! diff --git a/tests/apps/miniDFT/tests/src/konst.h b/tests/apps/miniDFT/tests/src/konst.h new file mode 100644 index 0000000000..2156998917 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/konst.h @@ -0,0 +1,1325 @@ +/* + Copyright (C) 2002 FPMD group + This file is distributed under the terms of the + GNU General Public License. See the file `License' + in the root directory of the present distribution, + or http://www.gnu.org/copyleft/gpl.txt . +*/ + +/* + * Copyright (c) 1997 Massachusetts Institute of Technology + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to use, copy, modify, and distribute the Software without + * restriction, provided the Software, including any modified copies made + * under this license, is not distributed for a fee, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE MASSACHUSETTS INSTITUTE OF TECHNOLOGY BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name of the Massachusetts + * Institute of Technology shall not be used in advertising or otherwise + * to promote the sale, use or other dealings in this Software without + * prior written authorization from the Massachusetts Institute of + * Technology. + * + */ + +/* $Id: konst.h,v 1.1.1.1 2003-01-19 21:58:43 giannozz Exp $ */ + +/* + * this file contains many floating-point constants in with 40 digits + * of precision. + * + * The constants are sin(pi/2 * i / j) for all relatively prime i and + * j, i < j, 1 <= i,j <= 64. + * + * These constants should be enough to compute any FFT of radix up to + * 64. + * + * The name of the constant is FFTW_K + the first nine digits + * of the constant. + */ + +/* First, a few hand-added constants for the hard-coded + small-prime routines from Nussbaumer: */ + +#define FFTW_K1_499999999 1.5 +#define FFTW_K1_500000000 1.5 +#define FFTW_K1_538841768 1.538841768587626701285145288018454912004 +#define FFTW_K363271264 0.3632712640026804429477333787403093748078 +#define FFTW_K559016994 0.5590169943749474241022934171828190588601 +#define FFTW_K1_250000000 1.25 + +/* Now, the sin(pi/2 * i / j) constants: */ + +#define FFTW_K024541228 0.02454122852291228803173452945928292506546 +#define FFTW_K024930691 0.02493069173807287528153113172264899347886 +#define FFTW_K025332714 0.02533271431318792626715014547444662011749 +#define FFTW_K025747913 0.02574791365498855709400812038783297868791 +#define FFTW_K026176948 0.02617694830787315261061168555411266379339 +#define FFTW_K026620521 0.02662052143777476692526640921682759077404 +#define FFTW_K027079384 0.02707938467613449510053273360969360284220 +#define FFTW_K027554342 0.02755434236816199651390270841655868519675 +#define FFTW_K028046256 0.02804625627586895837690032595826009306718 +#define FFTW_K028556050 0.02855605079369625384817304701047898542810 +#define FFTW_K029084718 0.02908471874311140688857775001359604786349 +#define FFTW_K029633327 0.02963332782255974048476287916054822494737 +#define FFTW_K030203027 0.03020302780088884696469629411308802751337 +#define FFTW_K030795058 0.03079505855617035387456489497623829357293 +#define FFTW_K031410759 0.03141075907812829383918367381782938975792 +#define FFTW_K032051577 0.03205157757165517423355052534564389799926 +#define FFTW_K032719082 0.03271908282177614206365992631728812611496 +#define FFTW_K033414977 0.03341497700767457087526435763745330726371 +#define FFTW_K034141110 0.03414111018596789528264900547320423176481 +#define FFTW_K034899496 0.03489949670250097164599518162533293735482 +#define FFTW_K035692333 0.03569233383898045576004959432178492172990 +#define FFTW_K036522023 0.03652202305765883496849494009839034350519 +#define FFTW_K037391194 0.03739119427632562109582828094423927302680 +#define FFTW_K038302733 0.03830273369003534880305423883905735073019 +#define FFTW_K039259815 0.03925981575906860902080336379833358968018 +#define FFTW_K040265940 0.04026594010941514336195447585729928046597 +#define FFTW_K041324974 0.04132497424881321193833038091793631399735 +#define FFTW_K042441203 0.04244120319614830587806918753450720196596 +#define FFTW_K043619387 0.04361938736533599978175307720994442711267 +#define FFTW_K044864830 0.04486483035051492545809033680196091713385 +#define FFTW_K046183458 0.04618345864573959194897001797523264272366 +#define FFTW_K047581915 0.04758191582374229744978724403148683485453 +#define FFTW_K049067674 0.04906767432741801425495497694268265831474 +#define FFTW_K049845885 0.04984588566069716295040714449394960588257 +#define FFTW_K050649168 0.05064916883871271227875185748519952674658 +#define FFTW_K051478754 0.05147875477034653381895970590186645379975 +#define FFTW_K052335956 0.05233595624294383272211862960907841873101 +#define FFTW_K053222174 0.05322217484217865465892175510110189963137 +#define FFTW_K054138908 0.05413890858541752614990832597459869261258 +#define FFTW_K055087760 0.05508776035586544311472166247114340920868 +#define FFTW_K056070447 0.05607044723719178819071956605945621966287 +#define FFTW_K057088810 0.05708881086276798374853641012211283431406 +#define FFTW_K058144828 0.05814482891047582853874801684707152363411 +#define FFTW_K059240627 0.05924062789371428721946459254200354944517 +#define FFTW_K060378497 0.06037849742228605343802003158079274972614 +#define FFTW_K061560906 0.06156090613394283745053467245960896573106 +#define FFTW_K062790519 0.06279051952931337607617822456563113312248 +#define FFTW_K064070219 0.06407021998071292342141653382538247166027 +#define FFTW_K065403129 0.06540312923014306681531555877517544144063 +#define FFTW_K066792633 0.06679263374512155398142808167595869283750 +#define FFTW_K068242413 0.06824241336467097592118847902245902393309 +#define FFTW_K069756473 0.06975647374412530077595883519414332860090 +#define FFTW_K071339183 0.07133918319923234032733775265783793276596 +#define FFTW_K072995314 0.07299531466090752529007863065550023575340 +#define FFTW_K073564563 0.07356456359966742352946562157523432181330 +#define FFTW_K074730093 0.07473009358642425429093974573476665337355 +#define FFTW_K075933114 0.07593311422524628957116630520938078420417 +#define FFTW_K076549252 0.07654925283649564686667574398250835581272 +#define FFTW_K077175462 0.07717546212664635123484042864263765610620 +#define FFTW_K078459095 0.07845909572784494503296024599345969868195 +#define FFTW_K079786105 0.07978610555308308193969075555986694480713 +#define FFTW_K080466568 0.08046656871672588043623283523605058814445 +#define FFTW_K081158725 0.08115872552743127025162162134332521448309 +#define FFTW_K082579345 0.08257934547233232460034393423744022769858 +#define FFTW_K084050524 0.08405052492924754505111842927022800243161 +#define FFTW_K084805924 0.08480592447550919108850144833189828879530 +#define FFTW_K085575008 0.08557500847883974285443620323245675643992 +#define FFTW_K087155742 0.08715574274765817355806427083747355137770 +#define FFTW_K088795895 0.08879589532293479712937356569797262395585 +#define FFTW_K089639308 0.08963930890343349976547043684523300801112 +#define FFTW_K090498875 0.09049887582963782754801984544037132033177 +#define FFTW_K092268359 0.09226835946330199523965110715450648036301 +#define FFTW_K094108313 0.09410831331851431847326684888547588974551 +#define FFTW_K095056043 0.09505604330418266363210430415931109734405 +#define FFTW_K096023025 0.09602302590768176305366495784331455593243 +#define FFTW_K098017140 0.09801714032956060199419556388864184586113 +#define FFTW_K099567846 0.09956784659581665718622086379104323229043 +#define FFTW_K100095691 0.1000956916240983451177672842105318430707 +#define FFTW_K101168321 0.1011683219874321777860407155854228233862 +#define FFTW_K102264148 0.1022641489420342371412709255326958104552 +#define FFTW_K102820997 0.1028209971373604031806320868342052679487 +#define FFTW_K104528463 0.1045284632676534713998341548024981190806 +#define FFTW_K106293485 0.1062934856473654067394496659573273763461 +#define FFTW_K106895121 0.1068951215651127844145864534883570813393 +#define FFTW_K108119018 0.1081190184239417630308083269836870058627 +#define FFTW_K109371208 0.1093712083778743869853209878362391474250 +#define FFTW_K110008220 0.1100082209940792950410059556544367917515 +#define FFTW_K111964476 0.1119644761033078584687059352720242032581 +#define FFTW_K113991409 0.1139914098905406252992389774304161634389 +#define FFTW_K114683425 0.1146834253984004343275380130470373859191 +#define FFTW_K116092914 0.1160929141252302296756665233807114688534 +#define FFTW_K117537397 0.1175373974578376441055682668404856236723 +#define FFTW_K118273170 0.1182731709213658039500508663092468403330 +#define FFTW_K120536680 0.1205366802553230533490676874525435822736 +#define FFTW_K122410675 0.1224106751992161984987044741509457875752 +#define FFTW_K122888290 0.1228882906647141222666013492105836037724 +#define FFTW_K123692631 0.1236926312693476160249117865542554850472 +#define FFTW_K124343704 0.1243437046474851743089045920543714991045 +#define FFTW_K125333233 0.1253332335643042453731187598165087939429 +#define FFTW_K126338594 0.1263385949221291894904811173099765440334 +#define FFTW_K127017819 0.1270178197468787473745739656594515054988 +#define FFTW_K127877161 0.1278771616845060105905627222310365268112 +#define FFTW_K128398355 0.1283983551465509444517094699699360502290 +#define FFTW_K130526192 0.1305261922200515915484062278954890101937 +#define FFTW_K132725527 0.1327255272837219725719487965069416073282 +#define FFTW_K133286955 0.1332869553737788428006966907749246477199 +#define FFTW_K134233265 0.1342332658176554760370186415106700491221 +#define FFTW_K135000013 0.1350000138532901039432785388369663768285 +#define FFTW_K136166649 0.1361666490962465907607258333878729914503 +#define FFTW_K137353557 0.1373535578184081750962293169450719150194 +#define FFTW_K138156354 0.1381563549518821982285452297396081025637 +#define FFTW_K139173100 0.1391731009600654441124966633011052754559 +#define FFTW_K139790339 0.1397903395354994779261757065854075728448 +#define FFTW_K142314838 0.1423148382732851404437926686163696687910 +#define FFTW_K144931859 0.1449318593072467375406813031778968151579 +#define FFTW_K145601167 0.1456011677350048723993394166411729066078 +#define FFTW_K146730474 0.1467304744553617516588501296467178197062 +#define FFTW_K147646564 0.1476465640024812314941125712317733092252 +#define FFTW_K149042266 0.1490422661761744469293547152772175569096 +#define FFTW_K150464503 0.1504645032747830094280823110511156957377 +#define FFTW_K151427777 0.1514277775045766636574676467272196523057 +#define FFTW_K152649284 0.1526492842188744985382798067894893515166 +#define FFTW_K153391654 0.1533916548786853726487552712140729945838 +#define FFTW_K153890576 0.1538905767040617933823856197344647265033 +#define FFTW_K156434465 0.1564344650402308690101053194671668923139 +#define FFTW_K159063496 0.1590634960190720532010083008860924909668 +#define FFTW_K159599895 0.1595998950333792234665111684813029413298 +#define FFTW_K160411280 0.1604112808577602403702298186769163785229 +#define FFTW_K161781996 0.1617819965527647265442600643364213138441 +#define FFTW_K162895473 0.1628954733945887394808006397082655595151 +#define FFTW_K164594590 0.1645945902807338941436520590879384195121 +#define FFTW_K166329354 0.1663293545831300328593301814704603689804 +#define FFTW_K167506223 0.1675062233047364080900562064755421518657 +#define FFTW_K169000820 0.1690008203218490740930355553844306062607 +#define FFTW_K169910385 0.1699103850286666621064277790456711366916 +#define FFTW_K170522192 0.1705221926326237844029624838779488814032 +#define FFTW_K170961888 0.1709618887603012263636423572082635319663 +#define FFTW_K173648177 0.1736481776669303488517166267693147960003 +#define FFTW_K176419766 0.1764197662578084553148843684896065607169 +#define FFTW_K176890275 0.1768902751225729626566607665047223570045 +#define FFTW_K177553196 0.1775531962543032681443899399620956620757 +#define FFTW_K178556894 0.1785568947986366480137183675903137598662 +#define FFTW_K179280758 0.1792807588107356641700983494684076980694 +#define FFTW_K180255037 0.1802550378139057401698714976814164183253 +#define FFTW_K181636850 0.1816368509794364397019702088022006165809 +#define FFTW_K182235525 0.1822355254921474566025733714374098829561 +#define FFTW_K183749517 0.1837495178165703315744088396207275824891 +#define FFTW_K185288724 0.1852887240871143248809536106633607262036 +#define FFTW_K185911607 0.1859116071629145811067063130899319181384 +#define FFTW_K187381314 0.1873813145857246305425507344472914693386 +#define FFTW_K188445323 0.1884453238783182943037067928415765684352 +#define FFTW_K189251244 0.1892512443604102036174993987003794963886 +#define FFTW_K190391109 0.1903911091646683687060801363670975059804 +#define FFTW_K191158628 0.1911586287013723021585445882022354575073 +#define FFTW_K191710631 0.1917106319237384206124231501600573332271 +#define FFTW_K195090322 0.1950903220161282678482848684770222409276 +#define FFTW_K198146143 0.1981461431993975833714472747416084106726 +#define FFTW_K198590466 0.1985904666457454649825982338832459220562 +#define FFTW_K199185985 0.1991859851038360988453201397948964743053 +#define FFTW_K200025693 0.2000256937760444275302791839461314924582 +#define FFTW_K201298520 0.2012985200886600791415289683390134818534 +#define FFTW_K202217572 0.2022175723320379311800611091313733641995 +#define FFTW_K203456013 0.2034560130526337898780287220615784267778 +#define FFTW_K204552066 0.2045520661262008192326881916211885127837 +#define FFTW_K205215342 0.2052153421956342913242144590999144259414 +#define FFTW_K205978618 0.2059786187410983794560099523629392761584 +#define FFTW_K207911690 0.2079116908177593371017422844051251662165 +#define FFTW_K209881102 0.2098811020648475664288490675128024697633 +#define FFTW_K210679269 0.2106792699957263203605157515044546621513 +#define FFTW_K211382623 0.2113826236296243207085529083770849382000 +#define FFTW_K212565289 0.2125652895529766738829101740168861225007 +#define FFTW_K213933083 0.2139330832064974399064939935426070792397 +#define FFTW_K214970440 0.2149704402110240671819534770820757537978 +#define FFTW_K216439613 0.2164396139381028797595536696179407286733 +#define FFTW_K217430175 0.2174301755815569683483334697013744130646 +#define FFTW_K218143241 0.2181432413965425520241529749432464294629 +#define FFTW_K218681091 0.2186810912063758065815451063216740840845 +#define FFTW_K219101240 0.2191012401568697972277375474973577988483 +#define FFTW_K222520933 0.2225209339563144042889025644967947594663 +#define FFTW_K226048070 0.2260480705837348469528011887515101798955 +#define FFTW_K226496767 0.2264967674257643803937744783433568234439 +#define FFTW_K227076263 0.2270762630343732075856966925770880866157 +#define FFTW_K227853508 0.2278535089031375755972602599574454122751 +#define FFTW_K228950549 0.2289505499501340769087585503449667718434 +#define FFTW_K229687742 0.2296877421317955508629587031855238968422 +#define FFTW_K230615870 0.2306158707424401784501983492929391024576 +#define FFTW_K231820150 0.2318201502675282692634378233857375282786 +#define FFTW_K233445363 0.2334453638559054117677444302028708487857 +#define FFTW_K234886045 0.2348860457809836794344735309665486913327 +#define FFTW_K235758935 0.2357589355094272282505103203014875844263 +#define FFTW_K236764420 0.2367644204664467369934485993258031509443 +#define FFTW_K237326699 0.2373266998711148178062315108453953280872 +#define FFTW_K239315664 0.2393156642875577671487537262602118952031 +#define FFTW_K241337891 0.2413378912997056469191530270185379193926 +#define FFTW_K241921895 0.2419218955996677225604423741003529652950 +#define FFTW_K242980179 0.2429801799032638899482741620774711183209 +#define FFTW_K243913720 0.2439137201083771486571152797107074577474 +#define FFTW_K245485487 0.2454854871407991489222909177963705562718 +#define FFTW_K246757397 0.2467573976902936383701134811922532799265 +#define FFTW_K247306500 0.2473065005542155019896448542641991067685 +#define FFTW_K248689887 0.2486898871648547882422837460064479684175 +#define FFTW_K249776478 0.2497764781672268499591643699129970495240 +#define FFTW_K250652532 0.2506525322587205393148020352659594949328 +#define FFTW_K251978061 0.2519780613851251944452590335089271028724 +#define FFTW_K252933382 0.2529333823916807465585823300480383661425 +#define FFTW_K253654583 0.2536545839095073878469674038123833536072 +#define FFTW_K254218334 0.2542183341934869302181946799708040944181 +#define FFTW_K254671120 0.2546711202412287479786428236449119383343 +#define FFTW_K258819045 0.2588190451025207623488988376240483283490 +#define FFTW_K263102564 0.2631025642275212511495477637383127381948 +#define FFTW_K263587166 0.2635871660690676452850324043464993370036 +#define FFTW_K264195401 0.2641954018712860094526428604782256719351 +#define FFTW_K264981502 0.2649815021966616823313383138368166609255 +#define FFTW_K266036845 0.2660368455666751073822760245929750947101 +#define FFTW_K266712757 0.2667127574748983863252865151164363940421 +#define FFTW_K267528338 0.2675283385292208211946262052833413401837 +#define FFTW_K268531867 0.2685318674743767514444181482437582231209 +#define FFTW_K269796771 0.2697967711570242712453285226025705364752 +#define FFTW_K270840468 0.2708404681430051173825276728313745513853 +#define FFTW_K271440449 0.2714404498650742533437874012956754728913 +#define FFTW_K272103464 0.2721034648453350043477078027786879151380 +#define FFTW_K273662990 0.2736629900720828635390779354368134316248 +#define FFTW_K275096112 0.2750961127544780934575888098987339713079 +#define FFTW_K275637355 0.2756373558169991856499715746113041477124 +#define FFTW_K276835511 0.2768355114248493876262772692158242788007 +#define FFTW_K278217463 0.2782174639164526345546182439651524382026 +#define FFTW_K278991106 0.2789911060392292518532508950584493874953 +#define FFTW_K279485634 0.2794856348516094581371390778942150551101 +#define FFTW_K281732556 0.2817325568414296977114179153466168990357 +#define FFTW_K284015344 0.2840153447039226174443896906991853505161 +#define FFTW_K284527586 0.2845275866310324418705029934626948723724 +#define FFTW_K285336224 0.2853362242491053090667449649265463487414 +#define FFTW_K286803232 0.2868032327110902531032801731671579370202 +#define FFTW_K288099099 0.2880990993652375689266931264899107353051 +#define FFTW_K288691947 0.2886919473396210094452906211327828963305 +#define FFTW_K290284677 0.2902846772544623676361923758173952746914 +#define FFTW_K292056770 0.2920567706369758204437390072356032915605 +#define FFTW_K292822771 0.2928227712765503799533928156354034200205 +#define FFTW_K293522573 0.2935225731039347541446271583891850734356 +#define FFTW_K294755174 0.2947551744109042168307729819601909732057 +#define FFTW_K296275580 0.2962755808856339773191629695178234257829 +#define FFTW_K297503053 0.2975030538552029766545272343836168141915 +#define FFTW_K298514811 0.2985148110016945481161981570821534393776 +#define FFTW_K299363122 0.2993631229733579540081126169766754622404 +#define FFTW_K300705799 0.3007057995042731216225471359310733948570 +#define FFTW_K301720598 0.3017205985951923159681622307862467380143 +#define FFTW_K302514550 0.3025145508810757874902189631473865052465 +#define FFTW_K303152674 0.3031526741130434999087207406797943019405 +#define FFTW_K303676745 0.3036767451096147308106077254328536766584 +#define FFTW_K304114832 0.3041148323275178942148291736201549317983 +#define FFTW_K309016994 0.3090169943749474241022934171828190588601 +#define FFTW_K313681740 0.3136817403988914766564788459941003099933 +#define FFTW_K314076712 0.3140767120219488154165234158283970375988 +#define FFTW_K314544756 0.3145447561516136728017265820394227561963 +#define FFTW_K315108218 0.3151082180236206884739997772913635477845 +#define FFTW_K315799587 0.3157995876150249155281530748686182849130 +#define FFTW_K316667993 0.3166679938014724990938464926070593078727 +#define FFTW_K317791419 0.3177914195819016261653495764591287854944 +#define FFTW_K318486650 0.3184866502516844273818275725699376031734 +#define FFTW_K319301530 0.3193015301359799731972335422795273269786 +#define FFTW_K320269853 0.3202698538628376311280745853886316208567 +#define FFTW_K321439465 0.3214394653031615807010576240789015860584 +#define FFTW_K322880404 0.3228804047714462166317487451277830603309 +#define FFTW_K323437987 0.3234379871492380979025474833971787876719 +#define FFTW_K324699469 0.3246994692046834874075727165465870379355 +#define FFTW_K326202789 0.3262027892208693378961868432839339339875 +#define FFTW_K327067963 0.3270679633174216363417493701584524078072 +#define FFTW_K328024857 0.3280248578395690989840510558626828114495 +#define FFTW_K328542381 0.3285423819108347330233652537686684647414 +#define FFTW_K330279061 0.3302790619551670817748776125965723703131 +#define FFTW_K332354799 0.3323547994796596645618863109731018350510 +#define FFTW_K333139794 0.3331397947420575668009190940208649269071 +#define FFTW_K333806859 0.3338068592337709288283112855367461082971 +#define FFTW_K334879612 0.3348796121709861519581150708478901575074 +#define FFTW_K336049393 0.3360493932154301264002038813057431950992 +#define FFTW_K336889853 0.3368898533922200506892532126191475704777 +#define FFTW_K338016878 0.3380168784085027582801184913755462388755 +#define FFTW_K338737920 0.3387379202452913812222843549667764425455 +#define FFTW_K339238866 0.3392388661180302873463200874425587375464 +#define FFTW_K342020143 0.3420201433256687330440996146822595807630 +#define FFTW_K344846302 0.3448463026279704341701015644183431449540 +#define FFTW_K345365054 0.3453650544213076319521147752559623304845 +#define FFTW_K346117057 0.3461170570774929764682149949282125051507 +#define FFTW_K347305252 0.3473052528448202855418543554810122464619 +#define FFTW_K348201635 0.3482016354343987872360551297332894837702 +#define FFTW_K349464179 0.3494641795990983367054385007091167841299 +#define FFTW_K350637555 0.3506375551927543753252906248597856202531 +#define FFTW_K351374824 0.3513748240813427048873232705101784160143 +#define FFTW_K352250047 0.3522500479212335065317523197587126718279 +#define FFTW_K352752086 0.3527520865490947802113466208444908167556 +#define FFTW_K354604887 0.3546048870425356259696378926000184743163 +#define FFTW_K356621532 0.3566215326623130243556992802935517782847 +#define FFTW_K357230889 0.3572308898011327811970544491665739772808 +#define FFTW_K358367949 0.3583679495453002734841377894134668341915 +#define FFTW_K359407772 0.3594077728375128365978369922382092764921 +#define FFTW_K359895036 0.3598950365349881487751045723267564202023 +#define FFTW_K361241666 0.3612416661871529487447145961837001637245 +#define FFTW_K362807705 0.3628077053506410086067015071723732383626 +#define FFTW_K363507970 0.3635079705638298484830911630066710945698 +#define FFTW_K364160575 0.3641605752528221783209334379434903294574 +#define FFTW_K365341024 0.3653410243663950145447379989297688024329 +#define FFTW_K366854218 0.3668542188130565156995449132831306900092 +#define FFTW_K368124552 0.3681245526846779591569471474929608308988 +#define FFTW_K369206147 0.3692061473126844511998878300716878438711 +#define FFTW_K370138155 0.3701381553399143568639806676151644570979 +#define FFTW_K370949600 0.3709496008697677795187832504613714657766 +#define FFTW_K371662455 0.3716624556603275191518049611285091938479 +#define FFTW_K372856477 0.3728564777803086108306500487961622518678 +#define FFTW_K373817071 0.3738170718407687913912982304163231070236 +#define FFTW_K374606593 0.3746065934159120354149637745011951310001 +#define FFTW_K375267004 0.3752670048793741338875592256739963144508 +#define FFTW_K375827582 0.3758275821142381678666440272552022706104 +#define FFTW_K376309371 0.3763093719478354580854128826607312195378 +#define FFTW_K376727893 0.3767278936351850994385423912048126363986 +#define FFTW_K382683432 0.3826834323650897717284599840303988667613 +#define FFTW_K388434796 0.3884347962746947118923318303095684709959 +#define FFTW_K388824175 0.3888241754733206472331483352233858759953 +#define FFTW_K389270106 0.3892701063173914903895747264449321369261 +#define FFTW_K389785873 0.3897858732926793690828678991204515658461 +#define FFTW_K390389275 0.3903892751634948132202383101205617972359 +#define FFTW_K391104720 0.3911047204901560157361797932002389820702 +#define FFTW_K391966609 0.3919666098600750758836817751475364086730 +#define FFTW_K393025031 0.3930250316539236181879675098179335770069 +#define FFTW_K394355855 0.3943558551133185801016261030214455736355 +#define FFTW_K395158538 0.3951585385301554551973223050248713719112 +#define FFTW_K396079766 0.3960797660391568236960433916097445675084 +#define FFTW_K397147890 0.3971478906347806137543773600194770636112 +#define FFTW_K398401089 0.3984010898462414579978803999696789656499 +#define FFTW_K399892024 0.3998920243197409718830580631715817256097 +#define FFTW_K400453905 0.4004539056512664881900757918031049168799 +#define FFTW_K401695424 0.4016954246529694575168416597426171522567 +#define FFTW_K403123429 0.4031234292879722141928847864308575941774 +#define FFTW_K403921004 0.4039210048718949626390971462228293575194 +#define FFTW_K404783343 0.4047833431223938171559229929865110885458 +#define FFTW_K405241314 0.4052413140049898709084813055050524665119 +#define FFTW_K406736643 0.4067366430758002077539859903414976129231 +#define FFTW_K408444256 0.4084442569359961354585130645868912825289 +#define FFTW_K409068637 0.4090686371713398883621478572702527811569 +#define FFTW_K410412805 0.4104128054527567964242959438829223418615 +#define FFTW_K411287103 0.4112871031306115394563645794677849305108 +#define FFTW_K411901248 0.4119012482439926753830399595163634298154 +#define FFTW_K412707029 0.4127070298043947370477021860733674718905 +#define FFTW_K413212185 0.4132121857683781796177459756612098495079 +#define FFTW_K415415013 0.4154150130018864255292741492296232035240 +#define FFTW_K417508992 0.4175089922850631204988983925715332880857 +#define FFTW_K417960344 0.4179603448867834197609712699154881891189 +#define FFTW_K418659737 0.4186597375374280866755652051218860503788 +#define FFTW_K419889101 0.4198891015602645769737108950291563357023 +#define FFTW_K420934762 0.4209347624283349696253509429280529945866 +#define FFTW_K422618261 0.4226182617406994361869784896477301815631 +#define FFTW_K423914390 0.4239143907098606887419042651814927925410 +#define FFTW_K424456698 0.4244566988758150853990378624175550294483 +#define FFTW_K425779291 0.4257792915650726488625024457442517039799 +#define FFTW_K426776435 0.4267764354964036681347859720543011341509 +#define FFTW_K427555093 0.4275550934302820943209668568887985343045 +#define FFTW_K428692561 0.4286925614030541830734336648482434287056 +#define FFTW_K429483443 0.4294834430300819004044761443765364092055 +#define FFTW_K430065202 0.4300652022765204603469796350767522768615 +#define FFTW_K430511096 0.4305110968082951443761483565082794876402 +#define FFTW_K433883739 0.4338837391175581204757683328483587546100 +#define FFTW_K437307320 0.4373073204588553906127706057564501702361 +#define FFTW_K437767705 0.4377677051653404809109457323247945767254 +#define FFTW_K438371146 0.4383711467890774174527345406582657390627 +#define FFTW_K439196588 0.4391965888473703654544278324316179454814 +#define FFTW_K440394151 0.4403941515576343095161715337137760630174 +#define FFTW_K441221101 0.4412211012432212932561177149092889833885 +#define FFTW_K442288690 0.4422886902190012819952389773242447301569 +#define FFTW_K443719837 0.4437198378669596859957300716487510074805 +#define FFTW_K444311706 0.4443117063539035508920534834793903341199 +#define FFTW_K445738355 0.4457383557765382673964575493794868554276 +#define FFTW_K447093792 0.4470937929851139085878077015499424448310 +#define FFTW_K447617210 0.4476172100627125493354635123469121632099 +#define FFTW_K448799180 0.4487991802004621727850403347331436164243 +#define FFTW_K449611329 0.4496113296546066000462945794242270758831 +#define FFTW_K450203744 0.4502037448176732924559998305063153741703 +#define FFTW_K451010119 0.4510101192161018402829405689831741061912 +#define FFTW_K451533358 0.4515333583108893507637632100198611342712 +#define FFTW_K453990499 0.4539904997395467915604083663578711989830 +#define FFTW_K456210657 0.4562106573531629639774980773788514351385 +#define FFTW_K456629237 0.4566292373937130644452233125091948196962 +#define FFTW_K457242323 0.4572423233046385228159706386386358177793 +#define FFTW_K458226521 0.4582265217274103945550366255897399668032 +#define FFTW_K458981864 0.4589818644675376813624520888264711922214 +#define FFTW_K460065037 0.4600650377311521260415757598109517955579 +#define FFTW_K461092501 0.4610925014493258460911917550660284882441 +#define FFTW_K461748613 0.4617486132350339305629306731356229872678 +#define FFTW_K462538290 0.4625382902408352776971056464298681702475 +#define FFTW_K462996644 0.4629966441051207667179520124020620021145 +#define FFTW_K464723172 0.4647231720437685456560153351331047775577 +#define FFTW_K466667323 0.4666673232256736976711189168781572674051 +#define FFTW_K467268628 0.4672686282730619891421497069463566255380 +#define FFTW_K468408440 0.4684084406997901392162396741494573562814 +#define FFTW_K469471562 0.4694715627858907759594622882278432957232 +#define FFTW_K469976743 0.4699767430273200448803201882849598306672 +#define FFTW_K471396736 0.4713967368259976485563876259052543776574 +#define FFTW_K473093556 0.4730935568360100744212386756923100796709 +#define FFTW_K473868662 0.4738686624729986707083830096659750872704 +#define FFTW_K474600369 0.4746003697476404014444030521845052424142 +#define FFTW_K475947393 0.4759473930370735444313529194551153377644 +#define FFTW_K477158760 0.4771587602596084150488630081893860525344 +#define FFTW_K477719818 0.4777198185122629226714738291795566445794 +#define FFTW_K478253978 0.4782539786213182117281992257619655845446 +#define FFTW_K479248986 0.4792489867200568311976566004526127683333 +#define FFTW_K480581755 0.4805817551866837805188145730989093322125 +#define FFTW_K481753674 0.4817536741017152749871915028721296535285 +#define FFTW_K482792202 0.4827922027307448748732654364456006331007 +#define FFTW_K483718887 0.4837188871052397910711613404089728511353 +#define FFTW_K484550870 0.4845508703326501661482589827850659897206 +#define FFTW_K485301962 0.4853019625310810252145722292597299794313 +#define FFTW_K486604478 0.4866044785668562872908560142642961120006 +#define FFTW_K487694943 0.4876949438136345453546358573087530741093 +#define FFTW_K488621241 0.4886212414969549474201908878388776372536 +#define FFTW_K489417847 0.4894178478110855091620714559474840496853 +#define FFTW_K490110217 0.4901102171780172253599534345284315254418 +#define FFTW_K490717552 0.4907175520039378866875617032247567784897 +#define FFTW_K491254611 0.4912546110838773740027218272702905763288 +#define FFTW_K491732924 0.4917329246456037728350634796082138236387 +#define FFTW_K492161631 0.4921616313890073350656423325950721684747 +#define FFTW_K492548067 0.4925480679538644138390568320545344677720 +#define FFTW_K492898192 0.4928981922297840368730266887588092682396 +#define FFTW_K500000000 0.5000000000000000000000000000000000000000 +#define FFTW_K499999999 0.5000000000000000000000000000000000000000 +#define FFTW_K507295790 0.5072957901801073367475366123379857519655 +#define FFTW_K507665800 0.5076658003388399581093093048575938349538 +#define FFTW_K508075345 0.5080753452465294585428491475669648936485 +#define FFTW_K508531118 0.5085311186492204850105948124297554981888 +#define FFTW_K509041415 0.5090414157503713002834427138653056527808 +#define FFTW_K509616642 0.5096166425919174293666674157223672698804 +#define FFTW_K510270033 0.5102700330608996133204856818145824161513 +#define FFTW_K511018679 0.5110186794471103662576250033662606123172 +#define FFTW_K511885049 0.5118850490896010021737274853303109596843 +#define FFTW_K512899277 0.5128992774059061439084936529403118044651 +#define FFTW_K514102744 0.5141027441932217265936938389688157726080 +#define FFTW_K514792801 0.5147928015098307273142233930965266875226 +#define FFTW_K515553857 0.5155538571770217397098664966397134305304 +#define FFTW_K516397461 0.5163974616389619233199213987888180697670 +#define FFTW_K517337814 0.5173378141776567710362946754733118933788 +#define FFTW_K518392568 0.5183925683105250315384743146752592400898 +#define FFTW_K519583950 0.5195839500354335781330010113237876331492 +#define FFTW_K520940340 0.5209403404879302861762814495347146459259 +#define FFTW_K521435203 0.5214352033794980724261075391331443334846 +#define FFTW_K522498564 0.5224985647159488649878978801782938234153 +#define FFTW_K523672913 0.5236729139878778613113179353244932106015 +#define FFTW_K524307283 0.5243072835572316877977574563473161566248 +#define FFTW_K524976580 0.5249765803345601755182577112207755871671 +#define FFTW_K526432162 0.5264321628773558002446077991406995661709 +#define FFTW_K528067850 0.5280678506503679958734488203376055682261 +#define FFTW_K528964010 0.5289640103269624573654923939122347256678 +#define FFTW_K529919264 0.5299192642332049540467811518160866687720 +#define FFTW_K530420908 0.5304209081197424901275539775477963937120 +#define FFTW_K532032076 0.5320320765153365635576303672303707301645 +#define FFTW_K533823377 0.5338233779647906819709106917246609497097 +#define FFTW_K534465826 0.5344658261278010920448916115059631779908 +#define FFTW_K534997619 0.5349976198870972106630769046370179155602 +#define FFTW_K535826794 0.5358267949789966182713087678676399780635 +#define FFTW_K536696193 0.5366961939916004804283904754877204814678 +#define FFTW_K537299608 0.5372996083468238318407855462677067680826 +#define FFTW_K538082353 0.5380823531633726744432314599446075951185 +#define FFTW_K538567961 0.5385679615609043184417452731084601648522 +#define FFTW_K540640817 0.5406408174555975821076359543186916954317 +#define FFTW_K542546263 0.5425462638657594057764972215610247085012 +#define FFTW_K542948982 0.5429489822014786701886277535350098429865 +#define FFTW_K543567550 0.5435675500012211507281151902424756896932 +#define FFTW_K544639035 0.5446390350150270822240836920815653816079 +#define FFTW_K545534901 0.5455349012105486651327077633824745393135 +#define FFTW_K546948158 0.5469481581224268747117627466961884997788 +#define FFTW_K548451871 0.5484518712493187136368616554921198282836 +#define FFTW_K549508978 0.5495089780708060352627803740501339165127 +#define FFTW_K550292715 0.5502927152373913716928201431260802030025 +#define FFTW_K550896981 0.5508969814521025226871043191204105871852 +#define FFTW_K551767740 0.5517677407704459049547942137195885263307 +#define FFTW_K552364972 0.5523649729605058107631005229003669921116 +#define FFTW_K552800065 0.5528000653611933830479607237660836570846 +#define FFTW_K555570233 0.5555702330196022247428308139485328743749 +#define FFTW_K558243722 0.5582437220268647591526404027462258729266 +#define FFTW_K558646765 0.5586467658036524568622720968872277915579 +#define FFTW_K559192903 0.5591929034707468301604281399859892873066 +#define FFTW_K559974786 0.5599747861375953903804362399881110256799 +#define FFTW_K561187065 0.5611870653623823692699409283736092029758 +#define FFTW_K562083377 0.5620833778521306000972520013088883538429 +#define FFTW_K563320058 0.5633200580636220277492615380297605110458 +#define FFTW_K564443218 0.5644432188667691804433731669421321560933 +#define FFTW_K565136414 0.5651364144225918889815679062534626407621 +#define FFTW_K565947094 0.5659470943305951647768230619336659850687 +#define FFTW_K566406236 0.5664062369248328318216250522337649325187 +#define FFTW_K568064746 0.5680647467311558025118075591275166245335 +#define FFTW_K569808057 0.5698080575102661816845660286961865846296 +#define FFTW_K570322636 0.5703226369349640602140881497060451205684 +#define FFTW_K571268215 0.5712682150947922791574245436284554823534 +#define FFTW_K572116660 0.5721166601221696498132192034370527016364 +#define FFTW_K573576436 0.5735764363510460961080319128261578646204 +#define FFTW_K574787410 0.5747874102144068850436978464129713348833 +#define FFTW_K575318660 0.5753186602186205995927072726495191736474 +#define FFTW_K575808191 0.5758081914178453007459724538157308417760 +#define FFTW_K576680322 0.5766803221148671412510482752668528239788 +#define FFTW_K577773831 0.5777738314082511021102199089899935947837 +#define FFTW_K578671296 0.5786712961798057416349117556513751600107 +#define FFTW_K579421098 0.5794210982045636845678607582146469698519 +#define FFTW_K580056909 0.5800569095711981791969811319003074122335 +#define FFTW_K581076815 0.5810768154019382799971629059056750994902 +#define FFTW_K581858915 0.5818589155579528384237390755893130777775 +#define FFTW_K582477696 0.5824776968678021491971347670361124496849 +#define FFTW_K582979479 0.5829794791144720768317634478275581254656 +#define FFTW_K583394579 0.5833945791074939474110439755476610699679 +#define FFTW_K583743672 0.5837436722347898704535849173602861862334 +#define FFTW_K587785252 0.5877852522924731291687059546390727685976 +#define FFTW_K591877046 0.5918770467870172636974905748868801823425 +#define FFTW_K592235252 0.5922352526649800217394881554148630285607 +#define FFTW_K592662191 0.5926621913640168354692868591503568120595 +#define FFTW_K593179744 0.5931797447293552110980879105045366390442 +#define FFTW_K593820185 0.5938201855735016116500901787757969715429 +#define FFTW_K594633176 0.5946331763042866161328284577790955529530 +#define FFTW_K595699304 0.5956993044924333434670365288299698895119 +#define FFTW_K596367358 0.5963673585385014139115331297600029152330 +#define FFTW_K597158591 0.5971585917027861648518521605839597728406 +#define FFTW_K598110530 0.5981105304912159620592663549050390073657 +#define FFTW_K599277666 0.5992776665113469345300241464975926115075 +#define FFTW_K600214280 0.6002142805483682182892439332026327230385 +#define FFTW_K600742264 0.6007422642379789169170698743449837706706 +#define FFTW_K601317091 0.6013170912984058082408764754369813163847 +#define FFTW_K602634636 0.6026346363792563891785881549868406216189 +#define FFTW_K603804410 0.6038044103254773687416432135874339982464 +#define FFTW_K604236389 0.6042363895210945207619697322884734664490 +#define FFTW_K605174215 0.6051742151937651659242801329801084792646 +#define FFTW_K606225410 0.6062254109666380182743756853644417577991 +#define FFTW_K606800145 0.6068001458185933703817660523085167627397 +#define FFTW_K608761429 0.6087614290087206394160975428981640045164 +#define FFTW_K610647879 0.6106478796354381306932542723821207732355 +#define FFTW_K611173714 0.6111737140978492922481400688827063108551 +#define FFTW_K612105982 0.6121059825476628441467056202598600662486 +#define FFTW_K612907053 0.6129070536529764933643860565186920014861 +#define FFTW_K614212712 0.6142127126896678174443358335144494567519 +#define FFTW_K615231590 0.6152315905806268454849135634139842776594 +#define FFTW_K615661475 0.6156614753256582796688110928436556282509 +#define FFTW_K616718872 0.6167188726285430584574009602667958339961 +#define FFTW_K617524614 0.6175246149461919150332079754986842314714 +#define FFTW_K618158986 0.6181589862206052132242870766482095935286 +#define FFTW_K619093949 0.6190939493098339869415608562461182062175 +#define FFTW_K619749888 0.6197498889602448854708069331948698244808 +#define FFTW_K620235491 0.6202354912682600677739492348652510534689 +#define FFTW_K620609481 0.6206094818274227951118685588824422384550 +#define FFTW_K623489801 0.6234898018587335305250048840042398106322 +#define FFTW_K626509999 0.6265099998359866294090460453355545190924 +#define FFTW_K626923805 0.6269238058941064650171695366099533004747 +#define FFTW_K627469007 0.6274690073808519692459461113376089475503 +#define FFTW_K628219997 0.6282199972956423167888571244982907776990 +#define FFTW_K629320391 0.6293203910498374527059024582799704265668 +#define FFTW_K630087843 0.6300878435817110813020457226223099127413 +#define FFTW_K631087944 0.6310879443260527893674001301433105742008 +#define FFTW_K631942038 0.6319420384463039980812672705334167368491 +#define FFTW_K632445375 0.6324453755953772378210421356243774316157 +#define FFTW_K633012453 0.6330124538088703887271152762762650288323 +#define FFTW_K634393284 0.6343932841636454982151716132254933706757 +#define FFTW_K635723748 0.6357237482099679982772185699592814904753 +#define FFTW_K636242442 0.6362424423265598332563914426192972085437 +#define FFTW_K637423989 0.6374239897486897101767128116760161954349 +#define FFTW_K638244183 0.6382441836448200939919339938994422817340 +#define FFTW_K638846805 0.6388468056519613170701714797131712501021 +#define FFTW_K639673021 0.6396730215588912736376413785400172119839 +#define FFTW_K640212840 0.6402128404624880139089127673149144443273 +#define FFTW_K640593178 0.6405931786981751555801787491064955966940 +#define FFTW_K642787609 0.6427876096865393263226434099072634329075 +#define FFTW_K645171983 0.6451719835420876332916589890067163479062 +#define FFTW_K645627851 0.6456278515588023976509609942805170886061 +#define FFTW_K646299237 0.6462992378609408919872782945589183784725 +#define FFTW_K647386284 0.6473862847818276391816601341861462687573 +#define FFTW_K648228395 0.6482283953077884016265676818920522589008 +#define FFTW_K649448048 0.6494480483301836557263207708937628792775 +#define FFTW_K650618300 0.6506183002042421137200625338820968810477 +#define FFTW_K651372482 0.6513724827222222074539996146910164660920 +#define FFTW_K652287411 0.6522874112781211543709918892277518756944 +#define FFTW_K652822118 0.6528221181905216240058867193362104152324 +#define FFTW_K653172842 0.6531728429537767640842030136563054150768 +#define FFTW_K654860733 0.6548607339452850640569250724662935531838 +#define FFTW_K656752024 0.6567520240477344067154384346008419370839 +#define FFTW_K657203678 0.6572036788179724611572838276890770109395 +#define FFTW_K657938725 0.6579387259397126123701191819931188157209 +#define FFTW_K658511379 0.6585113790650386427945048286629364391494 +#define FFTW_K659345815 0.6593458151000688684251246120553374509154 +#define FFTW_K660152120 0.6601521206712317513451242124324233897176 +#define FFTW_K660674723 0.6606747233900814419084029992842146796392 +#define FFTW_K661311865 0.6613118653236518765686217371023240621957 +#define FFTW_K661685837 0.6616858375968594152403677203172028537185 +#define FFTW_K663122658 0.6631226582407952023767854926667662795247 +#define FFTW_K664795865 0.6647958656139378287087022425974990458408 +#define FFTW_K665325700 0.6653257001655653635571413398480420351878 +#define FFTW_K666346577 0.6663465779520039455829121186875666953965 +#define FFTW_K667318811 0.6673188112222394158299466460967518615170 +#define FFTW_K667787758 0.6677877587886956156678714244522237437632 +#define FFTW_K669130606 0.6691306063588582138262733306867804735995 +#define FFTW_K670384843 0.6703848439562785276102304567161121618440 +#define FFTW_K670784730 0.6707847301392234490950123366082160122035 +#define FFTW_K671558954 0.6715589548470184006253768504274218032287 +#define FFTW_K672300890 0.6723008902613167880864184616374229315599 +#define FFTW_K673695643 0.6736956436465572117126919124256946158624 +#define FFTW_K674983001 0.6749830015182105320655112776739346328419 +#define FFTW_K675590207 0.6755902076156602443483393536743541823082 +#define FFTW_K676174900 0.6761749002740194352804986161659714461903 +#define FFTW_K677281571 0.6772815716257410747621509844956257184155 +#define FFTW_K678311836 0.6783118362696160847748068699856585450415 +#define FFTW_K678800745 0.6788007455329417413938555542417347670587 +#define FFTW_K679273338 0.6792733388972931155862949904270503180450 +#define FFTW_K680172737 0.6801727377709193901873587010337402440270 +#define FFTW_K681417939 0.6814179395938911071752870865417535631154 +#define FFTW_K682553143 0.6825531432186540828745375453725405780987 +#define FFTW_K683592302 0.6835923020228712805134975943161551170438 +#define FFTW_K684547105 0.6845471059286886737322833576212092698895 +#define FFTW_K685427422 0.6854274223350397681993662181891218368258 +#define FFTW_K686241637 0.6862416378687335857296049996175379830146 +#define FFTW_K686996926 0.6869969260349016335361463414661483035462 +#define FFTW_K687699458 0.6876994588534232930838768523753670644636 +#define FFTW_K688354575 0.6883545756937539843892561434196122934864 +#define FFTW_K688966919 0.6889669190756865678008668038181416871299 +#define FFTW_K689540544 0.6895405447370669246167306299574847028455 +#define FFTW_K690079011 0.6900790114821119896680022393860466831042 +#define FFTW_K691062648 0.6910626489868646759049354256591699817466 +#define FFTW_K691938868 0.6919388689775462000100916668541419889185 +#define FFTW_K692724353 0.6927243535095993926023640323286367890472 +#define FFTW_K693432500 0.6934325007922417286259483972875805939519 +#define FFTW_K694074195 0.6940741952206338743562373929183182498191 +#define FFTW_K694658370 0.6946583704589972866564062994226862299198 +#define FFTW_K695192427 0.6951924276746422635493018952393936461260 +#define FFTW_K695682550 0.6956825506034863980123038192788602156570 +#define FFTW_K696133945 0.6961339459629266082804580802171441972963 +#define FFTW_K696551029 0.6965510290629970275685644956080105169444 +#define FFTW_K696937568 0.6969375686552934513687343434240100437094 +#define FFTW_K697296801 0.6972968010939954123883995190174803108192 +#define FFTW_K697631521 0.6976315211349847088683553934221612826295 +#define FFTW_K697944154 0.6979441547663435525141697077142117061923 +#define FFTW_K698236818 0.6982368180860728303443788766343622359181 +#define FFTW_K707106781 0.7071067811865475244008443621048490392848 +#define FFTW_K715866849 0.7158668492597184358325495667351529571818 +#define FFTW_K716152188 0.7161521883143933244871695467834148450420 +#define FFTW_K716456740 0.7164567402983151385899735430616918149233 +#define FFTW_K716782513 0.7167825131684512560287415441946047504647 +#define FFTW_K717131804 0.7171318047589634877970500299385526785307 +#define FFTW_K717507257 0.7175072570443311343681755891326858548995 +#define FFTW_K717911923 0.7179119230644419217516810110208110922839 +#define FFTW_K718349350 0.7183493500977275799770853713340482116475 +#define FFTW_K718823683 0.7188236838779293347704518118723688496542 +#define FFTW_K719339800 0.7193398003386511393560546744567119082307 +#define FFTW_K719903473 0.7199034737579958486390645343470509553063 +#define FFTW_K720521593 0.7205215936007870086417952013179792194347 +#define FFTW_K721202447 0.7212024473438145312912178776909015417372 +#define FFTW_K721956093 0.7219560939545244623539160604710216653225 +#define FFTW_K722794863 0.7227948638273915285452633514998522610902 +#define FFTW_K723734038 0.7237340381050701616398577367648401146360 +#define FFTW_K724247082 0.7242470829514669209410692432905531674831 +#define FFTW_K724792787 0.7247927872291199588654846624405482525919 +#define FFTW_K725374371 0.7253743710122876379932841111897274422634 +#define FFTW_K725995491 0.7259954919231308581383348989285119089043 +#define FFTW_K726660322 0.7266603220340270471615222876385396255744 +#define FFTW_K727373641 0.7273736415730486959871764176638155218003 +#define FFTW_K728140953 0.7281409538757884113627136381609143278784 +#define FFTW_K728968627 0.7289686274214115231467303190552591113725 +#define FFTW_K729864072 0.7298640726978356573501011944031818828671 +#define FFTW_K730835964 0.7308359642781241016508331160835884644009 +#define FFTW_K731894522 0.7318945221817254249995908196165164482138 +#define FFTW_K733051871 0.7330518718298263285224314892706719069732 +#define FFTW_K733885366 0.7338853664321991204758701610226706020529 +#define FFTW_K734322509 0.7343225094356855356361262221870633391234 +#define FFTW_K734774150 0.7347741508630672705517472711052032451697 +#define FFTW_K735723910 0.7357239106731316247742076119610924993214 +#define FFTW_K736741137 0.7367411378764049113081712804175510630885 +#define FFTW_K737277336 0.7372773368101240413842933949823167074783 +#define FFTW_K737833279 0.7378332790417272840054057907426797687494 +#define FFTW_K739008917 0.7390089172206591159245343098726481057599 +#define FFTW_K740277997 0.7402779970753155388739455189600782362008 +#define FFTW_K740951125 0.7409511253549590911756168974951627297289 +#define FFTW_K741652105 0.7416521056479575401050298834696252306095 +#define FFTW_K742013585 0.7420135854509107900562897491988128499895 +#define FFTW_K743144825 0.7431448254773942350146970489742569771891 +#define FFTW_K744351737 0.7443517375622702753223079406751082310911 +#define FFTW_K744772182 0.7447721827437818541801075535542228384922 +#define FFTW_K745642164 0.7456421648831656094855517544592784043106 +#define FFTW_K746553221 0.7465532216119626505430821259987599991059 +#define FFTW_K747025071 0.7470250712409959770813061511833665718690 +#define FFTW_K748510748 0.7485107481711010986346305997013513838464 +#define FFTW_K749781202 0.7497812029677341725472752431791603229768 +#define FFTW_K750111069 0.7501110696304595415116318903602243084582 +#define FFTW_K750672305 0.7506723052527243552853714132129325824726 +#define FFTW_K751131930 0.7511319308705198908719336792015250259316 +#define FFTW_K751839807 0.7518398074789773964075194063769614427711 +#define FFTW_K752570769 0.7525707698561385039345058991616619849640 +#define FFTW_K753071466 0.7530714660036109335328981126967543453011 +#define FFTW_K753713025 0.7537130253273611135174409504536276492985 +#define FFTW_K754106609 0.7541066097768962584072425641248841945967 +#define FFTW_K755749574 0.7557495743542582837740358439723444201797 +#define FFTW_K757208846 0.7572088465064845475754640536057844730404 +#define FFTW_K757511242 0.7575112421616200777921492788026149650951 +#define FFTW_K757971723 0.7579717231454529817885572940611047033822 +#define FFTW_K758758122 0.7587581226927909019132546363634371874187 +#define FFTW_K759404916 0.7594049166547071324830192475886597898185 +#define FFTW_K760405965 0.7604059656000309381745943648449019998887 +#define FFTW_K761445958 0.7614459583691344354059827794359096182151 +#define FFTW_K762162055 0.7621620551276364632557304138001066169968 +#define FFTW_K763084068 0.7630840681998065061370822576584453862969 +#define FFTW_K763652196 0.7636521965473320213761899200454104141096 +#define FFTW_K764037375 0.7640373758216074366584418224732236328521 +#define FFTW_K766044443 0.7660444431189780352023926505554166739358 +#define FFTW_K767880446 0.7678804460366000439108131759354179442125 +#define FFTW_K768197578 0.7681975780402805136696963323797498461191 +#define FFTW_K768647139 0.7686471397785320711672309487157031840488 +#define FFTW_K769333970 0.7693339709828789081165579311348793444580 +#define FFTW_K769833983 0.7698339834299062446400585995897523594467 +#define FFTW_K770513242 0.7705132427757892308030096363961778472716 +#define FFTW_K771489179 0.7714891798219429236333137852557419058307 +#define FFTW_K771916650 0.7719166509163208938857372713158033849885 +#define FFTW_K773010453 0.7730104533627369608109066097584698009710 +#define FFTW_K774141610 0.7741416106390824490643725637222281648702 +#define FFTW_K774604961 0.7746049618276545830695547811609143505275 +#define FFTW_K775015651 0.7750156514834587774905671515508743070762 +#define FFTW_K775711290 0.7757112907044198070411010109695368955877 +#define FFTW_K776523862 0.7765238627180424194178981071015438682470 +#define FFTW_K777145961 0.7771459614569708799799377436724038490920 +#define FFTW_K778035754 0.7780357543184395071379034311358886990222 +#define FFTW_K778641538 0.7786415380497551756216347075406753784977 +#define FFTW_K779080574 0.7790805745256704319243606206074903916787 +#define FFTW_K779413382 0.7794133820415916066406766395486940072562 +#define FFTW_K781831482 0.7818314824680298087084445266740577502323 +#define FFTW_K784119806 0.7841198065767104288007771818131996408643 +#define FFTW_K784415664 0.7844156649195757164147347243863789879656 +#define FFTW_K784799385 0.7847993852786609660467986845419951971886 +#define FFTW_K785316930 0.7853169308807449274703402789474438465742 +#define FFTW_K786053094 0.7860530947427874697567960561472203660398 +#define FFTW_K786551555 0.7865515558026424811142105001200600923644 +#define FFTW_K787183480 0.7871834806090501817971553081772994121428 +#define FFTW_K788010753 0.7880107536067219566939777878358516666417 +#define FFTW_K788346427 0.7883464276266062620091647053596892826565 +#define FFTW_K789140509 0.7891405093963935992189811493990907424327 +#define FFTW_K790155012 0.7901550123756903651583739005191500716562 +#define FFTW_K790775736 0.7907757369376985820782204594612615906186 +#define FFTW_K791496488 0.7914964884292541024484192534757154670595 +#define FFTW_K791902245 0.7919022459222750967567379392185911277200 +#define FFTW_K793353340 0.7933533402912351645797769615012992766286 +#define FFTW_K794854441 0.7948544414133532553739957580767734022432 +#define FFTW_K795292871 0.7952928712734264419747999587861323112984 +#define FFTW_K796093065 0.7960930657056437459980762465098682421823 +#define FFTW_K796805111 0.7968051114159045953017786484229447858314 +#define FFTW_K797132507 0.7971325072229224793372837601652378546732 +#define FFTW_K798017227 0.7980172272802395033328051127962613693613 +#define FFTW_K799010485 0.7990104853582490339189956088648939776689 +#define FFTW_K799442763 0.7994427634035011497843129165366612315496 +#define FFTW_K799839244 0.7998392447397193882383350307398838367966 +#define FFTW_K800541240 0.8005412409243604039694861948940174149851 +#define FFTW_K801413621 0.8014136218679566597869832895333147708145 +#define FFTW_K802123192 0.8021231927550437850832948919339251336279 +#define FFTW_K802711637 0.8027116379309636648857701593460559768659 +#define FFTW_K803207531 0.8032075314806449098066765129631419238795 +#define FFTW_K803997130 0.8039971303669405448263546938160337037246 +#define FFTW_K804597779 0.8045977797666683273479469589870672086575 +#define FFTW_K805070053 0.8050700531275629237964644458284235283226 +#define FFTW_K805451132 0.8054511325509459412018817468525086560274 +#define FFTW_K805765105 0.8057651056609781448783432800395721783251 +#define FFTW_K806028263 0.8060282634540050525485951357692559600329 +#define FFTW_K809016994 0.8090169943749474241022934171828190588601 +#define FFTW_K811938005 0.8119380057158564945968154707997246072052 +#define FFTW_K812188872 0.8121888727802111341842463443864419315001 +#define FFTW_K812486878 0.8124868780056812804083249549706806424640 +#define FFTW_K812846684 0.8128466845916152165790961432719088000368 +#define FFTW_K813289740 0.8132897407355653520077715387689353346970 +#define FFTW_K813848717 0.8138487172701949671014723968817952735703 +#define FFTW_K814575952 0.8145759520503357077796110789197173627162 +#define FFTW_K815028337 0.8150283375168113542809178737613989382610 +#define FFTW_K815560868 0.8155608689592601713495029594534251284932 +#define FFTW_K816196912 0.8161969123562216908718525404314132261743 +#define FFTW_K816969893 0.8169698930104420169734140372449881772467 +#define FFTW_K817584813 0.8175848131515836965049208841306338094710 +#define FFTW_K817929360 0.8179293607667176652958167850895491664995 +#define FFTW_K818302775 0.8183027759081690562813923055156721567774 +#define FFTW_K819152044 0.8191520442889917896844883859168434318900 +#define FFTW_K820172254 0.8201722545969558802093426246966592359901 +#define FFTW_K820763441 0.8207634412072763263635445613553707767234 +#define FFTW_K821420775 0.8214207751204915613062020704361611380444 +#define FFTW_K821777815 0.8217778152252451671574450614136543968389 +#define FFTW_K822983865 0.8229838658936563945796174234393819906550 +#define FFTW_K824126188 0.8241261886220156617296849031023120581344 +#define FFTW_K824441560 0.8244415603417603172395375008020188385297 +#define FFTW_K824997474 0.8249974745983023155379937789444219618160 +#define FFTW_K825471896 0.8254718969627739569806123728687672821516 +#define FFTW_K826238774 0.8262387743159948719451625737726783977923 +#define FFTW_K827080574 0.8270805742745618249178521862153294255631 +#define FFTW_K827688998 0.8276889981568905561357816231375032629304 +#define FFTW_K828509649 0.8285096492438421235308184341918643175695 +#define FFTW_K829037572 0.8290375725550416920063368415016420263290 +#define FFTW_K829405685 0.8294056854502017964409300836351034222685 +#define FFTW_K829677013 0.8296770135526188902704259673870759766830 +#define FFTW_K831469612 0.8314696123025452370787883776179057567385 +#define FFTW_K833313919 0.8333139190825149799338497823040738779341 +#define FFTW_K833602385 0.8336023852211194846164818272941764912595 +#define FFTW_K833997817 0.8339978178898779396182802893240929133492 +#define FFTW_K834573253 0.8345732537213026509332106768737349045847 +#define FFTW_K834971812 0.8349718124324073791989500778051524105744 +#define FFTW_K835487811 0.8354878114129364196538261700195835937419 +#define FFTW_K836182124 0.8361821242547108702206976219550553416196 +#define FFTW_K837166478 0.8371664782625285748060612009369102474987 +#define FFTW_K838088104 0.8380881048918406577111979492710431086713 +#define FFTW_K838670567 0.8386705679454240296375909418045478940395 +#define FFTW_K839365426 0.8393654261319499596375221301924238843327 +#define FFTW_K839765683 0.8397656832273979021124385277222164103972 +#define FFTW_K840025923 0.8400259231507714427435891533712282132058 +#define FFTW_K841253532 0.8412535328311811688618116489193677175133 +#define FFTW_K842582073 0.8425820736166491030403155344809671036641 +#define FFTW_K842892271 0.8428922714167970616253021027431752417750 +#define FFTW_K843391445 0.8433914458128857012728568058275720937337 +#define FFTW_K843775559 0.8437755598231856492381035650969764103387 +#define FFTW_K844327925 0.8443279255020150785485580639666815053816 +#define FFTW_K844853565 0.8448535652497070732595712051049570977198 +#define FFTW_K845190085 0.8451900855437947525384210461577995981395 +#define FFTW_K845596003 0.8455960035018260599096401021741480733078 +#define FFTW_K846724199 0.8467241992282841683527758162629652715100 +#define FFTW_K847734427 0.8477344278896709378979078108963493518662 +#define FFTW_K848048096 0.8480480961564259703861761786903864487287 +#define FFTW_K848644257 0.8486442574947509504641043389938084539825 +#define FFTW_K849202181 0.8492021815265788876490969373431002233934 +#define FFTW_K850217135 0.8502171357296141521341439229493520584706 +#define FFTW_K851116672 0.8511166724369997244053230155948839997322 +#define FFTW_K851529137 0.8515291377333112998870022534009853476003 +#define FFTW_K851919408 0.8519194088383270748769520464652824320111 +#define FFTW_K852640164 0.8526401643540922215193834581304121358172 +#define FFTW_K853290881 0.8532908816321556602859841530744174889494 +#define FFTW_K853593089 0.8535930890373464483418460304073336603452 +#define FFTW_K854419404 0.8544194045464885525482156195502508000478 +#define FFTW_K855142763 0.8551427630053461657188369620377883134776 +#define FFTW_K855781272 0.8557812723014475226428751870717647816026 +#define FFTW_K856349030 0.8563490302515889746335454168038935447319 +#define FFTW_K856857176 0.8568571761675892445230765519053744460274 +#define FFTW_K857314628 0.8573146280763323254728913071983536155226 +#define FFTW_K857728610 0.8577286100002720699022699842847701370425 +#define FFTW_K858448793 0.8584487936018661185256909553391418597076 +#define FFTW_K859053954 0.8590539543698851819025917736107901459966 +#define FFTW_K859569606 0.8595696069872011600426288131227073044970 +#define FFTW_K860014240 0.8600142402077005233981293105137709830115 +#define FFTW_K860401579 0.8604015792601393698695982953288507392950 +#define FFTW_K860742027 0.8607420270039436371645764888171186033396 +#define FFTW_K861043611 0.8610436117673555084585595060301225131232 +#define FFTW_K861312628 0.8613126282324089409969539854169889092899 +#define FFTW_K861554081 0.8615540813938061097287323042306235949835 +#define FFTW_K861772000 0.8617720007435496349698180347969737605395 +#define FFTW_K866025403 0.8660254037844386467637231707529361834714 +#define FFTW_K870086991 0.8700869911087114186522924044838488439108 +#define FFTW_K870285241 0.8702852410301552181879425663868640291029 +#define FFTW_K870503836 0.8705038360561720522112540977190092812503 +#define FFTW_K870746077 0.8707460771197771877217507835501149827317 +#define FFTW_K871016019 0.8710160199955155735930822648109600128714 +#define FFTW_K871318704 0.8713187041233893515466254843890811801214 +#define FFTW_K871660470 0.8716604700327512208196316756206218352705 +#define FFTW_K872049408 0.8720494081438076081277840260926609267766 +#define FFTW_K872496007 0.8724960070727971145251610992220606750668 +#define FFTW_K873014113 0.8730141131611881587490998015817489306733 +#define FFTW_K873622390 0.8736223906463695371317751603403871753524 +#define FFTW_K874346616 0.8743466161445821188274846642006517855751 +#define FFTW_K874763084 0.8747630845319612851774127792561794433059 +#define FFTW_K875223421 0.8752234219087536975047322807456399773275 +#define FFTW_K875734942 0.8757349421956368077335331364008557877370 +#define FFTW_K876306680 0.8763066800438635873081159039220625833990 +#define FFTW_K876949928 0.8769499282066715222872466054001294856266 +#define FFTW_K877678989 0.8776789895672556152144819341043752955765 +#define FFTW_K878221573 0.8782215733702285355675152847970664824282 +#define FFTW_K878512250 0.8785122509109423770324441012904022125743 +#define FFTW_K878817112 0.8788171126619653741299951436845247996106 +#define FFTW_K879473751 0.8794737512064890713908547548818411172079 +#define FFTW_K880201391 0.8802013911801111312939007656084800475957 +#define FFTW_K880595531 0.8805955318567379951929100621071846598466 +#define FFTW_K881012194 0.8810121942857845060087088179255903520436 +#define FFTW_K881921264 0.8819212643483550297127568636603883495084 +#define FFTW_K882678798 0.8826787983255474000126255959521373235657 +#define FFTW_K882947592 0.8829475928589269420321713603157193860835 +#define FFTW_K883512044 0.8835120444460229228273168942218641218895 +#define FFTW_K884115393 0.8841153935046097894486040972072045445368 +#define FFTW_K884432930 0.8844329309978143222381222066254039736375 +#define FFTW_K885456025 0.8854560256532098959003755220150988786055 +#define FFTW_K886360032 0.8863600326884082489319680620575687435341 +#define FFTW_K886599306 0.8865993063730000600561492865169439780362 +#define FFTW_K887010833 0.8870108331782217010546098830375165208464 +#define FFTW_K887352075 0.8873520750565715798425605640019506703212 +#define FFTW_K887885218 0.8878852184023752349842692774195844835989 +#define FFTW_K888445635 0.8884456359788723003064024832079566539738 +#define FFTW_K888835448 0.8888354486549234663115988929508545523678 +#define FFTW_K889342148 0.8893421488825189034181645031537721365929 +#define FFTW_K889657090 0.8896570909947472780924836875303123734246 +#define FFTW_K889871808 0.8898718088114686056939962978651778190884 +#define FFTW_K891006524 0.8910065241883678623597095714136263127705 +#define FFTW_K892254238 0.8922542386183940179207828634080536567074 +#define FFTW_K892518835 0.8925188358598812258172950673579982916784 +#define FFTW_K892925858 0.8929258581495684897301089783029903371682 +#define FFTW_K893224301 0.8932243011955153203424164474933979780006 +#define FFTW_K893632640 0.8936326403234122481925741868666551173761 +#define FFTW_K894225269 0.8942252698597112823960628785193238212484 +#define FFTW_K894487082 0.8944870822287955820318233216497337670451 +#define FFTW_K895163291 0.8951632913550623220670164997537854569905 +#define FFTW_K895872260 0.8958722607586879531165149908123770853627 +#define FFTW_K896165556 0.8961655569610556111428812574074225463776 +#define FFTW_K896872741 0.8968727415326883038941039363930811981792 +#define FFTW_K897398428 0.8973984286913583989856569596882832674134 +#define FFTW_K897804539 0.8978045395707416571368028976620412024434 +#define FFTW_K898390981 0.8983909818919788715724772004503877322352 +#define FFTW_K898794046 0.8987940462991669927822956766957853549299 +#define FFTW_K899088113 0.8990881137654259575573009403311324039869 +#define FFTW_K899312130 0.8993121301712192281267728278439957438859 +#define FFTW_K900968867 0.9009688679024191262361023195074450511659 +#define FFTW_K902585284 0.9025852843498606067626451490957717568164 +#define FFTW_K902797829 0.9027978299657435157159434879211280035795 +#define FFTW_K903074732 0.9030747323245327046634600051435581145958 +#define FFTW_K903450434 0.9034504346103822750158502586754325787995 +#define FFTW_K903989293 0.9039892931234433315862002972305370487101 +#define FFTW_K904357160 0.9043571606975774917577889956510946245375 +#define FFTW_K904827052 0.9048270524660195277136686479326975939704 +#define FFTW_K905448237 0.9054482374931466157217925560288827802948 +#define FFTW_K905702263 0.9057022630804714831454571042369241665150 +#define FFTW_K906307787 0.9063077870366499632425526567543169832677 +#define FFTW_K907090913 0.9070909137343407425834416725781145590933 +#define FFTW_K907575419 0.9075754196709570536201612900285178073502 +#define FFTW_K908143173 0.9081431738250812992580858365718675308412 +#define FFTW_K908465271 0.9084652718195236861115036475859197065373 +#define FFTW_K908672791 0.9086727911416249200241224067716522862116 +#define FFTW_K909631995 0.9096319953545183714117153830790284600602 +#define FFTW_K910634772 0.9106347728549131795432779003164790771901 +#define FFTW_K910863824 0.9108638249211758185732917071605506458979 +#define FFTW_K911228490 0.9112284903881357028266050899228384756870 +#define FFTW_K911505852 0.9115058523116731517830363345907678394956 +#define FFTW_K911899845 0.9118998459920900771751693987314744889449 +#define FFTW_K912503616 0.9125036164765500159680850800074193201110 +#define FFTW_K912783265 0.9127832650613189089239580059304432421433 +#define FFTW_K913545457 0.9135454576426008955021275719853171779408 +#define FFTW_K914209755 0.9142097557035306546350148293935774010447 +#define FFTW_K914412623 0.9144126230158124813216621552768982013708 +#define FFTW_K914793868 0.9147938684880209699974625808573866803804 +#define FFTW_K915145617 0.9151456172430184708919922968074955054838 +#define FFTW_K915773326 0.9157733266550574399193492356940089700766 +#define FFTW_K916316904 0.9163169044870047347483910891303247178132 +#define FFTW_K916562255 0.9165622558699761858166528942590914119157 +#define FFTW_K917211301 0.9172113015054530178438054479656154936903 +#define FFTW_K917754625 0.9177546256839811411456038575494850645302 +#define FFTW_K918216106 0.9182161068802740147589614153146366024813 +#define FFTW_K918612937 0.9186129377636217717227839432978941276582 +#define FFTW_K918957811 0.9189578116202306291271881732781545512765 +#define FFTW_K919527772 0.9195277725514506383219765907863572139881 +#define FFTW_K919979443 0.9199794436588242031333806039892048138233 +#define FFTW_K920346183 0.9203461835691594463070513006835656710894 +#define FFTW_K920649886 0.9206498866764287674701863104116332022322 +#define FFTW_K920905517 0.9209055179449536255994064620068449731338 +#define FFTW_K921123653 0.9211236531148501159329021282782128071959 +#define FFTW_K921311977 0.9213119778704129896905480715839225965944 +#define FFTW_K921476211 0.9214762118704076536461883522196093537778 +#define FFTW_K923879532 0.9238795325112867561281831893967882868224 +#define FFTW_K926323968 0.9263239682514949705912905047270639912213 +#define FFTW_K926494067 0.9264940672148017743152104663441626574522 +#define FFTW_K926689607 0.9266896074318334380530112475652589383520 +#define FFTW_K926916757 0.9269167573460217630248384996993891944013 +#define FFTW_K927183854 0.9271838545667874008064744511369569420976 +#define FFTW_K927502451 0.9275024511020946646050826878721451949727 +#define FFTW_K927889027 0.9278890272965093271272407498585829086596 +#define FFTW_K928367933 0.9283679330160726102005887247635900348309 +#define FFTW_K928652999 0.9286529995722621793338215070602379216189 +#define FFTW_K928976719 0.9289767198167914417896296010855542620841 +#define FFTW_K929347524 0.9293475242268224539554160275642758031236 +#define FFTW_K929776485 0.9297764858882514036609425562219907295871 +#define FFTW_K930278443 0.9302784433378331543856301730081308574415 +#define FFTW_K930873748 0.9308737486442042556377992419512753071420 +#define FFTW_K931336177 0.9313361774523384395875688031090437233347 +#define FFTW_K931591088 0.9315910880512789729395061972269616864428 +#define FFTW_K931864029 0.9318640292114523161883811474964361005778 +#define FFTW_K932472229 0.9324722294043558045731158918215633862626 +#define FFTW_K932992798 0.9329927988347388877116602555433024982950 +#define FFTW_K933180611 0.9331806110416025837525594317989553113908 +#define FFTW_K933580426 0.9335804264972017489900430631395707414059 +#define FFTW_K934016108 0.9340161087325479993506852910851617783859 +#define FFTW_K934248940 0.9342489402945998550750225109270206586844 +#define FFTW_K935016242 0.9350162426854148234397845998378307290505 +#define FFTW_K935716819 0.9357168190404936530452206735763588980841 +#define FFTW_K935905926 0.9359059267573257002917072494667353604862 +#define FFTW_K936234870 0.9362348706397372095087557244681174697775 +#define FFTW_K936511241 0.9365112411970547880293893304037418045007 +#define FFTW_K936949724 0.9369497249997617358215340023800922029264 +#define FFTW_K937419661 0.9374196611341208896823459233762131843021 +#define FFTW_K937752132 0.9377521321470804584291761743123298881308 +#define FFTW_K938191335 0.9381913359224841344523397266860115488320 +#define FFTW_K938468422 0.9384684220497604029667155343105113540832 +#define FFTW_K938659164 0.9386591647471505040724405750138456370676 +#define FFTW_K939692620 0.9396926207859083840541092773247314699362 +#define FFTW_K940700266 0.9407002666710332778144147138258163847213 +#define FFTW_K940880768 0.9408807689542254723241184190970210354205 +#define FFTW_K941140047 0.9411400479795615741432348245881724850480 +#define FFTW_K941544065 0.9415440651830207784125094025995023571856 +#define FFTW_K941844363 0.9418443636395246934886599986368180673483 +#define FFTW_K942260922 0.9422609221188204956176842253179721336254 +#define FFTW_K942641491 0.9426414910921783947771677362823118828448 +#define FFTW_K942877445 0.9428774454610841700409712864144146678198 +#define FFTW_K943154434 0.9431544344712774640574280872093873723077 +#define FFTW_K943883330 0.9438833303083675628952636071510366215206 +#define FFTW_K944489228 0.9444892287836612562119467742722171807155 +#define FFTW_K944669091 0.9446690916079188006659540817282152326248 +#define FFTW_K945000818 0.9450008187146684873915352426727239165683 +#define FFTW_K945299815 0.9452998150346402616705143998997016607838 +#define FFTW_K945817241 0.9458172417006346790196657142849415278238 +#define FFTW_K946249369 0.9462493690718368405241967976805762668189 +#define FFTW_K946439773 0.9464397731576093538703011154574776795266 +#define FFTW_K946930129 0.9469301294951056642558042748539836836988 +#define FFTW_K947326353 0.9473263538541913844327283048776780232015 +#define FFTW_K947653171 0.9476531711828024442740040119711601634623 +#define FFTW_K947927346 0.9479273461671317559187225179207687336495 +#define FFTW_K948160647 0.9481606475909658589306343094708234149340 +#define FFTW_K948536441 0.9485364419471455261649097836474828763046 +#define FFTW_K948825916 0.9488259168373196381387831532597734947289 +#define FFTW_K949055747 0.9490557470106686677560247808577723846680 +#define FFTW_K949242643 0.9492426435730339082613672603147399360686 +#define FFTW_K949397608 0.9493976084683812981670710293175487404773 +#define FFTW_K949528180 0.9495281805930366671959360741893450282522 +#define FFTW_K951056516 0.9510565162951535721164393333793821434057 +#define FFTW_K952635380 0.9526353808033825473157607370981429062638 +#define FFTW_K952775122 0.9527751227228962896620281580565795070492 +#define FFTW_K952942000 0.9529420004271565558310283034152551849996 +#define FFTW_K953144766 0.9531447668141608217276037452354468061606 +#define FFTW_K953396392 0.9533963920549305459532780713869375485036 +#define FFTW_K953716950 0.9537169507482269211438470646002574361517 +#define FFTW_K954139256 0.9541392564000488514758967202113007469136 +#define FFTW_K954405001 0.9544050018795074313557527182827665834059 +#define FFTW_K954720866 0.9547208665085456260632257187577027324935 +#define FFTW_K955102497 0.9551024972069124260581615872080246655679 +#define FFTW_K955572805 0.9555728057861407328113340537674666664396 +#define FFTW_K955952142 0.9559521426716116096201124770282868790124 +#define FFTW_K956166734 0.9561667347392509355062530712604052072035 +#define FFTW_K956400984 0.9564009842765224267816104574942389408587 +#define FFTW_K956940335 0.9569403357322088649357978869802699694828 +#define FFTW_K957422038 0.9574220383620054784219814066701634108048 +#define FFTW_K957600599 0.9576005999084059522314160387302455826259 +#define FFTW_K957989512 0.9579895123154888744373747669567546242580 +#define FFTW_K958427482 0.9584274824582527002251773197822330882206 +#define FFTW_K958667853 0.9586678530366606221509833883096862227102 +#define FFTW_K958819734 0.9588197348681930497610285413925982910492 +#define FFTW_K959492973 0.9594929736144973898903680570663276990624 +#define FFTW_K960149873 0.9601498736716017631384943454019255716108 +#define FFTW_K960293685 0.9602936856769430717520688004889952933058 +#define FFTW_K960518111 0.9605181116313722984399716039511134369404 +#define FFTW_K960917321 0.9609173219450995432119881422930318860934 +#define FFTW_K961261695 0.9612616959383188619164970485570648735257 +#define FFTW_K961416730 0.9614167300122124852309898043387424113665 +#define FFTW_K961825643 0.9618256431728190704087962907315185500314 +#define FFTW_K962268000 0.9622680003092504049510324619909753067365 +#define FFTW_K962455236 0.9624552364536472876302664051852632909944 +#define FFTW_K962624246 0.9626242469500120742026630479274062371083 +#define FFTW_K962917287 0.9629172873477992950152235973732387993550 +#define FFTW_K963270801 0.9632708010475163164004074245844491050914 +#define FFTW_K963549992 0.9635499925192229600433361810024919509632 +#define FFTW_K963776065 0.9637760657954398666864643555078351536631 +#define FFTW_K963962860 0.9639628606958532918885659525499857760906 +#define FFTW_K964253495 0.9642534954531409838529948264870398702492 +#define FFTW_K964469175 0.9644691750543765745192646181812789566372 +#define FFTW_K964635581 0.9646355819083586729132710036114158221655 +#define FFTW_K964767868 0.9647678688145159485146378868261663336703 +#define FFTW_K965925826 0.9659258262890682867497431997288973676339 +#define FFTW_K967027724 0.9670277247913203491918621498323771774221 +#define FFTW_K967146854 0.9671468547019571390593240593318965996643 +#define FFTW_K967294863 0.9672948630390294157758746656854387201623 +#define FFTW_K967483697 0.9674836970574252545056551754955779856175 +#define FFTW_K967732946 0.9677329469334988386884628287513969373382 +#define FFTW_K968077118 0.9680771188662043051530076728012907428347 +#define FFTW_K968303522 0.9683035221222614393926671480238885087824 +#define FFTW_K968583161 0.9685831611286311194901683754647358138360 +#define FFTW_K968937301 0.9689373017815073299549272178752194446760 +#define FFTW_K969077286 0.9690772862290779477269065494657367873034 +#define FFTW_K969400265 0.9694002659393304167361073217961682259573 +#define FFTW_K969796936 0.9697969360350094718195360156539576289212 +#define FFTW_K970031253 0.9700312531945439926039842072861002514568 +#define FFTW_K970295726 0.9702957262759964723063778740339903776322 +#define FFTW_K970441148 0.9704411482532114174890399562715796811572 +#define FFTW_K970941817 0.9709418174260520271569822762937892272498 +#define FFTW_K971429893 0.9714298932647099623746131301214786871614 +#define FFTW_K971567089 0.9715670893979414829343695558577052136741 +#define FFTW_K971811568 0.9718115683235416873794201547326635821400 +#define FFTW_K972022914 0.9720229140804107808510859601443895664086 +#define FFTW_K972369920 0.9723699203976766018336458341187976440025 +#define FFTW_K972758663 0.9727586637650371566638855431106228008872 +#define FFTW_K973044870 0.9730448705798238388328851727846959200348 +#define FFTW_K973264373 0.9732643737003824959312345137172719428005 +#define FFTW_K973438054 0.9734380543606928258135514267061557560963 +#define FFTW_K973695423 0.9736954238777790443618756632395424075067 +#define FFTW_K973876979 0.9738769792773336481496899701335503917353 +#define FFTW_K974011916 0.9740119169423335138154695987232315341728 +#define FFTW_K974116147 0.9741161479953870616712023593468831967519 +#define FFTW_K974927912 0.9749279121818236070181316829939312172328 +#define FFTW_K975702130 0.9757021300385285444603957664195279716440 +#define FFTW_K975796382 0.9757963826274356228783491415777791577932 +#define FFTW_K975916761 0.9759167619387473989575160319010275841997 +#define FFTW_K976075877 0.9760758775559271590070457564913246259691 +#define FFTW_K976296007 0.9762960071199333659708864896054275771653 +#define FFTW_K976620555 0.9766205557100866832082279628778633517990 +#define FFTW_K976848317 0.9768483177596007116214126531054889178029 +#define FFTW_K977146865 0.9771468659711595194867185493399910586943 +#define FFTW_K977403389 0.9774033898178666485587216924073730415593 +#define FFTW_K977555238 0.9775552389476861943402493547982576354464 +#define FFTW_K977726916 0.9777269163708468952746194417086665766233 +#define FFTW_K978147600 0.9781476007338056379285667478695995324597 +#define FFTW_K978556492 0.9785564922995040021441569982979483175857 +#define FFTW_K978716845 0.9787168453273544836415447921951226189869 +#define FFTW_K978855685 0.9788556850953578475488459902421741595530 +#define FFTW_K979084087 0.9790840876823228756328148847602371349846 +#define FFTW_K979340621 0.9793406217655515015104288246369218020372 +#define FFTW_K979529941 0.9795299412524944939380064428117707242914 +#define FFTW_K979790652 0.9797906520422677014706319852738255873975 +#define FFTW_K979961705 0.9799617050365868167949249404815421840498 +#define FFTW_K980082561 0.9800825610923934085579115422063699191729 +#define FFTW_K980172487 0.9801724878485438426221952928871404568919 +#define FFTW_K980785280 0.9807852804032304491261822361342390369739 +#define FFTW_K981451493 0.9814514932524178941230111511474289750195 +#define FFTW_K981559156 0.9815591569910653538492430476851306890594 +#define FFTW_K981708319 0.9817083199968549376776858998806597451093 +#define FFTW_K981928697 0.9819286972627067003986744426247459609910 +#define FFTW_K982083682 0.9820836827421560010932038226168804103451 +#define FFTW_K982287250 0.9822872507286886810856417428652684163884 +#define FFTW_K982566473 0.9825664732332882361458695018243242460076 +#define FFTW_K982684124 0.9826841245925209408606988628810258780288 +#define FFTW_K982973099 0.9829730996839017782819488448551987160987 +#define FFTW_K983254907 0.9832549075639545845546320564305089875746 +#define FFTW_K983365676 0.9833656768294661196753671326297494335829 +#define FFTW_K983619906 0.9836199069471435884212429322426942302141 +#define FFTW_K983797951 0.9837979515735163526446952978240676138119 +#define FFTW_K983929588 0.9839295885986296553956360939899698965200 +#define FFTW_K984111204 0.9841112043361161061416962408560232630074 +#define FFTW_K984230577 0.9842305779475968124404416073840495619445 +#define FFTW_K984315023 0.9843150237975341546618492275637931110120 +#define FFTW_K984807753 0.9848077530122080593667430245895230136706 +#define FFTW_K985277642 0.9852776423889412447740184331785477871601 +#define FFTW_K985353835 0.9853538358476930122394797176177663749267 +#define FFTW_K985459517 0.9854595177171968680142498259365517811271 +#define FFTW_K985615910 0.9856159103477084622647702939762184573686 +#define FFTW_K985871018 0.9858710185182358739239575569680608455649 +#define FFTW_K986070253 0.9860702539900285422933352225912048513788 +#define FFTW_K986361303 0.9863613034027223736025091948190671107285 +#define FFTW_K986643332 0.9866433320848790047469239329842060425036 +#define FFTW_K986826522 0.9868265225415261517686243504388935079839 +#define FFTW_K987050262 0.9870502626379128637906800282243959059321 +#define FFTW_K987181783 0.9871817834144501341077945503208892301209 +#define FFTW_K987268354 0.9872683547213445699907431277816711317672 +#define FFTW_K987688340 0.9876883405951377261900402476934372607584 +#define FFTW_K988087896 0.9880878960910771492992690811307084884358 +#define FFTW_K988165472 0.9881654720812594137618841327936534641992 +#define FFTW_K988280423 0.9882804237803485263249493778325853582721 +#define FFTW_K988468324 0.9884683243281113991621906894031537749210 +#define FFTW_K988615412 0.9886154122075342261549440645140983788437 +#define FFTW_K988830826 0.9888308262251285450697428829340086130652 +#define FFTW_K989040187 0.9890401873221639791098880794573835995058 +#define FFTW_K989176509 0.9891765099647809734516737380162430639837 +#define FFTW_K989343368 0.9893433680751101977923535631123350883204 +#define FFTW_K989441638 0.9894416385809445189738370649369388973400 +#define FFTW_K989821441 0.9898214418809327323760920377767187873765 +#define FFTW_K990181125 0.9901811253364455904432628100327605252812 +#define FFTW_K990268068 0.9902680687415703150837748673448507592511 +#define FFTW_K990410430 0.9904104308752051583495612400629094294845 +#define FFTW_K990522084 0.9905220846375032755297487161751806762898 +#define FFTW_K990685946 0.9906859460363307523423229600962060051400 +#define FFTW_K990845596 0.9908455965788067627878172563691414037669 +#define FFTW_K990949761 0.9909497617679347552486867131683644064606 +#define FFTW_K991077488 0.9910774881547800989077028808834981789933 +#define FFTW_K991152831 0.9911528310040071586383345991233567829241 +#define FFTW_K991444861 0.9914448613738104111445575269285628712777 +#define FFTW_K991722674 0.9917226741361015058214790070582345607756 +#define FFTW_K991790013 0.9917900138232461089574427772187849280190 +#define FFTW_K991900435 0.9919004352588768873144078072665135340842 +#define FFTW_K991987177 0.9919871770507430065166704184575838095046 +#define FFTW_K992114701 0.9921147013144778310497930427857785214530 +#define FFTW_K992239206 0.9922392066001720806339750438970024692424 +#define FFTW_K992320579 0.9923205797370450627452009318759713711174 +#define FFTW_K992420509 0.9924205096719357582614560541072921874651 +#define FFTW_K992479534 0.9924795345987099981567672516611178200108 +#define FFTW_K992708874 0.9927088740980539928007516494925201793436 +#define FFTW_K992981096 0.9929810960135169614675928693736574381005 +#define FFTW_K993068456 0.9930684569549262956374372478102157228837 +#define FFTW_K993238357 0.9932383577419429885478955521937043403491 +#define FFTW_K993402089 0.9934020897596750687947423983479637156807 +#define FFTW_K993481735 0.9934817353485502085180496808547969202400 +#define FFTW_K993712209 0.9937122098932425835331482419473786971526 +#define FFTW_K993930677 0.9939306773179494792563298151574801808174 +#define FFTW_K994000975 0.9940009752399459187884342036497682765393 +#define FFTW_K994137957 0.9941379571543596089553027158795515668545 +#define FFTW_K994270301 0.9942703017718973183669165054181572463000 +#define FFTW_K994334800 0.9943348002101371309920980500642722883465 +#define FFTW_K994521895 0.9945218953682733369226919449805703815208 +#define FFTW_K994699875 0.9946998756145890479762568067220906149617 +#define FFTW_K994757278 0.9947572788580948291790636723123688992574 +#define FFTW_K994869323 0.9948693233918951463213533098837194930039 +#define FFTW_K994977815 0.9949778150885040755354075401441960635882 +#define FFTW_K995030775 0.9950307753654014099099494968280711167442 +#define FFTW_K995184726 0.9951847266721968862448369531094799215754 +#define FFTW_K995379112 0.9953791129491982046051034132093649871861 +#define FFTW_K995471922 0.9954719225730846047262552811299306157575 +#define FFTW_K995561964 0.9955619646030800128976780442146194187237 +#define FFTW_K995734176 0.9957341762950345218711911789054817839027 +#define FFTW_K995896557 0.9958965576170909700362686366938831171748 +#define FFTW_K995974293 0.9959742939952390295817189937211678685354 +#define FFTW_K996049842 0.9960498426152169249788048954440014509192 +#define FFTW_K996194698 0.9961946980917455322950104024738880461835 +#define FFTW_K996331730 0.9963317308626913876242320559879490045416 +#define FFTW_K996397488 0.9963974885425265016515427736575384585731 +#define FFTW_K996461494 0.9964614941176191465297827729475896395564 +#define FFTW_K996584493 0.9965844930066698498193520007504877187805 +#define FFTW_K996701189 0.9967011895602227462429879020699209472138 +#define FFTW_K996757308 0.9967573081342099855852412239757600532391 +#define FFTW_K996812007 0.9968120070307501492577958043253480021674 +#define FFTW_K996917333 0.9969173337331279761977734087420444201589 +#define FFTW_K997017526 0.9970175264485266683508923434628785416228 +#define FFTW_K997065801 0.9970658011837404621446414104254119713626 +#define FFTW_K997112913 0.9971129134476474623595146912637885801501 +#define FFTW_K997203797 0.9972037971811801482250298708781192656558 +#define FFTW_K997290456 0.9972904566786902161355971401825678211717 +#define FFTW_K997332283 0.9973322836635516728058606115895235926462 +#define FFTW_K997452114 0.9974521146102535413623057568371267046549 +#define FFTW_K997564050 0.9975640502598242476131626806442550263694 +#define FFTW_K997668769 0.9976687691905391984535782806992783166368 +#define FFTW_K997766878 0.9977668786231531595627548884062599817399 +#define FFTW_K997858923 0.9978589232386035067380697912727776045318 +#define FFTW_K997945392 0.9979453927503363420088404809579925550286 +#define FFTW_K998026728 0.9980267284282715619523368068634505533369 +#define FFTW_K998103328 0.9981033287370440781595580722798538475393 +#define FFTW_K998175554 0.9981755542233174708416597487435284042144 +#define FFTW_K998243731 0.9982437317643214135795104790047750439576 +#define FFTW_K998308158 0.9983081582712682080478207087832775329371 +#define FFTW_K998369103 0.9983691039261356791012880254984185496026 +#define FFTW_K998426815 0.9984268150178165621314250714948528394090 +#define FFTW_K998481516 0.9984815164333162254755259567160496340501 +#define FFTW_K998533413 0.9985334138511238645717905110783489569243 +#define FFTW_K998582695 0.9985826956767619481118898673784527334232 +#define FFTW_K998629534 0.9986295347545738737844920584394365805909 +#define FFTW_K998674089 0.9986740898848305076057717645316607303307 +#define FFTW_K998716507 0.9987165071710528071463114367595140457475 +#define FFTW_K998756921 0.9987569212189223697539952989398761436398 +#define FFTW_K998795456 0.9987954562051723927147716047591006944432 +#define FFTW_K998867339 0.9988673391830079766626725799084316622350 +#define FFTW_K998932974 0.9989329748023724444057615270546990770867 +#define FFTW_K998993066 0.9989930665413146473720559084446391440926 +#define FFTW_K999048221 0.9990482215818577624037162194033297553505 +#define FFTW_K999098966 0.9990989662046814723577027912279173440084 +#define FFTW_K999145758 0.9991457583873010291856105308946378568012 +#define FFTW_K999188998 0.9991889981715696377009069466390679555486 +#define FFTW_K999229036 0.9992290362407229347371262603414616252706 +#define FFTW_K999266181 0.9992661810508100203932244590995250044712 +#define FFTW_K999300704 0.9993007047883985526997800741767273557026 +#define FFTW_K999332848 0.9993328483702393720704821228710461134067 +#define FFTW_K999362825 0.9993628256569916913056650851375650424587 +#define FFTW_K999390827 0.9993908270190957300062434400439299644952 +#define FFTW_K999417022 0.9994170223661740289494017247549951505277 +#define FFTW_K999441563 0.9994415637302546063156399140856621311902 +#define FFTW_K999464587 0.9994645874763656444298364462428599458836 +#define FFTW_K999486216 0.9994862162006878676974893970113697242550 +#define FFTW_K999506560 0.9995065603657315570006908367092536671784 +#define FFTW_K999525719 0.9995257197133658746658464748330096458419 +#define FFTW_K999543784 0.9995437844895333725476836898291665684873 +#define FFTW_K999560836 0.9995608365087943494271135836565668351702 +#define FFTW_K999576950 0.9995769500822005769626607634052808295813 +#define FFTW_K999592192 0.9995921928281892296257285154349983157366 +#define FFTW_K999606626 0.9996066263830528855052742630847215222778 +#define FFTW_K999620307 0.9996203070249514057426708547796085483660 +#define FFTW_K999633286 0.9996332862232839494682650720821574004171 +#define FFTW_K999645611 0.9996456111234525767555760293242736879144 +#define FFTW_K999657324 0.9996573249755572800367608883676798759498 +#define FFTW_K999668467 0.9996684675143130940321877350828094000117 +#define FFTW_K999679075 0.9996790752964305212076609008127490933988 +#define FFTW_K999689182 0.9996891820008162841543067648951099180292 +#define FFTW_K999698818 0.9996988186962042201157656496661721968500 diff --git a/tests/apps/miniDFT/tests/src/kpoint_grid.f90 b/tests/apps/miniDFT/tests/src/kpoint_grid.f90 new file mode 100644 index 0000000000..f12c4b978e --- /dev/null +++ b/tests/apps/miniDFT/tests/src/kpoint_grid.f90 @@ -0,0 +1,313 @@ +! +! Copyright (C) 2001-2007 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +!----------------------------------------------------------------------- +SUBROUTINE kpoint_grid ( nrot, time_reversal, skip_equivalence, s, t_rev, & + bg, npk, k1,k2,k3, nk1,nk2,nk3, nks, xk, wk) +!----------------------------------------------------------------------- +! +! Automatic generation of a uniform grid of k-points +! + USE kinds, ONLY: DP + IMPLICIT NONE + ! + INTEGER, INTENT(in):: nrot, npk, k1, k2, k3, nk1, nk2, nk3, & + t_rev(48), s(3,3,48) + LOGICAL, INTENT(in):: time_reversal, skip_equivalence + real(DP), INTENT(in):: bg(3,3) + ! + INTEGER, INTENT(out) :: nks + real(DP), INTENT(out):: xk(3,npk) + real(DP), INTENT(out):: wk(npk) + ! LOCAL: + real(DP), PARAMETER :: eps=1.0d-5 + real(DP) :: xkr(3), fact, xx, yy, zz + real(DP), ALLOCATABLE:: xkg(:,:), wkk(:) + INTEGER :: nkr, i,j,k, ns, n, nk + INTEGER, ALLOCATABLE :: equiv(:) + LOGICAL :: in_the_list + ! + nkr=nk1*nk2*nk3 + ALLOCATE (xkg( 3,nkr),wkk(nkr)) + ALLOCATE (equiv( nkr)) + ! + DO i=1,nk1 + DO j=1,nk2 + DO k=1,nk3 + ! this is nothing but consecutive ordering + n = (k-1) + (j-1)*nk3 + (i-1)*nk2*nk3 + 1 + ! xkg are the components of the complete grid in crystal axis + xkg(1,n) = dble(i-1)/nk1 + dble(k1)/2/nk1 + xkg(2,n) = dble(j-1)/nk2 + dble(k2)/2/nk2 + xkg(3,n) = dble(k-1)/nk3 + dble(k3)/2/nk3 + ENDDO + ENDDO + ENDDO + + ! equiv(nk) =nk : k-point nk is not equivalent to any previous k-point + ! equiv(nk)!=nk : k-point nk is equivalent to k-point equiv(nk) + + DO nk=1,nkr + equiv(nk)=nk + ENDDO + + IF ( skip_equivalence ) THEN + CALL infomsg('kpoint_grid', 'ATTENTION: skip check of k-points equivalence') + wkk = 1.d0 + ELSE + DO nk=1,nkr + ! check if this k-point has already been found equivalent to another + IF (equiv(nk) == nk) THEN + wkk(nk) = 1.0d0 + ! check if there are equivalent k-point to this in the list + ! (excepted those previously found to be equivalent to another) + ! check both k and -k + DO ns=1,nrot + DO i=1,3 + xkr(i) = s(i,1,ns) * xkg(1,nk) & + + s(i,2,ns) * xkg(2,nk) & + + s(i,3,ns) * xkg(3,nk) + xkr(i) = xkr(i) - nint( xkr(i) ) + ENDDO + IF(t_rev(ns)==1) xkr = -xkr + xx = xkr(1)*nk1 - 0.5d0*k1 + yy = xkr(2)*nk2 - 0.5d0*k2 + zz = xkr(3)*nk3 - 0.5d0*k3 + in_the_list = abs(xx-nint(xx))<=eps .and. & + abs(yy-nint(yy))<=eps .and. & + abs(zz-nint(zz))<=eps + IF (in_the_list) THEN + i = mod ( nint ( xkr(1)*nk1 - 0.5d0*k1 + 2*nk1), nk1 ) + 1 + j = mod ( nint ( xkr(2)*nk2 - 0.5d0*k2 + 2*nk2), nk2 ) + 1 + k = mod ( nint ( xkr(3)*nk3 - 0.5d0*k3 + 2*nk3), nk3 ) + 1 + n = (k-1) + (j-1)*nk3 + (i-1)*nk2*nk3 + 1 + IF (n>nk .and. equiv(n)==n) THEN + equiv(n) = nk + wkk(nk)=wkk(nk)+1.0d0 + ELSE + IF (equiv(n)/=nk .or. nnk .and. equiv(n)==n) THEN + equiv(n) = nk + wkk(nk)=wkk(nk)+1.0d0 + ELSE + IF (equiv(n)/=nk.or.nnpk) CALL errore('kpoint_grid','too many k-points',1) + wk(nks) = wkk(nk) + fact = fact+wk(nks) + ! bring back into to the first BZ + DO i=1,3 + xk(i,nks) = xkg(i,nk)-nint(xkg(i,nk)) + ENDDO + ENDIF + ENDDO + ! go to cartesian axis (in units 2pi/a0) + CALL cryst_to_cart(nks,xk,bg,1) + ! normalize weights to one + DO nk=1,nks + wk(nk) = wk(nk)/fact + ENDDO + + DEALLOCATE(equiv) + DEALLOCATE(xkg,wkk) + + RETURN +END SUBROUTINE kpoint_grid +! +!----------------------------------------------------------------------- +SUBROUTINE tetrahedra ( nsym, s, time_reversal, t_rev, at, bg, npk, & + k1,k2,k3, nk1,nk2,nk3, nks, xk, wk, ntetra, tetra ) + !----------------------------------------------------------------------- + ! + ! Tetrahedron method according to P. E. Bloechl et al, PRB49, 16223 (1994) + ! + USE kinds, ONLY: DP + IMPLICIT NONE + ! + INTEGER, INTENT(IN):: nks, nsym, t_rev(48), s(3,3,48), npk, & + k1, k2, k3, nk1, nk2, nk3, ntetra + LOGICAL, INTENT (IN) :: time_reversal + real(DP), INTENT(IN) :: at(3,3), bg(3,3), xk(3,npk), wk(npk) + ! + INTEGER, INTENT(OUT) :: tetra(4,ntetra) + ! + real(DP) :: xkr(3), deltap(3), deltam(3) + real(DP), PARAMETER:: eps=1.0d-5 + real(DP), ALLOCATABLE :: xkg(:,:) + INTEGER :: nkr, i,j,k, ns, n, nk, ip1,jp1,kp1, & + n1,n2,n3,n4,n5,n6,n7,n8 + INTEGER, ALLOCATABLE:: equiv(:) + ! + ! Re-generate a uniform grid of k-points xkg + ! + nkr=nk1*nk2*nk3 + ! ntetra=6*nkr + ALLOCATE (xkg( 3,nkr)) + ALLOCATE (equiv( nkr)) +! + DO i=1,nk1 + DO j=1,nk2 + DO k=1,nk3 + ! this is nothing but consecutive ordering + n = (k-1) + (j-1)*nk3 + (i-1)*nk2*nk3 + 1 + ! xkg are the components of the complete grid in crystal axis + xkg(1,n) = dble(i-1)/nk1 + dble(k1)/2/nk1 + xkg(2,n) = dble(j-1)/nk2 + dble(k2)/2/nk2 + xkg(3,n) = dble(k-1)/nk3 + dble(k3)/2/nk3 + ENDDO + ENDDO + ENDDO + + ! locate k-points of the uniform grid in the list of irreducible k-points + ! that was previously calculated + + ! bring irreducible k-points to crystal axis + CALL cryst_to_cart (nks,xk,at,-1) + ! + DO nk=1,nkr + DO n=1,nks + DO ns=1,nsym + DO i=1,3 + xkr(i) = s(i,1,ns) * xk(1,n) + & + s(i,2,ns) * xk(2,n) + & + s(i,3,ns) * xk(3,n) + ENDDO + IF(t_rev(ns)==1) xkr = -xkr + ! xkr is the n-th irreducible k-point rotated wrt the ns-th symmetry + DO i=1,3 + deltap(i) = xkr(i)-xkg(i,nk) - nint (xkr(i)-xkg(i,nk) ) + deltam(i) = xkr(i)+xkg(i,nk) - nint (xkr(i)+xkg(i,nk) ) + ENDDO + ! deltap is the difference vector, brought back in the first BZ + ! deltam is the same but with k => -k (for time reversal) + IF ( sqrt ( deltap(1)**2 + & + deltap(2)**2 + & + deltap(3)**2 ) < eps .or. ( time_reversal .and. & + sqrt ( deltam(1)**2 + & + deltam(2)**2 + & + deltam(3)**2 ) < eps ) ) THEN + ! equivalent irreducible k-point found + equiv(nk) = n + GOTO 15 + ENDIF + ENDDO + ENDDO + ! equivalent irreducible k-point found - something wrong + CALL errore('tetrahedra','cannot locate k point',nk) +15 CONTINUE + ENDDO + + DO n=1,nks + DO nk=1,nkr + IF (equiv(nk)==n) GOTO 20 + ENDDO + ! this failure of the algorithm may indicate that the displaced grid + ! (with k1,k2,k3.ne.0) does not have the full symmetry of the lattice + CALL errore('tetrahedra','cannot remap grid on k-point list',n) +20 CONTINUE + ENDDO + + ! bring irreducible k-points back to cartesian axis + CALL cryst_to_cart (nks,xk,bg, 1) + + ! construct tetrahedra + + DO i=1,nk1 + DO j=1,nk2 + DO k=1,nk3 + ! n1-n8 are the indices of k-point 1-8 forming a cube + ip1 = mod(i,nk1)+1 + jp1 = mod(j,nk2)+1 + kp1 = mod(k,nk3)+1 + n1 = ( k-1) + ( j-1)*nk3 + ( i-1)*nk2*nk3 + 1 + n2 = ( k-1) + ( j-1)*nk3 + (ip1-1)*nk2*nk3 + 1 + n3 = ( k-1) + (jp1-1)*nk3 + ( i-1)*nk2*nk3 + 1 + n4 = ( k-1) + (jp1-1)*nk3 + (ip1-1)*nk2*nk3 + 1 + n5 = (kp1-1) + ( j-1)*nk3 + ( i-1)*nk2*nk3 + 1 + n6 = (kp1-1) + ( j-1)*nk3 + (ip1-1)*nk2*nk3 + 1 + n7 = (kp1-1) + (jp1-1)*nk3 + ( i-1)*nk2*nk3 + 1 + n8 = (kp1-1) + (jp1-1)*nk3 + (ip1-1)*nk2*nk3 + 1 + ! there are 6 tetrahedra per cube (and nk1*nk2*nk3 cubes) + n = 6 * ( (k-1) + (j-1)*nk3 + (i-1)*nk3*nk2 ) + + tetra (1,n+1) = equiv(n1) + tetra (2,n+1) = equiv(n2) + tetra (3,n+1) = equiv(n3) + tetra (4,n+1) = equiv(n6) + + tetra (1,n+2) = equiv(n2) + tetra (2,n+2) = equiv(n3) + tetra (3,n+2) = equiv(n4) + tetra (4,n+2) = equiv(n6) + + tetra (1,n+3) = equiv(n1) + tetra (2,n+3) = equiv(n3) + tetra (3,n+3) = equiv(n5) + tetra (4,n+3) = equiv(n6) + + tetra (1,n+4) = equiv(n3) + tetra (2,n+4) = equiv(n4) + tetra (3,n+4) = equiv(n6) + tetra (4,n+4) = equiv(n8) + + tetra (1,n+5) = equiv(n3) + tetra (2,n+5) = equiv(n6) + tetra (3,n+5) = equiv(n7) + tetra (4,n+5) = equiv(n8) + + tetra (1,n+6) = equiv(n3) + tetra (2,n+6) = equiv(n5) + tetra (3,n+6) = equiv(n6) + tetra (4,n+6) = equiv(n7) + ENDDO + ENDDO + ENDDO + + ! check + + DO n=1,ntetra + DO i=1,4 + IF ( tetra(i,n)<1 .or. tetra(i,n)>nks ) & + CALL errore ('tetrahedra','something wrong',n) + ENDDO + ENDDO + + DEALLOCATE(equiv) + DEALLOCATE(xkg) + + RETURN +END SUBROUTINE tetrahedra + diff --git a/tests/apps/miniDFT/tests/src/latgen.f90 b/tests/apps/miniDFT/tests/src/latgen.f90 new file mode 100644 index 0000000000..7822b740c9 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/latgen.f90 @@ -0,0 +1,346 @@ +! +! Copyright (C) 2001-2011 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +!------------------------------------------------------------------------- +subroutine latgen(ibrav,celldm,a1,a2,a3,omega) + !----------------------------------------------------------------------- + ! sets up the crystallographic vectors a1, a2, and a3. + ! + ! ibrav is the structure index: + ! 1 cubic P (sc) 8 orthorhombic P + ! 2 cubic F (fcc) 9 1-face (base) centered orthorhombic + ! 3 cubic I (bcc) 10 all face centered orthorhombic + ! 4 hexagonal and trigonal P 11 body centered orthorhombic + ! 5 trigonal R, 3-fold axis c 12 monoclinic P (unique axis: c) + ! 6 tetragonal P (st) 13 one face (base) centered monoclinic + ! 7 tetragonal I (bct) 14 triclinic P + ! Also accepted: + ! 0 "free" structure -12 monoclinic P (unique axis: b) + ! -5 trigonal R, threefold axis along (111) + ! -9 alternate description for base centered orthorhombic + ! + ! celldm are parameters which fix the shape of the unit cell + ! omega is the unit-cell volume + ! + ! NOTA BENE: all axis sets are right-handed + ! Boxes for US PPs do not work properly with left-handed axis + ! + use kinds, only: DP + implicit none + integer, intent(in) :: ibrav + real(DP), intent(inout) :: celldm(6) + real(DP), intent(inout) :: a1(3), a2(3), a3(3) + real(DP), intent(out) :: omega + ! + real(DP), parameter:: sr2 = 1.414213562373d0, & + sr3 = 1.732050807569d0 + integer :: i,j,k,l,iperm,ir + real(DP) :: term, cbya, s, term1, term2, singam, sen + ! + ! user-supplied lattice vectors + ! + if (ibrav == 0) then + if (SQRT( a1(1)**2 + a1(2)**2 + a1(3)**2 ) == 0 ) & + call errore ('latgen', 'wrong at for ibrav=0', 1) + if (SQRT( a2(1)**2 + a2(2)**2 + a2(3)**2 ) == 0 ) & + call errore ('latgen', 'wrong at for ibrav=0', 2) + if (SQRT( a3(1)**2 + a3(2)**2 + a3(3)**2 ) == 0 ) & + call errore ('latgen', 'wrong at for ibrav=0', 3) + + if ( celldm(1) /= 0.D0 ) then + ! + ! ... input at are in units of alat => convert them to a.u. + ! + a1(:) = a1(:) * celldm(1) + a2(:) = a2(:) * celldm(1) + a3(:) = a3(:) * celldm(1) + else + ! + ! ... input at are in atomic units: define celldm(1) from a1 + ! + celldm(1) = SQRT( a1(1)**2 + a1(2)**2 + a1(3)**2 ) + end if + ! + else + a1(:) = 0.d0 + a2(:) = 0.d0 + a3(:) = 0.d0 + end if + ! + if (celldm (1) <= 0.d0) call errore ('latgen', 'wrong celldm(1)', ibrav) + ! + ! index of bravais lattice supplied + ! + if (ibrav == 1) then + ! + ! simple cubic lattice + ! + a1(1)=celldm(1) + a2(2)=celldm(1) + a3(3)=celldm(1) + ! + else if (ibrav == 2) then + ! + ! fcc lattice + ! + term=celldm(1)/2.d0 + a1(1)=-term + a1(3)=term + a2(2)=term + a2(3)=term + a3(1)=-term + a3(2)=term + ! + else if (ibrav == 3) then + ! + ! bcc lattice + ! + term=celldm(1)/2.d0 + do ir=1,3 + a1(ir)=term + a2(ir)=term + a3(ir)=term + end do + a2(1)=-term + a3(1)=-term + a3(2)=-term + ! + else if (ibrav == 4) then + ! + ! hexagonal lattice + ! + if (celldm (3) <= 0.d0) call errore ('latgen', 'wrong celldm(3)', ibrav) + ! + cbya=celldm(3) + a1(1)=celldm(1) + a2(1)=-celldm(1)/2.d0 + a2(2)=celldm(1)*sr3/2.d0 + a3(3)=celldm(1)*cbya + ! + else if (ABS(ibrav) == 5) then + ! + ! trigonal lattice + ! + if (celldm (4) <= -0.5_dp .or. celldm (4) >= 1.0_dp) & + call errore ('latgen', 'wrong celldm(4)', ibrav) + ! + term1=sqrt(1.0_dp + 2.0_dp*celldm(4)) + term2=sqrt(1.0_dp - celldm(4)) + ! + IF ( ibrav == 5) THEN + ! threefold axis along c (001) + a2(2)=sr2*celldm(1)*term2/sr3 + a2(3)=celldm(1)*term1/sr3 + a1(1)=celldm(1)*term2/sr2 + a1(2)=-a1(1)/sr3 + a1(3)= a2(3) + a3(1)=-a1(1) + a3(2)= a1(2) + a3(3)= a2(3) + ELSE IF ( ibrav == -5) THEN + ! threefold axis along (111) + a1(1) = celldm(1)*(term1-2.0_dp*term2)/3.0_dp + a1(2) = celldm(1)*(term1+term2)/3.0_dp + a1(3) = a1(2) + a2(1) = a1(3) + a2(2) = a1(1) + a2(3) = a1(2) + a3(1) = a1(2) + a3(2) = a1(3) + a3(3) = a1(1) + END IF + else if (ibrav == 6) then + ! + ! tetragonal lattice + ! + if (celldm (3) <= 0.d0) call errore ('latgen', 'wrong celldm(3)', ibrav) + ! + cbya=celldm(3) + a1(1)=celldm(1) + a2(2)=celldm(1) + a3(3)=celldm(1)*cbya + ! + else if (ibrav == 7) then + ! + ! body centered tetragonal lattice + ! + if (celldm (3) <= 0.d0) call errore ('latgen', 'wrong celldm(3)', ibrav) + ! + cbya=celldm(3) + a2(1)=celldm(1)/2.d0 + a2(2)=a2(1) + a2(3)=cbya*celldm(1)/2.d0 + a1(1)= a2(1) + a1(2)=-a2(1) + a1(3)= a2(3) + a3(1)=-a2(1) + a3(2)=-a2(1) + a3(3)= a2(3) + ! + else if (ibrav == 8) then + ! + ! Simple orthorhombic lattice + ! + if (celldm (2) <= 0.d0) call errore ('latgen', 'wrong celldm(2)', ibrav) + if (celldm (3) <= 0.d0) call errore ('latgen', 'wrong celldm(3)', ibrav) + ! + a1(1)=celldm(1) + a2(2)=celldm(1)*celldm(2) + a3(3)=celldm(1)*celldm(3) + ! + else if ( ABS(ibrav) == 9) then + ! + ! One face (base) centered orthorhombic lattice + ! + if (celldm (2) <= 0.d0) call errore ('latgen', 'wrong celldm(2)', ibrav) + if (celldm (3) <= 0.d0) call errore ('latgen', 'wrong celldm(3)', ibrav) + ! + IF ( ibrav == 9 ) THEN + ! old PWscf description + a1(1) = 0.5d0 * celldm(1) + a1(2) = a1(1) * celldm(2) + a2(1) = - a1(1) + a2(2) = a1(2) + ELSE + ! alternate description + a1(1) = 0.5d0 * celldm(1) + a1(2) =-a1(1) * celldm(2) + a2(1) = a1(1) + a2(2) =-a1(2) + END IF + a3(3) = celldm(1) * celldm(3) + ! + else if (ibrav == 10) then + ! + ! All face centered orthorhombic lattice + ! + if (celldm (2) <= 0.d0) call errore ('latgen', 'wrong celldm(2)', ibrav) + if (celldm (3) <= 0.d0) call errore ('latgen', 'wrong celldm(3)', ibrav) + ! + a2(1) = 0.5d0 * celldm(1) + a2(2) = a2(1) * celldm(2) + a1(1) = a2(1) + a1(3) = a2(1) * celldm(3) + a3(2) = a2(1) * celldm(2) + a3(3) = a1(3) + ! + else if (ibrav == 11) then + ! + ! Body centered orthorhombic lattice + ! + if (celldm (2) <= 0.d0) call errore ('latgen', 'wrong celldm(2)', ibrav) + if (celldm (3) <= 0.d0) call errore ('latgen', 'wrong celldm(3)', ibrav) + ! + a1(1) = 0.5d0 * celldm(1) + a1(2) = a1(1) * celldm(2) + a1(3) = a1(1) * celldm(3) + a2(1) = - a1(1) + a2(2) = a1(2) + a2(3) = a1(3) + a3(1) = - a1(1) + a3(2) = - a1(2) + a3(3) = a1(3) + ! + else if (ibrav == 12) then + ! + ! Simple monoclinic lattice, unique (i.e. orthogonal to a) axis: c + ! + if (celldm (2) <= 0.d0) call errore ('latgen', 'wrong celldm(2)', ibrav) + if (celldm (3) <= 0.d0) call errore ('latgen', 'wrong celldm(3)', ibrav) + if (abs(celldm(4))>=1.d0) call errore ('latgen', 'wrong celldm(4)', ibrav) + ! + sen=sqrt(1.d0-celldm(4)**2) + a1(1)=celldm(1) + a2(1)=celldm(1)*celldm(2)*celldm(4) + a2(2)=celldm(1)*celldm(2)*sen + a3(3)=celldm(1)*celldm(3) + ! + else if (ibrav ==-12) then + ! + ! Simple monoclinic lattice, unique axis: b (more common) + ! + if (celldm (2) <= 0.d0) call errore ('latgen', 'wrong celldm(2)', ibrav) + if (celldm (3) <= 0.d0) call errore ('latgen', 'wrong celldm(3)', ibrav) + if (abs(celldm(5))>=1.d0) call errore ('latgen', 'wrong celldm(5)', ibrav) + ! + sen=sqrt(1.d0-celldm(5)**2) + a1(1)=celldm(1) + a2(2)=celldm(1)*celldm(2) + a3(1)=celldm(1)*celldm(3)*celldm(5) + a3(3)=celldm(1)*celldm(3)*sen + ! + else if (ibrav == 13) then + ! + ! One face centered monoclinic lattice + ! + if (celldm (2) <= 0.d0) call errore ('latgen', 'wrong celldm(2)', ibrav) + if (celldm (3) <= 0.d0) call errore ('latgen', 'wrong celldm(3)', ibrav) + if (abs(celldm(4))>=1.d0) call errore ('latgen', 'wrong celldm(4)', ibrav) + ! + sen = sqrt( 1.d0 - celldm(4) ** 2 ) + a1(1) = 0.5d0 * celldm(1) + a1(3) =-a1(1) * celldm(3) + a2(1) = celldm(1) * celldm(2) * celldm(4) + a2(2) = celldm(1) * celldm(2) * sen + a3(1) = a1(1) + a3(3) =-a1(3) + ! + else if (ibrav == 14) then + ! + ! Triclinic lattice + ! + if (celldm (2) <= 0.d0) call errore ('latgen', 'wrong celldm(2)', ibrav) + if (celldm (3) <= 0.d0) call errore ('latgen', 'wrong celldm(3)', ibrav) + if (abs(celldm(4))>=1.d0) call errore ('latgen', 'wrong celldm(4)', ibrav) + if (abs(celldm(5))>=1.d0) call errore ('latgen', 'wrong celldm(5)', ibrav) + if (abs(celldm(6))>=1.d0) call errore ('latgen', 'wrong celldm(6)', ibrav) + ! + singam=sqrt(1.d0-celldm(6)**2) + term= (1.d0+2.d0*celldm(4)*celldm(5)*celldm(6) & + -celldm(4)**2-celldm(5)**2-celldm(6)**2) + if (term < 0.d0) call errore & + ('latgen', 'celldm do not make sense, check your data', ibrav) + term= sqrt(term/(1.d0-celldm(6)**2)) + a1(1)=celldm(1) + a2(1)=celldm(1)*celldm(2)*celldm(6) + a2(2)=celldm(1)*celldm(2)*singam + a3(1)=celldm(1)*celldm(3)*celldm(5) + a3(2)=celldm(1)*celldm(3)*(celldm(4)-celldm(5)*celldm(6))/singam + a3(3)=celldm(1)*celldm(3)*term + ! + else + ! + call errore('latgen',' nonexistent bravais lattice',ibrav) + ! + end if + ! + ! calculate unit-cell volume omega + ! +100 omega=0.d0 + s=1.d0 + i=1 + j=2 + k=3 + ! +101 do iperm=1,3 + omega=omega+s*a1(i)*a2(j)*a3(k) + l=i + i=j + j=k + k=l + end do +! + i=2 + j=1 + k=3 + s=-s + if(s < 0.d0) go to 101 + omega=abs(omega) + return +! +end subroutine latgen diff --git a/tests/apps/miniDFT/tests/src/lchk_tauxk.f90 b/tests/apps/miniDFT/tests/src/lchk_tauxk.f90 new file mode 100644 index 0000000000..5d9d9ac78e --- /dev/null +++ b/tests/apps/miniDFT/tests/src/lchk_tauxk.f90 @@ -0,0 +1,54 @@ +! +! Copyright (C) 2001-2008 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +!----------------------------------------------------------------------- +subroutine check_atoms (nvec, vec, trmat) + !----------------------------------------------------------------------- + ! + ! This routine tests that the atomic coordinates (or k-points) + ! are different and not related by a lattice translation + ! + ! + USE kinds + implicit none + ! + integer, intent(in) :: nvec + ! nvec : number of atomic positions (or k-points) + real(DP), intent(in) :: vec (3, nvec), trmat (3, 3) + ! vec : cartesian coordinates of atomic positions (or k-points) + ! trmat: transformation matrix to crystal axis + ! ( = bg , basis of the real-space lattice, for atoms + ! = at , basis of the rec.-space lattice, for k-points ) + ! + integer :: nv1, nv2 + real(DP), allocatable :: vaux(:,:) + real(DP) :: zero (3) = 0.0_dp + character(len=30) :: message + logical, external :: eqvect + ! + ! Copy input positions and transform them to crystal units + ! + allocate ( vaux(3,nvec) ) + vaux = vec + call cryst_to_cart ( nvec, vaux, trmat, -1) + ! + ! Test that all the atomic positions (or k-points) are different + ! + do nv1 = 1, nvec-1 + do nv2 = nv1+1, nvec + if ( eqvect ( vaux (1,nv1), vaux (1,nv2), zero ) ) then + write (message,'("atoms #",i4," and #",i4," overlap!")') nv1, nv2 + call errore ( 'check_atoms', message, 1) + end if + enddo + enddo + ! + deallocate(vaux) + return +end subroutine check_atoms + diff --git a/tests/apps/miniDFT/tests/src/lsda_functionals.f90 b/tests/apps/miniDFT/tests/src/lsda_functionals.f90 new file mode 100644 index 0000000000..aa09834011 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/lsda_functionals.f90 @@ -0,0 +1,308 @@ +! +! Copyright (C) 2001-2009 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +!----------------------------------------------------------------------- +! +!----------------------------------------------------------------------- +subroutine pz_polarized (rs, ec, vc) + !----------------------------------------------------------------------- + ! J.P. Perdew and A. Zunger, PRB 23, 5048 (1981) + ! spin-polarized energy and potential + ! + USE kinds, ONLY : DP + implicit none + real(DP) :: rs, ec, vc + real(DP) :: a, b, c, d, gc, b1, b2 + parameter (a = 0.01555d0, b = - 0.0269d0, c = 0.0007d0, d = & + - 0.0048d0, gc = - 0.0843d0, b1 = 1.3981d0, b2 = 0.2611d0) + real(DP) :: lnrs, rs12, ox, dox + REAL(DP), PARAMETER :: xcprefact = 0.022575584d0, pi34 = 0.6203504908994d0 + ! REAL(DP) :: betha, etha, csi, prefact + ! + if (rs.lt.1.0d0) then + ! high density formula + lnrs = log (rs) + ec = a * lnrs + b + c * rs * lnrs + d * rs + vc = a * lnrs + (b - a / 3.d0) + 2.d0 / 3.d0 * c * rs * lnrs + & + (2.d0 * d-c) / 3.d0 * rs + else + ! interpolation formula + rs12 = sqrt (rs) + ox = 1.d0 + b1 * rs12 + b2 * rs + dox = 1.d0 + 7.d0 / 6.d0 * b1 * rs12 + 4.d0 / 3.d0 * b2 * rs + ec = gc / ox + vc = ec * dox / ox + endif + ! +! IF ( lxc_rel ) THEN +! betha = prefact * pi34 / rs +! etha = DSQRT( 1 + betha**2 ) +! csi = betha + etha +! prefact = 1.0D0 - (3.0D0/2.0D0) * ( (betha*etha - log(csi))/betha**2 )**2 +! ec = ec * prefact +! vc = vc * prefact +! ENDIF + return +end subroutine pz_polarized +! +!----------------------------------------------------------------------- +subroutine pz_spin (rs, zeta, ec, vcup, vcdw) + !----------------------------------------------------------------------- + ! J.P. Perdew and Y. Wang, PRB 45, 13244 (1992) + ! + USE kinds, ONLY : DP + implicit none + real(DP) :: rs, zeta, ec, vcup, vcdw + ! + real(DP) :: ecu, vcu, ecp, vcp, fz, dfz + real(DP) :: p43, third + parameter (p43 = 4.0d0 / 3.d0, third = 1.d0 / 3.d0) + ! + ! unpolarized part (Perdew-Zunger formula) + call pz (rs, 1, ecu, vcu) + ! polarization contribution + call pz_polarized (rs, ecp, vcp) + ! + fz = ( (1.0d0 + zeta) **p43 + (1.d0 - zeta) **p43 - 2.d0) / & + (2.d0**p43 - 2.d0) + dfz = p43 * ( (1.0d0 + zeta) **third- (1.d0 - zeta) **third) & + / (2.d0**p43 - 2.d0) + ! + ec = ecu + fz * (ecp - ecu) + vcup = vcu + fz * (vcp - vcu) + (ecp - ecu) * dfz * (1.d0 - zeta) + vcdw = vcu + fz * (vcp - vcu) + (ecp - ecu) * dfz * ( - 1.d0 - & + zeta) + ! + return +end subroutine pz_spin +! +!--------- + +!----------------------------------------------------------------------- +subroutine pw_spin (rs, zeta, ec, vcup, vcdw) + !----------------------------------------------------------------------- + ! J.P. Perdew and Y. Wang, PRB 45, 13244 (1992) + ! + USE kinds, ONLY : DP + implicit none + real(DP) :: rs, zeta, ec, vcup, vcdw + ! xc parameters, unpolarised + real(DP) :: a, a1, b1, b2, b3, b4, c0, c1, c2, c3, d0, d1 + parameter (a = 0.031091d0, a1 = 0.21370d0, b1 = 7.5957d0, b2 = & + 3.5876d0, b3 = 1.6382d0, b4 = 0.49294d0, c0 = a, c1 = 0.046644d0, & + c2 = 0.00664d0, c3 = 0.01043d0, d0 = 0.4335d0, d1 = 1.4408d0) + ! xc parameters, polarised + real(DP) :: ap, a1p, b1p, b2p, b3p, b4p, c0p, c1p, c2p, c3p, d0p, & + d1p + parameter (ap = 0.015545d0, a1p = 0.20548d0, b1p = 14.1189d0, b2p & + = 6.1977d0, b3p = 3.3662d0, b4p = 0.62517d0, c0p = ap, c1p = & + 0.025599d0, c2p = 0.00319d0, c3p = 0.00384d0, d0p = 0.3287d0, d1p & + = 1.7697d0) + ! xc parameters, antiferro + real(DP) :: aa, a1a, b1a, b2a, b3a, b4a, c0a, c1a, c2a, c3a, d0a, & + d1a + parameter (aa = 0.016887d0, a1a = 0.11125d0, b1a = 10.357d0, b2a = & + 3.6231d0, b3a = 0.88026d0, b4a = 0.49671d0, c0a = aa, c1a = & + 0.035475d0, c2a = 0.00188d0, c3a = 0.00521d0, d0a = 0.2240d0, d1a & + = 0.3969d0) + real(DP) :: fz0 + parameter (fz0 = 1.709921d0) + real(DP) :: rs12, rs32, rs2, zeta2, zeta3, zeta4, fz, dfz + real(DP) :: om, dom, olog, epwc, vpwc + real(DP) :: omp, domp, ologp, epwcp, vpwcp + real(DP) :: oma, doma, ologa, alpha, vpwca + ! + ! if(rs.lt.0.5d0) then + ! high density formula (not implemented) + ! + ! else if(rs.gt.100.d0) then + ! low density formula (not implemented) + ! + ! else + ! interpolation formula + zeta2 = zeta * zeta + zeta3 = zeta2 * zeta + zeta4 = zeta3 * zeta + rs12 = sqrt (rs) + rs32 = rs * rs12 + rs2 = rs**2 + ! unpolarised + om = 2.d0 * a * (b1 * rs12 + b2 * rs + b3 * rs32 + b4 * rs2) + dom = 2.d0 * a * (0.5d0 * b1 * rs12 + b2 * rs + 1.5d0 * b3 * rs32 & + + 2.d0 * b4 * rs2) + olog = log (1.d0 + 1.0d0 / om) + epwc = - 2.d0 * a * (1.d0 + a1 * rs) * olog + vpwc = - 2.d0 * a * (1.d0 + 2.d0 / 3.d0 * a1 * rs) * olog - 2.d0 / & + 3.d0 * a * (1.d0 + a1 * rs) * dom / (om * (om + 1.d0) ) + ! polarized + omp = 2.d0 * ap * (b1p * rs12 + b2p * rs + b3p * rs32 + b4p * rs2) + domp = 2.d0 * ap * (0.5d0 * b1p * rs12 + b2p * rs + 1.5d0 * b3p * & + rs32 + 2.d0 * b4p * rs2) + ologp = log (1.d0 + 1.0d0 / omp) + epwcp = - 2.d0 * ap * (1.d0 + a1p * rs) * ologp + vpwcp = - 2.d0 * ap * (1.d0 + 2.d0 / 3.d0 * a1p * rs) * ologp - & + 2.d0 / 3.d0 * ap * (1.d0 + a1p * rs) * domp / (omp * (omp + 1.d0) & + ) + ! antiferro + oma = 2.d0 * aa * (b1a * rs12 + b2a * rs + b3a * rs32 + b4a * rs2) + doma = 2.d0 * aa * (0.5d0 * b1a * rs12 + b2a * rs + 1.5d0 * b3a * & + rs32 + 2.d0 * b4a * rs2) + ologa = log (1.d0 + 1.0d0 / oma) + alpha = 2.d0 * aa * (1.d0 + a1a * rs) * ologa + vpwca = + 2.d0 * aa * (1.d0 + 2.d0 / 3.d0 * a1a * rs) * ologa + & + 2.d0 / 3.d0 * aa * (1.d0 + a1a * rs) * doma / (oma * (oma + 1.d0) & + ) + ! + fz = ( (1.d0 + zeta) ** (4.d0 / 3.d0) + (1.d0 - zeta) ** (4.d0 / & + 3.d0) - 2.d0) / (2.d0** (4.d0 / 3.d0) - 2.d0) + dfz = ( (1.d0 + zeta) ** (1.d0 / 3.d0) - (1.d0 - zeta) ** (1.d0 / & + 3.d0) ) * 4.d0 / (3.d0 * (2.d0** (4.d0 / 3.d0) - 2.d0) ) + ! + ec = epwc + alpha * fz * (1.d0 - zeta4) / fz0 + (epwcp - epwc) & + * fz * zeta4 + ! + vcup = vpwc + vpwca * fz * (1.d0 - zeta4) / fz0 + (vpwcp - vpwc) & + * fz * zeta4 + (alpha / fz0 * (dfz * (1.d0 - zeta4) - 4.d0 * fz * & + zeta3) + (epwcp - epwc) * (dfz * zeta4 + 4.d0 * fz * zeta3) ) & + * (1.d0 - zeta) + + vcdw = vpwc + vpwca * fz * (1.d0 - zeta4) / fz0 + (vpwcp - vpwc) & + * fz * zeta4 - (alpha / fz0 * (dfz * (1.d0 - zeta4) - 4.d0 * fz * & + zeta3) + (epwcp - epwc) * (dfz * zeta4 + 4.d0 * fz * zeta3) ) & + * (1.d0 + zeta) + ! endif + ! + return +end subroutine pw_spin +! +!--------------------------------------------------------------- +subroutine pbec_spin (rho, zeta, grho, iflag, sc, v1cup, v1cdw, v2c) + !--------------------------------------------------------------- + ! + ! PBE correlation (without LDA part) - spin-polarized + ! iflag = 1: J.P.Perdew, K.Burke, M.Ernzerhof, PRL 77, 3865 (1996). + ! iflag = 2: J.P.Perdew et al., PRL 100, 136406 (2008) + ! + USE kinds, ONLY : DP + implicit none + integer, intent(in) :: iflag + real(DP) :: rho, zeta, grho, sc, v1cup, v1cdw, v2c + real(DP) :: ga, be(2) + parameter (ga = 0.031091d0) + data be / 0.066725d0 , 0.046d0 / + real(DP) :: third, pi34, xkf, xks + parameter (third = 1.d0 / 3.d0, pi34 = 0.6203504908994d0) + parameter (xkf = 1.919158292677513d0, xks = 1.128379167095513d0) + ! pi34=(3/4pi)^(1/3), xkf=(9 pi/4)^(1/3), xks= sqrt(4/pi) + real(DP) :: kf, ks, rs, ec, vcup, vcdw, t, expe, af, y, xy, qy, & + s1, h0, ddh0 + real(DP) :: fz, fz2, fz3, fz4, dfz, bfup, bfdw, dh0up, dh0dw, & + dh0zup, dh0zdw + ! + rs = pi34 / rho**third + call pw_spin (rs, zeta, ec, vcup, vcdw) + kf = xkf / rs + ks = xks * sqrt (kf) + fz = 0.5d0 * ( (1.d0 + zeta) ** (2.d0 / 3.d0) + (1.d0 - zeta) ** ( & + 2.d0 / 3.d0) ) + fz2 = fz * fz + fz3 = fz2 * fz + fz4 = fz3 * fz + dfz = ( (1.d0 + zeta) ** ( - 1.d0 / 3.d0) - (1.d0 - zeta) ** ( - & + 1.d0 / 3.d0) ) / 3.d0 + t = sqrt (grho) / (2.d0 * fz * ks * rho) + expe = exp ( - ec / (fz3 * ga) ) + af = be(iflag) / ga * (1.d0 / (expe-1.d0) ) + bfup = expe * (vcup - ec) / fz3 + bfdw = expe * (vcdw - ec) / fz3 + y = af * t * t + xy = (1.d0 + y) / (1.d0 + y + y * y) + qy = y * y * (2.d0 + y) / (1.d0 + y + y * y) **2 + s1 = 1.d0 + be(iflag) / ga * t * t * xy + h0 = fz3 * ga * log (s1) + dh0up = be(iflag) * t * t * fz3 / s1 * ( - 7.d0 / 3.d0 * xy - qy * & + (af * bfup / be(iflag)-7.d0 / 3.d0) ) + dh0dw = be(iflag) * t * t * fz3 / s1 * ( - 7.d0 / 3.d0 * xy - qy * & + (af * bfdw / be(iflag)-7.d0 / 3.d0) ) + dh0zup = (3.d0 * h0 / fz - be(iflag) * t * t * fz2 / s1 * (2.d0 * xy - & + qy * (3.d0 * af * expe * ec / fz3 / be(iflag)+2.d0) ) ) * dfz * (1.d0 - zeta) + dh0zdw = - (3.d0 * h0 / fz - be(iflag) * t * t * fz2 / s1 * (2.d0 * xy - & + qy * (3.d0 * af * expe * ec / fz3 / be(iflag)+2.d0) ) ) * dfz * (1.d0 + zeta) + + ddh0 = be(iflag) * fz / (2.d0 * ks * ks * rho) * (xy - qy) / s1 + sc = rho * h0 + v1cup = h0 + dh0up + dh0zup + v1cdw = h0 + dh0dw + dh0zdw + v2c = ddh0 + return +end subroutine pbec_spin +! +!----------------------------------------------------------------------- +subroutine slater_spin (rho, zeta, ex, vxup, vxdw) + !----------------------------------------------------------------------- + ! Slater exchange with alpha=2/3, spin-polarized case + ! + USE kinds, ONLY : DP + implicit none + real(DP) :: rho, zeta, ex, vxup, vxdw + real(DP) :: f, alpha, third, p43 + parameter (f = - 1.10783814957303361d0, alpha = 2.0d0 / 3.0d0) + ! f = -9/8*(3/pi)^(1/3) + parameter (third = 1.d0 / 3.d0, p43 = 4.d0 / 3.d0) + real(DP) :: exup, exdw, rho13 + ! + rho13 = ( (1.d0 + zeta) * rho) **third + exup = f * alpha * rho13 + vxup = p43 * f * alpha * rho13 + rho13 = ( (1.d0 - zeta) * rho) **third + exdw = f * alpha * rho13 + vxdw = p43 * f * alpha * rho13 + ex = 0.5d0 * ( (1.d0 + zeta) * exup + (1.d0 - zeta) * exdw) + ! + return +end subroutine slater_spin + +! +!----------------------------------------------------------------------- +function dpz_polarized (rs, iflg) + !----------------------------------------------------------------------- + ! derivative of the correlation potential with respect to local density + ! Perdew and Zunger parameterization of the Ceperley-Alder functional + ! spin-polarized case + ! + USE kinds, only : DP + USE constants, ONLY : pi, fpi + ! + implicit none + ! + real(DP), intent (in) :: rs + integer, intent(in) :: iflg + real(DP) :: dpz_polarized + ! + ! local variables + ! a,b,c,d,gc,b1,b2 are the parameters defining the functional + ! + real(DP), parameter :: a = 0.01555d0, b = -0.0269d0, c = 0.0007d0, & + d = -0.0048d0, gc = -0.0843d0, b1 = 1.3981d0, b2 = 0.2611d0,& + a1 = 7.0d0 * b1 / 6.d0, a2 = 4.d0 * b2 / 3.d0 + real(DP) :: x, den, dmx, dmrs + ! + ! + if (iflg == 1) then + dmrs = a / rs + 2.d0 / 3.d0 * c * (log (rs) + 1.d0) + & + (2.d0 * d-c) / 3.d0 + else + x = sqrt (rs) + den = 1.d0 + x * (b1 + x * b2) + dmx = gc * ( (a1 + 2.d0 * a2 * x) * den - 2.d0 * (b1 + 2.d0 * & + b2 * x) * (1.d0 + x * (a1 + x * a2) ) ) / den**3 + dmrs = 0.5d0 * dmx / x + endif + ! + dpz_polarized = - fpi * rs**4.d0 / 9.d0 * dmrs + return + ! +end function dpz_polarized diff --git a/tests/apps/miniDFT/tests/src/matches.f90 b/tests/apps/miniDFT/tests/src/matches.f90 new file mode 100644 index 0000000000..2fe1f75435 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/matches.f90 @@ -0,0 +1,101 @@ +! +! Copyright (C) 2001-2004 Carlo Cavazzoni and PWSCF group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +!----------------------------------------------------------------------- +FUNCTION matches( string1, string2 ) + !----------------------------------------------------------------------- + ! + ! ... .TRUE. if string1 is contained in string2, .FALSE. otherwise + ! + IMPLICIT NONE + ! + CHARACTER (LEN=*), INTENT(IN) :: string1, string2 + LOGICAL :: matches + INTEGER :: len1, len2, l + ! + ! + len1 = LEN_TRIM( string1 ) + len2 = LEN_TRIM( string2 ) + ! + DO l = 1, ( len2 - len1 + 1 ) + ! + IF ( string1(1:len1) == string2(l:(l+len1-1)) ) THEN + ! + matches = .TRUE. + ! + RETURN + ! + END IF + ! + END DO + ! + matches = .FALSE. + ! + RETURN + ! +END FUNCTION matches +! +!----------------------------------------------------------------------- +FUNCTION imatches( string1, string2 ) + !----------------------------------------------------------------------- + ! + ! ... .TRUE. if string1 is contained in string2, .FALSE. otherwise + ! *** case insensitive *** + ! + IMPLICIT NONE + ! + CHARACTER (LEN=*), INTENT(IN) :: string1, string2 + CHARACTER(LEN=len(string1)) :: aux1 + CHARACTER(LEN=len(string2)) :: aux2 + CHARACTER(LEN=1) :: lowercase + LOGICAL :: imatches + LOGICAL, EXTERNAL :: matches + INTEGER :: i + ! + aux1 = string1 + aux2 = string2 + ! + do i=1,len(aux1) + aux1(i:i)=lowercase(aux1(i:i)) + enddo + do i=1,len(aux2) + aux2(i:i)=lowercase(aux2(i:i)) + enddo + ! + imatches = matches(aux1, aux2) + ! + RETURN + ! +END FUNCTION imatches +! +!----------------------------------------------------------------------- +SUBROUTINE remove_comments_from_string( string ) + !----------------------------------------------------------------------- + ! + ! chop string removing everything after an esclamation mark (!) + ! + IMPLICIT NONE + ! + CHARACTER (LEN=*), INTENT(INOUT) :: string + INTEGER :: len, l + ! + ! + len = LEN_TRIM( string ) + ! + l=1 + DO WHILE ( string(l:l) /= "!" ) + l = l + 1 + if (l == len+1) EXIT + END DO + len = l-1 + ! + string = string(1:len) + ! + RETURN + ! +END SUBROUTINE remove_comments_from_string +! diff --git a/tests/apps/miniDFT/tests/src/md5.c b/tests/apps/miniDFT/tests/src/md5.c new file mode 100644 index 0000000000..f24262c15d --- /dev/null +++ b/tests/apps/miniDFT/tests/src/md5.c @@ -0,0 +1,388 @@ +/* + Copyright (C) 1999, 2000, 2002 Aladdin Enterprises. All rights reserved. + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + L. Peter Deutsch + ghost@aladdin.com + + */ +/* $Id: md5.c,v 1.1 2010-08-13 10:50:08 degironc Exp $ */ +/* + Independent implementation of MD5 (RFC 1321). + + This code implements the MD5 Algorithm defined in RFC 1321, whose + text is available at + http://www.ietf.org/rfc/rfc1321.txt + The code is derived from the text of the RFC, including the test suite + (section A.5) but excluding the rest of Appendix A. It does not include + any code or documentation that is identified in the RFC as being + copyrighted. + + The original and principal author of md5.c is L. Peter Deutsch + . Other authors are noted in the change history + that follows (in reverse chronological order): + + 2002-04-13 lpd Clarified derivation from RFC 1321; now handles byte order + either statically or dynamically; added missing #include + in library. + 2002-03-11 lpd Corrected argument list for main(), and added int return + type, in test program and T value program. + 2002-02-21 lpd Added missing #include in test program. + 2000-07-03 lpd Patched to eliminate warnings about "constant is + unsigned in ANSI C, signed in traditional"; made test program + self-checking. + 1999-11-04 lpd Edited comments slightly for automatic TOC extraction. + 1999-10-18 lpd Fixed typo in header comment (ansi2knr rather than md5). + 1999-05-03 lpd Original version. + */ + +#include "md5.h" +#include +#include +#include +#include +#include +#include +#include + +#undef BYTE_ORDER /* 1 = big-endian, -1 = little-endian, 0 = unknown */ +#ifdef ARCH_IS_BIG_ENDIAN +# define BYTE_ORDER (ARCH_IS_BIG_ENDIAN ? 1 : -1) +#else +# define BYTE_ORDER 0 +#endif + +#define T_MASK ((md5_word_t)~0) +#define T1 /* 0xd76aa478 */ (T_MASK ^ 0x28955b87) +#define T2 /* 0xe8c7b756 */ (T_MASK ^ 0x173848a9) +#define T3 0x242070db +#define T4 /* 0xc1bdceee */ (T_MASK ^ 0x3e423111) +#define T5 /* 0xf57c0faf */ (T_MASK ^ 0x0a83f050) +#define T6 0x4787c62a +#define T7 /* 0xa8304613 */ (T_MASK ^ 0x57cfb9ec) +#define T8 /* 0xfd469501 */ (T_MASK ^ 0x02b96afe) +#define T9 0x698098d8 +#define T10 /* 0x8b44f7af */ (T_MASK ^ 0x74bb0850) +#define T11 /* 0xffff5bb1 */ (T_MASK ^ 0x0000a44e) +#define T12 /* 0x895cd7be */ (T_MASK ^ 0x76a32841) +#define T13 0x6b901122 +#define T14 /* 0xfd987193 */ (T_MASK ^ 0x02678e6c) +#define T15 /* 0xa679438e */ (T_MASK ^ 0x5986bc71) +#define T16 0x49b40821 +#define T17 /* 0xf61e2562 */ (T_MASK ^ 0x09e1da9d) +#define T18 /* 0xc040b340 */ (T_MASK ^ 0x3fbf4cbf) +#define T19 0x265e5a51 +#define T20 /* 0xe9b6c7aa */ (T_MASK ^ 0x16493855) +#define T21 /* 0xd62f105d */ (T_MASK ^ 0x29d0efa2) +#define T22 0x02441453 +#define T23 /* 0xd8a1e681 */ (T_MASK ^ 0x275e197e) +#define T24 /* 0xe7d3fbc8 */ (T_MASK ^ 0x182c0437) +#define T25 0x21e1cde6 +#define T26 /* 0xc33707d6 */ (T_MASK ^ 0x3cc8f829) +#define T27 /* 0xf4d50d87 */ (T_MASK ^ 0x0b2af278) +#define T28 0x455a14ed +#define T29 /* 0xa9e3e905 */ (T_MASK ^ 0x561c16fa) +#define T30 /* 0xfcefa3f8 */ (T_MASK ^ 0x03105c07) +#define T31 0x676f02d9 +#define T32 /* 0x8d2a4c8a */ (T_MASK ^ 0x72d5b375) +#define T33 /* 0xfffa3942 */ (T_MASK ^ 0x0005c6bd) +#define T34 /* 0x8771f681 */ (T_MASK ^ 0x788e097e) +#define T35 0x6d9d6122 +#define T36 /* 0xfde5380c */ (T_MASK ^ 0x021ac7f3) +#define T37 /* 0xa4beea44 */ (T_MASK ^ 0x5b4115bb) +#define T38 0x4bdecfa9 +#define T39 /* 0xf6bb4b60 */ (T_MASK ^ 0x0944b49f) +#define T40 /* 0xbebfbc70 */ (T_MASK ^ 0x4140438f) +#define T41 0x289b7ec6 +#define T42 /* 0xeaa127fa */ (T_MASK ^ 0x155ed805) +#define T43 /* 0xd4ef3085 */ (T_MASK ^ 0x2b10cf7a) +#define T44 0x04881d05 +#define T45 /* 0xd9d4d039 */ (T_MASK ^ 0x262b2fc6) +#define T46 /* 0xe6db99e5 */ (T_MASK ^ 0x1924661a) +#define T47 0x1fa27cf8 +#define T48 /* 0xc4ac5665 */ (T_MASK ^ 0x3b53a99a) +#define T49 /* 0xf4292244 */ (T_MASK ^ 0x0bd6ddbb) +#define T50 0x432aff97 +#define T51 /* 0xab9423a7 */ (T_MASK ^ 0x546bdc58) +#define T52 /* 0xfc93a039 */ (T_MASK ^ 0x036c5fc6) +#define T53 0x655b59c3 +#define T54 /* 0x8f0ccc92 */ (T_MASK ^ 0x70f3336d) +#define T55 /* 0xffeff47d */ (T_MASK ^ 0x00100b82) +#define T56 /* 0x85845dd1 */ (T_MASK ^ 0x7a7ba22e) +#define T57 0x6fa87e4f +#define T58 /* 0xfe2ce6e0 */ (T_MASK ^ 0x01d3191f) +#define T59 /* 0xa3014314 */ (T_MASK ^ 0x5cfebceb) +#define T60 0x4e0811a1 +#define T61 /* 0xf7537e82 */ (T_MASK ^ 0x08ac817d) +#define T62 /* 0xbd3af235 */ (T_MASK ^ 0x42c50dca) +#define T63 0x2ad7d2bb +#define T64 /* 0xeb86d391 */ (T_MASK ^ 0x14792c6e) + + +static void +md5_process(md5_state_t *pms, const md5_byte_t *data /*[64]*/) +{ + md5_word_t + a = pms->abcd[0], b = pms->abcd[1], + c = pms->abcd[2], d = pms->abcd[3]; + md5_word_t t; +#if BYTE_ORDER > 0 + /* Define storage only for big-endian CPUs. */ + md5_word_t X[16]; +#else + /* Define storage for little-endian or both types of CPUs. */ + md5_word_t xbuf[16]; + const md5_word_t *X; +#endif + + { +#if BYTE_ORDER == 0 + /* + * Determine dynamically whether this is a big-endian or + * little-endian machine, since we can use a more efficient + * algorithm on the latter. + */ + static const int w = 1; + + if (*((const md5_byte_t *)&w)) /* dynamic little-endian */ +#endif +#if BYTE_ORDER <= 0 /* little-endian */ + { + /* + * On little-endian machines, we can process properly aligned + * data without copying it. + */ + if (!((data - (const md5_byte_t *)0) & 3)) { + /* data are properly aligned */ + X = (const md5_word_t *)data; + } else { + /* not aligned */ + memcpy(xbuf, data, 64); + X = xbuf; + } + } +#endif +#if BYTE_ORDER == 0 + else /* dynamic big-endian */ +#endif +#if BYTE_ORDER >= 0 /* big-endian */ + { + /* + * On big-endian machines, we must arrange the bytes in the + * right order. + */ + const md5_byte_t *xp = data; + int i; + +# if BYTE_ORDER == 0 + X = xbuf; /* (dynamic only) */ +# else +# define xbuf X /* (static only) */ +# endif + for (i = 0; i < 16; ++i, xp += 4) + xbuf[i] = xp[0] + (xp[1] << 8) + (xp[2] << 16) + (xp[3] << 24); + } +#endif + } + +#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32 - (n)))) + + /* Round 1. */ + /* Let [abcd k s i] denote the operation + a = b + ((a + F(b,c,d) + X[k] + T[i]) <<< s). */ +#define F(x, y, z) (((x) & (y)) | (~(x) & (z))) +#define SET(a, b, c, d, k, s, Ti)\ + t = a + F(b,c,d) + X[k] + Ti;\ + a = ROTATE_LEFT(t, s) + b + /* Do the following 16 operations. */ + SET(a, b, c, d, 0, 7, T1); + SET(d, a, b, c, 1, 12, T2); + SET(c, d, a, b, 2, 17, T3); + SET(b, c, d, a, 3, 22, T4); + SET(a, b, c, d, 4, 7, T5); + SET(d, a, b, c, 5, 12, T6); + SET(c, d, a, b, 6, 17, T7); + SET(b, c, d, a, 7, 22, T8); + SET(a, b, c, d, 8, 7, T9); + SET(d, a, b, c, 9, 12, T10); + SET(c, d, a, b, 10, 17, T11); + SET(b, c, d, a, 11, 22, T12); + SET(a, b, c, d, 12, 7, T13); + SET(d, a, b, c, 13, 12, T14); + SET(c, d, a, b, 14, 17, T15); + SET(b, c, d, a, 15, 22, T16); +#undef SET + + /* Round 2. */ + /* Let [abcd k s i] denote the operation + a = b + ((a + G(b,c,d) + X[k] + T[i]) <<< s). */ +#define G(x, y, z) (((x) & (z)) | ((y) & ~(z))) +#define SET(a, b, c, d, k, s, Ti)\ + t = a + G(b,c,d) + X[k] + Ti;\ + a = ROTATE_LEFT(t, s) + b + /* Do the following 16 operations. */ + SET(a, b, c, d, 1, 5, T17); + SET(d, a, b, c, 6, 9, T18); + SET(c, d, a, b, 11, 14, T19); + SET(b, c, d, a, 0, 20, T20); + SET(a, b, c, d, 5, 5, T21); + SET(d, a, b, c, 10, 9, T22); + SET(c, d, a, b, 15, 14, T23); + SET(b, c, d, a, 4, 20, T24); + SET(a, b, c, d, 9, 5, T25); + SET(d, a, b, c, 14, 9, T26); + SET(c, d, a, b, 3, 14, T27); + SET(b, c, d, a, 8, 20, T28); + SET(a, b, c, d, 13, 5, T29); + SET(d, a, b, c, 2, 9, T30); + SET(c, d, a, b, 7, 14, T31); + SET(b, c, d, a, 12, 20, T32); +#undef SET + + /* Round 3. */ + /* Let [abcd k s t] denote the operation + a = b + ((a + H(b,c,d) + X[k] + T[i]) <<< s). */ +#define H(x, y, z) ((x) ^ (y) ^ (z)) +#define SET(a, b, c, d, k, s, Ti)\ + t = a + H(b,c,d) + X[k] + Ti;\ + a = ROTATE_LEFT(t, s) + b + /* Do the following 16 operations. */ + SET(a, b, c, d, 5, 4, T33); + SET(d, a, b, c, 8, 11, T34); + SET(c, d, a, b, 11, 16, T35); + SET(b, c, d, a, 14, 23, T36); + SET(a, b, c, d, 1, 4, T37); + SET(d, a, b, c, 4, 11, T38); + SET(c, d, a, b, 7, 16, T39); + SET(b, c, d, a, 10, 23, T40); + SET(a, b, c, d, 13, 4, T41); + SET(d, a, b, c, 0, 11, T42); + SET(c, d, a, b, 3, 16, T43); + SET(b, c, d, a, 6, 23, T44); + SET(a, b, c, d, 9, 4, T45); + SET(d, a, b, c, 12, 11, T46); + SET(c, d, a, b, 15, 16, T47); + SET(b, c, d, a, 2, 23, T48); +#undef SET + + /* Round 4. */ + /* Let [abcd k s t] denote the operation + a = b + ((a + I(b,c,d) + X[k] + T[i]) <<< s). */ +#define I(x, y, z) ((y) ^ ((x) | ~(z))) +#define SET(a, b, c, d, k, s, Ti)\ + t = a + I(b,c,d) + X[k] + Ti;\ + a = ROTATE_LEFT(t, s) + b + /* Do the following 16 operations. */ + SET(a, b, c, d, 0, 6, T49); + SET(d, a, b, c, 7, 10, T50); + SET(c, d, a, b, 14, 15, T51); + SET(b, c, d, a, 5, 21, T52); + SET(a, b, c, d, 12, 6, T53); + SET(d, a, b, c, 3, 10, T54); + SET(c, d, a, b, 10, 15, T55); + SET(b, c, d, a, 1, 21, T56); + SET(a, b, c, d, 8, 6, T57); + SET(d, a, b, c, 15, 10, T58); + SET(c, d, a, b, 6, 15, T59); + SET(b, c, d, a, 13, 21, T60); + SET(a, b, c, d, 4, 6, T61); + SET(d, a, b, c, 11, 10, T62); + SET(c, d, a, b, 2, 15, T63); + SET(b, c, d, a, 9, 21, T64); +#undef SET + + /* Then perform the following additions. (That is increment each + of the four registers by the value it had before this block + was started.) */ + pms->abcd[0] += a; + pms->abcd[1] += b; + pms->abcd[2] += c; + pms->abcd[3] += d; +} + +void +md5_init(md5_state_t *pms) +{ + pms->count[0] = pms->count[1] = 0; + pms->abcd[0] = 0x67452301; + pms->abcd[1] = /*0xefcdab89*/ T_MASK ^ 0x10325476; + pms->abcd[2] = /*0x98badcfe*/ T_MASK ^ 0x67452301; + pms->abcd[3] = 0x10325476; +} + +void +md5_append(md5_state_t *pms, const md5_byte_t *data, int nbytes) +{ + const md5_byte_t *p = data; + int left = nbytes; + int offset = (pms->count[0] >> 3) & 63; + md5_word_t nbits = (md5_word_t)(nbytes << 3); + + if (nbytes <= 0) + return; + + /* Update the message length. */ + pms->count[1] += nbytes >> 29; + pms->count[0] += nbits; + if (pms->count[0] < nbits) + pms->count[1]++; + + /* Process an initial partial block. */ + if (offset) { + int copy = (offset + nbytes > 64 ? 64 - offset : nbytes); + + memcpy(pms->buf + offset, p, copy); + if (offset + copy < 64) + return; + p += copy; + left -= copy; + md5_process(pms, pms->buf); + } + + /* Process full blocks. */ + for (; left >= 64; p += 64, left -= 64) + md5_process(pms, p); + + /* Process a final partial block. */ + if (left) + memcpy(pms->buf, p, left); +} + +void +md5_finish(md5_state_t *pms, md5_byte_t digest[16]) +{ + static const md5_byte_t pad[64] = { + 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + }; + md5_byte_t data[8]; + int i; + + /* Save the length before padding. */ + for (i = 0; i < 8; ++i) + data[i] = (md5_byte_t)(pms->count[i >> 2] >> ((i & 3) << 3)); + /* Pad to 56 bytes mod 64. */ + md5_append(pms, pad, ((55 - (pms->count[0] >> 3)) & 63) + 1); + /* Append the length. */ + md5_append(pms, data, 8); + for (i = 0; i < 16; ++i) + digest[i] = (md5_byte_t)(pms->abcd[i >> 2] >> ((i & 3) << 3)); +} + diff --git a/tests/apps/miniDFT/tests/src/md5.h b/tests/apps/miniDFT/tests/src/md5.h new file mode 100644 index 0000000000..c0c06617a6 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/md5.h @@ -0,0 +1,92 @@ +/* + Copyright (C) 1999, 2002 Aladdin Enterprises. All rights reserved. + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + L. Peter Deutsch + ghost@aladdin.com + + */ +/* $Id: md5.h,v 1.1 2010-08-13 10:50:08 degironc Exp $ */ +/* + Independent implementation of MD5 (RFC 1321). + + This code implements the MD5 Algorithm defined in RFC 1321, whose + text is available at + http://www.ietf.org/rfc/rfc1321.txt + The code is derived from the text of the RFC, including the test suite + (section A.5) but excluding the rest of Appendix A. It does not include + any code or documentation that is identified in the RFC as being + copyrighted. + + The original and principal author of md5.h is L. Peter Deutsch + . Other authors are noted in the change history + that follows (in reverse chronological order): + + 2002-04-13 lpd Removed support for non-ANSI compilers; removed + references to Ghostscript; clarified derivation from RFC 1321; + now handles byte order either statically or dynamically. + 1999-11-04 lpd Edited comments slightly for automatic TOC extraction. + 1999-10-18 lpd Fixed typo in header comment (ansi2knr rather than md5); + added conditionalization for C++ compilation from Martin + Purschke . + 1999-05-03 lpd Original version. + */ + +#ifndef md5_INCLUDED +# define md5_INCLUDED + +/* + * This package supports both compile-time and run-time determination of CPU + * byte order. If ARCH_IS_BIG_ENDIAN is defined as 0, the code will be + * compiled to run only on little-endian CPUs; if ARCH_IS_BIG_ENDIAN is + * defined as non-zero, the code will be compiled to run only on big-endian + * CPUs; if ARCH_IS_BIG_ENDIAN is not defined, the code will be compiled to + * run on either big- or little-endian CPUs, but will run slightly less + * efficiently on either one than if ARCH_IS_BIG_ENDIAN is defined. + */ + +typedef unsigned char md5_byte_t; /* 8-bit byte */ +typedef unsigned int md5_word_t; /* 32-bit word */ + +/* Define the state of the MD5 Algorithm. */ +typedef struct md5_state_s { + md5_word_t count[2]; /* message length in bits, lsw first */ + md5_word_t abcd[4]; /* digest buffer */ + md5_byte_t buf[64]; /* accumulate block */ +} md5_state_t; + +#ifdef __cplusplus +extern "C" +{ +#endif + +/* Initialize the algorithm. */ +void md5_init(md5_state_t *pms); + +/* Append a string to the message. */ +void md5_append(md5_state_t *pms, const md5_byte_t *data, int nbytes); + +/* Finish the message and return the digest. */ +void md5_finish(md5_state_t *pms, md5_byte_t digest[16]); + + +#ifdef __cplusplus +} /* end extern "C" */ +#endif + +#endif /* md5_INCLUDED */ diff --git a/tests/apps/miniDFT/tests/src/md5_from_file.c b/tests/apps/miniDFT/tests/src/md5_from_file.c new file mode 100644 index 0000000000..dc9d20b9d8 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/md5_from_file.c @@ -0,0 +1,131 @@ +/* + Copyright (C) 2005-2008 Quantum ESPRESSO group + This file is distributed under the terms of the + GNU General Public License. See the file `License' + in the root directory of the present distribution, + or http://www.gnu.org/copyleft/gpl.txt . + +------------------------------------------------------ +*/ + + +#include +#include +#include +#include "c_defs.h" +#include "md5.h" + +#define MAX_BUF 1024 + + +static void fatal ( const char * msg ) +{ + + fprintf( stderr , "fatal: %s" , *msg ? msg : "Oops!" ) ; + exit( -1 ) ; + +} /* fatal */ + +static void * xcmalloc ( size_t size ) +{ + + register void * ptr = malloc( size ) ; + + if ( ptr == NULL ) + fatal( "md5_from_file: virtual memory exhausted" ) ; + else + memset( ptr , 0 , size ) ; + + return ptr ; + +} /* xcmalloc */ + +char *readFile( FILE *file ) +{ + + char *out; + unsigned long fileLen; + + if (!file) + { + exit(1); + } + + fseek(file, 0, SEEK_END); + fileLen=ftell(file); + fseek(file, 0, SEEK_SET); + + out=(char *)xcmalloc(fileLen+1); + + if (!out) + { + fprintf(stderr, "Memory error!"); + fclose(file); + exit(1); + } + + fread(out, fileLen, 1, file); + + return out; + +} + + +void get_md5(const char *file, char *md5, int err) +{ + + FILE *fp; + char *data; + md5_state_t state; + md5_byte_t digest[16]; + + if(file==NULL) { + err = 1; + return; + } + + fp=fopen(file,"rb"); + if(fp==NULL) { + err = 2; + return; + } + + data=readFile(fp); + if(data==NULL) { + err = 3; + return; + } + + md5_init(&state); + md5_append(&state,(const md5_byte_t *)data,strlen(data)); + md5_finish(&state,digest); + + int i=0; + for(i;i<16;i++){ + snprintf(md5+i*2,sizeof(md5),"%02x",digest[i]); + } + fclose(fp); + + free(data); + err = 0; + return; +} + +int F77_FUNC_(file_md5,FILE_MD5)( const int * f_name, const int * f_len, int * out ) +{ + int i, err = -1 ; + char * md5 = ( char * ) xcmalloc( 32 + 1 ) ; + char * f = ( char * ) xcmalloc( (*f_len) + 1) ; + + for( i = 0; i < * f_len; i++ ) f[ i ] = (char)f_name[ i ]; + + f[*f_len] = '\0' ; + + get_md5( f , md5, err) ; + for( i = 0; i < 32; i++ ) out[ i ] = md5[ i ]; + + free(f); + free(md5); + return err; +} + diff --git a/tests/apps/miniDFT/tests/src/memory_report.f90 b/tests/apps/miniDFT/tests/src/memory_report.f90 new file mode 100644 index 0000000000..3908eb13d6 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/memory_report.f90 @@ -0,0 +1,83 @@ +! +! Copyright (C) 2007 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +!---------------------------------------------------------------------------- +SUBROUTINE memory_report() + !---------------------------------------------------------------------------- + ! + USE io_global, ONLY : stdout + USE wvfct, ONLY : npwx, nbnd, nbndx + USE basis, ONLY : natomwfc + USE fft_base, ONLY : dfftp + USE gvect, ONLY : ngl, ngm + USE uspp, ONLY : nkb + USE lsda_mod, ONLY : nspin + USE control_flags, ONLY: isolve, nmix, lscf + USE mp_global, ONLY : np_ortho + ! + IMPLICIT NONE + ! + integer, parameter :: npol=1 !substitute for noncollin_module%npol + INTEGER, PARAMETER :: Mb=1024*1024, complex_size=16, real_size=8 + INTEGER :: g_size, nbnd_l + ! + ! the conversions to double prevent integer overflow in very large run + ! + WRITE( stdout, '(/5x,"Largest allocated arrays",5x,"est. size (Mb)", & + &5x,"dimensions")') + WRITE( stdout, '(8x,"Kohn-Sham Wavefunctions ",f10.2," Mb", & + & 5x,"(",i7,",",i5,")")') & + complex_size*nbnd*npol*DBLE(npwx)/Mb, npwx*npol,nbnd + WRITE( stdout, '(8x,"NL pseudopotentials ",f10.2," Mb", & + & 5x,"(",i7,",",i5,")")') & + complex_size*nkb*DBLE(npwx)/Mb, npwx, nkb + IF ( nspin == 2 ) THEN + WRITE( stdout, '(8x,"Each V/rho on FFT grid ",f10.2," Mb", & + & 5x,"(",i7,",",i4,")")') & + DBLE(complex_size*nspin*dfftp%nnr)/Mb, dfftp%nnr, nspin + ELSE + WRITE( stdout, '(8x,"Each V/rho on FFT grid ",f10.2," Mb", & + & 5x,"(",i7,")")') DBLE(complex_size*dfftp%nnr)/Mb, dfftp%nnr + END IF + WRITE( stdout, '(8x,"Each G-vector array ",f10.2," Mb", & + & 5x,"(",i7,")")') DBLE(real_size*ngm)/Mb, ngm + WRITE( stdout, '(8x,"G-vector shells ",f10.2," Mb", & + & 5x,"(",i7,")")') DBLE(real_size*ngl)/Mb, ngl + ! + WRITE( stdout, '(5x,"Largest temporary arrays",5x,"est. size (Mb)", & + &5x,"dimensions")') + g_size = complex_size + ! + IF ( isolve == 0 ) THEN + WRITE( stdout, '(8x,"Auxiliary wavefunctions ",f10.2," Mb", & + & 5x,"(",i7,",",i5,")")') & + g_size*nbndx*npol*DBLE(npwx)/Mb, npwx*npol, nbndx + ENDIF + ! nbnd_l : estimated dimension of distributed matrices + nbnd_l = nbndx/np_ortho(1) + WRITE( stdout, '(8x,"Each subspace H/S matrix ",f10.2," Mb", & + & 5x,"(",i4,",",i4,")")') & + DBLE(g_size*nbnd_l*nbnd_l)/Mb, nbnd_l, nbnd_l + ! + IF ( npol > 1 ) THEN + WRITE( stdout, '(8x,"Each matrix",f10.2," Mb", & + & 5x,"(",i7,",",i4,",",i5,")")') & + DBLE(g_size*nkb*npol*nbnd)/Mb, nkb, npol, nbnd + ELSE + WRITE( stdout, '(8x,"Each matrix",f10.2," Mb", & + & 5x,"(",i7,",",i5,")")') & + DBLE(g_size*nkb*nbnd)/Mb, nkb, nbnd + END IF + ! + IF ( lscf) WRITE( stdout, & + '(8x,"Arrays for rho mixing ",f10.2," Mb", 5x,"(",i7,",",i4,")")') & + DBLE(complex_size*dfftp%nnr*nmix)/Mb, dfftp%nnr, nmix + ! + RETURN + ! +END subroutine memory_report diff --git a/tests/apps/miniDFT/tests/src/memstat.c b/tests/apps/miniDFT/tests/src/memstat.c new file mode 100644 index 0000000000..55c39c3087 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/memstat.c @@ -0,0 +1,41 @@ +/* + Copyright (C) 2002 FPMD group + This file is distributed under the terms of the + GNU General Public License. See the file `License' + in the root directory of the present distribution, + or http://www.gnu.org/copyleft/gpl.txt . +*/ + +#include "c_defs.h" + +/* + This function return the numer of kilobytes allocated + by the calling process. + Auhor: Carlo Cavazzoni. +*/ + +#if defined (__SVR4) && defined (__sun) +#define SUN_MALLINFO +#endif + +#if defined(HAVE_MALLINFO) && !defined(__QK_USER__) && !defined(SUN__MALLINFO) +#include + +void F77_FUNC(memstat,MEMSTAT)(int *kilobytes) +{ + + struct mallinfo info; + info = mallinfo(); + +#if defined(__AIX) + *kilobytes = (info.arena) / 1024 ; +#else + *kilobytes = (info.arena + info.hblkhd) / 1024 ; +#endif + +#else +void F77_FUNC(memstat,MEMSTAT)(int *kilobytes) +{ + *kilobytes = -1; +#endif +} diff --git a/tests/apps/miniDFT/tests/src/mix_rho.f90 b/tests/apps/miniDFT/tests/src/mix_rho.f90 new file mode 100644 index 0000000000..b3b4329318 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/mix_rho.f90 @@ -0,0 +1,673 @@ +! +! Copyright (C) 2002-2007 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +#define ZERO ( 0._dp, 0._dp ) +! +! This macro force the normalization of betamix matrix, usually not necessary +!#define __NORMALIZE_BETAMIX +! +#ifdef __GFORTRAN +! gfortran hack - for some mysterious reason gfortran doesn't save +! derived-type variables even with the SAVE attribute +MODULE mix_save + USE scf, ONLY : mix_type + TYPE(mix_type), ALLOCATABLE, SAVE :: & + df(:), &! information from preceding iterations + dv(:) ! " " " " " " +END MODULE mix_save +#endif + +!---------------------------------------------------------------------------- +SUBROUTINE mix_rho( input_rhout, rhoin, alphamix, dr2, tr2_min, iter, n_iter, conv ) + !---------------------------------------------------------------------------- + ! + ! ... Modified Broyden's method for charge density mixing + ! ... D.D. Johnson PRB 38, 12807 (1988) + ! + ! ... On output: the mixed density is in rhoin, mixed augmentation + ! ... channel occ. is in becin + ! input_rhocout, input_becout etc are unchanged + ! + USE kinds, ONLY : DP + USE ions_base, ONLY : nat + USE gvect, ONLY : ngm + USE gvecs, ONLY : ngms + USE lsda_mod, ONLY : nspin + USE control_flags, ONLY : imix, ngm0, tr2, io_level + ! ... for PAW: + USE uspp_param, ONLY : nhm + USE scf, ONLY : scf_type, create_scf_type, destroy_scf_type, & + mix_type, create_mix_type, destroy_mix_type, & + assign_scf_to_mix_type, assign_mix_to_scf_type, & + mix_type_AXPY, diropn_mix_file, close_mix_file, & + davcio_mix_type, rho_ddot, high_frequency_mixing, & + mix_type_COPY, mix_type_SCAL + USE io_global, ONLY : stdout +#ifdef __GFORTRAN + USE mix_save +#endif + ! + IMPLICIT NONE + integer :: kilobytes + ! + ! ... First the I/O variable + ! + INTEGER, INTENT(IN) :: & + iter, &! counter of the number of iterations + n_iter ! numb. of iterations used in mixing + REAL(DP), INTENT(IN) :: & + alphamix, &! mixing factor + tr2_min ! estimated error in diagonalization. If the estimated + ! scf error is smaller than this, exit: a more accurate + ! diagonalization is needed + REAL(DP), INTENT(OUT) :: & + dr2 ! the estimated errr on the energy + LOGICAL, INTENT(OUT) :: & + conv ! .true. if the convergence has been reached + + type(scf_type), intent(in) :: input_rhout + type(scf_type), intent(inout) :: rhoin + ! + ! ... Here the local variables + ! + type(mix_type) :: rhout_m, rhoin_m + INTEGER, PARAMETER :: & + maxmix = 25 ! max number of iterations for charge mixing + INTEGER :: & + iunmix, &! I/O unit number of charge density file in G-space + iunmix_paw, &! I/O unit number of PAW file + iter_used, &! actual number of iterations used + ipos, &! index of the present iteration + inext, &! index of the next iteration + i, j, &! counters on number of iterations + info, &! flag saying if the exec. of libr. routines was ok + ldim ! 2 * Hubbard_lmax + 1 + type(mix_type) :: rhoin_save, rhout_save + REAL(DP),ALLOCATABLE :: betamix(:,:), work(:) + INTEGER, ALLOCATABLE :: iwork(:) + REAL(DP) :: gamma0 +#ifdef __NORMALIZE_BETAMIX + REAL(DP) :: norm2, obn +#endif + LOGICAL :: & + savetofile, &! save intermediate steps on file $prefix."mix",... + exst ! if true the file exists + ! + ! ... saved variables and arrays + ! + INTEGER, SAVE :: & + mixrho_iter = 0 ! history of mixing +#ifndef __GFORTRAN + TYPE(mix_type), ALLOCATABLE, SAVE :: & + df(:), &! information from preceding iterations + dv(:) ! " " " " " " +#endif + REAL(DP) :: dr2_paw, norm +! REAL(DP),ALLOCATABLE :: e(:),v(:,:) + INTEGER, PARAMETER :: read_ = -1, write_ = +1 + ! + ! ... external functions + ! + INTEGER, EXTERNAL :: find_free_unit + ! + CALL start_clock( 'mix_rho' ) + ! + ! + ngm0 = ngms + ! + mixrho_iter = iter + ! + IF ( n_iter > maxmix ) CALL errore( 'mix_rho', 'n_iter too big', 1 ) + ! + savetofile = (io_level > 1) + ! + ! define rhocout variables and copy input_rhocout in there + ! + call create_mix_type(rhout_m) + call create_mix_type(rhoin_m) + ! + call assign_scf_to_mix_type(rhoin, rhoin_m) + call assign_scf_to_mix_type(input_rhout, rhout_m) + + call mix_type_AXPY ( -1.d0, rhoin_m, rhout_m ) + ! + dr2 = rho_ddot( rhout_m, rhout_m, ngms ) !!!! this used to be ngm NOT ngms + ! + IF (dr2 < 0.0_DP) CALL errore('mix_rho','negative dr2',1) + ! + conv = ( dr2 < tr2 ) + ! + IF ( conv .OR. dr2 < tr2_min ) THEN + ! + ! ... if convergence is achieved or if the self-consistency error (dr2) is + ! ... smaller than the estimated error due to diagonalization (tr2_min), + ! ... exit and leave rhoin and rhocout unchanged + ! + IF ( ALLOCATED( df ) ) THEN + DO i=1, n_iter + call destroy_mix_type(df(i)) + END DO + DEALLOCATE( df ) + END IF + IF ( ALLOCATED( dv ) ) THEN + DO i=1, n_iter + call destroy_mix_type(dv(i)) + END DO + DEALLOCATE( dv ) + END IF + ! + call destroy_mix_type(rhoin_m) + call destroy_mix_type(rhout_m) + + CALL stop_clock( 'mix_rho' ) + ! + RETURN + ! + END IF + ! + IF ( savetofile ) THEN + ! + iunmix = find_free_unit() + CALL diropn_mix_file( iunmix, 'mix', exst ) + ! + IF ( mixrho_iter > 1 .AND. .NOT. exst ) THEN + ! + CALL infomsg( 'mix_rho', 'file not found, restarting' ) + mixrho_iter = 1 + ! + END IF + ! + END IF + ! + IF ( savetofile .OR. mixrho_iter == 1 ) THEN + ! + IF ( .NOT. ALLOCATED( df ) ) THEN + ALLOCATE( df( n_iter ) ) + DO i=1,n_iter + CALL create_mix_type( df(i) ) + END DO + END IF + IF ( .NOT. ALLOCATED( dv ) ) THEN + ALLOCATE( dv( n_iter ) ) + DO i=1,n_iter + CALL create_mix_type( dv(i) ) + END DO + END IF + ! + END IF + ! + ! ... iter_used = mixrho_iter-1 if mixrho_iter <= n_iter + ! ... iter_used = n_iter if mixrho_iter > n_iter + ! + iter_used = MIN( ( mixrho_iter - 1 ), n_iter ) + ! + ! ... ipos is the position in which results from the present iteration + ! ... are stored. ipos=mixrho_iter-1 until ipos=n_iter, then back to 1,2,... + ! + ipos = mixrho_iter - 1 - ( ( mixrho_iter - 2 ) / n_iter ) * n_iter + ! + IF ( mixrho_iter > 1 ) THEN + ! + IF ( savetofile ) THEN + ! + CALL davcio_mix_type( df(ipos), iunmix, 1, read_ ) + CALL davcio_mix_type( dv(ipos), iunmix, 2, read_ ) + ! + END IF + ! + call mix_type_AXPY ( -1.d0, rhout_m, df(ipos) ) + call mix_type_AXPY ( -1.d0, rhoin_m, dv(ipos) ) +#ifdef __NORMALIZE_BETAMIX + ! NORMALIZE + norm2 = rho_ddot( df(ipos), df(ipos), ngm0 ) + obn = 1.d0/sqrt(norm2) + call mix_type_SCAL (obn,df(ipos)) + call mix_type_SCAL (obn,dv(ipos)) +#endif + ! + END IF + ! + IF ( savetofile ) THEN + ! + DO i = 1, iter_used + ! + IF ( i /= ipos ) THEN + ! + CALL davcio_mix_type( df(i), iunmix, 2*i+1, read_ ) + CALL davcio_mix_type( dv(i), iunmix, 2*i+2, read_ ) + END IF + ! + END DO + ! + CALL davcio_mix_type( rhout_m, iunmix, 1, write_ ) + CALL davcio_mix_type( rhoin_m, iunmix, 2, write_ ) + ! + IF ( mixrho_iter > 1 ) THEN + CALL davcio_mix_type( df(ipos), iunmix, 2*ipos+1, write_ ) + CALL davcio_mix_type( dv(ipos), iunmix, 2*ipos+2, write_ ) + END IF + ! + ELSE + ! + call create_mix_type (rhoin_save) + call create_mix_type (rhout_save) + ! + call mix_type_COPY( rhoin_m, rhoin_save ) + call mix_type_COPY( rhout_m, rhout_save ) + ! + END IF + ! Nothing else to do on first iteration + skip_on_first: & + IF (iter_used > 0) THEN + ! + ALLOCATE(betamix(iter_used, iter_used)) !iter_used)) + betamix = 0._dp + ! + DO i = 1, iter_used + ! + DO j = i, iter_used + ! + betamix(i,j) = rho_ddot( df(j), df(i), ngm0 ) + betamix(j,i) = betamix(i,j) + ! + END DO + ! + END DO + ! + ! allocate(e(iter_used), v(iter_used, iter_used)) + ! CALL rdiagh(iter_used, betamix, iter_used, e, v) + ! write(*,'(1e11.3)') e(:) + ! write(*,*) + ! deallocate(e,v) + allocate(work(iter_used), iwork(iter_used)) + !write(*,*) betamix(:,:) + CALL DSYTRF( 'U', iter_used, betamix, iter_used, iwork, work, iter_used, info ) + CALL errore( 'broyden', 'factorization', abs(info) ) + ! + CALL DSYTRI( 'U', iter_used, betamix, iter_used, iwork, work, info ) + CALL errore( 'broyden', 'DSYTRI', abs(info) ) ! + deallocate(iwork) + ! + FORALL( i = 1:iter_used, & + j = 1:iter_used, j > i ) betamix(j,i) = betamix(i,j) + ! + DO i = 1, iter_used + ! + work(i) = rho_ddot( df(i), rhout_m, ngm0 ) + ! + END DO + ! + DO i = 1, iter_used + ! + gamma0 = DOT_PRODUCT( betamix(1:iter_used,i), work(1:iter_used) ) + ! + call mix_type_AXPY ( -gamma0, dv(i), rhoin_m ) + call mix_type_AXPY ( -gamma0, df(i), rhout_m ) + ! + END DO + DEALLOCATE(betamix, work) + ! + ! ... auxiliary vectors dv and df not needed anymore + ! + ENDIF skip_on_first + ! + IF ( savetofile ) THEN + ! + call close_mix_file( iunmix ) + ! + IF ( ALLOCATED( df ) ) THEN + DO i=1, n_iter + call destroy_mix_type(df(i)) + END DO + DEALLOCATE( df ) + END IF + IF ( ALLOCATED( dv ) ) THEN + DO i=1, n_iter + call destroy_mix_type(dv(i)) + END DO + DEALLOCATE( dv ) + END IF + ! + ELSE + ! + inext = mixrho_iter - ( ( mixrho_iter - 1 ) / n_iter ) * n_iter + ! + call mix_type_COPY( rhout_save, df(inext) ) + call mix_type_COPY( rhoin_save, dv(inext) ) + ! + call destroy_mix_type( rhoin_save ) + call destroy_mix_type( rhout_save ) + ! + END IF + ! + ! ... preconditioning the new search direction + ! + IF ( imix == 1 ) THEN + ! + CALL approx_screening( rhout_m ) + ! + ELSE IF ( imix == 2 ) THEN + ! + CALL approx_screening2( rhout_m, rhoin_m ) + ! + END IF + ! + ! ... set new trial density + ! + call mix_type_AXPY ( alphamix, rhout_m, rhoin_m ) + ! ... simple mixing for high_frequencies (and set to zero the smooth ones) + call high_frequency_mixing ( rhoin, input_rhout, alphamix ) + ! ... add the mixed rho for the smooth frequencies + call assign_mix_to_scf_type(rhoin_m,rhoin) + ! + call destroy_mix_type(rhout_m) + call destroy_mix_type(rhoin_m) + + CALL stop_clock( 'mix_rho' ) + ! + RETURN + ! +END SUBROUTINE mix_rho +! +!---------------------------------------------------------------------------- +SUBROUTINE approx_screening( drho ) + !---------------------------------------------------------------------------- + ! + ! ... apply an average TF preconditioning to drho + ! + USE kinds, ONLY : DP + USE constants, ONLY : e2, pi, fpi + USE cell_base, ONLY : omega, tpiba2 + USE gvect, ONLY : gg, ngm, nl, nlm + USE klist, ONLY : nelec + USE lsda_mod, ONLY : nspin + USE control_flags, ONLY : ngm0 + USE scf, ONLY : mix_type + USE wavefunctions_module, ONLY : psic + ! + IMPLICIT NONE + ! + type (mix_type), intent(INOUT) :: drho ! (in/out) + ! + REAL(DP) :: rrho, rmag, rs, agg0 + INTEGER :: ig, is + ! + rs = ( 3.D0 * omega / fpi / nelec )**( 1.D0 / 3.D0 ) + ! + agg0 = ( 12.D0 / pi )**( 2.D0 / 3.D0 ) / tpiba2 / rs + ! + IF ( nspin == 1 .OR. nspin == 4 ) THEN + ! + drho%of_g(:ngm0,1) = drho%of_g(:ngm0,1) * gg(:ngm0) / (gg(:ngm0)+agg0) + ! + ELSE IF ( nspin == 2 ) THEN + ! + DO ig = 1, ngm0 + ! + rrho = ( drho%of_g(ig,1) + drho%of_g(ig,2) ) * gg(ig) / (gg(ig)+agg0) + rmag = ( drho%of_g(ig,1) - drho%of_g(ig,2) ) + ! + drho%of_g(ig,1) = 0.5D0*( rrho + rmag ) + drho%of_g(ig,2) = 0.5D0*( rrho - rmag ) + ! + END DO + ! + END IF + ! + RETURN + ! +END SUBROUTINE approx_screening +! +!---------------------------------------------------------------------------- +SUBROUTINE approx_screening2( drho, rhobest ) + !---------------------------------------------------------------------------- + ! + ! ... apply a local-density dependent TF preconditioning to drho + ! + USE kinds, ONLY : DP + USE constants, ONLY : e2, pi, tpi, fpi, eps8, eps32 + USE cell_base, ONLY : omega, tpiba2 + USE gvecs, ONLY : nls, nlsm + USE gvect, ONLY : gg, ngm, nl, nlm + USE wavefunctions_module, ONLY : psic + USE klist, ONLY : nelec + USE lsda_mod, ONLY : nspin + USE control_flags, ONLY : ngm0 + USE scf, ONLY : mix_type, local_tf_ddot + USE mp, ONLY : mp_max, mp_min, mp_sum + USE mp_global, ONLY : intra_image_comm, intra_bgrp_comm + USE fft_base, ONLY : dffts + USE fft_interfaces, ONLY : fwfft, invfft + ! + IMPLICIT NONE + ! + type(mix_type), intent(inout) :: drho + type(mix_type), intent(in) :: rhobest + ! + INTEGER, PARAMETER :: mmx = 12 + ! + INTEGER :: & + iwork(mmx), i, j, m, info, is + REAL(DP) :: & + rs, min_rs, max_rs, avg_rsm1, target, dr2_best + REAL(DP) :: & + aa(mmx,mmx), invaa(mmx,mmx), bb(mmx), work(mmx), vec(mmx), agg0 + COMPLEX(DP), ALLOCATABLE :: & + v(:,:), &! v(ngm0,mmx) + w(:,:), &! w(ngm0,mmx) + dv(:), &! dv(ngm0) + vbest(:), &! vbest(ngm0) + wbest(:) ! wbest(ngm0) + REAL(DP), ALLOCATABLE :: & + alpha(:) ! alpha(dffts%nnr) + ! + COMPLEX(DP) :: rrho, rmag + INTEGER :: ir, ig + REAL(DP), PARAMETER :: one_third = 1.D0 / 3.D0 + ! + ! + IF ( nspin == 2 ) THEN + ! + DO ig = 1, ngm0 + ! + rrho = drho%of_g(ig,1) + drho%of_g(ig,2) + rmag = drho%of_g(ig,1) - drho%of_g(ig,2) + ! + drho%of_g(ig,1) = rrho + drho%of_g(ig,2) = rmag + ! + END DO + ! + END IF + ! + target = 0.D0 + ! + IF ( gg(1) < eps8 ) drho%of_g(1,1) = ZERO + ! + ALLOCATE( alpha( dffts%nnr ) ) + ALLOCATE( v( ngm0, mmx ), & + w( ngm0, mmx ), dv( ngm0 ), vbest( ngm0 ), wbest( ngm0 ) ) + ! + v(:,:) = ZERO + w(:,:) = ZERO + dv(:) = ZERO + vbest(:) = ZERO + wbest(:) = ZERO + ! + ! ... calculate alpha from density + ! + psic(:) = ZERO + ! + IF ( nspin == 2 ) THEN + ! + psic(nls(:ngm0)) = ( rhobest%of_g(:ngm0,1) + rhobest%of_g(:ngm0,2) ) + ! + ELSE + ! + psic(nls(:ngm0)) = rhobest%of_g(:ngm0,1) + ! + END IF + ! + ! + CALL invfft ('Smooth', psic, dffts) + ! + alpha(:) = REAL( psic(1:dffts%nnr) ) + ! + min_rs = ( 3.D0 * omega / fpi / nelec )**one_third + max_rs = min_rs + avg_rsm1 = 0.D0 + ! + DO ir = 1, dffts%nnr + ! + alpha(ir) = ABS( alpha(ir) ) + ! + IF ( alpha(ir) > eps32 ) THEN + ! + rs = ( 3.D0 / fpi / alpha(ir) )**one_third + min_rs = MIN( min_rs, rs ) + avg_rsm1 = avg_rsm1 + 1.D0 / rs + max_rs = MAX( max_rs, rs ) + alpha(ir) = rs + ! + END IF + ! + END DO + ! + CALL mp_sum( avg_rsm1 , intra_bgrp_comm ) + ! + CALL mp_min( min_rs, intra_image_comm ) + CALL mp_max( max_rs, intra_image_comm ) + ! + alpha = 3.D0 * ( tpi / 3.D0 )**( 5.D0 / 3.D0 ) * alpha + ! + avg_rsm1 = ( dffts%nr1*dffts%nr2*dffts%nr3 ) / avg_rsm1 + rs = ( 3.D0 * omega / fpi / nelec )**one_third + agg0 = ( 12.D0 / pi )**( 2.D0 / 3.D0 ) / tpiba2 / avg_rsm1 + ! + ! ... calculate deltaV and the first correction vector + ! + psic(:) = ZERO + ! + psic(nls(:ngm0)) = drho%of_g(:ngm0,1) + ! + ! + CALL invfft ('Smooth', psic, dffts) + ! + psic(:dffts%nnr) = psic(:dffts%nnr) * alpha(:) + ! + CALL fwfft ('Smooth', psic, dffts) + ! + dv(:) = psic(nls(:ngm0)) * gg(:ngm0) * tpiba2 + v(:,1)= psic(nls(:ngm0)) * gg(:ngm0) / ( gg(:ngm0) + agg0 ) + ! + m = 1 + aa(:,:) = 0.D0 + bb(:) = 0.D0 + ! + repeat_loop: DO + ! + ! ... generate the vector w + ! + w(:,m) = fpi * e2 * v(:,m) + ! + psic(:) = ZERO + ! + psic(nls(:ngm0)) = v(:,m) + ! + ! + CALL invfft ('Smooth', psic, dffts) + ! + psic(:dffts%nnr) = psic(:dffts%nnr) * alpha(:) + ! + CALL fwfft ('Smooth', psic, dffts) + ! + w(:,m) = w(:,m) + gg(:ngm0) * tpiba2 * psic(nls(:ngm0)) + ! + ! ... build the linear system + ! + DO i = 1, m + ! + aa(i,m) = local_tf_ddot( w(1,i), w(1,m), ngm0) + ! + aa(m,i) = aa(i,m) + ! + END DO + ! + bb(m) = local_tf_ddot( w(1,m), dv, ngm0) + ! + ! ... solve it -> vec + ! + invaa = aa + ! + CALL DSYTRF( 'U', m, invaa, mmx, iwork, work, mmx, info ) + CALL errore( 'broyden', 'factorization', info ) + ! + CALL DSYTRI( 'U', m, invaa, mmx, iwork, work, info ) + CALL errore( 'broyden', 'DSYTRI', info ) + ! + FORALL( i = 1:m, j = 1:m, j > i ) invaa(j,i) = invaa(i,j) + ! + FORALL( i = 1:m ) vec(i) = SUM( invaa(i,:)*bb(:) ) + ! + vbest(:) = ZERO + wbest(:) = dv(:) + ! + DO i = 1, m + ! + vbest = vbest + vec(i) * v(:,i) + wbest = wbest - vec(i) * w(:,i) + ! + END DO + ! + dr2_best = local_tf_ddot( wbest, wbest, ngm0 ) + ! + IF ( target == 0.D0 ) target = 1.D-6 * dr2_best + ! + IF ( dr2_best < target ) THEN + ! + drho%of_g(:ngm0,1) = vbest(:) + ! + IF ( nspin == 2 ) THEN + ! + DO ig = 1, ngm0 + ! + rrho = drho%of_g(ig,1) + rmag = drho%of_g(ig,2) + ! + drho%of_g(ig,1) = 0.5D0 * ( rrho + rmag ) + drho%of_g(ig,2) = 0.5D0 * ( rrho - rmag ) + ! + END DO + ! + END IF + ! + DEALLOCATE( alpha, v, w, dv, vbest, wbest ) + ! + EXIT repeat_loop + ! + ELSE IF ( m >= mmx ) THEN + ! + m = 1 + ! + v(:,m) = vbest(:) + aa(:,:) = 0.D0 + bb(:) = 0.D0 + ! + CYCLE repeat_loop + ! + END IF + ! + m = m + 1 + ! + v(:,m) = wbest(:) / ( gg(:ngm0) + agg0 ) + ! + END DO repeat_loop + ! + RETURN + ! +END SUBROUTINE approx_screening2 diff --git a/tests/apps/miniDFT/tests/src/mp.f90 b/tests/apps/miniDFT/tests/src/mp.f90 new file mode 100644 index 0000000000..369820bcf9 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/mp.f90 @@ -0,0 +1,2285 @@ +! +! Copyright (C) 2002-2009 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! + +#if defined __HPM +# include "/cineca/prod/hpm/include/f_hpm.h" +#endif + +!------------------------------------------------------------------------------! + MODULE mp +!------------------------------------------------------------------------------! + USE kinds, ONLY : DP + USE io_global, ONLY : stdout + USE parallel_include + ! + IMPLICIT NONE + + PUBLIC :: mp_start, mp_end, & + mp_bcast, mp_sum, mp_max, mp_min, mp_rank, mp_size, & + mp_gather, mp_get, mp_put, mp_barrier, mp_report, mp_group_free, & + mp_root_sum, mp_comm_free, mp_comm_create, mp_comm_group, & + mp_group_create, mp_comm_split, mp_set_displs +! + INTERFACE mp_bcast + MODULE PROCEDURE mp_bcast_i1, mp_bcast_r1, mp_bcast_c1, & + mp_bcast_z, mp_bcast_zv, & + mp_bcast_iv, mp_bcast_rv, mp_bcast_cv, mp_bcast_l, mp_bcast_rm, & + mp_bcast_cm, mp_bcast_im, mp_bcast_it, mp_bcast_rt, mp_bcast_lv, & + mp_bcast_lm, mp_bcast_r4d, mp_bcast_r5d, mp_bcast_ct, mp_bcast_c4d,& + mp_bcast_c5d + END INTERFACE + + INTERFACE mp_sum + MODULE PROCEDURE mp_sum_i1, mp_sum_iv, mp_sum_im, mp_sum_it, & + mp_sum_r1, mp_sum_rv, mp_sum_rm, mp_sum_rt, mp_sum_r4d, & + mp_sum_c1, mp_sum_cv, mp_sum_cm, mp_sum_ct, mp_sum_c4d, & + mp_sum_c5d, mp_sum_c6d, mp_sum_rmm, mp_sum_cmm, mp_sum_r5d + END INTERFACE + + INTERFACE mp_root_sum + MODULE PROCEDURE mp_root_sum_rm, mp_root_sum_cm + END INTERFACE + + INTERFACE mp_get + MODULE PROCEDURE mp_get_r1, mp_get_rv, mp_get_cv, mp_get_i1, mp_get_iv, & + mp_get_rm + END INTERFACE + + INTERFACE mp_put + MODULE PROCEDURE mp_put_rv, mp_put_cv, mp_put_i1, mp_put_iv, & + mp_put_rm + END INTERFACE + + INTERFACE mp_max + MODULE PROCEDURE mp_max_i, mp_max_r, mp_max_rv, mp_max_iv + END INTERFACE + INTERFACE mp_min + MODULE PROCEDURE mp_min_i, mp_min_r, mp_min_rv, mp_min_iv + END INTERFACE + INTERFACE mp_gather + MODULE PROCEDURE mp_gather_i1, mp_gather_iv, mp_gatherv_rv, mp_gatherv_iv, & + mp_gatherv_rm, mp_gatherv_im, mp_gatherv_cv + END INTERFACE + INTERFACE mp_alltoall + MODULE PROCEDURE mp_alltoall_c3d, mp_alltoall_i3d + END INTERFACE + INTERFACE mp_circular_shift_left + MODULE PROCEDURE mp_circular_shift_left_d2d_int,mp_circular_shift_left_d2d_double + END INTERFACE + + + CHARACTER(LEN=80), PRIVATE :: err_msg = ' ' + +!------------------------------------------------------------------------------! +! + CONTAINS +! +!------------------------------------------------------------------------------! +! +!------------------------------------------------------------------------------! +!..mp_gather_i1 + SUBROUTINE mp_gather_i1(mydata, alldata, root, gid) + IMPLICIT NONE + INTEGER, INTENT(IN) :: mydata, root + INTEGER, OPTIONAL, INTENT(IN) :: gid + INTEGER :: group + INTEGER, INTENT(OUT) :: alldata(:) + INTEGER :: ierr + + +!!$ #if defined (__MPI) + group = mpi_comm_world + IF( PRESENT( gid ) ) group = gid + CALL MPI_GATHER(mydata, 1, MPI_INTEGER, alldata, 1, MPI_INTEGER, root, group, IERR) + IF (ierr/=0) CALL mp_stop( 8001 ) +!!$#else +!!$ alldata(1) = mydata +!!$#endif + RETURN + END SUBROUTINE mp_gather_i1 + +!------------------------------------------------------------------------------! +!..mp_gather_iv +!..Carlo Cavazzoni + SUBROUTINE mp_gather_iv(mydata, alldata, root, gid) + IMPLICIT NONE + INTEGER, INTENT(IN) :: mydata(:), root + INTEGER, OPTIONAL, INTENT(IN) :: gid + INTEGER :: group + INTEGER, INTENT(OUT) :: alldata(:,:) + INTEGER :: msglen, ierr + + +!!$#if defined (__MPI) + msglen = SIZE(mydata) + IF( msglen .NE. SIZE(alldata, 1) ) CALL mp_stop( 8000 ) + group = mpi_comm_world + IF( PRESENT( gid ) ) group = gid + CALL MPI_GATHER(mydata, msglen, MPI_INTEGER, alldata, msglen, MPI_INTEGER, root, group, IERR) + IF (ierr/=0) CALL mp_stop( 8001 ) +!!$#else +!!$ msglen = SIZE(mydata) +!!$ IF( msglen .NE. SIZE(alldata, 1) ) CALL mp_stop( 8002 ) +!!$ alldata(:,1) = mydata(:) +!!$#endif + RETURN + END SUBROUTINE mp_gather_iv + +! +!------------------------------------------------------------------------------! +!..mp_start + SUBROUTINE mp_start(numtask, taskid, groupid) + +! ... + IMPLICIT NONE + INTEGER, INTENT (OUT) :: numtask, taskid, groupid + INTEGER :: ierr +! ... + ierr = 0 + numtask = 1 + taskid = 0 + groupid = 0 + +# if defined(__MPI) + CALL mpi_init(ierr) + IF (ierr/=0) CALL mp_stop( 8003 ) + CALL mpi_comm_rank(mpi_comm_world,taskid,ierr) + IF (ierr/=0) CALL mp_stop( 8005 ) +#if defined __HPM + ! initialize the IBM Harware performance monitor + CALL f_hpminit( taskid, 'profiling' ) +#endif + CALL mpi_comm_size(mpi_comm_world,numtask,ierr) + groupid = mpi_comm_world + IF (ierr/=0) CALL mp_stop( 8006 ) +# endif + + RETURN + END SUBROUTINE mp_start +! +!------------------------------------------------------------------------------! +!..mp_end + + SUBROUTINE mp_end + IMPLICIT NONE + INTEGER :: ierr, taskid + + ierr = 0 + taskid = 0 + +#if defined __HPM + + ! terminate the IBM Harware performance monitor + +#if defined(__MPI) + CALL mpi_comm_rank( mpi_comm_world, taskid, ierr) +#endif + CALL f_hpmterminate( taskid ) +#endif + +#if defined(__MPI) + CALL mpi_finalize(ierr) + IF (ierr/=0) CALL mp_stop( 8004 ) +#endif + RETURN + END SUBROUTINE mp_end + +!------------------------------------------------------------------------------! +!..mp_group + + SUBROUTINE mp_comm_group( comm, group ) + IMPLICIT NONE + INTEGER, INTENT (IN) :: comm + INTEGER, INTENT (OUT) :: group + INTEGER :: ierr + ierr = 0 +#if defined(__MPI) + CALL mpi_comm_group( comm, group, ierr ) + IF (ierr/=0) CALL mp_stop( 8007 ) +#else + group = 0 +#endif + END SUBROUTINE mp_comm_group + + SUBROUTINE mp_comm_split( old_comm, color, key, new_comm ) + IMPLICIT NONE + INTEGER, INTENT (IN) :: old_comm + INTEGER, INTENT (IN) :: color, key + INTEGER, INTENT (OUT) :: new_comm + INTEGER :: ierr + ierr = 0 +#if defined(__MPI) + CALL MPI_COMM_SPLIT( old_comm, color, key, new_comm, ierr ) + IF (ierr/=0) CALL mp_stop( 8008 ) +#else + new_comm = old_comm +#endif + END SUBROUTINE mp_comm_split + + + SUBROUTINE mp_group_create( group_list, group_size, old_grp, new_grp ) + IMPLICIT NONE + INTEGER, INTENT (IN) :: group_list(:), group_size, old_grp + INTEGER, INTENT (OUT) :: new_grp + INTEGER :: ierr + + ierr = 0 + new_grp = old_grp +#if defined(__MPI) + CALL mpi_group_incl( old_grp, group_size, group_list, new_grp, ierr ) + IF (ierr/=0) CALL mp_stop( 8009 ) +#endif + END SUBROUTINE mp_group_create + +!------------------------------------------------------------------------------! + SUBROUTINE mp_comm_create( old_comm, new_grp, new_comm ) + IMPLICIT NONE + INTEGER, INTENT (IN) :: old_comm + INTEGER, INTENT (IN) :: new_grp + INTEGER, INTENT (OUT) :: new_comm + INTEGER :: ierr + + ierr = 0 + new_comm = old_comm +#if defined(__MPI) + CALL mpi_comm_create( old_comm, new_grp, new_comm, ierr ) + IF (ierr/=0) CALL mp_stop( 8010 ) +#endif + END SUBROUTINE mp_comm_create + +!------------------------------------------------------------------------------! +!..mp_group_free + SUBROUTINE mp_group_free( group ) + IMPLICIT NONE + INTEGER, INTENT (INOUT) :: group + INTEGER :: ierr + ierr = 0 +#if defined(__MPI) + CALL mpi_group_free( group, ierr ) + IF (ierr/=0) CALL mp_stop( 8011 ) +#endif + END SUBROUTINE mp_group_free +!------------------------------------------------------------------------------! + + SUBROUTINE mp_comm_free( comm ) + IMPLICIT NONE + INTEGER, INTENT (INOUT) :: comm + INTEGER :: ierr + ierr = 0 +#if defined(__MPI) + IF( comm /= MPI_COMM_NULL ) THEN + CALL mpi_comm_free( comm, ierr ) + IF (ierr/=0) CALL mp_stop( 8012 ) + END IF +#endif + RETURN + END SUBROUTINE mp_comm_free + +!------------------------------------------------------------------------------! +!..mp_bcast + + SUBROUTINE mp_bcast_i1(msg,source,gid) + IMPLICIT NONE + INTEGER :: msg + INTEGER :: source + INTEGER, OPTIONAL, INTENT(IN) :: gid + INTEGER :: group + INTEGER :: msglen + +#if defined(__MPI) + msglen = 1 + group = mpi_comm_world + IF( PRESENT( gid ) ) group = gid + CALL BCAST_INTEGER( msg, msglen, source, group ) +#endif + END SUBROUTINE mp_bcast_i1 +! +!------------------------------------------------------------------------------! + SUBROUTINE mp_bcast_iv(msg,source,gid) + IMPLICIT NONE + INTEGER :: msg(:) + INTEGER :: source + INTEGER, OPTIONAL, INTENT(IN) :: gid + INTEGER :: group + INTEGER :: msglen +#if defined(__MPI) + msglen = size(msg) + group = mpi_comm_world + IF( PRESENT( gid ) ) group = gid + CALL BCAST_INTEGER( msg, msglen, source, group ) +#endif + END SUBROUTINE mp_bcast_iv +! +!------------------------------------------------------------------------------! + SUBROUTINE mp_bcast_im( msg, source, gid ) + IMPLICIT NONE + INTEGER :: msg(:,:) + INTEGER :: source + INTEGER, OPTIONAL, INTENT(IN) :: gid + INTEGER :: group + INTEGER :: msglen +#if defined(__MPI) + msglen = size(msg) + group = mpi_comm_world + IF( PRESENT( gid ) ) group = gid + CALL BCAST_INTEGER( msg, msglen, source, group ) +#endif + END SUBROUTINE mp_bcast_im +! +!------------------------------------------------------------------------------! +! +! Carlo Cavazzoni +! + SUBROUTINE mp_bcast_it(msg,source,gid) + IMPLICIT NONE + INTEGER :: msg(:,:,:) + INTEGER :: source + INTEGER, OPTIONAL, INTENT(IN) :: gid + INTEGER :: group + INTEGER :: msglen +#if defined(__MPI) + msglen = size(msg) + group = mpi_comm_world + IF( PRESENT( gid ) ) group = gid + CALL BCAST_INTEGER( msg, msglen, source, group ) +#endif + END SUBROUTINE mp_bcast_it +! +!------------------------------------------------------------------------------! +! + SUBROUTINE mp_bcast_r1(msg,source,gid) + IMPLICIT NONE + REAL (DP) :: msg + INTEGER :: msglen, source + INTEGER, OPTIONAL, INTENT(IN) :: gid + INTEGER :: group +#if defined(__MPI) + msglen = 1 + group = mpi_comm_world + IF( PRESENT( gid ) ) group = gid + CALL bcast_real( msg, msglen, source, group ) +#endif + END SUBROUTINE mp_bcast_r1 +! +!------------------------------------------------------------------------------! +! + SUBROUTINE mp_bcast_rv(msg,source,gid) + IMPLICIT NONE + REAL (DP) :: msg(:) + INTEGER :: source + INTEGER, OPTIONAL, INTENT(IN) :: gid + INTEGER :: group + INTEGER :: msglen + +#if defined(__MPI) + msglen = size(msg) + group = mpi_comm_world + IF( PRESENT( gid ) ) group = gid + CALL bcast_real( msg, msglen, source, group ) +#endif + END SUBROUTINE mp_bcast_rv +! +!------------------------------------------------------------------------------! +! + SUBROUTINE mp_bcast_rm(msg,source,gid) + IMPLICIT NONE + REAL (DP) :: msg(:,:) + INTEGER :: source + INTEGER, OPTIONAL, INTENT(IN) :: gid + INTEGER :: group + INTEGER :: msglen +#if defined(__MPI) + msglen = size(msg) + group = mpi_comm_world + IF( PRESENT( gid ) ) group = gid + CALL bcast_real( msg, msglen, source, group ) +#endif + END SUBROUTINE mp_bcast_rm +! +!------------------------------------------------------------------------------! +! +! Carlo Cavazzoni +! + SUBROUTINE mp_bcast_rt(msg,source,gid) + IMPLICIT NONE + REAL (DP) :: msg(:,:,:) + INTEGER :: source + INTEGER, OPTIONAL, INTENT(IN) :: gid + INTEGER :: group + INTEGER :: msglen +#if defined(__MPI) + msglen = size(msg) + group = mpi_comm_world + IF( PRESENT( gid ) ) group = gid + CALL bcast_real( msg, msglen, source, group ) +#endif + END SUBROUTINE mp_bcast_rt +! +!------------------------------------------------------------------------------! +! +! Carlo Cavazzoni +! + SUBROUTINE mp_bcast_r4d(msg, source, gid) + IMPLICIT NONE + REAL (DP) :: msg(:,:,:,:) + INTEGER :: source + INTEGER, OPTIONAL, INTENT(IN) :: gid + INTEGER :: group + INTEGER :: msglen +#if defined(__MPI) + msglen = size(msg) + group = mpi_comm_world + IF( PRESENT( gid ) ) group = gid + CALL bcast_real( msg, msglen, source, group ) +#endif + END SUBROUTINE mp_bcast_r4d + +! +!------------------------------------------------------------------------------! +! +! Carlo Cavazzoni +! + SUBROUTINE mp_bcast_r5d(msg, source, gid) + IMPLICIT NONE + REAL (DP) :: msg(:,:,:,:,:) + INTEGER :: source + INTEGER, OPTIONAL, INTENT(IN) :: gid + INTEGER :: group + INTEGER :: msglen +#if defined(__MPI) + msglen = size(msg) + group = mpi_comm_world + IF( PRESENT( gid ) ) group = gid + CALL bcast_real( msg, msglen, source, group ) +#endif + END SUBROUTINE mp_bcast_r5d + +!------------------------------------------------------------------------------! +! + SUBROUTINE mp_bcast_c1(msg,source,gid) + IMPLICIT NONE + COMPLEX (DP) :: msg + INTEGER :: source + INTEGER, OPTIONAL, INTENT(IN) :: gid + INTEGER :: group + INTEGER :: msglen +#if defined(__MPI) + msglen = 1 + group = mpi_comm_world + IF( PRESENT( gid ) ) group = gid + CALL bcast_real( msg, 2 * msglen, source, group ) +#endif + END SUBROUTINE mp_bcast_c1 +! +!------------------------------------------------------------------------------! + SUBROUTINE mp_bcast_cv(msg,source,gid) + IMPLICIT NONE + COMPLEX (DP) :: msg(:) + INTEGER :: source + INTEGER, OPTIONAL, INTENT(IN) :: gid + INTEGER :: group + INTEGER :: msglen +#if defined(__MPI) + msglen = size(msg) + group = mpi_comm_world + IF( PRESENT( gid ) ) group = gid + CALL bcast_real( msg, 2 * msglen, source, group ) +#endif + END SUBROUTINE mp_bcast_cv +! +!------------------------------------------------------------------------------! + SUBROUTINE mp_bcast_cm(msg,source,gid) + IMPLICIT NONE + COMPLEX (DP) :: msg(:,:) + INTEGER :: source + INTEGER, OPTIONAL, INTENT(IN) :: gid + INTEGER :: group + INTEGER :: msglen +#if defined(__MPI) + msglen = size(msg) + group = mpi_comm_world + IF( PRESENT( gid ) ) group = gid + CALL bcast_real( msg, 2 * msglen, source, group ) +#endif + END SUBROUTINE mp_bcast_cm +! +!------------------------------------------------------------------------------! + SUBROUTINE mp_bcast_ct(msg,source,gid) + IMPLICIT NONE + COMPLEX (DP) :: msg(:,:,:) + INTEGER :: source + INTEGER, OPTIONAL, INTENT(IN) :: gid + INTEGER :: group + INTEGER :: msglen +#if defined(__MPI) + msglen = size(msg) + group = mpi_comm_world + IF( PRESENT( gid ) ) group = gid + CALL bcast_real( msg, 2 * msglen, source, group ) +#endif + END SUBROUTINE mp_bcast_ct + +! +!------------------------------------------------------------------------------! + SUBROUTINE mp_bcast_c4d(msg,source,gid) + IMPLICIT NONE + COMPLEX (DP) :: msg(:,:,:,:) + INTEGER :: source + INTEGER, OPTIONAL, INTENT(IN) :: gid + INTEGER :: group + INTEGER :: msglen +#if defined(__MPI) + msglen = size(msg) + group = mpi_comm_world + IF( PRESENT( gid ) ) group = gid + CALL bcast_real( msg, 2 * msglen, source, group ) +#endif + END SUBROUTINE mp_bcast_c4d + + SUBROUTINE mp_bcast_c5d(msg,source,gid) + IMPLICIT NONE + COMPLEX (DP) :: msg(:,:,:,:,:) + INTEGER :: source + INTEGER, OPTIONAL, INTENT(IN) :: gid + INTEGER :: group + INTEGER :: msglen +#if defined(__MPI) + msglen = size(msg) + group = mpi_comm_world + IF( PRESENT( gid ) ) group = gid + CALL bcast_real( msg, 2 * msglen, source, group ) +#endif + END SUBROUTINE mp_bcast_c5d + +! +!------------------------------------------------------------------------------! + + SUBROUTINE mp_bcast_l(msg,source,gid) + IMPLICIT NONE + LOGICAL :: msg + INTEGER :: source + INTEGER, OPTIONAL, INTENT(IN) :: gid + INTEGER :: group + INTEGER :: msglen +#if defined(__MPI) + msglen = 1 + group = mpi_comm_world + IF( PRESENT( gid ) ) group = gid + CALL bcast_logical( msg, msglen, source, group ) +#endif + END SUBROUTINE mp_bcast_l +! +!------------------------------------------------------------------------------! +! +! Carlo Cavazzoni +! + SUBROUTINE mp_bcast_lv(msg,source,gid) + IMPLICIT NONE + LOGICAL :: msg(:) + INTEGER :: source + INTEGER, OPTIONAL, INTENT(IN) :: gid + INTEGER :: group + INTEGER :: msglen +#if defined(__MPI) + msglen = size(msg) + group = mpi_comm_world + IF( PRESENT( gid ) ) group = gid + CALL bcast_logical( msg, msglen, source, group ) +#endif + END SUBROUTINE mp_bcast_lv + +!------------------------------------------------------------------------------! +! +! Carlo Cavazzoni +! + SUBROUTINE mp_bcast_lm(msg,source,gid) + IMPLICIT NONE + LOGICAL :: msg(:,:) + INTEGER :: source + INTEGER, OPTIONAL, INTENT(IN) :: gid + INTEGER :: group + INTEGER :: msglen +#if defined(__MPI) + msglen = size(msg) + group = mpi_comm_world + IF( PRESENT( gid ) ) group = gid + CALL bcast_logical( msg, msglen, source, group ) +#endif + END SUBROUTINE mp_bcast_lm + + +! +!------------------------------------------------------------------------------! +! + SUBROUTINE mp_bcast_z(msg,source,gid) + IMPLICIT NONE + CHARACTER (len=*) :: msg + INTEGER :: source + INTEGER, OPTIONAL, INTENT(IN) :: gid + INTEGER :: group + INTEGER :: msglen, ierr, i + INTEGER, ALLOCATABLE :: imsg(:) +#if defined(__MPI) + ierr = 0 + msglen = len(msg) + group = mpi_comm_world + IF( PRESENT( gid ) ) group = gid + IF (ierr/=0) CALL mp_stop( 8014 ) + ALLOCATE (imsg(1:msglen), STAT=ierr) + IF (ierr/=0) CALL mp_stop( 8015 ) + DO i = 1, msglen + imsg(i) = ichar(msg(i:i)) + END DO + CALL bcast_integer( imsg, msglen, source, group ) + DO i = 1, msglen + msg(i:i) = char(imsg(i)) + END DO + DEALLOCATE (imsg, STAT=ierr) + IF (ierr/=0) CALL mp_stop( 8016 ) +#endif + END SUBROUTINE mp_bcast_z +! +!------------------------------------------------------------------------------! +! +!------------------------------------------------------------------------------! +! + SUBROUTINE mp_bcast_zv(msg,source,gid) + IMPLICIT NONE + CHARACTER (len=*) :: msg(:) + INTEGER :: source + INTEGER, OPTIONAL, INTENT(IN) :: gid + INTEGER :: group + INTEGER :: msglen, m1, m2, ierr, i, j + INTEGER, ALLOCATABLE :: imsg(:,:) +#if defined(__MPI) + ierr = 0 + m1 = LEN(msg) + m2 = SIZE(msg) + msglen = LEN(msg)*SIZE(msg) + group = mpi_comm_world + IF( PRESENT( gid ) ) group = gid + ALLOCATE (imsg(1:m1,1:m2), STAT=ierr) + IF (ierr/=0) CALL mp_stop( 8017 ) + DO j = 1, m2 + DO i = 1, m1 + imsg(i,j) = ichar(msg(j)(i:i)) + END DO + END DO + CALL bcast_integer( imsg, msglen, source, group ) + DO j = 1, m2 + DO i = 1, m1 + msg(j)(i:i) = char(imsg(i,j)) + END DO + END DO + DEALLOCATE (imsg, STAT=ierr) + IF (ierr/=0) CALL mp_stop( 8018 ) +#endif + END SUBROUTINE mp_bcast_zv +! +!------------------------------------------------------------------------------! +! +! Carlo Cavazzoni +! + SUBROUTINE mp_get_i1(msg_dest, msg_sour, mpime, dest, sour, ip, gid) + INTEGER :: msg_dest, msg_sour + INTEGER, INTENT(IN) :: dest, sour, ip, mpime + INTEGER, OPTIONAL, INTENT(IN) :: gid + INTEGER :: group +#if defined(__MPI) + INTEGER :: istatus(MPI_STATUS_SIZE) +#endif + INTEGER :: ierr, nrcv + INTEGER :: msglen = 1 + +#if defined(__MPI) + group = mpi_comm_world + IF( PRESENT( gid ) ) group = gid +#endif + + ! processors not taking part in the communication have 0 length message + + msglen = 0 + + IF(dest .NE. sour) THEN +#if defined(__MPI) + IF(mpime .EQ. sour) THEN + msglen=1 + CALL MPI_SEND( msg_sour, msglen, MPI_INTEGER, dest, ip, group, ierr) + IF (ierr/=0) CALL mp_stop( 8019 ) + ELSE IF(mpime .EQ. dest) THEN + msglen=1 + CALL MPI_RECV( msg_dest, msglen, MPI_INTEGER, sour, ip, group, istatus, IERR ) + IF (ierr/=0) CALL mp_stop( 8020 ) + CALL MPI_GET_COUNT(istatus, MPI_INTEGER, nrcv, ierr) + IF (ierr/=0) CALL mp_stop( 8021 ) + END IF +#endif + ELSEIF(mpime .EQ. sour)THEN + msg_dest = msg_sour + msglen = 1 + END IF + +#if defined(__MPI) + CALL MPI_BARRIER(group, IERR) + IF (ierr/=0) CALL mp_stop( 8022 ) +#endif + + + RETURN + END SUBROUTINE mp_get_i1 + +!------------------------------------------------------------------------------! +! +! Carlo Cavazzoni +! + SUBROUTINE mp_get_iv(msg_dest, msg_sour, mpime, dest, sour, ip, gid) + INTEGER :: msg_dest(:), msg_sour(:) + INTEGER, INTENT(IN) :: dest, sour, ip, mpime + INTEGER, OPTIONAL, INTENT(IN) :: gid + INTEGER :: group +#if defined(__MPI) + INTEGER :: istatus(MPI_STATUS_SIZE) +#endif + INTEGER :: ierr, nrcv + INTEGER :: msglen + +#if defined(__MPI) + group = mpi_comm_world + IF( PRESENT( gid ) ) group = gid +#endif + + ! processors not taking part in the communication have 0 length message + + msglen = 0 + + IF(sour .NE. dest) THEN +#if defined(__MPI) + IF(mpime .EQ. sour) THEN + msglen = SIZE(msg_sour) + CALL MPI_SEND( msg_sour, SIZE(msg_sour), MPI_INTEGER, dest, ip, group, ierr) + IF (ierr/=0) CALL mp_stop( 8023 ) + ELSE IF(mpime .EQ. dest) THEN + CALL MPI_RECV( msg_dest, SIZE(msg_dest), MPI_INTEGER, sour, ip, group, istatus, IERR ) + IF (ierr/=0) CALL mp_stop( 8024 ) + CALL MPI_GET_COUNT(istatus, MPI_INTEGER, nrcv, ierr) + IF (ierr/=0) CALL mp_stop( 8025 ) + msglen = nrcv + END IF +#endif + ELSEIF(mpime .EQ. sour)THEN + msg_dest(1:SIZE(msg_sour)) = msg_sour(:) + msglen = SIZE(msg_sour) + END IF +#if defined(__MPI) + CALL MPI_BARRIER(group, IERR) + IF (ierr/=0) CALL mp_stop( 8026 ) +#endif + RETURN + END SUBROUTINE mp_get_iv + +!------------------------------------------------------------------------------! + + SUBROUTINE mp_get_r1(msg_dest, msg_sour, mpime, dest, sour, ip, gid) + REAL (DP) :: msg_dest, msg_sour + INTEGER, INTENT(IN) :: dest, sour, ip, mpime + INTEGER, OPTIONAL, INTENT(IN) :: gid + INTEGER :: group +#if defined(__MPI) + INTEGER :: istatus(MPI_STATUS_SIZE) +#endif + INTEGER :: ierr, nrcv + INTEGER :: msglen + +#if defined(__MPI) + group = mpi_comm_world + IF( PRESENT( gid ) ) group = gid +#endif + + ! processors not taking part in the communication have 0 length message + + msglen = 0 + + IF(sour .NE. dest) THEN +#if defined(__MPI) + IF(mpime .EQ. sour) THEN + msglen = 1 + CALL MPI_SEND( msg_sour, msglen, MPI_DOUBLE_PRECISION, dest, ip, group, ierr) + IF (ierr/=0) CALL mp_stop( 8027 ) + ELSE IF(mpime .EQ. dest) THEN + CALL MPI_RECV( msg_dest, msglen, MPI_DOUBLE_PRECISION, sour, ip, group, istatus, IERR ) + IF (ierr/=0) CALL mp_stop( 8028 ) + CALL MPI_GET_COUNT(istatus, MPI_DOUBLE_PRECISION, nrcv, ierr) + IF (ierr/=0) CALL mp_stop( 8029 ) + msglen = nrcv + END IF +#endif + ELSEIF(mpime .EQ. sour)THEN + msg_dest = msg_sour + msglen = 1 + END IF +#if defined(__MPI) + CALL MPI_BARRIER(group, IERR) + IF (ierr/=0) CALL mp_stop( 8030 ) +#endif + RETURN + END SUBROUTINE mp_get_r1 + +!------------------------------------------------------------------------------! +! +! Carlo Cavazzoni +! + SUBROUTINE mp_get_rv(msg_dest, msg_sour, mpime, dest, sour, ip, gid) + REAL (DP) :: msg_dest(:), msg_sour(:) + INTEGER, INTENT(IN) :: dest, sour, ip, mpime + INTEGER, OPTIONAL, INTENT(IN) :: gid + INTEGER :: group +#if defined(__MPI) + INTEGER :: istatus(MPI_STATUS_SIZE) +#endif + INTEGER :: ierr, nrcv + INTEGER :: msglen + +#if defined(__MPI) + group = mpi_comm_world + IF( PRESENT( gid ) ) group = gid +#endif + + ! processors not taking part in the communication have 0 length message + + msglen = 0 + + IF(sour .NE. dest) THEN +#if defined(__MPI) + IF(mpime .EQ. sour) THEN + msglen = SIZE(msg_sour) + CALL MPI_SEND( msg_sour, SIZE(msg_sour), MPI_DOUBLE_PRECISION, dest, ip, group, ierr) + IF (ierr/=0) CALL mp_stop( 8027 ) + ELSE IF(mpime .EQ. dest) THEN + CALL MPI_RECV( msg_dest, SIZE(msg_dest), MPI_DOUBLE_PRECISION, sour, ip, group, istatus, IERR ) + IF (ierr/=0) CALL mp_stop( 8028 ) + CALL MPI_GET_COUNT(istatus, MPI_DOUBLE_PRECISION, nrcv, ierr) + IF (ierr/=0) CALL mp_stop( 8029 ) + msglen = nrcv + END IF +#endif + ELSEIF(mpime .EQ. sour)THEN + msg_dest(1:SIZE(msg_sour)) = msg_sour(:) + msglen = SIZE(msg_sour) + END IF +#if defined(__MPI) + CALL MPI_BARRIER(group, IERR) + IF (ierr/=0) CALL mp_stop( 8030 ) +#endif + RETURN + END SUBROUTINE mp_get_rv + +!------------------------------------------------------------------------------! +! +! Carlo Cavazzoni +! + SUBROUTINE mp_get_rm(msg_dest, msg_sour, mpime, dest, sour, ip, gid) + REAL (DP) :: msg_dest(:,:), msg_sour(:,:) + INTEGER, INTENT(IN) :: dest, sour, ip, mpime + INTEGER, OPTIONAL, INTENT(IN) :: gid + INTEGER :: group +#if defined(__MPI) + INTEGER :: istatus(MPI_STATUS_SIZE) +#endif + INTEGER :: ierr, nrcv + INTEGER :: msglen + +#if defined(__MPI) + group = mpi_comm_world + IF( PRESENT( gid ) ) group = gid +#endif + + ! processors not taking part in the communication have 0 length message + + msglen = 0 + + IF(sour .NE. dest) THEN +#if defined(__MPI) + IF(mpime .EQ. sour) THEN + CALL MPI_SEND( msg_sour, SIZE(msg_sour), MPI_DOUBLE_PRECISION, dest, ip, group, ierr) + IF (ierr/=0) CALL mp_stop( 8031 ) + msglen = SIZE(msg_sour) + ELSE IF(mpime .EQ. dest) THEN + CALL MPI_RECV( msg_dest, SIZE(msg_dest), MPI_DOUBLE_PRECISION, sour, ip, group, istatus, IERR ) + IF (ierr/=0) CALL mp_stop( 8032 ) + CALL MPI_GET_COUNT(istatus, MPI_DOUBLE_PRECISION, nrcv, ierr) + IF (ierr/=0) CALL mp_stop( 8033 ) + msglen = nrcv + END IF +#endif + ELSEIF(mpime .EQ. sour)THEN + msg_dest(1:SIZE(msg_sour,1), 1:SIZE(msg_sour,2)) = msg_sour(:,:) + msglen = SIZE( msg_sour ) + END IF +#if defined(__MPI) + CALL MPI_BARRIER(group, IERR) + IF (ierr/=0) CALL mp_stop( 8034 ) +#endif + RETURN + END SUBROUTINE mp_get_rm + + +!------------------------------------------------------------------------------! +! +! Carlo Cavazzoni +! + SUBROUTINE mp_get_cv(msg_dest, msg_sour, mpime, dest, sour, ip, gid) + COMPLEX (DP) :: msg_dest(:), msg_sour(:) + INTEGER, INTENT(IN) :: dest, sour, ip, mpime + INTEGER, OPTIONAL, INTENT(IN) :: gid + INTEGER :: group +#if defined(__MPI) + INTEGER :: istatus(MPI_STATUS_SIZE) +#endif + INTEGER :: ierr, nrcv + INTEGER :: msglen + +#if defined(__MPI) + group = mpi_comm_world + IF( PRESENT( gid ) ) group = gid +#endif + + ! processors not taking part in the communication have 0 length message + + msglen = 0 + + IF( dest .NE. sour ) THEN +#if defined(__MPI) + IF(mpime .EQ. sour) THEN + CALL MPI_SEND( msg_sour, SIZE(msg_sour), MPI_DOUBLE_COMPLEX, dest, ip, group, ierr) + IF (ierr/=0) CALL mp_stop( 8035 ) + msglen = SIZE(msg_sour) + ELSE IF(mpime .EQ. dest) THEN + CALL MPI_RECV( msg_dest, SIZE(msg_dest), MPI_DOUBLE_COMPLEX, sour, ip, group, istatus, IERR ) + IF (ierr/=0) CALL mp_stop( 8036 ) + CALL MPI_GET_COUNT(istatus, MPI_DOUBLE_COMPLEX, nrcv, ierr) + IF (ierr/=0) CALL mp_stop( 8037 ) + msglen = nrcv + END IF +#endif + ELSEIF(mpime .EQ. sour)THEN + msg_dest(1:SIZE(msg_sour)) = msg_sour(:) + msglen = SIZE(msg_sour) + END IF +#if defined(__MPI) + CALL MPI_BARRIER(group, IERR) + IF (ierr/=0) CALL mp_stop( 8038 ) +#endif + RETURN + END SUBROUTINE mp_get_cv +!------------------------------------------------------------------------------! +! +! +!------------------------------------------------------------------------------! + + + SUBROUTINE mp_put_i1(msg_dest, msg_sour, mpime, sour, dest, ip, gid) + INTEGER :: msg_dest, msg_sour + INTEGER, INTENT(IN) :: dest, sour, ip, mpime + INTEGER, OPTIONAL, INTENT(IN) :: gid + INTEGER :: group +#if defined(__MPI) + INTEGER :: istatus(MPI_STATUS_SIZE) +#endif + INTEGER :: ierr, nrcv + INTEGER :: msglen + +#if defined(__MPI) + group = mpi_comm_world + IF( PRESENT( gid ) ) group = gid +#endif + + ! processors not taking part in the communication have 0 length message + + msglen = 0 + + IF(dest .NE. sour) THEN +#if defined(__MPI) + IF(mpime .EQ. sour) THEN + CALL MPI_SEND( msg_sour, 1, MPI_INTEGER, dest, ip, group, ierr) + IF (ierr/=0) CALL mp_stop( 8039 ) + msglen = 1 + ELSE IF(mpime .EQ. dest) THEN + CALL MPI_RECV( msg_dest, 1, MPI_INTEGER, sour, ip, group, istatus, IERR ) + IF (ierr/=0) CALL mp_stop( 8040 ) + CALL MPI_GET_COUNT(istatus, MPI_INTEGER, nrcv, ierr) + IF (ierr/=0) CALL mp_stop( 8041 ) + msglen = 1 + END IF +#endif + ELSEIF(mpime .EQ. sour)THEN + msg_dest = msg_sour + msglen = 1 + END IF +#if defined(__MPI) + CALL MPI_BARRIER(group, IERR) + IF (ierr/=0) CALL mp_stop( 8042 ) +#endif + RETURN + END SUBROUTINE mp_put_i1 + +!------------------------------------------------------------------------------! +! +! + SUBROUTINE mp_put_iv(msg_dest, msg_sour, mpime, sour, dest, ip, gid) + INTEGER :: msg_dest(:), msg_sour(:) + INTEGER, INTENT(IN) :: dest, sour, ip, mpime + INTEGER, OPTIONAL, INTENT(IN) :: gid + INTEGER :: group +#if defined(__MPI) + INTEGER :: istatus(MPI_STATUS_SIZE) +#endif + INTEGER :: ierr, nrcv + INTEGER :: msglen +#if defined(__MPI) + group = mpi_comm_world + IF( PRESENT( gid ) ) group = gid +#endif + ! processors not taking part in the communication have 0 length message + + msglen = 0 + + IF(sour .NE. dest) THEN +#if defined(__MPI) + IF(mpime .EQ. sour) THEN + CALL MPI_SEND( msg_sour, SIZE(msg_sour), MPI_INTEGER, dest, ip, group, ierr) + IF (ierr/=0) CALL mp_stop( 8043 ) + msglen = SIZE(msg_sour) + ELSE IF(mpime .EQ. dest) THEN + CALL MPI_RECV( msg_dest, SIZE(msg_dest), MPI_INTEGER, sour, ip, group, istatus, IERR ) + IF (ierr/=0) CALL mp_stop( 8044 ) + CALL MPI_GET_COUNT(istatus, MPI_INTEGER, nrcv, ierr) + IF (ierr/=0) CALL mp_stop( 8045 ) + msglen = nrcv + END IF +#endif + ELSEIF(mpime .EQ. sour)THEN + msg_dest(1:SIZE(msg_sour)) = msg_sour(:) + msglen = SIZE(msg_sour) + END IF +#if defined(__MPI) + CALL MPI_BARRIER(group, IERR) + IF (ierr/=0) CALL mp_stop( 8046 ) +#endif + RETURN + END SUBROUTINE mp_put_iv + +!------------------------------------------------------------------------------! +! +! + SUBROUTINE mp_put_rv(msg_dest, msg_sour, mpime, sour, dest, ip, gid) + REAL (DP) :: msg_dest(:), msg_sour(:) + INTEGER, INTENT(IN) :: dest, sour, ip, mpime + INTEGER, OPTIONAL, INTENT(IN) :: gid + INTEGER :: group +#if defined(__MPI) + INTEGER :: istatus(MPI_STATUS_SIZE) +#endif + INTEGER :: ierr, nrcv + INTEGER :: msglen +#if defined(__MPI) + group = mpi_comm_world + IF( PRESENT( gid ) ) group = gid +#endif + ! processors not taking part in the communication have 0 length message + + msglen = 0 + + IF(sour .NE. dest) THEN +#if defined(__MPI) + IF(mpime .EQ. sour) THEN + CALL MPI_SEND( msg_sour, SIZE(msg_sour), MPI_DOUBLE_PRECISION, dest, ip, group, ierr) + IF (ierr/=0) CALL mp_stop( 8047 ) + msglen = SIZE(msg_sour) + ELSE IF(mpime .EQ. dest) THEN + CALL MPI_RECV( msg_dest, SIZE(msg_dest), MPI_DOUBLE_PRECISION, sour, ip, group, istatus, IERR ) + IF (ierr/=0) CALL mp_stop( 8048 ) + CALL MPI_GET_COUNT(istatus, MPI_DOUBLE_PRECISION, nrcv, ierr) + IF (ierr/=0) CALL mp_stop( 8049 ) + msglen = nrcv + END IF +#endif + ELSEIF(mpime .EQ. sour)THEN + msg_dest(1:SIZE(msg_sour)) = msg_sour(:) + msglen = SIZE(msg_sour) + END IF +#if defined(__MPI) + CALL MPI_BARRIER(group, IERR) + IF (ierr/=0) CALL mp_stop( 8050 ) +#endif + RETURN + END SUBROUTINE mp_put_rv + +!------------------------------------------------------------------------------! +! +! + SUBROUTINE mp_put_rm(msg_dest, msg_sour, mpime, sour, dest, ip, gid) + REAL (DP) :: msg_dest(:,:), msg_sour(:,:) + INTEGER, INTENT(IN) :: dest, sour, ip, mpime + INTEGER, OPTIONAL, INTENT(IN) :: gid + INTEGER :: group +#if defined(__MPI) + INTEGER :: istatus(MPI_STATUS_SIZE) +#endif + INTEGER :: ierr, nrcv + INTEGER :: msglen +#if defined(__MPI) + group = mpi_comm_world + IF( PRESENT( gid ) ) group = gid +#endif + ! processors not taking part in the communication have 0 length message + + msglen = 0 + + IF(sour .NE. dest) THEN +#if defined(__MPI) + IF(mpime .EQ. sour) THEN + CALL MPI_SEND( msg_sour, SIZE(msg_sour), MPI_DOUBLE_PRECISION, dest, ip, group, ierr) + IF (ierr/=0) CALL mp_stop( 8051 ) + msglen = SIZE(msg_sour) + ELSE IF(mpime .EQ. dest) THEN + CALL MPI_RECV( msg_dest, SIZE(msg_dest), MPI_DOUBLE_PRECISION, sour, ip, group, istatus, IERR ) + IF (ierr/=0) CALL mp_stop( 8052 ) + CALL MPI_GET_COUNT(istatus, MPI_DOUBLE_PRECISION, nrcv, ierr) + IF (ierr/=0) CALL mp_stop( 8053 ) + msglen = nrcv + END IF +#endif + ELSEIF(mpime .EQ. sour)THEN + msg_dest(1:SIZE(msg_sour,1),1:SIZE(msg_sour,2)) = msg_sour(:,:) + msglen = SIZE(msg_sour) + END IF +#if defined(__MPI) + CALL MPI_BARRIER(group, IERR) + IF (ierr/=0) CALL mp_stop( 8054 ) +#endif + RETURN + END SUBROUTINE mp_put_rm + + +!------------------------------------------------------------------------------! +! +! + SUBROUTINE mp_put_cv(msg_dest, msg_sour, mpime, sour, dest, ip, gid) + COMPLEX (DP) :: msg_dest(:), msg_sour(:) + INTEGER, INTENT(IN) :: dest, sour, ip, mpime + INTEGER, OPTIONAL, INTENT(IN) :: gid + INTEGER :: group +#if defined(__MPI) + INTEGER :: istatus(MPI_STATUS_SIZE) +#endif + INTEGER :: ierr, nrcv + INTEGER :: msglen +#if defined(__MPI) + group = mpi_comm_world + IF( PRESENT( gid ) ) group = gid +#endif + ! processors not taking part in the communication have 0 length message + + msglen = 0 + + IF( dest .NE. sour ) THEN +#if defined(__MPI) + IF(mpime .EQ. sour) THEN + CALL MPI_SEND( msg_sour, SIZE(msg_sour), MPI_DOUBLE_COMPLEX, dest, ip, group, ierr) + IF (ierr/=0) CALL mp_stop( 8055 ) + msglen = SIZE(msg_sour) + ELSE IF(mpime .EQ. dest) THEN + CALL MPI_RECV( msg_dest, SIZE(msg_dest), MPI_DOUBLE_COMPLEX, sour, ip, group, istatus, IERR ) + IF (ierr/=0) CALL mp_stop( 8056 ) + CALL MPI_GET_COUNT(istatus, MPI_DOUBLE_COMPLEX, nrcv, ierr) + IF (ierr/=0) CALL mp_stop( 8057 ) + msglen = nrcv + END IF +#endif + ELSEIF(mpime .EQ. sour)THEN + msg_dest(1:SIZE(msg_sour)) = msg_sour(:) + msglen = SIZE(msg_sour) + END IF +#if defined(__MPI) + CALL MPI_BARRIER(group, IERR) + IF (ierr/=0) CALL mp_stop( 8058 ) +#endif + RETURN + END SUBROUTINE mp_put_cv + +! +!------------------------------------------------------------------------------! +! +!..mp_stop +! + SUBROUTINE mp_stop(code) + IMPLICIT NONE + INTEGER, INTENT (IN) :: code + WRITE( stdout, fmt='( "*** error in Message Passing (mp) module ***")' ) + WRITE( stdout, fmt='( "*** error msg: ",A60)' ) TRIM( err_msg ) + WRITE( stdout, fmt='( "*** error code: ",I5)' ) code +#if defined(__MPI) + CALL mpi_abort(mpi_comm_world,code) +#endif + STOP + END SUBROUTINE mp_stop +!------------------------------------------------------------------------------! +! +!..mp_sum + SUBROUTINE mp_sum_i1(msg,gid) + IMPLICIT NONE + INTEGER, INTENT (INOUT) :: msg + INTEGER, OPTIONAL, INTENT(IN) :: gid + INTEGER :: group + INTEGER :: msglen +#if defined(__MPI) + msglen = 1 + group = mpi_comm_world + IF( PRESENT( gid ) ) group = gid + CALL reduce_base_integer( msglen, msg, group, -1 ) +#endif + END SUBROUTINE mp_sum_i1 +! +!------------------------------------------------------------------------------! + SUBROUTINE mp_sum_iv(msg,gid) + IMPLICIT NONE + INTEGER, INTENT (INOUT) :: msg(:) + INTEGER, OPTIONAL, INTENT(IN) :: gid + INTEGER :: group + INTEGER :: msglen +#if defined(__MPI) + group = mpi_comm_world + IF( PRESENT( gid ) ) group = gid + msglen = size(msg) + CALL reduce_base_integer( msglen, msg, group, -1 ) +#endif + END SUBROUTINE mp_sum_iv +! +!------------------------------------------------------------------------------! + + SUBROUTINE mp_sum_im(msg,gid) + IMPLICIT NONE + INTEGER, INTENT (INOUT) :: msg(:,:) + INTEGER, OPTIONAL, INTENT(IN) :: gid + INTEGER :: group + INTEGER :: msglen +#if defined(__MPI) + group = mpi_comm_world + IF( PRESENT( gid ) ) group = gid + msglen = size(msg) + CALL reduce_base_integer( msglen, msg, group, -1 ) +#endif + END SUBROUTINE mp_sum_im +! +!------------------------------------------------------------------------------! + + SUBROUTINE mp_sum_it(msg,gid) + IMPLICIT NONE + INTEGER, INTENT (INOUT) :: msg(:,:,:) + INTEGER, OPTIONAL, INTENT (IN) :: gid + INTEGER :: group + INTEGER :: msglen +#if defined(__MPI) + group = mpi_comm_world + IF( PRESENT( gid ) ) group = gid + msglen = size(msg) + CALL reduce_base_integer( msglen, msg, group, -1 ) +#endif + END SUBROUTINE mp_sum_it + +!------------------------------------------------------------------------------! + + SUBROUTINE mp_sum_r1(msg,gid) + IMPLICIT NONE + REAL (DP), INTENT (INOUT) :: msg + INTEGER, OPTIONAL, INTENT (IN) :: gid + INTEGER :: group + INTEGER :: msglen +#if defined(__MPI) + msglen = 1 + group = mpi_comm_world + IF( PRESENT( gid ) ) group = gid + CALL reduce_base_real( msglen, msg, group, -1 ) +#endif + END SUBROUTINE mp_sum_r1 + +! +!------------------------------------------------------------------------------! + + SUBROUTINE mp_sum_rv(msg,gid) + IMPLICIT NONE + REAL (DP), INTENT (INOUT) :: msg(:) + INTEGER, OPTIONAL, INTENT (IN) :: gid + INTEGER :: group + INTEGER :: msglen +#if defined(__MPI) + msglen = size(msg) + group = mpi_comm_world + IF( PRESENT( gid ) ) group = gid + CALL reduce_base_real( msglen, msg, group, -1 ) +#endif + END SUBROUTINE mp_sum_rv +! +!------------------------------------------------------------------------------! + + + SUBROUTINE mp_sum_rm(msg, gid) + IMPLICIT NONE + REAL (DP), INTENT (INOUT) :: msg(:,:) + INTEGER, OPTIONAL, INTENT (IN) :: gid + INTEGER :: group + INTEGER :: msglen +#if defined(__MPI) + msglen = size(msg) + group = mpi_comm_world + IF( PRESENT( gid ) ) group = gid + CALL reduce_base_real( msglen, msg, group, -1 ) +#endif + END SUBROUTINE mp_sum_rm + + + SUBROUTINE mp_root_sum_rm( msg, res, root, gid ) + IMPLICIT NONE + REAL (DP), INTENT (IN) :: msg(:,:) + REAL (DP), INTENT (OUT) :: res(:,:) + INTEGER, INTENT (IN) :: root + INTEGER, OPTIONAL, INTENT (IN) :: gid + INTEGER :: group + INTEGER :: msglen, ierr, taskid + +#if defined(__MPI) + + msglen = size(msg) + group = mpi_comm_world + IF( PRESENT( gid ) ) group = gid + + CALL mpi_comm_rank( group, taskid, ierr) + IF( ierr /= 0 ) CALL mp_stop( 8059 ) + ! + IF( taskid == root ) THEN + IF( msglen > size(res) ) CALL mp_stop( 8060 ) + END IF + + CALL reduce_base_real_to( msglen, msg, res, group, root ) + + +#else + + res = msg + +#endif + + END SUBROUTINE mp_root_sum_rm + + + SUBROUTINE mp_root_sum_cm( msg, res, root, gid ) + IMPLICIT NONE + COMPLEX (DP), INTENT (IN) :: msg(:,:) + COMPLEX (DP), INTENT (OUT) :: res(:,:) + INTEGER, INTENT (IN) :: root + INTEGER, OPTIONAL, INTENT (IN) :: gid + INTEGER :: group + INTEGER :: msglen, ierr, taskid + +#if defined(__MPI) + + msglen = size(msg) + + group = mpi_comm_world + IF( PRESENT( gid ) ) group = gid + + CALL mpi_comm_rank( group, taskid, ierr) + IF( ierr /= 0 ) CALL mp_stop( 8061 ) + + IF( taskid == root ) THEN + IF( msglen > size(res) ) CALL mp_stop( 8062 ) + END IF + + CALL reduce_base_real_to( 2 * msglen, msg, res, group, root ) + + +#else + + res = msg + +#endif + + END SUBROUTINE mp_root_sum_cm + +! +!------------------------------------------------------------------------------! + + +!------------------------------------------------------------------------------! +! + + SUBROUTINE mp_sum_rmm( msg, res, root, gid ) + IMPLICIT NONE + REAL (DP), INTENT (IN) :: msg(:,:) + REAL (DP), INTENT (OUT) :: res(:,:) + INTEGER, OPTIONAL, INTENT (IN) :: root + INTEGER, OPTIONAL, INTENT (IN) :: gid + INTEGER :: group + INTEGER :: msglen + INTEGER :: taskid, ierr + + msglen = size(msg) + +#if defined(__MPI) + + group = mpi_comm_world + IF( PRESENT( gid ) ) group = gid + + IF( PRESENT( root ) ) THEN + ! + CALL mpi_comm_rank( group, taskid, ierr) + IF( ierr /= 0 ) CALL mp_stop( 8063 ) + + IF( taskid == root ) THEN + IF( msglen > size(res) ) CALL mp_stop( 8064 ) + END IF + ! + CALL reduce_base_real_to( msglen, msg, res, group, root ) + ! + ELSE + ! + IF( msglen > size(res) ) CALL mp_stop( 8065 ) + ! + CALL reduce_base_real_to( msglen, msg, res, group, -1 ) + ! + END IF + + +#else + res = msg +#endif + + END SUBROUTINE mp_sum_rmm + + +! +!------------------------------------------------------------------------------! + + + SUBROUTINE mp_sum_rt( msg, gid ) + IMPLICIT NONE + REAL (DP), INTENT (INOUT) :: msg(:,:,:) + INTEGER, OPTIONAL, INTENT(IN) :: gid + INTEGER :: group + INTEGER :: msglen +#if defined(__MPI) + msglen = size(msg) + group = mpi_comm_world + IF( PRESENT( gid ) ) group = gid + CALL reduce_base_real( msglen, msg, group, -1 ) +#endif + END SUBROUTINE mp_sum_rt + +! +!------------------------------------------------------------------------------! +! +! Carlo Cavazzoni +! + SUBROUTINE mp_sum_r4d(msg,gid) + IMPLICIT NONE + REAL (DP), INTENT (INOUT) :: msg(:,:,:,:) + INTEGER, OPTIONAL, INTENT(IN) :: gid + INTEGER :: group + INTEGER :: msglen +#if defined(__MPI) + msglen = size(msg) + group = mpi_comm_world + IF( PRESENT( gid ) ) group = gid + CALL reduce_base_real( msglen, msg, group, -1 ) +#endif + END SUBROUTINE mp_sum_r4d + + + +!------------------------------------------------------------------------------! + + SUBROUTINE mp_sum_c1(msg,gid) + IMPLICIT NONE + COMPLEX (DP), INTENT (INOUT) :: msg + INTEGER, OPTIONAL, INTENT(IN) :: gid + INTEGER :: group + INTEGER :: msglen + +#if defined(__MPI) + msglen = 1 + group = mpi_comm_world + IF( PRESENT( gid ) ) group = gid + CALL reduce_base_real( 2 * msglen, msg, group, -1 ) +#endif + END SUBROUTINE mp_sum_c1 +! +!------------------------------------------------------------------------------! + + SUBROUTINE mp_sum_cv(msg,gid) + IMPLICIT NONE + COMPLEX (DP), INTENT (INOUT) :: msg(:) + INTEGER, OPTIONAL, INTENT(IN) :: gid + INTEGER :: group + INTEGER :: msglen +#if defined(__MPI) + msglen = size(msg) + group = mpi_comm_world + IF( PRESENT( gid ) ) group = gid + CALL reduce_base_real( 2 * msglen, msg, group, -1 ) +#endif + END SUBROUTINE mp_sum_cv +! +!------------------------------------------------------------------------------! + + SUBROUTINE mp_sum_cm(msg, gid) + IMPLICIT NONE + COMPLEX (DP), INTENT (INOUT) :: msg(:,:) + INTEGER, OPTIONAL, INTENT (IN) :: gid + INTEGER :: group + INTEGER :: msglen +#if defined(__MPI) + msglen = size(msg) + group = mpi_comm_world + IF( PRESENT( gid ) ) group = gid + CALL reduce_base_real( 2 * msglen, msg, group, -1 ) +#endif + END SUBROUTINE mp_sum_cm +! +!------------------------------------------------------------------------------! + + + SUBROUTINE mp_sum_cmm(msg, res, gid) + IMPLICIT NONE + COMPLEX (DP), INTENT (IN) :: msg(:,:) + COMPLEX (DP), INTENT (OUT) :: res(:,:) + INTEGER, OPTIONAL, INTENT (IN) :: gid + INTEGER :: group + INTEGER :: msglen +#if defined(__MPI) + msglen = size(msg) + group = mpi_comm_world + IF( PRESENT( gid ) ) group = gid + CALL reduce_base_real_to( 2 * msglen, msg, res, group, -1 ) +#else + res = msg +#endif + END SUBROUTINE mp_sum_cmm + + +! +!------------------------------------------------------------------------------! +! +! Carlo Cavazzoni +! + SUBROUTINE mp_sum_ct(msg,gid) + IMPLICIT NONE + COMPLEX (DP), INTENT (INOUT) :: msg(:,:,:) + INTEGER, OPTIONAL, INTENT(IN) :: gid + INTEGER :: group + INTEGER :: msglen +#if defined(__MPI) + msglen = SIZE(msg) + group = mpi_comm_world + IF( PRESENT( gid ) ) group = gid + CALL reduce_base_real( 2 * msglen, msg, group, -1 ) +#endif + END SUBROUTINE mp_sum_ct + +! +!------------------------------------------------------------------------------! +! +! Carlo Cavazzoni +! + SUBROUTINE mp_sum_c4d(msg,gid) + IMPLICIT NONE + COMPLEX (DP), INTENT (INOUT) :: msg(:,:,:,:) + INTEGER, OPTIONAL, INTENT(IN) :: gid + INTEGER :: group + INTEGER :: msglen +#if defined(__MPI) + msglen = size(msg) + group = mpi_comm_world + IF( PRESENT( gid ) ) group = gid + CALL reduce_base_real( 2 * msglen, msg, group, -1 ) +#endif + END SUBROUTINE mp_sum_c4d +! +!------------------------------------------------------------------------------! +! +! Carlo Cavazzoni +! + SUBROUTINE mp_sum_c5d(msg,gid) + IMPLICIT NONE + COMPLEX (DP), INTENT (INOUT) :: msg(:,:,:,:,:) + INTEGER, OPTIONAL, INTENT(IN) :: gid + INTEGER :: group + INTEGER :: msglen +#if defined(__MPI) + msglen = size(msg) + group = mpi_comm_world + IF( PRESENT( gid ) ) group = gid + CALL reduce_base_real( 2 * msglen, msg, group, -1 ) +#endif + END SUBROUTINE mp_sum_c5d + +!------------------------------------------------------------------------------! +! +! Carlo Cavazzoni +! + SUBROUTINE mp_sum_r5d(msg,gid) + IMPLICIT NONE + REAL (DP), INTENT (INOUT) :: msg(:,:,:,:,:) + INTEGER, OPTIONAL, INTENT(IN) :: gid + INTEGER :: group + INTEGER :: msglen +#if defined(__MPI) + msglen = size(msg) + group = mpi_comm_world + IF( PRESENT( gid ) ) group = gid + CALL reduce_base_real( msglen, msg, group, -1 ) +#endif + END SUBROUTINE mp_sum_r5d + + + +! +!------------------------------------------------------------------------------! +! +! Carlo Cavazzoni +! + SUBROUTINE mp_sum_c6d(msg,gid) + IMPLICIT NONE + COMPLEX (DP), INTENT (INOUT) :: msg(:,:,:,:,:,:) + INTEGER, OPTIONAL, INTENT(IN) :: gid + INTEGER :: group + INTEGER :: msglen +#if defined(__MPI) + msglen = size(msg) + group = mpi_comm_world + IF( PRESENT( gid ) ) group = gid + CALL reduce_base_real( 2 * msglen, msg, group, -1 ) +#endif + END SUBROUTINE mp_sum_c6d + + + +!------------------------------------------------------------------------------! + SUBROUTINE mp_max_i(msg,gid) + IMPLICIT NONE + INTEGER, INTENT (INOUT) :: msg + INTEGER, OPTIONAL, INTENT(IN) :: gid + INTEGER :: group + INTEGER :: msglen +#if defined(__MPI) + msglen = 1 + group = mpi_comm_world + IF( PRESENT( gid ) ) group = gid + CALL parallel_max_integer( msglen, msg, group, -1 ) +#endif + END SUBROUTINE mp_max_i +! +!------------------------------------------------------------------------------! +! +!..mp_max_iv +!..Carlo Cavazzoni +! + SUBROUTINE mp_max_iv(msg,gid) + IMPLICIT NONE + INTEGER, INTENT (INOUT) :: msg(:) + INTEGER, OPTIONAL, INTENT(IN) :: gid + INTEGER :: group + INTEGER :: msglen +#if defined(__MPI) + group = mpi_comm_world + IF( PRESENT( gid ) ) group = gid + msglen = size(msg) + CALL parallel_max_integer( msglen, msg, group, -1 ) +#endif + END SUBROUTINE mp_max_iv +! +!---------------------------------------------------------------------- + + SUBROUTINE mp_max_r(msg,gid) + IMPLICIT NONE + REAL (DP), INTENT (INOUT) :: msg + INTEGER, OPTIONAL, INTENT(IN) :: gid + INTEGER :: group + INTEGER :: msglen +#if defined(__MPI) + group = mpi_comm_world + IF( PRESENT( gid ) ) group = gid + msglen = 1 + CALL parallel_max_real( msglen, msg, group, -1 ) +#endif + END SUBROUTINE mp_max_r +! +!------------------------------------------------------------------------------! + SUBROUTINE mp_max_rv(msg,gid) + IMPLICIT NONE + REAL (DP), INTENT (INOUT) :: msg(:) + INTEGER, OPTIONAL, INTENT(IN) :: gid + INTEGER :: group + INTEGER :: msglen +#if defined(__MPI) + group = mpi_comm_world + IF( PRESENT( gid ) ) group = gid + msglen = size(msg) + CALL parallel_max_real( msglen, msg, group, -1 ) +#endif + END SUBROUTINE mp_max_rv +!------------------------------------------------------------------------------! + SUBROUTINE mp_min_i(msg,gid) + IMPLICIT NONE + INTEGER, INTENT (INOUT) :: msg + INTEGER, OPTIONAL, INTENT(IN) :: gid + INTEGER :: group + INTEGER :: msglen +#if defined(__MPI) + group = mpi_comm_world + IF( PRESENT( gid ) ) group = gid + msglen = 1 + CALL parallel_min_integer( msglen, msg, group, -1 ) +#endif + END SUBROUTINE mp_min_i +!------------------------------------------------------------------------------! + SUBROUTINE mp_min_iv(msg,gid) + IMPLICIT NONE + INTEGER, INTENT (INOUT) :: msg(:) + INTEGER, OPTIONAL, INTENT(IN) :: gid + INTEGER :: group + INTEGER :: msglen +#if defined(__MPI) + group = mpi_comm_world + IF( PRESENT( gid ) ) group = gid + msglen = SIZE(msg) + CALL parallel_min_integer( msglen, msg, group, -1 ) +#endif + END SUBROUTINE mp_min_iv +!------------------------------------------------------------------------------! + SUBROUTINE mp_min_r(msg,gid) + IMPLICIT NONE + REAL (DP), INTENT (INOUT) :: msg + INTEGER, OPTIONAL, INTENT(IN) :: gid + INTEGER :: group + INTEGER :: msglen +#if defined(__MPI) + group = mpi_comm_world + IF( PRESENT( gid ) ) group = gid + msglen = 1 + CALL parallel_min_real( msglen, msg, group, -1 ) +#endif + END SUBROUTINE mp_min_r +! +!------------------------------------------------------------------------------! + SUBROUTINE mp_min_rv(msg,gid) + IMPLICIT NONE + REAL (DP), INTENT (INOUT) :: msg(:) + INTEGER, OPTIONAL, INTENT(IN) :: gid + INTEGER :: group + INTEGER :: msglen +#if defined(__MPI) + group = mpi_comm_world + IF( PRESENT( gid ) ) group = gid + msglen = size(msg) + CALL parallel_min_real( msglen, msg, group, -1 ) +#endif + END SUBROUTINE mp_min_rv + +!------------------------------------------------------------------------------! + + SUBROUTINE mp_barrier(gid) + IMPLICIT NONE + INTEGER, OPTIONAL, INTENT(IN) :: gid + INTEGER :: group + INTEGER :: ierr +#if defined(__MPI) + group = mpi_comm_world + IF( PRESENT( gid ) ) group = gid + CALL MPI_BARRIER(group,IERR) + IF (ierr/=0) CALL mp_stop( 8066 ) +#endif + END SUBROUTINE mp_barrier + +!------------------------------------------------------------------------------! +!.. Carlo Cavazzoni +!..mp_rank + FUNCTION mp_rank( comm ) + IMPLICIT NONE + INTEGER :: mp_rank + INTEGER, OPTIONAL, INTENT(IN) :: comm + INTEGER :: ierr, taskid + + ierr = 0 + taskid = 0 +#if defined(__MPI) + IF( PRESENT( comm ) ) THEN + CALL mpi_comm_rank(comm,taskid,ierr) + ELSE + CALL mpi_comm_rank(mpi_comm_world,taskid,ierr) + END IF + IF (ierr/=0) CALL mp_stop( 8067 ) +#endif + mp_rank = taskid + END FUNCTION mp_rank + +!------------------------------------------------------------------------------! +!.. Carlo Cavazzoni +!..mp_size + FUNCTION mp_size( comm ) + IMPLICIT NONE + INTEGER :: mp_size + INTEGER, OPTIONAL, INTENT(IN) :: comm + INTEGER :: ierr, numtask + + ierr = 0 + numtask = 1 +#if defined(__MPI) + IF( PRESENT( comm ) ) THEN + CALL mpi_comm_size(comm,numtask,ierr) + ELSE + CALL mpi_comm_size(mpi_comm_world,numtask,ierr) + END IF + IF (ierr/=0) CALL mp_stop( 8068 ) +#endif + mp_size = numtask + END FUNCTION mp_size + + SUBROUTINE mp_report + INTEGER :: i + WRITE( stdout, *) +#if defined(__MPI) +# if defined (__MP_STAT) + WRITE( stdout, 20 ) +# endif +20 FORMAT(3X,'please use an MPI profiler to analisy communications ') +#else + WRITE( stdout, *) +#endif + RETURN + END SUBROUTINE mp_report + + +!------------------------------------------------------------------------------! +!..mp_gatherv_rv +!..Carlo Cavazzoni + + SUBROUTINE mp_gatherv_rv( mydata, alldata, recvcount, displs, root, gid) + IMPLICIT NONE + REAL(DP) :: mydata(:) + REAL(DP) :: alldata(:) + INTEGER, INTENT(IN) :: recvcount(:), displs(:), root + INTEGER, OPTIONAL, INTENT(IN) :: gid + INTEGER :: group + INTEGER :: ierr, npe, myid + +#if defined (__MPI) + group = mpi_comm_world + IF( PRESENT( gid ) ) group = gid + CALL mpi_comm_size( group, npe, ierr ) + IF (ierr/=0) CALL mp_stop( 8069 ) + CALL mpi_comm_rank( group, myid, ierr ) + IF (ierr/=0) CALL mp_stop( 8070 ) + ! + IF ( SIZE( recvcount ) < npe .OR. SIZE( displs ) < npe ) CALL mp_stop( 8071 ) + IF ( myid == root ) THEN + IF ( SIZE( alldata ) < displs( npe ) + recvcount( npe ) ) CALL mp_stop( 8072 ) + END IF + IF ( SIZE( mydata ) < recvcount( myid + 1 ) ) CALL mp_stop( 8073 ) + ! + CALL MPI_GATHERV( mydata, recvcount( myid + 1 ), MPI_DOUBLE_PRECISION, & + alldata, recvcount, displs, MPI_DOUBLE_PRECISION, root, group, ierr ) + IF (ierr/=0) CALL mp_stop( 8074 ) +#else + IF ( SIZE( alldata ) < recvcount( 1 ) ) CALL mp_stop( 8075 ) + IF ( SIZE( mydata ) < recvcount( 1 ) ) CALL mp_stop( 8076 ) + ! + alldata( 1:recvcount( 1 ) ) = mydata( 1:recvcount( 1 ) ) +#endif + RETURN + END SUBROUTINE mp_gatherv_rv + +!------------------------------------------------------------------------------! +!..mp_gatherv_cv +!..Carlo Cavazzoni + + SUBROUTINE mp_gatherv_cv( mydata, alldata, recvcount, displs, root, gid) + IMPLICIT NONE + COMPLEX(DP) :: mydata(:) + COMPLEX(DP) :: alldata(:) + INTEGER, INTENT(IN) :: recvcount(:), displs(:), root + INTEGER, OPTIONAL, INTENT(IN) :: gid + INTEGER :: group + INTEGER :: ierr, npe, myid + +#if defined (__MPI) + group = mpi_comm_world + IF( PRESENT( gid ) ) group = gid + CALL mpi_comm_size( group, npe, ierr ) + IF (ierr/=0) CALL mp_stop( 8069 ) + CALL mpi_comm_rank( group, myid, ierr ) + IF (ierr/=0) CALL mp_stop( 8070 ) + ! + IF ( SIZE( recvcount ) < npe .OR. SIZE( displs ) < npe ) CALL mp_stop( 8071 ) + IF ( myid == root ) THEN + IF ( SIZE( alldata ) < displs( npe ) + recvcount( npe ) ) CALL mp_stop( 8072 ) + END IF + IF ( SIZE( mydata ) < recvcount( myid + 1 ) ) CALL mp_stop( 8073 ) + ! + CALL MPI_GATHERV( mydata, recvcount( myid + 1 ), MPI_DOUBLE_COMPLEX, & + alldata, recvcount, displs, MPI_DOUBLE_COMPLEX, root, group, ierr ) + IF (ierr/=0) CALL mp_stop( 8074 ) +#else + IF ( SIZE( alldata ) < recvcount( 1 ) ) CALL mp_stop( 8075 ) + IF ( SIZE( mydata ) < recvcount( 1 ) ) CALL mp_stop( 8076 ) + ! + alldata( 1:recvcount( 1 ) ) = mydata( 1:recvcount( 1 ) ) +#endif + RETURN + END SUBROUTINE mp_gatherv_cv + +!------------------------------------------------------------------------------! +!..mp_gatherv_rv +!..Carlo Cavazzoni + + SUBROUTINE mp_gatherv_iv( mydata, alldata, recvcount, displs, root, gid) + IMPLICIT NONE + INTEGER :: mydata(:) + INTEGER :: alldata(:) + INTEGER, INTENT(IN) :: recvcount(:), displs(:), root + INTEGER, OPTIONAL, INTENT(IN) :: gid + INTEGER :: group + INTEGER :: ierr, npe, myid + +#if defined (__MPI) + group = mpi_comm_world + IF( PRESENT( gid ) ) group = gid + CALL mpi_comm_size( group, npe, ierr ) + IF (ierr/=0) CALL mp_stop( 8069 ) + CALL mpi_comm_rank( group, myid, ierr ) + IF (ierr/=0) CALL mp_stop( 8070 ) + ! + IF ( SIZE( recvcount ) < npe .OR. SIZE( displs ) < npe ) CALL mp_stop( 8071 ) + IF ( myid == root ) THEN + IF ( SIZE( alldata ) < displs( npe ) + recvcount( npe ) ) CALL mp_stop( 8072 ) + END IF + IF ( SIZE( mydata ) < recvcount( myid + 1 ) ) CALL mp_stop( 8073 ) + ! + CALL MPI_GATHERV( mydata, recvcount( myid + 1 ), MPI_INTEGER, & + alldata, recvcount, displs, MPI_INTEGER, root, group, ierr ) + IF (ierr/=0) CALL mp_stop( 8074 ) +#else + IF ( SIZE( alldata ) < recvcount( 1 ) ) CALL mp_stop( 8075 ) + IF ( SIZE( mydata ) < recvcount( 1 ) ) CALL mp_stop( 8076 ) + ! + alldata( 1:recvcount( 1 ) ) = mydata( 1:recvcount( 1 ) ) +#endif + RETURN + END SUBROUTINE mp_gatherv_iv + + +!------------------------------------------------------------------------------! +!..mp_gatherv_rm +!..Carlo Cavazzoni + + SUBROUTINE mp_gatherv_rm( mydata, alldata, recvcount, displs, root, gid) + IMPLICIT NONE + REAL(DP) :: mydata(:,:) ! Warning first dimension is supposed constant! + REAL(DP) :: alldata(:,:) + INTEGER, INTENT(IN) :: recvcount(:), displs(:), root + INTEGER, OPTIONAL, INTENT(IN) :: gid + INTEGER :: group + INTEGER :: ierr, npe, myid, nsiz + INTEGER, ALLOCATABLE :: nrecv(:), ndisp(:) + + +#if defined (__MPI) + group = mpi_comm_world + IF( PRESENT( gid ) ) group = gid + CALL mpi_comm_size( group, npe, ierr ) + IF (ierr/=0) CALL mp_stop( 8069 ) + CALL mpi_comm_rank( group, myid, ierr ) + IF (ierr/=0) CALL mp_stop( 8070 ) + ! + IF ( SIZE( recvcount ) < npe .OR. SIZE( displs ) < npe ) CALL mp_stop( 8071 ) + IF ( myid == root ) THEN + IF ( SIZE( alldata, 2 ) < displs( npe ) + recvcount( npe ) ) CALL mp_stop( 8072 ) + IF ( SIZE( alldata, 1 ) /= SIZE( mydata, 1 ) ) CALL mp_stop( 8072 ) + END IF + IF ( SIZE( mydata, 2 ) < recvcount( myid + 1 ) ) CALL mp_stop( 8073 ) + ! + ALLOCATE( nrecv( npe ), ndisp( npe ) ) + ! + nrecv( 1:npe ) = recvcount( 1:npe ) * SIZE( mydata, 1 ) + ndisp( 1:npe ) = displs( 1:npe ) * SIZE( mydata, 1 ) + ! + CALL MPI_GATHERV( mydata, nrecv( myid + 1 ), MPI_DOUBLE_PRECISION, & + alldata, nrecv, ndisp, MPI_DOUBLE_PRECISION, root, group, ierr ) + IF (ierr/=0) CALL mp_stop( 8074 ) + ! + DEALLOCATE( nrecv, ndisp ) + ! +#else + IF ( SIZE( alldata, 1 ) /= SIZE( mydata, 1 ) ) CALL mp_stop( 8075 ) + IF ( SIZE( alldata, 2 ) < recvcount( 1 ) ) CALL mp_stop( 8075 ) + IF ( SIZE( mydata, 2 ) < recvcount( 1 ) ) CALL mp_stop( 8076 ) + ! + alldata( :, 1:recvcount( 1 ) ) = mydata( :, 1:recvcount( 1 ) ) +#endif + RETURN + END SUBROUTINE mp_gatherv_rm + +!------------------------------------------------------------------------------! +!..mp_gatherv_im +!..Carlo Cavazzoni + + SUBROUTINE mp_gatherv_im( mydata, alldata, recvcount, displs, root, gid) + IMPLICIT NONE + INTEGER :: mydata(:,:) ! Warning first dimension is supposed constant! + INTEGER :: alldata(:,:) + INTEGER, INTENT(IN) :: recvcount(:), displs(:), root + INTEGER, OPTIONAL, INTENT(IN) :: gid + INTEGER :: group + INTEGER :: ierr, npe, myid, nsiz + INTEGER, ALLOCATABLE :: nrecv(:), ndisp(:) + + +#if defined (__MPI) + group = mpi_comm_world + IF( PRESENT( gid ) ) group = gid + CALL mpi_comm_size( group, npe, ierr ) + IF (ierr/=0) CALL mp_stop( 8069 ) + CALL mpi_comm_rank( group, myid, ierr ) + IF (ierr/=0) CALL mp_stop( 8070 ) + ! + IF ( SIZE( recvcount ) < npe .OR. SIZE( displs ) < npe ) CALL mp_stop( 8071 ) + IF ( myid == root ) THEN + IF ( SIZE( alldata, 2 ) < displs( npe ) + recvcount( npe ) ) CALL mp_stop( 8072 ) + IF ( SIZE( alldata, 1 ) /= SIZE( mydata, 1 ) ) CALL mp_stop( 8072 ) + END IF + IF ( SIZE( mydata, 2 ) < recvcount( myid + 1 ) ) CALL mp_stop( 8073 ) + ! + ALLOCATE( nrecv( npe ), ndisp( npe ) ) + ! + nrecv( 1:npe ) = recvcount( 1:npe ) * SIZE( mydata, 1 ) + ndisp( 1:npe ) = displs( 1:npe ) * SIZE( mydata, 1 ) + ! + CALL MPI_GATHERV( mydata, nrecv( myid + 1 ), MPI_INTEGER, & + alldata, nrecv, ndisp, MPI_INTEGER, root, group, ierr ) + IF (ierr/=0) CALL mp_stop( 8074 ) + ! + DEALLOCATE( nrecv, ndisp ) + ! +#else + IF ( SIZE( alldata, 1 ) /= SIZE( mydata, 1 ) ) CALL mp_stop( 8075 ) + IF ( SIZE( alldata, 2 ) < recvcount( 1 ) ) CALL mp_stop( 8075 ) + IF ( SIZE( mydata, 2 ) < recvcount( 1 ) ) CALL mp_stop( 8076 ) + ! + alldata( :, 1:recvcount( 1 ) ) = mydata( :, 1:recvcount( 1 ) ) +#endif + RETURN + END SUBROUTINE mp_gatherv_im + + +!------------------------------------------------------------------------------! + + SUBROUTINE mp_set_displs( recvcount, displs, ntot, nproc ) + ! Given the number of elements on each processor (recvcount), this subroutine + ! sets the correct offsets (displs) to collect them on a single + ! array with contiguous elemets + IMPLICIT NONE + INTEGER, INTENT(IN) :: recvcount(:) ! number of elements on each processor + INTEGER, INTENT(OUT) :: displs(:) ! offsets/displacements + INTEGER, INTENT(OUT) :: ntot + INTEGER, INTENT(IN) :: nproc + INTEGER :: i + + displs( 1 ) = 0 + ! +#if defined (__MPI) + IF( nproc < 1 ) CALL mp_stop( 8090 ) + DO i = 2, nproc + displs( i ) = displs( i - 1 ) + recvcount( i - 1 ) + END DO + ntot = displs( nproc ) + recvcount( nproc ) +#else + ntot = recvcount( 1 ) +#endif + RETURN + END SUBROUTINE mp_set_displs + +!------------------------------------------------------------------------------! + + +SUBROUTINE mp_alltoall_c3d( sndbuf, rcvbuf, gid ) + IMPLICIT NONE + COMPLEX(DP) :: sndbuf( :, :, : ) + COMPLEX(DP) :: rcvbuf( :, :, : ) + INTEGER, OPTIONAL, INTENT(IN) :: gid + INTEGER :: nsiz, group, ierr, npe + +#if defined (__MPI) + + group = mpi_comm_world + IF( PRESENT( gid ) ) group = gid + + CALL mpi_comm_size( group, npe, ierr ) + IF (ierr/=0) CALL mp_stop( 8069 ) + + IF ( SIZE( sndbuf, 3 ) < npe ) CALL mp_stop( 8069 ) + IF ( SIZE( rcvbuf, 3 ) < npe ) CALL mp_stop( 8069 ) + + nsiz = SIZE( sndbuf, 1 ) * SIZE( sndbuf, 2 ) + + CALL MPI_ALLTOALL( sndbuf, nsiz, MPI_DOUBLE_COMPLEX, & + rcvbuf, nsiz, MPI_DOUBLE_COMPLEX, group, ierr ) + + IF (ierr/=0) CALL mp_stop( 8074 ) + +#else + + rcvbuf = sndbuf + +#endif + + RETURN +END SUBROUTINE mp_alltoall_c3d + + +!------------------------------------------------------------------------------! + +SUBROUTINE mp_alltoall_i3d( sndbuf, rcvbuf, gid ) + IMPLICIT NONE + INTEGER :: sndbuf( :, :, : ) + INTEGER :: rcvbuf( :, :, : ) + INTEGER, OPTIONAL, INTENT(IN) :: gid + INTEGER :: nsiz, group, ierr, npe + +#if defined (__MPI) + + group = mpi_comm_world + IF( PRESENT( gid ) ) group = gid + + CALL mpi_comm_size( group, npe, ierr ) + IF (ierr/=0) CALL mp_stop( 8069 ) + + IF ( SIZE( sndbuf, 3 ) < npe ) CALL mp_stop( 8069 ) + IF ( SIZE( rcvbuf, 3 ) < npe ) CALL mp_stop( 8069 ) + + nsiz = SIZE( sndbuf, 1 ) * SIZE( sndbuf, 2 ) + + CALL MPI_ALLTOALL( sndbuf, nsiz, MPI_INTEGER, & + rcvbuf, nsiz, MPI_INTEGER, group, ierr ) + + IF (ierr/=0) CALL mp_stop( 8074 ) + +#else + + rcvbuf = sndbuf + +#endif + + RETURN +END SUBROUTINE mp_alltoall_i3d + +SUBROUTINE mp_circular_shift_left_d2d_int( buf, itag, gid ) + IMPLICIT NONE + INTEGER :: buf + INTEGER, INTENT(IN) :: itag + INTEGER, OPTIONAL, INTENT(IN) :: gid + INTEGER :: nsiz, group, ierr, npe, sour, dest, mype + +#if defined (__MPI) + + INTEGER :: istatus( mpi_status_size ) + ! + group = mpi_comm_world + IF( PRESENT( gid ) ) group = gid + ! + CALL mpi_comm_size( group, npe, ierr ) + IF (ierr/=0) CALL mp_stop( 8100 ) + CALL mpi_comm_rank( group, mype, ierr ) + IF (ierr/=0) CALL mp_stop( 8101 ) + ! + sour = mype + 1 + IF( sour == npe ) sour = 0 + dest = mype - 1 + IF( dest == -1 ) dest = npe - 1 + ! + CALL MPI_Sendrecv_replace( buf, 1, MPI_INTEGER, & + dest, itag, sour, itag, group, istatus, ierr) + ! + IF (ierr/=0) CALL mp_stop( 8102 ) + ! +#else + ! do nothing +#endif + RETURN +END SUBROUTINE mp_circular_shift_left_d2d_int + + + +SUBROUTINE mp_circular_shift_left_d2d_double( buf, itag, gid ) + IMPLICIT NONE + REAL(DP) :: buf( :, : ) + INTEGER, INTENT(IN) :: itag + INTEGER, OPTIONAL, INTENT(IN) :: gid + INTEGER :: nsiz, group, ierr, npe, sour, dest, mype + +#if defined (__MPI) + + INTEGER :: istatus( mpi_status_size ) + ! + group = mpi_comm_world + IF( PRESENT( gid ) ) group = gid + ! + CALL mpi_comm_size( group, npe, ierr ) + IF (ierr/=0) CALL mp_stop( 8100 ) + CALL mpi_comm_rank( group, mype, ierr ) + IF (ierr/=0) CALL mp_stop( 8101 ) + ! + sour = mype + 1 + IF( sour == npe ) sour = 0 + dest = mype - 1 + IF( dest == -1 ) dest = npe - 1 + ! + CALL MPI_Sendrecv_replace( buf, SIZE(buf), MPI_DOUBLE_PRECISION, & + dest, itag, sour, itag, group, istatus, ierr) + ! + IF (ierr/=0) CALL mp_stop( 8102 ) + ! +#else + ! do nothing +#endif + RETURN +END SUBROUTINE mp_circular_shift_left_d2d_double + + + FUNCTION mp_get_comm_null( ) + IMPLICIT NONE + INTEGER :: mp_get_comm_null +#if defined(__MPI) + mp_get_comm_null = MPI_COMM_NULL +#else + mp_get_comm_null = 0 +#endif + END FUNCTION mp_get_comm_null + + FUNCTION mp_get_comm_self( ) + IMPLICIT NONE + INTEGER :: mp_get_comm_self +#if defined(__MPI) + mp_get_comm_self = MPI_COMM_SELF +#else + mp_get_comm_self = 0 +#endif + END FUNCTION mp_get_comm_self + +!------------------------------------------------------------------------------! + END MODULE mp +!------------------------------------------------------------------------------! + diff --git a/tests/apps/miniDFT/tests/src/mp_base.f90 b/tests/apps/miniDFT/tests/src/mp_base.f90 new file mode 100644 index 0000000000..36860b4a61 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/mp_base.f90 @@ -0,0 +1,963 @@ +! +! Copyright (C) 2002-2008 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +! Wrapper for MPI implementations that have problems with large messages +! + + +! In some MPI implementation the communication subsystem +! crashes when message exceeds a given size, so we need +! to break down MPI communications in smaller pieces +! +#define __MSGSIZ_MAX 100000 +#define __BCAST_MSGSIZ_MAX 100000 + +! Some implementation of MPI (OpenMPI) if it is not well tuned for the given +! network hardware (InfiniBand) tend to lose performance or get stuck inside +! collective routines if processors are not well synchronized +! A barrier fixes the problem +! +#define __USE_BARRIER + + +!=----------------------------------------------------------------------------=! +! + +SUBROUTINE mp_synchronize( gid ) + USE parallel_include + IMPLICIT NONE + INTEGER, INTENT(IN) :: gid +#if defined __MPI && defined __USE_BARRIER + INTEGER :: ierr + CALL mpi_barrier( gid, ierr ) + IF( ierr /= 0 ) CALL errore( 'mp_synchronize ', ' error in mpi_barrier ', ierr ) +#endif + RETURN +END SUBROUTINE mp_synchronize + + +!=----------------------------------------------------------------------------=! +! + + SUBROUTINE BCAST_REAL( array, n, root, gid ) + USE kinds, ONLY: DP + USE parallel_include + IMPLICIT NONE + INTEGER, INTENT(IN) :: n, root, gid + REAL(DP) :: array( n ) +#if defined __MPI + INTEGER :: msgsiz_max = __BCAST_MSGSIZ_MAX + INTEGER :: nblk, blksiz, iblk, istart, ierr + +#if defined __TRACE + write(*,*) 'BCAST_REAL IN' +#endif + IF( n <= 0 ) GO TO 1 + +#if defined __USE_BARRIER + CALL mp_synchronize( gid ) +#endif + + IF( n <= msgsiz_max ) THEN + CALL MPI_BCAST( array, n, MPI_DOUBLE_PRECISION, root, gid, ierr ) + IF( ierr /= 0 ) CALL errore( ' bcast_real ', ' error in mpi_bcast 1 ', ierr ) + ELSE + nblk = n / msgsiz_max + blksiz = msgsiz_max + DO iblk = 1, nblk + istart = (iblk-1)*msgsiz_max + 1 + CALL MPI_BCAST( array( istart ), blksiz, MPI_DOUBLE_PRECISION, root, gid, ierr ) + IF( ierr /= 0 ) CALL errore( ' bcast_real ', ' error in mpi_bcast 2 ', ierr ) + END DO + blksiz = MOD( n, msgsiz_max ) + IF( blksiz > 0 ) THEN + istart = nblk * msgsiz_max + 1 + CALL MPI_BCAST( array( istart ), blksiz, MPI_DOUBLE_PRECISION, root, gid, ierr ) + IF( ierr /= 0 ) CALL errore( ' bcast_real ', ' error in mpi_bcast 3 ', ierr ) + END IF + END IF + +1 CONTINUE +#if defined __TRACE + write(*,*) 'BCAST_REAL OUT' +#endif + +#endif + + RETURN + END SUBROUTINE BCAST_REAL + + + SUBROUTINE BCAST_INTEGER( array, n, root, gid ) + USE parallel_include + IMPLICIT NONE + INTEGER, INTENT(IN) :: n, root, gid + INTEGER :: array( n ) +#if defined __MPI + INTEGER :: msgsiz_max = __MSGSIZ_MAX + INTEGER :: nblk, blksiz, iblk, istart, ierr + +#if defined __TRACE + write(*,*) 'BCAST_INTEGER IN' +#endif + + IF( n <= 0 ) GO TO 1 + +#if defined __USE_BARRIER + CALL mp_synchronize( gid ) +#endif + + IF( n <= msgsiz_max ) THEN + CALL MPI_BCAST( array, n, MPI_INTEGER, root, gid, ierr ) + IF( ierr /= 0 ) CALL errore( ' bcast_integer ', ' error in mpi_bcast 1 ', ierr ) + ELSE + nblk = n / msgsiz_max + blksiz = msgsiz_max + DO iblk = 1, nblk + istart = (iblk-1)*msgsiz_max + 1 + CALL MPI_BCAST( array( istart ), blksiz, MPI_INTEGER, root, gid, ierr ) + IF( ierr /= 0 ) CALL errore( ' bcast_integer ', ' error in mpi_bcast 2 ', ierr ) + END DO + blksiz = MOD( n, msgsiz_max ) + IF( blksiz > 0 ) THEN + istart = nblk * msgsiz_max + 1 + CALL MPI_BCAST( array( istart ), blksiz, MPI_INTEGER, root, gid, ierr ) + IF( ierr /= 0 ) CALL errore( ' bcast_integer ', ' error in mpi_bcast 3 ', ierr ) + END IF + END IF +1 CONTINUE +#if defined __TRACE + write(*,*) 'BCAST_INTEGER OUT' +#endif +#endif + RETURN + END SUBROUTINE BCAST_INTEGER + + + SUBROUTINE BCAST_LOGICAL( array, n, root, gid ) + USE parallel_include + IMPLICIT NONE + INTEGER, INTENT(IN) :: n, root, gid + LOGICAL :: array( n ) +#if defined __MPI + INTEGER :: msgsiz_max = __MSGSIZ_MAX + INTEGER :: nblk, blksiz, iblk, istart, ierr + +#if defined __TRACE + write(*,*) 'BCAST_LOGICAL IN' +#endif + + IF( n <= 0 ) GO TO 1 + +#if defined __USE_BARRIER + CALL mp_synchronize( gid ) +#endif + + IF( n <= msgsiz_max ) THEN + CALL MPI_BCAST( array, n, MPI_LOGICAL, root, gid, ierr ) + IF( ierr /= 0 ) CALL errore( ' bcast_logical ', ' error in mpi_bcast 1 ', ierr ) + ELSE + nblk = n / msgsiz_max + blksiz = msgsiz_max + DO iblk = 1, nblk + istart = (iblk-1)*msgsiz_max + 1 + CALL MPI_BCAST( array( istart ), blksiz, MPI_LOGICAL, root, gid, ierr ) + IF( ierr /= 0 ) CALL errore( ' bcast_logical ', ' error in mpi_bcast 2 ', ierr ) + END DO + blksiz = MOD( n, msgsiz_max ) + IF( blksiz > 0 ) THEN + istart = nblk * msgsiz_max + 1 + CALL MPI_BCAST( array( istart ), blksiz, MPI_LOGICAL, root, gid, ierr ) + IF( ierr /= 0 ) CALL errore( ' bcast_logical ', ' error in mpi_bcast 3 ', ierr ) + END IF + END IF + +1 CONTINUE +#if defined __TRACE + write(*,*) 'BCAST_LOGICAL OUT' +#endif +#endif + RETURN + END SUBROUTINE BCAST_LOGICAL + + +! +! ... "reduce"-like subroutines +! +!---------------------------------------------------------------------------- +SUBROUTINE reduce_base_real( dim, ps, comm, root ) + !---------------------------------------------------------------------------- + ! + ! ... sums a distributed variable ps(dim) over the processors. + ! ... This version uses a fixed-length buffer of appropriate (?) dim + ! + USE kinds, ONLY : DP + USE parallel_include + ! + IMPLICIT NONE + ! + INTEGER, INTENT(IN) :: dim ! size of the array + REAL(DP) :: ps(dim) ! array whose elements have to be reduced + INTEGER, INTENT(IN) :: comm ! communicator + INTEGER, INTENT(IN) :: root ! if root < 0 perform a reduction to all procs + ! if root >= 0 perform a reduce only to root proc. + ! +#if defined (__MPI) + ! + INTEGER :: info, n, nbuf, nproc, myid + INTEGER, PARAMETER :: maxb = __MSGSIZ_MAX + ! + REAL(DP) :: buff(maxb) + ! the use of the common here could help the transfer of data to the network device + COMMON / mp_base_real / buff + ! +#if defined __TRACE + write(*,*) 'reduce_base_real IN' +#endif + + CALL mpi_comm_size( comm, nproc, info ) + IF( info /= 0 ) CALL errore( 'reduce_base_real', 'error in mpi_comm_size', info ) + + CALL mpi_comm_rank( comm, myid, info ) + IF( info /= 0 ) CALL errore( 'reduce_base_real', 'error in mpi_comm_rank', info ) + ! + IF ( dim <= 0 .OR. nproc <= 1 ) GO TO 1 ! go to the end of the subroutine + ! + ! ... synchronize processes + ! +#if defined __USE_BARRIER + CALL mp_synchronize( comm ) +#endif + ! + nbuf = dim / maxb + ! + DO n = 1, nbuf + ! + IF( root >= 0 ) THEN + CALL MPI_REDUCE( ps(1+(n-1)*maxb), buff, maxb, MPI_DOUBLE_PRECISION, MPI_SUM, root, comm, info ) + IF( info /= 0 ) CALL errore( 'reduce_base_real', 'error in mpi_reduce 1', info ) + ELSE + CALL MPI_ALLREDUCE( ps(1+(n-1)*maxb), buff, maxb, MPI_DOUBLE_PRECISION, MPI_SUM, comm, info ) + IF( info /= 0 ) CALL errore( 'reduce_base_real', 'error in mpi_allreduce 1', info ) + END IF + ! + IF( root < 0 ) THEN + ps((1+(n-1)*maxb):(n*maxb)) = buff(1:maxb) + ELSE IF( root == myid ) THEN + ps((1+(n-1)*maxb):(n*maxb)) = buff(1:maxb) + END IF + ! + END DO + ! + ! ... possible remaining elements < maxb + ! + IF ( ( dim - nbuf * maxb ) > 0 ) THEN + ! + IF( root >= 0 ) THEN + CALL MPI_REDUCE( ps(1+nbuf*maxb), buff, (dim-nbuf*maxb), MPI_DOUBLE_PRECISION, MPI_SUM, root, comm, info ) + IF( info /= 0 ) CALL errore( 'reduce_base_real', 'error in mpi_reduce 2', info ) + ELSE + CALL MPI_ALLREDUCE( ps(1+nbuf*maxb), buff, (dim-nbuf*maxb), MPI_DOUBLE_PRECISION, MPI_SUM, comm, info ) + IF( info /= 0 ) CALL errore( 'reduce_base_real', 'error in mpi_allreduce 2', info ) + END IF + ! + IF( root < 0 ) THEN + ps((1+nbuf*maxb):dim) = buff(1:(dim-nbuf*maxb)) + ELSE IF( root == myid ) THEN + ps((1+nbuf*maxb):dim) = buff(1:(dim-nbuf*maxb)) + END IF + ! + END IF + ! +1 CONTINUE + ! +#if defined __TRACE + write(*,*) 'reduce_base_real OUT' +#endif + ! +#endif + ! + RETURN + ! +END SUBROUTINE reduce_base_real +! +! +! +!---------------------------------------------------------------------------- +SUBROUTINE reduce_base_integer( dim, ps, comm, root ) + !---------------------------------------------------------------------------- + ! + ! ... sums a distributed variable ps(dim) over the processors. + ! ... This version uses a fixed-length buffer of appropriate (?) dim + ! + USE kinds, ONLY : DP + USE parallel_include + ! + IMPLICIT NONE + ! + INTEGER, INTENT(IN) :: dim + INTEGER :: ps(dim) + INTEGER, INTENT(IN) :: comm ! communicator + INTEGER, INTENT(IN) :: root ! if root < 0 perform a reduction to all procs + ! if root >= 0 perform a reduce only to root proc. + ! +#if defined (__MPI) + ! + INTEGER :: info, n, nbuf, nproc, myid + INTEGER, PARAMETER :: maxb = __MSGSIZ_MAX + ! + INTEGER :: buff(maxb) + COMMON / mp_base_integer / buff + ! +#if defined __TRACE + write(*,*) 'reduce_base_integer IN' +#endif + ! + CALL mpi_comm_size( comm, nproc, info ) + IF( info /= 0 ) CALL errore( 'reduce_base_integer', 'error in mpi_comm_size', info ) + + CALL mpi_comm_rank( comm, myid, info ) + IF( info /= 0 ) CALL errore( 'reduce_base_integer', 'error in mpi_comm_rank', info ) + ! + IF ( dim <= 0 .OR. nproc <= 1 ) GO TO 1 ! go to the end of the subroutine + ! + ! ... synchronize processes + ! +#if defined __USE_BARRIER + CALL mp_synchronize( comm ) +#endif + ! + nbuf = dim / maxb + ! + DO n = 1, nbuf + ! + IF( root >= 0 ) THEN + CALL MPI_REDUCE( ps(1+(n-1)*maxb), buff, maxb, MPI_INTEGER, MPI_SUM, root, comm, info ) + IF( info /= 0 ) CALL errore( 'reduce_base_integer', 'error in mpi_reduce 1', info ) + ELSE + CALL MPI_ALLREDUCE( ps(1+(n-1)*maxb), buff, maxb, MPI_INTEGER, MPI_SUM, comm, info ) + IF( info /= 0 ) CALL errore( 'reduce_base_integer', 'error in mpi_allreduce 1', info ) + END IF + ! + IF( root < 0 ) THEN + ps((1+(n-1)*maxb):(n*maxb)) = buff(1:maxb) + ELSE IF( root == myid ) THEN + ps((1+(n-1)*maxb):(n*maxb)) = buff(1:maxb) + END IF + ! + END DO + ! + ! ... possible remaining elements < maxb + ! + IF ( ( dim - nbuf * maxb ) > 0 ) THEN + ! + IF( root >= 0 ) THEN + CALL MPI_REDUCE( ps(1+nbuf*maxb), buff, (dim-nbuf*maxb), MPI_INTEGER, MPI_SUM, root, comm, info ) + IF( info /= 0 ) CALL errore( 'reduce_base_integer', 'error in mpi_reduce 2', info ) + ELSE + CALL MPI_ALLREDUCE( ps(1+nbuf*maxb), buff, (dim-nbuf*maxb), MPI_INTEGER, MPI_SUM, comm, info ) + IF( info /= 0 ) CALL errore( 'reduce_base_integer', 'error in mpi_allreduce 2', info ) + END IF + ! + IF( root < 0 ) THEN + ps((1+nbuf*maxb):dim) = buff(1:(dim-nbuf*maxb)) + ELSE IF( root == myid ) THEN + ps((1+nbuf*maxb):dim) = buff(1:(dim-nbuf*maxb)) + END IF + ! + END IF + ! +1 CONTINUE + ! +#if defined __TRACE + write(*,*) 'reduce_base_integer OUT' +#endif + ! +#endif + ! + RETURN + ! +END SUBROUTINE reduce_base_integer + +! +! ... "reduce"-like subroutines +! +!---------------------------------------------------------------------------- +SUBROUTINE reduce_base_real_to( dim, ps, psout, comm, root ) + !---------------------------------------------------------------------------- + ! + ! ... sums a distributed variable ps(dim) over the processors, + ! ... and store the results in variable psout. + ! ... This version uses a fixed-length buffer of appropriate (?) length + ! + USE kinds, ONLY : DP + USE parallel_include + ! + IMPLICIT NONE + ! + INTEGER, INTENT(IN) :: dim + REAL(DP), INTENT(IN) :: ps(dim) + REAL(DP) :: psout(dim) + INTEGER, INTENT(IN) :: comm ! communecator + INTEGER, INTENT(IN) :: root ! if root < 0 perform a reduction to all procs + ! if root >= 0 perform a reduce only to root proc. + ! +#if defined (__MPI) + ! + INTEGER :: info, n, nbuf, nproc, myid + INTEGER, PARAMETER :: maxb = __MSGSIZ_MAX + ! +#if defined __TRACE + write(*,*) 'reduce_base_real_to IN' +#endif + + CALL mpi_comm_size( comm, nproc, info ) + IF( info /= 0 ) CALL errore( 'reduce_base_real_to', 'error in mpi_comm_size', info ) + + CALL mpi_comm_rank( comm, myid, info ) + IF( info /= 0 ) CALL errore( 'reduce_base_real_to', 'error in mpi_comm_rank', info ) + ! + IF ( dim > 0 .AND. nproc <= 1 ) THEN + psout = ps + END IF + IF( dim <= 0 .OR. nproc <= 1 ) GO TO 1 ! go to the end of the subroutine + ! + ! ... synchronize processes + ! +#if defined __USE_BARRIER + CALL mp_synchronize( comm ) +#endif + ! + nbuf = dim / maxb + ! + DO n = 1, nbuf + ! + IF( root >= 0 ) THEN + CALL MPI_REDUCE( ps(1+(n-1)*maxb), psout(1+(n-1)*maxb), maxb, MPI_DOUBLE_PRECISION, MPI_SUM, root, comm, info ) + IF( info /= 0 ) CALL errore( 'reduce_base_real_to', 'error in mpi_reduce 1', info ) + ELSE + CALL MPI_ALLREDUCE( ps(1+(n-1)*maxb), psout(1+(n-1)*maxb), maxb, MPI_DOUBLE_PRECISION, MPI_SUM, comm, info ) + IF( info /= 0 ) CALL errore( 'reduce_base_real_to', 'error in mpi_allreduce 1', info ) + END IF + ! + END DO + ! + ! ... possible remaining elements < maxb + ! + IF ( ( dim - nbuf * maxb ) > 0 ) THEN + ! + IF( root >= 0 ) THEN + CALL MPI_REDUCE( ps(1+nbuf*maxb), psout(1+nbuf*maxb), (dim-nbuf*maxb), MPI_DOUBLE_PRECISION, MPI_SUM, root, comm, info ) + IF( info /= 0 ) CALL errore( 'reduce_base_real_to', 'error in mpi_reduce 2', info ) + ELSE + CALL MPI_ALLREDUCE( ps(1+nbuf*maxb), psout(1+nbuf*maxb), (dim-nbuf*maxb), MPI_DOUBLE_PRECISION, MPI_SUM, comm, info ) + IF( info /= 0 ) CALL errore( 'reduce_base_real_to', 'error in mpi_allreduce 2', info ) + END IF + ! + END IF + ! +1 CONTINUE + ! +#if defined __TRACE + write(*,*) 'reduce_base_real_to OUT' +#endif + ! +#endif + ! + RETURN + ! +END SUBROUTINE reduce_base_real_to +! +! +! +!---------------------------------------------------------------------------- +SUBROUTINE reduce_base_integer_to( dim, ps, psout, comm, root ) + !---------------------------------------------------------------------------- + ! + ! ... sums a distributed integer variable ps(dim) over the processors, and + ! ... saves the result on the output variable psout. + ! ... This version uses a fixed-length buffer of appropriate (?) length + ! + USE kinds, ONLY : DP + USE parallel_include + ! + IMPLICIT NONE + ! + INTEGER, INTENT(IN) :: dim + INTEGER, INTENT(IN) :: ps(dim) + INTEGER :: psout(dim) + INTEGER, INTENT(IN) :: comm ! communecator + INTEGER, INTENT(IN) :: root ! if root < 0 perform a reduction to all procs + ! if root >= 0 perform a reduce only to root proc. + ! +#if defined (__MPI) + ! + INTEGER :: info, n, nbuf, nproc, myid + INTEGER, PARAMETER :: maxb = __MSGSIZ_MAX + ! +#if defined __TRACE + write(*,*) 'reduce_base_integer_to IN' +#endif + + CALL mpi_comm_size( comm, nproc, info ) + IF( info /= 0 ) CALL errore( 'reduce_base_integer_to', 'error in mpi_comm_size', info ) + + CALL mpi_comm_rank( comm, myid, info ) + IF( info /= 0 ) CALL errore( 'reduce_base_integer_to', 'error in mpi_comm_rank', info ) + ! + IF ( dim > 0 .AND. nproc <= 1 ) THEN + psout = ps + END IF + IF( dim <= 0 .OR. nproc <= 1 ) GO TO 1 ! go to the end of the subroutine + ! + ! ... synchronize processes + ! +#if defined __USE_BARRIER + CALL mp_synchronize( comm ) +#endif + ! + nbuf = dim / maxb + ! + DO n = 1, nbuf + ! + IF( root >= 0 ) THEN + CALL MPI_REDUCE( ps(1+(n-1)*maxb), psout( 1+(n-1)*maxb ), maxb, MPI_INTEGER, MPI_SUM, root, comm, info ) + IF( info /= 0 ) CALL errore( 'reduce_base_integer_to', 'error in mpi_reduce 1', info ) + ELSE + CALL MPI_ALLREDUCE( ps(1+(n-1)*maxb), psout( 1+(n-1)*maxb ), maxb, MPI_INTEGER, MPI_SUM, comm, info ) + IF( info /= 0 ) CALL errore( 'reduce_base_integer_to', 'error in mpi_allreduce 1', info ) + END IF + ! + END DO + ! + ! ... possible remaining elements < maxb + ! + IF ( ( dim - nbuf * maxb ) > 0 ) THEN + ! + IF( root >= 0 ) THEN + CALL MPI_REDUCE( ps(1+nbuf*maxb), psout(1+nbuf*maxb), (dim-nbuf*maxb), MPI_INTEGER, MPI_SUM, root, comm, info ) + IF( info /= 0 ) CALL errore( 'reduce_base_integer_to', 'error in mpi_reduce 2', info ) + ELSE + CALL MPI_ALLREDUCE( ps(1+nbuf*maxb), psout(1+nbuf*maxb), (dim-nbuf*maxb), MPI_INTEGER, MPI_SUM, comm, info ) + IF( info /= 0 ) CALL errore( 'reduce_base_integer_to', 'error in mpi_allreduce 2', info ) + END IF + ! + END IF + ! +1 CONTINUE + ! +#if defined __TRACE + write(*,*) 'reduce_base_integer_to OUT' +#endif + ! +#endif + ! + RETURN + ! +END SUBROUTINE reduce_base_integer_to +! +! +! Parallel MIN and MAX +! + +!---------------------------------------------------------------------------- +SUBROUTINE parallel_min_integer( dim, ps, comm, root ) + !---------------------------------------------------------------------------- + ! + ! ... compute the minimum of a distributed variable ps(dim) over the processors. + ! ... This version uses a fixed-length buffer of appropriate (?) dim + ! + USE kinds, ONLY : DP + USE parallel_include + ! + IMPLICIT NONE + ! + INTEGER, INTENT(IN) :: dim + INTEGER :: ps(dim) + INTEGER, INTENT(IN) :: comm ! communecator + INTEGER, INTENT(IN) :: root ! if root < 0 perform a reduction to all procs + ! if root >= 0 perform a reduce only to root proc. + ! +#if defined (__MPI) + ! + INTEGER :: info, n, nbuf, nproc, myid + INTEGER, PARAMETER :: maxb = __MSGSIZ_MAX + ! + INTEGER :: buff(maxb) + COMMON / mp_base_integer / buff + ! +#if defined __TRACE + write(*,*) 'parallel_min_integer IN' +#endif + ! + CALL mpi_comm_size( comm, nproc, info ) + IF( info /= 0 ) CALL errore( 'parallel_min_integer', 'error in mpi_comm_size', info ) + + CALL mpi_comm_rank( comm, myid, info ) + IF( info /= 0 ) CALL errore( 'parallel_min_integer', 'error in mpi_comm_rank', info ) + ! + IF ( dim <= 0 .OR. nproc <= 1 ) GO TO 1 + ! + ! ... synchronize processes + ! +#if defined __USE_BARRIER + CALL mp_synchronize( comm ) +#endif + ! + nbuf = dim / maxb + ! + DO n = 1, nbuf + ! + IF( root >= 0 ) THEN + CALL MPI_REDUCE( ps(1+(n-1)*maxb), buff, maxb, MPI_INTEGER, MPI_MIN, root, comm, info ) + IF( info /= 0 ) CALL errore( 'parallel_min_integer', 'error in mpi_reduce 1', info ) + ELSE + CALL MPI_ALLREDUCE( ps(1+(n-1)*maxb), buff, maxb, MPI_INTEGER, MPI_MIN, comm, info ) + IF( info /= 0 ) CALL errore( 'parallel_min_integer', 'error in mpi_allreduce 1', info ) + END IF + ! + IF( root < 0 ) THEN + ps((1+(n-1)*maxb):(n*maxb)) = buff(1:maxb) + ELSE IF( root == myid ) THEN + ps((1+(n-1)*maxb):(n*maxb)) = buff(1:maxb) + END IF + ! + END DO + ! + ! ... possible remaining elements < maxb + ! + IF ( ( dim - nbuf * maxb ) > 0 ) THEN + ! + IF( root >= 0 ) THEN + CALL MPI_REDUCE( ps(1+nbuf*maxb), buff, (dim-nbuf*maxb), MPI_INTEGER, MPI_MIN, root, comm, info ) + IF( info /= 0 ) CALL errore( 'parallel_min_integer', 'error in mpi_reduce 2', info ) + ELSE + CALL MPI_ALLREDUCE( ps(1+nbuf*maxb), buff, (dim-nbuf*maxb), MPI_INTEGER, MPI_MIN, comm, info ) + IF( info /= 0 ) CALL errore( 'parallel_min_integer', 'error in mpi_allreduce 2', info ) + END IF + ! + IF( root < 0 ) THEN + ps((1+nbuf*maxb):dim) = buff(1:(dim-nbuf*maxb)) + ELSE IF( root == myid ) THEN + ps((1+nbuf*maxb):dim) = buff(1:(dim-nbuf*maxb)) + END IF + ! + END IF + ! +1 CONTINUE + ! +#if defined __TRACE + write(*,*) 'parallel_min_integer OUT' +#endif + ! +#endif + ! + RETURN + ! +END SUBROUTINE parallel_min_integer + +! +!---------------------------------------------------------------------------- +SUBROUTINE parallel_max_integer( dim, ps, comm, root ) + !---------------------------------------------------------------------------- + ! + ! ... compute the maximum of a distributed variable ps(dim) over the processors. + ! ... This version uses a fixed-length buffer of appropriate (?) dim + ! + USE kinds, ONLY : DP + USE parallel_include + ! + IMPLICIT NONE + ! + INTEGER, INTENT(IN) :: dim + INTEGER :: ps(dim) + INTEGER, INTENT(IN) :: comm ! communecator + INTEGER, INTENT(IN) :: root ! if root < 0 perform a reduction to all procs + ! if root >= 0 perform a reduce only to root proc. + ! +#if defined (__MPI) + ! + INTEGER :: info, n, nbuf, nproc, myid + INTEGER, PARAMETER :: maxb = __MSGSIZ_MAX + ! + INTEGER :: buff(maxb) + COMMON / mp_base_integer / buff + ! +#if defined __TRACE + write(*,*) 'parallel_max_integer IN' +#endif + CALL mpi_comm_size( comm, nproc, info ) + IF( info /= 0 ) CALL errore( 'parallel_max_integer', 'error in mpi_comm_size', info ) + + CALL mpi_comm_rank( comm, myid, info ) + IF( info /= 0 ) CALL errore( 'parallel_max_integer', 'error in mpi_comm_rank', info ) + ! + IF ( dim <= 0 .OR. nproc <= 1 ) GO TO 1 + ! + ! ... synchronize processes + ! +#if defined __USE_BARRIER + CALL mp_synchronize( comm ) +#endif + ! + nbuf = dim / maxb + ! + DO n = 1, nbuf + ! + IF( root >= 0 ) THEN + CALL MPI_REDUCE( ps(1+(n-1)*maxb), buff, maxb, MPI_INTEGER, MPI_MAX, root, comm, info ) + IF( info /= 0 ) CALL errore( 'parallel_max_integer', 'error in mpi_reduce 1', info ) + ELSE + CALL MPI_ALLREDUCE( ps(1+(n-1)*maxb), buff, maxb, MPI_INTEGER, MPI_MAX, comm, info ) + IF( info /= 0 ) CALL errore( 'parallel_max_integer', 'error in mpi_allreduce 1', info ) + END IF + ! + IF( root < 0 ) THEN + ps((1+(n-1)*maxb):(n*maxb)) = buff(1:maxb) + ELSE IF( root == myid ) THEN + ps((1+(n-1)*maxb):(n*maxb)) = buff(1:maxb) + END IF + ! + END DO + ! + ! ... possible remaining elements < maxb + ! + IF ( ( dim - nbuf * maxb ) > 0 ) THEN + ! + IF( root >= 0 ) THEN + CALL MPI_REDUCE( ps(1+nbuf*maxb), buff, (dim-nbuf*maxb), MPI_INTEGER, MPI_MAX, root, comm, info ) + IF( info /= 0 ) CALL errore( 'parallel_max_integer', 'error in mpi_reduce 2', info ) + ELSE + CALL MPI_ALLREDUCE( ps(1+nbuf*maxb), buff, (dim-nbuf*maxb), MPI_INTEGER, MPI_MAX, comm, info ) + IF( info /= 0 ) CALL errore( 'parallel_max_integer', 'error in mpi_allreduce 2', info ) + END IF + ! + IF( root < 0 ) THEN + ps((1+nbuf*maxb):dim) = buff(1:(dim-nbuf*maxb)) + ELSE IF( root == myid ) THEN + ps((1+nbuf*maxb):dim) = buff(1:(dim-nbuf*maxb)) + END IF + ! + END IF + ! +1 CONTINUE + ! +#if defined __TRACE + write(*,*) 'parallel_max_integer OUT' +#endif +#endif + ! + RETURN + ! +END SUBROUTINE parallel_max_integer + + +!---------------------------------------------------------------------------- +SUBROUTINE parallel_min_real( dim, ps, comm, root ) + !---------------------------------------------------------------------------- + ! + ! ... compute the minimum value of a distributed variable ps(dim) over the processors. + ! ... This version uses a fixed-length buffer of appropriate (?) dim + ! + USE kinds, ONLY : DP + USE parallel_include + ! + IMPLICIT NONE + ! + INTEGER, INTENT(IN) :: dim + REAL(DP) :: ps(dim) + INTEGER, INTENT(IN) :: comm ! communecator + INTEGER, INTENT(IN) :: root ! if root < 0 perform a reduction to all procs + ! if root >= 0 perform a reduce only to root proc. + ! +#if defined (__MPI) + ! + INTEGER :: info, n, nbuf, nproc, myid + INTEGER, PARAMETER :: maxb = __MSGSIZ_MAX + ! + REAL(DP) :: buff(maxb) + COMMON / mp_base_real / buff + ! +#if defined __TRACE + write(*,*) 'parallel_min_real IN' +#endif + CALL mpi_comm_size( comm, nproc, info ) + IF( info /= 0 ) CALL errore( 'parallel_min_real', 'error in mpi_comm_size', info ) + + CALL mpi_comm_rank( comm, myid, info ) + IF( info /= 0 ) CALL errore( 'parallel_min_real', 'error in mpi_comm_rank', info ) + ! + IF ( dim <= 0 .OR. nproc <= 1 ) GO TO 1 + ! + ! ... synchronize processes + ! +#if defined __USE_BARRIER + CALL mp_synchronize( comm ) +#endif + ! + nbuf = dim / maxb + ! + DO n = 1, nbuf + ! + IF( root >= 0 ) THEN + CALL MPI_REDUCE( ps(1+(n-1)*maxb), buff, maxb, MPI_DOUBLE_PRECISION, MPI_MIN, root, comm, info ) + IF( info /= 0 ) CALL errore( 'parallel_min_real', 'error in mpi_reduce 1', info ) + ELSE + CALL MPI_ALLREDUCE( ps(1+(n-1)*maxb), buff, maxb, MPI_DOUBLE_PRECISION, MPI_MIN, comm, info ) + IF( info /= 0 ) CALL errore( 'parallel_min_real', 'error in mpi_allreduce 1', info ) + END IF + ! + IF( root < 0 ) THEN + ps((1+(n-1)*maxb):(n*maxb)) = buff(1:maxb) + ELSE IF( root == myid ) THEN + ps((1+(n-1)*maxb):(n*maxb)) = buff(1:maxb) + END IF + ! + END DO + ! + ! ... possible remaining elements < maxb + ! + IF ( ( dim - nbuf * maxb ) > 0 ) THEN + ! + IF( root >= 0 ) THEN + CALL MPI_REDUCE( ps(1+nbuf*maxb), buff, (dim-nbuf*maxb), MPI_DOUBLE_PRECISION, MPI_MIN, root, comm, info ) + IF( info /= 0 ) CALL errore( 'parallel_min_real', 'error in mpi_reduce 2', info ) + ELSE + CALL MPI_ALLREDUCE( ps(1+nbuf*maxb), buff, (dim-nbuf*maxb), MPI_DOUBLE_PRECISION, MPI_MIN, comm, info ) + IF( info /= 0 ) CALL errore( 'parallel_min_real', 'error in mpi_allreduce 2', info ) + END IF + ! + IF( root < 0 ) THEN + ps((1+nbuf*maxb):dim) = buff(1:(dim-nbuf*maxb)) + ELSE IF( root == myid ) THEN + ps((1+nbuf*maxb):dim) = buff(1:(dim-nbuf*maxb)) + END IF + ! + END IF + ! +1 CONTINUE + ! +#if defined __TRACE + write(*,*) 'parallel_min_real OUT' +#endif +#endif + ! + RETURN + ! +END SUBROUTINE parallel_min_real + +! +!---------------------------------------------------------------------------- +SUBROUTINE parallel_max_real( dim, ps, comm, root ) + !---------------------------------------------------------------------------- + ! + ! ... compute the maximum value of a distributed variable ps(dim) over the processors. + ! ... This version uses a fixed-length buffer of appropriate (?) dim + ! + USE kinds, ONLY : DP + USE parallel_include + ! + IMPLICIT NONE + ! + INTEGER, INTENT(IN) :: dim + REAL(DP) :: ps(dim) + INTEGER, INTENT(IN) :: comm ! communecator + INTEGER, INTENT(IN) :: root ! if root < 0 perform a reduction to all procs + ! if root >= 0 perform a reduce only to root proc. + ! +#if defined (__MPI) + ! + INTEGER :: info, n, nbuf, nproc, myid + INTEGER, PARAMETER :: maxb = __MSGSIZ_MAX + ! + REAL(DP) :: buff(maxb) + COMMON / mp_base_real / buff + ! +#if defined __TRACE + write(*,*) 'parallel_max_real IN' +#endif + + CALL mpi_comm_size( comm, nproc, info ) + IF( info /= 0 ) CALL errore( 'parallel_max_real', 'error in mpi_comm_size', info ) + + CALL mpi_comm_rank( comm, myid, info ) + IF( info /= 0 ) CALL errore( 'parallel_max_real', 'error in mpi_comm_rank', info ) + ! + IF ( dim <= 0 .OR. nproc <= 1 ) GO TO 1 + ! + ! ... synchronize processes + ! +#if defined __USE_BARRIER + CALL mp_synchronize( comm ) +#endif + ! + nbuf = dim / maxb + ! + DO n = 1, nbuf + ! + IF( root >= 0 ) THEN + CALL MPI_REDUCE( ps(1+(n-1)*maxb), buff, maxb, MPI_DOUBLE_PRECISION, MPI_MAX, root, comm, info ) + IF( info /= 0 ) CALL errore( 'parallel_max_real', 'error in mpi_reduce 1', info ) + ELSE + CALL MPI_ALLREDUCE( ps(1+(n-1)*maxb), buff, maxb, MPI_DOUBLE_PRECISION, MPI_MAX, comm, info ) + IF( info /= 0 ) CALL errore( 'parallel_max_real', 'error in mpi_allreduce 1', info ) + END IF + ! + IF( root < 0 ) THEN + ps((1+(n-1)*maxb):(n*maxb)) = buff(1:maxb) + ELSE IF( root == myid ) THEN + ps((1+(n-1)*maxb):(n*maxb)) = buff(1:maxb) + END IF + ! + END DO + ! + ! ... possible remaining elements < maxb + ! + IF ( ( dim - nbuf * maxb ) > 0 ) THEN + ! + IF( root >= 0 ) THEN + CALL MPI_REDUCE( ps(1+nbuf*maxb), buff, (dim-nbuf*maxb), MPI_DOUBLE_PRECISION, MPI_MAX, root, comm, info ) + IF( info /= 0 ) CALL errore( 'parallel_max_real', 'error in mpi_reduce 2', info ) + ELSE + CALL MPI_ALLREDUCE( ps(1+nbuf*maxb), buff, (dim-nbuf*maxb), MPI_DOUBLE_PRECISION, MPI_MAX, comm, info ) + IF( info /= 0 ) CALL errore( 'parallel_max_real', 'error in mpi_allreduce 2', info ) + END IF + ! + IF( root < 0 ) THEN + ps((1+nbuf*maxb):dim) = buff(1:(dim-nbuf*maxb)) + ELSE IF( root == myid ) THEN + ps((1+nbuf*maxb):dim) = buff(1:(dim-nbuf*maxb)) + END IF + ! + END IF + ! +1 CONTINUE + ! +#if defined __TRACE + write(*,*) 'parallel_max_real OUT' +#endif + ! +#endif + ! + RETURN + ! +END SUBROUTINE parallel_max_real + + +SUBROUTINE hangup() +#if defined (__MPI) + IMPLICIT NONE + INCLUDE 'mpif.h' + INTEGER IERR + CALL MPI_BARRIER( MPI_COMM_WORLD, ierr ) + IF( ierr /= 0 ) CALL errore( ' hangup ', ' error in mpi_barrier ', ierr ) + CALL MPI_FINALIZE( ierr ) + IF( ierr /= 0 ) CALL errore( ' hangup ', ' error in mpi_finalize ', ierr ) +#endif + STOP 'hangup' +END SUBROUTINE hangup diff --git a/tests/apps/miniDFT/tests/src/mp_global.f90 b/tests/apps/miniDFT/tests/src/mp_global.f90 new file mode 100644 index 0000000000..96423ac115 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/mp_global.f90 @@ -0,0 +1,855 @@ +! +! Copyright (C) 2002-2009 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +!---------------------------------------------------------------------------- +MODULE mp_global + !---------------------------------------------------------------------------- + ! + USE mp, ONLY : mp_comm_free, mp_size, mp_rank, mp_sum, mp_barrier, & + mp_bcast, mp_start, mp_end + USE io_global, ONLY : stdout, io_global_start, meta_ionode_id, meta_ionode + USE parallel_include + ! + IMPLICIT NONE + SAVE + ! + ! ... World group (all processors) + ! + INTEGER :: mpime = 0 ! processor index (starts from 0 to nproc-1) + INTEGER :: root = 0 ! index of the root processor + INTEGER :: nproc = 1 ! number of processors + INTEGER :: world_comm = 0 ! communicator + ! + ! ... Image groups (processors within an image) + ! + INTEGER :: nimage = 1 ! number of images + INTEGER :: me_image = 0 ! index of the processor within an image + INTEGER :: root_image= 0 ! index of the root processor within an image + INTEGER :: my_image_id=0 ! index of my image + INTEGER :: nproc_image=1 ! number of processors within an image + INTEGER :: inter_image_comm = 0 ! inter image communicator + INTEGER :: intra_image_comm = 0 ! intra image communicator + ! + ! ... Pool groups (processors within a pool of k-points) + ! + INTEGER :: npool = 1 ! number of "k-points"-pools + INTEGER :: me_pool = 0 ! index of the processor within a pool + INTEGER :: root_pool = 0 ! index of the root processor within a pool + INTEGER :: my_pool_id = 0 ! index of my pool + INTEGER :: nproc_pool = 1 ! number of processors within a pool + INTEGER :: inter_pool_comm = 0 ! inter pool communicator + INTEGER :: intra_pool_comm = 0 ! intra pool communicator + ! + ! ... Band groups (processors within a pool of bands) + ! + INTEGER :: nbgrp = 1 ! number of band groups + INTEGER :: me_bgrp = 0 ! index of the processor within a band group + INTEGER :: root_bgrp = 0 ! index of the root processor within a band group + INTEGER :: my_bgrp_id = 0 ! index of my band group + INTEGER :: nproc_bgrp = 1 ! number of processor within a band group + INTEGER :: inter_bgrp_comm = 0 ! inter band group communicator + INTEGER :: intra_bgrp_comm = 0 ! intra band group communicator + INTEGER :: ibnd_start = 0 !starting band index + INTEGER :: ibnd_end = 0 !ending band index + ! + ! ... ortho (or linear-algebra) groups + ! + INTEGER :: np_ortho(2) = 1 ! size of the processor grid used in ortho + INTEGER :: me_ortho(2) = 0 ! coordinates of the processors + INTEGER :: me_ortho1 = 0 ! task id for the ortho group + INTEGER :: nproc_ortho = 1 ! size of the ortho group: + INTEGER :: leg_ortho = 1 ! the distance in the father communicator + ! of two neighbour processors in ortho_comm + INTEGER :: ortho_comm = 0 ! communicator for the ortho group + INTEGER :: ortho_comm_id= 0 ! id of the ortho_comm + ! +!!$ #if defined __SCALAPACK + INTEGER :: me_blacs = 0 ! BLACS processor index starting from 0 + INTEGER :: np_blacs = 1 ! BLACS number of processor + INTEGER :: world_cntx = -1 ! BLACS context of all processor + INTEGER :: ortho_cntx = -1 ! BLACS context for ortho_comm +!!$ #endif + ! + ! ... "task" groups (for band parallelization of FFT) + ! + INTEGER :: ntask_groups = 1 ! number of proc. in an orbital "task group" + ! + ! ... Misc parallelization info + ! + INTEGER :: kunit = 1 ! granularity of k-point distribution + ! ... number of processors written in the data file for checkin purposes: + INTEGER :: nproc_file = 1 ! world group + INTEGER :: nproc_image_file = 1 ! in an image + INTEGER :: nproc_pool_file = 1 ! in a pool + ! + PRIVATE :: init_pools, init_bands, init_ortho + PRIVATE :: ntask_groups + ! +CONTAINS + ! + !----------------------------------------------------------------------- + SUBROUTINE mp_startup ( ) + !----------------------------------------------------------------------- + ! ... This subroutine initializes MPI + ! ... Processes are organized in NIMAGE images each dealing with a subset of + ! ... images used to discretize the "path" (only in "path" optimizations) + ! ... Within each image processes are organized in NPOOL pools each dealing + ! ... with a subset of kpoints. + ! ... Within each pool R & G space distribution is performed. + ! ... NPROC is read from command line or can be set with the appropriate + ! ... environment variable ( for example use 'setenv MP_PROCS 8' on IBM SP + ! ... machine to run on NPROC=8 processors ); NIMAGE and NPOOL are read from + ! ... command line. + ! ... NPOOL must be a whole divisor of NPROC + ! + IMPLICIT NONE + INTEGER :: world, nproc_ortho_in = 0 + INTEGER :: root = 0 + ! + ! + ! ... get the basic parameters from communications sub-system + ! ... to handle processors + ! ... mpime = processor number, starting from 0 + ! ... nproc = number of processors + ! ... world = group index of all processors + ! + CALL mp_start( nproc, mpime, world ) + ! + ! + ! ... now initialize processors and groups variables + ! ... set global coordinate for this processor + ! ... root = index of the root processor + ! + CALL mp_global_start( root, mpime, world, nproc ) + ! + ! ... initialize input/output, set (and get) the I/O nodes + ! + CALL io_global_start( mpime, root ) + ! + meta_ionode = ( mpime == root ) + meta_ionode_id = root + ! + IF ( meta_ionode ) THEN + ! + ! ... How many parallel images ? + ! + CALL get_arg_nimage( nimage ) + ! + nimage = MAX( nimage, 1 ) + nimage = MIN( nimage, nproc ) + ! + ! ... How many band groups? + ! + CALL get_arg_nbgrp( nbgrp ) + ! + nbgrp = MAX( nbgrp, 1 ) + nbgrp = MIN( nbgrp, nproc ) + ! + ! ... How many k-point pools ? + ! + CALL get_arg_npool( npool ) + ! + npool = MAX( npool, 1 ) + npool = MIN( npool, nproc ) + ! + ! ... How many task groups ? + ! + CALL get_arg_ntg( ntask_groups ) + ! + ! ... How many processors involved in diagonalization of Hamiltonian ? + ! + CALL get_arg_northo( nproc_ortho_in ) + ! + ! ... nproc_ortho_in = 0 if no command-line option -ndiag or -northo + ! ... nproc_ortho_in = N if -ndiag N or -northo N comm-line opt present + ! + END IF + ! + CALL mp_barrier() + ! + ! ... broadcast input parallelization options to all processors + ! + CALL mp_bcast( npool, meta_ionode_id ) + CALL mp_bcast( nimage, meta_ionode_id ) + CALL mp_bcast( nbgrp, meta_ionode_id ) + CALL mp_bcast( ntask_groups, meta_ionode_id ) + CALL mp_bcast( nproc_ortho_in, meta_ionode_id ) + ! + ! ... initialize images, band, k-point, ortho groups in sequence + ! + CALL init_images( world_comm ) + ! + CALL init_pools( intra_image_comm ) + ! + CALL init_bands( intra_pool_comm ) + ! + CALL init_ortho( nproc_ortho_in, intra_bgrp_comm ) + ! + ! + RETURN + ! + END SUBROUTINE mp_startup + ! + !----------------------------------------------------------------------- + SUBROUTINE mp_global_start( root_i, mpime_i, group_i, nproc_i ) + !----------------------------------------------------------------------- + ! + IMPLICIT NONE + ! + INTEGER, INTENT(IN) :: root_i, mpime_i, group_i, nproc_i + ! + root = root_i + mpime = mpime_i + world_comm = group_i + nproc = nproc_i + nproc_pool = nproc_i + nproc_image = nproc_i + nproc_bgrp = nproc_i + my_pool_id = 0 + my_image_id = 0 + my_bgrp_id = 0 + me_pool = mpime + me_image = mpime + me_bgrp = mpime + root_pool = root + root_image = root + root_bgrp = root + inter_pool_comm = group_i + intra_pool_comm = group_i + inter_image_comm = group_i + intra_image_comm = group_i + inter_bgrp_comm = group_i + intra_bgrp_comm = group_i + ortho_comm = group_i + ! + RETURN + ! + END SUBROUTINE mp_global_start + ! + !----------------------------------------------------------------------- + SUBROUTINE mp_startup_new (root, world ) + !----------------------------------------------------------------------- + ! ... This subroutine initializes MPI + ! ... Processes are organized in NIMAGE images each dealing with a subset of + ! ... images used to discretize the "path" (only in "path" optimizations) + ! ... Within each image processes are organized in NPOOL pools each dealing + ! ... with a subset of kpoints. + ! ... Within each pool R & G space distribution is performed. + ! ... NPROC is read from command line or can be set with the appropriate + ! ... environment variable ( for example use 'setenv MP_PROCS 8' on IBM SP + ! ... machine to run on NPROC=8 processors ); NIMAGE and NPOOL are read from + ! ... command line. + ! ... NPOOL must be a whole divisor of NPROC + ! + IMPLICIT NONE + ! + INTEGER, INTENT(IN) :: world, root + INTEGER :: nproc_ortho_in = 0 + ! + INTEGER :: myrank, npe + ! + ! ... now initialize processors and groups variables + ! ... set global coordinate for this processor + ! ... root = index of the root processor + ! + myrank = mp_rank(world) + npe = mp_size(world) + ! + CALL mp_global_start_new( root, myrank, world, npe ) + ! + ! ... initialize input/output, set (and get) the I/O nodes + ! + CALL io_global_start( myrank, root ) + ! + IF ( myrank == root ) THEN + ! + ! ... How many band groups? + ! + CALL get_arg_nbgrp( nbgrp ) + ! + nbgrp = MAX( nbgrp, 1 ) + nbgrp = MIN( nbgrp, nproc ) + ! + ! ... How many k-point pools ? + ! + CALL get_arg_npool( npool ) + ! + npool = MAX( npool, 1 ) + npool = MIN( npool, nproc ) + ! + ! ... How many task groups ? + ! + CALL get_arg_ntg( ntask_groups ) + ! + ! ... How many processors involved in diagonalization of Hamiltonian ? + ! + CALL get_arg_northo( nproc_ortho_in ) + ! + ! ... nproc_ortho_in = 0 if no command-line option -ndiag or -northo + ! ... nproc_ortho_in = N if -ndiag N or -northo N comm-line opt present + ! + END IF + ! + CALL mp_barrier(world) + ! + ! ... broadcast input parallelization options to all processors + ! + CALL mp_bcast( npool, root, world ) + CALL mp_bcast( nbgrp, root, world ) + CALL mp_bcast( ntask_groups, root, world ) + CALL mp_bcast( nproc_ortho_in, root, world ) + ! + ! ... initialize images, band, k-point, ortho groups in sequence + ! + ! + CALL init_pools( intra_image_comm ) + ! + CALL init_bands( intra_pool_comm ) + ! + CALL init_ortho( nproc_ortho_in, intra_bgrp_comm ) + ! + ! + RETURN + ! + END SUBROUTINE mp_startup_new + ! + !----------------------------------------------------------------------- + SUBROUTINE mp_global_start_new( root_i, mpime_i, group_i, nproc_i ) + !----------------------------------------------------------------------- + ! + IMPLICIT NONE + ! + INTEGER, INTENT(IN) :: root_i, mpime_i, group_i, nproc_i + ! + root = root_i + mpime = mpime_i + world_comm = group_i + nproc = nproc_i + nproc_pool = nproc_i + nproc_bgrp = nproc_i + my_pool_id = 0 + my_bgrp_id = 0 + me_pool = mpime + me_bgrp = mpime + root_pool = root + root_bgrp = root + inter_pool_comm = group_i + intra_pool_comm = group_i + inter_bgrp_comm = group_i + intra_bgrp_comm = group_i + ortho_comm = group_i + ! + RETURN + ! + END SUBROUTINE mp_global_start_new + ! + !----------------------------------------------------------------------- + SUBROUTINE mp_global_end ( ) + !----------------------------------------------------------------------- + ! + CALL mp_barrier() + CALL mp_end () + ! + END SUBROUTINE mp_global_end + ! + !----------------------------------------------------------------------- + SUBROUTINE mp_global_group_start( mep, myp, nprocp, num_of_pools ) + !----------------------------------------------------------------------- + ! + IMPLICIT NONE + ! + INTEGER, INTENT(IN) :: mep, myp, nprocp, num_of_pools + ! + me_pool = mep + my_pool_id = myp + nproc_pool = nprocp + npool = num_of_pools + ! + RETURN + ! + END SUBROUTINE mp_global_group_start + ! + !---------------------------------------------------------------------------- + SUBROUTINE init_images ( parent_comm ) + !--------------------------------------------------------------------------- + ! + ! ... This routine divides all MPI processors into images + ! + IMPLICIT NONE + ! + INTEGER, INTENT(IN) :: parent_comm + ! + INTEGER :: ierr = 0 + INTEGER :: parent_nproc = 1 + INTEGER :: parent_mype = 0 + ! +#if defined (__MPI) + ! + parent_nproc = mp_size( parent_comm ) + parent_mype = mp_rank( parent_comm ) + ! + IF ( nimage < 1 .OR. nimage > parent_nproc ) & + CALL errore( 'init_images', 'invalid number of images, out of range', 1 ) + IF ( MOD( nproc, nimage ) /= 0 ) & + CALL errore( 'init_images', 'n. of images must be divisor of parent_nproc', 1 ) + ! + ! ... set number of cpus per image + ! + nproc_image = parent_nproc / nimage + ! + ! ... set index of image for this processor ( 0 : nimage - 1 ) + ! + my_image_id = parent_mype / nproc_image + ! + ! ... set index of processor within the image ( 0 : nproc_image - 1 ) + ! + me_image = MOD( parent_mype, nproc_image ) + ! + CALL mp_barrier( parent_comm ) + ! + ! ... the intra_image_comm communicator is created + ! + CALL MPI_COMM_SPLIT( parent_comm, my_image_id, parent_mype, intra_image_comm, ierr ) + IF ( ierr /= 0 ) CALL errore & + ( 'init_images', 'intra image communicator initialization', ABS(ierr) ) + ! + CALL mp_barrier( parent_comm ) + ! + ! ... the inter_image_comm communicator is created + ! + CALL MPI_COMM_SPLIT( parent_comm, me_image, parent_mype, inter_image_comm, ierr ) + IF ( ierr /= 0 ) CALL errore & + ( 'init_images', 'inter image communicator initialization', ABS(ierr) ) +#endif + RETURN + ! + END SUBROUTINE init_images + + !---------------------------------------------------------------------------- + SUBROUTINE init_bands( parent_comm ) + !--------------------------------------------------------------------------- + ! + ! ... This routine divides parent_comm into band pools + ! + IMPLICIT NONE + ! + INTEGER, INTENT(IN) :: parent_comm + ! + INTEGER :: ierr = 0 + INTEGER :: parent_nproc = 1 + INTEGER :: parent_mype = 0 + ! +#if defined (__MPI) + ! + parent_nproc = mp_size( parent_comm ) + parent_mype = mp_rank( parent_comm ) + ! + IF ( nbgrp < 1 .OR. nbgrp > parent_nproc ) & + CALL errore( 'init_bands', 'invalid number of band groups, out of range', 1 ) + IF ( MOD( parent_nproc, nbgrp ) /= 0 ) & + CALL errore( 'init_bands', 'n. of band groups must be divisor of parent_nproc', 1 ) + ! + ! ... Set number of processors per band group + ! + nproc_bgrp = parent_nproc / nbgrp + ! + ! ... set index of band group for this processor ( 0 : nbgrp - 1 ) + ! + my_bgrp_id = parent_mype / nproc_bgrp + ! + ! ... set index of processor within the image ( 0 : nproc_image - 1 ) + ! + me_bgrp = MOD( parent_mype, nproc_bgrp ) + ! + CALL mp_barrier( parent_comm ) + ! + ! ... the intra_bgrp_comm communicator is created + ! + CALL MPI_COMM_SPLIT( parent_comm, my_bgrp_id, parent_mype, intra_bgrp_comm, ierr ) + ! + IF ( ierr /= 0 ) & + CALL errore( 'init_bands', 'intra band group communicator initialization', ABS(ierr) ) + ! + CALL mp_barrier( parent_comm ) + ! + ! ... the inter_bgrp_comm communicator is created + ! + CALL MPI_COMM_SPLIT( parent_comm, me_bgrp, parent_mype, inter_bgrp_comm, ierr ) + ! + IF ( ierr /= 0 ) & + CALL errore( 'init_bands', 'inter band group communicator initialization', ABS(ierr) ) + ! +#endif + RETURN + ! + END SUBROUTINE init_bands + ! + !---------------------------------------------------------------------------- + SUBROUTINE init_pools( parent_comm ) + !--------------------------------------------------------------------------- + ! + ! ... This routine divides band groups into k-point pools + ! + IMPLICIT NONE + ! + INTEGER, INTENT(IN) :: parent_comm + ! + INTEGER :: ierr = 0 + INTEGER :: parent_nproc = 1 + INTEGER :: parent_mype = 0 + ! +#if defined (__MPI) + ! + parent_nproc = mp_size( parent_comm ) + parent_mype = mp_rank( parent_comm ) + ! + ! ... number of cpus per pool of k-points (they are created inside each image) + ! + nproc_pool = parent_nproc / npool + ! + IF ( MOD( parent_nproc, npool ) /= 0 ) & + CALL errore( 'init_pools', 'invalid number of pools, parent_nproc /= nproc_pool * npool', 1 ) + ! + ! ... my_pool_id = pool index for this processor ( 0 : npool - 1 ) + ! ... me_pool = processor index within the pool ( 0 : nproc_pool - 1 ) + ! + my_pool_id = parent_mype / nproc_pool + me_pool = MOD( parent_mype, nproc_pool ) + ! + CALL mp_barrier( parent_comm ) + ! + ! ... the intra_pool_comm communicator is created + ! + CALL MPI_COMM_SPLIT( parent_comm, my_pool_id, parent_mype, intra_pool_comm, ierr ) + ! + IF ( ierr /= 0 ) & + CALL errore( 'init_pools', 'intra pool communicator initialization', ABS(ierr) ) + ! + CALL mp_barrier( parent_comm ) + ! + ! ... the inter_pool_comm communicator is created + ! + CALL MPI_COMM_SPLIT( parent_comm, me_pool, parent_mype, inter_pool_comm, ierr ) + ! + IF ( ierr /= 0 ) & + CALL errore( 'init_pools', 'inter pool communicator initialization', ABS(ierr) ) + ! +#endif + ! + RETURN + END SUBROUTINE init_pools + ! + !---------------------------------------------------------------------------- + SUBROUTINE init_ortho( nproc_ortho_in, parent_comm ) + !--------------------------------------------------------------------------- + ! + ! ... Ortho group initialization + ! + IMPLICIT NONE + ! + INTEGER, INTENT(IN) :: nproc_ortho_in! read from command-line, 0 if unset + INTEGER, INTENT(IN) :: parent_comm ! communicator of the parent group + ! + INTEGER :: nproc_ortho_try + INTEGER :: parent_nproc ! nproc of the parent group + INTEGER :: ierr = 0 + ! + parent_nproc = mp_size( parent_comm ) + ! +!!$ #if defined __SCALAPACK + + ! define a 1D grid containing all MPI task of MPI_COMM_WORLD communicator + ! + CALL BLACS_PINFO( me_blacs, np_blacs ) + CALL BLACS_GET( -1, 0, world_cntx ) + CALL BLACS_GRIDINIT( world_cntx, 'Row', 1, np_blacs ) + ! +!!$ #endif + ! + IF( nproc_ortho_in > 0 ) THEN + ! command-line argument -ndiag N or -nproc N set to N + ! use the command line value ensuring that it falls in the proper range + nproc_ortho_try = MIN( nproc_ortho_in , parent_nproc ) + ELSE + ! no command-line argument -ndiag N or -nproc N is present + ! insert here custom architecture specific default definitions +!!$ #if defined __SCALAPACK + nproc_ortho_try = MAX( parent_nproc/2, 1 ) +!!$#else +!!$ nproc_ortho_try = 1 +!!$#endif + END IF + ! + ! the ortho group for parallel linear algebra is a sub-group of the pool, + ! then there are as many ortho groups as pools. + ! + CALL init_ortho_group( nproc_ortho_try, parent_comm ) + ! + RETURN + ! + END SUBROUTINE init_ortho + ! + ! + SUBROUTINE init_ortho_group( nproc_try_in, comm_all ) + ! + IMPLICIT NONE + + INTEGER, INTENT(IN) :: nproc_try_in, comm_all + + LOGICAL, SAVE :: first = .true. + INTEGER :: ierr, color, key, me_all, nproc_all, nproc_try + +!!$ #if defined __SCALAPACK + INTEGER, ALLOCATABLE :: blacsmap(:,:) + INTEGER, ALLOCATABLE :: ortho_cntx_pe(:,:,:) + INTEGER :: nprow, npcol, myrow, mycol, i, j, k + INTEGER, EXTERNAL :: BLACS_PNUM + ! + INTEGER :: nparent=1 + INTEGER :: total_nproc=1 + INTEGER :: total_mype=0 + INTEGER :: nproc_parent=1 + INTEGER :: my_parent_id=0 +!!$ #endif + + +#if defined __MPI + + me_all = mp_rank( comm_all ) + ! + nproc_all = mp_size( comm_all ) + ! + nproc_try = MIN( nproc_try_in, nproc_all ) + nproc_try = MAX( nproc_try, 1 ) + + IF( .NOT. first ) THEN + ! + ! free resources associated to the communicator + ! + CALL mp_comm_free( ortho_comm ) + ! +!!$ #if defined __SCALAPACK + IF( ortho_comm_id > 0 ) THEN + CALL BLACS_GRIDEXIT( ortho_cntx ) + ENDIF + ortho_cntx = -1 +!!$ #endif + ! + END IF + + ! find the square closer (but lower) to nproc_try + ! + CALL grid2d_dims( 'S', nproc_try, np_ortho(1), np_ortho(2) ) + ! + ! now, and only now, it is possible to define the number of tasks + ! in the ortho group for parallel linear algebra + ! + nproc_ortho = np_ortho(1) * np_ortho(2) + ! + IF( nproc_all >= 4*nproc_ortho ) THEN + ! + ! here we choose a processor every 4, in order not to stress memory BW + ! on multi core procs, for which further performance enhancements are + ! possible using OpenMP BLAS inside regter/cegter/rdiaghg/cdiaghg + ! (to be implemented) + ! + color = 0 + IF( me_all < 4*nproc_ortho .AND. MOD( me_all, 4 ) == 0 ) color = 1 + ! + leg_ortho = 4 + ! + ELSE IF( nproc_all >= 2*nproc_ortho ) THEN + ! + ! here we choose a processor every 2, in order not to stress memory BW + ! + color = 0 + IF( me_all < 2*nproc_ortho .AND. MOD( me_all, 2 ) == 0 ) color = 1 + ! + leg_ortho = 2 + ! + ELSE + ! + ! here we choose the first processors + ! + color = 0 + IF( me_all < nproc_ortho ) color = 1 + ! + leg_ortho = 1 + ! + END IF + ! + key = me_all + ! + ! initialize the communicator for the new group by splitting the input communicator + ! + CALL MPI_COMM_SPLIT( comm_all, color, key, ortho_comm, ierr ) + IF( ierr /= 0 ) & + CALL errore( " init_ortho_group ", " initializing ortho group communicator ", ierr ) + ! + ! Computes coordinates of the processors, in row maior order + ! + me_ortho1 = mp_rank( ortho_comm ) + ! + IF( me_all == 0 .AND. me_ortho1 /= 0 ) & + CALL errore( " init_ortho_group ", " wrong root task in ortho group ", ierr ) + ! + if( color == 1 ) then + ortho_comm_id = 1 + CALL GRID2D_COORDS( 'R', me_ortho1, np_ortho(1), np_ortho(2), me_ortho(1), me_ortho(2) ) + CALL GRID2D_RANK( 'R', np_ortho(1), np_ortho(2), me_ortho(1), me_ortho(2), ierr ) + IF( ierr /= me_ortho1 ) & + CALL errore( " init_ortho_group ", " wrong task coordinates in ortho group ", ierr ) + IF( me_ortho1*leg_ortho /= me_all ) & + CALL errore( " init_ortho_group ", " wrong rank assignment in ortho group ", ierr ) + else + ortho_comm_id = 0 + me_ortho(1) = me_ortho1 + me_ortho(2) = me_ortho1 + endif +!!$ #if defined __SCALAPACK + ! + ! This part is used to eliminate the image dependency from ortho groups + ! SCALAPACK is now independent of whatever level of parallelization + ! is present on top of pool parallelization + ! + total_nproc = mp_size(mpi_comm_world) + total_mype = mp_rank(mpi_comm_world) + nparent = total_nproc/npool/nproc_pool + nproc_parent = total_nproc/nparent + my_parent_id = total_mype/nproc_parent + ! + ! + ALLOCATE( ortho_cntx_pe( npool, nbgrp, nparent ) ) + ALLOCATE( blacsmap( np_ortho(1), np_ortho(2) ) ) + + DO j = 1, nparent + + DO k = 1, nbgrp + + DO i = 1, npool + + CALL BLACS_GET( -1, 0, ortho_cntx_pe( i, k, j ) ) ! take a default value + + blacsmap = 0 + nprow = np_ortho(1) + npcol = np_ortho(2) + + IF( ( j == ( my_parent_id + 1 ) ) .and. ( k == ( my_bgrp_id + 1 ) ) .and. & + ( i == ( my_pool_id + 1 ) ) .and. ( ortho_comm_id > 0 ) ) THEN + + blacsmap( me_ortho(1) + 1, me_ortho(2) + 1 ) = BLACS_PNUM( world_cntx, 0, me_blacs ) + + END IF + + ! All MPI tasks defined in world comm take part in the definition of the BLACS grid + + CALL mp_sum( blacsmap ) + + CALL BLACS_GRIDMAP( ortho_cntx_pe(i,k,j), blacsmap, nprow, nprow, npcol ) + + CALL BLACS_GRIDINFO( ortho_cntx_pe(i,k,j), nprow, npcol, myrow, mycol ) + + IF( ( j == ( my_parent_id + 1 ) ) .and. ( k == ( my_bgrp_id + 1 ) ) .and. & + ( i == ( my_pool_id + 1 ) ) .and. ( ortho_comm_id > 0 ) ) THEN + + IF( np_ortho(1) /= nprow ) & + CALL errore( ' init_ortho_group ', ' problem with SCALAPACK, wrong no. of task rows ', 1 ) + IF( np_ortho(2) /= npcol ) & + CALL errore( ' init_ortho_group ', ' problem with SCALAPACK, wrong no. of task columns ', 1 ) + IF( me_ortho(1) /= myrow ) & + CALL errore( ' init_ortho_group ', ' problem with SCALAPACK, wrong task row ID ', 1 ) + IF( me_ortho(2) /= mycol ) & + CALL errore( ' init_ortho_group ', ' problem with SCALAPACK, wrong task columns ID ', 1 ) + + ortho_cntx = ortho_cntx_pe(i,k,j) + + END IF + + END DO + + END DO + + END DO + + DEALLOCATE( blacsmap ) + DEALLOCATE( ortho_cntx_pe ) + + +!!$ #endif + +!!$#else +!!$ +!!$ ortho_comm_id = 1 + +#endif + + first = .false. + + RETURN + END SUBROUTINE init_ortho_group + ! + ! + SUBROUTINE distribute_over_bgrp( i2g, nl, nx ) + ! + IMPLICIT NONE + INTEGER, INTENT(OUT) :: i2g ! global index of the first local element + INTEGER, INTENT(OUT) :: nl ! local number of elements + INTEGER, INTENT(IN) :: nx ! dimension of the global array to be distributed + ! + INTEGER, EXTERNAL :: ldim_block, gind_block + ! + nl = ldim_block( nx, nbgrp, my_bgrp_id ) + i2g = gind_block( 1, nx, nbgrp, my_bgrp_id ) + ! + RETURN + ! + END SUBROUTINE distribute_over_bgrp + ! + SUBROUTINE init_index_over_band(comm,nbnd) + IMPLICIT NONE +#if defined (__MPI) + ! + include 'mpif.h' + ! +#endif + INTEGER, INTENT(IN) :: comm, nbnd + + INTEGER :: npe, myrank, ierror, rest, k + + myrank = mp_rank(comm) + npe = mp_size(comm) + +! call mpi_comm_rank(comm, mp_rank, ierror) +! call mpi_comm_size(comm, mp_size, ierror) + rest = mod(nbnd, npe) + k = int(nbnd/npe) + + if(k.ge.1)then + if(rest > myrank)then + ibnd_start = (myrank)*k + (myrank+1) + ibnd_end = (myrank+1)*k + (myrank+1) + else + ibnd_start = (myrank)*k + rest + 1 + ibnd_end = (myrank+1)*k + rest + endif + else + ibnd_start = 1 + ibnd_end = nbnd + endif + + + END SUBROUTINE init_index_over_band + ! + ! + FUNCTION get_ntask_groups() + IMPLICIT NONE + INTEGER :: get_ntask_groups + get_ntask_groups = ntask_groups + RETURN + END FUNCTION get_ntask_groups + ! +END MODULE mp_global diff --git a/tests/apps/miniDFT/tests/src/mp_image_global_module.f90 b/tests/apps/miniDFT/tests/src/mp_image_global_module.f90 new file mode 100644 index 0000000000..04ba4f449c --- /dev/null +++ b/tests/apps/miniDFT/tests/src/mp_image_global_module.f90 @@ -0,0 +1,175 @@ +! +! Copyright (C) 2002-2009 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +!---------------------------------------------------------------------------- +MODULE mp_image_global_module + !---------------------------------------------------------------------------- + ! + USE mp, ONLY : mp_comm_free, mp_size, mp_rank, mp_sum, mp_barrier, & + mp_bcast, mp_start, mp_end + USE io_global, ONLY : stdout, io_global_start, io_global_getmeta + USE parallel_include + ! + IMPLICIT NONE + SAVE + ! + ! ... World group (all processors) + ! + INTEGER :: mpime = 0 ! processor index (starts from 0 to nproc-1) + INTEGER :: root = 0 ! index of the root processor + INTEGER :: nproc = 1 ! number of processors + INTEGER :: world_comm = 0 ! communicator + ! + ! ... Image groups (processors within an image) + ! + INTEGER :: nimage = 1 ! number of images + INTEGER :: me_image = 0 ! index of the processor within an image + INTEGER :: root_image= 0 ! index of the root processor within an image + INTEGER :: my_image_id=0 ! index of my image + INTEGER :: nproc_image=1 ! number of processors within an image + INTEGER :: inter_image_comm = 0 ! inter image communicator + INTEGER :: intra_image_comm = 0 ! intra image communicator + ! + ! ... number of processors written in the data file for checkin purposes: + INTEGER :: nproc_file = 1 ! world group + INTEGER :: nproc_image_file = 1 ! in an image + ! + PRIVATE :: mp_images_init + ! +CONTAINS + ! + !----------------------------------------------------------------------- + SUBROUTINE mp_image_startup (root,comm) + !----------------------------------------------------------------------- + ! ... This subroutine initializes MPI + ! ... Processes are organized in NIMAGE images each dealing with a subset of + ! ... images used to discretize the "path" (only in "path" optimizations) + ! + IMPLICIT NONE + ! + INTEGER, INTENT(IN) :: comm + INTEGER, INTENT(IN) :: root + ! + INTEGER :: myrank, npe + ! + ! ... now initialize processors and groups variables + ! ... set global coordinate for this processor + ! ... root = index of the root processor + ! + myrank = mp_rank(comm) + npe = mp_size(comm) + ! + ! ... mp_global_path_start set default values for + ! mpime, root, nproc, world_comm, nproc_image, my_image_id, + ! root_image ... + ! + CALL mp_image_global_start( root, myrank, comm, npe ) + ! + ! ... initialize input/output, set (and get) the I/O nodes + ! ... sets meta_ionode and ionode_id (==root) + ! + CALL io_global_getmeta ( myrank, root ) + ! + IF ( myrank==root ) THEN + ! + ! ... How many parallel images ? + ! + CALL get_arg_nimage( nimage ) + ! + nimage = MAX( nimage, 1 ) + nimage = MIN( nimage, npe ) + ! + END IF + ! + CALL mp_barrier(comm) + ! + ! ... broadcast input parallelization options to all processors + ! + CALL mp_bcast( nimage, root, comm ) + ! + ! ... initialize images, band, k-point, ortho groups in sequence + ! + CALL mp_images_init( ) + ! + ! + RETURN + ! + END SUBROUTINE mp_image_startup + ! + !----------------------------------------------------------------------- + SUBROUTINE mp_image_global_start( root_i, mpime_i, group_i, nproc_i ) + !----------------------------------------------------------------------- + ! + IMPLICIT NONE + ! + INTEGER, INTENT(IN) :: root_i, mpime_i, group_i, nproc_i + ! + root = root_i + mpime = mpime_i + world_comm = group_i + nproc = nproc_i + nproc_image = nproc_i + my_image_id = 0 + me_image = mpime + root_image = root + inter_image_comm = group_i + intra_image_comm = group_i + ! + RETURN + ! + END SUBROUTINE mp_image_global_start + ! + !----------------------------------------------------------------------- + !---------------------------------------------------------------------------- + SUBROUTINE mp_images_init () + !--------------------------------------------------------------------------- + ! + ! ... This routine divides all MPI processors into images + ! + IMPLICIT NONE + INTEGER :: ierr = 0 + ! +#if defined (__MPI) + ! + IF ( nimage < 1 .OR. nimage > nproc ) & + CALL errore( 'init_images', 'invalid number of images, out of range', 1 ) + IF ( MOD( nproc, nimage ) /= 0 ) & + CALL errore( 'init_images', 'n. of images must be divisor of nprocs', 1 ) + ! + ! ... set number of cpus per image + ! + nproc_image = nproc / nimage + ! + ! ... set index of image for this processor ( 0 : nimage - 1 ) + ! + my_image_id = mpime / nproc_image + ! + ! ... set index of processor within the image ( 0 : nproc_image - 1 ) + ! + me_image = MOD( mpime, nproc_image ) + ! + CALL mp_barrier(world_comm) + ! + ! ... the intra_image_comm communicator is created + ! + CALL MPI_COMM_SPLIT( world_comm, my_image_id, mpime, intra_image_comm, ierr ) + IF ( ierr /= 0 ) CALL errore & + ( 'init_images', 'intra image communicator initialization', ABS(ierr) ) + ! + CALL mp_barrier(world_comm) + ! + ! ... the inter_image_comm communicator is created + ! + CALL MPI_COMM_SPLIT( world_comm, me_image, mpime, inter_image_comm, ierr ) + IF ( ierr /= 0 ) CALL errore & + ( 'init_images', 'inter image communicator initialization', ABS(ierr) ) +#endif + RETURN + ! + END SUBROUTINE mp_images_init + ! +END MODULE mp_image_global_module diff --git a/tests/apps/miniDFT/tests/src/multable.f90 b/tests/apps/miniDFT/tests/src/multable.f90 new file mode 100644 index 0000000000..8562249ee5 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/multable.f90 @@ -0,0 +1,48 @@ +! +! Copyright (C) 2001-2010 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +!----------------------------------------------------------------------- +SUBROUTINE multable (nsym, s, table) + !----------------------------------------------------------------------- + ! + ! Checks that {S} is a group and calculates multiplication table + ! + IMPLICIT NONE + ! + INTEGER, INTENT(IN) :: nsym, s(3,3,nsym) + ! nsym = number of symmetry operations + ! s = rotation matrix (in crystal axis, represented by integers) + INTEGER, INTENT(OUT) :: table (48, 48) + ! multiplication table: S(n)*S(m) = S (table(n,m) ) + ! + INTEGER :: isym, jsym, ksym, ss (3, 3) + LOGICAL :: found, smn + ! + DO isym = 1, nsym + DO jsym = 1, nsym + ! + ss = MATMUL (s(:,:,jsym),s(:,:,isym)) + ! + ! here we check that the input matrices really form a group + ! and we set the multiplication table + ! + found = .false. + DO ksym = 1, nsym + smn = ALL ( s(:,:,ksym) == ss(:,:) ) + IF (smn) THEN + IF (found) CALL errore ('multable', 'Not a group', 1) + found = .true. + table (jsym, isym) = ksym + END IF + END DO + IF ( .NOT.found) CALL errore ('multable', ' Not a group', 2) + END DO + END DO + RETURN + ! +END SUBROUTINE multable diff --git a/tests/apps/miniDFT/tests/src/n_plane_waves.f90 b/tests/apps/miniDFT/tests/src/n_plane_waves.f90 new file mode 100644 index 0000000000..818abe4dcd --- /dev/null +++ b/tests/apps/miniDFT/tests/src/n_plane_waves.f90 @@ -0,0 +1,59 @@ +! +! Copyright (C) 2001 PWSCF group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +!----------------------------------------------------------------------- +subroutine n_plane_waves (ecutwfc, tpiba2, nks, xk, g, ngm, npwx, ngk) + !----------------------------------------------------------------------- + ! + ! Find number of plane waves for each k-point + ! + USE kinds, only: DP + USE mp, ONLY : mp_max + USE mp_global, ONLY : inter_pool_comm + implicit none + ! + integer, intent(in) :: nks, ngm + real(DP), intent(in) :: ecutwfc, tpiba2, xk (3, nks), g (3, ngm) + ! + integer, intent(out) :: npwx, ngk (nks) + ! + integer :: nk, ng + real(DP) :: q2 + ! + npwx = 0 + do nk = 1, nks + ngk (nk) = 0 + do ng = 1, ngm + q2 = (xk (1, nk) + g (1, ng) ) **2 + (xk (2, nk) + g (2, ng) ) ** & + 2 + (xk (3, nk) + g (3, ng) ) **2 + if (q2 <= ecutwfc / tpiba2) then + ! + ! here if |k+G|^2 <= Ecut increase the number of G inside the sphere + ! + ngk (nk) = ngk (nk) + 1 + else + if (sqrt (g (1, ng) **2 + g (2, ng) **2 + g (3, ng) **2) & + .gt.sqrt (xk (1, nk) **2 + xk (2, nk) **2 + xk (3, nk) **2) & + + sqrt (ecutwfc / tpiba2) ) goto 100 + ! + ! if |G| > |k| + sqrt(Ecut) stop search + ! + endif + enddo +100 npwx = max (npwx, ngk (nk) ) + enddo + if (npwx <= 0) call errore ('n_plane_waves', & + 'No plane waves found: running on too many processors?', 1) + ! + ! when using pools, set npwx to the maximum value across pools + ! (you may run into trouble at restart otherwise) + ! + CALL mp_max ( npwx, inter_pool_comm ) + ! + return +end subroutine n_plane_waves diff --git a/tests/apps/miniDFT/tests/src/newd.f90 b/tests/apps/miniDFT/tests/src/newd.f90 new file mode 100644 index 0000000000..bf5d0c74c2 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/newd.f90 @@ -0,0 +1,326 @@ +! +! Copyright (C) 2001-2010 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +MODULE dfunct + +CONTAINS +!--------------------------------------- +SUBROUTINE newq(vr,deeq,skip_vltot) + ! + ! This routine computes the integral of the perturbed potential with + ! the Q function + ! + USE kinds, ONLY : DP + USE ions_base, ONLY : nat, ntyp => nsp, ityp + USE cell_base, ONLY : omega + USE fft_base, ONLY : dfftp + USE fft_interfaces, ONLY : fwfft + USE gvect, ONLY : g, gg, ngm, gstart, mill, & + eigts1, eigts2, eigts3, nl + USE lsda_mod, ONLY : nspin + USE scf, ONLY : vltot + USE uspp_param, ONLY : upf, lmaxq, nh, nhm + USE wavefunctions_module, ONLY : psic + USE spin_orb, ONLY : lspinorb, domag + USE mp_global, ONLY : intra_bgrp_comm + USE mp, ONLY : mp_sum + ! + IMPLICIT NONE + ! + integer, parameter :: nspin_mag = 1 !substitute for noncollin_module%nspin_mag + + ! Input: potential , output: contribution to integral + REAL(kind=dp), intent(in) :: vr(dfftp%nnr,nspin) + REAL(kind=dp), intent(out) :: deeq( nhm, nhm, nat, nspin ) + LOGICAL, intent(in) :: skip_vltot !If .false. vltot is added to vr when necessary + ! INTERNAL + INTEGER :: ig, nt, ih, jh, na, is, nht, nb, mb + ! counters on g vectors, atom type, beta functions x 2, + ! atoms, spin, aux, aux, beta func x2 (again) +#ifdef __OPENMP + INTEGER :: mytid, ntids, omp_get_thread_num, omp_get_num_threads +#endif + COMPLEX(DP), ALLOCATABLE :: aux(:,:), qgm(:), qgm_na(:) + ! work space + COMPLEX(DP) :: dtmp + REAL(DP), ALLOCATABLE :: ylmk0(:,:), qmod(:) + ! spherical harmonics, modulus of G + REAL(DP) :: fact, ddot + + ! + fact = 1.D0 + ! + ! + CALL start_clock( 'newd' ) + ! + ALLOCATE( aux( ngm, nspin_mag ), & + qgm( ngm ), qmod( ngm ), ylmk0( ngm, lmaxq*lmaxq ) ) + ! + deeq(:,:,:,:) = 0.D0 + ! + CALL ylmr2( lmaxq * lmaxq, ngm, g, gg, ylmk0 ) + ! + qmod(1:ngm) = SQRT( gg(1:ngm) ) + ! + ! ... fourier transform of the total effective potential + ! + DO is = 1, nspin_mag + ! + IF ( (nspin_mag == 4 .AND. is /= 1) .or. skip_vltot ) THEN + ! + psic(:) = vr(:,is) + ! + ELSE + ! + psic(:) = vltot(:) + vr(:,is) + ! + END IF + ! + CALL fwfft ('Dense', psic, dfftp) + ! + aux(1:ngm,is) = psic( nl(1:ngm) ) + ! + END DO + ! + ! ... here we compute the integral Q*V for each atom, + ! ... I = sum_G exp(-iR.G) Q_nm v^* + ! + ! + CALL mp_sum( deeq( :, :, :, 1:nspin_mag ), intra_bgrp_comm ) + ! + DEALLOCATE( aux, qgm, qmod, ylmk0 ) + ! +END SUBROUTINE newq +!--------------------------------------- +SUBROUTINE newd() + USE uspp, ONLY : deeq + USE control_flags, ONLY : tqr + IMPLICIT NONE + if (tqr) then + write(*,*)"newd.f90:188 skipping newd_r: realus module requires iotk" + !call newd_r() + else + call newd_g() + end if + !!$ IF (.not.noncolin) call add_paw_to_deeq(deeq) + return +END SUBROUTINE newd +!---------------------------------------------------------------------------- +SUBROUTINE newd_g() + !---------------------------------------------------------------------------- + ! + ! ... This routine computes the integral of the effective potential with + ! ... the Q function and adds it to the bare ionic D term which is used + ! ... to compute the non-local term in the US scheme. + ! + USE kinds, ONLY : DP + USE ions_base, ONLY : nat, ntyp => nsp, ityp + USE lsda_mod, ONLY : nspin + USE uspp, ONLY : deeq, dvan, deeq_nc, dvan_so!!$, okvan, indv + USE uspp_param, ONLY : upf, lmaxq, nh, nhm + USE spin_orb, ONLY : lspinorb, domag + USE uspp, ONLY : nhtol, nhtolm + USE scf, ONLY : v + ! + IMPLICIT NONE + ! + INTEGER :: ig, nt, ih, jh, na, is, nht, nb, mb + ! counters on g vectors, atom type, beta functions x 2, + ! atoms, spin, aux, aux, beta func x2 (again) + ! + ! + ! + ! ... no ultrasoft potentials: use bare coefficients for projectors + ! + DO na = 1, nat + ! + nt = ityp(na) + nht = nh(nt) + ! + IF ( lspinorb ) THEN + ! + deeq_nc(1:nht,1:nht,na,1:nspin) = dvan_so(1:nht,1:nht,1:nspin,nt) + ! + ELSE + ! + DO is = 1, nspin + ! + deeq(1:nht,1:nht,na,is) = dvan(1:nht,1:nht,nt) + ! + END DO + ! + END IF + ! + END DO + ! + ! ... early return + ! + RETURN + ! + ! + call newq(v%of_r,deeq,.false.) + ! + atoms : & + DO na = 1, nat + ! + nt = ityp(na) + DO is = 1, nspin + ! + DO ih = 1, nh(nt) + DO jh = ih, nh(nt) + deeq(ih,jh,na,is) = deeq(ih,jh,na,is) + dvan(ih,jh,nt) + deeq(jh,ih,na,is) = deeq(ih,jh,na,is) + END DO + END DO + ! + END DO + ! + ! + END DO atoms + ! + CALL stop_clock( 'newd' ) + ! + RETURN + ! + CONTAINS + ! + !------------------------------------------------------------------------ + SUBROUTINE newd_so(na) + !------------------------------------------------------------------------ + ! + USE spin_orb, ONLY : fcoef + ! + IMPLICIT NONE + ! + INTEGER :: na + + INTEGER :: ijs, is1, is2, kh, lh + ! + ! + nt=ityp(na) + ijs = 0 + ! + DO is1 = 1, 2 + ! + DO is2 =1, 2 + ! + ijs = ijs + 1 + ! + IF (domag) THEN + DO ih = 1, nh(nt) + ! + DO jh = 1, nh(nt) + ! + deeq_nc(ih,jh,na,ijs) = dvan_so(ih,jh,ijs,nt) + ! + DO kh = 1, nh(nt) + ! + DO lh = 1, nh(nt) + ! + deeq_nc(ih,jh,na,ijs) = deeq_nc(ih,jh,na,ijs) + & + deeq (kh,lh,na,1)* & + (fcoef(ih,kh,is1,1,nt)*fcoef(lh,jh,1,is2,nt) + & + fcoef(ih,kh,is1,2,nt)*fcoef(lh,jh,2,is2,nt)) + & + deeq (kh,lh,na,2)* & + (fcoef(ih,kh,is1,1,nt)*fcoef(lh,jh,2,is2,nt) + & + fcoef(ih,kh,is1,2,nt)*fcoef(lh,jh,1,is2,nt)) + & + (0.D0,-1.D0)*deeq (kh,lh,na,3)* & + (fcoef(ih,kh,is1,1,nt)*fcoef(lh,jh,2,is2,nt) - & + fcoef(ih,kh,is1,2,nt)*fcoef(lh,jh,1,is2,nt)) + & + deeq (kh,lh,na,4)* & + (fcoef(ih,kh,is1,1,nt)*fcoef(lh,jh,1,is2,nt) - & + fcoef(ih,kh,is1,2,nt)*fcoef(lh,jh,2,is2,nt)) + ! + END DO + ! + END DO + ! + END DO + ! + END DO + ! + ELSE + ! + DO ih = 1, nh(nt) + ! + DO jh = 1, nh(nt) + ! + deeq_nc(ih,jh,na,ijs) = dvan_so(ih,jh,ijs,nt) + ! + DO kh = 1, nh(nt) + ! + DO lh = 1, nh(nt) + ! + deeq_nc(ih,jh,na,ijs) = deeq_nc(ih,jh,na,ijs) + & + deeq (kh,lh,na,1)* & + (fcoef(ih,kh,is1,1,nt)*fcoef(lh,jh,1,is2,nt) + & + fcoef(ih,kh,is1,2,nt)*fcoef(lh,jh,2,is2,nt) ) + ! + END DO + ! + END DO + ! + END DO + ! + END DO + ! + END IF + ! + END DO + ! + END DO + ! + RETURN + ! + END SUBROUTINE newd_so + ! + !------------------------------------------------------------------------ + SUBROUTINE newd_nc(na) + !------------------------------------------------------------------------ + ! + IMPLICIT NONE + ! + INTEGER :: na + ! + nt = ityp(na) + ! + DO ih = 1, nh(nt) + ! + DO jh = 1, nh(nt) + ! + IF (lspinorb) THEN + deeq_nc(ih,jh,na,1) = dvan_so(ih,jh,1,nt) + & + deeq(ih,jh,na,1) + deeq(ih,jh,na,4) + ! + deeq_nc(ih,jh,na,4) = dvan_so(ih,jh,4,nt) + & + deeq(ih,jh,na,1) - deeq(ih,jh,na,4) + ! + ELSE + deeq_nc(ih,jh,na,1) = dvan(ih,jh,nt) + & + deeq(ih,jh,na,1) + deeq(ih,jh,na,4) + ! + deeq_nc(ih,jh,na,4) = dvan(ih,jh,nt) + & + deeq(ih,jh,na,1) - deeq(ih,jh,na,4) + ! + END IF + deeq_nc(ih,jh,na,2) = deeq(ih,jh,na,2) - & + ( 0.D0, 1.D0 ) * deeq(ih,jh,na,3) + ! + deeq_nc(ih,jh,na,3) = deeq(ih,jh,na,2) + & + ( 0.D0, 1.D0 ) * deeq(ih,jh,na,3) + ! + END DO + ! + END DO + ! + RETURN + END SUBROUTINE newd_nc + ! +END SUBROUTINE newd_g + +END MODULE dfunct diff --git a/tests/apps/miniDFT/tests/src/openfil.f90 b/tests/apps/miniDFT/tests/src/openfil.f90 new file mode 100644 index 0000000000..1b1aa07f0f --- /dev/null +++ b/tests/apps/miniDFT/tests/src/openfil.f90 @@ -0,0 +1,125 @@ +! +! Copyright (C) 2001-2006 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +!---------------------------------------------------------------------------- +SUBROUTINE openfil() + !---------------------------------------------------------------------------- + ! + ! ... This routine opens some files needed to the self consistent run, + ! ... sets various file names, units, record lengths + ! ... All units are set in Modules/io_files.f90 + ! + USE kinds, ONLY : DP + USE io_global, ONLY : stdout + USE basis, ONLY : natomwfc, starting_wfc + USE wvfct, ONLY : nbnd, npwx + USE fixed_occ, ONLY : one_atom_occupations + USE klist, ONLY : nks + USE io_files, ONLY : prefix, iunpun, iunat, iunsat, iunwfc, iunigk, & + nwordwfc, nwordatwfc, iunefield, diropn, & + tmp_dir, wfc_dir, iunefieldm, iunefieldp, seqopn + USE buffers, ONLY : open_buffer, init_buffer + USE control_flags, ONLY : io_level, twfcollect + ! + IMPLICIT NONE + ! + integer, parameter :: npol=1 !substitute for noncollin_module%npol + LOGICAL :: exst + INTEGER :: ierr + CHARACTER(LEN=256) :: tmp_dir_save + ! + ! ... tmp_dir may be replaced by wfc_dir for large files + ! + tmp_dir_save = tmp_dir + ! + IF ( wfc_dir /= 'undefined' ) THEN + ! + WRITE( stdout, '(5X,"writing wfc files to a dedicated directory")' ) + ! + tmp_dir = wfc_dir + ! + END IF + ! + ! ... nwordwfc is the record length (IN COMPLEX WORDS) + ! ... for the direct-access file containing wavefunctions + ! + nwordwfc = nbnd*npwx*npol + ! + ! ... iunwfc=10: read/write wfc from/to file + ! ... iunwfc=-1: copy wfc to/from RAM + ! + IF ( io_level > 0 ) THEN + iunwfc = 10 + ELSE + iunwfc = -1 + END IF + ! +#ifdef __IGKIO + CALL open_buffer( iunwfc, 'wfc', nwordwfc, nks, exst ) +#endif + ! + IF ( TRIM(starting_wfc) == 'file' .AND. .NOT. exst) THEN + ! + ierr = 1 + IF ( twfcollect ) THEN + ! + ! ... wavefunctions are read from the "save" file and rewritten + ! ... (directly in pw_readfile) using the internal format + ! + write(*,*)"openfil.f90:75 skipping pw_readfile, requires iotk" + !CALL pw_readfile( 'wave', ierr ) + ! + !ELSE + ! + ! ... wavefunctions are read into memory + ! +#ifdef __IGKIO + CALL init_buffer ( iunwfc, exst, ierr ) +#endif + ! + END IF + + IF ( ierr > 0 ) THEN + ! + WRITE( stdout, '(5X,"Cannot read wfc : file not found")' ) + ! + starting_wfc = 'atomic' + ! + END IF + ! + END IF + ! + ! ... Needed for LDA+U + ! + ! ... iunat contains the (orthogonalized) atomic wfcs + ! ... iunsat contains the (orthogonalized) atomic wfcs * S + ! ... iunocc contains the atomic occupations computed in new_ns + ! ... it is opened and closed for each reading-writing operation + ! + nwordatwfc = 2*npwx*natomwfc*npol + ! + IF ( one_atom_occupations ) then + CALL diropn( iunat, 'atwfc', nwordatwfc, exst ) + CALL diropn( iunsat, 'satwfc', nwordatwfc, exst ) + END IF + ! + ! ... iunigk contains the number of PW and the indices igk + ! ... Note that unit 15 is reserved for error messages + ! +#ifdef __IGKIO + CALL seqopn( iunigk, 'igk', 'UNFORMATTED', exst ) +#endif + ! + ! ... open units for electric field calculations + ! + ! + tmp_dir = tmp_dir_save + ! + RETURN + ! +END SUBROUTINE openfil diff --git a/tests/apps/miniDFT/tests/src/opt_param.h b/tests/apps/miniDFT/tests/src/opt_param.h new file mode 100644 index 0000000000..05b1737a99 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/opt_param.h @@ -0,0 +1,13 @@ +! +! Copyright (C) 2002 FPMD group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! + +#if defined __AIX +# define __BSIZ_VALUE 55 +#else +# define __BSIZ_VALUE 35 +#endif diff --git a/tests/apps/miniDFT/tests/src/para.f90 b/tests/apps/miniDFT/tests/src/para.f90 new file mode 100644 index 0000000000..07793074f6 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/para.f90 @@ -0,0 +1,218 @@ +! +! Copyright (C) 2001-2006 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +! +! ... here are all parallel subroutines (wrappers to MPI calls) used +! ... by the PWscf code +! +!---------------------------------------------------------------------------- +SUBROUTINE poolscatter( nsize, nkstot, f_in, nks, f_out ) + !---------------------------------------------------------------------------- + ! + ! ... This routine scatters a quantity ( typically the eigenvalues ) + ! ... among the pools. + ! ... On input, f_in is required only on the first node of the first pool. + ! ... f_in and f_out may coincide. + ! ... Not a smart implementation! + ! + USE kinds, ONLY : DP + USE mp_global, ONLY : intra_pool_comm, inter_pool_comm, & + my_pool_id, npool, me_pool, root_pool, kunit + USE mp, ONLY : mp_bcast + ! + IMPLICIT NONE + ! + INTEGER :: nsize, nkstot, nks + ! first dimension of vectors f_in and f_out + ! number of k-points per pool + ! total number of k-points + REAL(DP) :: f_in(nsize,nkstot), f_out(nsize,nks) + ! input ( contains values for all k-point ) + ! output ( only for k-points of mypool ) + ! + ! + INTEGER :: rest, nbase + ! the rest of the integer division nkstot / npo + ! the position in the original list + ! + ! + ! ... copy from the first node of the first pool + ! ... to the first node of all the other pools + ! + IF ( me_pool == root_pool ) & + CALL mp_bcast( f_in, root_pool, inter_pool_comm ) + ! + ! ... distribute the vector on the first node of each pool + ! + rest = nkstot / kunit - ( nkstot / kunit / npool ) * npool + ! + nbase = nks * my_pool_id + ! + IF ( ( my_pool_id + 1 ) > rest ) nbase = nbase + rest * kunit + ! + f_out(:,1:nks) = f_in(:,(nbase+1):(nbase+nks)) + ! + ! ... copy from the first node of every pool + ! ... to the other nodes of every pool + ! + CALL mp_bcast( f_out, root_pool, intra_pool_comm ) + ! + ! + RETURN + ! +END SUBROUTINE poolscatter +! +! ... other parallel subroutines +! +!----------------------------------------------------------------------- +SUBROUTINE poolrecover( vec, length, nkstot, nks ) + !----------------------------------------------------------------------- + ! + ! ... recovers on the first processor of the first pool a + ! ... distributed vector + ! + USE kinds, ONLY : DP + USE mp_global, ONLY : inter_pool_comm, intra_image_comm, & + npool, me_pool, root_pool, my_pool_id, kunit + USE mp, ONLY : mp_barrier + USE parallel_include + ! + IMPLICIT NONE + ! + INTEGER :: length, nks, nkstot + REAL(DP) :: vec(length,nkstot) + ! + ! + INTEGER :: status(MPI_STATUS_SIZE) + INTEGER :: i, nks1, rest, fine, nbase, info + ! + ! + IF ( npool <= 1 ) RETURN + ! + IF ( MOD( nkstot, kunit ) /= 0 ) & + CALL errore( 'poolrecover', 'nkstot/kunit is not an integer', nkstot ) + ! + nks1 = kunit * ( nkstot / kunit / npool ) + ! + rest = ( nkstot - nks1 * npool ) / kunit + ! + CALL mp_barrier( intra_image_comm ) + ! + IF ( me_pool == root_pool .AND. my_pool_id > 0 ) THEN + ! + CALL MPI_SEND( vec, (length*nks), MPI_DOUBLE_PRECISION, 0, 17, & + inter_pool_comm, info ) + ! + CALL errore( 'poolrecover', 'info<>0 in send', info ) + ! + END IF + ! + DO i = 2, npool + ! + IF ( i <= rest ) THEN + ! + fine = nks1 + kunit + ! + nbase = ( nks1 + kunit ) * ( i - 1 ) + ! + ELSE + ! + fine = nks1 + ! + nbase = rest * (nks1 + kunit) + (i - 1 - rest) * nks1 + ! + END IF + ! + IF ( me_pool == root_pool .AND. my_pool_id == 0 ) THEN + ! + CALL MPI_RECV( vec(1,nbase+1), (length*fine), MPI_DOUBLE_PRECISION, & + (i-1), 17, inter_pool_comm, status, info ) + ! + CALL errore( 'poolrecover', 'info<>0 in recv', info ) + ! + END IF + ! + END DO + ! + ! + RETURN + ! +END SUBROUTINE poolrecover +! +!------------------------------------------------------------------------ +SUBROUTINE ipoolrecover( ivec, length, nkstot, nks ) + !------------------------------------------------------------------------ + ! + ! ... as above, for an integer vector + ! + USE mp_global, ONLY : inter_pool_comm, intra_image_comm, & + npool, me_pool, root_pool, my_pool_id, kunit + USE mp, ONLY : mp_barrier + USE parallel_include + ! + IMPLICIT NONE + ! + INTEGER :: length, nks, nkstot + INTEGER :: ivec(length,nkstot) + ! + ! + INTEGER :: status(MPI_STATUS_SIZE) + INTEGER :: i, nks1, rest, fine, nbase, info + ! + ! + IF ( npool <= 1 ) RETURN + ! + IF ( MOD( nkstot, kunit ) /= 0 ) & + CALL errore( 'poolrecover', 'nkstot/kunit is not an integer', nkstot ) + ! + nks1 = kunit * ( nkstot / kunit / npool ) + ! + rest = ( nkstot - nks1 * npool ) / kunit + ! + CALL mp_barrier( intra_image_comm ) + ! + IF ( me_pool == root_pool .AND. my_pool_id > 0 ) THEN + ! + CALL MPI_SEND( ivec, (length*nks), MPI_INTEGER, 0, 17, & + inter_pool_comm, info ) + ! + CALL errore( 'ipoolrecover', 'info<>0 in send', info ) + ! + END IF + ! + DO i = 2, npool + ! + IF ( i <= rest ) THEN + ! + fine = nks1 + kunit + ! + nbase = ( nks1 + kunit ) * ( i - 1 ) + ! + ELSE + ! + fine = nks1 + ! + nbase = rest * ( nks1 + kunit ) + ( i - 1 - rest ) * nks1 + ! + END IF + ! + IF ( me_pool == root_pool .AND. my_pool_id == 0 ) THEN + ! + CALL MPI_RECV( ivec(1,nbase+1), (length*fine), MPI_INTEGER, & + (i-1), 17, inter_pool_comm, status, info ) + ! + CALL errore( 'ipoolrecover', 'info<>0 in recv', info ) + ! + END IF + ! + END DO + ! + ! + RETURN + ! +END SUBROUTINE ipoolrecover diff --git a/tests/apps/miniDFT/tests/src/parallel_include.f90 b/tests/apps/miniDFT/tests/src/parallel_include.f90 new file mode 100644 index 0000000000..ba9c7afbde --- /dev/null +++ b/tests/apps/miniDFT/tests/src/parallel_include.f90 @@ -0,0 +1,21 @@ +! +! Copyright (C) 2003-2004 Carlo Cavazzoni +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +!------------------------------------------------------------------------------! +! SISSA Code Interface -- Carlo Cavazzoni +!------------------------------------------------------------------------------C + MODULE parallel_include + +! +! Include file for MPI +! + INCLUDE 'mpif.h' + ! + ! this is only for symmetry with respect to the serial build + LOGICAL :: tparallel = .true. + + END MODULE parallel_include diff --git a/tests/apps/miniDFT/tests/src/parameters.f90 b/tests/apps/miniDFT/tests/src/parameters.f90 new file mode 100644 index 0000000000..725bbe33d8 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/parameters.f90 @@ -0,0 +1,22 @@ +! +! Copyright (C) 2001-2009 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +MODULE parameters + + IMPLICIT NONE + SAVE + + INTEGER, PARAMETER :: & + ntypx = 10, &! max number of different types of atom + npsx = ntypx, &! max number of different PPs (obsolete) + nsx = ntypx, &! max number of atomic species (CP) + npk = 40000, &! max number of k-points + lmaxx = 3, &! max non local angular momentum (l=0 to lmaxx) + lqmax= 2*lmaxx+1 ! max number of angular momenta of Q + +END MODULE parameters diff --git a/tests/apps/miniDFT/tests/src/parser.f90 b/tests/apps/miniDFT/tests/src/parser.f90 new file mode 100644 index 0000000000..c58f8fdf81 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/parser.f90 @@ -0,0 +1,417 @@ +! +! Copyright (C) 2001-2004 Carlo Cavazzoni and PWSCF group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +! ... SUBROUTINE field_count: accepts two string (one of them is optional) +! and one integer and count the number of fields +! in the string separated by a blank or a tab +! character. If the optional string is specified +! (it has anyway len=1) it is assumed as the +! separator character. +! Ignores any character following the exclamation +! mark (fortran comment) +! +! ... SUBROUTINE con_cam: counts the number of fields in a string +! separated by the optional character +! +! ... SUBROUTINE field_compare: accepts two strings and one integer. Counts the +! fields contained in the first string and +! compares it with the integer. +! If they are less than the integer calls the +! routine error and show by the second string the +! name of the field where read-error occurred. +! +! ... SUBROUTINE version_parse: Determine the major, minor and patch numbers from +! a version string with the fmt "i.j.k" +! +! ... FUNCTION version_compare: Compare two version strings; the result can be +! "newer", "equal", "older", "" +! +! +!---------------------------------------------------------------------------- +MODULE parser + !---------------------------------------------------------------------------- + ! + USE io_global, ONLY : stdout + USE kinds, ONLY : DP + ! + PRIVATE + ! + PUBLIC :: parse_unit, field_count, read_line, get_field + PUBLIC :: version_parse, version_compare + ! + INTEGER :: parse_unit = 5 ! normally 5, but can be set otherwise + ! + CONTAINS + ! + ! + !-------------------------------------------------------------------------- + PURE SUBROUTINE field_count( num, line, car ) + !-------------------------------------------------------------------------- + ! + IMPLICIT NONE + ! + INTEGER, INTENT(OUT) :: num + CHARACTER(LEN=*), INTENT(IN) :: line + CHARACTER(LEN=1), OPTIONAL, INTENT(IN) :: car +#if defined (__XLF) + ! ... with the IBM xlf compiler some combination of flags lead to + ! ... variables being defined as static, hence giving a conflict + ! ... with PURE function. We then force the variable to be AUTOMATIC + CHARACTER(LEN=1), AUTOMATIC :: sep1, sep2 + INTEGER, AUTOMATIC :: j +#else + CHARACTER(LEN=1) :: sep1, sep2 + INTEGER :: j +#endif + ! + ! + num = 0 + ! + IF ( .NOT. present(car) ) THEN + ! + sep1 = char(32) ! ... blank character + sep2 = char(9) ! ... tab character + ! + DO j = 2, MAX( LEN( line ), 256 ) + ! + IF ( line(j:j) == '!' .OR. line(j:j) == char(0) ) THEN + ! + IF ( line(j-1:j-1) /= sep1 .AND. line(j-1:j-1) /= sep2 ) THEN + ! + num = num + 1 + ! + END IF + ! + EXIT + ! + END IF + ! + IF ( ( line(j:j) == sep1 .OR. line(j:j) == sep2 ) .AND. & + ( line(j-1:j-1) /= sep1 .AND. line(j-1:j-1) /= sep2 ) ) THEN + ! + num = num + 1 + ! + END IF + ! + END DO + ! + ELSE + ! + sep1 = car + ! + DO j = 2, MAX( LEN( line ), 256 ) + ! + IF ( line(j:j) == '!' .OR. & + line(j:j) == char(0) .OR. line(j:j) == char(32) ) THEN + ! + IF ( line(j-1:j-1) /= sep1 ) num = num + 1 + ! + EXIT + ! + END IF + ! + IF ( line(j:j) == sep1 .AND. line(j-1:j-1) /= sep1 ) num = num + 1 + ! + END DO + ! + END IF + ! + RETURN + ! + END SUBROUTINE field_count + ! + ! + !-------------------------------------------------------------------------- + SUBROUTINE read_line( line, nfield, field, end_of_file, error ) + !-------------------------------------------------------------------------- + ! + USE mp, ONLY : mp_bcast + USE mp_global, ONLY : world_comm + USE io_global, ONLY : ionode, ionode_id + ! + IMPLICIT NONE + ! + CHARACTER(LEN=*), INTENT(OUT) :: line + CHARACTER(LEN=*), OPTIONAL, INTENT(IN) :: field + INTEGER, OPTIONAL, INTENT(IN) :: nfield + LOGICAL, OPTIONAL, INTENT(OUT) :: end_of_file, error + LOGICAL :: tend, terr + ! + ! + IF( LEN( line ) < 256 ) THEN + CALL errore(' read_line ', ' input line too short ', MAX(LEN(line),1) ) + END IF + ! + tend = .FALSE. + terr = .FALSE. + IF ( ionode ) THEN +30 READ (parse_unit, fmt='(A256)', ERR=15, END=10) line + IF( line == ' ' .OR. line(1:1) == '#' ) GO TO 30 + GO TO 20 +10 tend = .TRUE. + GO TO 20 +15 terr = .TRUE. +20 CONTINUE + END IF + ! + CALL mp_bcast( tend, ionode_id, world_comm ) + CALL mp_bcast( terr, ionode_id, world_comm ) + CALL mp_bcast( line, ionode_id, world_comm ) + ! + IF( PRESENT(end_of_file) ) THEN + end_of_file = tend + ELSE IF( tend ) THEN + CALL infomsg(' read_line ', ' end of file ' ) + END IF + IF( PRESENT(error) ) THEN + error = terr + ELSE IF( terr ) THEN + CALL infomsg(' read_line ', ' read error ' ) + END IF + IF( PRESENT(field) .and. .not.(tend.or.terr) ) & + &CALL field_compare( line, nfield, field ) + ! + END SUBROUTINE read_line + ! + ! + !-------------------------------------------------------------------------- + SUBROUTINE field_compare( str, nf, var ) + !-------------------------------------------------------------------------- + ! + IMPLICIT NONE + ! + CHARACTER(LEN=*), INTENT(IN) :: var + INTEGER, INTENT(IN) :: nf + CHARACTER(LEN=*), INTENT(IN) :: str + INTEGER :: nc + ! + CALL field_count( nc, str ) + ! + IF( nc < nf ) & + CALL errore( ' field_compare ', & + & ' wrong number of fields: ' // TRIM( var ), 1 ) + ! + RETURN + ! + END SUBROUTINE field_compare + ! + ! + !-------------------------------------------------------------------------- + SUBROUTINE con_cam(num, line, car) + !-------------------------------------------------------------------------- + CHARACTER(LEN=*) :: line + CHARACTER(LEN=1) :: sep + CHARACTER(LEN=1), OPTIONAL :: car + INTEGER :: num, j + + num = 0 + IF (len(line) .GT. 256 ) THEN + WRITE( stdout,*) 'riga ', line + WRITE( stdout,*) 'lunga ', len(line) + num = -1 + RETURN + END IF + + WRITE( stdout,*) '1riga ', line + WRITE( stdout,*) '1lunga ', len(line) + IF ( .NOT. present(car) ) THEN + sep=char(32) !char(32) is the blank character + ELSE + sep=car + END IF + + DO j=2, MAX(len(line),256) + IF ( line(j:j) == '!' .OR. line(j:j) == char(0)) THEN + RETURN + END IF + IF ( (line(j:j) .EQ. sep) .AND. & + (line(j-1:j-1) .NE. sep) ) THEN + num = num + 1 + END IF + END DO + RETURN + END SUBROUTINE con_cam + ! + !-------------------------------------------------------------------------- + SUBROUTINE version_parse(str, major, minor, patch, ierr) + !-------------------------------------------------------------------------- + ! + ! Determine the major, minor and patch numbers from + ! a version string with the fmt "i.j.k" + ! + ! The ierr variable assumes the following values + ! + ! ierr < 0 emtpy string + ! ierr = 0 no problem + ! ierr > 0 fatal error + ! + IMPLICIT NONE + CHARACTER(*), INTENT(in) :: str + INTEGER, INTENT(out) :: major, minor, patch, ierr + ! + INTEGER :: i1, i2, length + INTEGER :: ierrtot + CHARACTER(10) :: num(3) + + ! + major = 0 + minor = 0 + patch = 0 + + length = LEN_TRIM( str ) + ! + IF ( length == 0 ) THEN + ! + ierr = -1 + RETURN + ! + ENDIF + + i1 = SCAN( str, ".") + i2 = SCAN( str, ".", BACK=.TRUE.) + ! + IF ( i1 == 0 .OR. i2 == 0 .OR. i1 == i2 ) THEN + ! + ierr = 1 + RETURN + ! + ENDIF + ! + num(1) = str( 1 : i1-1 ) + num(2) = str( i1+1 : i2-1 ) + num(3) = str( i2+1 : ) + ! + ierrtot = 0 + ! + READ( num(1), *, IOSTAT=ierr ) major + IF (ierr/=0) RETURN + ! + READ( num(2), *, IOSTAT=ierr ) minor + IF (ierr/=0) RETURN + ! + READ( num(3), *, IOSTAT=ierr ) patch + IF (ierr/=0) RETURN + ! + END SUBROUTINE version_parse + ! + !-------------------------------------------------------------------------- + FUNCTION version_compare(str1, str2) + !-------------------------------------------------------------------------- + ! + ! Compare two version strings; the result is + ! + ! "newer": str1 is newer that str2 + ! "equal": str1 is equal to str2 + ! "older": str1 is older than str2 + ! " ": str1 or str2 has a wrong format + ! + IMPLICIT NONE + CHARACTER(*) :: str1, str2 + CHARACTER(10) :: version_compare + ! + INTEGER :: version1(3), version2(3) + INTEGER :: basis, icheck1, icheck2 + INTEGER :: ierr + ! + + version_compare = " " + ! + CALL version_parse( str1, version1(1), version1(2), version1(3), ierr) + IF ( ierr/=0 ) RETURN + ! + CALL version_parse( str2, version2(1), version2(2), version2(3), ierr) + IF ( ierr/=0 ) RETURN + ! + ! + basis = 1000 + ! + icheck1 = version1(1) * basis**2 + version1(2)* basis + version1(3) + icheck2 = version2(1) * basis**2 + version2(2)* basis + version2(3) + ! + IF ( icheck1 > icheck2 ) THEN + ! + version_compare = 'newer' + ! + ELSEIF( icheck1 == icheck2 ) THEN + ! + version_compare = 'equal' + ! + ELSE + ! + version_compare = 'older' + ! + ENDIF + ! + END FUNCTION version_compare + ! + !-------------------------------------------------------------------------- + SUBROUTINE get_field(n, field, str, sep) + !-------------------------------------------------------------------------- + ! Extract whitespace-separated nth block from string + IMPLICIT NONE + INTEGER,INTENT(IN) :: n + CHARACTER(len=*),INTENT(OUT) :: field + CHARACTER(len=*),INTENT(IN) :: str + CHARACTER(len=1),OPTIONAL,INTENT(IN) :: sep + INTEGER :: i,j,z ! block start and end + INTEGER :: k ! block counter + CHARACTER(len=1) :: sep1, sep2 + !print*, "------------- parser start -------------" + !print '(3a)', "string: -->", str,"<--" + IF(present(sep)) THEN + sep1 = sep + sep2 = sep ! redundant, but easy + ELSE + sep1 = char(32) ! ... blank character + sep2 = char(9) ! ... tab char + ENDIF + ! + k = 1 ! counter for the required block + ! + DO i = 1,len(str) + ! look for the beginning of the required block + z = MAX(i-1,1) + !print '(2a1,3i4,2l)', str(i:i), str(z:z), i,z,k,n,& + ! (str(i:i) == sep1 .or. str(i:i) == sep2), (str(z:z) /= sep1 .and. str(z:z) /= sep2) + IF( k == n) EXIT + IF( (str(i:i) == sep1 .or. str(i:i) == sep2) & + .and. & + (str(z:z) /= sep1 .and. str(z:z) /= sep2) & + ) & + k = k+1 + ENDDO + ! + !print*, "i found: ",i + DO j = i,len(str) + ! look for the beginning of the next block + z = MAX(j-1,1) + IF( (str(j:j) == sep1 .or. str(j:j) == sep2) & + .and. & + (str(z:z) /= sep1 .and. str(z:z) /= sep2) & + ) & + k = k+1 + IF( k >n) EXIT + ENDDO + !print*, "j found: ",j + ! + IF (j <= len(str)) THEN + ! if we are here, the reqired block was followed by a separator + ! and another field, we have to trash one char (a separator) + field = TRIM(adjustl(str(i:j-1))) + !print*, "taking: ",i,j-2 + ELSE + ! if we are here, it was the last block in str, we have to take + ! all the remaining chars + field = TRIM(adjustl(str(i:len(str)))) + !print*, "taking from ",i + ENDIF + !print*, "------------- parser end -------------" + + END SUBROUTINE get_field + +END MODULE parser diff --git a/tests/apps/miniDFT/tests/src/potinit.f90 b/tests/apps/miniDFT/tests/src/potinit.f90 new file mode 100644 index 0000000000..43ea8b28ee --- /dev/null +++ b/tests/apps/miniDFT/tests/src/potinit.f90 @@ -0,0 +1,201 @@ +! +! Copyright (C) 2001-2007 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +!---------------------------------------------------------------------------- +SUBROUTINE potinit() + !---------------------------------------------------------------------------- + ! + ! ... This routine initializes the self consistent potential in the array + ! ... vr. There are three possible cases: + ! + ! ... a) the code is restarting from a broken run: + ! ... read rho from data stored during the previous run + ! ... b) the code is performing a non-scf calculation following a scf one: + ! ... read rho from the file produced by the scf calculation + ! ... c) the code starts a new calculation: + ! ... calculate rho as a sum of atomic charges + ! + ! ... In all cases the scf potential is recalculated and saved in vr + ! + USE kinds, ONLY : DP + USE constants, ONLY : pi + USE io_global, ONLY : stdout + USE cell_base, ONLY : alat, omega + USE ions_base, ONLY : nat, ityp, ntyp => nsp + USE basis, ONLY : starting_pot + USE klist, ONLY : nelec + USE lsda_mod, ONLY : lsda, nspin + USE fft_base, ONLY : dfftp + USE fft_interfaces, ONLY : fwfft + USE gvect, ONLY : ngm, gstart, nl, g, gg + USE gvecs, ONLY : doublegrid + USE control_flags, ONLY : lscf + USE scf, ONLY : rho, rho_core, rhog_core, & + vltot, v, vrs, kedtau + USE wavefunctions_module, ONLY : psic + USE ener, ONLY : ehart, etxc, vtxc + USE io_files, ONLY : tmp_dir, prefix, iunocc, input_drho + USE spin_orb, ONLY : domag + USE mp, ONLY : mp_bcast, mp_sum + USE mp_global, ONLY : intra_image_comm, inter_bgrp_comm, intra_bgrp_comm, mpime + USE io_global, ONLY : ionode, ionode_id + ! + USE uspp, ONLY : becsum + ! + IMPLICIT NONE + ! + real(dp) :: v_kin_r !dummy variable; substitute for scf_mod%v%kin_r + real(dp) :: eth !dummy variable; substitute for ldaU%eth + REAL(DP) :: charge ! the starting charge + REAL(DP) :: etotefield ! + REAL(DP) :: fact + INTEGER :: is, ios + LOGICAL :: exst + CHARACTER(LEN=256) :: filename + ! + CALL start_clock('potinit') + ! + ! check for both .dat and .xml extensions (compatibility reasons) + ! + filename = TRIM( tmp_dir ) // TRIM( prefix ) // '.save/charge-density.dat' + !exst = check_file_exst( TRIM(filename) ) + exst = .false. + ! + IF ( .NOT. exst ) THEN + ! + filename = TRIM( tmp_dir ) // TRIM( prefix ) // '.save/charge-density.xml' + !exst = check_file_exst( TRIM(filename) ) + exst = .false. + ! + ENDIF + ! + ! + IF ( starting_pot == 'file' .AND. exst ) THEN + ! + ! ... Cases a) and b): the charge density is read from file + ! ... this also reads rho%ns if lda+U and rho%bec if PAW + ! + write(*,*) "potinit.f90:89 skipping pw_readfile, reqires iotk (indirectly)" + !CALL pw_readfile( 'rho', ios ) + ! + IF ( ios /= 0 ) THEN + ! + WRITE( stdout, '(/5X,"Error reading from file :"/5X,A,/)' ) & + TRIM( filename ) + ! + CALL errore ( 'potinit' , 'reading starting density', ios) + ! + ELSE IF ( lscf ) THEN + ! + WRITE( stdout, '(/5X, & + & "The initial density is read from file :"/5X,A,/)' ) & + TRIM( filename ) + ! + ELSE + ! + WRITE( stdout, '(/5X, & + & "The potential is recalculated from file :"/5X,A,/)' ) & + TRIM( filename ) + ! + END IF + ! + ELSE + ! + ! ... Case c): the potential is built from a superposition + ! ... of atomic charges contained in the array rho_at + ! + IF ( starting_pot == 'file' .AND. .NOT. exst ) & + WRITE( stdout, '(5X,"Cannot read rho : file not found")' ) + ! + WRITE( UNIT = stdout, & + FMT = '(/5X,"Initial potential from superposition of free atoms")' ) + ! + CALL atomic_rho( rho%of_r, nspin ) + + + ! ... in the paw case uses atomic becsum + ! + IF ( input_drho /= ' ' ) THEN + ! + IF ( nspin > 1 ) CALL errore & + ( 'potinit', 'spin polarization not allowed in drho', 1 ) + ! + write(*,*) "potinit.f90:143 skipping read_rho, requires iotk" + !CALL read_rho ( v%of_r, 1, input_drho ) + ! + WRITE( UNIT = stdout, & + FMT = '(/5X,"a scf correction to at. rho is read from",A)' ) & + TRIM( input_drho ) + ! + rho%of_r = rho%of_r + v%of_r + ! + END IF + ! + END IF + ! + ! ... check the integral of the starting charge + ! + IF ( nspin == 2 ) THEN + ! + charge = SUM ( rho%of_r(:,1:nspin) )*omega / ( dfftp%nr1*dfftp%nr2*dfftp%nr3 ) + ! + ELSE + ! + charge = SUM ( rho%of_r(:,1) )*omega / ( dfftp%nr1*dfftp%nr2*dfftp%nr3 ) + ! + END IF + ! + CALL mp_sum( charge , intra_bgrp_comm ) + ! + IF ( lscf .AND. ABS( charge - nelec ) > ( 1.D-7 * charge ) ) THEN + ! + IF ( charge > 1.D-8 .AND. nat > 0 ) THEN + WRITE( stdout, '(/,5X,"starting charge ",F10.5, & + & ", renormalised to ",F10.5)') charge, nelec + rho%of_r = rho%of_r / charge * nelec + ELSE + WRITE( stdout, '(/,5X,"Starting from uniform charge")') + rho%of_r = nelec / omega + ENDIF + ! + ELSE IF ( .NOT. lscf .AND. ABS( charge - nelec ) > (1.D-3 * charge ) ) THEN + ! + CALL errore( 'potinit', 'starting and expected charges differ', 1 ) + ! + END IF + ! + ! ... bring starting rho to G-space + ! + DO is = 1, nspin + ! + psic(:) = rho%of_r(:,is) + ! + CALL fwfft ('Dense', psic, dfftp) + ! + rho%of_g(:,is) = psic(nl(:)) + ! + END DO + ! + ! + ! ... compute the potential and store it in v + ! + CALL v_of_rho( rho, rho_core, rhog_core, & + ehart, etxc, vtxc, eth, etotefield, charge, v ) + ! + ! ... define the total local potential (external+scf) + ! + CALL set_vrs( vrs, vltot, v%of_r, kedtau, v_kin_r, dfftp%nnr, nspin, doublegrid ) + ! + ! ... write on output the parameters used in the lda+U calculation + ! + ! + CALL stop_clock('potinit') + ! + RETURN + ! +END SUBROUTINE potinit diff --git a/tests/apps/miniDFT/tests/src/print_clock_pw.f90 b/tests/apps/miniDFT/tests/src/print_clock_pw.f90 new file mode 100644 index 0000000000..49bba7ecf2 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/print_clock_pw.f90 @@ -0,0 +1,142 @@ +! +! Copyright (C) 2001-2006 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +!---------------------------------------------------------------------------- +SUBROUTINE print_clock_pw() + !--------------------------------------------------------------------------- + ! + ! ... this routine prints out the clocks at the end of the run + ! ... it tries to construct the calling tree of the program. + ! + USE io_global, ONLY : stdout + USE control_flags, ONLY : isolve, iverbosity + ! + IMPLICIT NONE + ! + ! + WRITE( stdout, * ) + ! + CALL print_clock( 'init_run' ) + CALL print_clock( 'electrons' ) + CALL print_clock( 'update_pot' ) + CALL print_clock( 'forces' ) + CALL print_clock( 'stress' ) + ! + WRITE( stdout, '(/5x,"Called by init_run:")' ) + CALL print_clock( 'wfcinit' ) + CALL print_clock( 'potinit' ) + CALL print_clock( 'realus' ) + IF ( iverbosity > 0 ) THEN + CALL print_clock( 'realus:boxes' ) + CALL print_clock( 'realus:spher' ) + CALL print_clock( 'realus:qsave' ) + END IF + ! + WRITE( stdout, '(/5x,"Called by electrons:")' ) + CALL print_clock( 'c_bands' ) + CALL print_clock( 'sum_band' ) + CALL print_clock( 'v_of_rho' ) + IF ( iverbosity > 0 ) THEN + CALL print_clock( 'v_h' ) + CALL print_clock( 'v_xc' ) + CALL print_clock( 'v_xc_meta' ) + END IF + CALL print_clock( 'newd' ) + IF ( iverbosity > 0 ) THEN + CALL print_clock( 'newd:fftvg' ) + CALL print_clock( 'newd:qvan2' ) + CALL print_clock( 'newd:int1' ) + CALL print_clock( 'newd:int2' ) + END IF + CALL print_clock( 'mix_rho' ) + + CALL print_clock( 'vdW_energy' ) + CALL print_clock( 'vdW_ffts' ) + CALL print_clock( 'vdW_v' ) + + ! + WRITE( stdout, '(/5x,"Called by c_bands:")' ) + CALL print_clock( 'init_us_2' ) + IF ( isolve == 0 ) THEN +!!$ IF ( gamma_only ) THEN + CALL print_clock( 'cegterg' ) +!!$ ENDIF + ELSE + CALL print_clock( 'ccgdiagg' ) + CALL print_clock( 'wfcrot' ) + ENDIF + ! + IF ( iverbosity > 0) THEN + WRITE( stdout, '(/5x,"Called by sum_band:")' ) + CALL print_clock( 'sum_band:becsum' ) + CALL print_clock( 'addusdens' ) + CALL print_clock( 'addus:qvan2' ) + CALL print_clock( 'addus:strf' ) + CALL print_clock( 'addus:aux2' ) + CALL print_clock( 'addus:aux' ) + ENDIF + ! + IF ( isolve == 0 ) THEN + WRITE( stdout, '(/5x,"Called by *egterg:")' ) + ELSE + WRITE( stdout, '(/5x,"Called by *cgdiagg:")' ) + END IF + ! + CALL print_clock( 'h_psi' ) + CALL print_clock( 's_psi' ) + CALL print_clock( 'g_psi' ) + CALL print_clock( 'cdiaghg' ) + IF ( iverbosity > 0 ) THEN + CALL print_clock( 'cegterg:overlap' ) + CALL print_clock( 'cegterg:update' ) + CALL print_clock( 'cegterg:last' ) + CALL print_clock( 'cdiaghg:choldc' ) + CALL print_clock( 'cdiaghg:inversion' ) + CALL print_clock( 'cdiaghg:paragemm' ) + END IF + ! + WRITE( stdout, '(/5x,"Called by h_psi:")' ) + IF ( iverbosity > 0 ) THEN + CALL print_clock( 'h_psi:init' ) + CALL print_clock( 'h_psi:vloc' ) + CALL print_clock( 'h_psi:vnl' ) + END IF + CALL print_clock( 'add_vuspsi' ) + CALL print_clock( 'h_psi_meta' ) + ! + WRITE( stdout, '(/5X,"General routines")' ) + ! + CALL print_clock( 'calbec' ) + CALL print_clock( 'fft' ) + CALL print_clock( 'ffts' ) + CALL print_clock( 'fftw' ) + CALL print_clock( 'interpolate' ) + CALL print_clock( 'davcio' ) + ! + WRITE( stdout, * ) + ! + WRITE( stdout, '(5X,"Parallel routines")' ) + ! + CALL print_clock( 'reduce' ) + CALL print_clock( 'fft_scatter' ) + CALL print_clock( 'ALLTOALL' ) + ! + WRITE( stdout, '(5X,"EXX routines")' ) + ! + CALL print_clock( 'exx_grid' ) + CALL print_clock( 'exxinit' ) + CALL print_clock( 'vexx' ) + !CALL print_clock( 'vexx_ngmloop' ) + CALL print_clock( 'exxenergy' ) + CALL print_clock( 'exxen2' ) + !CALL print_clock( 'exxen2_ngmloop' ) + CALL print_clock ('cycleig') + ! + ! + RETURN + ! +END SUBROUTINE print_clock_pw diff --git a/tests/apps/miniDFT/tests/src/print_ks_energies.f90 b/tests/apps/miniDFT/tests/src/print_ks_energies.f90 new file mode 100644 index 0000000000..2306b5a650 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/print_ks_energies.f90 @@ -0,0 +1,168 @@ +! +! Copyright (C) 2007 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +!---------------------------------------------------------------------------- +SUBROUTINE print_ks_energies() + !---------------------------------------------------------------------------- + ! + ! ... printout of Kohn-Sham eigenvalues + ! + USE kinds, ONLY : DP + USE constants, ONLY : rytoev + USE io_global, ONLY : stdout, ionode + USE ener, ONLY : ef, ef_up, ef_dw + USE klist, ONLY : xk, nelec, ngk, nks, nkstot, & + lgauss, two_fermi_energies, nelup, neldw + USE lsda_mod, ONLY : lsda, nspin, isk + USE ktetra, ONLY : ltetra + USE wvfct, ONLY : nbnd, et, wg + USE fixed_occ, ONLY : f_inp, tfixed_occ, one_atom_occupations + USE control_flags, ONLY : conv_elec, lbands, iverbosity + USE mp_global, ONLY : root_pool, intra_pool_comm, inter_pool_comm + USE mp_global, ONLY : root_bgrp, intra_bgrp_comm, inter_bgrp_comm + USE mp, ONLY : mp_sum, mp_bcast + ! + IMPLICIT NONE + ! + ! ... a few local variables + ! + INTEGER, ALLOCATABLE :: & + ngk_g(:) ! number of plane waves summed on all nodes + REAL(DP) :: & + ehomo, elumo ! highest occupied and lowest unoccupied levels + INTEGER :: & + i, &! counter on polarization + ik, &! counter on k points + kbnd, &! counter on bands + ibnd_up, &! counter on bands + ibnd_dw, &! counter on bands + ibnd + ! + ! + ALLOCATE ( ngk_g (nkstot) ) + ! + ngk_g(1:nks) = ngk(:) + ! + CALL mp_sum( ngk_g(1:nks), intra_bgrp_comm ) + ! + CALL ipoolrecover( ngk_g, 1, nkstot, nks ) + ! + CALL mp_bcast( ngk_g, root_bgrp, intra_bgrp_comm ) + CALL mp_bcast( ngk_g, root_bgrp, inter_bgrp_comm ) + ! + DO ik = 1, nkstot + ! + IF ( lsda ) THEN + ! + IF ( ik == 1 ) WRITE( stdout, 9015) + IF ( ik == ( 1 + nkstot / 2 ) ) WRITE( stdout, 9016) + ! + END IF + ! + IF ( conv_elec ) THEN + WRITE( stdout, 9021 ) ( xk(i,ik), i = 1, 3 ), ngk_g(ik) + ELSE + WRITE( stdout, 9020 ) ( xk(i,ik), i = 1, 3 ) + END IF + ! + WRITE( stdout, 9030 ) ( et(ibnd,ik) * rytoev, ibnd = 1, nbnd ) + ! + IF( iverbosity > 0 ) THEN + ! + WRITE( stdout, 9032 ) + WRITE( stdout, 9030 ) ( wg(ibnd,ik), ibnd = 1, nbnd ) + ! + END IF + ! + END DO + ! + DEALLOCATE ( ngk_g ) + ! + IF ( .NOT. lbands ) THEN + ! + IF ( lgauss .OR. ltetra ) THEN + ! + IF ( two_fermi_energies ) THEN + WRITE( stdout, 9041 ) ef_up*rytoev, ef_dw*rytoev + ELSE + WRITE( stdout, 9040 ) ef*rytoev + END IF + ! + ELSE + ! + IF ( tfixed_occ ) THEN + ibnd = 0 + ibnd_up = 0 + ibnd_dw = 0 + DO kbnd = 1, nbnd + IF ( nspin == 1 .OR. nspin == 4 ) THEN + IF ( f_inp(kbnd,1) > 0.D0 ) ibnd = kbnd + ELSE + IF ( f_inp(kbnd,1) > 0.D0 ) ibnd_up = kbnd + IF ( f_inp(kbnd,2) > 0.D0 ) ibnd_dw = kbnd + ibnd = MAX(ibnd_up, ibnd_dw) + END IF + END DO + ELSE + IF ( nspin == 1 ) THEN + ibnd = NINT( nelec ) / 2 + ELSE + ibnd = NINT( nelec ) + ibnd_up = NINT( nelup ) + ibnd_dw = NINT( neldw ) + END IF + END IF + ! + IF ( ionode .AND. nbnd > ibnd .AND. .NOT. one_atom_occupations ) THEN + ! + IF ( nspin == 1 .OR. nspin == 4 ) THEN + ehomo = MAXVAL( et(ibnd, 1:nkstot) ) + elumo = MINVAL( et(ibnd+1,1:nkstot) ) + ELSE + elumo = MIN( MINVAL( et(ibnd_up+1,1:nkstot/2) ), & + MINVAL( et(ibnd_dw+1,nkstot/2+1:nkstot) ) ) + IF ( ibnd_up == 0 ) THEN + ! + ehomo = MAXVAL( et(ibnd_dw,1:nkstot/2) ) + ! + ELSE IF ( ibnd_dw == 0 ) THEN + ! + ehomo = MAXVAL( et(ibnd_up,1:nkstot/2) ) + ! + ELSE + ! + ehomo = MAX( MAXVAL( et(ibnd_up,1:nkstot/2) ), & + MAXVAL( et(ibnd_dw,nkstot/2+1:nkstot) ) ) + ! + END IF + END IF + ! + WRITE( stdout, 9042 ) ehomo*rytoev, elumo*rytoev + ! + END IF + END IF + ! + END IF + ! + CALL flush_unit( stdout ) + ! + RETURN + ! + ! ... formats + ! +9015 FORMAT(/' ------ SPIN UP ------------'/ ) +9016 FORMAT(/' ------ SPIN DOWN ----------'/ ) +9020 FORMAT(/' k =',3F7.4,' band energies (ev):'/ ) +9021 FORMAT(/' k =',3F7.4,' (',I6,' PWs) bands (ev):'/ ) +9030 FORMAT( ' ',8F9.4 ) +9032 FORMAT(/' occupation numbers ' ) +9042 FORMAT(/' highest occupied, lowest unoccupied level (ev): ',2F10.4 ) +9041 FORMAT(/' the spin up/dw Fermi energies are ',2F10.4,' ev' ) +9040 FORMAT(/' the Fermi energy is ',F10.4,' ev' ) + ! +END SUBROUTINE print_ks_energies diff --git a/tests/apps/miniDFT/tests/src/pseudo_types.f90 b/tests/apps/miniDFT/tests/src/pseudo_types.f90 new file mode 100644 index 0000000000..37aa4eec14 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/pseudo_types.f90 @@ -0,0 +1,299 @@ +! +! Copyright (C) 2002-2008 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +MODULE pseudo_types + + ! this module contains the definitions of several TYPE structures, + ! together with their allocation/deallocation routines + + USE kinds, ONLY: DP + use radial_grids, ONLY: radial_grid_type + + IMPLICIT NONE + SAVE + ! + ! Additional data to make a PAW setup out of an US pseudo, + ! they are all stored on a radial grid: + TYPE paw_in_upf + REAL(DP),POINTER :: ae_rho_atc(:) ! AE core charge (pseudo ccharge + ! is already included in upf) + REAL(DP),POINTER :: pfunc(:,:,:),&! Psi_i(r)*Psi_j(r) + pfunc_rel(:,:,:), & ! Psi_i(r)*Psi_j(r) small component + ptfunc(:,:,:), & ! as above, but for pseudo + aewfc_rel(:,:) ! as above, but for pseudo + REAL(DP),POINTER :: ae_vloc(:) ! AE local potential (pseudo vloc + ! is already included in upf) + REAL(DP),POINTER :: oc(:) ! starting occupation used to init becsum + ! they differ from US ones because they + ! are indexed on BETA functions, non on WFC + REAL(DP),POINTER :: augmom(:,:,:) ! multipole AE-pseudo (i,j,l=0:2*lmax) + REAL(DP) :: raug ! augfunction max radius + INTEGER :: iraug ! index on rgrid closer to, and >, raug + INTEGER :: lmax_aug ! max angmom of augmentation functions, it is == + ! to 2* max{l of pseudized wavefunctions} + ! note that nqlc of upf also includes the angmom of + ! empty virtual channel used to generate local potential + REAL(DP) :: core_energy ! constant to add in order to get all-electron energy + CHARACTER(len=12):: augshape ! shape of augmentation charge + END TYPE paw_in_upf + + + TYPE pseudo_upf + CHARACTER(LEN=80):: generated=' '! generator software + CHARACTER(LEN=80):: author=' ' ! pseudopotential's author + CHARACTER(LEN=80):: date=' ' ! generation date + CHARACTER(LEN=80):: comment=' ' ! author's comment + CHARACTER(LEN=2) :: psd=' ' ! Element label + CHARACTER(LEN=20) :: typ=' ' ! Pseudo type ( NC or US or PAW) + CHARACTER(len=6) :: rel=' ' ! relativistic: {no|scalar|full} + LOGICAL :: tvanp ! .true. if Ultrasoft + LOGICAL :: tcoulombp ! .true. if Coulomb 1/r potential + LOGICAL :: nlcc ! Non linear core corrections + CHARACTER(LEN=25) :: dft ! Exch-Corr type + REAL(DP) :: zp ! z valence + REAL(DP) :: etotps ! total energy + REAL(DP) :: ecutwfc ! suggested cut-off for wfc + REAL(DP) :: ecutrho ! suggested cut-off for rho + ! + CHARACTER(len=11) :: nv ! UPF file three-digit version i.e. 2.0.0 + INTEGER :: lmax ! maximum l component in beta + INTEGER :: lmax_rho ! max l component in charge (should be 2*lmax) + REAL(DP), POINTER :: vnl(:,:,:) ! vnl(i,l,s) = V(r_i)_{ls} + ! only for single-channel NC PP + ! Wavefunctions and projectors + INTEGER :: nwfc ! number of atomic wavefunctions + INTEGER :: nbeta ! number of projectors + INTEGER, POINTER :: kbeta(:) ! kbeta(nbeta) see below + INTEGER :: kkbeta ! kkbeta=max(kbeta(:)) + ! kbeta<=mesh is the number of grid points for each beta function + ! beta(r,nb) = 0 for r > r(kbeta(nb)) + ! kkbeta<=mesh is the largest of such number so that for all beta + ! beta(r,nb) = 0 for r > r(kkbeta) + ! + INTEGER, POINTER :: lll(:) ! lll(nbeta) l of each projector + REAL(DP), POINTER :: beta(:,:) ! beta(mesh,nbeta) projectors + ! + CHARACTER(LEN=2), POINTER :: els(:) ! els(nwfc) label of wfc + CHARACTER(LEN=2), POINTER :: els_beta(:) ! els(nbeta) label of beta + INTEGER, POINTER :: nchi(:) ! lchi(nwfc) value of pseudo-n for wavefcts + INTEGER, POINTER :: lchi(:) ! lchi(nwfc) value of l for wavefcts + REAL(DP), POINTER :: oc(:) ! oc(nwfc) occupancies for wavefcts + REAL(DP), POINTER :: epseu(:) ! pseudo one-particle energy (nwfc) + REAL(DP), POINTER :: rcut_chi(:)! rcut_chi(nwfc) cutoff inner radius + REAL(DP), POINTER :: rcutus_chi(:)! rcutus_chi(nwfc) ultrasoft outer radius + ! Chi and rho_at are only used for initial density and initial wfcs: + REAL(DP), POINTER :: chi(:,:) ! chi(mesh,nwfc) atomic wavefcts + REAL(DP), POINTER :: rho_at(:) ! rho_at(mesh) atomic charge + ! Minimal radial grid: + INTEGER :: mesh ! number of points in the radial mesh + REAL(DP) :: xmin ! the minimum x of the linear mesh + REAL(DP) :: rmax ! the maximum radius of the mesh + REAL(DP) :: zmesh ! the nuclear charge used for mesh + REAL(DP) :: dx ! the deltax of the linear mesh + REAL(DP), POINTER :: r(:) ! r(mesh) radial grid + REAL(DP), POINTER :: rab(:) ! rab(mesh) dr(x)/dx (x=linear grid) + ! Pseudized core charge + REAL(DP), POINTER :: rho_atc(:) ! rho_atc(mesh) atomic core charge + ! Local potential + INTEGER :: lloc ! L of channel used to generate local potential + ! (if < 0 it was generated by smoothing AE potential) + REAL(DP) :: rcloc ! vloc = v_ae for r > rcloc + REAL(DP), POINTER :: vloc(:) ! vloc(mesh) local atomic potential + ! + REAL(DP), POINTER :: dion(:,:) ! dion(nbeta,nbeta) atomic D_{mu,nu} + ! Augmentation + LOGICAL :: q_with_l ! if .true. qfunc is pseudized in + ! different ways for different l + INTEGER :: nqf ! number of Q coefficients + INTEGER :: nqlc ! number of angular momenta in Q + REAL(DP):: qqq_eps ! qfunc is null if its norm is .lt. qqq_eps + REAL(DP), POINTER :: rinner(:) ! rinner(0:2*lmax) r_L + REAL(DP), POINTER :: qqq(:,:) ! qqq(nbeta,nbeta) q_{mu,nu} + ! Augmentation without L dependecy + REAL(DP), POINTER :: qfunc(:,:) ! qfunc(mesh,nbeta*(nbeta+1)/2) + ! Q_{mu,nu}(|r|) function for |r|> r_L + ! Augmentation depending on L (optional, compulsory for PAW) + REAL(DP), POINTER :: qfuncl(:,:,:)! qfuncl(mesh,nbeta*(nbeta+1)/2,l) + ! Q_{mu,nu}(|r|) function for |r|> r_L + ! Analitycal coeffs cor small r expansion of qfunc (Vanderbilt's code) + REAL(DP), POINTER :: qfcoef(:,:,:,:) ! qfcoef(nqf,0:2*lmax,nbeta,nbeta) + ! coefficients for Q for |r| desc%myr ) THEN + ! + ! super diagonal block, procs send the block to sub diag. + ! + CALL GRID2D_RANK( 'R', desc%npr, desc%npc, & + desc%myc, desc%myr, dest ) + CALL mpi_isend( a, lda*lda, MPI_DOUBLE_COMPLEX, dest, 1, comm, sreq, ierr ) + ! + IF( ierr /= 0 ) & + CALL errore( " zsqmher ", " in mpi_isend ", ABS( ierr ) ) + ! + ELSE IF( desc%myc < desc%myr ) THEN + ! + ! sub diagonal block, procs receive the block from super diag, + ! then transpose locally + ! + CALL GRID2D_RANK( 'R', desc%npr, desc%npc, & + desc%myc, desc%myr, sour ) + CALL mpi_recv( a, lda*lda, MPI_DOUBLE_COMPLEX, sour, 1, comm, istatus, ierr ) + ! + IF( ierr /= 0 ) & + CALL errore( " zsqmher ", " in mpi_recv ", ABS( ierr ) ) + ! + DO j = 1, lda + DO i = j + 1, lda + atmp = a(i,j) + a(i,j) = a(j,i) + a(j,i) = atmp + END DO + END DO + DO j = 1, nc + DO i = 1, nr + a(i,j) = CONJG( a(i,j) ) + END DO + END DO + ! + END IF + + IF( desc%myc > desc%myr ) THEN + ! + CALL MPI_Wait( sreq, istatus, ierr ) + ! + IF( ierr /= 0 ) & + CALL errore( " zsqmher ", " in MPI_Wait ", ABS( ierr ) ) + ! + END IF + + + RETURN +END SUBROUTINE zsqmher + +SUBROUTINE zsqmred( na, a, lda, desca, nb, b, ldb, descb ) + ! + ! double complex (Z) SQuare Matrix REDistribution + ! + ! Copy a global "na * na" matrix locally stored in "a", + ! and distributed as described by "desca", into a larger + ! global "nb * nb" matrix stored in "b" and distributed + ! as described in "descb". + ! + ! If you want to read, get prepared for an headache! + ! Written struggling by Carlo Cavazzoni. + ! + USE kinds + USE descriptors + ! + IMPLICIT NONE + ! + INTEGER, INTENT(IN) :: na + INTEGER, INTENT(IN) :: lda + COMPLEX(DP) :: a(lda,lda) ! matrix to be redistributed into b + TYPE(la_descriptor), INTENT(IN) :: desca + INTEGER, INTENT(IN) :: nb + INTEGER, INTENT(IN) :: ldb + COMPLEX(DP) :: b(ldb,ldb) + TYPE(la_descriptor), INTENT(IN) :: descb + + INTEGER :: ipc, ipr, npc, npr + INTEGER :: ipr_old, ir_old, nr_old, irx_old + INTEGER :: ipc_old, ic_old, nc_old, icx_old + INTEGER :: myrow, mycol, ierr, rank + INTEGER :: col_comm, row_comm, comm, sreq + INTEGER :: nr_new, ir_new, irx_new, ir, nr, nrtot, irb, ire + INTEGER :: nc_new, ic_new, icx_new, ic, nc, nctot, icb, ice + INTEGER :: ib, i, j, myid + INTEGER :: nrsnd( desca%npr ) + INTEGER :: ncsnd( desca%npr ) + INTEGER :: displ( desca%npr ) + INTEGER :: irb_new( desca%npr ) + INTEGER :: ire_new( desca%npr ) + INTEGER :: icb_new( desca%npr ) + INTEGER :: ice_new( desca%npr ) + COMPLEX(DP), ALLOCATABLE :: buf(:) + COMPLEX(DP), ALLOCATABLE :: ab(:,:) + COMPLEX(DP), ALLOCATABLE :: tst1(:,:) + COMPLEX(DP), ALLOCATABLE :: tst2(:,:) + INTEGER :: istatus( MPI_STATUS_SIZE ) + + IF( desca%active_node <= 0 ) THEN + RETURN + END IF + + ! preliminary consistency checks + + IF( nb < na ) & + CALL errore( " zsqmred ", " nb < na, this sub. work only with nb >= na ", nb ) + IF( nb /= descb%n ) & + CALL errore( " zsqmred ", " wrong global dim nb ", nb ) + IF( na /= desca%n ) & + CALL errore( " zsqmred ", " wrong global dim na ", na ) + IF( ldb /= descb%nrcx ) & + CALL errore( " zsqmred ", " wrong leading dim ldb ", ldb ) + IF( lda /= desca%nrcx ) & + CALL errore( " zsqmred ", " wrong leading dim lda ", lda ) + + npr = desca%npr + myrow = desca%myr + npc = desca%npc + mycol = desca%myc + comm = desca%comm + + + ! split communicator into row and col communicators + + CALL MPI_Comm_rank( comm, myid, ierr ) + IF( ierr /= 0 ) & + CALL errore( " zsqmred ", " in MPI_Comm_rank 1 ", ABS( ierr ) ) + + CALL MPI_Comm_split( comm, mycol, myrow, col_comm, ierr ) + IF( ierr /= 0 ) & + CALL errore( " zsqmred ", " in MPI_Comm_split 1 ", ABS( ierr ) ) + + CALL MPI_Comm_split( comm, myrow, mycol, row_comm, ierr ) + IF( ierr /= 0 ) & + CALL errore( " zsqmred ", " in MPI_Comm_split 2 ", ABS( ierr ) ) + + CALL MPI_Comm_rank( col_comm, rank, ierr ) + IF( ierr /= 0 ) & + CALL errore( " zsqmred ", " in MPI_Comm_rank 2 ", ABS( ierr ) ) + IF( rank /= myrow ) & + CALL errore( " zsqmred ", " building col_comm ", rank ) + + CALL MPI_Comm_rank( row_comm, rank, ierr ) + IF( ierr /= 0 ) & + CALL errore( " zsqmred ", " in MPI_Comm_rank 3 ", ABS( ierr ) ) + IF( rank /= mycol ) & + CALL errore( " zsqmred ", " building row_comm ", rank ) + + ALLOCATE( buf( descb%nrcx * descb%nrcx ) ) + ALLOCATE( ab( descb%nrcx, desca%nrcx ) ) + + DO j = 1, descb%nc + DO i = 1, descb%nr + b( i, j ) = ( 0_DP , 0_DP ) + END DO + END DO + + ab = ( 0_DP , 0_DP ) + + ! first redistribute rows, column groups work in parallel + + DO ipr = 1, npr + ! + CALL descla_local_dims( ir_new, nr_new, nb, descb%nx, npr, ipr-1 ) + ! + irx_new = ir_new + nr_new - 1 + ! + DO ipr_old = 1, npr + ! + CALL descla_local_dims( ir_old, nr_old, na, desca%nx, npr, ipr_old-1 ) + ! + irx_old = ir_old + nr_old - 1 + ! + IF( ir_old >= ir_new .AND. ir_old <= irx_new ) THEN + ! + nrsnd( ipr_old ) = MIN( nr_old, irx_new - ir_old + 1 ) + irb = 1 + ire = nrsnd( ipr_old ) + irb_new( ipr_old ) = ir_old - ir_new + 1 + ire_new( ipr_old ) = irb_new( ipr_old ) + nrsnd( ipr_old ) - 1 + ! + ELSE IF( ir_new >= ir_old .AND. ir_new <= irx_old ) THEN + ! + nrsnd( ipr_old ) = irx_old - ir_new + 1 + irb = ir_new - ir_old + 1 + ire = nr_old + irb_new( ipr_old ) = 1 + ire_new( ipr_old ) = nrsnd( ipr_old ) + ! + ELSE + nrsnd( ipr_old ) = 0 + irb = 0 + ire = 0 + irb_new( ipr_old ) = 0 + ire_new( ipr_old ) = 0 + END IF + ! + IF( ( myrow == ipr_old - 1 ) .AND. ( nrsnd( ipr_old ) > 0 ) ) THEN + IF( myrow /= ipr - 1 ) THEN + ib = 0 + DO j = 1, desca%nc + DO i = irb, ire + ib = ib + 1 + buf( ib ) = a( i, j ) + END DO + END DO + CALL mpi_isend( buf, ib, MPI_DOUBLE_COMPLEX, ipr-1, ipr, col_comm, sreq, ierr ) + IF( ierr /= 0 ) & + CALL errore( " zsqmred ", " in mpi_isend 1 ", ABS( ierr ) ) + ELSE + DO j = 1, desca%nc + ib = irb + DO i = irb_new( ipr_old ), ire_new( ipr_old ) + ab( i, j ) = a( ib, j ) + ib = ib + 1 + END DO + END DO + END IF + END IF + ! + IF( nrsnd( ipr_old ) /= ire - irb + 1 ) & + CALL errore( " zsqmred ", " somthing wrong with row 1 ", nrsnd( ipr_old ) ) + IF( nrsnd( ipr_old ) /= ire_new( ipr_old ) - irb_new( ipr_old ) + 1 ) & + CALL errore( " zsqmred ", " somthing wrong with row 2 ", nrsnd( ipr_old ) ) + ! + nrsnd( ipr_old ) = nrsnd( ipr_old ) * desca%nc + ! + END DO + ! + IF( myrow == ipr - 1 ) THEN + DO ipr_old = 1, npr + IF( nrsnd( ipr_old ) > 0 ) THEN + IF( myrow /= ipr_old - 1 ) THEN + CALL mpi_recv( buf, nrsnd(ipr_old), MPI_DOUBLE_COMPLEX, ipr_old-1, ipr, col_comm, istatus, ierr ) + IF( ierr /= 0 ) & + CALL errore( " zsqmred ", " in mpi_recv 1 ", ABS( ierr ) ) + CALL MPI_GET_COUNT( istatus, MPI_DOUBLE_COMPLEX, ib, ierr) + IF( ierr /= 0 ) & + CALL errore( " zsqmred ", " in MPI_GET_COUNT 1 ", ABS( ierr ) ) + IF( ib /= nrsnd(ipr_old) ) & + CALL errore( " zsqmred ", " somthing wrong with row 3 ", ib ) + ib = 0 + DO j = 1, desca%nc + DO i = irb_new( ipr_old ), ire_new( ipr_old ) + ib = ib + 1 + ab( i, j ) = buf( ib ) + END DO + END DO + END IF + END IF + END DO + ELSE + DO ipr_old = 1, npr + IF( myrow == ipr_old - 1 .AND. nrsnd( ipr_old ) > 0 ) THEN + CALL MPI_Wait( sreq, istatus, ierr ) + IF( ierr /= 0 ) & + CALL errore( " zsqmred ", " in MPI_Wait 1 ", ABS( ierr ) ) + END IF + END DO + END IF + ! + END DO + + ! then redistribute cols, row groups work in parallel + + DO ipc = 1, npc + ! + CALL descla_local_dims( ic_new, nc_new, nb, descb%nx, npc, ipc-1 ) + ! + icx_new = ic_new + nc_new - 1 + ! + DO ipc_old = 1, npc + ! + CALL descla_local_dims( ic_old, nc_old, na, desca%nx, npc, ipc_old-1 ) + ! + icx_old = ic_old + nc_old - 1 + ! + IF( ic_old >= ic_new .AND. ic_old <= icx_new ) THEN + ! + ncsnd( ipc_old ) = MIN( nc_old, icx_new - ic_old + 1 ) + icb = 1 + ice = ncsnd( ipc_old ) + icb_new( ipc_old ) = ic_old - ic_new + 1 + ice_new( ipc_old ) = icb_new( ipc_old ) + ncsnd( ipc_old ) - 1 + ! + ELSE IF( ic_new >= ic_old .AND. ic_new <= icx_old ) THEN + ! + ncsnd( ipc_old ) = icx_old - ic_new + 1 + icb = ic_new - ic_old + 1 + ice = nc_old + icb_new( ipc_old ) = 1 + ice_new( ipc_old ) = ncsnd( ipc_old ) + ! + ELSE + ncsnd( ipc_old ) = 0 + icb = 0 + ice = 0 + icb_new( ipc_old ) = 0 + ice_new( ipc_old ) = 0 + END IF + ! + IF( ( mycol == ipc_old - 1 ) .AND. ( ncsnd( ipc_old ) > 0 ) ) THEN + IF( mycol /= ipc - 1 ) THEN + ib = 0 + DO j = icb, ice + DO i = 1, descb%nrcx + ib = ib + 1 + buf( ib ) = ab( i, j ) + END DO + END DO + CALL mpi_isend( buf, ib, MPI_DOUBLE_COMPLEX, ipc-1, ipc, row_comm, sreq, ierr ) + IF( ierr /= 0 ) & + CALL errore( " zsqmred ", " in mpi_isend 2 ", ABS( ierr ) ) + ELSE + ib = icb + DO j = icb_new( ipc_old ), ice_new( ipc_old ) + DO i = 1, descb%nrcx + b( i, j ) = ab( i, ib ) + END DO + ib = ib + 1 + END DO + END IF + END IF + + IF( ncsnd( ipc_old ) /= ice-icb+1 ) & + CALL errore( " zsqmred ", " somthing wrong with col 1 ", ncsnd( ipc_old ) ) + IF( ncsnd( ipc_old ) /= ice_new( ipc_old ) - icb_new( ipc_old ) + 1 ) & + CALL errore( " zsqmred ", " somthing wrong with col 2 ", ncsnd( ipc_old ) ) + ! + ncsnd( ipc_old ) = ncsnd( ipc_old ) * descb%nrcx + ! + END DO + ! + IF( mycol == ipc - 1 ) THEN + DO ipc_old = 1, npc + IF( ncsnd( ipc_old ) > 0 ) THEN + IF( mycol /= ipc_old - 1 ) THEN + ib = icb_new( ipc_old ) + CALL mpi_recv( b( 1, ib ), ncsnd(ipc_old), MPI_DOUBLE_COMPLEX, ipc_old-1, ipc, row_comm, istatus, ierr ) + IF( ierr /= 0 ) & + CALL errore( " zsqmred ", " in mpi_recv 2 ", ABS( ierr ) ) + CALL MPI_GET_COUNT( istatus, MPI_DOUBLE_COMPLEX, ib, ierr ) + IF( ierr /= 0 ) & + CALL errore( " zsqmred ", " in MPI_GET_COUNT 2 ", ABS( ierr ) ) + IF( ib /= ncsnd(ipc_old) ) & + CALL errore( " zsqmred ", " somthing wrong with col 3 ", ib ) + END IF + END IF + END DO + ELSE + DO ipc_old = 1, npc + IF( mycol == ipc_old - 1 .AND. ncsnd( ipc_old ) > 0 ) THEN + CALL MPI_Wait( sreq, istatus, ierr ) + IF( ierr /= 0 ) & + CALL errore( " zsqmred ", " in MPI_Wait 2 ", ABS( ierr ) ) + END IF + END DO + END IF + ! + END DO + + DEALLOCATE( ab ) + DEALLOCATE( buf ) + + CALL mpi_comm_free( col_comm, ierr ) + IF( ierr /= 0 ) & + CALL errore( " zsqmred ", " in mpi_comm_free 1 ", ABS( ierr ) ) + + CALL mpi_comm_free( row_comm, ierr ) + IF( ierr /= 0 ) & + CALL errore( " zsqmred ", " in mpi_comm_free 2 ", ABS( ierr ) ) + + + RETURN +END SUBROUTINE zsqmred + +END MODULE parallel_toolkit +!==----------------------------------------------==! + +!=----------------------------------------------------------------------------=! +! +! Cannon's algorithms for parallel matrix multiplication +! written by Carlo Cavazzoni +! + +SUBROUTINE sqr_zmm_cannon( transa, transb, n, alpha, a, lda, b, ldb, beta, c, ldc, desc ) + ! + ! Parallel square matrix multiplication with Cannon's algorithm + ! + USE kinds, ONLY : DP + USE descriptors + ! + IMPLICIT NONE + ! + CHARACTER(LEN=1), INTENT(IN) :: transa, transb + INTEGER, INTENT(IN) :: n + COMPLEX(DP), INTENT(IN) :: alpha, beta + INTEGER, INTENT(IN) :: lda, ldb, ldc + COMPLEX(DP) :: a(lda,*), b(ldb,*), c(ldc,*) + TYPE(la_descriptor), INTENT(IN) :: desc + ! + ! performs one of the matrix-matrix operations + ! + ! C := ALPHA*OP( A )*OP( B ) + BETA*C, + ! + ! where op( x ) is one of + ! + ! OP( X ) = X OR OP( X ) = X', + ! + ! alpha and beta are scalars, and a, b and c are square matrices + ! + ! + include 'mpif.h' + ! + ! + INTEGER :: ierr + INTEGER :: np + INTEGER :: i, j, nr, nc, nb, iter, rowid, colid + LOGICAL :: ta, tb + INTEGER :: comm + ! + ! + COMPLEX(DP), ALLOCATABLE :: bblk(:,:), ablk(:,:) + COMPLEX(DP) :: zone = ( 1.0_DP, 0.0_DP ) + COMPLEX(DP) :: zzero = ( 0.0_DP, 0.0_DP ) + ! + ! + integer :: istatus( MPI_STATUS_SIZE ) + ! + ! + IF( desc%active_node < 0 ) THEN + ! + ! processors not interested in this computation return quickly + ! + RETURN + ! + END IF + + IF( n < 1 ) THEN + RETURN + END IF + + IF( desc%npr == 1 ) THEN + ! + ! quick return if only one processor is used + ! + CALL zgemm( TRANSA, TRANSB, n, n, n, alpha, a, lda, b, ldb, beta, c, ldc) + ! + RETURN + ! + END IF + + IF( desc%npr /= desc%npc ) & + CALL errore( ' sqr_zmm_cannon ', ' works only with square processor mesh ', 1 ) + ! + ! Retrieve communicator and mesh geometry + ! + np = desc%npr + comm = desc%comm + rowid = desc%myr + colid = desc%myc + ! + ! Retrieve the size of the local block + ! + nr = desc%nr + nc = desc%nc + nb = desc%nrcx + ! + CALL MPI_BARRIER( comm, ierr ) + IF( ierr /= 0 ) & + CALL errore( " sqr_zmm_cannon ", " in MPI_BARRIER ", ABS( ierr ) ) + ! + allocate( ablk( nb, nb ) ) + DO j = 1, nc + DO i = 1, nr + ablk( i, j ) = a( i, j ) + END DO + END DO + ! + ! Clear memory outside the matrix block + ! + DO j = nc+1, nb + DO i = 1, nb + ablk( i, j ) = zzero + END DO + END DO + DO j = 1, nb + DO i = nr+1, nb + ablk( i, j ) = zzero + END DO + END DO + ! + ! + allocate( bblk( nb, nb ) ) + DO j = 1, nc + DO i = 1, nr + bblk( i, j ) = b( i, j ) + END DO + END DO + ! + ! Clear memory outside the matrix block + ! + DO j = nc+1, nb + DO i = 1, nb + bblk( i, j ) = zzero + END DO + END DO + DO j = 1, nb + DO i = nr+1, nb + bblk( i, j ) = zzero + END DO + END DO + ! + ! + ta = ( TRANSA == 'C' .OR. TRANSA == 'c' ) + tb = ( TRANSB == 'C' .OR. TRANSB == 'c' ) + ! + ! Shift A rowid+1 places to the west + ! + IF( ta ) THEN + CALL shift_exch_block( ablk, 'W', 1 ) + ELSE + CALL shift_block( ablk, 'W', rowid+1, 1 ) + END IF + ! + ! Shift B colid+1 places to the north + ! + IF( tb ) THEN + CALL shift_exch_block( bblk, 'N', np+1 ) + ELSE + CALL shift_block( bblk, 'N', colid+1, np+1 ) + END IF + ! + ! Accumulate on C + ! + CALL zgemm( TRANSA, TRANSB, nr, nc, nb, alpha, ablk, nb, bblk, nb, beta, c, ldc) + ! + DO iter = 2, np + ! + ! Shift A 1 places to the east + ! + CALL shift_block( ablk, 'E', 1, iter ) + ! + ! Shift B 1 places to the south + ! + CALL shift_block( bblk, 'S', 1, np+iter ) + ! + ! Accumulate on C + ! + CALL zgemm( TRANSA, TRANSB, nr, nc, nb, alpha, ablk, nb, bblk, nb, zone, c, ldc) + ! + END DO + + deallocate( ablk, bblk ) + + RETURN + +CONTAINS + + SUBROUTINE shift_block( blk, dir, ln, tag ) + ! + ! Block shift + ! + IMPLICIT NONE + COMPLEX(DP) :: blk( :, : ) + CHARACTER(LEN=1), INTENT(IN) :: dir ! shift direction + INTEGER, INTENT(IN) :: ln ! shift length + INTEGER, INTENT(IN) :: tag ! communication tag + ! + INTEGER :: icdst, irdst, icsrc, irsrc, idest, isour + ! + IF( dir == 'W' ) THEN + ! + irdst = rowid + irsrc = rowid + icdst = MOD( colid - ln + np, np ) + icsrc = MOD( colid + ln + np, np ) + ! + ELSE IF( dir == 'E' ) THEN + ! + irdst = rowid + irsrc = rowid + icdst = MOD( colid + ln + np, np ) + icsrc = MOD( colid - ln + np, np ) + ! + ELSE IF( dir == 'N' ) THEN + + irdst = MOD( rowid - ln + np, np ) + irsrc = MOD( rowid + ln + np, np ) + icdst = colid + icsrc = colid + + ELSE IF( dir == 'S' ) THEN + + irdst = MOD( rowid + ln + np, np ) + irsrc = MOD( rowid - ln + np, np ) + icdst = colid + icsrc = colid + + ELSE + + CALL errore( ' sqr_zmm_cannon ', ' unknown shift direction ', 1 ) + + END IF + ! + CALL GRID2D_RANK( 'R', np, np, irdst, icdst, idest ) + CALL GRID2D_RANK( 'R', np, np, irsrc, icsrc, isour ) + ! + ! + CALL MPI_SENDRECV_REPLACE(blk, nb*nb, MPI_DOUBLE_COMPLEX, & + idest, tag, isour, tag, comm, istatus, ierr) + IF( ierr /= 0 ) & + CALL errore( " sqr_zmm_cannon ", " in MPI_SENDRECV_REPLACE 1 ", ABS( ierr ) ) + ! + RETURN + END SUBROUTINE shift_block + ! + SUBROUTINE shift_exch_block( blk, dir, tag ) + ! + ! Combined block shift and exchange + ! only used for the first step + ! + IMPLICIT NONE + COMPLEX(DP) :: blk( :, : ) + CHARACTER(LEN=1), INTENT(IN) :: dir + INTEGER, INTENT(IN) :: tag + ! + INTEGER :: icdst, irdst, icsrc, irsrc, idest, isour + INTEGER :: icol, irow + ! + IF( dir == 'W' ) THEN + ! + icol = rowid + irow = colid + ! + irdst = irow + icdst = MOD( icol - irow-1 + np, np ) + ! + irow = rowid + icol = MOD( colid + rowid+1 + np, np ) + ! + irsrc = icol + icsrc = irow + ! + ELSE IF( dir == 'N' ) THEN + ! + icol = rowid + irow = colid + ! + icdst = icol + irdst = MOD( irow - icol-1 + np, np ) + ! + irow = MOD( rowid + colid+1 + np, np ) + icol = colid + ! + irsrc = icol + icsrc = irow + + ELSE + + CALL errore( ' sqr_zmm_cannon ', ' unknown shift_exch direction ', 1 ) + + END IF + ! + CALL GRID2D_RANK( 'R', np, np, irdst, icdst, idest ) + CALL GRID2D_RANK( 'R', np, np, irsrc, icsrc, isour ) + ! + ! + CALL MPI_SENDRECV_REPLACE(blk, nb*nb, MPI_DOUBLE_COMPLEX, & + idest, tag, isour, tag, comm, istatus, ierr) + IF( ierr /= 0 ) & + CALL errore( " sqr_zmm_cannon ", " in MPI_SENDRECV_REPLACE 2 ", ABS( ierr ) ) + ! + RETURN + END SUBROUTINE shift_exch_block + +END SUBROUTINE sqr_zmm_cannon + +SUBROUTINE sqr_zsetmat( what, n, alpha, a, lda, desc ) + ! + ! Set the values of a square distributed matrix + ! + USE kinds, ONLY : DP + USE descriptors + ! + IMPLICIT NONE + ! + CHARACTER(LEN=1), INTENT(IN) :: what + ! what = 'A' set all the values of "a" equal to alpha + ! what = 'U' set the values in the upper triangle of "a" equal to alpha + ! what = 'L' set the values in the lower triangle of "a" equal to alpha + ! what = 'D' set the values in the diagonal of "a" equal to alpha + ! what = 'H' clear the imaginary part of the diagonal of "a" + INTEGER, INTENT(IN) :: n + ! dimension of the matrix + COMPLEX(DP), INTENT(IN) :: alpha + ! value to be assigned to elements of "a" + INTEGER, INTENT(IN) :: lda + ! leading dimension of a + COMPLEX(DP) :: a(lda,*) + ! matrix whose values have to be set + TYPE(la_descriptor), INTENT(IN) :: desc + ! descriptor of matrix a + + INTEGER :: i, j + + IF( desc%active_node < 0 ) THEN + ! + ! processors not interested in this computation return quickly + ! + RETURN + ! + END IF + + SELECT CASE( what ) + CASE( 'U', 'u' ) + IF( desc%myc > desc%myr ) THEN + DO j = 1, desc%nc + DO i = 1, desc%nr + a( i, j ) = alpha + END DO + END DO + ELSE IF( desc%myc == desc%myr ) THEN + DO j = 1, desc%nc + DO i = 1, j - 1 + a( i, j ) = alpha + END DO + END DO + END IF + CASE( 'L', 'l' ) + IF( desc%myc < desc%myr ) THEN + DO j = 1, desc%nc + DO i = 1, desc%nr + a( i, j ) = alpha + END DO + END DO + ELSE IF( desc%myc == desc%myr ) THEN + DO j = 1, desc%nc + DO i = j - 1, desc%nr + a( i, j ) = alpha + END DO + END DO + END IF + CASE( 'D', 'd' ) + IF( desc%myc == desc%myr ) THEN + DO i = 1, desc%nr + a( i, i ) = alpha + END DO + END IF + CASE( 'H', 'h' ) + IF( desc%myc == desc%myr ) THEN + DO i = 1, desc%nr + a( i, i ) = CMPLX( DBLE( a(i,i) ), 0_DP, KIND=DP ) + END DO + END IF + CASE DEFAULT + DO j = 1, desc%nc + DO i = 1, desc%nr + a( i, j ) = alpha + END DO + END DO + END SELECT + ! + RETURN +END SUBROUTINE sqr_zsetmat diff --git a/tests/apps/miniDFT/tests/src/punch.f90 b/tests/apps/miniDFT/tests/src/punch.f90 new file mode 100644 index 0000000000..3783bad239 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/punch.f90 @@ -0,0 +1,39 @@ +! +! Copyright (C) 2001-2006 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +!---------------------------------------------------------------------------- +SUBROUTINE punch( what ) + !---------------------------------------------------------------------------- + ! + ! ... This routine is called at the end of the run to save to a file + ! ... the information needed for further processing (phonon etc.) + ! + USE io_global, ONLY : stdout + USE io_files, ONLY : prefix, iunpun + USE control_flags, ONLY : io_level + USE a2F, ONLY : la2F, a2Fsave + ! + IMPLICIT NONE + ! + CHARACTER(LEN=*) :: what + ! + ! + IF (io_level < 0 ) RETURN + ! + WRITE( UNIT = stdout, FMT = '(/,5X,"Writing output data file ",A)' ) & + TRIM( prefix ) // '.save' + ! + iunpun = 4 + ! + write(*,*) "punch.f90:33 skipping pw_writefile, requires iotk" + !CALL pw_writefile( TRIM( what ) ) + ! + IF ( la2F ) CALL a2Fsave() + ! + RETURN + ! +END SUBROUTINE punch diff --git a/tests/apps/miniDFT/tests/src/pwcom.f90 b/tests/apps/miniDFT/tests/src/pwcom.f90 new file mode 100644 index 0000000000..c1f5f176ec --- /dev/null +++ b/tests/apps/miniDFT/tests/src/pwcom.f90 @@ -0,0 +1,427 @@ +! +! Copyright (C) 2001-2012 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +!-------------------------------------------------------------------------- +! +MODULE basis + ! + ! ... The variables needed to describe the atoms in the unit cell + ! + SAVE + ! + INTEGER :: & + natomwfc ! number of starting wavefunctions + CHARACTER(len=30) :: &! + starting_wfc, &! 'random' or 'atomic' or 'atomic+randm' or 'file' + starting_pot, &! 'atomic' or 'file' + startingconfig ! 'input' or 'file' + ! +END MODULE basis +! +! +MODULE klist + ! + ! ... The variables for the k-points + ! + USE kinds, ONLY : DP + USE parameters, ONLY : npk + ! + SAVE + ! + CHARACTER (len=32) :: & + smearing ! smearing type + REAL(DP) :: & + xk(3,npk), &! coordinates of k points + wk(npk), &! weight of k points + xqq(3), &! coordinates of q point (used in the ACFDT part) + degauss, &! smearing parameter + nelec, &! number of electrons + nelup=0.0_dp, &! number of spin-up electrons (if two_fermi_energies=t) + neldw=0.0_dp, &! number of spin-dw electrons (if two_fermi_energies=t) + tot_magnetization, &! nelup-neldw >= 0 (negative value means unspecified) + tot_charge + REAL(DP) :: & + qnorm= 0.0_dp ! |q|, used in phonon+US calculations only + INTEGER, ALLOCATABLE :: & + ngk(:) ! number of plane waves for each k point + INTEGER :: & + nks, &! number of k points in this pool + nkstot, &! total number of k points + ngauss ! type of smearing technique + LOGICAL :: & + lgauss, &! if .TRUE.: use gaussian broadening + lxkcry=.false., &! if .TRUE.:k-pnts in cryst. basis accepted in input + two_fermi_energies ! if .TRUE.: nelup and neldw set ef_up and ef_dw + ! separately + ! +END MODULE klist +! +! +MODULE lsda_mod + ! + ! ... The variables needed for the lsda calculation + ! + USE kinds, ONLY : DP + USE parameters, ONLY : ntypx, npk + ! + SAVE + ! + LOGICAL :: & + lsda + REAL(DP) :: & + magtot, &! total magnetization + absmag, &! total absolute magnetization + starting_magnetization(ntypx) ! the magnetization used to start with + INTEGER :: & + nspin, &! number of spin polarization: 2 if lsda, 1 other + current_spin, &! spin of the current kpoint + isk(npk) ! for each k-point: 1=spin up, 2=spin down + ! +END MODULE lsda_mod +! +! +MODULE ktetra + ! + ! ... The variables for the tetrahedron method + ! + SAVE + ! + INTEGER :: & + ntetra ! number of tetrahedra + INTEGER, ALLOCATABLE :: & + tetra(:,:) ! index of k-points in a given tetrahedron + ! shape (4,ntetra) + LOGICAL :: & + ltetra ! if .TRUE.: use tetrahedron method + ! +END MODULE ktetra +! +! +MODULE rap_point_group + ! + USE kinds, ONLY : DP + ! + INTEGER :: & + code_group, & ! The code of the point group + nclass, & ! The number of classes of the point group + nelem(12), & ! The elements of each class + elem(8,12), & ! Which elements in the smat list for each class + which_irr(12) ! For each class gives its position in the + ! character table. + ! + COMPLEX(DP) :: char_mat(12,12) ! the character tables: rap,class + + CHARACTER(len=15) :: name_rap(12) ! the name of the representation + CHARACTER(len=3) :: ir_ram(12) ! a string I, R or I+R for infrared, + ! Raman, or infrared+raman modes. + CHARACTER(len=11) :: gname ! the name of the group + CHARACTER(len=5) :: name_class(12) ! the name of the class + ! +END MODULE rap_point_group + +MODULE rap_point_group_so + ! + USE kinds, ONLY : DP + ! + INTEGER :: & + nrap, & ! The number of classes of the point group + nelem_so(24), &! The elements of each class + elem_so(12,24), &! Which elements in the smat list for each class + has_e(12,24), & ! if -1 the smat is multiplied by -E + which_irr_so(24) ! For each class gives its position in the + ! character table. + ! + COMPLEX(DP) :: char_mat_so(12,24), & ! the character tables + d_spin(2,2,48) ! the rotation in spin space + + CHARACTER(len=15) :: name_rap_so(12) ! the name of the representation + CHARACTER(len=5) :: name_class_so(24), & ! the name of the class + name_class_so1(24) ! the name of the class + ! +END MODULE rap_point_group_so +! +MODULE rap_point_group_is + ! + USE kinds, ONLY : DP + ! + INTEGER :: & + ftau_is(3,48), & ! The fractional transl. of the invariant subgroup + nsym_is, & ! The number of operations of the invariant subgroup + code_group_is ! The code of the point invariant subgroup + + REAL(DP) :: & + sr_is(3,3,48) ! The matrices of the invariant subgroup + + COMPLEX(DP) :: & + d_spin_is(2,2,48) ! the rotation in spin space + + CHARACTER(len=45) :: sname_is(48) ! name of the symmetries + CHARACTER(len=11) :: gname_is ! the name of the invariant group + ! +END MODULE rap_point_group_is +! +MODULE vlocal + ! + ! ... The variables needed for the local potential in reciprocal space + ! + USE kinds, ONLY : DP + ! + SAVE + ! + COMPLEX(DP), ALLOCATABLE :: & + strf(:,:) ! the structure factor + REAL(DP), ALLOCATABLE :: & + vloc(:,:) ! the local potential for each atom type + ! +END MODULE vlocal +! +! +MODULE wvfct + ! + ! ... The variables needed to compute the band structure + ! + USE kinds, ONLY : DP + ! + SAVE + ! + INTEGER :: & + npwx, &! maximum number of PW for wavefunctions + nbndx, &! max number of bands use in iterative diag + nbnd, &! number of bands + npw, &! the number of plane waves + current_k ! the index of k-point under consideration + INTEGER, ALLOCATABLE, TARGET :: & + igk(:) ! index of G corresponding to a given index of k+G + REAL(DP) :: & + ecutwfc, &! energy cut-off + ecfixed, &! + qcutz = 0.0_DP,&! For the modified Ekin functional + q2sigma ! + REAL(DP), ALLOCATABLE :: & + et(:,:), &! eigenvalues of the hamiltonian + wg(:,:), &! the weight of each k point and band + g2kin(:) ! kinetic energy + INTEGER, ALLOCATABLE :: & + btype(:,:) ! one if the corresponding state has to be + ! converged to full accuracy, zero otherwise + ! +END MODULE wvfct +! +! +MODULE ener + ! + ! ... The variables needed to compute the energies + ! + USE kinds, ONLY : DP + ! + SAVE + ! + REAL(DP) :: & + etot, &! the total Kohn-Sham energy of the solid + hwf_energy, &! this is the Harris-Weinert-Foulkes energy + eband, &! the band energy + deband, &! scf correction to have variational energy + ehart, &! the hartree energy + etxc, &! the exchange and correlation energy + vtxc, &! another exchange-correlation energy + etxcc, &! the nlcc exchange and correlation + ewld, &! the ewald energy + elondon, &! the semi-empirical dispersion energy + demet, &! variational correction ("-TS") for metals + epaw, &! sum of one-center paw contributions + ef, ef_up, ef_dw ! the fermi energy (up and dw if two_fermi_energies=.T.) + ! +END MODULE ener +! +! +MODULE force_mod + ! + ! ... The variables for the first derivative of the energy + ! + USE kinds, ONLY : DP + ! + SAVE + ! + REAL(DP), ALLOCATABLE :: & + force(:,:) ! the force on each atom + REAL(DP) :: & + sigma(3,3) ! the stress acting on the system + LOGICAL :: & + lforce, &! if .TRUE. compute the forces + lstres ! if .TRUE. compute the stress + ! +END MODULE force_mod +! +MODULE relax + ! + ! ... The variables used to control ionic relaxations + ! + USE kinds, ONLY : DP + ! + SAVE + ! + REAL(DP) :: & + epse, &! threshold on total energy + epsf, &! threshold on forces + epsp, &! threshold on pressure + starting_scf_threshold ! self-explanatory + ! +END MODULE relax +! +! +! +! +MODULE us + ! + ! ... These parameters are needed with the US pseudopotentials + ! + USE kinds, ONLY : DP + ! + SAVE + ! + INTEGER :: & + nqxq, &! size of interpolation table + nqx ! number of interpolation points + REAL(DP), PARAMETER:: & + dq = 0.01D0 ! space between points in the pseudopotential tab. + REAL(DP), ALLOCATABLE :: & + qrad(:,:,:,:), &! radial FT of Q functions + tab(:,:,:), &! interpolation table for PPs + tab_at(:,:,:) ! interpolation table for atomic wfc + LOGICAL :: spline_ps = .false. + REAL(DP), ALLOCATABLE :: & + tab_d2y(:,:,:) ! for cubic splines + ! +END MODULE us +! +! +!!$MODULE ldaU +!!$ ! +!!$ ! ... The quantities needed in lda+U calculations +!!$ ! +!!$ USE kinds, ONLY : DP +!!$ USE parameters, ONLY : lqmax, ntypx +!!$ ! +!!$ SAVE +!!$ ! +!!$ INTEGER, PARAMETER :: nspinx=2 +!!$ COMPLEX(DP), ALLOCATABLE :: & +!!$ swfcatom(:,:), &! orthogonalized atomic wfcs +!!$ d_spin_ldau(:,:,:) ! the rotations in spin space for all the symmetries +!!$ REAL(DP) :: & +!!$ eth, &! the Hubbard contribution to the energy +!!$ Hubbard_U(ntypx), &! the Hubbard U +!!$ Hubbard_J(3,ntypx), &! extra Hubbard parameters: +!!$ ! p: J(1) = J +!!$ ! d: J(1) = J, J(2) = B +!!$ ! f: J(1) = J, J(2) = E2, J(3) = E3 +!!$ Hubbard_alpha(ntypx), &! the Hubbard alpha (used to calculate U) +!!$ starting_ns(lqmax,nspinx,ntypx) ! +!!$ INTEGER :: & +!!$ niter_with_fixed_ns, &! no. of iterations with fixed ns +!!$ lda_plus_u_kind, &! 1/0 --> full/simplified(old) LDA+U calculation +!!$ Hubbard_l(ntypx), &! the angular momentum of Hubbard states +!!$ Hubbard_lmax = 0 ! maximum angular momentum of Hubbard states +!!$ LOGICAL :: & +!!$ lda_plus_u, &! .TRUE. if lda+u calculation is performed +!!$ conv_ns ! .TRUE. if ns are converged +!!$ CHARACTER(len=30) :: & ! 'atomic', 'ortho-atomic', 'file' +!!$ U_projection ! specifies how input coordinates are given +!!$ INTEGER, ALLOCATABLE :: & +!!$ oatwfc(:) ! offset of atomic wfcs used for projections +!!$ ! +!!$END MODULE ldaU +! +! +MODULE extfield + ! + ! ... The quantities needed in calculations with external field + ! + USE kinds, ONLY : DP + ! + SAVE + ! + LOGICAL :: & + tefield, &! if .TRUE. a finite electric field is added to the + ! local potential + dipfield ! if .TRUE. the dipole field is subtracted + INTEGER :: & + edir ! direction of the field + REAL(DP) :: & + emaxpos, &! position of the maximum of the field (0 1 ) CALL io_image_start( ) + CALL environment_start ( 'MiniDFT' ) + ! + IF ( ionode ) WRITE( unit = stdout, FMT = 9010 ) & + ntypx, npk, lmaxx + ! + ! + ! ... open, read, close input file + !call MQEoptions_read() + CALL read_input_file ('PW') + ! + ! ... convert to internal variables + ! + CALL iosys() + ! + ! + IF( nimage > 1 ) THEN + ! + ! ... When nimage are used, open a directory for each one + ! ...It has to be done here in order not to disturb NEB like calculations + ! + WRITE( dirname, FMT = '( I5.5 )' ) my_image_id + tmp_dir = TRIM( tmp_dir )//TRIM( dirname )//'/' + ! + END IF + ! + ! + CALL check_stop_init() + ! + ! + CALL setup () + ! + ! + CALL init_run() + ! + CALL MPI_Barrier( intra_image_comm, ierr ) + CALL start_clock( 'Benchmark_Time' ) +#ifdef __HPCTK + call hpctoolkit_sampling_start(); +#endif +#ifdef __IPM + call MPI_Pcontrol( 1, "Benchmark_Time"//char(0)) +#endif + ! + main_loop: DO + ! + ! ... electronic self-consistentcy + ! + CALL electrons() + ! + IF ( .NOT. conv_elec ) THEN + CALL punch( 'all' ) + CALL stop_run( conv_elec ) + ENDIF + ! + ! ... ionic section starts here + ! + CALL start_clock( 'ions' ) + conv_ions = .TRUE. + ! + ! ... force calculation + ! + IF ( lforce ) CALL forces() + ! + ! ... stress calculation + ! + IF ( lstres ) CALL stress ( sigma ) + ! + ! + CALL stop_clock( 'ions' ) + ! + ! ... exit condition (ionic convergence) is checked here + ! + IF ( conv_ions ) EXIT main_loop + ! + ! ... terms of the hamiltonian depending upon nuclear positions + ! ... are reinitialized here + ! + ! + END DO main_loop + CALL MPI_Barrier( intra_image_comm, ierr ) + CALL stop_clock( 'Benchmark_Time' ) + ! +#ifdef __IPM + call MPI_Pcontrol( -1, "Benchmark_Time"//char(0)) +#endif +#ifdef __HPCTK + call hpctoolkit_sampling_stop(); +#endif + ! + ! ... save final data file + ! + CALL punch('all') + CALL stop_run( conv_ions ) +#ifdef __OPENMP + call dfftw_cleanup_threads() +#endif + ! + ! END IF + ! + STOP + ! +9010 FORMAT( /,5X,'Current dimensions of program MiniDFT are:', & + & /,5X,'Max number of different atomic species (ntypx) = ',I2,& + & /,5X,'Max number of k-points (npk) = ',I6,& + & /,5X,'Max angular momentum in pseudopotentials (lmaxx) = ',i2) + ! +END PROGRAM pwscf diff --git a/tests/apps/miniDFT/tests/src/radial_grids.f90 b/tests/apps/miniDFT/tests/src/radial_grids.f90 new file mode 100644 index 0000000000..61e2271e83 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/radial_grids.f90 @@ -0,0 +1,481 @@ +! +! Copyright (C) 2004 PWSCF group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +MODULE radial_grids + !============================================================================ + ! + ! Module containing type definitions and auxiliary routines to deal with + ! data on logarithmic radial grids. + ! Should contain low level routines and no reference to other modules + ! (with the possible exception of kinds and parameters) so as to be + ! call-able from any other module. + ! + ! content: + ! + ! - ndmx : parameter definition max grid dimension + ! + ! - radial_grid_type : derived type definition for radial grids + ! + ! - do_mesh : a routine to build the radial mesh + ! + ! - check_mesh : a routine to check if grid is consistently set + ! + ! - hartree : a routine that solve the Poisson's equation on radial grid + ! + ! - series : a simple routine returning the coefficient of the polynomial + ! describing the leading behavior of a function f at small r. + ! + ! - write_grid_on_file, read_grid_from_file : I/O routines + ! + !============================================================================ + ! + USE kinds, ONLY: dp + ! + IMPLICIT NONE + ! + integer, parameter :: & + ndmx=3500 ! the maximum mesh size + +TYPE radial_grid_type + + INTEGER :: & + mesh ! the actual number of mesh points + REAL(DP),POINTER :: & + r(:), & ! the radial mesh + r2(:), & ! the square of the radial mesh + rab(:), & ! d r(x) / d x where x is the linear grid + sqr(:), & ! the square root of the radial mesh + rm1(:), & ! 1 / r + rm2(:), & ! 1 / r**2 + rm3(:) ! 1 / r**3 + REAL(DP) :: & + xmin, & ! the minimum x + rmax, & ! the maximum radial point + zmesh, & ! the ionic charge used for the mesh + dx ! the deltax of the linear mesh +END TYPE radial_grid_type + + PRIVATE + PUBLIC :: ndmx, radial_grid_type, & + do_mesh, check_mesh, hartree, series, & + write_grid_on_file, read_grid_from_file, & + allocate_radial_grid,& + deallocate_radial_grid,& + nullify_radial_grid,& + radial_grid_COPY + + interface deallocate_radial_grid + module procedure & + deallocate_radial_grid_s,& ! only one + deallocate_radial_grid_v ! an array + end interface + + !============================================================================ + ! + CONTAINS +! +! Build the radial (logarithmic) grid +! +! r(i) = exp ( xmin + (i-1) dx ) / zmesh i=1,mesh +! r2(i) is r(i) square, sqr(i) is sqrt(r(i)) and +! rab(i) is the integration element = r(i)*dx +! +! more general grid definitions are possible but currently not implemented +! (example: Vanderbilt's grid, same as above but starting at r=0) +! r(i) = exp ( xmin ) * ( exp( (i-1)*dx ) - 1.0_dp ) / zmesh +! rab(i) = ( r(i) + exp(xmin)/zmesh ) * dx +! +!--------------------------------------------------------------- + subroutine radial_grid_COPY(X,Y) +!--------------------------------------------------------------- + type(radial_grid_type),intent(in) :: X + type(radial_grid_type),intent(inout) :: Y + ! + call deallocate_radial_grid(Y) + call allocate_radial_grid(Y, X%mesh) + ! + Y%r(1:X%mesh) = X%r(1:X%mesh) + Y%r2(1:X%mesh) = X%r2(1:X%mesh) + Y%rab(1:X%mesh) = X%rab(1:X%mesh) + Y%sqr(1:X%mesh) = X%sqr(1:X%mesh) + Y%rm1(1:X%mesh) = X%rm1(1:X%mesh) + Y%rm2(1:X%mesh) = X%rm2(1:X%mesh) + Y%rm3(1:X%mesh) = X%rm3(1:X%mesh) + ! + Y%xmin = X%xmin + Y%rmax = X%rmax + Y%zmesh = X%zmesh + Y%dx = X%dx + end subroutine radial_grid_COPY +! +!--------------------------------------------------------------- + subroutine allocate_radial_grid(grid,mesh) +!--------------------------------------------------------------- + type(radial_grid_type),intent(inout) :: grid + integer,intent(in) :: mesh + if(mesh>ndmx) & + call errore('allocate_radial_grid', 'mesh>ndmx',1) + allocate( & + grid%r(mesh), & + grid%r2(mesh), & ! the square of the radial mesh + grid%rab(mesh), & ! d r(x) / d x where x is the linear grid + grid%sqr(mesh), & ! the square root of the radial mesh + grid%rm1(mesh), & ! 1 / r + grid%rm2(mesh), & ! 1 / r**2 + grid%rm3(mesh) ) ! 1 / r**3 + grid%mesh = mesh + end subroutine allocate_radial_grid +! +!--------------------------------------------------------------- + subroutine deallocate_radial_grid_s(grid) +!--------------------------------------------------------------- + type(radial_grid_type),intent(inout) :: grid + if (associated(grid%r)) deallocate(grid%r) + if (associated(grid%r2)) deallocate(grid%r2) + if (associated(grid%rab)) deallocate(grid%rab) + if (associated(grid%sqr)) deallocate(grid%sqr) + if (associated(grid%rm1)) deallocate(grid%rm1) + if (associated(grid%rm2)) deallocate(grid%rm2) + if (associated(grid%rm3)) deallocate(grid%rm3) + grid%mesh = 0 + call nullify_radial_grid(grid) + end subroutine deallocate_radial_grid_s +!--------------------------------------------------------------- + subroutine deallocate_radial_grid_v(grid) +!--------------------------------------------------------------- + type(radial_grid_type),intent(inout) :: grid(:) + integer :: n + do n = 1,size(grid) + if (associated(grid(n)%r)) deallocate(grid(n)%r) + if (associated(grid(n)%r2)) deallocate(grid(n)%r2) + if (associated(grid(n)%rab)) deallocate(grid(n)%rab) + if (associated(grid(n)%sqr)) deallocate(grid(n)%sqr) + if (associated(grid(n)%rm1)) deallocate(grid(n)%rm1) + if (associated(grid(n)%rm2)) deallocate(grid(n)%rm2) + if (associated(grid(n)%rm3)) deallocate(grid(n)%rm3) + grid(n)%mesh = 0 + enddo + !deallocate(grid) + end subroutine deallocate_radial_grid_v + +!--------------------------------------------------------------- + subroutine nullify_radial_grid(grid) +!--------------------------------------------------------------- + type(radial_grid_type),intent(inout) :: grid + nullify( & + grid%r, & + grid%r2, & ! the square of the radial mesh + grid%rab, & ! d r(x) / d x where x is the linear grid + grid%sqr, & ! the square root of the radial mesh + grid%rm1, & ! 1 / r + grid%rm2, & ! 1 / r**2 + grid%rm3 ) ! 1 / r**3 + grid%mesh = -1 + end subroutine nullify_radial_grid +! +!--------------------------------------------------------------- + subroutine do_mesh(rmax,zmesh,xmin,dx,ibound,grid) +!--------------------------------------------------------------- +! + use kinds, only : DP + implicit none + type(radial_grid_type),intent(out) :: grid + + integer, intent(in) :: ibound + real(DP),intent(in) :: rmax, zmesh, dx + real(DP),intent(inout):: xmin + + real(DP) :: xmax, x + integer :: mesh, i + ! + xmax=log(rmax*zmesh) + mesh=(xmax-xmin)/dx+1 + ! + ! mesh must be odd for simpson integration. + ! + mesh=2*(mesh/2)+1 + if(mesh+1 > ndmx) call errore('do_mesh','ndmx is too small',1) + if(ibound == 1) xmin=xmax-dx*(mesh-1) + ! + call deallocate_radial_grid(grid) + call allocate_radial_grid(grid,mesh) + ! + do i=1,mesh + x=xmin+DBLE(i-1)*dx + grid%r(i) = exp(x)/zmesh + grid%r2(i) = grid%r(i)*grid%r(i) + grid%rab(i) = grid%r(i)*dx + grid%sqr(i) = sqrt(grid%r(i)) + grid%rm1(i) = 1._dp/grid%r(i) + grid%rm2(i) = 1._dp/grid%r(i)**2 + grid%rm3(i) = 1._dp/grid%r(i)**3 + end do + ! + grid%mesh = mesh + grid%dx = dx + grid%xmin = xmin + grid%rmax = rmax + grid%zmesh = zmesh + + return + end subroutine do_mesh +! +! check that logarithmic grid is consistently set +!--------------------------------------------------------------- + subroutine check_mesh(grid) +!--------------------------------------------------------------- +! + use kinds, only : DP + use constants, only : eps8 + implicit none + type(radial_grid_type),intent(in) :: grid + integer :: i + + if (grid%mesh < 0 ) call errore('check_mesh','grid%mesh < 0 ',1) + do i=1,grid%mesh + if (abs(grid%r2(i)/grid%r(i)**2-1.d0) > eps8 ) & + call errore('check_mesh',' r2(i) is different ',i) + if (abs(grid%sqr(i)/sqrt(grid%r(i))-1.d0) > eps8 ) & + call errore('check_mesh',' sqr(i) is different ',i) + if (abs(grid%rab(i)/(grid%r(i)*grid%dx)-1.d0) > eps8 ) & + call errore('check_mesh',' rab(i) is different ',i) + end do + + return + end subroutine check_mesh +! +! Solution of the Poisson's equation on a radial (logarithmic) grid +!--------------------------------------------------------------- +subroutine hartree(k,nst,mesh,grid,f,vh) + !--------------------------------------------------------------- + ! + use kinds, only : DP +! use radial_grids, only: radial_grid_type + implicit none + integer,intent(in):: & + k, & ! input: the k of the equation + nst, & ! input: at low r, f goes as r**nst + mesh ! input: the dimension of the mesh + + type(radial_grid_type), intent(in) :: & + grid ! input: the radial grid + real(DP), intent(in):: & + f(mesh) ! input: the 4\pi r2 \rho function + real(DP), intent(out):: & + vh(mesh) ! output: the required solution + ! + ! local variables + ! + integer :: & + k21, & ! 2k+1 + nk1, & ! nst-k-1 + ierr, & ! integer variable for allocation control + i ! counter + + real(DP):: & + c0,c2,c3, & ! coefficients of the polynomial expansion close to r=0 + ch, & ! dx squared / 12.0 + xkh2, & ! ch * f + ei, di, & ! auxiliary variables for the diagonal and + ! off diagonal elements of the matrix + f1, fn, & ! variables used for the boundary condition + vhim1, vhi ! variables for the right hand side + + real(DP), allocatable:: & + d(:), & ! the diagonal elements of + ! the tridiagonal sys. + e(:) ! the off diagonal elements + ! of the trid. sys. + ! + ! Allocate space for the diagonal and off diagonal elements + ! + if (mesh.ne.grid%mesh) call errore('hartree',' grid dimension mismatch',1) + allocate(d(mesh),stat=ierr) + allocate(e(mesh),stat=ierr) + + if (ierr.ne.0) call errore('hartree',' error allocating d or e',1) + ! + ! Find the series expansion of the solution close to r=0 + ! + k21=2*k+1 + nk1=nst-k-1 + if(nk1.le.0) then + write(6,100) k,nst +100 format(5x,'stop in "hartree": k=',i3,' nst=',i3) + stop + !else if(nk1.ge.4) then + ! not sure whether the following is really correct, but the above wasn't + else if(nk1.ge.3) then + c2=0.0_dp + c3=0.0_dp + else + e(1)=0.0_dp + do i=1,4 + d(i)=-k21*f(i)/grid%r(i)**nst + end do + call series(d,grid%r,grid%r2,e(nk1)) + c2=e(1)/(4.0_dp*k+6.0_dp) + c3=e(2)/(6.0_dp*k+12.0_dp) + end if + ! + ! Set the main auxiliary parameters + ! + ch=grid%dx*grid%dx/12.0_dp + xkh2=ch*(DBLE(k)+0.5_dp)**2 + ei=1.0_dp-xkh2 + di=-(2.0_dp+10.0_dp*xkh2) + ! + ! Set the diagonal and the off diagonal elements of the + ! linear system, compute a part of the right hand side + ! + do i=2,mesh + d(i)=-di + e(i)=-ei + vh(i)=k21*ch*grid%sqr(i)*f(i) + end do + ! + ! Use the boundary condition to eliminate the value of the + ! solution in the first point from the first equation. This + ! part for the diagonal element + ! + f1=(grid%sqr(1)/grid%sqr(2))**k21 + d(2)=d(2)-ei*f1 + ! + ! Use the boundary condition to eliminate the value of the + ! solution in the last point from the last equation + ! + fn=(grid%sqr(mesh-1)/grid%sqr(mesh))**k21 + d(mesh-1)=d(mesh-1)-ei*fn + ! + ! In the first point vh(1) has the same definition as in the other points + ! + vhim1=k21*ch*grid%sqr(1)*f(1) + ! + ! Compute the right hand side using the auxiliary quantity vh(i). + ! + do i=2,mesh-1 + vhi=vh(i) + vh(i)=vhim1+10.0_dp*vhi+vh(i+1) + vhim1=vhi + end do + ! + ! Use the boundary condition to eliminate the value of the solution in the + ! first point from the first equation. This part for the right hand side. + ! + vh(2)=vh(2)-ei*grid%sqr(1)**k21*(c2*(grid%r2(2)-grid%r2(1)) & + +c3*(grid%r(2)**3-grid%r(1)**3)) + ! + ! solve the linear system with lapack routine dptsv + ! + call dptsv(mesh-2,1,d(2),e(2),vh(2),mesh-2,ierr) + if (ierr.ne.0) call errore('hartree', 'error in lapack', ierr) + ! + ! Set the value of the solution at the first and last point + ! First, find c0 from the solution in the second point + ! + c0=vh(2)/grid%sqr(2)**k21-c2*grid%r2(2)-c3*grid%r(2)*grid%r2(2) + ! + ! and then use the series expansion at the first point + ! + vh(1)=grid%sqr(1)**k21*(c0+c2*grid%r2(1)+c3*grid%r(1)**3) + ! + ! the solution at the last point is given by the boundary + ! condition + ! + vh(mesh)=vh(mesh-1)*fn + ! + ! The solution must be divided by r (from the equation) + ! and multiplied by the square root of r (from the log + ! mesh transformation) + ! + do i=1,mesh + vh(i)= vh(i) / grid%sqr(i) + end do + + deallocate(e) + deallocate(d) + + return +end subroutine hartree +! +! simple routine returning the coefficient of the polynomial +! describing the leading behavior of a function f at small r. +!--------------------------------------------------------------- +subroutine series(f,r,r2,b) + !--------------------------------------------------------------- + ! + use kinds, only : DP + implicit none + real(DP):: dr21,dr31,dr32,dr41,dr42,dr43,df21,df32,df43, & + ddf42,ddf31 + real(DP):: f(4),r(4),r2(4),b(0:3) + dr21=r(2)-r(1) + dr31=r(3)-r(1) + dr32=r(3)-r(2) + dr41=r(4)-r(1) + dr42=r(4)-r(2) + dr43=r(4)-r(3) + df21=(f(2)-f(1))/dr21 + df32=(f(3)-f(2))/dr32 + df43=(f(4)-f(3))/dr43 + ddf42=(df43-df32)/dr42 + ddf31=(df32-df21)/dr31 + b(3)=(ddf42-ddf31)/dr41 + b(2)=ddf31-b(3)*(r(1)+r(2)+r(3)) + b(1)=df21-b(2)*(r(2)+r(1))-b(3)*(r2(1)+r2(2)+r(1)*r(2)) + b(0)=f(1)-r(1)*(b(1)+r(1)*(b(2)+r(1)*b(3))) + return +end subroutine series +!---------------------------------------------------------------------- +!---------------------------------------------------------------------- +! +! I/O routines +! +!---------------------------------------------------------------------- +subroutine write_grid_on_file(iunit,grid) +! use radial_grids, only: radial_grid_type + implicit none + type(radial_grid_type), intent(in) :: grid + integer, intent(in) :: iunit + integer :: n +! + WRITE(iunit,'(i8)') grid%mesh + WRITE(iunit,'(e20.10)') grid%dx + WRITE(iunit,'(e20.10)') grid%xmin + WRITE(iunit,'(e20.10)') grid%zmesh + WRITE(iunit,'(e20.10)') (grid%r(n), n=1,grid%mesh) + WRITE(iunit,'(e20.10)') (grid%r2(n), n=1,grid%mesh) + WRITE(iunit,'(e20.10)') (grid%sqr(n), n=1,grid%mesh) +! WRITE(iunit,'(e20.10)') (grid%rab(n), n=1,grid%mesh) + return +end subroutine write_grid_on_file + +subroutine read_grid_from_file(iunit,grid) +! use radial_grids, only: radial_grid_type + implicit none + type(radial_grid_type), intent(out) :: grid + integer, intent(in) :: iunit + integer :: n +! + READ(iunit,'(i8)') grid%mesh + READ(iunit,'(e20.10)') grid%dx + READ(iunit,'(e20.10)') grid%xmin + READ(iunit,'(e20.10)') grid%zmesh + READ(iunit,'(e20.10)') (grid%r(n), n=1,grid%mesh) + READ(iunit,'(e20.10)') (grid%r2(n), n=1,grid%mesh) + READ(iunit,'(e20.10)') (grid%sqr(n), n=1,grid%mesh) +! READ(iunit,'(e20.10)') (grid%rab(n), n=1,grid%mesh) + grid%rab(1:grid%mesh) = grid%r(1:grid%mesh) * grid%dx + grid%rm1(1:grid%mesh) = 1._dp/grid%r(1:grid%mesh) + grid%rm2(1:grid%mesh) = 1._dp/grid%r2(1:grid%mesh) + grid%rm3(1:grid%mesh) = 1._dp/grid%r(1:grid%mesh)**3 + + return +end subroutine read_grid_from_file + +!---------------------------------------------------------------------- +END MODULE radial_grids diff --git a/tests/apps/miniDFT/tests/src/random_numbers.f90 b/tests/apps/miniDFT/tests/src/random_numbers.f90 new file mode 100644 index 0000000000..93d81cae76 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/random_numbers.f90 @@ -0,0 +1,172 @@ +! +! Copyright (C) 2001-2008 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +!---------------------------------------------------------------------------- +MODULE random_numbers + !---------------------------------------------------------------------------- + ! + USE kinds, ONLY : DP + ! + IMPLICIT NONE + ! + INTERFACE gauss_dist + ! + MODULE PROCEDURE gauss_dist_scal, gauss_dist_vect + ! + END INTERFACE + ! + CONTAINS + ! + !------------------------------------------------------------------------ + FUNCTION randy ( irand ) + !------------------------------------------------------------------------ + ! + ! x=rand(n) : reseed with initial seed idum=n + ! if randy is not explicitly initialized, it will be + ! initialized with seed idum=0 the first time it is called + ! x=rand( ) : generate uniform real(DP) numbers x in [0,1] + ! + REAL(DP) :: randy + INTEGER, optional :: irand + ! + INTEGER , PARAMETER :: m = 714025, & + ia = 1366, & + ic = 150889, & + ntab = 97 + REAL(DP), PARAMETER :: rm = 1.0_DP / m + INTEGER :: j + INTEGER, SAVE :: ir(ntab), iy, idum=0 + LOGICAL, SAVE :: first=.true. + ! + IF ( present(irand) ) THEN + idum = irand + first=.true. + END IF + + IF ( first ) THEN + ! + first = .false. + idum = MOD( ic - idum, m ) + ! + DO j=1,ntab + idum=mod(ia*idum+ic,m) + ir(j)=idum + END DO + idum=mod(ia*idum+ic,m) + iy=idum + END IF + j=1+(ntab*iy)/m + IF( j > ntab .OR. j < 1 ) call errore('randy','j out of range',j) + iy=ir(j) + randy=iy*rm + idum=mod(ia*idum+ic,m) + ir(j)=idum + ! + RETURN + ! + END FUNCTION randy + ! + !------------------------------------------------------------------------ + SUBROUTINE set_random_seed ( ) + !------------------------------------------------------------------------ + ! + ! poor-man random seed for randy + ! + INTEGER, DIMENSION (8) :: itime + INTEGER :: iseed, irand + ! + CALL date_and_time ( values = itime ) + ! itime contains: year, month, day, time difference in minutes, hours, + ! minutes, seconds and milliseconds. + iseed = ( itime(8) + itime(6) ) * ( itime(7) + itime(4) ) + irand = randy ( iseed ) + ! + END SUBROUTINE set_random_seed + ! + !----------------------------------------------------------------------- + FUNCTION gauss_dist_scal( mu, sigma ) + !----------------------------------------------------------------------- + ! + ! ... this function generates a number taken from a normal + ! ... distribution of mean value \mu and variance \sigma + ! + IMPLICIT NONE + ! + REAL(DP), INTENT(IN) :: mu + REAL(DP), INTENT(IN) :: sigma + REAL(DP) :: gauss_dist_scal + ! + REAL(DP) :: x1, x2, w + ! + ! + gaussian_loop: DO + ! + x1 = 2.0_DP * randy() - 1.0_DP + x2 = 2.0_DP * randy() - 1.0_DP + ! + w = x1 * x1 + x2 * x2 + ! + IF ( w < 1.0_DP ) EXIT gaussian_loop + ! + END DO gaussian_loop + ! + w = SQRT( ( - 2.0_DP * LOG( w ) ) / w ) + ! + gauss_dist_scal = x1 * w * sigma + mu + ! + RETURN + ! + END FUNCTION gauss_dist_scal + ! + !----------------------------------------------------------------------- + FUNCTION gauss_dist_vect( mu, sigma, dim ) + !----------------------------------------------------------------------- + ! + ! ... this function generates an array of numbers taken from a normal + ! ... distribution of mean value \mu and variance \sigma + ! + IMPLICIT NONE + ! + REAL(DP), INTENT(IN) :: mu + REAL(DP), INTENT(IN) :: sigma + INTEGER, INTENT(IN) :: dim + REAL(DP) :: gauss_dist_vect( dim ) + ! + REAL(DP) :: x1, x2, w + INTEGER :: i + ! + ! + DO i = 1, dim, 2 + ! + gaussian_loop: DO + ! + x1 = 2.0_DP * randy() - 1.0_DP + x2 = 2.0_DP * randy() - 1.0_DP + ! + w = x1 * x1 + x2 * x2 + ! + IF ( w < 1.0_DP ) EXIT gaussian_loop + ! + END DO gaussian_loop + ! + w = SQRT( ( - 2.0_DP * LOG( w ) ) / w ) + ! + gauss_dist_vect(i) = x1 * w * sigma + ! + IF ( i >= dim ) EXIT + ! + gauss_dist_vect(i+1) = x2 * w * sigma + ! + END DO + ! + gauss_dist_vect(:) = gauss_dist_vect(:) + mu + ! + RETURN + ! + END FUNCTION gauss_dist_vect + ! +END MODULE random_numbers diff --git a/tests/apps/miniDFT/tests/src/read_cards.f90 b/tests/apps/miniDFT/tests/src/read_cards.f90 new file mode 100644 index 0000000000..65be0a708a --- /dev/null +++ b/tests/apps/miniDFT/tests/src/read_cards.f90 @@ -0,0 +1,1534 @@ +! +! Copyright (C) 2002-2011 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +!--------------------------------------------------------------------------- +MODULE read_cards_module + !--------------------------------------------------------------------------- + ! + ! ... This module handles the reading of cards from standard input + ! ... Original version written by Carlo Cavazzoni + ! + USE kinds, ONLY : DP + USE io_global, ONLY : stdout + USE constants, ONLY : angstrom_au + USE parser, ONLY : field_count, read_line, get_field, parse_unit + USE io_global, ONLY : ionode, ionode_id + ! + USE input_parameters + ! + IMPLICIT NONE + ! + SAVE + ! + PRIVATE + ! + PUBLIC :: read_cards + ! + ! ... end of module-scope declarations + ! + ! ---------------------------------------------- + ! +CONTAINS + ! + ! ... Read CARDS .... + ! + ! ... subroutines + ! + !---------------------------------------------------------------------- + SUBROUTINE card_default_values( ) + !---------------------------------------------------------------------- + ! + ! + IMPLICIT NONE + ! + ! + ! ... mask that control the printing of selected Kohn-Sham occupied + ! ... orbitals, default allocation + ! + CALL allocate_input_iprnks( 0, nspin ) + nprnks = 0 + ! + ! ... Simulation cell from standard input + ! + trd_ht = .false. + rd_ht = 0.0_DP + ! + ! ... dipole + ! + tdipole_card = .false. + ! + ! ... Constraints + ! + nconstr_inp = 0 + constr_tol_inp = 1.E-6_DP + ! + ! ... ionic mass initialization + ! + atom_mass = 0.0_DP + ! + ! ... dimension of the real space Ewald summation + ! + iesr_inp = 1 + ! + ! ... k-points + ! + k_points = 'gamma' + tk_inp = .false. + nkstot = 1 + nk1 = 0 + nk2 = 0 + nk3 = 0 + k1 = 0 + k2 = 0 + k3 = 0 + ! + ! ... Electronic states + ! + tf_inp = .false. + ! + ! ... ion_velocities + ! + tavel = .false. + ! + ! + RETURN + ! + END SUBROUTINE card_default_values + ! + ! + !---------------------------------------------------------------------- + SUBROUTINE read_cards ( prog, unit ) + !---------------------------------------------------------------------- + ! + ! + IMPLICIT NONE + ! + INTEGER, INTENT(IN), optional :: unit + ! + CHARACTER(len=2) :: prog ! calling program ( PW, CP, WA ) + CHARACTER(len=256) :: input_line + CHARACTER(len=80) :: card + CHARACTER(len=1), EXTERNAL :: capital + LOGICAL :: tend + INTEGER :: i + ! + INTEGER :: unit_loc=5 + ! + ! + if(present(unit)) unit_loc = unit + parse_unit = unit_loc + ! + CALL card_default_values( ) + ! +100 CALL read_line( input_line, end_of_file=tend ) + ! + IF( tend ) GOTO 120 + IF( input_line == ' ' .or. input_line(1:1) == '#' ) GOTO 100 + ! + READ (input_line, *) card + ! + DO i = 1, len_trim( input_line ) + input_line( i : i ) = capital( input_line( i : i ) ) + ENDDO + ! + IF ( trim(card) == 'ATOMIC_SPECIES' ) THEN + ! + CALL card_atomic_species( input_line, prog ) + ! + ELSEIF ( trim(card) == 'ATOMIC_POSITIONS' ) THEN + ! + CALL card_atomic_positions( input_line, prog ) + ! + ELSEIF ( trim(card) == 'ATOMIC_FORCES' ) THEN + ! + CALL card_atomic_forces( input_line, prog ) + ! + ELSEIF ( trim(card) == 'CONSTRAINTS' ) THEN + ! + CALL card_constraints( input_line ) + ! + ELSEIF ( trim(card) == 'DIPOLE' ) THEN + ! + CALL card_dipole( input_line ) + IF ( prog == 'PW' .and. ionode ) & + WRITE( stdout,'(A)') 'Warning: card '//trim(input_line)//' ignored' + ! + ELSEIF ( trim(card) == 'ESR' ) THEN + ! + CALL card_esr( input_line ) + IF ( prog == 'PW' .and. ionode ) & + WRITE( stdout,'(A)') 'Warning: card '//trim(input_line)//' ignored' + ! + ELSEIF ( trim(card) == 'K_POINTS' ) THEN + ! + IF ( ( prog == 'CP' ) ) THEN + IF( ionode ) & + WRITE( stdout,'(A)') 'Warning: card '//trim(input_line)//' ignored' + ELSE + CALL card_kpoints( input_line ) + ENDIF + ! + ELSEIF ( trim(card) == 'OCCUPATIONS' ) THEN + ! + CALL card_occupations( input_line ) + ! + ELSEIF ( trim(card) == 'CELL_PARAMETERS' ) THEN + ! + CALL card_cell_parameters( input_line ) + ! + ELSEIF ( trim(card) == 'ATOMIC_VELOCITIES' ) THEN + ! + CALL card_ion_velocities( input_line ) + IF ( prog == 'CP' .and. ionode ) & + WRITE( stdout,'(A)') 'Warning: card '//trim(input_line)//' ignored' + ! + ELSEIF ( trim(card) == 'KSOUT' ) THEN + ! + CALL card_ksout( input_line ) + IF ( ( prog == 'PW' ) .and. ionode ) & + WRITE( stdout,'(a)') 'Warning: card '//trim(input_line)//' ignored' + ! + + ELSE + ! + IF ( ionode ) & + WRITE( stdout,'(A)') 'Warning: card '//trim(input_line)//' ignored' + ! + ENDIF + ! + ! ... END OF LOOP ... ! + ! + GOTO 100 + ! +120 CONTINUE + ! + RETURN + ! + END SUBROUTINE read_cards + + ! + ! ... Description of the allowed input CARDS + ! + !------------------------------------------------------------------------ + ! BEGIN manual + !---------------------------------------------------------------------- + ! + ! ATOMIC_SPECIES + ! + ! set the atomic species been read and their pseudopotential file + ! + ! Syntax: + ! + ! ATOMIC_SPECIE + ! label(1) mass(1) psfile(1) + ! ... ... ... + ! label(n) mass(n) psfile(n) + ! + ! Example: + ! + ! ATOMIC_SPECIES + ! O 16.0 O.BLYP.UPF + ! H 1.00 H.fpmd.UPF + ! + ! Where: + ! + ! label(i) ( character(len=4) ) label of the atomic species + ! mass(i) ( real ) atomic mass + ! ( in u.m.a, carbon mass is 12.0 ) + ! psfile(i) ( character(len=80) ) file name of the pseudopotential + ! + !---------------------------------------------------------------------- + ! END manual + !------------------------------------------------------------------------ + ! + SUBROUTINE card_atomic_species( input_line, prog ) + ! + IMPLICIT NONE + ! + CHARACTER(len=256) :: input_line + CHARACTER(len=2) :: prog + INTEGER :: is, ip, ierr + CHARACTER(len=4) :: lb_pos + CHARACTER(len=256) :: psfile + ! + ! + IF ( taspc ) THEN + CALL errore( ' card_atomic_species ', ' two occurrences', 2 ) + ENDIF + IF ( ntyp > nsx ) THEN + CALL errore( ' card_atomic_species ', ' nsp out of range ', ntyp ) + ENDIF + ! + DO is = 1, ntyp + ! + CALL read_line( input_line ) + READ( input_line, *, iostat=ierr ) lb_pos, atom_mass(is), psfile + CALL errore( ' card_atomic_species ', & + 'cannot read atomic specie from: '//trim(input_line), abs(ierr)) + atom_pfile(is) = trim( psfile ) + lb_pos = adjustl( lb_pos ) + atom_label(is) = trim( lb_pos ) + ! + DO ip = 1, is - 1 + IF ( atom_label(ip) == atom_label(is) ) THEN + CALL errore( ' card_atomic_species ', & + & ' two occurrences of the same atomic label ', is ) + ENDIF + ENDDO + ! + ENDDO + taspc = .true. + ! + RETURN + ! + END SUBROUTINE card_atomic_species + ! + ! + !------------------------------------------------------------------------ + ! BEGIN manual + !---------------------------------------------------------------------- + ! + ! ATOMIC_POSITIONS + ! + ! set the atomic positions in the cell + ! + ! Syntax: + ! + ! ATOMIC_POSITIONS (units_option) + ! label(1) tau(1,1) tau(2,1) tau(3,1) mbl(1,1) mbl(2,1) mbl(3,1) + ! label(2) tau(1,2) tau(2,2) tau(3,2) mbl(1,2) mbl(2,2) mbl(3,2) + ! ... ... ... ... ... + ! label(n) tau(1,n) tau(2,n) tau(3,n) mbl(1,3) mbl(2,3) mbl(3,3) + ! + ! Example: + ! + ! ATOMIC_POSITIONS (bohr) + ! O 0.0099 0.0099 0.0000 0 0 0 + ! H 1.8325 -0.2243 -0.0001 1 1 1 + ! H -0.2243 1.8325 0.0002 1 1 1 + ! + ! Where: + ! + ! units_option == crystal position are given in scaled units + ! units_option == bohr position are given in Bohr + ! units_option == angstrom position are given in Angstrom + ! units_option == alat position are given in units of alat + ! + ! label(k) ( character(len=4) ) atomic type + ! tau(:,k) ( real ) coordinates of the k-th atom + ! mbl(:,k) ( integer ) mbl(i,k) > 0 the i-th coord. of the + ! k-th atom is allowed to be moved + ! + !---------------------------------------------------------------------- + ! END manual + !------------------------------------------------------------------------ + ! + SUBROUTINE card_atomic_positions( input_line, prog ) + ! + USE wrappers, ONLY: feval_infix + ! + IMPLICIT NONE + ! + CHARACTER(len=256) :: input_line + CHARACTER(len=2) :: prog + CHARACTER(len=4) :: lb_pos + INTEGER :: ia, k, is, nfield, idx, rep_i + LOGICAL, EXTERNAL :: matches + LOGICAL :: tend + ! + INTEGER :: ifield, ierr + REAL(DP) :: field_value + CHARACTER(len=256) :: field_str, error_msg + ! + ! + IF ( tapos ) THEN + CALL errore( 'card_atomic_positions', 'two occurrences', 2 ) + ENDIF + IF ( .not. taspc ) THEN + CALL errore( 'card_atomic_positions', & + & 'ATOMIC_SPECIES must be present before', 2 ) + ENDIF + IF ( ntyp > nsx ) THEN + CALL errore( 'card_atomic_positions', 'nsp out of range', ntyp ) + ENDIF + IF ( nat < 1 ) THEN + CALL errore( 'card_atomic_positions', 'nat out of range', nat ) + ENDIF + ! + CALL allocate_input_ions(ntyp,nat) + ! + if_pos = 1 + ! + sp_pos = 0 + rd_pos = 0.0_DP + na_inp = 0 + ! + IF ( matches( "CRYSTAL", input_line ) ) THEN + atomic_positions = 'crystal' + ELSEIF ( matches( "BOHR", input_line ) ) THEN + atomic_positions = 'bohr' + ELSEIF ( matches( "ANGSTROM", input_line ) ) THEN + atomic_positions = 'angstrom' + ELSEIF ( matches( "ALAT", input_line ) ) THEN + atomic_positions = 'alat' + ELSE + IF ( trim( adjustl( input_line ) ) /= 'ATOMIC_POSITIONS' ) THEN + CALL errore( 'read_cards ', & + & 'unknown option for ATOMIC_POSITION: '& + & // input_line, 1 ) + ENDIF + IF ( prog == 'CP' ) atomic_positions = 'bohr' + IF ( prog == 'PW' ) atomic_positions = 'alat' + ENDIF + ! + reader_loop : DO ia = 1,nat,1 + ! + CALL read_line( input_line, end_of_file = tend ) + IF ( tend ) CALL errore( 'read_cards', & + 'end of file reading atomic positions', ia ) + ! + CALL field_count( nfield, input_line ) + ! + IF ( sic /= 'none' .and. nfield /= 8 ) & + CALL errore( 'read_cards', & + 'ATOMIC_POSITIONS with sic, 8 columns required', 1 ) + ! + IF ( nfield /= 4 .and. nfield /= 7 .and. nfield /= 8) & + CALL errore( 'read_cards', 'wrong number of columns ' // & + & 'in ATOMIC_POSITIONS', ia ) + + ! read atom symbol (column 1) and coordinate + CALL get_field(1, lb_pos, input_line) + lb_pos = trim(lb_pos) + ! + error_msg = 'Error while parsing atomic position card.' + ! read field 2 (atom X coordinate) + CALL get_field(2, field_str, input_line) + rd_pos(1,ia) = feval_infix(ierr, field_str ) + CALL errore('card_atomic_positions', error_msg, ierr) + ! read field 2 (atom Y coordinate) + CALL get_field(3, field_str, input_line) + rd_pos(2,ia) = feval_infix(ierr, field_str ) + CALL errore('card_atomic_positions', error_msg, ierr) + ! read field 2 (atom Z coordinate) + CALL get_field(4, field_str, input_line) + rd_pos(3,ia) = feval_infix(ierr, field_str ) + CALL errore('card_atomic_positions', error_msg, ierr) + ! + IF ( nfield >= 7 ) THEN + ! read constrains (fields 5-7, if present) + CALL get_field(5, field_str, input_line) + READ(field_str, *) if_pos(1,ia) + CALL get_field(6, field_str, input_line) + READ(field_str, *) if_pos(2,ia) + CALL get_field(7, field_str, input_line) + READ(field_str, *) if_pos(3,ia) + ENDIF + ! + IF ( nfield == 8 ) THEN + CALL get_field(5, field_str, input_line) + READ(field_str, *) id_loc(ia) + ENDIF + ! + match_label: DO is = 1, ntyp + ! + IF ( trim(lb_pos) == trim( atom_label(is) ) ) THEN + ! + sp_pos(ia) = is + exit match_label + ! + ENDIF + ! + ENDDO match_label + ! + IF( ( sp_pos(ia) < 1 ) .or. ( sp_pos(ia) > ntyp ) ) THEN + ! + CALL errore( 'read_cards', 'species '//trim(lb_pos)// & + & ' in ATOMIC_POSITIONS is nonexistent', ia ) + ! + ENDIF + ! + is = sp_pos(ia) + ! + na_inp(is) = na_inp(is) + 1 + ! + ENDDO reader_loop + ! + tapos = .true. + ! + + RETURN + ! + END SUBROUTINE card_atomic_positions + ! + !------------------------------------------------------------------------ + ! BEGIN manual + !---------------------------------------------------------------------- + ! + ! ATOMIC_FORCES + ! + ! read external forces (in atomic units) from standard input + ! + ! Syntax: + ! + ! ATOMIC_FORCES + ! label Fx(1) Fy(1) Fz(1) + ! ..... + ! label Fx(n) Fy(n) Fz(n) + ! + ! Example: + ! + ! ??? + ! + ! Where: + ! + ! label (character(len=4)) atomic label + ! Fx(:), Fy(:) and Fz(:) (REAL) x, y and z component of the external force + ! acting on the ions whose coordinate are given + ! in the same line in card ATOMIC_POSITION + ! + !---------------------------------------------------------------------- + ! END manual + !------------------------------------------------------------------------ + ! + SUBROUTINE card_atomic_forces( input_line, prog ) + ! + IMPLICIT NONE + ! + CHARACTER(len=256) :: input_line + CHARACTER(len=2) :: prog + INTEGER :: ia, k, nfield + CHARACTER(len=4) :: lb + ! + ! + IF( tforces ) THEN + CALL errore( ' card_atomic_forces ', ' two occurrences ', 2 ) + ENDIF + ! + IF( .not. taspc ) THEN + CALL errore( ' card_atomic_forces ', & + & ' ATOMIC_SPECIES must be present before ', 2 ) + ENDIF + ! + rd_for = 0.0_DP + ! + DO ia = 1, nat + ! + CALL read_line( input_line ) + CALL field_count( nfield, input_line ) + IF ( nfield == 4 ) THEN + READ(input_line,*) lb, ( rd_for(k,ia), k = 1, 3 ) + ELSEIF( nfield == 3 ) THEN + READ(input_line,*) ( rd_for(k,ia), k = 1, 3 ) + ELSE + CALL errore( ' iosys ', ' wrong entries in ATOMIC_FORCES ', ia ) + ENDIF + ! + ENDDO + ! + tforces = .true. + ! + RETURN + ! + END SUBROUTINE card_atomic_forces + ! + ! + !------------------------------------------------------------------------ + ! BEGIN manual + !---------------------------------------------------------------------- + ! + ! K_POINTS + ! + ! use the specified set of k points + ! + ! Syntax: + ! + ! K_POINTS (mesh_option) + ! n + ! xk(1,1) xk(2,1) xk(3,1) wk(1) + ! ... ... ... ... + ! xk(1,n) xk(2,n) xk(3,n) wk(n) + ! + ! Example: + ! + ! K_POINTS + ! 10 + ! 0.1250000 0.1250000 0.1250000 1.00 + ! 0.1250000 0.1250000 0.3750000 3.00 + ! 0.1250000 0.1250000 0.6250000 3.00 + ! 0.1250000 0.1250000 0.8750000 3.00 + ! 0.1250000 0.3750000 0.3750000 3.00 + ! 0.1250000 0.3750000 0.6250000 6.00 + ! 0.1250000 0.3750000 0.8750000 6.00 + ! 0.1250000 0.6250000 0.6250000 3.00 + ! 0.3750000 0.3750000 0.3750000 1.00 + ! 0.3750000 0.3750000 0.6250000 3.00 + ! + ! Where: + ! + ! mesh_option == automatic k points mesh is generated automatically + ! with Monkhorst-Pack algorithm + ! mesh_option == crystal k points mesh is given in stdin in scaled + ! units + ! mesh_option == tpiba k points mesh is given in stdin in units + ! of ( 2 PI / alat ) + ! mesh_option == gamma only gamma point is used ( default in + ! CPMD simulation ) + ! mesh_option == tpiba_b as tpiba but the weights gives the + ! number of points between this point + ! and the next + ! mesh_option == crystal_b as crystal but the weights gives the + ! number of points between this point and + ! the next + ! + ! n ( integer ) number of k points + ! xk(:,i) ( real ) coordinates of i-th k point + ! wk(i) ( real ) weights of i-th k point + ! + !---------------------------------------------------------------------- + ! END manual + !------------------------------------------------------------------------ + ! + SUBROUTINE card_kpoints( input_line ) + ! + IMPLICIT NONE + ! + CHARACTER(len=256) :: input_line + INTEGER :: i, j + INTEGER :: nkaux + INTEGER, ALLOCATABLE :: wkaux(:) + REAL(DP), ALLOCATABLE :: xkaux(:,:) + REAL(DP) :: delta, wk0 + LOGICAL, EXTERNAL :: matches + LOGICAL :: tend,terr + LOGICAL :: kband = .false. + ! + ! + IF ( tkpoints ) THEN + CALL errore( ' card_kpoints ', ' two occurrences', 2 ) + ENDIF + ! + IF ( matches( "AUTOMATIC", input_line ) ) THEN + ! automatic generation of k-points + k_points = 'automatic' + ELSEIF ( matches( "CRYSTAL", input_line ) ) THEN + ! input k-points are in crystal (reciprocal lattice) axis + k_points = 'crystal' + IF ( matches( "_B", input_line ) ) kband=.true. + ELSEIF ( matches( "TPIBA", input_line ) ) THEN + ! input k-points are in 2pi/a units + k_points = 'tpiba' + IF ( matches( "_B", input_line ) ) kband=.true. + ELSEIF ( matches( "GAMMA", input_line ) ) THEN + ! Only Gamma (k=0) is used + k_points = 'gamma' + ELSE + ! by default, input k-points are in 2pi/a units + k_points = 'tpiba' + ENDIF + ! + IF ( k_points == 'automatic' ) THEN + ! + ! ... automatic generation of k-points + ! + nkstot = 0 + CALL read_line( input_line, end_of_file = tend, error = terr ) + IF (tend) GOTO 10 + IF (terr) GOTO 20 + READ(input_line, *, END=10, ERR=20) nk1, nk2, nk3, k1, k2 ,k3 + IF ( k1 < 0 .or. k1 > 1 .or. & + k2 < 0 .or. k2 > 1 .or. & + k3 < 0 .or. k3 > 1 ) CALL errore & + ('card_kpoints', 'invalid offsets: must be 0 or 1', 1) + IF ( nk1 <= 0 .or. nk2 <= 0 .or. nk3 <= 0 ) CALL errore & + ('card_kpoints', 'invalid values for nk1, nk2, nk3', 1) + ALLOCATE ( xk(3,1), wk(1) ) ! prevents problems with debug flags + ! ! when init_startk is called in iosys + ELSEIF ( ( k_points == 'tpiba' ) .or. ( k_points == 'crystal' ) ) THEN + ! + ! ... input k-points are in 2pi/a units + ! + CALL read_line( input_line, end_of_file = tend, error = terr ) + IF (tend) GOTO 10 + IF (terr) GOTO 20 + READ(input_line, *, END=10, ERR=20) nkstot + ! + IF (.NOT. kband) THEN + ALLOCATE ( xk(3, nkstot), wk(nkstot) ) + DO i = 1, nkstot + CALL read_line( input_line, end_of_file = tend, error = terr ) + IF (tend) GOTO 10 + IF (terr) GOTO 20 + READ(input_line,*, END=10, ERR=20) xk(1,i),xk(2,i),xk(3,i),wk(i) + ENDDO + ELSE + nkaux=nkstot + ALLOCATE(xkaux(3,nkstot), wkaux(nkstot)) + DO i = 1, nkstot + CALL read_line( input_line, end_of_file = tend, error = terr ) + IF (tend) GOTO 10 + IF (terr) GOTO 20 + READ(input_line,*, END=10, ERR=20) xkaux(1,i), xkaux(2,i), & + xkaux(3,i), wk0 + wkaux(i) = NINT ( wk0 ) ! beware: wkaux is integer + ENDDO + ! Count k-points first + nkstot=0 + DO i=1,nkaux-1 + IF ( wkaux(i) > 0 ) THEN + nkstot=nkstot+wkaux(i) + ELSEIF ( wkaux(i) == 0 ) THEN + nkstot=nkstot+1 + ELSE + CALL errore ('card_kpoints', 'wrong number of points',i) + ENDIF + ENDDO + nkstot=nkstot+1 + ALLOCATE ( xk(3,nkstot), wk(nkstot) ) + ! Now fill the points + nkstot=0 + DO i=1,nkaux-1 + IF (wkaux(i)>0) THEN + delta=1.0_DP/wkaux(i) + DO j=0,wkaux(i)-1 + nkstot=nkstot+1 + xk(:,nkstot)=xkaux(:,i)+delta*j*(xkaux(:,i+1)-xkaux(:,i)) + wk(nkstot)=1.0_DP + ENDDO + ELSEIF (wkaux(i)==0) THEN + nkstot=nkstot+1 + xk(:,nkstot)=xkaux(:,i) + wk(nkstot)=1.0_DP + ELSE + CALL errore ('card_kpoints', 'wrong number of points',i) + ENDIF + ENDDO + nkstot=nkstot+1 + xk(:,nkstot)=xkaux(:,nkaux) + wk(nkstot)=1.0_DP + DEALLOCATE(xkaux) + DEALLOCATE(wkaux) + ENDIF + ! + ELSEIF ( k_points == 'gamma' ) THEN + ! + nkstot = 1 + ALLOCATE ( xk(3,1), wk(1) ) + xk(:,1) = 0.0_DP + wk(1) = 1.0_DP + ! + ENDIF + ! + tkpoints = .true. + tk_inp = .true. + ! + RETURN +10 CALL errore ('card_kpoints', ' end of file while reading ' & + & // trim(k_points) // ' k points', 1) +20 CALL errore ('card_kpoints', ' error while reading ' & + & // trim(k_points) // ' k points', 1) + ! + END SUBROUTINE card_kpoints + ! + !------------------------------------------------------------------------ + ! BEGIN manual + !---------------------------------------------------------------------- + ! + ! OCCUPATIONS + ! + ! use the specified occupation numbers for electronic states. + ! Note that you should specify 10 values per line maximum! + ! + ! Syntax (nspin == 1): + ! + ! OCCUPATIONS + ! f(1) .... .... f(10) + ! f(11) .... f(nbnd) + ! + ! Syntax (nspin == 2): + ! + ! OCCUPATIONS + ! u(1) .... .... u(10) + ! u(11) .... u(nbnd) + ! d(1) .... .... d(10) + ! d(11) .... d(nbnd) + ! + ! Example: + ! + ! OCCUPATIONS + ! 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 + ! 2.0 2.0 2.0 2.0 2.0 1.0 1.0 + ! + ! Where: + ! + ! f(:) (real) these are the occupation numbers + ! for LDA electronic states. + ! + ! u(:) (real) these are the occupation numbers + ! for LSD spin == 1 electronic states + ! d(:) (real) these are the occupation numbers + ! for LSD spin == 2 electronic states + ! + ! Note, maximum 10 values per line! + ! + !---------------------------------------------------------------------- + ! END manual + !------------------------------------------------------------------------ + ! + SUBROUTINE card_occupations( input_line ) + ! + USE wrappers, ONLY: feval_infix + ! + IMPLICIT NONE + ! + CHARACTER(len=256) :: input_line, field_str + INTEGER :: is, nx10, i, j, nspin0 + INTEGER :: nfield, nbnd_read, nf, ierr + LOGICAL :: tef + ! + ! + IF ( tocc ) THEN + CALL errore( ' card_occupations ', ' two occurrences', 2 ) + ENDIF + nspin0=nspin + IF (nspin == 4) nspin0=1 + ! + ALLOCATE ( f_inp ( nbnd, nspin0 ) ) + DO is = 1, nspin0 + ! + nbnd_read = 0 + DO WHILE ( nbnd_read < nbnd) + CALL read_line( input_line, end_of_file=tef ) + IF (tef) CALL errore('card_occupations',& + 'Missing occupations, end of file reached',1) + CALL field_count( nfield, input_line ) + ! + DO nf = 1,nfield + nbnd_read = nbnd_read+1 + IF (nbnd_read > nbnd ) EXIT + CALL get_field(nf, field_str, input_line) + ! + f_inp(nbnd_read,is) = feval_infix(ierr, field_str ) + CALL errore('card_occupations',& + 'Error parsing occupation: '//trim(field_str), nbnd_read*ierr) + ENDDO + ENDDO + ! + ENDDO + ! + tf_inp = .true. + tocc = .true. + ! + RETURN + ! + END SUBROUTINE card_occupations + ! + !------------------------------------------------------------------------ + ! BEGIN manual + !---------------------------------------------------------------------- + ! + ! DIPOLE + ! + ! calculate polarizability + ! + ! Syntax: + ! + ! DIPOLE + ! + ! Where: + ! + ! no parameters + ! + !---------------------------------------------------------------------- + ! END manual + !------------------------------------------------------------------------ + ! + SUBROUTINE card_dipole( input_line ) + ! + IMPLICIT NONE + ! + CHARACTER(len=256) :: input_line + ! + ! + IF ( tdipole ) THEN + CALL errore( ' card_dipole ', ' two occurrences', 2 ) + ENDIF + ! + tdipole_card = .true. + tdipole = .true. + ! + RETURN + ! + END SUBROUTINE card_dipole + ! + ! + !------------------------------------------------------------------------ + ! BEGIN manual + !---------------------------------------------------------------------- + ! + ! IESR + ! + ! use the specified number of neighbour cells for Ewald summations + ! + ! Syntax: + ! + ! ESR + ! iesr + ! + ! Example: + ! + ! ESR + ! 3 + ! + ! Where: + ! + ! iesr (integer) determines the number of neighbour cells to be + ! considered: + ! iesr = 1 : nearest-neighbour cells (default) + ! iesr = 2 : next-to-nearest-neighbour cells + ! and so on + ! + !---------------------------------------------------------------------- + ! END manual + !------------------------------------------------------------------------ + ! + SUBROUTINE card_esr( input_line ) + ! + IMPLICIT NONE + ! + CHARACTER(len=256) :: input_line + ! + IF ( tesr ) THEN + CALL errore( ' card_esr ', ' two occurrences', 2 ) + ENDIF + CALL read_line( input_line ) + READ(input_line,*) iesr_inp + ! + tesr = .true. + ! + RETURN + ! + END SUBROUTINE card_esr + ! + ! + !------------------------------------------------------------------------ + ! BEGIN manual + !---------------------------------------------------------------------- + ! + ! CELL_PARAMETERS + ! + ! use the specified cell dimensions + ! + ! Syntax: + ! + ! CELL_PARAMETERS + ! HT(1,1) HT(1,2) HT(1,3) + ! HT(2,1) HT(2,2) HT(2,3) + ! HT(3,1) HT(3,2) HT(3,3) + ! + ! Example: + ! + ! CELL_PARAMETERS + ! 24.50644311 0.00004215 -0.14717844 + ! -0.00211522 8.12850030 1.70624903 + ! 0.16447787 0.74511792 23.07395418 + ! + ! Where: + ! + ! HT(i,j) (real) cell dimensions ( in a.u. ), + ! note the relation with lattice vectors: + ! HT(1,:) = A1, HT(2,:) = A2, HT(3,:) = A3 + ! + !---------------------------------------------------------------------- + ! END manual + !------------------------------------------------------------------------ + ! + SUBROUTINE card_cell_parameters( input_line ) + ! + IMPLICIT NONE + ! + CHARACTER(len=256) :: input_line + INTEGER :: i, j + LOGICAL, EXTERNAL :: matches + ! + ! + IF ( tcell ) THEN + CALL errore( ' card_cell_parameters ', ' two occurrences', 2 ) + ENDIF + ! + IF ( matches( "BOHR", input_line ) ) THEN + cell_units = 'bohr' + ELSEIF ( matches( "ANGSTROM", input_line ) ) THEN + cell_units = 'angstrom' + ELSE + cell_units = 'alat' + ENDIF + ! + DO i = 1, 3 + CALL read_line( input_line ) + READ(input_line,*) ( rd_ht( i, j ), j = 1, 3 ) + ENDDO + ! + trd_ht = .true. + tcell = .true. + ! + RETURN + ! + END SUBROUTINE card_cell_parameters + ! + ! + !------------------------------------------------------------------------ + ! BEGIN manual + !---------------------------------------------------------------------- + ! + ! ATOMIC_VELOCITIES + ! + ! read velocities (in atomic units) from standard input + ! + ! Syntax: + ! + ! ATOMIC_VELOCITIES + ! label(1) Vx(1) Vy(1) Vz(1) + ! .... + ! label(n) Vx(n) Vy(n) Vz(n) + ! + ! Example: + ! + ! ??? + ! + ! Where: + ! + ! label (character(len=4)) atomic label + ! Vx(:), Vy(:) and Vz(:) (REAL) x, y and z velocity components of + ! the ions + ! + !---------------------------------------------------------------------- + ! END manual + !------------------------------------------------------------------------ + ! + SUBROUTINE card_ion_velocities( input_line ) + ! + IMPLICIT NONE + ! + CHARACTER(len=256) :: input_line + INTEGER :: ia, k, is, nfield + CHARACTER(len=4) :: lb_vel + ! + ! + IF( tionvel ) THEN + CALL errore( ' card_ion_velocities ', ' two occurrences', 2 ) + ENDIF + ! + IF( .not. taspc ) THEN + CALL errore( ' card_ion_velocities ', & + & ' ATOMIC_SPECIES must be present before ', 2 ) + ENDIF + ! + rd_vel = 0.0_DP + sp_vel = 0 + ! + IF ( ion_velocities == 'from_input' ) THEN + ! + tavel = .true. + ! + DO ia = 1, nat + ! + CALL read_line( input_line ) + CALL field_count( nfield, input_line ) + IF ( nfield == 4 ) THEN + READ(input_line,*) lb_vel, ( rd_vel(k,ia), k = 1, 3 ) + ELSE + CALL errore( ' iosys ', & + & ' wrong entries in ION_VELOCITIES ', ia ) + ENDIF + ! + match_label: DO is = 1, ntyp + IF ( trim( lb_vel ) == atom_label(is) ) THEN + sp_vel(ia) = is + exit match_label + ENDIF + ENDDO match_label + ! + IF ( sp_vel(ia) < 1 .or. sp_vel(ia) > ntyp ) THEN + CALL errore( ' iosys ', ' wrong LABEL in ION_VELOCITIES ', ia ) + ENDIF + ! + ENDDO + ! + ENDIF + ! + tionvel = .true. + ! + RETURN + ! + END SUBROUTINE + ! + !------------------------------------------------------------------------ + ! BEGIN manual + !---------------------------------------------------------------------- + ! + ! CONSTRAINTS + ! + ! Ionic Constraints + ! + ! Syntax: + ! + ! CONSTRAINTS + ! NCONSTR CONSTR_TOL + ! CONSTR_TYPE(.) CONSTR(1,.) CONSTR(2,.) ... { CONSTR_TARGET(.) } + ! + ! Where: + ! + ! NCONSTR(INTEGER) number of constraints + ! + ! CONSTR_TOL tolerance for keeping the constraints + ! satisfied + ! + ! CONSTR_TYPE(.) type of constrain: + ! 1: for fixed distances ( two atom indexes must + ! be specified ) + ! 2: for fixed planar angles ( three atom indexes + ! must be specified ) + ! + ! CONSTR(1,.) CONSTR(2,.) ... + ! + ! indices object of the constraint, as + ! they appear in the 'POSITION' CARD + ! + ! CONSTR_TARGET target for the constrain ( in the case of + ! planar angles it is the COS of the angle ). + ! this variable is optional. + ! + !---------------------------------------------------------------------- + ! END manual + !------------------------------------------------------------------------ + ! + SUBROUTINE card_constraints( input_line ) + ! + IMPLICIT NONE + ! + CHARACTER(len=256) :: input_line + INTEGER :: i, nfield + ! + ! + IF ( tconstr ) CALL errore( 'card_constraints', 'two occurrences', 2 ) + ! + CALL read_line( input_line ) + ! + CALL field_count( nfield, input_line ) + ! + IF ( nfield == 1 ) THEN + ! + READ( input_line, * ) nconstr_inp + ! + ELSEIF ( nfield == 2 ) THEN + ! + READ( input_line, * ) nconstr_inp, constr_tol_inp + ! + ELSE + ! + CALL errore( 'card_constraints', 'too many fields', nfield ) + ! + ENDIF + WRITE(stdout,'(5x,a,i4,a,f12.6)') & + 'Reading',nconstr_inp,' constraints; tolerance:', constr_tol_inp + ! + CALL allocate_input_constr() + ! + DO i = 1, nconstr_inp + ! + CALL read_line( input_line ) + ! + READ( input_line, * ) constr_type_inp(i) + ! + CALL field_count( nfield, input_line ) + ! + IF ( nfield > nc_fields + 2 ) & + CALL errore( 'card_constraints', & + 'too many fields for this constraint', i ) + ! + SELECT CASE( constr_type_inp(i) ) + CASE( 'type_coord', 'atom_coord' ) + ! + IF ( nfield == 5 ) THEN + ! + READ( input_line, * ) constr_type_inp(i), & + constr_inp(1,i), & + constr_inp(2,i), & + constr_inp(3,i), & + constr_inp(4,i) + ! + WRITE(stdout,'(7x,i3,a,i3,a,i2,a,2f12.6)') i, & + ') '//constr_type_inp(i)(1:4),int(constr_inp(1,i)) ,& + ' coordination wrt type:', int(constr_inp(2,i)), & + ' cutoff distance and smoothing:', constr_inp(3:4,i) + ELSEIF ( nfield == 6 ) THEN + ! + READ( input_line, * ) constr_type_inp(i), & + constr_inp(1,i), & + constr_inp(2,i), & + constr_inp(3,i), & + constr_inp(4,i), & + constr_target_inp(i) + ! + constr_target_set(i) = .true. + ! + WRITE(stdout,'(7x,i3,a,i3,a,i2,a,2f12.6,a,f12.6)') i, & + ') '//constr_type_inp(i)(1:4),int(constr_inp(1,i)) , & + ' coordination wrt type:', int(constr_inp(2,i)), & + ' cutoff distance and smoothing:', constr_inp(3:4,i), & + '; target:', constr_target_inp(i) + ELSE + ! + CALL errore( 'card_constraints', 'type_coord, ' // & + & 'atom_coord: wrong number of fields', nfield ) + ! + ENDIF + ! + CASE( 'distance' ) + ! + IF ( nfield == 3 ) THEN + ! + READ( input_line, * ) constr_type_inp(i), & + constr_inp(1,i), & + constr_inp(2,i) + ! + WRITE(stdout,'(7x,i3,a,2i3)') & + i,') distance between atoms: ', int(constr_inp(1:2,i)) + ELSEIF ( nfield == 4 ) THEN + ! + READ( input_line, * ) constr_type_inp(i), & + constr_inp(1,i), & + constr_inp(2,i), & + constr_target_inp(i) + ! + constr_target_set(i) = .true. + ! + WRITE(stdout,'(7x,i3,a,2i3,a,f12.6)') i, & + ') distance between atoms: ', int(constr_inp(1:2,i)), & + '; target:', constr_target_inp(i) + ELSE + ! + CALL errore( 'card_constraints', & + & 'distance: wrong number of fields', nfield ) + ! + ENDIF + ! + CASE( 'planar_angle' ) + ! + IF ( nfield == 4 ) THEN + ! + READ( input_line, * ) constr_type_inp(i), & + constr_inp(1,i), & + constr_inp(2,i), & + constr_inp(3,i) + ! + WRITE(stdout, '(7x,i3,a,3i3)') & + i,') planar angle between atoms: ', int(constr_inp(1:3,i)) + ELSEIF ( nfield == 5 ) THEN + ! + READ( input_line, * ) constr_type_inp(i), & + constr_inp(1,i), & + constr_inp(2,i), & + constr_inp(3,i), & + constr_target_inp(i) + ! + constr_target_set(i) = .true. + ! + WRITE(stdout, '(7x,i3,a,3i3,a,f12.6)') i, & + ') planar angle between atoms: ', int(constr_inp(1:3,i)), & + '; target:', constr_target_inp(i) + ELSE + ! + CALL errore( 'card_constraints', & + & 'planar_angle: wrong number of fields', nfield ) + ! + ENDIF + ! + CASE( 'torsional_angle' ) + ! + IF ( nfield == 5 ) THEN + ! + READ( input_line, * ) constr_type_inp(i), & + constr_inp(1,i), & + constr_inp(2,i), & + constr_inp(3,i), & + constr_inp(4,i) + ! + WRITE(stdout, '(7x,i3,a,4i3)') & + i,') torsional angle between atoms: ', int(constr_inp(1:4,i)) + ELSEIF ( nfield == 6 ) THEN + ! + READ( input_line, * ) constr_type_inp(i), & + constr_inp(1,i), & + constr_inp(2,i), & + constr_inp(3,i), & + constr_inp(4,i), & + constr_target_inp(i) + ! + constr_target_set(i) = .true. + ! + WRITE(stdout, '(7x,i3,a,4i3,a,f12.6)') i, & + ') torsional angle between atoms: ', int(constr_inp(1:4,i)),& + '; target:', constr_target_inp(i) + ELSE + ! + CALL errore( 'card_constraints', & + & 'torsional_angle: wrong number of fields', nfield ) + ! + ENDIF + ! + CASE( 'bennett_proj' ) + ! + IF ( nfield == 5 ) THEN + ! + READ( input_line, * ) constr_type_inp(i), & + constr_inp(1,i), & + constr_inp(2,i), & + constr_inp(3,i), & + constr_inp(4,i) + ! + WRITE(stdout, '(7x,i3,a,i3,a,3f12.6)') i, & + ') bennet projection of atom ', int(constr_inp(1,i)), & + ' along vector:', constr_inp(2:4,i) + ELSEIF ( nfield == 6 ) THEN + ! + READ( input_line, * ) constr_type_inp(i), & + constr_inp(1,i), & + constr_inp(2,i), & + constr_inp(3,i), & + constr_inp(4,i), & + constr_target_inp(i) + ! + constr_target_set(i) = .true. + ! + WRITE(stdout, '(7x,i3,a,i3,a,3f12.6,a,f12.6)') i, & + ') bennet projection of atom ', int(constr_inp(1,i)), & + ' along vector:', constr_inp(2:4,i), & + '; target:', constr_target_inp(i) + ELSE + ! + CALL errore( 'card_constraints', & + & 'bennett_proj: wrong number of fields', nfield ) + ! + ENDIF + ! + CASE DEFAULT + ! + CALL errore( 'card_constraints', 'unknown constraint ' // & + & 'type: ' // trim( constr_type_inp(i) ), 1 ) + ! + END SELECT + ! + ENDDO + ! + tconstr = .true. + ! + RETURN + ! + END SUBROUTINE card_constraints + ! + ! + !------------------------------------------------------------------------ + ! BEGIN manual + !---------------------------------------------------------------------- + ! + ! KSOUT + ! + ! Enable the printing of Kohn Sham states + ! + ! Syntax ( nspin == 2 ): + ! + ! KSOUT + ! nu + ! iu(1) iu(2) iu(3) .. iu(nu) + ! nd + ! id(1) id(2) id(3) .. id(nd) + ! + ! Syntax ( nspin == 1 ): + ! + ! KSOUT + ! ns + ! is(1) is(2) is(3) .. is(ns) + ! + ! Example: + ! + ! ??? + ! + ! Where: + ! + ! nu (integer) number of spin=1 states to be printed + ! iu(:) (integer) indexes of spin=1 states, the state iu(k) + ! is saved to file KS_UP.iu(k) + ! + ! nd (integer) number of spin=2 states to be printed + ! id(:) (integer) indexes of spin=2 states, the state id(k) + ! is saved to file KS_DW.id(k) + ! + ! ns (integer) number of LDA states to be printed + ! is(:) (integer) indexes of LDA states, the state is(k) + ! is saved to file KS.is(k) + ! + !---------------------------------------------------------------------- + ! END manual + !------------------------------------------------------------------------ + ! + SUBROUTINE card_ksout( input_line ) + ! + IMPLICIT NONE + ! + CHARACTER(len=256) :: input_line + INTEGER :: i, s, nksx + TYPE occupancy_type + INTEGER, POINTER :: occs(:) + END TYPE occupancy_type + TYPE(occupancy_type), ALLOCATABLE :: is(:) + ! + IF ( tksout ) THEN + CALL errore( ' card_ksout ', ' two occurrences', 2 ) + ENDIF + ! + nprnks = 0 + nksx = 0 + ! + ALLOCATE ( is (nspin) ) + ! + DO s = 1, nspin + ! + CALL read_line( input_line ) + READ(input_line, *) nprnks( s ) + ! + IF ( nprnks( s ) < 1 ) THEN + CALL errore( ' card_ksout ', ' wrong number of states ', 2 ) + ENDIF + ! + ALLOCATE( is(s)%occs( 1:nprnks(s) ) ) + ! + CALL read_line( input_line ) + READ(input_line, *) ( is(s)%occs(i), i = 1, nprnks( s ) ) + ! + nksx = max( nksx, nprnks( s ) ) + ! + ENDDO + ! + CALL allocate_input_iprnks( nksx, nspin ) + ! + DO s = 1, nspin + ! + DO i = 1, nprnks( s ) + ! + iprnks( i, s ) = is(s)%occs(i) + ! + ENDDO + ! + DEALLOCATE( is(s)%occs ) + ! + ENDDO + ! + DEALLOCATE( is ) + ! + tksout = .true. + ! + RETURN + ! + END SUBROUTINE + ! + ! + !------------------------------------------------------------------------ + ! BEGIN manual + !---------------------------------------------------------------------- + ! + ! PLOT WANNIER + ! + ! Needed to specify the indices of the wannier functions that + ! have to be plotted + ! + ! Syntax: + ! + ! PLOT_WANNIER + ! index1, ..., indexN + ! + ! Where: + ! + ! index1, ..., indexN are indices of the wannier functions + ! + !---------------------------------------------------------------------- + ! END manual + !------------------------------------------------------------------------ + ! + ! + !------------------------------------------------------------------------ + ! BEGIN manual + !---------------------------------------------------------------------- + ! + ! + ! TEMPLATE + ! + ! This is a template card info section + ! + ! Syntax: + ! + ! TEMPLATE + ! RVALUE IVALUE + ! + ! Example: + ! + ! ??? + ! + ! Where: + ! + ! RVALUE (real) This is a real value + ! IVALUE (integer) This is an integer value + ! + !---------------------------------------------------------------------- + ! END manual + !------------------------------------------------------------------------ + ! + SUBROUTINE card_template( input_line ) + ! + IMPLICIT NONE + ! + CHARACTER(len=256) :: input_line + ! + ! + IF ( ttemplate ) THEN + CALL errore( ' card_template ', ' two occurrences', 2 ) + ENDIF + ! + ! .... CODE HERE + ! + ttemplate = .true. + ! + RETURN + ! + END SUBROUTINE + ! + ! + !------------------------------------------------------------------------ + ! BEGIN manual + !---------------------------------------------------------------------- + !WANNIER_AC + !Wannier# 1 10.5 15.7 2 + !atom 1 + !d 1 0.45 + !p 3 0.55 + !Wannier# 2 10.5 15.7 1 + !atom 3 + !p 1 0.8 + !Spin#2: + !Wannier# 1 10.5 15.7 2 + !atom 1 + !d 1 0.45 + !p 3 0.55 + !Wannier# 2 10.5 15.7 1 + !atom 3 + !p 1 0.8 + !---------------------------------------------------------------------- + ! END manual + !------------------------------------------------------------------------ + ! +END MODULE read_cards_module diff --git a/tests/apps/miniDFT/tests/src/read_input.f90 b/tests/apps/miniDFT/tests/src/read_input.f90 new file mode 100644 index 0000000000..0f97ca6e95 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/read_input.f90 @@ -0,0 +1,79 @@ +! +! Copyright (C) 2011 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +!---------------------------------------------------------------------------- +MODULE read_input + !--------------------------------------------------------------------------- + ! + USE kinds, ONLY: DP + ! + IMPLICIT NONE + SAVE + ! + PRIVATE + PUBLIC :: read_input_file, has_been_read + ! + LOGICAL :: has_been_read = .FALSE. + ! + CONTAINS + ! + !------------------------------------------------------------------------- + SUBROUTINE read_input_file ( prog ) + !------------------------------------------------------------------------- + ! + !use MQEoptions, only : MQEo + USE read_namelists_module, ONLY : read_namelists + USE read_cards_module, ONLY : read_cards + USE io_global, ONLY : stdout, ionode, ionode_id + USE mp, ONLY : mp_bcast + USE mp_global, ONLY : intra_image_comm + ! + IMPLICIT NONE + ! + !borrowed from QE iotk_base.f90 + integer, parameter :: iotk_taglenx = 65535 ! (2**16-1) + integer, parameter :: iotk_namlenx = 256 + integer, parameter :: iotk_attlenx = iotk_taglenx - iotk_namlenx - 1 ! for space + ! + CHARACTER(LEN=2), INTENT (IN) :: prog + CHARACTER(LEN=iotk_attlenx) :: attr + LOGICAL :: xmlinput + INTEGER :: ierr + ! + ! + if( ionode ) then + call input_from_file( ierr ) + !WRITE(stdout, '(5x,a)') "Reading input from "//TRIM( MQEo%infile) + !OPEN ( UNIT = 5, FILE = TRIM( MQEo%infile), FORM = 'FORMATTED', & + ! STATUS = 'OLD', IOSTAT = ierr ) + !if( ierr > 0 ) ierr = 2 + xmlinput = .false. + end if + ! + CALL mp_bcast( ierr, ionode_id, intra_image_comm ) + IF ( ierr > 0 ) CALL errore('read_input', 'opening input file',ierr) + CALL mp_bcast( xmlinput, ionode_id, intra_image_comm ) + CALL mp_bcast( attr, ionode_id, intra_image_comm ) + ! + ! + ! ... Read NAMELISTS + ! + CALL read_namelists( prog ) + ! + ! ... Read CARDS + ! + CALL read_cards ( prog ) + ! + if( ionode ) CLOSE( UNIT=5, STATUS='keep', IOSTAT=ierr ) + ! + has_been_read = .TRUE. + ! + RETURN + ! + END SUBROUTINE read_input_file + ! +END MODULE read_input diff --git a/tests/apps/miniDFT/tests/src/read_namelists.f90 b/tests/apps/miniDFT/tests/src/read_namelists.f90 new file mode 100644 index 0000000000..2ac2b60b67 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/read_namelists.f90 @@ -0,0 +1,1668 @@ +! +! Copyright (C) 2002-2011 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +!---------------------------------------------------------------------------- +MODULE read_namelists_module + !---------------------------------------------------------------------------- + ! + ! ... this module handles the reading of input namelists + ! ... written by: Carlo Cavazzoni + ! -------------------------------------------------- + ! + USE kinds, ONLY : DP + USE input_parameters + ! + IMPLICIT NONE + ! + SAVE + ! + PRIVATE + ! + REAL(DP), PARAMETER :: sm_not_set = -20.0_DP + ! + PUBLIC :: read_namelists, sm_not_set + ! + ! ... modules needed by read_xml.f90 + ! + PUBLIC :: control_defaults, system_defaults, ee_defaults, & + electrons_defaults, ions_defaults, & + cell_defaults, press_ai_defaults, control_bcast, & + system_bcast, ee_bcast, electrons_bcast, ions_bcast, cell_bcast, & + press_ai_bcast, control_checkin, & + system_checkin, electrons_checkin, ions_checkin, cell_checkin, & + fixval + ! + ! ... end of module-scope declarations + ! + ! ---------------------------------------------- + ! + CONTAINS + ! + !=-----------------------------------------------------------------------=! + ! + ! Variables initialization for Namelist CONTROL + ! + !=-----------------------------------------------------------------------=! + ! + !----------------------------------------------------------------------- + SUBROUTINE control_defaults( prog ) + !----------------------------------------------------------------------- + ! + IMPLICIT NONE + ! + CHARACTER(LEN=2) :: prog ! ... specify the calling program + ! + ! + IF ( prog == 'PW' ) THEN + title = ' ' + calculation = 'scf' + ELSE + title = 'MD Simulation' + calculation = 'cp' + END IF + + verbosity = 'default' + IF( prog == 'PW' ) restart_mode = 'from_scratch' + IF( prog == 'CP' ) restart_mode = 'restart' + nstep = 50 + IF( prog == 'PW' ) iprint = 100000 + IF( prog == 'CP' ) iprint = 10 + IF( prog == 'PW' ) isave = 0 + IF( prog == 'CP' ) isave = 100 + ! + tstress = .FALSE. + tprnfor = .FALSE. + tabps = .FALSE. + ! + IF( prog == 'PW' ) dt = 20.0_DP + IF( prog == 'CP' ) dt = 1.0_DP + ! + ndr = 50 + ndw = 50 + ! + ! ... use the path specified as outdir and the filename prefix + ! ... to store output data + ! + CALL get_env( 'ESPRESSO_TMPDIR', outdir ) + IF ( TRIM( outdir ) == ' ' ) outdir = './' + IF( prog == 'PW' ) prefix = 'pwscf' + IF( prog == 'CP' ) prefix = 'cp' + ! + ! ... directory containing the pseudopotentials + ! + CALL get_env( 'ESPRESSO_PSEUDO', pseudo_dir ) + IF ( TRIM( pseudo_dir ) == ' ') THEN + CALL get_env( 'HOME', pseudo_dir ) + pseudo_dir = TRIM( pseudo_dir ) // '/espresso/pseudo/' + END IF + ! + refg = 0.05_DP + max_seconds = 1.E+7_DP + ekin_conv_thr = 1.E-6_DP + etot_conv_thr = 1.E-4_DP + forc_conv_thr = 1.E-3_DP + disk_io = 'default' + dipfield = .FALSE. + lberry = .FALSE. + gdir = 0 + nppstr = 0 + wf_collect = .FALSE. + IF( prog == 'CP' ) wf_collect = .TRUE. ! default for CP is true + printwfc = -1 + lelfield = .FALSE. + nberrycyc = 1 + lkpoint_dir = .TRUE. + lecrpa = .FALSE. + ! + saverho = .TRUE. + ! + RETURN + ! + END SUBROUTINE + ! + !=----------------------------------------------------------------------=! + ! + ! Variables initialization for Namelist SYSTEM + ! + !=----------------------------------------------------------------------=! + ! + !----------------------------------------------------------------------- + SUBROUTINE system_defaults( prog ) + !----------------------------------------------------------------------- + ! + IMPLICIT NONE + ! + CHARACTER(LEN=2) :: prog ! ... specify the calling program + ! + ! + ibrav = -1 + celldm = (/ 0.0_DP, 0.0_DP, 0.0_DP, 0.0_DP, 0.0_DP, 0.0_DP /) + a = 0.0_DP + b = 0.0_DP + c = 0.0_DP + cosab = 0.0_DP + cosac = 0.0_DP + cosbc = 0.0_DP + nat = 0 + ntyp = 0 + nbnd = 0 + tot_charge = 0.0_DP + tot_magnetization = -1 + ecutwfc = 0.0_DP + ecutrho = 0.0_DP + nr1 = 0 + nr2 = 0 + nr3 = 0 + nr1s = 0 + nr2s = 0 + nr3s = 0 + nr1b = 0 + nr2b = 0 + nr3b = 0 + occupations = 'fixed' + smearing = 'gaussian' + degauss = 0.0_DP + nspin = 1 + nosym = .FALSE. + nosym_evc = .FALSE. + force_symmorphic = .FALSE. + use_all_frac = .FALSE. + noinv = .FALSE. + ecfixed = 0.0_DP + qcutz = 0.0_DP + q2sigma = 0.01_DP + input_dft = 'none' + ecutfock = -1.0_DP +! +! ... set starting_magnetization to an invalid value: +! ... in PW starting_magnetization MUST be set for at least one atomic type +! ... (unless the magnetization is set in other ways) +! ... in CP starting_magnetization MUST REMAIN UNSET +! + starting_magnetization = sm_not_set + + IF ( prog == 'PW' ) THEN + ! + starting_ns_eigenvalue = -1.0_DP + U_projection_type = 'atomic' + ! + END IF + lda_plus_U = .FALSE. + lda_plus_u_kind = 0 + Hubbard_U = 0.0_DP + Hubbard_J = 0.0_DP + Hubbard_alpha = 0.0_DP + step_pen=.false. + A_pen=0.0_DP + sigma_pen=0.01_DP + alpha_pen=0.0_DP + edir = 1 + emaxpos = 0.5_DP + eopreg = 0.1_DP + eamp = 0.0_DP + ! + ! ... postprocessing of DOS & phonons & el-ph + la2F = .FALSE. + ! + ! ... non collinear program variables + ! + lspinorb = .FALSE. + starting_spin_angle=.FALSE. + noncolin = .FALSE. + lambda = 1.0_DP + constrained_magnetization= 'none' + fixed_magnetization = 0.0_DP + B_field = 0.0_DP + angle1 = 0.0_DP + angle2 = 0.0_DP + report = 1 + ! + no_t_rev = .FALSE. + ! + assume_isolated = 'none' + ! + one_atom_occupations=.FALSE. + ! + spline_ps = .false. + ! + real_space = .false. + ! + RETURN + ! + END SUBROUTINE + +! DCC + !=----------------------------------------------------------------------=! + ! + ! Variables initialization for Namelist EE + ! + !=----------------------------------------------------------------------=! + ! + !----------------------------------------------------------------------- + SUBROUTINE ee_defaults( prog ) + !----------------------------------------------------------------------- + ! + IMPLICIT NONE + ! + CHARACTER(LEN=2) :: prog ! ... specify the calling program + ! + ! + ncompx = 1 + ncompy = 1 + ncompz = 1 + mr1 = 0 + mr2 = 0 + mr3 = 0 + ecutcoarse = 100.D0 + errtol = 1.d-22 + nlev = 2 + itmax = 1000 + whichbc = 0 +! centercompx = 0.D0 +! centercompy = 0.D0 +! centercompz = 0.D0 +! spreadcomp = -9999.D0 + mixing_charge_compensation = 1.0D0 + n_charge_compensation = 5 + comp_thr = 1.D-4 +! multipole = 'dipole' +! poisson_maxiter = 5000 +! poisson_thr = 1.D-6 +! comp_thr = 1.D-2 +! ebc_thr = 1.D-2 +! rhoionmax = 1.D0 +! smoothspr = 0.25D0 +! deltapot = 5.D-1 + nlev = 2 +! which_smoothing = 'sphere' + RETURN + ! + END SUBROUTINE + ! + !=----------------------------------------------------------------------=! + ! + ! Variables initialization for Namelist ELECTRONS + ! + !=----------------------------------------------------------------------=! + ! + !----------------------------------------------------------------------- + SUBROUTINE electrons_defaults( prog ) + !----------------------------------------------------------------------- + ! + IMPLICIT NONE + ! + CHARACTER(LEN=2) :: prog ! ... specify the calling program + ! + ! + emass = 400.0_DP + emass_cutoff = 2.5_DP + orthogonalization = 'ortho' + ortho_eps = 1.E-8_DP + ortho_max = 20 + electron_maxstep = 100 + ! + ! ... ( 'sd' | 'cg' | 'damp' | 'verlet' | 'none' | 'diis' ) + ! + electron_dynamics = 'none' + electron_damping = 0.1_DP + ! + ! ... ( 'zero' | 'default' ) + ! + electron_velocities = 'default' + ! + ! ... ( 'nose' | 'not_controlled' | 'rescaling') + ! + electron_temperature = 'not_controlled' + ekincw = 0.001_DP + fnosee = 1.0_DP + ampre = 0.0_DP + grease = 1.0_DP + conv_thr = 1.E-6_DP + diis_size = 4 + diis_nreset = 3 + diis_hcut = 1.0_DP + diis_wthr = 0.0_DP + diis_delt = 0.0_DP + diis_maxstep = 100 + diis_rot = .FALSE. + diis_fthr = 0.0_DP + diis_temp = 0.0_DP + diis_achmix = 0.0_DP + diis_g0chmix = 0.0_DP + diis_g1chmix = 0.0_DP + diis_nchmix = 3 + diis_nrot = 3 + diis_rothr = 0.0_DP + diis_ethr = 0.0_DP + diis_chguess = .FALSE. + mixing_mode = 'plain' + mixing_fixed_ns = 0 + mixing_beta = 0.7_DP + mixing_ndim = 8 + diagonalization = 'david' + diago_thr_init = 0.0_DP + diago_cg_maxiter = 20 + diago_david_ndim = 4 + diago_full_acc = .FALSE. + ! + sic = 'none' + sic_epsilon = 0.0_DP + sic_alpha = 0.0_DP + force_pairing = .false. + ! + fermi_energy = 0.0_DP + n_inner = 2 + niter_cold_restart=1 + lambda_cold=0.03_DP + rotation_dynamics = "line-minimization" + occupation_dynamics = "line-minimization" + rotmass = 0.0_DP + occmass = 0.0_DP + rotation_damping = 0.0_DP + occupation_damping = 0.0_DP + ! + tcg = .FALSE. + maxiter = 100 + passop = 0.3_DP + niter_cg_restart = 20 + etresh = 1.E-6_DP + ! + epol = 3 + efield = 0.0_DP + epol2 = 3 + efield2 = 0.0_DP + efield_cart(1)=0.d0 + efield_cart(2)=0.d0 + efield_cart(3)=0.d0 + ! + occupation_constraints = .false. + ! + adaptive_thr = .false. + conv_thr_init = 0.1E-2_DP + conv_thr_multi = 0.1_DP + ! + RETURN + ! + END SUBROUTINE + + !=----------------------------------------------------------------------=! + ! + ! Variables initialization for Namelist IONS + ! + !=----------------------------------------------------------------------=! + ! + !----------------------------------------------------------------------- + SUBROUTINE ions_defaults( prog ) + !----------------------------------------------------------------------- + ! + IMPLICIT NONE + ! + CHARACTER(LEN=2) :: prog ! ... specify the calling program + ! + ! + ! ... ( 'full' | 'coarse-grained' ) + ! + phase_space = 'full' + ! + ! ... ( 'sd' | 'cg' | 'damp' | 'verlet' | 'none' | 'bfgs' | 'beeman' ) + ! + ion_dynamics = 'none' + ion_radius = 0.5_DP + ion_damping = 0.1_DP + ! + ! ... ( 'default' | 'from_input' ) + ! + ion_positions = 'default' + ! + ! ... ( 'zero' | 'default' | 'from_input' ) + ! + ion_velocities = 'default' + ! + ! ... ( 'nose' | 'not_controlled' | 'rescaling' | 'berendsen' | + ! 'andersen' | 'langevin' ) + ! + ion_temperature = 'not_controlled' + ! + tempw = 300.0_DP + fnosep = -1.0_DP + fnosep(1) = 1.0_DP + nhpcl = 0 + nhptyp = 0 + ndega = 0 + tranp = .FALSE. + amprp = 0.0_DP + greasp = 1.0_DP + tolp = 100.0_DP + ion_nstepe = 1 + ion_maxstep = 100 + delta_t = 1.0_DP + nraise = 1 + ! + refold_pos = .FALSE. + remove_rigid_rot = .FALSE. + ! + upscale = 100.0_DP + pot_extrapolation = 'atomic' + wfc_extrapolation = 'none' + ! + ! ... BFGS defaults + ! + bfgs_ndim = 1 + trust_radius_max = 0.8_DP ! bohr + trust_radius_min = 1.E-4_DP ! bohr + trust_radius_ini = 0.5_DP ! bohr + w_1 = 0.01_DP + w_2 = 0.50_DP + ! + sic_rloc = 0.0_DP + ! + ! ... meta-dynamics defaults + ! + fe_step = 0.4_DP + fe_nstep = 100 + sw_nstep = 10 + eq_nstep = 0 + g_amplitude = 0.005_DP + ! + RETURN + ! + END SUBROUTINE + ! + ! + !=----------------------------------------------------------------------=! + ! + ! Variables initialization for Namelist CELL + ! + !=----------------------------------------------------------------------=! + ! + !----------------------------------------------------------------------- + SUBROUTINE cell_defaults( prog ) + !----------------------------------------------------------------------- + ! + IMPLICIT NONE + ! + CHARACTER(LEN=2) :: prog ! ... specify the calling program + ! + ! + cell_parameters = 'default' + ! + ! ... ( 'sd' | 'pr' | 'none' | 'w' | 'damp-pr' | 'damp-w' | 'bfgs' ) + ! + cell_dynamics = 'none' + ! + ! ... ( 'zero' | 'default' ) + ! + cell_velocities = 'default' + press = 0.0_DP + wmass = 0.0_DP + ! + ! ... ( 'nose' | 'not_controlled' | 'rescaling' ) + ! + cell_temperature = 'not_controlled' + temph = 0.0_DP + fnoseh = 1.0_DP + greash = 1.0_DP + ! + ! ... ('all'* | 'volume' | 'x' | 'y' | 'z' | 'xy' | 'xz' | 'yz' | 'xyz' ) + ! + cell_dofree = 'all' + cell_factor = 0.0_DP + cell_nstepe = 1 + cell_damping = 0.0_DP + press_conv_thr = 0.5_DP + ! + RETURN + ! + END SUBROUTINE + ! + ! + !=----------------------------------------------------------------------=! + ! + ! Variables initialization for Namelist PRESS_AI + ! + !=----------------------------------------------------------------------=! + ! + !---------------------------------------------------------------------- + SUBROUTINE press_ai_defaults( prog ) + ! + IMPLICIT NONE + ! + CHARACTER(LEN=2) :: prog ! ... specify the calling program + ! + abivol = .false. + abisur = .false. + pvar = .false. + fill_vac = .false. + cntr = .false. + scale_at = .false. + t_gauss = .false. + jellium = .false. + + P_ext = 0.0_DP + P_in = 0.0_DP + P_fin = 0.0_DP + Surf_t = 0.0_DP + rho_thr = 0.0_DP + dthr = 0.0_DP + step_rad = 0.0_DP + delta_eps = 0.0_DP + delta_sigma = 0.0_DP + R_j = 0.0_DP + h_j = 0.0_DP + + n_cntr = 0 + axis = 3 + ! + RETURN + ! + END SUBROUTINE + ! + !=----------------------------------------------------------------------=! + ! + ! Broadcast variables values for Namelist CONTROL + ! + !=----------------------------------------------------------------------=! + ! + !----------------------------------------------------------------------- + SUBROUTINE control_bcast() + !----------------------------------------------------------------------- + ! + USE io_global, ONLY : ionode_id + USE mp, ONLY : mp_bcast + ! + IMPLICIT NONE + ! + CALL mp_bcast( title, ionode_id ) + CALL mp_bcast( calculation, ionode_id ) + CALL mp_bcast( verbosity, ionode_id ) + CALL mp_bcast( restart_mode, ionode_id ) + CALL mp_bcast( nstep, ionode_id ) + CALL mp_bcast( iprint, ionode_id ) + CALL mp_bcast( isave, ionode_id ) + CALL mp_bcast( tstress, ionode_id ) + CALL mp_bcast( tprnfor, ionode_id ) + CALL mp_bcast( tabps, ionode_id ) + CALL mp_bcast( dt, ionode_id ) + CALL mp_bcast( ndr, ionode_id ) + CALL mp_bcast( ndw, ionode_id ) + CALL mp_bcast( outdir, ionode_id ) + CALL mp_bcast( wfcdir, ionode_id ) + CALL mp_bcast( prefix, ionode_id ) + CALL mp_bcast( max_seconds, ionode_id ) + CALL mp_bcast( ekin_conv_thr, ionode_id ) + CALL mp_bcast( etot_conv_thr, ionode_id ) + CALL mp_bcast( forc_conv_thr, ionode_id ) + CALL mp_bcast( pseudo_dir, ionode_id ) + CALL mp_bcast( refg, ionode_id ) + CALL mp_bcast( disk_io, ionode_id ) + CALL mp_bcast( tefield, ionode_id ) + CALL mp_bcast( tefield2, ionode_id ) + CALL mp_bcast( dipfield, ionode_id ) + CALL mp_bcast( lberry, ionode_id ) + CALL mp_bcast( gdir, ionode_id ) + CALL mp_bcast( nppstr, ionode_id ) + CALL mp_bcast( lkpoint_dir, ionode_id ) + CALL mp_bcast( wf_collect, ionode_id ) + CALL mp_bcast( printwfc, ionode_id ) + CALL mp_bcast( lelfield, ionode_id ) + CALL mp_bcast( nberrycyc, ionode_id ) + CALL mp_bcast( saverho, ionode_id ) + CALL mp_bcast( lecrpa, ionode_id ) + CALL mp_bcast( vdw_table_name, ionode_id ) + ! + RETURN + ! + END SUBROUTINE + ! + !=----------------------------------------------------------------------=! + ! + ! Broadcast variables values for Namelist SYSTEM + ! + !=----------------------------------------------------------------------=! + ! + !----------------------------------------------------------------------- + SUBROUTINE system_bcast() + !----------------------------------------------------------------------- + ! + USE io_global, ONLY : ionode_id + USE mp, ONLY : mp_bcast + ! + IMPLICIT NONE + ! + CALL mp_bcast( ibrav, ionode_id ) + CALL mp_bcast( celldm, ionode_id ) + CALL mp_bcast( a, ionode_id ) + CALL mp_bcast( b, ionode_id ) + CALL mp_bcast( c, ionode_id ) + CALL mp_bcast( cosab, ionode_id ) + CALL mp_bcast( cosac, ionode_id ) + CALL mp_bcast( cosbc, ionode_id ) + CALL mp_bcast( nat, ionode_id ) + CALL mp_bcast( ntyp, ionode_id ) + CALL mp_bcast( nbnd, ionode_id ) + CALL mp_bcast( tot_charge, ionode_id ) + CALL mp_bcast( tot_magnetization, ionode_id ) + CALL mp_bcast( ecutwfc, ionode_id ) + CALL mp_bcast( ecutrho, ionode_id ) + CALL mp_bcast( nr1, ionode_id ) + CALL mp_bcast( nr2, ionode_id ) + CALL mp_bcast( nr3, ionode_id ) + CALL mp_bcast( nr1s, ionode_id ) + CALL mp_bcast( nr2s, ionode_id ) + CALL mp_bcast( nr3s, ionode_id ) + CALL mp_bcast( nr1b, ionode_id ) + CALL mp_bcast( nr2b, ionode_id ) + CALL mp_bcast( nr3b, ionode_id ) + CALL mp_bcast( occupations, ionode_id ) + CALL mp_bcast( smearing, ionode_id ) + CALL mp_bcast( degauss, ionode_id ) + CALL mp_bcast( nspin, ionode_id ) + CALL mp_bcast( nosym, ionode_id ) + CALL mp_bcast( nosym_evc, ionode_id ) + CALL mp_bcast( noinv, ionode_id ) + CALL mp_bcast( force_symmorphic, ionode_id ) + CALL mp_bcast( use_all_frac, ionode_id ) + CALL mp_bcast( ecfixed, ionode_id ) + CALL mp_bcast( qcutz, ionode_id ) + CALL mp_bcast( q2sigma, ionode_id ) + CALL mp_bcast( input_dft, ionode_id ) + CALL mp_bcast( nqx1, ionode_id ) + CALL mp_bcast( nqx2, ionode_id ) + CALL mp_bcast( nqx3, ionode_id ) + CALL mp_bcast( exx_fraction, ionode_id ) + CALL mp_bcast( screening_parameter, ionode_id ) + CALL mp_bcast( exxdiv_treatment, ionode_id ) + CALL mp_bcast( x_gamma_extrapolation, ionode_id ) + CALL mp_bcast( yukawa, ionode_id ) + CALL mp_bcast( ecutvcut, ionode_id ) + CALL mp_bcast( ecutfock, ionode_id ) + CALL mp_bcast( starting_magnetization, ionode_id ) + CALL mp_bcast( starting_ns_eigenvalue, ionode_id ) + CALL mp_bcast( U_projection_type, ionode_id ) + CALL mp_bcast( lda_plus_U, ionode_id ) + CALL mp_bcast( lda_plus_u_kind, ionode_id ) + CALL mp_bcast( Hubbard_U, ionode_id ) + CALL mp_bcast( Hubbard_J, ionode_id ) + CALL mp_bcast( Hubbard_alpha, ionode_id ) + CALL mp_bcast( step_pen, ionode_id ) + CALL mp_bcast( A_pen, ionode_id ) + CALL mp_bcast( sigma_pen, ionode_id ) + CALL mp_bcast( alpha_pen, ionode_id ) + CALL mp_bcast( edir, ionode_id ) + CALL mp_bcast( emaxpos, ionode_id ) + CALL mp_bcast( eopreg, ionode_id ) + CALL mp_bcast( eamp, ionode_id ) + CALL mp_bcast( la2F, ionode_id ) + ! + ! ... non collinear broadcast + ! + CALL mp_bcast( lspinorb, ionode_id ) + CALL mp_bcast( starting_spin_angle, ionode_id ) + CALL mp_bcast( noncolin, ionode_id ) + CALL mp_bcast( angle1, ionode_id ) + CALL mp_bcast( angle2, ionode_id ) + CALL mp_bcast( report, ionode_id ) + CALL mp_bcast( constrained_magnetization, ionode_id ) + CALL mp_bcast( B_field, ionode_id ) + CALL mp_bcast( fixed_magnetization, ionode_id ) + CALL mp_bcast( lambda, ionode_id ) + ! + CALL mp_bcast( assume_isolated, ionode_id ) + CALL mp_bcast( one_atom_occupations, ionode_id ) + CALL mp_bcast( spline_ps, ionode_id ) + ! + CALL mp_bcast( no_t_rev, ionode_id ) + + RETURN + ! + END SUBROUTINE +! DCC + !=----------------------------------------------------------------------=! + ! + ! Broadcast variables values for Namelist EE + ! + !=----------------------------------------------------------------------=! + ! + !----------------------------------------------------------------------- + SUBROUTINE ee_bcast() + !----------------------------------------------------------------------- + ! + USE io_global, ONLY : ionode_id + USE mp, ONLY : mp_bcast + ! + IMPLICIT NONE + ! + CALL mp_bcast( ecutcoarse, ionode_id ) + CALL mp_bcast( mixing_charge_compensation, ionode_id ) + CALL mp_bcast( errtol, ionode_id ) + CALL mp_bcast( comp_thr, ionode_id ) + CALL mp_bcast( nlev, ionode_id ) + CALL mp_bcast( itmax, ionode_id ) + CALL mp_bcast( whichbc, ionode_id ) + CALL mp_bcast( n_charge_compensation, ionode_id ) + CALL mp_bcast( ncompx, ionode_id ) + CALL mp_bcast( ncompy, ionode_id ) + CALL mp_bcast( ncompz, ionode_id ) + CALL mp_bcast( mr1, ionode_id ) + CALL mp_bcast( mr2, ionode_id ) + CALL mp_bcast( mr3, ionode_id ) + CALL mp_bcast( cellmin, ionode_id ) + CALL mp_bcast( cellmax, ionode_id ) + + RETURN + ! + END SUBROUTINE + ! + !=----------------------------------------------------------------------=! + ! + ! Broadcast variables values for Namelist ELECTRONS + ! + !=----------------------------------------------------------------------=! + ! + !----------------------------------------------------------------------- + SUBROUTINE electrons_bcast() + !----------------------------------------------------------------------- + ! + USE io_global, ONLY : ionode_id + USE mp, ONLY : mp_bcast + ! + IMPLICIT NONE + ! + CALL mp_bcast( emass, ionode_id ) + CALL mp_bcast( emass_cutoff, ionode_id ) + CALL mp_bcast( orthogonalization, ionode_id ) + CALL mp_bcast( electron_maxstep, ionode_id ) + CALL mp_bcast( ortho_eps, ionode_id ) + CALL mp_bcast( ortho_max, ionode_id ) + CALL mp_bcast( electron_dynamics, ionode_id ) + CALL mp_bcast( electron_damping, ionode_id ) + CALL mp_bcast( electron_velocities, ionode_id ) + CALL mp_bcast( electron_temperature, ionode_id ) + CALL mp_bcast( conv_thr, ionode_id ) + CALL mp_bcast( ekincw, ionode_id ) + CALL mp_bcast( fnosee, ionode_id ) + CALL mp_bcast( startingwfc, ionode_id ) + CALL mp_bcast( ampre, ionode_id ) + CALL mp_bcast( grease, ionode_id ) + CALL mp_bcast( startingpot, ionode_id ) + CALL mp_bcast( diis_size, ionode_id ) + CALL mp_bcast( diis_nreset, ionode_id ) + CALL mp_bcast( diis_hcut, ionode_id ) + CALL mp_bcast( diis_wthr, ionode_id ) + CALL mp_bcast( diis_delt, ionode_id ) + CALL mp_bcast( diis_maxstep, ionode_id ) + CALL mp_bcast( diis_rot, ionode_id ) + CALL mp_bcast( diis_fthr, ionode_id ) + CALL mp_bcast( diis_temp, ionode_id ) + CALL mp_bcast( diis_achmix, ionode_id ) + CALL mp_bcast( diis_g0chmix, ionode_id ) + CALL mp_bcast( diis_g1chmix, ionode_id ) + CALL mp_bcast( diis_nchmix, ionode_id ) + CALL mp_bcast( diis_nrot, ionode_id ) + CALL mp_bcast( diis_rothr, ionode_id ) + CALL mp_bcast( diis_ethr, ionode_id ) + CALL mp_bcast( diis_chguess, ionode_id ) + CALL mp_bcast( mixing_fixed_ns, ionode_id ) + CALL mp_bcast( mixing_mode, ionode_id ) + CALL mp_bcast( mixing_beta, ionode_id ) + CALL mp_bcast( mixing_ndim, ionode_id ) + CALL mp_bcast( tqr, ionode_id ) + CALL mp_bcast( diagonalization, ionode_id ) + CALL mp_bcast( diago_thr_init, ionode_id ) + CALL mp_bcast( diago_cg_maxiter, ionode_id ) + CALL mp_bcast( diago_david_ndim, ionode_id ) + CALL mp_bcast( diago_full_acc, ionode_id ) + CALL mp_bcast( sic, ionode_id ) + CALL mp_bcast( sic_epsilon , ionode_id ) + CALL mp_bcast( sic_alpha , ionode_id ) + CALL mp_bcast( force_pairing , ionode_id ) + ! + ! ... ensemble-DFT + ! + CALL mp_bcast( fermi_energy, ionode_id ) + CALL mp_bcast( n_inner, ionode_id ) + CALL mp_bcast( niter_cold_restart, ionode_id ) + CALL mp_bcast( lambda_cold, ionode_id ) + CALL mp_bcast( rotation_dynamics, ionode_id ) + CALL mp_bcast( occupation_dynamics,ionode_id ) + CALL mp_bcast( rotmass, ionode_id ) + CALL mp_bcast( occmass, ionode_id ) + CALL mp_bcast( rotation_damping, ionode_id ) + CALL mp_bcast( occupation_damping, ionode_id ) + ! + ! ... conjugate gradient + ! + CALL mp_bcast( tcg, ionode_id ) + CALL mp_bcast( maxiter, ionode_id ) + CALL mp_bcast( etresh, ionode_id ) + CALL mp_bcast( passop, ionode_id ) + CALL mp_bcast( niter_cg_restart, ionode_id ) + ! + ! ... electric field + ! + CALL mp_bcast( epol, ionode_id ) + CALL mp_bcast( efield, ionode_id ) + ! + CALL mp_bcast( epol2, ionode_id ) + CALL mp_bcast( efield2, ionode_id ) + CALL mp_bcast( efield_cart, ionode_id ) + ! + ! ... occupation constraints ... + ! + CALL mp_bcast( occupation_constraints, ionode_id ) + ! + ! ... real space ... + CALL mp_bcast( real_space, ionode_id) + CALL mp_bcast( adaptive_thr, ionode_id ) + CALL mp_bcast( conv_thr_init, ionode_id ) + CALL mp_bcast( conv_thr_multi, ionode_id ) + RETURN + ! + END SUBROUTINE + ! + ! + !=----------------------------------------------------------------------=! + ! + ! Broadcast variables values for Namelist IONS + ! + !=----------------------------------------------------------------------=! + ! + !----------------------------------------------------------------------- + SUBROUTINE ions_bcast() + !----------------------------------------------------------------------- + ! + USE io_global, ONLY: ionode_id + USE mp, ONLY: mp_bcast + ! + IMPLICIT NONE + ! + CALL mp_bcast( phase_space, ionode_id ) + CALL mp_bcast( ion_dynamics, ionode_id ) + CALL mp_bcast( ion_radius, ionode_id ) + CALL mp_bcast( ion_damping, ionode_id ) + CALL mp_bcast( ion_positions, ionode_id ) + CALL mp_bcast( ion_velocities, ionode_id ) + CALL mp_bcast( ion_temperature, ionode_id ) + CALL mp_bcast( tempw, ionode_id ) + CALL mp_bcast( fnosep, ionode_id ) + CALL mp_bcast( nhgrp, ionode_id ) + CALL mp_bcast( fnhscl, ionode_id ) + CALL mp_bcast( nhpcl, ionode_id ) + CALL mp_bcast( nhptyp, ionode_id ) + CALL mp_bcast( ndega, ionode_id ) + CALL mp_bcast( tranp, ionode_id ) + CALL mp_bcast( amprp, ionode_id ) + CALL mp_bcast( greasp, ionode_id ) + CALL mp_bcast( tolp, ionode_id ) + CALL mp_bcast( ion_nstepe, ionode_id ) + CALL mp_bcast( ion_maxstep, ionode_id ) + CALL mp_bcast( delta_t, ionode_id ) + CALL mp_bcast( nraise, ionode_id ) + CALL mp_bcast( refold_pos, ionode_id ) + CALL mp_bcast( remove_rigid_rot, ionode_id ) + CALL mp_bcast( upscale, ionode_id ) + CALL mp_bcast( pot_extrapolation, ionode_id ) + CALL mp_bcast( wfc_extrapolation, ionode_id ) + ! + ! ... BFGS + ! + CALL mp_bcast( bfgs_ndim, ionode_id ) + CALL mp_bcast( trust_radius_max, ionode_id ) + CALL mp_bcast( trust_radius_min, ionode_id ) + CALL mp_bcast( trust_radius_ini, ionode_id ) + CALL mp_bcast( w_1, ionode_id ) + CALL mp_bcast( w_2, ionode_id ) + ! + CALL mp_bcast( sic_rloc, ionode_id ) + ! + CALL mp_bcast( fe_step, ionode_id ) + CALL mp_bcast( fe_nstep, ionode_id ) + CALL mp_bcast( sw_nstep, ionode_id ) + CALL mp_bcast( eq_nstep, ionode_id ) + CALL mp_bcast( g_amplitude, ionode_id ) + ! + RETURN + ! + END SUBROUTINE + ! + !=----------------------------------------------------------------------=! + ! + ! Broadcast variables values for Namelist CELL + ! + !=----------------------------------------------------------------------=! + ! + !----------------------------------------------------------------------- + SUBROUTINE cell_bcast() + !----------------------------------------------------------------------- + ! + USE io_global, ONLY: ionode_id + USE mp, ONLY: mp_bcast + ! + IMPLICIT NONE + ! + CALL mp_bcast( cell_parameters, ionode_id ) + CALL mp_bcast( cell_dynamics, ionode_id ) + CALL mp_bcast( cell_velocities, ionode_id ) + CALL mp_bcast( cell_dofree, ionode_id ) + CALL mp_bcast( press, ionode_id ) + CALL mp_bcast( wmass, ionode_id ) + CALL mp_bcast( cell_temperature, ionode_id ) + CALL mp_bcast( temph, ionode_id ) + CALL mp_bcast( fnoseh, ionode_id ) + CALL mp_bcast( greash, ionode_id ) + CALL mp_bcast( cell_factor, ionode_id ) + CALL mp_bcast( cell_nstepe, ionode_id ) + CALL mp_bcast( cell_damping, ionode_id ) + CALL mp_bcast( press_conv_thr, ionode_id ) + ! + RETURN + ! + END SUBROUTINE + ! + !=----------------------------------------------------------------------=! + ! + ! Broadcast variables values for Namelist PRESS_AI + ! + !=----------------------------------------------------------------------=! + ! + !---------------------------------------------------------------------- + SUBROUTINE press_ai_bcast() + !---------------------------------------------------------------------- + ! + USE io_global, ONLY: ionode_id + USE mp, ONLY: mp_bcast + ! + IMPLICIT NONE + ! + ! + CALL mp_bcast( abivol, ionode_id ) + CALL mp_bcast( abisur, ionode_id ) + CALL mp_bcast( t_gauss, ionode_id ) + CALL mp_bcast( cntr, ionode_id ) + CALL mp_bcast( P_ext, ionode_id ) + CALL mp_bcast( Surf_t, ionode_id ) + CALL mp_bcast( pvar, ionode_id ) + CALL mp_bcast( P_in, ionode_id ) + CALL mp_bcast( P_fin, ionode_id ) + CALL mp_bcast( delta_eps, ionode_id ) + CALL mp_bcast( delta_sigma, ionode_id ) + CALL mp_bcast( fill_vac, ionode_id ) + CALL mp_bcast( scale_at, ionode_id ) + CALL mp_bcast( n_cntr, ionode_id ) + CALL mp_bcast( axis, ionode_id ) + CALL mp_bcast( rho_thr, ionode_id ) + CALL mp_bcast( dthr, ionode_id ) + CALL mp_bcast( step_rad, ionode_id ) + CALL mp_bcast( jellium, ionode_id ) + CALL mp_bcast( R_j, ionode_id ) + CALL mp_bcast( h_j, ionode_id ) + ! + RETURN + ! + END SUBROUTINE + + ! + !=----------------------------------------------------------------------=! + ! + ! Check input values for Namelist CONTROL + ! + !=----------------------------------------------------------------------=! + ! + !----------------------------------------------------------------------- + SUBROUTINE control_checkin( prog ) + !----------------------------------------------------------------------- + ! + IMPLICIT NONE + ! + CHARACTER(LEN=2) :: prog ! ... specify the calling program + CHARACTER(LEN=20) :: sub_name = ' control_checkin ' + INTEGER :: i + LOGICAL :: allowed = .FALSE. + ! + ! + DO i = 1, SIZE( calculation_allowed ) + IF( TRIM(calculation) == calculation_allowed(i) ) allowed = .TRUE. + END DO + IF( .NOT. allowed ) & + CALL errore( sub_name, ' calculation '''// & + & TRIM(calculation)//''' not allowed ',1) + IF( ndr < 50 ) & + CALL errore( sub_name,' ndr out of range ', 1 ) + IF( ndw > 0 .AND. ndw < 50 ) & + CALL errore( sub_name,' ndw out of range ', 1 ) + IF( nstep < 0 ) & + CALL errore( sub_name,' nstep out of range ', 1 ) + IF( iprint < 1 ) & + CALL errore( sub_name,' iprint out of range ', 1 ) + + IF( prog == 'PW' ) THEN + IF( isave > 0 ) & + CALL infomsg( sub_name,' isave not used in PW ' ) + ELSE + IF( isave < 1 ) & + CALL errore( sub_name,' isave out of range ', 1 ) + END IF + + IF( dt < 0.0_DP ) & + CALL errore( sub_name,' dt out of range ', 1 ) + IF( max_seconds < 0.0_DP ) & + CALL errore( sub_name,' max_seconds out of range ', 1 ) + + IF( ekin_conv_thr < 0.0_DP ) THEN + IF( prog == 'PW' ) THEN + CALL infomsg( sub_name,' ekin_conv_thr not used in PW ') + ELSE + CALL errore( sub_name,' ekin_conv_thr out of range ', 1 ) + END IF + END IF + + IF( etot_conv_thr < 0.0_DP ) & + CALL errore( sub_name,' etot_conv_thr out of range ', 1 ) + IF( forc_conv_thr < 0.0_DP ) & + CALL errore( sub_name,' forc_conv_thr out of range ', 1 ) + IF( prog == 'CP' ) THEN + IF( dipfield ) & + CALL infomsg( sub_name,' dipfield not yet implemented ') + IF( lberry ) & + CALL infomsg( sub_name,' lberry not implemented yet ') + IF( gdir /= 0 ) & + CALL infomsg( sub_name,' gdir not used ') + IF( nppstr /= 0 ) & + CALL infomsg( sub_name,' nppstr not used ') + END IF + ! + IF( prog == 'PW' .AND. TRIM( restart_mode ) == 'reset_counters' ) THEN + CALL infomsg ( sub_name, ' restart_mode == reset_counters' // & + & ' not implemented in PW ' ) + END IF + ! + IF( refg < 0 ) & + CALL errore( sub_name, ' wrong table interval refg ', 1 ) + ! +#ifdef __LOWMEM + IF( wf_collect .EQ. .true. ) & + CALL errore( sub_name, ' wf_collect = .true. is not allowed with LOWMEM build ', 1 ) + IF( prog /= 'CP' ) & + CALL errore( sub_name, ' LOWMEM not available in '//prog//' yet ', 1 ) +#endif + + RETURN + ! + END SUBROUTINE + ! + !=----------------------------------------------------------------------=! + ! + ! Check input values for Namelist SYSTEM + ! + !=----------------------------------------------------------------------=! + ! + !----------------------------------------------------------------------- + SUBROUTINE system_checkin( prog ) + !----------------------------------------------------------------------- + ! + IMPLICIT NONE + ! + CHARACTER(LEN=2) :: prog ! ... specify the calling program + CHARACTER(LEN=20) :: sub_name = ' system_checkin ' + INTEGER :: i + LOGICAL :: allowed + ! + ! + IF( ( ibrav /= 0 ) .AND. (celldm(1) == 0.0_DP) .AND. ( a == 0.0_DP ) ) & + CALL errore( ' iosys ', & + & ' invalid lattice parameters ( celldm or a )', 1 ) + ! + IF( nat < 0 ) & + CALL errore( sub_name ,' nat less than zero ', MAX( nat, 1) ) + ! + IF( ntyp < 0 ) & + CALL errore( sub_name ,' ntyp less than zero ', MAX( ntyp, 1) ) + IF( ntyp < 0 .OR. ntyp > nsx ) & + CALL errore( sub_name , & + & ' ntyp too large, increase NSX ', MAX( ntyp, 1) ) + ! + IF( nspin < 1 .OR. nspin > 4 .OR. nspin == 3 ) & + CALL errore( sub_name ,' nspin out of range ', MAX(nspin, 1 ) ) + ! + IF( ecutwfc <= 0.0_DP ) & + CALL errore( sub_name ,' ecutwfc out of range ',1) + IF( ecutrho < 0.0_DP ) & + CALL errore( sub_name ,' ecutrho out of range ',1) + ! + IF( prog == 'CP' ) THEN + IF( degauss /= 0.0_DP ) & + CALL infomsg( sub_name ,' degauss is not used in CP ') + END IF + ! + IF( ecfixed < 0.0_DP ) & + CALL errore( sub_name ,' ecfixed out of range ',1) + IF( qcutz < 0.0_DP ) & + CALL errore( sub_name ,' qcutz out of range ',1) + IF( q2sigma < 0.0_DP ) & + CALL errore( sub_name ,' q2sigma out of range ',1) + IF( prog == 'CP' ) THEN + IF( ANY(starting_magnetization /= SM_NOT_SET ) ) & + CALL infomsg( sub_name ,& + & ' starting_magnetization is not used in CP ') +! IF( lda_plus_U ) & +! CALL infomsg( sub_name ,' lda_plus_U is not used in CP ') + IF( la2F ) & + CALL infomsg( sub_name ,' la2F is not used in CP ') +! IF( ANY(Hubbard_U /= 0.0_DP) ) & +! CALL infomsg( sub_name ,' Hubbard_U is not used in CP ') + IF( ANY(Hubbard_alpha /= 0.0_DP) ) & + CALL infomsg( sub_name ,' Hubbard_alpha is not used in CP ') + IF( nosym ) & + CALL infomsg( sub_name ,' nosym not implemented in CP ') + IF( nosym_evc ) & + CALL infomsg( sub_name ,' nosym_evc not implemented in CP ') + IF( noinv ) & + CALL infomsg( sub_name ,' noinv not implemented in CP ') + END IF + ! + ! ... control on SIC variables + ! + IF ( sic /= 'none' ) THEN + ! + IF (sic_epsilon > 1.0_DP ) & + CALL errore( sub_name, & + & ' invalid sic_epsilon, greater than 1.',1 ) + IF (sic_epsilon < 0.0_DP ) & + CALL errore( sub_name, & + & ' invalid sic_epsilon, less than 0 ',1 ) + IF (sic_alpha > 1.0_DP ) & + CALL errore( sub_name, & + & ' invalid sic_alpha, greater than 1.',1 ) + IF (sic_alpha < 0.0_DP ) & + CALL errore( sub_name, & + & ' invalid sic_alpha, less than 0 ',1 ) + ! + IF ( .NOT. force_pairing ) & + CALL errore( sub_name, & + & ' invalid force_pairing with sic activated', 1 ) + IF ( nspin /= 2 ) & + CALL errore( sub_name, & + & ' invalid nspin with sic activated', 1 ) + IF ( tot_magnetization /= 1._DP ) & + CALL errore( sub_name, & + & ' invalid tot_magnetization_ with sic activated', 1 ) + ! + ENDIF + ! + ! ... control on EXX variables + ! + DO i = 1, SIZE( exxdiv_treatment_allowed ) + IF( TRIM(exxdiv_treatment) == exxdiv_treatment_allowed(i) ) allowed = .TRUE. + END DO + IF( .NOT. allowed ) CALL errore(sub_name, & + ' invalid exxdiv_treatment: '//TRIM(exxdiv_treatment), 1 ) + ! + IF ( TRIM(exxdiv_treatment) == "yukawa" .AND. yukawa <= 0.0 ) & + CALL errore(sub_name, ' invalid value for yukawa', 1 ) + ! + IF ( TRIM(exxdiv_treatment) == "vcut_ws" .AND. ecutvcut <= 0.0 ) & + CALL errore(sub_name, ' invalid value for ecutvcut', 1 ) + ! + IF ( x_gamma_extrapolation .AND. ( TRIM(exxdiv_treatment) == "vcut_ws" .OR. & + TRIM(exxdiv_treatment) == "vcut_spherical" ) ) & + CALL errore(sub_name, ' x_gamma_extrapolation cannot be used with vcut', 1 ) + ! + RETURN + ! + END SUBROUTINE + ! + !=----------------------------------------------------------------------=! + ! + ! Check input values for Namelist ELECTRONS + ! + !=----------------------------------------------------------------------=! + ! + !----------------------------------------------------------------------- + SUBROUTINE electrons_checkin( prog ) + !----------------------------------------------------------------------- + ! + IMPLICIT NONE + ! + CHARACTER(LEN=2) :: prog ! ... specify the calling program + CHARACTER(LEN=20) :: sub_name = ' electrons_checkin ' + INTEGER :: i + LOGICAL :: allowed = .FALSE. + ! + ! + DO i = 1, SIZE(electron_dynamics_allowed) + IF( TRIM(electron_dynamics) == & + electron_dynamics_allowed(i) ) allowed = .TRUE. + END DO + IF( .NOT. allowed ) & + CALL errore( sub_name, ' electron_dynamics '''//& + & TRIM(electron_dynamics)//''' not allowed ',1) + IF( emass <= 0.0_DP ) & + CALL errore( sub_name, ' emass less or equal 0 ',1) + IF( emass_cutoff <= 0.0_DP ) & + CALL errore( sub_name, ' emass_cutoff less or equal 0 ',1) + IF( ortho_eps <= 0.0_DP ) & + CALL errore( sub_name, ' ortho_eps less or equal 0 ',1) + IF( ortho_max < 1 ) & + CALL errore( sub_name, ' ortho_max less than 1 ',1) + IF( fnosee <= 0.0_DP ) & + CALL errore( sub_name, ' fnosee less or equal 0 ',1) + IF( ekincw <= 0.0_DP ) & + CALL errore( sub_name, ' ekincw less or equal 0 ',1) + IF( occupation_constraints ) & + CALL errore( sub_name, ' occupation_constraints not yet implemented ',1) + +! + RETURN + END SUBROUTINE + ! + !=----------------------------------------------------------------------=! + ! + ! Check input values for Namelist IONS + ! + !=----------------------------------------------------------------------=! + ! + !----------------------------------------------------------------------- + SUBROUTINE ions_checkin( prog ) + !----------------------------------------------------------------------- + ! + IMPLICIT NONE + ! + CHARACTER(LEN=2) :: prog ! ... specify the calling program + CHARACTER(LEN=20) :: sub_name = ' ions_checkin ' + INTEGER :: i + LOGICAL :: allowed = .FALSE. + ! + ! + DO i = 1, SIZE( phase_space_allowed ) + IF( TRIM( phase_space ) == phase_space_allowed(i) ) allowed = .TRUE. + END DO + IF ( .NOT. allowed ) & + CALL errore( sub_name, ' phase_space '''// & + & TRIM( phase_space )// ''' not allowed ', 1 ) + ! + allowed = .FALSE. + DO i = 1, SIZE(ion_dynamics_allowed) + IF( TRIM(ion_dynamics) == ion_dynamics_allowed(i) ) allowed = .TRUE. + END DO + IF( .NOT. allowed ) & + CALL errore( sub_name, ' ion_dynamics '''// & + & TRIM(ion_dynamics)//''' not allowed ',1) + IF( tempw <= 0.0_DP ) & + CALL errore( sub_name,' tempw out of range ',1) + IF( fnosep( 1 ) <= 0.0_DP ) & + CALL errore( sub_name,' fnosep out of range ',1) + IF( nhpcl > nhclm ) & + CALL infomsg ( sub_name,' nhpcl should be less than nhclm') + IF( nhpcl < 0 ) & + CALL infomsg ( sub_name,' nhpcl out of range ') + IF( ion_nstepe <= 0 ) & + CALL errore( sub_name,' ion_nstepe out of range ',1) + IF( ion_maxstep < 0 ) & + CALL errore( sub_name,' ion_maxstep out of range ',1) + ! + IF (sic /= 'none' .and. sic_rloc == 0.0_DP) & + CALL errore( sub_name, ' invalid sic_rloc with sic activated ', 1 ) + ! + RETURN + ! + END SUBROUTINE + ! + !=----------------------------------------------------------------------=! + ! + ! Check input values for Namelist CELL + ! + !=----------------------------------------------------------------------=! + ! + !=----------------------------------------------------------------------=! + ! + !----------------------------------------------------------------------- + SUBROUTINE cell_checkin( prog ) + !----------------------------------------------------------------------- + ! + IMPLICIT NONE + ! + CHARACTER(LEN=2) :: prog ! ... specify the calling program + CHARACTER(LEN=20) :: sub_name = ' cell_checkin ' + INTEGER :: i + LOGICAL :: allowed = .FALSE. + ! + ! + DO i = 1, SIZE(cell_dynamics_allowed) + IF( TRIM(cell_dynamics) == & + cell_dynamics_allowed(i) ) allowed = .TRUE. + END DO + IF( .NOT. allowed ) & + CALL errore( sub_name, ' cell_dynamics '''// & + TRIM(cell_dynamics)//''' not allowed ',1) + IF( wmass < 0.0_DP ) & + CALL errore( sub_name,' wmass out of range ',1) + IF( prog == 'CP' ) THEN + IF( cell_factor /= 0.0_DP ) & + CALL infomsg( sub_name,' cell_factor not used in CP ') + END IF + IF( cell_nstepe <= 0 ) & + CALL errore( sub_name,' cell_nstepe out of range ',1) + ! + RETURN + ! + END SUBROUTINE + ! + !=----------------------------------------------------------------------=! + ! + ! Set values according to the "calculation" variable + ! + !=----------------------------------------------------------------------=! + ! + !----------------------------------------------------------------------- + SUBROUTINE fixval( prog ) + !----------------------------------------------------------------------- + ! + USE constants, ONLY : e2 + ! + IMPLICIT NONE + ! + CHARACTER(LEN=2) :: prog ! ... specify the calling program + CHARACTER(LEN=20) :: sub_name = ' fixval ' + ! + ! + SELECT CASE( TRIM( calculation ) ) + CASE ('scf') + IF( prog == 'CP' ) THEN + electron_dynamics = 'damp' + ion_dynamics = 'none' + cell_dynamics = 'none' + END IF + CASE ('nscf', 'bands') + IF( prog == 'CP' ) occupations = 'bogus' + IF( prog == 'CP' ) electron_dynamics = 'damp' + CASE ( 'cp-wf' ) + IF( prog == 'CP' ) THEN + electron_dynamics = 'damp' + ion_dynamics = 'damp' + END IF + IF ( prog == 'PW' ) & + CALL errore( sub_name, ' calculation ' // & + & TRIM( calculation ) // ' not implemented ', 1 ) +!========================================================================= +!Lingzhu Kong + CASE ( 'cp-wf-nscf','cp-wf-pbe0','pbe0-nscf' ) + IF( prog == 'CP' ) THEN + occupations = 'fixed' + electron_dynamics = 'damp' + ion_dynamics = 'damp' + END IF + IF ( prog == 'PW' ) & + CALL errore( sub_name, ' calculation ' // & + & TRIM( calculation ) // ' not implemented ', 1 ) +!========================================================================= + CASE ('relax') + IF( prog == 'CP' ) THEN + electron_dynamics = 'damp' + ion_dynamics = 'damp' + ELSE IF( prog == 'PW' ) THEN + ion_dynamics = 'bfgs' + END IF + CASE ( 'md', 'cp' ) + IF( prog == 'CP' ) THEN + electron_dynamics = 'verlet' + ion_dynamics = 'verlet' + ELSE IF( prog == 'PW' ) THEN + ion_dynamics = 'verlet' + END IF + CASE ('vc-relax') + IF( prog == 'CP' ) THEN + electron_dynamics = 'damp' + ion_dynamics = 'damp' + cell_dynamics = 'damp-pr' + ELSE IF( prog == 'PW' ) THEN + ion_dynamics = 'bfgs' + cell_dynamics= 'bfgs' + END IF + CASE ( 'vc-md', 'vc-cp' ) + IF( prog == 'CP' ) THEN + electron_dynamics = 'verlet' + ion_dynamics = 'verlet' + cell_dynamics = 'pr' + ELSE IF( prog == 'PW' ) THEN + ion_dynamics = 'beeman' + END IF + ! + CASE DEFAULT + ! + CALL errore( sub_name,' calculation '// & + & TRIM(calculation)//' not implemented ', 1 ) + ! + END SELECT + ! + IF ( prog == 'PW' ) THEN + ! + IF ( calculation == 'nscf' .OR. calculation == 'bands' ) THEN + ! + startingpot = 'file' + startingwfc = 'atomic+random' + ! + ELSE IF ( restart_mode == "from_scratch" ) THEN + ! + startingwfc = 'atomic+random' + startingpot = 'atomic' + ! + ELSE + ! + startingwfc = 'file' + startingpot = 'file' + ! + END IF + ! + ELSE IF ( prog == 'CP' ) THEN + ! + startingwfc = 'random' + startingpot = ' ' + ! + END IF + ! + IF ( TRIM( sic ) /= 'none' ) THEN + force_pairing = ( nspin == 2 .AND. ( tot_magnetization==0._dp .OR. & + tot_magnetization==1._dp ) ) + END IF + ! + RETURN + ! + END SUBROUTINE + ! + !=----------------------------------------------------------------------=! + ! + ! Namelist parsing main routine + ! + !=----------------------------------------------------------------------=! + ! + !----------------------------------------------------------------------- + SUBROUTINE read_namelists( prog, unit ) + !----------------------------------------------------------------------- + ! + ! this routine reads data from standard input and puts them into + ! module-scope variables (accessible from other routines by including + ! this module, or the one that contains them) + ! ---------------------------------------------- + ! + ! ... declare modules + ! + USE io_global, ONLY : ionode, ionode_id + USE mp, ONLY : mp_bcast + ! + IMPLICIT NONE + ! + ! ... declare variables + ! + CHARACTER(LEN=2) :: prog ! ... specify the calling program + ! prog = 'PW' pwscf + ! prog = 'CP' cpr + ! + ! + INTEGER, INTENT(IN), optional :: unit + ! + ! ... declare other variables + ! + INTEGER :: ios + ! + INTEGER :: unit_loc=5 + ! + ! ... end of declarations + ! + ! ---------------------------------------------- + ! + IF(PRESENT(unit)) unit_loc = unit + ! + IF( prog /= 'PW' .AND. prog /= 'CP' ) & + CALL errore( ' read_namelists ', ' unknown calling program ', 1 ) + ! + ! ... default settings for all namelists + ! + IF( prog == 'PW' .OR. prog == 'CP') THEN + CALL control_defaults( prog ) + CALL system_defaults( prog ) + CALL electrons_defaults( prog ) + CALL ions_defaults( prog ) + CALL cell_defaults( prog ) + CALL ee_defaults( prog ) + ENDIF + ! + ! ... Here start reading standard input file + ! + ! ... CONTROL namelist + ! + IF(prog == 'PW' .OR. prog == 'CP' ) THEN + ios = 0 + IF( ionode ) THEN + READ( unit_loc, control, iostat = ios ) + END IF + CALL mp_bcast( ios, ionode_id ) + IF( ios /= 0 ) THEN + CALL errore( ' read_namelists ', & + & ' reading namelist control ', ABS(ios) ) + END IF + ! + CALL control_bcast( ) + CALL control_checkin( prog ) + ! + ! ... fixval changes some default values according to the value + ! ... of "calculation" read in CONTROL namelist + ! + CALL fixval( prog ) + ! + ! ... SYSTEM namelist + ! + ios = 0 + IF( ionode ) THEN + READ( unit_loc, system, iostat = ios ) + END IF + CALL mp_bcast( ios, ionode_id ) + IF( ios /= 0 ) THEN + CALL errore( ' read_namelists ', & + & ' reading namelist system ', ABS(ios) ) + END IF + ! + CALL system_bcast( ) + ! + CALL system_checkin( prog ) + ! +! CALL allocate_input_ions( ntyp, nat ) + ! + ! ... ELECTRONS namelist + ! + ios = 0 + IF( ionode ) THEN + READ( unit_loc, electrons, iostat = ios ) + END IF + CALL mp_bcast( ios, ionode_id ) + IF( ios /= 0 ) THEN + CALL errore( ' read_namelists ', & + & ' reading namelist electrons ', ABS(ios) ) + END IF + ! + CALL electrons_bcast( ) + CALL electrons_checkin( prog ) + ! + ! ... IONS namelist + ! + ios = 0 + IF ( ionode ) THEN + ! + IF ( TRIM( calculation ) == 'relax' .OR. & + TRIM( calculation ) == 'md' .OR. & + TRIM( calculation ) == 'vc-relax' .OR. & + TRIM( calculation ) == 'vc-md' .OR. & + TRIM( calculation ) == 'cp' .OR. & + TRIM( calculation ) == 'vc-cp' .OR. & + TRIM( calculation ) == 'smd' .OR. & + TRIM( calculation ) == 'cp-wf-nscf' .OR. & !Lingzhu Kong + TRIM( calculation ) == 'cp-wf-pbe0' .OR. & !Lingzhu Kong + TRIM( calculation ) == 'pbe0-nscf' .OR. & !Lingzhu Kong + TRIM( calculation ) == 'cp-wf' ) READ( 5, ions, iostat = ios ) + + END IF + CALL mp_bcast( ios, ionode_id ) + IF( ios /= 0 ) THEN + CALL errore( ' read_namelists ', & + & ' reading namelist ions ', ABS(ios) ) + END IF + ! + CALL ions_bcast( ) + CALL ions_checkin( prog ) + ! + ! ... CELL namelist + ! + ios = 0 + IF( ionode ) THEN + IF( TRIM( calculation ) == 'vc-relax' .OR. & + TRIM( calculation ) == 'vc-cp' .OR. & + TRIM( calculation ) == 'vc-md' .OR. & + TRIM( calculation ) == 'vc-md' ) THEN + READ( unit_loc, cell, iostat = ios ) + END IF + END IF + CALL mp_bcast( ios, ionode_id ) + IF( ios /= 0 ) THEN + CALL errore( ' read_namelists ', & + & ' reading namelist cell ', ABS(ios) ) + END IF + ! + CALL cell_bcast() + CALL cell_checkin( prog ) + ! + ios = 0 + IF( ionode ) THEN + if (tabps) then + READ( unit_loc, press_ai, iostat = ios ) + end if + END IF + CALL mp_bcast( ios, ionode_id ) + IF( ios /= 0 ) THEN + CALL errore( ' read_namelists ', & + & ' reading namelist press_ai ', ABS(ios) ) + END IF + ! + CALL press_ai_bcast() + ! + ! ... EE namelist + ! + IF ( TRIM( assume_isolated ) == 'dcc' ) THEN + ios = 0 + IF( ionode ) READ( unit_loc, ee, iostat = ios ) + CALL mp_bcast( ios, ionode_id ) + IF( ios /= 0 ) CALL errore( ' read_namelists ', & + & ' reading namelist ee ', ABS(ios) ) + END IF + CALL ee_bcast() + ! + ENDIF + ! + RETURN + ! + END SUBROUTINE read_namelists + ! + ! +END MODULE read_namelists_module diff --git a/tests/apps/miniDFT/tests/src/read_pseudo.f90 b/tests/apps/miniDFT/tests/src/read_pseudo.f90 new file mode 100644 index 0000000000..3c2005efa3 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/read_pseudo.f90 @@ -0,0 +1,319 @@ +! +! Copyright (C) 2001-2011 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +!=----------------------------------------------------------------------------=! +MODULE read_pseudo_mod +!=----------------------------------------------------------------------------=! + ! + ! read pseudopotential files. Note that each processor reads! + ! Main input module: + USE io_files, ONLY: pseudo_dir, pseudo_dir_cur, psfile + USE ions_base, ONLY: ntyp => nsp + ! Main output modules: + USE atom, ONLY: msh, rgrid + USE ions_base, ONLY: zv + USE uspp_param, ONLY: upf, newpseudo, oldvan, nvb + USE uspp, ONLY: okvan, nlcc_any + + IMPLICIT NONE + SAVE + PRIVATE + ! + PUBLIC :: readpp + ! + CONTAINS + ! + !----------------------------------------------------------------------- +SUBROUTINE readpp ( input_dft, printout ) + !----------------------------------------------------------------------- + ! + ! read PP files and put the result into the "upf" structure + ! set DFT to input_dft if present, to the value read in PP files otherwise + ! + USE kinds, ONLY: DP + USE mp, ONLY: mp_bcast, mp_sum + USE io_global, ONLY: stdout, ionode + USE pseudo_types, ONLY: pseudo_upf, nullify_pseudo_upf, deallocate_pseudo_upf + USE funct, ONLY: enforce_input_dft, & + get_iexch, get_icorr, get_igcx, get_igcc, get_inlc + use radial_grids, ONLY: deallocate_radial_grid, nullify_radial_grid + USE wrappers, ONLY: md5_from_file + USE upf_module, ONLY: read_upf + USE upf_to_internal, ONLY: set_pseudo_upf + ! + IMPLICIT NONE + ! + CHARACTER(len=*), INTENT(INOUT) :: input_dft + LOGICAL, OPTIONAL, INTENT(IN) :: printout + ! + REAL(DP), parameter :: rcut = 10.d0 + CHARACTER(len=256) :: file_pseudo ! file name complete with path + LOGICAL :: printout_ = .FALSE. + INTEGER :: iunps, isupf, nt, nb, ir, ios + INTEGER :: iexch_, icorr_, igcx_, igcc_, inlc_ + ! + ! ... initialization: allocate radial grids etc + ! + iunps = 4 + IF( ALLOCATED( rgrid ) ) THEN + DO nt = 1, SIZE( rgrid ) + CALL deallocate_radial_grid( rgrid( nt ) ) + CALL nullify_radial_grid( rgrid( nt ) ) + END DO + DEALLOCATE( rgrid ) + if(allocated(msh)) DEALLOCATE( msh ) + END IF + + ALLOCATE( rgrid( ntyp ), msh( ntyp ) ) + + DO nt = 1, ntyp + CALL nullify_radial_grid( rgrid( nt ) ) + END DO + + IF( ALLOCATED( upf ) ) THEN + DO nt = 1, SIZE( upf ) + CALL deallocate_pseudo_upf( upf( nt ) ) + CALL nullify_pseudo_upf( upf( nt ) ) + END DO + DEALLOCATE( upf ) + END IF + ! + ALLOCATE ( upf( ntyp ) ) + ! + ! nullify upf objects as soon as they are instantiated + ! + do nt = 1, ntyp + CALL nullify_pseudo_upf( upf( nt ) ) + end do + ! + IF (input_dft /='none') CALL enforce_input_dft (input_dft) + ! + IF ( PRESENT(printout) ) THEN + printout_ = printout + END IF + IF ( ionode .AND. printout_) THEN + WRITE( stdout,"(//,3X,'Atomic Pseudopotentials Parameters',/, & + & 3X,'----------------------------------' )" ) + END IF + ! + nvb = 0 + do nt = 1, ntyp + ! + ! + ! variables not necessary for USPP, but necessary for PAW; + ! will be read from file if it is a PAW dataset. + ! + rgrid(nt)%xmin = 0.d0 + rgrid(nt)%dx = 0.d0 + ! + ! try first pseudo_dir_cur if set: in case of restart from file, + ! this is where PP files should be located + ! + ios = 1 + IF ( pseudo_dir_cur /= ' ' ) THEN + file_pseudo = TRIM (pseudo_dir_cur) // TRIM (psfile(nt)) + OPEN (unit = iunps, file = file_pseudo, status = 'old', & + form = 'formatted', action='read', iostat = ios) + CALL mp_sum (ios) + IF ( ios /= 0 ) CALL infomsg & + ('readpp', 'file '//TRIM(file_pseudo)//' not found') + ! + ! file not found? no panic (yet): if the restart file is not visible + ! to all processors, this may happen. Try the original location + END IF + ! + ! try the original location pseudo_dir, as set in input + ! (it should already contain a slash at the end) + ! + IF ( ios /= 0 ) THEN + file_pseudo = TRIM (pseudo_dir) // TRIM (psfile(nt)) + OPEN (unit = iunps, file = file_pseudo, status = 'old', & + form = 'formatted', action='read', iostat = ios) + CALL mp_sum (ios) + CALL errore('readpp', 'file '//TRIM(file_pseudo)//' not found',ABS(ios)) + END IF + ! + upf(nt)%grid => rgrid(nt) + ! + ! start reading - UPF first: the UPF format is detected via the + ! presence of the keyword '' at the beginning of the file + ! + IF( ionode .AND. printout_ ) THEN + WRITE( stdout, "(/,3X,'Reading pseudopotential for specie # ',I2, & + & ' from file :',/,3X,A)") nt, TRIM(file_pseudo) + END IF + ! + call read_upf(upf(nt), rgrid(nt), isupf, unit=iunps) + ! + if (isupf ==-1 .OR. isupf== 0) then + ! + IF( ionode .AND. printout_ ) & + WRITE( stdout, "(3X,'file type is UPF v.',i1)") isupf+2 + call set_pseudo_upf (nt, upf(nt)) + ! + ! UPF is assumed to be multi-projector + ! + newpseudo (nt) = .true. + ! + else + CALL errore('readpp', 'Only UPF pseudopotentials are supported in mini_DFT', 1 ) + ! + endif + ! + ! end of reading + ! + close (iunps) + ! + ! Calculate MD5 checksum for this pseudopotential + ! + CALL md5_from_file(file_pseudo, upf(nt)%md5_cksum) + ! + ! ... Zv = valence charge of the (pseudo-)atom, read from PP files, + ! ... is set equal to Zp = pseudo-charge of the pseudopotential + ! + zv(nt) = upf(nt)%zp + ! + ! ... count US species + ! + ! + ! ... Check for DFT consistency - ignored if dft enforced from input + ! + IF (nt == 1) THEN + iexch_ = get_iexch() + icorr_ = get_icorr() + igcx_ = get_igcx() + igcc_ = get_igcc() + inlc_ = get_inlc() + ELSE + IF ( iexch_ /= get_iexch() .OR. icorr_ /= get_icorr() .OR. & + igcx_ /= get_igcx() .OR. igcc_ /= get_igcc() .OR. & + inlc_ /= get_inlc() ) THEN + CALL errore( 'readpp','inconsistent DFT read from PP files', nt) + END IF + END IF + ! + ! the radial grid is defined up to r(mesh) but we introduce + ! an auxiliary variable msh to limit the grid up to rcut=10 a.u. + ! This is used to cut off the numerical noise arising from the + ! large-r tail in cases like the integration of V_loc-Z/r + ! + do ir = 1, rgrid(nt)%mesh + if (rgrid(nt)%r(ir) > rcut) then + msh (nt) = ir + goto 5 + endif + enddo + msh (nt) = rgrid(nt)%mesh +5 msh (nt) = 2 * ( (msh (nt) + 1) / 2) - 1 + ! + ! msh is forced to be odd for simpson integration (maybe obsolete?) + ! + ! check for zero atomic wfc, + ! check that (occupied) atomic wfc are properly normalized + ! + call check_atwfc_norm(nt) + ! + enddo + ! + ! more intializations + ! + okvan = ( nvb > 0 ) + nlcc_any = ANY ( upf(1:ntyp)%nlcc ) + ! + return +end subroutine readpp +!----------------------------------------------------------------------- +integer & +function pseudo_type (psfile) + !----------------------------------------------------------------------- + implicit none + character (len=*) :: psfile + integer :: l + ! + l = len_trim (psfile) + pseudo_type = 0 + if (psfile (l - 3:l) .eq.'.vdb'.or.psfile (l - 3:l) .eq.'.van') & + pseudo_type = 1 + if (l > 5) then + if (psfile (l - 5:l) .eq.'.RRKJ3') pseudo_type = 2 + end if + ! + return + +end function pseudo_type + +!--------------------------------------------------------------- +SUBROUTINE check_atwfc_norm(nt) + !--------------------------------------------------------------- + ! check for the presence of zero wavefunctions first + ! check the normalization of the atomic wfc (only those with non-negative + ! occupations) and renormalize them if the calculated norm is incorrect + ! by more than eps6 (10^{-6}) + ! + USE kinds, ONLY : dp + USE constants, ONLY : eps6, eps8 + USE io_global, ONLY : stdout + + implicit none + + integer,intent(in) :: nt ! index of the pseudopotential to be checked + ! + integer :: & + mesh, kkbeta, & ! auxiliary indices of integration limits + l, & ! orbital angular momentum + iwfc, ir, & ! counter on atomic wfcs and on radial mesh + ibeta, ibeta1, ibeta2 ! counters on betas + logical :: & + match ! a logical variable + real(DP) :: & + norm, & ! the norm + j ! total (spin+orbital) angular momentum + real(DP), allocatable :: & + work(:), gi(:) ! auxiliary variable for becp + character (len=80) :: renorm + ! + allocate (work(upf(nt)%nbeta), gi(upf(nt)%grid%mesh) ) + + ! define indices for integration limits + mesh = upf(nt)%grid%mesh + kkbeta = upf(nt)%kkbeta + ! + renorm = ' ' + DO iwfc = 1, upf(nt)%nwfc + l = upf(nt)%lchi(iwfc) + ! + ! the smooth part first .. + gi(1:mesh) = upf(nt)%chi(1:mesh,iwfc) * upf(nt)%chi(1:mesh,iwfc) + call simpson (mesh, gi, upf(nt)%grid%rab, norm) + ! + IF ( norm < eps8 ) then + WRITE( stdout,'(5X,"WARNING: atomic wfc # ",i2, & + & " for atom type",i2," has zero norm")') iwfc, nt + ! + ! set occupancy to a small negative number so that this wfc + ! is not going to be used for starting wavefunctions + ! + upf(nt)%oc (iwfc) = -eps8 + END IF + ! + IF ( upf(nt)%oc(iwfc) < 0.d0) CYCLE ! only occupied states are normalized + ! + norm=sqrt(norm) + if (abs(norm-1.0_dp) > eps6 ) then + renorm = TRIM(renorm) // ' ' // upf(nt)%els(iwfc) + upf(nt)%chi(1:mesh,iwfc)=upf(nt)%chi(1:mesh,iwfc)/norm + end if + end do + deallocate (work, gi ) + IF ( LEN_TRIM(renorm) > 0 ) WRITE( stdout, & + '(15x,"file ",a,": wavefunction(s) ",a," renormalized")') & + TRIM(psfile(nt)),TRIM(renorm) + RETURN + ! +END SUBROUTINE check_atwfc_norm + +END MODULE read_pseudo_mod diff --git a/tests/apps/miniDFT/tests/src/recips.f90 b/tests/apps/miniDFT/tests/src/recips.f90 new file mode 100644 index 0000000000..ccecd2c0f1 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/recips.f90 @@ -0,0 +1,77 @@ +! +! Copyright (C) 2001 PWSCF group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +!--------------------------------------------------------------------- + +subroutine recips (a1, a2, a3, b1, b2, b3) + !--------------------------------------------------------------------- + ! + ! This routine generates the reciprocal lattice vectors b1,b2,b3 + ! given the real space vectors a1,a2,a3. The b's are units of 2 pi/a. + ! + ! first the input variables + ! + use kinds, ONLY: DP + implicit none + real(DP) :: a1 (3), a2 (3), a3 (3), b1 (3), b2 (3), b3 (3) + ! input: first direct lattice vector + ! input: second direct lattice vector + ! input: third direct lattice vector + ! output: first reciprocal lattice vector + ! output: second reciprocal lattice vector + ! output: third reciprocal lattice vector + ! + ! then the local variables + ! + real(DP) :: den, s + ! the denominator + ! the sign of the permutations + integer :: iperm, i, j, k, l, ipol + ! counter on the permutations + !\ + ! Auxiliary variables + !/ + ! + ! Counter on the polarizations + ! + ! first we compute the denominator + ! + den = 0 + i = 1 + j = 2 + k = 3 + s = 1.d0 +100 do iperm = 1, 3 + den = den + s * a1 (i) * a2 (j) * a3 (k) + l = i + i = j + j = k + k = l + enddo + i = 2 + j = 1 + k = 3 + s = - s + if (s.lt.0.d0) goto 100 + ! + ! here we compute the reciprocal vectors + ! + i = 1 + j = 2 + k = 3 + do ipol = 1, 3 + b1 (ipol) = (a2 (j) * a3 (k) - a2 (k) * a3 (j) ) / den + b2 (ipol) = (a3 (j) * a1 (k) - a3 (k) * a1 (j) ) / den + b3 (ipol) = (a1 (j) * a2 (k) - a1 (k) * a2 (j) ) / den + l = i + i = j + j = k + k = l + enddo + return +end subroutine recips diff --git a/tests/apps/miniDFT/tests/src/recvec.f90 b/tests/apps/miniDFT/tests/src/recvec.f90 new file mode 100644 index 0000000000..a1571bab0f --- /dev/null +++ b/tests/apps/miniDFT/tests/src/recvec.f90 @@ -0,0 +1,202 @@ +! +! Copyright (C) 2010 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +!=----------------------------------------------------------------------------=! + MODULE gvect +!=----------------------------------------------------------------------------=! + + ! ... variables describing the reciprocal lattice vectors + ! ... G vectors with |G|^2 < ecutrho, cut-off for charge density + ! ... With gamma tricks, G-vectors are divided into two half-spheres, + ! ... G> and G<, containing G and -G (G=0 is in G>) + ! ... This is referred to as the "dense" (or "hard", or "thick") grid + + USE kinds, ONLY: DP + + IMPLICIT NONE + SAVE + + INTEGER :: ngm = 0 ! local number of G vectors (on this processor) + ! with gamma tricks, only vectors in G> + INTEGER :: ngm_g= 0 ! global number of G vectors (summed on all procs) + ! in serial execution, ngm_g = ngm + INTEGER :: ngl = 0 ! number of G-vector shells + INTEGER :: ngmx = 0 ! local number of G vectors, maximum across all procs + + REAL(DP) :: ecutrho = 0.0_DP ! energy cut-off for charge density + REAL(DP) :: gcutm = 0.0_DP ! ecutrho/(2 pi/a)^2, cut-off for |G|^2 + + ! nl = fft index for G-vectors (with gamma tricks, only for G>) + ! nlm = as above, for G< (used only with gamma tricks) + + INTEGER, ALLOCATABLE :: nl(:), nlm(:) + + INTEGER :: gstart = 2 ! index of the first G vector whose module is > 0 + ! Needed in parallel execution: gstart=2 for the + ! proc that holds G=0, gstart=1 for all others + + ! G^2 in increasing order (in units of tpiba2=(2pi/a)^2) + ! + REAL(DP), ALLOCATABLE, TARGET :: gg(:) + + ! gl(i) = i-th shell of G^2 (in units of tpiba2) + ! igtongl(n) = shell index for n-th G-vector + ! + REAL(DP), POINTER :: gl(:) + INTEGER, ALLOCATABLE, TARGET :: igtongl(:) + ! + ! G-vectors cartesian components ( in units tpiba =(2pi/a) ) + ! + REAL(DP), ALLOCATABLE, TARGET :: g(:,:) + + ! mill = miller index of G vectors (local to each processor) + ! G(:) = mill(1)*bg(:,1)+mill(2)*bg(:,2)+mill(3)*bg(:,3) + ! where bg are the reciprocal lattice basis vectors + ! + INTEGER, ALLOCATABLE, TARGET :: mill(:,:) + + ! ig_l2g = converts a local G-vector index into the global index + ! ("l2g" means local to global): ig_l2g(i) = index of i-th + ! local G-vector in the global array of G-vectors + ! + INTEGER, ALLOCATABLE, TARGET :: ig_l2g(:) + ! + ! sortedig_l2g = array obtained by sorting ig_l2g + ! + INTEGER, ALLOCATABLE, TARGET :: sortedig_l2g(:) + ! + ! mill_g = miller index of all G vectors + ! + INTEGER, ALLOCATABLE, TARGET :: mill_g(:,:) + ! + ! the phases e^{-iG*tau_s} used to calculate structure factors + ! + COMPLEX(DP), ALLOCATABLE :: eigts1(:,:), eigts2(:,:), eigts3(:,:) + ! + CONTAINS + + SUBROUTINE gvect_init( ngm_ , comm ) + ! + ! Set local and global dimensions, allocate arrays + ! + USE mp, ONLY: mp_max, mp_sum + IMPLICIT NONE + INTEGER, INTENT(IN) :: ngm_ + INTEGER, INTENT(IN) :: comm ! communicator of the group on which g-vecs are distributed + ! + ngm = ngm_ + ! + ! calculate maximum over all processors + ! + ngmx = ngm + CALL mp_max( ngmx, comm ) + ! + ! calculate sum over all processors + ! + ngm_g = ngm + CALL mp_sum( ngm_g, comm ) + ! + ! allocate arrays - only those that are always kept until the end + ! + ALLOCATE( gg(ngm) ) + ALLOCATE( g(3, ngm) ) + ALLOCATE( mill(3, ngm) ) + ALLOCATE( nl (ngm) ) + ALLOCATE( nlm(ngm) ) + ALLOCATE( ig_l2g(ngm) ) + ALLOCATE( igtongl(ngm) ) + ! + RETURN + ! + END SUBROUTINE gvect_init + + SUBROUTINE deallocate_gvect() + IF( ALLOCATED( gg ) ) DEALLOCATE( gg ) + IF( ASSOCIATED( gl ) ) DEALLOCATE( gl ) + IF( ALLOCATED( g ) ) DEALLOCATE( g ) + IF( ALLOCATED( mill_g ) ) DEALLOCATE( mill_g ) + IF( ALLOCATED( mill ) ) DEALLOCATE( mill ) + IF( ALLOCATED( igtongl ) ) DEALLOCATE( igtongl ) + IF( ALLOCATED( ig_l2g ) ) DEALLOCATE( ig_l2g ) + IF( ALLOCATED( sortedig_l2g ) ) DEALLOCATE( sortedig_l2g ) + IF( ALLOCATED( eigts1 ) ) DEALLOCATE( eigts1 ) + IF( ALLOCATED( eigts2 ) ) DEALLOCATE( eigts2 ) + IF( ALLOCATED( eigts3 ) ) DEALLOCATE( eigts3 ) + IF( ALLOCATED( nl ) ) DEALLOCATE( nl ) + IF( ALLOCATED( nlm ) ) DEALLOCATE( nlm ) + END SUBROUTINE deallocate_gvect + +!=----------------------------------------------------------------------------=! + END MODULE gvect +!=----------------------------------------------------------------------------=! + +!=----------------------------------------------------------------------------=! + MODULE gvecs +!=----------------------------------------------------------------------------=! + USE kinds, ONLY: DP + + IMPLICIT NONE + SAVE + + ! ... G vectors with |G|^2 < 4*ecutwfc, cut-off for wavefunctions + ! ... ("smooth" grid). Gamma tricks and units as for the "dense" grid + ! + INTEGER :: ngms = 0 ! local number of smooth vectors (on this processor) + INTEGER :: ngms_g=0 ! global number of smooth vectors (summed on procs) + ! in serial execution this is equal to ngms + INTEGER :: ngsx = 0 ! local number of smooth vectors, max across procs + + ! nl = fft index for smooth vectors (with gamma tricks, only for G>) + ! nlm = as above, for G< (used only with gamma tricks) + + INTEGER, ALLOCATABLE :: nls(:), nlsm(:) + + REAL(DP) :: ecuts = 0.0_DP ! energy cut-off = 4*ecutwfc + REAL(DP) :: gcutms= 0.0_DP ! ecuts/(2 pi/a)^2, cut-off for |G|^2 + + REAL(DP) :: dual = 0.0_DP ! ecutrho=dual*ecutwfc + LOGICAL :: doublegrid = .FALSE. ! true if smooth and dense grid differ + ! doublegrid = (dual > 4) + + CONTAINS + + SUBROUTINE gvecs_init( ngs_ , comm ) + USE mp, ONLY: mp_max, mp_sum + IMPLICIT NONE + INTEGER, INTENT(IN) :: ngs_ + INTEGER, INTENT(IN) :: comm ! communicator of the group on which g-vecs are distributed + ! + ngms = ngs_ + ! + ! calculate maximum over all processors + ! + ngsx = ngms + CALL mp_max( ngsx, comm ) + ! + ! calculate sum over all processors + ! + ngms_g = ngms + CALL mp_sum( ngms_g, comm ) + ! + ! allocate arrays + ! + ALLOCATE( nls (ngms) ) + ALLOCATE( nlsm(ngms) ) + ! + RETURN + ! + END SUBROUTINE gvecs_init + + SUBROUTINE deallocate_gvecs() + IF( ALLOCATED( nls ) ) DEALLOCATE( nls ) + IF( ALLOCATED( nlsm ) ) DEALLOCATE( nlsm ) + END SUBROUTINE deallocate_gvecs + +!=----------------------------------------------------------------------------=! + END MODULE gvecs +!=----------------------------------------------------------------------------=! + diff --git a/tests/apps/miniDFT/tests/src/recvec_subs.f90 b/tests/apps/miniDFT/tests/src/recvec_subs.f90 new file mode 100644 index 0000000000..2f56b465ce --- /dev/null +++ b/tests/apps/miniDFT/tests/src/recvec_subs.f90 @@ -0,0 +1,333 @@ +! +! Copyright (C) 2011 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +!=----------------------------------------------------------------------= +MODULE recvec_subs +!=----------------------------------------------------------------------= + +! ... subroutines generating G-vectors and variables nl* needed to map +! ... G-vector components onto the FFT grid(s) in reciprocal space + +! ... Most important dependencies: next three modules + USE gvect, ONLY : ig_l2g, g, gg, ngm, ngm_g, gcutm, & + mill, nl, gstart + USE gvecs, ONLY : ngms, gcutms, ngms_g, nls + USE fft_base, ONLY : dfftp, dffts +! + USE kinds, ONLY : DP + USE constants, ONLY : eps8 + + PRIVATE + SAVE + + PUBLIC :: ggen + +!=----------------------------------------------------------------------= +CONTAINS +!=----------------------------------------------------------------------= +! + !----------------------------------------------------------------------- + SUBROUTINE ggen ( gamma_only, at, bg ) + !---------------------------------------------------------------------- + ! + ! This routine generates all the reciprocal lattice vectors + ! contained in the sphere of radius gcutm. Furthermore it + ! computes the indices nl which give the correspondence + ! between the fft mesh points and the array of g vectors. + ! + USE mp, ONLY: mp_rank, mp_size, mp_sum + ! + IMPLICIT NONE + ! + LOGICAL, INTENT(IN) :: gamma_only + REAL(DP), INTENT(IN) :: at(3,3), bg(3,3) +#ifdef __LOWMEM + INTEGER, INTENT(IN) :: comm +#endif + ! here a few local variables + ! + REAL(DP) :: t (3), tt + INTEGER :: ngm_, ngms_, n1, n2, n3, n1s, n2s, n3s, ngm_offset + ! + REAL(DP), ALLOCATABLE :: g2sort_g(:) + ! array containing all g vectors, on all processors: replicated data + ! when compiling with __LOWMEM only g vectors for the current processor are stored + INTEGER, ALLOCATABLE :: mill_g(:,:), mill_unsorted(:,:) + ! array containing all g vectors generators, on all processors: replicated data + ! when compiling with __LOWMEM only g vectors for the current processor are stored + INTEGER, ALLOCATABLE :: igsrt(:) + ! + INTEGER :: m1, m2, mc + INTEGER :: ni, nj, nk, i, j, k, ipol, ng, igl, indsw + INTEGER :: mype, npe + INTEGER, ALLOCATABLE :: ngmpe(:) + ! +#ifdef __LOWMEM + mype = mp_rank( comm ) + npe = mp_size( comm ) + ALLOCATE( ngmpe( npe ) ) + ngmpe = 0 +#endif + ! + ! counters + ! + ! set the total number of fft mesh points and and initial value of gg + ! The choice of gcutm is due to the fact that we have to order the + ! vectors after computing them. + ! + gg(:) = gcutm + 1.d0 + ! + ! and computes all the g vectors inside a sphere + ! +#ifdef __LOWMEM + ALLOCATE( mill_g( 3, ngm ),mill_unsorted( 3, ngm ) ) + ALLOCATE( igsrt( ngm ) ) + ALLOCATE( g2sort_g( ngm ) ) +#else + ALLOCATE( mill_g( 3, ngm_g ),mill_unsorted( 3, ngm_g ) ) + ALLOCATE( igsrt( ngm_g ) ) + ALLOCATE( g2sort_g( ngm_g ) ) +#endif + g2sort_g(:) = 1.0d20 + ! + ! save current value of ngm and ngms + ! + ngm_ = ngm + ngms_ = ngms + ! + ngm = 0 + ngms = 0 + ! + ! max miller indices (same convention as in module stick_set) + ! + ni = (dfftp%nr1-1)/2 + nj = (dfftp%nr2-1)/2 + nk = (dfftp%nr3-1)/2 + ! + iloop: DO i = -ni, ni + ! + ! gamma-only: exclude space with x < 0 + ! + IF ( gamma_only .and. i < 0) CYCLE iloop + jloop: DO j = -nj, nj + ! + ! gamma-only: exclude plane with x = 0, y < 0 + ! + IF ( gamma_only .and. i == 0 .and. j < 0) CYCLE jloop + +#if defined (__LOWMEM) + m1 = mod (i, dfftp%nr1) + 1 + IF (m1 < 1) m1 = m1 + dfftp%nr1 + m2 = mod (j, dfftp%nr2) + 1 + IF (m2 < 1) m2 = m2 + dfftp%nr2 + mc = m1 + (m2 - 1) * dfftp%nr1x + IF ( dfftp%isind ( mc ) == 0) CYCLE jloop +#endif + kloop: DO k = -nk, nk + ! + ! gamma-only: exclude line with x = 0, y = 0, z < 0 + ! + IF ( gamma_only .and. i == 0 .and. j == 0 .and. k < 0) CYCLE kloop + t(:) = i * bg (:,1) + j * bg (:,2) + k * bg (:,3) + tt = sum(t(:)**2) + IF (tt <= gcutm) THEN + ngm = ngm + 1 + IF (tt <= gcutms) ngms = ngms + 1 +#ifdef __LOWMEM + IF (ngm > ngm_) CALL errore ('ggen', 'too many g-vectors', ngm) +#else + IF (ngm > ngm_g) CALL errore ('ggen', 'too many g-vectors', ngm) +#endif + mill_unsorted( :, ngm ) = (/ i,j,k /) + IF ( tt > eps8 ) THEN + g2sort_g(ngm) = tt + ELSE + g2sort_g(ngm) = 0.d0 + ENDIF + ENDIF + ENDDO kloop + ENDDO jloop + ENDDO iloop + +#ifdef __LOWMEM + ngmpe( mype + 1 ) = ngm + CALL mp_sum( ngmpe, comm ) + IF (ngm /= ngm_ ) & + CALL errore ('ggen', 'g-vectors missing !', abs(ngm - ngm_)) + IF (ngms /= ngms_) & + CALL errore ('ggen', 'smooth g-vectors missing !', abs(ngms - ngms_)) +#else + IF (ngm /= ngm_g ) & + CALL errore ('ggen', 'g-vectors missing !', abs(ngm - ngm_g)) + IF (ngms /= ngms_g) & + CALL errore ('ggen', 'smooth g-vectors missing !', abs(ngms - ngms_g)) +#endif + + + igsrt(1) = 0 +#ifdef __LOWMEM + CALL hpsort_eps( ngm, g2sort_g, igsrt, eps8 ) +#else + CALL hpsort_eps( ngm_g, g2sort_g, igsrt, eps8 ) +#endif + mill_g(1,:) = mill_unsorted(1,igsrt(:)) + mill_g(2,:) = mill_unsorted(2,igsrt(:)) + mill_g(3,:) = mill_unsorted(3,igsrt(:)) + DEALLOCATE( g2sort_g, igsrt, mill_unsorted ) + +#ifdef __LOWMEM + ! compute adeguate offsets in order to avoid overlap between + ! g vectors once they are gathered on a single (global) array + ! + ngm_offset = 0 + DO ng = 1, mype + ngm_offset = ngm_offset + ngmpe( ng ) + END DO +#endif + + ngm = 0 + ngms = 0 + ! + ngloop: DO ng = 1, ngm_g + + i = mill_g(1, ng) + j = mill_g(2, ng) + k = mill_g(3, ng) + +#if !defined (__LOWMEM) + m1 = mod (i, dfftp%nr1) + 1 + IF (m1 < 1) m1 = m1 + dfftp%nr1 + m2 = mod (j, dfftp%nr2) + 1 + IF (m2 < 1) m2 = m2 + dfftp%nr2 + mc = m1 + (m2 - 1) * dfftp%nr1x + IF ( dfftp%isind ( mc ) == 0) CYCLE ngloop +#endif + + ngm = ngm + 1 + + ! Here map local and global g index !!! + ! N.B. the global G vectors arrangement depends on the number of processors + ! +#if defined (__LOWMEM) + ig_l2g( ngm ) = ng + ngm_offset +#else + ig_l2g( ngm ) = ng +#endif + + g (1:3, ngm) = i * bg (:, 1) + j * bg (:, 2) + k * bg (:, 3) + gg (ngm) = sum(g (1:3, ngm)**2) + + IF (gg (ngm) <= gcutms) ngms = ngms + 1 + IF (ngm > ngm_) CALL errore ('ggen', 'too many g-vectors', ngm) + ENDDO ngloop + + IF (ngm /= ngm_) & + CALL errore ('ggen', 'g-vectors missing !', abs(ngm - ngm_)) + ! + ! determine first nonzero g vector + ! + IF (gg(1).le.eps8) THEN + gstart=2 + ELSE + gstart=1 + ENDIF + ! + ! Now set nl and nls with the correct fft correspondence + ! + DO ng = 1, ngm + n1 = nint (sum(g (:, ng) * at (:, 1))) + 1 + mill (1,ng) = n1 - 1 + n1s = n1 + IF (n1<1) n1 = n1 + dfftp%nr1 + IF (n1s<1) n1s = n1s + dffts%nr1 + + n2 = nint (sum(g (:, ng) * at (:, 2))) + 1 + mill (2,ng) = n2 - 1 + n2s = n2 + IF (n2<1) n2 = n2 + dfftp%nr2 + IF (n2s<1) n2s = n2s + dffts%nr2 + + n3 = nint (sum(g (:, ng) * at (:, 3))) + 1 + mill (3,ng) = n3 - 1 + n3s = n3 + IF (n3<1) n3 = n3 + dfftp%nr3 + IF (n3s<1) n3s = n3s + dffts%nr3 + + IF (n1>dfftp%nr1 .or. n2>dfftp%nr2 .or. n3>dfftp%nr3) & + CALL errore('ggen','Mesh too small?',ng) + + nl (ng) = n3 + ( dfftp%isind (n1 + (n2 - 1) * dfftp%nr1x) - 1) * dfftp%nr3x + IF (ng <= ngms) & + nls (ng) = n3s + ( dffts%isind(n1s+(n2s-1)*dffts%nr1x) - 1 ) * dffts%nr3x + ENDDO + ! + DEALLOCATE( mill_g ) + + + IF( ALLOCATED( ngmpe ) ) DEALLOCATE( ngmpe ) + + END SUBROUTINE ggen + ! +!=----------------------------------------------------------------------= + END MODULE recvec_subs +!=----------------------------------------------------------------------= +! +!----------------------------------------------------------------------- +SUBROUTINE gshells ( vc ) + !---------------------------------------------------------------------- + ! + ! calculate number of G shells: ngl, and the index ng = igtongl(ig) + ! that gives the shell index ng for (lacal) G-vector of index ig + ! + USE kinds, ONLY : DP + USE gvect, ONLY : gg, ngm, gl, ngl, igtongl + USE constants, ONLY : eps8 + ! + IMPLICIT NONE + ! + LOGICAL, INTENT(IN) :: vc + ! + INTEGER :: ng, igl + ! + IF ( vc ) THEN + ! + ! in case of a variable cell run each G vector has its shell + ! + ngl = ngm + gl => gg + DO ng = 1, ngm + igtongl (ng) = ng + ENDDO + ELSE + ! + ! G vectors are grouped in shells with the same norm + ! + ngl = 1 + igtongl (1) = 1 + DO ng = 2, ngm + IF (gg (ng) > gg (ng - 1) + eps8) THEN + ngl = ngl + 1 + ENDIF + igtongl (ng) = ngl + ENDDO + + ALLOCATE (gl( ngl)) + gl (1) = gg (1) + igl = 1 + DO ng = 2, ngm + IF (gg (ng) > gg (ng - 1) + eps8) THEN + igl = igl + 1 + gl (igl) = gg (ng) + ENDIF + ENDDO + + IF (igl /= ngl) CALL errore ('setup', 'igl <> ngl', ngl) + + ENDIF + + END SUBROUTINE gshells diff --git a/tests/apps/miniDFT/tests/src/remove_atomic_rho.f90 b/tests/apps/miniDFT/tests/src/remove_atomic_rho.f90 new file mode 100644 index 0000000000..c1904c9994 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/remove_atomic_rho.f90 @@ -0,0 +1,44 @@ +! +! Copyright (C) 2001 PWSCF group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +!----------------------------------------------------------------------- +subroutine remove_atomic_rho + !----------------------------------------------------------------------- + USE io_global, ONLY: stdout + USE io_files, ONLY: output_drho + USE kinds, ONLY: DP + USE fft_base, ONLY: dfftp + USE lsda_mod, ONLY: nspin + USE scf, ONLY: rho + implicit none + + real(DP), allocatable :: work (:,:) + ! workspace, is the difference between the charge density + ! and the superposition of atomic charges + + allocate ( work( dfftp%nnr, 1 ) ) + work = 0.d0 + ! + IF ( nspin > 1 ) CALL errore & + ( 'remove_atomic_rho', 'spin polarization not allowed in drho', 1 ) + + WRITE( stdout, '(/5x,"remove atomic charge density from scf rho")') + ! + ! subtract the old atomic charge density + ! + call atomic_rho (work, nspin) + ! + work = rho%of_r - work + ! + call infomsg("remove_atomic_rho.f90:38","skipping write_rho, requires iotk") + !call write_rho ( work, 1, output_drho ) + ! + deallocate(work) + return + +end subroutine remove_atomic_rho + diff --git a/tests/apps/miniDFT/tests/src/remove_tot_torque.f90 b/tests/apps/miniDFT/tests/src/remove_tot_torque.f90 new file mode 100644 index 0000000000..e2a8f6f127 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/remove_tot_torque.f90 @@ -0,0 +1,118 @@ +! +! Copyright (C) 2001-2006 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +!---------------------------------------------------------------------------- +SUBROUTINE remove_tot_torque( nat, tau, mass, force ) + !---------------------------------------------------------------------------- + ! + ! ... This routine sets to zero the total torque associated to the internal + ! ... forces acting on the atoms by correcting the force vector. + ! + ! ... The algorithm is based on the following expressions ( F' is the + ! ... torqueless force ) : + ! _ + ! _ 1 \ __ _ __ _ _ + ! ... m = --- /_ dR_i /\ F_i , dR_i = ( R_i - R_cm ) , + ! N i + ! + ! __ _ 1 _ __ + ! ... F'_i = F_i - -------- m /\ dR_i + ! |dR_i|^2 + ! + ! + ! ... written by carlo sbraccia (2006) + ! + USE kinds, ONLY : DP + ! + IMPLICIT NONE + ! + INTEGER, INTENT(IN) :: nat + REAL(DP), INTENT(IN) :: tau(3,nat) + REAL(DP), INTENT(IN) :: mass(nat) + REAL(DP), INTENT(INOUT) :: force(3,nat) + ! + INTEGER :: ia + REAL(DP) :: m(3), mo(3), tauref(3), delta(3), sumf(3) + REAL(DP) :: nrmsq + ! + ! + tauref(:) = 0.D0 + ! + DO ia = 1, nat + ! + tauref(:) = tauref(:) + tau(:,ia)*mass(ia) + ! + END DO + ! + tauref(:) = tauref(:) / SUM( mass(:) ) + ! + m(:) = 0.D0 + ! + DO ia = 1, nat + ! + delta(:) = tau(:,ia) - tauref(:) + ! + m(:) = m(:) + ext_prod( delta(:), force(:,ia) ) + ! + END DO + ! + mo(:) = m(:) + ! + m(:) = m(:) / DBLE( nat ) + ! + sumf(:) = 0.D0 + ! + DO ia = 1, nat + ! + delta(:) = tau(:,ia) - tauref(:) + ! + nrmsq = delta(1)**2 + delta(2)**2 + delta(3)**2 + ! + force(:,ia) = force(:,ia) - ext_prod( m(:), delta(:) ) / nrmsq + ! + sumf(:) = sumf(:) + force(:,ia) + ! + END DO + ! + DO ia = 1, nat + ! + force(:,ia) = force(:,ia) - sumf(:) / DBLE( nat ) + ! + END DO + ! + m(:) = 0.D0 + ! + DO ia = 1, nat + ! + delta(:) = tau(:,ia) - tauref(:) + ! + m(:) = m(:) + ext_prod( delta(:), force(:,ia) ) + ! + END DO + ! + IF ( m(1)**2+m(2)**2+m(3)**2 > mo(1)**2+mo(2)**2+mo(3)**2 ) & + CALL errore( 'remove_tot_torque', & + 'total torque has not been properly removed', 1 ) + ! + RETURN + ! + CONTAINS + ! + !------------------------------------------------------------------------ + FUNCTION ext_prod( a, b ) + !------------------------------------------------------------------------ + ! + REAL(DP), INTENT(IN) :: a(3), b(3) + REAL(DP) :: ext_prod(3) + ! + ext_prod(1) = a(2)*b(3) - a(3)*b(2) + ext_prod(2) = a(3)*b(1) - a(1)*b(3) + ext_prod(3) = a(1)*b(2) - a(2)*b(1) + ! + END FUNCTION ext_prod + ! +END SUBROUTINE remove_tot_torque diff --git a/tests/apps/miniDFT/tests/src/rgen.f90 b/tests/apps/miniDFT/tests/src/rgen.f90 new file mode 100644 index 0000000000..a1271910e1 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/rgen.f90 @@ -0,0 +1,104 @@ +! +! Copyright (C) 2001-2010 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +!----------------------------------------------------------------------- +SUBROUTINE rgen ( dtau, rmax, mxr, at, bg, r, r2, nrm) + !----------------------------------------------------------------------- + ! + ! generates neighbours shells (cartesian, in units of lattice parameter) + ! with length < rmax,and returns them in order of increasing length: + ! r(:) = i*a1(:) + j*a2(:) + k*a3(:) - dtau(:), r2 = r^2 + ! where a1, a2, a3 are primitive lattice vectors. Other input variables: + ! mxr = maximum number of vectors + ! at = lattice vectors ( a1=at(:,1), a2=at(:,2), a3=at(:,3) ) + ! bg = reciprocal lattice vectors ( b1=bg(:,1), b2=bg(:,2), b3=bg(:,3) ) + ! Other output variables: + ! nrm = the number of vectors with r^2 < rmax^2 + ! + USE kinds, ONLY : DP + ! + IMPLICIT NONE + INTEGER, INTENT(in) :: mxr + INTEGER, INTENT(out):: nrm + REAL(DP), INTENT(in) :: at(3,3), bg(3,3), dtau(3), rmax + REAL(DP), INTENT(out):: r(3,mxr), r2(mxr) + ! + ! and here the local variables + ! + INTEGER, ALLOCATABLE :: irr (:) + INTEGER :: nm1, nm2, nm3, i, j, k, ipol, ir, indsw, iswap + real(DP) :: ds(3), dtau0(3) + real(DP) :: t (3), tt, swap + real(DP), EXTERNAL :: dnrm2 + ! + ! + nrm = 0 + IF (rmax==0.d0) RETURN + + ! bring dtau into the unit cell centered on the origin - prevents trouble + ! if atomic positions are not centered around the origin but displaced + ! far away (remember that translational invariance allows this!) + ! + ds(:) = matmul( dtau(:), bg(:,:) ) + ds(:) = ds(:) - anint(ds(:)) + dtau0(:) = matmul( at(:,:), ds(:) ) + ! + ALLOCATE (irr( mxr)) + ! + ! these are estimates of the maximum values of needed integer indices + ! + nm1 = int (dnrm2 (3, bg (1, 1), 1) * rmax) + 2 + nm2 = int (dnrm2 (3, bg (1, 2), 1) * rmax) + 2 + nm3 = int (dnrm2 (3, bg (1, 3), 1) * rmax) + 2 + ! + DO i = -nm1, nm1 + DO j = -nm2, nm2 + DO k = -nm3, nm3 + tt = 0.d0 + DO ipol = 1, 3 + t (ipol) = i*at (ipol, 1) + j*at (ipol, 2) + k*at (ipol, 3) & + - dtau0(ipol) + tt = tt + t (ipol) * t (ipol) + ENDDO + IF (tt<=rmax**2.and.abs (tt) >1.d-10) THEN + nrm = nrm + 1 + IF (nrm>mxr) CALL errore ('rgen', 'too many r-vectors', nrm) + DO ipol = 1, 3 + r (ipol, nrm) = t (ipol) + ENDDO + r2 (nrm) = tt + ENDIF + ENDDO + ENDDO + ENDDO + ! + ! reorder the vectors in order of increasing magnitude + ! + ! initialize the index inside sorting routine + ! + irr (1) = 0 + IF (nrm>1) CALL hpsort (nrm, r2, irr) + DO ir = 1, nrm - 1 +20 indsw = irr (ir) + IF (indsw/=ir) THEN + DO ipol = 1, 3 + swap = r (ipol, indsw) + r (ipol, indsw) = r (ipol, irr (indsw) ) + r (ipol, irr (indsw) ) = swap + ENDDO + iswap = irr (ir) + irr (ir) = irr (indsw) + irr (indsw) = iswap + GOTO 20 + ENDIF + + ENDDO + DEALLOCATE(irr) + ! + RETURN +END SUBROUTINE rgen + diff --git a/tests/apps/miniDFT/tests/src/rotate_wfc.f90 b/tests/apps/miniDFT/tests/src/rotate_wfc.f90 new file mode 100644 index 0000000000..16544d67fe --- /dev/null +++ b/tests/apps/miniDFT/tests/src/rotate_wfc.f90 @@ -0,0 +1,53 @@ +! +! Copyright (C) 2001-2007 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +!---------------------------------------------------------------------------- +SUBROUTINE rotate_wfc & + ( npwx, npw, nstart, gstart, nbnd, psi, npol, overlap, evc, e ) + !---------------------------------------------------------------------------- + ! + ! ... Driver routine (maybe it should be an interface) for + ! ... Hamiltonian diagonalization in the subspace spanned + ! ... by nstart states psi ( atomic or random wavefunctions ). + ! ... Produces on output nbnd eigenvectors ( nbnd <= nstart ) in evc. + ! ... Calls h_psi, s_psi to calculate H|psi> ans S|psi> + ! ... It only uses an auxiliary array of the same size as psi. + ! + USE kinds, ONLY : DP + ! + IMPLICIT NONE + ! + ! ... I/O variables + ! + INTEGER, INTENT(IN) :: npw, npwx, nstart, nbnd, gstart, npol + ! dimension of the matrix to be diagonalized + ! leading dimension of matrix psi, as declared in the calling pgm unit + ! input number of states + ! output number of states + ! first G with nonzero norm + ! number of spin polarizations + LOGICAL, INTENT(IN) :: overlap + ! if .FALSE. : S|psi> not needed + COMPLEX(DP), INTENT(INOUT) :: psi(npwx*npol,nstart), evc(npwx*npol,nbnd) + ! input and output eigenvectors (may overlap) + REAL(DP), INTENT(OUT) :: e(nbnd) + ! eigenvalues + ! + CALL start_clock( 'wfcrot' ) + ! + ! + ! use data distributed subroutine + ! + ! + CALL protate_wfc_k & + ( npwx, npw, nstart, nbnd, npol, psi, overlap, evc, e ) + ! + ! + CALL stop_clock( 'wfcrot' ) + ! +END SUBROUTINE rotate_wfc diff --git a/tests/apps/miniDFT/tests/src/rotate_wfc_k.f90 b/tests/apps/miniDFT/tests/src/rotate_wfc_k.f90 new file mode 100644 index 0000000000..e414a1a9c8 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/rotate_wfc_k.f90 @@ -0,0 +1,267 @@ +! +! Copyright (C) 2001-2007 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +!---------------------------------------------------------------------------- +! +! +!---------------------------------------------------------------------------- +SUBROUTINE protate_wfc_k( npwx, npw, nstart, nbnd, npol, psi, overlap, evc, e ) + !---------------------------------------------------------------------------- + ! + ! ... Parallel version of rotate_wfc for colinear, k-point calculations + ! ... Subroutine with distributed matrices, written by Carlo Cavazzoni + ! + USE kinds, ONLY : DP + USE mp_global, ONLY : intra_bgrp_comm, & + nbgrp, nproc_bgrp, me_bgrp, root_bgrp, & + ortho_comm, np_ortho, me_ortho, ortho_comm_id,& + leg_ortho + USE descriptors, ONLY : descla_init , la_descriptor + USE parallel_toolkit, ONLY : zsqmred, zsqmher + USE mp, ONLY : mp_bcast, mp_root_sum, mp_sum, mp_barrier + ! + IMPLICIT NONE + ! + ! ... I/O variables + ! + INTEGER :: npw, npwx, nstart, nbnd, npol + ! dimension of the matrix to be diagonalized + ! leading dimension of matrix psi, as declared in the calling pgm unit + ! input number of states + ! output number of states + ! number of spin polarizations + LOGICAL :: overlap + ! if .FALSE. : S|psi> not needed + COMPLEX(DP) :: psi(npwx*npol,nstart), evc(npwx*npol,nbnd) + ! input and output eigenvectors (may overlap) + REAL(DP) :: e(nbnd) + ! eigenvalues + ! + ! ... local variables + ! + INTEGER :: kdim, kdmx + COMPLEX(DP), ALLOCATABLE :: aux(:,:), hc(:,:), sc(:,:), vc(:,:) + REAL(DP), ALLOCATABLE :: en(:) + ! + TYPE(la_descriptor) :: desc + ! matrix distribution descriptors + INTEGER :: nx + ! maximum local block dimension + LOGICAL :: la_proc + ! flag to distinguish procs involved in linear algebra + TYPE(la_descriptor), ALLOCATABLE :: desc_ip( :, : ) + INTEGER, ALLOCATABLE :: rank_ip( :, : ) + ! + ALLOCATE( desc_ip( np_ortho(1), np_ortho(2) ) ) + ALLOCATE( rank_ip( np_ortho(1), np_ortho(2) ) ) + ! + CALL desc_init( nstart, desc, desc_ip ) + ! + IF ( npol == 1 ) THEN + ! + kdim = npw + kdmx = npwx + ! + ELSE + ! + kdim = npwx*npol + kdmx = npwx*npol + ! + END IF + ! + ALLOCATE( aux(kdmx, nstart ) ) + ALLOCATE( hc( nx, nx) ) + ALLOCATE( sc( nx, nx) ) + ALLOCATE( vc( nx, nx) ) + ALLOCATE( en( nstart ) ) + + aux=(0.0_DP,0.0_DP) + ! + ! ... Set up the Hamiltonian and Overlap matrix on the subspace : + ! + ! ... H_ij = S_ij = + ! + CALL h_psi( npwx, npw, nstart, psi, aux ) + ! + CALL compute_distmat( hc, psi, aux ) + ! + IF ( overlap ) THEN + ! + CALL s_psi( npwx, npw, nstart, psi, aux ) + ! + CALL compute_distmat( sc, psi, aux ) + ! + ELSE + ! + CALL compute_distmat( sc, psi, psi ) + ! + END IF + ! + ! ... Diagonalize + ! + CALL pcdiaghg( nstart, hc, sc, nx, en, vc, desc ) + ! + e(:) = en(1:nbnd) + ! + ! ... update the basis set + ! + CALL refresh_evc() + ! + evc(:,:) = aux(:,1:nbnd) + ! + DEALLOCATE( en ) + DEALLOCATE( vc ) + DEALLOCATE( sc ) + DEALLOCATE( hc ) + DEALLOCATE( aux ) + ! + DEALLOCATE( desc_ip ) + DEALLOCATE( rank_ip ) + ! + RETURN + ! + ! +CONTAINS + ! + SUBROUTINE desc_init( nsiz, desc, desc_ip ) + ! + INTEGER, INTENT(IN) :: nsiz + TYPE(la_descriptor), INTENT(OUT) :: desc + TYPE(la_descriptor), INTENT(OUT) :: desc_ip(:,:) + INTEGER :: i, j, rank + INTEGER :: coor_ip( 2 ) + ! + CALL descla_init( desc, nsiz, nsiz, np_ortho, me_ortho, ortho_comm, ortho_comm_id ) + ! + nx = desc%nrcx + ! + DO j = 0, desc%npc - 1 + DO i = 0, desc%npr - 1 + coor_ip( 1 ) = i + coor_ip( 2 ) = j + CALL descla_init( desc_ip(i+1,j+1), desc%n, desc%nx, & + np_ortho, coor_ip, ortho_comm, 1 ) + CALL GRID2D_RANK( 'R', desc%npr, desc%npc, i, j, rank ) + rank_ip( i+1, j+1 ) = rank * leg_ortho + END DO + END DO + ! + la_proc = .FALSE. + IF( desc%active_node > 0 ) la_proc = .TRUE. + ! + RETURN + END SUBROUTINE desc_init + ! + ! + SUBROUTINE compute_distmat( dm, v, w ) + ! + ! This subroutine compute and store the + ! result in distributed matrix dm + ! + INTEGER :: ipc, ipr + INTEGER :: nr, nc, ir, ic, root + COMPLEX(DP), INTENT(OUT) :: dm( :, : ) + COMPLEX(DP) :: v(:,:), w(:,:) + COMPLEX(DP), ALLOCATABLE :: work( :, : ) + ! + ALLOCATE( work( nx, nx ) ) + ! + work = ( 0.0_DP, 0.0_DP ) + ! + DO ipc = 1, desc%npc ! loop on column procs + ! + nc = desc_ip( 1, ipc )%nc + ic = desc_ip( 1, ipc )%ic + ! + DO ipr = 1, ipc ! desc%npr ! ipc ! use symmetry for the loop on row procs + ! + nr = desc_ip( ipr, ipc )%nr + ir = desc_ip( ipr, ipc )%ir + ! + ! rank of the processor for which this block (ipr,ipc) is destinated + ! + root = rank_ip( ipr, ipc ) + + ! use blas subs. on the matrix block + + CALL ZGEMM( 'C', 'N', nr, nc, kdim, ( 1.D0, 0.D0 ) , & + v(1,ir), kdmx, w(1,ic), kdmx, ( 0.D0, 0.D0 ), work, nx ) + + ! accumulate result on dm of root proc. + CALL mp_root_sum( work, dm, root, intra_bgrp_comm ) + + END DO + ! + END DO + ! + CALL zsqmher( nstart, dm, nx, desc ) + ! + DEALLOCATE( work ) + ! + RETURN + END SUBROUTINE compute_distmat + + + SUBROUTINE refresh_evc( ) + ! + INTEGER :: ipc, ipr + INTEGER :: nr, nc, ir, ic, root + COMPLEX(DP), ALLOCATABLE :: vtmp( :, : ) + COMPLEX(DP) :: beta + + ALLOCATE( vtmp( nx, nx ) ) + ! + DO ipc = 1, desc%npc + ! + nc = desc_ip( 1, ipc )%nc + ic = desc_ip( 1, ipc )%ic + ! + IF( ic <= nbnd ) THEN + ! + nc = min( nc, nbnd - ic + 1 ) + ! + beta = ( 0.D0, 0.D0 ) + + DO ipr = 1, desc%npr + ! + nr = desc_ip( ipr, ipc )%nr + ir = desc_ip( ipr, ipc )%ir + ! + root = rank_ip( ipr, ipc ) + + IF( ipr-1 == desc%myr .AND. ipc-1 == desc%myc .AND. la_proc ) THEN + ! + ! this proc sends his block + ! + CALL mp_bcast( vc(:,1:nc), root, intra_bgrp_comm ) + CALL ZGEMM( 'N', 'N', kdim, nc, nr, ( 1.D0, 0.D0 ), & + psi(1,ir), kdmx, vc, nx, beta, aux(1,ic), kdmx ) + ELSE + ! + ! all other procs receive + ! + CALL mp_bcast( vtmp(:,1:nc), root, intra_bgrp_comm ) + CALL ZGEMM( 'N', 'N', kdim, nc, nr, ( 1.D0, 0.D0 ), & + psi(1,ir), kdmx, vtmp, nx, beta, aux(1,ic), kdmx ) + END IF + ! + + beta = ( 1.D0, 0.D0 ) + + END DO + ! + END IF + ! + END DO + ! + DEALLOCATE( vtmp ) + + RETURN + END SUBROUTINE refresh_evc + +END SUBROUTINE protate_wfc_k diff --git a/tests/apps/miniDFT/tests/src/run_info.f90 b/tests/apps/miniDFT/tests/src/run_info.f90 new file mode 100644 index 0000000000..4253c09d04 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/run_info.f90 @@ -0,0 +1,17 @@ +! +! Copyright (C) 2011 Quantum ESPRESSO groups +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +!==-----------------------------------------------------------------------==! +MODULE run_info + !==-----------------------------------------------------------------------==! + + IMPLICIT NONE + ! ... title of the simulation + CHARACTER(LEN=75) :: title=' ' + ! +END MODULE run_info +!==-----------------------------------------------------------------------==! diff --git a/tests/apps/miniDFT/tests/src/s_1psi.f90 b/tests/apps/miniDFT/tests/src/s_1psi.f90 new file mode 100644 index 0000000000..cde23ef0fd --- /dev/null +++ b/tests/apps/miniDFT/tests/src/s_1psi.f90 @@ -0,0 +1,38 @@ +! +! Copyright (C) 2001-2004 PWSCF group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +!---------------------------------------------------------------------------- +SUBROUTINE s_1psi( npwx, n, psi, spsi ) + !---------------------------------------------------------------------------- + ! + ! ... spsi = S*psi for one wavefunction + ! ... Wrapper routine - calls calbec and s_psi + ! + USE kinds, ONLY : DP + USE uspp, ONLY : vkb, nkb + USE becmod, ONLY : bec_type, becp, calbec + USE wvfct, ONLY: nbnd + ! + IMPLICIT NONE + ! + integer, parameter :: npol=1 !substitute for noncollin_module%npol + INTEGER :: npwx, n, ibnd + COMPLEX(DP) :: psi(npwx*npol,1), spsi(npwx*npol,1) + ! + ! + CALL start_clock( 's_1psi' ) + ! + ! + CALL calbec( n, vkb, psi, becp ) + ! + CALL s_psi( npwx, n, 1, psi, spsi ) + ! + CALL stop_clock( 's_1psi' ) + ! + RETURN + ! +END SUBROUTINE s_1psi diff --git a/tests/apps/miniDFT/tests/src/s_psi.f90 b/tests/apps/miniDFT/tests/src/s_psi.f90 new file mode 100644 index 0000000000..0d5f01de8f --- /dev/null +++ b/tests/apps/miniDFT/tests/src/s_psi.f90 @@ -0,0 +1,51 @@ +! +! Copyright (C) 2001-2007 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +!---------------------------------------------------------------------------- +SUBROUTINE s_psi( lda, n, m, psi, spsi ) + !---------------------------------------------------------------------------- + ! + ! ... This routine applies the S matrix to m wavefunctions psi + ! ... and puts the results in spsi. + ! ... Requires the products of psi with all beta functions + ! ... in array becp(nkb,m) (calculated in h_psi or by calbec) + ! + ! ... input: + ! + ! ... lda leading dimension of arrays psi, spsi + ! ... n true dimension of psi, spsi + ! ... m number of states psi + ! ... psi + ! + ! ... output: + ! + ! ... spsi S*psi + ! + USE kinds, ONLY : DP + USE uspp, ONLY : vkb, nkb, qq, okvan + USE uspp_param, ONLY : upf, nh + USE ions_base, ONLY : nat, nsp, ityp + ! + IMPLICIT NONE + ! + integer, parameter ::npol=1 !substitute for noncollin_module%npol + INTEGER, INTENT(IN) :: lda, n, m + COMPLEX(DP), INTENT(IN) :: psi(lda*npol,m) + COMPLEX(DP), INTENT(OUT)::spsi(lda*npol,m) + ! + INTEGER :: ibnd + ! + ! ... initialize spsi + ! + spsi = psi + ! + ! + RETURN + ! + +END SUBROUTINE s_psi diff --git a/tests/apps/miniDFT/tests/src/save_in_cbands.f90 b/tests/apps/miniDFT/tests/src/save_in_cbands.f90 new file mode 100644 index 0000000000..e233091f96 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/save_in_cbands.f90 @@ -0,0 +1,42 @@ +! +! Copyright (C) 2001 PWSCF group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +!----------------------------------------------------------------------- +subroutine save_in_cbands (iter, ik_, dr2) + !----------------------------------------------------------------------- + USE kinds, ONLY: DP + USE io_files, ONLY: iunres, prefix, seqopn + USE klist, ONLY: nks + USE control_flags, ONLY: io_level, tr2, ethr + USE wvfct, ONLY: nbnd, et + implicit none + character :: where * 20 + ! are we in the right place? + integer :: ik, ibnd, ik_, iter + ! counters + ! last completed kpoint + ! last completed iteration + logical :: exst + + real(DP) :: dr2 + ! + ! open recover file + ! + call seqopn (iunres, 'restart', 'unformatted', exst) + ! + ! save restart information + ! + where = 'ELECTRONS' + write (iunres) where + write (iunres) ( (et (ibnd, ik), ibnd = 1, nbnd), ik = 1, nks) + + write (iunres) iter, ik_, dr2, tr2, ethr + + close (unit = iunres, status = 'keep') + ! + return +end subroutine save_in_cbands diff --git a/tests/apps/miniDFT/tests/src/save_in_electrons.f90 b/tests/apps/miniDFT/tests/src/save_in_electrons.f90 new file mode 100644 index 0000000000..b7153d7198 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/save_in_electrons.f90 @@ -0,0 +1,63 @@ +! +! Copyright (C) 2001 PWSCF group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +!----------------------------------------------------------------------- +subroutine save_in_electrons (iter, dr2) + !----------------------------------------------------------------------- + USE kinds, ONLY: DP + USE io_files, ONLY: iunres, prefix, seqopn + USE ener, ONLY: etot + USE klist, ONLY: nks + USE control_flags, ONLY: io_level, conv_elec, tr2, ethr + USE wvfct, ONLY: nbnd, et + USE scf, ONLY: vnew + implicit none + character :: where * 20 + ! are we in the right place? + integer :: ik, ibnd, ik_, iter + ! counters + ! last completed kpoint + ! last completed iteration + logical :: exst + + real(DP) :: dr2 + if ( io_level < 2 ) return + ! + ! open recover file + ! + call seqopn (iunres, 'restart', 'unformatted', exst) + ! + ! save restart information + ! + if (conv_elec) then + ! + ! step on electrons has been completed. restart from ions + ! + where = 'IONS' + write (iunres) where + write (iunres) ( (et (ibnd, ik), ibnd = 1, nbnd), ik = 1, nks) + write (iunres) etot, tr2 + ! vnew = V(in)-V(out) is needed in the scf correction term to forces + write (iunres) vnew%of_r + else + ! + ! save iteration number + ! + ! iteration iter has been completed + ik_ = 0 + where = 'ELECTRONS' + write (iunres) where + write (iunres) ( (et (ibnd, ik), ibnd = 1, nbnd), ik = 1, nks) + write (iunres) iter, ik_, dr2, tr2, ethr + + endif + ! + + close (unit = iunres, status = 'keep') + return + +end subroutine save_in_electrons diff --git a/tests/apps/miniDFT/tests/src/save_in_ions.f90 b/tests/apps/miniDFT/tests/src/save_in_ions.f90 new file mode 100644 index 0000000000..85af24f80f --- /dev/null +++ b/tests/apps/miniDFT/tests/src/save_in_ions.f90 @@ -0,0 +1,48 @@ +! +! Copyright (C) 2001 PWSCF group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +!----------------------------------------------------------------------- +subroutine save_in_ions + !----------------------------------------------------------------------- + USE kinds, ONLY: DP + USE io_files, ONLY: iunres, prefix, seqopn + USE klist, ONLY: nks + USE control_flags, ONLY: io_level, lscf, tr2, ethr + USE wvfct, ONLY: nbnd, et + implicit none + character :: where * 20 + ! are we in the right place? + integer :: ik, ibnd, ik_, iter + ! counters + ! last completed kpoint + ! last completed iteration + logical :: exst + real(DP) :: dr2 + ! + if ( io_level < 2 .or. .not.lscf ) return + ! + ! open recover file + ! + call seqopn (iunres, 'restart', 'unformatted', exst) + ! + ! save restart information + ! + where = 'ELECTRONS' + iter = 0 + ik_ = 0 + + dr2 = 0.0d0 + write (iunres) where + write (iunres) ( (et (ibnd, ik), ibnd = 1, nbnd), ik = 1, nks) + + write (iunres) iter, ik_, dr2, tr2, ethr + + + close (unit = iunres, status = 'keep') + ! + return +end subroutine save_in_ions diff --git a/tests/apps/miniDFT/tests/src/scf_mod.f90 b/tests/apps/miniDFT/tests/src/scf_mod.f90 new file mode 100644 index 0000000000..c38a50df6d --- /dev/null +++ b/tests/apps/miniDFT/tests/src/scf_mod.f90 @@ -0,0 +1,477 @@ +! +! Copyright (C) 2001-2007 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +!-------------------------------------------------------------------------- +! +MODULE scf + ! + ! This module contains variables and auxiliary routines needed for + ! the self-consistent cycle + ! + ! ROUTINES: allocate_scf_type + ! + USE kinds, ONLY : DP + ! + USE lsda_mod, ONLY : nspin + USE ions_base, ONLY : nat + USE io_files, ONLY : diropn + USE fft_base, ONLY : dfftp + USE fft_interfaces,ONLY : invfft + USE gvect, ONLY : ngm + USE gvecs, ONLY : ngms + USE uspp_param, ONLY : nhm + USE extfield, ONLY : dipfield, emaxpos, eopreg, edir + ! + SAVE + ! +! Details of PAW implementation: +! NOTE: scf_type is used for two different quantities: density and potential. +! These correspond, for PAW, to becsum and D coefficients. +! Due to interference with the ultrasoft routines only the becsum part +! is stored in the structure (at the moment). +! This only holds for scf_type; mix_type is not affected. +! NOTE: rho%bec is different from becsum for two reasons: +! 1. rho%bec is mixed, while becsum is not +! 2. for npool > 1 rho%bec is collected, becsum is not +! ( this is necessary to make the stress work) +#ifdef __STD_F95 + TYPE scf_type + REAL(DP), POINTER :: of_r(:,:) ! the charge density in R-space + COMPLEX(DP),POINTER :: of_g(:,:) ! the charge density in G-space + END TYPE scf_type + ! + TYPE mix_type + COMPLEX(DP), POINTER :: of_g(:,:) ! the charge density in G-space + REAL(DP) :: el_dipole ! electrons dipole + END TYPE mix_type +#else + TYPE scf_type + REAL(DP), ALLOCATABLE :: of_r(:,:) ! the charge density in R-space + COMPLEX(DP),ALLOCATABLE :: of_g(:,:) ! the charge density in G-space + END TYPE scf_type + ! + TYPE mix_type + COMPLEX(DP), ALLOCATABLE :: of_g(:,:) ! the charge density in G-space + REAL(DP) :: el_dipole ! electrons dipole + END TYPE mix_type +#endif + + type (scf_type) :: rho ! the charge density and its other components + + type (scf_type) :: v ! the scf potential + type (scf_type) :: vnew ! used to correct the forces + + REAL(DP) :: v_of_0 ! vltot(G=0) + REAL(DP), ALLOCATABLE :: & + vltot(:), &! the local potential in real space + vrs(:,:), &! the total pot. in real space (smooth grid) + rho_core(:), &! the core charge in real space + kedtau(:,:) ! position dependent kinetic energy enhancement factor + COMPLEX(DP), ALLOCATABLE :: & + rhog_core(:) ! the core charge in reciprocal space + + INTEGER, PRIVATE :: record_length, & + rlen_rho=0, rlen_kin=0, rlen_ldaU=0, rlen_bec=0,& + rlen_dip=0, & + start_rho=0, start_kin=0, start_ldaU=0, start_bec=0, & + start_dipole=0 + REAL(DP), PRIVATE, ALLOCATABLE:: io_buffer(:) +CONTAINS + + SUBROUTINE create_scf_type ( rho, do_not_allocate_becsum ) + IMPLICIT NONE + TYPE (scf_type) :: rho + LOGICAL,INTENT(IN),OPTIONAL :: do_not_allocate_becsum ! PAW hack + allocate ( rho%of_r( dfftp%nnr, nspin) ) + allocate ( rho%of_g( ngm, nspin ) ) +#ifdef __STD_F95 +#endif + + return + END SUBROUTINE create_scf_type + + SUBROUTINE destroy_scf_type ( rho ) + IMPLICIT NONE + TYPE (scf_type) :: rho +#ifdef __STD_F95 + if (ASSOCIATED(rho%of_r)) deallocate(rho%of_r) + if (ASSOCIATED(rho%of_g)) deallocate(rho%of_g) +#else + if (ALLOCATED(rho%of_r)) deallocate(rho%of_r) + if (ALLOCATED(rho%of_g)) deallocate(rho%of_g) +#endif + return + END SUBROUTINE destroy_scf_type + ! + + SUBROUTINE create_mix_type ( rho ) + IMPLICIT NONE + TYPE (mix_type) :: rho + allocate ( rho%of_g( ngms, nspin ) ) + + rho%of_g = 0._dp + if (dipfield) rho%el_dipole = 0._dp + + return + END SUBROUTINE create_mix_type + + SUBROUTINE destroy_mix_type ( rho ) + IMPLICIT NONE + TYPE (mix_type) :: rho +#ifdef __STD_F95 +#else + if (ALLOCATED(rho%of_g)) deallocate(rho%of_g) +#endif + return + END SUBROUTINE destroy_mix_type + ! + subroutine assign_scf_to_mix_type(rho_s, rho_m) + IMPLICIT NONE + TYPE (scf_type), INTENT(IN) :: rho_s + TYPE (mix_type), INTENT(INOUT) :: rho_m + REAL(DP) :: e_dipole + + rho_m%of_g(1:ngms,:) = rho_s%of_g(1:ngms,:) + + + if (dipfield) then + write(*,*) "scf_mod.f90:226 skipping compute_el_dip" + !!$ CALL compute_el_dip(emaxpos, eopreg, edir, rho_s%of_r,e_dipole) + !!rho_m%el_dipole = e_dipole + rho_m%el_dipole = 0.d0 + endif + + return + end subroutine assign_scf_to_mix_type + ! + subroutine assign_mix_to_scf_type(rho_m, rho_s) + USE wavefunctions_module, ONLY : psic + USE gvect, ONLY : nl, nlm + IMPLICIT NONE + TYPE (mix_type), INTENT(IN) :: rho_m + TYPE (scf_type), INTENT(INOUT) :: rho_s + INTEGER :: is + + rho_s%of_g(1:ngms,:) = rho_m%of_g(1:ngms,:) + ! define rho_s%of_r + + DO is = 1, nspin + psic(:) = ( 0.D0, 0.D0 ) + psic(nl(:)) = rho_s%of_g(:,is) + CALL invfft ('Dense', psic, dfftp) + rho_s%of_r(:,is) = psic(:) + END DO + + + return + end subroutine assign_mix_to_scf_type + ! + !---------------------------------------------------------------------------- + subroutine scf_type_COPY (X,Y) + !---------------------------------------------------------------------------- + ! works like DCOPY for scf_type copy variables : Y = X + USE kinds, ONLY : DP + IMPLICIT NONE + TYPE(scf_type), INTENT(IN) :: X + TYPE(scf_type), INTENT(INOUT) :: Y + Y%of_r = X%of_r + Y%of_g = X%of_g + ! + RETURN + end subroutine scf_type_COPY + ! + !---------------------------------------------------------------------------- + subroutine mix_type_AXPY (A,X,Y) + !---------------------------------------------------------------------------- + ! works like daxpy for scf_type variables : Y = A * X + Y + ! NB: A is a REAL(DP) number + USE kinds, ONLY : DP + IMPLICIT NONE + REAL(DP) :: A + TYPE(mix_type), INTENT(IN) :: X + TYPE(mix_type), INTENT(INOUT) :: Y + Y%of_g = Y%of_g + A * X%of_g + if (dipfield) Y%el_dipole = Y%el_dipole + A * X%el_dipole + ! + RETURN + END SUBROUTINE mix_type_AXPY + ! + !---------------------------------------------------------------------------- + subroutine mix_type_COPY (X,Y) + !---------------------------------------------------------------------------- + ! works like DCOPY for mix_type copy variables : Y = X + USE kinds, ONLY : DP + IMPLICIT NONE + TYPE(mix_type), INTENT(IN) :: X + TYPE(mix_type), INTENT(INOUT) :: Y + Y%of_g = X%of_g + if (dipfield) Y%el_dipole = X%el_dipole + ! + RETURN + end subroutine mix_type_COPY + ! + !---------------------------------------------------------------------------- + subroutine mix_type_SCAL (A,X) + !---------------------------------------------------------------------------- + ! works like DSCAL for mix_type copy variables : X = A * X + ! NB: A is a REAL(DP) number + USE kinds, ONLY : DP + IMPLICIT NONE + REAL(DP), INTENT(IN) :: A + TYPE(mix_type), INTENT(INOUT) :: X + X%of_g(:,:) = A * X%of_g(:,:) + if (dipfield) X%el_dipole = A * X%el_dipole + ! + RETURN + end subroutine mix_type_SCAL + ! + subroutine high_frequency_mixing ( rhoin, input_rhout, alphamix ) + USE wavefunctions_module, ONLY : psic + USE gvect, ONLY : nl, nlm + IMPLICIT NONE + TYPE (scf_type), INTENT(INOUT) :: rhoin + TYPE (scf_type), INTENT(IN) :: input_rhout + REAL(DP), INTENT(IN) :: alphamix + INTEGER :: is + if (ngms < ngm ) then + rhoin%of_g = rhoin%of_g + alphamix * ( input_rhout%of_g-rhoin%of_g) + rhoin%of_g(1:ngms,1:nspin) = (0.d0,0.d0) + ! define rho_s%of_r + DO is = 1, nspin + psic(:) = ( 0.D0, 0.D0 ) + psic(nl(:)) = rhoin%of_g(:,is) + CALL invfft ('Dense', psic, dfftp) + rhoin%of_r(:,is) = psic(:) + END DO + ! + else + rhoin%of_g(:,:)= (0.d0,0.d0) + rhoin%of_r(:,:)= 0.d0 + endif + return + end subroutine high_frequency_mixing + + + subroutine diropn_mix_file( iunit, extension, exst ) + implicit none + character(len=*), intent(in) :: extension + integer, intent(in) :: iunit + logical :: exst + ! define lengths of different record chunks + rlen_rho = 2 * ngms * nspin + if (dipfield) rlen_dip = 1 + ! define total record length + record_length = rlen_rho + rlen_kin + rlen_ldaU + rlen_bec + rlen_dip + ! and the starting point of different chunks + start_rho = 1 + start_kin = start_rho + rlen_rho + start_ldaU = start_kin + rlen_kin + start_bec = start_ldaU + rlen_ldaU + start_dipole = start_bec + rlen_bec + ! open file and allocate io_buffer + call diropn ( iunit, extension, record_length, exst) + allocate (io_buffer(record_length+1)) + ! + return + end subroutine diropn_mix_file + ! + subroutine close_mix_file( iunit ) + implicit none + integer, intent(in) :: iunit + deallocate (io_buffer) + close(iunit,status='keep') + return + end subroutine close_mix_file + + subroutine davcio_mix_type( rho, iunit, record, iflag ) + implicit none + type (mix_type) :: rho + integer, intent(in) :: iunit, record, iflag + if (iflag > 0) then + + call DCOPY(rlen_rho,rho%of_g,1,io_buffer(start_rho),1) + if (dipfield) call DCOPY(1, rho%el_dipole, 1,io_buffer(start_dipole),1) + + end if + CALL davcio( io_buffer, record_length, iunit, record, iflag ) + if (iflag < 0) then + + call DCOPY(rlen_rho,io_buffer(start_rho),1,rho%of_g,1) + if (dipfield) call DCOPY(1, io_buffer(start_dipole), 1, rho%el_dipole, 1) + + end if + end subroutine davcio_mix_type + ! + !---------------------------------------------------------------------------- + FUNCTION rho_ddot( rho1, rho2, gf ) + !---------------------------------------------------------------------------- + ! + ! ... calculates 4pi/G^2*rho1(-G)*rho2(G) = V1_Hartree(-G)*rho2(G) + ! ... used as an estimate of the self-consistency error on the energy + ! + USE kinds, ONLY : DP + USE constants, ONLY : e2, tpi, fpi + USE cell_base, ONLY : omega, tpiba2 + USE gvect, ONLY : gg, gstart + USE spin_orb, ONLY : domag + USE mp_global, ONLY : intra_bgrp_comm + USE mp, ONLY : mp_sum + ! + IMPLICIT NONE + ! + type(mix_type), INTENT(IN) :: rho1, rho2 + INTEGER, INTENT(IN) :: gf + REAL(DP) :: rho_ddot + ! + REAL(DP) :: fac + INTEGER :: ig + ! + fac = e2 * fpi / tpiba2 + ! + rho_ddot = 0.D0 + + IF ( nspin == 1 ) THEN + ! + DO ig = gstart, gf + ! + rho_ddot = rho_ddot + & + REAL( CONJG( rho1%of_g(ig,1) )*rho2%of_g(ig,1), DP ) / gg(ig) + ! + END DO + ! + rho_ddot = fac*rho_ddot + ! + ! + ELSE IF ( nspin == 2 ) THEN + ! + ! ... first the charge + ! + DO ig = gstart, gf + ! + rho_ddot = rho_ddot + & + REAL( CONJG( rho1%of_g(ig,1)+rho1%of_g(ig,2) ) * & + ( rho2%of_g(ig,1)+rho2%of_g(ig,2) ), DP ) / gg(ig) + ! + END DO + ! + rho_ddot = fac*rho_ddot + ! + ! + ! ... then the magnetization + ! + fac = e2 * fpi / tpi**2 ! lambda = 1 a.u. + ! + ! ... G=0 term + ! + IF ( gstart == 2 ) THEN + ! + rho_ddot = rho_ddot + & + fac * REAL( CONJG( rho1%of_g(1,1) - rho1%of_g(1,2) ) * & + ( rho2%of_g(1,1) - rho2%of_g(1,2) ), DP ) + ! + END IF + ! + ! + DO ig = gstart, gf + ! + rho_ddot = rho_ddot + & + fac * REAL( CONJG( rho1%of_g(ig,1) - rho1%of_g(ig,2) ) * & + ( rho2%of_g(ig,1) - rho2%of_g(ig,2) ), DP ) + ! + END DO + ! + ELSE IF ( nspin == 4 ) THEN + ! + DO ig = gstart, gf + ! + rho_ddot = rho_ddot + & + REAL( CONJG( rho1%of_g(ig,1) )*rho2%of_g(ig,1), DP ) / gg(ig) + ! + END DO + ! + rho_ddot = fac*rho_ddot + ! + ! + IF (domag) THEN + fac = e2*fpi / (tpi**2) ! lambda=1 a.u. + ! + IF ( gstart == 2 ) THEN + ! + rho_ddot = rho_ddot + & + fac * ( REAL( CONJG( rho1%of_g(1,2))*(rho2%of_g(1,2) ),DP ) + & + REAL( CONJG( rho1%of_g(1,3))*(rho2%of_g(1,3) ),DP ) + & + REAL( CONJG( rho1%of_g(1,4))*(rho2%of_g(1,4) ),DP ) ) + ! + END IF + ! + ! + DO ig = gstart, gf + ! + rho_ddot = rho_ddot + & + fac *( REAL( CONJG( rho1%of_g(ig,2))*(rho2%of_g(ig,2) ), DP ) + & + REAL( CONJG( rho1%of_g(ig,3))*(rho2%of_g(ig,3) ), DP ) + & + REAL( CONJG( rho1%of_g(ig,4))*(rho2%of_g(ig,4) ), DP ) ) + ! + END DO + ! + END IF + ! + END IF + ! + rho_ddot = rho_ddot * omega * 0.5D0 + ! + CALL mp_sum( rho_ddot , intra_bgrp_comm ) + ! + IF (dipfield) rho_ddot = rho_ddot + (e2/2.0_DP)* & + (rho1%el_dipole * rho2%el_dipole)*omega/fpi + + RETURN + ! + END FUNCTION rho_ddot + ! +!---------------------------------------------------------------------------- + !---------------------------------------------------------------------------- + FUNCTION local_tf_ddot( rho1, rho2, ngm0 ) + !---------------------------------------------------------------------------- + ! + ! ... calculates 4pi/G^2*rho1(-G)*rho2(G) = V1_Hartree(-G)*rho2(G) + ! ... used as an estimate of the self-consistency error on the energy + ! + USE kinds, ONLY : DP + USE constants, ONLY : e2, fpi + USE cell_base, ONLY : omega, tpiba2 + USE gvect, ONLY : gg, gstart + USE mp_global, ONLY : intra_bgrp_comm + USE mp, ONLY : mp_sum + ! + IMPLICIT NONE + ! + INTEGER, INTENT(IN) :: ngm0 + COMPLEX(DP), INTENT(IN) :: rho1(ngm0), rho2(ngm0) + REAL(DP) :: local_tf_ddot + ! + REAL(DP) :: fac + INTEGER :: ig + ! + local_tf_ddot = 0.D0 + ! + fac = e2 * fpi / tpiba2 + ! + DO ig = gstart, ngm0 + local_tf_ddot = local_tf_ddot + REAL( CONJG(rho1(ig))*rho2(ig) ) / gg(ig) + END DO + ! + local_tf_ddot = fac * local_tf_ddot * omega * 0.5D0 + ! + ! + CALL mp_sum( local_tf_ddot , intra_bgrp_comm ) + ! + RETURN + ! + END FUNCTION local_tf_ddot + ! +END MODULE scf diff --git a/tests/apps/miniDFT/tests/src/set_kup_and_kdw.f90 b/tests/apps/miniDFT/tests/src/set_kup_and_kdw.f90 new file mode 100644 index 0000000000..69b1f92429 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/set_kup_and_kdw.f90 @@ -0,0 +1,46 @@ +! +! Copyright (C) 2001-2007 PWSCF group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +!----------------------------------------------------------------------- +subroutine set_kup_and_kdw (xk, wk, isk, nkstot, npk) + !----------------------------------------------------------------------- + ! This routine sets the k vectors for the up and down spin wfc + ! + ! on input: xk and wk contain k-points and corresponding weights + ! + ! on output: the number of points is doubled and xk and wk in the + ! first (nkstot/2) positions correspond to up spin + ! those in the second (nkstot/2) ones correspond to down spin + ! + USE kinds, ONLY : DP + implicit none + ! + ! I/O variables first + ! + integer :: npk, isk (npk), nkstot + ! input: maximum allowed number of k-points + ! output: spin associated to a given k-point + ! input-output: starting and ending number of k-points + real(DP) :: xk (3, npk), wk (npk) + ! input-output: coordinates of k points + ! input-output: weights of k points + ! + integer :: ik, iq, ikq + ! + ! + if (2*nkstot > npk) call errore ('set_kup&kdw','too many k points',nkstot) + do ik = 1, nkstot + xk(:,ik+nkstot)= xk(:,ik) + wk (ik+nkstot) = wk(ik) + isk(ik) = 1 + isk(ik+nkstot) = 2 + enddo + nkstot = 2 * nkstot + + return + +end subroutine set_kup_and_kdw diff --git a/tests/apps/miniDFT/tests/src/set_rhoc.f90 b/tests/apps/miniDFT/tests/src/set_rhoc.f90 new file mode 100644 index 0000000000..f28926057b --- /dev/null +++ b/tests/apps/miniDFT/tests/src/set_rhoc.f90 @@ -0,0 +1,147 @@ +! +! Copyright (C) 2001-2007 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +!----------------------------------------------------------------------- +subroutine set_rhoc + !----------------------------------------------------------------------- + ! + ! This routine computes the core charge on the real space 3D mesh + ! + ! + USE io_global, ONLY : stdout + USE kinds, ONLY : DP + USE atom, ONLY : msh, rgrid + USE uspp_param,ONLY : upf + USE ions_base, ONLY : ntyp => nsp + USE cell_base, ONLY : omega, tpiba2 + USE ener, ONLY : etxcc + USE fft_base, ONLY : dfftp + USE fft_interfaces,ONLY : invfft + USE gvect, ONLY : ngm, nl, nlm, ngl, gl, igtongl + USE scf, ONLY : rho_core, rhog_core + USE lsda_mod, ONLY : nspin + USE vlocal, ONLY : strf + USE mp_global, ONLY : intra_bgrp_comm + USE mp, ONLY : mp_sum + ! + implicit none + ! + real(DP), parameter :: eps = 1.d-10 + + complex(DP) , allocatable :: aux (:) + ! used for the fft of the core charge + + real(DP) , allocatable :: rhocg(:) + ! the radial fourier trasform + real(DP) :: rhoima, rhoneg, rhorea + ! used to check the core charge + real(DP) :: vtxcc + ! dummy xc energy term + real(DP) , allocatable :: dum(:,:) + ! dummy array containing rho=0 + complex(DP) , allocatable :: dumg(:,:) + ! dummy array containing rhog=0 + + integer :: ir, nt, ng + ! counter on mesh points + ! counter on atomic types + ! counter on g vectors + + etxcc = 0.0_DP + if ( ANY( upf(1:ntyp)%nlcc ) ) goto 10 + + rhog_core(:) = 0.0_DP + rho_core(:) = 0.0_DP + + return + +10 continue + allocate (aux( dfftp%nnr)) + allocate (rhocg( ngl)) + aux (:) = (0.0_DP, 0.0_DP) + ! + ! the sum is on atom types + ! + do nt = 1, ntyp + if ( upf(nt)%nlcc ) then + ! + ! drhoc compute the radial fourier transform for each shell of g vec + ! + call drhoc (ngl, gl, omega, tpiba2, msh (nt), rgrid(nt)%r, & + rgrid(nt)%rab, upf(nt)%rho_atc, rhocg) + ! + ! multiply by the structure factor and sum + ! + do ng = 1, ngm + aux(nl(ng)) = aux(nl(ng)) + strf(ng,nt) * rhocg(igtongl(ng)) + enddo + endif + enddo + ! + rhog_core(:) = aux(nl(:)) + ! + ! the core charge in real space + ! + CALL invfft ('Dense', aux, dfftp) + ! + ! test on the charge and computation of the core energy + ! + rhoneg = 0.d0 + rhoima = 0.d0 + do ir = 1, dfftp%nnr + rhoneg = rhoneg + min (0.d0, DBLE (aux (ir) ) ) + rhoima = rhoima + abs (AIMAG (aux (ir) ) ) + rho_core(ir) = DBLE (aux(ir)) + ! + ! NOTE: Core charge is computed in reciprocal space and brought to real + ! space by FFT. For non smooth core charges (or insufficient cut-off) + ! this may result in negative values in some grid points. + ! Up to October 1999 the core charge was forced to be positive definite. + ! This induces an error in the force, and probably stress, calculation if + ! the number of grid points where the core charge would be otherwise neg + ! is large. The error disappears for sufficiently high cut-off, but may be + ! rather large and it is better to leave the core charge as it is. + ! If you insist to have it positive definite (with the possible problems + ! mentioned above) uncomment the following lines. SdG, Oct 15 1999 + ! + ! rhorea = max ( DBLE (aux (ir) ), eps) + ! rho_core(ir) = rhorea + ! + enddo + rhoneg = rhoneg / (dfftp%nr1 * dfftp%nr2 * dfftp%nr3) + rhoima = rhoima / (dfftp%nr1 * dfftp%nr2 * dfftp%nr3) + ! + call mp_sum( rhoneg, intra_bgrp_comm ) + call mp_sum( rhoima, intra_bgrp_comm ) + ! + IF (rhoneg < -1.0d-6 .OR. rhoima > 1.0d-6) & + WRITE( stdout, '(/5x,"Check: negative/imaginary core charge=",2f12.6)')& + rhoneg, rhoima + ! + ! calculate core_only exch-corr energy etxcc=E_xc[rho_core] if required + ! The term was present in previous versions of the code but it shouldn't + ! + ! call create_scf_type(dum) + ! dum%of_r(:,:) = 0.0_DP + ! dum%of_g(:,:) = (0.0_DP, 0.0_DP) + ! + ! call v_xc( dum, rho_core, rhog_core, etxcc, vtxcc, aux ) + ! + ! call destroy_scf_type(dum) + ! WRITE( stdout, 9000) etxcc + ! WRITE( stdout, * ) 'BEWARE it will be subtracted from total energy !' + ! + deallocate (rhocg) + deallocate (aux) + ! + return + +9000 format (5x,'core-only xc energy = ',f15.8,' Ry') + +end subroutine set_rhoc + diff --git a/tests/apps/miniDFT/tests/src/set_signal.f90 b/tests/apps/miniDFT/tests/src/set_signal.f90 new file mode 100644 index 0000000000..b02f872d7e --- /dev/null +++ b/tests/apps/miniDFT/tests/src/set_signal.f90 @@ -0,0 +1,125 @@ +MODULE set_signal +! This module is a Fortran 2003 interface to the customize_signals.c C file +! Compatible with Intel/PGI/Gcc(>=4.3) compilers + +! This module is compiled only if the following preprocessing option +! is enabled +#if defined __TRAP_SIGUSR1 + +USE iso_c_binding +USE io_global, ONLY : stdout +USE mp_global, ONLY : root, world_comm, mp_bcast, mpime + +IMPLICIT NONE + +LOGICAL,VOLATILE::signal_trapped + +INTERFACE + FUNCTION init_signal_USR1(new_handler) BIND(c, name = "init_signal_USR1") + USE iso_c_binding + TYPE(C_FUNPTR),VALUE,INTENT(IN):: new_handler + INTEGER(C_INT)::init_signal_USR1 + END FUNCTION init_signal_USR1 + + FUNCTION init_signal(signum, new_handler) BIND(c, name = "init_signal") + USE iso_c_binding + INTEGER(C_INT),VALUE :: signum + TYPE(C_FUNPTR), VALUE,INTENT(IN) :: new_handler + INTEGER(C_INT)::init_signal + END FUNCTION init_signal + +END INTERFACE + +CONTAINS + +SUBROUTINE set_signal_USR1(routine) + USE iso_c_binding + TYPE(C_FUNPTR),TARGET::ptr + INTERFACE + SUBROUTINE routine(signal) bind(C) + USE iso_c_binding + INTEGER(C_INT),VALUE, INTENT(IN)::signal + END SUBROUTINE routine + + END INTERFACE + + ptr = C_FUNLOC(routine) + + IF (init_signal_USR1(ptr) .NE. 0) THEN + CALL errore("set_signal_USR1", "The association of signal USR1 failed!", 1) + ENDIF + +END SUBROUTINE set_signal_USR1 + +! Unused. Here for possible future developments +SUBROUTINE set_signal_action(signal, routine) + USE iso_c_binding + INTEGER::signal + TYPE(C_FUNPTR),TARGET::ptr + INTERFACE + SUBROUTINE routine(signal) bind(C) + USE iso_c_binding + INTEGER(C_INT),VALUE::signal + END SUBROUTINE routine + END INTERFACE + + ptr = C_FUNLOC(routine) + + IF (init_signal(signal, ptr) .NE. 0) THEN + CALL errore("set_signal", "The association of the signal failed!", 1) + ENDIF +END SUBROUTINE set_signal_action + + +! Sets the signal_trapped flag on all nodes/processors +! Only the master will use the signal, though +SUBROUTINE custom_handler(signum) BIND(c) + USE iso_c_binding + INTEGER(C_INT),VALUE,INTENT(IN):: signum + WRITE(UNIT = stdout, FMT = *) " **** Trapped signal", signum + signal_trapped = .TRUE. +END SUBROUTINE custom_handler + + +! Set the signal handler for SIGUSR1 to 'custom_handler' +! Every processor will trap the signal, howver only 0 will actually +! use the result (required since the default action for SIGUSR1 is +! exit) +SUBROUTINE signal_trap_init + USE iso_c_binding + WRITE(UNIT = stdout, FMT=*) " signal trapping enabled: kill the code with -SIGUSR1 to stop cleanly the simulation " + CALL set_signal_USR1(custom_handler) +END SUBROUTINE signal_trap_init + + +FUNCTION signal_detected() + LOGICAL::signal_detected + ! If the signal is trapped, set the exit status and broadcast it + ! DO NOT broadcast the signal_trapped variable or you will be Very + ! Sorry + signal_detected = signal_trapped + + CALL mp_bcast(signal_detected, root, world_comm) + +END FUNCTION signal_detected + +#else + +USE io_global, ONLY : stdout + +CONTAINS + +! Place holders to employ when the signal trapping feature is disabled +SUBROUTINE signal_trap_init + WRITE(UNIT = stdout, FMT=*) " signal trapping disabled: compile with " + WRITE(UNIT = stdout, FMT=*) " -D__TRAP_SIGUSR1 to enable this feature" +END SUBROUTINE signal_trap_init + +FUNCTION signal_detected() + LOGICAL::signal_detected + signal_detected = .FALSE. +END FUNCTION signal_detected + +#endif + +END MODULE set_signal diff --git a/tests/apps/miniDFT/tests/src/set_vrs.f90 b/tests/apps/miniDFT/tests/src/set_vrs.f90 new file mode 100644 index 0000000000..ad091d8ef9 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/set_vrs.f90 @@ -0,0 +1,52 @@ +! +! Copyright (C) 2001 PWSCF group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +!-------------------------------------------------------------------- +subroutine set_vrs (vrs, vltot, vr, kedtau, kedtaur,nrxx, nspin, doublegrid) + !-------------------------------------------------------------------- + ! set the total local potential vrs on the smooth mesh to be used in + ! h_psi, adding the (spin dependent) scf (H+xc) part and the sum of + ! all the local pseudopotential contributions. + ! + USE kinds + USE fft_base, only : dffts + implicit none + + integer :: nspin, nrxx + ! input: number of spin components: 1 if lda, 2 if lsd, 4 if noncolinear + ! input: the fft grid dimension + real(DP) :: vrs (nrxx, nspin), vltot (nrxx), vr (nrxx, nspin), & + kedtau, kedtaur + ! output: total local potential on the smooth grid + ! vrs=vltot+vr + ! input: the total local pseudopotential + ! input: the scf(H+xc) part of the local potential + logical :: doublegrid + ! input: true if a doublegrid is used + + integer:: is + + do is = 1, nspin + ! + ! define the total local potential (external + scf) for each spin ... + ! + if (is > 1 .and. nspin == 4) then + ! + ! noncolinear case: only the first component contains vltot + ! + vrs (:, is) = vr (:, is) + else + vrs (:, is) = vltot (:) + vr (:, is) + end if + ! + ! ... and interpolate it on the smooth mesh if necessary + ! + if (doublegrid) call interpolate (vrs (1, is), vrs (1, is), - 1) + enddo + return + +end subroutine set_vrs diff --git a/tests/apps/miniDFT/tests/src/setlocal.f90 b/tests/apps/miniDFT/tests/src/setlocal.f90 new file mode 100644 index 0000000000..a55e8b5302 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/setlocal.f90 @@ -0,0 +1,67 @@ +! +! Copyright (C) 2001 PWSCF group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +!---------------------------------------------------------------------- +subroutine setlocal + !---------------------------------------------------------------------- + ! + ! This routine computes the local potential in real space vltot(ir) + ! + USE kinds, ONLY : DP + USE constants, ONLY : eps8 + USE ions_base, ONLY : zv, ntyp => nsp + USE cell_base, ONLY : omega + USE extfield, ONLY : tefield, dipfield, etotefield + USE gvect, ONLY : igtongl, gg + USE scf, ONLY : rho, v_of_0, vltot + USE vlocal, ONLY : strf, vloc + USE fft_base, ONLY : dfftp + USE fft_interfaces,ONLY : invfft + USE gvect, ONLY : nl, nlm, ngm + USE mp_global, ONLY : intra_pool_comm, intra_bgrp_comm + USE mp, ONLY : mp_sum + + ! + implicit none + complex(DP), allocatable :: aux (:), v_corr(:) + ! auxiliary variable + integer :: nt, ng + ! counter on atom types + ! counter on g vectors + ! + allocate (aux( dfftp%nnr)) + aux(:)=(0.d0,0.d0) + ! + ! + do nt = 1, ntyp + do ng = 1, ngm + aux (nl(ng))=aux(nl(ng)) + vloc (igtongl (ng), nt) * strf (ng, nt) + enddo + enddo + ! + ! ... v_of_0 is (Vloc)(G=0) + ! + v_of_0=0.0_DP + if (gg(1) < eps8) v_of_0 = DBLE ( aux (nl(1)) ) + ! + call mp_sum( v_of_0, intra_bgrp_comm ) + ! + ! ... aux = potential in G-space . FFT to real space + ! + CALL invfft ('Dense', aux, dfftp) + ! + vltot (:) = DBLE (aux (:) ) + ! + ! ... If required add an electric field to the local potential + ! + ! + deallocate(aux) + ! + return +end subroutine setlocal + diff --git a/tests/apps/miniDFT/tests/src/setup.f90 b/tests/apps/miniDFT/tests/src/setup.f90 new file mode 100644 index 0000000000..b0f7146870 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/setup.f90 @@ -0,0 +1,431 @@ +! +! Copyright (C) 2001-2011 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +!---------------------------------------------------------------------------- +SUBROUTINE setup() + !---------------------------------------------------------------------------- + ! + ! ... This routine is called at the beginning of the calculation and + ! ... 1) determines various parameters of the calculation: + ! ... zv charge of each atomic type + ! ... nelec total number of electrons (if not given in input) + ! ... nbnd total number of bands (if not given in input) + ! ... nbndx max number of bands used in iterative diagonalization + ! ... tpiba 2 pi / a (a = lattice parameter) + ! ... tpiba2 square of tpiba + ! ... gcutm cut-off in g space for charge/potentials + ! ... gcutms cut-off in g space for smooth charge + ! ... ethr convergence threshold for iterative diagonalization + ! ... 2) finds actual crystal symmetry: + ! ... s symmetry matrices in the direct lattice vectors basis + ! ... nsym number of crystal symmetry operations + ! ... nrot number of lattice symmetry operations + ! ... ft fractionary translations + ! ... irt for each atom gives the corresponding symmetric + ! ... invsym if true the system has inversion symmetry + ! ... 3) generates k-points corresponding to the actual crystal symmetry + ! ... 4) calculates various quantities used in magnetic, spin-orbit, PAW + ! ... electric-field, LDA+U calculations, and for parallelism + ! + USE kinds, ONLY : DP + USE constants, ONLY : eps8, rytoev + USE parameters, ONLY : npk + USE io_global, ONLY : stdout + USE io_files, ONLY : tmp_dir, prefix, xmlpun, delete_if_present + USE constants, ONLY : pi, degspin + USE cell_base, ONLY : at, bg, alat, tpiba, tpiba2, ibrav, omega + USE ions_base, ONLY : nat, tau, ntyp => nsp, ityp, zv + USE basis, ONLY : starting_pot, natomwfc + USE gvect, ONLY : gcutm + USE fft_base, ONLY : dfftp + USE fft_base, ONLY : dffts + USE grid_subroutines, ONLY : realspace_grids_init + USE gvecs, ONLY : doublegrid, gcutms, dual + USE klist, ONLY : xk, wk, nks, nelec, degauss, lgauss, & + lxkcry, nkstot, & + nelup, neldw, two_fermi_energies, & + tot_charge, tot_magnetization + USE lsda_mod, ONLY : lsda, nspin, current_spin, isk, & + starting_magnetization + USE ener, ONLY : ef + USE electrons_base, ONLY : set_nelup_neldw + USE start_k, ONLY : nks_start, xk_start, wk_start, & + nk1, nk2, nk3, k1, k2, k3 + USE ktetra, ONLY : tetra, ntetra, ltetra + USE symm_base, ONLY : s, t_rev, irt, nrot, nsym, invsym, nosym, & + d1,d2,d3, time_reversal, sname, set_sym_bl, & + find_sym, inverse_s, no_t_rev + USE wvfct, ONLY : nbnd, nbndx, ecutwfc + USE control_flags, ONLY : tr2, ethr, lscf, lmd, david, lecrpa, & + isolve, niter, noinv, & + lbands + USE uspp_param, ONLY : upf, n_atom_wfc + USE fixed_occ, ONLY : f_inp, tfixed_occ, one_atom_occupations + USE funct, ONLY : set_dft_from_name + USE mp_global, ONLY : kunit + USE spin_orb, ONLY : lspinorb, domag + USE funct, ONLY : dft_is_gradient + ! + IMPLICIT NONE + ! + integer, parameter :: nspin_lsda=1 !substitute for noncollin_module%nspin_lsda + integer, parameter :: npol=1 !substitute for noncollin_module%npol + real(dp),parameter :: m_loc(3,1)=0.D0 !dummy; substitute for noncollin%m_loc + logical :: use_para_diag !dummy; substitute for control_flags%use_para_diag + INTEGER :: na, nt, is, ierr, ibnd, ik + LOGICAL :: magnetic_sym, skip_equivalence=.FALSE. + REAL(DP) :: iocc, ionic_charge, one + ! + LOGICAL, EXTERNAL :: check_para_diag + INTEGER, EXTERNAL :: set_Hubbard_l + ! + ! ... Compute the ionic charge for each atom type and the total ionic charge + ! + zv(1:ntyp) = upf(1:ntyp)%zp + ! + ionic_charge = SUM( zv(ityp(1:nat)) ) + ! + ! ... set the number of electrons + ! + nelec = ionic_charge - tot_charge + ! + ! ... magnetism-related quantities + ! + ! time reversal operation is set up to 0 by default + t_rev = 0 + ! + ! ... wavefunctions are scalars + ! + IF (lspinorb) CALL errore( 'setup ', & + 'spin orbit requires a non collinear calculation', 1 ) + ! + ! + ! + ! ... If the occupations are from input, check the consistency with the + ! ... number of electrons + ! + IF ( tfixed_occ ) THEN + ! + iocc = 0 + ! + DO is = 1, nspin_lsda + ! + iocc = iocc + SUM( f_inp(1:nbnd,is) ) + ! + DO ibnd = 1, nbnd + if (f_inp(ibnd,is) > 2.d0/nspin_lsda .or. f_inp(ibnd,is) < 0.d0) & + call errore('setup','wrong fixed occupations',is) + END DO + END DO + ! + IF ( ABS( iocc - nelec ) > 1D-5 ) & + CALL errore( 'setup', 'strange occupations: '//& + 'number of electrons from occupations is wrong.', 1 ) + ! + END IF + ! + ! ... Check: if there is an odd number of electrons, the crystal is a metal + ! + IF ( lscf .AND. ABS( NINT( nelec / 2.D0 ) - nelec / 2.D0 ) > eps8 & + .AND. .NOT. lgauss .AND. .NOT. ltetra .AND. .NOT. tfixed_occ ) & + CALL infomsg( 'setup', 'the system is metallic, specify occupations' ) + ! + ! ... Check: spin-polarized calculations require either broadening or + ! fixed occupation + ! + IF ( lscf .AND. lsda & + .AND. .NOT. lgauss .AND. .NOT. ltetra & + .AND. .NOT. tfixed_occ .AND. .NOT. two_fermi_energies ) & + CALL errore( 'setup', 'spin-polarized system, specify occupations', 1 ) + ! + ! ... setting nelup/neldw + ! + call set_nelup_neldw ( tot_magnetization, nelec, nelup, neldw ) + ! + ! ... Set the number of occupied bands if not given in input + ! + IF ( nbnd == 0 ) THEN + ! + IF (nat==0) CALL errore('setup','free electrons: nbnd required in input',1) + ! + nbnd = MAX ( NINT( nelec / degspin ), NINT(nelup), NINT(neldw) ) + ! + IF ( lgauss .OR. ltetra ) THEN + ! + ! ... metallic case: add 20% more bands, with a minimum of 4 + ! + nbnd = MAX( NINT( 1.2D0 * nelec / degspin ), & + NINT( 1.2D0 * nelup), NINT( 1.2d0 * neldw ), & + ( nbnd + 4 ) ) + ! + END IF + ! + ! ... In the case of noncollinear magnetism, bands are NOT + ! ... twofold degenerate : + ! + ! + ELSE + ! + IF ( nbnd < NINT( nelec / degspin ) .AND. lscf ) & + CALL errore( 'setup', 'too few bands', 1 ) + ! + IF ( nbnd < NINT( nelup ) .AND. lscf ) & + CALL errore( 'setup', 'too few spin up bands', 1 ) + IF ( nbnd < NINT( neldw ) .AND. lscf ) & + CALL errore( 'setup', 'too few spin dw bands', 1 ) + ! + ! + END IF + ! + ! ... Here we set the precision of the diagonalization for the first scf + ! ... iteration of for the first ionic step + ! ... for subsequent steps ethr is automatically updated in electrons + ! + IF ( nat==0 ) THEN + ethr=1.0D-8 + ELSE IF ( .NOT. lscf ) THEN + ! + IF ( ethr == 0.D0 ) ethr = 0.1D0 * MIN( 1.D-2, tr2 / nelec ) + ! + ELSE + ! + IF ( ethr == 0.D0 ) THEN + ! + IF ( starting_pot == 'file' ) THEN + ! + ! ... if you think that the starting potential is good + ! ... do not spoil it with a lousy first diagonalization : + ! ... set a strict ethr in the input file (diago_thr_init) + ! + ethr = 1.D-5 + ! + ELSE + ! + ! ... starting atomic potential is probably far from scf + ! ... do not waste iterations in the first diagonalizations + ! + ethr = 1.0D-2 + ! + END IF + ! + END IF + ! + END IF + ! + IF ( .NOT. lscf ) niter = 1 + ! + ! ... set number of atomic wavefunctions + ! + natomwfc = n_atom_wfc( nat, ityp, .false. ) + ! + ! ... set the max number of bands used in iterative diagonalization + ! + nbndx = nbnd + IF ( isolve == 0 ) nbndx = david * nbnd + ! + use_para_diag = check_para_diag( nbnd ) + ! ... Set the units in real and reciprocal space + ! + tpiba = 2.D0 * pi / alat + tpiba2 = tpiba**2 + ! + ! ... Compute the cut-off of the G vectors + ! + doublegrid = ( dual > 4.D0 ) + IF ( doublegrid ) & + CALL infomsg ( 'setup', 'no reason to have ecutrho>4*ecutwfc' ) + gcutm = dual * ecutwfc / tpiba2 + ! + IF ( doublegrid ) THEN + ! + gcutms = 4.D0 * ecutwfc / tpiba2 + ! + ELSE + ! + gcutms = gcutm + ! + END IF + ! + ! ... Test that atoms do not overlap + ! + call check_atoms ( nat, tau, bg ) + ! + ! ... calculate dimensions of the FFT grid + ! + CALL realspace_grids_init ( dfftp, dffts, at, bg, gcutm, gcutms ) + ! + ! ... generate transformation matrices for the crystal point group + ! ... First we generate all the symmetry matrices of the Bravais lattice + ! + call set_sym_bl ( ) + ! + ! ... If lecrpa is true, nosym must be set to true also + ! + IF ( lecrpa ) nosym = .TRUE. + IF ( lecrpa ) skip_equivalence=.TRUE. + ! + ! ... If nosym is true do not use any point-group symmetry + ! + IF ( nosym ) nrot = 1 + ! + ! ... time_reversal = use q=>-q symmetry for k-point generation + ! + magnetic_sym = .false. + time_reversal = .NOT. noinv .AND. .NOT. magnetic_sym + ! + ! ... Automatic generation of k-points (if required) + ! + IF ( nks_start == 0 ) THEN + ! + ! + CALL kpoint_grid ( nrot, time_reversal, skip_equivalence, s, t_rev, bg,& + npk, k1,k2,k3, nk1,nk2,nk3, nkstot, xk, wk) + ! + ! + ELSE + nkstot = nks_start + xk(:,1:nkstot) = xk_start(:,1:nks_start) + wk(1:nkstot) = wk_start(1:nks_start) + ! + END IF + ! + IF ( nat==0 ) THEN + ! + nsym=nrot + invsym=.true. + CALL inverse_s ( ) + ! + ELSE + ! + ! ... eliminate rotations that are not symmetry operations + ! + CALL find_sym ( nat, tau, ityp, dfftp%nr1, dfftp%nr2, dfftp%nr3, & + magnetic_sym, m_loc ) + ! + END IF + ! + ! ... Input k-points are assumed to be given in the IBZ of the Bravais + ! ... lattice, with the full point symmetry of the lattice. + ! ... If some symmetries of the lattice are missing in the crystal, + ! ... "irreducible_BZ" computes the missing k-points. + ! + IF ( .NOT. lbands ) THEN + CALL irreducible_BZ (nrot, s, nsym, time_reversal, & + magnetic_sym, at, bg, npk, nkstot, xk, wk, t_rev) + ELSE + one = SUM (wk(1:nkstot)) + IF ( one > 0.0_dp ) wk(1:nkstot) = wk(1:nkstot) / one + END IF + ! + ntetra = 0 + ! + IF ( lbands ) THEN + ! + ! ... if calculating bands, we read the Fermi energy + ! + write(*,*)"setup.f90:496 skipping pw_readfile, requires iotk" + !CALL pw_readfile( 'reset', ierr ) + !CALL pw_readfile( 'ef', ierr ) + CALL errore( 'setup ', 'problem reading ef from file ' // & + & TRIM( tmp_dir ) // TRIM( prefix ) // '.save', ierr ) + + ! + ELSE IF ( ltetra ) THEN + ! + ! ... Calculate quantities used in tetrahedra method + ! + ntetra = 6 * nk1 * nk2 * nk3 + ! + ALLOCATE( tetra( 4, ntetra ) ) + ! + CALL tetrahedra( nsym, s, time_reversal, t_rev, at, bg, npk, k1, k2, k3, & + nk1, nk2, nk3, nkstot, xk, wk, ntetra, tetra ) + ! + END IF + ! + ! + IF ( lsda ) THEN + ! + ! ... LSDA case: two different spin polarizations, + ! ... each with its own kpoints + ! + if (nspin /= 2) call errore ('setup','nspin should be 2; check iosys',1) + ! + CALL set_kup_and_kdw( xk, wk, isk, nkstot, npk ) + ! + ELSE + ! + ! ... LDA case: the two spin polarizations are identical + ! + wk(1:nkstot) = wk(1:nkstot) * degspin + current_spin = 1 + isk(:) = 1 + ! + IF ( nspin /= 1 ) & + CALL errore( 'setup', 'nspin should be 1; check iosys', 1 ) + ! + END IF + ! + IF ( nkstot > npk ) CALL errore( 'setup', 'too many k points', nkstot ) + ! + ! + ! + ! ... distribute k-points (and their weights and spin indices) + ! + kunit = 1 + CALL divide_et_impera( xk, wk, isk, lsda, nkstot, nks ) + ! + IF (one_atom_occupations) THEN + DO ik=1,nkstot + DO ibnd=natomwfc+1, nbnd + IF (f_inp(ibnd,ik)> 0.0_DP) CALL errore('setup', & + 'no atomic wavefunction for some band',1) + ENDDO + ENDDO + ENDIF + + ! + RETURN + ! +END SUBROUTINE setup +! +!---------------------------------------------------------------------------- +LOGICAL FUNCTION check_para_diag( nbnd ) + ! + USE io_global, ONLY : stdout, ionode, ionode_id + USE mp_global, ONLY : np_ortho + + IMPLICIT NONE + + INTEGER, INTENT(IN) :: nbnd + LOGICAL, SAVE :: first = .TRUE. + + IF( .NOT. first ) RETURN + first = .FALSE. + ! + IF( np_ortho(1) > nbnd ) & + CALL errore ('check_para_diag', 'Too few bands for required ndiag',nbnd) + ! + check_para_diag = .true. + ! + IF ( ionode ) THEN + ! + WRITE( stdout, '(/,5X,"Subspace diagonalization in iterative solution ",& + & "of the eigenvalue problem:")' ) + IF ( check_para_diag ) THEN + WRITE( stdout, '(5X,"scalapack distributed-memory algorithm ", & + & "(size of sub-group: ", I2, "*", I3, " procs)",/)') & + np_ortho(1), np_ortho(2) + ELSE + WRITE( stdout, '(5X,"a serial algorithm will be used",/)' ) + END IF + ! + END IF + ! + RETURN +END FUNCTION check_para_diag diff --git a/tests/apps/miniDFT/tests/src/simpsn.f90 b/tests/apps/miniDFT/tests/src/simpsn.f90 new file mode 100644 index 0000000000..29014a8940 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/simpsn.f90 @@ -0,0 +1,134 @@ +! +! Copyright (C) 2001 PWSCF group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +!----------------------------------------------------------------------- +subroutine simpson (mesh, func, rab, asum) + !----------------------------------------------------------------------- + ! + ! simpson's rule integration. On input: + ! mesh = mhe number of grid points (should be odd) + ! func(i)= function to be integrated + ! rab(i) = r(i) * dr(i)/di * di + ! For the logarithmic grid not including r=0 : + ! r(i) = r_0*exp((i-1)*dx) ==> rab(i)=r(i)*dx + ! For the logarithmic grid including r=0 : + ! r(i) = a(exp((i-1)*dx)-1) ==> rab(i)=(r(i)+a)*dx + ! Output in asum = \sum_i c_i f(i)*rab(i) = \int_0^\infty f(r) dr + ! where c_i are alternativaly 2/3, 4/3 except c_1 = c_mesh = 1/3 + ! + use kinds, ONLY: DP + implicit none + integer, intent(in) :: mesh + real(DP), intent(in) :: rab (mesh), func (mesh) + real(DP), intent(out):: asum + ! + real(DP) :: f1, f2, f3, r12 + integer :: i + ! + ! routine assumes that mesh is an odd number so run check + ! if ( mesh+1 - ( (mesh+1) / 2 ) * 2 .ne. 1 ) then + ! write(*,*) '***error in subroutine radlg' + ! write(*,*) 'routine assumes mesh is odd but mesh =',mesh+1 + ! stop + ! endif + asum = 0.0d0 + r12 = 1.0d0 / 12.0d0 + f3 = func (1) * rab (1) * r12 + + do i = 2, mesh - 1, 2 + f1 = f3 + f2 = func (i) * rab (i) * r12 + f3 = func (i + 1) * rab (i + 1) * r12 + asum = asum + 4.0d0 * f1 + 16.0d0 * f2 + 4.0d0 * f3 + enddo + + return +end subroutine simpson + +!=----------------------------------------------------------------------- +subroutine simpson_cp90( mesh, func, rab, asum ) + !----------------------------------------------------------------------- + ! + ! This routine computes the integral of a function defined on a + ! logaritmic mesh, by using the open simpson formula given on + ! pag. 109 of Numerical Recipes. In principle it is used to + ! perform integrals from zero to infinity. The first point of + ! the function should be the closest to zero but not the value + ! in zero. The formula used here automatically includes the + ! contribution from the zero point and no correction is required. + ! + ! Input as "simpson". At least 8 integrating points are required. + ! + ! last revised 12 May 1995 by Andrea Dal Corso + ! + use kinds, ONLY: DP + implicit none + integer, intent(in) :: mesh + real(DP), intent(in) :: rab (mesh), func (mesh) + real(DP), intent(out):: asum + ! + real(DP) :: c(4) + integer ::i + ! + if ( mesh < 8 ) call errore ('simpson_cp90','few mesh points',8) + + c(1) = 109.0d0 / 48.d0 + c(2) = -5.d0 / 48.d0 + c(3) = 63.d0 / 48.d0 + c(4) = 49.d0 / 48.d0 + + asum = ( func(1)*rab(1) + func(mesh )*rab(mesh ) )*c(1) & + + ( func(2)*rab(2) + func(mesh-1)*rab(mesh-1) )*c(2) & + + ( func(3)*rab(3) + func(mesh-2)*rab(mesh-2) )*c(3) & + + ( func(4)*rab(4) + func(mesh-3)*rab(mesh-3) )*c(4) + do i=5,mesh-4 + asum = asum + func(i)*rab(i) + end do + + return +end subroutine simpson_cp90 +! +!----------------------------------------------------------------------- +SUBROUTINE herman_skillman_int(mesh,func,rab,asum) +!----------------------------------------------------------------------- + ! simpson rule integration for herman skillman mesh (obsolescent) + ! Input as in "simpson". BEWARE: "func" is overwritten!!! + ! + use kinds, ONLY: DP + IMPLICIT NONE + integer, intent(in) :: mesh + real(DP), intent(in) :: rab (mesh) + real(DP), intent(inout) :: func (mesh) + real(DP), intent(out):: asum + ! + INTEGER :: i, j, k, i1, nblock + REAL(DP) :: a1, a2e, a2o, a2es + ! + a1=0.0d0 + a2e=0.0d0 + asum=0.0d0 + nblock=mesh/40 + i=1 + func(1)=0.0d0 + DO j=1,nblock + DO k=1,20 + i=i+2 + i1=i-1 + a2es=a2e + a2o=func(i1)/12.0d0 + a2e=func(i)/12.0d0 + a1=a1+5.0d0*a2es+8.0d0*a2o-a2e + func(i1)=asum+a1*rab(i1) + a1=a1-a2es+8.0d0*a2o+5.0d0*a2e + func(i)=asum+a1*rab(i) + END DO + asum=func(i) + a1=0.0d0 + END DO + ! + RETURN +END SUBROUTINE herman_skillman_int diff --git a/tests/apps/miniDFT/tests/src/sort.f90 b/tests/apps/miniDFT/tests/src/sort.f90 new file mode 100644 index 0000000000..085aeb5b3b --- /dev/null +++ b/tests/apps/miniDFT/tests/src/sort.f90 @@ -0,0 +1,357 @@ +! +! Copyright (C) 2001 PWSCF group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +!--------------------------------------------------------------------- +subroutine hpsort_eps (n, ra, ind, eps) + !--------------------------------------------------------------------- + ! sort an array ra(1:n) into ascending order using heapsort algorithm, + ! and considering two elements being equal if their values differ + ! for less than "eps". + ! n is input, ra is replaced on output by its sorted rearrangement. + ! create an index table (ind) by making an exchange in the index array + ! whenever an exchange is made on the sorted data array (ra). + ! in case of equal values in the data array (ra) the values in the + ! index array (ind) are used to order the entries. + ! if on input ind(1) = 0 then indices are initialized in the routine, + ! if on input ind(1) != 0 then indices are assumed to have been + ! initialized before entering the routine and these + ! indices are carried around during the sorting process + ! + ! no work space needed ! + ! free us from machine-dependent sorting-routines ! + ! + ! adapted from Numerical Recipes pg. 329 (new edition) + ! + use kinds, only : DP + implicit none + !-input/output variables + integer, intent(in) :: n + integer, intent(inout) :: ind (*) + real(DP), intent(inout) :: ra (*) + real(DP), intent(in) :: eps + !-local variables + integer :: i, ir, j, l, iind + real(DP) :: rra + ! initialize index array + if (ind (1) .eq.0) then + do i = 1, n + ind (i) = i + enddo + endif + ! nothing to order + if (n.lt.2) return + ! initialize indices for hiring and retirement-promotion phase + l = n / 2 + 1 + + ir = n + + sorting: do + + ! still in hiring phase + if ( l .gt. 1 ) then + l = l - 1 + rra = ra (l) + iind = ind (l) + ! in retirement-promotion phase. + else + ! clear a space at the end of the array + rra = ra (ir) + ! + iind = ind (ir) + ! retire the top of the heap into it + ra (ir) = ra (1) + ! + ind (ir) = ind (1) + ! decrease the size of the corporation + ir = ir - 1 + ! done with the last promotion + if ( ir .eq. 1 ) then + ! the least competent worker at all ! + ra (1) = rra + ! + ind (1) = iind + exit sorting + endif + endif + ! wheter in hiring or promotion phase, we + i = l + ! set up to place rra in its proper level + j = l + l + ! + do while ( j .le. ir ) + if ( j .lt. ir ) then + ! compare to better underling + if ( abs(ra(j)-ra(j+1)).ge.eps ) then + if (ra(j).lt.ra(j+1)) j = j + 1 + else + ! this means ra(j) == ra(j+1) within tolerance + if (ind (j) .lt.ind (j + 1) ) j = j + 1 + endif + endif + ! demote rra + if ( abs(rra - ra(j)).ge.eps ) then + if (rra.lt.ra(j)) then + ra (i) = ra (j) + ind (i) = ind (j) + i = j + j = j + j + else + ! set j to terminate do-while loop + j = ir + 1 + end if + else + !this means rra == ra(j) within tolerance + ! demote rra + if (iind.lt.ind (j) ) then + ra (i) = ra (j) + ind (i) = ind (j) + i = j + j = j + j + else + ! set j to terminate do-while loop + j = ir + 1 + endif + end if + enddo + ra (i) = rra + ind (i) = iind + + end do sorting + ! +end subroutine hpsort_eps + +! +! Copyright (C) 2001 PWSCF group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +!--------------------------------------------------------------------- +subroutine hpsort (n, ra, ind) + !--------------------------------------------------------------------- + ! sort an array ra(1:n) into ascending order using heapsort algorithm. + ! n is input, ra is replaced on output by its sorted rearrangement. + ! create an index table (ind) by making an exchange in the index array + ! whenever an exchange is made on the sorted data array (ra). + ! in case of equal values in the data array (ra) the values in the + ! index array (ind) are used to order the entries. + ! if on input ind(1) = 0 then indices are initialized in the routine, + ! if on input ind(1) != 0 then indices are assumed to have been + ! initialized before entering the routine and these + ! indices are carried around during the sorting process + ! + ! no work space needed ! + ! free us from machine-dependent sorting-routines ! + ! + ! adapted from Numerical Recipes pg. 329 (new edition) + ! + use kinds, only : DP + implicit none + !-input/output variables + integer :: n + integer :: ind (*) + real(DP) :: ra (*) + !-local variables + integer :: i, ir, j, l, iind + real(DP) :: rra + ! initialize index array + if (ind (1) .eq.0) then + do i = 1, n + ind (i) = i + enddo + endif + ! nothing to order + if (n.lt.2) return + ! initialize indices for hiring and retirement-promotion phase + l = n / 2 + 1 + ir = n +10 continue + ! still in hiring phase + if (l.gt.1) then + l = l - 1 + rra = ra (l) + iind = ind (l) + ! in retirement-promotion phase. + else + ! clear a space at the end of the array + rra = ra (ir) + ! + iind = ind (ir) + ! retire the top of the heap into it + ra (ir) = ra (1) + ! + ind (ir) = ind (1) + ! decrease the size of the corporation + ir = ir - 1 + ! done with the last promotion + if (ir.eq.1) then + ! the least competent worker at all ! + ra (1) = rra + ! + ind (1) = iind + return + endif + endif + ! wheter in hiring or promotion phase, we + i = l + ! set up to place rra in its proper level + j = l + l + ! + do while (j.le.ir) + if (j.lt.ir) then + ! compare to better underling + if (ra (j) .lt.ra (j + 1) ) then + j = j + 1 + elseif (ra (j) .eq.ra (j + 1) ) then + if (ind (j) .lt.ind (j + 1) ) j = j + 1 + endif + endif + ! demote rra + if (rra.lt.ra (j) ) then + ra (i) = ra (j) + ind (i) = ind (j) + i = j + j = j + j + elseif (rra.eq.ra (j) ) then + ! demote rra + if (iind.lt.ind (j) ) then + ra (i) = ra (j) + ind (i) = ind (j) + i = j + j = j + j + else + ! set j to terminate do-while loop + j = ir + 1 + endif + ! this is the right place for rra + else + ! set j to terminate do-while loop + j = ir + 1 + endif + enddo + ra (i) = rra + ind (i) = iind + goto 10 + ! +end subroutine hpsort + + +! +! Copyright (C) 2001 PWSCF group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +!--------------------------------------------------------------------- +subroutine ihpsort (n, ia, ind) + !--------------------------------------------------------------------- + ! sort an integer array ia(1:n) into ascending order using heapsort algorithm. + ! n is input, ia is replaced on output by its sorted rearrangement. + ! create an index table (ind) by making an exchange in the index array + ! whenever an exchange is made on the sorted data array (ia). + ! in case of equal values in the data array (ia) the values in the + ! index array (ind) are used to order the entries. + ! if on input ind(1) = 0 then indices are initialized in the routine, + ! if on input ind(1) != 0 then indices are assumed to have been + ! initialized before entering the routine and these + ! indices are carried around during the sorting process + ! + ! no work space needed ! + ! free us from machine-dependent sorting-routines ! + ! + ! adapted from Numerical Recipes pg. 329 (new edition) + ! + implicit none + !-input/output variables + integer :: n + integer :: ind (*) + integer :: ia (*) + !-local variables + integer :: i, ir, j, l, iind + integer :: iia + ! initialize index array + if (ind (1) .eq.0) then + do i = 1, n + ind (i) = i + enddo + endif + ! nothing to order + if (n.lt.2) return + ! initialize indices for hiring and retirement-promotion phase + l = n / 2 + 1 + ir = n +10 continue + ! still in hiring phase + if (l.gt.1) then + l = l - 1 + iia = ia (l) + iind = ind (l) + ! in retirement-promotion phase. + else + ! clear a space at the end of the array + iia = ia (ir) + ! + iind = ind (ir) + ! retire the top of the heap into it + ia (ir) = ia (1) + ! + ind (ir) = ind (1) + ! decrease the size of the corporation + ir = ir - 1 + ! done with the last promotion + if (ir.eq.1) then + ! the least competent worker at all ! + ia (1) = iia + ! + ind (1) = iind + return + endif + endif + ! wheter in hiring or promotion phase, we + i = l + ! set up to place iia in its proper level + j = l + l + ! + do while (j.le.ir) + if (j.lt.ir) then + ! compare to better underling + if (ia (j) .lt.ia (j + 1) ) then + j = j + 1 + elseif (ia (j) .eq.ia (j + 1) ) then + if (ind (j) .lt.ind (j + 1) ) j = j + 1 + endif + endif + ! demote iia + if (iia.lt.ia (j) ) then + ia (i) = ia (j) + ind (i) = ind (j) + i = j + j = j + j + elseif (iia.eq.ia (j) ) then + ! demote iia + if (iind.lt.ind (j) ) then + ia (i) = ia (j) + ind (i) = ind (j) + i = j + j = j + j + else + ! set j to terminate do-while loop + j = ir + 1 + endif + ! this is the right place for iia + else + ! set j to terminate do-while loop + j = ir + 1 + endif + enddo + ia (i) = iia + ind (i) = iind + goto 10 + ! +end subroutine ihpsort diff --git a/tests/apps/miniDFT/tests/src/sph_bes.f90 b/tests/apps/miniDFT/tests/src/sph_bes.f90 new file mode 100644 index 0000000000..1582c121ba --- /dev/null +++ b/tests/apps/miniDFT/tests/src/sph_bes.f90 @@ -0,0 +1,260 @@ +! +! Copyright (C) 2001-2007 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +!-------------------------------------------------------------------- +subroutine sph_bes (msh, r, q, l, jl) + !-------------------------------------------------------------------- + ! + ! ... input: + ! ... msh = number of grid points points + ! ... r(1:msh)= radial grid + ! ... q = q + ! ... l = angular momentum (-1 <= l <= 6) + ! ... output: + ! ... jl(1:msh) = j_l(q*r(i)) (j_l = spherical bessel function) + ! + use kinds, only: DP + USE constants, ONLY : eps14 + ! + implicit none + ! + integer :: msh, l + real(DP) :: r (msh), q, jl (msh) + ! + ! xseries = convergence radius of the series for small x of j_l(x) + real(DP) :: x, xl, xseries = 0.05_dp + integer :: ir, ir0 + integer, external:: semifact + ! +#if defined (__MASS) + real(DP) :: qr(msh), sin_qr(msh), cos_qr(msh) +#endif + + ! case q=0 + + if (abs (q) < eps14) then + if (l == -1) then + call errore ('sph_bes', 'j_{-1}(0) ?!?', 1) + elseif (l == 0) then + jl(:) = 1.d0 + else + jl(:) = 0.d0 + endif + return + end if + + ! case l=-1 + + if (l == - 1) then + if (abs (q * r (1) ) < eps14) call errore ('sph_bes', 'j_{-1}(0) ?!?',1) + +#if defined (__MASS) + + qr = q * r + call vcos( cos_qr, qr, msh) + jl = cos_qr / qr + +#else + + jl (:) = cos (q * r (:) ) / (q * r (:) ) + +#endif + + return + + end if + + ! series expansion for small values of the argument + ! ir0 is the first grid point for which q*r(ir0) > xseries + ! notice that for small q it may happen that q*r(msh) < xseries ! + + ir0 = msh+1 + do ir = 1, msh + if ( abs (q * r (ir) ) > xseries ) then + ir0 = ir + exit + end if + end do + + do ir = 1, ir0 - 1 + x = q * r (ir) + if ( l == 0 ) then + xl = 1.0_dp + else + xl = x**l + end if + jl (ir) = xl/semifact(2*l+1) * & + ( 1.0_dp - x**2/1.0_dp/2.0_dp/(2.0_dp*l+3) * & + ( 1.0_dp - x**2/2.0_dp/2.0_dp/(2.0_dp*l+5) * & + ( 1.0_dp - x**2/3.0_dp/2.0_dp/(2.0_dp*l+7) * & + ( 1.0_dp - x**2/4.0_dp/2.0_dp/(2.0_dp*l+9) ) ) ) ) + end do + + ! the following shouldn't be needed but do you trust compilers + ! to do the right thing in this special case ? I don't - PG + + if ( ir0 > msh ) return + + if (l == 0) then + +#if defined (__MASS) + + qr = q * r + call vsin( sin_qr, qr, msh) + jl (ir0:) = sin_qr(ir0:) / (q * r (ir0:) ) + +#else + + jl (ir0:) = sin (q * r (ir0:) ) / (q * r (ir0:) ) + +#endif + + elseif (l == 1) then + +#if defined (__MASS) + + qr = q * r + call vcos( cos_qr, qr, msh) + call vsin( sin_qr, qr, msh) + jl (ir0:) = ( sin_qr(ir0:) / (q * r (ir0:) ) - & + cos_qr(ir0:) ) / (q * r (ir0:) ) + +#else + + jl (ir0:) = (sin (q * r (ir0:) ) / (q * r (ir0:) ) - & + cos (q * r (ir0:) ) ) / (q * r (ir0:) ) + +#endif + + elseif (l == 2) then + +#if defined (__MASS) + + qr = q * r + call vcos( cos_qr, qr, msh) + call vsin( sin_qr, qr, msh) + jl (ir0:) = ( (3.d0 / (q*r(ir0:)) - (q*r(ir0:)) ) * sin_qr(ir0: ) - & + 3.d0 * cos_qr(ir0:) ) / (q*r(ir0:))**2 + +#else + + jl (ir0:) = ( (3.d0 / (q*r(ir0:)) - (q*r(ir0:)) ) * sin (q*r(ir0:)) - & + 3.d0 * cos (q*r(ir0:)) ) / (q*r(ir0:))**2 + +#endif + + elseif (l == 3) then + +#if defined (__MASS) + + qr = q * r + call vcos( cos_qr, qr, msh) + call vsin( sin_qr, qr, msh) + jl (ir0:) = (sin_qr (ir0:) * & + (15.d0 / (q*r(ir0:)) - 6.d0 * (q*r(ir0:)) ) + & + cos_qr (ir0:) * ( (q*r(ir0:))**2 - 15.d0) ) / & + (q*r(ir0:))**3 + +#else + + jl (ir0:) = (sin (q*r(ir0:)) * & + (15.d0 / (q*r(ir0:)) - 6.d0 * (q*r(ir0:)) ) + & + cos (q*r(ir0:)) * ( (q*r(ir0:))**2 - 15.d0) ) / & + (q*r(ir0:)) **3 + +#endif + + elseif (l == 4) then + +#if defined (__MASS) + + qr = q * r + call vcos( cos_qr, qr, msh) + call vsin( sin_qr, qr, msh) + jl (ir0:) = (sin_qr (ir0:) * & + (105.d0 - 45.d0 * (q*r(ir0:))**2 + (q*r(ir0:))**4) + & + cos_qr (ir0:) * & + (10.d0 * (q*r(ir0:))**3 - 105.d0 * (q*r(ir0:))) ) / & + (q*r(ir0:))**5 + +#else + + jl (ir0:) = (sin (q*r(ir0:)) * & + (105.d0 - 45.d0 * (q*r(ir0:))**2 + (q*r(ir0:))**4) + & + cos (q*r(ir0:)) * & + (10.d0 * (q*r(ir0:))**3 - 105.d0 * (q*r(ir0:))) ) / & + (q*r(ir0:))**5 +#endif + + elseif (l == 5) then + +#if defined (__MASS) + qr = q * r + call vcos( cos_qr, qr, msh) + call vsin( sin_qr, qr, msh) + jl (ir0:) = (-cos_qr(ir0:) - & + (945.d0*cos_qr(ir0:)) / (q*r(ir0:)) ** 4 + & + (105.d0*cos_qr(ir0:)) / (q*r(ir0:)) ** 2 + & + (945.d0*sin_qr(ir0:)) / (q*r(ir0:)) ** 5 - & + (420.d0*sin_qr(ir0:)) / (q*r(ir0:)) ** 3 + & + ( 15.d0*sin_qr(ir0:)) / (q*r(ir0:)) ) / (q*r(ir0:)) +#else + jl (ir0:) = (-cos(q*r(ir0:)) - & + (945.d0*cos(q*r(ir0:))) / (q*r(ir0:)) ** 4 + & + (105.d0*cos(q*r(ir0:))) / (q*r(ir0:)) ** 2 + & + (945.d0*sin(q*r(ir0:))) / (q*r(ir0:)) ** 5 - & + (420.d0*sin(q*r(ir0:))) / (q*r(ir0:)) ** 3 + & + ( 15.d0*sin(q*r(ir0:))) / (q*r(ir0:)) ) / (q*r(ir0:)) +#endif + + elseif (l == 6) then + +#if defined (__MASS) + + qr = q * r + call vcos( cos_qr, qr, msh) + call vsin( sin_qr, qr, msh) + jl (ir0:) = ((-10395.d0*cos_qr(ir0:)) / (q*r(ir0:))**5 + & + ( 1260.d0*cos_qr(ir0:)) / (q*r(ir0:))**3 - & + ( 21.d0*cos_qr(ir0:)) / (q*r(ir0:)) - & + sin_qr(ir0:) + & + ( 10395.d0*sin_qr(ir0:)) / (q*r(ir0:))**6 - & + ( 4725.d0*sin_qr(ir0:)) / (q*r(ir0:))**4 + & + ( 210.d0*sin_qr(ir0:)) / (q*r(ir0:))**2 ) / (q*r(ir0:)) +#else + + jl (ir0:) = ((-10395.d0*cos(q*r(ir0:))) / (q*r(ir0:))**5 + & + ( 1260.d0*cos(q*r(ir0:))) / (q*r(ir0:))**3 - & + ( 21.d0*cos(q*r(ir0:))) / (q*r(ir0:)) - & + sin(q*r(ir0:)) + & + ( 10395.d0*sin(q*r(ir0:))) / (q*r(ir0:))**6 - & + ( 4725.d0*sin(q*r(ir0:))) / (q*r(ir0:))**4 + & + ( 210.d0*sin(q*r(ir0:))) / (q*r(ir0:))**2 ) / (q*r(ir0:)) +#endif + + else + + call errore ('sph_bes', 'not implemented', abs(l)) + + endif + ! + return +end subroutine sph_bes + +integer function semifact(n) + ! semifact(n) = n!! + implicit none + integer :: n, i + + semifact = 1 + do i = n, 1, -2 + semifact = i*semifact + end do + return +end function semifact + diff --git a/tests/apps/miniDFT/tests/src/splinelib.f90 b/tests/apps/miniDFT/tests/src/splinelib.f90 new file mode 100644 index 0000000000..ced4a78add --- /dev/null +++ b/tests/apps/miniDFT/tests/src/splinelib.f90 @@ -0,0 +1,293 @@ +! +! Copyright (C) 2004-2006 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +!--------------------------------------------------------------------------- +MODULE splinelib + !--------------------------------------------------------------------------- + ! + USE kinds, ONLY : DP + ! + IMPLICIT NONE + ! + PRIVATE + ! + PUBLIC :: dosplineint, spline, splint, splint_deriv + ! + INTERFACE dosplineint + ! + MODULE PROCEDURE dosplineint_1D, dosplineint_2D + ! + END INTERFACE + ! + CONTAINS + ! + !------------------------------------------------------------------------ + SUBROUTINE spline( xdata, ydata, startu, startd, d2y ) + !------------------------------------------------------------------------ + ! + IMPLICIT NONE + ! + REAL(DP), INTENT(IN) :: xdata(:), ydata(:), startu, startd + REAL(DP), INTENT(OUT) :: d2y(:) + ! + INTEGER :: i, k, ydim + REAL(DP) :: p, sig + REAL(DP), ALLOCATABLE :: u(:) + ! + ! + ydim = SIZE( ydata ) + ! + ALLOCATE( u( ydim ) ) + ! + u(1) = startu + d2y(1) = startd + ! + DO i = 2, ydim - 1 + ! + sig = ( xdata(i) - xdata(i-1) ) / ( xdata(i+1) - xdata(i-1) ) + p = sig * d2y(i- 1) + 2.0_DP + d2y(i) = ( sig - 1.0_DP ) / p + u(i) = ( 6.0_DP * ( ( ydata(i+1) - ydata(i) ) / & + ( xdata(i+1) - xdata(i) ) - ( ydata(i) - ydata(i-1) ) / & + ( xdata(i) - xdata(i-1) ) ) / & + ( xdata(i+1) - xdata(i-1) ) - sig * u(i-1) ) / p + ! + END DO + ! + d2y(ydim) = 0 + ! + DO k = ydim - 1, 1, -1 + ! + d2y(k) = d2y(k) * d2y(k+1) + u(k) + ! + END DO + ! + DEALLOCATE( u ) + ! + END SUBROUTINE spline + ! + !------------------------------------------------------------------------ + FUNCTION splint( xdata, ydata, d2y, x ) + !------------------------------------------------------------------------ + ! + IMPLICIT NONE + ! + REAL(DP), INTENT(IN) :: xdata(:), ydata(:), d2y(:) + REAL(DP), INTENT(IN) :: x + ! + REAL(DP) :: splint + INTEGER :: khi, klo, xdim + REAL(DP) :: a, b, h + ! + ! + xdim = SIZE( xdata ) + ! + klo = 1 + khi = xdim + ! + klo = MAX( MIN( locate( xdata, x ), ( xdim - 1 ) ), 1 ) + ! + khi = klo + 1 + ! + h = xdata(khi) - xdata(klo) + ! + a = ( xdata(khi) - x ) / h + b = ( x - xdata(klo) ) / h + ! + splint = a * ydata(klo) + b * ydata(khi) + & + ( ( a**3 - a ) * d2y(klo) + ( b**3 - b ) * d2y(khi) ) * & + ( h**2 ) / 6.0_DP + + END FUNCTION splint + + + !------------------------------------------------------------------------ + FUNCTION splint_deriv( xdata, ydata, d2y, x ) + !------------------------------------------------------------------------ + ! + IMPLICIT NONE + ! + REAL(DP), INTENT(IN) :: xdata(:), ydata(:), d2y(:) + REAL(DP), INTENT(IN) :: x + ! + REAL(DP) :: splint_deriv + INTEGER :: khi, klo, xdim + REAL(DP) :: a, b, da, db, h + ! + ! + xdim = SIZE( xdata ) + ! + klo = 1 + khi = xdim + ! + klo = MAX( MIN( locate( xdata, x ), ( xdim - 1 ) ), 1 ) + ! + khi = klo + 1 + ! + h = xdata(khi) - xdata(klo) + ! + a = ( xdata(khi) - x ) / h + b = ( x - xdata(klo) ) / h + da = -1.0_DP / h + db = 1.0_DP / h + ! + splint_deriv = da * ydata(klo) + db * ydata(khi) + & + ( ( 3.0_DP*a**2 - 1.0_DP ) * da * d2y(klo) + & + ( 3.0_DP*b**2 - 1.0_DP ) * db * d2y(khi) ) * & + ( h**2 ) / 6.0_DP + + END FUNCTION splint_deriv + + !------------------------------------------------------------------- + FUNCTION locate( xx, x ) + !------------------------------------------------------------------- + ! + IMPLICIT NONE + ! + REAL(DP), INTENT(IN) :: xx(:) + REAL(DP), INTENT(IN) :: x + ! + INTEGER :: locate + INTEGER :: n, jl, jm, ju + LOGICAL :: ascnd + ! + ! + n = SIZE( xx ) + ascnd = ( xx(n) >= xx(1) ) + jl = 0 + ju = n + 1 + ! + main_loop: DO + ! + IF ( ( ju - jl ) <= 1 ) EXIT main_loop + ! + jm = ( ju + jl ) / 2 + ! + IF ( ascnd .EQV. ( x >= xx(jm) ) ) THEN + ! + jl = jm + ! + ELSE + ! + ju = jm + ! + END IF + ! + END DO main_loop + ! + IF ( x == xx(1) ) THEN + ! + locate = 1 + ! + ELSE IF ( x == xx(n) ) THEN + ! + locate = n - 1 + ! + ELSE + ! + locate = jl + ! + END IF + ! + END FUNCTION locate + ! + ! + !------------------------------------------------------------------------ + SUBROUTINE dosplineint_1D( old_mesh, old_vec, new_mesh, new_vec ) + !------------------------------------------------------------------------ + ! + IMPLICIT NONE + ! + REAL (DP), INTENT(IN) :: old_mesh(:), new_mesh(:) + REAL (DP), INTENT(IN) :: old_vec(:) + REAL (DP), INTENT(OUT) :: new_vec(:) + ! + REAL (DP), ALLOCATABLE :: d2y(:) + INTEGER :: i + INTEGER :: old_dim, new_dim + ! + ! + old_dim = SIZE( old_vec ) + new_dim = SIZE( new_vec ) + ! + IF ( old_dim /= SIZE( old_mesh ) ) & + CALL errore( 'dosplineint', & + 'dimensions of old_mesh and old_vec do not match', 1 ) + ! + IF ( new_dim /= SIZE( new_mesh ) ) & + CALL errore( 'dosplineint', & + 'dimensions of new_mesh and new_vec do not match', 1 ) + ! + ALLOCATE( d2y( old_dim ) ) + ! + d2y = 0 + ! + CALL spline( old_mesh , old_vec(:), 0.0_DP, 0.0_DP, d2y ) + ! + DO i = 1, new_dim + ! + new_vec(i) = splint( old_mesh, old_vec(:), d2y, new_mesh(i) ) + ! + END DO + ! + DEALLOCATE( d2y ) + ! + END SUBROUTINE dosplineint_1D + ! + !------------------------------------------------------------------------ + SUBROUTINE dosplineint_2D( old_mesh, old_vec, new_mesh, new_vec ) + !------------------------------------------------------------------------ + ! + IMPLICIT NONE + ! + REAL (DP), INTENT(IN) :: old_mesh(:), new_mesh(:) + REAL (DP), INTENT(IN) :: old_vec(:,:) + REAL (DP), INTENT(OUT) :: new_vec(:,:) + ! + REAL (DP), ALLOCATABLE :: d2y(:) + INTEGER :: dim, i, j + INTEGER :: old_dim, new_dim + ! + ! + dim = SIZE( old_vec, 1 ) + ! + IF( dim /= SIZE( new_vec, 1 ) ) & + CALL errore( 'dosplineint', & + 'dimensions of old_vec and new_vec do not match', 1 ) + ! + old_dim = SIZE( old_vec, 2 ) + new_dim = SIZE( new_vec, 2 ) + ! + IF ( old_dim /= SIZE( old_mesh, 1 ) ) & + CALL errore( 'dosplineint', & + 'dimensions of old_mesh and old_vec do not match', 1 ) + ! + IF ( new_dim /= SIZE( new_mesh, 1 ) ) & + CALL errore( 'dosplineint', & + 'dimensions of new_mesh and new_vec do not match', 1 ) + ! + ALLOCATE( d2y( old_dim ) ) + ! + DO i = 1, dim + ! + d2y = 0 + ! + CALL spline( old_mesh , old_vec(i,:), 0.0_DP, 0.0_DP, d2y ) + ! + DO j = 1, new_dim + ! + new_vec(i,j) = splint( old_mesh, old_vec(i,:), d2y, new_mesh(j) ) + ! + END DO + ! + END DO + ! + DEALLOCATE( d2y ) + ! + END SUBROUTINE dosplineint_2D + ! +END MODULE splinelib diff --git a/tests/apps/miniDFT/tests/src/stack.c b/tests/apps/miniDFT/tests/src/stack.c new file mode 100644 index 0000000000..0bc5b003dd --- /dev/null +++ b/tests/apps/miniDFT/tests/src/stack.c @@ -0,0 +1,36 @@ +/* + Copyright (C) 2007-2008 Quantum ESPRESSO group + This file is distributed under the terms of the + GNU General Public License. See the file `License' + in the root directory of the present distribution, + or http://www.gnu.org/copyleft/gpl.txt . +*/ + +#include "c_defs.h" +#include +#include +#ifdef __INTEL + +#include + +void F77_FUNC_(remove_stack_limit,REMOVE_STACK_LIMIT) (void) { + + struct rlimit rlim = { RLIM_INFINITY, RLIM_INFINITY }; + + /* Modified according to Cesar Da Silva suggestions */ + if ( setrlimit(RLIMIT_STACK, &rlim) == -1 ) { + if ( getrlimit(RLIMIT_STACK, &rlim) == 0 ) { + rlim.rlim_cur = rlim.rlim_max; + if ( setrlimit(RLIMIT_STACK, &rlim) == 0 ) { + getrlimit(RLIMIT_STACK, &rlim); + } else { + perror(" Cannot set stack size to new value"); + } + } + } +} + +#else +void F77_FUNC_(remove_stack_limit,REMOVE_STACK_LIMIT) (void) { +} +#endif diff --git a/tests/apps/miniDFT/tests/src/start_k.f90 b/tests/apps/miniDFT/tests/src/start_k.f90 new file mode 100644 index 0000000000..754d37cbca --- /dev/null +++ b/tests/apps/miniDFT/tests/src/start_k.f90 @@ -0,0 +1,97 @@ +! +! Copyright (C) 2011 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +!-------------------------------------------------------------------------- +! +MODULE start_k + ! + ! ... Basic variables for k-point generations, as read from input + ! + USE kinds, ONLY : DP + USE cell_base, ONLY : bg + ! + SAVE + ! + ! ... uniform k-point grid parameters + ! + INTEGER :: & + nk1, nk2, nk3, &! the special-point grid + k1, k2, k3 ! the offset from the origin + ! + ! + ! ... k points and weights, read from input, if any + ! + INTEGER :: nks_start=0 ! number of k points + REAL(DP), ALLOCATABLE :: wk_start(:) ! weights of k points + REAL(DP), ALLOCATABLE :: xk_start(:,:) ! coordinates of k points + + CONTAINS + + SUBROUTINE init_start_k ( nk1_, nk2_, nk3_, k1_, k2_, k3_, & + k_points, nk_, xk_, wk_ ) + ! + ! initialize the grid of k points + ! + INTEGER, INTENT (IN) :: nk1_, nk2_, nk3_, k1_, k2_, k3_, nk_ + CHARACTER(LEN=*), INTENT (IN) :: k_points + REAL(dp),INTENT (IN) :: xk_(3,nk_), wk_(nk_) + ! + LOGICAL :: done + ! + ! variables for automatic grid + ! + nk1 = 0; nk2 = 0; nk3 = 0; k1 = 0; k2 = 0; k3 = 0 + done = reset_grid ( nk1_, nk2_, nk3_, k1_, k2_, k3_ ) + IF ( k_points == 'automatic' .AND. .not. done ) & + CALL errore ('init_start_k','automatic k-points and nk*=0?',1) + ! + ! variables for manual grid + ! + IF ( k_points == 'gamma' ) THEN + nks_start = 1 + ELSE + nks_start = nk_ + END IF + ! + IF ( nks_start > 0) THEN + IF ( .NOT. ALLOCATED (xk_start) ) ALLOCATE ( xk_start(3,nks_start) ) + IF ( .NOT. ALLOCATED (wk_start) ) ALLOCATE ( wk_start(nks_start) ) + ! + ! k-points in crystal axis: transform to cartesian (in units 2pi/a) + ! BEWARE: reciprocal axis bg NEEDED, must have been initialized + ! + IF ( k_points == 'crystal' ) CALL cryst_to_cart(nk_, xk_, bg, 1) + ! + IF ( k_points == 'gamma' ) THEN + xk_start(:,1) = 0.0_dp + wk_start(1) = 1.0_dp + ELSE + xk_start(:,:) = xk_(:,1:nk_) + wk_start(:) = wk_(1:nk_) + ENDIF + END IF + ! + END SUBROUTINE init_start_k + ! + LOGICAL FUNCTION reset_grid ( nk1_, nk2_, nk3_, k1_, k2_, k3_ ) + ! + ! reset the automatic grid to new values if these are > 0 + ! + INTEGER, INTENT (IN) :: nk1_, nk2_, nk3_, k1_, k2_, k3_ + ! + IF ( nk1_ > 0 ) nk1 = nk1_ + IF ( nk2_ > 0 ) nk2 = nk2_ + IF ( nk3_ > 0 ) nk3 = nk3_ + IF ( k1_ > 0 ) k1 = k1_ + IF ( k2_ > 0 ) k2 = k2_ + IF ( k3_ > 0 ) k3 = k3_ + ! + reset_grid = (nk1_*nk2_*nk3_ > 0) + ! + END FUNCTION reset_grid + +END MODULE start_k diff --git a/tests/apps/miniDFT/tests/src/stick_base.f90 b/tests/apps/miniDFT/tests/src/stick_base.f90 new file mode 100644 index 0000000000..53980a8dd5 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/stick_base.f90 @@ -0,0 +1,573 @@ +! +! Copyright (C) 2002-2010 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! + +!=----------------------------------------------------------------------= + MODULE stick_base +!=----------------------------------------------------------------------= + + USE kinds + USE io_global, ONLY: ionode + + IMPLICIT NONE + PRIVATE + SAVE + + PUBLIC :: sticks_maps, sticks_sort, sticks_countg, sticks_dist, sticks_pairup + PUBLIC :: sticks_owner, sticks_deallocate, sticks_maps_scalar + +! ... sticks_owner : stick owner, sticks_owner( i, j ) is the index of the processor +! ... (starting from 1) owning the stick whose x and y coordinate are i and j. + + INTEGER, ALLOCATABLE, TARGET :: sticks_owner( : , : ) + +!=----------------------------------------------------------------------= + CONTAINS +!=----------------------------------------------------------------------= + + SUBROUTINE sticks_maps( tk, ub, lb, b1, b2, b3, gcut, gcutw, gcuts, st, stw, sts, me, nproc, comm ) + + USE mp, ONLY: mp_sum + + LOGICAL, INTENT(in) :: tk ! if true use the full space grid + INTEGER, INTENT(in) :: ub(:) ! upper bounds for i-th grid dimension + INTEGER, INTENT(in) :: lb(:) ! lower bounds for i-th grid dimension + REAL(DP) , INTENT(in) :: b1(:), b2(:), b3(:) ! reciprocal space base vectors + REAL(DP) , INTENT(in) :: gcut ! cut-off for potentials + REAL(DP) , INTENT(in) :: gcutw ! cut-off for plane waves + REAL(DP) , INTENT(in) :: gcuts ! cut-off for smooth mesh + INTEGER, INTENT(out) :: st( lb(1): ub(1), lb(2):ub(2) ) ! stick map for potential + INTEGER, INTENT(out) :: stw(lb(1): ub(1), lb(2):ub(2) ) ! stick map for wave functions + INTEGER, INTENT(out) :: sts(lb(1): ub(1), lb(2):ub(2) ) ! stick map for smooth mesh + INTEGER, INTENT(in) :: me ! my proc id (starting from 0) + INTEGER, INTENT(in) :: nproc ! number of proc in the g-vec group + INTEGER, INTENT(in) :: comm ! communicator of the g-vec group + + INTEGER :: i, j, k, kip + REAL(DP) :: gsq + + stw = 0 + st = 0 + sts = 0 + +! ... Here find the basic maps of sticks st, stw and sts for the potential +! ... cut-off gcut, wavefunction cut-off gcutw, and smooth mesh cut-off gcuts + +! ... st(i,j) will contain the number of G vectors of the stick whose +! ... indices are (i,j). + +#if defined (__EKO) + WRITE(*,*) ! Workaround for EKOPath compiler bug +#endif + IF( .not. tk ) THEN + + kip = 0 + abs(lb(3)) + 1 + IF( mod( kip, nproc ) == me ) THEN + st (0,0) = st (0,0) + 1 + stw(0,0) = stw(0,0) + 1 + sts(0,0) = sts(0,0) + 1 + ENDIF + + DO i= 0, 0 + DO j= 0, 0 + DO k= 1, ub(3) + kip = k + abs(lb(3)) + 1 + IF( mod( kip, nproc ) == me ) THEN + gsq= (dble(i)*b1(1)+dble(j)*b2(1)+dble(k)*b3(1) )**2 + gsq=gsq+(dble(i)*b1(2)+dble(j)*b2(2)+dble(k)*b3(2) )**2 + gsq=gsq+(dble(i)*b1(3)+dble(j)*b2(3)+dble(k)*b3(3) )**2 + IF(gsq.le.gcut ) THEN + st(i,j) = st(i,j) + 1 + IF(gsq.le.gcutw) THEN + stw(i,j) = stw(i,j) + 1 + ENDIF + IF(gsq.le.gcuts) THEN + sts(i,j) = sts(i,j) + 1 + ENDIF + ENDIF + ENDIF + ENDDO + ENDDO + ENDDO + + DO i = 0, 0 + DO j = 1, ub(2) + DO k = lb(3), ub(3) + kip = k + abs(lb(3)) + 1 + IF( mod( kip, nproc) == me ) THEN + gsq= (dble(i)*b1(1)+dble(j)*b2(1)+dble(k)*b3(1) )**2 + gsq=gsq+(dble(i)*b1(2)+dble(j)*b2(2)+dble(k)*b3(2) )**2 + gsq=gsq+(dble(i)*b1(3)+dble(j)*b2(3)+dble(k)*b3(3) )**2 + IF(gsq.le.gcut ) THEN + st(i,j) = st(i,j) + 1 + IF(gsq.le.gcutw) THEN + stw(i,j) = stw(i,j) + 1 + ENDIF + IF(gsq.le.gcuts) THEN + sts(i,j) = sts(i,j) + 1 + ENDIF + ENDIF + ENDIF + ENDDO + ENDDO + ENDDO + + DO i = 1, ub(1) + DO j = lb(2), ub(2) + DO k = lb(3), ub(3) + kip = k + abs(lb(3)) + 1 + IF( mod( kip, nproc) == me ) THEN + gsq= (dble(i)*b1(1)+dble(j)*b2(1)+dble(k)*b3(1) )**2 + gsq=gsq+(dble(i)*b1(2)+dble(j)*b2(2)+dble(k)*b3(2) )**2 + gsq=gsq+(dble(i)*b1(3)+dble(j)*b2(3)+dble(k)*b3(3) )**2 + IF(gsq.le.gcut ) THEN + st(i,j) = st(i,j) + 1 + IF(gsq.le.gcutw) THEN + stw(i,j) = stw(i,j) + 1 + ENDIF + IF(gsq.le.gcuts) THEN + sts(i,j) = sts(i,j) + 1 + ENDIF + ENDIF + ENDIF + ENDDO + ENDDO + ENDDO + + ELSE + + DO i= lb(1), ub(1) + DO j= lb(2), ub(2) + DO k= lb(3), ub(3) + kip = k + abs(lb(3)) + 1 + IF( mod( kip, nproc ) == me ) THEN + gsq= (dble(i)*b1(1)+dble(j)*b2(1)+dble(k)*b3(1) )**2 + gsq=gsq+(dble(i)*b1(2)+dble(j)*b2(2)+dble(k)*b3(2) )**2 + gsq=gsq+(dble(i)*b1(3)+dble(j)*b2(3)+dble(k)*b3(3) )**2 + IF(gsq.le.gcut ) THEN + st(i,j) = st(i,j) + 1 + ENDIF + IF(gsq.le.gcutw) THEN + stw(i,j) = stw(i,j) + 1 + ENDIF + IF(gsq.le.gcuts) THEN + sts(i,j) = sts(i,j) + 1 + ENDIF + ENDIF + ENDDO + ENDDO + ENDDO + + ENDIF + + CALL mp_sum(st , comm ) + CALL mp_sum(stw , comm ) + CALL mp_sum(sts , comm ) + +#if defined __STICKS_DEBUG +! Test sticks + WRITE( 6,*) 'testtesttesttesttesttesttesttesttesttest' + WRITE( 6,*) 'lb = ', lb(1), lb(2) + WRITE( 6,*) 'ub = ', ub(1), ub(2) + WRITE( 6,*) 'counts = ', count( st > 0 ), count( stw > 0 ), count( sts > 0 ) + WRITE( 6,*) 'cut-offs = ', gcut, gcutw, gcuts + WRITE( 6,*) 'b1 = ', b1(1:3) + WRITE( 6,*) 'b2 = ', b2(1:3) + WRITE( 6,*) 'b3 = ', b3(1:3) + DO i = lb(1), ub(1) + DO j = lb(2), ub(2) + WRITE( 6,'(2I4,3I6)') i,j,st(i,j),stw(i,j),sts(i,j) + ENDDO + ENDDO + WRITE( 6,*) 'testtesttesttesttesttesttesttesttesttest' +! Test sticks +#endif + + RETURN + END SUBROUTINE sticks_maps + +!=----------------------------------------------------------------------= + + SUBROUTINE sticks_maps_scalar( lgamma, ub, lb, b1, b2, b3, gcutm, gkcut, gcutms, stw, ngm, ngms ) + + LOGICAL, INTENT(in) :: lgamma ! if true use gamma point simmetry + INTEGER, INTENT(in) :: ub(:) ! upper bounds for i-th grid dimension + INTEGER, INTENT(in) :: lb(:) ! lower bounds for i-th grid dimension + REAL(DP) , INTENT(in) :: b1(:), b2(:), b3(:) ! reciprocal space base vectors + REAL(DP) , INTENT(in) :: gcutm ! cut-off for potentials + REAL(DP) , INTENT(in) :: gkcut ! cut-off for plane waves + REAL(DP) , INTENT(in) :: gcutms ! cut-off for smooth mesh + ! + INTEGER, INTENT(out) :: ngm, ngms + ! + ! stick map for wave functions, note that map is taken in YZ plane + ! + INTEGER, INTENT(out) :: stw( lb(2) : ub(2), lb(3) : ub(3) ) + + INTEGER :: i1, i2, i3, n1, n2, n3 + REAL(DP) :: amod + + ngm = 0 + ngms = 0 + stw = 0 + + n1 = max( abs( lb(1) ), abs( ub(1) ) ) + n2 = max( abs( lb(2) ), abs( ub(2) ) ) + n3 = max( abs( lb(3) ), abs( ub(3) ) ) + + loop1: DO i1 = - n1, n1 + ! + ! Gamma-only: exclude space with x<0 + ! + IF (lgamma .and. i1 < 0) CYCLE loop1 + ! + loop2: DO i2 = - n2, n2 + ! + ! Gamma-only: exclude plane with x=0, y<0 + ! + IF(lgamma .and. i1 == 0.and. i2 < 0) CYCLE loop2 + ! + loop3: DO i3 = - n3, n3 + ! + ! Gamma-only: exclude line with x=0, y=0, z<0 + ! + IF(lgamma .and. i1 == 0 .and. i2 == 0 .and. i3 < 0) CYCLE loop3 + ! + amod = (i1 * b1 (1) + i2 * b2 (1) + i3 * b3 (1) ) **2 + & + (i1 * b1 (2) + i2 * b2 (2) + i3 * b3 (2) ) **2 + & + (i1 * b1 (3) + i2 * b2 (3) + i3 * b3 (3) ) **2 + IF (amod <= gcutm) ngm = ngm + 1 + IF (amod <= gcutms) ngms = ngms + 1 + IF (amod <= gkcut ) THEN + stw( i2, i3 ) = 1 + IF (lgamma) stw( -i2, -i3 ) = 1 + ENDIF + ENDDO loop3 + ENDDO loop2 + ENDDO loop1 + + RETURN + END SUBROUTINE sticks_maps_scalar + + +!=----------------------------------------------------------------------= + + SUBROUTINE sticks_sort( ngc, ngcw, ngcs, nct, idx, nproc ) + +! ... This subroutine sorts the sticks indexes, according to +! ... the length and type of the sticks, wave functions sticks +! ... first, then smooth mesh sticks, and finally potential +! ... sticks + + ! lengths of sticks, ngc for potential mesh, ngcw for wave functions mesh + ! and ngcs for smooth mesh + + INTEGER, INTENT(in) :: ngc(:), ngcw(:), ngcs(:) + INTEGER, INTENT(in) :: nproc ! number of proc in the g-vec group + + ! nct, total number of sticks + + INTEGER, INTENT(in) :: nct + + ! index, on output, new sticks indexes + + INTEGER, INTENT(out) :: idx(:) + + INTEGER :: mc, nr3x, ic + REAL(DP) :: dn3 + REAL(DP), ALLOCATABLE :: aux(:) + + nr3x = maxval( ngc(1:nct) ) + 1 + dn3 = REAL( nr3x ) + + IF( nproc > 1 ) THEN + ALLOCATE( aux( nct ) ) + DO mc = 1, nct + aux(mc) = ngcw(mc) + aux(mc) = dn3 * aux(mc) + ngcs(mc) + aux(mc) = dn3 * aux(mc) + ngc(mc) + aux(mc) = -aux(mc) + idx(mc) = 0 + ENDDO + CALL hpsort( nct, aux(1), idx(1)) + DEALLOCATE( aux ) + ELSE + ic = 0 + DO mc = 1, nct + IF( ngcw(mc) > 0 ) THEN + ic = ic + 1 + idx(ic) = mc + ENDIF + ENDDO + DO mc = 1, nct + IF( ngcs(mc) > 0 .and. ngcw(mc) == 0 ) THEN + ic = ic + 1 + idx(ic) = mc + ENDIF + ENDDO + DO mc = 1, nct + IF( ngc(mc) > 0 .and. ngcs(mc) == 0 .and. ngcw(mc) == 0 ) THEN + ic = ic + 1 + idx(ic) = mc + ENDIF + ENDDO + ENDIF + +#if defined __STICKS_DEBUG + WRITE( 6,*) '-----------------' + WRITE( 6,*) 'STICKS_SORT DEBUG' + DO mc = 1, nct + WRITE( 6, fmt="(4I10)" ) idx(mc), ngcw( idx(mc) ), ngcs( idx(mc) ), ngc( idx(mc) ) + ENDDO + WRITE( 6,*) '-----------------' +#endif + + RETURN + END SUBROUTINE sticks_sort + +!=----------------------------------------------------------------------= + + SUBROUTINE sticks_countg( tk, ub, lb, st, stw, sts, in1, in2, ngc, ngcw, ngcs ) + + INTEGER, INTENT(in) :: ub(:), lb(:) + INTEGER, INTENT(in) :: st( lb(1): ub(1), lb(2):ub(2) ) ! stick map for potential + INTEGER, INTENT(in) :: stw(lb(1): ub(1), lb(2):ub(2) ) ! stick map for wave functions + INTEGER, INTENT(in) :: sts(lb(1): ub(1), lb(2):ub(2) ) ! stick map for smooth mesh + LOGICAL, INTENT(in) :: tk + + INTEGER, INTENT(out) :: in1(:), in2(:) + INTEGER, INTENT(out) :: ngc(:), ngcw(:), ngcs(:) + + INTEGER :: j1, j2, i1, i2, nct, min_size + +! +! ... initialize the sticks indexes array ist +! ... nct counts columns containing G-vectors for the dense grid +! ... ncts counts columns contaning G-vectors for the smooth grid +! + nct = 0 + + ngc = 0 + ngcs = 0 + ngcw = 0 + + min_size = min( size( in1 ), size( in2 ), size( ngc ), size( ngcw ), size( ngcs ) ) + + DO j2 = 0, ( ub(2) - lb(2) ) + DO j1 = 0, ( ub(1) - lb(1) ) + + i1 = j1 + IF( i1 > ub(1) ) i1 = lb(1) + ( i1 - ub(1) ) - 1 + + i2 = j2 + IF( i2 > ub(2) ) i2 = lb(2) + ( i2 - ub(2) ) - 1 + + IF( st( i1, i2 ) > 0 ) THEN + + ! this sticks contains G-vectors + + nct = nct + 1 + IF( nct > min_size ) & + CALL errore(' sticks_countg ',' too many sticks ', nct ) + + in1(nct) = i1 + in2(nct) = i2 + + ngc(nct) = st( i1 , i2) + IF( stw( i1, i2 ) .gt. 0 ) ngcw(nct) = stw( i1 , i2) + IF( sts( i1, i2 ) .gt. 0 ) ngcs(nct) = sts( i1 , i2) + + ENDIF + + ! WRITE(7,fmt="(5I5)") i1, i2, nct, ngc(nct), ngcw( nct ) + + ENDDO + ENDDO + + RETURN + END SUBROUTINE sticks_countg + +!=----------------------------------------------------------------------= + + SUBROUTINE sticks_dist( tk, ub, lb, idx, in1, in2, ngc, ngcw, ngcs, nct, & + ncp, ncpw, ncps, ngp, ngpw, ngps, stown, stownw, stowns, nproc ) + + LOGICAL, INTENT(in) :: tk + + INTEGER, INTENT(in) :: ub(:), lb(:), idx(:) + INTEGER, INTENT(out) :: stown( lb(1): ub(1), lb(2):ub(2) ) ! stick map for potential + INTEGER, INTENT(out) :: stownw(lb(1): ub(1), lb(2):ub(2) ) ! stick map for wave functions + INTEGER, INTENT(out) :: stowns(lb(1): ub(1), lb(2):ub(2) ) ! stick map for smooth mesh + + INTEGER, INTENT(in) :: in1(:), in2(:) + INTEGER, INTENT(in) :: ngc(:), ngcw(:), ngcs(:) + INTEGER, INTENT(in) :: nct + INTEGER, INTENT(out) :: ncp(:), ncpw(:), ncps(:) + INTEGER, INTENT(out) :: ngp(:), ngpw(:), ngps(:) + INTEGER, INTENT(in) :: nproc ! number of proc in the g-vec group + + INTEGER :: mc, i1, i2, i, j, jj + + ncp = 0 + ncps = 0 + ncpw = 0 + ngp = 0 + ngps = 0 + ngpw = 0 + + stown = 0 + stownw = 0 + stowns = 0 + + DO mc = 1, nct + + i = idx( mc ) +! +! index contains the desired ordering of sticks (see above) +! + i1 = in1( i ) + i2 = in2( i ) +! + IF ( ( .not. tk ) .and. ( (i1 < 0) .or. ( (i1 == 0) .and. (i2 < 0) ) ) ) GOTO 30 +! + jj = 1 + + IF ( ngcw(i) > 0 ) THEN +! +! this is an active sticks: find which processor has currently +! the smallest number of plane waves +! + DO j = 1, nproc + IF ( ngpw(j) < ngpw(jj) ) THEN + jj = j + ELSEIF ( ( ngpw(j) == ngpw(jj) ) .and. ( ncpw(j) < ncpw(jj) ) ) THEN + jj = j + ENDIF + ENDDO + + ELSE +! +! this is an inactive sticks: find which processor has currently +! the smallest number of G-vectors +! + DO j = 1, nproc + IF ( ngp(j) < ngp(jj) ) jj = j + ENDDO + + ENDIF +! + ! potential mesh + + ncp(jj) = ncp(jj) + 1 + ngp(jj) = ngp(jj) + ngc(i) + stown(i1,i2) = jj + + ! smooth mesh + + IF ( ngcs(i) > 0 ) THEN + ncps(jj) = ncps(jj) + 1 + ngps(jj) = ngps(jj) + ngcs(i) + stowns(i1,i2) = jj + ENDIF + + ! wave functions mesh + + IF ( ngcw(i) > 0 ) THEN + ncpw(jj) = ncpw(jj) + 1 + ngpw(jj) = ngpw(jj) + ngcw(i) + stownw(i1,i2) = jj + ENDIF + + 30 CONTINUE + + ENDDO + + RETURN + END SUBROUTINE sticks_dist + +!=----------------------------------------------------------------------= + + SUBROUTINE sticks_pairup( tk, ub, lb, idx, in1, in2, ngc, ngcw, ngcs, nct, & + ncp, ncpw, ncps, ngp, ngpw, ngps, stown, stownw, stowns, nproc ) + + LOGICAL, INTENT(in) :: tk + + INTEGER, INTENT(in) :: ub(:), lb(:), idx(:) + INTEGER, INTENT(inout) :: stown( lb(1): ub(1), lb(2):ub(2) ) ! stick map for potential + INTEGER, INTENT(inout) :: stownw(lb(1): ub(1), lb(2):ub(2) ) ! stick map for wave functions + INTEGER, INTENT(inout) :: stowns(lb(1): ub(1), lb(2):ub(2) ) ! stick map for wave functions + + INTEGER, INTENT(in) :: in1(:), in2(:) + INTEGER, INTENT(in) :: ngc(:), ngcw(:), ngcs(:) + INTEGER, INTENT(in) :: nct + INTEGER, INTENT(out) :: ncp(:), ncpw(:), ncps(:) + INTEGER, INTENT(out) :: ngp(:), ngpw(:), ngps(:) + INTEGER, INTENT(in) :: nproc ! number of proc in the g-vec group + + INTEGER :: mc, i1, i2, i, jj + + IF ( .not. tk ) THEN + + ! when gamma symmetry is used only the sticks of half reciprocal space + ! are generated, then here we pair-up the sticks with those of the other + ! half of the space, using the gamma symmetry relation + ! Note that the total numero of stick "nct" is not modified + + DO mc = 1, nct + i = idx(mc) + i1 = in1(i) + i2 = in2(i) + IF( i1 == 0 .and. i2 == 0 ) THEN + jj = stown( i1, i2 ) + IF( jj > 0 ) ngp( jj ) = ngp( jj ) + ngc( i ) - 1 + jj = stowns( i1, i2 ) + IF( jj > 0 ) ngps( jj ) = ngps( jj ) + ngcs( i ) - 1 + jj = stownw( i1, i2 ) + IF( jj > 0 ) ngpw( jj ) = ngpw( jj ) + ngcw( i ) - 1 + ELSE + jj = stown( i1, i2 ) + IF( jj > 0 ) THEN + stown( -i1, -i2 ) = jj + ncp( jj ) = ncp( jj ) + 1 + ngp( jj ) = ngp( jj ) + ngc( i ) + ENDIF + jj = stowns( i1, i2 ) + IF( jj > 0 ) THEN + stowns( -i1, -i2 ) = jj + ncps( jj ) = ncps( jj ) + 1 + ngps( jj ) = ngps( jj ) + ngcs( i ) + ENDIF + jj = stownw( i1, i2 ) + IF( jj > 0 ) THEN + stownw( -i1, -i2 ) = jj + ncpw( jj ) = ncpw( jj ) + 1 + ngpw( jj ) = ngpw( jj ) + ngcw( i ) + ENDIF + ENDIF + ENDDO + + ENDIF + + IF( allocated( sticks_owner ) ) DEALLOCATE( sticks_owner ) + ALLOCATE( sticks_owner( lb(1): ub(1), lb(2):ub(2) ) ) + + sticks_owner( :, : ) = abs( stown( :, :) ) + + RETURN + END SUBROUTINE sticks_pairup + +!=----------------------------------------------------------------------= + + SUBROUTINE sticks_deallocate + IF( allocated( sticks_owner ) ) DEALLOCATE( sticks_owner ) + RETURN + END SUBROUTINE sticks_deallocate + + +!=----------------------------------------------------------------------= + END MODULE stick_base +!=----------------------------------------------------------------------= diff --git a/tests/apps/miniDFT/tests/src/stick_set.f90 b/tests/apps/miniDFT/tests/src/stick_set.f90 new file mode 100644 index 0000000000..453e515bf6 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/stick_set.f90 @@ -0,0 +1,654 @@ +! +! Copyright (C) 2011 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! + +!=----------------------------------------------------------------------= + MODULE stick_set +!=----------------------------------------------------------------------= + +! ... Distribute G-vectors across processors as sticks and planes, +! ... initialize FFT descriptors for both dense and smooth grids + +! ... Most important dependencies: next three modules + USE stick_base +! + USE kinds, ONLY: DP + USE io_global, ONLY: ionode, stdout + USE fft_types, ONLY: fft_dlay_descriptor, fft_dlay_allocate, & + fft_dlay_set, fft_dlay_scalar + + IMPLICIT NONE + PRIVATE + SAVE + + PUBLIC :: pstickset, pstickset_custom + +!=----------------------------------------------------------------------= + CONTAINS +!=----------------------------------------------------------------------= + + SUBROUTINE pstickset( gamma_only, bg, gcut, gkcut, gcuts, & + dfftp, dffts, ngw, ngm, ngs, mype, root, nproc, comm, nogrp_ ) + + LOGICAL, INTENT(in) :: gamma_only +! ... bg(:,1), bg(:,2), bg(:,3) reciprocal space base vectors. + REAL(DP), INTENT(in) :: bg(3,3) + REAL(DP), INTENT(in) :: gcut, gkcut, gcuts + TYPE(fft_dlay_descriptor), INTENT(inout) :: dfftp, dffts + INTEGER, INTENT(out) :: ngw, ngm, ngs + + INTEGER, INTENT(IN) :: mype, root, nproc, comm + INTEGER, INTENT(IN) :: nogrp_ + + + LOGICAL :: tk + + INTEGER :: ub(3), lb(3) +! ... ub(i), lb(i) upper and lower miller indexes + +! +! ... Plane Waves +! + INTEGER, ALLOCATABLE :: stw(:,:) +! ... stick map (wave functions), stw(i,j) = number of G-vector in the +! ... stick whose x and y miller index are i and j + + INTEGER, ALLOCATABLE :: nstpw(:) +! ... number of sticks (wave functions), nstpw(ip) = number of stick +! ... for processor ip + + INTEGER, ALLOCATABLE :: sstpw(:) +! ... number of G-vectors (wave functions), sstpw(ip) = sum of the +! ... sticks length for processor ip = number of G-vectors +! ... owned by the processor ip + + INTEGER :: nstw, nstpwx +! ... nstw local number of sticks (wave functions) +! ... nstpwx maximum among all processors of nstw + +! +! ... Potentials +! + + INTEGER, ALLOCATABLE :: st(:,:) +! ... stick map (potentials), st(i,j) = number of G-vector in the +! ... stick whose x and y miller index are i and j + + INTEGER, ALLOCATABLE :: nstp(:) +! ... number of sticks (potentials), nstp(ip) = number of stick +! ... for processor ip + + INTEGER, ALLOCATABLE :: sstp(:) +! ... number of G-vectors (potentials), sstp(ip) = sum of the +! ... sticks length for processor ip = number of G-vectors +! ... owned by the processor ip + + INTEGER :: nst, nstpx +! ... nst local number of sticks (potentials) +! ... nstpx maximum among all processors of nst + +! +! ... Smooth Mesh +! + + INTEGER, ALLOCATABLE :: sts(:,:) +! ... stick map (smooth mesh), sts(i,j) = number of G-vector in the +! ... stick whose x and y miller index are i and j + + INTEGER, ALLOCATABLE :: nstps(:) +! ... number of sticks (smooth mesh), nstp(ip) = number of stick +! ... for processor ip + + INTEGER, ALLOCATABLE :: sstps(:) +! ... number of G-vectors (smooth mesh), sstps(ip) = sum of the +! ... sticks length for processor ip = number of G-vectors +! ... owned by the processor ip + + INTEGER :: nsts +! ... nsts local number of sticks (smooth mesh) + + + INTEGER, ALLOCATABLE :: ist(:,:) ! sticks indices ordered + INTEGER :: ip, ngm_ , ngs_ + INTEGER, ALLOCATABLE :: idx(:) + + tk = .not. gamma_only + ub(1) = ( dfftp%nr1 - 1 ) / 2 + ub(2) = ( dfftp%nr2 - 1 ) / 2 + ub(3) = ( dfftp%nr3 - 1 ) / 2 + lb = - ub + + ! ... Allocate maps + + ALLOCATE( stw ( lb(1):ub(1), lb(2):ub(2) ) ) + ALLOCATE( st ( lb(1):ub(1), lb(2):ub(2) ) ) + ALLOCATE( sts ( lb(1):ub(1), lb(2):ub(2) ) ) + + st = 0 + stw = 0 + sts = 0 + +! ... Fill in the stick maps, for given g-space base and cut-off + + CALL sticks_maps( tk, ub, lb, bg(:,1), bg(:,2), bg(:,3), & + gcut, gkcut, gcuts, st, stw, sts, mype, & + nproc, comm ) + +! ... Now count the number of stick nst and nstw + + nst = count( st > 0 ) + nstw = count( stw > 0 ) + nsts = count( sts > 0 ) + + ALLOCATE(ist(nst,5)) + + ALLOCATE(nstp(nproc)) + ALLOCATE(sstp(nproc)) + + ALLOCATE(nstpw(nproc)) + ALLOCATE(sstpw(nproc)) + + ALLOCATE(nstps(nproc)) + ALLOCATE(sstps(nproc)) + +! ... initialize the sticks indexes array ist + + CALL sticks_countg( tk, ub, lb, st, stw, sts, & + ist(:,1), ist(:,2), ist(:,4), ist(:,3), ist(:,5) ) + +! ... Sorts the sticks according to their length + + ALLOCATE( idx( nst ) ) + + CALL sticks_sort( ist(:,4), ist(:,3), ist(:,5), nst, idx, nproc ) + + ! ... Set as first stick the stick containing the G=0 + ! + ! DO iss = 1, nst + ! IF( ist( idx( iss ), 1 ) == 0 .AND. ist( idx( iss ), 2 ) == 0 ) EXIT + ! END DO + ! itmp = idx( 1 ) + ! idx( 1 ) = idx( iss ) + ! idx( iss ) = itmp + + CALL sticks_dist( tk, ub, lb, idx, ist(:,1), ist(:,2), ist(:,4), ist(:,3), ist(:,5), & + nst, nstp, nstpw, nstps, sstp, sstpw, sstps, st, stw, sts, nproc ) + + ngw = sstpw( mype + 1 ) + ngm = sstp( mype + 1 ) + ngs = sstps( mype + 1 ) + + CALL sticks_pairup( tk, ub, lb, idx, ist(:,1), ist(:,2), ist(:,4), ist(:,3), ist(:,5), & + nst, nstp, nstpw, nstps, sstp, sstpw, sstps, st, stw, sts, nproc ) + + ! ... Allocate and Set fft data layout descriptors + + + CALL fft_dlay_allocate( dfftp, mype, root, nproc, comm, nogrp_ , dfftp%nr1x, dfftp%nr2x ) + CALL fft_dlay_allocate( dffts, mype, root, nproc, comm, nogrp_ , dffts%nr1x, dffts%nr2x ) + + CALL fft_dlay_set( dfftp, tk, nst, dfftp%nr1, dfftp%nr2, dfftp%nr3, dfftp%nr1x, dfftp%nr2x, dfftp%nr3x, & + ub, lb, idx, ist(:,1), ist(:,2), nstp, nstpw, sstp, sstpw, st, stw ) + CALL fft_dlay_set( dffts, tk, nsts, dffts%nr1, dffts%nr2, dffts%nr3, dffts%nr1x, dffts%nr2x, dffts%nr3x, & + ub, lb, idx, ist(:,1), ist(:,2), nstps, nstpw, sstps, sstpw, sts, stw ) + + +! ... Maximum number of sticks (potentials) + nstpx = maxval( nstp ) +! ... Maximum number of sticks (wave func.) + nstpwx = maxval( nstpw ) + + IF( dffts%have_task_groups ) THEN + ! + ! Initialize task groups. + ! Note that this call modify dffts adding task group data. + ! + CALL task_groups_init( dffts ) + ! + END IF + + IF (ionode) THEN + WRITE( stdout,*) + IF ( nproc > 1 ) THEN + WRITE( stdout, '(5X,"Parallelization info")') + ELSE + WRITE( stdout, '(5X,"G-vector sticks info")') + ENDIF + WRITE( stdout, '(5X,"--------------------")') + WRITE( stdout, '(5X,"sticks: dense smooth PW", & + & 5X,"G-vecs: dense smooth PW")') + IF ( nproc > 1 ) THEN + WRITE( stdout,'(5X,"Min",4X,2I8,I7,12X,2I9,I8)') & + minval(nstp), minval(nstps), minval(nstpw), & + minval(sstp), minval(sstps), minval(sstpw) + WRITE( stdout,'(5X,"Max",4X,2I8,I7,12X,2I9,I8)') & + maxval(nstp), maxval(nstps), maxval(nstpw), & + maxval(sstp), maxval(sstps), maxval(sstpw) + END IF + WRITE( stdout,'(5X,"Sum",4X,2I8,I7,12X,2I9,I8)') & + sum(nstp), sum(nstps), sum(nstpw), & + sum(sstp), sum(sstps), sum(sstpw) + ! in the case k=0, the lines above and below differ: + ! above all sticks, below only those in the half sphere + IF ( .NOT. tk ) & + WRITE( stdout,'(5X,"Tot",4X,2I8,I7)') nst, nsts, nstw + ENDIF + + DEALLOCATE( ist ) + DEALLOCATE( idx ) + + DEALLOCATE( st, stw, sts ) + DEALLOCATE( sstp ) + DEALLOCATE( nstp ) + DEALLOCATE( sstpw ) + DEALLOCATE( nstpw ) + DEALLOCATE( sstps ) + DEALLOCATE( nstps ) + + IF(ionode) WRITE( stdout,*) + + RETURN + END SUBROUTINE pstickset + +!---------------------------------------------------------------------- + + SUBROUTINE pstickset_custom( gamma_only, bg, gcut, gkcut, & + dfftp, ngw, ngm, mype, root, nproc, comm, nogrp_ ) + + LOGICAL, INTENT(in) :: gamma_only +! ... bg(:,1), bg(:,2), bg(:,3) reciprocal space base vectors. + REAL(DP), INTENT(in) :: bg(3,3) + REAL(DP), INTENT(in) :: gcut, gkcut + TYPE(fft_dlay_descriptor), INTENT(inout) :: dfftp + INTEGER, INTENT(out) :: ngw, ngm + + INTEGER, INTENT(IN) :: mype, root, nproc, comm + INTEGER, INTENT(IN) :: nogrp_ + + + LOGICAL :: tk + + INTEGER :: ub(3), lb(3) +! ... ub(i), lb(i) upper and lower miller indexes + +! +! ... Plane Waves +! + INTEGER, ALLOCATABLE :: stw(:,:) +! ... stick map (wave functions), stw(i,j) = number of G-vector in the +! ... stick whose x and y miller index are i and j + + INTEGER, ALLOCATABLE :: nstpw(:) +! ... number of sticks (wave functions), nstpw(ip) = number of stick +! ... for processor ip + + INTEGER, ALLOCATABLE :: sstpw(:) +! ... number of G-vectors (wave functions), sstpw(ip) = sum of the +! ... sticks length for processor ip = number of G-vectors +! ... owned by the processor ip + + INTEGER :: nstw, nstpwx +! ... nstw local number of sticks (wave functions) +! ... nstpwx maximum among all processors of nstw + +! +! ... Potentials +! + + INTEGER, ALLOCATABLE :: st(:,:) +! ... stick map (potentials), st(i,j) = number of G-vector in the +! ... stick whose x and y miller index are i and j + + INTEGER, ALLOCATABLE :: nstp(:) +! ... number of sticks (potentials), nstp(ip) = number of stick +! ... for processor ip + + INTEGER, ALLOCATABLE :: sstp(:) +! ... number of G-vectors (potentials), sstp(ip) = sum of the +! ... sticks length for processor ip = number of G-vectors +! ... owned by the processor ip + + INTEGER :: nst, nstpx +! ... nst local number of sticks (potentials) +! ... nstpx maximum among all processors of nst + +! +! ... Smooth Mesh +! + + INTEGER, ALLOCATABLE :: sts(:,:) +! ... stick map (smooth mesh), sts(i,j) = number of G-vector in the +! ... stick whose x and y miller index are i and j + + INTEGER, ALLOCATABLE :: nstps(:) +! ... number of sticks (smooth mesh), nstp(ip) = number of stick +! ... for processor ip + + INTEGER, ALLOCATABLE :: sstps(:) +! ... number of G-vectors (smooth mesh), sstps(ip) = sum of the +! ... sticks length for processor ip = number of G-vectors +! ... owned by the processor ip + + INTEGER :: nsts +! ... nsts local number of sticks (smooth mesh) + + + INTEGER, ALLOCATABLE :: ist(:,:) ! sticks indices ordered + INTEGER :: ip, ngm_ , ngs_ + INTEGER, ALLOCATABLE :: idx(:) + + tk = .not. gamma_only + ub(1) = ( dfftp%nr1 - 1 ) / 2 + ub(2) = ( dfftp%nr2 - 1 ) / 2 + ub(3) = ( dfftp%nr3 - 1 ) / 2 + lb = - ub + + ! ... Allocate maps + + ALLOCATE( stw ( lb(1):ub(1), lb(2):ub(2) ) ) + ALLOCATE( st ( lb(1):ub(1), lb(2):ub(2) ) ) + ALLOCATE( sts ( lb(1):ub(1), lb(2):ub(2) ) ) + + st = 0 + stw = 0 + sts = 0 + +! ... Fill in the stick maps, for given g-space base and cut-off + + CALL sticks_maps( tk, ub, lb, bg(:,1), bg(:,2), bg(:,3), & + gcut, gkcut, gcut, st, stw, sts, mype, & + nproc, comm ) + +! ... Now count the number of stick nst and nstw + + nst = count( st > 0 ) + nstw = count( stw > 0 ) + nsts = count( sts > 0 ) + + ALLOCATE(ist(nst,5)) + + ALLOCATE(nstp(nproc)) + ALLOCATE(sstp(nproc)) + + ALLOCATE(nstpw(nproc)) + ALLOCATE(sstpw(nproc)) + + ALLOCATE(nstps(nproc)) + ALLOCATE(sstps(nproc)) + +! ... initialize the sticks indexes array ist + + CALL sticks_countg( tk, ub, lb, st, stw, sts, & + ist(:,1), ist(:,2), ist(:,4), ist(:,3), ist(:,5) ) + +! ... Sorts the sticks according to their length + + ALLOCATE( idx( nst ) ) + + CALL sticks_sort( ist(:,4), ist(:,3), ist(:,5), nst, idx, nproc ) + + ! ... Set as first stick the stick containing the G=0 + ! + ! DO iss = 1, nst + ! IF( ist( idx( iss ), 1 ) == 0 .AND. ist( idx( iss ), 2 ) == 0 ) EXIT + ! END DO + ! itmp = idx( 1 ) + ! idx( 1 ) = idx( iss ) + ! idx( iss ) = itmp + + CALL sticks_dist( tk, ub, lb, idx, ist(:,1), ist(:,2), ist(:,4), ist(:,3), ist(:,5), & + nst, nstp, nstpw, nstps, sstp, sstpw, sstps, st, stw, sts, nproc ) + + ngw = sstpw( mype + 1 ) + ngm = sstp( mype + 1 ) +! ngs = sstps( mype + 1 ) + + CALL sticks_pairup( tk, ub, lb, idx, ist(:,1), ist(:,2), ist(:,4), ist(:,3), ist(:,5), & + nst, nstp, nstpw, nstps, sstp, sstpw, sstps, st, stw, sts, nproc ) + + ! ... Allocate and Set fft data layout descriptors + + + CALL fft_dlay_allocate( dfftp, mype, root, nproc, comm, nogrp_ , dfftp%nr1x, dfftp%nr2x ) +! CALL fft_dlay_allocate( dffts, mype, root, nproc, comm, nogrp_ , dffts%nr1x, dffts%nr2x ) + + CALL fft_dlay_set( dfftp, tk, nst, dfftp%nr1, dfftp%nr2, dfftp%nr3, dfftp%nr1x, dfftp%nr2x, dfftp%nr3x, & + ub, lb, idx, ist(:,1), ist(:,2), nstp, nstpw, sstp, sstpw, st, stw ) +! CALL fft_dlay_set( dffts, tk, nsts, dffts%nr1, dffts%nr2, dffts%nr3, dffts%nr1x, dffts%nr2x, dffts%nr3x, & +! ub, lb, idx, ist(:,1), ist(:,2), nstps, nstpw, sstps, sstpw, sts, stw ) + + +! ... Maximum number of sticks (potentials) + nstpx = maxval( nstp ) +! ... Maximum number of sticks (wave func.) + nstpwx = maxval( nstpw ) + +! IF( dffts%have_task_groups ) THEN + ! + ! Initialize task groups. + ! Note that this call modify dffts adding task group data. + ! +! CALL task_groups_init( dffts ) + ! +! END IF + +!!$ IF (ionode) THEN +!!$ WRITE( stdout,*) +!!$ IF ( nproc > 1 ) THEN +!!$ WRITE( stdout, '(5X,"Parallelization info")') +!!$ ELSE +!!$ WRITE( stdout, '(5X,"G-vector sticks info")') +!!$ ENDIF +!!$ WRITE( stdout, '(5X,"--------------------")') +!!$ WRITE( stdout, '(5X,"sticks: dense smooth PW", & +!!$ & 5X,"G-vecs: dense smooth PW")') +!!$ IF ( nproc > 1 ) THEN +!!$ WRITE( stdout,'(5X,"Min",4X,2I8,I7,12X,2I9,I8)') & +!!$ minval(nstp), minval(nstps), minval(nstpw), & +!!$ minval(sstp), minval(sstps), minval(sstpw) +!!$ WRITE( stdout,'(5X,"Max",4X,2I8,I7,12X,2I9,I8)') & +!!$ maxval(nstp), maxval(nstps), maxval(nstpw), & +!!$ maxval(sstp), maxval(sstps), maxval(sstpw) +!!$ END IF +!!$ WRITE( stdout,'(5X,"Sum",4X,2I8,I7,12X,2I9,I8)') & +!!$ sum(nstp), sum(nstps), sum(nstpw), & +!!$ sum(sstp), sum(sstps), sum(sstpw) +!!$ ! in the case k=0, the lines above and below differ: +!!$ ! above all sticks, below only those in the half sphere +!!$ IF ( .NOT. tk ) & +!!$ WRITE( stdout,'(5X,"Tot",4X,2I8,I7)') nst, nsts, nstw +!!$ ENDIF + + DEALLOCATE( ist ) + DEALLOCATE( idx ) + + DEALLOCATE( st, stw, sts ) + DEALLOCATE( sstp ) + DEALLOCATE( nstp ) + DEALLOCATE( sstpw ) + DEALLOCATE( nstpw ) + DEALLOCATE( sstps ) + DEALLOCATE( nstps ) + + IF(ionode) WRITE( stdout,*) + + RETURN + END SUBROUTINE pstickset_custom + +!----------------------------------------- +! Task groups Contributed by C. Bekas, October 2005 +! Revised by C. Cavazzoni +!-------------------------------------------- + +SUBROUTINE task_groups_init( dffts ) + + USE parallel_include + ! + USE io_global, ONLY : stdout + USE fft_types, ONLY : fft_dlay_descriptor + + ! T.G. + ! NPGRP: Number of processors per group + ! NOGRP: Number of processors per orbital task group + + IMPLICIT NONE + + TYPE(fft_dlay_descriptor), INTENT(inout) :: dffts + + !---------------------------------- + !Local Variables declaration + !---------------------------------- + + INTEGER :: I + INTEGER :: IERR + INTEGER :: num_planes, num_sticks + INTEGER :: nnrsx_vec ( dffts%nproc ) + INTEGER :: pgroup( dffts%nproc ) + INTEGER :: strd + + CALL task_groups_init_first( dffts ) + ! + IF ( dffts%nogrp > 1 ) WRITE( stdout, 100 ) dffts%nogrp, dffts%npgrp + +100 FORMAT( /,3X,'Task Groups are in USE',/,3X,'groups and procs/group : ',I5,I5 ) + + !Find maximum chunk of local data concerning coefficients of eigenfunctions in g-space + + CALL MPI_Allgather( dffts%nnr, 1, MPI_INTEGER, nnrsx_vec, 1, MPI_INTEGER, dffts%comm, IERR) + strd = maxval( nnrsx_vec( 1:dffts%nproc ) ) + + IF( strd /= dffts%tg_nnr ) CALL errore( ' task_groups_init ', ' inconsistent nnr ', 1 ) + + !------------------------------------------------------------------------------------- + !C. Bekas...TASK GROUP RELATED. FFT DATA STRUCTURES ARE ALREADY DEFINED ABOVE + !------------------------------------------------------------------------------------- + !dfft%nsw(me) holds the number of z-sticks for the current processor per wave-function + !We can either send these in the group with an mpi_allgather...or put the + !in the PSIS vector (in special positions) and send them with them. + !Otherwise we can do this once at the beginning, before the loop. + !we choose to do the latter one. + !------------------------------------------------------------------------------------- + ! + ! + ALLOCATE( dffts%tg_nsw(dffts%nproc)) + ALLOCATE( dffts%tg_npp(dffts%nproc)) + + num_sticks = 0 + num_planes = 0 + DO i = 1, dffts%nogrp + num_sticks = num_sticks + dffts%nsw( dffts%nolist(i) + 1 ) + num_planes = num_planes + dffts%npp( dffts%nolist(i) + 1 ) + ENDDO + + CALL MPI_ALLGATHER(num_sticks, 1, MPI_INTEGER, dffts%tg_nsw(1), 1, MPI_INTEGER, dffts%comm, IERR) + CALL MPI_ALLGATHER(num_planes, 1, MPI_INTEGER, dffts%tg_npp(1), 1, MPI_INTEGER, dffts%comm, IERR) + + ALLOCATE( dffts%tg_snd( dffts%nogrp ) ) + ALLOCATE( dffts%tg_rcv( dffts%nogrp ) ) + ALLOCATE( dffts%tg_psdsp( dffts%nogrp ) ) + ALLOCATE( dffts%tg_usdsp( dffts%nogrp ) ) + ALLOCATE( dffts%tg_rdsp( dffts%nogrp ) ) + + dffts%tg_snd(1) = dffts%nr3x * dffts%nsw( dffts%mype + 1 ) + IF( dffts%nr3x * dffts%nsw( dffts%mype + 1 ) > dffts%tg_nnr ) THEN + CALL errore( ' task_groups_init ', ' inconsistent dffts%tg_nnr ', 1 ) + ENDIF + dffts%tg_psdsp(1) = 0 + dffts%tg_usdsp(1) = 0 + dffts%tg_rcv(1) = dffts%nr3x * dffts%nsw( dffts%nolist(1) + 1 ) + dffts%tg_rdsp(1) = 0 + DO i = 2, dffts%nogrp + dffts%tg_snd(i) = dffts%nr3x * dffts%nsw( dffts%mype + 1 ) + dffts%tg_psdsp(i) = dffts%tg_psdsp(i-1) + dffts%tg_nnr + dffts%tg_usdsp(i) = dffts%tg_usdsp(i-1) + dffts%tg_snd(i-1) + dffts%tg_rcv(i) = dffts%nr3x * dffts%nsw( dffts%nolist(i) + 1 ) + dffts%tg_rdsp(i) = dffts%tg_rdsp(i-1) + dffts%tg_rcv(i-1) + ENDDO + + RETURN + +END SUBROUTINE task_groups_init + + + ! +SUBROUTINE task_groups_init_first( dffts ) + + USE parallel_include + ! + USE fft_types, ONLY : fft_dlay_descriptor + ! + IMPLICIT NONE + ! + TYPE(fft_dlay_descriptor), INTENT(inout) :: dffts + ! + INTEGER :: i, n1, ipos, color, key, ierr, itsk, ntsk + INTEGER :: pgroup( dffts%nproc ) + ! + !SUBDIVIDE THE PROCESSORS IN GROUPS + ! + DO i = 1, dffts%nproc + pgroup( i ) = i - 1 + ENDDO + ! + !LIST OF PROCESSORS IN MY ORBITAL GROUP + ! + ! processors in these group have contiguous indexes + ! + n1 = ( dffts%mype / dffts%nogrp ) * dffts%nogrp - 1 + DO i = 1, dffts%nogrp + dffts%nolist( i ) = pgroup( n1 + i + 1 ) + IF( dffts%mype == dffts%nolist( i ) ) ipos = i - 1 + ENDDO + ! + !LIST OF PROCESSORS IN MY PLANE WAVE GROUP + ! + DO I = 1, dffts%npgrp + dffts%nplist( i ) = pgroup( ipos + ( i - 1 ) * dffts%nogrp + 1 ) + ENDDO + ! + !SET UP THE GROUPS + ! + ! + !CREATE ORBITAL GROUPS + ! + color = dffts%mype / dffts%nogrp + key = MOD( dffts%mype , dffts%nogrp ) + CALL MPI_COMM_SPLIT( dffts%comm, color, key, dffts%ogrp_comm, ierr ) + if( ierr /= 0 ) & + CALL errore( ' init_task_groups ', ' creating ogrp_comm ', ABS(ierr) ) + CALL MPI_COMM_RANK( dffts%ogrp_comm, itsk, IERR ) + CALL MPI_COMM_SIZE( dffts%ogrp_comm, ntsk, IERR ) + IF( dffts%nogrp /= ntsk ) CALL errore( ' init_task_groups ', ' ogrp_comm size ', ntsk ) + DO i = 1, dffts%nogrp + IF( dffts%mype == dffts%nolist( i ) ) THEN + IF( (i-1) /= itsk ) CALL errore( ' init_task_groups ', ' ogrp_comm rank ', itsk ) + END IF + END DO + ! + !CREATE PLANEWAVE GROUPS + ! + color = MOD( dffts%mype , dffts%nogrp ) + key = dffts%mype / dffts%nogrp + CALL MPI_COMM_SPLIT( dffts%comm, color, key, dffts%pgrp_comm, ierr ) + if( ierr /= 0 ) & + CALL errore( ' init_task_groups ', ' creating pgrp_comm ', ABS(ierr) ) + CALL MPI_COMM_RANK( dffts%pgrp_comm, itsk, IERR ) + CALL MPI_COMM_SIZE( dffts%pgrp_comm, ntsk, IERR ) + IF( dffts%npgrp /= ntsk ) CALL errore( ' init_task_groups ', ' pgrp_comm size ', ntsk ) + DO i = 1, dffts%npgrp + IF( dffts%mype == dffts%nplist( i ) ) THEN + IF( (i-1) /= itsk ) CALL errore( ' init_task_groups ', ' pgrp_comm rank ', itsk ) + END IF + END DO + dffts%me_pgrp = itsk + + RETURN + END SUBROUTINE task_groups_init_first + ! +!=----------------------------------------------------------------------= + END MODULE stick_set +!=----------------------------------------------------------------------= diff --git a/tests/apps/miniDFT/tests/src/stop_run.f90 b/tests/apps/miniDFT/tests/src/stop_run.f90 new file mode 100644 index 0000000000..d835a34dbc --- /dev/null +++ b/tests/apps/miniDFT/tests/src/stop_run.f90 @@ -0,0 +1,89 @@ +! +! Copyright (C) 2001-2009 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +!---------------------------------------------------------------------------- +SUBROUTINE stop_run( lflag ) + !---------------------------------------------------------------------------- + ! + ! ... Close all files and synchronize processes before stopping. + ! ... Called at the end of the run with flag = .TRUE. (removes 'restart') + ! ... or during execution with flag = .FALSE. (does not remove 'restart') + ! + USE io_global, ONLY : ionode + USE mp_global, ONLY : mp_global_end + USE environment, ONLY : environment_end + USE io_files, ONLY : iuntmp, seqopn + USE image_io_routines, ONLY : io_image_stop + ! + IMPLICIT NONE + ! + LOGICAL, INTENT(IN) :: lflag + LOGICAL :: exst, opnd + ! + ! + ! + ! ... iunwfc contains wavefunctions and is kept open during + ! ... the execution - close the file and save it (or delete it + ! ... if the wavefunctions are already stored in the .save file) + ! + IF (lflag ) THEN + CALL seqopn( iuntmp, 'restart', 'UNFORMATTED', exst ) + CLOSE( UNIT = iuntmp, STATUS = 'DELETE' ) + ENDIF + + IF ( lflag .AND. ionode ) THEN + ! + ! ... all other files must be reopened and removed + ! + CALL seqopn( iuntmp, 'update', 'FORMATTED', exst ) + CLOSE( UNIT = iuntmp, STATUS = 'DELETE' ) + ! + CALL seqopn( iuntmp, 'para', 'FORMATTED', exst ) + CLOSE( UNIT = iuntmp, STATUS = 'DELETE' ) + ! + END IF + ! + CALL close_files(lflag) + ! + CALL print_clock_pw() + ! + CALL environment_end( 'MiniDFT' ) + ! + CALL io_image_stop() + ! + CALL mp_global_end () + ! + CALL clean_pw( .TRUE. ) + ! + IF ( lflag ) THEN + ! + STOP + ! + ELSE + ! + STOP 1 + ! + END IF + ! +END SUBROUTINE stop_run +! +!---------------------------------------------------------------------------- +SUBROUTINE closefile() + !---------------------------------------------------------------------------- + ! + USE io_global, ONLY : stdout + ! + ! ... Close all files and synchronize processes before stopping + ! ... Called by "sigcatch" when it receives a signal + ! + WRITE( stdout,'(5X,"Signal Received, stopping ... ")') + ! + CALL stop_run( .FALSE. ) + ! + RETURN + ! +END SUBROUTINE closefile diff --git a/tests/apps/miniDFT/tests/src/stres_cc.f90 b/tests/apps/miniDFT/tests/src/stres_cc.f90 new file mode 100644 index 0000000000..86bd34c430 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/stres_cc.f90 @@ -0,0 +1,101 @@ +! +! Copyright (C) 2001-2007 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +!----------------------------------------------------------------------- +subroutine stres_cc (sigmaxcc) + !----------------------------------------------------------------------- + ! + USE kinds, ONLY : DP + USE atom, ONLY : rgrid + USE uspp_param, ONLY : upf + USE ions_base, ONLY : ntyp => nsp + USE cell_base, ONLY : alat, omega, tpiba, tpiba2 + USE fft_base, ONLY : dfftp + USE fft_interfaces, ONLY : fwfft + USE gvect, ONLY : ngm, gstart, nl, g, gg, ngl, gl,igtongl + USE ener, ONLY : etxc, vtxc + USE lsda_mod, ONLY : nspin + USE scf, ONLY : rho, rho_core, rhog_core + USE vlocal, ONLY : strf + USE wavefunctions_module, ONLY : psic + USE mp_global, ONLY : intra_bgrp_comm + USE mp, ONLY : mp_sum + ! + implicit none + ! output + real(DP) :: sigmaxcc (3, 3) + ! local variables + + integer :: nt, ng, l, m, ir + ! counters + real(DP) :: fact, sigmadiag + real(DP) , allocatable:: rhocg (:), vxc (:,:) + + sigmaxcc(:,:) = 0.d0 + if ( ANY (upf(1:ntyp)%nlcc) ) goto 15 + + return + +15 continue + ! + ! recalculate the exchange-correlation potential + ! + allocate ( vxc(dfftp%nnr,nspin) ) + call v_xc (rho, rho_core, rhog_core, etxc, vtxc, vxc) + if (nspin.eq.1.or.nspin.eq.4) then + do ir = 1, dfftp%nnr + psic (ir) = vxc (ir, 1) + enddo + else + do ir = 1, dfftp%nnr + psic (ir) = 0.5d0 * (vxc (ir, 1) + vxc (ir, 2) ) + enddo + endif + deallocate (vxc) + CALL fwfft ('Dense', psic, dfftp) + ! + ! psic contains now Vxc(G) + ! + allocate(rhocg(ngl)) + sigmadiag = 0.0d0 + fact = 1.d0 + do nt = 1, ntyp + if ( upf(nt)%nlcc ) then + call drhoc (ngl, gl, omega, tpiba2, rgrid(nt)%mesh, rgrid(nt)%r, & + rgrid(nt)%rab, upf(nt)%rho_atc, rhocg) + ! diagonal term + if (gstart==2) sigmadiag = sigmadiag + & + CONJG(psic (nl(1) ) ) * strf (1,nt) * rhocg (igtongl (1) ) + do ng = gstart, ngm + sigmadiag = sigmadiag + CONJG(psic (nl (ng) ) ) * & + strf (ng,nt) * rhocg (igtongl (ng) ) * fact + enddo + + call deriv_drhoc (ngl, gl, omega, tpiba2, rgrid(nt)%mesh, & + rgrid(nt)%r, rgrid(nt)%rab, upf(nt)%rho_atc, rhocg) + ! non diagonal term (g=0 contribution missing) + do ng = gstart, ngm + do l = 1, 3 + do m = 1, 3 + sigmaxcc (l, m) = sigmaxcc (l, m) + CONJG(psic (nl (ng) ) ) & + * strf (ng, nt) * rhocg (igtongl (ng) ) * tpiba * & + g (l, ng) * g (m, ng) / sqrt (gg (ng) ) * fact + enddo + enddo + enddo + endif + enddo + + do l = 1, 3 + sigmaxcc (l, l) = sigmaxcc (l, l) + sigmadiag + enddo + call mp_sum( sigmaxcc, intra_bgrp_comm ) + deallocate (rhocg) + return +end subroutine stres_cc + diff --git a/tests/apps/miniDFT/tests/src/stres_ewa.f90 b/tests/apps/miniDFT/tests/src/stres_ewa.f90 new file mode 100644 index 0000000000..97dda23e72 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/stres_ewa.f90 @@ -0,0 +1,178 @@ +! +! Copyright (C) 2001-2009 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +!----------------------------------------------------------------------- +subroutine stres_ewa (alat, nat, ntyp, ityp, zv, at, bg, tau, & + omega, g, gg, ngm, gstart, gamma_only, gcutm, sigmaewa) + !----------------------------------------------------------------------- + ! + ! Ewald contribution, both real- and reciprocal-space terms are present + ! + USE kinds + USE constants, only : tpi, e2, eps6 + USE mp_global, ONLY : intra_pool_comm, intra_bgrp_comm + USE mp, ONLY : mp_sum + + implicit none + ! + ! first the dummy variables + ! + + integer :: nat, ntyp, ityp (nat), ngm, gstart + ! input: number of atoms in the unit cell + ! input: number of different types of atoms + ! input: the type of each atom + ! input: number of plane waves for G sum + ! input: first nonzero g vector + + logical :: gamma_only + + real(DP) :: tau (3, nat), g (3, ngm), gg (ngm), zv (ntyp), & + at (3, 3), bg (3, 3), omega, alat, gcutm, sigmaewa (3, 3) + ! input: the positions of the atoms in the cell + ! input: the coordinates of G vectors + ! input: the square moduli of G vectors + ! input: the charge of each type of atoms + ! input: the direct lattice vectors + ! input: the reciprocal lattice vectors + ! input: the volume of the unit cell + ! input: measure of length + ! input: cut-off of g vectors + ! output: the ewald stress + ! + ! here the local variables + ! + integer, parameter :: mxr = 50 + ! the maximum number of R vectors included in r sum + integer :: ng, nr, na, nb, l, m, nrm + ! counter over reciprocal G vectors + ! counter over direct vectors + ! counter on atoms + ! counter on atoms + ! counter on atoms + ! number of R vectors included in r sum + + real(DP) :: charge, arg, tpiba2, dtau (3), alpha, r (3, mxr), & + r2 (mxr), rmax, rr, upperbound, fact, fac, g2, g2a, sdewald, sewald + ! total ionic charge in the cell + ! the argument of the phase + ! length in reciprocal space + ! the difference tau_s - tau_s' + ! alpha term in ewald sum + ! input of the rgen routine ( not used here ) + ! the square modulus of R_j-tau_s-tau_s' + ! the maximum radius to consider real space sum + ! buffer variable + ! used to optimize alpha + ! auxiliary variables + ! diagonal term + ! nondiagonal term + complex(DP) :: rhostar + real(DP), external :: qe_erfc + ! the erfc function + ! + tpiba2 = (tpi / alat) **2 + sigmaewa(:,:) = 0.d0 + charge = 0.d0 + do na = 1, nat + charge = charge+zv (ityp (na) ) + enddo + ! + ! choose alpha in order to have convergence in the sum over G + ! upperbound is a safe upper bound for the error ON THE ENERGY + ! + alpha = 2.9d0 +12 alpha = alpha - 0.1d0 + if (alpha.eq.0.0) call errore ('stres_ew', 'optimal alpha not found & + &', 1) + upperbound = e2 * charge**2 * sqrt (2 * alpha / tpi) * & + qe_erfc ( sqrt (tpiba2 * gcutm / 4.0d0 / alpha) ) + if (upperbound.gt.1d-7) goto 12 + ! + ! G-space sum here + ! + ! Determine if this processor contains G=0 and set the constant term + ! + if (gstart == 2) then + sdewald = tpi * e2 / 4.d0 / alpha * (charge / omega) **2 + else + sdewald = 0.d0 + endif + ! sdewald is the diagonal term + if (gamma_only) then + fact = 2.d0 + else + fact = 1.d0 + end if + do ng = gstart, ngm + g2 = gg (ng) * tpiba2 + g2a = g2 / 4.d0 / alpha + rhostar = (0.d0, 0.d0) + do na = 1, nat + arg = (g (1, ng) * tau (1, na) + g (2, ng) * tau (2, na) + & + g (3, ng) * tau (3, na) ) * tpi + rhostar = rhostar + zv (ityp (na) ) * CMPLX(cos (arg), sin (arg),kind=DP) + enddo + rhostar = rhostar / omega + sewald = fact * tpi * e2 * exp ( - g2a) / g2 * abs (rhostar) **2 + sdewald = sdewald-sewald + do l = 1, 3 + do m = 1, l + sigmaewa (l, m) = sigmaewa (l, m) + sewald * tpiba2 * 2.d0 * & + g (l, ng) * g (m, ng) / g2 * (g2a + 1) + enddo + enddo + enddo + do l = 1, 3 + sigmaewa (l, l) = sigmaewa (l, l) + sdewald + enddo + ! + ! R-space sum here (only for the processor that contains G=0) + ! + if (gstart.eq.2) then + rmax = 4.0d0 / sqrt (alpha) / alat + ! + ! with this choice terms up to ZiZj*erfc(5) are counted (erfc(5)=2x10^-1 + ! + do na = 1, nat + do nb = 1, nat + dtau (:) = tau (:, na) - tau (:, nb) + ! + ! generates nearest-neighbors shells r(i)=R(i)-dtau(i) + ! + call rgen (dtau, rmax, mxr, at, bg, r, r2, nrm) + do nr = 1, nrm + rr = sqrt (r2 (nr) ) * alat + fac = - e2 / 2.0d0 / omega * alat**2 * zv (ityp (na) ) * & + zv ( ityp (nb) ) / rr**3 * (qe_erfc (sqrt (alpha) * rr) + & + rr * sqrt (8 * alpha / tpi) * exp ( - alpha * rr**2) ) + do l = 1, 3 + do m = 1, l + sigmaewa (l, m) = sigmaewa (l, m) + fac * r(l,nr) * r(m,nr) + enddo + enddo + enddo + enddo + enddo + endif + ! + do l = 1, 3 + do m = 1, l - 1 + sigmaewa (m, l) = sigmaewa (l, m) + enddo + + enddo + do l = 1, 3 + do m = 1, 3 + sigmaewa (l, m) = - sigmaewa (l, m) + enddo + enddo + call mp_sum( sigmaewa, intra_bgrp_comm ) + return +end subroutine stres_ewa + diff --git a/tests/apps/miniDFT/tests/src/stres_gradcorr.f90 b/tests/apps/miniDFT/tests/src/stres_gradcorr.f90 new file mode 100644 index 0000000000..1f8bf97b6e --- /dev/null +++ b/tests/apps/miniDFT/tests/src/stres_gradcorr.f90 @@ -0,0 +1,164 @@ +! +! Copyright (C) 2001-2006 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +!---------------------------------------------------------------------------- +subroutine stres_gradcorr( rho, rhog, rho_core, rhog_core, nspin, & + nr1, nr2, nr3, nrxx, nl, & + ngm, g, alat, omega, sigmaxc ) + !---------------------------------------------------------------------------- + ! + USE kinds, ONLY : DP + use funct, ONLY : gcxc, gcx_spin, gcc_spin, & !!$gcc_spin_more, & + dft_is_gradient, get_igcc + USE mp_global, ONLY : intra_pool_comm, intra_bgrp_comm + USE mp, ONLY : mp_sum + ! + IMPLICIT NONE + ! + integer :: nspin, nr1, nr2, nr3, nrxx, ngm, nl (ngm) + real(DP) :: rho (nrxx, nspin), rho_core (nrxx), g (3, ngm), & + alat, omega, sigmaxc (3, 3) + complex(DP) :: rhog(ngm, nspin), rhog_core(ngm) + integer :: k, l, m, ipol, is, nspin0 + real(DP) , allocatable :: grho (:,:,:) + real(DP), parameter :: epsr = 1.0d-6, epsg = 1.0d-10, e2 = 2.d0 + real(DP) :: grh2, grho2 (2), sx, sc, v1x, v2x, v1c, v2c, fac, & + v1xup, v1xdw, v2xup, v2xdw, v1cup, v1cdw, v2cup, v2cdw, v2cud, & + zeta, rh, rup, rdw, grhoup, grhodw, grhoud, grup, grdw, & + sigma_gradcorr (3, 3), rhok + logical :: igcc_is_lyp + + if ( .not. dft_is_gradient() ) return + + igcc_is_lyp = (get_igcc() == 3) + + sigma_gradcorr(:,:) = 0.d0 + + allocate (grho( 3, nrxx, nspin)) + nspin0=nspin + if (nspin==4) nspin0=1 + fac = 1.d0 / DBLE (nspin0) + ! + ! calculate the gradient of rho+rhocore in real space + ! + DO is = 1, nspin0 + ! + rho(:,is) = fac * rho_core(:) + rho(:,is) + rhog(:,is) = fac * rhog_core(:) + rhog(:,is) + ! + CALL gradrho( nrxx, rhog(1,is), ngm, g, nl, grho(1,1,is) ) + ! + END DO + ! + if (nspin.eq.1) then + ! + ! This is the LDA case + ! + ! sigma_gradcor_{alpha,beta} == + ! omega^-1 \int (grad_alpha rho) ( D(rho*Exc)/D(grad_alpha rho) ) d3 + ! + do k = 1, nrxx + grho2 (1) = grho(1,k,1)**2 + grho(2,k,1)**2 + grho(3,k,1)**2 + if (abs (rho (k, 1) ) .gt.epsr.and.grho2 (1) .gt.epsg) then + call gcxc (rho (k, 1), grho2(1), sx, sc, v1x, v2x, v1c, v2c) + do l = 1, 3 + do m = 1, l + sigma_gradcorr (l, m) = sigma_gradcorr (l, m) + & + grho(l,k,1) * grho(m,k,1) * e2 * (v2x + v2c) + enddo + enddo + endif + + enddo + else + ! + ! This is the LSDA case + ! + do k = 1, nrxx + grho2 (1) = grho(1,k,1)**2 + grho(2,k,1)**2 + grho(3,k,1)**2 + grho2 (2) = grho(1,k,2)**2 + grho(2,k,2)**2 + grho(3,k,2)**2 + + if ( (abs (rho (k, 1) ) .gt.epsr.and.grho2 (1) .gt.epsg) .and. & + (abs (rho (k, 2) ) .gt.epsr.and.grho2 (2) .gt.epsg) ) then + call gcx_spin (rho (k, 1), rho (k, 2), grho2 (1), grho2 (2), & + sx, v1xup, v1xdw, v2xup, v2xdw) + rh = rho (k, 1) + rho (k, 2) + if (rh.gt.epsr) then + if ( igcc_is_lyp ) then + call errore('stres_gradcor','lyp type functionals not available in mini_DFT',1) +!!$ rup = rho (k, 1) +!!$ rdw = rho (k, 2) +!!$ grhoup = grho(1,k,1)**2 + grho(2,k,1)**2 + grho(3,k,1)**2 +!!$ grhodw = grho(1,k,2)**2 + grho(2,k,2)**2 + grho(3,k,2)**2 +!!$ grhoud = grho(1,k,1) * grho(1,k,2) + & +!!$ grho(2,k,1) * grho(2,k,2) + & +!!$ grho(3,k,1) * grho(3,k,2) +!!$ call gcc_spin_more(rup, rdw, grhoup, grhodw, grhoud, sc, & +!!$ v1cup, v1cdw, v2cup, v2cdw, v2cud) + else + zeta = (rho (k, 1) - rho (k, 2) ) / rh + + grh2 = (grho (1, k, 1) + grho (1, k, 2) ) **2 + & + (grho (2, k, 1) + grho (2, k, 2) ) **2 + & + (grho (3, k, 1) + grho (3, k, 2) ) **2 + call gcc_spin (rh, zeta, grh2, sc, v1cup, v1cdw, v2c) + v2cup = v2c + v2cdw = v2c + v2cud = v2c + end if + else + sc = 0.d0 + v1cup = 0.d0 + v1cdw = 0.d0 + v2c = 0.d0 + v2cup = 0.d0 + v2cdw = 0.d0 + v2cud = 0.d0 + endif + do l = 1, 3 + do m = 1, l + ! exchange + sigma_gradcorr (l, m) = sigma_gradcorr (l, m) + & + grho (l, k, 1) * grho (m, k, 1) * e2 * v2xup + & + grho (l, k, 2) * grho (m, k, 2) * e2 * v2xdw + ! correlation + sigma_gradcorr (l, m) = sigma_gradcorr (l, m) + & + ( grho (l, k, 1) * grho (m, k, 1) * v2cup + & + grho (l, k, 2) * grho (m, k, 2) * v2cdw + & + (grho (l, k, 1) * grho (m, k, 2) + & + grho (l, k, 2) * grho (m, k, 1) ) * v2cud ) * e2 + enddo + enddo + endif + enddo + + endif + do l = 1, 3 + do m = 1, l - 1 + sigma_gradcorr (m, l) = sigma_gradcorr (l, m) + enddo + + enddo + call mp_sum( sigma_gradcorr, intra_bgrp_comm ) + + call dscal (9, 1.d0 / (nr1 * nr2 * nr3), sigma_gradcorr, 1) + + call daxpy (9, 1.d0, sigma_gradcorr, 1, sigmaxc, 1) + + DO is = 1, nspin0 + ! + rho(:,is) = rho(:,is) - fac * rho_core(:) + rhog(:,is) = rhog(:,is) - fac * rhog_core(:) + ! + END DO + ! + deallocate(grho) + return + +end subroutine stres_gradcorr + diff --git a/tests/apps/miniDFT/tests/src/stres_har.f90 b/tests/apps/miniDFT/tests/src/stres_har.f90 new file mode 100644 index 0000000000..309197d241 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/stres_har.f90 @@ -0,0 +1,70 @@ +! +! Copyright (C) 2001-2007 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +!---------------------------------------------------------------------- +subroutine stres_har (sigmahar) + !---------------------------------------------------------------------- + ! + USE kinds, ONLY : DP + USE constants, ONLY : e2, fpi + USE cell_base, ONLY: omega, tpiba2 + USE ener, ONLY: ehart + USE fft_base, ONLY : dfftp + USE fft_interfaces,ONLY : fwfft + USE gvect, ONLY: ngm, gstart, nl, g, gg + USE lsda_mod, ONLY: nspin + USE scf, ONLY: rho + USE wavefunctions_module, ONLY : psic + USE mp_global, ONLY: intra_pool_comm, intra_bgrp_comm + USE mp, ONLY: mp_sum + + implicit none + ! + real(DP) :: sigmahar (3, 3), shart, g2 + real(DP), parameter :: eps = 1.d-8 + integer :: is, ig, l, m, nspin0 + + sigmahar(:,:) = 0.d0 + psic (:) = (0.d0, 0.d0) + nspin0=nspin + if (nspin==4) nspin0=1 + do is = 1, nspin0 + call daxpy (dfftp%nnr, 1.d0, rho%of_r (1, is), 1, psic, 2) + enddo + + CALL fwfft ('Dense', psic, dfftp) + ! psic contains now the charge density in G space + ! the G=0 component is not computed + do ig = gstart, ngm + g2 = gg (ig) * tpiba2 + shart = psic (nl (ig) ) * CONJG(psic (nl (ig) ) ) / g2 + do l = 1, 3 + do m = 1, l + sigmahar (l, m) = sigmahar (l, m) + shart * tpiba2 * 2 * & + g (l, ig) * g (m, ig) / g2 + enddo + enddo + enddo + ! + call mp_sum( sigmahar, intra_bgrp_comm ) + ! + sigmahar(:,:) = 0.5d0 * fpi * e2 * sigmahar(:,:) + do l = 1, 3 + sigmahar (l, l) = sigmahar (l, l) - ehart / omega + enddo + do l = 1, 3 + do m = 1, l - 1 + sigmahar (m, l) = sigmahar (l, m) + enddo + enddo + + sigmahar(:,:) = -sigmahar(:,:) + + return +end subroutine stres_har + diff --git a/tests/apps/miniDFT/tests/src/stres_knl.f90 b/tests/apps/miniDFT/tests/src/stres_knl.f90 new file mode 100644 index 0000000000..34af2be35f --- /dev/null +++ b/tests/apps/miniDFT/tests/src/stres_knl.f90 @@ -0,0 +1,103 @@ +! +! Copyright (C) 2001-2007 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +!----------------------------------------------------------------------- +subroutine stres_knl (sigmanlc, sigmakin) + !----------------------------------------------------------------------- + ! + USE kinds, ONLY: DP + USE constants, ONLY: pi, e2 + USE cell_base, ONLY: omega, alat, at, bg, tpiba + USE gvect, ONLY: g + USE klist, ONLY: nks, xk, ngk + USE io_files, ONLY: iunwfc, nwordwfc, iunigk + USE buffers, ONLY: get_buffer + USE symme, ONLY: symmatrix + USE wvfct, ONLY: npw, npwx, nbnd, igk, wg, qcutz, ecfixed, q2sigma + USE wavefunctions_module, ONLY: evc + USE mp_global, ONLY: inter_pool_comm, intra_pool_comm, intra_bgrp_comm + USE mp, ONLY: mp_sum + implicit none + real(DP) :: sigmanlc (3, 3), sigmakin (3, 3) + real(DP), allocatable :: gk (:,:), kfac (:) + real(DP) :: twobysqrtpi, gk2, arg + integer :: ik, l, m, i, ibnd, is + + allocate (gk( 3, npwx)) + allocate (kfac( npwx)) + + sigmanlc(:,:) =0.d0 + sigmakin(:,:) =0.d0 + twobysqrtpi = 2.d0 / sqrt (pi) + + kfac(:) = 1.d0 + + !if (nks.gt.1) rewind (iunigk) !BMA: eliminate unused fs activty for miniApp + do ik = 1, nks + npw = ngk(ik) + !if (nks > 1) then + ! read (iunigk) igk + ! call get_buffer (evc, nwordwfc, iunwfc, ik) + !endif + do i = 1, npw + gk (1, i) = (xk (1, ik) + g (1, igk (i) ) ) * tpiba + gk (2, i) = (xk (2, ik) + g (2, igk (i) ) ) * tpiba + gk (3, i) = (xk (3, ik) + g (3, igk (i) ) ) * tpiba + if (qcutz.gt.0.d0) then + gk2 = gk (1, i) **2 + gk (2, i) **2 + gk (3, i) **2 + arg = ( (gk2 - ecfixed) / q2sigma) **2 + kfac (i) = 1.d0 + qcutz / q2sigma * twobysqrtpi * exp ( - arg) + endif + enddo + ! + ! kinetic contribution + ! + do l = 1, 3 + do m = 1, l + do ibnd = 1, nbnd + do i = 1, npw + sigmakin (l, m) = sigmakin (l, m) + wg (ibnd, ik) * & + gk (l, i) * gk (m, i) * kfac (i) * & + DBLE (CONJG(evc (i, ibnd) ) * evc (i, ibnd) ) + enddo + enddo + enddo + + enddo + ! + ! contribution from the nonlocal part + ! + call stres_us (ik, gk, sigmanlc) + + enddo + ! + call mp_sum( sigmakin, intra_bgrp_comm ) + call mp_sum( sigmanlc, intra_bgrp_comm ) + call mp_sum( sigmakin, inter_pool_comm ) + call mp_sum( sigmanlc, inter_pool_comm ) + ! + do l = 1, 3 + do m = 1, l - 1 + sigmanlc (m, l) = sigmanlc (l, m) + sigmakin (m, l) = sigmakin (l, m) + enddo + enddo + ! + sigmakin(:,:) = e2 / omega * sigmakin(:,:) + sigmanlc(:,:) = -1.d0 / omega * sigmanlc(:,:) + ! + ! symmetrize stress + ! + call symmatrix ( sigmakin ) + call symmatrix ( sigmanlc ) + + deallocate(kfac) + deallocate(gk) + return +end subroutine stres_knl + diff --git a/tests/apps/miniDFT/tests/src/stres_loc.f90 b/tests/apps/miniDFT/tests/src/stres_loc.f90 new file mode 100644 index 0000000000..b30950a554 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/stres_loc.f90 @@ -0,0 +1,101 @@ + +! Copyright (C) 2001-2007 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +!---------------------------------------------------------------------- +subroutine stres_loc (sigmaloc) + !---------------------------------------------------------------------- + ! + USE kinds, ONLY : DP + USE atom, ONLY : msh, rgrid + USE ions_base, ONLY : ntyp => nsp + USE cell_base, ONLY : omega, tpiba2 + USE fft_base, ONLY : dfftp + USE fft_interfaces, ONLY : fwfft + USE gvect, ONLY : ngm, gstart, nl, g, ngl, gl, igtongl + USE lsda_mod, ONLY : nspin + USE scf, ONLY : rho + USE vlocal, ONLY : strf, vloc + USE wavefunctions_module, ONLY : psic + USE uspp_param, ONLY : upf + USE mp_global, ONLY : intra_pool_comm, intra_bgrp_comm + USE mp, ONLY : mp_sum + ! + implicit none + ! + integer, parameter :: nspin_lsda = 1 !substitute for noncollin_module + real(DP) :: sigmaloc (3, 3) + real(DP) , allocatable :: dvloc(:) + real(DP) :: evloc, fact + integer :: ng, nt, l, m, is + ! counter on g vectors + ! counter on atomic type + ! counter on angular momentum + ! counter on spin components + + allocate(dvloc(ngl)) + sigmaloc(:,:) = 0.d0 + psic(:)=(0.d0,0.d0) + do is = 1, nspin_lsda + call daxpy (dfftp%nnr, 1.d0, rho%of_r (1, is), 1, psic, 2) + enddo + + CALL fwfft ('Dense', psic, dfftp) + ! psic contains now the charge density in G space + fact = 1.d0 + evloc = 0.0d0 + do nt = 1, ntyp + if (gstart==2) evloc = evloc + & + psic (nl (1) ) * strf (1, nt) * vloc (igtongl (1), nt) + do ng = gstart, ngm + evloc = evloc + DBLE (CONJG(psic (nl (ng) ) ) * strf (ng, nt) ) & + * vloc (igtongl (ng), nt) * fact + enddo + enddo + ! + ! WRITE( 6,*) ' evloc ', evloc, evloc*omega ! DEBUG + ! + do nt = 1, ntyp + IF ( .NOT. ASSOCIATED ( upf(nt)%vloc ) ) THEN + ! + ! special case: pseudopotential is coulomb 1/r potential + ! + call dvloc_coul (upf(nt)%zp, tpiba2, ngl, gl, omega, dvloc) + ! + ELSE + ! + ! normal case: dvloc contains dV_loc(G)/dG + ! + call dvloc_of_g (rgrid(nt)%mesh, msh (nt), rgrid(nt)%rab, rgrid(nt)%r,& + upf(nt)%vloc(1), upf(nt)%zp, tpiba2, ngl, gl, omega, dvloc) + ! + END IF + ! no G=0 contribution + do ng = 1, ngm + do l = 1, 3 + do m = 1, l + sigmaloc(l, m) = sigmaloc(l, m) + DBLE( CONJG( psic(nl(ng) ) ) & + * strf (ng, nt) ) * 2.0d0 * dvloc (igtongl (ng) ) & + * tpiba2 * g (l, ng) * g (m, ng) * fact + enddo + enddo + enddo + enddo + ! + do l = 1, 3 + sigmaloc (l, l) = sigmaloc (l, l) + evloc + do m = 1, l - 1 + sigmaloc (m, l) = sigmaloc (l, m) + enddo + enddo + ! + call mp_sum( sigmaloc, intra_bgrp_comm ) + ! + deallocate(dvloc) + return +end subroutine stres_loc + diff --git a/tests/apps/miniDFT/tests/src/stres_us.f90 b/tests/apps/miniDFT/tests/src/stres_us.f90 new file mode 100644 index 0000000000..e0c907c92c --- /dev/null +++ b/tests/apps/miniDFT/tests/src/stres_us.f90 @@ -0,0 +1,241 @@ +! +! Copyright (C) 2001-2003 PWSCF group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +!---------------------------------------------------------------------------- +SUBROUTINE stres_us( ik, gk, sigmanlc ) + !---------------------------------------------------------------------------- + ! + ! nonlocal (separable pseudopotential) contribution to the stress + ! + USE kinds, ONLY : DP + USE ions_base, ONLY : nat, ntyp => nsp, ityp + USE constants, ONLY : eps8 + USE klist, ONLY : nks, xk + USE lsda_mod, ONLY : current_spin, lsda, isk + USE wvfct, ONLY : npw, npwx, nbnd, igk, wg, et + USE uspp_param, ONLY : upf, lmaxkb, nh, newpseudo, nhm + USE uspp, ONLY : nkb, vkb, qq, deeq, deeq_nc, qq_so + USE wavefunctions_module, ONLY : evc + USE spin_orb, ONLY : lspinorb + USE lsda_mod, ONLY : nspin + USE mp_global, ONLY : me_pool, root_pool, intra_bgrp_comm,inter_bgrp_comm, mpime + USE becmod, ONLY : allocate_bec_type, deallocate_bec_type, & + bec_type, becp, calbec + USE mp, ONLY : mp_sum, mp_get_comm_null, mp_circular_shift_left + ! + IMPLICIT NONE + ! + ! ... First the dummy variables + ! + INTEGER :: ik + REAL(DP) :: sigmanlc(3,3), gk(3,npw) + ! + CALL allocate_bec_type ( nkb, nbnd, becp, intra_bgrp_comm ) + + ! + ! + CALL stres_us_k() + ! + ! + CALL deallocate_bec_type ( becp ) + ! + RETURN + ! + CONTAINS + ! + !----------------------------------------------------------------------- + ! + ! + !---------------------------------------------------------------------- + SUBROUTINE stres_us_k() + !---------------------------------------------------------------------- + ! + ! ... k-points version + ! + IMPLICIT NONE + ! + ! ... local variables + ! + INTEGER :: na, np, ibnd, ipol, jpol, l, i, & + ikb, jkb, ih, jh, ijkb0, is, js, ijs + REAL(DP) :: fac, xyz (3, 3), q, evps, ddot + REAL(DP), ALLOCATABLE :: qm1(:) + COMPLEX(DP), ALLOCATABLE :: work1(:), work2(:), dvkb(:,:) + COMPLEX(DP), ALLOCATABLE :: work2_nc(:,:) + COMPLEX(DP), ALLOCATABLE :: deff_nc(:,:,:,:) + REAL(DP), ALLOCATABLE :: deff(:,:,:) + ! dvkb contains the derivatives of the kb potential + COMPLEX(DP) :: ps, ps_nc(2) + ! xyz are the three unit vectors in the x,y,z directions + DATA xyz / 1.0d0, 0.0d0, 0.0d0, 0.0d0, 1.0d0, 0.0d0, 0.0d0, 0.0d0, 1.0d0 / + ! + ! + IF ( nkb == 0 ) RETURN + ! + IF ( lsda ) current_spin = isk(ik) + IF ( nks > 1 ) CALL init_us_2( npw, igk, xk(1,ik), vkb ) + ! + CALL calbec( npw, vkb, evc, becp ) + ALLOCATE( deff(nhm,nhm,nat) ) + ! + ALLOCATE( work1(npwx), work2(npwx), qm1( npwx ) ) + ! + DO i = 1, npw + q = SQRT( gk(1,i)**2 + gk(2,i)**2 + gk(3,i)**2 ) + IF ( q > eps8 ) THEN + qm1(i) = 1.D0 / q + ELSE + qm1(i) = 0.D0 + END IF + END DO + ! + evps = 0.D0 + ! ... diagonal contribution + ! + IF ( me_pool /= root_pool ) GO TO 100 + ! + ! ... the contribution is calculated only on one processor because + ! ... partial results are later summed over all processors + ! + DO ibnd = 1, nbnd + fac = wg(ibnd,ik) + IF (ABS(fac) < 1.d-9) CYCLE + CALL compute_deff(deff,et(ibnd,ik)) + ijkb0 = 0 + DO np = 1, ntyp + DO na = 1, nat + IF ( ityp(na) == np ) THEN + DO ih = 1, nh(np) + ikb = ijkb0 + ih + evps = evps+fac*deff(ih,ih,na)*ABS(becp%k(ikb,ibnd) )**2 + IF ( newpseudo(np) ) THEN + ! + ! ... only in the US case there is a contribution + ! ... for jh<>ih + ! ... we use here the symmetry in the interchange of + ! ... ih and jh + ! + DO jh = ( ih + 1 ), nh(np) + jkb = ijkb0 + jh + evps = evps + deff(ih,jh,na) * fac * 2.D0 * & + DBLE( CONJG( becp%k(ikb,ibnd) ) * & + becp%k(jkb,ibnd) ) + END DO + END IF + END DO + ijkb0 = ijkb0 + nh(np) + END IF + END DO + END DO + END DO + DO l = 1, 3 + sigmanlc(l,l) = sigmanlc(l,l) - evps + END DO + ! +100 CONTINUE + ! + ! ... non diagonal contribution - derivative of the bessel function + ! + ALLOCATE( dvkb( npwx, nkb ) ) + ! + CALL gen_us_dj( ik, dvkb ) + ! + DO ibnd = 1, nbnd + work2 = (0.D0,0.D0) + CALL compute_deff(deff,et(ibnd,ik)) + ijkb0 = 0 + DO np = 1, ntyp + DO na = 1, nat + IF ( ityp(na) == np ) THEN + DO ih = 1, nh(np) + ikb = ijkb0 + ih + ! + ! ... in the US case there is a contribution + ! ... also for jh<>ih + ! + ps = (0.D0,0.D0) + ps_nc = (0.D0,0.D0) + DO jh = 1, nh(np) + jkb = ijkb0 + jh + ps = ps + becp%k(jkb,ibnd) * deff(ih,jh,na) + END DO + CALL zaxpy( npw, ps, dvkb(1,ikb), 1, work2, 1 ) + END DO + ijkb0 = ijkb0 + nh(np) + END IF + END DO + END DO + DO ipol = 1, 3 + DO jpol = 1, ipol + DO i = 1, npw + work1(i) = evc(i,ibnd)*gk(ipol,i)*gk(jpol,i)*qm1(i) + END DO + sigmanlc(ipol,jpol) = sigmanlc(ipol,jpol) - & + 2.D0 * wg(ibnd,ik) * & + ddot( 2 * npw, work1, 1, work2, 1 ) + END DO + END DO + END DO + ! + ! ... non diagonal contribution - derivative of the spherical harmonics + ! ... (no contribution from l=0) + ! + IF ( lmaxkb == 0 ) GO TO 10 + ! + DO ipol = 1, 3 + CALL gen_us_dy( ik, xyz(1,ipol), dvkb ) + DO ibnd = 1, nbnd + work2 = (0.D0,0.D0) + CALL compute_deff(deff,et(ibnd,ik)) + + ijkb0 = 0 + DO np = 1, ntyp + DO na = 1, nat + IF ( ityp(na) == np ) THEN + DO ih = 1, nh(np) + ikb = ijkb0 + ih + ps = becp%k(ikb,ibnd) * deeq(ih,ih,na,current_spin) + ! + ! ... in the US case there is a contribution + ! ... also for jh<>ih + ! + ps = (0.D0,0.D0) + ps_nc = (0.D0,0.D0) + DO jh = 1, nh(np) + jkb = ijkb0 + jh + ps = ps + becp%k(jkb,ibnd) * deff(ih,jh,na) + END DO + CALL zaxpy( npw, ps, dvkb(1,ikb), 1, work2, 1 ) + END DO + ijkb0 = ijkb0 + nh(np) + END IF + END DO + END DO + DO jpol = 1, ipol + DO i = 1, npw + work1(i) = evc(i,ibnd) * gk(jpol,i) + END DO + sigmanlc(ipol,jpol) = sigmanlc(ipol,jpol) - & + 2.D0 * wg(ibnd,ik) * & + ddot( 2 * npw, work1, 1, work2, 1 ) + END DO + END DO + END DO + ! +10 CONTINUE + ! + DEALLOCATE( work2 ) + DEALLOCATE( deff ) + DEALLOCATE( dvkb ) + DEALLOCATE( work1, qm1 ) + ! + RETURN + ! + END SUBROUTINE stres_us_k + ! +END SUBROUTINE stres_us diff --git a/tests/apps/miniDFT/tests/src/stress.f90 b/tests/apps/miniDFT/tests/src/stress.f90 new file mode 100644 index 0000000000..e0497940c9 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/stress.f90 @@ -0,0 +1,143 @@ +! +! Copyright (C) 2001-2011 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +!---------------------------------------------------------------------- +subroutine stress ( sigma ) + !---------------------------------------------------------------------- + ! + USE io_global, ONLY : stdout + USE kinds, ONLY : DP + USE cell_base, ONLY : omega, alat, at, bg + USE ions_base, ONLY : nat, ntyp => nsp, ityp, tau, zv + USE constants, ONLY : ry_kbar + USE ener, ONLY : etxc, vtxc + USE gvect, ONLY : ngm, gstart, nl, g, gg, gcutm + USE fft_base, ONLY : dfftp + USE lsda_mod, ONLY : nspin + USE scf, ONLY : rho, rho_core, rhog_core + USE control_flags, ONLY : iverbosity !!$, gamma_only !!$, llondon + USE funct, ONLY : dft_is_gradient + USE symme, ONLY : symmatrix + ! + IMPLICIT NONE + ! + REAL(DP), INTENT(OUT) :: sigma(3,3) + ! + real(DP) :: sigmakin (3, 3), sigmaloc (3, 3), sigmahar (3, 3), & + sigmaxc (3, 3), sigmaxcc (3, 3), sigmaewa (3, 3), sigmanlc (3, 3), & + sigmabare (3, 3), sigmael( 3, 3), sigmaion(3, 3), & + sigma_nonloc_dft (3 ,3), sigmaexx(3,3) + integer :: l, m + ! + WRITE( stdout, '(//5x,"entering subroutine stress ..."/)') + + ! + call start_clock ('stress') + ! + ! contribution from local potential + ! + call stres_loc (sigmaloc) + ! + ! hartree contribution + ! + call stres_har (sigmahar) + ! + ! xc contribution (diagonal) + ! + sigmaxc(:,:) = 0.d0 + do l = 1, 3 + sigmaxc (l, l) = - (etxc - vtxc) / omega + enddo + ! + ! xc contribution: add gradient corrections (non diagonal) + ! + call stres_gradcorr ( rho%of_r, rho%of_g, rho_core, rhog_core, nspin, & + dfftp%nr1, dfftp%nr2, dfftp%nr3, dfftp%nnr, nl, ngm, g, alat, omega, sigmaxc) + ! + ! core correction contribution + ! + call stres_cc (sigmaxcc) + ! + ! ewald contribution + ! + call stres_ewa (alat, nat, ntyp, ityp, zv, at, bg, tau, omega, g, & + gg, ngm, gstart, .false., gcutm, sigmaewa) + ! + ! kinetic + nonlocal contribuition + ! + call stres_knl (sigmanlc, sigmakin) + ! + do l = 1, 3 + do m = 1, 3 + sigmabare (l, m) = sigmaloc (l, m) + sigmanlc (l, m) + enddo + enddo + + + ! + ! Electric field contribution + ! + sigmael(:,:)=0.d0 + sigmaion(:,:)=0.d0 + !the following is for calculating the improper stress tensor +! call stress_bp_efield (sigmael ) +! call stress_ion_efield (sigmaion ) + + +!!$ ! +!!$ ! DFT-non_local contribution +!!$ ! +!!$ sigma_nonloc_dft (:,:) = 0.d0 +!!$ +!!$ call stres_nonloc_dft(rho%of_r, rho_core, nspin, sigma_nonloc_dft) + + ! + ! SUM + ! + sigma(:,:) = sigmakin(:,:) + sigmaloc(:,:) + sigmahar(:,:) + & + sigmaxc(:,:) + sigmaxcc(:,:) + sigmaewa(:,:) + & + sigmanlc(:,:) + sigmael(:,:) + & + sigmaion(:,:) !!$ + sigma_nonloc_dft(:,:) + ! Resymmetrize the total stress. This should not be strictly necessary, + ! but prevents loss of symmetry in long vc-bfgs runs + + CALL symmatrix ( sigma ) + ! + ! write results in Ryd/(a.u.)^3 and in kbar + ! + WRITE( stdout, 9000) (sigma(1,1) + sigma(2,2) + sigma(3,3)) * ry_kbar/3d0, & + (sigma(l,1), sigma(l,2), sigma(l,3), & + sigma(l,1)*ry_kbar, sigma(l,2)*ry_kbar, sigma(l,3)*ry_kbar, l=1,3) + + if ( iverbosity > 0 ) WRITE( stdout, 9005) & + (sigmakin(l,1)*ry_kbar,sigmakin(l,2)*ry_kbar,sigmakin(l,3)*ry_kbar, l=1,3),& + (sigmaloc(l,1)*ry_kbar,sigmaloc(l,2)*ry_kbar,sigmaloc(l,3)*ry_kbar, l=1,3),& + (sigmanlc(l,1)*ry_kbar,sigmanlc(l,2)*ry_kbar,sigmanlc(l,3)*ry_kbar, l=1,3),& + (sigmahar(l,1)*ry_kbar,sigmahar(l,2)*ry_kbar,sigmahar(l,3)*ry_kbar, l=1,3),& + (sigmaxc (l,1)*ry_kbar,sigmaxc (l,2)*ry_kbar,sigmaxc (l,3)*ry_kbar, l=1,3),& + (sigmaewa(l,1)*ry_kbar,sigmaewa(l,2)*ry_kbar,sigmaewa(l,3)*ry_kbar, l=1,3) !!$,& +!!$ (sigma_nonloc_dft(l,1)*ry_kbar,sigma_nonloc_dft(l,2)*ry_kbar,sigma_nonloc_dft(l,3)*ry_kbar, l=1,3) + + + call stop_clock ('stress') + + return +9000 format (10x,'total stress (Ry/bohr**3) ',18x,'(kbar)', & + &5x,'P=',f8.2/3 (3f13.8,4x,3f10.2/)) +9001 format (5x,'Isostatic pressure: ',f8.2,' kbar') +9005 format & + & (5x,'kinetic stress (kbar)',3f10.2/2(26x,3f10.2/)/ & + & 5x,'local stress (kbar)',3f10.2/2(26x,3f10.2/)/ & + & 5x,'nonloc. stress (kbar)',3f10.2/2(26x,3f10.2/)/ & + & 5x,'hartree stress (kbar)',3f10.2/2(26x,3f10.2/)/ & + & 5x,'exc-cor stress (kbar)',3f10.2/2(26x,3f10.2/)/ & + & 5x,'corecor stress (kbar)',3f10.2/2(26x,3f10.2/)/ & + & 5x,'ewald stress (kbar)',3f10.2/2(26x,3f10.2/)/ & + & 5x,'dft-nl stress (kbar)',3f10.2/2(26x,3f10.2/)/ ) +end subroutine stress + diff --git a/tests/apps/miniDFT/tests/src/struct_fact.f90 b/tests/apps/miniDFT/tests/src/struct_fact.f90 new file mode 100644 index 0000000000..18526023c4 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/struct_fact.f90 @@ -0,0 +1,97 @@ +! +! Copyright (C) 2001 PWSCF group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +!---------------------------------------------------------------------- +subroutine struc_fact (nat, tau, ntyp, ityp, ngm, g, bg, nr1, nr2, & + nr3, strf, eigts1, eigts2, eigts3) + !---------------------------------------------------------------------- + ! + ! calculate the structure factors for each type of atoms in the unit + ! cell + ! + USE kinds + USE constants, ONLY : tpi + implicit none + ! + ! Here the dummy variables + ! + + integer :: nat, ntyp, ityp (nat), ngm, nr1, nr2, nr3 + ! input: the number of atom in the unit cel + ! input: the number of atom types + ! input: for each atom gives the type + ! input: the number of G vectors + ! input: fft dimension along x + ! input: fft dimension along y + ! input: fft dimension along z + + real(DP) :: bg (3, 3), tau (3, nat), g (3, ngm) + ! input: reciprocal crystal basis vectors + ! input: the positions of the atoms in the c + ! input: the coordinates of the g vectors + + complex(DP) :: strf (ngm, ntyp), & + eigts1 ( -nr1:nr1, nat), & + eigts2 ( -nr2:nr2, nat), & + eigts3 ( -nr3:nr3, nat) + ! output: the structure factor + ! + ! output: the phases e^{-iG\tau_s} + ! + ! + ! here the local variables + ! + integer :: nt, na, ng, n1, n2, n3, ipol + ! counter over atom type + ! counter over atoms + ! counter over G vectors + ! counter over fft dimension along x + ! counter over fft dimension along y + ! counter over fft dimension along z + ! counter over polarizations + + real(DP) :: arg, bgtau (3) + ! the argument of the exponent + ! scalar product of bg and tau + + strf(:,:) = (0.d0,0.d0) + do nt = 1, ntyp + do na = 1, nat + if (ityp (na) .eq.nt) then + do ng = 1, ngm + arg = (g (1, ng) * tau (1, na) + g (2, ng) * tau (2, na) & + + g (3, ng) * tau (3, na) ) * tpi + strf (ng, nt) = strf (ng, nt) + CMPLX(cos (arg), -sin (arg),kind=DP) + enddo + endif + enddo + enddo + + do na = 1, nat + do ipol = 1, 3 + bgtau (ipol) = bg (1, ipol) * tau (1, na) + & + bg (2, ipol) * tau (2, na) + & + bg (3, ipol) * tau (3, na) + enddo + do n1 = - nr1, nr1 + arg = tpi * n1 * bgtau (1) + eigts1 (n1, na) = CMPLX(cos (arg), - sin (arg) ,kind=DP) + enddo + do n2 = - nr2, nr2 + arg = tpi * n2 * bgtau (2) + eigts2 (n2, na) = CMPLX(cos (arg), - sin (arg) ,kind=DP) + enddo + do n3 = - nr3, nr3 + arg = tpi * n3 * bgtau (3) + eigts3 (n3, na) = CMPLX(cos (arg), - sin (arg) ,kind=DP) + enddo + enddo + + return +end subroutine struc_fact + diff --git a/tests/apps/miniDFT/tests/src/sum_band.f90 b/tests/apps/miniDFT/tests/src/sum_band.f90 new file mode 100644 index 0000000000..a83e8019ff --- /dev/null +++ b/tests/apps/miniDFT/tests/src/sum_band.f90 @@ -0,0 +1,435 @@ +! +! Copyright (C) 2001-2009 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +!---------------------------------------------------------------------------- +SUBROUTINE sum_band() + !---------------------------------------------------------------------------- + ! + ! ... calculates the symmetrized charge density and sum of occupied + ! ... eigenvalues. + ! ... this version works also for metals (gaussian spreading technique) + ! + USE kinds, ONLY : DP + USE ener, ONLY : eband + USE control_flags, ONLY : diago_full_acc, tqr + USE cell_base, ONLY : at, bg, omega, tpiba + USE ions_base, ONLY : nat, ntyp => nsp, ityp + USE fft_base, ONLY : dfftp, dffts + USE fft_interfaces, ONLY : fwfft, invfft + USE gvect, ONLY : ngm, g, nl, nlm + USE gvecs, ONLY : nls, nlsm, doublegrid + USE klist, ONLY : nks, nkstot, wk, xk, ngk + USE fixed_occ, ONLY : one_atom_occupations + USE lsda_mod, ONLY : lsda, nspin, current_spin, isk + USE scf, ONLY : rho + USE symme, ONLY : sym_rho + USE io_files, ONLY : iunwfc, nwordwfc, iunigk + USE buffers, ONLY : get_buffer + USE uspp, ONLY : nkb, vkb, becsum, nhtol, nhtoj, indv, okvan + USE uspp_param, ONLY : upf, nh, nhm + USE wavefunctions_module, ONLY : evc, psic, psic_nc + USE spin_orb, ONLY : lspinorb, domag, fcoef + USE wvfct, ONLY : nbnd, npwx, npw, igk, wg, et, btype + USE mp_global, ONLY : inter_pool_comm, intra_bgrp_comm + USE mp, ONLY : mp_bcast, mp_sum + USE becmod, ONLY : allocate_bec_type, deallocate_bec_type, & + bec_type, becp + USE wvfct, ONLY: nbnd + ! + IMPLICIT NONE + integer, parameter :: nspin_mag=1 !substitute for noncollin_module + ! ... local variables + ! + INTEGER :: ikb, jkb, ijkb0, ih, jh, ijh, na, np + ! counters on beta functions, atoms, pseudopotentials + INTEGER :: ir, is, ig, ibnd, ik + ! counter on 3D r points + ! counter on spin polarizations + ! counter on g vectors + ! counter on bands + ! counter on k points + REAL (DP), ALLOCATABLE :: kplusg (:) + ! + ! + CALL start_clock( 'sum_band' ) + ! + becsum(:,:,:) = 0.D0 + rho%of_r(:,:) = 0.D0 + rho%of_g(:,:) = 0.D0 + eband = 0.D0 + + ! + ! ... calculates weights of Kohn-Sham orbitals used in calculation of rho + ! + CALL weights ( ) + ! + ! + IF ( diago_full_acc ) THEN + ! + ! ... for diagonalization purposes all the bands are considered occupied + ! + btype(:,:) = 1 + ! + ELSE + ! + ! ... for diagonalization purposes a band is considered empty when its + ! ... occupation is less than 1.0 % + ! + btype(:,:) = 1 + ! + FORALL( ik = 1:nks, wk(ik) > 0.D0 ) + ! + WHERE( wg(:,ik) / wk(ik) < 0.01D0 ) btype(:,ik) = 0 + ! + END FORALL + ! + END IF + IF ( one_atom_occupations ) CALL allocate_bec_type (nkb,nbnd, becp,intra_bgrp_comm) + ! + ! ... specific routines are called to sum for each k point the contribution + ! ... of the wavefunctions to the charge + ! + ! + CALL sum_band_k() + ! + ! + IF ( one_atom_occupations ) CALL deallocate_bec_type ( becp ) + ! + ! ... If a double grid is used, interpolate onto the fine grid + ! + IF ( doublegrid ) THEN + ! + DO is = 1, nspin + ! + CALL interpolate( rho%of_r(1,is), rho%of_r(1,is), 1 ) + ! + END DO + ! + END IF + ! + CALL mp_sum( eband, inter_pool_comm ) + ! + ! + ! ... reduce charge density across pools + ! + CALL mp_sum( rho%of_r, inter_pool_comm ) + ! + ! ... bring the (unsymmetrized) rho(r) to G-space (use psic as work array) + ! + DO is = 1, nspin + psic(:) = rho%of_r(:,is) + CALL fwfft ('Dense', psic, dfftp) + rho%of_g(:,is) = psic(nl(:)) + END DO + ! + ! ... symmetrize rho(G) + ! + CALL sym_rho ( nspin_mag, rho%of_g ) + ! + ! ... synchronize rho%of_r to the calculated rho%of_g (use psic as work array) + ! + DO is = 1, nspin_mag + ! + psic(:) = ( 0.D0, 0.D0 ) + psic(nl(:)) = rho%of_g(:,is) + CALL invfft ('Dense', psic, dfftp) + rho%of_r(:,is) = psic(:) + ! + END DO + ! + CALL stop_clock( 'sum_band' ) + ! + RETURN + ! + CONTAINS + ! + ! ... internal procedures + ! + !----------------------------------------------------------------------- + ! + ! + !----------------------------------------------------------------------- + SUBROUTINE sum_band_k() + !----------------------------------------------------------------------- + ! + ! ... k-points version + ! + USE becmod, ONLY : bec_type, becp, calbec + USE mp_global, ONLY : me_pool + USE mp, ONLY : mp_sum + ! + IMPLICIT NONE + ! + ! ... local variables + ! + REAL(DP) :: w1 + ! weights + COMPLEX(DP), ALLOCATABLE :: becsum_nc(:,:,:,:) + ! + INTEGER :: ipol, js + ! + INTEGER :: idx, ioff, incr, v_siz, j + COMPLEX(DP), ALLOCATABLE :: tg_psi(:) + REAL(DP), ALLOCATABLE :: tg_rho(:) + LOGICAL :: use_tg +#ifdef __OPENMP + INTEGER :: mytid, ntids, omp_get_thread_num, omp_get_num_threads, icnt +#endif + ! + ! + ! ... here we sum for each k point the contribution + ! ... of the wavefunctions to the charge + ! +#ifdef __IGKIO + IF ( nks > 1 ) REWIND( iunigk ) +#endif + ! + use_tg = dffts%have_task_groups + dffts%have_task_groups = ( dffts%have_task_groups ) .AND. ( nbnd >= dffts%nogrp ) + ! + incr = 1 + ! + IF( dffts%have_task_groups ) THEN + ! + v_siz = dffts%tg_nnr * dffts%nogrp + ! + ALLOCATE( tg_psi( v_siz ) ) + ALLOCATE( tg_rho( v_siz ) ) + ! + incr = dffts%nogrp + ! + END IF + ! + k_loop: DO ik = 1, nks + ! + IF( dffts%have_task_groups ) tg_rho = 0.0_DP + + IF ( lsda ) current_spin = isk(ik) + npw = ngk (ik) + ! + IF ( nks > 1 ) THEN + ! +#ifdef __IGKIO + READ( iunigk ) igk + CALL get_buffer ( evc, nwordwfc, iunwfc, ik ) +#endif __IGKIO + ! + END IF + ! + IF ( nkb > 0 ) & + CALL init_us_2( npw, igk, xk(1,ik), vkb ) + ! + ! ... here we compute the band energy: the sum of the eigenvalues + ! + DO ibnd = 1, nbnd, incr + ! + IF( dffts%have_task_groups ) THEN + DO idx = 1, dffts%nogrp + IF( idx + ibnd - 1 <= nbnd ) eband = eband + et( idx + ibnd - 1, ik ) * wg( idx + ibnd - 1, ik ) + END DO + ELSE + eband = eband + et( ibnd, ik ) * wg( ibnd, ik ) + END IF + ! + ! ... the sum of eband and demet is the integral for e < ef of + ! ... e n(e) which reduces for degauss=0 to the sum of the + ! ... eigenvalues + w1 = wg(ibnd,ik) / omega + ! + ! + IF( dffts%have_task_groups ) THEN + ! +!$omp parallel default(shared), private(j,ioff,idx) +!$omp do + DO j = 1, SIZE( tg_psi ) + tg_psi(j) = ( 0.D0, 0.D0 ) + END DO +!$omp end do + ! + ioff = 0 + ! + DO idx = 1, dffts%nogrp + ! + ! ... dffts%nogrp ffts at the same time + ! + IF( idx + ibnd - 1 <= nbnd ) THEN +!$omp do + DO j = 1, npw + tg_psi( nls( igk( j ) ) + ioff ) = evc( j, idx+ibnd-1 ) + END DO +!$omp end do + END IF + + ioff = ioff + dffts%tg_nnr + + END DO +!$omp end parallel + ! + CALL invfft ('Wave', tg_psi, dffts) + ! + ! Now the first proc of the group holds the first band + ! of the dffts%nogrp bands that we are processing at the same time, + ! the second proc. holds the second and so on + ! + ! Compute the proper factor for each band + ! + DO idx = 1, dffts%nogrp + IF( dffts%nolist( idx ) == me_pool ) EXIT + END DO + ! + ! Remember + ! proc 0 has bands ibnd + ! proc 1 has bands ibnd+1 + ! .... + ! + IF( idx + ibnd - 1 <= nbnd ) THEN + w1 = wg( idx + ibnd - 1, ik) / omega + ELSE + w1 = 0.0d0 + END IF + ! + CALL get_rho(tg_rho, dffts%tg_npp( me_pool + 1 ) * dffts%nr1x * dffts%nr2x, w1, tg_psi) + ! + ELSE + ! + psic(:) = ( 0.D0, 0.D0 ) + ! + psic(nls(igk(1:npw))) = evc(1:npw,ibnd) + ! + CALL invfft ('Wave', psic, dffts) + ! + ! ... increment the charge density ... + ! + CALL get_rho(rho%of_r(:,current_spin), dffts%nnr, w1, psic) + + END IF + ! + ! + END DO + ! + IF( dffts%have_task_groups ) THEN + ! + ! reduce the group charge + ! + CALL mp_sum( tg_rho, gid = dffts%ogrp_comm ) + ! + ioff = 0 + DO idx = 1, dffts%nogrp + IF( me_pool == dffts%nolist( idx ) ) EXIT + ioff = ioff + dffts%nr1x * dffts%nr2x * dffts%npp( dffts%nolist( idx ) + 1 ) + END DO + ! + ! copy the charge back to the proper processor location + ! +!$omp parallel do + DO ir = 1, dffts%nnr + rho%of_r(ir,current_spin) = rho%of_r(ir,current_spin) + tg_rho(ir+ioff) + END DO +!$omp end parallel do + ! + END IF + ! + ! ... If we have a US pseudopotential we compute here the becsum term + ! + CYCLE k_loop + ! + END DO k_loop + + IF( dffts%have_task_groups ) THEN + DEALLOCATE( tg_psi ) + DEALLOCATE( tg_rho ) + END IF + dffts%have_task_groups = use_tg + + ! + IF ( ALLOCATED (becsum_nc) ) DEALLOCATE( becsum_nc ) + ! + RETURN + ! + END SUBROUTINE sum_band_k + ! + ! + SUBROUTINE get_rho(rho_loc, nrxxs_loc, w1_loc, psic_loc) + + IMPLICIT NONE + + INTEGER :: nrxxs_loc + REAL(DP) :: rho_loc(nrxxs_loc) + REAL(DP) :: w1_loc + COMPLEX(DP) :: psic_loc(nrxxs_loc) + + INTEGER :: ir + +!$omp parallel do + DO ir = 1, nrxxs_loc + ! + rho_loc(ir) = rho_loc(ir) + & + w1_loc * ( DBLE( psic_loc(ir) )**2 + & + AIMAG( psic_loc(ir) )**2 ) + ! + END DO +!$omp end parallel do + + END SUBROUTINE get_rho + + SUBROUTINE get_rho_gamma(rho_loc, nrxxs_loc, w1_loc, w2_loc, psic_loc) + + IMPLICIT NONE + + INTEGER :: nrxxs_loc + REAL(DP) :: rho_loc(nrxxs_loc) + REAL(DP) :: w1_loc, w2_loc + COMPLEX(DP) :: psic_loc(nrxxs_loc) + + INTEGER :: ir + +!$omp parallel do + DO ir = 1, nrxxs_loc + ! + rho_loc(ir) = rho_loc(ir) + & + w1_loc * DBLE( psic_loc(ir) )**2 + & + w2_loc * AIMAG( psic_loc(ir) )**2 + ! + END DO +!$omp end parallel do + + END SUBROUTINE get_rho_gamma + + + SUBROUTINE get_rho_domag(rho_loc, nrxxs_loc, w1_loc, psic_loc) + + IMPLICIT NONE + + INTEGER :: nrxxs_loc + REAL(DP) :: rho_loc(:, :) + REAL(DP) :: w1_loc + COMPLEX(DP) :: psic_loc(:, :) + + INTEGER :: ir + +!$omp parallel do + DO ir = 1, nrxxs_loc + ! + rho_loc(ir,2) = rho_loc(ir,2) + w1_loc*2.D0* & + (DBLE(psic_loc(ir,1))* DBLE(psic_loc(ir,2)) + & + AIMAG(psic_loc(ir,1))*AIMAG(psic_loc(ir,2))) + + rho_loc(ir,3) = rho_loc(ir,3) + w1_loc*2.D0* & + (DBLE(psic_loc(ir,1))*AIMAG(psic_loc(ir,2)) - & + DBLE(psic_loc(ir,2))*AIMAG(psic_loc(ir,1))) + + rho_loc(ir,4) = rho_loc(ir,4) + w1_loc* & + (DBLE(psic_loc(ir,1))**2+AIMAG(psic_loc(ir,1))**2 & + -DBLE(psic_loc(ir,2))**2-AIMAG(psic_loc(ir,2))**2) + ! + END DO +!$omp end parallel do + + END SUBROUTINE get_rho_domag + +END SUBROUTINE sum_band diff --git a/tests/apps/miniDFT/tests/src/summary.f90 b/tests/apps/miniDFT/tests/src/summary.f90 new file mode 100644 index 0000000000..3aaa1b898b --- /dev/null +++ b/tests/apps/miniDFT/tests/src/summary.f90 @@ -0,0 +1,396 @@ +! +! Copyright (C) 2001-2010 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +!----------------------------------------------------------------------- +SUBROUTINE summary() + !----------------------------------------------------------------------- + ! + ! This routine writes on output all the information obtained from + ! the input file and from the setup routine, before starting the + ! self-consistent calculation. + ! + ! if iverbosity < 1 only a partial summary is done. + ! + USE io_global, ONLY : stdout + USE kinds, ONLY : DP + USE run_info, ONLY: title + USE constants, ONLY : amconv, rytoev + USE cell_base, ONLY : alat, ibrav, omega, at, bg, celldm + USE ions_base, ONLY : nat, atm, zv, tau, ntyp => nsp, ityp + USE ions_base, ONLY : amass + USE gvect, ONLY : ecutrho, ngm, ngm_g, gcutm + USE gvecs, ONLY : doublegrid, ngms, gcutms + USE fft_base, ONLY : dfftp + USE fft_base, ONLY : dffts + USE lsda_mod, ONLY : lsda, starting_magnetization + USE klist, ONLY : degauss, smearing, lgauss, nkstot, xk, wk, & + nelec, nelup, neldw, two_fermi_energies + USE ktetra, ONLY : ltetra + USE control_flags, ONLY : imix, nmix, mixing_beta, nstep, lscf, & + tr2, isolve, lmd, lbfgs, lpath, iverbosity + USE spin_orb, ONLY : domag, lspinorb + USE funct, ONLY : write_dft_name + USE fixed_occ, ONLY : f_inp, tfixed_occ + USE uspp_param, ONLY : upf + USE wvfct, ONLY : nbnd, ecutwfc, qcutz, ecfixed, q2sigma + USE lsda_mod, ONLY : nspin + USE mp_global, ONLY : intra_bgrp_comm + USE mp, ONLY : mp_sum + ! + IMPLICIT NONE + ! + ! ... declaration of the local variables + ! + INTEGER :: i, ipol, apol, na, isym, ik, nt, ibnd, ngmtot + ! counter on the celldm elements + ! counter on polarizations + ! counter on direct or reciprocal lattice vect + ! counter on atoms + ! counter on symmetries + ! counter on k points + ! counter on beta functions + ! counter on types + ! counter on bands + ! total number of G-vectors (parallel execution) + ! + REAL(DP), ALLOCATABLE :: xau(:,:) + ! atomic coordinate referred to the crystal axes + REAL(DP) :: xkg(3) + ! coordinates of the k point in crystal axes + CHARACTER :: mixing_style * 9 + REAL(DP) :: xp + ! fraction contributing to a given atom type (obsolescent) + ! + ! ... we start with a general description of the run + ! + IF ( imix == 0 ) mixing_style = 'plain' + IF ( imix == 1 ) mixing_style = 'TF' + IF ( imix == 2 ) mixing_style = 'local-TF' + ! + IF ( title /= ' ') WRITE( stdout, "(/,5X,'Title: ',/,5X,A75)" ) title + ! + WRITE( stdout, 100) ibrav, alat, omega, nat, ntyp + IF ( two_fermi_energies ) THEN + WRITE( stdout, 101) nelec, nelup, neldw + ELSE + WRITE( stdout, 102) nelec + END IF + WRITE( stdout, 103) nbnd, ecutwfc, ecutrho + IF ( lscf) WRITE( stdout, 104) tr2, mixing_beta, nmix, mixing_style + ! +100 FORMAT( /,/,5X, & + & 'bravais-lattice index = ',I12,/,5X, & + & 'lattice parameter (alat) = ',F12.4,' a.u.',/,5X, & + & 'unit-cell volume = ',F12.4,' (a.u.)^3',/,5X, & + & 'number of atoms/cell = ',I12,/,5X, & + & 'number of atomic types = ',I12) +101 FORMAT(5X, & + & 'number of electrons = ',F12.2,' (up:',f7.2,', down:',f7.2,')') +102 FORMAT(5X, & + & 'number of electrons = ',f12.2) +103 FORMAT(5X, & + & 'number of Kohn-Sham states= ',I12,/,5X, & + & 'kinetic-energy cutoff = ',F12.4,' Ry',/,5X, & + & 'charge density cutoff = ',F12.4,' Ry') +104 FORMAT(5X, & + & 'convergence threshold = ',1PE12.1,/,5X, & + & 'mixing beta = ',0PF12.4,/,5X, & + & 'number of iterations used = ',I12,2X,A,' mixing') + ! + call write_dft_name ( ) + ! + IF ( lmd .OR. lbfgs .OR. lpath ) & + WRITE( stdout, '(5X,"nstep = ",I12,/)' ) nstep + ! + ! + IF ( qcutz > 0.D0 ) THEN + ! + WRITE( stdout, 110 ) ecfixed, qcutz, q2sigma + ! +110 FORMAT( 5X,'A smooth kinetic-energy cutoff is imposed at ', & + & F12.4,' Ry',/5X,'height of the smooth ', & + & 'step-function =',F21.4,' Ry',/5X, & + & 'width of the smooth step-function =',F21.4,' Ry',/ ) + ! + END IF + +#ifdef __ENVIRON + IF ( do_environ ) CALL environ_summary() +#endif +! DCC +! IF ( do_comp ) CALL write_ee_summary() + ! + ! ... ESM + ! + ! + ! ... and here more detailed information. Description of the unit cell + ! + WRITE( stdout, '(/2(3X,3(2X,"celldm(",I1,")=",F11.6),/))' ) & + ( i, celldm(i), i = 1, 6 ) + ! + WRITE( stdout, '(5X, & + & "crystal axes: (cart. coord. in units of alat)",/, & + & 3(15x,"a(",i1,") = (",3f11.6," ) ",/ ) )') (apol, & + (at (ipol, apol) , ipol = 1, 3) , apol = 1, 3) + ! + WRITE( stdout, '(5x, & + & "reciprocal axes: (cart. coord. in units 2 pi/alat)",/, & + & 3(15x,"b(",i1,") = (",3f10.6," ) ",/ ) )') (apol,& + & (bg (ipol, apol) , ipol = 1, 3) , apol = 1, 3) + ! + CALL print_ps_info ( ) + ! + ! + ! ... print the vdw table information if needed + ! + WRITE( stdout, '(/5x, "atomic species valence mass pseudopotential")') + xp = 1.d0 + DO nt = 1, ntyp + WRITE( stdout, '(5x,a6,6x,f10.2,2x,f10.5,5x,5 (a2,"(",f5.2,")"))') & + atm(nt), zv(nt), amass(nt), upf(nt)%psd, xp + ENDDO + + + IF (lsda) THEN + WRITE( stdout, '(/5x,"Starting magnetic structure ", & + & /5x,"atomic species magnetization")') + DO nt = 1, ntyp + WRITE( stdout, '(5x,a6,9x,f6.3)') atm(nt), starting_magnetization(nt) + ENDDO + ENDIF + ! + ! description of symmetries + ! + CALL print_symmetries ( iverbosity, .false., domag ) + ! + ! description of the atoms inside the unit cell + ! + WRITE( stdout, '(/,3x,"Cartesian axes")') + WRITE( stdout, '(/,5x,"site n. atom positions (alat units)")') + + WRITE( stdout, '(6x,i4,8x,a6," tau(",i4,") = (",3f12.7," )")') & + (na, atm(ityp(na)), na, (tau(ipol,na), ipol=1,3), na=1,nat) + ! + ! output of starting magnetization + ! + IF (iverbosity > 0) THEN + ! + ! allocate work space + ! + ALLOCATE (xau(3,nat)) + ! + ! Compute the coordinates of each atom in the basis of the + ! direct lattice vectors + ! + DO na = 1, nat + DO ipol = 1, 3 + xau(ipol,na) = bg(1,ipol)*tau(1,na) + bg(2,ipol)*tau(2,na) + & + bg(3,ipol)*tau(3,na) + ENDDO + ENDDO + ! + ! description of the atoms inside the unit cell + ! (in crystallographic coordinates) + ! + WRITE( stdout, '(/,3x,"Crystallographic axes")') + WRITE( stdout, '(/,5x,"site n. atom ", & + & " positions (cryst. coord.)")') + + WRITE( stdout, '(6x,i4,8x,a6," tau(",i4,") = (",3f11.7," )")') & + (na, atm(ityp(na)), na, (xau(ipol,na), ipol=1,3), na=1,nat) + ! + ! deallocate work space + ! + DEALLOCATE(xau) + ENDIF + + IF (lgauss) THEN + WRITE( stdout, '(/5x,"number of k points=", i6, 2x, & + & a," smearing, width (Ry)=",f8.4)') & + & nkstot, TRIM(smearing), degauss + ELSE IF (ltetra) THEN + WRITE( stdout,'(/5x,"number of k points=",i6, & + & " (tetrahedron method)")') nkstot + ELSE + WRITE( stdout, '(/5x,"number of k points=",i6)') nkstot + + ENDIF + IF ( iverbosity > 0 .OR. nkstot < 100 ) THEN + WRITE( stdout, '(23x,"cart. coord. in units 2pi/alat")') + DO ik = 1, nkstot + WRITE( stdout, '(8x,"k(",i5,") = (",3f12.7,"), wk =",f12.7)') ik, & + (xk (ipol, ik) , ipol = 1, 3) , wk (ik) + ENDDO + ELSE + WRITE( stdout, '(/5x,a)') & + "Number of k-points >= 100: set verbosity='high' to print them." + ENDIF + IF ( iverbosity > 0 ) THEN + WRITE( stdout, '(/23x,"cryst. coord.")') + DO ik = 1, nkstot + DO ipol = 1, 3 + xkg(ipol) = at(1,ipol)*xk(1,ik) + at(2,ipol)*xk(2,ik) + & + at(3,ipol)*xk(3,ik) + ! xkg are the component in the crystal RL basis + ENDDO + WRITE( stdout, '(8x,"k(",i5,") = (",3f12.7,"), wk =",f12.7)') & + ik, (xkg (ipol) , ipol = 1, 3) , wk (ik) + ENDDO + ENDIF + WRITE( stdout, '(/5x,"Dense grid: ",i8," G-vectors", 5x, & + & "FFT dimensions: (",i4,",",i4,",",i4,")")') & + & ngm_g, dfftp%nr1, dfftp%nr2, dfftp%nr3 + IF (doublegrid) THEN + ! + ngmtot = ngms + CALL mp_sum (ngmtot, intra_bgrp_comm) + ! + WRITE( stdout, '(/5x,"Smooth grid: ",i8," G-vectors", 5x, & + & "FFT dimensions: (",i4,",",i4,",",i4,")")') & + & ngmtot, dffts%nr1, dffts%nr2, dffts%nr3 + ENDIF + +! DCC +! IF (do_coarse .OR. do_mltgrid ) THEN +! WRITE( stdout, '(5x,"G cutoff =",f10.4," (", & +! & i7," G-vectors)"," coarse grid: (",i3, & +! & ",",i3,",",i3,")")') gcutmc, ngmc, mr1, mr2, mr3 +! END IF + + IF (tfixed_occ) THEN + WRITE( stdout, '(/,5X,"Occupations read from input ")' ) + IF (nspin==2) THEN + WRITE(stdout, '(/,5X," Spin-up")' ) + WRITE(stdout, '(/,(5X,8f9.4))') (f_inp(ibnd,1),ibnd=1,nbnd) + WRITE(stdout, '(/,5X," Spin-down")' ) + WRITE(stdout, '(/,(5X,8f9.4))') (f_inp(ibnd,2),ibnd=1,nbnd) + ELSE + WRITE(stdout, '(/,(5X,8f9.4))') (f_inp(ibnd,1), ibnd=1,nbnd) + END IF + END IF + + ! + CALL flush_unit( stdout ) + ! + RETURN + ! +END SUBROUTINE summary +! +!----------------------------------------------------------------------- +SUBROUTINE print_ps_info + !----------------------------------------------------------------------- + ! + USE io_global, ONLY : stdout + USE io_files, ONLY : pseudo_dir, psfile + USE ions_base, ONLY : ntyp => nsp + USE atom, ONLY : rgrid + USE uspp_param, ONLY : upf + USE funct, ONLY : dft_is_gradient + + ! + INTEGER :: nt, lmax + CHARACTER :: ps*35 + ! + DO nt = 1, ntyp + ! + IF ( upf(nt)%tpawp ) THEN + ! Note: for PAW pseudo also tvanp is .true. + ps="Projector augmented-wave" + ELSE + ps='Norm-conserving' + END IF + ! + IF ( upf(nt)%nlcc ) ps = TRIM(ps) // ' + core correction' + ! + WRITE( stdout, '(/5x,"PseudoPot. #",i2," for ",a2," read from file:", & + & /5x,a)') nt, upf(nt)%psd, TRIM(pseudo_dir)//TRIM (psfile(nt)) + WRITE( stdout, '(5x,"MD5 check sum: ", a )') upf(nt)%md5_cksum + ! + WRITE( stdout, '( 5x,"Pseudo is ",a,", Zval =",f5.1)') & + TRIM (ps), upf(nt)%zp + ! + WRITE( stdout, '(5x,A)') TRIM(upf(nt)%generated) + ! + IF(upf(nt)%tpawp) & + WRITE( stdout, '(5x,a,a)') & + "Shape of augmentation charge: ", TRIM(upf(nt)%paw%augshape) + ! + ! info added for 1/r pseudos (AF) + IF(upf(nt)%tcoulombp ) & + WRITE( stdout, '(5x,a,a)') "1/r Coulomb pseudo" + ! + WRITE( stdout, '(5x,"Using radial grid of ", i4, " points, ", & + &i2," beta functions with: ")') rgrid(nt)%mesh, upf(nt)%nbeta + DO ib = 1, upf(nt)%nbeta + IF (ib < 10 ) THEN + WRITE( stdout, '(15x," l(",i1,") = ",i3)') ib, upf(nt)%lll(ib) + ELSE + WRITE( stdout, '(14x," l(",i2,") = ",i3)') ib, upf(nt)%lll(ib) + ENDIF + END DO + + + ENDDO +END SUBROUTINE print_ps_info +! +SUBROUTINE print_symmetries ( iverbosity, noncolin, domag ) + !----------------------------------------------------------------------- + ! + USE kinds, ONLY : dp + USE io_global, ONLY : stdout + USE symm_base, ONLY : nsym, nsym_ns, nsym_na, invsym, s, sr, & + t_rev, ftau, sname + USE rap_point_group, ONLY : code_group, nclass, nelem, elem, & + which_irr, char_mat, name_rap, name_class, gname, ir_ram + USE rap_point_group_so, ONLY : nrap, nelem_so, elem_so, has_e, & + which_irr_so, char_mat_so, name_rap_so, name_class_so, d_spin, & + name_class_so1 + USE rap_point_group_is, ONLY : nsym_is, sr_is, ftau_is, d_spin_is, & + gname_is, sname_is, code_group_is + USE cell_base, ONLY : at + USE fft_base, ONLY : dfftp + ! + IMPLICIT NONE + ! + INTEGER, INTENT(IN) :: iverbosity + LOGICAL, INTENT(IN) :: noncolin, domag + ! + INTEGER :: nclass_ref ! The number of classes of the point group + INTEGER :: isym, ipol + REAL (dp) :: ft1, ft2, ft3 + ! + ! + IF (nsym <= 1) THEN + WRITE( stdout, '(/5x,"No symmetry found")') + ELSE + IF (invsym) THEN + IF ( nsym_ns > 0 ) THEN + WRITE( stdout, '(/5x,i2," Sym. Ops., with inversion, found ", & + & "(",i2," have fractional translation)")' ) nsym, nsym_ns + ELSE + WRITE( stdout, '(/5x,i2," Sym. Ops., with inversion, found")' )& + nsym + END IF + ELSE + IF ( nsym_ns > 0 ) THEN + WRITE( stdout, '(/5x,i2," Sym. Ops. (no inversion) found ",& + & "(",i2," have fractional translation)")' ) nsym, nsym_ns + ELSE + WRITE( stdout,'(/5x,i2," Sym. Ops. (no inversion) found")' ) nsym + END IF + ENDIF + ENDIF + IF ( nsym_na > 0 ) THEN + WRITE( stdout, '(10x,"(note: ",i2," additional sym.ops. were found ", & + & "but ignored",/,10x," their fractional transations ", & + & "are incommensurate with FFT grid)",/)') nsym_na + ELSE + WRITE( stdout, '(/)' ) + END IF + +END SUBROUTINE print_symmetries diff --git a/tests/apps/miniDFT/tests/src/symm_base.f90 b/tests/apps/miniDFT/tests/src/symm_base.f90 new file mode 100644 index 0000000000..eed0a1b65f --- /dev/null +++ b/tests/apps/miniDFT/tests/src/symm_base.f90 @@ -0,0 +1,906 @@ +! +! Copyright (C) 2010-2011 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +!-------------------------------------------------------------------------- +! +MODULE symm_base + + USE kinds, ONLY : DP + USE cell_base, ONLY : at, bg + ! + ! ... The variables needed to describe the symmetry properties + ! ... and the routines to find crystal symmetries + ! + ! ... these are acceptance criteria + ! + REAL(DP), parameter :: eps1 = 1.0d-6, eps2 = 1.0d-5 + ! + SAVE + ! + PRIVATE + ! + ! ... Exported variables + ! + PUBLIC :: s, sr, sname, ft, ftau, nrot, nsym, nsym_ns, nsym_na, t_rev, & + no_t_rev, time_reversal, irt, invs, invsym, d1, d2, d3, & + allfrac, nofrac, nosym, nosym_evc + INTEGER :: & + s(3,3,48), &! symmetry matrices, in crystal axis + invs(48), &! index of inverse operation: S^{-1}_i=S(invs(i)) + ftau(3,48), &! fractional translations, in FFT coordinates + nrot, &! number of bravais lattice symmetries + nsym = 1, &! total number of crystal symmetries + nsym_ns = 0, &! nonsymmorphic (fractional translation) symms + nsym_na = 0 ! excluded nonsymmorphic symmetries because + ! fract. transl. is noncommensurate with FFT grid + REAL (DP) :: & + ft (3,48), &! fractional translations, in crystal axis + sr (3,3,48) ! symmetry matrices, in cartesian axis + ! + ! ... note: ftau are used for symmetrization in real space (phonon, exx) + ! ... in which case they must be commensurated with the FFT grid + ! + CHARACTER(LEN=45) :: sname(48) ! name of the symmetries + INTEGER :: & + t_rev(48) = 0 ! time reversal flag, for noncolinear magnetism + INTEGER, ALLOCATABLE :: & + irt(:,:) ! symmetric atom for each atom and sym.op. + LOGICAL :: & + time_reversal=.true., &! if .TRUE. the system has time reversal symmetry + invsym, &! if .TRUE. the system has inversion symmetry + nofrac= .FALSE., &! if .TRUE. fract. translations are not allowed + allfrac= .FALSE., &! if .TRUE. all fractionary transations allowed, + ! even those not commensurate with FFT grid + nosym = .FALSE., &! if .TRUE. no symmetry is used + nosym_evc = .FALSE., &! if .TRUE. symmetry is used only to symmetrize + ! k points + no_t_rev=.FALSE. ! if .TRUE. remove the symmetries that + ! require time reversal + REAL(DP),TARGET :: & + d1(3,3,48), &! matrices for rotating spherical + d2(5,5,48), &! harmonics (d1 for l=1, ...) + d3(7,7,48) ! + ! + ! ... Exported routines + ! + PUBLIC :: find_sym, inverse_s, copy_sym, checkallsym, & + s_axis_to_cart, set_sym, set_sym_bl + ! +CONTAINS + ! + SUBROUTINE inverse_s ( ) + !----------------------------------------------------------------------- + ! + ! Locate index of S^{-1} + ! + IMPLICIT NONE + ! + INTEGER :: isym, jsym, ss (3, 3) + LOGICAL :: found + ! + DO isym = 1, nsym + found = .FALSE. + DO jsym = 1, nsym + ! + ss = MATMUL (s(:,:,jsym),s(:,:,isym)) + ! s(:,:,1) is the identity + IF ( ALL ( s(:,:,1) == ss(:,:) ) ) THEN + invs (isym) = jsym + found = .TRUE. + END IF + END DO + IF ( .NOT.found) CALL errore ('inverse_s', ' Not a group', 1) + END DO + ! + END SUBROUTINE inverse_s + ! +!----------------------------------------------------------------------- +subroutine set_sym_bl ( ) + !----------------------------------------------------------------------- + ! + ! Provides symmetry operations for all bravais lattices + ! Tests first the 24 proper rotations for the cubic lattice; + ! then the 8 rotations specific for the hexagonal axis (special axis c); + ! then inversion is added + ! + implicit none + ! + ! sin3 = sin(pi/3), cos3 = cos(pi/3), msin3 = -sin(pi/3), mcos3 = -cos(pi/3) + ! + real(DP), parameter :: sin3 = 0.866025403784438597d0, cos3 = 0.5d0, & + msin3 =-0.866025403784438597d0, mcos3 = -0.5d0 + real(DP) :: s0(3, 3, 32), overlap (3, 3), rat (3), rot (3, 3), value + ! s0: the s matrices in cartesian axis + ! overlap: inverse overlap matrix between direct lattice + ! rat: the rotated of a direct vector ( cartesian ) + ! rot: the rotated of a direct vector ( crystal axis ) + ! value: component of the s matrix in axis basis + integer :: jpol, kpol, mpol, irot + ! counters over the polarizations and the rotations + + character :: s0name (64) * 45 + ! full name of the rotational part of each symmetry operation + + data s0/ 1.d0, 0.d0, 0.d0, 0.d0, 1.d0, 0.d0, 0.d0, 0.d0, 1.d0, & + -1.d0, 0.d0, 0.d0, 0.d0, -1.d0, 0.d0, 0.d0, 0.d0, 1.d0, & + -1.d0, 0.d0, 0.d0, 0.d0, 1.d0, 0.d0, 0.d0, 0.d0, -1.d0, & + 1.d0, 0.d0, 0.d0, 0.d0, -1.d0, 0.d0, 0.d0, 0.d0, -1.d0, & + 0.d0, 1.d0, 0.d0, 1.d0, 0.d0, 0.d0, 0.d0, 0.d0, -1.d0, & + 0.d0, -1.d0, 0.d0, -1.d0, 0.d0, 0.d0, 0.d0, 0.d0, -1.d0, & + 0.d0, -1.d0, 0.d0, 1.d0, 0.d0, 0.d0, 0.d0, 0.d0, 1.d0, & + 0.d0, 1.d0, 0.d0, -1.d0, 0.d0, 0.d0, 0.d0, 0.d0, 1.d0, & + 0.d0, 0.d0, 1.d0, 0.d0, -1.d0, 0.d0, 1.d0, 0.d0, 0.d0, & + 0.d0, 0.d0, -1.d0, 0.d0, -1.d0, 0.d0, -1.d0, 0.d0, 0.d0, & + 0.d0, 0.d0, -1.d0, 0.d0, 1.d0, 0.d0, 1.d0, 0.d0, 0.d0, & + 0.d0, 0.d0, 1.d0, 0.d0, 1.d0, 0.d0, -1.d0, 0.d0, 0.d0, & + -1.d0, 0.d0, 0.d0, 0.d0, 0.d0, 1.d0, 0.d0, 1.d0, 0.d0, & + -1.d0, 0.d0, 0.d0, 0.d0, 0.d0, -1.d0, 0.d0, -1.d0, 0.d0, & + 1.d0, 0.d0, 0.d0, 0.d0, 0.d0, -1.d0, 0.d0, 1.d0, 0.d0, & + 1.d0, 0.d0, 0.d0, 0.d0, 0.d0, 1.d0, 0.d0, -1.d0, 0.d0, & + 0.d0, 0.d0, 1.d0, 1.d0, 0.d0, 0.d0, 0.d0, 1.d0, 0.d0, & + 0.d0, 0.d0, -1.d0, -1.d0, 0.d0, 0.d0, 0.d0, 1.d0, 0.d0, & + 0.d0, 0.d0, -1.d0, 1.d0, 0.d0, 0.d0, 0.d0, -1.d0, 0.d0, & + 0.d0, 0.d0, 1.d0, -1.d0, 0.d0, 0.d0, 0.d0, -1.d0, 0.d0, & + 0.d0, 1.d0, 0.d0, 0.d0, 0.d0, 1.d0, 1.d0, 0.d0, 0.d0, & + 0.d0, -1.d0, 0.d0, 0.d0, 0.d0, -1.d0, 1.d0, 0.d0, 0.d0, & + 0.d0, -1.d0, 0.d0, 0.d0, 0.d0, 1.d0, -1.d0, 0.d0, 0.d0, & + 0.d0, 1.d0, 0.d0, 0.d0, 0.d0, -1.d0, -1.d0, 0.d0, 0.d0, & + cos3, sin3, 0.d0, msin3, cos3, 0.d0, 0.d0, 0.d0, 1.d0, & + cos3, msin3, 0.d0, sin3, cos3, 0.d0, 0.d0, 0.d0, 1.d0, & + mcos3, sin3, 0.d0, msin3, mcos3, 0.d0, 0.d0, 0.d0, 1.d0, & + mcos3, msin3, 0.d0, sin3, mcos3, 0.d0, 0.d0, 0.d0, 1.d0, & + cos3, msin3, 0.d0, msin3, mcos3, 0.d0, 0.d0, 0.d0, -1.d0, & + cos3, sin3, 0.d0, sin3, mcos3, 0.d0, 0.d0, 0.d0, -1.d0, & + mcos3, msin3, 0.d0, msin3, cos3, 0.d0, 0.d0, 0.d0, -1.d0, & + mcos3, sin3, 0.d0, sin3, cos3, 0.d0, 0.d0, 0.d0, -1.d0 / + + data s0name/ 'identity ',& + '180 deg rotation - cart. axis [0,0,1] ',& + '180 deg rotation - cart. axis [0,1,0] ',& + '180 deg rotation - cart. axis [1,0,0] ',& + '180 deg rotation - cart. axis [1,1,0] ',& + '180 deg rotation - cart. axis [1,-1,0] ',& + ' 90 deg rotation - cart. axis [0,0,-1] ',& + ' 90 deg rotation - cart. axis [0,0,1] ',& + '180 deg rotation - cart. axis [1,0,1] ',& + '180 deg rotation - cart. axis [-1,0,1] ',& + ' 90 deg rotation - cart. axis [0,1,0] ',& + ' 90 deg rotation - cart. axis [0,-1,0] ',& + '180 deg rotation - cart. axis [0,1,1] ',& + '180 deg rotation - cart. axis [0,1,-1] ',& + ' 90 deg rotation - cart. axis [-1,0,0] ',& + ' 90 deg rotation - cart. axis [1,0,0] ',& + '120 deg rotation - cart. axis [-1,-1,-1] ',& + '120 deg rotation - cart. axis [-1,1,1] ',& + '120 deg rotation - cart. axis [1,1,-1] ',& + '120 deg rotation - cart. axis [1,-1,1] ',& + '120 deg rotation - cart. axis [1,1,1] ',& + '120 deg rotation - cart. axis [-1,1,-1] ',& + '120 deg rotation - cart. axis [1,-1,-1] ',& + '120 deg rotation - cart. axis [-1,-1,1] ',& + ' 60 deg rotation - cryst. axis [0,0,1] ',& + ' 60 deg rotation - cryst. axis [0,0,-1] ',& + '120 deg rotation - cryst. axis [0,0,1] ',& + '120 deg rotation - cryst. axis [0,0,-1] ',& + '180 deg rotation - cryst. axis [1,-1,0] ',& + '180 deg rotation - cryst. axis [2,1,0] ',& + '180 deg rotation - cryst. axis [0,1,0] ',& + '180 deg rotation - cryst. axis [1,1,0] ',& + 'inversion ',& + 'inv. 180 deg rotation - cart. axis [0,0,1] ',& + 'inv. 180 deg rotation - cart. axis [0,1,0] ',& + 'inv. 180 deg rotation - cart. axis [1,0,0] ',& + 'inv. 180 deg rotation - cart. axis [1,1,0] ',& + 'inv. 180 deg rotation - cart. axis [1,-1,0] ',& + 'inv. 90 deg rotation - cart. axis [0,0,-1] ',& + 'inv. 90 deg rotation - cart. axis [0,0,1] ',& + 'inv. 180 deg rotation - cart. axis [1,0,1] ',& + 'inv. 180 deg rotation - cart. axis [-1,0,1] ',& + 'inv. 90 deg rotation - cart. axis [0,1,0] ',& + 'inv. 90 deg rotation - cart. axis [0,-1,0] ',& + 'inv. 180 deg rotation - cart. axis [0,1,1] ',& + 'inv. 180 deg rotation - cart. axis [0,1,-1] ',& + 'inv. 90 deg rotation - cart. axis [-1,0,0] ',& + 'inv. 90 deg rotation - cart. axis [1,0,0] ',& + 'inv. 120 deg rotation - cart. axis [-1,-1,-1]',& + 'inv. 120 deg rotation - cart. axis [-1,1,1] ',& + 'inv. 120 deg rotation - cart. axis [1,1,-1] ',& + 'inv. 120 deg rotation - cart. axis [1,-1,1] ',& + 'inv. 120 deg rotation - cart. axis [1,1,1] ',& + 'inv. 120 deg rotation - cart. axis [-1,1,-1] ',& + 'inv. 120 deg rotation - cart. axis [1,-1,-1] ',& + 'inv. 120 deg rotation - cart. axis [-1,-1,1] ',& + 'inv. 60 deg rotation - cryst. axis [0,0,1] ',& + 'inv. 60 deg rotation - cryst. axis [0,0,-1] ',& + 'inv. 120 deg rotation - cryst. axis [0,0,1] ',& + 'inv. 120 deg rotation - cryst. axis [0,0,-1] ',& + 'inv. 180 deg rotation - cryst. axis [1,-1,0] ',& + 'inv. 180 deg rotation - cryst. axis [2,1,0] ',& + 'inv. 180 deg rotation - cryst. axis [0,1,0] ',& + 'inv. 180 deg rotation - cryst. axis [1,1,0] ' / + + ! compute the overlap matrix for crystal axis + + do jpol = 1,3 + do kpol = 1,3 + rot(kpol,jpol) = at(1,kpol)*at(1,jpol) +& + at(2,kpol)*at(2,jpol) +& + at(3,kpol)*at(3,jpol) + enddo + enddo + ! + ! then its inverse (rot is used as work space) + ! + call invmat (3, rot, overlap, value) + + nrot = 1 + do irot = 1,32 + ! + ! for each possible symmetry + ! + do jpol = 1,3 + do mpol = 1,3 + ! + ! compute, in cartesian coordinates the rotated vector + ! + rat(mpol) = s0(mpol,1,irot)*at(1,jpol) +& + s0(mpol,2,irot)*at(2,jpol) +& + s0(mpol,3,irot)*at(3,jpol) + enddo + + do kpol = 1,3 + ! + ! the rotated vector is projected on the direct lattice + ! + rot(kpol,jpol) = at(1,kpol)*rat(1) +& + at(2,kpol)*rat(2) +& + at(3,kpol)*rat(3) + enddo + enddo + ! + ! and the inverse of the overlap matrix is applied + ! + do jpol = 1,3 + do kpol = 1,3 + value = overlap(jpol,1)*rot(1,kpol) +& + & overlap(jpol,2)*rot(2,kpol) +& + & overlap(jpol,3)*rot(3,kpol) + if ( abs(DBLE(nint(value))-value) > eps1 ) then + ! + ! if a noninteger is obtained, this implies that this operation + ! is not a symmetry operation for the given lattice + ! + go to 10 + end if + s(kpol,jpol,nrot) = nint(value) + sname(nrot)=s0name(irot) + enddo + enddo + nrot = nrot+1 +10 continue + enddo + nrot = nrot-1 + ! + ! set the inversion symmetry ( Bravais lattices have always inversion + ! symmetry ) + ! + do irot = 1, nrot + do kpol = 1,3 + do jpol = 1,3 + s(kpol,jpol,irot+nrot) = -s(kpol,jpol,irot) + sname(irot+nrot) = s0name(irot+32) + end do + end do + end do + + nrot = 2*nrot + + return + ! +end subroutine set_sym_bl +! +!----------------------------------------------------------------------- +SUBROUTINE find_sym ( nat, tau, ityp, nr1, nr2, nr3, magnetic_sym, m_loc ) + !----------------------------------------------------------------------- + ! + ! This routine finds the point group of the crystal, by eliminating + ! the symmetries of the Bravais lattice which are not allowed + ! by the atomic positions (or by the magnetization if present) + ! + implicit none + ! + integer, intent(in) :: nat, ityp (nat), nr1, nr2, nr3 + real(DP), intent(in) :: tau (3,nat), m_loc(3,1) + logical, intent(in) :: magnetic_sym + ! + logical :: sym (48) + ! if true the corresponding operation is a symmetry operation + ! + IF ( .NOT. ALLOCATED(irt) ) ALLOCATE( irt( 48, nat ) ) + irt( :, : ) = 0 + ! + ! Here we find the true symmetries of the crystal + ! + CALL sgam_at ( nat, tau, ityp, nr1, nr2, nr3, sym ) + ! + ! If nosym_evc is true from now on we do not use the symmetry any more + ! + IF (nosym_evc) THEN + sym=.false. + sym(1)=.true. + ENDIF + ! + ! Here we re-order all rotations in such a way that true sym.ops + ! are the first nsym; rotations that are not sym.ops. follow + ! + nsym = copy_sym ( nrot, sym ) + ! + IF ( .not. is_group ( ) ) THEN + CALL infomsg ('find_sym', 'Not a group! symmetry disabled') + nsym = 1 + END IF + ! + ! check if inversion (I) is a symmetry. + ! If so, it should be the (nsym/2+1)-th operation of the group + ! + invsym = ALL ( s(:,:,nsym/2+1) == -s(:,:,1) ) + ! + CALL inverse_s ( ) + ! + CALL s_axis_to_cart ( ) + ! + return + ! +END SUBROUTINE find_sym +! +!----------------------------------------------------------------------- +subroutine sgam_at ( nat, tau, ityp, nr1, nr2, nr3, sym ) + !----------------------------------------------------------------------- + ! + ! Given the point group of the Bravais lattice, this routine finds + ! the subgroup which is the point group of the considered crystal. + ! Non symmorphic groups are allowed, provided that fractional + ! translations are allowed (nofrac=.false), that the unit cell is + ! not a supercell, and that they are commensurate with the FFT grid + ! + ! On output, the array sym is set to .true.. for each operation + ! of the original point group that is also a symmetry operation + ! of the crystal symmetry point group + ! + USE io_global, ONLY : stdout + USE kinds + implicit none + ! + integer, intent(in) :: nat, ityp (nat), nr1, nr2, nr3 + ! nat : number of atoms in the unit cell + ! ityp : species of each atom in the unit cell + ! nr* : dimensions of the FFT mesh + ! + real(DP), intent(in) :: tau (3, nat) + ! + ! tau : cartesian coordinates of the atoms + ! + ! output variables + ! + logical, intent(out) :: sym (48) + ! sym(isym) : flag indicating if sym.op. isym in the parent group + ! is a true symmetry operation of the crystal + ! + integer :: na, kpol, nb, irot, i, j + ! counters + real(DP) , allocatable :: xau (:,:), rau (:,:) + ! atomic coordinates in crystal axis + logical :: fractional_translations + real(DP) :: ft_(3), ft1, ft2, ft3 + ! + allocate(xau(3,nat)) + allocate(rau(3,nat)) + ! + ! Compute the coordinates of each atom in the basis of + ! the direct lattice vectors + ! + do na = 1, nat + xau(:,na) = bg(1,:) * tau(1,na) + bg(2,:) * tau(2,na) + bg(3,:) * tau(3,na) + enddo + ! + ! check if the identity has fractional translations + ! (this means that the cell is actually a supercell). + ! When this happens, fractional translations are disabled, + ! because there is no guarantee that the generated sym.ops. + ! form a group + ! + nb = 1 + irot = 1 + ! + fractional_translations = .not. nofrac + do na = 2, nat + if ( fractional_translations ) then + if (ityp (nb) == ityp (na) ) then + ft_(:) = xau(:,na) - xau(:,nb) - nint( xau(:,na) - xau(:,nb) ) + ! + sym(irot) = checksym ( irot, nat, ityp, xau, xau, ft_ ) + ! + if ( sym (irot) .and. & + (abs (ft_(1) **2 + ft_(2) **2 + ft_(3) **2) < 1.d-8) ) & + call errore ('sgam_at', 'overlapping atoms', na) + if (sym (irot) ) then + fractional_translations = .false. + WRITE( stdout, '(5x,"Found symmetry operation: I + (",& + & 3f8.4, ")",/,5x,"This is a supercell,", & + & " fractional translations are disabled")') ft_ + endif + endif + end if + enddo + ! + nsym_ns = 0 + do irot = 1, nrot + ! + ! check that the grid is compatible with the S rotation + ! + if ( mod (s (2, 1, irot) * nr1, nr2) /= 0 .or. & + mod (s (3, 1, irot) * nr1, nr3) /= 0 .or. & + mod (s (1, 2, irot) * nr2, nr1) /= 0 .or. & + mod (s (3, 2, irot) * nr2, nr3) /= 0 .or. & + mod (s (1, 3, irot) * nr3, nr1) /= 0 .or. & + mod (s (2, 3, irot) * nr3, nr2) /= 0 ) then + sym (irot) = .false. + WRITE( stdout, '(5x,"warning: symmetry operation # ",i2, & + & " not compatible with FFT grid. ")') irot + WRITE( stdout, '(3i4)') ( (s (i, j, irot) , j = 1, 3) , i = 1, 3) + goto 100 + endif + + do na = 1, nat + ! rau = rotated atom coordinates + rau (:, na) = s (1,:, irot) * xau (1, na) + & + s (2,:, irot) * xau (2, na) + & + s (3,:, irot) * xau (3, na) + enddo + ! + ! first attempt: no fractional translation + ! + ftau (:, irot) = 0 + ft (:, irot) = 0 + ft_(:) = 0.d0 + ! + sym(irot) = checksym ( irot, nat, ityp, xau, rau, ft_ ) + ! + if (.not.sym (irot) .and. fractional_translations) then + nb = 1 + do na = 1, nat + if (ityp (nb) == ityp (na) ) then + ! + ! second attempt: check all possible fractional translations + ! + ft_ (:) = rau(:,na) - xau(:,nb) - nint( rau(:,na) - xau(:,nb) ) + ! + sym(irot) = checksym ( irot, nat, ityp, xau, rau, ft_ ) + ! + if (sym (irot) ) then + nsym_ns = nsym_ns + 1 + ft (:,irot) = ft_(:) + go to 100 + end if + endif + enddo + + endif +100 continue + enddo + ! + ! convert ft to FFT coordinates, check if compatible with FFT grid + ! for real-space symmetrization (if done: currently, exx, phonon) + ! + nsym_na = 0 + do irot =1, nrot + if ( sym(irot) .AND. .NOT. allfrac ) then + ft1 = ft(1,irot) * nr1 + ft2 = ft(2,irot) * nr2 + ft3 = ft(3,irot) * nr3 + ! check if the fractional translations are commensurate + ! with the FFT grid, discard sym.op. if not + ! (needed because ph.x symmetrizes in real space) + if (abs (ft1 - nint (ft1) ) / nr1 > eps2 .or. & + abs (ft2 - nint (ft2) ) / nr2 > eps2 .or. & + abs (ft3 - nint (ft3) ) / nr3 > eps2 ) then + ! WRITE( stdout, '(5x,"warning: symmetry operation", & + ! & " # ",i2," not allowed. fractional ", & + ! & "translation:"/5x,3f11.7," in crystal", & + ! & " coordinates")') irot, ft_ + sym (irot) = .false. + nsym_na = nsym_na + 1 + nsym_ns = nsym_ns - 1 + endif + ftau (1, irot) = nint (ft1) + ftau (2, irot) = nint (ft2) + ftau (3, irot) = nint (ft3) + end if + end do + ! + ! deallocate work space + ! + deallocate (rau) + deallocate (xau) + ! + return +end subroutine sgam_at +! +!----------------------------------------------------------------------- +subroutine sgam_at_mag ( nat, m_loc, sym ) + !----------------------------------------------------------------------- + ! + ! Find magnetic symmetries, i.e. point-group symmetries that are + ! also symmetries of the local magnetization - including + ! rotation + time reversal operations + ! + implicit none + ! + integer, intent(in) :: nat + real(DP), intent(in) :: m_loc(3, nat) + ! + ! m_loc: local magnetization, must be invariant under the sym.op. + ! + logical, intent(inout) :: sym (48) + ! + ! sym(isym) = .true. if rotation isym is a sym.op. of the crystal + ! (i.e. not of the bravais lattice only) + ! + integer :: na, nb, irot + logical :: t1, t2 + real(DP) , allocatable :: mxau(:,:), mrau(:,:) + ! magnetization and rotated magnetization in crystal axis + ! + allocate ( mxau(3,nat), mrau(3,nat) ) + ! + ! Compute the local magnetization of each atom in the basis of + ! the direct lattice vectors + ! + do na = 1, nat + mxau (:, na)= bg (1, :) * m_loc (1, na) + & + bg (2, :) * m_loc (2, na) + & + bg (3, :) * m_loc (3, na) + enddo + ! + do irot = 1, nrot + ! + t_rev(irot) = 0 + ! + if ( sym (irot) ) then + ! + ! mrau = rotated local magnetization + ! + do na = 1, nat + mrau(:,na) = s(1,:,irot) * mxau(1,na) + & + s(2,:,irot) * mxau(2,na) + & + s(3,:,irot) * mxau(3,na) + enddo + if (sname(irot)(1:3)=='inv') mrau = -mrau + ! + ! check if this a magnetic symmetry + ! + t1 = .true. + t2 = .true. + do na = 1, nat + ! + nb = irt (irot,na) + if ( nb < 1 .or. nb > nat ) call errore ('check_mag_sym', & + 'internal error: out-of-bound atomic index', na) + ! + t1 = ( abs(mrau(1,na) - mxau(1,nb)) + & + abs(mrau(2,na) - mxau(2,nb)) + & + abs(mrau(3,na) - mxau(3,nb)) < eps2 ) .and. t1 + t2 = ( abs(mrau(1,na) + mxau(1,nb))+ & + abs(mrau(2,na) + mxau(2,nb))+ & + abs(mrau(3,na) + mxau(3,nb)) < eps2 ) .and. t2 + ! + enddo + ! + if ( .not.t1 .and. .not.t2 ) then + ! not a magnetic symmetry + sym(irot) = .false. + else if( t2 .and. .not. t1 ) then + ! magnetic symmetry with time reversal, if allowed + IF (no_t_rev) THEN + sym(irot) = .false. + ELSE + t_rev(irot) = 1 + ENDIF + end if + ! + end if + ! + enddo + ! + ! deallocate work space + ! + deallocate ( mrau, mxau ) + ! + return +END SUBROUTINE sgam_at_mag +! +SUBROUTINE set_sym(nat, tau, ityp, nspin_mag, m_loc, nr1, nr2, nr3) + ! + ! This routine receives as input atomic types and positions, if there + ! is noncollinear magnetism and the initial magnetic moments, the fft + ! dimensions nr1, nr2, nr3; it sets the symmetry elements of this module. + ! Note that at and bg are those in cell_base. It sets nrot, nsym, s, + ! sname, sr, invs, ftau, irt, t_rev, time_reversal, and invsym + ! + !----------------------------------------------------------------------- + ! + IMPLICIT NONE + ! input + INTEGER, INTENT(IN) :: nat, ityp(nat), nspin_mag, nr1, nr2, nr3 + REAL(DP), INTENT(IN) :: tau(3,nat) + REAL(DP), INTENT(IN) :: m_loc(3,1) !dummy variable + ! + time_reversal = (nspin_mag /= 4) + t_rev(:) = 0 + CALL set_sym_bl ( ) + CALL find_sym ( nat, tau, ityp, nr1, nr2, nr3, .not.time_reversal, m_loc ) + ! + RETURN + END SUBROUTINE set_sym +! +!----------------------------------------------------------------------- +INTEGER FUNCTION copy_sym ( nrot_, sym ) +!----------------------------------------------------------------------- + ! + implicit none + integer, intent(in) :: nrot_ + logical, intent(inout) :: sym(48) + ! + integer :: stemp(3,3), ftemp(3), ttemp, irot, jrot + REAL(dp) :: ft_(3) + integer, allocatable :: irtemp(:) + character(len=45) :: nametemp + ! + ! copy symm. operations in sequential order so that + ! s(i,j,irot) , irot <= nsym are the sym.ops. of the crystal + ! nsym+1 < irot <= nrot are the sym.ops. of the lattice + ! on exit copy_sym returns nsym + ! + allocate ( irtemp( size(irt,2) ) ) + jrot = 0 + do irot = 1, nrot_ + if (sym (irot) ) then + jrot = jrot + 1 + if ( irot > jrot ) then + stemp = s(:,:,jrot) + s (:,:, jrot) = s (:,:, irot) + s (:,:, irot) = stemp + ftemp(:) = ftau(:,jrot) + ftau (:, jrot) = ftau (:, irot) + ftau (:, irot) = ftemp(:) + ft_(:) = ft(:,jrot) + ft (:, jrot) = ft (:, irot) + ft (:, irot) = ft_(:) + irtemp (:) = irt (jrot,:) + irt (jrot,:) = irt (irot,:) + irt (irot,:) = irtemp (:) + nametemp = sname (jrot) + sname (jrot) = sname (irot) + sname (irot) = nametemp + ttemp = t_rev(jrot) + t_rev(jrot) = t_rev(irot) + t_rev(irot) = ttemp + endif + endif + enddo + sym (1:jrot) = .true. + sym (jrot+1:nrot_) = .false. + deallocate ( irtemp ) + ! + copy_sym = jrot + return + ! +END FUNCTION copy_sym + +! +!----------------------------------------------------------------------- +LOGICAL FUNCTION is_group ( ) + !----------------------------------------------------------------------- + ! + ! Checks that {S} is a group + ! + IMPLICIT NONE + ! + INTEGER :: isym, jsym, ksym, ss (3, 3) + REAL (DP) :: st(3), dt(3) + LOGICAL :: found + ! + DO isym = 1, nsym + DO jsym = 1, nsym + ! + ss = MATMUL (s(:,:,isym),s(:,:,jsym)) + st(:)= ft(:,jsym) + s(1,:,jsym)*ft(1,isym) + & + s(2,:,jsym)*ft(2,isym) + & + s(3,:,jsym)*ft(3,isym) + ! + ! here we check that the input matrices really form a group: + ! S(k) = S(i)*S(j) + ! ftau_k = S(j)*ftau_i+ftau_j (modulo a lattice vector) + ! + found = .false. + DO ksym = 1, nsym + dt(:) = ft(:,ksym) - st(:) - NINT( ft(:,ksym) - st(:) ) + IF ( ALL( s(:,:,ksym) == ss(:,:) ) .AND. & + ( ABS ( dt(1) ) < eps2 ) .AND. & + ( ABS ( dt(2) ) < eps2 ) .AND. & + ( ABS ( dt(3) ) < eps2 ) ) THEN + IF (found) THEN + is_group = .false. + RETURN + END IF + found = .true. + END IF + END DO + IF ( .NOT.found) then + is_group = .false. + RETURN + END IF + END DO + END DO + is_group=.true. + RETURN + ! +END FUNCTION is_group +! +!----------------------------------------------------------------------- +logical function checksym ( irot, nat, ityp, xau, rau, ft_ ) + !----------------------------------------------------------------------- + ! + ! This function receives as input all the atomic positions xau, + ! and the rotated rau by the symmetry operation ir. It returns + ! true if for each atom na, it is possible to find an atom nb + ! which is of the same type of na, and coincide with it after the + ! symmetry operation. Fractional translations are allowed. + ! + implicit none + ! + integer, intent(in) :: nat, ityp (nat), irot + ! nat : number of atoms + ! ityp: the type of each atom + real(DP), intent(in) :: xau (3, nat), rau (3, nat), ft_(3) + ! xau: the initial vectors (in crystal coordinates) + ! rau: the rotated vectors (as above) + ! ft_: fractionary translation (as above) + ! + integer :: na, nb + logical, external :: eqvect + ! the testing function + ! + do na = 1, nat + do nb = 1, nat + checksym = ( ityp (na) == ityp (nb) .and. & + eqvect (rau (1, na), xau (1, nb), ft_) ) + if ( checksym ) then + ! + ! the rotated atom does coincide with one of the like atoms + ! keep track of which atom the rotated atom coincides with + ! + irt (irot, na) = nb + goto 10 + endif + enddo + ! + ! the rotated atom does not coincide with any of the like atoms + ! s(ir) + ft is not a symmetry operation + ! + return +10 continue + enddo + ! + ! s(ir) + ft is a symmetry operation + ! + return +end function checksym +! +!----------------------------------------------------------------------- +subroutine checkallsym ( nat, tau, ityp, nr1, nr2, nr3 ) + !----------------------------------------------------------------------- + ! given a crystal group this routine checks that the actual + ! atomic positions and bravais lattice vectors are compatible with + ! it. Used in relaxation/MD runs to check that atomic motion is + ! consistent with assumed symmetry. + ! + implicit none + ! + integer, intent(in) :: nat, ityp (nat), nr1, nr2, nr3 + real(DP), intent(in) :: tau (3, nat) + ! + integer :: na, kpol, isym, i, j, k, l + logical :: loksym (48) + real(DP) :: sx (3, 3), sy(3,3) + real(DP) , allocatable :: xau(:,:), rau(:,:) + ! + allocate (xau( 3 , nat)) + allocate (rau( 3 , nat)) + ! + ! check that s(i,j, isym) is an orthogonal operation + ! + do isym = 1, nsym + sx = DBLE( s(:,:,isym) ) + sy = matmul ( bg, sx ) + sx = matmul ( sy, transpose(at) ) + ! sx is s in cartesian axis + sy = matmul ( transpose ( sx ), sx ) + ! sy = s*transpose(s) = I + do i = 1, 3 + sy (i,i) = sy (i,i) - 1.0_dp + end do + if (any (abs (sy) > eps1 ) ) & + call errore ('checkallsym', 'not orthogonal operation', isym) + enddo + ! + ! Compute the coordinates of each atom in the basis of the lattice + ! + do na = 1, nat + do kpol = 1, 3 + xau (kpol, na) = bg (1, kpol) * tau (1, na) + & + bg (2, kpol) * tau (2, na) + & + bg (3, kpol) * tau (3, na) + enddo + enddo + ! + ! generate the coordinates of the rotated atoms + ! + do isym = 1, nsym + do na = 1, nat + do kpol = 1, 3 + rau (kpol, na) = s (1, kpol, isym) * xau (1, na) + & + s (2, kpol, isym) * xau (2, na) + & + s (3, kpol, isym) * xau (3, na) + enddo + enddo + ! + loksym(isym) = checksym ( isym, nat, ityp, xau, rau, ft(1,isym) ) + ! + enddo + ! + ! deallocate work space + ! + deallocate(rau) + deallocate(xau) + ! + do isym = 1,nsym + if (.not.loksym (isym) ) call errore ('checkallsym', & + 'the following symmetry operation is not satisfied ', -isym) + end do + if (ANY (.not.loksym (1:nsym) ) ) then + !call symmetrize_at (nsym, s, invs, ft, irt, nat, tau, at, bg, & + ! alat, omega) + call errore ('checkallsym', & + 'some of the original symmetry operations not satisfied ',1) + end if + ! + return +end subroutine checkallsym + +!---------------------------------------------------------------------- +subroutine s_axis_to_cart ( ) + !---------------------------------------------------------------------- + ! + ! This routine transforms symmetry matrices expressed in the + ! basis of the crystal axis into rotations in cartesian axis + ! + USE kinds + implicit none + ! + integer :: isym + real(dp):: sa(3,3), sb(3,3) + ! + do isym = 1,nsym + sa (:,:) = DBLE ( s(:,:,isym) ) + sb = MATMUL ( bg, sa ) + sr (:,:, isym) = MATMUL ( at, TRANSPOSE (sb) ) + enddo + ! + end subroutine s_axis_to_cart + +END MODULE symm_base diff --git a/tests/apps/miniDFT/tests/src/symme.f90 b/tests/apps/miniDFT/tests/src/symme.f90 new file mode 100644 index 0000000000..c33e39e050 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/symme.f90 @@ -0,0 +1,919 @@ +! +! Copyright (C) 2008-2010 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +!-------------------------------------------------------------------------- +! +MODULE symme + + USE kinds, ONLY : DP + USE cell_base, ONLY : at, bg + USE symm_base, ONLY : s, sname, ft, nrot, nsym, t_rev, time_reversal, & + irt, invs, invsym + ! + ! ... Routines used for symmetrization + ! + SAVE + PRIVATE + ! + ! General-purpose symmetrizaton routines + ! + PUBLIC :: symscalar, symvector, symtensor, symmatrix, symv, & + symtensor3, symmatrix3, crys_to_cart, cart_to_crys + ! + ! For symmetrization in reciprocal space (all variables are private) + ! + PUBLIC :: sym_rho_init, sym_rho, sym_rho_deallocate + ! + LOGICAL :: & + no_rho_sym=.true. ! do not perform symetrization of charge density + INTEGER :: ngs ! number of symmetry-related G-vector shells + TYPE shell_type + INTEGER, POINTER :: vect(:) + END TYPE shell_type + ! shell contains a list of symmetry-related G-vectors for each shell + TYPE(shell_type), ALLOCATABLE :: shell(:) + ! Arrays used for parallel symmetrization + INTEGER, ALLOCATABLE :: sendcnt(:), recvcnt(:), sdispls(:), rdispls(:) + ! +CONTAINS + ! + LOGICAL FUNCTION rho_sym_needed ( ) + !----------------------------------------------------------------------- + rho_sym_needed = .NOT. no_rho_sym + END FUNCTION rho_sym_needed + ! + SUBROUTINE symscalar (nat, scalar) + !----------------------------------------------------------------------- + ! Symmetrize a function f(na), na=atom index + ! + IMPLICIT NONE + ! + INTEGER, INTENT(IN) :: nat + REAL(DP), intent(INOUT) :: scalar(nat) + ! + INTEGER :: isym + REAL(DP), ALLOCATABLE :: work (:) + + IF (nsym == 1) RETURN + + ALLOCATE (work(nat)) + work(:) = 0.0_dp + DO isym = 1, nsym + work (:) = work (:) + scalar(irt(isym,:)) + END DO + scalar(:) = work(:) / DBLE(nsym) + DEALLOCATE (work) + + END SUBROUTINE symscalar + ! + SUBROUTINE symvector (nat, vect) + !----------------------------------------------------------------------- + ! Symmetrize a function f(i,na), i=cartesian component, na=atom index + ! e.g. : forces (in cartesian axis) + ! + IMPLICIT NONE + ! + INTEGER, INTENT(IN) :: nat + REAL(DP), intent(INOUT) :: vect(3,nat) + ! + INTEGER :: na, isym, nar + REAL(DP), ALLOCATABLE :: work (:,:) + ! + IF (nsym == 1) RETURN + ! + ALLOCATE (work(3,nat)) + ! + ! bring vector to crystal axis + ! + DO na = 1, nat + work(:,na) = vect(1,na)*at(1,:) + & + vect(2,na)*at(2,:) + & + vect(3,na)*at(3,:) + END DO + ! + ! symmetrize in crystal axis + ! + vect (:,:) = 0.0_dp + DO na = 1, nat + DO isym = 1, nsym + nar = irt (isym, na) + vect (:, na) = vect (:, na) + & + s (:, 1, isym) * work (1, nar) + & + s (:, 2, isym) * work (2, nar) + & + s (:, 3, isym) * work (3, nar) + END DO + END DO + work (:,:) = vect (:,:) / DBLE(nsym) + ! + ! bring vector back to cartesian axis + ! + DO na = 1, nat + vect(:,na) = work(1,na)*bg(:,1) + & + work(2,na)*bg(:,2) + & + work(3,na)*bg(:,3) + END DO + ! + DEALLOCATE (work) + ! + END SUBROUTINE symvector + ! + SUBROUTINE symtensor (nat, tens) + !----------------------------------------------------------------------- + ! Symmetrize a function f(i,j,na), i,j=cartesian components, na=atom index + ! e.g. : effective charges (in cartesian axis) + ! + IMPLICIT NONE + ! + INTEGER, INTENT(IN) :: nat + REAL(DP), intent(INOUT) :: tens(3,3,nat) + ! + INTEGER :: na, isym, nar, i,j,k,l + REAL(DP), ALLOCATABLE :: work (:,:,:) + ! + IF (nsym == 1) RETURN + ! + ! bring tensor to crystal axis + ! + DO na=1,nat + CALL cart_to_crys ( tens (:,:,na) ) + END DO + ! + ! symmetrize in crystal axis + ! + ALLOCATE (work(3,3,nat)) + work (:,:,:) = 0.0_dp + DO na = 1, nat + DO isym = 1, nsym + nar = irt (isym, na) + DO i = 1, 3 + DO j = 1, 3 + DO k = 1, 3 + DO l = 1, 3 + work (i,j,na) = work (i,j,na) + & + s (i,k,isym) * s (j,l,isym) * tens (k,l,nar) + END DO + END DO + END DO + END DO + END DO + END DO + tens (:,:,:) = work (:,:,:) / DBLE(nsym) + DEALLOCATE (work) + ! + ! bring tensor back to cartesian axis + ! + DO na=1,nat + CALL crys_to_cart ( tens (:,:,na) ) + END DO + ! + ! + END SUBROUTINE symtensor + ! + !----------------------------------------------------------------------- + SUBROUTINE symv ( vect) + !-------------------------------------------------------------------- + ! + ! Symmetrize a vector f(i), i=cartesian components + ! The vector is supposed to be axial: inversion does not change it. + ! Time reversal changes its sign. Note that only groups compatible with + ! a finite magnetization give a nonzero output vector. + ! + IMPLICIT NONE + ! + REAL (DP), INTENT(inout) :: vect(3) ! the vector to rotate + ! + integer :: isym + real(DP) :: work (3), segno + ! + IF (nsym == 1) RETURN + ! + ! bring vector to crystal axis + ! + work(:) = vect(1)*at(1,:) + vect(2)*at(2,:) + vect(3)*at(3,:) + vect = work + work=0.0_DP + do isym = 1, nsym + segno=1.0_DP + IF (sname(isym)(1:3)=='inv') segno=-1.0_DP + IF (t_rev(isym)==1) segno=-1.0_DP*segno + work (:) = work (:) + segno * ( & + s (:, 1, isym) * vect (1) + & + s (:, 2, isym) * vect (2) + & + s (:, 3, isym) * vect (3) ) + enddo + work=work/nsym + ! + ! And back in cartesian coordinates. + ! + vect(:) = work(1) * bg(:,1) + work(2) * bg(:,2) + work(3) * bg(:,3) + ! + end subroutine symv + ! + SUBROUTINE symmatrix ( matr ) + !----------------------------------------------------------------------- + ! Symmetrize a function f(i,j), i,j=cartesian components + ! e.g. : stress, dielectric tensor (in cartesian axis) + ! + IMPLICIT NONE + ! + REAL(DP), intent(INOUT) :: matr(3,3) + ! + INTEGER :: isym, i,j,k,l + REAL(DP) :: work (3,3) + ! + IF (nsym == 1) RETURN + ! + ! bring matrix to crystal axis + ! + CALL cart_to_crys ( matr ) + ! + ! symmetrize in crystal axis + ! + work (:,:) = 0.0_dp + DO isym = 1, nsym + DO i = 1, 3 + DO j = 1, 3 + DO k = 1, 3 + DO l = 1, 3 + work (i,j) = work (i,j) + & + s (i,k,isym) * s (j,l,isym) * matr (k,l) + END DO + END DO + END DO + END DO + END DO + matr (:,:) = work (:,:) / DBLE(nsym) + ! + ! bring matrix back to cartesian axis + ! + CALL crys_to_cart ( matr ) + ! + END SUBROUTINE symmatrix + ! + SUBROUTINE symmatrix3 ( mat3 ) + !----------------------------------------------------------------------- + ! + ! Symmetrize a function f(i,j,k), i,j,k=cartesian components + ! e.g. : nonlinear susceptibility + ! BEWARE: input in crystal axis, output in cartesian axis + ! + IMPLICIT NONE + ! + REAL(DP), intent(INOUT) :: mat3(3,3,3) + ! + INTEGER :: isym, i,j,k,l,m,n + REAL(DP) :: work (3,3,3) + ! + IF (nsym == 1) RETURN + ! + work (:,:,:) = 0.0_dp + DO isym = 1, nsym + DO i = 1, 3 + DO j = 1, 3 + DO k = 1, 3 + DO l = 1, 3 + DO m = 1, 3 + DO n = 1, 3 + work (i, j, k) = work (i, j, k) + & + s (i, l, isym) * s (j, m, isym) * & + s (k, n, isym) * mat3 (l, m, n) + END DO + END DO + END DO + END DO + END DO + END DO + END DO + mat3 = work/ DBLE(nsym) + ! + ! Bring to cartesian axis + ! + CALL crys_to_cart_mat3 ( mat3 ) + ! + END SUBROUTINE symmatrix3 + ! + ! + SUBROUTINE symtensor3 (nat, tens3 ) + !----------------------------------------------------------------------- + ! Symmetrize a function f(i,j,k, na), i,j,k=cartesian, na=atom index + ! e.g. : raman tensor + ! BEWARE: input in crystal axis, output in cartesian axis + ! + IMPLICIT NONE + ! + INTEGER, INTENT(IN) :: nat + REAL(DP), intent(INOUT) :: tens3(3,3,3,nat) + ! + INTEGER :: na, isym, nar, i,j,k,l,n,m + REAL(DP), ALLOCATABLE :: work (:,:,:,:) + ! + IF (nsym == 1) RETURN + ! + ! symmetrize in crystal axis + ! + ALLOCATE (work(3,3,3,nat)) + work (:,:,:,:) = 0.0_dp + DO na = 1, nat + DO isym = 1, nsym + nar = irt (isym, na) + DO i = 1, 3 + DO j = 1, 3 + DO k = 1, 3 + DO l = 1, 3 + DO m =1, 3 + DO n =1, 3 + work (i, j, k, na) = work (i, j, k, na) + & + s (i, l, isym) * s (j, m, isym) * & + s (k, n, isym) * tens3 (l, m, n, nar) + END DO + END DO + END DO + END DO + END DO + END DO + END DO + END DO + tens3 (:,:,:,:) = work(:,:,:,:) / DBLE (nsym) + DEALLOCATE (work) + ! + ! Bring to cartesian axis + ! + DO na = 1, nat + CALL crys_to_cart_mat3 ( tens3(:,:,:,na) ) + END DO + ! + END SUBROUTINE symtensor3 + ! + ! Routines for crystal to cartesian axis conversion + ! + !INTERFACE cart_to_crys + ! MODULE PROCEDURE cart_to_crys_mat, cart_to_crys_mat3 + !END INTERFACE + !INTERFACE crys_to_cart + ! MODULE PROCEDURE crys_to_cart + !END INTERFACE + ! + SUBROUTINE cart_to_crys ( matr ) + !----------------------------------------------------------------------- + ! + IMPLICIT NONE + ! + REAL(DP), intent(INOUT) :: matr(3,3) + ! + REAL(DP) :: work(3,3) + INTEGER :: i,j,k,l + ! + work(:,:) = 0.0_dp + DO i = 1, 3 + DO j = 1, 3 + DO k = 1, 3 + DO l = 1, 3 + work(i,j) = work(i,j) + matr(k,l) * at(k,i) * at(l,j) + END DO + END DO + END DO + END DO + ! + matr(:,:) = work(:,:) + ! + END SUBROUTINE cart_to_crys + ! + SUBROUTINE crys_to_cart ( matr ) + !----------------------------------------------------------------------- + ! + IMPLICIT NONE + ! + REAL(DP), intent(INOUT) :: matr(3,3) + ! + REAL(DP) :: work(3,3) + INTEGER :: i,j,k,l + ! + work(:,:) = 0.0_dp + DO i = 1, 3 + DO j = 1, 3 + DO k = 1, 3 + DO l = 1, 3 + work(i,j) = work(i,j) + & + matr(k,l) * bg(i,k) * bg(j,l) + END DO + END DO + END DO + END DO + matr(:,:) = work(:,:) + ! + END SUBROUTINE crys_to_cart + ! + SUBROUTINE crys_to_cart_mat3 ( mat3 ) + !----------------------------------------------------------------------- + ! + IMPLICIT NONE + ! + REAL(DP), intent(INOUT) :: mat3(3,3,3) + ! + REAL(DP) :: work(3,3,3) + INTEGER :: i,j,k,l,m,n + ! + work(:,:,:) = 0.0_dp + DO i = 1, 3 + DO j = 1, 3 + DO k = 1, 3 + DO l = 1, 3 + DO m = 1, 3 + DO n = 1, 3 + work (i, j, k) = work (i, j, k) + & + mat3 (l, m, n) * bg (i, l) * bg (j, m) * bg (k, n) + END DO + END DO + END DO + END DO + END DO + END DO + mat3(:,:,:) = work (:,:,:) + ! + END SUBROUTINE crys_to_cart_mat3 + ! + ! G-space symmetrization + ! + SUBROUTINE sym_rho_init ( gamma_only ) + !----------------------------------------------------------------------- + ! + ! Initialize arrays needed for symmetrization in reciprocal space + ! + USE gvect, ONLY : ngm, g + ! + LOGICAL, INTENT(IN) :: gamma_only + ! + no_rho_sym = gamma_only .OR. (nsym==1) + IF (no_rho_sym) RETURN + CALL sym_rho_init_para ( ) + ! + END SUBROUTINE sym_rho_init + ! + ! + SUBROUTINE sym_rho_init_para ( ) + !----------------------------------------------------------------------- + ! + ! Initialize arrays needed for parallel symmetrization + ! + USE mp_global, ONLY : nproc_bgrp, me_bgrp, intra_bgrp_comm + USE parallel_include + USE gvect, ONLY : ngm, gcutm, g, gg + ! + IMPLICIT NONE + ! + REAL(DP), PARAMETER :: twothirds = 0.6666666666666666_dp + REAL(DP), ALLOCATABLE :: gcut_(:), g_(:,:) + INTEGER :: np, ig, ngloc, ngpos, ierr, ngm_ + ! + ALLOCATE ( sendcnt(nproc_bgrp), recvcnt(nproc_bgrp), & + sdispls(nproc_bgrp), rdispls(nproc_bgrp) ) + ALLOCATE ( gcut_(nproc_bgrp) ) + ! + ! the gcut_ cutoffs are estimated in such a way that there is an similar + ! number of G-vectors in each shell gcut_(i) < G^2 < gcut_(i+1) + ! + DO np = 1, nproc_bgrp + gcut_(np) = gcutm * np**twothirds/nproc_bgrp**twothirds + END DO + ! + ! find the number of G-vectors in each shell (defined as above) + ! beware: will work only if G-vectors are in order of increasing |G| + ! + ngpos=0 + DO np = 1, nproc_bgrp + sdispls(np) = ngpos + ngloc=0 + DO ig=ngpos+1,ngm + IF ( gg(ig) > gcut_(np) ) EXIT + ngloc = ngloc+1 + END DO + ! BMA: I'm fairly convinced this is not an error if triggered by extreme strong-scaling + ! Furthermore, this test assumes the sticks are not load balanced + !IF ( ngloc < 1 ) CALL infomsg('sym_rho_init', & + ! 'likely internal error: no G-vectors found') + sendcnt(np) = ngloc + ngpos = ngpos + ngloc + IF ( ngpos > ngm ) & + CALL errore('sym_rho','internal error: too many G-vectors', ngpos) + END DO + IF ( ngpos /= ngm .OR. ngpos /= SUM (sendcnt)) & + CALL errore('sym_rho_init', & + 'internal error: inconsistent number of G-vectors', ngpos) + DEALLOCATE ( gcut_ ) + ! + ! sendcnt(i) = n_j(i) = number of G-vectors in shell i for processor j (this) + ! sdispls(i) = \sum_{k=1}^i n_j(k) = starting position of shell i for proc j + ! we need the number and positions of G-vector shells for other processors + ! + CALL mpi_alltoall( sendcnt, 1, MPI_INTEGER, recvcnt, 1, MPI_INTEGER, & + intra_bgrp_comm, ierr) + ! + rdispls(1) = 0 + DO np = 2, nproc_bgrp + rdispls(np) = rdispls(np-1)+ recvcnt(np-1) + END DO + ! + ! recvcnt(i) = n_i(j) = number of G-vectors in shell j for processor i + ! rdispls(i) = \sum_{k=1}^i n_k(j) = start.pos. of shell j for proc i + ! + ! now collect G-vector shells on each processor + ! + ngm_ = SUM(recvcnt) + ALLOCATE (g_(3,ngm_)) + ! remember that G-vectors have 3 components + sendcnt(:) = 3*sendcnt(:) + recvcnt(:) = 3*recvcnt(:) + sdispls(:) = 3*sdispls(:) + rdispls(:) = 3*rdispls(:) + CALL mpi_alltoallv ( g , sendcnt, sdispls, MPI_DOUBLE_PRECISION, & + g_, recvcnt, rdispls, MPI_DOUBLE_PRECISION, & + intra_bgrp_comm, ierr) + sendcnt(:) = sendcnt(:)/3 + recvcnt(:) = recvcnt(:)/3 + sdispls(:) = sdispls(:)/3 + rdispls(:) = rdispls(:)/3 + ! + ! find shells of symmetry-related G-vectors + ! + CALL sym_rho_init_shells( ngm_, g_ ) + ! + DEALLOCATE (g_) + ! + END SUBROUTINE sym_rho_init_para + ! + ! + SUBROUTINE sym_rho_init_shells ( ngm_, g_ ) + !----------------------------------------------------------------------- + ! + ! Initialize G-vector shells needed for symmetrization + ! + USE constants, ONLY : eps8 + USE mp_global, ONLY : nproc_bgrp + IMPLICIT NONE + ! + INTEGER, INTENT(IN) :: ngm_ + REAL(DP), INTENT(IN) :: g_(3,ngm_) + ! + LOGICAL, ALLOCATABLE :: done(:) + INTEGER, ALLOCATABLE :: n(:,:), igsort(:) + REAL(DP), ALLOCATABLE :: g2sort_g(:) + INTEGER :: i,j,is,ig, iig, jg, ng, sn(3), gshell(3,48) + LOGICAL :: found + ! + ngs = 0 + ! shell should be allocated to the number of symmetry shells + ! since this is unknown, we use the number of all G-vectors + ALLOCATE ( shell(ngm_) ) + ALLOCATE ( done(ngm_), n(3,ngm_) ) + ALLOCATE ( igsort (ngm_)) + DO ig=1,ngm_ + ! + done(ig) = .false. + ! G-vectors are stored as integer indices in crystallographic axis: + ! G = n(1)*at(1) + n(2)*at(2) + n(3)*at(3) + n(:,ig) = nint ( at(1,:)*g_(1,ig) + at(2,:)*g_(2,ig) + at(3,:)*g_(3,ig) ) + ! + NULLIFY(shell(ig)%vect) + ! + END DO +! +! The following algorithm can become very slow if ngm_ is large and +! g vectors are not ordered in increasing order. This happens +! in the parallel case. +! + IF (nproc_bgrp > 1 .AND. ngm_ > 20000) THEN + ALLOCATE ( g2sort_g(ngm_)) + g2sort_g(:)=g_(1,:)*g_(1,:)+g_(2,:)*g_(2,:)+g_(3,:)*g_(3,:) + igsort(1) = 0 + CALL hpsort_eps( ngm_, g2sort_g, igsort, eps8 ) + DEALLOCATE( g2sort_g) + ELSE + DO ig=1,ngm_ + igsort(ig)=ig + ENDDO + ENDIF + ! + DO iig=1,ngm_ + ! + ig=igsort(iig) + IF ( done(ig) ) CYCLE + ! + ! we start a new shell of symmetry-equivalent G-vectors + ngs = ngs+1 + ! ng: counter on G-vectors in this shell + ng = 0 + DO is=1,nsym + ! integer indices for rotated G-vector + sn(:)=s(:,1,is)*n(1,ig)+s(:,2,is)*n(2,ig)+s(:,3,is)*n(3,ig) + found = .false. + ! check if this rotated G-vector is equivalent to any other + ! vector already present in this shell +shelloop: DO i=1,ng + found = ( sn(1)==gshell(1,i) .and. & + sn(2)==gshell(2,i) .and. & + sn(3)==gshell(3,i) ) + if (found) exit shelloop + END DO shelloop + IF ( .not. found ) THEN + ! add rotated G-vector to this shell + ng = ng + 1 + IF (ng > 48) CALL errore('sym_rho_init_shell','internal error',48) + gshell(:,ng) = sn(:) + END IF + END DO + ! there are ng vectors gshell in shell ngs + ! now we have to locate them in the list of G-vectors + ALLOCATE ( shell(ngs)%vect(ng)) + DO i=1,ng +gloop: DO jg=iig,ngm_ + j=igsort(jg) + IF (done(j)) CYCLE gloop + found = ( gshell(1,i)==n(1,j) .and. & + gshell(2,i)==n(2,j) .and. & + gshell(3,i)==n(3,j) ) + IF ( found ) THEN + done(j)=.true. + shell(ngs)%vect(i) = j + EXIT gloop + END IF + END DO gloop + IF (.not. found) CALL errore('sym_rho_init_shell','lone vector',i) + END DO + ! + END DO + DEALLOCATE ( n, done ) + DEALLOCATE( igsort) + + END SUBROUTINE sym_rho_init_shells + ! + !----------------------------------------------------------------------- + SUBROUTINE sym_rho (nspin, rhog) + !----------------------------------------------------------------------- + ! + ! Symmetrize the charge density rho in reciprocal space + ! Distributed parallel algorithm: collects entire shells of G-vectors + ! and corresponding rho(G), calls sym_rho_serial to perform the + ! symmetrization, re-distributed rho(G) into original ordering + ! rhog(ngm,nspin) components of rho: rhog(ig) = rho(G(:,ig)) + ! unsymmetrized on input, symmetrized on output + ! nspin=1,2,4 unpolarized, LSDA, non-colinear magnetism + ! + USE constants, ONLY : eps8, eps6 + USE gvect, ONLY : ngm, g + USE parallel_include + USE mp_global, ONLY : intra_bgrp_comm + ! + IMPLICIT NONE + ! + INTEGER, INTENT(IN) :: nspin + COMPLEX(DP), INTENT(INOUT) :: rhog(ngm,nspin) + ! + REAL(DP), allocatable :: g0(:,:), g_(:,:), gg_(:) + REAL(DP) :: gg0_, gg1_ + COMPLEX(DP), allocatable :: rhog_(:,:) + INTEGER :: is, ig, igl, np, ierr, ngm_ + ! + IF ( no_rho_sym) RETURN + ! + ! we transpose the matrix of G-vectors and their coefficients + ! + ngm_ = SUM(recvcnt) + ALLOCATE (rhog_(ngm_,nspin),g_(3,ngm_)) + DO is=1,nspin + CALL mpi_alltoallv (rhog (1,is) , sendcnt, sdispls, MPI_DOUBLE_COMPLEX,& + rhog_(1,is), recvcnt, rdispls, MPI_DOUBLE_COMPLEX, & + intra_bgrp_comm, ierr) + END DO + ! remember that G-vectors have 3 components + sendcnt(:) = 3*sendcnt(:) + recvcnt(:) = 3*recvcnt(:) + sdispls(:) = 3*sdispls(:) + rdispls(:) = 3*rdispls(:) + CALL mpi_alltoallv ( g , sendcnt, sdispls, MPI_DOUBLE_PRECISION, & + g_, recvcnt, rdispls, MPI_DOUBLE_PRECISION, & + intra_bgrp_comm, ierr) + ! + ! Now symmetrize + ! + CALL sym_rho_serial ( ngm_, g_, nspin, rhog_ ) + ! + DEALLOCATE ( g_ ) + ! + ! bring symmetrized rho(G) back to original distributed form + ! + sendcnt(:) = sendcnt(:)/3 + recvcnt(:) = recvcnt(:)/3 + sdispls(:) = sdispls(:)/3 + rdispls(:) = rdispls(:)/3 + DO is = 1, nspin + CALL mpi_alltoallv (rhog_(1,is), recvcnt, rdispls, MPI_DOUBLE_COMPLEX, & + rhog (1,is), sendcnt, sdispls, MPI_DOUBLE_COMPLEX, & + intra_bgrp_comm, ierr) + END DO + DEALLOCATE ( rhog_ ) + ! + RETURN + END SUBROUTINE sym_rho + ! + !----------------------------------------------------------------------- + SUBROUTINE sym_rho_serial ( ngm_, g_, nspin_, rhog_ ) + !----------------------------------------------------------------------- + ! + ! symmetrize the charge density rho in reciprocal space + ! Serial algorithm - requires in input: + ! g_(3,ngm_) list of G-vectors + ! nspin_ number of spin components to be symmetrized + ! rhog_(ngm_,nspin_) rho in reciprocal space: rhog_(ig) = rho(G(:,ig)) + ! unsymmetrized on input, symmetrized on output + ! + USE kinds + USE constants, ONLY : tpi + ! + IMPLICIT NONE + ! + INTEGER, INTENT (IN) :: ngm_, nspin_ + REAL(DP) , INTENT (IN) :: g_( 3, ngm_ ) + COMPLEX(DP) , INTENT (INOUT) :: rhog_( ngm_, nspin_ ) + ! + REAL(DP), ALLOCATABLE :: g0(:,:) + REAL(DP) :: sg(3), ft_(3,48), arg + COMPLEX(DP) :: fact, rhosum(2), mag(3), magrot(3), magsum(3) + INTEGER :: irot(48), ig, isg, igl, ng, ns, nspin_lsda, is + LOGICAL, ALLOCATABLE :: done(:) + LOGICAL :: non_symmorphic(48) + ! + ! convert fractional translations to cartesian, in a0 units + ! + DO ns=1,nsym + non_symmorphic(ns) = ( ft(1,ns) /= 0.0_dp .OR. & + ft(2,ns) /= 0.0_dp .OR. & + ft(3,ns) /= 0.0_dp ) + IF ( non_symmorphic(ns) ) ft_(:,ns) = at(:,1)*ft(1,ns) + & + at(:,2)*ft(2,ns) + & + at(:,3)*ft(3,ns) + END DO + ! + IF ( nspin_ == 4 ) THEN + nspin_lsda = 1 + ! + ELSE IF ( nspin_ == 1 .OR. nspin_ == 2 ) THEN + nspin_lsda = nspin_ + ELSE + CALL errore('sym_rho_serial','incorrect value of nspin',nspin_) + END IF + ! + ! scan shells of G-vectors + ! + DO igl=1, ngs + ! + ! symmetrize: \rho_sym(G) = \sum_S rho(SG) for all G-vectors in the star + ! + ng = SIZE ( shell(igl)%vect ) + allocate ( g0(3,ng), done(ng) ) + IF ( ng < 1 ) CALL errore('sym_rho_serial','internal error',1) + ! + ! bring G-vectors to crystal axis + ! + DO ig=1,ng + g0(:,ig) = g_(:,shell(igl)%vect(ig) ) + END DO + CALL cryst_to_cart (ng, g0, at,-1) + ! + ! rotate G-vectors + ! + done(1:ng) = .false. + DO ig=1,ng + IF ( .NOT. done(ig)) THEN + rhosum(:) = (0.0_dp, 0.0_dp) + magsum(:) = (0.0_dp, 0.0_dp) + ! S^{-1} are needed here + DO ns=1,nsym + + sg(:) = s(:,1,invs(ns)) * g0(1,ig) + & + s(:,2,invs(ns)) * g0(2,ig) + & + s(:,3,invs(ns)) * g0(3,ig) + irot(ns) = 0 + DO isg=1,ng + IF ( ABS ( sg(1)-g0(1,isg) ) < 1.0D-5 .AND. & + ABS ( sg(2)-g0(2,isg) ) < 1.0D-5 .AND. & + ABS ( sg(3)-g0(3,isg) ) < 1.0D-5 ) THEN + irot(ns) = isg + EXIT + END IF + END DO + IF ( irot(ns) < 1 .OR. irot(ns) > ng ) & + CALL errore('sym_rho_serial','internal error',2) + ! isg is the index of rotated G-vector + isg = shell(igl)%vect(irot(ns)) + ! + ! non-spin-polarized case: component 1 is the charge + ! LSDA case: components 1,2 are spin-up and spin-down charge + ! non colinear case: component 1 is the charge density, + ! components 2,3,4 are the magnetization + ! non colinear case: components 2,3,4 are the magnetization + ! + IF ( nspin_ == 4 ) THEN + ! bring magnetization to crystal axis + mag(:) = rhog_(isg, 2) * bg(1,:) + & + rhog_(isg, 3) * bg(2,:) + & + rhog_(isg, 4) * bg(3,:) + ! rotate and add magnetization + magrot(:) = s(1,:,invs(ns)) * mag(1) + & + s(2,:,invs(ns)) * mag(2) + & + s(3,:,invs(ns)) * mag(3) + IF (sname(invs(ns))(1:3)=='inv') magrot(:)=-magrot(:) + IF (t_rev(invs(ns)) == 1) magrot(:)=-magrot(:) + END IF + IF ( non_symmorphic (ns) ) THEN + arg = tpi * ( g_(1,isg) * ft_(1,ns) + & + g_(2,isg) * ft_(2,ns) + & + g_(3,isg) * ft_(3,ns) ) + fact = CMPLX ( COS(arg), -SIN(arg), KIND=dp ) + DO is=1,nspin_lsda + rhosum(is) = rhosum(is) + rhog_(isg, is) * fact + END DO + IF ( nspin_ == 4 ) & + magsum(:) = magsum(:) + magrot(:) * fact + ELSE + DO is=1,nspin_lsda + rhosum(is) = rhosum(is) + rhog_(isg, is) + END DO + IF ( nspin_ == 4 ) & + magsum(:) = magsum(:) + magrot(:) + END IF + END DO + ! + DO is=1,nspin_lsda + rhosum(is) = rhosum(is) / nsym + END DO + IF ( nspin_ == 4 ) magsum(:) = magsum(:) / nsym + ! + ! now fill the shell of G-vectors with the symmetrized value + ! + DO ns=1,nsym + isg = shell(igl)%vect(irot(ns)) + IF ( nspin_ == 4 ) THEN + ! rotate magnetization + magrot(:) = s(1,:,ns) * magsum(1) + & + s(2,:,ns) * magsum(2) + & + s(3,:,ns) * magsum(3) + IF (sname(ns)(1:3)=='inv') magrot(:)=-magrot(:) + IF (t_rev(ns) == 1) magrot(:)=-magrot(:) + ! back to cartesian coordinates + mag(:) = magrot(1) * at(:,1) + & + magrot(2) * at(:,2) + & + magrot(3) * at(:,3) + END IF + IF ( non_symmorphic (ns) ) THEN + arg = tpi * ( g_(1,isg) * ft_(1,ns) + & + g_(2,isg) * ft_(2,ns) + & + g_(3,isg) * ft_(3,ns) ) + fact = CMPLX ( COS(arg), SIN(arg), KIND=dp ) + DO is=1,nspin_lsda + rhog_(isg,is) = rhosum(is) * fact + END DO + IF ( nspin_ == 4 ) THEN + DO is=2,nspin_ + rhog_(isg, is) = mag(is-1)*fact + END DO + END IF + ELSE + DO is=1,nspin_lsda + rhog_(isg,is) = rhosum(is) + END DO + IF ( nspin_ == 4 ) THEN + DO is=2,nspin_ + rhog_(isg, is) = mag(is-1) + END DO + END IF + END IF + done(irot(ns)) =.true. + END DO + END IF + END DO + DEALLOCATE ( done, g0 ) + END DO + ! + RETURN + END SUBROUTINE sym_rho_serial + + SUBROUTINE sym_rho_deallocate ( ) + ! + IF ( ALLOCATED (rdispls) ) DEALLOCATE (rdispls) + IF ( ALLOCATED (recvcnt) ) DEALLOCATE (recvcnt) + IF ( ALLOCATED (sdispls) ) DEALLOCATE (sdispls) + IF ( ALLOCATED (sendcnt) ) DEALLOCATE (sendcnt) + IF ( ALLOCATED (shell) ) THEN + DO i=1,SIZE(shell) + IF ( ASSOCIATED(shell(i)%vect) ) DEALLOCATE (shell(i)%vect) + END DO + DEALLOCATE (shell) + END IF + ! + END SUBROUTINE sym_rho_deallocate + ! +END MODULE symme diff --git a/tests/apps/miniDFT/tests/src/trimcheck.f90 b/tests/apps/miniDFT/tests/src/trimcheck.f90 new file mode 100644 index 0000000000..c829388f21 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/trimcheck.f90 @@ -0,0 +1,38 @@ +! +! Copyright (C) 2002-2009 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! + !----------------------------------------------------------------------- + FUNCTION trimcheck ( directory ) + !----------------------------------------------------------------------- + ! + ! ... verify if directory ends with /, add one if needed; + ! ... trim white spaces and put the result in trimcheck + ! + IMPLICIT NONE + ! + CHARACTER (LEN=*), INTENT(IN) :: directory + CHARACTER (LEN=256) :: trimcheck + INTEGER :: l + ! + l = LEN_TRIM( directory ) + IF ( l == 0 ) CALL errore( 'trimcheck', ' input name empty', 1) + ! + IF ( directory(l:l) == '/' ) THEN + trimcheck = TRIM ( directory) + ELSE + IF ( l < LEN( trimcheck ) ) THEN + trimcheck = TRIM ( directory ) // '/' + ELSE + CALL errore( 'trimcheck', ' input name too long', l ) + END IF + END IF + ! + RETURN + ! + END FUNCTION trimcheck + ! diff --git a/tests/apps/miniDFT/tests/src/upf.f90 b/tests/apps/miniDFT/tests/src/upf.f90 new file mode 100644 index 0000000000..564a9c5ad7 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/upf.f90 @@ -0,0 +1,71 @@ +! Copyright (C) 2008 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +!=----------------------------------------------------------------------------=! + MODULE upf_module +!=----------------------------------------------------------------------------=! +! this module handles reading and writing of unified pseudopotential format (UPF) +! it can manage v2 read/write and v1 read only. +! +! A macro to trim both from left and right +#define TRIM(a) trim(adjustl(a)) + ! + USE kinds, ONLY: DP + USE pseudo_types, ONLY: pseudo_upf, deallocate_pseudo_upf + ! + IMPLICIT NONE + PUBLIC + ! + CONTAINS + +!------------------------------------------------+ +SUBROUTINE read_upf(upf, grid, ierr, unit, filename) ! + !---------------------------------------------+ + ! Read pseudopotential in UPF format (either v.1 or v.2) + ! ierr = -1 : read UPF v.1 + ! ierr = 0 : read UPF v.2 + ! ierr = 1 : not an UPF file, or error while reading + ! + USE radial_grids, ONLY: radial_grid_type, deallocate_radial_grid + use upf_nml, only: upf_nml_read + IMPLICIT NONE + INTEGER,INTENT(IN),OPTIONAL :: unit ! i/o unit + CHARACTER(len=*),INTENT(IN),OPTIONAL :: filename ! i/o filename + TYPE(pseudo_upf),INTENT(INOUT) :: upf ! the pseudo data + TYPE(radial_grid_type),OPTIONAL,INTENT(INOUT),TARGET :: grid + INTEGER,INTENT(OUT) :: ierr + ! + INTEGER :: u ! i/o unit + + ierr = 0 + + IF(.not. present(unit)) THEN + IF (.not. present(filename)) & + CALL errore('read_upf',& + 'You have to specify at least one between filename and unit',1) + ELSE + u = unit + ENDIF + ! + !call infomsg( "upf.f90:59", "replacing read_upf_v2 with upf_nml_read to avoit iotk" ) + IF( present(filename) ) & + open( unit=u, file=trim(filename), status='old', delim='APOSTROPHE', iostat=ierr ) + IF(ierr>0) CALL errore('read_upf', 'Cannot open file: '//TRIM(filename),1) + call upf_nml_read( u, upf, grid, ierr ) + close( u, status='keep' ) + ! + + RETURN + +END SUBROUTINE read_upf + + + +!=----------------------------------------------------------------------------=! + END MODULE upf_module +!=----------------------------------------------------------------------------=! +#undef TRIM + diff --git a/tests/apps/miniDFT/tests/src/upf_nml.f90 b/tests/apps/miniDFT/tests/src/upf_nml.f90 new file mode 100644 index 0000000000..b0574d0bae --- /dev/null +++ b/tests/apps/miniDFT/tests/src/upf_nml.f90 @@ -0,0 +1,342 @@ +! +! Copyright (C) 2002-2008 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +MODULE upf_nml + + USE kinds, ONLY: DP + use radial_grids, ONLY: radial_grid_type + + IMPLICIT NONE + SAVE + + integer, parameter :: nmesh_max = 2000 + integer, parameter :: nbeta_max = 5 + integer, parameter :: nwfc_max = 5 + + CHARACTER(LEN=80):: generated=' '! generator software + CHARACTER(LEN=80):: author=' ' ! pseudopotential's author + CHARACTER(LEN=80):: date=' ' ! generation date + CHARACTER(LEN=80):: comment=' ' ! author's comment + CHARACTER(LEN=2) :: psd=' ' ! Element label + CHARACTER(LEN=20) :: typ=' ' ! Pseudo type ( NC or US or PAW) + CHARACTER(len=6) :: rel=' ' ! relativistic: {no|scalar|full} + LOGICAL :: tvanp ! .true. if Ultrasoft + LOGICAL :: tcoulombp ! .true. if Coulomb 1/r potential + LOGICAL :: nlcc ! Non linear core corrections + CHARACTER(LEN=25) :: dft ! Exch-Corr type + REAL(DP) :: zp ! z valence + REAL(DP) :: etotps ! total energy + REAL(DP) :: ecutwfc ! suggested cut-off for wfc + REAL(DP) :: ecutrho ! suggested cut-off for rho + ! + CHARACTER(len=11) :: nv ! UPF file three-digit version i.e. 2.0.0 + INTEGER :: lmax ! maximum l component in beta + INTEGER :: lmax_rho ! max l component in charge (should be 2*lmax) + + ! only for single-channel NC PP + ! Wavefunctions and projectors + INTEGER :: nwfc ! number of atomic wavefunctions + INTEGER :: nbeta ! number of projectors + INTEGER :: kbeta( nbeta_max ) ! kbeta(nbeta) see below + ! kbeta<=mesh is the number of grid points for each beta function + ! beta(r,nb) = 0 for r > r(kbeta(nb)) + + INTEGER :: lll( nbeta_max ) ! lll(nbeta) l of each projector + REAL(DP) :: beta( nmesh_max, nbeta_max) ! beta(mesh,nbeta) projectors + ! + CHARACTER(LEN=2) :: els( nwfc_max ) ! els(nwfc) label of wfc + CHARACTER(LEN=2) :: els_beta( nbeta_max) ! els(nbeta) label of beta + INTEGER :: nchi( nwfc_max ) ! lchi(nwfc) value of pseudo-n for wavefcts + INTEGER :: lchi( nwfc_max ) ! lchi(nwfc) value of l for wavefcts + REAL(DP) :: oc( nwfc_max ) ! oc(nwfc) occupancies for wavefcts + REAL(DP) :: epseu( nwfc_max ) ! pseudo one-particle energy (nwfc) + REAL(DP) :: rcut_chi( nwfc_max )! rcut_chi(nwfc) cutoff inner radius + REAL(DP) :: rcutus_chi( nwfc_max )! rcutus_chi(nwfc) ultrasoft outerradius + ! Chi and rho_at are only used for initial density and initial wfcs: + REAL(DP) :: chi(nmesh_max,nwfc_max) ! chi(mesh,nwfc) atomic wavefcts + REAL(DP) :: rho_at(nmesh_max) ! rho_at(mesh) atomic charge + ! Minimal radial grid: + INTEGER :: nmesh ! number of points in the radial mesh + REAL(DP) :: xmin ! the minimum x of the linear mesh + REAL(DP) :: rmax ! the maximum radius of the mesh + REAL(DP) :: zmesh ! the nuclear charge used for mesh + REAL(DP) :: dx ! the deltax of the linear mesh + REAL(DP) :: r(nmesh_max) ! r(mesh) radial grid + REAL(DP) :: rab(nmesh_max) ! rab(mesh) dr(x)/dx (x=linear grid) + ! Pseudized core charge + REAL(DP) :: rho_atc(nmesh_max) ! rho_atc(mesh) atomic core charge + ! Local potential + INTEGER :: lloc ! L of channel used to generate local potential + ! (if < 0 it was generated by smoothing AE potential) + REAL(DP) :: rcloc ! vloc = v_ae for r > rcloc + REAL(DP) :: vloc(nmesh_max) ! vloc(mesh) local atomic potential + ! + REAL(DP) :: dion(nbeta_max *nbeta_max) !dion(nbeta,nbeta) atomic D_{mu,nu} + + LOGICAL :: has_wfc ! if true, UPF contain AE and PS wfc for each beta + + LOGICAL :: has_so ! if .true. includes spin-orbit + REAL(DP) :: rcut(nbeta_max) ! cut-off radius(nbeta) + REAL(DP) :: rcutus(nbeta_max)! ultrasoft cut-off radius (nbeta) + + ! PAW: + LOGICAL :: tpawp ! true if atom is PAW, PAW data must be present + + ! GIPAW: + LOGICAL :: has_gipaw ! Whether GIPAW data is included + +contains + +subroutine upf_nml_read( iunps, upf, grid, ierr ) + + !use upf_nml + use pseudo_types, only: pseudo_upf + implicit none + + integer, intent(in) :: iunps + type( pseudo_upf ), intent(inout) :: upf + type( radial_grid_type ), intent(inout), target :: grid + integer, intent(out) :: ierr + + namelist /header/ & + generated, author, date, comment, psd, typ, rel, tvanp, tpawp, tcoulombp, & + has_so, has_wfc, has_gipaw, nlcc, dft, zp, etotps, ecutwfc, ecutrho, nv, & + lmax, lmax_rho, lloc, nmesh, nwfc, nbeta + + namelist /mesh/ dx, nmesh, xmin, rmax, zmesh, r, rab + + namelist /nlcc_rho/ rho_atc + + namelist /local/ vloc + + namelist /nonlocal/ els_beta, lll, kbeta, rcut, rcutus, beta, dion + + namelist /pswfc/ els, lchi, oc, nchi, epseu, rcut_chi, rcutus_chi, chi + + namelist /rhoatom/ rho_at + + !open( unit=iunps, file=trim(fname), status='old', delim='APOSTROPHE', iostat=ierr ) + + read( iunps, nml=header ) + + read( iunps, nml=mesh ) + + if( nlcc ) read( iunps, nml=nlcc_rho ) + + read( iunps, nml=local ) + + read( iunps, nml=nonlocal ) + + read( iunps, nml=pswfc ) + + read( iunps, nml=rhoatom ) + + !close( iunps, status='keep' ) + + !copy the upf_nml module to the upf data_structure + call upf_nml_copy( upf, grid ) + + return +end subroutine upf_nml_read + +subroutine upf_nml_copy( upf, grid ) + + !use upf_nml + use pseudo_types, only: pseudo_upf + use radial_grids, only: radial_grid_type, allocate_radial_grid + implicit none + + type( pseudo_upf ), intent(inout) :: upf + type(radial_grid_type), intent(inout), target :: grid + + integer :: nb, nw + + !nullify elements of the upf that are not used by mini_DFT + nullify(upf%vnl) + upf%q_with_l = .false. + upf%nqf = 0 + upf%nqlc = 0 + upf%qqq_eps = 0.0_dp + nullify( upf%rinner ) + nullify( upf%qqq ) + nullify( upf%qfunc ) + nullify( upf%qfuncl ) + nullify( upf%qfcoef ) + nullify( upf%aewfc ) + nullify( upf%pswfc ) + nullify( upf%nn ) + nullify( upf%jchi ) + nullify( upf%jjj ) + upf%paw_data_format = 0 + !upf%paw + upf%paw_as_gipaw = .false. + upf%gipaw_data_format = 0 + upf%gipaw_ncore_orbitals = 0 + nullify( upf%gipaw_core_orbital_n ) + nullify( upf%gipaw_core_orbital_l ) + nullify( upf%gipaw_core_orbital_el ) + nullify( upf%gipaw_core_orbital ) + nullify( upf%gipaw_vlocal_ae ) + nullify( upf%gipaw_vlocal_ps ) + upf%gipaw_wfs_nchannels = 0 + nullify( upf%gipaw_wfs_el ) + nullify( upf%gipaw_wfs_ll ) + nullify( upf%gipaw_wfs_ae ) + nullify( upf%gipaw_wfs_rcut ) + nullify( upf%gipaw_wfs_rcutus ) + nullify( upf%gipaw_wfs_ps ) + + !copy data from the upf_nml module to the upf structure + upf%nv = nv + upf%generated = generated + upf%author = author + upf%date = date + upf%comment = comment + + upf%psd = psd + upf%typ = typ + upf%rel = rel + + upf%tvanp = tvanp + upf%tpawp = tpawp + upf%tcoulombp = tcoulombp + + upf%has_so = has_so + upf%has_wfc = has_wfc + upf%has_gipaw = has_gipaw + !upf%paw_as_gipaw = paw_as_gipaw + + upf%nlcc = nlcc + upf%dft = dft + upf%zp = zp + upf%etotps = etotps + upf%ecutwfc = ecutwfc + upf%ecutrho = ecutrho + upf%lmax = lmax + upf%lmax_rho = lmax_rho + upf%lloc = lloc + upf%mesh = nmesh + upf%nwfc = nwfc + upf%nbeta = nbeta + + upf%dx = dx + upf%mesh = nmesh + upf%xmin = xmin + upf%rmax = rmax + upf%zmesh = zmesh + + CALL allocate_radial_grid(grid, upf%mesh) + grid%dx = upf%dx + grid%mesh = upf%mesh + grid%xmin = upf%xmin + grid%rmax = upf%rmax + grid%zmesh = upf%zmesh + upf%grid => grid + upf%r => upf%grid%r + upf%rab => upf%grid%rab + + upf%r(1:upf%mesh) = r(1:upf%mesh) + upf%rab(1:upf%mesh) = rab(1:upf%mesh) + + ! Reconstruct additional grids + upf%grid%r2 = upf%r**2 + upf%grid%sqr = sqrt(upf%r) + upf%grid%rm1 = upf%r**(-1) + upf%grid%rm2 = upf%r**(-2) + upf%grid%rm3 = upf%r**(-3) + + !allocate and initialized core density; initialize to zero if .not.nlcc + allocate( upf%rho_atc( upf%mesh) ) + upf%rho_atc(1:upf%mesh) = 0._dp + if( upf%nlcc ) upf%rho_atc(1:upf%mesh) = rho_atc(1:upf%mesh) + + !allocate and initialize local potential + if( .not. upf%tcoulombp ) then + allocate( upf%vloc(upf%mesh) ) + upf%vloc(1:upf%mesh) = vloc(1:upf%mesh) + end if + + !allocate and initialize nonlocal potential + if( upf%tcoulombp ) upf%nbeta = 0 + IF ( upf%nbeta == 0) then + + !dummy allocation for local-only pp + upf%nqf = 0 + upf%nqlc= 0 + upf%qqq_eps= -1._dp + upf%kkbeta = 0 + ALLOCATE( upf%kbeta(1), & + upf%lll(1), & + upf%beta(upf%mesh,1), & + upf%dion(1,1), & + upf%rinner(1), & + upf%qqq(1,1), & + upf%qfunc(upf%mesh,1),& + upf%qfcoef(1,1,1,1), & + upf%rcut(1), & + upf%rcutus(1), & + upf%els_beta(1) ) + + ELSE + + !allocate space for non-local part + ALLOCATE( upf%kbeta(upf%nbeta), & + upf%lll(upf%nbeta), & + upf%beta(upf%mesh, upf%nbeta), & + upf%dion(upf%nbeta, upf%nbeta),& + upf%rcut(upf%nbeta), & + upf%rcutus(upf%nbeta), & + upf%els_beta(upf%nbeta) ) + + !read the projectors + do nb=1, upf%nbeta + + upf%beta(1:upf%mesh,nb) = beta(1:upf%mesh,nb) + upf%els_beta(nb) = els_beta(nb) + upf%lll(nb) = lll(nb) + upf%kbeta(nb) = kbeta(nb) + upf%rcut(nb) = rcut(nb) + upf%rcutus(nb) = rcutus(nb) + + end do + + upf%dion(:,:) = reshape( dion, (/ upf%nbeta, upf%nbeta /) ) + + upf%kkbeta = maxval( upf%kbeta(1:upf%nbeta) ) + + END IF + + !allocate and initialize chi functions + ALLOCATE( upf%chi(upf%mesh,upf%nwfc) ) + ALLOCATE( upf%els(upf%nwfc), & + upf%oc(upf%nwfc), & + upf%lchi(upf%nwfc), & + upf%nchi(upf%nwfc), & + upf%rcut_chi(upf%nwfc), & + upf%rcutus_chi(upf%nwfc), & + upf%epseu(upf%nwfc) ) + + DO nw=1, upf%nwfc + upf%chi(1:upf%mesh, nw) = chi(1:upf%mesh,nw) + upf%els(nw) = els(nw) + upf%lchi(nw) = lchi(nw) + upf%oc(nw) = oc(nw) + upf%nchi(nw) = nchi(nw) + upf%epseu(nw) = epseu(nw) + upf%rcut_chi(nw) = rcut_chi(nw) + upf%rcutus_chi(nw) = rcutus_chi(nw) + ENDDO + + !allocate and initialize atomic density + allocate( upf%rho_at( upf%mesh ) ) + upf%rho_at(1:upf%mesh) = rho_at(1:upf%mesh) + +end subroutine upf_nml_copy + + +END MODULE upf_nml + diff --git a/tests/apps/miniDFT/tests/src/upf_to_internal.f90 b/tests/apps/miniDFT/tests/src/upf_to_internal.f90 new file mode 100644 index 0000000000..79a935595b --- /dev/null +++ b/tests/apps/miniDFT/tests/src/upf_to_internal.f90 @@ -0,0 +1,77 @@ +! +! Copyright (C) 2004-2007 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! This module is USEd, for the time being, as an interface +! between the UPF pseudo type and the pseudo variables internal representation + +!=----------------------------------------------------------------------------=! + MODULE upf_to_internal +!=----------------------------------------------------------------------------=! + + IMPLICIT NONE + PRIVATE + PUBLIC :: set_pseudo_upf + SAVE + +!=----------------------------------------------------------------------------=! + CONTAINS +!=----------------------------------------------------------------------------=! +! +!--------------------------------------------------------------------- +subroutine set_pseudo_upf (is, upf, grid) + !--------------------------------------------------------------------- + ! + ! set "is"-th pseudopotential using the Unified Pseudopotential Format + ! "upf" - convert and copy to internal variables + ! If "grid" is present, reconstruct radial grid. + ! Obsolescent - for old-style PP formats only. + ! + USE funct, ONLY: set_dft_from_name, set_dft_from_indices + ! + USE pseudo_types + USE radial_grids, ONLY: radial_grid_type, allocate_radial_grid + ! + implicit none + ! + INTEGER :: is + TYPE (pseudo_upf) :: upf + TYPE (radial_grid_type), target, optional :: grid + ! + ! Local variables + ! + integer :: iexch,icorr,igcx,igcc + ! + ! old formats never contain "1/r" pseudopotentials + ! + upf%tcoulombp = .false. + ! + ! workaround for rrkj format - it contains the indices, not the name + ! + if ( upf%dft(1:6)=='INDEX:') then + read( upf%dft(7:10), '(4i1)') iexch,icorr,igcx,igcc + call set_dft_from_indices(iexch,icorr,igcx,igcc, 0) !Cannot read nonloc in this format + else + call set_dft_from_name( upf%dft ) + end if + ! + if(present(grid)) then + call allocate_radial_grid(grid,upf%mesh) + grid%dx = upf%dx + grid%xmin = upf%xmin + grid%zmesh= upf%zmesh + grid%mesh = upf%mesh + ! + grid%r (1:upf%mesh) = upf%r (1:upf%mesh) + grid%rab(1:upf%mesh) = upf%rab(1:upf%mesh) + upf%grid => grid + endif + ! +end subroutine set_pseudo_upf + +!=----------------------------------------------------------------------------=! + END MODULE upf_to_internal +!=----------------------------------------------------------------------------=! diff --git a/tests/apps/miniDFT/tests/src/usnldiag.f90 b/tests/apps/miniDFT/tests/src/usnldiag.f90 new file mode 100644 index 0000000000..a4332664fb --- /dev/null +++ b/tests/apps/miniDFT/tests/src/usnldiag.f90 @@ -0,0 +1,100 @@ +! +! Copyright (C) 2001 PWSCF group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +!----------------------------------------------------------------------- +subroutine usnldiag (h_diag, s_diag) + !----------------------------------------------------------------------- + ! + ! add nonlocal pseudopotential term to diagonal part of Hamiltonian + ! compute the diagonal part of the S matrix + ! + USE kinds, ONLY: DP + USE ions_base, ONLY : nat, ityp, ntyp => nsp + USE wvfct, ONLY: npw, npwx + USE lsda_mod, ONLY: current_spin + USE uspp, ONLY: deeq, vkb, qq, qq_so, deeq_nc + USE uspp_param, ONLY: upf, nh, newpseudo + USE spin_orb, ONLY: lspinorb + ! + implicit none + + integer, parameter :: npol=1 !substitute for noncollin_module + + ! here the dummy variables + ! + real(DP) :: h_diag (npwx,npol), s_diag (npwx,npol) + ! input/output: the diagonal part of the hamiltonian + ! output: the diagonal part of the S matrix + ! + ! and here the local variables + ! + integer :: ikb, jkb, ih, jh, na, nt, ig, ijkb0, ipol + ! counters + complex(DP) :: ps1(2), ps2(2), ar + ! + ! initialise s_diag + ! + s_diag = 1.d0 + ! + ! multiply on projectors + ! + ijkb0 = 0 + do nt = 1, ntyp + do na = 1, nat + if (ityp (na) == nt) then + do ih = 1, nh (nt) + ikb = ijkb0 + ih + if (lspinorb) then + ps1(1) = deeq_nc (ih, ih, na, 1) + ps1(2) = deeq_nc (ih, ih, na, 4) + ps2(1) = qq_so(ih, ih, 1, nt) + ps2(2) = qq_so(ih, ih, 4, nt) + else + ps1(1) = deeq (ih, ih, na, current_spin) + ps2(1) = qq (ih, ih, nt) + end if + do ipol =1, npol + do ig = 1, npw + ar = vkb (ig, ikb)*CONJG(vkb (ig, ikb)) + h_diag (ig,ipol) = h_diag (ig,ipol) + ps1(ipol) * ar + s_diag (ig,ipol) = s_diag (ig,ipol) + ps2(ipol) * ar + enddo + enddo + if ( newpseudo (nt) ) then + do jh = 1, nh (nt) + if (jh.ne.ih) then + jkb = ijkb0 + jh + if (lspinorb) then + ps1(1) = deeq_nc (ih, jh, na, 1) + ps1(2) = deeq_nc (ih, jh, na, 4) + ps2(1) = qq_so(ih, jh, 1, nt) + ps2(2) = qq_so(ih, jh, 4, nt) + else + ps1(1) = deeq (ih, jh, na, current_spin) + ps2(1) = qq (ih, jh, nt) + end if + do ipol = 1, npol + do ig = 1, npw + ar = vkb (ig, ikb) *CONJG( vkb (ig, jkb)) + h_diag (ig,ipol) = h_diag (ig,ipol) + & + ps1(ipol) * ar + s_diag (ig,ipol) = s_diag (ig,ipol) + & + ps2(ipol) * ar + enddo + enddo + endif + enddo + endif + enddo + ijkb0 = ijkb0 + nh (nt) + endif + enddo + enddo + + return +end subroutine usnldiag diff --git a/tests/apps/miniDFT/tests/src/uspp.f90 b/tests/apps/miniDFT/tests/src/uspp.f90 new file mode 100644 index 0000000000..cb8155fa1e --- /dev/null +++ b/tests/apps/miniDFT/tests/src/uspp.f90 @@ -0,0 +1,316 @@ +! +! Copyright (C) 2004-2011 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +MODULE uspp_param + ! + ! ... Ultrasoft and Norm-Conserving pseudopotential parameters + ! + USE kinds, ONLY : DP + USE parameters, ONLY : npsx + USE pseudo_types, ONLY : pseudo_upf + ! + SAVE + PUBLIC :: n_atom_wfc + ! + TYPE (pseudo_upf), ALLOCATABLE, TARGET :: upf(:) + + INTEGER :: & + nh(npsx), &! number of beta functions per atomic type + nhm, &! max number of different beta functions per atom + nbetam, &! max number of beta functions + iver(3,npsx) ! version of the atomic code + INTEGER :: & + lmaxkb, &! max angular momentum + lmaxq ! max angular momentum + 1 for Q functions + LOGICAL :: & + newpseudo(npsx), &! if .TRUE. multiple projectors are allowed + oldvan(npsx) ! old version of Vanderbilt PPs, using + ! Herman-Skillman grid - obsolescent + INTEGER :: & + nvb, &! number of species with Vanderbilt PPs (CPV) + ish(npsx) ! for each specie the index of the first beta + ! function: ish(1)=1, ish(i)=1+SUM(nh(1:i-1)) +CONTAINS + ! + !---------------------------------------------------------------------------- + FUNCTION n_atom_wfc( nat, ityp, noncolin ) + !---------------------------------------------------------------------------- + ! + ! ... Find number of starting atomic orbitals + ! + IMPLICIT NONE + ! + INTEGER, INTENT(IN) :: nat, ityp(nat) + LOGICAL, INTENT(IN), OPTIONAL :: noncolin + INTEGER :: n_atom_wfc + ! + INTEGER :: na, nt, n + LOGICAL :: non_col + ! + ! + non_col = .FALSE. + n_atom_wfc = 0 + ! + DO na = 1, nat + ! + nt = ityp(na) + ! + DO n = 1, upf(nt)%nwfc + ! + IF ( upf(nt)%oc(n) >= 0.D0 ) THEN + ! + ! + n_atom_wfc = n_atom_wfc + 2 * upf(nt)%lchi(n) + 1 + ! + END IF + END DO + END DO + ! + RETURN + ! + END FUNCTION n_atom_wfc +END MODULE uspp_param +MODULE uspp + ! + ! Ultrasoft PPs: + ! - Clebsch-Gordan coefficients "ap", auxiliary variables "lpx", "lpl" + ! - beta and q functions of the solid + ! + USE kinds, ONLY: DP + USE parameters, ONLY: lmaxx, lqmax + IMPLICIT NONE + PRIVATE + SAVE + PUBLIC :: nlx, lpx, lpl, ap, aainit, indv, nhtol, nhtolm, nkb, nkbus, & + vkb, dvan, deeq, qq, nhtoj, ijtoh, beta, becsum, deallocate_uspp + PUBLIC :: okvan, nlcc_any + PUBLIC :: qq_so, dvan_so, deeq_nc + PUBLIC :: dbeta + INTEGER, PARAMETER :: & + nlx = (lmaxx+1)**2, &! maximum number of combined angular momentum + mx = 2*lqmax-1 ! maximum magnetic angular momentum of Q + INTEGER :: &! for each pair of combined momenta lm(1),lm(2): + lpx(nlx,nlx), &! maximum combined angular momentum LM + lpl(nlx,nlx,mx) ! list of combined angular momenta LM + REAL(DP) :: & + ap(lqmax*lqmax,nlx,nlx) + ! Clebsch-Gordan coefficients for spherical harmonics + ! + INTEGER :: nkb, &! total number of beta functions, with struct.fact. + nkbus ! as above, for US-PP only + ! + INTEGER, ALLOCATABLE ::& + indv(:,:), &! indes linking atomic beta's to beta's in the solid + nhtol(:,:), &! correspondence n <-> angular momentum l + nhtolm(:,:), &! correspondence n <-> combined lm index for (l,m) + ijtoh(:,:,:) ! correspondence beta indexes ih,jh -> composite index ijh + ! + LOGICAL :: & + okvan = .FALSE.,& ! if .TRUE. at least one pseudo is Vanderbilt + nlcc_any=.FALSE. ! if .TRUE. at least one pseudo has core corrections + ! + COMPLEX(DP), ALLOCATABLE, TARGET :: & + vkb(:,:) ! all beta functions in reciprocal space + REAL(DP), ALLOCATABLE :: & + becsum(:,:,:) ! \sum_i f(i) + REAL(DP), ALLOCATABLE :: & + dvan(:,:,:), &! the D functions of the solid + deeq(:,:,:,:), &! the integral of V_eff and Q_{nm} + qq(:,:,:), &! the q functions in the solid + nhtoj(:,:) ! correspondence n <-> total angular momentum + ! + COMPLEX(DP), ALLOCATABLE :: & ! variables for spin-orbit/noncolinear case: + qq_so(:,:,:,:), &! Q_{nm} + dvan_so(:,:,:,:), &! D_{nm} + deeq_nc(:,:,:,:) ! \int V_{eff}(r) Q_{nm}(r) dr + ! + ! spin-orbit coupling: qq and dvan are complex, qq has additional spin index + ! noncolinear magnetism: deeq is complex (even in absence of spin-orbit) + ! + REAL(DP), ALLOCATABLE :: & + beta(:,:,:) ! beta functions for CP (without struct.factor) + REAL(DP), ALLOCATABLE :: & + dbeta(:,:,:,:,:) ! derivative of beta functions w.r.t. cell for CP (without struct.factor) + ! +CONTAINS + ! + !----------------------------------------------------------------------- + subroutine aainit(lli) + !----------------------------------------------------------------------- + ! + ! this routine computes the coefficients of the expansion of the product + ! of two real spherical harmonics into real spherical harmonics. + ! + ! Y_limi(r) * Y_ljmj(r) = \sum_LM ap(LM,limi,ljmj) Y_LM(r) + ! + ! On output: + ! ap the expansion coefficients + ! lpx for each input limi,ljmj is the number of LM in the sum + ! lpl for each input limi,ljmj points to the allowed LM + ! + ! The indices limi,ljmj and LM assume the order for real spherical + ! harmonics given in routine ylmr2 + ! + implicit none + ! + ! input: the maximum li considered + ! + integer :: lli + ! + ! local variables + ! + integer :: llx, l, li, lj + real(DP) , allocatable :: r(:,:), rr(:), ylm(:,:), mly(:,:) + ! an array of random vectors: r(3,llx) + ! the norm of r: rr(llx) + ! the real spherical harmonics for array r: ylm(llx,llx) + ! the inverse of ylm considered as a matrix: mly(llx,llx) + real(DP) :: dum + ! + if (lli < 0) call errore('aainit','lli not allowed',lli) + + if (lli*lli > nlx) call errore('aainit','nlx is too small ',lli*lli) + + llx = (2*lli-1)**2 + if (2*lli-1 > lqmax) & + call errore('aainit','ap leading dimension is too small',llx) + + allocate (r( 3, llx )) + allocate (rr( llx )) + allocate (ylm( llx, llx )) + allocate (mly( llx, llx )) + + r(:,:) = 0.0_DP + ylm(:,:) = 0.0_DP + mly(:,:) = 0.0_DP + ap(:,:,:)= 0.0_DP + + ! - generate an array of random vectors (uniform deviate on unitary sphere) + + call gen_rndm_r(llx,r,rr) + + ! - generate the real spherical harmonics for the array: ylm(ir,lm) + + call ylmr2(llx,llx,r,rr,ylm) + + !- store the inverse of ylm(ir,lm) in mly(lm,ir) + + call invmat(llx, ylm, mly, dum) + + !- for each li,lj compute ap(l,li,lj) and the indices, lpx and lpl + do li = 1, lli*lli + do lj = 1, lli*lli + lpx(li,lj)=0 + do l = 1, llx + ap(l,li,lj) = compute_ap(l,li,lj,llx,ylm,mly) + if (abs(ap(l,li,lj)) > 1.d-3) then + lpx(li,lj) = lpx(li,lj) + 1 + if (lpx(li,lj) > mx) & + call errore('aainit','mx dimension too small', lpx(li,lj)) + lpl(li,lj,lpx(li,lj)) = l + end if + end do + end do + end do + + deallocate(mly) + deallocate(ylm) + deallocate(rr) + deallocate(r) + + return + end subroutine aainit + ! + !----------------------------------------------------------------------- + subroutine gen_rndm_r(llx,r,rr) + !----------------------------------------------------------------------- + ! - generate an array of random vectors (uniform deviate on unitary sphere) + ! + USE constants, ONLY: tpi + USE random_numbers, ONLY: randy + + implicit none + ! + ! first the I/O variables + ! + integer :: llx ! input: the dimension of r and rr + + real(DP) :: & + r(3,llx), &! output: an array of random vectors + rr(llx) ! output: the norm of r + ! + ! here the local variables + ! + integer :: ir + real(DP) :: costheta, sintheta, phi + + do ir = 1, llx + costheta = 2.0_DP * randy() - 1.0_DP + sintheta = SQRT ( 1.0_DP - costheta*costheta) + phi = tpi * randy() + r (1,ir) = sintheta * cos(phi) + r (2,ir) = sintheta * sin(phi) + r (3,ir) = costheta + rr(ir) = 1.0_DP + end do + + return + end subroutine gen_rndm_r + ! + !----------------------------------------------------------------------- + function compute_ap(l,li,lj,llx,ylm,mly) + !----------------------------------------------------------------------- + !- given an l and a li,lj pair compute ap(l,li,lj) + implicit none + ! + ! first the I/O variables + ! + integer :: & + llx, &! the dimension of ylm and mly + l,li,lj ! the arguments of the array ap + + real(DP) :: & + compute_ap, &! this function + ylm(llx,llx),&! the real spherical harmonics for array r + mly(llx,llx) ! the inverse of ylm considered as a matrix + ! + ! here the local variables + ! + integer :: ir + + compute_ap = 0.0_DP + do ir = 1,llx + compute_ap = compute_ap + mly(l,ir)*ylm(ir,li)*ylm(ir,lj) + end do + + return + end function compute_ap + ! + !----------------------------------------------------------------------- + SUBROUTINE deallocate_uspp() + !----------------------------------------------------------------------- + ! + IF( ALLOCATED( nhtol ) ) DEALLOCATE( nhtol ) + IF( ALLOCATED( indv ) ) DEALLOCATE( indv ) + IF( ALLOCATED( nhtolm ) ) DEALLOCATE( nhtolm ) + IF( ALLOCATED( nhtoj ) ) DEALLOCATE( nhtoj ) + IF( ALLOCATED( ijtoh ) ) DEALLOCATE( ijtoh ) + IF( ALLOCATED( vkb ) ) DEALLOCATE( vkb ) + IF( ALLOCATED( becsum ) ) DEALLOCATE( becsum ) + IF( ALLOCATED( qq ) ) DEALLOCATE( qq ) + IF( ALLOCATED( dvan ) ) DEALLOCATE( dvan ) + IF( ALLOCATED( deeq ) ) DEALLOCATE( deeq ) + IF( ALLOCATED( qq_so ) ) DEALLOCATE( qq_so ) + IF( ALLOCATED( dvan_so ) ) DEALLOCATE( dvan_so ) + IF( ALLOCATED( deeq_nc ) ) DEALLOCATE( deeq_nc ) + IF( ALLOCATED( beta ) ) DEALLOCATE( beta ) + IF( ALLOCATED( dbeta ) ) DEALLOCATE( dbeta ) + ! + END SUBROUTINE deallocate_uspp + ! +END MODULE uspp + diff --git a/tests/apps/miniDFT/tests/src/v_of_rho.f90 b/tests/apps/miniDFT/tests/src/v_of_rho.f90 new file mode 100644 index 0000000000..fdba18dae0 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/v_of_rho.f90 @@ -0,0 +1,497 @@ +! +! Copyright (C) 2001-2009 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +!---------------------------------------------------------------------------- +SUBROUTINE v_of_rho( rho, rho_core, rhog_core, & + ehart, etxc, vtxc, eth, etotefield, charge, v ) + !---------------------------------------------------------------------------- + ! + ! ... This routine computes the Hartree and Exchange and Correlation + ! ... potential and energies which corresponds to a given charge density + ! ... The XC potential is computed in real space, while the + ! ... Hartree potential is computed in reciprocal space. + ! + USE kinds, ONLY : DP + USE fft_base, ONLY : dfftp + USE gvect, ONLY : ngm + USE ions_base, ONLY : nat + USE scf, ONLY : scf_type + ! + IMPLICIT NONE + ! + TYPE(scf_type), INTENT(IN) :: rho ! the valence charge + TYPE(scf_type), INTENT(INOUT) :: v ! the scf (Hxc) potential + !!!!!!!!!!!!!!!!! NB: NOTE that in F90 derived data type must be INOUT and + !!!!!!!!!!!!!!!!! not just OUT because otherwise their allocatable or pointer + !!!!!!!!!!!!!!!!! components are NOT defined !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + REAL(DP), INTENT(IN) :: rho_core(dfftp%nnr) + ! the core charge + COMPLEX(DP), INTENT(IN) :: rhog_core(ngm) + ! the core charge in reciprocal space + REAL(DP), INTENT(OUT) :: vtxc, etxc, ehart, eth, charge + ! the integral V_xc * rho + ! the E_xc energy + ! the hartree energy + ! the hubbard energy + ! the integral of the charge + REAL(DP), INTENT(INOUT) :: etotefield + ! electric field energy - inout due to the screwed logic of add_efield + ! ! + INTEGER :: is + ! + CALL start_clock( 'v_of_rho' ) + ! + ! ... calculate exchange-correlation potential + ! + CALL v_xc( rho, rho_core, rhog_core, etxc, vtxc, v%of_r ) + ! + ! ... add a magnetic field (if any) + ! + ! + ! ... calculate hartree potential + ! + CALL v_h( rho%of_g, ehart, charge, v%of_r ) + ! + CALL stop_clock( 'v_of_rho' ) + ! + RETURN + ! +END SUBROUTINE v_of_rho +!---------------------------------------------------------------------------- +SUBROUTINE v_xc( rho, rho_core, rhog_core, etxc, vtxc, v ) + !---------------------------------------------------------------------------- + ! + ! ... Exchange-Correlation potential Vxc(r) from n(r) + ! + USE kinds, ONLY : DP + USE constants, ONLY : e2, eps8 + USE io_global, ONLY : stdout + USE fft_base, ONLY : dfftp + USE gvect, ONLY : ngm + USE lsda_mod, ONLY : nspin + USE cell_base, ONLY : omega + USE spin_orb, ONLY : domag + USE funct, ONLY : xc, xc_spin + USE scf, ONLY : scf_type + USE mp_global, ONLY : intra_pool_comm, intra_bgrp_comm, mpime + USE mp, ONLY : mp_sum + + ! + IMPLICIT NONE + ! + TYPE (scf_type), INTENT(IN) :: rho + REAL(DP), INTENT(IN) :: rho_core(dfftp%nnr) + ! the core charge + COMPLEX(DP), INTENT(IN) :: rhog_core(ngm) + ! input: the core charge in reciprocal space + REAL(DP), INTENT(OUT) :: v(dfftp%nnr,nspin), vtxc, etxc + ! V_xc potential + ! integral V_xc * rho + ! E_xc energy + ! + ! ... local variables + ! + REAL(DP) :: rhox, arhox, zeta, amag, vs, ex, ec, vx(2), vc(2), rhoneg(2) + ! the total charge in each point + ! the absolute value of the charge + ! the absolute value of the charge + ! local exchange energy + ! local correlation energy + ! local exchange potential + ! local correlation potential + INTEGER :: ir, ipol + ! counter on mesh points + ! counter on nspin + ! + REAL(DP), PARAMETER :: vanishing_charge = 1.D-10, & + vanishing_mag = 1.D-20 + ! + ! + CALL start_clock( 'v_xc' ) + ! + etxc = 0.D0 + vtxc = 0.D0 + v(:,:) = 0.D0 + rhoneg = 0.D0 + ! + IF ( nspin == 1 .OR. ( nspin == 4 .AND. .NOT. domag ) ) THEN + ! + ! ... spin-unpolarized case + ! +!$omp parallel do private( rhox, arhox, ex, ec, vx, vc ), & +!$omp reduction(+:etxc,vtxc), reduction(-:rhoneg) + DO ir = 1, dfftp%nnr + ! + rhox = rho%of_r(ir,1) + rho_core(ir) + ! + arhox = ABS( rhox ) + ! + IF ( arhox > vanishing_charge ) THEN + ! + CALL xc( arhox, ex, ec, vx(1), vc(1) ) + ! + v(ir,1) = e2*( vx(1) + vc(1) ) + ! + etxc = etxc + e2*( ex + ec ) * rhox + ! + vtxc = vtxc + v(ir,1) * rho%of_r(ir,1) + ! + ENDIF + ! + IF ( rho%of_r(ir,1) < 0.D0 ) rhoneg(1) = rhoneg(1) - rho%of_r(ir,1) + ! + END DO +!$omp end parallel do + ! + ELSE IF ( nspin == 2 ) THEN + ! + ! ... spin-polarized case + ! +!$omp parallel do private( rhox, arhox, zeta, ex, ec, vx, vc ), & +!$omp reduction(+:etxc,vtxc), reduction(-:rhoneg) + DO ir = 1, dfftp%nnr + ! + rhox = rho%of_r(ir,1) + rho%of_r(ir,2) + rho_core(ir) + ! + arhox = ABS( rhox ) + ! + IF ( arhox > vanishing_charge ) THEN + ! + zeta = ( rho%of_r(ir,1) - rho%of_r(ir,2) ) / arhox + ! + IF ( ABS( zeta ) > 1.D0 ) zeta = SIGN( 1.D0, zeta ) + ! + IF ( rho%of_r(ir,1) < 0.D0 ) rhoneg(1) = rhoneg(1) - rho%of_r(ir,1) + IF ( rho%of_r(ir,2) < 0.D0 ) rhoneg(2) = rhoneg(2) - rho%of_r(ir,2) + ! + CALL xc_spin( arhox, zeta, ex, ec, vx(1), vx(2), vc(1), vc(2) ) + ! + v(ir,:) = e2*( vx(:) + vc(:) ) + ! + etxc = etxc + e2*( ex + ec ) * rhox + ! + vtxc = vtxc + v(ir,1) * rho%of_r(ir,1) + v(ir,2) * rho%of_r(ir,2) + ! + END IF + ! + END DO +!$omp end parallel do + ! + ELSE IF ( nspin == 4 ) THEN + ! + ! ... noncolinear case + ! + DO ir = 1,dfftp%nnr + ! + amag = SQRT( rho%of_r(ir,2)**2 + rho%of_r(ir,3)**2 + rho%of_r(ir,4)**2 ) + ! + rhox = rho%of_r(ir,1) + rho_core(ir) + ! + IF ( rho%of_r(ir,1) < 0.D0 ) rhoneg(1) = rhoneg(1) - rho%of_r(ir,1) + ! + arhox = ABS( rhox ) + ! + IF ( arhox > vanishing_charge ) THEN + ! + zeta = amag / arhox + ! + IF ( ABS( zeta ) > 1.D0 ) THEN + ! + rhoneg(2) = rhoneg(2) + 1.D0 / omega + ! + zeta = SIGN( 1.D0, zeta ) + ! + END IF + ! + CALL xc_spin( arhox, zeta, ex, ec, vx(1), vx(2), vc(1), vc(2) ) + ! + vs = 0.5D0*( vx(1) + vc(1) - vx(2) - vc(2) ) + ! + v(ir,1) = e2*( 0.5D0*( vx(1) + vc(1) + vx(2) + vc(2 ) ) ) + ! + IF ( amag > vanishing_mag ) THEN + ! + DO ipol = 2, 4 + ! + v(ir,ipol) = e2 * vs * rho%of_r(ir,ipol) / amag + ! + vtxc = vtxc + v(ir,ipol) * rho%of_r(ir,ipol) + ! + END DO + ! + END IF + ! + etxc = etxc + e2*( ex + ec ) * rhox + vtxc = vtxc + v(ir,1) * rho%of_r(ir,1) + ! + END IF + ! + END DO + ! + END IF + ! + CALL mp_sum( rhoneg , intra_bgrp_comm ) + ! + rhoneg(:) = rhoneg(:) * omega / ( dfftp%nr1*dfftp%nr2*dfftp%nr3 ) + ! + IF ( rhoneg(1) > eps8 .OR. rhoneg(2) > eps8 ) & + WRITE( stdout,'(/,5X,"negative rho (up, down): ",2E10.3)') rhoneg + ! + ! ... energy terms, local-density contribution + ! + vtxc = omega * vtxc / ( dfftp%nr1*dfftp%nr2*dfftp%nr3 ) + etxc = omega * etxc / ( dfftp%nr1*dfftp%nr2*dfftp%nr3 ) + ! + ! ... add gradient corrections (if any) + ! + CALL gradcorr( rho%of_r, rho%of_g, rho_core, rhog_core, etxc, vtxc, v ) + + ! + CALL mp_sum( vtxc , intra_bgrp_comm ) + CALL mp_sum( etxc , intra_bgrp_comm ) + ! + CALL stop_clock( 'v_xc' ) + ! + RETURN + ! +END SUBROUTINE v_xc +! +!---------------------------------------------------------------------------- +SUBROUTINE v_h( rhog, ehart, charge, v ) + !---------------------------------------------------------------------------- + ! + ! ... Hartree potential VH(r) from n(G) + ! + USE constants, ONLY : fpi, e2 + USE kinds, ONLY : DP + USE fft_base, ONLY : dfftp + USE fft_interfaces,ONLY : invfft + USE gvect, ONLY : nl, nlm, ngm, gg, gstart + USE lsda_mod, ONLY : nspin + USE cell_base, ONLY : omega, tpiba2 + USE mp_global, ONLY: intra_pool_comm, intra_bgrp_comm + USE mp, ONLY: mp_sum + ! + IMPLICIT NONE + ! + COMPLEX(DP), INTENT(IN) :: rhog(ngm,nspin) + REAL(DP), INTENT(INOUT) :: v(dfftp%nnr,nspin) + REAL(DP), INTENT(OUT) :: ehart, charge + ! + REAL(DP) :: fac + REAL(DP), ALLOCATABLE :: aux1(:,:) + REAL(DP) :: rgtot_re, rgtot_im, eh_corr + INTEGER :: is, ig + COMPLEX(DP), ALLOCATABLE :: aux(:), rgtot(:), vaux(:) + INTEGER :: nt + ! + CALL start_clock( 'v_h' ) + ! + ALLOCATE( aux( dfftp%nnr ), aux1( 2, ngm ) ) + charge = 0.D0 + ! + IF ( gstart == 2 ) THEN + ! + charge = omega*REAL( rhog(1,1) ) + ! + IF ( nspin == 2 ) charge = charge + omega*REAL( rhog(1,2) ) + ! + END IF + ! + CALL mp_sum( charge , intra_bgrp_comm ) + ! + ! ... calculate hartree potential in G-space (NB: V(G=0)=0 ) + ! + ! + ehart = 0.D0 + aux1(:,:) = 0.D0 + ! +!$omp parallel do private( fac, rgtot_re, rgtot_im ), reduction(+:ehart) + DO ig = gstart, ngm + ! + fac = 1.D0 / gg(ig) + ! + rgtot_re = REAL( rhog(ig,1) ) + rgtot_im = AIMAG( rhog(ig,1) ) + ! + IF ( nspin == 2 ) THEN + ! + rgtot_re = rgtot_re + REAL( rhog(ig,2) ) + rgtot_im = rgtot_im + AIMAG( rhog(ig,2) ) + ! + END IF + ! + ehart = ehart + ( rgtot_re**2 + rgtot_im**2 ) * fac + ! + aux1(1,ig) = rgtot_re * fac + aux1(2,ig) = rgtot_im * fac + ! + ENDDO +!$omp end parallel do + ! + fac = e2 * fpi / tpiba2 + ! + ehart = ehart * fac + ! + aux1 = aux1 * fac + ! + ! + ehart = ehart * 0.5D0 * omega + ! + ! + ! + CALL mp_sum( ehart , intra_bgrp_comm ) + ! + aux(:) = 0.D0 + ! + aux(nl(1:ngm)) = CMPLX ( aux1(1,1:ngm), aux1(2,1:ngm), KIND=dp ) + ! + ! + ! ... transform hartree potential to real space + ! + CALL invfft ('Dense', aux, dfftp) + ! + ! ... add hartree potential to the xc potential + ! + IF ( nspin == 4 ) THEN + ! + v(:,1) = v(:,1) + DBLE (aux(:)) + ! + ELSE + ! + DO is = 1, nspin + ! + v(:,is) = v(:,is) + DBLE (aux(:)) + ! + END DO + ! + END IF + ! + DEALLOCATE( aux, aux1 ) + ! + CALL stop_clock( 'v_h' ) + ! + RETURN + ! +END SUBROUTINE v_h +! + +!---------------------------------------------------------------------------- +SUBROUTINE v_h_of_rho_r( rhor, ehart, charge, v ) + !---------------------------------------------------------------------------- + ! + ! ... Hartree potential VH(r) from a density in R space n(r) + ! + USE kinds, ONLY : DP + USE fft_base, ONLY : dfftp + USE fft_interfaces, ONLY : fwfft + USE gvect, ONLY : nl, ngm + USE lsda_mod, ONLY : nspin + ! + IMPLICIT NONE + ! + ! ... Declares variables + ! + REAL( DP ), INTENT(IN) :: rhor( dfftp%nnr, nspin ) + REAL( DP ), INTENT(INOUT) :: v( dfftp%nnr, nspin ) + REAL( DP ), INTENT(OUT) :: ehart, charge + ! + ! ... Local variables + ! + COMPLEX( DP ), ALLOCATABLE :: rhog( : , : ) + COMPLEX( DP ), ALLOCATABLE :: aux( : ) + INTEGER :: is + ! + ! ... bring the (unsymmetrized) rho(r) to G-space (use aux as work array) + ! + ALLOCATE( rhog( ngm, nspin ) ) + ALLOCATE( aux( dfftp%nnr ) ) + DO is = 1, nspin + aux(:) = CMPLX(rhor( : , is ),0.D0,kind=dp) + CALL fwfft ('Dense', aux, dfftp) + rhog(:,is) = aux(nl(:)) + END DO + DEALLOCATE( aux ) + ! + ! ... compute VH(r) from n(G) + ! + CALL v_h( rhog, ehart, charge, v ) + DEALLOCATE( rhog ) + ! + RETURN + ! +END SUBROUTINE v_h_of_rho_r +!---------------------------------------------------------------------------- +SUBROUTINE gradv_h_of_rho_r( rho, gradv ) + !---------------------------------------------------------------------------- + ! + ! ... Gradient of Hartree potential in R space from a total + ! (spinless) density in R space n(r) + ! + USE kinds, ONLY : DP + USE fft_base, ONLY : dfftp + USE fft_interfaces, ONLY : fwfft, invfft + USE constants, ONLY : fpi, e2 + USE cell_base, ONLY : tpiba, omega + USE gvect, ONLY : nl, ngm, nlm, gg, gstart, g + ! + IMPLICIT NONE + ! + ! ... Declares variables + ! + REAL( DP ), INTENT(IN) :: rho( dfftp%nnr ) + REAL( DP ), INTENT(OUT) :: gradv( 3, dfftp%nnr ) + ! + ! ... Local variables + ! + COMPLEX( DP ), ALLOCATABLE :: rhoaux( : ) + COMPLEX( DP ), ALLOCATABLE :: gaux( : ) + COMPLEX( DP ), ALLOCATABLE :: rgtot(:), vaux(:) + REAL( DP ) :: fac, eh_corr + INTEGER :: ig, ipol + ! + ! ... Bring rho to G space + ! + ALLOCATE( rhoaux( dfftp%nnr ) ) + rhoaux( : ) = CMPLX( rho( : ), 0.D0 ) + ! + CALL fwfft('Dense', rhoaux, dfftp) + ! + ! ... Compute total potential in G space + ! + ALLOCATE( gaux( dfftp%nnr ) ) + ! + DO ipol = 1, 3 + ! + gaux(:) = CMPLX(0.d0,0.d0,kind=dp) + ! + DO ig = gstart, ngm + ! + fac = g(ipol,ig) / gg(ig) + gaux(nl(ig)) = CMPLX(-AIMAG(rhoaux(nl(ig))),REAL(rhoaux(nl(ig))),kind=dp) * fac + ! + END DO + ! + ! ...and add the factor e2*fpi/2\pi/a coming from the missing prefactor of + ! V = e2 * fpi divided by the 2\pi/a factor missing in G + ! + fac = e2 * fpi / tpiba + gaux = gaux * fac + ! + ! ... bring back to R-space, (\grad_ipol a)(r) ... + ! + CALL invfft ('Dense', gaux, dfftp) + ! + gradv(ipol,:) = REAL( gaux(:) ) + ! + ENDDO + ! + DEALLOCATE(gaux) + ! + RETURN + ! +END SUBROUTINE gradv_h_of_rho_r diff --git a/tests/apps/miniDFT/tests/src/version.f90 b/tests/apps/miniDFT/tests/src/version.f90 new file mode 100644 index 0000000000..08e0c0a72a --- /dev/null +++ b/tests/apps/miniDFT/tests/src/version.f90 @@ -0,0 +1,17 @@ +! +! Copyright (C) 2003-2011 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +!---------------------------------------------------------------------------- +MODULE global_version + ! + IMPLICIT NONE + ! + SAVE + ! + CHARACTER (LEN=6) :: version_number = '1.05' + ! +END MODULE global_version diff --git a/tests/apps/miniDFT/tests/src/vloc_of_g.f90 b/tests/apps/miniDFT/tests/src/vloc_of_g.f90 new file mode 100644 index 0000000000..db60cf08bc --- /dev/null +++ b/tests/apps/miniDFT/tests/src/vloc_of_g.f90 @@ -0,0 +1,136 @@ +! +! Copyright (C) 2001-2007 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +!---------------------------------------------------------------------- +subroutine vloc_of_g (mesh, msh, rab, r, vloc_at, zp, tpiba2, ngl, & + gl, omega, vloc) + !---------------------------------------------------------------------- + ! + ! This routine computes the Fourier transform of the local + ! part of an atomic pseudopotential, given in numerical form. + ! A term erf(r)/r is subtracted in real space (thus making the + ! function short-ramged) and added again in G space (for G<>0) + ! The G=0 term contains \int (V_loc(r)+ Ze^2/r) 4pi r^2 dr. + ! This is the "alpha" in the so-called "alpha Z" term of the energy. + ! Atomic Ry units everywhere. + ! + USE kinds + USE constants, ONLY : pi, fpi, e2, eps8 + implicit none + ! + ! first the dummy variables + ! + integer, intent(in) :: ngl, mesh, msh + ! ngl : the number of shells of G vectors + ! mesh: number of grid points in the radial grid + ! msh : as above, used for radial integration + ! + real(DP), intent(in) :: zp, rab (mesh), r (mesh), vloc_at (mesh), tpiba2, & + omega, gl (ngl) + ! zp : valence pseudocharge + ! rab: the derivative of mesh points + ! r : the mesh points + ! vloc_at: local part of the atomic pseudopotential on the radial mesh + ! tpiba2 : 2 pi / alat + ! omega : the volume of the unit cell + ! gl : the moduli of g vectors for each shell + ! + real(DP), intent(out):: vloc (ngl) + ! + ! vloc: the fourier transform of the potential + ! + ! local variables + ! + real(DP) :: vlcp, fac, gx + real(DP), allocatable :: aux (:), aux1 (:) + integer :: igl, igl0, ir + ! igl :counter on g shells vectors + ! igl0:first shell with g != 0 + ! ir :counter on mesh points + ! + real(DP), external :: qe_erf + ! + allocate ( aux(msh), aux1(msh) ) + if (gl (1) < eps8) then + ! + ! first the G=0 term + ! + do ir = 1, msh + aux (ir) = r (ir) * (r (ir) * vloc_at (ir) + zp * e2) + enddo + call simpson (msh, aux, rab, vlcp) + vloc (1) = vlcp + igl0 = 2 + else + igl0 = 1 + endif + ! + ! here the G<>0 terms, we first compute the part of the integrand + ! function independent of |G| in real space + ! + do ir = 1, msh + aux1 (ir) = r (ir) * vloc_at (ir) + zp * e2 * qe_erf (r (ir) ) + enddo + fac = zp * e2 / tpiba2 + ! + ! and here we perform the integral, after multiplying for the |G| + ! dependent part + ! + do igl = igl0, ngl + gx = sqrt (gl (igl) * tpiba2) + do ir = 1, msh + aux (ir) = aux1 (ir) * sin (gx * r (ir) ) / gx + enddo + call simpson (msh, aux, rab, vlcp) + ! + ! here we re-add the analytic fourier transform of the erf function + ! + vlcp = vlcp - fac * exp ( - gl (igl) * tpiba2 * 0.25d0) / gl (igl) + vloc (igl) = vlcp + enddo + vloc (:) = vloc(:) * fpi / omega + deallocate (aux, aux1) + +return +end subroutine vloc_of_g +! +!---------------------------------------------------------------------- +subroutine vloc_coul (zp, tpiba2, ngl, gl, omega, vloc) + !---------------------------------------------------------------------- + ! + ! Fourier transform of the Coulomb potential - For all-electron + ! calculations, in specific cases only, for testing purposes + ! + USE kinds + USE constants, ONLY : fpi, e2, eps8 + implicit none + ! + integer, intent(in) :: ngl + ! the number of shells of G vectors + real(DP), intent(in) :: zp, tpiba2, omega, gl (ngl) + ! valence pseudocharge + ! 2 pi / alat + ! the volume of the unit cell + ! the moduli of g vectors for each shell + real(DP), intent (out) :: vloc (ngl) + ! the fourier transform of the potential + ! + integer :: igl0 + ! + if (gl (1) < eps8) then + igl0 = 2 + vloc(1) = 0.0_dp + else + igl0 = 1 + endif + + vloc (igl0:ngl) = - fpi * zp *e2 / omega / tpiba2 / gl (igl0:ngl) + +return +end subroutine vloc_coul + diff --git a/tests/apps/miniDFT/tests/src/vloc_psi.f90 b/tests/apps/miniDFT/tests/src/vloc_psi.f90 new file mode 100644 index 0000000000..7f91828c0d --- /dev/null +++ b/tests/apps/miniDFT/tests/src/vloc_psi.f90 @@ -0,0 +1,345 @@ +! +! Copyright (C) 2003-2009 PWSCF group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +!----------------------------------------------------------------------- +SUBROUTINE vloc_psi_gamma(lda, n, m, psi, v, hpsi) + !----------------------------------------------------------------------- + ! + ! Calculation of Vloc*psi using dual-space technique - Gamma point + ! + USE parallel_include + USE kinds, ONLY : DP + USE gvecs, ONLY : nls, nlsm + USE wvfct, ONLY : igk + USE mp_global, ONLY : me_pool, me_bgrp + USE fft_base, ONLY : dffts, tg_gather + USE fft_interfaces,ONLY : fwfft, invfft + USE wavefunctions_module, ONLY: psic + ! + IMPLICIT NONE + ! + INTEGER, INTENT(in) :: lda, n, m + COMPLEX(DP), INTENT(in) :: psi (lda, m) + COMPLEX(DP), INTENT(inout):: hpsi (lda, m) + REAL(DP), INTENT(in) :: v(dffts%nnr) + ! + INTEGER :: ibnd, j, incr + COMPLEX(DP) :: fp, fm + ! + LOGICAL :: use_tg + ! Variables for task groups + REAL(DP), ALLOCATABLE :: tg_v(:) + COMPLEX(DP), ALLOCATABLE :: tg_psic(:) + INTEGER :: v_siz, idx, ioff + ! + ! + incr = 2 + ! + ! The following is dirty trick to prevent usage of task groups if + ! the number of bands is smaller than the number of task groups + ! + use_tg = dffts%have_task_groups + dffts%have_task_groups = dffts%have_task_groups .and. ( m >= dffts%nogrp ) + ! + IF( dffts%have_task_groups ) THEN + ! + v_siz = dffts%tg_nnr * dffts%nogrp + ! + ALLOCATE( tg_v ( v_siz ) ) + ALLOCATE( tg_psic( v_siz ) ) + ! + CALL tg_gather( dffts, v, tg_v ) + ! + incr = 2 * dffts%nogrp + ! + ENDIF + ! + ! the local potential V_Loc psi. First bring psi to real space + ! + DO ibnd = 1, m, incr + ! + IF( dffts%have_task_groups ) THEN + ! + tg_psic = (0.d0, 0.d0) + ioff = 0 + ! + DO idx = 1, 2*dffts%nogrp, 2 + IF( idx + ibnd - 1 < m ) THEN + DO j = 1, n + tg_psic(nls (igk(j))+ioff) = psi(j,idx+ibnd-1) + & + (0.0d0,1.d0) * psi(j,idx+ibnd) + tg_psic(nlsm(igk(j))+ioff) = conjg( psi(j,idx+ibnd-1) - & + (0.0d0,1.d0) * psi(j,idx+ibnd) ) + ENDDO + ELSEIF( idx + ibnd - 1 == m ) THEN + DO j = 1, n + tg_psic(nls (igk(j))+ioff) = psi(j,idx+ibnd-1) + tg_psic(nlsm(igk(j))+ioff) = conjg( psi(j,idx+ibnd-1) ) + ENDDO + ENDIF + + ioff = ioff + dffts%tg_nnr + + ENDDO + ! + ELSE + ! + psic(:) = (0.d0, 0.d0) + IF (ibnd < m) THEN + ! two ffts at the same time + DO j = 1, n + psic(nls (igk(j)))= psi(j,ibnd) + (0.0d0,1.d0)*psi(j,ibnd+1) + psic(nlsm(igk(j)))=conjg(psi(j,ibnd) - (0.0d0,1.d0)*psi(j,ibnd+1)) + ENDDO + ELSE + DO j = 1, n + psic (nls (igk(j))) = psi(j, ibnd) + psic (nlsm(igk(j))) = conjg(psi(j, ibnd)) + ENDDO + ENDIF + ! + ENDIF + ! + ! fft to real space + ! product with the potential v on the smooth grid + ! back to reciprocal space + ! + IF( dffts%have_task_groups ) THEN + ! + CALL invfft ('Wave', tg_psic, dffts) + ! + DO j = 1, dffts%nr1x*dffts%nr2x*dffts%tg_npp( me_bgrp + 1 ) + tg_psic (j) = tg_psic (j) * tg_v(j) + ENDDO + ! + CALL fwfft ('Wave', tg_psic, dffts) + ! + ELSE + ! + CALL invfft ('Wave', psic, dffts) + ! + DO j = 1, dffts%nnr + psic (j) = psic (j) * v(j) + ENDDO + ! + CALL fwfft ('Wave', psic, dffts) + ! + ENDIF + ! + ! addition to the total product + ! + IF( dffts%have_task_groups ) THEN + ! + ioff = 0 + ! + DO idx = 1, 2*dffts%nogrp, 2 + ! + IF( idx + ibnd - 1 < m ) THEN + DO j = 1, n + fp= ( tg_psic( nls(igk(j)) + ioff ) + & + tg_psic( nlsm(igk(j)) + ioff ) ) * 0.5d0 + fm= ( tg_psic( nls(igk(j)) + ioff ) - & + tg_psic( nlsm(igk(j)) + ioff ) ) * 0.5d0 + hpsi (j, ibnd+idx-1) = hpsi (j, ibnd+idx-1) + & + cmplx( dble(fp), aimag(fm),kind=DP) + hpsi (j, ibnd+idx ) = hpsi (j, ibnd+idx ) + & + cmplx(aimag(fp),- dble(fm),kind=DP) + ENDDO + ELSEIF( idx + ibnd - 1 == m ) THEN + DO j = 1, n + hpsi (j, ibnd+idx-1) = hpsi (j, ibnd+idx-1) + & + tg_psic( nls(igk(j)) + ioff ) + ENDDO + ENDIF + ! + ioff = ioff + dffts%nr3x * dffts%nsw( me_bgrp + 1 ) + ! + ENDDO + ! + ELSE + IF (ibnd < m) THEN + ! two ffts at the same time + DO j = 1, n + fp = (psic (nls(igk(j))) + psic (nlsm(igk(j))))*0.5d0 + fm = (psic (nls(igk(j))) - psic (nlsm(igk(j))))*0.5d0 + hpsi (j, ibnd) = hpsi (j, ibnd) + & + cmplx( dble(fp), aimag(fm),kind=DP) + hpsi (j, ibnd+1) = hpsi (j, ibnd+1) + & + cmplx(aimag(fp),- dble(fm),kind=DP) + ENDDO + ELSE + DO j = 1, n + hpsi (j, ibnd) = hpsi (j, ibnd) + psic (nls(igk(j))) + ENDDO + ENDIF + ENDIF + ! + ENDDO + ! + IF( dffts%have_task_groups ) THEN + ! + DEALLOCATE( tg_psic ) + DEALLOCATE( tg_v ) + ! + ENDIF + dffts%have_task_groups = use_tg + ! + RETURN +END SUBROUTINE vloc_psi_gamma +! +!----------------------------------------------------------------------- +SUBROUTINE vloc_psi_k(lda, n, m, psi, v, hpsi) + !----------------------------------------------------------------------- + ! + ! Calculation of Vloc*psi using dual-space technique - k-points + ! + USE parallel_include + USE kinds, ONLY : DP + USE gvecs, ONLY : nls, nlsm + USE wvfct, ONLY : igk + USE mp_global, ONLY : me_pool, me_bgrp + USE fft_base, ONLY : dffts, tg_gather + USE fft_interfaces,ONLY : fwfft, invfft + USE wavefunctions_module, ONLY: psic + ! + IMPLICIT NONE + ! + INTEGER, INTENT(in) :: lda, n, m + COMPLEX(DP), INTENT(in) :: psi (lda, m) + COMPLEX(DP), INTENT(inout):: hpsi (lda, m) + REAL(DP), INTENT(in) :: v(dffts%nnr) + ! + INTEGER :: ibnd, j, incr + ! + LOGICAL :: use_tg + ! Task Groups + REAL(DP), ALLOCATABLE :: tg_v(:) + COMPLEX(DP), ALLOCATABLE :: tg_psic(:) + INTEGER :: v_siz, idx, ioff + ! + ! + ! The following is dirty trick to prevent usage of task groups if + ! the number of bands is smaller than the number of task groups + ! + use_tg = dffts%have_task_groups + dffts%have_task_groups = dffts%have_task_groups .and. ( m >= dffts%nogrp ) + ! + incr = 1 + ! + IF( dffts%have_task_groups ) THEN + ! + v_siz = dffts%tg_nnr * dffts%nogrp + ! + ALLOCATE( tg_v ( v_siz ) ) + ALLOCATE( tg_psic( v_siz ) ) + ! + CALL tg_gather( dffts, v, tg_v ) + incr = dffts%nogrp + ! + ENDIF + ! + ! the local potential V_Loc psi. First bring psi to real space + ! + DO ibnd = 1, m, incr + ! + IF( dffts%have_task_groups ) THEN + ! + tg_psic = (0.d0, 0.d0) + ioff = 0 + ! + DO idx = 1, dffts%nogrp + + IF( idx + ibnd - 1 <= m ) THEN +!$omp parallel do + DO j = 1, n + tg_psic(nls (igk(j))+ioff) = psi(j,idx+ibnd-1) + ENDDO +!$omp end parallel do + ENDIF + + ioff = ioff + dffts%tg_nnr + + ENDDO + ! + CALL invfft ('Wave', tg_psic, dffts) + ! + ELSE + ! + psic(:) = (0.d0, 0.d0) + psic (nls (igk(1:n))) = psi(1:n, ibnd) + ! + CALL invfft ('Wave', psic, dffts) + ! + ENDIF + ! + ! fft to real space + ! product with the potential v on the smooth grid + ! back to reciprocal space + ! + IF( dffts%have_task_groups ) THEN + ! +!$omp parallel do + DO j = 1, dffts%nr1x*dffts%nr2x*dffts%tg_npp( me_bgrp + 1 ) + tg_psic (j) = tg_psic (j) * tg_v(j) + ENDDO +!$omp end parallel do + ! + CALL fwfft ('Wave', tg_psic, dffts) + ! + ELSE + ! +!$omp parallel do + DO j = 1, dffts%nnr + psic (j) = psic (j) * v(j) + ENDDO +!$omp end parallel do + ! + CALL fwfft ('Wave', psic, dffts) + ! + ENDIF + ! + ! addition to the total product + ! + IF( dffts%have_task_groups ) THEN + ! + ioff = 0 + ! + DO idx = 1, dffts%nogrp + ! + IF( idx + ibnd - 1 <= m ) THEN +!$omp parallel do + DO j = 1, n + hpsi (j, ibnd+idx-1) = hpsi (j, ibnd+idx-1) + tg_psic( nls(igk(j)) + ioff ) + ENDDO +!$omp end parallel do + ENDIF + ! + ioff = ioff + dffts%nr3x * dffts%nsw( me_bgrp + 1 ) + ! + ENDDO + ! + ELSE +!$omp parallel do + DO j = 1, n + hpsi (j, ibnd) = hpsi (j, ibnd) + psic (nls(igk(j))) + ENDDO +!$omp end parallel do + ENDIF + ! + ENDDO + ! + IF( dffts%have_task_groups ) THEN + ! + DEALLOCATE( tg_psic ) + DEALLOCATE( tg_v ) + ! + ENDIF + dffts%have_task_groups = use_tg + ! + RETURN +END SUBROUTINE vloc_psi_k diff --git a/tests/apps/miniDFT/tests/src/volume.f90 b/tests/apps/miniDFT/tests/src/volume.f90 new file mode 100644 index 0000000000..eda856217b --- /dev/null +++ b/tests/apps/miniDFT/tests/src/volume.f90 @@ -0,0 +1,62 @@ +! +! Copyright (C) 2001 PWSCF group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +!--------------------------------------------------------------------- +subroutine volume (alat, a1, a2, a3, omega) + !--------------------------------------------------------------------- + ! + ! Compute the volume of the unit cell + ! + use kinds, ONLY: DP + implicit none + ! + ! First the I/O variables + ! + real(DP) :: alat, a1 (3), a2 (3), a3 (3), omega + ! input: lattice parameter (unit length) + ! input: the first lattice vector + ! input: the second lattice vector + ! input: the third lattice vector + ! input: the volume of the unit cell + ! + ! Here the local variables required by the routine + ! + + real(DP) :: s + ! the sign of a permutation + integer :: i, j, k, l, iperm + !\ + ! \ + ! / auxiliary indices + !/ + ! counter on permutations + ! + ! Compute the volume + ! + omega = 0.d0 + s = 1.d0 + i = 1 + j = 2 + k = 3 +101 do iperm = 1, 3 + omega = omega + s * a1 (i) * a2 (j) * a3 (k) + l = i + i = j + j = k + k = l + enddo + i = 2 + j = 1 + k = 3 + s = - s + + if (s.lt.0.d0) goto 101 + + omega = abs (omega) * alat**3 + return +end subroutine volume diff --git a/tests/apps/miniDFT/tests/src/wavefunctions.f90 b/tests/apps/miniDFT/tests/src/wavefunctions.f90 new file mode 100644 index 0000000000..2e6f8340b2 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/wavefunctions.f90 @@ -0,0 +1,51 @@ +! +! Copyright (C) 2002-2011 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! + +!=----------------------------------------------------------------------------=! + MODULE wavefunctions_module +!=----------------------------------------------------------------------------=! + USE kinds, ONLY : DP + + IMPLICIT NONE + SAVE + + ! + COMPLEX(DP), ALLOCATABLE, TARGET :: & + evc(:,:) ! wavefunctions in the PW basis set + ! noncolinear case: first index + ! is a combined PW + spin index + ! + COMPLEX(DP) , ALLOCATABLE, TARGET :: & + psic(:), & ! additional memory for FFT + psic_nc(:,:) ! as above for the noncolinear case + ! + ! + ! electronic wave functions, CPV code + ! distributed over gvector and bands + ! + COMPLEX(DP), ALLOCATABLE :: c0_bgrp(:,:) ! wave functions at time t + COMPLEX(DP), ALLOCATABLE :: cm_bgrp(:,:) ! wave functions at time t-delta t + COMPLEX(DP), ALLOCATABLE :: phi_bgrp(:,:) ! |phi> = s'|c0> = |c0> + sum q_ij |i> + ! for hybrid functionals in CP with Wannier functions + COMPLEX(DP), ALLOCATABLE :: cv0(:,:) ! Lingzhu Kong + + CONTAINS + + SUBROUTINE deallocate_wavefunctions + IF( ALLOCATED( cv0) ) DEALLOCATE( cv0) ! Lingzhu Kong + IF( ALLOCATED( c0_bgrp ) ) DEALLOCATE( c0_bgrp ) + IF( ALLOCATED( cm_bgrp ) ) DEALLOCATE( cm_bgrp ) + IF( ALLOCATED( phi_bgrp ) ) DEALLOCATE( phi_bgrp ) + IF( ALLOCATED( psic_nc ) ) DEALLOCATE( psic_nc ) + IF( ALLOCATED( psic ) ) DEALLOCATE( psic ) + IF( ALLOCATED( evc ) ) DEALLOCATE( evc ) + END SUBROUTINE deallocate_wavefunctions + +!=----------------------------------------------------------------------------=! + END MODULE wavefunctions_module +!=----------------------------------------------------------------------------=! diff --git a/tests/apps/miniDFT/tests/src/weights.f90 b/tests/apps/miniDFT/tests/src/weights.f90 new file mode 100644 index 0000000000..cd5b2a4967 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/weights.f90 @@ -0,0 +1,65 @@ +! +! Copyright (C) 2001-2011 PWSCF group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +!---------------------------------------------------------------------------- +SUBROUTINE weights() + !---------------------------------------------------------------------------- + ! + ! ... calculates weights of Kohn-Sham orbitals used in calculation of rho, + ! ... Fermi energies, HOMO and LUMO, "-TS" term (gaussian) + ! + USE kinds, ONLY : DP + USE ener, ONLY : demet, ef, ef_up, ef_dw + USE fixed_occ, ONLY : f_inp, tfixed_occ + USE klist, ONLY : lgauss, degauss, ngauss, nks, & + nkstot, wk, xk, nelec, nelup, neldw, & + two_fermi_energies + USE ktetra, ONLY : ltetra, ntetra, tetra + USE lsda_mod, ONLY : nspin, current_spin, isk + USE wvfct, ONLY : nbnd, wg, et + USE mp_global, ONLY : intra_image_comm, inter_pool_comm + USE mp, ONLY : mp_bcast, mp_sum + USE io_global, ONLY : ionode, ionode_id + ! + IMPLICIT NONE + ! + ! ... local variables + ! + INTEGER :: ibnd, ik ! counters: bands, k-points + real (DP) demet_up, demet_dw + ! + demet = 0.D0 + ! + ! + ! ... calculate weights for the insulator case + ! + IF ( two_fermi_energies ) THEN + ! + CALL iweights( nks, wk, nbnd, nelup, et, ef_up, wg, 1, isk ) + CALL iweights( nks, wk, nbnd, neldw, et, ef_dw, wg, 2, isk ) + ! + ! the following line to prevent NaN in Ef + ! + ef = ( ef_up + ef_dw ) / 2.0_dp + ! + ELSE + ! + CALL iweights( nks, wk, nbnd, nelec, et, ef, wg, 0, isk ) + ! + END IF + ! + ! + ! ... collect all weights on the first pool; + ! ... not needed for calculation but useful for printout + ! + CALL poolrecover( wg, nbnd, nkstot, nks ) + ! + ! + RETURN + ! +END SUBROUTINE weights diff --git a/tests/apps/miniDFT/tests/src/wfcinit.f90 b/tests/apps/miniDFT/tests/src/wfcinit.f90 new file mode 100644 index 0000000000..9c08ae80aa --- /dev/null +++ b/tests/apps/miniDFT/tests/src/wfcinit.f90 @@ -0,0 +1,281 @@ +! +! Copyright (C) 2001-2007 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +! +!---------------------------------------------------------------------------- +SUBROUTINE wfcinit() + !---------------------------------------------------------------------------- + ! + ! ... This routine computes an estimate of the starting wavefunctions + ! ... from superposition of atomic wavefunctions and/or random wavefunctions. + ! + USE io_global, ONLY : stdout + USE basis, ONLY : natomwfc, starting_wfc + USE klist, ONLY : xk, nks, ngk + USE control_flags, ONLY : io_level, lscf + USE fixed_occ, ONLY : one_atom_occupations + USE lsda_mod, ONLY : lsda, current_spin, isk + USE io_files, ONLY : nwordwfc, nwordatwfc, iunwfc, iunigk, iunsat + USE buffers, ONLY : get_buffer, save_buffer + USE uspp, ONLY : nkb, vkb + USE wavefunctions_module, ONLY : evc + USE wvfct, ONLY : nbnd, npw, current_k, igk + ! + IMPLICIT NONE + ! + INTEGER :: ik + ! + ! + CALL start_clock( 'wfcinit' ) + ! + ! ... state what is going to happen + ! + IF ( TRIM(starting_wfc) == 'file' ) THEN + ! + WRITE( stdout, '(5X,"Starting wfc from file")' ) + ! + ELSE IF ( starting_wfc == 'atomic' ) THEN + ! + IF ( natomwfc >= nbnd ) THEN + ! + WRITE( stdout, '(5X,"Starting wfc are ",I4," atomic wfcs")' ) natomwfc + ! + ELSE + ! + WRITE( stdout, '(5X,"Starting wfc are ",I4," atomic + ", & + & I4," random wfc")' ) natomwfc, nbnd-natomwfc + ! + END IF + ! + ELSE IF ( TRIM(starting_wfc) == 'atomic+random' ) THEN + ! + WRITE( stdout, '(5X,"Starting wfc are ",I4," randomized atomic wfcs")' ) & + natomwfc + ! + ELSE + ! + WRITE( stdout, '(5X,"Starting wfc are random")' ) + ! + END IF + IF ( .NOT. lscf ) THEN + ! + CALL stop_clock( 'wfcinit' ) + ! + RETURN + ! + END IF + ! + IF ( TRIM(starting_wfc) == 'file' ) THEN + ! + ! ... wavefunctions are to be read from file: store wavefunction into + ! ... memory if c_bands will not do it (for a single k-point); + ! ... return and do nothing otherwise (c_bands will read wavefunctions) + ! +#ifdef __IGKIO + IF ( nks == 1 .AND. (io_level < 2) ) & + CALL get_buffer ( evc, nwordwfc, iunwfc, 1 ) +#endif + ! + CALL stop_clock( 'wfcinit' ) + ! + RETURN + ! + END IF + ! +#ifdef __IGKIO + IF ( nks > 1 ) REWIND( iunigk ) !BMA eliminate fs activity for miniDFT +#endif + ! + ! ... calculate and write all starting wavefunctions to file + ! + DO ik = 1, nks + ! + ! ... various initializations: k, spin, number of PW, indices + ! + current_k = ik + IF ( lsda ) current_spin = isk(ik) + npw = ngk (ik) + ! +#ifdef __IGKIO + IF ( nks > 1 ) READ( iunigk ) igk !BMA eliminate fs activity for miniDFT +#endif + ! + call g2_kin (ik) + ! + ! ... Calculate nonlocal pseudopotential projectors |beta> + ! + IF ( nkb > 0 ) CALL init_us_2( npw, igk, xk(1,ik), vkb ) + ! + ! ... LDA+U: read atomic wavefunctions for U term in Hamiltonian + ! + ! + ! ... calculate starting wavefunctions + ! + CALL init_wfc ( ik ) + ! + ! ... write starting wavefunctions to file + ! +#ifdef __IGKIO + IF ( nks > 1 .OR. (io_level > 1) ) & + CALL save_buffer ( evc, nwordwfc, iunwfc, ik ) +#endif + ! + END DO + ! + CALL stop_clock( 'wfcinit' ) + ! + RETURN + ! +END SUBROUTINE wfcinit +! +!---------------------------------------------------------------------------- +SUBROUTINE init_wfc ( ik ) + !---------------------------------------------------------------------------- + ! + ! ... This routine computes starting wavefunctions for k-point ik + ! + USE kinds, ONLY : DP + USE becmod, ONLY : allocate_bec_type, deallocate_bec_type, & + bec_type, becp + USE constants, ONLY : tpi + USE cell_base, ONLY : tpiba2 + USE basis, ONLY : natomwfc, starting_wfc + USE gvect, ONLY : g, gstart + USE klist, ONLY : xk + USE wvfct, ONLY : nbnd, npw, npwx, igk, et + USE uspp, ONLY : nkb, okvan + USE wavefunctions_module, ONLY : evc + USE random_numbers, ONLY : randy + USE mp_global, ONLY : intra_bgrp_comm + ! + IMPLICIT NONE + ! + integer, parameter :: npol=1 !substitute for noncollin_module + ! + INTEGER :: ik + ! + INTEGER :: ibnd, ig, ipol, n_starting_wfc, n_starting_atomic_wfc + LOGICAL :: lelfield_save + ! + REAL(DP) :: rr, arg + REAL(DP), ALLOCATABLE :: etatom(:) ! atomic eigenvalues + ! + COMPLEX(DP), ALLOCATABLE :: wfcatom(:,:,:) ! atomic wfcs for initialization + ! + ! + IF ( starting_wfc(1:6) == 'atomic' ) THEN + ! + n_starting_wfc = MAX( natomwfc, nbnd ) + n_starting_atomic_wfc = natomwfc + ! + ELSE IF ( starting_wfc == 'random' ) THEN + ! + n_starting_wfc = nbnd + n_starting_atomic_wfc = 0 + ! + ELSE + ! + ! ...case 'file' should not be done here + ! + CALL errore ( 'init_wfc', & + 'invalid value for startingwfc: ' // TRIM ( starting_wfc ) , 1 ) + ! + END IF + ! + ALLOCATE( wfcatom( npwx, npol, n_starting_wfc ) ) + ! + IF ( starting_wfc(1:6) == 'atomic' ) THEN + ! + CALL atomic_wfc( ik, wfcatom ) + ! + IF ( starting_wfc == 'atomic+random' .AND. & + n_starting_wfc == n_starting_atomic_wfc ) THEN + ! + ! ... in this case, introduce a small randomization of wavefunctions + ! ... to prevent possible "loss of states" + ! + DO ibnd = 1, n_starting_atomic_wfc + ! + DO ipol = 1, npol + ! +!$OMP PARALLEL DO DEFAULT(SHARED) PRIVATE(ig, rr, arg) + DO ig = 1, npw + ! + rr = randy() + arg = tpi * randy() + ! + wfcatom(ig,ipol,ibnd) = wfcatom(ig,ipol,ibnd) * & + ( 1.0_DP + 0.05_DP * CMPLX( rr*COS(arg), rr*SIN(arg) ,kind=DP) ) + ! + END DO +!$OMP END PARALLEL DO + ! + END DO + ! + END DO + ! + END IF + ! + END IF + ! + ! ... if not enough atomic wfc are available, + ! ... fill missing wfcs with random numbers + ! + DO ibnd = n_starting_atomic_wfc + 1, n_starting_wfc + ! + DO ipol = 1, npol + ! + wfcatom(:,ipol,ibnd) = (0.0_dp, 0.0_dp) + ! +!$OMP PARALLEL DO DEFAULT(SHARED) PRIVATE(ig, rr, arg) + DO ig = 1, npw + ! + rr = randy() + arg = tpi * randy() + ! + wfcatom(ig,ipol,ibnd) = & + CMPLX( rr*COS( arg ), rr*SIN( arg ) ,kind=DP) / & + ( ( xk(1,ik) + g(1,igk(ig)) )**2 + & + ( xk(2,ik) + g(2,igk(ig)) )**2 + & + ( xk(3,ik) + g(3,igk(ig)) )**2 + 1.0_DP ) + END DO +!$OMP END PARALLEL DO + ! + END DO + ! + END DO + ! + ! ... Diagonalize the Hamiltonian on the basis of atomic wfcs + ! + ALLOCATE( etatom( n_starting_wfc ) ) + ! + ! ... Allocate space for + ! + CALL allocate_bec_type ( nkb, n_starting_wfc, becp, intra_bgrp_comm ) + ! + ! ... the following trick is for electric fields with Berry's phase: + ! ... by setting lelfield = .false. one prevents the calculation of + ! ... electric enthalpy in the Hamiltonian (cannot be calculated + ! ... at this stage: wavefunctions at previous step are missing) + ! + ! + CALL rotate_wfc ( npwx, npw, n_starting_wfc, gstart, & + nbnd, wfcatom, npol, okvan, evc, etatom ) + ! + ! + ! ... copy the first nbnd eigenvalues + ! ... eigenvectors are already copied inside routine rotate_wfc + ! + et(1:nbnd,ik) = etatom(1:nbnd) + ! + CALL deallocate_bec_type ( becp ) + DEALLOCATE( etatom ) + DEALLOCATE( wfcatom ) + ! + RETURN + ! +END SUBROUTINE init_wfc diff --git a/tests/apps/miniDFT/tests/src/wrappers.f90 b/tests/apps/miniDFT/tests/src/wrappers.f90 new file mode 100644 index 0000000000..bd6642c437 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/wrappers.f90 @@ -0,0 +1,392 @@ +! +! Copyright (C) 2004-2012 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +!-------------------------------------------------------------------------- +! +! NOTE: by default the following macro is DISABLED: the default version of the +! subroutines and functions is in the second half of the file. +! +! NOTE: the mkdir function is NOT called directly as it return error on directory +! already existing, we are instead using a c wrapper (c_mkdir_safe) +#ifdef __ISO_C_BINDING +! +MODULE wrappers + USE kinds, ONLY : DP + USE io_global, ONLY : stdout + USE ISO_C_BINDING + IMPLICIT NONE + ! + ! C std library functions fortran wrappers: + PUBLIC f_remove, f_link, rename, f_chdir, f_mkdir, f_rmdir, f_getcwd + ! more stuff: + PUBLIC feval_infix, md5_from_file + ! + ! HELP: + ! integer f_remove(pathname) + ! integer f_rename(oldfile, newfile) + ! integer f_chdir(newdir) + ! integer f_chmod(mode) i.e. mode=777 + ! integer f_mkdir(dirname, mode) mode is optional + ! integer f_rmdir(dirname) + ! subroutine f_getcwd(dirname) + ! All *name are fortran characters of any length characters, + ! mode are integers, all functions return 0 if successful, -1 otherwise + ! + ! real(dp) :: result = feval_infix(integer:: ierr, character(len=*) :: expression) + ! subroutine md5_from_file(character(len=*) :: filename, character(len=32) ::md5) + PRIVATE + ! + SAVE + ! + ! Interfaces to the C functions, these are kept private as Fortran + ! characters have (?) to be converted explicitly to C character arrays. + ! Use the f_* wrappers instead + INTERFACE + FUNCTION remove(pathname) BIND(C,name="remove") RESULT(r) + USE iso_c_binding + CHARACTER(kind=c_char),INTENT(in) :: pathname(*) + INTEGER(c_int) :: r + END FUNCTION + FUNCTION rename(input,output) BIND(C,name="rename") RESULT(r) + USE iso_c_binding + CHARACTER(kind=c_char),INTENT(in) :: input(*) + CHARACTER(kind=c_char),INTENT(in) :: output(*) + INTEGER(c_int) :: r + END FUNCTION + FUNCTION link(input,output) BIND(C,name="link") RESULT(r) + USE iso_c_binding + CHARACTER(kind=c_char),INTENT(in) :: input(*) + CHARACTER(kind=c_char),INTENT(in) :: output(*) + INTEGER(c_int) :: r + END FUNCTION +! FUNCTION chmod(filename,mode) BIND(C,name="chmod") RESULT(r) +! USE iso_c_binding +! CHARACTER(kind=c_char),INTENT(in) :: filename(*) +! INTEGER(c_int),VALUE ,INTENT(in) :: mode +! INTEGER(c_int) :: r +! END FUNCTION + FUNCTION chdir(filename) BIND(C,name="chdir") RESULT(r) + USE iso_c_binding + CHARACTER(kind=c_char),INTENT(in) :: filename(*) + INTEGER(c_int) :: r + END FUNCTION +! FUNCTION mkdir(dirname,mode) BIND(C,name="c_mkdir") RESULT(r) +! USE iso_c_binding +! CHARACTER(kind=c_char),INTENT(in) :: dirname(*) +! INTEGER(c_int),VALUE ,INTENT(in) :: mode +! INTEGER(c_int) :: r +! END FUNCTION + FUNCTION mkdir_safe(dirname) BIND(C,name="c_mkdir_safe") RESULT(r) + USE iso_c_binding + CHARACTER(kind=c_char),INTENT(in) :: dirname(*) + INTEGER(c_int) :: r + END FUNCTION + FUNCTION rmdir(dirname) BIND(C,name="rmdir") RESULT(r) + USE iso_c_binding + CHARACTER(kind=c_char),INTENT(in) :: dirname(*) + INTEGER(c_int) :: r + END FUNCTION + FUNCTION getcwd(buffer,size) BIND(C,name="getcwd") RESULT(r) + USE iso_c_binding + CHARACTER(kind=c_char) ,INTENT(out) :: buffer(*) + INTEGER(c_size_t),VALUE,INTENT(in) :: size + TYPE(c_ptr) :: r + END FUNCTION + END INTERFACE + ! + ! ==================================================================== +CONTAINS + ! ==================================================================== + ! fortran wrappers functions that call the C functions after converting + ! frotran characters to C character arrays + FUNCTION f_remove(filename) RESULT(r) + CHARACTER(*),INTENT(in) :: filename + INTEGER(c_int) :: r + r= remove(TRIM(filename)//C_NULL_CHAR) + END FUNCTION + + FUNCTION f_rename(input,output) RESULT(k) + CHARACTER(*),INTENT(in) :: input,output + INTEGER :: k + k= rename(TRIM(input)//C_NULL_CHAR,TRIM(output)//C_NULL_CHAR) + END FUNCTION + + FUNCTION f_link(input,output) RESULT(k) + CHARACTER(*),INTENT(in) :: input,output + INTEGER :: k + k= link(TRIM(input)//C_NULL_CHAR,TRIM(output)//C_NULL_CHAR) + END FUNCTION + + FUNCTION f_chdir(dirname) RESULT(r) + CHARACTER(*),INTENT(in) :: dirname + INTEGER(c_int) :: r + r= chdir(TRIM(dirname)//C_NULL_CHAR) + END FUNCTION + + FUNCTION f_mkdir(dirname) RESULT(r) + CHARACTER(*),INTENT(in) :: dirname + INTEGER(c_int) :: r + r= mkdir_safe(TRIM(dirname)//C_NULL_CHAR) + END FUNCTION + +! FUNCTION f_chmod(filename, mode) RESULT(r) +! CHARACTER(*),INTENT(in) :: filename +! INTEGER,INTENT(in) :: mode +! INTEGER(c_int) :: r +! INTEGER(c_int) :: c_mode +! c_mode = INT(mode, kind=c_int) +! r= chmod(TRIM(filename)//C_NULL_CHAR, c_mode) +! END FUNCTION + + FUNCTION f_rmdir(dirname) RESULT(r) + CHARACTER(*),INTENT(in) :: dirname + INTEGER(c_int) :: r + r= rmdir(TRIM(dirname)//C_NULL_CHAR) + END FUNCTION + + SUBROUTINE f_getcwd(output) + CHARACTER(kind=c_char,len=*),INTENT(out) :: output + TYPE(c_ptr) :: buffer + INTEGER(C_LONG) :: length,i + length=LEN(output) + buffer=getcwd(output,length) + DO i=1,length + IF(output(i:i) == C_NULL_CHAR) EXIT + ENDDO + output(i:)=' ' + END SUBROUTINE + ! + ! ==================================================================== + ! Two more wrappers for eval_infix (simple algebric expression parser) + ! and for get_md5 which computes the md5 sum of a file. + ! + FUNCTION feval_infix(fierr, fstr) + IMPLICIT NONE + REAL(DP) :: feval_infix + INTEGER :: fierr + CHARACTER(len=*) :: fstr + INTEGER :: filen + ! + INTERFACE + REAL(kind=c_double) FUNCTION ceval_infix(cierr, cstr, cilen) BIND(C, name="eval_infix") + ! double eval_infix( int *ierr, const char *strExpression, int len ) + USE ISO_C_BINDING + INTEGER(kind=c_int) :: cierr + CHARACTER(kind=c_char) :: cstr(*) + INTEGER(kind=c_int),VALUE :: cilen + END FUNCTION ceval_infix + END INTERFACE + ! + INTEGER(kind=c_int) :: cierr + INTEGER(kind=c_int) :: cilen + CHARACTER(len=len_trim(fstr)+1,kind=c_char) :: cstr + ! + INTEGER :: i + ! + filen = len_trim(fstr) + cilen = INT(filen, kind=c_int) + DO i = 1,filen + cstr(i:i) = fstr(i:i) + ENDDO + cstr(filen+1:filen+1)=C_NULL_CHAR + ! + feval_infix = REAL( ceval_infix(cierr, cstr, cilen), kind=DP) + fierr = INT(cierr) + RETURN + END FUNCTION feval_infix + ! + ! + SUBROUTINE md5_from_file (ffile, fmd5) + IMPLICIT NONE + CHARACTER(LEN=*), INTENT (IN) :: ffile + CHARACTER(len=32), INTENT (OUT) :: fmd5 + ! + INTERFACE + SUBROUTINE cget_md5(cfile, cmd5, cierr) BIND(C, name="get_md5") + ! void get_md5(const char *file, char *md5, int err) + USE ISO_C_BINDING + CHARACTER(kind=c_char) :: cfile(*) + CHARACTER(kind=c_char) :: cmd5(*) + INTEGER(kind=c_int) :: cierr + END SUBROUTINE cget_md5 + END INTERFACE + ! + INTEGER,PARAMETER :: md5_length = 32 + INTEGER :: i + ! + CHARACTER(len=len_trim(ffile)+1,kind=c_char) :: cfile!(*) + CHARACTER(len=(md5_length+1),kind=c_char) :: cmd5!(*) + INTEGER(kind=c_int) :: cierr + ! + cfile = TRIM(ffile)//C_NULL_CHAR + ! + CALL cget_md5(cfile, cmd5, cierr) + ! + DO i = 1,md5_length + fmd5(i:i) = cmd5(i:i) + ENDDO + ! + END SUBROUTINE +END MODULE +! ==================================================================== +#else +! interfaces not using iso_c_binding follow +! ==================================================================== +MODULE wrappers + ! + ! these routines are used to pass fortran strings to C routines in a + ! safe way. Strings are converted to integer arrays here, passed to + ! C wrappers, converted back to strings. Other ways to pass fortran + ! strings to C turned out to be non portable and not safe + ! + USE kinds, ONLY : DP + USE io_global, ONLY : stdout + IMPLICIT NONE + SAVE +CONTAINS + ! + FUNCTION feval_infix( ierr, str ) + REAL(DP) :: feval_infix + INTEGER :: ierr + CHARACTER(LEN=*) :: str + INTEGER :: i, ilen + INTEGER, ALLOCATABLE :: istr(:) + REAL(DP), EXTERNAL :: eval_infix_wrapper + ALLOCATE( istr( LEN( str ) ) ) + DO i = 1, LEN( str ) + istr(i) = ICHAR( str(i:i) ) + IF( istr(i) < 0 .OR. istr(i) > 127 ) & + CALL errore( ' feval_infix ', ' invalid character ', ABS( istr(i) ) ) + END DO + ilen = LEN( str ) + feval_infix = eval_infix_wrapper( ierr, istr, ilen ) + DEALLOCATE( istr ) + RETURN + END FUNCTION + ! + FUNCTION f_mkdir( dirname ) + INTEGER :: f_mkdir + CHARACTER(LEN=*) :: dirname + INTEGER :: i, ilen + INTEGER, ALLOCATABLE :: istr(:) + INTEGER, EXTERNAL :: c_mkdir_int + ALLOCATE( istr( LEN_TRIM( dirname ) ) ) + DO i = 1, LEN_TRIM( dirname ) + istr(i) = ICHAR( dirname(i:i) ) + IF( istr(i) < 0 .OR. istr(i) > 127 ) & + CALL errore( ' f_mkdir ', ' invalid character ', ABS( istr(i) ) ) + END DO + ilen = LEN_TRIM( dirname ) + f_mkdir = c_mkdir_int( istr, ilen ) + DEALLOCATE( istr ) + RETURN + END FUNCTION + ! + FUNCTION f_chdir( dirname ) + INTEGER :: f_chdir + CHARACTER(LEN=*) :: dirname + INTEGER :: i, ilen + INTEGER, ALLOCATABLE :: istr(:) + INTEGER, EXTERNAL :: c_chdir_int + ALLOCATE( istr( LEN_TRIM( dirname ) ) ) + DO i = 1, LEN_TRIM( dirname ) + istr(i) = ICHAR( dirname(i:i) ) + IF( istr(i) < 0 .OR. istr(i) > 127 ) & + CALL errore( ' f_chdir ', ' invalid character ', ABS( istr(i) ) ) + END DO + ilen = LEN_TRIM( dirname ) + f_chdir = c_chdir_int( istr, ilen ) + DEALLOCATE( istr ) + RETURN + END FUNCTION + ! + FUNCTION f_rename( oldname, newname ) + INTEGER :: f_rename + CHARACTER(LEN=*) :: oldname + CHARACTER(LEN=*) :: newname + INTEGER :: i, lold, lnew + INTEGER, ALLOCATABLE :: iold(:) + INTEGER, ALLOCATABLE :: inew(:) + INTEGER, EXTERNAL :: c_rename_int + lold = LEN( oldname ) + lnew = LEN( newname ) + ALLOCATE( iold( lold ) ) + ALLOCATE( inew( lnew ) ) + DO i = 1, lold + iold(i) = ICHAR( oldname(i:i) ) + IF( iold(i) < 0 .OR. iold(i) > 127 ) & + CALL errore( ' f_rename ', ' invalid character ', ABS( iold(i) ) ) + END DO + DO i = 1, lnew + inew(i) = ICHAR( newname(i:i) ) + IF( inew(i) < 0 .OR. inew(i) > 127 ) & + CALL errore( ' f_rename ', ' invalid character ', ABS( inew(i) ) ) + END DO + f_rename = c_rename_int( iold, lold, inew, lnew ) + DEALLOCATE( inew ) + DEALLOCATE( iold ) + RETURN + END FUNCTION + ! + FUNCTION f_link( oldname, newname ) + INTEGER :: f_link + CHARACTER(LEN=*) :: oldname + CHARACTER(LEN=*) :: newname + INTEGER :: i, lold, lnew + INTEGER, ALLOCATABLE :: iold(:) + INTEGER, ALLOCATABLE :: inew(:) + INTEGER, EXTERNAL :: c_link_int + lold = LEN( oldname ) + lnew = LEN( newname ) + ALLOCATE( iold( lold ) ) + ALLOCATE( inew( lnew ) ) + DO i = 1, lold + iold(i) = ICHAR( oldname(i:i) ) + IF( iold(i) < 0 .OR. iold(i) > 127 ) & + CALL errore( ' f_link ', ' invalid character ', ABS( iold(i) ) ) + END DO + DO i = 1, lnew + inew(i) = ICHAR( newname(i:i) ) + IF( inew(i) < 0 .OR. inew(i) > 127 ) & + CALL errore( ' f_link ', ' invalid character ', ABS( inew(i) ) ) + END DO + f_link = c_link_int( iold, lold, inew, lnew ) + DEALLOCATE( inew ) + DEALLOCATE( iold ) + RETURN + END FUNCTION + ! + + SUBROUTINE md5_from_file (filename, md5) + + CHARACTER(LEN=*), INTENT (IN) :: filename + CHARACTER(len=32), INTENT (OUT) :: md5 + CHARACTER(LEN=len_trim(filename)) :: ftrim + + INTEGER , EXTERNAL :: file_md5 + INTEGER, ALLOCATABLE :: istr(:) + INTEGER :: getter(32), retval, i, ilen + + ftrim = TRIM(filename) + ilen = LEN(ftrim ) + ALLOCATE( istr( ilen ) ) + DO i = 1, ilen + istr(i) = ichar( ftrim(i:i) ) + ENDDO + + retval = file_md5( istr, ilen, getter ) + + DO i = 1,32 + md5(i:i) = char( getter(i) ) + ENDDO + + DEALLOCATE( istr ) + + END SUBROUTINE + ! +END MODULE +#endif diff --git a/tests/apps/miniDFT/tests/src/ylmr2.f90 b/tests/apps/miniDFT/tests/src/ylmr2.f90 new file mode 100644 index 0000000000..ca9688da00 --- /dev/null +++ b/tests/apps/miniDFT/tests/src/ylmr2.f90 @@ -0,0 +1,149 @@ +! +! Copyright (C) 2001-2007 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +!----------------------------------------------------------------------- +subroutine ylmr2 (lmax2, ng, g, gg, ylm) + !----------------------------------------------------------------------- + ! + ! Real spherical harmonics ylm(G) up to l=lmax + ! lmax2 = (lmax+1)^2 is the total number of spherical harmonics + ! Numerical recursive algorithm based on the one given in Numerical + ! Recipes but avoiding the calculation of factorials that generate + ! overflow for lmax > 11 + ! + USE kinds, ONLY : DP + USE constants, ONLY : pi, fpi + implicit none + ! + integer, intent(in) :: lmax2, ng + real(DP), intent(in) :: g (3, ng), gg (ng) + ! + ! BEWARE: gg = g(1)^2 + g(2)^2 +g(3)^2 is not checked on input + ! incorrect results will ensue if the above does not hold + ! + real(DP), intent(out) :: ylm (ng,lmax2) + ! + ! local variables + ! + real(DP), parameter :: eps = 1.0d-9 + real(DP), allocatable :: cost (:), sent(:), phi (:), Q(:,:,:) + real(DP) :: c, gmod + integer :: lmax, ig, l, m, lm + ! + if (ng < 1 .or. lmax2 < 1) return + do lmax = 0, 25 + if ((lmax+1)**2 == lmax2) go to 10 + end do + call errore (' ylmr', 'l > 25 or wrong number of Ylm required',lmax2) +10 continue + + ! + if (lmax == 0) then + ylm(:,1) = sqrt (1.d0 / fpi) + return + end if + ! + ! theta and phi are polar angles, cost = cos(theta) + ! + allocate(cost(ng), sent(ng), phi(ng), Q(ng,0:lmax,0:lmax) ) + ! +!$omp parallel default(shared), private(ig,gmod,lm,l,c,m) + +!$omp do + do ig = 1, ng + gmod = sqrt (gg (ig) ) + if (gmod < eps) then + cost(ig) = 0.d0 + else + cost(ig) = g(3,ig)/gmod + endif + ! + ! beware the arc tan, it is defined modulo pi + ! + if (g(1,ig) > eps) then + phi (ig) = atan( g(2,ig)/g(1,ig) ) + else if (g(1,ig) < -eps) then + phi (ig) = atan( g(2,ig)/g(1,ig) ) + pi + else + phi (ig) = sign( pi/2.d0,g(2,ig) ) + end if + sent(ig) = sqrt(max(0d0,1.d0-cost(ig)**2)) + enddo + ! + ! Q(:,l,m) are defined as sqrt ((l-m)!/(l+m)!) * P(:,l,m) where + ! P(:,l,m) are the Legendre Polynomials (0 <= m <= l) + ! + lm = 0 + do l = 0, lmax + c = sqrt (DBLE(2*l+1) / fpi) + if ( l == 0 ) then +!$omp do + do ig = 1, ng + Q (ig,0,0) = 1.d0 + end do + else if ( l == 1 ) then +!$omp do + do ig = 1, ng + Q (ig,1,0) = cost(ig) + Q (ig,1,1) =-sent(ig)/sqrt(2.d0) + end do + else + ! + ! recursion on l for Q(:,l,m) + ! + do m = 0, l - 2 +!$omp do + do ig = 1, ng + Q(ig,l,m) = cost(ig)*(2*l-1)/sqrt(DBLE(l*l-m*m))*Q(ig,l-1,m) & + - sqrt(DBLE((l-1)*(l-1)-m*m))/sqrt(DBLE(l*l-m*m))*Q(ig,l-2,m) + end do + end do +!$omp do + do ig = 1, ng + Q(ig,l,l-1) = cost(ig) * sqrt(DBLE(2*l-1)) * Q(ig,l-1,l-1) + end do +!$omp do + do ig = 1, ng + Q(ig,l,l) = - sqrt(DBLE(2*l-1))/sqrt(DBLE(2*l))*sent(ig)*Q(ig,l-1,l-1) + end do + end if + ! + ! Y_lm, m = 0 + ! + lm = lm + 1 +!$omp do + do ig = 1, ng + ylm(ig, lm) = c * Q(ig,l,0) + end do + ! + do m = 1, l + ! + ! Y_lm, m > 0 + ! + lm = lm + 1 +!$omp do + do ig = 1, ng + ylm(ig, lm) = c * sqrt(2.d0) * Q(ig,l,m) * cos (m*phi(ig)) + end do + ! + ! Y_lm, m < 0 + ! + lm = lm + 1 +!$omp do + do ig = 1, ng + ylm(ig, lm) = c * sqrt(2.d0) * Q(ig,l,m) * sin (m*phi(ig)) + end do + end do + end do + ! +!$omp end parallel + ! + deallocate(cost, sent, phi, Q) + ! + return +end subroutine ylmr2 + diff --git a/tests/apps/miniDFT/tests/src/zhpev_drv.f90 b/tests/apps/miniDFT/tests/src/zhpev_drv.f90 new file mode 100644 index 0000000000..f3d576736f --- /dev/null +++ b/tests/apps/miniDFT/tests/src/zhpev_drv.f90 @@ -0,0 +1,1477 @@ +! +! Copyright (C) 2001-2009 Quantum ESPRESSO group +! This file is distributed under the terms of the +! GNU General Public License. See the file `License' +! in the root directory of the present distribution, +! or http://www.gnu.org/copyleft/gpl.txt . +! +MODULE zhpev_module + + IMPLICIT NONE + SAVE + + PRIVATE + + PUBLIC :: pzhpev_drv, zhpev_drv + PUBLIC :: pzheevd_drv + + +CONTAINS + ! + !------------------------------------------------------------------------- + SUBROUTINE pzhptrd( n, nrl, ap, lda, d, e, tau, nproc, me, comm ) + !------------------------------------------------------------------------- + ! + ! Parallel MPI version of the LAPACK routine ZHPTRD + ! + ! Carlo Cavazzoni (carlo.cavazzoni@cineca.it) -- CINECA + ! Dicember 12, 1999 + ! + ! REFERENCES : + ! + ! NUMERICAL RECIPES, THE ART OF SCIENTIFIC COMPUTING. + ! W.H. PRESS, B.P. FLANNERY, S.A. TEUKOLSKY, AND W.T. VETTERLING, + ! CAMBRIDGE UNIVERSITY PRESS, CAMBRIDGE. + ! + ! PARALLEL NUMERICAL ALGORITHMS, + ! T.L. FREEMAN AND C.PHILLIPS, + ! PRENTICE HALL INTERNATIONAL (1992). + ! + ! LAPACK routine (version 2.0) -- + ! Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + ! Courant Institute, Argonne National Lab, and Rice University + ! + + USE kinds, ONLY : DP + USE io_global, ONLY : stdout + + IMPLICIT NONE + +! .. __SCALAR Arguments .. + INTEGER LDA, N, NRL, NPROC, ME, comm +! .. +! .. Array Arguments .. + REAL(DP) D( * ), E( * ) + COMPLEX(DP) AP(LDA, * ), TAU( * ) +! .. +! +! Purpose +! ======= +! +! PZHPTRD reduces a complex Hermitian distributed matrix AP to +! real symmetric tridiagonal form T by a unitary similarity +! transformation: Q**H * A * Q = T. +! +! Arguments +! ========= +! +! N (input) INTEGER +! The order of the mglobal atrix AP. N >= 0. +! +! NRL (input) INTEGER +! The number of local rows of the matrix AP. NRL >= 0. +! +! AP (input/output) COMPLEX(DP) array, dimension (LDA,N) +! On entry, the Hermitian matrix AP. +! The rows of the matrix are distributed among processors +! with blocking factor 1. +! Example for NPROC = 4 : +! ROW | PE +! 1 | 0 +! 2 | 1 +! 3 | 2 +! 4 | 3 +! 5 | 0 +! 6 | 1 +! .. | .. + +! On exit, the diagonal and first subdiagonal +! of A are overwritten by the corresponding elements of the +! tridiagonal matrix T, and the elements below the first +! subdiagonal, with the array TAU, represent the unitary +! matrix Q as a product of elementary reflectors; +! +! LDA (input) INTEGER +! Leading dimension of the local matrix AP, LDA > NRL +! +! D (output) DOUBLE PRECISION array, dimension (N) +! The diagonal elements of the tridiagonal matrix T: +! D(i) = AP(i,i). +! +! E (output) DOUBLE PRECISION array, dimension (N-1) +! The off-diagonal elements of the tridiagonal matrix T: +! E(i) = A(i+1,i) +! +! TAU (output) COMPLEX(DP) array, dimension (N-1) +! The __SCALAR factors of the elementary reflectors (see Further +! Details). +! +! NPROC (input) INTEGER +! Number of processors +! +! ME (input) INTEGER +! Index of the local processor ( 0, 1, 2, ..., NPROC-1 ) + +! +! Further Details +! =============== +! +! the matrix Q is represented as a product of elementary +! reflectors +! +! Q = H(1) H(2) . . . H(n-1). +! +! Each H(i) has the form +! +! H(i) = I - tau * v * v' +! +! where tau is a complex __SCALAR, and v is a complex vector with +! v(1:i) = 0 and v(i+1) = 1; v(i+2:n) is stored on exit in AP, +! overwriting A(i+2:n,i), and tau is stored in TAU(i). +! +! ===================================================================== +! +! .. Parameters .. + + COMPLEX(DP) ONE, ZERO, HALF + PARAMETER ( ONE = ( 1.0_DP, 0.0_DP ),ZERO = ( 0.0_DP, 0.0_DP ), & + & HALF = ( 0.5_DP, 0.0_DP ) ) + REAL(DP) RONE, RZERO + PARAMETER ( RONE = 1.0_DP, RZERO = 0.0_DP ) + + INTEGER QI + INTEGER IL(N+1) + INTEGER OW(N+1) + COMPLEX(DP) CTMP + COMPLEX(DP) CTMPV(N+1) + COMPLEX(DP) TAUL(N+1) + COMPLEX(DP) APKI(N+1) + REAL(DP) TMP + REAL(DP) TMPV(N+1) + +! .. +! .. Local __SCALARs .. + INTEGER J, I, I1, K, I2, NI1, JL + INTEGER KL, J1 + COMPLEX(DP) ALPHA, TAUI + INTEGER KNT, IERR + REAL(DP) ALPHI, ALPHR, BETA, RSAFMN, SAFMIN, XNORM +! .. +! .. External Subroutines .. + EXTERNAL zaxpy + EXTERNAL zdscal, zscal +! .. +! .. External Functions .. + COMPLEX(DP) zdotc + EXTERNAL zdotc + REAL(DP) DLAMCH, DLAPY3, DZNRM2 + COMPLEX(DP) ZLADIV + EXTERNAL DLAMCH, DLAPY3, DZNRM2, ZLADIV +! .. +! .. Intrinsic Functions .. + INTRINSIC DABS, DBLE, AIMAG, SIGN +! +! .. Executable Statements .. +! +! Quick return if possible +! + IF(N.LE.0) THEN + RETURN + END IF + + DO I = 1,N+1 + QI = (I-1)/NPROC + OW(I) = MOD((I-1),NPROC) + IF(ME .le. OW(I) ) then + IL(I) = QI + 1 + ELSE + IL(I) = QI + END IF + END DO +! +! Reduce the lower triangle of A. +! + IF (OW(1).EQ.ME) THEN + AP( IL(1), 1 ) = DBLE( AP( IL(1), 1 ) ) + END IF + + DO I = 1, N - 1 +! +! Generate elementary reflector H(i) = I - tau * v * v' +! to annihilate A(i+2:n,i) +! + IF (OW(I+1).EQ.ME) THEN + ALPHA = AP( IL(I+1), I ) + END IF + + CALL BCAST_REAL( ALPHA, 2, OW(I+1), comm ) + + IF( (N-I).LE.0 ) THEN + TAUI = RZERO + ELSE + IF(OW(I+2).EQ.ME) THEN + I2 = IL(I+2) + ELSE + I2 = IL(I+2) + 1 ! I+2 + ENDIF + NI1 = NRL - I2 + 1 ! N-I-1 + + IF((N-I-1).GT.0) THEN + IF( NI1 .GT. 0 ) THEN + XNORM = DZNRM2( NI1, AP( I2, I ), 1 ) + ELSE + XNORM = 0.0_DP + END IF + XNORM = XNORM ** 2 + CALL reduce_base_real( 1, xnorm, comm, -1 ) + XNORM = SQRT( xnorm ) + ELSE + XNORM = 0.0_DP + ENDIF + + ALPHR = DBLE( ALPHA ) + ALPHI = AIMAG( ALPHA ) + IF( XNORM.EQ.RZERO .AND. ALPHI.EQ.RZERO ) THEN + TAUI = RZERO + ELSE + BETA = -SIGN( DLAPY3( ALPHR, ALPHI, XNORM ), ALPHR ) + SAFMIN = DLAMCH( 'S' ) / DLAMCH( 'E' ) + RSAFMN = RONE / SAFMIN + IF( DABS( BETA ).LT.SAFMIN ) THEN + KNT = 0 + 10 CONTINUE + KNT = KNT + 1 + + IF(NI1.GT.0) THEN + CALL zdscal( NI1, RSAFMN, AP( I2, I ), 1 ) + ENDIF + + BETA = BETA*RSAFMN + ALPHI = ALPHI*RSAFMN + ALPHR = ALPHR*RSAFMN + IF( DABS( BETA ).LT.SAFMIN ) GO TO 10 + + IF((N-I-1).GT.0) THEN + XNORM = DZNRM2( NI1, AP( I2, I ), 1 ) + XNORM = XNORM ** 2 + CALL reduce_base_real( 1, xnorm, comm, -1 ) + XNORM = SQRT( XNORM ) + ELSE + XNORM = 0.0_DP + ENDIF + + ALPHA = CMPLX( ALPHR, ALPHI, KIND=DP ) + BETA = -SIGN( DLAPY3( ALPHR, ALPHI, XNORM ), ALPHR ) + TAUI = CMPLX( (BETA-ALPHR)/BETA, -ALPHI/BETA, KIND=DP ) + ALPHA = ZLADIV( ONE, ALPHA-BETA ) + + IF(NI1.GT.0) THEN + CALL zscal( NI1, ALPHA, AP( I2, I ), 1 ) + ENDIF + + ALPHA = BETA + DO J = 1, KNT + ALPHA = ALPHA*SAFMIN + END DO + + ELSE + + TAUI = CMPLX( (BETA-ALPHR)/BETA, -ALPHI/BETA, KIND=DP ) + ALPHA = ZLADIV( ONE, ALPHA-BETA ) + + IF(NI1.GT.0) THEN + CALL zscal( NI1, ALPHA, AP( I2, I ), 1 ) + ENDIF + + ALPHA = BETA + END IF + END IF + ENDIF +! + E( I ) = ALPHA +! + IF( TAUI.NE.ZERO ) THEN +! +! Apply H(i) from both sides to A(i+1:n,i+1:n) +! + ! ... AP( I+1, I ) = ONE + IF (OW(I+1).EQ.ME) THEN + AP( IL(I+1), I ) = ONE + END IF +! +! Compute y := tau * A * v storing y in TAU(i:n-1) +! + + ! ... broadcast A(K,I) + IF(OW(I+1).EQ.ME) THEN + I1 = IL(I+1) + ELSE + I1 = IL(I+1) + 1 ! I+2 + ENDIF + + DO J = I+1, N + CTMPV(J) = ZERO + END DO + DO JL = I1, NRL + J = ME + (JL-1)*NPROC + 1 + CTMPV(J) = AP(JL,I) + END DO + CALL reduce_base_real_to( 2*(n - i) , ctmpv( i + 1 ), apki( i + 1 ), comm, -1 ) + DO J = I+1, N+1 + TAU(J-1) = ZERO + END DO + DO JL = I1, NRL + J = ME + (JL-1)*NPROC + 1 + TAU(J-1) = ZERO + DO K = I+1, J + TAU(J-1) = TAU(J-1) + TAUI * AP(JL,K) * APKI(K) + END DO + END DO + DO J = I+1, N + IF(OW(J+1).EQ.ME) THEN + J1 = IL(J+1) + ELSE + J1 = IL(J+1) + 1 ! I+2 + ENDIF + DO KL = J1, NRL + K = ME + (KL-1)*NPROC + 1 + TAU(J-1) = TAU(J-1) + TAUI * CONJG(AP(KL,J)) * APKI(K) + END DO + END DO + + + ! ... parallel sum TAU + CALL reduce_base_real( 2*(n - i + 1), tau( i ), comm, -1 ) +! +! Compute w := y - 1/2 * tau * (y'*v) * v +! + ! ... ALPHA = -HALF*TAUI*zdotc(N-I,TAU(I),1,AP(I+1,I),1) + + JL = 1 + DO J = I, N + IF(OW(J+1).EQ.ME) THEN + TAUL(JL) = TAU(J) + JL = JL + 1 + END IF + END DO + IF(OW(I+1).EQ.ME) THEN + I1 = IL(I+1) + ELSE + I1 = IL(I+1) + 1 ! I+1 + ENDIF + NI1 = NRL - I1 + 1 ! N-I + IF ( NI1 > 0 ) THEN + ALPHA = -HALF*TAUI*zdotc(NI1,TAUL(1),1,AP(I1,I),1) + ELSE + ALPHA = 0.0_DP + END IF + + CALL reduce_base_real( 2, alpha, comm, -1 ) + + + IF ( NI1 > 0 ) CALL zaxpy(NI1,ALPHA,AP(I1,I),1,TAUL(1),1) + + JL = 1 + DO J = I, N + CTMPV(J) = ZERO + IF(OW(J+1).EQ.ME) THEN + CTMPV(J) = TAUL(JL) + JL = JL + 1 + END IF + END DO + CALL reduce_base_real_to( 2*(n - i + 1) , ctmpv( i ), tau( i ), comm, -1 ) + +! +! Apply the transformation as a rank-2 update: +! A := A - v * w' - w * v' +! + ! ... broadcast A(K,I) + IF(OW(I+1).EQ.ME) THEN + I1 = IL(I+1) + ELSE + I1 = IL(I+1) + 1 ! I+2 + ENDIF + + DO J = I+1, N + CTMPV(J) = ZERO + END DO + DO JL = I1, NRL + J = ME + (JL-1)*NPROC + 1 + CTMPV(J) = AP(JL,I) + END DO + CALL reduce_base_real_to( 2*(n - i) , ctmpv( i + 1 ), apki( i + 1 ), comm, -1 ) + + DO K = I+1,N + DO JL = I1,NRL + J = ME + (JL-1)*NPROC + 1 + AP(JL,K) = AP(JL,K) - ONE * AP(JL,I) * CONJG(TAU(K-1)) - & + & CONJG(ONE) * TAU(J-1) * CONJG(APKI(K)) + END DO + END DO +! + END IF + IF(OW(I+1).EQ.ME) THEN + AP(IL(I+1),I) = E( I ) + END IF + IF(OW(I).EQ.ME) THEN + D( I ) = DBLE(AP( IL(I),I )) + END IF + CALL BCAST_REAL(D(I),1,OW(I),comm) + TAU( I ) = TAUI + END DO + IF(OW(I).EQ.ME) THEN + D( N ) = DBLE(AP( IL(I),I )) + END IF + CALL BCAST_REAL(D(N),1,OW(I),comm) +! + RETURN + +! +! End of ZHPTRD +! + END SUBROUTINE pzhptrd + +!==----------------------------------------------==! + + SUBROUTINE pzupgtr( n, nrl, ap, lda, tau, q, ldq, nproc, me, comm) + + USE kinds, ONLY : DP + USE io_global, ONLY : stdout +! +! Parallel MPI version of the LAPACK routine ZUPGTR +! +! Carlo Cavazzoni (carlo.cavazzoni@cineca.it) -- CINECA +! Dicember 12, 1999 +! +! REFERENCES : +! +! NUMERICAL RECIPES, THE ART OF SCIENTIFIC COMPUTING. +! W.H. PRESS, B.P. FLANNERY, S.A. TEUKOLSKY, AND W.T. VETTERLING, +! CAMBRIDGE UNIVERSITY PRESS, CAMBRIDGE. +! +! PARALLEL NUMERICAL ALGORITHMS, +! T.L. FREEMAN AND C.PHILLIPS, +! PRENTICE HALL INTERNATIONAL (1992). +! +! LAPACK routine (version 2.0) -- +! Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., +! Courant Institute, Argonne National Lab, and Rice University + + IMPLICIT NONE + +! +! .. __SCALAR Arguments .. + + INTEGER INFO, LDQ, N, LDA, NRL, NPROC, ME, comm +! .. +! .. Array Arguments .. + COMPLEX(DP) AP(LDA, * ), Q( LDQ, * ), TAU( * ) +! .. +! +! Purpose +! ======= +! +! PZUPGTR generates a complex unitary matrix Q which is defined as the +! product of n-1 elementary reflectors H(i) of order n, as returned by +! PZHPTRD : +! +! Q = H(1) H(2) . . . H(n-1). +! +! Arguments +! ========= +! +! N (input) INTEGER +! The order of the mglobal atrix AP. N >= 0. +! +! NRL (input) INTEGER +! The number of local rows of the matrix AP. NRL >= 0. +! +! AP (input) COMPLEX(DP) array, dimension (LDA,N) +! The vectors which define the elementary reflectors, as +! returned by PZHPTRD. +! The rows of the matrix are distributed among processors +! with blocking factor 1. +! Example for NPROC = 4 : +! ROW | PE +! 1 | 0 +! 2 | 1 +! 3 | 2 +! 4 | 3 +! 5 | 0 +! 6 | 1 +! .. | .. +! +! LDA (input) INTEGER +! Leading dimension of the local matrix AP, LDA > NRL +! +! TAU (input) COMPLEX(DP) array, dimension (N-1) +! TAU(i) must contain the __SCALAR factor of the elementary +! reflector H(i), as returned by PZHPTRD. +! +! Q (output) COMPLEX(DP) array, dimension (LDQ,N) +! The N-by-N unitary matrix Q. +! The rows of the matrix are distributed among processors +! in the same way of the matrix AP +! +! LDQ (input) INTEGER +! The leading dimension of the array Q. LDQ >= max(1,NRL). +! +! NPROC (input) INTEGER +! Number of processors +! +! ME (input) INTEGER +! Index of the local processor ( 0, 1, 2, ..., NPROC-1 ) +! +! ===================================================================== +! +! .. Parameters .. + + COMPLEX(DP) ONE, ZERO + PARAMETER ( ONE = (1.0_DP,0.0_DP), ZERO = (0.0_DP,0.0_DP) ) + + ! change the following parameters to tune the performances + ! + INTEGER, PARAMETER :: opt_zgemv = 40 + INTEGER, PARAMETER :: opt_zgerc = 40 + + INTEGER QI + INTEGER IL(N+1) + INTEGER OW(N+1) + COMPLEX(DP) CTMP + COMPLEX(DP) WORK(N+1) + +! .. +! .. Local __SCALARs .. + INTEGER :: I, IINFO, J, K, JL, KL, J1, I1, I2, NI1, L, IERR + INTEGER :: ibeg, iend, nr + INTEGER, EXTERNAL :: ldim_cyclic, lind_cyclic +! .. + +! .. Executable Statements .. +! +! Test the input arguments +! +! Quick return if possible +! + IF( N == 0 ) THEN + RETURN + END IF + + nr = ldim_cyclic( n, nproc, me ) + ! + IF( nr /= nrl ) & + CALL errore( " pzupgtr ", " inconsistent dimensions ", nrl ) + ! + ibeg = lind_cyclic( 1, n, nproc, me ) + iend = lind_cyclic( nr, n, nproc, me ) +! + DO I = 1,N+1 + QI = (I-1)/NPROC + OW(I) = MOD((I-1),NPROC) + IF(ME .le. OW(I) ) then + IL(I) = QI + 1 + ELSE + IL(I) = QI + END IF + END DO +! +! Unpack the vectors which define the elementary reflectors and +! set the first row and column of Q equal to those of the unit +! matrix +! + IF(OW(1).EQ.ME) THEN + Q( IL(1), 1 ) = ONE + DO KL = 2, NRL + Q( KL, 1 ) = ZERO + END DO + DO J = 2, N + Q( IL(1), J ) = ZERO + END DO + ELSE + DO KL = 1, NRL + Q( KL, 1 ) = ZERO + END DO + ENDIF + + DO J = 2, N + IF(OW(J+1).EQ.ME) THEN + J1 = IL(J+1) + ELSE + J1 = IL(J+1) + 1 + ENDIF + DO KL = J1, NRL + Q( KL, J ) = AP( KL, J-1 ) + END DO + END DO + + IF( N.GT.1 ) THEN +! +! Generate Q(2:n,2:n) +! + DO I = N-1, 1, -1 +! +! Apply H(i) to A(i:m,i:n) from the left +! + IF( I.LT.(N-1) ) THEN + + IF(OW(I+1).EQ.ME) THEN + Q( IL(I+1), I+1 ) = ONE + END IF +! +! Form H * C +! + IF( TAU(I).NE.ZERO ) THEN +! +! w := C' * v +! + IF(OW(I+1).EQ.ME) THEN + I1 = IL(I+1) + ELSE + I1 = IL(I+1) + 1 + ENDIF + ! + IF( N-1-I > OPT_ZGEMV ) THEN + IF( NRL-I1+1 > 0 ) THEN + CALL zgemv( 'C', NRL-I1+1, N-1-I, one, Q( I1, I+1+1 ), ldq, Q( I1, I+1 ), 1, zero, work, 1 ) + ELSE + work( 1 : N-1-I ) = 0.0_DP + END IF + ELSE + DO J = 1, N-1-I + CTMP = ZERO + DO KL = I1, NRL + CTMP = CTMP + CONJG( Q( KL, J+I+1 ) ) * Q( KL,I+1 ) + END DO + WORK(J) = CTMP + END DO + END IF + + CALL reduce_base_real( 2*(n - 1 - i), work, comm, -1 ) + ! + ! C := C - v * w' + ! + IF( N-1-I > opt_zgerc ) THEN + IF( NRL-I1+1 > 0 ) THEN + CALL zgerc( NRL-I1+1, N-1-I, -TAU(I), Q(I1, I+1), 1, work, 1, Q( I1, 1+I+1 ), ldq ) + END IF + ELSE + DO J = 1, N-1-I + CTMP = -TAU(I) * CONJG( WORK( J ) ) + DO KL = I1, NRL + Q( KL, J+I+1 ) = Q( KL, J+I+1 ) + CTMP * Q(KL, I+1) + END DO + END DO + END IF + END IF + END IF + + IF( I.LT.(N-1) ) THEN + IF(OW(I+2).EQ.ME) THEN + I2 = IL(I+2) ! I+2 + ELSE + I2 = IL(I+2) + 1 ! local ind. of the first element > I+2 + ENDIF + NI1 = NRL - I2 + 1 ! N-I-1 + IF ( NI1 > 0 ) CALL zscal( NI1, -TAU( I ), Q( I2, I+1 ), 1 ) + END IF + + IF(OW(I+1).EQ.ME) THEN + Q( IL(I+1), I+1 ) = ONE - TAU( I ) + END IF +! +! Set A(1:i-1,i) to zero +! + DO L = 1, I - 1 + IF(OW(L+1).EQ.ME) THEN + Q( IL(L+1), I+1 ) = ZERO + END IF + END DO + END DO + END IF + + + RETURN + +! +! End of ZUPGTR +! + END SUBROUTINE pzupgtr + +!==----------------------------------------------==! + + SUBROUTINE pzsteqr( compz, n, nrl, d, e, z, ldz, nproc, me, comm ) +! +! Parallel MPI version of the LAPACK routine ZHPTRD +! +! Carlo Cavazzoni (carlo.cavazzoni@cineca.it) -- CINECA +! Dicember 12, 1999 +! +! REFERENCES : +! +! NUMERICAL RECIPES, THE ART OF SCIENTIFIC COMPUTING. +! W.H. PRESS, B.P. FLANNERY, S.A. TEUKOLSKY, AND W.T. VETTERLING, +! CAMBRIDGE UNIVERSITY PRESS, CAMBRIDGE. +! +! PARALLEL NUMERICAL ALGORITHMS, +! T.L. FREEMAN AND C.PHILLIPS, +! PRENTICE HALL INTERNATIONAL (1992). +! +! LAPACK routine (version 2.0) -- +! Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., +! Courant Institute, Argonne National Lab, and Rice University +! + USE kinds, ONLY : DP + USE io_global, ONLY : stdout + + IMPLICIT NONE + +! .. __SCALAR Arguments .. + CHARACTER COMPZ + INTEGER LDZ, N, NRL, NPROC, ME, comm +! .. +! .. Array Arguments .. + REAL(DP) D( * ), E( * ) + COMPLEX(DP) Z( LDZ, * ) +! .. +! +! Purpose +! ======= +! +! PZSTEQR computes all eigenvalues and, optionally, eigenvectors of a +! symmetric tridiagonal matrix using the implicit QL or QR method. +! The eigenvectors of a full or band complex Hermitian matrix can also +! be found if PZHPTRD has been used to reduce this +! matrix to tridiagonal form. +! +! Arguments +! ========= +! +! COMPZ (input) CHARACTER*1 +! = 'N': Compute eigenvalues only. +! = 'V': Compute eigenvalues and eigenvectors of the original +! Hermitian matrix. On entry, Z must contain the +! unitary matrix used to reduce the original matrix +! to tridiagonal form. +! = 'I': Compute eigenvalues and eigenvectors of the +! tridiagonal matrix. Z is initialized to the identity +! matrix. +! +! N (input) INTEGER +! The order of the mglobal atrix AP. N >= 0. +! +! NRL (input) INTEGER +! The number of local rows of the matrix AP. NRL >= 0. +! +! D (input/output) DOUBLE PRECISION array, dimension (N) +! On entry, the diagonal elements of the tridiagonal matrix. +! On exit, if INFO = 0, the eigenvalues in ascending order. +! +! E (input/output) DOUBLE PRECISION array, dimension (N-1) +! On entry, the (n-1) subdiagonal elements of the tridiagonal +! matrix. +! On exit, E has been destroyed. +! +! Z (input/output) COMPLEX(DP) array, dimension (LDZ, N) +! On entry, if COMPZ = 'V', then Z contains the unitary +! matrix used in the reduction to tridiagonal form. +! On exit if COMPZ = 'V', Z contains the +! orthonormal eigenvectors of the original Hermitian matrix, +! and if COMPZ = 'I', Z contains the orthonormal eigenvectors +! of the symmetric tridiagonal matrix. +! If COMPZ = 'N', then Z is not referenced. +! The rows of the matrix are distributed among processors +! with blocking factor 1, i.e. for NPROC = 4 : +! ROW Index | Processor index owning the row +! 1 | 0 +! 2 | 1 +! 3 | 2 +! 4 | 3 +! 5 | 0 +! 6 | 1 +! .. | .. +! +! LDZ (input) INTEGER +! The leading dimension of the array Z. LDZ >= 1, and if +! eigenvectors are desired, then LDZ >= max(1,NRL). +! +! NPROC (input) INTEGER +! Number of processors +! +! ME (input) INTEGER +! Index of the local processor ( 0, 1, 2, ..., NPROC-1 ) +! +! ===================================================================== +! +! .. Parameters .. + REAL(DP) RZERO, RONE, TWO, THREE, CTEMP, STEMP + PARAMETER ( RZERO = 0.0_DP, RONE = 1.0_DP, TWO = 2.0_DP, & + & THREE = 3.0_DP ) + COMPLEX(DP) ZERO, ONE,ZTEMP + PARAMETER ( ZERO = ( 0.0_DP, 0.0_DP ), ONE = ( 1.0_DP, 0.0_DP ) ) + INTEGER MAXIT + PARAMETER ( MAXIT = 30 ) +! .. + + INTEGER :: QI, KL, INFO + INTEGER :: IL(N+1) + INTEGER :: OW(N+1) + REAL(DP) :: WORK(2*N) + REAL(DP) :: dvar(6) + +! .. Local __SCALARs .. + INTEGER I, ICOMPZ, II, ISCALE, J, JTOT, K, L, L1, LEND, & + & LENDM1, LENDP1, LENDSV, LM1, LSV, M, MM, MM1, & + & NM1, NMAXIT, IERR + REAL(DP) ANORM, B, C, EPS, EPS2, F, G, P, R, RT1, RT2, & + & S, SAFMAX, SAFMIN, SSFMAX, SSFMIN, TST +! .. +! .. External Functions .. + LOGICAL LSAME + REAL(DP) DLAMCH, DLANST, DLAPY2 + EXTERNAL LSAME, DLAMCH, DLANST, DLAPY2 +! .. +! .. External Subroutines .. + EXTERNAL DLAE2, DLAEV2, DLARTG, DLASCL, DLASRT, XERBLA + EXTERNAL ZLASET, ZLASR, ZSWAP +! .. +! .. Intrinsic Functions .. + INTRINSIC DABS, MAX, SIGN, SQRT +! .. +! .. Executable Statements .. +! +! Test the input parameters. +! + INFO = 0 + +! DEBUG START +! if( n > 400 ) then +! write( 4000 + me, * ) LDZ, N, NRL, NPROC, ME, comm +! do i = 1, n +! write( 4000 + me, * ) d( i ) +! end do +! do i = 1, n +! write( 4000 + me, * ) e( i ) +! end do +! do j = 1, n +! do i = 1, nrl +! write( 4000 + me, * ) z( i, j ) +! end do +! end do +! close( 4000 + me ) +! call mpi_barrier( comm, i ) +! stop 'qui' +! end if +! DEBUG END + +! + IF( LSAME( COMPZ, 'N' ) ) THEN + ICOMPZ = 0 + ELSE IF( LSAME( COMPZ, 'V' ) ) THEN + ICOMPZ = 1 + ELSE IF( LSAME( COMPZ, 'I' ) ) THEN + ICOMPZ = 2 + ELSE + ICOMPZ = -1 + END IF + IF( ICOMPZ.LT.0 ) THEN + INFO = -1 + ELSE IF( N.LT.0 ) THEN + INFO = -2 + ELSE IF( (LDZ.LT.1) .OR. ( ICOMPZ.GT.0 .AND. LDZ.LT.MAX(1,NRL) ) ) THEN + INFO = -6 + END IF + IF( INFO.NE.0 ) THEN + CALL XERBLA( 'ZSTEQR', -INFO ) + RETURN + END IF +! +! Quick return if possible +! + IF(N.LE.0) THEN + RETURN + END IF +! + DO I = 1,N+1 + QI = (I-1)/NPROC + OW(I) = MOD((I-1),NPROC) + IF(ME .le. OW(I) ) then + IL(I) = QI + 1 + ELSE + IL(I) = QI + END IF + END DO + + IF( N.EQ.1 ) THEN + IF( ICOMPZ.EQ.2 .AND. OW(1).EQ.ME ) Z( IL(1), 1 ) = ONE + RETURN + END IF +! +! Determine the unit roundoff and over/underflow thresholds. +! We ensure that all procs have the same data! +! + EPS = DLAMCH( 'E' ) + EPS2 = EPS**2 + SAFMIN = DLAMCH( 'S' ) + SAFMAX = RONE / SAFMIN + SSFMAX = SQRT( SAFMAX ) / THREE + SSFMIN = SQRT( SAFMIN ) / EPS2 + ! + dvar(1) = EPS + dvar(2) = EPS2 + dvar(3) = SAFMIN + dvar(4) = SAFMAX + dvar(5) = SSFMAX + dvar(6) = SSFMIN + ! + CALL BCAST_REAL( dvar, 6, 0, comm ) + ! + EPS = dvar(1) + EPS2 = dvar(2) + SAFMIN = dvar(3) + SAFMAX = dvar(4) + SSFMAX = dvar(5) + SSFMIN = dvar(6) +! +! Compute the eigenvalues and eigenvectors of the tridiagonal +! matrix. +! + IF( ICOMPZ.EQ.2 ) THEN + CALL ZLASET( 'Full', NRL, N, ZERO, ZERO, Z, LDZ ) + DO J = 1, N + IF(OW(J).EQ.ME) THEN + Z( IL(J), J ) = ONE + END IF + END DO + END IF +! + NMAXIT = N*MAXIT + JTOT = 0 +! +! Determine where the matrix splits and choose QL or QR iteration +! for each block, according to whether top or bottom diagonal +! element is smaller. +! + L1 = 1 + NM1 = N - 1 +! + 10 CONTINUE + + IF( L1 .GT. N ) GO TO 160 + + IF( L1 .GT. 1 ) E( L1-1 ) = RZERO + + IF( me == 0 ) THEN + + IF( L1.LE.NM1 ) THEN + DO M = L1, NM1 + TST = DABS( E( M ) ) + IF( TST .EQ. RZERO ) GO TO 30 + IF( TST .LE. ( SQRT(DABS(D(M)))*SQRT(DABS(D(M+1))) ) * EPS ) THEN + E( M ) = RZERO + GO TO 30 + END IF + END DO + END IF + M = N +! + 30 CONTINUE + + END IF + + CALL BCAST_REAL( e( l1 ), nm1-l1+1, 0, comm ) + CALL BCAST_INTEGER( m, 1, 0, comm ) + + + L = L1 + LSV = L + LEND = M + LENDSV = LEND + L1 = M + 1 + IF( LEND.EQ.L ) GO TO 10 +! +! Scale submatrix in rows and columns L to LEND +! + ANORM = DLANST( 'I', LEND-L+1, D( L ), E( L ) ) + ISCALE = 0 + IF( ANORM.EQ.RZERO ) GO TO 10 + IF( ANORM.GT.SSFMAX ) THEN + ISCALE = 1 + CALL DLASCL( 'G', 0, 0, ANORM, SSFMAX, LEND-L+1, 1, D( L ), N, INFO ) + CALL DLASCL( 'G', 0, 0, ANORM, SSFMAX, LEND-L, 1, E( L ), N, INFO ) + ELSE IF( ANORM.LT.SSFMIN ) THEN + ISCALE = 2 + CALL DLASCL( 'G', 0, 0, ANORM, SSFMIN, LEND-L+1, 1, D( L ), N, INFO ) + CALL DLASCL( 'G', 0, 0, ANORM, SSFMIN, LEND-L, 1, E( L ), N, INFO ) + END IF +! +! Choose between QL and QR iteration +! + IF( DABS( D( LEND ) ).LT.DABS( D( L ) ) ) THEN + LEND = LSV + L = LENDSV + END IF +! + IF( LEND.GT.L ) THEN +! +! QL Iteration +! +! Look for small subdiagonal element. +! + 40 CONTINUE + + IF( me == 0 ) THEN + + IF( L.NE.LEND ) THEN + LENDM1 = LEND - 1 + DO M = L, LENDM1 + TST = DABS( E( M ) )**2 + IF( TST.LE.( EPS2*DABS(D(M)) )*DABS(D(M+1))+ SAFMIN )GO TO 60 + END DO + END IF +! + M = LEND +! + 60 CONTINUE + + END IF + + CALL BCAST_INTEGER( m, 1, 0, comm ) + + IF( M.LT.LEND ) E( M ) = RZERO + P = D( L ) + IF( M.EQ.L ) THEN +! +! Eigenvalue found. +! + D( L ) = P + L = L + 1 + IF( L.LE.LEND ) GO TO 40 + GO TO 140 + END IF +! +! If remaining matrix is 2-by-2, use DLAE2 or SLAEV2 +! to compute its eigensystem. +! + IF( M.EQ.L+1 ) THEN + IF( ICOMPZ.GT.0 ) THEN + CALL DLAEV2( D( L ), E( L ), D( L+1 ), RT1, RT2, C, S ) + WORK( L ) = C + WORK( N-1+L ) = S + CTEMP = WORK( L ) + STEMP = WORK( N-1+L ) + IF( ( CTEMP.NE.RONE ) .OR. ( STEMP.NE.RZERO ) ) THEN + DO KL = 1, NRL + ZTEMP = Z( KL, 1+L ) + Z( KL, 1+L ) = CTEMP*ZTEMP - STEMP*Z( KL, L ) + Z( KL, L ) = STEMP*ZTEMP + CTEMP*Z( KL, L ) + END DO + END IF + ELSE + CALL DLAE2( D( L ), E( L ), D( L+1 ), RT1, RT2 ) + END IF + D( L ) = RT1 + D( L+1 ) = RT2 + E( L ) = RZERO + L = L + 2 + IF( L.LE.LEND ) GO TO 40 + GO TO 140 + END IF +! + IF( JTOT.EQ.NMAXIT ) GO TO 140 + JTOT = JTOT + 1 +! +! Form shift. +! + ! + ! iteration is performed on one processor and results broadcast + ! to all others to prevent potential problems if all processors + ! do not behave in exactly the same way (even with the same data!) + ! + if ( me == 0 ) then + + G = ( D( L+1 )-P ) / ( TWO*E( L ) ) + R = DLAPY2( G, RONE ) + G = D( M ) - P + ( E( L ) / ( G+SIGN( R, G ) ) ) +! + S = RONE + C = RONE + P = RZERO +! +! Inner loop +! + MM1 = M - 1 + DO I = MM1, L, -1 + F = S*E( I ) + B = C*E( I ) + CALL DLARTG( G, F, C, S, R ) + IF( I.NE.M-1 ) E( I+1 ) = R + G = D( I+1 ) - P + R = ( D( I )-G )*S + TWO*C*B + P = S*R + D( I+1 ) = G + P + G = C*R - B +! +! If eigenvectors are desired, then save rotations. +! + IF( ICOMPZ.GT.0 ) THEN + WORK( I ) = C + WORK( N-1+I ) = -S + END IF + END DO + D( L ) = D( L ) - P + E( L ) = G + END IF + CALL BCAST_REAL( d( L ), m - l + 1, 0, comm ) + CALL BCAST_REAL( e( L ), m - l + 1, 0, comm ) +! +! If eigenvectors are desired, then apply saved rotations. +! + IF( ICOMPZ.GT.0 ) THEN + CALL BCAST_REAL( work, 2*n, 0, comm ) + DO J = M - L + 1 - 1, 1, -1 + CTEMP = WORK( L + J -1) + STEMP = WORK( N-1+L + J-1) + IF( ( CTEMP.NE.RONE ) .OR. ( STEMP.NE.RZERO ) ) THEN + DO KL = 1, NRL + ZTEMP = Z( KL, J+1+L-1 ) + Z( KL, J+1+L-1 ) = CTEMP*ZTEMP - STEMP*Z( KL, J+L-1 ) + Z( KL, J+L-1 ) = STEMP*ZTEMP + CTEMP*Z( KL, J+L-1 ) + END DO + END IF + END DO + END IF +! + GO TO 40 +! + ELSE +! +! QR Iteration +! +! Look for small superdiagonal element. +! + 90 CONTINUE + + IF( me == 0 ) THEN + + IF( L.NE.LEND ) THEN + LENDP1 = LEND + 1 + DO 100 M = L, LENDP1, -1 + TST = DABS( E( M-1 ) )**2 + IF( TST.LE.(EPS2*DABS(D(M)))*DABS(D(M-1))+ SAFMIN )GO TO 110 + 100 CONTINUE + END IF +! + M = LEND +! + 110 CONTINUE + + END IF + + CALL BCAST_INTEGER( m, 1, 0, comm ) + + IF( M.GT.LEND ) E( M-1 ) = RZERO + P = D( L ) + IF( M.EQ.L ) THEN +! +! Eigenvalue found. +! + D( L ) = P + L = L - 1 + IF( L.GE.LEND ) GO TO 90 + GO TO 140 + END IF +! +! If remaining matrix is 2-by-2, use DLAE2 or SLAEV2 +! to compute its eigensystem. +! + IF( M.EQ.L-1 ) THEN + IF( ICOMPZ.GT.0 ) THEN + CALL DLAEV2( D( L-1 ), E( L-1 ), D( L ), RT1, RT2, C, S ) + WORK( M ) = C + WORK( N-1+M ) = S + CTEMP = WORK( M ) + STEMP = WORK( N-1+M ) + IF( ( CTEMP.NE.RONE ) .OR. ( STEMP.NE.RZERO ) ) THEN + DO KL = 1, NRL + ZTEMP = Z( KL, L) + Z( KL, L ) = CTEMP*ZTEMP - STEMP*Z( KL, L-1 ) + Z( KL, L-1 ) = STEMP*ZTEMP + CTEMP*Z( KL, L-1 ) + END DO + END IF + ELSE + CALL DLAE2( D( L-1 ), E( L-1 ), D( L ), RT1, RT2 ) + END IF + D( L-1 ) = RT1 + D( L ) = RT2 + E( L-1 ) = RZERO + L = L - 2 + IF( L.GE.LEND ) GO TO 90 + GO TO 140 + END IF +! + IF( JTOT.EQ.NMAXIT ) GO TO 140 + JTOT = JTOT + 1 +! +! Form shift. +! + ! + ! iteration is performed on one processor and results broadcast + ! to all others to prevent potential problems if all processors + ! do not behave in exactly the same way (even with the same data!) + ! + if ( me == 0 ) then + + G = ( D( L-1 )-P ) / ( TWO*E( L-1 ) ) + R = DLAPY2( G, RONE ) + G = D( M ) - P + ( E( L-1 ) / ( G+SIGN( R, G ) ) ) +! + S = RONE + C = RONE + P = RZERO +! +! Inner loop +! + LM1 = L - 1 + DO I = M, LM1 + F = S*E( I ) + B = C*E( I ) + CALL DLARTG( G, F, C, S, R ) + IF( I.NE.M ) E( I-1 ) = R + G = D( I ) - P + R = ( D( I+1 )-G )*S + TWO*C*B + P = S*R + D( I ) = G + P + G = C*R - B +! +! If eigenvectors are desired, then save rotations. +! + IF( ICOMPZ.GT.0 ) THEN + WORK( I ) = C + WORK( N-1+I ) = S + END IF + END DO + D( L ) = D( L ) - P + E( LM1 ) = G + END IF + CALL BCAST_REAL( d(M), L - M + 1, 0, comm) + CALL BCAST_REAL( e(M), L - M + 1, 0, comm ) +! +! If eigenvectors are desired, then apply saved rotations. +! + IF( ICOMPZ.GT.0 ) THEN + CALL BCAST_REAL(work,2*n,0,comm) + DO J = 1, L - M + CTEMP = WORK( M+J-1 ) + STEMP = WORK( N-1+M+J-1 ) + IF( ( CTEMP.NE.RONE ) .OR. ( STEMP.NE.RZERO ) ) THEN + DO KL = 1, NRL + ZTEMP = Z( KL, J+M ) + Z( KL, J+M ) = CTEMP*ZTEMP - STEMP*Z(KL, J+M-1) + Z( KL, J+M-1 ) = STEMP*ZTEMP + CTEMP*Z(KL, J+M-1) + END DO + END IF + END DO + END IF +! + GO TO 90 +! + END IF +! +! Undo scaling if necessary +! + 140 CONTINUE + + IF( ISCALE.EQ.1 ) THEN + CALL DLASCL( 'G', 0, 0, SSFMAX, ANORM, LENDSV-LSV+1, 1, & + & D( LSV ), N, INFO ) + CALL DLASCL( 'G', 0, 0, SSFMAX, ANORM, LENDSV-LSV, 1, E( LSV ), & + & N, INFO ) + ELSE IF( ISCALE.EQ.2 ) THEN + CALL DLASCL( 'G', 0, 0, SSFMIN, ANORM, LENDSV-LSV+1, 1, & + & D( LSV ), N, INFO ) + CALL DLASCL( 'G', 0, 0, SSFMIN, ANORM, LENDSV-LSV, 1, E( LSV ), & + & N, INFO ) + END IF +! +! Check for no convergence to an eigenvalue after a total +! of N*MAXIT iterations. +! + IF( JTOT .EQ. NMAXIT ) THEN + DO 150 I = 1, N - 1 + IF( E( I ) .NE. RZERO ) INFO = INFO + 1 + 150 CONTINUE + WRITE(6,*) 'WARNING pzsteqr, convergence not achieved INFO = ', INFO + RETURN + END IF + GO TO 10 +! +! Order eigenvalues and eigenvectors. +! + 160 CONTINUE + + IF( ICOMPZ.EQ.0 ) THEN +! +! Use Quick Sort +! + CALL DLASRT( 'I', N, D, INFO ) +! + ELSE +! +! Use Selection Sort to minimize swaps of eigenvectors +! + DO 180 II = 2, N + I = II - 1 + K = I + P = D( I ) + DO 170 J = II, N + IF( D( J ).LT.P ) THEN + K = J + P = D( J ) + END IF + 170 CONTINUE + IF( K.NE.I ) THEN + D( K ) = D( I ) + D( I ) = P + CALL ZSWAP( NRL, Z( 1, I ), 1, Z( 1, K ), 1 ) + END IF + 180 CONTINUE + END IF + + RETURN +! +! End of ZSTEQR +! + END SUBROUTINE pzsteqr + +!==----------------------------------------------==! + + SUBROUTINE zhpev_drv( JOBZ, UPLO, N, AP, W, Z, LDZ ) + + USE kinds, ONLY : DP + USE io_global, ONLY : stdout + + IMPLICIT NONE + + CHARACTER :: JOBZ, UPLO + INTEGER :: IOPT, INFO, LDZ, N + COMPLEX(DP) :: AP( * ), Z( LDZ, * ) + REAL(DP) :: W( * ) + REAL(DP), ALLOCATABLE :: RWORK(:) + COMPLEX(DP), ALLOCATABLE :: ZWORK(:) + + ALLOCATE( rwork( MAX(1, 3*n-2) ), zwork( MAX(1, 2*n-1)) ) + CALL ZHPEV(jobz, uplo, n, ap, w, z, ldz, zwork, rwork, INFO) + DEALLOCATE( rwork, zwork ) + IF( info .NE. 0 ) THEN + CALL errore( ' dspev_drv ', ' diagonalization failed ',info ) + END IF + RETURN + END SUBROUTINE zhpev_drv + +!==----------------------------------------------==! + + SUBROUTINE pzhpev_drv( jobz, ap, lda, w, z, ldz, & + nrl, n, nproc, mpime, comm ) + + USE kinds, ONLY : DP + + IMPLICIT NONE + CHARACTER :: JOBZ + INTEGER, INTENT(IN) :: lda, ldz, nrl, n, nproc, mpime + INTEGER, INTENT(IN) :: comm + COMPLEX(DP) :: ap( lda, * ), z( ldz, * ) + REAL(DP) :: w( * ) + REAL(DP), ALLOCATABLE :: rwork( : ) + COMPLEX(DP), ALLOCATABLE :: cwork( : ) + ! + ALLOCATE( rwork( n ) ) + ALLOCATE( cwork( n ) ) + ! + CALL pzhptrd( n, nrl, ap, lda, w, rwork, cwork, nproc, mpime, comm) + + IF( jobz == 'V' .OR. jobz == 'v' ) THEN + CALL pzupgtr( n, nrl, ap, lda, cwork, z, ldz, nproc, mpime, comm) + END IF + + CALL pzsteqr( jobz, n, nrl, w, rwork, z, ldz, nproc, mpime, comm) + + DEALLOCATE( cwork ) + DEALLOCATE( rwork ) + + RETURN + END SUBROUTINE pzhpev_drv + + +!==----------------------------------------------==! + + + + + SUBROUTINE pzheevd_drv( tv, n, nb, h, w, ortho_cntx ) + + USE kinds, ONLY : DP + + IMPLICIT NONE + + LOGICAL, INTENT(IN) :: tv + ! if tv is true compute eigenvalues and eigenvectors (not used) + INTEGER, INTENT(IN) :: nb, n, ortho_cntx + ! nb = block size, n = matrix size, ortho_cntx = BLACS context + COMPLEX(DP) :: h(:,:) + ! input: h = matrix to be diagonalized + ! output: h = eigenvectors + REAL(DP) :: w(:) + ! output: w = eigenvalues + + COMPLEX(DP) :: ztmp( 4 ) + REAL(DP) :: rtmp( 4 ) + INTEGER :: itmp( 4 ) + COMPLEX(DP), ALLOCATABLE :: work(:) + COMPLEX(DP), ALLOCATABLE :: v(:,:) + REAL(DP), ALLOCATABLE :: rwork(:) + INTEGER, ALLOCATABLE :: iwork(:) + INTEGER :: LWORK, LRWORK, LIWORK + INTEGER :: desch( 10 ), info + CHARACTER :: jobv + ! + IF( tv ) THEN + ALLOCATE( v( SIZE( h, 1 ), SIZE( h, 2 ) ) ) + jobv = 'V' + ELSE + CALL errore( ' pzheevd_drv ', ' pzheevd does not compute eigenvalue only ', ABS( info ) ) + END IF + + CALL descinit( desch, n, n, nb, nb, 0, 0, ortho_cntx, SIZE( h, 1 ) , info ) + + lwork = -1 + lrwork = -1 + liwork = -1 + CALL PZHEEVD( 'V', 'L', n, h, 1, 1, desch, w, v, 1, 1, & + desch, ztmp, LWORK, rtmp, LRWORK, itmp, LIWORK, INFO ) + + IF( info /= 0 ) CALL errore( ' cdiaghg ', ' PZHEEVD ', ABS( info ) ) + + lwork = INT( REAL(ztmp(1)) ) + 1 + lrwork = INT( rtmp(1) ) + 1 + liwork = itmp(1) + 1 + + ALLOCATE( work( lwork ) ) + ALLOCATE( rwork( lrwork ) ) + ALLOCATE( iwork( liwork ) ) + + CALL PZHEEVD( 'V', 'L', n, h, 1, 1, desch, w, v, 1, 1, & + desch, work, LWORK, rwork, LRWORK, iwork, LIWORK, INFO ) + + IF( info /= 0 ) CALL errore( ' cdiaghg ', ' PZHEEVD ', ABS( info ) ) + + IF( tv ) h = v + + DEALLOCATE( work ) + DEALLOCATE( rwork ) + DEALLOCATE( iwork ) + IF( ALLOCATED( v ) ) DEALLOCATE( v ) + RETURN + END SUBROUTINE pzheevd_drv + + +END MODULE zhpev_module diff --git a/tests/apps/miniDFT/tests/test/.gitignore b/tests/apps/miniDFT/tests/test/.gitignore new file mode 100644 index 0000000000..b5a4f4baee --- /dev/null +++ b/tests/apps/miniDFT/tests/test/.gitignore @@ -0,0 +1,2 @@ +*~ +*.out diff --git a/tests/apps/miniDFT/tests/test/O.pbe.nml b/tests/apps/miniDFT/tests/test/O.pbe.nml new file mode 100644 index 0000000000..c07552c775 --- /dev/null +++ b/tests/apps/miniDFT/tests/test/O.pbe.nml @@ -0,0 +1,1997 @@ + +&header + generated='Generated using "atomic" code by A. Dal Corso (Quantum ESPRESSO distribution)' + author = "AM" + date = "15Dec2010" + comment = " " + psd = " O" + typ = "NC" + rel = "scalar" + tvanp = .false. + tpawp = .false. + tcoulombp= .false. + has_so = .false. + has_wfc = .false. + has_gipaw= .false. + nlcc = .false. + dft = "PBE " + zp = 6.000000000000000E+000 + etotps = -3.156320598423343E+001 + ecutwfc = 0.000000000000000E+000 + ecutrho = 0.000000000000000E+000 + nv = "2.0.1" + lmax = 1 + lmax_rho = 2 + lloc = 1 + nmesh = 1095 + nwfc = 2 + nbeta = 1 +/ + +&mesh + dx = 1.250000000000000E-002 + nmesh = 1095 + xmin =-7.000000000000000E+000 + rmax = 1.000000000000000E+002 + zmesh = 8.000000000000000E+000 + r(1:1095) = + 1.139852456943145E-004 1.154190035836278E-004 1.168707959270728E-004 1.183408495701567E-004 + 1.198293942117525E-004 1.213366624399886E-004 1.228628897685923E-004 1.244083146736889E-004 + 1.259731786310638E-004 1.275577261538943E-004 1.291622048309546E-004 1.307868653653023E-004 + 1.324319616134513E-004 1.340977506250371E-004 1.357844926829822E-004 1.374924513441648E-004 + 1.392218934806004E-004 1.409730893211415E-004 1.427463124937009E-004 1.445418400680072E-004 + 1.463599525988968E-004 1.482009341701516E-004 1.500650724388876E-004 1.519526586805018E-004 + 1.538639878341851E-004 1.557993585490062E-004 1.577590732305768E-004 1.597434380883031E-004 + 1.617527631832310E-004 1.637873624764950E-004 1.658475538783739E-004 1.679336592979659E-004 + 1.700460046934867E-004 1.721849201232021E-004 1.743507397969998E-004 1.765438021286102E-004 + 1.787644497884843E-004 1.810130297573369E-004 1.832898933803629E-004 1.855953964221359E-004 + 1.879298991221965E-004 1.902937662513414E-004 1.926873671686188E-004 1.951110758790415E-004 + 1.975652710920271E-004 2.000503362805705E-004 2.025666597411633E-004 2.051146346544658E-004 + 2.076946591467417E-004 2.103071363520676E-004 2.129524744753217E-004 2.156310868559678E-004 + 2.183433920326400E-004 2.210898138085401E-004 2.238707813176587E-004 2.266867290918269E-004 + 2.295380971286134E-004 2.324253309600751E-004 2.353488817223722E-004 2.383092062262596E-004 + 2.413067670284637E-004 2.443420325039584E-004 2.474154769191496E-004 2.505275805059799E-004 + 2.536788295369668E-004 2.568697164011824E-004 2.601007396811912E-004 2.633724042309543E-004 + 2.666852212547135E-004 2.700397083868693E-004 2.734363897728606E-004 2.768757961510646E-004 + 2.803584649357254E-004 2.838849403009259E-004 2.874557732656170E-004 2.910715217797142E-004 + 2.947327508112791E-004 2.984400324347967E-004 3.021939459205629E-004 3.059950778251979E-004 + 3.098440220832948E-004 3.137413801002248E-004 3.176877608461073E-004 3.216837809509625E-004 + 3.257300648010623E-004 3.298272446364902E-004 3.339759606499313E-004 3.381768610867033E-004 + 3.424306023460460E-004 3.467378490836861E-004 3.510992743156891E-004 3.555155595236209E-004 + 3.599873947610304E-004 3.645154787612710E-004 3.691005190466808E-004 3.737432320391325E-004 + 3.784443431719769E-004 3.832045870033929E-004 3.880247073311636E-004 3.929054573088975E-004 + 3.978475995637084E-004 4.028519063153783E-004 4.079191594970185E-004 4.130501508772477E-004 + 4.182456821839090E-004 4.235065652293390E-004 4.288336220372168E-004 4.342276849710067E-004 + 4.396895968640161E-004 4.452202111510912E-004 4.508203920019663E-004 4.564910144562929E-004 + 4.622329645603665E-004 4.680471395055725E-004 4.739344477685760E-004 4.798958092532704E-004 + 4.859321554345163E-004 4.920444295036854E-004 4.982335865160363E-004 5.045005935399448E-004 + 5.108464298080083E-004 5.172720868700546E-004 5.237785687480724E-004 5.303668920930925E-004 + 5.370380863440425E-004 5.437931938885961E-004 5.506332702260508E-004 5.575593841322502E-004 + 5.645726178265832E-004 5.716740671410841E-004 5.788648416916557E-004 5.861460650514514E-004 + 5.935188749264347E-004 6.009844233331482E-004 6.085438767787204E-004 6.161984164431315E-004 + 6.239492383637771E-004 6.317975536223518E-004 6.397445885340814E-004 6.477915848393406E-004 + 6.559397998976731E-004 6.641905068842594E-004 6.725449949888526E-004 6.810045696172156E-004 + 6.895705525950964E-004 6.982442823747625E-004 7.070271142441385E-004 7.159204205385731E-004 + 7.249255908552677E-004 7.340440322704065E-004 7.432771695590118E-004 7.526264454175699E-004 + 7.620933206894547E-004 7.716792745931876E-004 7.813858049535702E-004 7.912144284357184E-004 + 8.011666807820479E-004 8.112441170522359E-004 8.214483118662016E-004 8.317808596501467E-004 + 8.422433748856834E-004 8.528374923621034E-004 8.635648674318165E-004 8.744271762690013E-004 + 8.854261161315157E-004 8.965634056260874E-004 9.078407849768614E-004 9.192600162973045E-004 + 9.308228838655423E-004 9.425311944031595E-004 9.543867773574952E-004 9.663914851875088E-004 + 9.785471936532217E-004 9.908558021088118E-004 1.003319233799395E-003 1.015939436161526E-003 + 1.028718381127504E-003 1.041658065433476E-003 1.054760510931441E-003 1.068027764905168E-003 + 1.081461900390079E-003 1.095065016497179E-003 1.108839238741032E-003 1.122786719371889E-003 + 1.136909637711978E-003 1.151210200496018E-003 1.165690642216041E-003 1.180353225470526E-003 + 1.195200241317938E-003 1.210234009634712E-003 1.225456879477728E-003 1.240871229451376E-003 + 1.256479468079198E-003 1.272284034180234E-003 1.288287397250094E-003 1.304492057846813E-003 + 1.320900547981582E-003 1.337515431514366E-003 1.354339304554519E-003 1.371374795866436E-003 + 1.388624567280288E-003 1.406091314107958E-003 1.423777765564172E-003 1.441686685192953E-003 + 1.459820871299432E-003 1.478183157387077E-003 1.496776412600453E-003 1.515603542173512E-003 + 1.534667487883554E-003 1.553971228510887E-003 1.573517780304250E-003 1.593310197452134E-003 + 1.613351572559984E-003 1.633645037133435E-003 1.654193762067618E-003 1.675000958142604E-003 + 1.696069876525117E-003 1.717403809276518E-003 1.739006089867202E-003 1.760880093697467E-003 + 1.783029238624907E-003 1.805456985498485E-003 1.828166838699278E-003 1.851162346688050E-003 + 1.874447102559715E-003 1.898024744604743E-003 1.921898956877679E-003 1.946073469772761E-003 + 1.970552060606811E-003 1.995338554209453E-003 2.020436823520734E-003 2.045850790196303E-003 + 2.071584425220157E-003 2.097641749525120E-003 2.124026834621135E-003 2.150743803231423E-003 + 2.177796829936689E-003 2.205190141827395E-003 2.232928019164254E-003 2.261014796047039E-003 + 2.289454861091772E-003 2.318252658116486E-003 2.347412686835551E-003 2.376939503562782E-003 + 2.406837721923366E-003 2.437112013574749E-003 2.467767108936598E-003 2.498807797929929E-003 + 2.530238930725549E-003 2.562065418501907E-003 2.594292234212468E-003 2.626924413362754E-003 + 2.659967054797147E-003 2.693425321495596E-003 2.727304441380347E-003 2.761609708132805E-003 + 2.796346482020700E-003 2.831520190735621E-003 2.867136330241116E-003 2.903200465631447E-003 + 2.939718232001138E-003 2.976695335325485E-003 3.014137553352109E-003 3.052050736503754E-003 + 3.090440808792425E-003 3.129313768745018E-003 3.168675690340618E-003 3.208532723959554E-003 + 3.248891097344418E-003 3.289757116573164E-003 3.331137167044436E-003 3.373037714475311E-003 + 3.415465305911571E-003 3.458426570750697E-003 3.501928221777728E-003 3.545977056214138E-003 + 3.590579956779929E-003 3.635743892769060E-003 3.681475921138411E-003 3.727783187610464E-003 + 3.774672927789813E-003 3.822152468293762E-003 3.870229227897112E-003 3.918910718691361E-003 + 3.968204547258494E-003 4.018118415859508E-003 4.068660123637929E-003 4.119837567838421E-003 + 4.171658745040760E-003 4.224131752409320E-003 4.277264788958254E-003 4.331066156832628E-003 + 4.385544262605630E-003 4.440707618592121E-003 4.496564844178708E-003 4.553124667170529E-003 + 4.610395925155002E-003 4.668387566882703E-003 4.727108653665635E-003 4.786568360793083E-003 + 4.846775978965251E-003 4.907740915744977E-003 4.969472697027665E-003 5.031980968529731E-003 + 5.095275497295778E-003 5.159366173224694E-003 5.224263010614990E-003 5.289976149729540E-003 + 5.356515858380023E-003 5.423892533531297E-003 5.492116702925928E-003 5.561199026729190E-003 + 5.631150299194728E-003 5.701981450351176E-003 5.773703547710015E-003 5.846327797994873E-003 + 5.919865548892616E-003 5.994328290826434E-003 6.069727658751247E-003 6.146075433971698E-003 + 6.223383545982993E-003 6.301664074334922E-003 6.380929250519302E-003 6.461191459881176E-003 + 6.542463243554048E-003 6.624757300419475E-003 6.708086489091267E-003 6.792463829924687E-003 + 6.877902507050907E-003 6.964415870437050E-003 7.052017437972169E-003 7.140720897579412E-003 + 7.230540109354811E-003 7.321489107732945E-003 7.413582103679840E-003 7.506833486913493E-003 + 7.601257828152247E-003 7.696869881391529E-003 7.793684586209182E-003 7.891717070099797E-003 + 7.990982650838446E-003 8.091496838874069E-003 8.193275339753045E-003 8.296334056573205E-003 + 8.400689092468720E-003 8.506356753126275E-003 8.613353549332823E-003 8.721696199555458E-003 + 8.831401632553703E-003 8.942486990024652E-003 9.054969629281432E-003 9.168867125965267E-003 + 9.284197276791738E-003 9.400978102331554E-003 9.519227849826291E-003 9.638964996039589E-003 + 9.760208250144146E-003 9.882976556645086E-003 1.000728909834007E-002 1.013316529931665E-002 + 1.026062482798735E-002 1.038968760016282E-002 1.052037378216380E-002 1.065270379397211E-002 + 1.078669831242131E-002 1.092237827442755E-002 1.105976488026091E-002 1.119887959685809E-002 + 1.133974416117657E-002 1.148238058359111E-002 1.162681115133294E-002 1.177305843197209E-002 + 1.192114527694371E-002 1.207109482511861E-002 1.222293050641876E-002 1.237667604547829E-002 + 1.253235546535047E-002 1.268999309126139E-002 1.284961355441080E-002 1.301124179582083E-002 + 1.317490307023304E-002 1.334062295005453E-002 1.350842732935366E-002 1.367834242790612E-002 + 1.385039479529175E-002 1.402461131504297E-002 1.420101920884547E-002 1.437964604079155E-002 + 1.456051972168713E-002 1.474366851341282E-002 1.492912103333995E-002 1.511690625880209E-002 + 1.530705353162274E-002 1.549959256270016E-002 1.569455343664966E-002 1.589196661650445E-002 + 1.609186294847553E-002 1.629427366677146E-002 1.649923039847878E-002 1.670676516850381E-002 + 1.691691040457659E-002 1.712969894231781E-002 1.734516403036941E-002 1.756333933558977E-002 + 1.778425894831421E-002 1.800795738768166E-002 1.823446960702843E-002 1.846383099934961E-002 + 1.869607740282939E-002 1.893124510644083E-002 1.916937085561606E-002 1.941049185798788E-002 + 1.965464578920346E-002 1.990187079881129E-002 2.015220551622211E-002 2.040568905674480E-002 + 2.066236102769832E-002 2.092226153460032E-002 2.118543118743377E-002 2.145191110699236E-002 + 2.172174293130564E-002 2.199496882214519E-002 2.227163147161231E-002 2.255177410880886E-002 + 2.283544050659185E-002 2.312267498841303E-002 2.341352243524463E-002 2.370802829259192E-002 + 2.400623857759428E-002 2.430819988621546E-002 2.461395940052426E-002 2.492356489606690E-002 + 2.523706474933193E-002 2.555450794530926E-002 2.587594408514410E-002 2.620142339388723E-002 + 2.653099672834289E-002 2.686471558501508E-002 2.720263210815413E-002 2.754479909790425E-002 + 2.789127001855373E-002 2.824209900688886E-002 2.859734088065281E-002 2.895705114711111E-002 + 2.932128601172473E-002 2.969010238693227E-002 3.006355790104277E-002 3.044171090724010E-002 + 3.082462049270083E-002 3.121234648782671E-002 3.160494947559331E-002 3.200249080101626E-002 + 3.240503258073645E-002 3.281263771272593E-002 3.322536988611585E-002 3.364329359114798E-002 + 3.406647412925158E-002 3.449497762324665E-002 3.492887102767593E-002 3.536822213926663E-002 + 3.581309960752376E-002 3.626357294545692E-002 3.671971254044162E-002 3.718158966521759E-002 + 3.764927648902529E-002 3.812284608888241E-002 3.860237246100249E-002 3.908793053235673E-002 + 3.957959617238167E-002 4.007744620483386E-002 4.058155841979372E-002 4.109201158582052E-002 + 4.160888546225996E-002 4.213226081170681E-002 4.266221941262424E-002 4.319884407212182E-002 + 4.374221863889443E-002 4.429242801632360E-002 4.484955817574397E-002 4.541369616987644E-002 + 4.598493014643029E-002 4.656334936187663E-002 4.714904419539463E-002 4.774210616299364E-002 + 4.834262793181269E-002 4.895070333459987E-002 4.956642738437412E-002 5.018989628927085E-002 + 5.082120746757492E-002 5.146045956294235E-002 5.210775245981355E-002 5.276318729902069E-002 + 5.342686649359085E-002 5.409889374474844E-002 5.477937405811870E-002 5.546841376013498E-002 + 5.616612051465271E-002 5.687260333977171E-002 5.758797262487076E-002 5.831234014785609E-002 + 5.904581909262684E-002 5.978852406676052E-002 6.054057111942033E-002 6.130207775948830E-002 + 6.207316297392623E-002 6.285394724636761E-002 6.364455257594366E-002 6.444510249634554E-002 + 6.525572209512705E-002 6.607653803324971E-002 6.690767856487378E-002 6.774927355739840E-002 + 6.860145451175333E-002 6.946435458294646E-002 7.033810860086952E-002 7.122285309136538E-002 + 7.211872629756085E-002 7.302586820146700E-002 7.394442054585193E-002 7.487452685638822E-002 + 7.581633246407918E-002 7.676998452796724E-002 7.773563205812754E-002 7.871342593895130E-002 + 7.970351895272172E-002 8.070606580348651E-002 8.172122314123093E-002 8.274914958635428E-002 + 8.379000575445496E-002 8.484395428142685E-002 8.591115984887153E-002 8.699178920983026E-002 + 8.808601121483921E-002 8.919399683831286E-002 9.031591920525908E-002 9.145195361833022E-002 + 9.260227758521475E-002 9.376707084637276E-002 9.494651540312112E-002 9.614079554607138E-002 + 9.735009788392561E-002 9.857461137263460E-002 9.981452734492216E-002 1.010700395401816E-001 + 1.023413441347478E-001 1.036286397725500E-001 1.049321275961509E-001 1.062520112781748E-001 + 1.075884970531323E-001 1.089417937496448E-001 1.103121128230744E-001 1.116996683885645E-001 + 1.131046772544950E-001 1.145273589563598E-001 1.159679357910692E-001 1.174266328516845E-001 + 1.189036780625893E-001 1.203993022151028E-001 1.219137390035416E-001 1.234472250617353E-001 + 1.250000000000000E-001 1.265723064425793E-001 1.281643900655537E-001 1.297764996352282E-001 + 1.314088870470031E-001 1.330618073647324E-001 1.347355188605790E-001 1.364302830553690E-001 + 1.381463647594560E-001 1.398840321140977E-001 1.416435566333533E-001 1.434252132465091E-001 + 1.452292803410354E-001 1.470560398060864E-001 1.489057770765449E-001 1.507787811776226E-001 + 1.526753447700213E-001 1.545957641956607E-001 1.565403395239831E-001 1.585093745988400E-001 + 1.605031770859677E-001 1.625220585210614E-001 1.645663343584527E-001 1.666363240204004E-001 + 1.687323509470005E-001 1.708547426467245E-001 1.730038307475940E-001 1.751799510489967E-001 + 1.773834435741573E-001 1.796146526232657E-001 1.818739268272752E-001 1.841616192023770E-001 + 1.864780872051588E-001 1.888236927884592E-001 1.911988024579225E-001 1.936037873292666E-001 + 1.960390231862711E-001 1.985048905394930E-001 2.010017746857230E-001 2.035300657681889E-001 + 2.060901588375160E-001 2.086824539134554E-001 2.113073560473865E-001 2.139652753856082E-001 + 2.166566272334245E-001 2.193818321200373E-001 2.221413158642548E-001 2.249355096410262E-001 + 2.277648500488137E-001 2.306297791778126E-001 2.335307446790278E-001 2.364681998342213E-001 + 2.394426036267371E-001 2.424544208132194E-001 2.455041219962311E-001 2.485921836977865E-001 + 2.517190884338096E-001 2.548853247895270E-001 2.580913874958110E-001 2.613377775064821E-001 + 2.646250020765843E-001 2.679535748416449E-001 2.713240158979304E-001 2.747368518837129E-001 + 2.781926160615587E-001 2.816918484016511E-001 2.852350956661630E-001 2.888229114946881E-001 + 2.924558564907490E-001 2.961344983093927E-001 2.998594117458873E-001 3.036311788255361E-001 + 3.074503888946188E-001 3.113176387124790E-001 3.152335325447687E-001 3.191986822578659E-001 + 3.232137074144809E-001 3.272792353704627E-001 3.313959013728260E-001 3.355643486590090E-001 + 3.397852285573806E-001 3.440592005890134E-001 3.483869325707314E-001 3.527691007194624E-001 + 3.572063897578957E-001 3.616994930214701E-001 3.662491125667131E-001 3.708559592809336E-001 + 3.755207529933040E-001 3.802442225873332E-001 3.850271061147539E-001 3.898701509108494E-001 + 3.947741137112211E-001 3.997397607700343E-001 4.047678679797454E-001 4.098592209923342E-001 + 4.150146153420689E-001 4.202348565698038E-001 4.255207603488522E-001 4.308731526124346E-001 + 4.362928696827302E-001 4.417807584015592E-001 4.473376762626975E-001 4.529644915458676E-001 + 4.586620834524058E-001 4.644313422426380E-001 4.702731693749893E-001 4.761884776468328E-001 + 4.821781913371216E-001 4.882432463508068E-001 4.943845903650722E-001 5.006031829774161E-001 + 5.068999958555845E-001 5.132760128894014E-001 5.197322303445013E-001 5.262696570179950E-001 + 5.328893143961028E-001 5.395922368137556E-001 5.463794716162196E-001 5.532520793227422E-001 + 5.602111337922581E-001 5.672577223911884E-001 5.743929461633362E-001 5.816179200019336E-001 + 5.889337728238431E-001 5.963416477459503E-001 6.038427022637854E-001 6.114381084323758E-001 + 6.191290530493891E-001 6.269167378405703E-001 6.348023796475102E-001 6.427872106177864E-001 + 6.508724783974813E-001 6.590594463261362E-001 6.673493936341475E-001 6.757436156426458E-001 + 6.842434239659007E-001 6.928501467162530E-001 7.015651287116443E-001 7.103897316857435E-001 + 7.193253345007163E-001 7.283733333626849E-001 7.375351420398772E-001 7.468121920835402E-001 + 7.562059330516188E-001 7.657178327352483E-001 7.753493773881089E-001 7.851020719586458E-001 + 7.949774403252287E-001 8.049770255342580E-001 8.151023900412641E-001 8.253551159550543E-001 + 8.357368052849090E-001 8.462490801909092E-001 8.568935832373978E-001 8.676719776496294E-001 + 8.785859475736626E-001 8.896371983394996E-001 9.008274567275582E-001 9.121584712384796E-001 + 9.236320123663313E-001 9.352498728752607E-001 9.470138680796061E-001 9.589258361275534E-001 + 9.709876382883472E-001 9.832011592431115E-001 9.955683073793475E-001 1.008091015089109E+000 + 1.020771239070956E+000 1.033610960635684E+000 1.046612186015908E+000 1.059776946679548E+000 + 1.073107299647237E+000 1.086605327813750E+000 1.100273140273452E+000 1.114112872649842E+000 + 1.128126687429266E+000 1.142316774298791E+000 1.156685350488361E+000 1.171234661117242E+000 + 1.185966979544816E+000 1.200884607725814E+000 1.215989876569986E+000 1.231285146306323E+000 + 1.246772806851841E+000 1.262455278185007E+000 1.278335010723876E+000 1.294414485708962E+000 + 1.310696215590946E+000 1.327182744423251E+000 1.343876648259544E+000 1.360780535556269E+000 + 1.377897047580201E+000 1.395228858821171E+000 1.412778677409949E+000 1.430549245541390E+000 + 1.448543339902925E+000 1.466763772108402E+000 1.485213389137424E+000 1.503895073780192E+000 + 1.522811745087934E+000 1.541966358829033E+000 1.561361907950852E+000 1.581001423047403E+000 + 1.600887972832880E+000 1.621024664621142E+000 1.641414644811254E+000 1.662061099379099E+000 + 1.682967254375214E+000 1.704136376428846E+000 1.725571773258387E+000 1.747276794188206E+000 + 1.769254830671976E+000 1.791509316822619E+000 1.814043729948866E+000 1.836861591098618E+000 + 1.859966465609106E+000 1.883361963663974E+000 1.907051740857397E+000 1.931039498765253E+000 + 1.955328985523521E+000 1.979923996413929E+000 2.004828374456959E+000 2.030046011012357E+000 + 2.055580846387133E+000 2.081436870451268E+000 2.107618123261131E+000 2.134128695690733E+000 + 2.160972730070958E+000 2.188154420836786E+000 2.215678015182705E+000 2.243547813726332E+000 + 2.271768171180383E+000 2.300343497033134E+000 2.329278256237377E+000 2.358576969908110E+000 + 2.388244216028959E+000 2.418284630167477E+000 2.448702906199502E+000 2.479503797042542E+000 + 2.510692115398458E+000 2.542272734505453E+000 2.574250588899504E+000 2.606630675185429E+000 + 2.639418052817578E+000 2.672617844890418E+000 2.706235238939009E+000 2.740275487749559E+000 + 2.774743910180208E+000 2.809645891992078E+000 2.844986886690841E+000 2.880772416378825E+000 + 2.917008072617840E+000 2.953699517302906E+000 2.990852483546894E+000 3.028472776576372E+000 + 3.066566274638672E+000 3.105138929920356E+000 3.144196769477300E+000 3.183745896176387E+000 + 3.223792489649133E+000 3.264342807257249E+000 3.305403185070350E+000 3.346980038856020E+000 + 3.389079865082238E+000 3.431709241932512E+000 3.474874830333711E+000 3.518583374996832E+000 + 3.562841705470915E+000 3.607656737210129E+000 3.653035472654368E+000 3.698985002323373E+000 + 3.745512505924628E+000 3.792625253475245E+000 3.840330606437867E+000 3.888636018870958E+000 + 3.937549038593496E+000 3.987077308364313E+000 4.037228567076340E+000 4.088010650965772E+000 + 4.139431494836539E+000 4.191499133300121E+000 4.244221702030944E+000 4.297607439037654E+000 + 4.351664685950256E+000 4.406401889323567E+000 4.461827601956989E+000 4.517950484230867E+000 + 4.574779305459755E+000 4.632322945262574E+000 4.690590394950125E+000 4.749590758929975E+000 + 4.809333256129017E+000 4.869827221434003E+000 4.931082107150069E+000 4.993107484477742E+000 + 5.055913045008429E+000 5.119508602238725E+000 5.183904093103852E+000 5.249109579530251E+000 + 5.315135250007848E+000 5.381991421181995E+000 5.449688539465439E+000 5.518237182670661E+000 + 5.587648061662607E+000 5.657932022032345E+000 5.729100045791689E+000 5.801163253089122E+000 + 5.874132903947419E+000 5.948020400022963E+000 6.022837286387352E+000 6.098595253331307E+000 + 6.175306138191273E+000 6.252981927199102E+000 6.331634757354833E+000 6.411276918323213E+000 + 6.491920854353936E+000 6.573579166226057E+000 6.656264613216962E+000 6.739990115095946E+000 + 6.824768754143030E+000 6.910613777193061E+000 6.997538597705519E+000 7.085556797860484E+000 + 7.174682130680780E+000 7.264928522180998E+000 7.356310073543432E+000 7.448841063321374E+000 + 7.542535949670257E+000 7.637409372606672E+000 7.733476156295986E+000 7.830751311368615E+000 + 7.929250037265418E+000 8.028987724612744E+000 8.129979957627127E+000 8.232242516550462E+000 + 8.335791380115651E+000 8.440642728043269E+000 8.546812943569778E+000 8.654318616007330E+000 + 8.763176543335982E+000 8.873403734828367E+000 8.985017413707384E+000 9.098035019837468E+000 + 9.212474212449481E+000 9.328352872900114E+000 9.445689107465835E+000 9.564501250171986E+000 + 9.684807865657621E+000 9.806627752076144E+000 9.929979944032667E+000 1.005488371555816E+001 + 1.018135858312102E+001 1.030942430867664E+001 1.043910090275516E+001 1.057040862758825E+001 + 1.070336800027508E+001 1.083799979598811E+001 1.097432505121937E+001 1.111236506706729E+001 + 1.125214141256523E+001 1.139367592805156E+001 1.153699072858224E+001 1.168210820738647E+001 + 1.182905103936552E+001 1.197784218463586E+001 1.212850489211668E+001 1.228106270316251E+001 + 1.243553945524174E+001 1.259195928566114E+001 1.275034663533746E+001 1.291072625261636E+001 + 1.307312319713928E+001 1.323756284375925E+001 1.340407088650557E+001 1.357267334259870E+001 + 1.374339655651545E+001 1.391626720410529E+001 1.409131229675867E+001 1.426855918562738E+001 + 1.444803556589846E+001 1.462976948112149E+001 1.481378932759042E+001 1.500012385878069E+001 + 1.518880218984187E+001 1.537985380214707E+001 1.557330854789943E+001 1.576919665479652E+001 + 1.596754873075363E+001 1.616839576868612E+001 1.637176915135232E+001 1.657770065625708E+001 + 1.678622246061694E+001 1.699736714638814E+001 1.721116770535734E+001 1.742765754429690E+001 + 1.764687049018463E+001 1.786884079548925E+001 1.809360314352264E+001 1.832119265385890E+001 + 1.855164488782207E+001 1.878499585404262E+001 1.902128201408370E+001 1.926054028813861E+001 + 1.950280806079939E+001 1.974812318689843E+001 1.999652399742333E+001 2.024804930550604E+001 + 2.050273841248775E+001 2.076063111405951E+001 2.102176770648068E+001 2.128618899287514E+001 + 2.155393628960679E+001 2.182505143273556E+001 2.209957678455406E+001 2.237755524020708E+001 + 2.265903023439392E+001 2.294404574815500E+001 2.323264631574429E+001 2.352487703158756E+001 + 2.382078355732875E+001 2.412041212896457E+001 2.442380956406887E+001 2.473102326910822E+001 + 2.504210124684898E+001 2.535709210385811E+001 2.567604505809792E+001 2.599900994661633E+001 + 2.632603723333434E+001 2.665717801693076E+001 2.699248403882676E+001 2.733200769127052E+001 + 2.767580202552340E+001 2.802392076014966E+001 2.837641828940976E+001 2.873334969175986E+001 + 2.909477073845779E+001 2.946073790227733E+001 2.983130836633248E+001 3.020654003301210E+001 + 3.058649153302755E+001 3.097122223457379E+001 3.136079225260557E+001 3.175526245823091E+001 + 3.215469448822187E+001 3.255915075464585E+001 3.296869445461741E+001 3.338338958017277E+001 + 3.380330092826912E+001 3.422849411090882E+001 3.465903556539175E+001 3.509499256469619E+001 + 3.553643322799012E+001 3.598342653127542E+001 3.643604231816502E+001 3.689435131079654E+001 + 3.735842512088257E+001 3.782833626089998E+001 3.830415815542057E+001 3.878596515258330E+001 + 3.927383253571178E+001 3.976783653507726E+001 4.026805433980957E+001 4.077456410995854E+001 + 4.128744498870611E+001 4.180677711473313E+001 4.233264163474094E+001 4.286512071613055E+001 + 4.340429755984189E+001 4.395025641335360E+001 4.450308258384739E+001 4.506286245153721E+001 + 4.562968348316611E+001 4.620363424567365E+001 4.678480442003402E+001 4.737328481526944E+001 + 4.796916738263903E+001 4.857254523000610E+001 4.918351263638706E+001 4.980216506668199E+001 + 5.042859918659189E+001 5.106291287772257E+001 5.170520525287860E+001 5.235557667155054E+001 + 5.301412875559557E+001 5.368096440511674E+001 5.435618781454108E+001 5.503990448889986E+001 + 5.573222126031470E+001 5.643324630468944E+001 5.714308915861362E+001 5.786186073647745E+001 + 5.858967334780213E+001 5.932664071478911E+001 6.007287799008867E+001 6.082850177479340E+001 + 6.159363013665710E+001 6.236838262854275E+001 6.315288030710369E+001 6.394724575169803E+001 + 6.475160308354275E+001 6.556607798510755E+001 6.639079771975264E+001 6.722589115161468E+001 + 6.807148876574118E+001 6.892772268847985E+001 6.979472670812325E+001 7.067263629581315E+001 + 7.156158862670898E+001 7.246172260142080E+001 7.337317886771361E+001 7.429609984248353E+001 + 7.523062973401028E+001 7.617691456449101E+001 7.713510219285546E+001 7.810534233787011E+001 + 7.908778660153176E+001 8.008258849275511E+001 8.108990345135987E+001 8.210988887235747E+001 + 8.314270413054523E+001 8.418851060540868E+001 8.524747170633694E+001 8.631975289815679E+001 + 8.740552172698573E+001 8.850494784641242E+001 8.961820304400499E+001 9.074546126815267E+001 + 9.188689865524674E+001 9.304269355720088E+001 9.421302656932016E+001 9.539808055851896E+001 + 9.659804069189374E+001 9.781309446565707E+001 9.904343173443276E+001 + + rab(1:1095) = + 1.424815571178932E-006 1.442737544795347E-006 1.460884949088410E-006 1.479260619626959E-006 + 1.497867427646906E-006 1.516708280499858E-006 1.535786122107404E-006 1.555103933421111E-006 + 1.574664732888298E-006 1.594471576923679E-006 1.614527560386933E-006 1.634835817066279E-006 + 1.655399520168141E-006 1.676221882812964E-006 1.697306158537278E-006 1.718655641802060E-006 + 1.740273668507505E-006 1.762163616514269E-006 1.784328906171262E-006 1.806773000850090E-006 + 1.829499407486210E-006 1.852511677126895E-006 1.875813405486095E-006 1.899408233506273E-006 + 1.923299847927314E-006 1.947491981862577E-006 1.971988415382210E-006 1.996792976103788E-006 + 2.021909539790388E-006 2.047342030956188E-006 2.073094423479674E-006 2.099170741224573E-006 + 2.125575058668584E-006 2.152311501540027E-006 2.179384247462498E-006 2.206797526607627E-006 + 2.234555622356054E-006 2.262662871966712E-006 2.291123667254536E-006 2.319942455276699E-006 + 2.349123739027457E-006 2.378672078141768E-006 2.408592089607735E-006 2.438888448488019E-006 + 2.469565888650339E-006 2.500629203507132E-006 2.532083246764542E-006 2.563932933180822E-006 + 2.596183239334272E-006 2.628839204400846E-006 2.661905930941522E-006 2.695388585699598E-006 + 2.729292400407999E-006 2.763622672606751E-006 2.798384766470734E-006 2.833584113647836E-006 + 2.869226214107668E-006 2.905316637000939E-006 2.941861021529652E-006 2.978865077828245E-006 + 3.016334587855796E-006 3.054275406299480E-006 3.092693461489370E-006 3.131594756324749E-006 + 3.170985369212085E-006 3.210871455014780E-006 3.251259246014890E-006 3.292155052886929E-006 + 3.333565265683919E-006 3.375496354835867E-006 3.417954872160758E-006 3.460947451888308E-006 + 3.504480811696568E-006 3.548561753761574E-006 3.593197165820213E-006 3.638394022246428E-006 + 3.684159385140989E-006 3.730500405434959E-006 3.777424324007037E-006 3.824938472814974E-006 + 3.873050276041185E-006 3.921767251252811E-006 3.971097010576341E-006 4.021047261887031E-006 + 4.071625810013278E-006 4.122840557956128E-006 4.174699508124142E-006 4.227210763583792E-006 + 4.280382529325576E-006 4.334223113546076E-006 4.388740928946114E-006 4.443944494045262E-006 + 4.499842434512880E-006 4.556443484515887E-006 4.613756488083511E-006 4.671790400489157E-006 + 4.730554289649712E-006 4.790057337542412E-006 4.850308841639545E-006 4.911318216361220E-006 + 4.973094994546355E-006 5.035648828942229E-006 5.098989493712732E-006 5.163126885965597E-006 + 5.228071027298863E-006 5.293832065366737E-006 5.360420275465210E-006 5.427846062137584E-006 + 5.496119960800201E-006 5.565252639388640E-006 5.635254900024580E-006 5.706137680703662E-006 + 5.777912057004582E-006 5.850589243819657E-006 5.924180597107200E-006 5.998697615665881E-006 + 6.074151942931454E-006 6.150555368796068E-006 6.227919831450454E-006 6.306257419249310E-006 + 6.385580372600104E-006 6.465901085875683E-006 6.547232109350906E-006 6.629586151163657E-006 + 6.712976079300532E-006 6.797414923607452E-006 6.882915877825635E-006 6.969492301653128E-006 + 7.057157722832291E-006 7.145925839263552E-006 7.235810521145697E-006 7.326825813143143E-006 + 7.418985936580434E-006 7.512305291664353E-006 7.606798459734005E-006 7.702480205539145E-006 + 7.799365479547215E-006 7.897469420279397E-006 7.996807356676018E-006 8.097394810491758E-006 + 8.199247498720913E-006 8.302381336053244E-006 8.406812437360658E-006 8.512557120215196E-006 + 8.619631907438707E-006 8.728053529684530E-006 8.837838928051731E-006 8.949005256732165E-006 + 9.061569885690847E-006 9.175550403380082E-006 9.290964619487647E-006 9.407830567719623E-006 + 9.526166508618185E-006 9.645990932414846E-006 9.767322561919628E-006 9.890180355446481E-006 + 1.001458350977560E-005 1.014055146315295E-005 1.026810389832752E-005 1.039726074562683E-005 + 1.052804218607104E-005 1.066046865452629E-005 1.079456084289771E-005 1.093033970336252E-005 + 1.106782645164395E-005 1.120704257032609E-005 1.134800981221077E-005 1.149075020371631E-005 + 1.163528604831928E-005 1.178163993003950E-005 1.192983471696869E-005 1.207989356484386E-005 + 1.223183992066527E-005 1.238569752636015E-005 1.254149042249244E-005 1.269924295201908E-005 + 1.285897976409380E-005 1.302072581791845E-005 1.318450638664302E-005 1.335034706131460E-005 + 1.351827375487599E-005 1.368831270621473E-005 1.386049048426290E-005 1.403483399214862E-005 + 1.421137047139973E-005 1.439012750620022E-005 1.457113302770051E-005 1.475441531838158E-005 + 1.494000301647423E-005 1.512792512043390E-005 1.531821099347161E-005 1.551089036814221E-005 + 1.570599335098998E-005 1.590355042725292E-005 1.610359246562617E-005 1.630615072308516E-005 + 1.651125684976977E-005 1.671894289392958E-005 1.692924130693149E-005 1.714218494833045E-005 + 1.735780709100360E-005 1.757614142634948E-005 1.779722206955215E-005 1.802108356491191E-005 + 1.824776089124290E-005 1.847728946733847E-005 1.870970515750566E-005 1.894504427716891E-005 + 1.918334359854443E-005 1.942464035638608E-005 1.966897225380312E-005 1.991637746815167E-005 + 2.016689465699980E-005 2.042056296416794E-005 2.067742202584522E-005 2.093751197678255E-005 + 2.120087345656396E-005 2.146754761595648E-005 2.173757612334003E-005 2.201100117121834E-005 + 2.228786548281134E-005 2.256821231873106E-005 2.285208548374097E-005 2.313952933360063E-005 + 2.343058878199644E-005 2.372530930755929E-005 2.402373696097099E-005 2.432591837215952E-005 + 2.463190075758514E-005 2.494173192761816E-005 2.525546029400918E-005 2.557313487745379E-005 + 2.589480531525196E-005 2.622052186906400E-005 2.655033543276419E-005 2.688429754039279E-005 + 2.722246037420862E-005 2.756487677284244E-005 2.791160023955318E-005 2.826268495058799E-005 + 2.861818576364716E-005 2.897815822645607E-005 2.934265858544439E-005 2.971174379453478E-005 + 3.008547152404208E-005 3.046390016968437E-005 3.084708886170747E-005 3.123509747412411E-005 + 3.162798663406936E-005 3.202581773127384E-005 3.242865292765585E-005 3.283655516703442E-005 + 3.324958818496434E-005 3.366781651869496E-005 3.409130551725433E-005 3.452012135166007E-005 + 3.495433102525876E-005 3.539400238419527E-005 3.583920412801396E-005 3.629000582039309E-005 + 3.674647790001423E-005 3.720869169156856E-005 3.767671941690137E-005 3.815063420629693E-005 + 3.863051010990531E-005 3.911642210931274E-005 3.960844612925773E-005 4.010665904949443E-005 + 4.061113871680524E-005 4.112196395716455E-005 4.163921458805545E-005 4.216297143094138E-005 + 4.269331632389464E-005 4.323033213438372E-005 4.377410277222160E-005 4.432471320267672E-005 + 4.488224945974912E-005 4.544679865961325E-005 4.601844901423014E-005 4.659728984513080E-005 + 4.718341159737266E-005 4.777690585367203E-005 4.837786534871390E-005 4.898638398364202E-005 + 4.960255684073118E-005 5.022648019824386E-005 5.085825154547411E-005 5.149796959798026E-005 + 5.214573431300950E-005 5.280164690511650E-005 5.346580986197818E-005 5.413832696040785E-005 + 5.481930328257037E-005 5.550884523240151E-005 5.620706055223386E-005 5.691405833963162E-005 + 5.762994906443753E-005 5.835484458603378E-005 5.908885817082044E-005 5.983210450991353E-005 + 6.058469973706564E-005 6.134676144681221E-005 6.211840871284581E-005 6.289976210662165E-005 + 6.369094371619722E-005 6.449207716530867E-005 6.530328763268737E-005 6.612470187161925E-005 + 6.695644822975030E-005 6.779865666914121E-005 6.865145878657410E-005 6.951498783411488E-005 + 7.038937873993410E-005 7.127476812938969E-005 7.217129434637519E-005 7.307909747493592E-005 + 7.399831936115771E-005 7.492910363533043E-005 7.587159573439059E-005 7.682594292464622E-005 + 7.779229432478742E-005 7.877080092918653E-005 7.976161563149129E-005 8.076489324851471E-005 + 8.178079054442560E-005 8.280946625524344E-005 8.385108111364084E-005 8.490579787405859E-005 + 8.597378133813635E-005 8.705519838046312E-005 8.815021797465211E-005 8.925901121974264E-005 + 9.038175136693514E-005 9.151861384666182E-005 9.266977629599800E-005 9.383541858641867E-005 + 9.501572285190309E-005 9.621087351739412E-005 9.742105732761478E-005 9.864646337624746E-005 + 9.988728313548058E-005 1.011437104859259E-004 1.024159417469131E-004 1.037041757071651E-004 + 1.050086136558590E-004 1.063294594140784E-004 1.076669193666603E-004 1.090212024944432E-004 + 1.103925204069213E-004 1.117810873753082E-004 1.131871203660179E-004 1.146108390745658E-004 + 1.160524659598967E-004 1.175122262791444E-004 1.189903481228286E-004 1.204870624504949E-004 + 1.220026031268018E-004 1.235372069580636E-004 1.250911137292509E-004 1.266645662414582E-004 + 1.282578103498419E-004 1.298710950020353E-004 1.315046722770475E-004 1.331587974246514E-004 + 1.348337289052664E-004 1.365297284303444E-004 1.382470610032614E-004 1.399859949607261E-004 + 1.417468020147071E-004 1.435297572948889E-004 1.453351393916617E-004 1.471632303996511E-004 + 1.490143159617964E-004 1.508886853139826E-004 1.527866313302345E-004 1.547084505684786E-004 + 1.566544433168809E-004 1.586249136407673E-004 1.606201694301351E-004 1.626405224477604E-004 + 1.646862883779130E-004 1.667577868756816E-004 1.688553416169208E-004 1.709792803488265E-004 + 1.731299349411468E-004 1.753076414380371E-004 1.775127401105684E-004 1.797455755098944E-004 + 1.820064965210891E-004 1.842958564176603E-004 1.866140129167494E-004 1.889613282350261E-004 + 1.913381691452843E-004 1.937449070337520E-004 1.961819179581208E-004 1.986495827063056E-004 + 2.011482868559441E-004 2.036784208346433E-004 2.062403799809848E-004 2.088345646062977E-004 + 2.114613800572074E-004 2.141212367789726E-004 2.168145503796177E-004 2.195417416948721E-004 + 2.223032368539276E-004 2.250994673460207E-004 2.279308700878554E-004 2.307978874918701E-004 + 2.337009675353674E-004 2.366405638305104E-004 2.396171356952008E-004 2.426311482248485E-004 + 2.456830723650432E-004 2.487733849851412E-004 2.519025689527764E-004 2.550711132093100E-004 + 2.582795128462290E-004 2.615282691825040E-004 2.648178898429222E-004 2.681488888374045E-004 + 2.715217866413205E-004 2.749371102768149E-004 2.783953933951539E-004 2.818971763601107E-004 + 2.854430063323981E-004 2.890334373551629E-004 2.926690304405579E-004 2.963503536573990E-004 + 3.000779822199285E-004 3.038524985776933E-004 3.076744925065532E-004 3.115445612008362E-004 + 3.154633093666492E-004 3.194313493163658E-004 3.234493010643013E-004 3.275177924235903E-004 + 3.316374591042861E-004 3.358089448126885E-004 3.400329013519266E-004 3.443099887238031E-004 + 3.486408752319216E-004 3.530262375861108E-004 3.574667610081602E-004 3.619631393388889E-004 + 3.665160751465591E-004 3.711262798366534E-004 3.757944737630347E-004 3.805213863405012E-004 + 3.853077561587603E-004 3.901543310978340E-004 3.950618684449164E-004 4.000311350127033E-004 + 4.050629072592057E-004 4.101579714090741E-004 4.153171235764481E-004 4.205411698893498E-004 + 4.258309266156448E-004 4.311872202905832E-004 4.366108878459491E-004 4.421027767408329E-004 + 4.476637450940471E-004 4.532946618182115E-004 4.589964067555203E-004 4.647698708152199E-004 + 4.706159561128161E-004 4.765355761110301E-004 4.825296557625311E-004 4.885991316544592E-004 + 4.947449521547709E-004 5.009680775604233E-004 5.072694802474214E-004 5.136501448227566E-004 + 5.201110682782494E-004 5.266532601463351E-004 5.332777426578031E-004 5.399855509015227E-004 + 5.467777329861804E-004 5.536553502040450E-004 5.606194771967997E-004 5.676712021234555E-004 + 5.748116268303787E-004 5.820418670234579E-004 5.893630524424330E-004 5.967763270374205E-004 + 6.042828491476587E-004 6.118837916824984E-004 6.195803423046766E-004 6.273737036158857E-004 + 6.352650933446865E-004 6.432557445367794E-004 6.513469057476694E-004 6.595398412377587E-004 + 6.678358311698857E-004 6.762361718093556E-004 6.847421757264837E-004 6.933551720016873E-004 + 7.020765064331589E-004 7.109075417471465E-004 7.198496578108846E-004 7.289042518482011E-004 + 7.380727386578355E-004 7.473565508345065E-004 7.567571389927542E-004 7.662759719936037E-004 + 7.759145371740779E-004 7.856743405795952E-004 7.955569071992958E-004 8.055637812043192E-004 + 8.156965261890882E-004 8.259567254156214E-004 8.363459820609223E-004 8.468659194674800E-004 + 8.575181813969166E-004 8.683044322868308E-004 8.792263575108690E-004 8.902856636420673E-004 + 9.014840787195107E-004 9.128233525183375E-004 9.243052568231492E-004 9.359315857048528E-004 + 9.477041558009898E-004 9.596248065995906E-004 9.716954007265943E-004 9.839178242368911E-004 + 9.962939869090216E-004 1.008825822543581E-003 1.021515289265387E-003 1.034364369829428E-003 + 1.047375071930687E-003 1.060549428517836E-003 1.073889498110894E-003 1.087397365122878E-003 + 1.101075140185490E-003 1.114924960478911E-003 1.128948990065739E-003 1.143149420229128E-003 + 1.157528469815184E-003 1.172088385579660E-003 1.186831442539014E-003 1.201759944325892E-003 + 1.216876223549070E-003 1.232182642157933E-003 1.247681591811527E-003 1.263375494252270E-003 + 1.279266801684348E-003 1.295357997156876E-003 1.311651594951887E-003 1.328150140977185E-003 + 1.344856213164154E-003 1.361772421870560E-003 1.378901410288430E-003 1.396245854857056E-003 + 1.413808465681187E-003 1.431591986954497E-003 1.449599197388365E-003 1.467832910646056E-003 + 1.486295975782366E-003 1.504991277688785E-003 1.523921737544271E-003 1.543090313271691E-003 + 1.562500000000000E-003 1.582153830532242E-003 1.602054875819421E-003 1.622206245440352E-003 + 1.642611088087539E-003 1.663272592059155E-003 1.684193985757237E-003 1.705378538192113E-003 + 1.726829559493200E-003 1.748550401426221E-003 1.770544457916916E-003 1.792815165581363E-003 + 1.815366004262943E-003 1.838200497576080E-003 1.861322213456811E-003 1.884734764720282E-003 + 1.908441809625266E-003 1.932447052445758E-003 1.956754244049789E-003 1.981367182485501E-003 + 2.006289713574596E-003 2.031525731513268E-003 2.057079179480659E-003 2.082954050255006E-003 + 2.109154386837506E-003 2.135684283084057E-003 2.162547884344924E-003 2.189749388112459E-003 + 2.217293044676966E-003 2.245183157790821E-003 2.273424085340940E-003 2.302020240029712E-003 + 2.330976090064486E-003 2.360296159855740E-003 2.389985030724031E-003 2.420047341615833E-003 + 2.450487789828390E-003 2.481311131743663E-003 2.512522183571537E-003 2.544125822102361E-003 + 2.576126985468951E-003 2.608530673918192E-003 2.641341950592331E-003 2.674565942320102E-003 + 2.708207840417807E-003 2.742272901500467E-003 2.776766448303186E-003 2.811693870512827E-003 + 2.847060625610172E-003 2.882872239722658E-003 2.919134308487848E-003 2.955852497927766E-003 + 2.993032545334214E-003 3.030680260165243E-003 3.068801524952888E-003 3.107402296222331E-003 + 3.146488605422621E-003 3.186066559869087E-003 3.226142343697637E-003 3.266722218831027E-003 + 3.307812525957304E-003 3.349419685520562E-003 3.391550198724130E-003 3.434210648546411E-003 + 3.477407700769483E-003 3.521148105020638E-003 3.565438695827038E-003 3.610286393683601E-003 + 3.655698206134363E-003 3.701681228867409E-003 3.748242646823591E-003 3.795389735319201E-003 + 3.843129861182736E-003 3.891470483905988E-003 3.940419156809609E-003 3.989983528223323E-003 + 4.040171342681011E-003 4.090990442130784E-003 4.142448767160325E-003 4.194554358237613E-003 + 4.247315356967258E-003 4.300740007362668E-003 4.354836657134143E-003 4.409613758993280E-003 + 4.465079871973697E-003 4.521243662768377E-003 4.578113907083914E-003 4.635699491011670E-003 + 4.694009412416301E-003 4.753052782341665E-003 4.812838826434424E-003 4.873376886385618E-003 + 4.934676421390265E-003 4.996747009625429E-003 5.059598349746818E-003 5.123240262404178E-003 + 5.187682691775861E-003 5.252935707122548E-003 5.319009504360653E-003 5.385914407655433E-003 + 5.453660871034128E-003 5.522259480019490E-003 5.591720953283720E-003 5.662056144323345E-003 + 5.733276043155073E-003 5.805391778032975E-003 5.878414617187367E-003 5.952355970585410E-003 + 6.027227391714021E-003 6.103040579385086E-003 6.179807379563402E-003 6.257539787217702E-003 + 6.336249948194807E-003 6.415950161117518E-003 6.496652879306267E-003 6.578370712724938E-003 + 6.661116429951285E-003 6.744902960171945E-003 6.829743395202745E-003 6.915650991534278E-003 + 7.002639172403226E-003 7.090721529889855E-003 7.179911827041703E-003 7.270224000024170E-003 + 7.361672160298038E-003 7.454270596824380E-003 7.548033778297318E-003 7.642976355404698E-003 + 7.739113163117365E-003 7.836459223007129E-003 7.935029745593878E-003 8.034840132722331E-003 + 8.135905979968517E-003 8.238243079076703E-003 8.341867420426844E-003 8.446795195533074E-003 + 8.553042799573758E-003 8.660626833953163E-003 8.769564108895555E-003 8.879871646071794E-003 + 8.991566681258955E-003 9.104666667033563E-003 9.219189275498465E-003 9.335152401044253E-003 + 9.452574163145235E-003 9.571472909190604E-003 9.691867217351362E-003 9.813775899483073E-003 + 9.937218004065359E-003 1.006221281917823E-002 1.018877987551580E-002 1.031693894943818E-002 + 1.044671006606136E-002 1.057811350238637E-002 1.071116979046747E-002 1.084589972062037E-002 + 1.098232434467078E-002 1.112046497924375E-002 1.126034320909448E-002 1.140198089048100E-002 + 1.154540015457914E-002 1.169062341094076E-002 1.183767335099508E-002 1.198657295159442E-002 + 1.213734547860434E-002 1.229001449053889E-002 1.244460384224184E-002 1.260113768861387E-002 + 1.275964048838695E-002 1.292013700794605E-002 1.308265232519885E-002 1.324721183349435E-002 + 1.341384124559046E-002 1.358256659767188E-002 1.375341425341815E-002 1.392641090812303E-002 + 1.410158359286583E-002 1.427895967873489E-002 1.445856688110451E-002 1.464043326396552E-002 + 1.482458724431020E-002 1.501105759657267E-002 1.519987345712483E-002 1.539106432882903E-002 + 1.558466008564801E-002 1.578069097731259E-002 1.597918763404845E-002 1.618018107136203E-002 + 1.638370269488683E-002 1.658978430529064E-002 1.679845810324430E-002 1.700975669445336E-002 + 1.722371309475251E-002 1.744036073526463E-002 1.765973346762436E-002 1.788186556926738E-002 + 1.810679174878657E-002 1.833454715135502E-002 1.856516736421781E-002 1.879868842225241E-002 + 1.903514681359918E-002 1.927457948536292E-002 1.951702384938565E-002 1.976251778809254E-002 + 2.001109966041100E-002 2.026280830776427E-002 2.051768306014067E-002 2.077576374223873E-002 + 2.103709067969017E-002 2.130170470536057E-002 2.156964716572984E-002 2.184095992735258E-002 + 2.211568538339970E-002 2.239386646028273E-002 2.267554662436082E-002 2.296076988873272E-002 + 2.324958082011383E-002 2.354202454579968E-002 2.383814676071747E-002 2.413799373456567E-002 + 2.444161231904402E-002 2.474904995517412E-002 2.506035468071199E-002 2.537557513765447E-002 + 2.569476057983916E-002 2.601796088064085E-002 2.634522654076414E-002 2.667660869613416E-002 + 2.701215912588698E-002 2.735193026045983E-002 2.769597518978382E-002 2.804434767157915E-002 + 2.839710213975479E-002 2.875429371291418E-002 2.911597820296721E-002 2.948221212385138E-002 + 2.985305270036198E-002 3.022855787709347E-002 3.060878632749378E-002 3.099379746303177E-002 + 3.138365144248073E-002 3.177840918131817E-002 3.217813236124380E-002 3.258288343981787E-002 + 3.299272566021973E-002 3.340772306113023E-002 3.382794048673762E-002 3.425344359686949E-002 + 3.468429887725260E-002 3.512057364990098E-002 3.556233608363552E-002 3.600965520473531E-002 + 3.646260090772301E-002 3.692124396628633E-002 3.738565604433618E-002 3.785590970720466E-002 + 3.833207843298340E-002 3.881423662400445E-002 3.930245961846625E-002 3.979682370220484E-002 + 4.029740612061417E-002 4.080428509071562E-002 4.131753981337938E-002 4.183725048570025E-002 + 4.236349831352798E-002 4.289636552415640E-002 4.343593537917140E-002 4.398229218746040E-002 + 4.453552131838644E-002 4.509570921512662E-002 4.566294340817960E-002 4.623731252904216E-002 + 4.681890632405786E-002 4.740781566844057E-002 4.800413258047334E-002 4.860795023588697E-002 + 4.921936298241870E-002 4.983846635455391E-002 5.046535708845426E-002 5.110013313707215E-002 + 5.174289368545674E-002 5.239373916625151E-002 5.305277127538680E-002 5.372009298797067E-002 + 5.439580857437820E-002 5.508002361654460E-002 5.577284502446236E-002 5.647438105288584E-002 + 5.718474131824694E-002 5.790403681578218E-002 5.863237993687657E-002 5.936988448662470E-002 + 6.011666570161272E-002 6.087284026792503E-002 6.163852633937587E-002 6.241384355597177E-002 + 6.319891306260537E-002 6.399385752798407E-002 6.479880116379814E-002 6.561386974412814E-002 + 6.643919062509811E-002 6.727489276477494E-002 6.812110674331799E-002 6.897796478338326E-002 + 6.984560077078260E-002 7.072415027540432E-002 7.161375057239612E-002 7.251454066361403E-002 + 7.342666129934274E-002 7.435025500028704E-002 7.528546607984191E-002 7.623244066664135E-002 + 7.719132672739093E-002 7.816227408998877E-002 7.914543446693542E-002 8.014096147904017E-002 + 8.114901067942420E-002 8.216973957782571E-002 8.320330766521203E-002 8.424987643869933E-002 + 8.530960942678788E-002 8.638267221491326E-002 8.746923247131899E-002 8.856945997325605E-002 + 8.968352663350976E-002 9.081160652726249E-002 9.195387591929291E-002 9.311051329151718E-002 + 9.428169937087821E-002 9.546761715758340E-002 9.666845195369983E-002 9.788439139210769E-002 + 9.911562546581773E-002 1.003623465576593E-001 1.016247494703391E-001 1.029030314568808E-001 + 1.041973922514456E-001 1.055080341005409E-001 1.068351617946222E-001 1.081789827000916E-001 + 1.095397067916998E-001 1.109175466853546E-001 1.123127176713423E-001 1.137254377479684E-001 + 1.151559276556185E-001 1.166044109112514E-001 1.180711138433229E-001 1.195562656271498E-001 + 1.210600983207203E-001 1.225828469009518E-001 1.241247493004083E-001 1.256860464444771E-001 + 1.272669822890127E-001 1.288678038584580E-001 1.304887612844395E-001 1.321301078448531E-001 + 1.337921000034385E-001 1.354749974498514E-001 1.371790631402421E-001 1.389045633383411E-001 + 1.406517676570653E-001 1.424209491006445E-001 1.442123841072780E-001 1.460263525923308E-001 + 1.478631379920690E-001 1.497230273079483E-001 1.516063111514585E-001 1.535132837895314E-001 + 1.554442431905218E-001 1.573994910707643E-001 1.593793329417183E-001 1.613840781577045E-001 + 1.634140399642410E-001 1.654695355469907E-001 1.675508860813196E-001 1.696584167824838E-001 + 1.717924569564432E-001 1.739533400513162E-001 1.761414037094833E-001 1.783569898203423E-001 + 1.806004445737307E-001 1.828721185140186E-001 1.851723665948802E-001 1.875015482347587E-001 + 1.898600273730234E-001 1.922481725268383E-001 1.946663568487429E-001 1.971149581849565E-001 + 1.995943591344204E-001 2.021049471085765E-001 2.046471143919041E-001 2.072212582032135E-001 + 2.098277807577118E-001 2.124670893298518E-001 2.151395963169668E-001 2.178457193037112E-001 + 2.205858811273078E-001 2.233605099436157E-001 2.261700392940330E-001 2.290149081732362E-001 + 2.318955610977760E-001 2.348124481755328E-001 2.377660251760463E-001 2.407567536017327E-001 + 2.437851007599924E-001 2.468515398362304E-001 2.499565499677917E-001 2.531006163188256E-001 + 2.562842301560969E-001 2.595078889257439E-001 2.627720963310085E-001 2.660773624109393E-001 + 2.694242036200849E-001 2.728131429091945E-001 2.762447098069257E-001 2.797194405025886E-001 + 2.832378779299240E-001 2.868005718519375E-001 2.904080789468036E-001 2.940609628948445E-001 + 2.977597944666094E-001 3.015051516120572E-001 3.052976195508609E-001 3.091377908638527E-001 + 3.130262655856123E-001 3.169636512982264E-001 3.209505632262240E-001 3.249876243327041E-001 + 3.290754654166793E-001 3.332147252116345E-001 3.374060504853346E-001 3.416500961408815E-001 + 3.459475253190425E-001 3.502990095018708E-001 3.547052286176220E-001 3.591668711469982E-001 + 3.636846342307223E-001 3.682592237784666E-001 3.728913545791561E-001 3.775817504126512E-001 + 3.823311441628444E-001 3.871402779321724E-001 3.920099031575697E-001 3.969407807278864E-001 + 4.019336811027734E-001 4.069893844330731E-001 4.121086806827176E-001 4.172923697521596E-001 + 4.225412616033641E-001 4.278561763863603E-001 4.332379445673968E-001 4.386874070587024E-001 + 4.442054153498765E-001 4.497928316409427E-001 4.554505289770628E-001 4.611793913849567E-001 + 4.669803140110322E-001 4.728542032612498E-001 4.788019769427572E-001 4.848245644072913E-001 + 4.909229066963972E-001 4.970979566884657E-001 5.033506792476196E-001 5.096820513744817E-001 + 5.160930623588265E-001 5.225847139341642E-001 5.291580204342619E-001 5.358140089516319E-001 + 5.425537194980236E-001 5.493782051669200E-001 5.562885322980924E-001 5.632857806442152E-001 + 5.703710435395765E-001 5.775454280709207E-001 5.848100552504253E-001 5.921660601908680E-001 + 5.996145922829879E-001 6.071568153750763E-001 6.147939079548382E-001 6.225270633335249E-001 + 6.303574898323987E-001 6.382864109715322E-001 6.463150656609825E-001 6.544447083943817E-001 + 6.626766094449447E-001 6.710120550639593E-001 6.794523476817635E-001 6.879988061112483E-001 + 6.966527657539338E-001 7.054155788086180E-001 7.142886144826703E-001 7.232732592059681E-001 + 7.323709168475266E-001 7.415830089348640E-001 7.509109748761085E-001 7.603562721849175E-001 + 7.699203767082138E-001 7.796047828567845E-001 7.894110038387961E-001 7.993405718962254E-001 + 8.093950385442844E-001 8.195759748138445E-001 8.298849714969081E-001 8.403236393951835E-001 + 8.508936095717647E-001 8.615965336059981E-001 8.724340838515406E-001 8.834079536976644E-001 + 8.945198578338623E-001 9.057715325177601E-001 9.171647358464201E-001 9.287012480310441E-001 + 9.403828716751286E-001 9.522114320561377E-001 9.641887774106932E-001 9.763167792233765E-001 + 9.885973325191471E-001 1.001032356159439E+000 1.013623793141998E+000 1.026373610904469E+000 + 1.039283801631815E+000 1.052356382567609E+000 1.065593396329212E+000 1.078996911226960E+000 + 1.092569021587322E+000 1.106311848080155E+000 1.120227538050062E+000 1.134318265851908E+000 + 1.148586233190584E+000 1.163033669465011E+000 1.177662832116502E+000 1.192476006981487E+000 + 1.207475508648672E+000 1.222663680820713E+000 1.238042896680410E+000 +/ + +&local +vloc(1:1095) = +-3.959624422322239E+001 -3.959625385320293E+001 -3.959626365265639E+001 -3.959627363427202E+001 +-3.959628381049185E+001 -3.959629419351949E+001 -3.959630479532859E+001 -3.959631563552769E+001 +-3.959632679662119E+001 -3.959633824025218E+001 -3.959634895829286E+001 -3.959636096043304E+001 +-3.959637326635907E+001 -3.959638588377608E+001 -3.959639882055205E+001 -3.959641208478321E+001 +-3.959642482061974E+001 -3.959643874103972E+001 -3.959645301380638E+001 -3.959646764783876E+001 +-3.959648265226726E+001 -3.959649803652388E+001 -3.959651381012080E+001 -3.959652998296047E+001 +-3.959654656512785E+001 -3.959656228255710E+001 -3.959657968021117E+001 -3.959659751820813E+001 +-3.959661580762333E+001 -3.959663455995469E+001 -3.959665272687897E+001 -3.959667241201253E+001 +-3.959669259532957E+001 -3.959671328951007E+001 -3.959673450747822E+001 -3.959675626250315E+001 +-3.959677856807991E+001 -3.959680143816168E+001 -3.959682488712718E+001 -3.959684892956729E+001 +-3.959687358045201E+001 -3.959689885523004E+001 -3.959692476967803E+001 -3.959694964703533E+001 +-3.959697684508745E+001 -3.959700473148285E+001 -3.959703332357536E+001 -3.959706130022479E+001 +-3.959709132248835E+001 -3.959712210450277E+001 -3.959715366545179E+001 -3.959718602506627E+001 +-3.959721920363561E+001 -3.959725322174640E+001 -3.959728810073616E+001 -3.959732386241821E+001 +-3.959736052912092E+001 -3.959739812369802E+001 -3.959743666963212E+001 -3.959747619091922E+001 +-3.959751671224312E+001 -3.959755825884703E+001 -3.959760085672698E+001 -3.959764453234449E+001 +-3.959768931306181E+001 -3.959773522686079E+001 -3.959778230241007E+001 -3.959782809197516E+001 +-3.959787751601688E+001 -3.959792819061214E+001 -3.959797831202674E+001 -3.959803153579206E+001 +-3.959808610607536E+001 -3.959814205673877E+001 -3.959819942276579E+001 -3.959825824013600E+001 +-3.959831854558553E+001 -3.959838037659943E+001 -3.959844377170353E+001 -3.959850877077351E+001 +-3.959857541414056E+001 -3.959864374326736E+001 -3.959871380086004E+001 -3.959878563065821E+001 +-3.959885927754785E+001 -3.959893478716450E+001 -3.959901220673706E+001 -3.959909158449379E+001 +-3.959917296986502E+001 -3.959925641354704E+001 -3.959934196757856E+001 -3.959942968529555E+001 +-3.959951962136442E+001 -3.959961183181136E+001 -3.959970637415143E+001 -3.959980330736803E+001 +-3.959990269178395E+001 -3.960000458943888E+001 -3.960010906376169E+001 -3.960021617987327E+001 +-3.960032177447619E+001 -3.960043426779335E+001 -3.960054682068021E+001 -3.960066500283769E+001 +-3.960078617283736E+001 -3.960091040603426E+001 -3.960103777998404E+001 -3.960116837371622E+001 +-3.960130226827267E+001 -3.960143954748899E+001 -3.960158029639967E+001 -3.960172460295617E+001 +-3.960187255692673E+001 -3.960202425001235E+001 -3.960217977687456E+001 -3.960233923385778E+001 +-3.960250272014594E+001 -3.960267033772063E+001 -3.960284219049998E+001 -3.960301838570417E+001 +-3.960319903271947E+001 -3.960338424337389E+001 -3.960357413296531E+001 -3.960376881915365E+001 +-3.960396842292008E+001 -3.960417306819384E+001 -3.960438288197346E+001 -3.960459799453165E+001 +-3.960481853973278E+001 -3.960504465450713E+001 -3.960527647890746E+001 -3.960551415699551E+001 +-3.960575783565987E+001 -3.960600766615320E+001 -3.960626380373282E+001 -3.960652640650666E+001 +-3.960679563741736E+001 -3.960707166303802E+001 -3.960735465434943E+001 -3.960764478725350E+001 +-3.960794224096051E+001 -3.960824719981267E+001 -3.960855985230738E+001 -3.960888039140300E+001 +-3.960920901608949E+001 -3.960954592903887E+001 -3.960989133851782E+001 -3.961024545803881E+001 +-3.961060850604117E+001 -3.961098070732739E+001 -3.961136229162902E+001 -3.961175349450270E+001 +-3.961215455731018E+001 -3.961256572717987E+001 -3.961298725812046E+001 -3.961341940908272E+001 +-3.961385113269051E+001 -3.961429945781320E+001 -3.961476466031022E+001 -3.961524157870063E+001 +-3.961573050426911E+001 -3.961623173956241E+001 -3.961674559259257E+001 -3.961727237834213E+001 +-3.961781242133592E+001 -3.961836605106301E+001 -3.961893360900636E+001 -3.961951544408767E+001 +-3.962011191120283E+001 -3.962072337650537E+001 -3.962135021396065E+001 -3.962199280788710E+001 +-3.962265155098670E+001 -3.962332684672803E+001 -3.962401910839040E+001 -3.962472875705509E+001 +-3.962545622673819E+001 -3.962620196120464E+001 -3.962696641546403E+001 -3.962775005481082E+001 +-3.962855335624653E+001 -3.962937681062910E+001 -3.963022091545676E+001 -3.963108618400486E+001 +-3.963197314489632E+001 -3.963288233423840E+001 -3.963381430301356E+001 -3.963476961585763E+001 +-3.963574885210996E+001 -3.963675260455043E+001 -3.963778147779157E+001 -3.963883609429405E+001 +-3.963991708980490E+001 -3.964102511471709E+001 -3.964216083777580E+001 -3.964332494317706E+001 +-3.964451813116897E+001 -3.964574111566558E+001 -3.964699462966875E+001 -3.964827942659944E+001 +-3.964959627610289E+001 -3.965094596519575E+001 -3.965232929702616E+001 -3.965374709729971E+001 +-3.965520021295357E+001 -3.965668950747217E+001 -3.965821586612641E+001 -3.965978019465902E+001 +-3.966138342043062E+001 -3.966302649385507E+001 -3.966471038535632E+001 -3.966643608775642E+001 +-3.966820461817282E+001 -3.967001701891080E+001 -3.967187435440663E+001 -3.967377771278021E+001 +-3.967572821017840E+001 -3.967772698670711E+001 -3.967977520928349E+001 -3.968187407255830E+001 +-3.968402479531592E+001 -3.968622862692985E+001 -3.968848684422215E+001 -3.969080075207050E+001 +-3.969317168811222E+001 -3.969560101643839E+001 -3.969809013283709E+001 -3.970064046584488E+001 +-3.970325347490444E+001 -3.970593065129921E+001 -3.970867351798940E+001 -3.971148363535628E+001 +-3.971436259688690E+001 -3.971731202771502E+001 -3.972033359043128E+001 -3.972342898412528E+001 +-3.972659994610670E+001 -3.972984825047364E+001 -3.973317570677385E+001 -3.973658416300761E+001 +-3.974007550953901E+001 -3.974365167655071E+001 -3.974731463034571E+001 -3.975106638139673E+001 +-3.975490898213205E+001 -3.975884452604420E+001 -3.976287515117252E+001 -3.976700303664419E+001 +-3.977123040633841E+001 -3.977555953090206E+001 -3.977999272554747E+001 -3.978453235015787E+001 +-3.978918081022131E+001 -3.979394055963083E+001 -3.979881410065585E+001 -3.980380398150628E+001 +-3.980891279907638E+001 -3.981414320043779E+001 -3.981949788022260E+001 -3.982497958321085E+001 +-3.983059110611984E+001 -3.983633529525559E+001 -3.984221504646986E+001 -3.984823330790708E+001 +-3.985439307976844E+001 -3.986069741224780E+001 -3.986714940905466E+001 -3.987375222571273E+001 +-3.988050906805398E+001 -3.988742319644839E+001 -3.989449792250991E+001 -3.990173660753597E+001 +-3.990914266777280E+001 -3.991671957296776E+001 -3.992447084048937E+001 -3.993240004063362E+001 +-3.994051079586599E+001 -3.994880677534161E+001 -3.995729170107003E+001 -3.996596934425022E+001 +-3.997484352281001E+001 -3.998391810470068E+001 -3.999319700396335E+001 -4.000268417927282E+001 +-4.001238363466462E+001 -4.002229941785579E+001 -4.003243561752453E+001 -4.004279636378524E+001 +-4.005338582571950E+001 -4.006420820841491E+001 -4.007526775258853E+001 -4.008656873257435E+001 +-4.009811545434859E+001 -4.010991225140452E+001 -4.012196348320845E+001 -4.013427353249168E+001 +-4.014684680109113E+001 -4.015968771038958E+001 -4.017280069636121E+001 -4.018619020155356E+001 +-4.019986067752056E+001 -4.021381658169957E+001 -4.022806236655482E+001 -4.024260247832386E+001 +-4.025744135498729E+001 -4.027258342029845E+001 -4.028803307766791E+001 -4.030379470263949E+001 +-4.031987264126917E+001 -4.033627120446770E+001 -4.035299465862101E+001 -4.037004722113040E+001 +-4.038743305215781E+001 -4.040515625043559E+001 -4.042322084522425E+001 -4.044163078673675E+001 +-4.046038994077573E+001 -4.047950207780458E+001 -4.049897086704922E+001 -4.051879986679895E+001 +-4.053899251516101E+001 -4.055955212386759E+001 -4.058048186418223E+001 -4.060178475638114E+001 +-4.062346366315550E+001 -4.064552127967315E+001 -4.066796011952887E+001 -4.069078250402461E+001 +-4.071399055198499E+001 -4.073758616870347E+001 -4.076157103408228E+001 -4.078594658663473E+001 +-4.081071401578915E+001 -4.083587424746926E+001 -4.086142792880906E+001 -4.088737542223959E+001 +-4.091371678551491E+001 -4.094045175696474E+001 -4.096757974759171E+001 -4.099509982621129E+001 +-4.102301070524802E+001 -4.105131072504656E+001 -4.107999784004303E+001 -4.110906960641775E+001 +-4.113852316988388E+001 -4.116835525038687E+001 -4.119856212704838E+001 -4.122913962534739E+001 +-4.126008310281662E+001 -4.129138743910027E+001 -4.132304702158214E+001 -4.135505572989688E+001 +-4.138740692741445E+001 -4.142009344709812E+001 -4.145310758008198E+001 -4.148644106795610E+001 +-4.152008508728126E+001 -4.155403024093830E+001 -4.158826655276783E+001 -4.162278345547695E+001 +-4.165756978231397E+001 -4.169261376189576E+001 -4.172790301122655E+001 -4.176342452968175E+001 +-4.179916469568556E+001 -4.183510926462677E+001 -4.187124336365805E+001 -4.190755149117378E+001 +-4.194401751935484E+001 -4.198062469280887E+001 -4.201735563065912E+001 -4.205419233060698E+001 +-4.209111617592109E+001 -4.212810794112944E+001 -4.216514779731067E+001 -4.220221532371206E+001 +-4.223928951789279E+001 -4.227634880672285E+001 -4.231337106193568E+001 -4.235033361567424E+001 +-4.238721327475213E+001 -4.242398633869050E+001 -4.246062862193686E+001 -4.249711547483102E+001 +-4.253342180433381E+001 -4.256952209987960E+001 -4.260539046016859E+001 -4.264100061835472E+001 +-4.267632597178967E+001 -4.271133961131588E+001 -4.274601435359618E+001 -4.278032277487175E+001 +-4.281423724250126E+001 -4.284772995156664E+001 -4.288077296192242E+001 -4.291333823517571E+001 +-4.294539767292859E+001 -4.297692315614239E+001 -4.300788658632446E+001 -4.303825992551376E+001 +-4.306801523937721E+001 -4.309712473948586E+001 -4.312556082491562E+001 -4.315329612757731E+001 +-4.318030355517750E+001 -4.320655633619381E+001 -4.323202806416063E+001 -4.325669274043040E+001 +-4.328052482032509E+001 -4.330349925834413E+001 -4.332559155094251E+001 -4.334677778076352E+001 +-4.336703466143051E+001 -4.338633957940118E+001 -4.340467063703568E+001 -4.342200669662034E+001 +-4.343832742090601E+001 -4.345361331278325E+001 -4.346784575642702E+001 -4.348100705674133E+001 +-4.349308047724875E+001 -4.350405027717395E+001 -4.351390174774717E+001 -4.352262124726816E+001 +-4.353019623471035E+001 -4.353661530225310E+001 -4.354186820612621E+001 -4.354594589631882E+001 +-4.354884054514665E+001 -4.355054557350576E+001 -4.355105567568366E+001 -4.355036684343142E+001 +-4.354847638691513E+001 -4.354538295389044E+001 -4.354108654786082E+001 -4.353558854409998E+001 +-4.352889170317948E+001 -4.352100018156423E+001 -4.351191954147816E+001 -4.350165675795539E+001 +-4.349022022268107E+001 -4.347761974602678E+001 -4.346386655603686E+001 -4.344897329484915E+001 +-4.343295401254769E+001 -4.341582415797911E+001 -4.339760056595358E+001 -4.337830144219731E+001 +-4.335794634481226E+001 -4.333655616186607E+001 -4.331415308678017E+001 -4.329076058990246E+001 +-4.326640338607654E+001 -4.324110739928062E+001 -4.321489972368241E+001 -4.318780858134167E+001 +-4.315986327642790E+001 -4.313109414544411E+001 -4.310153250461207E+001 -4.307121059366671E+001 +-4.304016151628120E+001 -4.300841917769293E+001 -4.297601821893730E+001 -4.294299394848011E+001 +-4.290938227099564E+001 -4.287521961354832E+001 -4.284054284989391E+001 -4.280538922247148E+001 +-4.276979626250813E+001 -4.273380170905182E+001 -4.269744342678402E+001 -4.266075932266887E+001 +-4.262378726220760E+001 -4.258656498572839E+001 -4.254913002484299E+001 -4.251151961931686E+001 +-4.247377063487595E+001 -4.243591948232704E+001 -4.239800203835091E+001 -4.236005356821910E+001 +-4.232210865085646E+001 -4.228420110670304E+001 -4.224636392830116E+001 -4.220862921423593E+001 +-4.217102810678582E+001 -4.213359073321885E+001 -4.209634615111398E+001 -4.205932229788326E+001 +-4.202254594471989E+001 -4.198604265506128E+001 -4.194983674768567E+001 -4.191395126443923E+001 +-4.187840794271904E+001 -4.184322719278221E+001 -4.180842807964157E+001 -4.177402830971891E+001 +-4.174004422208472E+001 -4.170649078408281E+001 -4.167338159134914E+001 -4.164072887196771E+001 +-4.160854349461746E+001 -4.157683498049085E+001 -4.154561151871239E+001 -4.151487998508778E+001 +-4.148464596389050E+001 -4.145491377241514E+001 -4.142568648803468E+001 -4.139696597746462E+001 +-4.136875292797397E+001 -4.134104688023588E+001 -4.131384626254455E+001 -4.128714842611944E+001 +-4.126094968120724E+001 -4.123524533373017E+001 -4.121002972221524E+001 -4.118529625475959E+001 +-4.116103744579230E+001 -4.113724495240997E+001 -4.111390961008259E+001 -4.109102146753341E+001 +-4.106856982061737E+001 -4.104654324503528E+001 -4.102492962774496E+001 -4.100371619694189E+001 +-4.098288955049977E+001 -4.096243568278015E+001 -4.094234000973876E+001 -4.092258739227847E+001 +-4.090316215780146E+001 -4.088404811994393E+001 -4.086522859649053E+001 -4.084668642547640E+001 +-4.082840397951054E+001 -4.081036317835947E+001 -4.079254549984673E+001 -4.077493198914320E+001 +-4.075750326654364E+001 -4.074023953382294E+001 -4.072312057927762E+001 -4.070612578159226E+001 +-4.068923411266333E+001 -4.067242413952578E+001 -4.065567402555048E+001 -4.063896153107815E+001 +-4.062226401366831E+001 -4.060555842815108E+001 -4.058882132668231E+001 -4.057202885900578E+001 +-4.055515677312526E+001 -4.053818041660601E+001 -4.052107473872596E+001 -4.050381429369295E+001 +-4.048637324515210E+001 -4.046872537220580E+001 -4.045084407716515E+001 -4.043270239524563E+001 +-4.041427300641514E+001 -4.039552824959622E+001 -4.037644013940550E+001 -4.035698038560230E+001 +-4.033712041540193E+001 -4.031683139878376E+001 -4.029608427690121E+001 -4.027484979367080E+001 +-4.025309853058457E+001 -4.023080094475345E+001 -4.020792741014667E+001 -4.018444826194668E+001 +-4.016033384388997E+001 -4.013555455841021E+001 -4.011008091934276E+001 -4.008388360688748E+001 +-4.005693352446495E+001 -4.002920185703660E+001 -4.000066013038764E+001 -3.997128027081121E+001 +-3.994103466456078E+001 -3.990989621637193E+001 -3.987783840630577E+001 -3.984483534409548E+001 +-3.981086182013963E+001 -3.977589335224729E+001 -3.973990622719733E+001 -3.970287753617811E+001 +-3.966478520315997E+001 -3.962560800527201E+001 -3.958532558428436E+001 -3.954391844833957E+001 +-3.950136796317405E+001 -3.945765633214353E+001 -3.941276656447339E+001 -3.936668243129992E+001 +-3.931938840921839E+001 -3.927086961122075E+001 -3.922111170507708E+001 -3.917010081943430E+001 +-3.911782343807818E+001 -3.906426628300703E+001 -3.900941618720385E+001 -3.895325995813640E+001 +-3.889578423321370E+001 -3.883697532857892E+001 -3.877681908273917E+001 -3.871530069665008E+001 +-3.865240457189442E+001 -3.858811414863106E+001 -3.852241174494580E+001 -3.845527839913985E+001 +-3.838669371636971E+001 -3.831663572082950E+001 -3.824508071442265E+001 -3.817200314253141E+001 +-3.809737546713617E+001 -3.802116804710825E+001 -3.794334902496166E+001 -3.786388421884738E+001 +-3.778273701794684E+001 -3.769986827875206E+001 -3.761523621904136E+001 -3.752879630560395E+001 +-3.744050113100351E+001 -3.735030027385471E+001 -3.725814013633087E+001 -3.716396375186932E+001 +-3.706771055533252E+001 -3.696931610737339E+001 -3.686871176438089E+001 -3.676582428529409E+001 +-3.666057536693921E+001 -3.655288110036830E+001 -3.644265134218848E+001 -3.632978899726477E+001 +-3.621418921253964E+001 -3.609573848628547E+001 -3.597431370300207E+001 -3.584978111147404E+001 +-3.572199527224459E+001 -3.559079801080024E+001 -3.545601742378953E+001 -3.531746699710136E+001 +-3.517494490585584E+001 -3.502823357622079E+001 -3.487709959620228E+001 -3.472129406564835E+001 +-3.456055347302387E+001 -3.439460117666948E+001 -3.422314954999603E+001 -3.404590282285145E+001 +-3.386256061552667E+001 -3.367282211889420E+001 -3.347639082674549E+001 -3.327297967837047E+001 +-3.306231642557412E+001 -3.284414900390122E+001 -3.261825066777087E+001 -3.238442464744304E+001 +-3.214250810437295E+001 -3.189237520035545E+001 -3.163393915217515E+001 -3.136715321215296E+001 +-3.109201058918671E+001 -3.080854339700434E+001 -3.051682077906126E+001 -3.021694640683766E+001 +-2.990905557637376E+001 -2.959331213537850E+001 -2.926990546131848E+001 -2.893904768275773E+001 +-2.860097129647674E+001 -2.825592728675647E+001 -2.790418380569671E+001 -2.754602542884180E+001 +-2.718175296187562E+001 -2.681168374363328E+001 -2.643615236888547E+001 -2.605551174101892E+001 +-2.567013435888192E+001 -2.528041374229176E+001 -2.488676590544256E+001 -2.448963079518096E+001 +-2.408947362047910E+001 -2.368678600932860E+001 -2.328208693887347E+001 -2.287592339333025E+001 +-2.246887071177796E+001 -2.206153259407756E+001 -2.165454073798715E+001 -2.124855408404616E+001 +-2.084425764713963E+001 -2.044236091497493E+001 -2.004359579417128E+001 -1.964871408444628E+001 +-1.925848446062146E+001 -1.887368894100901E+001 -1.849511881933488E+001 -1.812357003581853E+001 +-1.775983796155302E+001 -1.740471156908653E+001 -1.705896696132256E+001 -1.672336023084910E+001 +-1.639861962292675E+001 -1.608543697810289E+001 -1.578445843537438E+001 -1.549627438472702E+001 +-1.522140866967019E+001 -1.496030705715428E+001 -1.471332501534683E+001 -1.448071487071766E+001 +-1.426261245655528E+001 -1.405902341752106E+001 -1.386980940147944E+001 -1.369467445324832E+001 +-1.353315202794706E+001 -1.338459316729963E+001 -1.324815653376933E+001 -1.312280117797825E+001 +-1.300728312774491E+001 -1.290015713544758E+001 -1.279978520739085E+001 -1.270435386757408E+001 +-1.261190248202305E+001 -1.252036539255855E+001 -1.242763108556672E+001 -1.233162215912159E+001 +-1.223040046110953E+001 -1.212230246700639E+001 -1.200611077036348E+001 -1.188126850144401E+001 +-1.174814460768029E+001 -1.160835944477409E+001 -1.146518402115629E+001 -1.132280407179867E+001 +-1.118218989168451E+001 -1.104331785872899E+001 -1.090616668641812E+001 -1.077071544792547E+001 +-1.063694343630547E+001 -1.050483016425221E+001 -1.037435536387954E+001 -1.024549898648309E+001 +-1.011824120225304E+001 -9.992562399913206E+000 -9.868443186270932E+000 -9.745864385665094E+000 +-9.624807039307031E+000 -9.505252404509125E+000 -9.387181953799780E+000 -9.270577373928035E+000 +-9.155420564758977E+000 -9.041693638065841E+000 -8.929378916223136E+000 -8.818458930806344E+000 +-8.708916421101794E+000 -8.600734333274142E+000 -8.493895816559178E+000 -8.388384222195361E+000 +-8.284183107116700E+000 -8.181276223554081E+000 -8.079647517800044E+000 -7.979281139011116E+000 +-7.880161428197857E+000 -7.782272914648133E+000 -7.685600318873758E+000 -7.590128548919757E+000 +-7.495842698362337E+000 -7.402728044281923E+000 -7.310770045201123E+000 -7.219954339049376E+000 +-7.130266741097813E+000 -7.041693241918789E+000 -6.954220005346530E+000 -6.867833366443412E+000 +-6.782519829475073E+000 -6.698266065896354E+000 -6.615058912350452E+000 -6.532885368681790E+000 +-6.451732595964483E+000 -6.371587914547370E+000 -6.292438802116163E+000 -6.214272891774091E+000 +-6.137077970141021E+000 -6.060841975472012E+000 -5.985552995795609E+000 -5.911199267071920E+000 +-5.837769171371101E+000 -5.765251235071945E+000 -5.693634127080952E+000 -5.622906657071764E+000 +-5.553057773744779E+000 -5.484076563107118E+000 -5.415952246772511E+000 -5.348674180281180E+000 +-5.282231851439473E+000 -5.216614878678951E+000 -5.151813009434896E+000 -5.087816118543952E+000 +-5.024614206660758E+000 -4.962197398693361E+000 -4.900555942257230E+000 -4.839680206147747E+000 +-4.779560678831080E+000 -4.720187966953350E+000 -4.661552793835557E+000 -4.603645998151747E+000 +-4.546458532352778E+000 -4.489981461093135E+000 -4.434205960236691E+000 -4.379123315283386E+000 +-4.324724919839739E+000 -4.271002274455124E+000 -4.217946985237782E+000 -4.165550762538802E+000 +-4.113805419653025E+000 -4.062702871536509E+000 -4.012235133540450E+000 -3.962394320161430E+000 +-3.913172643807676E+000 -3.864562413581273E+000 -3.816556034076072E+000 -3.769146004191123E+000 +-3.722324915959468E+000 -3.676085453391948E+000 -3.630420391335976E+000 -3.585322594349039E+000 +-3.540785015586642E+000 -3.496800695704459E+000 -3.453362761774627E+000 -3.410464426215798E+000 +-3.368098985736761E+000 -3.326259820293465E+000 -3.284940392059132E+000 -3.244134244407273E+000 +-3.203835000907359E+000 -3.164036364332936E+000 -3.124732115681998E+000 -3.085916113209257E+000 +-3.047582291470274E+000 -3.009724660377183E+000 -2.972337304265751E+000 -2.935414380973737E+000 +-2.898950120930256E+000 -2.862938826256054E+000 -2.827374869874560E+000 -2.792252694633524E+000 +-2.757566812437220E+000 -2.723311803388990E+000 -2.689482314944101E+000 -2.656073061072815E+000 +-2.623078821433511E+000 -2.590494440555879E+000 -2.558314827033982E+000 -2.526534952729197E+000 +-2.495149851982928E+000 -2.464154620838935E+000 -2.433544416275329E+000 -2.403314455446000E+000 +-2.373460014931491E+000 -2.343976429999216E+000 -2.314859093872842E+000 -2.286103457010875E+000 +-2.257705026394218E+000 -2.229659364822695E+000 -2.201962090220418E+000 -2.174608874949822E+000 +-2.147595445134400E+000 -2.120917579989881E+000 -2.094571111163854E+000 -2.068551922083709E+000 +-2.042855947312708E+000 -2.017479171914232E+000 -1.992417630823918E+000 -1.967667408229740E+000 +-1.943224636959844E+000 -1.919085497878015E+000 -1.895246219286778E+000 -1.871703076337889E+000 +-1.848452390450245E+000 -1.825490528735059E+000 -1.802813903428163E+000 -1.780418971329452E+000 +-1.758302233249252E+000 -1.736460233461611E+000 -1.714889559164406E+000 -1.693586839946112E+000 +-1.672548747259256E+000 -1.651771993900352E+000 -1.631253333496329E+000 -1.610989559997323E+000 +-1.590977507175718E+000 -1.571214048131446E+000 -1.551696094803352E+000 -1.532420597486635E+000 +-1.513384544356245E+000 -1.494584960996125E+000 -1.476018909934304E+000 -1.457683490183649E+000 +-1.439575836788294E+000 -1.421693120375618E+000 -1.404032546713658E+000 -1.386591356273957E+000 +-1.369366823799665E+000 -1.352356257878858E+000 -1.335557000523053E+000 -1.318966427020459E+000 +-1.302581944420165E+000 -1.286400992820359E+000 -1.270421043808944E+000 -1.254639600362399E+000 +-1.239054196452522E+000 -1.223662396657451E+000 -1.208461795776663E+000 -1.193450018449908E+000 +-1.178624719393483E+000 -1.163983580515975E+000 -1.149524314397601E+000 -1.135244661294176E+000 +-1.121142389443103E+000 -1.107215294698165E+000 -1.093461200163570E+000 -1.079877955891535E+000 +-1.066463437839677E+000 -1.053215552162067E+000 -1.040132217590330E+000 -1.027211850796977E+000 +-1.014451620253952E+000 -1.001849900379708E+000 -9.894047210561528E-001 -9.771141382321297E-001 +-9.649762314791170E-001 -9.529891042245537E-001 -9.411508834554730E-001 -9.294597195302924E-001 +-9.179137854626759E-001 -9.065112772914954E-001 -8.952504133516535E-001 -8.841294341102472E-001 +-8.731466018916424E-001 -8.623002006059632E-001 -8.515885354809387E-001 -8.410099327971033E-001 +-8.305627396262671E-001 -8.202453235732438E-001 -8.100560725207732E-001 -7.999933943774529E-001 +-7.900557168293979E-001 -7.802414870943259E-001 -7.705491716789135E-001 -7.609772561391901E-001 +-7.515242448438997E-001 -7.421886607408139E-001 -7.329690451259345E-001 -7.238639574155717E-001 +-7.148719749212562E-001 -7.059916926274302E-001 -6.972217229719252E-001 -6.885606956291402E-001 +-6.800072572959326E-001 -6.715600714801644E-001 -6.632178182914461E-001 -6.549791942366218E-001 +-6.468429120134611E-001 -6.388077003113125E-001 -6.308723036120029E-001 -6.230354819936503E-001 +-6.152960109369360E-001 -6.076526811337597E-001 -6.001042982982882E-001 -5.926496829803486E-001 +-5.852876703811285E-001 -5.780171101711836E-001 -5.708368663106879E-001 -5.637458168719287E-001 +-5.567428538640069E-001 -5.498268830597020E-001 -5.429968238245080E-001 -5.362516089477720E-001 +-5.295901844759453E-001 -5.230115095479038E-001 -5.165145562323030E-001 -5.100983093669719E-001 +-5.037617664002824E-001 -4.975039372345033E-001 -4.913238440710975E-001 -4.852205212579329E-001 +-4.791930151384047E-001 -4.732403839024175E-001 -4.673616974392293E-001 -4.615560371921216E-001 +-4.558224960148674E-001 -4.501601780299943E-001 -4.445681984887966E-001 -4.390456836330927E-001 +-4.335917705587028E-001 -4.282056070806111E-001 -4.228863515998176E-001 -4.176331729718307E-001 +-4.124452503768011E-001 -4.073217731912699E-001 -4.022619408615019E-001 -3.972649627784022E-001 +-3.923300581539789E-001 -3.874564558993426E-001 -3.826433945042280E-001 -3.778901219179976E-001 +-3.731958954321414E-001 -3.685599815642194E-001 -3.639816559432570E-001 -3.594602031965630E-001 +-3.549949168379451E-001 -3.505850991573267E-001 -3.462300611117225E-001 -3.419291222175767E-001 +-3.376816104444386E-001 -3.334868621099500E-001 -3.293442217761512E-001 -3.252530421470610E-001 +-3.212126839675380E-001 -3.172225159233980E-001 -3.132819145427642E-001 -3.093902640986557E-001 +-3.055469565127718E-001 -3.017513912604827E-001 -2.980029752769965E-001 -2.943011228646885E-001 +-2.906452556015889E-001 -2.870348022509996E-001 -2.834691986722382E-001 -2.799478877324925E-001 +-2.764703192197627E-001 -2.730359497568949E-001 -2.696442427166725E-001 -2.662946681379695E-001 +-2.629867026429443E-001 -2.597198293552571E-001 -2.564935378193113E-001 -2.533073239204900E-001 +-2.501606898063886E-001 -2.470531438090256E-001 -2.439842003680159E-001 -2.409533799547039E-001 +-2.379602089972332E-001 -2.350042198065516E-001 -2.320849505033352E-001 -2.292019449458151E-001 +-2.263547526585080E-001 -2.235429287618262E-001 -2.207660339025646E-001 -2.180236341852526E-001 +-2.153153011043542E-001 -2.126406114773162E-001 -2.099991473784422E-001 -2.073904960735922E-001 +-2.048142499556933E-001 -2.022700064810474E-001 -1.997573681064362E-001 -1.972759422270011E-001 +-1.948253411148996E-001 -1.924051818587228E-001 -1.900150863036626E-001 -1.876546809924264E-001 +-1.853235971068816E-001 -1.830214704104282E-001 -1.807479411910869E-001 -1.785026542052909E-001 +-1.762852586223813E-001 -1.740954079697865E-001 -1.719327600788865E-001 -1.697969770315491E-001 +-1.676877251073272E-001 -1.656046747313170E-001 -1.635475004226588E-001 -1.615158807436814E-001 +-1.595094982496771E-001 -1.575280394392986E-001 -1.555711947055760E-001 -1.536386582875383E-001 +-1.517301282224379E-001 -1.498453062985700E-001 -1.479838980086735E-001 -1.461456125039168E-001 +-1.443301625484495E-001 -1.425372644745219E-001 -1.407666381381631E-001 -1.390180068754051E-001 +-1.372910974590560E-001 -1.355856400560057E-001 -1.339013681850651E-001 -1.322380186753281E-001 +-1.305953316250492E-001 -1.289730503610352E-001 -1.273709213985379E-001 -1.257886944016469E-001 +-1.242261221441756E-001 -1.226829604710290E-001 -1.211589682600567E-001 +/ +&nonlocal + els_beta(1) = "2S" + lll(1) = 0 + kbeta(1) = 741 + rcut(1) = 1.050000000000000E+000 + rcutus(1) = 1.050000000000000E+000 + beta(1:1095,1) = +-2.028817480728866E-003 -2.054336863470290E-003 -2.080177240545214E-003 -2.106342649565853E-003 +-2.132837178931358E-003 -2.159664968466627E-003 -2.186830210069168E-003 -2.214337148364096E-003 +-2.242190081367352E-003 -2.270393361157302E-003 -2.298951394554734E-003 -2.327868643811450E-003 +-2.357149627307494E-003 -2.386798920257165E-003 -2.416821155423910E-003 -2.447221023844192E-003 +-2.478003275560480E-003 -2.509172720363463E-003 -2.540734228543574E-003 -2.572692731652009E-003 +-2.605053223271271E-003 -2.637820759795437E-003 -2.671000461220237E-003 -2.704597511943056E-003 +-2.738617161573027E-003 -2.773064725751271E-003 -2.807945586981496E-003 -2.843265195471019E-003 +-2.879029069982379E-003 -2.915242798695658E-003 -2.951912040081643E-003 -2.989042523785979E-003 +-3.026640051524441E-003 -3.064710497989467E-003 -3.103259811768096E-003 -3.142294016271445E-003 +-3.181819210675887E-003 -3.221841570876060E-003 -3.262367350449866E-003 -3.303402881635622E-003 +-3.344954576321466E-003 -3.387028927047250E-003 -3.429632508019012E-003 -3.472771976136204E-003 +-3.516454072031877E-003 -3.560685621125887E-003 -3.605473534691413E-003 -3.650824810934851E-003 +-3.696746536089304E-003 -3.743245885521842E-003 -3.790330124854640E-003 -3.838006611100282E-003 +-3.886282793811303E-003 -3.935166216244200E-003 -3.984664516538107E-003 -4.034785428908252E-003 +-4.085536784854457E-003 -4.136926514384850E-003 -4.188962647254929E-003 -4.241653314222257E-003 +-4.295006748316907E-003 -4.349031286127890E-003 -4.403735369105789E-003 -4.459127544881754E-003 +-4.515216468603103E-003 -4.572010904285704E-003 -4.629519726183393E-003 -4.687751920174596E-003 +-4.746716585166404E-003 -4.806422934516322E-003 -4.866880297471865E-003 -4.928098120628293E-003 +-4.990085969404679E-003 -5.052853529538525E-003 -5.116410608599224E-003 -5.180767137520485E-003 +-5.245933172152101E-003 -5.311918894831213E-003 -5.378734615973324E-003 -5.446390775683360E-003 +-5.514897945386957E-003 -5.584266829482282E-003 -5.654508267012662E-003 -5.725633233360193E-003 +-5.797652841960722E-003 -5.870578346040340E-003 -5.944421140373740E-003 -6.019192763064720E-003 +-6.094904897349035E-003 -6.171569373419976E-003 -6.249198170276866E-003 -6.327803417596834E-003 +-6.407397397630138E-003 -6.487992547119303E-003 -6.569601459242458E-003 -6.652236885581017E-003 +-6.735911738112220E-003 -6.820639091226660E-003 -6.906432183771239E-003 -6.993304421117789E-003 +-7.081269377257732E-003 -7.170340796923071E-003 -7.260532597734082E-003 -7.351858872374007E-003 +-7.444333890791133E-003 -7.537972102428498E-003 -7.632788138481732E-003 -7.728796814185240E-003 +-7.826013131127171E-003 -7.924452279593512E-003 -8.024129640941628E-003 -8.125060790003684E-003 +-8.227261497520351E-003 -8.330747732605013E-003 -8.435535665239108E-003 -8.541641668798708E-003 +-8.649082322613013E-003 -8.757874414554967E-003 -8.868034943664451E-003 -8.979581122804534E-003 +-9.092530381351044E-003 -9.206900367916066E-003 -9.322708953105644E-003 -9.439974232312180E-003 +-9.558714528542000E-003 -9.678948395278412E-003 -9.800694619380853E-003 -9.923972224020470E-003 +-1.004880047165263E-002 -1.017519886702686E-002 -1.030318716023456E-002 -1.043278534979518E-002 +-1.056401368578109E-002 -1.069689267298186E-002 -1.083144307410834E-002 -1.096768591303696E-002 +-1.110564247809488E-002 -1.124533432538658E-002 -1.138678328216209E-002 -1.153001145022779E-002 +-1.167504120939999E-002 -1.182189522100198E-002 -1.197059643140512E-002 -1.212116807561443E-002 +-1.227363368089934E-002 -1.242801707046997E-002 -1.258434236719989E-002 -1.274263399739552E-002 +-1.290291669461302E-002 -1.306521550352319E-002 -1.322955578382503E-002 -1.339596321420846E-002 +-1.356446379636692E-002 -1.373508385906052E-002 -1.390785006223020E-002 -1.408278940116368E-002 +-1.425992921071388E-002 -1.443929716957031E-002 -1.462092130458430E-002 -1.480482999514860E-002 +-1.499105197763198E-002 -1.517961634986983E-002 -1.537055257571107E-002 -1.556389048962235E-002 +-1.575966030135019E-002 -1.595789260064164E-002 -1.615861836202459E-002 -1.636186894964791E-002 +-1.656767612218274E-002 -1.677607203778534E-002 -1.698708925912228E-002 -1.720076075845912E-002 +-1.741711992281281E-002 -1.763620055916910E-002 -1.785803689976567E-002 -1.808266360744130E-002 +-1.831011578105306E-002 -1.854042896096092E-002 -1.877363913458184E-002 -1.900978274201363E-002 +-1.924889668172941E-002 -1.949101831634404E-002 -1.973618547845269E-002 -1.998443647654330E-002 +-2.023581010098313E-002 -2.049034563008071E-002 -2.074808283622420E-002 -2.100906199209678E-002 +-2.127332387697039E-002 -2.154090978307872E-002 -2.181186152207005E-002 -2.208622143154184E-002 +-2.236403238165701E-002 -2.264533778184383E-002 -2.293018158758002E-002 -2.321860830726198E-002 +-2.351066300916109E-002 -2.380639132846672E-002 -2.410583947441852E-002 -2.440905423752830E-002 +-2.471608299689240E-002 -2.502697372759687E-002 -2.534177500821505E-002 -2.566053602839993E-002 +-2.598330659657214E-002 -2.631013714770420E-002 -2.664107875120346E-002 -2.697618311889355E-002 +-2.731550261309678E-002 -2.765909025481810E-002 -2.800699973203179E-002 -2.835928540807314E-002 +-2.871600233013491E-002 -2.907720623787139E-002 -2.944295357211053E-002 -2.981330148367548E-002 +-3.018830784231779E-002 -3.056803124576228E-002 -3.095253102886646E-002 -3.134186727289492E-002 +-3.173610081491029E-002 -3.213529325728297E-002 -3.253950697731998E-002 -3.294880513701542E-002 +-3.336325169292365E-002 -3.378291140615639E-002 -3.420784985250638E-002 -3.463813343269777E-002 +-3.507382938276605E-002 -3.551500578456857E-002 -3.596173157642715E-002 -3.641407656390524E-002 +-3.687211143072010E-002 -3.733590774979292E-002 -3.780553799443805E-002 -3.828107554969256E-002 +-3.876259472378949E-002 -3.925017075977456E-002 -3.974387984726980E-002 -4.024379913438537E-002 +-4.075000673978076E-002 -4.126258176487892E-002 -4.178160430623323E-002 -4.230715546805098E-002 +-4.283931737487418E-002 -4.337817318442032E-002 -4.392380710058483E-002 -4.447630438660732E-002 +-4.503575137840374E-002 -4.560223549806652E-002 -4.617584526753473E-002 -4.675667032243670E-002 +-4.734480142610662E-002 -4.794033048377836E-002 -4.854335055695773E-002 -4.915395587797592E-002 +-4.977224186472661E-002 -5.039830513558845E-002 -5.103224352453597E-002 -5.167415609644078E-002 +-5.232414316256564E-002 -5.298230629625397E-002 -5.364874834881699E-002 -5.432357346562136E-002 +-5.500688710237957E-002 -5.569879604164559E-002 -5.639940840951892E-002 -5.710883369255874E-002 +-5.782718275491189E-002 -5.855456785565671E-002 -5.929110266636529E-002 -6.003690228888801E-002 +-6.079208327336158E-002 -6.155676363644488E-002 -6.233106287978473E-002 -6.311510200871438E-002 +-6.390900355118846E-002 -6.471289157695638E-002 -6.552689171697795E-002 -6.635113118308440E-002 +-6.718573878788668E-002 -6.803084496493624E-002 -6.888658178913928E-002 -6.975308299742940E-002 +-7.063048400970137E-002 -7.151892195000864E-002 -7.241853566802933E-002 -7.332946576080276E-002 +-7.425185459474096E-002 -7.518584632791817E-002 -7.613158693264184E-002 -7.708922421830922E-002 +-7.805890785455229E-002 -7.904078939467564E-002 -8.003502229939079E-002 -8.104176196084992E-002 +-8.206116572698419E-002 -8.309339292614952E-002 -8.413860489208405E-002 -8.519696498918163E-002 +-8.626863863808441E-002 -8.735379334160023E-002 -8.845259871094702E-002 -8.956522649232987E-002 +-9.069185059385480E-002 -9.183264711278250E-002 -9.298779436312811E-002 -9.415747290360968E-002 +-9.534186556595135E-002 -9.654115748354489E-002 -9.775553612047413E-002 -9.898519130090784E-002 +-1.002303152388646E-001 -1.014911025683556E-001 -1.027677503739090E-001 -1.040604582214825E-001 +-1.053694281897671E-001 -1.066948649018881E-001 -1.080369755575096E-001 -1.093959699653452E-001 +-1.107720605760821E-001 -1.121654625157232E-001 -1.135763936193535E-001 -1.150050744653339E-001 +-1.164517284099313E-001 -1.179165816223882E-001 -1.193998631204377E-001 -1.209018048062717E-001 +-1.224226415029651E-001 -1.239626109913644E-001 -1.255219540474463E-001 -1.271009144801509E-001 +-1.286997391696972E-001 -1.303186781063877E-001 -1.319579844299060E-001 -1.336179144691172E-001 +-1.352987277823739E-001 -1.370006871983380E-001 -1.387240588573228E-001 -1.404691122531626E-001 +-1.422361202756182E-001 -1.440253592533226E-001 -1.458371089972762E-001 -1.476716528448984E-001 +-1.495292777046427E-001 -1.514102741011814E-001 -1.533149362211706E-001 -1.552435619595989E-001 +-1.571964529667325E-001 -1.591739146956594E-001 -1.611762564504451E-001 -1.632037914349051E-001 +-1.652568368020032E-001 -1.673357137038848E-001 -1.694407473425517E-001 -1.715722670211899E-001 +-1.737306061961553E-001 -1.759161025296298E-001 -1.781290979429542E-001 -1.803699386706483E-001 +-1.826389753151274E-001 -1.849365629021230E-001 -1.872630609368197E-001 -1.896188334607157E-001 +-1.920042491092182E-001 -1.944196811699826E-001 -1.968655076420062E-001 -1.993421112954861E-001 +-2.018498797324523E-001 -2.043892054481860E-001 -2.069604858934348E-001 -2.095641235374329E-001 +-2.122005259317415E-001 -2.148701057749170E-001 -2.175732809780196E-001 -2.203104747309757E-001 +-2.230821155698013E-001 -2.258886374447028E-001 -2.287304797890656E-001 -2.316080875893416E-001 +-2.345219114558501E-001 -2.374724076945028E-001 -2.404600383794669E-001 -2.434852714267795E-001 +-2.465485806689262E-001 -2.496504459303952E-001 -2.527913531042270E-001 -2.559717942295632E-001 +-2.591922675702193E-001 -2.624532776942890E-001 -2.657553355547955E-001 -2.690989585714083E-001 +-2.724846707132337E-001 -2.759130025827015E-001 -2.793844915005585E-001 -2.828996815919863E-001 +-2.864591238738595E-001 -2.900633763431580E-001 -2.937130040665553E-001 -2.974085792711925E-001 +-3.011506814366616E-001 -3.049398973882104E-001 -3.087768213911884E-001 -3.126620552467531E-001 +-3.165962083888506E-001 -3.205798979824931E-001 -3.246137490233517E-001 -3.286983944386766E-001 +-3.328344751895747E-001 -3.370226403746558E-001 -3.412635473350703E-001 -3.455578617609591E-001 +-3.499062577993325E-001 -3.543094181634051E-001 -3.587680342434013E-001 -3.632828062188553E-001 +-3.678544431724310E-001 -3.724836632052744E-001 -3.771711935539311E-001 -3.819177707088450E-001 +-3.867241405344626E-001 -3.915910583909683E-001 -3.965192892576697E-001 -4.015096078580608E-001 +-4.065627987865872E-001 -4.116796566371330E-001 -4.168609861332624E-001 -4.221076022602311E-001 +-4.274203303988018E-001 -4.328000064608846E-001 -4.382474770270289E-001 -4.437635994857964E-001 +-4.493492421750331E-001 -4.550052845250802E-001 -4.607326172039389E-001 -4.665321422644219E-001 +-4.724047732933221E-001 -4.783514355626163E-001 -4.843730661827447E-001 -4.904706142579840E-001 +-4.966450410439469E-001 -5.028973201072384E-001 -5.092284374872905E-001 -5.156393918604119E-001 +-5.221311947060761E-001 -5.287048704754802E-001 -5.353614567623987E-001 -5.421020044763651E-001 +-5.489275780182090E-001 -5.558392554579733E-001 -5.628381287152459E-001 -5.699253037419316E-001 +-5.771019007074855E-001 -5.843690541866460E-001 -5.917279133496873E-001 -5.991796421552178E-001 +-6.067254195455539E-001 -6.143664396446890E-001 -6.221039119588860E-001 -6.299390615799171E-001 +-6.378731293909664E-001 -6.459073722752278E-001 -6.540430633272033E-001 -6.622814920667364E-001 +-6.706239646557830E-001 -6.790718041179455E-001 -6.876263505607771E-001 -6.962889614008683E-001 +-7.050610115917270E-001 -7.139438938544570E-001 -7.229390189112367E-001 -7.320478157216037E-001 +-7.412717317215328E-001 -7.506122330653134E-001 -7.600708048702065E-001 -7.696489514638691E-001 +-7.793481966345362E-001 -7.891700838839144E-001 -7.991161766827856E-001 -8.091880587292627E-001 +-8.193873342096691E-001 -8.297156280619929E-001 -8.401745862418466E-001 -8.507658759908927E-001 +-8.614911861076410E-001 -8.723522272205507E-001 -8.833507320633417E-001 -8.944884557524108E-001 +-9.057671760662455E-001 -9.171886937267100E-001 -9.287548326820588E-001 -9.404674403915364E-001 +-9.523283881113831E-001 -9.643395711820728E-001 -9.765029093165835E-001 -9.888203468894696E-001 +-1.001293853226508E+000 -1.013925422894649E+000 -1.026717075991993E+000 -1.039670858437484E+000 +-1.052788842259979E+000 -1.066073125886349E+000 -1.079525834428184E+000 -1.093149119966715E+000 +-1.106945161835474E+000 -1.120916166900193E+000 -1.135064369835422E+000 -1.149392033397267E+000 +-1.163901448691655E+000 -1.178594935437428E+000 -1.193474842223565E+000 -1.208543546759753E+000 +-1.223803456119464E+000 -1.239257006974664E+000 -1.254906665821174E+000 -1.270754929193668E+000 +-1.286804323869197E+000 -1.303057407058045E+000 -1.319516766580669E+000 -1.336185021029349E+000 +-1.353064819913086E+000 -1.370158843784216E+000 -1.387469804345035E+000 -1.405000444532687E+000 +-1.422753538580389E+000 -1.440731892052960E+000 -1.458938341854480E+000 -1.477375756205747E+000 +-1.496047034589050E+000 -1.514955107657624E+000 -1.534102937106927E+000 -1.553493515504754E+000 +-1.573129866076947E+000 -1.593015042445283E+000 -1.613152128313870E+000 -1.633544237100173E+000 +-1.654194511506503E+000 -1.675106123027535E+000 -1.696282271389190E+000 -1.717726183913813E+000 +-1.739441114806355E+000 -1.761430344355871E+000 -1.783697178046282E+000 -1.806244945570003E+000 +-1.829076999737613E+000 -1.852196715276283E+000 -1.875607487509307E+000 -1.899312730908489E+000 +-1.923315877510741E+000 -1.947620375189636E+000 -1.972229685772121E+000 -1.997147282989995E+000 +-2.022376650255116E+000 -2.047921278246644E+000 -2.073784662297916E+000 -2.099970299569804E+000 +-2.126481685996620E+000 -2.153322312989809E+000 -2.180495663883817E+000 -2.208005210107558E+000 +-2.235854407064004E+000 -2.264046689699338E+000 -2.292585467742087E+000 -2.321474120591525E+000 +-2.350715991833440E+000 -2.380314383360134E+000 -2.410272549070232E+000 -2.440593688122476E+000 +-2.471280937716347E+000 -2.502337365370739E+000 -2.533765960670462E+000 -2.565569626448665E+000 +-2.597751169371538E+000 -2.630313289889977E+000 -2.663258571520923E+000 -2.696589469419258E+000 +-2.730308298199076E+000 -2.764417218961069E+000 -2.798918225480672E+000 -2.833813129509299E+000 +-2.869103545138713E+000 -2.904790872176232E+000 -2.940876278475934E+000 -2.977360681168561E+000 +-3.014244726730218E+000 -3.051528769827246E+000 -3.089212850872030E+000 -3.127296672221627E+000 +-3.165779572948441E+000 -3.204660502109164E+000 -3.243937990435502E+000 -3.283610120367262E+000 +-3.323674494345509E+000 -3.364128201280778E+000 -3.404967781108426E+000 -3.446189187340603E+000 +-3.487787747521684E+000 -3.529758121491481E+000 -3.572094257358363E+000 -3.614789345082161E+000 +-3.657835767565024E+000 -3.701225049146692E+000 -3.744947801399513E+000 -3.788993666117757E+000 +-3.833351255395430E+000 -3.878008088686955E+000 -3.922950526746200E+000 -3.968163702340630E+000 +-4.013631447640185E+000 -4.059336218183590E+000 -4.105259013329529E+000 -4.151379293105737E+000 +-4.197674891376169E+000 -4.244121925255153E+000 -4.290694700707675E+000 -4.337365614287368E+000 +-4.384105050978182E+000 -4.430881278122568E+000 -4.477660335438553E+000 -4.524405921150438E+000 +-4.571079274283605E+000 -4.617639053203084E+000 -4.664041210508705E+000 -4.710238864437144E+000 +-4.756182166963260E+000 -4.801818168840506E+000 -4.847090681872980E+000 -4.891940138770752E+000 +-4.936303451005698E+000 -4.980113865157736E+000 -5.023300818321835E+000 -5.065789793234936E+000 +-5.107502173879481E+000 -5.148355102427454E+000 -5.188261338506033E+000 -5.227129121894043E+000 +-5.264862039897698E+000 -5.301358900805475E+000 -5.336513614985766E+000 -5.370215085367773E+000 +-5.402347109236228E+000 -5.432788293474650E+000 -5.461411985609499E+000 -5.488086223239763E+000 +-5.512673704681952E+000 -5.535031783919887E+000 -5.555012493220594E+000 -5.572462597061281E+000 +-5.587223681306849E+000 -5.599132281879747E+000 -5.608020057473048E+000 -5.613714011169411E+000 +-5.616036766139668E+000 -5.614806900900751E+000 -5.609839349907543E+000 -5.600945875530880E+000 +-5.587935617726307E+000 -5.570615727916385E+000 -5.548792093782930E+000 -5.522270161782376E+000 +-5.490855864244049E+000 -5.454356657871933E+000 -5.412582680328250E+000 -5.365348031312682E+000 +-5.312472184143146E+000 -5.253781533269546E+000 -5.189111082385808E+000 -5.118306276821486E+000 +-5.041224982662988E+000 -4.957739613548365E+000 -4.867739404266456E+000 -4.771132828142540E+000 +-4.667850152678289E+000 -4.557846125005155E+000 -4.441102775384212E+000 -4.317632323218912E+000 +-4.187480165826401E+000 -4.050727925531830E+000 -3.907496525508104E+000 -3.757949259200408E+000 +-3.602294812176500E+000 -3.440790188880791E+000 -3.273743490111749E+000 -3.101516480177266E+000 +-2.924526875736115E+000 -2.743250281448280E+000 -2.558221690917394E+000 -2.370036465227355E+000 +-2.179350695899008E+000 -1.986880854608056E+000 -1.793402628823925E+000 -1.599748840998966E+000 +-1.406806349429889E+000 -1.215511831814062E+000 -1.026846358235834E+000 -8.418286692340908E-001 +-6.615070871057700E-001 -4.869500050415136E-001 -3.192349193700731E-001 -1.594359953524181E-001 +-8.610186768778678E-003 1.322180359484435E-001 2.620732551059956E-001 3.800468350433308E-001 + 4.853156257506865E-001 5.771614033658083E-001 6.549907547354812E-001 7.183550547961625E-001 + 7.669701244374719E-001 8.007350930489672E-001 8.197499241998965E-001 8.243309946289926E-001 + 8.150240452511116E-001 7.926137469786079E-001 7.581290418714822E-001 7.128433287356473E-001 + 6.582684581731046E-001 5.961413807492246E-001 5.284021480532008E-001 4.571617939999210E-001 + 3.846584164504213E-001 3.131995309440306E-001 2.450884737487775E-001 1.825322869711200E-001 + 1.275281233536325E-001 8.172476574990027E-002 4.625537401331255E-002 2.153706317589453E-002 + 7.032398260282550E-003 9.673799199547972E-004 4.204707118187760E-016 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + + dion(1:1) = + 1.950924612895554E+000 +/ + +&pswfc + els(1) = "2S" + lchi(1) = 0 + oc(1) = 2.000000000000000E+000 + nchi(1) = 1 + epseu(1) = -1.761170243983008E+000 + rcut_chi(1) = 1.050000000000000E+000 + rcutus_chi(1) = 1.050000000000000E+000 + chi(1:1095,1) = +-1.343341767730406E-004 -1.360238927306804E-004 -1.377348626995604E-004 -1.394673540222670E-004 +-1.412216374041445E-004 -1.429979869555922E-004 -1.447966802348953E-004 -1.466179982915941E-004 +-1.484622257103983E-004 -1.503296506556544E-004 -1.522205649163720E-004 -1.541352639518165E-004 +-1.560740469376748E-004 -1.580372168128028E-004 -1.600250803265604E-004 -1.620379480867414E-004 +-1.640761346081067E-004 -1.661399583615282E-004 -1.682297418237505E-004 -1.703458115277794E-004 +-1.724884981139020E-004 -1.746581363813510E-004 -1.768550653406180E-004 -1.790796282664244E-004 +-1.813321727513591E-004 -1.836130507601902E-004 -1.859226186848610E-004 -1.882612374001767E-004 +-1.906292723201926E-004 -1.930270934553101E-004 -1.954550754700921E-004 -1.979135977418060E-004 +-2.004030444197011E-004 -2.029238044850334E-004 -2.054762718118457E-004 -2.080608452285103E-004 +-2.106779285800479E-004 -2.133279307912287E-004 -2.160112659304679E-004 -2.187283532745262E-004 +-2.214796173740216E-004 -2.242654881197669E-004 -2.270864008099415E-004 -2.299427962181081E-004 +-2.328351206620845E-004 -2.357638260736817E-004 -2.387293700693197E-004 -2.417322160215316E-004 +-2.447728331313668E-004 -2.478516965017048E-004 -2.509692872114915E-004 -2.541260923909085E-004 +-2.573226052974898E-004 -2.605593253931940E-004 -2.638367584224469E-004 -2.671554164911648E-004 +-2.705158181467736E-004 -2.739184884592330E-004 -2.773639591030801E-004 -2.808527684405059E-004 +-2.843854616054749E-004 -2.879625905889052E-004 -2.915847143249170E-004 -2.952523987781696E-004 +-2.989662170322948E-004 -3.027267493794418E-004 -3.065345834109507E-004 -3.103903141091666E-004 +-3.142945439404053E-004 -3.182478829490929E-004 -3.222509488530862E-004 -3.263043671401920E-004 +-3.304087711659042E-004 -3.345648022523659E-004 -3.387731097885795E-004 -3.430343513318740E-004 +-3.473491927106527E-004 -3.517183081284310E-004 -3.561423802691822E-004 -3.606221004040108E-004 +-3.651581684991650E-004 -3.697512933254091E-004 -3.744021925687718E-004 -3.791115929426877E-004 +-3.838802303015495E-004 -3.887088497556878E-004 -3.935982057877966E-004 -3.985490623708253E-004 +-4.035621930873524E-004 -4.086383812504613E-004 -4.137784200261359E-004 -4.189831125571954E-004 +-4.242532720887905E-004 -4.295897220954751E-004 -4.349932964098789E-004 -4.404648393529963E-004 +-4.460052058661168E-004 -4.516152616444117E-004 -4.572958832722055E-004 -4.630479583599446E-004 +-4.688723856828906E-004 -4.747700753215599E-004 -4.807419488039268E-004 -4.867889392494163E-004 +-4.929119915147121E-004 -4.991120623413904E-004 -5.053901205054202E-004 -5.117471469685375E-004 +-5.181841350315272E-004 -5.247020904894296E-004 -5.313020317887044E-004 -5.379849901863664E-004 +-5.447520099111274E-004 -5.516041483265604E-004 -5.585424760963227E-004 -5.655680773514508E-004 +-5.726820498597631E-004 -5.798855051973932E-004 -5.871795689224807E-004 -5.945653807510482E-004 +-6.020440947350877E-004 -6.096168794428906E-004 -6.172849181416424E-004 -6.250494089823190E-004 +-6.329115651869045E-004 -6.408726152379667E-004 -6.489338030706159E-004 -6.570963882668802E-004 +-6.653616462525227E-004 -6.737308684963407E-004 -6.822053627119629E-004 -6.907864530621949E-004 +-6.994754803659280E-004 -7.082738023076526E-004 -7.171827936496104E-004 -7.262038464466119E-004 +-7.353383702635575E-004 -7.445877923956939E-004 -7.539535580916425E-004 -7.634371307792349E-004 +-7.730399922941846E-004 -7.827636431116409E-004 -7.926096025806524E-004 -8.025794091615805E-004 +-8.126746206664987E-004 -8.228968145026194E-004 -8.332475879187805E-004 -8.437285582550326E-004 +-8.543413631953652E-004 -8.650876610236155E-004 -8.759691308825965E-004 -8.869874730364788E-004 +-8.981444091364812E-004 -9.094416824898990E-004 -9.208810583325206E-004 -9.324643241044626E-004 +-9.441932897294870E-004 -9.560697878978243E-004 -9.680956743525547E-004 -9.802728281795997E-004 +-9.926031521013518E-004 -1.005088572774004E-003 -1.017731041088620E-003 -1.030532532475993E-003 +-1.043495047215334E-003 -1.056620610746852E-003 -1.069911273988257E-003 -1.083369113655256E-003 +-1.096996232586075E-003 -1.110794760070063E-003 -1.124766852180429E-003 -1.138914692111177E-003 +-1.153240490518262E-003 -1.167746485865051E-003 -1.182434944772134E-003 -1.197308162371514E-003 +-1.212368462665285E-003 -1.227618198888798E-003 -1.243059753878403E-003 -1.258695540443829E-003 +-1.274528001745228E-003 -1.290559611674986E-003 -1.306792875244323E-003 -1.323230328974759E-003 +-1.339874541294514E-003 -1.356728112939885E-003 -1.373793677361685E-003 -1.391073901136781E-003 +-1.408571484384823E-003 -1.426289161190218E-003 -1.444229700029399E-003 -1.462395904203493E-003 +-1.480790612276406E-003 -1.499416698518442E-003 -1.518277073355504E-003 -1.537374683823924E-003 +-1.556712514031054E-003 -1.576293585621622E-003 -1.596120958249969E-003 -1.616197730058228E-003 +-1.636527038160515E-003 -1.657112059133234E-003 -1.677956009511522E-003 -1.699062146291962E-003 +-1.720433767441618E-003 -1.742074212413470E-003 -1.763986862668355E-003 -1.786175142203455E-003 +-1.808642518087442E-003 -1.831392501002374E-003 -1.854428645792386E-003 -1.877754552019314E-003 +-1.901373864525288E-003 -1.925290274002420E-003 -1.949507517569666E-003 -1.974029379356932E-003 +-1.998859691096556E-003 -2.024002332722214E-003 -2.049461232975374E-003 -2.075240370019397E-003 +-2.101343772061337E-003 -2.127775517981606E-003 -2.154539737971532E-003 -2.181640614178973E-003 +-2.209082381362031E-003 -2.236869327551022E-003 -2.265005794718760E-003 -2.293496179459297E-003 +-2.322344933675189E-003 -2.351556565273446E-003 -2.381135638870200E-003 -2.411086776504296E-003 +-2.441414658359830E-003 -2.472124023497803E-003 -2.503219670596995E-003 -2.534706458704136E-003 +-2.566589307993574E-003 -2.598873200536467E-003 -2.631563181079685E-003 -2.664664357834527E-003 +-2.698181903275332E-003 -2.732121054948208E-003 -2.766487116289909E-003 -2.801285457457023E-003 +-2.836521516165635E-003 -2.872200798541536E-003 -2.908328879981168E-003 -2.944911406023396E-003 +-2.981954093232276E-003 -3.019462730090940E-003 -3.057443177906737E-003 -3.095901371727809E-003 +-3.134843321271165E-003 -3.174275111862500E-003 -3.214202905387825E-003 -3.254632941257112E-003 +-3.295571537380069E-003 -3.337025091154213E-003 -3.379000080465413E-003 -3.421503064701029E-003 +-3.464540685775821E-003 -3.508119669170813E-003 -3.552246824985231E-003 -3.596929049001704E-003 +-3.642173323764926E-003 -3.687986719673875E-003 -3.734376396087840E-003 -3.781349602446374E-003 +-3.828913679403396E-003 -3.877076059975570E-003 -3.925844270705183E-003 -3.975225932837700E-003 +-4.025228763514156E-003 -4.075860576978589E-003 -4.127129285800751E-003 -4.179042902114188E-003 +-4.231609538869981E-003 -4.284837411106308E-003 -4.338734837234003E-003 -4.393310240338375E-003 +-4.448572149497441E-003 -4.504529201116807E-003 -4.561190140281396E-003 -4.618563822124258E-003 +-4.676659213212666E-003 -4.735485392951686E-003 -4.795051555005526E-003 -4.855367008736793E-003 +-4.916441180663959E-003 -4.978283615937253E-003 -5.040903979833147E-003 -5.104312059267808E-003 +-5.168517764329612E-003 -5.233531129831068E-003 -5.299362316880353E-003 -5.366021614472704E-003 +-5.433519441101973E-003 -5.501866346392495E-003 -5.571073012751663E-003 -5.641150257043403E-003 +-5.712109032282768E-003 -5.783960429352039E-003 -5.856715678738515E-003 -5.930386152294316E-003 +-6.004983365018441E-003 -6.080518976861412E-003 -6.157004794552775E-003 -6.234452773451745E-003 +-6.312875019421284E-003 -6.392283790725939E-003 -6.472691499953744E-003 -6.554110715962464E-003 +-6.636554165850525E-003 -6.720034736952927E-003 -6.804565478862497E-003 -6.890159605476737E-003 +-6.976830497070714E-003 -7.064591702396193E-003 -7.153456940807449E-003 -7.243440104414092E-003 +-7.334555260261187E-003 -7.426816652537094E-003 -7.520238704809360E-003 -7.614836022289048E-003 +-7.710623394123832E-003 -7.807615795720261E-003 -7.905828391095542E-003 -8.005276535259280E-003 +-8.105975776625526E-003 -8.207941859455498E-003 -8.311190726331462E-003 -8.415738520662098E-003 +-8.521601589219789E-003 -8.628796484710264E-003 -8.737339968375028E-003 -8.847249012626927E-003 +-8.958540803719413E-003 -9.071232744449856E-003 -9.185342456897359E-003 -9.300887785195553E-003 +-9.417886798340856E-003 -9.536357793036595E-003 -9.656319296573542E-003 -9.777790069747268E-003 +-9.900789109812848E-003 -1.002533565347744E-002 -1.015144917993115E-002 -1.027914941391679E-002 +-1.040845632883900E-002 -1.053939014991316E-002 -1.067197135735493E-002 -1.080622068961051E-002 +-1.094215914662857E-002 -1.107980799317419E-002 -1.121918876218542E-002 -1.136032325817307E-002 +-1.150323356066418E-002 -1.164794202769003E-002 -1.179447129931897E-002 -1.194284430123489E-002 +-1.209308424836185E-002 -1.224521464853557E-002 -1.239925930622233E-002 -1.255524232628598E-002 +-1.271318811780371E-002 -1.287312139793126E-002 -1.303506719581814E-002 -1.319905085657380E-002 +-1.336509804528508E-002 -1.353323475108599E-002 -1.370348729128034E-002 -1.387588231551800E-002 +-1.405044681002559E-002 -1.422720810189228E-002 -1.440619386341146E-002 -1.458743211647914E-002 +-1.477095123704982E-002 -1.495677995965057E-002 -1.514494738195434E-002 -1.533548296941305E-002 +-1.552841655995161E-002 -1.572377836872344E-002 -1.592159899292858E-002 -1.612190941669514E-002 +-1.632474101602514E-002 -1.653012556380550E-002 -1.673809523488526E-002 -1.694868261121976E-002 +-1.716192068708311E-002 -1.737784287434954E-002 -1.759648300784496E-002 -1.781787535076952E-002 +-1.804205460019229E-002 -1.826905589261918E-002 -1.849891480963509E-002 -1.873166738362137E-002 +-1.896735010354992E-002 -1.920599992085465E-002 -1.944765425538185E-002 -1.969235100142053E-002 +-1.994012853381383E-002 -2.019102571415276E-002 -2.044508189705365E-002 -2.070233693652043E-002 +-2.096283119239310E-002 -2.122660553688366E-002 -2.149370136120097E-002 -2.176416058226563E-002 +-2.203802564951668E-002 -2.231533955181119E-002 -2.259614582441841E-002 -2.288048855610988E-002 +-2.316841239634700E-002 -2.345996256256758E-002 -2.375518484757309E-002 -2.405412562701807E-002 +-2.435683186700338E-002 -2.466335113177499E-002 -2.497373159152998E-002 -2.528802203033156E-002 +-2.560627185413480E-002 -2.592853109892501E-002 -2.625485043897054E-002 -2.658528119519186E-002 +-2.691987534364911E-002 -2.725868552414967E-002 -2.760176504897838E-002 -2.794916791175176E-002 +-2.830094879639898E-002 -2.865716308627151E-002 -2.901786687338350E-002 -2.938311696778557E-002 +-2.975297090707382E-002 -3.012748696603689E-002 -3.050672416644325E-002 -3.089074228697126E-002 +-3.127960187328468E-002 -3.167336424825604E-002 -3.207209152234049E-002 -3.247584660410328E-002 +-3.288469321090326E-002 -3.329869587973543E-002 -3.371791997823541E-002 -3.414243171584895E-002 +-3.457229815516954E-002 -3.500758722344730E-002 -3.544836772427231E-002 -3.589470934943583E-002 +-3.634668269097267E-002 -3.680435925338850E-002 -3.726781146607547E-002 -3.773711269591973E-002 +-3.821233726010490E-002 -3.869356043911537E-002 -3.918085848994318E-002 -3.967430865950272E-002 +-4.017398919825761E-002 -4.067997937406376E-002 -4.119235948623329E-002 -4.171121087982390E-002 +-4.223661596015815E-002 -4.276865820757778E-002 -4.330742219243747E-002 -4.385299359034405E-002 +-4.440545919764555E-002 -4.496490694717564E-002 -4.553142592425941E-002 -4.610510638298582E-002 +-4.668603976275272E-002 -4.727431870509049E-002 -4.787003707077069E-002 -4.847328995720573E-002 +-4.908417371614644E-002 -4.970278597168408E-002 -5.032922563856437E-002 -5.096359294081933E-002 +-5.160598943072616E-002 -5.225651800809897E-002 -5.291528293992279E-002 -5.358238988033640E-002 +-5.425794589097373E-002 -5.494205946167159E-002 -5.563484053155247E-002 -5.633640051049189E-002 +-5.704685230097965E-002 -5.776631032038453E-002 -5.849489052363259E-002 -5.923271042630884E-002 +-5.997988912819360E-002 -6.073654733724437E-002 -6.150280739403369E-002 -6.227879329665596E-002 +-6.306463072611396E-002 -6.386044707219839E-002 -6.466637145987264E-002 -6.548253477617653E-002 +-6.630906969766226E-002 -6.714611071837623E-002 -6.799379417840262E-002 -6.885225829298224E-002 +-6.972164318222282E-002 -7.060209090141677E-002 -7.149374547198259E-002 -7.239675291304726E-002 +-7.331126127368713E-002 -7.423742066584500E-002 -7.517538329794322E-002 -7.612530350921083E-002 +-7.708733780474604E-002 -7.806164489133356E-002 -7.904838571403887E-002 -8.004772349360183E-002 +-8.105982376465068E-002 -8.208485441476203E-002 -8.312298572438974E-002 -8.417439040768850E-002 +-8.523924365425763E-002 -8.631772317183181E-002 -8.741000922994682E-002 -8.851628470460833E-002 +-8.963673512399388E-002 -9.077154871521746E-002 -9.192091645218914E-002 -9.308503210460163E-002 +-9.426409228807775E-002 -9.545829651551274E-002 -9.666784724964805E-002 -9.789294995691214E-002 +-9.913381316256800E-002 -1.003906485072054E-001 -1.016636708046188E-001 -1.029530981011128E-001 +-1.042591517362778E-001 -1.055820564052813E-001 -1.069220402227198E-001 -1.082793347880785E-001 +-1.096541752528483E-001 -1.110468003893493E-001 -1.124574526613131E-001 -1.138863782962769E-001 +-1.153338273598445E-001 -1.168000538318700E-001 -1.182853156846220E-001 -1.197898749629893E-001 +-1.213139978667872E-001 -1.228579548352295E-001 -1.244220206336290E-001 -1.260064744423935E-001 +-1.276115999483860E-001 -1.292376854387174E-001 -1.308850238970439E-001 -1.325539131024416E-001 +-1.342446557309335E-001 -1.359575594597437E-001 -1.376929370743595E-001 -1.394511065784771E-001 +-1.412323913069146E-001 -1.430371200415725E-001 -1.448656271305261E-001 -1.467182526103343E-001 +-1.485953423316499E-001 -1.504972480882186E-001 -1.524243277493532E-001 -1.543769453959716E-001 +-1.563554714602859E-001 -1.583602828692315E-001 -1.603917631917235E-001 -1.624503027898280E-001 +-1.645362989739358E-001 -1.666501561620226E-001 -1.687922860430782E-001 -1.709631077447902E-001 +-1.731630480055541E-001 -1.753925413508926E-001 -1.776520302743476E-001 -1.799419654229164E-001 +-1.822628057870914E-001 -1.846150188955544E-001 -1.869990810145756E-001 -1.894154773521514E-001 +-1.918647022669111E-001 -1.943472594818079E-001 -1.968636623025951E-001 -1.994144338410785E-001 +-2.020001072431170E-001 -2.046212259213242E-001 -2.072783437924062E-001 -2.099720255190439E-001 +-2.127028467562058E-001 -2.154713944017491E-001 -2.182782668511313E-001 -2.211240742560274E-001 +-2.240094387865988E-001 -2.269349948971280E-001 -2.299013895946779E-001 -2.329092827103884E-001 +-2.359593471729623E-001 -2.390522692838330E-001 -2.421887489934342E-001 -2.453695001779210E-001 +-2.485952509156050E-001 -2.518667437622771E-001 -2.551847360244934E-001 -2.585500000297910E-001 +-2.619633233926832E-001 -2.654255092751541E-001 -2.689373766402322E-001 -2.724997604970685E-001 +-2.761135121357864E-001 -2.797794993501758E-001 -2.834986066461208E-001 -2.872717354334319E-001 +-2.910998041985192E-001 -2.949837486551022E-001 -2.989245218698726E-001 -3.029230943597349E-001 +-3.069804541569373E-001 -3.110976068380590E-001 -3.152755755124536E-001 -3.195154007653510E-001 +-3.238181405503909E-001 -3.281848700259100E-001 -3.326166813287906E-001 -3.371146832791777E-001 +-3.416800010087784E-001 -3.463137755048688E-001 -3.510171630614762E-001 -3.557913346285091E-001 +-3.606374750488890E-001 -3.655567821729291E-001 -3.705504658383966E-001 -3.756197467037999E-001 +-3.807658549215216E-001 -3.859900286364248E-001 -3.912935122945462E-001 -3.966775547453858E-001 +-4.021434071201876E-001 -4.076923204674194E-001 -4.133255431254338E-001 -4.190443178110296E-001 +-4.248498784013307E-001 -4.307434463850680E-001 -4.367262269579837E-001 -4.427994047357393E-001 +-4.489641390563032E-001 -4.552215588424716E-001 -4.615727569938498E-001 -4.680187842763319E-001 +-4.745606426759467E-001 -4.811992781828329E-001 -4.879355729701533E-001 -4.947703369319728E-001 +-5.017042985435504E-001 -5.087380950072008E-001 -5.158722616468592E-001 -5.231072205148974E-001 +-5.304432681755521E-001 -5.378805626306629E-001 -5.454191093553998E-001 -5.530587464142778E-001 +-5.607991286312247E-001 -5.686397107918219E-001 -5.765797298611999E-001 -5.846181862076426E-001 +-5.927538238297301E-001 -6.009851095941415E-001 -6.093102115020456E-001 -6.177269760145572E-001 +-6.262329044821788E-001 -6.348251287395797E-001 -6.435003859457005E-001 -6.522549927700850E-001 +-6.610848190496581E-001 -6.699852610660313E-001 -6.789512146217691E-001 -6.879770481250581E-001 +-6.970565759257246E-001 -7.061830321814734E-001 -7.153490455714928E-001 -7.245466152147064E-001 +-7.337670881918321E-001 -7.430011391133066E-001 -7.522387522184913E-001 -7.614692065346628E-001 +-7.706810646659225E-001 -7.798621658213950E-001 -7.889996237273751E-001 -7.980798300978947E-001 +-8.070884643607642E-001 -8.160105103493632E-001 -8.248302806722073E-001 -8.335314494601376E-001 +-8.420970941622983E-001 -8.505097470143839E-001 -8.587514567329982E-001 -8.668038608960573E-001 +-8.746482693482243E-001 -8.822657588202533E-001 -8.896372787700573E-001 -8.967437682397958E-001 +-9.035662832769381E-001 -9.100861341881950E-001 -9.162850315848636E-001 -9.221452398391382E-001 +-9.276497362072043E-001 -9.327823734922971E-001 -9.375280437265628E-001 -9.418728399538999E-001 +-9.458042128082130E-001 -9.493111182159253E-001 -9.523841522236746E-001 -9.550156686795271E-001 +-9.571998752985827E-001 -9.589329035441962E-001 -9.602128477790933E-001 -9.610397693151301E-001 +-9.614156613486091E-001 -9.613443713473649E-001 -9.608314783005553E-001 -9.598841234046865E-001 +-9.585107943040048E-001 -9.567210650083779E-001 -9.545252961738170E-001 -9.519343036693255E-001 +-9.489590074148099E-001 -9.456100775360472E-001 -9.418976011563676E-001 -9.378308008798133E-001 +-9.334178455035781E-001 -9.286658050494701E-001 -9.235808161782386E-001 -9.181685240272081E-001 +-9.124346672815121E-001 -9.063852569373805E-001 -9.000265812905375E-001 -8.933651972288702E-001 +-8.864079211543512E-001 -8.791618195540069E-001 -8.716341992401537E-001 -8.638325972804719E-001 +-8.557647706387311E-001 -8.474386855471916E-001 -8.388625066317926E-001 -8.300445858112979E-001 +-8.209934509915079E-001 -8.117177945755601E-001 -8.022264618111686E-001 -7.925284389953879E-001 +-7.826328415572246E-001 -7.725489020380335E-001 -7.622859579892582E-001 -7.518534398066152E-001 +-7.412608585193257E-001 -7.305177935523908E-001 -7.196338804795396E-001 -7.086187987839754E-001 +-6.974822596432481E-001 -6.862339937531152E-001 -6.748837392071335E-001 -6.634412294464763E-001 +-6.519161812921658E-001 -6.403182830748725E-001 -6.286571828758163E-001 -6.169424768906004E-001 +-6.051836979285409E-001 -5.933903040596173E-001 -5.815716674209338E-001 -5.697370631944647E-001 +-5.578956587678775E-001 -5.460565030902808E-001 -5.342285162349870E-001 -5.224204791816369E-001 +-5.106410238304739E-001 -4.988986232620392E-001 -4.872015822561386E-001 -4.755580280846278E-001 +-4.639759015932273E-001 -4.524629485883729E-001 -4.410267115458403E-001 -4.296745216586190E-001 +-4.184134912422039E-001 -4.072505065160498E-001 -3.961922207804165E-001 -3.852450480081402E-001 +-3.744151568709697E-001 -3.637084652200142E-001 -3.531306350394680E-001 -3.426870678921376E-001 +-3.323829008743592E-001 -3.222230030966390E-001 -3.122119727048064E-001 -3.023541344545974E-001 +-2.926535378504534E-001 -2.831139558569095E-001 -2.737388841882912E-001 -2.645315411796233E-001 +-2.554948682386357E-001 -2.466315308756733E-001 -2.379439203051605E-001 -2.294341556091086E-001 +-2.211040864500630E-001 -2.129552963178687E-001 -2.049891062917855E-001 -1.972065792968104E-001 +-1.896085248306009E-001 -1.821955041352593E-001 -1.749678357863328E-001 -1.679256016697070E-001 +-1.610686533158945E-001 -1.543966185602531E-001 -1.479089084970032E-001 -1.416047246946264E-001 +-1.354830666402364E-001 -1.295427393808110E-001 -1.237823613297505E-001 -1.182003722080803E-001 +-1.127950410906814E-001 -1.075644745292310E-001 -1.025066247250119E-001 -9.761929772637561E-002 +-9.290016162741550E-002 -8.834675474625679E-002 -8.395649376330105E-002 -7.972668180172075E-002 +-7.565451643445957E-002 -7.173709760392825E-002 -6.797143544245289E-002 -6.435445798330858E-002 +-6.088301875382573E-002 -5.755390424355815E-002 -5.436384124183465E-002 -5.130950404015087E-002 +-4.838752149578891E-002 -4.559448395376196E-002 -4.292695002467038E-002 -4.038145321632737E-002 +-3.795450841707079E-002 -3.564261822854464E-002 -3.344227914542700E-002 -3.134998757912572E-002 +-2.936224572189615E-002 -2.747556724718178E-002 -2.568648284128348E-002 -2.399154556075709E-002 +-2.238733600925974E-002 -2.087046732694841E-002 -1.943758998500702E-002 -1.808539637747108E-002 +-1.681062520225208E-002 -1.561006562315273E-002 -1.448056120472325E-002 -1.341901361203996E-002 +-1.242238606789364E-002 -1.148770656044913E-002 -1.061207079517089E-002 -9.792644885689291E-003 +-9.026667779289439E-003 -8.311453413823064E-003 -7.644392604050288E-003 -7.022954656691624E-003 +-6.444688714788650E-003 -5.907224833311778E-003 -5.408274789294695E-003 -4.945632631096857E-003 +-4.517174972678681E-003 -4.120861040002922E-003 -3.754732477833842E-003 -3.416912926281437E-003 +-3.105607377419731E-003 -2.819101323187450E-003 -2.555759706550025E-003 -2.314025688558795E-003 +-2.092419244484218E-003 -1.889535602623816E-003 -1.704043539692937E-003 -1.534683546899826E-003 +-1.380265880888705E-003 -1.239668513710815E-003 -1.111834995858471E-003 -9.957722461778529E-004 +-8.905482821692504E-004 -7.952899037961990E-004 -7.091803434652691E-004 -6.314568943142122E-004 +-5.614085283659309E-004 -4.983735154775734E-004 -4.417370533461015E-004 -3.909289181319930E-004 +-3.454211445391222E-004 -3.047257434488394E-004 -2.683924644570308E-004 -2.360066099112674E-004 +-2.071869062974215E-004 -1.815834380872262E-004 -1.588756484355621E-004 -1.387704104137109E-004 +-1.210001717867296E-004 -1.053211756933396E-004 -9.151175896858470E-005 -7.937072926575233E-005 +-6.871582158695160E-005 -5.938223432302902E-005 -5.122124443446146E-005 -4.409890097627817E-005 +-3.789479578226268E-005 -3.250090977725960E-005 -2.782053307866084E-005 -2.376725678240842E-005 +-2.026403409981320E-005 -1.724230832029450E-005 -1.464120491945796E-005 -1.240678500998552E-005 +-1.049135724264854E-005 -8.852845204233458E-006 -7.454207326496869E-006 -6.262906311616602E-006 +-5.250425095428936E-006 -4.391826404818577E-006 -3.665353019334035E-006 -3.052065916632148E-006 +-2.535517564511026E-006 -2.101457716929248E-006 -1.737569175549195E-006 -1.433234972024142E-006 +-1.179357491821685E-006 -9.680938665870723E-007 -7.927290867435514E-007 -6.475320778847807E-007 +-5.276241994739592E-007 -4.288634664203718E-007 -3.477429142387355E-007 -2.813016549911503E-007 +-2.270472942132721E-007 -1.828884985162440E-007 -1.470766197071458E-007 -1.181553945943181E-007 +-9.491785098811248E-008 -7.603486099146203E-008 -6.073410786127121E-008 -4.837176407915130E-008 +-3.841268784305750E-008 -3.041339494730827E-008 -2.400746312748265E-008 -1.889306111012390E-008 +-1.482232723113169E-008 -1.159235260051945E-008 -9.037551449695847E-009 -7.023226576899051E-009 +-5.440160800729992E-009 -4.200086148670443E-009 -3.231901265310047E-009 -2.478524349420220E-009 +-1.894283950261378E-009 -1.442763303955301E-009 -1.095025702674240E-009 -8.281587931342607E-010 +-6.240848232695148E-010 -4.685918190766918E-010 -3.505475937514400E-010 -2.612644781650944E-010 +-1.939878181760678E-010 -1.434857055851085E-010 -1.057211835543121E-010 -7.759137431860347E-011 +-5.672068993476343E-011 -4.129757138190283E-011 -2.994611644402046E-011 -2.162555489045767E-011 +-1.555185688846692E-011 -1.113685809016018E-011 -7.941188043387116E-012 -5.638028409742083E-012 +-3.985330634925237E-012 -2.804612126603285E-012 -1.964845211652283E-012 -1.370270763247127E-012 +-9.512224083674265E-013 -6.572493907689925E-013 -4.519862671303540E-013 -3.093437767727042E-013 +-2.106941451477993E-013 -1.428012490661483E-013 -9.630596371270093E-014 -6.462325628976713E-014 +-4.314311296477770E-014 -2.865452803592299E-014 -1.893241385479927E-014 -1.244288593339210E-014 +-8.134104444331886E-015 -5.288622806239492E-015 -3.419715906695803E-015 -2.198983844709001E-015 +-1.406074188714829E-015 -8.939595120262020E-016 -5.650927334900892E-016 -3.551258659022150E-016 +-2.218572638311016E-016 -1.377721435676700E-016 -8.503796136219608E-017 -5.216686759251185E-017 +-3.180340289702899E-017 -1.926705458191300E-017 -1.159806494042019E-017 -6.936643094270080E-018 +-4.121653351938615E-018 -2.432854448553694E-018 -1.426419090802075E-018 -8.306687184753300E-019 +-4.804200806911277E-019 -2.759239815798463E-019 -1.573601245826465E-019 -8.910423503063960E-020 +-5.009119545481726E-020 -2.795402398384776E-020 -1.548485530383899E-020 -8.513523557661048E-021 +-4.645258505188724E-021 -2.515169469966510E-021 -1.351261436236241E-021 -7.202507037771764E-022 +-3.808527169232365E-022 -1.997633533469661E-022 -1.039239783603225E-022 -5.361818660994457E-023 +-2.743213203276870E-023 -1.391592834130658E-023 -6.998798770266476E-024 -3.489365543082186E-024 +-1.724381727479561E-024 -8.445708424253111E-025 -4.099261481041813E-025 -1.971480786761189E-025 +-9.393918048290111E-026 -4.434223173923008E-026 -2.073258825278866E-026 -9.600695163851284E-027 +-4.402631669600770E-027 -1.999075569706327E-027 -8.986679546084488E-028 -3.999151024053201E-028 +-1.761487206505863E-028 -7.678533022386660E-029 -3.312129627341331E-029 -1.413543630349794E-029 +-5.967957584269283E-030 -2.492286225850680E-030 -1.029357200904571E-030 -4.204069307679108E-031 +-1.697649413446130E-031 -6.777016909086675E-032 -2.674107196085949E-032 -1.042810055079195E-032 +-4.018402491164044E-033 -1.529883459917130E-033 -5.753789899913789E-034 -2.137339932786416E-034 +-7.840604102092595E-035 -2.839967044606395E-035 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + + els(2) = "2P" + lchi(2) = 1 + oc(2) = 4.000000000000000E+000 + nchi(2) = 2 + epseu(2) = -6.637594170761967E-001 + rcut_chi(2) = 8.966126290453905E-001 + rcutus_chi(2) = 8.966126290453905E-001 + chi(1:1095,2) = + 7.665845577818094E-008 7.859907375502957E-008 8.058881870625926E-008 8.262893428696254E-008 + 8.472069563550108E-008 8.686541017050790E-008 8.906441840806580E-008 9.131909479957289E-008 + 9.363084859081834E-008 9.600112470280620E-008 9.843140463487711E-008 1.009232073906926E-007 + 1.034780904276607E-007 1.060976506303967E-007 1.087835253088270E-007 1.115373932215592E-007 + 1.143609756251604E-007 1.172560373499968E-007 1.202243879033090E-007 1.232678826002116E-007 + 1.263884237233236E-007 1.295879617117556E-007 1.328684963801961E-007 1.362320781688588E-007 + 1.396808094250734E-007 1.432168457173177E-007 1.468423971825173E-007 1.505597299074503E-007 + 1.543711673451233E-007 1.582790917670029E-007 1.622859457520098E-007 1.663942337132082E-007 + 1.706065234631419E-007 1.749254478187987E-007 1.793537062472033E-007 1.838940665526687E-007 + 1.885493666067606E-007 1.933225161220564E-007 1.982164984708058E-007 2.032343725496321E-007 + 2.083792746914379E-007 2.136544206257113E-007 2.190631074884557E-007 2.246087158830036E-007 + 2.302947119929987E-007 2.361246497488672E-007 2.421021730491347E-007 2.482310180379762E-007 + 2.545150154404207E-007 2.609580929566736E-007 2.675642777170493E-007 2.743376987990522E-007 + 2.812825898081767E-007 2.884032915240410E-007 2.957042546135067E-007 3.031900424124816E-007 + 3.108653337781444E-007 3.187349260133733E-007 3.268037378652056E-007 3.350768125992052E-007 + 3.435593211516544E-007 3.522565653615474E-007 3.611739812843983E-007 3.703171425899414E-007 + 3.796917640458416E-007 3.893037050895951E-007 3.991589734908541E-007 4.092637291064621E-007 + 4.196242877305486E-007 4.302471250420881E-007 4.411388806523919E-007 4.523063622550611E-007 + 4.637565498809960E-007 4.754966002611220E-007 4.875338512995566E-007 4.998758266600134E-007 + 5.125302404683146E-007 5.255050021339406E-007 5.388082212936422E-007 5.524482128802000E-007 + 5.664335023194938E-007 5.807728308591428E-007 5.954751610320351E-007 6.105496822581647E-007 + 6.260058165882842E-007 6.418532245929505E-007 6.581018114006565E-007 6.747617328888145E-007 + 6.918434020314665E-007 7.093574954076821E-007 7.273149598747164E-007 7.457270194101004E-007 + 7.646051821269374E-007 7.839612474667863E-007 8.038073135746409E-007 8.241557848605929E-007 + 8.450193797529268E-007 8.664111386474821E-007 8.883444320582464E-007 9.108329689742843E-007 + 9.338908054282157E-007 9.575323532816102E-007 9.817723892327777E-007 1.006626064052585E-006 + 1.032108912054083E-006 1.058236860801849E-006 1.085026241067120E-006 1.112493797034941E-006 + 1.140656696769699E-006 1.169532542945594E-006 1.199139383848741E-006 1.229495724657797E-006 + 1.260620539010148E-006 1.292533280860885E-006 1.325253896642002E-006 1.358802837729378E-006 + 1.393201073225370E-006 1.428470103064996E-006 1.464631971453880E-006 1.501709280646393E-006 + 1.539725205072563E-006 1.578703505822614E-006 1.618668545498167E-006 1.659645303439402E-006 + 1.701659391337678E-006 1.744737069243382E-006 1.788905261979013E-006 1.834191575967749E-006 + 1.880624316488023E-006 1.928232505364894E-006 1.977045899109251E-006 2.027095007516207E-006 + 2.078411112734309E-006 2.131026288817461E-006 2.184973421771801E-006 2.240286230110033E-006 + 2.296999285926109E-006 2.355148036503370E-006 2.414768826469703E-006 2.475898920513528E-006 + 2.538576526674820E-006 2.602840820225746E-006 2.668731968155786E-006 2.736291154276705E-006 + 2.805560604963033E-006 2.876583615544113E-006 2.949404577364269E-006 3.024069005527973E-006 + 3.100623567347343E-006 3.179116111509772E-006 3.259595697983899E-006 3.342112628682614E-006 + 3.426718478902275E-006 3.513466129557763E-006 3.602409800233547E-006 3.693605083071373E-006 + 3.787108977515799E-006 3.882979925939263E-006 3.981277850168955E-006 4.082064188938316E-006 + 4.185401936286577E-006 4.291355680930314E-006 4.399991646631680E-006 4.511377733588424E-006 + 4.625583560871719E-006 4.742680509938168E-006 4.862741769243310E-006 4.985842379984391E-006 + 5.112059283001068E-006 5.241471366863320E-006 5.374159517176597E-006 5.510206667135079E-006 + 5.649697849354562E-006 5.792720249017394E-006 5.939363258362709E-006 6.089718532555913E-006 + 6.243880046972453E-006 6.401944155931558E-006 6.564009652916709E-006 6.730177832320453E-006 + 6.900552552752144E-006 7.075240301948204E-006 7.254350263325373E-006 7.437994384218608E-006 + 7.626287445846283E-006 7.819347135046295E-006 8.017294117828103E-006 8.220252114786410E-006 + 8.428347978423775E-006 8.641711772430475E-006 8.860476852970967E-006 9.084779952028033E-006 + 9.314761262856376E-006 9.550564527599255E-006 9.792337127122880E-006 1.004023017312461E-005 + 1.029439860257256E-005 1.055500127453561E-005 1.082220106946427E-005 1.109616499098463E-005 + 1.137706427026849E-005 1.166507447304566E-005 1.196037560932439E-005 1.226315224588923E-005 + 1.257359362164619E-005 1.289189376588728E-005 1.321825161954848E-005 1.355287115953675E-005 + 1.389596152620380E-005 1.424773715404625E-005 1.460841790571373E-005 1.497822920940884E-005 + 1.535740219976451E-005 1.574617386228707E-005 1.614478718145500E-005 1.655349129256584E-005 + 1.697254163742657E-005 1.740220012398394E-005 1.784273528999514E-005 1.829442247084069E-005 + 1.875754397158434E-005 1.923238924338770E-005 1.971925506438940E-005 2.021844572516209E-005 + 2.073027321886294E-005 2.125505743619629E-005 2.179312636531046E-005 2.234481629675338E-005 + 2.291047203361483E-005 2.349044710698710E-005 2.408510399687781E-005 2.469481435871375E-005 + 2.531995925557608E-005 2.596092939631298E-005 2.661812537967776E-005 2.729195794464479E-005 + 2.798284822706016E-005 2.869122802278655E-005 2.941754005750705E-005 3.016223826335633E-005 + 3.092578806255149E-005 3.170866665820024E-005 3.251136333246738E-005 3.333437975228585E-005 + 3.417823028280345E-005 3.504344230876052E-005 3.593055656399916E-005 3.684012746930993E-005 + 3.777272347882662E-005 3.872892743518532E-005 3.970933693366951E-005 4.071456469556821E-005 + 4.174523895098019E-005 4.280200383130345E-005 4.388551977165419E-005 4.499646392346700E-005 + 4.613553057753321E-005 4.730343159774157E-005 4.850089686579174E-005 4.972867473715774E-005 + 5.098753250858641E-005 5.227825689742175E-005 5.360165453305440E-005 5.495855246080287E-005 + 5.634979865854045E-005 5.777626256639033E-005 5.923883562981877E-005 6.073843185646511E-005 + 6.227598838705590E-005 6.385246608075901E-005 6.546885011534261E-005 6.712615060251298E-005 + 6.882540321881468E-005 7.056766985248653E-005 7.235403926667659E-005 7.418562777942860E-005 + 7.606357996086488E-005 7.798906934799866E-005 7.996329917762250E-005 8.198750313772851E-005 + 8.406294613792833E-005 8.619092509935366E-005 8.837276976452815E-005 9.060984352771546E-005 + 9.290354428626123E-005 9.525530531345749E-005 9.766659615347429E-005 1.001389235389148E-004 + 1.026738323315655E-004 1.052729064869269E-004 1.079377700431242E-004 1.106700881348145E-004 + 1.134715680327206E-004 1.163439602094376E-004 1.192890594321772E-004 1.223087058831258E-004 + 1.254047863081169E-004 1.285792351943300E-004 1.318340359777480E-004 1.351712222811242E-004 + 1.385928791832278E-004 1.421011445201588E-004 1.456982102195367E-004 1.493863236683960E-004 + 1.531677891156357E-004 1.570449691098942E-004 1.610202859737434E-004 1.650962233151153E-004 + 1.692753275769024E-004 1.735602096256898E-004 1.779535463806077E-004 1.824580824833145E-004 + 1.870766320101436E-004 1.918120802274800E-004 1.966673853914516E-004 2.016455805930524E-004 + 2.067497756498414E-004 2.119831590453876E-004 2.173489999176651E-004 2.228506500976287E-004 + 2.284915461992305E-004 2.342752117621743E-004 2.402052594487325E-004 2.462853932959856E-004 + 2.525194110248763E-004 2.589112064075063E-004 2.654647716941423E-004 2.721842001014254E-004 + 2.790736883633295E-004 2.861375393464367E-004 2.933801647311502E-004 3.008060877604971E-004 + 3.084199460582186E-004 3.162264945178863E-004 3.242306082648266E-004 3.324372856926803E-004 + 3.408516515764660E-004 3.494789602640685E-004 3.583245989481158E-004 3.673940910202609E-004 + 3.766930995099327E-004 3.862274306096670E-004 3.960030372891912E-004 4.060260230004837E-004 + 4.163026454760795E-004 4.268393206229595E-004 4.376426265144125E-004 4.487193074823195E-004 + 4.600762783123658E-004 4.717206285447627E-004 4.836596268831028E-004 4.959007257140523E-004 + 5.084515657406537E-004 5.213199807320611E-004 5.345140023926209E-004 5.480418653532712E-004 + 5.619120122883032E-004 5.761330991606169E-004 5.907140005986596E-004 6.056638154083323E-004 + 6.209918722232226E-004 6.367077352965939E-004 6.528212104386643E-004 6.693423511027813E-004 + 6.862814646241905E-004 7.036491186151821E-004 7.214561475204959E-004 7.397136593369630E-004 + 7.584330425014444E-004 7.776259729512414E-004 7.973044213612473E-004 8.174806605622047E-004 + 8.381672731445571E-004 8.593771592524673E-004 8.811235445727077E-004 9.034199885232317E-004 + 9.262803926463344E-004 9.497190092114670E-004 9.737504500328494E-004 9.983896955071711E-004 + 1.023652103876800E-003 1.049553420724025E-003 1.076109788702012E-003 1.103337757508283E-003 + 1.131254294106656E-003 1.159876793203726E-003 1.189223087986135E-003 1.219311461124969E-003 + 1.250160656053855E-003 1.281789888527381E-003 1.314218858466717E-003 1.347467762099406E-003 + 1.381557304400489E-003 1.416508711842271E-003 1.452343745460242E-003 1.489084714242809E-003 + 1.526754488852669E-003 1.565376515687860E-003 1.604974831290682E-003 1.645574077112896E-003 + 1.687199514645767E-003 1.729877040923753E-003 1.773633204410792E-003 1.818495221278398E-003 + 1.864490992084923E-003 1.911649118865606E-003 1.959998922643221E-003 2.009570461369329E-003 + 2.060394548306430E-003 2.112502770861452E-003 2.165927509881323E-003 2.220701959421548E-003 + 2.276860146998988E-003 2.334436954340269E-003 2.393468138637469E-003 2.453990354323055E-003 + 2.516041175376208E-003 2.579659118172986E-003 2.644883664893037E-003 2.711755287495827E-003 + 2.780315472279618E-003 2.850606745036722E-003 2.922672696818806E-003 2.996558010326347E-003 + 3.072308486936580E-003 3.149971074384632E-003 3.229593895112742E-003 3.311226275302832E-003 + 3.394918774608007E-003 3.480723216598775E-003 3.568692719940219E-003 3.658881730316523E-003 + 3.751346053119657E-003 3.846142886919362E-003 3.943330857731782E-003 4.042970054104544E-003 + 4.145122063036307E-003 4.249850006749174E-003 4.357218580332682E-003 4.467294090278448E-003 + 4.580144493924742E-003 4.695839439830812E-003 4.814450309100837E-003 4.936050257678019E-003 + 5.060714259629381E-003 5.188519151442292E-003 5.319543677354139E-003 5.453868535736681E-003 + 5.591576426557155E-003 5.732752099938386E-003 5.877482405840489E-003 6.025856344887143E-003 + 6.177965120359545E-003 6.333902191381683E-003 6.493763327320647E-003 6.657646663426045E-003 + 6.825652757732927E-003 6.997884649252809E-003 7.174447917477673E-003 7.355450743221994E-003 + 7.541003970828204E-003 7.731221171761058E-003 7.926218709616647E-003 8.126115806571958E-003 + 8.331034611301087E-003 8.541100268384189E-003 8.756440989235642E-003 8.977188124577574E-003 + 9.203476238485430E-003 9.435443184031979E-003 9.673230180556177E-003 9.916981892583429E-003 + 1.016684651042363E-002 1.042297583247312E-002 1.068552534924690E-002 1.095465432916686E-002 + 1.123052590613177E-002 1.151330716889449E-002 1.180316925227138E-002 1.210028743020859E-002 + 1.240484121072941E-002 1.271701443278645E-002 1.303699536504154E-002 1.336497680659586E-002 + 1.370115618969192E-002 1.404573568440823E-002 1.439892230536650E-002 1.476092802047021E-002 + 1.513196986169240E-002 1.551227003792912E-002 1.590205604993377E-002 1.630156080734609E-002 + 1.671102274782784E-002 1.713068595831576E-002 1.756080029840019E-002 1.800162152583623E-002 + 1.845341142419149E-002 1.891643793263275E-002 1.939097527785098E-002 1.987730410812164E-002 + 2.037571162949427E-002 2.088649174410215E-002 2.140994519057961E-002 2.194637968657111E-002 + 2.249611007331228E-002 2.305945846225881E-002 2.363675438373562E-002 2.422833493757292E-002 + 2.483454494569188E-002 2.545573710659706E-002 2.609227215172702E-002 2.674451900360889E-002 + 2.741285493575610E-002 2.809766573424257E-002 2.879934586087860E-002 2.951829861790682E-002 + 3.025493631412889E-002 3.100968043236422E-002 3.178296179813465E-002 3.257522074945809E-002 + 3.338690730762529E-002 3.421848134882293E-002 3.507041277645535E-002 3.594318169400511E-002 + 3.683727857826129E-002 3.775320445272989E-002 3.869147106102842E-002 3.965260104005155E-002 + 4.063712809267959E-002 4.164559715978541E-002 4.267856459127930E-002 4.373659831591253E-002 + 4.482027800954212E-002 4.593019526153991E-002 4.706695373900874E-002 4.823116934844586E-002 + 4.942347039447200E-002 5.064449773522049E-002 5.189490493395587E-002 5.317535840646507E-002 + 5.448653756373736E-002 5.582913494941994E-002 5.720385637150691E-002 5.861142102768711E-002 + 6.005256162374450E-002 6.152802448436957E-002 6.303856965570503E-002 6.458497099891178E-002 + 6.616801627400209E-002 6.778850721314644E-002 6.944725958261797E-002 7.114510323249472E-002 + 7.288288213319458E-002 7.466145439786916E-002 7.648169228963463E-002 7.834448221256564E-002 + 8.025072468532488E-002 8.220133429624706E-002 8.419723963863761E-002 8.623938322498852E-002 + 8.832872137875170E-002 9.046622410224822E-002 9.265287491922673E-002 9.488967069051711E-002 + 9.717762140115631E-002 9.951774991729473E-002 1.019110917111163E-001 1.043586945519326E-001 + 1.068616181615363E-001 1.094209338318197E-001 1.120377240025865E-001 1.147130817974062E-001 + 1.174481105152737E-001 1.202439230757616E-001 1.231016414152637E-001 1.260223958318478E-001 + 1.290073242761499E-001 1.320575715856594E-001 1.351742886596608E-001 1.383586315720151E-001 + 1.416117606188822E-001 1.449348392984068E-001 1.483290332193101E-001 1.517955089352606E-001 + 1.553354327018188E-001 1.589499691526909E-001 1.626402798919591E-001 1.664075219989039E-001 + 1.702528464419823E-001 1.741773963984853E-001 1.781823054763667E-001 1.822686958347090E-001 + 1.864376761992876E-001 1.906903397696904E-001 1.950277620144694E-001 1.994509983508329E-001 + 2.039610817054368E-001 2.085590199529010E-001 2.132457932287719E-001 2.180223511137642E-001 + 2.228896096862560E-001 2.278484484401818E-001 2.328997070656661E-001 2.380441820899775E-001 + 2.432826233766465E-001 2.486157304809067E-001 2.540441488599661E-001 2.595684659370132E-001 + 2.651892070183077E-001 2.709068310632072E-001 2.767217263075266E-001 2.826342057412518E-001 + 2.886445024422921E-001 2.947527647687105E-001 3.009590514126734E-001 3.072633263202531E-001 + 3.136654534821802E-001 3.201651916016834E-001 3.267621886466885E-001 3.334559762948593E-001 + 3.402459642812705E-001 3.471314346599030E-001 3.541115359916371E-001 3.611852774730137E-001 + 3.683515230217148E-001 3.756089853364961E-001 3.829562199511769E-001 3.903916193042677E-001 + 3.979134068478783E-001 4.055196312216885E-001 4.132081605200043E-001 4.209766766822230E-001 + 4.288226700393940E-001 4.367434340519974E-001 4.447360602765256E-001 4.527974336009458E-001 + 4.609242277916236E-001 4.691129013967908E-001 4.773596940540922E-001 4.856606232521545E-001 + 4.940114815984308E-001 5.024078346477732E-001 5.108450193482199E-001 5.193181431623477E-001 + 5.278220839241243E-001 5.363514904925549E-001 5.449007842644066E-001 5.534641616089078E-001 + 5.620355972875278E-001 5.706088489216128E-001 5.791774625698047E-001 5.877347794757054E-001 + 5.962739440440749E-001 6.047879131009948E-001 6.132694664897032E-001 6.217112190492741E-001 + 6.301056340178318E-001 6.384450378955052E-001 6.467216367948684E-001 6.549275342980052E-001 + 6.630547508296766E-001 6.710952445452277E-001 6.790409337198507E-001 6.868837206126970E-001 + 6.946155167649676E-001 7.022282696756653E-001 7.097139907821443E-001 7.170647846549725E-001 + 7.242728792981332E-001 7.313306574261527E-001 7.382306885696783E-001 7.449657618403384E-001 + 7.515289191646530E-001 7.579134887755096E-001 7.641131187284723E-001 7.701218101892403E-001 + 7.759339502181669E-001 7.815443437581194E-001 7.869482445135428E-001 7.921413843915441E-001 + 7.971200011606017E-001 8.018808639694039E-001 8.064212963576444E-001 8.107391963828360E-001 + 8.148330534824906E-001 8.187019616899143E-001 8.223456288245777E-001 8.257643812849331E-001 + 8.289591640830704E-001 8.319315357769358E-001 8.346836579774983E-001 8.372182791355227E-001 + 8.395387123458663E-001 8.416488069470521E-001 8.435529137405722E-001 8.452558437087386E-001 + 8.467628201724258E-001 8.480794244015744E-001 8.492115347728298E-001 8.501652596610415E-001 + 8.509468643558958E-001 8.515626924128870E-001 8.520190819805585E-001 8.523222777949709E-001 + 8.524783396989162E-001 8.524930487288551E-001 8.523718120175968E-001 8.521195679855572E-001 + 8.517406935373382E-001 8.512389152409462E-001 8.506172267401988E-001 8.498778149297702E-001 + 8.490219976965759E-001 8.480501762860863E-001 8.469618055672306E-001 8.457553856177569E-001 + 8.444284780978958E-001 8.429777507789424E-001 8.413990532888892E-001 8.396875265605782E-001 + 8.378377475360044E-001 8.358439092945040E-001 8.337000348163542E-001 8.314002199317713E-001 + 8.289388974818536E-001 8.263111101525510E-001 8.235127736265376E-001 8.205409043878643E-001 + 8.173937774235414E-001 8.140709678514479E-001 8.105732167495573E-001 8.069020591572043E-001 + 8.030593216888513E-001 7.990469613981120E-001 7.948670519901674E-001 7.905217812728413E-001 + 7.860134485042608E-001 7.813444616448012E-001 7.765173345210473E-001 7.715346839094472E-001 + 7.663992265472731E-001 7.611137760783988E-001 7.556812399412131E-001 7.501046162058302E-001 + 7.443869903674818E-001 7.385315321027277E-001 7.325414919947744E-001 7.264201982338454E-001 + 7.201710532981421E-001 7.137975306204994E-001 7.073031712453672E-001 7.006915804802668E-001 + 6.939664245453039E-001 6.871314272237905E-001 6.801903665163067E-001 6.731470713004929E-001 + 6.660054179976148E-001 6.587693272456999E-001 6.514427605807138E-001 6.440297171250563E-001 + 6.365342302803474E-001 6.289603644242312E-001 6.213122116093053E-001 6.135938882605348E-001 + 6.058095318681186E-001 5.979632976722536E-001 5.900593553359242E-001 5.821018856016384E-001 + 5.740950769279818E-001 5.660431221018718E-001 5.579502148225983E-001 5.498205462540190E-001 + 5.416583015417792E-001 5.334676562930365E-001 5.252527730169469E-001 5.170177975251524E-001 + 5.087668552925647E-001 5.005040477800344E-001 4.922334487218433E-001 4.839591003824619E-001 + 4.756850097886066E-001 4.674151449442462E-001 4.591534310378986E-001 4.509037466532046E-001 + 4.426699199953573E-001 4.344557251475037E-001 4.262648783725879E-001 4.181010344773167E-001 + 4.099677832559236E-001 4.018686460321251E-001 3.938070723181463E-001 3.857864366098324E-001 + 3.778100353367078E-001 3.698810839853502E-001 3.620027144136282E-001 3.541779723722111E-001 + 3.464098152483032E-001 3.387011100448278E-001 3.310546316062981E-001 3.234730611003961E-001 + 3.159589847618996E-001 3.085148929030589E-001 3.011431791919026E-001 2.938461401972797E-001 + 2.866259751967215E-001 2.794847862406287E-001 2.724245784637051E-001 2.654472606319701E-001 + 2.585546459115124E-001 2.517484528429970E-001 2.450303065039318E-001 2.384017398390409E-001 + 2.318641951376308E-001 2.254190256356494E-001 2.190674972192267E-001 2.128107902058801E-001 + 2.066500011792592E-001 2.005861448533150E-001 1.946201559421062E-001 1.887528910121040E-001 + 1.829851302948407E-001 1.773175794390326E-001 1.717508711829252E-001 1.662855669295232E-001 + 1.609221582095523E-001 1.556610680194724E-001 1.505026520245352E-001 1.454471996197649E-001 + 1.404949348447740E-001 1.356460171514417E-001 1.309005420266662E-001 1.262585414755402E-001 + 1.217199843733792E-001 1.172847766979537E-001 1.129527616559881E-001 1.087237197204416E-001 + 1.045973685972039E-001 1.005733631415905E-001 9.665129524637017E-002 9.283069372395293E-002 + 8.911102420583181E-002 8.549168908236296E-002 8.197202750552574E-002 7.855131547642989E-002 + 7.522876603806726E-002 7.200352959218535E-002 6.887469435722601E-002 6.584128698208899E-002 + 6.290227332809845E-002 6.005655942902325E-002 5.730299263640035E-002 5.464036295477426E-002 + 5.206740456885953E-002 4.958279756209537E-002 4.718516982363710E-002 4.487309913855610E-002 + 4.264511545391887E-002 4.049970331151843E-002 3.843530443634689E-002 3.645032046843749E-002 + 3.454311582447758E-002 3.271202067458982E-002 3.095533401890561E-002 2.927132684799373E-002 + 2.765824537085235E-002 2.611431429401181E-002 2.463774013530992E-002 2.322671455607900E-002 + 2.187941769580774E-002 2.059402149379099E-002 1.936869298284621E-002 1.820159754083533E-002 + 1.709090208647318E-002 1.603477820671338E-002 1.503140520386379E-002 1.407897305148863E-002 + 1.317568524908567E-002 1.231976156647928E-002 1.150944066983129E-002 1.074298262213307E-002 + 1.001867125199855E-002 9.334816385519761E-003 8.689755936870365E-003 8.081857854241981E-003 + 7.509521918569348E-003 6.971181393339760E-003 6.465304524586077E-003 5.990395890929348E-003 + 5.544997604263568E-003 5.127690362360200E-003 4.737094355312701E-003 4.371870028339719E-003 + 4.030718704020124E-003 3.712383067542550E-003 3.415647519016873E-003 3.139338397315258E-003 + 2.882324080285969E-003 2.643514966515268E-003 2.421863344101450E-003 2.216363152151600E-003 + 2.026049640917158E-003 1.849998936649522E-003 1.687327517383463E-003 1.537191605944728E-003 + 1.398786486529073E-003 1.271345751236721E-003 1.154140482891915E-003 1.046478380474082E-003 + 9.477028333932470E-004 8.571919507436638E-004 7.743575515435820E-004 6.986441218188300E-004 + 6.295277442159047E-004 5.665150056366306E-004 5.091418881989111E-004 4.569726485571144E-004 + 4.095986904270582E-004 3.666374348885819E-004 3.277311927836293E-004 2.925460432626300E-004 + 2.607707222606449E-004 2.321155244106597E-004 2.063112216398754E-004 1.831084964287518E-004 + 1.622808212987347E-004 1.436138682814248E-004 1.269093213725300E-004 1.119844867543084E-004 + 9.867134522126673E-005 8.681564161201218E-005 7.627601224021512E-005 6.692315121768971E-005 + 5.863901648117145E-005 5.131607628390857E-005 4.485659689741043E-005 3.917197229997181E-005 + 3.418209671117872E-005 2.981478097980356E-005 2.600521405957843E-005 2.264235810686479E-005 + 1.967911078948544E-005 1.707268946209148E-005 1.478430803601421E-005 1.277887047664681E-005 + 1.102468079733011E-005 9.493169344289565E-006 8.158635099126459E-006 6.998003663833427E-006 + 5.990600538332791E-006 5.117939252123248E-006 4.363523869697761E-006 3.712665353843395E-006 + 3.152311241579547E-006 2.670888064114003E-006 2.258155924539304E-006 1.905074634756673E-006 + 1.603680805976580E-006 1.346975284752027E-006 1.128820328483141E-006 9.438459203045262E-007 + 7.873646328387712E-007 6.552944630714146E-007 5.440890761835351E-007 4.506749141733107E-007 + 3.723946451312487E-007 3.069564507363943E-007 2.523886725625801E-007 2.069993617931601E-007 + 1.693403016292659E-007 1.381750967532339E-007 1.124509494124934E-007 9.127376678218614E-008 + 7.388626903504656E-008 5.964879180831758E-008 4.802250034874744E-008 3.855475540198857E-008 + 3.086639277973748E-008 2.464069939728511E-008 1.961388835768030E-008 1.556689431821548E-008 + 1.231832788039394E-008 9.718444082370497E-009 7.643995244230443E-009 5.993852435425499E-009 + 4.685292725419767E-009 3.650861177701284E-009 2.835727296130231E-009 2.195465379636327E-009 + 1.694197039769536E-009 1.303042042127807E-009 9.988307059456911E-010 7.630373958761852E-010 + 5.809002260612961E-010 4.406970280365319E-010 3.331519684707155E-010 2.509509957954725E-010 + 1.883475995294562E-010 1.408432328119249E-010 1.049292244965940E-010 7.787913603162730E-011 + 5.758234083600840E-011 4.241115718879405E-011 3.111518367133702E-011 2.273759960992745E-011 + 1.654912932217883E-011 1.199615289436188E-011 8.660099561380144E-012 6.225801804938767E-012 + 4.456935934997816E-012 3.177042913226915E-012 2.254924288500201E-012 1.593453350347535E-012 + 1.121040396905728E-012 7.851513927148686E-013 5.474080635022485E-013 3.799003715141809E-013 + 2.624241365304021E-013 1.804213125568504E-013 1.234514094982611E-013 8.406248969327576E-014 + 5.696130405120588E-014 3.840627996577907E-014 2.576570546069773E-014 1.719775647002971E-014 + 1.141993565744167E-014 7.543787000931954E-015 4.957018224268122E-015 3.239873334537814E-015 + 2.106117916343675E-015 1.361616541661726E-015 8.754158742394170E-016 5.596687774791476E-016 + 3.557738496160280E-016 2.248599350334098E-016 1.412907380306521E-016 8.825654175498248E-017 + 5.479984892717239E-017 3.382036544443760E-017 2.074486131787533E-017 1.264568878210174E-017 + 7.660200609161282E-018 4.610723270078356E-018 2.757365629964819E-018 1.638252103412378E-018 + 9.669242036342996E-019 5.668827549080152E-019 3.301007551131498E-019 1.909040442031113E-019 + 1.096380980150992E-019 6.252411483171713E-020 3.540256837295189E-020 1.990142283583697E-020 + 1.110596017813807E-020 6.151920545371780E-021 3.382263467019624E-021 1.845462581313459E-021 + 9.992234346395062E-022 5.368308675522184E-022 2.861457270940119E-022 1.513104237251728E-022 + 7.936674415213993E-023 4.129069625983690E-023 2.130418896870418E-023 1.090012891082889E-023 + 5.529758859420384E-024 2.781263951573173E-024 1.386732250404776E-024 6.853458205683369E-025 + 3.356954194190725E-025 1.629486246061723E-025 7.837474650878181E-026 3.734837175185186E-026 + 1.763138984248185E-026 8.244596671147523E-027 3.818284346403259E-027 1.751178618350454E-027 + 7.952480813317832E-028 3.575450974909615E-028 1.591330432405223E-028 7.010288551009714E-029 + 3.056337796645827E-029 1.318560263225846E-029 5.628262132627767E-030 2.376655069223483E-030 + 9.926966959452249E-031 4.100774711915087E-031 1.675150154163590E-031 6.765795898176817E-032 + 2.701465446675277E-032 1.066185055110814E-032 4.158674216369998E-033 1.602883773223423E-033 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 +/ + +&rhoatom + rho_at(1:1095) = + 3.609136560465641E-008 3.700502349847288E-008 3.794181078396430E-008 3.890231298610786E-008 + 3.988713045260043E-008 4.089687872910136E-008 4.193218894397555E-008 4.299370820277606E-008 + 4.408209999271373E-008 4.519804459736596E-008 4.634223952188454E-008 4.751539992896743E-008 + 4.871825908586781E-008 4.995156882271954E-008 5.121610000246571E-008 5.251264300268332E-008 + 5.384200820960607E-008 5.520502652465381E-008 5.660254988378530E-008 5.803545178999899E-008 + 5.950462785931374E-008 6.101099638057250E-008 6.255549888941781E-008 6.413910075679799E-008 + 6.576279179237154E-008 6.742758686318798E-008 6.913452652803088E-008 7.088467768782046E-008 + 7.267913425248152E-008 7.451901782469357E-008 7.640547840095154E-008 7.833969509037485E-008 + 8.032287685171279E-008 8.235626324900934E-008 8.444112522639876E-008 8.657876590251505E-008 + 8.877052138501412E-008 9.101776160571547E-008 9.332189117688770E-008 9.568435026921260E-008 + 9.810661551197452E-008 1.005902009160404E-007 1.031366588202071E-007 1.057475808615058E-007 + 1.084245989700724E-007 1.111693863892033E-007 1.139836587212372E-007 1.168691749999141E-007 + 1.198277387898842E-007 1.228611993140515E-007 1.259714526094591E-007 1.291604427124371E-007 + 1.324301628737568E-007 1.357826568045469E-007 1.392200199537540E-007 1.427444008179427E-007 + 1.463580022842595E-007 1.500630830073941E-007 1.538619588214025E-007 1.577570041872742E-007 + 1.617506536771467E-007 1.658454034960982E-007 1.700438130424659E-007 1.743485065076710E-007 + 1.787621745165451E-007 1.832875758091859E-007 1.879275389653947E-007 1.926849641727740E-007 + 1.975628250395861E-007 2.025641704535135E-007 2.076921264874768E-007 2.129498983537038E-007 + 2.183407724072759E-007 2.238681182003968E-007 2.295353905886745E-007 2.353461318907275E-007 + 2.413039741024739E-007 2.474126411674809E-007 2.536759513047950E-007 2.600978193957126E-007 + 2.666822594309794E-007 2.734333870199497E-007 2.803554219632770E-007 2.874526908907423E-007 + 2.947296299658711E-007 3.021907876590275E-007 3.098408275907220E-007 3.176845314469127E-007 + 3.257268019681187E-007 3.339726660142199E-007 3.424272777068541E-007 3.510959216513808E-007 + 3.599840162404289E-007 3.690971170410852E-007 3.784409202678549E-007 3.880212663435526E-007 + 3.978441435503631E-007 4.079156917733456E-007 4.182422063387331E-007 4.288301419494155E-007 + 4.396861167200765E-007 4.508169163145097E-007 4.622294981876918E-007 4.739309959352753E-007 + 4.859287237532246E-007 4.982301810103663E-007 5.108430569367414E-007 5.237752354306696E-007 + 5.370347999875436E-007 5.506300387534312E-007 5.645694497066585E-007 5.788617459705973E-007 + 5.935158612609996E-007 6.085409554712686E-007 6.239464203991847E-007 6.397418856186405E-007 + 6.559372245000820E-007 6.725425603834132E-007 6.895682729072277E-007 7.070250044983322E-007 + 7.249236670256109E-007 7.432754486224128E-007 7.620918206817091E-007 7.813845450284254E-007 + 8.011656812734112E-007 8.214475943536650E-007 8.422429622635313E-007 8.635647839817064E-007 + 8.854263875990133E-007 9.078414386520461E-007 9.308239486678703E-007 9.543882839251741E-007 + 9.785491744373056E-007 1.003321723162854E-006 1.028721415449535E-006 1.054764128717280E-006 + 1.081466142386608E-006 1.108844148058481E-006 1.136915259952037E-006 1.165697025606720E-006 + 1.195207436855513E-006 1.225464941076158E-006 1.256488452727391E-006 1.288297365177427E-006 + 1.320911562832108E-006 1.354351433570306E-006 1.388637881494375E-006 1.423792340003632E-006 + 1.459836785199055E-006 1.496793749627622E-006 1.534686336374880E-006 1.573538233514568E-006 + 1.613373728924373E-006 1.654217725477091E-006 1.696095756616722E-006 1.739034002329223E-006 + 1.783059305518012E-006 1.828199188794402E-006 1.874481871693536E-006 1.921936288326632E-006 + 1.970592105480552E-006 2.020479741176088E-006 2.071630383696615E-006 2.124076011098988E-006 + 2.177849411218981E-006 2.232984202183777E-006 2.289514853444407E-006 2.347476707341301E-006 + 2.406906001216534E-006 2.467839890086576E-006 2.530316469889807E-006 2.594374801323450E-006 + 2.660054934284760E-006 2.727397932931887E-006 2.796445901380218E-006 2.867242010050127E-006 + 2.939830522682939E-006 3.014256824041857E-006 3.090567448315367E-006 3.168810108240985E-006 + 3.249033724967502E-006 3.331288458674702E-006 3.415625739969619E-006 3.502098302079136E-006 + 3.590760213859198E-006 3.681666913641318E-006 3.774875243937771E-006 3.870443487027127E-006 + 3.968431401442706E-006 4.068900259386821E-006 4.171912885094266E-006 4.277533694169413E-006 + 4.385828733921400E-006 4.496865724723075E-006 4.610714102419553E-006 4.727445061813140E-006 + 4.847131601252126E-006 4.969848568351363E-006 5.095672706873549E-006 5.224682704800764E-006 + 5.356959243626495E-006 5.492585048899422E-006 5.631644942050527E-006 5.774225893536518E-006 + 5.920417077332965E-006 6.070309926811504E-006 6.223998192036603E-006 6.381577998517732E-006 + 6.543147907454317E-006 6.708808977511507E-006 6.878664828165598E-006 7.052821704659508E-006 + 7.231388544608961E-006 7.414477046301830E-006 7.602201738733821E-006 7.794680053424522E-006 + 7.992032398059778E-006 8.194382232006544E-006 8.401856143748397E-006 8.614583930290654E-006 + 8.832698678585317E-006 9.056336849027820E-006 9.285638361078057E-006 9.520746681060576E-006 + 9.761808912199199E-006 1.000897588694358E-005 1.026240226164622E-005 1.052224661365012E-005 + 1.078867154084885E-005 1.106184376378244E-005 1.134193423033375E-005 1.162911822309260E-005 + 1.192357546945530E-005 1.222549025453041E-005 1.253505153692237E-005 1.285245306746673E-005 + 1.317789351099346E-005 1.351157657119514E-005 1.385371111868061E-005 1.420451132229561E-005 + 1.456419678379414E-005 1.493299267594759E-005 1.531112988417905E-005 1.569884515181429E-005 + 1.609638122904224E-005 1.650398702568067E-005 1.692191776784502E-005 1.735043515862121E-005 + 1.778980754284549E-005 1.824031007609759E-005 1.870222489801575E-005 1.917584131004566E-005 + 1.966145595773716E-005 2.015937301770727E-005 2.066990438938959E-005 2.119336989169430E-005 + 2.173009746470594E-005 2.228042337654926E-005 2.284469243555768E-005 2.342325820788152E-005 + 2.401648324067725E-005 2.462473929102320E-005 2.524840756071003E-005 2.588787893705895E-005 + 2.654355423992512E-005 2.721584447504630E-005 2.790517109390312E-005 2.861196626026023E-005 + 2.933667312356324E-005 3.007974609936976E-005 3.084165115699911E-005 3.162286611458957E-005 + 3.242388094175633E-005 3.324519807005011E-005 3.408733271142125E-005 3.495081318489806E-005 + 3.583618125169668E-005 3.674399245898348E-005 3.767481649251742E-005 3.862923753840710E-005 + 3.960785465422212E-005 4.061128214970596E-005 4.164014997734385E-005 4.269510413304654E-005 + 4.377680706721762E-005 4.488593810647901E-005 4.602319388633864E-005 4.718928879508947E-005 + 4.838495542923946E-005 4.961094506077940E-005 5.086802811660286E-005 5.215699467040461E-005 + 5.347865494738875E-005 5.483383984213057E-005 5.622340144994385E-005 5.764821361211571E-005 + 5.910917247538213E-005 6.060719706602523E-005 6.214322987898850E-005 6.371823748241361E-005 + 6.533321113801394E-005 6.698916743771619E-005 6.868714895700781E-005 7.042822492544501E-005 + 7.221349191478668E-005 7.404407454523442E-005 7.592112621027198E-005 7.784582982061198E-005 + 7.981939856777162E-005 8.184307670781642E-005 8.391814036582464E-005 8.604589836164195E-005 + 8.822769305751296E-005 9.046490122819277E-005 9.275893495416123E-005 9.511124253857752E-005 + 9.752330944863702E-005 9.999665928200572E-005 1.025328547590334E-004 1.051334987414646E-004 + 1.078002352783882E-004 1.105347506801894E-004 1.133387746212929E-004 1.162140812725056E-004 + 1.191624904637969E-004 1.221858688783746E-004 1.252861312789471E-004 1.284652417670851E-004 + 1.317252150766264E-004 1.350681179020965E-004 1.384960702631469E-004 1.420112469060468E-004 + 1.456158787432927E-004 1.493122543324367E-004 1.531027213952706E-004 1.569896883785311E-004 + 1.609756260573410E-004 1.650630691826276E-004 1.692546181738077E-004 1.735529408580661E-004 + 1.779607742575996E-004 1.824809264262410E-004 1.871162783369262E-004 1.918697858215109E-004 + 1.967444815644989E-004 2.017434771522913E-004 2.068699651796196E-004 2.121272214148816E-004 + 2.175186070261602E-004 2.230475708697518E-004 2.287176518431148E-004 2.345324813041874E-004 + 2.404957855591112E-004 2.466113884204555E-004 2.528832138381104E-004 2.593152886050956E-004 + 2.659117451405971E-004 2.726768243526493E-004 2.796148785829311E-004 2.867303746362573E-004 + 2.940278968974242E-004 3.015121505381664E-004 3.091879648170768E-004 3.170602964754454E-004 + 3.251342332320778E-004 3.334149973802628E-004 3.419079494901689E-004 3.506185922200816E-004 + 3.595525742399983E-004 3.687156942712364E-004 3.781139052458524E-004 3.877533185897831E-004 + 3.976402086337990E-004 4.077810171564779E-004 4.181823580635893E-004 4.288510222084276E-004 + 4.397939823578112E-004 4.510183983086402E-004 4.625316221600876E-004 4.743412037466947E-004 + 4.864548962378441E-004 4.988806619092847E-004 5.116266780926098E-004 5.247013433088203E-004 + 5.381132835923258E-004 5.518713590120023E-004 5.659846703961741E-004 5.804625662686488E-004 + 5.953146500032424E-004 6.105507872044865E-004 6.261811133225514E-004 6.422160415107092E-004 + 6.586662707340087E-004 6.755427941381870E-004 6.928569076881826E-004 7.106202190860157E-004 + 7.288446569781974E-004 7.475424804632057E-004 7.667262889100498E-004 7.864090320993605E-004 + 8.066040206989167E-004 8.273249370860166E-004 8.485858465296157E-004 8.704012087456853E-004 + 8.927858898398012E-004 9.157551746515588E-004 9.393247795160354E-004 9.635108654581228E-004 + 9.883300518362733E-004 1.013799430452847E-003 1.039936580149006E-003 1.066759581902865E-003 + 1.094287034450380E-003 1.122538070449303E-003 1.151532373207423E-003 1.181290193997177E-003 + 1.211832369979697E-003 1.243180342762345E-003 1.275356177614837E-003 1.308382583370115E-003 + 1.342282933037302E-003 1.377081285155238E-003 1.412802405916343E-003 1.449471792091848E-003 + 1.487115694790824E-003 1.525761144086813E-003 1.565435974547407E-003 1.606168851703612E-003 + 1.647989299497537E-003 1.690927728748604E-003 1.735015466680232E-003 1.780284787550913E-003 + 1.826768944435388E-003 1.874502202203847E-003 1.923519871749064E-003 1.973858345513693E-003 + 2.025555134372271E-003 2.078648905924871E-003 2.133179524261954E-003 2.189188091262641E-003 + 2.246716989491370E-003 2.305809926760901E-003 2.366511982432578E-003 2.428869655528109E-003 + 2.492930914730343E-003 2.558745250354075E-003 2.626363728371575E-003 2.695839046581347E-003 + 2.767225593012623E-003 2.840579506662359E-003 2.915958740665750E-003 2.993423128005959E-003 + 3.073034449873520E-003 3.154856506790907E-003 3.238955192622923E-003 3.325398571599097E-003 + 3.414256958480026E-003 3.505603002005498E-003 3.599511771768547E-003 3.696060848666139E-003 + 3.795330419083960E-003 3.897403372979965E-003 4.002365406038758E-003 4.110305126076788E-003 + 4.221314163886315E-003 4.335487288714699E-003 4.452922528584508E-003 4.573721295669107E-003 + 4.697988516948120E-003 4.825832770377320E-003 4.957366426818012E-003 5.092705797981995E-003 + 5.231971290659733E-003 5.375287567511346E-003 5.522783714712642E-003 5.674593416761197E-003 + 5.830855138761627E-003 5.991712316522815E-003 6.157313554815226E-003 6.327812834151410E-003 + 6.503369726469309E-003 6.684149620114510E-003 6.870323954535005E-003 7.062070465120482E-003 + 7.259573438636906E-003 7.463023979726964E-003 7.672620288967447E-003 7.888567952995921E-003 + 8.111080247241463E-003 8.340378451817185E-003 8.576692181156151E-003 8.820259727997607E-003 + 9.071328422355911E-003 9.330155006131850E-003 9.597006024053631E-003 9.872158231664140E-003 + 1.015589902110079E-002 1.044852686544547E-002 1.075035178245487E-002 1.106169581851408E-002 + 1.138289355369163E-002 1.171429262880962E-002 1.205625429547975E-002 1.240915399009420E-002 + 1.277338193279997E-002 1.314934375252582E-002 1.353746113917354E-002 1.393817252412780E-002 + 1.435193379028442E-002 1.477921901284206E-002 1.522052123215009E-002 1.567635325995385E-002 + 1.614724852042768E-002 1.663376192743827E-002 1.713647079953222E-002 1.765597581419560E-002 + 1.819290200298778E-002 1.874789978920739E-002 1.932164606980552E-002 1.991484534331826E-002 + 2.052823088564993E-002 2.116256597559716E-002 2.181864517206452E-002 2.249729564498249E-002 + 2.319937856200019E-002 2.392579053308560E-002 2.467746511522817E-002 2.545537437949900E-002 + 2.626053054278528E-002 2.709398766657503E-002 2.795684342522781E-002 2.885024094622466E-002 + 2.977537072494697E-002 3.073347261658875E-002 3.172583790785778E-002 3.275381147117142E-002 + 3.381879400409774E-002 3.492224435683498E-002 3.606568195056020E-002 3.725068928950943E-002 + 3.847891456967910E-002 3.975207438705763E-002 4.107195654830934E-002 4.244042298683642E-002 + 4.385941278714023E-002 4.533094532038730E-002 4.685712349405909E-002 4.844013711852421E-002 + 5.008226639332022E-002 5.178588551586097E-002 5.355346641520162E-002 5.538758261338862E-002 + 5.729091321679826E-002 5.926624703971987E-002 6.131648686227249E-002 6.344465382454365E-002 + 6.565389195861815E-002 6.794747285990792E-002 7.032880049890591E-002 7.280141617416545E-002 + 7.536900360694104E-002 7.803539417752645E-002 8.080457230287598E-002 8.368068095460071E-002 + 8.666802731588247E-002 8.977108857525092E-002 9.299451785450608E-002 9.634315026734788E-002 + 9.982200910448874E-002 1.034363121401628E-001 1.071914780540157E-001 1.110931329613471E-001 + 1.151471170435794E-001 1.193594912696478E-001 1.237365441977241E-001 1.282847988453197E-001 + 1.330110196143328E-001 1.379222192560181E-001 1.430256658591728E-001 1.483288898430092E-001 + 1.538396909342593E-001 1.595661451059983E-001 1.655166114534812E-001 1.716997389799749E-001 + 1.781244732631067E-001 1.848000629696567E-001 1.917360661839851E-001 1.989423565124028E-001 + 2.064291289227767E-001 2.142069052754886E-001 2.222865394985604E-001 2.306792223563129E-001 + 2.393964857573356E-001 2.484502065438389E-001 2.578526097006177E-001 2.676162709179110E-001 + 2.777541184383887E-001 2.882794341143586E-001 2.992058535970820E-001 3.105473655758195E-001 + 3.223183099799514E-001 3.345333750532178E-001 3.472075932048730E-001 3.603563355383553E-001 + 3.739953049539719E-001 3.881405277181692E-001 4.028083433881987E-001 4.180153929774969E-001 + 4.337786052439137E-001 4.501151809801064E-001 4.670425751830544E-001 4.845784769778242E-001 + 5.027407871694659E-001 5.215475932964281E-001 5.410171420591287E-001 5.611678089984991E-001 + 5.820180653015261E-001 6.035864416141057E-001 6.258914887461138E-001 6.489517351595169E-001 + 6.727856411377919E-001 6.974115495440167E-001 7.228476330857826E-001 7.491118380178721E-001 + 7.762218242283851E-001 8.041949016709219E-001 8.330479631246307E-001 8.627974132855047E-001 + 8.934590942164167E-001 9.250482072099495E-001 9.575792311474079E-001 9.910658374692892E-001 + 1.025520801907094E+000 1.060955913163621E+000 1.097381878768746E+000 1.134808228379969E+000 + 1.173243214841684E+000 1.212693713363879E+000 1.253165119229536E+000 1.294661244490107E+000 + 1.337184214159558E+000 1.380734362469229E+000 1.425310129797445E+000 1.470907960939005E+000 + 1.517522205429156E+000 1.565145020684281E+000 1.613766278765669E+000 1.663373477612796E+000 + 1.713951657627408E+000 1.765483324517950E+000 1.817948379334614E+000 1.871324056636980E+000 + 1.925584871737658E+000 1.980702577955337E+000 2.036646134787552E+000 2.093381687876581E+000 + 2.150872561589577E+000 2.209079264965329E+000 2.267959511694610E+000 2.327468254697324E+000 + 2.387557735738300E+000 2.448177550383690E+000 2.509274728442136E+000 2.570793829860394E+000 + 2.632677055852185E+000 2.694864374834480E+000 2.757293662529005E+000 2.819900855361307E+000 + 2.882620116059604E+000 2.945384010123923E+000 3.008123691608776E+000 3.070769096444430E+000 + 3.133249141319005E+000 3.195491925962894E+000 3.257424936524561E+000 3.318975247610346E+000 + 3.380069720487266E+000 3.440635194923278E+000 3.500598672171879E+000 3.559887486701184E+000 + 3.618429464428150E+000 3.676153065448613E+000 3.732987509555040E+000 3.788862883207004E+000 + 3.843710227059597E+000 3.897461603658929E+000 3.950050145471439E+000 4.001410084013723E+000 + 4.051476761477645E+000 4.100186626881940E+000 4.147477219406374E+000 4.193287142152820E+000 + 4.237556030102594E+000 4.280224516474528E+000 4.321234202002930E+000 4.360527631823709E+000 + 4.398048284653127E+000 4.433740578746577E+000 4.467549898719685E+000 4.499422646691922E+000 + 4.529306320378326E+000 4.557149619721167E+000 4.582902582448924E+000 4.606516747618394E+000 + 4.627945344793874E+000 4.647143505119919E+000 4.664068489236158E+000 4.678679925861220E+000 + 4.690940054041390E+000 4.700813961619072E+000 4.708269812522362E+000 4.713279056086011E+000 + 4.715816612833983E+000 4.715861032994853E+000 4.713394626438886E+000 4.708403565616320E+000 + 4.700877966263681E+000 4.690811953875819E+000 4.678203726888217E+000 4.663055629774454E+000 + 4.645374250379410E+000 4.625170555280406E+000 4.602460074282587E+000 4.577263139815198E+000 + 4.549605178541126E+000 4.519517040521623E+000 4.487035335432531E+000 4.452202725252361E+000 + 4.415068098091987E+000 4.375686517730733E+000 4.334118806871822E+000 4.290430609317148E+000 + 4.244691140719679E+000 4.196972654065107E+000 4.147350215417223E+000 4.095901497906700E+000 + 4.042706570288598E+000 3.987847680895041E+000 3.931409037816736E+000 3.873476586149655E+000 + 3.814137783141754E+000 3.753481372069180E+000 3.691597155661506E+000 3.628575769882482E+000 + 3.564508458855321E+000 3.499486851701232E+000 3.433602742035853E+000 3.366947870841330E+000 + 3.299613713402093E+000 3.231691270960034E+000 3.163270867710215E+000 3.094441953721816E+000 + 3.025292914330387E+000 2.955910886507720E+000 2.886381582674431E+000 2.816789122381812E+000 + 2.747215872242813E+000 2.677742294443709E+000 2.608446804144489E+000 2.539405636019624E+000 + 2.470692720135497E+000 2.402379567346552E+000 2.334535164342100E+000 2.267225878426545E+000 + 2.200515372086003E+000 2.134464527356235E+000 2.069131379971317E+000 2.004571063238839E+000 + 1.940835761555869E+000 1.877974673449710E+000 1.816033983999606E+000 1.755056846469013E+000 + 1.695083372953769E+000 1.636150633828657E+000 1.578292665753740E+000 1.521540487982517E+000 + 1.465922126695638E+000 1.411462647067365E+000 1.358184192756274E+000 1.306106032497134E+000 + 1.255244613457327E+000 1.205613621008161E+000 1.157224044549334E+000 1.110084249013178E+000 + 1.064200051664210E+000 1.019574803799170E+000 9.762094769427444E-001 9.341027531250303E-001 + 8.932511188184122E-001 8.536489621040070E-001 8.152886726316125E-001 7.781607439320264E-001 + 7.422538776372712E-001 7.075550891626070E-001 6.740498144046407E-001 6.417220170124964E-001 + 6.105542957940100E-001 5.805279918265505E-001 5.516232948523041E-001 5.238193485507716E-001 + 4.970943542969151E-001 4.714256730316063E-001 4.467899248918353E-001 4.231630862712558E-001 + 4.005205840067597E-001 3.788373864140822E-001 3.580880909240159E-001 3.382470081003345E-001 + 3.192882418517020E-001 3.011857656810514E-001 2.839134948471927E-001 2.674453543448088E-001 + 2.517553426397708E-001 2.368175911266718E-001 2.226064193043215E-001 2.090963856924619E-001 + 1.962623345388483E-001 1.840794383899594E-001 1.725232366207477E-001 1.615696700388903E-001 + 1.511951116968792E-001 1.413763940608610E-001 1.320908326984295E-001 1.233162466585174E-001 + 1.150309757251445E-001 1.072138947331223E-001 9.984442513788835E-002 9.290254403357785E-002 + 8.636879081330652E-002 8.022427166355021E-002 7.445066208063483E-002 6.903020759181530E-002 + 6.394572285643356E-002 5.918058931437520E-002 5.471875153969888E-002 5.054471244712146E-002 + 4.664352748820030E-002 4.300079796281249E-002 3.960266356008539E-002 3.643579423150409E-002 + 3.348738148771539E-002 3.074512919973049E-002 2.819724397497777E-002 2.583242516909822E-002 + 2.363985458562404E-002 2.160918590782129E-002 1.973053390005569E-002 1.799446341009169E-002 + 1.639197819875241E-002 1.491450961932547E-002 1.355390516595688E-002 1.230241690795810E-002 + 1.115268982538878E-002 1.009775006037289E-002 9.130993098265329E-003 8.246171892909172E-003 + 7.437384950707605E-003 6.699064388984371E-003 6.025963985028384E-003 5.413147233227065E-003 + 4.855975428714141E-003 4.350095796921757E-003 3.891429689281100E-003 3.476160866011855E-003 + 3.100723887444692E-003 2.761792635607746E-003 2.456268987860445E-003 2.181271664169866E-003 + 1.934125269195867E-003 1.712349549687695E-003 1.513648886810273E-003 1.335902041928791E-003 + 1.177152173107029E-003 1.035597138141127E-003 9.095800983813123E-004 7.975804359164222E-004 + 6.982049949357855E-004 6.101796562673717E-004 5.323412522454973E-004 4.636298272103285E-004 + 4.030812471082376E-004 3.498201598676332E-004 3.030533064886101E-004 2.620631811234451E-004 + 2.262020368533378E-004 1.948862323972449E-004 1.675909136311306E-004 1.438450225583165E-004 + 1.232266252593443E-004 1.053585493664076E-004 8.990432075449645E-005 7.656438841862418E-005 + 6.507262591203287E-005 5.519309725068169E-005 4.671707483999613E-005 3.946029674504452E-005 + 3.326045049833026E-005 2.797487061285973E-005 2.347843703406808E-005 1.966166191418986E-005 + 1.642895231811492E-005 1.369703676192384E-005 1.139354383544059E-005 9.455721559682359E-006 + 7.829286570680156E-006 6.467392695023346E-006 5.329708981121490E-006 4.381597768188554E-006 + 3.593383903842351E-006 2.939706756071335E-006 2.398947200293272E-006 1.952722292436584E-006 + 1.585440860103848E-006 1.283913752182306E-006 1.037012979688743E-006 8.353744541081522E-007 + 6.711394827256097E-007 5.377306109250567E-007 4.296578085190342E-007 3.423513799272013E-007 + 2.720183360519935E-007 2.155192989388144E-007 1.702633189914308E-007 1.341189941825629E-007 + 1.053430416137545E-007 8.250164706248678E-008 6.442516024375438E-008 5.016293969008727E-008 + 3.894469424568933E-008 3.014819036176702E-008 2.327236202334659E-008 1.791499093686525E-008 + 1.375424011646401E-008 1.053342563710948E-008 8.048500403931213E-009 6.137801576873579E-009 + 4.673680961086374E-009 3.555696222094797E-009 2.705092010401698E-009 2.050710202213143E-009 + 1.549072556928544E-009 1.165908751825222E-009 8.743042091315888E-010 6.531988365311785E-010 + 4.861747861348464E-010 3.604813255627143E-010 2.662534700774652E-010 1.958883197675274E-010 + 1.435492384301916E-010 1.047732440351428E-010 7.616138313606007E-011 5.513554840468232E-011 + 3.974827183177851E-011 2.853457636723849E-011 2.039707511629042E-011 1.451723882766705E-011 + 1.028716928879450E-011 7.257370110087801E-012 5.096941581754378E-012 3.563380621620248E-012 + 2.479772335443879E-012 1.717643374504510E-012 1.184131713642948E-012 8.124315251013267E-013 + 5.547110933241880E-013 3.768890540057167E-013 2.548001699451448E-013 1.713949440664316E-013 + 1.147045515072835E-013 7.636942969912139E-014 5.058086422120955E-014 3.332360207401035E-014 + 2.183672303944284E-014 1.423191347249975E-014 9.224642166703026E-015 5.945876660183951E-015 + 3.810936814741767E-015 2.428656268013420E-015 1.538818466438771E-015 9.693127950493447E-016 + 6.069648071643465E-016 3.777926215694329E-016 2.337226531938202E-016 1.437050680789771E-016 + 8.780787169520823E-017 5.331514935702778E-017 3.216539719278915E-017 1.928027293303637E-017 + 1.148121443838776E-017 6.791674254266361E-018 3.990651116583259E-018 2.328904270031712E-018 + 1.349780290556214E-018 7.768554820825256E-019 4.439609363842891E-019 2.519056091632093E-019 + 1.418992729941321E-019 7.934726491569431E-020 4.404056861384094E-020 2.426063931613628E-020 + 1.326290390461898E-020 7.194825016371130E-021 3.872618619604420E-021 2.067993744085588E-021 + 1.095494725288831E-021 5.756307370596395E-022 2.999892976520704E-022 1.550424324575166E-022 + 7.945711171469990E-023 4.037440668994160E-023 2.033873418747260E-023 1.015637431893515E-023 + 5.026926285978212E-024 2.465850837928393E-024 1.198622351949128E-024 5.772971691064510E-025 + 2.754657097349085E-025 1.302074000989469E-025 6.096100202842944E-026 2.826600869372837E-026 + 1.297836063685569E-026 5.900169363239212E-027 2.655486311549716E-027 1.183051310409795E-027 + 5.216597216804307E-028 2.276348892617197E-028 9.828811870290515E-029 4.198711689539671E-029 + 1.774293071017529E-029 7.415998426107355E-030 3.065411811481451E-030 1.252916561940014E-030 + 5.063001282824324E-031 2.022479615329171E-031 7.985229061298544E-032 3.115686865019586E-032 + 1.201209376976367E-032 4.575268475181235E-033 1.721397084391520E-033 6.396537790950949E-034 + 2.347146934903795E-034 8.503507629296820E-035 3.041226086924514E-035 1.073547981734032E-035 + 3.739769662295298E-036 1.285424231248403E-036 4.358660341050868E-037 1.457774163724139E-037 + 4.808205014547398E-038 1.563705974195900E-038 5.013367389606135E-039 1.584266523563092E-039 + 4.933694059135546E-040 1.513845055862697E-040 4.575882464134242E-041 1.362292855611254E-041 + 3.993789889331086E-042 1.152749521427470E-042 3.275175085366430E-043 9.157937731156533E-044 + 2.519632030924495E-044 6.819686390488435E-045 1.815473870457028E-045 4.752512410907514E-046 + 1.223129321733529E-046 3.094171667328168E-047 7.692105337250774E-048 1.878795575081948E-048 + 4.507656584757881E-049 1.062090170441730E-049 2.457040356126323E-050 5.579603490058104E-051 + 1.243463631110288E-051 2.718934970795873E-052 5.831718139995266E-053 1.226650621347121E-053 + 2.529678043447530E-054 5.113539869592847E-055 1.012933018039598E-055 1.965765822736715E-056 + 3.736480290882348E-057 6.954404671032851E-058 1.267093385342866E-058 2.259395727226271E-059 + 3.941786920562265E-060 6.726541295152905E-061 1.122451215597719E-061 1.831039765431450E-062 + 2.919166223832182E-063 4.547002286966594E-064 6.917828495160245E-065 1.027694556185183E-065 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 +/ diff --git a/tests/apps/miniDFT/tests/test/QE_Si_333.out.ref b/tests/apps/miniDFT/tests/test/QE_Si_333.out.ref new file mode 100644 index 0000000000..b4f40d2890 --- /dev/null +++ b/tests/apps/miniDFT/tests/test/QE_Si_333.out.ref @@ -0,0 +1,425 @@ + + Program PWSCF v.5.0 starts on 2Nov2012 at 14:58:27 + + This program is part of the open-source Quantum ESPRESSO suite + for quantum simulation of materials; please cite + "P. Giannozzi et al., J. Phys.:Condens. Matter 21 395502 (2009); + URL http://www.quantum-espresso.org", + in publications or presentations arising from this work. More details at + http://www.quantum-espresso.org/quote.php + + Parallel version (MPI), running on 24 processors + R & G space division: proc/pool = 24 + + Current dimensions of program PWSCF are: + Max number of different atomic species (ntypx) = 10 + Max number of k-points (npk) = 40000 + Max angular momentum in pseudopotentials (lmaxx) = 3 + Reading input from QE_Si_333.in + + Subspace diagonalization in iterative solution of the eigenvalue problem: + scalapack distributed-memory algorithm (size of sub-group: 3* 3 procs) + + Found symmetry operation: I + ( 0.0000 0.0000 0.3333) + This is a supercell, fractional translations are disabled + + Parallelization info + -------------------- + sticks: dense smooth PW G-vecs: dense smooth PW + Min 162 162 43 6733 6733 924 + Max 163 163 44 6739 6739 928 + Sum 3901 3901 1039 161653 161653 22219 + + + + bravais-lattice index = 0 + lattice parameter (alat) = 10.2612 a.u. + unit-cell volume = 7292.8659 (a.u.)^3 + number of atoms/cell = 54 + number of atomic types = 1 + number of electrons = 216.00 + number of Kohn-Sham states= 108 + kinetic-energy cutoff = 30.0000 Ry + charge density cutoff = 120.0000 Ry + convergence threshold = 1.0E-10 + mixing beta = 0.7000 + number of iterations used = 8 plain mixing + Exchange-correlation = PZ ( 1 1 0 0 0) + EXX-fraction = 0.00 + + celldm(1)= 10.261200 celldm(2)= 0.000000 celldm(3)= 0.000000 + celldm(4)= 0.000000 celldm(5)= 0.000000 celldm(6)= 0.000000 + + crystal axes: (cart. coord. in units of alat) + a(1) = ( 0.000000 1.500000 1.500000 ) + a(2) = ( 1.500000 0.000000 1.500000 ) + a(3) = ( 1.500000 1.500000 0.000000 ) + + reciprocal axes: (cart. coord. in units 2 pi/alat) + b(1) = ( -0.333333 0.333333 0.333333 ) + b(2) = ( 0.333333 -0.333333 0.333333 ) + b(3) = ( 0.333333 0.333333 -0.333333 ) + + + PseudoPot. # 1 for Si read from file: + ./Si.UPF + MD5 check sum: 2b84a5024e7ea64828ec672373b6cfd7 + Pseudo is Norm-conserving, Zval = 4.0 + Generated using "atomic" code by A. Dal Corso (Quantum ESPRESSO distribution) + Using radial grid of 1141 points, 2 beta functions with: + l(1) = 0 + l(2) = 1 + + atomic species valence mass pseudopotential + Si 4.00 28.08600 Si( 1.00) + + 24 Sym. Ops. (no inversion) found + + + + Cartesian axes + + site n. atom positions (alat units) + 1 Si tau( 1) = ( 0.0000000 0.0000000 0.0000000 ) + 2 Si tau( 2) = ( 0.2500000 0.2500000 0.2500000 ) + 3 Si tau( 3) = ( 0.5000000 0.5000000 0.0000000 ) + 4 Si tau( 4) = ( 0.7500000 0.7500000 0.2500000 ) + 5 Si tau( 5) = ( 1.0000000 1.0000000 0.0000000 ) + 6 Si tau( 6) = ( 1.2500000 1.2500000 0.2500000 ) + 7 Si tau( 7) = ( 0.5000000 0.0000000 0.5000000 ) + 8 Si tau( 8) = ( 0.7500000 0.2500000 0.7500000 ) + 9 Si tau( 9) = ( 1.0000000 0.5000000 0.5000000 ) + 10 Si tau( 10) = ( 1.2500000 0.7500000 0.7500000 ) + 11 Si tau( 11) = ( 1.5000000 1.0000000 0.5000000 ) + 12 Si tau( 12) = ( 1.7500000 1.2500000 0.7500000 ) + 13 Si tau( 13) = ( 1.0000000 0.0000000 1.0000000 ) + 14 Si tau( 14) = ( 1.2500000 0.2500000 1.2500000 ) + 15 Si tau( 15) = ( 1.5000000 0.5000000 1.0000000 ) + 16 Si tau( 16) = ( 1.7500000 0.7500000 1.2500000 ) + 17 Si tau( 17) = ( 2.0000000 1.0000000 1.0000000 ) + 18 Si tau( 18) = ( 2.2500000 1.2500000 1.2500000 ) + 19 Si tau( 19) = ( 0.0000000 0.5000000 0.5000000 ) + 20 Si tau( 20) = ( 0.2500000 0.7500000 0.7500000 ) + 21 Si tau( 21) = ( 0.5000000 1.0000000 0.5000000 ) + 22 Si tau( 22) = ( 0.7500000 1.2500000 0.7500000 ) + 23 Si tau( 23) = ( 1.0000000 1.5000000 0.5000000 ) + 24 Si tau( 24) = ( 1.2500000 1.7500000 0.7500000 ) + 25 Si tau( 25) = ( 0.5000000 0.5000000 1.0000000 ) + 26 Si tau( 26) = ( 0.7500000 0.7500000 1.2500000 ) + 27 Si tau( 27) = ( 1.0000000 1.0000000 1.0000000 ) + 28 Si tau( 28) = ( 1.2500000 1.2500000 1.2500000 ) + 29 Si tau( 29) = ( 1.5000000 1.5000000 1.0000000 ) + 30 Si tau( 30) = ( 1.7500000 1.7500000 1.2500000 ) + 31 Si tau( 31) = ( 1.0000000 0.5000000 1.5000000 ) + 32 Si tau( 32) = ( 1.2500000 0.7500000 1.7500000 ) + 33 Si tau( 33) = ( 1.5000000 1.0000000 1.5000000 ) + 34 Si tau( 34) = ( 1.7500000 1.2500000 1.7500000 ) + 35 Si tau( 35) = ( 2.0000000 1.5000000 1.5000000 ) + 36 Si tau( 36) = ( 2.2500000 1.7500000 1.7500000 ) + 37 Si tau( 37) = ( 0.0000000 1.0000000 1.0000000 ) + 38 Si tau( 38) = ( 0.2500000 1.2500000 1.2500000 ) + 39 Si tau( 39) = ( 0.5000000 1.5000000 1.0000000 ) + 40 Si tau( 40) = ( 0.7500000 1.7500000 1.2500000 ) + 41 Si tau( 41) = ( 1.0000000 2.0000000 1.0000000 ) + 42 Si tau( 42) = ( 1.2500000 2.2500000 1.2500000 ) + 43 Si tau( 43) = ( 0.5000000 1.0000000 1.5000000 ) + 44 Si tau( 44) = ( 0.7500000 1.2500000 1.7500000 ) + 45 Si tau( 45) = ( 1.0000000 1.5000000 1.5000000 ) + 46 Si tau( 46) = ( 1.2500000 1.7500000 1.7500000 ) + 47 Si tau( 47) = ( 1.5000000 2.0000000 1.5000000 ) + 48 Si tau( 48) = ( 1.7500000 2.2500000 1.7500000 ) + 49 Si tau( 49) = ( 1.0000000 1.0000000 2.0000000 ) + 50 Si tau( 50) = ( 1.2500000 1.2500000 2.2500000 ) + 51 Si tau( 51) = ( 1.5000000 1.5000000 2.0000000 ) + 52 Si tau( 52) = ( 1.7500000 1.7500000 2.2500000 ) + 53 Si tau( 53) = ( 2.0000000 2.0000000 2.0000000 ) + 54 Si tau( 54) = ( 2.2500000 2.2500000 2.2500000 ) + + number of k points= 1 + cart. coord. in units 2pi/alat + k( 1) = ( -0.1666667 -0.1666667 -0.1666667), wk = 2.0000000 + + Dense grid: 161653 G-vectors FFT dimensions: ( 75, 75, 75) + + Largest allocated arrays est. size (Mb) dimensions + Kohn-Sham Wavefunctions 1.40 Mb ( 851, 108) + NL pseudopotentials 2.80 Mb ( 851, 216) + Each V/rho on FFT grid 0.34 Mb ( 22500) + Each G-vector array 0.05 Mb ( 6734) + G-vector shells 0.01 Mb ( 931) + Largest temporary arrays est. size (Mb) dimensions + Auxiliary wavefunctions 5.61 Mb ( 851, 432) + Each subspace H/S matrix 0.32 Mb ( 144, 144) + Each matrix 0.36 Mb ( 216, 108) + Arrays for rho mixing 2.75 Mb ( 22500, 8) + writing wfc files to a dedicated directory + + Initial potential from superposition of free atoms + + starting charge 215.97322, renormalised to 216.00000 + Starting wfc are 216 randomized atomic wfcs + + total cpu time spent up to now is 1.5 secs + + per-process dynamical memory: 13.0 Mb + + Self-consistent Calculation + + iteration # 1 ecut= 30.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 1.00E-02, avg # of iterations = 2.0 + + Threshold (ethr) on eigenvalues was too large: + Diagonalizing with lowered threshold + + Davidson diagonalization with overlap + ethr = 7.73E-04, avg # of iterations = 1.0 + + total cpu time spent up to now is 4.5 secs + + total energy = -428.20916922 Ry + Harris-Foulkes estimate = -428.74955308 Ry + estimated scf accuracy < 1.63888300 Ry + + iteration # 2 ecut= 30.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 7.59E-04, avg # of iterations = 1.0 + + total cpu time spent up to now is 5.7 secs + + total energy = -428.28529928 Ry + Harris-Foulkes estimate = -428.29401272 Ry + estimated scf accuracy < 0.06080148 Ry + + iteration # 3 ecut= 30.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 2.81E-05, avg # of iterations = 3.0 + + total cpu time spent up to now is 7.5 secs + + total energy = -428.29570367 Ry + Harris-Foulkes estimate = -428.29646513 Ry + estimated scf accuracy < 0.00178094 Ry + + iteration # 4 ecut= 30.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 8.25E-07, avg # of iterations = 4.0 + + total cpu time spent up to now is 9.5 secs + + total energy = -428.29615816 Ry + Harris-Foulkes estimate = -428.29622435 Ry + estimated scf accuracy < 0.00014192 Ry + + iteration # 5 ecut= 30.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 6.57E-08, avg # of iterations = 3.0 + + total cpu time spent up to now is 11.4 secs + + total energy = -428.29618044 Ry + Harris-Foulkes estimate = -428.29618761 Ry + estimated scf accuracy < 0.00002129 Ry + + iteration # 6 ecut= 30.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 9.86E-09, avg # of iterations = 3.0 + + total cpu time spent up to now is 13.6 secs + + total energy = -428.29618340 Ry + Harris-Foulkes estimate = -428.29618391 Ry + estimated scf accuracy < 0.00000153 Ry + + iteration # 7 ecut= 30.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 7.09E-10, avg # of iterations = 2.0 + + total cpu time spent up to now is 15.1 secs + + total energy = -428.29618341 Ry + Harris-Foulkes estimate = -428.29618355 Ry + estimated scf accuracy < 0.00000030 Ry + + iteration # 8 ecut= 30.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 1.38E-10, avg # of iterations = 2.0 + + total cpu time spent up to now is 16.8 secs + + total energy = -428.29618346 Ry + Harris-Foulkes estimate = -428.29618346 Ry + estimated scf accuracy < 0.00000002 Ry + + iteration # 9 ecut= 30.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 7.87E-12, avg # of iterations = 4.0 + + total cpu time spent up to now is 18.5 secs + + total energy = -428.29618346 Ry + Harris-Foulkes estimate = -428.29618346 Ry + estimated scf accuracy < 4.7E-09 Ry + + iteration # 10 ecut= 30.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 2.19E-12, avg # of iterations = 2.0 + + total cpu time spent up to now is 19.8 secs + + total energy = -428.29618346 Ry + Harris-Foulkes estimate = -428.29618346 Ry + estimated scf accuracy < 8.6E-10 Ry + + iteration # 11 ecut= 30.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 3.98E-13, avg # of iterations = 3.0 + + total cpu time spent up to now is 21.6 secs + + End of self-consistent calculation + + k =-0.1667-0.1667-0.1667 ( 20214 PWs) bands (ev): + + -5.5353 -5.5353 -4.5952 -4.5952 -4.5952 -4.5952 -4.5952 -4.5952 + -3.7845 -3.7845 -3.7845 -3.7845 -3.7845 -3.7845 -3.5509 -2.8242 + -2.8242 -2.8242 -2.8242 -2.8242 -2.8242 -2.6110 -2.6110 -2.6110 + -2.6110 -2.6110 -2.6110 -0.9456 -0.7878 -0.7878 -0.7878 -0.7878 + -0.7878 -0.7878 -0.5016 -0.5016 -0.5016 -0.5016 -0.5016 -0.5016 + 0.0323 0.0323 0.0323 0.0323 0.0323 0.0323 1.6042 1.6042 + 1.6042 1.6042 1.6042 1.6042 1.9956 1.9956 1.9956 1.9956 + 1.9956 1.9956 2.3733 2.3733 2.3733 2.3733 2.3733 2.3733 + 2.9660 2.9660 2.9660 2.9660 2.9660 2.9660 3.2487 3.2487 + 3.2487 3.2487 3.2487 3.2487 3.4660 3.4660 3.4660 3.4660 + 3.4660 3.4660 3.6432 3.6432 4.0230 4.0230 4.0230 4.0230 + 4.0230 4.0230 4.2730 4.2730 4.2730 4.2730 4.2730 4.2730 + 4.7224 4.7224 4.7224 4.7224 4.7224 4.7224 4.8213 4.8213 + 5.5652 5.5652 5.5652 5.5652 + +! total energy = -428.29618346 Ry + Harris-Foulkes estimate = -428.29618346 Ry + estimated scf accuracy < 6.0E-11 Ry + + The total energy is the sum of the following terms: + + one-electron contribution = 125.18806103 Ry + hartree contribution = 29.53512379 Ry + xc contribution = -129.44731918 Ry + ewald contribution = -453.57204910 Ry + + convergence has been achieved in 11 iterations + + Forces acting on atoms (Ry/au): + + atom 1 type 1 force = 0.00000000 0.00000000 0.00000000 + atom 2 type 1 force = -0.00000002 -0.00000002 -0.00000002 + atom 3 type 1 force = 0.00000002 0.00000002 0.00000011 + atom 4 type 1 force = 0.00000000 0.00000000 -0.00000011 + atom 5 type 1 force = -0.00000002 -0.00000002 0.00000011 + atom 6 type 1 force = 0.00000002 0.00000002 -0.00000002 + atom 7 type 1 force = 0.00000002 0.00000011 0.00000002 + atom 8 type 1 force = 0.00000000 -0.00000011 0.00000000 + atom 9 type 1 force = -0.00000004 0.00000004 0.00000004 + atom 10 type 1 force = 0.00000011 0.00000000 0.00000000 + atom 11 type 1 force = -0.00000011 -0.00000002 0.00000002 + atom 12 type 1 force = 0.00000009 -0.00000009 0.00000003 + atom 13 type 1 force = -0.00000002 0.00000011 -0.00000002 + atom 14 type 1 force = 0.00000002 -0.00000002 0.00000002 + atom 15 type 1 force = -0.00000011 0.00000002 -0.00000002 + atom 16 type 1 force = 0.00000009 0.00000003 -0.00000009 + atom 17 type 1 force = -0.00000003 0.00000003 0.00000003 + atom 18 type 1 force = -0.00000003 -0.00000009 -0.00000009 + atom 19 type 1 force = 0.00000011 0.00000002 0.00000002 + atom 20 type 1 force = -0.00000011 0.00000000 0.00000000 + atom 21 type 1 force = 0.00000004 -0.00000004 0.00000004 + atom 22 type 1 force = 0.00000000 0.00000011 0.00000000 + atom 23 type 1 force = -0.00000002 -0.00000011 0.00000002 + atom 24 type 1 force = -0.00000009 0.00000009 0.00000003 + atom 25 type 1 force = 0.00000004 0.00000004 -0.00000004 + atom 26 type 1 force = 0.00000000 0.00000000 0.00000011 + atom 27 type 1 force = -0.00000004 -0.00000004 -0.00000004 + atom 28 type 1 force = 0.00000007 0.00000007 0.00000007 + atom 29 type 1 force = 0.00000000 0.00000000 0.00000014 + atom 30 type 1 force = -0.00000007 -0.00000007 0.00000007 + atom 31 type 1 force = -0.00000002 0.00000002 -0.00000011 + atom 32 type 1 force = -0.00000009 0.00000003 0.00000009 + atom 33 type 1 force = 0.00000000 0.00000014 0.00000000 + atom 34 type 1 force = -0.00000007 0.00000007 -0.00000007 + atom 35 type 1 force = -0.00000014 0.00000000 0.00000000 + atom 36 type 1 force = -0.00000003 0.00000009 0.00000009 + atom 37 type 1 force = 0.00000011 -0.00000002 -0.00000002 + atom 38 type 1 force = -0.00000002 0.00000002 0.00000002 + atom 39 type 1 force = 0.00000002 -0.00000011 -0.00000002 + atom 40 type 1 force = 0.00000003 0.00000009 -0.00000009 + atom 41 type 1 force = 0.00000003 -0.00000003 0.00000003 + atom 42 type 1 force = -0.00000009 -0.00000003 -0.00000009 + atom 43 type 1 force = 0.00000002 -0.00000002 -0.00000011 + atom 44 type 1 force = 0.00000003 -0.00000009 0.00000009 + atom 45 type 1 force = 0.00000014 0.00000000 0.00000000 + atom 46 type 1 force = 0.00000007 -0.00000007 -0.00000007 + atom 47 type 1 force = 0.00000000 -0.00000014 0.00000000 + atom 48 type 1 force = 0.00000009 -0.00000003 0.00000009 + atom 49 type 1 force = 0.00000003 0.00000003 -0.00000003 + atom 50 type 1 force = -0.00000009 -0.00000009 -0.00000003 + atom 51 type 1 force = 0.00000000 0.00000000 -0.00000014 + atom 52 type 1 force = 0.00000009 0.00000009 -0.00000003 + atom 53 type 1 force = -0.00000003 -0.00000003 -0.00000003 + atom 54 type 1 force = 0.00000000 0.00000000 0.00000000 + + Total force = 0.000001 Total SCF correction = 0.000016 + SCF correction compared to forces is large: reduce conv_thr to get better values + + + entering subroutine stress ... + + total stress (Ry/bohr**3) (kbar) P= -29.12 + -0.00019795 0.00000000 0.00000000 -29.12 0.00 0.00 + 0.00000000 -0.00019795 0.00000000 0.00 -29.12 0.00 + 0.00000000 0.00000000 -0.00019795 0.00 0.00 -29.12 + + + init_run : 1.26s CPU 1.36s WALL ( 1 calls) + electrons : 18.41s CPU 20.07s WALL ( 1 calls) + forces : 0.20s CPU 0.20s WALL ( 1 calls) + stress : 0.72s CPU 0.72s WALL ( 1 calls) + + Called by init_run: + wfcinit : 0.90s CPU 0.92s WALL ( 1 calls) + potinit : 0.05s CPU 0.05s WALL ( 1 calls) + + Called by electrons: + c_bands : 16.23s CPU 16.49s WALL ( 12 calls) + sum_band : 1.86s CPU 1.89s WALL ( 12 calls) + v_of_rho : 0.09s CPU 0.09s WALL ( 12 calls) + mix_rho : 0.07s CPU 0.07s WALL ( 12 calls) + + Called by c_bands: + init_us_2 : 0.05s CPU 0.09s WALL ( 25 calls) + cegterg : 16.11s CPU 16.38s WALL ( 12 calls) + + Called by *egterg: + h_psi : 11.99s CPU 12.10s WALL ( 43 calls) + g_psi : 0.03s CPU 0.03s WALL ( 30 calls) + cdiaghg : 2.14s CPU 2.17s WALL ( 41 calls) + + Called by h_psi: + add_vuspsi : 0.72s CPU 0.79s WALL ( 43 calls) + + General routines + calbec : 0.96s CPU 0.95s WALL ( 45 calls) + fft : 0.16s CPU 0.14s WALL ( 54 calls) + fftw : 11.71s CPU 11.49s WALL ( 8390 calls) + + Parallel routines + fft_scatter : 7.48s CPU 5.37s WALL ( 8444 calls) + EXX routines + + PWSCF : 20.69s CPU 23.64s WALL + + + This run was terminated on: 14:58:51 2Nov2012 + +=------------------------------------------------------------------------------= + JOB DONE. +=------------------------------------------------------------------------------= +Application 12692069 resources: utime ~530s, stime ~12s Rss ~36652 inblocks ~44174 outblocks ~110200 diff --git a/tests/apps/miniDFT/tests/test/QE_TiO2_222.out.ref b/tests/apps/miniDFT/tests/test/QE_TiO2_222.out.ref new file mode 100644 index 0000000000..c4ff46f229 --- /dev/null +++ b/tests/apps/miniDFT/tests/test/QE_TiO2_222.out.ref @@ -0,0 +1,665 @@ + + Program PWSCF v.5.0 starts on 2Nov2012 at 15: 0:10 + + This program is part of the open-source Quantum ESPRESSO suite + for quantum simulation of materials; please cite + "P. Giannozzi et al., J. Phys.:Condens. Matter 21 395502 (2009); + URL http://www.quantum-espresso.org", + in publications or presentations arising from this work. More details at + http://www.quantum-espresso.org/quote.php + + Parallel version (MPI), running on 24 processors + R & G space division: proc/pool = 24 + + Current dimensions of program PWSCF are: + Max number of different atomic species (ntypx) = 10 + Max number of k-points (npk) = 40000 + Max angular momentum in pseudopotentials (lmaxx) = 3 + Reading input from QE_TiO2_2.in + + Subspace diagonalization in iterative solution of the eigenvalue problem: + scalapack distributed-memory algorithm (size of sub-group: 3* 3 procs) + + Found symmetry operation: I + ( 0.0000 0.0000 -0.5000) + This is a supercell, fractional translations are disabled + + Parallelization info + -------------------- + sticks: dense smooth PW G-vecs: dense smooth PW + Min 407 407 109 19381 19381 2703 + Max 408 408 110 19384 19384 2706 + Sum 9777 9777 2617 465167 465167 64917 + + + + bravais-lattice index = 0 + lattice parameter (alat) = 8.7671 a.u. + unit-cell volume = 3442.5370 (a.u.)^3 + number of atoms/cell = 48 + number of atomic types = 2 + number of electrons = 384.00 + number of Kohn-Sham states= 192 + kinetic-energy cutoff = 100.0000 Ry + charge density cutoff = 400.0000 Ry + convergence threshold = 1.0E-10 + mixing beta = 0.7000 + number of iterations used = 8 plain mixing + Exchange-correlation = PBE ( 1 4 3 4 0) + EXX-fraction = 0.00 + + celldm(1)= 8.767100 celldm(2)= 0.000000 celldm(3)= 0.000000 + celldm(4)= 0.000000 celldm(5)= 0.000000 celldm(6)= 0.000000 + + crystal axes: (cart. coord. in units of alat) + a(1) = ( 2.000000 0.000000 0.000000 ) + a(2) = ( 0.000000 2.000000 0.000000 ) + a(3) = ( 0.000000 0.000000 1.277176 ) + + reciprocal axes: (cart. coord. in units 2 pi/alat) + b(1) = ( 0.500000 0.000000 0.000000 ) + b(2) = ( 0.000000 0.500000 0.000000 ) + b(3) = ( 0.000000 0.000000 0.782977 ) + + + PseudoPot. # 1 for Ti read from file: + ./Ti.UPF + MD5 check sum: 62dbf2fbf73916fd320f8d494e62af35 + Pseudo is Norm-conserving, Zval = 12.0 + Generated using "atomic" code by A. Dal Corso (Quantum ESPRESSO distribution) + Using radial grid of 1177 points, 2 beta functions with: + l(1) = 1 + l(2) = 2 + + PseudoPot. # 2 for O read from file: + ./O.UPF + MD5 check sum: da7678121fb76f7377a20687ab6aa51b + Pseudo is Norm-conserving, Zval = 6.0 + Generated using "atomic" code by A. Dal Corso (Quantum ESPRESSO distribution) + Using radial grid of 1095 points, 1 beta functions with: + l(1) = 0 + + atomic species valence mass pseudopotential + Ti 12.00 47.86700 Ti( 1.00) + O 6.00 15.99940 O( 1.00) + + 8 Sym. Ops., with inversion, found + + + + Cartesian axes + + site n. atom positions (alat units) + 1 Ti tau( 1) = ( 0.0000000 0.0000000 0.0000000 ) + 2 Ti tau( 2) = ( 0.5000000 0.5000000 0.3192940 ) + 3 O tau( 3) = ( 0.3050877 0.3050877 0.0000000 ) + 4 O tau( 4) = ( -0.3050877 -0.3050877 0.0000000 ) + 5 O tau( 5) = ( 0.8050877 0.1949123 0.3192940 ) + 6 O tau( 6) = ( 0.1949123 0.8050877 0.3192940 ) + 7 Ti tau( 7) = ( 0.0000000 0.0000000 0.6385880 ) + 8 Ti tau( 8) = ( 0.5000000 0.5000000 0.9578820 ) + 9 O tau( 9) = ( 0.3050877 0.3050877 0.6385880 ) + 10 O tau( 10) = ( -0.3050877 -0.3050877 0.6385880 ) + 11 O tau( 11) = ( 0.8050877 0.1949123 0.9578820 ) + 12 O tau( 12) = ( 0.1949123 0.8050877 0.9578820 ) + 13 Ti tau( 13) = ( 0.0000000 1.0000000 0.0000000 ) + 14 Ti tau( 14) = ( 0.5000000 1.5000000 0.3192940 ) + 15 O tau( 15) = ( 0.3050877 1.3050877 0.0000000 ) + 16 O tau( 16) = ( -0.3050877 0.6949123 0.0000000 ) + 17 O tau( 17) = ( 0.8050877 1.1949123 0.3192940 ) + 18 O tau( 18) = ( 0.1949123 1.8050877 0.3192940 ) + 19 Ti tau( 19) = ( 0.0000000 1.0000000 0.6385880 ) + 20 Ti tau( 20) = ( 0.5000000 1.5000000 0.9578820 ) + 21 O tau( 21) = ( 0.3050877 1.3050877 0.6385880 ) + 22 O tau( 22) = ( -0.3050877 0.6949123 0.6385880 ) + 23 O tau( 23) = ( 0.8050877 1.1949123 0.9578820 ) + 24 O tau( 24) = ( 0.1949123 1.8050877 0.9578820 ) + 25 Ti tau( 25) = ( 1.0000000 0.0000000 0.0000000 ) + 26 Ti tau( 26) = ( 1.5000000 0.5000000 0.3192940 ) + 27 O tau( 27) = ( 1.3050877 0.3050877 0.0000000 ) + 28 O tau( 28) = ( 0.6949123 -0.3050877 0.0000000 ) + 29 O tau( 29) = ( 1.8050877 0.1949123 0.3192940 ) + 30 O tau( 30) = ( 1.1949123 0.8050877 0.3192940 ) + 31 Ti tau( 31) = ( 1.0000000 0.0000000 0.6385880 ) + 32 Ti tau( 32) = ( 1.5000000 0.5000000 0.9578820 ) + 33 O tau( 33) = ( 1.3050877 0.3050877 0.6385880 ) + 34 O tau( 34) = ( 0.6949123 -0.3050877 0.6385880 ) + 35 O tau( 35) = ( 1.8050877 0.1949123 0.9578820 ) + 36 O tau( 36) = ( 1.1949123 0.8050877 0.9578820 ) + 37 Ti tau( 37) = ( 1.0000000 1.0000000 0.0000000 ) + 38 Ti tau( 38) = ( 1.5000000 1.5000000 0.3192940 ) + 39 O tau( 39) = ( 1.3050877 1.3050877 0.0000000 ) + 40 O tau( 40) = ( 0.6949123 0.6949123 0.0000000 ) + 41 O tau( 41) = ( 1.8050877 1.1949123 0.3192940 ) + 42 O tau( 42) = ( 1.1949123 1.8050877 0.3192940 ) + 43 Ti tau( 43) = ( 1.0000000 1.0000000 0.6385880 ) + 44 Ti tau( 44) = ( 1.5000000 1.5000000 0.9578820 ) + 45 O tau( 45) = ( 1.3050877 1.3050877 0.6385880 ) + 46 O tau( 46) = ( 0.6949123 0.6949123 0.6385880 ) + 47 O tau( 47) = ( 1.8050877 1.1949123 0.9578820 ) + 48 O tau( 48) = ( 1.1949123 1.8050877 0.9578820 ) + + number of k points= 1 + cart. coord. in units 2pi/alat + k( 1) = ( -0.2500000 -0.2500000 -0.3914887), wk = 2.0000000 + + Dense grid: 465167 G-vectors FFT dimensions: ( 120, 120, 72) + + Largest allocated arrays est. size (Mb) dimensions + Kohn-Sham Wavefunctions 7.14 Mb ( 2436, 192) + NL pseudopotentials 5.95 Mb ( 2436, 160) + Each V/rho on FFT grid 0.66 Mb ( 43200) + Each G-vector array 0.15 Mb ( 19383) + G-vector shells 0.06 Mb ( 7897) + Largest temporary arrays est. size (Mb) dimensions + Auxiliary wavefunctions 28.55 Mb ( 2436, 768) + Each subspace H/S matrix 1.00 Mb ( 256, 256) + Each matrix 0.47 Mb ( 160, 192) + Arrays for rho mixing 5.27 Mb ( 43200, 8) + writing wfc files to a dedicated directory + + Initial potential from superposition of free atoms + + starting charge 319.99995, renormalised to 384.00000 + Starting wfc are 272 randomized atomic wfcs + + total cpu time spent up to now is 5.1 secs + + per-process dynamical memory: 36.5 Mb + + Self-consistent Calculation + + iteration # 1 ecut= 100.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 1.00E-02, avg # of iterations = 2.0 + + total cpu time spent up to now is 13.5 secs + + total energy = -2884.42141711 Ry + Harris-Foulkes estimate = -2906.91049596 Ry + estimated scf accuracy < 31.81354340 Ry + + iteration # 2 ecut= 100.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 8.28E-03, avg # of iterations = 2.0 + + total cpu time spent up to now is 21.5 secs + + total energy = -2892.13100419 Ry + Harris-Foulkes estimate = -2893.85752594 Ry + estimated scf accuracy < 2.81830807 Ry + + iteration # 3 ecut= 100.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 7.34E-04, avg # of iterations = 5.0 + + total cpu time spent up to now is 34.2 secs + + total energy = -2892.40618315 Ry + Harris-Foulkes estimate = -2896.56363395 Ry + estimated scf accuracy < 27.57647255 Ry + + iteration # 4 ecut= 100.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 7.34E-04, avg # of iterations = 5.0 + + total cpu time spent up to now is 45.4 secs + + total energy = -2893.65314169 Ry + Harris-Foulkes estimate = -2894.01604806 Ry + estimated scf accuracy < 1.76379667 Ry + + iteration # 5 ecut= 100.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 4.59E-04, avg # of iterations = 1.0 + + total cpu time spent up to now is 50.3 secs + + total energy = -2893.51723641 Ry + Harris-Foulkes estimate = -2893.69978961 Ry + estimated scf accuracy < 0.77822505 Ry + + iteration # 6 ecut= 100.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 2.03E-04, avg # of iterations = 4.0 + + total cpu time spent up to now is 59.4 secs + + total energy = -2893.74503872 Ry + Harris-Foulkes estimate = -2893.75696816 Ry + estimated scf accuracy < 0.05309055 Ry + + iteration # 7 ecut= 100.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 1.38E-05, avg # of iterations = 2.0 + + total cpu time spent up to now is 65.0 secs + + total energy = -2893.73983165 Ry + Harris-Foulkes estimate = -2893.74801239 Ry + estimated scf accuracy < 0.02242147 Ry + + iteration # 8 ecut= 100.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 5.84E-06, avg # of iterations = 4.0 + + total cpu time spent up to now is 75.1 secs + + total energy = -2893.74900970 Ry + Harris-Foulkes estimate = -2893.74956765 Ry + estimated scf accuracy < 0.00722472 Ry + + iteration # 9 ecut= 100.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 1.88E-06, avg # of iterations = 1.0 + + total cpu time spent up to now is 80.0 secs + + total energy = -2893.74814739 Ry + Harris-Foulkes estimate = -2893.74906370 Ry + estimated scf accuracy < 0.00588493 Ry + + iteration # 10 ecut= 100.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 1.53E-06, avg # of iterations = 1.0 + + total cpu time spent up to now is 84.9 secs + + total energy = -2893.74811231 Ry + Harris-Foulkes estimate = -2893.74827486 Ry + estimated scf accuracy < 0.00310783 Ry + + iteration # 11 ecut= 100.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 8.09E-07, avg # of iterations = 1.0 + + total cpu time spent up to now is 89.9 secs + + total energy = -2893.74799681 Ry + Harris-Foulkes estimate = -2893.74818422 Ry + estimated scf accuracy < 0.00265147 Ry + + iteration # 12 ecut= 100.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 6.90E-07, avg # of iterations = 3.0 + + total cpu time spent up to now is 95.2 secs + + total energy = -2893.74818471 Ry + Harris-Foulkes estimate = -2893.74808635 Ry + estimated scf accuracy < 0.00169862 Ry + + iteration # 13 ecut= 100.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 4.42E-07, avg # of iterations = 3.0 + + total cpu time spent up to now is 100.6 secs + + total energy = -2893.74808241 Ry + Harris-Foulkes estimate = -2893.74823701 Ry + estimated scf accuracy < 0.00167293 Ry + + iteration # 14 ecut= 100.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 4.36E-07, avg # of iterations = 3.0 + + total cpu time spent up to now is 106.3 secs + + total energy = -2893.74852071 Ry + Harris-Foulkes estimate = -2893.74818549 Ry + estimated scf accuracy < 0.00068989 Ry + + iteration # 15 ecut= 100.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 1.80E-07, avg # of iterations = 4.0 + + total cpu time spent up to now is 113.6 secs + + total energy = -2893.74846301 Ry + Harris-Foulkes estimate = -2893.74862653 Ry + estimated scf accuracy < 0.00200325 Ry + + iteration # 16 ecut= 100.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 1.80E-07, avg # of iterations = 1.0 + + total cpu time spent up to now is 118.5 secs + + total energy = -2893.74805819 Ry + Harris-Foulkes estimate = -2893.74847641 Ry + estimated scf accuracy < 0.00162460 Ry + + iteration # 17 ecut= 100.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 1.80E-07, avg # of iterations = 4.0 + + total cpu time spent up to now is 128.0 secs + + total energy = -2893.74825070 Ry + Harris-Foulkes estimate = -2893.74827960 Ry + estimated scf accuracy < 0.00011797 Ry + + iteration # 18 ecut= 100.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 3.07E-08, avg # of iterations = 4.0 + + total cpu time spent up to now is 134.3 secs + + total energy = -2893.74824977 Ry + Harris-Foulkes estimate = -2893.74826067 Ry + estimated scf accuracy < 0.00003128 Ry + + iteration # 19 ecut= 100.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 8.15E-09, avg # of iterations = 5.0 + + total cpu time spent up to now is 144.3 secs + + total energy = -2893.74826174 Ry + Harris-Foulkes estimate = -2893.74826276 Ry + estimated scf accuracy < 0.00001338 Ry + + iteration # 20 ecut= 100.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 3.48E-09, avg # of iterations = 5.0 + + total cpu time spent up to now is 154.0 secs + + total energy = -2893.74826019 Ry + Harris-Foulkes estimate = -2893.74826605 Ry + estimated scf accuracy < 0.00003018 Ry + + iteration # 21 ecut= 100.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 3.48E-09, avg # of iterations = 4.0 + + total cpu time spent up to now is 161.9 secs + + total energy = -2893.74826286 Ry + Harris-Foulkes estimate = -2893.74826246 Ry + estimated scf accuracy < 0.00001174 Ry + + iteration # 22 ecut= 100.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 3.06E-09, avg # of iterations = 4.0 + + total cpu time spent up to now is 168.0 secs + + total energy = -2893.74826016 Ry + Harris-Foulkes estimate = -2893.74826372 Ry + estimated scf accuracy < 0.00001543 Ry + + iteration # 23 ecut= 100.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 3.06E-09, avg # of iterations = 4.0 + + total cpu time spent up to now is 174.3 secs + + total energy = -2893.74826006 Ry + Harris-Foulkes estimate = -2893.74826111 Ry + estimated scf accuracy < 0.00000582 Ry + + iteration # 24 ecut= 100.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 1.52E-09, avg # of iterations = 4.0 + + total cpu time spent up to now is 180.6 secs + + total energy = -2893.74826020 Ry + Harris-Foulkes estimate = -2893.74826058 Ry + estimated scf accuracy < 0.00000247 Ry + + iteration # 25 ecut= 100.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 6.43E-10, avg # of iterations = 4.0 + + total cpu time spent up to now is 188.0 secs + + total energy = -2893.74826020 Ry + Harris-Foulkes estimate = -2893.74826058 Ry + estimated scf accuracy < 0.00000090 Ry + + iteration # 26 ecut= 100.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 2.33E-10, avg # of iterations = 5.0 + + total cpu time spent up to now is 198.5 secs + + total energy = -2893.74826046 Ry + Harris-Foulkes estimate = -2893.74826059 Ry + estimated scf accuracy < 0.00000064 Ry + + iteration # 27 ecut= 100.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 1.66E-10, avg # of iterations = 4.0 + + total cpu time spent up to now is 204.2 secs + + total energy = -2893.74826039 Ry + Harris-Foulkes estimate = -2893.74826049 Ry + estimated scf accuracy < 0.00000031 Ry + + iteration # 28 ecut= 100.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 8.12E-11, avg # of iterations = 4.0 + + total cpu time spent up to now is 213.5 secs + + total energy = -2893.74826046 Ry + Harris-Foulkes estimate = -2893.74826048 Ry + estimated scf accuracy < 0.00000009 Ry + + iteration # 29 ecut= 100.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 2.26E-11, avg # of iterations = 4.0 + + total cpu time spent up to now is 220.7 secs + + total energy = -2893.74826047 Ry + Harris-Foulkes estimate = -2893.74826047 Ry + estimated scf accuracy < 0.00000003 Ry + + iteration # 30 ecut= 100.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 8.38E-12, avg # of iterations = 4.0 + + total cpu time spent up to now is 228.2 secs + + total energy = -2893.74826047 Ry + Harris-Foulkes estimate = -2893.74826047 Ry + estimated scf accuracy < 0.00000001 Ry + + iteration # 31 ecut= 100.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 3.37E-12, avg # of iterations = 5.0 + + total cpu time spent up to now is 235.5 secs + + total energy = -2893.74826047 Ry + Harris-Foulkes estimate = -2893.74826047 Ry + estimated scf accuracy < 1.9E-09 Ry + + iteration # 32 ecut= 100.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 4.87E-13, avg # of iterations = 5.0 + + total cpu time spent up to now is 246.2 secs + + total energy = -2893.74826047 Ry + Harris-Foulkes estimate = -2893.74826047 Ry + estimated scf accuracy < 2.5E-09 Ry + + iteration # 33 ecut= 100.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 4.87E-13, avg # of iterations = 4.0 + + total cpu time spent up to now is 254.8 secs + + total energy = -2893.74826047 Ry + Harris-Foulkes estimate = -2893.74826047 Ry + estimated scf accuracy < 7.9E-10 Ry + + iteration # 34 ecut= 100.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 2.07E-13, avg # of iterations = 5.0 + + total cpu time spent up to now is 262.4 secs + + total energy = -2893.74826047 Ry + Harris-Foulkes estimate = -2893.74826047 Ry + estimated scf accuracy < 1.0E-10 Ry + + iteration # 35 ecut= 100.00 Ry beta=0.70 + Davidson diagonalization with overlap + ethr = 1.00E-13, avg # of iterations = 4.0 + + total cpu time spent up to now is 269.6 secs + + End of self-consistent calculation + + k =-0.2500-0.2500-0.3915 ( 58152 PWs) bands (ev): + + -48.4006 -48.4006 -48.4006 -48.4006 -48.4006 -48.4006 -48.4006 -48.4006 + -48.3971 -48.3971 -48.3971 -48.3971 -48.3971 -48.3971 -48.3971 -48.3971 + -24.8741 -24.8741 -24.8741 -24.8741 -24.8740 -24.8740 -24.8740 -24.8740 + -24.8617 -24.8617 -24.8617 -24.8617 -24.8617 -24.8617 -24.8617 -24.8617 + -24.7917 -24.7917 -24.7917 -24.7917 -24.7916 -24.7916 -24.7916 -24.7916 + -24.7474 -24.7474 -24.7474 -24.7474 -24.7474 -24.7474 -24.7474 -24.7474 + -24.7217 -24.7217 -24.7217 -24.7217 -24.7217 -24.7217 -24.7217 -24.7217 + -24.6898 -24.6898 -24.6898 -24.6898 -24.6898 -24.6898 -24.6898 -24.6898 + -8.4145 -8.4145 -8.4145 -8.4145 -8.4145 -8.4145 -8.4145 -8.4145 + -7.9030 -7.9030 -7.9030 -7.9030 -7.9030 -7.9030 -7.9030 -7.9030 + -7.7726 -7.7726 -7.7726 -7.7726 -7.7726 -7.7726 -7.7726 -7.7726 + -7.6940 -7.6940 -7.6940 -7.6940 -7.6940 -7.6940 -7.6940 -7.6940 + 4.0450 4.0450 4.0450 4.0450 4.0450 4.0450 4.0450 4.0450 + 4.4378 4.4378 4.4378 4.4378 4.4378 4.4378 4.4378 4.4378 + 4.6427 4.6427 4.6427 4.6427 4.6427 4.6427 4.6427 4.6427 + 4.8490 4.8490 4.8490 4.8490 4.8490 4.8490 4.8490 4.8490 + 5.3577 5.3577 5.3577 5.3577 5.3577 5.3577 5.3577 5.3577 + 5.8577 5.8577 5.8577 5.8577 5.8577 5.8577 5.8577 5.8577 + 6.0689 6.0689 6.0689 6.0689 6.0689 6.0689 6.0689 6.0689 + 6.5671 6.5671 6.5671 6.5671 6.5671 6.5671 6.5671 6.5671 + 7.1172 7.1172 7.1172 7.1172 7.1172 7.1172 7.1172 7.1172 + 7.3176 7.3176 7.3176 7.3176 7.3176 7.3176 7.3177 7.3177 + 7.6762 7.6762 7.6762 7.6762 7.6762 7.6762 7.6762 7.6762 + 8.2575 8.2575 8.2575 8.2575 8.2575 8.2575 8.2575 8.2575 + +! total energy = -2893.74826047 Ry + Harris-Foulkes estimate = -2893.74826047 Ry + estimated scf accuracy < 6.9E-11 Ry + + The total energy is the sum of the following terms: + + one-electron contribution = -1031.00495247 Ry + hartree contribution = 692.51164607 Ry + xc contribution = -457.83735245 Ry + ewald contribution = -2097.41760163 Ry + + convergence has been achieved in 35 iterations + + Forces acting on atoms (Ry/au): + + atom 1 type 1 force = 0.00000000 0.00000000 0.00000000 + atom 2 type 1 force = 0.00000066 0.00000066 -0.00000030 + atom 3 type 2 force = 0.00767316 0.00767316 0.00000000 + atom 4 type 2 force = -0.00767316 -0.00767316 0.00000000 + atom 5 type 2 force = 0.00767277 -0.00767280 -0.00000033 + atom 6 type 2 force = -0.00767280 0.00767277 -0.00000033 + atom 7 type 1 force = 0.00000000 0.00000000 0.00000000 + atom 8 type 1 force = 0.00000066 0.00000066 0.00000030 + atom 9 type 2 force = 0.00767309 0.00767309 0.00000000 + atom 10 type 2 force = -0.00767309 -0.00767309 0.00000000 + atom 11 type 2 force = 0.00767277 -0.00767280 0.00000033 + atom 12 type 2 force = -0.00767280 0.00767277 0.00000033 + atom 13 type 1 force = 0.00000000 0.00000000 0.00000000 + atom 14 type 1 force = 0.00000005 -0.00000005 -0.00000130 + atom 15 type 2 force = 0.00767283 0.00767254 0.00000000 + atom 16 type 2 force = -0.00767283 -0.00767254 0.00000000 + atom 17 type 2 force = 0.00767313 -0.00767313 0.00000058 + atom 18 type 2 force = -0.00767285 0.00767285 0.00000017 + atom 19 type 1 force = 0.00000000 0.00000000 0.00000000 + atom 20 type 1 force = 0.00000005 -0.00000005 0.00000130 + atom 21 type 2 force = 0.00767283 0.00767291 0.00000000 + atom 22 type 2 force = -0.00767283 -0.00767291 0.00000000 + atom 23 type 2 force = 0.00767313 -0.00767313 -0.00000058 + atom 24 type 2 force = -0.00767285 0.00767285 -0.00000017 + atom 25 type 1 force = 0.00000000 0.00000000 0.00000000 + atom 26 type 1 force = -0.00000005 0.00000005 -0.00000130 + atom 27 type 2 force = 0.00767254 0.00767283 0.00000000 + atom 28 type 2 force = -0.00767254 -0.00767283 0.00000000 + atom 29 type 2 force = 0.00767285 -0.00767285 0.00000017 + atom 30 type 2 force = -0.00767313 0.00767313 0.00000058 + atom 31 type 1 force = 0.00000000 0.00000000 0.00000000 + atom 32 type 1 force = -0.00000005 0.00000005 0.00000130 + atom 33 type 2 force = 0.00767291 0.00767283 0.00000000 + atom 34 type 2 force = -0.00767291 -0.00767283 0.00000000 + atom 35 type 2 force = 0.00767285 -0.00767285 -0.00000017 + atom 36 type 2 force = -0.00767313 0.00767313 -0.00000058 + atom 37 type 1 force = 0.00000000 0.00000000 0.00000000 + atom 38 type 1 force = -0.00000066 -0.00000066 -0.00000030 + atom 39 type 2 force = 0.00767311 0.00767311 0.00000000 + atom 40 type 2 force = -0.00767311 -0.00767311 0.00000000 + atom 41 type 2 force = 0.00767280 -0.00767277 -0.00000033 + atom 42 type 2 force = -0.00767277 0.00767280 -0.00000033 + atom 43 type 1 force = 0.00000000 0.00000000 0.00000000 + atom 44 type 1 force = -0.00000066 -0.00000066 0.00000030 + atom 45 type 2 force = 0.00767284 0.00767284 0.00000000 + atom 46 type 2 force = -0.00767284 -0.00767284 0.00000000 + atom 47 type 2 force = 0.00767280 -0.00767277 0.00000033 + atom 48 type 2 force = -0.00767277 0.00767280 0.00000033 + + Total force = 0.061383 Total SCF correction = 0.000021 + + + entering subroutine stress ... + + total stress (Ry/bohr**3) (kbar) P= -247.07 + -0.00160285 0.00000000 0.00000000 -235.79 0.00 0.00 + 0.00000000 -0.00160285 0.00000000 0.00 -235.79 0.00 + 0.00000000 0.00000000 -0.00183290 0.00 0.00 -269.63 + + + init_run : 4.58s CPU 4.79s WALL ( 1 calls) + electrons : 256.40s CPU 264.47s WALL ( 1 calls) + forces : 1.08s CPU 1.08s WALL ( 1 calls) + stress : 3.10s CPU 3.11s WALL ( 1 calls) + + Called by init_run: + wfcinit : 2.45s CPU 2.55s WALL ( 1 calls) + potinit : 0.67s CPU 0.69s WALL ( 1 calls) + + Called by electrons: + c_bands : 228.20s CPU 231.32s WALL ( 35 calls) + sum_band : 22.97s CPU 24.00s WALL ( 35 calls) + v_of_rho : 3.44s CPU 3.54s WALL ( 36 calls) + mix_rho : 0.78s CPU 0.85s WALL ( 35 calls) + + Called by c_bands: + init_us_2 : 0.33s CPU 1.41s WALL ( 71 calls) + cegterg : 227.33s CPU 230.40s WALL ( 35 calls) + + Called by *egterg: + h_psi : 124.45s CPU 124.74s WALL ( 160 calls) + g_psi : 0.41s CPU 0.41s WALL ( 124 calls) + cdiaghg : 38.02s CPU 38.62s WALL ( 159 calls) + + Called by h_psi: + add_vuspsi : 7.63s CPU 7.82s WALL ( 160 calls) + + General routines + calbec : 8.66s CPU 8.58s WALL ( 162 calls) + fft : 2.28s CPU 2.34s WALL ( 403 calls) + fftw : 124.66s CPU 120.32s WALL ( 42816 calls) + + Parallel routines + fft_scatter : 91.90s CPU 59.67s WALL ( 43219 calls) + EXX routines + + PWSCF : 4m25.32s CPU 4m34.35s WALL + + + This run was terminated on: 15: 4:45 2Nov2012 + +=------------------------------------------------------------------------------= + JOB DONE. +=------------------------------------------------------------------------------= +Application 12692097 resources: utime ~6453s, stime ~115s Rss ~136416 inblocks ~70076 outblocks ~595905 diff --git a/tests/apps/miniDFT/tests/test/Si.lda.nml b/tests/apps/miniDFT/tests/test/Si.lda.nml new file mode 100644 index 0000000000..2e83c2a392 --- /dev/null +++ b/tests/apps/miniDFT/tests/test/Si.lda.nml @@ -0,0 +1,2375 @@ + +&header + generated='Generated using "atomic" code by A. Dal Corso (Quantum ESPRESSO distribution)' + author = "anonymous" + date = "18Feb2011" + comment = " " + psd = "Si" + typ = "NC" + rel = "no" + tvanp = .false. + tpawp = .false. + tcoulombp= .false. + has_so = .false. + has_wfc = .false. + has_gipaw= .false. + nlcc = .false. + dft = "PZ " + zp = 4.000000000000000E+000 + etotps = -7.491233379645715E+000 + ecutwfc = 0.000000000000000E+000 + ecutrho = 0.000000000000000E+000 + nv = "2.0.1" + lmax = 2 + lmax_rho = 4 + lloc = 2 + nmesh = 1141 + nwfc = 2 + nbeta = 2 +/ + +&mesh + dx = 1.250000000000000E-002 + nmesh = 1141 + xmin =-7.000000000000000E+000 + rmax = 1.000000000000000E+002 + zmesh = 1.400000000000000E+001 + r(1:1141) = + 6.513442611103688E-005 6.595371633350160E-005 6.678331195832731E-005 6.762334261151814E-005 + 6.847393954957285E-005 6.933523567999349E-005 7.020736558205276E-005 7.109046552782222E-005 + 7.198467350346503E-005 7.289012923079676E-005 7.380697418911693E-005 7.473535163731562E-005 + 7.567540663625787E-005 7.662728607144977E-005 7.759113867598985E-005 7.856711505380845E-005 + 7.955536770320024E-005 8.055605104065229E-005 8.156932142497194E-005 8.259533718171841E-005 + 8.363425862794104E-005 8.468624809722948E-005 8.575146996507863E-005 8.683009067457247E-005 + 8.792227876239150E-005 8.902820488514639E-005 9.014804184604389E-005 9.128196462188746E-005 + 9.243015039041771E-005 9.359277855799713E-005 9.477003078764225E-005 9.596209102740905E-005 + 9.716914553913527E-005 9.839138292754407E-005 9.962899416971422E-005 1.008821726449201E-004 + 1.021511141648482E-004 1.034360170041926E-004 1.047370819316360E-004 1.060545122412205E-004 + 1.073885137841123E-004 1.087392950007665E-004 1.101070669534965E-004 1.114920433594523E-004 + 1.128944406240155E-004 1.143144778746117E-004 1.157523769949505E-004 1.172083626596947E-004 + 1.186826623695667E-004 1.201755064868958E-004 1.216871282716124E-004 1.232177639176959E-004 + 1.247676525900800E-004 1.263370364620229E-004 1.279261607529478E-004 1.295352737667582E-004 + 1.311646269306362E-004 1.328144748343287E-004 1.344850752699270E-004 1.361766892721483E-004 + 1.378895811591221E-004 1.396240185736905E-004 1.413802725252283E-004 1.431586174319885E-004 + 1.449593311639810E-004 1.467826950863899E-004 1.486289941035378E-004 1.504985167034024E-004 + 1.523915550026935E-004 1.543084047924968E-004 1.562493655844918E-004 1.582147406577512E-004 + 1.602048371061288E-004 1.622199658862433E-004 1.642604418660669E-004 1.663265838741224E-004 + 1.684187147493024E-004 1.705371613913124E-004 1.726822548117502E-004 1.748543301858273E-004 + 1.770537269047399E-004 1.792807886286999E-004 1.815358633406327E-004 1.838193034005500E-004 + 1.861314656006070E-004 1.884727112208516E-004 1.908434060856750E-004 1.932439206209733E-004 + 1.956746299120263E-004 1.981359137621063E-004 2.006281567518223E-004 2.031517482992120E-004 + 2.057070827205888E-004 2.082945592921548E-004 2.109145823123890E-004 2.135675611652186E-004 + 2.162539103839868E-004 2.189740497162245E-004 2.217284041892364E-004 2.245174041765129E-004 + 2.273414854649762E-004 2.302010893230733E-004 2.330966625697249E-004 2.360286576441416E-004 + 2.389975326765194E-004 2.420037515596223E-004 2.450477840212667E-004 2.481301056977181E-004 + 2.512511982080092E-004 2.544115492291950E-004 2.576116525725522E-004 2.608520082607388E-004 + 2.641331226059237E-004 2.674555082888986E-004 2.708196844391863E-004 2.742261767161545E-004 + 2.776755173911522E-004 2.811682454306774E-004 2.847049065805922E-004 2.882860534513970E-004 + 2.919122456045762E-004 2.955840496400312E-004 2.993020392846129E-004 3.030667954817672E-004 + 3.068789064823100E-004 3.107389679363406E-004 3.146475829863146E-004 3.186053623612859E-004 + 3.226129244723333E-004 3.266708955091909E-004 3.307799095380890E-004 3.349406086008293E-004 + 3.391536428151055E-004 3.434196704760847E-004 3.477393581592688E-004 3.521133808246465E-004 + 3.565424219221584E-004 3.610271734984867E-004 3.655683363051894E-004 3.701666199081946E-004 + 3.748227427986703E-004 3.795374325052911E-004 3.843114257079158E-004 3.891454683526947E-004 + 3.940403157686265E-004 3.989967327855786E-004 4.040154938537935E-004 4.090973831648989E-004 + 4.142431947744387E-004 4.194537327259466E-004 4.247298111765782E-004 4.300722545243257E-004 + 4.354818975368313E-004 4.409595854818215E-004 4.465061742591829E-004 4.521225305346962E-004 + 4.578095318754559E-004 4.635680668869920E-004 4.693990353521151E-004 4.753033483715124E-004 + 4.812819285061048E-004 4.873357099212019E-004 4.934656385324665E-004 4.996726721537150E-004 + 5.059577806465804E-004 5.123219460720500E-004 5.187661628439208E-004 5.252914378841740E-004 + 5.318987907803099E-004 5.385892539446626E-004 5.453638727757115E-004 5.522237058214337E-004 + 5.591698249446982E-004 5.662033154907496E-004 5.733252764567971E-004 5.805368206637293E-004 + 5.878390749300021E-004 5.952331802477007E-004 6.027202919608236E-004 6.103015799458105E-004 + 6.179782287943310E-004 6.257514379983876E-004 6.336224221377328E-004 6.415924110696512E-004 + 6.496626501211302E-004 6.578344002834385E-004 6.661089384091661E-004 6.744875574117294E-004 + 6.829715664673932E-004 6.915622912198352E-004 7.002610739872734E-004 7.090692739722151E-004 + 7.179882674738274E-004 7.270194481029906E-004 7.361642270000536E-004 7.454240330553219E-004 + 7.548003131323325E-004 7.642945322939235E-004 7.739081740311538E-004 7.836427404951063E-004 + 7.934997527315935E-004 8.034807509188332E-004 8.135872946080984E-004 8.238209629674016E-004 + 8.341833550282468E-004 8.446760899354727E-004 8.553008072002587E-004 8.660591669562928E-004 + 8.769528502191741E-004 8.879835591490780E-004 8.991530173167141E-004 9.104629699726479E-004 + 9.219151843199911E-004 9.335114497905343E-004 9.452535783243529E-004 9.571434046529162E-004 + 9.691827865857810E-004 9.813736053008674E-004 9.937177656384013E-004 1.006217196398553E-003 + 1.018873850642804E-003 1.031689705999134E-003 1.044666764971016E-003 1.057807055250314E-003 + 1.071112630034123E-003 1.084585568345567E-003 1.098227975358674E-003 1.112041982727292E-003 + 1.126029748918178E-003 1.140193459548259E-003 1.154535327726134E-003 1.169057594397888E-003 + 1.183762528697233E-003 1.198652428300069E-003 1.213729619783506E-003 1.228996458989385E-003 + 1.244455331392394E-003 1.260108652472797E-003 1.275958868093860E-003 1.292008454884022E-003 + 1.308259920623870E-003 1.324715804637992E-003 1.341378678191744E-003 1.358251144893018E-003 + 1.375335841099066E-003 1.392635436328428E-003 1.410152633678056E-003 1.427890170245674E-003 + 1.445850817557457E-003 1.464037382001090E-003 1.482452705264267E-003 1.501099664778717E-003 + 1.519981174169798E-003 1.539100183711769E-003 1.558459680788769E-003 1.578062690361603E-003 + 1.597912275440400E-003 1.618011537563212E-003 1.638363617280638E-003 1.658971694646541E-003 + 1.679838989714936E-003 1.700968763043134E-003 1.722364316201205E-003 1.744028992287860E-003 + 1.765966176452814E-003 1.788179296425725E-003 1.810671823051782E-003 1.833447270834031E-003 + 1.856509198482525E-003 1.879861209470379E-003 1.903506952596820E-003 1.927450122557321E-003 + 1.951694460520898E-003 1.976243754714684E-003 2.001101841015845E-003 2.026272603550936E-003 + 2.051759975302817E-003 2.077567938725177E-003 2.103700526364807E-003 2.130161821491694E-003 + 2.156955958737036E-003 2.184087124739293E-003 2.211559558798350E-003 2.239377553537921E-003 + 2.267545455576282E-003 2.296067666205433E-003 2.324948642078817E-003 2.354192895907669E-003 + 2.383804997166149E-003 2.413789572805326E-003 2.444151307976146E-003 2.474894946761502E-003 + 2.506025292917502E-003 2.537547210624069E-003 2.569465625244976E-003 2.601785524097445E-003 + 2.634511957231429E-003 2.667650038218687E-003 2.701204944951792E-003 2.735181920453190E-003 + 2.769586273694429E-003 2.804423380425701E-003 2.839698684015808E-003 2.875417696302704E-003 + 2.911585998454730E-003 2.948209241842682E-003 2.985293148922851E-003 3.022843514131166E-003 + 3.060866204788585E-003 3.099367162017884E-003 3.138352401671959E-003 3.177828015273824E-003 + 3.217800170968416E-003 3.258275114486386E-003 3.299259170120009E-003 3.340758741711356E-003 + 3.382780313652924E-003 3.425330451900819E-003 3.468415805000712E-003 3.512043105126685E-003 + 3.556219169133139E-003 3.600950899619956E-003 3.646245286011030E-003 3.692109405646387E-003 + 3.738550424888027E-003 3.785575600239700E-003 3.833192279480724E-003 3.881407902814107E-003 + 3.930230004029090E-003 3.979666211678314E-003 4.029724250269811E-003 4.080411941473949E-003 + 4.131737205345606E-003 4.183708061561682E-003 4.236332630674195E-003 4.289619135379139E-003 + 4.343575901801284E-003 4.398211360795159E-003 4.453534049262390E-003 4.509552611485598E-003 + 4.566275800479113E-003 4.623712479356611E-003 4.681871622716024E-003 4.740762318041832E-003 + 4.800393767124983E-003 4.860775287500728E-003 4.921916313904469E-003 4.983826399745975E-003 + 5.046515218602116E-003 5.109992565728373E-003 5.174268359589390E-003 5.239352643408724E-003 + 5.305255586738136E-003 5.371987487046604E-003 5.439558771329309E-003 5.507979997736908E-003 + 5.577261857225227E-003 5.647415175225763E-003 5.718450913337185E-003 5.790380171038089E-003 + 5.863214187421343E-003 5.936964342950183E-003 6.011642161236457E-003 6.087259310841205E-003 + 6.163827607097892E-003 6.241359013958599E-003 6.319865645863380E-003 6.399359769633193E-003 + 6.479853806386611E-003 6.561360333480635E-003 6.643892086475964E-003 6.727461961126907E-003 + 6.812083015396403E-003 6.897768471496347E-003 6.984531717953575E-003 7.072386311701879E-003 + 7.161345980200268E-003 7.251424623577934E-003 7.342636316806176E-003 7.434995311897618E-003 + 7.528516040133167E-003 7.623213114316872E-003 7.719101331059236E-003 7.816195673089213E-003 + 7.914511311595282E-003 8.014063608595981E-003 8.114868119340268E-003 8.216940594738030E-003 + 8.320296983821215E-003 8.424953436235899E-003 8.530926304765688E-003 8.638232147886909E-003 + 8.746887732355853E-003 8.856910035828664E-003 8.968316249514094E-003 9.081123780859682E-003 + 9.195350256271731E-003 9.311013523869408E-003 9.428131656273592E-003 9.546722953430753E-003 + 9.666805945472336E-003 9.788399395610176E-003 9.911522303068234E-003 1.003619390605130E-002 + 1.016243368475098E-002 1.029026136438952E-002 1.041969691830196E-002 1.055076057105692E-002 + 1.068347280161680E-002 1.081785434653762E-002 1.095392620320918E-002 1.109170963313593E-002 + 1.123122616525912E-002 1.137249759932074E-002 1.151554600926978E-002 1.166039374671131E-002 + 1.180706344439904E-002 1.195557801977161E-002 1.210596067853358E-002 1.225823491828135E-002 + 1.241242453217465E-002 1.256855361265440E-002 1.272664655520704E-002 1.288672806217649E-002 + 1.304882314662391E-002 1.321295713623602E-002 1.337915567728265E-002 1.354744473862395E-002 + 1.371785061576816E-002 1.389039993498026E-002 1.406511965744243E-002 1.424203708346680E-002 + 1.442117985676110E-002 1.460257596874815E-002 1.478625376293949E-002 1.497224193936413E-002 + 1.516056955905308E-002 1.535126604858005E-002 1.554436120465950E-002 1.573988519880243E-002 + 1.593786858203070E-002 1.613834228965078E-002 1.634133764608732E-002 1.654688636977778E-002 + 1.675502057812842E-002 1.696577279253272E-002 1.717917594345301E-002 1.739526337556577E-002 + 1.761406885297190E-002 1.783562656447241E-002 1.805997112891046E-002 1.828713760058072E-002 + 1.851716147470654E-002 1.875007869298625E-002 1.898592564920906E-002 1.922473919494171E-002 + 1.946655664528662E-002 1.971141578471237E-002 1.995935487295767E-002 2.021041265100950E-002 + 2.046462834715643E-002 2.072204168311824E-002 2.098269288025235E-002 2.124662266583862E-002 + 2.151387227944302E-002 2.178448347936138E-002 2.205849854914428E-002 2.233596030420385E-002 + 2.261691209850381E-002 2.290139783133363E-002 2.318946195416784E-002 2.348114947761173E-002 + 2.377650597843426E-002 2.407557760668960E-002 2.437841109292813E-002 2.468505375549818E-002 + 2.499555350793967E-002 2.530995886647063E-002 2.562831895756798E-002 2.595068352564368E-002 + 2.627710294081731E-002 2.660762820678665E-002 2.694231096879693E-002 2.728120352171065E-002 + 2.762435881817868E-002 2.797183047691421E-002 2.832367279107093E-002 2.867994073672620E-002 + 2.904068998147138E-002 2.940597689310991E-002 2.977585854846488E-002 3.015039274229754E-002 + 3.052963799633763E-002 3.091365356842768E-002 3.130249946178211E-002 3.169623643436285E-002 + 3.209492600837298E-002 3.249863047986955E-002 3.290741292849757E-002 3.332133722734634E-002 + 3.374046805292962E-002 3.416487089529173E-002 3.459461206824019E-002 3.502975871970760E-002 + 3.547037884224356E-002 3.591654128363864E-002 3.636831575768208E-002 3.682577285505458E-002 + 3.728898405435831E-002 3.775802173328555E-002 3.823295917992788E-002 3.871387060422766E-002 + 3.920083114957333E-002 3.969391690454083E-002 4.019320491478257E-002 4.069877319506593E-002 + 4.121070074146334E-002 4.172906754369543E-002 4.225395459762966E-002 4.278544391793613E-002 + 4.332361855090239E-002 4.386856258740985E-002 4.442036117607288E-002 4.497910053654360E-002 + 4.554486797298384E-002 4.611775188770657E-002 4.669784179498910E-002 4.728522833505959E-002 + 4.788000328825998E-002 4.848225958938678E-002 4.909209134221231E-002 4.970959383418872E-002 + 5.033486355133670E-002 5.096799819332164E-002 5.160909668871948E-002 5.225825921047441E-002 + 5.291558719155128E-002 5.358118334078444E-002 5.425515165892635E-002 5.493759745489792E-002 + 5.562862736224321E-002 5.632834935579120E-002 5.703687276852695E-002 5.775430830867521E-002 + 5.848076807699875E-002 5.921636558431431E-002 5.996121576922910E-002 6.071543501609988E-002 + 6.147914117321845E-002 6.225245357122561E-002 6.303549304175680E-002 6.382838193632255E-002 + 6.463124414542570E-002 6.544420511791986E-002 6.626739188061097E-002 6.710093305810541E-002 + 6.794495889290816E-002 6.879960126577302E-002 6.966499371630951E-002 7.054127146384873E-002 + 7.142857142857143E-002 7.232703225290246E-002 7.323679432317351E-002 7.415799979155897E-002 + 7.509079259828748E-002 7.603531849413282E-002 7.699172506318798E-002 7.796016174592516E-002 + 7.894077986254630E-002 7.993373263662724E-002 8.093917521905902E-002 8.195726471229088E-002 + 8.298816019487740E-002 8.403202274633508E-002 8.508901547231136E-002 8.615930353007006E-002 + 8.724305415429787E-002 8.834043668323464E-002 8.945162258513320E-002 9.057678548505145E-002 + 9.171610119198152E-002 9.286974772632081E-002 9.403790534768730E-002 9.522075658308596E-002 + 9.641848625542886E-002 9.763128151241403E-002 9.885933185576798E-002 1.001028291708553E-001 + 1.013619677566613E-001 1.026369443561518E-001 1.039279581870144E-001 1.052352109727869E-001 + 1.065589069743765E-001 1.078992530219767E-001 1.092564585473843E-001 1.106307356167238E-001 + 1.120222989635835E-001 1.134313660225674E-001 1.148581569632703E-001 1.163028947246794E-001 + 1.177658050500092E-001 1.192471165219745E-001 1.207470605985066E-001 1.222658716489190E-001 + 1.238037869905283E-001 1.253610469257356E-001 1.269378947795742E-001 1.285345769377292E-001 + 1.301513428850364E-001 1.317884452444644E-001 1.334461398165873E-001 1.351246856195550E-001 + 1.368243449295641E-001 1.385453833218396E-001 1.402880697121320E-001 1.420526763987351E-001 + 1.438394791050341E-001 1.456487570225868E-001 1.474807928547491E-001 1.493358728608469E-001 + 1.512142869009054E-001 1.531163284809400E-001 1.550422947988174E-001 1.569924867906931E-001 + 1.589672091780335E-001 1.609667705152292E-001 1.629914832378074E-001 1.650416637112503E-001 + 1.671176322804280E-001 1.692197133196529E-001 1.713482352833641E-001 1.735035307574492E-001 + 1.756859365112107E-001 1.778957935499880E-001 1.801334471684393E-001 1.823992470044948E-001 + 1.846935470939890E-001 1.870167059259787E-001 1.893690864987578E-001 1.917510563765766E-001 + 1.941629877470747E-001 1.966052574794362E-001 1.990782471832751E-001 2.015823432682642E-001 + 2.041179370045119E-001 2.066854245836972E-001 2.092852071809789E-001 2.119176910176763E-001 + 2.145832874247451E-001 2.172824129070476E-001 2.200154892084308E-001 2.227829433776283E-001 + 2.255852078349835E-001 2.284227204400196E-001 2.312959245598545E-001 2.342052691384767E-001 + 2.371512087668965E-001 2.401342037541736E-001 2.431547201993441E-001 2.462132300642484E-001 + 2.493102112472744E-001 2.524461476580338E-001 2.556215292929701E-001 2.588368523119243E-001 + 2.620926191156605E-001 2.653893384243646E-001 2.687275253571367E-001 2.721077015124759E-001 + 2.755303950497838E-001 2.789961407718896E-001 2.825054802086126E-001 2.860589617013806E-001 + 2.896571404889054E-001 2.933005787939437E-001 2.969898459111436E-001 3.007255182959971E-001 + 3.045081796549159E-001 3.083384210364318E-001 3.122168409235541E-001 3.161440453272812E-001 + 3.201206478812903E-001 3.241472699378220E-001 3.282245406647636E-001 3.323530971439621E-001 + 3.365335844707675E-001 3.407666558548287E-001 3.450529727221632E-001 3.493932048185005E-001 + 3.537880303139366E-001 3.582381359088974E-001 3.627442169414344E-001 3.673069774958780E-001 + 3.719271305128465E-001 3.766053979006493E-001 3.813425106480843E-001 3.861392089386548E-001 + 3.909962422662289E-001 3.959143695521447E-001 4.008943592637967E-001 4.059369895347106E-001 + 4.110430482861237E-001 4.162133333501057E-001 4.214486525942157E-001 4.267498240477373E-001 + 4.321176760294965E-001 4.375530472772847E-001 4.430567870789194E-001 4.486297554049404E-001 + 4.542728230429878E-001 4.599868717338617E-001 4.657727943092938E-001 4.716314948314596E-001 + 4.775638887342337E-001 4.835709029662338E-001 4.896534761356559E-001 4.958125586569311E-001 + 5.020491128992358E-001 5.083641133368569E-001 5.147585467014618E-001 5.212334121362741E-001 + 5.277897213521893E-001 5.344284987858633E-001 5.411507817597749E-001 5.479576206443163E-001 + 5.548500790219126E-001 5.618292338532066E-001 5.688961756453415E-001 5.760520086223482E-001 + 5.832978508976890E-001 5.906348346489624E-001 5.980641062948047E-001 6.055868266740273E-001 + 6.132041712269928E-001 6.209173301792859E-001 6.287275087276868E-001 6.366359272284811E-001 + 6.446438213881521E-001 6.527524424564518E-001 6.609630574219206E-001 6.692769492098526E-001 + 6.776954168827519E-001 6.862197758433223E-001 6.948513580399921E-001 7.035915121750415E-001 + 7.124416039153376E-001 7.214030161057181E-001 7.304771489850721E-001 7.396654204051211E-001 + 7.489692660519693E-001 7.583901396704293E-001 7.679295132911682E-001 7.775888774607249E-001 + 7.873697414744004E-001 7.972736336120975E-001 8.073021013771136E-001 8.174567117379372E-001 + 8.277390513731001E-001 8.381507269190867E-001 8.486933652213854E-001 8.593686135886813E-001 + 8.701781400502482E-001 8.811236336165903E-001 8.922068045433438E-001 9.034293845985159E-001 + 9.147931273330744E-001 9.262998083549381E-001 9.379512256064306E-001 9.497491996451991E-001 + 9.616955739286935E-001 9.737922151021975E-001 9.860410132905068E-001 9.984438823932605E-001 + 1.011002760383986E+000 1.023719609612925E+000 1.036596417113638E+000 1.049635194913496E+000 + 1.062837980348061E+000 1.076206836379414E+000 1.089743851918513E+000 1.103451142151573E+000 + 1.117330848870584E+000 1.131385140807959E+000 1.145616213975405E+000 1.160026292007061E+000 + 1.174617626506933E+000 1.189392497400724E+000 1.204353213292075E+000 1.219502111823276E+000 + 1.234841560040547E+000 1.250373954763878E+000 1.266101722961546E+000 1.282027322129333E+000 + 1.298153240674505E+000 1.314481998304648E+000 1.331016146421358E+000 1.347758268518920E+000 + 1.364710980587976E+000 1.381876931524273E+000 1.399258803542573E+000 1.416859312595738E+000 + 1.434681208799119E+000 1.452727276860259E+000 1.471000336514003E+000 1.489503242963103E+000 + 1.508238887324330E+000 1.527210197080239E+000 1.546420136536577E+000 1.565871707285462E+000 + 1.585567948674405E+000 1.605511938281188E+000 1.625706792394766E+000 1.646155666502186E+000 + 1.666861755781623E+000 1.687828295601661E+000 1.709058562026797E+000 1.730555872329356E+000 + 1.752323585507812E+000 1.774365102811632E+000 1.796683868272743E+000 1.819283369243650E+000 + 1.842167136942362E+000 1.865338747004142E+000 1.888801820040200E+000 1.912560022203440E+000 + 1.936617065761279E+000 1.960976709675721E+000 1.985642760190692E+000 2.010619071426761E+000 + 2.035909545983380E+000 2.061518135548645E+000 2.087448841516781E+000 2.113705715613356E+000 + 2.140292860528359E+000 2.167214430557283E+000 2.194474632250210E+000 2.222077725069119E+000 + 2.250028022053426E+000 2.278329890493893E+000 2.306987752615052E+000 2.336006086266155E+000 + 2.365389425620879E+000 2.395142361885783E+000 2.425269544017683E+000 2.455775679450088E+000 + 2.486665534828718E+000 2.517943936756325E+000 2.549615772546851E+000 2.581685990989066E+000 + 2.614159603119860E+000 2.647041683007185E+000 2.680337368542928E+000 2.714051862245700E+000 + 2.748190432073724E+000 2.782758412248001E+000 2.817761204085753E+000 2.853204276844424E+000 + 2.889093168576245E+000 2.925433486993557E+000 2.962230910345058E+000 2.999491188303001E+000 + 3.037220142861627E+000 3.075423669246854E+000 3.114107736837394E+000 3.153278390097521E+000 + 3.192941749521490E+000 3.233104012589912E+000 3.273771454738108E+000 3.314950430336641E+000 + 3.356647373684239E+000 3.398868800013122E+000 3.441621306507058E+000 3.484911573332176E+000 + 3.528746364680728E+000 3.573132529828058E+000 3.618077004202762E+000 3.663586810470407E+000 + 3.709669059630821E+000 3.756330952129175E+000 3.803579778981121E+000 3.851422922911969E+000 + 3.899867859510303E+000 3.948922158396035E+000 3.998593484403154E+000 4.048889598777420E+000 + 4.099818360389017E+000 4.151387726960571E+000 4.203605756310533E+000 4.256480607612214E+000 + 4.310020542668719E+000 4.364233927203812E+000 4.419129232169135E+000 4.474715035067780E+000 + 4.531000021294525E+000 4.587992985492996E+000 4.645702832929787E+000 4.704138580885979E+000 + 4.763309360066087E+000 4.823224416024724E+000 4.883893110611302E+000 4.945324923432760E+000 + 5.007529453334847E+000 5.070516419901924E+000 5.134295664975647E+000 5.198877154192838E+000 + 5.264270978542561E+000 5.330487355942922E+000 5.397536632837620E+000 5.465429285812563E+000 + 5.534175923232927E+000 5.603787286900654E+000 5.674274253732953E+000 5.745647837461808E+000 + 5.817919190354867E+000 5.891099604958079E+000 5.965200515860090E+000 6.040233501479000E+000 + 6.116210285871476E+000 6.193142740564634E+000 6.271042886411067E+000 6.349922895467024E+000 + 6.429795092894416E+000 6.510671958886604E+000 6.592566130618422E+000 6.675490404220839E+000 + 6.759457736780297E+000 6.844481248363350E+000 6.930574224066675E+000 7.017750116092862E+000 + 7.106022545852425E+000 7.195405306092080E+000 7.285912363049978E+000 7.377557858637919E+000 + 7.470356112651017E+000 7.564321625005287E+000 7.659469078003183E+000 7.755813338627829E+000 + 7.853369460865973E+000 7.952152688060167E+000 8.052178455290667E+000 8.153462391787075E+000 + 8.256020323370548E+000 8.359868274926566E+000 8.465022472908810E+000 8.571499347874683E+000 + 8.679315537052498E+000 8.788487886941182E+000 8.899033455942533E+000 9.010969517026583E+000 + 9.124313560430645E+000 9.239083296392069E+000 9.355296657915615E+000 9.472971803575474E+000 + 9.592127120352538E+000 9.712781226507508E+000 9.834952974489909E+000 9.958661453883940E+000 + 1.008392599439121E+001 1.021076616885100E+001 1.033920179629865E+001 1.046925294506223E+001 + 1.060093993589833E+001 1.073428334516721E+001 1.086930400804783E+001 1.100602302179350E+001 + 1.114446174902822E+001 1.128464182108482E+001 1.142658514138476E+001 1.157031388886060E+001 + 1.171585052142157E+001 1.186321777946258E+001 1.201243868941753E+001 1.216353656735723E+001 + 1.231653502263245E+001 1.247145796156318E+001 1.262832959117375E+001 1.278717442297548E+001 + 1.294801727679653E+001 1.311088328466000E+001 1.327579789471102E+001 1.344278687519289E+001 + 1.361187631847357E+001 1.378309264512262E+001 1.395646260803935E+001 1.413201329663327E+001 + 1.430977214105656E+001 1.448976691649035E+001 1.467202574748453E+001 1.485657711235219E+001 + 1.504344984761963E+001 1.523267315253186E+001 1.542427659361529E+001 1.561829010929744E+001 + 1.581474401458480E+001 1.601366900579981E+001 1.621509616537701E+001 1.641905696671991E+001 + 1.662558327911874E+001 1.683470737272990E+001 1.704646192361856E+001 1.726088001886405E+001 + 1.747799516173003E+001 1.769784127689931E+001 1.792045271577461E+001 1.814586426184624E+001 + 1.837411113612678E+001 1.860522900265477E+001 1.883925397406709E+001 1.907622261724158E+001 + 1.931617195901093E+001 1.955913949194790E+001 1.980516318022385E+001 2.005428146554068E+001 + 2.030653327313721E+001 2.056195801787166E+001 2.082059561038001E+001 2.108248646331230E+001 + 2.134767149764718E+001 2.161619214908570E+001 2.188809037452604E+001 2.216340865861903E+001 + 2.244219002040673E+001 2.272447802004415E+001 2.301031676560547E+001 2.329975091997631E+001 + 2.359282570783207E+001 2.388958692270465E+001 2.419008093413768E+001 2.449435469493174E+001 + 2.480245574848107E+001 2.511443223620206E+001 2.543033290505565E+001 2.575020711516412E+001 + 2.607410484752350E+001 2.640207671181352E+001 2.673417395430516E+001 2.707044846586825E+001 + 2.741095279007945E+001 2.775574013143206E+001 2.810486436364974E+001 2.845838003810399E+001 + 2.881634239233822E+001 2.917880735869861E+001 2.954583157307349E+001 2.991747238374317E+001 + 3.029378786034033E+001 3.067483680292385E+001 3.106067875116633E+001 3.145137399365706E+001 + 3.184698357732268E+001 3.224756931696539E+001 3.265319380492206E+001 3.306392042084426E+001 + 3.347981334160122E+001 3.390093755130807E+001 3.432735885147924E+001 3.475914387131051E+001 + 3.519636007808977E+001 3.563907578773871E+001 3.608736017548782E+001 3.654128328668459E+001 + 3.700091604773871E+001 3.746633027720431E+001 3.793759869700151E+001 3.841479494377982E+001 + 3.889799358042353E+001 3.938727010770277E+001 3.988270097607043E+001 4.038436359760750E+001 + 4.089233635811942E+001 4.140669862938331E+001 4.192753078155063E+001 4.245491419570487E+001 + 4.298893127657730E+001 4.352966546542344E+001 4.407720125306027E+001 4.463162419306865E+001 + 4.519302091516101E+001 4.576147913871721E+001 4.633708768649136E+001 4.691993649848997E+001 + 4.751011664602584E+001 4.810772034594782E+001 4.871284097504968E+001 4.932557308466102E+001 + 4.994601241542041E+001 5.057425591223567E+001 5.121040173943143E+001 5.185454929608725E+001 + 5.250679923156957E+001 5.316725346125764E+001 5.383601518246866E+001 5.451318889058226E+001 + 5.519888039536786E+001 5.589319683751832E+001 5.659624670539014E+001 5.730813985195564E+001 + 5.802898751196743E+001 5.875890231933875E+001 5.949799832474348E+001 6.024639101343598E+001 + 6.100419732329654E+001 6.177153566310299E+001 6.254852593103185E+001 6.333528953339351E+001 + 6.413194940360131E+001 6.493863002138087E+001 6.575545743222007E+001 6.658255926706345E+001 + 6.742006476225569E+001 6.826810477973412E+001 6.912681182747690E+001 6.999632008020744E+001 + 7.087676540035901E+001 7.176828535930441E+001 7.267101925885081E+001 7.358510815300670E+001 + 7.451069487002171E+001 7.544792403470322E+001 7.639694209101528E+001 7.735789732495972E+001 + 7.833093988774705E+001 7.931622181925751E+001 8.031389707179719E+001 8.132412153415434E+001 + 8.234705305595631E+001 8.338285147233465E+001 8.443167862889943E+001 8.549369840702740E+001 + 8.656907674946989E+001 8.765798168628048E+001 8.876058336107113E+001 8.987705405759688E+001 + 9.100756822667528E+001 9.215230251344561E+001 9.331143578496878E+001 9.448514915817695E+001 + 9.567362602817279E+001 9.687705209688488E+001 9.809561540208516E+001 9.932950634676892E+001 + 1.005789177289068E+002 + + rab(1:1141) = + 8.141803263879611E-007 8.244214541687700E-007 8.347913994790914E-007 8.452917826439767E-007 + 8.559242443696606E-007 8.666904459999187E-007 8.775920697756596E-007 8.886308190977778E-007 + 8.998084187933129E-007 9.111266153849596E-007 9.225871773639616E-007 9.341918954664452E-007 + 9.459425829532234E-007 9.578410758931221E-007 9.698892334498732E-007 9.820889381726056E-007 + 9.944420962900031E-007 1.006950638008154E-006 1.019616517812149E-006 1.032441714771480E-006 + 1.045428232849263E-006 1.058578101215369E-006 1.071893374563483E-006 1.085376133432156E-006 + 1.099028484529894E-006 1.112852561064330E-006 1.126850523075549E-006 1.141024557773593E-006 + 1.155376879880222E-006 1.169909731974964E-006 1.184625384845528E-006 1.199526137842613E-006 + 1.214614319239191E-006 1.229892286594301E-006 1.245362427121428E-006 1.261027158061502E-006 + 1.276888927060602E-006 1.292950212552407E-006 1.309213524145450E-006 1.325681403015256E-006 + 1.342356422301404E-006 1.359241187509582E-006 1.376338336918706E-006 1.393650541993154E-006 + 1.411180507800194E-006 1.428930973432647E-006 1.446904712436881E-006 1.465104533246184E-006 + 1.483533279619584E-006 1.502193831086197E-006 1.521089103395155E-006 1.540222048971199E-006 + 1.559595657376000E-006 1.579212955775286E-006 1.599077009411848E-006 1.619190922084478E-006 + 1.639557836632953E-006 1.660180935429108E-006 1.681063440874087E-006 1.702208615901854E-006 + 1.723619764489026E-006 1.745300232171131E-006 1.767253406565354E-006 1.789482717899856E-006 + 1.811991639549763E-006 1.834783688579874E-006 1.857862426294223E-006 1.881231458792531E-006 + 1.904894437533668E-006 1.928855059906210E-006 1.953117069806148E-006 1.977684258221890E-006 + 2.002560463826610E-006 2.027749573578042E-006 2.053255523325836E-006 2.079082298426530E-006 + 2.105233934366279E-006 2.131714517391405E-006 2.158528185146878E-006 2.185679127322842E-006 + 2.213171586309249E-006 2.241009857858749E-006 2.269198291757910E-006 2.297741292506875E-006 + 2.326643320007588E-006 2.355908890260644E-006 2.385542576070938E-006 2.415549007762167E-006 + 2.445932873900329E-006 2.476698922026329E-006 2.507851959397779E-006 2.539396853740150E-006 + 2.571338534007360E-006 2.603681991151935E-006 2.636432278904863E-006 2.669594514565233E-006 + 2.703173879799835E-006 2.737175621452806E-006 2.771605052365455E-006 2.806467552206411E-006 + 2.841768568312203E-006 2.877513616538416E-006 2.913708282121561E-006 2.950358220551770E-006 + 2.987469158456493E-006 3.025046894495278E-006 3.063097300265834E-006 3.101626321221476E-006 + 3.140639977600115E-006 3.180144365364937E-006 3.220145657156903E-006 3.260650103259236E-006 + 3.301664032574047E-006 3.343193853611233E-006 3.385246055489828E-006 3.427827208951931E-006 + 3.470943967389402E-006 3.514603067883468E-006 3.558811332257402E-006 3.603575668142463E-006 + 3.648903070057203E-006 3.694800620500390E-006 3.741275491057661E-006 3.788334943522090E-006 + 3.835986331028874E-006 3.884237099204258E-006 3.933094787328933E-006 3.982567029516073E-006 + 4.032661555904166E-006 4.083386193864887E-006 4.134748869226113E-006 4.186757607510367E-006 + 4.239420535188819E-006 4.292745880951059E-006 4.346741976990860E-006 4.401417260308082E-006 + 4.456780274026979E-006 4.512839668731084E-006 4.569604203814868E-006 4.627082748852433E-006 + 4.685284284983378E-006 4.744217906316140E-006 4.803892821348948E-006 4.864318354408684E-006 + 4.925503947107832E-006 4.987459159819732E-006 5.050193673172419E-006 5.113717289561237E-006 + 5.178039934680484E-006 5.243171659074332E-006 5.309122639707228E-006 5.375903181554071E-006 + 5.443523719210392E-006 5.511994818522769E-006 5.581327178239786E-006 5.651531631683702E-006 + 5.722619148443200E-006 5.794600836087401E-006 5.867487941901439E-006 5.941291854643906E-006 + 6.016024106326311E-006 6.091696374015025E-006 6.168320481655831E-006 6.245908401921438E-006 + 6.324472258082256E-006 6.404024325900625E-006 6.484577035549010E-006 6.566142973552175E-006 + 6.648734884753874E-006 6.732365674308284E-006 6.817048409696394E-006 6.902796322767921E-006 + 6.989622811808727E-006 7.077541443634370E-006 7.166565955709964E-006 7.256710258296617E-006 + 7.347988436625027E-006 7.440414753096259E-006 7.534003649510296E-006 7.628769749322631E-006 + 7.724727859929137E-006 7.821892974979846E-006 7.920280276721661E-006 8.019905138370640E-006 + 8.120783126514127E-006 8.222930003542982E-006 8.326361730114578E-006 8.431094467646617E-006 + 8.537144580842415E-006 8.644528640247941E-006 8.753263424840918E-006 8.863365924652690E-006 + 8.974853343422843E-006 9.087743101287382E-006 9.202052837500671E-006 9.317800413191524E-006 + 9.435003914154157E-006 9.553681653674044E-006 9.673852175389423E-006 9.795534256188829E-006 + 9.918746909144919E-006 1.004350938648542E-005 1.016984118260123E-005 1.029776203709252E-005 + 1.042729193785309E-005 1.055845112419341E-005 1.069126009000324E-005 1.082573958695366E-005 + 1.096191062773968E-005 1.109979448936348E-005 1.123941271645893E-005 1.138078712465810E-005 + 1.152393980399989E-005 1.166889312238168E-005 1.181566972905441E-005 1.196429255816145E-005 + 1.211478483232226E-005 1.226717006626084E-005 1.242147207048002E-005 1.257771495498191E-005 + 1.273592313303505E-005 1.289612132498918E-005 1.305833456213770E-005 1.322258819062893E-005 + 1.338890787542653E-005 1.355731960431959E-005 1.372784969198342E-005 1.390052478409115E-005 + 1.407537186147722E-005 1.425241824435323E-005 1.443169159657668E-005 1.461321992997360E-005 + 1.479703160871541E-005 1.498315535375086E-005 1.517162024729383E-005 1.536245573736731E-005 + 1.555569164240493E-005 1.575135815590997E-005 1.594948585117325E-005 1.615010568605028E-005 + 1.635324900779837E-005 1.655894755797490E-005 1.676723347739679E-005 1.697813931116273E-005 + 1.719169801373833E-005 1.740794295410535E-005 1.762690792097570E-005 1.784862712807092E-005 + 1.807313521946821E-005 1.830046727501363E-005 1.853065881580334E-005 1.876374580973396E-005 + 1.899976467712248E-005 1.923875229639712E-005 1.948074600985962E-005 1.972578362952004E-005 + 1.997390344300500E-005 2.022514421954015E-005 2.047954521600798E-005 2.073714618308176E-005 + 2.099798737143671E-005 2.126210953803918E-005 2.152955395251506E-005 2.180036240359825E-005 + 2.207457720566018E-005 2.235224120532156E-005 2.263339778814727E-005 2.291809088542539E-005 + 2.320636498103156E-005 2.349826511837974E-005 2.379383690746026E-005 2.409312653196651E-005 + 2.439618075651123E-005 2.470304693393355E-005 2.501377301269806E-005 2.532840754438670E-005 + 2.564699969128521E-005 2.596959923406471E-005 2.629625657956009E-005 2.662702276864618E-005 + 2.696194948421295E-005 2.730108905924116E-005 2.764449448497937E-005 2.799221941922401E-005 + 2.834431819470353E-005 2.870084582756792E-005 2.906185802598521E-005 2.942741119884586E-005 + 2.979756246457686E-005 3.017236966006657E-005 3.055189134970183E-005 3.093618683451877E-005 + 3.132531616146878E-005 3.171934013280086E-005 3.211832031556220E-005 3.252231905121807E-005 + 3.293139946539287E-005 3.334562547773359E-005 3.376506181189740E-005 3.418977400566488E-005 + 3.461982842118036E-005 3.505529225532126E-005 3.549623355019761E-005 3.594272120378380E-005 + 3.639482498068413E-005 3.685261552303353E-005 3.731616436153564E-005 3.778554392663957E-005 + 3.826082755985731E-005 3.874208952522355E-005 3.922940502089949E-005 3.972285019092280E-005 + 4.022250213710520E-005 4.072843893107983E-005 4.124073962650011E-005 4.175948427139195E-005 + 4.228475392066155E-005 4.281663064876024E-005 4.335519756250890E-005 4.390053881408356E-005 + 4.445273961416424E-005 4.501188624524945E-005 4.557806607513788E-005 4.615136757057984E-005 + 4.673188031110035E-005 4.731969500299625E-005 4.791490349350905E-005 4.851759878517634E-005 + 4.912787505036363E-005 4.974582764597893E-005 5.037155312837264E-005 5.100514926842437E-005 + 5.164671506682007E-005 5.229635076952103E-005 5.295415788342744E-005 5.362023919223924E-005 + 5.429469877251605E-005 5.497764200993949E-005 5.566917561577987E-005 5.636940764356998E-005 + 5.707844750598891E-005 5.779640599195764E-005 5.852339528395031E-005 5.925952897552290E-005 + 6.000492208906228E-005 6.075969109375911E-005 6.152395392380587E-005 6.229782999682469E-005 + 6.308144023252646E-005 6.387490707160467E-005 6.467835449486737E-005 6.549190804260906E-005 + 6.631569483422671E-005 6.714984358808254E-005 6.799448464161636E-005 6.884974997171135E-005 + 6.971577321531534E-005 7.059268969032204E-005 7.148063641671481E-005 7.237975213797611E-005 + 7.329017734276679E-005 7.421205428687729E-005 7.514552701545572E-005 7.609074138551506E-005 + 7.704784508872366E-005 7.801698767448249E-005 7.899832057329226E-005 7.999199712041492E-005 + 8.099817257983264E-005 8.201700416850794E-005 8.304865108094955E-005 8.409327451408635E-005 + 8.515103769245505E-005 8.622210589370434E-005 8.730664647441969E-005 8.840482889627349E-005 + 8.951682475250335E-005 9.064280779472418E-005 9.178295396007720E-005 9.293744139872022E-005 + 9.410645050166459E-005 9.529016392896091E-005 9.648876663824046E-005 9.770244591361516E-005 + 9.893139139494103E-005 1.001757951074498E-004 1.014358514917534E-004 1.027117574342254E-004 + 1.040037122977652E-004 1.053119179529487E-004 1.066365788095711E-004 1.079779018485864E-004 + 1.093360966544482E-004 1.107113754478583E-004 1.121039531189262E-004 1.135140472607460E-004 + 1.149418782033966E-004 1.163876690483676E-004 1.178516457034199E-004 1.193340369178844E-004 + 1.208350743184042E-004 1.223549924451272E-004 1.238940287883529E-004 1.254524238256412E-004 + 1.270304210593872E-004 1.286282670548690E-004 1.302462114787745E-004 1.318845071382115E-004 + 1.335434100202099E-004 1.352231793317203E-004 1.369240775401147E-004 1.386463704141991E-004 + 1.403903270657390E-004 1.421562199915092E-004 1.439443251158722E-004 1.457549218338914E-004 + 1.475882930549880E-004 1.494447252471452E-004 1.513245084816698E-004 1.532279364785168E-004 + 1.551553066521832E-004 1.571069201581800E-004 1.590830819400880E-004 1.610841007772061E-004 + 1.631102893327989E-004 1.651619642029503E-004 1.672394459660331E-004 1.693430592327994E-004 + 1.714731326971020E-004 1.736299991872533E-004 1.758139957180304E-004 1.780254635433350E-004 + 1.802647482095138E-004 1.825321996093519E-004 1.848281720367436E-004 1.871530242420516E-004 + 1.895071194881635E-004 1.918908256072506E-004 1.943045150582437E-004 1.967485649850304E-004 + 1.992233572753838E-004 2.017292786206348E-004 2.042667205760916E-004 2.068360796222222E-004 + 2.094377572266052E-004 2.120721599066591E-004 2.147396992931627E-004 2.174407921945722E-004 + 2.201758606621488E-004 2.229453320559051E-004 2.257496391113808E-004 2.285892200072590E-004 + 2.314645184338317E-004 2.343759836623281E-004 2.373240706151133E-004 2.403092399367714E-004 + 2.433319580660827E-004 2.463926973089046E-004 2.494919359119709E-004 2.526301581376188E-004 + 2.558078543394555E-004 2.590255210389779E-004 2.622836610031544E-004 2.655827833229828E-004 + 2.689234034930378E-004 2.723060434920173E-004 2.757312318643035E-004 2.791995038025481E-004 + 2.827114012312976E-004 2.862674728916704E-004 2.898682744270980E-004 2.935143684701466E-004 + 2.972063247304283E-004 3.009447200836201E-004 3.047301386616017E-004 3.085631719437273E-004 + 3.124444188492459E-004 3.163744858308829E-004 3.203539869695998E-004 3.243835440705460E-004 + 3.284637867602164E-004 3.325953525848331E-004 3.367788871099617E-004 3.410150440213832E-004 + 3.453044852272335E-004 3.496478809614277E-004 3.540459098883866E-004 3.584992592090775E-004 + 3.630086247683923E-004 3.675747111638740E-004 3.721982318558110E-004 3.768799092787193E-004 + 3.816204749542204E-004 3.864206696053460E-004 3.912812432722764E-004 3.962029554295356E-004 + 4.011865751046622E-004 4.062328809983694E-004 4.113426616062197E-004 4.165167153418292E-004 + 4.217558506616203E-004 4.270608861911467E-004 4.324326508530024E-004 4.378719839963450E-004 + 4.433797355280445E-004 4.489567660454830E-004 4.546039469710261E-004 4.603221606881823E-004 + 4.661123006794789E-004 4.719752716660694E-004 4.779119897490985E-004 4.839233825528458E-004 + 4.900103893696666E-004 4.961739613067605E-004 5.024150614347822E-004 5.087346649383242E-004 + 5.151337592682918E-004 5.216133442961929E-004 5.281744324703708E-004 5.348180489742016E-004 + 5.415452318862799E-004 5.483570323426231E-004 5.552545147009109E-004 5.622387567067949E-004 + 5.693108496622981E-004 5.764718985963322E-004 5.837230224373638E-004 5.910653541882449E-004 + 5.985000411032498E-004 6.060282448673347E-004 6.136511417776539E-004 6.213699229273591E-004 + 6.291857943917088E-004 6.370999774165205E-004 6.451137086089936E-004 6.532282401309302E-004 + 6.614448398943911E-004 6.697647917598055E-004 6.781893957365794E-004 6.867199681862240E-004 + 6.953578420280401E-004 7.041043669473900E-004 7.129609096065869E-004 7.219288538584402E-004 + 7.310096009624844E-004 7.402045698039289E-004 7.495151971153638E-004 7.589429377012485E-004 + 7.684892646652306E-004 7.781556696403202E-004 7.879436630219601E-004 7.978547742040319E-004 + 8.078905518178214E-004 8.180525639739983E-004 8.283423985076372E-004 8.387616632263177E-004 + 8.493119861613521E-004 8.599950158221627E-004 8.708124214538689E-004 8.817658932981092E-004 + 8.928571428571428E-004 9.040879031612808E-004 9.154599290396690E-004 9.269749973944872E-004 + 9.386349074785935E-004 9.504414811766604E-004 9.623965632898498E-004 9.745020218240645E-004 + 9.867597482818289E-004 9.991716579578406E-004 1.011739690238238E-003 1.024465808903636E-003 + 1.037352002435968E-003 1.050400284329188E-003 1.063612693403892E-003 1.076991294125876E-003 + 1.090538176928724E-003 1.104255458540433E-003 1.118145282314165E-003 1.132209818563143E-003 + 1.146451264899769E-003 1.160871846579010E-003 1.175473816846091E-003 1.190259457288575E-003 + 1.205231078192861E-003 1.220391018905176E-003 1.235741648197100E-003 1.251285364635691E-003 + 1.267024596958266E-003 1.282961804451898E-003 1.299099477337680E-003 1.315440137159836E-003 + 1.331986337179706E-003 1.348740662774709E-003 1.365705731842303E-003 1.382884195209047E-003 + 1.400278737044794E-003 1.417892075282093E-003 1.435726962040878E-003 1.453786184058492E-003 + 1.472072563125115E-003 1.490588956524681E-003 1.509338257481332E-003 1.528323395611487E-003 + 1.547547337381604E-003 1.567013086571695E-003 1.586723684744678E-003 1.606682211721616E-003 + 1.626891786062956E-003 1.647355565555805E-003 1.668076747707342E-003 1.689058570244438E-003 + 1.710304311619551E-003 1.731817291522996E-003 1.753600871401651E-003 1.775658454984190E-003 + 1.797993488812926E-003 1.820609462782336E-003 1.843509910684364E-003 1.866698410760587E-003 + 1.890178586261317E-003 1.913954106011750E-003 1.938028684985218E-003 1.962406084883664E-003 + 1.987090114725418E-003 2.012084631440365E-003 2.037393540472593E-003 2.063020796390629E-003 + 2.088970403505350E-003 2.115246416495662E-003 2.141852941042052E-003 2.168794134468115E-003 + 2.196074206390134E-003 2.223697419374851E-003 2.251668089605491E-003 2.279990587556185E-003 + 2.308669338674863E-003 2.337708824074734E-003 2.367113581234472E-003 2.396888204707207E-003 + 2.427037346838433E-003 2.457565718492953E-003 2.488478089790939E-003 2.519779290853303E-003 + 2.551474212556399E-003 2.583567807296216E-003 2.616065089762237E-003 2.648971137720954E-003 + 2.682291092809314E-003 2.716030161338095E-003 2.750193615105385E-003 2.784786792220353E-003 + 2.819815097937294E-003 2.855284005500245E-003 2.891199056998181E-003 2.927565864230959E-003 + 2.964390109586207E-003 3.001677546927170E-003 3.039434002491802E-003 3.077665375803105E-003 + 3.116377640590930E-003 3.155576845725423E-003 3.195269116162126E-003 3.235460653899054E-003 + 3.276157738945756E-003 3.317366730304557E-003 3.359094066964209E-003 3.401346268905949E-003 + 3.444129938122298E-003 3.487451759648620E-003 3.531318502607658E-003 3.575737021267258E-003 + 3.620714256111318E-003 3.666257234924296E-003 3.712373073889295E-003 3.759068978699964E-003 + 3.806352245686449E-003 3.854230262955398E-003 3.902710511544426E-003 3.951800566591015E-003 + 4.001508098516129E-003 4.051840874222774E-003 4.102806758309545E-003 4.154413714299526E-003 + 4.206669805884594E-003 4.259583198185360E-003 4.313162159027040E-003 4.367415060231256E-003 + 4.422350378924208E-003 4.477976698861217E-003 4.534302711767930E-003 4.591337218698475E-003 + 4.649089131410582E-003 4.707567473758116E-003 4.766781383101054E-003 4.826740111733185E-003 + 4.887453028327862E-003 4.948929619401809E-003 5.011179490797459E-003 5.074212369183883E-003 + 5.138038103576546E-003 5.202666666876321E-003 5.268108157427696E-003 5.334372800596717E-003 + 5.401470950368707E-003 5.469413090966059E-003 5.538209838486493E-003 5.607871942561756E-003 + 5.678410288037348E-003 5.749835896673272E-003 5.822159928866173E-003 5.895393685393245E-003 + 5.969548609177922E-003 6.044636287077923E-003 6.120668451695699E-003 6.197656983211640E-003 + 6.275613911240448E-003 6.354551416710712E-003 6.434481833768273E-003 6.515417651703426E-003 + 6.597371516902366E-003 6.680356234823291E-003 6.764384771997187E-003 6.849470258053954E-003 + 6.935625987773909E-003 7.022865423165083E-003 7.111202195566768E-003 7.200650107779353E-003 + 7.291223136221114E-003 7.382935433112030E-003 7.475801328685059E-003 7.569835333425342E-003 + 7.665052140337410E-003 7.761466627241073E-003 7.859093859096085E-003 7.957949090356013E-003 + 8.058047767351901E-003 8.159405530705648E-003 8.262038217774008E-003 8.365961865123157E-003 + 8.471192711034399E-003 8.577747198041530E-003 8.685641975499902E-003 8.794893902188019E-003 + 8.905520048941721E-003 9.017537701321477E-003 9.130964362313402E-003 9.245817755064013E-003 + 9.362115825649617E-003 9.479876745880368E-003 9.599118916139604E-003 9.719860968259062E-003 + 9.842121768430006E-003 9.965920420151219E-003 1.009127626721392E-002 1.021820889672422E-002 + 1.034673814216375E-002 1.047688408648858E-002 1.060866706526732E-002 1.074210766985852E-002 + 1.087722675062810E-002 1.101404542020738E-002 1.115258505679180E-002 1.129286730748145E-002 + 1.143491409166343E-002 1.157874760443673E-002 1.172439032008038E-002 1.187186499556499E-002 + 1.202119467410867E-002 1.217240268877747E-002 1.232551266613133E-002 1.248054852991576E-002 + 1.263753450479983E-002 1.279649512016156E-002 1.295745521392047E-002 1.312043993641870E-002 + 1.328547475435076E-002 1.345258545474267E-002 1.362179814898141E-002 1.379313927689467E-002 + 1.396663561088230E-002 1.414231426009949E-002 1.432020267469257E-002 1.450032865008826E-002 + 1.468272033133666E-002 1.486740621750906E-002 1.505441516615094E-002 1.524377639779095E-002 + 1.543551950050684E-002 1.562967443454847E-002 1.582627153701932E-002 1.602534152661666E-002 + 1.622691550843131E-002 1.643102497880810E-002 1.663770183026698E-002 1.684697835648650E-002 + 1.705888725734970E-002 1.727346164405341E-002 1.749073504428216E-002 1.771074140744673E-002 + 1.793351510998899E-002 1.815909096075324E-002 1.838750420642503E-002 1.861879053703878E-002 + 1.885298609155413E-002 1.909012746350298E-002 1.933025170670721E-002 1.957339634106828E-002 + 1.981959935843006E-002 2.006889922851485E-002 2.032133490493458E-002 2.057694583127732E-002 + 2.083577194727029E-002 2.109785369502076E-002 2.136323202533496E-002 2.163194840411695E-002 + 2.190404481884765E-002 2.217956378514540E-002 2.245854835340928E-002 2.274104211554562E-002 + 2.302708921177952E-002 2.331673433755178E-002 2.361002275050250E-002 2.390700027754300E-002 + 2.420771332201599E-002 2.451220887094652E-002 2.482053450238365E-002 2.513273839283451E-002 + 2.544886932479225E-002 2.576897669435807E-002 2.609311051895977E-002 2.642132144516695E-002 + 2.675366075660449E-002 2.709018038196604E-002 2.743093290312762E-002 2.777597156336398E-002 + 2.812535027566783E-002 2.847912363117366E-002 2.883734690768815E-002 2.920007607832694E-002 + 2.956736782026100E-002 2.993927952357229E-002 3.031586930022104E-002 3.069719599312611E-002 + 3.108331918535897E-002 3.147429920945406E-002 3.187019715683564E-002 3.227107488736333E-002 + 3.267699503899825E-002 3.308802103758982E-002 3.350421710678660E-002 3.392564827807126E-002 + 3.435238040092156E-002 3.478448015310002E-002 3.522201505107191E-002 3.566505346055530E-002 + 3.611366460720307E-002 3.656791858741947E-002 3.702788637931322E-002 3.749363985378751E-002 + 3.796525178577034E-002 3.844279586558567E-002 3.892634671046742E-002 3.941597987621902E-002 + 3.991177186901863E-002 4.041380015737391E-002 4.092214318422635E-002 4.143688037920802E-002 + 4.195809217105299E-002 4.248586000016402E-002 4.302026633133824E-002 4.356139466665221E-002 + 4.410932955850910E-002 4.466415662285073E-002 4.522596255253453E-002 4.579483513088009E-002 + 4.637086324538526E-002 4.695413690161469E-002 4.754474723726401E-002 4.814278653639961E-002 + 4.874834824387878E-002 4.936152697995044E-002 4.998241855503943E-002 5.061111998471775E-002 + 5.124772950486272E-002 5.189234658700714E-002 5.254507195388167E-002 5.320600759515268E-002 + 5.387525678335899E-002 5.455292409004765E-002 5.523911540211419E-002 5.593393793834725E-002 + 5.663750026618156E-002 5.734991231866246E-002 5.807128541162233E-002 5.880173226107474E-002 + 5.954136700082609E-002 6.029030520030905E-002 6.104866388264128E-002 6.181656154290950E-002 + 6.259411816668559E-002 6.338145524877405E-002 6.417869581219558E-002 6.498596442741048E-002 + 6.580338723178202E-002 6.663109194928653E-002 6.746920791047026E-002 6.831786607265704E-002 + 6.917719904041159E-002 7.004734108625818E-002 7.092842817166191E-002 7.182059796827260E-002 + 7.272398987943583E-002 7.363874506197599E-002 7.456500644825113E-002 7.550291876848751E-002 + 7.645262857339347E-002 7.741428425705793E-002 7.838803608013834E-002 7.937403619333780E-002 + 8.037243866118021E-002 8.138339948608256E-002 8.240707663273028E-002 8.344363005276050E-002 + 8.449322170975371E-002 8.555601560454187E-002 8.663217780083345E-002 8.772187645116078E-002 + 8.882528182315531E-002 8.994256632615100E-002 9.107390453812474E-002 9.221947323297398E-002 + 9.337945140813772E-002 9.455402031256610E-002 9.574336347503980E-002 9.694766673284787E-002 + 9.816711826082467E-002 9.940190860075210E-002 1.006522306911333E-001 1.019182798973384E-001 + 1.032002540421318E-001 1.044983534365821E-001 1.058127809113601E-001 1.071437418484336E-001 + 1.084914442131562E-001 1.098560985867648E-001 1.112379181992817E-001 1.126371189628323E-001 + 1.140539195053831E-001 1.154885412049009E-001 1.169412082239452E-001 1.184121475446934E-001 + 1.199015890044067E-001 1.214097653313438E-001 1.229369121811239E-001 1.244832681735493E-001 + 1.260490749298902E-001 1.276345771106375E-001 1.292400224537331E-001 1.308656618132778E-001 + 1.325117491987291E-001 1.341785418145902E-001 1.358663001005979E-001 1.375752877724187E-001 + 1.393057718628528E-001 1.410580227635603E-001 1.428323142673096E-001 1.446289236107575E-001 + 1.464481315177696E-001 1.482902222432822E-001 1.501554836177192E-001 1.520442070919653E-001 + 1.539566877829057E-001 1.558932245195397E-001 1.578541198896719E-001 1.598396802871935E-001 + 1.618502159599566E-001 1.638860410582500E-001 1.659474736838878E-001 1.680348359399112E-001 + 1.701484539809197E-001 1.722886580640327E-001 1.744557826004919E-001 1.766501662079159E-001 + 1.788721517632070E-001 1.811220864561294E-001 1.834003218435566E-001 1.857072139044024E-001 + 1.880431230952453E-001 1.904084144066482E-001 1.928034574201912E-001 1.952286263662180E-001 + 1.976843001823100E-001 2.001708625724976E-001 2.026887020672126E-001 2.052382120839990E-001 + 2.078197909889842E-001 2.104338421591238E-001 2.130807740452320E-001 2.157610002358007E-001 + 2.184749395216254E-001 2.212230159612414E-001 2.240056589471827E-001 2.268233032730780E-001 + 2.296763892015848E-001 2.325653625331846E-001 2.354906746758386E-001 2.384527827155198E-001 + 2.414521494876367E-001 2.444892436493487E-001 2.475645397527982E-001 2.506785183192585E-001 + 2.538316659142151E-001 2.570244752233958E-001 2.602574451297501E-001 2.635310807914038E-001 + 2.668458937205898E-001 2.702024018635713E-001 2.736011296815755E-001 2.770426082327379E-001 + 2.805273752550841E-001 2.840559752505519E-001 2.876289595700683E-001 2.912468864997039E-001 + 2.949103213479009E-001 2.986198365338081E-001 3.023760116767211E-001 3.061794336866468E-001 + 3.100306968560134E-001 3.139304029525257E-001 3.178791613131957E-001 3.218775889395515E-001 + 3.259263105940438E-001 3.300259588976690E-001 3.341771744288145E-001 3.383806058233532E-001 + 3.426369098759932E-001 3.469467516429007E-001 3.513108045456218E-001 3.557297504763000E-001 + 3.602042799042278E-001 3.647350919837327E-001 3.693228946634186E-001 3.739684047967896E-001 + 3.786723482542541E-001 3.834354600365482E-001 3.882584843895791E-001 3.931421749207134E-001 + 3.980872947165335E-001 4.030946164620674E-001 4.081649225615258E-001 4.132990052605532E-001 + 4.184976667700152E-001 4.237617193913509E-001 4.290919856434905E-001 4.344892983913815E-001 + 4.399545009761221E-001 4.454884473467339E-001 4.510920021935978E-001 4.567660410835574E-001 + 4.625114505967339E-001 4.683291284650539E-001 4.742199837125189E-001 4.801849367972477E-001 + 4.862249197552941E-001 4.923408763462847E-001 4.985337622008804E-001 5.048045449700939E-001 + 5.111542044764927E-001 5.175837328672914E-001 5.240941347693829E-001 5.306864274463109E-001 + 5.373616409572163E-001 5.441208183177929E-001 5.509650156632534E-001 5.578953024133581E-001 + 5.649127614395126E-001 5.720184892339651E-001 5.792135960811420E-001 5.864992062311247E-001 + 5.938764580753231E-001 6.013465043243478E-001 6.089105121881211E-001 6.165696635582628E-001 + 6.243251551927552E-001 6.321781989029459E-001 6.401300217428929E-001 6.481818662010906E-001 + 6.563349903946196E-001 6.645906682657206E-001 6.729501897808583E-001 6.814148611322783E-001 + 6.899860049420983E-001 6.986649604689790E-001 7.074530838173767E-001 7.163517481494455E-001 + 7.253623438995929E-001 7.344862789917344E-001 7.437249790592935E-001 7.530798876679498E-001 + 7.625524665412068E-001 7.721441957887874E-001 7.818565741378982E-001 7.916911191674190E-001 + 8.016493675450165E-001 8.117328752672610E-001 8.219432179027509E-001 8.322819908382931E-001 + 8.427508095281961E-001 8.533513097466765E-001 8.640851478434612E-001 8.749540010025930E-001 + 8.859595675044876E-001 8.971035669913052E-001 9.083877407356351E-001 9.198138519125838E-001 + 9.313836858752714E-001 9.430990504337903E-001 9.549617761376910E-001 9.669737165619966E-001 + 9.791367485968382E-001 9.914527727407189E-001 1.003923713397465E+000 1.016551519176929E+000 + 1.029338163199454E+000 1.042285643404183E+000 1.055395982861243E+000 1.068671230087843E+000 + 1.082113459368374E+000 1.095724771078506E+000 1.109507292013389E+000 1.123463175719961E+000 + 1.137594602833441E+000 1.151903781418070E+000 1.166392947312110E+000 1.181064364477212E+000 + 1.195920325352160E+000 1.210963151211061E+000 1.226195192526065E+000 1.241618829334612E+000 + 1.257236471611336E+000 +/ + +&local +vloc(1:1141) = +-1.277124356888939E+001 -1.277124356882264E+001 -1.277124356875419E+001 -1.277124356868401E+001 +-1.277124356861206E+001 -1.277124356853828E+001 -1.277124356846264E+001 -1.277124356838508E+001 +-1.277124356830557E+001 -1.277124356822403E+001 -1.277124356814044E+001 -1.277124356805473E+001 +-1.277124356796685E+001 -1.277124356787675E+001 -1.277124356778436E+001 -1.277124356768963E+001 +-1.277124356759252E+001 -1.277124356749293E+001 -1.277124356739083E+001 -1.277124356728614E+001 +-1.277124356717881E+001 -1.277124356706875E+001 -1.277124356695591E+001 -1.277124356684021E+001 +-1.277124356672158E+001 -1.277124356659995E+001 -1.277124356647524E+001 -1.277124356634738E+001 +-1.277124356621627E+001 -1.277124356608185E+001 -1.277124356594402E+001 -1.277124356580270E+001 +-1.277124356565781E+001 -1.277124356550925E+001 -1.277124356535692E+001 -1.277124356520075E+001 +-1.277124356504061E+001 -1.277124356487642E+001 -1.277124356470808E+001 -1.277124356453547E+001 +-1.277124356435849E+001 -1.277124356417704E+001 -1.277124356399098E+001 -1.277124356380022E+001 +-1.277124356360464E+001 -1.277124356340409E+001 -1.277124356319848E+001 -1.277124356298765E+001 +-1.277124356277149E+001 -1.277124356254986E+001 -1.277124356232261E+001 -1.277124356208962E+001 +-1.277124356185072E+001 -1.277124356160578E+001 -1.277124356135463E+001 -1.277124356109713E+001 +-1.277124356083311E+001 -1.277124356056240E+001 -1.277124356028484E+001 -1.277124356000025E+001 +-1.277124355970846E+001 -1.277124355940929E+001 -1.277124355910253E+001 -1.277124355878802E+001 +-1.277124355846554E+001 -1.277124355813490E+001 -1.277124355779588E+001 -1.277124355744828E+001 +-1.277124355709189E+001 -1.277124355672647E+001 -1.277124355635180E+001 -1.277124355596765E+001 +-1.277124355557377E+001 -1.277124355516992E+001 -1.277124355475585E+001 -1.277124355433129E+001 +-1.277124355389598E+001 -1.277124355344966E+001 -1.277124355299203E+001 -1.277124355252282E+001 +-1.277124355204174E+001 -1.277124355154847E+001 -1.277124355104271E+001 -1.277124355052416E+001 +-1.277124354999247E+001 -1.277124354944733E+001 -1.277124354888838E+001 -1.277124354831529E+001 +-1.277124354772768E+001 -1.277124354712520E+001 -1.277124354650747E+001 -1.277124354587410E+001 +-1.277124354522469E+001 -1.277124354455885E+001 -1.277124354387615E+001 -1.277124354317616E+001 +-1.277124354245846E+001 -1.277124354172258E+001 -1.277124354096808E+001 -1.277124354019448E+001 +-1.277124353940129E+001 -1.277124353858802E+001 -1.277124353775417E+001 -1.277124353689920E+001 +-1.277124353602259E+001 -1.277124353512379E+001 -1.277124353420224E+001 -1.277124353325735E+001 +-1.277124353228855E+001 -1.277124353129522E+001 -1.277124353027675E+001 -1.277124352923249E+001 +-1.277124352816179E+001 -1.277124352706399E+001 -1.277124352593840E+001 -1.277124352478431E+001 +-1.277124352360101E+001 -1.277124352238775E+001 -1.277124352114378E+001 -1.277124351986832E+001 +-1.277124351856056E+001 -1.277124351721971E+001 -1.277124351584490E+001 -1.277124351443530E+001 +-1.277124351299001E+001 -1.277124351150813E+001 -1.277124350998874E+001 -1.277124350843088E+001 +-1.277124350683358E+001 -1.277124350519586E+001 -1.277124350351666E+001 -1.277124350179497E+001 +-1.277124350002968E+001 -1.277124349821971E+001 -1.277124349636392E+001 -1.277124349446114E+001 +-1.277124349251020E+001 -1.277124349050987E+001 -1.277124348845890E+001 -1.277124348635602E+001 +-1.277124348419989E+001 -1.277124348198918E+001 -1.277124347972251E+001 -1.277124347739846E+001 +-1.277124347501557E+001 -1.277124347257236E+001 -1.277124347006730E+001 -1.277124346749882E+001 +-1.277124346486532E+001 -1.277124346216515E+001 -1.277124345939663E+001 -1.277124345655802E+001 +-1.277124345364755E+001 -1.277124345066341E+001 -1.277124344760371E+001 -1.277124344446656E+001 +-1.277124344125000E+001 -1.277124343795200E+001 -1.277124343457052E+001 -1.277124343110343E+001 +-1.277124342754857E+001 -1.277124342390372E+001 -1.277124342016660E+001 -1.277124341633487E+001 +-1.277124341240614E+001 -1.277124340837796E+001 -1.277124340424780E+001 -1.277124340001309E+001 +-1.277124339567117E+001 -1.277124339121933E+001 -1.277124338665480E+001 -1.277124338197471E+001 +-1.277124337717614E+001 -1.277124337225610E+001 -1.277124336721151E+001 -1.277124336203921E+001 +-1.277124335673597E+001 -1.277124335129848E+001 -1.277124334572334E+001 -1.277124334000705E+001 +-1.277124333414606E+001 -1.277124332813670E+001 -1.277124332197521E+001 -1.277124331565774E+001 +-1.277124330918034E+001 -1.277124330253896E+001 -1.277124329572945E+001 -1.277124328874756E+001 +-1.277124328158892E+001 -1.277124327424905E+001 -1.277124326672337E+001 -1.277124325900718E+001 +-1.277124325109566E+001 -1.277124324298385E+001 -1.277124323466667E+001 -1.277124322613896E+001 +-1.277124321739536E+001 -1.277124320843041E+001 -1.277124319923851E+001 -1.277124318981391E+001 +-1.277124318015073E+001 -1.277124317024291E+001 -1.277124316008428E+001 -1.277124314966848E+001 +-1.277124313898900E+001 -1.277124312803916E+001 -1.277124311681212E+001 -1.277124310530087E+001 +-1.277124309349820E+001 -1.277124308139674E+001 -1.277124306898893E+001 -1.277124305626701E+001 +-1.277124304322303E+001 -1.277124302984883E+001 -1.277124301613606E+001 -1.277124300207614E+001 +-1.277124298766029E+001 -1.277124297287949E+001 -1.277124295772451E+001 -1.277124294218587E+001 +-1.277124292625386E+001 -1.277124290991852E+001 -1.277124289316965E+001 -1.277124287599677E+001 +-1.277124285838914E+001 -1.277124284033578E+001 -1.277124282182537E+001 -1.277124280284636E+001 +-1.277124278338689E+001 -1.277124276343479E+001 -1.277124274297758E+001 -1.277124272200249E+001 +-1.277124270049640E+001 -1.277124267844586E+001 -1.277124265583710E+001 -1.277124263265599E+001 +-1.277124260888802E+001 -1.277124258451835E+001 -1.277124255953174E+001 -1.277124253391258E+001 +-1.277124250764485E+001 -1.277124248071212E+001 -1.277124245309757E+001 -1.277124242478393E+001 +-1.277124239575351E+001 -1.277124236598815E+001 -1.277124233546926E+001 -1.277124230417775E+001 +-1.277124227209406E+001 -1.277124223919815E+001 -1.277124220546943E+001 -1.277124217088685E+001 +-1.277124213542876E+001 -1.277124209907302E+001 -1.277124206179688E+001 -1.277124202357707E+001 +-1.277124198438967E+001 -1.277124194421019E+001 -1.277124190301352E+001 -1.277124186077390E+001 +-1.277124181746494E+001 -1.277124177305954E+001 -1.277124172752997E+001 -1.277124168084775E+001 +-1.277124163298370E+001 -1.277124158390791E+001 -1.277124153358969E+001 -1.277124148199759E+001 +-1.277124142909935E+001 -1.277124137486191E+001 -1.277124131925136E+001 -1.277124126223294E+001 +-1.277124120377100E+001 -1.277124114382899E+001 -1.277124108236944E+001 -1.277124101935393E+001 +-1.277124095474307E+001 -1.277124088849646E+001 -1.277124082057268E+001 -1.277124075092928E+001 +-1.277124067952272E+001 -1.277124060630834E+001 -1.277124053124038E+001 -1.277124045427192E+001 +-1.277124037535482E+001 -1.277124029443975E+001 -1.277124021147613E+001 -1.277124012641208E+001 +-1.277124003919442E+001 -1.277123994976863E+001 -1.277123985807879E+001 -1.277123976406757E+001 +-1.277123966767621E+001 -1.277123956884442E+001 -1.277123946751043E+001 -1.277123936361087E+001 +-1.277123925708078E+001 -1.277123914785355E+001 -1.277123903586089E+001 -1.277123892103277E+001 +-1.277123880329740E+001 -1.277123868258115E+001 -1.277123855880856E+001 -1.277123843190222E+001 +-1.277123830178278E+001 -1.277123816836889E+001 -1.277123803157711E+001 -1.277123789132191E+001 +-1.277123774751559E+001 -1.277123760006821E+001 -1.277123744888758E+001 -1.277123729387917E+001 +-1.277123713494602E+001 -1.277123697198877E+001 -1.277123680490549E+001 -1.277123663359171E+001 +-1.277123645794028E+001 -1.277123627784135E+001 -1.277123609318229E+001 -1.277123590384763E+001 +-1.277123570971893E+001 -1.277123551067480E+001 -1.277123530659074E+001 -1.277123509733911E+001 +-1.277123488278903E+001 -1.277123466280631E+001 -1.277123443725336E+001 -1.277123420598909E+001 +-1.277123396886885E+001 -1.277123372574432E+001 -1.277123347646342E+001 -1.277123322087023E+001 +-1.277123295880484E+001 -1.277123269010332E+001 -1.277123241459759E+001 -1.277123213211529E+001 +-1.277123184247969E+001 -1.277123154550961E+001 -1.277123124101924E+001 -1.277123092881808E+001 +-1.277123060871080E+001 -1.277123028049712E+001 -1.277122994397168E+001 -1.277122959892391E+001 +-1.277122924513791E+001 -1.277122888239228E+001 -1.277122851046006E+001 -1.277122812910848E+001 +-1.277122773809890E+001 -1.277122733718661E+001 -1.277122692612072E+001 -1.277122650464395E+001 +-1.277122607249251E+001 -1.277122562939592E+001 -1.277122517507682E+001 -1.277122470925085E+001 +-1.277122423162641E+001 -1.277122374190451E+001 -1.277122323977858E+001 -1.277122272493427E+001 +-1.277122219704925E+001 -1.277122165579302E+001 -1.277122110082668E+001 -1.277122053180274E+001 +-1.277121994836491E+001 -1.277121935014782E+001 -1.277121873677685E+001 -1.277121810786787E+001 +-1.277121746302700E+001 -1.277121680185036E+001 -1.277121612392382E+001 -1.277121542882272E+001 +-1.277121471611163E+001 -1.277121398534408E+001 -1.277121323606223E+001 -1.277121246779662E+001 +-1.277121168006590E+001 -1.277121087237645E+001 -1.277121004422213E+001 -1.277120919508395E+001 +-1.277120832442973E+001 -1.277120743171374E+001 -1.277120651637642E+001 -1.277120557784397E+001 +-1.277120461552801E+001 -1.277120362882521E+001 -1.277120261711689E+001 -1.277120157976865E+001 +-1.277120051612996E+001 -1.277119942553374E+001 -1.277119830729594E+001 -1.277119716071513E+001 +-1.277119598507202E+001 -1.277119477962902E+001 -1.277119354362979E+001 -1.277119227629871E+001 +-1.277119097684046E+001 -1.277118964443943E+001 -1.277118827825928E+001 -1.277118687744238E+001 +-1.277118544110921E+001 -1.277118396835791E+001 -1.277118245826361E+001 -1.277118090987788E+001 +-1.277117932222813E+001 -1.277117769431698E+001 -1.277117602512163E+001 -1.277117431359319E+001 +-1.277117255865605E+001 -1.277117075920715E+001 -1.277116891411528E+001 -1.277116702222040E+001 +-1.277116508233285E+001 -1.277116309323260E+001 -1.277116105366849E+001 -1.277115896235740E+001 +-1.277115681798345E+001 -1.277115461919713E+001 -1.277115236461447E+001 -1.277115005281612E+001 +-1.277114768234643E+001 -1.277114525171257E+001 -1.277114275938349E+001 -1.277114020378901E+001 +-1.277113758331872E+001 -1.277113489632105E+001 -1.277113214110210E+001 -1.277112931592462E+001 +-1.277112641900683E+001 -1.277112344852132E+001 -1.277112040259381E+001 -1.277111727930200E+001 +-1.277111407667425E+001 -1.277111079268835E+001 -1.277110742527019E+001 -1.277110397229242E+001 +-1.277110043157302E+001 -1.277109680087394E+001 -1.277109307789960E+001 -1.277108926029540E+001 +-1.277108534564617E+001 -1.277108133147461E+001 -1.277107721523962E+001 -1.277107299433470E+001 +-1.277106866608617E+001 -1.277106422775145E+001 -1.277105967651725E+001 -1.277105500949769E+001 +-1.277105022373242E+001 -1.277104531618462E+001 -1.277104028373907E+001 -1.277103512320000E+001 +-1.277102983128898E+001 -1.277102440464279E+001 -1.277101883981114E+001 -1.277101313325435E+001 +-1.277100728134104E+001 -1.277100128034562E+001 -1.277099512644589E+001 -1.277098881572038E+001 +-1.277098234414578E+001 -1.277097570759416E+001 -1.277096890183027E+001 -1.277096192250859E+001 +-1.277095476517045E+001 -1.277094742524094E+001 -1.277093989802587E+001 -1.277093217870850E+001 +-1.277092426234630E+001 -1.277091614386754E+001 -1.277090781806781E+001 -1.277089927960647E+001 +-1.277089052300294E+001 -1.277088154263293E+001 -1.277087233272454E+001 -1.277086288735426E+001 +-1.277085320044284E+001 -1.277084326575109E+001 -1.277083307687547E+001 -1.277082262724361E+001 +-1.277081191010973E+001 -1.277080091854986E+001 -1.277078964545695E+001 -1.277077808353583E+001 +-1.277076622529806E+001 -1.277075406305656E+001 -1.277074158892014E+001 -1.277072879478781E+001 +-1.277071567234303E+001 -1.277070221304762E+001 -1.277068840813567E+001 -1.277067424860712E+001 +-1.277065972522124E+001 -1.277064482848984E+001 -1.277062954867037E+001 -1.277061387575871E+001 +-1.277059779948182E+001 -1.277058130929007E+001 -1.277056439434947E+001 -1.277054704353353E+001 +-1.277052924541493E+001 -1.277051098825696E+001 -1.277049226000460E+001 -1.277047304827543E+001 +-1.277045334035017E+001 -1.277043312316297E+001 -1.277041238329137E+001 -1.277039110694596E+001 +-1.277036927995970E+001 -1.277034688777690E+001 -1.277032391544181E+001 -1.277030034758693E+001 +-1.277027616842086E+001 -1.277025136171580E+001 -1.277022591079461E+001 -1.277019979851748E+001 +-1.277017300726813E+001 -1.277014551893959E+001 -1.277011731491946E+001 -1.277008837607474E+001 +-1.277005868273612E+001 -1.277002821468173E+001 -1.276999695112037E+001 -1.276996487067412E+001 +-1.276993195136048E+001 -1.276989817057377E+001 -1.276986350506594E+001 -1.276982793092673E+001 +-1.276979142356317E+001 -1.276975395767832E+001 -1.276971550724926E+001 -1.276967604550438E+001 +-1.276963554489980E+001 -1.276959397709504E+001 -1.276955131292771E+001 -1.276950752238739E+001 +-1.276946257458860E+001 -1.276941643774270E+001 -1.276936907912885E+001 -1.276932046506391E+001 +-1.276927056087121E+001 -1.276921933084826E+001 -1.276916673823317E+001 -1.276911274516994E+001 +-1.276905731267236E+001 -1.276900040058668E+001 -1.276894196755282E+001 -1.276888197096413E+001 +-1.276882036692566E+001 -1.276875711021090E+001 -1.276869215421673E+001 -1.276862545091686E+001 +-1.276855695081331E+001 -1.276848660288618E+001 -1.276841435454135E+001 -1.276834015155629E+001 +-1.276826393802364E+001 -1.276818565629268E+001 -1.276810524690852E+001 -1.276802264854881E+001 +-1.276793779795806E+001 -1.276785062987929E+001 -1.276776107698300E+001 -1.276766906979330E+001 +-1.276757453661113E+001 -1.276747740343427E+001 -1.276737759387429E+001 -1.276727502907004E+001 +-1.276716962759763E+001 -1.276706130537680E+001 -1.276694997557344E+001 -1.276683554849809E+001 +-1.276671793150024E+001 -1.276659702885843E+001 -1.276647274166553E+001 -1.276634496770953E+001 +-1.276621360134917E+001 -1.276607853338445E+001 -1.276593965092170E+001 -1.276579683723298E+001 +-1.276564997160953E+001 -1.276549892920907E+001 -1.276534358089653E+001 -1.276518379307809E+001 +-1.276501942752813E+001 -1.276485034120869E+001 -1.276467638608134E+001 -1.276449740891079E+001 +-1.276431325106017E+001 -1.276412374827737E+001 -1.276392873047219E+001 -1.276372802148375E+001 +-1.276352143883785E+001 -1.276330879349363E+001 -1.276308988957932E+001 -1.276286452411621E+001 +-1.276263248673068E+001 -1.276239355935346E+001 -1.276214751590563E+001 -1.276189412197083E+001 +-1.276163313445287E+001 -1.276136430121820E+001 -1.276108736072254E+001 -1.276080204162084E+001 +-1.276050806235991E+001 -1.276020513075287E+001 -1.275989294353455E+001 -1.275957118589704E+001 +-1.275923953100440E+001 -1.275889763948563E+001 -1.275854515890482E+001 -1.275818172320755E+001 +-1.275780695214229E+001 -1.275742045065578E+001 -1.275702180826116E+001 -1.275661059837749E+001 +-1.275618637763958E+001 -1.275574868517647E+001 -1.275529704185744E+001 -1.275483094950369E+001 +-1.275434989006460E+001 -1.275385332475639E+001 -1.275334069316200E+001 -1.275281141229007E+001 +-1.275226487559121E+001 -1.275170045192987E+001 -1.275111748450941E+001 -1.275051528974858E+001 +-1.274989315610706E+001 -1.274925034285780E+001 -1.274858607880378E+001 -1.274789956093669E+001 +-1.274718995303495E+001 -1.274645638419835E+001 -1.274569794731653E+001 -1.274491369746833E+001 +-1.274410265024896E+001 -1.274326378002194E+001 -1.274239601809231E+001 -1.274149825079783E+001 +-1.274056931751463E+001 -1.273960800857342E+001 -1.273861306308270E+001 -1.273758316665471E+001 +-1.273651694903020E+001 -1.273541298159759E+001 -1.273426977480213E+001 -1.273308577544054E+001 +-1.273185936383610E+001 -1.273058885088970E+001 -1.272927247500126E+001 -1.272790839885665E+001 +-1.272649470607445E+001 -1.272502939770705E+001 -1.272351038859025E+001 -1.272193550353545E+001 +-1.272030247335823E+001 -1.271860893073716E+001 -1.271685240589616E+001 -1.271503032210404E+001 +-1.271313999098416E+001 -1.271117860762734E+001 -1.270914324550104E+001 -1.270703085114733E+001 +-1.270483823866231E+001 -1.270256208394960E+001 -1.270019891873995E+001 -1.269774512436958E+001 +-1.269519692530900E+001 -1.269255038243476E+001 -1.268980138603590E+001 -1.268694564854723E+001 +-1.268397869700134E+001 -1.268089586519148E+001 -1.267769228553724E+001 -1.267436288064526E+001 +-1.267090235455722E+001 -1.266730518367769E+001 -1.266356560737423E+001 -1.265967761824297E+001 +-1.265563495203283E+001 -1.265143107722195E+001 -1.264705918424054E+001 -1.264251217433474E+001 +-1.263778264806681E+001 -1.263286289344747E+001 -1.262774487369725E+001 -1.262242021463448E+001 +-1.261688019168843E+001 -1.261111571653766E+001 -1.260511732337433E+001 -1.259887515479711E+001 +-1.259237894733663E+001 -1.258561801661921E+001 -1.257858124217644E+001 -1.257125705191036E+001 +-1.256363340622614E+001 -1.255569778184685E+001 -1.254743715532722E+001 -1.253883798628690E+001 +-1.252988620038624E+001 -1.252056717207160E+001 -1.251086570712071E+001 -1.250076602502287E+001 +-1.249025174123291E+001 -1.247930584934294E+001 -1.246791070322054E+001 -1.245604799916803E+001 +-1.244369875816276E+001 -1.243084330824511E+001 -1.241746126712718E+001 -1.240353152510242E+001 +-1.238903222834412E+001 -1.237394076268828E+001 -1.235823373800549E+001 -1.234188697327472E+001 +-1.232487548248208E+001 -1.230717346147690E+001 -1.228875427592849E+001 -1.226959045053753E+001 +-1.224965365966774E+001 -1.222891471957501E+001 -1.220734358242418E+001 -1.218490933229575E+001 +-1.216158018339876E+001 -1.213732348071909E+001 -1.211210570334676E+001 -1.208589247074001E+001 +-1.205864855219816E+001 -1.203033787983002E+001 -1.200092356531940E+001 -1.197036792080329E+001 +-1.193863248419349E+001 -1.190567804928569E+001 -1.187146470101453E+001 -1.183595185622540E+001 +-1.179909831034634E+001 -1.176086229035472E+001 -1.172120151444275E+001 -1.168007325879487E+001 +-1.163743443189621E+001 -1.159324165679604E+001 -1.154745136175229E+001 -1.150001987968215E+001 +-1.145090355684038E+001 -1.140005887113927E+001 -1.134744256051268E+001 -1.129301176171125E+001 +-1.123672415989464E+001 -1.117853814936085E+001 -1.111841300572088E+001 -1.105630906978814E+001 +-1.099218794340770E+001 -1.092601269739696E+001 -1.085774809170990E+001 -1.078736080786763E+001 +-1.071481969362083E+001 -1.064009601972317E+001 -1.056316374859844E+001 -1.048399981457835E+001 +-1.040258441527242E+001 -1.031890131350480E+001 -1.023293814911772E+001 -1.014468675979461E+001 +-1.005414350990080E+001 -9.961309626174650E+000 -9.866191538928128E+000 -9.768801227234874E+000 +-9.669156566394230E+000 -9.567281675765864E+000 -9.463207264869311E+000 -9.356970975440390E+000 +-9.248617716931001E+000 -9.138199992733354E+000 -9.025778214205740E+000 -8.911420999374256E+000 +-8.795205452987883E+000 -8.677217424410793E+000 -8.557551739648625E+000 -8.436312403624998E+000 +-8.313612768647932E+000 -8.189575664835715E+000 -8.064333488101877E+000 -7.938028241128460E+000 +-7.810811522580501E+000 -7.682844459624465E+000 -7.554297578604327E+000 -7.425350608488743E+000 +-7.296192211421459E+000 -7.167019634373293E+000 -7.038038275491284E+000 -6.909461158259147E+000 +-6.781508306006524E+000 -6.654406008623335E+000 -6.528385972542961E+000 -6.403684344150157E+000 +-6.280540595757564E+000 -6.159196262195297E+000 -6.039893514910228E+000 -5.922873559334354E+000 +-5.808374840239878E+000 -5.696631038977804E+000 -5.587868846057559E+000 -5.482305492685192E+000 +-5.380146025910751E+000 -5.281580314282541E+000 -5.186779774789438E+000 -5.095893817892459E+000 +-5.009046016200565E+000 -4.926330014521985E+000 -4.847805215407886E+000 -4.773492295784210E+000 +-4.703368637813538E+000 -4.637363791799418E+000 -4.575355131873899E+000 -4.517163917584973E+000 +-4.462552037574826E+000 -4.411219789591163E+000 -4.362805179098640E+000 -4.316885410419743E+000 +-4.272981242721826E+000 -4.230565032363103E+000 -4.189073474351396E+000 -4.147926251685524E+000 +-4.106552025447234E+000 -4.064423458549986E+000 -4.021103263966626E+000 -3.976303618721876E+000 +-3.929961753350966E+000 -3.882335041899741E+000 -3.834119538413978E+000 -3.786292384905248E+000 +-3.739083612690033E+000 -3.692482769808510E+000 -3.646479827485071E+000 -3.601065146483959E+000 +-3.556229446324951E+000 -3.511963777149560E+000 -3.468259494038068E+000 -3.425108233588893E+000 +-3.382501892581600E+000 -3.340432608556286E+000 -3.298892742152442E+000 -3.257874861060433E+000 +-3.217371725449445E+000 -3.177376274744606E+000 -3.137881615635904E+000 -3.098881011209789E+000 +-3.060367871102846E+000 -3.022335742584919E+000 -2.984778302486022E+000 -2.947689349888694E+000 +-2.911062799513726E+000 -2.874892675733059E+000 -2.839173107149732E+000 -2.803898321689321E+000 +-2.769062642152790E+000 -2.734660482184725E+000 -2.700686342615113E+000 -2.667134808136921E+000 +-2.634000544284845E+000 -2.601278294684165E+000 -2.568962878541468E+000 -2.537049188351623E+000 +-2.505532187798232E+000 -2.474406909826540E+000 -2.443668454870453E+000 -2.413311989216751E+000 +-2.383332743491449E+000 -2.353726011255088E+000 -2.324487147694571E+000 -2.295611568401196E+000 +-2.267094748225114E+000 -2.238932220197621E+000 -2.211119574514008E+000 -2.183652457569932E+000 +-2.156526571045638E+000 -2.129737671032649E+000 -2.103281567198256E+000 -2.077154121983877E+000 +-2.051351249833504E+000 -2.025868916449244E+000 -2.000703138071108E+000 -1.975849980778585E+000 +-1.951305559812019E+000 -1.927066038911758E+000 -1.903127629673630E+000 -1.879486590919267E+000 +-1.856139228079977E+000 -1.833081892593306E+000 -1.810310981311120E+000 -1.787822935918618E+000 +-1.765614242363474E+000 -1.743681430294482E+000 -1.722021072509295E+000 -1.700629784410651E+000 +-1.679504223470833E+000 -1.658641088703957E+000 -1.638037120145700E+000 -1.617689098340410E+000 +-1.597593843835129E+000 -1.577748216680503E+000 -1.558149115938332E+000 -1.538793479195519E+000 +-1.519678282084445E+000 -1.500800537809447E+000 -1.482157296679409E+000 -1.463745645646324E+000 +-1.445562707849644E+000 -1.427605642166471E+000 -1.409871642767327E+000 -1.392357938677561E+000 +-1.375061793344250E+000 -1.357980504208459E+000 -1.341111402282937E+000 -1.324451851734981E+000 +-1.307999249474581E+000 -1.291751024747661E+000 -1.275704638734358E+000 -1.259857584152371E+000 +-1.244207384865156E+000 -1.228751595495052E+000 -1.213487801041216E+000 -1.198413616502259E+000 +-1.183526686503632E+000 -1.168824684929586E+000 -1.154305314559742E+000 -1.139966306710184E+000 +-1.125805420878949E+000 -1.111820444396003E+000 -1.098009192077494E+000 -1.084369505884341E+000 +-1.070899254585061E+000 -1.057596333422753E+000 -1.044458663786263E+000 -1.031484192885383E+000 +-1.018670893430130E+000 -1.006016763313991E+000 -9.935198253010711E-001 -9.811781267171947E-001 +-9.689897391447654E-001 -9.569527581214714E-001 -9.450653028427273E-001 -9.333255158677639E-001 +-9.217315628294428E-001 -9.102816321476016E-001 -8.989739347460087E-001 -8.878067037728255E-001 +-8.767781943245053E-001 -8.658866831731832E-001 -8.551304684973862E-001 -8.445078696161305E-001 +-8.340172267263215E-001 -8.236569006433788E-001 -8.134252725451333E-001 -8.033207437188564E-001 +-7.933417353114651E-001 -7.834866880828257E-001 -7.737540621620971E-001 -7.641423368071382E-001 +-7.546500101668671E-001 -7.452755990465945E-001 -7.360176386762768E-001 -7.268746824816166E-001 +-7.178453018580517E-001 -7.089280859475032E-001 -7.001216414179381E-001 -6.914245922456492E-001 +-6.828355795002348E-001 -6.743532611322722E-001 -6.659763117636006E-001 -6.577034224802302E-001 +-6.495333006278192E-001 -6.414646696096783E-001 -6.334962686873108E-001 -6.256268527834000E-001 +-6.178551922872620E-001 -6.101800728627249E-001 -6.026002959623741E-001 -5.951146757610200E-001 +-5.877220433892063E-001 -5.804212437343833E-001 -5.732111360330748E-001 -5.660905936926098E-001 +-5.590585041151065E-001 -5.521137685236074E-001 -5.452553017903943E-001 -5.384820322674389E-001 +-5.317929016189360E-001 -5.251868646559518E-001 -5.186628896054093E-001 -5.122199561828820E-001 +-5.058570581399915E-001 -4.995732012620703E-001 -4.933674036847828E-001 -4.872386957406930E-001 +-4.811861327727236E-001 -4.752087340482719E-001 -4.693055964215468E-001 -4.634757887440984E-001 +-4.577184000968071E-001 -4.520325308761718E-001 -4.464172926537530E-001 -4.408718080373355E-001 +-4.353952105338542E-001 -4.299866444139855E-001 -4.246452645784444E-001 -4.193702364259423E-001 +-4.141607357227643E-001 -4.090159484739971E-001 -4.039350707963250E-001 -3.989173087924296E-001 +-3.939618784269454E-001 -3.890680054039408E-001 -3.842349253728886E-001 -3.794618824726567E-001 +-3.747481312635833E-001 -3.700929352124546E-001 -3.654955669354135E-001 -3.609553080843156E-001 +-3.564714492344773E-001 -3.520432897738292E-001 -3.476701377934487E-001 -3.433513099794393E-001 +-3.390861315061706E-001 -3.348739359308274E-001 -3.307140650892796E-001 -3.266058689932480E-001 +-3.225487057285594E-001 -3.185419413555606E-001 -3.145849498089774E-001 -3.106771128008286E-001 +-3.068178197236337E-001 -3.030064675549949E-001 -2.992424607633844E-001 -2.955252112150816E-001 +-2.918541380822807E-001 -2.882286677523381E-001 -2.846482337381362E-001 -2.811122765895786E-001 +-2.776202438061652E-001 -2.741715897506682E-001 -2.707657755638772E-001 -2.674022690803943E-001 +-2.640805447454903E-001 -2.608000835329790E-001 -2.575603728641206E-001 -2.543609065275336E-001 +-2.512011846000917E-001 -2.480807133688174E-001 -2.449990052537311E-001 -2.419555787316690E-001 +-2.389499582610472E-001 -2.359816742075500E-001 -2.330502627707574E-001 -2.301552659116670E-001 +-2.272962312811287E-001 -2.244727121491669E-001 -2.216842673351705E-001 -2.189304611389667E-001 +-2.162108632727331E-001 -2.135250487937694E-001 -2.108725980381005E-001 -2.082530965548979E-001 +-2.056661350417272E-001 -2.031113092805875E-001 -2.005882200747553E-001 -1.980964731864106E-001 +-1.956356792750307E-001 -1.932054538365622E-001 -1.908054171433353E-001 -1.884351941847327E-001 +-1.860944146085966E-001 -1.837827126633547E-001 -1.814997271408756E-001 -1.792451013200265E-001 +-1.770184829109350E-001 -1.748195239999457E-001 -1.726478809952539E-001 -1.705032145732231E-001 +-1.683851896253610E-001 -1.662934752059592E-001 -1.642277444803857E-001 -1.621876746740107E-001 +-1.601729470217773E-001 -1.581832467183905E-001 -1.562182628691292E-001 -1.542776884412703E-001 +-1.523612202161101E-001 -1.504685587415907E-001 -1.485994082855051E-001 -1.467534767892915E-001 +-1.449304758223989E-001 -1.431301205372164E-001 -1.413521296245690E-001 -1.395962252697584E-001 +-1.378621331091563E-001 -1.361495821873359E-001 -1.344583049147300E-001 -1.327880370258252E-001 +-1.311385175378650E-001 -1.295094887100731E-001 -1.279006960033815E-001 -1.263118880406561E-001 +-1.247428165674210E-001 -1.231932364130658E-001 -1.216629054525382E-001 -1.201515845685132E-001 +-1.186590376140268E-001 -1.171850313755816E-001 -1.157293355367038E-001 -1.142917226419563E-001 +-1.128719680614003E-001 -1.114698499554932E-001 -1.100851492404293E-001 -1.087176495539041E-001 +-1.073671372213092E-001 -1.060334012223455E-001 -1.047162331580491E-001 -1.034154272182308E-001 +-1.021307801493157E-001 -1.008620912225853E-001 -9.960916220281425E-002 -9.837179731729347E-002 +-9.714980322524283E-002 -9.594298898759891E-002 -9.475116603718146E-002 -9.357414814923039E-002 +-9.241175141230545E-002 -9.126379419955218E-002 -9.013009714032008E-002 -8.901048309213711E-002 +-8.790477711303071E-002 -8.681280643419158E-002 -8.573440043298015E-002 -8.466939060626430E-002 +-8.361761054409164E-002 -8.257889590368808E-002 -8.155308438377726E-002 -8.054001569922280E-002 +-7.953953155598111E-002 +/ + +&nonlocal + els_beta(1) = "3S" + lll(1) = 0 + kbeta(1) = 836 + rcut(1) = 1.750000000000000E+000 + rcutus(1) = 1.750000000000000E+000 + beta(1:1141,1) = + 3.075797279882494E-004 3.114486047166302E-004 3.153661459244108E-004 3.193329637354234E-004 + 3.233496779730725E-004 3.274169162571814E-004 3.315353141020609E-004 3.357055150158096E-004 + 3.399281706008627E-004 3.442039406558072E-004 3.485334932784765E-004 3.529175049703414E-004 + 3.573566607422158E-004 3.618516542212906E-004 3.664031877595161E-004 3.710119725433431E-004 + 3.756787287048496E-004 3.804041854342618E-004 3.851890810938928E-004 3.900341633335129E-004 + 3.949401892071706E-004 3.999079252914851E-004 4.049381478054248E-004 4.100316427315942E-004 + 4.151892059390451E-004 4.204116433076318E-004 4.256997708539326E-004 4.310544148587548E-004 + 4.364764119962410E-004 4.419666094646043E-004 4.475258651185019E-004 4.531550476030780E-004 + 4.588550364896921E-004 4.646267224133531E-004 4.704710072118849E-004 4.763888040668373E-004 + 4.823810376461755E-004 4.884486442487609E-004 4.945925719506491E-004 5.008137807532308E-004 + 5.071132427332315E-004 5.134919421946036E-004 5.199508758223238E-004 5.264910528381289E-004 + 5.331134951582095E-004 5.398192375528850E-004 5.466093278082901E-004 5.534848268900931E-004 + 5.604468091092752E-004 5.674963622899950E-004 5.746345879395607E-004 5.818626014205451E-004 + 5.891815321250646E-004 5.965925236512465E-004 6.040967339819234E-004 6.116953356655663E-004 + 6.193895159995005E-004 6.271804772154239E-004 6.350694366672571E-004 6.430576270213606E-004 + 6.511462964491389E-004 6.593367088220725E-004 6.676301439091999E-004 6.760278975770854E-004 + 6.845312819923025E-004 6.931416258264602E-004 7.018602744638141E-004 7.106885902114848E-004 + 7.196279525123232E-004 7.286797581604509E-004 7.378454215195129E-004 7.471263747436767E-004 + 7.565240680014084E-004 7.660399697020662E-004 7.756755667253461E-004 7.854323646536056E-004 + 7.953118880071188E-004 8.053156804822851E-004 8.154453051928364E-004 8.257023449140806E-004 + 8.360884023302095E-004 8.466051002847259E-004 8.572540820340177E-004 8.680370115041197E-004 + 8.789555735507095E-004 8.900114742223674E-004 9.012064410271536E-004 9.125422232025372E-004 + 9.240205919887161E-004 9.356433409053853E-004 9.474122860319710E-004 9.593292662914052E-004 + 9.713961437374607E-004 9.836148038457006E-004 9.959871558080961E-004 1.008515132831335E-003 + 1.021200692438897E-003 1.034045816776924E-003 1.047052512923929E-003 1.060222813204422E-003 + 1.073558775506451E-003 1.087062483603169E-003 1.100736047478419E-003 1.114581603656432E-003 + 1.128601315535666E-003 1.142797373726842E-003 1.157171996395237E-003 1.171727429607276E-003 + 1.186465947681493E-003 1.201389853543900E-003 1.216501479087824E-003 1.231803185538277E-003 + 1.247297363820906E-003 1.262986434935583E-003 1.278872850334697E-003 1.294959092306200E-003 + 1.311247674361478E-003 1.327741141628091E-003 1.344442071247466E-003 1.361353072777585E-003 + 1.378476788600728E-003 1.395815894336376E-003 1.413373099259266E-003 1.431151146722743E-003 + 1.449152814587415E-003 1.467380915655202E-003 1.485838298108855E-003 1.504527845956991E-003 + 1.523452479484738E-003 1.542615155710042E-003 1.562018868845709E-003 1.581666650767270E-003 + 1.601561571486729E-003 1.621706739632255E-003 1.642105302933940E-003 1.662760448715625E-003 + 1.683675404392953E-003 1.704853437977660E-003 1.726297858588220E-003 1.748012016966921E-003 + 1.769999306003421E-003 1.792263161264917E-003 1.814807061532969E-003 1.837634529347075E-003 + 1.860749131555096E-003 1.884154479870589E-003 1.907854231437162E-003 1.931852089399923E-003 + 1.956151803484120E-003 1.980757170581064E-003 2.005672035341406E-003 2.030900290775896E-003 + 2.056445878863692E-003 2.082312791168315E-003 2.108505069461365E-003 2.135026806354071E-003 + 2.161882145936788E-003 2.189075284426545E-003 2.216610470822731E-003 2.244492007571041E-003 + 2.272724251235753E-003 2.301311613180480E-003 2.330258560257485E-003 2.359569615505651E-003 + 2.389249358857263E-003 2.419302427853625E-003 2.449733518369755E-003 2.480547385348129E-003 + 2.511748843541689E-003 2.543342768266200E-003 2.575334096162042E-003 2.607727825965633E-003 + 2.640529019290502E-003 2.673742801418233E-003 2.707374362099343E-003 2.741428956364201E-003 + 2.775911905344229E-003 2.810828597103344E-003 2.846184487479917E-003 2.881985100939313E-003 + 2.918236031437130E-003 2.954942943293338E-003 2.992111572077390E-003 3.029747725504454E-003 + 3.067857284342975E-003 3.106446203333572E-003 3.145520512119582E-003 3.185086316189243E-003 + 3.225149797829766E-003 3.265717217093409E-003 3.306794912775663E-003 3.348389303405826E-003 + 3.390506888249946E-003 3.433154248326451E-003 3.476338047434524E-003 3.520065033195413E-003 + 3.564342038106878E-003 3.609175980610847E-003 3.654573866174548E-003 3.700542788385247E-003 + 3.747089930058697E-003 3.794222564361629E-003 3.841948055948277E-003 3.890273862111248E-003 + 3.939207533946881E-003 3.988756717535204E-003 4.038929155134841E-003 4.089732686392846E-003 + 4.141175249569818E-003 4.193264882780451E-003 4.246009725249597E-003 4.299418018584264E-003 + 4.353498108061498E-003 4.408258443932552E-003 4.463707582743426E-003 4.519854188672017E-003 + 4.576707034882132E-003 4.634275004894495E-003 4.692567093975021E-003 4.751592410540588E-003 + 4.811360177582418E-003 4.871879734107483E-003 4.933160536597938E-003 4.995212160488980E-003 + 5.058044301665315E-003 5.121666777976370E-003 5.186089530770707E-003 5.251322626449613E-003 + 5.317376258040319E-003 5.384260746789015E-003 5.451986543773834E-003 5.520564231538272E-003 + 5.590004525745017E-003 5.660318276850680E-003 5.731516471801612E-003 5.803610235750958E-003 + 5.876610833797475E-003 5.950529672746085E-003 6.025378302890687E-003 6.101168419819381E-003 + 6.177911866242340E-003 6.255620633842836E-003 6.334306865151408E-003 6.413982855443720E-003 + 6.494661054662270E-003 6.576354069362285E-003 6.659074664682125E-003 6.742835766338462E-003 + 6.827650462646603E-003 6.913532006566238E-003 7.000493817772906E-003 7.088549484755597E-003 + 7.177712766940693E-003 7.267997596842699E-003 7.359418082242024E-003 7.451988508390178E-003 + 7.545723340242751E-003 7.640637224720464E-003 7.736744992998733E-003 7.834061662826037E-003 + 7.932602440871463E-003 8.032382725101827E-003 8.133418107188727E-003 8.235724374945894E-003 + 8.339317514797232E-003 8.444213714275943E-003 8.550429364555127E-003 8.657981063010233E-003 + 8.766885615813784E-003 8.877160040562802E-003 8.988821568939286E-003 9.101887649404226E-003 + 9.216375949925521E-003 9.332304360740279E-003 9.449690997151920E-003 9.568554202362446E-003 + 9.688912550340489E-003 9.810784848725381E-003 9.934190141767883E-003 1.005914771330795E-002 + 1.018567708978994E-002 1.031379804331597E-002 1.044353059473752E-002 1.057489501678619E-002 + 1.070791183724382E-002 1.084260184215250E-002 1.097898607906520E-002 1.111708586033714E-002 + 1.125692276645886E-002 1.139851864943112E-002 1.154189563618246E-002 1.168707613202978E-002 + 1.183408282418253E-002 1.198293868529111E-002 1.213366697703999E-002 1.228629125378613E-002 + 1.244083536624325E-002 1.259732346521261E-002 1.275578000536074E-002 1.291622974904494E-002 + 1.307869777018687E-002 1.324320945819517E-002 1.340979052193737E-002 1.357846699376201E-002 + 1.374926523357152E-002 1.392221193294640E-002 1.409733411932148E-002 1.427465916021485E-002 + 1.445421476751018E-002 1.463602900179308E-002 1.482013027674213E-002 1.500654736357542E-002 + 1.519530939555313E-002 1.538644587253704E-002 1.557998666560749E-002 1.577596202173874E-002 + 1.597440256853330E-002 1.617533931901608E-002 1.637880367648908E-002 1.658482743944740E-002 + 1.679344280655732E-002 1.700468238169732E-002 1.721857917906279E-002 1.743516662833519E-002 + 1.765447857991658E-002 1.787654931023036E-002 1.810141352708889E-002 1.832910637512909E-002 + 1.855966344131668E-002 1.879312076052009E-002 1.902951482115493E-002 1.926888257089959E-002 + 1.951126142248348E-002 1.975668925954828E-002 2.000520444258349E-002 2.025684581493703E-002 + 2.051165270890196E-002 2.076966495188021E-002 2.103092287262450E-002 2.129546730755906E-002 + 2.156333960718081E-002 2.183458164254113E-002 2.210923581181020E-002 2.238734504692436E-002 + 2.266895282031766E-002 2.295410315173893E-002 2.324284061515517E-002 2.353521034574253E-002 + 2.383125804696606E-002 2.413102999774909E-002 2.443457305973394E-002 2.474193468463447E-002 + 2.505316292168216E-002 2.536830642516677E-002 2.568741446207267E-002 2.601053691981249E-002 + 2.633772431405864E-002 2.666902779667478E-002 2.700449916374794E-002 2.734419086372289E-002 + 2.768815600564013E-002 2.803644836747833E-002 2.838912240460352E-002 2.874623325832547E-002 + 2.910783676456328E-002 2.947398946262136E-002 2.984474860407720E-002 3.022017216178258E-002 + 3.060031883897957E-002 3.098524807853281E-002 3.137502007227975E-002 3.176969577050010E-002 + 3.216933689150647E-002 3.257400593135746E-002 3.298376617369483E-002 3.339868169970683E-002 + 3.381881739821851E-002 3.424423897591163E-002 3.467501296767524E-002 3.511120674708880E-002 + 3.555288853704005E-002 3.600012742047843E-002 3.645299335130698E-002 3.691155716541390E-002 + 3.737589059184562E-002 3.784606626412364E-002 3.832215773170683E-002 3.880423947160104E-002 + 3.929238690011817E-002 3.978667638478679E-002 4.028718525641607E-002 4.079399182131539E-002 + 4.130717537367133E-002 4.182681620808477E-002 4.235299563226963E-002 4.288579597991581E-002 + 4.342530062371876E-002 4.397159398857718E-002 4.452476156496206E-002 4.508488992245882E-002 + 4.565206672348508E-002 4.622638073718677E-002 4.680792185351407E-002 4.739678109748118E-002 + 4.799305064361089E-002 4.859682383056777E-002 4.920819517598181E-002 4.982726039146531E-002 + 5.045411639782604E-002 5.108886134047905E-002 5.173159460506016E-002 5.238241683324373E-002 + 5.304142993876769E-002 5.370873712366888E-002 5.438444289473150E-002 5.506865308015165E-002 + 5.576147484642157E-002 5.646301671543545E-002 5.717338858182168E-002 5.789270173050334E-002 + 5.862106885449102E-002 5.935860407291115E-002 6.010542294927287E-002 6.086164250997743E-002 + 6.162738126307345E-002 6.240275921726147E-002 6.318789790115190E-002 6.398292038277904E-002 + 6.478795128937655E-002 6.560311682741678E-002 6.642854480291859E-002 6.726436464202770E-002 + 6.811070741187314E-002 6.896770584170447E-002 6.983549434431376E-002 7.071420903774668E-002 + 7.160398776730706E-002 7.250497012785916E-002 7.341729748643280E-002 7.434111300513531E-002 + 7.527656166437557E-002 7.622379028640471E-002 7.718294755917808E-002 7.815418406054424E-002 + 7.913765228276554E-002 8.013350665737555E-002 8.114190358037905E-002 8.216300143779921E-002 + 8.319696063157846E-002 8.424394360583797E-002 8.530411487350215E-002 8.637764104329347E-002 + 8.746469084710351E-002 8.856543516774738E-002 8.968004706710675E-002 9.080870181466824E-002 + 9.195157691646413E-002 9.310885214442095E-002 9.428070956612447E-002 9.546733357500627E-002 + 9.666891092096018E-002 9.788563074139631E-002 9.911768459273788E-002 1.003652664823713E-001 + 1.016285729010555E-001 1.029078028557989E-001 1.042031579032127E-001 1.055148421833474E-001 + 1.068430624540236E-001 1.081880281256625E-001 1.095499512966284E-001 1.109290467890902E-001 + 1.123255321854112E-001 1.137396278650787E-001 1.151715570421814E-001 1.166215458034443E-001 + 1.180898231468349E-001 1.195766210207459E-001 1.210821743637697E-001 1.226067211450736E-001 + 1.241505024053882E-001 1.257137622986198E-001 1.272967481340981E-001 1.288997104194740E-001 + 1.305229029042771E-001 1.321665826241483E-001 1.338310099457588E-001 1.355164486124293E-001 + 1.372231657904659E-001 1.389514321162222E-001 1.407015217439072E-001 1.424737123941509E-001 + 1.442682854033439E-001 1.460855257737672E-001 1.479257222245282E-001 1.497891672433193E-001 + 1.516761571390179E-001 1.535869920951418E-001 1.555219762241831E-001 1.574814176228351E-001 + 1.594656284281328E-001 1.614749248745287E-001 1.635096273519187E-001 1.655700604646461E-001 + 1.676565530914986E-001 1.697694384467248E-001 1.719090541420902E-001 1.740757422499964E-001 + 1.762698493676887E-001 1.784917266825752E-001 1.807417300386832E-001 1.830202200042800E-001 + 1.853275619406815E-001 1.876641260722816E-001 1.900302875578248E-001 1.924264265629557E-001 + 1.948529283340741E-001 1.973101832735244E-001 1.997985870161547E-001 2.023185405072767E-001 + 2.048704500820581E-001 2.074547275463878E-001 2.100717902592422E-001 2.127220612165962E-001 + 2.154059691369125E-001 2.181239485482507E-001 2.208764398770355E-001 2.236638895385233E-001 + 2.264867500290155E-001 2.293454800198564E-001 2.322405444532643E-001 2.351724146400431E-001 + 2.381415683592184E-001 2.411484899596529E-001 2.441936704636885E-001 2.472776076728687E-001 + 2.504008062757975E-001 2.535637779581845E-001 2.567670415151424E-001 2.600111229657885E-001 + 2.632965556702168E-001 2.666238804488993E-001 2.699936457045836E-001 2.734064075467542E-001 + 2.768627299187236E-001 2.803631847274272E-001 2.839083519759935E-001 2.874988198991631E-001 + 2.911351851016374E-001 2.948180526994351E-001 2.985480364643377E-001 3.023257589715117E-001 + 3.061518517503893E-001 3.100269554389052E-001 3.139517199411740E-001 3.179268045887093E-001 + 3.219528783052802E-001 3.260306197755040E-001 3.301607176172848E-001 3.343438705581986E-001 + 3.385807876159393E-001 3.428721882829373E-001 3.472188027152659E-001 3.516213719259585E-001 + 3.560806479828572E-001 3.605973942111205E-001 3.651723854005217E-001 3.698064080176682E-001 + 3.745002604232842E-001 3.792547530946962E-001 3.840707088536637E-001 3.889489630997133E-001 + 3.938903640491147E-001 3.988957729796740E-001 4.039660644814900E-001 4.091021267138489E-001 + 4.143048616684249E-001 4.195751854389572E-001 4.249140284975871E-001 4.303223359780379E-001 + 4.358010679658182E-001 4.413511997956521E-001 4.469737223563176E-001 4.526696424031092E-001 + 4.584399828781190E-001 4.642857832385487E-001 4.702080997932701E-001 4.762080060478453E-001 + 4.822865930582366E-001 4.884449697934268E-001 4.946842635071849E-001 5.010056201192101E-001 + 5.074102046058918E-001 5.138992014009314E-001 5.204738148060675E-001 5.271352694121583E-001 + 5.338848105308713E-001 5.407237046372303E-001 5.476532398232882E-001 5.546747262631759E-001 + 5.617894966897900E-001 5.689989068833873E-001 5.763043361723385E-001 5.837071879463163E-001 + 5.912088901821715E-001 5.988108959827627E-001 6.065146841289980E-001 6.143217596453439E-001 + 6.222336543790568E-001 6.302519275933839E-001 6.383781665749740E-001 6.466139872557378E-001 + 6.549610348493751E-001 6.634209845027963E-001 6.719955419626363E-001 6.806864442570526E-001 + 6.894954603929883E-001 6.984243920690495E-001 7.074750744041507E-001 7.166493766820304E-001 + 7.259492031117417E-001 7.353764936041746E-001 7.449332245646467E-001 7.546214097015647E-001 + 7.644431008511167E-001 7.744003888179122E-001 7.844954042314520E-001 7.947303184182392E-001 + 8.051073442893110E-001 8.156287372428873E-001 8.262967960817775E-001 8.371138639451131E-001 + 8.480823292538769E-001 8.592046266696434E-001 8.704832380658135E-001 8.819206935105410E-001 + 8.935195722604379E-001 9.052825037640000E-001 9.172121686735850E-001 9.293112998646089E-001 + 9.415826834604762E-001 9.540291598615819E-001 9.666536247765268E-001 9.794590302535229E-001 + 9.924483857096761E-001 1.005624758955655E+000 1.018991277212988E+000 1.032551128120894E+000 + 1.046307560729341E+000 1.060263886474619E+000 1.074423480133389E+000 1.088789780750837E+000 + 1.103366292538021E+000 1.118156585733235E+000 1.133164297421561E+000 1.148393132306357E+000 + 1.163846863425896E+000 1.179529332807651E+000 1.195444452052236E+000 1.211596202838153E+000 + 1.227988637337876E+000 1.244625878534935E+000 1.261512120430771E+000 1.278651628129293E+000 + 1.296048737785944E+000 1.313707856407093E+000 1.331633461484418E+000 1.349830100447584E+000 + 1.368302389917371E+000 1.387055014739795E+000 1.406092726780330E+000 1.425420343455702E+000 + 1.445042745978853E+000 1.464964877290938E+000 1.485191739652021E+000 1.505728391860105E+000 + 1.526579946065746E+000 1.547751564146985E+000 1.569248453606783E+000 1.591075862952170E+000 + 1.613239076511393E+000 1.635743408642106E+000 1.658594197280094E+000 1.681796796774524E+000 + 1.705356569951618E+000 1.729278879344592E+000 1.753569077523282E+000 1.778232496452048E+000 + 1.803274435799736E+000 1.828700150120007E+000 1.854514834814824E+000 1.880723610787987E+000 + 1.907331507689192E+000 1.934343445642659E+000 1.961764215347239E+000 1.989598456427679E+000 + 2.017850633909027E+000 2.046525012678004E+000 2.075625629786886E+000 2.105156264446524E+000 + 2.135120405546036E+000 2.165521216527314E+000 2.196361497432507E+000 2.227643643932817E+000 + 2.259369603136411E+000 2.291540825962834E+000 2.324158215860734E+000 2.357222073634758E+000 + 2.390732038137102E+000 2.424687022568335E+000 2.459085146122029E+000 2.493923660697798E+000 + 2.529198872397979E+000 2.564906057514829E+000 2.601039372707564E+000 2.637591759062492E+000 + 2.674554839725089E+000 2.711918810790263E+000 2.749672325137254E+000 2.787802368898396E+000 + 2.826294130257447E+000 2.865130860283830E+000 2.904293725524212E+000 2.943761652094140E+000 + 2.983511161039548E+000 3.023516194773074E+000 3.063747934433562E+000 3.104174608070248E+000 + 3.144761289617693E+000 3.185469688704282E+000 3.226257931428352E+000 3.267080332343103E+000 + 3.307887158016029E+000 3.348624382673619E+000 3.389233436608260E+000 3.429650948215268E+000 + 3.469808480745272E+000 3.509632265103197E+000 3.549042930303255E+000 3.587955233500538E+000 + 3.626277791868118E+000 3.663912818975205E+000 3.700755868749009E+000 3.736695590573131E+000 + 3.771613499588751E+000 3.805383766822990E+000 3.837873034371597E+000 3.868940261508750E+000 + 3.898436608283991E+000 3.926205363890317E+000 3.952081927843322E+000 3.975893852790803E+000 + 3.997460958565001E+000 4.016595527882590E+000 4.033102594873306E+000 4.046780338356693E+000 + 4.057420592462114E+000 4.064809487770518E+000 4.068728236612259E+000 4.068954076442616E+000 + 4.065261385289282E+000 4.057422983071095E+000 4.045211632066242E+000 4.028401748896859E+000 + 4.006771339025895E+000 3.980104162858274E+000 3.948192140025416E+000 3.910837995234068E+000 + 3.867858145102059E+000 3.819085820616837E+000 3.764374414177209E+000 3.703601033570708E+000 + 3.636670237673134E+000 3.563517920136270E+000 3.484115297891471E+000 3.398472951019091E+000 + 3.306644849547645E+000 3.208732291238676E+000 3.104887662638749E+000 2.995317923966189E+000 + 2.880287707149558E+000 2.760121906033574E+000 2.635207628975264E+000 2.505995377402686E+000 + 2.372999310094681E+000 2.236796452696228E+000 2.098024716067414E+000 1.957379596212463E+000 + 1.815609443439404E+000 1.673509209655465E+000 1.531912610756213E+000 1.391682676180116E+000 + 1.253700699891358E+000 1.118853656067123E+000 9.880201980393709E-001 8.620554197025262E-001 + 7.417746234871715E-001 6.279364067111378E-001 5.212254471026790E-001 4.222354369738667E-001 + 3.314526824815972E-001 2.492409485889171E-001 1.758281912536422E-001 1.112958763910707E-001 + 5.557164170709673E-002 8.426115250977995E-003 -3.052523249311788E-002 -6.181425265832750E-002 +-8.610525746664197E-002 -1.041719801039226E-001 -1.168650549810820E-001 -1.250685370290415E-001 +-1.296437578493815E-001 -1.313585569019249E-001 -1.307996329927177E-001 -1.282654455890776E-001 +-1.236367700602208E-001 -1.164848148323806E-001 -1.069952681991816E-001 -9.562285469468815E-002 +-8.289014444846655E-002 -6.937569655146257E-002 -5.569676116848803E-002 -4.248545568044745E-002 +-3.035719789100982E-002 -1.987003691617276E-002 -1.147336603830714E-002 -5.444325797909452E-003 +-1.810002679679951E-003 -2.532902842563463E-004 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 + + els_beta(2) = "3P" + lll(2) = 1 + kbeta(2) = 836 + rcut(2) = 1.930000000000000E+000 + rcutus(2) = 1.930000000000000E+000 + beta(1:1141,2) = +-4.280971527514776E-008 -4.389344837610757E-008 -4.500461631109104E-008 -4.614391359622576E-008 +-4.731205232939891E-008 -4.850976263534117E-008 -4.973779312197860E-008 -5.099691134833722E-008 +-5.228790430429188E-008 -5.361157890246114E-008 -5.496876248255344E-008 -5.636030332848145E-008 +-5.778707119856716E-008 -5.924995786916914E-008 -6.074987769207190E-008 -6.228776816598528E-008 +-6.386459052251169E-008 -6.548133032694716E-008 -6.713899809429184E-008 -6.883862992085485E-008 +-7.058128813184761E-008 -7.236806194537223E-008 -7.420006815321807E-008 -7.607845181889279E-008 +-7.800438699332487E-008 -7.997907744868277E-008 -8.200375743077227E-008 -8.407969243048025E-008 +-8.620817997474716E-008 -8.839055043756454E-008 -9.062816787150101E-008 -9.292243086027996E-008 +-9.527477339294001E-008 -9.768666576012424E-008 -1.001596154730608E-007 -1.026951682058051E-007 +-1.052949087613370E-007 -1.079604620621146E-007 -1.106934941657028E-007 -1.134957133061144E-007 +-1.163688709615109E-007 -1.193147629489343E-007 -1.223352305467504E-007 -1.254321616455077E-007 +-1.286074919279315E-007 -1.318632060787869E-007 -1.352013390253724E-007 -1.386239772094152E-007 +-1.421332598911650E-007 -1.457313804865025E-007 -1.494205879378938E-007 -1.532031881200533E-007 +-1.570815452811908E-007 -1.610580835207428E-007 -1.651352883045146E-007 -1.693157080181757E-007 +-1.736019555600847E-007 -1.779967099744352E-007 -1.825027181257457E-007 -1.871227964157402E-007 +-1.918598325436890E-007 -1.967167873113156E-007 -2.016966964733939E-007 -2.068026726351937E-007 +-2.120379071979606E-007 -2.174056723536442E-007 -2.229093231301253E-007 -2.285522994882171E-007 +-2.343381284717528E-007 -2.402704264121029E-007 -2.463529011884984E-007 -2.525893545455772E-007 +-2.589836844695972E-007 -2.655398876248044E-007 -2.722620618514792E-007 -2.791544087272175E-007 +-2.862212361930550E-007 -2.934669612460684E-007 -3.008961127001441E-007 -3.085133340166335E-007 +-3.163233862066656E-007 -3.243311508069348E-007 -3.325416329308198E-007 -3.409599643967414E-007 +-3.495914069357176E-007 -3.584413554801125E-007 -3.675153415356476E-007 -3.768190366387711E-007 +-3.863582559015508E-007 -3.961389616463130E-007 -4.061672671322801E-007 -4.164494403765618E-007 +-4.269919080718659E-007 -4.378012596033909E-007 -4.488842511674078E-007 -4.602478099940965E-007 +-4.718990386772946E-007 -4.838452196138456E-007 -4.960938195553340E-007 -5.086524942750497E-007 +-5.215290933530899E-007 -5.347316650826045E-007 -5.482684615002386E-007 -5.621479435439226E-007 +-5.763787863412366E-007 -5.909698846316402E-007 -6.059303583259765E-007 -6.212695582067112E-007 +-6.369970717724737E-007 -6.531227292305568E-007 -6.696566096411118E-007 -6.866090472168880E-007 +-7.039906377824501E-007 -7.218122453969136E-007 -7.400850091443320E-007 -7.588203500959845E-007 +-7.780299784489147E-007 -7.977259008451835E-007 -8.179204278764072E-007 -8.386261817782814E-007 +-8.598561043198767E-007 -8.816234648926712E-007 -9.039418688043436E-007 -9.268252657825315E-007 +-9.502879586938697E-007 -9.743446124837284E-007 -9.990102633422930E-007 -1.024300328102658E-006 +-1.050230613876850E-006 -1.076817327935787E-006 -1.104077087839336E-006 -1.132026931822833E-006 +-1.160684329446523E-006 -1.190067192514604E-006 -1.220193886270683E-006 -1.251083240876637E-006 +-1.282754563182081E-006 -1.315227648791763E-006 -1.348522794438458E-006 -1.382660810669089E-006 +-1.417663034851967E-006 -1.453551344513355E-006 -1.490348171011612E-006 -1.528076513557517E-006 +-1.566759953589526E-006 -1.606422669512911E-006 -1.647089451812051E-006 -1.688785718545280E-006 +-1.731537531231987E-006 -1.775371611141915E-006 -1.820315355996788E-006 -1.866396857094788E-006 +-1.913644916868507E-006 -1.962089066887391E-006 -2.011759586315929E-006 -2.062687520839080E-006 +-2.114904702066837E-006 -2.168443767429995E-006 -2.223338180579585E-006 -2.279622252302752E-006 +-2.337331161968052E-006 -2.396500979513714E-006 -2.457168687992488E-006 -2.519372206687242E-006 +-2.583150414811724E-006 -2.648543175811288E-006 -2.715591362278859E-006 -2.784336881501567E-006 +-2.854822701654150E-006 -2.927092878655452E-006 -3.001192583704717E-006 -3.077168131515098E-006 +-3.155067009261756E-006 -3.234937906262893E-006 -3.316830744412122E-006 -3.400796709381183E-006 +-3.486888282612685E-006 -3.575159274122608E-006 -3.665664856133283E-006 -3.758461597557804E-006 +-3.853607499357322E-006 -3.951162030793551E-006 -4.051186166598878E-006 -4.153742425087497E-006 +-4.258894907231379E-006 -4.366709336725288E-006 -4.477253101066287E-006 -4.590595293672928E-006 +-4.706806757070860E-006 -4.825960127171655E-006 -4.948129878672423E-006 -5.073392371604971E-006 +-5.201825899063074E-006 -5.333510736138190E-006 -5.468529190093881E-006 -5.606965651810350E-006 +-5.748906648531482E-006 -5.894440897946956E-006 -6.043659363643590E-006 -6.196655311960465E-006 +-6.353524370283130E-006 -6.514364586813836E-006 -6.679276491854579E-006 -6.848363160641669E-006 +-7.021730277770980E-006 -7.199486203253938E-006 -7.381742040246028E-006 -7.568611704489536E-006 +-7.760211995514414E-006 -7.956662669641630E-006 -8.158086514834348E-006 -8.364609427444358E-006 +-8.576360490900950E-006 -8.793472056392048E-006 -9.016079825587756E-006 -9.244322935457857E-006 +-9.478344045236817E-006 -9.718289425589929E-006 -9.964309050036949E-006 -1.021655668869010E-005 +-1.047519000436483E-005 -1.074037065112396E-005 -1.101226437531619E-005 -1.129104111917247E-005 +-1.157687512702507E-005 -1.186994505421520E-005 -1.217043407875817E-005 -1.247853001583477E-005 +-1.279442543518140E-005 -1.311831778145183E-005 -1.345040949762570E-005 -1.379090815154151E-005 +-1.414002656563231E-005 -1.449798294994597E-005 -1.486500103853289E-005 -1.524131022928583E-005 +-1.562714572732065E-005 -1.602274869198581E-005 -1.642836638759400E-005 -1.684425233796944E-005 +-1.727066648490706E-005 -1.770787535064392E-005 -1.815615220444267E-005 -1.861577723339261E-005 +-1.908703771753447E-005 -1.957022820941821E-005 -2.006565071820666E-005 -2.057361489843932E-005 +-2.109443824357500E-005 -2.162844628443389E-005 -2.217597279266295E-005 -2.273735998935236E-005 +-2.331295875893258E-005 -2.390312886848669E-005 -2.450823919261415E-005 -2.512866794398717E-005 +-2.576480290974350E-005 -2.641704169386334E-005 -2.708579196568224E-005 -2.777147171469477E-005 +-2.847450951180854E-005 -2.919534477721186E-005 -2.993442805502237E-005 -3.069222129488834E-005 +-3.146919814071850E-005 -3.226584422672110E-005 -3.308265748093717E-005 -3.392014843645731E-005 +-3.477884055051720E-005 -3.565927053167065E-005 -3.656198867524503E-005 -3.748755920728860E-005 +-3.843656063722457E-005 -3.940958611943276E-005 -4.040724382398436E-005 -4.143015731676157E-005 +-4.247896594920013E-005 -4.355432525789758E-005 -4.465690737433766E-005 -4.578740144498683E-005 +-4.694651406202485E-005 -4.813496970497963E-005 -4.935351119354125E-005 -5.060290015183918E-005 +-5.188391748447233E-005 -5.319736386458908E-005 -5.454406023432356E-005 -5.592484831789924E-005 +-5.734059114772200E-005 -5.879217360379095E-005 -6.028050296676348E-005 -6.180650948502148E-005 +-6.337114695609173E-005 -6.497539332278509E-005 -6.662025128442607E-005 -6.830674892355541E-005 +-7.003594034849718E-005 -7.180890635219153E-005 -7.362675508770559E-005 -7.549062276084436E-005 +-7.740167434029395E-005 -7.936110428574209E-005 -8.137013729442942E-005 -8.343002906659987E-005 +-8.554206709032715E-005 -8.770757144620814E-005 -8.992789563242667E-005 -9.220442741070248E-005 +-9.453858967365437E-005 -9.693184133412022E-005 -9.938567823698803E-005 -1.019016340941099E-004 +-1.044812814428811E-004 -1.071262326290853E-004 -1.098381408146185E-004 -1.126187010107222E-004 +-1.154696511373715E-004 -1.183927731094797E-004 -1.213898939505996E-004 -1.244628869348148E-004 +-1.276136727575371E-004 -1.308442207359407E-004 -1.341565500397831E-004 -1.375527309533823E-004 +-1.410348861695377E-004 -1.446051921162070E-004 -1.482658803167615E-004 -1.520192387846763E-004 +-1.558676134535240E-004 -1.598134096431647E-004 -1.638590935630514E-004 -1.680071938535854E-004 +-1.722603031664907E-004 -1.766210797851900E-004 -1.810922492861979E-004 -1.856766062425679E-004 +-1.903770159704571E-004 -1.951964163199024E-004 -2.001378195109240E-004 -2.052043140161053E-004 +-2.103990664908282E-004 -2.157253237523602E-004 -2.211864148090429E-004 -2.267857529408406E-004 +-2.325268378325510E-004 -2.384132577610142E-004 -2.444486918376801E-004 -2.506369123079422E-004 +-2.569817869086704E-004 -2.634872812854144E-004 -2.701574614707956E-004 -2.769964964256233E-004 +-2.840086606443347E-004 -2.911983368263805E-004 -2.985700186152244E-004 -3.061283134066741E-004 +-3.138779452282857E-004 -3.218237576916554E-004 -3.299707170194321E-004 -3.383239151489446E-004 +-3.468885729143873E-004 -3.556700433095404E-004 -3.646738148330771E-004 -3.739055149185375E-004 +-3.833709134511147E-004 -3.930759263734528E-004 -4.030266193826997E-004 -4.132292117211390E-004 +-4.236900800627543E-004 -4.344157624981610E-004 -4.454129626203963E-004 -4.566885537141079E-004 +-4.682495830507758E-004 -4.801032762926324E-004 -4.922570420080427E-004 -5.047184763011618E-004 +-5.174953675587550E-004 -5.305957013171550E-004 -5.440276652523898E-004 -5.577996542965942E-004 +-5.719202758839141E-004 -5.863983553291547E-004 -6.012429413425584E-004 -6.164633116841403E-004 +-6.320689789611118E-004 -6.480696965720176E-004 -6.644754648012991E-004 -6.812965370680790E-004 +-6.985434263330791E-004 -7.162269116676690E-004 -7.343580449891395E-004 -7.529481579664222E-004 +-7.720088691005384E-004 -7.915520909842332E-004 -8.115900377452905E-004 -8.321352326782047E-004 +-8.532005160689592E-004 -8.747990532177813E-004 -8.969443426649184E-004 -9.196502246245312E-004 +-9.429308896319895E-004 -9.668008874099666E-004 -9.912751359588442E-004 -1.016368930877131E-003 +-1.042097954917690E-003 -1.068478287785743E-003 -1.095526416184772E-003 -1.123259244116567E-003 +-1.151694103441869E-003 -1.180848764708189E-003 -1.210741448251540E-003 -1.241390835579045E-003 +-1.272816081039473E-003 -1.305036823789030E-003 -1.338073200059831E-003 -1.371945855738728E-003 +-1.406675959264332E-003 -1.442285214850255E-003 -1.478795876042851E-003 -1.516230759621879E-003 +-1.554613259852765E-003 -1.593967363099375E-003 -1.634317662806338E-003 -1.675689374860352E-003 +-1.718108353339964E-003 -1.761601106663704E-003 -1.806194814146601E-003 -1.851917342975388E-003 +-1.898797265613030E-003 -1.946863877643356E-003 -1.996147216066948E-003 -2.046678078059686E-003 +-2.098488040205611E-003 -2.151609478216113E-003 -2.206075587147701E-003 -2.261920402130972E-003 +-2.319178819623677E-003 -2.377886619201081E-003 -2.438080485897257E-003 -2.499798033111154E-003 +-2.563077826091739E-003 -2.627959406016816E-003 -2.694483314680485E-003 -2.762691119804651E-003 +-2.832625440990287E-003 -2.904329976324626E-003 -2.977849529660816E-003 -3.053230038586989E-003 +-3.130518603102194E-003 -3.209763515016945E-003 -3.291014288096745E-003 -3.374321688967273E-003 +-3.459737768800410E-003 -3.547315895800912E-003 -3.637110788513778E-003 -3.729178549973105E-003 +-3.823576702713613E-003 -3.920364224666527E-003 -4.019601585962216E-003 -4.121350786662333E-003 +-4.225675395444930E-003 -4.332640589266597E-003 -4.442313194026090E-003 -4.554761726254851E-003 +-4.670056435860175E-003 -4.788269349947538E-003 -4.909474317749312E-003 -5.033747056687619E-003 +-5.161165199599980E-003 -5.291808343156936E-003 -5.425758097501686E-003 -5.563098137142474E-003 +-5.703914253129162E-003 -5.848294406546420E-003 -5.996328783356535E-003 -6.148109850625765E-003 +-6.303732414169138E-003 -6.463293677649112E-003 -6.626893303164882E-003 -6.794633473369584E-003 +-6.966618955153854E-003 -7.142957164935132E-003 -7.323758235592772E-003 -7.509135085090594E-003 +-7.699203486829029E-003 -7.894082141770205E-003 -8.093892752380615E-003 -8.298760098436702E-003 +-8.508812114740316E-003 -8.724179970791666E-003 -8.944998152468976E-003 -9.171404545765066E-003 +-9.403540522632188E-003 -9.641551028988168E-003 -9.885584674937751E-003 -1.013579382726455E-002 +-1.039233470425053E-002 -1.065536747288093E-002 -1.092505634849455E-002 -1.120156969694030E-002 +-1.148508013930248E-002 -1.177576465925931E-002 -1.207380471313981E-002 -1.237938634274690E-002 +-1.269270029101531E-002 -1.301394212057501E-002 -1.334331233529273E-002 -1.368101650486523E-002 +-1.402726539254080E-002 -1.438227508604642E-002 -1.474626713180037E-002 -1.511946867249200E-002 +-1.550211258811192E-002 -1.589443764051876E-002 -1.629668862162967E-002 -1.670911650532483E-002 +-1.713197860315758E-002 -1.756553872396456E-002 -1.801006733747233E-002 -1.846584174199927E-002 +-1.893314623635373E-002 -1.941227229603236E-002 -1.990351875382417E-002 -2.040719198492934E-002 +-2.092360609670390E-002 -2.145308312314362E-002 -2.199595322422448E-002 -2.255255489021774E-002 +-2.312323515110306E-002 -2.370834979120344E-002 -2.430826356917065E-002 -2.492335044345160E-002 +-2.555399380336952E-002 -2.620058670595733E-002 -2.686353211868313E-002 -2.754324316821126E-002 +-2.824014339534626E-002 -2.895466701630850E-002 -2.968725919049682E-002 -3.043837629489383E-002 +-3.120848620527550E-002 -3.199806858438846E-002 -3.280761517726370E-002 -3.363763011383802E-002 +-3.448863021905908E-002 -3.536114533065304E-002 -3.625571862473926E-002 -3.717290694947804E-002 +-3.811328116694433E-002 -3.907742650342264E-002 -4.006594290832277E-002 -4.107944542192165E-002 +-4.211856455213803E-002 -4.318394666055553E-002 -4.427625435790931E-002 -4.539616690925962E-002 +-4.654438064907875E-002 -4.772160940648147E-002 -4.892858494083677E-002 -5.016605738799987E-002 +-5.143479571741054E-002 -5.273558820030848E-002 -5.406924288931931E-002 -5.543658810967297E-002 +-5.683847296231786E-002 -5.827576783920127E-002 -5.974936495099070E-002 -6.126017886751497E-002 +-6.280914707121069E-002 -6.439723052386290E-002 -6.602541424693427E-002 -6.769470791578296E-002 +-6.940614646807086E-002 -7.116079072667443E-002 -7.295972803740897E-002 -7.480407292188543E-002 +-7.669496774582370E-002 -7.863358340314634E-002 -8.062112001618854E-002 -8.265880765235616E-002 +-8.474790705757344E-002 -8.688971040686472E-002 -8.908554207241295E-002 -9.133675940945142E-002 +-9.364475356033727E-002 -9.601095027716472E-002 -9.843681076327830E-002 -1.009238325340428E-001 +-1.034735502972372E-001 -1.060875368534324E-001 -1.087674040167194E-001 -1.115148035561523E-001 +-1.143314281582678E-001 -1.172190124110495E-001 -1.201793338096931E-001 -1.232142137845352E-001 +-1.263255187515009E-001 -1.295151611854186E-001 -1.327851007165525E-001 -1.361373452506919E-001 +-1.395739521131263E-001 -1.430970292168360E-001 -1.467087362552066E-001 -1.504112859195739E-001 +-1.542069451418864E-001 -1.580980363627614E-001 -1.620869388251907E-001 -1.661760898941367E-001 +-1.703679864022375E-001 -1.746651860218158E-001 -1.790703086633613E-001 -1.835860379006301E-001 +-1.882151224224672E-001 -1.929603775114339E-001 -1.978246865492747E-001 -2.028110025492214E-001 +-2.079223497150899E-001 -2.131618250270668E-001 -2.185325998540422E-001 -2.240379215922732E-001 +-2.296811153301114E-001 -2.354655855384484E-001 -2.413948177864630E-001 -2.474723804821754E-001 +-2.537019266372200E-001 -2.600871956551562E-001 -2.666320151425341E-001 -2.733403027418152E-001 +-2.802160679851412E-001 -2.872634141677971E-001 -2.944865402400877E-001 -3.018897427161930E-001 +-3.094774175983972E-001 -3.172540623149314E-001 -3.252242776694561E-001 -3.333927698000296E-001 +-3.417643521451813E-001 -3.503439474144735E-001 -3.591365895606938E-001 -3.681474257505437E-001 +-3.773817183304076E-001 -3.868448467834706E-001 -3.965423096741227E-001 -4.064797265752543E-001 +-4.166628399736285E-001 -4.270975171481409E-001 -4.377897520153515E-001 -4.487456669361574E-001 +-4.599715144770581E-001 -4.714736791188545E-001 -4.832586789051082E-001 -4.953331670220955E-001 +-5.077039333012635E-001 -5.203779056346382E-001 -5.333621512927730E-001 -5.466638781341299E-001 +-5.602904356939449E-001 -5.742493161396886E-001 -5.885481550793883E-001 -6.031947322079778E-001 +-6.181969717758451E-001 -6.335629428626217E-001 -6.493008594379871E-001 -6.654190801900982E-001 +-6.819261081008085E-001 -6.988305897454583E-001 -7.161413142935392E-001 -7.338672121848237E-001 +-7.520173534540068E-001 -7.706009456749776E-001 -7.896273314940270E-001 -8.091059857193129E-001 +-8.290465119317017E-001 -8.494586385800420E-001 -8.703522145214219E-001 -8.917372039646383E-001 +-9.136236807724841E-001 -9.360218220756904E-001 -9.589419011486532E-001 -9.823942794939543E-001 +-1.006389398079675E+000 -1.030937767670249E+000 -1.056049958188116E+000 -1.081736587040064E+000 +-1.108008306338321E+000 -1.134875788942740E+000 -1.162349713246484E+000 -1.190440746623429E+000 +-1.219159527451446E+000 -1.248516645621245E+000 -1.278522621436077E+000 -1.309187882803090E+000 +-1.340522740612328E+000 -1.372537362194844E+000 -1.405241742746414E+000 -1.438645674598624E+000 +-1.472758714214314E+000 -1.507590146779331E+000 -1.543148948258046E+000 -1.579443744775154E+000 +-1.616482769181824E+000 -1.654273814659949E+000 -1.692824185213875E+000 -1.732140642895386E+000 +-1.772229351604022E+000 -1.813095817301815E+000 -1.854744824479118E+000 -1.897180368705997E+000 +-1.940405585102878E+000 -1.984422672563450E+000 -2.029232813563646E+000 -2.074836089392387E+000 +-2.121231390642506E+000 -2.168416322805135E+000 -2.216387106816625E+000 -2.265138474415183E+000 +-2.314663558174465E+000 -2.364953776093370E+000 -2.415998710636432E+000 -2.467785982136537E+000 +-2.520301116492536E+000 -2.573527407118540E+000 -2.627445771129216E+000 -2.682034599777791E+000 +-2.737269603199404E+000 -2.793123649553989E+000 -2.849566598709223E+000 -2.906565130656050E+000 +-2.964082568907745E+000 -3.022078699197878E+000 -3.080509583864390E+000 -3.139327372386151E+000 +-3.198480108624966E+000 -3.257911535421704E+000 -3.317560897298813E+000 -3.377362742134766E+000 +-3.437246722798709E+000 -3.497137399865629E+000 -3.556954046675513E+000 -3.616610458152174E+000 +-3.676014764961200E+000 -3.735069254760133E+000 -3.793670202477827E+000 -3.851707711754598E+000 +-3.909065569878354E+000 -3.965621118765052E+000 -4.021245144753420E+000 -4.075801790211995E+000 +-4.129148490191599E+000 -4.181135937594688E+000 -4.231608080574318E+000 -4.280402156116430E+000 +-4.327348763996949E+000 -4.372271985537566E+000 -4.414989551805687E+000 -4.455313066112370E+000 +-4.493048285850980E+000 -4.527995468883971E+000 -4.559949789819850E+000 -4.588701831619567E+000 +-4.614038158025029E+000 -4.635741972303426E+000 -4.653593867741125E+000 -4.667372675191550E+000 +-4.676856412771619E+000 -4.681823342501818E+000 -4.682053138284346E+000 -4.677328169100658E+000 +-4.667434900673019E+000 -4.652165418062082E+000 -4.631319070752564E+000 -4.604704240699860E+000 +-4.572140232560480E+000 -4.533459283897804E+000 -4.488508691531225E+000 -4.437153048372119E+000 +-4.379276583056396E+000 -4.314785592433352E+000 -4.243610954499535E+000 -4.165710706671606E+000 +-4.081072671371463E+000 -3.989717107753898E+000 -3.891699365043773E+000 -3.787112509374679E+000 +-3.676089892244952E+000 -3.558807624741808E+000 -3.435486917551135E+000 -3.306396242488577E+000 +-3.171853266886182E+000 -3.032226507681965E+000 -2.887936647526053E+000 -2.739457450689569E+000 +-2.587316212099967E+000 -2.432093668506068E+000 -2.274423296692659E+000 -2.114989919933567E+000 +-1.954527540644367E+000 -1.793816314653481E+000 -1.633678580887233E+000 -1.474973859850492E+000 +-1.318592735437162E+000 -1.165449537772878E+000 -1.016473750514458E+000 -8.726000749698608E-001 +-7.347570963473823E-001 -6.038545153285990E-001 -4.807689320855421E-001 -3.663282010900124E-001 +-2.612944150345410E-001 -1.663456265122479E-001 -8.205647856564720E-002 -8.877991741091574E-003 + 5.288315206949503E-002 1.030853778072129E-001 1.417724548589676E-001 1.691924674011923E-001 + 1.858146016629774E-001 1.923426279096748E-001 1.897237189148411E-001 1.791509784390031E-001 + 1.620577497945949E-001 1.401014322419140E-001 1.151341468282651E-001 8.915715666037022E-002 + 6.425545030375676E-002 4.235655674850899E-002 2.463412529326869E-002 1.177513228287110E-002 + 3.943917392410514E-003 5.560911616415589E-004 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 + + dion(1:4) = + 6.749115800389129E-001 0.000000000000000E+000 0.000000000000000E+000 2.681987499466206E-001 +/ + +&pswfc + els(1) = "3S" + lchi(1) = 0 + oc(1) = 2.000000000000000E+000 + nchi(1) = 1 + epseu(1) = -7.966274208176654E-001 + rcut_chi(1) = 1.750000000000000E+000 + rcutus_chi(1) = 1.750000000000000E+000 + chi(1:1141,1) = + 1.588529165901082E-005 1.608510403164364E-005 1.628742973457217E-005 1.649230038160163E-005 + 1.669974798419004E-005 1.690980495645004E-005 1.712250412021369E-005 1.733787871016099E-005 + 1.755596237901280E-005 1.777678920278922E-005 1.800039368613398E-005 1.822681076770591E-005 + 1.845607582563815E-005 1.868822468306608E-005 1.892329361372477E-005 1.916131934761678E-005 + 1.940233907675137E-005 1.964639046095580E-005 1.989351163375976E-005 2.014374120835385E-005 + 2.039711828362291E-005 2.065368245025533E-005 2.091347379692926E-005 2.117653291657641E-005 + 2.144290091272493E-005 2.171261940592186E-005 2.198573054023641E-005 2.226227698984515E-005 + 2.254230196569982E-005 2.282584922227927E-005 2.311296306442607E-005 2.340368835426934E-005 + 2.369807051823450E-005 2.399615555414131E-005 2.429799003839108E-005 2.460362113324433E-005 + 2.491309659419003E-005 2.522646477740759E-005 2.554377464732240E-005 2.586507578425691E-005 + 2.619041839217741E-005 2.651985330653871E-005 2.685343200222718E-005 2.719120660160391E-005 + 2.753322988264889E-005 2.787955528720770E-005 2.823023692934195E-005 2.858532960378468E-005 + 2.894488879450220E-005 2.930897068336365E-005 2.967763215891943E-005 3.005093082529024E-005 + 3.042892501116789E-005 3.081167377892925E-005 3.119923693386494E-005 3.159167503352393E-005 + 3.198904939717597E-005 3.239142211539273E-005 3.279885605974977E-005 3.321141489265016E-005 + 3.362916307727211E-005 3.405216588764136E-005 3.448048941883048E-005 3.491420059728628E-005 + 3.535336719128748E-005 3.579805782153343E-005 3.624834197186633E-005 3.670429000012832E-005 + 3.716597314915503E-005 3.763346355790750E-005 3.810683427274398E-005 3.858615925883378E-005 + 3.907151341171437E-005 3.956297256899412E-005 4.006061352220206E-005 4.056451402878668E-005 + 4.107475282426596E-005 4.159140963452983E-005 4.211456518829770E-005 4.264430122973235E-005 + 4.318070053121286E-005 4.372384690626792E-005 4.427382522267201E-005 4.483072141570621E-005 + 4.539462250158579E-005 4.596561659105676E-005 4.654379290316343E-005 4.712924177918919E-005 + 4.772205469677249E-005 4.832232428420068E-005 4.893014433488335E-005 4.954560982200767E-005 + 5.016881691337852E-005 5.079986298644491E-005 5.143884664351543E-005 5.208586772716509E-005 + 5.274102733583636E-005 5.340442783963578E-005 5.407617289632990E-005 5.475636746754197E-005 + 5.544511783515249E-005 5.614253161790622E-005 5.684871778822796E-005 5.756378668924963E-005 + 5.828785005205225E-005 5.902102101312385E-005 5.976341413203765E-005 6.051514540935224E-005 + 6.127633230473725E-005 6.204709375532680E-005 6.282755019430369E-005 6.361782356971785E-005 + 6.441803736354086E-005 6.522831661096045E-005 6.604878791991811E-005 6.687957949089174E-005 + 6.772082113692753E-005 6.857264430392372E-005 6.943518209116963E-005 7.030856927214297E-005 + 7.119294231556850E-005 7.208843940674227E-005 7.299520046912326E-005 7.391336718619711E-005 + 7.484308302361489E-005 7.578449325161008E-005 7.673774496769773E-005 7.770298711965918E-005 + 7.868037052881564E-005 7.967004791359498E-005 8.067217391339438E-005 8.168690511274363E-005 + 8.271440006577244E-005 8.375481932098477E-005 8.480832544634577E-005 8.587508305468351E-005 + 8.695525882941070E-005 8.804902155056995E-005 8.915654212120621E-005 9.027799359407200E-005 + 9.141355119866682E-005 9.256339236861826E-005 9.372769676940704E-005 9.490664632644060E-005 + 9.610042525348003E-005 9.730922008142463E-005 9.853321968745823E-005 9.977261532456285E-005 + 1.010276006514024E-004 1.022983717625839E-004 1.035851272192976E-004 1.048880680803442E-004 + 1.062073979335512E-004 1.075433229275850E-004 1.088960518041630E-004 1.102657959306710E-004 + 1.116527693331905E-004 1.130571887299423E-004 1.144792735651499E-004 1.159192460433295E-004 + 1.173773311640109E-004 1.188537567568957E-004 1.203487535174575E-004 1.218625550429894E-004 + 1.233953978691059E-004 1.249475215067034E-004 1.265191684793860E-004 1.281105843613616E-004 + 1.297220178158152E-004 1.313537206337647E-004 1.330059477734052E-004 1.346789573999494E-004 + 1.363730109259673E-004 1.380883730522352E-004 1.398253118090980E-004 1.415840985983507E-004 + 1.433650082356483E-004 1.451683189934486E-004 1.469943126444949E-004 1.488432745058471E-004 + 1.507154934834635E-004 1.526112621173481E-004 1.545308766272620E-004 1.564746369590113E-004 + 1.584428468313175E-004 1.604358137832770E-004 1.624538492224182E-004 1.644972684733634E-004 + 1.665663908271010E-004 1.686615395908805E-004 1.707830421387325E-004 1.729312299626266E-004 + 1.751064387242708E-004 1.773090083075636E-004 1.795392828717069E-004 1.817976109049841E-004 + 1.840843452792192E-004 1.863998433049171E-004 1.887444667870996E-004 1.911185820818437E-004 + 1.935225601535302E-004 1.959567766328143E-004 1.984216118753233E-004 2.009174510210955E-004 + 2.034446840547645E-004 2.060037058665013E-004 2.085949163137254E-004 2.112187202835884E-004 + 2.138755277562467E-004 2.165657538689300E-004 2.192898189808136E-004 2.220481487387104E-004 + 2.248411741435866E-004 2.276693316179159E-004 2.305330630738806E-004 2.334328159824303E-004 + 2.363690434432109E-004 2.393422042553721E-004 2.423527629892664E-004 2.454011900590513E-004 + 2.484879617962022E-004 2.516135605239543E-004 2.547784746326773E-004 2.579831986562020E-004 + 2.612282333491037E-004 2.645140857649617E-004 2.678412693356017E-004 2.712103039513347E-004 + 2.746217160422073E-004 2.780760386602737E-004 2.815738115629020E-004 2.851155812971321E-004 + 2.887019012850911E-004 2.923333319104854E-004 2.960104406061827E-004 2.997338019428931E-004 + 3.035039977189694E-004 3.073216170513359E-004 3.111872564675619E-004 3.151015199990936E-004 + 3.190650192756587E-004 3.230783736208633E-004 3.271422101489858E-004 3.312571638629937E-004 + 3.354238777537926E-004 3.396430029007234E-004 3.439151985733270E-004 3.482411323343870E-004 + 3.526214801442716E-004 3.570569264665876E-004 3.615481643751653E-004 3.660958956623891E-004 + 3.707008309488938E-004 3.753636897946380E-004 3.800852008113810E-004 3.848661017765708E-004 + 3.897071397486692E-004 3.946090711839270E-004 3.995726620546306E-004 4.045986879688354E-004 + 4.096879342916087E-004 4.148411962677992E-004 4.200592791463502E-004 4.253429983061806E-004 + 4.306931793836486E-004 4.361106584016229E-004 4.415962819001778E-004 4.471509070689325E-004 + 4.527754018810608E-004 4.584706452289857E-004 4.642375270617835E-004 4.700769485243189E-004 + 4.759898220981310E-004 4.819770717440949E-004 4.880396330468821E-004 4.941784533612368E-004 + 5.003944919600973E-004 5.066887201845818E-004 5.130621215958652E-004 5.195156921289681E-004 + 5.260504402484814E-004 5.326673871062587E-004 5.393675667010887E-004 5.461520260403839E-004 + 5.530218253039050E-004 5.599780380095485E-004 5.670217511812229E-004 5.741540655188425E-004 + 5.813760955704620E-004 5.886889699065811E-004 5.960938312966429E-004 6.035918368877635E-004 + 6.111841583857091E-004 6.188719822381565E-004 6.266565098202630E-004 6.345389576225772E-004 + 6.425205574413181E-004 6.506025565710537E-004 6.587862179998086E-004 6.670728206066323E-004 + 6.754636593616597E-004 6.839600455286942E-004 6.925633068703435E-004 7.012747878557504E-004 + 7.100958498709329E-004 7.190278714317889E-004 7.280722483997816E-004 7.372303942003470E-004 + 7.465037400440596E-004 7.558937351505871E-004 7.654018469754724E-004 7.750295614397786E-004 + 7.847783831626288E-004 7.946498356966873E-004 8.046454617666113E-004 8.147668235105115E-004 + 8.250155027244622E-004 8.353931011101009E-004 8.459012405253535E-004 8.565415632383276E-004 + 8.673157321844120E-004 8.782254312266261E-004 8.892723654192560E-004 9.004582612748233E-004 + 9.117848670344280E-004 9.232539529415100E-004 9.348673115190682E-004 9.466267578503855E-004 + 9.585341298633053E-004 9.705912886180984E-004 9.828001185989770E-004 9.951625280092903E-004 + 1.007680449070459E-003 1.020355838324687E-003 1.033190676941511E-003 1.046186971028226E-003 + 1.059346751944234E-003 1.072672076619387E-003 1.086165027876348E-003 1.099827714757043E-003 + 1.113662272853243E-003 1.127670864641341E-003 1.141855679821359E-003 1.156218935660263E-003 + 1.170762877339627E-003 1.185489778307705E-003 1.200401940635959E-003 1.215501695380130E-003 + 1.230791402945865E-003 1.246273453459003E-003 1.261950267140548E-003 1.277824294686412E-003 + 1.293898017651969E-003 1.310173948841509E-003 1.326654632702620E-003 1.343342645725602E-003 + 1.360240596847937E-003 1.377351127863922E-003 1.394676913839494E-003 1.412220663532343E-003 + 1.429985119817365E-003 1.447973060117535E-003 1.466187296840259E-003 1.484630677819292E-003 + 1.503306086762268E-003 1.522216443703965E-003 1.541364705465313E-003 1.560753866118283E-003 + 1.580386957456686E-003 1.600267049472993E-003 1.620397250841236E-003 1.640780709406078E-003 + 1.661420612678126E-003 1.682320188335585E-003 1.703482704732310E-003 1.724911471412375E-003 + 1.746609839631206E-003 1.768581202883398E-003 1.790828997437293E-003 1.813356702876393E-003 + 1.836167842647734E-003 1.859265984617268E-003 1.882654741632391E-003 1.906337772091683E-003 + 1.930318780521966E-003 1.954601518162775E-003 1.979189783558353E-003 2.004087423157244E-003 + 2.029298331919617E-003 2.054826453932410E-003 2.080675783032391E-003 2.106850363437271E-003 + 2.133354290384927E-003 2.160191710780910E-003 2.187366823854295E-003 2.214883881822025E-003 + 2.242747190561830E-003 2.270961110293874E-003 2.299530056271213E-003 2.328458499479217E-003 + 2.357750967344054E-003 2.387412044450384E-003 2.417446373268354E-003 2.447858654890072E-003 + 2.478653649775645E-003 2.509836178508941E-003 2.541411122563195E-003 2.573383425076610E-003 + 2.605758091638078E-003 2.638540191083167E-003 2.671734856300534E-003 2.705347285048886E-003 + 2.739382740784648E-003 2.773846553500481E-003 2.808744120574842E-003 2.844080907632671E-003 + 2.879862449417439E-003 2.916094350674661E-003 2.952782287047084E-003 2.989932005981677E-003 + 3.027549327648609E-003 3.065640145872421E-003 3.104210429075494E-003 3.143266221234074E-003 + 3.182813642846971E-003 3.222858891917166E-003 3.263408244946470E-003 3.304468057943473E-003 + 3.346044767444943E-003 3.388144891550892E-003 3.430775030973515E-003 3.473941870100193E-003 + 3.517652178070783E-003 3.561912809869405E-003 3.606730707430938E-003 3.652112900762478E-003 + 3.698066509079949E-003 3.744598741960090E-003 3.791716900508123E-003 3.839428378541259E-003 + 3.887740663788321E-003 3.936661339105771E-003 3.986198083710309E-003 4.036358674428421E-003 + 4.087150986962996E-003 4.138582997177442E-003 4.190662782397439E-003 4.243398522730695E-003 + 4.296798502404968E-003 4.350871111124635E-003 4.405624845446120E-003 4.461068310172487E-003 + 4.517210219767505E-003 4.574059399789524E-003 4.631624788345443E-003 4.689915437565156E-003 + 4.748940515096783E-003 4.808709305623022E-003 4.869231212399025E-003 4.930515758812113E-003 + 4.992572589963741E-003 5.055411474274063E-003 5.119042305109477E-003 5.183475102433573E-003 + 5.248720014481912E-003 5.314787319460987E-003 5.381687427271826E-003 5.449430881258691E-003 + 5.518028359983281E-003 5.587490679024933E-003 5.657828792807236E-003 5.729053796451602E-003 + 5.801176927658225E-003 5.874209568614983E-003 5.948163247934728E-003 6.023049642621564E-003 + 6.098880580066623E-003 6.175668040073841E-003 6.253424156916410E-003 6.332161221424409E-003 + 6.411891683104199E-003 6.492628152290287E-003 6.574383402330132E-003 6.657170371802731E-003 + 6.741002166771474E-003 6.825892063072034E-003 6.911853508636005E-003 6.998900125850900E-003 + 7.087045713957378E-003 7.176304251484370E-003 7.266689898722872E-003 7.358217000239269E-003 + 7.450900087428897E-003 7.544753881110831E-003 7.639793294164633E-003 7.736033434210024E-003 + 7.833489606330329E-003 7.932177315840698E-003 8.032112271102045E-003 8.133310386381671E-003 + 8.235787784761634E-003 8.339560801095909E-003 8.444645985017369E-003 8.551060103995754E-003 + 8.658820146447808E-003 8.767943324900654E-003 8.878447079209701E-003 8.990349079832326E-003 + 9.103667231158614E-003 9.218419674900464E-003 9.334624793540428E-003 9.452301213841779E-003 + 9.571467810421093E-003 9.692143709385009E-003 9.814348292032598E-003 9.938101198625007E-003 + 1.006342233222396E-002 1.019033186260083E-002 1.031885023021802E-002 1.044899815028452E-002 + 1.058079661688733E-002 1.071426690720092E-002 1.084943058577639E-002 1.098630950891267E-002 + 1.112492582911163E-002 1.126530199961949E-002 1.140746077905657E-002 1.155142523613781E-002 + 1.169721875448643E-002 1.184486503754327E-002 1.199438811357422E-002 1.214581234077847E-002 + 1.229916241250035E-002 1.245446336254743E-002 1.261174057061796E-002 1.277101976784053E-002 + 1.293232704242915E-002 1.309568884545689E-002 1.326113199675144E-002 1.342868369091604E-002 + 1.359837150347929E-002 1.377022339717756E-002 1.394426772837375E-002 1.412053325361650E-002 + 1.429904913634355E-002 1.447984495373387E-002 1.466295070371267E-002 1.484839681211385E-002 + 1.503621414000465E-002 1.522643399117707E-002 1.541908811981144E-002 1.561420873831690E-002 + 1.581182852535450E-002 1.601198063404821E-002 1.621469870038971E-002 1.642001685184291E-002 + 1.662796971615423E-002 1.683859243037519E-002 1.705192065010381E-002 1.726799055895172E-002 + 1.748683887824392E-002 1.770850287695881E-002 1.793302038191582E-002 1.816042978821874E-002 + 1.839077006996282E-002 1.862408079121403E-002 1.886040211726949E-002 1.909977482620794E-002 + 1.934224032073988E-002 1.958784064036700E-002 1.983661847386117E-002 2.008861717207336E-002 + 2.034388076108364E-002 2.060245395570321E-002 2.086438217334059E-002 2.112971154824390E-002 + 2.139848894613183E-002 2.167076197922651E-002 2.194657902170178E-002 2.222598922556104E-002 + 2.250904253695920E-002 2.279578971298392E-002 2.308628233891193E-002 2.338057284595673E-002 + 2.367871452952463E-002 2.398076156799675E-002 2.428676904205517E-002 2.459679295457235E-002 + 2.491089025108317E-002 2.522911884086053E-002 2.555153761861524E-002 2.587820648684238E-002 + 2.620918637883717E-002 2.654453928240392E-002 2.688432826428277E-002 2.722861749531975E-002 + 2.757747227640692E-002 2.793095906522004E-002 2.828914550378255E-002 2.865210044688568E-002 + 2.901989399139573E-002 2.939259750648041E-002 2.977028366478785E-002 3.015302647461306E-002 + 3.054090131308787E-002 3.093398496043154E-002 3.133235563530165E-002 3.173609303128478E-002 + 3.214527835457003E-002 3.255999436284841E-002 3.298032540548383E-002 3.340635746500287E-002 + 3.383817819995216E-002 3.427587698917476E-002 3.471954497755828E-002 3.516927512331000E-002 + 3.562516224681624E-002 3.608730308114531E-002 3.655579632425633E-002 3.703074269297810E-002 + 3.751224497882487E-002 3.800040810571872E-002 3.849533918969075E-002 3.899714760063636E-002 + 3.950594502620294E-002 4.002184553789078E-002 4.054496565945242E-002 4.107542443767773E-002 + 4.161334351565634E-002 4.215884720861259E-002 4.271206258241132E-002 4.327311953483778E-002 + 4.384215087975776E-002 4.441929243426975E-002 4.500468310896374E-002 4.559846500140734E-002 + 4.620078349298348E-002 4.681178734920947E-002 4.743162882367243E-002 4.806046376572067E-002 + 4.869845173205725E-002 4.934575610238687E-002 5.000254419927290E-002 5.066898741236842E-002 + 5.134526132719069E-002 5.203154585861577E-002 5.272802538927680E-002 5.343488891305462E-002 + 5.415233018386047E-002 5.488054786991462E-002 5.561974571373342E-002 5.637013269804769E-002 + 5.713192321787967E-002 5.790533725901802E-002 5.869060058313692E-002 5.948794491981513E-002 + 6.029760816572110E-002 6.111983459123801E-002 6.195487505481420E-002 6.280298722533377E-002 + 6.366443581281241E-002 6.453949280773520E-002 6.542843772936223E-002 6.633155788334029E-002 + 6.724914862896936E-002 6.818151365648449E-002 6.912896527472563E-002 7.009182470957727E-002 + 7.107042241357520E-002 7.206509838708554E-002 7.307620251147579E-002 7.410409489470854E-002 + 7.514914622979774E-002 7.621173816658353E-002 7.729226369728727E-002 7.839112755632256E-002 + 7.950874663484810E-002 8.064555041055484E-002 8.180198139319281E-002 8.297849558634772E-002 + 8.417556296598543E-002 8.539366797628918E-002 8.663331004331666E-002 8.789500410700926E-002 + 8.917928117208242E-002 9.048668887832935E-002 9.181779209086323E-002 9.317317351081539E-002 + 9.455343430700160E-002 9.595919476904721E-002 9.739109498245070E-002 9.884979552603931E-002 + 1.003359781922411E-001 1.018503467305673E-001 1.033936276146549E-001 1.049665708331725E-001 + 1.065699507048367E-001 1.082045667177188E-001 1.098712443929483E-001 1.115708361728288E-001 + 1.133042223332832E-001 1.150723119204342E-001 1.168760437109878E-001 1.187163871959503E-001 + 1.205943435870358E-001 1.225109468449371E-001 1.244672647284223E-001 1.264643998629819E-001 + 1.285034908274922E-001 1.305857132570591E-001 1.327122809598846E-001 1.348844470456321E-001 + 1.371035050623572E-001 1.393707901386296E-001 1.416876801269654E-001 1.440555967441484E-001 + 1.464760067034094E-001 1.489504228327623E-001 1.514804051730706E-001 1.540675620486026E-001 + 1.567135511019550E-001 1.594200802842598E-001 1.621889087905253E-001 1.650218479288173E-001 + 1.679207619107228E-001 1.708875685491768E-001 1.739242398482532E-001 1.770328024679073E-001 + 1.802153380449329E-001 1.834739833495163E-001 1.868109302547606E-001 1.902284254943944E-001 + 1.937287701815613E-001 1.973143190591231E-001 2.009874794492807E-001 2.047507098675329E-001 + 2.086065182630612E-001 2.125574598445265E-001 2.166061344470464E-001 2.207551833927419E-001 + 2.250072857937791E-001 2.293651542432474E-001 2.338315298355891E-001 2.384091764546271E-001 + 2.431008742635857E-001 2.479094123279243E-001 2.528375802983519E-001 2.578881590781559E-001 + 2.630639103960439E-001 2.683675652031689E-001 2.738018108110112E-001 2.793692766854718E-001 + 2.850725188120368E-001 2.909140025474080E-001 2.968960838747436E-001 3.030209889828561E-001 + 3.092907920946371E-001 3.157073914768611E-001 3.222724835727047E-001 3.289875352101008E-001 + 3.358537538537729E-001 3.428720558868242E-001 3.500430329294393E-001 3.573669162279834E-001 + 3.648435391778648E-001 3.724722980783504E-001 3.802521112573288E-001 3.881813767490903E-001 + 3.962579287586712E-001 4.044789932022479E-001 4.128411426744247E-001 4.213402512597623E-001 + 4.299714496771207E-001 4.387290813206923E-001 4.476066598399679E-001 4.565968289811138E-001 + 4.656913254926538E-001 4.748809459769732E-001 4.841555186435170E-001 4.935038809867748E-001 + 5.029138644689165E-001 5.123722873294058E-001 5.218649566679666E-001 5.313766809482996E-001 + 5.408912940430808E-001 5.503916918811030E-001 5.598598826598388E-001 5.692770514465103E-001 + 5.786236398034933E-001 5.878794408359337E-001 5.970237097682299E-001 6.060352898101882E-001 + 6.148927526738127E-001 6.235745526504718E-001 6.320591926606709E-001 6.403254001531565E-001 + 6.483523101676865E-001 6.561196523015754E-001 6.636079377527033E-001 6.707986420737744E-001 + 6.776743787912428E-001 6.842190586487578E-001 6.904180289652696E-001 6.962581874930431E-001 + 7.017280652671564E-001 7.068178733086412E-001 7.115195087385942E-001 7.158265169505379E-001 + 7.197340080549429E-001 7.232385279502981E-001 7.263378872058027E-001 7.290309546013406E-001 + 7.313174268294337E-001 7.331975917228782E-001 7.346721096699950E-001 7.357418468966542E-001 + 7.364078053523058E-001 7.366712001205062E-001 7.365336531300881E-001 7.359972616161919E-001 + 7.350646016162605E-001 7.337387252635462E-001 7.320231569827874E-001 7.299218885969601E-001 + 7.274393733587045E-001 7.245805189244857E-001 7.213506792937806E-001 7.177556457395435E-001 + 7.138016367599475E-001 7.094952870847986E-001 7.048436357732473E-001 6.998541134422532E-001 + 6.945345286679207E-001 6.888930536041369E-001 6.829382088649658E-001 6.766788477190460E-001 + 6.701241396457004E-001 6.632835533036831E-001 6.561668389644452E-001 6.487840104624525E-001 + 6.411453267155719E-001 6.332612728686871E-001 6.251425411137189E-001 6.168000112389631E-001 + 6.082447309602020E-001 5.994878960854659E-001 5.905408305644568E-001 5.814149664727547E-001 + 5.721218239798104E-001 5.626729913485116E-001 5.530801050128057E-001 5.433548297784722E-001 + 5.335088391904511E-001 5.235537961090977E-001 5.135013335354446E-001 5.033630357244393E-001 + 4.931504196232514E-001 4.828749166701086E-001 4.725478549874551E-001 4.621804420015295E-001 + 4.517837475188348E-001 4.413686872883016E-001 4.309460070763507E-001 4.205262672804651E-001 + 4.101198281053169E-001 3.997368353239816E-001 3.893872066452604E-001 3.790806187066820E-001 + 3.688264947113148E-001 3.586339927251102E-001 3.485119946501274E-001 3.384690958876178E-001 + 3.285135957036090E-001 3.186534883083033E-001 3.088964546592616E-001 2.992498549970498E-001 + 2.897207221206751E-001 2.803157554088234E-001 2.710413155915648E-001 2.619034202758264E-001 + 2.529077402265608E-001 2.440595964041316E-001 2.353639577570055E-001 2.268254397673898E-001 + 2.184483037459554E-001 2.102364568702774E-001 2.021934529600691E-001 1.943224939807120E-001 + 1.866264322649802E-001 1.791077734412255E-001 1.717686800546473E-001 1.646109758666012E-001 + 1.576361508152328E-001 1.508453666190459E-001 1.442394630033393E-001 1.378189645277900E-001 + 1.315840879918216E-001 1.255347503927814E-001 1.196705774103887E-001 1.139909123893872E-001 + 1.084948257908776E-001 1.031811250814147E-001 9.804836502763829E-002 9.309485836299414E-002 + 8.831868679197147E-002 8.371771229628611E-002 7.928958870654039E-002 7.503177350213859E-002 + 7.094153980161332E-002 6.701598850504237E-002 6.325206054991552E-002 5.964654924164186E-002 + 5.619611261989008E-002 5.289728582211954E-002 4.974649340599153E-002 4.674006159286147E-002 + 4.387423039522645E-002 4.114516559185161E-002 3.854897051531502E-002 3.608169761788820E-002 + 3.373935978300986E-002 3.151794135109916E-002 2.941340883009200E-002 2.742172126285428E-002 + 2.553884022552387E-002 2.376073943284547E-002 2.208341392867616E-002 2.050288884204493E-002 + 1.901522769142856E-002 1.761654022224722E-002 1.630298976497101E-002 1.507080010364494E-002 + 1.391626184707343E-002 1.283573829733650E-002 1.182567081272356E-002 1.088258366455324E-002 + 1.000308838968117E-002 9.183887642768500E-003 8.421778554577857E-003 7.713655604666343E-003 + 7.056513018845533E-003 6.447446703662645E-003 5.883655731916885E-003 5.362443394849369E-003 + 4.881217838126296E-003 4.437492300067055E-003 4.028884971745255E-003 3.653118499608320E-003 + 3.308019152116994E-003 2.991515672598816E-003 2.701637841040463E-003 2.436514767912972E-003 + 2.194372943335833E-003 1.973534064943884E-003 1.772412667730752E-003 1.589513578910996E-003 + 1.423429220477136E-003 1.272836781636439E-003 1.136495282704425E-003 1.013242551317782E-003 + 9.019921310190163E-004 8.017301413695556E-004 7.115121077783850E-004 6.304597782008045E-004 + 5.577579427779516E-004 4.926512713635611E-004 4.344411827309878E-004 3.824827580816849E-004 + 3.361817102962881E-004 2.949914191911462E-004 2.584100418758076E-004 2.259777061592516E-004 + 1.972737938325041E-004 1.719143195698943E-004 1.495494101470335E-004 1.298608876762683E-004 + 1.125599596146904E-004 9.738501740981253E-005 8.409954481679814E-005 7.249013615070973E-005 + 6.236462403594673E-005 5.355031555977357E-005 4.589233517116013E-005 3.925207214500177E-005 + 3.350572998058010E-005 2.854297471249878E-005 2.426567878080439E-005 2.058675683233549E-005 + 1.742908960473579E-005 1.472453187492391E-005 1.241300033177604E-005 1.044163715475333E-005 + 8.764045043335358E-006 7.339589439673769E-006 6.132763720356013E-006 5.112613193217919E-006 + 4.252213821007427E-006 3.528222380305141E-006 2.920616041294306E-006 2.411906776373607E-006 + 1.987014872013707E-006 1.632988459009587E-006 1.338730613959724E-006 1.094757357181618E-006 + 8.929836245874746E-007 7.265344921001121E-007 5.895791278288569E-007 4.771851382682925E-007 + 3.851911592308438E-007 3.100957192546507E-007 2.489605721848046E-007 1.993268560094532E-007 + 1.591425864889990E-007 1.267001364269900E-007 1.005824844970287E-007 7.961714137129975E-008 + 6.283677560884652E-008 4.944566751216675E-008 3.879121627006786E-008 3.033981442931589E-008 + 2.365648448215618E-008 1.838774551331859E-008 1.424724384992783E-008 1.100374094936707E-008 + 8.471104801663469E-009 6.499998375045360E-009 4.971000553000014E-009 3.788932046557330E-009 + 2.878191351444311E-009 2.178934374203365E-009 1.643956272901467E-009 1.236155723981352E-009 + 9.264805921802551E-010 6.922701779305991E-010 5.159231572545170E-010 3.838323039321710E-010 + 2.855373667464862E-010 2.116093609559551E-010 1.562199673285571E-010 1.148806629640611E-010 + 8.414818733147046E-011 6.139153448278705E-011 4.460836270686672E-011 3.228093117107701E-011 + 2.326351994595866E-011 1.669482034103586E-011 1.193004500600970E-011 8.488543852452095E-012 + 6.013558967365646E-012 4.241440692241636E-012 2.978204778620418E-012 2.081759850248197E-012 + 1.448494631977936E-012 1.003201806536586E-012 6.915435323151619E-013 4.744439091836144E-013 + 3.239353683141249E-013 2.200967768432197E-013 1.488072766359538E-013 1.001066298347484E-013 + 6.700425371936056E-014 4.461851391802407E-014 2.955786119549046E-014 1.947815052667691E-014 + 1.276763660589752E-014 8.324004480768487E-015 5.397388030762797E-015 3.480444392961142E-015 + 2.231800039612262E-015 1.423032466552632E-015 9.021574095936393E-016 5.686256742348749E-016 + 3.562997322729821E-016 2.219306418024968E-016 1.374039553923409E-016 8.455288574211672E-017 + 5.170963769977019E-017 3.142639924105276E-017 1.897857507863960E-017 1.138790362505613E-017 + 6.788910480721983E-018 4.020656525520265E-018 2.365366746570649E-018 1.382191432528311E-018 + 8.021751803439640E-019 4.623429209424552E-019 2.646155466148649E-019 1.503780192723965E-019 + 8.484621071494828E-020 4.752480772711412E-020 2.642459606940622E-020 1.458331185767110E-020 + 7.987723532141401E-021 4.341778552548209E-021 2.341791918238171E-021 1.253206411695263E-021 + 6.653462819271870E-022 3.504130662200751E-022 1.830527869760250E-022 9.483996986362925E-023 + 4.872820686196173E-023 2.482548833174067E-023 1.253999401982792E-023 6.279603886173609E-024 + 3.117132073469060E-024 1.533621681525724E-024 7.477782031401515E-025 3.613014660818033E-025 + 1.729653942735454E-025 8.203343231630381E-026 3.854017342124809E-026 1.793394687391563E-026 + 8.264663755132737E-027 3.771452133028719E-027 1.704011219210066E-027 7.621885175062694E-028 + 3.374608807858094E-028 1.478767303460541E-028 6.412615495653270E-029 2.751518234516415E-029 + 1.168028887750573E-029 4.904787514876242E-030 2.037102732491102E-030 8.367037856743614E-031 + 3.398097214233594E-031 1.364405796775704E-031 5.415426407443244E-032 2.124418022042571E-032 + 8.235720283488727E-033 3.154661482704268E-033 1.193790067153356E-033 4.462321068436429E-034 + 1.647343338101190E-034 6.005232710715924E-035 2.161369733443872E-035 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 + + els(2) = "3P" + lchi(2) = 1 + oc(2) = 2.000000000000000E+000 + nchi(2) = 2 + epseu(2) = -3.070517669423277E-001 + rcut_chi(2) = 1.930000000000000E+000 + rcutus_chi(2) = 1.930000000000000E+000 + chi(1:1141,2) = + 1.577903055421536E-009 1.617847861414176E-009 1.658803874983275E-009 1.700796694970694E-009 + 1.743852568255793E-009 1.787998406160837E-009 1.833261801271459E-009 1.879671044682913E-009 + 1.927255143682936E-009 1.976043839882247E-009 2.026067627804019E-009 2.077357773943944E-009 + 2.129946336312821E-009 2.183866184473845E-009 2.239151020087163E-009 2.295835397974495E-009 + 2.353954747717039E-009 2.413545395800098E-009 2.474644588318326E-009 2.537290514255736E-009 + 2.601522329355068E-009 2.667380180591398E-009 2.734905231265310E-009 2.804139686731286E-009 + 2.875126820777438E-009 2.947911002673022E-009 3.022537724900687E-009 3.099053631590740E-009 + 3.177506547675259E-009 3.257945508780235E-009 3.340420791874424E-009 3.424983946694083E-009 + 3.511687827963241E-009 3.600586628429621E-009 3.691735912736865E-009 3.785192652154245E-009 + 3.881015260185565E-009 3.979263629079487E-009 4.079999167264154E-009 4.183284837729446E-009 + 4.289185197380886E-009 4.397766437389812E-009 4.509096424565024E-009 4.623244743771733E-009 + 4.740282741424374E-009 4.860283570080425E-009 4.983322234163139E-009 5.109475636841748E-009 + 5.238822628098439E-009 5.371444054012177E-009 5.507422807290104E-009 5.646843879078202E-009 + 5.789794412083506E-009 5.936363755041128E-009 6.086643518560138E-009 6.240727632383148E-009 + 6.398712404095485E-009 6.560696579320536E-009 6.726781403438979E-009 6.897070684870464E-009 + 7.071670859957205E-009 7.250691059490183E-009 7.434243176919430E-009 7.622441938291058E-009 + 7.815404973954807E-009 8.013252892086790E-009 8.216109354073547E-009 8.424101151804413E-009 + 8.637358286920597E-009 8.856014052070415E-009 9.080205114221523E-009 9.310071600082209E-009 + 9.545757183685151E-009 9.787409176188355E-009 1.003517861794939E-008 1.028922037293055E-008 + 1.054969322549386E-008 1.081675997964640E-008 1.109058756079819E-008 1.137134712009591E-008 + 1.165921414139799E-008 1.195436855095768E-008 1.225699482988277E-008 1.256728212944237E-008 + 1.288542438929253E-008 1.321162045869477E-008 1.354607422080343E-008 1.388899472009917E-008 + 1.424059629304863E-008 1.460109870207163E-008 1.497072727289983E-008 1.534971303541262E-008 + 1.573829286803829E-008 1.613670964581069E-008 1.654521239217412E-008 1.696405643463094E-008 + 1.739350356432958E-008 1.783382219969255E-008 1.828528755418657E-008 1.874818180834001E-008 + 1.922279428611478E-008 1.970942163574318E-008 2.020836801514278E-008 2.071994528202484E-008 + 2.124447318881559E-008 2.178227958251177E-008 2.233370060959573E-008 2.289908092613771E-008 + 2.347877391321721E-008 2.407314189779758E-008 2.468255637919204E-008 2.530739826126277E-008 + 2.594805809049827E-008 2.660493630011744E-008 2.727844346035337E-008 2.796900053507301E-008 + 2.867703914489320E-008 2.940300183695751E-008 3.014734236154256E-008 3.091052595566656E-008 + 3.169302963387753E-008 3.249534248640282E-008 3.331796598484630E-008 3.416141429562430E-008 + 3.502621460133627E-008 3.591290743027087E-008 3.682204699425373E-008 3.775420153504764E-008 + 3.870995367952201E-008 3.968990080381356E-008 4.069465540670558E-008 4.172484549245946E-008 + 4.278111496333765E-008 4.386412402206329E-008 4.497454958446833E-008 4.611308570258756E-008 + 4.728044399846358E-008 4.847735410893351E-008 4.970456414167553E-008 5.096284114280043E-008 + 5.225297157627982E-008 5.357576181551155E-008 5.493203864732908E-008 5.632264978876980E-008 + 5.774846441692554E-008 5.921037371220609E-008 6.070929141535558E-008 6.224615439856986E-008 + 6.382192325107179E-008 6.543758287951015E-008 6.709414312355809E-008 6.879263938709525E-008 + 7.053413328536828E-008 7.231971330853470E-008 7.415049550200377E-008 7.602762416400101E-008 + 7.795227256079087E-008 7.992564366000582E-008 8.194897088253985E-008 8.402351887347576E-008 + 8.615058429252851E-008 8.833149662449938E-008 9.056761901024631E-008 9.286034909869046E-008 + 9.521111992039143E-008 9.762140078323660E-008 1.000926981908062E-007 1.026265567839853E-007 + 1.052245603064139E-007 1.078883325943771E-007 1.106195385917543E-007 1.134198853906621E-007 + 1.162911232984409E-007 1.192350469316529E-007 1.222534963377745E-007 1.253483581452833E-007 + 1.285215667428618E-007 1.317751054884510E-007 1.351110079489118E-007 1.385313591710692E-007 + 1.420382969849316E-007 1.456340133399026E-007 1.493207556748182E-007 1.531008283226666E-007 + 1.569765939508701E-007 1.609504750380248E-007 1.650249553880274E-007 1.692025816825296E-007 + 1.734859650726949E-007 1.778777828112490E-007 1.823807799258471E-007 1.869977709348020E-007 + 1.917316416062458E-007 1.965853507618254E-007 2.015619321260580E-007 2.066644962225039E-007 + 2.118962323179396E-007 2.172604104157495E-007 2.227603832997785E-007 2.283995886299272E-007 + 2.341815510907943E-007 2.401098845947152E-007 2.461882945405670E-007 2.524205801297580E-007 + 2.588106367408456E-007 2.653624583642667E-007 2.720801400987067E-007 2.789678807106584E-007 + 2.860299852587817E-007 2.932708677846970E-007 3.006950540718946E-007 3.083071844744881E-007 + 3.161120168175764E-007 3.241144293710283E-007 3.323194238985507E-007 3.407321287839395E-007 + 3.493578022364769E-007 3.582018355774689E-007 3.672697566099831E-007 3.765672330738929E-007 + 3.861000761883820E-007 3.958742442841320E-007 4.058958465274558E-007 4.161711467387088E-007 + 4.267065673073612E-007 4.375086932061814E-007 4.485842761070398E-007 4.599402386009002E-007 + 4.715836785246438E-007 4.835218733974251E-007 4.957622849693308E-007 5.083125638851949E-007 + 5.211805544664711E-007 5.343742996141612E-007 5.479020458358604E-007 5.617722484000587E-007 + 5.759935766209310E-007 5.905749192769005E-007 6.055253901663810E-007 6.208543338041589E-007 + 6.365713312619758E-007 6.526862061569727E-007 6.692090307917207E-007 6.861501324496947E-007 + 7.035200998501091E-007 7.213297897661621E-007 7.395903338108175E-007 7.583131453943663E-007 + 7.775099268581208E-007 7.971926767886955E-007 8.173736975174457E-007 8.380656028097557E-007 + 8.592813257489801E-007 8.810341268199626E-007 9.033376021971907E-007 9.262056922427598E-007 + 9.496526902194645E-007 9.736932512244572E-007 9.983424013490631E-007 1.023615547070470E-006 + 1.049528484881168E-006 1.076097411162156E-006 1.103338932306086E-006 1.131270075096672E-006 + 1.159908297350844E-006 1.189271498830320E-006 1.219378032429384E-006 1.250246715645887E-006 + 1.281896842342634E-006 1.314348194806500E-006 1.347621056112825E-006 1.381736222802804E-006 + 1.416715017881802E-006 1.452579304146712E-006 1.489351497850699E-006 1.527054582713853E-006 + 1.565712124288515E-006 1.605348284688257E-006 1.645987837689719E-006 1.687656184216742E-006 + 1.730379368216473E-006 1.774184092937363E-006 1.819097737619240E-006 1.865148374605872E-006 + 1.912364786890735E-006 1.960776486106934E-006 2.010413730972527E-006 2.061307546202790E-006 + 2.113489741901222E-006 2.166992933441429E-006 2.221850561852302E-006 2.278096914719230E-006 + 2.335767147614404E-006 2.394897306069632E-006 2.455524348105354E-006 2.517686167329985E-006 + 2.581421616623985E-006 2.646770532423468E-006 2.713773759618541E-006 2.782473177081912E-006 + 2.852911723843736E-006 2.925133425929059E-006 2.999183423874604E-006 3.075108000942139E-006 + 3.152954612046029E-006 3.232771913413050E-006 3.314609792993029E-006 3.398519401639266E-006 + 3.484553185078275E-006 3.572764916688799E-006 3.663209731110573E-006 3.755944158703871E-006 + 3.851026160881318E-006 3.948515166334119E-006 4.048472108175281E-006 4.150959462023063E-006 + 4.256041285048475E-006 4.363783256011173E-006 4.474252716308832E-006 4.587518712065608E-006 + 4.703652037285994E-006 4.822725278101051E-006 4.944812858134676E-006 5.069991085018197E-006 + 5.198338198082431E-006 5.329934417256988E-006 5.464861993207333E-006 5.603205258740995E-006 + 5.745050681515017E-006 5.890486918077606E-006 6.039604869277683E-006 6.192497737077054E-006 + 6.349261082800642E-006 6.509992886861188E-006 6.674793609995744E-006 6.843766256052212E-006 + 7.017016436365184E-006 7.194652435761303E-006 7.376785280235343E-006 7.563528806339356E-006 + 7.754999732328222E-006 7.951317731106025E-006 8.152605505018859E-006 8.358988862540824E-006 + 8.570596796901051E-006 8.787561566700978E-006 9.010018778572141E-006 9.238107471926210E-006 + 9.471970205850160E-006 9.711753148200947E-006 9.957606166955226E-006 1.020968292387131E-005 + 1.046814097052181E-005 1.073314184675699E-005 1.100485118166029E-005 1.128343879705924E-005 + 1.156907881365615E-005 1.186194975984520E-005 1.216223468328374E-005 1.247012126528744E-005 + 1.278580193812088E-005 1.310947400525680E-005 1.344133976467912E-005 1.378160663530684E-005 + 1.413048728661760E-005 1.448819977155200E-005 1.485496766278179E-005 1.523102019242685E-005 + 1.561659239530833E-005 1.601192525582744E-005 1.641726585856167E-005 1.683286754267221E-005 + 1.725899006021952E-005 1.769589973848545E-005 1.814386964640358E-005 1.860317976520160E-005 + 1.907411716336224E-005 1.955697617601225E-005 2.005205858885126E-005 2.055967382673527E-005 + 2.108013914703300E-005 2.161377983787526E-005 2.216092942142153E-005 2.272192986227055E-005 + 2.329713178114507E-005 2.388689467398413E-005 2.449158713657985E-005 2.511158709489865E-005 + 2.574728204123101E-005 2.639906927631719E-005 2.706735615759973E-005 2.775256035375827E-005 + 2.845511010568492E-005 2.917544449406379E-005 2.991401371372125E-005 3.067127935491815E-005 + 3.144771469176010E-005 3.224380497790505E-005 3.306004774975342E-005 3.389695313730970E-005 + 3.475504418290950E-005 3.563485716801110E-005 3.653694194825533E-005 3.746186229700293E-005 + 3.841019625756378E-005 3.938253650433762E-005 4.037949071309196E-005 4.140168194060764E-005 + 4.244974901392968E-005 4.352434692946543E-005 4.462614726217957E-005 4.575583858514106E-005 + 4.691412689968350E-005 4.810173607644779E-005 4.931940830758154E-005 5.056790457037773E-005 + 5.184800510264155E-005 5.316050989008167E-005 5.450623916603059E-005 5.588603392380470E-005 + 5.730075644202422E-005 5.875129082322058E-005 6.023854354606610E-005 6.176344403157156E-005 + 6.332694522360339E-005 6.493002418408338E-005 6.657368270324081E-005 6.825894792529815E-005 + 6.998687298998018E-005 7.175853769024546E-005 7.357504914665102E-005 7.543754249876980E-005 + 7.734718161409153E-005 7.930515981484922E-005 8.131270062322316E-005 8.337105852538727E-005 + 8.548151975487334E-005 8.764540309574075E-005 8.986406070605191E-005 9.213887896216646E-005 + 9.447127932437930E-005 9.686271922444161E-005 9.931469297551652E-005 1.018287327051375E-004 + 1.044064093117478E-004 1.070493334454173E-004 1.097591565133470E-004 1.125375717107858E-004 + 1.153863150780016E-004 1.183071665839641E-004 1.213019512374115E-004 1.243725402259947E-004 + 1.275208520842038E-004 1.307488538908062E-004 1.340585624965380E-004 1.374520457828120E-004 + 1.409314239522259E-004 1.444988708516698E-004 1.481566153288573E-004 1.519069426231201E-004 + 1.557521957913326E-004 1.596947771698489E-004 1.637371498733600E-004 1.678818393316040E-004 + 1.721314348648793E-004 1.764885912993399E-004 1.809560306230749E-004 1.855365436839975E-004 + 1.902329919305986E-004 1.950483091966415E-004 1.999855035309047E-004 2.050476590731081E-004 + 2.102379379771807E-004 2.155595823830653E-004 2.210159164382775E-004 2.266103483704721E-004 + 2.323463726123002E-004 2.382275719798691E-004 2.442576199061544E-004 2.504402827307451E-004 + 2.567794220473374E-004 2.632789971104261E-004 2.699430673026828E-004 2.767757946645448E-004 + 2.837814464875744E-004 2.909643979731923E-004 2.983291349584221E-004 3.058802567103329E-004 + 3.136224787908972E-004 3.215606359940348E-004 3.296996853566474E-004 3.380447092455074E-004 + 3.466009185218915E-004 3.553736557859145E-004 3.643683987025558E-004 3.735907634114270E-004 + 3.830465080223739E-004 3.927415361990644E-004 4.026819008327601E-004 4.128738078085302E-004 + 4.233236198662182E-004 4.340378605585305E-004 4.450232183086713E-004 4.562865505700129E-004 + 4.678348880903487E-004 4.796754392833414E-004 4.918155947098366E-004 5.042629316717857E-004 + 5.170252189215868E-004 5.301104214897180E-004 5.435267056336109E-004 5.572824439107844E-004 + 5.713862203793311E-004 5.858468359289286E-004 6.006733137456163E-004 6.158749049136681E-004 + 6.314610941579671E-004 6.474416057303668E-004 6.638264094436211E-004 6.806257268565415E-004 + 6.978500376141252E-004 7.155100859465097E-004 7.336168873306692E-004 7.521817353189044E-004 + 7.712162085382300E-004 7.907321778649051E-004 8.107418137784237E-004 8.312575938993972E-004 + 8.522923107158791E-004 8.738590795027659E-004 8.959713464390429E-004 9.186428969277458E-004 + 9.418878641236229E-004 9.657207376736167E-004 9.901563726753861E-004 1.015209998859228E-003 + 1.040897229998879E-003 1.067234073556809E-003 1.094236940569759E-003 1.121922655780385E-003 + 1.150308468021046E-003 1.179412060855886E-003 1.209251563487516E-003 1.239845561934749E-003 + 1.271213110487996E-003 1.303373743449076E-003 1.336347487162345E-003 1.370154872344237E-003 + 1.404816946718443E-003 1.440355287964135E-003 1.476792016984818E-003 1.514149811505554E-003 + 1.552451920006485E-003 1.591722176000761E-003 1.631985012665172E-003 1.673265477831969E-003 + 1.715589249350538E-003 1.758982650827794E-003 1.803472667756371E-003 1.849086964039880E-003 + 1.895853898924691E-003 1.943802544347971E-003 1.992962702711819E-003 2.043364925093693E-003 + 2.095040529903396E-003 2.148021621997245E-003 2.202341112260197E-003 2.258032737666976E-003 + 2.315131081833460E-003 2.373671596069855E-003 2.433690620947388E-003 2.495225408390566E-003 + 2.558314144307208E-003 2.622995971768838E-003 2.689311014754143E-003 2.757300402468581E-003 + 2.827006294253453E-003 2.898471905098001E-003 2.971741531768400E-003 3.046860579567800E-003 + 3.123875589741788E-003 3.202834267544053E-003 3.283785510977154E-003 3.366779440223780E-003 + 3.451867427783997E-003 3.539102129334416E-003 3.628537515325447E-003 3.720228903333114E-003 + 3.814232991182209E-003 3.910607890857928E-003 4.009413163223342E-003 4.110709853560442E-003 + 4.214560527952781E-003 4.321029310528057E-003 4.430181921579271E-003 4.542085716583446E-003 + 4.656809726137186E-003 4.774424696828639E-003 4.895003133065816E-003 5.018619339881431E-003 + 5.145349466734828E-003 5.275271552331781E-003 5.408465570483348E-003 5.545013477025172E-003 + 5.684999257818952E-003 5.828508977858155E-003 5.975630831500194E-003 6.126455193847701E-003 + 6.281074673301744E-003 6.439584165310056E-003 6.602080907333675E-003 6.768664535055601E-003 + 6.939437139855249E-003 7.114503327572816E-003 7.293970278587789E-003 7.477947809236011E-003 + 7.666548434589950E-003 7.859887432626925E-003 8.058082909810190E-003 8.261255868107862E-003 + 8.469530273474852E-003 8.683033125822888E-003 8.901894530503865E-003 9.126247771331699E-003 + 9.356229385167928E-003 9.591979238096083E-003 9.833640603209971E-003 1.008136024004053E-002 + 1.033528847564633E-002 1.059557928739176E-002 1.086239038743754E-002 1.113588330896714E-002 + 1.141622349417275E-002 1.170358038402396E-002 1.199812750984142E-002 1.230004258669788E-002 + 1.260950760866773E-002 1.292670894594570E-002 1.325183744385468E-002 1.358508852376154E-002 + 1.392666228591908E-002 1.427676361425080E-002 1.463560228309447E-002 1.500339306591889E-002 + 1.538035584602674E-002 1.576671572925529E-002 1.616270315868472E-002 1.656855403136198E-002 + 1.698450981704654E-002 1.741081767898188E-002 1.784773059669438E-002 1.829550749081922E-002 + 1.875441334994932E-002 1.922471935950184E-002 1.970670303259234E-002 2.020064834290437E-002 + 2.070684585953855E-002 2.122559288382104E-002 2.175719358804785E-002 2.230195915613681E-002 + 2.286020792615417E-002 2.343226553467888E-002 2.401846506296082E-002 2.461914718482542E-002 + 2.523466031626953E-002 2.586536076668806E-002 2.651161289166427E-002 2.717378924724796E-002 + 2.785227074564058E-002 2.854744681219558E-002 2.925971554363547E-002 2.998948386737716E-002 + 3.073716770184722E-002 3.150319211765890E-002 3.228799149951136E-002 3.309200970865957E-002 + 3.391570024579209E-002 3.475952641413888E-002 3.562396148261984E-002 3.650948884882749E-002 + 3.741660220162345E-002 3.834580568311085E-002 3.929761404972712E-002 4.027255283218398E-002 + 4.127115849396046E-002 4.229397858803463E-002 4.334157191151818E-002 4.441450865783279E-002 + 4.551337056604517E-002 4.663875106694874E-002 4.779125542545400E-002 4.897150087882031E-002 + 5.018011677022966E-002 5.141774467717192E-002 5.268503853407496E-002 5.398266474857719E-002 + 5.531130231080233E-002 5.667164289495277E-002 5.806439095249828E-002 5.949026379618844E-002 + 6.094999167406966E-002 6.244431783263871E-002 6.397399856820800E-002 6.553980326550404E-002 + 6.714251442245865E-002 6.878292766009073E-002 7.046185171631017E-002 7.218010842240280E-002 + 7.393853266088557E-002 7.573797230333852E-002 7.757928812674148E-002 7.946335370675607E-002 + 8.139105528629972E-002 8.336329161766772E-002 8.538097377635248E-002 8.744502494460762E-002 + 8.955638016269027E-002 9.171598604559862E-002 9.392480046299835E-002 9.618379217990176E-002 + 9.849394045552883E-002 1.008562345976374E-001 1.032716734694586E-001 1.057412649462221E-001 + 1.082660253180882E-001 1.108469786361390E-001 1.134851559979004E-001 1.161815947686841E-001 + 1.189373377348462E-001 1.217534321848601E-001 1.246309289138993E-001 1.275708811474056E-001 + 1.305743433789050E-001 1.336423701171055E-001 1.367760145370776E-001 1.399763270300838E-001 + 1.432443536463820E-001 1.465811344250791E-001 1.499877016048694E-001 1.534650777092395E-001 + 1.570142734994751E-001 1.606362857885637E-001 1.643320951088398E-001 1.681026632259941E-001 + 1.719489304918413E-001 1.758718130280329E-001 1.798721997327160E-001 1.839509491019652E-001 + 1.881088858576796E-001 1.923467973735228E-001 1.966654298904307E-001 2.010654845131795E-001 + 2.055476129795466E-001 2.101124131937078E-001 2.147604245156737E-001 2.194921227988476E-001 + 2.243079151681422E-001 2.292081345315625E-001 2.341930338187743E-001 2.392627799409159E-001 + 2.444174474668233E-001 2.496570120119229E-001 2.549813433373393E-001 2.603901981582799E-001 + 2.658832126625087E-001 2.714598947417635E-001 2.771196159412913E-001 2.828616031353239E-001 + 2.886849299393283E-001 2.945885078732261E-001 3.005710772935848E-001 3.066311981169812E-001 + 3.127672403614247E-001 3.189773745378901E-001 3.252595619296622E-001 3.316115448033972E-001 + 3.380308366025138E-001 3.445147121807927E-001 3.510601981418685E-001 3.576640633586105E-001 + 3.643228097552380E-001 3.710326634442953E-001 3.777895663203246E-001 3.845891682221245E-001 + 3.914268197857564E-001 3.982975661208894E-001 4.051961414534429E-001 4.121169648876636E-001 + 4.190541374505458E-001 4.260014405905602E-001 4.329523363107982E-001 4.398999691234277E-001 + 4.468371700175050E-001 4.537564626351866E-001 4.606500718518267E-001 4.675099349527580E-001 + 4.743277155932024E-001 4.810948207171196E-001 4.878024205952470E-001 4.944414721214269E-001 + 5.010027454788979E-001 5.074768542538054E-001 5.138542890311405E-001 5.201254544579512E-001 + 5.262807096993817E-001 5.323104121443913E-001 5.382049641393932E-001 5.439548624393071E-001 + 5.495507499664489E-001 5.549834693583401E-001 5.602441176662698E-001 5.653241014377306E-001 + 5.702151912786471E-001 5.749095748467827E-001 5.793999070774426E-001 5.836793562887164E-001 + 5.877416446584863E-001 5.915810814124811E-001 5.951925869155470E-001 5.985717057216498E-001 + 6.017146065174847E-001 6.046180667967075E-001 6.072794400349817E-001 6.096966031103946E-001 + 6.118678817419258E-001 6.137919538543997E-001 6.154677563023413E-001 6.168944597638472E-001 + 6.180714683936587E-001 6.189984208809787E-001 6.196751910569864E-001 6.201018880591097E-001 + 6.202788560606851E-001 6.202066735760820E-001 6.198861523526406E-001 6.193183358619818E-001 + 6.185044974042379E-001 6.174461378396950E-001 6.161449829630873E-001 6.146029805364046E-001 + 6.128222969965976E-001 6.108053138549023E-001 6.085546238047563E-001 6.060730265554011E-001 + 6.033635244082312E-001 6.004293175928707E-001 5.972737993796965E-001 5.939005509852285E-001 + 5.903133362863758E-001 5.865160963590396E-001 5.825129438559972E-001 5.783081572383583E-001 + 5.739061748741781E-001 5.693115890171104E-001 5.645291396771567E-001 5.595637083948324E-001 + 5.544203119291992E-001 5.491040958694315E-001 5.436203281787576E-001 5.379743926787960E-001 + 5.321717824815573E-001 5.262180933755841E-001 5.201190171720245E-001 5.138803350157403E-001 + 5.075079106659202E-001 5.010076837501298E-001 4.943856629951898E-001 4.876479194378606E-001 + 4.808005796179269E-001 4.738498187560097E-001 4.668018539180295E-001 4.596629371685451E-001 + 4.524393487145099E-001 4.451373900414571E-001 4.377633770439929E-001 4.303236331526906E-001 + 4.228244824596602E-001 4.152722428453744E-001 4.076732191096794E-001 4.000336961103134E-001 + 3.923599319127295E-001 3.846581509555139E-001 3.769345372362556E-001 3.691952275233029E-001 + 3.614463045994553E-001 3.536937905442903E-001 3.459436400624694E-001 3.382017338660334E-001 + 3.304738721193691E-001 3.227657679561715E-001 3.150830410783917E-001 3.074312114477593E-001 + 2.998156930810821E-001 2.922417879610730E-001 2.847146800749726E-001 2.772394295937039E-001 + 2.698209672047020E-001 2.624640886119114E-001 2.551734492167302E-001 2.479535589938745E-001 + 2.408087775762869E-001 2.337433095632411E-001 2.267612000657723E-001 2.198663305034370E-001 + 2.130624146661792E-001 2.063529950547889E-001 1.997414395130172E-001 1.932309381639311E-001 + 1.868245006624922E-001 1.805249537756576E-001 1.743349393005320E-001 1.682569123302291E-001 + 1.622931398761502E-001 1.564456998543577E-001 1.507164804426051E-001 1.451071798134084E-001 + 1.396193062472871E-001 1.342541786289978E-001 1.290129273282249E-001 1.238964954647761E-001 + 1.189056405569013E-001 1.140409365498711E-001 1.093027762204688E-001 1.046913739515532E-001 + 1.002067688693456E-001 9.584882833461772E-002 9.161725177748464E-002 8.751157486407736E-002 + 8.353117398197475E-002 7.967527102993222E-002 7.594293849616381E-002 7.233310480822103E-002 + 6.884455993637896E-002 6.547596123139368E-002 6.222583947654103E-002 5.909260513299887E-002 + 5.607455475688900E-002 5.316987756566781E-002 5.037666213104334E-002 4.769290317520403E-002 + 4.511650844688288E-002 4.264530565363874E-002 4.027704942672563E-002 3.800942829503649E-002 + 3.584007164484614E-002 3.376655664244430E-002 3.178641509723130E-002 2.989714024344968E-002 + 2.809619341943642E-002 2.638101062409461E-002 2.474900893119986E-002 2.319759274316022E-002 + 2.172415986693833E-002 2.032610739600727E-002 1.900083738344047E-002 1.774576229252109E-002 + 1.655831021258838E-002 1.543592982920690E-002 1.437609513914006E-002 1.337630990202217E-002 + 1.243411182204313E-002 1.154707645437688E-002 1.071282083249091E-002 9.929006813859029E-003 + 9.193344142954949E-003 8.503593231722830E-003 7.857567658993985E-003 7.253136391540225E-003 + 6.688225730617569E-003 6.160820988952760E-003 5.668967904155693E-003 5.210773795497540E-003 + 4.784408471874968E-003 4.388104899581836E-003 4.020159639228954E-003 3.678933061789227E-003 + 3.362849354298264E-003 3.070396326209784E-003 2.800125027786895E-003 2.550649192192210E-003 + 2.320644513345346E-003 2.108847771354928E-003 1.914055817824106E-003 1.735124433127180E-003 + 1.570967067711931E-003 1.420553479352623E-003 1.282908278082261E-003 1.157109390279502E-003 + 1.042286453079549E-003 9.376191499237130E-004 8.423354976624892E-004 7.557100951825338E-004 + 6.770623430985579E-004 6.057546434425459E-004 5.411905878531138E-004 4.828131421575197E-004 + 4.301028346434114E-004 3.825781930576345E-004 3.398117011094828E-004 3.013847912329459E-004 + 2.669076982590956E-004 2.360203274043297E-004 2.083905077967938E-004 1.837123044204780E-004 + 1.617043901167716E-004 1.421084789464991E-004 1.246878218882345E-004 1.092257655327250E-004 + 9.552437413004071E-005 8.340311505700941E-005 7.269760749879939E-005 6.325843388122335E-005 + 5.495001335033167E-005 4.764953637384113E-005 4.124595933534801E-005 3.563905780725368E-005 + 3.073853702578912E-005 2.646319793804598E-005 2.274015707059596E-005 1.950411835685986E-005 + 1.669669497021196E-005 1.426577913694524E-005 1.216495784732646E-005 1.035297234336883E-005 + 8.793219237798165E-006 7.453291109060571E-006 6.304554421127137E-006 5.321762633258999E-006 + 4.482702392729612E-006 3.767870741664740E-006 3.160181316547951E-006 2.644697574445437E-006 + 2.208391142535025E-006 1.839923456012333E-006 1.529448922854011E-006 1.268437931248235E-006 + 1.049518095808051E-006 8.663322210708545E-007 7.134115444241307E-007 5.860629047146004E-007 + 4.802685666941419E-007 3.925975144994612E-007 3.201271089935193E-007 2.603740835268644E-007 + 2.112339300901159E-007 1.709278025806593E-007 1.379561357240166E-007 1.110582468714152E-007 + 8.917725330877020E-008 7.142969979997985E-008 5.707934986545572E-008 4.551464986192195E-008 + 3.622942746808152E-008 2.880643598331435E-008 2.290340333058542E-008 1.815648567286021E-008 + 1.435055361489514E-008 1.130821943298445E-008 8.883659714755097E-009 6.957367093463197E-009 + 5.431705689151051E-009 4.227159420228528E-009 3.279175580837433E-009 2.535518056366668E-009 + 1.954055341662703E-009 1.500918207427419E-009 1.148970505772449E-009 8.765442924859939E-010 + 6.663972475039818E-010 5.048563712659407E-010 3.811171958146592E-010 2.866723455592033E-010 + 2.148472800801603E-010 1.604245129562488E-010 1.193405850251163E-010 8.844263223247733E-011 + 6.529357745632072E-011 4.801683831862637E-011 3.517302071384679E-011 2.566239821929154E-011 + 1.864809444413071E-011 1.349581877858071E-011 9.726782538027792E-012 6.981065582877742E-012 + 4.989233627595460E-012 3.550441456298912E-012 2.515612550416466E-012 1.774574457411287E-012 + 1.246262915808455E-012 8.712959287384343E-013 6.063697832789212E-013 4.200492847859669E-013 + 2.896199292534681E-013 1.987451217921522E-013 1.357307900804507E-013 9.224606287294589E-014 + 6.238472023882325E-014 4.198001491112858E-014 2.810694243983057E-014 1.872249104534209E-014 + 1.240693981841664E-014 8.178777441400386E-015 5.362978724732693E-015 3.497749186885351E-015 + 2.268854960661859E-015 1.463627249516655E-015 9.389225102431991E-016 5.989271196265383E-016 + 3.798675846477310E-016 2.395373276263683E-016 1.501637681608985E-016 9.357848185976881E-017 + 5.796598178367465E-017 3.568813352242357E-017 2.183708044936421E-017 1.327858065253249E-017 + 8.023445352594695E-018 4.817122528400369E-018 2.873405991445026E-018 1.702759503555861E-018 + 1.002353062172416E-018 5.860880089590191E-019 3.403633713359319E-019 1.963013836977289E-019 + 1.124259839336527E-019 6.393439789669635E-020 3.609842732347367E-020 2.023431890619292E-020 + 1.125889580827295E-020 6.218271868698249E-021 3.408549441249149E-021 1.854190085369063E-021 + 1.000879827736919E-021 5.360562689643373E-022 2.848372526087288E-022 1.501404903456802E-022 + 7.849999461276401E-023 4.070687374462147E-023 2.093375862121131E-023 1.067486668664398E-023 + 5.397185790573233E-024 +/ + +&rhoatom + rho_at(1:1141) = + 5.046849871632335E-010 5.174611486524602E-010 5.305607402205121E-010 5.439919495393732E-010 + 5.577631715529621E-010 5.718830137242411E-010 5.863603014151670E-010 6.012040834028339E-010 + 6.164236375352503E-010 6.320284765303051E-010 6.480283539215239E-010 6.644332701543506E-010 + 6.812534788367524E-010 6.984994931480633E-010 7.161820924100679E-010 7.343123288244266E-010 + 7.529015343806723E-010 7.719613279390731E-010 7.915036224928017E-010 8.115406326139526E-010 + 8.320848820880447E-010 8.531492117418044E-010 8.747467874691067E-010 8.968911084600868E-010 + 9.195960156385878E-010 9.428757003131874E-010 9.667447130472368E-010 9.912179727534440E-010 + 1.016310776018684E-009 1.042038806664872E-009 1.068418145551870E-009 1.095465280628555E-009 + 1.123197117238333E-009 1.151630988685542E-009 1.180784667069332E-009 1.210676374391821E-009 + 1.241324793947445E-009 1.272749082000649E-009 1.304968879759168E-009 1.338004325650450E-009 + 1.371876067908828E-009 1.406605277481363E-009 1.442213661260379E-009 1.478723475651000E-009 + 1.516157540482141E-009 1.554539253269655E-009 1.593892603840564E-009 1.634242189327501E-009 + 1.675613229542722E-009 1.718031582741362E-009 1.761523761783669E-009 1.806116950706450E-009 + 1.851839021713996E-009 1.898718552599142E-009 1.946784844605343E-009 1.996067940740921E-009 + 2.046598644556970E-009 2.098408539400586E-009 2.151530008155544E-009 2.205996253482658E-009 + 2.261841318572581E-009 2.319100108423934E-009 2.377808411660105E-009 2.438002922898334E-009 + 2.499721265685114E-009 2.563002016012145E-009 2.627884726427638E-009 2.694409950758000E-009 + 2.762619269455342E-009 2.832555315586673E-009 2.904261801481000E-009 2.977783546051034E-009 + 3.053166502806512E-009 3.130457788576719E-009 3.209705712960096E-009 3.290959808519374E-009 + 3.374270861741143E-009 3.459690944779115E-009 3.547273448001017E-009 3.637073113359376E-009 + 3.729146068607123E-009 3.823549862379364E-009 3.920343500163261E-009 4.019587481178479E-009 + 4.121343836191281E-009 4.225676166285895E-009 4.332649682617387E-009 4.442331247170892E-009 + 4.554789414552656E-009 4.670094474839069E-009 4.788318497510383E-009 4.909535376496626E-009 + 5.033820876363914E-009 5.161252679669948E-009 5.291910435518302E-009 5.425875809341896E-009 + 5.563232533946810E-009 5.704066461848158E-009 5.848465618931010E-009 5.996520259469618E-009 + 6.148322922539530E-009 6.303968489857803E-009 6.463554245087447E-009 6.627179934643131E-009 + 6.794947830036336E-009 6.966962791798623E-009 7.143332335023240E-009 7.324166696565904E-009 + 7.509578903946822E-009 7.699684845996950E-009 7.894603345292678E-009 8.094456232424308E-009 + 8.299368422144529E-009 8.509467991444670E-009 8.724886259607598E-009 8.945757870286994E-009 + 9.172220875664610E-009 9.404416822737919E-009 9.642490841792270E-009 9.886591737112682E-009 + 1.013687207999198E-008 1.039348830409367E-008 1.065660080322870E-008 1.092637403160765E-008 + 1.120297660663084E-008 1.148658141428051E-008 1.177736571718113E-008 1.207551126539531E-008 + 1.238120441002447E-008 1.269463621968549E-008 1.301600259993585E-008 1.334550441572223E-008 + 1.368334761692891E-008 1.402974336710436E-008 1.438490817544682E-008 1.474906403213093E-008 + 1.512243854706039E-008 1.550526509213318E-008 1.589778294710823E-008 1.630023744916497E-008 + 1.671288014624864E-008 1.713596895429806E-008 1.756976831845357E-008 1.801454937834592E-008 + 1.847059013756969E-008 1.893817563744698E-008 1.941759813518994E-008 1.990915728657386E-008 + 2.041316033323428E-008 2.092992229470616E-008 2.145976616532423E-008 2.200302311610830E-008 + 2.256003270175930E-008 2.313114307289550E-008 2.371671119366187E-008 2.431710306484802E-008 + 2.493269395265486E-008 2.556386862325261E-008 2.621102158327650E-008 2.687455732641136E-008 + 2.755489058621810E-008 2.825244659536124E-008 2.896766135139869E-008 2.970098188930008E-008 + 3.045286656086462E-008 3.122378532121198E-008 3.201422002252697E-008 3.282466471523939E-008 + 3.365562595682951E-008 3.450762312845084E-008 3.538118875956823E-008 3.627686886081558E-008 + 3.719522326527872E-008 3.813682597841940E-008 3.910226553685772E-008 4.009214537623677E-008 + 4.110708420840124E-008 4.214771640812415E-008 4.321469240962398E-008 4.430867911312084E-008 + 4.543036030168350E-008 4.658043706863155E-008 4.775962825575630E-008 4.896867090263603E-008 + 5.020832070732679E-008 5.147935249871549E-008 5.278256072083219E-008 5.411875992942288E-008 + 5.548878530109324E-008 5.689349315534353E-008 5.833376148981790E-008 5.981049052910635E-008 + 6.132460328743837E-008 6.287704614562359E-008 6.446878944259855E-008 6.610082808194801E-008 + 6.777418215378411E-008 6.948989757236718E-008 7.124904672986983E-008 7.305272916669305E-008 + 7.490207225875120E-008 7.679823192215871E-008 7.874239333575562E-008 8.073577168192719E-008 + 8.277961290617725E-008 8.487519449593262E-008 8.702382627906544E-008 8.922685124263044E-008 + 9.148564637233106E-008 9.380162351323974E-008 9.617623025230706E-008 9.861095082321688E-008 + 1.011073070341476E-007 1.036668592190238E-007 1.062912072128507E-007 1.089819913517415E-007 + 1.117408934982650E-007 1.145696380927506E-007 1.174699932312113E-007 1.204437717705593E-007 + 1.234928324617994E-007 1.266190811119178E-007 1.298244717751841E-007 1.331110079746175E-007 + 1.364807439543767E-007 1.399357859638603E-007 1.434782935743182E-007 1.471104810287969E-007 + 1.508346186262652E-007 1.546530341407842E-007 1.585681142766077E-007 1.625823061601283E-007 + 1.666981188695937E-007 1.709181250035562E-007 1.752449622890364E-007 1.796813352304010E-007 + 1.842300167999930E-007 1.888938501715665E-007 1.936757504976125E-007 1.985787067316860E-007 + 2.036057834968724E-007 2.087601230015717E-007 2.140449470037801E-007 2.194635588251170E-007 + 2.250193454158442E-007 2.307157794721728E-007 2.365564216071856E-007 2.425449225767250E-007 + 2.486850255616466E-007 2.549805685078602E-007 2.614354865256259E-007 2.680538143496029E-007 + 2.748396888611943E-007 2.817973516747557E-007 2.889311517893027E-007 2.962455483073563E-007 + 3.037451132226416E-007 3.114345342783780E-007 3.193186178979487E-007 3.274022921897824E-007 + 3.356906100283321E-007 3.441887522130739E-007 3.529020307075018E-007 3.618358919601487E-007 + 3.709959203097079E-007 3.803878414763898E-007 3.900175261416945E-007 3.998909936188382E-007 + 4.100144156161411E-007 4.203941200957194E-007 4.310365952299022E-007 4.419484934578491E-007 + 4.531366356449045E-007 4.646080153472944E-007 4.763698031848389E-007 4.884293513244053E-007 + 5.007941980769200E-007 5.134720726108092E-007 5.264708997848245E-007 5.397988051032738E-007 + 5.534641197967580E-007 5.674753860316090E-007 5.818413622512649E-007 5.965710286529509E-007 + 6.116735928030818E-007 6.271584953949035E-007 6.430354161519808E-007 6.593142798812306E-007 + 6.760052626792881E-007 6.931187982960903E-007 7.106655846596594E-007 7.286565905661947E-007 + 7.471030625396309E-007 7.660165318649834E-007 7.854088217998751E-007 8.052920549687680E-007 + 8.256786609445298E-007 8.465813840220849E-007 8.680132911890196E-007 8.899877802981390E-007 + 9.125185884470966E-007 9.356198005703457E-007 9.593058582487913E-007 9.835915687426903E-007 + 1.008492114253416E-006 1.034023061419947E-006 1.060200371055986E-006 1.087040408133845E-006 + 1.114559952021337E-006 1.142776206978112E-006 1.171706812917997E-006 1.201369856444118E-006 + 1.231783882163683E-006 1.262967904289582E-006 1.294941418536028E-006 1.327724414315729E-006 + 1.361337387246234E-006 1.395801351973314E-006 1.431137855319403E-006 1.467368989765383E-006 + 1.504517407274141E-006 1.542606333464603E-006 1.581659582145122E-006 1.621701570215360E-006 + 1.662757332946022E-006 1.704852539646032E-006 1.748013509726991E-006 1.792267229175008E-006 + 1.837641367440274E-006 1.884164294754946E-006 1.931865099890281E-006 1.980773608364130E-006 + 2.030920401110278E-006 2.082336833621322E-006 2.135055055577189E-006 2.189108030971562E-006 + 2.244529558748933E-006 2.301354293965240E-006 2.359617769485398E-006 2.419356418231407E-006 + 2.480607595995000E-006 2.543409604829220E-006 2.607801717033634E-006 2.673824199748311E-006 + 2.741518340172035E-006 2.810926471420679E-006 2.882091999041933E-006 2.955059428203267E-006 + 3.029874391570063E-006 3.106583677891681E-006 3.185235261313354E-006 3.265878331432464E-006 + 3.348563324118145E-006 3.433341953113710E-006 3.520267242441710E-006 3.609393559632293E-006 + 3.700776649795659E-006 3.794473670560248E-006 3.890543227898693E-006 3.989045412864203E-006 + 4.090041839260570E-006 4.193595682269667E-006 4.299771718060832E-006 4.408636364407239E-006 + 4.520257722334879E-006 4.634705618830731E-006 4.752051650636867E-006 4.872369229158539E-006 + 4.995733626514482E-006 5.122222022758793E-006 5.251913554304211E-006 5.384889363577642E-006 + 5.521232649939315E-006 5.661028721898062E-006 5.804365050655705E-006 5.951331325014762E-006 + 6.102019507684216E-006 6.256523893019272E-006 6.414941166231823E-006 6.577370464109210E-006 + 6.743913437280186E-006 6.914674314067396E-006 7.089759965967495E-006 7.269279974800292E-006 + 7.453346701570075E-006 7.642075357082783E-006 7.835584074364461E-006 8.033993982926933E-006 + 8.237429284928498E-006 8.446017333278196E-006 8.659888711733634E-006 8.879177317043897E-006 + 9.104020443189804E-006 9.334558867775956E-006 9.570936940629783E-006 9.813302674664540E-006 + 1.006180783906464E-005 1.031660805485327E-005 1.057786289290381E-005 1.084573597445800E-005 + 1.112039507421596E-005 1.140201222606429E-005 1.169076383151050E-005 1.198683077089399E-005 + 1.229039851744534E-005 1.260165725426776E-005 1.292080199431633E-005 1.324803270345307E-005 + 1.358355442665733E-005 1.392757741747367E-005 1.428031727078140E-005 1.464199505897202E-005 + 1.501283747162314E-005 1.539307695876013E-005 1.578295187779910E-005 1.618270664426663E-005 + 1.659259188639547E-005 1.701286460369689E-005 1.744378832961407E-005 1.788563329836270E-005 + 1.833867661606875E-005 1.880320243631615E-005 1.927950214021923E-005 1.976787452113955E-005 + 2.026862597416832E-005 2.078207069050018E-005 2.130853085682654E-005 2.184833685988116E-005 + 2.240182749627320E-005 2.296935018774770E-005 2.355126120201651E-005 2.414792587930696E-005 + 2.475971886477954E-005 2.538702434697003E-005 2.603023630241583E-005 2.668975874663073E-005 + 2.736600599159673E-005 2.805940290994581E-005 2.877038520601101E-005 2.949939969392873E-005 + 3.024690458298088E-005 3.101336977037119E-005 3.179927714163313E-005 3.260512087887578E-005 + 3.343140777707593E-005 3.427865756863465E-005 3.514740325641914E-005 3.603819145551922E-005 + 3.695158274395372E-005 3.788815202256808E-005 3.884848888437230E-005 3.983319799357496E-005 + 4.084289947457655E-005 4.187822931119332E-005 4.293983975638921E-005 4.402839975280370E-005 + 4.514459536436980E-005 4.628913021932571E-005 4.746272596493317E-005 4.866612273422338E-005 + 4.990007962510215E-005 5.116537519215436E-005 5.246280795149839E-005 5.379319689905220E-005 + 5.515738204258329E-005 5.655622494792425E-005 5.799060929974901E-005 5.946144147731616E-005 + 6.096965114559730E-005 6.251619186222195E-005 6.410204170068218E-005 6.572820389025576E-005 + 6.739570747311804E-005 6.910560797912998E-005 7.085898811880093E-005 7.265695849494469E-005 + 7.450065833355977E-005 7.639125623448179E-005 7.832995094237587E-005 8.031797213865062E-005 + 8.235658125489553E-005 8.444707230846371E-005 8.659077276083739E-005 8.878904439944062E-005 + 9.104328424357657E-005 9.335492547519538E-005 9.572543839521777E-005 9.815633140616183E-005 + 1.006491520218492E-004 1.032054879049871E-004 1.058269679334506E-004 1.085152632961181E-004 + 1.112720886191363E-004 1.140992031235272E-004 1.169984118150719E-004 1.199715667074433E-004 + 1.230205680795868E-004 1.261473657683875E-004 1.293539604976927E-004 1.326424052447966E-004 + 1.360148066455312E-004 1.394733264391473E-004 1.430201829542076E-004 1.466576526367579E-004 + 1.503880716220899E-004 1.542138373514432E-004 1.581374102350541E-004 1.621613153630004E-004 + 1.662881442653441E-004 1.705205567231280E-004 1.748612826318332E-004 1.793131239189719E-004 + 1.838789565175330E-004 1.885617323970787E-004 1.933644816543386E-004 1.982903146652284E-004 + 2.033424243002783E-004 2.085240882055367E-004 2.138386711510906E-004 2.192896274494164E-004 + 2.248805034458649E-004 2.306149400836640E-004 2.364966755459139E-004 2.425295479771445E-004 + 2.487174982870944E-004 2.550645730394835E-004 2.615749274286451E-004 2.682528283469937E-004 + 2.751026575464290E-004 2.821289148968889E-004 2.893362217453805E-004 2.967293243789648E-004 + 3.043130975952895E-004 3.120925483844180E-004 3.200728197258415E-004 3.282591945047145E-004 + 3.366570995515272E-004 3.452721098095694E-004 3.541099526347446E-004 3.631765122324554E-004 + 3.724778342364770E-004 3.820201304349370E-004 3.918097836487255E-004 4.018533527678773E-004 + 4.121575779516877E-004 4.227293859985692E-004 4.335758958919057E-004 4.447044245284030E-004 + 4.561224926357259E-004 4.678378308864775E-004 4.798583862158806E-004 4.921923283508280E-004 + 5.048480565582919E-004 5.178342066214146E-004 5.311596580519671E-004 5.448335415482187E-004 + 5.588652467076584E-004 5.732644300044034E-004 5.880410230415619E-004 6.032052410892560E-004 + 6.187675919194622E-004 6.347388849493441E-004 6.511302407052170E-004 6.679531006198516E-004 + 6.852192371763567E-004 7.029407644124698E-004 7.211301487997098E-004 7.398002205124443E-004 + 7.589641851026538E-004 7.786356355968039E-004 7.988285650320353E-004 8.195573794495973E-004 + 8.408369113643027E-004 8.626824337295726E-004 8.851096744185813E-004 9.081348312428897E-004 + 9.317745875309495E-004 9.560461282898637E-004 9.809671569748759E-004 1.006555912892160E-003 + 1.032831189261646E-003 1.059812351967876E-003 1.087519359028121E-003 1.115972780808405E-003 + 1.145193821019434E-003 1.175204338525938E-003 1.206026870004507E-003 1.237684653486590E-003 + 1.270201652825066E-003 1.303602583124608E-003 1.337912937177877E-003 1.373159012951620E-003 + 1.409367942168803E-003 1.446567720035055E-003 1.484787236160002E-003 1.524056306726448E-003 + 1.564405707962877E-003 1.605867210977370E-003 1.648473618013809E-003 1.692258800194118E-003 + 1.737257736813349E-003 1.783506556257599E-003 1.831042578618076E-003 1.879904360078214E-003 + 1.930131739154349E-003 1.981765884874356E-003 2.034849346982790E-003 2.089426108265172E-003 + 2.145541639088762E-003 2.203242954261664E-003 2.262578672317164E-003 2.323599077335345E-003 + 2.386356183419441E-003 2.450903801950169E-003 2.517297611747228E-003 2.585595232273459E-003 + 2.655856300023790E-003 2.728142548248012E-003 2.802517890163776E-003 2.879048505823796E-003 + 2.957802932809357E-003 3.038852160930621E-003 3.122269731123110E-003 3.208131838739109E-003 + 3.296517441442497E-003 3.387508371925709E-003 3.481189455678551E-003 3.577648634049685E-003 + 3.676977092853691E-003 3.779269396789094E-003 3.884623629945832E-003 3.993141542694584E-003 + 4.104928705264693E-003 4.220094668332969E-003 4.338753130961321E-003 4.461022116238303E-003 + 4.587024154997168E-003 4.716886478001600E-003 4.850741217009963E-003 4.988725615149173E-003 + 5.130982247051100E-003 5.277659249226893E-003 5.428910561178319E-003 5.584896177770424E-003 + 5.745782413415826E-003 5.911742178648765E-003 6.082955269695952E-003 6.259608671681297E-003 + 6.441896876134392E-003 6.630022213505477E-003 6.824195201425095E-003 7.024634909484255E-003 + 7.231569341348912E-003 7.445235835064450E-003 7.665881482448191E-003 7.893763568513287E-003 + 8.129150031915049E-003 8.372319947460016E-003 8.623564031770859E-003 8.883185173254862E-003 + 9.151498987581426E-003 9.428834399934806E-003 9.715534255371401E-003 1.001195595867804E-002 + 1.031847214519744E-002 1.063547138416061E-002 1.096335891614336E-002 1.130255742634391E-002 + 1.165350785546496E-002 1.201667025007091E-002 1.239252465438537E-002 1.278157204559129E-002 + 1.318433531479801E-002 1.360136029594802E-002 1.403321684504702E-002 1.448049997221931E-002 + 1.494383102921378E-002 1.542385895511312E-002 1.592126158313489E-002 1.643674701155238E-002 + 1.697105504191022E-002 1.752495868786323E-002 1.809926575812548E-002 1.869482051718445E-002 + 1.931250542760588E-002 1.995324297793741E-002 2.061799760040458E-002 2.130777768278643E-002 + 2.202363767906123E-002 2.276668032361750E-002 2.353805895404344E-002 2.433897994772816E-002 + 2.517070527773553E-002 2.603455519364724E-002 2.693191103330980E-002 2.786421817166538E-002 + 2.883298911309656E-002 2.983980673396460E-002 3.088632768227906E-002 3.197428594168857E-002 + 3.310549656723848E-002 3.428185960059462E-002 3.550536417267561E-002 3.677809280187951E-002 + 3.810222589631622E-002 3.948004646867255E-002 4.091394507253290E-002 4.240642496914802E-002 + 4.396010753379243E-002 4.557773791095227E-002 4.726219092765466E-002 4.901647727426189E-002 + 5.084374996200262E-002 5.274731106639648E-002 5.473061876551891E-002 5.679729468175152E-002 + 5.895113153524306E-002 6.119610111675022E-002 6.353636258682338E-002 6.597627110741305E-002 + 6.852038681088463E-002 7.117348411010697E-002 7.394056135168761E-002 7.682685081253769E-002 + 7.983782903770917E-002 8.297922751482054E-002 8.625704367732098E-002 8.967755222527163E-002 + 9.324731674820461E-002 9.697320162986382E-002 1.008623842091810E-001 1.049223671656037E-001 + 1.091609910897848E-001 1.135864471925657E-001 1.182072900960438E-001 1.230324506401832E-001 + 1.280712486268132E-001 1.333334054098012E-001 1.388290562256065E-001 1.445687621421321E-001 + 1.505635214857027E-001 1.568247805859475E-001 1.633644436562255E-001 1.701948816028910E-001 + 1.773289395300156E-001 1.847799426770883E-001 1.925617004956232E-001 2.006885085364681E-001 + 2.091751477829507E-001 2.180368810258563E-001 2.272894458347534E-001 2.369490436365667E-001 + 2.470323243668571E-001 2.575563661124735E-001 2.685386491166223E-001 2.799970234697851E-001 + 2.919496697632131E-001 3.044150519371258E-001 3.174118615147216E-001 3.309589523773449E-001 + 3.450752652077360E-001 3.597797407095578E-001 3.750912207051093E-001 3.910283362224135E-001 + 4.076093817111340E-001 4.248521745779537E-001 4.427738993102096E-001 4.613909355662093E-001 + 4.807186697563740E-001 5.007712898257558E-001 5.215615631803017E-001 5.431005979805901E-001 + 5.653975883614919E-001 5.884595445271681E-001 6.122910091195369E-001 6.368937617650079E-001 + 6.622665142666004E-001 6.884045995219988E-001 7.152996579047618E-001 7.429393255344019E-001 + 7.713069295660222E-001 8.003811963314698E-001 8.301359788371152E-001 8.605400107388330E-001 + 8.915566944383790E-001 9.231439313391348E-001 9.552540025212939E-001 9.878335081037051E-001 + 1.020823373307727E+000 1.054158928685605E+000 1.087770071084796E+000 1.121581510660223E+000 + 1.155513107600062E+000 1.189480300192867E+000 1.223394623447904E+000 1.257164314721664E+000 + 1.290694999759284E+000 1.323890449314355E+000 1.356653393173956E+000 1.388886375123247E+000 + 1.420492629294980E+000 1.451376955643061E+000 1.481446570151974E+000 1.510611904052376E+000 + 1.538787325970543E+000 1.565891761811764E+000 1.591849189479792E+000 1.616588989481809E+000 + 1.640046138279038E+000 1.662161239145468E+000 1.682880395540493E+000 1.702154944866639E+000 + 1.719941086298736E+000 1.736199455517474E+000 1.750894722096620E+000 1.763995312465020E+000 + 1.775473393299324E+000 1.785305265944295E+000 1.793472075424748E+000 1.799960111994117E+000 + 1.804760872491526E+000 1.807871047296723E+000 1.809292441296495E+000 1.809031822594614E+000 + 1.807100693239712E+000 1.803514982042557E+000 1.798294723130874E+000 1.791463882956636E+000 + 1.783050233366947E+000 1.773085214897372E+000 1.761603786603125E+000 1.748644263353030E+000 + 1.734248141575846E+000 1.718459914504682E+000 1.701326878012498E+000 1.682898928170461E+000 + 1.663228351690318E+000 1.642369610432631E+000 1.620379121174350E+000 1.597315031831952E+000 + 1.573236995330807E+000 1.548205942297311E+000 1.522283853728533E+000 1.495533534764818E+000 + 1.468018390654342E+000 1.439802205956037E+000 1.410948927978433E+000 1.381522455398145E+000 + 1.351586432943074E+000 1.321204052962657E+000 1.290437864641512E+000 1.259349591544036E+000 + 1.227999958106107E+000 1.196448525618868E+000 1.164753538174621E+000 1.132971778972600E+000 + 1.101158437308519E+000 1.069366986499500E+000 1.037649072924850E+000 1.006054416293697E+000 + 9.746307211835203E-001 9.434235998288670E-001 9.124765060780856E-001 8.818306803774612E-001 + 8.515251055872445E-001 8.215964733830041E-001 7.920791609483842E-001 7.630052176222300E-001 + 7.344043611239399E-001 7.063039829461153E-001 6.787291624726396E-001 6.517026893547904E-001 + 6.252450936546483E-001 5.993746832479405E-001 5.741075879640448E-001 5.494578099309735E-001 + 5.254372795868099E-001 5.020559168164938E-001 4.793216966737097E-001 4.572407191517094E-001 + 4.358172824741345E-001 4.150539593869250E-001 3.949516759451033E-001 3.755097923033063E-001 + 3.567261850361748E-001 3.385973305339127E-001 3.211183890391742E-001 3.042832889137503E-001 + 2.880848107470487E-001 2.725146709428210E-001 2.575636044458465E-001 2.432214462959833E-001 + 2.294772117230648E-001 2.163191745222383E-001 2.037349434753714E-001 1.917115366099091E-001 + 1.802354531118406E-001 1.692927427341184E-001 1.588690725657981E-001 1.489497910501874E-001 + 1.395199891623570E-001 1.305645586772874E-001 1.220682474797245E-001 1.140157118853451E-001 + 1.063915659600825E-001 9.918042784041092E-002 9.236696307196925E-002 8.593592499717839E-002 + 7.987219223442689E-002 7.416080330202256E-002 6.878698844946070E-002 6.373619876667602E-002 + 5.899413264889403E-002 5.454675970053358E-002 5.038034216639702E-002 4.648145398221064E-002 + 4.283699753949430E-002 3.943421826185548E-002 3.626071709117693E-002 3.330446098288402E-002 + 3.055379150962879E-002 2.799743167236609E-002 2.562449101701602E-002 2.342446915376327E-002 + 2.138725777459859E-002 1.950314126302919E-002 1.776279598800852E-002 1.615728837212054E-002 + 1.467807182192761E-002 1.331698260619042E-002 1.206623476541774E-002 1.091841413392222E-002 + 9.866471553259973E-003 8.903715353625359E-003 8.023803177462307E-003 7.220733217241051E-003 + 6.488834937030233E-003 5.822759345166202E-003 5.217468882975287E-003 4.668226992133573E-003 + 4.170587420845582E-003 3.720383326577685E-003 3.313716230589235E-003 2.946944876956968E-003 + 2.616674046181893E-003 2.319743370801108E-003 2.053216197698097E-003 1.814368539017358E-003 + 1.600678150746310E-003 1.409813775135994E-003 1.239624580201504E-003 1.088129826583556E-003 + 9.535087890774768E-004 8.340909571590310E-004 7.283465358733627E-004 6.348772655204114E-004 + 5.524075756840336E-004 4.797760863297722E-004 4.159274659544316E-004 3.599046541254746E-004 + 3.108414532149859E-004 2.679554917256107E-004 2.305415593371328E-004 1.979653116831761E-004 + 1.696573409070719E-004 1.451076062515569E-004 1.238602173138418E-004 1.055085611490299E-004 + 8.969076313206532E-005 7.608547039063454E-005 6.440794569617929E-005 5.440645894304968E-005 + 4.585896275096406E-005 3.857003828601460E-005 3.236809710192160E-005 2.710282464654785E-005 + 2.264285104842542E-005 1.887363488323690E-005 1.569554580935390E-005 1.302213224293984E-005 + 1.077856060730201E-005 8.900213118090400E-006 7.331431560347542E-006 6.024395047205188E-006 + 4.938120323553907E-006 4.037573778212563E-006 3.292884946277367E-006 2.678651911259750E-006 + 2.173329646875193E-006 1.758692964285204E-006 1.419366346399100E-006 1.142413551494532E-006 + 9.169804498552619E-007 7.339851152506977E-007 5.858497263432973E-007 4.662693381073615E-007 + 3.700130593813546E-007 2.927570443128190E-007 2.309610444179623E-007 1.816772193616487E-007 + 1.424873352361400E-007 1.114165231987084E-007 8.685679187892468E-008 6.750281857830697E-008 + 5.229821440558170E-008 4.039069528171155E-008 3.109480106156011E-008 2.386099112373199E-008 + 1.825010885033028E-008 1.391235152113570E-008 1.057000823483199E-008 8.003338376601263E-009 + 6.039058587128927E-009 4.540988739133159E-009 3.402478556658738E-009 2.540297560555940E-009 + 1.889723213892355E-009 1.400606579964474E-009 1.034232496707670E-009 7.608231067654750E-010 + 5.575603651151189E-010 4.070255849865741E-010 2.959728048223740E-010 2.143683148497494E-010 + 1.546415526472006E-010 1.111031812127605E-010 7.949486231960045E-011 5.664234376151561E-011 + 4.018925805153849E-011 2.839370934729641E-011 1.997349731210194E-011 1.398885357671710E-011 + 9.753984593586880E-012 6.770637606444734E-012 4.678428547591994E-012 3.217869865513079E-012 + 2.202976629920291E-012 1.501063124088163E-012 1.017912112244603E-012 6.869394829601630E-013 + 4.613158064707257E-013 3.082656243201503E-013 2.049627358049093E-013 1.355893288290261E-013 + 8.923954752501466E-014 5.843262794753973E-014 3.806379105245852E-014 2.466786854041518E-014 + 1.590516508771892E-014 1.020440406301012E-014 6.516104379865606E-015 4.143166712774151E-015 + 2.625142833526234E-015 1.659621510134403E-015 1.049131769203407E-015 6.593159444277503E-016 + 4.118767783178281E-016 2.557516535859395E-016 1.578388198994124E-016 9.680991376645175E-017 + 5.900685339609091E-017 3.573775353203519E-017 2.150598498166837E-017 1.285770362908161E-017 + 7.636664556887111E-018 4.505510930912853E-018 2.640266446328257E-018 1.536659793403770E-018 + 8.881705829717282E-019 5.097599112196767E-019 2.905006338928864E-019 1.643620674174772E-019 + 9.231870751593957E-020 5.147204871459775E-020 2.848435046831179E-020 1.564419839243277E-020 + 8.526502514094453E-021 4.611233524236187E-021 2.474282772274110E-021 1.317117364731254E-021 + 6.955028527945292E-022 3.642742490086157E-022 1.892205970841759E-022 9.747055334488411E-023 + 4.978490438145999E-023 2.521126906921231E-023 1.265661300762581E-023 6.298229009793170E-024 + 3.106342510638801E-024 1.518313190872346E-024 7.353686281474532E-025 3.528828032984050E-025 + 1.677594068415678E-025 7.899924687235486E-026 3.684569475172676E-026 1.701867223111898E-026 + 7.783706638552488E-027 3.524643303877156E-027 1.580000426631898E-027 7.010633418858296E-028 + 3.078643113156248E-028 1.337848008719197E-028 5.752308160387099E-029 2.446849874871427E-029 + 1.029540566503985E-029 4.284409451055378E-030 1.763150960482781E-030 7.174273892482835E-031 + 2.885987637322021E-031 1.147562626527642E-031 4.509831453656017E-032 1.751386453435816E-032 + 6.720110088290602E-033 2.547285748628666E-033 9.537161651040087E-034 3.526414082916201E-034 + 1.287513506521468E-034 4.640933890724472E-035 1.651292398334435E-035 5.798779853899606E-036 + 2.009423322492838E-036 6.869983084910944E-037 2.316944490943229E-037 7.706846648328600E-038 + 2.527920372689988E-038 8.175214468826181E-039 2.606192910456221E-039 8.188553231950328E-040 + 2.535254696430923E-040 7.733381006608802E-041 2.323641858687977E-041 6.876041745361868E-042 + 2.003520859141368E-042 5.747126469919319E-043 1.622645209473776E-043 4.508433368248258E-044 + 1.232449830840796E-044 3.314099140121106E-045 8.764445000222776E-046 2.279055575552430E-046 + 5.825922891593123E-047 +/ diff --git a/tests/apps/miniDFT/tests/test/Si_333.in b/tests/apps/miniDFT/tests/test/Si_333.in new file mode 100644 index 0000000000..062916f59c --- /dev/null +++ b/tests/apps/miniDFT/tests/test/Si_333.in @@ -0,0 +1,93 @@ +&control +prefix = 'silicon' +calculation = 'scf' +restart_mode = 'from_scratch' +wf_collect = .false. +disk_io = 'none' +tstress = .true. +tprnfor = .true. +outdir = './' +wfcdir = './' +pseudo_dir = './' +/ +&system +ibrav = 0 +celldm(1) = 10.2612 +nat = 54 +ntyp = 1 +nbnd = 108 +ecutwfc = 30 +/ +&electrons +electron_maxstep = 100 +conv_thr = 1.0d-10 +mixing_mode = 'plain' +mixing_beta = 0.7 +mixing_ndim = 8 +diagonalization = 'david' +diago_david_ndim = 4 +diago_full_acc = .true. +/ +CELL_PARAMETERS +0.0 1.5 1.5 +1.5 0.0 1.5 +1.5 1.5 0.0 +ATOMIC_SPECIES +Si 28.086 Si.lda.nml +ATOMIC_POSITIONS crystal +Si 0.0 0.0 0.0 +Si 0.0833333333333 0.0833333333333 0.0833333333333 +Si 0.0 0.0 0.333333333333 +Si 0.0833333333333 0.0833333333333 0.416666666667 +Si 0.0 0.0 0.666666666667 +Si 0.0833333333333 0.0833333333333 0.75 +Si 0.0 0.333333333333 0.0 +Si 0.0833333333333 0.416666666667 0.0833333333333 +Si 0.0 0.333333333333 0.333333333333 +Si 0.0833333333333 0.416666666667 0.416666666667 +Si 0.0 0.333333333333 0.666666666667 +Si 0.0833333333333 0.416666666667 0.75 +Si 0.0 0.666666666667 0.0 +Si 0.0833333333333 0.75 0.0833333333333 +Si 0.0 0.666666666667 0.333333333333 +Si 0.0833333333333 0.75 0.416666666667 +Si 0.0 0.666666666667 0.666666666667 +Si 0.0833333333333 0.75 0.75 +Si 0.333333333333 0.0 0.0 +Si 0.416666666667 0.0833333333333 0.0833333333333 +Si 0.333333333333 0.0 0.333333333333 +Si 0.416666666667 0.0833333333333 0.416666666667 +Si 0.333333333333 0.0 0.666666666667 +Si 0.416666666667 0.0833333333333 0.75 +Si 0.333333333333 0.333333333333 0.0 +Si 0.416666666667 0.416666666667 0.0833333333333 +Si 0.333333333333 0.333333333333 0.333333333333 +Si 0.416666666667 0.416666666667 0.416666666667 +Si 0.333333333333 0.333333333333 0.666666666667 +Si 0.416666666667 0.416666666667 0.75 +Si 0.333333333333 0.666666666667 0.0 +Si 0.416666666667 0.75 0.0833333333333 +Si 0.333333333333 0.666666666667 0.333333333333 +Si 0.416666666667 0.75 0.416666666667 +Si 0.333333333333 0.666666666667 0.666666666667 +Si 0.416666666667 0.75 0.75 +Si 0.666666666667 0.0 0.0 +Si 0.75 0.0833333333333 0.0833333333333 +Si 0.666666666667 0.0 0.333333333333 +Si 0.75 0.0833333333333 0.416666666667 +Si 0.666666666667 0.0 0.666666666667 +Si 0.75 0.0833333333333 0.75 +Si 0.666666666667 0.333333333333 0.0 +Si 0.75 0.416666666667 0.0833333333333 +Si 0.666666666667 0.333333333333 0.333333333333 +Si 0.75 0.416666666667 0.416666666667 +Si 0.666666666667 0.333333333333 0.666666666667 +Si 0.75 0.416666666667 0.75 +Si 0.666666666667 0.666666666667 0.0 +Si 0.75 0.75 0.0833333333333 +Si 0.666666666667 0.666666666667 0.333333333333 +Si 0.75 0.75 0.416666666667 +Si 0.666666666667 0.666666666667 0.666666666667 +Si 0.75 0.75 0.75 +K_POINTS automatic +1 1 1 1 1 1 diff --git a/tests/apps/miniDFT/tests/test/Ti.pbe.nml b/tests/apps/miniDFT/tests/test/Ti.pbe.nml new file mode 100644 index 0000000000..0149b8d1ce --- /dev/null +++ b/tests/apps/miniDFT/tests/test/Ti.pbe.nml @@ -0,0 +1,2746 @@ +&header + generated='Generated using "atomic" code by A. Dal Corso (Quantum ESPRESSO distribution)' + author = "AM" + date = "15Apr2011" + comment = "" + psd = "Ti" + typ = "NC" + rel ="scalar" + tvanp = .false. + tpawp = .false. + tcoulombp= .false. + has_so = .false. + has_wfc = .false. + has_gipaw= .false. + nlcc = .false. + dft = "PBE " + zp = 1.200000000000000E+001 + etotps = -1.092354330442288E+002 + ecutwfc = 0.000000000000000E+000 + ecutrho = 0.000000000000000E+000 + nv = "2.0.1" + lmax = 2 + lmax_rho = 4 + lloc = 0 + nmesh = 1177 + nwfc = 3 + nbeta = 2 +/ +&mesh + dx = 1.250000000000000E-002 + nmesh = 1177 + xmin =-7.000000000000000E+000 + rmax = 1.000000000000000E+002 + zmesh = 2.200000000000000E+001 + r(1:1177) = + 4.144918025247801E-005 4.197054675768283E-005 4.249847124620828E-005 4.303303620732972E-005 + 4.357432516790999E-005 4.412242270545040E-005 4.467741446130630E-005 4.523938715406870E-005 + 4.580842859311411E-005 4.638462769232521E-005 4.696807448398350E-005 4.755886013283720E-005 + 4.815707695034592E-005 4.876281840910440E-005 4.937617915744808E-005 4.999725503424174E-005 + 5.062614308385469E-005 5.126294157132420E-005 5.190774999770943E-005 5.256066911563899E-005 + 5.322180094505338E-005 5.389124878914604E-005 5.456911725050459E-005 5.525551224745521E-005 + 5.595054103061277E-005 5.665431219963862E-005 5.736693572020975E-005 5.808852294120111E-005 + 5.881918661208400E-005 5.955904090054364E-005 6.030820141031780E-005 6.106678519926031E-005 + 6.183491079763153E-005 6.261269822661895E-005 6.340026901709085E-005 6.419774622858552E-005 + 6.500525446853975E-005 6.582291991175889E-005 6.665087032013196E-005 6.748923506259485E-005 + 6.833814513534419E-005 6.919773318230599E-005 7.006813351586138E-005 7.094948213783328E-005 + 7.184191676073714E-005 7.274557682929838E-005 7.366060354224122E-005 7.458713987435118E-005 + 7.552533059881518E-005 7.647532230984278E-005 7.743726344557155E-005 7.841130431126101E-005 + 7.939759710277816E-005 8.039629593037822E-005 8.140755684278499E-005 8.243153785157342E-005 + 8.346839895585942E-005 8.451830216730004E-005 8.558141153540807E-005 8.665789317318529E-005 + 8.774791528307769E-005 8.885164818325759E-005 8.996926433423621E-005 9.110093836581087E-005 + 9.224684710435155E-005 9.340716960042995E-005 9.458208715679679E-005 9.577178335671064E-005 + 9.697644409262310E-005 9.819625759522520E-005 9.943141446285842E-005 1.006821076912962E-004 + 1.019485327039001E-004 1.032308873821549E-004 1.045293720965880E-004 1.058441897380779E-004 + 1.071755457495560E-004 1.085236481581079E-004 1.098887076074774E-004 1.112709373909811E-004 + 1.126705534848345E-004 1.140877745818999E-004 1.155228221258572E-004 1.169759203458045E-004 + 1.184472962912954E-004 1.199371798678146E-004 1.214458038727023E-004 1.229734040315285E-004 + 1.245202190349258E-004 1.260864905758858E-004 1.276724633875233E-004 1.292783852813167E-004 + 1.309045071858292E-004 1.325510831859167E-004 1.342183705624294E-004 1.359066298324118E-004 + 1.376161247898098E-004 1.393471225466883E-004 1.410998935749686E-004 1.428747117486900E-004 + 1.446718543868030E-004 1.464916022965012E-004 1.483342398170977E-004 1.502000548644537E-004 + 1.520893389759669E-004 1.540023873561233E-004 1.559394989226243E-004 1.579009763530933E-004 + 1.598871261323695E-004 1.618982586003968E-004 1.639346880007150E-004 1.659967325295611E-004 + 1.680847143855878E-004 1.701989598202082E-004 1.723397991885731E-004 1.745075670011893E-004 + 1.767026019761877E-004 1.789252470922492E-004 1.811758496421950E-004 1.834547612872527E-004 + 1.857623381120030E-004 1.880989406800198E-004 1.904649340902081E-004 1.928606880338518E-004 + 1.952865768523791E-004 1.977429795958531E-004 2.002302800822003E-004 2.027488669571819E-004 + 2.052991337551212E-004 2.078814789603942E-004 2.104963060696930E-004 2.131440236550732E-004 + 2.158250454277944E-004 2.185397903029630E-004 2.212886824649892E-004 2.240721514338660E-004 + 2.268906321322826E-004 2.297445649535825E-004 2.326343958305751E-004 2.355605763052148E-004 + 2.385235635991538E-004 2.415238206851853E-004 2.445618163595828E-004 2.476380253153511E-004 + 2.507529282163987E-004 2.539070117726409E-004 2.571007688160504E-004 2.603346983776630E-004 + 2.636093057655519E-004 2.669251026437842E-004 2.702826071123679E-004 2.736823437882072E-004 + 2.771248438870744E-004 2.806106453066137E-004 2.841402927103891E-004 2.877143376129885E-004 + 2.913333384661993E-004 2.949978607462676E-004 2.987084770422551E-004 3.024657671455079E-004 + 3.062703181402485E-004 3.101227244953103E-004 3.140235881570242E-004 3.179735186432732E-004 + 3.219731331387330E-004 3.260230565913045E-004 3.301239218097678E-004 3.342763695626562E-004 + 3.384810486783790E-004 3.427386161466034E-004 3.470497372209074E-004 3.514150855227305E-004 + 3.558353431466261E-004 3.603112007668406E-004 3.648433577452346E-004 3.694325222405551E-004 + 3.740794113190923E-004 3.787847510667186E-004 3.835492767023423E-004 3.883737326927885E-004 + 3.932588728691197E-004 3.982054605444285E-004 4.032142686331026E-004 4.082860797715962E-004 + 4.134216864407193E-004 4.186218910894609E-004 4.238875062603785E-004 4.292193547165551E-004 + 4.346182695701593E-004 4.400850944126224E-004 4.456206834464467E-004 4.512259016186824E-004 + 4.569016247560721E-004 4.626487397019031E-004 4.684681444545795E-004 4.743607483079320E-004 + 4.803274719933025E-004 4.863692478234058E-004 4.924870198380069E-004 4.986817439514312E-004 + 5.049543881019231E-004 5.113059324028938E-004 5.177373692960626E-004 5.242497037065282E-004 + 5.308439531997933E-004 5.375211481407553E-004 5.442823318547100E-004 5.511285607903681E-004 + 5.580609046849289E-004 5.650804467312315E-004 5.721882837469999E-004 5.793855263462304E-004 + 5.866732991127215E-004 5.940527407757945E-004 6.015250043882246E-004 6.090912575064013E-004 + 6.167526823727698E-004 6.245104761005520E-004 6.323658508608008E-004 6.403200340718061E-004 + 6.483742685908753E-004 6.565298129085399E-004 6.647879413451919E-004 6.731499442502000E-004 + 6.816171282035326E-004 6.901908162199066E-004 6.988723479555197E-004 7.076630799173677E-004 + 7.165643856752040E-004 7.255776560761647E-004 7.347042994620852E-004 7.439457418895648E-004 + 7.533034273527843E-004 7.627788180091345E-004 7.723733944076856E-004 7.820886557205174E-004 + 7.919261199769780E-004 8.018873243008710E-004 8.119738251506379E-004 8.221871985625597E-004 + 8.325290403970082E-004 8.430009665878129E-004 8.536046133947459E-004 8.643416376591935E-004 + 8.752137170630423E-004 8.862225503908180E-004 8.973698577951265E-004 9.086573810654287E-004 + 9.200868839001996E-004 9.316601521825118E-004 9.433789942590792E-004 9.552452412228196E-004 + 9.672607471989625E-004 9.794273896347623E-004 9.917470695928533E-004 1.004221712048293E-003 + 1.016853266189346E-003 1.029643705722044E-003 1.042595029178588E-003 1.055709260229617E-003 + 1.068988448000414E-003 1.082434667391085E-003 1.096050019400767E-003 1.109836631455911E-003 + 1.123796657742700E-003 1.137932279543643E-003 1.152245705578407E-003 1.166739172348929E-003 + 1.181414944488879E-003 1.196275315117514E-003 1.211322606197977E-003 1.226559168900113E-003 + 1.241987383967844E-003 1.257609662091163E-003 1.273428444282810E-003 1.289446202259686E-003 + 1.305665438829065E-003 1.322088688279658E-003 1.338718516777604E-003 1.355557522767441E-003 + 1.372608337378114E-003 1.389873624834095E-003 1.407356082871677E-003 1.425058443160495E-003 + 1.442983471730361E-003 1.461133969403458E-003 1.479512772231974E-003 1.498122751941244E-003 + 1.516966816378458E-003 1.536047909967025E-003 1.555369014166638E-003 1.574933147939137E-003 + 1.594743368220229E-003 1.614802770397135E-003 1.635114488792258E-003 1.655681697152920E-003 + 1.676507609147273E-003 1.697595478866437E-003 1.718948601332958E-003 1.740570313015666E-003 + 1.762463992351000E-003 1.784633060270901E-003 1.807080980737333E-003 1.829811261283539E-003 + 1.852827453562101E-003 1.876133153899889E-003 1.899732003859996E-003 1.923627690810742E-003 + 1.947823948501827E-003 1.972324557647745E-003 1.997133346518519E-003 2.022254191537887E-003 + 2.047691017888992E-003 2.073447800127700E-003 2.099528562803642E-003 2.125937381089044E-003 + 2.152678381415497E-003 2.179755742118704E-003 2.207173694091362E-003 2.234936521444254E-003 + 2.263048562175634E-003 2.291514208849063E-003 2.320337909279746E-003 2.349524167229519E-003 + 2.379077543110563E-003 2.409002654697991E-003 2.439304177851370E-003 2.469986847245341E-003 + 2.501055457109421E-003 2.532514861977109E-003 2.564369977444425E-003 2.596625780937968E-003 + 2.629287312492658E-003 2.662359675539253E-003 2.695848037701760E-003 2.729757631604907E-003 + 2.764093755691726E-003 2.798861775051465E-003 2.834067122257884E-003 2.869715298218108E-003 + 2.905811873032162E-003 2.942362486863298E-003 2.979372850819289E-003 3.016848747844802E-003 + 3.054796033624989E-003 3.093220637500463E-003 3.132128563393754E-003 3.171525890747439E-003 + 3.211418775474074E-003 3.251813450918055E-003 3.292716228829612E-003 3.334133500351006E-003 + 3.376071737015178E-003 3.418537491756929E-003 3.461537399936833E-003 3.505078180378032E-003 + 3.549166636416053E-003 3.593809656961849E-003 3.639014217578208E-003 3.684787381569693E-003 + 3.731136301086309E-003 3.778068218241025E-003 3.825590466241382E-003 3.873710470535313E-003 + 3.922435749971386E-003 3.971773917973654E-003 4.021732683731242E-003 4.072319853402942E-003 + 4.123543331336934E-003 4.175411121305859E-003 4.227931327757431E-003 4.281112157080758E-003 + 4.334961918888621E-003 4.389489027315858E-003 4.444702002334093E-003 4.500609471083014E-003 + 4.557220169218352E-003 4.614542942276868E-003 4.672586747058474E-003 4.731360653025756E-003 + 4.790873843721106E-003 4.851135618201646E-003 4.912155392492241E-003 4.973942701056772E-003 + 5.036507198287908E-003 5.099858660015624E-003 5.164006985034717E-003 5.228962196651474E-003 + 5.294734444249865E-003 5.361334004877390E-003 5.428771284850892E-003 5.497056821382577E-003 + 5.566201284226452E-003 5.636215477345513E-003 5.707110340599878E-003 5.778896951456163E-003 + 5.851586526718374E-003 5.925190424280532E-003 5.999720144901377E-003 6.075187334001387E-003 + 6.151603783482396E-003 6.228981433570113E-003 6.307332374679786E-003 6.386668849305372E-003 + 6.467003253932440E-003 6.548348140975149E-003 6.630716220737610E-003 6.714120363399857E-003 + 6.798573601028869E-003 6.884089129614849E-003 6.970680311133112E-003 7.058360675631955E-003 + 7.147143923346712E-003 7.237043926840470E-003 7.328074733171677E-003 7.420250566089018E-003 + 7.513585828253935E-003 7.608095103491025E-003 7.703793159066827E-003 7.800694947997220E-003 + 7.898815611383871E-003 7.998170480780069E-003 8.098775080586295E-003 8.200645130475949E-003 + 8.303796547851581E-003 8.408245450332013E-003 8.514008158270775E-003 8.621101197306151E-003 + 8.729541300943373E-003 8.839345413169258E-003 8.950530691099729E-003 9.063114507660690E-003 + 9.177114454302521E-003 9.292548343748822E-003 9.409434212779672E-003 9.527790325049900E-003 + 9.647635173942869E-003 9.768987485460030E-003 9.891866221146954E-003 1.001629058105609E-002 + 1.014228000674681E-002 1.026985418432322E-002 1.039903304751011E-002 1.052983678076768E-002 + 1.066228582244536E-002 1.079640086797537E-002 1.093220287310646E-002 1.106971305717822E-002 + 1.120895290643666E-002 1.134994417739153E-002 1.149270890021575E-002 1.163726938218773E-002 + 1.178364821117689E-002 1.193186825917306E-002 1.208195268586031E-002 1.223392494223563E-002 + 1.238780877427330E-002 1.254362822663515E-002 1.270140764642761E-002 1.286117168700605E-002 + 1.302294531182682E-002 1.318675379834797E-002 1.335262274197877E-002 1.352057806007912E-002 + 1.369064599600919E-002 1.386285312322997E-002 1.403722634945545E-002 1.421379292085699E-002 + 1.439258042632061E-002 1.457361680175777E-002 1.475693033447044E-002 1.494254966757110E-002 + 1.513050380445817E-002 1.532082211334793E-002 1.551353433186336E-002 1.570867057168066E-002 + 1.590626132323434E-002 1.610633746048131E-002 1.630893024572508E-002 1.651407133450052E-002 + 1.672179278052011E-002 1.693212704068241E-002 1.714510698014350E-002 1.736076587745223E-002 + 1.757913742975007E-002 1.780025575803632E-002 1.802415541249968E-002 1.825087137791667E-002 + 1.848043907911815E-002 1.871289438652449E-002 1.894827362175038E-002 1.918661356328025E-002 + 1.942795145221485E-002 1.967232499809034E-002 1.991977238477044E-002 2.017033227641272E-002 + 2.042404382351008E-002 2.068094666900790E-002 2.094108095449846E-002 2.120448732649312E-002 + 2.147120694277339E-002 2.174128147882201E-002 2.201475313433467E-002 2.229166463981393E-002 + 2.257205926324590E-002 2.285598081686095E-002 2.314347366397951E-002 2.343458272594383E-002 + 2.372935348913711E-002 2.402783201209080E-002 2.433006493268138E-002 2.463609947541760E-002 + 2.494598345881939E-002 2.525976530288962E-002 2.557749403667983E-002 2.589921930595105E-002 + 2.622499138093122E-002 2.655486116416982E-002 2.688888019849161E-002 2.722710067505026E-002 + 2.756957544148334E-002 2.791635801016991E-002 2.826750256659183E-002 2.862306397780047E-002 + 2.898309780098972E-002 2.934766029217691E-002 2.971680841499307E-002 3.009059984958337E-002 + 3.046909300161998E-002 3.085234701142795E-002 3.124042176322601E-002 3.163337789448373E-002 + 3.203127680539607E-002 3.243418066847741E-002 3.284215243827603E-002 3.325525586121099E-002 + 3.367355548553264E-002 3.409711667140827E-002 3.452600560113495E-002 3.496028928948050E-002 + 3.540003559415477E-002 3.584531322641258E-002 3.629619176178988E-002 3.675274165097513E-002 + 3.721503423081739E-002 3.768314173547274E-002 3.815713730769125E-002 3.863709501024538E-002 + 3.912308983750265E-002 3.961519772714357E-002 4.011349557202706E-002 4.061806123220527E-002 + 4.112897354708908E-002 4.164631234776719E-002 4.217015846947970E-002 4.270059376424890E-002 + 4.323770111366882E-002 4.378156444185555E-002 4.433226872856060E-002 4.488990002244918E-002 + 4.545454545454546E-002 4.602629325184703E-002 4.660523275111042E-002 4.719145441281025E-002 + 4.778504983527385E-002 4.838611176899361E-002 4.899473413111963E-002 4.961101202013418E-002 + 5.023504173071128E-002 5.086692076876279E-002 5.150674786667393E-002 5.215462299873057E-002 + 5.281064739674016E-002 5.347492356584960E-002 5.414755530056177E-002 5.482864770095366E-002 + 5.551830718909864E-002 5.621664152569478E-002 5.692375982690296E-002 5.763977258139638E-002 + 5.836479166762461E-002 5.909893037129506E-002 5.984230340307373E-002 6.059502691650925E-002 + 6.135721852618201E-002 6.212899732608165E-002 6.291048390821598E-002 6.370180038145336E-002 + 6.450307039060264E-002 6.531441913573298E-002 6.613597339173642E-002 6.696786152813708E-002 + 6.781021352914868E-002 6.866316101398516E-002 6.952683725742635E-002 7.040137721064242E-002 + 7.128691752228042E-002 7.218359655981564E-002 7.309155443117199E-002 7.401093300661414E-002 + 7.494187594091492E-002 7.588452869580196E-002 7.683903856268599E-002 7.780555468567570E-002 + 7.878422808488166E-002 7.977521168001357E-002 8.077866031427448E-002 8.179473077855497E-002 + 8.282358183593228E-002 8.386537424647732E-002 8.492027079237374E-002 8.598843630335319E-002 + 8.707003768244985E-002 8.816524393207978E-002 8.927422618044766E-002 9.039715770828599E-002 + 9.153421397593077E-002 9.268557265073708E-002 9.385141363484034E-002 9.503191909326623E-002 + 9.622727348239431E-002 9.743766357877998E-002 9.866327850833832E-002 9.990430977589559E-002 + 1.011609512951122E-001 1.024333994187822E-001 1.037218529695138E-001 1.050265132707957E-001 + 1.063475841784542E-001 1.076852721125064E-001 1.090397860894135E-001 1.104113377547404E-001 + 1.118001414162250E-001 1.132064140772651E-001 1.146303754708250E-001 1.160722480937694E-001 + 1.175322572416294E-001 1.190106310438046E-001 1.205076004992094E-001 1.220233995123669E-001 + 1.235582649299566E-001 1.251124365778231E-001 1.266861572984478E-001 1.282796729888954E-001 + 1.298932326392348E-001 1.315270883714437E-001 1.331814954788048E-001 1.348567124657940E-001 + 1.365530010884742E-001 1.382706263953939E-001 1.400098567690014E-001 1.417709639675816E-001 + 1.435542231677168E-001 1.453599130072852E-001 1.471883156289983E-001 1.490397167244852E-001 + 1.509144055789342E-001 1.528126751162923E-001 1.547348219450372E-001 1.566811464045217E-001 + 1.586519526119019E-001 1.606475485096579E-001 1.626682459137082E-001 1.647143605621337E-001 + 1.667862121645112E-001 1.688841244518684E-001 1.710084252272688E-001 1.731594464170301E-001 + 1.753375241225897E-001 1.775429986730207E-001 1.797762146782081E-001 1.820375210826968E-001 + 1.843272712202126E-001 1.866458228688732E-001 1.889935383070914E-001 1.913707843701800E-001 + 1.937779325076737E-001 1.962153588413657E-001 1.986834442240799E-001 2.011825742991790E-001 + 2.037131395608211E-001 2.062755354149776E-001 2.088701622412132E-001 2.114974254552486E-001 + 2.141577355723066E-001 2.168515082712547E-001 2.195791644595584E-001 2.223411303390457E-001 + 2.251378374725052E-001 2.279697228511165E-001 2.308372289627310E-001 2.337408038610133E-001 + 2.366809012354477E-001 2.396579804822314E-001 2.426725067760536E-001 2.457249511427803E-001 + 2.488157905330548E-001 2.519455078968193E-001 2.551145922587797E-001 2.583235387948158E-001 + 2.615728489093514E-001 2.648630303137036E-001 2.681945971054099E-001 2.715680698485601E-001 + 2.749839756551341E-001 2.784428482673630E-001 2.819452281411305E-001 2.854916625304166E-001 + 2.890827055728104E-001 2.927189183760938E-001 2.964008691059142E-001 3.001291330745652E-001 + 3.039042928308760E-001 3.077269382512397E-001 3.115976666317810E-001 3.155170827816834E-001 + 3.194857991176955E-001 3.235044357598180E-001 3.275736206282029E-001 3.316939895412653E-001 + 3.358661863150296E-001 3.400908628637312E-001 3.443686793016749E-001 3.487003040463831E-001 + 3.530864139230354E-001 3.575276942702224E-001 3.620248390470355E-001 3.665785509414943E-001 + 3.711895414803476E-001 3.758585311402488E-001 3.805862494603302E-001 3.853734351561992E-001 + 3.902208362353589E-001 3.951292101140910E-001 4.000993237358006E-001 4.051319536908517E-001 + 4.102278863379150E-001 4.153879179268331E-001 4.206128547230404E-001 4.259035131335425E-001 + 4.312607198344784E-001 4.366853119002960E-001 4.421781369345403E-001 4.477400532022991E-001 + 4.533719297643058E-001 4.590746466127297E-001 4.648490948086823E-001 4.706961766214407E-001 + 4.766168056694350E-001 4.826119070630005E-001 4.886824175489252E-001 4.948292856568249E-001 + 5.010534718473457E-001 5.073559486622439E-001 5.137377008763450E-001 5.201997256514146E-001 + 5.267430326919729E-001 5.333686444030552E-001 5.400775960499725E-001 5.468709359200700E-001 + 5.537497254865215E-001 5.607150395741939E-001 5.677679665275824E-001 5.749096083808737E-001 + 5.821410810301383E-001 5.894635144076878E-001 5.968780526586377E-001 6.043858543196722E-001 + 6.119880925000777E-001 6.196859550650348E-001 6.274806448212316E-001 6.353733797048021E-001 + 6.433653929716276E-001 6.514579333900431E-001 6.596522654359511E-001 6.679496694904065E-001 + 6.763514420396750E-001 6.848588958778087E-001 6.934733603117809E-001 7.021961813691830E-001 + 7.110287220085533E-001 7.199723623323379E-001 7.290284998025307E-001 7.381985494590390E-001 + 7.474839441407756E-001 7.568861347095520E-001 7.664065902767749E-001 7.760467984329936E-001 + 7.858082654803483E-001 7.956925166679223E-001 8.057010964300747E-001 8.158355686277571E-001 + 8.260975167928667E-001 8.364885443756851E-001 8.470102749954098E-001 8.576643526938583E-001 + 8.684524421923485E-001 8.793762291518099E-001 8.904374204361827E-001 9.016377443791060E-001 + 9.129789510539849E-001 9.244628125474376E-001 9.360911232361834E-001 9.478657000674289E-001 + 9.597883828427558E-001 9.718610345056065E-001 9.840855414323670E-001 9.964638137271123E-001 + 1.008997785520076E+000 1.021689415269847E+000 1.034540686069397E+000 1.047553605955936E+000 + 1.060730208224669E+000 1.074072551746511E+000 1.087582721289780E+000 1.101262827845954E+000 + 1.115115008959517E+000 1.129141429061948E+000 1.143344279809927E+000 1.157725780427777E+000 + 1.172288178054230E+000 1.187033748093545E+000 1.201964794571037E+000 1.217083650493098E+000 + 1.232392678211723E+000 1.247894269793641E+000 1.263590847394077E+000 1.279484863635212E+000 + 1.295578801989423E+000 1.311875177167320E+000 1.328376535510679E+000 1.345085455390317E+000 + 1.362004547608956E+000 1.379136455809180E+000 1.396483856886497E+000 1.414049461407621E+000 + 1.431836014033999E+000 1.449846293950659E+000 1.468083115300487E+000 1.486549327623917E+000 + 1.505247816304196E+000 1.524181503018226E+000 1.543353346193071E+000 1.562766341468238E+000 + 1.582423522163730E+000 1.602327959754025E+000 1.622482764347996E+000 1.642891085174861E+000 + 1.663556111076274E+000 1.684481071004573E+000 1.705669234527318E+000 1.727123912338173E+000 + 1.748848456774188E+000 1.770846262339637E+000 1.793120766236389E+000 1.815675448900997E+000 + 1.838513834548520E+000 1.861639491723173E+000 1.885056033855946E+000 1.908767119829182E+000 + 1.932776454548308E+000 1.957087789520725E+000 1.981704923441978E+000 2.006631702789331E+000 + 2.031872022422766E+000 2.057429826193580E+000 2.083309107560614E+000 2.109513910214226E+000 + 2.136048328708152E+000 2.162916509099259E+000 2.190122649595401E+000 2.217671001211384E+000 + 2.245565868433190E+000 2.273811609890582E+000 2.302412639038121E+000 2.331373424844805E+000 + 2.360698492492340E+000 2.390392424082203E+000 2.420459859351622E+000 2.450905496398526E+000 + 2.481734092415647E+000 2.512950464433840E+000 2.544559490074734E+000 2.576566108312903E+000 + 2.608975320247556E+000 2.641792189883999E+000 2.675021844924884E+000 2.708669477571409E+000 + 2.742740345334639E+000 2.777239771856971E+000 2.812173147743995E+000 2.847545931406769E+000 + 2.883363649914697E+000 2.919631899859179E+000 2.956356348228046E+000 2.993542733291077E+000 + 3.031196865496601E+000 3.069324628379370E+000 3.107931979479919E+000 3.147024951275393E+000 + 3.186609652122175E+000 3.226692267210315E+000 3.267279059529958E+000 3.308376370849988E+000 + 3.349990622708902E+000 3.392128317418223E+000 3.434796039078485E+000 3.478000454607995E+000 + 3.521748314784590E+000 3.566046455300416E+000 3.610901797830060E+000 3.656321351112060E+000 + 3.702312212044006E+000 3.748881566791505E+000 3.796036691910967E+000 3.843784955486636E+000 + 3.892133818281848E+000 3.941090834904768E+000 3.990663654988860E+000 4.040860024388106E+000 + 4.091687786387355E+000 4.143154882927838E+000 4.195269355848086E+000 4.248039348140534E+000 + 4.301473105223825E+000 4.355578976231222E+000 4.410365415315156E+000 4.465840982968185E+000 + 4.522014347360634E+000 4.578894285694960E+000 4.636489685577259E+000 4.694809546405948E+000 + 4.753862980777919E+000 4.813659215912455E+000 4.874207595092934E+000 4.935517579126800E+000 + 4.997598747823800E+000 5.060460801492834E+000 5.124113562457697E+000 5.188566976591774E+000 + 5.253831114872167E+000 5.319916174953269E+000 5.386832482760152E+000 5.454590494102071E+000 + 5.523200796306135E+000 5.592674109871661E+000 5.663021290145248E+000 5.734253329016917E+000 + 5.806381356637683E+000 5.879416643158589E+000 5.953370600491755E+000 6.028254784093485E+000 + 6.104080894769797E+000 6.180860780504778E+000 6.258606438311760E+000 6.337330016107962E+000 + 6.417043814612591E+000 6.497760289268819E+000 6.579492052190052E+000 6.662251874130508E+000 + 6.746052686480755E+000 6.830907583288226E+000 6.916829823303164E+000 7.003832832050406E+000 + 7.091930203927050E+000 7.181135704326703E+000 7.271463271790304E+000 7.362927020184016E+000 + 7.455541240904636E+000 7.549320405112550E+000 7.644279165992975E+000 7.740432361045507E+000 + 7.837795014402470E+000 7.936382339176566E+000 8.036209739837838E+000 8.137292814620757E+000 + 8.239647357961426E+000 8.343289362965454E+000 8.448235023907015E+000 8.554500738759113E+000 + 8.662103111755910E+000 8.771058955987117E+000 8.881385296025043E+000 8.993099370584806E+000 + 9.106218635217811E+000 9.220760765039314E+000 9.336743657490153E+000 9.454185435133210E+000 + 9.573104448485216E+000 9.693519278883912E+000 9.815448741391551E+000 9.938911887734735E+000 + 1.006392800928123E+001 1.019051664005442E+001 1.031869755978537E+001 1.044849079700358E+001 + 1.057991663216647E+001 1.071299560082812E+001 1.084774849684818E+001 1.098419637564076E+001 + 1.112236055746456E+001 1.126226263075411E+001 1.140392445549294E+001 1.154736816662942E+001 + 1.169261617753523E+001 1.183969118350758E+001 1.198861616531542E+001 1.213941439279010E+001 + 1.229210942846150E+001 1.244672513123957E+001 1.260328566014245E+001 1.276181547807134E+001 + 1.292233935563277E+001 1.308488237500924E+001 1.324946993387819E+001 1.341612774938056E+001 + 1.358488186213912E+001 1.375575864032727E+001 1.392878478378930E+001 1.410398732821211E+001 + 1.428139364934974E+001 1.446103146730082E+001 1.464292885083984E+001 1.482711422180311E+001 + 1.501361635952949E+001 1.520246440535750E+001 1.539368786717853E+001 1.558731662404747E+001 + 1.578338093085159E+001 1.598191142303767E+001 1.618293912139905E+001 1.638649543692262E+001 + 1.659261217569677E+001 1.680132154388133E+001 1.701265615273964E+001 1.722664902373434E+001 + 1.744333359368692E+001 1.766274372000222E+001 1.788491368595893E+001 1.810987820606618E+001 + 1.833767243148796E+001 1.856833195553548E+001 1.880189281922858E+001 1.903839151692747E+001 + 1.927786500203475E+001 1.952035069276972E+001 1.976588647801494E+001 2.001451072323631E+001 + 2.026626227647807E+001 2.052118047443252E+001 2.077930514858677E+001 2.104067663144635E+001 + 2.130533576283714E+001 2.157332389628695E+001 2.184468290548679E+001 2.211945519083396E+001 + 2.239768368605712E+001 2.267941186492464E+001 2.296468374803770E+001 2.325354390970837E+001 + 2.354603748492464E+001 2.384221017640275E+001 2.414210826172823E+001 2.444577860058715E+001 + 2.475326864208770E+001 2.506462643217449E+001 2.537990062113573E+001 2.569914047120478E+001 + 2.602239586425781E+001 2.634971730960757E+001 2.668115595189586E+001 2.701676357908492E+001 + 2.735659263054919E+001 2.770069620526946E+001 2.804912807012926E+001 2.840194266831640E+001 + 2.875919512782973E+001 2.912094127009277E+001 2.948723761867632E+001 2.985814140812999E+001 + 3.023371059292554E+001 3.061400385651225E+001 3.099908062048616E+001 3.138900105387520E+001 + 3.178382608254026E+001 3.218361739869543E+001 3.258843747054727E+001 3.299834955205552E+001 + 3.341341769281700E+001 3.383370674807305E+001 3.425928238884369E+001 3.469021111218871E+001 + 3.512656025159772E+001 3.556839798751167E+001 3.601579335797555E+001 3.646881626942632E+001 + 3.692753750761563E+001 3.739202874867011E+001 3.786236257029131E+001 3.833861246309561E+001 + 3.882085284209780E+001 3.930915905833826E+001 3.980360741065663E+001 4.030427515761406E+001 + 4.081124052956447E+001 4.132458274087874E+001 4.184438200232186E+001 4.237071953358583E+001 + 4.290367757598090E+001 4.344333940528534E+001 4.398978934475803E+001 4.454311277831383E+001 + 4.510339616386483E+001 4.567072704683008E+001 4.624519407381415E+001 4.682688700645881E+001 + 4.741589673546837E+001 4.801231529481115E+001 4.861623587610064E+001 4.922775284315619E+001 + 4.984696174674811E+001 5.047395933952750E+001 5.110884359114366E+001 5.175171370355278E+001 + 5.240267012651766E+001 5.306181457330388E+001 5.372925003657236E+001 5.440508080447198E+001 + 5.508941247693538E+001 5.578235198217849E+001 5.648400759340890E+001 5.719448894574348E+001 + 5.791390705333882E+001 5.864237432673811E+001 5.938000459043467E+001 6.012691310065807E+001 + 6.088321656338269E+001 6.164903315256311E+001 6.242448252859965E+001 6.320968585703477E+001 + 6.400476582748617E+001 6.480984667281692E+001 6.562505418854684E+001 6.645051575250906E+001 + 6.728636034475211E+001 6.813271856769418E+001 6.898972266652969E+001 6.985750654989238E+001 + 7.073620581077982E+001 7.162595774773901E+001 7.252690138632042E+001 7.343917750080070E+001 + 7.436292863617849E+001 7.529829913044841E+001 7.624543513715288E+001 7.720448464822010E+001 + 7.817559751708747E+001 7.915892548211623E+001 8.015462219030179E+001 8.116284322128031E+001 + 8.218374611163924E+001 8.321749037953238E+001 8.426423754960447E+001 8.532415117823076E+001 + 8.639739687907185E+001 8.748414234895215E+001 8.858455739406249E+001 8.969881395649219E+001 + 9.082708614109640E+001 9.196955024269914E+001 9.312638477364081E+001 9.429777049167060E+001 + 9.548389042818989E+001 9.668492991685221E+001 9.790107662252090E+001 9.913252057059316E+001 + 1.003794541766914E+002 + + rab(1:1177) = + 5.181147531559752E-007 5.246318344710354E-007 5.312308905776035E-007 5.379129525916215E-007 + 5.446790645988750E-007 5.515302838181300E-007 5.584676807663288E-007 5.654923394258587E-007 + 5.726053574139265E-007 5.798078461540652E-007 5.871009310497938E-007 5.944857516604651E-007 + 6.019634618793240E-007 6.095352301138051E-007 6.172022394681011E-007 6.249656879280218E-007 + 6.328267885481837E-007 6.407867696415525E-007 6.488468749713680E-007 6.570083639454874E-007 + 6.652725118131673E-007 6.736406098643256E-007 6.821139656313074E-007 6.906939030931902E-007 + 6.993817628826597E-007 7.081789024954827E-007 7.170866965026219E-007 7.261065367650139E-007 + 7.352398326510501E-007 7.444880112567955E-007 7.538525176289725E-007 7.633348149907539E-007 + 7.729363849703942E-007 7.826587278327370E-007 7.925033627136357E-007 8.024718278573191E-007 + 8.125656808567469E-007 8.227864988969862E-007 8.331358790016495E-007 8.436154382824357E-007 + 8.542268141918024E-007 8.649716647788249E-007 8.758516689482673E-007 8.868685267229160E-007 + 8.980239595092143E-007 9.093197103662298E-007 9.207575442780153E-007 9.323392484293898E-007 + 9.440666324851898E-007 9.559415288730349E-007 9.679657930696443E-007 9.801413038907627E-007 + 9.924699637847271E-007 1.004953699129728E-006 1.017594460534812E-006 1.030394223144668E-006 + 1.043354986948243E-006 1.056478777091251E-006 1.069767644192601E-006 1.083223664664816E-006 + 1.096848941038471E-006 1.110645602290720E-006 1.124615804177953E-006 1.138761729572636E-006 + 1.153085588804394E-006 1.167589620005375E-006 1.182276089459960E-006 1.197147291958883E-006 + 1.212205551157789E-006 1.227453219940315E-006 1.242892680785730E-006 1.258526346141203E-006 + 1.274356658798752E-006 1.290386092276936E-006 1.306617151207350E-006 1.323052371725974E-006 + 1.339694321869451E-006 1.356545601976349E-006 1.373608845093468E-006 1.390886717387263E-006 + 1.408381918560431E-006 1.426097182273749E-006 1.444035276573215E-006 1.462199004322557E-006 + 1.480591203641192E-006 1.499214748347683E-006 1.518072548408779E-006 1.537167550394106E-006 + 1.556502737936573E-006 1.576081132198573E-006 1.595905792344042E-006 1.615979816016459E-006 + 1.636306339822865E-006 1.656888539823959E-006 1.677729632030368E-006 1.698832872905148E-006 + 1.720201559872623E-006 1.741839031833604E-006 1.763748669687107E-006 1.785933896858625E-006 + 1.808398179835038E-006 1.831145028706265E-006 1.854177997713721E-006 1.877500685805672E-006 + 1.901116737199586E-006 1.925029841951541E-006 1.949243736532804E-006 1.973762204413667E-006 + 1.998589076654618E-006 2.023728232504960E-006 2.049183600008938E-006 2.074959156619513E-006 + 2.101058929819848E-006 2.127486997752602E-006 2.154247489857163E-006 2.181344587514866E-006 + 2.208782524702347E-006 2.236565588653116E-006 2.264698120527438E-006 2.293184516090658E-006 + 2.322029226400038E-006 2.351236758500248E-006 2.380811676127602E-006 2.410758600423148E-006 + 2.441082210654739E-006 2.471787244948164E-006 2.502878501027504E-006 2.534360836964774E-006 + 2.566239171939015E-006 2.598518487004928E-006 2.631203825871162E-006 2.664300295688415E-006 + 2.697813067847431E-006 2.731747378787037E-006 2.766108530812365E-006 2.800901892923325E-006 + 2.836132901653533E-006 2.871807061919781E-006 2.907929947882188E-006 2.944507203815185E-006 + 2.981544544989423E-006 3.019047758564816E-006 3.057022704494785E-006 3.095475316441889E-006 + 3.134411602704984E-006 3.173837647158011E-006 3.213759610200630E-006 3.254183729720787E-006 + 3.295116322069398E-006 3.336563783047303E-006 3.378532588904599E-006 3.421029297352591E-006 + 3.464060548588430E-006 3.507633066332671E-006 3.551753658879864E-006 3.596429220162356E-006 + 3.641666730827491E-006 3.687473259328345E-006 3.733855963028189E-006 3.780822089318849E-006 + 3.828378976753107E-006 3.876534056191379E-006 3.925294851962802E-006 3.974668983040915E-006 + 4.024664164234162E-006 4.075288207391306E-006 4.126549022622097E-006 4.178454619533203E-006 + 4.231013108479738E-006 4.284232701832543E-006 4.338121715261342E-006 4.392688569034131E-006 + 4.447941789332826E-006 4.503890009585508E-006 4.560541971815432E-006 4.617906528006938E-006 + 4.675992641488654E-006 4.734809388333983E-006 4.794365958779279E-006 4.854671658659856E-006 + 4.915735910863997E-006 4.977568256805357E-006 5.040178357913783E-006 5.103575997144953E-006 + 5.167771080508991E-006 5.232773638618262E-006 5.298593828254731E-006 5.365241933956938E-006 + 5.432728369626991E-006 5.501063680157780E-006 5.570258543080584E-006 5.640323770233530E-006 + 5.711270309450902E-006 5.783109246273789E-006 5.855851805682244E-006 5.929509353849151E-006 + 6.004093399916281E-006 6.079615597792573E-006 6.156087747975086E-006 6.233521799392891E-006 + 6.311929851274039E-006 6.391324155036173E-006 6.471717116200782E-006 6.553121296331603E-006 + 6.635549414997417E-006 6.719014351759442E-006 6.803529148183876E-006 6.889107009879602E-006 + 6.975761308561613E-006 7.063505584140393E-006 7.152353546837499E-006 7.242319079327880E-006 + 7.333416238909019E-006 7.425659259697432E-006 7.519062554852808E-006 7.613640718830016E-006 + 7.709408529659622E-006 7.806380951256900E-006 7.904573135760011E-006 8.004000425897576E-006 + 8.104678357385942E-006 8.206622661356749E-006 8.309849266814899E-006 8.414374303127500E-006 + 8.520214102544157E-006 8.627385202748832E-006 8.735904349443996E-006 8.845788498967097E-006 + 8.957054820940050E-006 9.069720700952058E-006 9.183803743276066E-006 9.299321773619562E-006 + 9.416292841909805E-006 9.534735225114182E-006 9.654667430096070E-006 9.776108196506468E-006 + 9.899076499712226E-006 1.002359155376089E-005 1.014967281438298E-005 1.027733998203200E-005 + 1.040661300496260E-005 1.053751208234766E-005 1.067005766743432E-005 1.080427047073992E-005 + 1.094017146328803E-005 1.107778187988523E-005 1.121712322243908E-005 1.135821726331786E-005 + 1.150108604875250E-005 1.164575190228140E-005 1.179223742823849E-005 1.194056551528525E-005 + 1.209075933998703E-005 1.224284237043453E-005 1.239683836991067E-005 1.255277140060366E-005 + 1.271066582736682E-005 1.287054632152555E-005 1.303243786473235E-005 1.319636575287021E-005 + 1.336235560000518E-005 1.353043334238857E-005 1.370062524250959E-005 1.387295789319888E-005 + 1.404745822178375E-005 1.422415349429554E-005 1.440307131973008E-005 1.458423965436161E-005 + 1.476768680611099E-005 1.495344143896893E-005 1.514153257747471E-005 1.533198961125141E-005 + 1.552484229959805E-005 1.572012077613954E-005 1.591785555353513E-005 1.611807752824608E-005 + 1.632081798536332E-005 1.652610860349572E-005 1.673398145972005E-005 1.694446903459302E-005 + 1.715760421722642E-005 1.737342031042619E-005 1.759195103589596E-005 1.781323053950619E-005 + 1.803729339662952E-005 1.826417461754322E-005 1.849390965289968E-005 1.872653439926555E-005 + 1.896208520473073E-005 1.920059887458782E-005 1.944211267708297E-005 1.968666434923922E-005 + 1.993429210275286E-005 2.018503462996419E-005 2.043893110990322E-005 2.069602121441150E-005 + 2.095634511434092E-005 2.121994348583047E-005 2.148685751666198E-005 2.175712891269583E-005 + 2.203079990438751E-005 2.230791325338626E-005 2.258851225921666E-005 2.287264076604424E-005 + 2.316034316952627E-005 2.345166442374861E-005 2.374665004824996E-005 2.404534613513427E-005 + 2.434779935627284E-005 2.465405697059681E-005 2.496416683148149E-005 2.527817739422359E-005 + 2.559613772361240E-005 2.591809750159625E-005 2.624410703504553E-005 2.657421726361306E-005 + 2.690847976769371E-005 2.724694677648379E-005 2.758967117614203E-005 2.793670651805318E-005 + 2.828810702719543E-005 2.864392761061328E-005 2.900422386599683E-005 2.936905209036899E-005 + 2.973846928888204E-005 3.011253318372489E-005 3.049130222314212E-005 3.087483559056676E-005 + 3.126319321386777E-005 3.165643577471386E-005 3.205462471805531E-005 3.245782226172460E-005 + 3.286609140615823E-005 3.327949594424066E-005 3.369810047127200E-005 3.412197039506133E-005 + 3.455117194614658E-005 3.498577218814332E-005 3.542583902822355E-005 3.587144122772635E-005 + 3.632264841290203E-005 3.677953108579122E-005 3.724216063524112E-005 3.771060934806003E-005 + 3.818495042031236E-005 3.866525796875580E-005 3.915160704242192E-005 3.964407363434300E-005 + 4.014273469342593E-005 4.064766813647569E-005 4.115895286037015E-005 4.167666875438758E-005 + 4.220089671268972E-005 4.273171864696161E-005 4.326921749921042E-005 4.381347725472541E-005 + 4.436458295520066E-005 4.492262071202312E-005 4.548767771972761E-005 4.605984226962116E-005 + 4.663920376357886E-005 4.722585272801282E-005 4.781988082801728E-005 4.842138088169141E-005 + 4.903044687464234E-005 4.964717397467068E-005 5.027165854664053E-005 5.090399816753677E-005 + 5.154429164171168E-005 5.219263901632324E-005 5.284914159696790E-005 5.351390196350948E-005 + 5.418702398610776E-005 5.486861284144823E-005 5.555877502917616E-005 5.625761838853768E-005 + 5.696525211522940E-005 5.768178677846085E-005 5.840733433823093E-005 5.914200816282196E-005 + 5.988592304651383E-005 6.063919522752057E-005 6.140194240615302E-005 6.217428376320966E-005 + 6.295633997859885E-005 6.374823325019531E-005 6.455008731293397E-005 6.536202745814343E-005 + 6.618418055312332E-005 6.701667506096738E-005 6.785964106063615E-005 6.871321026728221E-005 + 6.957751605283065E-005 7.045269346681892E-005 7.133887925749847E-005 7.223621189320204E-005 + 7.314483158397969E-005 7.406488030350666E-005 7.499650181126721E-005 7.593984167501734E-005 + 7.689504729352995E-005 7.786226791962642E-005 7.884165468349733E-005 7.983336061631716E-005 + 8.083754067415551E-005 8.185435176218937E-005 8.288395275922012E-005 8.392650454249822E-005 + 8.498217001286087E-005 8.605111412018561E-005 8.713350388916391E-005 8.822950844539944E-005 + 8.933929904183390E-005 9.046304908550589E-005 9.160093416464596E-005 9.275313207611274E-005 + 9.391982285317420E-005 9.510118879363782E-005 9.629741448833534E-005 9.750868684996525E-005 + 9.873519514229839E-005 9.997713100975087E-005 1.012346885073287E-004 1.025080641309494E-004 + 1.037974568481448E-004 1.051030681291502E-004 1.064251019783847E-004 1.077637649663269E-004 + 1.091192662617922E-004 1.104918176646157E-004 1.118816336387466E-004 1.132889313457586E-004 + 1.147139306787815E-004 1.161568542968603E-004 1.176179276597459E-004 1.190973790631237E-004 + 1.205954396742859E-004 1.221123435682504E-004 1.236483277643369E-004 1.252036322632011E-004 + 1.267785000843351E-004 1.283731773040403E-004 1.299879130938764E-004 1.316229597595960E-004 + 1.332785727805669E-004 1.349550108496921E-004 1.366525359138308E-004 1.383714132147277E-004 + 1.401119113304583E-004 1.418743022173942E-004 1.436588612526969E-004 1.454658672773466E-004 + 1.472956026397111E-004 1.491483532396633E-004 1.510244085732539E-004 1.529240617779454E-004 + 1.548476096784163E-004 1.567953528329393E-004 1.587675955803451E-004 1.607646460875756E-004 + 1.627868163978353E-004 1.648344224793497E-004 1.669077842747346E-004 1.690072257509891E-004 + 1.711330749501150E-004 1.732856640403746E-004 1.754653293681931E-004 1.776724115107124E-004 + 1.799072553290076E-004 1.821702100219721E-004 1.844616291808805E-004 1.867818708446387E-004 + 1.891312975557271E-004 1.915102764168491E-004 1.939191791482920E-004 1.963583821460082E-004 + 1.988282665404292E-004 2.013292182560164E-004 2.038616280715635E-004 2.064258916812565E-004 + 2.090224097565013E-004 2.116515880085301E-004 2.143138372517938E-004 2.170095734681529E-004 + 2.197392178718759E-004 2.225031969754540E-004 2.253019426562460E-004 2.281358922239584E-004 + 2.310054884889769E-004 2.339111798315561E-004 2.368534202718798E-004 2.398326695410031E-004 + 2.428493931526857E-004 2.459040624761293E-004 2.489971548096305E-004 2.521291534551590E-004 + 2.553005477938759E-004 2.585118333625987E-004 2.617635119312307E-004 2.650560915811640E-004 + 2.683900867846674E-004 2.717660184852751E-004 2.751844141791833E-004 2.786458079976741E-004 + 2.821507407905738E-004 2.856997602107619E-004 2.892934207997439E-004 2.929322840742979E-004 + 2.966169186142139E-004 3.003479001511351E-004 3.041258116585172E-004 3.079512434427201E-004 + 3.118247932352424E-004 3.157470662861203E-004 3.197186754584978E-004 3.237402413243881E-004 + 3.278123922616402E-004 3.319357645521228E-004 3.361110024811452E-004 3.403387584381283E-004 + 3.446196930185418E-004 3.489544751271238E-004 3.533437820823979E-004 3.577882997225059E-004 + 3.622887225123715E-004 3.668457536522114E-004 3.714601051874134E-004 3.761324981197922E-004 + 3.808636625202498E-004 3.856543376428494E-004 3.905052720403251E-004 3.954172236810467E-004 + 4.003909600674509E-004 4.054272583559676E-004 4.105269054784504E-004 4.156906982651374E-004 + 4.209194435691580E-004 4.262139583926034E-004 4.315750700141870E-004 4.370036161185063E-004 + 4.425004449269347E-004 4.480664153301573E-004 4.537023970223735E-004 4.594092706371892E-004 + 4.651879278852174E-004 4.710392716934093E-004 4.769642163461406E-004 4.829636876280673E-004 + 4.890386229687831E-004 4.951899715892946E-004 5.014186946503383E-004 5.077257654025659E-004 + 5.141121693386135E-004 5.205789043470899E-004 5.271269808684963E-004 5.337574220531113E-004 + 5.404712639208603E-004 5.472695555231945E-004 5.541533591070075E-004 5.611237502806148E-004 + 5.681818181818183E-004 5.753286656480879E-004 5.825654093888803E-004 5.898931801601282E-004 + 5.973131229409232E-004 6.048263971124201E-004 6.124341766389953E-004 6.201376502516774E-004 + 6.279380216338911E-004 6.358365096095349E-004 6.438343483334241E-004 6.519327874841322E-004 + 6.601330924592520E-004 6.684365445731200E-004 6.768444412570221E-004 6.853580962619208E-004 + 6.939788398637331E-004 7.027080190711849E-004 7.115469978362871E-004 7.204971572674548E-004 + 7.295598958453076E-004 7.387366296411883E-004 7.480287925384216E-004 7.574378364563657E-004 + 7.669652315772751E-004 7.766124665760207E-004 7.863810488526997E-004 7.962725047681670E-004 + 8.062883798825330E-004 8.164302391966623E-004 8.266996673967054E-004 8.370982691017136E-004 + 8.476276691143585E-004 8.582895126748145E-004 8.690854657178294E-004 8.800172151330303E-004 + 8.910864690285053E-004 9.022949569976956E-004 9.136444303896499E-004 9.251366625826768E-004 + 9.367734492614365E-004 9.485566086975246E-004 9.604879820335750E-004 9.725694335709462E-004 + 9.848028510610208E-004 9.971901460001696E-004 1.009733253928431E-003 1.022434134731937E-003 + 1.035294772949153E-003 1.048317178080966E-003 1.061503384904672E-003 1.074855453791915E-003 + 1.088375471030623E-003 1.102065549150997E-003 1.115927827255596E-003 1.129964471353575E-003 + 1.144177674699135E-003 1.158569658134213E-003 1.173142670435504E-003 1.187898988665828E-003 + 1.202840918529929E-003 1.217970794734750E-003 1.233290981354229E-003 1.248803872198695E-003 + 1.264511891188903E-003 1.280417492734778E-003 1.296523162118923E-003 1.312831415884946E-003 + 1.329344802230677E-003 1.346065901406330E-003 1.362997326117669E-003 1.380141721934255E-003 + 1.397501767702813E-003 1.415080175965814E-003 1.432879693385312E-003 1.450903101172117E-003 + 1.469153215520368E-003 1.487632888047558E-003 1.506345006240118E-003 1.525292493904587E-003 + 1.544478311624458E-003 1.563905457222788E-003 1.583576966230597E-003 1.603495912361193E-003 + 1.623665407990435E-003 1.644088604643046E-003 1.664768693485060E-003 1.685708905822425E-003 + 1.706912513605927E-003 1.728382829942424E-003 1.750123209612518E-003 1.772137049594770E-003 + 1.794427789596460E-003 1.816998912591065E-003 1.839853945362479E-003 1.862996459056064E-003 + 1.886430069736677E-003 1.910158438953654E-003 1.934185274312965E-003 1.958514330056521E-003 + 1.983149407648774E-003 2.008094356370723E-003 2.033353073921353E-003 2.058929507026671E-003 + 2.084827652056390E-003 2.111051555648355E-003 2.137605315340861E-003 2.164493080212876E-003 + 2.191719051532371E-003 2.219287483412759E-003 2.247202683477601E-003 2.275469013533710E-003 + 2.304090890252657E-003 2.333072785860916E-003 2.362419228838643E-003 2.392134804627250E-003 + 2.422224156345922E-003 2.452691985517071E-003 2.483543052800998E-003 2.514782178739738E-003 + 2.546414244510264E-003 2.578444192687220E-003 2.610877028015165E-003 2.643717818190608E-003 + 2.676971694653832E-003 2.710643853390683E-003 2.744739555744479E-003 2.779264129238072E-003 + 2.814222968406315E-003 2.849621535638956E-003 2.885465362034137E-003 2.921760048262666E-003 + 2.958511265443097E-003 2.995724756027892E-003 3.033406334700671E-003 3.071561889284754E-003 + 3.110197381663185E-003 3.149318848710241E-003 3.188932403234747E-003 3.229044234935198E-003 + 3.269660611366893E-003 3.310787878921295E-003 3.352432463817624E-003 3.394600873107001E-003 + 3.437299695689176E-003 3.480535603342038E-003 3.524315351764132E-003 3.568645781630208E-003 + 3.613533819660130E-003 3.658986479701173E-003 3.705010863823927E-003 3.751614163432065E-003 + 3.798803660385950E-003 3.846586728140497E-003 3.894970832897263E-003 3.943963534771043E-003 + 3.993572488971193E-003 4.043805446997725E-003 4.094670257852537E-003 4.146174869265817E-003 + 4.198327328937870E-003 4.251135785796640E-003 4.304608491270937E-003 4.358753800579789E-003 + 4.413580174037942E-003 4.469096178377779E-003 4.525310488087944E-003 4.582231886768679E-003 + 4.639869268504344E-003 4.698231639253110E-003 4.757328118254128E-003 4.817167939452490E-003 + 4.877760452941987E-003 4.939115126426138E-003 5.001241546697508E-003 5.064149421135647E-003 + 5.127848579223938E-003 5.192348974085414E-003 5.257660684038006E-003 5.323793914169282E-003 + 5.390758997930981E-003 5.458566398753700E-003 5.527226711681755E-003 5.596750665028739E-003 + 5.667149122053823E-003 5.738433082659122E-003 5.810613685108528E-003 5.883702207768009E-003 + 5.957710070867938E-003 6.032648838287507E-003 6.108530219361565E-003 6.185366070710312E-003 + 6.263168398091822E-003 6.341949358278049E-003 6.421721260954312E-003 6.502496570642682E-003 + 6.584287908649661E-003 6.667108055038191E-003 6.750969950624657E-003 6.835886699000875E-003 + 6.921871568581518E-003 7.008937994677424E-003 7.097099581594781E-003 7.186370104760921E-003 + 7.276763512876729E-003 7.368293930096099E-003 7.460975658232971E-003 7.554823178995903E-003 + 7.649851156250971E-003 7.746074438312935E-003 7.843508060265394E-003 7.942167246310026E-003 + 8.042067412145346E-003 8.143224167375540E-003 8.245653317949389E-003 8.349370868630081E-003 + 8.454393025495938E-003 8.560736198472609E-003 8.668417003897260E-003 8.777452267114788E-003 + 8.887859025106916E-003 8.999654529154223E-003 9.112856247531635E-003 9.227481868237988E-003 + 9.343549301759695E-003 9.461076683869401E-003 9.580082378459687E-003 9.700584980412421E-003 + 9.822603318504354E-003 9.946156458349030E-003 1.007126370537594E-002 1.019794460784696E-002 + 1.032621895991083E-002 1.045610680469606E-002 1.058762843744262E-002 1.072080440867323E-002 + 1.085565552740436E-002 1.099220286439762E-002 1.113046775545228E-002 1.127047180473883E-002 + 1.141223688817481E-002 1.155578515684297E-002 1.170113904045229E-002 1.184832125084286E-002 + 1.199735478553445E-002 1.214826293132008E-002 1.230106926790459E-002 1.245579767158891E-002 + 1.261247231900095E-002 1.277111769087308E-002 1.293175857586746E-002 1.309442007444921E-002 + 1.325912760280837E-002 1.342590689683139E-002 1.359478401612224E-002 1.376578534807442E-002 + 1.393893761199396E-002 1.411426786327435E-002 1.429180349762409E-002 1.447157225534721E-002 + 1.465360222567788E-002 1.483792185116931E-002 1.502455993213796E-002 1.521354563116373E-002 + 1.540490847764654E-002 1.559867837242051E-002 1.579488559242596E-002 1.599356079544014E-002 + 1.619473502486779E-002 1.639843971459150E-002 1.660470669388349E-002 1.681356819237897E-002 + 1.702505684511195E-002 1.723920569761475E-002 1.745604821108121E-002 1.767561826759526E-002 + 1.789795017542498E-002 1.812307867438324E-002 1.835103894125609E-002 1.858186659529896E-002 + 1.881559770380245E-002 1.905226878772782E-002 1.929191682741338E-002 1.953457926835297E-002 + 1.978029402704662E-002 2.002909949692531E-002 2.028103455434995E-002 2.053613856468576E-002 + 2.079445138845343E-002 2.105601338755716E-002 2.132086543159148E-002 2.158904890422716E-002 + 2.186060570967735E-002 2.213557827924547E-002 2.241400957795486E-002 2.269594311126246E-002 + 2.298142293185650E-002 2.327049364653966E-002 2.356320042319933E-002 2.385958899786478E-002 + 2.415970568185385E-002 2.446359736900907E-002 2.477131154302472E-002 2.508289628486664E-002 + 2.539840028028458E-002 2.571787282741975E-002 2.604136384450768E-002 2.636892387767783E-002 + 2.670060410885191E-002 2.703645636374074E-002 2.737653311994251E-002 2.772088751514231E-002 + 2.806957335541488E-002 2.842264512363228E-002 2.878015798797651E-002 2.914216781056006E-002 + 2.950873115615426E-002 2.987990530102753E-002 3.025574824189528E-002 3.063631870498158E-002 + 3.102167615519559E-002 3.141188080542300E-002 3.180699362593418E-002 3.220707635391129E-002 + 3.261219150309445E-002 3.302240237355000E-002 3.343777306156106E-002 3.385836846964261E-002 + 3.428425431668299E-002 3.471549714821214E-002 3.515216434679994E-002 3.559432414258461E-002 + 3.604204562393372E-002 3.649539874823975E-002 3.695445435285057E-002 3.741928416613847E-002 + 3.788996081870751E-002 3.836655785474213E-002 3.884914974349899E-002 3.933781189094241E-002 + 3.983262065152719E-002 4.033365334012894E-002 4.084098824412447E-002 4.135470463562486E-002 + 4.187488278386128E-002 4.240160396772780E-002 4.293495048848107E-002 4.347500568259994E-002 + 4.402185393480737E-002 4.457558069125520E-002 4.513627247287576E-002 4.570401688890074E-002 + 4.627890265055008E-002 4.686101958489382E-002 4.745045864888709E-002 4.804731194358296E-002 + 4.865167272852311E-002 4.926363543630961E-002 4.988329568736075E-002 5.051075030485133E-002 + 5.114609732984193E-002 5.178943603659798E-002 5.244086694810107E-002 5.310049185175667E-002 + 5.376841381529782E-002 5.444473720289027E-002 5.512956769143945E-002 5.582301228710232E-002 + 5.652517934200793E-002 5.723617857118701E-002 5.795612106971574E-002 5.868511933007436E-002 + 5.942328725972399E-002 6.017074019890570E-002 6.092759493866168E-002 6.169396973908500E-002 + 6.246998434779751E-002 6.325576001866043E-002 6.405141953072122E-002 6.485708720739718E-002 + 6.567288893590209E-002 6.649895218691586E-002 6.733540603450190E-002 6.818238117627588E-002 + 6.904000995382668E-002 6.990842637339577E-002 7.078776612681560E-002 7.167816661271147E-002 + 7.257976695797104E-002 7.349270803948237E-002 7.441713250614694E-002 7.535318480116857E-002 + 7.630101118462246E-002 7.726075975630974E-002 7.823258047889700E-002 7.921662520134953E-002 + 8.021304768265740E-002 8.122200361586024E-002 8.224365065237565E-002 8.327814842663135E-002 + 8.432565858100943E-002 8.538634479110284E-002 8.646037279128956E-002 8.754791040063008E-002 + 8.864912754908813E-002 8.976419630408379E-002 9.089329089737880E-002 9.203658775230021E-002 + 9.319426551130795E-002 9.436650506390688E-002 9.555348957491219E-002 9.675540451306884E-002 + 9.797243768003089E-002 9.920477923970708E-002 1.004526217479730E-001 1.017161601827595E-001 + 1.029955919745178E-001 1.042911170370682E-001 1.056029377988377E-001 1.069312592344889E-001 + 1.082762888969489E-001 1.096382369498390E-001 1.110173162003130E-001 1.124137421323101E-001 + 1.138277329402226E-001 1.152595095629914E-001 1.167092957186269E-001 1.181773179391651E-001 + 1.196638056060652E-001 1.211689909860489E-001 1.226931092673944E-001 1.242363985966842E-001 + 1.257991001160154E-001 1.273814580006803E-001 1.289837194973171E-001 1.306061349625448E-001 + 1.322489579020809E-001 1.339124450103515E-001 1.355968562106022E-001 1.373024546955095E-001 + 1.390295069683070E-001 1.407782828844263E-001 1.425490556936617E-001 1.443421020828678E-001 + 1.461577022191903E-001 1.479961397938448E-001 1.498577020664427E-001 1.517426799098762E-001 + 1.536513678557687E-001 1.555840641404946E-001 1.575410707517807E-001 1.595226934758918E-001 + 1.615292419454096E-001 1.635610296876155E-001 1.656183741734774E-001 1.677015968672570E-001 + 1.698110232767390E-001 1.719469830040908E-001 1.741098097973662E-001 1.762998416026514E-001 + 1.785174206168717E-001 1.807628933412603E-001 1.830366106354980E-001 1.853389277725388E-001 + 1.876702044941187E-001 1.900308050669688E-001 1.924210983397316E-001 1.948414578005934E-001 + 1.972922616356449E-001 1.997738927879709E-001 2.022867390174881E-001 2.048311929615328E-001 + 2.074076521962096E-001 2.100165192985166E-001 2.126582019092456E-001 2.153331127966793E-001 + 2.180416699210865E-001 2.207842965000277E-001 2.235614210744866E-001 2.263734775758273E-001 + 2.292209053935995E-001 2.321041494441935E-001 2.350236602403573E-001 2.379798939615934E-001 + 2.409733125254344E-001 2.440043836596216E-001 2.470735809751867E-001 2.501813840404539E-001 + 2.533282784559759E-001 2.565147559304066E-001 2.597413143573347E-001 2.630084578930793E-001 + 2.663166970354642E-001 2.696665487035869E-001 2.730585363185848E-001 2.764931898854245E-001 + 2.799710460757140E-001 2.834926483115580E-001 2.870585468504713E-001 2.906692988713547E-001 + 2.943254685615579E-001 2.980276272050343E-001 3.017763532716029E-001 3.055722325073394E-001 + 3.094158580260963E-001 3.133078304021811E-001 3.172487577641966E-001 3.212392558900598E-001 + 3.252799483032227E-001 3.293714663700946E-001 3.335144493986982E-001 3.377095447385615E-001 + 3.419574078818649E-001 3.462587025658683E-001 3.506141008766157E-001 3.550242833539551E-001 + 3.594899390978716E-001 3.640117658761596E-001 3.685904702334540E-001 3.732267676016249E-001 + 3.779213824115693E-001 3.826750482064031E-001 3.874885077560770E-001 3.923625131734400E-001 + 3.972978260317533E-001 4.022952174836928E-001 4.073554683818409E-001 4.124793694006940E-001 + 4.176677211602125E-001 4.229213343509131E-001 4.282410298605462E-001 4.336276389023589E-001 + 4.390820031449716E-001 4.446049748438958E-001 4.501974169746943E-001 4.558602033678290E-001 + 4.615942188451954E-001 4.674003593583764E-001 4.732795321286414E-001 4.792326557886952E-001 + 4.852606605262225E-001 4.913644882292283E-001 4.975450926332079E-001 5.038034394701757E-001 + 5.101405066195559E-001 5.165572842609842E-001 5.230547750290233E-001 5.296339941698229E-001 + 5.362959696997612E-001 5.430417425660669E-001 5.498723668094754E-001 5.567889097289228E-001 + 5.637924520483104E-001 5.708840880853761E-001 5.780649259226769E-001 5.853360875807352E-001 + 5.926987091933545E-001 6.001539411851393E-001 6.077029484512581E-001 6.153469105394525E-001 + 6.230870218343515E-001 6.309244917440938E-001 6.388605448892958E-001 6.468964212944098E-001 + 6.550333765814709E-001 6.632726821662985E-001 6.716156254571546E-001 6.800635100558998E-001 + 6.886176559616923E-001 6.972793997772312E-001 7.060500949176114E-001 7.149311118217936E-001 + 7.239238381667352E-001 7.330296790842263E-001 7.422500573804335E-001 7.515864137582259E-001 + 7.610402070422837E-001 7.706129144070388E-001 7.803060316074957E-001 7.901210732129347E-001 + 8.000595728435771E-001 8.101230834102116E-001 8.203131773568355E-001 8.306314469063634E-001 + 8.410795043094015E-001 8.516589820961773E-001 8.623715333316211E-001 8.732188318736548E-001 + 8.842025726347478E-001 8.953244718467377E-001 9.065862673290053E-001 9.179897187600088E-001 + 9.295366079522313E-001 9.412287391306052E-001 9.530679392144110E-001 9.650560581027513E-001 + 9.771949689635934E-001 9.894865685264529E-001 1.001932777378773E+000 1.014535540266004E+000 + 1.027296826395490E+000 1.040218629744155E+000 1.053302969370056E+000 1.066551889727885E+000 + 1.079967460988398E+000 1.093551779361902E+000 1.107306967425781E+000 1.121235174456152E+000 + 1.135338576763705E+000 1.149619378033739E+000 1.164079809670510E+000 1.178722131145883E+000 + 1.193548630352374E+000 1.208561623960653E+000 1.223763457781511E+000 1.239156507132415E+000 + 1.254743177208643E+000 +/ +&local +vloc(1:1177) = +-8.055763997176067E+000 -8.055770284309713E+000 -8.055776492429622E+000 -8.055782635699529E+000 +-8.055788727947256E+000 -8.055794782674921E+000 -8.055800813068915E+000 -8.055806832009555E+000 +-8.055812852080628E+000 -8.055818885578557E+000 -8.055824944521502E+000 -8.055831040658109E+000 +-8.055837185476090E+000 -8.055843390210656E+000 -8.055849665852616E+000 -8.055856023156451E+000 +-8.055862472648020E+000 -8.055869024632218E+000 -8.055875786323492E+000 -8.055880957778051E+000 +-8.055888255781426E+000 -8.055895738521572E+000 -8.055903410670915E+000 -8.055910500770020E+000 +-8.055918539459865E+000 -8.055926781636328E+000 -8.055933732892964E+000 -8.055942349812213E+000 +-8.055950325494775E+000 -8.055959355757739E+000 -8.055968614612315E+000 -8.055978107831075E+000 +-8.055986179639502E+000 -8.055995168393409E+000 -8.056005318409786E+000 -8.056015725356234E+000 +-8.056026395736705E+000 -8.056037336209732E+000 -8.056048553646777E+000 -8.056058894372564E+000 +-8.056068833223367E+000 -8.056080833725485E+000 -8.056093138001685E+000 -8.056105753715398E+000 +-8.056117441014869E+000 -8.056130666119138E+000 -8.056144226003958E+000 -8.056158129121872E+000 +-8.056170305625850E+000 -8.056184861610710E+000 -8.056199786048646E+000 -8.056213683567924E+000 +-8.056229332270723E+000 -8.056245377066464E+000 -8.056261828013028E+000 -8.056278695363121E+000 +-8.056295989662575E+000 -8.056311308702368E+000 -8.056327864385674E+000 -8.056346391794886E+000 +-8.056365388132622E+000 -8.056384865284496E+000 -8.056404835451019E+000 -8.056425311078010E+000 +-8.056446304991262E+000 -8.056467830309144E+000 -8.056487907759434E+000 -8.056507895677100E+000 +-8.056530969665275E+000 -8.056554627684640E+000 -8.056578884478045E+000 -8.056603755293423E+000 +-8.056629255618120E+000 -8.056655401351431E+000 -8.056682208838909E+000 -8.056707410160820E+000 +-8.056735529717889E+000 -8.056764361012098E+000 -8.056790882686061E+000 -8.056821110249331E+000 +-8.056852102862885E+000 -8.056883879887504E+000 -8.056916461128914E+000 -8.056949866915932E+000 +-8.056984118184808E+000 -8.057016599280104E+000 -8.057052535669714E+000 -8.057089381609739E+000 +-8.057127160017028E+000 -8.057165894591595E+000 -8.057205609523860E+000 -8.057242640425351E+000 +-8.057284293501564E+000 -8.057327000676521E+000 -8.057370788686713E+000 -8.057415684877620E+000 +-8.057461717355382E+000 -8.057505785038199E+000 -8.057554094432188E+000 -8.057603626444243E+000 +-8.057654411877275E+000 -8.057706482613458E+000 -8.057759871039002E+000 -8.057814610384508E+000 +-8.057870735043476E+000 -8.057928279948472E+000 -8.057982683490884E+000 -8.058043057792286E+000 +-8.058104959800618E+000 -8.058168428333472E+000 -8.058233502925214E+000 -8.058296436538917E+000 +-8.058364747390039E+000 -8.058434786724661E+000 -8.058506598313222E+000 -8.058580226852049E+000 +-8.058655718449852E+000 -8.058733120136056E+000 -8.058812480225988E+000 -8.058893848111486E+000 +-8.058977274619835E+000 -8.059062812079844E+000 -8.059150513641377E+000 -8.059240434059731E+000 +-8.059326640760066E+000 -8.059421014408453E+000 -8.059517775584620E+000 -8.059616984609740E+000 +-8.059713970819615E+000 -8.059818141275054E+000 -8.059924946909756E+000 -8.060034454468992E+000 +-8.060146732311573E+000 -8.060261850223874E+000 -8.060379880192535E+000 -8.060500896061528E+000 +-8.060624972962115E+000 -8.060752188255508E+000 -8.060882621167975E+000 -8.061016353115519E+000 +-8.061153467519699E+000 -8.061294049874293E+000 -8.061438187631106E+000 -8.061585970307490E+000 +-8.061737490543710E+000 -8.061892842564001E+000 -8.062052123528531E+000 -8.062215432190490E+000 +-8.062374189862231E+000 -8.062545640463858E+000 -8.062721426199841E+000 -8.062895228648394E+000 +-8.063079852403906E+000 -8.063269143457623E+000 -8.063463220918580E+000 -8.063662204772562E+000 +-8.063866219317672E+000 -8.064075391177889E+000 -8.064289850739073E+000 -8.064509732280227E+000 +-8.064735171773075E+000 -8.064966309937615E+000 -8.065203290314615E+000 -8.065446260261675E+000 +-8.065695371711440E+000 -8.065950778541785E+000 -8.066212639833262E+000 -8.066481118564878E+000 +-8.066756381733775E+000 -8.067038601130049E+000 -8.067327950949036E+000 -8.067624611486217E+000 +-8.067928767528162E+000 -8.068240607572196E+000 -8.068560325735179E+000 -8.068888119750081E+000 +-8.069224193565931E+000 -8.069568756496652E+000 -8.069922021563270E+000 -8.070284208511229E+000 +-8.070655541813448E+000 -8.071021532602344E+000 -8.071411484398544E+000 -8.071801593504279E+000 +-8.072211240020287E+000 -8.072631228099416E+000 -8.073061817288547E+000 -8.073503274954508E+000 +-8.073955874826144E+000 -8.074419898489086E+000 -8.074895632888396E+000 -8.075383373490329E+000 +-8.075883421439244E+000 -8.076396085580267E+000 -8.076921683239625E+000 -8.077460538145028E+000 +-8.078012984847202E+000 -8.078579364997298E+000 -8.079160029020674E+000 -8.079755336795762E+000 +-8.080365654433058E+000 -8.080991359586786E+000 -8.081632838110316E+000 -8.082290485742513E+000 +-8.082964709863244E+000 -8.083655924511158E+000 -8.084364557667751E+000 -8.085091045056265E+000 +-8.085835833756622E+000 -8.086599383809606E+000 -8.087382162550190E+000 -8.088184654604019E+000 +-8.089007352446467E+000 -8.089850761932739E+000 -8.090715403748630E+000 -8.091601805291555E+000 +-8.092510513735032E+000 -8.093442085943190E+000 -8.094397093433292E+000 -8.095376123977836E+000 +-8.096379775117413E+000 -8.097408664753631E+000 -8.098463421062721E+000 -8.099544689881078E+000 +-8.100653134946418E+000 -8.101789430066635E+000 -8.102954272797557E+000 -8.104148373834290E+000 +-8.105372459673982E+000 -8.106627280333120E+000 -8.107913597625009E+000 -8.109232197273366E+000 +-8.110583883165772E+000 -8.111969476920121E+000 -8.113389822905420E+000 -8.114845782571308E+000 +-8.116338238784705E+000 -8.117829060810639E+000 -8.119377002329319E+000 -8.120982993986647E+000 +-8.122629203183749E+000 -8.124316622092209E+000 -8.126046275105020E+000 -8.127819205572635E+000 +-8.129636481926894E+000 -8.131499202987589E+000 -8.133408490544179E+000 -8.135365489314340E+000 +-8.137371375974858E+000 -8.139427360173787E+000 -8.141534674271369E+000 -8.143694575809402E+000 +-8.145908358447567E+000 -8.148177346789625E+000 -8.150502898291913E+000 -8.152886403238590E+000 +-8.155329278444805E+000 -8.157832974116241E+000 -8.160398976944085E+000 -8.163028814842614E+000 +-8.165724049308198E+000 -8.168486268949763E+000 -8.171317111652971E+000 -8.174218250030080E+000 +-8.177191387248904E+000 -8.180238278474086E+000 -8.183360716494732E+000 -8.186560529076685E+000 +-8.189839588679295E+000 -8.193199815802563E+000 -8.196643172365874E+000 -8.200171661336041E+000 +-8.203787337651940E+000 -8.207492300236769E+000 -8.211288694737762E+000 -8.215178718842028E+000 +-8.219164619073441E+000 -8.223248690376231E+000 -8.227433274793011E+000 -8.231720775396150E+000 +-8.236113651131189E+000 -8.240614405874723E+000 -8.245225599249371E+000 -8.249949858001004E+000 +-8.254789858269049E+000 -8.259748327964488E+000 -8.264828070950657E+000 -8.270031945861543E+000 +-8.275362866667468E+000 -8.280823815869118E+000 -8.286417835442942E+000 -8.292148035815851E+000 +-8.298017597013043E+000 -8.304029759439384E+000 -8.310187832017403E+000 -8.316495196182933E+000 +-8.322955297073989E+000 -8.329571655433446E+000 -8.336347872601282E+000 -8.343287608214913E+000 +-8.350394597949697E+000 -8.357672666964801E+000 -8.365125706307957E+000 -8.372757676359193E+000 +-8.380572622239905E+000 -8.388574675345637E+000 -8.396768041685609E+000 -8.405157001499553E+000 +-8.413745923823019E+000 -8.422539260238848E+000 -8.431541537387577E+000 -8.440757367797755E+000 +-8.450191455804575E+000 -8.459848590108230E+000 -8.469733636165621E+000 -8.479851545155800E+000 +-8.490207364594411E+000 -8.500806226203718E+000 -8.511653339085720E+000 -8.522754007688111E+000 +-8.534113626226135E+000 -8.545737669716848E+000 -8.557631708247664E+000 -8.569801394607762E+000 +-8.582252465177573E+000 -8.594990749899655E+000 -8.608022162824174E+000 -8.621352702203660E+000 +-8.634988450962503E+000 -8.648935581921455E+000 -8.663200349006338E+000 -8.677789086359118E+000 +-8.692708211880561E+000 -8.707964215922553E+000 -8.723563670754650E+000 -8.739513232842173E+000 +-8.755819629911848E+000 -8.772489658139580E+000 -8.789530181631340E+000 -8.806948133262894E+000 +-8.824750513890395E+000 -8.842944386134457E+000 -8.861536866622762E+000 -8.880535124454862E+000 +-8.899946389123450E+000 -8.919777933547405E+000 -8.940037062821956E+000 -8.960731128631549E+000 +-8.981867518644961E+000 -9.003453642147077E+000 -9.025496931195747E+000 -9.048004833327438E+000 +-9.070984806147797E+000 -9.094444308293387E+000 -9.118390793523842E+000 -9.142831709980209E+000 +-9.167774480624097E+000 -9.193226494520635E+000 -9.219195108260498E+000 -9.245687637808242E+000 +-9.272711338199864E+000 -9.300273395703787E+000 -9.328380929286174E+000 -9.357040961912617E+000 +-9.386260414082154E+000 -9.416046108077545E+000 -9.446404731745067E+000 -9.477342834261302E+000 +-9.508866825110109E+000 -9.540982942946075E+000 -9.573697244768548E+000 -9.607015592408501E+000 +-9.640943642681018E+000 -9.675486824978821E+000 -9.710650320496535E+000 -9.746439058274891E+000 +-9.782857682248423E+000 -9.819910534967995E+000 -9.857601649423648E+000 -9.895934724341483E+000 +-9.934913102082835E+000 -9.974539742377488E+000 -1.001481720775979E+001 -1.005574765209258E+001 +-1.009733278417058E+001 -1.013957384337448E+001 -1.018247158952427E+001 -1.022602627255571E+001 +-1.027023760731241E+001 -1.031510474887048E+001 -1.036062627640271E+001 -1.040680016475738E+001 +-1.045362375222514E+001 -1.050109372529177E+001 -1.054920608987991E+001 -1.059795614600240E+001 +-1.064733846343896E+001 -1.069734685383724E+001 -1.074797434847863E+001 -1.079921317318857E+001 +-1.085105472211488E+001 -1.090348953363483E+001 -1.095650726529173E+001 -1.101009667208498E+001 +-1.106424557759697E+001 -1.111894085769401E+001 -1.117416842144439E+001 -1.122991317689045E+001 +-1.128615901830865E+001 -1.134288880542460E+001 -1.140008434370531E+001 -1.145772637029019E+001 +-1.151579453197092E+001 -1.157426737474377E+001 -1.163312232469947E+001 -1.169233567585004E+001 +-1.175188258762865E+001 -1.181173706633315E+001 -1.187187195717186E+001 -1.193225894337732E+001 +-1.199286854180911E+001 -1.205367009971575E+001 -1.211463179312866E+001 -1.217572063087328E+001 +-1.223690245649713E+001 -1.229814196067886E+001 -1.235940268808131E+001 -1.242064704374040E+001 +-1.248183631705532E+001 -1.254293069326405E+001 -1.260388927198389E+001 -1.266467009491749E+001 +-1.272523016388758E+001 -1.278552547200504E+001 -1.284551103565009E+001 -1.290514092776462E+001 +-1.296436831632722E+001 -1.302314549959704E+001 -1.308142395031486E+001 -1.313915435964418E+001 +-1.319628668608765E+001 -1.325277021257172E+001 -1.330855359467878E+001 -1.336358491319812E+001 +-1.341781173944171E+001 -1.347118119908575E+001 -1.352364003559137E+001 -1.357513467674197E+001 +-1.362561130447232E+001 -1.367501592920116E+001 -1.372329446549030E+001 -1.377039281016442E+001 +-1.381625691982922E+001 -1.386083289494457E+001 -1.390406706773376E+001 -1.394590608377310E+001 +-1.398629699072090E+001 -1.402518733153028E+001 -1.406252523412834E+001 -1.409825950574224E+001 +-1.413233973075262E+001 -1.416471636374759E+001 -1.419534082752325E+001 -1.422416561546239E+001 +-1.425114438806332E+001 -1.427623207505352E+001 -1.429938497838362E+001 -1.432056087232074E+001 +-1.433971910770477E+001 -1.435682071317947E+001 -1.437182849870193E+001 -1.438470715878316E+001 +-1.439542337417535E+001 -1.440394591451134E+001 -1.441024573652158E+001 -1.441429608529036E+001 +-1.441607259433224E+001 -1.441555337980003E+001 -1.441271913558736E+001 -1.440755322605094E+001 +-1.440004177566163E+001 -1.439017375516461E+001 -1.437794106363054E+001 -1.436333860882407E+001 +-1.434636438219002E+001 -1.432701952882549E+001 -1.430530841125816E+001 -1.428123866887018E+001 +-1.425482127149334E+001 -1.422607056433163E+001 -1.419500430704093E+001 -1.416164370438351E+001 +-1.412601342893987E+001 -1.408814163501600E+001 -1.404805996258293E+001 -1.400580353246496E+001 +-1.396141093058085E+001 -1.391492418065927E+001 -1.386638870748982E+001 -1.381585328846294E+001 +-1.376336999189896E+001 -1.370899410535785E+001 -1.365278405155915E+001 -1.359480129065470E+001 +-1.353511021118492E+001 -1.347377800956062E+001 -1.341087455712079E+001 -1.334647225486714E+001 +-1.328064587732172E+001 -1.321347240556882E+001 -1.314503084944953E+001 -1.307540206008800E+001 +-1.300466853339831E+001 -1.293291420526556E+001 -1.286022423895226E+001 -1.278668480641658E+001 +-1.271238286427913E+001 -1.263740592478950E+001 -1.256184182421756E+001 -1.248577848930240E+001 +-1.240930370255545E+001 -1.233250486823096E+001 -1.225546878008845E+001 -1.217828139226253E+001 +-1.210102759435813E+001 -1.202379099191798E+001 -1.194665369376763E+001 -1.186969610718727E+001 +-1.179299674194595E+001 -1.171663202426062E+001 -1.164067612160114E+001 -1.156520077921395E+001 +-1.149027516906040E+001 -1.141596575182828E+001 -1.134233615252144E+001 -1.126944705011086E+001 +-1.119735608154489E+001 -1.112611776030215E+001 -1.105578340959877E+001 -1.098640111024493E+001 +-1.091801566302331E+001 -1.085066856536233E+001 -1.078439800206024E+001 -1.071923884955533E+001 +-1.065522269331204E+001 -1.059237785782056E+001 -1.053072944850924E+001 -1.047029940494794E+001 +-1.041110656455967E+001 -1.035316673608812E+001 -1.029649278205090E+001 -1.024109470942810E+001 +-1.018697976756537E+001 -1.013415255247601E+001 -1.008261511697757E+001 -1.003236708545210E+001 +-9.983405772535807E+000 -9.935726305125749E+000 -9.889321746611463E+000 -9.844183222796007E+000 +-9.800300048720295E+000 -9.757659855668640E+000 -9.716248717840239E+000 -9.676051277960063E+000 +-9.637050871334512E+000 -9.599229647771670E+000 -9.562568690995423E+000 -9.527048135193324E+000 +-9.492647278116808E+000 -9.459344690535071E+000 -9.427118321785597E+000 -9.395945601070656E+000 +-9.365803534417072E+000 -9.336668797080284E+000 -9.308517821272860E+000 -9.281326879132708E+000 +-9.255072160847146E+000 -9.229729847950717E+000 -9.205276181783534E+000 -9.181687527184945E+000 +-9.158940431374281E+000 -9.137011678159345E+000 -9.115878337639932E+000 -9.095517811342237E+000 +-9.075907873049925E+000 -9.057026705469729E+000 -9.038852932746551E+000 -9.021365649177264E+000 +-9.004544444191115E+000 -8.988369423694435E+000 -8.972821228076237E+000 -8.957881046995908E+000 +-8.943530631161165E+000 -8.929752301220542E+000 -8.916528953957812E+000 -8.903844066026828E+000 +-8.891681695318272E+000 -8.880026480155749E+000 -8.868863636470666E+000 -8.858178953120127E+000 +-8.847958785505392E+000 -8.838190047611626E+000 -8.828860202651759E+000 -8.819957252367745E+000 +-8.811469725172648E+000 -8.803386663259079E+000 -8.795697608720873E+000 -8.788392588876089E+000 +-8.781462100837521E+000 -8.774897095432207E+000 -8.768688960544338E+000 -8.762829503984177E+000 +-8.757310935982117E+000 -8.752125851327975E+000 -8.747267211260372E+000 -8.742728325139746E+000 +-8.738502832009978E+000 -8.734584682101231E+000 -8.730968118282474E+000 -8.727647657589770E+000 +-8.724618072851070E+000 -8.721874374460281E+000 -8.719411792400074E+000 -8.717225758537170E+000 +-8.715311889264902E+000 -8.713665968562188E+000 -8.712283931561705E+000 -8.711161848700399E+000 +-8.710295910496116E+000 -8.709682413098740E+000 -8.709317744694058E+000 -8.709198372858058E+000 +-8.709320833019158E+000 -8.709681718106172E+000 -8.710277669552827E+000 -8.711105369816513E+000 +-8.712161536563439E+000 -8.713442918708921E+000 -8.714946294473593E+000 -8.716668471706974E+000 +-8.718606290663759E+000 -8.720756629472147E+000 -8.723116412564590E+000 -8.725682622267726E+000 +-8.728452313909155E+000 -8.731422634668757E+000 -8.734590846458955E+000 -8.737954353205991E+000 +-8.741510732754554E+000 -8.745257773804218E+000 -8.749193518150964E+000 -8.753316308527662E+000 +-8.757624842452856E+000 -8.762118232300979E+000 -8.766796071976172E+000 -8.771658510458844E+000 +-8.776706332452548E+000 -8.781941046450155E+000 -8.787364980368102E+000 -8.792981384990270E+000 +-8.798794545329867E+000 -8.804809899974808E+000 -8.811034168522955E+000 -8.817475487020811E+000 +-8.824143551344255E+000 -8.831049768352644E+000 -8.838207414560046E+000 -8.845631802017921E+000 +-8.853340450949318E+000 -8.861353268659975E+000 -8.869692734095642E+000 -8.878384087318247E+000 +-8.887455523120522E+000 -8.896938387831877E+000 -8.906867378336511E+000 -8.917280742189305E+000 +-8.928220477628996E+000 -8.939732532254727E+000 -8.951866999008118E+000 -8.964678308101051E+000 +-8.978225413461848E+000 -8.992571972252700E+000 -9.007786516045700E+000 -9.023942612221081E+000 +-9.041119014232269E+000 -9.059399799435017E+000 -9.078874493265170E+000 -9.099638178683817E+000 +-9.121791589927124E+000 -9.145441189772473E+000 -9.170699229700226E+000 -9.197683792520374E+000 +-9.226518817240889E+000 -9.257334106153120E+000 -9.290265314312474E+000 -9.325453921789713E+000 +-9.363047189246743E+000 -9.403198097542079E+000 -9.446065272208756E+000 -9.491812893723150E+000 +-9.540610594540652E+000 -9.592633343871304E+000 -9.648061321102626E+000 -9.707079778689137E+000 +-9.769878895127455E+000 -9.836653618436840E+000 -9.907603500279004E+000 -9.982932520489527E+000 +-1.006284890145290E+001 -1.014756491128332E+001 -1.023729665434115E+001 -1.033226384712945E+001 +-1.043268957707676E+001 -1.053880004124640E+001 -1.065082426144948E+001 -1.076899377176006E+001 +-1.089354227394288E+001 -1.102470525580413E+001 -1.116271956708029E+001 -1.130782294703174E+001 +-1.146025349757189E+001 -1.162024909543868E+001 -1.178804673661196E+001 -1.196388180599716E+001 +-1.214798726516655E+001 -1.234059275086763E+001 -1.254192357694165E+001 -1.275219963224807E+001 +-1.297163416731305E+001 -1.320043246250130E+001 -1.343879037073776E+001 -1.368689272811462E+001 +-1.394491162606845E+001 -1.421300453934361E+001 -1.449131230452925E+001 -1.477995694470620E+001 +-1.507903933661961E+001 -1.538863671777946E+001 -1.570880003211180E+001 -1.603955111410914E+001 +-1.638087971298054E+001 -1.673274036002423E+001 -1.709504908434793E+001 -1.746767998419723E+001 +-1.785046166340513E+001 -1.824317354498896E+001 -1.864554207655947E+001 -1.905723684498398E+001 +-1.947786662074713E+001 -1.990697535553421E+001 -2.034403815986398E+001 -2.078845729111545E+001 +-2.123955818611071E+001 -2.169658557676996E+001 -2.215869973243336E+001 -2.262497287872366E+001 +-2.309438585083860E+001 -2.356582504968371E+001 -2.403807978330937E+001 -2.450984009483394E+001 +-2.497969520278392E+001 -2.544613271180549E+001 -2.590753879197173E+001 -2.636219957367488E+001 +-2.680830406117869E+001 -2.724394892812452E+001 -2.766714561648865E+001 -2.807583020702422E+001 +-2.846787655072657E+001 -2.884111313089413E+001 -2.919334404650859E+001 -2.952237435499421E+001 +-2.982603977859174E+001 -3.010224046939931E+001 -3.034897816723853E+001 -3.056439571488066E+001 +-3.074681757522653E+001 -3.089478978832902E+001 -3.100711776564481E+001 -3.108290046970368E+001 +-3.112155985358311E+001 -3.112286487617053E+001 -3.108694987208094E+001 -3.101432743265543E+001 +-3.090589615426976E+001 -3.076294357692137E+001 -3.058714436299724E+001 -3.038055329172233E+001 +-3.014559203699602E+001 -2.988502803078262E+001 -2.960194305399332E+001 -2.929968857917834E+001 +-2.898182432174341E+001 -2.865203592024938E+001 -2.831402712580177E+001 -2.797138129280300E+001 +-2.762738628795404E+001 -2.728481662939762E+001 -2.694567186628333E+001 -2.661086240643594E+001 +-2.628038052151570E+001 -2.595411995036496E+001 -2.563199201460306E+001 -2.531391744225404E+001 +-2.499982438126566E+001 -2.468964707778963E+001 -2.438332476196889E+001 -2.408080072161843E+001 +-2.378202154107996E+001 -2.348693648195098E+001 -2.319549698359870E+001 -2.290765626340291E+001 +-2.262336899907351E+001 -2.234259107785765E+001 -2.206527939980480E+001 -2.179139172439187E+001 +-2.152088655169713E+001 -2.125372303092616E+001 -2.098986089046358E+001 -2.072926038476817E+001 +-2.047188225436555E+001 -2.021768769596601E+001 -1.996663834035521E+001 -1.971869623620574E+001 +-1.947382383837249E+001 -1.923198399592940E+001 -1.899313995717031E+001 -1.875725536177139E+001 +-1.852429421918500E+001 -1.829422091850869E+001 -1.806700025356700E+001 -1.784259740137339E+001 +-1.762097788624078E+001 -1.740210762097372E+001 -1.718595291046741E+001 -1.697248042788758E+001 +-1.676165722118234E+001 -1.655345071147621E+001 -1.634782869126039E+001 -1.614475932237413E+001 +-1.594421113379202E+001 -1.574615301924318E+001 -1.555055423469106E+001 -1.535738439570444E+001 +-1.516661347475099E+001 -1.497821179843881E+001 -1.479215004472817E+001 -1.460839924012838E+001 +-1.442693075688691E+001 -1.424771631017311E+001 -1.407072795525068E+001 -1.389593808463055E+001 +-1.372331942519179E+001 -1.355284503525716E+001 -1.338448830161204E+001 -1.321822293645549E+001 +-1.305402297427660E+001 -1.289186276865331E+001 -1.273171698897349E+001 -1.257356061708371E+001 +-1.241736894387344E+001 -1.226311756580531E+001 -1.211078238140469E+001 -1.196033958772152E+001 +-1.181176567677910E+001 -1.166503743202257E+001 -1.152013192477933E+001 -1.137702651074196E+001 +-1.123569882648163E+001 -1.109612678599939E+001 -1.095828857731882E+001 -1.082216265912407E+001 +-1.068772775744376E+001 -1.055496286238122E+001 -1.042384722489001E+001 -1.029436035359324E+001 +-1.016648201164381E+001 -1.004019221362317E+001 -9.915471222479313E+000 -9.792299546493824E+000 +-9.670657936284790E+000 -9.550527381836304E+000 -9.431889109558345E+000 -9.314724579373511E+000 +-9.199015481831388E+000 -9.084743735249603E+000 -8.971891482882855E+000 -8.860441090120039E+000 +-8.750375141710334E+000 -8.641676439019356E+000 -8.534327997315803E+000 -8.428313043089844E+000 +-8.323615011403607E+000 -8.220217543274172E+000 -8.118104483089860E+000 -8.017259876059391E+000 +-7.917667965694434E+000 -7.819313191325248E+000 -7.722180185648954E+000 -7.626253772310575E+000 +-7.531518963515921E+000 -7.437960957676301E+000 -7.345565137084280E+000 -7.254317065619902E+000 +-7.164202486487238E+000 -7.075207319980158E+000 -6.987317661277279E+000 -6.900519778265368E+000 +-6.814800109390507E+000 -6.730145261537054E+000 -6.646542007933245E+000 -6.563977286083675E+000 +-6.482438195727791E+000 -6.401911996823990E+000 -6.322386107559327E+000 -6.243848102383939E+000 +-6.166285710070168E+000 -6.089686811796084E+000 -6.014039439252619E+000 -5.939331772774660E+000 +-5.865552139495164E+000 -5.792689011522391E+000 -5.720731004139862E+000 -5.649666874028537E+000 +-5.579485517511340E+000 -5.510175968819317E+000 -5.441727398379454E+000 -5.374129111123812E+000 +-5.307370544819541E+000 -5.241441268419842E+000 -5.176330980435239E+000 -5.112029507325206E+000 +-5.048526801909794E+000 -4.985812941800837E+000 -4.923878127852904E+000 -4.862712682633193E+000 +-4.802307048910673E+000 -4.742651788163887E+000 -4.683737579107226E+000 -4.625555216235609E+000 +-4.568095608387134E+000 -4.511349777323604E+000 -4.455308856328672E+000 -4.399964088823396E+000 +-4.345306826998153E+000 -4.291328530478738E+000 -4.238020764629016E+000 -4.185375201171141E+000 +-4.133383611312292E+000 -4.082037633410822E+000 -4.031329747527034E+000 -3.981251765117995E+000 +-3.931795861398061E+000 -3.882954308781589E+000 -3.834719475676578E+000 -3.787083825292160E+000 +-3.740039914460994E+000 -3.693580392476275E+000 -3.647697999943111E+000 -3.602385567644295E+000 +-3.557636015420044E+000 -3.513442351061737E+000 -3.469797669219388E+000 -3.426695150322613E+000 +-3.384128059515133E+000 -3.342089745602362E+000 -3.300573639982462E+000 -3.259573255741968E+000 +-3.219082186454329E+000 -3.179094105307605E+000 -3.139602764082751E+000 -3.100601992177352E+000 +-3.062085695641461E+000 -3.024047856225367E+000 -2.986482530439292E+000 -2.949383848624644E+000 +-2.912746014036870E+000 -2.876563301939862E+000 -2.840830058711185E+000 -2.805540700958905E+000 +-2.770689714649065E+000 -2.736271654244146E+000 -2.702281141852195E+000 -2.668712866386488E+000 +-2.635561582735696E+000 -2.602822110944299E+000 -2.570489335403213E+000 -2.538558204050491E+000 +-2.507023727581883E+000 -2.475880978671295E+000 -2.445125091200843E+000 -2.414751259500531E+000 +-2.384754737597372E+000 -2.355130838473776E+000 -2.325874933335249E+000 -2.296982450887084E+000 +-2.268448876620115E+000 -2.240269752105315E+000 -2.212440674297141E+000 -2.184957294845578E+000 +-2.157815319416663E+000 -2.131010507021511E+000 -2.104538669353662E+000 -2.078395670134610E+000 +-2.052577424467550E+000 -2.027079898199066E+000 -2.001899107288795E+000 -1.977031117186939E+000 +-1.952472042219439E+000 -1.928218044980875E+000 -1.904265335734831E+000 -1.880610171821746E+000 +-1.857248857074147E+000 -1.834177741239061E+000 -1.811393219407713E+000 -1.788891731452205E+000 +-1.766669761469261E+000 -1.744723837230869E+000 -1.723050529641706E+000 -1.701646452203378E+000 +-1.680508260485233E+000 -1.659632651601807E+000 -1.639016363696745E+000 -1.618656175433110E+000 +-1.598548905490075E+000 -1.578691412065793E+000 -1.559080592386516E+000 -1.539713382221777E+000 +-1.520586755405577E+000 -1.501697723363573E+000 -1.483043334646071E+000 -1.464620674466879E+000 +-1.446426864247869E+000 -1.428459061169174E+000 -1.410714457725012E+000 -1.393190281284990E+000 +-1.375883793660883E+000 -1.358792290678796E+000 -1.341913101756608E+000 -1.325243589486717E+000 +-1.308781149223912E+000 -1.292523208678406E+000 -1.276467227513918E+000 -1.260610696950718E+000 +-1.244951139373652E+000 -1.229486107944987E+000 -1.214213186222093E+000 -1.199129987779885E+000 +-1.184234155837914E+000 -1.169523362892139E+000 -1.154995310351229E+000 -1.140647728177415E+000 +-1.126478374531797E+000 -1.112485035424036E+000 -1.098665524366429E+000 -1.085017682032258E+000 +-1.071539375918387E+000 -1.058228500012070E+000 -1.045082974461860E+000 -1.032100745252650E+000 +-1.019279783884710E+000 -1.006618087056741E+000 -9.941136763528576E-001 -9.817645979334413E-001 +-9.695689222298702E-001 -9.575247436430017E-001 -9.456301802454230E-001 -9.338833734874100E-001 +-9.222824879065024E-001 -9.108257108407315E-001 -8.995112521453683E-001 -8.883373439132202E-001 +-8.773022401983972E-001 -8.664042167434876E-001 -8.556415707101603E-001 -8.450126204130719E-001 +-8.345157050571125E-001 -8.241491844779059E-001 -8.139114388855168E-001 -8.038008686113709E-001 +-7.938158938582910E-001 -7.839549544536559E-001 -7.742165096056242E-001 -7.645990376623721E-001 +-7.551010358743462E-001 -7.457210201594401E-001 -7.364575248711132E-001 -7.273091025693836E-001 +-7.182743237946505E-001 -7.093517768443531E-001 -7.005400675523746E-001 -6.918378190712091E-001 +-6.832436716568303E-001 -6.747562824562154E-001 -6.663743252975396E-001 -6.580964904829402E-001 +-6.499214845838848E-001 -6.418480302390723E-001 -6.338748659548330E-001 -6.260007459080297E-001 +-6.182244397513825E-001 -6.105447324212323E-001 -6.029604239476875E-001 -5.954703292671153E-001 +-5.880732780369868E-001 -5.807681144529955E-001 -5.735536970684683E-001 -5.664288986160132E-001 +-5.593926058313736E-001 -5.524437192794903E-001 -5.455811531826993E-001 -5.388038352510860E-001 +-5.321107065149363E-001 -5.255007211592658E-001 -5.189728463604174E-001 -5.125260621246716E-001 +-5.061593611288735E-001 -4.998717485630419E-001 -4.936622419749195E-001 -4.875298711164701E-001 +-4.814736777922701E-001 -4.754927157097898E-001 -4.695860503315377E-001 -4.637527587290290E-001 +-4.579919294385851E-001 -4.523026623189080E-001 -4.466840684104339E-001 -4.411352697964357E-001 +-4.356553994658389E-001 -4.302436011777575E-001 -4.248990293276972E-001 -4.196208488154324E-001 +-4.144082349145212E-001 -4.092603731434346E-001 -4.041764591382990E-001 -3.991556985272073E-001 +-3.941973068060981E-001 -3.893005092161788E-001 -3.844645406228618E-001 -3.796886453962172E-001 +-3.749720772928981E-001 -3.703140993395420E-001 -3.657139837176182E-001 -3.611710116497004E-001 +-3.566844732871619E-001 -3.522536675992547E-001 -3.478779022635744E-001 -3.435564935578870E-001 +-3.392887662532884E-001 -3.350740535087058E-001 -3.309116967666975E-001 -3.268010456505532E-001 +-3.227414578626746E-001 -3.187322990842085E-001 -3.147729428759414E-001 -3.108627705804088E-001 +-3.070011712252340E-001 -3.031875414276625E-001 -2.994212853002783E-001 -2.957018143579003E-001 +-2.920285474256257E-001 -2.884009105480222E-001 -2.848183368994488E-001 -2.812802666954827E-001 +-2.777861471054577E-001 -2.743354321660782E-001 -2.709275826961138E-001 -2.675620662121524E-001 +-2.642383568453956E-001 -2.609559352594935E-001 -2.577142885693946E-001 -2.545129102612081E-001 +-2.513513001130608E-001 -2.482289641169340E-001 -2.451454144014766E-001 -2.421001691557716E-001 +-2.390927525540534E-001 +/ + +&nonlocal + els_beta(1) = "3P" + lll(1) = 1 + kbeta(1) = 809 + rcut(1) = 9.000000000000000E-001 + rcutus(1) = 9.000000000000000E-001 + beta(1:1177,1) = +-1.126741090995861E-007 -1.155264677465885E-007 -1.184510341962707E-007 -1.214496363978473E-007 +-1.245241485752880E-007 -1.276764923987662E-007 -1.309086381857674E-007 -1.342226061326007E-007 +-1.376204675770872E-007 -1.411043462932145E-007 -1.446764198185632E-007 -1.483389208153393E-007 +-1.520941384658608E-007 -1.559444199033706E-007 -1.598921716790725E-007 -1.639398612663019E-007 +-1.680900186027780E-007 -1.723452376718975E-007 -1.767081781240574E-007 -1.811815669390247E-007 +-1.857682001303858E-007 -1.904709444931463E-007 -1.952927393955716E-007 -2.002365986163871E-007 +-2.053056122284887E-007 -2.105029485303374E-007 -2.158318560262502E-007 -2.212956654568201E-007 +-2.268977918807371E-007 -2.326417368093126E-007 -2.385310903950352E-007 -2.445695336755341E-007 +-2.507608408743475E-007 -2.571088817599341E-007 -2.636176240644054E-007 -2.702911359634857E-007 +-2.771335886192552E-007 -2.841492587872611E-007 -2.913425314896293E-007 -2.987179027558464E-007 +-3.062799824329225E-007 -3.140334970666962E-007 -3.219832928560796E-007 -3.301343386820890E-007 +-3.384917292135598E-007 -3.470606880914757E-007 -3.558465711939171E-007 -3.648548699836575E-007 +-3.740912149405067E-007 -3.835613790805442E-007 -3.932712815644397E-007 -4.032269913971215E-007 +-4.134347312211035E-007 -4.239008812058353E-007 -4.346319830355191E-007 -4.456347439978720E-007 +-4.569160411763986E-007 -4.684829257487926E-007 -4.803426273941505E-007 -4.925025588117583E-007 +-5.049703203542654E-007 -5.177537047781533E-007 -5.308607021144617E-007 -5.442995046628150E-007 +-5.580785121118805E-007 -5.722063367894399E-007 -5.866918090453765E-007 -6.015439827709301E-007 +-6.167721410576722E-007 -6.323858019997415E-007 -6.483947246429569E-007 -6.648089150845408E-007 +-6.816386327272527E-007 -6.988943966918482E-007 -7.165869923918752E-007 -7.347274782748975E-007 +-7.533271927343912E-007 -7.723977611966030E-007 -7.919511033868196E-007 -8.119994407795859E-007 +-8.325553042375141E-007 -8.536315418434853E-007 -8.752413269311155E-007 -8.973981663185116E-007 +-9.201159087504795E-007 -9.434087535544262E-007 -9.672912595154064E-007 -9.917783539758304E-007 +-1.016885342165536E-006 -1.042627916768060E-006 -1.069022167729059E-006 -1.096084592313055E-006 +-1.123832105414757E-006 -1.152282050131415E-006 -1.181452208602822E-006 -1.211360813125716E-006 +-1.242026557549562E-006 -1.273468608960808E-006 -1.305706619662932E-006 -1.338760739459776E-006 +-1.372651628249807E-006 -1.407400468939232E-006 -1.443028980681992E-006 -1.479559432454936E-006 +-1.517014656976655E-006 -1.555418064978655E-006 -1.594793659837824E-006 -1.635166052579322E-006 +-1.676560477259250E-006 -1.719002806736771E-006 -1.762519568845451E-006 -1.807137962974031E-006 +-1.852885877066906E-006 -1.899791905054997E-006 -1.947885364727874E-006 -1.997196316058314E-006 +-2.047755579990749E-006 -2.099594757705353E-006 -2.152746250369784E-006 -2.207243279390969E-006 +-2.263119907179534E-006 -2.320411058439908E-006 -2.379152541999386E-006 -2.439381073189786E-006 +-2.501134296795729E-006 -2.564450810583805E-006 -2.629370189427427E-006 -2.695933010042398E-006 +-2.764180876348645E-006 -2.834156445474017E-006 -2.905903454416328E-006 -2.979466747380393E-006 +-3.054892303807087E-006 -3.132227267111951E-006 -3.211519974151359E-006 -3.292819985434555E-006 +-3.376178116100576E-006 -3.461646467679324E-006 -3.549278460656671E-006 -3.639128867863994E-006 +-3.731253848712889E-006 -3.825710984296624E-006 -3.922559313380125E-006 -4.021859369301091E-006 +-4.123673217805262E-006 -4.228064495839442E-006 -4.335098451326624E-006 -4.444841983948011E-006 +-4.557363686957414E-006 -4.672733890054247E-006 -4.791024703341732E-006 -4.912310062398063E-006 +-5.036665774488421E-006 -5.164169565946925E-006 -5.294901130758051E-006 -5.428942180367832E-006 +-5.566376494756115E-006 -5.707289974801660E-006 -5.851770695972884E-006 -5.999908963377817E-006 +-6.151797368207551E-006 -6.307530845608693E-006 -6.467206734020765E-006 -6.630924836015752E-006 +-6.798787480677884E-006 -6.970899587562368E-006 -7.147368732273535E-006 -7.328305213702788E-006 +-7.513822122968902E-006 -7.704035414103497E-006 -7.899063976525771E-006 -8.099029709352230E-006 +-8.304057597587260E-006 -8.514275790242638E-006 -8.729815680434690E-006 -8.950811987508826E-006 +-9.177402841243501E-006 -9.409729868185376E-006 -9.647938280170290E-006 -9.892176965085162E-006 +-1.014259857992728E-005 -1.039935964621977E-005 -1.066262064784216E-005 -1.093254613133767E-005 +-1.120930480875994E-005 -1.149306966312284E-005 -1.178401805652039E-005 -1.208233184098323E-005 +-1.238819747214158E-005 -1.270180612576571E-005 -1.302335381725628E-005 -1.335304152416014E-005 +-1.369107531178693E-005 -1.403766646200620E-005 -1.439303160530485E-005 -1.475739285618736E-005 +-1.513097795200422E-005 -1.551402039529414E-005 -1.590675959973014E-005 -1.630944103976013E-005 +-1.672231640403531E-005 -1.714564375272326E-005 -1.757968767880272E-005 -1.802471947344189E-005 +-1.848101729556336E-005 -1.894886634570106E-005 -1.942855904425918E-005 -1.992039521428286E-005 +-2.042468226885621E-005 -2.094173540324436E-005 -2.147187779189890E-005 -2.201544079045150E-005 +-2.257276414282003E-005 -2.314419619355805E-005 -2.373009410557996E-005 -2.433082408339723E-005 +-2.494676160200682E-005 -2.557829164157277E-005 -2.622580892804950E-005 -2.688971817989632E-005 +-2.757043436103682E-005 -2.826838294022305E-005 -2.898400015696434E-005 -2.971773329418861E-005 +-3.047004095780621E-005 -3.124139336334996E-005 -3.203227262987285E-005 -3.284317308128418E-005 +-3.367460155531496E-005 -3.452707772030455E-005 -3.540113440000587E-005 -3.629731790661434E-005 +-3.721618838222611E-005 -3.815832014894063E-005 -3.912430206782656E-005 -4.011473790697329E-005 +-4.113024671886154E-005 -4.217146322728517E-005 -4.323903822406878E-005 -4.433363897582811E-005 +-4.545594964102625E-005 -4.660667169758958E-005 -4.778652438134631E-005 -4.899624513556548E-005 +-5.023659007187540E-005 -5.150833444284968E-005 -5.281227312655719E-005 -5.414922112337751E-005 +-5.552001406539344E-005 -5.692550873867859E-005 -5.836658361880589E-005 -5.984413941991294E-005 +-6.135909965766582E-005 -6.291241122647466E-005 -6.450504499132077E-005 -6.613799639456562E-005 +-6.781228607812075E-005 -6.952896052136732E-005 -7.128909269522454E-005 -7.309378273277527E-005 +-7.494415861686761E-005 -7.684137688512348E-005 -7.878662335279278E-005 -8.078111385390712E-005 +-8.282609500119500E-005 -8.492284496523283E-005 -8.707267427332077E-005 -8.927692662858019E-005 +-9.153697974978674E-005 -9.385424623246267E-005 -9.623017443176662E-005 -9.866624936773362E-005 +-1.011639936534293E-004 -1.037249684466004E-004 -1.063507744254144E-004 -1.090430527888999E-004 +-1.118034862827112E-004 -1.146338002508588E-004 -1.175357637140640E-004 -1.205111904754107E-004 +-1.235619402539839E-004 -1.266899198472071E-004 -1.298970843226008E-004 -1.331854382397091E-004 +-1.365570369029594E-004 -1.400139876462333E-004 -1.435584511499577E-004 -1.471926427915334E-004 +-1.509188340299498E-004 -1.547393538254476E-004 -1.586565900951179E-004 -1.626729912053487E-004 +-1.667910675020478E-004 -1.710133928796028E-004 -1.753426063895554E-004 -1.797814138899956E-004 +-1.843325897367087E-004 -1.889989785171288E-004 -1.937834968281847E-004 -1.986891350991481E-004 +-2.037189594606228E-004 -2.088761136608441E-004 -2.141638210304836E-004 -2.195853864971896E-004 +-2.251441986511213E-004 -2.308437318627645E-004 -2.366875484543574E-004 -2.426793009262777E-004 +-2.488227342397870E-004 -2.551216881575557E-004 -2.615800996434309E-004 -2.682020053229497E-004 +-2.749915440061301E-004 -2.819529592741213E-004 -2.890906021313269E-004 -2.964089337246548E-004 +-3.039125281316018E-004 -3.116060752189026E-004 -3.194943835735405E-004 -3.275823835079457E-004 +-3.358751301412554E-004 -3.443778065585701E-004 -3.530957270501694E-004 -3.620343404327197E-004 +-3.711992334545408E-004 -3.805961342870695E-004 -3.902309161046849E-004 -4.001096007551504E-004 +-4.102383625229517E-004 -4.206235319878878E-004 -4.312715999813260E-004 -4.421892216425844E-004 +-4.533832205779889E-004 -4.648605931251907E-004 -4.766285127254138E-004 -4.886943344063674E-004 +-5.010655993786076E-004 -5.137500397482417E-004 -5.267555833489003E-004 -5.400903586960053E-004 +-5.537627000664258E-004 -5.677811527066875E-004 -5.821544781730031E-004 -5.968916598064452E-004 +-6.120019083466865E-004 -6.274946676878204E-004 -6.433796207798335E-004 -6.596666956794492E-004 +-6.763660717540897E-004 -6.934881860428506E-004 -7.110437397784567E-004 -7.290437050742551E-004 +-7.474993317804489E-004 -7.664221545138326E-004 -7.858239998654214E-004 -8.057169937904857E-004 +-8.261135691855849E-004 -8.470264736573529E-004 -8.684687774878709E-004 -8.904538818016055E-004 +-9.129955269390172E-004 -9.361078010420427E-004 -9.598051488568450E-004 -9.841023807593018E-004 +-1.009014682008871E-003 -1.034557622236620E-003 -1.060747165173318E-003 -1.087599678623690E-003 +-1.115131944693043E-003 -1.143361170272645E-003 -1.172304997790412E-003 -1.201981516233594E-003 +-1.232409272450357E-003 -1.263607282737307E-003 -1.295595044720174E-003 -1.328392549535106E-003 +-1.362020294318103E-003 -1.396499295010471E-003 -1.431851099488216E-003 -1.468097801023602E-003 +-1.505262052087265E-003 -1.543367078499480E-003 -1.582436693939420E-003 -1.622495314821466E-003 +-1.663567975547820E-003 -1.705680344146948E-003 -1.748858738307620E-003 -1.793130141818505E-003 +-1.838522221423618E-003 -1.885063344104095E-003 -1.932782594797085E-003 -1.981709794562812E-003 +-2.031875519211104E-003 -2.083311118399024E-003 -2.136048735211519E-003 -2.190121326237238E-003 +-2.245562682152102E-003 -2.302407448823381E-003 -2.360691148947477E-003 -2.420450204234881E-003 +-2.481721958156120E-003 -2.544544699262878E-003 -2.608957685098774E-003 -2.675001166714764E-003 +-2.742716413804366E-003 -2.812145740474394E-003 -2.883332531667261E-003 -2.956321270251241E-003 +-3.031157564795632E-003 -3.107888178048066E-003 -3.186561056131680E-003 -3.267225358480381E-003 +-3.349931488530724E-003 -3.434731125189629E-003 -3.521677255097413E-003 -3.610824205706251E-003 +-3.702227679194663E-003 -3.795944787239033E-003 -3.892034086663890E-003 -3.990555615993030E-003 +-4.091570932924264E-003 -4.195143152751053E-003 -4.301336987754880E-003 -4.410218787592905E-003 +-4.521856580705951E-003 -4.636320116772548E-003 -4.753680910235442E-003 -4.874012284927482E-003 +-4.997389419824772E-003 -5.123889395955340E-003 -5.253591244492503E-003 -5.386575996062808E-003 +-5.522926731299002E-003 -5.662728632669590E-003 -5.806069037616968E-003 -5.953037493037121E-003 +-6.103725811134781E-003 -6.258228126688368E-003 -6.416640955760596E-003 -6.579063255890776E-003 +-6.745596487806282E-003 -6.916344678691412E-003 -7.091414487052580E-003 -7.270915269220368E-003 +-7.454959147529204E-003 -7.643661080217131E-003 -7.837138933088772E-003 -8.035513552985691E-003 +-8.238908843109844E-003 -8.447451840246409E-003 -8.661272793933793E-003 -8.880505247629763E-003 +-9.105286121923642E-003 -9.335755799846121E-003 -9.572058214329200E-003 -9.814340937870182E-003 +-1.006275527445515E-002 -1.031745635379825E-002 -1.057860322795526E-002 -1.084635897037065E-002 +-1.112089077741906E-002 -1.140237007250406E-002 -1.169097261277757E-002 -1.198687859854627E-002 +-1.229027278543168E-002 -1.260134459935304E-002 -1.292028825440358E-002 -1.324730287369238E-002 +-1.358259261322613E-002 -1.392636678890651E-002 -1.427884000672113E-002 -1.464023229620789E-002 +-1.501076924727393E-002 -1.539068215045349E-002 -1.578020814068999E-002 -1.617959034473032E-002 +-1.658907803222132E-002 -1.700892677060048E-002 -1.743939858387554E-002 -1.788076211538966E-002 +-1.833329279467105E-002 -1.879727300846891E-002 -1.927299227607930E-002 -1.976074742906770E-002 +-2.026084279549734E-002 -2.077359038877481E-002 -2.129931010122775E-002 -2.183832990253121E-002 +-2.239098604310351E-002 -2.295762326259380E-002 -2.353859500358760E-002 -2.413426363065914E-002 +-2.474500065490221E-002 -2.537118696407504E-002 -2.601321305849749E-002 -2.667147929284188E-002 +-2.734639612396317E-002 -2.803838436491594E-002 -2.874787544531139E-002 -2.947531167816899E-002 +-3.022114653342246E-002 -3.098584491824331E-002 -3.176988346434785E-002 -3.257375082245979E-002 +-3.339794796410200E-002 -3.424298849089684E-002 -3.510939895155799E-002 -3.599771916676043E-002 +-3.690850256208100E-002 -3.784231650920470E-002 -3.879974267559762E-002 -3.978137738285134E-002 +-4.078783197390809E-002 -4.181973318938216E-002 -4.287772355319560E-002 -4.396246176775330E-002 +-4.507462311888651E-002 -4.621489989079868E-002 -4.738400179125393E-002 -4.858265638725238E-002 +-4.981160955144316E-002 -5.107162591953046E-002 -5.236348935893351E-002 -5.368800344896835E-002 +-5.504599197282353E-002 -5.643829942160779E-002 -5.786579151075542E-002 -5.932935570907750E-002 +-6.082990178075801E-002 -6.236836234059522E-002 -6.394569342279828E-002 -6.556287506365432E-002 +-6.722091189838549E-002 -6.892083377252693E-002 -7.066369636815682E-002 -7.245058184532156E-002 +-7.428259949900270E-002 -7.616088643197870E-002 -7.808660824394410E-002 -8.006095973725155E-002 +-8.208516563965239E-002 -8.416048134441551E-002 -8.628819366821151E-002 -8.846962162715780E-002 +-9.070611723142469E-002 -9.299906629880929E-002 -9.534988928769340E-002 -9.776004214980245E-002 +-1.002310172031969E-001 -1.027643440259263E-001 -1.053615903707868E-001 -1.080243631016288E-001 +-1.107543091516642E-001 -1.135531165042333E-001 -1.164225151964925E-001 -1.193642783464923E-001 +-1.223802232041193E-001 -1.254722122263776E-001 -1.286421541774958E-001 -1.318920052543448E-001 +-1.352237702376545E-001 -1.386395036695267E-001 -1.421413110577351E-001 -1.457313501073159E-001 +-1.494118319799436E-001 -1.531850225815944E-001 -1.570532438789984E-001 -1.610188752453756E-001 +-1.650843548359594E-001 -1.692521809937974E-001 -1.735249136863224E-001 -1.779051759731823E-001 +-1.823956555058033E-001 -1.869991060591663E-001 -1.917183490962529E-001 -1.965562753656202E-001 +-2.015158465325431E-001 -2.066000968441458E-001 -2.118121348289422E-001 -2.171551450311704E-001 +-2.226323897802931E-001 -2.282472109960173E-001 -2.340030320291451E-001 -2.399033595385603E-001 +-2.459517854046022E-001 -2.521519886790562E-001 -2.585077375719484E-001 -2.650228914752785E-001 +-2.717014030237953E-001 -2.785473201928535E-001 -2.855647884333330E-001 -2.927580528435526E-001 +-3.001314603780194E-001 -3.076894620928077E-001 -3.154366154272564E-001 -3.233775865215995E-001 +-3.315171525700458E-001 -3.398602042087123E-001 -3.484117479377188E-001 -3.571769085766132E-001 +-3.661609317521728E-001 -3.753691864174853E-001 -3.848071674010489E-001 -3.944804979844818E-001 +-4.043949325072282E-001 -4.145563589964751E-001 -4.249708018202722E-001 -4.356444243616172E-001 +-4.465835317110437E-001 -4.577945733749677E-001 -4.692841459967773E-001 -4.810589960873428E-001 +-4.931260227612987E-001 -5.054922804751051E-001 -5.181649817625070E-001 -5.311514999626180E-001 +-5.444593719354169E-001 -5.580963007589713E-001 -5.720701584022235E-001 -5.863889883666155E-001 +-6.010610082892727E-001 -6.160946124998485E-001 -6.314983745224546E-001 -6.472810495134315E-001 +-6.634515766249300E-001 -6.800190812834753E-001 -6.969928773718290E-001 -7.143824693015220E-001 +-7.321975539624719E-001 -7.504480225350139E-001 -7.691439621485667E-001 -7.882956573699483E-001 +-8.079135915030522E-001 -8.280084476802587E-001 -8.485911097244661E-001 -8.696726627590688E-001 +-8.912643935415702E-001 -9.133777904947027E-001 -9.360245434071000E-001 -9.592165427735089E-001 +-9.829658787424076E-001 -1.007284839636650E+000 -1.032185910010263E+000 -1.057681768202096E+000 +-1.083785283344119E+000 -1.110509511779402E+000 -1.137867692841724E+000 -1.165873243945404E+000 +-1.194539754930651E+000 -1.223880981605916E+000 -1.253910838424983E+000 -1.284643390232416E+000 +-1.316092843006576E+000 -1.348273533525015E+000 -1.381199917872077E+000 -1.414886558703548E+000 +-1.449348111177906E+000 -1.484599307457896E+000 -1.520654939680539E+000 -1.557529841287179E+000 +-1.595238866598869E+000 -1.633796868515583E+000 -1.673218674210389E+000 -1.713519058682669E+000 +-1.754712716026301E+000 -1.796814228260952E+000 -1.839838031566183E+000 -1.883798379749220E+000 +-1.928709304768570E+000 -1.974584574126090E+000 -2.021437644930801E+000 -2.069281614427988E+000 +-2.118129166776900E+000 -2.167992515850654E+000 -2.218883343821204E+000 -2.270812735282193E+000 +-2.323791106652117E+000 -2.377828130589610E+000 -2.432932655142984E+000 -2.489112617345668E+000 +-2.546374950959995E+000 -2.604725488062551E+000 -2.664168854155634E+000 -2.724708356482052E+000 +-2.786345865213372E+000 -2.849081687176533E+000 -2.912914431779668E+000 -2.977840868795389E+000 +-3.043855777660017E+000 -3.110951787948824E+000 -3.179119210692590E+000 -3.248345860208869E+000 +-3.318616866132800E+000 -3.389914475348846E+000 -3.462217843545019E+000 -3.535502816137835E+000 +-3.609741698348491E+000 -3.684903014249826E+000 -3.760951254651117E+000 -3.837846613743069E+000 +-3.915544714491052E+000 -3.993996322840904E+000 -4.073147050889369E+000 -4.152937049273103E+000 +-4.233300689145533E+000 -4.314166234242856E+000 -4.395455503689904E+000 -4.477083526364375E+000 +-4.558958187827582E+000 -4.640979871040733E+000 -4.723041092321791E+000 -4.805026134259753E+000 +-4.886810677592283E+000 -4.968261434372732E+000 -5.049235785102661E+000 -5.129581422890452E+000 +-5.209136008115400E+000 -5.287726837531200E+000 -5.365170532235695E+000 -5.441272749463348E+000 +-5.515827923726221E+000 -5.588619043436204E+000 -5.659417469785441E+000 -5.727982805342765E+000 +-5.794062820536998E+000 -5.857393446941189E+000 -5.917698847039297E+000 -5.974691570941305E+000 +-6.028072811307485E+000 -6.077532768534345E+000 -6.122751139033164E+000 -6.163397740179403E+000 +-6.199133286209296E+000 -6.229610329967048E+000 -6.254474385934661E+000 -6.273365250377884E+000 +-6.285918534680279E+000 -6.291767427973547E+000 -6.290544704961770E+000 -6.281884994329302E+000 +-6.265427322261502E+000 -6.240817944332982E+000 -6.207713477262783E+000 -6.165784339728400E+000 +-6.114718508494126E+000 -6.054225592464499E+000 -5.984041222837040E+000 -5.903931752218848E+000 +-5.813699249304765E+000 -5.713186768415940E+000 -5.602283864795304E+000 -5.480932316994045E+000 +-5.349132006921396E+000 -5.206946896150050E+000 -5.054511023888581E+000 -4.892034437699690E+000 +-4.719808952662309E+000 -4.538213618405452E+000 -4.347719756508491E+000 -4.148895413481021E+000 +-3.942409057304448E+000 -3.729032328850276E+000 -3.509641644014471E+000 -3.285218428876452E+000 +-3.056847759503075E+000 -2.825715171203143E+000 -2.593101400275251E+000 -2.360374825898332E+000 +-2.128981392221127E+000 -1.900431812463062E+000 -1.676285889540162E+000 -1.458133833015132E+000 +-1.247574511620703E+000 -1.046190655700902E+000 -8.555211159312436E-001 -6.770303945822398E-001 +-5.120757939464325E-001 -3.618726733811468E-001 -2.274584711259200E-001 -1.096563282906759E-001 +-9.039348041338267E-003 7.410326992805605E-002 1.397967647871462E-001 1.884063468964680E-001 + 2.206558375286447E-001 2.376373161189566E-001 2.408094755127621E-001 2.319821999300481E-001 + 2.132847099535964E-001 1.871144625013242E-001 1.560638466997885E-001 1.228215699029496E-001 + 9.004546833679371E-002 6.020328628778985E-002 3.537772559570571E-002 1.703175227548087E-002 + 5.729742392182262E-003 8.095496302189142E-004 1.197524714767390E-012 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 + + els_beta(2) = "3D" + lll(2) = 2 + kbeta(2) = 819 + rcut(2) = 1.000000000000000E+000 + rcutus(2) = 1.000000000000000E+000 + beta(1:1177,2) = + 1.586013978883939E-011 1.646618740130396E-011 1.709539330318276E-011 1.774864241895137E-011 + 1.842685348781618E-011 1.913098035584250E-011 1.986201331745792E-011 2.062098050821685E-011 + 2.140894935078544E-011 2.222702805618081E-011 2.307636718237494E-011 2.395816125245651E-011 + 2.487365043462572E-011 2.582412228638502E-011 2.681091356537915E-011 2.783541210943035E-011 + 2.889905878841407E-011 3.000334953071957E-011 3.114983742714533E-011 3.234013491518928E-011 + 3.357591604680394E-011 3.485891884280802E-011 3.619094773726428E-011 3.757387611526205E-011 + 3.900964894767382E-011 4.050028552659021E-011 4.204788230528247E-011 4.365461584668472E-011 + 4.532274588454422E-011 4.705461850154410E-011 4.885266942886796E-011 5.071942747184822E-011 + 5.265751806651487E-011 5.466966697204701E-011 5.675870410432086E-011 5.892756751594414E-011 + 6.117930752837676E-011 6.351709102194719E-011 6.594420588979928E-011 6.846406566203364E-011 + 7.108021430654552E-011 7.379633121331323E-011 7.661623636914610E-011 7.954389573016909E-011 + 8.258342679960258E-011 8.573910441867708E-011 8.901536677883355E-011 9.241682166365993E-011 + 9.594825292934515E-011 9.961462723276443E-011 1.034211010166569E-010 1.073730277617223E-010 + 1.114759655158339E-010 1.157356847109572E-010 1.201581762787705E-010 1.247496600763967E-010 + 1.295165936341012E-010 1.344656812372558E-010 1.396038833553429E-010 1.449384264312614E-010 + 1.504768130446988E-010 1.562268324638687E-010 1.621965716004506E-010 1.683944263831379E-010 + 1.748291135657956E-010 1.815096829868258E-010 1.884455302969928E-010 1.956464101736008E-010 + 2.031224500396125E-010 2.108841643070039E-010 2.189424691643821E-010 2.273086979296707E-010 + 2.359946169894514E-010 2.450124423473775E-010 2.543748568049389E-010 2.640950277987325E-010 + 2.741866259193352E-010 2.846638441378176E-010 2.955414177669405E-010 3.068346451851115E-010 + 3.185594093522382E-010 3.307322001477523E-010 3.433701375622096E-010 3.564909957750865E-010 + 3.701132281526431E-010 3.842559932009926E-010 3.989391815109001E-010 4.141834437321885E-010 + 4.300102196171047E-010 4.464417681734935E-010 4.635011989701727E-010 4.812125046385609E-010 + 4.996005946162512E-010 5.186913301799916E-010 5.385115608173515E-010 5.590891619882112E-010 + 5.804530743292034E-010 6.026333443562245E-010 6.256611667222746E-010 6.495689280900572E-010 + 6.743902526810206E-010 7.001600495649388E-010 7.269145617565036E-010 7.546914171880051E-010 + 7.835296816297790E-010 8.134699136328360E-010 8.445542215709659E-010 8.768263228625394E-010 + 9.103316054552744E-010 9.451171916604785E-010 9.812320044264963E-010 1.018726836144615E-009 + 1.057654420084177E-009 1.098069504557354E-009 1.140028929917928E-009 1.183591708502319E-009 + 1.228819107625327E-009 1.275774735747314E-009 1.324524631933985E-009 1.375137358734623E-009 + 1.427684098609355E-009 1.482238754041116E-009 1.538878051473079E-009 1.597681649217730E-009 + 1.658732249489382E-009 1.722115714717629E-009 1.787921188305405E-009 1.856241220001421E-009 + 1.927171896063324E-009 2.000812974394682E-009 2.077268024845737E-009 2.156644574875407E-009 + 2.239054260779264E-009 2.324612984696231E-009 2.413441077614861E-009 2.505663468608297E-009 + 2.601409860536133E-009 2.700814912460123E-009 2.804018429030354E-009 2.911165557108273E-009 + 3.022406989902972E-009 3.137899178907999E-009 3.257804553936633E-009 3.382291751565150E-009 + 3.511535852305356E-009 3.645718626839882E-009 3.785028791666659E-009 3.929662274512048E-009 + 4.079822489885875E-009 4.235720625166030E-009 4.397575937614782E-009 4.565616062744776E-009 + 4.740077334468187E-009 4.921205117479458E-009 5.109254152338980E-009 5.304488913743019E-009 + 5.507183982483914E-009 5.717624431623507E-009 5.936106227423015E-009 6.162936645593218E-009 + 6.398434703450231E-009 6.642931608584921E-009 6.896771224676707E-009 7.160310555107004E-009 + 7.433920245052558E-009 7.717985102764368E-009 8.012904640766167E-009 8.319093637732581E-009 + 8.636982721838012E-009 8.967018976396368E-009 9.309666568643050E-009 9.665407402544475E-009 + 1.003474179655199E-008 1.041818918725448E-008 1.081628885991873E-008 1.122960070694469E-008 + 1.165870601530346E-008 1.210420828406395E-008 1.256673407315908E-008 1.304693388458507E-008 + 1.354548307727224E-008 1.406308281691569E-008 1.460046106209973E-008 1.515837358810450E-008 + 1.573760504983401E-008 1.633897008536003E-008 1.696331446163525E-008 1.761151626398539E-008 + 1.828448713105412E-008 1.898317353693780E-008 1.970855812231192E-008 2.046166107642346E-008 + 2.124354157189032E-008 2.205529925432772E-008 2.289807578889583E-008 2.377305646594267E-008 + 2.468147186800300E-008 2.562459960049441E-008 2.660376608854728E-008 2.762034844249469E-008 + 2.867577639464467E-008 2.977153431006161E-008 3.090916327418121E-008 3.209026326019762E-008 + 3.331649537927024E-008 3.458958421671312E-008 3.591132025745637E-008 3.728356240418596E-008 + 3.870824059170712E-008 4.018735850120688E-008 4.172299637823125E-008 4.331731395834431E-008 + 4.497255350457906E-008 4.669104296095499E-008 4.847519922649706E-008 5.032753155435772E-008 + 5.225064508082826E-008 5.424724448919493E-008 5.632013781359949E-008 5.847224038825013E-008 + 6.070657894753584E-008 6.302629588281576E-008 6.543465366186297E-008 6.793503941718336E-008 + 7.053096970966159E-008 7.322609547422915E-008 7.602420715451853E-008 7.892924003371443E-008 + 8.194527976910718E-008 8.507656813812880E-008 8.832750900394972E-008 9.170267450903398E-008 + 9.520681150535312E-008 9.884484823030884E-008 1.026219012377533E-007 1.065432825938464E-007 + 1.106145073478832E-007 1.148413012885835E-007 1.192296089967630E-007 1.237856022057056E-007 + 1.285156884809916E-007 1.334265202319982E-007 1.385250040677330E-007 1.438183105101670E-007 + 1.493138840787253E-007 1.550194537601130E-007 1.609430438782075E-007 1.670929853792966E-007 + 1.734779275485383E-007 1.801068501741177E-007 1.869890761762042E-007 1.941342847184770E-007 + 2.015525248206477E-007 2.092542294911316E-007 2.172502303997395E-007 2.255517731110223E-007 + 2.341705328996937E-007 2.431186311703705E-007 2.524086525047222E-007 2.620536623600034E-007 + 2.720672254438555E-007 2.824634247912215E-007 2.932568815701976E-007 3.044627756446775E-007 + 3.160968669227047E-007 3.281755175205491E-007 3.407157147736878E-007 3.537350951270368E-007 + 3.672519689380368E-007 3.812853462274728E-007 3.958549634142319E-007 4.109813110716065E-007 + 4.266856627441611E-007 4.429901048656969E-007 4.599175678203834E-007 4.774918581907269E-007 + 4.957376922377390E-007 5.146807306603671E-007 5.343476146830821E-007 5.547660035223640E-007 + 5.759646132847593E-007 5.979732573512298E-007 6.208228883045603E-007 6.445456414587929E-007 + 6.691748800519019E-007 6.947452421652374E-007 7.212926894357481E-007 7.488545576294337E-007 + 7.774696091471891E-007 8.071780875368395E-007 8.380217740880163E-007 8.700440465894848E-007 + 9.032899403314937E-007 9.378062114389718E-007 9.736414026245955E-007 1.010845911454179E-006 + 1.049472061220405E-006 1.089574174524503E-006 1.131208649669383E-006 1.174434039971609E-006 + 1.219311136103725E-006 1.265903051582747E-006 1.314275311524961E-006 1.364495944791878E-006 + 1.416635579656876E-006 1.470767543127010E-006 1.526967964059705E-006 1.585315880219235E-006 + 1.645893349423556E-006 1.708785564937752E-006 1.774080975276307E-006 1.841871408582670E-006 + 1.912252201760955E-006 1.985322334541336E-006 2.061184568667623E-006 2.139945592402673E-006 + 2.221716170554849E-006 2.306611300236357E-006 2.394750372572515E-006 2.486257340589264E-006 + 2.581260893514870E-006 2.679894637740998E-006 2.782297284697374E-006 2.888612845904284E-006 + 2.998990835477021E-006 3.113586480367033E-006 3.232560938635131E-006 3.356081526063840E-006 + 3.484321951427215E-006 3.617462560748939E-006 3.755690590892066E-006 3.899200432836712E-006 + 4.048193905015948E-006 4.202880537093972E-006 4.363477864585434E-006 4.530211734730099E-006 + 4.703316624052576E-006 4.883035968053675E-006 5.069622503496578E-006 5.263338623768967E-006 + 5.464456747820586E-006 5.673259703194540E-006 5.890041123690922E-006 6.115105862221395E-006 + 6.348770419434999E-006 6.591363388717607E-006 6.843225918190112E-006 7.104712190354873E-006 + 7.376189920064240E-006 7.658040871510874E-006 7.950661394966486E-006 8.254462984022794E-006 + 8.569872854118113E-006 8.897334543162154E-006 9.237308535102911E-006 9.590272907311905E-006 + 9.956724002697024E-006 1.033717712748754E-005 1.073216727567131E-005 1.114224988110205E-005 + 1.156800159833314E-005 1.201002111327470E-005 1.246892998481291E-005 1.294537351857361E-005 + 1.344002167405736E-005 1.395357000642046E-005 1.448674064422399E-005 1.504028330452487E-005 + 1.561497634673390E-005 1.621162786672126E-005 1.683107683270552E-005 1.747419426452138E-005 + 1.814188445792229E-005 1.883508625563666E-005 1.955477436696257E-005 2.030196073775388E-005 + 2.107769597272038E-005 2.188307081203995E-005 2.271921766435447E-005 2.358731219830231E-005 + 2.448857499482120E-005 2.542427326254004E-005 2.639572261866856E-005 2.740428893788336E-005 + 2.845139027180528E-005 2.953849884176187E-005 3.066714310763183E-005 3.183890991567286E-005 + 3.305544672834858E-005 3.431846393928144E-005 3.562973727657998E-005 3.699111029791221E-005 + 3.840449698082401E-005 3.987188441193720E-005 4.139533557879818E-005 4.297699226829296E-005 + 4.461907807569341E-005 4.632390152855319E-005 4.809385932983494E-005 4.993143972481513E-005 + 5.183922599648635E-005 5.381990009435810E-005 5.587624640174079E-005 5.801115564679544E-005 + 6.022762896282817E-005 6.252878210352094E-005 6.491784981900425E-005 6.739819039890219E-005 + 6.997329038871656E-005 7.264676948615471E-005 7.542238562426005E-005 7.830404024846537E-005 + 8.129578379495538E-005 8.440182137801406E-005 8.762651869431515E-005 9.097440815242398E-005 + 9.445019523608967E-005 9.805876511023125E-005 1.018051894788660E-004 1.056947337045723E-004 + 1.097328641994493E-004 1.139252560979108E-004 1.182778012220458E-004 1.227966163506835E-004 + 1.274880518037274E-004 1.323587003537566E-004 1.374154064773546E-004 1.426652759590899E-004 + 1.481156858615755E-004 1.537742948755323E-004 1.596490540643147E-004 1.657482180179088E-004 + 1.720803564319723E-004 1.786543661280895E-004 1.854794835320151E-004 1.925652976273241E-004 + 1.999217634025453E-004 2.075592158105296E-004 2.154883842595358E-004 2.237204076562314E-004 + 2.322668500215855E-004 2.411397167014225E-004 2.503514711942193E-004 2.599150526196005E-004 + 2.698438938518572E-004 2.801519403437415E-004 2.908536696667484E-004 3.019641117950709E-004 + 3.134988701614657E-004 3.254741435143099E-004 3.379067486062486E-004 3.508141437459808E-004 + 3.642144532459036E-004 3.781264927996036E-004 3.925697958244280E-004 4.075646408057202E-004 + 4.231320796806830E-004 4.392939673012357E-004 4.560729920167618E-004 4.734927074191344E-004 + 4.915775652940278E-004 5.103529498241859E-004 5.298452130919947E-004 5.500817119305486E-004 + 5.710908461741851E-004 5.929020983614146E-004 6.155460749451546E-004 6.390545490672062E-004 + 6.634605049561009E-004 6.887981840096069E-004 7.151031326255080E-004 7.424122518466542E-004 + 7.707638488887164E-004 8.001976906216913E-004 8.307550590788135E-004 8.624788090692873E-004 + 8.954134279741459E-004 9.296050978074120E-004 9.651017596279248E-004 1.001953180390257E-003 + 1.040211022326510E-003 1.079928914954175E-003 1.121162529808745E-003 1.163969658003522E-003 + 1.208410290722746E-003 1.254546702758210E-003 1.302443539203566E-003 1.352167905424709E-003 + 1.403789460429125E-003 1.457380513761508E-003 1.513016126057709E-003 1.570774213393985E-003 + 1.630735655573455E-003 1.692984408497032E-003 1.757607620771422E-003 1.824695754712404E-003 + 1.894342711907479E-003 1.966645963507826E-003 2.041706685425973E-003 2.119629898621814E-003 + 2.200524614666385E-003 2.284503986779767E-003 2.371685466546442E-003 2.462190966519141E-003 + 2.556147028929565E-003 2.653685000732500E-003 2.754941215218025E-003 2.860057180434828E-003 + 2.969179774676730E-003 3.082461449293338E-003 3.200060439095245E-003 3.322140980633984E-003 + 3.448873538646768E-003 3.580435040966832E-003 3.717009122210427E-003 3.858786376563098E-003 + 4.005964619999091E-003 4.158749162279537E-003 4.317353089087630E-003 4.481997554671334E-003 + 4.652912085377444E-003 4.830334894474282E-003 5.014513208674134E-003 5.205703606781248E-003 + 5.404172370905698E-003 5.610195850699025E-003 5.824060841083379E-003 6.046064973961917E-003 + 6.276517124415658E-003 6.515737831908668E-003 6.764059737041917E-003 7.021828034414337E-003 + 7.289400942168550E-003 7.567150188818754E-003 7.855461517977863E-003 8.154735211622273E-003 + 8.465386632553824E-003 8.787846786740260E-003 9.122562906238885E-003 9.469999053430486E-003 + 9.830636747315309E-003 1.020497561264699E-002 1.059353405270573E-002 1.099684994653808E-002 + 1.141548137151744E-002 1.185000735210598E-002 1.230102863572803E-002 1.276916849669199E-002 + 1.325507356912898E-002 1.375941470994536E-002 1.428288789281739E-002 1.482621513428825E-002 + 1.539014545305881E-002 1.597545586359806E-002 1.658295240523070E-002 1.721347120789546E-002 + 1.786787959580134E-002 1.854707723024472E-002 1.925199729288705E-002 1.998360771082872E-002 + 2.074291242485196E-002 2.153095270224428E-002 2.234880849565039E-002 2.319759984944155E-002 + 2.407848835512776E-002 2.499267865737929E-002 2.594142001226318E-002 2.692600789933873E-002 + 2.794778568929834E-002 2.900814636887709E-002 3.010853432479592E-002 3.125044718854243E-002 + 3.243543774383071E-002 3.366511589862359E-002 3.494115072363479E-002 3.626527255926863E-002 + 3.763927519298975E-002 3.906501810914944E-002 4.054442881333175E-002 4.207950523331111E-002 + 4.367231819874513E-002 4.532501400175497E-002 4.703981704056784E-002 4.881903254842358E-002 + 5.066504940996304E-002 5.258034306733327E-002 5.456747851825800E-002 5.662911340832629E-002 + 5.876800121975880E-002 6.098699455890712E-002 6.328904854473022E-002 6.567722430048371E-002 + 6.815469255082574E-002 7.072473732652348E-002 7.339075977889671E-002 7.615628210608991E-002 + 7.902495159320658E-002 8.200054476826422E-002 8.508697167585164E-002 8.828828027026882E-002 + 9.160866092982083E-002 9.505245109381047E-002 9.862414002362579E-002 1.023283736891636E-001 + 1.061699597816364E-001 1.101538728536122E-001 1.142852595869053E-001 1.185694441886741E-001 + 1.230119339158125E-001 1.276184247273954E-001 1.323948070646003E-001 1.373471717571457E-001 + 1.424818160548668E-001 1.478052497825975E-001 1.533242016160193E-001 1.590456254755947E-001 + 1.649767070351059E-001 1.711248703406627E-001 1.774977845353474E-001 1.841033706838816E-001 + 1.909498086908737E-001 1.980455443053014E-001 2.053992962028930E-001 2.130200631370275E-001 + 2.209171311476130E-001 2.291000808161766E-001 2.375787945540599E-001 2.463634639091740E-001 + 2.554645968752379E-001 2.648930251857339E-001 2.746599115730528E-001 2.847767569713646E-001 + 2.952554076396947E-001 3.061080621794893E-001 3.173472784185771E-001 3.289859801309166E-001 + 3.410374635588135E-001 3.535154037013953E-001 3.664338603300792E-001 3.798072836884516E-001 + 3.936505198305023E-001 4.079788155474377E-001 4.228078228293061E-001 4.381536028035404E-001 + 4.540326290879629E-001 4.704617904911644E-001 4.874583929881308E-001 5.050401608936693E-001 + 5.232252371506759E-001 5.420321826443093E-001 5.614799744469707E-001 5.815880028924906E-001 + 6.023760673709444E-001 6.238643707284807E-001 6.460735121488540E-001 6.690244783855609E-001 + 6.927386332052708E-001 7.172377048945515E-001 7.425437716731818E-001 7.686792448479188E-001 + 7.956668495311675E-001 8.235296027391584E-001 8.522907886739891E-001 8.819739309837126E-001 + 9.126027617838534E-001 9.442011872131006E-001 9.767932492850091E-001 1.010403083786419E+000 + 1.045054873962551E+000 1.080772799717534E+000 1.117580982048530E+000 1.155503422421071E+000 + 1.194563936782904E+000 1.234786083904216E+000 1.276193087722850E+000 1.318807753365018E+000 + 1.362652376504839E+000 1.407748645719751E+000 1.454117537494557E+000 1.501779203523582E+000 + 1.550752849959623E+000 1.601056608259620E+000 1.652707397280593E+000 1.705720776286531E+000 + 1.760110788536652E+000 1.815889795139622E+000 1.873068298876423E+000 1.931654757717142E+000 + 1.991655387785505E+000 2.053073955558424E+000 2.115911559128453E+000 2.180166398404413E+000 + 2.245833534180202E+000 2.312904636065721E+000 2.381367719345900E+000 2.451206870916462E+000 + 2.522401964537952E+000 2.594928365753463E+000 2.668756626932225E+000 2.743852173029744E+000 + 2.820174978797888E+000 2.897679238335086E+000 2.976313028037556E+000 3.056017964199745E+000 + 3.136728856713650E+000 3.218373360535287E+000 3.300871626820664E+000 3.384135955883575E+000 + 3.468070454393972E+000 3.552570699516445E+000 3.637523412984249E+000 3.722806148413395E+000 + 3.808286995481477E+000 3.893824304927217E+000 3.979266438663885E+000 4.064451549642516E+000 + 4.149207396444270E+000 4.233351197920884E+000 4.316689533535072E+000 4.399018295370902E+000 + 4.480122698083595E+000 4.559777353330997E+000 4.637746415466567E+000 4.713783805470111E+000 + 4.787633520234990E+000 4.859030034412503E+000 4.927698802022600E+000 4.993356864964404E+000 + 5.055713575389352E+000 5.114471438620295E+000 5.169327082900756E+000 5.219972361726859E+000 + 5.266095593837488E+000 5.307382945106167E+000 5.343519955578034E+000 5.374193213719792E+000 + 5.399092178590265E+000 5.417911149088861E+000 5.430351377695985E+000 5.436123324181819E+000 + 5.434949042632221E+000 5.426564692828907E+000 5.410723164537805E+000 5.387196800620468E+000 + 5.355780202110796E+000 5.316293095520185E+000 5.268583239681751E+000 5.212529346458149E+000 + 5.148043986661832E+000 5.075076449623605E+000 4.993615522049914E+000 4.903692149193208E+000 + 4.805381938988256E+000 4.698807467746647E+000 4.584140344323987E+000 4.461602988446097E+000 + 4.331470078172054E+000 4.194069621346860E+000 4.049783606412324E+000 3.899048189155459E+000 + 3.742353373917331E+000 3.580242150493290E+000 3.413309051444106E+000 3.242198098804681E+000 + 3.067600114211031E+000 2.890249372231510E+000 2.710919583137901E+000 2.530419198423502E+000 + 2.349586039988150E+000 2.169281261984241E+000 1.990382662755268E+000 1.813777373017099E+000 + 1.640353955346093E+000 1.470993959088717E+000 1.306562983963455E+000 1.147901314893992E+000 + 9.958142000657394E-001 8.510618539711469E-001 7.143492775377758E-001 5.863159986561808E-001 + 4.675258490132335E-001 3.584569077138738E-001 2.594917595319485E-001 1.709082367536493E-001 + 9.287083965571109E-002 2.542306310172526E-002 -3.151910282694076E-002 -7.817217999083925E-002 +-1.148883368712655E-001 -1.421561944320368E-001 -1.605987546408234E-001 -1.709677927764287E-001 +-1.741339244025560E-001 -1.710714065757611E-001 -1.628365601636454E-001 -1.505385069835973E-001 +-1.353007042597320E-001 -1.182115338424319E-001 -1.002619706487867E-001 -8.226510148249258E-002 +-6.486478244285586E-002 -4.867106843062511E-002 -3.425552340464791E-002 -2.211133100224610E-002 +-1.260371269767548E-002 -5.909259850195633E-003 -1.942647218801536E-003 -2.690080039601190E-004 + 8.391833212926056E-014 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 + dion(1:4) = +-1.275816085584227E+000 0.000000000000000E+000 0.000000000000000E+000 -4.814177794229427E+000 +/ + +&pswfc + els(1) = "3P" + lchi(1) = 1 + oc(1) = 6.000000000000000E+000 + nchi(1) = 2 + epseu(1) = -6.571780880819030E+000 + rcut_chi(1) = 9.000000000000000E-001 + rcutus_chi(1) = 9.000000000000000E-001 + chi(1:1177,1) = + 5.713073518220381E-009 5.857700662653833E-009 6.005989060668534E-009 6.158031397339205E-009 + 6.313922704074705E-009 6.473760418015427E-009 6.637644442934680E-009 6.805677211681779E-009 + 6.977963750205942E-009 7.154611743200913E-009 7.335731601411389E-009 7.521436530643325E-009 + 7.711842602521241E-009 7.907068827036787E-009 8.107237226933830E-009 8.312472913976655E-009 + 8.522904167148867E-009 8.738662512831953E-009 8.959882807013523E-009 9.186703319576714E-009 + 9.419265820723326E-009 9.657715669584842E-009 9.902201905076596E-009 1.015287733905194E-008 + 1.040989865181461E-008 1.067342649004904E-008 1.094362556722973E-008 1.122066476657256E-008 + 1.150471724659222E-008 1.179596054933200E-008 1.209457671133326E-008 1.240075237741424E-008 + 1.271467891732910E-008 1.303655254538029E-008 1.336657444305878E-008 1.370495088478911E-008 + 1.405189336685755E-008 1.440761873960420E-008 1.477234934296146E-008 1.514631314542374E-008 + 1.552974388653514E-008 1.592288122298430E-008 1.632597087839757E-008 1.673926479692432E-008 + 1.716302130071017E-008 1.759750525135674E-008 1.804298821546874E-008 1.849974863439194E-008 + 1.896807199824803E-008 1.944825102437521E-008 1.994058584028609E-008 2.044538417125708E-008 + 2.096296153266663E-008 2.149364142720271E-008 2.203775554706244E-008 2.259564398127038E-008 + 2.316765542824532E-008 2.375414741374813E-008 2.435548651434685E-008 2.497204858653912E-008 + 2.560421900167446E-008 2.625239288682402E-008 2.691697537174777E-008 2.759838184211373E-008 + 2.829703819912758E-008 2.901338112573461E-008 2.974785835956074E-008 3.050092897276317E-008 + 3.127306365896521E-008 3.206474502745515E-008 3.287646790483272E-008 3.370873964429167E-008 + 3.456208044273207E-008 3.543702366589997E-008 3.633411618175872E-008 3.725391870229881E-008 + 3.819700613400114E-008 3.916396793717233E-008 4.015540849437620E-008 4.117194748819271E-008 + 4.221422028853945E-008 4.328287834979859E-008 4.437858961799687E-008 4.550203894829341E-008 + 4.665392853303653E-008 4.783497834065657E-008 4.904592656566941E-008 5.028753009007196E-008 + 5.156056495641797E-008 5.286582685286962E-008 5.420413161052841E-008 5.557631571335585E-008 + 5.698323682100320E-008 5.842577430487623E-008 5.990482979777100E-008 6.142132775742325E-008 + 6.297621604432445E-008 6.457046651416518E-008 6.620507562527624E-008 6.788106506144750E-008 + 6.959948237051308E-008 7.136140161910261E-008 7.316792406396731E-008 7.502017884030120E-008 + 7.691932366748701E-008 7.886654557270799E-008 8.086306163287817E-008 8.291011973535446E-008 + 8.500899935790682E-008 8.716101236843297E-008 8.936750384491775E-008 9.162985291615053E-008 + 9.394947362372469E-008 9.632781580585937E-008 9.876636600359513E-008 1.012666483899294E-007 + 1.038302257224736E-007 1.064587003202274E-007 1.091537150650789E-007 1.119169544286593E-007 + 1.147501455251907E-007 1.176550591909888E-007 1.206335110912917E-007 1.236873628551096E-007 + 1.268185232388017E-007 1.300289493191110E-007 1.333206477163988E-007 1.366956758488476E-007 + 1.401561432184126E-007 1.437042127293284E-007 1.473421020399928E-007 1.510720849490745E-007 + 1.548964928167094E-007 1.588177160216755E-007 1.628382054554560E-007 1.669604740541238E-007 + 1.711870983690070E-007 1.755207201771161E-007 1.799640481323377E-007 1.845198594584303E-007 + 1.891910016848763E-007 1.939803944266797E-007 1.988910312092166E-007 2.039259813392845E-007 + 2.090883918235168E-007 2.143814893353606E-007 2.198085822318499E-007 2.253730626214340E-007 + 2.310784084841524E-007 2.369281858454816E-007 2.429260510052138E-007 2.490757528227604E-007 + 2.553811350603057E-007 2.618461387852807E-007 2.684748048336534E-007 2.752712763355788E-007 + 2.822398013049851E-007 2.893847352947156E-007 2.967105441188855E-007 3.042218066441560E-007 + 3.119232176516694E-007 3.198195907714332E-007 3.279158614909901E-007 3.362170902402503E-007 + 3.447284655544195E-007 3.534553073169931E-007 3.624030700848499E-007 3.715773464975196E-007 + 3.809838707727543E-007 3.906285222905945E-007 4.005173292681603E-007 4.106564725274767E-007 + 4.210522893586751E-007 4.317112774809957E-007 4.426400991040630E-007 4.538455850919692E-007 + 4.653347392327757E-007 4.771147426160950E-007 4.891929581214888E-007 5.015769350204942E-007 + 5.142744136951472E-007 5.272933304759591E-007 5.406418226023604E-007 5.543282333087258E-007 + 5.683611170391443E-007 5.827492447942074E-007 5.975016096131481E-007 6.126274321947595E-007 + 6.281361666606086E-007 6.440375064641467E-007 6.603413904494048E-007 6.770580090630710E-007 + 6.941978107238163E-007 7.117715083528716E-007 7.297900860699198E-007 7.482648060584904E-007 + 7.672072156051603E-007 7.866291543169447E-007 8.065427615213961E-007 8.269604838540438E-007 + 8.478950830378973E-007 8.693596438598965E-007 8.913675823492812E-007 9.139326541629951E-007 + 9.370689631833687E-007 9.607909703334458E-007 9.851135026154782E-007 1.010051762378221E-006 + 1.035621336818827E-006 1.061838207725295E-006 1.088718761465526E-006 1.116279799229268E-006 + 1.144538547529328E-006 1.173512668968616E-006 1.203220273279767E-006 1.233679928644216E-006 + 1.264910673297822E-006 1.296932027430286E-006 1.329764005385799E-006 1.363427128172547E-006 + 1.397942436288887E-006 1.433331502874229E-006 1.469616447192817E-006 1.506819948458851E-006 + 1.544965260011594E-006 1.584076223849314E-006 1.624177285531154E-006 1.665293509456231E-006 + 1.707450594529532E-006 1.750674890224378E-006 1.794993413051513E-006 1.840433863445098E-006 + 1.887024643076173E-006 1.934794872604399E-006 1.983774409879188E-006 2.033993868601571E-006 + 2.085484637458510E-006 2.138278899741569E-006 2.192409653462230E-006 2.247910731976428E-006 + 2.304816825131168E-006 2.363163500946497E-006 2.422987227846298E-006 2.484325397451888E-006 + 2.547216347952607E-006 2.611699388068019E-006 2.677814821616719E-006 2.745603972707082E-006 + 2.815109211565691E-006 2.886373981019619E-006 2.959442823649079E-006 3.034361409627442E-006 + 3.111176565265995E-006 3.189936302281305E-006 3.270689847803454E-006 3.353487675143940E-006 + 3.438381535342424E-006 3.525424489512064E-006 3.614670942003660E-006 3.706176674409330E-006 + 3.799998880426937E-006 3.896196201607131E-006 3.994828764005244E-006 4.095958215761033E-006 + 4.199647765629724E-006 4.305962222488438E-006 4.414968035842662E-006 4.526733337358139E-006 + 4.641327983444084E-006 4.758823598914345E-006 4.879293621753842E-006 5.002813349018186E-006 + 5.129459983895199E-006 5.259312683957783E-006 5.392452610638234E-006 5.528962979954941E-006 + 5.668929114523199E-006 5.812438496882566E-006 5.959580824174193E-006 6.110448064202220E-006 + 6.265134512914285E-006 6.423736853337107E-006 6.586354216003922E-006 6.753088240911531E-006 + 6.924043141045772E-006 7.099325767514999E-006 7.279045676332327E-006 7.463315196888354E-006 + 7.652249502157200E-006 7.845966680679684E-006 8.044587810368610E-006 8.248237034182334E-006 + 8.457041637713870E-006 8.671132128744024E-006 8.890642318808284E-006 9.115709406828377E-006 + 9.346474064860870E-006 9.583080526016236E-006 9.825676674603501E-006 1.007441413855665E-005 + 1.032944838420064E-005 1.059093881341619E-005 1.085904886326406E-005 1.113394610813116E-005 + 1.141580236446217E-005 1.170479379814215E-005 1.200110103459743E-005 1.230490927168319E-005 + 1.261640839542871E-005 1.293579309871225E-005 1.326326300293989E-005 1.359902278280440E-005 + 1.394328229420183E-005 1.429625670538612E-005 1.465816663144336E-005 1.502923827216987E-005 + 1.540970355344020E-005 1.579980027215343E-005 1.619977224484822E-005 1.660986946007959E-005 + 1.703034823465251E-005 1.746147137380995E-005 1.790350833547557E-005 1.835673539865347E-005 + 1.882143583609033E-005 1.929790009130787E-005 1.978642596011597E-005 2.028731877672012E-005 + 2.080089160453927E-005 2.132746543185352E-005 2.186736937240354E-005 2.242094087106718E-005 + 2.298852591474199E-005 2.357047924856492E-005 2.416716459760458E-005 2.477895489416455E-005 + 2.540623251083947E-005 2.604938949946970E-005 2.670882783614387E-005 2.738495967240193E-005 + 2.807820759279626E-005 2.878900487897086E-005 2.951779578042449E-005 3.026503579212608E-005 + 3.103119193915635E-005 3.181674306855302E-005 3.262218014854190E-005 3.344800657534122E-005 + 3.429473848772997E-005 3.516290508957755E-005 3.605304898053553E-005 3.696572649509809E-005 + 3.790150805024330E-005 3.886097850187181E-005 3.984473751026571E-005 4.085339991479567E-005 + 4.188759611811052E-005 4.294797248004908E-005 4.403519172151960E-005 4.514993333860003E-005 + 4.629289402711687E-005 4.746478811796767E-005 4.866634802345915E-005 4.989832469493981E-005 + 5.116148809201185E-005 5.245662766361647E-005 5.378455284129158E-005 5.514609354491099E-005 + 5.654210070121964E-005 5.797344677548918E-005 5.944102631662573E-005 6.094575651606926E-005 + 6.248857778083441E-005 6.407045432104942E-005 6.569237475236050E-005 6.735535271357702E-005 + 6.906042749994296E-005 7.080866471243000E-005 7.260115692345682E-005 7.443902435945090E-005 + 7.632341560067733E-005 7.825550829877211E-005 8.023650991242716E-005 8.226765846168549E-005 + 8.435022330131840E-005 8.648550591376522E-005 8.867484072213113E-005 9.091959592374984E-005 + 9.322117434483113E-005 9.558101431672523E-005 9.800059057435196E-005 1.004814151773530E-004 + 1.030250384545423E-004 1.056330499722440E-004 1.083070795271204E-004 1.110487981641092E-004 + 1.138599192201045E-004 1.167421993940314E-004 1.196974398439822E-004 1.227274873120961E-004 + 1.258342352778855E-004 1.290196251407243E-004 1.322856474322381E-004 1.356343430593488E-004 + 1.390678045787496E-004 1.425881775036032E-004 1.461976616432769E-004 1.498985124769495E-004 + 1.536930425619438E-004 1.575836229776631E-004 1.615726848060283E-004 1.656627206493412E-004 + 1.698562861865117E-004 1.741560017686251E-004 1.785645540548358E-004 1.830846976896097E-004 + 1.877192570223554E-004 1.924711278705159E-004 1.973432793272153E-004 2.023387556145867E-004 + 2.074606779839320E-004 2.127122466638953E-004 2.180967428578607E-004 2.236175307918163E-004 + 2.292780598139555E-004 2.350818665473220E-004 2.410325770968345E-004 2.471339093120611E-004 + 2.533896751071516E-004 2.598037828393642E-004 2.663802397476657E-004 2.731231544529182E-004 + 2.800367395212030E-004 2.871253140918743E-004 2.943933065719702E-004 3.018452573986533E-004 + 3.094858218713963E-004 3.173197730556621E-004 3.253520047598863E-004 3.335875345876006E-004 + 3.420315070665914E-004 3.506891968570314E-004 3.595660120405682E-004 3.686674974924117E-004 + 3.779993383385032E-004 3.875673634999063E-004 3.973775493266154E-004 4.074360233230248E-004 + 4.177490679673661E-004 4.283231246274727E-004 4.391647975752925E-004 4.502808581026295E-004 + 4.616782487406539E-004 4.733640875857903E-004 4.853456727346490E-004 4.976304868307436E-004 + 5.102262017257931E-004 5.231406832584883E-004 5.363819961536640E-004 5.499584090448993E-004 + 5.638783996236400E-004 5.781506599180109E-004 5.927841017045704E-004 6.077878620563361E-004 + 6.231713090304942E-004 6.389440474992889E-004 6.551159251276757E-004 6.716970385014099E-004 + 6.886977394093370E-004 7.061286412837312E-004 7.240006258026451E-004 7.423248496583107E-004 + 7.611127514957392E-004 7.803760590257751E-004 8.001267963169563E-004 8.203772912706376E-004 + 8.411401832839652E-004 8.624284311053620E-004 8.842553208873406E-004 9.066344744415555E-004 + 9.295798577011283E-004 9.531057893954097E-004 9.772269499424601E-004 1.001958390564666E-003 + 1.027315542633046E-003 1.053314227245918E-003 1.079970665047754E-003 1.107301486294182E-003 + 1.135323741169258E-003 1.164054910361235E-003 1.193512915903265E-003 1.223716132285581E-003 + 1.254683397845882E-003 1.286434026444810E-003 1.318987819433567E-003 1.352365077920887E-003 + 1.386586615346769E-003 1.421673770370528E-003 1.457648420080926E-003 1.494532993536322E-003 + 1.532350485642965E-003 1.571124471379764E-003 1.610879120378044E-003 1.651639211865015E-003 + 1.693430149979899E-003 1.736277979471848E-003 1.780209401789016E-003 1.825251791568369E-003 + 1.871433213536035E-003 1.918782439828262E-003 1.967328967743211E-003 2.017103037934150E-003 + 2.068135653054780E-003 2.120458596867728E-003 2.174104453827462E-003 2.229106629149178E-003 + 2.285499369375459E-003 2.343317783452756E-003 2.402597864330085E-003 2.463376511092538E-003 + 2.525691551642581E-003 2.589581765942310E-003 2.655086909830236E-003 2.722247739426420E-003 + 2.791106036140081E-003 2.861704632294196E-003 2.934087437381839E-003 3.008299464969402E-003 + 3.084386860262169E-003 3.162396928348070E-003 3.242378163135729E-003 3.324380277003370E-003 + 3.408454231175433E-003 3.494652266844189E-003 3.583027937053955E-003 3.673636139365939E-003 + 3.766533149322130E-003 3.861776654726989E-003 3.959425790766217E-003 4.059541175982152E-003 + 4.162184949125875E-003 4.267420806906436E-003 4.375314042658120E-003 4.485931585947039E-003 + 4.599342043138836E-003 4.715615738949706E-003 4.834824759003379E-003 4.957042993417176E-003 + 5.082346181440796E-003 5.210811957171814E-003 5.342519896372436E-003 5.477551564412611E-003 + 5.615990565364862E-003 5.757922592276994E-003 5.903435478649066E-003 6.052619251141638E-003 + 6.205566183542861E-003 6.362370852022357E-003 6.523130191700438E-003 6.687943554561702E-003 + 6.856912768742575E-003 7.030142199222913E-003 7.207738809952163E-003 7.389812227441342E-003 + 7.576474805852377E-003 7.767841693617107E-003 7.964030901618501E-003 8.165163372967426E-003 + 8.371363054408641E-003 8.582756969390318E-003 8.799475292831834E-003 9.021651427625134E-003 + 9.249422082905422E-003 9.482927354127490E-003 9.722310804984388E-003 9.967719551205786E-003 + 1.021930434627354E-002 1.047721966909285E-002 1.074162381365745E-002 1.101267898074788E-002 + 1.129055137170239E-002 1.157541128430012E-002 1.186743321079685E-002 1.216679593815386E-002 + 1.247368265050078E-002 1.278828103387346E-002 1.311078338326844E-002 1.344138671205549E-002 + 1.378029286379032E-002 1.412770862646918E-002 1.448384584926761E-002 1.484892156180568E-002 + 1.522315809598153E-002 1.560678321041590E-002 1.600003021754945E-002 1.640313811343490E-002 + 1.681635171026592E-002 1.723992177168403E-002 1.767410515090491E-002 1.811916493170461E-002 + 1.857537057230618E-002 1.904299805220614E-002 1.952233002197979E-002 2.001365595610371E-002 + 2.051727230883233E-002 2.103348267316524E-002 2.156259794294008E-002 2.210493647808495E-002 + 2.266082427306302E-002 2.323059512853970E-002 2.381459082630222E-002 2.441316130745856E-002 + 2.502666485394111E-002 2.565546827333816E-002 2.629994708707389E-002 2.696048572195489E-002 + 2.763747770509827E-002 2.833132586225354E-002 2.904244251952696E-002 2.977124970851373E-002 + 3.051817937483866E-002 3.128367359010358E-002 3.206818476723304E-002 3.287217587920670E-002 + 3.369612068116147E-002 3.454050393583990E-002 3.540582164235696E-002 3.629258126824997E-002 + 3.720130198476997E-002 3.813251490536642E-002 3.908676332730810E-002 4.006460297637648E-002 + 4.106660225455796E-002 4.209334249065336E-002 4.314541819371209E-002 4.422343730918901E-002 + 4.532802147771082E-002 4.645980629632635E-002 4.761944158210428E-002 4.880759163792714E-002 + 5.002493552031765E-002 5.127216730911844E-002 5.254999637882981E-002 5.385914767139585E-002 + 5.520036197020921E-002 5.657439617508833E-002 5.798202357796120E-002 5.942403413896801E-002 + 6.090123476267542E-002 6.241444957407035E-002 6.396452019397830E-002 6.555230601352596E-002 + 6.717868446723950E-002 6.884455130434446E-002 7.055082085780030E-002 7.229842631057415E-002 + 7.408831995862353E-002 7.592147347002363E-002 7.779887813963982E-002 7.972154513870464E-002 + 8.169050575862108E-002 8.370681164827093E-002 8.577153504406060E-002 8.788576899189401E-002 + 9.005062756020821E-002 9.226724604316014E-002 9.453678115299718E-002 9.686041120058649E-002 + 9.923933626302071E-002 1.016747783371535E-001 1.041679814778539E-001 1.067202119197002E-001 + 1.093327581807613E-001 1.120069311470387E-001 1.147440641360644E-001 1.175455129380643E-001 + 1.204126558330166E-001 1.233468935818344E-001 1.263496493898189E-001 1.294223688404186E-001 + 1.325665197972350E-001 1.357835922721032E-001 1.390750982569593E-001 1.424425715170955E-001 + 1.458875673432704E-001 1.494116622600171E-001 1.530164536873567E-001 1.567035595529764E-001 + 1.604746178517895E-001 1.643312861496326E-001 1.682752410276975E-001 1.723081774641204E-001 + 1.764318081489735E-001 1.806478627287212E-001 1.849580869759995E-001 1.893642418803787E-001 + 1.938681026555545E-001 1.984714576581815E-001 2.031761072133378E-001 2.079838623413518E-001 + 2.128965433804712E-001 2.179159784995794E-001 2.230440020948770E-001 2.282824530641546E-001 + 2.336331729519603E-001 2.390980039586419E-001 2.446787868058939E-001 2.503773584510773E-001 + 2.561955496421954E-001 2.621351823050089E-001 2.681980667533456E-001 2.743859987132232E-001 + 2.807007561509228E-001 2.871440958946723E-001 2.937177500390677E-001 3.004234221208222E-001 + 3.072627830538615E-001 3.142374668111733E-001 3.213490658402017E-001 3.285991261978967E-001 + 3.359891423908508E-001 3.435205519052233E-001 3.511947294103880E-001 3.590129806194707E-001 + 3.669765357890997E-001 3.750865428398666E-001 3.833440600781134E-001 3.917500484987532E-001 + 4.003053636479501E-001 4.090107470235244E-001 4.178668169900496E-001 4.268740591846757E-001 + 4.360328163888140E-001 4.453432778399675E-001 4.548054679571731E-001 4.644192344528016E-001 + 4.741842358028488E-001 4.840999280473583E-001 4.941655508923467E-001 5.043801130845090E-001 + 5.147423770302204E-001 5.252508426309177E-001 5.359037303079197E-001 5.466989631912692E-001 + 5.576341484492779E-001 5.687065577382957E-001 5.799131067559328E-001 5.912503338856296E-001 + 6.027143779263657E-001 6.143009549084800E-001 6.260053340053687E-001 6.378223125614040E-001 + 6.497461902689722E-001 6.617707425425083E-001 6.738891931548775E-001 6.860941862219171E-001 + 6.983777576446752E-001 7.107313061461353E-001 7.231455640705178E-001 7.356105681487528E-001 + 7.481156304739432E-001 7.606493099757455E-001 7.731993847329376E-001 7.857528255192076E-001 + 7.982957710384382E-001 8.108135053724798E-001 8.232904382364516E-001 8.357100887134206E-001 + 8.480550732214085E-001 8.603070985497995E-001 8.724469608881676E-001 8.844545518561425E-001 + 8.963088726258920E-001 9.079880573057736E-001 9.194694068207137E-001 9.307294345771253E-001 + 9.417439252316196E-001 9.524880078864280E-001 9.629362450020343E-001 9.730627382392718E-001 + 9.828412523080385E-001 9.922453576951257E-001 1.001248592855112E+000 1.009824646060030E+000 + 1.017947556597752E+000 1.025591934366663E+000 1.032733196113644E+000 1.039347815581042E+000 + 1.045413583640763E+000 1.050909873072501E+000 1.055817900958262E+000 1.060120979682472E+000 + 1.063804745207637E+000 1.066857348594371E+000 1.069269593597920E+000 1.071034999536379E+000 + 1.072149764409427E+000 1.072612598354798E+000 1.072424391847801E+000 1.071587690426032E+000 + 1.070106118270693E+000 1.067984202196006E+000 1.065227351723261E+000 1.061841848932560E+000 + 1.057834836312705E+000 1.053214302726913E+000 1.047989067607154E+000 1.042168763484356E+000 + 1.035763816955753E+000 1.028785428184352E+000 1.021245549019500E+000 1.013156859821308E+000 + 1.004532745065794E+000 9.953872678016865E-001 9.857351430238847E-001 9.755917100227249E-001 + 9.649729037621617E-001 9.538952253338502E-001 9.423757115279076E-001 9.304319035546309E-001 + 9.180818149450930E-001 9.053438986518637E-001 8.922370133647387E-001 8.787803890501622E-001 + 8.649935917172931E-001 8.508964874088556E-001 8.365092054115097E-001 8.218521006761215E-001 + 8.069457154407494E-001 7.918107400541491E-001 7.764679729979741E-001 7.609382801129556E-001 + 7.452425530561088E-001 7.294016670367529E-001 7.134364378889109E-001 6.973675785709821E-001 + 6.812156552203880E-001 6.650010429212662E-001 6.487438813816720E-001 6.324640307551969E-001 + 6.161810278793450E-001 5.999140432373210E-001 5.836818389791119E-001 5.675027283596522E-001 + 5.513945369645278E-001 5.353745660955663E-001 5.194595586785719E-001 5.036656680328989E-001 + 4.880084298076144E-001 4.725027373423477E-001 4.571628206540134E-001 4.420022291852051E-001 + 4.270338183785754E-001 4.122697400665679E-001 3.977214365901936E-001 3.833996384871282E-001 + 3.693143655208982E-001 3.554749307620615E-001 3.418899473813509E-001 3.285673377757301E-001 + 3.155143446227681E-001 3.027375434476552E-001 2.902428562910548E-001 2.780355660845704E-001 + 2.661203313730894E-001 2.545012010681478E-001 2.431816289715946E-001 2.321644878716100E-001 + 2.214520830804775E-001 2.110461653521245E-001 2.009479431840698E-001 1.911580945698065E-001 + 1.816767783211351E-001 1.725036451232393E-001 1.636378485168610E-001 1.550780560209846E-001 + 1.468224606159177E-001 1.388687928012488E-001 1.312143334271021E-001 1.238559274721409E-001 + 1.167899989098829E-001 1.100125667682416E-001 1.035192624479151E-001 9.730534832530055E-002 + 9.136573762674108E-002 8.569501552456846E-002 8.028746137268214E-002 7.513707197108518E-002 + 7.023758572533338E-002 6.558250754842999E-002 6.116513433927525E-002 5.697858086311113E-002 + 5.301580585514614E-002 4.926963816823227E-002 4.573280278860544E-002 4.239794654977374E-002 + 3.925766338312286E-002 3.630451895422748E-002 3.353107454575449E-002 3.092991006081133E-002 + 2.849364603427643E-002 2.621496455373082E-002 2.408662900583072E-002 2.210150257809416E-002 + 2.025256545993835E-002 1.853293070024925E-002 1.693585869167060E-002 1.545477026407370E-002 + 1.408325838123921E-002 1.281509844559459E-002 1.164425722586924E-002 1.056490043172602E-002 + 9.571398967791302E-003 8.658333907028448E-003 7.820500230084950E-003 7.052909383099762E-003 + 6.350790711498487E-003 5.709591831549846E-003 5.124978004929267E-003 4.592830584262377E-003 + 4.109244599632740E-003 3.670525557367215E-003 3.273185523095274E-003 2.913938561153695E-003 + 2.589695601915163E-003 2.297558807601527E-003 2.034815505642234E-003 1.798931756701356E-003 + 1.587545622167612E-003 1.398460193226809E-003 1.229636440661425E-003 1.079185941292917E-003 + 9.453635335442980E-004 8.265599509974068E-004 7.212944790941751E-004 6.282076763252864E-004 + 5.460541974023030E-004 4.736957520579292E-004 4.100942292983616E-004 3.543050131738807E-004 + 3.054705124685239E-004 2.628139231632024E-004 2.256332391226233E-004 1.932955232151000E-004 + 1.652314480130730E-004 1.409301123549920E-004 1.199341373870588E-004 1.018350432542563E-004 + 8.626890537813499E-005 7.291233640150445E-005 6.147907744004595E-005 5.171549535898937E-005 + 4.339782795511430E-005 3.632921638739082E-005 3.033691447022094E-005 2.526972787969675E-005 + 2.099567181922993E-005 1.739983533262328E-005 1.438244023885100E-005 1.185708258120988E-005 + 9.749144521328623E-006 7.994364752793941E-006 6.537555746872585E-006 5.331456461151729E-006 + 4.335709528389563E-006 3.515952385446531E-006 2.843012289435873E-006 2.292195689473453E-006 + 1.842662967682300E-006 1.476880123333771E-006 1.180139540953571E-006 9.401425495972628E-007 + 7.466370398927241E-007 5.911039523531816E-007 4.664869802480603E-007 3.669603391777808E-007 + 2.877299404177229E-007 2.248637637934849E-007 1.751476567137884E-007 1.359631880161464E-007 + 1.051845580117335E-007 8.109190956092001E-008 6.229869958723697E-008 4.769107690389118E-008 + 3.637747162137628E-008 2.764683498609501E-008 2.093417769404813E-008 1.579224107433428E-008 + 1.186830066233223E-008 8.885247235514923E-009 6.626218021846809E-009 4.922162142119893E-009 + 3.641820995427706E-009 2.683687756578669E-009 1.969581860278122E-009 1.439535643347646E-009 + 1.047742449858767E-009 7.593596208553931E-010 5.479969346747525E-010 3.937521796580370E-010 + 2.816814747023348E-010 2.006134579316893E-010 1.422342052421618E-010 1.003843023343886E-010 + 7.052138454863003E-011 4.931111824374260E-011 3.431740362083495E-011 2.376885448501602E-011 + 1.638362916513345E-011 1.123867933374322E-011 7.672642966114915E-012 5.214094957198777E-012 + 3.528817082726973E-012 2.381267665705056E-012 1.606610446594055E-012 1.078256886535217E-012 + 7.198041870942759E-013 4.779228553322317E-013 3.155898280464901E-013 2.072430855648540E-013 + 1.353314306877513E-013 8.787153240779351E-014 5.672801387318032E-014 3.640955450006067E-014 + 2.323109714123703E-014 1.473426263149192E-014 9.288782155599184E-015 5.820064242028050E-015 + 3.624114725770366E-015 2.242576991226764E-015 1.378890353981225E-015 8.423921308768696E-016 + 5.112883268606081E-016 3.082824713341214E-016 1.846405501524063E-016 1.098409058846233E-016 + 6.489674298765667E-017 3.807728841250568E-017 2.218479982492339E-017 1.283373294676381E-017 + 7.370883977723126E-018 4.202578824714963E-018 2.378493684635331E-018 1.336095816291324E-018 + 7.448722400973624E-019 4.120910295415995E-019 2.262193762774352E-019 1.232109378229029E-019 + 6.657460053597807E-020 3.568323323569961E-020 1.897020761358039E-020 1.000201734219212E-020 + 5.229565096754398E-021 2.711191803593430E-021 1.393558756714095E-021 7.100906411562849E-022 + 3.586561278527761E-022 1.795438721015096E-022 8.907217994028038E-023 4.378682172295313E-023 + 2.132674992965308E-023 1.029047160316851E-023 4.918402076622400E-024 2.328300786043027E-024 + 1.091510579423154E-024 5.066843226623238E-025 2.328701444012627E-025 1.059503715396926E-025 + 4.771427112535666E-026 2.126646769693280E-026 9.379660074655577E-027 4.093230616476988E-027 + 1.767155174112370E-027 7.546642390310776E-028 3.187454398608921E-028 1.331328045537664E-028 + 5.498143627775605E-029 2.244787423740202E-029 9.059411034646792E-030 3.613491102970009E-030 + 1.424269509825342E-030 5.546647941388047E-031 2.133912065368205E-031 8.108926453879534E-032 + 3.043152537539202E-032 1.127689003239632E-032 4.125638003053172E-033 1.489906654045815E-033 + 5.310339718188228E-034 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 + + els(2) = "3D" + lchi(2) = 2 + oc(2) = 0.000000000000000E+000 + nchi(2) = 3 + epseu(2) = -3.841408597712678E+000 + rcut_chi(2) = 1.000000000000000E+000 + rcutus_chi(2) = 1.000000000000000E+000 + chi(1:1177,2) = +-1.109914671868205E-012 -1.152326727870288E-012 -1.196359433208574E-012 -1.242074716145936E-012 +-1.289536871331851E-012 -1.338812650242699E-012 -1.389971355062025E-012 -1.443084936148156E-012 +-1.498228093226232E-012 -1.555478380447005E-012 -1.614916315460140E-012 -1.676625492655419E-012 +-1.740692700731117E-012 -1.807208044754909E-012 -1.876265072888960E-012 -1.947960907957430E-012 +-2.022396384041449E-012 -2.099676188293648E-012 -2.179909008171710E-012 -2.263207684298002E-012 +-2.349689369160283E-012 -2.439475691876691E-012 -2.532692929256706E-012 -2.629472183398720E-012 +-2.729949566073948E-012 -2.834266390156022E-012 -2.942569368365481E-012 -3.055010819608706E-012 +-3.171748883201442E-012 -3.292947741278269E-012 -3.418777849700744E-012 -3.549416177789040E-012 +-3.685046457214173E-012 -3.825859440400923E-012 -3.972053168804822E-012 -4.123833251440576E-012 +-4.281413154053562E-012 -4.445014499341196E-012 -4.614867378646326E-012 -4.791210675561068E-012 +-4.974292401896150E-012 -5.164370046488373E-012 -5.361710937336643E-012 -5.566592617575997E-012 +-5.779303235818310E-012 -6.000141951408667E-012 -6.229419355167470E-012 -6.467457906209882E-012 +-6.714592385457000E-012 -6.971170366476631E-012 -7.237552704315803E-012 -7.514114043012578E-012 +-7.801243342500821E-012 -8.099344425649154E-012 -8.408836546203285E-012 -8.730154978430543E-012 +-9.063751629295926E-012 -9.410095674030595E-012 -9.769674215986787E-012 -1.014299297170695E-011 +-1.053057698217080E-011 -1.093297135122061E-011 -1.135074201220309E-011 -1.178447652390622E-011 +-1.223478489691044E-011 -1.270230045151631E-011 -1.318768070845530E-011 -1.369160831363649E-011 +-1.421479199822950E-011 -1.475796757543427E-011 -1.532189897533935E-011 -1.590737931932406E-011 +-1.651523203551586E-011 -1.714631201687144E-011 -1.780150682351046E-011 -1.848173793099279E-011 +-1.918796202629486E-011 -1.992117235330807E-011 -2.068240010975102E-011 -2.147271589746076E-011 +-2.229323122810249E-011 -2.314510008641532E-011 -2.402952055319287E-011 -2.494773649028119E-011 +-2.590103928996368E-011 -2.689076969119345E-011 -2.791831966522755E-011 -2.898513437331523E-011 +-3.009271419919302E-011 -3.124261685924550E-011 -3.243645959329974E-011 -3.367592143913411E-011 +-3.496274559390068E-011 -3.629874186578200E-011 -3.768578921933093E-011 -3.912583841807252E-011 +-4.062091476808511E-011 -4.217312096641934E-011 -4.378464005836023E-011 -4.545773850769275E-011 +-4.719476938428780E-011 -4.899817567349233E-011 -5.087049371197791E-011 -5.281435675487957E-011 +-5.483249867924211E-011 -5.692775782898258E-011 -5.910308100677614E-011 -6.136152761847969E-011 +-6.370627397592253E-011 -6.614061776411417E-011 -6.866798267915393E-011 -7.129192324336335E-011 +-7.401612980441505E-011 -7.684443372548741E-011 -7.978081277374560E-011 -8.282939671472708E-011 +-8.599447312049908E-011 -8.928049339975802E-011 -9.269207905834959E-011 -9.623402819901681E-011 +-9.991132226951503E-011 -1.037291330685864E-010 -1.076928300196463E-010 -1.118079877224109E-010 +-1.160803937930876E-010 -1.205160570041543E-010 -1.251212157351757E-010 -1.299023467465412E-010 +-1.348661742884648E-010 -1.400196795580576E-010 -1.453701105177737E-010 -1.509249920890369E-010 +-1.566921367353869E-010 -1.626796554500271E-010 -1.688959691632289E-010 -1.753498205856329E-010 +-1.820502865041089E-010 -1.890067905474613E-010 -1.962291164399378E-010 -2.037274217611819E-010 +-2.115122522319764E-010 -2.195945565458756E-010 -2.279857017675807E-010 -2.366974893197187E-010 +-2.457421715805052E-010 -2.551324691156352E-010 -2.648815885686400E-010 -2.750032412348660E-010 +-2.855116623452028E-010 -2.964216310866792E-010 -3.077484913880821E-010 -3.195081734998356E-010 +-3.317172163984882E-010 -3.443927910473178E-010 -3.575527245457688E-010 -3.712155252016827E-010 +-3.854004085615900E-010 -4.001273244356655E-010 -4.154169849553591E-010 -4.312908937031633E-010 +-4.477713759554795E-010 -4.648816100811268E-010 -4.826456601396412E-010 -5.010885097252221E-010 +-5.202360971039142E-010 -5.401153516934474E-010 -5.607542319370465E-010 -5.821817646244585E-010 +-6.044280857155177E-010 -6.275244827236505E-010 -6.515034387189335E-010 -6.763986780125896E-010 +-7.022452135871754E-010 -7.290793963391566E-010 -7.569389662031409E-010 -7.858631052296501E-010 +-8.158924926911055E-010 -8.470693622935004E-010 -8.794375615742384E-010 -9.130426135696757E-010 +-9.479317808390810E-010 -9.841541319350821E-010 -1.021760610414045E-009 -1.060804106483487E-009 +-1.101339531387250E-009 -1.143423894633069E-009 -1.187116384171142E-009 -1.232478449636462E-009 +-1.279573888771996E-009 -1.328468937154233E-009 -1.379232361347305E-009 -1.431935555616695E-009 +-1.486652642338536E-009 -1.543460576245737E-009 -1.602439252657524E-009 -1.663671619844602E-009 +-1.727243795688015E-009 -1.793245188795714E-009 -1.861768624247205E-009 -1.932910474143117E-009 +-2.006770793143271E-009 -2.083453459183904E-009 -2.163066319571924E-009 -2.245721342661674E-009 +-2.331534775327502E-009 -2.420627306453629E-009 -2.513124236671231E-009 -2.609155654581438E-009 +-2.708856619712110E-009 -2.812367352465689E-009 -2.919833431325228E-009 -3.031405997596022E-009 +-3.147241967970711E-009 -3.267504255216809E-009 -3.392361997297108E-009 -3.521990795245027E-009 +-3.656572960129651E-009 -3.796297769457609E-009 -3.941361733372446E-009 -4.091968871025926E-009 +-4.248330997509826E-009 -4.410668021751880E-009 -4.579208255794682E-009 -4.754188735892643E-009 +-4.935855555878495E-009 -5.124464213268199E-009 -5.320279968591006E-009 -5.523578218450016E-009 +-5.734644882837889E-009 -5.953776807252394E-009 -6.181282180177324E-009 -6.417480966515964E-009 +-6.662705357586545E-009 -6.917300238312623E-009 -7.181623672265383E-009 -7.456047405240013E-009 +-7.740957388074396E-009 -8.036754319445223E-009 -8.343854209405098E-009 -8.662688964452967E-009 +-8.993706994960781E-009 -9.337373845810655E-009 -9.694172851129279E-009 -1.006460581404052E-008 +-1.044919371239202E-008 -1.084847743144834E-008 -1.126301852458107E-008 -1.169340000302564E-008 +-1.214022715581544E-008 -1.260412840104647E-008 -1.308575616966943E-008 -1.358578782305247E-008 +-1.410492660560463E-008 -1.464390263379978E-008 -1.520347392299212E-008 -1.578442745346678E-008 +-1.638758027722528E-008 -1.701378066706173E-008 -1.766390930954626E-008 -1.833888054359288E-008 +-1.903964364635380E-008 -1.976718416824852E-008 -2.052252531900485E-008 -2.130672940666162E-008 +-2.212089933155591E-008 -2.296618013739626E-008 -2.384376062160304E-008 -2.475487500718028E-008 +-2.570080467847019E-008 -2.668287998323128E-008 -2.770248210357426E-008 -2.876104499838657E-008 +-2.986005741997713E-008 -3.100106500777712E-008 -3.218567246204125E-008 -3.341554580060568E-008 +-3.469241470187672E-008 -3.601807493734452E-008 -3.739439089704267E-008 -3.882329821150491E-008 +-4.030680647390579E-008 -4.184700206621344E-008 -4.344605109332828E-008 -4.510620242933335E-008 +-4.682979088014072E-008 -4.861924046697992E-008 -5.047706783534655E-008 -5.240588579420400E-008 +-5.440840699041484E-008 -5.648744772356923E-008 -5.864593190657386E-008 -6.088689517757069E-008 +-6.321348916896752E-008 -6.562898593958285E-008 -6.813678257613720E-008 -7.074040597056072E-008 +-7.344351777983526E-008 -7.624991957534354E-008 -7.916355818896654E-008 -8.218853126344649E-008 +-8.532909301481786E-008 -8.858966021501038E-008 -9.197481840303482E-008 -9.548932833348504E-008 +-9.913813267142262E-008 -1.029263629430567E-007 -1.068593467519929E-007 -1.109426152711961E-007 +-1.151819110212008E-007 -1.195831959455045E-007 -1.241526597944992E-007 -1.288967288297264E-007 +-1.338220748606932E-007 -1.389356246269571E-007 -1.442445695386652E-007 -1.497563757892466E-007 +-1.554787948544711E-007 -1.614198743926371E-007 -1.675879695612115E-007 -1.739917547658307E-007 +-1.806402358581798E-007 -1.875427627998985E-007 -1.947090428103139E-007 -2.021491540164871E-007 +-2.098735596247572E-007 -2.178931226337076E-007 -2.262191211092353E-007 -2.348632640431957E-007 +-2.438377078179147E-007 -2.531550732997120E-007 -2.628284635854634E-007 -2.728714824271450E-007 +-2.832982533602601E-007 -2.941234395630308E-007 -3.053622644742722E-007 -3.170305331989269E-007 +-3.291446547313423E-007 -3.417216650275299E-007 -3.547792509588334E-007 -3.683357751806652E-007 +-3.824103019512718E-007 -3.970226239368060E-007 -4.121932900403800E-007 -4.279436342942080E-007 +-4.442958058554416E-007 -4.612728001478520E-007 -4.788984911931141E-007 -4.971976651771378E-007 +-5.161960552986004E-007 -5.359203779486576E-007 -5.563983702726666E-007 -5.776588291666999E-007 +-5.997316517636425E-007 -6.226478774657589E-007 -6.464397315827813E-007 -6.711406706368349E-007 +-6.967854293978464E-007 -7.234100697155143E-007 -7.510520312164484E-007 -7.797501839376902E-007 +-8.095448829705630E-007 -8.404780251916009E-007 -8.725931081602535E-007 -9.059352912660913E-007 +-9.405514592114056E-007 -9.764902879183558E-007 -1.013802312953252E-006 -1.052540000564045E-006 +-1.092757821430818E-006 -1.134512327232823E-006 -1.177862230139611E-006 -1.222868485337860E-006 +-1.269594376709812E-006 -1.318105605783591E-006 -1.368470384080320E-006 -1.420759528987680E-006 +-1.475046563294531E-006 -1.531407818526310E-006 -1.589922542226298E-006 -1.650673009333321E-006 +-1.713744637812268E-006 -1.779226108699681E-006 -1.847209490732967E-006 -1.917790369738086E-006 +-1.991067982957360E-006 -2.067145358505855E-006 -2.146129460152090E-006 -2.228131337626162E-006 +-2.313266282666246E-006 -2.401653991022370E-006 -2.493418730644751E-006 -2.588689516292659E-006 +-2.687600290808700E-006 -2.790290113312826E-006 -2.896903354580009E-006 -3.007589899875586E-006 +-3.122505359532750E-006 -3.241811287567424E-006 -3.365675408637110E-006 -3.494271853661897E-006 +-3.627781404437967E-006 -3.766391747586455E-006 -3.910297738193718E-006 -4.059701673512444E-006 +-4.214813577107255E-006 -4.375851493842956E-006 -4.543041796128763E-006 -4.716619501847624E-006 +-4.896828604416023E-006 -5.083922415436590E-006 -5.278163920423539E-006 -5.479826148099044E-006 +-5.689192553777761E-006 -5.906557417376366E-006 -6.132226256605240E-006 -6.366516255920829E-006 +-6.609756711839101E-006 -6.862289495233224E-006 -7.124469531262622E-006 -7.396665297604751E-006 +-7.679259341686719E-006 -7.972648817640326E-006 -8.277246043731435E-006 -8.593479081043327E-006 +-8.921792334223137E-006 -9.262647175131274E-006 -9.616522590265581E-006 -9.983915852865115E-006 +-1.036534322063276E-005 -1.076134066005144E-005 -1.117246459830585E-005 -1.159929270385994E-005 +-1.204242469678006E-005 -1.250248318993528E-005 -1.298011456224919E-005 -1.347598986522168E-005 +-1.399080576398618E-005 -1.452528551421461E-005 -1.508017997623328E-005 -1.565626866776367E-005 +-1.625436085675581E-005 -1.687529669583786E-005 -1.751994839996257E-005 -1.818922146889174E-005 +-1.888405595622147E-005 -1.960542778671531E-005 -2.035435012377961E-005 -2.113187478898429E-005 +-2.193909373560470E-005 -2.277714057823408E-005 -2.364719218059415E-005 -2.455047030375188E-005 +-2.548824331703256E-005 -2.646182797400761E-005 -2.747259125602342E-005 -2.852195228583163E-005 +-2.961138431397762E-005 -3.074241678070339E-005 -3.191663745622573E-005 -3.313569466235779E-005 +-3.440129957855380E-005 -3.571522863557279E-005 -3.707932600007716E-005 -3.849550615360676E-005 +-3.996575656949813E-005 -4.149214049145277E-005 -4.307679981759752E-005 -4.472195809402413E-005 +-4.642992362194448E-005 -4.820309268275291E-005 -5.004395288544889E-005 -5.195508664103849E-005 +-5.393917476870679E-005 -5.599900023873294E-005 -5.813745205730445E-005 -6.035752929858140E-005 +-6.266234528955890E-005 -6.505513195348601E-005 -6.753924431781150E-005 -7.011816519285037E-005 +-7.279551002759639E-005 -7.557503194934448E-005 -7.846062699403367E-005 -8.145633953448076E-005 +-8.456636791393803E-005 -8.779507029268650E-005 -9.114697071566104E-005 -9.462676540940080E-005 +-9.823932931692565E-005 -1.019897228794554E-004 -1.058831990742199E-004 -1.099252107179519E-004 +-1.141214180460019E-004 -1.184776965773876E-004 -1.230001452764674E-004 -1.276950950223183E-004 +-1.325691173973110E-004 -1.376290338067911E-004 -1.428819249422184E-004 -1.483351406005623E-004 +-1.539963098732239E-004 -1.598733517182401E-004 -1.659744859300237E-004 -1.723082445214180E-004 +-1.788834835333796E-004 -1.857093952881595E-004 -1.927955211024309E-004 -2.001517644774069E-004 +-2.077884047836091E-004 -2.157161114585890E-004 -2.239459587365560E-004 -2.324894409295671E-004 +-2.413584882806121E-004 -2.505654834096953E-004 -2.601232783747346E-004 -2.700452123699083E-004 +-2.803451300848720E-004 -2.910374007491100E-004 -3.021369378865511E-004 -3.136592198064641E-004 +-3.256203108575795E-004 -3.380368834733307E-004 -3.509262410370919E-004 -3.643063415973189E-004 +-3.781958224635301E-004 -3.926140257151664E-004 -4.075810246564821E-004 -4.231176512517721E-004 +-4.392455245764401E-004 -4.559870803206434E-004 -4.733656013835080E-004 -4.914052495972423E-004 +-5.101310986218039E-004 -5.295691680521814E-004 -5.497464587817915E-004 -5.706909896669606E-004 +-5.924318355390044E-004 -6.149991666119614E-004 -6.384242893356965E-004 -6.627396887457125E-004 +-6.879790723627608E-004 -7.141774156970851E-004 -7.413710094139555E-004 -7.695975082190248E-004 +-7.988959815239458E-004 -8.293069659546778E-004 -8.608725197669320E-004 -8.936362792352826E-004 +-9.276435170846195E-004 -9.629412030348161E-004 -9.995780665317182E-004 -1.037604661739899E-003 +-1.077073434874960E-003 -1.118038793955617E-003 -1.160557181058260E-003 -1.204687147159246E-003 +-1.250489429652756E-003 -1.298027032634730E-003 -1.347365310046105E-003 -1.398572051771327E-003 +-1.451717572790977E-003 -1.506874805490197E-003 -1.564119395227577E-003 -1.623529799272130E-003 +-1.685187389219019E-003 -1.749176556997832E-003 -1.815584824590297E-003 -1.884502957577516E-003 +-1.956025082640092E-003 -2.030248809137656E-003 -2.107275354897749E-003 -2.187209676347222E-003 +-2.270160603122759E-003 -2.356240977300412E-003 -2.445567797387572E-003 -2.538262367224019E-003 +-2.634450449942266E-003 -2.734262427140656E-003 -2.837833463426205E-003 -2.945303676487375E-003 +-3.056818312860455E-003 -3.172527929556371E-003 -3.292588581718029E-003 -3.417162016481457E-003 +-3.546415873217016E-003 -3.680523890330034E-003 -3.819666118802951E-003 -3.964029142663790E-003 +-4.113806306568509E-003 -4.269197950686902E-003 -4.430411653084150E-003 -4.597662479791959E-003 +-4.771173242765036E-003 -4.951174765920034E-003 -5.137906159455257E-003 -5.331615102650311E-003 +-5.532558135345192E-003 -5.741000958298393E-003 -5.957218742623273E-003 -6.181496448500787E-003 +-6.414129153365493E-003 -6.655422389759563E-003 -6.905692493046788E-003 -7.165266959175435E-003 +-7.434484812674378E-003 -7.713696985062252E-003 -8.003266703843496E-003 -8.303569892258162E-003 +-8.614995579944981E-003 -8.937946324667810E-003 -9.272838645245928E-003 -9.620103465816841E-003 +-9.980186571547769E-003 -1.035354907589778E-002 -1.074066789951627E-002 -1.114203626084673E-002 +-1.155816417848449E-002 -1.198957898531658E-002 -1.243682585444796E-002 -1.290046833689312E-002 +-1.338108891098384E-002 -1.387928954341365E-002 -1.439569226180608E-002 -1.493093973865805E-002 +-1.548569588647051E-002 -1.606064646383623E-002 -1.665649969220912E-002 -1.727398688302946E-002 +-1.791386307482755E-002 -1.857690767986958E-002 -1.926392513984924E-002 -1.997574559006194E-002 +-2.071322553142768E-002 -2.147724850965326E-002 -2.226872580074288E-002 -2.308859710197935E-002 +-2.393783122740654E-002 -2.481742680674327E-002 -2.572841298655550E-002 -2.667185013240022E-002 +-2.764883053053632E-002 -2.866047908767118E-002 -2.970795402707713E-002 -3.079244757927070E-002 +-3.191518666529630E-002 -3.307743357049753E-002 -3.428048660649127E-002 -3.552568075888173E-002 +-3.681438831806583E-002 -3.814801949028370E-002 -3.952802298586160E-002 -4.095588658137812E-002 +-4.243313765225470E-002 -4.396134367203627E-002 -4.554211267437402E-002 -4.717709367346578E-002 +-4.886797703843540E-002 -5.061649481684945E-002 -5.242442100227689E-002 -5.429357174049071E-002 +-5.622580546859501E-002 -5.822302298103475E-002 -6.028716741610696E-002 -6.242022415624730E-002 +-6.462422063500889E-002 -6.690122604328452E-002 -6.925335092695563E-002 -7.168274666776722E-002 +-7.419160483884985E-002 -7.678215642591707E-002 -7.945667090478138E-002 -8.221745516543870E-002 +-8.506685227258455E-002 -8.800724005204137E-002 -9.104102949219905E-002 -9.417066294920466E-002 +-9.739861214428548E-002 -1.007273759412508E-001 -1.041594778919085E-001 -1.076974635368411E-001 +-1.113438974487319E-001 -1.151013600052123E-001 -1.189724438780256E-001 -1.229597502251756E-001 +-1.270658845726585E-001 -1.312934523723746E-001 -1.356450542228826E-001 -1.401232807398072E-001 +-1.447307070629594E-001 -1.494698869875623E-001 -1.543433467074420E-001 -1.593535781586139E-001 +-1.645030319524126E-001 -1.697941098881814E-001 -1.752291570365528E-001 -1.808104533855603E-001 +-1.865402050432015E-001 -1.924205349916691E-001 -1.984534733902655E-001 -2.046409474260645E-001 +-2.109847707136547E-001 -2.174866322478557E-001 -2.241480849160995E-001 -2.309705335802841E-001 +-2.379552227412933E-001 -2.451032238030917E-001 -2.524154219573245E-001 -2.598925027137000E-001 +-2.675349381061115E-001 -2.753429726094589E-001 -2.833166088074742E-001 -2.914555928575161E-001 +-2.997593998042666E-001 -3.082272188005585E-001 -3.168579383001092E-001 -3.256501312937503E-001 +-3.346020406677969E-001 -3.437115647704025E-001 -3.529762432791173E-001 -3.623932434703024E-001 +-3.719593469984950E-001 -3.816709373012314E-001 -3.915239877520540E-001 -4.015140506914548E-001 +-4.116362474721451E-001 -4.218852596612518E-001 -4.322553215476302E-001 -4.427402141073426E-001 +-4.533332605843729E-001 -4.640273238465699E-001 -4.748148056785735E-001 -4.856876481738981E-001 +-4.966373373870987E-001 -5.076549094041326E-001 -5.187309589841382E-001 -5.298556509190070E-001 +-5.410187342479129E-001 -5.522095594523835E-001 -5.634170987433210E-001 -5.746299695344752E-001 +-5.858364611771563E-001 -5.970245650083612E-001 -6.081820077388723E-001 -6.192962881793401E-001 +-6.303547172708437E-001 -6.413444613520145E-001 -6.522525885576996E-001 -6.630661182044184E-001 +-6.737720729758485E-001 -6.843575336775426E-001 -6.948096962843713E-001 -7.051159309573447E-001 +-7.152638426587341E-001 -7.252413329467774E-001 -7.350366624838023E-001 -7.446385137454918E-001 +-7.540360533745870E-001 -7.632189935805899E-001 -7.721776519485309E-001 -7.809030089856367E-001 +-7.893867627053061E-001 -7.976213795242063E-001 -8.056001407310364E-001 -8.133171837755898E-001 +-8.207675376245243E-001 -8.279471514366898E-001 -8.348529158263155E-001 -8.414826760073750E-001 +-8.478352361477001E-001 -8.539103543070372E-001 -8.597087273899733E-001 -8.652319656127307E-001 +-8.704825560628994E-001 -8.754638150235704E-001 -8.801798288390974E-001 -8.846353832193903E-001 +-8.888358810145258E-001 -8.927872486428545E-001 -8.964958315253919E-001 -8.999682790689296E-001 +-9.032114199525165E-001 -9.062321287089610E-001 -9.090371848577464E-001 -9.116331261403675E-001 +-9.140260977362721E-001 -9.162216996982816E-001 -9.182248352410686E-001 -9.200395629425345E-001 +-9.216689563711850E-001 -9.231149751231017E-001 -9.243783517253741E-001 -9.254584993161499E-001 +-9.263534454138350E-001 -9.270597973958549E-001 -9.275727454643544E-001 -9.278861088093873E-001 +-9.279924302976509E-001 -9.278831242043520E-001 -9.275486801324053E-001 -9.269789241657663E-001 +-9.261633352981061E-001 -9.250914110493617E-001 -9.237530706909418E-001 -9.221390773713029E-001 +-9.202414513594849E-001 -9.180538352548725E-001 -9.155717579381163E-001 -9.127927267792610E-001 +-9.097160565922359E-001 -9.063423398303055E-001 -9.026727139724054E-001 -8.987086273391314E-001 +-8.944518219630417E-001 -8.899043331435215E-001 -8.850684889530842E-001 -8.799469096982419E-001 +-8.745425073307006E-001 -8.688584847972438E-001 -8.628983353085917E-001 -8.566658414992527E-001 +-8.501650744415801E-001 -8.434003924679242E-001 -8.363764397453113E-001 -8.290981445370745E-001 +-8.215707170759501E-001 -8.137996469633921E-001 -8.057907000010360E-001 -7.975499143495947E-001 +-7.890835959062666E-001 -7.803983127892100E-001 -7.715008888107032E-001 -7.623983958197820E-001 +-7.530981448092200E-001 -7.436076756952681E-001 -7.339347456824956E-001 -7.240873161543159E-001 +-7.140735380642140E-001 -7.039017358328595E-001 -6.935803897976979E-001 -6.831181173074616E-001 +-6.725236526003895E-001 -6.618058256565174E-001 -6.509735402608411E-001 -6.400357515596777E-001 +-6.290014434313818E-001 -6.178796060233140E-001 -6.066792138273228E-001 -5.954092046742873E-001 +-5.840784600232468E-001 -5.726957869016037E-001 -5.612699018199273E-001 -5.498094169384983E-001 +-5.383228287042219E-001 -5.268185091076159E-001 -5.153046996324402E-001 -5.037895078878736E-001 +-4.922809068277141E-001 -4.807867363761457E-001 -4.693147071982353E-001 -4.578724062788215E-001 +-4.464673039088998E-001 -4.351067616268594E-001 -4.237980406255449E-001 -4.125483101170280E-001 +-4.013646551465034E-001 -3.902540833654283E-001 -3.792235303114299E-001 -3.682798627973528E-001 +-3.574298800818383E-001 -3.466803125758676E-001 -3.360378179301381E-001 -3.255089744426692E-001 +-3.151002718204150E-001 -3.048180994186386E-001 -2.946687321635849E-001 -2.846583144344612E-001 +-2.747928422374927E-001 -2.650781440465027E-001 -2.555198607105285E-001 -2.461234248397772E-001 +-2.368940400779104E-001 -2.278366606528235E-001 -2.189559715719054E-001 -2.102563697934807E-001 +-2.017419466660726E-001 -1.934164718835521E-001 -1.852833791591224E-001 -1.773457537762140E-001 +-1.696063221311138E-001 -1.620674433416176E-001 -1.547311029589543E-001 -1.475989087871304E-001 +-1.406720887849459E-001 -1.339514910012340E-001 -1.274375854732643E-001 -1.211304680014735E-001 +-1.150298657004169E-001 -1.091351442157230E-001 -1.034453164894879E-001 -9.795905295158422E-002 +-9.267469301144352E-002 -8.759025772363760E-002 -8.270346350075999E-002 -7.801173674841895E-002 +-7.351222929936828E-002 -6.920183452674210E-002 -6.507720401985227E-002 -6.113476470993396E-002 +-5.737073633747431E-002 -5.378114915725080E-002 -5.036186178188148E-002 -4.710857906949086E-002 +-4.401686996599604E-002 -4.108218521748479E-002 -3.829987487317254E-002 -3.566520550447583E-002 +-3.317337707081166E-002 -3.081953936781888E-002 -2.859880799879171E-002 -2.650627981520616E-002 +-2.453704777730558E-002 -2.268621519077722E-002 -2.094890928059408E-002 -1.932029406810130E-002 +-1.779558252238292E-002 -1.637004796184315E-002 -1.503903468675808E-002 -1.379796782828773E-002 +-1.264236240406758E-002 -1.156783157500635E-002 -1.057009410228786E-002 -9.644981007790307E-003 +-8.788441445181578E-003 -7.996547792806395E-003 -7.265499983134135E-003 -6.591629086971412E-003 +-5.971400173844213E-003 -5.401414472909904E-003 -4.878410861456299E-003 -4.399266710473836E-003 +-3.960998118939320E-003 -3.560759570318517E-003 -3.195843046376001E-003 -2.863676634671122E-003 +-2.561822667118141E-003 -2.287975427698495E-003 -2.039958467836807E-003 -1.815721568097323E-003 +-1.613337384716016E-003 -1.430998782655097E-003 -1.267022571063318E-003 -1.119826547574266E-003 +-9.879349362533364E-004 -8.699751341658228E-004 -7.646731788142539E-004 -6.708491613069328E-004 +-5.874126133216343E-004 -5.133578943032382E-004 -4.477596035912395E-004 -3.897680403364035E-004 +-3.386047321579409E-004 -2.935580515355409E-004 -2.539789369461929E-004 -2.192767337646807E-004 +-1.889151679686942E-004 -1.624084637432234E-004 -1.393176141812738E-004 -1.192468124445447E-004 +-1.018400489921678E-004 -8.677787882045583E-005 -7.377436109117977E-005 -6.257417206942536E-005 +-5.294989095056281E-005 -4.469945693410428E-005 -3.764379480314594E-005 -3.162460529291852E-005 +-2.650231568034159E-005 -2.215418529658858E-005 -1.847256005335998E-005 -1.536326957650378E-005 +-1.274416015244275E-005 -1.054375640732146E-005 -8.700044448915566E-006 -7.159369099632709E-006 +-5.875437827464562E-006 -4.808424032357347E-006 -3.924162459875888E-006 -3.193429683991710E-006 +-2.591302818212762E-006 -2.096589871223049E-006 -1.691325452183817E-006 -1.360325844747599E-006 +-1.090797801014851E-006 -8.719957510085462E-007 -6.949224742043485E-007 -5.520686322653660E-007 +-4.371869120140136E-007 -3.450968710421046E-007 -2.715169120033581E-007 -2.129201328955733E-007 +-1.664111073959767E-007 -1.296209399291765E-007 -1.006182134440443E-007 -7.783370308727961E-008 +-5.999696568954515E-008 -4.608313315035403E-008 -3.526843762439058E-008 -2.689317831343778E-008 +-2.043100428606967E-008 -1.546353586641816E-008 -1.165947965482783E-008 -8.757510151408358E-009 +-6.552295286067967E-009 -4.883134980415364E-009 -3.624762247529381E-009 -2.679926330516297E-009 +-1.973438016213078E-009 -1.447409521495869E-009 -1.057466172048978E-009 -7.697453580531138E-010 +-5.585307822933948E-010 -4.043975826752679E-010 -2.927672322006930E-010 -2.110104068774647E-010 +-1.514008766225205E-010 -1.081362540220379E-010 -7.687898990091456E-011 -5.440165591463880E-011 +-3.831413652100477E-011 -2.685483485885377E-011 -1.873165597839108E-011 -1.300150108283056E-011 +-8.979404089981892E-012 -6.170366400492423E-012 -4.218481884127906E-012 -2.869163213666832E-012 +-1.941242686664061E-012 -1.306475444173300E-012 -8.745617472794965E-013 -5.822615533903831E-013 +-3.855266429409540E-013 -2.538453335796962E-013 -1.662003599358308E-013 -1.081961540176563E-013 +-7.002892929036021E-014 -4.506063082276571E-014 -2.882299377098421E-014 -1.832611749010484E-014 +-1.158133206366638E-014 -7.273943581026671E-015 -4.540158230107176E-015 -2.815966942507531E-015 +-1.735421788970751E-015 -1.062596701481423E-015 -6.463717373513866E-016 -3.905807546256023E-016 +-2.344323634682500E-016 -1.397544796638547E-016 -8.274049108676491E-017 -4.864485432788234E-017 +-2.839775276499848E-017 -1.645965058885180E-017 -9.471257672429394E-018 -5.410101768821290E-018 +-3.067423924651603E-018 -1.726124379547633E-018 -9.639602336304101E-019 -5.341868640756639E-019 +-2.937190597105946E-019 -1.602260577206541E-019 -8.670676345057177E-020 -4.654229417879687E-020 +-2.477839684004989E-020 -1.308230566069140E-020 -6.849132223806676E-021 -3.555338107683577E-021 +-1.829673986186490E-021 -9.333977082785868E-022 -4.719675366471804E-022 -2.365165163068151E-022 +-1.174534363997429E-022 -5.779299919727447E-023 -2.817342900020602E-023 -1.360530370443916E-023 +-6.507726268499191E-024 -3.082837380927308E-024 -1.446170177246042E-024 -6.717104584671616E-025 +-3.088762733403483E-025 -1.405956361551232E-025 -6.334151138001427E-026 -2.824086707163570E-026 +-1.245901429825813E-026 -5.438106480911005E-027 -2.348073472935556E-027 -1.002804934760990E-027 +-4.235475334978145E-028 -1.768919714268841E-028 -7.304204964305237E-029 -2.981497619736009E-029 +-1.202900508574428E-029 -4.796173934462246E-030 -1.889581210844481E-030 -7.354891252835701E-031 +-2.827878979037006E-031 -1.073871297146637E-031 -4.027009360460148E-032 -1.491019483411858E-032 +-5.449851818532516E-033 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 + + els(3) = "3S" + lchi(3) = 0 + oc(3) = 2.000000000000000E+000 + nchi(3) = 1 + epseu(3) = -8.373940011626802E+000 + rcut_chi(3) = 9.434307879632442E-001 + rcutus_chi(3) = 9.434307879632442E-001 + chi(1:1177,3) = + 3.102279727032465E-005 3.141301602639238E-005 3.180814313032442E-005 3.220824032154230E-005 + 3.261337011605411E-005 3.302359581622266E-005 3.343898152065682E-005 3.385959213422685E-005 + 3.428549337820610E-005 3.471675180053999E-005 3.515343478624439E-005 3.559561056793451E-005 + 3.604334823648659E-005 3.649671775183337E-005 3.695578995389556E-005 3.742063657365070E-005 + 3.789133024434127E-005 3.836794451282392E-005 3.885055385106112E-005 3.933923366775784E-005 + 3.983406032014413E-005 4.033511112590609E-005 4.084246437526715E-005 4.135619934322087E-005 + 4.187639630191802E-005 4.240313653320917E-005 4.293650234134522E-005 4.347657706583761E-005 + 4.402344509448033E-005 4.457719187653570E-005 4.513790393608602E-005 4.570566888555325E-005 + 4.628057543938854E-005 4.686271342793412E-005 4.745217381145949E-005 4.804904869437420E-005 + 4.865343133961936E-005 4.926541618324029E-005 4.988509884914216E-005 5.051257616403184E-005 + 5.114794617254700E-005 5.179130815257592E-005 5.244276263076987E-005 5.310241139825066E-005 + 5.377035752651585E-005 5.444670538354384E-005 5.513156065010163E-005 5.582503033625770E-005 + 5.652722279810272E-005 5.723824775468042E-005 5.795821630513125E-005 5.868724094605229E-005 + 5.942543558907481E-005 6.017291557866344E-005 6.092979771013913E-005 6.169620024792846E-005 + 6.247224294404294E-005 6.325804705679062E-005 6.405373536972287E-005 6.485943221081993E-005 + 6.567526347191719E-005 6.650135662837616E-005 6.733784075900300E-005 6.818484656621750E-005 + 6.904250639647553E-005 6.991095426094858E-005 7.079032585646348E-005 7.168075858670538E-005 + 7.258239158368729E-005 7.349536572949023E-005 7.441982367827615E-005 7.535590987857809E-005 + 7.630377059587095E-005 7.726355393542578E-005 7.823540986545154E-005 7.921949024052809E-005 + 8.021594882533422E-005 8.122494131867372E-005 8.224662537780352E-005 8.328116064306869E-005 + 8.432870876284627E-005 8.538943341880359E-005 8.646350035147404E-005 8.755107738615449E-005 + 8.865233445912864E-005 8.976744364421994E-005 9.089657917967891E-005 9.203991749540847E-005 + 9.319763724053174E-005 9.436991931130642E-005 9.555694687939060E-005 9.675890542046375E-005 + 9.797598274320854E-005 9.920836901865599E-005 1.004562568099008E-004 1.017198411021896E-004 + 1.029993193333889E-004 1.042948914248346E-004 1.056067598125712E-004 1.069351294789829E-004 + 1.082802079848229E-004 1.096422055016457E-004 1.110213348446471E-004 1.124178115059178E-004 + 1.138318536881143E-004 1.152636823385547E-004 1.167135211837420E-004 1.181815967643229E-004 + 1.196681384704856E-004 1.211733785778028E-004 1.226975522835260E-004 1.242408977433361E-004 + 1.258036561085564E-004 1.273860715638335E-004 1.289883913652924E-004 1.306108658791716E-004 + 1.322537486209434E-004 1.339172962949278E-004 1.356017688344036E-004 1.373074294422240E-004 + 1.390345446319436E-004 1.407833842694624E-004 1.425542216151942E-004 1.443473333667647E-004 + 1.461629997022471E-004 1.480015043239414E-004 1.498631345027049E-004 1.517481811228393E-004 + 1.536569387275436E-004 1.555897055649380E-004 1.575467836346673E-004 1.595284787350897E-004 + 1.615351005110599E-004 1.635669625023135E-004 1.656243821924594E-004 1.677076810585881E-004 + 1.698171846215059E-004 1.719532224965984E-004 1.741161284453365E-004 1.763062404274281E-004 + 1.785239006536269E-004 1.807694556392054E-004 1.830432562581012E-004 1.853456577977428E-004 + 1.876770200145663E-004 1.900377071902303E-004 1.924280881885378E-004 1.948485365130743E-004 + 1.972994303655709E-004 1.997811527050015E-004 2.022940913074233E-004 2.048386388265705E-004 + 2.074151928552100E-004 2.100241559872691E-004 2.126659358807437E-004 2.153409453214002E-004 + 2.180496022872759E-004 2.207923300139936E-004 2.235695570608952E-004 2.263817173780098E-004 + 2.292292503738621E-004 2.321126009841350E-004 2.350322197411957E-004 2.379885628444967E-004 + 2.409820922318623E-004 2.440132756516711E-004 2.470825867359486E-004 2.501905050743764E-004 + 2.533375162892348E-004 2.565241121112885E-004 2.597507904566244E-004 2.630180555044589E-004 + 2.663264177759216E-004 2.696763942138320E-004 2.730685082634798E-004 2.765032899544190E-004 + 2.799812759832955E-004 2.835030097977109E-004 2.870690416811478E-004 2.906799288389586E-004 + 2.943362354854372E-004 2.980385329319892E-004 3.017873996764060E-004 3.055834214932679E-004 + 3.094271915254804E-004 3.133193103769627E-004 3.172603862065057E-004 3.212510348228054E-004 + 3.252918797806959E-004 3.293835524785938E-004 3.335266922571643E-004 3.377219464992341E-004 + 3.419699707309561E-004 3.462714287242521E-004 3.506269926005405E-004 3.550373429357691E-004 + 3.595031688667740E-004 3.640251681989710E-004 3.686040475154050E-004 3.732405222871733E-004 + 3.779353169852325E-004 3.826891651936203E-004 3.875028097240933E-004 3.923770027322138E-004 + 3.973125058348953E-004 4.023100902294255E-004 4.073705368139898E-004 4.124946363097088E-004 + 4.176831893842130E-004 4.229370067767737E-004 4.282569094250037E-004 4.336437285931586E-004 + 4.390983060020489E-004 4.446214939605869E-004 4.502141554989913E-004 4.558771645036664E-004 + 4.616114058537789E-004 4.674177755595530E-004 4.732971809023076E-004 4.792505405762555E-004 + 4.852787848320847E-004 4.913828556223505E-004 4.975637067486953E-004 5.038223040109204E-004 + 5.101596253579372E-004 5.165766610406156E-004 5.230744137665565E-004 5.296538988568126E-004 + 5.363161444045840E-004 5.430621914359089E-004 5.498930940723744E-004 5.568099196958840E-004 + 5.638137491154884E-004 5.709056767363251E-004 5.780868107306817E-004 5.853582732112090E-004 + 5.927212004063209E-004 6.001767428377987E-004 6.077260655006298E-004 6.153703480451159E-004 + 6.231107849612674E-004 6.309485857655278E-004 6.388849751898372E-004 6.469211933730878E-004 + 6.550584960549836E-004 6.632981547723421E-004 6.716414570578700E-004 6.800897066414392E-004 + 6.886442236538978E-004 6.973063448334491E-004 7.060774237346283E-004 7.149588309399134E-004 + 7.239519542739948E-004 7.330581990207509E-004 7.422789881429521E-004 7.516157625047328E-004 + 7.610699810968685E-004 7.706431212648849E-004 7.803366789400438E-004 7.901521688732392E-004 + 8.000911248718360E-004 8.101551000395018E-004 8.203456670190444E-004 8.306644182383246E-004 + 8.411129661592610E-004 8.516929435299652E-004 8.624060036400687E-004 8.732538205792533E-004 + 8.842380894990484E-004 8.953605268779219E-004 9.066228707897151E-004 9.180268811754618E-004 + 9.295743401186271E-004 9.412670521238233E-004 9.531068443990356E-004 9.650955671414020E-004 + 9.772350938266052E-004 9.895273215019009E-004 1.001974171082852E-003 1.014577587653796E-003 + 1.027339540772102E-003 1.040262024776275E-003 1.053347059097929E-003 1.066596688577704E-003 + 1.080012983785173E-003 1.093598041342770E-003 1.107353984253818E-003 1.121282962234684E-003 + 1.135387152051136E-003 1.149668757858933E-003 1.164130011548717E-003 1.178773173095260E-003 + 1.193600530911118E-003 1.208614402204741E-003 1.223817133343118E-003 1.239211100218982E-003 + 1.254798708622666E-003 1.270582394618645E-003 1.286564624926831E-003 1.302747897308703E-003 + 1.319134740958280E-003 1.335727716898063E-003 1.352529418379960E-003 1.369542471291288E-003 + 1.386769534565895E-003 1.404213300600480E-003 1.421876495676180E-003 1.439761880385481E-003 + 1.457872250064521E-003 1.476210435230868E-003 1.494779302026830E-003 1.513581752668364E-003 + 1.532620725899670E-003 1.551899197453534E-003 1.571420180517496E-003 1.591186726205911E-003 + 1.611201924037992E-003 1.631468902421888E-003 1.651990829144915E-003 1.672770911869969E-003 + 1.693812398638235E-003 1.715118578378271E-003 1.736692781421519E-003 1.758538380024371E-003 + 1.780658788896836E-003 1.803057465737914E-003 1.825737911777746E-003 1.848703672326651E-003 + 1.871958337331119E-003 1.895505541936850E-003 1.919348967058957E-003 1.943492339959377E-003 + 1.967939434831628E-003 1.992694073392988E-003 2.017760125484184E-003 2.043141509676711E-003 + 2.068842193887852E-003 2.094866196003525E-003 2.121217584509043E-003 2.147900479127892E-003 + 2.174919051468629E-003 2.202277525680014E-003 2.229980179114476E-003 2.258031343000027E-003 + 2.286435403120719E-003 2.315196800505787E-003 2.344320032127552E-003 2.373809651608225E-003 + 2.403670269935716E-003 2.433906556188586E-003 2.464523238270236E-003 2.495525103652454E-003 + 2.526917000128473E-003 2.558703836575636E-003 2.590890583727803E-003 2.623482274957632E-003 + 2.656484007068857E-003 2.689900941098708E-003 2.723738303130584E-003 2.758001385117140E-003 + 2.792695545713918E-003 2.827826211123641E-003 2.863398875951339E-003 2.899419104070451E-003 + 2.935892529500027E-003 2.972824857293185E-003 3.010221864436992E-003 3.048089400763902E-003 + 3.086433389874898E-003 3.125259830074536E-003 3.164574795318007E-003 3.204384436170389E-003 + 3.244694980778261E-003 3.285512735853858E-003 3.326844087671907E-003 3.368695503079339E-003 + 3.411073530518034E-003 3.453984801060803E-003 3.497436029460739E-003 3.541434015214178E-003 + 3.585985643637418E-003 3.631097886957390E-003 3.676777805416480E-003 3.723032548391675E-003 + 3.769869355528286E-003 3.817295557888366E-003 3.865318579114102E-003 3.913945936606334E-003 + 3.963185242718452E-003 4.013044205965857E-003 4.063530632251211E-003 4.114652426105722E-003 + 4.166417591946614E-003 4.218834235351114E-003 4.271910564347095E-003 4.325654890720672E-003 + 4.380075631340977E-003 4.435181309502314E-003 4.490980556284010E-003 4.547482111928156E-003 + 4.604694827235534E-003 4.662627664979973E-003 4.721289701341391E-003 4.780690127357821E-003 + 4.840838250396649E-003 4.901743495645386E-003 4.963415407622274E-003 5.025863651706935E-003 + 5.089098015691436E-003 5.153128411352047E-003 5.217964876041963E-003 5.283617574305369E-003 + 5.350096799513082E-003 5.417412975520185E-003 5.485576658345880E-003 5.554598537875995E-003 + 5.624489439588405E-003 5.695260326301745E-003 5.766922299947808E-003 5.839486603367893E-003 + 5.912964622133584E-003 5.987367886392237E-003 6.062708072737632E-003 6.138997006106120E-003 + 6.216246661698718E-003 6.294469166929479E-003 6.373676803400667E-003 6.453882008905017E-003 + 6.535097379455655E-003 6.617335671343984E-003 6.700609803226076E-003 6.784932858238033E-003 + 6.870318086140651E-003 6.956778905494068E-003 7.044328905862706E-003 7.132981850051073E-003 + 7.222751676371004E-003 7.313652500940703E-003 7.405698620016245E-003 7.498904512356032E-003 + 7.593284841618757E-003 7.688854458795456E-003 7.785628404676172E-003 7.883621912351946E-003 + 7.982850409752607E-003 8.083329522221032E-003 8.185075075124532E-003 8.288103096503964E-003 + 8.392429819761280E-003 8.498071686386176E-003 8.605045348722501E-003 8.713367672775189E-003 + 8.823055741058381E-003 8.934126855485542E-003 9.046598540302328E-003 9.160488545062928E-003 + 9.275814847650773E-003 9.392595657344309E-003 9.510849417928817E-003 9.630594810855046E-003 + 9.751850758445561E-003 9.874636427149737E-003 9.998971230848308E-003 1.012487483420845E-002 + 1.025236715609033E-002 1.038146837300613E-002 1.051219892263269E-002 1.064457950737857E-002 + 1.077863109800700E-002 1.091437493731539E-002 1.105183254387296E-002 1.119102571581731E-002 + 1.133197653471138E-002 1.147470736946197E-002 1.161924088030108E-002 1.176560002283128E-002 + 1.191380805213673E-002 1.206388852696084E-002 1.221586531395248E-002 1.236976259198170E-002 + 1.252560485652677E-002 1.268341692413410E-002 1.284322393695239E-002 1.300505136734297E-002 + 1.316892502256773E-002 1.333487104955648E-002 1.350291593975566E-002 1.367308653406000E-002 + 1.384541002782916E-002 1.401991397599131E-002 1.419662629823559E-002 1.437557528429559E-002 + 1.455678959932591E-002 1.474029828937399E-002 1.492613078694955E-002 1.511431691669394E-002 + 1.530488690115185E-002 1.549787136664758E-002 1.569330134926889E-002 1.589120830096071E-002 + 1.609162409573153E-002 1.629458103597533E-002 1.650011185891184E-002 1.670824974314821E-002 + 1.691902831536508E-002 1.713248165713030E-002 1.734864431184364E-002 1.756755129181559E-002 + 1.778923808548408E-002 1.801374066477267E-002 1.824109549259368E-002 1.847133953050051E-002 + 1.870451024649265E-002 1.894064562297800E-002 1.917978416489639E-002 1.942196490800874E-002 + 1.966722742735658E-002 1.991561184589636E-002 2.016715884331360E-002 2.042190966502176E-002 + 2.067990613135103E-002 2.094119064693245E-002 2.120580621028287E-002 2.147379642359644E-002 + 2.174520550274847E-002 2.202007828751805E-002 2.229846025203547E-002 2.258039751546118E-002 + 2.286593685290298E-002 2.315512570657847E-002 2.344801219723010E-002 2.374464513580023E-002 + 2.404507403537412E-002 2.434934912339867E-002 2.465752135418545E-002 2.496964242170665E-002 + 2.528576477269281E-002 2.560594162004158E-002 2.593022695654713E-002 2.625867556896023E-002 + 2.659134305238913E-002 2.692828582505205E-002 2.726956114339205E-002 2.761522711756618E-002 + 2.796534272732030E-002 2.831996783826213E-002 2.867916321854519E-002 2.904299055597674E-002 + 2.941151247556360E-002 2.978479255750973E-002 3.016289535568058E-002 3.054588641654931E-002 + 3.093383229864041E-002 3.132680059248768E-002 3.172485994112310E-002 3.212808006111434E-002 + 3.253653176416918E-002 3.295028697932578E-002 3.336941877574844E-002 3.379400138614945E-002 + 3.422411023085764E-002 3.465982194255644E-002 3.510121439171323E-002 3.554836671272441E-002 + 3.600135933080023E-002 3.646027398961512E-002 3.692519377974980E-002 3.739620316795252E-002 + 3.787338802724786E-002 3.835683566792297E-002 3.884663486942134E-002 3.934287591317659E-002 + 3.984565061641858E-002 4.035505236698692E-002 4.087117615918689E-002 4.139411863072514E-002 + 4.192397810076338E-002 4.246085460913013E-002 4.300484995673192E-002 4.355606774720685E-002 + 4.411461342986551E-002 4.468059434396542E-002 4.525411976436725E-002 4.583530094862342E-002 + 4.642425118555043E-002 4.702108584533973E-002 4.762592243126291E-002 4.823888063302965E-002 + 4.886008238185948E-002 4.948965190733012E-002 5.012771579606827E-002 5.077440305235072E-002 + 5.142984516068673E-002 5.209417615045547E-002 5.276753266267479E-002 5.345005401898112E-002 + 5.414188229290313E-002 5.484316238351509E-002 5.555404209155949E-002 5.627467219813144E-002 + 5.700520654602207E-002 5.774580212382119E-002 5.849661915288321E-002 5.925782117726581E-002 + 6.002957515675349E-002 6.081205156308428E-002 6.160542447950090E-002 6.240987170375379E-002 + 6.322557485468834E-002 6.405271948255341E-002 6.489149518317378E-002 6.574209571613567E-002 + 6.660471912713917E-002 6.747956787467875E-002 6.836684896121868E-002 6.926677406903689E-002 + 7.017955970091877E-002 7.110542732588769E-002 7.204460353016842E-002 7.299732017358666E-002 + 7.396381455161512E-002 7.494432956328698E-002 7.593911388520425E-002 7.694842215187828E-002 + 7.797251514265074E-002 7.901165997544940E-002 8.006613030764805E-002 8.113620654430505E-002 + 8.222217605407095E-002 8.332433339306280E-002 8.444298053701779E-002 8.557842712204741E-002 + 8.673099069432975E-002 8.790099696908700E-002 8.908878009921112E-002 9.029468295391253E-002 + 9.151905740778295E-002 9.276226464067579E-002 9.402467544882538E-002 9.530667056764004E-002 + 9.660864100661964E-002 9.793098839686776E-002 9.927412535168177E-002 1.006384758407249E-001 + 1.020244755782990E-001 1.034325724262577E-001 1.048632268121178E-001 1.063169121629432E-001 + 1.077941153555982E-001 1.092953371839859E-001 1.108210928439038E-001 1.123719124361755E-001 + 1.139483414887300E-001 1.155509414983271E-001 1.171802904926409E-001 1.188369836134404E-001 + 1.205216337216212E-001 1.222348720248617E-001 1.239773487287020E-001 1.257497337118523E-001 + 1.275527172265655E-001 1.293870106249177E-001 1.312533471118586E-001 1.331524825259081E-001 + 1.350851961483850E-001 1.370522915420646E-001 1.390545974201710E-001 1.410929685466124E-001 + 1.431682866683656E-001 1.452814614809221E-001 1.474334316276889E-001 1.496251657342372E-001 + 1.518576634782612E-001 1.541319566960984E-001 1.564491105266169E-001 1.588102245932458E-001 + 1.612164342248706E-001 1.636689117162529E-001 1.661688676285684E-001 1.687175521305641E-001 + 1.713162563807409E-001 1.739663139508535E-001 1.766691022908731E-001 1.794260442354202E-001 + 1.822386095514833E-001 1.851083165270388E-001 1.880367335999656E-001 1.910254810263713E-001 + 1.940762325871657E-001 1.971907173313712E-001 2.003707213542934E-001 2.036180896082514E-001 + 2.069347277430913E-001 2.103226039731896E-001 2.137837509670555E-001 2.173202677549937E-001 + 2.209343216495611E-001 2.246281501727394E-001 2.284040629828590E-001 2.322644437933164E-001 + 2.362117522740335E-001 2.402485259254101E-001 2.443773819131837E-001 2.486010188511636E-001 + 2.529222185171962E-001 2.573438474859663E-001 2.618688586603233E-001 2.665002926807098E-001 + 2.712412791899948E-001 2.760950379285097E-001 2.810648796313769E-001 2.861542066972859E-001 + 2.913665135946757E-001 2.967053869678588E-001 3.021745054018928E-001 3.077776388010388E-001 + 3.135186473313503E-001 3.194014798733729E-001 3.254301719260501E-001 3.316088428977522E-001 + 3.379416927148541E-001 3.444329976725061E-001 3.510871054461621E-001 3.579084291761078E-001 + 3.649014405306315E-001 3.720706616467189E-001 3.794206558402097E-001 3.869560169703218E-001 + 3.946813573364265E-001 4.026012939779812E-001 4.107204332417727E-001 4.190433534742154E-001 + 4.275745856905010E-001 4.363185920672075E-001 4.452797421006499E-001 4.544622862701623E-001 + 4.638703270438764E-001 4.735077870647562E-001 4.833783743570868E-001 4.934855443986670E-001 + 5.038324589121606E-001 5.144219412409149E-001 5.252564281906146E-001 5.363379182390805E-001 + 5.476679160429356E-001 5.592473732024855E-001 5.710766252857016E-001 5.831553251593200E-001 + 5.954823727305973E-001 6.080558412677388E-001 6.208729005411652E-001 6.339297371120794E-001 + 6.472214721895655E-001 6.607420775830255E-001 6.744842903929305E-001 6.884395272093994E-001 + 7.025977987242400E-001 7.169476258066074E-001 7.314759582437391E-001 7.461680975038831E-001 + 7.610076250356977E-001 7.759763377732493E-001 7.910541926637109E-001 8.062192621706391E-001 + 8.214477028228853E-001 8.367137389706949E-001 8.519896639683878E-001 8.672458610184260E-001 + 8.824508458756319E-001 8.975713335129963E-001 9.125723306826705E-001 9.274172560579630E-001 + 9.420680893062764E-001 9.564855500120574E-001 9.706293068379797E-001 9.844582166798372E-001 + 9.979305928370643E-001 1.011004500392217E+000 1.023638076079342E+000 1.035789868939150E+000 + 1.047419197030527E+000 1.058486514421847E+000 1.068953781657804E+000 1.078784831930711E+000 + 1.087945724329078E+000 1.096405074847486E+000 1.104134355382864E+000 1.111108150782237E+000 + 1.117304364220401E+000 1.122704361853143E+000 1.127293048899173E+000 1.131058871145640E+000 + 1.133993738451114E+000 1.136092870250939E+000 1.137354567483237E+000 1.137779920899827E+000 + 1.137372472579308E+000 1.136137855823249E+000 1.134083448726713E+000 1.131218089028614E+000 + 1.127551907423270E+000 1.123096275258521E+000 1.117863775300199E+000 1.111868170909520E+000 + 1.105124372237408E+000 1.097648399629170E+000 1.089457344430178E+000 1.080569327379441E+000 + 1.071003454773387E+000 1.060779772577310E+000 1.049919218656852E+000 1.038443573296780E+000 + 1.026375408169082E+000 1.013738033907219E+000 1.000555446437975E+000 9.868522722169372E-001 + 9.726537125079638E-001 9.579854868412035E-001 9.428737757782318E-001 9.273451631066473E-001 + 9.114265775802006E-001 8.951452343141411E-001 8.785285759391975E-001 8.616042136116356E-001 + 8.443998679712448E-001 8.269433101344728E-001 8.092623028066100E-001 7.913845415924180E-001 + 7.733375965872786E-001 7.551488543346035E-001 7.368454602353945E-001 7.184542615012670E-001 + 7.000017507616038E-001 6.815140104524251E-001 6.630166581206557E-001 6.445347928045041E-001 + 6.260929426795477E-001 6.077150141812961E-001 5.894242428420404E-001 5.712431461049957E-001 + 5.531934784011474E-001 5.352961887919081E-001 5.175713814920623E-001 5.000382795907281E-001 + 4.827151922818657E-001 4.656194858993049E-001 4.487675590238236E-001 4.321748218917089E-001 + 4.158556802861685E-001 3.998235240362504E-001 3.840907201844128E-001 3.686686108156938E-001 + 3.535675154711240E-001 3.387967379981137E-001 3.243645776236737E-001 3.102783439749737E-001 + 2.965443757181049E-001 2.831680624419676E-001 2.701538693814284E-001 2.575053645534048E-001 + 2.452252478719243E-001 2.333153818135218E-001 2.217768232221765E-001 2.106098558723177E-001 + 1.998140234477911E-001 1.893881626421260E-001 1.793304361386682E-001 1.696383652855472E-001 + 1.603088623373591E-001 1.513382621901360E-001 1.427223535861950E-001 1.344564098086119E-001 + 1.265352189197106E-001 1.189531136229617E-001 1.117040008425594E-001 1.047813911198507E-001 + 9.817842792138363E-002 9.188791694085419E-002 8.590235545817088E-002 8.021396179498538E-002 + 7.481470487921746E-002 6.969633390308712E-002 6.485040803162211E-002 6.026832609291344E-002 + 5.594135615866108E-002 5.186066490460264E-002 4.801734662574229E-002 4.440245177113330E-002 + 4.100701485729594E-002 3.782208161796510E-002 3.483873525040291E-002 3.204812162451574E-002 + 2.944147332996701E-002 2.701013244782631E-002 2.474557194649663E-002 2.263941561620319E-002 + 2.068345647172079E-002 1.886967356884173E-002 1.719024719596179E-002 1.563757241777112E-002 + 1.420427096311594E-002 1.288320146342933E-002 1.166746806155067E-002 1.055042742313738E-002 + 9.525694194129930E-003 8.587144957806467E-003 7.728920753825060E-003 6.945428229293332E-003 + 6.231339498337421E-003 5.581590791891885E-003 4.991379983538816E-003 4.456163080236202E-003 + 3.971649768751168E-003 3.533798109615193E-003 3.138808470514341E-003 2.783116790289441E-003 + 2.463387263222443E-003 2.176504531101053E-003 1.919565467759837E-003 1.689870637467344E-003 + 1.484915504740406E-003 1.302381468990903E-003 1.140126792918567E-003 9.961774888239687E-004 + 8.687182220941297E-004 7.560832860718610E-004 6.567476974169896E-004 5.693184559580960E-004 + 4.925260079673266E-004 4.252159468143393E-004 3.663409801098614E-004 3.149531877713059E-004 + 2.701965909645015E-004 2.313000476240357E-004 1.975704862526391E-004 1.683864859655072E-004 + 1.431922072920545E-004 1.214916750847441E-004 1.028434120176943E-004 8.685541858832078E-005 + 7.318049326149261E-005 6.151188441246691E-005 5.157926402436331E-005 4.314501166768967E-005 + 3.600079612086747E-005 2.996444106739203E-005 2.487706061129143E-005 2.060044987086265E-005 + 1.701471562316153E-005 1.401614131672755E-005 1.151532677031165E-005 9.435260714428836E-006 + 7.709863546780700E-006 6.282604913149372E-006 5.105261757484203E-006 4.136816253777973E-006 + 3.342481050620196E-006 2.692839944773491E-006 2.163092810257386E-006 1.732394333169708E-006 + 1.383276829898899E-006 1.101148148719979E-006 8.738563644221854E-007 6.913136661218984E-007 + 5.451725043978946E-007 4.285477010123506E-007 3.357788293871192E-007 2.622277442241839E-007 + 2.041066725413962E-007 1.583327750223259E-007 1.224055456771717E-007 9.430383966904383E-008 + 7.239970453681132E-008 5.538654009833634E-008 4.221942851941849E-008 3.206576010329060E-008 + 2.426453419268413E-008 1.829294020254460E-008 1.373902330688850E-008 1.027941480232691E-008 + 7.661260762713281E-009 5.687616336193724E-009 4.205688896200919E-009 3.097413126306717E-009 + 2.271926770909914E-009 1.659588875432048E-009 1.207244400941210E-009 8.744915299619239E-010 + 6.307520549801664E-010 4.529821050538525E-010 3.238911437424263E-010 2.305625726534095E-010 + 1.633902004816790E-010 1.152619884716914E-010 8.093646886672083E-011 5.656857884101943E-011 + 3.935080939745915E-011 2.724292072406716E-011 1.876934751153399E-011 1.286808303004662E-011 + 8.778517720021123E-012 5.958606305526235E-012 4.024003479984814E-012 2.703570370360052E-012 + 1.807016842167760E-012 1.201492968097707E-012 7.947448304965751E-013 5.230598125877196E-013 + 3.426880404867156E-013 2.237739823377289E-013 1.460924042942280E-013 9.483846805429423E-014 + 6.121380248919002E-014 3.928174903501038E-014 2.505977739431953E-014 1.589192246719863E-014 + 1.001742274253589E-014 6.276000806088283E-015 3.907725775108244E-015 2.417940018838314E-015 + 1.486665120009554E-015 9.082227287183137E-016 5.512493992953708E-016 3.323877152786612E-016 + 1.990888543805484E-016 1.184452646476372E-016 6.998748627073830E-017 4.106934035872895E-017 + 2.393161079662242E-017 1.384665155259462E-017 7.954218178951333E-018 4.536186755638886E-018 + 2.567942756611439E-018 1.442914274420416E-018 8.046662539811467E-019 4.453176301908563E-019 + 2.445462959022487E-019 1.332438333209888E-019 7.202531668521004E-020 3.862174774475969E-020 + 2.054203535559261E-020 1.083615944617791E-020 5.668689492124577E-021 2.940490324308670E-021 + 1.512308897738554E-021 7.710778163752447E-022 3.897135921998000E-022 1.952246437300173E-022 + 9.692079371653407E-023 4.768078619764643E-023 2.324150478364441E-023 1.122352064533745E-023 + 5.368921014151167E-024 2.543819687228981E-024 1.193643819302157E-024 5.546248972256990E-025 + 2.551564427003981E-025 1.162095991541221E-025 5.239028831501885E-026 2.337637884372209E-026 + 1.032202699265205E-026 4.509796878297719E-027 1.949375148292034E-027 8.335310996704759E-028 + 3.525144162093263E-028 1.474350199028789E-028 6.097227086231348E-029 2.492932509569204E-029 + 1.007564407698353E-029 4.024910134442564E-030 1.588900741491320E-030 6.197690540915147E-031 + 2.388306525464899E-031 9.090986116751324E-032 3.417633868134587E-032 1.268719750555362E-032 + 4.650103844226560E-033 1.682467486225844E-033 6.008239040580709E-034 2.117350460320250E-034 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 +/ +&rhoatom + rho_at(1:1177) = + 1.924828096786578E-009 1.973555357624711E-009 2.023516155229837E-009 2.074741716748551E-009 + 2.127264059847182E-009 2.181116012723921E-009 2.236331234627599E-009 2.292944236895847E-009 + 2.350990404525897E-009 2.410506018291409E-009 2.471528277419223E-009 2.534095322840147E-009 + 2.598246261028380E-009 2.664021188444402E-009 2.731461216596668E-009 2.800608497737724E-009 + 2.871506251210836E-009 2.944198790463605E-009 3.018731550745399E-009 3.095151117506012E-009 + 3.173505255513174E-009 3.253842938707218E-009 3.336214380811547E-009 3.420671066717954E-009 + 3.507265784666526E-009 3.596052659240155E-009 3.687087185194331E-009 3.780426262143340E-009 + 3.876128230124562E-009 3.974252906063073E-009 4.074861621159373E-009 4.178017259223619E-009 + 4.283784295980228E-009 4.392228839367568E-009 4.503418670857797E-009 4.617423287822759E-009 + 4.734313946972354E-009 4.854163708892614E-009 4.977047483711198E-009 5.103042077919047E-009 + 5.232226242377202E-009 5.364680721539033E-009 5.500488303918495E-009 5.639733873836039E-009 + 5.782504464474480E-009 5.928889312277989E-009 6.078979912728211E-009 6.232870077532383E-009 + 6.390655993259219E-009 6.552436281459162E-009 6.718312060306545E-009 6.888387007802396E-009 + 7.062767426577094E-009 7.241562310333646E-009 7.424883411972967E-009 7.612845313443735E-009 + 7.805565497360595E-009 8.003164420435388E-009 8.205765588767313E-009 8.413495635039155E-009 + 8.626484397667665E-009 8.844865001957732E-009 9.068773943311068E-009 9.298351172541325E-009 + 9.533740183348953E-009 9.775088102010595E-009 1.002254577933903E-008 1.027626788497108E-008 + 1.053641300404250E-008 1.080314373631030E-008 1.107662679778427E-008 1.135703312493154E-008 + 1.164453798151903E-008 1.193932106816077E-008 1.224156663463838E-008 1.255146359506500E-008 + 1.286920564596494E-008 1.319499138734229E-008 1.352902444681450E-008 1.387151360688879E-008 + 1.422267293546026E-008 1.458272191961393E-008 1.495188560281400E-008 1.533039472556612E-008 + 1.571848586964070E-008 1.611640160594732E-008 1.652439064615275E-008 1.694270799813729E-008 + 1.737161512538665E-008 1.781138011041886E-008 1.826227782234865E-008 1.872459008869371E-008 + 1.919860587153067E-008 1.968462144811026E-008 2.018294059604526E-008 2.069387478318642E-008 + 2.121774336230555E-008 2.175487377070697E-008 2.230560173489242E-008 2.287027148040763E-008 + 2.344923594700070E-008 2.404285700922807E-008 2.465150570264520E-008 2.527556245572353E-008 + 2.591541732763866E-008 2.657147025207855E-008 2.724413128722402E-008 2.793382087205778E-008 + 2.864097008916248E-008 2.936602093417152E-008 3.010942659204165E-008 3.087165172031989E-008 + 3.165317273958143E-008 3.245447813122081E-008 3.327606874278202E-008 3.411845810101836E-008 + 3.498217273287800E-008 3.586775249461621E-008 3.677575090923912E-008 3.770673551249076E-008 + 3.866128820759920E-008 3.964000562900393E-008 4.064349951529180E-008 4.167239709157418E-008 + 4.272734146154518E-008 4.380899200946528E-008 4.491802481232230E-008 4.605513306242685E-008 + 4.722102750070706E-008 4.841643686097274E-008 4.964210832542753E-008 5.089880799171303E-008 + 5.218732135177739E-008 5.350845378286798E-008 5.486303105095463E-008 5.625189982689759E-008 + 5.767592821568510E-008 5.913600629906864E-008 6.063304669193755E-008 6.216798511277937E-008 + 6.374178096858277E-008 6.535541795454985E-008 6.700990466899161E-008 6.870627524379114E-008 + 7.044558999082939E-008 7.222893606477720E-008 7.405742814266830E-008 7.593220912067783E-008 + 7.785445082854273E-008 7.982535476206977E-008 8.184615283418981E-008 8.391810814502825E-008 + 8.604251577147282E-008 8.822070357673184E-008 9.045403304039014E-008 9.274390010948198E-008 + 9.509173607111105E-008 9.749900844716662E-008 9.996722191169170E-008 1.024979192314800E-007 + 1.050926822304878E-007 1.077531327786644E-007 1.104809338058207E-007 1.132777903411685E-007 + 1.161454505791813E-007 1.190857069724424E-007 1.221003973521664E-007 1.251914060770898E-007 + 1.283606652114554E-007 1.316101557328244E-007 1.349419087704687E-007 1.383580068751238E-007 + 1.418605853208917E-007 1.454518334401109E-007 1.491339959920282E-007 1.529093745661256E-007 + 1.567803290209857E-007 1.607492789595877E-007 1.648187052419668E-007 1.689911515361745E-007 + 1.732692259085130E-007 1.776556024540430E-007 1.821530229683757E-007 1.867642986618059E-007 + 1.914923119168488E-007 1.963400180902848E-007 2.013104473608433E-007 2.064067066236708E-007 + 2.116319814327806E-007 2.169895379926956E-007 2.224827252005220E-007 2.281149767397488E-007 + 2.338898132270645E-007 2.398108444135501E-007 2.458817714416173E-007 2.521063891591018E-007 + 2.584885884919745E-007 2.650323588771368E-007 2.717417907568350E-007 2.786210781362550E-007 + 2.856745212058874E-007 2.929065290303222E-007 3.003216223051349E-007 3.079244361836096E-007 + 3.157197231750579E-007 3.237123561165490E-007 3.319073312199147E-007 3.403097711959340E-007 + 3.489249284576564E-007 3.577581884048697E-007 3.668150727917610E-007 3.761012431798950E-007 + 3.856225044786585E-007 3.953848085753938E-007 4.053942580574961E-007 4.156571100288039E-007 + 4.261797800226729E-007 4.369688460141840E-007 4.480310525340035E-007 4.593733148864693E-007 + 4.710027234745406E-007 4.829265482343343E-007 4.951522431820145E-007 5.076874510758870E-007 + 5.205400081966296E-007 5.337179492486399E-007 5.472295123855825E-007 5.610831443632812E-007 + 5.752875058231937E-007 5.898514767097711E-007 6.047841618250958E-007 6.200948965243079E-007 + 6.357932525553473E-007 6.518890440467170E-007 6.683923336469977E-007 6.853134388199618E-007 + 7.026629382992586E-007 7.204516787066967E-007 7.386907813382832E-007 7.573916491222878E-007 + 7.765659737536781E-007 7.962257430094323E-007 8.163832482492757E-007 8.370510921066026E-007 + 8.582421963743735E-007 8.799698100909495E-007 9.022475178309505E-007 9.250892482063273E-007 + 9.485092825829974E-007 9.725222640185198E-007 9.971432064264182E-007 1.022387503972921E-006 + 1.048270940711994E-006 1.074809700464769E-006 1.102020376949533E-006 1.129919984168666E-006 + 1.158525967059071E-006 1.187856212412755E-006 1.217929060074468E-006 1.248763314423419E-006 + 1.280378256146307E-006 1.312793654309079E-006 1.346029778734964E-006 1.380107412696660E-006 + 1.415047865930592E-006 1.450872987981442E-006 1.487605181885414E-006 1.525267418200771E-006 + 1.563883249394554E-006 1.603476824594493E-006 1.644072904715453E-006 1.685696877969921E-006 + 1.728374775772321E-006 1.772133289047191E-006 1.816999784951523E-006 1.863002324021771E-006 + 1.910169677756421E-006 1.958531346645133E-006 2.008117578655937E-006 2.058959388192062E-006 + 2.111088575530458E-006 2.164537746754237E-006 2.219340334191665E-006 2.275530617374585E-006 + 2.333143744529621E-006 2.392215754615606E-006 2.452783599921358E-006 2.514885169237944E-006 + 2.578559311620240E-006 2.643845860752730E-006 2.710785659935064E-006 2.779420587703169E-006 + 2.849793584102175E-006 2.921948677627811E-006 2.995931012853381E-006 3.071786878759819E-006 + 3.149563737786891E-006 3.229310255623906E-006 3.311076331758920E-006 3.394913130805904E-006 + 3.480873114629670E-006 3.569010075289122E-006 3.659379168819755E-006 3.752036949876928E-006 + 3.847041407261963E-006 3.944452000353731E-006 4.044329696469005E-006 4.146737009175377E-006 + 4.251738037581177E-006 4.359398506627574E-006 4.469785808408544E-006 4.582969044545155E-006 + 4.699019069641280E-006 4.818008535848564E-006 4.940011938569251E-006 5.065105663326022E-006 + 5.193368033829081E-006 5.324879361271199E-006 5.459721994882516E-006 5.597980373777459E-006 + 5.739741080127186E-006 5.885092893691835E-006 6.034126847747533E-006 6.186936286444455E-006 + 6.343616923632686E-006 6.504266903194061E-006 6.668986860918780E-006 6.837879987966978E-006 + 7.011052095956234E-006 7.188611683717108E-006 7.370670005760185E-006 7.557341142498813E-006 + 7.748742072273251E-006 7.944992745223117E-006 8.146216159056029E-006 8.352538436761945E-006 + 8.564088906323770E-006 8.781000182476329E-006 9.003408250567046E-006 9.231452552573209E-006 + 9.465276075332146E-006 9.705025441042095E-006 9.950851000093268E-006 1.020290692629000E-005 + 1.046135131452659E-005 1.072634628098141E-005 1.099805806589492E-005 1.127665713899991E-005 + 1.156231830767333E-005 1.185522082788160E-005 1.215554851799278E-005 1.246348987553104E-005 + 1.277923819695146E-005 1.310299170051449E-005 1.343495365234237E-005 1.377533249574133E-005 + 1.412434198387655E-005 1.448220131588831E-005 1.484913527654105E-005 1.522537437949900E-005 + 1.561115501432515E-005 1.600671959730227E-005 1.641231672617843E-005 1.682820133894156E-005 + 1.725463487673087E-005 1.769188545099553E-005 1.814022801501507E-005 1.859994453989808E-005 + 1.907132419517954E-005 1.955466353414122E-005 2.005026668398146E-005 2.055844554096594E-005 + 2.107951997069371E-005 2.161381801361724E-005 2.216167609595868E-005 2.272343924616894E-005 + 2.329946131708038E-005 2.389010521390822E-005 2.449574312825994E-005 2.511675677831754E-005 + 2.575353765536105E-005 2.640648727680744E-005 2.707601744594401E-005 2.776255051854023E-005 + 2.846651967652840E-005 2.918836920894746E-005 2.992855480035189E-005 3.068754382689210E-005 + 3.146581566028001E-005 3.226386197985915E-005 3.308218709300538E-005 3.392130826409166E-005 + 3.478175605225580E-005 3.566407465821987E-005 3.656882228041479E-005 3.749657148067349E-005 + 3.844790955976296E-005 3.942343894303346E-005 4.042377757647331E-005 4.144955933346477E-005 + 4.250143443254719E-005 4.358006986650191E-005 4.468614984308396E-005 4.582037623773593E-005 + 4.698346905862870E-005 4.817616692438648E-005 4.939922755486414E-005 5.065342827535475E-005 + 5.193956653462071E-005 5.325846043715194E-005 5.461094929006781E-005 5.599789416509476E-005 + 5.742017847606269E-005 5.887870857238114E-005 6.037441434896712E-005 6.190824987311687E-005 + 6.348119402882512E-005 6.509425117907580E-005 6.674845184664435E-005 6.844485341396815E-005 + 7.018454084266403E-005 7.196862741328691E-005 7.379825548594735E-005 7.567459728242439E-005 + 7.759885569043322E-005 7.957226509072800E-005 8.159609220774714E-005 8.367163698452688E-005 + 8.580023348264177E-005 8.798325080794894E-005 9.022209406294692E-005 9.251820532658613E-005 + 9.487306466239268E-005 9.728819115580864E-005 9.976514398167201E-005 1.023055235028004E-004 + 1.049109724006768E-004 1.075831768392650E-004 1.103238676630287E-004 1.131348216302607E-004 + 1.160178626828718E-004 1.189748632538309E-004 1.220077456134894E-004 1.251184832560754E-004 + 1.283091023276808E-004 1.315816830971218E-004 1.349383614711027E-004 1.383813305551649E-004 + 1.419128422619623E-004 1.455352089684606E-004 1.492508052237176E-004 1.530620695089693E-004 + 1.569715060518079E-004 1.609816866963115E-004 1.650952528310539E-004 1.693149173769987E-004 + 1.736434668373622E-004 1.780837634116073E-004 1.826387471758206E-004 1.873114383318114E-004 + 1.921049395273632E-004 1.970224382501668E-004 2.020672092980664E-004 2.072426173283534E-004 + 2.125521194889520E-004 2.179992681344619E-004 2.235877136301349E-004 2.293212072469970E-004 + 2.352036041514522E-004 2.412388664928440E-004 2.474310665925947E-004 2.537843902386898E-004 + 2.603031400894350E-004 2.669917391905734E-004 2.738547346100261E-004 2.808968011946904E-004 + 2.881227454539258E-004 2.955375095745482E-004 3.031461755723603E-004 3.109539695854551E-004 + 3.189662663147558E-004 3.271885936174967E-004 3.356266372595768E-004 3.442862458329962E-004 + 3.531734358448333E-004 3.622943969845110E-004 3.716554975763972E-004 3.812632902250816E-004 + 3.911245176610001E-004 4.012461187944095E-004 4.116352349860760E-004 4.222992165433964E-004 + 4.332456294510666E-004 4.444822623458136E-004 4.560171337451309E-004 4.678584995404012E-004 + 4.800148607652521E-004 4.924949716504670E-004 5.053078479773158E-004 5.184627757416570E-004 + 5.319693201417565E-004 5.458373349033436E-004 5.600769719560261E-004 5.746986914758452E-004 + 5.897132723094166E-004 6.051318227958057E-004 6.209657920030377E-004 6.372269813968846E-004 + 6.539275569604295E-004 6.710800617837286E-004 6.886974291437725E-004 7.067929960959211E-004 + 7.253805175989150E-004 7.444741811966527E-004 7.640886222809351E-004 7.842389399605466E-004 + 8.049407135632276E-004 8.262100197982901E-004 8.480634506089848E-004 8.705181317450329E-004 + 8.935917420872118E-004 9.173025337573473E-004 9.416693530486545E-004 9.667116622130000E-004 + 9.924495621433901E-004 1.018903815991812E-003 1.046095873764423E-003 1.074047897938102E-003 + 1.102782790144440E-003 1.132324218969454E-003 1.162696648919579E-003 1.193925370606937E-003 + 1.226036532209351E-003 1.259057172263266E-003 1.293015253850478E-003 1.327939700242517E-003 + 1.363860432069561E-003 1.400808406083921E-003 1.438815655591595E-003 1.477915332628785E-003 + 1.518141751964067E-003 1.559530437010706E-003 1.602118167737684E-003 1.645943030672309E-003 + 1.691044471091680E-003 1.737463347504984E-003 1.785241988533543E-003 1.834424252300627E-003 + 1.885055588448501E-003 1.937183102905802E-003 1.990855625534287E-003 2.046123780790258E-003 + 2.103040061542420E-003 2.161658906194896E-003 2.222036779271190E-003 2.284232255622487E-003 + 2.348306108431564E-003 2.414321401191835E-003 2.482343583849788E-003 2.552440593308163E-003 + 2.624682958496659E-003 2.699143910227203E-003 2.775899496060976E-003 2.855028700425716E-003 + 2.936613570233089E-003 3.020739346258187E-003 3.107494600555753E-003 3.196971380201057E-003 + 3.289265357657271E-003 3.384475988085804E-003 3.482706673931231E-003 3.584064937128645E-003 + 3.688662599297827E-003 3.796615970306470E-003 3.908046045602871E-003 4.023078712738033E-003 + 4.141844967517167E-003 4.264481140241931E-003 4.391129132526848E-003 4.521936665196583E-003 + 4.657057537795245E-003 4.796651900264204E-003 4.940886537371732E-003 5.089935166505822E-003 + 5.243978749470586E-003 5.403205818957583E-003 5.567812820395269E-003 5.738004469913498E-003 + 5.913994129195173E-003 6.096004198023876E-003 6.284266525374865E-003 6.479022839937069E-003 + 6.680525200995912E-003 6.889036470650886E-003 7.104830808387874E-003 7.328194189074523E-003 + 7.559424945497336E-003 7.798834336611919E-003 8.046747142732989E-003 8.303502288948180E-003 + 8.569453498100265E-003 8.844969974744984E-003 9.130437121557486E-003 9.426257289729336E-003 + 9.732850564969298E-003 1.005065559079650E-002 1.038013043089228E-002 1.072175347235904E-002 + 1.107602437181945E-002 1.144346504637815E-002 1.182462071156092E-002 1.222006096844304E-002 + 1.263038094227914E-002 1.305620247505232E-002 1.349817537446949E-002 1.395697872204440E-002 + 1.443332224302847E-002 1.492794774107337E-002 1.544163060063848E-002 1.597518136029032E-002 + 1.652944736018039E-002 1.710531446713401E-002 1.770370888093242E-002 1.832559902552833E-002 + 1.897199752909819E-002 1.964396329700269E-002 2.034260368190491E-002 2.106907675547543E-002 + 2.182459368630558E-002 2.261042122884452E-002 2.342788432838032E-002 2.427836884729521E-002 + 2.516332441804422E-002 2.608426742853154E-002 2.704278414579301E-002 2.804053398413379E-002 + 2.907925292412102E-002 3.016075708908653E-002 3.128694648606255E-002 3.245980891834526E-002 + 3.368142407716346E-002 3.495396782022030E-002 3.627971664517301E-002 3.766105236642371E-002 + 3.910046700390658E-002 4.060056789288118E-002 4.216408302407083E-002 4.379386662382136E-002 + 4.549290498430305E-002 4.726432255412735E-002 4.911138830010943E-002 5.103752235127269E-002 + 5.304630293655802E-002 5.514147362807872E-002 5.732695090213600E-002 5.960683203059534E-002 + 6.198540331560547E-002 6.446714868102565E-002 6.705675863431551E-002 6.975913961301866E-002 + 7.257942373035620E-002 7.552297893481977E-002 7.859541959901917E-002 8.180261755340390E-002 + 8.515071358081930E-002 8.864612938819641E-002 9.229558007198978E-002 9.610608709427088E-002 + 1.000849917866600E-001 1.042399693995211E-001 1.085790437140559E-001 1.131106022351103E-001 + 1.178434119826307E-001 1.227866358998008E-001 1.279498498959067E-001 1.333430605419502E-001 + 1.389767234369271E-001 1.448617622624955E-001 1.510095885435023E-001 1.574321221314513E-001 + 1.641418124275277E-001 1.711516603611945E-001 1.784752411396232E-001 1.861267277823591E-001 + 1.941209154545394E-001 2.024732466107572E-001 2.111998369602188E-001 2.203175022621525E-001 + 2.298437859585225E-001 2.397969876488761E-001 2.501961924096580E-001 2.610613009574687E-001 + 2.724130606525119E-001 2.842730973348558E-001 2.966639479820164E-001 3.096090941717877E-001 + 3.231329963290912E-001 3.372611287298336E-001 3.520200152283500E-001 3.674372656677955E-001 + 3.835416129248559E-001 4.003629505312400E-001 4.179323708044811E-001 4.362822034096009E-001 + 4.554460542609243E-001 4.754588446598009E-001 4.963568505489453E-001 5.181777417474436E-001 + 5.409606210120491E-001 5.647460627499719E-001 5.895761511857931E-001 6.154945177602236E-001 + 6.425463775108318E-001 6.707785641545061E-001 7.002395635578308E-001 7.309795452445998E-001 + 7.630503915489855E-001 7.965057239780209E-001 8.314009262978587E-001 8.677931638040994E-001 + 9.057413981771985E-001 9.453063972589527E-001 9.865507390149431E-001 1.029538808870277E+000 + 1.074336789521270E+000 1.121012642233833E+000 1.169636078539463E+000 1.220278521131725E+000 + 1.273013052649753E+000 1.327914350909938E+000 1.385058609012993E+000 1.444523438610644E+000 + 1.506387754464574E+000 1.570731638270499E+000 1.637636179552902E+000 1.707183291262164E+000 + 1.779455497527176E+000 1.854535690834670E+000 1.932506855724619E+000 2.013451755911750E+000 + 2.097452581571277E+000 2.184590553367077E+000 2.274945479658786E+000 2.368595263208514E+000 + 2.465615353626132E+000 2.566078141755009E+000 2.670052292219319E+000 2.777602010442556E+000 + 2.888786240620720E+000 3.003657791408458E+000 3.122262386471839E+000 3.244637637597044E+000 + 3.370811938740718E+000 3.500803280289043E+000 3.634617983879301E+000 3.772249359453690E+000 + 3.913676287781124E+000 4.058861733516611E+000 4.207751195986397E+000 4.360271107297915E+000 + 4.516327190081499E+000 4.675802790167435E+000 4.838557202770031E+000 5.004424014258449E+000 + 5.173209485293118E+000 5.344691004931090E+000 5.518615649167344E+000 5.694698881171542E+000 + 5.872623434072649E+000 6.052038420379644E+000 6.232558714833202E+000 6.413764659462462E+000 + 6.595202140665742E+000 6.776383088023213E+000 6.956786443060965E+000 7.135859643106423E+000 + 7.313020660504220E+000 7.487660630631369E+000 7.659147093230540E+000 7.826827860492219E+000 + 7.990035512046748E+000 8.148092501630988E+000 8.300316842807096E+000 8.446028321949131E+000 + 8.584555166071841E+000 8.715241071330365E+000 8.837452475604078E+000 8.950585935987947E+000 + 9.054075449775638E+000 9.147399536175701E+000 9.230087876096249E+000 9.301727289372039E+000 + 9.361966813250383E+000 9.410521633168901E+000 9.447175607108328E+000 9.471782118196989E+000 + 9.484262986701477E+000 9.484605171765882E+000 9.472854994732511E+000 9.449109799526678E+000 + 9.413509234029927E+000 9.366232023840556E+000 9.307494705412942E+000 9.237550331830462E+000 + 9.156687001726613E+000 9.065226223228187E+000 8.963521125610381E+000 8.851954532041583E+000 + 8.730936907361560E+000 8.600904195285107E+000 8.462315559762876E+000 8.315651045460609E+000 + 8.161409172445017E+000 8.000104480190386E+000 7.832265035947301E+000 7.658429922349852E+000 + 7.479146718882118E+000 7.294968991485057E+000 7.106453804166978E+000 6.914159265988351E+000 + 6.718642126236371E+000 6.520455429987573E+000 6.320146245591683E+000 6.118253474901577E+000 + 5.915305756331610E+000 5.711819470060691E+000 5.508296853916888E+000 5.305224237657406E+000 + 5.103070402599875E+000 4.902285072796324E+000 4.703297543088516E+000 4.506515448586239E+000 + 4.312323679452144E+000 4.121083444141861E+000 3.933131483336672E+000 3.748779436122819E+000 + 3.568313359250326E+000 3.391993399440976E+000 3.220053617880767E+000 3.052701965138531E+000 + 2.890120403801799E+000 2.732465175110386E+000 2.579867204803431E+000 2.432432642286006E+000 + 2.290243526085393E+000 2.153358567430362E+000 2.021814042679622E+000 1.895624784284418E+000 + 1.774785259032304E+000 1.659270721521602E+000 1.549038430193564E+000 1.444028912829690E+000 + 1.344167268226764E+000 1.249364490803658E+000 1.159518805174173E+000 1.074516998232068E+000 + 9.942357370207028E-001 9.185428615760307E-001 8.472986430060530E-001 7.803569982657481E-001 + 7.175666543641025E-001 6.587722560579047E-001 6.038154124049805E-001 5.525356788289217E-001 + 5.047714725535263E-001 4.603609203686996E-001 4.191426386670396E-001 3.809564465256273E-001 + 3.456440132918931E-001 3.130494426644784E-001 2.830197956458146E-001 2.554055549945973E-001 + 2.300610339409994E-001 2.068447319660214E-001 1.856196404118320E-001 1.662535006055080E-001 + 1.486190170661049E-001 1.325940282439157E-001 1.180616371268363E-001 1.049103039536001E-001 + 9.303390320455152E-002 8.233174700068216E-002 7.270857703029772E-002 6.407452713633191E-002 + 5.634505873021127E-002 4.944087124323114E-002 4.328778987597293E-002 3.781663295290384E-002 + 3.296306122615431E-002 2.866741149387129E-002 2.487451690014486E-002 2.153351626236407E-002 + 1.859765472650161E-002 1.602407798106942E-002 1.377362216732735E-002 1.181060150871119E-002 + 1.010259554905065E-002 8.620237740176459E-003 7.337006958474213E-003 6.229023360461341E-003 + 5.274849813147058E-003 4.455299959214796E-003 3.753253803121763E-003 3.153481534878796E-003 + 2.642476146014689E-003 2.208295239094210E-003 1.840412289783223E-003 1.529577490068310E-003 + 1.267688183683547E-003 1.047668800557950E-003 8.633601063333917E-004 7.094175055890282E-004 + 5.812180729750608E-004 4.747759344326309E-004 3.866655803216977E-004 3.139526627340820E-004 + 2.541318095847459E-004 2.050709772452112E-004 1.649618604760847E-004 1.322758821971639E-004 + 1.057252951901019E-004 8.422894218525724E-005 6.688223901946445E-005 5.293096680755006E-005 + 4.174848256226919E-005 3.281598271727856E-005 2.570547992813738E-005 2.006517980020077E-005 + 1.560697035182976E-005 1.209576267509021E-005 9.340446084630689E-006 7.186244796280297E-006 + 5.508285658869842E-006 4.206207539618776E-006 3.199662547506633E-006 2.424577324875719E-006 + 1.830059135462381E-006 1.375846447336157E-006 1.030217196213786E-006 7.682799816371678E-007 + 5.705841731146864E-007 4.219943730985473E-007 3.107829925363915E-007 2.279019398336058E-007 + 1.664007031176535E-007 1.209635148673064E-007 8.754292015398305E-008 6.307101327734135E-008 + 4.523294530632377E-008 3.229015723197786E-008 2.294326727852911E-008 1.622500305085240E-008 + 1.141911281915015E-008 7.997814028920651E-009 5.574097672665867E-009 3.865581380118584E-009 + 2.667253769992346E-009 1.831028391550769E-009 1.250485464356297E-009 8.495448242769811E-010 + 5.741018229627817E-010 3.858842612951436E-010 2.579650607520829E-010 1.715023971528729E-010 + 1.133846888065112E-010 7.453883332444888E-011 4.872180811182958E-011 3.166249325272587E-011 + 2.045575994235830E-011 1.313718792748279E-011 8.386342251957678E-012 5.320994509732099E-012 + 3.355284650472650E-012 2.102558632573443E-012 1.309225576734737E-012 8.100157691188354E-013 + 4.979086469158939E-013 3.040515369267409E-013 1.844377314368409E-013 1.111272637104405E-013 + 6.650013729769101E-014 3.952008473659406E-014 2.332214345974806E-014 1.366582083366721E-014 + 7.950245951888975E-015 4.591593378961119E-015 2.632353652443102E-015 1.497898739771295E-015 + 8.459350599788174E-016 4.740960961923515E-016 2.636504025842742E-016 1.454723991197269E-016 + 7.963055369165518E-017 4.323965050083439E-017 2.328861765000499E-017 1.243997721903410E-017 + 6.589682419816772E-018 3.461246556173034E-018 1.802508419289567E-018 9.305758490344666E-019 + 4.762208438896140E-019 2.415455669980665E-019 1.214158000532303E-019 6.047666751646655E-020 + 2.984612469167028E-020 1.459240546539496E-020 7.067368386342975E-021 3.390297844314284E-021 + 1.610774697909853E-021 7.579476285905844E-022 3.532593864940209E-022 1.631387060061600E-022 + 7.472279427930461E-023 3.402570028600894E-023 1.548843874751700E-023 6.976332586563125E-024 + 3.108909104067513E-024 1.370540310265716E-024 5.976121780399459E-025 2.577098719545178E-025 + 1.098919971383199E-025 4.633008698321336E-026 1.930901309977488E-026 7.954154916543868E-027 + 3.238182519057423E-027 1.302619030324111E-027 5.176986401015360E-028 2.032422600694362E-028 + 7.880639071726435E-029 3.017529282899654E-029 1.140815818898848E-029 4.257788166960202E-030 + 1.568507707763523E-030 5.702326567944468E-031 2.045540915390602E-031 7.239054424891156E-032 + 2.526964310821747E-032 8.699314864933074E-033 2.953002434924013E-033 9.882311913719036E-034 + 3.259804276287660E-034 1.059702475123587E-034 3.394345751518204E-035 1.071092947483377E-035 + 3.329012498562380E-036 1.018915288893930E-036 3.070515409734788E-037 9.108568742051845E-038 + 2.659308340643082E-038 7.639763351834770E-039 2.159213741749150E-039 6.002423574159030E-040 + 1.640901642577767E-040 4.410337891727039E-041 1.165203890005834E-041 3.025372927164016E-042 + 7.718054384877018E-043 1.934160390645613E-043 4.760312492536675E-044 1.150371563249626E-044 + 2.728981788460229E-045 6.353628755702412E-046 1.451440815240682E-046 3.252590869127966E-047 + 7.148372318488842E-048 1.540374060464837E-048 3.253710323560254E-049 6.735288861933596E-050 + 1.365991021718147E-050 2.713575922227922E-051 5.278681437457383E-052 1.005272220462149E-052 + 1.873702457043289E-053 3.417108698563338E-054 6.095919349287256E-055 1.063460622120381E-055 + 1.813775005423663E-056 3.023442352330697E-057 4.924375704900590E-058 7.834390779712392E-059 + 1.217126181970872E-059 1.845918203142256E-060 2.732148421634400E-061 3.945281294065639E-062 + 5.556466420038769E-063 7.630094928165562E-064 1.021253335934194E-064 1.331893102661997E-065 + 1.691982475354046E-066 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 +/ diff --git a/tests/apps/miniDFT/tests/test/TiO2_222.in b/tests/apps/miniDFT/tests/test/TiO2_222.in new file mode 100644 index 0000000000..98f6445244 --- /dev/null +++ b/tests/apps/miniDFT/tests/test/TiO2_222.in @@ -0,0 +1,88 @@ +&control +prefix = 'titania' +calculation = 'scf' +restart_mode = 'from_scratch' +wf_collect = .false. +disk_io = 'none' +tstress = .true. +tprnfor = .true. +outdir = './' +wfcdir = './' +pseudo_dir = './' +/ +&system +ibrav = 0 +celldm(1) = 8.7671 +nat = 48 +ntyp = 2 +nbnd = 192 +ecutwfc = 100 +/ +&electrons +electron_maxstep = 100 +conv_thr = 1.0d-10 +mixing_mode = 'plain' +mixing_beta = 0.7 +mixing_ndim = 8 +diagonalization = 'david' +diago_david_ndim = 4 +diago_full_acc = .true. +/ +CELL_PARAMETERS +2.0 0.0 0.0 +0.0 2.0 0.0 +0.0 0.0 1.277176 +ATOMIC_SPECIES +Ti 47.867 Ti.pbe.nml +O 15.9994 O.pbe.nml +ATOMIC_POSITIONS crystal +Ti 0.0 0.0 0.0 +Ti 0.25 0.25 0.25 +O 0.15254385 0.15254385 0.0 +O -0.15254385 -0.15254385 0.0 +O 0.40254385 0.09745615 0.25 +O 0.09745615 0.40254385 0.25 +Ti 0.0 0.0 0.5 +Ti 0.25 0.25 0.75 +O 0.15254385 0.15254385 0.5 +O -0.15254385 -0.15254385 0.5 +O 0.40254385 0.09745615 0.75 +O 0.09745615 0.40254385 0.75 +Ti 0.0 0.5 0.0 +Ti 0.25 0.75 0.25 +O 0.15254385 0.65254385 0.0 +O -0.15254385 0.34745615 0.0 +O 0.40254385 0.59745615 0.25 +O 0.09745615 0.90254385 0.25 +Ti 0.0 0.5 0.5 +Ti 0.25 0.75 0.75 +O 0.15254385 0.65254385 0.5 +O -0.15254385 0.34745615 0.5 +O 0.40254385 0.59745615 0.75 +O 0.09745615 0.90254385 0.75 +Ti 0.5 0.0 0.0 +Ti 0.75 0.25 0.25 +O 0.65254385 0.15254385 0.0 +O 0.34745615 -0.15254385 0.0 +O 0.90254385 0.09745615 0.25 +O 0.59745615 0.40254385 0.25 +Ti 0.5 0.0 0.5 +Ti 0.75 0.25 0.75 +O 0.65254385 0.15254385 0.5 +O 0.34745615 -0.15254385 0.5 +O 0.90254385 0.09745615 0.75 +O 0.59745615 0.40254385 0.75 +Ti 0.5 0.5 0.0 +Ti 0.75 0.75 0.25 +O 0.65254385 0.65254385 0.0 +O 0.34745615 0.34745615 0.0 +O 0.90254385 0.59745615 0.25 +O 0.59745615 0.90254385 0.25 +Ti 0.5 0.5 0.5 +Ti 0.75 0.75 0.75 +O 0.65254385 0.65254385 0.5 +O 0.34745615 0.34745615 0.5 +O 0.90254385 0.59745615 0.75 +O 0.59745615 0.90254385 0.75 +K_POINTS automatic +1 1 1 1 1 1 diff --git a/tests/apps/miniDFT/tests/test/mini_dft b/tests/apps/miniDFT/tests/test/mini_dft new file mode 120000 index 0000000000..a6495bd9a7 --- /dev/null +++ b/tests/apps/miniDFT/tests/test/mini_dft @@ -0,0 +1 @@ +../src/mini_dft \ No newline at end of file diff --git a/tests/apps/miniDFT/tests/test/run b/tests/apps/miniDFT/tests/test/run new file mode 100755 index 0000000000..cfc7729d9c --- /dev/null +++ b/tests/apps/miniDFT/tests/test/run @@ -0,0 +1,9 @@ +#!/bin/sh + +. /opt/ohpc/pub/compiler/intel/composer_xe_2013_sp1.2.144/bin/compilervars.sh intel64 +. /opt/ohpc/pub/mpi/impi/4.1.3.048/bin64/mpivars.sh + +export OMP_NUM_THREADS=1 + +srun -n 16 -N 1 ./mini_dft -in Si_333.in > Si_333.out +srun -n 16 -N 2 ./mini_dft -in TiO2_222.in > TiO2_222.out diff --git a/tests/apps/miniFE/.gitignore b/tests/apps/miniFE/.gitignore new file mode 100644 index 0000000000..11eaff38a9 --- /dev/null +++ b/tests/apps/miniFE/.gitignore @@ -0,0 +1,8 @@ +*~ +*.yaml +log.miniFE +family-*/ +compile +test-driver +test-suite.log.orig +job.*.out diff --git a/tests/apps/miniFE/Makefile.am b/tests/apps/miniFE/Makefile.am new file mode 100644 index 0000000000..39cbee2e65 --- /dev/null +++ b/tests/apps/miniFE/Makefile.am @@ -0,0 +1,3 @@ +AUTOMAKE_OPTIONS = foreign +AM_MAKEFLAGS = --no-print-directory +SUBDIRS = tests diff --git a/tests/apps/miniFE/bootstrap b/tests/apps/miniFE/bootstrap new file mode 120000 index 0000000000..b17b398013 --- /dev/null +++ b/tests/apps/miniFE/bootstrap @@ -0,0 +1 @@ +../../bootstrap \ No newline at end of file diff --git a/tests/apps/miniFE/configure.ac b/tests/apps/miniFE/configure.ac new file mode 100644 index 0000000000..2e8c8af4ca --- /dev/null +++ b/tests/apps/miniFE/configure.ac @@ -0,0 +1,35 @@ +AC_PREREQ([2.63]) +AC_INIT([miniFE], [0.10.0], [karl.w.schulz@intel.com]) +AM_INIT_AUTOMAKE +m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) + +# set compilers to use MPI toolchain + +CC=mpicc +CXX=mpicxx +FC=mpif90 + +# test compilers + +AC_PROG_CC +AC_PROG_FC +AC_PROG_CXX + +AC_OUTPUT( Makefile tests/Makefile) + +echo +echo '-------------------------------------------------- SUMMARY --------------------------------------------------' +echo +echo Package version............... : $PACKAGE-$VERSION +echo OHPC compiler toolchain........ : $LMOD_FAMILY_COMPILER +echo OHPC MPI toolchain............. : $LMOD_FAMILY_MPI +echo +echo C compiler.................... : `which $CC` +echo C++ compiler.................. : `which $CXX` +echo Fortran compiler ............. : `which $FC` +echo +echo C compiler flags.............. : $CFLAGS +echo C++ compiler flags............ : $CXXFLAGS +echo Fortran compiler flags........ : $FCFLAGS +echo +echo '-------------------------------------------------------------------------------------------------------------' diff --git a/tests/apps/miniFE/ohpc-tests/test_miniFE b/tests/apps/miniFE/ohpc-tests/test_miniFE new file mode 100755 index 0000000000..1a07d5f21e --- /dev/null +++ b/tests/apps/miniFE/ohpc-tests/test_miniFE @@ -0,0 +1,61 @@ +#!/bin/bash +# -*-sh-*- + +TEST_LOGS="" +MAKEFLAGS="" + +source ./TEST_ENV || exit 1 +source ./common/functions || exit 1 + +cd apps/miniFE || exit 1 +export BATS_JUNIT_CLASS=MiniFE + +# bootstrap the local autotools project + +./bootstrap || exit 1 + +rm -f tests/miniFE.*.yaml tests/log.miniFE >& /dev/null + +make_check_failure=0 + +for compiler in $COMPILER_FAMILIES ; do + for mpi in $MPI_FAMILIES ; do + + echo " " + echo " " + echo "-------------------------------------------------------" + echo "Apps: MiniFE tests: $compiler-$mpi" + echo "-------------------------------------------------------" + + rm -f tests/job.*.out >& /dev/null + + module purge || exit 1 + module load prun || exit 1 + module load $compiler || exit 1 + module load $mpi || exit 1 + + ./configure || exit 1 + make clean || exit 1 + + make -k check + if [ $? != 0 ] ; then + make_check_failure=1 + fi + + save_logs_mpi_family tests $compiler $mpi + mv -f tests/job.*.out tests/family-$compiler-$mpi + + make distclean + done +done + +echo " " +echo " " +echo "-------------------------------------------------------" +echo "Apps: MiniFE tests: Results Summary" +echo "-------------------------------------------------------" +printf "%-24s %-10s %-10s %16s %16s\n" \ + Run_ID Compiler MPI_Stack Reference_Time Current_Time +cat tests/log.miniFE + +exit $make_check_failure diff --git a/tests/apps/miniFE/tests/Makefile.am b/tests/apps/miniFE/tests/Makefile.am new file mode 100644 index 0000000000..4e868308fc --- /dev/null +++ b/tests/apps/miniFE/tests/Makefile.am @@ -0,0 +1,5 @@ +TESTS_ENVIRONMENT = BATS_NO_SUMMARY=1 + +TESTS = build +TESTS += rm_execution_single_host +TESTS += rm_execution_multi_host diff --git a/tests/apps/miniFE/tests/TEST_ENV b/tests/apps/miniFE/tests/TEST_ENV new file mode 100644 index 0000000000..276419c7d9 --- /dev/null +++ b/tests/apps/miniFE/tests/TEST_ENV @@ -0,0 +1,11 @@ +if [ -s ../../../TEST_ENV ];then + source ../../../TEST_ENV +fi + +CMD_TIMEOUT="5:00" +TEST_EXE="./src/miniFE.x" +TEST_MAX_COMPUTES=1024 +TEST_NUM_RANKS=8 +TEST_NUM_THREADS=4 +TEST_VERIFY=1 +TEST_PERFLOG=./log.miniFE diff --git a/tests/apps/miniFE/tests/basic/Box.hpp b/tests/apps/miniFE/tests/basic/Box.hpp new file mode 100644 index 0000000000..62046e4f5b --- /dev/null +++ b/tests/apps/miniFE/tests/basic/Box.hpp @@ -0,0 +1,22 @@ +#ifndef _Box_hpp_ +#define _Box_hpp_ + +/** + * a 'Box' is 3 pairs of ints, where each pair specifies a lower + * and upper bound for one of the 3 spatial dimensions. + * + * This struct stores the 3 pairs as a simple array of 6 ints, + * but defines the bracket operator so that it can be referenced + * using 2-dimensional array notation like this: + * int xmin = box[0][0]; int xmax = box[0][1]; + * int ymin = box[1][0]; int ymax = box[1][1]; + * int zmin = box[2][0]; int zmax = box[2][1]; + */ +struct Box { + int ranges[6]; + int* operator[](int xyz) { return &ranges[xyz*2]; } + const int* operator[](int xyz) const { return &ranges[xyz*2]; } +}; + +#endif + diff --git a/tests/apps/miniFE/tests/basic/BoxIterator.hpp b/tests/apps/miniFE/tests/basic/BoxIterator.hpp new file mode 100644 index 0000000000..f644119a40 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/BoxIterator.hpp @@ -0,0 +1,143 @@ +#ifndef _BoxTraverser_hpp_ +#define _BoxTraverser_hpp_ + +//@HEADER +// ************************************************************************ +// +// miniFE: simple finite-element assembly and linear-solve +// Copyright (2006) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA +// Questions? Contact Michael A. Heroux (maherou@sandia.gov) +// +// ************************************************************************ +//@HEADER + +namespace miniFE { + +/** Class for traversing a 3-dimensional 'box' of indices. + + //One way to traverse a 'box[3][2]' is to use a triply-nested for-loop: + for(int z=box[2][0]; z= box_[0][1]) { + x = box_[0][0]; + ++y; + if (y >= box_[1][1]) { + y = box_[1][0]; + ++z; + if (z >= box_[2][1]) { + z = box_[2][1]; + y = box_[1][1]; + x = box_[0][1]; + } + } + } + return *this; + } + + BoxIterator operator++(int) + { + BoxIterator temp = *this; + ++(*this); + return temp; + } + + bool operator==(const BoxIterator& rhs) const + { + return x == rhs.x && y == rhs.y && z == rhs.z; + } + + bool operator!=(const BoxIterator& rhs) const + { + return !(this->operator==(rhs)); + } + + int x; + int y; + int z; + +private: + BoxIterator(const Box& box, bool at_end = false) + : x(box[0][0]), + y(box[1][0]), + z(box[2][0]), + box_() + { + box_[0][0] = box[0][0]; box_[0][1] = box[0][1]; + box_[1][0] = box[1][0]; box_[1][1] = box[1][1]; + box_[2][0] = box[2][0]; box_[2][1] = box[2][1]; + if (at_end) { + x = box[0][1]; + y = box[1][1]; + z = box[2][1]; + } + } + + Box box_; +};//class BoxTraverser + +}//namespace miniFE + +#endif + diff --git a/tests/apps/miniFE/tests/basic/BoxPartition.cpp b/tests/apps/miniFE/tests/basic/BoxPartition.cpp new file mode 100644 index 0000000000..2a4e5a71f6 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/BoxPartition.cpp @@ -0,0 +1,477 @@ + +#include +#include + +#include +#include + +/*--------------------------------------------------------------------*/ + +static int box_map_local_entry( const Box& box , + const int ghost , + int local_x , + int local_y , + int local_z ) +{ + const int nx = 2 * ghost + box[0][1] - box[0][0] ; + const int ny = 2 * ghost + box[1][1] - box[1][0] ; + const int nz = 2 * ghost + box[2][1] - box[2][0] ; + int result = -1 ; + + local_x += ghost ; + local_y += ghost ; + local_z += ghost ; + + if ( 0 <= local_x && local_x < nx && + 0 <= local_y && local_y < ny && + 0 <= local_z && local_z < nz ) { + + result = local_z * ny * nx + local_y * nx + local_x ; + } + return result ; +} + +int box_map_local( const Box& box_local, + const int ghost , + const int box_local_map[] , + const int local_x , + const int local_y , + const int local_z ) +{ + int result = box_map_local_entry(box_local,ghost,local_x,local_y,local_z); + + if ( 0 <= result ) { + result = box_local_map[ result ]; + } + + return result ; +} + +/*--------------------------------------------------------------------*/ +/* Recursively split a box into into (up-ip) sub-boxes */ + +void box_partition( int ip , int up , int axis , + const Box& box, + Box* p_box ) +{ + const int np = up - ip ; + if ( 1 == np ) { + p_box[ip][0][0] = box[0][0] ; p_box[ip][0][1] = box[0][1] ; + p_box[ip][1][0] = box[1][0] ; p_box[ip][1][1] = box[1][1] ; + p_box[ip][2][0] = box[2][0] ; p_box[ip][2][1] = box[2][1] ; + } + else { + const int n = box[ axis ][1] - box[ axis ][0] ; + const int np_low = np / 2 ; /* Rounded down */ + const int np_upp = np - np_low ; + + const int n_upp = (int) (((double) n) * ( ((double)np_upp) / ((double)np))); + const int n_low = n - n_upp ; + const int next_axis = ( axis + 2 ) % 3 ; + + if ( np_low ) { /* P = [ip,ip+np_low) */ + Box dbox ; + dbox[0][0] = box[0][0] ; dbox[0][1] = box[0][1] ; + dbox[1][0] = box[1][0] ; dbox[1][1] = box[1][1] ; + dbox[2][0] = box[2][0] ; dbox[2][1] = box[2][1] ; + + dbox[ axis ][1] = dbox[ axis ][0] + n_low ; + + box_partition( ip, ip + np_low, next_axis, dbox, p_box ); + } + + if ( np_upp ) { /* P = [ip+np_low,ip+np_low+np_upp) */ + Box dbox; + dbox[0][0] = box[0][0] ; dbox[0][1] = box[0][1] ; + dbox[1][0] = box[1][0] ; dbox[1][1] = box[1][1] ; + dbox[2][0] = box[2][0] ; dbox[2][1] = box[2][1] ; + + ip += np_low ; + dbox[ axis ][0] += n_low ; + dbox[ axis ][1] = dbox[ axis ][0] + n_upp ; + + box_partition( ip, ip + np_upp, next_axis, dbox, p_box ); + } + } +} + +/*--------------------------------------------------------------------*/ + +static int box_disjoint( const Box& a , const Box& b) +{ + return a[0][1] <= b[0][0] || b[0][1] <= a[0][0] || + a[1][1] <= b[1][0] || b[1][1] <= a[1][0] || + a[2][1] <= b[2][0] || b[2][1] <= a[2][0] ; +} + +static void resize_int( int ** a , int * allocLen , int newLen ) +{ + int k = 32; + while ( k < newLen ) { k <<= 1 ; } + if ( NULL == *a ) + { *a = (int*)malloc( sizeof(int)*(*allocLen = k) ); } + else if ( *allocLen < k ) + { *a = (int*)realloc(*a , sizeof(int)*(*allocLen = k)); } +} + +static void box_partition_maps( + const int np , + const int my_p , + const Box* pbox, + const int ghost , + int ** map_local_id , + int ** map_recv_pc , + int ** map_send_pc , + int ** map_send_id ) +{ + const Box& my_box = pbox[my_p] ; + + const int my_ix = my_box[0][0] ; + const int my_iy = my_box[1][0] ; + const int my_iz = my_box[2][0] ; + const int my_nx = my_box[0][1] - my_box[0][0] ; + const int my_ny = my_box[1][1] - my_box[1][0] ; + const int my_nz = my_box[2][1] - my_box[2][0] ; + + const int my_use_nx = 2 * ghost + my_nx ; + const int my_use_ny = 2 * ghost + my_ny ; + const int my_use_nz = 2 * ghost + my_nz ; + + const int id_length = my_use_nx * my_use_ny * my_use_nz ; + + int * local_id = (int *) malloc( id_length * sizeof(int) ); + int * recv_pc = (int *) malloc( ( np + 1 ) * sizeof(int) ); + int * send_pc = (int *) malloc( ( np + 1 ) * sizeof(int) ); + + int * send_id = NULL ; + int send_id_size = 0 ; + + int iLocal , iSend ; + int i ; + + Box my_use_box; + + my_use_box[0][0] = my_box[0][0] - ghost ; + my_use_box[0][1] = my_box[0][1] + ghost ; + my_use_box[1][0] = my_box[1][0] - ghost ; + my_use_box[1][1] = my_box[1][1] + ghost ; + my_use_box[2][0] = my_box[2][0] - ghost ; + my_use_box[2][1] = my_box[2][1] + ghost ; + + for ( i = 0 ; i < id_length ; ++i ) { local_id[i] = -1 ; } + + iSend = 0 ; + iLocal = 0 ; + + /* The vector space is partitioned by processors */ + + for ( i = 0 ; i < np ; ++i ) { + const int ip = ( i + my_p ) % np ; + recv_pc[i] = iLocal ; + send_pc[i] = iSend ; + + if ( ! box_disjoint( my_use_box , pbox[ip] ) ) { + const int p_ix = pbox[ip][0][0] ; + const int p_iy = pbox[ip][1][0] ; + const int p_iz = pbox[ip][2][0] ; + const int p_ex = pbox[ip][0][1] ; + const int p_ey = pbox[ip][1][1] ; + const int p_ez = pbox[ip][2][1] ; + + int local_x , local_y , local_z ; + + /* Run the span of global cells that my processor uses */ + + for ( local_z = -ghost ; local_z < my_nz + ghost ; ++local_z ) { + for ( local_y = -ghost ; local_y < my_ny + ghost ; ++local_y ) { + for ( local_x = -ghost ; local_x < my_nx + ghost ; ++local_x ) { + + const int global_z = local_z + my_iz ; + const int global_y = local_y + my_iy ; + const int global_x = local_x + my_ix ; + + const int entry = + box_map_local_entry(my_box,ghost,local_x,local_y,local_z); + + if ( entry < 0 ) { abort(); } + + if ( p_iz <= global_z && global_z < p_ez && + p_iy <= global_y && global_y < p_ey && + p_ix <= global_x && global_x < p_ex ) { + + /* This ordinal is owned by processor 'ip' */ + + local_id[ entry ] = iLocal++ ; + +#if defined(DEBUG_PRINT) +if ( my_p != ip ) { + fprintf(stdout," (%d,%d,%d) : P%d recv at local %d from P%d\n", + global_x,global_y,global_z,my_p,local_id[entry],ip); + fflush(stdout); +} +#endif + } + + /* If in my ownership and used by the other processor */ + if ( my_p != ip && + /* In my ownership: */ + ( 0 <= local_z && local_z < my_nz && + 0 <= local_y && local_y < my_ny && + 0 <= local_x && local_x < my_nx ) && + /* In other processors usage: */ + ( p_iz - ghost <= global_z && global_z < p_ez + ghost && + p_iy - ghost <= global_y && global_y < p_ey + ghost && + p_ix - ghost <= global_x && global_x < p_ex + ghost ) ) { + + resize_int( & send_id , & send_id_size , (iSend + 1) ); + send_id[ iSend ] = local_id[ entry ] ; + ++iSend ; + +#if defined(DEBUG_PRINT) +{ + fprintf(stdout," (%d,%d,%d) : P%d send at local %d to P%d\n", + global_x,global_y,global_z,my_p,local_id[entry],ip); + fflush(stdout); +} +#endif + } + } + } + } + } + } + recv_pc[np] = iLocal ; + send_pc[np] = iSend ; + + *map_local_id = local_id ; + *map_recv_pc = recv_pc ; + *map_send_pc = send_pc ; + *map_send_id = send_id ; +} + +void box_partition_rcb( const int np , + const int my_p , + const Box& root_box, + const int ghost , + Box** pbox, + int ** map_local_id , + int ** map_recv_pc , + int ** map_send_pc , + int ** map_send_id ) +{ + *pbox = new Box[ np ]; + + box_partition( 0 , np , 2 , root_box , *pbox ); + + box_partition_maps( np , my_p , *pbox , ghost , + map_local_id , map_recv_pc , + map_send_pc , map_send_id ); +} + +/*--------------------------------------------------------------------*/ + +#ifdef UNIT_TEST + +static int box_contain( const Box& a , const Box& b ) +{ + return a[0][0] <= b[0][0] && b[0][1] <= a[0][1] && + a[1][0] <= b[1][0] && b[1][1] <= a[1][1] && + a[2][0] <= b[2][0] && b[2][1] <= a[2][1] ; +} + +static void box_print( FILE * fp , const Box& a ) +{ + fprintf(fp,"{ [ %d , %d ) , [ %d , %d ) , [ %d , %d ) }", + a[0][0] , a[0][1] , + a[1][0] , a[1][1] , + a[2][0] , a[2][1] ); +} + +static void test_box( const Box& box , const int np ) +{ + const int ncell_box = box[0][1] * box[1][1] * box[2][1] ; + int ncell_total = 0 ; + int ncell_min = ncell_box ; + int ncell_max = 0 ; + std::vector pbox(np); + int i , j ; + + box_partition( 0 , np , 2 , box , &pbox[0] ); + + for ( i = 0 ; i < np ; ++i ) { + const int ncell = ( pbox[i][0][1] - pbox[i][0][0] ) * + ( pbox[i][1][1] - pbox[i][1][0] ) * + ( pbox[i][2][1] - pbox[i][2][0] ); + + if ( ! box_contain( box , pbox[i] ) ) { + fprintf(stdout," OUT OF BOUNDS pbox[%d/%d] = ",i,np); + box_print(stdout,pbox[i]); + fprintf(stdout,"\n"); + abort(); + } + + for ( j = i + 1 ; j < np ; ++j ) { + if ( ! box_disjoint( pbox[i] , pbox[j] ) ) { + fprintf(stdout," NOT DISJOINT pbox[%d/%d] = ",i,np); + box_print(stdout, pbox[i]); + fprintf(stdout,"\n"); + fprintf(stdout," pbox[%d/%d] = ",j,np); + box_print(stdout, pbox[j]); + fprintf(stdout,"\n"); + abort(); + } + } + ncell_total += ncell ; + + if ( ncell_max < ncell ) { ncell_max = ncell ; } + if ( ncell < ncell_min ) { ncell_min = ncell ; } + } + + if ( ncell_total != ncell_box ) { + fprintf(stdout," WRONG CELL COUNT NP = %d\n",np); + abort(); + } + fprintf(stdout,"NP = %d, total = %d, avg = %d, min = %d, max = %d\n", + np,ncell_box,ncell_box/np,ncell_min,ncell_max); +} + +/*--------------------------------------------------------------------*/ + +static void test_maps( const Box& root_box , const int np ) +{ + const int ghost = 1 ; + const int nx_global = root_box[0][1] - root_box[0][0] ; + const int ny_global = root_box[1][1] - root_box[1][0] ; + int ieq , i , j ; + std::vector pbox(np); + int **local_values ; + int **map_local_id ; + int **map_recv_pc ; + int **map_send_pc ; + int **map_send_id ; + + box_partition( 0 , np , 2 , root_box , &pbox[0] ); + + local_values = (int **) malloc( sizeof(int*) * np ); + map_local_id = (int **) malloc( sizeof(int*) * np ); + map_recv_pc = (int **) malloc( sizeof(int*) * np ); + map_send_pc = (int **) malloc( sizeof(int*) * np ); + map_send_id = (int **) malloc( sizeof(int*) * np ); + + /* Set each local value to the global equation number */ + + for ( ieq = i = 0 ; i < np ; ++i ) { + const Box& mybox = pbox[i] ; + const int nx = mybox[0][1] - mybox[0][0] ; + const int ny = mybox[1][1] - mybox[1][0] ; + const int nz = mybox[2][1] - mybox[2][0] ; + int ix , iy , iz ; + + /* Generate the partition maps for this rank */ + box_partition_maps( np , i , &pbox[0] , ghost , + & map_local_id[i] , & map_recv_pc[i] , + & map_send_pc[i] , & map_send_id[i] ); + + local_values[i] = (int *) malloc( sizeof(int) * map_recv_pc[i][np] ); + + for ( iz = -ghost ; iz < nz + ghost ; ++iz ) { + for ( iy = -ghost ; iy < ny + ghost ; ++iy ) { + for ( ix = -ghost ; ix < nx + ghost ; ++ix ) { + const int ieq = box_map_local(mybox,ghost,map_local_id[i],ix,iy,iz); + + if ( 0 <= ieq ) { + const int ix_global = ix + mybox[0][0] ; + const int iy_global = iy + mybox[1][0] ; + const int iz_global = iz + mybox[2][0] ; + + if ( root_box[0][0] <= ix_global && ix_global < root_box[0][1] && + root_box[1][0] <= iy_global && iy_global < root_box[1][1] && + root_box[2][0] <= iz_global && iz_global < root_box[2][1] ) { + + local_values[i][ ieq ] = ix_global + + iy_global * nx_global + + iz_global * nx_global * ny_global ; + } + else { + local_values[i][ ieq ] = -1 ; + } + } + } + } + } + } + + /* Pair-wise compare the local values */ + /* i == receiving processor rank */ + /* ip == sending processor rank */ + /* j == receiving processor data entry for message from 'ip' */ + /* jp == sending processor data entry for message to 'i' */ + + for ( i = 0 ; i < np ; ++i ) { + for ( j = 1 ; j < np ; ++j ) { + const int ip = ( i + j ) % np ; + const int jp = ( i + np - ip ) % np ; + const int nrecv = map_recv_pc[i] [j+1] - map_recv_pc[i] [j] ; + const int nsend = map_send_pc[ip][jp+1] - map_send_pc[ip][jp] ; + int k ; + if ( nrecv != nsend ) { + fprintf(stderr,"P%d recv %d from P%d\n",i,nrecv,ip); + fprintf(stderr,"P%d send %d to P%d\n",ip,nsend,i); + abort(); + } + for ( k = 0 ; k < nrecv ; ++k ) { + const int irecv = map_recv_pc[i][j] + k ; + const int isend = map_send_pc[ip][jp] + k ; + const int val_irecv = local_values[i][irecv] ; + const int val_isend = local_values[ip][ map_send_id[ip][isend] ] ; + if ( val_irecv != val_isend ) { + fprintf(stderr,"P%d recv[%d] = %d , from P%d\n",i,k,val_irecv,ip); + fprintf(stderr,"P%d send[%d] = %d , to P%d\n",ip,k,val_isend,i); + abort(); + } + } + } + } + + for ( i = 0 ; i < np ; ++i ) { + free( map_local_id[i] ); + free( map_recv_pc[i] ); + free( map_send_pc[i] ); + free( map_send_id[i] ); + free( local_values[i] ); + } + free( map_send_id ); + free( map_send_pc ); + free( map_recv_pc ); + free( map_local_id ); + free( local_values ); +} + +/*--------------------------------------------------------------------*/ + +int main( int argc , char * argv[] ) +{ + int np_max = 256 ; + Box box = { 0 , 64 , 0 , 64 , 0 , 64 }; + int np = 0 ; + + switch( argc ) { + case 3: + sscanf(argv[1],"%d",&np); + sscanf(argv[2],"%dx%dx%d",& box[0][1] , & box[1][1] , & box[2][1] ); + if ( 0 < np ) { test_box( box , np ); } + if ( 0 < np ) { test_maps( box , np ); } + break ; + default: + for ( np = 1 ; np <= np_max ; ++np ) { + test_box( box , np ); + test_maps( box , np ); + } + break ; + } + return 0 ; +} + +#endif + + diff --git a/tests/apps/miniFE/tests/basic/BoxPartition.hpp b/tests/apps/miniFE/tests/basic/BoxPartition.hpp new file mode 100644 index 0000000000..4359a16d0e --- /dev/null +++ b/tests/apps/miniFE/tests/basic/BoxPartition.hpp @@ -0,0 +1,76 @@ +#ifndef _BoxPartition_hpp_ +#define _BoxPartition_hpp_ + +#include + +/** \brief Recursively split a box into (up-ip) sub-boxes + */ +void box_partition( int ip , int up , int axis , + const Box& box , + Box* p_box ); + +/** \brief Partition a { [ix,jx) X [iy,jy) X [iz,jz) } box. + * + * Use recursive coordinate bisection to partition a box + * into np disjoint sub-boxes. Allocate (via malloc) and + * populate the sub-boxes, mapping the local (x,y,z) to + * a local ordinal, and mappings for the send-recv messages + * to update the ghost cells. + * + * usage: + * + * my_nx = pbox[my_p][0][1] - pbox[my_p][0][0] ; + * my_ny = pbox[my_p][1][1] - pbox[my_p][1][0] ; + * my_nz = pbox[my_p][2][1] - pbox[my_p][2][0] ; + * + * for ( x = -ghost ; x < my_nx + ghost ; ++x ) { + * for ( y = -ghost ; y < my_ny + ghost ; ++y ) { + * for ( z = -ghost ; z < my_nz + ghost ; ++z ) { + * const int x_global = x + pbox[my_p][0][0] ; + * const int y_global = y + pbox[my_p][1][0] ; + * const int z_global = z + pbox[my_p][2][0] ; + * + * const int local_ordinal = + * box_map_local( pbox[my_p], ghost, map_local_id, x, y, z ); + * + * if ( 0 <= local_ordinal ) { + * } + * } + * + * for ( i = 1 ; i < np ; ++i ) { + * const int recv_processor = ( my_p + i ) % np ; + * const int recv_ordinal_begin = map_recv_pc[i]; + * const int recv_ordinal_end = map_recv_pc[i+1]; + * } + * + * for ( i = 1 ; i < np ; ++i ) { + * const int send_processor = ( my_p + i ) % np ; + * const int send_map_begin = map_send_pc[i]; + * const int send_map_end = map_send_pc[i+1]; + * for ( j = send_map_begin ; j < send_map_end ; ++j ) { + * send_ordinal = map_send_id[j] ; + * } + * } + */ +void box_partition_rcb( + const int np /**< [in] Number of partitions */ , + const int my_p /**< [in] My partition rank */ , + const Box& root_box /**< [in] 3D Box to partition */ , + const int ghost /**< [in] Ghost cell boundary */ , + Box* pbox /**< [out] Partition's 3D boxes */ , + int ** map_local_id /**< [out] Map local cells */ , + int ** map_recv_pc /**< [out] Receive spans per processor */ , + int ** map_send_pc /**< [out] Send prefix counts per processor */ , + int ** map_send_id /**< [out] Send message ordinals */ ); + +/* \brief Map a local (x,y,z) to a local ordinal. + */ +int box_map_local( const Box& box_local , + const int ghost , + const int map_local_id[] , + const int local_x , + const int local_y , + const int local_z ); + +#endif + diff --git a/tests/apps/miniFE/tests/basic/CSRMatrix.hpp b/tests/apps/miniFE/tests/basic/CSRMatrix.hpp new file mode 100644 index 0000000000..9cfeaeede1 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/CSRMatrix.hpp @@ -0,0 +1,139 @@ +#ifndef _CSRMatrix_hpp_ +#define _CSRMatrix_hpp_ + +//@HEADER +// ************************************************************************ +// +// miniFE: simple finite-element assembly and linear-solve +// Copyright (2006) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA +// Questions? Contact Michael A. Heroux (maherou@sandia.gov) +// +// ************************************************************************ +//@HEADER + +#include +#include +#include +#ifdef HAVE_MPI +#include +#endif + +namespace miniFE { + +template +struct +CSRMatrix { + CSRMatrix(ComputeNode& comp_node) + : has_local_indices(false), + rows(), row_offsets(), row_offsets_external(), + packed_cols(), packed_coefs(), + num_cols(0), + compute_node(comp_node) +#ifdef HAVE_MPI + ,external_index(), external_local_index(), elements_to_send(), + neighbors(), recv_length(), send_length(), send_buffer(), request() +#endif + { + } + + ~CSRMatrix() + {} + + typedef Scalar ScalarType; + typedef LocalOrdinal LocalOrdinalType; + typedef GlobalOrdinal GlobalOrdinalType; + typedef ComputeNode ComputeNodeType; + + bool has_local_indices; + std::vector rows; + std::vector row_offsets; + std::vector row_offsets_external; + std::vector packed_cols; + std::vector packed_coefs; + LocalOrdinal num_cols; + ComputeNode& compute_node; + +#ifdef HAVE_MPI + std::vector external_index; + std::vector external_local_index; + std::vector elements_to_send; + std::vector neighbors; + std::vector recv_length; + std::vector send_length; + std::vector send_buffer; + std::vector request; +#endif + + size_t num_nonzeros() const + { + return row_offsets[row_offsets.size()-1]; + } + + void reserve_space(unsigned nrows, unsigned ncols_per_row) + { + rows.resize(nrows); + row_offsets.resize(nrows+1); + packed_cols.reserve(nrows * ncols_per_row); + packed_coefs.reserve(nrows * ncols_per_row); + } + + void get_row_pointers(GlobalOrdinalType row, size_t& row_length, + GlobalOrdinalType*& cols, + ScalarType*& coefs) + { + ptrdiff_t local_row = -1; + //first see if we can get the local-row index using fast direct lookup: + if (rows.size() >= 1) { + ptrdiff_t idx = row - rows[0]; + if (idx < rows.size() && rows[idx] == row) { + local_row = idx; + } + } + + //if we didn't get the local-row index using direct lookup, try a + //more expensive binary-search: + if (local_row == -1) { + typename std::vector::iterator row_iter = + std::lower_bound(rows.begin(), rows.end(), row); + + //if we still haven't found row, it's not local so jump out: + if (row_iter == rows.end() || *row_iter != row) { + row_length = 0; + return; + } + + local_row = row_iter - rows.begin(); + } + + LocalOrdinalType offset = row_offsets[local_row]; + row_length = row_offsets[local_row+1] - offset; + cols = &packed_cols[offset]; + coefs = &packed_coefs[offset]; + } +}; + +}//namespace miniFE + +#endif + diff --git a/tests/apps/miniFE/tests/basic/ComputeNodeType.hpp b/tests/apps/miniFE/tests/basic/ComputeNodeType.hpp new file mode 100644 index 0000000000..e59f3eb33c --- /dev/null +++ b/tests/apps/miniFE/tests/basic/ComputeNodeType.hpp @@ -0,0 +1,29 @@ +#ifndef _ComputeNodeType_hpp_ +#define _ComputeNodeType_hpp_ + +#if defined(MINIFE_HAVE_TBB) + +#include +#include +typedef TBBNode ComputeNodeType; + +#elif defined(MINIFE_HAVE_TPI) + +#include +#include +typedef TPINode ComputeNodeType; + +#elif defined(MINIFE_HAVE_CUDA) + +#include +typedef CUDANode ComputeNodeType; + +#else + +#include +typedef SerialComputeNode ComputeNodeType; + +#endif + +#endif + diff --git a/tests/apps/miniFE/tests/basic/DotOp.hpp b/tests/apps/miniFE/tests/basic/DotOp.hpp new file mode 100644 index 0000000000..6471949de4 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/DotOp.hpp @@ -0,0 +1,35 @@ +#ifndef DOTOP_HPP_ +#define DOTOP_HPP_ + +template +struct DotOp { + typedef Scalar ReductionType; + + const Scalar* x; + const Scalar* y; + + size_t n; + + ReductionType result; + + inline DotOp() { + result = identity(); + } + + static inline KERNEL_PREFIX ReductionType identity() + { + return 0.0; + } + + inline KERNEL_PREFIX ReductionType reduce(ReductionType u, ReductionType v) const + { + return u+v; + } + + inline KERNEL_PREFIX Scalar generate(int i) const + { + return x[i]*y[i]; + } +}; + +#endif diff --git a/tests/apps/miniFE/tests/basic/ELLMatrix.hpp b/tests/apps/miniFE/tests/basic/ELLMatrix.hpp new file mode 100644 index 0000000000..97b662f3a6 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/ELLMatrix.hpp @@ -0,0 +1,144 @@ +#ifndef _ELLMatrix_hpp_ +#define _ELLMatrix_hpp_ + +//@HEADER +// ************************************************************************ +// +// miniFE: simple finite-element assembly and linear-solve +// Copyright (2006) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA +// Questions? Contact Michael A. Heroux (maherou@sandia.gov) +// +// ************************************************************************ +//@HEADER + +#include +#include +#include +#ifdef HAVE_MPI +#include +#endif + +namespace miniFE { + +template +struct +ELLMatrix { + ELLMatrix(ComputeNode& comp_node) + : has_local_indices(false), + rows(), + cols(), coefs(), + num_cols(0), + num_cols_per_row(0), + compute_node(comp_node) +#ifdef HAVE_MPI + ,external_index(), external_local_index(), elements_to_send(), + neighbors(), recv_length(), send_length(), send_buffer(), request() +#endif + { + } + + ~ELLMatrix() + {} + + typedef Scalar ScalarType; + typedef LocalOrdinal LocalOrdinalType; + typedef GlobalOrdinal GlobalOrdinalType; + typedef ComputeNode ComputeNodeType; + + bool has_local_indices; + std::vector rows; + std::vector cols; + std::vector coefs; + LocalOrdinal num_cols; + LocalOrdinal num_cols_per_row; + ComputeNode& compute_node; + +#ifdef HAVE_MPI + std::vector external_index; + std::vector external_local_index; + std::vector elements_to_send; + std::vector neighbors; + std::vector recv_length; + std::vector send_length; + std::vector send_buffer; + std::vector request; +#endif + + size_t num_nonzeros() const + { + return rows.size()*num_cols_per_row; + } + + void reserve_space(unsigned nrows, unsigned ncols_per_row) + { + rows.resize(nrows); + cols.resize(nrows * ncols_per_row); + coefs.resize(nrows * ncols_per_row); + num_cols_per_row = ncols_per_row; + } + + void get_row_pointers(GlobalOrdinalType row, size_t& row_length, + GlobalOrdinalType*& cols_ptr, + ScalarType*& coefs_ptr) + { + ptrdiff_t local_row = -1; + //first see if we can get the local-row index using fast direct lookup: + if (rows.size() >= 1) { + ptrdiff_t idx = row - rows[0]; + if (idx < rows.size() && rows[idx] == row) { + local_row = idx; + } + } + + //if we didn't get the local-row index using direct lookup, try a + //more expensive binary-search: + if (local_row == -1) { + typename std::vector::iterator row_iter = + std::lower_bound(rows.begin(), rows.end(), row); + + //if we still haven't found row, it's not local so jump out: + if (row_iter == rows.end() || *row_iter != row) { + row_length = 0; + return; + } + + local_row = row_iter - rows.begin(); + } + + cols_ptr = &cols[local_row*num_cols_per_row]; + coefs_ptr = &coefs[local_row*num_cols_per_row]; + + int idx = num_cols_per_row-1; + while(idx>=0) { + if (cols_ptr[idx] != 0) break; + --idx; + } + row_length = idx+1; + } +}; + +}//namespace miniFE + +#endif + diff --git a/tests/apps/miniFE/tests/basic/FEComputeElem.hpp b/tests/apps/miniFE/tests/basic/FEComputeElem.hpp new file mode 100644 index 0000000000..03aa8a22c5 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/FEComputeElem.hpp @@ -0,0 +1,29 @@ +#ifndef FECOMPUTEELEM_HPP_ +#define FECOMPUTEELEM_HPP_ + +#include + +#ifndef KERNEL_PREFIX +#define KERNEL_PREFIX +#endif + +template +struct FEComputeElem { + Scalar* elem_node_coords; + Scalar* elem_diffusion_matrix; + Scalar* elem_source_vector; + +inline KERNEL_PREFIX void operator()(int i) +{ + unsigned nnodes = miniFE::Hex8::numNodesPerElem; + unsigned dim = miniFE::Hex8::spatialDim; + Scalar* coords = elem_node_coords+i*nnodes*dim; + Scalar* diffusionMat = elem_diffusion_matrix+i*nnodes*nnodes; + Scalar* sourceVec = elem_source_vector+i*nnodes; + + miniFE::Hex8::diffusionMatrix(coords, diffusionMat); + miniFE::Hex8::sourceVector(coords, sourceVec); +} +}; + +#endif diff --git a/tests/apps/miniFE/tests/basic/FusedMatvecDotOp.hpp b/tests/apps/miniFE/tests/basic/FusedMatvecDotOp.hpp new file mode 100644 index 0000000000..e4b59e491a --- /dev/null +++ b/tests/apps/miniFE/tests/basic/FusedMatvecDotOp.hpp @@ -0,0 +1,59 @@ +#ifndef FUSEDMATVECDOTOP_HPP_ +#define FUSEDMATVECDOTOP_HPP_ + +#ifndef KERNEL_PREFIX +#define KERNEL_PREFIX +#endif + +template +struct FusedMatvecDotOp { + + typedef typename VectorType::GlobalOrdinalType GlobalOrdinalType; + typedef typename VectorType::LocalOrdinalType LocalOrdinalType; + typedef typename VectorType::ScalarType ScalarType; + typedef ScalarType ReductionType; + + size_t n; + + const LocalOrdinalType* Arowoffsets; + const GlobalOrdinalType* Acols; + const ScalarType* Acoefs; + + const ScalarType* x; + ScalarType* y; + ScalarType beta; + + ReductionType result; + + inline FusedMatvecDotOp() { + result = identity(); + } + + static inline KERNEL_PREFIX ReductionType identity() + { + return 0.0; + } + + inline KERNEL_PREFIX ReductionType reduce(ReductionType u, ReductionType v) const + { + return u+v; + } + + inline KERNEL_PREFIX ScalarType generate(int row) + { + //we count on the caller (ComputeNode) to pass in 'row' + //in range 0..n-1 + + ScalarType sum = beta*y[row]; + + for(LocalOrdinalType i=Arowoffsets[row]; i +#include + +template +struct GetNodesCoords { + const miniFE::simple_mesh_description* mesh; + GlobalOrdinal* elemIDs; + GlobalOrdinal* node_ordinals; + Scalar* elem_node_coords; + +inline void operator()(int i) +{ + unsigned nnodes = miniFE::Hex8::numNodesPerElem; + GlobalOrdinal elemID = elemIDs[i]; + GlobalOrdinal* node_ords = node_ordinals+i*nnodes; + Scalar* node_coords = elem_node_coords+i*nnodes*miniFE::Hex8::spatialDim; + get_elem_nodes_and_coords(*mesh, elemID, node_ords, node_coords); +} +}; + +#endif diff --git a/tests/apps/miniFE/tests/basic/Hex8_box_utils.hpp b/tests/apps/miniFE/tests/basic/Hex8_box_utils.hpp new file mode 100644 index 0000000000..c1662ec6e5 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/Hex8_box_utils.hpp @@ -0,0 +1,174 @@ +#ifndef _Hex8_box_utils_hpp_ +#define _Hex8_box_utils_hpp_ + +//@HEADER +// ************************************************************************ +// +// miniFE: simple finite-element assembly and linear-solve +// Copyright (2006) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA +// Questions? Contact Michael A. Heroux (maherou@sandia.gov) +// +// ************************************************************************ +//@HEADER + +#include + +#include +#include +#include +#include + +namespace miniFE { + + +template +void get_hex8_node_ids(int nx, int ny, + GlobalOrdinal node0, + GlobalOrdinal* elem_node_ids) +{ +//Given box dimensions nx and ny, and a starting node +//(local-node-0 for a hex8), compute the other nodes +//of the hex8 using the exodus ordering convention. + elem_node_ids[0] = node0; + elem_node_ids[1] = node0 + 1; + elem_node_ids[2] = node0 + nx + 1; + elem_node_ids[3] = node0 + nx; + elem_node_ids[4] = node0 + nx*ny; + elem_node_ids[5] = node0 + 1 + nx*ny; + elem_node_ids[6] = node0 + nx + nx*ny + 1; + elem_node_ids[7] = node0 + nx + nx*ny; +} + +template +void get_hex8_node_coords_3d(Scalar x, Scalar y, Scalar z, + Scalar hx, Scalar hy, Scalar hz, + Scalar* elem_node_coords) +{ + //Input: x,y,z are the coordinates of local-node 0 for a Hex8. + //'hx', 'hy', 'hz' are the lengths of the sides of the element + //in each direction. + + elem_node_coords[0] = x; + elem_node_coords[1] = y; + elem_node_coords[2] = z; + + elem_node_coords[3] = x + hx; + elem_node_coords[4] = y; + elem_node_coords[5] = z; + + elem_node_coords[6] = x + hx; + elem_node_coords[7] = y + hy; + elem_node_coords[8] = z; + + elem_node_coords[9] = x; + elem_node_coords[10] = y + hy; + elem_node_coords[11] = z; + + elem_node_coords[12] = x; + elem_node_coords[13] = y; + elem_node_coords[14] = z + hz; + + elem_node_coords[15] = x + hx; + elem_node_coords[16] = y; + elem_node_coords[17] = z + hz; + + elem_node_coords[18] = x + hx; + elem_node_coords[19] = y + hy; + elem_node_coords[20] = z + hz; + + elem_node_coords[21] = x; + elem_node_coords[22] = y + hy; + elem_node_coords[23] = z + hz; +} + +template +void +get_elem_nodes_and_coords(const simple_mesh_description& mesh, + GlobalOrdinal elemID, + GlobalOrdinal* node_ords, Scalar* node_coords) +{ + int global_nodes_x = mesh.global_box[0][1]+1; + int global_nodes_y = mesh.global_box[1][1]+1; + int global_nodes_z = mesh.global_box[2][1]+1; + + if (elemID < 0) { + //I don't think this can happen, but check for the sake of paranoia... + throw std::runtime_error("get_elem_nodes_and_coords ERROR, negative elemID"); + } + + int elem_int_x, elem_int_y, elem_int_z; + get_int_coords(elemID, global_nodes_x-1, global_nodes_y-1, global_nodes_z-1, + elem_int_x, elem_int_y, elem_int_z); + GlobalOrdinal nodeID = get_id(global_nodes_x, global_nodes_y, global_nodes_z, elem_int_x, elem_int_y, elem_int_z); + +#ifdef MINIFE_DEBUG + std::cout<<"\nelemID: "<(nodeID, global_nodes_x,global_nodes_y,global_nodes_z, + ix,iy,iz); + Scalar hx = 1.0/global_elems_x; + Scalar hy = 1.0/global_elems_y; + Scalar hz = 1.0/global_elems_z; + get_hex8_node_coords_3d(ix, iy, iz, hx, hy, hz, node_coords); +#ifdef MINIFE_DEBUG + int offset = 0; + for(int i=0; i +void +get_elem_nodes_and_coords(const simple_mesh_description& mesh, + GlobalOrdinal elemID, + ElemData& elem_data) +{ + get_elem_nodes_and_coords(mesh, elemID, elem_data.elem_node_ids, elem_data.elem_node_coords); +} + +}//namespace miniFE + +#endif + diff --git a/tests/apps/miniFE/tests/basic/Lock.hpp b/tests/apps/miniFE/tests/basic/Lock.hpp new file mode 100644 index 0000000000..16be86fad3 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/Lock.hpp @@ -0,0 +1,103 @@ +#ifndef _Lock_hpp_ +#define _Lock_hpp_ + +//@HEADER +// ************************************************************************ +// +// miniFE: simple finite-element assembly and linear-solve +// Copyright (2006) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA +// Questions? Contact Michael A. Heroux (maherou@sandia.gov) +// +// ************************************************************************ +//@HEADER + +#ifdef MINIFE_HAVE_TBB + +#include +#include + +namespace miniFE { + +static tbb::atomic miniFE_num_matrix_conflicts; +static tbb::atomic miniFE_num_vector_conflicts; + +//We have two lock classes, LockM and LockV. The only reason for +//this is so that they can separately track the number of conflicts +//for matrix accesses versus vector accesses (by incrementing the +//above counters). +//The LockingMatrix class uses LockM, LockingVector uses LockV. + +template +class LockM { +public: + // Constructors/destructors + LockM(tbb::atomic& row) + : locked_row_(row) + { + if (++locked_row_ != 1) { + unsigned counter = 0; + while(locked_row_ != 1) { + ++counter; + } + ++miniFE_num_matrix_conflicts; + } + } + ~LockM() + { --locked_row_; } + +private: + tbb::atomic& locked_row_; + LockM(const LockM&); + LockM& operator=(const LockM&); +}; + +template +class LockV { +public: + // Constructors/destructors + LockV(tbb::atomic& row) + : locked_row_(row) + { + if (++locked_row_ != 1) { + unsigned counter = 0; + while(locked_row_ != 1) { + ++counter; + } + ++miniFE_num_vector_conflicts; + } + } + ~LockV() + { --locked_row_; } + +private: + tbb::atomic& locked_row_; + LockV(const LockV&); + LockV& operator=(const LockV&); +}; + +}//namespace miniFE + +#else +#error "ERROR, this file shouldn't be compiled if MINIFE_HAVE_TBB isn't defined." +#endif + +#endif + diff --git a/tests/apps/miniFE/tests/basic/LockingMatrix.hpp b/tests/apps/miniFE/tests/basic/LockingMatrix.hpp new file mode 100644 index 0000000000..c2782741e2 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/LockingMatrix.hpp @@ -0,0 +1,74 @@ +#ifndef _LockingMatrix_hpp_ +#define _LockingMatrix_hpp_ + +//@HEADER +// ************************************************************************ +// +// miniFE: simple finite-element assembly and linear-solve +// Copyright (2006) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA +// Questions? Contact Michael A. Heroux (maherou@sandia.gov) +// +// ************************************************************************ +//@HEADER + +#include + +#include + +namespace miniFE { + +template +class LockingMatrix { +public: + typedef typename MatrixType::GlobalOrdinalType GlobalOrdinal; + typedef typename MatrixType::ScalarType Scalar; + + LockingMatrix(MatrixType& A) : A_(A), myFirstRow_(0), myLastRow_(0), numMyRows_(0), row_locks_() + { + if (A_.rows.size() > 0) { + myFirstRow_ = A_.rows[0]; + myLastRow_ = A_.rows[A_.rows.size()-1]; + } + numMyRows_ = myLastRow_-myFirstRow_+1; + row_locks_.resize(numMyRows_); + } + + void sum_in(GlobalOrdinal row, size_t row_len, const GlobalOrdinal* col_indices, const Scalar* values) + { + int local_row = row - myFirstRow_; + if (local_row >= 0 && local_row < numMyRows_) { + LockM lock(row_locks_[local_row]); + sum_into_row(row, row_len, col_indices, values, A_); + } + } + +private: + MatrixType& A_; + GlobalOrdinal myFirstRow_; + GlobalOrdinal myLastRow_; + size_t numMyRows_; + std::vector > row_locks_; +}; + +}//namespace miniFE + +#endif + diff --git a/tests/apps/miniFE/tests/basic/LockingVector.hpp b/tests/apps/miniFE/tests/basic/LockingVector.hpp new file mode 100644 index 0000000000..60f7598580 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/LockingVector.hpp @@ -0,0 +1,77 @@ +#ifndef _LockingVector_hpp_ +#define _LockingVector_hpp_ + +//@HEADER +// ************************************************************************ +// +// miniFE: simple finite-element assembly and linear-solve +// Copyright (2006) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA +// Questions? Contact Michael A. Heroux (maherou@sandia.gov) +// +// ************************************************************************ +//@HEADER + +#include + +#include + +namespace miniFE { + +template +class LockingVector { +public: + typedef typename VectorType::GlobalOrdinalType GlobalOrdinal; + typedef typename VectorType::ScalarType Scalar; + + LockingVector(VectorType& x) : x_(x), myFirstRow_(0), myLastRow_(0), numMyRows_(0), row_locks_() + { + if (x_.local_size > 0) { + myFirstRow_ = x_.startIndex; + myLastRow_ = myFirstRow_ + x_.local_size - 1; + } + numMyRows_ = myLastRow_-myFirstRow_+1; + row_locks_.resize(numMyRows_); + } + + void sum_in(size_t num_indices, const GlobalOrdinal* indices, const Scalar* values) + { + for(int i=0; i= 0 && local_row < numMyRows_) { + LockV lock(row_locks_[local_row]); + sum_into_vector(1, &row, &values[i], x_); + } + } + } + +private: + VectorType& x_; + GlobalOrdinal myFirstRow_; + GlobalOrdinal myLastRow_; + size_t numMyRows_; + std::vector > row_locks_; +}; + +}//namespace miniFE + +#endif + diff --git a/tests/apps/miniFE/tests/basic/MatrixCopyOp.hpp b/tests/apps/miniFE/tests/basic/MatrixCopyOp.hpp new file mode 100644 index 0000000000..f6c300a407 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/MatrixCopyOp.hpp @@ -0,0 +1,33 @@ +#ifndef _MatrixCopyOp_hpp_ +#define _MatrixCopyOp_hpp_ + +template +struct MatrixCopyOp { + typedef typename MatrixType::GlobalOrdinalType GlobalOrdinalType; + typedef typename MatrixType::LocalOrdinalType LocalOrdinalType; + typedef typename MatrixType::ScalarType ScalarType; + + const GlobalOrdinalType* src_rows; + const LocalOrdinalType* src_rowoffsets; + const GlobalOrdinalType* src_cols; + const ScalarType* src_coefs; + + GlobalOrdinalType* dest_rows; + LocalOrdinalType* dest_rowoffsets; + GlobalOrdinalType* dest_cols; + ScalarType* dest_coefs; + int n; + + inline void operator()(int i) + { + dest_rows[i] = src_rows[i]; + dest_rowoffsets[i] = src_rowoffsets[i]; + for(int j=src_rowoffsets[i]; j +#include +#include + +#include +#include + +#include + +template +void sort_if_needed(GlobalOrdinal* list, + GlobalOrdinal list_len) +{ + bool need_to_sort = false; + for(GlobalOrdinal i=list_len-1; i>=1; --i) { + if (list[i] < list[i-1]) { + need_to_sort = true; + break; + } + } + + if (need_to_sort) { + std::sort(list,list+list_len); + } +} + +template +struct MatrixInitOp { +}; + +template<> +struct MatrixInitOp > { + MatrixInitOp(const std::vector& rows_vec, + const std::vector& row_offsets_vec, + const std::vector& row_coords_vec, + int global_nx, int global_ny, int global_nz, + MINIFE_GLOBAL_ORDINAL global_n_rows, + const miniFE::simple_mesh_description& input_mesh, + miniFE::CSRMatrix& matrix) + : rows(&rows_vec[0]), + row_offsets(&row_offsets_vec[0]), + row_coords(&row_coords_vec[0]), + global_nodes_x(global_nx), + global_nodes_y(global_ny), + global_nodes_z(global_nz), + global_nrows(global_n_rows), + mesh(&input_mesh), + dest_rows(&matrix.rows[0]), + dest_rowoffsets(&matrix.row_offsets[0]), + dest_cols(&matrix.packed_cols[0]), + dest_coefs(&matrix.packed_coefs[0]), + n(matrix.rows.size()) + { + matrix.packed_cols.resize(row_offsets_vec[n]); + matrix.packed_coefs.resize(row_offsets_vec[n]); + dest_rowoffsets[n] = row_offsets_vec[n]; + } + + typedef MINIFE_GLOBAL_ORDINAL GlobalOrdinalType; + typedef MINIFE_LOCAL_ORDINAL LocalOrdinalType; + typedef MINIFE_SCALAR ScalarType; + + const GlobalOrdinalType* rows; + const LocalOrdinalType* row_offsets; + const int* row_coords; + + int global_nodes_x; + int global_nodes_y; + int global_nodes_z; + + GlobalOrdinalType global_nrows; + + GlobalOrdinalType* dest_rows; + LocalOrdinalType* dest_rowoffsets; + GlobalOrdinalType* dest_cols; + ScalarType* dest_coefs; + int n; + + const miniFE::simple_mesh_description* mesh; + + inline void operator()(int i) + { + dest_rows[i] = rows[i]; + int offset = row_offsets[i]; + dest_rowoffsets[i] = offset; + int ix = row_coords[i*3]; + int iy = row_coords[i*3+1]; + int iz = row_coords[i*3+2]; + GlobalOrdinalType nnz = 0; + for(int sz=-1; sz<=1; ++sz) + for(int sy=-1; sy<=1; ++sy) + for(int sx=-1; sx<=1; ++sx) { + GlobalOrdinalType col_id = + miniFE::get_id(global_nodes_x, global_nodes_y, global_nodes_z, + ix+sx, iy+sy, iz+sz); + if (col_id >= 0 && col_id < global_nrows) { + GlobalOrdinalType col = mesh->map_id_to_row(col_id); + dest_cols[offset+nnz] = col; + dest_coefs[offset+nnz] = 0; + ++nnz; + } + } + + sort_if_needed(&dest_cols[offset], nnz); + } +}; + +template<> +struct MatrixInitOp > { + MatrixInitOp(const std::vector& rows_vec, + const std::vector& /*row_offsets_vec*/, + const std::vector& row_coords_vec, + int global_nx, int global_ny, int global_nz, + MINIFE_GLOBAL_ORDINAL global_n_rows, + const miniFE::simple_mesh_description& input_mesh, + miniFE::ELLMatrix& matrix) + : rows(&rows_vec[0]), + row_coords(&row_coords_vec[0]), + global_nodes_x(global_nx), + global_nodes_y(global_ny), + global_nodes_z(global_nz), + global_nrows(global_n_rows), + mesh(&input_mesh), + dest_rows(&matrix.rows[0]), + dest_cols(&matrix.cols[0]), + dest_coefs(&matrix.coefs[0]), + n(matrix.rows.size()), + ncols_per_row(matrix.num_cols_per_row) + { + } + + typedef MINIFE_GLOBAL_ORDINAL GlobalOrdinalType; + typedef MINIFE_LOCAL_ORDINAL LocalOrdinalType; + typedef MINIFE_SCALAR ScalarType; + + const GlobalOrdinalType* rows; + const int* row_coords; + + int global_nodes_x; + int global_nodes_y; + int global_nodes_z; + + GlobalOrdinalType global_nrows; + + GlobalOrdinalType* dest_rows; + GlobalOrdinalType* dest_cols; + ScalarType* dest_coefs; + int n; + int ncols_per_row; + + const miniFE::simple_mesh_description* mesh; + + inline void operator()(int i) + { + dest_rows[i] = rows[i]; + int offset = i*ncols_per_row; + int ix = row_coords[i*3]; + int iy = row_coords[i*3+1]; + int iz = row_coords[i*3+2]; + GlobalOrdinalType nnz = 0; + for(int sz=-1; sz<=1; ++sz) + for(int sy=-1; sy<=1; ++sy) + for(int sx=-1; sx<=1; ++sx) { + GlobalOrdinalType col_id = + miniFE::get_id(global_nodes_x, global_nodes_y, global_nodes_z, + ix+sx, iy+sy, iz+sz); + if (col_id >= 0 && col_id < global_nrows) { + GlobalOrdinalType col = mesh->map_id_to_row(col_id); + dest_cols[offset+nnz] = col; + dest_coefs[offset+nnz] = 0; + ++nnz; + } + } + + sort_if_needed(&dest_cols[offset], nnz); + } +}; + +#endif + diff --git a/tests/apps/miniFE/tests/basic/MatvecOp.hpp b/tests/apps/miniFE/tests/basic/MatvecOp.hpp new file mode 100644 index 0000000000..9c5c8e423f --- /dev/null +++ b/tests/apps/miniFE/tests/basic/MatvecOp.hpp @@ -0,0 +1,99 @@ +#ifndef _MatvecOp_hpp_ +#define _MatvecOp_hpp_ + +#ifndef KERNEL_PREFIX +#define KERNEL_PREFIX +#endif + +#include +#include +#include + +template +struct MatvecOp { +}; + +template<> +struct MatvecOp > { + MatvecOp(miniFE::CSRMatrix& A) + : n(A.rows.size()), + Arowoffsets(&A.row_offsets[0]), + Acols(&A.packed_cols[0]), + Acoefs(&A.packed_coefs[0]) + { + } + + size_t n; + + typedef MINIFE_GLOBAL_ORDINAL GlobalOrdinalType; + typedef MINIFE_LOCAL_ORDINAL LocalOrdinalType; + typedef MINIFE_SCALAR ScalarType; + + const LocalOrdinalType* Arowoffsets; + const GlobalOrdinalType* Acols; + const ScalarType* Acoefs; + + const ScalarType* x; + ScalarType* y; + ScalarType beta; + + inline KERNEL_PREFIX void operator()(int row) + { + //we count on the caller (ComputeNode) to pass in 'row' + //in range 0..n-1 + + ScalarType sum = beta*y[row]; + + for(LocalOrdinalType i=Arowoffsets[row]; i +struct MatvecOp > { + MatvecOp(miniFE::ELLMatrix& A) + : n(A.rows.size()), + Acols(&A.cols[0]), + Acoefs(&A.coefs[0]), + ncols_per_row(A.num_cols_per_row) + { + } + + size_t n; + + typedef MINIFE_GLOBAL_ORDINAL GlobalOrdinalType; + typedef MINIFE_LOCAL_ORDINAL LocalOrdinalType; + typedef MINIFE_SCALAR ScalarType; + + const GlobalOrdinalType* Acols; + const ScalarType* Acoefs; + int ncols_per_row; + + const ScalarType* x; + ScalarType* y; + ScalarType beta; + + inline KERNEL_PREFIX void operator()(int row) + { + //we count on the caller (ComputeNode) to pass in 'row' + //in range 0..n-1 + + ScalarType sum = beta*y[row]; + + for(LocalOrdinalType i=0; i +struct MemInitOp { + Scalar* ptr; + size_t n; + inline void operator()(size_t i) + { + ptr[i] = 0; + } +}; + +#endif diff --git a/tests/apps/miniFE/tests/basic/NoOpMemoryModel.hpp b/tests/apps/miniFE/tests/basic/NoOpMemoryModel.hpp new file mode 100644 index 0000000000..92d1eb1397 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/NoOpMemoryModel.hpp @@ -0,0 +1,27 @@ +#ifndef _NoOpMemoryModel_hpp_ +#define _NoOpMemoryModel_hpp_ + +class NoOpMemoryModel { + public: + NoOpMemoryModel(){} + virtual ~NoOpMemoryModel(){} + + template + T* get_buffer(const T* host_ptr, size_t buf_size) + { return const_cast(host_ptr); } + + template + void destroy_buffer(T*& device_ptr) + { } + + template + void copy_to_buffer(const T* host_ptr, size_t buf_size, T* device_ptr) + { } + + template + void copy_from_buffer(T* host_ptr, size_t buf_size, const T* device_ptr) + { } +}; + +#endif + diff --git a/tests/apps/miniFE/tests/basic/SerialComputeNode.hpp b/tests/apps/miniFE/tests/basic/SerialComputeNode.hpp new file mode 100644 index 0000000000..1f45ed8def --- /dev/null +++ b/tests/apps/miniFE/tests/basic/SerialComputeNode.hpp @@ -0,0 +1,25 @@ +#ifndef SERIALCOMPUTENODE_HPP_ +#define SERIALCOMPUTENODE_HPP_ + +#include + +class SerialComputeNode : public NoOpMemoryModel { + public: + template + void parallel_for(unsigned int length, WDP wd) { + for(int i=0; i + void parallel_reduce(unsigned int length, WDP &wd) { + wd.result = wd.identity(); + for(int i=0; i +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef MINIFE_HAVE_TBB +#include +#endif + +#ifdef HAVE_MPI +#include +#endif + +namespace miniFE { + +template +void init_matrix(MatrixType& M, + const std::vector& rows, + const std::vector& row_offsets, + const std::vector& row_coords, + int global_nodes_x, + int global_nodes_y, + int global_nodes_z, + typename MatrixType::GlobalOrdinalType global_nrows, + const simple_mesh_description& mesh) +{ + MatrixInitOp mat_init(rows, row_offsets, row_coords, + global_nodes_x, global_nodes_y, global_nodes_z, + global_nrows, mesh, M); + +#ifdef MINIFE_HAVE_CUDA +//if on cuda, don't do this with parallel_for... + for(size_t i=0; i +void sort_with_companions(ptrdiff_t len, T* array, U* companions) +{ + ptrdiff_t i, j, index; + U companion; + + for (i=1; i < len; i++) { + index = array[i]; + companion = companions[i]; + j = i; + while ((j > 0) && (array[j-1] > index)) + { + array[j] = array[j-1]; + companions[j] = companions[j-1]; + j = j - 1; + } + array[j] = index; + companions[j] = companion; + } +} + +template +void write_matrix(const std::string& filename, + MatrixType& mat) +{ + typedef typename MatrixType::LocalOrdinalType LocalOrdinalType; + typedef typename MatrixType::GlobalOrdinalType GlobalOrdinalType; + typedef typename MatrixType::ScalarType ScalarType; + + int numprocs = 1, myproc = 0; +#ifdef HAVE_MPI + MPI_Comm_size(MPI_COMM_WORLD, &numprocs); + MPI_Comm_rank(MPI_COMM_WORLD, &myproc); +#endif + + std::ostringstream osstr; + osstr << filename << "." << numprocs << "." << myproc; + std::string full_name = osstr.str(); + std::ofstream ofs(full_name.c_str()); + + size_t nrows = mat.rows.size(); + size_t nnz = mat.num_nonzeros(); + + for(int p=0; p +void +sum_into_row(int row_len, + GlobalOrdinal* row_indices, + Scalar* row_coefs, + int num_inputs, + const GlobalOrdinal* input_indices, + const Scalar* input_coefs) +{ + for(size_t i=0; i +void +sum_into_row(typename MatrixType::GlobalOrdinalType row, + size_t num_indices, + const typename MatrixType::GlobalOrdinalType* col_inds, + const typename MatrixType::ScalarType* coefs, + MatrixType& mat) +{ + typedef typename MatrixType::GlobalOrdinalType GlobalOrdinal; + typedef typename MatrixType::ScalarType Scalar; + + size_t row_len = 0; + GlobalOrdinal* mat_row_cols = NULL; + Scalar* mat_row_coefs = NULL; + + mat.get_row_pointers(row, row_len, mat_row_cols, mat_row_coefs); + if (row_len == 0) return; + + sum_into_row(row_len, mat_row_cols, mat_row_coefs, num_indices, col_inds, coefs); +} + +template +void +sum_in_symm_elem_matrix(size_t num, + const typename MatrixType::GlobalOrdinalType* indices, + const typename MatrixType::ScalarType* coefs, + MatrixType& mat) +{ + typedef typename MatrixType::ScalarType Scalar; + typedef typename MatrixType::GlobalOrdinalType GlobalOrdinal; + +//indices is length num (which should be nodes-per-elem) +//coefs is the upper triangle of the element diffusion matrix +//which should be length num*(num+1)/2 +//std::cout< +void +sum_in_elem_matrix(size_t num, + const typename MatrixType::GlobalOrdinalType* indices, + const typename MatrixType::ScalarType* coefs, + MatrixType& mat) +{ + size_t offset = 0; + + for(size_t i=0; i +void +sum_into_global_linear_system(ElemData& elem_data, + MatrixType& A, VectorType& b) +{ + sum_in_symm_elem_matrix(elem_data.nodes_per_elem, elem_data.elem_node_ids, + elem_data.elem_diffusion_matrix, A); + sum_into_vector(elem_data.nodes_per_elem, elem_data.elem_node_ids, + elem_data.elem_source_vector, b); +} + +#ifdef MINIFE_HAVE_TBB +template +void +sum_in_elem_matrix(size_t num, + const typename MatrixType::GlobalOrdinalType* indices, + const typename MatrixType::ScalarType* coefs, + LockingMatrix& mat) +{ + size_t offset = 0; + + for(size_t i=0; i +void +sum_into_global_linear_system(ElemData& elem_data, + LockingMatrix& A, LockingVector& b) +{ + sum_in_elem_matrix(elem_data.nodes_per_elem, elem_data.elem_node_ids, + elem_data.elem_diffusion_matrix, A); + sum_into_vector(elem_data.nodes_per_elem, elem_data.elem_node_ids, + elem_data.elem_source_vector, b); +} +#endif + +template +void +add_to_diagonal(typename MatrixType::ScalarType value, MatrixType& mat) +{ + for(size_t i=0; i +double +parallel_memory_overhead_MB(const MatrixType& A) +{ + typedef typename MatrixType::GlobalOrdinalType GlobalOrdinal; + typedef typename MatrixType::LocalOrdinalType LocalOrdinal; + double mem_MB = 0; + +#ifdef HAVE_MPI + double invMB = 1.0/(1024*1024); + mem_MB = invMB*A.external_index.size()*sizeof(GlobalOrdinal); + mem_MB += invMB*A.external_local_index.size()*sizeof(GlobalOrdinal); + mem_MB += invMB*A.elements_to_send.size()*sizeof(GlobalOrdinal); + mem_MB += invMB*A.neighbors.size()*sizeof(int); + mem_MB += invMB*A.recv_length.size()*sizeof(LocalOrdinal); + mem_MB += invMB*A.send_length.size()*sizeof(LocalOrdinal); + + double tmp = mem_MB; + MPI_Allreduce(&tmp, &mem_MB, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); +#endif + + return mem_MB; +} + +template +void rearrange_matrix_local_external(MatrixType& A) +{ + //This function will rearrange A so that local entries are contiguous at the front + //of A's memory, and external entries are contiguous at the back of A's memory. + // + //A.row_offsets will describe where the local entries occur, and + //A.row_offsets_external will describe where the external entries occur. + + typedef typename MatrixType::GlobalOrdinalType GlobalOrdinal; + typedef typename MatrixType::LocalOrdinalType LocalOrdinal; + typedef typename MatrixType::ScalarType Scalar; + + size_t nrows = A.rows.size(); + std::vector tmp_row_offsets(nrows*2); + std::vector tmp_row_offsets_external(nrows*2); + + LocalOrdinal num_local_nz = 0; + LocalOrdinal num_extern_nz = 0; + + //First sort within each row of A, so that local entries come + //before external entries within each row. + //tmp_row_offsets describe the locations of the local entries, and + //tmp_row_offsets_external describe the locations of the external entries. + // + for(size_t i=0; i ext_cols(num_extern_nz); + std::vector ext_coefs(num_extern_nz); + std::vector ext_offsets(nrows+1); + LocalOrdinal offset = 0; + for(size_t i=0; i +void +zero_row_and_put_1_on_diagonal(MatrixType& A, typename MatrixType::GlobalOrdinalType row) +{ + typedef typename MatrixType::GlobalOrdinalType GlobalOrdinal; + typedef typename MatrixType::LocalOrdinalType LocalOrdinal; + typedef typename MatrixType::ScalarType Scalar; + + size_t row_len = 0; + GlobalOrdinal* cols = NULL; + Scalar* coefs = NULL; + A.get_row_pointers(row, row_len, cols, coefs); + + for(size_t i=0; i +void +impose_dirichlet(typename MatrixType::ScalarType prescribed_value, + MatrixType& A, + VectorType& b, + int global_nx, + int global_ny, + int global_nz, + const std::set& bc_rows) +{ + typedef typename MatrixType::GlobalOrdinalType GlobalOrdinal; + typedef typename MatrixType::LocalOrdinalType LocalOrdinal; + typedef typename MatrixType::ScalarType Scalar; + + GlobalOrdinal first_local_row = A.rows.size()>0 ? A.rows[0] : 0; + GlobalOrdinal last_local_row = A.rows.size()>0 ? A.rows[A.rows.size()-1] : -1; + + typename std::set::const_iterator + bc_iter = bc_rows.begin(), bc_end = bc_rows.end(); + for(; bc_iter!=bc_end; ++bc_iter) { + GlobalOrdinal row = *bc_iter; + if (row >= first_local_row && row <= last_local_row) { + size_t local_row = row - first_local_row; + b.coefs[local_row] = prescribed_value; + zero_row_and_put_1_on_diagonal(A, row); + } + } + + for(size_t i=0; i +typename TypeTraits::magnitude_type +matvec_and_dot(MatrixType& A, + VectorType& x, + VectorType& y) +{ + timer_type t0 = mytimer(); + exchange_externals(A, x); + exchtime += mytimer()-t0; + + typedef typename TypeTraits::magnitude_type magnitude; + typedef typename MatrixType::ScalarType ScalarType; + typedef typename MatrixType::GlobalOrdinalType GlobalOrdinalType; + typedef typename MatrixType::LocalOrdinalType LocalOrdinalType; + typedef typename MatrixType::ComputeNodeType ComputeNodeType; + + ComputeNodeType& comp_node = A.compute_node; + + FusedMatvecDotOp mvdotop; + + mvdotop.n = A.rows.size(); + mvdotop.Arowoffsets = comp_node.get_buffer(&A.row_offsets[0], A.row_offsets.size()); + mvdotop.Acols = comp_node.get_buffer(&A.packed_cols[0], A.packed_cols.size()); + mvdotop.Acoefs = comp_node.get_buffer(&A.packed_coefs[0], A.packed_coefs.size()); + mvdotop.x = comp_node.get_buffer(&x.coefs[0], x.coefs.size()); + mvdotop.y = comp_node.get_buffer(&y.coefs[0], y.coefs.size()); + mvdotop.beta = 0; + + comp_node.parallel_reduce(mvdotop.n, mvdotop); + +#ifdef HAVE_MPI + magnitude local_dot = mvdotop.result, global_dot = 0; + MPI_Datatype mpi_dtype = TypeTraits::mpi_type(); + MPI_Allreduce(&local_dot, &global_dot, 1, mpi_dtype, MPI_SUM, MPI_COMM_WORLD); + return global_dot; +#else + return mvdotop.result; +#endif +} + +//------------------------------------------------------------------------ +//Compute matrix vector product y = A*x where: +// +// A - input matrix +// x - input vector +// y - result vector +// +template +struct matvec_std { +void operator()(MatrixType& A, + VectorType& x, + VectorType& y) +{ + exchange_externals(A, x); + + typedef typename MatrixType::ScalarType ScalarType; + typedef typename MatrixType::GlobalOrdinalType GlobalOrdinalType; + typedef typename MatrixType::LocalOrdinalType LocalOrdinalType; + typedef typename MatrixType::ComputeNodeType ComputeNodeType; + + ComputeNodeType& comp_node = A.compute_node; + + MatvecOp mvop(A); + + mvop.x = comp_node.get_buffer(&x.coefs[0], x.coefs.size()); + mvop.y = comp_node.get_buffer(&y.coefs[0], y.coefs.size()); + mvop.beta = 0; + + comp_node.parallel_for(mvop.n, mvop); +} +}; + +template +void matvec(MatrixType& A, VectorType& x, VectorType& y) +{ + matvec_std mv; + mv(A, x, y); +} + +template +struct matvec_overlap { +void operator()(MatrixType& A, + VectorType& x, + VectorType& y) +{ +#ifdef HAVE_MPI + begin_exchange_externals(A, x); +#endif + + typedef typename MatrixType::ScalarType ScalarType; + typedef typename MatrixType::GlobalOrdinalType GlobalOrdinalType; + typedef typename MatrixType::LocalOrdinalType LocalOrdinalType; + typedef typename MatrixType::ComputeNodeType ComputeNodeType; + + ComputeNodeType& comp_node = A.compute_node; + + MatvecOp mvop(A); + + mvop.x = comp_node.get_buffer(&x.coefs[0], x.coefs.size()); + mvop.y = comp_node.get_buffer(&y.coefs[0], y.coefs.size()); + mvop.beta = 0; + + comp_node.parallel_for(mvop.n, mvop); + +#ifdef HAVE_MPI + finish_exchange_externals(A.neighbors.size()); + + mvop.Arowoffsets = comp_node.get_buffer(&A.row_offsets_external[0], A.row_offsets_external.size()); + mvop.beta = 1; + + comp_node.parallel_for(A.rows.size(), mvop); +#endif +} +}; + +}//namespace miniFE + +#endif + diff --git a/tests/apps/miniFE/tests/basic/SumInLinSys.hpp b/tests/apps/miniFE/tests/basic/SumInLinSys.hpp new file mode 100644 index 0000000000..d5f6471d77 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/SumInLinSys.hpp @@ -0,0 +1,33 @@ +#ifndef _SUMINLINSYS_HPP_ +#define _SUMINLINSYS_HPP_ + +#include +#include +#include + +template +struct SumInLinSys { + GlobalOrdinal* node_ordinals; + Scalar* elem_diffusion_matrix; + Scalar* elem_source_vector; + miniFE::LockingMatrix* A; + miniFE::LockingVector* b; + +inline void operator()(int i) +{ + size_t nnodes = miniFE::Hex8::numNodesPerElem; + GlobalOrdinal* node_ords = node_ordinals+i*nnodes; + Scalar* diffusionMat = elem_diffusion_matrix+i*nnodes*nnodes; + Scalar* sourceVec = elem_source_vector+i*nnodes; + for(size_t ii=0; iisum_in(row, nnodes, node_ords, + &(diffusionMat[ii*nnodes])); + b->sum_in(1, &row, &(sourceVec[ii])); + } +} + +}; + +#endif diff --git a/tests/apps/miniFE/tests/basic/TBBNode.cpp b/tests/apps/miniFE/tests/basic/TBBNode.cpp new file mode 100644 index 0000000000..20078fd76a --- /dev/null +++ b/tests/apps/miniFE/tests/basic/TBBNode.cpp @@ -0,0 +1,8 @@ +#ifdef MINIFE_HAVE_TBB + +#include "TBBNode.hpp" + +tbb::task_scheduler_init TBBNode::tsi_(tbb::task_scheduler_init::deferred); + +#endif + diff --git a/tests/apps/miniFE/tests/basic/TBBNode.hpp b/tests/apps/miniFE/tests/basic/TBBNode.hpp new file mode 100644 index 0000000000..6b1fe8935d --- /dev/null +++ b/tests/apps/miniFE/tests/basic/TBBNode.hpp @@ -0,0 +1,76 @@ +#ifndef TBBNODE_HPP_ +#define TBBNODE_HPP_ + +#include +#include +#include +#include +#include + +#include + +#include // debug + +template +struct BlockedRangeWDP { + mutable WDPin wd; + BlockedRangeWDP(WDPin &in) : wd(in) {} + inline void operator()(tbb::blocked_range &rng) const + { + for(int i=rng.begin(); i +struct BlockedRangeWDPReducer { + WDPin wd; + BlockedRangeWDPReducer(WDPin &in) : wd(in) {} + BlockedRangeWDPReducer(BlockedRangeWDPReducer &in, tbb::split) : wd(in.wd) + { + wd.result = wd.identity(); + } + void operator()(tbb::blocked_range &rng) + { + for(int i=rng.begin(); i &other ) { + wd.result = wd.reduce( wd.result, other.wd.result ); + } +}; + +class TBBNode : public NoOpMemoryModel { + public: + + TBBNode(int numThreads=0) { + if (numThreads >= 1) { + tsi_.initialize(numThreads); + } + else { + tsi_.initialize(tbb::task_scheduler_init::automatic); + } + } + + ~TBBNode() {} + + template + void parallel_for(int length, WDP wd) { + BlockedRangeWDP tbb_wd(wd); + tbb::parallel_for(tbb::blocked_range(0,length), tbb_wd, tbb::auto_partitioner()); + } + + template + void parallel_reduce(int length, WDP &wd) { + BlockedRangeWDPReducer tbb_wd(wd); + tbb::parallel_reduce(tbb::blocked_range(0,length), tbb_wd, tbb::auto_partitioner()); + wd.result = tbb_wd.wd.result; // have to put result from final tbb_wd into orginal wd + } + + private: + static tbb::task_scheduler_init tsi_; +}; + +#endif diff --git a/tests/apps/miniFE/tests/basic/TPINode.hpp b/tests/apps/miniFE/tests/basic/TPINode.hpp new file mode 100644 index 0000000000..66ec84ff53 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/TPINode.hpp @@ -0,0 +1,113 @@ +#ifndef TPINODE_HPP_ +#define TPINODE_HPP_ + +#include + +#include + +#include // debug + +inline +void tpi_work_span(TPI_Work* work, int n, + size_t& ibeg, size_t& iend) +{ + const int chunk = ( n + work->count - 1 ) / work->count ; + + iend = chunk * ( work->rank + 1 ); + ibeg = chunk * ( work->rank ); + + if ( n < iend ) { iend = n; } +} + +template +void tpi_execute(TPI_Work * work) +{ + const WDP* const_wdp = static_cast(work->info); + WDP* wdp = const_cast(const_wdp); + size_t n = wdp->n; + size_t ibeg = 0, iend = n; + tpi_work_span(work, n, ibeg, iend); + for(size_t i=ibeg; i +void tpi_reduction_work(TPI_Work * work) +{ + const WDP* wdp = static_cast(work->info); + size_t n = wdp->n; + size_t ibeg = 0, iend = n; + tpi_work_span(work, n, ibeg, iend); + + typedef typename WDP::ReductionType ReductionType; + ReductionType tmpres = wdp->result, tmpi; + + for(size_t i=ibeg; igenerate(i); + tmpres = wdp->reduce(tmpres, tmpi); + } + *(static_cast(work->reduce)) = tmpres; +} + +template +void tpi_reduction_join(TPI_Work * work, const void* src) +{ + typedef typename WDP::ReductionType ReductionType; + + const WDP* wdp = static_cast(work->info); + + ReductionType& work_reduce = *(static_cast(work->reduce)); + + work_reduce = wdp->reduce(work_reduce, *(static_cast(src)) ); +} + +template +void tpi_reduction_init(TPI_Work * work) +{ + typedef typename WDP::ReductionType ReductionType; + + const WDP* wdp = static_cast(work->info); + + *(static_cast(work->reduce)) = wdp->identity(); +} + +class TPINode : public NoOpMemoryModel { + public: + + TPINode(int numThreads=0) + : numThreads_(numThreads) + { + if (numThreads >= 1) { + TPI_Init(numThreads); + } + } + + ~TPINode() + { + if (numThreads_ >= 1) { + TPI_Finalize(); + } + } + + template + void parallel_for(int length, WDP & wd ) { + TPI_Run_threads(tpi_execute, &wd, 0 ); + } + + template + void parallel_reduce(int length, WDP & wd ) { + typedef typename WDP::ReductionType ReductionType; + ReductionType result = 0; + TPI_Run_threads_reduce(tpi_reduction_work, &wd, + tpi_reduction_join, + tpi_reduction_init, sizeof(result), &result); + wd.result = result; + } + + private: + int numThreads_; +}; + +#endif + diff --git a/tests/apps/miniFE/tests/basic/TypeTraits.hpp b/tests/apps/miniFE/tests/basic/TypeTraits.hpp new file mode 100644 index 0000000000..3ac472c385 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/TypeTraits.hpp @@ -0,0 +1,137 @@ +#ifndef _TypeTraits_hpp_ +#define _TypeTraits_hpp_ + +//@HEADER +// ************************************************************************ +// +// miniFE: simple finite-element assembly and linear-solve +// Copyright (2006) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA +// Questions? Contact Michael A. Heroux (maherou@sandia.gov) +// +// ************************************************************************ +//@HEADER + +#include + +#ifdef HAVE_MPI +#include +#endif + +namespace miniFE { + +template struct TypeTraits {}; + +template<> +struct TypeTraits { + typedef float magnitude_type; + + static const char* name() {return "float";} + +#ifdef HAVE_MPI + static MPI_Datatype mpi_type() {return MPI_FLOAT;} +#endif +}; + +template<> +struct TypeTraits { + typedef double magnitude_type; + + static const char* name() {return "double";} + +#ifdef HAVE_MPI + static MPI_Datatype mpi_type() {return MPI_DOUBLE;} +#endif +}; + +template<> +struct TypeTraits { + typedef int magnitude_type; + + static const char* name() {return "int";} + +#ifdef HAVE_MPI + static MPI_Datatype mpi_type() {return MPI_INT;} +#endif +}; + +template<> +struct TypeTraits { + typedef long int magnitude_type; + + static const char* name() {return "long int";} + +#ifdef HAVE_MPI + static MPI_Datatype mpi_type() {return MPI_LONG;} +#endif +}; + +#ifndef MINIFE_NO_LONG_LONG + +template<> +struct TypeTraits { + typedef long long magnitude_type; + + static const char* name() {return "long long";} + +#ifdef HAVE_MPI + static MPI_Datatype mpi_type() {return MPI_LONG_LONG;} +#endif +}; + +#endif + +template<> +struct TypeTraits { + typedef unsigned magnitude_type; + + static const char* name() {return "unsigned";} + +#ifdef HAVE_MPI + static MPI_Datatype mpi_type() {return MPI_UNSIGNED;} +#endif +}; + +template<> +struct TypeTraits > { + typedef float magnitude_type; + + static const char* name() {return "std::complex";} + +#ifdef HAVE_MPI + static MPI_Datatype mpi_type() {return MPI_COMPLEX;} +#endif +}; + +template<> +struct TypeTraits > { + typedef double magnitude_type; + + static const char* name() {return "std::complex";} + +#ifdef HAVE_MPI + static MPI_Datatype mpi_type() {return MPI_DOUBLE_COMPLEX;} +#endif +}; + +}//namespace miniFE + +#endif + diff --git a/tests/apps/miniFE/tests/basic/Vector.hpp b/tests/apps/miniFE/tests/basic/Vector.hpp new file mode 100644 index 0000000000..4290ae45ee --- /dev/null +++ b/tests/apps/miniFE/tests/basic/Vector.hpp @@ -0,0 +1,83 @@ +#ifndef _Vector_hpp_ +#define _Vector_hpp_ + +//@HEADER +// ************************************************************************ +// +// miniFE: simple finite-element assembly and linear-solve +// Copyright (2006) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA +// Questions? Contact Michael A. Heroux (maherou@sandia.gov) +// +// ************************************************************************ +//@HEADER + +#include + +#include + +namespace miniFE { + + +template +struct Vector { + typedef ComputeNode ComputeNodeType; + typedef Scalar ScalarType; + typedef LocalOrdinal LocalOrdinalType; + typedef GlobalOrdinal GlobalOrdinalType; + + Vector(GlobalOrdinal startIdx, LocalOrdinal local_sz, ComputeNode& cn) + : startIndex(startIdx), + local_size(local_sz), + coefs(local_size), + compute_node(cn) + { + MemInitOp mem_init; + mem_init.ptr = &coefs[0]; + mem_init.n = local_size; +#ifdef MINIFE_HAVE_CUDA +//we don't want to run this mem-init kernel on cuda, we want +//to just run it locally on the host. + for(size_t i=0; i coefs; + ComputeNode& compute_node; +}; + + +}//namespace miniFE + +#endif + diff --git a/tests/apps/miniFE/tests/basic/Vector_functions.hpp b/tests/apps/miniFE/tests/basic/Vector_functions.hpp new file mode 100644 index 0000000000..f82866e328 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/Vector_functions.hpp @@ -0,0 +1,249 @@ +#ifndef _Vector_functions_hpp_ +#define _Vector_functions_hpp_ + +//@HEADER +// ************************************************************************ +// +// miniFE: simple finite-element assembly and linear-solve +// Copyright (2006) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA +// Questions? Contact Michael A. Heroux (maherou@sandia.gov) +// +// ************************************************************************ +//@HEADER + +#include +#include +#include + +#ifdef HAVE_MPI +#include +#endif + +#ifdef MINIFE_HAVE_TBB +#include +#endif + +#include +#include +#include +#include + + +namespace miniFE { + + +template +void write_vector(const std::string& filename, + const VectorType& vec) +{ + int numprocs = 1, myproc = 0; +#ifdef HAVE_MPI + MPI_Comm_size(MPI_COMM_WORLD, &numprocs); + MPI_Comm_rank(MPI_COMM_WORLD, &myproc); +#endif + + std::ostringstream osstr; + osstr << filename << "." << numprocs << "." << myproc; + std::string full_name = osstr.str(); + std::ofstream ofs(full_name.c_str()); + + typedef typename VectorType::ScalarType ScalarType; + + const std::vector& coefs = vec.coefs; + for(int p=0; p +void sum_into_vector(size_t num_indices, + const typename VectorType::GlobalOrdinalType* indices, + const typename VectorType::ScalarType* coefs, + VectorType& vec) +{ + typedef typename VectorType::GlobalOrdinalType GlobalOrdinal; + typedef typename VectorType::ScalarType Scalar; + + GlobalOrdinal first = vec.startIndex; + GlobalOrdinal last = first + vec.local_size - 1; + + std::vector& vec_coefs = vec.coefs; + + for(size_t i=0; i last) continue; + size_t idx = indices[i] - first; + vec_coefs[idx] += coefs[i]; + } +} + +#ifdef MINIFE_HAVE_TBB +template +void sum_into_vector(size_t num_indices, + const typename VectorType::GlobalOrdinalType* indices, + const typename VectorType::ScalarType* coefs, + LockingVector& vec) +{ + vec.sum_in(num_indices, indices, coefs); +} +#endif + +//------------------------------------------------------------ +//Compute the update of a vector with the sum of two scaled vectors where: +// +// w = alpha*x + beta*y +// +// x,y - input vectors +// +// alpha,beta - scalars applied to x and y respectively +// +// w - output vector +// +template +void + waxpby(typename VectorType::ScalarType alpha, const VectorType& x, + typename VectorType::ScalarType beta, const VectorType& y, + VectorType& w) +{ + typedef typename VectorType::ScalarType ScalarType; + typedef typename VectorType::ComputeNodeType ComputeNodeType; + + ComputeNodeType& compute_node = x.compute_node; + + WaxpbyOp waxpbyop; + + waxpbyop.w = compute_node.get_buffer(&w.coefs[0], w.coefs.size()); + waxpbyop.x = compute_node.get_buffer(&x.coefs[0], x.coefs.size()); + waxpbyop.y = compute_node.get_buffer(&y.coefs[0], y.coefs.size()); + waxpbyop.alpha = alpha; + waxpbyop.beta = beta; + waxpbyop.n = x.local_size; + +#ifdef MINIFE_DEBUG + if (y.local_size < x.local_size || w.local_size < x.local_size) { + std::cerr << "miniFE::waxpby ERROR, y and w must be at least as long as x." << std::endl; + return; + } +#endif + + compute_node.parallel_for(waxpbyop.n, waxpbyop); +} + +//Like waxpby above, except operates on two sets of arguments. +//In other words, performs two waxpby operations in one loop. +template +void + fused_waxpby(typename VectorType::ScalarType alpha, const VectorType& x, + typename VectorType::ScalarType beta, const VectorType& y, + VectorType& w, + typename VectorType::ScalarType alpha2, const VectorType& x2, + typename VectorType::ScalarType beta2, const VectorType& y2, + VectorType& w2) +{ + typedef typename VectorType::ScalarType ScalarType; + typedef typename VectorType::ComputeNodeType ComputeNodeType; + + ComputeNodeType& compute_node = x.compute_node; + + FusedWaxpbyOp waxpbyop; + + waxpbyop.w = compute_node.get_buffer(&w.coefs[0], w.coefs.size()); + waxpbyop.x = compute_node.get_buffer(&x.coefs[0], x.coefs.size()); + waxpbyop.y = compute_node.get_buffer(&y.coefs[0], y.coefs.size()); + waxpbyop.alpha = alpha; + waxpbyop.beta = beta; + waxpbyop.w2 = compute_node.get_buffer(&w2.coefs[0], w2.coefs.size()); + waxpbyop.x2 = compute_node.get_buffer(&x2.coefs[0], x2.coefs.size()); + waxpbyop.y2 = compute_node.get_buffer(&y2.coefs[0], y2.coefs.size()); + waxpbyop.alpha2 = alpha2; + waxpbyop.beta2 = beta2; + waxpbyop.n = x.local_size; + +#ifdef MINIFE_DEBUG + if (y.local_size < x.local_size || w.local_size < x.local_size) { + std::cerr << "miniFE::waxpby ERROR, y and w must be at least as long as x." << std::endl; + return; + } +#endif + + compute_node.parallel_for(waxpbyop.n, waxpbyop); +} + +//----------------------------------------------------------- +//Compute the dot product of two vectors where: +// +// x,y - input vectors +// +// result - return-value +// +template +typename TypeTraits::magnitude_type + dot(const Vector& x, + const Vector& y) +{ + size_t n = x.local_size; + +#ifdef MINIFE_DEBUG + if (y.local_size < n) { + std::cerr << "miniFE::dot ERROR, y must be at least as long as x."<::magnitude_type magnitude; + + typedef typename Vector::ComputeNodeType ComputeNodeType; + + ComputeNodeType& compute_node = x.compute_node; + + DotOp dotop; + dotop.x = compute_node.get_buffer(&x.coefs[0], x.coefs.size()); + dotop.y = compute_node.get_buffer(&y.coefs[0], y.coefs.size()); + dotop.n = x.local_size; + + compute_node.parallel_reduce(n, dotop); + +#ifdef HAVE_MPI + magnitude local_dot = dotop.result, global_dot = 0; + MPI_Datatype mpi_dtype = TypeTraits::mpi_type(); + MPI_Allreduce(&local_dot, &global_dot, 1, mpi_dtype, MPI_SUM, MPI_COMM_WORLD); + return global_dot; +#else + return dotop.result; +#endif +} + +}//namespace miniFE + +#endif + diff --git a/tests/apps/miniFE/tests/basic/WaxpbyOp.hpp b/tests/apps/miniFE/tests/basic/WaxpbyOp.hpp new file mode 100644 index 0000000000..6eaaa6ea25 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/WaxpbyOp.hpp @@ -0,0 +1,43 @@ +#ifndef WAXPBYOP_HPP_ +#define WAXPBYOP_HPP_ + +#ifndef KERNEL_PREFIX +#define KERNEL_PREFIX +#endif + +template +struct WaxpbyOp { + Scalar* w; + const Scalar* x; + const Scalar* y; + Scalar alpha, beta; + size_t n; + KERNEL_PREFIX void operator()(size_t i) const + { + //here we count on the caller (ComputeNode) to pass in 'i' + //that is in the range 0..n-1 + w[i] = alpha*x[i] + beta*y[i]; + } +}; + +template +struct FusedWaxpbyOp { + Scalar* w; + const Scalar* x; + const Scalar* y; + Scalar alpha, beta; + Scalar* w2; + const Scalar* x2; + const Scalar* y2; + Scalar alpha2, beta2; + size_t n; + KERNEL_PREFIX void operator()(size_t i) const + { + //here we count on the caller (ComputeNode) to pass in 'i' + //that is in the range 0..n-1 + w[i] = alpha*x[i] + beta*y[i]; + w2[i] = alpha2*x2[i] + beta2*y2[i]; + } +}; + +#endif diff --git a/tests/apps/miniFE/tests/basic/analytic_soln.hpp b/tests/apps/miniFE/tests/basic/analytic_soln.hpp new file mode 100644 index 0000000000..8dcdfade40 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/analytic_soln.hpp @@ -0,0 +1,117 @@ +#ifndef _analytic_soln_hpp_ +#define _analytic_soln_hpp_ + +//@HEADER +// ************************************************************************ +// +// miniFE: simple finite-element assembly and linear-solve +// Copyright (2006) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA +// Questions? Contact Michael A. Heroux (maherou@sandia.gov) +// +// ************************************************************************ +//@HEADER + +#include + +#ifndef MINIFE_SCALAR +#define MINIFE_SCALAR double; +#endif + +namespace miniFE { + +typedef MINIFE_SCALAR Scalar; + +// The 'soln' function below computes the analytic solution for +// steady state temperature in a brick-shaped domain (formally called +// a rectangular parallelepiped). The inputs to the function are +// the x,y,z coordinates of the point at which temperature is to be +// computed, and the number of terms p,q in the series expansion. +// +// The equations used for the temperature solution are equations 9 and 10 +// in section 6.2 of Carslaw & Jaeger, "Conduction of Heat in Solids". +// +// The paralellepiped being used is defined by this domain: +// 0 <= x <= 1.0 +// 0 <= y <= 1.0 +// 0 <= z <= 1.0 +// +// With boundary conditions prescribing the temperature to be 1.0 on +// the x==1.0 face, and 0.0 on all other faces. +// +// Thus, in the equations from Carslaw & Jaeger, the following constants +// are used: +// +// a == b == c == 1.0 (the extents of the domain) +// v1 == 0.0 (temperature at x == 0.0) +// v2 == 1.0 (temperature at x == 1.0) +// + +const Scalar PI = 3.141592653589793238462; +const Scalar PI_SQR = PI*PI; +const Scalar term0 = 16.0/(PI_SQR); + +inline Scalar fcn_l(int p, int q) +{ + return std::sqrt((2*p+1)*(2*p+1)*PI_SQR + (2*q+1)*(2*q+1)*PI_SQR); +} + +inline Scalar fcn(int n, Scalar u) +{ + return (2*n+1)*PI*u; +} + +inline Scalar soln(Scalar x, Scalar y, Scalar z, int max_p, int max_q) +{ + Scalar sum = 0; + for(int p=0; p<=max_p; ++p) { + const Scalar p21y = fcn(p, y); + const Scalar sin_py = std::sin(p21y)/(2*p+1); + for(int q=0; q<=max_q; ++q) { + const Scalar q21z = fcn(q, z); + const Scalar sin_qz = std::sin(q21z)/(2*q+1); + + const Scalar l = fcn_l(p, q); + + const Scalar sinh1 = std::sinh(l*x); + const Scalar sinh2 = std::sinh(l); + + const Scalar tmp = (sinh1*sin_py)*(sin_qz/sinh2); + + //if the scalar l gets too big, sinh(l) becomes inf. + //if that happens, tmp is a NaN. + //crude check for NaN: + //if tmp != tmp, tmp is NaN + if (tmp == tmp) { + sum += tmp; + } + else { + //if we got a NaN, break out of this inner loop and go to + //the next iteration of the outer loop. + break; + } + } + } + return term0*sum; +} + +}//namespace miniFE + +#endif /* _analytic_soln_hpp_ */ diff --git a/tests/apps/miniFE/tests/basic/assemble_FE_data.hpp b/tests/apps/miniFE/tests/basic/assemble_FE_data.hpp new file mode 100644 index 0000000000..f34b14a08b --- /dev/null +++ b/tests/apps/miniFE/tests/basic/assemble_FE_data.hpp @@ -0,0 +1,85 @@ +#ifndef _assemble_FE_data_hpp_ +#define _assemble_FE_data_hpp_ + +//@HEADER +// ************************************************************************ +// +// miniFE: simple finite-element assembly and linear-solve +// Copyright (2006) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA +// Questions? Contact Michael A. Heroux (maherou@sandia.gov) +// +// ************************************************************************ +//@HEADER + +#include +#include + +#ifdef MINIFE_HAVE_TBB +//#include +#include +//#include +#else +#include +#endif + +namespace miniFE { + +template +void +assemble_FE_data(const simple_mesh_description& mesh, + MatrixType& A, + VectorType& b, + Parameters& params) +{ + typedef typename MatrixType::GlobalOrdinalType GlobalOrdinal; + + int global_elems_x = mesh.global_box[0][1]; + int global_elems_y = mesh.global_box[1][1]; + int global_elems_z = mesh.global_box[2][1]; + + Box local_elem_box; + copy_box(mesh.local_box, local_elem_box); + + if (get_num_ids(local_elem_box) < 1) { + return; + } + + // + //We want the element-loop to loop over our (processor-local) domain plus a + //ghost layer, so we can assemble the complete linear-system without doing + //any communication. + // + int ghost = 1; + if (local_elem_box[0][0] > 0) local_elem_box[0][0] -= ghost; + if (local_elem_box[1][0] > 0) local_elem_box[1][0] -= ghost; + if (local_elem_box[2][0] > 0) local_elem_box[2][0] -= ghost; + if (local_elem_box[0][1] < global_elems_x) local_elem_box[0][1] += ghost; + if (local_elem_box[1][1] < global_elems_y) local_elem_box[1][1] += ghost; + if (local_elem_box[2][1] < global_elems_z) local_elem_box[2][1] += ghost; + + perform_element_loop(mesh, local_elem_box, A, b, params); +} + +}//namespace miniFE + +#endif + diff --git a/tests/apps/miniFE/tests/basic/box_utils.hpp b/tests/apps/miniFE/tests/basic/box_utils.hpp new file mode 100644 index 0000000000..ee109753b0 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/box_utils.hpp @@ -0,0 +1,199 @@ +#ifndef _box_utils_hpp_ +#define _box_utils_hpp_ + +//@HEADER +// ************************************************************************ +// +// miniFE: simple finite-element assembly and linear-solve +// Copyright (2006) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA +// Questions? Contact Michael A. Heroux (maherou@sandia.gov) +// +// ************************************************************************ +//@HEADER + +#include +#include + +#ifdef HAVE_MPI +#include +#endif + +#include +#include + +namespace miniFE { + +inline void copy_box(const Box& from_box, Box& to_box) +{ + for(int i=0; i<3; ++i) { + to_box[i][0] = from_box[i][0]; + to_box[i][1] = from_box[i][1]; + } +} + +template +void get_int_coords(GlobalOrdinal ID, int nx, int ny, int nz, + int& x, int& y, int& z) +{ + z = ID/(nx*ny); + y = (ID%(nx*ny))/nx; + x = ID%nx; +} + +template +void get_coords(GlobalOrdinal ID, int nx, int ny, int nz, + Scalar& x, Scalar& y, Scalar& z) +{ + const int xdiv = nx>1 ? nx-1 : 1; + const int ydiv = ny>1 ? ny-1 : 1; + const int zdiv = nz>1 ? nz-1 : 1; + +//This code assumes that ID is 0-based. +// +//compute coordinates that lie on (or in) the unit cube. +//that's why we're dividing by nz,ny,nx: + z = (1.0*(ID/(nx*ny)))/zdiv; + y = 1.0*((ID%(nx*ny))/nx)/ydiv; + x = 1.0*(ID%nx)/xdiv; +} + +template +GlobalOrdinal get_num_ids(const Box& box) +{ + int nx = box[0][1] - box[0][0]; + int ny = box[1][1] - box[1][0]; + int nz = box[2][1] - box[2][0]; + GlobalOrdinal tmp = nx*ny; + tmp *= nz; + return tmp; +} + +template +GlobalOrdinal get_id(int nx, int ny, int nz, + int x, int y, int z) +{ + if (x<0 || y<0 || z<0) return -1; + if (x>=nx || y>=ny || z>=nz) return -1; + + //form x + nx*y + nx*ny*z: + + GlobalOrdinal tmp = nx*ny; + tmp *= z; + tmp = x + nx * y + tmp; + return tmp; +} + +template +void get_ids(int nx, int ny, int nz, + const Box& box, + GlobalOrdinal* ids) +{ + unsigned offset = 0; + for(int z=box[2][0]; z(nx, ny, nz, x, y, z); + } + } + } +} + +template +void create_map_id_to_row(int global_nx, int global_ny, int global_nz, + const Box& box, + std::map& id_to_row) +{ + GlobalOrdinal num_my_ids = get_num_ids(box); + GlobalOrdinal my_first_row = 0; + +#ifdef HAVE_MPI + int numprocs = 1, myproc = 0; + MPI_Comm_size(MPI_COMM_WORLD, &numprocs); + MPI_Comm_rank(MPI_COMM_WORLD, &myproc); + + typename std::vector tmp_buffer(numprocs, 0); + tmp_buffer[myproc] = num_my_ids; + typename std::vector global_offsets(numprocs); + MPI_Datatype mpi_dtype = TypeTraits::mpi_type(); + MPI_Allreduce(&tmp_buffer[0], &global_offsets[0], numprocs, mpi_dtype, + MPI_SUM, MPI_COMM_WORLD); + GlobalOrdinal offset = 0; + for(int i=0; i all_my_ids(num_my_ids); + get_ids(global_nx, global_ny, global_nz, box, &all_my_ids[0]); + + typename std::vector ids; + typename std::vector rows; + + if (all_my_ids.size() > 0) { + ids.push_back(all_my_ids[0]); + rows.push_back(my_first_row); + } + + for(size_t i=1; i lengths(numprocs); + MPI_Allgather(&len, 1, MPI_INT, &lengths[0], 1, MPI_INT, MPI_COMM_WORLD); + + std::vector displs(lengths); + int displ = 0; + for(int i=0; i global_ids(displ); + typename std::vector global_rows(displ); + + MPI_Allgatherv(&ids[0], len, mpi_dtype, &global_ids[0], + &lengths[0], &displs[0], mpi_dtype, MPI_COMM_WORLD); + MPI_Allgatherv(&rows[0], len, mpi_dtype, &global_rows[0], + &lengths[0], &displs[0], mpi_dtype, MPI_COMM_WORLD); + + ids = global_ids; + rows = global_rows; +#endif + + for(size_t i=0; i +#include + +#include +#include + +#include + +namespace miniFE { + +template +void print_vec(const std::vector& vec, const std::string& name) +{ + for(size_t i=0; i +bool breakdown(typename VectorType::ScalarType inner, + const VectorType& v, + const VectorType& w) +{ + typedef typename VectorType::ScalarType Scalar; + typedef typename TypeTraits::magnitude_type magnitude; + +//This is code that was copied from Aztec, and originally written +//by my hero, Ray Tuminaro. +// +//Assuming that inner = (inner product of v and w), +//v and w are considered orthogonal if +// |inner| < 100 * ||v||_2 * ||w||_2 * epsilon + + magnitude vnorm = std::sqrt(dot(v,v)); + magnitude wnorm = std::sqrt(dot(w,w)); + return std::abs(inner) <= 100*vnorm*wnorm*std::numeric_limits::epsilon(); +} + +template +void +cg_solve(OperatorType& A, + const VectorType& b, + VectorType& x, + Matvec matvec, + typename OperatorType::LocalOrdinalType max_iter, + typename TypeTraits::magnitude_type& tolerance, + typename OperatorType::LocalOrdinalType& num_iters, + typename TypeTraits::magnitude_type& normr, + timer_type* my_cg_times) +{ + typedef typename OperatorType::ScalarType ScalarType; + typedef typename OperatorType::GlobalOrdinalType GlobalOrdinalType; + typedef typename OperatorType::LocalOrdinalType LocalOrdinalType; + typedef typename TypeTraits::magnitude_type magnitude_type; + + timer_type t0 = 0, tWAXPY = 0, tDOT = 0, tMATVEC = 0, tMATVECDOT = 0; + timer_type total_time = mytimer(); + + int myproc = 0; +#ifdef HAVE_MPI + MPI_Comm_rank(MPI_COMM_WORLD, &myproc); +#endif + + if (!A.has_local_indices) { + std::cerr << "miniFE::cg_solve ERROR, A.has_local_indices is false, needs to be true. This probably means " + << "miniFE::make_local_matrix(A) was not called prior to calling miniFE::cg_solve." + << std::endl; + return; + } + + size_t nrows = A.rows.size(); + LocalOrdinalType ncols = A.num_cols; + + VectorType r(b.startIndex, nrows, b.compute_node); + VectorType p(0, ncols, b.compute_node); + VectorType Ap(b.startIndex, nrows, b.compute_node); + + normr = 0; + magnitude_type rtrans = 0; + magnitude_type oldrtrans = 0; + + LocalOrdinalType print_freq = max_iter/10; + if (print_freq>50) print_freq = 50; + if (print_freq<1) print_freq = 1; + + ScalarType one = 1.0; + ScalarType zero = 0.0; + + typedef typename VectorType::ComputeNodeType ComputeNodeType; + ComputeNodeType& compute_node = x.compute_node; + + //The following lines that create and initialize buffers are no-ops in many + //cases, but perform actual allocations and copies if an off-cpu device such + //as a GPU is being used by compute_node. + + //Do any required allocations for buffers that will be needed during CG: + ScalarType* d_x = compute_node.get_buffer(&x.coefs[0], x.coefs.size()); + ScalarType* d_p = compute_node.get_buffer(&p.coefs[0], p.coefs.size()); + ScalarType* d_b = compute_node.get_buffer(&b.coefs[0], b.coefs.size()); + ScalarType* d_Ap = compute_node.get_buffer(&Ap.coefs[0], Ap.coefs.size()); + ScalarType* d_r = compute_node.get_buffer(&r.coefs[0], r.coefs.size()); +#ifdef MINIFE_CSR_MATRIX + LocalOrdinalType* d_Arowoff = compute_node.get_buffer(&A.row_offsets[0], A.row_offsets.size()); + GlobalOrdinalType* d_Acols = compute_node.get_buffer(&A.packed_cols[0], A.packed_cols.size()); + ScalarType* d_Acoefs = compute_node.get_buffer(&A.packed_coefs[0], A.packed_coefs.size()); +#endif +#ifdef MINIFE_ELL_MATRIX + GlobalOrdinalType* d_Acols = compute_node.get_buffer(&A.cols[0], A.cols.size()); + ScalarType* d_Acoefs = compute_node.get_buffer(&A.coefs[0], A.coefs.size()); +#endif + + //Copy data to buffers that need to be initialized from input data: + compute_node.copy_to_buffer(&x.coefs[0], x.coefs.size(), d_x); + compute_node.copy_to_buffer(&b.coefs[0], b.coefs.size(), d_b); +#ifdef MINIFE_CSR_MATRIX + compute_node.copy_to_buffer(&A.row_offsets[0], A.row_offsets.size(), d_Arowoff); + compute_node.copy_to_buffer(&A.packed_cols[0], A.packed_cols.size(), d_Acols); + compute_node.copy_to_buffer(&A.packed_coefs[0], A.packed_coefs.size(), d_Acoefs); +#endif +#ifdef MINIFE_ELL_MATRIX + compute_node.copy_to_buffer(&A.cols[0], A.cols.size(), d_Acols); + compute_node.copy_to_buffer(&A.coefs[0], A.coefs.size(), d_Acoefs); +#endif + + TICK(); waxpby(one, x, zero, x, p); TOCK(tWAXPY); + + compute_node.copy_from_buffer(&p.coefs[0], p.coefs.size(), d_p); +// print_vec(p.coefs, "p"); + + TICK(); + matvec(A, p, Ap); + TOCK(tMATVEC); + + TICK(); waxpby(one, b, -one, Ap, r); TOCK(tWAXPY); + +// if (b.coefs.size() == r.coefs.size()) std::cout << "b.size == r.size" << std::endl; +// else std::cout << "b.size != r.size" << std::endl; +// if (b.coefs == r.coefs) std::cout << "b == r" << std::endl; +// else std::cout << "b != r" << std::endl; +// compute_node.copy_from_buffer(&r.coefs[0], r.coefs.size(), d_r); +// print_vec(b.coefs, "b"); +// print_vec(r.coefs, "r"); + + TICK(); rtrans = dot(r, r); TOCK(tDOT); + +//std::cout << "rtrans="<add("Global Nrows",global_nrows); + ydoc.get("Matrix attributes")->add("Global NNZ",global_nnz); + + //compute how much memory the matrix occupies: + //num-bytes = sizeof(GlobalOrdinal)*global_nrows for A.rows + // + sizeof(LocalOrdinal)*global_nrows for A.rows_offsets + // + sizeof(GlobalOrdinal)*global_nnz for A.packed_cols + // + sizeof(Scalar)*global_nnz for A.packed_coefs + + double invGB = 1.0/(1024*1024*1024); + double memGB = invGB*global_nrows*sizeof(GlobalOrdinal); + memGB += invGB*global_nrows*sizeof(LocalOrdinal); + memGB += invGB*global_nnz*sizeof(GlobalOrdinal); + memGB += invGB*global_nnz*sizeof(Scalar); + ydoc.get("Matrix attributes")->add("Global Memory (GB)",memGB); + + ydoc.get("Matrix attributes")->add("Pll Memory Overhead (MB)",mem_overhead_MB); + + ydoc.get("Matrix attributes")->add("Rows per proc MIN",min_nrows); + ydoc.get("Matrix attributes")->add("Rows per proc MAX",max_nrows); + ydoc.get("Matrix attributes")->add("Rows per proc AVG",avg_nrows); + ydoc.get("Matrix attributes")->add("NNZ per proc MIN",min_nnz); + ydoc.get("Matrix attributes")->add("NNZ per proc MAX",max_nnz); + ydoc.get("Matrix attributes")->add("NNZ per proc AVG",avg_nnz); + } + + return global_nnz; +} + +}//namespace miniFE + +#endif + diff --git a/tests/apps/miniFE/tests/basic/driver.hpp b/tests/apps/miniFE/tests/basic/driver.hpp new file mode 100644 index 0000000000..d3966ebf40 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/driver.hpp @@ -0,0 +1,403 @@ +#ifndef _driver_hpp_ +#define _driver_hpp_ + +//@HEADER +// ************************************************************************ +// +// miniFE: simple finite-element assembly and linear-solve +// Copyright (2006) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA +// Questions? Contact Michael A. Heroux (maherou@sandia.gov) +// +// ************************************************************************ +//@HEADER + +#include +#include +#include +#include +#include +#include + +#include +#include + +#ifdef MINIFE_CSR_MATRIX +#include +#elif defined(MINIFE_ELL_MATRIX) +#include +#else +#include +#endif + +#include + +#include + +#include +#include + +#include + +#include +#include +#include +#include +#if MINIFE_KERNELS != 0 +#include +#endif +#include +#include +#include +#include + +#ifdef HAVE_MPI +#include +#endif + +#define RUN_TIMED_FUNCTION(msg, fn, time_inc, time_total) \ +{ \ + if (myproc==0) { \ + std::cout.width(30); \ + std::cout << msg; \ + std::cout.flush(); \ + } \ + timer_type rtf_t0 = mytimer(); \ + fn; \ + time_inc = mytimer() - rtf_t0; \ + time_total += time_inc; \ + if (myproc==0) { \ + std::cout << time_inc << "s, total time: " << time_total << std::endl; \ + } \ +} + +//This program assembles finite-element matrices into a global matrix and +//vector, then solves the linear-system using Conjugate Gradients. +//Each finite-element is a hexahedron with 8 vertex-nodes. +// +//Notes: +//- In finite-element terms, the box dimensions are in elements, not nodes. +// In other words, a 2x2x2 box describes 8 elements, each of which has 8 nodes, +// so it is a 3x3x3 node domain (27 nodes). +// The assembled linear system will have 1 equation for each finite element node. +// +//- The coordinate origin is at the corner of the global box where x=0, +// y=0, z=0, and the box extends along the positive x-axis, positive y-axis, +// and the positive z-axis. +// +//- Some aspects of matrix-structure generation and finite-element assembly +// are convenient to do using global node identifiers. +// A global identifier for each node is obtained from coordinates plus +// global box dimensions. See the function 'get_id' in box_utils.hpp. +// +//- Each node corresponds to a row in the matrix. The RCB partitioning method +// we use to split the global box among processors results in some +// processors owning non-contiguous blocks of global node identifiers. +// Since it is convenient for matrices and vectors to store contiguously- +// numbered blocks of rows, we map global node identifiers to a separate +// space of row numbers such that each processor's nodes correspond to a +// contiguous block of row numbers. +// + +namespace miniFE { + +template +void +driver(const Box& global_box, Box& my_box, ComputeNodeType& compute_node, + Parameters& params, YAML_Doc& ydoc) +{ + int global_nx = global_box[0][1]; + int global_ny = global_box[1][1]; + int global_nz = global_box[2][1]; + + int numprocs = 1, myproc = 0; +#ifdef HAVE_MPI + MPI_Comm_size(MPI_COMM_WORLD, &numprocs); + MPI_Comm_rank(MPI_COMM_WORLD, &myproc); +#endif + + if (params.load_imbalance > 0) { + add_imbalance(global_box, my_box, params.load_imbalance, ydoc); + } + + float largest_imbalance = 0, std_dev = 0; + compute_imbalance(global_box, my_box, largest_imbalance, + std_dev, ydoc, true); + + + //Create a representation of the mesh: + //Note that 'simple_mesh_description' is a virtual or conceptual + //mesh that doesn't actually store mesh data. + + if (myproc==0) { + std::cout.width(30); + std::cout << "creating/filling mesh..."; + std::cout.flush(); + } + + timer_type t_start = mytimer(); + timer_type t0 = mytimer(); + + simple_mesh_description mesh(global_box, my_box); + + timer_type mesh_fill = mytimer() - t0; + timer_type t_total = mytimer() - t_start; + + if (myproc==0) { + std::cout << mesh_fill << "s, total time: " << t_total << std::endl; + } + + //next we will generate the matrix structure. + + //Declare matrix object: + +#ifdef MINIFE_CSR_MATRIX + typedef CSRMatrix MatrixType; +#elif defined(MINIFE_ELL_MATRIX) + typedef ELLMatrix MatrixType; +#else + typedef CSRMatrix MatrixType; +#endif + + MatrixType A(compute_node); + + timer_type gen_structure; + RUN_TIMED_FUNCTION("generating matrix structure...", + generate_matrix_structure(mesh, A), + gen_structure, t_total); + + GlobalOrdinal local_nrows = A.rows.size(); + GlobalOrdinal my_first_row = local_nrows > 0 ? A.rows[0] : -1; + + Vector b(my_first_row, local_nrows,compute_node); + Vector x(my_first_row, local_nrows,compute_node); + + //Assemble finite-element sub-matrices and sub-vectors into the global + //linear system: + + timer_type fe_assembly; + RUN_TIMED_FUNCTION("assembling FE data...", + assemble_FE_data(mesh, A, b, params), + fe_assembly, t_total); + + if (myproc == 0) { + ydoc.add("Matrix structure generation",""); + ydoc.get("Matrix structure generation")->add("Mat-struc-gen Time",gen_structure); + ydoc.add("FE assembly",""); + ydoc.get("FE assembly")->add("FE assembly Time",fe_assembly); + } + +#ifdef MINIFE_DEBUG + write_matrix("A_prebc.mtx", A); + write_vector("b_prebc.vec", b); +#endif + + //Now apply dirichlet boundary-conditions + //(Apply the 0-valued surfaces first, then the 1-valued surface last.) + + timer_type dirbc_time; + RUN_TIMED_FUNCTION("imposing Dirichlet BC...", + impose_dirichlet(0.0, A, b, global_nx+1, global_ny+1, global_nz+1, mesh.bc_rows_0), dirbc_time, t_total); + RUN_TIMED_FUNCTION("imposing Dirichlet BC...", + impose_dirichlet(1.0, A, b, global_nx+1, global_ny+1, global_nz+1, mesh.bc_rows_1), dirbc_time, t_total); + +#ifdef MINIFE_DEBUG + write_matrix("A.mtx", A); + write_vector("b.vec", b); +#endif + + //Transform global indices to local, set up communication information: + + timer_type make_local_time; + RUN_TIMED_FUNCTION("making matrix indices local...", + make_local_matrix(A), + make_local_time, t_total); + +#ifdef MINIFE_DEBUG + write_matrix("A_local.mtx", A); + write_vector("b_local.vec", b); +#endif + + size_t global_nnz = compute_matrix_stats(A, myproc, numprocs, ydoc); + + //Prepare to perform conjugate gradient solve: + + LocalOrdinal max_iters = 50; + LocalOrdinal num_iters = 0; + typedef typename TypeTraits::magnitude_type magnitude; + magnitude rnorm = 0; + magnitude tol = std::numeric_limits::epsilon(); + + timer_type cg_times[NUM_TIMERS]; + + typedef Vector VectorType; + + t_total = mytimer() - t_start; + + bool matvec_with_comm_overlap = params.mv_overlap_comm_comp==1; + +#if MINIFE_KERNELS != 0 + if (myproc==0) { + std::cout.width(30); + std::cout << "Starting kernel timing loops ..." << std::endl; + } + + max_iters = 500; + x.coefs[0] = 0.9; + if (matvec_with_comm_overlap) { + time_kernels(A, b, x, matvec_overlap(), max_iters, rnorm, cg_times); + } + else { + time_kernels(A, b, x, matvec_std(), max_iters, rnorm, cg_times); + } + num_iters = max_iters; + std::string title("Kernel timings"); +#else + if (myproc==0) { + std::cout << "Starting CG solver ... " << std::endl; + } + + if (matvec_with_comm_overlap) { +#ifdef MINIFE_CSR_MATRIX + rearrange_matrix_local_external(A); + cg_solve(A, b, x, matvec_overlap(), max_iters, tol, + num_iters, rnorm, cg_times); +#else + std::cout << "ERROR, matvec with overlapping comm/comp only works with CSR matrix."<(), max_iters, tol, + num_iters, rnorm, cg_times); + if (myproc == 0) { + std::cout << "Final Resid Norm: " << rnorm << std::endl; + } + +#ifdef MINIFE_DEBUG + if (myproc == 0) { + std::cout << "verifying solution..." << std::endl; + } + verify_solution(mesh, x); +#endif + } + +#ifdef MINIFE_DEBUG + write_vector("x.vec", x); +#endif + std::string title("CG solve"); +#endif + + if (myproc == 0) { + ydoc.get("Global Run Parameters")->add("ScalarType",TypeTraits::name()); + ydoc.get("Global Run Parameters")->add("GlobalOrdinalType",TypeTraits::name()); + ydoc.get("Global Run Parameters")->add("LocalOrdinalType",TypeTraits::name()); + ydoc.add(title,""); + ydoc.get(title)->add("Iterations",num_iters); + ydoc.get(title)->add("Final Resid Norm",rnorm); + + GlobalOrdinal global_nrows = global_nx; + global_nrows *= global_ny*global_nz; + + //flops-per-mv, flops-per-dot, flops-per-waxpy: + double mv_flops = global_nnz*2.0; + double dot_flops = global_nrows*2.0; + double waxpy_flops = global_nrows*3.0; + +#if MINIFE_KERNELS == 0 +//if MINIFE_KERNELS == 0 then we did a CG solve, and in that case +//there were num_iters+1 matvecs, num_iters*2 dots, and num_iters*3+2 waxpys. + mv_flops *= (num_iters+1); + dot_flops *= (2*num_iters); + waxpy_flops *= (3*num_iters+2); +#else +//if MINIFE_KERNELS then we did one of each operation per iteration. + mv_flops *= num_iters; + dot_flops *= num_iters; + waxpy_flops *= num_iters; +#endif + + double total_flops = mv_flops + dot_flops + waxpy_flops; + + double mv_mflops = -1; + if (cg_times[MATVEC] > 1.e-4) + mv_mflops = 1.e-6 * (mv_flops/cg_times[MATVEC]); + + double dot_mflops = -1; + if (cg_times[DOT] > 1.e-4) + dot_mflops = 1.e-6 * (dot_flops/cg_times[DOT]); + + double waxpy_mflops = -1; + if (cg_times[WAXPY] > 1.e-4) + waxpy_mflops = 1.e-6 * (waxpy_flops/cg_times[WAXPY]); + + double total_mflops = -1; + if (cg_times[TOTAL] > 1.e-4) + total_mflops = 1.e-6 * (total_flops/cg_times[TOTAL]); + + ydoc.get(title)->add("WAXPY Time",cg_times[WAXPY]); + ydoc.get(title)->add("WAXPY Flops",waxpy_flops); + if (waxpy_mflops >= 0) + ydoc.get(title)->add("WAXPY Mflops",waxpy_mflops); + else + ydoc.get(title)->add("WAXPY Mflops","inf"); + + ydoc.get(title)->add("DOT Time",cg_times[DOT]); + ydoc.get(title)->add("DOT Flops",dot_flops); + if (dot_mflops >= 0) + ydoc.get(title)->add("DOT Mflops",dot_mflops); + else + ydoc.get(title)->add("DOT Mflops","inf"); + + ydoc.get(title)->add("MATVEC Time",cg_times[MATVEC]); + ydoc.get(title)->add("MATVEC Flops",mv_flops); + if (mv_mflops >= 0) + ydoc.get(title)->add("MATVEC Mflops",mv_mflops); + else + ydoc.get(title)->add("MATVEC Mflops","inf"); + +#ifdef MINIFE_FUSED + ydoc.get(title)->add("MATVECDOT Time",cg_times[MATVECDOT]); + ydoc.get(title)->add("MATVECDOT Flops",mv_flops); + if (mv_mflops >= 0) + ydoc.get(title)->add("MATVECDOT Mflops",mv_mflops); + else + ydoc.get(title)->add("MATVECDOT Mflops","inf"); +#endif + +#if MINIFE_KERNELS == 0 + ydoc.get(title)->add("Total",""); + ydoc.get(title)->get("Total")->add("Total CG Time",cg_times[TOTAL]); + ydoc.get(title)->get("Total")->add("Total CG Flops",total_flops); + if (total_mflops >= 0) + ydoc.get(title)->get("Total")->add("Total CG Mflops",total_mflops); + else + ydoc.get(title)->get("Total")->add("Total CG Mflops","inf"); + ydoc.get(title)->add("Time per iteration",cg_times[TOTAL]/num_iters); +#endif + } +} + +}//namespace miniFE + +#endif + diff --git a/tests/apps/miniFE/tests/basic/exchange_externals.hpp b/tests/apps/miniFE/tests/basic/exchange_externals.hpp new file mode 100644 index 0000000000..167ba1b9d1 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/exchange_externals.hpp @@ -0,0 +1,270 @@ +#ifndef _exchange_externals_hpp_ +#define _exchange_externals_hpp_ + +//@HEADER +// ************************************************************************ +// +// miniFE: simple finite-element assembly and linear-solve +// Copyright (2006) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA +// Questions? Contact Michael A. Heroux (maherou@sandia.gov) +// +// ************************************************************************ +//@HEADER + +#include +#include + +#ifdef HAVE_MPI +#include +#endif + +#include + +#include + +namespace miniFE { + +template +void +exchange_externals(MatrixType& A, + VectorType& x) +{ +#ifdef HAVE_MPI +#ifdef MINIFE_DEBUG + std::ostream& os = outstream(); + os << "entering exchange_externals\n"; +#endif + + int numprocs = 1; + MPI_Comm_size(MPI_COMM_WORLD, &numprocs); + + if (numprocs < 2) return; + + typedef typename MatrixType::ScalarType Scalar; + typedef typename MatrixType::LocalOrdinalType LocalOrdinal; + typedef typename MatrixType::GlobalOrdinalType GlobalOrdinal; + + // Extract Matrix pieces + + int local_nrow = A.rows.size(); + int num_neighbors = A.neighbors.size(); + const std::vector& recv_length = A.recv_length; + const std::vector& send_length = A.send_length; + const std::vector& neighbors = A.neighbors; + const std::vector& elements_to_send = A.elements_to_send; + + std::vector& send_buffer = A.send_buffer; + + // + // first post receives, these are immediate receives + // Do not wait for result to come, will do that at the + // wait call below. + // + + int MPI_MY_TAG = 99; + + std::vector& request = A.request; + + // + // Externals are at end of locals + // + + std::vector& x_coefs = x.coefs; + Scalar* x_external = &(x_coefs[local_nrow]); + + MPI_Datatype mpi_dtype = TypeTraits::mpi_type(); + + // Post receives first + for(int i=0; i x.coefs.size()) { + os << "error, out-of-range. x.coefs.size()=="< exch_ext_requests; +#endif + +template +void +begin_exchange_externals(MatrixType& A, + VectorType& x) +{ +#ifdef HAVE_MPI + + int numprocs = 1, myproc = 0; + MPI_Comm_size(MPI_COMM_WORLD, &numprocs); + MPI_Comm_rank(MPI_COMM_WORLD, &myproc); + + if (numprocs < 2) return; + + typedef typename MatrixType::ScalarType Scalar; + typedef typename MatrixType::LocalOrdinalType LocalOrdinal; + typedef typename MatrixType::GlobalOrdinalType GlobalOrdinal; + + // Extract Matrix pieces + + int local_nrow = A.rows.size(); + int num_neighbors = A.neighbors.size(); + const std::vector& recv_length = A.recv_length; + const std::vector& send_length = A.send_length; + const std::vector& neighbors = A.neighbors; + const std::vector& elements_to_send = A.elements_to_send; + + std::vector send_buffer(elements_to_send.size(), 0); + + // + // first post receives, these are immediate receives + // Do not wait for result to come, will do that at the + // wait call below. + // + + int MPI_MY_TAG = 99; + + exch_ext_requests.resize(num_neighbors); + + // + // Externals are at end of locals + // + + std::vector& x_coefs = x.coefs; + Scalar* x_external = &(x_coefs[local_nrow]); + + MPI_Datatype mpi_dtype = TypeTraits::mpi_type(); + + // Post receives first + for(int i=0; i +#include +#include +#include + +#include +#include +#include +#include + +#ifdef HAVE_MPI +#include +#endif + +namespace miniFE { + +template +int +generate_matrix_structure(const simple_mesh_description& mesh, + MatrixType& A) +{ + int myproc = 0; +#ifdef HAVE_MPI + MPI_Comm_rank(MPI_COMM_WORLD, &myproc); +#endif + + int threw_exc = 0; + try { + + typedef typename MatrixType::GlobalOrdinalType GlobalOrdinal; + typedef typename MatrixType::LocalOrdinalType LocalOrdinal; + + int global_nodes_x = mesh.global_box[0][1]+1; + int global_nodes_y = mesh.global_box[1][1]+1; + int global_nodes_z = mesh.global_box[2][1]+1; + Box box; + copy_box(mesh.local_box, box); + + //num-owned-nodes in each dimension is num-elems+1 + //only if num-elems > 0 in that dimension *and* + //we are at the high end of the global range in that dimension: + if (box[0][1] > box[0][0] && box[0][1] == mesh.global_box[0][1]) ++box[0][1]; + if (box[1][1] > box[1][0] && box[1][1] == mesh.global_box[1][1]) ++box[1][1]; + if (box[2][1] > box[2][0] && box[2][1] == mesh.global_box[2][1]) ++box[2][1]; + + GlobalOrdinal global_nrows = global_nodes_x; + global_nrows *= global_nodes_y*global_nodes_z; + + GlobalOrdinal nrows = get_num_ids(box); + try { + A.reserve_space(nrows, 27); + } + catch(std::exception& exc) { + std::ostringstream osstr; + osstr << "One of A.rows.resize, A.row_offsets.resize, A.packed_cols.reserve or A.packed_coefs.reserve: nrows=" < rows(nrows); + std::vector row_offsets(nrows+1); + std::vector row_coords(nrows*3); + + unsigned roffset = 0; + GlobalOrdinal nnz = 0; + + for(int iz=box[2][0]; iz(global_nodes_x, global_nodes_y, global_nodes_z, + ix, iy, iz); + rows[roffset] = mesh.map_id_to_row(row_id); + row_coords[roffset*3] = ix; + row_coords[roffset*3+1] = iy; + row_coords[roffset*3+2] = iz; + row_offsets[roffset++] = nnz; + + GlobalOrdinal row_begin_offset = nnz; + for(int sz=-1; sz<=1; ++sz) { + for(int sy=-1; sy<=1; ++sy) { + for(int sx=-1; sx<=1; ++sx) { + GlobalOrdinal col_id = + get_id(global_nodes_x, global_nodes_y, global_nodes_z, + ix+sx, iy+sy, iz+sz); + if (col_id >= 0 && col_id < global_nrows) { + ++nnz; + } + } + } + } + } + } + } + row_offsets[roffset] = nnz; + init_matrix(A, rows, row_offsets, row_coords, + global_nodes_x, global_nodes_y, global_nodes_z, global_nrows, mesh); + } + catch(...) { + std::cout << "proc " << myproc << " threw an exception in generate_matrix_structure, probably due to running out of memory." << std::endl; + threw_exc = 1; + } +#ifdef HAVE_MPI + int global_throw = 0; + MPI_Allreduce(&threw_exc, &global_throw, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD); + threw_exc = global_throw; +#endif + if (threw_exc) { + return 1; + } + + return 0; +} + +}//namespace miniFE + +#endif + diff --git a/tests/apps/miniFE/tests/basic/get_common_files b/tests/apps/miniFE/tests/basic/get_common_files new file mode 100755 index 0000000000..dec46a7e4e --- /dev/null +++ b/tests/apps/miniFE/tests/basic/get_common_files @@ -0,0 +1,11 @@ +#!/bin/bash + +dir=../../common + +cp ${dir}/YAML_Doc.cpp . +cp ${dir}/YAML_Doc.hpp . +cp ${dir}/YAML_Element.cpp . +cp ${dir}/YAML_Element.hpp . + +cp ${dir}/generate_info_header . + diff --git a/tests/apps/miniFE/tests/basic/gold_files/1x1x2_A.mtx.1.0 b/tests/apps/miniFE/tests/basic/gold_files/1x1x2_A.mtx.1.0 new file mode 100644 index 0000000000..d337780f47 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/gold_files/1x1x2_A.mtx.1.0 @@ -0,0 +1,113 @@ +12 112 +0 0 1 +0 1 0 +0 2 0 +0 3 0 +0 4 0 +0 5 0 +0 6 0 +0 7 0 +1 0 0 +1 1 1.16667 +1 2 0 +1 3 2.18961e-10 +1 4 0 +1 5 2.18961e-10 +1 6 0 +1 7 0.333333 +2 0 0 +2 1 0 +2 2 1 +2 3 0 +2 4 0 +2 5 0 +2 6 0 +2 7 0 +3 0 0 +3 1 2.18961e-10 +3 2 0 +3 3 2.5 +3 4 0 +3 5 -1 +3 6 0 +3 7 2.18961e-10 +4 0 0 +4 1 0 +4 2 0 +4 3 0 +4 4 1 +4 5 0 +4 6 0 +4 7 0 +4 8 0 +4 9 0 +4 10 0 +4 11 0 +5 0 0 +5 1 2.18961e-10 +5 2 0 +5 3 -1 +5 4 0 +5 5 2.5 +5 6 0 +5 7 2.18961e-10 +5 8 0 +5 9 0 +5 10 0 +5 11 0 +6 0 0 +6 1 0 +6 2 0 +6 3 0 +6 4 0 +6 5 0 +6 6 1 +6 7 0 +6 8 0 +6 9 0 +6 10 0 +6 11 0 +7 0 0 +7 1 0.333333 +7 2 0 +7 3 2.18961e-10 +7 4 0 +7 5 2.18961e-10 +7 6 0 +7 7 1.16667 +7 8 0 +7 9 0 +7 10 0 +7 11 0 +8 4 0 +8 5 0 +8 6 0 +8 7 0 +8 8 1 +8 9 0 +8 10 0 +8 11 0 +9 4 0 +9 5 0 +9 6 0 +9 7 0 +9 8 0 +9 9 0.5 +9 10 0 +9 11 0 +10 4 0 +10 5 0 +10 6 0 +10 7 0 +10 8 0 +10 9 0 +10 10 1 +10 11 0 +11 4 0 +11 5 0 +11 6 0 +11 7 0 +11 8 0 +11 9 0 +11 10 0 +11 11 0.5 diff --git a/tests/apps/miniFE/tests/basic/gold_files/1x1x2_A.mtx.2.0 b/tests/apps/miniFE/tests/basic/gold_files/1x1x2_A.mtx.2.0 new file mode 100644 index 0000000000..363c0bd17b --- /dev/null +++ b/tests/apps/miniFE/tests/basic/gold_files/1x1x2_A.mtx.2.0 @@ -0,0 +1,33 @@ +4 32 +0 0 1 +0 1 0 +0 2 0 +0 3 0 +0 4 0 +0 5 0 +0 6 0 +0 7 0 +1 0 0 +1 1 1.16667 +1 2 0 +1 3 2.18961e-10 +1 4 0 +1 5 2.18961e-10 +1 6 0 +1 7 0.333333 +2 0 0 +2 1 0 +2 2 1 +2 3 0 +2 4 0 +2 5 0 +2 6 0 +2 7 0 +3 0 0 +3 1 2.18961e-10 +3 2 0 +3 3 2.5 +3 4 0 +3 5 -1 +3 6 0 +3 7 2.18961e-10 diff --git a/tests/apps/miniFE/tests/basic/gold_files/1x1x2_A.mtx.2.1 b/tests/apps/miniFE/tests/basic/gold_files/1x1x2_A.mtx.2.1 new file mode 100644 index 0000000000..3b435ca68d --- /dev/null +++ b/tests/apps/miniFE/tests/basic/gold_files/1x1x2_A.mtx.2.1 @@ -0,0 +1,80 @@ +4 0 0 +4 1 0 +4 2 0 +4 3 0 +4 4 1 +4 5 0 +4 6 0 +4 7 0 +4 8 0 +4 9 0 +4 10 0 +4 11 0 +5 0 0 +5 1 2.18961e-10 +5 2 0 +5 3 -1 +5 4 0 +5 5 2.5 +5 6 0 +5 7 2.18961e-10 +5 8 0 +5 9 0 +5 10 0 +5 11 0 +6 0 0 +6 1 0 +6 2 0 +6 3 0 +6 4 0 +6 5 0 +6 6 1 +6 7 0 +6 8 0 +6 9 0 +6 10 0 +6 11 0 +7 0 0 +7 1 0.333333 +7 2 0 +7 3 2.18961e-10 +7 4 0 +7 5 2.18961e-10 +7 6 0 +7 7 1.16667 +7 8 0 +7 9 0 +7 10 0 +7 11 0 +8 4 0 +8 5 0 +8 6 0 +8 7 0 +8 8 1 +8 9 0 +8 10 0 +8 11 0 +9 4 0 +9 5 0 +9 6 0 +9 7 0 +9 8 0 +9 9 0.5 +9 10 0 +9 11 0 +10 4 0 +10 5 0 +10 6 0 +10 7 0 +10 8 0 +10 9 0 +10 10 1 +10 11 0 +11 4 0 +11 5 0 +11 6 0 +11 7 0 +11 8 0 +11 9 0 +11 10 0 +11 11 0.5 diff --git a/tests/apps/miniFE/tests/basic/gold_files/1x1x2_b.vec.1.0 b/tests/apps/miniFE/tests/basic/gold_files/1x1x2_b.vec.1.0 new file mode 100644 index 0000000000..b0b890a94e --- /dev/null +++ b/tests/apps/miniFE/tests/basic/gold_files/1x1x2_b.vec.1.0 @@ -0,0 +1,13 @@ +12 +0 1 +1 1.25 +2 1 +3 1.41667 +4 1 +5 1.25 +6 1 +7 1.25 +8 1 +9 0 +10 1 +11 0 diff --git a/tests/apps/miniFE/tests/basic/gold_files/1x1x2_b.vec.2.0 b/tests/apps/miniFE/tests/basic/gold_files/1x1x2_b.vec.2.0 new file mode 100644 index 0000000000..15d91a46de --- /dev/null +++ b/tests/apps/miniFE/tests/basic/gold_files/1x1x2_b.vec.2.0 @@ -0,0 +1,5 @@ +4 +0 1 +1 1.25 +2 1 +3 1.41667 diff --git a/tests/apps/miniFE/tests/basic/gold_files/1x1x2_b.vec.2.1 b/tests/apps/miniFE/tests/basic/gold_files/1x1x2_b.vec.2.1 new file mode 100644 index 0000000000..a8349a9d5c --- /dev/null +++ b/tests/apps/miniFE/tests/basic/gold_files/1x1x2_b.vec.2.1 @@ -0,0 +1,8 @@ +4 1 +5 1.25 +6 1 +7 1.25 +8 1 +9 0 +10 1 +11 0 diff --git a/tests/apps/miniFE/tests/basic/gold_files/1x1x2_x.vec.1.0 b/tests/apps/miniFE/tests/basic/gold_files/1x1x2_x.vec.1.0 new file mode 100644 index 0000000000..78dcba9861 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/gold_files/1x1x2_x.vec.1.0 @@ -0,0 +1,13 @@ +12 +0 1 +1 0.833333 +2 1 +3 0.912698 +4 1 +5 0.865079 +6 1 +7 0.833333 +8 1 +9 0 +10 1 +11 0 diff --git a/tests/apps/miniFE/tests/basic/gold_files/1x1x2_x.vec.2.0 b/tests/apps/miniFE/tests/basic/gold_files/1x1x2_x.vec.2.0 new file mode 100644 index 0000000000..024797bcb6 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/gold_files/1x1x2_x.vec.2.0 @@ -0,0 +1,5 @@ +4 +0 1 +1 0.833333 +2 1 +3 0.912698 diff --git a/tests/apps/miniFE/tests/basic/gold_files/1x1x2_x.vec.2.1 b/tests/apps/miniFE/tests/basic/gold_files/1x1x2_x.vec.2.1 new file mode 100644 index 0000000000..f77488369a --- /dev/null +++ b/tests/apps/miniFE/tests/basic/gold_files/1x1x2_x.vec.2.1 @@ -0,0 +1,8 @@ +4 1 +5 0.865079 +6 1 +7 0.833333 +8 1 +9 0 +10 1 +11 0 diff --git a/tests/apps/miniFE/tests/basic/imbalance.hpp b/tests/apps/miniFE/tests/basic/imbalance.hpp new file mode 100644 index 0000000000..f801efc586 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/imbalance.hpp @@ -0,0 +1,271 @@ +#ifndef _imbalance_hpp_ +#define _imbalance_hpp_ + +#include + +#ifdef HAVE_MPI +#include +#endif + +#include +#include +#include + +namespace miniFE { + +const int X = 0; +const int Y = 1; +const int Z = 2; +const int NONE = 3; + +const int LOWER = 0; +const int UPPER = 1; + +template +void +compute_imbalance(const Box& global_box, + const Box& local_box, + float& largest_imbalance, + float& std_dev, + YAML_Doc& doc, + bool record_in_doc) +{ + int numprocs = 1, myproc = 0; +#ifdef HAVE_MPI + MPI_Comm_size(MPI_COMM_WORLD, &numprocs); + MPI_Comm_rank(MPI_COMM_WORLD, &myproc); +#endif + + GlobalOrdinal local_nrows = get_num_ids(local_box); + GlobalOrdinal min_nrows = 0, max_nrows = 0, global_nrows = 0; + int min_proc = myproc, max_proc = myproc; + get_global_min_max(local_nrows, global_nrows, min_nrows, min_proc, + max_nrows, max_proc); + + float avg_nrows = global_nrows; + avg_nrows /= numprocs; + + //largest_imbalance will be the difference between the min (or max) + //rows-per-processor and avg_nrows, represented as a percentage: + largest_imbalance = percentage_difference(min_nrows, avg_nrows); + + float tmp = percentage_difference(max_nrows, avg_nrows); + if (tmp > largest_imbalance) largest_imbalance = tmp; + + std_dev = compute_std_dev_as_percentage(local_nrows, avg_nrows); + + if (myproc == 0 && record_in_doc) { + doc.add("Rows-per-proc Load Imbalance",""); + doc.get("Rows-per-proc Load Imbalance")->add("Largest (from avg, %)",largest_imbalance); + doc.get("Rows-per-proc Load Imbalance")->add("Std Dev (%)",std_dev); + } +} + +std::pair +decide_how_to_grow(const Box& global_box, const Box& local_box) +{ + std::pair result(NONE,UPPER); + + if (local_box[Z][UPPER] < global_box[Z][UPPER]) { + result.first = Z; + result.second = UPPER; + return result; + } + if (local_box[Z][LOWER] > global_box[Z][LOWER]) { + result.first = Z; + result.second = LOWER; + return result; + } + if (local_box[Y][UPPER] < global_box[Y][UPPER]) { + result.first = Y; + result.second = UPPER; + return result; + } + if (local_box[Y][LOWER] > global_box[Y][LOWER]) { + result.first = Y; + result.second = LOWER; + return result; + } + if (local_box[X][UPPER] < global_box[X][UPPER]) { + result.first = X; + result.second = UPPER; + return result; + } + if (local_box[X][LOWER] > global_box[X][LOWER]) { + result.first = X; + result.second = LOWER; + return result; + } + return result; +} + +std::pair +decide_how_to_shrink(const Box& global_box, const Box& local_box) +{ + std::pair result(NONE,UPPER); + + if (local_box[Z][UPPER] < global_box[Z][UPPER] && local_box[Z][UPPER]-local_box[Z][LOWER] > 2) { + result.first = Z; + result.second = UPPER; + return result; + } + if (local_box[Z][LOWER] > global_box[Z][LOWER] && local_box[Z][UPPER]-local_box[Z][LOWER] > 2) { + result.first = Z; + result.second = LOWER; + return result; + } + if (local_box[Y][UPPER] < global_box[Y][UPPER] && local_box[Y][UPPER]-local_box[Y][LOWER] > 2) { + result.first = Y; + result.second = UPPER; + return result; + } + if (local_box[Y][LOWER] > global_box[Y][LOWER] && local_box[Y][UPPER]-local_box[Y][LOWER] > 2) { + result.first = Y; + result.second = LOWER; + return result; + } + if (local_box[X][UPPER] < global_box[X][UPPER] && local_box[X][UPPER]-local_box[X][LOWER] > 2) { + result.first = X; + result.second = UPPER; + return result; + } + if (local_box[X][LOWER] > global_box[X][LOWER] && local_box[X][UPPER]-local_box[X][LOWER] > 2) { + result.first = X; + result.second = LOWER; + return result; + } + return result; +} + +template +void +add_imbalance(const Box& global_box, + Box& local_box, + float imbalance, + YAML_Doc& doc) +{ + int numprocs = 1, myproc = 0; +#ifdef HAVE_MPI + MPI_Comm_size(MPI_COMM_WORLD, &numprocs); + MPI_Comm_rank(MPI_COMM_WORLD, &myproc); +#endif + + if (numprocs == 1) { + return; + } + + float cur_imbalance = 0, cur_std_dev = 0; + compute_imbalance(global_box, local_box, + cur_imbalance, cur_std_dev, doc, false); + + while (cur_imbalance < imbalance) { + GlobalOrdinal local_nrows = get_num_ids(local_box); + GlobalOrdinal min_nrows = 0, max_nrows = 0, global_nrows = 0; + int min_proc = myproc, max_proc = myproc; + get_global_min_max(local_nrows, global_nrows, min_nrows, min_proc, + max_nrows, max_proc); + + std::pair grow(NONE,UPPER); + int grow_axis_val = -1; + std::pair shrink(NONE,UPPER); + int shrink_axis_val = -1; + + if (myproc == max_proc) { + grow = decide_how_to_grow(global_box, local_box); + if (grow.first != NONE) { + grow_axis_val = local_box[grow.first][grow.second]; + } + } + if (myproc == min_proc) { + shrink = decide_how_to_shrink(global_box, local_box); + if (shrink.first != NONE) { + shrink_axis_val = local_box[shrink.first][shrink.second]; + } + } + + int grow_info[8] = {grow.first, grow.second, + local_box[X][0], local_box[X][1], + local_box[Y][0], local_box[Y][1], + local_box[Z][0], local_box[Z][1]}; + + int shrink_info[8] = {shrink.first, shrink.second, + local_box[X][0], local_box[X][1], + local_box[Y][0], local_box[Y][1], + local_box[Z][0], local_box[Z][1]}; +#ifdef HAVE_MPI + MPI_Bcast(&grow_info[0], 8, MPI_INT, max_proc, MPI_COMM_WORLD); + MPI_Bcast(&shrink_info[0], 8, MPI_INT, min_proc, MPI_COMM_WORLD); +#endif + + int grow_axis = grow_info[0]; + int grow_end = grow_info[1]; + int shrink_axis = shrink_info[0]; + int shrink_end = shrink_info[1]; + int grow_incr = 1; + if (grow_end == LOWER) grow_incr = -1; + int shrink_incr = -1; + if (shrink_end == LOWER) shrink_incr = 1; + if (grow_axis != NONE) grow_axis_val = grow_info[2+grow_axis*2+grow_end]; + if (shrink_axis != NONE) shrink_axis_val = shrink_info[2+shrink_axis*2+shrink_end]; + + if (grow_axis == NONE && shrink_axis == NONE) break; + + bool grow_status = grow_axis==NONE ? false : true; + if (grow_axis != NONE) { + if ((grow_incr == 1 && local_box[grow_axis][0] == grow_axis_val) || + (grow_incr == -1 && local_box[grow_axis][1] == grow_axis_val)) { + if (local_box[grow_axis][1] - local_box[grow_axis][0] < 2) { + grow_status = false; + } + } + } + + bool shrink_status = shrink_axis==NONE ? false : true; + if (shrink_axis != NONE) { + if ((shrink_incr == 1 && local_box[shrink_axis][0] == shrink_axis_val) || + (shrink_incr == -1 && local_box[shrink_axis][1] == shrink_axis_val)) { + if (local_box[shrink_axis][1] - local_box[shrink_axis][0] < 2) { + shrink_status = false; + } + } + } + +#ifdef HAVE_MPI + int statusints[2] = { grow_status ? 0 : 1, shrink_status ? 0 : 1 }; + int globalstatus[2] = { 0, 0 }; + MPI_Allreduce(&statusints, &globalstatus, 2, MPI_INT, MPI_SUM, MPI_COMM_WORLD); + grow_status = globalstatus[0]>0 ? false : true; + shrink_status = globalstatus[1]>0 ? false : true; +#endif + + if (grow_status == false && shrink_status == false) break; + + if (grow_status && grow_axis != NONE) { + if (local_box[grow_axis][0] == grow_axis_val) { + local_box[grow_axis][0] += grow_incr; + } + + if (local_box[grow_axis][1] == grow_axis_val) { + local_box[grow_axis][1] += grow_incr; + } + } + + if (shrink_status && shrink_axis != NONE) { + if (local_box[shrink_axis][0] == shrink_axis_val) { + local_box[shrink_axis][0] += shrink_incr; + } + + if (local_box[shrink_axis][1] == shrink_axis_val) { + local_box[shrink_axis][1] += shrink_incr; + } + } + + compute_imbalance(global_box, local_box, + cur_imbalance, cur_std_dev, doc, false); + } +} + +}//namespace miniFE + +#endif + diff --git a/tests/apps/miniFE/tests/basic/main.cpp b/tests/apps/miniFE/tests/basic/main.cpp new file mode 100644 index 0000000000..ed3753f7da --- /dev/null +++ b/tests/apps/miniFE/tests/basic/main.cpp @@ -0,0 +1,247 @@ + +//@HEADER +// ************************************************************************ +// +// miniFE: simple finite-element assembly and linear-solve +// Copyright (2006) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA +// Questions? Contact Michael A. Heroux (maherou@sandia.gov) +// +// ************************************************************************ +//@HEADER +#include +#include +#include +#include + +#include + +#include + +#ifdef HAVE_MPI +#include +#endif + +//-------------------------------------------------------------------- +#include +//-------------------------------------------------------------------- + +#include +#include +#include +#include +#include +#include +#include + +#if MINIFE_INFO != 0 +#include +#else +#include +#endif + +//The following macros should be specified as compile-macros in the +//makefile. They are defaulted here just in case... +#ifndef MINIFE_SCALAR +#define MINIFE_SCALAR double +#endif +#ifndef MINIFE_LOCAL_ORDINAL +#define MINIFE_LOCAL_ORDINAL int +#endif +#ifndef MINIFE_GLOBAL_ORDINAL +#define MINIFE_GLOBAL_ORDINAL int +#endif + +// ************************************************************************ + +void add_params_to_yaml(YAML_Doc& doc, miniFE::Parameters& params); +void add_configuration_to_yaml(YAML_Doc& doc, int numprocs, int numthreads); +void add_timestring_to_yaml(YAML_Doc& doc); + +inline void print_box(int myproc, const char* name, const Box& box, + const char* name2, const Box& box2) +{ + std::cout << "proc " << myproc << " "< local_boxes(numprocs); + + box_partition(0, numprocs, 2, global_box, &local_boxes[0]); + + Box& my_box = local_boxes[myproc]; + +//print_box(myproc, "global-box", global_box, "local-box", my_box); + + std::ostringstream osstr; + osstr << "miniFE." << params.nx << "x" << params.ny << "x" << params.nz; +#ifdef HAVE_MPI + osstr << ".P"<. + //To run miniFE with float instead of double, or 'long long' instead of int, + //etc., change these template-parameters by changing the macro definitions in + //the makefile or on the make command-line. + + miniFE::driver< MINIFE_SCALAR, MINIFE_LOCAL_ORDINAL, MINIFE_GLOBAL_ORDINAL, + ComputeNodeType>(global_box, my_box, compute_node, params, doc); + + miniFE::timer_type total_time = miniFE::mytimer() - start_time; + + if (myproc == 0) { + doc.add("Total Program Time",total_time); + std::cout << doc.generateYAML() << std::endl; + } + + miniFE::finalize_mpi(); + + return 0; +} + +void add_params_to_yaml(YAML_Doc& doc, miniFE::Parameters& params) +{ + doc.add("Global Run Parameters",""); + doc.get("Global Run Parameters")->add("dimensions",""); + doc.get("Global Run Parameters")->get("dimensions")->add("nx",params.nx); + doc.get("Global Run Parameters")->get("dimensions")->add("ny",params.ny); + doc.get("Global Run Parameters")->get("dimensions")->add("nz",params.nz); + doc.get("Global Run Parameters")->add("load_imbalance", params.load_imbalance); + if (params.mv_overlap_comm_comp == 1) { + std::string val("1 (yes)"); + doc.get("Global Run Parameters")->add("mv_overlap_comm_comp", val); + } + else { + std::string val("0 (no)"); + doc.get("Global Run Parameters")->add("mv_overlap_comm_comp", val); + } +} + +void add_configuration_to_yaml(YAML_Doc& doc, int numprocs, int numthreads) +{ + doc.get("Global Run Parameters")->add("number of processors", numprocs); + std::string threading("none"); + +#ifdef MINIFE_HAVE_TPI + threading = "TPI"; +#endif +#ifdef MINIFE_HAVE_TBB + threading = "TBB"; +#endif +#ifdef MINIFE_HAVE_CUDA + threading = "CUDA"; +#endif + if (threading != "none") { + doc.get("Global Run Parameters")->add("(per proc) numthreads",numthreads); + } + + doc.add("Platform",""); + doc.get("Platform")->add("hostname",MINIFE_HOSTNAME); + doc.get("Platform")->add("kernel name",MINIFE_KERNEL_NAME); + doc.get("Platform")->add("kernel release",MINIFE_KERNEL_RELEASE); + doc.get("Platform")->add("processor",MINIFE_PROCESSOR); + + doc.add("Build",""); + doc.get("Build")->add("CXX",MINIFE_CXX); + doc.get("Build")->add("compiler version",MINIFE_CXX_VERSION); + doc.get("Build")->add("CXXFLAGS",MINIFE_CXXFLAGS); + std::string using_mpi("no"); +#ifdef HAVE_MPI + using_mpi = "yes"; +#endif + doc.get("Build")->add("using MPI",using_mpi); + doc.get("Build")->add("Threading",threading.c_str()); +} + +void add_timestring_to_yaml(YAML_Doc& doc) +{ + std::time_t rawtime; + struct tm * timeinfo; + std::time(&rawtime); + timeinfo = std::localtime(&rawtime); + std::ostringstream osstr; + osstr.fill('0'); + osstr << timeinfo->tm_year+1900 << "-"; + osstr.width(2); osstr << timeinfo->tm_mon+1 << "-"; + osstr.width(2); osstr << timeinfo->tm_mday << ", "; + osstr.width(2); osstr << timeinfo->tm_hour << "-"; + osstr.width(2); osstr << timeinfo->tm_min << "-"; + osstr.width(2); osstr << timeinfo->tm_sec; + std::string timestring = osstr.str(); + doc.add("Run Date/Time",timestring); +} + diff --git a/tests/apps/miniFE/tests/basic/make_local_matrix.hpp b/tests/apps/miniFE/tests/basic/make_local_matrix.hpp new file mode 100644 index 0000000000..99c2cf7039 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/make_local_matrix.hpp @@ -0,0 +1,440 @@ +#ifndef _make_local_matrix_hpp_ +#define _make_local_matrix_hpp_ + +//@HEADER +// ************************************************************************ +// +// MiniFE: Simple Finite Element Assembly and Solve +// Copyright (2006-2013) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA +// +// ************************************************************************ +//@HEADER + +#include + +#ifdef HAVE_MPI +#include +#endif + +namespace miniFE { + +template +void +make_local_matrix(MatrixType& A) +{ +#ifdef HAVE_MPI + int numprocs = 1, myproc = 0; + MPI_Comm_size(MPI_COMM_WORLD, &numprocs); + MPI_Comm_rank(MPI_COMM_WORLD, &myproc); + + if (numprocs < 2) { + A.num_cols = A.rows.size(); + A.has_local_indices = true; + return; + } + + typedef typename MatrixType::GlobalOrdinalType GlobalOrdinal; + typedef typename MatrixType::LocalOrdinalType LocalOrdinal; + typedef typename MatrixType::ScalarType Scalar; + + std::map externals; + LocalOrdinal num_external = 0; + + //Extract Matrix pieces + + size_t local_nrow = A.rows.size(); + GlobalOrdinal start_row = local_nrow>0 ? A.rows[0] : -1; + GlobalOrdinal stop_row = local_nrow>0 ? A.rows[local_nrow-1] : -1; + + // We need to convert the index values for the rows on this processor + // to a local index space. We need to: + // - Determine if each index reaches to a local value or external value + // - If local, subtract start_row from index value to get local index + // - If external, find out if it is already accounted for. + // - If so, then do nothing, + // - otherwise + // - add it to the list of external indices, + // - find out which processor owns the value. + // - Set up communication for sparse MV operation + + /////////////////////////////////////////// + // Scan the indices and transform to local + /////////////////////////////////////////// + + std::vector& external_index = A.external_index; + + for(size_t i=0; i tmp_buffer(numprocs, 0); // Temp buffer space needed below + + // Build list of global index offset + + std::vector global_index_offsets(numprocs, 0); + + tmp_buffer[myproc] = start_row; // This is my start row + + // This call sends the start_row of each ith processor to the ith + // entry of global_index_offsets on all processors. + // Thus, each processor knows the range of indices owned by all + // other processors. + // Note: There might be a better algorithm for doing this, but this + // will work... + + MPI_Datatype mpi_dtype = TypeTraits::mpi_type(); + MPI_Allreduce(&tmp_buffer[0], &global_index_offsets[0], numprocs, mpi_dtype, + MPI_SUM, MPI_COMM_WORLD); + + // Go through list of externals and find the processor that owns each + std::vector external_processor(num_external); + + for(LocalOrdinal i=0; i=0; --j) { + if (global_index_offsets[j] <= cur_ind && global_index_offsets[j] >= 0) { + external_processor[i] = j; + break; + } + } + } + + ///////////////////////////////////////////////////////////////////////// + // Sift through the external elements. For each newly encountered external + // point assign it the next index in the sequence. Then look for other + // external elements who are updated by the same node and assign them the next + // set of index numbers in the sequence (ie. elements updated by the same node + // have consecutive indices). + ///////////////////////////////////////////////////////////////////////// + + size_t count = local_nrow; + std::vector& external_local_index = A.external_local_index; + external_local_index.assign(num_external, -1); + + for(LocalOrdinal i=0; i new_external_processor(num_external, 0); + + for(int i=0; i No external elements are updated by + // processor i. + // tmp_neighbors[i] = x ==> (x-1)/numprocs elements are updated from + // processor i. + /// + //////////////////////////////////////////////////////////////////////// + + std::vector tmp_neighbors(numprocs, 0); + + int num_recv_neighbors = 0; + int length = 1; + + for(LocalOrdinal i=0; i recv_list; + recv_list.push_back(new_external_processor[0]); + for(LocalOrdinal i=1; i send_list(num_send_neighbors, 0); + + // + // first post receives, these are immediate receives + // Do not wait for result to come, will do that at the + // wait call below. + // + int MPI_MY_TAG = 99; + + std::vector request(num_send_neighbors); + for(int i=0; i new_external(num_external); + for(LocalOrdinal i=0; i lengths(num_recv_neighbors); + + ++MPI_MY_TAG; + + // First post receives + + for(int i=0; i& neighbors = A.neighbors; + std::vector& recv_length = A.recv_length; + std::vector& send_length = A.send_length; + + neighbors.resize(num_recv_neighbors, 0); + A.request.resize(num_recv_neighbors); + recv_length.resize(num_recv_neighbors, 0); + send_length.resize(num_recv_neighbors, 0); + + LocalOrdinal j = 0; + for(int i=0; i $(DESTDIR)$(includedir)/Makefile.export.threadpool.macros + +uninstall-hook: + rm -f $(includedir)/Makefile.export.threadpool + rm -f $(includedir)/Makefile.export.threadpool.macros + +else + +install-exec-hook: + +uninstall-hook: + +endif + +## ####################################################################### +## Subdirectories to be make'd recursively +## ####################################################################### +#We now build tests and examples through separate make targets, rather than +#during "make". We still need to conditionally include the test and example +#in SUBDIRS, even though BUILD_TESTS and BUILD_EXAMPLES will never be +#defined, so that the tests and examples are included in the distribution +#tarball. + +if SUB_TEST +TEST_SUBDIR=test +endif + +#if SUB_EXAMPLE +#EXAMPLE_SUBDIR=example +#endif + +# #np# - The following make targets must be defined for all packages. +# #np# - If the package does not have tests or examples, replace the +# #np# - corresponding rules with something like: +# #np# - @echo "new_package does not have any tests yet" +if BUILD_TESTS +tests: + @echo "" + @echo "Now building ThreadPool tests." + @echo "" + cd $(top_builddir)/test && $(MAKE) + @echo "" + @echo "Finished building ThreadPool tests." + @echo "" +else +tests: + @echo "ThreadPool tests were disabled at configure time" +endif + +examples: + @echo "ThreadPool does not have any examples yet" + +install-examples: + @echo "ThreadPool does not have any examples yet" + +clean-tests: + cd $(top_builddir)/test && $(MAKE) clean + +clean-examples: + @echo "ThreadPool does not have any examples yet" + +everything: + $(MAKE) && $(MAKE) examples && $(MAKE) tests + +clean-everything: + $(MAKE) clean-examples && $(MAKE) clean-tests && $(MAKE) clean + +install-everything: + $(MAKE) install && $(MAKE) install-examples + +SUBDIRS = src $(TEST_SUBDIR) + +## ####################################################################### +## The below targets allow you to use the new +## testharness to run the test suite as make targets +## ####################################################################### + +TRILINOS_HOME_DIR=@abs_top_srcdir@/../.. +TRILINOS_BUILD_DIR=@abs_top_builddir@/../.. +TRILINOS_TEST_CATEGORY=INSTALL + +runtests-serial : + $(PERL_EXE) $(TRILINOS_HOME_DIR)/commonTools/test/utilities/runtests \ + --trilinos-dir=$(TRILINOS_HOME_DIR) \ + --comm=serial \ + --build-dir=$(TRILINOS_BUILD_DIR) \ + --category=$(TRILINOS_TEST_CATEGORY) \ + --output-dir=@abs_top_builddir@/test/runtests-results \ + --verbosity=1 \ + --packages=ThreadPool + +runtests-mpi : + $(PERL_EXE) $(TRILINOS_HOME_DIR)/commonTools/test/utilities/runtests \ + --trilinos-dir=$(TRILINOS_HOME_DIR) \ + --comm=mpi \ + --mpi-go=$(TRILINOS_MPI_GO) \ + --build-dir=$(TRILINOS_BUILD_DIR) \ + --category=$(TRILINOS_TEST_CATEGORY) \ + --output-dir=@abs_top_builddir@/test/runtests-results \ + --verbosity=1 \ + --packages=ThreadPool + +if HAVE_MPI +THREADPOOL_CHECK_COMM=mpi +else +THREADPOOL_CHECK_COMM=serial +endif + diff --git a/tests/apps/miniFE/tests/basic/optional/ThreadPool/Makefile.export.threadpool.in b/tests/apps/miniFE/tests/basic/optional/ThreadPool/Makefile.export.threadpool.in new file mode 100644 index 0000000000..66bfda9453 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/optional/ThreadPool/Makefile.export.threadpool.in @@ -0,0 +1,9 @@ +_THREADPOOL_INCLUDES = -I@abs_top_srcdir@/include -I@abs_top_builddir@/include + +_THREADPOOL_LIBS = @LDFLAGS@ -L@abs_top_builddir@/src -ltpi $(LIBS) + +@USING_GNUMAKE_TRUE@THREADPOOL_INCLUDES = $(shell @PERL_EXE@ @abs_top_srcdir@/config/strip_dup_incl_paths.pl $(_THREADPOOL_INCLUDES)) +@USING_GNUMAKE_TRUE@THREADPOOL_LIBS = $(shell @PERL_EXE@ @abs_top_srcdir@/config/strip_dup_libs.pl $(_THREADPOOL_LIBS)) + +@USING_GNUMAKE_FALSE@THREADPOOL_INCLUDES = $(_THREADPOOL_INCLUDES) +@USING_GNUMAKE_FALSE@THREADPOOL_LIBS = $(_THREADPOOL_LIBS) diff --git a/tests/apps/miniFE/tests/basic/optional/ThreadPool/ThreadPool_config.h b/tests/apps/miniFE/tests/basic/optional/ThreadPool/ThreadPool_config.h new file mode 100644 index 0000000000..b9410691d7 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/optional/ThreadPool/ThreadPool_config.h @@ -0,0 +1,3 @@ +#ifndef HAVE_PTHREAD +#define HAVE_PTHREAD +#endif diff --git a/tests/apps/miniFE/tests/basic/optional/ThreadPool/bootstrap b/tests/apps/miniFE/tests/basic/optional/ThreadPool/bootstrap new file mode 100755 index 0000000000..8706e9eebe --- /dev/null +++ b/tests/apps/miniFE/tests/basic/optional/ThreadPool/bootstrap @@ -0,0 +1,9 @@ +#! /bin/sh +#np# This file does not need to be edited, other than removing this line. +set -x +# Only run aclocal if we need to create aclocal.m4 +aclocal -I config +# autoheader is smart and doesn't change anything unless it's necessary +autoheader +automake --foreign --add-missing --copy +autoconf diff --git a/tests/apps/miniFE/tests/basic/optional/ThreadPool/cmake/Dependencies.cmake b/tests/apps/miniFE/tests/basic/optional/ThreadPool/cmake/Dependencies.cmake new file mode 100644 index 0000000000..746d066a17 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/optional/ThreadPool/cmake/Dependencies.cmake @@ -0,0 +1,11 @@ +SET(LIB_REQUIRED_DEP_PACKAGES) +SET(LIB_OPTIONAL_DEP_PACKAGES) +SET(TEST_REQUIRED_DEP_PACKAGES) +SET(TEST_OPTIONAL_DEP_PACKAGES) +SET(LIB_REQUIRED_DEP_TPLS) +SET(LIB_OPTIONAL_DEP_TPLS Pthread MPI) +SET(TEST_REQUIRED_DEP_TPLS) +SET(TEST_OPTIONAL_DEP_TPLS) + +TPL_TENTATIVELY_ENABLE(Pthread) + diff --git a/tests/apps/miniFE/tests/basic/optional/ThreadPool/cmake/ThreadPool_config.h.in b/tests/apps/miniFE/tests/basic/optional/ThreadPool/cmake/ThreadPool_config.h.in new file mode 100644 index 0000000000..55614b9f5f --- /dev/null +++ b/tests/apps/miniFE/tests/basic/optional/ThreadPool/cmake/ThreadPool_config.h.in @@ -0,0 +1,2 @@ +#cmakedefine HAVE_MPI +#cmakedefine HAVE_PTHREAD diff --git a/tests/apps/miniFE/tests/basic/optional/ThreadPool/config/acx_pthread.m4 b/tests/apps/miniFE/tests/basic/optional/ThreadPool/config/acx_pthread.m4 new file mode 100644 index 0000000000..3bd3ec2200 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/optional/ThreadPool/config/acx_pthread.m4 @@ -0,0 +1,224 @@ +dnl @synopsis ACX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) +dnl +dnl This macro figures out how to build C programs using POSIX +dnl threads. It sets the PTHREAD_LIBS output variable to the threads +dnl library and linker flags, and the PTHREAD_CFLAGS output variable +dnl to any special C compiler flags that are needed. (The user can also +dnl force certain compiler flags/libs to be tested by setting these +dnl environment variables.) +dnl +dnl Also sets PTHREAD_CC to any special C compiler that is needed for +dnl multi-threaded programs (defaults to the value of CC otherwise). +dnl (This is necessary on AIX to use the special cc_r compiler alias.) +dnl +dnl If you are only building threads programs, you may wish to +dnl use these variables in your default LIBS, CFLAGS, and CC: +dnl +dnl LIBS="$PTHREAD_LIBS $LIBS" +dnl CFLAGS="$CFLAGS $PTHREAD_CFLAGS" +dnl CC="$PTHREAD_CC" +dnl +dnl In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute +dnl constant has a nonstandard name, defines PTHREAD_CREATE_JOINABLE +dnl to that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX). +dnl +dnl ACTION-IF-FOUND is a list of shell commands to run if a threads +dnl library is found, and ACTION-IF-NOT-FOUND is a list of commands +dnl to run it if it is not found. If ACTION-IF-FOUND is not specified, +dnl the default action will define HAVE_PTHREAD. +dnl +dnl Please let the authors know if this macro fails on any platform, +dnl or if you have any other suggestions or comments. This macro was +dnl based on work by SGJ on autoconf scripts for FFTW (www.fftw.org) +dnl (with help from M. Frigo), as well as ac_pthread and hb_pthread +dnl macros posted by AFC to the autoconf macro repository. We are also +dnl grateful for the helpful feedback of numerous users. +dnl +dnl @version $Id$ +dnl @author Steven G. Johnson and Alejandro Forero Cuervo + +AC_DEFUN([ACX_PTHREAD], [ +AC_REQUIRE([AC_CANONICAL_HOST]) +acx_pthread_ok=no + +# First, check if the POSIX threads header, pthread.h, is available. +# If it isn't, don't bother looking for the threads libraries. +AC_CHECK_HEADER(pthread.h, , acx_pthread_ok=noheader) + +# We must check for the threads library under a number of different +# names; the ordering is very important because some systems +# (e.g. DEC) have both -lpthread and -lpthreads, where one of the +# libraries is broken (non-POSIX). + +# First of all, check if the user has set any of the PTHREAD_LIBS, +# etcetera environment variables, and if threads linking works using +# them: +if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + save_LIBS="$LIBS" + LIBS="$PTHREAD_LIBS $LIBS" + AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS]) + AC_TRY_LINK_FUNC(pthread_join, acx_pthread_ok=yes) + AC_MSG_RESULT($acx_pthread_ok) + if test x"$acx_pthread_ok" = xno; then + PTHREAD_LIBS="" + PTHREAD_CFLAGS="" + fi + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" +fi + +# Create a list of thread flags to try. Items starting with a "-" are +# C compiler flags, and other items are library names, except for "none" +# which indicates that we try without any flags at all. + +acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt" + +# The ordering *is* (sometimes) important. Some notes on the +# individual items follow: + +# pthreads: AIX (must check this before -lpthread) +# none: in case threads are in libc; should be tried before -Kthread and +# other compiler flags to prevent continual compiler warnings +# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) +# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) +# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) +# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads) +# -pthreads: Solaris/gcc +# -mthreads: Mingw32/gcc, Lynx/gcc +# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it +# doesn't hurt to check since this sometimes defines pthreads too; +# also defines -D_REENTRANT) +# pthread: Linux, etcetera +# --thread-safe: KAI C++ + +case "${host_cpu}-${host_os}" in + *solaris*) + + # On Solaris (at least, for some versions), libc contains stubbed + # (non-functional) versions of the pthreads routines, so link-based + # tests will erroneously succeed. (We need to link with -pthread or + # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather + # a function called by this macro, so we could check for that, but + # who knows whether they'll stub that too in a future libc.) So, + # we'll just look for -pthreads and -lpthread first: + + acx_pthread_flags="-pthread -pthreads pthread -mt $acx_pthread_flags" + ;; +esac + +if test x"$acx_pthread_ok" = xno; then +for flag in $acx_pthread_flags; do + + case $flag in + none) + AC_MSG_CHECKING([whether pthreads work without any flags]) + ;; + + -*) + AC_MSG_CHECKING([whether pthreads work with $flag]) + PTHREAD_CFLAGS="$flag" + ;; + + *) + AC_MSG_CHECKING([for the pthreads library -l$flag]) + PTHREAD_LIBS="-l$flag" + ;; + esac + + save_LIBS="$LIBS" + save_CFLAGS="$CFLAGS" + LIBS="$PTHREAD_LIBS $LIBS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + + # Check for various functions. We must include pthread.h, + # since some functions may be macros. (On the Sequent, we + # need a special flag -Kthread to make this header compile.) + # We check for pthread_join because it is in -lpthread on IRIX + # while pthread_create is in libc. We check for pthread_attr_init + # due to DEC craziness with -lpthreads. We check for + # pthread_cleanup_push because it is one of the few pthread + # functions on Solaris that doesn't have a non-functional libc stub. + # We try pthread_create on general principles. + AC_TRY_LINK([#include ], + [pthread_t th; pthread_join(th, 0); + pthread_attr_init(0); pthread_cleanup_push(0, 0); + pthread_create(0,0,0,0); pthread_cleanup_pop(0); ], + [acx_pthread_ok=yes]) + + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" + + AC_MSG_RESULT($acx_pthread_ok) + if test "x$acx_pthread_ok" = xyes; then + break; + fi + + PTHREAD_LIBS="" + PTHREAD_CFLAGS="" +done +fi + +# Various other checks: +if test "x$acx_pthread_ok" = xyes; then + save_LIBS="$LIBS" + LIBS="$PTHREAD_LIBS $LIBS" + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + + # Detect AIX lossage: threads are created detached by default + # and the JOINABLE attribute has a nonstandard name (UNDETACHED). + AC_MSG_CHECKING([for joinable pthread attribute]) + AC_TRY_LINK([#include ], + [int attr=PTHREAD_CREATE_JOINABLE;], + ok=PTHREAD_CREATE_JOINABLE, ok=unknown) + if test x"$ok" = xunknown; then + AC_TRY_LINK([#include ], + [int attr=PTHREAD_CREATE_UNDETACHED;], + ok=PTHREAD_CREATE_UNDETACHED, ok=unknown) + fi + if test x"$ok" != xPTHREAD_CREATE_JOINABLE; then + AC_DEFINE(PTHREAD_CREATE_JOINABLE, $ok, + [Define to the necessary symbol if this constant + uses a non-standard name on your system.]) + fi + AC_MSG_RESULT(${ok}) + if test x"$ok" = xunknown; then + AC_MSG_WARN([we do not know how to create joinable pthreads]) + fi + + AC_MSG_CHECKING([if more special flags are required for pthreads]) + flag=no + case "${host_cpu}-${host_os}" in + *-aix* | *-freebsd*) flag="-D_THREAD_SAFE";; + *solaris* | alpha*-osf*) flag="-D_REENTRANT";; + esac + AC_MSG_RESULT(${flag}) + if test "x$flag" != xno; then + PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" + fi + + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" + + # More AIX lossage: must compile with cc_r + AC_CHECK_PROG(PTHREAD_CC, cc_r, cc_r, ${CC}) +else + PTHREAD_CC="$CC" +fi + +AC_SUBST(PTHREAD_LIBS) +AC_SUBST(PTHREAD_CFLAGS) +AC_SUBST(PTHREAD_CC) + +# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: +if test x"$acx_pthread_ok" = xyes; then + ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1]) + : +else + acx_pthread_ok=no + $2 +fi + +])dnl ACX_PTHREAD diff --git a/tests/apps/miniFE/tests/basic/optional/ThreadPool/config/generate-makeoptions.pl b/tests/apps/miniFE/tests/basic/optional/ThreadPool/config/generate-makeoptions.pl new file mode 100755 index 0000000000..a39223efac --- /dev/null +++ b/tests/apps/miniFE/tests/basic/optional/ThreadPool/config/generate-makeoptions.pl @@ -0,0 +1,86 @@ +#!/usr/bin/perl -w +# +# This perl script graps a bunch of make macro definitions +# generated for Teuchos that can be used in other makefiles. +# This is dumped to stdout and can be redirected to build +# a makefile. +# +# Note, this script must be maintained to be current for +# the Teuchos makefile. +# +use strict; + +if( !(defined(@ARGV) && scalar(@ARGV)==2) ) { + die "Error, this script takes two and only two arguments (makefile_name package_name).!\n"; +} + +my $makefile_name = shift; +my $package_name = shift; + +# +# List the macros you want to grep and include in the output +# +my @macros = + ( + "CC" + ,"CXX" + ,"F77" + ,"CXXLD" + ,"DEFS" + ,"CPPFLAGS" + ,"CFLAGS" + ,"CXXFLAGS" + ,"FFLAGS" + ,"LDFLAGS" + ,"FLIBS" + ,"BLAS_LIBS" + ,"LAPACK_LIBS" + ,"prefix" + ,"AR" + ,"ALTERNATE_AR" + ,"libteuchos_a_AR" + ,"RANLIB" + ); + +open FILE_IN, "<$makefile_name" || die "The file $makefile_name could not be opended for input\n"; +my @makefile_name_array = ; +close FILE_IN; + +# +# Find the above macros and append "${package_name}_" to the beginning. +# +my @new_macros; +my $add_next_line = 0; +foreach( @makefile_name_array ) { + my $line = $_; + if($add_next_line) { + push @new_macros, $line; + if( substr($line,-1,1) eq "\\" ) { + $add_next_line = 1; + } + else { + $add_next_line = 0; + } + next; + } + #print "Line = $line"; + foreach( @macros ) { + my $macro_search = "^${_} "; + #print "Macro search = \'$macro_search\'\n"; + if( $line=~/$macro_search/ ) { + #print "Adding Macro!\n"; + my $find_str = '\(CXX\)'; + my $replace_str = "(${package_name}_CXX)"; + $line=~s/$find_str/$replace_str/; + push @new_macros, "${package_name}_${line}"; + if( substr($line,-2,1) eq "\\" ) { + $add_next_line = 1; + } + else { + $add_next_line = 0; + } + } + } +} + +print join("",@new_macros); diff --git a/tests/apps/miniFE/tests/basic/optional/ThreadPool/config/replace-install-prefix.pl b/tests/apps/miniFE/tests/basic/optional/ThreadPool/config/replace-install-prefix.pl new file mode 100755 index 0000000000..7523b08994 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/optional/ThreadPool/config/replace-install-prefix.pl @@ -0,0 +1,89 @@ +#!/usr/bin/perl -w +use strict; +use Getopt::Long; +# +# This script is called to do a set of text replacements for installing +# a Mafile.export.package file so that external clients can use it. +# +# Read in commandline arguments +# +my $exec_prefix = ""; # [required] Abs path to base installation directory (i.e. --prefix=??? option passed to configure) +my $my_export_makefile = ""; # [required] Name only of installed Makefile.export.package file +my $my_top_srcdir = ""; # [required] Abs path to this package's top source directory +my $my_incl_dirs = ""; # [required] Abs path to this package's include directories +my $my_lib_dirs = ""; # [optional] Abs path to this package's library directories (if any exist) +my $dep_package_builddirs = ""; # [optional] Abs paths to other directly dependent framework package build directories (if any exist) +GetOptions( + "exec-prefix=s" => \$exec_prefix, + "my-export-makefile=s" => \$my_export_makefile, + "my-abs-top-srcdir=s" => \$my_top_srcdir, + "my-abs-incl-dirs=s" => \$my_incl_dirs, + "my-abs-lib-dirs=s" => \$my_lib_dirs, + "dep-package-abs-builddirs=s" => \$dep_package_builddirs + ); +# +# Validate commandline arguments +# +scalar(@ARGV) == 0 || die; +$exec_prefix ne "" || die; +$my_export_makefile ne "" || die; +$my_top_srcdir ne "" || die; +$my_incl_dirs ne "" || die; +# +# Interpret commandline arguments +# +$exec_prefix = remove_rel_paths($exec_prefix); +my @my_incl_dirs = split(":",$my_incl_dirs); +my @my_lib_dirs = split(":",$my_lib_dirs); +my @dep_export_package_builddirs = split(":",$dep_package_builddirs); +# +# Do the replacements +# +my $my_abs_export_makefile = "${exec_prefix}/include/${my_export_makefile}"; + +my $cmnd_base = "${my_top_srcdir}/config/token-replace.pl "; +# +foreach(@dep_export_package_builddirs) { + if($_ ne "") { + run_cmnd($cmnd_base . "${_} ${exec_prefix}/include ${my_abs_export_makefile} ${my_abs_export_makefile}"); + } +} +# +foreach(@my_incl_dirs) { + if($_ ne "") { + run_cmnd($cmnd_base . "-I${_} -I${exec_prefix}/include ${my_abs_export_makefile} ${my_abs_export_makefile}"); + } +} +# +foreach(@my_lib_dirs) { + if($_ ne "") { + run_cmnd($cmnd_base . "-L${_} -L${exec_prefix}/lib ${my_abs_export_makefile} ${my_abs_export_makefile}"); + } +} +# +run_cmnd($cmnd_base . "${my_top_srcdir}/config ${exec_prefix}/include ${my_abs_export_makefile} ${my_abs_export_makefile}"); +# +# Subroutines +# +sub remove_rel_paths { + my $entry_in = shift; + if ($entry_in=~/-L\.\./) { + return $entry_in; + } + my @paths = split("/",$entry_in); + my @new_paths; + foreach( @paths ) { + if( !($_=~/\.\./) ) { + push @new_paths, $_; + } + else { + pop @new_paths + } + } + return join("/",@new_paths); +} +sub run_cmnd { + my $cmnd = shift; + #print "\n", $cmnd, "\n"; + system($cmnd)==0 || die; +} diff --git a/tests/apps/miniFE/tests/basic/optional/ThreadPool/config/string-replace.pl b/tests/apps/miniFE/tests/basic/optional/ThreadPool/config/string-replace.pl new file mode 100755 index 0000000000..adeb1f436d --- /dev/null +++ b/tests/apps/miniFE/tests/basic/optional/ThreadPool/config/string-replace.pl @@ -0,0 +1,43 @@ +#!/usr/bin/perl -w +# +# This perl script replaces a string with another string. +# Here it is allowd for file_in and file_out to be the +# same file. +# +use strict; +# +my $g_use_msg = + "Use: string-replace.pl find_string replacement_string file_in file_out\n"; +if( scalar(@ARGV) < 4 ) { + print STDERR $g_use_msg; + exit(-1); +} +# +my $find_string = shift; +my $replacement_string = shift; +my $file_in_name = shift; +my $file_out_name = shift; +# +# +if($file_in_name=~/CVS/) { +# print "Do not replace in CVS\n"; + exit; +} +# +open FILE_IN, "<$file_in_name" || die "The file $file_in_name could not be opended for input\n"; +my @file_in_array = ; +close FILE_IN; +# +my @file_out_array; +my $did_replacement = 0; +foreach(@file_in_array) { + #print $_; + $did_replacement = 1 if $_=~s/$find_string/$replacement_string/g; + #print $_; + push @file_out_array, $_; +} +if($did_replacement || $file_out_name ne $file_in_name) { + open FILE_OUT, ">$file_out_name" || die "The file $file_out_name could not be opended for output\n"; + print FILE_OUT @file_out_array; + close FILE_OUT; +} diff --git a/tests/apps/miniFE/tests/basic/optional/ThreadPool/config/strip_dup_incl_paths.pl b/tests/apps/miniFE/tests/basic/optional/ThreadPool/config/strip_dup_incl_paths.pl new file mode 100755 index 0000000000..c628d31159 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/optional/ThreadPool/config/strip_dup_incl_paths.pl @@ -0,0 +1,44 @@ +#!/usr/bin/perl -w +# This perl script removes duplicate include paths left to the right +use strict; +my @all_incl_paths = @ARGV; +my @cleaned_up_incl_paths; +foreach( @all_incl_paths ) { + $_ = remove_rel_paths($_); + if( !($_=~/-I/) ) { + push @cleaned_up_incl_paths, $_; + } + elsif( !entry_exists($_,\@cleaned_up_incl_paths) ) { + push @cleaned_up_incl_paths, $_; + } +} +print join( " ", @cleaned_up_incl_paths ); +# +# Subroutines +# +sub entry_exists { + my $entry = shift; # String + my $list = shift; # Reference to an array + foreach( @$list ) { + if( $entry eq $_ ) { return 1; } + } + return 0; +} +# +sub remove_rel_paths { + my $entry_in = shift; + if ($entry_in=~/-I\.\./) { + return $entry_in; + } + my @paths = split("/",$entry_in); + my @new_paths; + foreach( @paths ) { + if( !($_=~/\.\./) ) { + push @new_paths, $_; + } + else { + pop @new_paths + } + } + return join("/",@new_paths); +} diff --git a/tests/apps/miniFE/tests/basic/optional/ThreadPool/config/strip_dup_libs.pl b/tests/apps/miniFE/tests/basic/optional/ThreadPool/config/strip_dup_libs.pl new file mode 100755 index 0000000000..cdf4b42a90 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/optional/ThreadPool/config/strip_dup_libs.pl @@ -0,0 +1,69 @@ +#!/usr/bin/perl -w +# This perl script removes duplicate libraries from the right to the left and +# removes duplicate -L library paths from the left to the right +use strict; + +my @all_libs = @ARGV; +# +# Move from left to right and remove duplicate -l libraries +# +my @cleaned_up_libs_first; +foreach( reverse @all_libs ) { + $_ = remove_rel_paths($_); + if( $_=~/-L/ ) { + unshift @cleaned_up_libs_first, $_; + } + else { + if( !entry_exists($_,\@cleaned_up_libs_first) ) { + unshift @cleaned_up_libs_first, $_; + } + } +} + +# +# Move from right to left and remove duplicate -L library paths +# +my @cleaned_up_libs; +foreach( @cleaned_up_libs_first ) { + $_ = remove_rel_paths($_); + if( !($_=~/-L/) ) { + push @cleaned_up_libs, $_; + } + elsif( !entry_exists($_,\@cleaned_up_libs) ) { + push @cleaned_up_libs, $_; + } +} +# +# Print the new list of libraries and paths +# +print join( " ", @cleaned_up_libs ); + +# +# Subroutines +# +sub entry_exists { + my $entry = shift; # String + my $list = shift; # Reference to an array + foreach( @$list ) { + if( $entry eq $_ ) { return 1; } + } + return 0; +} +# +sub remove_rel_paths { + my $entry_in = shift; + if ($entry_in=~/-L\.\./) { + return $entry_in; + } + my @paths = split("/",$entry_in); + my @new_paths; + foreach( @paths ) { + if( !($_=~/\.\./) ) { + push @new_paths, $_; + } + else { + pop @new_paths + } + } + return join("/",@new_paths); +} diff --git a/tests/apps/miniFE/tests/basic/optional/ThreadPool/config/tac_arg_check_mpi.m4 b/tests/apps/miniFE/tests/basic/optional/ThreadPool/config/tac_arg_check_mpi.m4 new file mode 100644 index 0000000000..10d569abac --- /dev/null +++ b/tests/apps/miniFE/tests/basic/optional/ThreadPool/config/tac_arg_check_mpi.m4 @@ -0,0 +1,68 @@ +dnl @synopsis TAC_ARG_CHECK_MPI +dnl +dnl Check to make sure any definitions set in TAC_ARG_CONFIG_MPI +dnl are valid, set the MPI flags. Test MPI compile using C++ compiler. +dnl +dnl @author Mike Heroux +dnl +AC_DEFUN([TAC_ARG_CHECK_MPI], +[ + +if test "X${HAVE_PKG_MPI}" = "Xyes"; then + + if test -n "${MPI_DIR}" && test -z "${MPI_INC}"; then + MPI_INC="${MPI_DIR}/include" + fi + + if test -n "${MPI_INC}"; then + CPPFLAGS="${CPPFLAGS} -I${MPI_INC}" + fi + + AC_LANG_CPLUSPLUS + AC_MSG_CHECKING(for mpi.h) + AC_TRY_CPP([#include "mpi.h"], + [AC_MSG_RESULT(yes)], + [ + AC_MSG_RESULT(no) + echo "-----" + echo "Cannot link simple MPI program." + echo "Try --with-mpi-compilers to specify MPI compilers." + echo "Or try --with-mpi-libs, --with-mpi-incdir, --with-mpi-libdir" + echo "to specify all the specific MPI compile options." + echo "-----" + AC_MSG_ERROR(MPI cannot link) + ]) + + if test -n "${MPI_DIR}" && test -z "${MPI_LIBDIR}"; then + MPI_LIBDIR="${MPI_DIR}/lib" + fi + + if test -n "${MPI_LIBDIR}"; then + LDFLAGS="${LDFLAGS} -L${MPI_LIBDIR}" + fi + + if test -z "${MPI_LIBS}" && test -n "${MPI_LIBDIR}"; then + MPI_LIBS="-lmpi" + fi + + if test -n "${MPI_LIBS}"; then + LIBS="${MPI_LIBS} ${LIBS}" + fi + +# AC_LANG_CPLUSPLUS +# AC_MSG_CHECKING(whether MPI will link using C++ compiler) +# AC_TRY_LINK([#include ], +# [int c; char** v; MPI_Init(&c,&v);], +# [AC_MSG_RESULT(yes)], +# [AC_MSG_RESULT(no) +# echo "-----" +# echo "Cannot link simple MPI program." +# echo "Try --with-mpi-cxx to specify MPI C++ compile script." +# echo "Or try --with-mpi-libs, --with-mpi-incdir, --with-mpi-libdir" +# echo "to specify all the specific MPI compile options." +# echo "-----" +# AC_MSG_ERROR(MPI cannot link)] +# ) + +fi +]) diff --git a/tests/apps/miniFE/tests/basic/optional/ThreadPool/config/tac_arg_config_mpi.m4 b/tests/apps/miniFE/tests/basic/optional/ThreadPool/config/tac_arg_config_mpi.m4 new file mode 100644 index 0000000000..2d1dd98179 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/optional/ThreadPool/config/tac_arg_config_mpi.m4 @@ -0,0 +1,188 @@ +dnl @synopsis TAC_ARG_CONFIG_MPI +dnl +dnl Test a variety of MPI options: +dnl --enable-mpi - Turns MPI compiling mode on +dnl --with-mpi - specify root directory of MPI +dnl --with-mpi-compilers - Turns on MPI compiling mode and sets the MPI C++ +dnl compiler = mpicxx, mpic++ or mpiCC, +dnl the MPI C compiler = mpicc and +dnl the MPI Fortran compiler = mpif77 +dnl --with-mpi-incdir - specify include directory for MPI +dnl --with-mpi-libs - specify MPI libraries +dnl --with-mpi-libdir - specify location of MPI libraries +dnl +dnl If any of these options are set, HAVE_MPI will be defined for both +dnl Autoconf and Automake, and HAVE_MPI will be defined in the +dnl generated config.h file +dnl +dnl +dnl @author Mike Heroux +dnl Modified 12/26/2007 by Jim Willenbring to skip the Fortran compiler +dnl check if Fortran is not enabled. +dnl +AC_DEFUN([TAC_ARG_CONFIG_MPI], +[ + +AC_ARG_ENABLE(mpi, +[AC_HELP_STRING([--enable-mpi],[MPI support])], +[HAVE_PKG_MPI=$enableval], +[HAVE_PKG_MPI=no] +) + +AC_ARG_WITH(mpi-compilers, +[AC_HELP_STRING([--with-mpi-compilers=PATH], +[use MPI compilers mpicc, mpif77, and mpicxx, mpic++ or mpiCC in the specified path or in the default path if no path is specified. Enables MPI])], +[ + if test X${withval} != Xno; then + HAVE_PKG_MPI=yes + if test X${withval} = Xyes; then + # Check for mpicxx, if it does not exist, check for mpic++, if it does + # not exist, use mpiCC instead. + AC_CHECK_PROG(MPI_TEMP_CXX, mpicxx, mpicxx, no) + if test X${MPI_TEMP_CXX} = Xno; then + AC_CHECK_PROG(MPI_CXX, mpic++, mpic++, mpiCC) + else + MPI_CXX=${MPI_TEMP_CXX} + fi + MPI_CC=mpicc + MPI_F77=mpif77 + else + if test -f ${withval}/mpicxx; then + MPI_CXX=${withval}/mpicxx + elif test -f ${withval}/mpic++; then + MPI_CXX=${withval}/mpic++ + else + MPI_CXX=${withval}/mpiCC + fi + MPI_CC=${withval}/mpicc + MPI_F77=${withval}/mpif77 + fi + fi +] +) + +AC_ARG_WITH(mpi, +[AC_HELP_STRING([--with-mpi=MPIROOT],[use MPI root directory (enables MPI)])], +[ + HAVE_PKG_MPI=yes + MPI_DIR=${withval} + AC_MSG_CHECKING(MPI directory) + AC_MSG_RESULT([${MPI_DIR}]) +] +) + +#AC_ARG_WITH(mpi-include, +#[AC_HELP_STRING([--with-mpi-include],[Obsolete. Use --with-mpi-incdir=DIR instead. Do not prefix DIR with '-I'.])], +#[AC_MSG_ERROR([--with-mpi-include is an obsolte option. Use --with-mpi-incdir=DIR instead. Do not prefix DIR with '-I'. For example '--with-mpi-incdir=/usr/lam_path/include'.])] +#) + +AC_ARG_WITH(mpi-libs, +[AC_HELP_STRING([--with-mpi-libs="LIBS"],[MPI libraries @<:@"-lmpi"@:>@])], +[ + MPI_LIBS=${withval} + AC_MSG_CHECKING(user-defined MPI libraries) + AC_MSG_RESULT([${MPI_LIBS}]) +] +) + +AC_ARG_WITH(mpi-incdir, +[AC_HELP_STRING([--with-mpi-incdir=DIR],[MPI include directory @<:@MPIROOT/include@:>@ Do not use -I])], +[ + MPI_INC=${withval} + AC_MSG_CHECKING(user-defined MPI includes) + AC_MSG_RESULT([${MPI_INC}]) +] +) + +AC_ARG_WITH(mpi-libdir, +[AC_HELP_STRING([--with-mpi-libdir=DIR],[MPI library directory @<:@MPIROOT/lib@:>@ Do not use -L])], +[ + MPI_LIBDIR=${withval} + AC_MSG_CHECKING(user-defined MPI library directory) + AC_MSG_RESULT([${MPI_LIBDIR}]) +] +) + +AC_MSG_CHECKING(whether we are using MPI) +AC_MSG_RESULT([${HAVE_PKG_MPI}]) + +if test "X${HAVE_PKG_MPI}" = "Xyes"; then + AC_DEFINE(HAVE_MPI,,[define if we want to use MPI]) +fi + +dnl Define Automake version of HAVE_MPI if appropriate + +AM_CONDITIONAL(HAVE_MPI, [test "X${HAVE_PKG_MPI}" = "Xyes"]) + + +dnl +dnl -------------------------------------------------------------------- +dnl Check for MPI compilers (must be done *before* AC_PROG_CXX, +dnl AC_PROG_CC and AC_PROG_F77) +dnl +dnl -------------------------------------------------------------------- + +if test -n "${MPI_CXX}"; then + if test -f ${MPI_CXX}; then + MPI_CXX_EXISTS=yes + else + AC_CHECK_PROG(MPI_CXX_EXISTS, ${MPI_CXX}, yes, no) + fi + + if test "X${MPI_CXX_EXISTS}" = "Xyes"; then + CXX=${MPI_CXX} + else + echo "-----" + echo "Cannot find MPI C++ compiler ${MPI_CXX}." + echo "Specify a path to all mpi compilers with --with-mpi-compilers=PATH" + echo "or specify a C++ compiler using CXX=" + echo "Do not use --with-mpi-compilers if using CXX=" + echo "-----" + AC_MSG_ERROR([MPI C++ compiler (${MPI_CXX}) not found.]) + fi +fi + +if test -n "${MPI_CC}"; then + if test -f ${MPI_CC}; then + MPI_CC_EXISTS=yes + else + AC_CHECK_PROG(MPI_CC_EXISTS, ${MPI_CC}, yes, no) + fi + + if test "X${MPI_CC_EXISTS}" = "Xyes"; then + CC=${MPI_CC} + else + echo "-----" + echo "Cannot find MPI C compiler ${MPI_CC}." + echo "Specify a path to all mpi compilers with --with-mpi-compilers=PATH" + echo "or specify a C compiler using CC=" + echo "Do not use --with-mpi-compilers if using CC=" + echo "-----" + AC_MSG_ERROR([MPI C compiler (${MPI_CC}) not found.]) + fi +fi + +if test "X$ac_cv_use_fortran" = "Xyes"; then + +if test -n "${MPI_F77}"; then + if test -f ${MPI_F77}; then + MPI_F77_EXISTS=yes + else + AC_CHECK_PROG(MPI_F77_EXISTS, ${MPI_F77}, yes, no) + fi + + if test "X${MPI_F77_EXISTS}" = "Xyes"; then + F77=${MPI_F77} + else + echo "-----" + echo "Cannot find MPI Fortran compiler ${MPI_F77}." + echo "Specify a path to all mpi compilers with --with-mpi-compilers=PATH" + echo "or specify a Fortran 77 compiler using F77=" + echo "Do not use --with-mpi-compilers if using F77=" + echo "-----" + AC_MSG_ERROR([MPI Fortran 77 compiler (${MPI_F77}) not found.]) + fi +fi + +fi dnl ac_cv_use_fortran +]) diff --git a/tests/apps/miniFE/tests/basic/optional/ThreadPool/config/tac_arg_enable_export-makefiles.m4 b/tests/apps/miniFE/tests/basic/optional/ThreadPool/config/tac_arg_enable_export-makefiles.m4 new file mode 100644 index 0000000000..b7a8b38dac --- /dev/null +++ b/tests/apps/miniFE/tests/basic/optional/ThreadPool/config/tac_arg_enable_export-makefiles.m4 @@ -0,0 +1,76 @@ +dnl Enables export makefile specific code +dnl +dnl The following AM_CONDITIONALS are set for makefiles to access: +dnl USING_EXPORT_MAKEFILES +dnl USING_PERL via TAC_ARG_WITH_PERL +dnl USING_GNUMAKE +dnl +dnl The following AC_DEFINES are set: +dnl HAVE_EXPORT_MAKEFILES +dnl +dnl the following variables are set: +dnl PERL_EXE for the perl executable via TAC_ARG_WITH_PERL +dnl +dnl This file was based on tac_arg_enable_feature.m4 by Mike Heroux +dnl @author Roger Pawlowski +dnl +AC_DEFUN([TAC_ARG_ENABLE_EXPORT_MAKEFILES], +[ +AC_ARG_ENABLE(export-makefiles, +AC_HELP_STRING([--enable-export-makefiles],[Creates export makefiles in the install (prefix) directory. This option requires perl to be set in your path or defined with --with-perl=. Note that the export makefiles are always created and used in the build directory, but will not be installable without this option to change the paths. (default is $1)]), +ac_cv_use_export_makefiles=$enableval, +ac_cv_use_export_makefiles=$1) + +AC_MSG_CHECKING(whether to build export makefiles) + +if test "X$ac_cv_use_export_makefiles" != "Xno"; then + + AC_MSG_RESULT(yes) + AC_DEFINE([HAVE_EXPORT_MAKEFILES],,[Define if you want to build export makefiles.]) + +else + + AC_MSG_RESULT(no) + +fi + +AM_CONDITIONAL(USING_EXPORT_MAKEFILES, test X${ac_cv_use_export_makefiles} = Xyes) + +# Check for perl to run scripts (Required dependency) +TAC_ARG_WITH_PERL + +if test "X$HAVE_PERL" != "Xyes" && + test "X$ac_cv_use_export_makefiles" != "Xno"; then + AC_MSG_RESULT(no) + AC_MSG_ERROR([Failed to find the perl executable. The flag --enable-export-makefiles requires perl to be either in your path or explicitly defined by the flag --with-perl=. If you do not require the export makefiles to be installed via 'make install', you can disable the export makefiles with --disable-export-makefiles.]) +fi + +# Check for using gnumake to clean up link lines via +# gnumake's "shell" command. Optional dependency. +AC_DEFUN([TAC_ARG_WITH_GNUMAKE], +[ +AC_ARG_WITH(gnumake, +AC_HELP_STRING([--with-gnumake],[Gnu's make has special functions we can use to eliminate redundant paths in the build and link lines. Enable this if you use gnu-make to build Trilinos. This requires that perl is in your path or that you have specified the perl executable with --with-perl=. Configure will check for the existence of the perl executable and quit with an error if it is not found. (default is no)]), +ac_cv_use_gnumake=$withval, ac_cv_use_gnumake=no) + +AC_MSG_CHECKING(whether gnumake specific code should be enabled) + +if test "X$ac_cv_use_gnumake" != "Xno"; then + AC_MSG_RESULT(yes) + AC_DEFINE([HAVE_GNUMAKE],,[Define if you are using gnumake - this will shorten your link lines.]) +else + AC_MSG_RESULT(no) +fi +AM_CONDITIONAL(USING_GNUMAKE, test "X$ac_cv_use_gnumake" = "Xyes") +]) + +TAC_ARG_WITH_GNUMAKE + +if test "X$HAVE_PERL" != "Xyes" && + test "X$ac_cv_use_gnumake" != "Xno"; then + AC_MSG_RESULT(no) + AC_MSG_ERROR([The flag --with-gnumake requires perl to be in your path. The perl executable can alternatively be explicitly defined by the flag --with-perl=.]) +fi + +]) + diff --git a/tests/apps/miniFE/tests/basic/optional/ThreadPool/config/tac_arg_enable_feature.m4 b/tests/apps/miniFE/tests/basic/optional/ThreadPool/config/tac_arg_enable_feature.m4 new file mode 100644 index 0000000000..4e22753a1b --- /dev/null +++ b/tests/apps/miniFE/tests/basic/optional/ThreadPool/config/tac_arg_enable_feature.m4 @@ -0,0 +1,40 @@ +dnl @synopsis TAC_ARG_ENABLE_FEATURE(FEATURE_NAME, FEATURE_DESCRIPTION, HAVE_NAME, DEFAULT_VAL) +dnl +dnl Test for --enable-${FEATURE_NAME} and set to DEFAULT_VAL value if feature not specified. +dnl Also calls AC_DEFINE to define HAVE_${HAVE_NAME} if value is not equal to "no" +dnl +dnl Use this macro to help defining whether or not optional +dnl features* should compiled. For example: +dnl +dnl TAC_ARG_ENABLE_FEATURE(epetra, [Configure and build epetra], EPETRA, yes) +dnl +dnl will test for --enable-epetra when configure is run. If it is defined +dnl and not set to "no" or not defined (default is "yes") then HAVE_EPETRA will +dnl be defined, if --enable-epetra is defined to be "no", HAVE_EPETRA will not +dnl be defined. +dnl +dnl *NOTE: epetra, aztecoo, komplex, ifpack, and other software found in +dnl subdirectories of Trilinos/packages are "packages" in their own right. +dnl However, these packages are also "features" of the larger package +dnl "Trilinos". Therefore, when configuring from the Trilinos directory, +dnl it is appropriate to refer to these software packages as "features". +dnl +dnl This file was based on tac_arg_with_package.m4 by Mike Heroux +dnl @author James Willenbring +dnl +AC_DEFUN([TAC_ARG_ENABLE_FEATURE], +[ +AC_ARG_ENABLE([$1], +AC_HELP_STRING([--enable-$1],[$2 (default is [$4])]), +ac_cv_use_$1=$enableval, ac_cv_use_$1=$4) + +AC_MSG_CHECKING(whether to use [$1]) + +if test "X$ac_cv_use_$1" != "Xno"; then + AC_MSG_RESULT(yes) + AC_DEFINE([HAVE_$3],,[Define if want to build $1]) +else + AC_MSG_RESULT(no) +fi +]) + diff --git a/tests/apps/miniFE/tests/basic/optional/ThreadPool/config/tac_arg_enable_feature_sub_check.m4 b/tests/apps/miniFE/tests/basic/optional/ThreadPool/config/tac_arg_enable_feature_sub_check.m4 new file mode 100755 index 0000000000..b3876fd7ed --- /dev/null +++ b/tests/apps/miniFE/tests/basic/optional/ThreadPool/config/tac_arg_enable_feature_sub_check.m4 @@ -0,0 +1,54 @@ +dnl @synopsis TAC_ARG_ENABLE_FEATURE_SUB_CHECK(FEATURE_NAME, SUB_FEATURE_NAME, FEATURE_DESCRIPTION, HAVE_NAME) +dnl +dnl This hack gets around the fact that TAC_ARG_ENABLE_FEATURE does not support underscores +dnl in its feature names. TAC_ARG_ENABLE_FEATURE_SUB_CHECK allows exactly one underscore. Not great, +dnl but arguably better than supporting no underscores. +dnl +dnl TAC_ARG_ENABLE_FEATURE(feature-sub, [Configure and build feature-sub], FEATURE_SUB, yes) +dnl fails because tac_arg_enable_feature tests for ac_cv_use_feature-sub which gets +dnl rejected because the `-' is not allowed in variables. (AC_ARG_ENABLE sets ac_cv_use_feature_sub +dnl to avoid this problem.) Use: +dnl +dnl TAC_ARG_ENABLE_FEATURE_SUB_CHECK(feature, sub, [Configure and build feature-sub], FEATURE_SUB) +dnl instead. +dnl +dnl This macro will test for --enable-${FEATURE_NAME}-${SUB_FEATURE_NAME} when configure is run. +dnl If it is defined and not set to "no" or not defined and --disable-${SUB_FEATURE_NAME} is not +dnl specified then HAVE_${HAVE_NAME} will be defined. +dnl +dnl *NOTE: This macro is designed for the use-case when there is an individual Trilinos package +dnl offering fine-grained control of a Trilinos option. This way, the individual package +dnl option is enabled, as long as the Trilinos option is not disabled. If the Trilinos option is +dnl disabled, then the user must enable each packages option individually. For instance: +dnl +dnl --disable-tests --enable-teuchos-tests +dnl +dnl *NOTE: epetra, aztecoo, komplex, ifpack, and other software found in +dnl subdirectories of Trilinos/packages are "packages" in their own right. +dnl However, these packages are also "features" of the larger package +dnl "Trilinos". Therefore, when configuring from the Trilinos directory, +dnl it is appropriate to refer to these software packages as "features". +dnl +dnl This file was based on tac_arg_enable_package.m4 by Jim Willenbring +dnl and tac_arg_enable_package_sub.m4 by Ken Stanley. +dnl +dnl @author Heidi Thornquist +dnl +AC_DEFUN([TAC_ARG_ENABLE_FEATURE_SUB_CHECK], +[ +AC_ARG_ENABLE([$2],, ac_cv_use_$2=$enableval, ac_cv_use_$2=yes) + +AC_ARG_ENABLE([$1-$2], +AC_HELP_STRING([--enable-$1-$2],[$3 (default is yes if --disable-$2 is not specified)]), +ac_cv_use_$1_$2=$enableval, ac_cv_use_$1_$2=${ac_cv_use_$2}) + +AC_MSG_CHECKING(whether to use [$1-$2]) + +if test "X$ac_cv_use_$1_$2" != "Xno"; then + AC_MSG_RESULT(yes) + AC_DEFINE([HAVE_$4],,[Define if want to build $1-$2]) +else + AC_MSG_RESULT(no) +fi +]) + diff --git a/tests/apps/miniFE/tests/basic/optional/ThreadPool/config/tac_arg_with_ar.m4 b/tests/apps/miniFE/tests/basic/optional/ThreadPool/config/tac_arg_with_ar.m4 new file mode 100644 index 0000000000..9568f3e539 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/optional/ThreadPool/config/tac_arg_with_ar.m4 @@ -0,0 +1,39 @@ +dnl @synopsis TAC_ARG_WITH_AR +dnl +dnl Test for --with-ar="ar_program ar_flags". +dnl Default is "ar cru" +dnl +dnl Generates an Automake conditional USE_ALTERNATE_AR that can be tested. +dnl Generates the user-specified archiver command in @ALTERNATE_AR@. +dnl +dnl @author Mike Heroux +dnl +AC_DEFUN([TAC_ARG_WITH_AR], +[ +AC_ARG_WITH(ar, +AC_HELP_STRING([--with-ar], [override archiver command (default is "ar cru")]), +[ +AC_MSG_CHECKING(user-defined archiver) +AC_MSG_RESULT([${withval}]) +USE_ALTERNATE_AR=yes +ALTERNATE_AR="${withval}" +] +) + +if test -n "${SPECIAL_AR}" && test "X${USE_ALTERNATE_AR}" != "Xyes"; +then + USE_ALTERNATE_AR=yes + ALTERNATE_AR="${SPECIAL_AR}" +fi + +AC_MSG_CHECKING(for special archiver command) +if test "X${USE_ALTERNATE_AR}" = "Xyes"; then + AC_MSG_RESULT([${ALTERNATE_AR}]) + AM_CONDITIONAL(USE_ALTERNATE_AR, true) +else + AC_MSG_RESULT([none]) + AM_CONDITIONAL(USE_ALTERNATE_AR, false) +fi +AC_SUBST(ALTERNATE_AR) +]) + diff --git a/tests/apps/miniFE/tests/basic/optional/ThreadPool/config/tac_arg_with_flags.m4 b/tests/apps/miniFE/tests/basic/optional/ThreadPool/config/tac_arg_with_flags.m4 new file mode 100644 index 0000000000..256450ac35 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/optional/ThreadPool/config/tac_arg_with_flags.m4 @@ -0,0 +1,31 @@ +dnl @synopsis TAC_ARG_WITH_FLAGS(lcase_name, UCASE_NAME) +dnl +dnl Test for --with-lcase_name="compiler/loader flags". if defined, prepend +dnl flags to standard UCASE_NAME definition. +dnl +dnl Use this macro to facilitate additional special flags that should be +dnl passed on to the preprocessor/compilers/loader. +dnl +dnl Example use +dnl +dnl TAC_ARG_WITH_FLAGS(cxxflags, CXXFLAGS) +dnl +dnl tests for --with-cxxflags and pre-pends to CXXFLAGS +dnl +dnl +dnl @author Mike Heroux +dnl +AC_DEFUN([TAC_ARG_WITH_FLAGS], +[ +AC_MSG_CHECKING([whether additional [$2] flags should be added]) +AC_ARG_WITH($1, +AC_HELP_STRING([--with-$1], +[additional [$2] flags to be added: will prepend to [$2]]), +[ +$2="${withval} ${$2}" +AC_MSG_RESULT([$2 = ${$2}]) +], +AC_MSG_RESULT(no) +) +]) + diff --git a/tests/apps/miniFE/tests/basic/optional/ThreadPool/config/tac_arg_with_incdirs.m4 b/tests/apps/miniFE/tests/basic/optional/ThreadPool/config/tac_arg_with_incdirs.m4 new file mode 100644 index 0000000000..f3092e5eec --- /dev/null +++ b/tests/apps/miniFE/tests/basic/optional/ThreadPool/config/tac_arg_with_incdirs.m4 @@ -0,0 +1,24 @@ +dnl @synopsis TAC_ARG_WITH_INCDIRS +dnl +dnl Test for --with-incdirs="-Iincdir1 -Iincdir2". if defined, prepend +dnl "-Iincdir1 -Iincdir2" to CPPFLAGS +dnl +dnl Use this macro to facilitate addition of directories to include file search path. +dnl +dnl +dnl @author Mike Heroux +dnl +AC_DEFUN([TAC_ARG_WITH_INCDIRS], +[ +AC_MSG_CHECKING([whether additional include search paths defined]) +AC_ARG_WITH(incdirs, +AC_HELP_STRING([--with-incdirs], +[additional directories containing include files: will prepend to search here for includes, use -Idir format]), +[ +CPPFLAGS="${withval} ${CPPFLAGS}" +AC_MSG_RESULT([${withval}]) +], +AC_MSG_RESULT(no) +) +]) + diff --git a/tests/apps/miniFE/tests/basic/optional/ThreadPool/config/tac_arg_with_libdirs.m4 b/tests/apps/miniFE/tests/basic/optional/ThreadPool/config/tac_arg_with_libdirs.m4 new file mode 100644 index 0000000000..b2f94381d6 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/optional/ThreadPool/config/tac_arg_with_libdirs.m4 @@ -0,0 +1,24 @@ +dnl @synopsis TAC_ARG_WITH_LIBDIRS +dnl +dnl Test for --with-libdirs="-Llibdir1 -Llibdir2". if defined, +dnl prepend "-Llibdir1 -Llibdir2" to LDFLAGS +dnl +dnl Use this macro to facilitate addition of directories to library search path. +dnl +dnl +dnl @author Mike Heroux +dnl +AC_DEFUN([TAC_ARG_WITH_LIBDIRS], +[ +AC_MSG_CHECKING([whether additional library search paths defined]) +AC_ARG_WITH(libdirs, +AC_HELP_STRING([--with-libdirs], +[OBSOLETE use --with-ldflags instead. (ex. --with-ldflags="-L -L")]), +[ +LDFLAGS="${withval} ${LDFLAGS}" +AC_MSG_RESULT([${withval}]) +], +AC_MSG_RESULT(no) +) +]) + diff --git a/tests/apps/miniFE/tests/basic/optional/ThreadPool/config/tac_arg_with_libs.m4 b/tests/apps/miniFE/tests/basic/optional/ThreadPool/config/tac_arg_with_libs.m4 new file mode 100644 index 0000000000..3a648807f6 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/optional/ThreadPool/config/tac_arg_with_libs.m4 @@ -0,0 +1,30 @@ +dnl @synopsis TAC_ARG_WITH_LIBS +dnl +dnl Test for --with-libs="name(s)". +dnl +dnl Prepends the specified name(s) to the list of libraries to link +dnl with. +dnl +dnl Example use +dnl +dnl TAC_ARG_WITH_LIBS +dnl +dnl tests for --with-libs and pre-pends to LIBS +dnl +dnl @author Jim Willenbring +dnl +AC_DEFUN([TAC_ARG_WITH_LIBS], +[ +AC_MSG_CHECKING([whether additional libraries are needed]) +AC_ARG_WITH(libs, +AC_HELP_STRING([--with-libs], +[List additional libraries here. For example, --with-libs=-lsuperlu +or --with-libs=/path/libsuperlu.a]), +[ +LIBS="${withval} ${LIBS}" +AC_MSG_RESULT([LIBS = ${LIBS}]) +], +AC_MSG_RESULT(no) +) +] +) diff --git a/tests/apps/miniFE/tests/basic/optional/ThreadPool/config/tac_arg_with_perl.m4 b/tests/apps/miniFE/tests/basic/optional/ThreadPool/config/tac_arg_with_perl.m4 new file mode 100644 index 0000000000..63e74ba987 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/optional/ThreadPool/config/tac_arg_with_perl.m4 @@ -0,0 +1,34 @@ +dnl @synopsis TAC_ARG_WITH_PERL(DEFAULT_VAL) +dnl +dnl Test for --enable-gnumake and set to DEFAULT_VAL value if feature not specified. +dnl Calls AC_DEFINE to define HAVE_GNUMAKE if value is not equal to "no" +dnl Calls AM_CONDITIONAL to define USING_GNUMAKE to true/false. +dnl +dnl This file was based on tac_arg_with_ar.m4 by Mike Heroux +dnl @author Roger Pawlowski +dnl +AC_DEFUN([TAC_ARG_WITH_PERL], +[ + +AC_ARG_WITH(perl, +AC_HELP_STRING([--with-perl], [supply a perl executable. For example --with-perl=/usr/bin/perl.]), +[ +AC_MSG_CHECKING(for user supplied perl executable) +AC_MSG_RESULT([${withval}]) +USER_SPECIFIED_PERL=yes +PERL_EXE="${withval}" +], +[ +USER_SPECIFIED_PERL=no +]) + +if test "X${USER_SPECIFIED_PERL}" = "Xyes"; then + AC_CHECK_FILE(${PERL_EXE}, [HAVE_PERL=yes], [HAVE_PERL=no]) + AC_SUBST(PERL_EXE, ${PERL_EXE}) +else + AC_CHECK_PROG(HAVE_PERL, perl, yes, no) + AC_SUBST(PERL_EXE, perl) +fi +AM_CONDITIONAL(USING_PERL, test X${HAVE_PERL} = Xyes) +]) + diff --git a/tests/apps/miniFE/tests/basic/optional/ThreadPool/config/token-replace.pl b/tests/apps/miniFE/tests/basic/optional/ThreadPool/config/token-replace.pl new file mode 100755 index 0000000000..c3b413ec2a --- /dev/null +++ b/tests/apps/miniFE/tests/basic/optional/ThreadPool/config/token-replace.pl @@ -0,0 +1,43 @@ +#!/usr/bin/perl -w +# +# This perl script replaces a string with another string +# on a token basis. Here it is allowed for file_in and +# file_out to be the same file. +# +use strict; +# +my $g_use_msg = + "Use: token-replace.pl find_token replacement_token file_in file_out\n"; +if( scalar(@ARGV) < 4 ) { + print STDERR $g_use_msg; + exit(-1); +} +# +my $find_token = shift; +my $replacement_token = shift; +my $file_in_name = shift; +my $file_out_name = shift; +# +#print "file_in_name = $file_in_name\n"; +if($file_in_name=~/CVS/) { +# print "Do not replace in CVS\n"; + exit; +} +open FILE_IN, "<$file_in_name" || die "The file $file_in_name could not be opended for input\n"; +my @file_in_array = ; +close FILE_IN; +# +my $match_str = '([^\w\d_]|^)' . $find_token . '([^\w\d_]|$)'; +#print $match_str . "\n"; +# +my @file_out_array; +my $did_replacement = 0; +foreach(@file_in_array) { + $did_replacement = 1 if $_=~s/$match_str/$1$replacement_token$2/g; + push @file_out_array, $_; +} +if($did_replacement || $file_out_name ne $file_in_name) { + open FILE_OUT, ">$file_out_name" || die "The file $file_out_name could not be opended for output\n"; + print FILE_OUT @file_out_array; + close FILE_OUT; +} diff --git a/tests/apps/miniFE/tests/basic/optional/ThreadPool/configure.ac b/tests/apps/miniFE/tests/basic/optional/ThreadPool/configure.ac new file mode 100644 index 0000000000..12778f463e --- /dev/null +++ b/tests/apps/miniFE/tests/basic/optional/ThreadPool/configure.ac @@ -0,0 +1,240 @@ +# ------------------------------------------------------------------------ +# Process this file with autoconf to produce a configure script. +# ------------------------------------------------------------------------ + +# @HEADER +# ************************************************************************ +# +# ThreadPool Package +# Copyright (2008) Sandia Corporation +# +# Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +# license for use of this work by or on behalf of the U.S. Government. +# +# This library is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as +# published by the Free Software Foundation; either version 2.1 of the +# License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +# USA +# Questions? Contact Carter Edwards (hcedwar@sandia.gov) +# +# ************************************************************************ +# @HEADER + +# ------------------------------------------------------------------------ +# Initialization +# ------------------------------------------------------------------------ + +# This must be the first line in configure.ac. +# Optional 3rd argument is email address for bugs. + +# #np# - package name, version number, and e-mail address below +AC_INIT(ThreadPool, 1.1d, hcedwar@sandia.gov) + +# Hello World! +echo "----------------------------------------" +echo "Running ThreadPool Configure Script" +echo "----------------------------------------" + +# This is to protect against accidentally specifying the wrong +# directory with --srcdir. Any file in that directory will do, +# preferably one that is unlikely to be removed or renamed. + +AC_CONFIG_SRCDIR([src/TPI.c]) + +# Specify directory for auxillary build tools (e.g., install-sh, +# config.sub, config.guess) and M4 files. + +AC_CONFIG_AUX_DIR(config) +# #auto np# - Change file names in next line +# Configure should create src/ThreadPool_config.h from src/ThreadPool_config.h.in + +AM_CONFIG_HEADER(src/ThreadPool_config.h:src/ThreadPool_config.h.in) + +# Allow users to specify their own "install" command. If none is specified, +# the default is install-sh found in the config subdirectory. + +AC_ARG_WITH(install, + [AC_HELP_STRING([--with-install=INSTALL_PROGRAM], + [Use the installation program INSTALL_PROGRAM rather the default that is provided. For example --with-install="/path/install -p"])], + [ + INSTALL=$withval + INSTALL_PROGRAM=$withval + INSTALL_SCRIPT=$withval + INSTALL_DATA="$withval -m 644" + ],) + +# AM_MAINTAINER_MODE turns off maintainer-only makefile targets by +# default, and changes configure to understand a +# --enable-maintainer-mode option. --enable-maintainer-mode turns the +# maintainer-only targets back on. The maintainer-only makefile +# targets permit end users to clean automatically-generated files such +# as configure, which means they have to have autoconf and automake +# installed to repair the damage. AM_MAINTAINER_MODE makes it a bit +# harder for users to shoot themselves in the foot. + +AM_MAINTAINER_MODE + +# Define $build, $host, $target, etc + +AC_CANONICAL_TARGET + +# Use automake + +# - Required version of automake. +AM_INIT_AUTOMAKE(1.10 no-define tar-ustar) + +# Specify required version of autoconf. + +AC_PREREQ(2.61) + +# ------------------------------------------------------------------------ +# Check to see if MPI enabled and if any special configuration done +# ------------------------------------------------------------------------ + +TAC_ARG_CONFIG_MPI + +# #np# - can eliminate compiler checks below if your package does not use the +# language corresponding to the check. Please note that if you use +# F77_FUNC to determine Fortran name mangling, you should not remove +# the Fortran compiler check or the check for Fortran flags. Doing +# so will prevent the detection of the proper name mangling in some +# cases. +# ------------------------------------------------------------------------ +# Checks for programs +# ------------------------------------------------------------------------ + +AC_PROG_CC(cc gcc) +AC_PROG_CXX(CC g++ c++ cxx) +#AC_PROG_F77(f77 g77 gfortran f90 xlf90 f95) +AC_PROG_RANLIB + +# Check if --with-flags present, prepend any specs to FLAGS + +TAC_ARG_WITH_FLAGS(ccflags, CCFLAGS) +TAC_ARG_WITH_FLAGS(cxxflags, CXXFLAGS) +TAC_ARG_WITH_FLAGS(cflags, CFLAGS) +#TAC_ARG_WITH_FLAGS(fflags, FFLAGS) +TAC_ARG_WITH_LIBS +TAC_ARG_WITH_FLAGS(ldflags, LDFLAGS) + +# ------------------------------------------------------------------------ +# Alternate archiver +# ------------------------------------------------------------------------ + +TAC_ARG_WITH_AR + +# ------------------------------------------------------------------------ +# MPI link check +# ------------------------------------------------------------------------ +TAC_ARG_CHECK_MPI + +# ------------------------------------------------------------------------ +# Checks for Makefile.export related systems +# ------------------------------------------------------------------------ +TAC_ARG_ENABLE_EXPORT_MAKEFILES(yes) + +# ------------------------------------------------------------------------ +# Checks if tests and examples should be built +# ------------------------------------------------------------------------ + +# #np# - These options can disable the tests and examples of a package. +# #np# - Packages that do not have tests or examples should #-out the +# #np# - option(s) that does (do) not apply. + +TAC_ARG_ENABLE_FEATURE(tests, [Make tests for all Trilinos packages buildable with 'make tests'], TESTS, yes) +TAC_ARG_ENABLE_FEATURE_SUB_CHECK( threadpool, tests, [Make ThreadPool tests buildable with 'make tests'], NEW_PACKAGE_TESTS) +AM_CONDITIONAL(BUILD_TESTS, test "X$ac_cv_use_threadpool_tests" != "Xno") + +#TAC_ARG_ENABLE_FEATURE(examples, [Make examples for all Trilinos packages buildable with 'make examples'], EXAMPLES, yes) +#TAC_ARG_ENABLE_FEATURE_SUB_CHECK( new_package, examples, [Make New_Package examples buildable with 'make examples'], NEW_PACKAGE_EXAMPLES) +#AM_CONDITIONAL(BUILD_EXAMPLES, test "X$ac_cv_use_new_package_examples" != "Xno") + +#We now build tests and examples through separate make targets, rather than +#during "make". We still need to conditionally include the test and example +#in SUBDIRS, even though SUB_TEST and SUB_EXAMPLE will never be +#defined, so that the tests and examples are included in the distribution +#tarball. +AM_CONDITIONAL(SUB_TEST, test "X$ac_cv_use_sub_test" = "Xyes") +#AM_CONDITIONAL(SUB_EXAMPLE, test "X$ac_cv_use_sub_example" = "Xyes") + +TAC_ARG_ENABLE_FEATURE(libcheck, [Check for some third-party libraries. (Cannot be disabled unless tests and examples are also disabled.)], LIBCHECK, yes) + +# ------------------------------------------------------------------------ +# Specify other directories +# ------------------------------------------------------------------------ + +# enable use of --with-libdirs="-Llibdir1 -Llibdir2 ..." to prepend to LDFLAGS +TAC_ARG_WITH_LIBDIRS +# enable use of --with-incdirs="-Lincdir1 -Lincdir2 ..." to prepend to CPPFLAGS +TAC_ARG_WITH_INCDIRS + +# #np# - Yet another opportunity to remove code if you aren't +# using Fortran +# Define F77_FUNC that will be used to link with Fortran subroutines. - trash WORKGXX +#AC_F77_WRAPPERS + +# ------------------------------------------------------------------------ +# Checks for libraries +# ------------------------------------------------------------------------ + +# If tests, examples and libcheck are disabled, we don't have to check +# for these libraries. + +# #np# - +# If a package does not have tests or examples, the corresponding check(s) +# should be pulled out of the "if" statement below. +#if test "X$ac_cv_use_new_package_examples" != "Xno" || test "X$ac_cv_use_libcheck" != "Xno"; then +if test "X$ac_cv_use_threadpool_tests" != "Xno" || test "X$ac_cv_use_libcheck" != "Xno"; then + +ACX_PTHREAD +LIBS="$PTHREAD_LIBS $LIBS" +CFLAGS="$CFLAGS $PTHREAD_CFLAGS" +CC="$PTHREAD_CC" + +fi +# end of the list of libraries that don't need to be checked for if +# tests and examples are disabled. + +# ------------------------------------------------------------------------ +# Checks for linker characteristics +# ------------------------------------------------------------------------ + +# Determine libraries needed for linking with Fortran +#AC_F77_LIBRARY_LDFLAGS + + +# ------------------------------------------------------------------------ +# Perform substitutions in output files +# ------------------------------------------------------------------------ + +AC_SUBST(ac_aux_dir) + +# ------------------------------------------------------------------------ +# Output files +# ------------------------------------------------------------------------ +## +# You will need to change AC_CONFIG_FILES below and Makefile.am +# to add a new directory. +AC_CONFIG_FILES([ + Makefile + Makefile.export.threadpool + src/Makefile + test/Makefile + ]) + +AC_OUTPUT() + +# Bye World! +echo "---------------------------------------------" +echo "Finished Running ThreadPool Configure Script" +echo "---------------------------------------------" diff --git a/tests/apps/miniFE/tests/basic/optional/ThreadPool/src/CMakeLists.txt b/tests/apps/miniFE/tests/basic/optional/ThreadPool/src/CMakeLists.txt new file mode 100644 index 0000000000..41a1f398f7 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/optional/ThreadPool/src/CMakeLists.txt @@ -0,0 +1,70 @@ + +INCLUDE(PackageLibraryMacros) + +# +# A) Package-specific configuration options +# + +PACKAGE_CONFIGURE_FILE(${PACKAGE_NAME}_config.h) + +# +# B) Define the header and source files (and directories) +# + +# +# src +# + +SET(HEADERS "") +SET(SOURCES "") + +INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) + +SET(HEADERS ${HEADERS} + ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}_config.h + ) + +# +# Core files +# + +INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) + +APPEND_SET(HEADERS + TPI.h + TPI.hpp + ) + +APPEND_SET(SOURCES + TPI.c + ) + +# +# Util files +# +APPEND_SET(SOURCES + TPI_Walltime.c + ) + +###################################### + +APPEND_SET(HEADERS + ) + +APPEND_SET(SOURCES + ) + +###################################### +IF (TPL_ENABLE_MPI) +ENDIF() + +# +# C) Define the targets for package's library(s) +# + +PACKAGE_ADD_LIBRARY( + tpi + HEADERS ${HEADERS} + SOURCES ${SOURCES} + ) diff --git a/tests/apps/miniFE/tests/basic/optional/ThreadPool/src/Makefile.am b/tests/apps/miniFE/tests/basic/optional/ThreadPool/src/Makefile.am new file mode 100644 index 0000000000..44c1621473 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/optional/ThreadPool/src/Makefile.am @@ -0,0 +1,140 @@ +# @HEADER +# ************************************************************************ +# +# ThreadPool Package +# Copyright (2008) Sandia Corporation +# +# Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +# license for use of this work by or on behalf of the U.S. Government. +# +# This library is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as +# published by the Free Software Foundation; either version 2.1 of the +# License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +# USA +# Questions? Contact Carter Edwards (hcedwar@sandia.gov) +# +# ************************************************************************ +# @HEADER + +# The following line helps the test harness recover from build errors. + +all-local: + @echo "" + @echo "Trilinos package ThreadPool subdirectory src built successfully." + @echo "" + +# ------------------------------------------------------------------------ +# For each category, create two variables - NAME and NAME_H. The +# second is the list of headers to be installed, i.e., any header that +# might someday be needed by some other code outside New_Package. The first is +# the list of all source and any other header files. +# ------------------------------------------------------------------------ + +#np# Make sure to list all source files in one of the following categories. + +CORE = $(srcdir)/TPI.c + +CORE_H = \ + $(srcdir)/TPI.h \ + $(srcdir)/TPI.hpp + +UTIL = \ + $(srcdir)/TPI_Walltime.c + + +# ------------------------------------------------------------------------ +# ThreadPool library specifications +# ------------------------------------------------------------------------ +#np# replace new_package with the name of the package being autotool'ed here +THREADPOOL_LIB = libtpi.a + +#np# replace new_package with the name of the package being autotool'ed here +THREADPOOL_H = \ + $(CORE_H) + +#np# replace new_package with the name of the package being autotool'ed here +libtpi_a_SOURCES = \ + $(CORE) \ + $(UTIL) + +#np# replace new_package with the name of the package being autotool'ed here +#EXTRA_libtpi_a_SOURCES = + +include $(top_builddir)/Makefile.export.threadpool + +if USING_GNUMAKE +EXPORT_INCLUDES = $(shell $(PERL_EXE) $(top_srcdir)/config/strip_dup_incl_paths.pl $(THREADPOOL_INCLUDES)) +else +EXPORT_INCLUDES = $(THREADPOOL_INCLUDES) +endif + +AM_CPPFLAGS = $(EXPORT_INCLUDES) + +# ------------------------------------------------------------------------ +# For using a special archiver +# ------------------------------------------------------------------------ + +if USE_ALTERNATE_AR + +libtpi_a_AR = $(ALTERNATE_AR) +else + +libtpi_a_AR = $(AR) cru + +endif + +# ------------------------------------------------------------------------ +# Some C++ compilers create extra .o-files for templates. We need to +# be sure to include these, and this is the hack to do it. +# ------------------------------------------------------------------------ + +libtpi_a_LIBADD = $(XTRALDADD) + +# ------------------------------------------------------------------------ +# List of all libraries to install in $(libexecdir) +# ------------------------------------------------------------------------ + +lib_LIBRARIES = $(THREADPOOL_LIB) + +# ------------------------------------------------------------------------ +# List of all headers to install in $(includedir) +# ------------------------------------------------------------------------ + +#np# replace new_package with the name of the package being autotool'ed here +include_HEADERS = $(THREADPOOL_H) + +# ------------------------------------------------------------------------ +# Special stuff to install in our special $(execincludedir) +# ------------------------------------------------------------------------ + +# SPECIAL NOTE: New_Package_config.h is a machine-dependent file, so we need +# to install it in the machine-dependent directory. However, that is +# not a default installation directory, so we had to create it +# special. + +# All Trilinos headers are now installed in the same directory +execincludedir = $(includedir) +#np# replace new_package with the name of the package being autotool'ed here +nodist_execinclude_HEADERS = ThreadPool_config.h + +# ------------------------------------------------------------------------ +# Files to be deleted by 'make maintainer-clean' +# ------------------------------------------------------------------------ + +MAINTAINERCLEANFILES = Makefile.in + + + + + + diff --git a/tests/apps/miniFE/tests/basic/optional/ThreadPool/src/TPI.c b/tests/apps/miniFE/tests/basic/optional/ThreadPool/src/TPI.c new file mode 100644 index 0000000000..f2b1566ce0 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/optional/ThreadPool/src/TPI.c @@ -0,0 +1,1016 @@ +/*------------------------------------------------------------------------*/ +/* TPI: Thread Pool Interface */ +/* Copyright (2008) Sandia Corporation */ +/* */ +/* Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive */ +/* license for use of this work by or on behalf of the U.S. Government. */ +/* */ +/* This library is free software; you can redistribute it and/or modify */ +/* it under the terms of the GNU Lesser General Public License as */ +/* published by the Free Software Foundation; either version 2.1 of the */ +/* License, or (at your option) any later version. */ +/* */ +/* This library is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU */ +/* Lesser General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU Lesser General Public */ +/* License along with this library; if not, write to the Free Software */ +/* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 */ +/* USA */ +/*------------------------------------------------------------------------*/ +/** + * @author H. Carter Edwards + */ + +/*--------------------------------------------------------------------*/ + +#include +#include +#include +#include + +/*--------------------------------------------------------------------*/ +/*----------- PTHREAD CONFIGURATION (BEGIN) --------------------------*/ +/*--------------------------------------------------------------------*/ + +#if defined( HAVE_PTHREAD ) + +#include +#include +#include + +/*--------------------------------------------------------------------*/ +/*---------------- COMPILER SPECIFICS (BEGIN) ------------------------*/ +/*--------------------------------------------------------------------*/ + +/* Performance is heavily impacted by an + * atomic decrement of the work counter. + * Optimize this if at all possible. + */ + +#if defined( __INTEL_COMPILER ) + +#define THREADPOOL_CONFIG "PTHREAD SCHED_YIELD" + +#elif defined( __linux__ ) && \ + defined( __GNUC__ ) && ( 4 <= __GNUC__ ) + +#define THREADPOOL_CONFIG "PTHREAD SCHED_YIELD ATOMIC_SYNC" + +#define atomic_fetch_and_decrement( VALUE_PTR ) \ + __sync_fetch_and_sub( VALUE_PTR , 1 ) + +#else + +#define THREADPOOL_CONFIG "PTHREAD SCHED_YIELD" + +#endif + +#if ! defined( atomic_fetch_and_decrement ) + +static int atomic_fetch_and_decrement( volatile int * value ) +{ + static pthread_mutex_t atomic_lock = PTHREAD_MUTEX_INITIALIZER ; + int result ; + while ( EBUSY == pthread_mutex_trylock( & atomic_lock ) ); + result = ( *value )-- ; + pthread_mutex_unlock( & atomic_lock ); + return result ; +} + +#endif + +/*--------------------------------------------------------------------*/ +/*---------------- COMPILER SPECIFICS (END) --------------------------*/ +/*--------------------------------------------------------------------*/ + +typedef pthread_mutex_t local_lock_type ; + +#else /* ! defined( HAVE_PTHREAD ) */ + +#define THREADPOOL_CONFIG "NO THREADING" + +typedef int local_lock_type ; + +#endif + +/*--------------------------------------------------------------------*/ +/*----------- PTHREAD CONFIGURATION (END) ----------------------------*/ +/*--------------------------------------------------------------------*/ + +const char * TPI_Version() +{ + static const char version_string[] = + "TPI Version 1.1 , November 2009 , Configuration = " THREADPOOL_CONFIG ; + + return version_string ; +} + +/*--------------------------------------------------------------------*/ + +enum { THREAD_COUNT_MAX = 256 }; +enum { LOCK_COUNT_MAX = 32 }; + +struct ThreadPool_Data ; + +typedef struct Thread_Data { + struct Thread_Data * m_thread_fan ; /* Fan-in / fan-out begin */ + void * m_reduce ; /* Reduction memory */ + long m_rank ; + long m_barrier_wait_max ; + long m_barrier_wait_total ; + long m_barrier_wait_count ; + volatile long m_control ; +} Thread ; + +typedef struct ThreadPool_Data { + TPI_work_subprogram m_work_routine ; + const void * m_work_info ; + TPI_reduce_join m_reduce_join ; + TPI_reduce_init m_reduce_init ; + unsigned char * m_reduce_alloc ; + int m_reduce_alloc_size ; + int m_thread_count ; + int m_lock_init ; + int m_lock_count ; + int m_work_thread_count ; + int m_work_count ; + int m_work_count_claim ; + + Thread m_thread[ THREAD_COUNT_MAX ]; + local_lock_type m_lock[ LOCK_COUNT_MAX ]; +} ThreadPool ; + + +static ThreadPool thread_pool = +{ + /* m_work_routine */ NULL , + /* m_work_info */ NULL , + /* m_reduce_join */ NULL , + /* m_reduce_init */ NULL , + /* m_reduce_alloc */ NULL , + /* m_reduce_alloc_size */ 0 , + /* m_thread_count */ 0 , + /* m_lock_init */ 0 , + /* m_lock_count */ 0 , + /* m_work_thread_count */ 0 , + /* m_work_count */ 0 , + /* m_work_count_claim */ 0 +}; + +/*--------------------------------------------------------------------*/ +/*--------------------------------------------------------------------*/ + +#if defined( HAVE_PTHREAD ) + +/*--------------------------------------------------------------------*/ +/*--------------------------------------------------------------------*/ + +int TPI_Lock( int i ) +{ + int result = i < 0 || thread_pool.m_lock_count <= i ? TPI_ERROR_SIZE : 0 ; + + if ( ! result ) { + pthread_mutex_t * const lock = thread_pool.m_lock + i ; + + while ( EBUSY == ( result = pthread_mutex_trylock( lock ) ) ); + + if ( result ) { result = TPI_ERROR_LOCK ; } + } + return result ; +} + +int TPI_Unlock( int i ) +{ + int result = i < 0 || thread_pool.m_lock_count <= i ? TPI_ERROR_SIZE : 0 ; + + if ( ! result && pthread_mutex_unlock( thread_pool.m_lock + i ) ) { + result = TPI_ERROR_LOCK ; + } + + return result ; +} + +static int local_set_lock_count( const int lock_count ) +{ + int result = lock_count < 0 || LOCK_COUNT_MAX < lock_count + ? TPI_ERROR_SIZE : 0 ; + + while ( ! result && thread_pool.m_lock_init < lock_count ) { + + pthread_mutex_t * const lock = thread_pool.m_lock + + thread_pool.m_lock_init ; + + if ( pthread_mutex_init( lock , NULL ) ) { + result = TPI_ERROR_INTERNAL ; + } + else { + ++( thread_pool.m_lock_init ); + } + } + + return result ; +} + +static void local_destroy_locks() +{ + while ( thread_pool.m_lock_init ) { + --( thread_pool.m_lock_init ); + pthread_mutex_destroy( thread_pool.m_lock + thread_pool.m_lock_init ); + } +} + +/*--------------------------------------------------------------------*/ +/*--------------------------------------------------------------------*/ +/* Run work if any, then wait for child threads to block. */ + +static void local_run( Thread * const this_thread , void * reduce ) +{ + struct TPI_Work_Struct work ; + + work.info = thread_pool.m_work_info ; + work.reduce = reduce ; + work.count = thread_pool.m_work_count ; + work.lock_count = thread_pool.m_lock_count ; + + if ( work.count <= thread_pool.m_work_thread_count ) { + + work.rank = ( thread_pool.m_thread_count - 1 ) - this_thread->m_rank ; + + if ( work.rank < work.count ) { + (*thread_pool.m_work_routine)( & work ); + } + } + else { + + int * const claim = & thread_pool.m_work_count_claim ; + + while ( 0 < ( work.rank = atomic_fetch_and_decrement( claim ))) { + + work.rank = work.count - work.rank ; + + (*thread_pool.m_work_routine)( & work ); + } + } +} + +static int wait_thread( volatile long * const control , const int val ) +{ + int count = 0 ; + while ( val == *control ) { + sched_yield(); + ++count ; + } + return count ; +} + +static void local_barrier_wait( Thread * const this_thread , + Thread * const thread ) +{ + const long count = wait_thread( & thread->m_control , 1 ); + + ++( this_thread->m_barrier_wait_count ); + + this_thread->m_barrier_wait_total += count ; + + if ( this_thread->m_barrier_wait_max < count ) { + this_thread->m_barrier_wait_max = count ; + } +} + +static void local_barrier( Thread * const this_thread ) +{ + Thread * const thread_beg = this_thread[0].m_thread_fan ; + Thread * thread = this_thread[1].m_thread_fan ; + + if ( ! thread_pool.m_work_routine ) { + while ( thread_beg < thread ) { + --thread ; local_barrier_wait( this_thread , thread ); + } + } + else if ( ! thread_pool.m_reduce_join ) { + + local_run( this_thread , NULL ); + + while ( thread_beg < thread ) { + --thread ; local_barrier_wait( this_thread , thread ); + } + } + else { + + /* Work data for the reduction initialization and join */ + + struct TPI_Work_Struct work ; + + work.info = thread_pool.m_work_info ; + work.reduce = this_thread->m_reduce ; + work.count = -1 ; + work.rank = -1 ; + work.lock_count = -1 ; + + /* Initialize reduction value for non-root thread */ + + if ( this_thread->m_rank ) { (*thread_pool.m_reduce_init)( & work ); } + + /* Run the work routine with barrier blocking */ + + local_run( this_thread , work.reduce ); + + /* Reduction of thread's contributions */ + + while ( thread_beg < thread ) { + --thread ; local_barrier_wait( this_thread , thread ); + (*thread_pool.m_reduce_join)( & work , thread->m_reduce ); + } + } +} + +/*--------------------------------------------------------------------*/ +/* The driver given to 'pthread_create'. + * Run work until told to terminate. + */ +static void * local_driver( void * arg ) +{ + Thread * const this_thread = (Thread *) arg ; + + do { + /* Wait for my subtree of threads to complete */ + local_barrier( this_thread ); + + this_thread->m_control = 0 ; + + /* Spin until I am activated. */ + wait_thread( & this_thread->m_control , 0 ); + + } while ( thread_pool.m_work_routine ); + + local_barrier( this_thread ); /* Termination barrier */ + + this_thread->m_control = 0 ; + + return NULL ; +} + +/*--------------------------------------------------------------------*/ +/*--------------------------------------------------------------------*/ + +static void alloc_reduce( int reduce_size ) +{ + const int alloc_count = thread_pool.m_thread_count - 1 ; + + if ( thread_pool.m_reduce_alloc_size < alloc_count * reduce_size ) { + + const int grain_shift = 8 ; /* grain_size = 0x80 */ + const int grain_size = 1 << grain_shift ; /* Byte grain size */ + const int grain_count = ( reduce_size + grain_size - 1 ) >> grain_shift ; + const int reduce_grain = grain_size * grain_count ; + const int alloc_size = alloc_count * reduce_grain ; + + int i ; + + if ( thread_pool.m_reduce_alloc ) { + thread_pool.m_reduce_alloc = + (unsigned char *) realloc( thread_pool.m_reduce_alloc , alloc_size ); + } + else { + thread_pool.m_reduce_alloc = (unsigned char *) malloc( alloc_size ); + } + + thread_pool.m_reduce_alloc_size = alloc_size ; + + for ( i = 0 ; i < alloc_count ; ++i ) { + thread_pool.m_thread[i+1].m_reduce = + thread_pool.m_reduce_alloc + reduce_grain * i ; + } + } +} + +static int local_start( + int work_thread_count , + TPI_work_subprogram work_subprogram , + const void * work_info , + int work_count , + int lock_count , + TPI_reduce_join reduce_join , + TPI_reduce_init reduce_init , + int reduce_size , + void * reduce_data ) +{ + const int result = lock_count ? local_set_lock_count( lock_count ) : 0 ; + + if ( ! result ) { + + thread_pool.m_work_routine = work_subprogram ; + thread_pool.m_work_info = work_info ; + thread_pool.m_work_count = work_count ; + thread_pool.m_lock_count = lock_count ; + thread_pool.m_thread->m_reduce = reduce_data ; + + if ( 1 < thread_pool.m_thread_count ) { + + if ( reduce_size ) { alloc_reduce( reduce_size ); } + + thread_pool.m_reduce_join = reduce_join ; + thread_pool.m_reduce_init = reduce_init ; + thread_pool.m_work_thread_count = work_thread_count ; + thread_pool.m_work_count_claim = work_count ; + + /* Activate the spinning worker threads */ + { + Thread * const thread_beg = thread_pool.m_thread + 1 ; + Thread * thread = thread_pool.m_thread + + thread_pool.m_thread_count ; + + while ( thread_beg < thread ) { (--thread)->m_control = 1 ; } + } + } + } + + return result ; +} + +static void local_wait() +{ + if ( 1 < thread_pool.m_thread_count ) { + + local_barrier( thread_pool.m_thread ); + + thread_pool.m_reduce_join = NULL ; + thread_pool.m_reduce_init = NULL ; + thread_pool.m_work_thread_count = 0 ; + thread_pool.m_work_count_claim = 0 ; + } + else { + struct TPI_Work_Struct w = { NULL , NULL , 0 , 0 , 0 }; + + w.info = thread_pool.m_work_info ; + w.count = thread_pool.m_work_count ; + w.lock_count = thread_pool.m_lock_count ; + w.reduce = thread_pool.m_thread->m_reduce ; + + for ( w.rank = 0 ; w.rank < w.count ; ++( w.rank ) ) { + (* thread_pool.m_work_routine )( & w ); + } + } + + thread_pool.m_work_routine = NULL ; + thread_pool.m_work_info = NULL ; + thread_pool.m_work_count = 0 ; + thread_pool.m_lock_count = 0 ; + thread_pool.m_thread->m_reduce = NULL ; +} + +/*--------------------------------------------------------------------*/ +/*--------------------------------------------------------------------*/ + +int TPI_Init( int n ) +{ + int result = thread_pool.m_thread_count ? TPI_ERROR_ACTIVE : 0 ; + + if ( ! result && ( n < 1 || THREAD_COUNT_MAX + 1 <= n ) ) { + result = TPI_ERROR_SIZE ; + } + + if ( ! result ) { + pthread_attr_t attr ; + + if ( pthread_attr_init( & attr ) + || pthread_attr_setscope( & attr, PTHREAD_SCOPE_SYSTEM ) + || pthread_attr_setdetachstate( & attr, PTHREAD_CREATE_DETACHED ) ) { + result = TPI_ERROR_INTERNAL ; + } + + if ( ! result ) { + int thread_rank = 0 ; + int count = 1 ; + + /* Initialize one lock for blocking and unblocking */ + + local_set_lock_count( 1 ); + + /* Initialize threads with fan-in / fan-out span of threads */ + + for ( thread_rank = 0 ; thread_rank <= n ; ++thread_rank ) { + Thread * const thread = thread_pool.m_thread + thread_rank ; + + thread->m_thread_fan = thread_pool.m_thread + count ; + thread->m_reduce = NULL ; + thread->m_rank = thread_rank ; + thread->m_barrier_wait_max = 0 ; + thread->m_barrier_wait_total = 0 ; + thread->m_barrier_wait_count = 0 ; + thread->m_control = 1 ; + + { + int up = 1 ; + while ( up <= thread_rank ) { up <<= 1 ; } + while ( thread_rank + up < n ) { up <<= 1 ; ++count ; } + } + } + + thread_pool.m_thread_count = n ; + + /* Create threads last-to-first for start up fan-in barrier */ + + for ( thread_rank = n ; ! result && 1 < thread_rank ; ) { + Thread * const thread = thread_pool.m_thread + --thread_rank ; + + pthread_t pt ; + + if ( pthread_create( & pt, & attr, & local_driver, thread ) ) { + thread->m_control = 0 ; + result = TPI_ERROR_INTERNAL ; + } + } + + /* If a thread-spawn failed, terminate the created threads */ + + if ( result ) { + while ( thread_rank < --( thread_pool.m_thread_count ) ) { + Thread * thread = thread_pool.m_thread + thread_pool.m_thread_count ; + wait_thread( & thread->m_control , 1 ); /* Wait for blocking */ + thread->m_control = 1 ; /* Reactivate thread */ + wait_thread( & thread->m_control , 1 ); /* Wait for termination */ + } + thread_pool.m_thread_count = 0 ; + } + + pthread_attr_destroy( & attr ); + } + } + + if ( ! result ) { + local_barrier( thread_pool.m_thread ); + result = n ; + } + + return result ; +} + +/*--------------------------------------------------------------------*/ + +int TPI_Finalize() +{ + static int print_statistics = 0 ; + + int result ; + + result = NULL != thread_pool.m_work_routine ? TPI_ERROR_ACTIVE : 0 ; + + if ( ! result ) { + + /* Wake up threads then wait for them to terminate */ + local_start( 0 , NULL , NULL , 0 , + 0 , NULL , NULL , 0 , NULL ); + + local_wait(); + + if ( print_statistics ) { + int i = 0 ; + for ( ; i < thread_pool.m_thread_count ; ++i ) { + if ( thread_pool.m_thread[i].m_barrier_wait_count ) { + long mean = ( thread_pool.m_thread[i].m_barrier_wait_total + 0.5 ) / + thread_pool.m_thread[i].m_barrier_wait_count ; + fprintf(stdout,"Thread[%d] barrier_wait( max %ld , mean %ld )\n", i , + thread_pool.m_thread[i].m_barrier_wait_max , mean ); + } + } + } + + thread_pool.m_thread_count = 0 ; + + local_destroy_locks(); + + if ( thread_pool.m_reduce_alloc ) { + free( thread_pool.m_reduce_alloc ); + thread_pool.m_reduce_alloc = NULL ; + thread_pool.m_reduce_alloc_size = 0 ; + } + } + + return result ; +} + +/*--------------------------------------------------------------------*/ +/*--------------------------------------------------------------------*/ + +static void local_block( TPI_Work * work ) +{ + if ( work->rank ) { + pthread_mutex_lock( thread_pool.m_lock ); + pthread_mutex_unlock( thread_pool.m_lock ); + } +} + +int TPI_Block() +{ + const int result = + NULL != thread_pool.m_work_routine ? TPI_ERROR_ACTIVE : ( + pthread_mutex_lock( thread_pool.m_lock ) ? TPI_ERROR_INTERNAL : + + local_start( thread_pool.m_thread_count , + local_block , NULL , + thread_pool.m_thread_count , + 0 /* lock_count */ , + NULL , NULL , 0 , NULL ) ); + + return result ; +} + +int TPI_Unblock() +{ + const int result = + local_block != thread_pool.m_work_routine ? TPI_ERROR_ACTIVE : ( + pthread_mutex_unlock( thread_pool.m_lock ) ? TPI_ERROR_INTERNAL : 0 ); + + if ( ! result ) { local_wait(); } + + return result ; +} + +int TPI_Isblocked() +{ + return local_block == thread_pool.m_work_routine ; +} + +/*--------------------------------------------------------------------*/ +/*--------------------------------------------------------------------*/ + +#else /* ! defined( HAVE_PTHREAD ) */ + +/*--------------------------------------------------------------------*/ +/*--------------------------------------------------------------------*/ + +int TPI_Lock( int i ) +{ + int result = i < 0 || thread_pool.m_lock_count <= i ? TPI_ERROR_SIZE : 0 ; + + if ( ! result ) { + if ( 0 != thread_pool.m_lock[i] ) { + result = TPI_ERROR_LOCK ; + } + else { + thread_pool.m_lock[i] = 1 ; + } + } + return result ; +} + +int TPI_Unlock( int i ) +{ + int result = i < 0 || thread_pool.m_lock_count <= i ? TPI_ERROR_SIZE : 0 ; + + if ( ! result ) { + if ( 0 == thread_pool.m_lock[i] ) { + result = TPI_ERROR_LOCK ; + } + else { + thread_pool.m_lock[i] = 0 ; + } + } + return result ; +} + +static int local_set_lock_count( const int lock_count ) +{ + int result = lock_count < 0 || LOCK_COUNT_MAX < lock_count + ? TPI_ERROR_SIZE : 0 ; + + while ( thread_pool.m_lock_init < lock_count ) { + + thread_pool.m_lock[ thread_pool.m_lock_init ] = 0 ; + + ++( thread_pool.m_lock_init ); + } + + return result ; +} + +/*--------------------------------------------------------------------*/ + +static int local_start( + int work_thread_count , + TPI_work_subprogram work_subprogram , + const void * work_info , + int work_count , + int lock_count , + TPI_reduce_join reduce_join , + TPI_reduce_init reduce_init , + int reduce_size , + void * reduce_data ) +{ + const int result = lock_count ? local_set_lock_count( lock_count ) : 0 ; + + if ( ! result ) { + thread_pool.m_work_routine = work_subprogram ; + thread_pool.m_work_info = work_info ; + thread_pool.m_work_count = work_count ; + thread_pool.m_lock_count = lock_count ; + thread_pool.m_thread->m_reduce = reduce_data ; + } + + return result ; +} + +static void local_wait() +{ + struct TPI_Work_Struct w = { NULL , NULL , 0 , 0 , 0 }; + + w.info = thread_pool.m_work_info ; + w.count = thread_pool.m_work_count ; + w.lock_count = thread_pool.m_lock_count ; + w.reduce = thread_pool.m_thread->m_reduce ; + + for ( w.rank = 0 ; w.rank < w.count ; ++( w.rank ) ) { + (* thread_pool.m_work_routine )( & w ); + } + + thread_pool.m_work_routine = NULL ; + thread_pool.m_work_info = NULL ; + thread_pool.m_work_count = 0 ; + thread_pool.m_lock_count = 0 ; + thread_pool.m_thread->m_reduce = NULL ; +} + +/*--------------------------------------------------------------------*/ + +static void local_block( TPI_Work * work ) {} + +int TPI_Block() +{ + const int result = + NULL != thread_pool.m_work_routine ? TPI_ERROR_ACTIVE : + + local_start( thread_pool.m_thread_count , + local_block , NULL , + thread_pool.m_thread_count , + 0 /* lock_count */ , + NULL , NULL , 0 , NULL ) ; + + return result ; +} + +int TPI_Unblock() +{ + const int result = + local_block != thread_pool.m_work_routine ? TPI_ERROR_ACTIVE : 0 ; + + if ( ! result ) { local_wait(); } + + return result ; +} + +int TPI_Isblocked() +{ + return local_block == thread_pool.m_work_routine ; +} + +/*--------------------------------------------------------------------*/ + +int TPI_Init( int n ) +{ + int result = thread_pool.m_thread_count ? TPI_ERROR_ACTIVE : 0 ; + + if ( ! result && ( n < 1 || THREAD_COUNT_MAX + 1 <= n ) ) { + result = TPI_ERROR_SIZE ; + } + else { + Thread * const thread = thread_pool.m_thread ; + + thread->m_thread_fan = NULL ; + thread->m_reduce = NULL ; + thread->m_rank = 0 ; + thread->m_barrier_wait_max = 0 ; + thread->m_barrier_wait_total = 0 ; + thread->m_barrier_wait_count = 0 ; + thread->m_control = 1 ; + + thread_pool.m_thread_count = result = n ; + + /* Initialize one lock for blocking and unblocking */ + + local_set_lock_count( 1 ); + } + + return result ; +} + +/*--------------------------------------------------------------------*/ + +int TPI_Finalize() +{ + int result = NULL != thread_pool.m_work_routine ? TPI_ERROR_ACTIVE : 0 ; + + if ( ! result ) { + thread_pool.m_thread_count = 0 ; + thread_pool.m_lock_init = 0 ; + } + + return result ; +} + +/*--------------------------------------------------------------------*/ +/*--------------------------------------------------------------------*/ + +#endif + +/*--------------------------------------------------------------------*/ +/*--------------------------------------------------------------------*/ + +int TPI_Wait() +{ + const int result = + ( NULL == thread_pool.m_work_routine || + local_block == thread_pool.m_work_routine ) ? TPI_ERROR_ACTIVE : 0 ; + + if ( ! result ) { local_wait(); } + + return result ; +} + +int TPI_Start( TPI_work_subprogram work_subprogram , + const void * work_info , + int work_count , + int lock_count ) +{ + const int result = + NULL != thread_pool.m_work_routine ? TPI_ERROR_ACTIVE : ( + NULL == work_subprogram ? TPI_ERROR_NULL : ( + work_count < 0 ? TPI_ERROR_SIZE : + local_start( thread_pool.m_thread_count - 1 , + work_subprogram , work_info , work_count , lock_count , + NULL , NULL , 0 , NULL ) ) ); + + return result ; +} + +int TPI_Run( TPI_work_subprogram work_subprogram , + const void * work_info , + int work_count , + int lock_count ) +{ + const int result = + NULL != thread_pool.m_work_routine ? TPI_ERROR_ACTIVE : ( + NULL == work_subprogram ? TPI_ERROR_NULL : ( + work_count < 0 ? TPI_ERROR_SIZE : + local_start( thread_pool.m_thread_count , + work_subprogram , work_info , work_count , lock_count , + NULL , NULL , 0 , NULL ) ) ); + + if ( ! result ) { local_wait(); } + + return result ; +} + +int TPI_Run_threads( TPI_work_subprogram work_subprogram , + const void * work_info , + int lock_count ) +{ + const int work_count = 0 < thread_pool.m_thread_count ? + thread_pool.m_thread_count : 1 ; + + const int result = + NULL != thread_pool.m_work_routine ? TPI_ERROR_ACTIVE : ( + NULL == work_subprogram ? TPI_ERROR_NULL : ( + local_start( thread_pool.m_thread_count , + work_subprogram , work_info , work_count , lock_count , + NULL , NULL , 0 , NULL ) ) ); + + if ( ! result ) { local_wait(); } + + return result ; +} + +int TPI_Start_threads( TPI_work_subprogram work_subprogram , + const void * work_info , + int lock_count ) +{ + const int work_count = 1 < thread_pool.m_thread_count ? + thread_pool.m_thread_count - 1 : 1 ; + + const int result = + NULL != thread_pool.m_work_routine ? TPI_ERROR_ACTIVE : ( + NULL == work_subprogram ? TPI_ERROR_NULL : ( + local_start( thread_pool.m_thread_count - 1 , + work_subprogram , work_info , work_count , lock_count , + NULL , NULL , 0 , NULL ) ) ); + + if ( ! result ) { local_wait(); } + + return result ; +} + +/*--------------------------------------------------------------------*/ +/*--------------------------------------------------------------------*/ + +int TPI_Run_reduce( TPI_work_subprogram work_subprogram , + const void * work_info , + int work_count , + TPI_reduce_join reduce_join , + TPI_reduce_init reduce_init , + int reduce_size , + void * reduce_data ) +{ + const int lock_count = 0 ; + + const int result = + NULL != thread_pool.m_work_routine ? TPI_ERROR_ACTIVE : ( + NULL == work_subprogram ? TPI_ERROR_NULL : ( + NULL == reduce_join ? TPI_ERROR_NULL : ( + NULL == reduce_init ? TPI_ERROR_NULL : ( + NULL == reduce_data ? TPI_ERROR_NULL : ( + work_count <= 0 ? TPI_ERROR_SIZE : ( + reduce_size <= 0 ? TPI_ERROR_SIZE : + + local_start( thread_pool.m_thread_count , + work_subprogram, work_info, work_count, lock_count, + reduce_join, reduce_init, reduce_size, reduce_data ))))))); + + if ( ! result ) { local_wait(); } + + return result ; +} + +int TPI_Run_threads_reduce( TPI_work_subprogram work_subprogram , + const void * work_info , + TPI_reduce_join reduce_join , + TPI_reduce_init reduce_init , + int reduce_size , + void * reduce_data ) +{ + const int lock_count = 0 ; + const int work_count = 0 < thread_pool.m_thread_count ? + thread_pool.m_thread_count : 1 ; + + const int result = + NULL != thread_pool.m_work_routine ? TPI_ERROR_ACTIVE : ( + NULL == work_subprogram ? TPI_ERROR_NULL : ( + NULL == reduce_join ? TPI_ERROR_NULL : ( + NULL == reduce_init ? TPI_ERROR_NULL : ( + NULL == reduce_data ? TPI_ERROR_NULL : ( + reduce_size <= 0 ? TPI_ERROR_SIZE : + + local_start( thread_pool.m_thread_count , + work_subprogram , work_info , work_count , lock_count , + reduce_join, reduce_init, reduce_size, reduce_data )))))); + + if ( ! result ) { local_wait(); } + + return result ; +} + +int TPI_Start_reduce( TPI_work_subprogram work_subprogram , + const void * work_info , + int work_count , + TPI_reduce_join reduce_join , + TPI_reduce_init reduce_init , + int reduce_size , + void * reduce_data ) +{ + const int lock_count = 0 ; + + const int result = + NULL != thread_pool.m_work_routine ? TPI_ERROR_ACTIVE : ( + NULL == work_subprogram ? TPI_ERROR_NULL : ( + NULL == reduce_join ? TPI_ERROR_NULL : ( + NULL == reduce_init ? TPI_ERROR_NULL : ( + NULL == reduce_data ? TPI_ERROR_NULL : ( + work_count <= 0 ? TPI_ERROR_SIZE : ( + reduce_size <= 0 ? TPI_ERROR_SIZE : + + local_start( thread_pool.m_thread_count - 1 , + work_subprogram , work_info , work_count , lock_count , + reduce_join, reduce_init, reduce_size, reduce_data ))))))); + + return result ; +} + +int TPI_Start_threads_reduce( TPI_work_subprogram work_subprogram , + const void * work_info , + TPI_reduce_join reduce_join , + TPI_reduce_init reduce_init , + int reduce_size , + void * reduce_data ) +{ + const int lock_count = 0 ; + const int work_count = 1 < thread_pool.m_thread_count ? + thread_pool.m_thread_count - 1 : 1 ; + + const int result = + NULL != thread_pool.m_work_routine ? TPI_ERROR_ACTIVE : ( + NULL == work_subprogram ? TPI_ERROR_NULL : ( + NULL == reduce_join ? TPI_ERROR_NULL : ( + NULL == reduce_init ? TPI_ERROR_NULL : ( + NULL == reduce_data ? TPI_ERROR_NULL : ( + reduce_size <= 0 ? TPI_ERROR_SIZE : + + local_start( thread_pool.m_thread_count - 1 , + work_subprogram , work_info , work_count , lock_count , + reduce_join, reduce_init, reduce_size, reduce_data )))))); + + return result ; +} + + diff --git a/tests/apps/miniFE/tests/basic/optional/ThreadPool/src/TPI.h b/tests/apps/miniFE/tests/basic/optional/ThreadPool/src/TPI.h new file mode 100644 index 0000000000..939d3bed4a --- /dev/null +++ b/tests/apps/miniFE/tests/basic/optional/ThreadPool/src/TPI.h @@ -0,0 +1,253 @@ +/*------------------------------------------------------------------------*/ +/* TPI: Thread Pool Interface */ +/* Copyright (2008) Sandia Corporation */ +/* */ +/* Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive */ +/* license for use of this work by or on behalf of the U.S. Government. */ +/* */ +/* This library is free software; you can redistribute it and/or modify */ +/* it under the terms of the GNU Lesser General Public License as */ +/* published by the Free Software Foundation; either version 2.1 of the */ +/* License, or (at your option) any later version. */ +/* */ +/* This library is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU */ +/* Lesser General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU Lesser General Public */ +/* License along with this library; if not, write to the Free Software */ +/* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 */ +/* USA */ +/*------------------------------------------------------------------------*/ +/** + * @author H. Carter Edwards + * + * Thread Pool Interface (TPI). + * + * A simple and miminalistic interface for executing subprograms + * in a thread parallel, shared memory mode. + * + * States: the underlying thread pool has four states. + * 1) Uninitialized: no extra threads exist, this is the initial state. + * 2) Ready: extra threads exist and are ready to run a subprogram. + * 3) Active: extra threads are calling the subprogram. + * 4) Blocked: extra threads blocked. + * + * Threads are created on initialization and placed in the 'Ready' state. + * While in the 'Ready' state the threads are spin-waiting to minimize + * the cost of activating blocked threads. + * Threads can be blocked so that they do not compete for computatational + * resources with other threads created external to the TPI interface. + * For example, threads created by OpenMP or TBB. + */ + +#ifndef ThreadPoolInterface_h +#define ThreadPoolInterface_h + +#if defined( __cplusplus ) +extern "C" { +#endif + +/*--------------------------------------------------------------------*/ +/** \brief Version string. */ +const char * TPI_Version(); + +/** Start up the requested number of threads, less the calling thread. + * Return the actual number of threads, including the calling thread, + * otherwise return an error. + */ +int TPI_Init( int thread_count ); + +/** Shut down all started threads. */ +int TPI_Finalize(); + +/*--------------------------------------------------------------------*/ +/** \brief A utility to measure wall-clock time, which is frequently + * needed when performance testing HPC algorithms. + */ +double TPI_Walltime(); + +/*--------------------------------------------------------------------*/ +/* All functions return zero for success. */ + +#define TPI_ERROR_NULL ((int) -1) /**< NULL input */ +#define TPI_ERROR_SIZE ((int) -2) /**< BAD input: size or index */ +#define TPI_ERROR_LOCK ((int) -3) /**< BAD lock or unlock */ +#define TPI_ERROR_ACTIVE ((int) -4) /**< BAD input: the pool is active */ +#define TPI_ERROR_INTERNAL ((int) -5) /**< internal resource error */ + +/*--------------------------------------------------------------------*/ +/** \brief Work information passed to a work subprogram. */ +struct TPI_Work_Struct { + const void * info ; /**< Shared info input to TPI_Run */ + void * reduce ; /**< Data for reduce operation, if any */ + int count ; /**< Count of work requested via TPI_Run */ + int rank ; /**< Rank of work for the current call */ + int lock_count ; /**< Count of locks requested via TPI_Run */ +}; + +/** \brief Typedef for work subprogram argument */ +typedef const struct TPI_Work_Struct TPI_Work ; + +/** The interface for a parallel task */ +typedef void (*TPI_work_subprogram)( TPI_Work * ); + +/** The interface for a parallel reduction operation. + * Initialize work->reduce value. + */ +typedef +void (*TPI_reduce_init)( TPI_Work * work ); + +/** The interface for a parallel reduction operation. + * Perform reduction operation work->reduce OP= reduce. + * Every initialized reduce value will appear exactly + * once as the 'reduce' argument of a call to the join function. + */ +typedef +void (*TPI_reduce_join)( TPI_Work * work , const void * reduce ); + +/*--------------------------------------------------------------------*/ +/** \brief Run a work subprogram in thread parallel. + * + * The thread pool must be in the 'paused' state when this + * function is called. Thus a recursive call to TPI_Run is illegal. + */ +int TPI_Run( TPI_work_subprogram work_subprogram , + const void * work_info , + int work_count , + int lock_count ); + +/** \brief Run a work and reduction subprograms in thread parallel. + * + * Each call to the work_subprogram has exclusive (thread safe) + * access to its work->reduce data. + * The reduce_init and reduce_join subprograms have + * exclusive access to their arguments. + */ +int TPI_Run_reduce( TPI_work_subprogram work_subprogram , + const void * work_info , + int work_count , + TPI_reduce_join reduce_join , + TPI_reduce_init reduce_init , + int reduce_size , + void * reduce_data ); + +/** \brief Run a work subprogram exactly once on each thread. + * + * The thread pool must be in the 'paused' state when this + * function is called. Thus a recursive call to TPI_Run is illegal. + */ +int TPI_Run_threads( TPI_work_subprogram work_subprogram , + const void * work_info , + int lock_count ); + +/** \brief Run a work and reduction subprograms in thread parallel. + * + * Each call to the work_subprogram has exclusive (thread safe) + * access to its work->reduce data. + * The reduce_init and reduce_join subprograms have + * exclusive access to their arguments. + */ +int TPI_Run_threads_reduce( TPI_work_subprogram work_subprogram , + const void * work_info , + TPI_reduce_join reduce_join , + TPI_reduce_init reduce_init , + int reduce_size , + void * reduce_data ); + +/*--------------------------------------------------------------------*/ +/** \brief Start a work subprogram in thread parallel + * running on all but the 'main' calling thread; + * the 'main' calling thread returns immediately. + * + * The thread pool must be in the 'paused' state when this + * function is called. Thus a recursive call to TPI_Start is illegal. + */ +int TPI_Start( TPI_work_subprogram work_subprogram , + const void * work_info , + int work_count , + int lock_count ); + +/** \brief Start a work and reduction subprograms in thread parallel + * running on all but the 'main' calling thread; + * the 'main' calling thread returns immediately. + * + * Each call to the work_subprogram has exclusive (thread safe) + * access to its work->reduce data. + * The reduce_init and reduce_join subprograms have + * exclusive access to their arguments. + */ +int TPI_Start_reduce( TPI_work_subprogram work_subprogram , + const void * work_info , + int work_count , + TPI_reduce_join reduce_join , + TPI_reduce_init reduce_init , + int reduce_size , + void * reduce_data ); + +/** \brief Run a work subprogram on each thread + * that is not the 'main' calling thread. + * The 'main' calling thread returns immediately. + * + * The thread pool must be in the 'paused' state when this + * function is called. Thus a recursive call to TPI_Start_threads is illegal. + */ +int TPI_Start_threads( TPI_work_subprogram work_subprogram , + const void * work_info , + int lock_count ); + +/** \brief Start a work / reduction subprogram + * on each thread that is not the 'main' calling thread. + * The 'main' calling thread returns immediately. + * + * Each call to the work_subprogram has exclusive (thread safe) + * access to its work->reduce data. + * The reduce_init and reduce_join subprograms have + * exclusive access to their arguments. + */ +int TPI_Start_threads_reduce( TPI_work_subprogram work_subprogram , + const void * work_info , + TPI_reduce_join reduce_join , + TPI_reduce_init reduce_init , + int reduce_size , + void * reduce_data ); + +/** \brief Wait for a started work subprogram to complete. */ +int TPI_Wait(); + +/*--------------------------------------------------------------------*/ +/** \brief Block threads within the operating system. + * + * Normally the worker threads are unblocked and spinning for + * minimal start up overhead when running work subprograms. + * If no TPI work is to be performed for a long period of time + * then an application can block the worker threads. + */ +int TPI_Block(); + +/** \brief Unblock blocked threads within the operating system */ +int TPI_Unblock(); + +/** \brief Query if threads are blocked */ +int TPI_Isblocked(); + +/*--------------------------------------------------------------------*/ +/** \brief Blocks until lock lock_rank is obtained. + * The thread pool must be in the 'active' state. + */ +int TPI_Lock( int lock_rank ); + +/** \brief Unlocks lock lock_rank. + * The thread pool must be in the 'active' state. + */ +int TPI_Unlock( int lock_rank ); + +/*--------------------------------------------------------------------*/ + +#if defined( __cplusplus ) +} +#endif + +#endif + diff --git a/tests/apps/miniFE/tests/basic/optional/ThreadPool/src/TPI.hpp b/tests/apps/miniFE/tests/basic/optional/ThreadPool/src/TPI.hpp new file mode 100644 index 0000000000..fc1894ecf2 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/optional/ThreadPool/src/TPI.hpp @@ -0,0 +1,135 @@ +/*------------------------------------------------------------------------*/ +/* TPI: Thread Pool Interface */ +/* Copyright (2008) Sandia Corporation */ +/* */ +/* Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive */ +/* license for use of this work by or on behalf of the U.S. Government. */ +/* */ +/* This library is free software; you can redistribute it and/or modify */ +/* it under the terms of the GNU Lesser General Public License as */ +/* published by the Free Software Foundation; either version 2.1 of the */ +/* License, or (at your option) any later version. */ +/* */ +/* This library is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU */ +/* Lesser General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU Lesser General Public */ +/* License along with this library; if not, write to the Free Software */ +/* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 */ +/* USA */ +/*------------------------------------------------------------------------*/ +/** + * @author H. Carter Edwards + */ + +#ifndef util_ThreadPool_hpp +#define util_ThreadPool_hpp + +#include + +namespace TPI { + +typedef TPI_Work Work ; + +//---------------------------------------------------------------------- +/** Run worker.*method(work) on all threads. + */ +template +int Run( Worker & worker , void (Worker::*method)(Work &) , + int work_count , int lock_count = 0 ); + +//---------------------------------------------------------------------- + +inline int Lock( int n ) { return TPI_Lock( n ); } +inline int Unlock( int n ) { return TPI_Unlock( n ); } + +/** Lock guard to insure that a lock is released + * when control exists a block. + * { + * TPI::LockGuard local_lock( i ); + * } + */ +class LockGuard { +private: + LockGuard(); + LockGuard( const LockGuard & ); + LockGuard & operator = ( const LockGuard & ); + const int m_value ; + const int m_result ; +public: + operator int() const { return m_result ; } + + explicit LockGuard( unsigned i_lock ) + : m_value( i_lock ), m_result( TPI_Lock(i_lock) ) {} + + ~LockGuard() { TPI_Unlock( m_value ); } +}; + +//---------------------------------------------------------------------- + +inline +int Init( int n ) { return TPI_Init( n ); } + +inline +int Finalize() { return TPI_Finalize(); } + +inline +double Walltime() { return TPI_Walltime(); } + +//---------------------------------------------------------------------- +//---------------------------------------------------------------------- + +namespace { + +template +class WorkerMethodHelper { +private: + WorkerMethodHelper(); + WorkerMethodHelper( const WorkerMethodHelper & ); + WorkerMethodHelper & operator = ( const WorkerMethodHelper & ); + +public: + + typedef void (Worker::*Method)( Work & ); + + Worker & worker ; + Method method ; + + WorkerMethodHelper( Worker & w , Method m ) : worker(w), method(m) {} + + static void run( TPI_Work * work ) + { + try { + const WorkerMethodHelper & wm = + * reinterpret_cast(work->info); + (wm.worker.*wm.method)(*work); + } catch(...){} + } +}; + +} + +//---------------------------------------------------------------------- +//---------------------------------------------------------------------- + +template +inline +int Run( Worker & worker, void (Worker::*method)(Work &) , + int work_count , int lock_count ) +{ + typedef WorkerMethodHelper WM ; + + WM tmp( worker , method ); + + return TPI_Run( reinterpret_cast(& WM::run),&tmp,work_count,lock_count); +} + +//---------------------------------------------------------------------- +//---------------------------------------------------------------------- + +} + +#endif + diff --git a/tests/apps/miniFE/tests/basic/optional/ThreadPool/src/TPI_Walltime.c b/tests/apps/miniFE/tests/basic/optional/ThreadPool/src/TPI_Walltime.c new file mode 100644 index 0000000000..d2c1fe458d --- /dev/null +++ b/tests/apps/miniFE/tests/basic/optional/ThreadPool/src/TPI_Walltime.c @@ -0,0 +1,44 @@ +/*------------------------------------------------------------------------*/ +/* TPI: Thread Pool Interface */ +/* Copyright (2008) Sandia Corporation */ +/* */ +/* Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive */ +/* license for use of this work by or on behalf of the U.S. Government. */ +/* */ +/* This library is free software; you can redistribute it and/or modify */ +/* it under the terms of the GNU Lesser General Public License as */ +/* published by the Free Software Foundation; either version 2.1 of the */ +/* License, or (at your option) any later version. */ +/* */ +/* This library is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU */ +/* Lesser General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU Lesser General Public */ +/* License along with this library; if not, write to the Free Software */ +/* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 */ +/* USA */ +/*------------------------------------------------------------------------*/ +/** + * @author H. Carter Edwards + */ + +#include + +#include +#ifdef _MSC_VER +#include +#else +#include +#endif + +double TPI_Walltime() +{ + struct timeval tp ; + + gettimeofday( &tp , ((struct timezone *) NULL ) ); + + return ( (double) tp.tv_sec ) + ( (double) tp.tv_usec ) / 1.0e6 ; +} + diff --git a/tests/apps/miniFE/tests/basic/optional/ThreadPool/src/ThreadPool_config.h.in b/tests/apps/miniFE/tests/basic/optional/ThreadPool/src/ThreadPool_config.h.in new file mode 100644 index 0000000000..752f5c5a6a --- /dev/null +++ b/tests/apps/miniFE/tests/basic/optional/ThreadPool/src/ThreadPool_config.h.in @@ -0,0 +1,71 @@ +/* src/ThreadPool_config.h.in. Generated from configure.ac by autoheader. */ + +/* Define if you want to build export makefiles. */ +#undef HAVE_EXPORT_MAKEFILES + +/* Define if you are using gnumake - this will shorten your link lines. */ +#undef HAVE_GNUMAKE + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define if want to build libcheck */ +#undef HAVE_LIBCHECK + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* define if we want to use MPI */ +#undef HAVE_MPI + +/* Define if want to build threadpool-tests */ +#undef HAVE_NEW_PACKAGE_TESTS + +/* Define if you have POSIX threads libraries and header files. */ +#undef HAVE_PTHREAD + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define if want to build tests */ +#undef HAVE_TESTS + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Define to the necessary symbol if this constant uses a non-standard name on + your system. */ +#undef PTHREAD_CREATE_JOINABLE + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS diff --git a/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/CMakeLists.txt b/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/CMakeLists.txt new file mode 100644 index 0000000000..ff878e7d54 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/CMakeLists.txt @@ -0,0 +1,86 @@ + +INCLUDE(PackageAddExecutableAndTest) + +PACKAGE_ADD_EXECUTABLE( + test_tpi_unit + COMM serial mpi + SOURCES test_tpi_unit.c + DIRECTORY . + ) + +PACKAGE_ADD_EXECUTABLE( + test_c_dnax + COMM serial + SOURCES test_c_dnax.c + DIRECTORY . + ) + +PACKAGE_ADD_EXECUTABLE( + test_tpi_cpp + COMM serial + SOURCES test_tpi.cpp + DIRECTORY . + ) + +PACKAGE_ADD_EXECUTABLE( + test_tpi_sum + COMM serial mpi + SOURCES test_mpi_sum.c + DIRECTORY . + ) + +PACKAGE_ADD_TEST( + test_tpi_unit + NAME test_tpi_unit_serial + COMM serial + DIRECTORY . + ) + +PACKAGE_ADD_TEST( + test_tpi_unit + NAME test_tpi_unit_mpi + COMM mpi + NUM_MPI_PROCS 1 + DIRECTORY . + ) + +PACKAGE_ADD_TEST( + test_tpi_cpp + NAME test_tpi_cpp + COMM serial + DIRECTORY . + ) + +PACKAGE_ADD_TEST( + test_tpi_sum + NAME test_tpi_sum_serial + COMM serial + DIRECTORY . + XHOSTTYPE AIX + ) + +PACKAGE_ADD_TEST( + test_tpi_sum + NAME test_tpi_sum_np1 + COMM mpi + NUM_MPI_PROCS 1 + DIRECTORY . + ) + +PACKAGE_ADD_TEST( + test_tpi_sum + NAME test_tpi_sum_np2 + COMM mpi + NUM_MPI_PROCS 2 + DIRECTORY . + ) + +PACKAGE_ADD_TEST( + test_tpi_sum + NAME test_tpi_sum_np4 + COMM mpi + NUM_MPI_PROCS 4 + DIRECTORY . + ) + + diff --git a/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/Makefile.am b/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/Makefile.am new file mode 100644 index 0000000000..8e78cbf2e4 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/Makefile.am @@ -0,0 +1,55 @@ +#@HEADER +# ************************************************************************ +# +# ThreadPool Package +# Copyright (2008) Sandia Corporation +# +# Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +# license for use of this work by or on behalf of the U.S. Government. +# +# This library is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as +# published by the Free Software Foundation; either version 2.1 of the +# License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +# USA +# Questions? Contact Carter Edwards (hcedwar@sandia.gov) +# +# ************************************************************************ +#@HEADER + +SUBDIRS = + +# The following line helps the test harness recover from build errors. + +all-local: + +include $(top_builddir)/Makefile.export.threadpool + +EXEEXT = .exe + +noinst_PROGRAMS = test_tpi test_tpi_cpp test_sum + +test_tpi_SOURCES = test_main.c test_tpi_unit.c test_c_dnax.c test_c_tpi.c test_pthreads.c +test_tpi_DEPENDENCIES = $(top_builddir)/src/libtpi.a +test_tpi_CFLAGS = $(THREADPOOL_INCLUDES) +test_tpi_LDADD = $(THREADPOOL_LIBS) + +test_tpi_cpp_SOURCES = test_tpi.cpp +test_tpi_cpp_DEPENDENCIES = $(top_builddir)/src/libtpi.a +test_tpi_cpp_CXXFLAGS = $(THREADPOOL_INCLUDES) +test_tpi_cpp_LDADD = $(THREADPOOL_LIBS) + +test_sum_SOURCES = test_mpi_sum.c +test_sum_DEPENDENCIES = $(top_builddir)/src/libtpi.a +test_sum_CFLAGS = $(THREADPOOL_INCLUDES) +test_sum_LDADD = $(THREADPOOL_LIBS) + diff --git a/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/build_gnu b/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/build_gnu new file mode 100755 index 0000000000..bba4b90621 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/build_gnu @@ -0,0 +1,79 @@ +#!/bin/bash + +TEST_SRC="test_main.c test_c_dnax.c test_tpi_unit.c test_pthreads.c" + +LIB_SRC="../src/TPI.c ../src/TPI_Walltime.c" + +LIB_OBJ="TPI.o TPI_Walltime.o" + +# OPT="-O3" +OPT="-g" +# OPT="-O" + +#CFLAGS="${OPT} -std=c99 -Wall -Wextra" + +CFLAGS=" ${OPT} -std=c89 -Wall -Wextra" +CCFLAGS="${OPT} -std=c++98 -Wall -Wextra" + +echo build: gcc ${CFLAGS} + +#----------------------------------------------------------------------- + +rm -f ThreadPool_config.h +echo "#define HAVE_PTHREAD 1" > ThreadPool_config.h + +gcc ${CFLAGS} -c \ + -I. -I../src ${LIB_SRC} + +gcc ${CFLAGS} \ + -o test_tpi.gnu.exe \ + -I. -I../src ${TEST_SRC} ${LIB_OBJ} -lpthread -lm + +g++ ${CCFLAGS} \ + -o test_tpi_cpp.gnu.exe \ + -I. -I../src test_tpi.cpp ${LIB_OBJ} -lpthread -lstdc++ -lm + +gcc ${CFLAGS} \ + -o test_sum.gnu.exe \ + -I. -I../src test_mpi_sum.c ${LIB_OBJ} -lpthread -lm + +#----------------------------------------------------------------------- + +mpicc ${CFLAGS} \ + -o test_sum.mpi.gnu.exe \ + -I. -I../src -DTEST_WITH_MPI test_mpi_sum.c ${LIB_OBJ} -lpthread -lm + +#----------------------------------------------------------------------- + +rm -f ThreadPool_config.h +echo "/* #define HAVE_PTHREAD 1 */" > ThreadPool_config.h + +gcc ${CFLAGS} -c \ + -I. -I../src ${LIB_SRC} + +gcc ${CFLAGS} \ + -o test_tpi.gnu.noth.exe \ + -I. -I../src ${TEST_SRC} ${LIB_OBJ} -lpthread -lm + +g++ ${CCFLAGS} \ + -o test_tpi_cpp.gnu.noth.exe \ + -I. -I../src test_tpi.cpp ${LIB_OBJ} -lpthread -lstdc++ -lm + +gcc ${CFLAGS} \ + -o test_sum.gnu.noth.exe \ + -I. -I../src test_mpi_sum.c ${LIB_OBJ} -lpthread -lm + +#----------------------------------------------------------------------- + +rm -f ThreadPool_config.h +echo "/* #define HAVE_PTHREAD 1 */" > ThreadPool_config.h +echo "#define HAVE_MPI 1" >> ThreadPool_config.h + +mpicc ${CFLAGS} \ + -o test_sum.mpi.gnu.noth.exe \ + -I. -I../src -DTEST_WITH_MPI test_mpi_sum.c ${LIB_OBJ} -lpthread -lm + +#----------------------------------------------------------------------- + +rm -f ThreadPool_config.h + diff --git a/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/build_intel b/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/build_intel new file mode 100755 index 0000000000..accb0a0dff --- /dev/null +++ b/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/build_intel @@ -0,0 +1,82 @@ +#!/bin/bash + +# . /usr/local/modules/3.2.6/Modules/$MODULE_VERSION/bin/modulecmd tcsh \ +# load sierra-devel-desktop-intel-10.1ip + + +TEST_SRC="test_main.c test_c_dnax.c test_tpi_unit.c test_pthreads.c" + +LIB_SRC="../src/TPI.c ../src/TPI_Walltime.c" + +LIB_OBJ="TPI.o TPI_Walltime.o" + +#CFLAGS="-std=c99 -strict-ansi -Wall -Wcheck -Werror -wd141 -wd869 -wd1418 -wd1419" +#CFLAGS="-std=c89 -strict-ansi -Wall -Wcheck -Werror -wd141 -wd869 -wd1418 -wd1419" +CCFLAGS=" -strict-ansi -Wall -Wcheck -Werror -wd141 -wd869 -wd1418 -wd1419" + +OPT="-O3" +# OPT="-g" +# OPT="-O" + +echo build ${OPT} + +#----------------------------------------------------------------------- + +rm -f ThreadPool_config.h +echo "#define HAVE_PTHREAD 1" > ThreadPool_config.h + +icc ${CFLAGS} ${OPT} -c \ + -I. -I../src ${LIB_SRC} + +icc ${CFLAGS} ${OPT} \ + -o test_tpi.intel.exe \ + -I. -I../src ${TEST_SRC} ${LIB_OBJ} -lpthread + +icc ${CCFLAGS} ${OPT} \ + -o test_tpi_cpp.intel.exe \ + -I. -I../src test_tpi.cpp ${LIB_OBJ} -lpthread -lstdc++ + +icc ${CFLAGS} ${OPT} \ + -o test_sum.intel.exe \ + -I. -I../src test_mpi_sum.c ${LIB_OBJ} -lpthread + +#----------------------------------------------------------------------- + +mpicc ${CFLAGS} ${OPT} \ + -o test_sum.mpi.intel.exe \ + -I. -I../src -DTEST_WITH_MPI test_mpi_sum.c ${LIB_OBJ} -lpthread + +#----------------------------------------------------------------------- + +rm -f ThreadPool_config.h +echo "/* #define HAVE_PTHREAD 1 */" > ThreadPool_config.h + +icc ${CFLAGS} ${OPT} -c \ + -I. -I../src ${LIB_SRC} + +icc ${CFLAGS} ${OPT} \ + -o test_tpi.intel.noth.exe \ + -I. -I../src ${TEST_SRC} ${LIB_OBJ} -lpthread + +icc ${CCFLAGS} ${OPT} \ + -o test_tpi_cpp.intel.noth.exe \ + -I. -I../src test_tpi.cpp ${LIB_OBJ} -lpthread -lstdc++ + +icc ${CFLAGS} ${OPT} \ + -o test_sum.intel.noth.exe \ + -I. -I../src test_mpi_sum.c ${LIB_OBJ} -lpthread + +#----------------------------------------------------------------------- + +rm -f ThreadPool_config.h +echo "/* #define HAVE_PTHREAD 1 */" > ThreadPool_config.h +echo "#define HAVE_MPI 1" >> ThreadPool_config.h + +mpicc ${CFLAGS} ${OPT} \ + -o test_sum.mpi.intel.noth.exe \ + -I. -I../src -DTEST_WITH_MPI test_mpi_sum.c ${LIB_OBJ} -lpthread + +#----------------------------------------------------------------------- + +rm -f ThreadPool_config.h + diff --git a/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/build_pgi b/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/build_pgi new file mode 100755 index 0000000000..85799ccfd3 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/build_pgi @@ -0,0 +1,39 @@ +#!/bin/bash + +export LM_LICENSE_FILE=7500@reddish +PGI_HOME="/usr/local/pgi_64/linux86-64/7.0-7" +MPICH_HOME="/usr/local/mpi/mpich/64Bit/1.2.7/pgi-6.0" + +export PATH="${PGI_HOME}/bin:${PATH}" + +TEST_SRC="test_main.c test_c_dnax.c test_c_tpi.c test_pthreads.c" + +LIB_SRC="../src/TPI_pthreads.c ../src/TPI_Walltime.c ../src/TPI_Concurrency.c" + +LIB_OBJ="TPI_pthreads.o TPI_Walltime.o TPI_Concurrency.o" + +#----------------------------------------------------------------------- + +pgcc -O4 -c \ + -I../include ${LIB_SRC} -lpthread + +pgcc -O4 \ + -o test_tpi.pgi.exe \ + -I../include ${TEST_SRC} ${LIB_OBJ} -lpthread + +pgCC -O4 \ + -o test_tpi_cpp.pgi.exe \ + -I../include test_tpi.cpp ${LIB_OBJ} -lpthread + +#----------------------------------------------------------------------- +# Enable PGI-MPI installation to accept as large a message as possible, 200 Mb + +# export P4_GLOBMEMSIZE="268435456" + +export PATH="${MPICH_HOME}/bin:${PGI_HOME}/bin:${PATH}" + +mpicc -c99 \ + -O4 \ + -o test_sum.mpi.pgi.exe \ + -I../include -DTEST_WITH_MPI test_mpi_sum.c ${LIB_OBJ} -lpthread + diff --git a/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/hhpccg/BoxPartitionIB.c b/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/hhpccg/BoxPartitionIB.c new file mode 100644 index 0000000000..5f2866f845 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/hhpccg/BoxPartitionIB.c @@ -0,0 +1,562 @@ + + +#include +#include + +#include + +/*--------------------------------------------------------------------*/ +/* Recursively split a box into into (up-ip) sub-boxes */ + +typedef const int RangeInput[2] ; +typedef int RangeOutput[2] ; +typedef RangeInput * const BoxInput ; +typedef RangeOutput * const BoxOutput ; + +static +void box_partition( int ip , int up , int axis , + BoxInput box , + int (* const p_box)[3][2] ) +{ + const int np = up - ip ; + if ( 1 == np ) { + p_box[ip][0][0] = box[0][0] ; p_box[ip][0][1] = box[0][1] ; + p_box[ip][1][0] = box[1][0] ; p_box[ip][1][1] = box[1][1] ; + p_box[ip][2][0] = box[2][0] ; p_box[ip][2][1] = box[2][1] ; + } + else { + const int n = box[ axis ][1] - box[ axis ][0] ; + const int np_low = np / 2 ; /* Rounded down */ + const int np_upp = np - np_low ; + + const int n_upp = (int) (((double) n) * ( ((double)np_upp) / ((double)np))); + const int n_low = n - n_upp ; + const int next_axis = ( axis + 2 ) % 3 ; + + if ( np_low ) { /* P = [ip,ip+np_low) */ + int dbox[3][2] ; + dbox[0][0] = box[0][0] ; dbox[0][1] = box[0][1] ; + dbox[1][0] = box[1][0] ; dbox[1][1] = box[1][1] ; + dbox[2][0] = box[2][0] ; dbox[2][1] = box[2][1] ; + + dbox[ axis ][1] = dbox[ axis ][0] + n_low ; + + box_partition( ip, ip + np_low, next_axis, + (const int (*)[2]) dbox, p_box ); + } + + if ( np_upp ) { /* P = [ip+np_low,ip+np_low+np_upp) */ + int dbox[3][2] ; + dbox[0][0] = box[0][0] ; dbox[0][1] = box[0][1] ; + dbox[1][0] = box[1][0] ; dbox[1][1] = box[1][1] ; + dbox[2][0] = box[2][0] ; dbox[2][1] = box[2][1] ; + + ip += np_low ; + dbox[ axis ][0] += n_low ; + dbox[ axis ][1] = dbox[ axis ][0] + n_upp ; + + box_partition( ip, ip + np_upp, next_axis, + (const int (*)[2]) dbox, p_box ); + } + } +} + +void box_partition_rcb( const int np , + const int root_box[3][2] , + int pbox[][3][2] ) +{ + box_partition( 0 , np , 2 , root_box , pbox ); +} + +/*--------------------------------------------------------------------*/ + +static int box_intersect( BoxInput a , BoxInput b , BoxOutput c ) +{ + int i ; + for ( i = 0 ; i < 3 ; ++i ) { + c[i][0] = a[i][0] < b[i][0] ? b[i][0] : a[i][0] ; + c[i][1] = a[i][1] < b[i][1] ? a[i][1] : b[i][1] ; + } + + return c[0][0] < c[0][1] && c[1][0] < c[1][1] && c[2][0] < c[2][1] ; +} + + +/*--------------------------------------------------------------------*/ + +static void global_to_use_box( BoxInput gbox , + BoxInput pbox , + const int ghost , + BoxOutput interiorBox , + BoxOutput useBox ) +{ + int i = 0 ; + + for ( i = 0 ; i < 3 ; ++i ) { + const int n = pbox[i][1] - pbox[i][0] ; + + if ( n < 0 ) { + abort(); + } + + interiorBox[i][0] = gbox[i][0] == pbox[i][0] + ? gbox[i][0] : pbox[i][0] + ghost ; + + interiorBox[i][1] = gbox[i][1] == pbox[i][1] + ? gbox[i][1] : pbox[i][1] - ghost ; + + if ( interiorBox[i][1] < pbox[i][0] ) { + interiorBox[i][1] = pbox[i][0] ; + } + + if ( interiorBox[i][0] > pbox[i][1] ) { + interiorBox[i][0] = pbox[i][1] ; + } + + if ( interiorBox[i][1] < interiorBox[i][0] ) { + interiorBox[i][1] = interiorBox[i][0] ; + } + + useBox[i][0] = pbox[i][0] - ghost ; + useBox[i][1] = pbox[i][1] + ghost ; + + if ( useBox[i][0] < gbox[i][0] ) { useBox[i][0] = gbox[i][0] ; } + if ( useBox[i][1] > gbox[i][1] ) { useBox[i][1] = gbox[i][1] ; } + } +} + + +/* A use-box is the owned box plus the ghost layers. + * Map a global (x,y,z) to a local integer ordinate. + */ +static int map_global_to_use_box( BoxInput useBox , + const int global_x , + const int global_y , + const int global_z ) +{ + const int nx = useBox[0][1] - useBox[0][0] ; + const int ny = useBox[1][1] - useBox[1][0] ; + const int nz = useBox[2][1] - useBox[2][0] ; + const int ix = global_x - useBox[0][0] ; + const int iy = global_y - useBox[1][0] ; + const int iz = global_z - useBox[2][0] ; + + const int good = 0 <= ix && ix < nx && + 0 <= iy && iy < ny && + 0 <= iz && iz < nz ; + + if ( nx < 0 || ny < 0 || nz < 0 ) { + abort(); + } + if ( ! good ) { + abort(); + } + + return good ? ix + iy * nx + iz * nx * ny : -1 ; +} + +int box_map_local( const int local_uses[3][2] , + const int map_local_id[] , + const int global_x , + const int global_y , + const int global_z ) +{ + int i = map_global_to_use_box( local_uses , global_x , global_y , global_z ); + + if ( 0 <= i ) { i = map_local_id[i] ; } + + return i ; +} + + +/*--------------------------------------------------------------------*/ + +static void resize_int( int ** a , int * allocLen , int newLen ) +{ + int k = 32; + while ( k < newLen ) { k <<= 1 ; } + if ( NULL == *a ) + { *a = malloc( sizeof(int)*(*allocLen = k) ); } + else if ( *allocLen < k ) + { *a = realloc(*a , sizeof(int)*(*allocLen = k)); } +} + +void box_partition_map( + const int np , + const int my_p , + const int gbox[3][2] , + const int pbox[][3][2] , + const int ghost , + + int map_use_box[3][2] , + int map_local_id[] , + int * map_count_interior , + int * map_count_owns , + int * map_count_uses , + int ** map_recv_pc , + int ** map_send_pc , + int ** map_send_id ) +{ + int * recv_pc = (int *) malloc( ( np + 1 ) * sizeof(int) ); + int * send_pc = (int *) malloc( ( np + 1 ) * sizeof(int) ); + + int id_length = 0 ; + + int * send_id = NULL ; + int send_id_size = 0 ; + + int own_length , use_length , int_length ; + int count_interior , count_parallel ; + int iSend ; + int g_ix , g_iy , g_iz ; + int i ; + + int my_int_box[3][2] ; + + global_to_use_box( gbox , pbox[my_p] , ghost , my_int_box , map_use_box ); + + own_length = ( pbox[my_p][0][1] - pbox[my_p][0][0] ) * + ( pbox[my_p][1][1] - pbox[my_p][1][0] ) * + ( pbox[my_p][2][1] - pbox[my_p][2][0] ); + + use_length = ( map_use_box[0][1] - map_use_box[0][0] ) * + ( map_use_box[1][1] - map_use_box[1][0] ) * + ( map_use_box[2][1] - map_use_box[2][0] ); + + int_length = ( my_int_box[0][1] - my_int_box[0][0] ) * + ( my_int_box[1][1] - my_int_box[1][0] ) * + ( my_int_box[2][1] - my_int_box[2][0] ); + + for ( i = 0 ; i < id_length ; ++i ) { map_local_id[i] = -1 ; } + + /* Fill in locally owned portion: { interior , parallel } */ + + count_interior = 0 ; + count_parallel = int_length ; + + for ( g_iz = pbox[my_p][2][0] ; g_iz < pbox[my_p][2][1] ; ++g_iz ) { + for ( g_iy = pbox[my_p][1][0] ; g_iy < pbox[my_p][1][1] ; ++g_iy ) { + for ( g_ix = pbox[my_p][0][0] ; g_ix < pbox[my_p][0][1] ; ++g_ix ) { + + const int local = + map_global_to_use_box( (BoxInput) map_use_box, g_ix, g_iy, g_iz ); + + if ( local < 0 ) { + abort(); + } + + if ( my_int_box[2][0] <= g_iz && g_iz < my_int_box[2][1] && + my_int_box[1][0] <= g_iy && g_iy < my_int_box[1][1] && + my_int_box[0][0] <= g_ix && g_ix < my_int_box[0][1] ) { + /* Interior */ + map_local_id[ local ] = count_interior++ ; + } + else { + /* Parallel */ + map_local_id[ local ] = count_parallel++ ; + } + } + } + } + + if ( count_interior != int_length ) { abort(); } + if ( count_parallel != own_length ) { abort(); } + + /* Fill in off-process received portion: { ( i + my_p ) % np } */ + + recv_pc[0] = count_parallel ; + recv_pc[1] = count_parallel ; + send_pc[0] = 0 ; + send_pc[1] = 0 ; + iSend = 0 ; + + for ( i = 1 ; i < np ; ++i ) { + const int ip = ( i + my_p ) % np ; + int recv_box[3][2] ; + int send_box[3][2] ; + int other_int_box[3][2] ; + int other_use_box[3][2] ; + + /* Received portions */ + + if ( box_intersect( (BoxInput) map_use_box , (BoxInput) pbox[ip] , recv_box ) ) { + + for ( g_iz = recv_box[2][0] ; g_iz < recv_box[2][1] ; ++g_iz ) { + for ( g_iy = recv_box[1][0] ; g_iy < recv_box[1][1] ; ++g_iy ) { + for ( g_ix = recv_box[0][0] ; g_ix < recv_box[0][1] ; ++g_ix ) { + + const int local = map_global_to_use_box( (BoxInput) map_use_box, g_ix, g_iy, g_iz ); + + map_local_id[ local ] = count_parallel++ ; + } + } + } + } + recv_pc[i+1] = count_parallel ; + + /* Sent items */ + + global_to_use_box( gbox, pbox[ip], ghost, other_int_box, other_use_box ); + + if ( box_intersect( (BoxInput) other_use_box , (BoxInput) pbox[my_p] , send_box ) ) { + + int nSend = ( send_box[0][1] - send_box[0][0] ) * + ( send_box[1][1] - send_box[1][0] ) * + ( send_box[2][1] - send_box[2][0] ); + + resize_int( & send_id , & send_id_size , (iSend + nSend ) ); + + for ( g_iz = send_box[2][0] ; g_iz < send_box[2][1] ; ++g_iz ) { + for ( g_iy = send_box[1][0] ; g_iy < send_box[1][1] ; ++g_iy ) { + for ( g_ix = send_box[0][0] ; g_ix < send_box[0][1] ; ++g_ix ) { + + const int local = map_global_to_use_box( (BoxInput) map_use_box, g_ix, g_iy, g_iz ); + + if ( map_local_id[ local ] < count_interior ) { abort(); } + + send_id[ iSend ] = map_local_id[ local ] ; + ++iSend ; + } + } + } + } + send_pc[i+1] = iSend ; + } + + if ( count_parallel != use_length ) { abort(); } + + *map_count_interior = int_length ; + *map_count_owns = own_length ; + *map_count_uses = use_length ; + *map_recv_pc = recv_pc ; + *map_send_pc = send_pc ; + *map_send_id = send_id ; +} + +/*--------------------------------------------------------------------*/ + +#ifdef UNIT_TEST + +static int box_contain( const int a[3][2] , const int b[3][2] ) +{ + return a[0][0] <= b[0][0] && b[0][1] <= a[0][1] && + a[1][0] <= b[1][0] && b[1][1] <= a[1][1] && + a[2][0] <= b[2][0] && b[2][1] <= a[2][1] ; +} + +static void box_print( FILE * fp , const int a[][2] ) +{ + fprintf(fp,"{ [ %d , %d ) , [ %d , %d ) , [ %d , %d ) }", + a[0][0] , a[0][1] , + a[1][0] , a[1][1] , + a[2][0] , a[2][1] ); +} + +static int box_disjoint( BoxInput a , BoxInput b ) +{ + return a[0][1] <= b[0][0] || b[0][1] <= a[0][0] || + a[1][1] <= b[1][0] || b[1][1] <= a[1][0] || + a[2][1] <= b[2][0] || b[2][1] <= a[2][0] ; +} + + +static void test_box( const int box[3][2] , const int np ) +{ + const int ncell_box = box[0][1] * box[1][1] * box[2][1] ; + int ncell_total = 0 ; + int ncell_min = ncell_box ; + int ncell_max = 0 ; + int (*pbox)[3][2] ; + int i , j ; + + pbox = (int (*)[3][2]) malloc( sizeof(int) * np * 3 * 2 ); + + box_partition( 0 , np , 2 , box , pbox ); + + for ( i = 0 ; i < np ; ++i ) { + const int ncell = ( pbox[i][0][1] - pbox[i][0][0] ) * + ( pbox[i][1][1] - pbox[i][1][0] ) * + ( pbox[i][2][1] - pbox[i][2][0] ); + + if ( ! box_contain( box , (const int (*)[2]) pbox[i] ) ) { + fprintf(stdout," OUT OF BOUNDS pbox[%d/%d] = ",i,np); + box_print(stdout,(const int (*)[2]) pbox[i]); + fprintf(stdout,"\n"); + abort(); + } + + for ( j = i + 1 ; j < np ; ++j ) { + if ( ! box_disjoint( (const int (*)[2]) pbox[i] , + (const int (*)[2]) pbox[j] ) ) { + fprintf(stdout," NOT DISJOINT pbox[%d/%d] = ",i,np); + box_print(stdout, (const int (*)[2]) pbox[i]); + fprintf(stdout,"\n"); + fprintf(stdout," pbox[%d/%d] = ",j,np); + box_print(stdout, (const int (*)[2]) pbox[j]); + fprintf(stdout,"\n"); + abort(); + } + } + ncell_total += ncell ; + + if ( ncell_max < ncell ) { ncell_max = ncell ; } + if ( ncell < ncell_min ) { ncell_min = ncell ; } + } + + if ( ncell_total != ncell_box ) { + fprintf(stdout," WRONG CELL COUNT NP = %d\n",np); + abort(); + } + fprintf(stdout,"NP = %d, total = %d, avg = %d, min = %d, max = %d\n", + np,ncell_box,ncell_box/np,ncell_min,ncell_max); + + free( pbox ); +} + +/*--------------------------------------------------------------------*/ + +static void test_maps( const int root_box[][2] , const int np ) +{ + const int ghost = 1 ; + const int nx_global = root_box[0][1] - root_box[0][0] ; + const int ny_global = root_box[1][1] - root_box[1][0] ; + int map_count_interior , map_count_owns , map_count_uses ; + int map_use_box[3][2] ; + int ieq , i , j ; + int (*pbox)[3][2] ; + int **local_values ; + int **map_local_id ; + int **map_recv_pc ; + int **map_send_pc ; + int **map_send_id ; + + pbox = (int (*)[3][2]) malloc( sizeof(int) * np * 3 * 2 ); + + box_partition( 0 , np , 2 , root_box , pbox ); + + local_values = (int **) malloc( sizeof(int*) * np ); + map_local_id = (int **) malloc( sizeof(int*) * np ); + map_recv_pc = (int **) malloc( sizeof(int*) * np ); + map_send_pc = (int **) malloc( sizeof(int*) * np ); + map_send_id = (int **) malloc( sizeof(int*) * np ); + + /* Set each local value to the global equation number */ + + for ( ieq = i = 0 ; i < np ; ++i ) { + const int (*mybox)[2] = (const int (*)[2]) pbox[i] ; + const int nx = mybox[0][1] - mybox[0][0] ; + const int ny = mybox[1][1] - mybox[1][0] ; + const int nz = mybox[2][1] - mybox[2][0] ; + int ix , iy , iz ; + + map_local_id[i] = (int *) malloc( sizeof(int) * + ( nx + 2 * ghost ) * + ( ny + 2 * ghost ) * + ( nz + 2 * ghost ) ); + + /* Generate the partition maps for this rank */ + box_partition_map( np , i , root_box , + (const int (*)[3][2]) pbox , ghost , + map_use_box , + map_local_id[i] , + & map_count_interior , + & map_count_owns , + & map_count_uses , + & map_recv_pc[i] , + & map_send_pc[i] , & map_send_id[i] ); + + if ( map_count_uses != map_recv_pc[i][np] ) { abort(); } + + local_values[i] = (int *) malloc( sizeof(int) * map_count_uses ); + + for ( iz = map_use_box[2][0] ; iz < map_use_box[2][1] ; ++iz ) { + for ( iy = map_use_box[1][0] ; iy < map_use_box[1][1] ; ++iy ) { + for ( ix = map_use_box[0][0] ; ix < map_use_box[0][1] ; ++ix ) { + + const int igrid = map_global_to_use_box((BoxInput)map_use_box,ix,iy,iz); + const int ieq = map_local_id[i][ igrid ]; + + if ( 0 <= ieq ) { + local_values[i][ ieq ] = + ix + iy * nx_global + iz * nx_global * ny_global ; + } + } + } + } + } + + /* Pair-wise compare the local values */ + /* i == receiving processor rank */ + /* ip == sending processor rank */ + /* j == receiving processor data entry for message from 'ip' */ + /* jp == sending processor data entry for message to 'i' */ + + for ( i = 0 ; i < np ; ++i ) { + for ( j = 1 ; j < np ; ++j ) { + const int ip = ( i + j ) % np ; + const int jp = ( i + np - ip ) % np ; + const int nrecv = map_recv_pc[i] [j+1] - map_recv_pc[i] [j] ; + const int nsend = map_send_pc[ip][jp+1] - map_send_pc[ip][jp] ; + int k ; + if ( nrecv != nsend ) { + fprintf(stderr,"P%d recv %d from P%d\n",i,nrecv,ip); + fprintf(stderr,"P%d send %d to P%d\n",ip,nsend,i); + abort(); + } + for ( k = 0 ; k < nrecv ; ++k ) { + const int irecv = map_recv_pc[i][j] + k ; + const int isend = map_send_pc[ip][jp] + k ; + const int val_irecv = local_values[i][irecv] ; + const int val_isend = local_values[ip][ map_send_id[ip][isend] ] ; + if ( val_irecv != val_isend ) { + fprintf(stderr,"P%d recv[%d] = %d , from P%d\n",i,k,val_irecv,ip); + fprintf(stderr,"P%d send[%d] = %d , to P%d\n",ip,k,val_isend,i); + abort(); + } + } + } + } + + for ( i = 0 ; i < np ; ++i ) { + free( map_local_id[i] ); + free( map_recv_pc[i] ); + free( map_send_pc[i] ); + free( map_send_id[i] ); + free( local_values[i] ); + } + free( map_send_id ); + free( map_send_pc ); + free( map_recv_pc ); + free( map_local_id ); + free( local_values ); + free( pbox ); +} + +/*--------------------------------------------------------------------*/ + +int main( int argc , char * argv[] ) +{ + int np_max = 256 ; + int box[3][2] = { { 0 , 64 } , { 0 , 64 } , { 0 , 64 } }; + int np = 0 ; + + switch( argc ) { + case 3: + sscanf(argv[1],"%d",&np); + sscanf(argv[2],"%dx%dx%d",& box[0][1] , & box[1][1] , & box[2][1] ); + if ( 0 < np ) { test_box( (const int (*)[2]) box , np ); } + if ( 0 < np ) { test_maps( (const int (*)[2]) box , np ); } + break ; + default: + for ( np = 1 ; np <= np_max ; ++np ) { + test_box( (const int (*)[2]) box , np ); + test_maps( (const int (*)[2]) box , np ); + } + break ; + } + return 0 ; +} + +#endif + + diff --git a/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/hhpccg/BoxPartitionIB.h b/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/hhpccg/BoxPartitionIB.h new file mode 100644 index 0000000000..71d71f59dd --- /dev/null +++ b/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/hhpccg/BoxPartitionIB.h @@ -0,0 +1,88 @@ + + +#ifndef BoxPartionIB_h +#define BoxPartionIB_h + +/** \brief Partition a { [ix,jx) X [iy,jy) X [iz,jz) } box. + * + * Use recursive coordinate bisection to partition a box + * into np disjoint sub-boxes. Allocate (via malloc) and + * populate the sub-boxes, mapping the local (x,y,z) to + * a local ordinal, and mappings for the send-recv messages + * to update the ghost cells. + * + * Order local ordinates as follows: + * { + * interior , + * boundary , + * remote[ ( my_p + i ) % np ] + * } + * where i = 1..(np-1) + * + * usage: + * + * my_nx = pbox[my_p][0][1] - pbox[my_p][0][0] ; + * my_ny = pbox[my_p][1][1] - pbox[my_p][1][0] ; + * my_nz = pbox[my_p][2][1] - pbox[my_p][2][0] ; + * + * for ( x = -ghost ; x < my_nx + ghost ; ++x ) { + * for ( y = -ghost ; y < my_ny + ghost ; ++y ) { + * for ( z = -ghost ; z < my_nz + ghost ; ++z ) { + * const int x_global = x + pbox[my_p][0][0] ; + * const int y_global = y + pbox[my_p][1][0] ; + * const int z_global = z + pbox[my_p][2][0] ; + * + * const int local_ordinal = + * box_map_local( pbox[my_p], ghost, map_local_id, x, y, z ); + * + * if ( 0 <= local_ordinal ) { + * } + * } + * + * for ( i = 1 ; i < np ; ++i ) { + * const int recv_processor = ( my_p + i ) % np ; + * const int recv_ordinal_begin = map_recv_pc[i]; + * const int recv_ordinal_end = map_recv_pc[i+1]; + * } + * + * for ( i = 1 ; i < np ; ++i ) { + * const int send_processor = ( my_p + i ) % np ; + * const int send_map_begin = map_send_pc[i]; + * const int send_map_end = map_send_pc[i+1]; + * for ( j = send_map_begin ; j < send_map_end ; ++j ) { + * send_ordinal = map_send_id[j] ; + * } + * } + */ + + +void box_partition_rcb( + const int np /**< [in] Number of partitions */ , + const int root_box[3][2] /**< [in] Global 3D box to partition */ , + int pbox[][3][2] /**< [out] Partition of global 3D boxes */ ); + +void box_partition_map( + const int np /**< [in] Number of partitions */ , + const int my_p /**< [in] My partition */ , + const int gbox[3][2] /**< [in] Global 3D box */ , + const int pbox[][3][2] /**< [in] Partitions of global 3D box */ , + const int ghost /**< [in] Number of grid points to ghost */ , + + int map_uses_box[3][2] /**< [out] Local box expanded by ghosting */ , + int map_local_id[] /**< [out] Mapping for local points */ , + int * map_count_interior /**< [out] Number of my interior points */ , + int * map_count_owns /**< [out] Number of points I own */ , + int * map_count_uses /**< [out] Number of points I access */ , + int ** map_recv_pc /**< [out] Received prefix spans per process */ , + int ** map_send_pc /**< [out] Send prefix counts per process */ , + int ** map_send_id /**< [out] Send grid points */ ); + +/* \brief Map a global (x,y,z) to a local ordinal. */ +int box_map_local( const int local_uses[3][2] , + const int map_local_id[] , + const int global_x , + const int global_y , + const int global_z ); + +#endif + diff --git a/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/hhpccg/CGSolver.c b/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/hhpccg/CGSolver.c new file mode 100644 index 0000000000..55f739dd09 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/hhpccg/CGSolver.c @@ -0,0 +1,311 @@ + +#include +#include +#include +#include + +#include +#include +#include +#include + +#ifdef HAVE_MPI +#include +#endif + +/*--------------------------------------------------------------------*/ + +void cgsolve_set_lhs( const struct distributed_crs_matrix * const matrix , + const VECTOR_SCALAR * const x , + VECTOR_SCALAR * const b ) +{ + const int nRow = matrix->n_local_row ; + const int nVec = matrix->p_recv_pc[ matrix->p_size ] ; + + VECTOR_SCALAR * const p = + (VECTOR_SCALAR *) malloc( nVec * sizeof(VECTOR_SCALAR) ); + + tpi_copy( nRow , x , p ); + + dcrs_apply( matrix , p , b ); + + free( p ); +} + +/*--------------------------------------------------------------------*/ + +/* x += alpha * p ; + * r -= alpha * Ap ; + * return dot( r , r ); + */ +static +double cgsolver_update( const int length , + const VECTOR_SCALAR alpha , + const VECTOR_SCALAR * p , + const VECTOR_SCALAR * Ap , + VECTOR_SCALAR * x , + VECTOR_SCALAR * r ); + +/*--------------------------------------------------------------------*/ + +void cgsolve_blas( const struct distributed_crs_matrix * matrix , + const VECTOR_SCALAR * const b , + VECTOR_SCALAR * const x , + const VECTOR_SCALAR tolerance , + const int max_iter , + const int print_iter , + int * const iter_count , + VECTOR_SCALAR * const norm_resid , + double * const solve_dt ) +{ + const int nRow = matrix->n_local_row ; + const int nVec = matrix->p_recv_pc[ matrix->p_size ] ; + + const VECTOR_SCALAR tol_2 = tolerance * tolerance ; + + VECTOR_SCALAR * const r = + (VECTOR_SCALAR *) malloc( nRow * sizeof(VECTOR_SCALAR) ); + VECTOR_SCALAR * const p = + (VECTOR_SCALAR *) malloc( nVec * sizeof(VECTOR_SCALAR) ); + VECTOR_SCALAR * const Ap = + (VECTOR_SCALAR *) malloc( nRow * sizeof(VECTOR_SCALAR) ); + + VECTOR_SCALAR rtrans = 0.0 ; + VECTOR_SCALAR beta = 0.0 ; + VECTOR_SCALAR pAp = 0.0 ; + VECTOR_SCALAR alpha ; + double time_begin , time_end ; + + int k ; + + tpi_copy( nRow , b , r ); + tpi_copy( nRow , x , p ); + + /* Ap = matrix * p ; */ + dcrs_apply( matrix , p , Ap ); + + /* r -= Ap ; */ + tpi_axpy( nRow , -1.0 , Ap , r ); + + rtrans = tpi_dot( nRow , r , r ); + + time_begin = TPI_Walltime(); + + for ( k = 0 ; k < max_iter && tol_2 < rtrans ; ++k ) { + + /* p = r + beta * p ; */ + tpi_xpby( nRow, r, beta, p ); /* parallel */ + + dcrs_apply( matrix , p , Ap ); + + pAp = tpi_dot( nRow , p , Ap ); + + /* If orthogonal then cannot update */ + alpha = 0 < fabs( pAp ) ? rtrans / pAp : 0.0 ; + + /* x += alpha * p ; + * r -= alpha * Ap ; + * return dot( r , r ); + */ + beta = rtrans ; + + tpi_axpy( nRow , alpha , p , x ); + tpi_axpy( nRow , -alpha , Ap , r ); + rtrans = tpi_dot( nRow , r , r ); + beta = rtrans / beta ; + } + + time_end = TPI_Walltime(); + +#ifdef HAVE_MPI + { + double tb = time_begin ; + double te = time_end ; + MPI_Allreduce(&tb, &time_begin, 1, MPI_DOUBLE, MPI_MIN, MPI_COMM_WORLD); + MPI_Allreduce(&te, &time_end, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); + } +#endif + + *solve_dt += time_end - time_begin ; + + *norm_resid = sqrt( rtrans ); + *iter_count = k ; + + free( Ap ); + free( p ); + free( r ); +} + +/*--------------------------------------------------------------------*/ +/*--------------------------------------------------------------------*/ + +void cgsolve( const struct distributed_crs_matrix * matrix , + const VECTOR_SCALAR * const b , + VECTOR_SCALAR * const x , + const int overlap_comm , + const VECTOR_SCALAR tolerance , + const int max_iter , + const int print_iter , + int * const iter_count , + VECTOR_SCALAR * const norm_resid , + double * const solve_dt ) +{ + const int nRow = matrix->n_local_row ; + const int nVec = matrix->p_recv_pc[ matrix->p_size ] ; + + const VECTOR_SCALAR tol_2 = tolerance * tolerance ; + + VECTOR_SCALAR * const r = + (VECTOR_SCALAR *) malloc( nRow * sizeof(VECTOR_SCALAR) ); + VECTOR_SCALAR * const p = + (VECTOR_SCALAR *) malloc( nVec * sizeof(VECTOR_SCALAR) ); + VECTOR_SCALAR * const Ap = + (VECTOR_SCALAR *) malloc( nRow * sizeof(VECTOR_SCALAR) ); + + VECTOR_SCALAR rtrans = 0.0 ; + VECTOR_SCALAR beta = 0.0 ; + VECTOR_SCALAR pAp = 0.0 ; + VECTOR_SCALAR alpha ; + double time_begin , time_end ; + + int k ; + + tpi_copy( nRow , b , r ); + tpi_copy( nRow , x , p ); + + /* gather off-processor components of 'p'. + * Ap = matrix * p ; + * return dot( Ap , p ); + */ + pAp = dcrs_apply_and_dot( matrix , p , Ap , overlap_comm ); + + /* r -= 1.0 * Ap ; + * return dot( r , r ); + */ + alpha = 1.0 ; + rtrans = cgsolver_update( nRow, alpha, NULL, Ap, NULL, r ); /* parallel */ + + time_begin = TPI_Walltime(); + + for ( k = 0 ; k < max_iter && tol_2 < rtrans ; ++k ) { + + /* p = r + beta * p ; */ + tpi_xpby( nRow, r, beta, p ); /* parallel */ + + /* gather off-processor components of 'p'. + * Ap = matrix * p ; + * return dot( Ap , p ); + */ + pAp = dcrs_apply_and_dot( matrix , p , Ap , overlap_comm ); /* parallel */ + + /* If orthogonal then cannot update */ + alpha = 0 < fabs( pAp ) ? rtrans / pAp : 0.0 ; + + /* x += alpha * p ; + * r -= alpha * Ap ; + * return dot( r , r ); + */ + beta = rtrans ; + rtrans = cgsolver_update( nRow , alpha , p , Ap , x , r ); /* parallel */ + beta = rtrans / beta ; + } + + time_end = TPI_Walltime(); + +#ifdef HAVE_MPI + { + double tb = time_begin ; + double te = time_end ; + MPI_Allreduce(&tb, &time_begin, 1, MPI_DOUBLE, MPI_MIN, MPI_COMM_WORLD); + MPI_Allreduce(&te, &time_end, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); + } +#endif + + *solve_dt += time_end - time_begin ; + + *norm_resid = sqrt( rtrans ); + *iter_count = k ; + + free( Ap ); + free( p ); + free( r ); +} + +/*--------------------------------------------------------------------*/ + +struct tpi_work_cgsolve { + const VECTOR_SCALAR * p ; + const VECTOR_SCALAR * Ap ; + VECTOR_SCALAR * x ; + VECTOR_SCALAR * r ; + VECTOR_SCALAR alpha ; + int length ; +}; + +static void tpi_work_dot_join( TPI_Work * work , const void * src ) +{ *((double *) work->reduce ) += *((const double *) src); } + +static void tpi_work_dot_init( TPI_Work * work ) +{ *((double *) work->reduce ) = 0 ; } + +static void tpi_work_update( TPI_Work * work ) +{ + const struct tpi_work_cgsolve * const cg_work = + (const struct tpi_work_cgsolve *) work->info ; + + const int length = cg_work->length ; + const VECTOR_SCALAR alpha = cg_work->alpha ; + const VECTOR_SCALAR * const p = cg_work->p ; + const VECTOR_SCALAR * const Ap = cg_work->Ap ; + VECTOR_SCALAR * const x = cg_work->x ; + VECTOR_SCALAR * const r = cg_work->r ; + + double mag = 0 ; + int iBeg , iEnd , i ; + + tpi_work_span( work , length , & iBeg , & iEnd ); + + if ( x ) { for ( i = iBeg ; i < iEnd ; ++i ) { x[i] += alpha * p[i]; } } + + for ( i = iBeg ; i < iEnd ; ++i ) { + const VECTOR_SCALAR val = ( r[i] -= alpha * Ap[i] ); + mag += val * val ; + } + + *((double*) work->reduce ) = mag ; +} + +double cgsolver_update( const int length , + const VECTOR_SCALAR alpha , + const VECTOR_SCALAR * p , + const VECTOR_SCALAR * Ap , + VECTOR_SCALAR * x , + VECTOR_SCALAR * r ) +{ + struct tpi_work_cgsolve work ; + + double result = 0.0 ; + + work.length = length ; + work.alpha = alpha ; + work.p = p ; + work.Ap = Ap ; + work.x = x ; + work.r = r ; + + TPI_Run_threads_reduce( tpi_work_update , & work , + tpi_work_dot_join , tpi_work_dot_init , + sizeof(result) , & result ); + +#ifdef HAVE_MPI + { + double local = result ; + MPI_Allreduce( & local, & result, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD ); + } +#endif + + return result ; +} + +/*--------------------------------------------------------------------*/ + diff --git a/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/hhpccg/CGSolver.h b/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/hhpccg/CGSolver.h new file mode 100644 index 0000000000..f0ee6f622c --- /dev/null +++ b/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/hhpccg/CGSolver.h @@ -0,0 +1,40 @@ + +#ifndef CGSolver_h +#define CGSolver_h + +#include +#include + +/*--------------------------------------------------------------------*/ + +void cgsolve_set_lhs( const struct distributed_crs_matrix * matrix , + const VECTOR_SCALAR * const x , + VECTOR_SCALAR * const b ); + +/* Solve with fused loops */ +void cgsolve( const struct distributed_crs_matrix * matrix , + const VECTOR_SCALAR * const b , + VECTOR_SCALAR * const x , + const int overlap_comm , + const VECTOR_SCALAR tolerance , + const int max_iter , + const int print_iter , + int * const iter_count , + VECTOR_SCALAR * const norm_resid , + double * const solve_dt ); + +/* Solve with blas-like calls */ +void cgsolve_blas( const struct distributed_crs_matrix * matrix , + const VECTOR_SCALAR * const b , + VECTOR_SCALAR * const x , + const VECTOR_SCALAR tolerance , + const int max_iter , + const int print_iter , + int * const iter_count , + VECTOR_SCALAR * const norm_resid , + double * const solve_dt ); + +/*--------------------------------------------------------------------*/ + +#endif + diff --git a/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/hhpccg/CMakeLists.txt b/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/hhpccg/CMakeLists.txt new file mode 100644 index 0000000000..0c652cde7a --- /dev/null +++ b/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/hhpccg/CMakeLists.txt @@ -0,0 +1,83 @@ + +INCLUDE(PackageAddExecutableAndTest) +INCLUDE(PackageLibraryMacros) + +#################### + +SET(HEADERS "") +SET(SOURCES "") + +INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) + +SET(HEADERS ${HEADERS} + ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}_config.h + ) + +INCLUDE_DIRECTORIES(REQUIRED_DURING_INSTALLATION_TESTING ${CMAKE_CURRENT_SOURCE_DIR}) + +APPEND_SET(HEADERS + BoxPartition.h + CGSolver.h + tpi_vector.h + dcrs_matrix.h + ) + +#################### + + +PACKAGE_ADD_EXECUTABLE( + test_tpi_hhpccg + COMM serial mpi + SOURCES main.c CGSolver.c BoxPartitionIB.c tpi_vector.c dcrs_matrix.c + DEPLIBS pthread m + DIRECTORY . + ) + +PACKAGE_ADD_TEST( + test_tpi_hhpccg + NAME test_tpi_hhpccg_serial_1 + COMM serial + DIRECTORY . + ) + +PACKAGE_ADD_TEST( + test_tpi_hhpccg + NAME test_tpi_hhpccg_serial_2 + COMM serial + ARGS "threads=2" + DIRECTORY . + ) + +PACKAGE_ADD_TEST( + test_tpi_hhpccg + NAME test_tpi_hhpccg_serial_4 + COMM serial + ARGS "threads=4" + DIRECTORY . + ) + +PACKAGE_ADD_TEST( + test_tpi_hhpccg + NAME test_tpi_hhpccg_mpi_1 + COMM mpi + NUM_MPI_PROCS 1 + DIRECTORY . + ) + +PACKAGE_ADD_TEST( + test_tpi_hhpccg + NAME test_tpi_hhpccg_mpi_2 + COMM mpi + NUM_MPI_PROCS 2 + DIRECTORY . + ) + +PACKAGE_ADD_TEST( + test_tpi_hhpccg + NAME test_tpi_hhpccg_mpi_4 + COMM mpi + NUM_MPI_PROCS 4 + DIRECTORY . + ) + + diff --git a/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/hhpccg/dcrs_matrix.c b/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/hhpccg/dcrs_matrix.c new file mode 100644 index 0000000000..d61404fc19 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/hhpccg/dcrs_matrix.c @@ -0,0 +1,314 @@ + +#include +#include + +#include +#include + +#ifdef HAVE_MPI +#include +#endif + +#include + +/*--------------------------------------------------------------------*/ +/*--------------------------------------------------------------------*/ + +#if ! defined( HAVE_MPI ) + +static +double comm_sum( double v ) { return v ; } + +#define get_off_process_entries( M , V ) /* */ + +/*--------------------------------------------------------------------*/ +#else /* defined( HAVE_MPI ) */ +/*--------------------------------------------------------------------*/ + +static +double comm_sum( double v ) +{ + double result = 0 ; + MPI_Allreduce( & v , & result , 1 , MPI_DOUBLE , MPI_SUM , MPI_COMM_WORLD ); + return result ; +} + +static +void get_off_process_entries( + const struct distributed_crs_matrix * const matrix , + VECTOR_SCALAR * const vec ) +{ + const int np = matrix->p_size ; + const int my_p = matrix->p_rank ; + const int * const recv_pc = matrix->p_recv_pc ; + const int * const send_pc = matrix->p_send_pc ; + const int * const send_id = matrix->p_send_id ; + int i , irecv ; + + for ( irecv = 0 , i = 1 ; i < np ; ++i ) { + if ( recv_pc[i] < recv_pc[i+1] ) ++irecv ; + } + + { + VECTOR_SCALAR * const send_buf = + (VECTOR_SCALAR *) malloc( sizeof(VECTOR_SCALAR) * send_pc[np] ); + + MPI_Request * const recv_request = + (MPI_Request *) malloc( sizeof(MPI_Request) * irecv ); + + MPI_Status * const recv_status = + (MPI_Status *) malloc( sizeof(MPI_Status) * irecv ); + + for ( irecv = 0 , i = 1 ; i < np ; ++i ) { + const int ip = ( i + my_p ) % np ; + const int recv_beg = recv_pc[i]; + const int recv_length = recv_pc[i+1] - recv_beg ; + if ( recv_length ) { + MPI_Irecv( vec + recv_beg , + recv_length * sizeof(VECTOR_SCALAR), MPI_BYTE , + ip , 0 , MPI_COMM_WORLD , recv_request + irecv ); + ++irecv ; + } + } + + /* Gather components into send buffer */ + + for ( i = 0 ; i < send_pc[np] ; ++i ) { + send_buf[i] = vec[ send_id[i] ]; + } + + MPI_Barrier( MPI_COMM_WORLD ); + + for ( i = 1 ; i < np ; ++i ) { + const int ip = ( i + my_p ) % np ; + const int send_beg = send_pc[i]; + const int send_length = send_pc[i+1] - send_beg ; + if ( send_length ) { /* Send to 'i' */ + MPI_Rsend( send_buf + send_beg , + send_length * sizeof(VECTOR_SCALAR), MPI_BYTE , + ip , 0 , MPI_COMM_WORLD ); + } + } + + MPI_Waitall( irecv , recv_request , recv_status ); + + free( recv_status ); + free( recv_request ); + free( send_buf ); + } +} + +#endif + +/*--------------------------------------------------------------------*/ +/*--------------------------------------------------------------------*/ + +static void dcrs_apply_and_dot_span( + const struct distributed_crs_matrix * const matrix , + const int span_begin , + const int span_end , + const VECTOR_SCALAR * const x , + VECTOR_SCALAR * const y , + double * const result ) +{ + const int * const A_pc = matrix->A_pc ; + const int * const A_ia = matrix->A_ia ; + const MATRIX_SCALAR * const A_a = matrix->A_a ; + + double dot_x_y = *result ; + + int row = span_begin ; + + for ( ; row < span_end ; ++row ) { + const int pcBeg = A_pc[ row ]; + const int pcEnd = A_pc[ row + 1 ]; + + const int * ia = A_ia + pcBeg ; + const MATRIX_SCALAR * a = A_a + pcBeg ; + const MATRIX_SCALAR * const a_end = A_a + pcEnd ; + + VECTOR_SCALAR y_tmp = 0 ; + for ( ; a != a_end ; ++a , ++ia ) { + y_tmp += *a * x[ *ia ]; + } + dot_x_y += x[ row ] * y_tmp ; + y[ row ] = y_tmp ; + } + + *result = dot_x_y ; +} + +static void dcrs_apply_span( + const struct distributed_crs_matrix * const matrix , + const int span_begin , + const int span_end , + const VECTOR_SCALAR * const x , + VECTOR_SCALAR * const y ) +{ + const int * const A_pc = matrix->A_pc ; + const int * const A_ia = matrix->A_ia ; + const MATRIX_SCALAR * const A_a = matrix->A_a ; + + int row = span_begin ; + + for ( ; row < span_end ; ++row ) { + const int pcBeg = A_pc[ row ]; + const int pcEnd = A_pc[ row + 1 ]; + + const int * ia = A_ia + pcBeg ; + const MATRIX_SCALAR * a = A_a + pcBeg ; + const MATRIX_SCALAR * const a_end = A_a + pcEnd ; + + VECTOR_SCALAR y_tmp = 0 ; + for ( ; a != a_end ; ++a , ++ia ) { + y_tmp += *a * x[ *ia ]; + } + y[ row ] = y_tmp ; + } +} + +static void work_span( const int count , const int rank , + int * jBeg , int * jEnd ) +{ + const int length = *jEnd - *jBeg ; + const int chunk = ( length + count - 1 ) / count ; + const int begin = chunk * rank ; + int end = begin + chunk ; + + if ( length < end ) { end = length ; } + + *jEnd = *jBeg + end ; + *jBeg += begin ; +} + +/*--------------------------------------------------------------------*/ +/*--------------------------------------------------------------------*/ + +static void tpi_work_dot_join( TPI_Work * work , const void * src ) +{ *((double *) ( work->reduce) ) += *((const double *) src); } + +static void tpi_work_dot_init( TPI_Work * work ) +{ *((double *) ( work->reduce) ) = 0 ; } + +/*--------------------------------------------------------------------*/ + +struct work_dcrs { + const struct distributed_crs_matrix * matrix ; + const VECTOR_SCALAR * x ; + VECTOR_SCALAR * y ; + int jBeg ; + int jEnd ; +}; + +/*--------------------------------------------------------------------*/ + +static void tpi_work_dcrs_apply_and_dot( TPI_Work * work ) +{ + const struct work_dcrs * const info = (const struct work_dcrs *) work->info ; + + int local_begin = info->jBeg ; + int local_end = info->jEnd ; + + work_span( work->count , work->rank , & local_begin , & local_end ); + + dcrs_apply_and_dot_span( info->matrix , local_begin , local_end , + info->x , info->y , (double *) work->reduce ); +} + +double dcrs_apply_and_dot( + const struct distributed_crs_matrix * matrix , + VECTOR_SCALAR * x , + VECTOR_SCALAR * y , + const int overlap_communication ) +{ + struct work_dcrs info ; + + double result = 0.0 ; + + info.matrix = matrix ; + info.x = x ; + info.y = y ; + + if ( overlap_communication && + matrix->n_internal_row < matrix->n_local_row ) { + + double remote_result = 0 ; + + /* Start the internal matrix-vector multiply */ + /* result += dot( output = A * input , input ); */ + + info.jBeg = 0 ; + info.jEnd = matrix->n_internal_row ; + + /* Divide internal work evenly among worker threads. + * This leave the primary thread completely out of the computation. + */ + TPI_Start_threads_reduce( tpi_work_dcrs_apply_and_dot , & info , + tpi_work_dot_join , + tpi_work_dot_init , + sizeof(result) , & result ); + + get_off_process_entries( matrix , x ); + + TPI_Wait(); /* Wait for internal result */ + + info.jBeg = matrix->n_internal_row ; + info.jEnd = matrix->n_local_row ; + + TPI_Run_threads_reduce( tpi_work_dcrs_apply_and_dot , & info , + tpi_work_dot_join , + tpi_work_dot_init , + sizeof(remote_result) , & remote_result ); + + result += remote_result ; + } + else { + info.jBeg = 0 ; + info.jEnd = matrix->n_local_row ; + + get_off_process_entries( matrix , x ); + + TPI_Run_threads_reduce( tpi_work_dcrs_apply_and_dot , & info , + tpi_work_dot_join , + tpi_work_dot_init , + sizeof(result) , & result ); + } + + result = comm_sum( result ); + + return result ; +} + +/*--------------------------------------------------------------------*/ + +static void tpi_work_dcrs_apply( TPI_Work * work ) +{ + const struct work_dcrs * const info = (const struct work_dcrs *) work->info ; + + int local_begin = info->jBeg ; + int local_end = info->jEnd ; + + work_span( work->count , work->rank , & local_begin , & local_end ); + + dcrs_apply_span( info->matrix , local_begin , local_end , + info->x , info->y ); +} + +void dcrs_apply( + const struct distributed_crs_matrix * matrix , + VECTOR_SCALAR * x , + VECTOR_SCALAR * y ) +{ + struct work_dcrs info ; + + info.matrix = matrix ; + info.x = x ; + info.y = y ; + info.jBeg = 0 ; + info.jEnd = matrix->n_local_row ; + + get_off_process_entries( matrix , x ); + + TPI_Run_threads( tpi_work_dcrs_apply , & info , 0 ); +} + diff --git a/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/hhpccg/dcrs_matrix.h b/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/hhpccg/dcrs_matrix.h new file mode 100644 index 0000000000..61f2032eff --- /dev/null +++ b/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/hhpccg/dcrs_matrix.h @@ -0,0 +1,41 @@ + +#ifndef dcrs_matrix_h +#define dcrs_matrix_h + +#include + +struct distributed_crs_matrix { + /* Global parallel */ + int p_size ; + int p_rank ; + int * p_recv_pc ; /* [np+1], span of received off-processor elements */ + int * p_send_pc ; /* [np+1], span of sent off-processor elements */ + int * p_send_id ; /* [send_pc[np]], indices of sent elements */ + + /* Local and local parallel */ + int n_local_column ; /* Number of local columns */ + int n_local_row ; /* Number of local rows */ + int n_internal_row ; /* Number of local rows with internal columns */ + int * A_pc ; /* Offsets into A_ia array for column indices */ + int * A_ia ; + MATRIX_SCALAR * A_a ; +}; + +/* 1) communicate off-processor portions of input. + * 2) apply: output = matrix * input ; + * 3) return: dot( output , input ); + */ +double dcrs_apply_and_dot( const struct distributed_crs_matrix * matrix , + VECTOR_SCALAR * input , + VECTOR_SCALAR * output , + const int overlap_communication ); + +/* 1) communicate off-processor portions of input. + * 2) apply: output = matrix * input ; + */ +void dcrs_apply( const struct distributed_crs_matrix * matrix , + VECTOR_SCALAR * input , + VECTOR_SCALAR * output ); + +#endif + diff --git a/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/hhpccg/main.c b/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/hhpccg/main.c new file mode 100644 index 0000000000..57bb80a8d2 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/hhpccg/main.c @@ -0,0 +1,422 @@ + +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#ifdef HAVE_MPI +#include +#endif + +/*--------------------------------------------------------------------*/ +static +void hpccg_alloc_and_fill( const int np , + const int my_p , + const int gbox[][2] , + const int ghost , + struct distributed_crs_matrix * const matrix ); + +/*--------------------------------------------------------------------*/ + +int main( int argc , char ** argv ) +{ + const int ghost = 1 ; + const int max_cube = 20 ; + int ncube[20] = { 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , + 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }; + + FILE * print_file = stdout ; + int print_iter = 500 ; + int max_iter = 50 ; + int overlap_comm = 0 ; + + float tolerance = 0.0 ; /* Force max iterations */ + + int gbox[3][2] = { { 0 , 16 } , { 0 , 16 } , { 0 , 16 } }; + int nt = 0 ; + int trials = 6 ; + int ntest ; + int np = 1; + int my_p = 0 ; + +#ifdef HAVE_MPI + MPI_Init( & argc , & argv ); + MPI_Comm_size( MPI_COMM_WORLD , & np ); + MPI_Comm_rank( MPI_COMM_WORLD , & my_p ); +#endif + + if ( ! my_p ) { + const char arg_threads[] = "threads=" ; + const char arg_cube[] = "cube=" ; + const char arg_box[] = "box=" ; + const char arg_max[] = "max_iter=" ; + const char arg_trials[] = "trials=" ; + const char arg_print[] = "print_iter=" ; + const char arg_file[] = "print_file=" ; + const char arg_comm[] = "overlap_comm=" ; + const char arg_tolerance[] = "tolerance=" ; + int i ; + for ( i = 1 ; i < argc ; ++i ) { + if ( ! strncmp(argv[i],arg_threads,strlen(arg_threads)) ) { + sscanf(argv[i]+strlen(arg_threads),"%d",&nt); + } + else if ( ! strncmp(argv[i],arg_box,strlen(arg_box)) ) { + sscanf(argv[i]+strlen(arg_box),"%d%*[x]%d%*[x]%d", + & gbox[0][1] , & gbox[1][1] , & gbox[2][1] ); + } + else if ( ! strncmp(argv[i],arg_cube,strlen(arg_cube)) ) { + sscanf(argv[i]+strlen(arg_cube), + "%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d", + ncube+0, ncube+1, ncube+2, ncube+3, ncube+4, + ncube+5, ncube+6, ncube+7, ncube+8, ncube+9, + ncube+10, ncube+11, ncube+12, ncube+13, ncube+14, + ncube+15, ncube+16, ncube+17, ncube+18, ncube+19); + } + else if ( ! strncmp(argv[i],arg_max,strlen(arg_max)) ) { + sscanf(argv[i]+strlen(arg_max),"%d",&max_iter); + } + else if ( ! strncmp(argv[i],arg_trials,strlen(arg_trials)) ) { + sscanf(argv[i]+strlen(arg_trials),"%d",&trials); + } + else if ( ! strncmp(argv[i],arg_print,strlen(arg_print)) ) { + sscanf(argv[i]+strlen(arg_print),"%d",&print_iter); + } + else if ( ! strncmp(argv[i],arg_comm,strlen(arg_comm)) ) { + sscanf(argv[i]+strlen(arg_print),"%d",&overlap_comm); + } + else if ( ! strncmp(argv[i],arg_tolerance,strlen(arg_tolerance)) ) { + sscanf(argv[i]+strlen(arg_print),"%f",&tolerance); + } + else if ( ! strncmp(argv[i],arg_file,strlen(arg_file)) ) { + char buffer[256] ; + sscanf(argv[i]+strlen(arg_file),"%s",buffer); + print_file = fopen(buffer,"a"); + } + } + } + +#ifdef HAVE_MPI + { + MPI_Bcast( & nt , 1 , MPI_INT , 0 , MPI_COMM_WORLD ); + MPI_Bcast( & gbox[0][0] , 6 , MPI_INT , 0 , MPI_COMM_WORLD ); + MPI_Bcast( ncube , max_cube , MPI_INT , 0 , MPI_COMM_WORLD ); + MPI_Bcast( & overlap_comm , 1 , MPI_INT , 0 , MPI_COMM_WORLD ); + MPI_Bcast( & max_iter , 1 , MPI_INT , 0 , MPI_COMM_WORLD ); + MPI_Bcast( & print_iter , 1 , MPI_INT , 0 , MPI_COMM_WORLD ); + MPI_Bcast( & trials , 1 , MPI_INT , 0 , MPI_COMM_WORLD ); + MPI_Bcast( & tolerance , 1 , MPI_FLOAT , 0 , MPI_COMM_WORLD ); + } +#endif + + if ( nt ) { + TPI_Init( nt ); + TPI_Block(); + TPI_Unblock(); + } + + if ( ! my_p ) { + fprintf(print_file,"\"PROC\" , \"THREAD\" , \"EQUATION\" , \"NON-ZERO\" , \"FUSED-AVG\", \"FUSED-MAX\", \"BLAS-AVG\", \"BLAS-MAX\", \"FUSED\", \"BLAS\" , \"Iter\"\n"); + fprintf(print_file,"\"COUNT\", \"COUNT\" , \"COUNT\" , \"COUNT\" , \"Mflops\" , \"Mflops\" , \"Mflops\" , \"Mflops\" , \"error\", \"error\" , \"COUNT\"\n"); + } + + for ( ntest = 0 ; ! ntest || ( ntest < max_cube && ncube[ntest] ) ; ++ntest ) { + struct distributed_crs_matrix matrix ; + + if ( ncube[ntest] ) { + gbox[0][1] = gbox[1][1] = gbox[2][1] = ncube[ntest] ; + } + + hpccg_alloc_and_fill( np, my_p, (const int (*)[2]) gbox, ghost, &matrix); + + { + const int nRow = matrix.n_local_row ; + + double solve_dt[2] = { 0 , 0 }; + double solve_blas_dt[2] = { 0 , 0 }; + VECTOR_SCALAR norm_resid = 0.0 ; + VECTOR_SCALAR norm_resid_blas = 0.0 ; + int iter_count = 0 ; + int iter_count_blas = 0 ; + int k ; + + VECTOR_SCALAR * const b = (VECTOR_SCALAR *) malloc( sizeof(VECTOR_SCALAR) * nRow ); + VECTOR_SCALAR * const x = (VECTOR_SCALAR *) malloc( sizeof(VECTOR_SCALAR) * nRow ); + VECTOR_SCALAR * const x_blas = (VECTOR_SCALAR *) malloc( sizeof(VECTOR_SCALAR) * nRow ); + VECTOR_SCALAR * const xexact = (VECTOR_SCALAR *) malloc( sizeof(VECTOR_SCALAR) * nRow ); + + { + const VECTOR_SCALAR value = 1.0 /* 1.0 / 3.0 */ ; + int i ; + for ( i = 0 ; i < nRow ; ++i ) xexact[i] = value ; + } + + for ( k = 0 ; k < trials ; ++k ) { + double dt = 0 ; + int i ; + + for ( i = 0 ; i < nRow ; ++i ) { x_blas[i] = 0.0 ; } + + cgsolve_set_lhs( & matrix , xexact , b ); + + cgsolve_blas( & matrix, b, x_blas, + tolerance , max_iter , print_iter , + & iter_count_blas, & norm_resid_blas, & dt ); + + solve_blas_dt[0] += dt ; + if ( ! k || dt < solve_blas_dt[1] ) { solve_blas_dt[1] = dt ; } + } + + for ( k = 0 ; k < trials ; ++k ) { + double dt = 0 ; + int i ; + + for ( i = 0 ; i < nRow ; ++i ) { x[i] = 0.0 ; } + + cgsolve_set_lhs( & matrix , xexact , b ); + + cgsolve( & matrix, b, x, overlap_comm, + tolerance , max_iter , print_iter , + & iter_count, & norm_resid, & dt ); + + solve_dt[0] += dt ; + if ( ! k || dt < solve_dt[1] ) { solve_dt[1] = dt ; } + } + + { + int nnzGlobal = matrix.A_pc[ nRow ]; + double error[3] = { 0 , 0 , 0 }; + + for ( k = 0 ; k < nRow ; ++k ) { + error[0] += xexact[k] * xexact[k] ; + error[1] += ( x[k] - xexact[k] ) * ( x[k] - xexact[k] ); + error[2] += ( x_blas[k] - xexact[k] ) * ( x_blas[k] - xexact[k] ); + } + +#ifdef HAVE_MPI + { + double error_global[3] = { 0.0 , 0.0 , 0.0 }; + int nnz = nnzGlobal ; + + MPI_Allreduce( & nnz , & nnzGlobal , 1 , MPI_INT , MPI_SUM , + MPI_COMM_WORLD ); + + MPI_Allreduce( error , error_global , 3 , MPI_DOUBLE , MPI_SUM , + MPI_COMM_WORLD ); + + error[0] = error_global[0]; + error[1] = error_global[1]; + error[2] = error_global[2]; + } +#endif + + error[0] = sqrt( error[0] ); + error[1] = sqrt( error[1] ); + error[2] = sqrt( error[2] ); + + if ( ! my_p ) { + const int nRowGlobal = ( gbox[0][1] - gbox[0][0] ) * + ( gbox[1][1] - gbox[1][0] ) * + ( gbox[2][1] - gbox[2][0] ); + + const double dt_mean_fuse_step = 1.0e6 * solve_dt[0] / (double) trials ; + const double dt_mean_blas_step = 1.0e6 * solve_blas_dt[0] / (double) trials ; + const double dt_min_fuse_step = 1.0e6 * solve_dt[1] ; + const double dt_min_blas_step = 1.0e6 * solve_blas_dt[1] ; + + const double Mflop_step = 2 * nnzGlobal + + 3 * 2 * nRowGlobal + + 2 * 2 * nRowGlobal ; + + const double Mflop_mean_fuse = Mflop_step * iter_count / dt_mean_fuse_step ; + const double Mflop_mean_blas = Mflop_step * iter_count_blas / dt_mean_blas_step ; + + const double Mflop_max_fuse = Mflop_step * iter_count / dt_min_fuse_step ; + const double Mflop_max_blas = Mflop_step * iter_count_blas / dt_min_blas_step ; + + fprintf(print_file,"%8d , %8d , %8d , %8d , %10g , %10g , %10g , %10g , %10g , %10g , %d\n", + np , nt , nRowGlobal , nnzGlobal , + Mflop_mean_fuse , Mflop_max_fuse , + Mflop_mean_blas , Mflop_max_blas , + error[1] / error[0] , error[2] / error[0] , iter_count ); + fflush(print_file); + } + } + + free( xexact ); + free( x_blas ); + free( x ); + free( b ); + } + free( matrix.A_a ); + free( matrix.A_ia ); + free( matrix.A_pc ); + free( matrix.p_recv_pc ); + free( matrix.p_send_pc ); + free( matrix.p_send_id ); + } + + if ( nt ) { TPI_Finalize(); } + +#ifdef HAVE_MPI + MPI_Finalize(); +#endif + + return 0 ; +} + +/*--------------------------------------------------------------------*/ +/*--------------------------------------------------------------------*/ + +static +void hpccg_alloc_and_fill( const int np , + const int my_p , + const int gbox[][2] , + const int ghost , + struct distributed_crs_matrix * const matrix ) +{ + int (* const pbox)[3][2] = (int (*)[3][2]) malloc( sizeof(int)*np*3*2 ); + + const int (* const my_box)[2] = (const int (*)[2]) pbox[my_p] ; + + int my_uses_box[3][2] ; + int * map_local_ord = NULL; + + matrix->n_local_row = 0 ; + matrix->n_internal_row = 0 ; + matrix->A_pc = NULL ; + matrix->A_ia = NULL ; + matrix->A_a = NULL ; + + matrix->p_size = np ; + matrix->p_rank = my_p ; + matrix->p_recv_pc = NULL ; + matrix->p_send_pc = NULL ; + matrix->p_send_id = NULL ; + + /* Partition the global box */ + box_partition_rcb( np , gbox , pbox ); + + /* Upper bound */ + map_local_ord = (int *) malloc( sizeof(int) * + ( 2 * ghost + my_box[0][1]- my_box[0][0] ) * + ( 2 * ghost + my_box[1][1]- my_box[1][0] ) * + ( 2 * ghost + my_box[2][1]- my_box[2][0] ) ); + + /* Generate local layout with ghosting. */ + box_partition_map( np, my_p, gbox, + (const int (* const)[3][2]) pbox, + ghost, + my_uses_box , map_local_ord , + & matrix->n_internal_row , + & matrix->n_local_row , + & matrix->n_local_column , + & matrix->p_recv_pc , + & matrix->p_send_pc , + & matrix->p_send_id ); + + { + const int nrow = matrix->n_local_row ; + int * const pc = (int *) malloc( sizeof(int) * ( nrow + 1 ) ); + int * ia = NULL ; + MATRIX_SCALAR * a = NULL ; + + int ix , iy , iz ; + int sx , sy , sz ; + + /* Number of non zeros in each matrix row, + * then prefix the array for offsets. + */ + pc[0] = 0 ; + + for ( iz = my_box[2][0] ; iz < my_box[2][1] ; ++iz ) { + for ( iy = my_box[1][0] ; iy < my_box[1][1] ; ++iy ) { + for ( ix = my_box[0][0] ; ix < my_box[0][1] ; ++ix ) { + const int irow = box_map_local( (const int (*const)[2]) my_uses_box, map_local_ord, ix, iy, iz ); + int count = 1 ; /* Count the diagonal */ + + /* Count the off-diagonal terms to follow */ + for ( sz = -1 ; sz <= 1 ; ++sz ) { + for ( sy = -1 ; sy <= 1 ; ++sy ) { + for ( sx = -1 ; sx <= 1 ; ++sx ) { + const int g_ix = ix + sx ; + const int g_iy = iy + sy ; + const int g_iz = iz + sz ; + + if ( my_uses_box[0][0] <= g_ix && g_ix < my_uses_box[0][1] && + my_uses_box[1][0] <= g_iy && g_iy < my_uses_box[1][1] && + my_uses_box[2][0] <= g_iz && g_iz < my_uses_box[2][1] && + ! ( sz == 0 && sy == 0 && sx == 0 ) ) { + /* This column is within global bounds and is not a diagonal */ + ++count ; + } + } + } + } + pc[ irow + 1 ] = count ; + } + } + } + + for ( ix = 0 ; ix < nrow ; ++ix ) { pc[ix+1] += pc[ix] ; } + + ia = (int *) malloc( sizeof(int) * pc[ nrow ] ); + a = (MATRIX_SCALAR *) malloc( sizeof(MATRIX_SCALAR) * pc[ nrow ] ); + + for ( iz = my_box[2][0] ; iz < my_box[2][1] ; ++iz ) { + for ( iy = my_box[1][0] ; iy < my_box[1][1] ; ++iy ) { + for ( ix = my_box[0][0] ; ix < my_box[0][1] ; ++ix ) { + const int irow = box_map_local( (const int (*const)[2]) my_uses_box, map_local_ord, ix, iy, iz ); + int ipc = pc[ irow ]; + + /* Diagonal term first */ + ia[ ipc ] = irow ; + a[ ipc ] = 27.0f ; + ++ipc ; + + /* Off-diagonal terms to follow */ + for ( sz = -1 ; sz <= 1 ; ++sz ) { + for ( sy = -1 ; sy <= 1 ; ++sy ) { + for ( sx = -1 ; sx <= 1 ; ++sx ) { + const int g_ix = ix + sx ; + const int g_iy = iy + sy ; + const int g_iz = iz + sz ; + + if ( my_uses_box[0][0] <= g_ix && g_ix < my_uses_box[0][1] && + my_uses_box[1][0] <= g_iy && g_iy < my_uses_box[1][1] && + my_uses_box[2][0] <= g_iz && g_iz < my_uses_box[2][1] && + ! ( sz == 0 && sy == 0 && sx == 0 ) ) { + /* Column is within global bounds and is not a diagonal */ + /* 'icol' is mapped for communication */ + + const int icol = + box_map_local( (const int (*const)[2]) my_uses_box, map_local_ord, g_ix, g_iy, g_iz ); + + if ( icol < 0 ) { abort(); } + + ia[ ipc ] = icol ; + a[ ipc ] = -1.0f ; + ++ipc ; + } + } + } + } + if ( ipc != pc[ irow + 1 ] ) { abort(); } + } + } + } + + matrix->A_pc = pc ; + matrix->A_ia = ia ; + matrix->A_a = a ; + } + + free( map_local_ord ); + free( pbox ); +} + diff --git a/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/hhpccg/tpi_vector.c b/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/hhpccg/tpi_vector.c new file mode 100644 index 0000000000..e5cc365ea4 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/hhpccg/tpi_vector.c @@ -0,0 +1,277 @@ +#include +#include + +#include +#include +#include + +#if defined( HAVE_MPI ) +#include +#endif + +/*--------------------------------------------------------------------*/ + +struct tpi_work_vector { + VECTOR_SCALAR alpha ; + VECTOR_SCALAR beta ; + const VECTOR_SCALAR * x ; + const VECTOR_SCALAR * y ; + VECTOR_SCALAR * w ; + int n ; +}; + +void tpi_work_span( TPI_Work * const work , const int n , + int * const iBeg , int * const iEnd ) +{ + const int chunk = ( n + work->count - 1 ) / work->count ; + const int i_end = chunk + ( *iBeg = chunk * work->rank ); + + *iEnd = n < i_end ? n : i_end ; +} + +/*--------------------------------------------------------------------*/ + +static void tpi_work_fill( TPI_Work * work ) +{ + const struct tpi_work_vector * const h = + (struct tpi_work_vector *) work->info ; + + const VECTOR_SCALAR alpha = h->alpha ; + VECTOR_SCALAR * const w = h->w ; + + int i , iEnd ; + + tpi_work_span( work , h->n , & i , & iEnd ); + + for ( ; i < iEnd ; ++i ) { w[i] = alpha ; } +} + +void tpi_fill( int n , VECTOR_SCALAR alpha , VECTOR_SCALAR * x ) +{ + struct tpi_work_vector tmp = { 0.0 , 0.0 , NULL , NULL , NULL , 0 }; + tmp.alpha = alpha ; + tmp.w = x ; + tmp.n = n ; + TPI_Run_threads( tpi_work_fill , & tmp , 0 ); +} + +/*--------------------------------------------------------------------*/ + +static void tpi_work_scale( TPI_Work * work ) +{ + const struct tpi_work_vector * const h = + (struct tpi_work_vector *) work->info ; + + const VECTOR_SCALAR beta = h->beta ; + VECTOR_SCALAR * const w = h->w ; + + int i , iEnd ; + + tpi_work_span( work , h->n , & i , & iEnd ); + + for ( ; i < iEnd ; ++i ) { w[i] *= beta ; } +} + +void tpi_scale( int n , const VECTOR_SCALAR alpha , VECTOR_SCALAR * x ) +{ + struct tpi_work_vector tmp = { 0.0 , 0.0 , NULL , NULL , NULL , 0 }; + tmp.alpha = alpha ; + tmp.w = x ; + tmp.n = n ; + TPI_Run_threads( tpi_work_scale , & tmp , 0 ); +} + +/*--------------------------------------------------------------------*/ + +static void tpi_work_copy( TPI_Work * work ) +{ + const struct tpi_work_vector * const h = + (struct tpi_work_vector *) work->info ; + + const VECTOR_SCALAR * const x = h->x ; + VECTOR_SCALAR * const w = h->w ; + + int i , iEnd ; + + tpi_work_span( work , h->n , & i , & iEnd ); + + for ( ; i < iEnd ; ++i ) { w[i] = x[i] ; } +} + +void tpi_copy( int n , const VECTOR_SCALAR * x , VECTOR_SCALAR * y ) +{ + struct tpi_work_vector tmp = { 0.0 , 0.0 , NULL , NULL , NULL , 0 }; + tmp.x = x ; + tmp.w = y ; + tmp.n = n ; + TPI_Run_threads( tpi_work_copy , & tmp , 0 ); +} + +/*--------------------------------------------------------------------*/ + +static void tpi_work_axpby( TPI_Work * work ) +{ + const struct tpi_work_vector * const h = + (struct tpi_work_vector *) work->info ; + + const VECTOR_SCALAR alpha = h->alpha ; + const VECTOR_SCALAR beta = h->beta ; + const VECTOR_SCALAR * const x = h->x ; + VECTOR_SCALAR * const w = h->w ; + + int i , iEnd ; + + tpi_work_span( work , h->n , & i , & iEnd ); + + for ( ; i < iEnd ; ++i ) { w[i] = alpha * x[i] + beta * w[i] ; } +} + +void tpi_axpby( int n , VECTOR_SCALAR alpha , const VECTOR_SCALAR * x , + VECTOR_SCALAR beta , VECTOR_SCALAR * y ) +{ + struct tpi_work_vector tmp = { 0.0 , 0.0 , NULL , NULL , NULL , 0 }; + tmp.alpha = alpha ; + tmp.beta = beta ; + tmp.x = x ; + tmp.w = y ; + tmp.n = n ; + + TPI_Run_threads( tpi_work_axpby , & tmp , 0 ); +} + +/*--------------------------------------------------------------------*/ + +static void tpi_work_axpy( TPI_Work * work ) +{ + const struct tpi_work_vector * const h = + (struct tpi_work_vector *) work->info ; + + const VECTOR_SCALAR alpha = h->alpha ; + const VECTOR_SCALAR * const x = h->x ; + VECTOR_SCALAR * const w = h->w ; + + int i , iEnd ; + + tpi_work_span( work , h->n , & i , & iEnd ); + + for ( ; i < iEnd ; ++i ) { w[i] += alpha * x[i] ; } +} + +void tpi_axpy( int n , VECTOR_SCALAR alpha , const VECTOR_SCALAR * x , + VECTOR_SCALAR * y ) +{ + struct tpi_work_vector tmp = { 0.0 , 0.0 , NULL , NULL , NULL , 0 }; + tmp.alpha = alpha ; + tmp.x = x ; + tmp.w = y ; + tmp.n = n ; + + TPI_Run_threads( tpi_work_axpy , & tmp , 0 ); +} + +/*--------------------------------------------------------------------*/ + +static void tpi_work_xpby( TPI_Work * work ) +{ + const struct tpi_work_vector * const h = + (struct tpi_work_vector *) work->info ; + + const VECTOR_SCALAR beta = h->beta ; + const VECTOR_SCALAR * const x = h->x ; + VECTOR_SCALAR * const w = h->w ; + + int i , iEnd ; + + tpi_work_span( work , h->n , & i , & iEnd ); + + for ( ; i < iEnd ; ++i ) { w[i] = x[i] + beta * w[i] ; } +} + +void tpi_xpby( int n , const VECTOR_SCALAR * x , VECTOR_SCALAR beta , + VECTOR_SCALAR * y ) +{ + struct tpi_work_vector tmp = { 0.0 , 0.0 , NULL , NULL , NULL , 0 }; + tmp.beta = beta ; + tmp.x = x ; + tmp.w = y ; + tmp.n = n ; + + TPI_Run_threads( tpi_work_xpby , & tmp , 0 ); +} + +/*--------------------------------------------------------------------*/ + +static void tpi_work_dot_partial( TPI_Work * work ) +{ + const struct tpi_work_vector * const h = + (struct tpi_work_vector *) work->info ; + + const VECTOR_SCALAR * const x = h->x ; + const VECTOR_SCALAR * const y = h->y ; + double * const s = (double *) work->reduce ; + double tmp = *s ; + int i , iEnd ; + + tpi_work_span( work , h->n , & i , & iEnd ); + + for ( ; i < iEnd ; ++i ) { tmp += x[i] * y[i] ; } + + *s = tmp ; +} + +static void tpi_work_dot_partial_self( TPI_Work * work ) +{ + const struct tpi_work_vector * const h = + (struct tpi_work_vector *) work->info ; + + const VECTOR_SCALAR * const x = h->x ; + double * const s = (double *) work->reduce ; + double tmp = *s ; + + int i , iEnd ; + + tpi_work_span( work , h->n , & i , & iEnd ); + + for ( ; i < iEnd ; ++i ) { const VECTOR_SCALAR d = x[i] ; tmp += d * d ; } + + *s = tmp ; +} + +static void tpi_work_dot_join( TPI_Work * work , const void * src ) +{ + *((double *) ( work->reduce) ) += *((const double *) src); +} + +static void tpi_work_dot_init( TPI_Work * work ) +{ + *((double *) ( work->reduce) ) = 0 ; +} + +double tpi_dot( int n , const VECTOR_SCALAR * x , const VECTOR_SCALAR * y ) +{ + struct tpi_work_vector tmp = { 0.0 , 0.0 , NULL , NULL , NULL , 0 }; + double result = 0.0 ; + tmp.x = x ; + tmp.y = y ; + tmp.n = n ; + if ( x != y ) { + TPI_Run_threads_reduce( tpi_work_dot_partial , & tmp , + tpi_work_dot_join , tpi_work_dot_init , + sizeof(result) , & result ); + } + else { + TPI_Run_threads_reduce( tpi_work_dot_partial_self , & tmp , + tpi_work_dot_join , tpi_work_dot_init , + sizeof(result) , & result ); + } +#if defined HAVE_MPI + { + double tmp = result ; + MPI_Allreduce( & tmp , & result , 1 , MPI_DOUBLE , MPI_SUM , MPI_COMM_WORLD ); + } +#endif + return result ; +} + +/*--------------------------------------------------------------------*/ + diff --git a/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/hhpccg/tpi_vector.h b/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/hhpccg/tpi_vector.h new file mode 100644 index 0000000000..fba628f913 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/hhpccg/tpi_vector.h @@ -0,0 +1,30 @@ + +#ifndef tpi_vector_h +#define tpi_vector_h + +#define VECTOR_SCALAR float +#define MATRIX_SCALAR float + +void tpi_fill( int n , VECTOR_SCALAR alpha , VECTOR_SCALAR * x ); + +void tpi_scale( int n , const VECTOR_SCALAR alpha , VECTOR_SCALAR * x ); + +void tpi_copy( int n , const VECTOR_SCALAR * x , VECTOR_SCALAR * y ); + +void tpi_xpby( int n , const VECTOR_SCALAR * x , + VECTOR_SCALAR beta , VECTOR_SCALAR * y ); + +void tpi_axpy( int n , VECTOR_SCALAR alpha , const VECTOR_SCALAR * x , + VECTOR_SCALAR * y ); + +void tpi_axpby( int n , VECTOR_SCALAR alpha , const VECTOR_SCALAR * x , + VECTOR_SCALAR beta , VECTOR_SCALAR * y ); + +double tpi_dot( int n , const VECTOR_SCALAR * x , + const VECTOR_SCALAR * y ); + +void tpi_work_span( TPI_Work * const work , const int n , + int * const iBeg , int * const iEnd ); + +#endif + diff --git a/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/hpccg/BoxPartition.c b/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/hpccg/BoxPartition.c new file mode 100644 index 0000000000..ef860ae6ed --- /dev/null +++ b/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/hpccg/BoxPartition.c @@ -0,0 +1,487 @@ + +#include +#include + +#include + +/*--------------------------------------------------------------------*/ + +static int box_map_local_entry( const int box[][2] , + const int ghost , + int local_x , + int local_y , + int local_z ) +{ + const int nx = 2 * ghost + box[0][1] - box[0][0] ; + const int ny = 2 * ghost + box[1][1] - box[1][0] ; + const int nz = 2 * ghost + box[2][1] - box[2][0] ; + int result = -1 ; + + local_x += ghost ; + local_y += ghost ; + local_z += ghost ; + + if ( 0 <= local_x && local_x < nx && + 0 <= local_y && local_y < ny && + 0 <= local_z && local_z < nz ) { + + result = local_z * ny * nx + local_y * nx + local_x ; + } + return result ; +} + +int box_map_local( const int box_local[][2] , + const int ghost , + const int box_local_map[] , + const int local_x , + const int local_y , + const int local_z ) +{ + int result = box_map_local_entry(box_local,ghost,local_x,local_y,local_z); + + if ( 0 <= result ) { + result = box_local_map[ result ]; + } + + return result ; +} + +/*--------------------------------------------------------------------*/ +/* Recursively split a box into into (up-ip) sub-boxes */ + +static +void box_partition( int ip , int up , int axis , + const int box[3][2] , + int p_box[][3][2] ) +{ + const int np = up - ip ; + if ( 1 == np ) { + p_box[ip][0][0] = box[0][0] ; p_box[ip][0][1] = box[0][1] ; + p_box[ip][1][0] = box[1][0] ; p_box[ip][1][1] = box[1][1] ; + p_box[ip][2][0] = box[2][0] ; p_box[ip][2][1] = box[2][1] ; + } + else { + const int n = box[ axis ][1] - box[ axis ][0] ; + const int np_low = np / 2 ; /* Rounded down */ + const int np_upp = np - np_low ; + + const int n_upp = (int) (((double) n) * ( ((double)np_upp) / ((double)np))); + const int n_low = n - n_upp ; + const int next_axis = ( axis + 2 ) % 3 ; + + if ( np_low ) { /* P = [ip,ip+np_low) */ + int dbox[3][2] ; + dbox[0][0] = box[0][0] ; dbox[0][1] = box[0][1] ; + dbox[1][0] = box[1][0] ; dbox[1][1] = box[1][1] ; + dbox[2][0] = box[2][0] ; dbox[2][1] = box[2][1] ; + + dbox[ axis ][1] = dbox[ axis ][0] + n_low ; + + box_partition( ip, ip + np_low, next_axis, + (const int (*)[2]) dbox, p_box ); + } + + if ( np_upp ) { /* P = [ip+np_low,ip+np_low+np_upp) */ + int dbox[3][2] ; + dbox[0][0] = box[0][0] ; dbox[0][1] = box[0][1] ; + dbox[1][0] = box[1][0] ; dbox[1][1] = box[1][1] ; + dbox[2][0] = box[2][0] ; dbox[2][1] = box[2][1] ; + + ip += np_low ; + dbox[ axis ][0] += n_low ; + dbox[ axis ][1] = dbox[ axis ][0] + n_upp ; + + box_partition( ip, ip + np_upp, next_axis, + (const int (*)[2]) dbox, p_box ); + } + } +} + +/*--------------------------------------------------------------------*/ + +static int box_disjoint( const int a[3][2] , const int b[3][2] ) +{ + return a[0][1] <= b[0][0] || b[0][1] <= a[0][0] || + a[1][1] <= b[1][0] || b[1][1] <= a[1][0] || + a[2][1] <= b[2][0] || b[2][1] <= a[2][0] ; +} + +static void resize_int( int ** a , int * allocLen , int newLen ) +{ + int k = 32; + while ( k < newLen ) { k <<= 1 ; } + if ( NULL == *a ) + { *a = malloc( sizeof(int)*(*allocLen = k) ); } + else if ( *allocLen < k ) + { *a = realloc(*a , sizeof(int)*(*allocLen = k)); } +} + +static void box_partition_maps( + const int np , + const int my_p , + const int pbox[][3][2] , + const int ghost , + int ** map_local_id , + int ** map_recv_pc , + int ** map_send_pc , + int ** map_send_id ) +{ + const int (*my_box)[2] = pbox[my_p] ; + + const int my_ix = my_box[0][0] ; + const int my_iy = my_box[1][0] ; + const int my_iz = my_box[2][0] ; + const int my_nx = my_box[0][1] - my_box[0][0] ; + const int my_ny = my_box[1][1] - my_box[1][0] ; + const int my_nz = my_box[2][1] - my_box[2][0] ; + + const int my_use_nx = 2 * ghost + my_nx ; + const int my_use_ny = 2 * ghost + my_ny ; + const int my_use_nz = 2 * ghost + my_nz ; + + const int id_length = my_use_nx * my_use_ny * my_use_nz ; + + int * local_id = (int *) malloc( id_length * sizeof(int) ); + int * recv_pc = (int *) malloc( ( np + 1 ) * sizeof(int) ); + int * send_pc = (int *) malloc( ( np + 1 ) * sizeof(int) ); + + int * send_id = NULL ; + int send_id_size = 0 ; + + int iLocal , iSend ; + int i ; + + int my_use_box[3][2] ; + + my_use_box[0][0] = my_box[0][0] - ghost ; + my_use_box[0][1] = my_box[0][1] + ghost ; + my_use_box[1][0] = my_box[1][0] - ghost ; + my_use_box[1][1] = my_box[1][1] + ghost ; + my_use_box[2][0] = my_box[2][0] - ghost ; + my_use_box[2][1] = my_box[2][1] + ghost ; + + for ( i = 0 ; i < id_length ; ++i ) { local_id[i] = -1 ; } + + iSend = 0 ; + iLocal = 0 ; + + /* The vector space is partitioned by processors */ + + for ( i = 0 ; i < np ; ++i ) { + const int ip = ( i + my_p ) % np ; + recv_pc[i] = iLocal ; + send_pc[i] = iSend ; + + if ( ! box_disjoint( (const int (*)[2]) my_use_box , pbox[ip] ) ) { + const int p_ix = pbox[ip][0][0] ; + const int p_iy = pbox[ip][1][0] ; + const int p_iz = pbox[ip][2][0] ; + const int p_ex = pbox[ip][0][1] ; + const int p_ey = pbox[ip][1][1] ; + const int p_ez = pbox[ip][2][1] ; + + int local_x , local_y , local_z ; + + /* Run the span of global cells that my processor uses */ + + for ( local_z = -ghost ; local_z < my_nz + ghost ; ++local_z ) { + for ( local_y = -ghost ; local_y < my_ny + ghost ; ++local_y ) { + for ( local_x = -ghost ; local_x < my_nx + ghost ; ++local_x ) { + + const int global_z = local_z + my_iz ; + const int global_y = local_y + my_iy ; + const int global_x = local_x + my_ix ; + + const int entry = + box_map_local_entry(my_box,ghost,local_x,local_y,local_z); + + if ( entry < 0 ) { abort(); } + + if ( p_iz <= global_z && global_z < p_ez && + p_iy <= global_y && global_y < p_ey && + p_ix <= global_x && global_x < p_ex ) { + + /* This ordinal is owned by processor 'ip' */ + + local_id[ entry ] = iLocal++ ; + +#if defined(DEBUG_PRINT) +if ( my_p != ip ) { + fprintf(stdout," (%d,%d,%d) : P%d recv at local %d from P%d\n", + global_x,global_y,global_z,my_p,local_id[entry],ip); + fflush(stdout); +} +#endif + } + + /* If in my ownership and used by the other processor */ + if ( my_p != ip && + /* In my ownership: */ + ( 0 <= local_z && local_z < my_nz && + 0 <= local_y && local_y < my_ny && + 0 <= local_x && local_x < my_nx ) && + /* In other processors usage: */ + ( p_iz - ghost <= global_z && global_z < p_ez + ghost && + p_iy - ghost <= global_y && global_y < p_ey + ghost && + p_ix - ghost <= global_x && global_x < p_ex + ghost ) ) { + + resize_int( & send_id , & send_id_size , (iSend + 1) ); + send_id[ iSend ] = local_id[ entry ] ; + ++iSend ; + +#if defined(DEBUG_PRINT) +{ + fprintf(stdout," (%d,%d,%d) : P%d send at local %d to P%d\n", + global_x,global_y,global_z,my_p,local_id[entry],ip); + fflush(stdout); +} +#endif + } + } + } + } + } + } + recv_pc[np] = iLocal ; + send_pc[np] = iSend ; + + *map_local_id = local_id ; + *map_recv_pc = recv_pc ; + *map_send_pc = send_pc ; + *map_send_id = send_id ; +} + +void box_partition_rcb( const int np , + const int my_p , + const int root_box[][2] , + const int ghost , + int (**pbox)[3][2] , + int ** map_local_id , + int ** map_recv_pc , + int ** map_send_pc , + int ** map_send_id ) +{ + *pbox = (int (*)[3][2]) malloc( sizeof(int) * np * 3 * 2 ); + + box_partition( 0 , np , 2 , root_box , *pbox ); + + box_partition_maps( np , my_p , (const int (*)[3][2]) *pbox , ghost , + map_local_id , map_recv_pc , + map_send_pc , map_send_id ); +} + +/*--------------------------------------------------------------------*/ + +#ifdef UNIT_TEST + +static int box_contain( const int a[3][2] , const int b[3][2] ) +{ + return a[0][0] <= b[0][0] && b[0][1] <= a[0][1] && + a[1][0] <= b[1][0] && b[1][1] <= a[1][1] && + a[2][0] <= b[2][0] && b[2][1] <= a[2][1] ; +} + +static void box_print( FILE * fp , const int a[][2] ) +{ + fprintf(fp,"{ [ %d , %d ) , [ %d , %d ) , [ %d , %d ) }", + a[0][0] , a[0][1] , + a[1][0] , a[1][1] , + a[2][0] , a[2][1] ); +} + +static void test_box( const int box[3][2] , const int np ) +{ + const int ncell_box = box[0][1] * box[1][1] * box[2][1] ; + int ncell_total = 0 ; + int ncell_min = ncell_box ; + int ncell_max = 0 ; + int (*pbox)[3][2] ; + int i , j ; + + pbox = (int (*)[3][2]) malloc( sizeof(int) * np * 3 * 2 ); + + box_partition( 0 , np , 2 , box , pbox ); + + for ( i = 0 ; i < np ; ++i ) { + const int ncell = ( pbox[i][0][1] - pbox[i][0][0] ) * + ( pbox[i][1][1] - pbox[i][1][0] ) * + ( pbox[i][2][1] - pbox[i][2][0] ); + + if ( ! box_contain( box , (const int (*)[2]) pbox[i] ) ) { + fprintf(stdout," OUT OF BOUNDS pbox[%d/%d] = ",i,np); + box_print(stdout,(const int (*)[2]) pbox[i]); + fprintf(stdout,"\n"); + abort(); + } + + for ( j = i + 1 ; j < np ; ++j ) { + if ( ! box_disjoint( (const int (*)[2]) pbox[i] , + (const int (*)[2]) pbox[j] ) ) { + fprintf(stdout," NOT DISJOINT pbox[%d/%d] = ",i,np); + box_print(stdout, (const int (*)[2]) pbox[i]); + fprintf(stdout,"\n"); + fprintf(stdout," pbox[%d/%d] = ",j,np); + box_print(stdout, (const int (*)[2]) pbox[j]); + fprintf(stdout,"\n"); + abort(); + } + } + ncell_total += ncell ; + + if ( ncell_max < ncell ) { ncell_max = ncell ; } + if ( ncell < ncell_min ) { ncell_min = ncell ; } + } + + if ( ncell_total != ncell_box ) { + fprintf(stdout," WRONG CELL COUNT NP = %d\n",np); + abort(); + } + fprintf(stdout,"NP = %d, total = %d, avg = %d, min = %d, max = %d\n", + np,ncell_box,ncell_box/np,ncell_min,ncell_max); + + free( pbox ); +} + +/*--------------------------------------------------------------------*/ + +static void test_maps( const int root_box[][2] , const int np ) +{ + const int ghost = 1 ; + const int nx_global = root_box[0][1] - root_box[0][0] ; + const int ny_global = root_box[1][1] - root_box[1][0] ; + int ieq , i , j ; + int (*pbox)[3][2] ; + int **local_values ; + int **map_local_id ; + int **map_recv_pc ; + int **map_send_pc ; + int **map_send_id ; + + pbox = (int (*)[3][2]) malloc( sizeof(int) * np * 3 * 2 ); + + box_partition( 0 , np , 2 , root_box , pbox ); + + local_values = (int **) malloc( sizeof(int*) * np ); + map_local_id = (int **) malloc( sizeof(int*) * np ); + map_recv_pc = (int **) malloc( sizeof(int*) * np ); + map_send_pc = (int **) malloc( sizeof(int*) * np ); + map_send_id = (int **) malloc( sizeof(int*) * np ); + + /* Set each local value to the global equation number */ + + for ( ieq = i = 0 ; i < np ; ++i ) { + const int (*mybox)[2] = (const int (*)[2]) pbox[i] ; + const int nx = mybox[0][1] - mybox[0][0] ; + const int ny = mybox[1][1] - mybox[1][0] ; + const int nz = mybox[2][1] - mybox[2][0] ; + int ix , iy , iz ; + + /* Generate the partition maps for this rank */ + box_partition_maps( np , i , (const int (*)[3][2]) pbox , ghost , + & map_local_id[i] , & map_recv_pc[i] , + & map_send_pc[i] , & map_send_id[i] ); + + local_values[i] = (int *) malloc( sizeof(int) * map_recv_pc[i][np] ); + + for ( iz = -ghost ; iz < nz + ghost ; ++iz ) { + for ( iy = -ghost ; iy < ny + ghost ; ++iy ) { + for ( ix = -ghost ; ix < nx + ghost ; ++ix ) { + const int ieq = box_map_local(mybox,ghost,map_local_id[i],ix,iy,iz); + + if ( 0 <= ieq ) { + const int ix_global = ix + mybox[0][0] ; + const int iy_global = iy + mybox[1][0] ; + const int iz_global = iz + mybox[2][0] ; + + if ( root_box[0][0] <= ix_global && ix_global < root_box[0][1] && + root_box[1][0] <= iy_global && iy_global < root_box[1][1] && + root_box[2][0] <= iz_global && iz_global < root_box[2][1] ) { + + local_values[i][ ieq ] = ix_global + + iy_global * nx_global + + iz_global * nx_global * ny_global ; + } + else { + local_values[i][ ieq ] = -1 ; + } + } + } + } + } + } + + /* Pair-wise compare the local values */ + /* i == receiving processor rank */ + /* ip == sending processor rank */ + /* j == receiving processor data entry for message from 'ip' */ + /* jp == sending processor data entry for message to 'i' */ + + for ( i = 0 ; i < np ; ++i ) { + for ( j = 1 ; j < np ; ++j ) { + const int ip = ( i + j ) % np ; + const int jp = ( i + np - ip ) % np ; + const int nrecv = map_recv_pc[i] [j+1] - map_recv_pc[i] [j] ; + const int nsend = map_send_pc[ip][jp+1] - map_send_pc[ip][jp] ; + int k ; + if ( nrecv != nsend ) { + fprintf(stderr,"P%d recv %d from P%d\n",i,nrecv,ip); + fprintf(stderr,"P%d send %d to P%d\n",ip,nsend,i); + abort(); + } + for ( k = 0 ; k < nrecv ; ++k ) { + const int irecv = map_recv_pc[i][j] + k ; + const int isend = map_send_pc[ip][jp] + k ; + const int val_irecv = local_values[i][irecv] ; + const int val_isend = local_values[ip][ map_send_id[ip][isend] ] ; + if ( val_irecv != val_isend ) { + fprintf(stderr,"P%d recv[%d] = %d , from P%d\n",i,k,val_irecv,ip); + fprintf(stderr,"P%d send[%d] = %d , to P%d\n",ip,k,val_isend,i); + abort(); + } + } + } + } + + for ( i = 0 ; i < np ; ++i ) { + free( map_local_id[i] ); + free( map_recv_pc[i] ); + free( map_send_pc[i] ); + free( map_send_id[i] ); + free( local_values[i] ); + } + free( map_send_id ); + free( map_send_pc ); + free( map_recv_pc ); + free( map_local_id ); + free( local_values ); + free( pbox ); +} + +/*--------------------------------------------------------------------*/ + +int main( int argc , char * argv[] ) +{ + int np_max = 256 ; + int box[3][2] = { { 0 , 64 } , { 0 , 64 } , { 0 , 64 } }; + int np = 0 ; + + switch( argc ) { + case 3: + sscanf(argv[1],"%d",&np); + sscanf(argv[2],"%dx%dx%d",& box[0][1] , & box[1][1] , & box[2][1] ); + if ( 0 < np ) { test_box( (const int (*)[2]) box , np ); } + if ( 0 < np ) { test_maps( (const int (*)[2]) box , np ); } + break ; + default: + for ( np = 1 ; np <= np_max ; ++np ) { + test_box( (const int (*)[2]) box , np ); + test_maps( (const int (*)[2]) box , np ); + } + break ; + } + return 0 ; +} + +#endif + + diff --git a/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/hpccg/BoxPartition.h b/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/hpccg/BoxPartition.h new file mode 100644 index 0000000000..3dfd8392c8 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/hpccg/BoxPartition.h @@ -0,0 +1,64 @@ + +/** \brief Partition a { [ix,jx) X [iy,jy) X [iz,jz) } box. + * + * Use recursive coordinate bisection to partition a box + * into np disjoint sub-boxes. Allocate (via malloc) and + * populate the sub-boxes, mapping the local (x,y,z) to + * a local ordinal, and mappings for the send-recv messages + * to update the ghost cells. + * + * usage: + * + * my_nx = pbox[my_p][0][1] - pbox[my_p][0][0] ; + * my_ny = pbox[my_p][1][1] - pbox[my_p][1][0] ; + * my_nz = pbox[my_p][2][1] - pbox[my_p][2][0] ; + * + * for ( x = -ghost ; x < my_nx + ghost ; ++x ) { + * for ( y = -ghost ; y < my_ny + ghost ; ++y ) { + * for ( z = -ghost ; z < my_nz + ghost ; ++z ) { + * const int x_global = x + pbox[my_p][0][0] ; + * const int y_global = y + pbox[my_p][1][0] ; + * const int z_global = z + pbox[my_p][2][0] ; + * + * const int local_ordinal = + * box_map_local( pbox[my_p], ghost, map_local_id, x, y, z ); + * + * if ( 0 <= local_ordinal ) { + * } + * } + * + * for ( i = 1 ; i < np ; ++i ) { + * const int recv_processor = ( my_p + i ) % np ; + * const int recv_ordinal_begin = map_recv_pc[i]; + * const int recv_ordinal_end = map_recv_pc[i+1]; + * } + * + * for ( i = 1 ; i < np ; ++i ) { + * const int send_processor = ( my_p + i ) % np ; + * const int send_map_begin = map_send_pc[i]; + * const int send_map_end = map_send_pc[i+1]; + * for ( j = send_map_begin ; j < send_map_end ; ++j ) { + * send_ordinal = map_send_id[j] ; + * } + * } + */ +void box_partition_rcb( + const int np /**< [in] Number of partitions */ , + const int my_p /**< [in] My partition rank */ , + const int root_box[][2] /**< [in] 3D Box to partition */ , + const int ghost /**< [in] Ghost cell boundary */ , + int (**pbox)[3][2] /**< [out] Partition's 3D boxes */ , + int ** map_local_id /**< [out] Map local cells */ , + int ** map_recv_pc /**< [out] Receive spans per processor */ , + int ** map_send_pc /**< [out] Send prefix counts per processor */ , + int ** map_send_id /**< [out] Send message ordinals */ ); + +/* \brief Map a local (x,y,z) to a local ordinal. + */ +int box_map_local( const int box_local[][2] , + const int ghost , + const int map_local_id[] , + const int local_x , + const int local_y , + const int local_z ); + diff --git a/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/hpccg/CGSolver.c b/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/hpccg/CGSolver.c new file mode 100644 index 0000000000..2670bf79d5 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/hpccg/CGSolver.c @@ -0,0 +1,248 @@ + +#include +#include +#include +#include + +#include +#include +#include +#include + +#ifdef HAVE_MPI +#include +#endif + +/*--------------------------------------------------------------------*/ + +#ifdef HAVE_MPI + +#define TIMER( DT , F ) \ + { double tb , te , tbg , teg , dt ; \ + tb = TPI_Walltime(); \ + F ; \ + te = TPI_Walltime(); \ + MPI_Allreduce(&tb, &tbg, 1, MPI_DOUBLE, MPI_MIN, MPI_COMM_WORLD); \ + MPI_Allreduce(&te, &teg, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); \ + DT[0] += dt = teg - tbg ; \ + DT[1] += dt * dt ; } + +#else + +#define TIMER( DT , F ) \ + { const double tb = TPI_Walltime(); double dt ; \ + F ; \ + DT[0] += dt = TPI_Walltime() - tb ; \ + DT[1] += dt * dt ; } + +#endif + +/*--------------------------------------------------------------------*/ + +static +VECTOR_SCALAR comm_sum( VECTOR_SCALAR v ) +{ +#ifdef HAVE_MPI + VECTOR_SCALAR result = 0 ; + if ( sizeof(VECTOR_SCALAR) == sizeof(double) ) { + MPI_Allreduce( & v , & result , 1 , MPI_DOUBLE , MPI_SUM , MPI_COMM_WORLD ); + } + else { + MPI_Allreduce( & v , & result , 1 , MPI_FLOAT , MPI_SUM , MPI_COMM_WORLD ); + } + return result ; +#else + return v ; +#endif +} + +#ifdef HAVE_MPI +static +void comm_rhs_vector( const struct cgsolve_data * const data , + VECTOR_SCALAR * const vec ) +{ + const int np = data->np ; + const int my_p = data->ip ; + const int * const recv_pc = data->recv_pc ; + const int * const send_pc = data->send_pc ; + const int * const send_id = data->send_id ; + int i , irecv ; + + for ( irecv = 0 , i = 1 ; i < np ; ++i ) { + if ( recv_pc[i] < recv_pc[i+1] ) ++irecv ; + } + +#ifdef DEBUG_PRINT + fflush(stdout); + MPI_Barrier( MPI_COMM_WORLD ); + fflush(stdout); +#endif + + { + VECTOR_SCALAR * const send_buf = + (VECTOR_SCALAR *) malloc( sizeof(VECTOR_SCALAR) * send_pc[np] ); + + MPI_Request * const recv_request = + (MPI_Request *) malloc( sizeof(MPI_Request) * irecv ); + + MPI_Status * const recv_status = + (MPI_Status *) malloc( sizeof(MPI_Status) * irecv ); + + for ( irecv = 0 , i = 1 ; i < np ; ++i ) { + const int ip = ( i + my_p ) % np ; + const int recv_beg = recv_pc[i]; + const int recv_length = recv_pc[i+1] - recv_beg ; + if ( recv_length ) { +#ifdef DEBUG_PRINT + fprintf(stdout," comm_rhs_vector P%d Irecv P%d : %d\n", + my_p, ip, recv_length ); + fflush(stdout); +#endif + MPI_Irecv( vec + recv_beg , + recv_length * sizeof(VECTOR_SCALAR), MPI_BYTE , + ip , 0 , MPI_COMM_WORLD , recv_request + irecv ); + ++irecv ; + } + } + + /* Gather components into send buffer */ + + for ( i = 0 ; i < send_pc[np] ; ++i ) { + send_buf[i] = vec[ send_id[i] ]; + } + + MPI_Barrier( MPI_COMM_WORLD ); + + for ( i = 1 ; i < np ; ++i ) { + const int ip = ( i + my_p ) % np ; + const int send_beg = send_pc[i]; + const int send_length = send_pc[i+1] - send_beg ; + if ( send_length ) { /* Send to 'i' */ +#ifdef DEBUG_PRINT + fprintf(stdout," comm_rhs_vector P%d Rsend P%d : %d\n", + my_p, ip, send_length ); + fflush(stdout); +#endif + MPI_Rsend( send_buf + send_beg , + send_length * sizeof(VECTOR_SCALAR), MPI_BYTE , + ip , 0 , MPI_COMM_WORLD ); + } + } + + MPI_Waitall( irecv , recv_request , recv_status ); + + free( recv_status ); + free( recv_request ); + free( send_buf ); + } +} +#else +#define comm_rhs_vector( D , V ) /* */ +#endif + +/*--------------------------------------------------------------------*/ + +void cgsolve_set_lhs( const struct cgsolve_data * const data , + const VECTOR_SCALAR * const x , + VECTOR_SCALAR * const b ) +{ + const int nRow = data->nRow ; + const int nVec = data->recv_pc[ data->np ] ; + const int * const A_pc = data->A_pc ; + const int * const A_ia = data->A_ia ; + const MATRIX_SCALAR * const A_a = data->A_a ; + + VECTOR_SCALAR * const p = (VECTOR_SCALAR *) malloc( nVec * sizeof(VECTOR_SCALAR) ); + + tpi_copy( nRow , x , p ); + + comm_rhs_vector( data , p ); + + tpi_crs_matrix_apply( nRow, A_pc, A_ia, A_a, p, b ); + + free( p ); +} + +/*--------------------------------------------------------------------*/ + +void cgsolve( const struct cgsolve_data * const data , + const VECTOR_SCALAR * const b , + VECTOR_SCALAR * const x , + int * const iter_count , + VECTOR_SCALAR * const norm_resid , + double * const dt_mxv , + double * const dt_axpby , + double * const dt_dot ) +{ + const int nRow = data->nRow ; + const int nVec = data->recv_pc[ data->np ] ; + const int max_iter = data->max_iter ; + const int print_iter = data->print_iter ; + const int * const A_pc = data->A_pc ; + const int * const A_ia = data->A_ia ; + const MATRIX_SCALAR * const A_a = data->A_a ; + const VECTOR_SCALAR tolerance = data->tolerance ; + + const VECTOR_SCALAR tol_2 = tolerance * tolerance ; + + VECTOR_SCALAR * const r = (VECTOR_SCALAR *) malloc( nRow * sizeof(VECTOR_SCALAR) ); + VECTOR_SCALAR * const p = (VECTOR_SCALAR *) malloc( nVec * sizeof(VECTOR_SCALAR) ); + VECTOR_SCALAR * const Ap = (VECTOR_SCALAR *) malloc( nRow * sizeof(VECTOR_SCALAR) ); + + VECTOR_SCALAR rtrans = 0.0 ; + + int k ; + + tpi_copy( nRow , b , r ); + tpi_copy( nRow , x , p ); + + comm_rhs_vector( data , p ); tpi_crs_matrix_apply( nRow, A_pc, A_ia, A_a, p, Ap ); + + tpi_axpby( nRow , -1.0, Ap, 1.0 , r ); + + /* Include timing dot product for 2 * #iter dot products */ + TIMER( dt_dot , rtrans = comm_sum( tpi_dot( nRow , r , r ) ) ); + + for ( k = 0 ; k < max_iter && tol_2 < rtrans ; ++k ) { + VECTOR_SCALAR alpha ; + VECTOR_SCALAR beta = 0.0 ; + VECTOR_SCALAR pAp = 0.0 ; + + if ( k ) { + const VECTOR_SCALAR oldrtrans = rtrans ; + TIMER( dt_dot , rtrans = comm_sum( tpi_dot( nRow , r , r ) ) ); + beta = rtrans / oldrtrans ; + } + + TIMER( dt_axpby , tpi_axpby( nRow, 1.0, r, beta, p ) ); + + TIMER( dt_mxv , comm_rhs_vector( data , p ); tpi_crs_matrix_apply( nRow, A_pc, A_ia, A_a, p, Ap ) ); + + TIMER( dt_dot , pAp = comm_sum( tpi_dot( nRow , p , Ap ) ) ); + + if ( 0 < fabs( pAp ) ) { + alpha = rtrans / pAp ; + } + else { + alpha = rtrans = 0.0 ; /* Orthogonal, cannot continue */ + } + + if ( ! ( ( k + 1 ) % print_iter ) ) { + fprintf(stdout," cgsolve | r(%d) | = %g\n",k,sqrt(rtrans)); + fflush(stdout); + } + + TIMER( dt_axpby , tpi_axpby( nRow , alpha, p, 1.0, x) ); + TIMER( dt_axpby , tpi_axpby( nRow , -alpha, Ap, 1.0, r) ); + } + + *norm_resid = sqrt( rtrans ); + *iter_count = k ; + + free( Ap ); + free( p ); + free( r ); +} + +/*--------------------------------------------------------------------*/ + diff --git a/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/hpccg/CGSolver.h b/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/hpccg/CGSolver.h new file mode 100644 index 0000000000..0660a01da7 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/hpccg/CGSolver.h @@ -0,0 +1,32 @@ + +#include + +struct cgsolve_data { + int nRow ; + int * A_pc ; + int * A_ia ; + MATRIX_SCALAR * A_a ; + int max_iter ; + int print_iter ; + VECTOR_SCALAR tolerance ; + + int np ; + int ip ; + int * recv_pc ; + int * send_pc ; + int * send_id ; +}; + +void cgsolve_set_lhs( const struct cgsolve_data * data , + const VECTOR_SCALAR * const x , + VECTOR_SCALAR * const b ); + +void cgsolve( const struct cgsolve_data * data , + const VECTOR_SCALAR * const b , + VECTOR_SCALAR * const x , + int * const iter_count , + VECTOR_SCALAR * const norm_resid , + double * const dt_mxv , + double * const dt_axpby , + double * const dt_dot ); + diff --git a/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/hpccg/CMakeLists.txt b/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/hpccg/CMakeLists.txt new file mode 100644 index 0000000000..bfba897477 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/hpccg/CMakeLists.txt @@ -0,0 +1,83 @@ + +INCLUDE(PackageAddExecutableAndTest) +INCLUDE(PackageLibraryMacros) + +#################### + +SET(HEADERS "") +SET(SOURCES "") + +INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) + +SET(HEADERS ${HEADERS} + ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}_config.h + ) + +INCLUDE_DIRECTORIES(REQUIRED_DURING_INSTALLATION_TESTING ${CMAKE_CURRENT_SOURCE_DIR}) + +APPEND_SET(HEADERS + BoxPartition.h + CGSolver.h + tpi_vector.h + ) + +#################### + + +PACKAGE_ADD_EXECUTABLE( + test_tpi_hpccg + COMM serial mpi + SOURCES main.c CGSolver.c BoxPartition.c tpi_vector.c + DEPLIBS pthread m + DIRECTORY . + ) + +PACKAGE_ADD_TEST( + test_tpi_hpccg + NAME test_tpi_hpccg_serial_1 + COMM serial + DIRECTORY . + ) + +PACKAGE_ADD_TEST( + test_tpi_hpccg + NAME test_tpi_hpccg_serial_2 + COMM serial + ARGS "threads=2" + DIRECTORY . + XHOSTTYPE AIX + ) + +PACKAGE_ADD_TEST( + test_tpi_hpccg + NAME test_tpi_hpccg_serial_4 + COMM serial + ARGS "threads=4" + DIRECTORY . + ) + +PACKAGE_ADD_TEST( + test_tpi_hpccg + NAME test_tpi_hpccg_mpi_1 + COMM mpi + NUM_MPI_PROCS 1 + DIRECTORY . + ) + +PACKAGE_ADD_TEST( + test_tpi_hpccg + NAME test_tpi_hpccg_mpi_2 + COMM mpi + NUM_MPI_PROCS 2 + DIRECTORY . + ) + +PACKAGE_ADD_TEST( + test_tpi_hpccg + NAME test_tpi_hpccg_mpi_4 + COMM mpi + NUM_MPI_PROCS 4 + DIRECTORY . + ) + + diff --git a/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/hpccg/main.c b/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/hpccg/main.c new file mode 100644 index 0000000000..676a02d3ea --- /dev/null +++ b/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/hpccg/main.c @@ -0,0 +1,340 @@ + +#include +#include +#include +#include + +#include +#include +#include +#include + +#ifdef HAVE_MPI +#include +#endif + +/*--------------------------------------------------------------------*/ + +static +void hpccg_alloc_and_fill( const int np , + const int my_p , + const int gbox[][2] , + const int ghost , + struct cgsolve_data * const data ) +{ + int (*pbox)[3][2] = NULL ; + int * map_local_ord = NULL; + + data->nRow = 0 ; + data->A_pc = NULL ; + data->A_ia = NULL ; + data->A_a = NULL ; + + data->np = np ; + data->ip = my_p ; + data->recv_pc = NULL ; + data->send_pc = NULL ; + data->send_id = NULL ; + + box_partition_rcb( np, my_p, + (const int (*)[2]) gbox, ghost, + & pbox , + & map_local_ord , + & data->recv_pc , + & data->send_pc , + & data->send_id ); + + { + const int (* const my_box)[2] = (const int (*)[2]) pbox[my_p] ; + const int bx = my_box[0][0] ; + const int by = my_box[1][0] ; + const int bz = my_box[2][0] ; + const int nx = my_box[0][1] - bx ; + const int ny = my_box[1][1] - by ; + const int nz = my_box[2][1] - bz ; + const int n = nx * ny * nz ; + const int nnz = 27 * n ; /* Upper bound */ + int * const pc = (int *) malloc( sizeof(int) * ( n + 1 ) ); + int * const ia = (int *) malloc( sizeof(int) * nnz ); + MATRIX_SCALAR * const a = (MATRIX_SCALAR *) malloc( sizeof(MATRIX_SCALAR) * nnz ); + + int irow = 0 ; + int ipc = 0 ; + int ix , iy , iz ; + int sx , sy , sz ; + + for ( iz = 0 ; iz < nz ; ++iz ) { + for ( iy = 0 ; iy < ny ; ++iy ) { + for ( ix = 0 ; ix < nx ; ++ix , ++irow ) { + + if ( irow != box_map_local( my_box, ghost, map_local_ord,ix,iy,iz) ) { + fprintf(stderr,"P%d: irow[%d] != box_map_local(%d,%d,%d) = %d\n", + my_p,irow,ix,iy,iz, + box_map_local( my_box, ghost, map_local_ord, ix, iy, iz) ); + } + + pc[ irow ] = ipc ; /* Beginning of row coefficients */ + /* Diagonal term first */ + ia[ ipc ] = irow ; + a[ ipc ] = 27.0f ; + ++ipc ; + + /* Off-diagonal terms to follow */ + for ( sz = -1 ; sz <= 1 ; ++sz ) { + for ( sy = -1 ; sy <= 1 ; ++sy ) { + for ( sx = -1 ; sx <= 1 ; ++sx ) { + const int dx = ix + sx ; + const int dy = iy + sy ; + const int dz = iz + sz ; + const int global_x = dx + bx ; + const int global_y = dy + by ; + const int global_z = dz + bz ; + + if ( gbox[0][0] <= global_x && global_x < gbox[0][1] && + gbox[1][0] <= global_y && global_y < gbox[1][1] && + gbox[2][0] <= global_z && global_z < gbox[2][1] && + ! ( sz == 0 && sy == 0 && sx == 0 ) ) { + /* 'icol' is mapped for communication */ + + const int icol = + box_map_local(my_box,ghost,map_local_ord,dx,dy,dz); + + if ( icol < 0 ) { + fprintf(stderr,"P%d : bad column at local (%d,%d,%d) global(%d,%d,%d)\n", + my_p, dx,dy,dz,global_x,global_y,global_z); + fflush(stderr); + abort(); + } + + ia[ ipc ] = icol ; + a[ ipc ] = -1.0f ; + ++ipc ; + } + } + } + } + } + } + } + + pc[irow] = ipc ; + + data->nRow = irow ; + data->A_pc = pc ; + data->A_ia = ia ; + data->A_a = a ; + } + + free( map_local_ord ); + free( pbox ); +} + +/*--------------------------------------------------------------------*/ + +int main( int argc , char ** argv ) +{ + const int ghost = 1 ; + const int max_cube = 20 ; + int ncube[20] = { 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , + 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }; + + FILE * print_file = stdout ; + int print_iter = 500 ; + int max_iter = 50 ; + + VECTOR_SCALAR tolerance = 0.0 ; /* Force max iterations */ + + int gbox[3][2] = { { 0 , 16 } , { 0 , 16 } , { 0 , 16 } }; + int nt = 0 ; + int trials = 5 ; + int ntest ; + int np = 1; + int my_p = 0 ; + +#ifdef HAVE_MPI + MPI_Init( & argc , & argv ); + MPI_Comm_size( MPI_COMM_WORLD , & np ); + MPI_Comm_rank( MPI_COMM_WORLD , & my_p ); +#endif + + if ( ! my_p ) { + const char arg_threads[] = "threads=" ; + const char arg_cube[] = "cube=" ; + const char arg_box[] = "box=" ; + const char arg_max[] = "max_iter=" ; + const char arg_trials[] = "trials=" ; + const char arg_print[] = "print_iter=" ; + const char arg_file[] = "print_file=" ; + int i ; + for ( i = 1 ; i < argc ; ++i ) { + if ( ! strncmp(argv[i],arg_threads,strlen(arg_threads)) ) { + sscanf(argv[i]+strlen(arg_threads),"%d",&nt); + } + else if ( ! strncmp(argv[i],arg_box,strlen(arg_box)) ) { + sscanf(argv[i]+strlen(arg_box),"%d%*[x]%d%*[x]%d", + & gbox[0][1] , & gbox[1][1] , & gbox[2][1] ); + } + else if ( ! strncmp(argv[i],arg_cube,strlen(arg_cube)) ) { + sscanf(argv[i]+strlen(arg_cube), + "%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d", + ncube+0, ncube+1, ncube+2, ncube+3, ncube+4, + ncube+5, ncube+6, ncube+7, ncube+8, ncube+9, + ncube+10, ncube+11, ncube+12, ncube+13, ncube+14, + ncube+15, ncube+16, ncube+17, ncube+18, ncube+19); + } + else if ( ! strncmp(argv[i],arg_max,strlen(arg_max)) ) { + sscanf(argv[i]+strlen(arg_max),"%d",&max_iter); + } + else if ( ! strncmp(argv[i],arg_trials,strlen(arg_trials)) ) { + sscanf(argv[i]+strlen(arg_trials),"%d",&trials); + } + else if ( ! strncmp(argv[i],arg_print,strlen(arg_print)) ) { + sscanf(argv[i]+strlen(arg_print),"%d",&print_iter); + } + else if ( ! strncmp(argv[i],arg_file,strlen(arg_file)) ) { + char buffer[256] ; + sscanf(argv[i]+strlen(arg_file),"%s",buffer); + print_file = fopen(buffer,"a"); + } + } + } + +#ifdef HAVE_MPI + { + MPI_Bcast( & nt , 1 , MPI_INT , 0 , MPI_COMM_WORLD ); + MPI_Bcast( & gbox[0][0] , 6 , MPI_INT , 0 , MPI_COMM_WORLD ); + MPI_Bcast( ncube , max_cube , MPI_INT , 0 , MPI_COMM_WORLD ); + MPI_Bcast( & max_iter , 1 , MPI_INT , 0 , MPI_COMM_WORLD ); + MPI_Bcast( & print_iter , 1 , MPI_INT , 0 , MPI_COMM_WORLD ); + MPI_Bcast( & trials , 1 , MPI_INT , 0 , MPI_COMM_WORLD ); + } +#endif + + if ( nt ) { + TPI_Init( nt ); + TPI_Block(); + TPI_Unblock(); + } + + if ( ! my_p ) { + fprintf(print_file,"\"PROC\" , \"THREAD\" , \"EQUATION\" , \"NON-ZERO\" , \"MXV\" , \"AXPBY\" , \"DOT\" , \"Xerror\" , \"Iter\"\n"); + fprintf(print_file,"\"COUNT\" , \"COUNT\" , \"COUNT\" , \"COUNT\" , \"Mflops\" , \"Mflops\" , \"Mflops\" , \"L2norm\" , \"COUNT\"\n"); + } + + for ( ntest = 0 ; ! ntest || ( ntest < max_cube && ncube[ntest] ) ; ++ntest ) { + struct cgsolve_data cgdata ; + + if ( ncube[ntest] ) { + gbox[0][1] = gbox[1][1] = gbox[2][1] = ncube[ntest] ; + } + + hpccg_alloc_and_fill( np, my_p, (const int (*)[2]) gbox, ghost, &cgdata); + + cgdata.max_iter = max_iter ; + cgdata.print_iter = print_iter ; + cgdata.tolerance = tolerance ; + + { + double dt_mxv[2] = { 0 , 0 }; + double dt_axpby[2] = { 0 , 0 }; + double dt_dot[2] = { 0 , 0 }; + VECTOR_SCALAR norm_resid = 0.0 ; + int iter_count = 0 ; + int iter_total = 0 ; + int k ; + + VECTOR_SCALAR * const b = (VECTOR_SCALAR *) malloc( sizeof(VECTOR_SCALAR) * cgdata.nRow ); + VECTOR_SCALAR * const x = (VECTOR_SCALAR *) malloc( sizeof(VECTOR_SCALAR) * cgdata.nRow ); + VECTOR_SCALAR * const xexact = (VECTOR_SCALAR *) malloc( sizeof(VECTOR_SCALAR) * cgdata.nRow ); + + { + const VECTOR_SCALAR value = 1.0 /* 1.0 / 3.0 */ ; + int i ; + for ( i = 0 ; i < cgdata.nRow ; ++i ) xexact[i] = value ; + } + + for ( k = 0 ; k < trials ; ++k ) { + int i ; + + for ( i = 0 ; i < cgdata.nRow ; ++i ) { x[i] = 0.0 ; } + + cgsolve_set_lhs( & cgdata , xexact , b ); + + cgsolve( & cgdata, b, x, + & iter_count, & norm_resid, + dt_mxv , dt_axpby , dt_dot ); + + iter_total += iter_count ; + } + + { + int nnzGlobal = cgdata.A_pc[ cgdata.nRow ]; + double error[2] = { 0 , 0 }; + + for ( k = 0 ; k < cgdata.nRow ; ++k ) { + error[0] += ( x[k] - xexact[k] ) * ( x[k] - xexact[k] ); + error[1] += xexact[k] * xexact[k] ; + } + +#ifdef HAVE_MPI + { + double error_global[2] = { 0.0 , 0.0 }; + int nnz = nnzGlobal ; + + MPI_Allreduce( & nnz , & nnzGlobal , 1 , MPI_INT , MPI_SUM , + MPI_COMM_WORLD ); + + MPI_Allreduce( error , error_global , 2 , MPI_DOUBLE , MPI_SUM , + MPI_COMM_WORLD ); + + error[0] = error_global[0]; + error[1] = error_global[1]; + } +#endif + + error[0] = sqrt( error[0] ); + error[1] = sqrt( error[1] ); + + if ( ! my_p ) { + const int nRowGlobal = ( gbox[0][1] - gbox[0][0] ) * + ( gbox[1][1] - gbox[1][0] ) * + ( gbox[2][1] - gbox[2][0] ); + + const double mflop_mxv = + 1.0e-6 * ( iter_total ) * 2 * nnzGlobal / dt_mxv[0] ; + + const double mflop_axpby = + 1.0e-6 * ( iter_total * 3 ) * 3 * nRowGlobal / dt_axpby[0] ; + + const double mflop_dot = + 1.0e-6 * ( iter_total * 2 ) * 2 * nRowGlobal / dt_dot[0] ; + + fprintf(print_file,"%8d , %8d , %8d , %8d , %10g , %10g , %10g , %g , %d\n", + np , nt , nRowGlobal , nnzGlobal , + mflop_mxv , mflop_axpby , mflop_dot , + error[0] / error[1] , iter_total ); + fflush(print_file); + } + } + + free( xexact ); + free( x ); + free( b ); + } + free( cgdata.A_a ); + free( cgdata.A_ia ); + free( cgdata.A_pc ); + free( cgdata.recv_pc ); + free( cgdata.send_pc ); + free( cgdata.send_id ); + } + + if ( nt ) { TPI_Finalize(); } + +#ifdef HAVE_MPI + MPI_Finalize(); +#endif + + return 0 ; +} + diff --git a/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/hpccg/tpi_vector.c b/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/hpccg/tpi_vector.c new file mode 100644 index 0000000000..1b8a26c747 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/hpccg/tpi_vector.c @@ -0,0 +1,273 @@ +#include + +#include + +#include +#include + +/*--------------------------------------------------------------------*/ + +struct tpi_work_vector { + VECTOR_SCALAR alpha ; + VECTOR_SCALAR beta ; + const VECTOR_SCALAR * x ; + const VECTOR_SCALAR * y ; + VECTOR_SCALAR * w ; + int n ; +}; + +static void tpi_work_span( TPI_Work * const work , const int n , + int * const iBeg , int * const iEnd ) +{ + const int chunk = ( n + work->count - 1 ) / work->count ; + const int i_end = chunk + ( *iBeg = chunk * work->rank ); + + *iEnd = n < i_end ? n : i_end ; +} + +/*--------------------------------------------------------------------*/ + +static void tpi_work_fill( TPI_Work * work ) +{ + const struct tpi_work_vector * const h = + (struct tpi_work_vector *) work->info ; + + const VECTOR_SCALAR alpha = h->alpha ; + VECTOR_SCALAR * const w = h->w ; + + int i , iEnd ; + + tpi_work_span( work , h->n , & i , & iEnd ); + + for ( ; i < iEnd ; ++i ) { w[i] = alpha ; } +} + +void tpi_fill( int n , VECTOR_SCALAR alpha , VECTOR_SCALAR * x ) +{ + struct tpi_work_vector tmp = { 0.0 , 0.0 , NULL , NULL , NULL , 0 }; + tmp.alpha = alpha ; + tmp.w = x ; + tmp.n = n ; + TPI_Run_threads( tpi_work_fill , & tmp , 0 ); +} + +/*--------------------------------------------------------------------*/ + +static void tpi_work_scale( TPI_Work * work ) +{ + const struct tpi_work_vector * const h = + (struct tpi_work_vector *) work->info ; + + const VECTOR_SCALAR beta = h->beta ; + VECTOR_SCALAR * const w = h->w ; + + int i , iEnd ; + + tpi_work_span( work , h->n , & i , & iEnd ); + + for ( ; i < iEnd ; ++i ) { w[i] *= beta ; } +} + +void tpi_scale( int n , const VECTOR_SCALAR alpha , VECTOR_SCALAR * x ) +{ + struct tpi_work_vector tmp = { 0.0 , 0.0 , NULL , NULL , NULL , 0 }; + tmp.alpha = alpha ; + tmp.w = x ; + tmp.n = n ; + TPI_Run_threads( tpi_work_scale , & tmp , 0 ); +} + +/*--------------------------------------------------------------------*/ + +static void tpi_work_copy( TPI_Work * work ) +{ + const struct tpi_work_vector * const h = + (struct tpi_work_vector *) work->info ; + + const VECTOR_SCALAR * const x = h->x ; + VECTOR_SCALAR * const w = h->w ; + + int i , iEnd ; + + tpi_work_span( work , h->n , & i , & iEnd ); + + for ( ; i < iEnd ; ++i ) { w[i] = x[i] ; } +} + +void tpi_copy( int n , const VECTOR_SCALAR * x , VECTOR_SCALAR * y ) +{ + struct tpi_work_vector tmp = { 0.0 , 0.0 , NULL , NULL , NULL , 0 }; + tmp.x = x ; + tmp.w = y ; + tmp.n = n ; + TPI_Run_threads( tpi_work_copy , & tmp , 0 ); +} + +/*--------------------------------------------------------------------*/ + +static void tpi_work_axpby( TPI_Work * work ) +{ + const struct tpi_work_vector * const h = + (struct tpi_work_vector *) work->info ; + + const VECTOR_SCALAR alpha = h->alpha ; + const VECTOR_SCALAR beta = h->beta ; + const VECTOR_SCALAR * const x = h->x ; + VECTOR_SCALAR * const w = h->w ; + + int i , iEnd ; + + tpi_work_span( work , h->n , & i , & iEnd ); + + for ( ; i < iEnd ; ++i ) { w[i] = alpha * x[i] + beta * w[i] ; } +} + +void tpi_axpby( int n , VECTOR_SCALAR alpha , const VECTOR_SCALAR * x , + VECTOR_SCALAR beta , VECTOR_SCALAR * y ) +{ + struct tpi_work_vector tmp = { 0.0 , 0.0 , NULL , NULL , NULL , 0 }; + tmp.alpha = alpha ; + tmp.beta = beta ; + tmp.x = x ; + tmp.w = y ; + tmp.n = n ; + + TPI_Run_threads( tpi_work_axpby , & tmp , 0 ); +} + +/*--------------------------------------------------------------------*/ + +static void tpi_work_dot_partial( TPI_Work * work ) +{ + const struct tpi_work_vector * const h = + (struct tpi_work_vector *) work->info ; + + VECTOR_SCALAR * const s = (VECTOR_SCALAR *) work->reduce ; + const VECTOR_SCALAR * const x = h->x ; + const VECTOR_SCALAR * const y = h->y ; + VECTOR_SCALAR tmp = *s ; + int i , iEnd ; + + tpi_work_span( work , h->n , & i , & iEnd ); + + for ( ; i < iEnd ; ++i ) { tmp += x[i] * y[i] ; } + + *s = tmp ; +} + +static void tpi_work_dot_partial_self( TPI_Work * work ) +{ + const struct tpi_work_vector * const h = + (struct tpi_work_vector *) work->info ; + + VECTOR_SCALAR * const s = (VECTOR_SCALAR *) work->reduce ; + const VECTOR_SCALAR * const x = h->x ; + VECTOR_SCALAR tmp = *s ; + + int i , iEnd ; + + tpi_work_span( work , h->n , & i , & iEnd ); + + for ( ; i < iEnd ; ++i ) { const VECTOR_SCALAR d = x[i] ; tmp += d * d ; } + + *s = tmp ; +} + +static void tpi_work_dot_join( TPI_Work * work , const void * src ) +{ + *((VECTOR_SCALAR *) ( work->reduce) ) += *((const VECTOR_SCALAR *) src); +} + +static void tpi_work_dot_init( TPI_Work * work ) +{ + *((VECTOR_SCALAR *) ( work->reduce) ) = 0 ; +} + +VECTOR_SCALAR tpi_dot( int n , const VECTOR_SCALAR * x , const VECTOR_SCALAR * y ) +{ + struct tpi_work_vector tmp = { 0.0 , 0.0 , NULL , NULL , NULL , 0 }; + VECTOR_SCALAR result = 0.0 ; + tmp.x = x ; + tmp.y = y ; + tmp.n = n ; + if ( x != y ) { + TPI_Run_threads_reduce( tpi_work_dot_partial , & tmp , + tpi_work_dot_join , tpi_work_dot_init , + sizeof(result) , & result ); + } + else { + TPI_Run_threads_reduce( tpi_work_dot_partial_self , & tmp , + tpi_work_dot_join , tpi_work_dot_init , + sizeof(result) , & result ); + } + return result ; +} + +/*--------------------------------------------------------------------*/ + +struct tpi_crs_matrix { + int nRow ; + const int * A_pc ; + const int * A_ia ; + const MATRIX_SCALAR * A_a ; + const VECTOR_SCALAR * x ; + VECTOR_SCALAR * y ; +}; + +static void tpi_work_crs_matrix_apply( TPI_Work * work ) +{ + const struct tpi_crs_matrix * const h = + (struct tpi_crs_matrix *) work->info ; + + const int * const A_pc = h->A_pc ; + const int * const A_ia = h->A_ia ; + const MATRIX_SCALAR * const A_a = h->A_a ; + const VECTOR_SCALAR * const x = h->x ; + + const int nRow = h->nRow ; + const int chunk = ( nRow + work->count - 1 ) / work->count ; + + int row = chunk * work->rank ; + int rowEnd = chunk + row ; + + if ( nRow < rowEnd ) { rowEnd = nRow ; } + + { + const int * const pc_end = A_pc + rowEnd ; + const int * pc = A_pc + row ; + VECTOR_SCALAR * y = h->y + row ; + + for ( ; pc != pc_end ; ++pc , ++y ) { + const int * ia = A_ia + *pc ; + const MATRIX_SCALAR * a = A_a + *pc ; + const MATRIX_SCALAR * const a_end = A_a + pc[1] ; + VECTOR_SCALAR tmp = 0 ; + for ( ; a != a_end ; ++a , ++ia ) { + tmp += *a * x[ *ia ]; + } + *y = tmp ; + } + } +} + +/*--------------------------------------------------------------------*/ + +void tpi_crs_matrix_apply( + const int nRow , + const int * A_pc , + const int * A_ia , + const MATRIX_SCALAR * A_a , + const VECTOR_SCALAR * x , + VECTOR_SCALAR * y ) +{ + struct tpi_crs_matrix h = { 0 , NULL , NULL , NULL , NULL , NULL }; + h.nRow = nRow ; + h.A_pc = A_pc ; + h.A_ia = A_ia ; + h.A_a = A_a ; + h.x = x ; + h.y = y ; + TPI_Run_threads( tpi_work_crs_matrix_apply , & h , 0 ); +} + + diff --git a/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/hpccg/tpi_vector.h b/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/hpccg/tpi_vector.h new file mode 100644 index 0000000000..bcd514ebb4 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/hpccg/tpi_vector.h @@ -0,0 +1,31 @@ + +#include + +#ifndef tpi_vector_h +#define tpi_vector_h + +#define VECTOR_SCALAR float +#define MATRIX_SCALAR float + +void tpi_fill( int n , VECTOR_SCALAR alpha , VECTOR_SCALAR * x ); + +void tpi_scale( int n , const VECTOR_SCALAR alpha , VECTOR_SCALAR * x ); + +void tpi_copy( int n , const VECTOR_SCALAR * x , VECTOR_SCALAR * y ); + +void tpi_axpby( int n , VECTOR_SCALAR alpha , const VECTOR_SCALAR * x , + VECTOR_SCALAR beta , VECTOR_SCALAR * y ); + +VECTOR_SCALAR tpi_dot( int n , const VECTOR_SCALAR * x , + const VECTOR_SCALAR * y ); + +void tpi_crs_matrix_apply( + const int nRow , + const int * A_pc , + const int * A_ia , + const MATRIX_SCALAR * A_a , + const VECTOR_SCALAR * x , + VECTOR_SCALAR * y ); + +#endif + diff --git a/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/test_c_dnax.c b/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/test_c_dnax.c new file mode 100644 index 0000000000..4f6ab9bc06 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/test_c_dnax.c @@ -0,0 +1,414 @@ +/*------------------------------------------------------------------------*/ +/* TPI: Thread Pool Interface */ +/* Copyright (2008) Sandia Corporation */ +/* */ +/* Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive */ +/* license for use of this work by or on behalf of the U.S. Government. */ +/* */ +/* This library is free software; you can redistribute it and/or modify */ +/* it under the terms of the GNU Lesser General Public License as */ +/* published by the Free Software Foundation; either version 2.1 of the */ +/* License, or (at your option) any later version. */ +/* */ +/* This library is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU */ +/* Lesser General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU Lesser General Public */ +/* License along with this library; if not, write to the Free Software */ +/* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 */ +/* USA */ +/*------------------------------------------------------------------------*/ +/** + * @author H. Carter Edwards + * + * Multi-array 'axpby' + */ + +#include +#include +#include +#include +#include + +#if defined( HAVE_MPI ) +#include +#endif + +int test_c_tpi_dnax( int , int ); + +int main( int argc , char ** argv ) +{ + int num_thread[] = { 1 , 2 , 4 , 6 , 8 , 12 , 16 }; + int num_test = sizeof(num_thread) / sizeof(int); + + const int ntrial = 1 < argc ? atoi( argv[1] ) : 2 ; + int i ; + +#if defined( HAVE_MPI ) + int rank ; + + MPI_Init( & argc , & argv ); + MPI_Comm_rank( MPI_COMM_WORLD , & rank ); + if ( 0 == rank ) { +#endif + + + fprintf( stdout , "\"TESTING Multiarray 'axpby' with: %s\"\n" , + TPI_Version() ); + + for ( i = 0 ; i < num_test ; ++i ) { + test_c_tpi_dnax( num_thread[i] , ntrial ); + } + +#if defined( HAVE_MPI ) + } + MPI_Finalize(); +#endif + + return 0 ; +} + +/*------------------------------------------------------------------------*/ + +typedef double SCALAR ; + +/*------------------------------------------------------------------------*/ + +struct TestTPI_DNAX { + SCALAR * coef ; + SCALAR * array ; + unsigned number ; + unsigned length ; + unsigned stride ; + unsigned chunk_length ; +}; + +/*------------------------------------------------------------------------*/ + +static +void test_dnax_column( const unsigned num_array , + const unsigned stride , + const unsigned length , + const SCALAR * const coef , + SCALAR * const array ) +{ + unsigned i = 0 ; + for ( ; i < length ; ++i ) { + SCALAR * const a = array + i ; + SCALAR tmp = 0 ; + unsigned j = 0 ; + for ( ; j < num_array ; ++j ) { tmp += coef[j] * a[ j * stride ] ; } + a[0] = tmp ; + } +} + +static +void test_dnax_row( const unsigned num_array , + const unsigned stride , + const unsigned length , + const SCALAR * const coef , + SCALAR * const array ) +{ + unsigned i = 0 ; + for ( ; i < length ; ++i ) { + SCALAR * const a = array + i * stride ; + SCALAR tmp = 0 ; + unsigned j = 0 ; + for ( ; j < num_array ; ++j ) { tmp += coef[j] * a[j] ; } + a[0] = tmp ; + } +} + +/*------------------------------------------------------------------------*/ +/* The multi-array storage is flat: every array is fully contiguous. + * Work corresponds to a span of the array. + */ +static +void test_dnax_flat_work( TPI_Work * work ) +{ + const struct TestTPI_DNAX * const info = + (struct TestTPI_DNAX *) work->info ; + + const unsigned which_chunk = work->rank ; + const unsigned beg_local = info->chunk_length * which_chunk ; + const unsigned max_local = info->length - beg_local ; + const unsigned len_local = info->chunk_length < max_local ? + info->chunk_length : max_local ; + + test_dnax_column( info->number , + info->stride , + len_local , + info->coef , + info->array + beg_local ); + + return ; +} + +/* The multi-array storage is chunked: each array has a contiguous chunk; + * but chunk-subarrays are contiguously grouped. + */ +static +void test_dnax_column_work( TPI_Work * work ) +{ + const struct TestTPI_DNAX * const info = + (struct TestTPI_DNAX *) work->info ; + + const unsigned which_chunk = work->rank ; + const unsigned beg_local = info->chunk_length * which_chunk ; + const unsigned max_local = info->length - beg_local ; + const unsigned len_local = info->chunk_length < max_local ? + info->chunk_length : max_local ; + + const unsigned chunk_size = info->chunk_length * info->number ; + + test_dnax_column( info->number , + info->chunk_length , + len_local , + info->coef , + info->array + which_chunk * chunk_size ); + + return ; +} + +static +void test_dnax_row_work( TPI_Work * work ) +{ + const struct TestTPI_DNAX * const info = + (struct TestTPI_DNAX *) work->info ; + + const unsigned which_chunk = work->rank ; + const unsigned beg_local = info->chunk_length * which_chunk ; + const unsigned max_local = info->length - beg_local ; + const unsigned len_local = info->chunk_length < max_local ? + info->chunk_length : max_local ; + + const unsigned chunk_size = info->chunk_length * info->number ; + + test_dnax_row( info->number , + info->number , + len_local , + info->coef , + info->array + which_chunk * chunk_size ); + + return ; +} + +/*------------------------------------------------------------------------*/ +/* Process identical block of allocated memory as a + * as a flat array, chunked-column, and chunked-row. + */ + +static +void test_tpi_dnax_driver( const int nthread , + const unsigned Mflop_target , + const unsigned num_trials , + const unsigned num_test , + const unsigned num_test_array[] , + const unsigned length_array , + const unsigned length_chunk ) +{ + const unsigned max_array = num_test_array[ num_test - 1 ]; + + const unsigned num_chunk = + ( length_array + length_chunk - 1 ) / length_chunk ; + + const unsigned stride_array = num_chunk * length_chunk ; + const unsigned size_alloc = max_array * stride_array ; + + SCALAR * const coef = (SCALAR *) malloc( max_array * sizeof(SCALAR) ); + SCALAR * const array = (SCALAR *) malloc( size_alloc * sizeof(SCALAR) ); + + struct TestTPI_DNAX data = { NULL , NULL , 0 , 0 , 0 , 0 }; + + unsigned i_test , i , j ; + + data.coef = coef ; + + if ( NULL == array ) { + fprintf(stderr,"allocation failure for %u\n",size_alloc); + abort(); + } + + for ( i = 0 ; i < max_array ; ++i ) { coef[i] = 0 ; } + + printf("\n\"test_tpi_dnax[%d]( length_array = %u , stride_array = %u )\"\n", + nthread , length_array , stride_array ); + printf("\"NUMBER OF THREADS\" , %d\n" , nthread ); + printf("\"NUMBER OF CHUNKS\" , %u\n" , num_chunk ); + printf("\"NUMBER OF TRIALS\" , %u \n", num_trials ); + + printf("\"TEST\" , \"#ARRAY\" \"DT-MEAN\" , \"DT-STDDEV\" , \"MFLOP-MEAN\" , \"MFLOP-STDDEV\"\n"); + + /*----------------------------------------------------------------------*/ + + for ( i_test = 0 ; i_test < num_test ; ++i_test ) { + const unsigned num_array = num_test_array[ i_test ]; + const unsigned num_sets = max_array / num_array ; + + const double mflop_cycle = + ((double)( 2 * num_array * length_array )) / 1.0e6 ; + + const unsigned ncycle = 1 + (unsigned)( Mflop_target / mflop_cycle ); + + double dt_sum = 0 ; + double dt_sum_2 = 0 ; + + data.length = length_array ; + data.number = num_array ; + data.stride = stride_array ; + data.chunk_length = length_chunk ; + + for ( i = 0 ; i < size_alloc ; ++i ) { array[i] = 0 ; } + + for ( j = 0 ; j < num_trials ; ++j ) { + + double dt_tmp = TPI_Walltime(); + for ( i = 0 ; i < ncycle ; ++i ) { + data.array = array + stride_array * num_array * ( i % num_sets ); + TPI_Run( & test_dnax_flat_work , & data , num_chunk , 0 ); + } + dt_tmp = TPI_Walltime() - dt_tmp ; + + dt_sum += dt_tmp ; + dt_sum_2 += dt_tmp * dt_tmp ; + } + + { + const double dt_mean = dt_sum / num_trials ; + const double dt_sdev = sqrt( ( num_trials * dt_sum_2 - dt_sum * dt_sum ) / ( num_trials * ( num_trials - 1 ) ) ); + const double mflop_mean = mflop_cycle * ncycle / dt_mean ; + const double mflop_sdev = mflop_mean * dt_sdev / ( dt_mean + dt_sdev ); + + printf("\"FLAT ARRAY\" , %6u , %9.5g , %9.3g , %9.5g , %9.3g\n", + num_array, dt_mean, dt_sdev, mflop_mean, mflop_sdev ); + } + } + + /*----------------------------------------------------------------------*/ + + for ( i_test = 0 ; i_test < num_test ; ++i_test ) { + + const unsigned num_array = num_test_array[ i_test ]; + const unsigned num_sets = max_array / num_array ; + + const double mflop_cycle = + ((double)( 2 * num_array * length_array )) / 1.0e6 ; + + const unsigned ncycle = 1 + (unsigned)( Mflop_target / mflop_cycle ); + + double dt_sum = 0 ; + double dt_sum_2 = 0 ; + + data.length = length_array ; + data.number = num_array ; + data.stride = stride_array ; + data.chunk_length = length_chunk ; + + for ( i = 0 ; i < size_alloc ; ++i ) { array[i] = 0 ; } + + for ( j = 0 ; j < num_trials ; ++j ) { + + double dt_tmp = TPI_Walltime(); + for ( i = 0 ; i < ncycle ; ++i ) { + data.array = array + stride_array * num_array * ( i % num_sets ); + TPI_Run( & test_dnax_column_work , & data , num_chunk , 0 ); + } + dt_tmp = TPI_Walltime() - dt_tmp ; + + dt_sum += dt_tmp ; + dt_sum_2 += dt_tmp * dt_tmp ; + } + + { + const double dt_mean = dt_sum / num_trials ; + const double dt_sdev = sqrt( ( num_trials * dt_sum_2 - dt_sum * dt_sum ) / ( num_trials * ( num_trials - 1 ) ) ); + const double mflop_mean = mflop_cycle * ncycle / dt_mean ; + const double mflop_sdev = mflop_mean * dt_sdev / ( dt_mean + dt_sdev ); + + printf("\"CHUNK COLUMN\" , %6u , %9.5g , %9.3g , %9.5g , %9.3g\n", + num_array, dt_mean, dt_sdev, mflop_mean, mflop_sdev ); + } + } + + /*----------------------------------------------------------------------*/ + + for ( i_test = 0 ; i_test < num_test ; ++i_test ) { + + const unsigned num_array = num_test_array[ i_test ]; + const unsigned num_sets = max_array / num_array ; + + const double mflop_cycle = + ((double)( 2 * num_array * length_array )) / 1.0e6 ; + + const unsigned ncycle = 1 + (unsigned)( Mflop_target / mflop_cycle ); + + double dt_sum = 0 ; + double dt_sum_2 = 0 ; + + data.length = length_array ; + data.number = num_array ; + data.stride = stride_array ; + data.chunk_length = length_chunk ; + + for ( i = 0 ; i < size_alloc ; ++i ) { array[i] = 0 ; } + + for ( j = 0 ; j < num_trials ; ++j ) { + + double dt_tmp = TPI_Walltime(); + + for ( i = 0 ; i < ncycle ; ++i ) { + data.array = array + stride_array * num_array * ( i % num_sets ); + TPI_Run( & test_dnax_row_work , & data , num_chunk , 0 ); + } + dt_tmp = TPI_Walltime() - dt_tmp ; + + dt_sum += dt_tmp ; + dt_sum_2 += dt_tmp * dt_tmp ; + } + + { + const double dt_mean = dt_sum / num_trials ; + const double dt_sdev = sqrt( ( num_trials * dt_sum_2 - dt_sum * dt_sum ) / ( num_trials * ( num_trials - 1 ) ) ); + const double mflop_mean = mflop_cycle * ncycle / dt_mean ; + const double mflop_sdev = mflop_mean * dt_sdev / ( dt_mean + dt_sdev ); + + printf("\"CHUNK ROW\" , %6u , %9.5g , %9.3g , %9.5g , %9.3g\n", + num_array, dt_mean, dt_sdev, mflop_mean, mflop_sdev ); + } + } + + /*----------------------------------------------------------------------*/ + + free( array ); + free( coef ); +} + +/*------------------------------------------------------------------------*/ + +int test_c_tpi_dnax( int nthread , int ntrial ) +{ + const unsigned Mflop_target = 10 ; + const unsigned num_array[6] = { 2 , 5 , 10 , 20 , 50 , 100 }; + const unsigned ntest = sizeof(num_array) / sizeof(unsigned); + + if ( ntrial <= 0 ) { ntrial = 7 ; } + + TPI_Init( nthread ); + + test_tpi_dnax_driver( nthread , + Mflop_target * nthread , + ntrial /* number trials */ , + ntest /* number of tests */ , + num_array /* number of arrays for each test */ , + 1e6 /* array computation length */ , + 1000 /* chunk length */ ); + + TPI_Finalize(); + + return 0 ; +} + + + diff --git a/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/test_mpi_sum.c b/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/test_mpi_sum.c new file mode 100644 index 0000000000..51d6b9ebb7 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/test_mpi_sum.c @@ -0,0 +1,764 @@ +/*------------------------------------------------------------------------*/ +/* TPI: Thread Pool Interface */ +/* Copyright (2008) Sandia Corporation */ +/* */ +/* Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive */ +/* license for use of this work by or on behalf of the U.S. Government. */ +/* */ +/* This library is free software; you can redistribute it and/or modify */ +/* it under the terms of the GNU Lesser General Public License as */ +/* published by the Free Software Foundation; either version 2.1 of the */ +/* License, or (at your option) any later version. */ +/* */ +/* This library is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU */ +/* Lesser General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU Lesser General Public */ +/* License along with this library; if not, write to the Free Software */ +/* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 */ +/* USA */ +/*------------------------------------------------------------------------*/ +/** + * @author H. Carter Edwards + */ + +#include +#include +#include +#include +#include + +int rand_r( unsigned int * ); + +/*--------------------------------------------------------------------*/ + +#if defined(HAVE_MPI) + +#include + +typedef MPI_Comm COMM ; + +#else + +typedef int COMM ; + +#endif + +static int comm_size( COMM ); +static int comm_rank( COMM ); +static void comm_reduce_dmax( COMM , double * ); +static void comm_reduce_dsum( COMM , double * ); +static void comm_reduce_d4_sum( COMM , double * ); + +/*--------------------------------------------------------------------*/ + +static void my_span( const unsigned count , const unsigned rank , + const unsigned size , + unsigned * begin , unsigned * length ) +{ + const unsigned int max = ( size + count - 1 ) / count ; + const unsigned int end = size - max * ( count - ( rank + 1 ) ); + if ( rank ) { + *begin = end - max ; + *length = max ; + } + else { + *begin = 0 ; + *length = end ; + } +} + +/*--------------------------------------------------------------------*/ + +#define LESS_ABS( X , Y ) ( ( X < 0 ? -X : X ) < ( Y < 0 ? -Y : Y ) ) + +static void d2_add_d( double v[] , const double a ) +{ + const int AltV = a < 0 ? ( - a < ( v[0] < 0 ? - v[0] : v[0] ) ) + : ( a < ( v[0] < 0 ? - v[0] : v[0] ) ); + + const double VpA = v[0] + a ; + + v[1] += AltV ? ( a - ( VpA - v[0] ) ) : ( v[0] - ( VpA - a ) ); + v[0] = VpA + v[1] ; + v[1] += VpA - v[0] ; +} + +void d4_dot( double v[] , unsigned n , const double * x , const double * y ) +{ + double * pos = v ; + double * neg = v + 2 ; + const double * const x_end = x + n ; + for ( ; x < x_end ; ++x , ++y ) { + const double a = *x * *y ; + if ( a < 0 ) { d2_add_d( neg , a ); } + else { d2_add_d( pos , a ); } + } +} + +double ddot( unsigned n , const double * x , const double * y ) +{ + double val = 0 ; + const double * const x_end = x + n ; + for ( ; x < x_end ; ++x , ++y ) { val += *x * *y ; } + return val ; +} + +/*--------------------------------------------------------------------*/ + +struct TaskXY { + unsigned int nreduce ; + unsigned int n ; + const double * x ; + const double * y ; +}; + +static +void reduce_init( TPI_Work * work ) +{ + struct TaskXY * const info = (struct TaskXY *) work->info ; + double * const dst = (double *) work->reduce ; + + if ( info->nreduce == 4 ) { + dst[0] = 0 ; + dst[1] = 0 ; + dst[2] = 0 ; + dst[3] = 0 ; + } + else if ( info->nreduce == 1 ) { + dst[0] = 0 ; + } +} + +static +void reduce_join( TPI_Work * work , const void * arg_src ) +{ + struct TaskXY * const info = (struct TaskXY *) work->info ; + double * const dst = (double *) work->reduce ; + const double * const src = (const double *) arg_src ; + + if ( info->nreduce == 4 ) { + d2_add_d( dst , src[0] ); + d2_add_d( dst , src[1] ); + d2_add_d( dst + 2 , src[2] ); + d2_add_d( dst + 2 , src[3] ); + } + else if ( info->nreduce == 1 ) { + dst[0] += src[0] ; + } +} + +/*--------------------------------------------------------------------*/ + +static +void work_d4_dot_tp( TPI_Work * work ) +{ + struct TaskXY * const info = (struct TaskXY *) work->info ; + double * const dst = (double *) work->reduce ; + + unsigned int begin , length ; + + my_span( work->count , work->rank , info->n , & begin , & length ); + + d4_dot( dst , length , info->x + begin , info->y + begin ); +} + +double d4_dot_tp( COMM comm, unsigned nwork, unsigned n, + const double * x, const double * y ) +{ + struct TaskXY info = { 4 , 0 , NULL , NULL }; + double result[4] = { 0 , 0 , 0 , 0 }; + info.n = n ; + info.x = x ; + info.y = y ; + + if ( nwork ) { + TPI_Run_reduce( work_d4_dot_tp , & info , nwork , + reduce_join, reduce_init, sizeof(result) , result ); + } + else { + TPI_Run_threads_reduce( work_d4_dot_tp , & info , + reduce_join, reduce_init, sizeof(result), result); + } + + comm_reduce_d4_sum( comm , result ); + + d2_add_d( result , result[2] ); + d2_add_d( result , result[3] ); + + return result[0] ; +} + +static +void task_ddot_tp( TPI_Work * work ) +{ + struct TaskXY * const info = (struct TaskXY *) work->info ; + double * const dst = (double *) work->reduce ; + unsigned int begin , length ; + + my_span( work->count , work->rank , info->n , & begin , & length ); + + *dst += ddot( length , info->x + begin , info->y + begin ); + + return ; +} + +double ddot_tp( COMM comm, unsigned nwork, unsigned n, + const double * x, const double * y ) +{ + struct TaskXY info = { 1 , 0 , NULL , NULL }; + double result = 0 ; + info.n = n ; + info.x = x ; + info.y = y ; + + if ( nwork ) { + TPI_Run_reduce( task_ddot_tp , & info , nwork , + reduce_join, reduce_init, sizeof(result), & result); + } + else { + TPI_Run_threads_reduce( task_ddot_tp , & info , + reduce_join, reduce_init, sizeof(result), & result); + } + + comm_reduce_dsum( comm , & result ); + + return result ; +} + +/*--------------------------------------------------------------------*/ + +void dfill_rand( unsigned seed , unsigned n , double * x , double mag ) +{ + const double scale = 2.0 * mag / (double) RAND_MAX ; + double * const xe = x + n ; + for ( ; xe != x ; ++x , ++seed ) { + unsigned s = seed ; + *x = scale * ((double) rand_r( & s )) - mag ; + } +} + +struct FillWork { + double mag ; + double * beg ; + unsigned length ; + unsigned seed ; +}; + +static void task_dfill_rand( TPI_Work * work ) +{ + struct FillWork * const w = (struct FillWork *) work->info ; + + unsigned int begin , length ; + + my_span( work->count, work->rank, w->length, & begin , & length ); + + dfill_rand( w->seed + begin , length , w->beg + begin , w->mag ); +} + +void dfill_rand_tp( unsigned nblock , unsigned seed , + unsigned n , double * x , double mag ) +{ + struct FillWork data ; + data.mag = mag ; + data.beg = x ; + data.length = n ; + data.seed = seed ; + if ( nblock ) { + const int nwork = ( n + nblock - 1 ) / nblock ; + TPI_Run( & task_dfill_rand , & data , nwork , 0 ); + } + else { + TPI_Run_threads( & task_dfill_rand , & data , 0 ); + } +} + +/*--------------------------------------------------------------------*/ + +static +void test_ddot_performance( + COMM comm , + const int nthreads , + const int nblock , + const unsigned int num_trials , + const unsigned int num_tests , + const unsigned int length_array[] /* Global array length for each test */ , + const double mag ) +{ + const unsigned int ddot_flop = 2 ; /* 1 mult, 1 sum */ + const unsigned int d4_dot_flop = 12 ; /* 1 mult, 7 sum, 4 compare */ + + const unsigned int p_rank = comm_rank( comm ); + const unsigned int p_size = comm_size( comm ); + + const unsigned int max_array = length_array[ num_tests - 1 ]; + + unsigned int local_max_size = 0 ; + unsigned int i_test ; + + TPI_Init( nthreads ); + + if ( 0 == p_rank ) { + fprintf(stdout,"\n\"DDOT and D4DOT Performance testing\"\n"); + fprintf(stdout,"\"MPI size = %u , TPI size = %d , BlockSize = %d , #Trials = %u\"\n",p_size,nthreads,nblock,num_trials); + fprintf(stdout,"\"TEST\" , \"LENGTH\" , \"#CYCLE\" , \"DT-MEAN\" , \"DT-STDDEV\" , \"MFLOP-MEAN\" , \"MFLOP-STDDEV\"\n"); + } + + for ( i_test = 0 ; i_test < num_tests ; ++i_test ) { + const unsigned length = length_array[ i_test ]; /* Global */ + const unsigned ncycle = 2 * max_array / length ; + const unsigned local_max = ncycle * ( ( length + p_size - 1 ) / p_size ); + if ( local_max_size < local_max ) { local_max_size = local_max ; } + } + + { + double * const x = (double*) malloc(local_max_size * 2 * sizeof(double)); + double * const y = x + local_max_size ; + + unsigned int i , j ; + + dfill_rand_tp( nblock, 0, local_max_size, x, mag ); + dfill_rand_tp( nblock, local_max_size, local_max_size, y, mag ); + + for ( i_test = 0 ; i_test < num_tests ; ++i_test ) { + const unsigned length = length_array[ i_test ]; /* Global */ + const unsigned ncycle = 2 * max_array / length ; + + unsigned int local_begin , local_length , local_nwork ; + + double dt_sum = 0.0 ; + double dt_sum_2 = 0.0 ; + + my_span( p_size, p_rank, length, & local_begin , & local_length ); + + local_nwork = nblock ? ( local_length + nblock - 1 ) / nblock : 0 ; + + /*--------------------------------------------------------------*/ + + for ( i = 0 ; i < num_trials ; ++i ) { + double dt = TPI_Walltime(); + for ( j = 0 ; j < ncycle ; ++j ) { + ddot_tp( comm, local_nwork, local_length, + x + j * local_length , + y + j * local_length ); + } + dt = TPI_Walltime() - dt ; + comm_reduce_dmax( comm , & dt ); + dt_sum += dt ; + dt_sum_2 += dt * dt ; + } + + if ( 0 == p_rank ) { + const double mflop = ((double)( ddot_flop * length * ncycle ) ) / ((double) 1e6 ); + + const double dt_mean = dt_sum / num_trials ; + const double dt_sdev = sqrt( ( num_trials * dt_sum_2 - dt_sum * dt_sum ) / + ( num_trials * ( num_trials - 1 ) ) ); + const double mflop_mean = mflop / dt_mean ; + const double mflop_sdev = mflop_mean * dt_sdev / ( dt_mean + dt_sdev ); + + fprintf(stdout,"\"DDOT\" , %8u , %8u , %9.5g , %9.5g , %9.5g , %9.5g\n", + length, ncycle, dt_mean, dt_sdev, mflop_mean, mflop_sdev ); + fflush(stdout); + } + } + + for ( i_test = 0 ; i_test < num_tests ; ++i_test ) { + const unsigned length = length_array[ i_test ]; /* Global */ + const unsigned ncycle = 2 * max_array / length ; + + unsigned int local_begin , local_length , local_nwork ; + + double dt_sum = 0 ; + double dt_sum_2 = 0 ; + + my_span( p_size, p_rank, length, & local_begin , & local_length ); + + local_nwork = nblock ? ( local_length + nblock - 1 ) / nblock : 0 ; + + /*--------------------------------------------------------------*/ + + for ( i = 0 ; i < num_trials ; ++i ) { + double dt = TPI_Walltime(); + for ( j = 0 ; j < ncycle ; ++j ) { + d4_dot_tp( comm, local_nwork, local_length, + x + j * local_length , + y + j * local_length ); + } + dt = TPI_Walltime() - dt ; + comm_reduce_dmax( comm , & dt ); + dt_sum += dt ; + dt_sum_2 += dt * dt ; + } + + if ( 0 == p_rank ) { + const double mflop = ((double)( d4_dot_flop * length * ncycle ) ) / ((double) 1e6 ); + + const double dt_mean = dt_sum / num_trials ; + const double dt_sdev = sqrt( ( num_trials * dt_sum_2 - dt_sum * dt_sum ) / + ( num_trials * ( num_trials - 1 ) ) ); + const double mflop_mean = mflop / dt_mean ; + const double mflop_sdev = mflop_mean * dt_sdev / ( dt_mean + dt_sdev ); + + fprintf(stdout,"\"D4DOT\" , %8u , %8u , %9.5g , %9.5g , %9.5g , %9.5g\n", + length, ncycle, dt_mean, dt_sdev, mflop_mean, mflop_sdev ); + fflush(stdout); + } + } + + /*--------------------------------------------------------------*/ + + free( x ); + } + + TPI_Finalize(); + + return ; +} + +/*--------------------------------------------------------------------*/ + +static +void test_ddot_accuracy( + COMM comm , + const int nthreads , + const int nblock , + const unsigned int num_tests , + const unsigned int length_array[] /* Global array length for each test */ , + const double mag ) +{ + const unsigned int p_rank = comm_rank( comm ); + const unsigned int p_size = comm_size( comm ); + + const unsigned int max_array = length_array[ num_tests - 1 ]; + const unsigned int local_max_size = ( max_array + p_size - 1 ) / p_size ; + + unsigned int i_test ; + + TPI_Init( nthreads ); + + if ( 0 == p_rank ) { + fprintf(stdout,"\n\"DDOT and D4DOT Accuracy testing\"\n"); + fprintf(stdout,"\"MPI size = %u , TPI size = %d , BlockSize = %d\"\n",p_size,nthreads,nblock); + fprintf(stdout,"\"TEST\" , \"LENGTH\" , \"VALUE\"\n"); + } + + { + double * const x = (double*) malloc(local_max_size * 2 * sizeof(double)); + double * const y = x + local_max_size ; + + for ( i_test = 0 ; i_test < num_tests ; ++i_test ) { + const unsigned length = length_array[ i_test ]; /* Global */ + const unsigned length_half = length / 2 ; + + unsigned local_begin , local_length , local_nwork ; + + double val_ddot ; + + my_span( p_size, p_rank, length, & local_begin , & local_length ); + + local_nwork = nblock ? ( local_length + nblock - 1 ) / nblock : 0 ; + + /*--------------------------------------------------------------*/ + + if ( local_begin < length_half ) { + const unsigned len = local_length < length_half - local_begin + ? local_length : length_half - local_begin ; + + dfill_rand_tp( nblock, local_begin, len, x, mag ); + dfill_rand_tp( nblock, length + local_begin, len, y, mag ); + } + + if ( length_half < local_begin + local_length ) { + const unsigned beg = length_half > local_begin + ? length_half : local_begin ; + const unsigned off = beg - local_begin ; + const unsigned len = local_length - off ; + + dfill_rand_tp( nblock, beg - length_half, len, x + off, mag ); + dfill_rand_tp( nblock, length + beg - length_half, len, y + off, - mag ); + } + + /*--------------------------------------------------------------*/ + + val_ddot = ddot_tp( comm, local_nwork, local_length, x, y ); + + if ( 0 == p_rank ) { + fprintf(stdout,"\"DDOT\" , %8u , %9.3g\n", length , val_ddot ); + fflush(stdout); + } + } + + for ( i_test = 0 ; i_test < num_tests ; ++i_test ) { + const unsigned length = length_array[ i_test ]; /* Global */ + const unsigned length_half = length / 2 ; + + unsigned local_begin , local_length , local_nwork ; + + double val_d4_dot ; + + my_span( p_size, p_rank, length, & local_begin , & local_length ); + + local_nwork = nblock ? ( local_length + nblock - 1 ) / nblock : 0 ; + + /*--------------------------------------------------------------*/ + + if ( local_begin < length_half ) { + const unsigned len = local_length < length_half - local_begin + ? local_length : length_half - local_begin ; + + dfill_rand_tp( nblock, local_begin, len, x, mag ); + dfill_rand_tp( nblock, length + local_begin, len, y, mag ); + } + + if ( length_half < local_begin + local_length ) { + const unsigned beg = length_half > local_begin + ? length_half : local_begin ; + const unsigned off = beg - local_begin ; + const unsigned len = local_length - off ; + + dfill_rand_tp( nblock, beg - length_half, len, x + off, mag ); + dfill_rand_tp( nblock, length + beg - length_half, len, y + off, - mag ); + } + + /*--------------------------------------------------------------*/ + + val_d4_dot = d4_dot_tp( comm, local_nwork, local_length, x , y ); + + if ( 0 == p_rank ) { + fprintf(stdout,"\"DDOT\" , %8u , %9.3g\n", length , val_d4_dot ); + fflush(stdout); + } + } + + /*--------------------------------------------------------------*/ + + free( x ); + } + + TPI_Finalize(); + + return ; +} + +/*--------------------------------------------------------------------*/ + +const unsigned test_lengths[] = + { 1e4 , 2e4 , 5e4 , + 1e5 , 2e5 , 5e5 , + 1e6 , 2e6 , 5e6 , 1e7 }; + +const unsigned test_count = sizeof(test_lengths) / sizeof(unsigned); +const unsigned nblock = 2500 ; + +const double test_mag = 1e4 ; + +static void test_performance( + COMM comm , const int test_thread_count , const int test_thread[] ) +{ + const unsigned num_trials = 11 ; + + int i ; + + for ( i = 0 ; i < test_thread_count ; ++i ) { + + test_ddot_performance( comm , test_thread[i] , nblock, + num_trials , test_count , test_lengths , test_mag ); + + test_ddot_performance( comm , test_thread[i] , 0, + num_trials , test_count , test_lengths , test_mag ); + } +} + +static void test_accuracy( + COMM comm , const int test_thread_count , const int test_thread[] , + unsigned test_do ) +{ + int i ; + + if ( test_count < test_do ) { test_do = test_count ; } + + for ( i = 0 ; i < test_thread_count ; ++i ) { + + test_ddot_accuracy( comm, test_thread[i], nblock, + test_do, test_lengths, test_mag ); + + test_ddot_accuracy( comm, test_thread[i], 0, + test_do, test_lengths, test_mag ); + } +} + +/*--------------------------------------------------------------------*/ +/*--------------------------------------------------------------------*/ + +#define TEST_THREAD_MAX 128 + +#if defined(HAVE_MPI) + +int main( int argc , char **argv ) +{ + int nthread[ TEST_THREAD_MAX ]; + int i ; + + MPI_Init( & argc , & argv ); + + for ( i = 0 ; i < TEST_THREAD_MAX ; ++i ) { nthread[i] = 0 ; } + + if ( 0 == comm_rank( MPI_COMM_WORLD ) ) { + if ( 1 < argc && argc < TEST_THREAD_MAX ) { + nthread[0] = 1 ; + nthread[1] = argc - 1 ; + for ( i = 1 ; i < argc ; ++i ) { nthread[i+1] = atoi( argv[i] ); } + } + else { + nthread[0] = 0 ; + nthread[1] = 1 ; + nthread[2] = 1 ; + } + } + + MPI_Bcast( nthread , TEST_THREAD_MAX , MPI_INT , 0 , MPI_COMM_WORLD ); + + if ( nthread[0] ) { + test_accuracy( MPI_COMM_WORLD , nthread[1] , nthread + 2 , test_count ); + test_performance( MPI_COMM_WORLD , nthread[1] , nthread + 2 ); + } + else { + test_accuracy( MPI_COMM_WORLD , nthread[1] , nthread + 2 , 3 ); + } + + MPI_Finalize(); + + return 0 ; +} + +static int comm_size( COMM comm ) +{ + int size = 0 ; + MPI_Comm_size( comm , & size ); + return size ; +} + +static int comm_rank( COMM comm ) +{ + int rank = 0 ; + MPI_Comm_rank( comm , & rank ); + return rank ; +} + +static void comm_reduce_dmax( COMM comm , double * val ) +{ + double tmp ; + if ( MPI_SUCCESS == + MPI_Allreduce( val , & tmp , 1 , MPI_DOUBLE , MPI_MAX , comm ) ) { + *val = tmp ; + } + else { + *val = 0 ; + } +} + +static void comm_reduce_dsum( COMM comm , double * val ) +{ + double tmp ; + if ( MPI_SUCCESS == + MPI_Allreduce( val , & tmp , 1 , MPI_DOUBLE , MPI_SUM , comm ) ) { + *val = tmp ; + } + else { + *val = 0 ; + } +} + +static void comm_reduce_d4_op( void * argin , + void * argout , + int * n , + MPI_Datatype * d ) +{ + if ( d && n && *n == 4 ) { + double * const in = (double*) argin ; + double * const out = (double*) argout ; + d2_add_d( out , in[0] ); + d2_add_d( out , in[1] ); + d2_add_d( out + 2 , in[2] ); + d2_add_d( out + 2 , in[3] ); + } + return ; +} + +static void comm_reduce_d4_sum( COMM comm , double * val ) +{ + double tmp[4] ; + MPI_Op mpi_op = MPI_OP_NULL ; + + /* Use Reduce->Bcast instead of Allreduce due to a bug with the SUN MPI. */ + + MPI_Op_create( comm_reduce_d4_op , 0 , & mpi_op ); + MPI_Reduce( val , tmp , 4 , MPI_DOUBLE , mpi_op , 0 , comm ); + MPI_Bcast( tmp , 4 , MPI_DOUBLE , 0 , comm ); + MPI_Op_free( & mpi_op ); + + val[0] = tmp[0] ; + val[1] = tmp[1] ; + val[2] = tmp[2] ; + val[3] = tmp[3] ; +} + +#else + +int main( int argc , char **argv ) +{ + int nthread[ TEST_THREAD_MAX ]; + int i ; + + for ( i = 0 ; i < TEST_THREAD_MAX ; ++i ) { nthread[i] = 0 ; } + + if ( 1 < argc && argc < TEST_THREAD_MAX ) { + nthread[0] = 1 ; + nthread[1] = argc - 1 ; + for ( i = 1 ; i < argc ; ++i ) { nthread[i+1] = atoi( argv[i] ); } + } + else { + nthread[0] = 0 ; + nthread[1] = 4 ; + nthread[2] = 1 ; + nthread[3] = 2 ; + nthread[4] = 4 ; + nthread[5] = 8 ; + } + + if ( nthread[0] ) { + test_accuracy( 0 , nthread[1] , nthread + 2 , test_count ); + test_performance( 0 , nthread[1] , nthread + 2 ); + } + else { + test_accuracy( 0 , nthread[1] , nthread + 2 , 3 ); + } + + return 0 ; +} + +static int comm_size( COMM comm ) { return comm ? -1 : 1 ; } +static int comm_rank( COMM comm ) { return comm ? -1 : 0 ; } +static void comm_reduce_dmax( COMM comm , double * val ) +{ + if ( comm ) { *val = 0 ; } + return ; +} +static void comm_reduce_dsum( COMM comm , double * val ) +{ + if ( comm ) { *val = 0 ; } + return ; +} +static void comm_reduce_d4_sum( COMM comm , double * val ) +{ + if ( comm ) { val[0] = val[1] = val[2] = val[3] = 0 ; } + return ; +} + +#endif + +/*--------------------------------------------------------------------*/ + diff --git a/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/test_pthreads.c b/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/test_pthreads.c new file mode 100644 index 0000000000..235eb418ee --- /dev/null +++ b/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/test_pthreads.c @@ -0,0 +1,279 @@ +/*------------------------------------------------------------------------*/ +/* TPI: Thread Pool Interface */ +/* Copyright (2008) Sandia Corporation */ +/* */ +/* Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive */ +/* license for use of this work by or on behalf of the U.S. Government. */ +/* */ +/* This library is free software; you can redistribute it and/or modify */ +/* it under the terms of the GNU Lesser General Public License as */ +/* published by the Free Software Foundation; either version 2.1 of the */ +/* License, or (at your option) any later version. */ +/* */ +/* This library is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU */ +/* Lesser General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU Lesser General Public */ +/* License along with this library; if not, write to the Free Software */ +/* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 */ +/* USA */ +/*------------------------------------------------------------------------*/ +/** + * @author H. Carter Edwards + */ + +#include +#include +#include +#include + +/*------------------------------------------------------------------------*/ +/* Test various ways of controling worker threads */ + +typedef struct TestPthreads_struct { + pthread_mutex_t m_lock ; + pthread_cond_t m_cond ; + int m_thread_rank ; + int m_thread_count ; +} TestPthreads ; + +/*------------------------------------------------------------------------*/ +/*------------------------------------------------------------------------*/ + +static void * test_driver( void * arg ) +{ + TestPthreads * const data = (TestPthreads*) arg ; + TestPthreads * const root = data - data->m_thread_rank ; + + /*------------------------------*/ + /* Initializing */ + + pthread_mutex_lock( & data->m_lock ); + + pthread_mutex_lock( & root->m_lock ); + pthread_cond_signal( & root->m_cond ); + pthread_mutex_unlock( & root->m_lock ); + + /*------------------------------*/ + + while ( data->m_thread_rank ) { + pthread_cond_wait( & data->m_cond , & data->m_lock ); + } + pthread_mutex_unlock( & data->m_lock ); + + /*------------------------------*/ + /* Terminating */ + + pthread_mutex_lock( & root->m_lock ); + if ( 0 == --( root->m_thread_count ) ) { + pthread_cond_signal( & root->m_cond ); + } + pthread_mutex_unlock( & root->m_lock ); + + return NULL ; +} + + +static void test_run( pthread_attr_t * const thread_attr , + const int number_threads , + const int number_trials , + const int number_loops , + double * const dt_start_stop , + double * const dt_loop ) +{ + TestPthreads data[ number_threads ]; + double dt_total ; + double dt_run = 0 ; + int j ; + + dt_total = TPI_Walltime(); + + for ( j = 0 ; j < number_trials ; ++j ) { + int i ; + + for ( i = 0 ; i < number_threads ; ++i ) { + pthread_cond_init( & data[i].m_cond , NULL ); + pthread_mutex_init( & data[i].m_lock , NULL ); + data[i].m_thread_rank = i ; + data[i].m_thread_count = number_threads ; + } + + pthread_mutex_lock( & data->m_lock ); + + for ( i = 1 ; i < number_threads ; ++i ) { + pthread_t pt ; + pthread_create( & pt, thread_attr, & test_driver , data + i ); + pthread_cond_wait( & data->m_cond , & data->m_lock ); + pthread_mutex_lock( & data[i].m_lock ); + } + + /* Running */ + + { + double dt = TPI_Walltime(); + int k ; + + for ( k = 1 ; k < number_loops ; ++k ) { + for ( i = 1 ; i < number_threads ; ++i ) { + pthread_cond_signal( & data[i].m_cond ); + pthread_mutex_unlock( & data[i].m_lock ); + } + + /* Work goes here */ + + for ( i = 1 ; i < number_threads ; ++i ) { + pthread_mutex_lock( & data[i].m_lock ); + } + } + + dt_run += TPI_Walltime() - dt ; + } + + /* Termination */ + + --( data->m_thread_count ); + + if ( data->m_thread_count ) { + for ( i = 1 ; i < number_threads ; ++i ) { + data[i].m_thread_rank = 0 ; + pthread_cond_signal( & data[i].m_cond ); + pthread_mutex_unlock( & data[i].m_lock ); + } + + pthread_cond_wait( & data->m_cond , & data->m_lock ); + } + + pthread_mutex_unlock( & data->m_lock ); + + for ( i = 0 ; i < number_threads ; ++i ) { + pthread_cond_destroy( & data[i].m_cond ); + pthread_mutex_destroy( & data[i].m_lock ); + } + } + + dt_total = TPI_Walltime() - dt_total ; + + *dt_loop = 1.0e6 * dt_run / (double) ( number_trials * number_loops ); + *dt_start_stop = 1.0e6 * ( dt_total - dt_run ) / (double) number_trials ; +} + +/*------------------------------------------------------------------------*/ +/*------------------------------------------------------------------------*/ + +static double test_mutex_init_destroy( const int number ) +{ + pthread_mutex_t mutex ; + double dt ; + int i ; + dt = TPI_Walltime(); + for ( i = 0 ; i < number ; ++i ) { + pthread_mutex_init( & mutex , NULL ); + pthread_mutex_destroy( & mutex ); + } + dt = ( TPI_Walltime() - dt ) / (double) number ; + return dt ; +} + +static double test_mutex_lock_unlock( const int number ) +{ + pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER ; + double dt ; + int i ; + + dt = TPI_Walltime(); + for ( i = 0 ; i < number ; ++i ) { + pthread_mutex_lock( & mutex ); + pthread_mutex_unlock( & mutex ); + } + dt = ( TPI_Walltime() - dt ) / (double) number ; + + pthread_mutex_destroy( & mutex ); + return dt ; +} + +/*------------------------------------------------------------------------*/ + +void test_pthreads_performance( int n_test , int * n_concurrent ) +{ + const int n_mutex = 1e4 /* 1e8 */ ; + const int n_trial = 1e2 /* 1e4 */ ; + const int n_loop = 1e3 /* 1e4 */ ; + + { + const double dt = 1e6 * test_mutex_init_destroy( n_mutex ); + fprintf(stdout,"\n\"test pthreads mutex init/destroy (microsec)\" , %g\n",dt); + } + + { + const double dt = 1e6 * test_mutex_lock_unlock( n_mutex ); + fprintf(stdout,"\n\"test pthreads mutex lock/unlock (microsec)\" , %g\n",dt); + } + + /*------------------------------------------------------------------*/ + + { + int i ; + + pthread_attr_t thread_attr ; + + fprintf(stdout,"\n\"test pthreads SCOPE_SYSTEM run-blocking\"\n"); + fprintf(stdout,"\"#Threads\" , \"#Spawned\" \"Spawn (microsec)\" , \"Loop (microsec)\"\n"); + + pthread_attr_init( & thread_attr ); + pthread_attr_setscope( & thread_attr, PTHREAD_SCOPE_SYSTEM ); + pthread_attr_setdetachstate( & thread_attr, PTHREAD_CREATE_DETACHED ); + + for ( i = 0 ; i < n_test ; ++i ) { + const int nthread = n_concurrent[i] ; + double dt_start_stop , dt_loop ; + + test_run( & thread_attr, nthread, n_trial, n_loop, + & dt_start_stop , & dt_loop ); + + fprintf( stdout, "%d , %d , %g , %g\n", + nthread , nthread - 1 , dt_start_stop , dt_loop ); + fflush( stdout ); + } + + pthread_attr_destroy( & thread_attr ); + } + + /*------------------------------------------------------------------*/ + + { + int i ; + + pthread_attr_t thread_attr ; + + fprintf(stdout,"\n\"test pthreads SCOPE_PROCESS run-blocking\"\n"); + fprintf(stdout,"\"#Threads\" , \"#Spawned\" \"Spawn (microsec)\" , \"Loop (microsec)\"\n"); + + pthread_attr_init( & thread_attr ); + pthread_attr_setscope( & thread_attr, PTHREAD_SCOPE_PROCESS ); + pthread_attr_setdetachstate( & thread_attr, PTHREAD_CREATE_DETACHED ); + + for ( i = 0 ; i < n_test ; ++i ) { + const int nthread = n_concurrent[i] ; + double dt_start_stop , dt_loop ; + + test_run( & thread_attr, nthread, n_trial, n_loop, + & dt_start_stop , & dt_loop ); + + fprintf( stdout, "%d , %d , %g , %g\n", + nthread , nthread - 1 , dt_start_stop , dt_loop ); + fflush( stdout ); + } + + pthread_attr_destroy( & thread_attr ); + } + + /*------------------------------------------------------------------*/ + + fflush( stdout ); +} + +/*------------------------------------------------------------------------*/ + + diff --git a/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/test_tpi.cpp b/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/test_tpi.cpp new file mode 100644 index 0000000000..cf5a649206 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/test_tpi.cpp @@ -0,0 +1,123 @@ +/*------------------------------------------------------------------------*/ +/* TPI: Thread Pool Interface */ +/* Copyright (2008) Sandia Corporation */ +/* */ +/* Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive */ +/* license for use of this work by or on behalf of the U.S. Government. */ +/* */ +/* This library is free software; you can redistribute it and/or modify */ +/* it under the terms of the GNU Lesser General Public License as */ +/* published by the Free Software Foundation; either version 2.1 of the */ +/* License, or (at your option) any later version. */ +/* */ +/* This library is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU */ +/* Lesser General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU Lesser General Public */ +/* License along with this library; if not, write to the Free Software */ +/* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 */ +/* USA */ +/*------------------------------------------------------------------------*/ +/** + * @author H. Carter Edwards + */ + +#include +#include +#include + +/*------------------------------------------------------------------------*/ +/*--------------------------------------------------------------------*/ + +template class TEST ; + +template +class TEST { +public: + int m_flag[N] ; + ~TEST() {} + TEST(); + void flag( TPI::Work & ); + void verify(); +private: + TEST( const TEST & ); + TEST & operator = ( const TEST & ); +}; + +template +TEST::TEST() +{ + for ( unsigned i = 0 ; i < N ; ++i ) { m_flag[i] = 0 ; } +} + +template +void TEST::flag( TPI::Work & work ) +{ + static const char method[] = "TEST::flag" ; + if ( work.count != (int) N ) { + std::cerr << method + << "<" << N << "> count(" << work.count << ") failed" + << std::endl ; + throw std::exception(); + } + m_flag[ work.rank ] = 1 ; +} + +template +void TEST::verify() +{ + static const char method[] = "TEST::verify" ; + + for ( unsigned i = 0 ; i < N ; ++i ) { + if ( ! m_flag[i] ) { + std::cerr << method + << "<" << N << "> m_flag[" << i << "] failed" + << std::endl ; + throw std::exception(); + } + else { + m_flag[i] = 0 ; + } + } +} + +void test_tpi_cpp( int np ) +{ + TEST<1> test_1 ; + TEST<2> test_2 ; + TEST<4> test_4 ; + TEST<8> test_8 ; + TEST<16> test_16 ; + + TPI::Init( np ); + + TPI::Run( test_1 , & TEST<1>::flag , 1 ); + TPI::Run( test_2 , & TEST<2>::flag , 2 ); + TPI::Run( test_4 , & TEST<4>::flag , 4 ); + TPI::Run( test_8 , & TEST<8>::flag , 8 ); + TPI::Run( test_16 , & TEST<16>::flag , 16 ); + + test_1.verify(); + test_2.verify(); + test_4.verify(); + test_8.verify(); + test_16.verify(); + + TPI::Finalize(); +} + +int main( int argc , char ** argv ) +{ + if ( argc ) { std::cout << argv[0] ; } + else { std::cout << "test" ; } + test_tpi_cpp(1); std::cout << " 1 " ; + test_tpi_cpp(2); std::cout << " 2 " ; + test_tpi_cpp(4); std::cout << " 4 " ; + test_tpi_cpp(8); std::cout << " 8 " ; + test_tpi_cpp(16); std::cout << " 16 " ; + std::cout << " passed" << std::endl ; + return 0 ; +} + diff --git a/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/test_tpi_unit.c b/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/test_tpi_unit.c new file mode 100644 index 0000000000..34faef8525 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/optional/ThreadPool/test/test_tpi_unit.c @@ -0,0 +1,505 @@ +/*------------------------------------------------------------------------*/ +/* TPI: Thread Pool Interface */ +/* Copyright (2008) Sandia Corporation */ +/* */ +/* Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive */ +/* license for use of this work by or on behalf of the U.S. Government. */ +/* */ +/* This library is free software; you can redistribute it and/or modify */ +/* it under the terms of the GNU Lesser General Public License as */ +/* published by the Free Software Foundation; either version 2.1 of the */ +/* License, or (at your option) any later version. */ +/* */ +/* This library is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU */ +/* Lesser General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU Lesser General Public */ +/* License along with this library; if not, write to the Free Software */ +/* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 */ +/* USA */ +/*------------------------------------------------------------------------*/ +/** + * @author H. Carter Edwards + */ + +#include +#include +#include +#include + +#if defined( HAVE_MPI ) +#include +#endif + +/*--------------------------------------------------------------------*/ + +static void test_work( TPI_Work * ); +static void test_reduce_work( TPI_Work * ); +static void test_reduce_init( TPI_Work * ); +static void test_reduce_join( TPI_Work * , const void * ); +static void test_reduce_via_lock( TPI_Work * ); +static void test_reduce_via_nolock( TPI_Work * ); + +void test_tpi_init( const int ntest, const int nthread[], const int ntrial); +void test_tpi_block( const int ntest, const int nthread[], const int ntrial); +void test_tpi_reduce( const int ntest, const int nthread[], const int ntrial); +void test_tpi_work( const int ntest, const int nthread[], + const int nwork , const int ntrial ); +void test_tpi_work_async( + const int ntest , const int nthread[] , const int nwork , const int ntrial ); + +int main( int argc , char ** argv ) +{ + int num_thread[] = { 1 , 2 , 4 , 6 , 8 , 12 , 16 }; + int num_test = sizeof(num_thread) / sizeof(int); + +#if defined( HAVE_MPI ) + int rank ; + + MPI_Init( & argc , & argv ); + MPI_Comm_rank( MPI_COMM_WORLD , & rank ); + if ( 0 == rank ) { +#endif + + const int ntrial = 1 < argc ? atoi( argv[1] ) : 5 ; + const int nwork = 2 < argc ? atoi( argv[2] ) : 100 ; + + /* Get the configuration print message out. */ + fprintf( stdout , "\"%s\"\n" , TPI_Version() ); + fprintf( stdout , "\"Unit Testing: ntrial = %d , nwork = %d\"\n" , ntrial , nwork ); + + test_tpi_init( num_test , num_thread , ntrial ); + test_tpi_block( num_test , num_thread , ntrial ); + test_tpi_reduce( num_test , num_thread , ntrial ); + test_tpi_work( num_test , num_thread , nwork , ntrial ); + test_tpi_work_async( num_test , num_thread , nwork , ntrial ); + +#if defined( HAVE_MPI ) + } + MPI_Finalize(); +#endif + + return 0 ; +} + +/*--------------------------------------------------------------------*/ + +void test_tpi_init( const int ntest , const int nthread[] , const int ntrial ) +{ + int j ; + + fprintf( stdout , "\n\"TEST TPI_Init / TPI_Finalize\"\n" ); + fprintf( stdout , "\"#Thread\" , \"#Trial\" , \"TPI_Init(avg-msec)\" , \"TPI_Init(stddev-msec)\" , \"TPI_Finalize(avg-msec)\" , \"TPI_Finalize(stddev-msec)\"\n"); + + for ( j = 0 ; j < ntest ; ++j ) { + const int nth = nthread[j]; + double dt_init_total = 0.0 ; + double dt_init_total_2 = 0.0 ; + double dt_fin_total = 0.0 ; + double dt_fin_total_2 = 0.0 ; + int i ; + int result ; + + for ( i = 0 ; i < ntrial ; ++i ) { + double t , dt ; + + t = TPI_Walltime(); + result = TPI_Init( nth ); + dt = TPI_Walltime() - t ; + dt_init_total += dt ; + dt_init_total_2 += dt * dt ; + + if ( result != nth ) { + fprintf(stderr,"%d != TPI_Init(%d) : FAILED at trial %d\n", + result , nth , i ); + abort(); + } + + t = TPI_Walltime(); + TPI_Finalize(); + dt = TPI_Walltime() - t ; + dt_fin_total += dt ; + dt_fin_total_2 += dt * dt ; + } + + if ( 1 < ntrial ) { + const double init_mean = 1.0e6 * dt_init_total / ntrial ; + const double init_sdev = 1.0e6 * sqrt( ( ntrial * dt_init_total_2 - + dt_init_total * dt_init_total ) / + ( ntrial * ( ntrial - 1 ) ) ); + + const double fin_mean = 1.0e6 * dt_fin_total / ntrial ; + const double fin_sdev = 1.0e6 * sqrt( ( ntrial * dt_fin_total_2 - + dt_fin_total * dt_fin_total ) / + ( ntrial * ( ntrial - 1 ) ) ); + + fprintf(stdout,"%d , %d , %10g , %10g , %10g , %10g\n", + nth , ntrial , init_mean , init_sdev , fin_mean , fin_sdev ); + } + } +} + +/*--------------------------------------------------------------------*/ + +void test_tpi_block( const int ntest , const int nthread[] , const int ntrial ) +{ + int i, j ; + + fprintf( stdout , "\n\"TEST TPI_Block / TPI_Unblock\"\n" ); + fprintf( stdout , "\"#Thread\" , \"#Trial\" , \"TPI_Block(avg-msec)\" , \"TPI_Block(stddev-msec)\" , \"TPI_Unblock(avg-msec)\" , \"TPI_Unblock(stddev-msec)\"\n"); + + for ( j = 0 ; j < ntest ; ++j ) { + const int nth = nthread[j]; + + double dt_block_total = 0.0 ; + double dt_block_total_2 = 0.0 ; + double dt_unblock_total = 0.0 ; + double dt_unblock_total_2 = 0.0 ; + + int result = TPI_Init( nth ); + + if ( result != nth ) { + fprintf(stderr,"%d != TPI_Init(%d) : FAILED\n", result , nth ); + abort(); + } + + for ( i = 0 ; i < ntrial ; ++i ) { + double t , dt ; + + t = TPI_Walltime(); + TPI_Block(); + dt = TPI_Walltime() - t ; + dt_block_total += dt ; + dt_block_total_2 += dt * dt ; + + + t = TPI_Walltime(); + TPI_Unblock(); + dt = TPI_Walltime() - t ; + dt_unblock_total += dt ; + dt_unblock_total_2 += dt * dt ; + } + + TPI_Finalize(); + + if ( 1 < ntrial ) { + const double block_mean = 1.0e6 * dt_block_total / ntrial ; + const double block_sdev = 1.0e6 * sqrt( ( ntrial * dt_block_total_2 - + dt_block_total * dt_block_total ) / + ( ntrial * ( ntrial - 1 ) ) ); + + const double unblock_mean = 1.0e6 * dt_unblock_total / ntrial ; + const double unblock_sdev = 1.0e6 * sqrt( ( ntrial * dt_unblock_total_2 - + dt_unblock_total * dt_unblock_total) / + ( ntrial * ( ntrial - 1 ) ) ); + + fprintf(stdout,"%d , %d , %10g , %10g , %10g , %10g\n", + nth , ntrial , block_mean , block_sdev , unblock_mean , unblock_sdev ); + } + } +} + +/*--------------------------------------------------------------------*/ + +void test_tpi_reduce( const int ntest , const int nthread[] , const int ntrial ) +{ + int j ; + + fprintf( stdout , "\n\"TEST TPI_Run_threads(reduce) / TPI_Run_threads_reduce\"\n" ); + fprintf( stdout , "\"#Thread\" , \"#Trial\" , \"TPI_Run_threads(avg-msec)\" , \"TPI_Run_threads(stddev-msec)\" , \"TPI_Run_threads_reduce(avg-msec)\" , \"TPI_Run_threads_reduce(stddev-msec)\"\n"); + + for ( j = 0 ; j < ntest ; ++j ) { + const int nth = nthread[j]; + + double dt_lock_total = 0.0 ; + double dt_lock_total_2 = 0.0 ; + double dt_reduce_total = 0.0 ; + double dt_reduce_total_2 = 0.0 ; + int i ; + + int result = TPI_Init( nth ); + + if ( result != nth ) { + fprintf(stderr,"%d != TPI_Init(%d) : FAILED\n", result , nth ); + } + + for ( i = 0 ; i < ntrial ; ++i ) { + double t , dt ; + int value = 0 ; + int * const ptr = & value ; + + t = TPI_Walltime(); + TPI_Run_threads( test_reduce_via_lock , & ptr , 1 ); + dt = TPI_Walltime() - t ; + dt_lock_total += dt ; + dt_lock_total_2 += dt * dt ; + + if ( value != nth ) { + fprintf(stderr, + "TPI_Run_threads(reduce,...) : FAILED at trial %d\n", + i ); + abort(); + } + + value = 0 ; + + t = TPI_Walltime(); + TPI_Run_threads_reduce( test_reduce_via_nolock , NULL , + test_reduce_join , test_reduce_init , + sizeof(value) , & value ); + + dt = TPI_Walltime() - t ; + dt_reduce_total += dt ; + dt_reduce_total_2 += dt * dt ; + + if ( value != nth ) { + fprintf(stderr, + "TPI_Run_threads_reduce(...) : FAILED at trial %d\n", + i ); + abort(); + } + } + + TPI_Finalize(); + + if ( 1 < ntrial ) { + const double lock_mean = 1.0e6 * dt_lock_total / ntrial ; + const double lock_sdev = 1.0e6 * sqrt( ( ntrial * dt_lock_total_2 - + dt_lock_total * dt_lock_total ) / + ( ntrial * ( ntrial - 1 ) ) ); + + const double reduce_mean = 1.0e6 * dt_reduce_total / ntrial ; + const double reduce_sdev = 1.0e6 * sqrt( ( ntrial * dt_reduce_total_2 - + dt_reduce_total * dt_reduce_total) / + ( ntrial * ( ntrial - 1 ) ) ); + + fprintf(stdout,"%d , %d , %10g , %10g , %10g , %10g\n", + nth, ntrial, lock_mean, lock_sdev, reduce_mean, reduce_sdev); + } + } +} + +/*--------------------------------------------------------------------*/ + +void test_tpi_work( const int ntest , const int nthread[] , const int nwork , + const int ntrial ) +{ + int * const flags = (int *) malloc( sizeof(int) * nwork ); + int j ; + + fprintf( stdout , "\n\"TEST TPI_Run / TPI_Run_reduce\"\n" ); + fprintf( stdout , "\"#Thread\" , \"#Work\" , \"#Trial\" , \"TPI_Run(avg-msec)\" , \"TPI_Run(stddev-msec)\" , \"TPI_Run_reduce(avg-msec)\" , \"TPI_Run_reduce(stddev-msec)\"\n"); + + for ( j = 0 ; j < ntest ; ++j ) { + const int nth = nthread[j]; + + double dt_work_total = 0.0 ; + double dt_work_total_2 = 0.0 ; + double dt_reduce_total = 0.0 ; + double dt_reduce_total_2 = 0.0 ; + int i , k ; + + int result = TPI_Init( nth ); + + if ( result != nth ) { + fprintf(stderr,"%d != TPI_Init(%d) : FAILED\n", result , nth ); + } + + for ( i = 0 ; i < ntrial ; ++i ) { + double t , dt ; + int value = 0 ; + + for ( k = 0 ; k < nwork ; ++k ) { flags[k] = 0 ; } + + t = TPI_Walltime(); + TPI_Run( test_work , & flags , nwork , 0 ); + dt = TPI_Walltime() - t ; + dt_work_total += dt ; + dt_work_total_2 += dt * dt ; + + for ( k = 0 ; k < nwork && flags[k] ; ++k ); + + if ( k < nwork ) { + fprintf(stderr, "TPI_Run(...) : FAILED at trial %d\n", i ); + abort(); + } + + for ( k = 0 ; k < nwork ; ++k ) { flags[k] = 0 ; } + + t = TPI_Walltime(); + TPI_Run_reduce( test_reduce_work , & flags , nwork , + test_reduce_join , test_reduce_init , + sizeof(value) , & value ); + + dt = TPI_Walltime() - t ; + dt_reduce_total += dt ; + dt_reduce_total_2 += dt * dt ; + + for ( k = 0 ; k < nwork && flags[k] ; ++k ); + + if ( value != nwork || k < nwork ) { + fprintf(stderr, "TPI_Run_reduce(...) : FAILED at trial %d\n", i ); + abort(); + } + } + + TPI_Finalize(); + + if ( 1 < ntrial ) { + const double work_mean = 1.0e6 * dt_work_total / ntrial ; + const double work_sdev = 1.0e6 * sqrt( ( ntrial * dt_work_total_2 - + dt_work_total * dt_work_total ) / + ( ntrial * ( ntrial - 1 ) ) ); + + const double reduce_mean = 1.0e6 * dt_reduce_total / ntrial ; + const double reduce_sdev = 1.0e6 * sqrt( ( ntrial * dt_reduce_total_2 - + dt_reduce_total * dt_reduce_total) / + ( ntrial * ( ntrial - 1 ) ) ); + + fprintf(stdout,"%d , %d , %d , %10g , %10g , %10g , %10g\n", + nth, ntrial, nwork, work_mean, work_sdev, reduce_mean, reduce_sdev); + } + } + + free( flags ); +} + +/*--------------------------------------------------------------------*/ + +void test_tpi_work_async( + const int ntest , const int nthread[] , const int nwork , const int ntrial ) +{ + int * const flags = (int *) malloc( sizeof(int) * nwork ); + int j ; + + fprintf( stdout , "\n\"TEST TPI_Start / TPI_Start_reduce\"\n" ); + fprintf( stdout , "\"#Thread\" , \"#Work\" , \"#Trial\" , \"TPI_Start(avg-msec)\" , \"TPI_Start(stddev-msec)\" , \"TPI_Start_reduce(avg-msec)\" , \"TPI_Start_reduce(stddev-msec)\"\n"); + + for ( j = 0 ; j < ntest ; ++j ) { + const int nth = nthread[j]; + + double dt_work_total = 0.0 ; + double dt_work_total_2 = 0.0 ; + double dt_reduce_total = 0.0 ; + double dt_reduce_total_2 = 0.0 ; + int i , k ; + + int result = TPI_Init( nth ); + + if ( result != nth ) { + fprintf(stderr,"%d != TPI_Init(%d) : FAILED\n", result , nth ); + } + + for ( i = 0 ; i < ntrial ; ++i ) { + double t , dt ; + int value = 0 ; + + for ( k = 0 ; k < nwork ; ++k ) { flags[k] = 0 ; } + + t = TPI_Walltime(); + TPI_Start( test_work , & flags , nwork , 0 ); + TPI_Wait(); + dt = TPI_Walltime() - t ; + dt_work_total += dt ; + dt_work_total_2 += dt * dt ; + + for ( k = 0 ; k < nwork && flags[k] ; ++k ); + + if ( k < nwork ) { + fprintf(stderr, "TPI_Run(...) : FAILED at trial %d\n", i ); + abort(); + } + + for ( k = 0 ; k < nwork ; ++k ) { flags[k] = 0 ; } + + t = TPI_Walltime(); + + TPI_Start_reduce( test_reduce_work , & flags , nwork , + test_reduce_join , test_reduce_init , + sizeof(value) , & value ); + TPI_Wait(); + + dt = TPI_Walltime() - t ; + dt_reduce_total += dt ; + dt_reduce_total_2 += dt * dt ; + + for ( k = 0 ; k < nwork && flags[k] ; ++k ); + + if ( value != nwork || k < nwork ) { + fprintf(stderr, "TPI_Run_reduce(...) : FAILED at trial %d\n", i ); + abort(); + } + } + + TPI_Finalize(); + + if ( 1 < ntrial ) { + const double work_mean = 1.0e6 * dt_work_total / ntrial ; + const double work_sdev = 1.0e6 * sqrt( ( ntrial * dt_work_total_2 - + dt_work_total * dt_work_total ) / + ( ntrial * ( ntrial - 1 ) ) ); + + const double reduce_mean = 1.0e6 * dt_reduce_total / ntrial ; + const double reduce_sdev = 1.0e6 * sqrt( ( ntrial * dt_reduce_total_2 - + dt_reduce_total * dt_reduce_total) / + ( ntrial * ( ntrial - 1 ) ) ); + + fprintf(stdout,"%d , %d , %d , %10g , %10g , %10g , %10g\n", + nth, ntrial, nwork, work_mean, work_sdev, reduce_mean, reduce_sdev); + } + } + + free( flags ); +} + +/*--------------------------------------------------------------------*/ + +static void test_work( TPI_Work * work ) +{ + int * const flags = * (int *const*) work->info ; + flags[ work->rank ] = 1 ; +} + +static void test_reduce_work( TPI_Work * work ) +{ + int * const flags = * (int *const*) work->info ; + flags[ work->rank ] = 1 ; + + *((int *) work->reduce) += 1 ; +} + +static void test_reduce_init( TPI_Work * work ) +{ + *((int *) work->reduce) = 0 ; +} + +static void test_reduce_join( TPI_Work * work , const void * src ) +{ + *((int *) work->reduce) += *( (const int *) src ); +} + +static void test_reduce_via_lock( TPI_Work * work ) +{ + int * const value = * ((int *const*) work->info ); + int result ; + if ( ( result = TPI_Lock(0) ) ) { + fprintf(stderr,"TPI_Lock(0) = %d : FAILED\n", result); + abort(); + } + *value += 1 ; + if ( ( result = TPI_Unlock(0) ) ) { + fprintf(stderr,"TPI_Unlock(0) = %d : FAILED\n", result); + abort(); + } +} + +static void test_reduce_via_nolock( TPI_Work * work ) +{ + int * const value = (int *) work->reduce ; + *value += 1 ; +} + +/*--------------------------------------------------------------------*/ + diff --git a/tests/apps/miniFE/tests/basic/optional/copy_from_trilinos b/tests/apps/miniFE/tests/basic/optional/copy_from_trilinos new file mode 100755 index 0000000000..042e4fb853 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/optional/copy_from_trilinos @@ -0,0 +1,25 @@ +#!/bin/bash + +TRILINOS_SRC=$1 + +if [ -d "${TRILINOS_SRC}" -a -d "${TRILINOS_SRC}/packages" ] ; +then + +#----------------------------------------------------------------------- +cp -r ${TRILINOS_SRC}/packages/ThreadPool/* ThreadPool +rm -rf ThreadPool/doc + +cat << END_CAT > ThreadPool/ThreadPool_config.h +#ifndef HAVE_PTHREAD +#define HAVE_PTHREAD +#endif +END_CAT + +#----------------------------------------------------------------------- + +else + + echo 'usage: ' $0 '' + +fi + diff --git a/tests/apps/miniFE/tests/basic/optional/cuda/CudaCall.hpp b/tests/apps/miniFE/tests/basic/optional/cuda/CudaCall.hpp new file mode 100644 index 0000000000..f4b8c703c9 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/optional/cuda/CudaCall.hpp @@ -0,0 +1,21 @@ +#ifndef stk_algsup_CudaCall_hpp +#define stk_algsup_CudaCall_hpp + +#include +#include + +//---------------------------------------------------------------- +inline +void stk_cuda_call(cudaError err , const char* name ) +{ + if ( err != cudaSuccess ) { + fprintf(stderr, "%s error: %s\n",name, cudaGetErrorString(err) ); + exit(-1); + } +} + +#define CUDA_CALL( cuda_fn ) stk_cuda_call( cuda_fn , #cuda_fn ) + + +#endif + diff --git a/tests/apps/miniFE/tests/basic/optional/cuda/CudaMemoryModel.hpp b/tests/apps/miniFE/tests/basic/optional/cuda/CudaMemoryModel.hpp new file mode 100644 index 0000000000..54d189ec22 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/optional/cuda/CudaMemoryModel.hpp @@ -0,0 +1,152 @@ +#ifndef _CudaMemoryModel_hpp_ +#define _CudaMemoryModel_hpp_ + +#include +#ifdef MINIFE_HAVE_CUDA + +#include +#include +#include + +#include +#include +#include + +class CudaMemoryModel { + public: + CudaMemoryModel() + : host_to_device_map(), + device_to_host_map() + {} + + /** Destructor + * Upon destruction this class de-allocates all device-buffers that + * it was tracking. + */ + virtual ~CudaMemoryModel(); + + /** Return a device-pointer corresponding to the given host-ptr and size. + * The returned device-pointer points to a buffer which has been allocated + * on the CUDA device with length buf_size*sizeof(T), but not initialized. + * + * If a device-pointer has already been allocated for the given host-pointer + * (by a previous call to this method) then that (previously-allocated) device-pointer + * is returned. + */ + template + T* get_buffer(const T* host_ptr, size_t buf_size); + + /** Destroy (free) the specified device-pointer. + * + * De-allocates the cuda-device buffer. + */ + template + void destroy_buffer(T*& device_ptr); + + /** Copy the contents of the given host-ptr to the given device-ptr. + * If the given device-ptr is not known (was not created by a previous + * call to get_buffer), an exception is thrown. + */ + template + void copy_to_buffer(const T* host_ptr, size_t buf_size, T* device_ptr); + + /** Copy the contents of the given device-ptr to the given host-ptr. + * If the given device-ptr is not known (was not created by a previous + * call to get_buffer), an exception is thrown. + */ + template + void copy_from_buffer(T* host_ptr, size_t buf_size, const T* device_ptr); + + private: + std::map host_to_device_map; + std::map device_to_host_map; +}; + +//------------------------------------------------------------------------------ +template +inline +T* CudaMemoryModel::get_buffer(const T* host_ptr, size_t buf_size) +{ + T* device_ptr = NULL; + + std::map::iterator iter = host_to_device_map.find(host_ptr); + + if (iter == host_to_device_map.end()) { + CUDA_CALL( cudaMalloc( (void**)&device_ptr, sizeof(T)*buf_size) ); + + host_to_device_map.insert( std::make_pair(host_ptr, device_ptr) ); + device_to_host_map.insert( std::make_pair(device_ptr, host_ptr) ); + } + else { + device_ptr = reinterpret_cast(iter->second); + } + + return device_ptr; +} + +//------------------------------------------------------------------------------ +template +inline +void CudaMemoryModel::destroy_buffer(T*& device_ptr) +{ + std::map::iterator iter = device_to_host_map.find(device_ptr); + if (iter != device_to_host_map.end()) { + const void* host_ptr = iter->second; + if (host_ptr != NULL) { + std::map::iterator iter2 = host_to_device_map.find(host_ptr); + if (iter2 != host_to_device_map.end()) { + host_to_device_map.erase(iter2); + } + } + CUDA_CALL( cudaFree(device_ptr) ); + device_ptr = NULL; + device_to_host_map.erase(iter); + } +} + +//------------------------------------------------------------------------------ +template +inline +void CudaMemoryModel::copy_to_buffer(const T* host_ptr, size_t buf_size, T* device_ptr) +{ + std::map::iterator iter = device_to_host_map.find(device_ptr); + if (iter == device_to_host_map.end()) { + //failed to find device_ptr in device_to_host_map + throw std::runtime_error("CudaMemoryModel::copy_to_buffer ERROR, device_ptr not known."); + } + + CUDA_CALL( cudaMemcpy( device_ptr, host_ptr, sizeof(T)*buf_size, cudaMemcpyHostToDevice) ); +} + +//------------------------------------------------------------------------------ +template +inline +void CudaMemoryModel::copy_from_buffer(T* host_ptr, size_t buf_size, const T* device_ptr) +{ + std::map::iterator iter = device_to_host_map.find(device_ptr); + if (iter == device_to_host_map.end()) { + //failed to find device_ptr in device_to_host_map + throw std::runtime_error("CudaMemoryModel::copy_from_buffer ERROR, device_ptr not known."); + } + + CUDA_CALL( cudaMemcpy( host_ptr, device_ptr, sizeof(T)*buf_size, cudaMemcpyDeviceToHost) ); +} + +inline +CudaMemoryModel::~CudaMemoryModel() +{ + std::map::iterator + iter = device_to_host_map.begin(), + iter_end = device_to_host_map.end(); + + for(; iter!=iter_end; ++iter) { + //cast away const so we can free the pointer: + void* dev_ptr = const_cast(iter->first); + CUDA_CALL( cudaFree(dev_ptr) ); + } +} + +#endif + +#endif + diff --git a/tests/apps/miniFE/tests/basic/optional/cuda/CudaNode.cpp b/tests/apps/miniFE/tests/basic/optional/cuda/CudaNode.cpp new file mode 100644 index 0000000000..5ddc580ca3 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/optional/cuda/CudaNode.cpp @@ -0,0 +1,96 @@ +#include +#include +#include +#include + +// some CUDA rules of thumb employed here (stolen from slides by Mike Bailey, Oregon State) +// -The number of Blocks should be at least twice the number of MPs +// -The number of Threads per Block should be a multiple of 64 +// - 192 or 256 are good numbers for Threads/Block +// We will enforce that numThreads is a power of two (to ease the reduction kernel) +// greater than 64 + +CUDANode::CUDANode(int device, int numBlocks, int numThreads, int verbose) +: numBlocks_(numBlocks) +, numThreads_(numThreads) +, h_blk_mem_(NULL) +, d_blk_mem_(NULL) +, blk_mem_size_(0) +{ + using std::cout; + using std::endl; + using std::runtime_error; + // enforce that numThreads_ is a multiple of 64 + if (numThreads_ != 64 && numThreads_ != 128 && numThreads_ != 256 && numThreads_ != 512 + && numThreads_ != 1 && numThreads_ != 2 && numThreads_ != 4 && numThreads_ != 8 && numThreads_ != 16 + && numThreads_ != 32) { +// throw runtime_error("CUDANode::CUDANode(): number of threads per block must be a power of two in [1,512]."); + } + int deviceCount; cudaGetDeviceCount(&deviceCount); + if (device >= deviceCount) { + if (deviceCount == 0) { +// throw runtime_error("CUDANode::CUDANode(): system has no CUDA devices."); + } + if (verbose) { + cout << "CUDANode::CUDANode(): specified device number not valid. Using device 0." << endl; + } + device = 0; + } + cudaDeviceProp deviceProp; + int deviceAlreadyBeingUsed = -1; + cudaGetDevice(&deviceAlreadyBeingUsed); + if (deviceAlreadyBeingUsed >= 0 && deviceAlreadyBeingUsed < deviceCount) { + device = deviceAlreadyBeingUsed; + } + else { + cudaSetDevice(device); + } + cudaGetDeviceProperties(&deviceProp, device); + // as of CUDA 2.1, device prop contains the following fields + // char name[256]; + // size_t totalGlobalMem, sharedMemPerBlock; + // int regsPerBlock, warpSize; + // size_t memPitch; + // int maxThreadsPerBlock, maxThreadsDim[3], maxGridSize[3]; + // size_t totalConstMem; + // int major, minor; + // int clockRate; + // size_t textureAlignment; + // int deviceOverlap; + // int multiProcessorCount; + // int kernelExecTimeoutEnabled; + if (verbose) { + cout << "CUDANode attached to device #" << device << " \"" << deviceProp.name + << "\", of compute capability " << deviceProp.major << "." << deviceProp.minor + << endl; + } + totalMem_ = deviceProp.totalGlobalMem; + + expand_blk_mem(numBlocks_*8); +} + +void CUDANode::expand_blk_mem(size_t size_in_bytes) +{ + if (blk_mem_size_ >= size_in_bytes) return; + + if (d_blk_mem_ != NULL) { + cutilSafeCallNoSync( cudaFree(d_blk_mem_) ); + delete [] h_blk_mem_; + } + + cutilSafeCallNoSync( cudaMalloc(&d_blk_mem_, size_in_bytes) ); + h_blk_mem_ = new char[size_in_bytes]; + blk_mem_size_ = size_in_bytes; +} + +CUDANode::~CUDANode() +{ + if (d_blk_mem_ != NULL) { + cutilSafeCallNoSync( cudaFree(d_blk_mem_) ); + d_blk_mem_ = NULL; + delete [] h_blk_mem_; + h_blk_mem_ = NULL; + } + blk_mem_size_ = 0; +} + diff --git a/tests/apps/miniFE/tests/basic/optional/cuda/CudaNode.cuh b/tests/apps/miniFE/tests/basic/optional/cuda/CudaNode.cuh new file mode 100644 index 0000000000..9b1b4fbf97 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/optional/cuda/CudaNode.cuh @@ -0,0 +1,66 @@ +#ifndef CUDANODE_CUH_ +#define CUDANODE_CUH_ + +#include +#include +#include +#include +#include + +// must define this before including any kernels +#define KERNEL_PREFIX __device__ __host__ + +#include + +#include + +#ifdef CUDANODE_INCLUDE_PARALLEL_FOR +template +__global__ void +Tkern1D(int length, WDP wd, int stride) +{ + unsigned int i = blockIdx.x*blockDim.x + threadIdx.x; + while(i < length) { + wd(i); + i += stride; + } +} + +template +void CUDANode::parallel_for(int length, WDP wd) { + if (length == 0) return; + unsigned int stride = numThreads_ * numBlocks_; + Tkern1D <<< numBlocks_, numThreads_ >>>(length,wd,stride); +} +#endif // parallel_for + +#ifdef CUDANODE_INCLUDE_PARALLEL_REDUCE +template +void call_dot(DotOp& wd) +{ + printf("ERROR, unknown scalar-type, skipping cuda dot-product.\n"); +} +template<> +void call_dot(DotOp& wd) +{ + wd.result = cublasDdot(wd.n, wd.x, 1, wd.y, 1); +} +template<> +void call_dot(DotOp& wd) +{ + wd.result = cublasSdot(wd.n, wd.x, 1, wd.y, 1); +} + +template +void CUDANode::parallel_reduce(int length, WDP& wd) +{ + if (length == 1) { + wd.result = wd.generate(0); + return; + } + + call_dot(wd); +} +#endif // parallel_reduce + +#endif diff --git a/tests/apps/miniFE/tests/basic/optional/cuda/CudaNode.hpp b/tests/apps/miniFE/tests/basic/optional/cuda/CudaNode.hpp new file mode 100644 index 0000000000..de078ea6a1 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/optional/cuda/CudaNode.hpp @@ -0,0 +1,57 @@ +#ifndef CUDANODE_HPP_ +#define CUDANODE_HPP_ + +#include + +// forward declaration +class CUDANode; + +class CUDANode : public CudaMemoryModel { + public: + + CUDANode(int device = 0, int numBlocks = -1, int numThreads = 256, int verbose = 1); + + ~CUDANode(); + + //@{ Computational methods + + template + void parallel_for(int length, WDP wdp); + + template + void parallel_reduce(int length, WDP& wd); + + //@} + + static CUDANode& singleton(int device=0, int numBlocks=-1, int numThreads=256) + { + static CUDANode* cuda_node = NULL; + if (cuda_node == NULL) { + cuda_node = new CUDANode(device, numBlocks, numThreads); + } + return *cuda_node; + } + + private: + //template + //void call_reduce(int length, WDP wd, int threads, int blocks, void * d_blkpart); + // numBlocks_ is + // - the number of blocks launched in a call to parallel_for() + // - not used by parallel_reduce() + int numBlocks_; + // numThreads_ is required to be a power-of-two (our requirement) between 1 and 512 (CUDA's requirement). It is: + // - the maximum number of threads used by parallel_reduce() + // - the number of threads per block in a call to parallel_for() + int numThreads_; + // total global device memory, in bytes + int totalMem_; + + void expand_blk_mem(size_t size_in_bytes); + + char* h_blk_mem_; + void* d_blk_mem_; + size_t blk_mem_size_; + +}; + +#endif diff --git a/tests/apps/miniFE/tests/basic/optional/cuda/CudaNodeImpl.hpp b/tests/apps/miniFE/tests/basic/optional/cuda/CudaNodeImpl.hpp new file mode 100644 index 0000000000..4b94562d29 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/optional/cuda/CudaNodeImpl.hpp @@ -0,0 +1,15 @@ +#ifndef CUDANODE_IMPL_HPP_ +#define CUDANODE_IMPL_HPP_ + +#include +#include +#include +#include +#include +#include + +// TODO: consider using cudaMallocHost to allocate page-locked host memory +// this speeds up transfer between device and host, and could be very +// useful in the case of Import/Export multivector operations + +#endif diff --git a/tests/apps/miniFE/tests/basic/optional/cuda/Matrix.cu b/tests/apps/miniFE/tests/basic/optional/cuda/Matrix.cu new file mode 100644 index 0000000000..1487f1a458 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/optional/cuda/Matrix.cu @@ -0,0 +1,22 @@ +#define CUDANODE_INCLUDE_PARALLEL_FOR + +// include for CudaNode method implementations +#include + +// includes for all operators for which Matrix needs support +#include +#include +#include + +#include +#include + +// explicit instantiations for Matrix class +#define EXPLICIT_MATRIX_SUPPORT(MATRIX,VECTOR) \ +template void CUDANode::parallel_for >(int , MatvecOp< MATRIX, VECTOR >); + +typedef miniFE::SparseMatrix Matrix_type; +typedef miniFE::Vector Vector_type; + +EXPLICIT_MATRIX_SUPPORT(Matrix_type,Vector_type) + diff --git a/tests/apps/miniFE/tests/basic/optional/cuda/Vector.cu b/tests/apps/miniFE/tests/basic/optional/cuda/Vector.cu new file mode 100644 index 0000000000..9a799559f7 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/optional/cuda/Vector.cu @@ -0,0 +1,19 @@ +#define CUDANODE_INCLUDE_PARALLEL_REDUCE +#define CUDANODE_INCLUDE_PARALLEL_FOR + +// include for CudaNode method implementations +#include + +// includes for all operators for which Vector needs support +#include +#include +#include +#include + +// explicit instantiations for Vectors +#define EXPLICIT_VECTOR_SUPPORT(GLOBALORDINAL, SCALAR) \ +template void CUDANode::parallel_for >(int , WaxpbyOp< SCALAR >); \ +template void CUDANode::parallel_reduce< DotOp< SCALAR > >(int , DotOp< SCALAR >& ); \ +template void CUDANode::parallel_for >(int , FEComputeElem< GLOBALORDINAL, SCALAR > ); + +EXPLICIT_VECTOR_SUPPORT(MINIFE_GLOBAL_ORDINAL, MINIFE_SCALAR) diff --git a/tests/apps/miniFE/tests/basic/optional/cuda/cutil_inline_runtime.h b/tests/apps/miniFE/tests/basic/optional/cuda/cutil_inline_runtime.h new file mode 100644 index 0000000000..1f49afbb24 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/optional/cuda/cutil_inline_runtime.h @@ -0,0 +1,63 @@ +#ifndef _CUTIL_INLINE_FUNCTIONS_RUNTIME_H_ +#define _CUTIL_INLINE_FUNCTIONS_RUNTIME_H_ + +#include +#include +#include + +#include + +// We define these calls here, so the user doesn't need to include __FILE__ and __LINE__ +// The advantage is the developers gets to use the inline function so they can debug +#define cutilSafeCallNoSync(err) __cudaSafeCallNoSync(err, __FILE__, __LINE__) +#define cutilSafeCall(err) __cudaSafeCall (err, __FILE__, __LINE__) +#define cutilSafeThreadSync() __cudaSafeThreadSync(__FILE__, __LINE__) +#define cutilCheckMsg(msg) __cutilCheckMsg (msg, __FILE__, __LINE__) + +inline void __cudaSafeCallNoSync( cudaError err, const char *file, const int line ) +{ + if( cudaSuccess != err) { + fprintf(stderr, "cudaSafeCallNoSync() Runtime API error in file <%s>, line %i : %s.\n", + file, line, cudaGetErrorString( err) ); + exit(-1); + } +} + +inline void __cudaSafeCall( cudaError err, const char *file, const int line ) +{ + if( cudaSuccess != err) { + fprintf(stderr, "cudaSafeCall() Runtime API error in file <%s>, line %i : %s.\n", + file, line, cudaGetErrorString( err) ); + exit(-1); + } +} + +inline void __cudaSafeThreadSync( const char *file, const int line ) +{ + cudaError err = cudaThreadSynchronize(); + if ( cudaSuccess != err) { + fprintf(stderr, "cudaThreadSynchronize() Driver API error in file '%s' in line %i : %s.\n", + file, line, cudaGetErrorString( err) ); + exit(-1); + } +} + +inline void __cutilCheckMsg( const char *errorMessage, const char *file, const int line ) +{ + cudaError_t err = cudaGetLastError(); + if( cudaSuccess != err) { + fprintf(stderr, "cutilCheckMsg() CUTIL CUDA error: %s in file <%s>, line %i : %s.\n", + errorMessage, file, line, cudaGetErrorString( err) ); + exit(-1); + } +#ifdef _DEBUG + err = cudaThreadSynchronize(); + if( cudaSuccess != err) { + fprintf(stderr, "cutilCheckMsg cudaThreadSynchronize error: %s in file <%s>, line %i : %s.\n", + errorMessage, file, line, cudaGetErrorString( err) ); + exit(-1); + } +#endif +} + +#endif // _CUTIL_INLINE_FUNCTIONS_RUNTIME_H_ diff --git a/tests/apps/miniFE/tests/basic/optional/make_targets b/tests/apps/miniFE/tests/basic/optional/make_targets new file mode 100644 index 0000000000..01ed2c89cc --- /dev/null +++ b/tests/apps/miniFE/tests/basic/optional/make_targets @@ -0,0 +1,54 @@ +#----------------------------------------------------------------------- + +TPI.o : ./optional/ThreadPool/src/TPI.c + $(CC) $(CFLAGS) $(CPPFLAGS) -c $< + +#----------------------------------------------------------------------- + +CudaNode.o : ./optional/cuda/CudaNode.cpp ./optional/cuda/*.hpp ./optional/cuda/*.h + $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $< + +CudaVector.o : ./optional/cuda/Vector.cu ./optional/cuda/*.cuh + nvcc $(CUDAFLAGS) $(CPPFLAGS) -c -o $@ $< + +CudaMatrix.o : ./optional/cuda/Matrix.cu ./optional/cuda/*.cuh + nvcc $(CUDAFLAGS) $(CPPFLAGS) -c -o $@ $< + +#----------------------------------------------------------------------- +# Recursive make to create the object files in this directory, +# generate the archive, and then remove the object files. + +libstk.a : + cd ./optional ; \ + $(MAKE) "CC=$(CC)" "CXX=$(CXX)" "CPPFLAGS=$(CPPFLAGS)" "CFLAGS=$(CFLAGS)" "CXXFLAGS=$(CXXFLAGS)" -f make_targets stk_library + +STK_SOURCE = \ + ./shards/src/*.cpp \ + ./stk_util/util/*.cpp \ + ./stk_util/environment/*.cpp \ + ./stk_util/parallel/*.cpp \ + ./stk_mesh/base/*.cpp \ + ./stk_mesh/baseImpl/*.cpp \ + ./stk_mesh/fem/*.cpp \ + stk_helpers.cpp + +STK_INCLUDES = \ + ./shards/src/*.hpp \ + ./shards/src/*.h \ + ./stk_util/util/*.hpp \ + ./stk_util/environment/*.hpp \ + ./stk_util/parallel/*.hpp \ + ./stk_mesh/base/*.hpp \ + ./stk_mesh/fem/*.hpp + +STK_INC = -I${PWD}/ThreadPool -I${PWD}/shards + +stk_library : $(STK_SOURCE) $(STK_INCLUDES) + $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(STK_INC) -c $(STK_SOURCE) + ar -qc ../libstk.a *.o + ranlib ../libstk.a + rm *.o + +#----------------------------------------------------------------------- + + diff --git a/tests/apps/miniFE/tests/basic/perform_element_loop.hpp b/tests/apps/miniFE/tests/basic/perform_element_loop.hpp new file mode 100644 index 0000000000..f65ad4fbf8 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/perform_element_loop.hpp @@ -0,0 +1,110 @@ +#ifndef _perform_element_loop_hpp_ +#define _perform_element_loop_hpp_ + +//@HEADER +// ************************************************************************ +// +// miniFE: simple finite-element assembly and linear-solve +// Copyright (2006) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA +// Questions? Contact Michael A. Heroux (maherou@sandia.gov) +// +// ************************************************************************ +//@HEADER + +#include +#include +#include +#include +#include +#include + +namespace miniFE { + +template +void +perform_element_loop(const simple_mesh_description& mesh, + const Box& local_elem_box, + MatrixType& A, VectorType& b, + Parameters& /*params*/) +{ + typedef typename MatrixType::ScalarType Scalar; + + int global_elems_x = mesh.global_box[0][1]; + int global_elems_y = mesh.global_box[1][1]; + int global_elems_z = mesh.global_box[2][1]; + + //We will iterate the local-element-box (local portion of the mesh), and + //get element-IDs in preparation for later assembling the FE operators + //into the global sparse linear-system. + + GlobalOrdinal num_elems = get_num_ids(local_elem_box); + std::vector elemIDs(num_elems); + + BoxIterator iter = BoxIterator::begin(local_elem_box); + BoxIterator end = BoxIterator::end(local_elem_box); + + for(size_t i=0; iter != end; ++iter, ++i) { + elemIDs[i] = get_id(global_elems_x, global_elems_y, global_elems_z, + iter.x, iter.y, iter.z); +//#ifdef MINIFE_DEBUG +//std::cout << "elem ID " << elemIDs[i] << " ("< elem_data; + + compute_gradient_values(elem_data.grad_vals); + + timer_type t_gn = 0, t_ce = 0, t_si = 0; + timer_type t0 = 0; + for(size_t i=0; i +#include +#include +#include +#include +#include +#include + +#include + +namespace miniFE { + +//--------------------------------------------------------------------- +//This file contains three 'filter' classes, and a 'perform_element_loop' +//function that uses those filter classes to run a TBB pipeline. +// +//The filter classes are as follows: +//1. GetElemNodesCoords +// For each element in the mesh, create an elem-data object with coords +// and node-ids. +//2. Compute_FE_Operators +// Given an elem-data object (with coords and node-ids), compute the +// diffusion-matrix and source-vector. +//3. LockingSumIntoLinearSystem +// Given an elem-data object (with diffusion-matrix and source-vector), +// assemble into global-sparse linear-system. Uses a lock on each +// matrix row to ensure that multiple threads don't update the same row +// at the same time. +//... or: +//3. SumIntoLinearSystem +// Given an elem-data object (with diffusion-matrix and source-vector), +// assemble into global-sparse linear-system. +// There are several of these filters, usually 1 per thread, and each +// will be responsible for a certain slice of equations. It will check +// the elem-data for equations that are in its slice, assemble those, and +// pass the elem-data on so that the next SumIntoLinearSystem filter can +// deal with equations in a different 'slice'. +// +//--------------------------------------------------------------------- + +//--------------------------------------------------------------------- + +/** Filter 1.: GetElemNodesCoords + */ +template +class GetElemNodesCoords : public tbb::filter { +public: + GetElemNodesCoords(const std::vector& elemIDs, + const simple_mesh_description& mesh, + size_t num_elems_at_a_time) + : tbb::filter(/*is_serial=*/true), + elemIDs_(elemIDs), + i_(0), + mesh_(mesh), + num_elems_(num_elems_at_a_time) + { + if (num_elems_ < 1) num_elems_ = 1; + } + + ~GetElemNodesCoords(){} + +private: + /** This operator launches an elem-data object for a 'group' (size num_elems_) + * of elements. When all elements have been launched, return NULL to signal + * that we're done issuing data. + */ + void* operator()(void* item) { + if (i_ >= elemIDs_.size()) return NULL; + + size_t num = num_elems_; + if (i_+num > elemIDs_.size()) num = elemIDs_.size() - i_; + + std::vector >* elemdata_vec = new std::vector >(num); + + size_t i=0; + while (i_ < elemIDs_.size() && i < num) { + get_elem_nodes_and_coords(mesh_, elemIDs_[i_], (*elemdata_vec)[i]); + ++i_; + ++i; + } + + return elemdata_vec; + } + + const std::vector& elemIDs_; + size_t i_; + const simple_mesh_description& mesh_; + size_t num_elems_; +}; + +//--------------------------------------------------------------------- + +/** Filter 2.: Compute_FE_Operators + */ +template +class Compute_FE_Operators : public tbb::filter { +public: + Compute_FE_Operators() : tbb::filter(/*is_serial=*/false) {} + ~Compute_FE_Operators() {} + +private: + /** This operator takes a vector of elem-data objects which are assumed + * to have nodal-coordinates already populated, and computes the + * element-diffusion-matrix and element-source-vector for each. + */ + void* operator()(void* item) { + if (item == NULL) return NULL; + std::vector >* elemdata = static_cast >*>(item); + + for(size_t i=0; isize(); ++i) { + compute_element_matrix_and_vector((*elemdata)[i]); + } + return elemdata; + } +}; + +//--------------------------------------------------------------------- + +/** Filter 3.: SumIntoLinearSystem + */ +template +class SumIntoLinearSystem : public tbb::filter { + typedef typename MatrixType::GlobalOrdinalType GlobalOrdinal; + typedef typename MatrixType::ScalarType Scalar; + +public: + SumIntoLinearSystem(GlobalOrdinal myFirstRow, + GlobalOrdinal myLastRow, + MatrixType& mat, VectorType& vec) + : tbb::filter(/*is_serial=*/true), + A_(mat), b_(vec), + myFirstRow_(myFirstRow), + myLastRow_(myLastRow) + { + } + + ~SumIntoLinearSystem() {} + +private: + /** This operator takes a vector of elem-data objects which have an + * element-diffusion-matrix and source-vector, looks through it for + * any rows in this filter's slice of the global matrix, assembles + * those rows into the linear-system, then passes the elem-data object + * on for use by the next assembly filter. + * If this assembly filter is responsible for the last slice of the + * row-space, then this is the last filter and so we delete the + * elem-data object. + */ + void* operator()(void* item) { + if (item == NULL) return NULL; + std::vector >* elemdata_vec = static_cast >*>(item); + + for(size_t e=0; esize(); ++e) { + ElemData& elemdata = (*elemdata_vec)[e]; + size_t nnodes = elemdata.nodes_per_elem; + for(size_t i=0; i myLastRow_) continue; + + sum_into_row(row, nnodes, elemdata.elem_node_ids, + &(elemdata.elem_diffusion_matrix[i*nnodes]), A_); + sum_into_vector(1, &row, &(elemdata.elem_source_vector[i]), b_); + } + } + + if (myLastRow_ >= A_.rows.size()) { + delete elemdata_vec; + return NULL; + } + + return elemdata_vec; + } + + MatrixType& A_; + VectorType& b_; + GlobalOrdinal myFirstRow_; + GlobalOrdinal myLastRow_; +}; + +//--------------------------------------------------------------------- + +static tbb::atomic matrix_suminto; + +/** Filter 3.: SumIntoLinearSystem with locking + */ +template +class LockingSumIntoLinearSystem : public tbb::filter { + typedef typename MatrixType::GlobalOrdinalType GlobalOrdinal; + typedef typename MatrixType::ScalarType Scalar; + +public: + LockingSumIntoLinearSystem(MatrixType& mat, VectorType& vec) + : tbb::filter(/*is_serial=*/false), + A_(mat), b_(vec) + { + } + + ~LockingSumIntoLinearSystem() {} + +private: + /** This operator takes a vector of elem-data objects which have an + * element-diffusion-matrix and source-vector, and assembles into + * the linear-system, using locking to make sure no other + * thread is assembling the same global row at the same time. + */ + void* operator()(void* item) { + if (item == NULL) return NULL; + std::vector >* elemdata_vec = static_cast >*>(item); + + for(size_t e=0; esize(); ++e) { + ElemData& elemdata = (*elemdata_vec)[e]; + size_t nnodes = elemdata.nodes_per_elem; + size_t offset = 0; + for(size_t i=0; i A_; + LockingVector b_; +}; + +//--------------------------------------------------------------------- + +template +void +perform_element_loop(const simple_mesh_description& mesh, + const Box& local_elem_box, + MatrixType& A, VectorType& b, + Parameters& params) +{ + typedef typename MatrixType::ScalarType Scalar; + + if (A.rows.size() == 0) return; + + int num_threads = params.numthreads; + + //We will iterate the local-element-box (local portion of the mesh), and + //assemble the FE operators into the global sparse linear-system. + + tbb::pipeline pipe; + + int global_elems_x = mesh.global_box[0][1]; + int global_elems_y = mesh.global_box[1][1]; + int global_elems_z = mesh.global_box[2][1]; + + GlobalOrdinal num_elems = get_num_ids(local_elem_box); + std::vector elemIDs(num_elems); + + BoxIterator iter = BoxIterator::begin(local_elem_box); + BoxIterator end = BoxIterator::end(local_elem_box); + + for(size_t i=0; iter != end; ++iter, ++i) { + elemIDs[i] = get_id(global_elems_x, global_elems_y, global_elems_z, + iter.x, iter.y, -iter.z); + } + + //Create the first stage of the pipeline, the filter that will + //launch elem-data from the mesh, through the pipeline. + GetElemNodesCoords get_nodes_coords(elemIDs, mesh, params.elem_group_size); + + //Create the second stage of the pipeline, the parallel filter that will + //compute element-matrices and element-vectors. + Compute_FE_Operators fe_ops; + + //Add the filters to the pipeline: + pipe.add_filter(get_nodes_coords); + pipe.add_filter(fe_ops); + + LockingSumIntoLinearSystem* sum_into_linsys = NULL; + size_t num_assembly_filters = 0; + std::vector*> linsys; + + bool use_locking = params.use_locking==1; + if (use_locking) { + sum_into_linsys = new LockingSumIntoLinearSystem(A, b); + pipe.add_filter(*sum_into_linsys); + } + else { + //If not using locking, create several assembly filters, each of which + //will be responsible for assembling rows into a certain slice of the + //global matrix. + + num_assembly_filters = num_threads/3; + if (num_assembly_filters == 0) num_assembly_filters = 1; + num_assembly_filters = 2; + + size_t num_rows = A.rows.size(); + size_t rows_per_thread = num_rows/num_assembly_filters; + if (num_rows % num_assembly_filters > 0) ++rows_per_thread; + size_t first_row = A.rows[0]; + for(int i=0; i * sum_into = new SumIntoLinearSystem(first_row, last_row, A, b); + linsys.push_back(sum_into); + pipe.add_filter(*sum_into); + + first_row += rows_per_thread; + } + } + + //Running the pipeline carries out the element-loop and assembly. + pipe.run(num_threads); + + pipe.clear(); + + if (use_locking) { + std::cout << "\n{number of matrix conflicts: " << miniFE_num_matrix_conflicts << "}"< +#include +#include +#include +#include +#include +#include +#include + +namespace miniFE { + +//--------------------------------------------------------------------- + +template +struct FEAssembleSumInto { + const simple_mesh_description* mesh; + GlobalOrdinal* elemIDs; + LockingMatrix* A; + LockingVector* b; + +inline void operator()(int i) +{ + ElemData elem_data; + GlobalOrdinal elemID = elemIDs[i]; + get_elem_nodes_and_coords(*mesh, elemID, elem_data.elem_node_ids, + elem_data.elem_node_coords); + compute_element_matrix_and_vector(elem_data); + sum_into_global_linear_system(elem_data, *A, *b); +} +}; + +template +void +perform_element_loop(const simple_mesh_description& mesh, + const Box& local_elem_box, + MatrixType& A, VectorType& b, + Parameters& params) +{ + typedef typename MatrixType::ScalarType Scalar; + + if (A.rows.size() == 0) return; + + int num_threads = params.numthreads; + + timer_type t0 = mytimer(); + + //We will iterate the local-element-box (local portion of the mesh), and + //assemble the FE operators into the global sparse linear-system. + + int global_elems_x = mesh.global_box[0][1]; + int global_elems_y = mesh.global_box[1][1]; + int global_elems_z = mesh.global_box[2][1]; + + GlobalOrdinal num_elems = get_num_ids(local_elem_box); + std::vector elemIDs(num_elems); + + BoxIterator iter = BoxIterator::begin(local_elem_box); + BoxIterator end = BoxIterator::end(local_elem_box); + + for(size_t i=0; iter != end; ++iter, ++i) { + elemIDs[i] = get_id(global_elems_x, global_elems_y, global_elems_z, + iter.x, iter.y, iter.z); + } + + LockingMatrix lockingA(A); + LockingVector lockingb(b); + + FEAssembleSumInto fe_op; + fe_op.mesh = &mesh; + fe_op.elemIDs = &elemIDs[0]; + fe_op.A = &lockingA; + fe_op.b = &lockingb; + + typedef typename VectorType::ComputeNodeType ComputeNodeType; + + ComputeNodeType& compute_node = b.compute_node; + + compute_node.parallel_for(elemIDs.size(), fe_op); + + std::cout << "\n{number of matrix conflicts: " << miniFE_num_matrix_conflicts << "}"< +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace miniFE { + +//--------------------------------------------------------------------- + +template +void +perform_element_loop(const simple_mesh_description& mesh, + const Box& local_elem_box, + MatrixType& A, VectorType& b, + Parameters& params) +{ + typedef typename MatrixType::ScalarType Scalar; + + if (A.rows.size() == 0) return; + + int num_threads = params.numthreads; + + timer_type t0 = mytimer(); + + //We will iterate the local-element-box (local portion of the mesh), and + //assemble the FE operators into the global sparse linear-system. + + int global_elems_x = mesh.global_box[0][1]; + int global_elems_y = mesh.global_box[1][1]; + int global_elems_z = mesh.global_box[2][1]; + + GlobalOrdinal num_elems = get_num_ids(local_elem_box); + std::vector elemIDs(num_elems); + + BoxIterator iter = BoxIterator::begin(local_elem_box); + BoxIterator end = BoxIterator::end(local_elem_box); + + for(size_t i=0; iter != end; ++iter, ++i) { + elemIDs[i] = get_id(global_elems_x, global_elems_y, global_elems_z, + iter.x, iter.y, iter.z); + } + + std::vector node_ordinals(num_elems*Hex8::numNodesPerElem); + std::vector node_coords(num_elems*Hex8::numNodesPerElem*Hex8::spatialDim); + std::vector elem_matrices(num_elems*Hex8::numNodesPerElem*Hex8::numNodesPerElem); + std::vector elem_vectors(num_elems*Hex8::numNodesPerElem); + + LockingMatrix lockingA(A); + LockingVector lockingb(b); + + GetNodesCoords get_nodes_coords; + get_nodes_coords.elemIDs = &elemIDs[0]; + get_nodes_coords.mesh = &mesh; + get_nodes_coords.node_ordinals = &node_ordinals[0]; + get_nodes_coords.elem_node_coords = &node_coords[0]; + + typedef typename VectorType::ComputeNodeType ComputeNodeType; + + ComputeNodeType& compute_node = b.compute_node; + + compute_node.parallel_for(elemIDs.size(), get_nodes_coords); + + timer_type t_gn = mytimer() - t0; + t0 = mytimer(); + +#ifdef MINIFE_HAVE_CUDA + CUDANode& elem_compute_node = CUDANode::singleton(); +#else + ComputeNodeType& elem_compute_node = compute_node; +#endif + timer_type t_ccn = mytimer() - t0; + t0 = mytimer(); + + Scalar* d_node_coords = elem_compute_node.get_buffer(&node_coords[0], node_coords.size()); + Scalar* d_elem_matrices = elem_compute_node.get_buffer(&elem_matrices[0], elem_matrices.size()); + Scalar* d_elem_vectors = elem_compute_node.get_buffer(&elem_vectors[0], elem_vectors.size()); + + elem_compute_node.copy_to_buffer(&node_coords[0], node_coords.size(), d_node_coords); + + FEComputeElem fe_compute_elem; + fe_compute_elem.elem_node_coords = &d_node_coords[0]; + fe_compute_elem.elem_diffusion_matrix = &d_elem_matrices[0]; + fe_compute_elem.elem_source_vector = &d_elem_vectors[0]; + + elem_compute_node.parallel_for(elemIDs.size(), fe_compute_elem); + + elem_compute_node.copy_from_buffer(&elem_matrices[0], elem_matrices.size(), d_elem_matrices); + elem_compute_node.copy_from_buffer(&elem_vectors[0], elem_vectors.size(), d_elem_vectors); + + timer_type t_ce = mytimer() - t0; + + t0 = mytimer(); + SumInLinSys sum_in; + sum_in.node_ordinals = &node_ordinals[0]; + sum_in.elem_diffusion_matrix = &elem_matrices[0]; + sum_in.elem_source_vector = &elem_vectors[0]; + sum_in.A = &lockingA; + sum_in.b = &lockingb; + + compute_node.parallel_for(elemIDs.size(), sum_in); + + timer_type t_si = mytimer() - t0; + std::cout << "time to get nodes/coords: " << t_gn << std::endl; + std::cout << "time to create compute-node: " << t_ccn << ", time to compute elements: " << t_ce << std::endl; + std::cout << "time to sum into linsys: " << t_si << std::endl; + std::cout << "\n{number of matrix conflicts: " << miniFE_num_matrix_conflicts << "}"< " +exit 1 +fi + +np=$1 +nx=$2 +ny=$3 +nz=$4 + +echo " " +echo "running miniFE test for np=${np}, nx=${nx} ny=${ny} nz=${nz}..." + +if [ ! -x miniFE.x ]; then +echo "miniFE.x doesn't exist or isn't executable. Aborting." +exit -1 +fi + +mpirun -np ${np} miniFE.x nx=${nx} ny=${ny} nz=${nz} >& miniFE_run.out +rm miniFE_run.out + +if [ ! -f A.mtx.${np}.0 ]; then +echo "matrix file A.mtx.${np}.0 doesn't exist. build miniFE with -DMINIFE_DEBUG." +fi + +p=0 +while [ $p -lt ${np} ]; do +diff A.mtx.${np}.$p gold_files/1x1x2_A.mtx.${np}.$p >& diff.A.$p.txt +diff b.vec.${np}.$p gold_files/1x1x2_b.vec.${np}.$p >& diff.b.$p.txt +diff x.vec.${np}.$p gold_files/1x1x2_x.vec.${np}.$p >& diff.x.$p.txt + +test_result="passed" +if [ -s diff.A.$p.txt ]; then +echo "TEST FAILED: see diff.A.${p}.txt" +test_result="failed" +fi + +if [ -s diff.b.$p.txt ]; then +echo "TEST FAILED: see diff.b.${p}.txt" +test_result="failed" +fi + +if [ -s diff.x.$p.txt ]; then +echo "TEST FAILED: see diff.x.${p}.txt" +test_result="failed" +fi + +if [ $test_result != "passed" ]; then +echo "test failed" +exit 1 +fi + +let p=p+1 +rm diff.*.txt +done + +echo "tests passed" + diff --git a/tests/apps/miniFE/tests/basic/run_tests b/tests/apps/miniFE/tests/basic/run_tests new file mode 100755 index 0000000000..5e03399ea5 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/run_tests @@ -0,0 +1,22 @@ +#!/bin/bash + +echo " " +echo "running miniFE tests..." + +if [ ! -x miniFE.x ]; then +echo "miniFE.x doesn't exist or isn't executable. Aborting." +exit -1 +fi + +./run_one_test 1 1 1 2 +if [ $? != 0 ]; then +echo "test failed" +exit $? +fi + +./run_one_test 2 1 1 2 +if [ $? != 0 ]; then +echo "test failed" +exit $? +fi + diff --git a/tests/apps/miniFE/tests/basic/sharedmem.cuh b/tests/apps/miniFE/tests/basic/sharedmem.cuh new file mode 100644 index 0000000000..b13c4f2ba1 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/sharedmem.cuh @@ -0,0 +1,153 @@ +/* +* Copyright 1993-2006 NVIDIA Corporation. All rights reserved. +* +* NOTICE TO USER: +* +* This source code is subject to NVIDIA ownership rights under U.S. and +* international Copyright laws. +* +* NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOURCE +* CODE FOR ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR +* IMPLIED WARRANTY OF ANY KIND. NVIDIA DISCLAIMS ALL WARRANTIES WITH +* REGARD TO THIS SOURCE CODE, INCLUDING ALL IMPLIED WARRANTIES OF +* MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE. +* IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL, +* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS +* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE +* OR PERFORMANCE OF THIS SOURCE CODE. +* +* U.S. Government End Users. This source code is a "commercial item" as +* that term is defined at 48 C.F.R. 2.101 (OCT 1995), consisting of +* "commercial computer software" and "commercial computer software +* documentation" as such terms are used in 48 C.F.R. 12.212 (SEPT 1995) +* and is provided to the U.S. Government only as a commercial end item. +* Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through +* 227.7202-4 (JUNE 1995), all U.S. Government End Users acquire the +* source code with only those rights set forth herein. +*/ + +#ifndef _SHAREDMEM_H_ +#define _SHAREDMEM_H_ + +//**************************************************************************** +// Because dynamically sized shared memory arrays are declared "extern", +// we can't templatize them directly. To get around this, we declare a +// simple wrapper struct that will declare the extern array with a different +// name depending on the type. This avoids compiler errors about duplicate +// definitions. +// +// To use dynamically allocated shared memory in a templatized __global__ or +// __device__ function, just replace code like this: +// +// +// template +// __global__ void +// foo( T* g_idata, T* g_odata) +// { +// // Shared mem size is determined by the host app at run time +// extern __shared__ T sdata[]; +// ... +// doStuff(sdata); +// ... +// } +// +// With this +// template +// __global__ void +// foo( T* g_idata, T* g_odata) +// { +// // Shared mem size is determined by the host app at run time +// SharedMemory smem; +// T* sdata = smem.getPointer(); +// ... +// doStuff(sdata); +// ... +// } +//**************************************************************************** + +// This is the un-specialized struct. Note that we prevent instantiation of this +// struct by putting an undefined symbol in the function body so it won't compile. +template +struct SharedMemory +{ + // Ensure that we won't compile any un-specialized types + __device__ T* getPointer() { + extern __device__ void error(void); + error(); + return NULL; + } +}; + +// Following are the specializations for the following types. +// int, uint, char, uchar, short, ushort, long, ulong, bool, float, and double +// One could also specialize it for user-defined types. + +template <> +struct SharedMemory +{ + __device__ int* getPointer() { extern __shared__ int s_int[]; return s_int; } +}; + +template <> +struct SharedMemory +{ + __device__ unsigned int* getPointer() { extern __shared__ unsigned int s_uint[]; return s_uint; } +}; + +template <> +struct SharedMemory +{ + __device__ char* getPointer() { extern __shared__ char s_char[]; return s_char; } +}; + +template <> +struct SharedMemory +{ + __device__ unsigned char* getPointer() { extern __shared__ unsigned char s_uchar[]; return s_uchar; } +}; + +template <> +struct SharedMemory +{ + __device__ short* getPointer() { extern __shared__ short s_short[]; return s_short; } +}; + +template <> +struct SharedMemory +{ + __device__ unsigned short* getPointer() { extern __shared__ unsigned short s_ushort[]; return s_ushort; } +}; + +template <> +struct SharedMemory +{ + __device__ long* getPointer() { extern __shared__ long s_long[]; return s_long; } +}; + +template <> +struct SharedMemory +{ + __device__ unsigned long* getPointer() { extern __shared__ unsigned long s_ulong[]; return s_ulong; } +}; + +template <> +struct SharedMemory +{ + __device__ bool* getPointer() { extern __shared__ bool s_bool[]; return s_bool; } +}; + +template <> +struct SharedMemory +{ + __device__ float* getPointer() { extern __shared__ float s_float[]; return s_float; } +}; + +template <> +struct SharedMemory +{ + __device__ double* getPointer() { extern __shared__ double s_double[]; return s_double; } +}; + + +#endif //_SHAREDMEM_H_ diff --git a/tests/apps/miniFE/tests/basic/simple_mesh_description.hpp b/tests/apps/miniFE/tests/basic/simple_mesh_description.hpp new file mode 100644 index 0000000000..717dc6c6d2 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/simple_mesh_description.hpp @@ -0,0 +1,239 @@ + +#ifndef _simple_mesh_description_hpp_ +#define _simple_mesh_description_hpp_ + +//@HEADER +// ************************************************************************ +// +// miniFE: simple finite-element assembly and linear-solve +// Copyright (2006) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA +// Questions? Contact Michael A. Heroux (maherou@sandia.gov) +// +// ************************************************************************ +//@HEADER + +#include +#include +#include + +namespace miniFE { + +template +class simple_mesh_description { +public: + simple_mesh_description(const Box& global_box_in, const Box& local_box_in) + { + Box local_node_box; + for(int i=0; i<3; ++i) { + global_box[i][0] = global_box_in[i][0]; + global_box[i][1] = global_box_in[i][1]; + local_box[i][0] = local_box_in[i][0]; + local_box[i][1] = local_box_in[i][1]; + local_node_box[i][0] = local_box_in[i][0]; + local_node_box[i][1] = local_box_in[i][1]; + //num-owned-nodes == num-elems+1 in this dimension if the elem box is not empty + //and we are at the high end of the global range in that dimension: + if (local_box_in[i][1] > local_box_in[i][0] && local_box_in[i][1] == global_box[i][1]) local_node_box[i][1] += 1; + } + + int max_node_x = global_box[0][1]+1; + int max_node_y = global_box[1][1]+1; + int max_node_z = global_box[2][1]+1; + create_map_id_to_row(max_node_x, max_node_y, max_node_z, local_node_box, + map_ids_to_rows); + + //As described in analytic_soln.hpp, + //we will impose a 0 boundary-condition on faces x=0, y=0, z=0, y=1, z=1 + //we will impose a 1 boundary-condition on face x=1 + +#ifdef MINIFE_DEBUG +std::cout< 0) --miny; + if (local_node_box[Z][0] > 0) --minz; + if (local_node_box[Y][1] < max_node_y) ++maxy; + if (local_node_box[Z][1] < max_node_z) ++maxz; + + for(int iz=minz; iz(max_node_x, max_node_y, max_node_z, + 0, iy, iz); +#ifdef MINIFE_DEBUG +std::cout<<"x=0 BC, node "< 0) --minx; + if (local_node_box[Z][0] > 0) --minz; + if (local_node_box[X][1] < max_node_x) ++maxx; + if (local_node_box[Z][1] < max_node_z) ++maxz; + + for(int iz=minz; iz(max_node_x, max_node_y, max_node_z, + ix, 0, iz); +#ifdef MINIFE_DEBUG +std::cout<<"y=0 BC, node "< 0) --minx; + if (local_node_box[Y][0] > 0) --miny; + if (local_node_box[X][1] < max_node_x) ++maxx; + if (local_node_box[Y][1] < max_node_y) ++maxy; + + for(int iy=miny; iy(max_node_x, max_node_y, max_node_z, + ix, iy, 0); +#ifdef MINIFE_DEBUG +std::cout<<"z=0 BC, node "< 0) --minz; + if (local_node_box[Y][0] > 0) --miny; + if (local_node_box[Z][1] < max_node_z) ++maxz; + if (local_node_box[Y][1] < max_node_y) ++maxy; + + for(int iy=miny; iy(max_node_x, max_node_y, max_node_z, + x1, iy, iz); + int row = map_id_to_row(nodeID); +#ifdef MINIFE_DEBUG +std::cout<<"x=1 BC, node "< 0) --minz; + if (local_node_box[X][0] > 0) --minx; + if (local_node_box[Z][1] < max_node_z) ++maxz; + if (local_node_box[X][1] < max_node_x) ++maxx; + + for(int ix=minx; ix(max_node_x, max_node_y, max_node_z, + ix, y1, iz); +#ifdef MINIFE_DEBUG +std::cout<<"y=1 BC, node "< 0) --miny; + if (local_node_box[X][0] > 0) --minx; + if (local_node_box[Y][1] < max_node_y) ++maxy; + if (local_node_box[X][1] < max_node_x) ++maxx; + + for(int ix=minx; ix(max_node_x, max_node_y, max_node_z, + ix, iy, z1); +#ifdef MINIFE_DEBUG +std::cout<<"z=1 BC, node "< bc_rows_0; + std::set bc_rows_1; + std::map map_ids_to_rows; + Box global_box; + Box local_box; +};//class simple_mesh_description + +}//namespace miniFE + +#endif diff --git a/tests/apps/miniFE/tests/basic/time_kernels.hpp b/tests/apps/miniFE/tests/basic/time_kernels.hpp new file mode 100644 index 0000000000..b14f743eca --- /dev/null +++ b/tests/apps/miniFE/tests/basic/time_kernels.hpp @@ -0,0 +1,140 @@ +#ifndef _time_kernels_hpp_ +#define _time_kernels_hpp_ + +//@HEADER +// ************************************************************************ +// +// miniFE: simple finite-element assembly and linear-solve +// Copyright (2006) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA +// Questions? Contact Michael A. Heroux (maherou@sandia.gov) +// +// ************************************************************************ +//@HEADER + +#include + +#include +#include + +#ifdef MINIFE_HAVE_CUDA +#include +#endif + +namespace miniFE { + +template +void +time_kernels(OperatorType& A, + const VectorType& b, + VectorType& x, + Matvec matvec, + typename OperatorType::LocalOrdinalType max_iter, + typename OperatorType::ScalarType& xdotp, + timer_type* my_kern_times) +{ + typedef typename OperatorType::ScalarType ScalarType; + typedef typename OperatorType::LocalOrdinalType OrdinalType; + typedef typename TypeTraits::magnitude_type magnitude_type; + + timer_type t0 = 0, tWAXPY = 0, tDOT = 0, tMATVEC = 0; + + int myproc = 0; +#ifdef HAVE_MPI + MPI_Comm_rank(MPI_COMM_WORLD, &myproc); +#endif + + if (!A.has_local_indices) { + std::cerr << "miniFE::time_kernels ERROR, A.has_local_indices is false, needs to be true. This probably means " + << "miniFE::make_local_matrix(A) was not called prior to calling miniFE::time_kernels." + << std::endl; + return; + } + + OrdinalType nrows = A.rows.size(); + OrdinalType ncols = A.num_cols; + + VectorType p(0, ncols, b.compute_node); + + ScalarType one = 1.0; + ScalarType zero = 0.0; + + typedef typename VectorType::ComputeNodeType ComputeNodeType; + ComputeNodeType& compute_node = x.compute_node; + + //The following lines that create and initialize buffers are no-ops in many + //cases, but perform actual allocations and copies if a off-cpu device such as + //a GPU is being used by compute_node. + + //Do any required allocations for buffers that will be needed during CG: + ScalarType* d_x = compute_node.get_buffer(&x.coefs[0], x.coefs.size()); + ScalarType* d_p = compute_node.get_buffer(&p.coefs[0], p.coefs.size()); + ScalarType* d_b = compute_node.get_buffer(&b.coefs[0], b.coefs.size()); + OrdinalType* d_Arowoff = compute_node.get_buffer(&A.row_offsets[0], A.row_offsets.size()); + OrdinalType* d_Acols = compute_node.get_buffer(&A.packed_cols[0], A.packed_cols.size()); + ScalarType* d_Acoefs = compute_node.get_buffer(&A.packed_coefs[0], A.packed_coefs.size()); + + //Copy data to buffers that need to be initialized from input data: + compute_node.copy_to_buffer(&x.coefs[0], x.coefs.size(), d_x); + compute_node.copy_to_buffer(&b.coefs[0], b.coefs.size(), d_b); + compute_node.copy_to_buffer(&A.row_offsets[0], A.row_offsets.size(), d_Arowoff); + compute_node.copy_to_buffer(&A.packed_cols[0], A.packed_cols.size(), d_Acols); + compute_node.copy_to_buffer(&A.packed_coefs[0], A.packed_coefs.size(), d_Acoefs); + + TICK(); + for(OrdinalType i=0; i + +#ifdef HAVE_MPI +#include +#endif + +#include +#include + +int main(int argc, char** argv) { + +#ifdef HAVE_MPI + MPI_Init(&argc, &argv); +#endif + + //utest_case.hpp declares the 'get_utest_cases' function. + + std::vector& utest_cases = get_utest_cases(); + bool tests_passed = true; + + for(size_t i=0; irun(); + if (passed) std::cout << " pass: " << utest_cases[i]->name() << std::endl; + else { + std::cout << "!!!FAIL: " << utest_cases[i]->name() << std::endl; + tests_passed = false; + } + } + + if (!tests_passed) { + std::cout << "at least 1 test failed."< + +class utest_case; + +std::vector& get_utest_cases() +{ + static std::vector utest_cases; + return utest_cases; +} + +//When a class that inherits the utest_case class is constructed, +//it gets added to the vector of utest_cases returned by +//the above 'get_utest_cases' function. +class utest_case { +public: + utest_case(){ get_utest_cases().push_back(this); } + ~utest_case(){} + virtual const char* name() = 0; + virtual bool run() = 0; +}; + +//The following macro declares and instantiates a class that +//inherits the above utest_case interfaces. +// +//use the macro like this: +// UTEST_CASE(mytest) +// { +// ... test code here ... +// } +// +//See example usages in utest_cases.hpp +// +#define UTEST_CASE(TESTNAME) \ + class TESTNAME##_utest : public utest_case { \ + public: \ + TESTNAME##_utest(){} \ + const char* name() {return #TESTNAME;} \ + bool run(); \ + }; \ + \ + TESTNAME##_utest instance_##TESTNAME##_utest; \ + \ + bool TESTNAME##_utest::run() + +#define TEST_EQUAL(A,B) \ + if ((A) != (B)) return false; + +#define TEST_EQUAL_TOL(A,B,tol) \ + if (std::abs((A) - (B)) > tol) return false; + +#endif + diff --git a/tests/apps/miniFE/tests/basic/utest_cases.hpp b/tests/apps/miniFE/tests/basic/utest_cases.hpp new file mode 100644 index 0000000000..d15ef9d030 --- /dev/null +++ b/tests/apps/miniFE/tests/basic/utest_cases.hpp @@ -0,0 +1,1232 @@ +#ifndef _utest_cases_hpp_ +#define _utest_cases_hpp_ + +//@HEADER +// ************************************************************************ +// +// miniFE: simple finite-element assembly and linear-solve +// Copyright (2006) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA +// Questions? Contact Michael A. Heroux (maherou@sandia.gov) +// +// ************************************************************************ +//@HEADER + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#ifdef MINIFE_HAVE_TPI +#include +#include +#endif + +#ifdef MINIFE_HAVE_TBB +#include +#include +#endif + +#ifdef MINIFE_HAVE_CUDA +#include +#endif + +#include + +typedef MINIFE_SCALAR Scalar; +typedef MINIFE_LOCAL_ORDINAL LocalOrdinal; +typedef MINIFE_GLOBAL_ORDINAL GlobalOrdinal; + +template +inline +int check_get_id(int nx, int ny, int nz, int x, int y, int z, T expected, const char* testname) +{ + T val = miniFE::get_id(nx,ny,nz,x,y,z); + if (val != expected) { + std::cout << testname << " failed. val=" << val<<", expected " << expected << std::endl; + return -1; + } + return 0; +} + +UTEST_CASE(box_partition) +{ + int global_box[3][2] = { { 0, 2000 }, { 0, 2000}, { 0, 2000} }; + int numprocs = 4, myproc = 0; + + int (*local_boxes0)[3][2] = (int(*)[3][2])std::malloc(sizeof(int)*numprocs*3*2); + int (*local_boxes1)[3][2] = (int(*)[3][2])std::malloc(sizeof(int)*numprocs*3*2); + int (*local_boxes2)[3][2] = (int(*)[3][2])std::malloc(sizeof(int)*numprocs*3*2); + int (*local_boxes3)[3][2] = (int(*)[3][2])std::malloc(sizeof(int)*numprocs*3*2); + + box_partition(0, numprocs, 2, global_box, local_boxes0); + box_partition(0, numprocs, 2, global_box, local_boxes1); + box_partition(0, numprocs, 2, global_box, local_boxes2); + box_partition(0, numprocs, 2, global_box, local_boxes3); + + for(int i=1; i(local_boxes0[i]) != + miniFE::get_num_ids(local_boxes0[0])) { + return false; + } + if (miniFE::get_num_ids(local_boxes1[i]) != + miniFE::get_num_ids(local_boxes1[0])) { + return false; + } + if (miniFE::get_num_ids(local_boxes2[i]) != + miniFE::get_num_ids(local_boxes2[0])) { + return false; + } + if (miniFE::get_num_ids(local_boxes3[i]) != + miniFE::get_num_ids(local_boxes3[0])) { + return false; + } + + if (miniFE::get_num_ids(local_boxes0[i]) < 0 || + miniFE::get_num_ids(local_boxes0[i]) > 2000000000) { + return false; + } + } + + std::free(local_boxes0); + std::free(local_boxes1); + std::free(local_boxes2); + std::free(local_boxes3); + + return true; +} + +UTEST_CASE(generate_matrix_structure1) +{ + int global_box[3][2] = {{ 0, 1 }, { 0, 1 }, { 0, 1 } }; + int box[3][2] = {{ 0, 1 }, { 0, 1 }, { 0, 1 } }; + + miniFE::simple_mesh_description mesh(global_box, box); + + SerialComputeNode compute_node; + miniFE::CSRMatrix A(compute_node); + + miniFE::generate_matrix_structure(mesh, A); + + int nodes_x = global_box[0][1]+1; + int nodes_y = global_box[1][1]+1; + int nodes_z = global_box[2][1]+1; + int nrows = nodes_x*nodes_y*nodes_z; + + if (A.rows.size() != nrows) { + return false; + } + + if (A.row_offsets[nrows] != 64) { + return false; + } + + return true; +} + +UTEST_CASE(generate_matrix_structure2) +{ + int global_box[3][2] = {{ 0, 2 }, { 0, 2 }, { 0, 2 } }; + int box[3][2] = {{ 0, 2 }, { 0, 2 }, { 0, 2 } }; + + miniFE::simple_mesh_description mesh(global_box, box); + + SerialComputeNode compute_node; + miniFE::CSRMatrix A(compute_node); + + int nodes_x = global_box[0][1]+1; + int nodes_y = global_box[1][1]+1; + int nodes_z = global_box[2][1]+1; + int nrows = nodes_x*nodes_y*nodes_z; + + if (nrows != 27) { + return false; + } + + miniFE::generate_matrix_structure(mesh, A); + + if (A.row_offsets.size() != nrows+1) { + return false; + } + + if (A.row_offsets[nrows] != 343) { + return false; + } + + if (A.row_offsets[14]-A.row_offsets[13] != 27) { + return false; + } + + return true; +} + +UTEST_CASE(get_hex8_node_coords_3d) +{ + std::vector coords(24); + coords[0] = 0; + coords[1] = 0; + coords[2] = 0; + coords[3] = 1; + coords[4] = 0; + coords[5] = 0; + coords[6] = 1; + coords[7] = 0; + coords[8] = -1; + coords[9] = 0; + coords[10] = 0; + coords[11] = -1; + coords[12] = 0; + coords[13] = 1; + coords[14] = 0; + coords[15] = 1; + coords[16] = 1; + coords[17] = 0; + coords[18] = 1; + coords[19] = 1; + coords[20] = -1; + coords[21] = 0; + coords[22] = 1; + coords[23] = -1; + + std::vector testcoords(24); + + miniFE::get_hex8_node_coords_3d(0, 0, 0, 1.0, &testcoords[0]); + + if (coords != testcoords) { + return false; + } + + return true; +} + +inline +void get_test_elem_mat(std::vector& elem_mat) +{ +//after much careful debugging, I'm convinced that the following is a +//correct element-diffusion matrix for the element with local-node-0 at +//coordinates 0,0,0. So pasting this into a unit-test will guard against +//unintended changes as I continue working on the code for various reasons. + + elem_mat.resize(36); +elem_mat[0] = 0.6666666664477059; +elem_mat[1] = 1.094804871759614e-10; +elem_mat[2] = -0.1666666666666667; +elem_mat[3] = 1.094805019211109e-10; +elem_mat[4] = 1.094804871759614e-10; +elem_mat[5] = -0.1666666666666667; +elem_mat[6] = -0.1666666667761472; +elem_mat[7] = -0.1666666666666667; +elem_mat[8] = 0.666666666447706; +elem_mat[9] = 1.094804941148553e-10; +elem_mat[10] = -0.1666666666666667; +elem_mat[11] = -0.1666666666666667; +elem_mat[12] = 1.094804732981736e-10; +elem_mat[13] = -0.1666666666666667; +elem_mat[14] = -0.1666666667761472; +elem_mat[15] = 0.666666666447706; +elem_mat[16] = 1.094804841401953e-10; +elem_mat[17] = -0.1666666667761472; +elem_mat[18] = -0.1666666666666667; +elem_mat[19] = 1.094804871759614e-10; +elem_mat[20] = -0.1666666666666667; +elem_mat[21] = 0.6666666664477059; +elem_mat[22] = -0.1666666666666668; +elem_mat[23] = -0.1666666667761472; +elem_mat[24] = -0.1666666666666667; +elem_mat[25] = 1.094804702624075e-10; +elem_mat[26] = 0.666666666447706; +elem_mat[27] = 1.094804802370675e-10; +elem_mat[28] = -0.1666666666666667; +elem_mat[29] = 1.094804698287266e-10; +elem_mat[30] = 0.666666666447706; +elem_mat[31] = 1.094805079926431e-10; +elem_mat[32] = -0.1666666666666667; +elem_mat[33] = 0.666666666447706; +elem_mat[34] = 1.094804663592797e-10; +elem_mat[35] = 0.666666666447706; +} + +UTEST_CASE(diffusionMatrix) +{ + std::vector elem_mat_correct(64); + get_test_elem_mat(elem_mat_correct); + + const size_t len = miniFE::Hex8::numNodesPerElem*miniFE::Hex8::numNodesPerElem; + Scalar elem_mat[len]; + Scalar testcoords[miniFE::Hex8::numNodesPerElem*miniFE::Hex8::spatialDim]; + + miniFE::get_hex8_node_coords_3d(0, 0, 0, 1.0, &testcoords[0]); + + miniFE::Hex8::diffusionMatrix_symm(testcoords, elem_mat); + + for(size_t i=0; i 1.e-6) { + return false; + } + } + + Scalar elem_vec_correct[miniFE::Hex8::numNodesPerElem]; + elem_vec_correct[0] = 0.125; + elem_vec_correct[1] = 0.125; + elem_vec_correct[2] = 0.125; + elem_vec_correct[3] = 0.125; + elem_vec_correct[4] = 0.125; + elem_vec_correct[5] = 0.125; + elem_vec_correct[6] = 0.125; + elem_vec_correct[7] = 0.125; + + Scalar elem_vec[miniFE::Hex8::numNodesPerElem]; + miniFE::Hex8::sourceVector(testcoords, elem_vec); + + const size_t nn = miniFE::Hex8::numNodesPerElem; + for(size_t i=0; i 1.e-13) { + return false; + } + } + + return true; +} + +UTEST_CASE(sum_into_row) +{ + SerialComputeNode compute_node; + miniFE::CSRMatrix A(compute_node); + A.rows.resize(1,0); + A.row_offsets.resize(2,0); + A.row_offsets[1] = 4; + A.packed_cols.resize(4); + A.packed_cols[0] = 0; + A.packed_cols[1] = 1; + A.packed_cols[2] = 2; + A.packed_cols[3] = 3; + A.packed_coefs.resize(4,0); + + std::vector indices(4); + indices[0] = 2; + indices[1] = 0; + indices[2] = 1; + indices[3] = 3; + std::vector coefs(4); + coefs[0] = 2.0; + coefs[1] = 0.0; + coefs[2] = 1.0; + coefs[3] = 3.0; + + miniFE::sum_into_row(0, 4, &indices[0], &coefs[0], A); + + coefs[0] = 0.0; + coefs[1] = 1.0; + coefs[2] = 2.0; + coefs[3] = 3.0; + + if (coefs != A.packed_coefs) { + return false; + } + + return true; +} + +UTEST_CASE(sum_in_elem_matrix) +{ + SerialComputeNode compute_node; + miniFE::CSRMatrix A(compute_node); + A.rows.resize(4,0); + A.rows[0] = 0; + A.rows[1] = 1; + A.rows[2] = 2; + A.rows[3] = 3; + A.row_offsets.resize(5,0); + A.row_offsets[1] = 4; + A.row_offsets[2] = 8; + A.row_offsets[3] = 12; + A.row_offsets[4] = 16; + A.packed_cols.resize(16); + A.packed_cols[0] = 0; + A.packed_cols[1] = 1; + A.packed_cols[2] = 2; + A.packed_cols[3] = 3; + A.packed_cols[4] = 0; + A.packed_cols[5] = 1; + A.packed_cols[6] = 2; + A.packed_cols[7] = 3; + A.packed_cols[8] = 0; + A.packed_cols[9] = 1; + A.packed_cols[10] = 2; + A.packed_cols[11] = 3; + A.packed_cols[12] = 0; + A.packed_cols[13] = 1; + A.packed_cols[14] = 2; + A.packed_cols[15] = 3; + + A.packed_coefs.resize(16,0); + + std::vector indices(4); + indices[0] = 2; + indices[1] = 0; + indices[2] = 1; + indices[3] = 3; + std::vector coefs(16); + coefs[0] = 2.0; + coefs[1] = 0.0; + coefs[2] = 1.0; + coefs[3] = 3.0; + coefs[4] = 2.0; + coefs[5] = 0.0; + coefs[6] = 1.0; + coefs[7] = 3.0; + coefs[8] = 2.0; + coefs[9] = 0.0; + coefs[10] = 1.0; + coefs[11] = 3.0; + coefs[12] = 2.0; + coefs[13] = 0.0; + coefs[14] = 1.0; + coefs[15] = 3.0; + + miniFE::sum_in_elem_matrix(4, &indices[0], &coefs[0], A); + + coefs[0] = 0.0; + coefs[1] = 1.0; + coefs[2] = 2.0; + coefs[3] = 3.0; + coefs[4] = 0.0; + coefs[5] = 1.0; + coefs[6] = 2.0; + coefs[7] = 3.0; + coefs[8] = 0.0; + coefs[9] = 1.0; + coefs[10] = 2.0; + coefs[11] = 3.0; + coefs[12] = 0.0; + coefs[13] = 1.0; + coefs[14] = 2.0; + coefs[15] = 3.0; + + if (coefs != A.packed_coefs) { + return false; + } + + return true; +} + +UTEST_CASE(assemble_FE_data) +{ + int global_box[3][2] = {{ 0, 1 }, { 0, 1 }, { 0, 1 } }; + int box[3][2] = {{ 0, 1 }, { 0, 1 }, { 0, 1 } }; + + miniFE::simple_mesh_description mesh(global_box, box); + + SerialComputeNode compute_node; + miniFE::CSRMatrix A(compute_node); + + miniFE::generate_matrix_structure(mesh, A); + + miniFE::Vector b(0, 8, compute_node); + + const int num_nodes = 8; + + std::vector symm_elem_mat_correct; + get_test_elem_mat(symm_elem_mat_correct); + std::vector full_elem_mat_correct(num_nodes*num_nodes); + + int offset = 0; + for(int i=0; i=i) { + Scalar coef = symm_elem_mat_correct[offset++]; + full_elem_mat_correct[i*num_nodes+j] = coef; + full_elem_mat_correct[j*num_nodes+i] = coef; + } + } + } + + std::vector elem_node_ids(num_nodes); + elem_node_ids[0] = 0; + elem_node_ids[1] = 1; + elem_node_ids[2] = 5; + elem_node_ids[3] = 4; + elem_node_ids[4] = 2; + elem_node_ids[5] = 3; + elem_node_ids[6] = 7; + elem_node_ids[7] = 6; + + //now for each row of of the 8x8 elem_mat_correct, reorder that + //row according to the order of elem_node_ids, rows and columns. + std::vector elem_mat_reordered(num_nodes*num_nodes); + offset = 0; + int row = 0; + for(int i=0; i& assembled_mat = A.packed_coefs; + + for(size_t i=0; i 1.e-13) { + return false; + } + } + + return true; +} + +UTEST_CASE(pll_matvec2) +{ + int numprocs = 1, myproc = 0; +#ifdef HAVE_MPI + MPI_Comm_size(MPI_COMM_WORLD, &numprocs); + MPI_Comm_rank(MPI_COMM_WORLD, &myproc); +#endif + + if (numprocs != 2) { + if (myproc == 0) std::cout <<"pll_matvec2_utest only runs when numprocs=2."< A(compute_node); + miniFE::Vector x(myproc, 4,compute_node) ,y(myproc, 4,compute_node); + + A.rows.resize(2, 0); + if (myproc == 0) { + A.rows[0] = 0; A.rows[1] = 1; + } + else { + A.rows[0] = 2; A.rows[1] = 3; + } + + A.row_offsets.resize(3, 0); + if (myproc == 0) { + A.row_offsets[1] = 2; A.row_offsets[2] = 6; + } + else { + A.row_offsets[1] = 2; A.row_offsets[2] = 4; + } + + if (myproc == 0) { + A.packed_cols.resize(6, 0); + A.packed_cols[1] = 1; + A.packed_cols[2] = 0; + A.packed_cols[3] = 1; + A.packed_cols[4] = 2; + A.packed_cols[5] = 3; + } + else { + A.packed_cols.resize(4, 0); + A.packed_cols[0] = 1; + A.packed_cols[1] = 2; + A.packed_cols[2] = 1; + A.packed_cols[3] = 3; + } + if (myproc == 0) { + A.packed_coefs.resize(6, 1); + A.packed_coefs[2] = 2; + A.packed_coefs[4] = -1; + } + else { + A.packed_coefs.resize(4, 1); + A.packed_coefs[0] = -2; + A.packed_coefs[2] = 2; + } + + if (myproc == 0) { + x.coefs[0] = 1; x.coefs[1] = 2; + } + else { + x.coefs[0] = 3; x.coefs[1] = 4; + } + + miniFE::make_local_matrix(A); + miniFE::exchange_externals(A, x); + miniFE::matvec(A, x, y); + + if (myproc == 0) { + if (y.coefs[0] != 3.0 || y.coefs[1] != 5.0) { + std::cout << "proc 0: pll_matvec2_utest failed" << std::endl; + return false; + } + } + else { + if (y.coefs[0] != -1.0 || y.coefs[1] != 8.0) { + std::cout << "proc 1: pll_matvec2_utest failed" << std::endl; + return false; + } + } + + return true; +} + +UTEST_CASE(pll_matvec3) +{ + int numprocs = 1, myproc = 0; +#ifdef HAVE_MPI + MPI_Comm_size(MPI_COMM_WORLD, &numprocs); + MPI_Comm_rank(MPI_COMM_WORLD, &myproc); +#endif + + if (numprocs != 3) { + if (myproc == 0) std::cout <<"pll_matvec3_utest only runs when numprocs=3."< A(compute_node); + miniFE::Vector x(myproc, 6, compute_node) ,y(myproc, 6, compute_node); + + A.rows.resize(2, 0); + A.rows[0] = myproc*2; A.rows[1] = myproc*2+1; + + A.row_offsets.resize(3, 0); + if (myproc == 0) { + A.row_offsets[1] = 2; A.row_offsets[2] = 4; + } + else if (myproc == 1) { + A.row_offsets[1] = 3; A.row_offsets[2] = 4; + } + else { + A.row_offsets[1] = 2; A.row_offsets[2] = 4; + } + + A.packed_cols.resize(4, 0); + if (myproc == 0) { + A.packed_cols[1] = 3; + A.packed_cols[2] = 1; + A.packed_cols[3] = 5; + } + else if (myproc == 1) { + A.packed_cols[1] = 2; + A.packed_cols[2] = 4; + A.packed_cols[3] = 3; + } + else { + A.packed_cols[0] = 1; + A.packed_cols[1] = 4; + A.packed_cols[2] = 3; + A.packed_cols[3] = 5; + } + + A.packed_coefs.resize(4, 1); + if (myproc == 0) { + A.packed_coefs[1] = -1; + A.packed_coefs[3] = -1; + } + else if (myproc == 1) { + A.packed_coefs[0] = 2; + A.packed_coefs[2] = -1; + } + else { + A.packed_coefs[0] = 2; + A.packed_coefs[2] = 2; + } + + if (myproc == 0) { + x.coefs[0] = 1; x.coefs[1] = 2; + } + else if (myproc == 1) { + x.coefs[0] = 3; x.coefs[1] = 4; + } + else { + x.coefs[0] = 5; x.coefs[1] = 6; + } + + miniFE::make_local_matrix(A); + miniFE::exchange_externals(A, x); + miniFE::matvec(A, x, y); + + if (myproc == 0) { + if (y.coefs[0] != -3.0 || y.coefs[1] != -4.0) { + std::cout << "proc 0: pll_matvec3 failed" << std::endl; + return false; + } + } + else if (myproc == 1) { + if (y.coefs[0] != 0.0 || y.coefs[1] != 4.0) { + std::cout << "proc 1: pll_matvec3 failed" << std::endl; + return false; + } + } + else { + if (y.coefs[0] != 9.0 || y.coefs[1] != 14.0) { + std::cout << "proc 2: pll_matvec3 failed" << std::endl; + return false; + } + } + + return true; +} + +UTEST_CASE(ComputeNode_waxpy1) +{ + int numprocs = 1, myproc = 0; +#ifdef HAVE_MPI + MPI_Comm_size(MPI_COMM_WORLD, &numprocs); + MPI_Comm_rank(MPI_COMM_WORLD, &myproc); +#endif + + if (numprocs != 1) { + if (myproc == 0) std::cout <<"ComputeNode_waxpy1 only runs when numprocs=1."< x(0, len, compute_node), y(0, len, compute_node), w(0, len, compute_node); + + std::vector inds(len, 0); + for(size_t i=0; i coefs(len, 1); + + miniFE::sum_into_vector(len, &inds[0], &coefs[0], x); + miniFE::sum_into_vector(len, &inds[0], &coefs[0], y); + miniFE::sum_into_vector(len, &inds[0], &coefs[0], w); + + Scalar* d_x = compute_node.get_buffer(&x.coefs[0], x.coefs.size()); + Scalar* d_y = compute_node.get_buffer(&y.coefs[0], y.coefs.size()); + + compute_node.copy_to_buffer(&x.coefs[0], x.coefs.size(), d_x); + compute_node.copy_to_buffer(&y.coefs[0], y.coefs.size(), d_y); + + miniFE::waxpby(1.0, x, 1.0, y, w); + + Scalar* d_w = compute_node.get_buffer(&w.coefs[0], w.coefs.size()); + compute_node.copy_from_buffer(&w.coefs[0], w.coefs.size(), d_w); + + Scalar expected = 2; + Scalar tol = 1.e-7; + + for(size_t i=0; i tol) { + return false; + } + } + return true; +} + +UTEST_CASE(ComputeNode_dot1) +{ + int numprocs = 1, myproc = 0; +#ifdef HAVE_MPI + MPI_Comm_size(MPI_COMM_WORLD, &numprocs); + MPI_Comm_rank(MPI_COMM_WORLD, &myproc); +#endif + + if (numprocs != 1) { + if (myproc == 0) std::cout <<"ComputeNode_dot1 only runs when numprocs=1."< x(0, N, compute_node), y(0, N, compute_node); + + std::vector inds(N, 0); + for(size_t i=0; i coefs(N, 1); + + miniFE::sum_into_vector(N, &inds[0], &coefs[0], x); + miniFE::sum_into_vector(N, &inds[0], &coefs[0], y); + + Scalar* d_x = compute_node.get_buffer(&x.coefs[0], x.coefs.size()); + Scalar* d_y = compute_node.get_buffer(&y.coefs[0], y.coefs.size()); + + compute_node.copy_to_buffer(&x.coefs[0], x.coefs.size(), d_x); + compute_node.copy_to_buffer(&y.coefs[0], y.coefs.size(), d_y); + + Scalar dot_prod = miniFE::dot(x,y); + + if (dot_prod != N) { + return false; + } + + return true; +} + +UTEST_CASE(ComputeNode_TBB_dot1) +{ + int numprocs = 1, myproc = 0; +#ifdef HAVE_MPI + MPI_Comm_size(MPI_COMM_WORLD, &numprocs); + MPI_Comm_rank(MPI_COMM_WORLD, &myproc); +#endif + + if (numprocs != 1) { + if (myproc == 0) std::cout <<"ComputeNode_TBB_dot1_utest only runs when numprocs=1."< x(0, N, compute_node), y(0, N, compute_node); + + std::vector inds(N, 0); + for(size_t i=0; i coefs(N, 1); + + miniFE::sum_into_vector(inds.size(), &inds[0], &coefs[0], x); + miniFE::sum_into_vector(inds.size(), &inds[0], &coefs[0], y); + + Scalar dot_prod = miniFE::dot(x,y); + + if (dot_prod != N) { + return false; + } + +#else + std::cout << "ComputeNode_TBB_dot1_utest only runs when MINIFE_HAVE_TBB is defined."< x(0, 10, compute_node), y(0, 10, compute_node); + + size_t len = 10; + std::vector inds(len, 0); + for(size_t i=0; i coefs(len, 1); + + miniFE::sum_into_vector(len, &inds[0], &coefs[0], x); + miniFE::sum_into_vector(len, &inds[0], &coefs[0], y); + + Scalar* d_x = compute_node.get_buffer(&x.coefs[0], x.coefs.size()); + Scalar* d_y = compute_node.get_buffer(&y.coefs[0], y.coefs.size()); + + compute_node.copy_to_buffer(&x.coefs[0], x.coefs.size(), d_x); + compute_node.copy_to_buffer(&y.coefs[0], y.coefs.size(), d_y); + + Scalar dot_prod = miniFE::dot(x, y); + + if (std::abs(dot_prod-10.0) > 1.e-12) { + return false; + } + return true; +} + +UTEST_CASE(ser_matvec1) +{ + int numprocs = 1, myproc = 0; +#ifdef HAVE_MPI + MPI_Comm_size(MPI_COMM_WORLD, &numprocs); + MPI_Comm_rank(MPI_COMM_WORLD, &myproc); +#endif + + if (numprocs != 1) { + if (myproc == 0) std::cout <<"ser_matvec1_utest only runs when numprocs=1."< A(compute_node); + miniFE::Vector x(0, 4,compute_node) ,y(0, 4,compute_node); + + A.rows.resize(4, 0); + A.rows[0] = 0; A.rows[1] = 1; + A.rows[2] = 2; A.rows[3] = 3; + + A.row_offsets.resize(5, 0); + A.row_offsets[1] = 2; A.row_offsets[2] = 6; + A.row_offsets[3] = 8; A.row_offsets[4] = 10; + + A.packed_cols.resize(10, 0); + A.packed_cols[1] = 1; + A.packed_cols[2] = 0; + A.packed_cols[3] = 1; + A.packed_cols[4] = 2; + A.packed_cols[5] = 3; + A.packed_cols[6] = 1; + A.packed_cols[7] = 2; + A.packed_cols[8] = 1; + A.packed_cols[9] = 3; + + A.packed_coefs.resize(10, 1); + A.packed_coefs[2] = 2; + A.packed_coefs[4] = -1; + A.packed_coefs[6] = -2; + A.packed_coefs[8] = 2; + + x.coefs[0] = 1; x.coefs[1] = 2; x.coefs[2] = 3; x.coefs[3] = 4; + + for(size_t i=0; i 1.e-12) { + std::cout << "failed 0. y.coefs[0]=" < 1.e-12) { + std::cout << "failed 1. y.coefs[1]=" < 1.e-12) { + std::cout << "failed 2. y.coefs[2]=" < 1.e-12) { + std::cout << "failed 3. y.coefs[3]=" < x(0, len,compute_node) ,y(0, len,compute_node), w(0, len,compute_node); + + Scalar one = 1, zero = 0; + + for(size_t i=0; i1.e-2 ? 1.e-6 * (waxpy_flops/tWAXPY) : 0; + + std::cout << "waxpby_perf_utest: WAXPBY time: " << tWAXPY << ", len: " << len << ", num_iters: " << num_iters + << ", MFLOPS: " << waxpy_mflops << std::endl; + return true; +} + +UTEST_CASE(matmat3x3_1) +{ + Scalar A[] = {1, 4, 7, 2, 5, 8, 3, 6, 9}; + Scalar B[] = {1, 1, 1, 2, 2, 2, 3, 3, 3}; + Scalar C[9]; + + miniFE::matmat3x3(A, B, C); + + TEST_EQUAL(C[0], 6.0); + TEST_EQUAL(C[1], 15.0); + TEST_EQUAL(C[2], 24.0); + TEST_EQUAL(C[3], 12.0); + TEST_EQUAL(C[4], 30.0); + TEST_EQUAL(C[5], 48.0); + TEST_EQUAL(C[6], 18.0); + TEST_EQUAL(C[7], 45.0); + TEST_EQUAL(C[8], 72.0); + + return true; +} + +UTEST_CASE(matmat3x3_X_3xn_1) +{ + Scalar A[] = {1, 4, 7, 2, 5, 8, 3, 6, 9}; + Scalar B[] = {1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6}; + Scalar C[18]; + + miniFE::matmat3x3_X_3xn(A, 6, B, C); + + TEST_EQUAL(C[0], 6.0); + TEST_EQUAL(C[1], 15.0); + TEST_EQUAL(C[2], 24.0); + TEST_EQUAL(C[3], 12.0); + TEST_EQUAL(C[4], 30.0); + TEST_EQUAL(C[5], 48.0); + TEST_EQUAL(C[6], 18.0); + TEST_EQUAL(C[7], 45.0); + TEST_EQUAL(C[8], 72.0); + TEST_EQUAL(C[9], 24.0); + TEST_EQUAL(C[10], 60.0); + TEST_EQUAL(C[11], 96.0); + TEST_EQUAL(C[12], 30.0); + TEST_EQUAL(C[13], 75.0); + TEST_EQUAL(C[14], 120.0); + TEST_EQUAL(C[15], 36.0); + TEST_EQUAL(C[16], 90.0); + TEST_EQUAL(C[17], 144.0); + + return true; +} + +UTEST_CASE(matTransMat3x3_X_3xn_1) +{ + Scalar A[] = {1, 2, 3, 4, 5, 6, 7, 8, 9}; + Scalar B[] = {1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6}; + Scalar C[18]; + + miniFE::matTransMat3x3_X_3xn(A, 6, B, C); + + TEST_EQUAL(C[0], 6.0); + TEST_EQUAL(C[1], 15.0); + TEST_EQUAL(C[2], 24.0); + TEST_EQUAL(C[3], 12.0); + TEST_EQUAL(C[4], 30.0); + TEST_EQUAL(C[5], 48.0); + TEST_EQUAL(C[6], 18.0); + TEST_EQUAL(C[7], 45.0); + TEST_EQUAL(C[8], 72.0); + TEST_EQUAL(C[9], 24.0); + TEST_EQUAL(C[10], 60.0); + TEST_EQUAL(C[11], 96.0); + TEST_EQUAL(C[12], 30.0); + TEST_EQUAL(C[13], 75.0); + TEST_EQUAL(C[14], 120.0); + TEST_EQUAL(C[15], 36.0); + TEST_EQUAL(C[16], 90.0); + TEST_EQUAL(C[17], 144.0); + + return true; +} + +UTEST_CASE(BoxIterator1) +{ + int box1[3][2] = {{ 0, 2 }, { 0, 2 }, { 0, 2 } }; + miniFE::BoxIterator iter = miniFE::BoxIterator::begin(box1); + miniFE::BoxIterator end = miniFE::BoxIterator::end(box1); + + for(int iz=box1[2][0]; iz(nx,ny,nz,iter.x,iter.y,-iter.z); + int x, y, z; + miniFE::get_coords(elemID, nx,ny,nz, x,y,z); + TEST_EQUAL(x,iter.x); + TEST_EQUAL(y,iter.y); + TEST_EQUAL(z,-iter.z); + } + + return true; +} + +#endif + diff --git a/tests/apps/miniFE/tests/basic/verify_solution.hpp b/tests/apps/miniFE/tests/basic/verify_solution.hpp new file mode 100644 index 0000000000..fb3bd3babd --- /dev/null +++ b/tests/apps/miniFE/tests/basic/verify_solution.hpp @@ -0,0 +1,170 @@ +#ifndef _verify_solution_hpp_ +#define _verify_solution_hpp_ + +//@HEADER +// ************************************************************************ +// +// miniFE: simple finite-element assembly and linear-solve +// Copyright (2006) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA +// Questions? Contact Michael A. Heroux (maherou@sandia.gov) +// +// ************************************************************************ +//@HEADER + +#include +#include +#include +#include + +#include +#include +#include +#include + +#ifdef HAVE_MPI +#include +#endif + +namespace miniFE { + +template +struct err_info { + Scalar err; + Scalar computed; + Scalar analytic; + Scalar coords[3]; +}; + +template +void +verify_solution(const simple_mesh_description& mesh, + const VectorType& x) +{ + typedef typename VectorType::GlobalOrdinalType GlobalOrdinal; + typedef typename VectorType::ScalarType Scalar; + + int global_nodes_x = mesh.global_box[0][1]+1; + int global_nodes_y = mesh.global_box[1][1]+1; + int global_nodes_z = mesh.global_box[2][1]+1; + Box box; + copy_box(mesh.local_box, box); + + //num-owned-nodes in each dimension is num-elems+1 + //only if num-elems > 0 in that dimension *and* + //we are at the high end of the global range in that dimension: + if (box[0][1] > box[0][0] && box[0][1] == mesh.global_box[0][1]) ++box[0][1]; + if (box[1][1] > box[1][0] && box[1][1] == mesh.global_box[1][1]) ++box[1][1]; + if (box[2][1] > box[2][0] && box[2][1] == mesh.global_box[2][1]) ++box[2][1]; + + GlobalOrdinal nrows = get_num_ids(box); + + std::vector rows(nrows); + std::vector row_coords(nrows*3); + + unsigned roffset = 0; + + for(int iz=box[2][0]; iz(global_nodes_x, global_nodes_y, global_nodes_z, + ix, iy, iz); + Scalar x, y, z; + get_coords(row_id, global_nodes_x, global_nodes_y, global_nodes_z, x, y, z); + + rows[roffset] = mesh.map_id_to_row(row_id); + row_coords[roffset*3] = x; + row_coords[roffset*3+1] = y; + row_coords[roffset*3+2] = z; + ++roffset; + } + } + } + + if (x.local_size != rows.size() || x.local_size != nrows) { + throw std::runtime_error("verify_solution ERROR, size mismatch"); + } + + const int num_terms = 300; + + err_info max_error; + max_error.err = 0.0; + + for(size_t i=0; i max_error.err) { + max_error.err = err; + max_error.computed = computed_soln; + max_error.analytic = analytic_soln; + max_error.coords[0] = x; + max_error.coords[1] = y; + max_error.coords[2] = z; + } + } + + Scalar local_max_err = max_error.err; + Scalar global_max_err = 0; +#ifdef HAVE_MPI + MPI_Allreduce(&local_max_err, &global_max_err, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); +#else + global_max_err = local_max_err; +#endif + + if (local_max_err == global_max_err) { + if (max_error.err > 1.e-6) { + std::cout << "max absolute error is "<& /dev/null + + # build exe + pushd src >& /dev/null + make -f Makefile.ohpc realclean >& /dev/null + make -f Makefile.ohpc >& /dev/null + popd >& /dev/null + + if [ ! -s $TEST_EXE ];then + flunk "failed to create $TEST_EXE" + fi + + # rename exe + cp -f $TEST_EXE $TEST_EXE.$LMOD_FAMILY_COMPILER.$LMOD_FAMILY_MPI +} diff --git a/tests/apps/miniFE/tests/common/Doxyfile b/tests/apps/miniFE/tests/common/Doxyfile new file mode 100644 index 0000000000..b36b41344a --- /dev/null +++ b/tests/apps/miniFE/tests/common/Doxyfile @@ -0,0 +1,275 @@ +# Doxyfile 1.5.1 + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = Mantevo +PROJECT_NUMBER = 1.0 +OUTPUT_DIRECTORY = /Users/maherou/Software/Mantevo/packages/gathering +CREATE_SUBDIRS = NO +OUTPUT_LANGUAGE = English +USE_WINDOWS_ENCODING = NO +BRIEF_MEMBER_DESC = YES +REPEAT_BRIEF = YES +ABBREVIATE_BRIEF = "The $name class" \ + "The $name widget" \ + "The $name file" \ + is \ + provides \ + specifies \ + contains \ + represents \ + a \ + an \ + the +ALWAYS_DETAILED_SEC = NO +INLINE_INHERITED_MEMB = NO +FULL_PATH_NAMES = YES +STRIP_FROM_PATH = /Applications/ +STRIP_FROM_INC_PATH = +SHORT_NAMES = NO +JAVADOC_AUTOBRIEF = NO +MULTILINE_CPP_IS_BRIEF = NO +DETAILS_AT_TOP = NO +INHERIT_DOCS = YES +SEPARATE_MEMBER_PAGES = NO +TAB_SIZE = 8 +ALIASES = +OPTIMIZE_OUTPUT_FOR_C = NO +OPTIMIZE_OUTPUT_JAVA = NO +BUILTIN_STL_SUPPORT = NO +DISTRIBUTE_GROUP_DOC = NO +SUBGROUPING = YES +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- +EXTRACT_ALL = NO +EXTRACT_PRIVATE = NO +EXTRACT_STATIC = NO +EXTRACT_LOCAL_CLASSES = YES +EXTRACT_LOCAL_METHODS = NO +HIDE_UNDOC_MEMBERS = YES +HIDE_UNDOC_CLASSES = YES +HIDE_FRIEND_COMPOUNDS = NO +HIDE_IN_BODY_DOCS = NO +INTERNAL_DOCS = NO +CASE_SENSE_NAMES = NO +HIDE_SCOPE_NAMES = NO +SHOW_INCLUDE_FILES = YES +INLINE_INFO = YES +SORT_MEMBER_DOCS = YES +SORT_BRIEF_DOCS = NO +SORT_BY_SCOPE_NAME = NO +GENERATE_TODOLIST = YES +GENERATE_TESTLIST = YES +GENERATE_BUGLIST = YES +GENERATE_DEPRECATEDLIST= YES +ENABLED_SECTIONS = +MAX_INITIALIZER_LINES = 30 +SHOW_USED_FILES = YES +SHOW_DIRECTORIES = NO +FILE_VERSION_FILTER = +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- +QUIET = NO +WARNINGS = YES +WARN_IF_UNDOCUMENTED = YES +WARN_IF_DOC_ERROR = YES +WARN_NO_PARAMDOC = NO +WARN_FORMAT = "$file:$line: $text" +WARN_LOGFILE = +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = /Users/maherou/Software/Mantevo/packages/gathering +FILE_PATTERNS = *.c \ + *.cc \ + *.cxx \ + *.cpp \ + *.c++ \ + *.d \ + *.java \ + *.ii \ + *.ixx \ + *.ipp \ + *.i++ \ + *.inl \ + *.h \ + *.hh \ + *.hxx \ + *.hpp \ + *.h++ \ + *.idl \ + *.odl \ + *.cs \ + *.php \ + *.php3 \ + *.inc \ + *.m \ + *.mm \ + *.dox \ + *.py \ + *.C \ + *.CC \ + *.C++ \ + *.II \ + *.I++ \ + *.H \ + *.HH \ + *.H++ \ + *.CS \ + *.PHP \ + *.PHP3 \ + *.M \ + *.MM \ + *.PY +RECURSIVE = NO +EXCLUDE = +EXCLUDE_SYMLINKS = NO +EXCLUDE_PATTERNS = +EXAMPLE_PATH = +EXAMPLE_PATTERNS = * +EXAMPLE_RECURSIVE = NO +IMAGE_PATH = +INPUT_FILTER = +FILTER_PATTERNS = +FILTER_SOURCE_FILES = NO +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- +SOURCE_BROWSER = NO +INLINE_SOURCES = NO +STRIP_CODE_COMMENTS = YES +REFERENCED_BY_RELATION = NO +REFERENCES_RELATION = NO +REFERENCES_LINK_SOURCE = YES +USE_HTAGS = NO +VERBATIM_HEADERS = NO +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- +ALPHABETICAL_INDEX = NO +COLS_IN_ALPHA_INDEX = 5 +IGNORE_PREFIX = +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- +GENERATE_HTML = YES +HTML_OUTPUT = html +HTML_FILE_EXTENSION = .html +HTML_HEADER = +HTML_FOOTER = +HTML_STYLESHEET = +HTML_ALIGN_MEMBERS = YES +GENERATE_HTMLHELP = NO +CHM_FILE = +HHC_LOCATION = +GENERATE_CHI = NO +BINARY_TOC = NO +TOC_EXPAND = NO +DISABLE_INDEX = NO +ENUM_VALUES_PER_LINE = 4 +GENERATE_TREEVIEW = NO +TREEVIEW_WIDTH = 250 +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- +GENERATE_LATEX = YES +LATEX_OUTPUT = latex +LATEX_CMD_NAME = latex +MAKEINDEX_CMD_NAME = makeindex +COMPACT_LATEX = NO +PAPER_TYPE = a4wide +EXTRA_PACKAGES = +LATEX_HEADER = +PDF_HYPERLINKS = NO +USE_PDFLATEX = NO +LATEX_BATCHMODE = NO +LATEX_HIDE_INDICES = NO +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- +GENERATE_RTF = NO +RTF_OUTPUT = rtf +COMPACT_RTF = NO +RTF_HYPERLINKS = NO +RTF_STYLESHEET_FILE = +RTF_EXTENSIONS_FILE = +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- +GENERATE_MAN = NO +MAN_OUTPUT = man +MAN_EXTENSION = .3 +MAN_LINKS = NO +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- +GENERATE_XML = NO +XML_OUTPUT = xml +XML_SCHEMA = +XML_DTD = +XML_PROGRAMLISTING = YES +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- +GENERATE_AUTOGEN_DEF = NO +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- +GENERATE_PERLMOD = NO +PERLMOD_LATEX = NO +PERLMOD_PRETTY = YES +PERLMOD_MAKEVAR_PREFIX = +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- +ENABLE_PREPROCESSING = YES +MACRO_EXPANSION = NO +EXPAND_ONLY_PREDEF = NO +SEARCH_INCLUDES = YES +INCLUDE_PATH = +INCLUDE_FILE_PATTERNS = +PREDEFINED = +EXPAND_AS_DEFINED = +SKIP_FUNCTION_MACROS = YES +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- +TAGFILES = +GENERATE_TAGFILE = +ALLEXTERNALS = NO +EXTERNAL_GROUPS = YES +PERL_PATH = /usr/bin/perl +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- +CLASS_DIAGRAMS = NO +HIDE_UNDOC_RELATIONS = YES +HAVE_DOT = YES +CLASS_GRAPH = YES +COLLABORATION_GRAPH = YES +GROUP_GRAPHS = YES +UML_LOOK = NO +TEMPLATE_RELATIONS = NO +INCLUDE_GRAPH = YES +INCLUDED_BY_GRAPH = YES +CALL_GRAPH = NO +CALLER_GRAPH = NO +GRAPHICAL_HIERARCHY = YES +DIRECTORY_GRAPH = YES +DOT_IMAGE_FORMAT = png +DOT_PATH = /Applications/Doxygen.app/Contents/Resources/ +DOTFILE_DIRS = +MAX_DOT_GRAPH_WIDTH = 1024 +MAX_DOT_GRAPH_HEIGHT = 1024 +MAX_DOT_GRAPH_DEPTH = 1000 +DOT_TRANSPARENT = NO +DOT_MULTI_TARGETS = NO +GENERATE_LEGEND = YES +DOT_CLEANUP = YES +#--------------------------------------------------------------------------- +# Configuration::additions related to the search engine +#--------------------------------------------------------------------------- +SEARCHENGINE = NO diff --git a/tests/apps/miniFE/tests/common/NewMiniApp.cpp b/tests/apps/miniFE/tests/common/NewMiniApp.cpp new file mode 100644 index 0000000000..0e59a31ddb --- /dev/null +++ b/tests/apps/miniFE/tests/common/NewMiniApp.cpp @@ -0,0 +1,161 @@ + +//@HEADER +// ************************************************************************ +// +// Mantevo: A collection of mini-applications for HPC +// Copyright (2008) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA +// Questions? Contact Michael A. Heroux (maherou@sandia.gov) +// +// ************************************************************************ +//@HEADER + +// Changelog +// +// Version 0.1 + + +#include +#include + +#include +#include +#include "vectorTests.hpp" +#include "YAML_Element.hpp" +#include "YAML_Doc.hpp" +#ifdef HAVE_MPI +#include // If this routine is compiled with -DHAVE_MPI + // then include mpi.h +#endif +void addResults(YAML_Element * currentElement, const std::vector & times, double fnops); + + +#undef DEBUG +int main(int argc, char *argv[]) { +#ifdef HAVE_MPI + // Initialize MPI + MPI_Init(&argc, &argv); + int size, rank; // Number of MPI processes, My process ID + MPI_Comm_size(MPI_COMM_WORLD, &size); + MPI_Comm_rank(MPI_COMM_WORLD, &rank); + + // I'm alive !!! + if (size < 100) std::cout << "Process "<> junk; +#endif + + if(argc != 2) { + std::cerr << "Usage:" << std::endl + << argv[0] << " n" << std::endl + << " where n is the problem size" << std::endl; + std::exit(1); + } + + size_t n = atoi(argv[1]); + int numTrials = 1000000/n; if (numTrials<1) numTrials = 1; + double fnops = 2.0 * ((double) size) *((double) n)*((double) numTrials); + std::vector times(4,0.0); + doc.add("Problem_size",n); + doc.add("Number_of_timing_trials",numTrials); + + std::vector dx(n, 1.0), dy(n, 1.0); + + int ierr = vectorTests(numTrials, dx, dy, times); + + if (ierr) std::cerr << "Error in call to vectorTests: " << ierr << ".\n" << std::endl; + + if (rank==0) { // Only PE 0 needs to compute and report timing results + + doc.add("Total_time_for_vector_tests_in_double",times[0]); + + + doc.add("Double_precision_results",""); + doc.get("Double_precision_results")->add("performance_summary",""); + YAML_Element * currentElement = doc.get("Double_precision_results"); + addResults(currentElement, times, fnops); + } + +#ifdef HAVE_MPI + MPI_Barrier(MPI_COMM_WORLD); +#endif + + std::vector fx(n, 1.0f), fy(n, 1.0f); + ierr = vectorTests(numTrials, fx, fy, times); + if (ierr) std::cerr << "Error in call to vectorTests: " << ierr << ".\n" << std::endl; + + if (rank==0) { // Only PE 0 needs to compute and report timing results + + doc.add("Total_time_for_vector_tests_in_float",times[0]); + + + doc.add("Float_precision_results",""); + doc.get("Float_precision_results")->add("performance_summary",""); + YAML_Element * currentElement = doc.get("Float_precision_results"); + addResults(currentElement, times, fnops); + } + + if (rank==0) { // Only PE 0 needs to compute and report timing results + + std::string yaml = doc.generateYAML(); + std::cout << yaml; + } + // Finish up +#ifdef HAVE_MPI + MPI_Finalize(); +#endif + return 0; +} + +void addResults(YAML_Element * currentElement, const std::vector & times, double fnops) { + + currentElement->get("performance_summary")->add("total",""); + currentElement->get("performance_summary")->get("total")->add("time",times[0]); + currentElement->get("performance_summary")->get("total")->add("flops",3.0*fnops); + currentElement->get("performance_summary")->get("total")->add("mflops",3.0*fnops/times[0]/1.0E6); + + currentElement->get("performance_summary")->add("std_vector_bracket_notation",""); + currentElement->get("performance_summary")->get("std_vector_bracket_notation")->add("time",times[1]); + currentElement->get("performance_summary")->get("std_vector_bracket_notation")->add("flops",fnops); + currentElement->get("performance_summary")->get("std_vector_bracket_notation")->add("mflops",fnops/times[1]/1.0E6); + + currentElement->get("performance_summary")->add("raw_pointer_bracket_notation",""); + currentElement->get("performance_summary")->get("raw_pointer_bracket_notation")->add("time",times[2]); + currentElement->get("performance_summary")->get("raw_pointer_bracket_notation")->add("flops",fnops); + currentElement->get("performance_summary")->get("raw_pointer_bracket_notation")->add("mflops",fnops/times[2]/1.0E6); + + currentElement->get("performance_summary")->add("raw_pointer_deref_plusplus_notation",""); + currentElement->get("performance_summary")->get("raw_pointer_deref_plusplus_notation")->add("time",times[3]); + currentElement->get("performance_summary")->get("raw_pointer_deref_plusplus_notation")->add("flops",fnops); + currentElement->get("performance_summary")->get("raw_pointer_deref_plusplus_notation")->add("mflops",fnops/times[3]/1.0E6); + + return; +} diff --git a/tests/apps/miniFE/tests/common/YAML_Doc.cpp b/tests/apps/miniFE/tests/common/YAML_Doc.cpp new file mode 100644 index 0000000000..f79e6d955c --- /dev/null +++ b/tests/apps/miniFE/tests/common/YAML_Doc.cpp @@ -0,0 +1,74 @@ +#include +#include +#include +#include +#include +#include +#include +#ifdef REDSTORM +#include +#include +#include +#endif +#include "YAML_Doc.hpp" +using namespace std; + +//set the microapp_name and version which will become part of the YAML doc. +YAML_Doc::YAML_Doc(const std::string& miniApp_Name, const std::string& miniApp_Version, const std::string& destination_Directory, const std::string& destination_FileName){ + miniAppName = miniApp_Name; + miniAppVersion = miniApp_Version; + destinationDirectory = destination_Directory; + destinationFileName = destination_FileName; +} + +//inherits the destructor from YAML_Element +YAML_Doc::~YAML_Doc(void){ +} + +/* +* generates YAML from the elements of the document and saves it +* to a file +*/ +string YAML_Doc::generateYAML(){ + string yaml; + yaml = yaml + "Mini-Application Name: " + miniAppName + "\n"; + yaml = yaml + "Mini-Application Version: " + miniAppVersion + "\n"; + for(size_t i=0; iprintYAML(""); + } + + time_t rawtime; + tm * ptm; + time ( &rawtime ); + ptm = localtime(&rawtime); + char sdate[25]; + //use tm_mon+1 because tm_mon is 0 .. 11 instead of 1 .. 12 + sprintf (sdate,"%04d:%02d:%02d-%02d:%02d:%02d",ptm->tm_year + 1900, ptm->tm_mon+1, + ptm->tm_mday, ptm->tm_hour, ptm->tm_min,ptm->tm_sec); + + string filename; + if (destinationFileName=="") + filename = miniAppName + "-" + miniAppVersion + "_"; + else + filename = destinationFileName; + filename = filename + string(sdate) + ".yaml"; + if (destinationDirectory!="" && destinationDirectory!=".") { + string mkdir_cmd = "mkdir " + destinationDirectory; +#ifdef REDSTORM + mkdir(destinationDirectory.c_str(),0755); +#else + system(mkdir_cmd.c_str()); +#endif + filename = destinationDirectory + "/" + destinationFileName; + } + else + filename = "./" + filename; + + ofstream myfile; + myfile.open(filename.c_str()); + myfile << yaml; + myfile.close(); + return yaml; +} + + diff --git a/tests/apps/miniFE/tests/common/YAML_Doc.hpp b/tests/apps/miniFE/tests/common/YAML_Doc.hpp new file mode 100644 index 0000000000..057bb44eab --- /dev/null +++ b/tests/apps/miniFE/tests/common/YAML_Doc.hpp @@ -0,0 +1,122 @@ +//@HEADER +// ************************************************************************ +// +// Mantevo: A collection of mini-applications for HPC +// Copyright (2008) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA +// Questions? Contact Michael A. Heroux (maherou@sandia.gov) +// +// ************************************************************************ +//@HEADER + +// Changelog +// +// Version 0.1 +// - Initial version. +// +///////////////////////////////////////////////////////////////////////// + +#ifndef YAML_DOC_H +#define YAML_DOC_H +#include +#include +#include "YAML_Element.hpp" + +//! The Mantevo YAML_Doc class for the uniform collecting and reporting of performance data for mini-applications + +/*! + +The YAML_Doc class works in conjuction with the YAML_Element class to facilitate easy collecting and reporting of YAML-formatted +data that can be then registered with the Mantevo results collection website. + +\code + +//EXAMPLE CODE FOR GENERATING YAML + + YAML_Doc doc("hpccg","1.0"); + doc.add("final_residual",1.4523e-13); + doc.add("time","4.893"); + +//note: the following line will remove the data (4.890) associated with "time" + doc.get("time")->add("total",4.243); + +//note: the following line will likewise remove the data (1.243) associated with "time" + doc.get("time")->get("total")->add("time",2.457); + doc.get("time")->get("total")->add("flops",4.88e5); + doc.get("time")->add("ddot",1.243); + doc.get("time")->add("sparsemv",""); + doc.get("time")->get("sparsemv")->add("time",0.3445); + doc.get("time")->get("sparsemv")->add("overhead",""); + doc.get("time")->get("sparsemv")->get("overhead")->add("time",0.0123); + doc.get("time")->get("sparsemv")->get("overhead")->add("percentage",0.034); + cout << doc.generateYAML() << endl; + return 0; + +\endcode + +Below is the output generated by the above code: + +\verbatim + +final_residual: 1.4523e-13 +time: + total: + time: 2.457 + flops: 4.88e5 + ddot: 1.243 + sparsemv: + time: 0.3445 + overhead: + time: 0.0123 + percentage: 0.034 + +\endverbatim + +\note {No value is allowed to be attached to a key that has children. If children are added to a key, the value is simply set to "".} + +*/ +class YAML_Doc: public YAML_Element { + public: + //! Constructor: accepts mini-application name and version as strings, optionally accepts directory and file name for printing results. + /*! + The sole constructor for this class accepts and name and version number for the mini-application as well as optional directory + and file name information for results that are generated by the generateYAML() method. + \param miniApp_Name (in) string containing name of the mini-application + \param miniApp_Version (in) string containing the version of the mini-application + \param destination_Directory (in, optional) path of diretory where results file will be stored, relative to current working directory. + If this value is not supplied, the results file will be stored in the current working directory. If the directory does not exist + it will be created. + \param destination_FileName (in, optional) root name of the results file. A suffix of ".yaml" will be automatically appended. If no + file name is specified the filename will be constructed by concatenating the miniAppName + miniAppVersion + ".yaml" strings. + */ + YAML_Doc(const std::string& miniApp_Name, const std::string& miniApp_Version, const std::string& destination_Directory = "", const std::string& destination_FileName = ""); + //! Destructor + ~YAML_Doc(); + //! Generate YAML results to standard out and to a file using specified directory and filename, using current directory and miniAppName + miniAppVersion + ".yaml" by default + std::string generateYAML(); + +protected: + std::string miniAppName; + std::string miniAppVersion; + std::string destinationDirectory; + std::string destinationFileName; +}; +#endif /* YAML_DOC_H */ + diff --git a/tests/apps/miniFE/tests/common/YAML_Element.cpp b/tests/apps/miniFE/tests/common/YAML_Element.cpp new file mode 100644 index 0000000000..114a61236b --- /dev/null +++ b/tests/apps/miniFE/tests/common/YAML_Element.cpp @@ -0,0 +1,120 @@ +#include +#include +#include +#include +#include "YAML_Element.hpp" +using namespace std; +YAML_Element::YAML_Element(const std::string& key_arg, const std::string& value_arg){ + key = key_arg; + value = value_arg; +} + +YAML_Element::~YAML_Element(){ + for (size_t i=0; ivalue = ""; + string converted_value = convert_double_to_string(value_arg); + YAML_Element* element = new YAML_Element(key_arg,converted_value); + children.push_back(element); + return element; +} + +YAML_Element* YAML_Element::add(const std::string& key_arg, int value_arg) { + this->value = ""; + string converted_value = convert_int_to_string(value_arg); + YAML_Element* element = new YAML_Element(key_arg,converted_value); + children.push_back(element); + return element; +} + +#ifndef MINIFE_NO_LONG_LONG + +YAML_Element* YAML_Element::add(const std::string& key_arg, long long value_arg) { + this->value = ""; + string converted_value = convert_long_long_to_string(value_arg); + YAML_Element* element = new YAML_Element(key_arg,converted_value); + children.push_back(element); + return element; +} + +#endif + +YAML_Element* YAML_Element::add(const std::string& key_arg, size_t value_arg) { + this->value = ""; + string converted_value = convert_size_t_to_string(value_arg); + YAML_Element* element = new YAML_Element(key_arg,converted_value); + children.push_back(element); + return element; +} + +YAML_Element* YAML_Element::add(const std::string& key_arg, const std::string& value_arg) { + this->value = ""; + YAML_Element* element = new YAML_Element(key_arg, value_arg); + children.push_back(element); + return element; +} + +/* +* returns pointer to the YAML_Element for the given key. +* I, cam, believe an exception should be thrown if there is no +* element in the vector for the specified key +*/ +YAML_Element* YAML_Element::get(const std::string& key_arg) { + for (size_t i=0; igetKey() == key_arg){ + return children[i]; + } + } + return 0; +} + +/* +* prints a line of a YAML document. Correct YAML depends on +* correct spacing; the parameter space should be the proper +* amount of space for the parent element +*/ +string YAML_Element::printYAML(std::string space){ + string yaml_line = space + key + ": " + value + "\n"; + for(int i=0; i<2; i++) space = space + " "; + for(size_t i=0; iprintYAML(space); + } + return yaml_line; +} + +string YAML_Element::convert_double_to_string(double value_arg){ + stringstream strm; + strm << value_arg; + return strm.str(); +} +string YAML_Element::convert_int_to_string(int value_arg){ + stringstream strm; + strm << value_arg; + return strm.str(); +} + +#ifndef MINIFE_NO_LONG_LONG + +string YAML_Element::convert_long_long_to_string(long long value_arg){ + stringstream strm; + strm << value_arg; + return strm.str(); +} + +#endif + +string YAML_Element::convert_size_t_to_string(size_t value_arg){ + stringstream strm; + strm << value_arg; + return strm.str(); +} diff --git a/tests/apps/miniFE/tests/common/YAML_Element.hpp b/tests/apps/miniFE/tests/common/YAML_Element.hpp new file mode 100644 index 0000000000..611dca1854 --- /dev/null +++ b/tests/apps/miniFE/tests/common/YAML_Element.hpp @@ -0,0 +1,86 @@ +//@HEADER +// ************************************************************************ +// +// Mantevo: A collection of mini-applications for HPC +// Copyright (2008) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA +// Questions? Contact Michael A. Heroux (maherou@sandia.gov) +// +// ************************************************************************ +//@HEADER + +// Changelog +// +// Version 0.1 +// - Initial version. +// +///////////////////////////////////////////////////////////////////////// + +#ifndef YAML_ELEMENT_H +#define YAML_ELEMENT_H +#include +#include +//! The Mantevo YAML_Element class for registering key-value pairs of performance data + +/*! + Mantevo mini-applications generate a collection of performance data for each run of the executable. YAML_Element, and + the related YAML_Doc class, provide a uniform facility for gathering and reporting this data using the YAML text format. +*/ +class YAML_Element { + public: + + //! Default constructor. + YAML_Element (){key="";value="";} + //! Construct with known key-value pair + YAML_Element (const std::string& key_arg, const std::string& value_arg); + //! Destructor + ~YAML_Element (); + //! Key accessor method + std::string getKey(){return key;} + //! Add a child element to an element list associated with this element, value of type double + YAML_Element* add(const std::string& key_arg, double value_arg); + //! Add a child element to an element list associated with this element, value of type int + YAML_Element* add(const std::string& key_arg, int value_arg); +#ifndef MINIFE_NO_LONG_LONG + //! Add a child element to an element list associated with this element, value of type long long + YAML_Element* add(const std::string& key_arg, long long value_arg); +#endif + //! Add a child element to an element list associated with this element, value of type size_t + YAML_Element* add(const std::string& key_arg, size_t value_arg); + //! Add a child element to an element list associated with this element, value of type string + YAML_Element* add(const std::string& key_arg, const std::string& value_arg); + //! get the element in the list with the given key + YAML_Element* get(const std::string& key_arg); + std::string printYAML(std::string space); + +protected: + std::string key; + std::string value; + std::vector children; + +private: + std::string convert_double_to_string(double value_arg); + std::string convert_int_to_string(int value_arg); +#ifndef MINIFE_NO_LONG_LONG + std::string convert_long_long_to_string(long long value_arg); +#endif + std::string convert_size_t_to_string(size_t value_arg); +}; +#endif /* YAML_ELEMENT_H */ diff --git a/tests/apps/miniFE/tests/common/gather_yaml.pl b/tests/apps/miniFE/tests/common/gather_yaml.pl new file mode 100644 index 0000000000..e9a127259e --- /dev/null +++ b/tests/apps/miniFE/tests/common/gather_yaml.pl @@ -0,0 +1,124 @@ +#!/usr/bin/perl +use strict; +use warnings; + +my $all_yaml; + + + +run(); + +############################################################################ + # run() + # + # generate yaml and write it to a file + # + # - args: none + # + # - returns: none + # + + sub run{ + get_sys_info(); + my $dir = "../"; + opendir(DIR, $dir) or die "couldn't open $dir: $!\n"; + my @files = readdir(DIR); + closedir(DIR); + foreach my $file (@files){ + if (-T "$dir/$file"){ + get_result_info("$dir/$file"); + } + } + print $all_yaml; + my $filePath = $dir . "upload/" . "mantevo_results.yaml"; + open(my $out, ">", $filePath ) or die "Can't open $filePath: $!"; + print $out $all_yaml; + } # run + +############################################################################ + # get_sys_info() + # + # gather system information into yaml format and append it to the "all_yaml" string + # + # - args: none + # + # - returns: none + # + + sub get_sys_info { + my $hostName = ""; my $dnsName = ""; my $ipAddress = ""; + my $operatingSystem = ""; my $kernelName = ""; my $kernelRelease = ""; + my $kernelVersion = ""; my $processor = ""; my $machineHardware = ""; + my $hardwarePlatform = ""; my $badCmd = 0; my $outString = ""; + my $time = ""; + $badCmd = system('hostname -s > /dev/null 2>&1'); + if (!$badCmd) { + chomp($hostName=`hostname -s`); + } else { + $hostName=getOptionalOutput("uname -n"); + } + $dnsName=getOptionalOutput("hostname -d"); + $ipAddress=getOptionalOutput("hostname -i"); + $operatingSystem=getOptionalOutput("uname -o"); + $kernelName=getOptionalOutput("uname -s"); + $kernelRelease=getOptionalOutput("uname -r"); + $kernelVersion=getOptionalOutput("uname -v"); + $processor=getOptionalOutput("uname -p"); + $machineHardware=getOptionalOutput("uname -m"); + $hardwarePlatform=getOptionalOutput("uname -i"); + $time = time(); + $all_yaml = "--- +description: $time +hostName: $hostName +dnsName: $dnsName +ipAddress: $ipAddress +operatingSystem: $operatingSystem +kernelName: $kernelName +kernelRelease: $kernelRelease +kernelVersion: $kernelVersion +processor: $processor +machineHardware: $machineHardware +hardwarePlatform: $hardwarePlatform + +"; + } # get_sys_info() + +############################################################################ + # get_result_info() + # + # appends the yaml from a result file to the "all_yaml" string + # + # - args: the shell command + # + # - returns: the optional output string + # + + sub get_result_info { + my $current_file = $_[0]; + local $/=undef; + open FILE, $current_file or die "Couldn't open $current_file: $!"; + my $yaml_string = ; + close FILE; + $all_yaml = "$all_yaml--SEPARATOR--\n\n$yaml_string\n"; + } # get_result_info() + +############################################################################ + # getOptionalOutput() + # + # Runs a system command and gets its output if it succeeds then returns + # its output. The program suppress output to stderr of the program does + # not run correctly. + # + # - args: the shell command + # + # - returns: the optional output string + # + + sub getOptionalOutput { + my $cmnd_in = shift; + my $cmnd = "$cmnd_in > /dev/null 2>&1"; + my $returnVal = system($cmnd); + my $outputStr=""; + chomp($outputStr = `$cmnd_in`) if($returnVal == 0); + return $outputStr; + } # getOptionalOutput() \ No newline at end of file diff --git a/tests/apps/miniFE/tests/common/generate_info_header b/tests/apps/miniFE/tests/common/generate_info_header new file mode 100755 index 0000000000..469f0b9c81 --- /dev/null +++ b/tests/apps/miniFE/tests/common/generate_info_header @@ -0,0 +1,88 @@ +#!/bin/bash + +# usage: +# generate_info_header +# example: +# % generate_info_header g++ -O3 miniFE MINIFE +# this will cause the appropriate info to be put in a +# header named miniFE_info.hpp and the info will be in macros +# that start with MINIFE. +# +# an example of usage can be seen in miniFE/make_targets +# +if [ $# != 4 ] ; then +echo "error, need 4 arguments."; +exit 1; +fi + +cxx=`which ${1}` +errcode="$?" +if [ ${errcode} != "0" ] ; then +cxx="unknown"; +fi +echo "CXX: ${cxx}" + +cxx_ver=`${1} --version 2>&1` +errcode="$?" +if [ ${errcode} != "0" ] ; then +cxx_ver=`${1} -V 2>&1`; +errcode="$?" +if [ ${errcode} != "0" ] ; then +cxx_ver="unknown"; +fi +fi + +cxx_ver=${cxx_ver// /@} +cxx_version="" +for i in $(echo ${cxx_ver}); +do + if [ "$cxx_version" == "" ]; then + cxx_version=$i; + fi +done +cxx_version=${cxx_version//@/ } +echo "Compiler version: ${cxx_version}" + +cxxflags=${2} +hostname=`uname -n` +errcode="$?" +if [ ${errcode} != "0" ] ; then +hostname="unknown"; +fi + +kern_name=`uname -s` +errcode="$?" +if [ ${errcode} != "0" ] ; then +kern_name="unknown"; +fi + +kern_rel=`uname -r` +errcode="$?" +if [ ${errcode} != "0" ] ; then +kern_rel="unknown"; +fi + +proc=`uname -p` +errcode="$?" +if [ ${errcode} != "0" ] ; then +proc="unknown"; +fi + +header_prefix=${3} +macro_prefix=${4} + +cat << END_CAT > ${header_prefix}_info.hpp +#ifndef ${header_prefix}_info_hpp +#define ${header_prefix}_info_hpp + +#define ${macro_prefix}_HOSTNAME "${hostname}" +#define ${macro_prefix}_KERNEL_NAME "'${kern_name}'" +#define ${macro_prefix}_KERNEL_RELEASE "'${kern_rel}'" +#define ${macro_prefix}_PROCESSOR "'${proc}'" + +#define ${macro_prefix}_CXX "'${cxx}'" +#define ${macro_prefix}_CXX_VERSION "'${cxx_version}'" +#define ${macro_prefix}_CXXFLAGS "'${cxxflags}'" + +#endif +END_CAT diff --git a/tests/apps/miniFE/tests/common/main.cpp b/tests/apps/miniFE/tests/common/main.cpp new file mode 100644 index 0000000000..9724f69e68 --- /dev/null +++ b/tests/apps/miniFE/tests/common/main.cpp @@ -0,0 +1,292 @@ + +//@HEADER +// ************************************************************************ +// +// HPCCG: Simple Conjugate Gradient Benchmark Code +// Copyright (2006) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA +// Questions? Contact Michael A. Heroux (maherou@sandia.gov) +// +// ************************************************************************ +//@HEADER + +// Changelog +// +// Version 0.3 +// - Added timing of setup time for sparse MV +// - Corrected percentages reported for sparse MV with overhead +// +///////////////////////////////////////////////////////////////////////// + +// Main routine of a program that reads a sparse matrix, right side +// vector, solution vector and initial guess from a file in HPC +// format. This program then calls the HPCCG conjugate gradient +// solver to solve the problem, and then prints results. + +// Calling sequence: + +// test_HPCCG linear_system_file + +// Routines called: + +// read_HPC_row - Reads in linear system + +// mytimer - Timing routine (compile with -DWALL to get wall clock +// times + +// HPCCG - CG Solver + +// compute_residual - Compares HPCCG solution to known solution. + +#include +using std::cout; +using std::cerr; +using std::endl; +#include +#include +#include +#include +#include +#include +#ifdef USING_MPI +#include // If this routine is compiled with -DUSING_MPI + // then include mpi.h +#include "make_local_matrix.hpp" // Also include this function +#endif +#include "generate_matrix.hpp" +#include "read_HPC_row.hpp" +#include "mytimer.hpp" +#include "HPC_sparsemv.hpp" +#include "compute_residual.hpp" +#include "HPCCG.hpp" +#include "HPC_Sparse_Matrix.hpp" +#include "YAML_generator.hpp" +//#include "YAML_generator.cpp" + +#undef DEBUG +int main(int argc, char *argv[]) +{ + HPC_Sparse_Matrix *A; + double *x, *b, *xexact; + double norm, d; + int ierr = 0; + int i, j; + int ione = 1; + double times[7]; + double t6 = 0.0; + YAML_Doc doc("HPCCG","1.0"); + +#ifdef USING_MPI + + // Initialize MPI + MPI_Init(&argc, &argv); + int size, rank; // Number of MPI processes, My process ID + MPI_Comm_size(MPI_COMM_WORLD, &size); + MPI_Comm_rank(MPI_COMM_WORLD, &rank); + + // I'm alive !!! + + if (size < 100) cout << "Process "<> junk; + } + + MPI_Barrier(MPI_COMM_WORLD); +#endif + + + if(argc != 2 && argc!=4) { + if (rank==0) + cerr << "Usage:" << endl + << "Mode 1: " << argv[0] << " nx ny nz" << endl + << " where nx, ny and nz are the local sub-block dimensions, or" << endl + << "Mode 2: " << argv[0] << " HPC_data_file " << endl + << " where HPC_data_file is a globally accessible file containing matrix data." << endl; + exit(1); + } + + if (argc==4) { + int nx = atoi(argv[1]); + int ny = atoi(argv[2]); + int nz = atoi(argv[3]); + doc.add("nx",argv[1]); + doc.add("ny",argv[2]); + doc.add("nz",argv[3]); + generate_matrix(nx, ny, nz, &A, &x, &b, &xexact); + } + else + read_HPC_row(argv[1], &A, &x, &b, &xexact); + +#ifdef USING_MPI + + // Transform matrix indices from global to local values. + // Define number of columns for the local matrix. + + t6 = mytimer(); make_local_matrix(A); t6 = mytimer() - t6; + times[6] = t6; + +#endif + + double t1 = mytimer(); // Initialize it (if needed) + int niters = 0; + double normr = 0.0; + int max_iter = 300; + double tolerance = 0.0; // Set tolerance to zero to make all runs do max_iter iterations + ierr = HPCCG( A, b, x, max_iter, tolerance, niters, normr, times); + + if (ierr) cerr << "Error in call to CG: " << ierr << ".\n" << endl; + +#ifdef USING_MPI + double t4 = times[4]; + double t4min = 0.0; + double t4max = 0.0; + double t4avg = 0.0; + MPI_Allreduce(&t4, &t4min, 1, MPI_DOUBLE, MPI_MIN, MPI_COMM_WORLD); + MPI_Allreduce(&t4, &t4max, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); + MPI_Allreduce(&t4, &t4avg, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + t4avg = t4avg/((double) size); +#endif + + if (rank==0) // Only PE 0 needs to compute and report timing results + { + doc.add("time_spent_in_CG",times[0]); + + cout << "Time spent in CG = " << times[0] << ".\n" << endl; + double fniters = niters; + double fnrow = A->total_nrow; double fnnz = A->total_nnz; + double fnops_ddot = fniters*4*fnrow; + double fnops_waxpby = fniters*6*fnrow; + double fnops_sparsemv = fniters*2*fnnz; + double fnops = fnops_ddot+fnops_waxpby+fnops_sparsemv; + + doc.add("number_of_iterations",fniters); + doc.add("final_residual",normr); + doc.add("performance_summary",""); + doc.get("performance_summary")->add("total",""); + doc.get("performance_summary")->get("total")->add("time",times[0]); + doc.get("performance_summary")->get("total")->add("flops",fnops); + doc.get("performance_summary")->get("total")->add("mflops",fnops/times[0]/1.0E6); + + doc.get("performance_summary")->add("ddot",""); + doc.get("performance_summary")->get("ddot")->add("time",times[1]); + doc.get("performance_summary")->get("ddot")->add("flops",fnops_ddot); + doc.get("performance_summary")->get("ddot")->add("mflops",fnops_ddot/times[1]/1.0E6); + + doc.get("performance_summary")->add("waxpby",""); + doc.get("performance_summary")->get("waxpby")->add("time",times[2]); + doc.get("performance_summary")->get("waxpby")->add("flops",fnops_waxpby); + doc.get("performance_summary")->get("waxpby")->add("mflops",fnops_waxpby/times[2]/1.0E6); + + doc.get("performance_summary")->add("sparsemv",""); + doc.get("performance_summary")->get("sparsemv")->add("time",times[3]); + doc.get("performance_summary")->get("sparsemv")->add("flops",fnops_sparsemv); + doc.get("performance_summary")->get("sparsemv")->add("mflops",fnops_sparsemv/times[3]/1.0E6); + + cout << "Number of iterations = " << niters << ".\n" << endl; + cout << "Final residual = " << normr << ".\n" << endl; + cout << "********** Performance Summary (times in sec) ***********" << endl << endl; + cout << "Total Time/FLOPS/MFLOPS = " + << times[0] << "/" << fnops << "/" + << fnops/times[0]/1.0E6 << "." << endl; + cout << "DDOT Time/FLOPS/MFLOPS = " + << times[1] << "/" << fnops_ddot << "/" + << fnops_ddot/times[1]/1.0E6 << "." << endl; +#ifdef USING_MPI + doc.get("performance_summary")->get("ddot")->add("min_MPI_Allreduce_time",t4min); + doc.get("performance_summary")->get("ddot")->add("max_MPI_Allreduce_time",t4max); + doc.get("performance_summary")->get("ddot")->add("avg_MPI_Allreduce_time",t4avg); + + cout << " Minimum DDOT MPI_Allreduce time (over all processors) = " << t4min << endl; + cout << " Maximum DDOT MPI_Allreduce time (over all processors) = " << t4max << endl; + cout << " Average DDOT MPI_Allreduce time (over all processors) = " << t4avg << endl; +#endif + cout << "WAXPBY Time/FLOPS/MFLOPS = " + << times[2] << "/" << fnops_waxpby << "/" + << fnops_waxpby/times[2]/1.0E6 << "." << endl; + cout << "SPARSEMV Time/FLOPS/MFLOPS = " + << times[3] << "/" << fnops_sparsemv << "/" + << fnops_sparsemv/(times[3])/1.0E6 << "." << endl; +#ifdef USING_MPI + double totalSparseMVTime = times[3] + times[5]+ times[6]; + + double mflops_w_overhead = fnops_sparsemv/(totalSparseMVTime)/1.0E6; + double po_time = (times[5]+times[6]); + double po_perc = po_time/totalSparseMVTime*100.0; + double po_set_time = times[6]; + double po_set_perc = po_set_time/totalSparseMVTime*100.0; + double po_Bdry_exch_time = times[5]; + double po_Bdry_exch_perc = po_Bdry_exch_time/totalSparseMVTime*100.0; + + YAML_Element* currnet_elem = doc.get("performance_summary")->get("sparsemv"); + currnet_elem->add("mflops_w_overhead",mflops_w_overhead); + currnet_elem->add("parallel_overhead",""); + currnet_elem->get("parallel_overhead")->add("time",po_time); + currnet_elem->get("parallel_overhead")->add("percentage",po_perc); + currnet_elem->get("parallel_overhead")->add("setup",""); + currnet_elem->get("parallel_overhead")->get("setup")->add("time",po_set_time); + currnet_elem->get("parallel_overhead")->get("setup")->add("percentage",po_set_perc); + currnet_elem->get("parallel_overhead")->add("Bdry_exchange",""); + currnet_elem->get("parallel_overhead")->get("Bdry_exchange")->add("time",po_Bdry_exch_time); + currnet_elem->get("parallel_overhead")->get("Bdry_exchange")->add("percentage",po_Bdry_exch_perc); + + cout << "SPARSEMV MFLOPS W OVRHEAD = " + << mflops_w_overhead << "." << endl; + cout << "SPARSEMV PARALLEL OVERHEAD Time = " + << po_time << " ( " << po_perc << " % )." << endl; + cout << " SPARSEMV PARALLEL OVERHEAD (Setup) Time = " + << po_set_time << " ( " << po_set_perc << " % )." << endl; + cout << " SPARSEMV PARALLEL OVERHEAD (Bdry Exchange) Time = " + << po_Bdry_exch_time << " ( " << po_Bdry_exch_perc << " % )." << endl; +#endif + } + + // Compute difference between known exact solution and computed solution + // All processors are needed here. + + double residual = 0; + if ((ierr = compute_residual(A->local_nrow, x, xexact, &residual))) + cerr << "Error in call to compute_residual: " << ierr << ".\n" << endl; + + if (rank==0){ + cout << "Difference between computed and exact = " + << residual << ".\n" << endl; + doc.add("diff_between_computed_and_exact",residual); + string yaml = doc.generateYAML(); + cout << yaml; + } + // Finish up +#ifdef USING_MPI + MPI_Finalize(); +#endif + return 0 ; +} diff --git a/tests/apps/miniFE/tests/common/mytimer.cpp b/tests/apps/miniFE/tests/common/mytimer.cpp new file mode 100644 index 0000000000..71e19e6191 --- /dev/null +++ b/tests/apps/miniFE/tests/common/mytimer.cpp @@ -0,0 +1,109 @@ + +//@HEADER +// ************************************************************************ +// +// HPCCG: Simple Conjugate Gradient Benchmark Code +// Copyright (2006) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA +// Questions? Contact Michael A. Heroux (maherou@sandia.gov) +// +// ************************************************************************ +//@HEADER + +///////////////////////////////////////////////////////////////////////// + +// Function to return time in seconds. +// If compiled with no flags, return CPU time (user and system). +// If compiled with -DWALL, returns elapsed time. + +///////////////////////////////////////////////////////////////////////// +#ifdef HAVE_MPI +#include // If this routine is compiled with -DHAVE_MPI + // then include mpi.h +double mytimer(void) +{ + return(MPI_Wtime()); +} + + +#elif defined(UseClock) + +#include +double mytimer(void) +{ + clock_t t1; + static clock_t t0=0; + static double CPS = CLOCKS_PER_SEC; + double d; + + if (t0 == 0) t0 = clock(); + t1 = clock() - t0; + d = t1 / CPS; + return(d); +} + +#elif defined(WALL) + +#include +#include +#include +double mytimer(void) +{ + struct timeval tp; + static long start=0, startu; + if (!start) + { + gettimeofday(&tp, NULL); + start = tp.tv_sec; + startu = tp.tv_usec; + return(0.0); + } + gettimeofday(&tp, NULL); + return( ((double) (tp.tv_sec - start)) + (tp.tv_usec-startu)/1000000.0 ); +} + +#elif defined(UseTimes) + +#include +#include +#include +double mytimer(void) +{ + struct tms ts; + static double ClockTick=0.0; + + if (ClockTick == 0.0) ClockTick = (double) sysconf(_SC_CLK_TCK); + times(&ts); + return( (double) ts.tms_utime / ClockTick ); +} + +#else + +#include +#include +#include +double mytimer(void) +{ + struct rusage ruse; + getrusage(RUSAGE_SELF, &ruse); + return( (double)(ruse.ru_utime.tv_sec+ruse.ru_utime.tv_usec / 1000000.0) ); +} + +#endif diff --git a/tests/apps/miniFE/tests/common/mytimer.hpp b/tests/apps/miniFE/tests/common/mytimer.hpp new file mode 100644 index 0000000000..94226a3ca3 --- /dev/null +++ b/tests/apps/miniFE/tests/common/mytimer.hpp @@ -0,0 +1,32 @@ + +//@HEADER +// ************************************************************************ +// +// HPCCG: Simple Conjugate Gradient Benchmark Code +// Copyright (2006) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA +// Questions? Contact Michael A. Heroux (maherou@sandia.gov) +// +// ************************************************************************ +//@HEADER +#ifndef MYTIMER_H +#define MYTIMER_H +double mytimer(void); +#endif // MYTIMER_H diff --git a/tests/apps/miniFE/tests/common/param_utils.cpp b/tests/apps/miniFE/tests/common/param_utils.cpp new file mode 100644 index 0000000000..0d9cbf3b28 --- /dev/null +++ b/tests/apps/miniFE/tests/common/param_utils.cpp @@ -0,0 +1,32 @@ + +#include + +#include +#include + +namespace Mantevo { + +//------------------------------------------------------------- +void read_args_into_string(int argc, char** argv, std::string& arg_string) +{ + arg_string = argv[0]; + for(int i=1; i +#include + +//Parameter-parsing Utilities: +// +//The functions declared below are intended to assist with parsing +//input-parameters which may be command-line arguments and/or lines in a +//text file. +// +// Scenario: You want your program to accept parameters that are specified +// as command-line arguments and/or as lines in a text file (such +// as a YAML output file). i.e., your program can be run like this: +// % program.exe foo=3.14159 bar: 42 +// or +// % program.exe input_file=params.txt +// or +// % program.exe foo=3.14159 input_file = params.txt +// +//Example: +// Here is example code to obtain parameters using the 3 functions +// 'read_args_into_string', 'read_file_into_string' and 'parse_parameter': +// +// std::string arg_string; +// +// //put command-line-arguments into 'arg_string': +// read_args_into_string(argc, argv, arg_string); +// +// //do the command-line-arguments specify an 'input_file'? +// std::string filename = +// parse_parameter(arg_string,"input_file","none-specified"); +// +// if (filename != "none-specified") { +// std::string tmp; +// read_file_into_string(filename, tmp); +// arg_string += tmp; +// } +// +// //now parse the parameters: +// float foo = parse_parameter(arg_string, "foo", -9.9); +// int bar = parse_parameter(arg_string, "bar", -1); +// +//See the comments below for parse_parameter, for formatting requirements of +//named parameter-value pairs. +// + +namespace Mantevo { + +/** + * Concatenate command-line arguments into a single string. + * + * Note: this function is purely serial. If argc and argv have different + * values on different MPI processes, then you need to resolve that by + * broadcasting arg_string's contents. + */ +void read_args_into_string(int argc, char** argv, std::string& arg_string); + +/** + * Read the contents of a text-file into a single string. + * + * Note: this function is purely serial. If you want file_contents on multiple + * MPI processes, you need to broadcast it (or call this function on each + * MPI process...). + */ +void read_file_into_string(const std::string& filename, + std::string& file_contents); + +/** + * Parse a named parameter value from input 'arg_string'. + * + * Search 'arg_string' for an occurrence of param_name and attempt to parse + * a value into the return-type. If param_name is not found, then default_value + * is returned. + * + * Example: + * arg_string = "foo = 3.14159"; + * float foo = parse_parameter(arg_string, "foo", -999.9); + * //foo should now contain the value 3.14159; if 'foo' was not found in + * //arg_string, then -999.9 would have been returned. + * + * Other legal name-value separators are ':' and ' '. Extra spaces are also ok, + * e.g. "foo : 3.114159". + * + * Note that if a YAML file is read into a string, that would be a valid input + * string for this function. + */ +template +T parse_parameter(const std::string& arg_string, + const std::string& param_name, + const T& default_value) +{ + std::string::size_type pos = arg_string.find(param_name); + if (pos == std::string::npos) { + //if param_name is not found in arg_string, return default_value: + return default_value; + } + + pos += param_name.size(); + + if (arg_string.size() <= pos) return default_value; + + //skip past ' ', '=' or ':': + while(pos < arg_string.size() && + (arg_string[pos] == ' ' || + arg_string[pos] == '=' || + arg_string[pos] == ':')) + { + ++pos; + } + + if (arg_string[pos] == '=' || arg_string[pos] == ':') ++pos; + + std::string str = arg_string.substr(pos); + + std::istringstream isstr(str); + + T return_val = default_value; + + //parse value into return_val: + isstr >> return_val; + + //if parse failed, return default_value: + if (!isstr) return default_value; + + return return_val; +} + +}//namespace Mantevo + +#endif + diff --git a/tests/apps/miniFE/tests/common/vectorTests.hpp b/tests/apps/miniFE/tests/common/vectorTests.hpp new file mode 100644 index 0000000000..53ce682a59 --- /dev/null +++ b/tests/apps/miniFE/tests/common/vectorTests.hpp @@ -0,0 +1,66 @@ + +//@HEADER +// ************************************************************************ +// +// Mantevo: A collection of mini-applications for HPC +// Copyright (2008) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA +// Questions? Contact Michael A. Heroux (maherou@sandia.gov) +// +// ************************************************************************ +//@HEADER +#include +#include "mytimer.hpp" +template +int vectorTests(int numTrials, const std::vector & x, std::vector & y, + std::vector & times) { + + Scalar alpha = 2.0; + double t0; + + size_t n = x.size(); + + double tstart = mytimer(); // Initial time + + t0 = mytimer(); + for (int j=0;j + +namespace miniFE { + +template +struct ElemData { + ElemData() : nodes_per_elem(Hex8::numNodesPerElem) {} + ~ElemData(){} + + const size_t nodes_per_elem; + GlobalOrdinal elem_node_ids[Hex8::numNodesPerElem]; + Scalar grad_vals[Hex8::numGaussPointsPerDim * Hex8::numGaussPointsPerDim * Hex8::numGaussPointsPerDim * Hex8::numNodesPerElem * Hex8::spatialDim]; + Scalar elem_node_coords[Hex8::numNodesPerElem*Hex8::spatialDim]; + Scalar elem_diffusion_matrix[(Hex8::numNodesPerElem*(Hex8::numNodesPerElem+1))/2]; + Scalar elem_source_vector[Hex8::numNodesPerElem]; +}; + +template +struct ElemDataPtr { + ElemDataPtr() : nodes_per_elem(Hex8::numNodesPerElem) {} + ~ElemDataPtr(){} + + const size_t nodes_per_elem; + GlobalOrdinal elem_node_ids[Hex8::numNodesPerElem]; + Scalar grad_vals[Hex8::numGaussPointsPerDim * Hex8::numGaussPointsPerDim * Hex8::numGaussPointsPerDim * Hex8::numNodesPerElem * Hex8::spatialDim]; + Scalar elem_node_coords[(Hex8::numNodesPerElem*(Hex8::spatialDim+1))/2]; + Scalar* elem_diffusion_matrix; + Scalar* elem_source_vector; +}; + +}//namespace miniFE + +#endif + diff --git a/tests/apps/miniFE/tests/fem/Hex8.hpp b/tests/apps/miniFE/tests/fem/Hex8.hpp new file mode 100644 index 0000000000..d2cd4f2046 --- /dev/null +++ b/tests/apps/miniFE/tests/fem/Hex8.hpp @@ -0,0 +1,417 @@ +#ifndef _Hex8_hpp_ +#define _Hex8_hpp_ + +//@HEADER +// ************************************************************************ +// +// MiniFE: Simple Finite Element Assembly and Solve +// Copyright (2006-2013) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA +// +// ************************************************************************ +//@HEADER + +#ifndef KERNEL_PREFIX +#define KERNEL_PREFIX +#endif + +#include +#include +#include + +namespace miniFE { + +namespace Hex8 { + +template +KERNEL_PREFIX void shape_fns(const Scalar* x, Scalar* values_at_nodes) +{ + //assumptions: values_at_nodes has length numNodesPerElem + // x has length 3 (hard-coded spatialDim) + + const Scalar u = 1.0 - x[0]; + const Scalar v = 1.0 - x[1]; + const Scalar w = 1.0 - x[2]; + + const Scalar up1 = 1.0 + x[0]; + const Scalar vp1 = 1.0 + x[1]; + const Scalar wp1 = 1.0 + x[2]; + + values_at_nodes[0] = 0.125 * u * v * w;//(1-x)*(1-y)*(1-z) + values_at_nodes[1] = 0.125 * up1 * v * w;//(1+x)*(1-y)*(1-z) + values_at_nodes[2] = 0.125 * up1 * vp1 * w;//(1+x)*(1+y)*(1-z) + values_at_nodes[3] = 0.125 * u * vp1 * w;//(1-x)*(1+y)*(1-z) + values_at_nodes[4] = 0.125 * u * v * wp1;//(1-x)*(1-y)*(1+z) + values_at_nodes[5] = 0.125 * up1 * v * wp1;//(1+x)*(1-y)*(1+z) + values_at_nodes[6] = 0.125 * up1 * vp1 * wp1;//(1+x)*(1+y)*(1+z) + values_at_nodes[7] = 0.125 * u * vp1 * wp1;//(1-x)*(1+y)*(1+z) +} + +template +KERNEL_PREFIX void gradients(const Scalar* x, Scalar* values_per_fn) +{ + //assumptions values_per_fn has length 24 (numNodesPerElem*spatialDim) + // spatialDim == 3 + + const Scalar u = 1.0 - x[0]; + const Scalar v = 1.0 - x[1]; + const Scalar w = 1.0 - x[2]; + + const Scalar up1 = 1.0 + x[0]; + const Scalar vp1 = 1.0 + x[1]; + const Scalar wp1 = 1.0 + x[2]; + +//fn 0 + values_per_fn[0] = -0.125 * v * w; + values_per_fn[1] = -0.125 * u * w; + values_per_fn[2] = -0.125 * u * v; +//fn 1 + values_per_fn[3] = 0.125 * v * w; + values_per_fn[4] = -0.125 * up1 * w; + values_per_fn[5] = -0.125 * up1 * v; +//fn 2 + values_per_fn[6] = 0.125 * vp1 * w; + values_per_fn[7] = 0.125 * up1 * w; + values_per_fn[8] = -0.125 * up1 * vp1; +//fn 3 + values_per_fn[9] = -0.125 * vp1 * w; + values_per_fn[10] = 0.125 * u * w; + values_per_fn[11] = -0.125 * u * vp1; +//fn 4 + values_per_fn[12] = -0.125 * v * wp1; + values_per_fn[13] = -0.125 * u * wp1; + values_per_fn[14] = 0.125 * u * v; +//fn 5 + values_per_fn[15] = 0.125 * v * wp1; + values_per_fn[16] = -0.125 * up1 * wp1; + values_per_fn[17] = 0.125 * up1 * v; +//fn 6 + values_per_fn[18] = 0.125 * vp1 * wp1; + values_per_fn[19] = 0.125 * up1 * wp1; + values_per_fn[20] = 0.125 * up1 * vp1; +//fn 7 + values_per_fn[21] = -0.125 * vp1 * wp1; + values_per_fn[22] = 0.125 * u * wp1; + values_per_fn[23] = 0.125 * u * vp1; +} + +template +KERNEL_PREFIX void gradients_and_detJ(const Scalar* elemNodeCoords, + const Scalar* grad_vals, + Scalar& detJ) +{ +/** + pt is the point at which the jacobian is to be computed. +*/ + + //assumptions on the lengths of input arguments: + //elemNodeCoords has length numNodesPerElem*spatialDim, + //grad_vals has length numNodesPerElem*spatialDim + + const Scalar zero = 0; + + Scalar J00 = zero; + Scalar J01 = zero; + Scalar J02 = zero; + + Scalar J10 = zero; + Scalar J11 = zero; + Scalar J12 = zero; + + Scalar J20 = zero; + Scalar J21 = zero; + Scalar J22 = zero; + + size_t i_X_spatialDim = 0; + for(size_t i=0; i +KERNEL_PREFIX void gradients_and_invJ_and_detJ(const Scalar* elemNodeCoords, + const Scalar* grad_vals, + Scalar* invJ, + Scalar& detJ) +{ +/** + pt is the point at which the jacobian is to be computed. +*/ + + //assumptions on the lengths of input arguments: + //pt has length spatialDim, + //elemNodeCoords has length numNodesPerElem*spatialDim, + //grad_vals has length numNodesPerElem*spatialDim, and + //J has length spatialDim*spatialDim + + const Scalar zero = 0; + + // + //First we compute the jacobian J: + // + Scalar J00 = zero; + Scalar J01 = zero; + Scalar J02 = zero; + + Scalar J10 = zero; + Scalar J11 = zero; + Scalar J12 = zero; + + Scalar J20 = zero; + Scalar J21 = zero; + Scalar J22 = zero; + + size_t i_X_spatialDim = 0; + for(size_t i=0; i +KERNEL_PREFIX void diffusionMatrix_symm(const Scalar* elemNodeCoords, + const Scalar* grad_vals, + Scalar* elem_mat) +{ + int len = (numNodesPerElem * (numNodesPerElem+1))/2; + const Scalar zero = 0; + miniFE::fill(elem_mat, elem_mat+len, zero); + + Scalar gpts[numGaussPointsPerDim]; + Scalar gwts[numGaussPointsPerDim]; + + gauss_pts(numGaussPointsPerDim, gpts, gwts); + + const Scalar k = 1.0; + Scalar detJ = 0.0; + + Scalar dpsidx[numNodesPerElem], dpsidy[numNodesPerElem], dpsidz[numNodesPerElem]; + + Scalar invJ[spatialDim*spatialDim]; + + //The following nested loop implements equations 3.4.5 and 3.4.7 on page 88 + //of Reddy & Gartling, "The Finite Element Method in Heat Transfer and Fluid + //Dynamics", 2nd edition, + //to compute the element diffusion matrix for the steady conduction equation. + + Scalar pt[spatialDim]; + +#ifdef MINIFE_DEBUG + Scalar volume = zero; +#endif + + size_t gv_offset = 0; + for(size_t ig=0; ig 1.e-7) { +// std::cout << "element volume is "< +KERNEL_PREFIX void sourceVector(const Scalar* elemNodeCoords, + const Scalar* grad_vals, + Scalar* elem_vec) +{ + int len = numNodesPerElem; + const Scalar zero = 0; + miniFE::fill(elem_vec, elem_vec+len, zero); + + Scalar gpts[numGaussPointsPerDim]; + Scalar gwts[numGaussPointsPerDim]; + + Scalar psi[numNodesPerElem]; + + gauss_pts(numGaussPointsPerDim, gpts, gwts); + + Scalar Q = 1.0; + + Scalar pt[spatialDim]; + + size_t gv_offset = 0; + for(size_t ig=0; ig +#include +#include + +namespace miniFE { + +template +void compute_gradient_values(Scalar* grad_vals) +{ + Scalar gpts[Hex8::numGaussPointsPerDim]; + Scalar gwts[Hex8::numGaussPointsPerDim]; + + gauss_pts(Hex8::numGaussPointsPerDim, gpts, gwts); + + Scalar pt[Hex8::spatialDim]; + + Scalar* grad_vals_ptr = grad_vals; + for(size_t ig=0; ig +void +compute_element_matrix_and_vector(ElemData& elem_data) +{ + Hex8::diffusionMatrix_symm(elem_data.elem_node_coords, elem_data.grad_vals, + elem_data.elem_diffusion_matrix); + Hex8::sourceVector(elem_data.elem_node_coords, elem_data.grad_vals, + elem_data.elem_source_vector); +} + +template +void +compute_element_matrix_and_vector(ElemDataPtr& elem_data) +{ + Hex8::diffusionMatrix_symm(elem_data.elem_node_coords, elem_data.grad_vals, + elem_data.elem_diffusion_matrix); + Hex8::sourceVector(elem_data.elem_node_coords, elem_data.grad_vals, + elem_data.elem_source_vector); +} + +}//namespace miniFE + +#endif + diff --git a/tests/apps/miniFE/tests/fem/Hex8_enums.hpp b/tests/apps/miniFE/tests/fem/Hex8_enums.hpp new file mode 100644 index 0000000000..3dfac264ae --- /dev/null +++ b/tests/apps/miniFE/tests/fem/Hex8_enums.hpp @@ -0,0 +1,52 @@ +#ifndef _Hex8_enums_hpp_ +#define _Hex8_enums_hpp_ + +//@HEADER +// ************************************************************************ +// +// MiniFE: Simple Finite Element Assembly and Solve +// Copyright (2006-2013) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA +// +// ************************************************************************ +//@HEADER + +namespace miniFE { + +namespace Hex8 { + +// !!!!!!! +//Important note: there are places in miniFE code where +//loops over spatialDim are unrolled (spatialDim is assumed to be 3). +//Thus, changing this enum is not enough to make miniFE code +//work for spatialDim values other than 3. +// !!!!!!! +enum { + spatialDim = 3, + numNodesPerElem = 8, + numGaussPointsPerDim = 2 +}; + +}//namespace Hex8 + +}//namespace miniFE + +#endif + diff --git a/tests/apps/miniFE/tests/fem/analytic_soln.hpp b/tests/apps/miniFE/tests/fem/analytic_soln.hpp new file mode 100644 index 0000000000..2d130e2d0d --- /dev/null +++ b/tests/apps/miniFE/tests/fem/analytic_soln.hpp @@ -0,0 +1,116 @@ +#ifndef _analytic_soln_hpp_ +#define _analytic_soln_hpp_ + +//@HEADER +// ************************************************************************ +// +// MiniFE: Simple Finite Element Assembly and Solve +// Copyright (2006-2013) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA +// +// ************************************************************************ +//@HEADER + +#include + +#ifndef MINIFE_SCALAR +#define MINIFE_SCALAR double; +#endif + +namespace miniFE { + +typedef MINIFE_SCALAR Scalar; + +// The 'soln' function below computes the analytic solution for +// steady state temperature in a brick-shaped domain (formally called +// a rectangular parallelepiped). The inputs to the function are +// the x,y,z coordinates of the point at which temperature is to be +// computed, and the number of terms p,q in the series expansion. +// +// The equations used for the temperature solution are equations 9 and 10 +// in section 6.2 of Carslaw & Jaeger, "Conduction of Heat in Solids". +// +// The paralellepiped being used is defined by this domain: +// 0 <= x <= 1.0 +// 0 <= y <= 1.0 +// 0 <= z <= 1.0 +// +// With boundary conditions prescribing the temperature to be 1.0 on +// the x==1.0 face, and 0.0 on all other faces. +// +// Thus, in the equations from Carslaw & Jaeger, the following constants +// are used: +// +// a == b == c == 1.0 (the extents of the domain) +// v1 == 0.0 (temperature at x == 0.0) +// v2 == 1.0 (temperature at x == 1.0) +// + +const Scalar PI = 3.141592653589793238462; +const Scalar PI_SQR = PI*PI; +const Scalar term0 = 16.0/(PI_SQR); + +inline Scalar fcn_l(int p, int q) +{ + return std::sqrt((2*p+1)*(2*p+1)*PI_SQR + (2*q+1)*(2*q+1)*PI_SQR); +} + +inline Scalar fcn(int n, Scalar u) +{ + return (2*n+1)*PI*u; +} + +inline Scalar soln(Scalar x, Scalar y, Scalar z, int max_p, int max_q) +{ + Scalar sum = 0; + for(int p=0; p<=max_p; ++p) { + const Scalar p21y = fcn(p, y); + const Scalar sin_py = std::sin(p21y)/(2*p+1); + for(int q=0; q<=max_q; ++q) { + const Scalar q21z = fcn(q, z); + const Scalar sin_qz = std::sin(q21z)/(2*q+1); + + const Scalar l = fcn_l(p, q); + + const Scalar sinh1 = std::sinh(l*x); + const Scalar sinh2 = std::sinh(l); + + const Scalar tmp = (sinh1*sin_py)*(sin_qz/sinh2); + + //if the scalar l gets too big, sinh(l) becomes inf. + //if that happens, tmp is a NaN. + //crude check for NaN: + //if tmp != tmp, tmp is NaN + if (tmp == tmp) { + sum += tmp; + } + else { + //if we got a NaN, break out of this inner loop and go to + //the next iteration of the outer loop. + break; + } + } + } + return term0*sum; +} + +}//namespace miniFE + +#endif /* _analytic_soln_hpp_ */ diff --git a/tests/apps/miniFE/tests/fem/gauss_pts.hpp b/tests/apps/miniFE/tests/fem/gauss_pts.hpp new file mode 100644 index 0000000000..76528395cf --- /dev/null +++ b/tests/apps/miniFE/tests/fem/gauss_pts.hpp @@ -0,0 +1,67 @@ +#ifndef _gauss_pts_hpp_ +#define _gauss_pts_hpp_ + +//@HEADER +// ************************************************************************ +// +// MiniFE: Simple Finite Element Assembly and Solve +// Copyright (2006-2013) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA +// +// ************************************************************************ +//@HEADER + +#ifndef KERNEL_PREFIX +#define KERNEL_PREFIX +#endif + +namespace miniFE { + +template +inline +KERNEL_PREFIX void gauss_pts(int N, Scalar* pts, Scalar* wts) +{ + const Scalar x2 = 0.577350269; // 1.0/sqrt(3.0) + const Scalar x3 = 0.77459667; // sqrt(3.0/5.0) + const Scalar w1 = 0.55555556; // 5.0/9.0 + const Scalar w2 = 0.88888889; // 8.0/9.0 + + switch(N) { + case 1: + pts[0] = 0.0; wts[0] = 2.0; + break; + case 2: + pts[0] = -x2; wts[0] = 1.0; + pts[1] = x2; wts[1] = 1.0; + break; + case 3: + pts[0] = -x3; wts[0] = w1; + pts[1] = 0.0; wts[1] = w2; + pts[2] = x3; wts[2] = w1; + break; + default: + break; + } +} + +}//namespace miniFE + +#endif + diff --git a/tests/apps/miniFE/tests/fem/matrix_algebra_3x3.hpp b/tests/apps/miniFE/tests/fem/matrix_algebra_3x3.hpp new file mode 100644 index 0000000000..012ae826f8 --- /dev/null +++ b/tests/apps/miniFE/tests/fem/matrix_algebra_3x3.hpp @@ -0,0 +1,166 @@ +#ifndef _matrix_algebra_3x3_hpp_ +#define _matrix_algebra_3x3_hpp_ + +//@HEADER +// ************************************************************************ +// +// MiniFE: Simple Finite Element Assembly and Solve +// Copyright (2006-2013) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA +// +// ************************************************************************ +//@HEADER + +#ifndef KERNEL_PREFIX +#define KERNEL_PREFIX +#endif + +namespace miniFE { + +template +#ifdef __CUDACC__ + __host__ __device__ +#endif +KERNEL_PREFIX void fill(Scalar* begin, Scalar* end, const Scalar& val) +{ + while(begin != end) {*begin++ = val;} +} + +template +KERNEL_PREFIX void inverse_and_determinant3x3(const Scalar* J, Scalar* invJ, Scalar& detJ) +{ + //hardwired "3x3" in function-name allows us to assume + //that J and invJ have length 9: + + Scalar J00 = J[0]; + Scalar J01 = J[1]; + Scalar J02 = J[2]; + + Scalar J10 = J[3]; + Scalar J11 = J[4]; + Scalar J12 = J[5]; + + Scalar J20 = J[6]; + Scalar J21 = J[7]; + Scalar J22 = J[8]; + + Scalar term0 = J22*J11 - J21*J12; + Scalar term1 = J22*J01 - J21*J02; + Scalar term2 = J12*J01 - J11*J02; + + detJ = J00*term0 - J10*term1 + J20*term2; + + Scalar inv_detJ = 1.0/detJ; + + invJ[0] = term0*inv_detJ; + invJ[1] = -term1*inv_detJ; + invJ[2] = term2*inv_detJ; + + invJ[3] = -(J22*J10 - J20*J12)*inv_detJ; + invJ[4] = (J22*J00 - J20*J02)*inv_detJ; + invJ[5] = -(J12*J00 - J10*J02)*inv_detJ; + + invJ[6] = (J21*J10 - J20*J11)*inv_detJ; + invJ[7] = -(J21*J00 - J20*J01)*inv_detJ; + invJ[8] = (J11*J00 - J10*J01)*inv_detJ; +} + +template +KERNEL_PREFIX void matmat3x3(const Scalar* A, const Scalar* B, Scalar* C) +{ + //hardwired "3x3" in function-name allows us to assume args have length 9: + //A,B,C are all assumed to be ordered such that columns are contiguous. + + const Scalar zero = 0; + miniFE::fill(C, C+9, zero); + + for(int i=0; i<3; ++i) { + for(int j=0; j<3; ++j) { + C[i+j*3] = A[i+0]*B[j*3+0] + + A[i+3]*B[j*3+1] + + A[i+6]*B[j*3+2]; + } + } +} + +template +KERNEL_PREFIX Scalar determinant3x3(const Scalar* J) +{ + //hardwired "3x3" in function-name allows us to assume that J has length 9: + + Scalar J00 = J[0]; + Scalar J01 = J[1]; + Scalar J02 = J[2]; + + Scalar J10 = J[3]; + Scalar J11 = J[4]; + Scalar J12 = J[5]; + + Scalar J20 = J[6]; + Scalar J21 = J[7]; + Scalar J22 = J[8]; + + Scalar term0 = J22*J11 - J21*J12; + Scalar term1 = J22*J01 - J21*J02; + Scalar term2 = J12*J01 - J11*J02; + + Scalar detJ = J00*term0 - J10*term1 + J20*term2; + + return detJ; +} + +template +KERNEL_PREFIX void matmat3x3_X_3xn(const Scalar* A, int n, const Scalar* B, Scalar* C) +{ + //A is 3x3, B is 3xn. So C is also 3xn. + //A,B,C are all assumed to be ordered such that columns are contiguous. + + Scalar* Cj = C; + const Scalar* Bj = B; + for(int j=0; j +KERNEL_PREFIX void matTransMat3x3_X_3xn(const Scalar* A, int n, const Scalar* B, Scalar* C) +{ + //A is 3x3, B is 3xn. So C is also 3xn. + //A,B,C are all assumed to be ordered such that columns are contiguous. + + Scalar* Cj = C; + const Scalar* Bj = B; + for(int j=0; j +#include +#include +#include + +#include +#include +#include +#include + +#ifdef HAVE_MPI +#include +#endif + +namespace miniFE { + +template +struct err_info { + Scalar err; + Scalar computed; + Scalar analytic; + Scalar coords[3]; +}; + +template +int +verify_solution(const simple_mesh_description& mesh, + const VectorType& x, double tolerance, bool verify_whole_domain = false) +{ + typedef typename VectorType::GlobalOrdinalType GlobalOrdinal; + typedef typename VectorType::ScalarType Scalar; + + int global_nodes_x = mesh.global_box[0][1]+1; + int global_nodes_y = mesh.global_box[1][1]+1; + int global_nodes_z = mesh.global_box[2][1]+1; + Box box; + copy_box(mesh.local_box, box); + + //num-owned-nodes in each dimension is num-elems+1 + //only if num-elems > 0 in that dimension *and* + //we are at the high end of the global range in that dimension: + if (box[0][1] > box[0][0] && box[0][1] == mesh.global_box[0][1]) ++box[0][1]; + if (box[1][1] > box[1][0] && box[1][1] == mesh.global_box[1][1]) ++box[1][1]; + if (box[2][1] > box[2][0] && box[2][1] == mesh.global_box[2][1]) ++box[2][1]; + + std::vector rows; + std::vector row_coords; + + int roffset = 0; + for(int iz=box[2][0]; iz(global_nodes_x, global_nodes_y, global_nodes_z, + ix, iy, iz); + Scalar x, y, z; + get_coords(row_id, global_nodes_x, global_nodes_y, global_nodes_z, x, y, z); + + bool verify_this_point = false; + if (verify_whole_domain) verify_this_point = true; + else if (std::abs(x - 0.5) < 0.05 && std::abs(y - 0.5) < 0.05 && std::abs(z - 0.5) < 0.05) { + verify_this_point = true; + } + + if (verify_this_point) { + rows.push_back(roffset); + row_coords.push_back(x); + row_coords.push_back(y); + row_coords.push_back(z); + } + + ++roffset; + } + } + } + + int return_code = 0; + + const int num_terms = 300; + + err_info max_error; + max_error.err = 0.0; + + for(size_t i=0; i max_error.err) { + max_error.err = err; + max_error.computed = computed_soln; + max_error.analytic = analytic_soln; + max_error.coords[0] = x; + max_error.coords[1] = y; + max_error.coords[2] = z; + } + } + + Scalar local_max_err = max_error.err; + Scalar global_max_err = 0; +#ifdef HAVE_MPI + MPI_Allreduce(&local_max_err, &global_max_err, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); +#else + global_max_err = local_max_err; +#endif + + if (local_max_err == global_max_err) { + if (max_error.err > tolerance) { + std::cout << "max absolute error is "< tolerance) { + return_code = 1; + } + + return return_code; +} + +}//namespace miniFE + +#endif + diff --git a/tests/apps/miniFE/tests/rm_execution_multi_host b/tests/apps/miniFE/tests/rm_execution_multi_host new file mode 100755 index 0000000000..00535b16a0 --- /dev/null +++ b/tests/apps/miniFE/tests/rm_execution_multi_host @@ -0,0 +1,61 @@ +#!../../../common/bats/bin/bats +# -*-sh-*- + +load ../../../common/test_helper_functions || exit 1 +source ../../../common/functions || exit 1 + +if [ -s ./TEST_ENV ];then + . ./TEST_ENV +else + ERROR "TEST_ENV does not exist" +fi + +rm=$RESOURCE_MANAGER + +# init run options +nx=256 +ny=$nx +nz=$nx + +NODES=$((NUM_COMPUTES < TEST_MAX_COMPUTES ? NUM_COMPUTES : TEST_MAX_COMPUTES)) +TASKS=$((NODES*TEST_NUM_RANKS)) +ARGS="nx=$nx ny=$ny nz=$nz verify_solution=$TEST_VERIFY" +EXE=$TEST_EXE.$LMOD_FAMILY_COMPILER.$LMOD_FAMILY_MPI + +# set global env settings +export OMP_NUM_THREADS=$TEST_NUM_THREADS +if [ $LMOD_FAMILY_MPI == "mvapich2" ];then + export MV2_ENABLE_AFFINITY=0 + export IPATH_NO_CPUAFFINITY=1 +fi + +@test "[Apps/miniFE] run miniFE on multi nodes under resource manager ($rm/$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + if [ ! -x $EXE ];then + flunk "missing $EXE" + fi + + run_mpi_binary -t $CMD_TIMEOUT $EXE "$ARGS" $NODES $TASKS + assert_success +} + +@test "[Apps/miniFE] log miniFE multi node results ($rm/$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + run_tag=miniFE.${nx}x${ny}x${nz}.P${TASKS} + run_yaml=`ls -t $run_tag.*.yaml | head -n 1` + wrk_yaml=$run_tag.$LMOD_FAMILY_COMPILER.$LMOD_FAMILY_MPI.yaml + mv $run_yaml $wrk_yaml || exit 1 + + str="Total Program Time" + ref_time=`grep $str ref/$wrk_yaml | cut -d ' ' -f4` + cur_time=`grep $str $wrk_yaml | cut -d ' ' -f4` + + if [ -z $ref_time ];then + ref_time="?" + fi + + if [ -z $cur_time ];then + cur_time="?" + fi + + fmt="%-24s %-10s %-10s %16s %16s\n" + printf "$fmt" $run_tag $LMOD_FAMILY_COMPILER $LMOD_FAMILY_MPI $ref_time $cur_time >>$TEST_PERFLOG +} diff --git a/tests/apps/miniFE/tests/rm_execution_single_host b/tests/apps/miniFE/tests/rm_execution_single_host new file mode 100755 index 0000000000..4b9e2c8318 --- /dev/null +++ b/tests/apps/miniFE/tests/rm_execution_single_host @@ -0,0 +1,62 @@ +#!../../../common/bats/bin/bats --tap +# -*-sh-*- + +load ../../../common/test_helper_functions || exit 1 +source ../../../common/functions || exit 1 + +if [ -s ./TEST_ENV ];then + . ./TEST_ENV +else + ERROR "TEST_ENV does not exist" +fi + +rm=$RESOURCE_MANAGER + +# init run options +nx=100 +ny=$nx +nz=$nx + +NODES=1 +TASKS=$((NODES*TEST_NUM_RANKS)) +ARGS="nx=$nx ny=$ny nz=$nz verify_solution=$TEST_VERIFY" +EXE=$TEST_EXE.$LMOD_FAMILY_COMPILER.$LMOD_FAMILY_MPI + +# set global env settings +export OMP_NUM_THREADS=$TEST_NUM_THREADS +if [ $LMOD_FAMILY_MPI == "mvapich2" ];then + export MV2_ENABLE_AFFINITY=0 + export IPATH_NO_CPUAFFINITY=1 +fi + +@test "[Apps/miniFE] run miniFE on single node under resource manager ($rm/$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + if [ ! -x $EXE ];then + flunk "missing $EXE" + fi + + run_mpi_binary -t $CMD_TIMEOUT $EXE "$ARGS" $NODES $TASKS + assert_success +} + +@test "[Apps/miniFE] log miniFE single node results ($rm/$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + + run_tag=miniFE.${nx}x${ny}x${nz}.P${TASKS} + run_yaml=`ls -t $run_tag.*.yaml | head -n 1` + wrk_yaml=$run_tag.$LMOD_FAMILY_COMPILER.$LMOD_FAMILY_MPI.yaml + mv $run_yaml $wrk_yaml || flunk "Unable to move ${run_yaml} file to ${work_yaml}" + + str="Total Program Time" + ref_time=`grep $str ref/$wrk_yaml | cut -d ' ' -f4` + cur_time=`grep $str $wrk_yaml | cut -d ' ' -f4` + + if [ -z $ref_time ];then + ref_time="?" + fi + + if [ -z $cur_time ];then + cur_time="?" + fi + + fmt="%-24s %-10s %-10s %16s %16s\n" + printf "$fmt" $run_tag $LMOD_FAMILY_COMPILER $LMOD_FAMILY_MPI $ref_time $cur_time >>$TEST_PERFLOG +} diff --git a/tests/apps/miniFE/tests/src/.gitignore b/tests/apps/miniFE/tests/src/.gitignore new file mode 100644 index 0000000000..e264c5147e --- /dev/null +++ b/tests/apps/miniFE/tests/src/.gitignore @@ -0,0 +1,15 @@ +*~ +*.a +*.o +*.x +*.yaml +*.linkinfo +*.log +miniFE.x.* +miniFE_info.hpp +gmon.out +gprof.* +*.TVD.* +*.mtx* +*.vec* +minife_debug* diff --git a/tests/apps/miniFE/tests/src/CSRMatrix.hpp b/tests/apps/miniFE/tests/src/CSRMatrix.hpp new file mode 100644 index 0000000000..4ec173b349 --- /dev/null +++ b/tests/apps/miniFE/tests/src/CSRMatrix.hpp @@ -0,0 +1,152 @@ +#ifndef _CSRMatrix_hpp_ +#define _CSRMatrix_hpp_ + +//@HEADER +// ************************************************************************ +// +// MiniFE: Simple Finite Element Assembly and Solve +// Copyright (2006-2013) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA +// +// ************************************************************************ +//@HEADER + +#include +#include +#include +#ifdef HAVE_MPI +#include +#endif + +namespace miniFE { + +template +struct +CSRMatrix { + CSRMatrix() + : has_local_indices(false), + rows(), row_offsets(), row_offsets_external(), + packed_cols(), packed_coefs(), + num_cols(0) +#ifdef HAVE_MPI + ,external_index(), external_local_index(), elements_to_send(), + neighbors(), recv_length(), send_length(), send_buffer(), request() +#endif + { + } + + ~CSRMatrix() + {} + + typedef Scalar ScalarType; + typedef LocalOrdinal LocalOrdinalType; + typedef GlobalOrdinal GlobalOrdinalType; + + bool has_local_indices; + std::vector rows; + std::vector row_offsets; + std::vector row_offsets_external; + std::vector packed_cols; + std::vector packed_coefs; + LocalOrdinal num_cols; + +#ifdef HAVE_MPI + std::vector external_index; + std::vector external_local_index; + std::vector elements_to_send; + std::vector neighbors; + std::vector recv_length; + std::vector send_length; + std::vector send_buffer; + std::vector request; +#endif + + size_t num_nonzeros() const + { + return row_offsets[row_offsets.size()-1]; + } + + void reserve_space(unsigned nrows, unsigned ncols_per_row) + { + rows.resize(nrows); + row_offsets.resize(nrows+1); + + const MINIFE_GLOBAL_ORDINAL nrows_max = nrows * ncols_per_row; + packed_cols.reserve(nrows_max); + packed_coefs.reserve(nrows_max); + + #pragma omp parallel for + for(MINIFE_GLOBAL_ORDINAL i = 0; i < nrows; ++i) { + rows[i] = 0; + } + + #pragma omp parallel for + for(MINIFE_GLOBAL_ORDINAL i = 0; i < nrows + 1; ++i) { + row_offsets[i] = 0; + } + + #pragma omp parallel for + for(MINIFE_GLOBAL_ORDINAL i = 0; i < nrows_max; ++i) { + packed_cols[i] = 0; + packed_coefs[i] = 0; + } + } + + void get_row_pointers(GlobalOrdinalType row, size_t& row_length, + GlobalOrdinalType*& cols, + ScalarType*& coefs) + { + ptrdiff_t local_row = -1; + //first see if we can get the local-row index using fast direct lookup: + if (rows.size() >= 1) { + ptrdiff_t idx = row - rows[0]; + if (idx < rows.size() && rows[idx] == row) { + local_row = idx; + } + } + + //if we didn't get the local-row index using direct lookup, try a + //more expensive binary-search: + if (local_row == -1) { + typename std::vector::iterator row_iter = + std::lower_bound(rows.begin(), rows.end(), row); + + //if we still haven't found row, it's not local so jump out: + if (row_iter == rows.end() || *row_iter != row) { + row_length = 0; + return; + } + + local_row = row_iter - rows.begin(); + } + + LocalOrdinalType offset = row_offsets[local_row]; + row_length = row_offsets[local_row+1] - offset; + cols = &packed_cols[offset]; + coefs = &packed_coefs[offset]; + } +}; + +}//namespace miniFE + +#endif + diff --git a/tests/apps/miniFE/tests/src/ELLMatrix.hpp b/tests/apps/miniFE/tests/src/ELLMatrix.hpp new file mode 100644 index 0000000000..f405f6d4a2 --- /dev/null +++ b/tests/apps/miniFE/tests/src/ELLMatrix.hpp @@ -0,0 +1,139 @@ +#ifndef _ELLMatrix_hpp_ +#define _ELLMatrix_hpp_ + +//@HEADER +// ************************************************************************ +// +// MiniFE: Simple Finite Element Assembly and Solve +// Copyright (2006-2013) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA +// +// ************************************************************************ +//@HEADER + +#include +#include +#include +#ifdef HAVE_MPI +#include +#endif + +namespace miniFE { + +template +struct +ELLMatrix { + ELLMatrix() + : has_local_indices(false), + rows(), + cols(), coefs(), + num_cols(0), + num_cols_per_row(0) +#ifdef HAVE_MPI + ,external_index(), external_local_index(), elements_to_send(), + neighbors(), recv_length(), send_length(), send_buffer(), request() +#endif + { + } + + ~ELLMatrix() + {} + + typedef Scalar ScalarType; + typedef LocalOrdinal LocalOrdinalType; + typedef GlobalOrdinal GlobalOrdinalType; + + bool has_local_indices; + std::vector rows; + std::vector cols; + std::vector coefs; + LocalOrdinal num_cols; + LocalOrdinal num_cols_per_row; + +#ifdef HAVE_MPI + std::vector external_index; + std::vector external_local_index; + std::vector elements_to_send; + std::vector neighbors; + std::vector recv_length; + std::vector send_length; + std::vector send_buffer; + std::vector request; +#endif + + size_t num_nonzeros() const + { + return rows.size()*num_cols_per_row; + } + + void reserve_space(unsigned nrows, unsigned ncols_per_row) + { + rows.resize(nrows); + cols.resize(nrows * ncols_per_row); + coefs.resize(nrows * ncols_per_row); + num_cols_per_row = ncols_per_row; + } + + void get_row_pointers(GlobalOrdinalType row, size_t& row_length, + GlobalOrdinalType*& cols_ptr, + ScalarType*& coefs_ptr) + { + ptrdiff_t local_row = -1; + //first see if we can get the local-row index using fast direct lookup: + if (rows.size() >= 1) { + ptrdiff_t idx = row - rows[0]; + if (idx < rows.size() && rows[idx] == row) { + local_row = idx; + } + } + + //if we didn't get the local-row index using direct lookup, try a + //more expensive binary-search: + if (local_row == -1) { + typename std::vector::iterator row_iter = + std::lower_bound(rows.begin(), rows.end(), row); + + //if we still haven't found row, it's not local so jump out: + if (row_iter == rows.end() || *row_iter != row) { + row_length = 0; + return; + } + + local_row = row_iter - rows.begin(); + } + + cols_ptr = &cols[local_row*num_cols_per_row]; + coefs_ptr = &coefs[local_row*num_cols_per_row]; + + int idx = num_cols_per_row-1; + while(idx>=0) { + if (cols_ptr[idx] != 0) break; + --idx; + } + row_length = idx+1; + } +}; + +}//namespace miniFE + +#endif + diff --git a/tests/apps/miniFE/tests/src/GetNodesCoords.hpp b/tests/apps/miniFE/tests/src/GetNodesCoords.hpp new file mode 100644 index 0000000000..5278dd1d8b --- /dev/null +++ b/tests/apps/miniFE/tests/src/GetNodesCoords.hpp @@ -0,0 +1,51 @@ +//@HEADER +// ************************************************************************ +// +// MiniFE: Simple Finite Element Assembly and Solve +// Copyright (2006-2013) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA +// +// ************************************************************************ +//@HEADER + +#ifndef _GETNODESCOORDS_HPP_ +#define _GETNODESCOORDS_HPP_ + +#include +#include + +template +struct GetNodesCoords { + const miniFE::simple_mesh_description* mesh; + GlobalOrdinal* elemIDs; + GlobalOrdinal* node_ordinals; + Scalar* elem_node_coords; + +inline void operator()(int i) +{ + unsigned nnodes = miniFE::Hex8::numNodesPerElem; + GlobalOrdinal elemID = elemIDs[i]; + GlobalOrdinal* node_ords = node_ordinals+i*nnodes; + Scalar* node_coords = elem_node_coords+i*nnodes*miniFE::Hex8::spatialDim; + get_elem_nodes_and_coords(*mesh, elemID, node_ords, node_coords); +} +}; + +#endif diff --git a/tests/apps/miniFE/tests/src/Hex8_box_utils.hpp b/tests/apps/miniFE/tests/src/Hex8_box_utils.hpp new file mode 100644 index 0000000000..da38684603 --- /dev/null +++ b/tests/apps/miniFE/tests/src/Hex8_box_utils.hpp @@ -0,0 +1,173 @@ +#ifndef _Hex8_box_utils_hpp_ +#define _Hex8_box_utils_hpp_ + +//@HEADER +// ************************************************************************ +// +// MiniFE: Simple Finite Element Assembly and Solve +// Copyright (2006-2013) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA +// +// ************************************************************************ +//@HEADER + +#include + +#include +#include +#include +#include + +namespace miniFE { + + +template +void get_hex8_node_ids(int nx, int ny, + GlobalOrdinal node0, + GlobalOrdinal* elem_node_ids) +{ +//Given box dimensions nx and ny, and a starting node +//(local-node-0 for a hex8), compute the other nodes +//of the hex8 using the exodus ordering convention. + elem_node_ids[0] = node0; + elem_node_ids[1] = node0 + 1; + elem_node_ids[2] = node0 + nx + 1; + elem_node_ids[3] = node0 + nx; + elem_node_ids[4] = node0 + nx*ny; + elem_node_ids[5] = node0 + 1 + nx*ny; + elem_node_ids[6] = node0 + nx + nx*ny + 1; + elem_node_ids[7] = node0 + nx + nx*ny; +} + +template +void get_hex8_node_coords_3d(Scalar x, Scalar y, Scalar z, + Scalar hx, Scalar hy, Scalar hz, + Scalar* elem_node_coords) +{ + //Input: x,y,z are the coordinates of local-node 0 for a Hex8. + //'hx', 'hy', 'hz' are the lengths of the sides of the element + //in each direction. + + elem_node_coords[0] = x; + elem_node_coords[1] = y; + elem_node_coords[2] = z; + + elem_node_coords[3] = x + hx; + elem_node_coords[4] = y; + elem_node_coords[5] = z; + + elem_node_coords[6] = x + hx; + elem_node_coords[7] = y + hy; + elem_node_coords[8] = z; + + elem_node_coords[9] = x; + elem_node_coords[10] = y + hy; + elem_node_coords[11] = z; + + elem_node_coords[12] = x; + elem_node_coords[13] = y; + elem_node_coords[14] = z + hz; + + elem_node_coords[15] = x + hx; + elem_node_coords[16] = y; + elem_node_coords[17] = z + hz; + + elem_node_coords[18] = x + hx; + elem_node_coords[19] = y + hy; + elem_node_coords[20] = z + hz; + + elem_node_coords[21] = x; + elem_node_coords[22] = y + hy; + elem_node_coords[23] = z + hz; +} + +template +void +get_elem_nodes_and_coords(const simple_mesh_description& mesh, + GlobalOrdinal elemID, + GlobalOrdinal* node_ords, Scalar* node_coords) +{ + int global_nodes_x = mesh.global_box[0][1]+1; + int global_nodes_y = mesh.global_box[1][1]+1; + int global_nodes_z = mesh.global_box[2][1]+1; + + if (elemID < 0) { + //I don't think this can happen, but check for the sake of paranoia... + throw std::runtime_error("get_elem_nodes_and_coords ERROR, negative elemID"); + } + + int elem_int_x, elem_int_y, elem_int_z; + get_int_coords(elemID, global_nodes_x-1, global_nodes_y-1, global_nodes_z-1, + elem_int_x, elem_int_y, elem_int_z); + GlobalOrdinal nodeID = get_id(global_nodes_x, global_nodes_y, global_nodes_z, elem_int_x, elem_int_y, elem_int_z); + +#ifdef MINIFE_DEBUG_VERBOSE + std::cout<<"\nelemID: "<(nodeID, global_nodes_x,global_nodes_y,global_nodes_z, + ix,iy,iz); + Scalar hx = 1.0/global_elems_x; + Scalar hy = 1.0/global_elems_y; + Scalar hz = 1.0/global_elems_z; + get_hex8_node_coords_3d(ix, iy, iz, hx, hy, hz, node_coords); +#ifdef MINIFE_DEBUG_VERBOSE + int offset = 0; + for(int i=0; i +void +get_elem_nodes_and_coords(const simple_mesh_description& mesh, + GlobalOrdinal elemID, + ElemData& elem_data) +{ + get_elem_nodes_and_coords(mesh, elemID, elem_data.elem_node_ids, elem_data.elem_node_coords); +} + +}//namespace miniFE + +#endif + diff --git a/tests/apps/miniFE/tests/src/Makefile.cray b/tests/apps/miniFE/tests/src/Makefile.cray new file mode 100644 index 0000000000..42e510c3ec --- /dev/null +++ b/tests/apps/miniFE/tests/src/Makefile.cray @@ -0,0 +1,41 @@ +#----------------------------------------------------------------------- +# This file compiles for OpenMP and MPI hybrid operations using the GNU +# compile chain. + +MINIFE_TYPES = \ + -DMINIFE_SCALAR=double \ + -DMINIFE_LOCAL_ORDINAL=int \ + -DMINIFE_GLOBAL_ORDINAL=int + +MINIFE_MATRIX_TYPE = -DMINIFE_CSR_MATRIX +#MINIFE_MATRIX_TYPE = -DMINIFE_ELL_MATRIX + +#----------------------------------------------------------------------- + +MPIDIR=/opt/cray/mpt/6.0.1/gni/mpich2-cray64/81/ + +CFLAGS = -O3 +CXXFLAGS = $(CFLAGS) -I $(MPIDIR)/include + +CPPFLAGS = -I. -I../utils -I../fem $(MINIFE_TYPES) \ + $(MINIFE_MATRIX_TYPE) \ + -DMINIFE_RESTRICT=restrict \ + -DHAVE_MPI -DMPICH_IGNORE_CXX_SEEK + +LDFLAGS=$(CFLAGS) +LIBS=-L$(MPIDIR)/lib \ + -lmpichcxx_cray + +# The MPICH_IGNORE_CXX_SEEK macro is required for some mpich versions, +# such as the one on my cygwin machine. + +#CXX=mpiicpc +#CC=mpiicc + +#CXX=g++ +#CC=g++ + +CXX=CC +CC=cc + +include make_targets diff --git a/tests/apps/miniFE/tests/src/Makefile.gnu.openmp b/tests/apps/miniFE/tests/src/Makefile.gnu.openmp new file mode 100644 index 0000000000..9e4011d330 --- /dev/null +++ b/tests/apps/miniFE/tests/src/Makefile.gnu.openmp @@ -0,0 +1,33 @@ +#----------------------------------------------------------------------- +# ATTENTION: +# +# This file does not enable MPI in the binary, this is just OpenMP +# only. To enable MPI calls add -DHAVE_MPI to CPPFLAGS +# +#----------------------------------------------------------------------- + +MINIFE_TYPES = \ + -DMINIFE_SCALAR=double \ + -DMINIFE_LOCAL_ORDINAL=int \ + -DMINIFE_GLOBAL_ORDINAL=int + +MINIFE_MATRIX_TYPE = -DMINIFE_CSR_MATRIX +# MINIFE_MATRIX_TYPE = -DMINIFE_ELL_MATRIX + +#----------------------------------------------------------------------- + +CFLAGS = -O3 -fopenmp +CXXFLAGS = $(CFLAGS) + +CPPFLAGS = -I. -I../utils -I../fem $(MINIFE_TYPES) $(MINIFE_MATRIX_TYPE) \ + -DMINIFE_RESTRICT="" + +LDFLAGS= +LIBS= + +CXX=g++ +CC=gcc + +#----------------------------------------------------------------------- + +include make_targets diff --git a/tests/apps/miniFE/tests/src/Makefile.intel.openmp b/tests/apps/miniFE/tests/src/Makefile.intel.openmp new file mode 100644 index 0000000000..087ab8d30d --- /dev/null +++ b/tests/apps/miniFE/tests/src/Makefile.intel.openmp @@ -0,0 +1,33 @@ +#----------------------------------------------------------------------- +# ATTENTION: +# +# This file does not enable MPI in the binary, this is just OpenMP +# only. To enable MPI calls add -DHAVE_MPI to CPPFLAGS +# +#----------------------------------------------------------------------- + +MINIFE_TYPES = \ + -DMINIFE_SCALAR=double \ + -DMINIFE_LOCAL_ORDINAL=int \ + -DMINIFE_GLOBAL_ORDINAL=int + +MINIFE_MATRIX_TYPE = -DMINIFE_CSR_MATRIX +# MINIFE_MATRIX_TYPE = -DMINIFE_ELL_MATRIX + +#----------------------------------------------------------------------- + +CFLAGS = -O3 -openmp -restrict -mavx +CXXFLAGS = $(CFLAGS) + +CPPFLAGS = -I. -I../utils -I../fem $(MINIFE_TYPES) $(MINIFE_MATRIX_TYPE) \ + -DMINIFE_RESTRICT=restrict + +LDFLAGS= +LIBS= + +CXX=icpc +CC=icc + +#----------------------------------------------------------------------- + +include make_targets diff --git a/tests/apps/miniFE/tests/src/Makefile.ohpc b/tests/apps/miniFE/tests/src/Makefile.ohpc new file mode 100644 index 0000000000..0facd4229a --- /dev/null +++ b/tests/apps/miniFE/tests/src/Makefile.ohpc @@ -0,0 +1,54 @@ +#----------------------------------------------------------------------- +# ATTENTION: +# +# This file does not enable MPI in the binary, this is just OpenMP +# only. To enable MPI calls add -DHAVE_MPI to CPPFLAGS +# +#----------------------------------------------------------------------- + +MINIFE_TYPES = \ + -DMINIFE_SCALAR=double \ + -DMINIFE_LOCAL_ORDINAL=int \ + -DMINIFE_GLOBAL_ORDINAL=int + +MINIFE_MATRIX_TYPE = -DMINIFE_CSR_MATRIX +# MINIFE_MATRIX_TYPE = -DMINIFE_ELL_MATRIX + +#----------------------------------------------------------------------- + +CFLAGS = -O3 + +ifeq ($(LMOD_FAMILY_COMPILER),intel) + CFLAGS += -openmp -restrict -mavx +else + CFLAGS += -fopenmp +endif + +CXXFLAGS = $(CFLAGS) + +CPPFLAGS = -I. -I../utils -I../fem $(MINIFE_TYPES) $(MINIFE_MATRIX_TYPE) + +ifeq ($(LMOD_FAMILY_COMPILER),intel) + CPPFLAGS += -DMINIFE_RESTRICT=restrict +else + CPPFLAGS += -DMINIFE_RESTRICT="" +endif + +LDFLAGS= +LIBS= + +CXX=icpc +CC=icc + +#----------------------------------------------------------------------- + +# MPI +ifdef LMOD_FAMILY_MPI + CXX = mpicxx + CC = mpicc + CPPFLAGS += -DHAVE_MPI -DMPICH_IGNORE_CXX_SEEK +endif + +#----------------------------------------------------------------------- + +include make_targets diff --git a/tests/apps/miniFE/tests/src/MatrixCopyOp.hpp b/tests/apps/miniFE/tests/src/MatrixCopyOp.hpp new file mode 100644 index 0000000000..9d24be0075 --- /dev/null +++ b/tests/apps/miniFE/tests/src/MatrixCopyOp.hpp @@ -0,0 +1,60 @@ +//@HEADER +// ************************************************************************ +// +// MiniFE: Simple Finite Element Assembly and Solve +// Copyright (2006-2013) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA +// +// ************************************************************************ +//@HEADER + +#ifndef _MatrixCopyOp_hpp_ +#define _MatrixCopyOp_hpp_ + +template +struct MatrixCopyOp { + typedef typename MatrixType::GlobalOrdinalType GlobalOrdinalType; + typedef typename MatrixType::LocalOrdinalType LocalOrdinalType; + typedef typename MatrixType::ScalarType ScalarType; + + const GlobalOrdinalType* src_rows; + const LocalOrdinalType* src_rowoffsets; + const GlobalOrdinalType* src_cols; + const ScalarType* src_coefs; + + GlobalOrdinalType* dest_rows; + LocalOrdinalType* dest_rowoffsets; + GlobalOrdinalType* dest_cols; + ScalarType* dest_coefs; + int n; + + inline void operator()(int i) + { + dest_rows[i] = src_rows[i]; + dest_rowoffsets[i] = src_rowoffsets[i]; + for(int j=src_rowoffsets[i]; j +#include + +#include +#include + +#include + +template +void sort_if_needed(GlobalOrdinal* list, + GlobalOrdinal list_len) +{ + bool need_to_sort = false; + for(GlobalOrdinal i=list_len-1; i>=1; --i) { + if (list[i] < list[i-1]) { + need_to_sort = true; + break; + } + } + + if (need_to_sort) { + std::sort(list,list+list_len); + } +} + +template +struct MatrixInitOp { +}; + +template<> +struct MatrixInitOp > { + MatrixInitOp(const std::vector& rows_vec, + const std::vector& row_offsets_vec, + const std::vector& row_coords_vec, + int global_nx, int global_ny, int global_nz, + MINIFE_GLOBAL_ORDINAL global_n_rows, + const miniFE::simple_mesh_description& input_mesh, + miniFE::CSRMatrix& matrix) + : rows(&rows_vec[0]), + row_offsets(&row_offsets_vec[0]), + row_coords(&row_coords_vec[0]), + global_nodes_x(global_nx), + global_nodes_y(global_ny), + global_nodes_z(global_nz), + global_nrows(global_n_rows), + mesh(&input_mesh), + dest_rows(&matrix.rows[0]), + dest_rowoffsets(&matrix.row_offsets[0]), + dest_cols(&matrix.packed_cols[0]), + dest_coefs(&matrix.packed_coefs[0]), + n(matrix.rows.size()) + { + if (matrix.packed_cols.capacity() != matrix.packed_coefs.capacity()) { + std::cout<<"Warning, packed_cols.capacity ("<* mesh; + + inline void operator()(int i) + { + dest_rows[i] = rows[i]; + int offset = row_offsets[i]; + dest_rowoffsets[i] = offset; + int ix = row_coords[i*3]; + int iy = row_coords[i*3+1]; + int iz = row_coords[i*3+2]; + GlobalOrdinalType nnz = 0; + for(int sz=-1; sz<=1; ++sz) { + for(int sy=-1; sy<=1; ++sy) { + for(int sx=-1; sx<=1; ++sx) { + GlobalOrdinalType col_id = + miniFE::get_id(global_nodes_x, global_nodes_y, global_nodes_z, + ix+sx, iy+sy, iz+sz); + if (col_id >= 0 && col_id < global_nrows) { + GlobalOrdinalType col = mesh->map_id_to_row(col_id); + dest_cols[offset+nnz] = col; + dest_coefs[offset+nnz] = 0; + ++nnz; + } + } + } + } + + sort_if_needed(&dest_cols[offset], nnz); + } +}; + +template<> +struct MatrixInitOp > { + MatrixInitOp(const std::vector& rows_vec, + const std::vector& /*row_offsets_vec*/, + const std::vector& row_coords_vec, + int global_nx, int global_ny, int global_nz, + MINIFE_GLOBAL_ORDINAL global_n_rows, + const miniFE::simple_mesh_description& input_mesh, + miniFE::ELLMatrix& matrix) + : rows(&rows_vec[0]), + row_coords(&row_coords_vec[0]), + global_nodes_x(global_nx), + global_nodes_y(global_ny), + global_nodes_z(global_nz), + global_nrows(global_n_rows), + mesh(&input_mesh), + dest_rows(&matrix.rows[0]), + dest_cols(&matrix.cols[0]), + dest_coefs(&matrix.coefs[0]), + n(matrix.rows.size()), + ncols_per_row(matrix.num_cols_per_row) + { + } + + typedef MINIFE_GLOBAL_ORDINAL GlobalOrdinalType; + typedef MINIFE_LOCAL_ORDINAL LocalOrdinalType; + typedef MINIFE_SCALAR ScalarType; + + const GlobalOrdinalType* rows; + const int* row_coords; + + int global_nodes_x; + int global_nodes_y; + int global_nodes_z; + + GlobalOrdinalType global_nrows; + + GlobalOrdinalType* dest_rows; + GlobalOrdinalType* dest_cols; + ScalarType* dest_coefs; + int n; + int ncols_per_row; + + const miniFE::simple_mesh_description* mesh; + + inline void operator()(int i) + { + dest_rows[i] = rows[i]; + int offset = i*ncols_per_row; + int ix = row_coords[i*3]; + int iy = row_coords[i*3+1]; + int iz = row_coords[i*3+2]; + GlobalOrdinalType nnz = 0; + for(int sz=-1; sz<=1; ++sz) + for(int sy=-1; sy<=1; ++sy) + for(int sx=-1; sx<=1; ++sx) { + GlobalOrdinalType col_id = + miniFE::get_id(global_nodes_x, global_nodes_y, global_nodes_z, + ix+sx, iy+sy, iz+sz); + if (col_id >= 0 && col_id < global_nrows) { + GlobalOrdinalType col = mesh->map_id_to_row(col_id); + dest_cols[offset+nnz] = col; + dest_coefs[offset+nnz] = 0; + ++nnz; + } + } + + sort_if_needed(&dest_cols[offset], nnz); + } +}; + +#endif + diff --git a/tests/apps/miniFE/tests/src/SparseMatrix_functions.hpp b/tests/apps/miniFE/tests/src/SparseMatrix_functions.hpp new file mode 100644 index 0000000000..e883f79b66 --- /dev/null +++ b/tests/apps/miniFE/tests/src/SparseMatrix_functions.hpp @@ -0,0 +1,722 @@ +#ifndef _SparseMatrix_functions_hpp_ +#define _SparseMatrix_functions_hpp_ + +//@HEADER +// ************************************************************************ +// +// MiniFE: Simple Finite Element Assembly and Solve +// Copyright (2006-2013) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA +// +// ************************************************************************ +//@HEADER + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#ifdef MINIFE_HAVE_TBB +#include +#endif + +#ifdef HAVE_MPI +#include +#endif + +namespace miniFE { + +template +void init_matrix(MatrixType& M, + const std::vector& rows, + const std::vector& row_offsets, + const std::vector& row_coords, + int global_nodes_x, + int global_nodes_y, + int global_nodes_z, + typename MatrixType::GlobalOrdinalType global_nrows, + const simple_mesh_description& mesh) +{ + MatrixInitOp mat_init(rows, row_offsets, row_coords, + global_nodes_x, global_nodes_y, global_nodes_z, + global_nrows, mesh, M); + + for(int i=0; i +void sort_with_companions(ptrdiff_t len, T* array, U* companions) +{ + ptrdiff_t i, j, index; + U companion; + + for (i=1; i < len; i++) { + index = array[i]; + companion = companions[i]; + j = i; + while ((j > 0) && (array[j-1] > index)) + { + array[j] = array[j-1]; + companions[j] = companions[j-1]; + j = j - 1; + } + array[j] = index; + companions[j] = companion; + } +} + +template +void write_matrix(const std::string& filename, + MatrixType& mat) +{ + typedef typename MatrixType::LocalOrdinalType LocalOrdinalType; + typedef typename MatrixType::GlobalOrdinalType GlobalOrdinalType; + typedef typename MatrixType::ScalarType ScalarType; + + int numprocs = 1, myproc = 0; +#ifdef HAVE_MPI + MPI_Comm_size(MPI_COMM_WORLD, &numprocs); + MPI_Comm_rank(MPI_COMM_WORLD, &myproc); +#endif + + std::ostringstream osstr; + osstr << filename << "." << numprocs << "." << myproc; + std::string full_name = osstr.str(); + std::ofstream ofs(full_name.c_str()); + + size_t nrows = mat.rows.size(); + size_t nnz = mat.num_nonzeros(); + + for(int p=0; p +void +sum_into_row(int row_len, + GlobalOrdinal* row_indices, + Scalar* row_coefs, + int num_inputs, + const GlobalOrdinal* input_indices, + const Scalar* input_coefs) +{ + for(size_t i=0; i +void +sum_into_row(typename MatrixType::GlobalOrdinalType row, + size_t num_indices, + const typename MatrixType::GlobalOrdinalType* col_inds, + const typename MatrixType::ScalarType* coefs, + MatrixType& mat) +{ + typedef typename MatrixType::GlobalOrdinalType GlobalOrdinal; + typedef typename MatrixType::ScalarType Scalar; + + size_t row_len = 0; + GlobalOrdinal* mat_row_cols = NULL; + Scalar* mat_row_coefs = NULL; + + mat.get_row_pointers(row, row_len, mat_row_cols, mat_row_coefs); + if (row_len == 0) return; + + sum_into_row(row_len, mat_row_cols, mat_row_coefs, num_indices, col_inds, coefs); +} + +template +void +sum_in_symm_elem_matrix(size_t num, + const typename MatrixType::GlobalOrdinalType* indices, + const typename MatrixType::ScalarType* coefs, + MatrixType& mat) +{ + typedef typename MatrixType::ScalarType Scalar; + typedef typename MatrixType::GlobalOrdinalType GlobalOrdinal; + +//indices is length num (which should be nodes-per-elem) +//coefs is the upper triangle of the element diffusion matrix +//which should be length num*(num+1)/2 +//std::cout< +void +sum_in_elem_matrix(size_t num, + const typename MatrixType::GlobalOrdinalType* indices, + const typename MatrixType::ScalarType* coefs, + MatrixType& mat) +{ + size_t offset = 0; + + for(size_t i=0; i +void +sum_into_global_linear_system(ElemData& elem_data, + MatrixType& A, VectorType& b) +{ + sum_in_symm_elem_matrix(elem_data.nodes_per_elem, elem_data.elem_node_ids, + elem_data.elem_diffusion_matrix, A); + sum_into_vector(elem_data.nodes_per_elem, elem_data.elem_node_ids, + elem_data.elem_source_vector, b); +} + +#ifdef MINIFE_HAVE_TBB +template +void +sum_in_elem_matrix(size_t num, + const typename MatrixType::GlobalOrdinalType* indices, + const typename MatrixType::ScalarType* coefs, + LockingMatrix& mat) +{ + size_t offset = 0; + + for(size_t i=0; i +void +sum_into_global_linear_system(ElemData& elem_data, + LockingMatrix& A, LockingVector& b) +{ + sum_in_elem_matrix(elem_data.nodes_per_elem, elem_data.elem_node_ids, + elem_data.elem_diffusion_matrix, A); + sum_into_vector(elem_data.nodes_per_elem, elem_data.elem_node_ids, + elem_data.elem_source_vector, b); +} +#endif + +template +void +add_to_diagonal(typename MatrixType::ScalarType value, MatrixType& mat) +{ + for(size_t i=0; i +double +parallel_memory_overhead_MB(const MatrixType& A) +{ + typedef typename MatrixType::GlobalOrdinalType GlobalOrdinal; + typedef typename MatrixType::LocalOrdinalType LocalOrdinal; + double mem_MB = 0; + +#ifdef HAVE_MPI + double invMB = 1.0/(1024*1024); + mem_MB = invMB*A.external_index.size()*sizeof(GlobalOrdinal); + mem_MB += invMB*A.external_local_index.size()*sizeof(GlobalOrdinal); + mem_MB += invMB*A.elements_to_send.size()*sizeof(GlobalOrdinal); + mem_MB += invMB*A.neighbors.size()*sizeof(int); + mem_MB += invMB*A.recv_length.size()*sizeof(LocalOrdinal); + mem_MB += invMB*A.send_length.size()*sizeof(LocalOrdinal); + + double tmp = mem_MB; + MPI_Allreduce(&tmp, &mem_MB, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); +#endif + + return mem_MB; +} + +template +void rearrange_matrix_local_external(MatrixType& A) +{ + //This function will rearrange A so that local entries are contiguous at the front + //of A's memory, and external entries are contiguous at the back of A's memory. + // + //A.row_offsets will describe where the local entries occur, and + //A.row_offsets_external will describe where the external entries occur. + + typedef typename MatrixType::GlobalOrdinalType GlobalOrdinal; + typedef typename MatrixType::LocalOrdinalType LocalOrdinal; + typedef typename MatrixType::ScalarType Scalar; + + size_t nrows = A.rows.size(); + std::vector tmp_row_offsets(nrows*2); + std::vector tmp_row_offsets_external(nrows*2); + + LocalOrdinal num_local_nz = 0; + LocalOrdinal num_extern_nz = 0; + + //First sort within each row of A, so that local entries come + //before external entries within each row. + //tmp_row_offsets describe the locations of the local entries, and + //tmp_row_offsets_external describe the locations of the external entries. + // + for(size_t i=0; i ext_cols(num_extern_nz); + std::vector ext_coefs(num_extern_nz); + std::vector ext_offsets(nrows+1); + LocalOrdinal offset = 0; + for(size_t i=0; i +void +zero_row_and_put_1_on_diagonal(MatrixType& A, typename MatrixType::GlobalOrdinalType row) +{ + typedef typename MatrixType::GlobalOrdinalType GlobalOrdinal; + typedef typename MatrixType::LocalOrdinalType LocalOrdinal; + typedef typename MatrixType::ScalarType Scalar; + + size_t row_len = 0; + GlobalOrdinal* cols = NULL; + Scalar* coefs = NULL; + A.get_row_pointers(row, row_len, cols, coefs); + + for(size_t i=0; i +void +impose_dirichlet(typename MatrixType::ScalarType prescribed_value, + MatrixType& A, + VectorType& b, + int global_nx, + int global_ny, + int global_nz, + const std::set& bc_rows) +{ + typedef typename MatrixType::GlobalOrdinalType GlobalOrdinal; + typedef typename MatrixType::LocalOrdinalType LocalOrdinal; + typedef typename MatrixType::ScalarType Scalar; + + GlobalOrdinal first_local_row = A.rows.size()>0 ? A.rows[0] : 0; + GlobalOrdinal last_local_row = A.rows.size()>0 ? A.rows[A.rows.size()-1] : -1; + + typename std::set::const_iterator + bc_iter = bc_rows.begin(), bc_end = bc_rows.end(); + for(; bc_iter!=bc_end; ++bc_iter) { + GlobalOrdinal row = *bc_iter; + if (row >= first_local_row && row <= last_local_row) { + size_t local_row = row - first_local_row; + b.coefs[local_row] = prescribed_value; + zero_row_and_put_1_on_diagonal(A, row); + } + } + + const int ROW_COUNT = A.rows.size(); + + #pragma omp parallel for + for(MINIFE_GLOBAL_ORDINAL i=0; i < ROW_COUNT; ++i) { + GlobalOrdinal row = A.rows[i]; + + if (bc_rows.find(row) != bc_rows.end()) continue; + + size_t row_length = 0; + GlobalOrdinal* cols = NULL; + Scalar* coefs = NULL; + A.get_row_pointers(row, row_length, cols, coefs); + + Scalar sum = 0; + for(size_t j=0; j +struct matvec_std { +void operator()(MatrixType& A, + VectorType& x, + VectorType& y) +{ + exchange_externals(A, x); + + typedef typename MatrixType::ScalarType ScalarType; + typedef typename MatrixType::GlobalOrdinalType GlobalOrdinalType; + typedef typename MatrixType::LocalOrdinalType LocalOrdinalType; + + const MINIFE_GLOBAL_ORDINAL rows_size = A.rows.size(); + const LocalOrdinalType* const Arowoffsets = &A.row_offsets[0]; + const GlobalOrdinalType* const Acols = &A.packed_cols[0]; + const ScalarType* const Acoefs = &A.packed_coefs[0]; + const ScalarType* const xcoefs __attribute__((aligned(64))) = &x.coefs[0]; + ScalarType* ycoefs __attribute__((aligned(64))) = &y.coefs[0]; + + #pragma omp parallel for + for(MINIFE_GLOBAL_ORDINAL row = 0; row < rows_size; ++row) { + const MINIFE_GLOBAL_ORDINAL row_start = Arowoffsets[row]; + const MINIFE_GLOBAL_ORDINAL row_end = Arowoffsets[row+1]; + + MINIFE_SCALAR sum = 0; + + #pragma loop_count(15) + #pragma vector nontemporal + for(MINIFE_GLOBAL_ORDINAL i = row_start; i < row_end; ++i) { + sum += Acoefs[i] * xcoefs[Acols[i]]; + } + + ycoefs[row] = sum; + } +} +}; +#elif defined(MINIFE_ELL_MATRIX) +template +struct matvec_std { +void operator()(MatrixType& A, + VectorType& x, + VectorType& y) +{ + exchange_externals(A, x); + + typedef typename MatrixType::ScalarType ScalarType; + typedef typename MatrixType::GlobalOrdinalType GlobalOrdinalType; + typedef typename MatrixType::LocalOrdinalType LocalOrdinalType; + + int row_len = A.num_cols_per_row; + int n = A.rows.size(); + const GlobalOrdinalType* Acols = &A.cols[0]; + const ScalarType* Acoefs = &A.coefs[0]; + const ScalarType* xcoefs = &x.coefs[0]; + ScalarType* ycoefs = &y.coefs[0]; + ScalarType beta = 0; + + #pragma omp parallel for + for(int row=0; row +struct matvec_std_nowait { +void operator()(MatrixType& A, + VectorType& x, + VectorType& y) +{ + exchange_externals(A, x); + + typedef typename MatrixType::ScalarType ScalarType; + typedef typename MatrixType::GlobalOrdinalType GlobalOrdinalType; + typedef typename MatrixType::LocalOrdinalType LocalOrdinalType; + + const MINIFE_GLOBAL_ORDINAL rows_size = A.rows.size(); + const LocalOrdinalType* const Arowoffsets = &A.row_offsets[0]; + const GlobalOrdinalType* const Acols = &A.packed_cols[0]; + const ScalarType* const Acoefs = &A.packed_coefs[0]; + const ScalarType* const xcoefs = &x.coefs[0]; + ScalarType* ycoefs = &y.coefs[0]; + const ScalarType beta = 0; + + #pragma omp parallel for + for(MINIFE_GLOBAL_ORDINAL row = 0; row < rows_size; ++row) { + const MINIFE_GLOBAL_ORDINAL row_start = Arowoffsets[row]; + const MINIFE_GLOBAL_ORDINAL row_end = Arowoffsets[row+1]; + + MINIFE_SCALAR sum = 0; + + #pragma loop_count(15) + for(MINIFE_GLOBAL_ORDINAL i = row_start; i < row_end; ++i) { + sum += Acoefs[i] * xcoefs[Acols[i]]; + } + + ycoefs[row] = sum; + } +} +}; +#elif defined(MINIFE_ELL_MATRIX) +template +struct matvec_std_nowait { +void operator()(MatrixType& A, + VectorType& x, + VectorType& y) +{ + exchange_externals(A, x); + + typedef typename MatrixType::ScalarType ScalarType; + typedef typename MatrixType::GlobalOrdinalType GlobalOrdinalType; + typedef typename MatrixType::LocalOrdinalType LocalOrdinalType; + + int row_len = A.num_cols_per_row; + int n = A.rows.size(); + const GlobalOrdinalType* Acols = &A.cols[0]; + const ScalarType* Acoefs = &A.coefs[0]; + const ScalarType* xcoefs = &x.coefs[0]; + ScalarType* ycoefs = &y.coefs[0]; + ScalarType beta = 0; + + #pragma omp parallel for + for(int row=0; row +void matvec_nowait(MatrixType& A, VectorType& x, VectorType& y) +{ + matvec_std_nowait mv; + mv(A, x, y); +} + +template +void matvec(MatrixType& A, VectorType& x, VectorType& y) +{ + matvec_std mv; + mv(A, x, y); +} + +template +struct matvec_overlap { +void operator()(MatrixType& A, + VectorType& x, + VectorType& y) +{ +#ifdef HAVE_MPI + begin_exchange_externals(A, x); +#endif + + typedef typename MatrixType::ScalarType ScalarType; + typedef typename MatrixType::GlobalOrdinalType GlobalOrdinalType; + typedef typename MatrixType::LocalOrdinalType LocalOrdinalType; + + + int n = A.rows.size(); + const LocalOrdinalType* Arowoffsets = &A.row_offsets[0]; + const GlobalOrdinalType* Acols = &A.packed_cols[0]; + const ScalarType* Acoefs = &A.packed_coefs[0]; + const ScalarType* xcoefs = &x.coefs[0]; + ScalarType* ycoefs = &y.coefs[0]; + ScalarType beta = 0; + + for(int row=0; row + +#include +#include +#include +#define HUGE_PAGE_SIZE (2 * 1024 * 1024) +#define ALIGN_TO_PAGE_SIZE(x) \ + (((x) + HUGE_PAGE_SIZE - 1) / HUGE_PAGE_SIZE * HUGE_PAGE_SIZE) + +namespace miniFE { + +#ifdef __MIC__ +void *malloc_huge_pages(size_t size) +{ + // Use 1 extra page to store allocation metadata + // (libhugetlbfs is more efficient in this regard) + size_t real_size = ALIGN_TO_PAGE_SIZE(size + HUGE_PAGE_SIZE); + char *ptr = (char *)mmap(NULL, real_size, PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_ANONYMOUS | + MAP_POPULATE | MAP_HUGETLB, -1, 0); + if (ptr == MAP_FAILED) { + // The mmap() call failed. Try to malloc instead + ptr = (char *)malloc(real_size); + if (ptr == NULL) return NULL; + real_size = 0; +} + // Save real_size since mmunmap() requires a size parameter + *((size_t *)ptr) = real_size; + // Skip the page with metadata + return ptr + HUGE_PAGE_SIZE; +} +#endif + +template +struct Vector { + typedef Scalar ScalarType; + typedef LocalOrdinal LocalOrdinalType; + typedef GlobalOrdinal GlobalOrdinalType; + + Vector(GlobalOrdinal startIdx, LocalOrdinal local_sz) + : startIndex(startIdx), + local_size(local_sz)//, +// coefs(local_size) + { +#ifdef __MIC__ + coefs = (MINIFE_SCALAR*) malloc_huge_pages((sizeof(MINIFE_SCALAR) * local_size) + 64); +#else + posix_memalign((void**) &coefs, 64, sizeof(MINIFE_SCALAR) * local_size); +#endif + + if(((unsigned long long int) coefs) % 64 > 0) { + coefs = coefs + (((unsigned long long int )coefs) % 64); + } + + #pragma omp parallel for + for(MINIFE_LOCAL_ORDINAL i = 0; i < local_size; ++i) { + coefs[i] = 0; + } + } + + ~Vector() + { + } + + const GlobalOrdinal startIndex; + const LocalOrdinal local_size; +// std::vector coefs; + + MINIFE_SCALAR* MINIFE_RESTRICT coefs __attribute__ ((aligned (64))); +}; + + +}//namespace miniFE + +#endif + diff --git a/tests/apps/miniFE/tests/src/Vector_functions.hpp b/tests/apps/miniFE/tests/src/Vector_functions.hpp new file mode 100644 index 0000000000..c483b0d7ff --- /dev/null +++ b/tests/apps/miniFE/tests/src/Vector_functions.hpp @@ -0,0 +1,331 @@ +#ifndef _Vector_functions_hpp_ +#define _Vector_functions_hpp_ + +//@HEADER +// ************************************************************************ +// +// MiniFE: Simple Finite Element Assembly and Solve +// Copyright (2006-2013) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA +// +// ************************************************************************ +//@HEADER + +#include +#include +#include + +#ifdef HAVE_MPI +#include +#endif + +#ifdef MINIFE_HAVE_TBB +#include +#endif + +#include +#include + +#define MINIFE_MIN(X, Y) ((X) < (Y) ? (X) : (Y)) + +namespace miniFE { + + +template +void write_vector(const std::string& filename, + const VectorType& vec) +{ + int numprocs = 1, myproc = 0; +#ifdef HAVE_MPI + MPI_Comm_size(MPI_COMM_WORLD, &numprocs); + MPI_Comm_rank(MPI_COMM_WORLD, &myproc); +#endif + + std::ostringstream osstr; + osstr << filename << "." << numprocs << "." << myproc; + std::string full_name = osstr.str(); + std::ofstream ofs(full_name.c_str()); + + typedef typename VectorType::ScalarType ScalarType; + + const std::vector& coefs = vec.coefs; + for(int p=0; p +void sum_into_vector(size_t num_indices, + const typename VectorType::GlobalOrdinalType* indices, + const typename VectorType::ScalarType* coefs, + VectorType& vec) +{ + typedef typename VectorType::GlobalOrdinalType GlobalOrdinal; + typedef typename VectorType::ScalarType Scalar; + + GlobalOrdinal first = vec.startIndex; + GlobalOrdinal last = first + vec.local_size - 1; + + //std::vector& vec_coefs = vec.coefs; + MINIFE_SCALAR* vec_coefs = vec.coefs; + + for(size_t i=0; i last) continue; + size_t idx = indices[i] - first; + + #pragma omp atomic + vec_coefs[idx] += coefs[i]; + } +} + +#ifdef MINIFE_HAVE_TBB +template +void sum_into_vector(size_t num_indices, + const typename VectorType::GlobalOrdinalType* indices, + const typename VectorType::ScalarType* coefs, + LockingVector& vec) +{ + vec.sum_in(num_indices, indices, coefs); +} +#endif + +//------------------------------------------------------------ +//Compute the update of a vector with the sum of two scaled vectors where: +// +// w = alpha*x + beta*y +// +// x,y - input vectors +// +// alpha,beta - scalars applied to x and y respectively +// +// w - output vector +// +template +void + waxpby(typename VectorType::ScalarType alpha, const VectorType& x, + typename VectorType::ScalarType beta, const VectorType& y, + VectorType& w) +{ + typedef typename VectorType::ScalarType ScalarType; + +#ifdef MINIFE_DEBUG_OPENMP + std::cout << "Starting WAXPBY..." << std::endl; +#endif + +#ifdef MINIFE_DEBUG + if (y.local_size < x.local_size || w.local_size < x.local_size) { + std::cerr << "miniFE::waxpby ERROR, y and w must be at least as long as x." << std::endl; + return; + } +#endif + + const int n = x.local_size; + const ScalarType* MINIFE_RESTRICT xcoefs __attribute__ ((aligned (64))) = &x.coefs[0]; + const ScalarType* MINIFE_RESTRICT ycoefs __attribute__ ((aligned (64))) = &y.coefs[0]; + ScalarType* MINIFE_RESTRICT wcoefs __attribute__ ((aligned (64))) = &w.coefs[0]; + + if(beta == 0.0) { + if(alpha == 1.0) { + #pragma omp parallel for + #pragma vector nontemporal + #pragma unroll(8) + for(int i=0; i +void + daxpby(const MINIFE_SCALAR alpha, + const VectorType& x, + const MINIFE_SCALAR beta, + VectorType& y) +{ + + const MINIFE_LOCAL_ORDINAL n = MINIFE_MIN(x.local_size, y.local_size); + const MINIFE_SCALAR* MINIFE_RESTRICT xcoefs __attribute__ ((aligned (64))) = &x.coefs[0]; + MINIFE_SCALAR* MINIFE_RESTRICT ycoefs __attribute__ ((aligned (64))) = &y.coefs[0]; + + if(alpha == 1.0 && beta == 1.0) { + #pragma omp parallel for + #pragma vector nontemporal + #pragma unroll(8) + for(int i = 0; i < n; ++i) { + ycoefs[i] += xcoefs[i]; + } + } else if (beta == 1.0) { + #pragma omp parallel for + #pragma vector nontemporal + #pragma unroll(8) + for(int i = 0; i < n; ++i) { + ycoefs[i] += alpha * xcoefs[i]; + } + } else if (alpha == 1.0) { + #pragma omp parallel for + #pragma vector nontemporal + #pragma unroll(8) + for(int i = 0; i < n; ++i) { + ycoefs[i] = xcoefs[i] + beta * ycoefs[i]; + } + } else if (beta == 0.0) { + #pragma omp parallel for + #pragma vector nontemporal + #pragma unroll(8) + for(int i = 0; i < n; ++i) { + ycoefs[i] = alpha * xcoefs[i]; + } + } else { + #pragma omp parallel for + #pragma vector nontemporal + #pragma unroll(8) + for(int i = 0; i < n; ++i) { + ycoefs[i] = alpha * xcoefs[i] + beta * ycoefs[i]; + } + } + +} + +//----------------------------------------------------------- +//Compute the dot product of two vectors where: +// +// x,y - input vectors +// +// result - return-value +// +template +MINIFE_SCALAR dot(const Vector& x, + const Vector& y) +{ + const MINIFE_LOCAL_ORDINAL n = x.local_size; + + typedef typename Vector::ScalarType Scalar; + typedef typename TypeTraits::magnitude_type magnitude; + + const Scalar* MINIFE_RESTRICT xcoefs __attribute__ ((aligned (64))) = &x.coefs[0]; + const Scalar* MINIFE_RESTRICT ycoefs __attribute__ ((aligned (64))) = &y.coefs[0]; + + MINIFE_SCALAR result = 0; + + #pragma omp parallel for reduction(+:result) + for(int i=0; i::mpi_type(); + MPI_Allreduce(&local_dot, &global_dot, 1, mpi_dtype, MPI_SUM, MPI_COMM_WORLD); + return global_dot; +#else + return result; +#endif +} + +template +MINIFE_SCALAR dot_r2(const Vector& x) +{ +#ifdef MINIFE_DEBUG_OPENMP + int myrank; + MPI_Comm_rank(MPI_COMM_WORLD, &myrank); + std::cout << "[" << myrank << "] Starting dot..." << std::endl; +#endif + + const MINIFE_LOCAL_ORDINAL n = x.local_size; + +#ifdef MINIFE_DEBUG + if (y.local_size < n) { + std::cerr << "miniFE::dot ERROR, y must be at least as long as x."<::magnitude_type magnitude; + + const MINIFE_SCALAR* MINIFE_RESTRICT xcoefs __attribute__ ((aligned (64))) = &x.coefs[0]; + MINIFE_SCALAR result = 0; + + #pragma omp parallel for reduction(+:result) + #pragma unroll(8) + for(MINIFE_LOCAL_ORDINAL i = 0; i < n; ++i) { + result += xcoefs[i] * xcoefs[i]; + } + +#ifdef HAVE_MPI + magnitude local_dot = result, global_dot = 0; + MPI_Datatype mpi_dtype = TypeTraits::mpi_type(); + MPI_Allreduce(&local_dot, &global_dot, 1, mpi_dtype, MPI_SUM, MPI_COMM_WORLD); +#ifdef MINIFE_DEBUG_OPENMP + std::cout << "[" << myrank << "] Completed dot." << std::endl; +#endif + return global_dot; +#else +#ifdef MINIFE_DEBUG_OPENMP + std::cout << "[" << myrank << "] Completed dot." << std::endl; +#endif + return result; +#endif +} + +}//namespace miniFE + +#endif + diff --git a/tests/apps/miniFE/tests/src/YAML_Doc.cpp b/tests/apps/miniFE/tests/src/YAML_Doc.cpp new file mode 100644 index 0000000000..f79e6d955c --- /dev/null +++ b/tests/apps/miniFE/tests/src/YAML_Doc.cpp @@ -0,0 +1,74 @@ +#include +#include +#include +#include +#include +#include +#include +#ifdef REDSTORM +#include +#include +#include +#endif +#include "YAML_Doc.hpp" +using namespace std; + +//set the microapp_name and version which will become part of the YAML doc. +YAML_Doc::YAML_Doc(const std::string& miniApp_Name, const std::string& miniApp_Version, const std::string& destination_Directory, const std::string& destination_FileName){ + miniAppName = miniApp_Name; + miniAppVersion = miniApp_Version; + destinationDirectory = destination_Directory; + destinationFileName = destination_FileName; +} + +//inherits the destructor from YAML_Element +YAML_Doc::~YAML_Doc(void){ +} + +/* +* generates YAML from the elements of the document and saves it +* to a file +*/ +string YAML_Doc::generateYAML(){ + string yaml; + yaml = yaml + "Mini-Application Name: " + miniAppName + "\n"; + yaml = yaml + "Mini-Application Version: " + miniAppVersion + "\n"; + for(size_t i=0; iprintYAML(""); + } + + time_t rawtime; + tm * ptm; + time ( &rawtime ); + ptm = localtime(&rawtime); + char sdate[25]; + //use tm_mon+1 because tm_mon is 0 .. 11 instead of 1 .. 12 + sprintf (sdate,"%04d:%02d:%02d-%02d:%02d:%02d",ptm->tm_year + 1900, ptm->tm_mon+1, + ptm->tm_mday, ptm->tm_hour, ptm->tm_min,ptm->tm_sec); + + string filename; + if (destinationFileName=="") + filename = miniAppName + "-" + miniAppVersion + "_"; + else + filename = destinationFileName; + filename = filename + string(sdate) + ".yaml"; + if (destinationDirectory!="" && destinationDirectory!=".") { + string mkdir_cmd = "mkdir " + destinationDirectory; +#ifdef REDSTORM + mkdir(destinationDirectory.c_str(),0755); +#else + system(mkdir_cmd.c_str()); +#endif + filename = destinationDirectory + "/" + destinationFileName; + } + else + filename = "./" + filename; + + ofstream myfile; + myfile.open(filename.c_str()); + myfile << yaml; + myfile.close(); + return yaml; +} + + diff --git a/tests/apps/miniFE/tests/src/YAML_Doc.hpp b/tests/apps/miniFE/tests/src/YAML_Doc.hpp new file mode 100644 index 0000000000..057bb44eab --- /dev/null +++ b/tests/apps/miniFE/tests/src/YAML_Doc.hpp @@ -0,0 +1,122 @@ +//@HEADER +// ************************************************************************ +// +// Mantevo: A collection of mini-applications for HPC +// Copyright (2008) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA +// Questions? Contact Michael A. Heroux (maherou@sandia.gov) +// +// ************************************************************************ +//@HEADER + +// Changelog +// +// Version 0.1 +// - Initial version. +// +///////////////////////////////////////////////////////////////////////// + +#ifndef YAML_DOC_H +#define YAML_DOC_H +#include +#include +#include "YAML_Element.hpp" + +//! The Mantevo YAML_Doc class for the uniform collecting and reporting of performance data for mini-applications + +/*! + +The YAML_Doc class works in conjuction with the YAML_Element class to facilitate easy collecting and reporting of YAML-formatted +data that can be then registered with the Mantevo results collection website. + +\code + +//EXAMPLE CODE FOR GENERATING YAML + + YAML_Doc doc("hpccg","1.0"); + doc.add("final_residual",1.4523e-13); + doc.add("time","4.893"); + +//note: the following line will remove the data (4.890) associated with "time" + doc.get("time")->add("total",4.243); + +//note: the following line will likewise remove the data (1.243) associated with "time" + doc.get("time")->get("total")->add("time",2.457); + doc.get("time")->get("total")->add("flops",4.88e5); + doc.get("time")->add("ddot",1.243); + doc.get("time")->add("sparsemv",""); + doc.get("time")->get("sparsemv")->add("time",0.3445); + doc.get("time")->get("sparsemv")->add("overhead",""); + doc.get("time")->get("sparsemv")->get("overhead")->add("time",0.0123); + doc.get("time")->get("sparsemv")->get("overhead")->add("percentage",0.034); + cout << doc.generateYAML() << endl; + return 0; + +\endcode + +Below is the output generated by the above code: + +\verbatim + +final_residual: 1.4523e-13 +time: + total: + time: 2.457 + flops: 4.88e5 + ddot: 1.243 + sparsemv: + time: 0.3445 + overhead: + time: 0.0123 + percentage: 0.034 + +\endverbatim + +\note {No value is allowed to be attached to a key that has children. If children are added to a key, the value is simply set to "".} + +*/ +class YAML_Doc: public YAML_Element { + public: + //! Constructor: accepts mini-application name and version as strings, optionally accepts directory and file name for printing results. + /*! + The sole constructor for this class accepts and name and version number for the mini-application as well as optional directory + and file name information for results that are generated by the generateYAML() method. + \param miniApp_Name (in) string containing name of the mini-application + \param miniApp_Version (in) string containing the version of the mini-application + \param destination_Directory (in, optional) path of diretory where results file will be stored, relative to current working directory. + If this value is not supplied, the results file will be stored in the current working directory. If the directory does not exist + it will be created. + \param destination_FileName (in, optional) root name of the results file. A suffix of ".yaml" will be automatically appended. If no + file name is specified the filename will be constructed by concatenating the miniAppName + miniAppVersion + ".yaml" strings. + */ + YAML_Doc(const std::string& miniApp_Name, const std::string& miniApp_Version, const std::string& destination_Directory = "", const std::string& destination_FileName = ""); + //! Destructor + ~YAML_Doc(); + //! Generate YAML results to standard out and to a file using specified directory and filename, using current directory and miniAppName + miniAppVersion + ".yaml" by default + std::string generateYAML(); + +protected: + std::string miniAppName; + std::string miniAppVersion; + std::string destinationDirectory; + std::string destinationFileName; +}; +#endif /* YAML_DOC_H */ + diff --git a/tests/apps/miniFE/tests/src/YAML_Element.cpp b/tests/apps/miniFE/tests/src/YAML_Element.cpp new file mode 100644 index 0000000000..114a61236b --- /dev/null +++ b/tests/apps/miniFE/tests/src/YAML_Element.cpp @@ -0,0 +1,120 @@ +#include +#include +#include +#include +#include "YAML_Element.hpp" +using namespace std; +YAML_Element::YAML_Element(const std::string& key_arg, const std::string& value_arg){ + key = key_arg; + value = value_arg; +} + +YAML_Element::~YAML_Element(){ + for (size_t i=0; ivalue = ""; + string converted_value = convert_double_to_string(value_arg); + YAML_Element* element = new YAML_Element(key_arg,converted_value); + children.push_back(element); + return element; +} + +YAML_Element* YAML_Element::add(const std::string& key_arg, int value_arg) { + this->value = ""; + string converted_value = convert_int_to_string(value_arg); + YAML_Element* element = new YAML_Element(key_arg,converted_value); + children.push_back(element); + return element; +} + +#ifndef MINIFE_NO_LONG_LONG + +YAML_Element* YAML_Element::add(const std::string& key_arg, long long value_arg) { + this->value = ""; + string converted_value = convert_long_long_to_string(value_arg); + YAML_Element* element = new YAML_Element(key_arg,converted_value); + children.push_back(element); + return element; +} + +#endif + +YAML_Element* YAML_Element::add(const std::string& key_arg, size_t value_arg) { + this->value = ""; + string converted_value = convert_size_t_to_string(value_arg); + YAML_Element* element = new YAML_Element(key_arg,converted_value); + children.push_back(element); + return element; +} + +YAML_Element* YAML_Element::add(const std::string& key_arg, const std::string& value_arg) { + this->value = ""; + YAML_Element* element = new YAML_Element(key_arg, value_arg); + children.push_back(element); + return element; +} + +/* +* returns pointer to the YAML_Element for the given key. +* I, cam, believe an exception should be thrown if there is no +* element in the vector for the specified key +*/ +YAML_Element* YAML_Element::get(const std::string& key_arg) { + for (size_t i=0; igetKey() == key_arg){ + return children[i]; + } + } + return 0; +} + +/* +* prints a line of a YAML document. Correct YAML depends on +* correct spacing; the parameter space should be the proper +* amount of space for the parent element +*/ +string YAML_Element::printYAML(std::string space){ + string yaml_line = space + key + ": " + value + "\n"; + for(int i=0; i<2; i++) space = space + " "; + for(size_t i=0; iprintYAML(space); + } + return yaml_line; +} + +string YAML_Element::convert_double_to_string(double value_arg){ + stringstream strm; + strm << value_arg; + return strm.str(); +} +string YAML_Element::convert_int_to_string(int value_arg){ + stringstream strm; + strm << value_arg; + return strm.str(); +} + +#ifndef MINIFE_NO_LONG_LONG + +string YAML_Element::convert_long_long_to_string(long long value_arg){ + stringstream strm; + strm << value_arg; + return strm.str(); +} + +#endif + +string YAML_Element::convert_size_t_to_string(size_t value_arg){ + stringstream strm; + strm << value_arg; + return strm.str(); +} diff --git a/tests/apps/miniFE/tests/src/YAML_Element.hpp b/tests/apps/miniFE/tests/src/YAML_Element.hpp new file mode 100644 index 0000000000..611dca1854 --- /dev/null +++ b/tests/apps/miniFE/tests/src/YAML_Element.hpp @@ -0,0 +1,86 @@ +//@HEADER +// ************************************************************************ +// +// Mantevo: A collection of mini-applications for HPC +// Copyright (2008) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA +// Questions? Contact Michael A. Heroux (maherou@sandia.gov) +// +// ************************************************************************ +//@HEADER + +// Changelog +// +// Version 0.1 +// - Initial version. +// +///////////////////////////////////////////////////////////////////////// + +#ifndef YAML_ELEMENT_H +#define YAML_ELEMENT_H +#include +#include +//! The Mantevo YAML_Element class for registering key-value pairs of performance data + +/*! + Mantevo mini-applications generate a collection of performance data for each run of the executable. YAML_Element, and + the related YAML_Doc class, provide a uniform facility for gathering and reporting this data using the YAML text format. +*/ +class YAML_Element { + public: + + //! Default constructor. + YAML_Element (){key="";value="";} + //! Construct with known key-value pair + YAML_Element (const std::string& key_arg, const std::string& value_arg); + //! Destructor + ~YAML_Element (); + //! Key accessor method + std::string getKey(){return key;} + //! Add a child element to an element list associated with this element, value of type double + YAML_Element* add(const std::string& key_arg, double value_arg); + //! Add a child element to an element list associated with this element, value of type int + YAML_Element* add(const std::string& key_arg, int value_arg); +#ifndef MINIFE_NO_LONG_LONG + //! Add a child element to an element list associated with this element, value of type long long + YAML_Element* add(const std::string& key_arg, long long value_arg); +#endif + //! Add a child element to an element list associated with this element, value of type size_t + YAML_Element* add(const std::string& key_arg, size_t value_arg); + //! Add a child element to an element list associated with this element, value of type string + YAML_Element* add(const std::string& key_arg, const std::string& value_arg); + //! get the element in the list with the given key + YAML_Element* get(const std::string& key_arg); + std::string printYAML(std::string space); + +protected: + std::string key; + std::string value; + std::vector children; + +private: + std::string convert_double_to_string(double value_arg); + std::string convert_int_to_string(int value_arg); +#ifndef MINIFE_NO_LONG_LONG + std::string convert_long_long_to_string(long long value_arg); +#endif + std::string convert_size_t_to_string(size_t value_arg); +}; +#endif /* YAML_ELEMENT_H */ diff --git a/tests/apps/miniFE/tests/src/assemble_FE_data.hpp b/tests/apps/miniFE/tests/src/assemble_FE_data.hpp new file mode 100644 index 0000000000..a60b29cb95 --- /dev/null +++ b/tests/apps/miniFE/tests/src/assemble_FE_data.hpp @@ -0,0 +1,78 @@ +#ifndef _assemble_FE_data_hpp_ +#define _assemble_FE_data_hpp_ + +//@HEADER +// ************************************************************************ +// +// MiniFE: Simple Finite Element Assembly and Solve +// Copyright (2006-2013) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA +// +// ************************************************************************ +//@HEADER + +#include +#include + +#include + +namespace miniFE { + +template +void +assemble_FE_data(const simple_mesh_description& mesh, + MatrixType& A, + VectorType& b, + Parameters& params) +{ + typedef typename MatrixType::GlobalOrdinalType GlobalOrdinal; + + int global_elems_x = mesh.global_box[0][1]; + int global_elems_y = mesh.global_box[1][1]; + int global_elems_z = mesh.global_box[2][1]; + + Box local_elem_box; + copy_box(mesh.local_box, local_elem_box); + + if (get_num_ids(local_elem_box) < 1) { + return; + } + + // + //We want the element-loop to loop over our (processor-local) domain plus a + //ghost layer, so we can assemble the complete linear-system without doing + //any communication. + // + int ghost = 1; + if (local_elem_box[0][0] > 0) local_elem_box[0][0] -= ghost; + if (local_elem_box[1][0] > 0) local_elem_box[1][0] -= ghost; + if (local_elem_box[2][0] > 0) local_elem_box[2][0] -= ghost; + if (local_elem_box[0][1] < global_elems_x) local_elem_box[0][1] += ghost; + if (local_elem_box[1][1] < global_elems_y) local_elem_box[1][1] += ghost; + if (local_elem_box[2][1] < global_elems_z) local_elem_box[2][1] += ghost; + + perform_element_loop(mesh, local_elem_box, A, b, params); +} + +}//namespace miniFE + +#endif + diff --git a/tests/apps/miniFE/tests/src/cg_solve.hpp b/tests/apps/miniFE/tests/src/cg_solve.hpp new file mode 100644 index 0000000000..834a5b5ccb --- /dev/null +++ b/tests/apps/miniFE/tests/src/cg_solve.hpp @@ -0,0 +1,216 @@ +#ifndef _cg_solve_hpp_ +#define _cg_solve_hpp_ + +//@HEADER +// ************************************************************************ +// +// MiniFE: Simple Finite Element Assembly and Solve +// Copyright (2006-2013) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA +// +// ************************************************************************ +//@HEADER + +#include +#include + +#include +#include + +#include + +namespace miniFE { + +template +void print_vec(const std::vector& vec, const std::string& name) +{ + for(size_t i=0; i +bool breakdown(typename VectorType::ScalarType inner, + const VectorType& v, + const VectorType& w) +{ + typedef typename VectorType::ScalarType Scalar; + typedef typename TypeTraits::magnitude_type magnitude; + +//This is code that was copied from Aztec, and originally written +//by my hero, Ray Tuminaro. +// +//Assuming that inner = (inner product of v and w), +//v and w are considered orthogonal if +// |inner| < 100 * ||v||_2 * ||w||_2 * epsilon + + magnitude vnorm = std::sqrt(dot_r2(v)); + magnitude wnorm = std::sqrt(dot_r2(w)); + return std::abs(inner) <= 100*vnorm*wnorm*std::numeric_limits::epsilon(); +} + +template +void +cg_solve(OperatorType& A, + const VectorType& b, + VectorType& x, + Matvec matvec, + typename OperatorType::LocalOrdinalType max_iter, + typename TypeTraits::magnitude_type& tolerance, + typename OperatorType::LocalOrdinalType& num_iters, + typename TypeTraits::magnitude_type& normr, + timer_type* my_cg_times) +{ + typedef typename OperatorType::ScalarType ScalarType; + typedef typename OperatorType::GlobalOrdinalType GlobalOrdinalType; + typedef typename OperatorType::LocalOrdinalType LocalOrdinalType; + typedef typename TypeTraits::magnitude_type magnitude_type; + + timer_type t0 = 0, tWAXPY = 0, tDOT = 0, tMATVEC = 0, tMATVECDOT = 0; + timer_type total_time = mytimer(); + + int myproc = 0; +#ifdef HAVE_MPI + MPI_Comm_rank(MPI_COMM_WORLD, &myproc); +#endif + + if (!A.has_local_indices) { + std::cerr << "miniFE::cg_solve ERROR, A.has_local_indices is false, needs to be true. This probably means " + << "miniFE::make_local_matrix(A) was not called prior to calling miniFE::cg_solve." + << std::endl; + return; + } + + size_t nrows = A.rows.size(); + LocalOrdinalType ncols = A.num_cols; + + VectorType r(b.startIndex, nrows); + VectorType p(0, ncols); + VectorType Ap(b.startIndex, nrows); + + normr = 0; + magnitude_type rtrans = 0; + magnitude_type oldrtrans = 0; + + LocalOrdinalType print_freq = max_iter/10; + if (print_freq>50) print_freq = 50; + if (print_freq<1) print_freq = 1; + + ScalarType one = 1.0; + ScalarType zero = 0.0; + + TICK(); waxpby(one, x, zero, x, p); TOCK(tWAXPY); + +// print_vec(p.coefs, "p"); + + TICK(); + matvec(A, p, Ap); + TOCK(tMATVEC); + + TICK(); waxpby(one, b, -one, Ap, r); TOCK(tWAXPY); + + TICK(); rtrans = dot_r2(r); TOCK(tDOT); + +//std::cout << "rtrans="< tolerance; ++k) { + if (k == 1) { + //TICK(); waxpby(one, r, zero, r, p); TOCK(tWAXPY); + TICK(); daxpby(one, r, zero, p); TOCK(tWAXPY); + } + else { + oldrtrans = rtrans; + TICK(); rtrans = dot_r2(r); TOCK(tDOT); + const magnitude_type beta = rtrans/oldrtrans; + TICK(); daxpby(one, r, beta, p); TOCK(tWAXPY); + } + + normr = sqrt(rtrans); + + if (myproc == 0 && (k%print_freq==0 || k==max_iter)) { + std::cout << "Iteration = "< +int +driver(const Box& global_box, Box& my_box, + Parameters& params, YAML_Doc& ydoc) +{ + int global_nx = global_box[0][1]; + int global_ny = global_box[1][1]; + int global_nz = global_box[2][1]; + + int numprocs = 1, myproc = 0; +#ifdef HAVE_MPI + MPI_Comm_size(MPI_COMM_WORLD, &numprocs); + MPI_Comm_rank(MPI_COMM_WORLD, &myproc); +#endif + + if (params.load_imbalance > 0) { + add_imbalance(global_box, my_box, params.load_imbalance, ydoc); + } + + float largest_imbalance = 0, std_dev = 0; + compute_imbalance(global_box, my_box, largest_imbalance, + std_dev, ydoc, true); + + + //Create a representation of the mesh: + //Note that 'simple_mesh_description' is a virtual or conceptual + //mesh that doesn't actually store mesh data. + + if (myproc==0) { + std::cout.width(30); + std::cout << "creating/filling mesh..."; + std::cout.flush(); + } + + timer_type t_start = mytimer(); + timer_type t0 = mytimer(); + + simple_mesh_description mesh(global_box, my_box); + + timer_type mesh_fill = mytimer() - t0; + timer_type t_total = mytimer() - t_start; + + if (myproc==0) { + std::cout << mesh_fill << "s, total time: " << t_total << std::endl; + } + + //next we will generate the matrix structure. + + //Declare matrix object: + +#if defined(MINIFE_ELL_MATRIX) + typedef ELLMatrix MatrixType; +#else + typedef CSRMatrix MatrixType; +#endif + + MatrixType A; + + timer_type gen_structure; + RUN_TIMED_FUNCTION("generating matrix structure...", + generate_matrix_structure(mesh, A), + gen_structure, t_total); + + GlobalOrdinal local_nrows = A.rows.size(); + GlobalOrdinal my_first_row = local_nrows > 0 ? A.rows[0] : -1; + + Vector b(my_first_row, local_nrows); + Vector x(my_first_row, local_nrows); + + //Assemble finite-element sub-matrices and sub-vectors into the global + //linear system: + + timer_type fe_assembly; + RUN_TIMED_FUNCTION("assembling FE data...", + assemble_FE_data(mesh, A, b, params), + fe_assembly, t_total); + + if (myproc == 0) { + ydoc.add("Matrix structure generation",""); + ydoc.get("Matrix structure generation")->add("Mat-struc-gen Time",gen_structure); + ydoc.add("FE assembly",""); + ydoc.get("FE assembly")->add("FE assembly Time",fe_assembly); + } + +#ifdef MINIFE_DEBUG + write_matrix("A_prebc.mtx", A); + write_vector("b_prebc.vec", b); +#endif + + //Now apply dirichlet boundary-conditions + //(Apply the 0-valued surfaces first, then the 1-valued surface last.) + + timer_type dirbc_time; + RUN_TIMED_FUNCTION("imposing Dirichlet BC...", + impose_dirichlet(0.0, A, b, global_nx+1, global_ny+1, global_nz+1, mesh.bc_rows_0), dirbc_time, t_total); + RUN_TIMED_FUNCTION("imposing Dirichlet BC...", + impose_dirichlet(1.0, A, b, global_nx+1, global_ny+1, global_nz+1, mesh.bc_rows_1), dirbc_time, t_total); + +#ifdef MINIFE_DEBUG + write_matrix("A.mtx", A); + write_vector("b.vec", b); +#endif + + //Transform global indices to local, set up communication information: + + timer_type make_local_time; + RUN_TIMED_FUNCTION("making matrix indices local...", + make_local_matrix(A), + make_local_time, t_total); + +#ifdef MINIFE_DEBUG + write_matrix("A_local.mtx", A); + write_vector("b_local.vec", b); +#endif + + size_t global_nnz = compute_matrix_stats(A, myproc, numprocs, ydoc); + + //Prepare to perform conjugate gradient solve: + + LocalOrdinal max_iters = 200; + LocalOrdinal num_iters = 0; + typedef typename TypeTraits::magnitude_type magnitude; + magnitude rnorm = 0; + magnitude tol = std::numeric_limits::epsilon(); + + timer_type cg_times[NUM_TIMERS]; + + typedef Vector VectorType; + + t_total = mytimer() - t_start; + + bool matvec_with_comm_overlap = params.mv_overlap_comm_comp==1; + + int verify_result = 0; + +#if MINIFE_KERNELS != 0 + if (myproc==0) { + std::cout.width(30); + std::cout << "Starting kernel timing loops ..." << std::endl; + } + + max_iters = 500; + x.coefs[0] = 0.9; + if (matvec_with_comm_overlap) { + time_kernels(A, b, x, matvec_overlap(), max_iters, rnorm, cg_times); + } + else { + time_kernels(A, b, x, matvec_std(), max_iters, rnorm, cg_times); + } + num_iters = max_iters; + std::string title("Kernel timings"); +#else + if (myproc==0) { + std::cout << "Starting CG solver ... " << std::endl; + } + + if (matvec_with_comm_overlap) { +#ifdef MINIFE_CSR_MATRIX + rearrange_matrix_local_external(A); + cg_solve(A, b, x, matvec_overlap(), max_iters, tol, + num_iters, rnorm, cg_times); +#else + std::cout << "ERROR, matvec with overlapping comm/comp only works with CSR matrix."<(), max_iters, tol, + num_iters, rnorm, cg_times); + if (myproc == 0) { + std::cout << "Final Resid Norm: " << rnorm << std::endl; + } + + if (params.verify_solution > 0) { + double tolerance = 0.06; + bool verify_whole_domain = false; + #ifdef MINIFE_DEBUG + verify_whole_domain = true; + #endif + if (myproc == 0) { + if (verify_whole_domain) std::cout << "verifying solution..." << std::endl; + else std::cout << "verifying solution at ~ (0.5, 0.5, 0.5) ..." << std::endl; + } + verify_result = verify_solution(mesh, x, tolerance, verify_whole_domain); + } + } + +#ifdef MINIFE_DEBUG + write_vector("x.vec", x); +#endif + std::string title("CG solve"); +#endif + + if (myproc == 0) { + ydoc.get("Global Run Parameters")->add("ScalarType",TypeTraits::name()); + ydoc.get("Global Run Parameters")->add("GlobalOrdinalType",TypeTraits::name()); + ydoc.get("Global Run Parameters")->add("LocalOrdinalType",TypeTraits::name()); + ydoc.add(title,""); + ydoc.get(title)->add("Iterations",num_iters); + ydoc.get(title)->add("Final Resid Norm",rnorm); + + GlobalOrdinal global_nrows = global_nx; + global_nrows *= global_ny*global_nz; + + //flops-per-mv, flops-per-dot, flops-per-waxpy: + double mv_flops = global_nnz*2.0; + double dot_flops = global_nrows*2.0; + double waxpy_flops = global_nrows*3.0; + +#if MINIFE_KERNELS == 0 +//if MINIFE_KERNELS == 0 then we did a CG solve, and in that case +//there were num_iters+1 matvecs, num_iters*2 dots, and num_iters*3+2 waxpys. + mv_flops *= (num_iters+1); + dot_flops *= (2*num_iters); + waxpy_flops *= (3*num_iters+2); +#else +//if MINIFE_KERNELS then we did one of each operation per iteration. + mv_flops *= num_iters; + dot_flops *= num_iters; + waxpy_flops *= num_iters; +#endif + + double total_flops = mv_flops + dot_flops + waxpy_flops; + + double mv_mflops = -1; + if (cg_times[MATVEC] > 1.e-4) + mv_mflops = 1.e-6 * (mv_flops/cg_times[MATVEC]); + + double dot_mflops = -1; + if (cg_times[DOT] > 1.e-4) + dot_mflops = 1.e-6 * (dot_flops/cg_times[DOT]); + + double waxpy_mflops = -1; + if (cg_times[WAXPY] > 1.e-4) + waxpy_mflops = 1.e-6 * (waxpy_flops/cg_times[WAXPY]); + + double total_mflops = -1; + if (cg_times[TOTAL] > 1.e-4) + total_mflops = 1.e-6 * (total_flops/cg_times[TOTAL]); + + ydoc.get(title)->add("WAXPY Time",cg_times[WAXPY]); + ydoc.get(title)->add("WAXPY Flops",waxpy_flops); + if (waxpy_mflops >= 0) + ydoc.get(title)->add("WAXPY Mflops",waxpy_mflops); + else + ydoc.get(title)->add("WAXPY Mflops","inf"); + + ydoc.get(title)->add("DOT Time",cg_times[DOT]); + ydoc.get(title)->add("DOT Flops",dot_flops); + if (dot_mflops >= 0) + ydoc.get(title)->add("DOT Mflops",dot_mflops); + else + ydoc.get(title)->add("DOT Mflops","inf"); + + ydoc.get(title)->add("MATVEC Time",cg_times[MATVEC]); + ydoc.get(title)->add("MATVEC Flops",mv_flops); + if (mv_mflops >= 0) + ydoc.get(title)->add("MATVEC Mflops",mv_mflops); + else + ydoc.get(title)->add("MATVEC Mflops","inf"); + +#ifdef MINIFE_FUSED + ydoc.get(title)->add("MATVECDOT Time",cg_times[MATVECDOT]); + ydoc.get(title)->add("MATVECDOT Flops",mv_flops); + if (mv_mflops >= 0) + ydoc.get(title)->add("MATVECDOT Mflops",mv_mflops); + else + ydoc.get(title)->add("MATVECDOT Mflops","inf"); +#endif + +#if MINIFE_KERNELS == 0 + ydoc.get(title)->add("Total",""); + ydoc.get(title)->get("Total")->add("Total CG Time",cg_times[TOTAL]); + ydoc.get(title)->get("Total")->add("Total CG Flops",total_flops); + if (total_mflops >= 0) + ydoc.get(title)->get("Total")->add("Total CG Mflops",total_mflops); + else + ydoc.get(title)->get("Total")->add("Total CG Mflops","inf"); + ydoc.get(title)->add("Time per iteration",cg_times[TOTAL]/num_iters); +#endif + } + + return verify_result; +} + +}//namespace miniFE + +#endif + diff --git a/tests/apps/miniFE/tests/src/exchange_externals.hpp b/tests/apps/miniFE/tests/src/exchange_externals.hpp new file mode 100644 index 0000000000..893c257933 --- /dev/null +++ b/tests/apps/miniFE/tests/src/exchange_externals.hpp @@ -0,0 +1,272 @@ +#ifndef _exchange_externals_hpp_ +#define _exchange_externals_hpp_ + +//@HEADER +// ************************************************************************ +// +// MiniFE: Simple Finite Element Assembly and Solve +// Copyright (2006-2013) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA +// +// ************************************************************************ +//@HEADER + +#include +#include + +#ifdef HAVE_MPI +#include +#endif + +#include + +#include + +namespace miniFE { + +template +void +exchange_externals(MatrixType& A, + VectorType& x) +{ +#ifdef HAVE_MPI +#ifdef MINIFE_DEBUG + std::ostream& os = outstream(); + os << "entering exchange_externals\n"; +#endif + + int numprocs = 1; + MPI_Comm_size(MPI_COMM_WORLD, &numprocs); + + if (numprocs < 2) return; + + typedef typename MatrixType::ScalarType Scalar; + typedef typename MatrixType::LocalOrdinalType LocalOrdinal; + typedef typename MatrixType::GlobalOrdinalType GlobalOrdinal; + + // Extract Matrix pieces + + int local_nrow = A.rows.size(); + int num_neighbors = A.neighbors.size(); + const std::vector& recv_length = A.recv_length; + const std::vector& send_length = A.send_length; + const std::vector& neighbors = A.neighbors; + const std::vector& elements_to_send = A.elements_to_send; + + std::vector& send_buffer = A.send_buffer; + + // + // first post receives, these are immediate receives + // Do not wait for result to come, will do that at the + // wait call below. + // + + int MPI_MY_TAG = 99; + + std::vector& request = A.request; + + // + // Externals are at end of locals + // + + //std::vector& x_coefs = x.coefs; + MINIFE_SCALAR* x_coefs __attribute__((aligned(64))) = x.coefs; + Scalar* x_external = &(x_coefs[local_nrow]); + + MPI_Datatype mpi_dtype = TypeTraits::mpi_type(); + + // Post receives first + for(int i=0; i x.local_size) { + os << "error, out-of-range. x.coefs.size()=="< exch_ext_requests; +#endif + +template +void +begin_exchange_externals(MatrixType& A, + VectorType& x) +{ +#ifdef HAVE_MPI + + int numprocs = 1, myproc = 0; + MPI_Comm_size(MPI_COMM_WORLD, &numprocs); + MPI_Comm_rank(MPI_COMM_WORLD, &myproc); + + if (numprocs < 2) return; + + typedef typename MatrixType::ScalarType Scalar; + typedef typename MatrixType::LocalOrdinalType LocalOrdinal; + typedef typename MatrixType::GlobalOrdinalType GlobalOrdinal; + + // Extract Matrix pieces + + int local_nrow = A.rows.size(); + int num_neighbors = A.neighbors.size(); + const std::vector& recv_length = A.recv_length; + const std::vector& send_length = A.send_length; + const std::vector& neighbors = A.neighbors; + const std::vector& elements_to_send = A.elements_to_send; + + std::vector send_buffer(elements_to_send.size(), 0); + + // + // first post receives, these are immediate receives + // Do not wait for result to come, will do that at the + // wait call below. + // + + int MPI_MY_TAG = 99; + + exch_ext_requests.resize(num_neighbors); + + // + // Externals are at end of locals + // + +// std::vector& x_coefs = x.coefs; + MINIFE_SCALAR* x_coefs __attribute__((aligned(64))) = x.coefs; + Scalar* x_external = &(x_coefs[local_nrow]); + + MPI_Datatype mpi_dtype = TypeTraits::mpi_type(); + + // Post receives first + for(int i=0; i +# example: +# % generate_info_header g++ -O3 miniFE MINIFE +# this will cause the appropriate info to be put in a +# header named miniFE_info.hpp and the info will be in macros +# that start with MINIFE. +# +# an example of usage can be seen in miniFE/make_targets +# +if [ $# != 4 ] ; then +echo "error, need 4 arguments."; +exit 1; +fi + +cxx=`which ${1}` +errcode="$?" +if [ ${errcode} != "0" ] ; then +cxx="unknown"; +fi +echo "CXX: ${cxx}" + +cxx_ver=`${1} --version 2>&1` +errcode="$?" +if [ ${errcode} != "0" ] ; then +cxx_ver=`${1} -V 2>&1`; +errcode="$?" +if [ ${errcode} != "0" ] ; then +cxx_ver="unknown"; +fi +fi + +cxx_ver=${cxx_ver// /@} +cxx_version="" +for i in $(echo ${cxx_ver}); +do + if [ "$cxx_version" == "" ]; then + cxx_version=$i; + fi +done +cxx_version=${cxx_version//@/ } +echo "Compiler version: ${cxx_version}" + +cxxflags=${2} +hostname=`uname -n` +errcode="$?" +if [ ${errcode} != "0" ] ; then +hostname="unknown"; +fi + +kern_name=`uname -s` +errcode="$?" +if [ ${errcode} != "0" ] ; then +kern_name="unknown"; +fi + +kern_rel=`uname -r` +errcode="$?" +if [ ${errcode} != "0" ] ; then +kern_rel="unknown"; +fi + +proc=`uname -p` +errcode="$?" +if [ ${errcode} != "0" ] ; then +proc="unknown"; +fi + +header_prefix=${3} +macro_prefix=${4} + +cat << END_CAT > ${header_prefix}_info.hpp +#ifndef ${header_prefix}_info_hpp +#define ${header_prefix}_info_hpp + +#define ${macro_prefix}_HOSTNAME "${hostname}" +#define ${macro_prefix}_KERNEL_NAME "'${kern_name}'" +#define ${macro_prefix}_KERNEL_RELEASE "'${kern_rel}'" +#define ${macro_prefix}_PROCESSOR "'${proc}'" + +#define ${macro_prefix}_CXX "'${cxx}'" +#define ${macro_prefix}_CXX_VERSION "'${cxx_version}'" +#define ${macro_prefix}_CXXFLAGS "'${cxxflags}'" + +#endif +END_CAT diff --git a/tests/apps/miniFE/tests/src/generate_matrix_structure.hpp b/tests/apps/miniFE/tests/src/generate_matrix_structure.hpp new file mode 100644 index 0000000000..76de40c262 --- /dev/null +++ b/tests/apps/miniFE/tests/src/generate_matrix_structure.hpp @@ -0,0 +1,165 @@ +#ifndef _generate_matrix_structure_hpp_ +#define _generate_matrix_structure_hpp_ + +//@HEADER +// ************************************************************************ +// +// MiniFE: Simple Finite Element Assembly and Solve +// Copyright (2006-2013) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA +// +// ************************************************************************ +//@HEADER + +#include +#include +#include +#include + +#include +#include +#include +#include + +#ifdef HAVE_MPI +#include +#endif + +namespace miniFE { + +template +int +generate_matrix_structure(const simple_mesh_description& mesh, + MatrixType& A) +{ + int myproc = 0; +#ifdef HAVE_MPI + MPI_Comm_rank(MPI_COMM_WORLD, &myproc); +#endif + + int threw_exc = 0; + try { + + typedef typename MatrixType::GlobalOrdinalType GlobalOrdinal; + typedef typename MatrixType::LocalOrdinalType LocalOrdinal; + + const int global_nodes_x = mesh.global_box[0][1]+1; + const int global_nodes_y = mesh.global_box[1][1]+1; + const int global_nodes_z = mesh.global_box[2][1]+1; + Box box; + copy_box(mesh.local_box, box); + + //num-owned-nodes in each dimension is num-elems+1 + //only if num-elems > 0 in that dimension *and* + //we are at the high end of the global range in that dimension: + if (box[0][1] > box[0][0] && box[0][1] == mesh.global_box[0][1]) ++box[0][1]; + if (box[1][1] > box[1][0] && box[1][1] == mesh.global_box[1][1]) ++box[1][1]; + if (box[2][1] > box[2][0] && box[2][1] == mesh.global_box[2][1]) ++box[2][1]; + + GlobalOrdinal global_nrows = global_nodes_x; + global_nrows *= global_nodes_y*global_nodes_z; + + GlobalOrdinal nrows = get_num_ids(box); + try { + A.reserve_space(nrows, 27); + } + catch(std::exception& exc) { + std::ostringstream osstr; + osstr << "One of A.rows.resize, A.row_offsets.resize, A.packed_cols.reserve or A.packed_coefs.reserve: nrows=" < rows(nrows); + std::vector row_offsets(nrows+1); + std::vector row_coords(nrows*3); + + const MINIFE_GLOBAL_ORDINAL z_width = box[2][1] - box[2][0]; + const MINIFE_GLOBAL_ORDINAL y_width = box[1][1] - box[1][0]; + const MINIFE_GLOBAL_ORDINAL x_width = box[0][1] - box[0][0]; + const MINIFE_GLOBAL_ORDINAL r_n = (box[2][1] - box[2][0]) * + (box[1][1] - box[1][0]) * + (box[0][1] - box[0][0]); + const MINIFE_GLOBAL_ORDINAL xy_width = x_width * y_width; + MINIFE_GLOBAL_ORDINAL* const row_ptr = &rows[0]; + MINIFE_LOCAL_ORDINAL* const row_offset_ptr = &row_offsets[0]; + MINIFE_LOCAL_ORDINAL* const row_coords_ptr = &row_coords[0]; + + #pragma omp parallel for + for(int r = 0; r < r_n; ++r) { + int iz = r / (xy_width) + box[2][0]; + int iy = (r / x_width) % y_width + box[1][0]; + int ix = r % x_width + box[0][0]; + + GlobalOrdinal row_id = + get_id(global_nodes_x, global_nodes_y, global_nodes_z, + ix, iy, iz); + row_ptr[r] = mesh.map_id_to_row(row_id); + row_coords_ptr[r*3] = ix; + row_coords_ptr[r*3+1] = iy; + row_coords_ptr[r*3+2] = iz; + + MINIFE_LOCAL_ORDINAL nnz = 0; + for(int sz=-1; sz<=1; ++sz) { + for(int sy=-1; sy<=1; ++sy) { + for(int sx=-1; sx<=1; ++sx) { + GlobalOrdinal col_id = +get_id(global_nodes_x, global_nodes_y, global_nodes_z, + ix+sx, iy+sy, iz+sz); + + if (col_id >= 0 && col_id < global_nrows) { + ++nnz; + } + } + } + } + row_offset_ptr[r+1] = nnz; + + } + + const MINIFE_GLOBAL_ORDINAL n = row_offsets.size() - 1; + for(int i = 0; i < n; ++i) { + row_offset_ptr[i+1] += row_offset_ptr[i]; + } + + init_matrix(A, rows, row_offsets, row_coords, + global_nodes_x, global_nodes_y, global_nodes_z, global_nrows, mesh); + } + catch(...) { + std::cout << "proc " << myproc << " threw an exception in generate_matrix_structure, probably due to running out of memory." << std::endl; + threw_exc = 1; + } +#ifdef HAVE_MPI + int global_throw = 0; + MPI_Allreduce(&threw_exc, &global_throw, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD); + threw_exc = global_throw; +#endif + if (threw_exc) { + return 1; + } + + return 0; +} + +}//namespace miniFE + +#endif + diff --git a/tests/apps/miniFE/tests/src/get_common_files b/tests/apps/miniFE/tests/src/get_common_files new file mode 100755 index 0000000000..486fd8e372 --- /dev/null +++ b/tests/apps/miniFE/tests/src/get_common_files @@ -0,0 +1,15 @@ +#!/bin/bash + +if [ -f ./YAML_Doc.cpp ] ; then + exit 0; +fi + +dir=../common + +cp ${dir}/YAML_Doc.cpp . +cp ${dir}/YAML_Doc.hpp . +cp ${dir}/YAML_Element.cpp . +cp ${dir}/YAML_Element.hpp . + +cp ${dir}/generate_info_header . + diff --git a/tests/apps/miniFE/tests/src/main.cpp b/tests/apps/miniFE/tests/src/main.cpp new file mode 100644 index 0000000000..5e55d81244 --- /dev/null +++ b/tests/apps/miniFE/tests/src/main.cpp @@ -0,0 +1,245 @@ + +//@HEADER +// ************************************************************************ +// +// MiniFE: Simple Finite Element Assembly and Solve +// Copyright (2006-2013) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA +// +// ************************************************************************ +//@HEADER + +#include +#include +#include +#include + +#include + +#include +#include + +#ifdef HAVE_MPI +#include +#endif + +#include +#include +#include +#include +#include +#include +#include + +#if MINIFE_INFO != 0 +#include +#else +#include +#endif + +//The following macros should be specified as compile-macros in the +//makefile. They are defaulted here just in case... +#ifndef MINIFE_SCALAR +#define MINIFE_SCALAR double +#endif +#ifndef MINIFE_LOCAL_ORDINAL +#define MINIFE_LOCAL_ORDINAL int +#endif +#ifndef MINIFE_GLOBAL_ORDINAL +#define MINIFE_GLOBAL_ORDINAL int +#endif + +// ************************************************************************ + +void add_params_to_yaml(YAML_Doc& doc, miniFE::Parameters& params); +void add_configuration_to_yaml(YAML_Doc& doc, int numprocs, int numthreads); +void add_timestring_to_yaml(YAML_Doc& doc); + +// +//We will create a 'box' of size nx X ny X nz, partition it among processors, +//then call miniFE::driver which will use the partitioned box as the domain +//from which to assemble finite-element matrices into a global matrix and +//vector, then solve the linear-system using Conjugate Gradients. +// + +int main(int argc, char** argv) { + miniFE::Parameters params; + miniFE::get_parameters(argc, argv, params); + + int numprocs = 1, myproc = 0; + miniFE::initialize_mpi(argc, argv, numprocs, myproc); + + miniFE::timer_type start_time = miniFE::mytimer(); + +#ifdef MINIFE_DEBUG + outstream(numprocs, myproc); +#endif + + if(myproc==0) { + std::cout << "MiniFE Mini-App, OpenMP Peer Implementation" << std::endl; + std::cout << "Creating OpenMP Thread Pool..." << std::endl; + } + int value = 0; + +#ifdef _OPENMP + const int thread_count = omp_get_max_threads(); +#else + const int thread_count = 1; +#endif + +#pragma omp parallel for reduction(+:value) + for(int i = 0; i < thread_count; ++i) { + value += 1; + } + double global_threadcount; + double local_threadcount = value; + +#ifdef HAVE_MPI + MPI_Allreduce(&local_threadcount,&global_threadcount,1,MPI_DOUBLE,MPI_SUM,MPI_COMM_WORLD); +#else + global_threadcount = local_threadcount; +#endif + if(myproc==0) { + std::cout << "Counted: " << global_threadcount << " threads." << std::endl; + std::cout << "Running MiniFE Mini-App..." << std::endl; + } + + //make sure each processor has the same parameters: + miniFE::broadcast_parameters(params); + + + Box global_box = { 0, params.nx, 0, params.ny, 0, params.nz }; + std::vector local_boxes(numprocs); + + box_partition(0, numprocs, 2, global_box, &local_boxes[0]); + + Box& my_box = local_boxes[myproc]; + + MINIFE_GLOBAL_ORDINAL num_my_ids = miniFE::get_num_ids(my_box); + MINIFE_GLOBAL_ORDINAL min_ids = num_my_ids; + +#ifdef HAVE_MPI + MPI_Datatype mpi_dtype = miniFE::TypeTraits::mpi_type(); + MPI_Allreduce(&num_my_ids, &min_ids, 1, mpi_dtype, MPI_MIN, MPI_COMM_WORLD); +#endif + + if (min_ids == 0) { + std::cout<<"One or more processors have 0 equations. Not currently supported. Exiting."<. + //To run miniFE with float instead of double, or 'long long' instead of int, + //etc., change these template-parameters by changing the macro definitions in + //the makefile or on the make command-line. + + int return_code = + miniFE::driver< MINIFE_SCALAR, MINIFE_LOCAL_ORDINAL, MINIFE_GLOBAL_ORDINAL>(global_box, my_box, params, doc); + + miniFE::timer_type total_time = miniFE::mytimer() - start_time; + + if (myproc == 0) { + doc.add("Total Program Time",total_time); + doc.generateYAML(); + } + + miniFE::finalize_mpi(); + + return return_code; +} + +void add_params_to_yaml(YAML_Doc& doc, miniFE::Parameters& params) +{ + doc.add("Global Run Parameters",""); + doc.get("Global Run Parameters")->add("dimensions",""); + doc.get("Global Run Parameters")->get("dimensions")->add("nx",params.nx); + doc.get("Global Run Parameters")->get("dimensions")->add("ny",params.ny); + doc.get("Global Run Parameters")->get("dimensions")->add("nz",params.nz); + doc.get("Global Run Parameters")->add("load_imbalance", params.load_imbalance); + if (params.mv_overlap_comm_comp == 1) { + std::string val("1 (yes)"); + doc.get("Global Run Parameters")->add("mv_overlap_comm_comp", val); + } + else { + std::string val("0 (no)"); + doc.get("Global Run Parameters")->add("mv_overlap_comm_comp", val); + } +} + +void add_configuration_to_yaml(YAML_Doc& doc, int numprocs, int numthreads) +{ + doc.get("Global Run Parameters")->add("number of processors", numprocs); + + doc.add("Platform",""); + doc.get("Platform")->add("hostname",MINIFE_HOSTNAME); + doc.get("Platform")->add("kernel name",MINIFE_KERNEL_NAME); + doc.get("Platform")->add("kernel release",MINIFE_KERNEL_RELEASE); + doc.get("Platform")->add("processor",MINIFE_PROCESSOR); + + doc.add("Build",""); + doc.get("Build")->add("CXX",MINIFE_CXX); +#if MINIFE_INFO != 0 + doc.get("Build")->add("compiler version",MINIFE_CXX_VERSION); +#endif + doc.get("Build")->add("CXXFLAGS",MINIFE_CXXFLAGS); + std::string using_mpi("no"); +#ifdef HAVE_MPI + using_mpi = "yes"; +#endif + doc.get("Build")->add("using MPI",using_mpi); +} + +void add_timestring_to_yaml(YAML_Doc& doc) +{ + std::time_t rawtime; + struct tm * timeinfo; + std::time(&rawtime); + timeinfo = std::localtime(&rawtime); + std::ostringstream osstr; + osstr.fill('0'); + osstr << timeinfo->tm_year+1900 << "-"; + osstr.width(2); osstr << timeinfo->tm_mon+1 << "-"; + osstr.width(2); osstr << timeinfo->tm_mday << ", "; + osstr.width(2); osstr << timeinfo->tm_hour << "-"; + osstr.width(2); osstr << timeinfo->tm_min << "-"; + osstr.width(2); osstr << timeinfo->tm_sec; + std::string timestring = osstr.str(); + doc.add("Run Date/Time",timestring); +} + diff --git a/tests/apps/miniFE/tests/src/make_local_matrix.hpp b/tests/apps/miniFE/tests/src/make_local_matrix.hpp new file mode 100644 index 0000000000..76970d0621 --- /dev/null +++ b/tests/apps/miniFE/tests/src/make_local_matrix.hpp @@ -0,0 +1,447 @@ +#ifndef _make_local_matrix_hpp_ +#define _make_local_matrix_hpp_ +#include + +//@HEADER +// ************************************************************************ +// +// MiniFE: Simple Finite Element Assembly and Solve +// Copyright (2006-2013) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA +// +// ************************************************************************ +//@HEADER + +#include + +#include + +#ifdef HAVE_MPI +#include +#endif + +namespace miniFE { + +template +void +make_local_matrix(MatrixType& A) +{ +#ifdef HAVE_MPI + int numprocs = 1, myproc = 0; + MPI_Comm_size(MPI_COMM_WORLD, &numprocs); + MPI_Comm_rank(MPI_COMM_WORLD, &myproc); + + if (numprocs < 2) { + A.num_cols = A.rows.size(); + A.has_local_indices = true; + return; + } + + typedef typename MatrixType::GlobalOrdinalType GlobalOrdinal; + typedef typename MatrixType::LocalOrdinalType LocalOrdinal; + typedef typename MatrixType::ScalarType Scalar; + + std::map externals; + LocalOrdinal num_external = 0; + + //Extract Matrix pieces + + size_t local_nrow = A.rows.size(); + GlobalOrdinal start_row = local_nrow>0 ? A.rows[0] : -1; + GlobalOrdinal stop_row = local_nrow>0 ? A.rows[local_nrow-1] : -1; + + // We need to convert the index values for the rows on this processor + // to a local index space. We need to: + // - Determine if each index reaches to a local value or external value + // - If local, subtract start_row from index value to get local index + // - If external, find out if it is already accounted for. + // - If so, then do nothing, + // - otherwise + // - add it to the list of external indices, + // - find out which processor owns the value. + // - Set up communication for sparse MV operation + + /////////////////////////////////////////// + // Scan the indices and transform to local + /////////////////////////////////////////// + + std::vector& external_index = A.external_index; + + for(size_t i=0; i tmp_buffer(numprocs, 0); // Temp buffer space needed below + + // Build list of global index offset + + std::vector global_index_offsets(numprocs, 0); + + tmp_buffer[myproc] = start_row; // This is my start row + + // This call sends the start_row of each ith processor to the ith + // entry of global_index_offsets on all processors. + // Thus, each processor knows the range of indices owned by all + // other processors. + // Note: There might be a better algorithm for doing this, but this + // will work... + + MPI_Datatype mpi_dtype = TypeTraits::mpi_type(); + MPI_Allreduce(&tmp_buffer[0], &global_index_offsets[0], numprocs, mpi_dtype, + MPI_SUM, MPI_COMM_WORLD); + + // Go through list of externals and find the processor that owns each + std::vector external_processor(num_external); + + for(LocalOrdinal i=0; i=0; --j) { + if (global_index_offsets[j] <= cur_ind && global_index_offsets[j] >= 0) { + external_processor[i] = j; + break; + } + } + } + + ///////////////////////////////////////////////////////////////////////// + // Sift through the external elements. For each newly encountered external + // point assign it the next index in the sequence. Then look for other + // external elements who are updated by the same node and assign them the next + // set of index numbers in the sequence (ie. elements updated by the same node + // have consecutive indices). + ///////////////////////////////////////////////////////////////////////// + + size_t count = local_nrow; + std::vector& external_local_index = A.external_local_index; + external_local_index.assign(num_external, -1); + + for(LocalOrdinal i=0; i new_external_processor(num_external, 0); + + for(int i=0; i No external elements are updated by + // processor i. + // tmp_neighbors[i] = x ==> (x-1)/numprocs elements are updated from + // processor i. + /// + //////////////////////////////////////////////////////////////////////// + + std::vector tmp_neighbors(numprocs, 0); + + int num_recv_neighbors = 0; + int length = 1; + + for(LocalOrdinal i=0; i recv_list; + recv_list.push_back(new_external_processor[0]); + for(LocalOrdinal i=1; i send_list(num_send_neighbors, 0); + + // + // first post receives, these are immediate receives + // Do not wait for result to come, will do that at the + // wait call below. + // + int MPI_MY_TAG = 99; + + std::vector request(num_send_neighbors); + for(int i=0; i new_external(num_external); + for(LocalOrdinal i=0; i lengths(num_recv_neighbors); + + ++MPI_MY_TAG; + + // First post receives + + for(int i=0; i& neighbors = A.neighbors; + std::vector& recv_length = A.recv_length; + std::vector& send_length = A.send_length; + + neighbors.resize(num_recv_neighbors, 0); + A.request.resize(num_recv_neighbors); + recv_length.resize(num_recv_neighbors, 0); + send_length.resize(num_recv_neighbors, 0); + + LocalOrdinal j = 0; + for(int i=0; i= A.rows.size()) { +//std::cout<<"start_row: "< +#include +#include +#include +#include +#include + +#ifdef _OPENMP +#include +#endif + +//#include "advisor-annotate.h" + +namespace miniFE { + +template +void +perform_element_loop(const simple_mesh_description& mesh, + const Box& local_elem_box, + MatrixType& A, VectorType& b, + Parameters& /*params*/) +{ + typedef typename MatrixType::ScalarType Scalar; + + int global_elems_x = mesh.global_box[0][1]; + int global_elems_y = mesh.global_box[1][1]; + int global_elems_z = mesh.global_box[2][1]; + + //We will iterate the local-element-box (local portion of the mesh), and + //get element-IDs in preparation for later assembling the FE operators + //into the global sparse linear-system. + + GlobalOrdinal num_elems = get_num_ids(local_elem_box); + std::vector elemIDs(num_elems); + + BoxIterator iter = BoxIterator::begin(local_elem_box); + BoxIterator end = BoxIterator::end(local_elem_box); + + for(size_t i=0; iter != end; ++iter, ++i) { + elemIDs[i] = get_id(global_elems_x, global_elems_y, global_elems_z, + iter.x, iter.y, iter.z); + } + + timer_type t_gn = 0, t_ce = 0, t_si = 0; + timer_type t0 = 0; + + const MINIFE_GLOBAL_ORDINAL elemID_size = elemIDs.size(); + + #pragma omp parallel for shared (elemIDs) + for(MINIFE_GLOBAL_ORDINAL i=0; i < elemID_size; ++i) { + ElemData elem_data; + compute_gradient_values(elem_data.grad_vals); + + get_elem_nodes_and_coords(mesh, elemIDs[i], elem_data); + compute_element_matrix_and_vector(elem_data); + sum_into_global_linear_system(elem_data, A, b); + } + +//std::cout << std::endl<<"get-nodes: " << t_gn << std::endl; +//std::cout << "compute-elems: " << t_ce << std::endl; +//std::cout << "sum-in: " << t_si << std::endl; +} + +}//namespace miniFE + +#endif + diff --git a/tests/apps/miniFE/tests/src/run b/tests/apps/miniFE/tests/src/run new file mode 100755 index 0000000000..88543d8d96 --- /dev/null +++ b/tests/apps/miniFE/tests/src/run @@ -0,0 +1,79 @@ +#!/bin/bash + +source /opt/ohpc/pub/compiler/intel/composer_xe_2013_sp1.2.144/bin/compilervars.sh intel64 +source /opt/ohpc/pub/mpi/impi/4.1.3.048/bin64/mpivars.sh + +exe=./miniFE.x +log=./miniFE.log +yaml="miniFE.*.yaml" + +out_single=yaml.single +out_strong=yaml.strong +out_weak=yaml.weak + +num_ranks_per_node=8 +num_nodes=4 +num_threads=4 +num_iterations=5 +verify=1 + +x=256 +y=256 +z=256 + +if [ ! -f $exe ] +then + echo ERROR: $exe file does not exist + exit +fi + +rm -f $log +rm -rf $out_single +rm -rf $out_strong +rm -rf $out_weak + +export OMP_NUM_THREADS=$num_threads + +function summary { + out=$1 + mkdir -p $out + mv $yaml $out + grep "Total CG Time" $out/$yaml + echo +} + +echo "miniFE single node runs..." +for i in $(seq 1 $num_iterations) +do + for j in $(seq 1 $num_nodes) + do + srun -N 1 -n $num_ranks_per_node --nodelist=c$j $exe nx=$x ny=$y nz=$z verify_solution=$verify >>$log + done +done +summary $out_single + +echo "miniFE strong scaling runs..." +for i in $(seq 1 $num_iterations) +do + for j in $(seq 1 $num_nodes) + do + r=$((j*num_ranks_per_node)) + srun -N $j -n $r $exe nx=$x ny=$y nz=$z verify_solution=$verify >>$log + done +done +summary $out_strong + +echo "miniFE weak scaling runs..." +dx=$((x/num_nodes)) +for i in $(seq 1 $num_iterations) +do + for j in $(seq 1 $num_nodes) + do + r=$((j*num_ranks_per_node)) + nx=$((j*dx)) + srun -N $j -n $r $exe nx=$nx ny=$y nz=$z verify_solution=$verify >>$log + done +done +summary $out_weak + +exit diff --git a/tests/apps/miniFE/tests/src/run_quick b/tests/apps/miniFE/tests/src/run_quick new file mode 100755 index 0000000000..1bfab88876 --- /dev/null +++ b/tests/apps/miniFE/tests/src/run_quick @@ -0,0 +1,10 @@ +#!/bin/bash + +source /opt/ohpc/pub/compiler/intel/composer_xe_2013_sp1.2.144/bin/compilervars.sh intel64 +source /opt/ohpc/pub/mpi/impi/4.1.3.048/bin64/mpivars.sh + +OMP_NUM_THREADS=2 srun -n 4 -N 1 ./miniFE.x nx=100 ny=100 nz=100 verify_solution=1 + +if [ $? != 0 ] ; then \ +echo "test FAILED, verify_solution detected unacceptable error."; \ +fi diff --git a/tests/apps/miniFE/tests/src/simple_mesh_description.hpp b/tests/apps/miniFE/tests/src/simple_mesh_description.hpp new file mode 100644 index 0000000000..b34d44af7f --- /dev/null +++ b/tests/apps/miniFE/tests/src/simple_mesh_description.hpp @@ -0,0 +1,248 @@ + +#ifndef _simple_mesh_description_hpp_ +#define _simple_mesh_description_hpp_ + +//@HEADER +// ************************************************************************ +// +// MiniFE: Simple Finite Element Assembly and Solve +// Copyright (2006-2013) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA +// +// ************************************************************************ +//@HEADER + +#include +#include +#include + +namespace miniFE { + +template +class simple_mesh_description { +public: + simple_mesh_description(const Box& global_box_in, const Box& local_box_in) + { + Box local_node_box; + for(int i=0; i<3; ++i) { + global_box[i][0] = global_box_in[i][0]; + global_box[i][1] = global_box_in[i][1]; + local_box[i][0] = local_box_in[i][0]; + local_box[i][1] = local_box_in[i][1]; + local_node_box[i][0] = local_box_in[i][0]; + local_node_box[i][1] = local_box_in[i][1]; + //num-owned-nodes == num-elems+1 in this dimension if the elem box is not empty + //and we are at the high end of the global range in that dimension: + if (local_box_in[i][1] > local_box_in[i][0] && local_box_in[i][1] == global_box[i][1]) local_node_box[i][1] += 1; + } + + int max_node_x = global_box[0][1]+1; + int max_node_y = global_box[1][1]+1; + int max_node_z = global_box[2][1]+1; + create_map_id_to_row(max_node_x, max_node_y, max_node_z, local_node_box, + map_ids_to_rows); + + //As described in analytic_soln.hpp, + //we will impose a 0 boundary-condition on faces x=0, y=0, z=0, y=1, z=1 + //we will impose a 1 boundary-condition on face x=1 + +#ifdef MINIFE_DEBUG +std::cout< 0) --miny; + if (local_node_box[Z][0] > 0) --minz; + if (local_node_box[Y][1] < max_node_y) ++maxy; + if (local_node_box[Z][1] < max_node_z) ++maxz; + + for(int iz=minz; iz(max_node_x, max_node_y, max_node_z, + 0, iy, iz); +#ifdef MINIFE_DEBUG +std::cout<<"x=0 BC, node "< 0) --minx; + if (local_node_box[Z][0] > 0) --minz; + if (local_node_box[X][1] < max_node_x) ++maxx; + if (local_node_box[Z][1] < max_node_z) ++maxz; + + for(int iz=minz; iz(max_node_x, max_node_y, max_node_z, + ix, 0, iz); +#ifdef MINIFE_DEBUG +std::cout<<"y=0 BC, node "< 0) --minz; + if (local_node_box[Y][0] > 0) --miny; + if (local_node_box[Z][1] < max_node_z) ++maxz; + if (local_node_box[Y][1] < max_node_y) ++maxy; + + for(int iy=miny; iy(max_node_x, max_node_y, max_node_z, + x1, iy, iz); + GlobalOrdinal row = map_id_to_row(nodeID); +#ifdef MINIFE_DEBUG +std::cout<<"x=1 BC, node "< 0) --minz; + if (local_node_box[X][0] > 0) --minx; + if (local_node_box[Z][1] < max_node_z) ++maxz; + if (local_node_box[X][1] < max_node_x) ++maxx; + + for(int ix=minx; ix(max_node_x, max_node_y, max_node_z, + ix, y1, iz); +#ifdef MINIFE_DEBUG +std::cout<<"y=1 BC, node "< 0) --miny; + if (local_node_box[X][0] > 0) --minx; + if (local_node_box[Y][1] < max_node_y) ++maxy; + if (local_node_box[X][1] < max_node_x) ++maxx; + + for(int ix=minx; ix(max_node_x, max_node_y, max_node_z, + ix, iy, z1); +#ifdef MINIFE_DEBUG +std::cout<<"z=1 BC, node "<::const_iterator mend = map_ids_to_rows.end(); + --mend; + return mend->second; + } + std::set bc_rows_0; + std::set bc_rows_1; + std::map map_ids_to_rows; + Box global_box; + Box local_box; +};//class simple_mesh_description + +}//namespace miniFE + +#endif diff --git a/tests/apps/miniFE/tests/src/time_kernels.hpp b/tests/apps/miniFE/tests/src/time_kernels.hpp new file mode 100644 index 0000000000..e14ff09192 --- /dev/null +++ b/tests/apps/miniFE/tests/src/time_kernels.hpp @@ -0,0 +1,139 @@ +#ifndef _time_kernels_hpp_ +#define _time_kernels_hpp_ + +//@HEADER +// ************************************************************************ +// +// MiniFE: Simple Finite Element Assembly and Solve +// Copyright (2006-2013) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA +// +// ************************************************************************ +//@HEADER + +#include + +#include +#include + +#ifdef MINIFE_HAVE_CUDA +#include +#endif + +namespace miniFE { + +template +void +time_kernels(OperatorType& A, + const VectorType& b, + VectorType& x, + Matvec matvec, + typename OperatorType::LocalOrdinalType max_iter, + typename OperatorType::ScalarType& xdotp, + timer_type* my_kern_times) +{ + typedef typename OperatorType::ScalarType ScalarType; + typedef typename OperatorType::LocalOrdinalType OrdinalType; + typedef typename TypeTraits::magnitude_type magnitude_type; + + timer_type t0 = 0, tWAXPY = 0, tDOT = 0, tMATVEC = 0; + + int myproc = 0; +#ifdef HAVE_MPI + MPI_Comm_rank(MPI_COMM_WORLD, &myproc); +#endif + + if (!A.has_local_indices) { + std::cerr << "miniFE::time_kernels ERROR, A.has_local_indices is false, needs to be true. This probably means " + << "miniFE::make_local_matrix(A) was not called prior to calling miniFE::time_kernels." + << std::endl; + return; + } + + OrdinalType nrows = A.rows.size(); + OrdinalType ncols = A.num_cols; + + VectorType p(0, ncols, b.compute_node); + + ScalarType one = 1.0; + ScalarType zero = 0.0; + + typedef typename VectorType::ComputeNodeType ComputeNodeType; + ComputeNodeType& compute_node = x.compute_node; + + //The following lines that create and initialize buffers are no-ops in many + //cases, but perform actual allocations and copies if a off-cpu device such as + //a GPU is being used by compute_node. + + //Do any required allocations for buffers that will be needed during CG: + ScalarType* d_x = compute_node.get_buffer(&x.coefs[0], x.coefs.size()); + ScalarType* d_p = compute_node.get_buffer(&p.coefs[0], p.coefs.size()); + ScalarType* d_b = compute_node.get_buffer(&b.coefs[0], b.coefs.size()); + OrdinalType* d_Arowoff = compute_node.get_buffer(&A.row_offsets[0], A.row_offsets.size()); + OrdinalType* d_Acols = compute_node.get_buffer(&A.packed_cols[0], A.packed_cols.size()); + ScalarType* d_Acoefs = compute_node.get_buffer(&A.packed_coefs[0], A.packed_coefs.size()); + + //Copy data to buffers that need to be initialized from input data: + compute_node.copy_to_buffer(&x.coefs[0], x.coefs.size(), d_x); + compute_node.copy_to_buffer(&b.coefs[0], b.coefs.size(), d_b); + compute_node.copy_to_buffer(&A.row_offsets[0], A.row_offsets.size(), d_Arowoff); + compute_node.copy_to_buffer(&A.packed_cols[0], A.packed_cols.size(), d_Acols); + compute_node.copy_to_buffer(&A.packed_coefs[0], A.packed_coefs.size(), d_Acoefs); + + TICK(); + for(OrdinalType i=0; i= box_[0][1]) { + x = box_[0][0]; + ++y; + if (y >= box_[1][1]) { + y = box_[1][0]; + ++z; + if (z >= box_[2][1]) { + z = box_[2][1]; + y = box_[1][1]; + x = box_[0][1]; + } + } + } + return *this; + } + + BoxIterator operator++(int) + { + BoxIterator temp = *this; + ++(*this); + return temp; + } + + bool operator==(const BoxIterator& rhs) const + { + return x == rhs.x && y == rhs.y && z == rhs.z; + } + + bool operator!=(const BoxIterator& rhs) const + { + return !(this->operator==(rhs)); + } + + int x; + int y; + int z; + +private: + BoxIterator(const Box& box, bool at_end = false) + : x(box[0][0]), + y(box[1][0]), + z(box[2][0]), + box_() + { + box_[0][0] = box[0][0]; box_[0][1] = box[0][1]; + box_[1][0] = box[1][0]; box_[1][1] = box[1][1]; + box_[2][0] = box[2][0]; box_[2][1] = box[2][1]; + if (at_end) { + x = box[0][1]; + y = box[1][1]; + z = box[2][1]; + } + } + + Box box_; +};//class BoxTraverser + +}//namespace miniFE + +#endif + diff --git a/tests/apps/miniFE/tests/utils/BoxPartition.cpp b/tests/apps/miniFE/tests/utils/BoxPartition.cpp new file mode 100644 index 0000000000..cb167fb884 --- /dev/null +++ b/tests/apps/miniFE/tests/utils/BoxPartition.cpp @@ -0,0 +1,503 @@ +//@HEADER +// ************************************************************************ +// +// MiniFE: Simple Finite Element Assembly and Solve +// Copyright (2006-2013) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA +// +// ************************************************************************ +//@HEADER + +#include +#include + +#include +#include + +/*--------------------------------------------------------------------*/ + +static int box_map_local_entry( const Box& box , + const int ghost , + int local_x , + int local_y , + int local_z ) +{ + const int nx = 2 * ghost + box[0][1] - box[0][0] ; + const int ny = 2 * ghost + box[1][1] - box[1][0] ; + const int nz = 2 * ghost + box[2][1] - box[2][0] ; + int result = -1 ; + + local_x += ghost ; + local_y += ghost ; + local_z += ghost ; + + if ( 0 <= local_x && local_x < nx && + 0 <= local_y && local_y < ny && + 0 <= local_z && local_z < nz ) { + + result = local_z * ny * nx + local_y * nx + local_x ; + } + return result ; +} + +int box_map_local( const Box& box_local, + const int ghost , + const int box_local_map[] , + const int local_x , + const int local_y , + const int local_z ) +{ + int result = box_map_local_entry(box_local,ghost,local_x,local_y,local_z); + + if ( 0 <= result ) { + result = box_local_map[ result ]; + } + + return result ; +} + +/*--------------------------------------------------------------------*/ +/* Recursively split a box into into (up-ip) sub-boxes */ + +void box_partition( int ip , int up , int axis , + const Box& box, + Box* p_box ) +{ + const int np = up - ip ; + if ( 1 == np ) { + p_box[ip][0][0] = box[0][0] ; p_box[ip][0][1] = box[0][1] ; + p_box[ip][1][0] = box[1][0] ; p_box[ip][1][1] = box[1][1] ; + p_box[ip][2][0] = box[2][0] ; p_box[ip][2][1] = box[2][1] ; + } + else { + const int n = box[ axis ][1] - box[ axis ][0] ; + const int np_low = np / 2 ; /* Rounded down */ + const int np_upp = np - np_low ; + + const int n_upp = (int) (((double) n) * ( ((double)np_upp) / ((double)np))); + const int n_low = n - n_upp ; + const int next_axis = ( axis + 2 ) % 3 ; + + if ( np_low ) { /* P = [ip,ip+np_low) */ + Box dbox ; + dbox[0][0] = box[0][0] ; dbox[0][1] = box[0][1] ; + dbox[1][0] = box[1][0] ; dbox[1][1] = box[1][1] ; + dbox[2][0] = box[2][0] ; dbox[2][1] = box[2][1] ; + + dbox[ axis ][1] = dbox[ axis ][0] + n_low ; + + box_partition( ip, ip + np_low, next_axis, dbox, p_box ); + } + + if ( np_upp ) { /* P = [ip+np_low,ip+np_low+np_upp) */ + Box dbox; + dbox[0][0] = box[0][0] ; dbox[0][1] = box[0][1] ; + dbox[1][0] = box[1][0] ; dbox[1][1] = box[1][1] ; + dbox[2][0] = box[2][0] ; dbox[2][1] = box[2][1] ; + + ip += np_low ; + dbox[ axis ][0] += n_low ; + dbox[ axis ][1] = dbox[ axis ][0] + n_upp ; + + box_partition( ip, ip + np_upp, next_axis, dbox, p_box ); + } + } +} + +/*--------------------------------------------------------------------*/ + +static int box_disjoint( const Box& a , const Box& b) +{ + return a[0][1] <= b[0][0] || b[0][1] <= a[0][0] || + a[1][1] <= b[1][0] || b[1][1] <= a[1][0] || + a[2][1] <= b[2][0] || b[2][1] <= a[2][0] ; +} + +static void resize_int( int ** a , int * allocLen , int newLen ) +{ + int k = 32; + while ( k < newLen ) { k <<= 1 ; } + if ( NULL == *a ) + { *a = (int*)malloc( sizeof(int)*(*allocLen = k) ); } + else if ( *allocLen < k ) + { *a = (int*)realloc(*a , sizeof(int)*(*allocLen = k)); } +} + +static void box_partition_maps( + const int np , + const int my_p , + const Box* pbox, + const int ghost , + int ** map_local_id , + int ** map_recv_pc , + int ** map_send_pc , + int ** map_send_id ) +{ + const Box& my_box = pbox[my_p] ; + + const int my_ix = my_box[0][0] ; + const int my_iy = my_box[1][0] ; + const int my_iz = my_box[2][0] ; + const int my_nx = my_box[0][1] - my_box[0][0] ; + const int my_ny = my_box[1][1] - my_box[1][0] ; + const int my_nz = my_box[2][1] - my_box[2][0] ; + + const int my_use_nx = 2 * ghost + my_nx ; + const int my_use_ny = 2 * ghost + my_ny ; + const int my_use_nz = 2 * ghost + my_nz ; + + const int id_length = my_use_nx * my_use_ny * my_use_nz ; + + int * local_id = (int *) malloc( id_length * sizeof(int) ); + int * recv_pc = (int *) malloc( ( np + 1 ) * sizeof(int) ); + int * send_pc = (int *) malloc( ( np + 1 ) * sizeof(int) ); + + int * send_id = NULL ; + int send_id_size = 0 ; + + int iLocal , iSend ; + int i ; + + Box my_use_box; + + my_use_box[0][0] = my_box[0][0] - ghost ; + my_use_box[0][1] = my_box[0][1] + ghost ; + my_use_box[1][0] = my_box[1][0] - ghost ; + my_use_box[1][1] = my_box[1][1] + ghost ; + my_use_box[2][0] = my_box[2][0] - ghost ; + my_use_box[2][1] = my_box[2][1] + ghost ; + + for ( i = 0 ; i < id_length ; ++i ) { local_id[i] = -1 ; } + + iSend = 0 ; + iLocal = 0 ; + + /* The vector space is partitioned by processors */ + + for ( i = 0 ; i < np ; ++i ) { + const int ip = ( i + my_p ) % np ; + recv_pc[i] = iLocal ; + send_pc[i] = iSend ; + + if ( ! box_disjoint( my_use_box , pbox[ip] ) ) { + const int p_ix = pbox[ip][0][0] ; + const int p_iy = pbox[ip][1][0] ; + const int p_iz = pbox[ip][2][0] ; + const int p_ex = pbox[ip][0][1] ; + const int p_ey = pbox[ip][1][1] ; + const int p_ez = pbox[ip][2][1] ; + + int local_x , local_y , local_z ; + + /* Run the span of global cells that my processor uses */ + + for ( local_z = -ghost ; local_z < my_nz + ghost ; ++local_z ) { + for ( local_y = -ghost ; local_y < my_ny + ghost ; ++local_y ) { + for ( local_x = -ghost ; local_x < my_nx + ghost ; ++local_x ) { + + const int global_z = local_z + my_iz ; + const int global_y = local_y + my_iy ; + const int global_x = local_x + my_ix ; + + const int entry = + box_map_local_entry(my_box,ghost,local_x,local_y,local_z); + + if ( entry < 0 ) { abort(); } + + if ( p_iz <= global_z && global_z < p_ez && + p_iy <= global_y && global_y < p_ey && + p_ix <= global_x && global_x < p_ex ) { + + /* This ordinal is owned by processor 'ip' */ + + local_id[ entry ] = iLocal++ ; + +#if defined(DEBUG_PRINT) +if ( my_p != ip ) { + fprintf(stdout," (%d,%d,%d) : P%d recv at local %d from P%d\n", + global_x,global_y,global_z,my_p,local_id[entry],ip); + fflush(stdout); +} +#endif + } + + /* If in my ownership and used by the other processor */ + if ( my_p != ip && + /* In my ownership: */ + ( 0 <= local_z && local_z < my_nz && + 0 <= local_y && local_y < my_ny && + 0 <= local_x && local_x < my_nx ) && + /* In other processors usage: */ + ( p_iz - ghost <= global_z && global_z < p_ez + ghost && + p_iy - ghost <= global_y && global_y < p_ey + ghost && + p_ix - ghost <= global_x && global_x < p_ex + ghost ) ) { + + resize_int( & send_id , & send_id_size , (iSend + 1) ); + send_id[ iSend ] = local_id[ entry ] ; + ++iSend ; + +#if defined(DEBUG_PRINT) +{ + fprintf(stdout," (%d,%d,%d) : P%d send at local %d to P%d\n", + global_x,global_y,global_z,my_p,local_id[entry],ip); + fflush(stdout); +} +#endif + } + } + } + } + } + } + recv_pc[np] = iLocal ; + send_pc[np] = iSend ; + + *map_local_id = local_id ; + *map_recv_pc = recv_pc ; + *map_send_pc = send_pc ; + *map_send_id = send_id ; +} + +void box_partition_rcb( const int np , + const int my_p , + const Box& root_box, + const int ghost , + Box** pbox, + int ** map_local_id , + int ** map_recv_pc , + int ** map_send_pc , + int ** map_send_id ) +{ + *pbox = new Box[ np ]; + + box_partition( 0 , np , 2 , root_box , *pbox ); + + box_partition_maps( np , my_p , *pbox , ghost , + map_local_id , map_recv_pc , + map_send_pc , map_send_id ); +} + +/*--------------------------------------------------------------------*/ + +#ifdef UNIT_TEST + +static int box_contain( const Box& a , const Box& b ) +{ + return a[0][0] <= b[0][0] && b[0][1] <= a[0][1] && + a[1][0] <= b[1][0] && b[1][1] <= a[1][1] && + a[2][0] <= b[2][0] && b[2][1] <= a[2][1] ; +} + +static void box_print( FILE * fp , const Box& a ) +{ + fprintf(fp,"{ [ %d , %d ) , [ %d , %d ) , [ %d , %d ) }", + a[0][0] , a[0][1] , + a[1][0] , a[1][1] , + a[2][0] , a[2][1] ); +} + +static void test_box( const Box& box , const int np ) +{ + const int ncell_box = box[0][1] * box[1][1] * box[2][1] ; + int ncell_total = 0 ; + int ncell_min = ncell_box ; + int ncell_max = 0 ; + std::vector pbox(np); + int i , j ; + + box_partition( 0 , np , 2 , box , &pbox[0] ); + + for ( i = 0 ; i < np ; ++i ) { + const int ncell = ( pbox[i][0][1] - pbox[i][0][0] ) * + ( pbox[i][1][1] - pbox[i][1][0] ) * + ( pbox[i][2][1] - pbox[i][2][0] ); + + if ( ! box_contain( box , pbox[i] ) ) { + fprintf(stdout," OUT OF BOUNDS pbox[%d/%d] = ",i,np); + box_print(stdout,pbox[i]); + fprintf(stdout,"\n"); + abort(); + } + + for ( j = i + 1 ; j < np ; ++j ) { + if ( ! box_disjoint( pbox[i] , pbox[j] ) ) { + fprintf(stdout," NOT DISJOINT pbox[%d/%d] = ",i,np); + box_print(stdout, pbox[i]); + fprintf(stdout,"\n"); + fprintf(stdout," pbox[%d/%d] = ",j,np); + box_print(stdout, pbox[j]); + fprintf(stdout,"\n"); + abort(); + } + } + ncell_total += ncell ; + + if ( ncell_max < ncell ) { ncell_max = ncell ; } + if ( ncell < ncell_min ) { ncell_min = ncell ; } + } + + if ( ncell_total != ncell_box ) { + fprintf(stdout," WRONG CELL COUNT NP = %d\n",np); + abort(); + } + fprintf(stdout,"NP = %d, total = %d, avg = %d, min = %d, max = %d\n", + np,ncell_box,ncell_box/np,ncell_min,ncell_max); +} + +/*--------------------------------------------------------------------*/ + +static void test_maps( const Box& root_box , const int np ) +{ + const int ghost = 1 ; + const int nx_global = root_box[0][1] - root_box[0][0] ; + const int ny_global = root_box[1][1] - root_box[1][0] ; + int ieq , i , j ; + std::vector pbox(np); + int **local_values ; + int **map_local_id ; + int **map_recv_pc ; + int **map_send_pc ; + int **map_send_id ; + + box_partition( 0 , np , 2 , root_box , &pbox[0] ); + + local_values = (int **) malloc( sizeof(int*) * np ); + map_local_id = (int **) malloc( sizeof(int*) * np ); + map_recv_pc = (int **) malloc( sizeof(int*) * np ); + map_send_pc = (int **) malloc( sizeof(int*) * np ); + map_send_id = (int **) malloc( sizeof(int*) * np ); + + /* Set each local value to the global equation number */ + + for ( ieq = i = 0 ; i < np ; ++i ) { + const Box& mybox = pbox[i] ; + const int nx = mybox[0][1] - mybox[0][0] ; + const int ny = mybox[1][1] - mybox[1][0] ; + const int nz = mybox[2][1] - mybox[2][0] ; + int ix , iy , iz ; + + /* Generate the partition maps for this rank */ + box_partition_maps( np , i , &pbox[0] , ghost , + & map_local_id[i] , & map_recv_pc[i] , + & map_send_pc[i] , & map_send_id[i] ); + + local_values[i] = (int *) malloc( sizeof(int) * map_recv_pc[i][np] ); + + for ( iz = -ghost ; iz < nz + ghost ; ++iz ) { + for ( iy = -ghost ; iy < ny + ghost ; ++iy ) { + for ( ix = -ghost ; ix < nx + ghost ; ++ix ) { + const int ieq = box_map_local(mybox,ghost,map_local_id[i],ix,iy,iz); + + if ( 0 <= ieq ) { + const int ix_global = ix + mybox[0][0] ; + const int iy_global = iy + mybox[1][0] ; + const int iz_global = iz + mybox[2][0] ; + + if ( root_box[0][0] <= ix_global && ix_global < root_box[0][1] && + root_box[1][0] <= iy_global && iy_global < root_box[1][1] && + root_box[2][0] <= iz_global && iz_global < root_box[2][1] ) { + + local_values[i][ ieq ] = ix_global + + iy_global * nx_global + + iz_global * nx_global * ny_global ; + } + else { + local_values[i][ ieq ] = -1 ; + } + } + } + } + } + } + + /* Pair-wise compare the local values */ + /* i == receiving processor rank */ + /* ip == sending processor rank */ + /* j == receiving processor data entry for message from 'ip' */ + /* jp == sending processor data entry for message to 'i' */ + + for ( i = 0 ; i < np ; ++i ) { + for ( j = 1 ; j < np ; ++j ) { + const int ip = ( i + j ) % np ; + const int jp = ( i + np - ip ) % np ; + const int nrecv = map_recv_pc[i] [j+1] - map_recv_pc[i] [j] ; + const int nsend = map_send_pc[ip][jp+1] - map_send_pc[ip][jp] ; + int k ; + if ( nrecv != nsend ) { + fprintf(stderr,"P%d recv %d from P%d\n",i,nrecv,ip); + fprintf(stderr,"P%d send %d to P%d\n",ip,nsend,i); + abort(); + } + for ( k = 0 ; k < nrecv ; ++k ) { + const int irecv = map_recv_pc[i][j] + k ; + const int isend = map_send_pc[ip][jp] + k ; + const int val_irecv = local_values[i][irecv] ; + const int val_isend = local_values[ip][ map_send_id[ip][isend] ] ; + if ( val_irecv != val_isend ) { + fprintf(stderr,"P%d recv[%d] = %d , from P%d\n",i,k,val_irecv,ip); + fprintf(stderr,"P%d send[%d] = %d , to P%d\n",ip,k,val_isend,i); + abort(); + } + } + } + } + + for ( i = 0 ; i < np ; ++i ) { + free( map_local_id[i] ); + free( map_recv_pc[i] ); + free( map_send_pc[i] ); + free( map_send_id[i] ); + free( local_values[i] ); + } + free( map_send_id ); + free( map_send_pc ); + free( map_recv_pc ); + free( map_local_id ); + free( local_values ); +} + +/*--------------------------------------------------------------------*/ + +int main( int argc , char * argv[] ) +{ + int np_max = 256 ; + Box box = { 0 , 64 , 0 , 64 , 0 , 64 }; + int np = 0 ; + + switch( argc ) { + case 3: + sscanf(argv[1],"%d",&np); + sscanf(argv[2],"%dx%dx%d",& box[0][1] , & box[1][1] , & box[2][1] ); + if ( 0 < np ) { test_box( box , np ); } + if ( 0 < np ) { test_maps( box , np ); } + break ; + default: + for ( np = 1 ; np <= np_max ; ++np ) { + test_box( box , np ); + test_maps( box , np ); + } + break ; + } + return 0 ; +} + +#endif + + diff --git a/tests/apps/miniFE/tests/utils/BoxPartition.hpp b/tests/apps/miniFE/tests/utils/BoxPartition.hpp new file mode 100644 index 0000000000..14e40762e8 --- /dev/null +++ b/tests/apps/miniFE/tests/utils/BoxPartition.hpp @@ -0,0 +1,103 @@ +//@HEADER +// ************************************************************************ +// +// MiniFE: Simple Finite Element Assembly and Solve +// Copyright (2006-2013) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA +// +// ************************************************************************ +//@HEADER + +#ifndef _BoxPartition_hpp_ +#define _BoxPartition_hpp_ + +#include + +/** \brief Recursively split a box into (up-ip) sub-boxes + */ +void box_partition( int ip , int up , int axis , + const Box& box , + Box* p_box ); + +/** \brief Partition a { [ix,jx) X [iy,jy) X [iz,jz) } box. + * + * Use recursive coordinate bisection to partition a box + * into np disjoint sub-boxes. Allocate (via malloc) and + * populate the sub-boxes, mapping the local (x,y,z) to + * a local ordinal, and mappings for the send-recv messages + * to update the ghost cells. + * + * usage: + * + * my_nx = pbox[my_p][0][1] - pbox[my_p][0][0] ; + * my_ny = pbox[my_p][1][1] - pbox[my_p][1][0] ; + * my_nz = pbox[my_p][2][1] - pbox[my_p][2][0] ; + * + * for ( x = -ghost ; x < my_nx + ghost ; ++x ) { + * for ( y = -ghost ; y < my_ny + ghost ; ++y ) { + * for ( z = -ghost ; z < my_nz + ghost ; ++z ) { + * const int x_global = x + pbox[my_p][0][0] ; + * const int y_global = y + pbox[my_p][1][0] ; + * const int z_global = z + pbox[my_p][2][0] ; + * + * const int local_ordinal = + * box_map_local( pbox[my_p], ghost, map_local_id, x, y, z ); + * + * if ( 0 <= local_ordinal ) { + * } + * } + * + * for ( i = 1 ; i < np ; ++i ) { + * const int recv_processor = ( my_p + i ) % np ; + * const int recv_ordinal_begin = map_recv_pc[i]; + * const int recv_ordinal_end = map_recv_pc[i+1]; + * } + * + * for ( i = 1 ; i < np ; ++i ) { + * const int send_processor = ( my_p + i ) % np ; + * const int send_map_begin = map_send_pc[i]; + * const int send_map_end = map_send_pc[i+1]; + * for ( j = send_map_begin ; j < send_map_end ; ++j ) { + * send_ordinal = map_send_id[j] ; + * } + * } + */ +void box_partition_rcb( + const int np /**< [in] Number of partitions */ , + const int my_p /**< [in] My partition rank */ , + const Box& root_box /**< [in] 3D Box to partition */ , + const int ghost /**< [in] Ghost cell boundary */ , + Box* pbox /**< [out] Partition's 3D boxes */ , + int ** map_local_id /**< [out] Map local cells */ , + int ** map_recv_pc /**< [out] Receive spans per processor */ , + int ** map_send_pc /**< [out] Send prefix counts per processor */ , + int ** map_send_id /**< [out] Send message ordinals */ ); + +/* \brief Map a local (x,y,z) to a local ordinal. + */ +int box_map_local( const Box& box_local , + const int ghost , + const int map_local_id[] , + const int local_x , + const int local_y , + const int local_z ); + +#endif + diff --git a/tests/apps/miniFE/tests/utils/Parameters.hpp b/tests/apps/miniFE/tests/utils/Parameters.hpp new file mode 100644 index 0000000000..44841cfc0d --- /dev/null +++ b/tests/apps/miniFE/tests/utils/Parameters.hpp @@ -0,0 +1,64 @@ +//@HEADER +// ************************************************************************ +// +// MiniFE: Simple Finite Element Assembly and Solve +// Copyright (2006-2013) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA +// +// ************************************************************************ +//@HEADER + +#ifndef _parameters_hpp_ +#define _parameters_hpp_ + +#include + +namespace miniFE { + +struct Parameters { + Parameters() + : nx(5), ny(nx), nz(nx), numthreads(1), + mv_overlap_comm_comp(0), use_locking(0), + load_imbalance(0), name(), elem_group_size(1), + use_elem_mat_fields(1), verify_solution(0), + device(0),num_devices(2),skip_device(9999),numa(1) + {} + + int nx; + int ny; + int nz; + int numthreads; + int mv_overlap_comm_comp; + int use_locking; + float load_imbalance; + std::string name; + int elem_group_size; + int use_elem_mat_fields; + int verify_solution; + int device; + int num_devices; + int skip_device; + int numa; +};//struct Parameters + +}//namespace miniFE + +#endif + diff --git a/tests/apps/miniFE/tests/utils/TypeTraits.hpp b/tests/apps/miniFE/tests/utils/TypeTraits.hpp new file mode 100644 index 0000000000..c7bcb44d16 --- /dev/null +++ b/tests/apps/miniFE/tests/utils/TypeTraits.hpp @@ -0,0 +1,136 @@ +#ifndef _TypeTraits_hpp_ +#define _TypeTraits_hpp_ + +//@HEADER +// ************************************************************************ +// +// MiniFE: Simple Finite Element Assembly and Solve +// Copyright (2006-2013) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA +// +// ************************************************************************ +//@HEADER + +#include + +#ifdef HAVE_MPI +#include +#endif + +namespace miniFE { + +template struct TypeTraits {}; + +template<> +struct TypeTraits { + typedef float magnitude_type; + + static const char* name() {return "float";} + +#ifdef HAVE_MPI + static MPI_Datatype mpi_type() {return MPI_FLOAT;} +#endif +}; + +template<> +struct TypeTraits { + typedef double magnitude_type; + + static const char* name() {return "double";} + +#ifdef HAVE_MPI + static MPI_Datatype mpi_type() {return MPI_DOUBLE;} +#endif +}; + +template<> +struct TypeTraits { + typedef int magnitude_type; + + static const char* name() {return "int";} + +#ifdef HAVE_MPI + static MPI_Datatype mpi_type() {return MPI_INT;} +#endif +}; + +template<> +struct TypeTraits { + typedef long int magnitude_type; + + static const char* name() {return "long int";} + +#ifdef HAVE_MPI + static MPI_Datatype mpi_type() {return MPI_LONG;} +#endif +}; + +#ifndef MINIFE_NO_LONG_LONG + +template<> +struct TypeTraits { + typedef long long magnitude_type; + + static const char* name() {return "long long";} + +#ifdef HAVE_MPI + static MPI_Datatype mpi_type() {return MPI_LONG_LONG;} +#endif +}; + +#endif + +template<> +struct TypeTraits { + typedef unsigned magnitude_type; + + static const char* name() {return "unsigned";} + +#ifdef HAVE_MPI + static MPI_Datatype mpi_type() {return MPI_UNSIGNED;} +#endif +}; + +template<> +struct TypeTraits > { + typedef float magnitude_type; + + static const char* name() {return "std::complex";} + +#ifdef HAVE_MPI + static MPI_Datatype mpi_type() {return MPI_COMPLEX;} +#endif +}; + +template<> +struct TypeTraits > { + typedef double magnitude_type; + + static const char* name() {return "std::complex";} + +#ifdef HAVE_MPI + static MPI_Datatype mpi_type() {return MPI_DOUBLE_COMPLEX;} +#endif +}; + +}//namespace miniFE + +#endif + diff --git a/tests/apps/miniFE/tests/utils/box_utils.hpp b/tests/apps/miniFE/tests/utils/box_utils.hpp new file mode 100644 index 0000000000..f5bdb40330 --- /dev/null +++ b/tests/apps/miniFE/tests/utils/box_utils.hpp @@ -0,0 +1,320 @@ +#ifndef _box_utils_hpp_ +#define _box_utils_hpp_ + +//@HEADER +// ************************************************************************ +// +// MiniFE: Simple Finite Element Assembly and Solve +// Copyright (2006-2013) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA +// +// ************************************************************************ +//@HEADER + +#include +#include +#include + +#ifdef HAVE_MPI +#include +#endif + +#include +#include + +namespace miniFE { + +inline void copy_box(const Box& from_box, Box& to_box) +{ + for(int i=0; i<3; ++i) { + to_box[i][0] = from_box[i][0]; + to_box[i][1] = from_box[i][1]; + } +} + +template +#ifdef __CUDACC__ +__host__ __device__ __inline__ +#endif +void get_int_coords(GlobalOrdinal ID, int nx, int ny, int nz, + int& x, int& y, int& z) +{ + z = ID/(nx*ny); + y = (ID%(nx*ny))/nx; + x = ID%nx; +} + +template +#ifdef __CUDACC__ +__host__ __device__ __inline__ +#endif +void get_coords(GlobalOrdinal ID, int nx, int ny, int nz, + Scalar& x, Scalar& y, Scalar& z) +{ + const int xdiv = nx>1 ? nx-1 : 1; + const int ydiv = ny>1 ? ny-1 : 1; + const int zdiv = nz>1 ? nz-1 : 1; + +//This code assumes that ID is 0-based. +// +//compute coordinates that lie on (or in) the unit cube. +//that's why we're dividing by nz,ny,nx: + z = (1.0*(ID/(nx*ny)))/zdiv; + y = 1.0*((ID%(nx*ny))/nx)/ydiv; + x = 1.0*(ID%nx)/xdiv; +} + +template +GlobalOrdinal get_num_ids(const Box& box) +{ + int nx = box[0][1] - box[0][0]; + int ny = box[1][1] - box[1][0]; + int nz = box[2][1] - box[2][0]; + GlobalOrdinal tmp = nx*ny; + tmp *= nz; + return tmp; +} + +template +#ifdef __CUDACC__ +__host__ __device__ __inline__ +#endif +GlobalOrdinal get_id(int nx, int ny, int nz, + int x, int y, int z) +{ + if (x<0 || y<0 || z<0) return -1; + if (x>=nx || y>=ny || z>=nz) return -1; + + //form x + nx*y + nx*ny*z: + + GlobalOrdinal tmp = nx*ny; + tmp *= z; + tmp = x + nx * y + tmp; + return tmp; +} + +template +void get_ids(int nx, int ny, int nz, + const Box& box, + std::vector& ids, + bool include_ghost_layer=false) +{ + ids.clear(); + int minz = box[2][0]; + int maxz = box[2][1]; + int miny = box[1][0]; + int maxy = box[1][1]; + int minx = box[0][0]; + int maxx = box[0][1]; + + if (include_ghost_layer) { + if (minz > 0) minz--; + if (miny > 0) miny--; + if (minx > 0) minx--; + if (maxz < nz) maxz++; + if (maxy < ny) maxy++; + if (maxx < nx) maxx++; + } + + size_t ids_size = ((maxz - minz) * (maxy - miny)) * (maxx - minx); + ids.reserve(ids_size); + + for(int z=minz; z(nx, ny, nz, x, y, z)); + } + } + } +} + +template +void get_ghost_ids(int nx, int ny, int nz, + const Box& box, + std::vector& ids) +{ + ids.clear(); + int minz,maxz,miny,maxy,minx,maxx; + int orig_minz = minz = box[2][0]; + int orig_maxz = maxz = box[2][1]; + int orig_miny = miny = box[1][0]; + int orig_maxy = maxy = box[1][1]; + int orig_minx = minx = box[0][0]; + int orig_maxx = maxx = box[0][1]; + + if (minz > 0) minz--; + if (miny > 0) miny--; + if (minx > 0) minx--; + if (maxz < nz) maxz++; + if (maxy < ny) maxy++; + if (maxx < nx) maxx++; + + for(int z=minz; z= orig_maxx); + bool y_in_ghost_layer = (y < orig_miny) || (y >= orig_maxy); + bool z_in_ghost_layer = (z < orig_minz) || (z >= orig_maxz); + //we are in the ghost layer if any one of x,y,z are in the ghost layer + if (!x_in_ghost_layer && !y_in_ghost_layer && !z_in_ghost_layer) continue; + ids.push_back(get_id(nx, ny, nz, x, y, z)); + } + } + } +} + + inline void print_box(int myproc, const char* name, const Box& box, + const char* name2, const Box& box2) +{ + std::cout << "proc " << myproc << " "< box2[0][0] && box1[0][1] < box2[0][1]) || // range contains other + (box2[0][0] > box1[0][0] && box2[0][1] < box1[0][1]) || // range contains other + (box1[0][0] > box2[0][0] && box1[0][0] < box2[0][1]) || // min contained in rng + (box2[0][0] > box1[0][0] && box2[0][0] < box1[0][1]); // min contained in rng + if (!x_neighbor) { + x_neighbor = (box1[0][1] == box2[0][0]-1) || (box1[0][0] == box2[0][1]+1); + } + + bool y_neighbor = (box1[1][1] == box2[1][0]) || (box1[1][0] == box2[1][1]) || // min matches max + (box1[1][0] == box2[1][0]) || (box1[1][1] == box2[1][1]) || // mins or maxs match + (box1[1][0] > box2[1][0] && box1[1][1] < box2[1][1]) || // range contains other + (box2[1][0] > box1[1][0] && box2[1][1] < box1[1][1]) || // range contains other + (box1[1][0] > box2[1][0] && box1[1][0] < box2[1][1]) || // min contained in rng + (box2[1][0] > box1[1][0] && box2[1][0] < box1[1][1]); // min contained in rng + if (!y_neighbor) { + y_neighbor = (box1[1][1] == box2[1][0]-1) || (box1[1][0] == box2[1][1]+1); + } + + bool z_neighbor = (box1[2][1] == box2[2][0]) || (box1[2][0] == box2[2][1]) || // min matches max + (box1[2][0] == box2[2][0]) || (box1[2][1] == box2[2][1]) || // mins or maxs match + (box1[2][0] > box2[2][0] && box1[2][1] < box2[2][1]) || // range contains other + (box2[2][0] > box1[2][0] && box2[2][1] < box1[2][1]) || // range contains other + (box1[2][0] > box2[2][0] && box1[2][0] < box2[2][1]) || // min contained in rng + (box2[2][0] > box1[2][0] && box2[2][0] < box1[2][1]); // min contained in rng + if (!z_neighbor) { + z_neighbor = (box1[2][1] == box2[2][0]-1) || (box1[2][0] == box2[2][1]+1); + } + + return x_neighbor && y_neighbor && z_neighbor; +} + +template +void create_map_id_to_row(int global_nx, int global_ny, int global_nz, + const Box& box, + std::map& id_to_row) +{ + GlobalOrdinal num_my_ids = get_num_ids(box); + + typename std::vector all_ids; + bool include_ghost_layer = false; + get_ids(global_nx, global_ny, global_nz, box, all_ids, include_ghost_layer); + + GlobalOrdinal my_first_row = 0; + typename std::vector global_offsets; + std::vector all_boxes; + int numprocs = 1, myproc = 0; +#ifdef HAVE_MPI + MPI_Comm_size(MPI_COMM_WORLD, &numprocs); + MPI_Comm_rank(MPI_COMM_WORLD, &myproc); + + GlobalOrdinal local_num_ids = num_my_ids; + global_offsets.resize(numprocs); + MPI_Datatype mpi_dtype = TypeTraits::mpi_type(); + MPI_Allgather(&local_num_ids, 1, mpi_dtype, &global_offsets[0], 1, mpi_dtype, MPI_COMM_WORLD); + GlobalOrdinal offset = 0; + for(int i=0; i(&box.ranges[0]); + MPI_Allgather(local_box_ranges, 6, MPI_INT, &all_boxes[0], 6, MPI_INT, MPI_COMM_WORLD); +#endif + + if (all_ids.size() > 0) { + id_to_row.insert(std::make_pair(all_ids[0], my_first_row)); + } + + for(size_t i=1; i 0) { + id_to_row.insert(std::make_pair(all_ids[0], first_row)); + } + for(size_t j=1; j::iterator iter = id_to_row.begin(), end = id_to_row.end(); +//for(; iter!=end; ++iter) { +// std::cout<<"proc "<first<<" :: "<second< +#include +#include +#include +#include +#include + +#include +#include +#include + +namespace miniFE { + +template +size_t +compute_matrix_stats(const MatrixType& A, int myproc, int numprocs, YAML_Doc& ydoc) +{ + typedef typename MatrixType::GlobalOrdinalType GlobalOrdinal; + typedef typename MatrixType::LocalOrdinalType LocalOrdinal; + typedef typename MatrixType::ScalarType Scalar; + + GlobalOrdinal min_nrows = 0, max_nrows = 0, global_nrows = 0; + int min_proc = 0, max_proc = 0; + + GlobalOrdinal local_nrows = A.rows.size(); + + get_global_min_max(local_nrows, global_nrows, min_nrows, min_proc, + max_nrows, max_proc); + + //Gather stats on global, min/max matrix num-nonzeros: + + double local_nnz = A.num_nonzeros(); + double dglobal_nnz = 0, dmin_nnz = 0, dmax_nnz = 0; + + get_global_min_max(local_nnz, dglobal_nnz, dmin_nnz, min_proc, + dmax_nnz, max_proc); + + double avg_nrows = global_nrows; + avg_nrows /= numprocs; + double avg_nnz = dglobal_nnz; + avg_nnz /= numprocs; + + double mem_overhead_MB = parallel_memory_overhead_MB(A); + + size_t global_nnz = static_cast(std::ceil(dglobal_nnz)); + size_t min_nnz = static_cast(std::ceil(dmin_nnz)); + size_t max_nnz = static_cast(std::ceil(dmax_nnz)); + size_t global_num_rows = global_nrows; + + if (myproc == 0) { + ydoc.add("Matrix attributes",""); + ydoc.get("Matrix attributes")->add("Global Nrows",global_num_rows); + ydoc.get("Matrix attributes")->add("Global NNZ",global_nnz); + + //compute how much memory the matrix occupies: + //num-bytes = sizeof(GlobalOrdinal)*global_nrows for A.rows + // + sizeof(LocalOrdinal)*global_nrows for A.rows_offsets + // + sizeof(GlobalOrdinal)*global_nnz for A.packed_cols + // + sizeof(Scalar)*global_nnz for A.packed_coefs + + double invGB = 1.0/(1024*1024*1024); + double memGB = invGB*global_nrows*sizeof(GlobalOrdinal); + memGB += invGB*global_nrows*sizeof(LocalOrdinal); + memGB += invGB*global_nnz*sizeof(GlobalOrdinal); + memGB += invGB*global_nnz*sizeof(Scalar); + ydoc.get("Matrix attributes")->add("Global Memory (GB)",memGB); + + ydoc.get("Matrix attributes")->add("Pll Memory Overhead (MB)",mem_overhead_MB); + + size_t min_num_rows = min_nrows; + size_t max_num_rows = max_nrows; + ydoc.get("Matrix attributes")->add("Rows per proc MIN",min_num_rows); + ydoc.get("Matrix attributes")->add("Rows per proc MAX",max_num_rows); + ydoc.get("Matrix attributes")->add("Rows per proc AVG",avg_nrows); + ydoc.get("Matrix attributes")->add("NNZ per proc MIN",min_nnz); + ydoc.get("Matrix attributes")->add("NNZ per proc MAX",max_nnz); + ydoc.get("Matrix attributes")->add("NNZ per proc AVG",avg_nnz); + } + + return global_nnz; +} + +}//namespace miniFE + +#endif + diff --git a/tests/apps/miniFE/tests/utils/imbalance.hpp b/tests/apps/miniFE/tests/utils/imbalance.hpp new file mode 100644 index 0000000000..bd6c6c8e3c --- /dev/null +++ b/tests/apps/miniFE/tests/utils/imbalance.hpp @@ -0,0 +1,298 @@ +//@HEADER +// ************************************************************************ +// +// MiniFE: Simple Finite Element Assembly and Solve +// Copyright (2006-2013) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA +// +// ************************************************************************ +//@HEADER + +#ifndef _imbalance_hpp_ +#define _imbalance_hpp_ + +#include + +#ifdef HAVE_MPI +#include +#endif + +#include +#include +#include + +namespace miniFE { + +const int X = 0; +const int Y = 1; +const int Z = 2; +const int NONE = 3; + +const int LOWER = 0; +const int UPPER = 1; + +template +void +compute_imbalance(const Box& global_box, + const Box& local_box, + float& largest_imbalance, + float& std_dev, + YAML_Doc& doc, + bool record_in_doc) +{ + int numprocs = 1, myproc = 0; +#ifdef HAVE_MPI + MPI_Comm_size(MPI_COMM_WORLD, &numprocs); + MPI_Comm_rank(MPI_COMM_WORLD, &myproc); +#endif + + GlobalOrdinal local_nrows = get_num_ids(local_box); + GlobalOrdinal min_nrows = 0, max_nrows = 0, global_nrows = 0; + int min_proc = myproc, max_proc = myproc; + get_global_min_max(local_nrows, global_nrows, min_nrows, min_proc, + max_nrows, max_proc); + + float avg_nrows = global_nrows; + avg_nrows /= numprocs; + + //largest_imbalance will be the difference between the min (or max) + //rows-per-processor and avg_nrows, represented as a percentage: + largest_imbalance = percentage_difference(min_nrows, avg_nrows); + + float tmp = percentage_difference(max_nrows, avg_nrows); + if (tmp > largest_imbalance) largest_imbalance = tmp; + + std_dev = compute_std_dev_as_percentage(local_nrows, avg_nrows); + + if (myproc == 0 && record_in_doc) { + doc.add("Rows-per-proc Load Imbalance",""); + doc.get("Rows-per-proc Load Imbalance")->add("Largest (from avg, %)",largest_imbalance); + doc.get("Rows-per-proc Load Imbalance")->add("Std Dev (%)",std_dev); + } +} + +std::pair +decide_how_to_grow(const Box& global_box, const Box& local_box) +{ + std::pair result(NONE,UPPER); + + if (local_box[Z][UPPER] < global_box[Z][UPPER]) { + result.first = Z; + result.second = UPPER; + return result; + } + if (local_box[Z][LOWER] > global_box[Z][LOWER]) { + result.first = Z; + result.second = LOWER; + return result; + } + if (local_box[Y][UPPER] < global_box[Y][UPPER]) { + result.first = Y; + result.second = UPPER; + return result; + } + if (local_box[Y][LOWER] > global_box[Y][LOWER]) { + result.first = Y; + result.second = LOWER; + return result; + } + if (local_box[X][UPPER] < global_box[X][UPPER]) { + result.first = X; + result.second = UPPER; + return result; + } + if (local_box[X][LOWER] > global_box[X][LOWER]) { + result.first = X; + result.second = LOWER; + return result; + } + return result; +} + +std::pair +decide_how_to_shrink(const Box& global_box, const Box& local_box) +{ + std::pair result(NONE,UPPER); + + if (local_box[Z][UPPER] < global_box[Z][UPPER] && local_box[Z][UPPER]-local_box[Z][LOWER] > 2) { + result.first = Z; + result.second = UPPER; + return result; + } + if (local_box[Z][LOWER] > global_box[Z][LOWER] && local_box[Z][UPPER]-local_box[Z][LOWER] > 2) { + result.first = Z; + result.second = LOWER; + return result; + } + if (local_box[Y][UPPER] < global_box[Y][UPPER] && local_box[Y][UPPER]-local_box[Y][LOWER] > 2) { + result.first = Y; + result.second = UPPER; + return result; + } + if (local_box[Y][LOWER] > global_box[Y][LOWER] && local_box[Y][UPPER]-local_box[Y][LOWER] > 2) { + result.first = Y; + result.second = LOWER; + return result; + } + if (local_box[X][UPPER] < global_box[X][UPPER] && local_box[X][UPPER]-local_box[X][LOWER] > 2) { + result.first = X; + result.second = UPPER; + return result; + } + if (local_box[X][LOWER] > global_box[X][LOWER] && local_box[X][UPPER]-local_box[X][LOWER] > 2) { + result.first = X; + result.second = LOWER; + return result; + } + return result; +} + +template +void +add_imbalance(const Box& global_box, + Box& local_box, + float imbalance, + YAML_Doc& doc) +{ + int numprocs = 1, myproc = 0; +#ifdef HAVE_MPI + MPI_Comm_size(MPI_COMM_WORLD, &numprocs); + MPI_Comm_rank(MPI_COMM_WORLD, &myproc); +#endif + + if (numprocs == 1) { + return; + } + + float cur_imbalance = 0, cur_std_dev = 0; + compute_imbalance(global_box, local_box, + cur_imbalance, cur_std_dev, doc, false); + + while (cur_imbalance < imbalance) { + GlobalOrdinal local_nrows = get_num_ids(local_box); + GlobalOrdinal min_nrows = 0, max_nrows = 0, global_nrows = 0; + int min_proc = myproc, max_proc = myproc; + get_global_min_max(local_nrows, global_nrows, min_nrows, min_proc, + max_nrows, max_proc); + + std::pair grow(NONE,UPPER); + int grow_axis_val = -1; + std::pair shrink(NONE,UPPER); + int shrink_axis_val = -1; + + if (myproc == max_proc) { + grow = decide_how_to_grow(global_box, local_box); + if (grow.first != NONE) { + grow_axis_val = local_box[grow.first][grow.second]; + } + } + if (myproc == min_proc) { + shrink = decide_how_to_shrink(global_box, local_box); + if (shrink.first != NONE) { + shrink_axis_val = local_box[shrink.first][shrink.second]; + } + } + + int grow_info[8] = {grow.first, grow.second, + local_box[X][0], local_box[X][1], + local_box[Y][0], local_box[Y][1], + local_box[Z][0], local_box[Z][1]}; + + int shrink_info[8] = {shrink.first, shrink.second, + local_box[X][0], local_box[X][1], + local_box[Y][0], local_box[Y][1], + local_box[Z][0], local_box[Z][1]}; +#ifdef HAVE_MPI + MPI_Bcast(&grow_info[0], 8, MPI_INT, max_proc, MPI_COMM_WORLD); + MPI_Bcast(&shrink_info[0], 8, MPI_INT, min_proc, MPI_COMM_WORLD); +#endif + + int grow_axis = grow_info[0]; + int grow_end = grow_info[1]; + int shrink_axis = shrink_info[0]; + int shrink_end = shrink_info[1]; + int grow_incr = 1; + if (grow_end == LOWER) grow_incr = -1; + int shrink_incr = -1; + if (shrink_end == LOWER) shrink_incr = 1; + if (grow_axis != NONE) grow_axis_val = grow_info[2+grow_axis*2+grow_end]; + if (shrink_axis != NONE) shrink_axis_val = shrink_info[2+shrink_axis*2+shrink_end]; + + if (grow_axis == NONE && shrink_axis == NONE) break; + + bool grow_status = grow_axis==NONE ? false : true; + if (grow_axis != NONE) { + if ((grow_incr == 1 && local_box[grow_axis][0] == grow_axis_val) || + (grow_incr == -1 && local_box[grow_axis][1] == grow_axis_val)) { + if (local_box[grow_axis][1] - local_box[grow_axis][0] < 2) { + grow_status = false; + } + } + } + + bool shrink_status = shrink_axis==NONE ? false : true; + if (shrink_axis != NONE) { + if ((shrink_incr == 1 && local_box[shrink_axis][0] == shrink_axis_val) || + (shrink_incr == -1 && local_box[shrink_axis][1] == shrink_axis_val)) { + if (local_box[shrink_axis][1] - local_box[shrink_axis][0] < 2) { + shrink_status = false; + } + } + } + +#ifdef HAVE_MPI + int statusints[2] = { grow_status ? 0 : 1, shrink_status ? 0 : 1 }; + int globalstatus[2] = { 0, 0 }; + MPI_Allreduce(&statusints, &globalstatus, 2, MPI_INT, MPI_SUM, MPI_COMM_WORLD); + grow_status = globalstatus[0]>0 ? false : true; + shrink_status = globalstatus[1]>0 ? false : true; +#endif + + if (grow_status == false && shrink_status == false) break; + + if (grow_status && grow_axis != NONE) { + if (local_box[grow_axis][0] == grow_axis_val) { + local_box[grow_axis][0] += grow_incr; + } + + if (local_box[grow_axis][1] == grow_axis_val) { + local_box[grow_axis][1] += grow_incr; + } + } + + if (shrink_status && shrink_axis != NONE) { + if (local_box[shrink_axis][0] == shrink_axis_val) { + local_box[shrink_axis][0] += shrink_incr; + } + + if (local_box[shrink_axis][1] == shrink_axis_val) { + local_box[shrink_axis][1] += shrink_incr; + } + } + + compute_imbalance(global_box, local_box, + cur_imbalance, cur_std_dev, doc, false); + } +} + +}//namespace miniFE + +#endif + diff --git a/tests/apps/miniFE/tests/utils/miniFE_no_info.hpp b/tests/apps/miniFE/tests/utils/miniFE_no_info.hpp new file mode 100644 index 0000000000..7dc5d6f1d4 --- /dev/null +++ b/tests/apps/miniFE/tests/utils/miniFE_no_info.hpp @@ -0,0 +1,39 @@ +//@HEADER +// ************************************************************************ +// +// MiniFE: Simple Finite Element Assembly and Solve +// Copyright (2006-2013) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA +// +// ************************************************************************ +//@HEADER + +#ifndef miniFE_no_info_hpp +#define miniFE_no_info_hpp + +#define MINIFE_HOSTNAME "unknown" +#define MINIFE_KERNEL_NAME "unknown" +#define MINIFE_KERNEL_RELEASE "unknown" +#define MINIFE_PROCESSOR "unknown" + +#define MINIFE_CXX "unknown" +#define MINIFE_CXXFLAGS "unknown" + +#endif diff --git a/tests/apps/miniFE/tests/utils/miniFE_version.h b/tests/apps/miniFE/tests/utils/miniFE_version.h new file mode 100644 index 0000000000..6ae83984f0 --- /dev/null +++ b/tests/apps/miniFE/tests/utils/miniFE_version.h @@ -0,0 +1,35 @@ +#ifndef _minife_version_h_ +#define _minife_version_h_ + +//@HEADER +// ************************************************************************ +// +// miniFE: simple finite-element assembly and linear-solve +// Copyright (2006) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA +// Questions? Contact Michael A. Heroux (maherou@sandia.gov) +// +// ************************************************************************ +//@HEADER + +#define MINIFE_VERSION "2.0" + +#endif + diff --git a/tests/apps/miniFE/tests/utils/mytimer.cpp b/tests/apps/miniFE/tests/utils/mytimer.cpp new file mode 100644 index 0000000000..c89626323f --- /dev/null +++ b/tests/apps/miniFE/tests/utils/mytimer.cpp @@ -0,0 +1,132 @@ + +//@HEADER +// ************************************************************************ +// +// MiniFE: Simple Finite Element Assembly and Solve +// Copyright (2006-2013) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA +// +// ************************************************************************ +//@HEADER + +#include +#include +#include + +#ifdef HAVE_MPI +#include +#endif + +namespace miniFE { + +///////////////////////////////////////////////////////////////////////// + +// Function to return time in seconds. +// If compiled with no flags, return CPU time (user and system). +// If compiled with -DWALL, returns elapsed time. + +///////////////////////////////////////////////////////////////////////// + +#if defined(HAVE_MPI) && defined(USE_MPI_WTIME) + +timer_type mytimer() +{ + return((timer_type) MPI_Wtime()); +} + + +#elif defined(UseClock) + +#include +timer_type mytimer(void) +{ + clock_t t1; + static clock_t t0=0; + static timer_type CPS = CLOCKS_PER_SEC; + timer_type d; + + if (t0 == 0) t0 = clock(); + t1 = clock() - t0; + d = t1 / CPS; + return(d); +} + +#elif defined(WALL) + +#include +#include +#include +timer_type mytimer(void) +{ + struct timeval tp; + static long start=0, startu; + if (!start) + { + gettimeofday(&tp, NULL); + start = tp.tv_sec; + startu = tp.tv_usec; + return(0.0); + } + gettimeofday(&tp, NULL); + return( ((timer_type) (tp.tv_sec - start)) + (tp.tv_usec-startu)/1000000.0 ); +} + +#elif defined(UseTimes) + +#include +#include +#include +timer_type mytimer(void) +{ + struct tms ts; + static timer_type ClockTick=0.0; + + if (ClockTick == 0.0) ClockTick = (timer_type) sysconf(_SC_CLK_TCK); + times(&ts); + return( (timer_type) ts.tms_utime / ClockTick ); +} + +#else + +#include +#include +#include +timer_type mytimer(void) +{ +//This function now uses gettimeofday instead of getrusage. See note below. +// + struct timeval tv; + struct timezone tz; + gettimeofday(&tv, &tz); + return ( (timer_type)tv.tv_sec + tv.tv_usec/1000000.0 ); + +//The below use of 'getrusage' is not used because it doesn't do the right thing +//for the case of using threads. It adds up the time spent in multiple threads, +//rather than giving elapsed time. +// +// struct rusage ruse; +// getrusage(RUSAGE_SELF, &ruse); +// return( (timer_type)(ruse.ru_utime.tv_sec+ruse.ru_utime.tv_usec / 1000000.0) ); +} + +#endif + +}//namespace miniFE + diff --git a/tests/apps/miniFE/tests/utils/mytimer.hpp b/tests/apps/miniFE/tests/utils/mytimer.hpp new file mode 100644 index 0000000000..824dbee16d --- /dev/null +++ b/tests/apps/miniFE/tests/utils/mytimer.hpp @@ -0,0 +1,52 @@ +#ifndef _mytimer_hpp_ +#define _mytimer_hpp_ + +//@HEADER +// ************************************************************************ +// +// MiniFE: Simple Finite Element Assembly and Solve +// Copyright (2006-2013) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA +// +// ************************************************************************ +//@HEADER + +namespace miniFE { + +typedef double timer_type; + +timer_type mytimer(); + +enum CG_TIMES { + WAXPY = 0, + DOT = 1, + MATVEC = 2, + MATVECDOT = 3, + TOTAL = 4, + NUM_TIMERS = 5 +}; + +//Use TICK and TOCK to time a code section +#define TICK() t0 = mytimer(); +#define TOCK(t) t += mytimer() - t0; + +}//namespace miniFE + +#endif diff --git a/tests/apps/miniFE/tests/utils/outstream.hpp b/tests/apps/miniFE/tests/utils/outstream.hpp new file mode 100644 index 0000000000..bff02cd214 --- /dev/null +++ b/tests/apps/miniFE/tests/utils/outstream.hpp @@ -0,0 +1,45 @@ +//@HEADER +// ************************************************************************ +// +// MiniFE: Simple Finite Element Assembly and Solve +// Copyright (2006-2013) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA +// +// ************************************************************************ +//@HEADER + +#ifndef _outstream_hpp_ +#define _outstream_hpp_ + +#include +#include + +inline +std::ostream& outstream(int np=1, int p=0) +{ + static bool first = true; + static std::ostringstream oss; + if (first) oss << "minife_debug."< + +#include +#include + +namespace Mantevo { + +//------------------------------------------------------------- +void read_args_into_string(int argc, char** argv, std::string& arg_string) +{ + arg_string = argv[0]; + for(int i=1; i +#include + +//Parameter-parsing Utilities: +// +//The functions declared below are intended to assist with parsing +//input-parameters which may be command-line arguments and/or lines in a +//text file. +// +// Scenario: You want your program to accept parameters that are specified +// as command-line arguments and/or as lines in a text file (such +// as a YAML output file). i.e., your program can be run like this: +// % program.exe foo=3.14159 bar: 42 +// or +// % program.exe input_file=params.txt +// or +// % program.exe foo=3.14159 input_file = params.txt +// +//Example: +// Here is example code to obtain parameters using the 3 functions +// 'read_args_into_string', 'read_file_into_string' and 'parse_parameter': +// +// std::string arg_string; +// +// //put command-line-arguments into 'arg_string': +// read_args_into_string(argc, argv, arg_string); +// +// //do the command-line-arguments specify an 'input_file'? +// std::string filename = +// parse_parameter(arg_string,"input_file","none-specified"); +// +// if (filename != "none-specified") { +// std::string tmp; +// read_file_into_string(filename, tmp); +// arg_string += tmp; +// } +// +// //now parse the parameters: +// float foo = parse_parameter(arg_string, "foo", -9.9); +// int bar = parse_parameter(arg_string, "bar", -1); +// +//See the comments below for parse_parameter, for formatting requirements of +//named parameter-value pairs. +// + +namespace Mantevo { + +/** + * Concatenate command-line arguments into a single string. + * + * Note: this function is purely serial. If argc and argv have different + * values on different MPI processes, then you need to resolve that by + * broadcasting arg_string's contents. + */ +void read_args_into_string(int argc, char** argv, std::string& arg_string); + +/** + * Read the contents of a text-file into a single string. + * + * Note: this function is purely serial. If you want file_contents on multiple + * MPI processes, you need to broadcast it (or call this function on each + * MPI process...). + */ +void read_file_into_string(const std::string& filename, + std::string& file_contents); + +/** + * Parse a named parameter value from input 'arg_string'. + * + * Search 'arg_string' for an occurrence of param_name and attempt to parse + * a value into the return-type. If param_name is not found, then default_value + * is returned. + * + * Example: + * arg_string = "foo = 3.14159"; + * float foo = parse_parameter(arg_string, "foo", -999.9); + * //foo should now contain the value 3.14159; if 'foo' was not found in + * //arg_string, then -999.9 would have been returned. + * + * Other legal name-value separators are ':' and ' '. Extra spaces are also ok, + * e.g. "foo : 3.114159". + * + * Note that if a YAML file is read into a string, that would be a valid input + * string for this function. + */ +template +T parse_parameter(const std::string& arg_string, + const std::string& param_name, + const T& default_value) +{ + std::string::size_type pos = arg_string.find(param_name); + if (pos == std::string::npos) { + //if param_name is not found in arg_string, return default_value: + return default_value; + } + + pos += param_name.size(); + + if (arg_string.size() <= pos) return default_value; + + //skip past ' ', '=' or ':': + while(pos < arg_string.size() && + (arg_string[pos] == ' ' || + arg_string[pos] == '=' || + arg_string[pos] == ':')) + { + ++pos; + } + + if (arg_string[pos] == '=' || arg_string[pos] == ':') ++pos; + + std::string str = arg_string.substr(pos); + + std::istringstream isstr(str); + + T return_val = default_value; + + //parse value into return_val: + isstr >> return_val; + + //if parse failed, return default_value: + if (!isstr) return default_value; + + return return_val; +} + +}//namespace Mantevo + +#endif + diff --git a/tests/apps/miniFE/tests/utils/utils.cpp b/tests/apps/miniFE/tests/utils/utils.cpp new file mode 100644 index 0000000000..29fcc8fe2e --- /dev/null +++ b/tests/apps/miniFE/tests/utils/utils.cpp @@ -0,0 +1,136 @@ + +//@HEADER +// ************************************************************************ +// +// MiniFE: Simple Finite Element Assembly and Solve +// Copyright (2006-2013) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA +// +// ************************************************************************ +//@HEADER + +#include +#include +#include +#include + +#ifdef HAVE_MPI +#include +#endif + +#ifdef MINIFE_HAVE_TPI +#include +#endif + +#ifdef MINIFE_HAVE_TBB +#include +#endif + +#include +#include +#include + +namespace miniFE { + +//------------------------------------------------------------- +void get_parameters(int argc, char** argv, Parameters& params) +{ + std::string argstring; + Mantevo::read_args_into_string(argc, argv, argstring); + + std::string garbage("garbage"); + std::string filename = + Mantevo::parse_parameter(argstring, "input_file", garbage); + + if (filename != garbage) { + Mantevo::read_file_into_string(filename, argstring); + } + + params.nx = Mantevo::parse_parameter(argstring, "nx", 10); + params.ny = Mantevo::parse_parameter(argstring, "ny", params.nx); + params.nz = Mantevo::parse_parameter(argstring, "nz", params.ny); + params.load_imbalance = + Mantevo::parse_parameter(argstring, "load_imbalance", 0); + params.numthreads = Mantevo::parse_parameter(argstring, "numthreads", 1); + params.mv_overlap_comm_comp = Mantevo::parse_parameter(argstring, "mv_overlap_comm_comp", 0); + params.use_locking = Mantevo::parse_parameter(argstring, "use_locking", 0); + params.name = Mantevo::parse_parameter(argstring, "name",""); + params.elem_group_size = Mantevo::parse_parameter(argstring, "elem_group_size", 1); + params.use_elem_mat_fields = Mantevo::parse_parameter(argstring, "use_elem_mat_fields", 1); + params.verify_solution = Mantevo::parse_parameter(argstring, "verify_solution", 0); + params.device = Mantevo::parse_parameter(argstring, "device", 0); + params.num_devices = Mantevo::parse_parameter(argstring, "num_devices", 2); + params.skip_device = Mantevo::parse_parameter(argstring, "skip_device", 9999); + params.numa = Mantevo::parse_parameter(argstring, "numa", 1); +} + +//------------------------------------------------------------- +void broadcast_parameters(Parameters& params) +{ +#ifdef HAVE_MPI + const int num_int_params = 13; + int iparams[num_int_params] = {params.nx, params.ny, params.nz, params.numthreads, params.mv_overlap_comm_comp, params.use_locking, + params.elem_group_size, params.use_elem_mat_fields, params.verify_solution, + params.device, params.num_devices,params.skip_device,params.numa}; + MPI_Bcast(&iparams[0], num_int_params, MPI_INT, 0, MPI_COMM_WORLD); + params.nx = iparams[0]; + params.ny = iparams[1]; + params.nz = iparams[2]; + params.numthreads = iparams[3]; + params.mv_overlap_comm_comp = iparams[4]; + params.use_locking = iparams[5]; + params.elem_group_size = iparams[6]; + params.use_elem_mat_fields = iparams[7]; + params.verify_solution = iparams[8]; + params.device = iparams[9]; + params.num_devices = iparams[10]; + params.skip_device = iparams[11]; + params.numa = iparams[12]; + + float fparams[1] = {params.load_imbalance}; + MPI_Bcast(&fparams[0], 1, MPI_FLOAT, 0, MPI_COMM_WORLD); + params.load_imbalance = fparams[0]; + +#endif +} + +//------------------------------------------------------------- +void initialize_mpi(int argc, char** argv, int& numprocs, int& myproc) +{ +#ifdef HAVE_MPI + MPI_Init(&argc, &argv); + MPI_Comm_size(MPI_COMM_WORLD, &numprocs); + MPI_Comm_rank(MPI_COMM_WORLD, &myproc); +#else + numprocs = 1; + myproc = 0; +#endif +} + +//------------------------------------------------------------- +void finalize_mpi() +{ +#ifdef HAVE_MPI + MPI_Finalize(); +#endif +} + +}//namespace miniFE + diff --git a/tests/apps/miniFE/tests/utils/utils.hpp b/tests/apps/miniFE/tests/utils/utils.hpp new file mode 100644 index 0000000000..263294d52b --- /dev/null +++ b/tests/apps/miniFE/tests/utils/utils.hpp @@ -0,0 +1,204 @@ +#ifndef _utils_hpp_ +#define _utils_hpp_ + +//@HEADER +// ************************************************************************ +// +// MiniFE: Simple Finite Element Assembly and Solve +// Copyright (2006-2013) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA +// +// ************************************************************************ +//@HEADER + +#include +#include +#include +#include + +#ifdef HAVE_MPI +#include +#endif + +#include +#include + +namespace miniFE { + +void get_parameters(int argc, char** argv, Parameters& params); + +void broadcast_parameters(Parameters& params); + +void initialize_mpi(int argc, char** argv, int& numprocs, int& myproc); + +void finalize_mpi(); + +template +Scalar percentage_difference(Scalar value, Scalar average) +{ + //result will be the difference between value and average, represented as + //a percentage of average. + //Examples: + // if value=100 and average=50, result is 100% + // if value=500 and average=400, result is 25% + + //Note: if average is 0, result is undefined. We'll return -1.0; + + Scalar result = std::abs(value-average); + if (std::abs(average) > 1.e-5) { + result /= average; + result *= 100; + } + else result = -1; + + return result; +} + +template +void get_global_min_max(GlobalOrdinal local_n, + GlobalOrdinal& global_n, + GlobalOrdinal& min_n, + int& min_proc, + GlobalOrdinal& max_n, + int& max_proc) +{ +//Given a local_n, compute global_n, min/max, etc. All computed results +//will be returned on all processors. +// + int numprocs = 1, myproc = 0; +#ifdef HAVE_MPI + MPI_Comm_size(MPI_COMM_WORLD, &numprocs); + MPI_Comm_rank(MPI_COMM_WORLD, &myproc); +#endif + + std::vector all_n(numprocs, 0); + all_n[myproc] = local_n; +#ifdef HAVE_MPI + std::vector tmp(all_n); + MPI_Datatype mpi_dtype = TypeTraits::mpi_type(); + MPI_Allreduce(&tmp[0], &all_n[0], numprocs, mpi_dtype, MPI_MAX, MPI_COMM_WORLD); +#endif + + global_n = 0; + min_n= 5*local_n; + min_proc = 0; + max_n= 0; + max_proc = 0; + + for(int i=0; i= max_n) { + max_n = all_n[i]; + max_proc = i; + } + } +} + +template +Scalar compute_std_dev_as_percentage(Scalar local_nrows, + Scalar avg_nrows) +{ +//compute and return a standard deviation for the deviation of local_nrows from the average. +//the std. dev. will be expressed as a percentage of avg_nrows. +// +//Input argument local_nrows is really a integer, but taking it as a floating-point scalar is +//harmless. +// +#ifdef HAVE_MPI + int numprocs = 1, myproc = 0; + MPI_Comm_size(MPI_COMM_WORLD, &numprocs); + MPI_Comm_rank(MPI_COMM_WORLD, &myproc); + MPI_Datatype mpi_dtype = TypeTraits::mpi_type(); + +//If it's significantly more efficient, we may consider using MPI_Gather below instead of +//MPI_Allgather. We really only need to compute std.dev. on proc 0... +// +//(But for now, use MPI_Allgather and compute on all procs.) + + std::vector all_nrows(numprocs, 0); + MPI_Allgather(&local_nrows, 1, mpi_dtype, &all_nrows[0], 1, mpi_dtype, MPI_COMM_WORLD); + + //turn all_nrows contents into deviations, add to sum-of-squares-of-deviations: + Scalar sum_sqr_dev = 0; + for(size_t i=0; i1 ? std::sqrt(tmp1/(numprocs-1)) : 0; + + //std_dev is now the standard deviation of rows-per-processor with respect + //to avg_nrows. + //Next turn std_dev into a percentage of avg_nrows: + std_dev /= avg_nrows; + std_dev *= 100; + return std_dev; +#else + return 0; +#endif +} + +template +GlobalOrdinal find_row_for_id(GlobalOrdinal id, + const std::map& ids_to_rows) +{ + typename std::map::const_iterator + iter = ids_to_rows.lower_bound(id); + + if (iter == ids_to_rows.end() || iter->first != id) { + if (ids_to_rows.size() > 0) { + --iter; + } + else { + std::cout << "ERROR, failed to map id to row."<first == id) { + return iter->second; + } + + if (iter == ids_to_rows.begin() && iter->first > id) { + std::cout << "ERROR, id:" << id << ", ids_to_rows.begin(): " << iter->first<first; + + if (offset < 0) { + std::cout << "ERROR, negative offset in find_row_for_id for id="<second + offset; +} + +}//namespace miniFE + +#endif + diff --git a/tests/apps/prk/.gitignore b/tests/apps/prk/.gitignore new file mode 100644 index 0000000000..884dff2449 --- /dev/null +++ b/tests/apps/prk/.gitignore @@ -0,0 +1,9 @@ +*~ +*.o +*.log +*.trs +family-*/ +compile +test-driver +test-suite.log.orig +job.*.out diff --git a/tests/apps/prk/Makefile.am b/tests/apps/prk/Makefile.am new file mode 100644 index 0000000000..39cbee2e65 --- /dev/null +++ b/tests/apps/prk/Makefile.am @@ -0,0 +1,3 @@ +AUTOMAKE_OPTIONS = foreign +AM_MAKEFLAGS = --no-print-directory +SUBDIRS = tests diff --git a/tests/apps/prk/bootstrap b/tests/apps/prk/bootstrap new file mode 120000 index 0000000000..b17b398013 --- /dev/null +++ b/tests/apps/prk/bootstrap @@ -0,0 +1 @@ +../../bootstrap \ No newline at end of file diff --git a/tests/apps/prk/configure.ac b/tests/apps/prk/configure.ac new file mode 100644 index 0000000000..389f38e4dd --- /dev/null +++ b/tests/apps/prk/configure.ac @@ -0,0 +1,35 @@ +AC_PREREQ([2.63]) +AC_INIT([prk], [2.12.0], [karl.w.schulz@intel.com]) +AM_INIT_AUTOMAKE +m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) + +# set compilers to use MPI toolchain + +CC=mpicc +CXX=mpicxx +FC=mpif90 + +# test compilers + +AC_PROG_CC +AC_PROG_FC +AC_PROG_CXX + +AC_OUTPUT( Makefile tests/Makefile) + +echo +echo '-------------------------------------------------- SUMMARY --------------------------------------------------' +echo +echo Package version............... : $PACKAGE-$VERSION +echo OHPC compiler toolchain........ : $LMOD_FAMILY_COMPILER +echo OHPC MPI toolchain............. : $LMOD_FAMILY_MPI +echo +echo C compiler.................... : `which $CC` +echo C++ compiler.................. : `which $CXX` +echo Fortran compiler ............. : `which $FC` +echo +echo C compiler flags.............. : $CFLAGS +echo C++ compiler flags............ : $CXXFLAGS +echo Fortran compiler flags........ : $FCFLAGS +echo +echo '-------------------------------------------------------------------------------------------------------------' diff --git a/tests/apps/prk/ohpc-tests/test_PRK b/tests/apps/prk/ohpc-tests/test_PRK new file mode 100755 index 0000000000..a741cf8bc9 --- /dev/null +++ b/tests/apps/prk/ohpc-tests/test_PRK @@ -0,0 +1,50 @@ +#!/bin/bash +# -*-sh-*- + +TEST_LOGS="" +MAKEFLAGS="" + +source ./TEST_ENV || exit 1 +source ./common/functions || exit 1 + +cd apps/prk || exit 1 +export BATS_JUNIT_CLASS=PRK + +# bootstrap the local autotools project + +./bootstrap || exit 1 + +make_check_failure=0 + +for compiler in $COMPILER_FAMILIES ; do + for mpi in $MPI_FAMILIES ; do + + echo " " + echo " " + echo "-------------------------------------------------------" + echo "Apps: PRK tests: $compiler-$mpi" + echo "-------------------------------------------------------" + + rm -f tests/job.*.out >& /dev/null + + module purge || exit 1 + module load prun || exit 1 + module load $compiler || exit 1 + module load $mpi || exit 1 + + ./configure || exit 1 + make clean || exit 1 + + make -k check + if [ $? != 0 ] ; then + make_check_failure=1 + fi + + save_logs_mpi_family tests $compiler $mpi + mv -f tests/job.*.out tests/family-$compiler-$mpi + + make distclean + done +done + +exit $make_check_failure diff --git a/tests/apps/prk/tests/.gitignore b/tests/apps/prk/tests/.gitignore new file mode 100644 index 0000000000..e5c483c99f --- /dev/null +++ b/tests/apps/prk/tests/.gitignore @@ -0,0 +1,13 @@ +branch +func.c +dgemm +nstream +random +reduce +sparse +stencil +global +p2p +transpose +private +shared diff --git a/tests/apps/prk/tests/CHARM++/Stencil/Makefile.ohpc b/tests/apps/prk/tests/CHARM++/Stencil/Makefile.ohpc new file mode 100644 index 0000000000..86a8e3ebe4 --- /dev/null +++ b/tests/apps/prk/tests/CHARM++/Stencil/Makefile.ohpc @@ -0,0 +1,42 @@ +include ../../common/CHARM++.defs +##### User configurable options ##### + +OPTFLAGS = $(DEFAULT_OPT_FLAGS) +#description: change above into something that is a decent optimization on you system + +#uncomment any of the following flags (and change values) to change defaults + +#RESTRICTFLAG = -DRESTRICT_KEYWORD +#description: the "restrict" keyword can be used on IA platforms to disambiguate +# data accessed through pointers + +RADIUSFLAG = -DRADIUS=2 +#description: default radius of filter to be applied is 2 + +DOUBLEFLAG = -DDOUBLE +#description: default data type is single precision + +STARFLAG = -DSTAR +#description: default stencil is compact (dense, square) + +#DEBUGFLAG = -DVERBOSE +#description: default diagnostic style is silent + +USERFLAGS = +#description: parameter to specify optional flags + +#set the following variables for custom libraries and/or other objects +EXTOBJS = +LIBS = -lm +LIBPATHS = +INCLUDEPATHS = + +### End User configurable options ### + +TUNEFLAGS = $(RESTRICTFLAG) $(DEBUGFLAG) $(USERFLAGS) \ + $(DOUBLEFLAG) $(RADIUSFLAG) $(STARFLAG) +PROGRAM = stencil +OBJS = $(PROGRAM).o $(COMOBJS) + +include ../../common/make.common + diff --git a/tests/apps/prk/tests/CHARM++/Stencil/ci_reqs.h b/tests/apps/prk/tests/CHARM++/Stencil/ci_reqs.h new file mode 100644 index 0000000000..fafb932aa8 --- /dev/null +++ b/tests/apps/prk/tests/CHARM++/Stencil/ci_reqs.h @@ -0,0 +1,2 @@ +#define WEIGHTSIZE ((2*RADIUS+1)*(2*RADIUS+1)) +#define RADIUSTIMESWIDTH ((RADIUS)*(width)) diff --git a/tests/apps/prk/tests/CHARM++/Stencil/stencil.C b/tests/apps/prk/tests/CHARM++/Stencil/stencil.C new file mode 100644 index 0000000000..ae4a8b7935 --- /dev/null +++ b/tests/apps/prk/tests/CHARM++/Stencil/stencil.C @@ -0,0 +1,357 @@ +#include "stencil.decl.h" +#include + +#define EPSILON 1.e-8 +#define COEFX 1.0 +#define COEFY 1.0 +#define TINDEX(i,j) (i+RADIUS+(width+2*RADIUS)*(j+RADIUS)) +#define temp(i,j) temperature[TINDEX(i,j)] +#define TNINDEX(i,j) (i+width*(j)) +#define temp_new(i,j) new_temperature[TNINDEX(i,j)] +#define WEIGHT(i,j) weight[i+RADIUS+(j+RADIUS)*(2*RADIUS+1)] +#define LEFT 1111 +#define RIGHT 2222 +#define BOTTOM 3333 +#define TOP 4444 + +/*readonly*/ CProxy_Main mainProxy; +/*readonly*/ int n; // array size +/*readonly*/ int overdecomposition; +/*readonly*/ int maxiterations; +/*readonly*/ double weight[(2*RADIUS+1)*(2*RADIUS+1)]; + +// specify the number of worker chares in each dimension +/*readonly*/ int num_chare_rows; +/*readonly*/ int num_chare_cols; +/*readonly*/ double startTime, endTime; + +class ghostMsg : public CMessage_ghostMsg { +public: + int dir; + int size; + double *edge; + ghostMsg(int _d, int _s) : dir(_d), size(_s) { + } +}; + +class Main : public CBase_Main +{ + +public: + CProxy_Stencil array; + + Main(CkArgMsg* m) { + + int num_chares, min_size; + long nsquare; + + if (m->argc != 4) { + CkPrintf("%s \n", m->argv[0]); + CkExit(); + } + + // store the main proxy + mainProxy = thisProxy; + + maxiterations = atoi(m->argv[1]); + if (maxiterations < 1) { + CkPrintf("ERROR: maxiterations must be positive: %d", maxiterations); + CkExit(); + } + + n = atoi(m->argv[2]); + nsquare = n * n; + if (nsquare < CkNumPes()) { + CkPrintf("ERROR: Grid size %ld must be larger than #PEs %d", + nsquare, CkNumPes()); + CkExit(); + } + + overdecomposition = atoi(m->argv[3]); + if (n < overdecomposition) { + CkPrintf("ERROR: Grid size %d must be larger than overdecomposition %d", + n, overdecomposition); + CkExit(); + } + + if (RADIUS < 0) { + CkPrintf("ERROR: Stencil radius %d should be non-negative\n", RADIUS); + CkExit(); + } + + if (2*RADIUS +1 > n) { + CkPrintf("ERROR: Stencil diameter %d exceeds grid size %d\n", 2*RADIUS +1 , n); + CkExit(); + } + + // compute decomposition that has smallest surface/volume ratio + num_chares = CkNumPes()*overdecomposition; + for (num_chare_cols= (int) (sqrt(num_chares+1)); num_chare_cols>0; num_chare_cols--) { + if (!(num_chares%num_chare_cols)) { + num_chare_rows = num_chares/num_chare_cols; + break; + } + } + min_size = (n+num_chare_cols-1)/num_chare_cols; + if (min_size 0) { + ghostMsg *msg = new (height*RADIUS) ghostMsg(LEFT, height); + if (!msg) { + CkPrintf("Could not allocate space for message\n"); + CkExit(); + } + CkSetRefNum(msg, iterations); + for(int j=0, k=0;jedge[k++] = temp(i,j); + thisProxy(thisIndex.x-1, thisIndex.y).receiveGhosts(msg); + } + + // Send my right edge + if (thisIndex.x < num_chare_cols-1) { + ghostMsg *msg = new (height*RADIUS) ghostMsg(RIGHT, height); + if (!msg) { + CkPrintf("Could not allocate space for message\n"); + CkExit(); + } + CkSetRefNum(msg, iterations); + for(int j=0, k=0;jedge[k++] = temp(width-RADIUS+i,j); + thisProxy(thisIndex.x+1, thisIndex.y).receiveGhosts(msg); + } + + // Send my bottom edge + if (thisIndex.y > 0) { + ghostMsg *msg = new (width*RADIUS) ghostMsg(BOTTOM, width); + if (!msg) { + CkPrintf("Could not allocate space for message\n"); + CkExit(); + } + CkSetRefNum(msg, iterations); + for (int j=0, k=0; jedge[k++] = temp(i,j); + thisProxy(thisIndex.x, thisIndex.y-1).receiveGhosts(msg); + } + + // Send my top edge + if (thisIndex.y < num_chare_rows-1) { + ghostMsg *msg = new (width*RADIUS) ghostMsg(TOP, width); + if (!msg) { + CkPrintf("Could not allocate space for message\n"); + CkExit(); + } + CkSetRefNum(msg, iterations); + for (int j=0, k=0; jedge[k++] = temp(i,height-RADIUS+j); + thisProxy(thisIndex.x, thisIndex.y+1).receiveGhosts(msg); + } + } + + void processGhosts(ghostMsg *msg) { + int k; k=0; + int size = msg->size; + + switch(msg->dir) { + case LEFT: + for(int j=0;jedge[k++]; + break; + + case RIGHT: + for(int j=0;jedge[k++]; + break; + + case BOTTOM: + for (int j=0; jedge[k++]; + } + break; + + case TOP: + for (int j=0; jedge[k++]; + break; + + default: CkPrintf("ERROR: invalid direction\n"); + CkExit(); + } + delete msg; + } + + void compute() { + + for (int j=MAX(jstart,RADIUS); j<=MIN(n-1-RADIUS,jend); j++) { + for (int i=MAX(istart,RADIUS); i<=MIN(n-1-RADIUS,iend); i++) { + + for (int jj=-RADIUS; jj<=RADIUS; jj++) { + temp_new(i-istart,j-jstart) += WEIGHT(0,jj)*temp(i-istart,j-jstart+jj); + } + for (int ii=-RADIUS; ii<0; ii++) { + temp_new(i-istart,j-jstart) += WEIGHT(ii,0)*temp(i-istart+ii,j-jstart); + } + for (int ii=1; ii<=RADIUS; ii++) { + temp_new(i-istart,j-jstart) += WEIGHT(ii,0)*temp(i-istart+ii,j-jstart); + } + } + } + } + + void compute_local_norm() { + + local_norm = 0.0; + for (int j=MAX(jstart,RADIUS); j<=MIN(n-1-RADIUS,jend); j++) { + for (int i=MAX(istart,RADIUS); i<=MIN(n-1-RADIUS,iend); i++) { + local_norm += temp_new(i-istart,j-jstart); + } + } + } +}; + +#include "stencil.def.h" diff --git a/tests/apps/prk/tests/CHARM++/Stencil/stencil.ci b/tests/apps/prk/tests/CHARM++/Stencil/stencil.ci new file mode 100644 index 0000000000..8859ea7bb3 --- /dev/null +++ b/tests/apps/prk/tests/CHARM++/Stencil/stencil.ci @@ -0,0 +1,75 @@ +mainmodule stencil { + include "ci_reqs.h"; + readonly CProxy_Main mainProxy; + readonly int n; + readonly int num_chare_rows; + readonly int num_chare_cols; + readonly int overdecomposition; + readonly double weight[WEIGHTSIZE]; + readonly double startTime; + readonly double endTime; + + readonly int maxiterations; + + message ghostMsg { + double edge[]; + }; + + mainchare Main { + entry Main(CkArgMsg *m); + entry void report(double); + }; + + array [2D] Stencil { + entry Stencil(void); + entry void begin_iteration(void); + entry void receiveGhosts(ghostMsg *msg); + entry void processGhosts(ghostMsg *msg); + entry [reductiontarget] void global_norm(double result); + entry [reductiontarget] void barrier_start(void); + entry [reductiontarget] void barrier_stop(void); + + entry void run() { + for (iterations=0; iterations<=maxiterations; iterations++) { + if (iterations == 1) { + serial "start the timer" { + // implement a barrier by doing an empty collective; then start the timer + CkCallback cb(CkReductionTarget(Stencil, barrier_start), thisProxy); + contribute(0, NULL, CkReduction::nop, cb); + } + when barrier_start(void) serial "barrier_start" { + if (thisIndex.x==0 && thisIndex.y==0) startTime = CkWallTimer(); + } + } + + serial "begin_iteration" { + begin_iteration(); + } + for (messages_due=0; messages_due < max_messages_due; messages_due++) { + when receiveGhosts[iterations](ghostMsg *msg) + serial "processGhosts" { + processGhosts(msg); + } + } + serial "compute" { + compute(); + } + } + serial "stop the timer" { + CkCallback cb(CkReductionTarget(Stencil, barrier_stop), thisProxy); + contribute(0, NULL, CkReduction::nop, cb); + } + when barrier_stop(void) serial "barrier_stop" { + if (thisIndex.x == 0 && thisIndex.y == 0) endTime = CkWallTimer(); + } + serial "compute solution norm" { + compute_local_norm(); + CkCallback cb(CkReductionTarget(Stencil, global_norm), thisProxy); + contribute(sizeof(double), &local_norm, CkReduction::sum_double, cb); + } + when global_norm(double result) serial "report solution norm" { + if (thisIndex.x==0 && thisIndex.y==0) mainProxy.report(result); + } + }; + }; +}; diff --git a/tests/apps/prk/tests/CHARM++/Synch_p2p/Makefile.ohpc b/tests/apps/prk/tests/CHARM++/Synch_p2p/Makefile.ohpc new file mode 100644 index 0000000000..f789fe3806 --- /dev/null +++ b/tests/apps/prk/tests/CHARM++/Synch_p2p/Makefile.ohpc @@ -0,0 +1,32 @@ +include ../../common/CHARM++.defs +##### User configurable options ##### + +OPTFLAGS = $(DEFAULT_OPT_FLAGS) +#description: change above into something that is a decent optimization on you system + +#uncomment any of the following flags (and change values) to change defaults + +#RESTRICTFLAG = -DRESTRICT_KEYWORD +#description: the "restrict" keyword can be used on IA platforms to disambiguate +# data accessed through pointers + +#DEBUGFLAG = -DVERBOSE +#description: default diagnostic style is silent + +USERFLAGS = +#description: parameter to specify optional flags + +#set the following variables for custom libraries and/or other objects +EXTOBJS = +LIBS = +LIBPATHS = +INCLUDEPATHS = + +### End User configurable options ### + +TUNEFLAGS = $(RESTRICTFLAG) $(DEBUGFLAG) $(USERFLAGS) +PROGRAM = p2p +OBJS = $(PROGRAM).o $(COMOBJS) + +include ../../common/make.common + diff --git a/tests/apps/prk/tests/CHARM++/Synch_p2p/p2p.C b/tests/apps/prk/tests/CHARM++/Synch_p2p/p2p.C new file mode 100644 index 0000000000..892fa3500e --- /dev/null +++ b/tests/apps/prk/tests/CHARM++/Synch_p2p/p2p.C @@ -0,0 +1,229 @@ +#include "p2p.decl.h" +#include + +#define EPSILON 1.e-8 +#define ARRAY(i,j) vector[i+1+(j)*(width+1)] + +/*readonly*/ CProxy_Main mainProxy; +/*readonly*/ int n; // array size +/*readonly*/ int m; // array size +/*readonly*/ int overdecomposition; +/*readonly*/ int maxiterations; +/*readonly*/ int grp; + +// specify the number of worker chares in each dimension +/*readonly*/ int num_chares; +/*readonly*/ double startTime, endTime; + +class ghostMsg : public CMessage_ghostMsg { +public: + double *gp; + ghostMsg(){ + } +}; + +class cornerMsg : public CMessage_cornerMsg { +public: + double *gp; + cornerMsg(){ + } +}; + +class Main : public CBase_Main +{ + +public: + CProxy_P2p array; + + Main(CkArgMsg* cmdlinearg) { + if (cmdlinearg->argc != 5 && cmdlinearg->argc != 6 ) { + CkPrintf("%s <#iterations> ", + cmdlinearg->argv[0]); + CkPrintf("[group factor]\n"); + CkExit(); + } + + // store the main proxy + mainProxy = thisProxy; + + maxiterations = atoi(cmdlinearg->argv[1]); + if (maxiterations < 1) { + CkPrintf("ERROR: #iterations must be positive: %d", maxiterations); + CkExit(); + } + m = atoi(cmdlinearg->argv[2]); + if (m < CkNumPes()) { + CkPrintf("ERROR: Horizontal grid size %d smaller than #PEs %d\n", m, CkNumPes()); + CkExit(); + } + + n = atoi(cmdlinearg->argv[3]); + if (n < 1) { + CkPrintf("ERROR: Vertical grid size must be positive: %d\n", n); + CkExit(); + } + + overdecomposition = atoi(cmdlinearg->argv[4]); + if (overdecomposition<1) { + CkPrintf("ERROR: Overdecomposition factor must be positive: %d\n", overdecomposition); + CkExit(); + } + + if (cmdlinearg->argc==6) { + grp = atoi(cmdlinearg->argv[5]); + if (grp < 1) grp = 1; + else if (grp >= n) grp = n-1; + } + else grp = 1; + + num_chares = CkNumPes()*overdecomposition; + + if ((m-1)< num_chares) { + CkPrintf("ERROR: Interior horizontal grid size %d smaller than #chares %d\n", + m-1, num_chares); + CkExit(); + } + + // print info + CkPrintf("Charm++ pipeline execution on 2D grid\n"); + CkPrintf("Number of Charm++ PEs = %d\n", CkNumPes()); + CkPrintf("Overdecomposition = %d\n", overdecomposition); + CkPrintf("Grid sizes = %d,%d\n", m, n); + CkPrintf("Number of iterations = %d\n", maxiterations); + if (grp > 1) + CkPrintf("Group factor = %d (cheating!)\n", grp); + + // Create new array of worker chares + array = CProxy_P2p::ckNew(num_chares); + + //Start the computation + array.run(); + } + + // One worker reports back to here when it completes the workload + void report(double result) { + double totalTime, flops, diff; + double corner_val = (double) ((maxiterations+1)*(m+n-2)); + totalTime = endTime - startTime; + // flip sign of time if grouping is applied (cheating) + if (grp>1) totalTime *= -1.0; + flops = (double) (2*(n-1)) * (double) (m-1)*maxiterations; + diff = ABS(result-corner_val); + if (diff < EPSILON) { + CkPrintf("Solution validates\n"); + CkPrintf("Rate (MFlops): %lf Avg time (s) %lf\n", flops/totalTime/1.e6, totalTime/maxiterations); + } + else { + CkPrintf("Solution does not validate\n"); + } + CkPrintf("Reference corner value: %lf, corner value: %lf, |diff|: %e \n", + corner_val, result, diff); + CkExit(); + } + +}; + +class P2p: public CBase_P2p { + P2p_SDAG_CODE + +public: + int iterations; + double result; + int offset, istart, iend, j; // global grid indices of strip + int width; + double *vector; + + // Constructor, initialize values + P2p() { + int i, iloc, leftover; + + /* compute amount of space required for input and solution arrays */ + width = m/num_chares; + leftover = m%num_chares; + if (thisIndex < leftover) { + istart = (width+1) * thisIndex; + iend = istart + width; + } + else { + istart = (width+1) * leftover + width * (thisIndex-leftover); + iend = istart + width - 1; + } + width = iend - istart + 1; + + // allocate two dimensional array + vector = new double[n*(width+1)]; + if (!vector) { + CkPrintf("ERROR: Char %d could not allocate array of size %d\n", thisIndex, n*(width+1)); + CkExit(); + } + + // initialize + if (thisIndex == 0) for (j=0; jgp[jj]; + delete msg; + } + + // do the actual work + void compute() { + int iloc, jj, jjsize; + jjsize = MIN(grp, n-j); + + for (jj=j; jjgp[jj] = ARRAY(iend-istart,j+jj); + // CkPrintf("Chare %d, send_msg->[%d]=%lf\n", thisIndex, jj, msg->gp[jj]); + } + thisProxy(thisIndex+1).receiveGhost(msg); + } + } + + // Receive top right grid value and plop in 0,0 position + void processCorner(cornerMsg *msg) { + + ARRAY(0,0) = msg->gp[0]; + delete msg; + } + + // send the top right grid value to chare zero + void sendCorner(void) { + + cornerMsg *msg = new (1) cornerMsg(); + CkSetRefNum(msg, iterations); + msg->gp[0] = -ARRAY(iend-istart,n-1); + thisProxy(0).receiveCorner(msg); + } + +}; + +#include "p2p.def.h" diff --git a/tests/apps/prk/tests/CHARM++/Synch_p2p/p2p.ci b/tests/apps/prk/tests/CHARM++/Synch_p2p/p2p.ci new file mode 100644 index 0000000000..d0503083e8 --- /dev/null +++ b/tests/apps/prk/tests/CHARM++/Synch_p2p/p2p.ci @@ -0,0 +1,89 @@ +mainmodule p2p { + readonly CProxy_Main mainProxy; + readonly int n; + readonly int m; + readonly int overdecomposition; + readonly int maxiterations; + readonly int grp; + + readonly int num_chares; + readonly double startTime; + readonly double endTime; + + message ghostMsg { + double gp[]; + }; + + message cornerMsg { + double gp[]; + }; + + mainchare Main { + entry Main(CkArgMsg *m); + entry void report(double); + }; + + array [1D] P2p { + entry P2p(void); + entry void pass_baton(void); + entry void sendCorner(void); + entry void receiveGhost(ghostMsg *msg); + entry void receiveCorner(cornerMsg *msg); + entry void processGhost(ghostMsg *msg); + entry void processCorner(cornerMsg *msg); + entry [reductiontarget] void barrier_stop(void); + entry [reductiontarget] void barrier_start(void); + + entry void run() { + for (iterations=0; iterations<=maxiterations; iterations++) { + if (iterations == 1) { + serial "start the timer" { + // implement a barrier by doing an empty collective; then start the timer + CkCallback cb(CkReductionTarget(P2p, barrier_start), thisProxy); + contribute(0, NULL, CkReduction::nop, cb); + } + when barrier_start(void) serial "barrier_start" { + if (thisIndex == 0) startTime = CkWallTimer(); + } + } + for (j=1; j 0) { + when receiveGhost[j+iterations*(n-1)](ghostMsg *msg) + serial "processGhost" { + processGhost(msg); + } + } + serial "compute line segment" { + compute(); + } + serial "pass_baton" { + pass_baton(); + } + } + if (thisIndex == num_chares-1) { + serial "send corner" { + sendCorner(); + } + } + if (thisIndex == 0) { + when receiveCorner[iterations](cornerMsg *msg) + serial "processCorner" { + processCorner(msg); + } + } + + } + serial "stop the timer" { + // implement a barrier by doing an empty collective; then stop the timer + CkCallback cb(CkReductionTarget(P2p, barrier_stop), thisProxy); + contribute(0, NULL, CkReduction::nop, cb); + } + when barrier_stop(void) serial "barrier_stop" { + if (thisIndex == 0) endTime = CkWallTimer(); + } + serial "report solution norm" { + if (thisIndex==num_chares-1) mainProxy.report(ARRAY(iend-istart,n-1)); + } + }; + }; +}; diff --git a/tests/apps/prk/tests/CHARM++/Transpose/Makefile.ohpc b/tests/apps/prk/tests/CHARM++/Transpose/Makefile.ohpc new file mode 100644 index 0000000000..1990898159 --- /dev/null +++ b/tests/apps/prk/tests/CHARM++/Transpose/Makefile.ohpc @@ -0,0 +1,42 @@ +include ../../common/CHARM++.defs +##### User configurable options ##### + +OPTFLAGS = $(DEFAULT_OPT_FLAGS) +#description: change above into something that is a decent optimization on you system + +#uncomment any of the following flags (and change values) to change defaults + +RESTRICTFLAG = -DRESTRICT_KEYWORD +#description: the "restrict" keyword can be used on IA platforms to disambiguate +# data accessed through pointers + +RADIUSFLAG = -DRADIUS=2 +#description: default radius of filter to be applied is 2 + +DOUBLEFLAG = -DDOUBLE +#description: default data type is single precision + +STARFLAG = -DSTAR +#description: default stencil is compact (dense, square) + +#DEBUGFLAG = -DVERBOSE +#description: default diagnostic style is silent + +USERFLAGS = +#description: parameter to specify optional flags + +#set the following variables for custom libraries and/or other objects +EXTOBJS = +LIBS = #-mt_mpi +LIBPATHS = +INCLUDEPATHS = + +### End User configurable options ### + +TUNEFLAGS = $(RESTRICTFLAG) $(DEBUGFLAG) $(USERFLAGS) \ + $(DOUBLEFLAG) $(RADIUSFLAG) $(STARFLAG) +PROGRAM = transpose +OBJS = $(PROGRAM).o $(COMOBJS) + +include ../../common/make.common + diff --git a/tests/apps/prk/tests/CHARM++/Transpose/transpose.C b/tests/apps/prk/tests/CHARM++/Transpose/transpose.C new file mode 100644 index 0000000000..636ec055e0 --- /dev/null +++ b/tests/apps/prk/tests/CHARM++/Transpose/transpose.C @@ -0,0 +1,239 @@ +#include "transpose.decl.h" +#include + +#define A(i,j) A_p[(i+istart)+order*(j)] +#define B(i,j) B_p[(i+istart)+order*(j)] +#define Work_in(i,j) Work_in_p[i+Block_order*(j)] +#define Work_out(i,j) Work_out_p[i+Block_order*(j)] + +/*readonly*/ CProxy_Main mainProxy; +/*readonly*/ int order; // array size +/*readonly*/ int num_chares; +/*readonly*/ int overdecomposition; +/*readonly*/ int maxiterations; +/*readonly*/ int Block_order; +/*readonly*/ int Tile_order; +/*readonly*/ int tiling; +/*readonly*/ int Colblock_size; +/*readonly*/ int Block_size; +/*readonly*/ double startTime; +/*readonly*/ double endTime; +/*readonly*/ long bytes; + +class blockMsg : public CMessage_blockMsg { +public: + int blockID; + double *blockData; + blockMsg(int _t) : blockID(_t) { + } +}; + +class Main : public CBase_Main +{ + +public: + CProxy_Transpose array; + + Main(CkArgMsg* cmdlinearg) { + if (cmdlinearg->argc != 5) { + CkPrintf("%s <#iterations> \n", + cmdlinearg->argv[0]); CkExit(); + } + + // store the main proxy + mainProxy = thisProxy; + + maxiterations = atoi(cmdlinearg->argv[1]); + if (maxiterations < 1) { + CkPrintf("ERROR: #iterations must be positive: %d\n", maxiterations); + CkExit(); + } + order = atoi(cmdlinearg->argv[2]); + if (order < CkNumPes()) { + CkPrintf("ERROR: Matrix order %d smaller than #PEs %d\n", order, CkNumPes()); + CkExit(); + } + + Tile_order = atoi(cmdlinearg->argv[3]); + if (Tile_order < 1) { + CkPrintf("ERROR: Tile size must be positive: %d \n", Tile_order); + CkExit(); + } + + overdecomposition = atoi(cmdlinearg->argv[4]); + if (overdecomposition<1) { + CkPrintf("ERROR: Overdecomposition factor must be positive: %d\n", overdecomposition); + CkExit(); + } + + num_chares = CkNumPes()*overdecomposition; + if (!(order/num_chares)) { + CkPrintf("ERROR: Matrix order %d smaller than #chares %d\n", order, num_chares); + CkExit(); + } + if (order%num_chares) { + CkPrintf("ERROR: Matrix order %d not multiple of #chares $d\n", order, num_chares); + CkExit(); + } + + Block_order = order/num_chares; + Colblock_size = order * Block_order; + Block_size = Block_order * Block_order; + + tiling = (Tile_order > 0) && (Tile_order < order); + bytes = 2 * sizeof(double) * order * order; + + // print info + CkPrintf("Charm++ transpose execution\n"); + CkPrintf("Number of Charm++ PEs = %d\n", CkNumPes()); + CkPrintf("Overdecomposition = %d\n", overdecomposition); + CkPrintf("Matrix order = %d\n", order); + CkPrintf("Tile size = %d\n", Tile_order); + CkPrintf("Number of iterations = %d\n", maxiterations); + + // Create new array of worker chares + array = CProxy_Transpose::ckNew(num_chares); + + //Start the computation + array.run(); + } + + // One worker reports back to here when it completes the workload + void report(double result) { + + double epsilon = 1.e-8, avgtime; + if (result < epsilon) { + CkPrintf("Solution validates\n"); + avgtime = (endTime-startTime)/(double)maxiterations; + CkPrintf("Rate (MB/s): %lf Avg time (s): %lf\n",1.0E-06*bytes/avgtime, avgtime); + } + else + CkPrintf("Solutions does not validate; diff = %e, threshold = %e\n", + result, epsilon); + CkExit(); + } + +}; + +class Transpose: public CBase_Transpose { + Transpose_SDAG_CODE + +public: + int iterations, phase, colstart; + double result, local_error; + int send_to, recv_from; + double *A_p, *B_p, *Work_in_p, *Work_out_p; + + // Constructor, initialize values + Transpose() { + + // allocate two dimensional array + A_p = new double[Colblock_size]; + B_p = new double[Colblock_size]; + Work_in_p = new double[Block_size]; + Work_out_p = new double[Block_size]; + if (! A_p || !B_p || !Work_in_p || !Work_out_p) { + CkPrintf("Could not allocate memory for matrix blocks\n"); + CkExit(); + } + + /* set value of starting column for this chare */ + colstart = thisIndex*Block_order; + + /* Fill the original column matrix in A. */ + int istart = 0; + for (int j=0;jblockData, Work_out_p, Block_size*sizeof(double)); + thisProxy(send_to).receiveBlock(msg); + } + + // The final step is to receive the transposed block and store it in the proper place + void processBlock(blockMsg *msg) { + + memcpy(Work_in_p,msg->blockData,Block_size*sizeof(double)); + int istart = msg->blockID*Block_order; + /* scatter received block to transposed matrix; no need to tile */ + for (int j=0; j +The function is invoked with default values 10 and 40 if no +values for these variables are supplied on the make command line. + diff --git a/tests/apps/prk/tests/FG_MPI/Branch/branch.c b/tests/apps/prk/tests/FG_MPI/Branch/branch.c new file mode 100755 index 0000000000..c2bb4304dd --- /dev/null +++ b/tests/apps/prk/tests/FG_MPI/Branch/branch.c @@ -0,0 +1,376 @@ +/* +Copyright (c) 2013, Intel Corporation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. +* Neither the name of Intel Corporation nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +*/ + +/******************************************************************* + +NAME: Branch + +PURPOSE: This program tests the effect of inner-loop branches on + application performance. We investigate four cases. The first + three all concern light-weight loops, i.e. loops that have + very few instructions associated with them. + 1) branches inside vectorizable loops where the branch does + not necessarily inhibit vectorization: vector_go + 2) branches inside vectorizable loops where the branch does + inhibit vectorization: vector_stop + 3) branches inside non-vectorizable loops: no_vector + 4) branches inside non-vectorizable loops in which each branch + corresponds to a sizeable and different set of instructions: + ins-heavy + +CONSTRAINTS: + - the code should be continuously scalable, i.e. the user should + be able to specify the amount of work to be done. + - the code should be verifiable. + - the code should be executable with and without branches, with + otherwise identical amounts of work, to assess the impact of the + branches. + - the performance of the code should be dominated by the work in + the loops, not by memory bandwidth required to fetch data. This + means that arrays should fit in cache, and any loop over arrays + should be executed many times to amortize the initial memory load + costs and to remove noise from the timings. + - any arrays used should be initialized only once, to avoid confusing + performance impact of initialization with that of the branches. + Because the base loop over the array is short, it completes very + quickly, leading to very noisy results if it were timed separately. + Hence, we must time the ensemble of all iterations over the base + loop, which would include reinitializations if present. + - the branches should be "unpredictable," meaning that if the compiler + guesses them to be always taken or to be always not taken, it will + be wrong often. Otherwise the cost of a mispredicted branch may + not show up in the performance results. + - the amount of work in the codes containing the three different + types of light-weight loops should be the same to allow fair + comparisions. + - the code should not not produce overflow or underflow. + - the actual cost of computing the branch condition should be small, + so that we can assess the cost of the occurrence of the branch as + it disrupts vectorization and the hardware pipelines). If the + condition were expensive to compute and we run the code with and + without the branch, the performance difference would be exaggerated. + - Note: Casts from integer to float or double are not always vectorizable. + +APPROACH: + - to avoid casts and keep conditionals inexpensive and exact, we use + only integer operations. + - we make sure that the numerical results of the codes for the + different branch structures and for the different paths following + the branch are identical. + - conditionals are simple comparisons to zero of quantities that + are computed anyway. + - initialization produces a saw-tooth pattern with frequent sign + crossings to defeat speculative branch execution. + - successive iterations over a relatively short array result simply + in a change of sign of all array elements, so that the results are + bounded, and verification values are easily computable. + +USAGE: The program takes as input the length of the loop, the number of + repetitions of the loop, and the type of branching + + <# iterations> + + The output consists of diagnostics to make sure the + algorithm worked, and of timing statistics. + +FUNCTIONS CALLED: + + Other than MPI or standard C functions, the following + functions are used in this program: + + wtime() + bail_out() + fill_vec() + func*() + +HISTORY: Written by Rob Van der Wijngaart, May 2006. + +*******************************************************************/ + +#include +#include + +/* the following values are only used as labels */ +#define VECTOR_STOP 66 +#define VECTOR_GO 77 +#define NO_VECTOR 88 +#define INS_HEAVY 99 +#define WITH_BRANCHES 1 +#define WITHOUT_BRANCHES 0 + +extern int fill_vec(int *vector, int vector_length, int iterations, int branch, + int *nfunc, int *rank); + +int main(int argc, char ** argv) +{ + int my_ID; /* rank */ + int root=0; /* ID of root rank */ + int Num_procs; /* Number of ranks */ + int vector_length; /* length of loop containing the branch */ + int nfunc; /* number of functions used in INS_HEAVY option */ + int rank; /* matrix rank used in INS_HEAVY option */ + double branch_time, /* timing parameters */ + no_branch_time; + double ops; /* number of integer operations in code */ + int iterations; /* number of times the branching loop is executed */ + int i, iter, aux; /* dummies */ + int error = 0; /* error flag */ + char *branch_type; + int total=0, + total_sum, + total_ref; /* computed and stored verification values */ + int btype; + int * RESTRICT vector, * RESTRICT index; + int procsize; /* number of ranks per OS process */ + +/********************************************************************* +** Initialize the MPI environment +*********************************************************************/ + MPI_Init(&argc,&argv); + MPI_Comm_rank(MPI_COMM_WORLD, &my_ID); + MPI_Comm_size(MPI_COMM_WORLD, &Num_procs); + +/********************************************************************************** +** process and test input parameters +***********************************************************************************/ + + if(my_ID == root) { + if (argc != 4){ + printf("USAGE: %s <# iterations> \n", *argv); + printf("branching type: vector_go, vector_stop, no_vector, ins_heavy\n"); + error = 1; + goto ENDOFTESTS; + } + + iterations = atoi(*++argv); + if (iterations < 1 || iterations%2==1){ + printf("ERROR: Iterations must be positive and even : %d \n", iterations); + error = 1; + goto ENDOFTESTS; + } + + vector_length = atoi(*++argv); + if (vector_length < 1){ + printf("ERROR: loop length must be >= 1 : %d \n",vector_length); + error = 1; + goto ENDOFTESTS; + } + + branch_type = *++argv; + if (!strcmp(branch_type,"vector_stop")) btype = VECTOR_STOP; + else if (!strcmp(branch_type,"vector_go" )) btype = VECTOR_GO; + else if (!strcmp(branch_type,"no_vector" )) btype = NO_VECTOR; + else if (!strcmp(branch_type,"ins_heavy" )) btype = INS_HEAVY; + else { + printf("Wrong branch type: %s; choose vector_stop, vector_go, ", branch_type); + printf("no_vector, or ins_heavy\n"); + error = 1; + goto ENDOFTESTS; + } + ENDOFTESTS:; + } + bail_out(error); + + if (my_ID == root) { + MPIX_Get_collocated_size(&procsize); + printf("FG_MPI Branching Bonanza\n"); + printf("Number of ranks = %d\n", Num_procs); + printf("Number of ranks/process = %d\n", procsize); + printf("Vector length = %d\n", vector_length); + printf("Number of iterations = %d\n", iterations); + printf("Branching type = %s\n", branch_type); + } + + /* broadcast input data */ + MPI_Bcast(&vector_length, 1, MPI_INTEGER, root, MPI_COMM_WORLD); + MPI_Bcast(&iterations, 1, MPI_INTEGER, root, MPI_COMM_WORLD); + MPI_Bcast(&btype, 1, MPI_INTEGER, root, MPI_COMM_WORLD); + + vector = malloc(vector_length*2*sizeof(int)); + if (!vector) { + printf("ERROR: rank %d failed to allocate space for vector\n", my_ID); + error = 1; + } + bail_out(error); + + index = vector + vector_length; + + /* initialize the array with entries with varying signs */ + for (i=0; i0) vector[i] -= 2*vector[i]; + else vector[i] -= 2*aux; + } + #pragma vector always + for (i=0; i0) vector[i] -= 2*vector[i]; + else vector[i] -= 2*aux; + } + } + break; + + case VECTOR_GO: + for (iter=0; iter0) vector[i] -= 2*vector[i]; + else vector[i] -= 2*aux; + } + #pragma vector always + for (i=0; i0) vector[i] -= 2*vector[i]; + else vector[i] -= 2*aux; + } + } + break; + + case NO_VECTOR: + for (iter=0; iter0) vector[i] -= 2*vector[index[i]]; + else vector[i] -= 2*aux; + } + #pragma vector always + for (i=0; i0) vector[i] -= 2*vector[index[i]]; + else vector[i] -= 2*aux; + } + } + break; + + case INS_HEAVY: + fill_vec(vector, vector_length, iterations, WITH_BRANCHES, &nfunc, &rank); + } + + branch_time = wtime() - branch_time; + + if (btype == INS_HEAVY && my_ID==root) { + printf("Number of matrix functions = %d\n", nfunc); + printf("Matrix order = %d\n", rank); + } + + /* do the whole thing once more, but now without branches */ + + MPI_Barrier(MPI_COMM_WORLD); + no_branch_time = wtime(); + + /* do actual branching */ + + switch (btype) { + + case VECTOR_STOP: + case VECTOR_GO: + for (iter=0; iter \"" + exit +fi + +n=$1 +nfunc=$2 +PID=$$ +NAME=___func.c$PID + +if [ $n -lt 1 ]; then + echo "ERROR: Invalid matrix size $n" + exit +fi +if [ $nfunc -lt 1 ]; then + echo "ERROR: Invalid number of functions $nfunc" + exit +fi + +echo "Generating $nfunc functions with matrix order $n" + +# empty the file func.c +cp /dev/null func.c + +# insert the right header file +echo "#include " >> func.c +#create some global read-only arrays +echo "static int one[$n], zero[$n];" >> func.c + +#write prototype matrix function +echo "int funcVERSION(int index, int a[$n][$n], int b[$n][$n]){" > $NAME +echo " int i, j, x1, x2, x3, error=0;" >> $NAME +echo >> $NAME + +j=0 +while [ $j -lt $n ]; do + i=0 + while [ $i -lt $n ]; do + echo " x1 = `expr \( \( $i + $j \) \* 48611 \) % 8389` + index;" >> $NAME + echo " x2 = `expr \( \( $i + 17 + 19 \* $j \) \* 29443 \) % 77029`;" >> $NAME + echo " x3 = (x1 + (VERSION+1)*x2) % $n;" >> $NAME + echo " x1 += (x2 - x3 + $n ) % $n;" >> $NAME + echo " x2 += (x1 - 5*x3 + 7 * $n ) % $n;" >> $NAME + echo " x3 = (x1 + 4*x2) % $n;" >> $NAME + if [ $i -ne $j ]; then + echo " a[$j][$i] = zero[x3];" >> $NAME + else + echo " a[$j][$i] = one[x3];" >> $NAME + fi + echo >> $NAME + i=`expr $i + 1` + done + j=`expr $j + 1` +done + +echo " for (j=0; j<$n; j++) for (i=0; i<$n; i++)" >> $NAME +echo " b[j][i] = (a[i][j]+a[j][i])/2;" >> $NAME +echo " for (j=0; j<$n; j++) for (i=0; i<$n; i++)" >> $NAME +echo " if (i != j) error += ABS(b[j][i]);" >> $NAME +echo " for (i=0; i<$n; i++) error += ABS(1-b[i][i]);" >> $NAME + +echo " if (error) return(0);" >> $NAME +echo " else return(index);" >> $NAME +echo "}" >> $NAME +echo >> $NAME + +#write the list of matrix functions; do odd/even scrambling to kill unit instruction stride +v=0 +half=`expr \( $nfunc + 1 \) / 2` +while [ $v -lt $nfunc ]; do + v2=`expr $half \* \( $v % 2 \) + $v / 2` + cat $NAME | sed "s/VERSION/$v2/" >> func.c + v=`expr $v + 1` +done + +#remove prototype matrix function +rm -f $NAME + + +echo "int fill_vec(int *vector, int length, int iterations, int branch, " >> func.c +echo " int *nfunc, int *rank) {" >> func.c + +echo " static int a[$n][$n], b[$n][$n];" >> func.c +echo " int aux, aux2, i, iter;" >> func.c + +echo " /* return generator values to calling program */" >> func.c +echo " *nfunc = $nfunc;" >> func.c +echo " *rank = $n;" >> func.c +echo >> func.c +echo " if (!branch)" >> func.c +echo " for (iter=0; iter> func.c +echo " for (i=0; i> func.c +echo " aux2 = -(3-(func0(i,a,b)&7));" >> func.c +echo " vector[i] -= (vector[i]+aux2);" >> func.c +echo " }" >> func.c +echo " for (i=0; i> func.c +echo " aux2 = (3-(func0(i,a,b)&7));" >> func.c +echo " vector[i] -= (vector[i]+aux2);" >> func.c +echo " }" >> func.c +echo " }" >> func.c +echo " else {" >> func.c +echo " for (i=0; i<$n; i++) {" >> func.c +echo " zero[i] = 0; one[i] = 1;" >> func.c +echo " }" >> func.c +echo " for (iter=0; iter> func.c +echo " for (i=0; i> func.c +echo " aux = i%$nfunc;" >> func.c +echo " switch(aux) {" >> func.c +v=0 +while [ $v -lt $nfunc ]; do + echo " case $v: aux2 = -(3-(func$v(i,a,b)&7));" >> func.c + echo " vector[i] -= (vector[i]+aux2);" >> func.c + echo " break;" >> func.c + v=`expr $v + 1` +done +echo " default: vector[i] = 0;" >> func.c +echo " }" >> func.c +echo " }" >> func.c +echo " for (i=0; i> func.c +echo " aux = i%$nfunc;" >> func.c +echo " switch(aux) {" >> func.c +v=0 +while [ $v -lt $nfunc ]; do + echo " case $v: aux2 = (3-(func$v(i,a,b)&7));" >> func.c + echo " vector[i] -= (vector[i]+aux2);" >> func.c + echo " break;" >> func.c + v=`expr $v + 1` +done +echo " default: vector[i] = 0;" >> func.c +echo " }" >> func.c +echo " }" >> func.c +echo " }" >> func.c +echo " }" >> func.c +echo " return(0);" >> func.c +echo "}" >> func.c + diff --git a/tests/apps/prk/tests/FG_MPI/DGEMM/Makefile.ohpc b/tests/apps/prk/tests/FG_MPI/DGEMM/Makefile.ohpc new file mode 100644 index 0000000000..a1619120c2 --- /dev/null +++ b/tests/apps/prk/tests/FG_MPI/DGEMM/Makefile.ohpc @@ -0,0 +1,33 @@ +include ../../common/FG_MPI.defs + +##### User configurable options ##### + +OPTFLAGS = $(DEFAULT_OPT_FLAGS) +#description: change above into something that is a decent optimization on you system + +#uncomment any of the following flags (and change values) to change defaults + +#OFFSETFLAG = -DBOFFSET=0 +#description: set this flag to some value to override default first array +# dimension padding (12) of tiles used inside dgemm + +#DEBUGFLAG = -DVERBOSE +#description: default diagnostic style is silent + +USERFLAGS = +#description: parameter to specify optional flags + +#set the following variables for custom libraries and/or other objects +EXTOBJS = +LIBS = -lm +LIBPATHS = +INCLUDEPATHS = + +### End User configurable options ### + +TUNEFLAGS = $(DEBUGFLAG) $(OFFSETFLAG) $(USERFLAGS) + +PROGRAM = dgemm +OBJS = $(PROGRAM).o $(COMOBJS) + +include ../../common/make.common diff --git a/tests/apps/prk/tests/FG_MPI/DGEMM/dgemm.c b/tests/apps/prk/tests/FG_MPI/DGEMM/dgemm.c new file mode 100755 index 0000000000..ee83bda241 --- /dev/null +++ b/tests/apps/prk/tests/FG_MPI/DGEMM/dgemm.c @@ -0,0 +1,492 @@ +/* +Copyright (c) 2013, Intel Corporation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. +* Neither the name of Intel Corporation nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +*/ + +/********************************************************************************* + +NAME: dgemm + +PURPOSE: This program tests the efficiency with which a dense matrix + dense multiplication is carried out + +USAGE: The program takes as input the matrix order, the number of times + the matrix-matrix multiplication is carried out, the outer level + block size, and a flag determining whether to use square tiles + for the local dgemm. + + <# iterations> [] + + The output consists of diagnostics to make sure the + algorithm worked, and of timing statistics. + +FUNCTIONS CALLED: + + Other than OpenMP or standard C functions, the following + functions are used in this program: + + wtime() + bail_out() + +NOTES: Derived frmo SUMMA implementation provided by Robert Van de Geijn, + U. Texas at Austion. + Algorithm first published by Elmroth, Gustavson, Jonsson & Kagstrom + +HISTORY: Written by Rob Van der Wijngaart, December 2007 + +***********************************************************************************/ + +#include "par-res-kern_general.h" +#include "par-res-kern_fg-mpi.h" + +#define A(i,j) (a[(j)*lda+i]) +#define B(i,j) (b[(j)*ldb+i]) +#define C(i,j) (c[(j)*ldc+i]) +#ifndef BOFFSET + #define BOFFSET 12 +#endif +#define AA(i,j) (aa[(j)*ldaa+i]) +#define BB(i,j) (bb[(j)*ldbb+i]) +#define CC(i,j) (cc[(j)*ldcc+i]) + +#define epsilon 0.00001 + +void RING_Bcast(double *, int, MPI_Datatype, int, MPI_Comm); +void dlacpy(int, int, double *, int, double *, int); +void dgemm_local(int, int, int, double *, int, double *, int, + double *, int, int, int); +void dgemm(int, int, int, double *, int, double *, int, double *, int, + int *, int *, MPI_Comm, MPI_Comm, double *, double *); + + +int main(int argc, char *argv[]) +{ + int my_ID, myrow, mycol, /* my index and row and column index */ + root=0, /* ID of root rank */ + Num_procs, /* number of ranks */ + nprow, npcol, /* row, column dimensions of rank grid */ + order, /* matrix order */ + mynrows, myfrow, /* my number of rows and index of first row*/ + mylrow, /* and last row */ + myncols, myfcol, /* my number of cols and index of first row*/ + mylcol, /* and last row */ + *mm, /* arrays that hold m_i's and n_j's */ + *nn, + nb, /* block factor for SUMMA */ + inner_block_flag, /* flag to select local DGEMM blocking */ + error=0, /* error flag */ + *ranks, /* work array for row and column ranks */ + lda, ldb, ldc, /* leading array dimensions of a, b, and c */ + i, j, ii, jj, /* dummy variables */ + iter, iterations; + double *a, *b, *c, /* arrays that hold local a, b, c */ + *work1, *work2, /* work arrays to pass to dpmmmult */ + local_dgemm_time, /* timing parameters */ + dgemm_time, + avgtime; + double + forder, nflops, /* float matrix order + total flops */ + checksum, /* array checksum for verification test */ + checksum_local=0.0, + ref_checksum; /* reference checkcum for verification */ + MPI_Group world_group, + temp_group; + MPI_Comm comm_row, /* communicators for row and column ranks */ + comm_col; /* of rank grid */ + int procsize; /* number of ranks per OS process */ + + /* initialize */ + MPI_Init(&argc,&argv); + MPI_Comm_rank( MPI_COMM_WORLD, &my_ID ); + MPI_Comm_size( MPI_COMM_WORLD, &Num_procs ); + +/********************************************************************* +** process, test and broadcast input parameters +*********************************************************************/ + + if (my_ID == root) { + if (argc != 5) { + printf("Usage: %s <# iterations> ", + *argv); + printf("\n"); + error = 1; + goto ENDOFTESTS; + } + + iterations = atoi(*++argv); + if(iterations < 1){ + printf("ERROR: iterations must be positive: %d \n",iterations); + error = 1; + goto ENDOFTESTS; + } + + order = atoi(*++argv); + if (order < Num_procs) { + printf("ERROR: matrix order too small: %d\n", order); + error = 1; + goto ENDOFTESTS; + } + + nb = atoi(*++argv); + /* a non-positive tile size means no outer level tiling */ + + inner_block_flag = atoi(*++argv); + + ENDOFTESTS:; + } + bail_out(error); + + MPI_Bcast(&order, 1, MPI_INT, root, MPI_COMM_WORLD); + MPI_Bcast(&iterations, 1, MPI_INT, root, MPI_COMM_WORLD); + MPI_Bcast(&nb, 1, MPI_INT, root, MPI_COMM_WORLD); + MPI_Bcast(&inner_block_flag, 1, MPI_INT, root, MPI_COMM_WORLD); + + /* compute rank grid to most closely match a square; to do so, + compute largest divisor of Num_procs, using hare-brained method. + The small term epsilon is used to guard against roundoff errors + in case Num_procs is a perfect square */ + nprow = (int) (sqrt((double) Num_procs + epsilon)); + while (Num_procs%nprow) nprow--; + npcol = Num_procs/nprow; + + if (my_ID == root) { + MPIX_Get_collocated_size(&procsize); + printf("FG_MPI Dense matrix-matrix multiplication: C = A x B\n"); + printf("Number of ranks = %d\n", Num_procs); + printf("Number of ranks/process = %d\n", procsize); + printf("Ranks grid = %d rows x %d columns\n", nprow, npcol); + printf("Matrix order = %d\n", order); + printf("Outer block size = %d\n", nb); + printf("Number of iterations = %d\n", iterations); + if (inner_block_flag) + printf("Using local dgemm blocking\n"); + else + printf("No local dgemm blocking\n"); + } + + /* set up row and column communicators */ + + ranks = (int *) malloc (3*Num_procs*sizeof(int)); + if (!ranks) { + printf("ERROR: Proc %d could not allocate rank work arrays\n", + my_ID); + error = 1; + } + bail_out(error); + mm = ranks + Num_procs; + nn = mm + Num_procs; + + /* 1. extract group of ranks that make up WORLD */ + MPI_Comm_group( MPI_COMM_WORLD, &world_group ); + + /* 2. create list of all ranks in same row of rank grid */ + ranks[0] = my_ID/npcol * npcol; + for (i=1; i epsilon) { + printf("ERROR: Checksum = %lf, Reference checksum = %lf\n", + checksum, ref_checksum); + error = 1; + } + else { + printf("Solution validates\n"); +#ifdef VERBOSE + printf("Reference checksum = %lf, checksum = %lf\n", + ref_checksum, checksum); +#endif + } + } + bail_out(error); + + /* report elapsed time */ + nflops = 2.0*forder*forder*forder; + if ( my_ID == root ) { + avgtime = dgemm_time/iterations; + printf("Rate (MFlops/s): %lf Avg time (s): %lf\n", + 1.0E-06 * nflops/avgtime, avgtime); + } + + MPI_Finalize(); +} + +void dgemm(k, nb, inner_block_flag, a, lda, b, ldb, c, ldc, mm, nn, + comm_row, comm_col, work1, work2 ) +int k, /* global matrix dimensions */ + nb, /* panel width */ + inner_block_flag,/* determines local dgemm blocking */ + mm[], nn[], /* dimensions of blocks of A, B, C */ + lda, ldb, ldc; /* leading dimension of local arrays that + hold local portions of matrices A, B, C */ +double *a, *b, *c, /* arrays that hold local parts of A, B, C */ + *work1, *work2; /* work arrays */ +MPI_Comm comm_row, /* Communicator for this row of nodes */ + comm_col; /* Communicator for this column of nodes */ +{ + int myrow, mycol, /* my row and column index */ + nprow, npcol, /* number of node rows and columns */ + i, j, kk, updt, /* misc. index variables */ + currow, curcol, /* index of row and column that hold current + row and column, resp., for rank-1 update*/ + ii, jj; /* local index (on currow and curcol, resp.) + of row and column for rank-updt update */ + int my_ID; + + /* get row, column, and global MPI rank */ + MPI_Comm_rank(comm_row, &mycol); + MPI_Comm_rank(comm_col, &myrow); + MPI_Comm_rank(MPI_COMM_WORLD, &my_ID); + + /* This routine does a rank "updt" update of the matrix block + owned by the calling rank. This requires updt whole columns + of A and updt whole rows of B. The value of updt is determined + as the minimum of 1. the maximum number of remaining columns + of A and 2. the maximum number of remaining rows of B, + respectively, that can be gathered from the current row and column + of the rank grid, with an overall maximum of the block factor nb. + We keep track of how many matrix columns and rows of the current + rank grid row and column have been visited through the + indices ii and jj. When a certain rank grid row or column + has been exhausted, we move to the next row or column (increment + currow or curcol) and reset ii or jj to zero */ + + currow = curcol = ii = jj = 0; + updt = nb; + + for ( kk=0; kk=nn[curcol]) {curcol++; jj = 0;}; + if (ii>=mm[currow]) {currow++; ii = 0;}; + } +} + +void dgemm_local(int M, int N, int K, double *a, int lda, double *b, + int ldb, double *c, int ldc, int nb, int inner_block_flag) { + + int m, n, k, mg, ng, kg, mm, nn, kk, ldaa, ldbb, ldcc; + double *aa, *bb, *cc; + + if (nb >= MAX(M,MAX(N,K)) || !inner_block_flag) { + for (m=0; m <# iterations> + + The output consists of diagnostics to make sure the + algorithm worked, and of timing statistics. + +FUNCTIONS CALLED: + + Other than MPI or standard C functions, the following + external functions are used in this program: + + wtime() + bail_out() + checkTRIADresults() + +NOTES: Bandwidth is determined as the number of words read, plus the + number of words written, times the size of the words, divided + by the execution time. For a vector length of N, the total + number of words read and written is 4*N*sizeof(double). + +HISTORY: This code is loosely based on the Stream benchmark by John + McCalpin, but does not follow all the Stream rules. Hence, + reported results should not be associated with Stream in + external publications +REVISION: Modified by Rob Van der Wijngaart, December 2005, to + parameterize vector size and offsets through compiler flags. + Also removed all Stream cases except TRIAD. +REVISION: Modified by Rob Van der Wijngaart, March 2006, to handle MPI. +REVISION: Modified by Rob Van der Wijngaart, May 2006, to introduce + dependence between successive triad operations. This is + necessary to avoid dead code elimination +REVISION: Modified by Rob Van der Wijngaart, November 2014, replaced + timing of individual loop iterations with timing of overall + loop; also replaced separate loop establishing dependence + between iterations (must now be included in timing) with + accumulation: a[] += b[] + scalar*c[] +**********************************************************************/ + +#include +#include + +#define SCALAR 3.0 + +static int checkTRIADresults(int, long int, double *); + +int main(int argc, char **argv) +{ + long int j, iter; /* dummies */ + double scalar; /* constant used in Triad operation */ + int iterations; /* number of times vector loop gets repeated */ + long int length, /* vector length per rank */ + total_length, /* total vector length */ + offset; /* offset between vectors a and b, and b and c */ + double bytes; /* memory IO size */ + size_t space; /* memory used for a single vector */ + double local_nstream_time,/* timing parameters */ + nstream_time, + avgtime; + int Num_procs, /* number of ranks */ + my_ID, /* ID of calling rank */ + root=0; /* ID of master rank */ + int error=0; /* error flag for individual rank */ + double * RESTRICT a; /* main vector */ + double * RESTRICT b; /* main vector */ + double * RESTRICT c; /* main vector */ + int procsize; /* number of ranks per OS process */ + +/************************************************************************* +* process and test input parameters +**************************************************************************/ + + MPI_Init(&argc,&argv); + MPI_Comm_size(MPI_COMM_WORLD,&Num_procs); + MPI_Comm_rank(MPI_COMM_WORLD,&my_ID); + + if (my_ID == root) { + if (argc != 4){ + printf("Usage: %s <# iterations> \n", *argv); + error = 1; + goto ENDOFTESTS; + } + + iterations = atoi(*++argv); + if (iterations < 1) { + printf("ERROR: Invalid number of iterations: %d\n", iterations); + error = 1; + goto ENDOFTESTS; + } + + total_length = atol(*++argv); + if (total_length < Num_procs) { + printf("ERROR: Invalid vector length: %ld\n", total_length); + error = 1; + goto ENDOFTESTS; + } + else length = total_length/Num_procs; + + offset = atol(*++argv); + if (offset < 0) { + printf("ERROR: Invalid array offset: %ld\n", offset); + error = 1; + goto ENDOFTESTS; + } + + ENDOFTESTS:; + } + bail_out(error); + + /* broadcast initialization data */ + MPI_Bcast(&length,1, MPI_LONG, root, MPI_COMM_WORLD); + MPI_Bcast(&offset,1, MPI_LONG, root, MPI_COMM_WORLD); + MPI_Bcast(&iterations,1, MPI_INT, root, MPI_COMM_WORLD); + + space = (3*length + 2*offset)*sizeof(double); + a = (double *) malloc(space); + if (!a && my_ID == root) { + printf("ERROR: Could not allocate %ld bytes for vectors\n", (long int)space); + error = 1; + } + bail_out(error); + + b = a + length + offset; + c = b + length + offset; + + bytes = 4.0 * sizeof(double) * length * Num_procs; + + if (my_ID == root) { + MPIX_Get_collocated_size(&procsize); + printf("FG_MPI stream triad: A = B + scalar*C\n"); + printf("Number of ranks = %d\n", Num_procs); + printf("Number of ranks/process = %d\n", procsize); + printf("Vector length = %ld\n", total_length); + printf("Offset = %ld\n", offset); + printf("Number of iterations = %d\n", iterations); + } + + #pragma vector always + for (j=0; j epsilon) { + printf ("Failed Validation on output array\n"); +#ifndef VERBOSE + printf (" Expected checksum: %f \n",aj); + printf (" Observed checksum: %f \n",asum); +#endif + return (0); + } + else { + printf ("Solution validates\n"); + return (1); + } +} + diff --git a/tests/apps/prk/tests/FG_MPI/Random/Makefile.ohpc b/tests/apps/prk/tests/FG_MPI/Random/Makefile.ohpc new file mode 100644 index 0000000000..83f08c7a6b --- /dev/null +++ b/tests/apps/prk/tests/FG_MPI/Random/Makefile.ohpc @@ -0,0 +1,37 @@ +include ../../common/FG_MPI.defs + +##### User configurable options ##### + +OPTFLAGS = $(DEFAULT_OPT_FLAGS) +#description: change above into something that is a decent optimization on you system + +#uncomment any of the following flags (and change values) to change defaults + +#VECTORFLAG = -DLOOKAHEAD=2048 +#description: Default value for LOOKAHEAD is 1024 (HPCC compliant) + +#RESTRICTFLAG = -DRESTRICT_KEYWORD +#description: the "restrict" keyword can be used on IA platforms to disambiguate +# data accessed through pointers + +#LONG64FLAG = -DLONG_IS_64BITS +#description: can use "long" for 64 bit integers instead of "long long" + +#DEBUGFLAG = -DVERBOSE +#description: default diagnostic style is silent + +USERFLAGS = +#description: parameter to specify optional flags + +EXTOBJS = +LIBS = +LIBPATHS = +INCLUDEPATHS = + +### End User configurable options ### + +TUNEFLAGS = $(RESTRICTFLAG) $(LONG64FLAG) $(DEBUGFLAG) $(USERFLAGS) $(VECTORFLAG) +PROGRAM = random +OBJS = $(PROGRAM).o $(COMOBJS) + +include ../../common/make.common diff --git a/tests/apps/prk/tests/FG_MPI/Random/random.c b/tests/apps/prk/tests/FG_MPI/Random/random.c new file mode 100644 index 0000000000..a93cf9b885 --- /dev/null +++ b/tests/apps/prk/tests/FG_MPI/Random/random.c @@ -0,0 +1,519 @@ +/* +Copyright (c) 2013, Intel Corporation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. +* Neither the name of Intel Corporation nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +*/ +/************************************************************* +Copyright (c) 2013 The University of Tennessee. All rights reserved. +Redistribution and use in source and binary forms, with or +without modification, are permitted provided that the following +conditions are met: + +- Redistributions of source code must retain the + above copyright notice, this list of conditions and + the following disclaimer. + +- Redistributions in binary form must reproduce the + above copyright notice, this list of conditions and + the following disclaimer listed in this license in the + documentation and/or other materials provided with the + distribution. + +- Neither the name of the copyright holders nor the names + of its contributors may be used to endorse or promote + products derived from this software without specific + prior written permission. + +This software is provided by the copyright holders and +contributors "as is" and any express or implied warranties, +including, but not limited to, the implied warranties of +merchantability and fitness for a particular purpose are +disclaimed. in no event shall the copyright owner or +contributors be liable for any direct, indirect, incidental, +special, exemplary, or consequential damages (including, but +not limited to, procurement of substitute goods or services; +loss of use, data, or profits; or business interruption) +however caused and on any theory of liability, whether in +contract, strict liability, or tort (including negligence or +otherwise) arising in any way out of the use of this software, +even if advised of the possibility of such damage. + +*************************************************************/ +/******************************************************************* + +NAME: RandomAccess + +PURPOSE: This program tests the efficiency of the memory subsystem to + update elements of a distributed array with irregular stride. + +USAGE: The program takes as input the 2log of the size of the table that + gets updated and the ratio of table size over number of updates. + The table is distributed evenly over all participating ranks. + The code can be vectorized, in principle, with a vector length + that is automatically set to the size of the LOOKAHEAD parameter. + + <#update ratio> + +FUNCTIONS CALLED: + + Other than MPI or standard C functions, the following + functions are used in this program: + + wtime + bail_out() + PRK_starts + poweroftwo + +NOTES: This program is derived from HPC Challenge Random Access. The random + number generator computes successive powers of 0x2, modulo the + primitive polynomial x^63+x^2+x+1. The principal differences between + this code and the HPCC version are: + - we start the stream of random numbers not with seed 0x1, but the + SEQSEED-th element in the stream of powers of 0x2. + - the timed code applies the RandomAccess operator twice to the table of + computed resuls (starting with the same seed(s) for "ran" in both + iterations. The second pass makes sure that any update to any table + element that sets high-order bits in the first pass resets those bits + to zero. + - the verification test now simply constitutes checking whether table + element j equals j. + + The program uses aggragation to reduce latency costs. The parameter + LOOKAHEAD determines how many random numbers are generated by each + rank before they are sent to the ranks that are responsible for + updating the corresponding table elements. LOOKAHEAD also determines the + (potential) level of vectorization (independent streams) of the code. + + We note that the vectorized version of this code (i.e. LOOKAHEAD unequal + to 1), does not feature exactly the same sequence of accesses and + intermediate update values in the table as the scalar version. The + reason for this is twofold. + 1. the elements in the stream of powers of 0x2 that get computed outside + the main timed loop as seeds for independent streams in the vectorized + version, using the jump-ahead function PRK_starts, are computed inside + the timed loop for the scalar version. However, since both versions do + the same number of timed random accesses, the vectorized version must + progress further in the sequence of powers of 0x2. + 2. The independent streams of powers of 0x2 computed in the vectorized + version can (and will) cause updates of the same elements of the table + in an order that is not consistent with the scalar version. That is, + distinct values of "ran" can refer to the same table element + "ran&(tablesize-1)," but the operation + Table[ran&(tablesize-1)] ^= ran will deposit different values in that + table element for different values of ran. At the end of each pass over + the data set, the table will contain the same values in the vector and + scalar version (ignoring the small differences caused by 1.) because of + commutativity of the XOR operator. If the update operator had been + non-commutative, the vector and scalar version would have yielded + different results. + +HISTORY: Written by Rob Van der Wijngaart, December 2007. + +************************************************************************************/ + +#include +#include + +/* Define 64-bit types and corresponding format strings for printf() and constants */ +/* PERIOD = (2^63-1)/7 = 7*73*127*337*92737*649657 */ +#ifdef LONG_IS_64BITS + #define POLY 0x0000000000000007UL + #define PERIOD 1317624576693539401L + /* sequence number in series of random numbers to be used as initial value */ + #define SEQSEED 834568137686317453L +#else + #define POLY 0x0000000000000007ULL + #define PERIOD 1317624576693539401LL + /* sequence number in series of random numbers to be used as initial value */ + #define SEQSEED 834568137686317453LL +#endif + +#ifndef LOOKAHEAD +#define LOOKAHEAD 1024 +#endif + +static u64Int PRK_starts(s64Int); +static int poweroftwo(int); + +int main(int argc, char **argv) { + + int update_ratio;/* multiplier of tablesize for # updates */ + int nstarts; /* vector length */ + s64Int i, j, round, oldsize, index, global_index; /* dummies */ + int proc, dest; /* dummies */ + s64Int tablesize; /* aggregate table size (all ranks) */ + s64Int loctablesize;/* local table size (each rank) */ + s64Int nupdate; /* number of updates per rank */ + s64Int tablespace; /* bytes per rank required for table */ + u64Int *ran; /* vector of random numbers */ + u64Int **ranSendBucket; /* send list of buckets of random numbers */ + u64Int **ranRecvBucket; /* receive list of buckets of random numbers */ + int *sizeSendBucket; /* list of send bucket sizes */ + int *sizeRecvBucket; /* list of receive buffer sizes */ + int sizeRecvTotal;/* total number of elements in receive buffer */ + int *senddispls; /* successive displacements in send buffer */ + int *recvdispls; /* successive dispalcemetns in receive buffer */ + u64Int * RESTRICT Table; /* (pseudo-)randomly accessed array */ + double random_time, /* timing parameters */ + avgtime = 0.0; + int Num_procs, /* rank parameters */ + my_ID, /* rank of calling rank */ + root=0; /* ID of master rank */ + s64Int error=0; /* error flag for individual rank */ + s64Int tot_error; /* error flag for all ranks combined */ + int log2nproc; /* log2 of # ranks */ + int log2nstarts; /* log2 of vector length */ + int log2tablesize; /* log2 of aggregate table size */ + int log2update_ratio; /* log2 of update ratio */ + int procsize; /* number of ranks per OS rank */ + +#ifdef LONG_IS_64BITS + if (sizeof(long) != 8) { + printf("ERROR: Makefile says \"long\" is 8 bytes, but it is %d bytes\n", + sizeof(long)); + exit(EXIT_FAILURE); + } +#endif + +/*********************************************************************************** +** process and test input parameters +************************************************************************************/ + + MPI_Init(&argc,&argv); + MPI_Comm_size(MPI_COMM_WORLD,&Num_procs); + MPI_Comm_rank(MPI_COMM_WORLD,&my_ID); + + if (my_ID == root) { + if (argc != 3){ + printf("Usage: %s <#update ratio>\n", *argv); + error = 1; + goto ENDOFTESTS; + } + + /* test whether number of ranks is a power of two */ + log2nproc = poweroftwo(Num_procs); + if (log2nproc <0) { + printf("ERROR: Invalid number of ranks: %d, must be a power of 2\n", + Num_procs); + error = 1; + goto ENDOFTESTS; + } + + log2tablesize = atoi(*++argv); + if (log2tablesize < 1){ + printf("ERROR: Log2 tablesize is %d; must be >= 1\n",log2tablesize); + error = 1; + goto ENDOFTESTS; + } + + update_ratio = atoi(*++argv); + /* test whether update ratio is a power of two */ + log2update_ratio = poweroftwo(update_ratio); + if (log2update_ratio <0) { + printf("ERROR: Invalid update ratio: %d, must be a power of 2\n", + update_ratio); + error = 1; + goto ENDOFTESTS; + } + + /* for simplicity we set the vector length equal to the LOOKAHEAD size */ + nstarts = LOOKAHEAD; + + /* test whether vector length is a power of two */ + log2nstarts = poweroftwo(nstarts); + if (log2nstarts <0) { + printf("ERROR: Invalid vector length: %d, must be a power of 2\n", + nstarts); + error = 1; + goto ENDOFTESTS; + } + + /* compute (local) table size carefully to make sure it can be represented */ + loctablesize = 1; + for (i=0; i>(log2tablesize-log2nproc); + /* place new random number in first available element of the appropriate + send bucket and increment that bucket size */ + ranSendBucket[dest][sizeSendBucket[dest]++] = ran[j]; + } + + /* let all other rankes know how many indices to expect */ + MPI_Alltoall(sizeSendBucket, 1, MPI_INTEGER, + sizeRecvBucket, 1, MPI_INTEGER, MPI_COMM_WORLD); + + /* compute receive buffer offsets so that received data is contiguous */ + for (proc=1; proc PERIOD) n -= PERIOD; + if (n == 0) return 0x1; + + temp = 0x1; + for (i=0; i<64; i++) { + m2[i] = temp; + temp = (temp << 1) ^ ((s64Int) temp < 0 ? POLY : 0); + temp = (temp << 1) ^ ((s64Int) temp < 0 ? POLY : 0); + } + + for (i=62; i>=0; i--) + if ((n >> i) & 1) + break; + + ran = 0x2; + while (i > 0) { + temp = 0; + for (j=0; j<64; j++) + if ((unsigned int)((ran >> j) & 1)) + temp ^= m2[j]; + ran = temp; + i -= 1; + if ((n >> i) & 1) + ran = (ran << 1) ^ ((s64Int) ran < 0 ? POLY : 0); + } + + return ran; +} + +/* utility routine that tests whether an integer is a power of two */ +int poweroftwo(int n) { + int log2n = 0; + + while ((1< <# iterations> + + The output consists of diagnostics to make sure the + algorithm worked, and of timing statistics. + +FUNCTIONS CALLED: + + Other than MPI or standard C functions, the following external + functions are used in this program: + + wtime(); + bail_out(); + +HISTORY: Written by Rob Van der Wijngaart, March 2006. + Modified by Rob Van der Wijngaart, November 2014 + - added dependence between successive reductions + - improved timing + - changed initialization values + +*******************************************************************/ + +#include +#include + +int main(int argc, char ** argv) +{ + int Num_procs; /* Number of ranks */ + int my_ID; /* rank */ + int root=0; + int iterations; /* number of times the reduction is carried out */ + int i, iter; /* dummies */ + long vector_length; /* length of the vectors to be aggregated */ + double * RESTRICT vector; /* vector to be reduced */ + double * RESTRICT ones; /* constant vector */ + double local_reduce_time, /* timing parameters */ + reduce_time, + avgtime; + double epsilon=1.e-8; /* error tolerance */ + double element_value; /* verification value */ + int error = 0; /* error flag */ + int procsize; /* number of ranks per OS process */ + + /*************************************************************************** + ** Initialize the MPI environment + ****************************************************************************/ + MPI_Init(&argc,&argv); + MPI_Comm_rank(MPI_COMM_WORLD, &my_ID); + MPI_Comm_size(MPI_COMM_WORLD, &Num_procs); + + /*************************************************************************** + ** process, test and broadcast input parameters + ****************************************************************************/ + + if (my_ID == root){ + if (argc != 3){ + printf("Usage: %s <# iterations> \n", *argv); + error = 1; + goto ENDOFTESTS; + } + + iterations = atoi(*++argv); + if (iterations < 1) { + printf("ERROR: Iterations must be positive: %d\n", iterations); + error = 1; + goto ENDOFTESTS; + } + + vector_length = atol(*++argv); + if (vector_length < 1) { + printf("ERROR: Vector length should be positive: %d\n", vector_length); + error = 1; + goto ENDOFTESTS; + } + + ENDOFTESTS:; + } + bail_out(error); + + + if (my_ID == root) { + MPIX_Get_collocated_size(&procsize); + printf("FG_MPI vector reduction\n"); + printf("Number of ranks = %d\n", Num_procs); + printf("Number of ranks/process = %d\n", procsize); + printf("Vector length = %ld\n", vector_length); + printf("Number of iterations = %d\n", iterations); + } + + /* Broadcast benchmark data to all ranks */ + MPI_Bcast(&iterations, 1, MPI_INT, root, MPI_COMM_WORLD); + MPI_Bcast(&vector_length, 1, MPI_LONG, root, MPI_COMM_WORLD); + vector= (double *) malloc(2*vector_length*sizeof(double)); + if (vector==NULL) { + printf("ERROR: Could not allocate space %ld for vector in rank %d\n", + 2*vector_length*sizeof(double),my_ID); + error = 1; + } + bail_out(error); + ones = vector + vector_length; + + /* initialize the arrays */ + for (i=0; i= epsilon) { + error = 1; +#ifdef VERBOSE + printf("ERROR at i=%d; value: %lf; reference value: %lf\n", + i, vector[i], element_value); +#else + printf("First error at i=%d; value: %lf; reference value: %lf\n", + i, vector[i], element_value); + break; +#endif + } + } + } + bail_out(error); + + if (my_ID == root) { + printf("Solution validates\n"); +#ifdef VERBOSE + printf("Element verification value: %lf\n", element_value); +#endif + avgtime = reduce_time/(double)iterations; + printf("Rate (MFlops/s): %lf Avg time (s): %lf\n", + 1.0E-06 * (2.0*Num_procs-1.0)*vector_length/ avgtime, avgtime); + } + + MPI_Finalize(); + exit(EXIT_SUCCESS); + +} /* end of main */ + diff --git a/tests/apps/prk/tests/FG_MPI/Sparse/Makefile.ohpc b/tests/apps/prk/tests/FG_MPI/Sparse/Makefile.ohpc new file mode 100644 index 0000000000..4c0cfd445a --- /dev/null +++ b/tests/apps/prk/tests/FG_MPI/Sparse/Makefile.ohpc @@ -0,0 +1,37 @@ +include ../../common/FG_MPI.defs + +##### User configurable options ##### + +OPTFLAGS = $(DEFAULT_OPT_FLAGS) +#description: change above into something that is a decent optimization on you system + +#uncomment any of the following flags (and change values) to change defaults + +#DENSEFLAG = -DTESTDENSE +#description: if flag is set, sparse matrix will be embedded in dense matrix + +#RESTRICTFLAG = -DRESTRICT_KEYWORD +#description: the "restrict" keyword can be used on IA platforms to disambiguate +# data accessed through pointers + +#DEBUGFLAG = -DVERBOSE +#description: default diagnostic style is silent + +SCRAMBLEFLAG = -DSCRAMBLE +#description: if flag is set, grid indices are scrambled to produce irregular stride + +USERFLAGS = +#description: parameter to specify optional flags + +EXTOBJS = +LIBS = +LIBPATHS = +INCLUDEPATHS = + +### End User configurable options ### + +TUNEFLAGS = $(DENSEFLAG) $(DEBUGFLAG) $(NTHREADFLAG) $(USERFLAGS) $(SCRAMBLEFLAG) +PROGRAM = sparse +OBJS = $(PROGRAM).o $(COMOBJS) + +include ../../common/make.common diff --git a/tests/apps/prk/tests/FG_MPI/Sparse/README b/tests/apps/prk/tests/FG_MPI/Sparse/README new file mode 100755 index 0000000000..81755fc7db --- /dev/null +++ b/tests/apps/prk/tests/FG_MPI/Sparse/README @@ -0,0 +1,32 @@ +This program constructs a sparse matrix and performs a (parallel) +sparse matrix-vector multiplication. The sparse matrix is built as +follows. The standard star-shaped discretization stencil with a +user-specified radius is applied to a structured 2-dimensional +grid. Example of a stencil with radius r=2: + + 0 + | + 0 + | + 0--0--0--0--0 + | + 0 + | + 0 + +Here, the `0' symbol signifies inclusion in the stencil. A square grid +with linear dimension (2^n) has 2^(2n) = 4^n points. The resulting +matrix has (4^n) rows and (4^n) columns, for a total of (16^n) +elements. The user specifies n. The stencil is applied in a periodic +fashion, i.e. it wraps around the edges of the grid. + +If the scramble flag is unset in the Makefile, the discretization +stencil results in a regularly banded sparse matrix, which can be +stored efficiently in vectors, in principle. If the scramble flag is +maintained, the columns of the matrix are permuted, resulting in a +general irregular sparse matrix, but with a known number of nonzeroes +per row (4r+1). We use Compressed Row Storage for accessing the matrix +elements, even in the case of an unset scramble flag. Numerical values +of matrix elements are chosen judiciously to make verification +easy. They do not correspond to any realistic discretization of a +continuum problem. diff --git a/tests/apps/prk/tests/FG_MPI/Sparse/sparse.c b/tests/apps/prk/tests/FG_MPI/Sparse/sparse.c new file mode 100755 index 0000000000..6af9d47d50 --- /dev/null +++ b/tests/apps/prk/tests/FG_MPI/Sparse/sparse.c @@ -0,0 +1,444 @@ +/* +Copyright (c) 2013, Intel Corporation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. +* Neither the name of Intel Corporation nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +*/ + +/********************************************************************************* + +NAME: sparse + +PURPOSE: This program tests the efficiency with which a sparse matrix + vector multiplication is carried out + +USAGE: The program takes as input the 2log of the linear size of the 2D grid + (equalling the 2log of the square root of the order of the sparse matrix), + the radius of the difference stencil, and the number of times the + matrix-vector multiplication is carried out. + + <# iterations> <2log root-of-matrix-order> + + The output consists of diagnostics to make sure the + algorithm worked, and of timing statistics. + +FUNCTIONS CALLED: + + Other than MPI or standard C functions, the following + functions are used in this program: + + wtime() + bail_out() + reverse() + qsort() + compare + +NOTES: + +HISTORY: Written by Rob Van der Wijngaart, October 2006. + Updated by RvdW to fix verification bug, February 2013 + Updated by RvdW to sort matrix elements to reflect traditional CSR storage, + August 2013 + +***********************************************************************************/ + +#include +#include + +/* linearize the grid index */ +#define LIN(i,j) (i+((j)< <2log grid size> \n",*argv); + error = 1; + goto ENDOFTESTS; + } + + iterations = atoi(*++argv); + if (iterations < 1){ + printf("ERROR: Iterations must be positive : %d \n", iterations); + error = 1; + goto ENDOFTESTS; + } + + lsize = atoi(*++argv); + if (lsize <0) { + printf("ERROR: Log of grid size must be non-negative: %d\n", + (int) lsize); + error = 1; + goto ENDOFTESTS; + } + lsize2 = 2*lsize; + size = 1< epsilon) { + printf("ERROR: Vector sum = %lf, Reference vector sum = %lf, my_ID = %d\n", + check_sum, reference_sum, my_ID); + error = 1; + } + else { + printf("Solution validates\n"); +#ifdef VERBOSE + printf("Reference sum = %lf, check sum = %lf\n", + reference_sum, check_sum); +#endif + } + avgtime = sparse_time/iterations; + printf("Rate (MFlops/s): %lf Avg time (s): %lf\n", + 1.0E-06 * (2.0*nent*Num_procs)/avgtime, avgtime); + } + + bail_out(error); + + MPI_Finalize(); + exit(EXIT_SUCCESS); +} + +/* Code below reverses bits in unsigned integer stored in a 64-bit word. + Bit reversal is with respect to the largest integer that is going to be + processed for the particular run of the code, to make sure the reversal + constitutes a true permutation. Hence, the final result needs to be shifted + to the right. + Example: if largest integer being processed is 0x000000ff = 255 = + 0000...0011111111 (binary), then the unshifted reversal of 0x00000006 = 6 = + 0000...0000000110 (binary) would be 011000000...0000 = 3*2^61, which is + outside the range of the original sequence 0-255. Setting shift_in_bits to + 2log(256) = 8, the final result is shifted the the right by 64-8=56 bits, + so we get 000...0001100000 (binary) = 96, which is within the proper range */ +u64Int reverse(register u64Int x, int shift_in_bits){ + x = ((x >> 1) & 0x5555555555555555) | ((x << 1) & 0xaaaaaaaaaaaaaaaa); + x = ((x >> 2) & 0x3333333333333333) | ((x << 2) & 0xcccccccccccccccc); + x = ((x >> 4) & 0x0f0f0f0f0f0f0f0f) | ((x << 4) & 0xf0f0f0f0f0f0f0f0); + x = ((x >> 8) & 0x00ff00ff00ff00ff) | ((x << 8) & 0xff00ff00ff00ff00); + x = ((x >> 16) & 0x0000ffff0000ffff) | ((x << 16) & 0xffff0000ffff0000); + x = ((x >> 32) & 0x00000000ffffffff) | ((x << 32) & 0xffffffff00000000); + return (x>>((sizeof(u64Int)*BITS_IN_BYTE-shift_in_bits))); +} + +int compare(const void *el1, const void *el2) { + s64Int v1 = *(s64Int *)el1; + s64Int v2 = *(s64Int *)el2; + return (v1v2) ? 1 : 0; +} + diff --git a/tests/apps/prk/tests/FG_MPI/Stencil/Makefile.ohpc b/tests/apps/prk/tests/FG_MPI/Stencil/Makefile.ohpc new file mode 100644 index 0000000000..1828fb9752 --- /dev/null +++ b/tests/apps/prk/tests/FG_MPI/Stencil/Makefile.ohpc @@ -0,0 +1,41 @@ +include ../../common/FG_MPI.defs +##### User configurable options ##### + +OPTFLAGS = $(DEFAULT_OPT_FLAGS) +#description: change above into something that is a decent optimization on you system + +#uncomment any of the following flags (and change values) to change defaults + +#RESTRICTFLAG = -DRESTRICT_KEYWORD +#description: the "restrict" keyword can be used on IA platforms to disambiguate +# data accessed through pointers + +#RADIUSFLAG = -DRADIUS=n +#description: default radius of filter to be applied is 2 + +DOUBLEFLAG = -DDOUBLE +#description: default data type is single precision + +STARFLAG = -DSTAR +#description: default stencil is compact (dense, square) + +#DEBUGFLAG = -DVERBOSE +#description: default diagnostic style is silent + +USERFLAGS = +#description: parameter to specify optional flags + +#set the following variables for custom libraries and/or other objects +EXTOBJS = +LIBS = -lm +LIBPATHS = +INCLUDEPATHS = + +### End User configurable options ### + +TUNEFLAGS = $(RESTRICTFLAG) $(DEBUGFLAG) $(USERFLAGS) \ + $(DOUBLEFLAG) $(RADIUSFLAG) $(STARFLAG) +PROGRAM = stencil +OBJS = $(PROGRAM).o $(COMOBJS) + +include ../../common/make.common diff --git a/tests/apps/prk/tests/FG_MPI/Stencil/stencil.c b/tests/apps/prk/tests/FG_MPI/Stencil/stencil.c new file mode 100644 index 0000000000..4ecfbc2bc9 --- /dev/null +++ b/tests/apps/prk/tests/FG_MPI/Stencil/stencil.c @@ -0,0 +1,493 @@ +/* +Copyright (c) 2013, Intel Corporation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. +* Neither the name of Intel Corporation nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +*/ + +/******************************************************************* + +NAME: Stencil + +PURPOSE: This program tests the efficiency with which a space-invariant, + linear, symmetric filter (stencil) can be applied to a square + grid or image. + +USAGE: The program takes as input the linear dimension of the grid, + and the number of iterations on the grid + + <# iterations> + + The output consists of diagnostics to make sure the + algorithm worked, and of timing statistics. + +FUNCTIONS CALLED: + + Other than MPI or standard C functions, the following + functions are used in this program: + + wtime() + bail_out() + +HISTORY: - Written by Rob Van der Wijngaart, November 2006. + - RvdW, August 2013: Removed unrolling pragmas for clarity; + fixed bug in compuation of width of strip assigned to + each rank; + - RvdW, August 2013: added constant to array "in" at end of + each iteration to force refreshing of neighbor data in + parallel versions + - RvdW, October 2014: introduced 2D domain decomposition + - RvdW, October 2014: removed barrier at start of each iteration + - RvdW, October 2014: replaced single rank/single iteration timing + with global timing of all iterations across all ranks + +*********************************************************************************/ + +#include +#include + +#ifndef RADIUS + #define RADIUS 2 +#endif + +#ifdef DOUBLE + #define DTYPE double + #define MPI_DTYPE MPI_DOUBLE + #define EPSILON 1.e-8 + #define COEFX 1.0 + #define COEFY 1.0 + #define FSTR "%lf" +#else + #define DTYPE float + #define MPI_DTYPE MPI_FLOAT + #define EPSILON 0.0001f + #define COEFX 1.0f + #define COEFY 1.0f + #define FSTR "%f" +#endif + +/* define shorthand for indexing multi-dimensional arrays with offsets */ +#define INDEXIN(i,j) (i+RADIUS+(j+RADIUS)*(width+2*RADIUS)) +/* need to add offset of RADIUS to j to account for ghost points */ +#define IN(i,j) in[INDEXIN(i-istart,j-jstart)] +#define INDEXOUT(i,j) (i+(j)*(width)) +#define OUT(i,j) out[INDEXOUT(i-istart,j-jstart)] +#define WEIGHT(ii,jj) weight[ii+RADIUS][jj+RADIUS] + +int main(int argc, char ** argv) { + + int Num_procs; /* number of ranks */ + int Num_procsx, Num_procsy; /* number of ranks in each coord direction */ + int my_ID; /* MPI rank */ + int my_IDx, my_IDy; /* coordinates of rank in rank grid */ + int right_nbr; /* global rank of right neighboring tile */ + int left_nbr; /* global rank of left neighboring tile */ + int top_nbr; /* global rank of top neighboring tile */ + int bottom_nbr; /* global rank of bottom neighboring tile */ + DTYPE *top_buf_out; /* communication buffer */ + DTYPE *top_buf_in; /* " " */ + DTYPE *bottom_buf_out; /* " " */ + DTYPE *bottom_buf_in; /* " " */ + DTYPE *right_buf_out; /* " " */ + DTYPE *right_buf_in; /* " " */ + DTYPE *left_buf_out; /* " " */ + DTYPE *left_buf_in; /* " " */ + int root = 0; + int n, width, height;/* linear global and local grid dimension */ + long nsquare; /* total number of grid points */ + int i, j, ii, jj, kk, it, jt, iter, leftover; /* dummies */ + int istart, iend; /* bounds of grid tile assigned to calling rank */ + int jstart, jend; /* bounds of grid tile assigned to calling rank */ + DTYPE norm, /* L1 norm of solution */ + local_norm, /* contribution of calling rank to L1 norm */ + reference_norm; + DTYPE f_active_points; /* interior of grid with respect to stencil */ + DTYPE flops; /* floating point ops per iteration */ + int iterations; /* number of times to run the algorithm */ + double local_stencil_time,/* timing parameters */ + stencil_time, + avgtime; + int stencil_size; /* number of points in stencil */ + DTYPE * RESTRICT in; /* input grid values */ + DTYPE * RESTRICT out; /* output grid values */ + long total_length_in; /* total required length to store input array */ + long total_length_out;/* total required length to store output array */ + int error=0; /* error flag */ + DTYPE weight[2*RADIUS+1][2*RADIUS+1]; /* weights of points in the stencil */ + MPI_Request request[8]; + MPI_Status status[8]; + int procsize; /* number of ranks per OS process */ + + /******************************************************************************* + ** Initialize the MPI environment + ********************************************************************************/ + MPI_Init(&argc,&argv); + MPI_Comm_rank(MPI_COMM_WORLD, &my_ID); + MPI_Comm_size(MPI_COMM_WORLD, &Num_procs); + + /******************************************************************************* + ** process, test, and broadcast input parameters + ********************************************************************************/ + + if (my_ID == root) { +#ifndef STAR + printf("ERROR: Compact stencil not supported\n"); + error = 1; + goto ENDOFTESTS; +#endif + + if (argc != 3){ + printf("Usage: %s <# iterations> \n", + *argv); + error = 1; + goto ENDOFTESTS; + } + + iterations = atoi(*++argv); + if (iterations < 1){ + printf("ERROR: iterations must be >= 1 : %d \n",iterations); + error = 1; + goto ENDOFTESTS; + } + + n = atoi(*++argv); + nsquare = n * n; + if (nsquare < Num_procs){ + printf("ERROR: grid size %d must be at least # ranks: %ld\n", + nsquare, Num_procs); + error = 1; + goto ENDOFTESTS; + } + + if (RADIUS < 0) { + printf("ERROR: Stencil radius %d should be non-negative\n", RADIUS); + error = 1; + goto ENDOFTESTS; + } + + if (2*RADIUS +1 > n) { + printf("ERROR: Stencil radius %d exceeds grid size %d\n", RADIUS, n); + error = 1; + goto ENDOFTESTS; + } + + ENDOFTESTS:; + } + bail_out(error); + + /* determine best way to create a 2D grid of ranks (closest to square, for + best surface/volume ratio); we do this brute force for now + */ + for (Num_procsx=(int) (sqrt(Num_procs+1)); Num_procsx>0; Num_procsx--) { + if (!(Num_procs%Num_procsx)) { + Num_procsy = Num_procs/Num_procsx; + break; + } + } + my_IDx = my_ID%Num_procsx; + my_IDy = my_ID/Num_procsx; + /* compute neighbors; don't worry about dropping off the edges of the grid */ + right_nbr = my_ID+1; + left_nbr = my_ID-1; + top_nbr = my_ID+Num_procsx; + bottom_nbr = my_ID-Num_procsx; + + if (my_ID == root) { + MPIX_Get_collocated_size(&procsize); + printf("FG_MPI stencil execution on 2D grid\n"); + printf("Number of ranks = %d\n", Num_procs); + printf("Number of ranks/process = %d\n", procsize); + printf("Grid size = %d\n", n); + printf("Radius of stencil = %d\n", RADIUS); + printf("Tiles in x/y-direction = %d/%d\n", Num_procsx, Num_procsy); + printf("Type of stencil = star\n"); +#ifdef DOUBLE + printf("Data type = double precision\n"); +#else + printf("Data type = single precision\n"); +#endif + printf("Number of iterations = %d\n", iterations); + } + + MPI_Bcast(&n, 1, MPI_INT, root, MPI_COMM_WORLD); + MPI_Bcast(&iterations, 1, MPI_INT, root, MPI_COMM_WORLD); + + /* compute amount of space required for input and solution arrays */ + + width = n/Num_procsx; + leftover = n%Num_procsx; + if (my_IDx 0) { + MPI_Irecv(bottom_buf_in,RADIUS*width, MPI_DTYPE, bottom_nbr, 99, + MPI_COMM_WORLD, &(request[3])); + for (kk=0,j=jstart; j<=jstart+RADIUS-1; j++) for (i=istart; i<=iend; i++) { + bottom_buf_out[kk++]= IN(i,j); + } + MPI_Isend(bottom_buf_out, RADIUS*width,MPI_DTYPE, bottom_nbr, 101, + MPI_COMM_WORLD, &(request[2])); + } + if (my_IDy < Num_procsy-1) { + MPI_Wait(&(request[0]), &(status[0])); + MPI_Wait(&(request[1]), &(status[1])); + for (kk=0,j=jend+1; j<=jend+RADIUS; j++) for (i=istart; i<=iend; i++) { + IN(i,j) = top_buf_in[kk++]; + } + } + if (my_IDy > 0) { + MPI_Wait(&(request[2]), &(status[2])); + MPI_Wait(&(request[3]), &(status[3])); + for (kk=0,j=jstart-RADIUS; j<=jstart-1; j++) for (i=istart; i<=iend; i++) { + IN(i,j) = bottom_buf_in[kk++]; + } + } + + /* need to fetch ghost point data from neighbors in x-direction */ + if (my_IDx < Num_procsx-1) { + MPI_Irecv(right_buf_in, RADIUS*height, MPI_DTYPE, right_nbr, 1010, + MPI_COMM_WORLD, &(request[1+4])); + for (kk=0,j=jstart; j<=jend; j++) for (i=iend-RADIUS+1; i<=iend; i++) { + right_buf_out[kk++]= IN(i,j); + } + MPI_Isend(right_buf_out, RADIUS*height, MPI_DTYPE, right_nbr, 990, + MPI_COMM_WORLD, &(request[0+4])); + } + if (my_IDx > 0) { + MPI_Irecv(left_buf_in, RADIUS*height, MPI_DTYPE, left_nbr, 990, + MPI_COMM_WORLD, &(request[3+4])); + for (kk=0,j=jstart; j<=jend; j++) for (i=istart; i<=istart+RADIUS-1; i++) { + left_buf_out[kk++]= IN(i,j); + } + MPI_Isend(left_buf_out, RADIUS*height, MPI_DTYPE, left_nbr, 1010, + MPI_COMM_WORLD, &(request[2+4])); + } + if (my_IDx < Num_procsx-1) { + MPI_Wait(&(request[0+4]), &(status[0+4])); + MPI_Wait(&(request[1+4]), &(status[1+4])); + for (kk=0,j=jstart; j<=jend; j++) for (i=iend+1; i<=iend+RADIUS; i++) { + IN(i,j) = right_buf_in[kk++]; + } + } + if (my_IDx > 0) { + MPI_Wait(&(request[2+4]), &(status[2+4])); + MPI_Wait(&(request[3+4]), &(status[3+4])); + for (kk=0,j=jstart; j<=jend; j++) for (i=istart-RADIUS; i<=istart-1; i++) { + IN(i,j) = left_buf_in[kk++]; + } + } + + /* Apply the stencil operator */ + for (j=MAX(jstart,RADIUS); j<=MIN(n-RADIUS-1,jend); j++) { + for (i=MAX(istart,RADIUS); i<=MIN(n-RADIUS-1,iend); i++) { + for (jj=-RADIUS; jj<=RADIUS; jj++) { + OUT(i,j) += WEIGHT(0,jj)*IN(i,j+jj); + } + for (ii=-RADIUS; ii<0; ii++) { + OUT(i,j) += WEIGHT(ii,0)*IN(i+ii,j); + } + for (ii=1; ii<=RADIUS; ii++) { + OUT(i,j) += WEIGHT(ii,0)*IN(i+ii,j); + + } + } + } + + /* add constant to solution to force refresh of neighbor data, if any */ + for (j=jstart; j<=jend; j++) for (i=istart; i<=iend; i++) IN(i,j)+= 1.0; + + } /* end of iterations */ + + local_stencil_time = wtime() - local_stencil_time; + MPI_Reduce(&local_stencil_time, &stencil_time, 1, MPI_DOUBLE, MPI_MAX, root, + MPI_COMM_WORLD); + + /* compute L1 norm in parallel */ + local_norm = (DTYPE) 0.0; + for (j=MAX(jstart,RADIUS); j<=MIN(n-RADIUS-1,jend); j++) { + for (i=MAX(istart,RADIUS); i<=MIN(n-RADIUS-1,iend); i++) { + local_norm += (DTYPE)ABS(OUT(i,j)); + } + } + + MPI_Reduce(&local_norm, &norm, 1, MPI_DTYPE, MPI_SUM, root, MPI_COMM_WORLD); + + /******************************************************************************* + ** Analyze and output results. + ********************************************************************************/ + +/* verify correctness */ + if (my_ID == root) { + norm /= f_active_points; + if (RADIUS > 0) { + reference_norm = (DTYPE) (iterations+1) * (COEFX + COEFY); + } + else { + reference_norm = (DTYPE) 0.0; + } + if (ABS(norm-reference_norm) > EPSILON) { + printf("ERROR: L1 norm = "FSTR", Reference L1 norm = "FSTR"\n", + norm, reference_norm); + error = 1; + } + else { + printf("Solution validates\n"); +#ifdef VERBOSE + printf("Reference L1 norm = "FSTR", L1 norm = "FSTR"\n", + reference_norm, norm); +#endif + } + } + bail_out(error); + + if (my_ID == root) { + /* flops/stencil: 2 flops (fma) for each point in the stencil, + plus one flop for the update of the input of the array */ + flops = (DTYPE) (2*stencil_size+1) * f_active_points; + avgtime = stencil_time/iterations; + printf("Rate (MFlops/s): "FSTR" Avg time (s): %lf\n", + 1.0E-06 * flops/avgtime, avgtime); + } + + MPI_Finalize(); + exit(EXIT_SUCCESS); +} diff --git a/tests/apps/prk/tests/FG_MPI/Synch_global/Makefile.ohpc b/tests/apps/prk/tests/FG_MPI/Synch_global/Makefile.ohpc new file mode 100644 index 0000000000..3a658e85e8 --- /dev/null +++ b/tests/apps/prk/tests/FG_MPI/Synch_global/Makefile.ohpc @@ -0,0 +1,28 @@ +include ../../common/FG_MPI.defs +##### User configurable options ##### + +OPTFLAGS = $(DEFAULT_OPT_FLAGS) +#description: change above into something that is a decent optimization on you system + +#uncomment any of the following flags (and change values) to change defaults + +#DEBUGFLAG = -DVERBOSE +#description: default diagnostic style is silent + +USERFLAGS = +#description: parameter to specify optional flags + +#set the following variables for custom libraries and/or other objects + +EXTOBJS = +LIBS = +LIBPATHS = +INCLUDEPATHS = + +### End User configurable options ### + +TUNEFLAGS = $(DEBUGFLAG) $(USERFLAGS) +PROGRAM = global +OBJS = $(PROGRAM).o $(COMOBJS) + +include ../../common/make.common diff --git a/tests/apps/prk/tests/FG_MPI/Synch_global/global.c b/tests/apps/prk/tests/FG_MPI/Synch_global/global.c new file mode 100755 index 0000000000..96686fd2bd --- /dev/null +++ b/tests/apps/prk/tests/FG_MPI/Synch_global/global.c @@ -0,0 +1,238 @@ +/* +Copyright (c) 2013, Intel Corporation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. +* Neither the name of Intel Corporation nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +*/ + +/******************************************************************* + +NAME: StopNGo + +PURPOSE: This program tests the efficiency of a global synchronization + on the target system. + +USAGE: The program takes as input the number of times the test of + string manipulation involving the global synchronization is + carried out, as well as the length of the string. + + <# iterations> + + The output consists of diagnostics to make sure the + algorithm worked, and of timing statistics. + + Compile with VERBOSE defined if you want lots of output. + +FUNCTIONS CALLED: + + Other than MPI or standard C functions, the following + functions are used in this program: + + wtime() + bail_out() + chartoi() + +HISTORY: Written by Rob Van der Wijngaart, December 2005. + +*******************************************************************/ + +#include +#include + +#define EOS '\0' + +int chartoi(char c) { + /* define short string; need two characters, second contains string terminator */ + char letter[2]="0"; + letter[0]=c; + return (atoi(letter)); +} + + +int main(int argc, char ** argv) +{ + int my_ID; /* rank */ + int root=0; + int iterations; /* number of times to rehash strings */ + int i, iter; /* dummies */ + int checksum; /* computed checksum of final aggregate string */ + char *scramble = "27638472638746283742712311207892"; + char *basestring; /* initial string to be copied to private strings */ + char *iterstring; /* private copy of string */ + char *catstring; /* concatenated, scrambled string */ + long length, /* total length of scramble string */ + proc_length; /* length of string per rank */ + int basesum; /* checksum of base string */ + MPI_Datatype mpi_word; /* chunk of scramble string to be communicated */ + double stopngo_time;/* timing parameter */ + int Num_procs; /* Number of ranks */ + int error = 0; /* error flag */ + int procsize; /* number of ranks per OS process */ + +/********************************************************************************* +** Initialize the MPI environment +**********************************************************************************/ + MPI_Init(&argc,&argv); + MPI_Comm_rank(MPI_COMM_WORLD, &my_ID); + MPI_Comm_size(MPI_COMM_WORLD, &Num_procs); + +/********************************************************************************* +** process, test and broadcast input parameter +**********************************************************************************/ + + if (my_ID == root){ + if (argc != 3){ + printf("Usage: %s <# iterations> \n", *argv); + error = 1; + goto ENDOFTESTS; + } + + iterations = atoi(*++argv); + if (iterations < 1){ + printf("ERROR: iterations must be positive: %d \n",iterations); + error = 1; + goto ENDOFTESTS; + } + + length = atol(*++argv); + if (length <# iterations> + + The output consists of diagnostics to make sure the + algorithm worked, and of timing statistics. + +FUNCTIONS CALLED: + + Other than MPI or standard C functions, the following + functions are used in this program: + + wtime() + bail_out() + +HISTORY: - Written by Rob Van der Wijngaart, March 2006. + - modified by Rob Van der Wijngaart, August 2006: + * changed boundary conditions and stencil computation to avoid + overflow + * introduced multiple iterations over grid and dependency between + iterations + +**********************************************************************************/ + +#include +#include + +#define ARRAY(i,j) vector[i+1+(j)*(segment_size+1)] + +int mymain(int argc, char ** argv) +{ + int my_ID; /* rank */ + int root; + int m, n; /* grid dimensions */ + double local_pipeline_time, /* timing parameters */ + pipeline_time, + avgtime; + double epsilon = 1.e-8; /* error tolerance */ + double corner_val; /* verification value at top right corner of grid */ + int i, j, jj, iter, ID;/* dummies */ + int iterations; /* number of times to run the pipeline algorithm */ + int start, end; /* start and end of grid slice owned by calling rank */ + int segment_size; + int error=0; /* error flag */ + int Num_procs; /* Number of ranks */ + int grp; /* grid line aggregation factor */ + int jjsize; /* actual line group size */ + double *vector; /* array holding grid values */ + double *inbuf, *outbuf; /* communication buffers used when aggregating */ + long total_length; /* total required length to store grid values */ + MPI_Status status; /* completion status of message */ + int procsize; /* number of ranks per OS process */ + +/********************************************************************************* +** Initialize the MPI environment +**********************************************************************************/ + MPI_Init(&argc,&argv); + MPI_Comm_rank(MPI_COMM_WORLD, &my_ID); + MPI_Comm_size(MPI_COMM_WORLD, &Num_procs); + +/* we set root equal to the highest rank, because this is also the rank that + reports on the verification value */ + root = Num_procs-1; + +/********************************************************************* +** process, test and broadcast input parameter +*********************************************************************/ + + if (my_ID == root){ + if (argc != 4 && argc != 5){ + printf("Usage: %s <#iterations> <1st array dimension> <2nd array dimension> [group factor]\n", + *argv); + error = 1; + goto ENDOFTESTS; + } + + iterations = atoi(*++argv); + if (iterations < 1){ + printf("ERROR: iterations must be >= 1 : %d \n",iterations); + error = 1; + goto ENDOFTESTS; + } + + m = atoi(*++argv); + n = atoi(*++argv); + if (m < 1 || n < 1){ + printf("ERROR: grid dimensions must be positive: %d, %d \n", m, n); + error = 1; + goto ENDOFTESTS; + } + + if (m= n) grp = n-1; + } + else grp = 1; + + ENDOFTESTS:; + } + bail_out(error); + + if (my_ID == root) { + MPIX_Get_collocated_size(&procsize); + printf("FG_MPI pipeline execution on 2D grid\n"); + printf("Number of ranks = %d\n", Num_procs); + printf("Number of ranks/process = %d\n", procsize); + printf("Grid sizes = %d, %d\n", m, n); + printf("Number of iterations = %d\n", iterations); + if (grp > 1) + printf("Group factor = %d (cheating!)\n", grp); + } + + /* Broadcast benchmark data to all ranks */ + MPI_Bcast(&m, 1, MPI_INT, root, MPI_COMM_WORLD); + MPI_Bcast(&n, 1, MPI_INT, root, MPI_COMM_WORLD); + MPI_Bcast(&grp, 1, MPI_INT, root, MPI_COMM_WORLD); + MPI_Bcast(&iterations, 1, MPI_INT, root, MPI_COMM_WORLD); + + int leftover; + segment_size = m/Num_procs; + leftover = m%Num_procs; + if (my_ID < leftover) { + start = (segment_size+1)* my_ID; + end = start + segment_size; + } + else { + start = (segment_size+1) * leftover + segment_size * (my_ID-leftover); + end = start + segment_size -1; + } + + /* now set segment_size to the value needed by the calling rank */ + segment_size = end - start + 1; + + /* total_length takes into account one ghost cell on left side of segment */ + total_length = ((end-start+1)+1)*n; + vector = (double *) malloc(total_length*sizeof(double)); + if (vector == NULL) { + printf("Could not allocate space for grid slice of %d by %d points", + segment_size, n); + printf(" on rank %d\n", my_ID); + error = 1; + } + bail_out(error); + + /* reserve space for in and out buffers */ + inbuf = (double *) malloc(2*sizeof(double)*(grp)); + if (inbuf == NULL) { + printf("Could not allocate space for %d words of communication buffers", + 2*grp); + printf(" on rank %d\n", my_ID); + error = 1; + } + bail_out(error); + outbuf = inbuf + grp; + + /* clear the array */ + for (j=0; j 0) { + MPI_Recv(&(ARRAY(start-1,j)), 1, MPI_DOUBLE, my_ID-1, j, + MPI_COMM_WORLD, &status); + } + + for (i=start; i<= end; i++) { + ARRAY(i,j) = ARRAY(i-1,j) + ARRAY(i,j-1) - ARRAY(i-1,j-1); + } + + /* if I am not on the right boundary, send data to my right neighbor */ + if (my_ID < Num_procs-1) { + MPI_Send(&(ARRAY(end,j)), 1, MPI_DOUBLE, my_ID+1, j, MPI_COMM_WORLD); + } + } + else for (j=1; j 0) { + MPI_Recv(inbuf, jjsize, MPI_DOUBLE, my_ID-1, j, MPI_COMM_WORLD, &status); + for (jj=0; jj1) { + if (my_ID==root) { + corner_val = -ARRAY(end,n-1); + MPI_Send(&corner_val,1,MPI_DOUBLE,0,888,MPI_COMM_WORLD); + } + if (my_ID==0) { + MPI_Recv(&(ARRAY(0,0)),1,MPI_DOUBLE,root,888,MPI_COMM_WORLD,&status); + } + } + else ARRAY(0,0)= -ARRAY(end,n-1); + + } + + local_pipeline_time = wtime() - local_pipeline_time; + MPI_Reduce(&local_pipeline_time, &pipeline_time, 1, MPI_DOUBLE, MPI_MAX, root, + MPI_COMM_WORLD); + + /******************************************************************************* + ** Analyze and output results. + ********************************************************************************/ + + /* verify correctness, using top right value */ + corner_val = (double) ((iterations+1)*(m+n-2)); + if (my_ID == root) { + if (abs(ARRAY(end,n-1)-corner_val)/corner_val >= epsilon) { + printf("ERROR: checksum %lf does not match verification value %lf\n", + ARRAY(end,n-1), corner_val); + error = 1; + } + } + bail_out(error); + + if (my_ID == root) { + avgtime = pipeline_time/iterations; + /* flip the sign of the execution time to indicate cheating */ + if (grp>1) avgtime *= -1.0; +#ifdef VERBOSE + printf("Solution validates; verification value = %lf\n", corner_val); + printf("Point-to-point synchronizations/s: %lf\n", + ((float)((n-1)*(Num_procs-1)))/(avgtime)); +#else + printf("Solution validates\n"); +#endif + printf("Rate (MFlops/s): %lf Avg time (s): %lf\n", + 1.0E-06 * 2 * ((double)((m-1)*(n-1)))/avgtime, avgtime); + } + + MPI_Finalize(); + exit(EXIT_SUCCESS); + +} /* end of main */ + diff --git a/tests/apps/prk/tests/FG_MPI/Transpose/Makefile.ohpc b/tests/apps/prk/tests/FG_MPI/Transpose/Makefile.ohpc new file mode 100644 index 0000000000..a5bad2f966 --- /dev/null +++ b/tests/apps/prk/tests/FG_MPI/Transpose/Makefile.ohpc @@ -0,0 +1,31 @@ +include ../../common/FG_MPI.defs + +##### User configurable options ##### + +OPTFLAGS = $(DEFAULT_OPT_FLAGS) +#description: change above into something that is a decent optimization on you system + +#uncomment any of the following flags (and change values) to change defaults + +#BLOCKFLAG = -DSYNCHRONOUS +#description: turn on synchronous (blocking) communications + +#DEBUGFLAG = -DVERBOSE +#description: default diagnostic style is silent + +USERFLAGS = +#description: parameter to specify optional flags + +#set the following variables for custom libraries and/or other objects +EXTOBJS = +LIBS = +LIBPATHS = +INCLUDEPATHS = + +### End User configurable options ### + +TUNEFLAGS = $(BLOCKFLAG) $(DEBUGFLAG) $(USERFLAGS) +PROGRAM = transpose +OBJS = $(PROGRAM).o $(COMOBJS) + +include ../../common/make.common diff --git a/tests/apps/prk/tests/FG_MPI/Transpose/transpose.c b/tests/apps/prk/tests/FG_MPI/Transpose/transpose.c new file mode 100755 index 0000000000..baa21a48b3 --- /dev/null +++ b/tests/apps/prk/tests/FG_MPI/Transpose/transpose.c @@ -0,0 +1,382 @@ +/* +Copyright (c) 2013, Intel Corporation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. +* Neither the name of Intel Corporation nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +*/ + +/******************************************************************* + +NAME: transpose + +PURPOSE: This program tests the efficiency with which a square matrix + can be transposed and stored in another matrix. The matrices + are distributed identically. + +USAGE: Program inputs are the matrix order, the number of times to + repeat the operation, and the communication mode + + transpose <# iterations> [tile size] + + An optional parameter specifies the tile size used to divide the + individual matrix blocks for improved cache and TLB performance. + + The output consists of diagnostics to make sure the + transpose worked and timing statistics. + +FUNCTIONS CALLED: + + Other than MPI or standard C functions, the following + functions are used in this program: + + wtime() Portable wall-timer interface. + bail_out() Determine global error and exit if nonzero. + +HISTORY: Written by Tim Mattson, April 1999. + Updated by Rob Van der Wijngaart, December 2005. + Updated by Rob Van der Wijngaart, October 2006. + Updated by Rob Van der Wijngaart, November 2014:: + - made variable names more consistent + - put timing around entire iterative loop of transposes + - fixed incorrect matrix block access; no separate function + for local transpose of matrix block + - reordered initialization and verification loops to + produce unit stride + - changed initialization values, such that the input matrix + elements are: A(i,j) = i+order*j + + +*******************************************************************/ + +/****************************************************************** + Layout nomenclature + ------------------- + +o Each rank owns one block of columns (Colblock) of the overall + matrix to be transposed, as well as of the transposed matrix. +o Colblock is stored contiguously in the memory of the rank. + The stored format is column major, which means that matrix + elements (i,j) and (i+1,j) are adjacent, and (i,j) and (i,j+1) + are "order" words apart +o Colblock is logically composed of #ranks Blocks, but a Block is + not stored contiguously in memory. Conceptually, the Block is + the unit of data that gets communicated between ranks. Block i of + rank j is locally transposed and gathered into a buffer called Work, + which is sent to rank i, where it is scattered into Block j of the + transposed matrix. +o When tiling is applied to reduce TLB misses, each block gets + accessed by tiles. +o The original and transposed matrices are called A and B + + ----------------------------------------------------------------- +| | | | | +| Colblock | | | | +| | | | | +| | | | | +| | | | | +| ------------------------------- | +| | | | | +| | Block | | | +| | | | | +| | | | | +| | | | | +| ------------------------------- | +| |Tile| | | | +| | | | | Overall Matrix | +| |---- | | | +| | | | | +| | | | | +| ------------------------------- | +| | | | | +| | | | | +| | | | | +| | | | | +| | | | | + -----------------------------------------------------------------*/ + +#include +#include + +#define A(i,j) A_p[(i+istart)+order*(j)] +#define B(i,j) B_p[(i+istart)+order*(j)] +#define Work_in(i,j) Work_in_p[i+Block_order*(j)] +#define Work_out(i,j) Work_out_p[i+Block_order*(j)] + +int main(int argc, char ** argv) +{ + int Block_order; /* number of columns owned by rank */ + int Block_size; /* size of a single block */ + int Colblock_size; /* size of column block */ + int Tile_order=32; /* default Tile order */ + int tiling; /* boolean: true if tiling is used */ + int Num_procs; /* number of ranks */ + int order; /* order of overall matrix */ + int send_to, recv_from; /* ranks with which to communicate */ + MPI_Status status; +#ifndef SYNCHRONOUS + MPI_Request send_req; + MPI_Request recv_req; +#endif + long bytes; /* combined size of matrices */ + int my_ID; /* rank */ + int root=0; /* ID of root rank */ + int iterations; /* number of times to do the transpose */ + int i, j, it, jt, istart;/* dummies */ + int iter; /* index of iteration */ + int phase; /* phase inside staged communication */ + int colstart; /* starting column for owning rank */ + int error; /* error flag */ + double *A_p; /* original matrix column block */ + double *B_p; /* transposed matrix column block */ + double *Work_in_p; /* workspace for the transpose function */ + double *Work_out_p; /* workspace for the transpose function */ + double abserr, /* absolute error */ + abserr_tot; /* aggregate absolute error */ + double epsilon = 1.e-8; /* error tolerance */ + double local_trans_time, /* timing parameters */ + trans_time, + avgtime; + int procsize; /* number of ranks per OS process */ + +/********************************************************************* +** Initialize the MPI environment +*********************************************************************/ + MPI_Init(&argc,&argv); + MPI_Comm_rank(MPI_COMM_WORLD, &my_ID); + MPI_Comm_size(MPI_COMM_WORLD, &Num_procs); + +/********************************************************************* +** process, test and broadcast input parameters +*********************************************************************/ + error = 0; + if (my_ID == root) { + if (argc != 3 && argc != 4){ + printf("Usage: %s <# iterations> [Tile size]\n", + *argv); + error = 1; goto ENDOFTESTS; + } + + iterations = atoi(*++argv); + if(iterations < 1){ + printf("ERROR: iterations must be >= 1 : %d \n",iterations); + error = 1; goto ENDOFTESTS; + } + + order = atoi(*++argv); + if (order < Num_procs) { + printf("ERROR: matrix order %d should at least # procs %d\n", + order, Num_procs); + error = 1; goto ENDOFTESTS; + } + if (order%Num_procs) { + printf("ERROR: matrix order %d should be divisible by # procs %d\n", + order, Num_procs); + error = 1; goto ENDOFTESTS; + } + + if (argc == 4) Tile_order = atoi(*++argv); + + ENDOFTESTS:; + } + bail_out(error); + + if (my_ID == root) { + MPIX_Get_collocated_size(&procsize); + printf("FG_MPI matrix transpose: B = A^T\n"); + printf("Number of ranks = %d\n", Num_procs); + printf("Number of ranks/process = %d\n", procsize); + printf("Matrix order = %d\n", order); + printf("Number of iterations = %d\n", iterations); + if ((Tile_order > 0) && (Tile_order < order)) + printf("Tile size = %d\n", Tile_order); + else printf("Untiled\n"); +#ifndef SYNCHRONOUS + printf("Non-"); +#endif + printf("Blocking messages\n"); + } + + /* Broadcast input data to all ranks */ + MPI_Bcast (&order, 1, MPI_INT, root, MPI_COMM_WORLD); + MPI_Bcast (&iterations, 1, MPI_INT, root, MPI_COMM_WORLD); + MPI_Bcast (&Tile_order, 1, MPI_INT, root, MPI_COMM_WORLD); + + /* a non-positive tile size means no tiling of the local transpose */ + tiling = (Tile_order > 0) && (Tile_order < order); + bytes = 2 * sizeof(double) * order * order; + +/********************************************************************* +** The matrix is broken up into column blocks that are mapped one to a +** rank. Each column block is made up of Num_procs smaller square +** blocks of order block_order. +*********************************************************************/ + + Block_order = order/Num_procs; + colstart = Block_order * my_ID; + Colblock_size = order * Block_order; + Block_size = Block_order * Block_order; + +/********************************************************************* +** Create the column block of the test matrix, the row block of the +** transposed matrix, and workspace (workspace only if #procs>1) +*********************************************************************/ + A_p = (double *)malloc(Colblock_size*sizeof(double)); + if (A_p == NULL){ + printf(" Error allocating space for original matrix on node %d\n",my_ID); + error = 1; + } + bail_out(error); + + B_p = (double *)malloc(Colblock_size*sizeof(double)); + if (B_p == NULL){ + printf(" Error allocating space for transpose matrix on node %d\n",my_ID); + error = 1; + } + bail_out(error); + + if (Num_procs>1) { + Work_in_p = (double *)malloc(2*Block_size*sizeof(double)); + if (Work_in_p == NULL){ + printf(" Error allocating space for work on node %d\n",my_ID); + error = 1; + } + bail_out(error); + Work_out_p = Work_in_p + Block_size; + } + + /* Fill the original column matrix */ + istart = 0; + for (j=0;j <# iterations> + + The output consists of diagnostics to make sure the + algorithm worked, and of timing statistics. +FUNCTIONS CALLED: + Other than MPI or standard C functions, the following + functions are used in this program: + wtime() + bail_out() +HISTORY: - Written by Rob Van der Wijngaart, November 2006. + - RvdW, August 2013: Removed unrolling pragmas for clarity; + fixed bug in compuation of width of strip assigned to + each rank; + - RvdW, August 2013: added constant to array "in" at end of + each iteration to force refreshing of neighbor data in + parallel versions + - RvdW, October 2014: introduced 2D domain decomposition + - RvdW, October 2014: removed barrier at start of each iteration + - RvdW, October 2014: replaced single rank/single iteration timing + with global timing of all iterations across all ranks + +*********************************************************************************/ +#include +#include +#include +#include +using namespace Grappa; +#ifndef RADIUS + #define RADIUS 2 +#endif +#define DOUBLE +#define STAR +#ifdef DOUBLE + #define DTYPE double + #define MPI_DTYPE MPI_DOUBLE + #define EPSILON 1.e-8 + #define COEFX 1.0 + #define COEFY 1.0 + #define FSTR "%lf" +#else + #define DTYPE float + #define MPI_DTYPE MPI_FLOAT + #define EPSILON 0.0001f + #define COEFX 1.0f + #define COEFY 1.0f + #define FSTR "%f" +#endif +#define root 0 + +#define FOCUS 1 + +// temporary hack to allocate symmetric data with lower overhead +#define symmetric static + +// define shorthand for indexing multi-dimensional arrays with offsets +#define INDEXIN(i,j) (i+RADIUS+(j+RADIUS)*(width+2*RADIUS)) +// need to add offset of RADIUS to j to account for ghost points +#define IN(i,j) in[INDEXIN(i-istart,j-jstart)] +#define INDEXOUT(i,j) (i+(j)*(width)) +#define OUT(i,j) out[INDEXOUT(i-istart,j-jstart)] +#define WEIGHT(ii,jj) weight[ii+RADIUS][jj+RADIUS] + + +int main(int argc, char * argv[]) { + // Num_procs = number of Grappa cores + // Num_procsx/y = number of Grappa cores in respective coordinate directions + // my_ID = Grappa core ID + // my_IDx, my_IDy = coordinates of Grappa core in core grid + // right_nbr = global ID of right neighboring core + // left_nbr = global ID of left neighboring core + // top_nbr = global ID of top neighboring core + // bottom_nbr = global ID of bottom neighboring core + // root = 0 + // n, width, height = linear global and local grid dimension + // nsquare = total number of grid points + // i, j, ii, jj, kk, it, jt, iter, leftover = dummies + // istart, iend = bounds of grid tile assigned to calling core + // jstart, jend = bounds of grid tile assigned to calling core + // norm = L1 norm of solution + // local_norm = contribution of calling core to L1 norm + // reference_norm + // f_active_points = interior of grid with respect to stencil + // flops = floating point ops per iteration + // iterations; = number of times to run the algorithm + // local_stencil_time = timing parameters + // stencil_time, + // avgtime + // stencil_size = number of points in stencil + // in = input grid values + // out = output grid values + // total_length_in = total required length to store input array + // total_length_out = total required length to store output array + // error = error flag + // weight = weights of points in the stencil + Grappa::init( &argc, &argv ); + symmetric int my_ID = Grappa::mycore(); + + /******************************************************************************* + ** process and test input parameters + ********************************************************************************/ +#ifndef STAR + if (my_ID == root) + std::cout <<"ERROR: Compact stencil not supported"< "<= 1 :"< n) { + std::cout<<"ERROR: Stencil radius "<0; Num_procsx--) { + if (!(Num_procs%Num_procsx)) { + Num_procsy = Num_procs/Num_procsx; + break; + } + } + symmetric int my_IDx; + symmetric int my_IDy; + on_all_cores( [Num_procsx] { + my_IDx = my_ID%Num_procsx; + my_IDy = my_ID/Num_procsx; } + ); + + std::cout<<"Grappa stencil execution on 2D grid"<(total_length_in); + out = Grappa::locale_new_array(total_length_out); + if (!in || !out) { + std::cout<<"ERROR: core "<>(RADIUS*width); + bottom_halo = Grappa::locale_new_array>(RADIUS*width); + right_halo = Grappa::locale_new_array>(RADIUS*height); + left_halo = Grappa::locale_new_array>(RADIUS*height); + if (!top_halo || !bottom_halo || !right_halo || !left_halo) { + std::cout<<"ERROR: Rank "<( top_nbr, [=] () { + writeXF( &bottom_halo[kk], val); + } ); + } + if (my_IDy > 0) + for (kk=0,j=jstart; j<=jstart+RADIUS-1; j++) + for (i=istart; i<=iend; i++,kk++) { + auto val = IN(i,j); + Grappa::delegate::call( bottom_nbr, [=] () { + writeXF( &top_halo[kk], val); + } ); + } + if (my_IDx < Num_procsx-1) + for (kk=0,j=jstart; j<=jend; j++) + for (i=iend-RADIUS+1; i<=iend; i++,kk++) { + auto val = IN(i,j); + Grappa::delegate::call( right_nbr, [=] () { + writeXF( &left_halo[kk], val); + } ); + } + if (my_IDx > 0) + for (kk=0,j=jstart; j<=jend; j++) + for (i=istart; i<=istart+RADIUS-1; i++,kk++) { + auto val = IN(i,j); + Grappa::delegate::call( left_nbr, [=] () { + writeXF( &right_halo[kk], val); + } ); + } + //Now put the halos into the regular array tile + if (my_IDy < Num_procsy-1) + for (kk=0,j=jend+1; j<=jend+RADIUS; j++) + for (i=istart; i<=iend; i++,kk++) { + IN(i,j) = readFE( &top_halo[kk]); + } + if (my_IDy > 0) + for (kk=0,j=jstart-RADIUS; j<=jstart-1; j++) + for (i=istart; i<=iend; i++,kk++) { + IN(i,j) = readFE( &bottom_halo[kk]); + } + if (my_IDx < Num_procsx-1) + for (kk=0,j=jstart; j<=jend; j++) + for (i=iend+1; i<=iend+RADIUS; i++,kk++) + IN(i,j) = readFE( &right_halo[kk]); + if (my_IDx > 0) + for (kk=0,j=jstart; j<=jend; j++) for (i=istart-RADIUS; i<=istart-1; i++,kk++) + IN(i,j) = readFE( &left_halo[kk]); + + // Apply the stencil operator + for (j=MAX(jstart,RADIUS); j<=MIN(n-RADIUS-1,jend); j++) { + for (i=MAX(istart,RADIUS); i<=MIN(n-RADIUS-1,iend); i++) { + for (jj=-RADIUS; jj<=RADIUS; jj++) { + OUT(i,j) += WEIGHT(0,jj)*IN(i,j+jj); + } + for (ii=-RADIUS; ii<0; ii++) { + OUT(i,j) += WEIGHT(ii,0)*IN(i+ii,j); + } + for (ii=1; ii<=RADIUS; ii++) { + OUT(i,j) += WEIGHT(ii,0)*IN(i+ii,j); + } + } + } + // add constant to solution to force refresh of neighbor data, if any + for (j=jstart; j<=jend; j++) for (i=istart; i<=iend; i++) IN(i,j)+= 1.0; + } ); + } ); + + } // end of iterations */ + + symmetric DTYPE local_norm; + + Grappa::on_all_cores ( [n] { + int my_ID=Grappa::mycore(); + total = Grappa::walltime() - start; + local_norm = (DTYPE) 0.0; + // compute L1 norm in parallel */ + for (int j=MAX(jstart,RADIUS); j<=MIN(n-RADIUS-1,jend); j++) { + for (int i=MAX(istart,RADIUS); i<=MIN(n-RADIUS-1,iend); i++) { + local_norm += (DTYPE)ABS(OUT(i,j)); + } + } + }); + // verify result + double reference_norm = (DTYPE) (iterations+1) * (COEFX + COEFY); + double actual_norm = Grappa::reduce>(&local_norm ); + double f_active_points = (DTYPE) (n-2*RADIUS)*(DTYPE) (n-2*RADIUS); + actual_norm /= f_active_points; + if (ABS(reference_norm-actual_norm) >= EPSILON) { + std::cout<<"ERROR: checksum "<>( &total ); + // flops/stencil: 2 flops (fma) for each point in the stencil, + // plus one flop for the update of the input of the array + int stencil_size = 4*RADIUS+1; + double flops = (DTYPE) (2*stencil_size+1) * f_active_points; + double avgtime = iter_time/iterations; + std::cout << "Solution validates"< +#include + +using namespace Grappa; + +#define ARRAY(i,j) (local[(i)+((j)*segment_size)]) +#define ABS(x) ((x)>0 ? (x) : (-(x))) +#define root 0 + +double *local; +int start, end, segment_size; +FullEmpty *lefts; + +struct Timer { + double start; + double total; +} GRAPPA_BLOCK_ALIGNED; + +int main( int argc, char * argv[] ) { + + int iterations; + int m, n; + + Grappa::init( &argc, &argv ); + + if( argc != 4 && argc !=5 ) { + if( Grappa::mycore() == root ) + std::cout <<"Usage: " << argv[0] << + " <#iterations> <1st array dimension> <2nd array dimension>" << std::endl; + exit(1); + } + + iterations = atoi(argv[1]); + if (iterations < 1){ + if( Grappa::mycore() == root ) + printf("ERROR: iterations must be >= 1 : %d \n",iterations); + exit(1); + } + + m = atoi(argv[2]); + n = atoi(argv[3]); + if (m < 1 || n < 1){ + if( Grappa::mycore() == root ) + std::cout <<"ERROR: grid dimensions must be positive: "< timer = Grappa::symmetric_global_alloc(); + + for (int iter = 0; iter <= iterations; ++iter ) { + + Grappa::on_all_cores( [timer,iter,n] { + for( int j = 1; j < n; j++ ) { + if( Grappa::mycore() != root) { + lefts[j].reset(); + } + } + if (iter==1) timer->start = Grappa::walltime(); + } ); + + // execute kernel + + Grappa::finish( [m,n] { + Grappa::on_all_cores( [m,n] { + double left, diag, up, current; + int my_ID = Grappa::mycore(); + + for(int j=1; j( my_ID+1, [=] () { + writeXF( &lefts[j], current ); + } ); + } + } + + // store top right corner value in a location to be read by the root core + if (my_ID==Grappa::cores()-1) { + Grappa::delegate::call(root, [=] () { + writeXF(&lefts[0], -1.0*current); + } ); + } + } ); + } ); + + } // done with all iterations + + + Grappa::on_all_cores ( [timer] { + Grappa::barrier(); + timer->total = Grappa::walltime() - timer->start; + }); + + // verify result + double expected_corner_val = (double) (iterations+1) * ( m + n - 2 ); + double actual_corner_val = -1.0*readFF(&lefts[0]); + if (ABS(expected_corner_val-actual_corner_val) >= epsilon) { + std::cout<<"ERROR: checksum "<>( &timer->total ); + avgtime = iter_time/iterations; + std::cout << "Solution validates"< +The function is invoked with default values 10 and 40 if no +values for these variables are supplied on the make command line. + diff --git a/tests/apps/prk/tests/MPI/Branch/branch.c b/tests/apps/prk/tests/MPI/Branch/branch.c new file mode 100755 index 0000000000..f0688059cf --- /dev/null +++ b/tests/apps/prk/tests/MPI/Branch/branch.c @@ -0,0 +1,374 @@ +/* +Copyright (c) 2013, Intel Corporation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. +* Neither the name of Intel Corporation nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +*/ + +/******************************************************************* + +NAME: Branch + +PURPOSE: This program tests the effect of inner-loop branches on + application performance. We investigate four cases. The first + three all concern light-weight loops, i.e. loops that have + very few instructions associated with them. + 1) branches inside vectorizable loops where the branch does + not necessarily inhibit vectorization: vector_go + 2) branches inside vectorizable loops where the branch does + inhibit vectorization: vector_stop + 3) branches inside non-vectorizable loops: no_vector + 4) branches inside non-vectorizable loops in which each branch + corresponds to a sizeable and different set of instructions: + ins-heavy + +CONSTRAINTS: + - the code should be continuously scalable, i.e. the user should + be able to specify the amount of work to be done. + - the code should be verifiable. + - the code should be executable with and without branches, with + otherwise identical amounts of work, to assess the impact of the + branches. + - the performance of the code should be dominated by the work in + the loops, not by memory bandwidth required to fetch data. This + means that arrays should fit in cache, and any loop over arrays + should be executed many times to amortize the initial memory load + costs and to remove noise from the timings. + - any arrays used should be initialized only once, to avoid confusing + performance impact of initialization with that of the branches. + Because the base loop over the array is short, it completes very + quickly, leading to very noisy results if it were timed separately. + Hence, we must time the ensemble of all iterations over the base + loop, which would include reinitializations if present. + - the branches should be "unpredictable," meaning that if the compiler + guesses them to be always taken or to be always not taken, it will + be wrong often. Otherwise the cost of a mispredicted branch may + not show up in the performance results. + - the amount of work in the codes containing the three different + types of light-weight loops should be the same to allow fair + comparisions. + - the code should not not produce overflow or underflow. + - the actual cost of computing the branch condition should be small, + so that we can assess the cost of the occurrence of the branch as + it disrupts vectorization and the hardware pipelines). If the + condition were expensive to compute and we run the code with and + without the branch, the performance difference would be exaggerated. + - Note: Casts from integer to float or double are not always vectorizable. + +APPROACH: + - to avoid casts and keep conditionals inexpensive and exact, we use + only integer operations. + - we make sure that the numerical results of the codes for the + different branch structures and for the different paths following + the branch are identical. + - conditionals are simple comparisons to zero of quantities that + are computed anyway. + - initialization produces a saw-tooth pattern with frequent sign + crossings to defeat speculative branch execution. + - successive iterations over a relatively short array result simply + in a change of sign of all array elements, so that the results are + bounded, and verification values are easily computable. + +USAGE: The program takes as input the length of the loop, the number of + repetitions of the loop, and the type of branching + + <# iterations> + + The output consists of diagnostics to make sure the + algorithm worked, and of timing statistics. + +FUNCTIONS CALLED: + + Other than MPI or standard C functions, the following + functions are used in this program: + + wtime() + bail_out() + fill_vec() + func*() + +HISTORY: Written by Rob Van der Wijngaart, May 2006. + +*******************************************************************/ + +#include +#include + +/* the following values are only used as labels */ +#define VECTOR_STOP 66 +#define VECTOR_GO 77 +#define NO_VECTOR 88 +#define INS_HEAVY 99 +#define WITH_BRANCHES 1 +#define WITHOUT_BRANCHES 0 + +extern int fill_vec(int *vector, int vector_length, int iterations, int branch, + int *nfunc, int *rank); + +int main(int argc, char ** argv) +{ + int my_ID; /* rank */ + int root=0; /* ID of root rank */ + int Num_procs; /* Number of ranks */ + int vector_length; /* length of loop containing the branch */ + int nfunc; /* number of functions used in INS_HEAVY option */ + int rank; /* matrix rank used in INS_HEAVY option */ + double branch_time, /* timing parameters */ + no_branch_time; + double ops; /* number of integer operations in code */ + int iterations; /* number of times the branching loop is executed */ + int i, iter, aux; /* dummies */ + int error = 0; /* error flag */ + char *branch_type; + int total=0, + total_sum, + total_ref; /* computed and stored verification values */ + int btype; + int * RESTRICT vector, * RESTRICT index; + int factor = -1; + +/********************************************************************* +** Initialize the MPI environment +*********************************************************************/ + MPI_Init(&argc,&argv); + MPI_Comm_rank(MPI_COMM_WORLD, &my_ID); + MPI_Comm_size(MPI_COMM_WORLD, &Num_procs); + +/********************************************************************************** +** process and test input parameters +***********************************************************************************/ + + if(my_ID == root) { + if (argc != 4){ + printf("USAGE: %s <# iterations> \n", *argv); + printf("branching type: vector_go, vector_stop, no_vector, ins_heavy\n"); + error = 1; + goto ENDOFTESTS; + } + + iterations = atoi(*++argv); + if (iterations < 1 || iterations%2==1){ + printf("ERROR: Iterations must be positive and even : %d \n", iterations); + error = 1; + goto ENDOFTESTS; + } + + vector_length = atoi(*++argv); + if (vector_length < 1){ + printf("ERROR: loop length must be >= 1 : %d \n",vector_length); + error = 1; + goto ENDOFTESTS; + } + + branch_type = *++argv; + if (!strcmp(branch_type,"vector_stop")) btype = VECTOR_STOP; + else if (!strcmp(branch_type,"vector_go" )) btype = VECTOR_GO; + else if (!strcmp(branch_type,"no_vector" )) btype = NO_VECTOR; + else if (!strcmp(branch_type,"ins_heavy" )) btype = INS_HEAVY; + else { + printf("Wrong branch type: %s; choose vector_stop, vector_go, ", branch_type); + printf("no_vector, or ins_heavy\n"); + error = 1; + goto ENDOFTESTS; + } + ENDOFTESTS:; + } + bail_out(error); + + if (my_ID == root) { + printf("MPI Branching Bonanza\n"); + printf("Number of ranks = %d\n", Num_procs); + printf("Vector length = %d\n", vector_length); + printf("Number of iterations = %d\n", iterations); + printf("Branching type = %s\n", branch_type); + } + + /* broadcast input data */ + MPI_Bcast(&vector_length, 1, MPI_INTEGER, root, MPI_COMM_WORLD); + MPI_Bcast(&iterations, 1, MPI_INTEGER, root, MPI_COMM_WORLD); + MPI_Bcast(&btype, 1, MPI_INTEGER, root, MPI_COMM_WORLD); + + vector = malloc(vector_length*2*sizeof(int)); + if (!vector) { + printf("ERROR: rank %d failed to allocate space for vector\n", my_ID); + error = 1; + } + bail_out(error); + + index = vector + vector_length; + + /* initialize the array with entries with varying signs */ + for (i=0; i0) vector[i] -= 2*vector[i]; + else vector[i] -= 2*aux; + } + #pragma vector always + for (i=0; i0) vector[i] -= 2*vector[i]; + else vector[i] -= 2*aux; + } + } + break; + + case VECTOR_GO: + for (iter=0; iter0) vector[i] -= 2*vector[i]; + else vector[i] -= 2*aux; + } + #pragma vector always + for (i=0; i0) vector[i] -= 2*vector[i]; + else vector[i] -= 2*aux; + } + } + break; + + case NO_VECTOR: + for (iter=0; iter0) vector[i] -= 2*vector[index[i]]; + else vector[i] -= 2*aux; + } + #pragma vector always + for (i=0; i0) vector[i] -= 2*vector[index[i]]; + else vector[i] -= 2*aux; + } + } + break; + + case INS_HEAVY: + fill_vec(vector, vector_length, iterations, WITH_BRANCHES, &nfunc, &rank); + } + + branch_time = wtime() - branch_time; + + if (btype == INS_HEAVY && my_ID==root) { + printf("Number of matrix functions = %d\n", nfunc); + printf("Matrix order = %d\n", rank); + } + + /* do the whole thing once more, but now without branches */ + + MPI_Barrier(MPI_COMM_WORLD); + no_branch_time = wtime(); + + /* do actual branching */ + + switch (btype) { + + case VECTOR_STOP: + case VECTOR_GO: + for (iter=0; iter \"" + exit +fi + +n=$1 +nfunc=$2 +PID=$$ +NAME=___func.c$PID + +if [ $n -lt 1 ]; then + echo "ERROR: Invalid matrix size $n" + exit +fi +if [ $nfunc -lt 1 ]; then + echo "ERROR: Invalid number of functions $nfunc" + exit +fi + +echo "Generating $nfunc functions with matrix order $n" + +# empty the file func.c +cp /dev/null func.c + +# insert the right header file +echo "#include " >> func.c +#create some global read-only arrays +echo "static int one[$n], zero[$n];" >> func.c + +#write prototype matrix function +echo "int funcVERSION(int index, int a[$n][$n], int b[$n][$n]){" > $NAME +echo " int i, j, x1, x2, x3, error=0;" >> $NAME +echo >> $NAME + +j=0 +while [ $j -lt $n ]; do + i=0 + while [ $i -lt $n ]; do + echo " x1 = `expr \( \( $i + $j \) \* 48611 \) % 8389` + index;" >> $NAME + echo " x2 = `expr \( \( $i + 17 + 19 \* $j \) \* 29443 \) % 77029`;" >> $NAME + echo " x3 = (x1 + (VERSION+1)*x2) % $n;" >> $NAME + echo " x1 += (x2 - x3 + $n ) % $n;" >> $NAME + echo " x2 += (x1 - 5*x3 + 7 * $n ) % $n;" >> $NAME + echo " x3 = (x1 + 4*x2) % $n;" >> $NAME + if [ $i -ne $j ]; then + echo " a[$j][$i] = zero[x3];" >> $NAME + else + echo " a[$j][$i] = one[x3];" >> $NAME + fi + echo >> $NAME + i=`expr $i + 1` + done + j=`expr $j + 1` +done + +echo " for (j=0; j<$n; j++) for (i=0; i<$n; i++)" >> $NAME +echo " b[j][i] = (a[i][j]+a[j][i])/2;" >> $NAME +echo " for (j=0; j<$n; j++) for (i=0; i<$n; i++)" >> $NAME +echo " if (i != j) error += ABS(b[j][i]);" >> $NAME +echo " for (i=0; i<$n; i++) error += ABS(1-b[i][i]);" >> $NAME + +echo " if (error) return(0);" >> $NAME +echo " else return(index);" >> $NAME +echo "}" >> $NAME +echo >> $NAME + +#write the list of matrix functions; do odd/even scrambling to kill unit instruction stride +v=0 +half=`expr \( $nfunc + 1 \) / 2` +while [ $v -lt $nfunc ]; do + v2=`expr $half \* \( $v % 2 \) + $v / 2` + cat $NAME | sed "s/VERSION/$v2/" >> func.c + v=`expr $v + 1` +done + +#remove prototype matrix function +rm -f $NAME + + +echo "int fill_vec(int *vector, int length, int iterations, int branch, " >> func.c +echo " int *nfunc, int *rank) {" >> func.c + +echo " static int a[$n][$n], b[$n][$n];" >> func.c +echo " int aux, aux2, i, iter;" >> func.c + +echo " /* return generator values to calling program */" >> func.c +echo " *nfunc = $nfunc;" >> func.c +echo " *rank = $n;" >> func.c +echo >> func.c +echo " if (!branch)" >> func.c +echo " for (iter=0; iter> func.c +echo " for (i=0; i> func.c +echo " aux2 = -(3-(func0(i,a,b)&7));" >> func.c +echo " vector[i] -= (vector[i]+aux2);" >> func.c +echo " }" >> func.c +echo " for (i=0; i> func.c +echo " aux2 = (3-(func0(i,a,b)&7));" >> func.c +echo " vector[i] -= (vector[i]+aux2);" >> func.c +echo " }" >> func.c +echo " }" >> func.c +echo " else {" >> func.c +echo " for (i=0; i<$n; i++) {" >> func.c +echo " zero[i] = 0; one[i] = 1;" >> func.c +echo " }" >> func.c +echo " for (iter=0; iter> func.c +echo " for (i=0; i> func.c +echo " aux = i%$nfunc;" >> func.c +echo " switch(aux) {" >> func.c +v=0 +while [ $v -lt $nfunc ]; do + echo " case $v: aux2 = -(3-(func$v(i,a,b)&7));" >> func.c + echo " vector[i] -= (vector[i]+aux2);" >> func.c + echo " break;" >> func.c + v=`expr $v + 1` +done +echo " default: vector[i] = 0;" >> func.c +echo " }" >> func.c +echo " }" >> func.c +echo " for (i=0; i> func.c +echo " aux = i%$nfunc;" >> func.c +echo " switch(aux) {" >> func.c +v=0 +while [ $v -lt $nfunc ]; do + echo " case $v: aux2 = (3-(func$v(i,a,b)&7));" >> func.c + echo " vector[i] -= (vector[i]+aux2);" >> func.c + echo " break;" >> func.c + v=`expr $v + 1` +done +echo " default: vector[i] = 0;" >> func.c +echo " }" >> func.c +echo " }" >> func.c +echo " }" >> func.c +echo " }" >> func.c +echo " return(0);" >> func.c +echo "}" >> func.c + diff --git a/tests/apps/prk/tests/MPI/DGEMM/Makefile.ohpc b/tests/apps/prk/tests/MPI/DGEMM/Makefile.ohpc new file mode 100644 index 0000000000..39cbc9d1ed --- /dev/null +++ b/tests/apps/prk/tests/MPI/DGEMM/Makefile.ohpc @@ -0,0 +1,33 @@ +include ../../common/MPI.defs + +##### User configurable options ##### + +OPTFLAGS = $(DEFAULT_OPT_FLAGS) +#description: change above into something that is a decent optimization on you system + +#uncomment any of the following flags (and change values) to change defaults + +#OFFSETFLAG = -DBOFFSET=0 +#description: set this flag to some value to override default first array +# dimension padding (12) of tiles used inside dgemm + +#DEBUGFLAG = -DVERBOSE +#description: default diagnostic style is silent + +USERFLAGS = +#description: parameter to specify optional flags + +#set the following variables for custom libraries and/or other objects +EXTOBJS = +LIBS = -lm +LIBPATHS = +INCLUDEPATHS = + +### End User configurable options ### + +TUNEFLAGS = $(DEBUGFLAG) $(OFFSETFLAG) $(USERFLAGS) + +PROGRAM = dgemm +OBJS = $(PROGRAM).o $(COMOBJS) + +include ../../common/make.common diff --git a/tests/apps/prk/tests/MPI/DGEMM/dgemm.c b/tests/apps/prk/tests/MPI/DGEMM/dgemm.c new file mode 100755 index 0000000000..397a405034 --- /dev/null +++ b/tests/apps/prk/tests/MPI/DGEMM/dgemm.c @@ -0,0 +1,489 @@ +/* +Copyright (c) 2013, Intel Corporation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. +* Neither the name of Intel Corporation nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +*/ + +/********************************************************************************* + +NAME: dgemm + +PURPOSE: This program tests the efficiency with which a dense matrix + dense multiplication is carried out + +USAGE: The program takes as input the matrix order, the number of times + the matrix-matrix multiplication is carried out, the outer level + block size, and a flag determining whether to use square tiles + for the local dgemm. + + <# iterations> [] + + The output consists of diagnostics to make sure the + algorithm worked, and of timing statistics. + +FUNCTIONS CALLED: + + Other than OpenMP or standard C functions, the following + functions are used in this program: + + wtime() + bail_out() + +NOTES: Derived frmo SUMMA implementation provided by Robert Van de Geijn, + U. Texas at Austion. + Algorithm first published by Elmroth, Gustavson, Jonsson & Kagstrom + +HISTORY: Written by Rob Van der Wijngaart, December 2007 + +***********************************************************************************/ + +#include "par-res-kern_general.h" +#include "par-res-kern_mpi.h" + +#define A(i,j) (a[(j)*lda+i]) +#define B(i,j) (b[(j)*ldb+i]) +#define C(i,j) (c[(j)*ldc+i]) +#ifndef BOFFSET + #define BOFFSET 12 +#endif +#define AA(i,j) (aa[(j)*ldaa+i]) +#define BB(i,j) (bb[(j)*ldbb+i]) +#define CC(i,j) (cc[(j)*ldcc+i]) + +#define epsilon 0.00001 + +void RING_Bcast(double *, int, MPI_Datatype, int, MPI_Comm); +void dlacpy(int, int, double *, int, double *, int); +void dgemm_local(int, int, int, double *, int, double *, int, + double *, int, int, int); +void dgemm(int, int, int, double *, int, double *, int, double *, int, + int *, int *, MPI_Comm, MPI_Comm, double *, double *); + + +int main(int argc, char *argv[]) +{ + int my_ID, myrow, mycol, /* my index and row and column index */ + root=0, /* ID of root rank */ + Num_procs, /* number of ranks */ + nprow, npcol, /* row, column dimensions of rank grid */ + order, /* matrix order */ + mynrows, myfrow, /* my number of rows and index of first row*/ + mylrow, /* and last row */ + myncols, myfcol, /* my number of cols and index of first row*/ + mylcol, /* and last row */ + *mm, /* arrays that hold m_i's and n_j's */ + *nn, + nb, /* block factor for SUMMA */ + inner_block_flag, /* flag to select local DGEMM blocking */ + error=0, /* error flag */ + *ranks, /* work array for row and column ranks */ + lda, ldb, ldc, /* leading array dimensions of a, b, and c */ + i, j, ii, jj, /* dummy variables */ + iter, iterations; + double *a, *b, *c, /* arrays that hold local a, b, c */ + *work1, *work2, /* work arrays to pass to dpmmmult */ + local_dgemm_time, /* timing parameters */ + dgemm_time, + avgtime; + double + forder, nflops, /* float matrix order + total flops */ + checksum, /* array checksum for verification test */ + checksum_local=0.0, + ref_checksum; /* reference checkcum for verification */ + MPI_Group world_group, + temp_group; + MPI_Comm comm_row, /* communicators for row and column ranks */ + comm_col; /* of rank grid */ + + /* initialize */ + MPI_Init(&argc,&argv); + MPI_Comm_rank( MPI_COMM_WORLD, &my_ID ); + MPI_Comm_size( MPI_COMM_WORLD, &Num_procs ); + +/********************************************************************* +** process, test and broadcast input parameters +*********************************************************************/ + + if (my_ID == root) { + if (argc != 5) { + printf("Usage: %s <# iterations> ", + *argv); + printf("\n"); + error = 1; + goto ENDOFTESTS; + } + + iterations = atoi(*++argv); + if(iterations < 1){ + printf("ERROR: iterations must be positive: %d \n",iterations); + error = 1; + goto ENDOFTESTS; + } + + order = atoi(*++argv); + if (order < Num_procs) { + printf("ERROR: matrix order too small: %d\n", order); + error = 1; + goto ENDOFTESTS; + } + + nb = atoi(*++argv); + /* a non-positive tile size means no outer level tiling */ + + inner_block_flag = atoi(*++argv); + + ENDOFTESTS:; + } + bail_out(error); + + MPI_Bcast(&order, 1, MPI_INT, root, MPI_COMM_WORLD); + MPI_Bcast(&iterations, 1, MPI_INT, root, MPI_COMM_WORLD); + MPI_Bcast(&nb, 1, MPI_INT, root, MPI_COMM_WORLD); + MPI_Bcast(&inner_block_flag, 1, MPI_INT, root, MPI_COMM_WORLD); + + /* compute rank grid to most closely match a square; to do so, + compute largest divisor of Num_procs, using hare-brained method. + The small term epsilon is used to guard against roundoff errors + in case Num_procs is a perfect square */ + nprow = (int) (sqrt((double) Num_procs + epsilon)); + while (Num_procs%nprow) nprow--; + npcol = Num_procs/nprow; + + if (my_ID == root) { + printf("MPI Dense matrix-matrix multiplication: C = A x B\n"); + printf("Number of ranks = %d\n", Num_procs); + printf("Rank grid = %d rows x %d columns\n", nprow, npcol); + printf("Matrix order = %d\n", order); + printf("Outer block size = %d\n", nb); + printf("Number of iterations = %d\n", iterations); + if (inner_block_flag) + printf("Using local dgemm blocking\n"); + else + printf("No local dgemm blocking\n"); + } + + /* set up row and column communicators */ + + ranks = (int *) malloc (3*Num_procs*sizeof(int)); + if (!ranks) { + printf("ERROR: Proc %d could not allocate rank work arrays\n", + my_ID); + error = 1; + } + bail_out(error); + mm = ranks + Num_procs; + nn = mm + Num_procs; + + /* 1. extract group of ranks that make up WORLD */ + MPI_Comm_group( MPI_COMM_WORLD, &world_group ); + + /* 2. create list of all ranks in same row of rank grid */ + ranks[0] = my_ID/npcol * npcol; + for (i=1; i epsilon) { + printf("ERROR: Checksum = %lf, Reference checksum = %lf\n", + checksum, ref_checksum); + error = 1; + } + else { + printf("Solution validates\n"); +#ifdef VERBOSE + printf("Reference checksum = %lf, checksum = %lf\n", + ref_checksum, checksum); +#endif + } + } + bail_out(error); + + /* report elapsed time */ + nflops = 2.0*forder*forder*forder; + if ( my_ID == root ) { + avgtime = dgemm_time/iterations; + printf("Rate (MFlops/s): %lf Avg time (s): %lf\n", + 1.0E-06 * nflops/avgtime, avgtime); + } + + MPI_Finalize(); +} + +void dgemm(k, nb, inner_block_flag, a, lda, b, ldb, c, ldc, mm, nn, + comm_row, comm_col, work1, work2 ) +int k, /* global matrix dimensions */ + nb, /* panel width */ + inner_block_flag,/* determines local dgemm blocking */ + mm[], nn[], /* dimensions of blocks of A, B, C */ + lda, ldb, ldc; /* leading dimension of local arrays that + hold local portions of matrices A, B, C */ +double *a, *b, *c, /* arrays that hold local parts of A, B, C */ + *work1, *work2; /* work arrays */ +MPI_Comm comm_row, /* Communicator for this row of nodes */ + comm_col; /* Communicator for this column of nodes */ +{ + int myrow, mycol, /* my row and column index */ + nprow, npcol, /* number of node rows and columns */ + i, j, kk, updt, /* misc. index variables */ + currow, curcol, /* index of row and column that hold current + row and column, resp., for rank-1 update*/ + ii, jj; /* local index (on currow and curcol, resp.) + of row and column for rank-updt update */ + int my_ID; + + /* get row, column, and global MPI rank */ + MPI_Comm_rank(comm_row, &mycol); + MPI_Comm_rank(comm_col, &myrow); + MPI_Comm_rank(MPI_COMM_WORLD, &my_ID); + + /* This routine does a rank "updt" update of the matrix block + owned by the calling rank. This requires updt whole columns + of A and updt whole rows of B. The value of updt is determined + as the minimum of 1. the maximum number of remaining columns + of A and 2. the maximum number of remaining rows of B, + respectively, that can be gathered from the current row and column + of the rank grid, with an overall maximum of the block factor nb. + We keep track of how many matrix columns and rows of the current + rank grid row and column have been visited through the + indices ii and jj. When a certain rank grid row or column + has been exhausted, we move to the next row or column (increment + currow or curcol) and reset ii or jj to zero */ + + currow = curcol = ii = jj = 0; + updt = nb; + + for ( kk=0; kk=nn[curcol]) {curcol++; jj = 0;}; + if (ii>=mm[currow]) {currow++; ii = 0;}; + } +} + +void dgemm_local(int M, int N, int K, double *a, int lda, double *b, + int ldb, double *c, int ldc, int nb, int inner_block_flag) { + + int m, n, k, mg, ng, kg, mm, nn, kk, ldaa, ldbb, ldcc; + double *aa, *bb, *cc; + + if (nb >= MAX(M,MAX(N,K)) || !inner_block_flag) { + for (m=0; m <# iterations> + + The output consists of diagnostics to make sure the + algorithm worked, and of timing statistics. + +FUNCTIONS CALLED: + + Other than MPI or standard C functions, the following + external functions are used in this program: + + wtime() + bail_out() + checkTRIADresults() + +NOTES: Bandwidth is determined as the number of words read, plus the + number of words written, times the size of the words, divided + by the execution time. For a vector length of N, the total + number of words read and written is 4*N*sizeof(double). + +HISTORY: This code is loosely based on the Stream benchmark by John + McCalpin, but does not follow all the Stream rules. Hence, + reported results should not be associated with Stream in + external publications +REVISION: Modified by Rob Van der Wijngaart, December 2005, to + parameterize vector size and offsets through compiler flags. + Also removed all Stream cases except TRIAD. +REVISION: Modified by Rob Van der Wijngaart, March 2006, to handle MPI. +REVISION: Modified by Rob Van der Wijngaart, May 2006, to introduce + dependence between successive triad operations. This is + necessary to avoid dead code elimination +REVISION: Modified by Rob Van der Wijngaart, November 2014, replaced + timing of individual loop iterations with timing of overall + loop; also replaced separate loop establishing dependence + between iterations (must now be included in timing) with + accumulation: a[] += b[] + scalar*c[] +**********************************************************************/ + +#include +#include + +#define SCALAR 3.0 + +static int checkTRIADresults(int, long int, double *); + +int main(int argc, char **argv) +{ + long int j, iter; /* dummies */ + double scalar; /* constant used in Triad operation */ + int iterations; /* number of times vector loop gets repeated */ + long int length, /* vector length per rank */ + total_length, /* total vector length */ + offset; /* offset between vectors a and b, and b and c */ + double bytes; /* memory IO size */ + size_t space; /* memory used for a single vector */ + double local_nstream_time,/* timing parameters */ + nstream_time, + avgtime; + int Num_procs, /* number of ranks */ + my_ID, /* rank */ + root=0; /* ID of master rank */ + int error=0; /* error flag for individual rank */ + double * RESTRICT a; /* main vector */ + double * RESTRICT b; /* main vector */ + double * RESTRICT c; /* main vector */ + +/********************************************************************************** +* process and test input parameters +***********************************************************************************/ + + MPI_Init(&argc,&argv); + MPI_Comm_size(MPI_COMM_WORLD,&Num_procs); + MPI_Comm_rank(MPI_COMM_WORLD,&my_ID); + + if (my_ID == root) { + if (argc != 4){ + printf("Usage: %s <# iterations> \n", *argv); + error = 1; + goto ENDOFTESTS; + } + + iterations = atoi(*++argv); + if (iterations < 1) { + printf("ERROR: Invalid number of iterations: %d\n", iterations); + error = 1; + goto ENDOFTESTS; + } + + total_length = atol(*++argv); + if (total_length < Num_procs) { + printf("ERROR: Invalid vector length: %ld\n", total_length); + error = 1; + goto ENDOFTESTS; + } + else length = total_length/Num_procs; + + offset = atol(*++argv); + if (offset < 0) { + printf("ERROR: Invalid array offset: %ld\n", offset); + error = 1; + goto ENDOFTESTS; + } + + ENDOFTESTS:; + } + bail_out(error); + + /* broadcast initialization data */ + MPI_Bcast(&length,1, MPI_LONG, root, MPI_COMM_WORLD); + MPI_Bcast(&offset,1, MPI_LONG, root, MPI_COMM_WORLD); + MPI_Bcast(&iterations,1, MPI_INT, root, MPI_COMM_WORLD); + + space = (3*length + 2*offset)*sizeof(double); + a = (double *) malloc(space); + if (!a && my_ID == root) { + printf("ERROR: Could not allocate %ld bytes for vectors\n", (long int)space); + error = 1; + } + bail_out(error); + + b = a + length + offset; + c = b + length + offset; + + bytes = 4.0 * sizeof(double) * length * Num_procs; + + if (my_ID == root) { + printf("MPI stream triad: A = B + scalar*C\n"); + printf("Number of ranks = %d\n", Num_procs); + printf("Vector length = %ld\n", total_length); + printf("Offset = %ld\n", offset); + printf("Number of iterations = %d\n", iterations); + } + + #pragma vector always + for (j=0; j epsilon) { + printf ("Failed Validation on output array\n"); +#ifndef VERBOSE + printf (" Expected checksum: %f \n",aj); + printf (" Observed checksum: %f \n",asum); +#endif + return (0); + } + else { + printf ("Solution validates\n"); + return (1); + } +} + diff --git a/tests/apps/prk/tests/MPI/Random/Makefile.ohpc b/tests/apps/prk/tests/MPI/Random/Makefile.ohpc new file mode 100644 index 0000000000..7184b77f2d --- /dev/null +++ b/tests/apps/prk/tests/MPI/Random/Makefile.ohpc @@ -0,0 +1,37 @@ +include ../../common/MPI.defs + +##### User configurable options ##### + +OPTFLAGS = $(DEFAULT_OPT_FLAGS) +#description: change above into something that is a decent optimization on you system + +#uncomment any of the following flags (and change values) to change defaults + +#VECTORFLAG = -DLOOKAHEAD=2048 +#description: Default value for LOOKAHEAD is 1024 (HPCC compliant) + +#RESTRICTFLAG = -DRESTRICT_KEYWORD +#description: the "restrict" keyword can be used on IA platforms to disambiguate +# data accessed through pointers + +#LONG64FLAG = -DLONG_IS_64BITS +#description: can use "long" for 64 bit integers instead of "long long" + +#DEBUGFLAG = -DVERBOSE +#description: default diagnostic style is silent + +USERFLAGS = +#description: parameter to specify optional flags + +EXTOBJS = +LIBS = +LIBPATHS = +INCLUDEPATHS = + +### End User configurable options ### + +TUNEFLAGS = $(RESTRICTFLAG) $(LONG64FLAG) $(DEBUGFLAG) $(USERFLAGS) $(VECTORFLAG) +PROGRAM = random +OBJS = $(PROGRAM).o $(COMOBJS) + +include ../../common/make.common diff --git a/tests/apps/prk/tests/MPI/Random/random.c b/tests/apps/prk/tests/MPI/Random/random.c new file mode 100644 index 0000000000..1ad131f62a --- /dev/null +++ b/tests/apps/prk/tests/MPI/Random/random.c @@ -0,0 +1,515 @@ +/* +Copyright (c) 2013, Intel Corporation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. +* Neither the name of Intel Corporation nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +*/ +/************************************************************* +Copyright (c) 2013 The University of Tennessee. All rights reserved. +Redistribution and use in source and binary forms, with or +without modification, are permitted provided that the following +conditions are met: + +- Redistributions of source code must retain the + above copyright notice, this list of conditions and + the following disclaimer. + +- Redistributions in binary form must reproduce the + above copyright notice, this list of conditions and + the following disclaimer listed in this license in the + documentation and/or other materials provided with the + distribution. + +- Neither the name of the copyright holders nor the names + of its contributors may be used to endorse or promote + products derived from this software without specific + prior written permission. + +This software is provided by the copyright holders and +contributors "as is" and any express or implied warranties, +including, but not limited to, the implied warranties of +merchantability and fitness for a particular purpose are +disclaimed. in no event shall the copyright owner or +contributors be liable for any direct, indirect, incidental, +special, exemplary, or consequential damages (including, but +not limited to, procurement of substitute goods or services; +loss of use, data, or profits; or business interruption) +however caused and on any theory of liability, whether in +contract, strict liability, or tort (including negligence or +otherwise) arising in any way out of the use of this software, +even if advised of the possibility of such damage. + +*************************************************************/ +/******************************************************************* + +NAME: RandomAccess + +PURPOSE: This program tests the efficiency of the memory subsystem to + update elements of a distributed array with irregular stride. + +USAGE: The program takes as input the 2log of the size of the table that + gets updated and the ratio of table size over number of updates. + The table is distributed evenly over all participating ranks. + The code can be vectorized, in principle, with a vector length + that is automatically set to the size of the LOOKAHEAD parameter. + + <#update ratio> + +FUNCTIONS CALLED: + + Other than MPI or standard C functions, the following + functions are used in this program: + + wtime + bail_out() + PRK_starts + poweroftwo + +NOTES: This program is derived from HPC Challenge Random Access. The random + number generator computes successive powers of 0x2, modulo the + primitive polynomial x^63+x^2+x+1. The principal differences between + this code and the HPCC version are: + - we start the stream of random numbers not with seed 0x1, but the + SEQSEED-th element in the stream of powers of 0x2. + - the timed code applies the RandomAccess operator twice to the table of + computed resuls (starting with the same seed(s) for "ran" in both + iterations. The second pass makes sure that any update to any table + element that sets high-order bits in the first pass resets those bits + to zero. + - the verification test now simply constitutes checking whether table + element j equals j. + + The program uses aggragation to reduce latency costs. The parameter + LOOKAHEAD determines how many random numbers are generated by each + process before they are sent to the ranks that are responsible for + updating the corresponding table elements. LOOKAHEAD also determines the + (potential) level of vectorization (independent streams) of the code. + + We note that the vectorized version of this code (i.e. LOOKAHEAD unequal + to 1), does not feature exactly the same sequence of accesses and + intermediate update values in the table as the scalar version. The + reason for this is twofold. + 1. the elements in the stream of powers of 0x2 that get computed outside + the main timed loop as seeds for independent streams in the vectorized + version, using the jump-ahead function PRK_starts, are computed inside + the timed loop for the scalar version. However, since both versions do + the same number of timed random accesses, the vectorized version must + progress further in the sequence of powers of 0x2. + 2. The independent streams of powers of 0x2 computed in the vectorized + version can (and will) cause updates of the same elements of the table + in an order that is not consistent with the scalar version. That is, + distinct values of "ran" can refer to the same table element + "ran&(tablesize-1)," but the operation + Table[ran&(tablesize-1)] ^= ran will deposit different values in that + table element for different values of ran. At the end of each pass over + the data set, the table will contain the same values in the vector and + scalar version (ignoring the small differences caused by 1.) because of + commutativity of the XOR operator. If the update operator had been + non-commutative, the vector and scalar version would have yielded + different results. + +HISTORY: Written by Rob Van der Wijngaart, December 2007. + +************************************************************************************/ + +#include +#include + +/* Define 64-bit types and corresponding format strings for printf() and constants */ +/* PERIOD = (2^63-1)/7 = 7*73*127*337*92737*649657 */ +#ifdef LONG_IS_64BITS + #define POLY 0x0000000000000007UL + #define PERIOD 1317624576693539401L + /* sequence number in series of random numbers to be used as initial value */ + #define SEQSEED 834568137686317453L +#else + #define POLY 0x0000000000000007ULL + #define PERIOD 1317624576693539401LL + /* sequence number in series of random numbers to be used as initial value */ + #define SEQSEED 834568137686317453LL +#endif + +#ifndef LOOKAHEAD +#define LOOKAHEAD 1024 +#endif + +static u64Int PRK_starts(s64Int); +static int poweroftwo(int); + +int main(int argc, char **argv) { + + int update_ratio;/* multiplier of tablesize for # updates */ + int nstarts; /* vector length */ + s64Int i, j, round, oldsize, index, global_index; /* dummies */ + int proc, dest; /* dummies */ + s64Int tablesize; /* aggregate table size (all ranks) */ + s64Int loctablesize;/* local table size (each rank) */ + s64Int nupdate; /* number of updates per rank */ + s64Int tablespace; /* bytes per rank required for table */ + u64Int *ran; /* vector of random numbers */ + u64Int **ranSendBucket; /* send list of buckets of random numbers */ + u64Int **ranRecvBucket; /* receive list of buckets of random numbers */ + int *sizeSendBucket; /* list of send bucket sizes */ + int *sizeRecvBucket; /* list of receive buffer sizes */ + int sizeRecvTotal;/* total number of elements in receive buffer */ + int *senddispls; /* successive displacements in send buffer */ + int *recvdispls; /* successive dispalcemetns in receive buffer */ + u64Int * RESTRICT Table; /* (pseudo-)randomly accessed array */ + double random_time, /* timing parameters */ + avgtime = 0.0; + int Num_procs, /* rank parameters */ + my_ID, /* rank of calling rank */ + root=0; /* ID of master rank */ + s64Int error=0; /* error flag for individual rank */ + s64Int tot_error; /* error flag for all rankes combined */ + int log2nproc; /* log2 of # rankes */ + int log2nstarts; /* log2 of vector length */ + int log2tablesize; /* log2 of aggregate table size */ + int log2update_ratio; /* log2 of update ratio */ + +#ifdef LONG_IS_64BITS + if (sizeof(long) != 8) { + printf("ERROR: Makefile says \"long\" is 8 bytes, but it is %d bytes\n", + sizeof(long)); + exit(EXIT_FAILURE); + } +#endif + +/*********************************************************************************** +** rank and test input parameters +************************************************************************************/ + + MPI_Init(&argc,&argv); + MPI_Comm_size(MPI_COMM_WORLD,&Num_procs); + MPI_Comm_rank(MPI_COMM_WORLD,&my_ID); + + if (my_ID == root) { + if (argc != 3){ + printf("Usage: %s <#update ratio>\n", *argv); + error = 1; + goto ENDOFTESTS; + } + + /* test whether number of rankes is a power of two */ + log2nproc = poweroftwo(Num_procs); + if (log2nproc <0) { + printf("ERROR: Invalid number of ranks: %d, must be a power of 2\n", + Num_procs); + error = 1; + goto ENDOFTESTS; + } + + log2tablesize = atoi(*++argv); + if (log2tablesize < 1){ + printf("ERROR: Log2 tablesize is %d; must be >= 1\n",log2tablesize); + error = 1; + goto ENDOFTESTS; + } + + update_ratio = atoi(*++argv); + /* test whether update ratio is a power of two */ + log2update_ratio = poweroftwo(update_ratio); + if (log2update_ratio <0) { + printf("ERROR: Invalid update ratio: %d, must be a power of 2\n", + update_ratio); + error = 1; + goto ENDOFTESTS; + } + + /* for simplicity we set the vector length equal to the LOOKAHEAD size */ + nstarts = LOOKAHEAD; + + /* test whether vector length is a power of two */ + log2nstarts = poweroftwo(nstarts); + if (log2nstarts <0) { + printf("ERROR: Invalid vector length: %d, must be a power of 2\n", + nstarts); + error = 1; + goto ENDOFTESTS; + } + + /* compute (local) table size carefully to make sure it can be represented */ + loctablesize = 1; + for (i=0; i>(log2tablesize-log2nproc); + /* place new random number in first available element of the appropriate + send bucket and increment that bucket size */ + ranSendBucket[dest][sizeSendBucket[dest]++] = ran[j]; + } + + /* let all other rankes know how many indices to expect */ + MPI_Alltoall(sizeSendBucket, 1, MPI_INTEGER, + sizeRecvBucket, 1, MPI_INTEGER, MPI_COMM_WORLD); + + /* compute receive buffer offsets so that received data is contiguous */ + for (proc=1; proc PERIOD) n -= PERIOD; + if (n == 0) return 0x1; + + temp = 0x1; + for (i=0; i<64; i++) { + m2[i] = temp; + temp = (temp << 1) ^ ((s64Int) temp < 0 ? POLY : 0); + temp = (temp << 1) ^ ((s64Int) temp < 0 ? POLY : 0); + } + + for (i=62; i>=0; i--) + if ((n >> i) & 1) + break; + + ran = 0x2; + while (i > 0) { + temp = 0; + for (j=0; j<64; j++) + if ((unsigned int)((ran >> j) & 1)) + temp ^= m2[j]; + ran = temp; + i -= 1; + if ((n >> i) & 1) + ran = (ran << 1) ^ ((s64Int) ran < 0 ? POLY : 0); + } + + return ran; +} + +/* utility routine that tests whether an integer is a power of two */ +int poweroftwo(int n) { + int log2n = 0; + + while ((1< <# iterations> + + The output consists of diagnostics to make sure the + algorithm worked, and of timing statistics. + +FUNCTIONS CALLED: + + Other than MPI or standard C functions, the following external + functions are used in this program: + + wtime(); + bail_out(); + +HISTORY: Written by Rob Van der Wijngaart, March 2006. + Modified by Rob Van der Wijngaart, November 2014 + - added dependence between successive reductions + - improved timing + - changed initialization values + +*******************************************************************/ + +#include +#include + + +int main(int argc, char ** argv) +{ + int Num_procs; /* Number of ranks */ + int my_ID; /* Rank */ + int root=0; + int iterations; /* number of times the reduction is carried out */ + int i, iter; /* dummies */ + long vector_length; /* length of the vectors to be aggregated */ + double * RESTRICT vector; /* vector to be reduced */ + double * RESTRICT ones; /* constant vector */ + double local_reduce_time, /* timing parameters */ + reduce_time, + avgtime; + double epsilon=1.e-8; /* error tolerance */ + double element_value; /* verification value */ + int error = 0; /* error flag */ + + /*************************************************************************** + ** Initialize the MPI environment + ****************************************************************************/ + MPI_Init(&argc,&argv); + MPI_Comm_rank(MPI_COMM_WORLD, &my_ID); + MPI_Comm_size(MPI_COMM_WORLD, &Num_procs); + + /*************************************************************************** + ** process, test and broadcast input parameters + ****************************************************************************/ + + if (my_ID == root){ + if (argc != 3){ + printf("Usage: %s <# iterations> \n", *argv); + error = 1; + goto ENDOFTESTS; + } + + iterations = atoi(*++argv); + if (iterations < 1) { + printf("ERROR: Iterations must be positive: %d\n", iterations); + error = 1; + goto ENDOFTESTS; + } + + vector_length = atol(*++argv); + if (vector_length < 1) { + printf("ERROR: Vector length should be positive: %ld\n", vector_length); + error = 1; + goto ENDOFTESTS; + } + + ENDOFTESTS:; + } + bail_out(error); + + + if (my_ID == root) { + printf("MPI vector reduction\n"); + printf("Number of ranks = %d\n", Num_procs); + printf("Vector length = %ld\n", vector_length); + printf("Number of iterations = %d\n", iterations); + } + + /* Broadcast benchmark data to all ranks */ + MPI_Bcast(&iterations, 1, MPI_INT, root, MPI_COMM_WORLD); + MPI_Bcast(&vector_length, 1, MPI_LONG, root, MPI_COMM_WORLD); + vector= (double *) malloc(2*vector_length*sizeof(double)); + if (vector==NULL) { + printf("ERROR: Could not allocate space %ld for vector in rank %d\n", + 2*vector_length*sizeof(double),my_ID); + error = 1; + } + bail_out(error); + ones = vector + vector_length; + + /* initialize the arrays */ + for (i=0; i= epsilon) { + error = 1; +#ifdef VERBOSE + printf("ERROR at i=%d; value: %lf; reference value: %lf\n", + i, vector[i], element_value); +#else + printf("First error at i=%d; value: %lf; reference value: %lf\n", + i, vector[i], element_value); + break; +#endif + } + } + } + bail_out(error); + + if (my_ID == root) { + printf("Solution validates\n"); +#ifdef VERBOSE + printf("Element verification value: %lf\n", element_value); +#endif + avgtime = reduce_time/(double)iterations; + printf("Rate (MFlops/s): %lf Avg time (s): %lf\n", + 1.0E-06 * (2.0*Num_procs-1.0)*vector_length/ avgtime, avgtime); + } + + MPI_Finalize(); + exit(EXIT_SUCCESS); + +} /* end of main */ + diff --git a/tests/apps/prk/tests/MPI/Sparse/Makefile.ohpc b/tests/apps/prk/tests/MPI/Sparse/Makefile.ohpc new file mode 100644 index 0000000000..f23d72945d --- /dev/null +++ b/tests/apps/prk/tests/MPI/Sparse/Makefile.ohpc @@ -0,0 +1,37 @@ +include ../../common/MPI.defs + +##### User configurable options ##### + +OPTFLAGS = $(DEFAULT_OPT_FLAGS) +#description: change above into something that is a decent optimization on you system + +#uncomment any of the following flags (and change values) to change defaults + +#DENSEFLAG = -DTESTDENSE +#description: if flag is set, sparse matrix will be embedded in dense matrix + +#RESTRICTFLAG = -DRESTRICT_KEYWORD +#description: the "restrict" keyword can be used on IA platforms to disambiguate +# data accessed through pointers + +#DEBUGFLAG = -DVERBOSE +#description: default diagnostic style is silent + +SCRAMBLEFLAG = -DSCRAMBLE +#description: if flag is set, grid indices are scrambled to produce irregular stride + +USERFLAGS = +#description: parameter to specify optional flags + +EXTOBJS = +LIBS = +LIBPATHS = +INCLUDEPATHS = + +### End User configurable options ### + +TUNEFLAGS = $(DENSEFLAG) $(DEBUGFLAG) $(NTHREADFLAG) $(USERFLAGS) $(SCRAMBLEFLAG) +PROGRAM = sparse +OBJS = $(PROGRAM).o $(COMOBJS) + +include ../../common/make.common diff --git a/tests/apps/prk/tests/MPI/Sparse/README b/tests/apps/prk/tests/MPI/Sparse/README new file mode 100755 index 0000000000..81755fc7db --- /dev/null +++ b/tests/apps/prk/tests/MPI/Sparse/README @@ -0,0 +1,32 @@ +This program constructs a sparse matrix and performs a (parallel) +sparse matrix-vector multiplication. The sparse matrix is built as +follows. The standard star-shaped discretization stencil with a +user-specified radius is applied to a structured 2-dimensional +grid. Example of a stencil with radius r=2: + + 0 + | + 0 + | + 0--0--0--0--0 + | + 0 + | + 0 + +Here, the `0' symbol signifies inclusion in the stencil. A square grid +with linear dimension (2^n) has 2^(2n) = 4^n points. The resulting +matrix has (4^n) rows and (4^n) columns, for a total of (16^n) +elements. The user specifies n. The stencil is applied in a periodic +fashion, i.e. it wraps around the edges of the grid. + +If the scramble flag is unset in the Makefile, the discretization +stencil results in a regularly banded sparse matrix, which can be +stored efficiently in vectors, in principle. If the scramble flag is +maintained, the columns of the matrix are permuted, resulting in a +general irregular sparse matrix, but with a known number of nonzeroes +per row (4r+1). We use Compressed Row Storage for accessing the matrix +elements, even in the case of an unset scramble flag. Numerical values +of matrix elements are chosen judiciously to make verification +easy. They do not correspond to any realistic discretization of a +continuum problem. diff --git a/tests/apps/prk/tests/MPI/Sparse/sparse.c b/tests/apps/prk/tests/MPI/Sparse/sparse.c new file mode 100755 index 0000000000..8644f78804 --- /dev/null +++ b/tests/apps/prk/tests/MPI/Sparse/sparse.c @@ -0,0 +1,441 @@ +/* +Copyright (c) 2013, Intel Corporation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. +* Neither the name of Intel Corporation nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +*/ + +/********************************************************************************* + +NAME: sparse + +PURPOSE: This program tests the efficiency with which a sparse matrix + vector multiplication is carried out + +USAGE: The program takes as input the 2log of the linear size of the 2D grid + (equalling the 2log of the square root of the order of the sparse matrix), + the radius of the difference stencil, and the number of times the + matrix-vector multiplication is carried out. + + <# iterations> <2log root-of-matrix-order> + + The output consists of diagnostics to make sure the + algorithm worked, and of timing statistics. + +FUNCTIONS CALLED: + + Other than MPI or standard C functions, the following + functions are used in this program: + + wtime() + bail_out() + reverse() + qsort() + compare + +NOTES: + +HISTORY: Written by Rob Van der Wijngaart, October 2006. + Updated by RvdW to fix verification bug, February 2013 + Updated by RvdW to sort matrix elements to reflect traditional CSR storage, + August 2013 + +***********************************************************************************/ + +#include +#include + +/* linearize the grid index */ +#define LIN(i,j) (i+((j)< <2log grid size> \n",*argv); + error = 1; + goto ENDOFTESTS; + } + + iterations = atoi(*++argv); + if (iterations < 1){ + printf("ERROR: Iterations must be positive : %d \n", iterations); + error = 1; + goto ENDOFTESTS; + } + + lsize = atoi(*++argv); + if (lsize <0) { + printf("ERROR: Log of grid size must be non-negative: %d\n", + (int) lsize); + error = 1; + goto ENDOFTESTS; + } + lsize2 = 2*lsize; + size = 1< epsilon) { + printf("ERROR: Vector sum = %lf, Reference vector sum = %lf, my_ID = %d\n", + check_sum, reference_sum, my_ID); + error = 1; + } + else { + printf("Solution validates\n"); +#ifdef VERBOSE + printf("Reference sum = %lf, check sum = %lf\n", + reference_sum, check_sum); +#endif + } + avgtime = sparse_time/iterations; + printf("Rate (MFlops/s): %lf Avg time (s): %lf\n", + 1.0E-06 * (2.0*nent*Num_procs)/avgtime, avgtime); + } + + bail_out(error); + + MPI_Finalize(); + exit(EXIT_SUCCESS); +} + +/* Code below reverses bits in unsigned integer stored in a 64-bit word. + Bit reversal is with respect to the largest integer that is going to be + ranked for the particular run of the code, to make sure the reversal + constitutes a true permutation. Hence, the final result needs to be shifted + to the right. + Example: if largest integer being processed is 0x000000ff = 255 = + 0000...0011111111 (binary), then the unshifted reversal of 0x00000006 = 6 = + 0000...0000000110 (binary) would be 011000000...0000 = 3*2^61, which is + outside the range of the original sequence 0-255. Setting shift_in_bits to + 2log(256) = 8, the final result is shifted the the right by 64-8=56 bits, + so we get 000...0001100000 (binary) = 96, which is within the proper range */ +u64Int reverse(register u64Int x, int shift_in_bits){ + x = ((x >> 1) & 0x5555555555555555) | ((x << 1) & 0xaaaaaaaaaaaaaaaa); + x = ((x >> 2) & 0x3333333333333333) | ((x << 2) & 0xcccccccccccccccc); + x = ((x >> 4) & 0x0f0f0f0f0f0f0f0f) | ((x << 4) & 0xf0f0f0f0f0f0f0f0); + x = ((x >> 8) & 0x00ff00ff00ff00ff) | ((x << 8) & 0xff00ff00ff00ff00); + x = ((x >> 16) & 0x0000ffff0000ffff) | ((x << 16) & 0xffff0000ffff0000); + x = ((x >> 32) & 0x00000000ffffffff) | ((x << 32) & 0xffffffff00000000); + return (x>>((sizeof(u64Int)*BITS_IN_BYTE-shift_in_bits))); +} + +int compare(const void *el1, const void *el2) { + s64Int v1 = *(s64Int *)el1; + s64Int v2 = *(s64Int *)el2; + return (v1v2) ? 1 : 0; +} + diff --git a/tests/apps/prk/tests/MPI/Stencil/Makefile.ohpc b/tests/apps/prk/tests/MPI/Stencil/Makefile.ohpc new file mode 100644 index 0000000000..8cbccfc380 --- /dev/null +++ b/tests/apps/prk/tests/MPI/Stencil/Makefile.ohpc @@ -0,0 +1,41 @@ +include ../../common/MPI.defs +##### User configurable options ##### + +OPTFLAGS = $(DEFAULT_OPT_FLAGS) +#description: change above into something that is a decent optimization on you system + +#uncomment any of the following flags (and change values) to change defaults + +#RESTRICTFLAG = -DRESTRICT_KEYWORD +#description: the "restrict" keyword can be used on IA platforms to disambiguate +# data accessed through pointers + +#RADIUSFLAG = -DRADIUS=n +#description: default radius of filter to be applied is 2 + +DOUBLEFLAG = -DDOUBLE +#description: default data type is single precision + +STARFLAG = -DSTAR +#description: default stencil is compact (dense, square) + +#DEBUGFLAG = -DVERBOSE +#description: default diagnostic style is silent + +USERFLAGS = +#description: parameter to specify optional flags + +#set the following variables for custom libraries and/or other objects +EXTOBJS = +LIBS = -lm +LIBPATHS = +INCLUDEPATHS = + +### End User configurable options ### + +TUNEFLAGS = $(RESTRICTFLAG) $(DEBUGFLAG) $(USERFLAGS) \ + $(DOUBLEFLAG) $(RADIUSFLAG) $(STARFLAG) +PROGRAM = stencil +OBJS = $(PROGRAM).o $(COMOBJS) + +include ../../common/make.common diff --git a/tests/apps/prk/tests/MPI/Stencil/stencil.c b/tests/apps/prk/tests/MPI/Stencil/stencil.c new file mode 100644 index 0000000000..fc70b7f6d3 --- /dev/null +++ b/tests/apps/prk/tests/MPI/Stencil/stencil.c @@ -0,0 +1,490 @@ +/* +Copyright (c) 2013, Intel Corporation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. +* Neither the name of Intel Corporation nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +*/ + +/******************************************************************* + +NAME: Stencil + +PURPOSE: This program tests the efficiency with which a space-invariant, + linear, symmetric filter (stencil) can be applied to a square + grid or image. + +USAGE: The program takes as input the linear dimension of the grid, + and the number of iterations on the grid + + <# iterations> + + The output consists of diagnostics to make sure the + algorithm worked, and of timing statistics. + +FUNCTIONS CALLED: + + Other than MPI or standard C functions, the following + functions are used in this program: + + wtime() + bail_out() + +HISTORY: - Written by Rob Van der Wijngaart, November 2006. + - RvdW, August 2013: Removed unrolling pragmas for clarity; + fixed bug in compuation of width of strip assigned to + each rank; + - RvdW, August 2013: added constant to array "in" at end of + each iteration to force refreshing of neighbor data in + parallel versions + - RvdW, October 2014: introduced 2D domain decomposition + - RvdW, October 2014: removed barrier at start of each iteration + - RvdW, October 2014: replaced single rank/single iteration timing + with global timing of all iterations across all ranks + +*********************************************************************************/ + +#include +#include + +#ifndef RADIUS + #define RADIUS 2 +#endif + +#ifdef DOUBLE + #define DTYPE double + #define MPI_DTYPE MPI_DOUBLE + #define EPSILON 1.e-8 + #define COEFX 1.0 + #define COEFY 1.0 + #define FSTR "%lf" +#else + #define DTYPE float + #define MPI_DTYPE MPI_FLOAT + #define EPSILON 0.0001f + #define COEFX 1.0f + #define COEFY 1.0f + #define FSTR "%f" +#endif + +/* define shorthand for indexing multi-dimensional arrays with offsets */ +#define INDEXIN(i,j) (i+RADIUS+(j+RADIUS)*(width+2*RADIUS)) +/* need to add offset of RADIUS to j to account for ghost points */ +#define IN(i,j) in[INDEXIN(i-istart,j-jstart)] +#define INDEXOUT(i,j) (i+(j)*(width)) +#define OUT(i,j) out[INDEXOUT(i-istart,j-jstart)] +#define WEIGHT(ii,jj) weight[ii+RADIUS][jj+RADIUS] + +int main(int argc, char ** argv) { + + int Num_procs; /* number of ranks */ + int Num_procsx, Num_procsy; /* number of ranks in each coord direction */ + int my_ID; /* MPI rank */ + int my_IDx, my_IDy; /* coordinates of rank in rank grid */ + int right_nbr; /* global rank of right neighboring tile */ + int left_nbr; /* global rank of left neighboring tile */ + int top_nbr; /* global rank of top neighboring tile */ + int bottom_nbr; /* global rank of bottom neighboring tile */ + DTYPE *top_buf_out; /* communication buffer */ + DTYPE *top_buf_in; /* " " */ + DTYPE *bottom_buf_out; /* " " */ + DTYPE *bottom_buf_in; /* " " */ + DTYPE *right_buf_out; /* " " */ + DTYPE *right_buf_in; /* " " */ + DTYPE *left_buf_out; /* " " */ + DTYPE *left_buf_in; /* " " */ + int root = 0; + int n, width, height;/* linear global and local grid dimension */ + long nsquare; /* total number of grid points */ + int i, j, ii, jj, kk, it, jt, iter, leftover; /* dummies */ + int istart, iend; /* bounds of grid tile assigned to calling rank */ + int jstart, jend; /* bounds of grid tile assigned to calling rank */ + DTYPE norm, /* L1 norm of solution */ + local_norm, /* contribution of calling rank to L1 norm */ + reference_norm; + DTYPE f_active_points; /* interior of grid with respect to stencil */ + DTYPE flops; /* floating point ops per iteration */ + int iterations; /* number of times to run the algorithm */ + double local_stencil_time,/* timing parameters */ + stencil_time, + avgtime; + int stencil_size; /* number of points in stencil */ + DTYPE * RESTRICT in; /* input grid values */ + DTYPE * RESTRICT out; /* output grid values */ + long total_length_in; /* total required length to store input array */ + long total_length_out;/* total required length to store output array */ + int error=0; /* error flag */ + DTYPE weight[2*RADIUS+1][2*RADIUS+1]; /* weights of points in the stencil */ + MPI_Request request[8]; + MPI_Status status[8]; + + /******************************************************************************* + ** Initialize the MPI environment + ********************************************************************************/ + MPI_Init(&argc,&argv); + MPI_Comm_rank(MPI_COMM_WORLD, &my_ID); + MPI_Comm_size(MPI_COMM_WORLD, &Num_procs); + + /******************************************************************************* + ** process, test, and broadcast input parameters + ********************************************************************************/ + + if (my_ID == root) { +#ifndef STAR + printf("ERROR: Compact stencil not supported\n"); + error = 1; + goto ENDOFTESTS; +#endif + + if (argc != 3){ + printf("Usage: %s <# iterations> \n", + *argv); + error = 1; + goto ENDOFTESTS; + } + + iterations = atoi(*++argv); + if (iterations < 1){ + printf("ERROR: iterations must be >= 1 : %d \n",iterations); + error = 1; + goto ENDOFTESTS; + } + + n = atoi(*++argv); + nsquare = n * n; + if (nsquare < Num_procs){ + printf("ERROR: grid size %d must be at least # ranks: %ld\n", + nsquare, Num_procs); + error = 1; + goto ENDOFTESTS; + } + + if (RADIUS < 0) { + printf("ERROR: Stencil radius %d should be non-negative\n", RADIUS); + error = 1; + goto ENDOFTESTS; + } + + if (2*RADIUS +1 > n) { + printf("ERROR: Stencil radius %d exceeds grid size %d\n", RADIUS, n); + error = 1; + goto ENDOFTESTS; + } + + ENDOFTESTS:; + } + bail_out(error); + + /* determine best way to create a 2D grid of ranks (closest to square, for + best surface/volume ratio); we do this brute force for now + */ + for (Num_procsx=(int) (sqrt(Num_procs+1)); Num_procsx>0; Num_procsx--) { + if (!(Num_procs%Num_procsx)) { + Num_procsy = Num_procs/Num_procsx; + break; + } + } + my_IDx = my_ID%Num_procsx; + my_IDy = my_ID/Num_procsx; + /* compute neighbors; don't worry about dropping off the edges of the grid */ + right_nbr = my_ID+1; + left_nbr = my_ID-1; + top_nbr = my_ID+Num_procsx; + bottom_nbr = my_ID-Num_procsx; + + if (my_ID == root) { + printf("MPI stencil execution on 2D grid\n"); + printf("Number of ranks = %d\n", Num_procs); + printf("Grid size = %d\n", n); + printf("Radius of stencil = %d\n", RADIUS); + printf("Tiles in x/y-direction = %d/%d\n", Num_procsx, Num_procsy); + printf("Type of stencil = star\n"); +#ifdef DOUBLE + printf("Data type = double precision\n"); +#else + printf("Data type = single precision\n"); +#endif + printf("Number of iterations = %d\n", iterations); + } + + MPI_Bcast(&n, 1, MPI_INT, root, MPI_COMM_WORLD); + MPI_Bcast(&iterations, 1, MPI_INT, root, MPI_COMM_WORLD); + + /* compute amount of space required for input and solution arrays */ + + width = n/Num_procsx; + leftover = n%Num_procsx; + if (my_IDx 0) { + MPI_Irecv(bottom_buf_in,RADIUS*width, MPI_DTYPE, bottom_nbr, 99, + MPI_COMM_WORLD, &(request[3])); + for (kk=0,j=jstart; j<=jstart+RADIUS-1; j++) for (i=istart; i<=iend; i++) { + bottom_buf_out[kk++]= IN(i,j); + } + MPI_Isend(bottom_buf_out, RADIUS*width,MPI_DTYPE, bottom_nbr, 101, + MPI_COMM_WORLD, &(request[2])); + } + if (my_IDy < Num_procsy-1) { + MPI_Wait(&(request[0]), &(status[0])); + MPI_Wait(&(request[1]), &(status[1])); + for (kk=0,j=jend+1; j<=jend+RADIUS; j++) for (i=istart; i<=iend; i++) { + IN(i,j) = top_buf_in[kk++]; + } + } + if (my_IDy > 0) { + MPI_Wait(&(request[2]), &(status[2])); + MPI_Wait(&(request[3]), &(status[3])); + for (kk=0,j=jstart-RADIUS; j<=jstart-1; j++) for (i=istart; i<=iend; i++) { + IN(i,j) = bottom_buf_in[kk++]; + } + } + + /* need to fetch ghost point data from neighbors in x-direction */ + if (my_IDx < Num_procsx-1) { + MPI_Irecv(right_buf_in, RADIUS*height, MPI_DTYPE, right_nbr, 1010, + MPI_COMM_WORLD, &(request[1+4])); + for (kk=0,j=jstart; j<=jend; j++) for (i=iend-RADIUS+1; i<=iend; i++) { + right_buf_out[kk++]= IN(i,j); + } + MPI_Isend(right_buf_out, RADIUS*height, MPI_DTYPE, right_nbr, 990, + MPI_COMM_WORLD, &(request[0+4])); + } + if (my_IDx > 0) { + MPI_Irecv(left_buf_in, RADIUS*height, MPI_DTYPE, left_nbr, 990, + MPI_COMM_WORLD, &(request[3+4])); + for (kk=0,j=jstart; j<=jend; j++) for (i=istart; i<=istart+RADIUS-1; i++) { + left_buf_out[kk++]= IN(i,j); + } + MPI_Isend(left_buf_out, RADIUS*height, MPI_DTYPE, left_nbr, 1010, + MPI_COMM_WORLD, &(request[2+4])); + } + if (my_IDx < Num_procsx-1) { + MPI_Wait(&(request[0+4]), &(status[0+4])); + MPI_Wait(&(request[1+4]), &(status[1+4])); + for (kk=0,j=jstart; j<=jend; j++) for (i=iend+1; i<=iend+RADIUS; i++) { + IN(i,j) = right_buf_in[kk++]; + } + } + if (my_IDx > 0) { + MPI_Wait(&(request[2+4]), &(status[2+4])); + MPI_Wait(&(request[3+4]), &(status[3+4])); + for (kk=0,j=jstart; j<=jend; j++) for (i=istart-RADIUS; i<=istart-1; i++) { + IN(i,j) = left_buf_in[kk++]; + } + } + + /* Apply the stencil operator */ + for (j=MAX(jstart,RADIUS); j<=MIN(n-RADIUS-1,jend); j++) { + for (i=MAX(istart,RADIUS); i<=MIN(n-RADIUS-1,iend); i++) { + for (jj=-RADIUS; jj<=RADIUS; jj++) { + OUT(i,j) += WEIGHT(0,jj)*IN(i,j+jj); + } + for (ii=-RADIUS; ii<0; ii++) { + OUT(i,j) += WEIGHT(ii,0)*IN(i+ii,j); + } + for (ii=1; ii<=RADIUS; ii++) { + OUT(i,j) += WEIGHT(ii,0)*IN(i+ii,j); + + } + } + } + + /* add constant to solution to force refresh of neighbor data, if any */ + for (j=jstart; j<=jend; j++) for (i=istart; i<=iend; i++) IN(i,j)+= 1.0; + + } /* end of iterations */ + + local_stencil_time = wtime() - local_stencil_time; + MPI_Reduce(&local_stencil_time, &stencil_time, 1, MPI_DOUBLE, MPI_MAX, root, + MPI_COMM_WORLD); + + /* compute L1 norm in parallel */ + local_norm = (DTYPE) 0.0; + for (j=MAX(jstart,RADIUS); j<=MIN(n-RADIUS-1,jend); j++) { + for (i=MAX(istart,RADIUS); i<=MIN(n-RADIUS-1,iend); i++) { + local_norm += (DTYPE)ABS(OUT(i,j)); + } + } + + MPI_Reduce(&local_norm, &norm, 1, MPI_DTYPE, MPI_SUM, root, MPI_COMM_WORLD); + + /******************************************************************************* + ** Analyze and output results. + ********************************************************************************/ + +/* verify correctness */ + if (my_ID == root) { + norm /= f_active_points; + if (RADIUS > 0) { + reference_norm = (DTYPE) (iterations+1) * (COEFX + COEFY); + } + else { + reference_norm = (DTYPE) 0.0; + } + if (ABS(norm-reference_norm) > EPSILON) { + printf("ERROR: L1 norm = "FSTR", Reference L1 norm = "FSTR"\n", + norm, reference_norm); + error = 1; + } + else { + printf("Solution validates\n"); +#ifdef VERBOSE + printf("Reference L1 norm = "FSTR", L1 norm = "FSTR"\n", + reference_norm, norm); +#endif + } + } + bail_out(error); + + if (my_ID == root) { + /* flops/stencil: 2 flops (fma) for each point in the stencil, + plus one flop for the update of the input of the array */ + flops = (DTYPE) (2*stencil_size+1) * f_active_points; + avgtime = stencil_time/iterations; + printf("Rate (MFlops/s): "FSTR" Avg time (s): %lf\n", + 1.0E-06 * flops/avgtime, avgtime); + } + + MPI_Finalize(); + exit(EXIT_SUCCESS); +} diff --git a/tests/apps/prk/tests/MPI/Synch_global/Makefile.ohpc b/tests/apps/prk/tests/MPI/Synch_global/Makefile.ohpc new file mode 100644 index 0000000000..1597250768 --- /dev/null +++ b/tests/apps/prk/tests/MPI/Synch_global/Makefile.ohpc @@ -0,0 +1,28 @@ +include ../../common/MPI.defs +##### User configurable options ##### + +OPTFLAGS = $(DEFAULT_OPT_FLAGS) +#description: change above into something that is a decent optimization on you system + +#uncomment any of the following flags (and change values) to change defaults + +#DEBUGFLAG = -DVERBOSE +#description: default diagnostic style is silent + +USERFLAGS = +#description: parameter to specify optional flags + +#set the following variables for custom libraries and/or other objects + +EXTOBJS = +LIBS = +LIBPATHS = +INCLUDEPATHS = + +### End User configurable options ### + +TUNEFLAGS = $(DEBUGFLAG) $(USERFLAGS) +PROGRAM = global +OBJS = $(PROGRAM).o $(COMOBJS) + +include ../../common/make.common diff --git a/tests/apps/prk/tests/MPI/Synch_global/global.c b/tests/apps/prk/tests/MPI/Synch_global/global.c new file mode 100755 index 0000000000..125b7e13b8 --- /dev/null +++ b/tests/apps/prk/tests/MPI/Synch_global/global.c @@ -0,0 +1,235 @@ +/* +Copyright (c) 2013, Intel Corporation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. +* Neither the name of Intel Corporation nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +*/ + +/******************************************************************* + +NAME: StopNGo + +PURPOSE: This program tests the efficiency of a global synchronization + on the target system. + +USAGE: The program takes as input the number of times the test of + string manipulation involving the global synchronization is + carried out, as well as the length of the string. + + <# iterations> + + The output consists of diagnostics to make sure the + algorithm worked, and of timing statistics. + + Compile with VERBOSE defined if you want lots of output. + +FUNCTIONS CALLED: + + Other than MPI or standard C functions, the following + functions are used in this program: + + wtime() + bail_out() + chartoi() + +HISTORY: Written by Rob Van der Wijngaart, December 2005. + +*******************************************************************/ + +#include +#include + +#define EOS '\0' + +int chartoi(char c) { + /* define short string; need two characters, second contains string terminator */ + char letter[2]="0"; + letter[0]=c; + return (atoi(letter)); +} + + +int main(int argc, char ** argv) +{ + int my_ID; /* rank */ + int root=0; + int iterations; /* number of times to rehash strings */ + int i, iter; /* dummies */ + int checksum; /* computed checksum of final aggregate string */ + char *scramble = "27638472638746283742712311207892"; + char *basestring; /* initial string to be copied to private strings */ + char *iterstring; /* private copy of string */ + char *catstring; /* concatenated, scrambled string */ + long length, /* total length of scramble string */ + proc_length; /* length of string per rank */ + int basesum; /* checksum of base string */ + MPI_Datatype mpi_word; /* chunk of scramble string to be communicated */ + double stopngo_time;/* timing parameter */ + int Num_procs; /* Number of ranks */ + int error = 0; /* error flag */ + +/********************************************************************************* +** Initialize the MPI environment +**********************************************************************************/ + MPI_Init(&argc,&argv); + MPI_Comm_rank(MPI_COMM_WORLD, &my_ID); + MPI_Comm_size(MPI_COMM_WORLD, &Num_procs); + +/********************************************************************************* +** process, test and broadcast input parameter +**********************************************************************************/ + + if (my_ID == root){ + if (argc != 3){ + printf("Usage: %s <# iterations> \n", *argv); + error = 1; + goto ENDOFTESTS; + } + + iterations = atoi(*++argv); + if (iterations < 1){ + printf("ERROR: iterations must be positive: %d \n",iterations); + error = 1; + goto ENDOFTESTS; + } + + length = atol(*++argv); + if (length <# iterations> + + The output consists of diagnostics to make sure the + algorithm worked, and of timing statistics. + +FUNCTIONS CALLED: + + Other than MPI or standard C functions, the following + functions are used in this program: + + wtime() + bail_out() + +HISTORY: - Written by Rob Van der Wijngaart, March 2006. + - modified by Rob Van der Wijngaart, August 2006: + * changed boundary conditions and stencil computation to avoid + overflow + * introduced multiple iterations over grid and dependency between + iterations + +**********************************************************************************/ + +#include +#include + +#define ARRAY(i,j) vector[i+1+(j)*(segment_size+1)] + +int main(int argc, char ** argv) +{ + int my_ID; /* MPI rank */ + int root; /* ID of root rank */ + int m, n; /* grid dimensions */ + double local_pipeline_time, /* timing parameters */ + pipeline_time, + avgtime; + double epsilon = 1.e-8; /* error tolerance */ + double corner_val; /* verification value at top right corner of grid */ + int i, j, jj, iter, ID;/* dummies */ + int iterations; /* number of times to run the pipeline algorithm */ + int start, end; /* start and end of grid slice owned by calling rank */ + int segment_size; /* size of x-dimension of grid owned by calling rank */ + int error=0; /* error flag */ + int Num_procs; /* Number of ranks */ + int grp; /* grid line aggregation factor */ + int jjsize; /* actual line group size */ + double *vector; /* array holding grid values */ + double *inbuf, *outbuf; /* communication buffers used when aggregating */ + long total_length; /* total required length to store grid values */ + MPI_Status status; /* completion status of message */ + +/********************************************************************************* +** Initialize the MPI environment +**********************************************************************************/ + MPI_Init(&argc,&argv); + MPI_Comm_rank(MPI_COMM_WORLD, &my_ID); + MPI_Comm_size(MPI_COMM_WORLD, &Num_procs); + +/* we set root equal to the highest rank, because this is also + the rank that reports on the verification value */ + root = Num_procs-1; + +/********************************************************************* +** process, test and broadcast input parameter +*********************************************************************/ + + if (my_ID == root){ + if (argc != 4 && argc != 5){ + printf("Usage: %s <#iterations> <1st array dimension> <2nd array dimension> [group factor]\n", + *argv); + error = 1; + goto ENDOFTESTS; + } + + iterations = atoi(*++argv); + if (iterations < 1){ + printf("ERROR: iterations must be >= 1 : %d \n",iterations); + error = 1; + goto ENDOFTESTS; + } + + m = atoi(*++argv); + n = atoi(*++argv); + if (m < 1 || n < 1){ + printf("ERROR: grid dimensions must be positive: %d, %d \n", m, n); + error = 1; + goto ENDOFTESTS; + } + + if (m<=Num_procs) { + printf("ERROR: First grid dimension %d must be >= number of ranks %d\n", + m, Num_procs); + error = 1; + goto ENDOFTESTS; + } + + if (argc==5) { + grp = atoi(*++argv); + if (grp < 1) grp = 1; + else if (grp >= n) grp = n-1; + } + else grp = 1; + + ENDOFTESTS:; + } + bail_out(error); + + if (my_ID == root) { + printf("MPI pipeline execution on 2D grid\n"); + printf("Number of ranks = %d\n",Num_procs); + printf("Grid sizes = %d, %d\n", m, n); + printf("Number of iterations = %d\n", iterations); + if (grp > 1) + printf("Group factor = %d (cheating!)\n", grp); + } + + /* Broadcast benchmark data to all rankes */ + MPI_Bcast(&m, 1, MPI_INT, root, MPI_COMM_WORLD); + MPI_Bcast(&n, 1, MPI_INT, root, MPI_COMM_WORLD); + MPI_Bcast(&grp, 1, MPI_INT, root, MPI_COMM_WORLD); + MPI_Bcast(&iterations, 1, MPI_INT, root, MPI_COMM_WORLD); + + int leftover; + segment_size = m/Num_procs; + leftover = m%Num_procs; + if (my_ID < leftover) { + start = (segment_size+1)* my_ID; + end = start + segment_size; + } + else { + start = (segment_size+1) * leftover + segment_size * (my_ID-leftover); + end = start + segment_size -1; + } + + /* now set segment_size to the value needed by the calling rank */ + segment_size = end - start + 1; + + /* total_length takes into account one ghost cell on left side of segment */ + total_length = ((end-start+1)+1)*n; + vector = (double *) malloc(total_length*sizeof(double)); + if (vector == NULL) { + printf("Could not allocate space for grid slice of %d by %d points", + segment_size, n); + printf(" on rank %d\n", my_ID); + error = 1; + } + bail_out(error); + + /* reserve space for in and out buffers */ + inbuf = (double *) malloc(2*sizeof(double)*(grp)); + if (inbuf == NULL) { + printf("Could not allocate space for %d words of communication buffers", + 2*grp); + printf(" on rank %d\n", my_ID); + error = 1; + } + bail_out(error); + outbuf = inbuf + grp; + + /* clear the array */ + for (j=0; j 0) { + MPI_Recv(&(ARRAY(start-1,j)), 1, MPI_DOUBLE, my_ID-1, j, + MPI_COMM_WORLD, &status); + } + + for (i=start; i<= end; i++) { + ARRAY(i,j) = ARRAY(i-1,j) + ARRAY(i,j-1) - ARRAY(i-1,j-1); + } + + /* if I am not on the right boundary, send data to my right neighbor */ + if (my_ID < Num_procs-1) { + MPI_Send(&(ARRAY(end,j)), 1, MPI_DOUBLE, my_ID+1, j, MPI_COMM_WORLD); + } + } + else for (j=1; j 0) { + MPI_Recv(inbuf, jjsize, MPI_DOUBLE, my_ID-1, j, MPI_COMM_WORLD, &status); + for (jj=0; jj1) { + if (my_ID==root) { + corner_val = -ARRAY(end,n-1); + MPI_Send(&corner_val,1,MPI_DOUBLE,0,888,MPI_COMM_WORLD); + } + if (my_ID==0) { + MPI_Recv(&(ARRAY(0,0)),1,MPI_DOUBLE,root,888,MPI_COMM_WORLD,&status); + } + } + else ARRAY(0,0)= -ARRAY(end,n-1); + + } + + local_pipeline_time = wtime() - local_pipeline_time; + MPI_Reduce(&local_pipeline_time, &pipeline_time, 1, MPI_DOUBLE, MPI_MAX, root, + MPI_COMM_WORLD); + + /******************************************************************************* + ** Analyze and output results. + ********************************************************************************/ + + /* verify correctness, using top right value */ + corner_val = (double) ((iterations+1)*(m+n-2)); + if (my_ID == root) { + if (abs(ARRAY(end,n-1)-corner_val)/corner_val >= epsilon) { + printf("ERROR: checksum %lf does not match verification value %lf\n", + ARRAY(end,n-1), corner_val); + error = 1; + } + } + bail_out(error); + + if (my_ID == root) { + avgtime = pipeline_time/iterations; + /* flip the sign of the execution time to indicate cheating */ + if (grp>1) avgtime *= -1.0; +#ifdef VERBOSE + printf("Solution validates; verification value = %lf\n", corner_val); + printf("Point-to-point synchronizations/s: %lf\n", + ((float)((n-1)*(Num_procs-1)))/(avgtime)); +#else + printf("Solution validates\n"); +#endif + printf("Rate (MFlops/s): %lf Avg time (s): %lf\n", + 1.0E-06 * 2 * ((double)((m-1)*(n-1)))/avgtime, avgtime); + } + + MPI_Finalize(); + exit(EXIT_SUCCESS); + +} /* end of main */ + diff --git a/tests/apps/prk/tests/MPI/Transpose/Makefile.ohpc b/tests/apps/prk/tests/MPI/Transpose/Makefile.ohpc new file mode 100644 index 0000000000..3c210cfc85 --- /dev/null +++ b/tests/apps/prk/tests/MPI/Transpose/Makefile.ohpc @@ -0,0 +1,31 @@ +include ../../common/MPI.defs + +##### User configurable options ##### + +OPTFLAGS = $(DEFAULT_OPT_FLAGS) +#description: change above into something that is a decent optimization on you system + +#uncomment any of the following flags (and change values) to change defaults + +#BLOCKFLAG = -DSYNCHRONOUS +#description: turn on synchronous (blocking) communications + +#DEBUGFLAG = -DVERBOSE +#description: default diagnostic style is silent + +USERFLAGS = +#description: parameter to specify optional flags + +#set the following variables for custom libraries and/or other objects +EXTOBJS = +LIBS = +LIBPATHS = +INCLUDEPATHS = + +### End User configurable options ### + +TUNEFLAGS = $(BLOCKFLAG) $(DEBUGFLAG) $(USERFLAGS) +PROGRAM = transpose +OBJS = $(PROGRAM).o $(COMOBJS) + +include ../../common/make.common diff --git a/tests/apps/prk/tests/MPI/Transpose/transpose.c b/tests/apps/prk/tests/MPI/Transpose/transpose.c new file mode 100755 index 0000000000..3fe3b08a54 --- /dev/null +++ b/tests/apps/prk/tests/MPI/Transpose/transpose.c @@ -0,0 +1,379 @@ +/* +Copyright (c) 2013, Intel Corporation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. +* Neither the name of Intel Corporation nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +*/ + +/******************************************************************* + +NAME: transpose + +PURPOSE: This program tests the efficiency with which a square matrix + can be transposed and stored in another matrix. The matrices + are distributed identically. + +USAGE: Program inputs are the matrix order, the number of times to + repeat the operation, and the communication mode + + transpose <# iterations> [tile size] + + An optional parameter specifies the tile size used to divide the + individual matrix blocks for improved cache and TLB performance. + + The output consists of diagnostics to make sure the + transpose worked and timing statistics. + +FUNCTIONS CALLED: + + Other than MPI or standard C functions, the following + functions are used in this program: + + wtime() Portable wall-timer interface. + bail_out() Determine global error and exit if nonzero. + +HISTORY: Written by Tim Mattson, April 1999. + Updated by Rob Van der Wijngaart, December 2005. + Updated by Rob Van der Wijngaart, October 2006. + Updated by Rob Van der Wijngaart, November 2014:: + - made variable names more consistent + - put timing around entire iterative loop of transposes + - fixed incorrect matrix block access; no separate function + for local transpose of matrix block + - reordered initialization and verification loops to + produce unit stride + - changed initialization values, such that the input matrix + elements are: A(i,j) = i+order*j + + +*******************************************************************/ + +/****************************************************************** + Layout nomenclature + ------------------- + +o Each rank owns one block of columns (Colblock) of the overall + matrix to be transposed, as well as of the transposed matrix. +o Colblock is stored contiguously in the memory of the rank. + The stored format is column major, which means that matrix + elements (i,j) and (i+1,j) are adjacent, and (i,j) and (i,j+1) + are "order" words apart +o Colblock is logically composed of #ranks Blocks, but a Block is + not stored contiguously in memory. Conceptually, the Block is + the unit of data that gets communicated between ranks. Block i of + rank j is locally transposed and gathered into a buffer called Work, + which is sent to rank i, where it is scattered into Block j of the + transposed matrix. +o When tiling is applied to reduce TLB misses, each block gets + accessed by tiles. +o The original and transposed matrices are called A and B + + ----------------------------------------------------------------- +| | | | | +| Colblock | | | | +| | | | | +| | | | | +| | | | | +| ------------------------------- | +| | | | | +| | Block | | | +| | | | | +| | | | | +| | | | | +| ------------------------------- | +| |Tile| | | | +| | | | | Overall Matrix | +| |---- | | | +| | | | | +| | | | | +| ------------------------------- | +| | | | | +| | | | | +| | | | | +| | | | | +| | | | | + -----------------------------------------------------------------*/ + +#include +#include + +#define A(i,j) A_p[(i+istart)+order*(j)] +#define B(i,j) B_p[(i+istart)+order*(j)] +#define Work_in(i,j) Work_in_p[i+Block_order*(j)] +#define Work_out(i,j) Work_out_p[i+Block_order*(j)] + +int main(int argc, char ** argv) +{ + int Block_order; /* number of columns owned by rank */ + int Block_size; /* size of a single block */ + int Colblock_size; /* size of column block */ + int Tile_order=32; /* default Tile order */ + int tiling; /* boolean: true if tiling is used */ + int Num_procs; /* number of ranks */ + int order; /* order of overall matrix */ + int send_to, recv_from; /* ranks with which to communicate */ + MPI_Status status; +#ifndef SYNCHRONOUS + MPI_Request send_req; + MPI_Request recv_req; +#endif + long bytes; /* combined size of matrices */ + int my_ID; /* rank */ + int root=0; /* rank of root */ + int iterations; /* number of times to do the transpose */ + int i, j, it, jt, istart;/* dummies */ + int iter; /* index of iteration */ + int phase; /* phase inside staged communication */ + int colstart; /* starting column for owning rank */ + int error; /* error flag */ + double *A_p; /* original matrix column block */ + double *B_p; /* transposed matrix column block */ + double *Work_in_p; /* workspace for the transpose function */ + double *Work_out_p; /* workspace for the transpose function */ + double abserr, /* absolute error */ + abserr_tot; /* aggregate absolute error */ + double epsilon = 1.e-8; /* error tolerance */ + double local_trans_time, /* timing parameters */ + trans_time, + avgtime; + +/********************************************************************* +** Initialize the MPI environment +*********************************************************************/ + MPI_Init(&argc,&argv); + MPI_Comm_rank(MPI_COMM_WORLD, &my_ID); + MPI_Comm_size(MPI_COMM_WORLD, &Num_procs); + +/********************************************************************* +** process, test and broadcast input parameters +*********************************************************************/ + error = 0; + if (my_ID == root) { + if (argc != 3 && argc != 4){ + printf("Usage: %s <# iterations> [Tile size]\n", + *argv); + error = 1; goto ENDOFTESTS; + } + + iterations = atoi(*++argv); + if(iterations < 1){ + printf("ERROR: iterations must be >= 1 : %d \n",iterations); + error = 1; goto ENDOFTESTS; + } + + order = atoi(*++argv); + if (order < Num_procs) { + printf("ERROR: matrix order %d should at least # procs %d\n", + order, Num_procs); + error = 1; goto ENDOFTESTS; + } + if (order%Num_procs) { + printf("ERROR: matrix order %d should be divisible by # procs %d\n", + order, Num_procs); + error = 1; goto ENDOFTESTS; + } + + if (argc == 4) Tile_order = atoi(*++argv); + + ENDOFTESTS:; + } + bail_out(error); + + if (my_ID == root) { + printf("MPI matrix transpose: B = A^T\n"); + printf("Number of ranks = %d\n", Num_procs); + printf("Matrix order = %d\n", order); + printf("Number of iterations = %d\n", iterations); + if ((Tile_order > 0) && (Tile_order < order)) + printf("Tile size = %d\n", Tile_order); + else printf("Untiled\n"); +#ifndef SYNCHRONOUS + printf("Non-"); +#endif + printf("Blocking messages\n"); + } + + /* Broadcast input data to all ranks */ + MPI_Bcast (&order, 1, MPI_INT, root, MPI_COMM_WORLD); + MPI_Bcast (&iterations, 1, MPI_INT, root, MPI_COMM_WORLD); + MPI_Bcast (&Tile_order, 1, MPI_INT, root, MPI_COMM_WORLD); + + /* a non-positive tile size means no tiling of the local transpose */ + tiling = (Tile_order > 0) && (Tile_order < order); + bytes = 2 * sizeof(double) * order * order; + +/********************************************************************* +** The matrix is broken up into column blocks that are mapped one to a +** rank. Each column block is made up of Num_procs smaller square +** blocks of order block_order. +*********************************************************************/ + + Block_order = order/Num_procs; + colstart = Block_order * my_ID; + Colblock_size = order * Block_order; + Block_size = Block_order * Block_order; + +/********************************************************************* +** Create the column block of the test matrix, the row block of the +** transposed matrix, and workspace (workspace only if #procs>1) +*********************************************************************/ + A_p = (double *)malloc(Colblock_size*sizeof(double)); + if (A_p == NULL){ + printf(" Error allocating space for original matrix on node %d\n",my_ID); + error = 1; + } + bail_out(error); + + B_p = (double *)malloc(Colblock_size*sizeof(double)); + if (B_p == NULL){ + printf(" Error allocating space for transpose matrix on node %d\n",my_ID); + error = 1; + } + bail_out(error); + + if (Num_procs>1) { + Work_in_p = (double *)malloc(2*Block_size*sizeof(double)); + if (Work_in_p == NULL){ + printf(" Error allocating space for work on node %d\n",my_ID); + error = 1; + } + bail_out(error); + Work_out_p = Work_in_p + Block_size; + } + + /* Fill the original column matrix */ + istart = 0; + for (j=0;j <# iterations> + + The output consists of diagnostics to make sure the + algorithm worked, and of timing statistics. + +FUNCTIONS CALLED: + + Other than MPI or standard C functions, the following + external functions are used in this program: + + wtime() + bail_out() + checkTRIADresults() + +NOTES: Bandwidth is determined as the number of words read, plus the + number of words written, times the size of the words, divided + by the execution time. For a vector length of N, the total + number of words read and written is 4*N*sizeof(double). + +HISTORY: This code is loosely based on the Stream benchmark by John + McCalpin, but does not follow all the Stream rules. Hence, + reported results should not be associated with Stream in + external publications +REVISION: Modified by Rob Van der Wijngaart, December 2005, to + parameterize vector size and offsets through compiler flags. + Also removed all Stream cases except TRIAD. +REVISION: Modified by Rob Van der Wijngaart, March 2006, to handle MPI. +REVISION: Modified by Rob Van der Wijngaart, May 2006, to introduce + dependence between successive triad operations. This is + necessary to avoid dead code elimination +REVISION: Modified by Rob Van der Wijngaart, November 2014, replaced + timing of individual loop iterations with timing of overall + loop; also replaced separate loop establishing dependence + between iterations (must now be included in timing) with + accumulation: a[] += b[] + scalar*c[] +**********************************************************************/ + +#include +#include + +#define DEFAULTMAXLENGTH 2000000 +#ifdef MAXLENGTH + #if MAXLENGTH > 0 + #define N MAXLENGTH + #else + #define N DEFAULTMAXLENGTH + #endif +#else + #define N DEFAULTMAXLENGTH +#endif + +#ifdef STATIC_ALLOCATION + /* use static to make sure it goes on the heap, not the stack */ + static double a[N]; +#else + static double * RESTRICT a; +#endif + +static double * RESTRICT b; +static double * RESTRICT c; + +#define SCALAR 3.0 + +static int checkTRIADresults(int, long int); + +int main(int argc, char **argv) +{ + long j, iter; /* dummies */ + double scalar; /* constant used in Triad operation */ + int iterations; /* number of times vector loop gets repeated */ + long length, /* vector length per rank */ + total_length, /* total vector length */ + offset; /* offset between vectors a and b, and b and c */ + double bytes; /* memory IO size */ + size_t space; /* memory used for a single vector */ + double local_nstream_time,/* timing parameters */ + nstream_time, + avgtime; + int nthread_input, /* thread parameters */ + nthread; + int Num_procs, /* number of ranks */ + my_ID, /* rank of calling rank */ + root=0; /* ID of master rank */ + int error=0; /* error flag for individual rank */ + +/********************************************************************************** +* process and test input parameters +***********************************************************************************/ + + MPI_Init(&argc,&argv); + MPI_Comm_size(MPI_COMM_WORLD,&Num_procs); + MPI_Comm_rank(MPI_COMM_WORLD,&my_ID); + + if (my_ID == root) { + printf("MPI+OpenMP stream triad: A = B + scalar*C\n"); + if (argc != 5){ + printf("Usage: %s <#threads> <#iterations> \n", *argv); + error = 1; + goto ENDOFTESTS; + } + + /* Take number of threads to request from command line */ + nthread_input = atoi(*++argv); + if ((nthread_input < 1) || (nthread_input > MAX_THREADS)) { + printf("ERROR: Invalid number of threads: %d\n", nthread_input); + error = 1; + goto ENDOFTESTS; + } + + iterations = atoi(*++argv); + if (iterations < 1) { + printf("ERROR: Invalid number of iterations: %d\n", iterations); + error = 1; + goto ENDOFTESTS; + } + + total_length = atol(*++argv); + if (total_length < Num_procs) { + printf("ERROR: Invalid vector length: %ld\n", total_length); + error = 1; + goto ENDOFTESTS; + } + else length = total_length/Num_procs; + + offset = atol(*++argv); + if (offset < 0) { + printf("ERROR: Invalid array offset: %ld\n", offset); + error = 1; + goto ENDOFTESTS; + } +#ifdef STATIC_ALLOCATION + if ((3*length + 2*offset) > N) { + printf("ERROR: vector length/offset %ld/%ld too ", total_length, offset); + printf("large; increase MAXLENGTH in Makefile or decrease vector length\n"); + error = 1; + goto ENDOFTESTS; + } +#endif + ENDOFTESTS:; + } + bail_out(error); + + /* broadcast initialization data */ + MPI_Bcast(&length, 1, MPI_LONG, root, MPI_COMM_WORLD); + MPI_Bcast(&offset, 1, MPI_LONG, root, MPI_COMM_WORLD); + MPI_Bcast(&iterations, 1, MPI_INT, root, MPI_COMM_WORLD); + MPI_Bcast(&nthread_input, 1, MPI_INT, root, MPI_COMM_WORLD); + + omp_set_num_threads(nthread_input); + +#ifndef STATIC_ALLOCATION + space = (3*length + 2*offset)*sizeof(double); + a = (double *) malloc(space); + if (!a && my_ID == root) { + printf("ERROR: Could not allocate %ld bytes for vectors\n", (long int)space); + error = 1; + } + bail_out(error); +#endif + b = a + length + offset; + c = b + length + offset; + + bytes = 4.0 * sizeof(double) * length * Num_procs; + + if (my_ID == root) { + printf("Number of ranks = %d\n", Num_procs); + printf("Number of threads = %d\n", omp_get_max_threads()); + printf("Vector length = %ld\n", total_length); + printf("Offset = %ld\n", offset); + printf("Number of iterations = %d\n", iterations); + } + + #pragma omp parallel for + #pragma vector always + for (j=0; j epsilon) { + printf ("Failed Validation on output array\n"); +#ifndef VERBOSE + printf (" Expected checksum: %f \n",aj); + printf (" Observed checksum: %f \n",asum); +#endif + return (0); + } + else { + printf ("Solution validates\n"); + return (1); + } +} + diff --git a/tests/apps/prk/tests/MPIOPENMP/Stencil/Makefile.ohpc b/tests/apps/prk/tests/MPIOPENMP/Stencil/Makefile.ohpc new file mode 100644 index 0000000000..185eaa28af --- /dev/null +++ b/tests/apps/prk/tests/MPIOPENMP/Stencil/Makefile.ohpc @@ -0,0 +1,41 @@ +include ../../common/MPIOPENMP.defs +##### User configurable options ##### + +OPTFLAGS = $(DEFAULT_OPT_FLAGS) +#description: change above into something that is a decent optimization on you system + +#uncomment any of the following flags (and change values) to change defaults + +#RESTRICTFLAG = -DRESTRICT_KEYWORD +#description: the "restrict" keyword can be used on IA platforms to disambiguate +# data accessed through pointers + +#RADIUSFLAG = -DRADIUS=R +#description: default radius of filter to be applied is 2 + +DOUBLEFLAG = -DDOUBLE +#description: default data type is single precision + +STARFLAG = -DSTAR +#description: default stencil is compact (dense, square) + +#DEBUGFLAG = -DVERBOSE +#description: default diagnostic style is silent + +USERFLAGS = +#description: parameter to specify optional flags + +#set the following variables for custom libraries and/or other objects +EXTOBJS = +LIBS = -lm +LIBPATHS = +INCLUDEPATHS = + +### End User configurable options ### + +TUNEFLAGS = $(RESTRICTFLAG) $(DEBUGFLAG) $(USERFLAGS) \ + $(DOUBLEFLAG) $(RADIUSFLAG) $(STARFLAG) +PROGRAM = stencil +OBJS = $(PROGRAM).o $(COMOBJS) + +include ../../common/make.common diff --git a/tests/apps/prk/tests/MPIOPENMP/Stencil/stencil.c b/tests/apps/prk/tests/MPIOPENMP/Stencil/stencil.c new file mode 100644 index 0000000000..e7c1461e41 --- /dev/null +++ b/tests/apps/prk/tests/MPIOPENMP/Stencil/stencil.c @@ -0,0 +1,508 @@ +/* +Copyright (c) 2013, Intel Corporation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. +* Neither the name of Intel Corporation nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +*/ + +/******************************************************************* + +NAME: Stencil + +PURPOSE: This program tests the efficiency with which a space-invariant, + linear, symmetric filter (stencil) can be applied to a square + grid or image. + +USAGE: The program takes as input the linear dimension of the grid, + and the number of iterations on the grid + + <#threads><# iterations> + + The output consists of diagnostics to make sure the + algorithm worked, and of timing statistics. + +FUNCTIONS CALLED: + + Other than MPI or standard C functions, the following + functions are used in this program: + + wtime() + bail_out() + +HISTORY: - Written by Rob Van der Wijngaart, November 2006. + - RvdW, August 2013: Removed unrolling pragmas for clarity; + fixed bug in compuation of width of strip assigned to + each rank; + - RvdW, August 2013: added constant to array "in" at end of + each iteration to force refreshing of neighbor data in + parallel versions + - RvdW, October 2014: introduced 2D domain decomposition + - RvdW, October 2014: removed barrier at start of each iteration + - RvdW, October 2014: replaced single rank/single iteration timing + with global timing of all iterations across all ranks + +*********************************************************************************/ + +#include +#include + +#ifndef RADIUS + #define RADIUS 2 +#endif + +#ifdef DOUBLE + #define DTYPE double + #define MPI_DTYPE MPI_DOUBLE + #define EPSILON 1.e-8 + #define COEFX 1.0 + #define COEFY 1.0 + #define FSTR "%lf" +#else + #define DTYPE float + #define MPI_DTYPE MPI_FLOAT + #define EPSILON 0.0001f + #define COEFX 1.0f + #define COEFY 1.0f + #define FSTR "%f" +#endif + +/* define shorthand for indexing multi-dimensional arrays with offsets */ +#define INDEXIN(i,j) (i+RADIUS+(j+RADIUS)*(width+2*RADIUS)) +/* need to add offset of RADIUS to j to account for ghost points */ +#define IN(i,j) in[INDEXIN(i-istart,j-jstart)] +#define INDEXOUT(i,j) (i+(j)*(width)) +#define OUT(i,j) out[INDEXOUT(i-istart,j-jstart)] +#define WEIGHT(ii,jj) weight[ii+RADIUS][jj+RADIUS] + +int main(int argc, char ** argv) { + + int Num_procs; /* number of ranks */ + int Num_procsx, Num_procsy; /* number of ranks in each coord direction */ + int my_ID; /* MPI rank */ + int my_IDx, my_IDy; /* coordinates of rank in rank grid */ + int right_nbr; /* global rank of right neighboring tile */ + int left_nbr; /* global rank of left neighboring tile */ + int top_nbr; /* global rank of top neighboring tile */ + int bottom_nbr; /* global rank of bottom neighboring tile */ + DTYPE *top_buf_out; /* communication buffer */ + DTYPE *top_buf_in; /* " " */ + DTYPE *bottom_buf_out; /* " " */ + DTYPE *bottom_buf_in; /* " " */ + DTYPE *right_buf_out; /* " " */ + DTYPE *right_buf_in; /* " " */ + DTYPE *left_buf_out; /* " " */ + DTYPE *left_buf_in; /* " " */ + int root = 0; + int n, width, height;/* linear global and local grid dimension */ + long nsquare; /* total number of grid points */ + int i, j, ii, jj, kk, it, jt, iter, leftover; /* dummies */ + int istart, iend; /* bounds of grid tile assigned to calling rank */ + int jstart, jend; /* bounds of grid tile assigned to calling rank */ + DTYPE norm, /* L1 norm of solution */ + local_norm, /* contribution of calling rank to L1 norm */ + reference_norm; + DTYPE f_active_points; /* interior of grid with respect to stencil */ + DTYPE flops; /* floating point ops per iteration */ + int iterations; /* number of times to run the algorithm */ + double local_stencil_time,/* timing parameters */ + stencil_time, + avgtime; + int stencil_size; /* number of points in stencil */ + int nthread_input, /* thread parameters */ + nthread; + DTYPE * RESTRICT in; /* input grid values */ + DTYPE * RESTRICT out; /* output grid values */ + long total_length_in; /* total required length to store input array */ + long total_length_out;/* total required length to store output array */ + int error=0; /* error flag */ + DTYPE weight[2*RADIUS+1][2*RADIUS+1]; /* weights of points in the stencil */ + MPI_Request request[8]; + MPI_Status status[8]; + + /******************************************************************************* + ** Initialize the MPI environment + ********************************************************************************/ + MPI_Init(&argc,&argv); + MPI_Comm_rank(MPI_COMM_WORLD, &my_ID); + MPI_Comm_size(MPI_COMM_WORLD, &Num_procs); + + /******************************************************************************* + ** process, test, and broadcast input parameters + ********************************************************************************/ + + if (my_ID == root) { +#ifndef STAR + printf("ERROR: Compact stencil not supported\n"); + error = 1; + goto ENDOFTESTS; +#endif + + if (argc != 4){ + printf("Usage: %s <#threads><#iterations> \n", + *argv); + error = 1; + goto ENDOFTESTS; + } + + /* Take number of threads to request from command line */ + nthread_input = atoi(*++argv); + if ((nthread_input < 1) || (nthread_input > MAX_THREADS)) { + printf("ERROR: Invalid number of threads: %d\n", nthread_input); + error = 1; + goto ENDOFTESTS; + } + + iterations = atoi(*++argv); + if (iterations < 1){ + printf("ERROR: iterations must be >= 1 : %d \n",iterations); + error = 1; + goto ENDOFTESTS; + } + + n = atoi(*++argv); + nsquare = n * n; + if (nsquare < Num_procs){ + printf("ERROR: grid size %d must be at least # ranks: %ld\n", + nsquare, Num_procs); + error = 1; + goto ENDOFTESTS; + } + + if (RADIUS < 0) { + printf("ERROR: Stencil radius %d should be non-negative\n", RADIUS); + error = 1; + goto ENDOFTESTS; + } + + if (2*RADIUS +1 > n) { + printf("ERROR: Stencil radius %d exceeds grid size %d\n", RADIUS, n); + error = 1; + goto ENDOFTESTS; + } + + ENDOFTESTS:; + } + bail_out(error); + + /* determine best way to create a 2D grid of ranks (closest to square, for + best surface/volume ratio); we do this brute force for now + */ + for (Num_procsx=(int) (sqrt(Num_procs+1)); Num_procsx>0; Num_procsx--) { + if (!(Num_procs%Num_procsx)) { + Num_procsy = Num_procs/Num_procsx; + break; + } + } + my_IDx = my_ID%Num_procsx; + my_IDy = my_ID/Num_procsx; + /* compute neighbors; don't worry about dropping off the edges of the grid */ + right_nbr = my_ID+1; + left_nbr = my_ID-1; + top_nbr = my_ID+Num_procsx; + bottom_nbr = my_ID-Num_procsx; + + + MPI_Bcast(&n, 1, MPI_INT, root, MPI_COMM_WORLD); + MPI_Bcast(&iterations, 1, MPI_INT, root, MPI_COMM_WORLD); + MPI_Bcast(&nthread_input, 1, MPI_INT, root, MPI_COMM_WORLD); + + omp_set_num_threads(nthread_input); + + if (my_ID == root) { + printf("MPI+OPENMP stencil execution on 2D grid\n"); + printf("Number of ranks = %d\n", Num_procs); + printf("Number of threads = %d\n", omp_get_max_threads()); + printf("Grid size = %d\n", n); + printf("Radius of stencil = %d\n", RADIUS); + printf("Tiles in x/y-direction = %d/%d\n", Num_procsx, Num_procsy); + printf("Type of stencil = star\n"); +#ifdef DOUBLE + printf("Data type = double precision\n"); +#else + printf("Data type = single precision\n"); +#endif + printf("Number of iterations = %d\n", iterations); + } + + /* compute amount of space required for input and solution arrays */ + + width = n/Num_procsx; + leftover = n%Num_procsx; + if (my_IDx 0) { + MPI_Irecv(bottom_buf_in,RADIUS*width, MPI_DTYPE, bottom_nbr, 99, + MPI_COMM_WORLD, &(request[3])); + for (kk=0,j=jstart; j<=jstart+RADIUS-1; j++) for (i=istart; i<=iend; i++) { + bottom_buf_out[kk++]= IN(i,j); + } + MPI_Isend(bottom_buf_out, RADIUS*width,MPI_DTYPE, bottom_nbr, 101, + MPI_COMM_WORLD, &(request[2])); + } + if (my_IDy < Num_procsy-1) { + MPI_Wait(&(request[0]), &(status[0])); + MPI_Wait(&(request[1]), &(status[1])); + for (kk=0,j=jend+1; j<=jend+RADIUS; j++) for (i=istart; i<=iend; i++) { + IN(i,j) = top_buf_in[kk++]; + } + } + if (my_IDy > 0) { + MPI_Wait(&(request[2]), &(status[2])); + MPI_Wait(&(request[3]), &(status[3])); + for (kk=0,j=jstart-RADIUS; j<=jstart-1; j++) for (i=istart; i<=iend; i++) { + IN(i,j) = bottom_buf_in[kk++]; + } + } + + /* need to fetch ghost point data from neighbors in x-direction */ + if (my_IDx < Num_procsx-1) { + MPI_Irecv(right_buf_in, RADIUS*height, MPI_DTYPE, right_nbr, 1010, + MPI_COMM_WORLD, &(request[1+4])); + for (kk=0,j=jstart; j<=jend; j++) for (i=iend-RADIUS+1; i<=iend; i++) { + right_buf_out[kk++]= IN(i,j); + } + MPI_Isend(right_buf_out, RADIUS*height, MPI_DTYPE, right_nbr, 990, + MPI_COMM_WORLD, &(request[0+4])); + } + if (my_IDx > 0) { + MPI_Irecv(left_buf_in, RADIUS*height, MPI_DTYPE, left_nbr, 990, + MPI_COMM_WORLD, &(request[3+4])); + for (kk=0,j=jstart; j<=jend; j++) for (i=istart; i<=istart+RADIUS-1; i++) { + left_buf_out[kk++]= IN(i,j); + } + MPI_Isend(left_buf_out, RADIUS*height, MPI_DTYPE, left_nbr, 1010, + MPI_COMM_WORLD, &(request[2+4])); + } + if (my_IDx < Num_procsx-1) { + MPI_Wait(&(request[0+4]), &(status[0+4])); + MPI_Wait(&(request[1+4]), &(status[1+4])); + for (kk=0,j=jstart; j<=jend; j++) for (i=iend+1; i<=iend+RADIUS; i++) { + IN(i,j) = right_buf_in[kk++]; + } + } + if (my_IDx > 0) { + MPI_Wait(&(request[2+4]), &(status[2+4])); + MPI_Wait(&(request[3+4]), &(status[3+4])); + for (kk=0,j=jstart; j<=jend; j++) for (i=istart-RADIUS; i<=istart-1; i++) { + IN(i,j) = left_buf_in[kk++]; + } + } + + /* Apply the stencil operator */ + #pragma omp parallel for private (i) + for (j=MAX(jstart,RADIUS); j<=MIN(n-RADIUS-1,jend); j++) { + for (i=MAX(istart,RADIUS); i<=MIN(n-RADIUS-1,iend); i++) { + for (jj=-RADIUS; jj<=RADIUS; jj++) { + OUT(i,j) += WEIGHT(0,jj)*IN(i,j+jj); + } + for (ii=-RADIUS; ii<0; ii++) { + OUT(i,j) += WEIGHT(ii,0)*IN(i+ii,j); + } + for (ii=1; ii<=RADIUS; ii++) { + OUT(i,j) += WEIGHT(ii,0)*IN(i+ii,j); + + } + } + } + + #pragma omp parallel for private (i) + /* add constant to solution to force refresh of neighbor data, if any */ + for (j=jstart; j<=jend; j++) for (i=istart; i<=iend; i++) IN(i,j)+= 1.0; + + } + + local_stencil_time = wtime() - local_stencil_time; + MPI_Reduce(&local_stencil_time, &stencil_time, 1, MPI_DOUBLE, MPI_MAX, root, + MPI_COMM_WORLD); + + /* compute L1 norm in parallel */ + local_norm = (DTYPE) 0.0; +#pragma omp parallel for reduction(+:local_norm) private (i) + for (j=MAX(jstart,RADIUS); j<=MIN(n-RADIUS-1,jend); j++) { + for (i=MAX(istart,RADIUS); i<=MIN(n-RADIUS-1,iend); i++) { + local_norm += (DTYPE)ABS(OUT(i,j)); + } + } + + MPI_Reduce(&local_norm, &norm, 1, MPI_DTYPE, MPI_SUM, root, MPI_COMM_WORLD); + + /******************************************************************************* + ** Analyze and output results. + ********************************************************************************/ + +/* verify correctness */ + if (my_ID == root) { + norm /= f_active_points; + if (RADIUS > 0) { + reference_norm = (DTYPE) (iterations+1) * (COEFX + COEFY); + } + else { + reference_norm = (DTYPE) 0.0; + } + if (ABS(norm-reference_norm) > EPSILON) { + printf("ERROR: L1 norm = "FSTR", Reference L1 norm = "FSTR"\n", + norm, reference_norm); + error = 1; + } + else { + printf("Solution validates\n"); +#ifdef VERBOSE + printf("Reference L1 norm = "FSTR", L1 norm = "FSTR"\n", + reference_norm, norm); +#endif + } + } + bail_out(error); + + if (my_ID == root) { + /* flops/stencil: 2 flops (fma) for each point in the stencil, + plus one flop for the update of the input of the array */ + flops = (DTYPE) (2*stencil_size+1) * f_active_points; + avgtime = stencil_time/iterations; + printf("Rate (MFlops/s): "FSTR" Avg time (s): %lf\n", + 1.0E-06 * flops/avgtime, avgtime); + } + + MPI_Finalize(); + exit(EXIT_SUCCESS); +} diff --git a/tests/apps/prk/tests/MPIOPENMP/Synch_p2p/Makefile.ohpc b/tests/apps/prk/tests/MPIOPENMP/Synch_p2p/Makefile.ohpc new file mode 100644 index 0000000000..7cfe2fbb23 --- /dev/null +++ b/tests/apps/prk/tests/MPIOPENMP/Synch_p2p/Makefile.ohpc @@ -0,0 +1,31 @@ +include ../../common/MPIOPENMP.defs + +##### User configurable options ##### + +OPTFLAGS = $(DEFAULT_OPT_FLAGS) +#description: change above into something that is a decent optimization on you system + +#uncomment any of the following flags (and change values) to change defaults + +#DEBUGFLAG = -DVERBOSE +#description: default diagnostic style is silent + +SYNCHFLAG = -DSYNCHRONOUS +#description: default handshake between threads is off + +USERFLAGS = +#description: parameter to specify optional flags + +#set the following variables for custom libraries and/or other objects +EXTOBJS = +LIBS = +LIBPATHS = +INCLUDEPATHS = + +### End User configurable options ### + +TUNEFLAGS = $(DEBUGFLAG) $(USERFLAGS) $(SYNCHFLAG) +PROGRAM = p2p +OBJS = $(PROGRAM).o $(COMOBJS) + +include ../../common/make.common diff --git a/tests/apps/prk/tests/MPIOPENMP/Synch_p2p/README b/tests/apps/prk/tests/MPIOPENMP/Synch_p2p/README new file mode 100644 index 0000000000..a58865bd0c --- /dev/null +++ b/tests/apps/prk/tests/MPIOPENMP/Synch_p2p/README @@ -0,0 +1,3 @@ +Use "mpiexec.hydra -np procs -f hostfile -ppn threads ./p2p threads iters xsize ysize" +or try the run script runp2p instead. This script puts all threads of only one rank +on each node, so may be suboptimal. diff --git a/tests/apps/prk/tests/MPIOPENMP/Synch_p2p/p2p.c b/tests/apps/prk/tests/MPIOPENMP/Synch_p2p/p2p.c new file mode 100755 index 0000000000..c05f027bd3 --- /dev/null +++ b/tests/apps/prk/tests/MPIOPENMP/Synch_p2p/p2p.c @@ -0,0 +1,417 @@ +/* +Copyright (c) 2013, Intel Corporation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. +* Neither the name of Intel Corporation nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +*/ + +/******************************************************************* + +NAME: Pipeline + +PURPOSE: This program tests the efficiency with which point-to-point + synchronization can be carried out. It does so by executing + a pipelined algorithm on an m*n grid. The first array dimension + is distributed among the ranks (stripwise decomposition). + +USAGE: The program takes as input the dimensions of the grid, and the + number of times we loop over the grid + + p2p <#threads> <# iterations> + + The output consists of diagnostics to make sure the + algorithm worked, and of timing statistics. + +FUNCTIONS CALLED: + + Other than MPI or standard C functions, the following + functions are used in this program: + + wtime() + bail_out() + +HISTORY: - Written by Rob Van der Wijngaart, March 2006. + - modified by Rob Van der Wijngaart, August 2006: + * changed boundary conditions and stencil computation to avoid + overflow + * introduced multiple iterations over grid and dependency between + iterations + +**********************************************************************************/ + +#include +#include + + +/* define shorthand for flag with cache line padding */ +#define LINEWORDS 16 +#define flag(TID,j) flag[((TID)+(j)*nthread)*LINEWORDS] +#define ARRAY(i,j) vector[i+1+(j)*(segment_size+1)] +double *vector; /* array holding grid values */ + +int main(int argc, char ** argv) +{ + int my_ID; /* rank */ + int TID; /* thread ID */ + int root; + int m, n; /* grid dimensions */ + double local_pipeline_time, /* timing parameters */ + pipeline_time, + avgtime; + double epsilon = 1.e-8; /* error tolerance */ + double corner_val; /* verification value at top right corner of grid */ + int i, j, iter, ID;/* dummies */ + int iterations; /* number of times to run the pipeline algorithm */ + int start, end; /* start and end of grid slice owned by calling rank */ + int segment_size; + int *flag; /* used for pairwise synchronizations */ + int *tstart, *tend;/* starts and ends of grid slices for respective threads */ + int *tsegment_size; + int nthread; /* number of threads */ + int error=0; /* error flag */ + int Num_procs; /* Number of ranks */ + char *name; /* MPI threading mode suffix name */ + long total_length; /* total required length to store grid values */ + MPI_Status status; /* completion status of message */ + int provided; /* MPI level of thread support */ + int true, false; /* toggled booleans used for synchronization */ + +/********************************************************************************* +** Initialize the MPI environment +**********************************************************************************/ + MPI_Init_thread(&argc,&argv, MPI_THREAD_MULTIPLE, &provided); + MPI_Comm_rank(MPI_COMM_WORLD, &my_ID); + switch (provided) { + case MPI_THREAD_SERIALIZED: error=1; name="SERIALIZED"; break; + case MPI_THREAD_FUNNELED: error=1; name="FUNNELED"; break; + case MPI_THREAD_SINGLE: error=1; name="SINGLE"; break; + case MPI_THREAD_MULTIPLE: error=0; break; + default: error=1; name="UNKNOWN"; break; + } + if (error) { + if (my_ID==0) printf("ERROR: need MPI_THREAD_MULTIPLE but gets MPI_THREAD_%s\n", + name); + } + bail_out(error); + + MPI_Comm_size(MPI_COMM_WORLD, &Num_procs); + +/* we set root equal to highest rank, because this is also the rank + that reports on the verification value */ + root = Num_procs-1; + +/********************************************************************* +** process, test and broadcast input parameter +*********************************************************************/ + + if (my_ID == root){ + if (argc != 5){ + printf("Usage: %s <#threads> <#iterations> <1st array dimension> <2nd array dimension>\n", + *argv); + error = 1; + goto ENDOFTESTS; + } + + /* Take number of threads to request from command line */ + nthread = atoi(*++argv); + if ((nthread < 1) || (nthread > MAX_THREADS)) { + printf("ERROR: Invalid number of threads: %d\n", nthread); + error = 1; + goto ENDOFTESTS; + } + + iterations = atoi(*++argv); + if (iterations < 1){ + printf("ERROR: iterations must be >= 1 : %d \n",iterations); + error = 1; + goto ENDOFTESTS; + } + + m = atoi(*++argv); + n = atoi(*++argv); + if (m < 1 || n < 1){ + printf("ERROR: grid dimensions must be positive: %d, %d \n", m, n); + error = 1; + goto ENDOFTESTS; + } + + if (m0) tstart[TID] = tend[TID-1]+1; + tend[TID] = tstart[TID]+tsegment_size[TID]-1; + } + + flag = (int *) malloc(sizeof(int)*nthread*LINEWORDS*n); + if (!flag) { + printf("ERROR: Could not allocate space for synchronization flags\n"); + exit(EXIT_FAILURE); + } + +#pragma omp parallel private(i, j, iter, true, false) + { + int TID = omp_get_thread_num(); + + /* clear the array */ + for (j=0; j 0) { + MPI_Recv(&(ARRAY(start-1,j)), 1, MPI_DOUBLE, my_ID-1, j, + MPI_COMM_WORLD, &status); + } + } + else { + while (flag(TID-1,j) == false) { + #pragma omp flush + } +#ifdef SYNCHRONOUS + flag(TID-1,j)= false; + #pragma omp flush +#endif + } + + for (i=tstart[TID]; i<= tend[TID]; i++) { + ARRAY(i,j) = ARRAY(i-1,j) + ARRAY(i,j-1) - ARRAY(i-1,j-1); + } + + /* if not on right boundary, signal right neighbor it has new data */ + if (TID < nthread-1) { +#ifdef SYNCHRONOUS + while (flag(TID,j) == true) { + #pragma omp flush + } +#endif + flag(TID,j) = true; + #pragma omp flush + } + else { /* if not on the right boundary, send data to my right neighbor */ + if (my_ID < Num_procs-1) { + MPI_Send(&(ARRAY(end,j)), 1, MPI_DOUBLE, my_ID+1, j, MPI_COMM_WORLD); + } + } + } + + /* copy top right corner value to bottom left corner to create dependency */ + if (Num_procs>1) { + if (TID==nthread-1 && my_ID==root) { + corner_val = -ARRAY(end,n-1); + MPI_Send(&corner_val,1,MPI_DOUBLE,0,888,MPI_COMM_WORLD); + } + if (TID==0 && my_ID==0) { + MPI_Recv(&(ARRAY(0,0)),1,MPI_DOUBLE,root,888,MPI_COMM_WORLD,&status); + } + } + else { + if (TID==nthread-1) { /* if on right boundary, copy top right corner value + to bottom left corner to create dependency and signal completion */ + ARRAY(0,0) = -ARRAY(m-1,n-1); +#ifdef SYNCHRONOUS + while (flag(0,0) == false) { + #pragma omp flush + } + flag(0,0) = false; +#else + #pragma omp flush + flag(0,0) = true; +#endif + #pragma omp flush + } + } + + } /* end of iterations */ + } /* end of parallel section */ + + local_pipeline_time = wtime() - local_pipeline_time; + MPI_Reduce(&local_pipeline_time, &pipeline_time, 1, MPI_DOUBLE, MPI_MAX, root, + MPI_COMM_WORLD); + + /******************************************************************************* + ** Analyze and output results. + ********************************************************************************/ + + /* verify correctness, using top right value */ + corner_val = (double) ((iterations+1)*(m+n-2)); + if (my_ID == root) { + if (abs(ARRAY(end,n-1)-corner_val)/corner_val >= epsilon) { + printf("ERROR: checksum %lf does not match verification value %lf\n", + ARRAY(end,n-1), corner_val); + error = 1; + } + } + bail_out(error); + + if (my_ID == root) { + avgtime = pipeline_time/iterations; +#ifdef VERBOSE + printf("Solution validates; verification value = %lf\n", corner_val); + printf("Point-to-point synchronizations/s: %lf\n", + ((float)((n-1)*(Num_procs-1)))/(avgtime)); +#else + printf("Solution validates\n"); +#endif + printf("Rate (MFlops/s): %lf Avg time (s): %lf\n", + 1.0E-06 * 2 * ((double)((m-1)*(n-1)))/avgtime, avgtime); + } + + MPI_Finalize(); + exit(EXIT_SUCCESS); + +} /* end of main */ diff --git a/tests/apps/prk/tests/MPIOPENMP/Synch_p2p/runp2p b/tests/apps/prk/tests/MPIOPENMP/Synch_p2p/runp2p new file mode 100755 index 0000000000..901d5b075c --- /dev/null +++ b/tests/apps/prk/tests/MPIOPENMP/Synch_p2p/runp2p @@ -0,0 +1,17 @@ +if [ $# -ne 6 ]; then + echo "Usage: $0 <#mpi ranks><#threads><#iterations>" + echo "If no hostfile, use \"none\"" + exit +fi + +procs=$1 +hostfile=$2 +threads=$3 +iterations=$4 +xsize=$5 +ysize=$6 +if [ $hostfile == "none" ]; then + mpiexec.hydra -np $procs -ppn 1 ./p2p $threads $iterations $xsize $ysize +else + mpiexec.hydra -np $procs -f $hostfile -ppn 1 ./p2p $threads $iterations $xsize $ysize +fi diff --git a/tests/apps/prk/tests/MPIOPENMP/Transpose/Makefile.ohpc b/tests/apps/prk/tests/MPIOPENMP/Transpose/Makefile.ohpc new file mode 100644 index 0000000000..76913d4485 --- /dev/null +++ b/tests/apps/prk/tests/MPIOPENMP/Transpose/Makefile.ohpc @@ -0,0 +1,34 @@ +include ../../common/MPIOPENMP.defs + +##### User configurable options ##### + +OPTFLAGS = $(DEFAULT_OPT_FLAGS) +#description: change above into something that is a decent optimization on you system + +#uncomment any of the following flags (and change values) to change defaults + +#BLOCKFLAG = -DSYNCHRONOUS +#description: turn on synchronous (blocking) communications + +COLLAPSEFLAG = -DCOLLAPSE +#description: collapse outer 2 loops in case of tiling to increase concurrency + +#DEBUGFLAG = -DVERBOSE +#description: default diagnostic style is silent + +USERFLAGS = +#description: parameter to specify optional flags + +#set the following variables for custom libraries and/or other objects +EXTOBJS = +LIBS = +LIBPATHS = +INCLUDEPATHS = + +### End User configurable options ### + +TUNEFLAGS = $(BLOCKFLAG) $(DEBUGFLAG) $(USERFLAGS) $(COLLAPSEFLAG) +PROGRAM = transpose +OBJS = $(PROGRAM).o $(COMOBJS) + +include ../../common/make.common diff --git a/tests/apps/prk/tests/MPIOPENMP/Transpose/transpose.c b/tests/apps/prk/tests/MPIOPENMP/Transpose/transpose.c new file mode 100755 index 0000000000..146a8c19f3 --- /dev/null +++ b/tests/apps/prk/tests/MPIOPENMP/Transpose/transpose.c @@ -0,0 +1,431 @@ +/* +Copyright (c) 2013, Intel Corporation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. +* Neither the name of Intel Corporation nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +*/ + +/******************************************************************* + +NAME: transpose + +PURPOSE: This program tests the efficiency with which a square matrix + can be transposed and stored in another matrix. The matrices + are distributed identically. + +USAGE: Program inputs are the matrix order, the number of times to + repeat the operation, and the communication mode + + transpose <#threads> <# iterations> [tile size] + + An optional parameter specifies the tile size used to divide the + individual matrix blocks for improved cache and TLB performance. + + The output consists of diagnostics to make sure the + transpose worked and timing statistics. + +FUNCTIONS CALLED: + + Other than MPI or standard C functions, the following + functions are used in this program: + + wtime() Portable wall-timer interface. + bail_out() Determine global error and exit if nonzero. + +HISTORY: Written by Tim Mattson, April 1999. + Updated by Rob Van der Wijngaart, December 2005. + Updated by Rob Van der Wijngaart, October 2006. + Updated by Rob Van der Wijngaart, November 2014:: + - made variable names more consistent + - put timing around entire iterative loop of transposes + - fixed incorrect matrix block access; no separate function + for local transpose of matrix block + - reordered initialization and verification loops to + produce unit stride + - changed initialization values, such that the input matrix + elements are: A(i,j) = i+order*j + + +*******************************************************************/ + +/****************************************************************** + Layout nomenclature + ------------------- + +o Each rank owns one block of columns (Colblock) of the overall + matrix to be transposed, as well as of the transposed matrix. +o Colblock is stored contiguously in the memory of the rank. + The stored format is column major, which means that matrix + elements (i,j) and (i+1,j) are adjacent, and (i,j) and (i,j+1) + are "order" words apart +o Colblock is logically composed of #ranks Blocks, but a Block is + not stored contiguously in memory. Conceptually, the Block is + the unit of data that gets communicated between ranks. Block i of + rank j is locally transposed and gathered into a buffer called Work, + which is sent to rank i, where it is scattered into Block j of the + transposed matrix. +o When tiling is applied to reduce TLB misses, each block gets + accessed by tiles. +o The original and transposed matrices are called A and B + + ----------------------------------------------------------------- +| | | | | +| Colblock | | | | +| | | | | +| | | | | +| | | | | +| ------------------------------- | +| | | | | +| | Block | | | +| | | | | +| | | | | +| | | | | +| ------------------------------- | +| |Tile| | | | +| | | | | Overall Matrix | +| |---- | | | +| | | | | +| | | | | +| ------------------------------- | +| | | | | +| | | | | +| | | | | +| | | | | +| | | | | + -----------------------------------------------------------------*/ + +#include +#include + +#define A(i,j) A_p[(i+istart)+order*(j)] +#define B(i,j) B_p[(i+istart)+order*(j)] +#define Work_in(i,j) Work_in_p[i+Block_order*(j)] +#define Work_out(i,j) Work_out_p[i+Block_order*(j)] + +int main(int argc, char ** argv) +{ + int Block_order; /* number of columns owned by rank */ + int Block_size; /* size of a single block */ + int Colblock_size; /* size of column block */ + int Tile_order=32; /* default Tile order */ + int tiling; /* boolean: true if tiling is used */ + int Num_procs; /* number of ranks */ + int order; /* order of overall matrix */ + int send_to, recv_from; /* ranks with which to communicate */ + MPI_Status status; +#ifndef SYNCHRONOUS + MPI_Request send_req; + MPI_Request recv_req; +#endif + long bytes; /* combined size of matrices */ + int my_ID; /* rank */ + int root=0; /* ID of root rank */ + int iterations; /* number of times to do the transpose */ + int i, j, it, jt, istart;/* dummies */ + int iter; /* index of iteration */ + int phase; /* phase inside staged communication */ + int colstart; /* starting column for owning rank */ + int nthread_input, /* thread parameters */ + nthread; + int error; /* error flag */ + double *A_p; /* original matrix column block */ + double *B_p; /* transposed matrix column block */ + double *Work_in_p; /* workspace for the transpose function */ + double *Work_out_p; /* workspace for the transpose function */ + double abserr, /* absolute error */ + abserr_tot; /* aggregate absolute error */ + double epsilon = 1.e-8; /* error tolerance */ + double local_trans_time, /* timing parameters */ + trans_time, + avgtime; + +/********************************************************************* +** Initialize the MPI environment +*********************************************************************/ + MPI_Init(&argc,&argv); + MPI_Comm_rank(MPI_COMM_WORLD, &my_ID); + MPI_Comm_size(MPI_COMM_WORLD, &Num_procs); + +/********************************************************************* +** process, test and broadcast input parameters +*********************************************************************/ + error = 0; + if (my_ID == root) { + if (argc != 4 && argc != 5){ + printf("Usage: %s <#threads><#iterations> [Tile size]\n", + *argv); + error = 1; goto ENDOFTESTS; + } + + /* Take number of threads to request from command line */ + nthread_input = atoi(*++argv); + if ((nthread_input < 1) || (nthread_input > MAX_THREADS)) { + printf("ERROR: Invalid number of threads: %d\n", nthread_input); + error = 1; + goto ENDOFTESTS; + } + + iterations = atoi(*++argv); + if(iterations < 1){ + printf("ERROR: iterations must be >= 1 : %d \n",iterations); + error = 1; goto ENDOFTESTS; + } + + order = atoi(*++argv); + if (order < Num_procs) { + printf("ERROR: matrix order %d should at least # procs %d\n", + order, Num_procs); + error = 1; goto ENDOFTESTS; + } + if (order%Num_procs) { + printf("ERROR: matrix order %d should be divisible by # procs %d\n", + order, Num_procs); + error = 1; goto ENDOFTESTS; + } + + if (argc == 5) Tile_order = atoi(*++argv); + + ENDOFTESTS:; + } + bail_out(error); + /* Broadcast input data to all ranks */ + MPI_Bcast(&order, 1, MPI_INT, root, MPI_COMM_WORLD); + MPI_Bcast(&iterations, 1, MPI_INT, root, MPI_COMM_WORLD); + MPI_Bcast(&Tile_order, 1, MPI_INT, root, MPI_COMM_WORLD); + MPI_Bcast(&nthread_input, 1, MPI_INT, root, MPI_COMM_WORLD); + + omp_set_num_threads(nthread_input); + + /* a non-positive tile size means no tiling of the local transpose */ + tiling = (Tile_order > 0) && (Tile_order < order); + + if (my_ID == root) { + printf("MPI+OpenMP matrix transpose: B = A^T\n"); + printf("Number of ranks = %d\n", Num_procs); + printf("Number of threads = %d\n", omp_get_max_threads()); + printf("Matrix order = %d\n", order); + printf("Number of iterations = %d\n", iterations); + if (tiling) { + printf("Tile size = %d\n", Tile_order); +#ifdef COLLAPSE + printf("Using loop collapse\n"); + } +#endif + else printf("Untiled\n"); +#ifndef SYNCHRONOUS + printf("Non-"); +#endif + printf("Blocking messages\n"); + } + + bytes = 2.0 * sizeof(double) * order * order; + +/********************************************************************* +** The matrix is broken up into column blocks that are mapped one to a +** rank. Each column block is made up of Num_procs smaller square +** blocks of order block_order. +*********************************************************************/ + + Block_order = order/Num_procs; + colstart = Block_order * my_ID; + Colblock_size = order * Block_order; + Block_size = Block_order * Block_order; + +/********************************************************************* +** Create the column block of the test matrix, the row block of the +** transposed matrix, and workspace (workspace only if #procs>1) +*********************************************************************/ + A_p = (double *)malloc(Colblock_size*sizeof(double)); + if (A_p == NULL){ + printf(" Error allocating space for original matrix on node %d\n",my_ID); + error = 1; + } + bail_out(error); + + B_p = (double *)malloc(Colblock_size*sizeof(double)); + if (B_p == NULL){ + printf(" Error allocating space for transpose matrix on node %d\n",my_ID); + error = 1; + } + bail_out(error); + + if (Num_procs>1) { + Work_in_p = (double *)malloc(2*Block_size*sizeof(double)); + if (Work_in_p == NULL){ + printf(" Error allocating space for work on node %d\n",my_ID); + error = 1; + } + bail_out(error); + Work_out_p = Work_in_p + Block_size; + } + + /* Fill the original column matrix */ + istart = 0; + + if (tiling) { +#ifdef COLLAPSE + #pragma omp parallel for private (i,it,jt) collapse(2) +#else + #pragma omp parallel for private (i,it,jt) +#endif + for (j=0; j <# iterations> + + The output consists of diagnostics to make sure the + algorithm worked, and of timing statistics. + +FUNCTIONS CALLED: + + Other than MPI or standard C functions, the following + functions are used in this program: + + wtime() + bail_out() + +HISTORY: - Written by Rob Van der Wijngaart, November 2006. + - RvdW, August 2013: Removed unrolling pragmas for clarity; + fixed bug in compuation of width of strip assigned to + each rank; + - RvdW, August 2013: added constant to array "in" at end of + each iteration to force refreshing of neighbor data in + parallel versions + - RvdW, October 2014: introduced 2D domain decomposition + - RvdW, October 2014: removed barrier at start of each iteration + - RvdW, October 2014: replaced single rank/single iteration timing + with global timing of all iterations across all ranks + +*********************************************************************************/ + +#include +#include + +#ifndef RADIUS + #define RADIUS 2 +#endif + +#ifdef DOUBLE + #define DTYPE double + #define MPI_DTYPE MPI_DOUBLE + #define EPSILON 1.e-8 + #define COEFX 1.0 + #define COEFY 1.0 + #define FSTR "%lf" +#else + #define DTYPE float + #define MPI_DTYPE MPI_FLOAT + #define EPSILON 0.0001f + #define COEFX 1.0f + #define COEFY 1.0f + #define FSTR "%f" +#endif + +/* define shorthand for indexing multi-dimensional arrays with offsets */ +#define INDEXIN(i,j) (i+RADIUS+(j+RADIUS)*(width+2*RADIUS)) +/* need to add offset of RADIUS to j to account for ghost points */ +#define IN(i,j) in[INDEXIN(i-istart,j-jstart)] +#define INDEXOUT(i,j) (i+(j)*(width)) +#define OUT(i,j) out[INDEXOUT(i-istart,j-jstart)] +#define WEIGHT(ii,jj) weight[ii+RADIUS][jj+RADIUS] + +int main(int argc, char ** argv) { + + int Num_procs; /* number of ranks */ + int Num_procsx, Num_procsy; /* number of ranks in each coord direction */ + int my_ID; /* MPI rank */ + int my_IDx, my_IDy; /* coordinates of rank in rank grid */ + int right_nbr; /* global rank of right neighboring tile */ + int left_nbr; /* global rank of left neighboring tile */ + int top_nbr; /* global rank of top neighboring tile */ + int bottom_nbr; /* global rank of bottom neighboring tile */ + DTYPE *top_buf_out; /* communication buffer */ + DTYPE *top_buf_in; /* " " */ + DTYPE *bottom_buf_out; /* " " */ + DTYPE *bottom_buf_in; /* " " */ + DTYPE *right_buf_out; /* " " */ + DTYPE *right_buf_in; /* " " */ + DTYPE *left_buf_out; /* " " */ + DTYPE *left_buf_in; /* " " */ + int root = 0; + int n, width, height;/* linear global and local grid dimension */ + int i, j, ii, jj, kk, it, jt, iter, leftover; /* dummies */ + int istart, iend; /* bounds of grid tile assigned to calling rank */ + int jstart, jend; /* bounds of grid tile assigned to calling rank */ + DTYPE norm, /* L1 norm of solution */ + local_norm, /* contribution of calling rank to L1 norm */ + reference_norm; + DTYPE f_active_points; /* interior of grid with respect to stencil */ + DTYPE flops; /* floating point ops per iteration */ + int iterations; /* number of times to run the algorithm */ + double local_stencil_time,/* timing parameters */ + stencil_time, + avgtime; + int stencil_size; /* number of points in stencil */ + DTYPE * RESTRICT in; /* input grid values */ + DTYPE * RESTRICT out; /* output grid values */ + long total_length_in; /* total required length to store input array */ + long total_length_out;/* total required length to store output array */ + int error=0; /* error flag */ + DTYPE weight[2*RADIUS+1][2*RADIUS+1]; /* weights of points in the stencil */ + MPI_Request request[8]; + MPI_Status status[8]; + MPI_Win rma_winx; /* RMA window object x-direction */ + MPI_Win rma_winy; /* RMA window object y-direction */ + MPI_Info rma_winfo; /* info for window */ + + /******************************************************************************* + ** Initialize the MPI environment + ********************************************************************************/ + MPI_Init(&argc,&argv); + MPI_Comm_rank(MPI_COMM_WORLD, &my_ID); + MPI_Comm_size(MPI_COMM_WORLD, &Num_procs); + + /******************************************************************************* + ** process, test, and broadcast input parameters + ********************************************************************************/ + + if (my_ID == root) { +#ifndef STAR + printf("ERROR: Compact stencil not supported\n"); + error = 1; + goto ENDOFTESTS; +#endif + + if (argc != 3){ + printf("Usage: %s <# iterations> \n", + *argv); + error = 1; + goto ENDOFTESTS; + } + + iterations = atoi(*++argv); + if (iterations < 1){ + printf("ERROR: iterations must be >= 1 : %d \n",iterations); + error = 1; + goto ENDOFTESTS; + } + + n = atoi(*++argv); + long nsquare = n * n; + if (nsquare < Num_procs){ + printf("ERROR: grid size must be at least # ranks: %ld\n", nsquare); + error = 1; + goto ENDOFTESTS; + } + + if (RADIUS < 0) { + printf("ERROR: Stencil radius %d should be non-negative\n", RADIUS); + error = 1; + goto ENDOFTESTS; + } + + if (2*RADIUS +1 > n) { + printf("ERROR: Stencil radius %d exceeds grid size %d\n", RADIUS, n); + error = 1; + goto ENDOFTESTS; + } + + ENDOFTESTS:; + } + bail_out(error); + + /* determine best way to create a 2D grid of ranks (closest to square, for + best surface/volume ratio); we do this brute force for now + */ + for (Num_procsx=(int) (sqrt(Num_procs+1)); Num_procsx>0; Num_procsx--) { + if (!(Num_procs%Num_procsx)) { + Num_procsy = Num_procs/Num_procsx; + break; + } + } + my_IDx = my_ID%Num_procsx; + my_IDy = my_ID/Num_procsx; + /* compute neighbors; don't worry about dropping off the edges of the grid */ + right_nbr = my_ID+1; + left_nbr = my_ID-1; + top_nbr = my_ID+Num_procsx; + bottom_nbr = my_ID-Num_procsx; + + if (my_ID == root) { + printf("MPIRMA stencil execution on 2D grid\n"); + printf("Number of ranks = %d\n", Num_procs); + printf("Grid size = %d\n", n); + printf("Radius of stencil = %d\n", RADIUS); + printf("Tiles in x/y-direction = %d/%d\n", Num_procsx, Num_procsy); + printf("Type of stencil = star\n"); +#ifdef DOUBLE + printf("Data type = double precision\n"); +#else + printf("Data type = single precision\n"); +#endif + printf("Number of iterations = %d\n", iterations); + } + + MPI_Bcast(&n, 1, MPI_INT, root, MPI_COMM_WORLD); + MPI_Bcast(&iterations, 1, MPI_INT, root, MPI_COMM_WORLD); + + /* compute amount of space required for input and solution arrays */ + + width = n/Num_procsx; + leftover = n%Num_procsx; + if (my_IDx 0) { + for (kk=0,j=jstart; j<=jstart+RADIUS-1; j++) for (i=istart; i<=iend; i++) { + bottom_buf_out[kk++]= IN(i,j); + } + MPI_Put(bottom_buf_out, RADIUS*width, MPI_DTYPE, bottom_nbr, + RADIUS*width, RADIUS*width, MPI_DTYPE, rma_winy); + } + MPI_Win_fence(0, rma_winy); + if (my_IDy < Num_procsy-1) { + for (kk=0,j=jend; j<=jend+RADIUS-1; j++) for (i=istart; i<=iend; i++) { + IN(i,j) = top_buf_in[kk++]; + } + } + if (my_IDy > 0) { + for (kk=0,j=jstart-RADIUS; j<=jstart-1; j++) for (i=istart; i<=iend; i++) { + IN(i,j) = bottom_buf_in[kk++]; + } + } + + /* need to fetch ghost point data from neighbors in x-direction */ + MPI_Win_fence(0, rma_winx); + if (my_IDx < Num_procsx-1) { + for (kk=0,j=jstart; j<=jend; j++) for (i=iend-RADIUS; i<=iend-1; i++) { + right_buf_out[kk++]= IN(i,j); + } + MPI_Put(right_buf_out, RADIUS*height, MPI_DTYPE, right_nbr, + 3*RADIUS*height, RADIUS*height, MPI_DTYPE, rma_winx); + } + if (my_IDx > 0) { + for (kk=0,j=jstart; j<=jend; j++) for (i=istart; i<=istart+RADIUS-1; i++) { + left_buf_out[kk++]= IN(i,j); + } + MPI_Put(left_buf_out, RADIUS*height, MPI_DTYPE, left_nbr, + RADIUS*height, RADIUS*height, MPI_DTYPE, rma_winx); + } + MPI_Win_fence(0, rma_winx); + if (my_IDx < Num_procsx-1) { + for (kk=0,j=jstart; j<=jend; j++) for (i=iend; i<=iend+RADIUS-1; i++) { + IN(i,j) = right_buf_in[kk++]; + } + } + if (my_IDx > 0) { + for (kk=0,j=jstart; j<=jend; j++) for (i=istart-RADIUS; i<=istart-1; i++) { + IN(i,j) = left_buf_in[kk++]; + } + } + + /* Apply the stencil operator */ + for (j=MAX(jstart,RADIUS); j 0) { + reference_norm = (DTYPE) (iterations+1) * (COEFX + COEFY); + } + else { + reference_norm = (DTYPE) 0.0; + } + if (ABS(norm-reference_norm) > EPSILON) { + printf("ERROR: L1 norm = "FSTR", Reference L1 norm = "FSTR"\n", + norm, reference_norm); + error = 1; + } + else { + printf("Solution validates\n"); +#ifdef VERBOSE + printf("Reference L1 norm = "FSTR", L1 norm = "FSTR"\n", + reference_norm, norm); +#endif + } + } + bail_out(error); + + if (my_ID == root) { + /* flops/stencil: 2 flops (fma) for each point in the stencil, + plus one flop for the update of the input of the array */ + flops = (DTYPE) (2*stencil_size+1) * f_active_points; + avgtime = stencil_time/iterations; + printf("Rate (MFlops/s): "FSTR" Avg time (s): %lf\n", + 1.0E-06 * flops/avgtime, avgtime); + } + + MPI_Win_free(&rma_winx); + MPI_Win_free(&rma_winy); + + MPI_Info_free(&rma_winfo); + + MPI_Finalize(); + exit(EXIT_SUCCESS); +} diff --git a/tests/apps/prk/tests/MPIRMA/Synch_p2p/Makefile.ohpc b/tests/apps/prk/tests/MPIRMA/Synch_p2p/Makefile.ohpc new file mode 100644 index 0000000000..7eb324a307 --- /dev/null +++ b/tests/apps/prk/tests/MPIRMA/Synch_p2p/Makefile.ohpc @@ -0,0 +1,28 @@ +include ../../common/MPI.defs +##### User configurable options ##### + +OPTFLAGS = $(DEFAULT_OPT_FLAGS) +#description: change above into something that is a decent optimization on you system + +#uncomment any of the following flags (and change values) to change defaults + +#DEBUGFLAG = -DVERBOSE +#description: default diagnostic style is silent + +USERFLAGS = +#description: parameter to specify optional flags + +#set the following variables for custom libraries and/or other objects + +EXTOBJS = +LIBS = +LIBPATHS = +INCLUDEPATHS = + +### End User configurable options ### + +TUNEFLAGS = $(DEBUGFLAG) $(USERFLAGS) +PROGRAM = p2p +OBJS = $(PROGRAM).o $(COMOBJS) + +include ../../common/make.common diff --git a/tests/apps/prk/tests/MPIRMA/Synch_p2p/p2p.c b/tests/apps/prk/tests/MPIRMA/Synch_p2p/p2p.c new file mode 100755 index 0000000000..6ced1bff6f --- /dev/null +++ b/tests/apps/prk/tests/MPIRMA/Synch_p2p/p2p.c @@ -0,0 +1,323 @@ +/* +Copyright (c) 2013, Intel Corporation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. +* Neither the name of Intel Corporation nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +*/ + +/******************************************************************* + +NAME: Pipeline + +PURPOSE: This program tests the efficiency with which point-to-point + synchronization can be carried out. It does so by executing + a pipelined algorithm on an m*n grid. The first array dimension + is distributed among the ranks (stripwise decomposition). + +USAGE: The program takes as input the dimensions of the grid, and the + number of times we loop over the grid + + <# iterations> + + The output consists of diagnostics to make sure the + algorithm worked, and of timing statistics. + +FUNCTIONS CALLED: + + Other than MPI or standard C functions, the following + functions are used in this program: + + wtime() + bail_out() + +HISTORY: - Written by Rob Van der Wijngaart, March 2006. + - modified by Rob Van der Wijngaart, August 2006: + * changed boundary conditions and stencil computation to avoid + overflow + * introduced multiple iterations over grid and dependency between + iterations + +**********************************************************************************/ + +#include +#include + +#define ARRAY(i,j) vector[i+1+(j)*(segment_size+1)] +#define NBR_INDEX(i,j) (i+(j)*(nbr_segment_size+1)) + +int main(int argc, char ** argv) +{ + int my_ID; /* rank */ + int root; + int m, n; /* grid dimensions */ + double local_pipeline_time, /* timing parameters */ + pipeline_time, + avgtime; + double epsilon = 1.e-8; /* error tolerance */ + double corner_val; /* verification value at top right corner of grid */ + int i, j, iter, ID;/* dummies */ + int iterations; /* number of times to run the pipeline algorithm */ + int *start, *end; /* starts and ends of grid slices */ + int segment_size; + int error=0; /* error flag */ + int Num_procs; /* Number of ranks */ + double *vector; /* array holding grid values */ + long total_length; /* total required length to store grid values */ + MPI_Status status; /* completion status of message */ + MPI_Win rma_win; /* RMA window object */ + MPI_Info rma_winfo; /* info for window */ + MPI_Group world_group, origin_group, target_group; + int origin_ranks[1], target_ranks[1]; + int nbr_segment_size; + +/********************************************************************************* +** Initialize the MPI environment +**********************************************************************************/ + MPI_Init(&argc,&argv); + MPI_Comm_rank(MPI_COMM_WORLD, &my_ID); + MPI_Comm_size(MPI_COMM_WORLD, &Num_procs); + +/* we set root equal to highest rank, because this is also the rank that reports + on the verification value */ + root = Num_procs-1; + +/********************************************************************* +** process, test and broadcast input parameter +*********************************************************************/ + + if (my_ID == root){ + if (argc != 4){ + printf("Usage: %s <#iterations> <1st array dimension> <2nd array dimension>\n", + *argv); + error = 1; + goto ENDOFTESTS; + } + + iterations = atoi(*++argv); + if (iterations < 1){ + printf("ERROR: iterations must be >= 1 : %d \n",iterations); + error = 1; + goto ENDOFTESTS; + } + + m = atoi(*++argv); + n = atoi(*++argv); + if (m < 1 || n < 1){ + printf("ERROR: grid dimensions must be positive: %d, %d \n", m, n); + error = 1; + goto ENDOFTESTS; + } + + if (m0) start[ID] = end[ID-1]+1; + end[ID] = start[ID]+segment_size-1; + } + + /* now set segment_size to the value needed by the calling rank */ + segment_size = end[my_ID] - start[my_ID] + 1; + + /* RMA win info */ + MPI_Info_create(&rma_winfo); + /* This key indicates that passive target RMA will not be used. + * It is the one info key that MPICH actually uses for optimization. */ + MPI_Info_set(rma_winfo, "no_locks", "true"); + + /* total_length takes into account one ghost cell on left side of segment */ + total_length = ((end[my_ID]-start[my_ID]+1)+1)*n; + + MPI_Win_allocate(total_length*sizeof(double), sizeof(double), rma_winfo, + MPI_COMM_WORLD, (void *) &vector, &rma_win); + if (vector == NULL) { + printf("Could not allocate space for grid slice of %d by %d points", + segment_size, n); + printf(" on rank %d\n", my_ID); + error = 1; + } + bail_out(error); + + /* clear the array */ + for (j=0; j 0) + origin_ranks[0] = my_ID-1; + else + origin_ranks[0] = Num_procs-1; + MPI_Group_incl(world_group, 1, origin_ranks, &origin_group); + + /* Set neighbor segment size */ + if (my_ID != Num_procs-1) + nbr_segment_size = end[my_ID+1] - start[my_ID+1] + 1; + else + nbr_segment_size = end[0] - start[0] + 1; + + for (iter=0; iter<=iterations; iter++) { + + /* start timer after a warmup iteration */ + if (iter == 1) { + MPI_Barrier(MPI_COMM_WORLD); + local_pipeline_time = wtime(); + } + + /* execute pipeline algorithm for grid lines 1 through n-1 (skip bottom line) */ + for (j=1; j 0) { + /* Exposure epoch at target*/ + MPI_Win_post(origin_group, MPI_MODE_NOSTORE, rma_win); + MPI_Win_wait(rma_win); + } + + for (i=start[my_ID]; i<= end[my_ID]; i++) { + ARRAY(i,j) = ARRAY(i-1,j) + ARRAY(i,j-1) - ARRAY(i-1,j-1); + } + + /* if I am not on the right boundary, send data to my right neighbor */ + if (my_ID != Num_procs-1) { + /* Access epoch at origin */ + MPI_Win_start(target_group, 0, rma_win); + MPI_Put(&(ARRAY(end[my_ID],j)), 1, MPI_DOUBLE, my_ID+1, + NBR_INDEX(0,j), 1, MPI_DOUBLE, rma_win); + MPI_Win_complete(rma_win); + } + } + + /* copy top right corner value to bottom left corner to create dependency */ + if (Num_procs >1) { + if (my_ID==root) { + corner_val = -ARRAY(end[my_ID],n-1); + MPI_Win_start(target_group, 0, rma_win); + MPI_Put(&corner_val, 1, MPI_DOUBLE, 0, + NBR_INDEX(1,0), 1, MPI_DOUBLE, rma_win); + MPI_Win_complete(rma_win); + } + if (my_ID==0) { + MPI_Win_post(origin_group, MPI_MODE_NOSTORE, rma_win); + MPI_Win_wait(rma_win); + } + } + else ARRAY(0,0)= -ARRAY(end[my_ID],n-1); + + } + + local_pipeline_time = wtime() - local_pipeline_time; + MPI_Reduce(&local_pipeline_time, &pipeline_time, 1, MPI_DOUBLE, MPI_MAX, root, + MPI_COMM_WORLD); + + /******************************************************************************* + ** Analyze and output results. + ********************************************************************************/ + + /* verify correctness, using top right value */ + corner_val = (double) ((iterations+1)*(m+n-2)); + if (my_ID == root) { + if (abs(ARRAY(end[my_ID],n-1)-corner_val)/corner_val >= epsilon) { + printf("ERROR: checksum %lf does not match verification value %lf\n", + ARRAY(end[my_ID],n-1), corner_val); + error = 1; + } + } + bail_out(error); + + if (my_ID == root) { + avgtime = pipeline_time/iterations; +#ifdef VERBOSE + printf("Solution validates; verification value = %lf\n", corner_val); + printf("Point-to-point synchronizations/s: %lf\n", + ((float)((n-1)*(Num_procs-1)))/(avgtime)); +#else + printf("Solution validates\n"); +#endif + printf("Rate (MFlops/s): %lf, Avg time (s): %lf\n", + 1.0E-06 * 2 * ((double)((m-1)*(n-1)))/avgtime, avgtime); + } + + MPI_Win_free(&rma_win); + MPI_Info_free(&rma_winfo); + + MPI_Finalize(); + exit(EXIT_SUCCESS); + +} /* end of main */ + diff --git a/tests/apps/prk/tests/MPISHM/Stencil/Makefile.ohpc b/tests/apps/prk/tests/MPISHM/Stencil/Makefile.ohpc new file mode 100644 index 0000000000..63a82734dd --- /dev/null +++ b/tests/apps/prk/tests/MPISHM/Stencil/Makefile.ohpc @@ -0,0 +1,41 @@ +include ../../common/MPI.defs +##### User configurable options ##### + +OPTFLAGS = $(DEFAULT_OPT_FLAGS) +#description: change above into something that is a decent optimization on you system + +#uncomment any of the following flags (and change values) to change defaults + +#RESTRICTFLAG = -DRESTRICT_KEYWORD +#description: the "restrict" keyword can be used on IA platforms to disambiguate +# data accessed through pointers + +#RADIUSFLAG = -DRADIUS=R +#description: default radius of filter to be applied is 2 + +DOUBLEFLAG = -DDOUBLE +#description: default data type is single precision + +STARFLAG = -DSTAR +#description: default stencil is compact (dense, square) + +#DEBUGFLAG = -DVERBOSE +#description: default diagnostic style is silent + +USERFLAGS = +#description: parameter to specify optional flags + +#set the following variables for custom libraries and/or other objects +EXTOBJS = +LIBS = -lm +LIBPATHS = +INCLUDEPATHS = + +### End User configurable options ### + +TUNEFLAGS = $(RESTRICTFLAG) $(DEBUGFLAG) $(USERFLAGS) \ + $(DOUBLEFLAG) $(RADIUSFLAG) $(STARFLAG) +PROGRAM = stencil +OBJS = $(PROGRAM).o $(COMOBJS) + +include ../../common/make.common diff --git a/tests/apps/prk/tests/MPISHM/Stencil/stencil.c b/tests/apps/prk/tests/MPISHM/Stencil/stencil.c new file mode 100755 index 0000000000..09bad2af63 --- /dev/null +++ b/tests/apps/prk/tests/MPISHM/Stencil/stencil.c @@ -0,0 +1,690 @@ +/* +Copyright (c) 2013, Intel Corporation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. +* Neither the name of Intel Corporation nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +*/ + +/******************************************************************* + +NAME: Stencil + +PURPOSE: This program tests the efficiency with which a space-invariant, + linear, symmetric filter (stencil) can be applied to a square + grid or image. + +USAGE: The program takes as input the linear dimension of the grid, + and the number of iterations on the grid + + <# iterations> + + The output consists of diagnostics to make sure the + algorithm worked, and of timing statistics. + +FUNCTIONS CALLED: + + Other than MPI or standard C functions, the following + functions are used in this program: + + wtime() + bail_out() + +HISTORY: - Written by Rob Van der Wijngaart, November 2006. + - RvdW, August 2013: Removed unrolling pragmas for clarity; + fixed bug in compuation of width of strip assigned to + each rank; + - RvdW, August 2013: added constant to array "in" at end of + each iteration to force refreshing of neighbor data in + parallel versions + - RvdW, October 2014: introduced 2D domain decomposition + - RvdW, October 2014: removed barrier at start of each iteration + - RvdW, October 2014: replaced single rank/single iteration timing + with global timing of all iterations across all ranks + +*********************************************************************************/ + +#include +#include + +/********************************************************************************** + Strategy for hierarchical decomposition of grid. + Give a total number of Num_procs ranks and coherence domains of group_size ranks. + The grid is divided into Num_procs/group_size contiguous groups of group_size + tiles each (a "block"). + Each tile is assigned to a rank. Ranks within a block are contiguous within + MPI_COMM_WORLD, so that contiguous groups of ranks span a single coherence + domain. + Given Num_procs ranks, factor Num_procs into two integers Num_procsx and + Num_procsy that are as close together as possible. That is the division of tiles + within the grid. The tiles are now assigned to groups that lie within the same + coherence domain. Let group_size be factored into two integers group_sizex and + group_sizey. The number of groups Num_groups equals Num_procs/group_size. + Nomenclature: + group: sequence number of block within the grid (ordered lexicographically) + Num_groupsx: number of blocks in the x-direction + Num_groupsy: number of blocks in the y-direction + groupx: x-coordinate of block + groupy: y-coordinate of block + my_local_ID: sequence number of tile within block (ordered lexicographically) + my_local_IDx: x-coordinate of tile within block + my_local_IDy: y-coordinate of tile within block + my_global_IDx: x-coordinate of tile within overall grid + my_global_IDy: y-coordinate of tile within overall grid + + Example: Num_procs=24, group_size=4 + Num_groups = 6, Num_procsx=4, Num_procsy=6, group_sizex=2, group_sizey=2, + Num_groupsx=2, Num_groupsy=3 + Ranks (double lines indicate block boundaries): + + ------------------------------------ + | | || | | + | 18 | 19 || 22 | 23 | + | | || | | + ------------------------------------ + | | || | | + | 16 | 17 || 20 | 21 | + | | || | | + ------------------------------------ + ------------------------------------ + | | || | | + | 10 | 11 || 14 | 15 | + | | || | | + ------------------------------------ + | | || | | + | 8 | 9 || 12 | 13 | + | | || | | + ------------------------------------ + ------------------------------------ + | | || | | + | 2 | 3 || 6 | 7 | + | | || | | + ------------------------------------ + | | || | | + | 0 | 1 || 4 | 5 | + | | || | | + ------------------------------------ + +*********************************************************************************/ + +#ifndef RADIUS + #define RADIUS 2 +#endif + +#ifdef DOUBLE + #define DTYPE double + #define MPI_DTYPE MPI_DOUBLE + #define EPSILON 1.e-8 + #define COEFX 1.0 + #define COEFY 1.0 + #define FSTR "%15.10lf" +#else + #define DTYPE float + #define MPI_DTYPE MPI_FLOAT + #define EPSILON 0.0001f + #define COEFX 1.0f + #define COEFY 1.0f + #define FSTR "%15.10f" +#endif + +/* define shorthand for indexing multi-dimensional arrays with offsets */ +#define INDEXIN(i,j) (i+RADIUS+(j+RADIUS)*(width+2*RADIUS)) +/* need to add offset of RADIUS to j to account for ghost points */ +#define IN(i,j) in[INDEXIN(i-istart,j-jstart)] +#define INDEXOUT(i,j) (i+(j)*(width)) +#define OUT(i,j) out[INDEXOUT(i-istart,j-jstart)] +#define WEIGHT(ii,jj) weight[ii+RADIUS][jj+RADIUS] + +int main(int argc, char ** argv) { + + int Num_procs; /* number of ranks */ + int Num_procsx, + Num_procsy; /* number of ranks in each coord direction */ + int Num_groupsx, + Num_groupsy; /* number of blocks in each coord direction */ + int my_group; /* sequence number of shared memory block */ + int my_group_IDx, + my_group_IDy; /* coordinates of block within block grid */ + int group_size; /* number of ranks in shared memory group */ + int group_sizex, + group_sizey; /* number of ranks in block in each coord direction */ + int my_ID; /* MPI rank */ + int my_global_IDx, + my_global_IDy; /* coordinates of rank in overall rank grid */ + int my_local_IDx, + my_local_IDy; /* coordinates of rank within shared memory block */ + int right_nbr; /* global rank of right neighboring tile */ + int left_nbr; /* global rank of left neighboring tile */ + int top_nbr; /* global rank of top neighboring tile */ + int bottom_nbr; /* global rank of bottom neighboring tile */ + DTYPE *top_buf_out; /* communication buffer */ + DTYPE *top_buf_in; /* " " */ + DTYPE *bottom_buf_out; /* " " */ + DTYPE *bottom_buf_in; /* " " */ + DTYPE *right_buf_out; /* " " */ + DTYPE *right_buf_in; /* " " */ + DTYPE *left_buf_out; /* " " */ + DTYPE *left_buf_in; /* " " */ + int root = 0; + int n, width, height;/* linear global and block grid dimension */ + int width_rank, + height_rank; /* linear local dimension */ + int i, j, ii, jj, kk, it, jt, iter, leftover; /* dummies */ + int istart_rank, + iend_rank; /* bounds of grid tile assigned to calling rank */ + int jstart_rank, + jend_rank; /* bounds of grid tile assigned to calling rank */ + int istart, iend; /* bounds of grid block containing tile */ + int jstart, jend; /* bounds of grid block containing tile */ + DTYPE norm, /* L1 norm of solution */ + local_norm, /* contribution of calling rank to L1 norm */ + reference_norm; /* value to be matched by computed norm */ + DTYPE f_active_points; /* interior of grid with respect to stencil */ + DTYPE flops; /* floating point ops per iteration */ + int iterations; /* number of times to run the algorithm */ + double local_stencil_time,/* timing parameters */ + stencil_time, + avgtime; + int stencil_size; /* number of points in stencil */ + DTYPE * RESTRICT in; /* input grid values */ + DTYPE * RESTRICT out; /* output grid values */ + long total_length_in; /* total required length to store input array */ + long total_length_out;/* total required length to store output array */ + int error=0; /* error flag */ + DTYPE weight[2*RADIUS+1][2*RADIUS+1]; /* weights of points in the stencil */ + MPI_Request request[8]; /* requests for sends & receives in 4 coord directions */ + MPI_Status status[8]; /* corresponding statuses */ + MPI_Win shm_win_in; /* shared memory window object for IN array */ + MPI_Win shm_win_out; /* shared memory window object for OUT array */ + MPI_Comm shm_comm_prep; /* preparatory shared memory communicator */ + MPI_Comm shm_comm; /* Shared Memory Communicator */ + int shm_procs; /* # of rankes in shared domain */ + int shm_ID; /* MPI rank in shared memory domain */ + MPI_Aint size_in; /* size of the IN array in shared memory window */ + MPI_Aint size_out; /* size of the OUT array in shared memory window */ + int size_mul; /* one for shm_comm root, zero for the other ranks */ + int disp_unit; /* ignored */ + + /******************************************************************************* + ** Initialize the MPI environment + ********************************************************************************/ + MPI_Init(&argc,&argv); + MPI_Comm_rank(MPI_COMM_WORLD, &my_ID); + MPI_Comm_size(MPI_COMM_WORLD, &Num_procs); + + /******************************************************************************* + ** process, test, and broadcast input parameters + ********************************************************************************/ + + if (my_ID == root) { +#ifndef STAR + printf("ERROR: Compact stencil not supported\n"); + error = 1; + goto ENDOFTESTS; +#endif + + if (argc != 4){ + printf("Usage: %s <#ranks per coherence domain><# iterations> \n", + *argv); + error = 1; + goto ENDOFTESTS; + } + + group_size = atoi(*++argv); + if (group_size < 1) { + printf("ERROR: # ranks per coherence domain must be >= 1 : %d \n",group_size); + error = 1; + goto ENDOFTESTS; + } + if (Num_procs%group_size) { + printf("ERROR: total # %d ranks not divisible by ranks per coherence domain %d\n", + Num_procs, group_size); + error = 1; + goto ENDOFTESTS; + } + + iterations = atoi(*++argv); + if (iterations < 0){ + printf("ERROR: iterations must be >= 0 : %d \n",iterations); + error = 1; + goto ENDOFTESTS; + } + + n = atoi(*++argv); + long nsquare = n * n; + if (nsquare < Num_procs){ + printf("ERROR: grid size must be at least # ranks: %ld\n", nsquare); + error = 1; + goto ENDOFTESTS; + } + + if (RADIUS < 0) { + printf("ERROR: Stencil radius %d should be non-negative\n", RADIUS); + error = 1; + goto ENDOFTESTS; + } + + if (2*RADIUS +1 > n) { + printf("ERROR: Stencil radius %d exceeds grid size %d\n", RADIUS, n); + error = 1; + goto ENDOFTESTS; + } + + ENDOFTESTS:; + } + bail_out(error); + + MPI_Bcast(&n, 1, MPI_INT, root, MPI_COMM_WORLD); + MPI_Bcast(&iterations, 1, MPI_INT, root, MPI_COMM_WORLD); + MPI_Bcast(&group_size, 1, MPI_INT, root, MPI_COMM_WORLD); + + /* determine best way to create a 2D grid of ranks (closest to square, for + best surface/volume ratio); we do this brute force for now. The + decomposition needs to be such that shared memory groups can evenly + tessellate the rank grid + */ + for (Num_procsx=(int) (sqrt(Num_procs+1)); Num_procsx>0; Num_procsx--) { + if (!(Num_procs%Num_procsx)) { + Num_procsy = Num_procs/Num_procsx; + for (group_sizex=(int)(sqrt(group_size+1)); group_sizex>0; group_sizex--) { + if (!(group_size%group_sizex) && !(Num_procsx%group_sizex)) { + group_sizey=group_size/group_sizex; + break; + } + } + if (!(Num_procsy%group_sizey)) break; + } + } + + + if (my_ID == root) { + printf("MPI+SHM stencil execution on 2D grid\n"); + printf("Number of ranks = %d\n", Num_procs); + printf("Grid size = %d\n", n); + printf("Radius of stencil = %d\n", RADIUS); + printf("Tiles in x/y-direction = %d/%d\n", Num_procsx, Num_procsy); + printf("Tiles per shared memory domain = %d\n", group_size); + printf("Tiles in x/y-direction in group = %d/%d\n", group_sizex, group_sizey); + printf("Type of stencil = star\n"); +#ifdef DOUBLE + printf("Data type = double precision\n"); +#else + printf("Data type = single precision\n"); +#endif + printf("Number of iterations = %d\n", iterations); + } + + /* Setup for Shared memory regions */ + + /* first divide WORLD in groups of size group_size */ + MPI_Comm_split(MPI_COMM_WORLD, my_ID/group_size, my_ID%group_size, &shm_comm_prep); + /* derive from that a SHM communicator */ + MPI_Comm_split_type(shm_comm_prep, MPI_COMM_TYPE_SHARED, 0, MPI_INFO_NULL, &shm_comm); + MPI_Comm_rank(shm_comm, &shm_ID); + MPI_Comm_size(shm_comm, &shm_procs); + /* do sanity check, making sure groups did not shrink in second comm split */ + if (shm_procs != group_size) MPI_Abort(MPI_COMM_WORLD, 666); + + Num_groupsx = Num_procsx/group_sizex; + Num_groupsy = Num_procsy/group_sizey; + + my_group = my_ID/group_size; + my_group_IDx = my_group%Num_groupsx; + my_group_IDy = my_group/Num_groupsx; + my_local_IDx = my_ID%group_sizex; + my_local_IDy = (my_ID%group_size)/group_sizex; + my_global_IDx = my_group_IDx*group_sizex+my_local_IDx; + my_global_IDy = my_group_IDy*group_sizey+my_local_IDy; + + /* set all neighboring ranks to -1 (no communication with other coherence domain) */ + left_nbr = right_nbr = top_nbr = bottom_nbr = -1; + + if (my_local_IDx == group_sizex-1 && my_group_IDx != (Num_groupsx-1)) { + right_nbr = (my_group+1)*group_size+shm_ID-group_sizex+1; + } + + if (my_local_IDx == 0 && my_group_IDx != 0) { + left_nbr = (my_group-1)*group_size+shm_ID+group_sizex-1; + } + + if (my_local_IDy == group_sizey-1 && my_group_IDy != (Num_groupsy-1)) { + top_nbr = (my_group+Num_groupsx)*group_size + my_local_IDx; + } + + if (my_local_IDy == 0 && my_group_IDy != 0) { + bottom_nbr = (my_group-Num_groupsx)*group_size + group_sizex*(group_sizey-1)+my_local_IDx; + } + + /* compute amount of space required for input and solution arrays for the block, + and also compute index sets */ + + width = n/Num_groupsx; + leftover = n%Num_groupsx; + if (my_group_IDx 0) { + reference_norm = (DTYPE) (iterations+1) * (COEFX + COEFY); + } + else { + reference_norm = (DTYPE) 0.0; + } + if (ABS(norm-reference_norm) > EPSILON) { + printf("ERROR: L1 norm = "FSTR", Reference L1 norm = "FSTR"\n", + norm, reference_norm); + error = 1; + } + else { + printf("Solution validates\n"); +#ifdef VERBOSE + printf("Reference L1 norm = "FSTR", L1 norm = "FSTR"\n", + reference_norm, norm); +#endif + } + } + bail_out(error); + + if (my_ID == root) { + /* flops/stencil: 2 flops (fma) for each point in the stencil, + plus one flop for the update of the input of the array */ + flops = (DTYPE) (2*stencil_size+1) * f_active_points; + avgtime = stencil_time/iterations; + printf("Rate (MFlops/s): "FSTR" Avg time (s): %lf\n", + 1.0E-06 * flops/avgtime, avgtime); + } + + MPI_Finalize(); + exit(EXIT_SUCCESS); +} diff --git a/tests/apps/prk/tests/MPISHM/Synch_p2p/Makefile.ohpc b/tests/apps/prk/tests/MPISHM/Synch_p2p/Makefile.ohpc new file mode 100644 index 0000000000..7eb324a307 --- /dev/null +++ b/tests/apps/prk/tests/MPISHM/Synch_p2p/Makefile.ohpc @@ -0,0 +1,28 @@ +include ../../common/MPI.defs +##### User configurable options ##### + +OPTFLAGS = $(DEFAULT_OPT_FLAGS) +#description: change above into something that is a decent optimization on you system + +#uncomment any of the following flags (and change values) to change defaults + +#DEBUGFLAG = -DVERBOSE +#description: default diagnostic style is silent + +USERFLAGS = +#description: parameter to specify optional flags + +#set the following variables for custom libraries and/or other objects + +EXTOBJS = +LIBS = +LIBPATHS = +INCLUDEPATHS = + +### End User configurable options ### + +TUNEFLAGS = $(DEBUGFLAG) $(USERFLAGS) +PROGRAM = p2p +OBJS = $(PROGRAM).o $(COMOBJS) + +include ../../common/make.common diff --git a/tests/apps/prk/tests/MPISHM/Synch_p2p/p2p.c b/tests/apps/prk/tests/MPISHM/Synch_p2p/p2p.c new file mode 100644 index 0000000000..126ff2a39e --- /dev/null +++ b/tests/apps/prk/tests/MPISHM/Synch_p2p/p2p.c @@ -0,0 +1,329 @@ +/* +Copyright (c) 2013, Intel Corporation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. +* Neither the name of Intel Corporation nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +*/ + +/******************************************************************* + +NAME: Pipeline + +PURPOSE: This program tests the efficiency with which point-to-point + synchronization can be carried out. It does so by executing + a pipelined algorithm on an m*n grid. The first array dimension + is distributed among the ranks (stripwise decomposition). + +USAGE: The program takes as input the dimensions of the grid, and the + number of times we loop over the grid + + <# iterations> + + The output consists of diagnostics to make sure the + algorithm worked, and of timing statistics. + +FUNCTIONS CALLED: + + Other than MPI or standard C functions, the following + functions are used in this program: + + wtime() + bail_out() + +HISTORY: - Written by Rob Van der Wijngaart, March 2006. + - modified by Rob Van der Wijngaart, August 2006: + * changed boundary conditions and stencil computation to avoid + overflow + * introduced multiple iterations over grid and dependency between + iterations + +**********************************************************************************/ + +#include +#include + +#define ARRAY(i,j) vector[i+1+(j)*(width)] +#define NBR_INDEX(i,j) (i+(j)*(nbr_width+1)) + +int main(int argc, char ** argv) +{ + int my_ID; /* rank */ + int root; + int m, n; /* grid dimensions */ + double local_pipeline_time, /* timing parameters */ + pipeline_time, + avgtime; + double epsilon = 1.e-8; /* error tolerance */ + double corner_val; /* verification value at top right corner of grid */ + int i, j, iter, ID;/* dummies */ + int iterations; /* number of times to run the pipeline algorithm */ + int *start, *end; /* starts and ends of grid slices */ + int segment_size; + int error=0; /* error flag */ + int Num_procs; /* Number of ranks */ + double *vector; /* array holding grid values */ + long total_length; /* total required length to store grid values */ + MPI_Status status; /* completion status of message */ + MPI_Group shm_group, origin_group, target_group; + int origin_ranks[1], target_ranks[1]; + MPI_Aint nbr_segment_size; + MPI_Win shm_win; /* Shared Memory window object */ + MPI_Info rma_winfo; /* info for window */ + MPI_Comm shm_comm; /* Shared Memory Communicator */ + int shm_procs; /* # of ranks in shared domain */ + int shm_ID; /* MPI rank */ + int source_disp; + double *source_ptr; + int p2pbuf; + int width, nbr_width; + +/********************************************************************************* +** Initialize the MPI environment +**********************************************************************************/ + MPI_Init(&argc,&argv); + MPI_Comm_rank(MPI_COMM_WORLD, &my_ID); + MPI_Comm_size(MPI_COMM_WORLD, &Num_procs); + +/* we set root equal to highest rank, because this is also the rank that reports + on the verification value */ + root = Num_procs-1; + + /* Setup for Shared memory regions */ + MPI_Comm_split_type(MPI_COMM_WORLD, MPI_COMM_TYPE_SHARED, 0, MPI_INFO_NULL, &shm_comm); + MPI_Comm_rank(shm_comm, &shm_ID); + MPI_Comm_size(shm_comm, &shm_procs); + +/********************************************************************* +** process, test and broadcast input parameter +*********************************************************************/ + + if (my_ID == root){ + if (argc != 4){ + printf("Usage: %s <#iterations> <1st array dimension> <2nd array dimension>\n", + *argv); + error = 1; + goto ENDOFTESTS; + } + + iterations = atoi(*++argv); + if (iterations < 1){ + printf("ERROR: iterations must be >= 1 : %d \n",iterations); + error = 1; + goto ENDOFTESTS; + } + + m = atoi(*++argv); + n = atoi(*++argv); + if (m < 1 || n < 1){ + printf("ERROR: grid dimensions must be positive: %d, %d \n", m, n); + error = 1; + goto ENDOFTESTS; + } + + if (m0) start[ID] = end[ID-1]+1; + end[ID] = start[ID]+segment_size-1; + } + + /* now set segment_size to the value needed by the calling rank */ + segment_size = end[my_ID] - start[my_ID] + 1; + + /* RMA win info */ + MPI_Info_create(&rma_winfo); + /* This key indicates that passive target RMA will not be used. + * It is the one info key that MPICH actually uses for optimization. */ + MPI_Info_set(rma_winfo, "no_locks", "true"); + + /* total_length takes into account one ghost cell on left side of segment */ + if (shm_ID == 0) { + total_length = ((end[my_ID]-start[my_ID]+1)+1)*n; + width = segment_size+1; + } else { + total_length = (end[my_ID]-start[my_ID]+1)*n; + width = segment_size; + } + + MPI_Win_allocate_shared(total_length*sizeof(double), sizeof(double), + rma_winfo, shm_comm, (void *) &vector, &shm_win); + if (vector == NULL) { + printf("Could not allocate space for grid slice of %d by %d points", + segment_size, n); + printf(" on rank %d\n", my_ID); + error = 1; + } + bail_out(error); + + /* Get left neighbor base address */ + if (shm_ID > 0) { + MPI_Win_shared_query(shm_win, shm_ID-1, &nbr_segment_size, &source_disp, &source_ptr); + nbr_segment_size = end[my_ID-1] - start[my_ID-1] + 1; + nbr_width = nbr_segment_size; + } + + /* clear the array */ + for (j=0; j 0) { + if (shm_ID > 0) { + MPI_Recv(&p2pbuf, 0, MPI_INT, shm_ID-1, 1, shm_comm, &status); + } else { + MPI_Recv(&(ARRAY(start[my_ID]-1,j)), 1, MPI_DOUBLE, + my_ID-1, j, MPI_COMM_WORLD, &status); + } + } + + i = start[my_ID]; + + if (shm_ID != 0) { + ARRAY(i,j) = source_ptr[NBR_INDEX(end[my_ID],j)] + ARRAY(i,j-1) - source_ptr[NBR_INDEX(end[my_ID],j-1)]; + i++; + } + + for (; i<= end[my_ID]; i++) { + ARRAY(i,j) = ARRAY(i-1,j) + ARRAY(i,j-1) - ARRAY(i-1,j-1); + } + + /* if I am not on the right boundary, send data to my right neighbor */ + if (my_ID != Num_procs-1) { + if (shm_ID != shm_procs-1) { + MPI_Send(&p2pbuf, 0, MPI_INT, shm_ID+1, 1, shm_comm); + } else { + MPI_Send(&(ARRAY(end[my_ID],j)), 1, MPI_DOUBLE, + my_ID+1, j, MPI_COMM_WORLD); + } + } + } + + /* copy top right corner value to bottom left corner to create dependency */ + if (Num_procs >1) { + if (my_ID==root) { + corner_val = -ARRAY(end[my_ID],n-1); + MPI_Send(&corner_val,1,MPI_DOUBLE,0,888,MPI_COMM_WORLD); + } + if (my_ID==0) { + MPI_Recv(&(ARRAY(0,0)),1,MPI_DOUBLE,root,888,MPI_COMM_WORLD,&status); + } + } + else ARRAY(0,0)= -ARRAY(end[my_ID],n-1); + + } + + local_pipeline_time = wtime() - local_pipeline_time; + MPI_Reduce(&local_pipeline_time, &pipeline_time, 1, MPI_DOUBLE, MPI_MAX, root, + MPI_COMM_WORLD); + + /******************************************************************************* + ** Analyze and output results. + ********************************************************************************/ + + /* verify correctness, using top right value */ + corner_val = (double) ((iterations+1)*(m+n-2)); + if (my_ID == root) { + if (abs(ARRAY(end[my_ID],n-1)-corner_val)/corner_val >= epsilon) { + printf("ERROR: checksum %lf does not match verification value %lf\n", + ARRAY(end[my_ID],n-1), corner_val); + error = 1; + } + } + bail_out(error); + + if (my_ID == root) { + avgtime = pipeline_time/iterations; +#ifdef VERBOSE + printf("Solution validates; verification value = %lf\n", corner_val); + printf("Point-to-point synchronizations/s: %lf\n", + ((float)((n-1)*(Num_procs-1)))/(avgtime)); +#else + printf("Solution validates\n"); +#endif + printf("Rate (MFlops/s): %lf Avg time (s): %lf\n", + 1.0E-06 * 2 * ((double)((m-1)*(n-1)))/avgtime, avgtime); + } + + MPI_Finalize(); + exit(EXIT_SUCCESS); + +} /* end of main */ diff --git a/tests/apps/prk/tests/MPISHM/Transpose/Makefile.ohpc b/tests/apps/prk/tests/MPISHM/Transpose/Makefile.ohpc new file mode 100644 index 0000000000..a32a79a660 --- /dev/null +++ b/tests/apps/prk/tests/MPISHM/Transpose/Makefile.ohpc @@ -0,0 +1,30 @@ +include ../../common/MPI.defs +##### User configurable options ##### + +OPTFLAGS = $(DEFAULT_OPT_FLAGS) +#description: change above into something that is a decent optimization on you system + +#uncomment any of the following flags (and change values) to change defaults + +#BLOCKFLAG = -DSYNCHRONOUS +#description: turn on synchronous (blocking) communications + +#DEBUGFLAG = -DVERBOSE +#description: default diagnostic style is silent + +USERFLAGS = +#description: parameter to specify optional flags + +#set the following variables for custom libraries and/or other objects +EXTOBJS = +LIBS = +LIBPATHS = +INCLUDEPATHS = + +### End User configurable options ### + +TUNEFLAGS = $(BLOCKFLAG) $(DEBUGFLAG) $(USERFLAGS) +PROGRAM = transpose +OBJS = $(PROGRAM).o $(COMOBJS) + +include ../../common/make.common diff --git a/tests/apps/prk/tests/MPISHM/Transpose/transpose.c b/tests/apps/prk/tests/MPISHM/Transpose/transpose.c new file mode 100644 index 0000000000..7d97a60af1 --- /dev/null +++ b/tests/apps/prk/tests/MPISHM/Transpose/transpose.c @@ -0,0 +1,443 @@ +/* +Copyright (c) 2013, Intel Corporation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. +* Neither the name of Intel Corporation nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +*/ + +/******************************************************************* + +NAME: transpose + +PURPOSE: This program tests the efficiency with which a square matrix + can be transposed and stored in another matrix. The matrices + are distributed identically. + +USAGE: Program inputs are the matrix order, the number of times to + repeat the operation, and the communication mode + + transpose <#ranks per coherence domain><# iterations> [tile size] + + An optional parameter specifies the tile size used to divide the + individual matrix into blocks for improved cache and TLB performance. + + The output consists of diagnostics to make sure the + transpose worked and timing statistics. + +FUNCTIONS CALLED: + + Other than MPI or standard C functions, the following + functions are used in this program: + + wtime() Portable wall-timer interface. + bail_out() Determine global error and exit if nonzero. + +HISTORY: Written by Tim Mattson, April 1999. + Updated by Rob Van der Wijngaart, December 2005. + Updated by Rob Van der Wijngaart, October 2006. + Updated by Rob Van der Wijngaart, November 2014:: + - made variable names more consistent + - put timing around entire iterative loop of transposes + - fixed incorrect matrix block access; no separate function + for local transpose of matrix block + - reordered initialization and verification loops to + produce unit stride + - changed initialization values, such that the input matrix + elements are: A(i,j) = i+order*j + +**********************************************************************************/ + +#include +#include + +#define A(i,j) A_p[(i+istart)+order*(j)] +#define B(i,j) B_p[(i+istart)+order*(j)] +#define Work_in(i,j) Work_in_p[i+Block_order*(j)] +#define Work_out(i,j) Work_out_p[i+Block_order*(j)] + +int main(int argc, char ** argv) +{ + int Block_order; + size_t Block_size; + size_t Colblock_size; + int Tile_order=32; + int tiling; + int Num_procs; /* Number of ranks */ + int order; /* overall matrix order */ + int send_to, recv_from; /* communicating ranks */ + size_t bytes; /* total amount of data to be moved */ + int my_ID; /* rank */ + int root=0; /* root rank of a communicator */ + int iterations; /* number of times to run the pipeline algorithm */ + int i, j, it, jt, ID;/* dummies */ + int iter; /* index of iteration */ + int phase; /* phase in the staged communication */ + size_t colstart; /* sequence number of first column owned by calling rank */ + int error=0; /* error flag */ + double *A_p; /* original matrix column block */ + double *B_p; /* transposed matrix column block */ + double *Work_in_p; /* workspace for the transpose function */ + double *Work_out_p;/* workspace for the transpose function */ + double abserr, abserr_tot; /* computed error */ + double epsilon = 1.e-8; /* error tolerance */ + double local_trans_time, /* timing parameters */ + trans_time, + avgtime; + MPI_Status status; /* completion status of message */ + MPI_Win shm_win_A; /* Shared Memory window object */ + MPI_Win shm_win_B; /* Shared Memory window object */ + MPI_Win shm_win_Work_in; /* Shared Memory window object */ + MPI_Win shm_win_Work_out; /* Shared Memory window object */ + MPI_Info rma_winfo;/* info for window */ + MPI_Comm shm_comm_prep;/* Shared Memory prep Communicator */ + MPI_Comm shm_comm; /* Shared Memory Communicator */ + int shm_procs; /* # of ranks in shared domain */ + int shm_ID; /* MPI rank within coherence domain */ + int group_size; /* number of ranks per shared memory group */ + int Num_groups; /* number of shared memory group */ + int group_ID; /* sequence number of shared memory group */ + int size_mul; /* size multiplier; 0 for non-root ranks in coherence domain*/ + int istart; + MPI_Request send_req, recv_req; + +/********************************************************************************* +** Initialize the MPI environment +**********************************************************************************/ + MPI_Init(&argc,&argv); + MPI_Comm_rank(MPI_COMM_WORLD, &my_ID); + MPI_Comm_size(MPI_COMM_WORLD, &Num_procs); + + root = 0; + +/********************************************************************* +** process, test and broadcast input parameter +*********************************************************************/ + + if (my_ID == root){ + if (argc != 4 && argc !=5){ + printf("Usage: %s <#ranks per coherence domain> <# iterations> [tile size]\n", + *argv); + error = 1; + goto ENDOFTESTS; + } + + group_size = atoi(*++argv); + if (group_size < 1) { + printf("ERROR: # ranks per coherence domain must be >= 1 : %d \n",group_size); + error = 1; + goto ENDOFTESTS; + } + if (Num_procs%group_size) { + printf("ERROR: toal # %d ranks not divisible by ranks per coherence domain %d\n", + Num_procs, group_size); + error = 1; + goto ENDOFTESTS; + } + + iterations = atoi(*++argv); + if (iterations < 1){ + printf("ERROR: iterations must be >= 1 : %d \n",iterations); + error = 1; + goto ENDOFTESTS; + } + + order = atoi(*++argv); + if (order < Num_procs) { + printf("ERROR: matrix order %d should at least # procs %d\n", + order, Num_procs); + error = 1; goto ENDOFTESTS; + } + + if (order%Num_procs) { + printf("ERROR: matrix order %d should be divisible by # procs %d\n", + order, Num_procs); + error = 1; goto ENDOFTESTS; + } + + if (argc == 5) Tile_order = atoi(*++argv); + + ENDOFTESTS:; + } + bail_out(error); + + /* Broadcast input data to all ranks */ + MPI_Bcast(&order, 1, MPI_INT, root, MPI_COMM_WORLD); + MPI_Bcast(&iterations, 1, MPI_INT, root, MPI_COMM_WORLD); + MPI_Bcast(&Tile_order, 1, MPI_INT, root, MPI_COMM_WORLD); + MPI_Bcast(&group_size, 1, MPI_INT, root, MPI_COMM_WORLD); + + if (my_ID == root) { + printf("MPI+SHM Matrix transpose: B = A^T\n"); + printf("Number of ranks = %d\n", Num_procs); + printf("Rank group size = %d\n", group_size); + printf("Matrix order = %d\n", order); + printf("Number of iterations = %d\n", iterations); + if ((Tile_order > 0) && (Tile_order < order)) + printf("Tile size = %d\n", Tile_order); + else printf("Untiled\n"); +#ifndef SYNCHRONOUS + printf("Non-"); +#endif + printf("Blocking messages\n"); + } + + /* Setup for Shared memory regions */ + + /* first divide WORLD in groups of size group_size */ + MPI_Comm_split(MPI_COMM_WORLD, my_ID/group_size, my_ID%group_size, &shm_comm_prep); + /* derive from that a SHM communicator */ + MPI_Comm_split_type(shm_comm_prep, MPI_COMM_TYPE_SHARED, 0, MPI_INFO_NULL, &shm_comm); + MPI_Comm_rank(shm_comm, &shm_ID); + MPI_Comm_size(shm_comm, &shm_procs); + /* do sanity check, making sure groups did not shrink in second comm split */ + if (shm_procs != group_size) MPI_Abort(MPI_COMM_WORLD, 666); + + /* a non-positive tile size means no tiling of the local transpose */ + tiling = (Tile_order > 0) && (Tile_order < order); + bytes = 2 * sizeof(double) * order * order; + +/********************************************************************* +** The matrix is broken up into column blocks that are mapped one to a +** rank. Each column block is made up of Num_procs smaller square +** blocks of order block_order. +*********************************************************************/ + + Num_groups = Num_procs/group_size; + Block_order = order/Num_groups; + + group_ID = my_ID/group_size; + colstart = Block_order * group_ID; + Colblock_size = order * Block_order; + Block_size = Block_order * Block_order; + +/********************************************************************* +** Create the column block of the test matrix, the column block of the +** transposed matrix, and workspace (workspace only if #procs>1) +*********************************************************************/ + + /* RMA win info */ + MPI_Info_create(&rma_winfo); + /* This key indicates that passive target RMA will not be used. + * It is the one info key that MPICH actually uses for optimization. */ + MPI_Info_set(rma_winfo, "no_locks", "true"); + + /* only the root of each SHM domain specifies window of nonzero size */ + size_mul = (shm_ID==0); + int offset = 32; + MPI_Aint size= (Colblock_size+offset)*sizeof(double)*size_mul; int disp_unit; + MPI_Win_allocate_shared(size, sizeof(double), rma_winfo, shm_comm, + (void *) &A_p, &shm_win_A); + MPI_Win_shared_query(shm_win_A, MPI_PROC_NULL, &size, &disp_unit, (void *)&A_p); + if (A_p == NULL){ + printf(" Error allocating space for original matrix on node %d\n",my_ID); + error = 1; + } + bail_out(error); + A_p += offset; + + MPI_Win_allocate_shared(size, sizeof(double), rma_winfo, shm_comm, + (void *) &B_p, &shm_win_B); + MPI_Win_shared_query(shm_win_B, MPI_PROC_NULL, &size, &disp_unit, (void *)&B_p); + if (B_p == NULL){ + printf(" Error allocating space for transposed matrix by group %d\n",group_ID); + error = 1; + } + bail_out(error); + B_p += offset; + + if (Num_groups>1) { + + size = Block_size*sizeof(double)*size_mul; + MPI_Win_allocate_shared(size, sizeof(double),rma_winfo, shm_comm, + (void *) &Work_in_p, &shm_win_Work_in); + MPI_Win_shared_query(shm_win_Work_in, MPI_PROC_NULL, &size, &disp_unit, + (void *)&Work_in_p); + if (Work_in_p == NULL){ + printf(" Error allocating space for in block by group %d\n",group_ID); + error = 1; + } + bail_out(error); + + MPI_Win_allocate_shared(size, sizeof(double), rma_winfo, + shm_comm, (void *) &Work_out_p, &shm_win_Work_out); + MPI_Win_shared_query(shm_win_Work_out, MPI_PROC_NULL, &size, &disp_unit, + (void *)&Work_out_p); + if (Work_out_p == NULL){ + printf(" Error allocating space for out block by group %d\n",group_ID); + error = 1; + } + bail_out(error); + } + + /* Fill the original column matrix */ + istart = 0; + int chunk_size = Block_order/group_size; + if (tiling) { + for (j=shm_ID*chunk_size;j<(shm_ID+1)*chunk_size;j+=Tile_order) { + for (i=0;i1) { + MPI_Win_free(&shm_win_Work_in); + MPI_Win_free(&shm_win_Work_out); + } + + MPI_Info_free(&rma_winfo); + + MPI_Finalize(); + exit(EXIT_SUCCESS); + +} /* end of main */ + diff --git a/tests/apps/prk/tests/Makefile.am b/tests/apps/prk/tests/Makefile.am new file mode 100644 index 0000000000..0e68feeb60 --- /dev/null +++ b/tests/apps/prk/tests/Makefile.am @@ -0,0 +1,9 @@ +TESTS_ENVIRONMENT = BATS_NO_SUMMARY=1 + +TESTS = build +TESTS += rm_execution_serial +TESTS += rm_execution_openmp +TESTS += rm_execution_mpi +TESTS += rm_execution_mpiopenmp +TESTS += rm_execution_mpirma +TESTS += rm_execution_mpishm diff --git a/tests/apps/prk/tests/Makefile.ohpc b/tests/apps/prk/tests/Makefile.ohpc new file mode 100644 index 0000000000..e9ea1c082d --- /dev/null +++ b/tests/apps/prk/tests/Makefile.ohpc @@ -0,0 +1,222 @@ +#Copyright (c) 2013, Intel Corporation +# +#Redistribution and use in source and binary forms, with or without +#modification, are permitted provided that the following conditions +#are met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials provided +# with the distribution. +# * Neither the name of Intel Corporation nor the names of its +# contributors may be used to endorse or promote products +# derived from this software without specific prior written +# permission. +# +#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +#"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +#LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +#FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +#COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +#INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +#BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +#LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +#CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +#LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +#ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +#POSSIBILITY OF SUCH DAMAGE. +# +# ****************************************************************** + +MAKE=make -f Makefile.ohpc +MAKE_FGMPI=make -f Makefile_FG_MPI + +ifndef number_of_functions + number_of_functions=40 +endif + +ifndef matrix_rank + matrix_rank=5 +endif + +ifndef default_opt_flags + default_opt_flags=-O3 +endif + +default: + @echo "Usage: \"make all\" (re-)builds all targets" + @echo " \"make allserial\" (re-)builds all serial targets" + @echo " \"make allopenmp\" (re-)builds all OpenMP targets" + @echo " \"make allmpi\" (re-)builds all MPI targets" + @echo " \"make allfgmpi\" (re-)builds all Fine-Grain MPI targets" + @echo " \"make allmpiopenmp\" (re-)builds all MPI + OpenMP targets" + @echo " \"make allmpirma\" (re-)builds all MPI-3 RMA targets" + @echo " \"make allshmem\" (re-)builds all SHMEM targets" + @echo " \"make allmpishm\" (re-)builds all MPI-3 shared memory segments targets" + @echo " \"make alldarwin\" (re-)builds all of the above targets" + @echo " \"make allcharm++\" (re-)builds all Charm++ targets" + @echo " \"make allgrappa\" (re-)builds all Grappa targets" + @echo " \"make allfreaks\" (re-)builds the above two targets" + @echo " optionally, specify \"matrix_rank= number_of_functions=\"" + @echo " optionally, specify \"default_opt_flags=\"" + @echo " \"make clean\" removes all objects and executables" + @echo " \"make veryclean\" removes some generated source files as well" + +all: alldarwin allfreaks +alldarwin: allserial allopenmp allmpi allfgmpi allmpiopenmp allmpirma allshmem allmpishm +allohpc: allserial allopenmp allmpi allmpiopenmp allmpirma allmpishm +allfreaks: allcharm++ allgrappa +allohpc: allserial allopenmp allmpi allmpiopenmp allmpirma allmpishm + +allmpi: + cd MPI/Synch_global; $(MAKE) global "DEFAULT_OPT_FLAGS = $(default_opt_flags)" + cd MPI/Synch_p2p; $(MAKE) p2p "DEFAULT_OPT_FLAGS = $(default_opt_flags)" + cd MPI/Sparse; $(MAKE) sparse "DEFAULT_OPT_FLAGS = $(default_opt_flags)" + cd MPI/Transpose; $(MAKE) transpose "DEFAULT_OPT_FLAGS = $(default_opt_flags)" + cd MPI/Stencil; $(MAKE) stencil "DEFAULT_OPT_FLAGS = $(default_opt_flags)" + cd MPI/DGEMM; $(MAKE) dgemm "DEFAULT_OPT_FLAGS = $(default_opt_flags)" + cd MPI/Nstream; $(MAKE) nstream "DEFAULT_OPT_FLAGS = $(default_opt_flags)" + cd MPI/Reduce; $(MAKE) reduce "DEFAULT_OPT_FLAGS = $(default_opt_flags)" + cd MPI/Random; $(MAKE) random "DEFAULT_OPT_FLAGS = $(default_opt_flags)" + cd MPI/Branch; $(MAKE) branch "DEFAULT_OPT_FLAGS = $(default_opt_flags)" \ + "MATRIX_RANK = $(matrix_rank)" \ + "NUMBER_OF_FUNCTIONS = $(number_of_functions)" + +allfgmpi: + cd Run; $(MAKE_FGMPI) smallfgmpi + cd FG_MPI/Synch_global; $(MAKE) global "DEFAULT_OPT_FLAGS = $(default_opt_flags)" + cd FG_MPI/Synch_p2p; $(MAKE) p2p "DEFAULT_OPT_FLAGS = $(default_opt_flags)" + cd FG_MPI/Sparse; $(MAKE) sparse "DEFAULT_OPT_FLAGS = $(default_opt_flags)" + cd FG_MPI/Transpose; $(MAKE) transpose "DEFAULT_OPT_FLAGS = $(default_opt_flags)" + cd FG_MPI/Stencil; $(MAKE) stencil "DEFAULT_OPT_FLAGS = $(default_opt_flags)" + cd FG_MPI/DGEMM; $(MAKE) dgemm "DEFAULT_OPT_FLAGS = $(default_opt_flags)" + cd FG_MPI/Nstream; $(MAKE) nstream "DEFAULT_OPT_FLAGS = $(default_opt_flags)" + cd FG_MPI/Reduce; $(MAKE) reduce "DEFAULT_OPT_FLAGS = $(default_opt_flags)" + cd FG_MPI/Random; $(MAKE) random "DEFAULT_OPT_FLAGS = $(default_opt_flags)" + cd FG_MPI/Branch; $(MAKE) branch "DEFAULT_OPT_FLAGS = $(default_opt_flags)" \ + "MATRIX_RANK = $(matrix_rank)" \ + "NUMBER_OF_FUNCTIONS = $(number_of_functions)" + +allmpiopenmp: + cd MPIOPENMP/Nstream; $(MAKE) nstream "DEFAULT_OPT_FLAGS = $(default_opt_flags)" + cd MPIOPENMP/Transpose; $(MAKE) transpose "DEFAULT_OPT_FLAGS = $(default_opt_flags)" + cd MPIOPENMP/Stencil; $(MAKE) stencil "DEFAULT_OPT_FLAGS = $(default_opt_flags)" + cd MPIOPENMP/Synch_p2p; $(MAKE) p2p "DEFAULT_OPT_FLAGS = $(default_opt_flags)" + +allmpirma: + cd MPIRMA/Synch_p2p; $(MAKE) p2p "DEFAULT_OPT_FLAGS = $(default_opt_flags)" + cd MPIRMA/Stencil; $(MAKE) stencil "DEFAULT_OPT_FLAGS = $(default_opt_flags)" + +allshmem: + cd SHMEM/Synch_p2p; $(MAKE) p2p "DEFAULT_OPT_FLAGS = $(default_opt_flags)" + +allmpishm: + cd MPISHM/Synch_p2p; $(MAKE) p2p "DEFAULT_OPT_FLAGS = $(default_opt_flags)" + cd MPISHM/Stencil; $(MAKE) stencil "DEFAULT_OPT_FLAGS = $(default_opt_flags)" + cd MPISHM/Transpose; $(MAKE) transpose "DEFAULT_OPT_FLAGS = $(default_opt_flags)" + +allopenmp: + cd OPENMP/DGEMM; $(MAKE) dgemm "DEFAULT_OPT_FLAGS = $(default_opt_flags)" + cd OPENMP/Nstream; $(MAKE) nstream "DEFAULT_OPT_FLAGS = $(default_opt_flags)" + cd OPENMP/Reduce; $(MAKE) reduce "DEFAULT_OPT_FLAGS = $(default_opt_flags)" + cd OPENMP/RefCount_shared; $(MAKE) shared "DEFAULT_OPT_FLAGS = $(default_opt_flags)" + cd OPENMP/RefCount_private; $(MAKE) private "DEFAULT_OPT_FLAGS = $(default_opt_flags)" + cd OPENMP/Stencil; $(MAKE) stencil "DEFAULT_OPT_FLAGS = $(default_opt_flags)" + cd OPENMP/Transpose; $(MAKE) transpose "DEFAULT_OPT_FLAGS = $(default_opt_flags)" + cd OPENMP/Random; $(MAKE) random "DEFAULT_OPT_FLAGS = $(default_opt_flags)" + cd OPENMP/Sparse; $(MAKE) sparse "DEFAULT_OPT_FLAGS = $(default_opt_flags)" + cd OPENMP/Synch_global; $(MAKE) global "DEFAULT_OPT_FLAGS = $(default_opt_flags)" + cd OPENMP/Synch_p2p; $(MAKE) p2p "DEFAULT_OPT_FLAGS = $(default_opt_flags)" + cd OPENMP/Branch; $(MAKE) branch "DEFAULT_OPT_FLAGS = $(default_opt_flags)" \ + "MATRIX_RANK = $(matrix_rank)" \ + "NUMBER_OF_FUNCTIONS = $(number_of_functions)" + +allcharm++: + cd CHARM++/Synch_p2p; $(MAKE) p2p "DEFAULT_OPT_FLAGS = $(default_opt_flags)" + cd CHARM++/Stencil; $(MAKE) stencil "DEFAULT_OPT_FLAGS = $(default_opt_flags)" + cd CHARM++/Transpose; $(MAKE) transpose "DEFAULT_OPT_FLAGS = $(default_opt_flags)" + +allgrappa: + cd GRAPPA/Synch_p2p; $(MAKE) p2p "DEFAULT_OPT_FLAGS = $(default_opt_flags)" + cd GRAPPA/Stencil; $(MAKE) stencil "DEFAULT_OPT_FLAGS = $(default_opt_flags)" + +allserial: + cd SERIAL/DGEMM; $(MAKE) dgemm "DEFAULT_OPT_FLAGS = $(default_opt_flags)" + cd SERIAL/Nstream; $(MAKE) nstream "DEFAULT_OPT_FLAGS = $(default_opt_flags)" + cd SERIAL/Reduce; $(MAKE) reduce "DEFAULT_OPT_FLAGS = $(default_opt_flags)" + cd SERIAL/Stencil; $(MAKE) stencil "DEFAULT_OPT_FLAGS = $(default_opt_flags)" + cd SERIAL/Transpose; $(MAKE) transpose "DEFAULT_OPT_FLAGS = $(default_opt_flags)" + cd SERIAL/Random; $(MAKE) random "DEFAULT_OPT_FLAGS = $(default_opt_flags)" + cd SERIAL/Sparse; $(MAKE) sparse "DEFAULT_OPT_FLAGS = $(default_opt_flags)" + cd SERIAL/Synch_p2p; $(MAKE) p2p "DEFAULT_OPT_FLAGS = $(default_opt_flags)" + cd SERIAL/Branch; $(MAKE) branch "DEFAULT_OPT_FLAGS = $(default_opt_flags)" \ + "MATRIX_RANK = $(matrix_rank)" \ + "NUMBER_OF_FUNCTIONS = $(number_of_functions)" + +clean: + cd MPI/DGEMM; $(MAKE) clean + cd MPI/Nstream; $(MAKE) clean + cd MPI/Reduce; $(MAKE) clean + cd MPI/Stencil; $(MAKE) clean + cd MPI/Transpose; $(MAKE) clean + cd MPI/Random; $(MAKE) clean + cd MPI/Sparse; $(MAKE) clean + cd MPI/Synch_global; $(MAKE) clean + cd MPI/Synch_p2p; $(MAKE) clean + cd MPI/Branch; $(MAKE) clean + cd FG_MPI/DGEMM; $(MAKE) clean + cd FG_MPI/Nstream; $(MAKE) clean + cd FG_MPI/Reduce; $(MAKE) clean + cd FG_MPI/Stencil; $(MAKE) clean + cd FG_MPI/Transpose; $(MAKE) clean + cd FG_MPI/Random; $(MAKE) clean + cd FG_MPI/Sparse; $(MAKE) clean + cd FG_MPI/Synch_global; $(MAKE) clean + cd FG_MPI/Synch_p2p; $(MAKE) clean + cd FG_MPI/Branch; $(MAKE) clean + cd MPIRMA/Stencil; $(MAKE) clean + cd MPIRMA/Synch_p2p; $(MAKE) clean + cd MPISHM/Stencil; $(MAKE) clean + cd SHMEM/Synch_p2p; $(MAKE) clean + cd MPISHM/Synch_p2p; $(MAKE) clean + cd MPISHM/Transpose; $(MAKE) clean + cd CHARM++/Stencil; $(MAKE) clean + cd CHARM++/Synch_p2p; $(MAKE) clean + cd CHARM++/Transpose; $(MAKE) clean + cd GRAPPA/Synch_p2p; $(MAKE) clean + cd GRAPPA/Stencil; $(MAKE) clean + cd MPIOPENMP/Nstream; $(MAKE) clean + cd MPIOPENMP/Stencil; $(MAKE) clean + cd MPIOPENMP/Transpose; $(MAKE) clean + cd MPIOPENMP/Synch_p2p; $(MAKE) clean + cd OPENMP/DGEMM; $(MAKE) clean + cd OPENMP/Nstream; $(MAKE) clean + cd OPENMP/Reduce; $(MAKE) clean + cd OPENMP/RefCount_shared; $(MAKE) clean + cd OPENMP/RefCount_private; $(MAKE) clean + cd OPENMP/Stencil; $(MAKE) clean + cd OPENMP/Transpose; $(MAKE) clean + cd OPENMP/Random; $(MAKE) clean + cd OPENMP/Sparse; $(MAKE) clean + cd OPENMP/Synch_global; $(MAKE) clean + cd OPENMP/Synch_p2p; $(MAKE) clean + cd OPENMP/Branch; $(MAKE) clean + cd SERIAL/DGEMM; $(MAKE) clean + cd SERIAL/Nstream; $(MAKE) clean + cd SERIAL/Reduce; $(MAKE) clean + cd SERIAL/Stencil; $(MAKE) clean + cd SERIAL/Transpose; $(MAKE) clean + cd SERIAL/Random; $(MAKE) clean + cd SERIAL/Sparse; $(MAKE) clean + cd SERIAL/Synch_p2p; $(MAKE) clean + cd SERIAL/Branch; $(MAKE) clean + rm -f stats.json + +veryclean: clean + cd MPI/Branch; $(MAKE) veryclean + cd OPENMP/Branch; $(MAKE) veryclean + cd SERIAL/Branch; $(MAKE) veryclean + cd Run; $(MAKE_FGMPI) veryclean +# cd common; rm -f make.defs diff --git a/tests/apps/prk/tests/OPENMP/Branch/Makefile.ohpc b/tests/apps/prk/tests/OPENMP/Branch/Makefile.ohpc new file mode 100644 index 0000000000..384b47b28e --- /dev/null +++ b/tests/apps/prk/tests/OPENMP/Branch/Makefile.ohpc @@ -0,0 +1,54 @@ +ifndef NUMBER_OF_FUNCTIONS + NUMBER_OF_FUNCTIONS=40 +endif + +ifndef MATRIX_RANK + MATRIX_RANK=10 +endif + +include ../../common/OPENMP.defs +##### User configurable options ##### + +OPTFLAGS = $(DEFAULT_OPT_FLAGS) +#description: change above into something that is a decent optimization on you system + +#uncomment any of the following flags (and change values) to change defaults + +#RESTRICTFLAG = -DRESTRICT_KEYWORD +#description: the "restrict" keyword can be used on IA platforms to disambiguate +# data accessed through pointers (requires -restrict compiler flag) + +#DEBUGFLAG = -DVERBOSE +#description: default diagnostic style is silent + +#NTHREADFLAG = -DMAXTHREADS=n +#description: default thread limit is 256 + +USERFLAGS = +#description: parameter to specify optional flags + +EXTOBJS = +LIBS = +LIBPATHS = +INCLUDEPATHS = + +### End User configurable options ### + +TUNEFLAGS = $(RESTRICTFLAG) $(DEBUGFLAG) $(NTHREADFLAG) $(USERFLAGS) +PROGRAM = branch +OBJS = $(PROGRAM).o $(COMOBJS) func.o + +#default: usage +# @echo " \"make veryclean\" to remove custom built files as well" + +include ../../common/make.common + +func.c: + @echo "############################################################" + @echo "##### No file func.c -- invoking func_gen to create it #####" + @echo "############################################################" + ./func_gen ${MATRIX_RANK} ${NUMBER_OF_FUNCTIONS} + +veryclean: + @rm -f func.c ___* + make -f Makefile.ohpc clean diff --git a/tests/apps/prk/tests/OPENMP/Branch/README b/tests/apps/prk/tests/OPENMP/Branch/README new file mode 100755 index 0000000000..3131b10318 --- /dev/null +++ b/tests/apps/prk/tests/OPENMP/Branch/README @@ -0,0 +1,14 @@ +Option INS_HEAVY of the Branching code requires a customized version +of file func.c, which contains a variable number of functions of +variable size. This file is built by invoking script "func_gen," +which takes two integer input parameters. The first is the rank of +the square matrices whose elements get initialized individually by +one of the functions in func.c. Hence, the number of instructions +associated with each such function is proportional to rank*rank. +The second parameters is the number of functions created. These +functions are all slightly different, but all have the same size. + +Usage: func_gen +The function is invoked with default values 10 and 40 if no +values for these variables are supplied on the make command line. + diff --git a/tests/apps/prk/tests/OPENMP/Branch/branch.c b/tests/apps/prk/tests/OPENMP/Branch/branch.c new file mode 100755 index 0000000000..3b2783412f --- /dev/null +++ b/tests/apps/prk/tests/OPENMP/Branch/branch.c @@ -0,0 +1,393 @@ +/* +Copyright (c) 2013, Intel Corporation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. +* Neither the name of Intel Corporation nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +*/ + +/******************************************************************* + +NAME: Branch + +PURPOSE: This program tests the effect of inner-loop branches on + application performance. We investigate four cases. The first + three all concern light-weight loops, i.e. loops that have + very few instructions associated with them. + 1) branches inside vectorizable loops where the branch does + not necessarily inhibit vectorization: vector_go + 2) branches inside vectorizable loops where the branch does + inhibit vectorization: vector_stop + 3) branches inside non-vectorizable loops: no_vector + 4) branches inside non-vectorizable loops in which each branch + corresponds to a sizeable and different set of instructions: + ins-heavy + +CONSTRAINTS: + - the code should be continuously scalable, i.e. the user should + be able to specify the amount of work to be done. + - the code should be verifiable. + - the code should be executable with and without branches, with + otherwise identical amounts of work, to assess the impact of the + branches. + - the performance of the code should be dominated by the work in + the loops, not by memory bandwidth required to fetch data. This + means that arrays should fit in cache, and any loop over arrays + should be executed many times to amortize the initial memory load + costs and to remove noise from the timings. + - any arrays used should be initialized only once, to avoid confusing + performance impact of initialization with that of the branches. + Because the base loop over the array is short, it completes very + quickly, leading to very noisy results if it were timed separately. + Hence, we must time the ensemble of all iterations over the base + loop, which would include reinitializations if present. + - the branches should be "unpredictable," meaning that if the compiler + guesses them to be always taken or to be always not taken, it will + be wrong often. Otherwise the cost of a mispredicted branch may + not show up in the performance results. + - the amount of work in the codes containing the three different + types of light-weight loops should be the same to allow fair + comparisions. + - the code should not not produce overflow or underflow. + - the actual cost of computing the branch condition should be small, + so that we can assess the cost of the occurrence of the branch as + it disrupts vectorization and the hardware pipelines). If the + condition were expensive to compute and we run the code with and + without the branch, the performance difference would be exaggerated. + - Note: Casts from integer to float or double are not always vectorizable. + +APPROACH: + - to avoid casts and keep conditionals inexpensive and exact, we use + only integer operations. + - we make sure that the numerical results of the codes for the + different branch structures and for the different paths following + the branch are identical. + - conditionals are simple comparisons to zero of quantities that + are computed anyway. + - initialization produces a saw-tooth pattern with frequent sign + crossings to defeat speculative branch execution. + - successive iterations over a relatively short array result simply + in a change of sign of all array elements, so that the results are + bounded, and verification values are easily computable. + +USAGE: The program takes as input the number of threads, the length of the + vector loop, the number of repetitions of the loop, and the type of + branching + + <# threads> <# iterations> + + The output consists of diagnostics to make sure the + algorithm worked, and of timing statistics. + +FUNCTIONS CALLED: + + Other than OpenMP or standard C functions, the following + functions are used in this program: + + wtime() + bail_out() + fill_vec() + func*() + +HISTORY: Written by Rob Van der Wijngaart, May 2006. + +**********************************************************************************/ + +#include +#include + +/* the following values are only used as labels */ +#define VECTOR_STOP 66 +#define VECTOR_GO 77 +#define NO_VECTOR 88 +#define INS_HEAVY 99 +#define WITH_BRANCHES 1 +#define WITHOUT_BRANCHES 0 + +extern int fill_vec(int *vector, int vector_length, int iterations, int branch, + int *nfunc, int *rank); + +int main(int argc, char ** argv) +{ + int my_ID; /* Thread ID */ + int vector_length; /* length of vector loop containing the branch */ + int nfunc; /* number of functions used in INS_HEAVY option */ + int rank; /* matrix rank used in INS_HEAVY option */ + double branch_time, /* timing parameters */ + no_branch_time; + double ops; /* double precision representation of integer ops */ + int iterations; /* number of times the branch loop is carried out */ + int i, iter, aux; /* dummies */ + char *branch_type; /* string defining branching type */ + int btype; /* integer encoding branching type */ + int total=0, + total_ref; /* computed and stored verification values */ + int nthread_input; /* thread parameters */ + int nthread; + int num_error=0; /* flag that signals that requested and obtained + numbers of threads are the same */ + +/********************************************************************************** +** process and test input parameters +**********************************************************************************/ + + if (argc != 5){ + printf("Usage: %s <# threads> <# iterations> ", *argv); + printf("\n"); + printf("branching type: vector_go, vector_stop, no_vector, ins_heavy\n"); + exit(EXIT_FAILURE); + } + + nthread_input = atoi(*++argv); + if ((nthread_input < 1) || (nthread_input > MAX_THREADS)) { + printf("ERROR: Invalid number of threads: %d\n", nthread_input); + exit(EXIT_FAILURE); + } + + omp_set_num_threads(nthread_input); + + iterations = atoi(*++argv); + if (iterations < 1 || iterations%2==1){ + printf("ERROR: Iterations must be positive and even : %d \n", iterations); + exit(EXIT_FAILURE); + } + + vector_length = atoi(*++argv); + if (vector_length < 1){ + printf("ERROR: loop length must be >= 1 : %d \n",vector_length); + exit(EXIT_FAILURE); + } + + branch_type = *++argv; + if (!strcmp(branch_type,"vector_stop")) btype = VECTOR_STOP; + else if (!strcmp(branch_type,"vector_go" )) btype = VECTOR_GO; + else if (!strcmp(branch_type,"no_vector" )) btype = NO_VECTOR; + else if (!strcmp(branch_type,"ins_heavy" )) btype = INS_HEAVY; + else { + printf("Wrong branch type: %s; choose vector_stop, vector_go, ", branch_type); + printf("no_vector, or ins_heavy\n"); + exit(EXIT_FAILURE); + } + + #pragma omp parallel private(i, my_ID, iter, aux, nfunc, rank) reduction(+:total) + { + int * RESTRICT vector; int * RESTRICT index; + int factor = -1; + + #pragma omp master + { + nthread = omp_get_num_threads(); + + printf("OpenMP Branching Bonanza\n"); + if (nthread != nthread_input) { + num_error = 1; + printf("ERROR: number of requested threads %d does not equal ", + nthread_input); + printf("number of spawned threads %d\n", nthread); + } + else { + printf("Number of threads = %d\n", nthread_input); + printf("Vector length = %d\n", vector_length); + printf("Number of iterations = %d\n", iterations); + printf("Branching type = %s\n", branch_type); + } + } + bail_out(num_error); + + my_ID = omp_get_thread_num(); + + vector = malloc(vector_length*2*sizeof(int)); + if (!vector) { + printf("ERROR: Thread %d failed to allocate space for vector\n", my_ID); + num_error = 1; + } + + bail_out(num_error); + + /* grab the second half of vector to store index array */ + index = vector + vector_length; + + /* initialize the array with entries with varying signs; array "index" is only + used to obfuscate the compiler (i.e. it won't vectorize a loop containing + indirect referencing). It functions as the identity operator. */ + for (i=0; i0 inhibits vectorization */ + for (iter=0; iter0) vector[i] -= 2*vector[i]; + else vector[i] -= 2*aux; + } + #pragma vector always + for (i=0; i0) vector[i] -= 2*vector[i]; + else vector[i] -= 2*aux; + } + } + break; + + case VECTOR_GO: + /* condition aux>0 allows vectorization */ + for (iter=0; iter0) vector[i] -= 2*vector[i]; + else vector[i] -= 2*aux; + } + #pragma vector always + for (i=0; i0) vector[i] -= 2*vector[i]; + else vector[i] -= 2*aux; + } + } + break; + + case NO_VECTOR: + /* condition aux>0 allows vectorization, but indirect indexing inbibits it */ + for (iter=0; iter0) vector[i] -= 2*vector[index[i]]; + else vector[i] -= 2*aux; + } + #pragma vector always + for (i=0; i0) vector[i] -= 2*vector[index[i]]; + else vector[i] -= 2*aux; + } + } + break; + + case INS_HEAVY: + fill_vec(vector, vector_length, iterations, WITH_BRANCHES, &nfunc, &rank); + } + #pragma omp master + { + branch_time = wtime() - branch_time; + if (btype == INS_HEAVY) { + printf("Number of matrix functions = %d\n", nfunc); + printf("Matrix order = %d\n", rank); + } + } + + /* do the whole thing once more, but now without branches */ + + #pragma omp barrier + #pragma omp master + { + no_branch_time = wtime(); + } + + /* do actual branching */ + + switch (btype) { + + case VECTOR_STOP: + case VECTOR_GO: + for (iter=0; iter \"" + exit +fi + +n=$1 +nfunc=$2 +PID=$$ +NAME=___func.c$PID + +if [ $n -lt 1 ]; then + echo "ERROR: Invalid matrix size $n" + exit +fi +if [ $nfunc -lt 1 ]; then + echo "ERROR: Invalid number of functions $nfunc" + exit +fi + +echo "Generating $nfunc functions with matrix order $n" + +# empty the file func.c +cp /dev/null func.c + +# insert the right header file +echo "#include " >> func.c +#create some global read-only arrays +echo "static int one[$n], zero[$n];" >> func.c + +#write prototype matrix function +echo "int funcVERSION(int index, int a[$n][$n], int b[$n][$n]){" > $NAME +echo " int i, j, x1, x2, x3, error=0;" >> $NAME +echo >> $NAME + +j=0 +while [ $j -lt $n ]; do + i=0 + while [ $i -lt $n ]; do + echo " x1 = `expr \( \( $i + $j \) \* 48611 \) % 8389` + index;" >> $NAME + echo " x2 = `expr \( \( $i + 17 + 19 \* $j \) \* 29443 \) % 77029`;" >> $NAME + echo " x3 = (x1 + (VERSION+1)*x2) % $n;" >> $NAME + echo " x1 += (x2 - x3 + $n ) % $n;" >> $NAME + echo " x2 += (x1 - 5*x3 + 7 * $n ) % $n;" >> $NAME + echo " x3 = (x1 + 4*x2) % $n;" >> $NAME + if [ $i -ne $j ]; then + echo " a[$j][$i] = zero[x3];" >> $NAME + else + echo " a[$j][$i] = one[x3];" >> $NAME + fi + echo >> $NAME + i=`expr $i + 1` + done + j=`expr $j + 1` +done + +echo " for (j=0; j<$n; j++) for (i=0; i<$n; i++)" >> $NAME +echo " b[j][i] = (a[i][j]+a[j][i])/2;" >> $NAME +echo " for (j=0; j<$n; j++) for (i=0; i<$n; i++)" >> $NAME +echo " if (i != j) error += ABS(b[j][i]);" >> $NAME +echo " for (i=0; i<$n; i++) error += ABS(1-b[i][i]);" >> $NAME + +echo " if (error) return(0);" >> $NAME +echo " else return(index);" >> $NAME +echo "}" >> $NAME +echo >> $NAME + +#write the list of matrix functions; do odd/even scrambling to kill unit instruction stride +v=0 +half=`expr \( $nfunc + 1 \) / 2` +while [ $v -lt $nfunc ]; do + v2=`expr $half \* \( $v % 2 \) + $v / 2` + cat $NAME | sed "s/VERSION/$v2/" >> func.c + v=`expr $v + 1` +done + +#remove prototype matrix function +rm -f $NAME + + +echo "int fill_vec(int *vector, int length, int iterations, int branch, " >> func.c +echo " int *nfunc, int *rank) {" >> func.c + +echo " static int a[$n][$n], b[$n][$n];" >> func.c +echo " int aux, aux2, i, iter;" >> func.c + +echo " /* return generator values to calling program */" >> func.c +echo " *nfunc = $nfunc;" >> func.c +echo " *rank = $n;" >> func.c +echo >> func.c +echo " if (!branch)" >> func.c +echo " for (iter=0; iter> func.c +echo " for (i=0; i> func.c +echo " aux2 = -(3-(func0(i,a,b)&7));" >> func.c +echo " vector[i] -= (vector[i]+aux2);" >> func.c +echo " }" >> func.c +echo " for (i=0; i> func.c +echo " aux2 = (3-(func0(i,a,b)&7));" >> func.c +echo " vector[i] -= (vector[i]+aux2);" >> func.c +echo " }" >> func.c +echo " }" >> func.c +echo " else {" >> func.c +echo " for (i=0; i<$n; i++) {" >> func.c +echo " zero[i] = 0; one[i] = 1;" >> func.c +echo " }" >> func.c +echo " for (iter=0; iter> func.c +echo " for (i=0; i> func.c +echo " aux = i%$nfunc;" >> func.c +echo " switch(aux) {" >> func.c +v=0 +while [ $v -lt $nfunc ]; do + echo " case $v: aux2 = -(3-(func$v(i,a,b)&7));" >> func.c + echo " vector[i] -= (vector[i]+aux2);" >> func.c + echo " break;" >> func.c + v=`expr $v + 1` +done +echo " default: vector[i] = 0;" >> func.c +echo " }" >> func.c +echo " }" >> func.c +echo " for (i=0; i> func.c +echo " aux = i%$nfunc;" >> func.c +echo " switch(aux) {" >> func.c +v=0 +while [ $v -lt $nfunc ]; do + echo " case $v: aux2 = (3-(func$v(i,a,b)&7));" >> func.c + echo " vector[i] -= (vector[i]+aux2);" >> func.c + echo " break;" >> func.c + v=`expr $v + 1` +done +echo " default: vector[i] = 0;" >> func.c +echo " }" >> func.c +echo " }" >> func.c +echo " }" >> func.c +echo " }" >> func.c +echo " return(0);" >> func.c +echo "}" >> func.c + diff --git a/tests/apps/prk/tests/OPENMP/DGEMM/Makefile.ohpc b/tests/apps/prk/tests/OPENMP/DGEMM/Makefile.ohpc new file mode 100644 index 0000000000..bfad9abd41 --- /dev/null +++ b/tests/apps/prk/tests/OPENMP/DGEMM/Makefile.ohpc @@ -0,0 +1,41 @@ +include ../../common/OPENMP.defs + +##### User configurable options ##### + +OPTFLAGS = $(DEFAULT_OPT_FLAGS) +#description: change above into something that is a decent optimization on you system + +#uncomment any of the following flags (and change values) to change defaults + +#BLOCKFLAG = -DDEFAULTBLOCK=32 +#description: default tile size is 32 (used only for non-MKL version) + +#OFFSETFLAG = -DBOFFSET=0 +#description: set this flag to some value to override default first array +# dimension padding (12) of tiles used in non-MKL version + +#MKLFLAG = -DMKL +#description: set this flag to call the tuned mkl library + +#DEBUGFLAG = -DVERBOSE +#description: default diagnostic style is silent + +#NTHREADFLAG = -DMAXTHREADS=n +#description: default thread limit is 256 + +USERFLAGS = +#description: parameter to specify optional flags + +EXTOBJS = +#LIBS = -lmkl_ia32 +#LIBPATHS = -L/opt/intel/mkl/10.0.3.020/lib/32 +#INCLUDEPATHS = -I/opt/intel/mkl/10.0.3.020/include + +### End User configurable options ### + +TUNEFLAGS = $(BLOCKFLAG) $(MKLFLAG) $(OFFSETFLAG) \ + $(DEBUGFLAG) $(NTHREADFLAG) $(USERFLAGS) +PROGRAM = dgemm +OBJS = $(PROGRAM).o $(COMOBJS) + +include ../../common/make.common diff --git a/tests/apps/prk/tests/OPENMP/DGEMM/dgemm.c b/tests/apps/prk/tests/OPENMP/DGEMM/dgemm.c new file mode 100755 index 0000000000..4af89bbe36 --- /dev/null +++ b/tests/apps/prk/tests/OPENMP/DGEMM/dgemm.c @@ -0,0 +1,307 @@ +/* +Copyright (c) 2013, Intel Corporation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. +* Neither the name of Intel Corporation nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +*/ + +/********************************************************************************* + +NAME: dgemm + +PURPOSE: This program tests the efficiency with which a dense matrix + dense multiplication is carried out + +USAGE: The program takes as input the number of threads, the matrix + order, the number of times the matrix-matrix multiplication + is carried out, and, optionally, a tile size for matrix + blocking + + <# threads> <# iterations> [] + + The output consists of diagnostics to make sure the + algorithm worked, and of timing statistics. + +FUNCTIONS CALLED: + + Other than OpenMP or standard C functions, the following + functions are used in this program: + + wtime() + bail_out() + +HISTORY: Written by Rob Van der Wijngaart, September 2006. + Made array dimensioning dynamic, October 2007 + Allowed arbitrary block size, November 2007 + Removed reverse-engineered MKL source code option, November 2007 + Changed from row- to column-major storage order, November 2007 + Stored blocks of B in transpose form, November 2007 + +***********************************************************************************/ + +#include +#include + +#ifdef MKL + #include +#endif + +#ifndef DEFAULTBLOCK + #define DEFAULTBLOCK 32 +#endif + +#ifndef BOFFSET + #define BOFFSET 12 +#endif +#define AA_arr(i,j) AA[(i)+(block+BOFFSET)*(j)] +#define BB_arr(i,j) BB[(i)+(block+BOFFSET)*(j)] +#define CC_arr(i,j) CC[(i)+(block+BOFFSET)*(j)] +#define A_arr(i,j) A[(i)+(order)*(j)] +#define B_arr(i,j) B[(i)+(order)*(j)] +#define C_arr(i,j) C[(i)+(order)*(j)] + +#define forder (1.0*order) + +main(int argc, char **argv){ + + int iter, i,ii,j,jj,k,kk,ig,jg,kg; /* dummies */ + int iterations; /* number of times the multiplication is done */ + double dgemm_time, /* timing parameters */ + avgtime; + double checksum = 0.0, /* checksum of result */ + ref_checksum; + double epsilon = 1.e-8; /* error tolerance */ + int nthread_input, /* thread parameters */ + nthread; + int num_error=0; /* flag that signals that requested and + obtained numbers of threads are the same */ + static + double *A, *B, *C; /* input (A,B) and output (C) matrices */ + int order; /* number of rows and columns of matrices */ + int block; /* tile size of matrices */ + +#ifndef MKL + if (argc != 4 && argc != 5) { + printf("Usage: %s <# threads> <# iterations> [tile size]\n",*argv); +#else + if (argc != 4) { + printf("Usage: %s <# threads> <# iterations> \n",*argv); +#endif + exit(EXIT_FAILURE); + } + + /* Take number of threads to request from command line */ + nthread_input = atoi(*++argv); + + if ((nthread_input < 1) || (nthread_input > MAX_THREADS)) { + printf("ERROR: Invalid number of threads: %d\n", nthread_input); + exit(EXIT_FAILURE); + } + + omp_set_num_threads(nthread_input); + + iterations = atoi(*++argv); + if (iterations < 1){ + printf("ERROR: Iterations must be positive : %d \n", iterations); + exit(EXIT_FAILURE); + } + + order = atoi(*++argv); + if (order < 1) { + printf("ERROR: Matrix order must be positive: %d\n", order); + exit(EXIT_FAILURE); + } + A = (double *) malloc(order*order*sizeof(double)); + B = (double *) malloc(order*order*sizeof(double)); + C = (double *) malloc(order*order*sizeof(double)); + if (!A || !B || !C) { + printf("ERROR: Could not allocate space for global matrices\n"); + exit(EXIT_FAILURE); + } + + ref_checksum = (0.25*forder*forder*forder*(forder-1.0)*(forder-1.0)); + + #pragma omp parallel for private(i,j) + for(j = 0; j < order; j++) for(i = 0; i < order; i++) { + A_arr(i,j) = B_arr(i,j) = (double) j; + C_arr(i,j) = 0.0; + } + + printf("OpenMP Dense matrix-matrix multiplication\n"); + +#ifndef MKL + if (argc == 5) { + block = atoi(*++argv); + } else block = DEFAULTBLOCK; + + #pragma omp parallel private (i,j,k,ii,jj,kk,ig,jg,kg,iter) + { + double *AA, *BB, *CC; + + if (block > 0) { + /* matrix blocks for local temporary copies */ + AA = (double *) malloc(block*(block+BOFFSET)*3*sizeof(double)); + if (!AA) { + num_error = 1; + printf("Could not allocate space for matrix tiles on thread %d\n", + omp_get_thread_num()); + } + bail_out(num_error); + BB = AA + block*(block+BOFFSET); + CC = BB + block*(block+BOFFSET); + } + + #pragma omp master + { + nthread = omp_get_num_threads(); + + if (nthread != nthread_input) { + num_error = 1; + printf("ERROR: number of requested threads %d does not equal ", + nthread_input); + printf("number of spawned threads %d\n", nthread); + } + else { + printf("Matrix order = %d\n", order); + printf("Number of threads = %d\n", nthread_input); + if (block>0) + printf("Blocking factor = %d\n", block); + else + printf("No blocking\n"); + printf("Number of iterations = %d\n", iterations); + } + } + bail_out(num_error); + + for (iter=0; iter<=iterations; iter++) { + + if (iter==1) { + #pragma omp barrier + #pragma omp master + { + dgemm_time = wtime(); + } + } + + + if (block > 0) { + + #pragma omp for + for(jj = 0; jj < order; jj+=block){ + for(kk = 0; kk < order; kk+=block) { + + for (jg=jj,j=0; jg epsilon) { + printf("ERROR: Checksum = %lf, Reference checksum = %lf\n", + checksum, ref_checksum); + exit(EXIT_FAILURE); + } + else { + printf("Solution validates\n"); +#ifdef VERBOSE + printf("Reference checksum = %lf, checksum = %lf\n", + ref_checksum, checksum); +#endif + } + + double nflops = 2.0*forder*forder*forder; + avgtime = dgemm_time/iterations; + printf("Rate (MFlops/s): %lf Avg time (s): %lf\n", + 1.0E-06 *nflops/avgtime, avgtime); + + exit(EXIT_SUCCESS); + +} diff --git a/tests/apps/prk/tests/OPENMP/Nstream/Makefile.ohpc b/tests/apps/prk/tests/OPENMP/Nstream/Makefile.ohpc new file mode 100644 index 0000000000..6c856b947d --- /dev/null +++ b/tests/apps/prk/tests/OPENMP/Nstream/Makefile.ohpc @@ -0,0 +1,43 @@ +include ../../common/OPENMP.defs + +##### User configurable options ##### + +OPTFLAGS = $(DEFAULT_OPT_FLAGS) +#description: change above into something that is a decent optimization on you system + +#uncomment any of the following flags (and change values) to change defaults + +#RESTRICTFLAG = -DRESTRICT_KEYWORD +#description: the "restrict" keyword can be used on IA platforms to disambiguate +# data accessed through pointers (requires -restrict compiler flag) + +LENGTHFLAG = -DMAXLENGTH=1000000000 +#description: default vector length is 2000000 + +#ALLOCFLAG = -DSTATIC_ALLOCATION +#description: default memory allocation is dynamic (using malloc) + +#DEBUGFLAG = -DVERBOSE +#description: default diagnostic style is silent + +#NTHREADFLAG = -DMAXTHREADS=n +#description: default thread limit is 256 + +USERFLAGS = +#description: parameter to specify optional flags + +#set the following variables for custom libraries and/or other objects +EXTOBJS = +LIBS = +LIBPATHS = +INCLUDEPATHS = + +### End User configurable options ### + +TUNEFLAGS = $(LENGTHFLAG) $(ALLOCFLAG) $(DEBUGFLAG) $(NTHREADFLAG) \ + $(USERFLAGS) $(RESTRICTFLAG) +PROGRAM = nstream +OBJS = $(PROGRAM).o $(COMOBJS) + +include ../../common/make.common + diff --git a/tests/apps/prk/tests/OPENMP/Nstream/nstream.c b/tests/apps/prk/tests/OPENMP/Nstream/nstream.c new file mode 100755 index 0000000000..fadc006200 --- /dev/null +++ b/tests/apps/prk/tests/OPENMP/Nstream/nstream.c @@ -0,0 +1,323 @@ +/* +Copyright (c) 2013, Intel Corporation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. +* Neither the name of Intel Corporation nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +*/ +/* Copyright 1991-2013: John D. McCalpin */ +/*-----------------------------------------------------------------------*/ +/* License: */ +/* 1. You are free to use this program and/or to redistribute */ +/* this program. */ +/* 2. You are free to modify this program for your own use, */ +/* including commercial use, subject to the publication */ +/* restrictions in item 3. */ +/* 3. You are free to publish results obtained from running this */ +/* program, or from works that you derive from this program, */ +/* with the following limitations: */ +/* 3a. In order to be referred to as "STREAM benchmark results", */ +/* published results must be in conformance to the STREAM */ +/* Run Rules, (briefly reviewed below) published at */ +/* http://www.cs.virginia.edu/stream/ref.html */ +/* and incorporated herein by reference. */ +/* As the copyright holder, John McCalpin retains the */ +/* right to determine conformity with the Run Rules. */ +/* 3b. Results based on modified source code or on runs not in */ +/* accordance with the STREAM Run Rules must be clearly */ +/* labelled whenever they are published. Examples of */ +/* proper labelling include: */ +/* "tuned STREAM benchmark results" */ +/* "based on a variant of the STREAM benchmark code" */ +/* Other comparable, clear, and reasonable labelling is */ +/* acceptable. */ +/* 3c. Submission of results to the STREAM benchmark web site */ +/* is encouraged, but not required. */ +/* 4. Use of this program or creation of derived works based on this */ +/* program constitutes acceptance of these licensing restrictions. */ +/* 5. Absolutely no warranty is expressed or implied. */ +/*-----------------------------------------------------------------------*/ + +/********************************************************************** + +NAME: nstream + +PURPOSE: To compute memory bandwidth when adding a vector of a given + number of double precision values to the scalar multiple of + another vector of the same length, and storing the result in + a third vector. + +USAGE: The program takes as input the number of threads, the number + of iterations to loop over the triad vectors, the length of the + vectors, and the offset between vectors + + <# threads> <# iterations> + + The output consists of diagnostics to make sure the + algorithm worked, and of timing statistics. + +FUNCTIONS CALLED: + + Other than OpenMP or standard C functions, the following + external functions are used in this program: + + wtime() + bail_out() + checkTRIADresults() + +NOTES: Bandwidth is determined as the number of words read, plus the + number of words written, times the size of the words, divided + by the execution time. For a vector length of N, the total + number of words read and written is 4*N*sizeof(double). + +HISTORY: This code is loosely based on the Stream benchmark by John + McCalpin, but does not follow all the Stream rules. Hence, + reported results should not be associated with Stream in + external publications +REVISION: Modified by Tim Mattson to handle OpenMP correctly +REVISION: Modified by Rob Van der Wijngaart, December 2005, to + parameterize vector size and offsets through compiler flags. + Also removed all Stream cases except TRIAD. +REVISION: Modified by Rob Van der Wijngaart, May 2006, to introduce + dependence between successive triad operations. This is + necessary to avoid dead code elimination +**********************************************************************/ + +#include +#include + +#define DEFAULTMAXLENGTH 2000000 +#ifdef MAXLENGTH + #if MAXLENGTH > 0 + #define N MAXLENGTH + #else + #define N DEFAULTMAXLENGTH + #endif +#else + #define N DEFAULTMAXLENGTH +#endif + +#ifdef STATIC_ALLOCATION + /* use static to make sure it goes on the heap, not the stack */ + static double a[N]; +#else + static double * RESTRICT a; +#endif + +static double * RESTRICT b; +static double * RESTRICT c; + +#define SCALAR 3.0 + +static int checkTRIADresults(int, long int); + +int main(int argc, char **argv) +{ + long j, iter; /* dummies */ + double scalar; /* constant used in Triad operation */ + int iterations; /* number of times vector loop gets repeated */ + long int length, /* total vector length */ + offset; /* offset between vectors a and b, and b and c */ + double bytes; /* memory IO size */ + size_t space; /* memory used for a single vector */ + double nstream_time, /* timing parameters */ + avgtime; + int nthread_input; /* thread parameters */ + int nthread; + int num_error=0; /* flag that signals that requested and + obtained numbers of threads are the same */ + +/********************************************************************************** +* process and test input parameters +***********************************************************************************/ + + if (argc != 5){ + printf("Usage: %s <# threads> <# iterations> \n", *argv); + exit(EXIT_FAILURE); + } + + nthread_input = atoi(*++argv); + iterations = atoi(*++argv); + length = atol(*++argv); + offset = atol(*++argv); + + if ((nthread_input < 1) || (nthread_input > MAX_THREADS)) { + printf("ERROR: Invalid number of threads: %d\n", nthread_input); + exit(EXIT_FAILURE); + } + + if ((iterations < 1)) { + printf("ERROR: Invalid number of iterations: %d\n", iterations); + exit(EXIT_FAILURE); + } + + if (length < 0) { + printf("ERROR: Invalid vector length: %ld\n", length); + exit(EXIT_FAILURE); + } + + if (offset < 0) { + printf("ERROR: Incvalid array offset: %ld\n", offset); + exit(EXIT_FAILURE); + } + +#ifdef STATIC_ALLOCATION + if ((3*length + 2*offset) > N) { + printf("ERROR: vector length/offset %ld/%ld too ", length, offset); + printf("large; increase MAXLENGTH in Makefile or decrease vector length\n"); + exit(EXIT_FAILURE); + } +#endif + + omp_set_num_threads(nthread_input); + +#ifndef STATIC_ALLOCATION + space = (3*length + 2*offset)*sizeof(double); + a = (double *) malloc(space); + if (!a) { + printf("ERROR: Could not allocate %ld words for vectors\n", + 3*length+2*offset); + exit(EXIT_FAILURE); + } +#endif + b = a + length + offset; + c = b + length + offset; + + #pragma omp parallel private(j,iter) + { + #pragma omp master + { + nthread = omp_get_num_threads(); + + printf("OpenMP stream triad: A = B + scalar*C\n"); + if (nthread != nthread_input) { + num_error = 1; + printf("ERROR: number of requested threads %d does not equal ", + nthread_input); + printf("number of spawned threads %d\n", nthread); + } + else { + printf("Number of threads = %i;\n",nthread_input); + printf("Vector length = %ld\n", length); + printf("Offset = %ld\n", offset); + printf("Number of iterations = %d\n", iterations); + } + } + bail_out(num_error); + + #pragma omp for + #pragma vector always + for (j=0; j epsilon) { + printf ("Failed Validation on output array\n"); +#ifndef VERBOSE + printf (" Expected checksum: %f \n",aj); + printf (" Observed checksum: %f \n",asum); +#endif + return (0); + } + else { + printf ("Solution validates\n"); + return (1); + } +} diff --git a/tests/apps/prk/tests/OPENMP/Random/Makefile.ohpc b/tests/apps/prk/tests/OPENMP/Random/Makefile.ohpc new file mode 100644 index 0000000000..04ec9689f6 --- /dev/null +++ b/tests/apps/prk/tests/OPENMP/Random/Makefile.ohpc @@ -0,0 +1,51 @@ +include ../../common/OPENMP.defs + +##### User configurable options ##### + +OPTFLAGS = $(DEFAULT_OPT_FLAGS) +#description: change above into something that is a decent optimization on you system + +#uncomment any of the following flags (and change values) to change defaults + +#RESTRICTFLAG = -DRESTRICT_KEYWORD +#description: the "restrict" keyword can be used on IA platforms to disambiguate +# data accessed through pointers + +HPCCFLAG = -DHPCC +#description: Uses HPC Challenge rules: non-atomic updates, shared table, +# 1% errors allowed; overrides ATOMICFLAG, CHUNKFLAG, ERRORPERCENTFLAG + +#ATOMICFLAG = -DATOMIC +#description: protect threads from simultaneous access to same memory location + +#CHUNKFLAG = -DCHUNKED +#description: assign chunks of Table to different threads, so no atomic needed + +ERRORPERCENTFLAG = -DERRORPERCENT=1 +#description: percent errors allowed in solution; if unset, no errors allowed + +#LONG64FLAG = -DLONG_IS_64BITS +#description: can use "long" for 64 bit integers instead of "long long" + +#DEBUGFLAG = -DVERBOSE +#description: default diagnostic style is silent + +#NTHREADFLAG = -DMAXTHREADS=n +#description: default thread limit is 256 + +USERFLAGS = +#description: parameter to specify optional flags + +EXTOBJS = +LIBS = +LIBPATHS = +INCLUDEPATHS = + +### End User configurable options ### + +TUNEFLAGS = $(RESTRICTFLAG) $(LONG64FLAG) $(DEBUGFLAG) $(NTHREADFLAG) $(USERFLAGS) \ + $(ATOMICFLAG) $(CHUNKFLAG) $(HPCCFLAG) $(ERRORPERCENTFLAG) +PROGRAM = random +OBJS = $(PROGRAM).o $(COMOBJS) + +include ../../common/make.common diff --git a/tests/apps/prk/tests/OPENMP/Random/random.c b/tests/apps/prk/tests/OPENMP/Random/random.c new file mode 100644 index 0000000000..b73ed7af0b --- /dev/null +++ b/tests/apps/prk/tests/OPENMP/Random/random.c @@ -0,0 +1,499 @@ +/* +Copyright (c) 2013, Intel Corporation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. +* Neither the name of Intel Corporation nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +*/ + +/************************************************************* +Copyright (c) 2013 The University of Tennessee. All rights reserved. +Redistribution and use in source and binary forms, with or +without modification, are permitted provided that the following +conditions are met: + +- Redistributions of source code must retain the + above copyright notice, this list of conditions and + the following disclaimer. + +- Redistributions in binary form must reproduce the + above copyright notice, this list of conditions and + the following disclaimer listed in this license in the + documentation and/or other materials provided with the + distribution. + +- Neither the name of the copyright holders nor the names + of its contributors may be used to endorse or promote + products derived from this software without specific + prior written permission. + +This software is provided by the copyright holders and +contributors "as is" and any express or implied warranties, +including, but not limited to, the implied warranties of +merchantability and fitness for a particular purpose are +disclaimed. in no event shall the copyright owner or +contributors be liable for any direct, indirect, incidental, +special, exemplary, or consequential damages (including, but +not limited to, procurement of substitute goods or services; +loss of use, data, or profits; or business interruption) +however caused and on any theory of liability, whether in +contract, strict liability, or tort (including negligence or +otherwise) arising in any way out of the use of this software, +even if advised of the possibility of such damage. + +*************************************************************/ + +/******************************************************************* + +NAME: RandomAccess + +PURPOSE: This program tests the efficiency of the memory subsystem to + update elements of an array with irregular stride. + +USAGE: The program takes as input the number of threads involved, the 2log + of the size of the table that gets updated, the ratio of table size + over number of updates, and the vector length of simultaneously + updatable table elements. When multiple threads participate, they + all share the same table. This can lead to conflicts in memory + accesses. Setting the ATOMICFLAG variable in the Makefile will + avoid conflicts, but at a large price, because the atomic + directive is currently not implemented on IA for the type of update + operation used here. Instead, a critical section is used, serializing + the main loop. + If the CHUNKFLAG variable is set, contiguous, non-overlapping chunks + of the array are assigned to individual threads. Each thread computes + all pseudo-random indices into the table, but only updates table + elements that fall inside its chunk. Hence, this version is safe, and + there is no false sharing. It is also non-scalable. + + <# threads> <#update ratio> + +FUNCTIONS CALLED: + + Other than OpenMP or standard C functions, the following + functions are used in this program: + + wtime() + bail_out() + PRK_starts() + poweroftwo() + +NOTES: This program is derived from HPC Challenge Random Access. The random + number generator computes successive powers of 0x2, modulo the + primitive polynomial x^63+x^2+x+1. The principal differences between + this code and the HPCC version are: + - we start the stream of random numbers not with seed 0x1, but the + SEQSEED-th element in the stream of powers of 0x2. + - the timed code applies the RandomAccess operator twice to the table of + computed resuls (starting with the same seed(s) for "ran" in both + iterations. The second pass makes sure that any update to any table + element that sets high-order bits in the first pass resets those bits + to zero. + - the verification test now simply constitutes checking whether table + element j equals j. + - the number of independent streams (vector length) can be changed by the + user. + + We note that the vectorized version of this code (i.e. nstarts unequal + to 1), does not feature exactly the same sequence of accesses and + intermediate update values in the table as the scalar version. The + reason for this is twofold. + 1. the elements in the stream of powers of 0x2 that get computed outside + the main timed loop as seeds for independent streams in the vectorized + version, using the jump-ahead function PRK_starts, are computed inside + the timed loop for the scalar version. However, since both versions do + the same number of timed random accesses, the vectorized version must + progress further in the sequence of powers of 0x2. + 2. The independent streams of powers of 0x2 computed in the vectorized + version can (and will) cause updates of the same elements of the table + in an order that is not consistent with the scalar version. That is, + distinct values of "ran" can refer to the same table element + "ran&(tablesize-1)," but the operation + Table[ran&(tablesize-1)] ^= ran will deposit different values in that + table element for different values of ran. At the end of each pass over + the data set, the table will contain the same values in the vector and + scalar version (ignoring the small differences caused by 1.) because of + commutativity of the XOR operator. If the update operator had been + non-commutative, the vector and scalar version would have yielded + different results. + +HISTORY: Written by Rob Van der Wijngaart, June 2006. + Histogram code (verbose mode) courtesy Roger Golliver + Shared table version derived from random.c by Michael Frumkin, October 2006 + +************************************************************************************/ + +#include +#include + +/* Define constants */ +/* PERIOD = (2^63-1)/7 = 7*73*127*337*92737*649657 */ +#ifdef LONG_IS_64BITS + #define POLY 0x0000000000000007UL + #define PERIOD 1317624576693539401L + /* sequence number in stream of random numbers to be used as initial value */ + #define SEQSEED 834568137686317453L +#else + #define POLY 0x0000000000000007ULL + #define PERIOD 1317624576693539401LL + /* sequence number in stream of random numbers to be used as initial value */ + #define SEQSEED 834568137686317453LL +#endif + +#ifdef HPCC + #undef ATOMIC + #undef CHUNKED + #undef ERRORPERCENT + #define ERRORPERCENT 1 +#else + #ifndef ERRORPERCENT + #define ERRORPERCENT 0 + #endif + #ifdef CHUNKED + #undef ATOMIC + #endif +#endif + +static u64Int PRK_starts(s64Int); +static int poweroftwo(int); + +int main(int argc, char **argv) { + + int my_ID; /* thread ID */ + int update_ratio; /* multiplier of tablesize for # updates */ + int nstarts; /* vector length */ + s64Int i, j, round, oldsize; /* dummies */ + s64Int error; /* number of incorrect table elements */ + s64Int tablesize; /* aggregate table size (all threads */ + s64Int nupdate; /* number of updates per thread */ + size_t tablespace; /* bytes per thread required for table */ + u64Int *ran; /* vector of random numbers */ + s64Int index; /* index into Table */ +#ifdef VERBOSE + u64Int * RESTRICT Hist; /* histogram of # updates to table elements */ + unsigned int *HistHist; /* histogram of update frequencies */ +#endif + u64Int * RESTRICT Table; /* (pseudo-)randomly accessed array */ + double random_time; + int nthread_input; /* thread parameters */ + int nthread; + int log2tablesize; /* log2 of aggregate table size */ + int num_error=0; /* flag that signals that requested and obtained + numbers of threads are the same */ + +#ifdef LONG_IS_64BITS + if (sizeof(long) != 8) { + printf("ERROR: Makefile says \"long\" is 8 bytes, but it is %d bytes\n", + sizeof(long)); + exit(EXIT_FAILURE); + } +#endif + +/********************************************************************* +** process and test input parameters +*********************************************************************/ + + if (argc != 5){ + printf("Usage: %s <# threads> <#update ratio> ", *argv); + printf("\n"); + exit(EXIT_FAILURE); + } + + nthread_input = atoi(*++argv); + /* test whether number of threads is positive */ + if (nthread_input <1) { + printf("ERROR: Invalid number of threads: %d, must be positive\n", + nthread_input); + exit(EXIT_FAILURE); + } + + omp_set_num_threads(nthread_input); + + log2tablesize = atoi(*++argv); + if (log2tablesize < 1){ + printf("ERROR: Log2 tablesize is %d; must be >= 1\n",log2tablesize); + exit(EXIT_FAILURE); + } + + update_ratio = atoi(*++argv); + /* test whether update ratio is positive */ + if (update_ratio <1) { + printf("ERROR: Invalid update ratio: %d, must be positive\n", + update_ratio); + exit(EXIT_FAILURE); + } + + nstarts = atoi(*++argv); + /* if whether vector length is positive */ + if (nstarts <1) { + printf("ERROR: Invalid vector length: %d, must be positive\n", + nstarts); + exit(EXIT_FAILURE); + } + + /* do some additional divisibility tests */ + if (nstarts%nthread_input) { + printf("ERROR: vector length %d must be divisible by # threads %d\n", + nstarts, nthread_input); + exit(EXIT_FAILURE); + } + if (update_ratio%nstarts) { + printf("ERROR: update ratio %d must be divisible by vector length %d\n", + update_ratio, nstarts); + exit(EXIT_FAILURE); + } + + + /* compute table size carefully to make sure it can be represented */ + tablesize = 1; + for (i=0; i= low && index < up) { +#endif + Table[index] ^= ran[j]; +#ifdef VERBOSE + #pragma omp atomic + Hist[index] += 1; +#endif +#ifdef CHUNKED + } +#endif + } + } + } + + #pragma omp master + { + random_time = wtime() - random_time; + } + + } /* end of OpenMP parallel region */ + + /* verification test */ + for(i=0;i ((double) ERRORPERCENT)*0.01)) { + printf("ERROR: number of incorrect table elements = "FSTR64U"\n", error); + exit(EXIT_FAILURE); + } + else { + printf("Solution validates, number of errors: %ld\n",(long) error); + printf("Rate (GUPs/s): %lf, time (s) = %lf\n", + 1.e-9*nupdate/random_time,random_time); + } + +#ifdef VERBOSE + for(i=0;i PERIOD) n -= PERIOD; + if (n == 0) return 0x1; + + temp = 0x1; + for (i=0; i<64; i++) { + m2[i] = temp; + temp = (temp << 1) ^ ((s64Int) temp < 0 ? POLY : 0); + temp = (temp << 1) ^ ((s64Int) temp < 0 ? POLY : 0); + } + + for (i=62; i>=0; i--) + if ((n >> i) & 1) + break; + + ran = 0x2; + while (i > 0) { + temp = 0; + for (j=0; j<64; j++) + if ((unsigned int)((ran >> j) & 1)) + temp ^= m2[j]; + ran = temp; + i -= 1; + if ((n >> i) & 1) + ran = (ran << 1) ^ ((s64Int) ran < 0 ? POLY : 0); + } + + return ran; +} + +/* utility routine that tests whether an integer is a power of two */ +int poweroftwo(int n) { + int log2n = 0; + + while ((1< <# threads> <# iterations> [] + + The output consists of diagnostics to make sure the + algorithm worked, and of timing statistics. + +FUNCTIONS CALLED: + + Other than OpenMP or standard C functions, the following + functions are used in this program: + + wtime() + bail_out() + +NOTES: The long-optimal algorithm is based on a distributed memory + algorithm decribed in: + Collective Communication; Theory, Practice, and Experience by + Chan, Heimlich, Purkayastha, Van de Geijn (to Appear). This + is a two-phase, multi-stage algorithm. In the first phase, + partial sums of the vectors are built by each thread locally. + In the second phase the partial sums are collected on the + master thread. In the distributed-memory algorithm the second + phase also has multiple stages. In the shared-memory algorithm + it is more efficient to let each thread write its contribution + into the master thread vector in a single stage. + +HISTORY: Written by Rob Van der Wijngaart, March 2006. + +*******************************************************************/ + +#include +#include + +#define LINEAR 11 +#define BINARY_BARRIER 12 +#define BINARY_P2P 13 +#define LONG_OPTIMAL 14 +#define NONE 15 +#define LOCAL 16 +#define VEC0(id,i) vector[(id )*(vector_length)+i] +#define VEC1(id,i) vector[(id+nthread)*(vector_length)+i] +/* define shorthand for flag with cache line padding */ +#define LINEWORDS 16 +#define flag(i) flag[(i)*LINEWORDS] + +int main(int argc, char ** argv) +{ + int my_ID; /* Thread ID */ + long vector_length; /* length of vectors to be aggregated */ + long total_length; /* bytes needed to store reduction vectors */ + double reduce_time, /* timing parameters */ + avgtime; + double epsilon=1.e-8; /* error tolerance */ + int group_size, /* size of aggregating half of thread pool */ + old_size, /* group size in previous binary tree iteration */ + i, id, iter, stage; /* dummies */ + double element_value; /* reference element value for final vector */ + char *algorithm; /* reduction algorithm selector */ + int intalgorithm; /* integer encoding of algorithm selector */ + int iterations; /* number of times the reduction is carried out */ + int flag[MAX_THREADS*LINEWORDS]; /* used for pairwise synchronizations */ + int start[MAX_THREADS], + end[MAX_THREADS];/* segments of vectors for bucket algorithm */ + long segment_size; + int my_donor, my_segment; + int nthread_input, /* thread parameters */ + nthread; + double RESTRICT *vector;/* vector pair to be reduced */ + int num_error=0; /* flag that signals that requested and obtained + numbers of threads are the same */ + +/***************************************************************************** +** process and test input parameters +******************************************************************************/ + + if (argc != 4 && argc != 5){ + printf("Usage: %s <# threads> <# iterations> ", *argv); + printf("[]\n"); + printf("Algorithm: linear, binary-barrier, binary-p2p, or long-optimal\n"); + return(EXIT_FAILURE); + } + + /* Take number of threads to request from command line */ + nthread_input = atoi(*++argv); + + if ((nthread_input < 1) || (nthread_input > MAX_THREADS)) { + printf("ERROR: Invalid number of threads: %d\n", nthread_input); + exit(EXIT_FAILURE); + } + + omp_set_num_threads(nthread_input); + + iterations = atoi(*++argv); + if (iterations < 1){ + printf("ERROR: Iterations must be positive : %d \n", iterations); + exit(EXIT_FAILURE); + } + + vector_length = atol(*++argv); + if (vector_length < 1){ + printf("ERROR: vector length must be >= 1 : %d \n",vector_length); + exit(EXIT_FAILURE); + } + + total_length = 2*nthread_input*sizeof(double)*vector_length; + vector = (double *) malloc(total_length); + if (!vector) { + printf("Could not allocate space for vectors\n"); + exit(EXIT_FAILURE); + } + + algorithm = "binary-p2p"; + if (argc == 5) algorithm = *++argv; + + intalgorithm = NONE; + if (!strcmp(algorithm,"linear" )) intalgorithm = LINEAR; + if (!strcmp(algorithm,"binary-barrier")) intalgorithm = BINARY_BARRIER; + if (!strcmp(algorithm,"binary-p2p" )) intalgorithm = BINARY_P2P; + if (!strcmp(algorithm,"long-optimal" )) intalgorithm = LONG_OPTIMAL; + if (intalgorithm == NONE) { + printf("Wrong algorithm: %s; choose linear, binary-barrier, ", algorithm); + printf("binary-p2p, or long-optimal\n"); + exit(EXIT_FAILURE); + } + else { + if (nthread_input == 1) intalgorithm = LOCAL; + } + + #pragma omp parallel private(i, old_size, group_size, my_ID, iter, start, end, \ + segment_size, stage, id, my_donor, my_segment) + { + + my_ID = omp_get_thread_num(); + + #pragma omp master + { + nthread = omp_get_num_threads(); + + printf("OpenMP Vector Reduction\n"); + if (nthread != nthread_input) { + num_error = 1; + printf("ERROR: number of requested threads %d does not equal ", + nthread_input); + printf("number of spawned threads %d\n", nthread); + } + else { + printf("Number of threads = %d\n",nthread_input); + printf("Vector length = %d\n", vector_length); + printf("Reduction algorithm = %s\n", algorithm); + printf("Number of iterations = %d\n", iterations); + } + } + bail_out(num_error); + + for (iter=0; iter<=iterations; iter++) { + + /* start timer after a warmup iteration */ + if (iter == 1) { + #pragma omp barrier + #pragma omp master + { + reduce_time = wtime(); + } + } + + /* in case of the long-optimal algorithm we need a barrier before the + reinitialization to make sure that we don't overwrite parts of the + vector before other threads are done with those parts */ + if (intalgorithm == LONG_OPTIMAL) { + #pragma omp barrier + } + + /* initialize the arrays, assuming first-touch memory placement */ + for (i=0; i1) { + /* barrier to make sure threads have completed their updates before + the results are being read */ + #pragma omp barrier + old_size = group_size; + group_size = (group_size+1)/2; + + /* Threads in "first half" of group aggregate data from threads in + second half; must make sure the counterpart is within old group. + If group size is odd, the last thread in the group does not have + a counterpart. */ + if (my_ID < group_size && my_ID+group_size1) { + + old_size = group_size; + group_size = (group_size+1)/2; + + /* synchronize between each pair of threads that collaborate to + aggregate a new subresult, to make sure the donor of the pair has + updated its vector in the previous round before it is being read */ + if (my_ID < group_size && my_ID+group_size= epsilon) { + printf("First error at i=%d; value: %lf; reference value: %lf\n", + i, VEC0(0,i), element_value); + exit(EXIT_FAILURE); + } + } + + printf("Solution validates\n"); +#ifdef VERBOSE + printf("Element verification value: %lf\n", element_value); +#endif + avgtime = reduce_time/iterations; + printf("Rate (MFlops/s): %lf Avg time (s): %lf\n", + 1.0E-06 * (2.0*nthread-1.0)*vector_length/avgtime, avgtime); + + exit(EXIT_SUCCESS); +} diff --git a/tests/apps/prk/tests/OPENMP/RefCount_private/Makefile.ohpc b/tests/apps/prk/tests/OPENMP/RefCount_private/Makefile.ohpc new file mode 100644 index 0000000000..d714e75af2 --- /dev/null +++ b/tests/apps/prk/tests/OPENMP/RefCount_private/Makefile.ohpc @@ -0,0 +1,41 @@ +include ../../common/OPENMP.defs + +##### User configurable options ##### + +OPTFLAGS = $(DEFAULT_OPT_FLAGS) +#description: change above into something that is a decent optimization on you system + +#uncomment any of the following flags (and change values) to change defaults + +LOCKFLAG = -DLOCK +#description: if flag is unset, no locks will be used + +#LONG64FLAG = -DLONG_IS_64BITS +#description: can use "long" for 64 bit integers instead of "long long" + +#CACHEFLAG = -DLINE_LENGTH=L +#description: default cache line size is 64 bytes + +#DEBUGFLAG = -DVERBOSE +#description: default diagnostic style is silent + +#NTHREADFLAG = -DMAXTHREADS=n +#description: default thread limit is 256 + +USERFLAGS = +#description: parameter to specify optional flags + +EXTOBJS = +LIBS = +LIBPATHS = +INCLUDEPATHS = + +### End User configurable options ### + +TUNEFLAGS = $(LONG64FLAG) $(CACHEFLAG) $(LOCKFLAG) \ + $(DEBUGFLAG) $(NTHREADFLAG) $(USERFLAGS) +PROGRAM = private +# objects below are the default, used by "clean," if invoked +OBJS = $(PROGRAM).o $(COMOBJS) + +include ../../common/make.common diff --git a/tests/apps/prk/tests/OPENMP/RefCount_private/private.c b/tests/apps/prk/tests/OPENMP/RefCount_private/private.c new file mode 100755 index 0000000000..2b0dc36bf3 --- /dev/null +++ b/tests/apps/prk/tests/OPENMP/RefCount_private/private.c @@ -0,0 +1,262 @@ +/* +Copyright (c) 2013, Intel Corporation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. +* Neither the name of Intel Corporation nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +*/ + +/******************************************************************* + +NAME: RefCount + +PURPOSE: This program tests the efficiency of exclusive access to a + pair of non-adjacent private reference counters + +USAGE: The program takes as input the total number of times each + thread updates its the reference counters, and the number of + threads involved. + + <# threads><# iterations> + + The output consists of diagnostics to make sure the + algorithm worked, and of timing statistics. + +FUNCTIONS CALLED: + + Other than OpenMP or standard C functions, the following + functions are used in this program: + + wtime() + bail_out() + +HISTORY: Written by Rob Van der Wijngaart, January 2006. + +*******************************************************************/ + +#include +#include + +/* choose a default cache line size (bytes); not that if we do not undefine + before redefining the variable, we get a warning */ +#if !defined(LINE_LENGTH) || LINE_LENGTH < 1 + #undef LINE_LENGTH + #define LINE_LENGTH 128 +#endif + +int main(int argc, char ** argv) +{ + int iterations; /* number of reference counter updates per thread */ + int iter, thread; + int line_fit; /* indicates that elements fit on different lines */ + s64Int alloc_unit; /* amount of space reserved per element */ + s64Int **pcounter1, + **pcounter2; /* pointers to pointers to space for counters */ + s64Int *counter_space; /* pointer to space reserved for counters */ + omp_lock_t **counter_lock; + omp_lock_t *lock_space; /* pointer to space reserved for lock handles */ + double refcount_time; /* timing parameter */ + int nthread_input, + nthread; /* number of threads requested and used */ + s64Int global_counter1, + global_counter2; + int num_error=0; /* flag that signals that requested and obtained + numbers of threads are the same */ + +/********************************************************************* +** process and test input parameters +*********************************************************************/ + + if (argc != 3){ + printf("Usage: %s <# threads> <# counter pair updates>\n", *argv); + exit(EXIT_FAILURE); + } + + nthread_input = atoi(*++argv); + if ((nthread_input < 1) || (nthread_input > MAX_THREADS)) { + printf("ERROR: Invalid number of threads: %d\n", nthread_input); + exit(EXIT_FAILURE); + } + + omp_set_num_threads(nthread_input); + + iterations = atoi(*++argv); + if (iterations < 1){ + printf("ERROR: iterations must be >= 1 : %d \n",iterations); + exit(EXIT_FAILURE); + } + + /* allocate the locks on which we will be pounding; we + put them on different cache lines, if possible */ + + counter_lock = (omp_lock_t **) malloc(nthread_input*sizeof(omp_lock_t *)); + if (!counter_lock) { + printf("Not able to allocate memory for counter lock handles\n"); + exit(EXIT_FAILURE); + } + + /* we try to put counter locks on different cache lines */ + line_fit = 1; + if (sizeof(omp_lock_t) > LINE_LENGTH) + alloc_unit = (sizeof(omp_lock_t)/LINE_LENGTH+1)*LINE_LENGTH; + else + alloc_unit = LINE_LENGTH; + + lock_space = (omp_lock_t *) malloc(2*nthread_input*alloc_unit); + while (!lock_space && alloc_unit >= 2*sizeof(s64Int)) { + line_fit = 0; + alloc_unit/=2; + lock_space = (omp_lock_t *)malloc(2*nthread_input*alloc_unit); + } + if (!lock_space) { + printf("Not able to allocate memory for lock handles\n"); + exit(EXIT_FAILURE); + } + +#ifdef VERBOSE + if (!line_fit) printf("Lock handles do not fit on separate cache lines\n"); + else printf("Lock handles fit on separate cache lines\n"); +#endif + + /* we try to put private counters on different cache lines */ + pcounter1 = (s64Int **) malloc(nthread_input*sizeof(s64Int *)); + pcounter2 = (s64Int **) malloc(nthread_input*sizeof(s64Int *)); + if (!pcounter1 || !pcounter2) { + printf("Not able to allocate memory for reference counter pointers\n"); + exit(EXIT_FAILURE); + } + + line_fit = 1; + if (sizeof(s64Int) > LINE_LENGTH) + alloc_unit = (sizeof(s64Int)/LINE_LENGTH+1)*LINE_LENGTH; + else + alloc_unit = LINE_LENGTH; + counter_space = malloc(2*nthread_input*alloc_unit); + while (!counter_space && alloc_unit >= 2*sizeof(s64Int)) { + line_fit = 0; + alloc_unit/=2; + counter_space = malloc(2*nthread_input*alloc_unit); + } + if (!counter_space) { + printf("Not able to allocate memory for reference counters\n"); + exit(EXIT_FAILURE); + } +#ifdef VERBOSE + printf("Cache line size used: %d bytes\n", LINE_LENGTH); + if (!line_fit) printf("Counters do not fit on separate cache lines\n"); + else printf("Counters fit on separate cache lines\n"); +#endif + + #pragma omp parallel + { + + int my_ID; /* Thread ID */ + int iter; /* dummy */ + + my_ID = omp_get_thread_num(); + + /* for maximum performance we rely on first touch and parallel initialization */ + + /* each thread initializes its own counters */ + pcounter1[my_ID] = (s64Int *)((char *)counter_space + my_ID*2*alloc_unit); + pcounter2[my_ID] = (s64Int *)((char *)counter_space + (my_ID*2+1)*alloc_unit); + *(pcounter1[my_ID]) = 0; + *(pcounter2[my_ID]) = 0; + + /* each thread initializes its own lock */ + counter_lock[my_ID] = (omp_lock_t *)((char *)lock_space + my_ID*alloc_unit); + omp_init_lock(counter_lock[my_ID]); + + #pragma omp master + { + nthread = omp_get_num_threads(); + printf("OpenMP exclusive access test RefCount, private counters\n"); + if (nthread != nthread_input) { + num_error = 1; + printf("ERROR: number of requested threads %d does not equal ", + nthread_input); + printf("number of spawned threads %d\n", nthread); + } + else { + printf("Number of threads = %i;\n",nthread_input); + printf("Number of counter pair updates = %i\n", iterations); +#ifndef LOCK + printf("Not "); +#endif + printf("Using (uncontended) locks\n"); + } + } + bail_out(num_error); + + #pragma omp master + { + refcount_time = wtime(); + } + + #pragma omp for + for (iter=0; iter <# threads><# iterations> + + The output consists of diagnostics to make sure the + algorithm worked, and of timing statistics. + +FUNCTIONS CALLED: + + Other than OpenMP or standard C functions, the following + functions are used in this program: + + wtime() + bail_out() + getpagesize() + +HISTORY: Written by Rob Van der Wijngaart, January 2006. + +*******************************************************************/ + +#include +#include + +/* shouldn't need the prototype below, since it is defined in . But it + depends on the existence of symbols __USE_BSD or _USE_XOPEN_EXTENDED, neither + of which may be present. To avoid warnings, we define the prototype here */ +#if !defined(__USE_BSD) && !defined(__USE_XOPEN_EXTENDED) +extern int getpagesize(void); +#endif +#define COUNTER1 (*pcounter1) +#define COUNTER2 (*pcounter2) + +int main(int argc, char ** argv) +{ + int iterations; /* total number of reference pair counter updates */ + int page_fit; /* indicates that counters fit on different pages */ + size_t store_size; /* amount of space reserved for counters */ + double *pcounter1, + *pcounter2; /* pointers to counters */ + double cosa, sina; /* cosine and sine of rotation angle */ + double *counter_space; /* pointer to space reserved for counters */ + double refcounter1, + refcounter2; /* reference values for counters */ + double epsilon=1.e-7; /* required accuracy */ + omp_lock_t counter_lock; /* lock that guards access to counters */ + double refcount_time; /* timing parameter */ + int nthread_input; /* thread parameters */ + int nthread; + int num_error=0; /* flag that signals that requested and obtained + numbers of threads are the same */ + +/********************************************************************* +** process and test input parameters +*********************************************************************/ + + if (argc != 3){ + printf("Usage: %s <# threads> <# counter pair updates>\n", *argv); + return(1); + } + + nthread_input = atoi(*++argv); + if ((nthread_input < 1) || (nthread_input > MAX_THREADS)) { + printf("ERROR: Invalid number of threads: %d\n", nthread_input); + exit(EXIT_FAILURE); + } + + iterations = atoi(*++argv); + if (iterations < 1){ + printf("ERROR: iterations must be >= 1 : %d \n",iterations); + exit(EXIT_FAILURE); + } + + omp_set_num_threads(nthread_input); + + /* initialize shared counters; we put them on different pages, if possible. + If the page size equals the whole memory, this will fail, and we reduce + the space required */ + page_fit = 1; + store_size = (size_t) getpagesize(); +#ifdef VERBOSE + printf("Page size = %d\n", getpagesize()); +#endif + counter_space = (double *) malloc(store_size+sizeof(double)); + while (!counter_space && store_size>2*sizeof(double)) { + page_fit=0; + + store_size/=2; + counter_space = (double *) malloc(store_size+sizeof(double)); + } + if (!counter_space) { + printf("ERROR: could not allocate space for counters\n"); + exit(EXIT_FAILURE); + } + +#ifdef VERBOSE + if (!page_fit) printf("Counters do not fit on different pages\n"); + else printf("Counters fit on different pages\n"); +#endif + + pcounter1 = counter_space; + pcounter2 = counter_space + store_size/sizeof(double); + + COUNTER1 = 1.0; + COUNTER2 = 0.0; + + cosa = cos(1.0); + sina = sin(1.0); + + /* initialize the lock on which we will be pounding */ + omp_init_lock(&counter_lock); + + #pragma omp parallel + { + int iter; /* dummy */ + double tmp1; /* local copy of previous value of COUNTER1 */ + + #pragma omp master + { + nthread = omp_get_num_threads(); + printf("OpenMP exclusive access test RefCount, shared counters\n"); + if (nthread != nthread_input) { + num_error = 1; + printf("ERROR: number of requested threads %d does not equal ", + nthread_input); + printf("number of spawned threads %d\n", nthread); + } + else { + printf("Number of threads = %d\n",nthread_input); + printf("Number of counter pair updates = %d\n", iterations); +#ifdef DEPENDENT + printf("Dependent atomic counter pair update\n"); +#else + printf("Independent atomic counter updates\n"); +#endif + } + } + bail_out(num_error); + + #pragma omp master + { + refcount_time = wtime(); + } + + #pragma omp for + /* start with iteration nthread to take into account pre-loop iter */ + for (iter=0; iterepsilon) || + (ABS(COUNTER2-refcounter2)>epsilon)) { + printf("ERROR: Incorrect or inconsistent counter values %13.10lf %13.10lf; ", + COUNTER1, COUNTER2); + printf("should be %13.10lf, %13.10lf\n", refcounter1, refcounter2); + } + else { +#ifdef VERBOSE + printf("Solution validates; Correct counter values %13.10lf %13.10lf\n", + COUNTER1, COUNTER2); +#else + printf("Solution validates\n"); +#endif + printf("Rate (MCPUPs/s): %lf, time (s): %lf\n", + iterations/refcount_time*1.e-6, refcount_time); + } + + exit(EXIT_SUCCESS); +} diff --git a/tests/apps/prk/tests/OPENMP/Sparse/Makefile.ohpc b/tests/apps/prk/tests/OPENMP/Sparse/Makefile.ohpc new file mode 100644 index 0000000000..16c34224bd --- /dev/null +++ b/tests/apps/prk/tests/OPENMP/Sparse/Makefile.ohpc @@ -0,0 +1,38 @@ +include ../../common/OPENMP.defs + +##### User configurable options ##### + +OPTFLAGS = $(DEFAULT_OPT_FLAGS) +#description: change above into something that is a decent optimization on you system + +#uncomment any of the following flags (and change values) to change defaults + +#RESTRICTFLAG = -DRESTRICT_KEYWORD +#description: the "restrict" keyword can be used on IA platforms to disambiguate +# data accessed through pointers + +#DEBUGFLAG = -DVERBOSE +#description: default diagnostic style is silent + +SCRAMBLEFLAG = -DSCRAMBLE +#description: if flag is set, grid indices are scrambled to produce irregular stride + +#NTHREADFLAG = -DMAXTHREADS=n +#description: default thread limit is 256 + +USERFLAGS = +#description: parameter to specify optional flags + +EXTOBJS = +LIBS = +LIBPATHS = +INCLUDEPATHS = + +### End User configurable options ### + +TUNEFLAGS = $(DEBUGFLAG) $(NTHREADFLAG) $(USERFLAGS) $(SCRAMBLEFLAG) \ + $(RESTRICTFLAG) +PROGRAM = sparse +OBJS = $(PROGRAM).o $(COMOBJS) + +include ../../common/make.common diff --git a/tests/apps/prk/tests/OPENMP/Sparse/README b/tests/apps/prk/tests/OPENMP/Sparse/README new file mode 100755 index 0000000000..81755fc7db --- /dev/null +++ b/tests/apps/prk/tests/OPENMP/Sparse/README @@ -0,0 +1,32 @@ +This program constructs a sparse matrix and performs a (parallel) +sparse matrix-vector multiplication. The sparse matrix is built as +follows. The standard star-shaped discretization stencil with a +user-specified radius is applied to a structured 2-dimensional +grid. Example of a stencil with radius r=2: + + 0 + | + 0 + | + 0--0--0--0--0 + | + 0 + | + 0 + +Here, the `0' symbol signifies inclusion in the stencil. A square grid +with linear dimension (2^n) has 2^(2n) = 4^n points. The resulting +matrix has (4^n) rows and (4^n) columns, for a total of (16^n) +elements. The user specifies n. The stencil is applied in a periodic +fashion, i.e. it wraps around the edges of the grid. + +If the scramble flag is unset in the Makefile, the discretization +stencil results in a regularly banded sparse matrix, which can be +stored efficiently in vectors, in principle. If the scramble flag is +maintained, the columns of the matrix are permuted, resulting in a +general irregular sparse matrix, but with a known number of nonzeroes +per row (4r+1). We use Compressed Row Storage for accessing the matrix +elements, even in the case of an unset scramble flag. Numerical values +of matrix elements are chosen judiciously to make verification +easy. They do not correspond to any realistic discretization of a +continuum problem. diff --git a/tests/apps/prk/tests/OPENMP/Sparse/sparse.c b/tests/apps/prk/tests/OPENMP/Sparse/sparse.c new file mode 100755 index 0000000000..c124798a0e --- /dev/null +++ b/tests/apps/prk/tests/OPENMP/Sparse/sparse.c @@ -0,0 +1,351 @@ +/* +Copyright (c) 2013, Intel Corporation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. +* Neither the name of Intel Corporation nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +*/ + +/********************************************************************************* + +NAME: sparse + +PURPOSE: This program tests the efficiency with which a sparse matrix + vector multiplication is carried out + +USAGE: The program takes as input the number of threads, the 2log of the linear + size of the 2D grid (equalling the 2log of the square root of the order + of the sparse matrix), the radius of the difference stencil, and the number + of times the matrix-vector multiplication is carried out. + + <# threads> <# iterations> <2log root-of-matrix-order> + + The output consists of diagnostics to make sure the + algorithm worked, and of timing statistics. + +FUNCTIONS CALLED: + + Other than OpenMP or standard C functions, the following + functions are used in this program: + + wtime() + bail_out() + reverse() + +NOTES: + +HISTORY: Written by Rob Van der Wijngaart, August 2006. + Updated by RvdW to parallelize matrix generation, March 2007. + Updated by RvdW to fix verification bug, February 2013 + Updated by RvdW to sort matrix elements to reflect traditional CSR storage, + August 2013 + +***********************************************************************************/ + +#include +#include + +/* linearize the grid index */ +#define LIN(i,j) (i+((j)< <# iterations> <2log grid size> \n",*argv); + exit(EXIT_FAILURE); + } + + /* Take number of threads to request from command line */ + nthread_input = atoi(*++argv); + + if ((nthread_input < 1) || (nthread_input > MAX_THREADS)) { + printf("ERROR: Invalid number of threads: %d\n", nthread_input); + exit(EXIT_FAILURE); + } + + omp_set_num_threads(nthread_input); + + iterations = atoi(*++argv); + if (iterations < 1){ + printf("ERROR: Iterations must be positive : %d \n", iterations); + exit(EXIT_FAILURE); + } + + lsize = atoi(*++argv); + lsize2 = 2*lsize; + size = 1< epsilon) { + printf("ERROR: Vector sum = %lf, Reference vector sum = %lf\n", + vector_sum, reference_sum); + exit(EXIT_FAILURE); + } + else { + printf("Solution validates\n"); +#ifdef VERBOSE + printf("Reference sum = %lf, vector sum = %lf\n", + reference_sum, vector_sum); +#endif + } + + avgtime = sparse_time/iterations; + printf("Rate (MFlops/s): %lf Avg time (s): %lf\n", + 1.0E-06 * (2.0*nent)/avgtime, avgtime); + + exit(EXIT_SUCCESS); +} + +/* Code below reverses bits in unsigned integer stored in a 64-bit word. + Bit reversal is with respect to the largest integer that is going to be + processed for the particular run of the code, to make sure the reversal + constitutes a true permutation. Hence, the final result needs to be shifted + to the right. + Example: if largest integer being processed is 0x000000ff = 255 = + 0000...0011111111 (binary), then the unshifted reversal of 0x00000006 = 6 = + 0000...0000000110 (binary) would be 011000000...0000 = 3*2^61, which is + outside the range of the original sequence 0-255. Setting shift_in_bits to + 2log(256) = 8, the final result is shifted the the right by 64-8=56 bits, + so we get 000...0001100000 (binary) = 96, which is within the proper range */ +u64Int reverse(register u64Int x, int shift_in_bits){ + x = ((x >> 1) & 0x5555555555555555) | ((x << 1) & 0xaaaaaaaaaaaaaaaa); + x = ((x >> 2) & 0x3333333333333333) | ((x << 2) & 0xcccccccccccccccc); + x = ((x >> 4) & 0x0f0f0f0f0f0f0f0f) | ((x << 4) & 0xf0f0f0f0f0f0f0f0); + x = ((x >> 8) & 0x00ff00ff00ff00ff) | ((x << 8) & 0xff00ff00ff00ff00); + x = ((x >> 16) & 0x0000ffff0000ffff) | ((x << 16) & 0xffff0000ffff0000); + x = ((x >> 32) & 0x00000000ffffffff) | ((x << 32) & 0xffffffff00000000); + return (x>>((sizeof(u64Int)*BITS_IN_BYTE-shift_in_bits))); +} + +int compare(const void *el1, const void *el2) { + s64Int v1 = *(s64Int *)el1; + s64Int v2 = *(s64Int *)el2; + return (v1v2) ? 1 : 0; +} diff --git a/tests/apps/prk/tests/OPENMP/Stencil/Makefile.ohpc b/tests/apps/prk/tests/OPENMP/Stencil/Makefile.ohpc new file mode 100644 index 0000000000..0b026ae355 --- /dev/null +++ b/tests/apps/prk/tests/OPENMP/Stencil/Makefile.ohpc @@ -0,0 +1,47 @@ +include ../../common/OPENMP.defs +##### User configurable options ##### + +OPTFLAGS = $(DEFAULT_OPT_FLAGS) +#description: change above into something that is a decent optimization on you system + +#uncomment any of the following flags (and change values) to change defaults + +#RESTRICTFLAG = -DRESTRICT_KEYWORD +#description: the "restrict" keyword can be used on IA platforms to disambiguate +# data accessed through pointers + +RADIUSFLAG = -DRADIUS=2 +#description: default radius of filter to be applied is 2 + +DOUBLEFLAG = -DDOUBLE +#description: default data type is single precision + +PARALLELFORFLAG = -DPARALLELFOR +#description: default is a single parallel region for all iterations + +STARFLAG = -DSTAR +#description: default stencil is compact (dense, square) + +#DEBUGFLAG = -DVERBOSE +#description: default diagnostic style is silent + +#NTHREADFLAG = -DMAXTHREADS=n +#description: default thread limit is 256 + +USERFLAGS = +#description: parameter to specify optional flags + +#set the following variables for custom libraries and/or other objects +EXTOBJS = +LIBS = +LIBPATHS = +INCLUDEPATHS = + +### End User configurable options ### + +TUNEFLAGS = $(RESTRICTFLAG) $(DEBUGFLAG) $(NTHREADFLAG) $(USERFLAGS) \ + $(DOUBLEFLAG) $(RADIUSFLAG) $(STARFLAG) $(PARALLELFORFLAG) +PROGRAM = stencil +OBJS = $(PROGRAM).o $(COMOBJS) + +include ../../common/make.common diff --git a/tests/apps/prk/tests/OPENMP/Stencil/stencil.c b/tests/apps/prk/tests/OPENMP/Stencil/stencil.c new file mode 100755 index 0000000000..b52d392ca1 --- /dev/null +++ b/tests/apps/prk/tests/OPENMP/Stencil/stencil.c @@ -0,0 +1,337 @@ +/* +Copyright (c) 2013, Intel Corporation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. +* Neither the name of Intel Corporation nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +*/ + +/******************************************************************* + +NAME: Stencil + +PURPOSE: This program tests the efficiency with which a space-invariant, + linear, symmetric filter (stencil) can be applied to a square + grid or image. + +USAGE: The program takes as input the number of threads, the linear + dimension of the grid, and the number of iterations on the grid + + <# threads> + + The output consists of diagnostics to make sure the + algorithm worked, and of timing statistics. + +FUNCTIONS CALLED: + + Other than OpenMP or standard C functions, the following + functions are used in this program: + + wtime() + bail_out() + +HISTORY: - Written by Rob Van der Wijngaart, November 2006. + - RvdW: Removed unrolling pragmas for clarity; + added constant to array "in" at end of each iteration to force + refreshing of neighbor data in parallel versions; August 2013 + +*******************************************************************/ + +#include +#include + +#ifndef RADIUS + #define RADIUS 2 +#endif + +#ifdef DOUBLE + #define DTYPE double + #define EPSILON 1.e-8 + #define COEFX 1.0 + #define COEFY 1.0 + #define FSTR "%lf" +#else + #define DTYPE float + #define EPSILON 0.0001f + #define COEFX 1.0f + #define COEFY 1.0f + #define FSTR "%f" +#endif + +/* define shorthand for indexing a multi-dimensional array */ +#define IN(i,j) in[i+(j)*(n)] +#define OUT(i,j) out[i+(j)*(n)] +#define WEIGHT(ii,jj) weight[ii+RADIUS][jj+RADIUS] + +int main(int argc, char ** argv) { + + int n; /* linear grid dimension */ + int i, j, ii, jj, it, jt, iter; /* dummies */ + DTYPE norm, /* L1 norm of solution */ + reference_norm; + DTYPE f_active_points; /* interior of grid with respect to stencil */ + DTYPE flops; /* floating point ops per iteration */ + int iterations; /* number of times to run the algorithm */ + double stencil_time, /* timing parameters */ + avgtime; + int stencil_size; /* number of points in stencil */ + int nthread_input, /* thread parameters */ + nthread; + DTYPE * RESTRICT in; /* input grid values */ + DTYPE * RESTRICT out; /* output grid values */ + long total_length; /* total required length to store grid values */ + int num_error=0; /* flag that signals that requested and obtained + numbers of threads are the same */ + DTYPE weight[2*RADIUS+1][2*RADIUS+1]; /* weights of points in the stencil */ + + /******************************************************************************* + ** process and test input parameters + ********************************************************************************/ + + if (argc != 4){ + printf("Usage: %s <# threads> <# iterations> \n", + *argv); + return(EXIT_FAILURE); + } + + /* Take number of threads to request from command line */ + nthread_input = atoi(*++argv); + + if ((nthread_input < 1) || (nthread_input > MAX_THREADS)) { + printf("ERROR: Invalid number of threads: %d\n", nthread_input); + exit(EXIT_FAILURE); + } + + omp_set_num_threads(nthread_input); + + iterations = atoi(*++argv); + if (iterations < 1){ + printf("ERROR: iterations must be >= 1 : %d \n",iterations); + exit(EXIT_FAILURE); + } + + n = atoi(*++argv); + + if (n < 1){ + printf("ERROR: grid dimension must be positive: %d\n", n); + exit(EXIT_FAILURE); + } + + if (RADIUS < 1) { + printf("ERROR: Stencil radius %d should be positive\n", RADIUS); + exit(EXIT_FAILURE); + } + + if (2*RADIUS +1 > n) { + printf("ERROR: Stencil radius %d exceeds grid size %d\n", RADIUS, n); + exit(EXIT_FAILURE); + } + + /* make sure the vector space can be represented */ + total_length = n*n*sizeof(DTYPE); + + in = (DTYPE *) malloc(total_length); + out = (DTYPE *) malloc(total_length); + if (!in || !out) { + printf("ERROR: could not allocate space for input or output array\n"); + exit(EXIT_FAILURE); + } + + /* fill the stencil weights to reflect a discrete divergence operator */ + for (jj=-RADIUS; jj<=RADIUS; jj++) for (ii=-RADIUS; ii<=RADIUS; ii++) + WEIGHT(ii,jj) = (DTYPE) 0.0; +#ifdef STAR + stencil_size = 4*RADIUS+1; + for (ii=1; ii<=RADIUS; ii++) { + WEIGHT(0, ii) = WEIGHT( ii,0) = (DTYPE) (1.0/(2.0*ii*RADIUS)); + WEIGHT(0,-ii) = WEIGHT(-ii,0) = -(DTYPE) (1.0/(2.0*ii*RADIUS)); + } +#else + stencil_size = (2*RADIUS+1)*(2*RADIUS+1); + for (jj=1; jj<=RADIUS; jj++) { + for (ii=-jj+1; ii EPSILON) { + printf("ERROR: L1 norm = "FSTR", Reference L1 norm = "FSTR"\n", + norm, reference_norm); + exit(EXIT_FAILURE); + } + else { + printf("Solution validates\n"); +#ifdef VERBOSE + printf("Reference L1 norm = "FSTR", L1 norm = "FSTR"\n", + reference_norm, norm); +#endif + } + + flops = (DTYPE) (2*stencil_size+1) * f_active_points; + avgtime = stencil_time/iterations; + printf("Rate (MFlops/s): "FSTR" Avg time (s): %lf\n", + 1.0E-06 * flops/avgtime, avgtime); + + exit(EXIT_SUCCESS); +} diff --git a/tests/apps/prk/tests/OPENMP/Synch_global/Makefile.ohpc b/tests/apps/prk/tests/OPENMP/Synch_global/Makefile.ohpc new file mode 100644 index 0000000000..a5c5664a89 --- /dev/null +++ b/tests/apps/prk/tests/OPENMP/Synch_global/Makefile.ohpc @@ -0,0 +1,30 @@ +include ../../common/OPENMP.defs +##### User configurable options ##### + +OPTFLAGS = $(DEFAULT_OPT_FLAGS) +#description: change above into something that is a decent optimization on you system + +#uncomment any of the following flags (and change values) to change defaults + +#DEBUGFLAG = -DVERBOSE +#description: default diagnostic style is silent + +#NTHREADFLAG = -DMAXTHREADS=n +#description: default thread limit is 256 + +USERFLAGS = +#description: parameter to specify optional flags + +#set the following variables for custom libraries and/or other objects +EXTOBJS = +LIBS = +LIBPATHS = +INCLUDEPATHS = + +### End User configurable options ### + +TUNEFLAGS = $(DEBUGFLAG) $(NTHREADFLAG) $(USERFLAGS) +PROGRAM = global +OBJS = $(PROGRAM).o $(COMOBJS) + +include ../../common/make.common diff --git a/tests/apps/prk/tests/OPENMP/Synch_global/global.c b/tests/apps/prk/tests/OPENMP/Synch_global/global.c new file mode 100755 index 0000000000..bef17fda14 --- /dev/null +++ b/tests/apps/prk/tests/OPENMP/Synch_global/global.c @@ -0,0 +1,245 @@ +/* +Copyright (c) 2013, Intel Corporation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. +* Neither the name of Intel Corporation nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +*/ + +/***************************************************************************** + +NAME: StopNGo + +PURPOSE: This program tests the efficiency of a global synchronization + on the target system. + +USAGE: The program takes as input the number of times the test of + string manipulation involving a global synchronization is + carried out, as well as an input string and the number of + threads involved. + + <# threads> <# iterations> + + The user can avoid false sharing if the string, disregarding + the string terminator, fits within an exact multiple of a cache + line. + + The output consists of diagnostics to make sure the + algorithm worked, and of timing statistics. + + Compile with VERBOSE defined if you want lots of output. + +FUNCTIONS CALLED: + + Other than OpenMP or standard C functions, the following + functions are used in this program: + + wtime() + bail_out() + chartoi() + +HISTORY: Written by Rob Van der Wijngaart, December 2005. + +*****************************************************************************/ + +#include +#include + +#define EOS '\0' + +static int chartoi(char c) { + /* define short string; second character contains string terminator */ + char letter[2]="0"; + letter[0]=c; + return (atoi(letter)); +} + + +int main(int argc, char ** argv) +{ + int my_ID; /* Thread ID */ + int iterations; /* number of times to rehash strings */ + int i, iter; /* dummy */ + int checksum; /* computed checksum of final aggregate string */ + char *scramble = "27638472638746283742712311207892"; + char *basestring; /* initial string to be copied to private strings */ + char *iterstring; /* private copy of string */ + char *catstring; /* concatenated, scrambled string */ + long length; /* length of scramble string */ + long thread_length; /* string length per thread */ + int basesum; /* checksum of base string */ + double stopngo_time; /* timing parameter */ + int nthread_input, /* thread parameters */ + nthread; + int num_error=0; /* flag that signals that requested and obtained + numbers of threads are the same */ + + /************************************************************************** + ** process, and test input parameter + ***************************************************************************/ + + if (argc != 4){ + printf("Usage: %s <# threads> <# iterations> \n", *argv); + exit(EXIT_FAILURE); + } + + /* Take number of threads to request from command line */ + nthread_input = atoi(*++argv); + + if ((nthread_input < 1) || (nthread_input > MAX_THREADS)) { + printf("ERROR: Invalid number of threads: %d\n", nthread_input); + exit(EXIT_FAILURE); + } + + omp_set_num_threads(nthread_input); + + iterations = atoi(*++argv); + if(iterations < 1){ + printf("ERROR: iterations must be >= 1 : %d \n",iterations); + exit(EXIT_FAILURE); + } + + length = atol(*++argv); + if (length <# threads> + + The output consists of diagnostics to make sure the + algorithm worked, and of timing statistics. + +FUNCTIONS CALLED: + + Other than OpenMP or standard C functions, the following + functions are used in this program: + + wtime() + bail_out() + +HISTORY: - Written by Rob Van der Wijngaart, March 2006. + - modified by Rob Van der Wijngaart, August 2006: + * changed boundary conditions and stencil computation to avoid + overflow + * introduced multiple iterations over grid and dependency between + iterations + +*******************************************************************/ + +#include +#include + +/* define shorthand for indexing a multi-dimensional array */ +#define ARRAY(i,j) vector[i+(j)*(m)] +/* define shorthand for flag with cache line padding */ +#define LINEWORDS 16 +#define flag(TID,j) flag[((TID)+(j)*nthread)*LINEWORDS] + +int main(int argc, char ** argv) { + + int TID; /* Thread ID */ + int m, n; /* grid dimensions */ + int i, j, jj, iter, ID; /* dummies */ + int iterations; /* number of times to run the pipeline algorithm */ + int *flag; /* used for pairwise synchronizations */ + int *start, *end; /* starts and ends of grid slices */ + int segment_size; + double pipeline_time, /* timing parameters */ + avgtime; + double epsilon = 1.e-8; /* error tolerance */ + double corner_val; /* verification value at top right corner of grid */ + int nthread_input, /* thread parameters */ + nthread; + int grp; /* grid line aggregation factor */ + int jjsize; /* actual line group size */ + double RESTRICT *vector;/* array holding grid values */ + long total_length; /* total required length to store grid values */ + int num_error=0; /* flag that signals that requested and obtained + numbers of threads are the same */ + int true, false; /* toggled booleans used for synchronization */ + + /******************************************************************************* + ** process and test input parameters + ********************************************************************************/ + + if (argc != 5 && argc != 6){ + printf("Usage: %s <# threads> <# iterations> ", *argv); + printf(" [group factor]\n"); + return(EXIT_FAILURE); + } + + /* Take number of threads to request from command line */ + nthread_input = atoi(*++argv); + + if ((nthread_input < 1) || (nthread_input > MAX_THREADS)) { + printf("ERROR: Invalid number of threads: %d\n", nthread_input); + exit(EXIT_FAILURE); + } + + omp_set_num_threads(nthread_input); + + iterations = atoi(*++argv); + if (iterations < 1){ + printf("ERROR: iterations must be >= 1 : %d \n",iterations); + exit(EXIT_FAILURE); + } + + m = atoi(*++argv); + n = atoi(*++argv); + + if (m < 1 || n < 1){ + printf("ERROR: grid dimensions must be positive: %d, %d \n", m, n); + exit(EXIT_FAILURE); + } + + if (argc==6) { + grp = atoi(*++argv); + if (grp < 1) grp = 1; + else if (grp >= n) grp = n-1; + } + else grp = 1; + + total_length = sizeof(double)*m*n; + vector = (double *) malloc(total_length); + if (!vector) { + printf("ERROR: Could not allocate space for vector: %ld\n", total_length); + exit(EXIT_FAILURE); + } + + if (m0) start[ID] = end[ID-1]+1; + end[ID] = start[ID]+segment_size-1; + } + + flag = (int *) malloc(sizeof(int)*nthread_input*LINEWORDS*n); + if (!flag) { + printf("ERROR: COuld not allocate space for synchronization flags\n"); + exit(EXIT_FAILURE); + } + +#pragma omp parallel private(i, j, jj, jjsize, TID, iter, true, false) + { + + #pragma omp master + { + nthread = omp_get_num_threads(); + + printf("OpenMP pipeline execution on 2D grid\n"); + if (nthread != nthread_input) { + num_error = 1; + printf("ERROR: number of requested threads %d does not equal ", + nthread_input); + printf("number of spawned threads %d\n", nthread); + } + else { + printf("Number of threads = %d\n",nthread_input); + printf("Grid sizes = %d, %d\n", m, n); + printf("Number of iterations = %d\n", iterations); + if (grp > 1) + printf("Group factor = %d (cheating!)\n", grp); +#ifdef SYNCHRONOUS + printf("Handshake between neighbor threads\n"); +#else + printf("No handshake between neighbor threads\n"); +#endif + } + } + bail_out(num_error); + + TID = omp_get_thread_num(); + + /* clear the array, assuming first-touch memory placement */ + for (j=0; j 0) { + while (flag(TID-1,j) == false) { + #pragma omp flush + } +#ifdef SYNCHRONOUS + flag(TID-1,j)= false; + #pragma omp flush +#endif + } + + for (jj=j; jj epsilon) { + printf("ERROR: checksum %lf does not match verification value %lf\n", + ARRAY(m-1,n-1), corner_val); + exit(EXIT_FAILURE); + } + +#ifdef VERBOSE + printf("Solution validates; verification value = %lf\n", corner_val); + printf("Point-to-point synchronizations/s: %lf\n", + ((float)((n-1)*(nthread-1)))/(avgtime)); +#else + printf("Solution validates\n"); +#endif + avgtime = pipeline_time/iterations; + /* flip the sign of the execution time to indicate cheating */ + if (grp>1) avgtime *= -1.0; + printf("Rate (MFlops/s): %lf Avg time (s): %lf\n", + 1.0E-06 * 2 * ((double)((m-1)*(n-1)))/avgtime, avgtime); + + exit(EXIT_SUCCESS); +} diff --git a/tests/apps/prk/tests/OPENMP/Transpose/Makefile.ohpc b/tests/apps/prk/tests/OPENMP/Transpose/Makefile.ohpc new file mode 100644 index 0000000000..4ba58f5434 --- /dev/null +++ b/tests/apps/prk/tests/OPENMP/Transpose/Makefile.ohpc @@ -0,0 +1,38 @@ +include ../../common/OPENMP.defs + +##### User configurable options ##### + +OPTFLAGS = $(DEFAULT_OPT_FLAGS) +#description: change above into something that is a decent optimization on you system + +#uncomment any of the following flags (and change values) to change defaults + +#RESTRICTFLAG = -DRESTRICT_KEYWORD +#description: the "restrict" keyword can be used on IA platforms to disambiguate +# data accessed through pointers + +#DEBUGFLAG = -DVERBOSE +#description: default diagnostic style is silent + +#COLLAPSEFLAG = -DCOLLAPSE +#description: collapse outer two loops in case of tiling to increase concurrency + +#NTHREADFLAG = -DMAXTHREADS=n +#description: default thread limit is 256 + +USERFLAGS = +#description: parameter to specify optional flags + +#set the following variables for custom libraries and/or other objects +EXTOBJS = +LIBS = +LIBPATHS = +INCLUDEPATHS = + +### End User configurable options ### + +TUNEFLAGS = $(DEBUGFLAG) $(NTHREADFLAG) $(USERFLAGS) $(RESTRICTFLAG) $(COLLAPSEFLAG) +PROGRAM = transpose +OBJS = $(PROGRAM).o $(COMOBJS) + +include ../../common/make.common diff --git a/tests/apps/prk/tests/OPENMP/Transpose/transpose.c b/tests/apps/prk/tests/OPENMP/Transpose/transpose.c new file mode 100755 index 0000000000..16a38c2dd8 --- /dev/null +++ b/tests/apps/prk/tests/OPENMP/Transpose/transpose.c @@ -0,0 +1,293 @@ +/* +Copyright (c) 2013, Intel Corporation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. +* Neither the name of Intel Corporation nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +*/ + +/******************************************************************* + +NAME: transpose + +PURPOSE: This program tests the efficiency with which a square matrix + can be transposed and stored in another matrix. The matrices + are distributed identically. + +USAGE: Program input is three command line arguments that give the + matrix order, the number of times to repeat the operation + (iterations), and the number of threads to use: + + transpose <# threads> <# iterations> [tile size] + + An optional parameter specifies the tile size used to divide the + individual matrix blocks for improved cache and TLB performance. + + The output consists of diagnostics to make sure the + transpose worked and timing statistics. + + +FUNCTIONS CALLED: + + Other than OpenMP or standard C functions, the following + functions are used in this program: + + wtime() portable wall-timer interface. + bail_out() + test_results() Verify that the transpose worked + +HISTORY: Written by Tim Mattson, April 1999. + Updated by Rob Van der Wijngaart, December 2005. + +*******************************************************************/ + +#include +#include + +#define A(i,j) A[i+order*(j)] +#define B(i,j) B[i+order*(j)] +static double test_results (int , double*); + +int main(int argc, char ** argv) { + + int order; /* order of a the matrix */ + int Tile_order=32; /* default tile size for tiling of local transpose */ + int iterations; /* number of times to do the transpose */ + int tiling; /* boolean: true if tiling is used */ + int i, j, it, jt, iter; /* dummies */ + double bytes; /* combined size of matrices */ + double * RESTRICT A; /* buffer to hold original matrix */ + double * RESTRICT B; /* buffer to hold transposed matrix */ + double abserr; /* absolute error */ + double epsilon=1.e-8; /* error tolerance */ + double transpose_time,/* timing parameters */ + avgtime; + int nthread_input, + nthread; + int num_error=0; /* flag that signals that requested and + obtained numbers of threads are the same */ + + /********************************************************************* + ** read and test input parameters + *********************************************************************/ + + if (argc != 4 && argc != 5){ + printf("Usage: %s <# threads> <# iterations> [tile size]\n", + *argv); + exit(EXIT_FAILURE); + } + + /* Take number of threads to request from command line */ + nthread_input = atoi(*++argv); + + if ((nthread_input < 1) || (nthread_input > MAX_THREADS)) { + printf("ERROR: Invalid number of threads: %d\n", nthread_input); + exit(EXIT_FAILURE); + } + + omp_set_num_threads(nthread_input); + + iterations = atoi(*++argv); + if (iterations < 1){ + printf("ERROR: iterations must be >= 1 : %d \n",iterations); + exit(EXIT_FAILURE); + } + + order = atoi(*++argv); + if (order < 0){ + printf("ERROR: Matrix Order must be greater than 0 : %d \n", order); + exit(EXIT_FAILURE); + } + + if (argc == 5) Tile_order = atoi(*++argv); + /* a non-positive tile size means no tiling of the local transpose */ + tiling = (Tile_order > 0) && (Tile_order < order); + if (!tiling) Tile_order = order; + + /********************************************************************* + ** Allocate space for the input and transpose matrix + *********************************************************************/ + + A = (double *)malloc(order*order*sizeof(double)); + if (A == NULL){ + printf(" Error allocating space for input matrix\n"); + exit(EXIT_FAILURE); + } + B = (double *)malloc(order*order*sizeof(double)); + if (B == NULL){ + printf(" Error allocating space for transposed matrix\n"); + exit(EXIT_FAILURE); + } + + bytes = 2.0 * sizeof(double) * order * order; + + #pragma omp parallel private (iter) + { + + #pragma omp master + { + nthread = omp_get_num_threads(); + + printf("OpenMP Matrix transpose: B = A^T\n"); + if (nthread != nthread_input) { + num_error = 1; + printf("ERROR: number of requested threads %d does not equal ", + nthread_input); + printf("number of spawned threads %d\n", nthread); + } + else { + printf("Number of threads = %i;\n",nthread_input); + printf("Matrix order = %d\n", order); + printf("Number of iterations = %d\n", iterations); + if (tiling) { + printf("Tile size = %d\n", Tile_order); +#ifdef COLLAPSE + printf("Using loop collapse\n"); +#endif + } + else + printf("Untiled\n"); + } + } + bail_out(num_error); + + /* Fill the original matrix, set transpose to known garbage value. */ + + if (tiling) { +#ifdef COLLAPSE + #pragma omp for private (i,it,jt) collapse(2) +#else + #pragma omp for private (i,it,jt) +#endif + for (j=0; j default_opt_flags=" + +The global make process uses some defaults for the Branch kernel +(see Makefile in that directory). These can be overridden by adjusting +the command line: +"make all matrix_rank= number_of_functions=" +Note that no new values for "matrix_rank" or "number_of_functions" will +be used unless a "make veryclean" has been issued. + +Individual make +--------------- +Descend into the desired sub-tree and cd to the kernel(s) of interest. +Each kernel has its own Makefile. There are a number of parameters +that determine the behavior of the kernel that need to be known at +compile time. These are explained succinctly in the Makefile itself. Edit +the Makefile to activate certain parameters, and/or to set their values. + +Typing "make" without parameters in each leaf directory will prompt +the user for the correct parameter syntax. Once the code has been +built, typing the name of the executable without any parameters will +prompt the user for the correct parameter syntax. + +Running test suite +------------------ +After the desired kernels have been built, they can be tested by +executing scripts in the Run subdirectory from the root of the +kernels package. Only very small examples are provided that should +complete in just a few seconds. Only a few parameters can be changed +globally; for rigorous testing, the user should run each kernel +individually, carefully choosing the right parameters. This may involve +editing the individual Makefile and rerunning the code. + +Example build and run +--------------------- +make all default_opt_flags="-xP -restrict" matrix_rank=7 number_of_functions=200 +./Run/smallopenmp +./Run/smallmpi +./Run/smallserial +./Run/smallcharm++ +./Run/smallmpiopenmp + +To exercise all kernels, type +./Run/smallall + + diff --git a/tests/apps/prk/tests/README.md b/tests/apps/prk/tests/README.md new file mode 100644 index 0000000000..6f3285c683 --- /dev/null +++ b/tests/apps/prk/tests/README.md @@ -0,0 +1,133 @@ +# License + +See LICENSE for licensing information. + +# Overview + +This suite contains a number of kernel operations, called Parallel +Research Kernels, plus a simple build environment intended for Linux. + +These programs must not be used as benchmarks. They are operations to +explore features of a hardware platform, but they do not define +fixed problems that can be used to rank systems. Furthermore +they have not been optimimzed for the features of any particular system. + +### Note on stream + +Note that while our "nstream" operations are based on the well +known STREAM benchmark by John D. McCalpin, we modified the source +code and do not follow the run-rules associated with this benchmark. +Hence, according to the rules defined in the STREAM license (see +clause 3b), you must never report the results of our nstream +operations as official "STREAM Benchmark" results. The results must +be clearly labled whenever they are published. Examples of proper +labelling include: + + "tuned STREAM benchmark results" + "based on a variant of the STREAM benchmark code" + +Other comparable, clear, and reasonable labelling is acceptable. + + +# Build Instructions + +To build the codes the user needs to make certain changes by editing text +files. Assuming the source tree is untarred in directory HOME, the +following file needs to be copied to `HOME/common/make.defs` and edited. + +`HOME/common/make.defs.in` -- This file specifies the names of the C +compiler (CC), and of the MPI (Message Passing Interface) compiler MPICC +or compile script. If MPI is not going to be used, the user can ignore +the value of MPICC. The compilers should already be in your path. That +is, if you define `CC=icc`, then typing `which icc` should show a +valid path where that compiler is installed. +Special instructions for building and running codes using Charm++, Grappa, +OpenSHMEM, or Fine-Grain MPI are in `README.special`. + +The suite of kernels currently has complete parallel implementations in +[OpenMP](http://openmp.org/), +[MPI](http://www.mpi-forum.org/), and +[Fine-Grain MPI](http://www.cs.ubc.ca/~humaira/fgmpi.html). +There is also a SERIAL reference implementation. +The suite is currently being extended to include +[Charm++](http://charm.cs.illinois.edu/research/charm), +MPI+OpenMP, +[OpenSHMEM](http://openshmem.org/), and +[Grappa](http://grappa.io/), +as well as two new variations of MPI: + 1. MPI with one-sided communications (MPIRMA) + 2. MPI with direct use of shared memory inside coherency domains (MPISHM) +These extensions are not yet complete. + +## Global make + +To build all available kernels of a certain version, type in the root +directory: + +| Command | Effect | +|----------------------|-------------------------| +| `make all` | builds all kernels. | +| `make allopenmp` | builds all OpenMP kernels. | +| `make allmpi` | builds all MPI kernels. | +| `make allfgmpi` | builds all Fine-Grain MPI kernels. | +| `make allserial` | builds all serial kernels. | +| `make allmpiopenmp` | builds all hybrid MPI+OpenMP kernels. | +| `make allmpirma` | builds all MPI kernels with one-sided communications. | +| `make allshmem` | builds all OpenSHMEM kernels. | +| `make allmpishm` | builds all kernels with MPI3 shared memory. | +| `make allcharm++` | builds all Charm++ kernels. | +| `make allgrappa` | builds all Charm++ kernels. | + +The global make process uses a single set of optimization flags for all +kernels. For more control, the user should consider individual makes +(see below), carefully choosing the right parameters in each Makefile. +If a a single set of optimization flags different from the default is +desired, the command line can be adjusted: +`make all default_opt_flags=` + +The global make process uses some defaults for the Branch kernel +(see Makefile in that directory). These can be overridden by adjusting +the command line: +`make all matrix_rank= number_of_functions=` +Note that no new values for `matrix_rank` or `number_of_functions` will +be used unless a `make veryclean` has been issued. + +## Individual make + +Descend into the desired sub-tree and cd to the kernel(s) of interest. +Each kernel has its own Makefile. There are a number of parameters +that determine the behavior of the kernel that need to be known at +compile time. These are explained succinctly in the Makefile itself. Edit +the Makefile to activate certain parameters, and/or to set their values. + +Typing `make` without parameters in each leaf directory will prompt +the user for the correct parameter syntax. Once the code has been +built, typing the name of the executable without any parameters will +prompt the user for the correct parameter syntax. + +# Running test suite + +After the desired kernels have been built, they can be tested by +executing scripts in the Run subdirectory from the root of the +kernels package. Only very small examples are provided that should +complete in just a few seconds. Only a few parameters can be changed +globally; for rigorous testing, the user should run each kernel +individually, carefully choosing the right parameters. This may involve +editing the individual Makefile and rerunning the code. + +# Example build and run + +``` +make all default_opt_flags="-xP -restrict" matrix_rank=7 number_of_functions=200 +./Run/smallopenmp +./Run/smallmpi +./Run/smallserial +./Run/smallcharm++ +./Run/smallmpiopenmp +``` + +To exercise all kernels, type +``` +./Run/smallall +``` + diff --git a/tests/apps/prk/tests/README.special b/tests/apps/prk/tests/README.special new file mode 100644 index 0000000000..08f493a366 --- /dev/null +++ b/tests/apps/prk/tests/README.special @@ -0,0 +1,67 @@ +Copyright (c) 2013, Intel Corporation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Intel Corporation nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + +****************************************************************** + +This files contains instructions for building and running PRKs using +the Charm++, OpenSHMEM, Grappa, or Fine-Grain MPI runtimes. + +These runtimes need to be installed, and you need to specify in file +PRKROOT/common/make.defs where they are located. Note that if Charm++, +OpenSHMEM or Grappa are built on top of MPI, MPI does need to be +installed, even if it is not called directly. + +Grappa +------ +This runtime requires cmake to install. Compile and link flags +depend on the particulars of the installation and cannot be specified +uniformly. Hence, it may be necessary to obtain them from the Grappa +installation, after building it, from GRAPPAROOT/util/grappa.mk and +insert them into the required Makefile associated with each PRK. +The run script grappa(s)_run may not give the desired result. If +Grappa is built to use MPI, the code can be run in most cases by using +mpiexec.hydra, with the usual command line parameters. + +Charm++ +------- +The run script charmrun may not give the desired result. If Charm++ +is built to use MPI, the code can be run in most cases by using +mpiexec.hydra, with the usual command line parameters. + +Fine-Grain MPI +-------------- +Care must be taken to use the specific MPI version supporting this +runtime, which must be built explicitly. Codes are run using the +Fine-Grain MPI version of mpiexec.hydra. This name may well clash +with the version of mpiexec.hydra supporting standard MPI. Such a +conflict may be avoided by starting a sub-shell for FG_MPI runs and +changing path variables only inside that shell. Scripts in the +PRKROOT/Run directory employ this technique automatically and do +not need to be modified for proper execution. diff --git a/tests/apps/prk/tests/Run/Makefile_FG_MPI b/tests/apps/prk/tests/Run/Makefile_FG_MPI new file mode 100644 index 0000000000..12b4debc4c --- /dev/null +++ b/tests/apps/prk/tests/Run/Makefile_FG_MPI @@ -0,0 +1,8 @@ +include ../common/make.defs +smallfgmpi: smallfgmpi.in + @echo PATH=$(FGMPITOP)/bin:$(PATH) > smallfgmpi + @cat smallfgmpi.in >> smallfgmpi + @chmod u+x smallfgmpi + +veryclean: + rm -f smallfgmpi diff --git a/tests/apps/prk/tests/Run/smallMPI b/tests/apps/prk/tests/Run/smallMPI new file mode 100755 index 0000000000..4397a83b84 --- /dev/null +++ b/tests/apps/prk/tests/Run/smallMPI @@ -0,0 +1,19 @@ +NUMPROCS=4 +NUMITERS=10 +SEPLINE="===============================================================" +MPIRUN=mpirun + +for type in vector_go vector_stop no_vector ins_heavy; do + $MPIRUN -np $NUMPROCS MPI/Branch/branch $NUMITERS 1000 $type; echo $SEPLINE +done +$MPIRUN -np $NUMPROCS MPI/DGEMM/dgemm $NUMITERS 500 32 1; echo $SEPLINE +$MPIRUN -np $NUMPROCS MPI/Nstream/nstream $NUMITERS 2000000 0; echo $SEPLINE +$MPIRUN -np $NUMPROCS MPI/Random/random 20 16; echo $SEPLINE +$MPIRUN -np $NUMPROCS MPI/Reduce/reduce $NUMITERS 2000000; echo $SEPLINE +$MPIRUN -np $NUMPROCS MPI/Sparse/sparse $NUMITERS 10 4; echo $SEPLINE +$MPIRUN -np $NUMPROCS MPI/Stencil/stencil $NUMITERS 1000; echo $SEPLINE +$MPIRUN -np $NUMPROCS MPI/Synch_global/global $NUMITERS 10000; echo $SEPLINE +$MPIRUN -np $NUMPROCS MPI/Synch_p2p/p2p $NUMITERS 1000 100; echo $SEPLINE +$MPIRUN -np $NUMPROCS MPI/Transpose/transpose $NUMITERS 2000 64; echo $SEPLINE + + diff --git a/tests/apps/prk/tests/Run/smallOPENMP b/tests/apps/prk/tests/Run/smallOPENMP new file mode 100755 index 0000000000..44410d10c6 --- /dev/null +++ b/tests/apps/prk/tests/Run/smallOPENMP @@ -0,0 +1,20 @@ +NUMTHREADS=4 +NUMITERS=10 +SEPLINE="===============================================================" + +for type in vector_go vector_stop no_vector ins_heavy; do + OPENMP/Branch/branch $NUMTHREADS $NUMITERS 1000 $type; echo $SEPLINE +done +OPENMP/DGEMM/dgemm $NUMTHREADS $NUMITERS 500 32; echo $SEPLINE +OPENMP/Nstream/nstream $NUMTHREADS $NUMITERS 2000000 0; echo $SEPLINE +OPENMP/Random/random $NUMTHREADS 20 16 4; echo $SEPLINE +for ALGORITHM in linear binary-barrier binary-p2p long-optimal; do + OPENMP/Reduce/reduce $NUMTHREADS $NUMITERS 2000000 $ALGORITHM; echo $SEPLINE +done +OPENMP/RefCount_shared/shared $NUMTHREADS 2000000; echo $SEPLINE +OPENMP/RefCount_private/private $NUMTHREADS 2000000; echo $SEPLINE +OPENMP/Sparse/sparse $NUMTHREADS $NUMITERS 10 4; echo $SEPLINE +OPENMP/Stencil/stencil $NUMTHREADS $NUMITERS 1000; echo $SEPLINE +OPENMP/Synch_global/global $NUMTHREADS $NUMITERS 10000; echo $SEPLINE +OPENMP/Synch_p2p/p2p $NUMTHREADS $NUMITERS 1000 100; echo $SEPLINE +OPENMP/Transpose/transpose $NUMTHREADS $NUMITERS 2000 64; echo $SEPLINE diff --git a/tests/apps/prk/tests/Run/smallall b/tests/apps/prk/tests/Run/smallall new file mode 100755 index 0000000000..9ea3f2dbd7 --- /dev/null +++ b/tests/apps/prk/tests/Run/smallall @@ -0,0 +1,2 @@ +./Run/smalldarwin +./Run/smallfreaks diff --git a/tests/apps/prk/tests/Run/smallcharm++ b/tests/apps/prk/tests/Run/smallcharm++ new file mode 100755 index 0000000000..201dd84a3a --- /dev/null +++ b/tests/apps/prk/tests/Run/smallcharm++ @@ -0,0 +1,11 @@ +NUMPROCS=2 +OVERDECOMPOSITION=2 +NUMITERS=10 +SEPLINE="===============================================================" +CHARMRUN=CHARM++/Stencil/charmrun + +$CHARMRUN +p$NUMPROCS CHARM++/Stencil/stencil $NUMITERS 1000 $OVERDECOMPOSITION; echo $SEPLINE +$CHARMRUN +p$NUMPROCS CHARM++/Synch_p2p/p2p $NUMITERS 1000 100 $OVERDECOMPOSITION; echo $SEPLINE +$CHARMRUN +p$NUMPROCS CHARM++/Transpose/transpose $NUMITERS 2000 64 $OVERDECOMPOSITION; echo $SEPLINE + + diff --git a/tests/apps/prk/tests/Run/smalldarwin b/tests/apps/prk/tests/Run/smalldarwin new file mode 100755 index 0000000000..c10d65b12f --- /dev/null +++ b/tests/apps/prk/tests/Run/smalldarwin @@ -0,0 +1,8 @@ +./Run/smallserial +./Run/smallmpi +./Run/smallfgmpi +./Run/smallopenmp +./Run/smallmpiopenmp +./Run/smallmpirma +./Run/smallshmem +./Run/smallmpishm diff --git a/tests/apps/prk/tests/Run/smallfgmpi.in b/tests/apps/prk/tests/Run/smallfgmpi.in new file mode 100755 index 0000000000..8f6f1357e4 --- /dev/null +++ b/tests/apps/prk/tests/Run/smallfgmpi.in @@ -0,0 +1,20 @@ +NUMPROCS=2 +NUMTHREADS=2 +NUMITERS=10 +SEPLINE="===============================================================" +MPIRUN=mpiexec + +for type in vector_go vector_stop no_vector ins_heavy; do + $MPIRUN -np $NUMPROCS FG_MPI/Branch/branch $NUMITERS 1000 $type; echo $SEPLINE +done +$MPIRUN -np $NUMPROCS -nfg $NUMTHREADS FG_MPI/DGEMM/dgemm $NUMITERS 500 32 1; echo $SEPLINE +$MPIRUN -np $NUMPROCS -nfg $NUMTHREADS FG_MPI/Nstream/nstream $NUMITERS 2000000 0; echo $SEPLINE +$MPIRUN -np $NUMPROCS -nfg $NUMTHREADS FG_MPI/Random/random 20 16; echo $SEPLINE +$MPIRUN -np $NUMPROCS -nfg $NUMTHREADS FG_MPI/Reduce/reduce $NUMITERS 2000000; echo $SEPLINE +$MPIRUN -np $NUMPROCS -nfg $NUMTHREADS FG_MPI/Sparse/sparse $NUMITERS 10 4; echo $SEPLINE +$MPIRUN -np $NUMPROCS -nfg $NUMTHREADS FG_MPI/Stencil/stencil $NUMITERS 1000; echo $SEPLINE +$MPIRUN -np $NUMPROCS -nfg $NUMTHREADS FG_MPI/Synch_global/global $NUMITERS 10000; echo $SEPLINE +$MPIRUN -np $NUMPROCS -nfg $NUMTHREADS FG_MPI/Synch_p2p/p2p $NUMITERS 1000 100; echo $SEPLINE +$MPIRUN -np $NUMPROCS -nfg $NUMTHREADS FG_MPI/Transpose/transpose $NUMITERS 2000 64; echo $SEPLINE + + diff --git a/tests/apps/prk/tests/Run/smallfreaks b/tests/apps/prk/tests/Run/smallfreaks new file mode 100755 index 0000000000..a0a62a8092 --- /dev/null +++ b/tests/apps/prk/tests/Run/smallfreaks @@ -0,0 +1,2 @@ +./Run/smallcharm++ +./Run/smallgrappa diff --git a/tests/apps/prk/tests/Run/smallgrappa b/tests/apps/prk/tests/Run/smallgrappa new file mode 100755 index 0000000000..d95f470263 --- /dev/null +++ b/tests/apps/prk/tests/Run/smallgrappa @@ -0,0 +1,7 @@ +NUMPROCS=4 +NUMITERS=10 +SEPLINE="===============================================================" +MPIRUN=mpiexec.hydra + +$MPIRUN -np $NUMPROCS GRAPPA/Synch_p2p/p2p $NUMITERS 1000 100; echo $SEPLINE +$MPIRUN -np $NUMPROCS GRAPPA/Stencil/stencil $NUMITERS 1000; echo $SEPLINE diff --git a/tests/apps/prk/tests/Run/smallmpiopenmp b/tests/apps/prk/tests/Run/smallmpiopenmp new file mode 100755 index 0000000000..178d3c39d0 --- /dev/null +++ b/tests/apps/prk/tests/Run/smallmpiopenmp @@ -0,0 +1,10 @@ +NUMPROCS=2 +NUMTHREADS=2 +NUMITERS=10 +SEPLINE="===============================================================" +MPIRUN=mpirun + +$MPIRUN -np $NUMPROCS MPIOPENMP/Nstream/nstream $NUMTHREADS $NUMITERS 2000000 0; echo $SEPLINE +$MPIRUN -np $NUMPROCS MPIOPENMP/Stencil/stencil $NUMTHREADS $NUMITERS 1000; echo $SEPLINE +$MPIRUN -np $NUMPROCS MPIOPENMP/Transpose/transpose $NUMTHREADS $NUMITERS 2000 64; echo $SEPLINE +$MPIRUN -np $NUMPROCS MPIOPENMP/Synch_p2p/p2p $NUMTHREADS $NUMITERS 1000 1000; echo $SEPLINE diff --git a/tests/apps/prk/tests/Run/smallmpirma b/tests/apps/prk/tests/Run/smallmpirma new file mode 100755 index 0000000000..675fb76cce --- /dev/null +++ b/tests/apps/prk/tests/Run/smallmpirma @@ -0,0 +1,9 @@ +NUMPROCS=4 +NUMITERS=10 +SEPLINE="===============================================================" +MPIRUN=mpirun + +$MPIRUN -np $NUMPROCS MPIRMA/Stencil/stencil $NUMITERS 1000; echo $SEPLINE +$MPIRUN -np $NUMPROCS MPIRMA/Synch_p2p/p2p $NUMITERS 1000 100; echo $SEPLINE + + diff --git a/tests/apps/prk/tests/Run/smallmpishm b/tests/apps/prk/tests/Run/smallmpishm new file mode 100755 index 0000000000..2c0a687de1 --- /dev/null +++ b/tests/apps/prk/tests/Run/smallmpishm @@ -0,0 +1,9 @@ +NUMPROCS=4 +NUMSUBPROCS=2 +NUMITERS=10 +SEPLINE="===============================================================" +MPIRUN=mpirun + +$MPIRUN -np $NUMPROCS MPISHM/Stencil/stencil $NUMSUBPROCS $NUMITERS 1000; echo $SEPLINE +$MPIRUN -np $NUMPROCS MPISHM/Synch_p2p/p2p $NUMITERS 1000 100; echo $SEPLINE +$MPIRUN -np $NUMPROCS MPISHM/Transpose/transpose $NUMSUBPROCS $NUMITERS 1000 64; echo $SEPLINE diff --git a/tests/apps/prk/tests/Run/smallserial b/tests/apps/prk/tests/Run/smallserial new file mode 100755 index 0000000000..1007ecebe6 --- /dev/null +++ b/tests/apps/prk/tests/Run/smallserial @@ -0,0 +1,14 @@ +NUMITERS=10 +SEPLINE="===============================================================" + +for type in vector_go vector_stop no_vector ins_heavy; do + SERIAL/Branch/branch $NUMITERS 1000 $type; echo $SEPLINE +done +SERIAL/DGEMM/dgemm $NUMITERS 500 32; echo $SEPLINE +SERIAL/Nstream/nstream $NUMITERS 2000000 0; echo $SEPLINE +SERIAL/Random/random 20 16 4; echo $SEPLINE +SERIAL/Reduce/reduce $NUMITERS 2000000; echo $SEPLINE +SERIAL/Sparse/sparse $NUMITERS 10 4; echo $SEPLINE +SERIAL/Stencil/stencil $NUMITERS 1000; echo $SEPLINE +SERIAL/Synch_p2p/p2p $NUMITERS 1000 100; echo $SEPLINE +SERIAL/Transpose/transpose $NUMITERS 2000 64; echo $SEPLINE diff --git a/tests/apps/prk/tests/Run/smallshmem b/tests/apps/prk/tests/Run/smallshmem new file mode 100755 index 0000000000..e69fbb6f57 --- /dev/null +++ b/tests/apps/prk/tests/Run/smallshmem @@ -0,0 +1,8 @@ +NUMPROCS=4 +NUMITERS=10 +SEPLINE="===============================================================" +MPIRUN=mpirun + +$MPIRUN -np $NUMPROCS SHMEM/Synch_p2p/p2p $NUMITERS 1000 100; echo $SEPLINE + + diff --git a/tests/apps/prk/tests/SERIAL/Branch/Makefile.ohpc b/tests/apps/prk/tests/SERIAL/Branch/Makefile.ohpc new file mode 100644 index 0000000000..e30fed104c --- /dev/null +++ b/tests/apps/prk/tests/SERIAL/Branch/Makefile.ohpc @@ -0,0 +1,52 @@ +ifndef NUMBER_OF_FUNCTIONS + NUMBER_OF_FUNCTIONS=40 +endif + +ifndef MATRIX_RANK + MATRIX_RANK=10 +endif + +include ../../common/SERIAL.defs +##### User configurable options ##### + +OPTFLAGS = $(DEFAULT_OPT_FLAGS) +#description: change above into something that is a decent optimization on you system + +#uncomment any of the following flags (and change values) to change defaults + +#RESTRICTFLAG = -DRESTRICT_KEYWORD +#description: the "restrict" keyword can be used on IA platforms to disambiguate +# data accessed through pointers (requires -restrict compiler flag) + +#DEBUGFLAG = -DVERBOSE +#description: default diagnostic style is silent + +USERFLAGS = +#description: parameter to specify optional flags + + +EXTOBJS = +LIBS = +LIBPATHS = +INCLUDEPATHS = + +### End User configurable options ### + +TUNEFLAGS = $(RESTRICTFLAG) $(DEBUGFLAG) $(USERFLAGS) +PROGRAM = branch +OBJS = $(PROGRAM).o $(COMOBJS) func.o + +#default: usage +# @echo " \"make veryclean\" to remove custom built files as well" + +include ../../common/make.common + +func.c: + @echo "############################################################" + @echo "##### No file func.c -- invoking func_gen to create it #####" + @echo "############################################################" + ./func_gen ${MATRIX_RANK} ${NUMBER_OF_FUNCTIONS} + +veryclean: + @rm -f func.c ___* + make -f Makefile.ohpc clean diff --git a/tests/apps/prk/tests/SERIAL/Branch/README b/tests/apps/prk/tests/SERIAL/Branch/README new file mode 100755 index 0000000000..3131b10318 --- /dev/null +++ b/tests/apps/prk/tests/SERIAL/Branch/README @@ -0,0 +1,14 @@ +Option INS_HEAVY of the Branching code requires a customized version +of file func.c, which contains a variable number of functions of +variable size. This file is built by invoking script "func_gen," +which takes two integer input parameters. The first is the rank of +the square matrices whose elements get initialized individually by +one of the functions in func.c. Hence, the number of instructions +associated with each such function is proportional to rank*rank. +The second parameters is the number of functions created. These +functions are all slightly different, but all have the same size. + +Usage: func_gen +The function is invoked with default values 10 and 40 if no +values for these variables are supplied on the make command line. + diff --git a/tests/apps/prk/tests/SERIAL/Branch/branch.c b/tests/apps/prk/tests/SERIAL/Branch/branch.c new file mode 100755 index 0000000000..8146b4a12b --- /dev/null +++ b/tests/apps/prk/tests/SERIAL/Branch/branch.c @@ -0,0 +1,343 @@ +/* +Copyright (c) 2013, Intel Corporation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. +* Neither the name of Intel Corporation nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +*/ + +/******************************************************************* + +NAME: Branch + +PURPOSE: This program tests the effect of inner-loop branches on + application performance. We investigate four cases. The first + three all concern light-weight loops, i.e. loops that have + very few instructions associated with them. + 1) branches inside vectorizable loops where the branch does + not necessarily inhibit vectorization: vector_go + 2) branches inside vectorizable loops where the branch does + inhibit vectorization: vector_stop + 3) branches inside non-vectorizable loops: no_vector + 4) branches inside non-vectorizable loops in which each branch + corresponds to a sizeable and different set of instructions: + ins-heavy + +CONSTRAINTS: + - the code should be continuously scalable, i.e. the user should + be able to specify the amount of work to be done. + - the code should be verifiable. + - the code should be executable with and without branches, with + otherwise identical amounts of work, to assess the impact of the + branches. + - the performance of the code should be dominated by the work in + the loops, not by memory bandwidth required to fetch data. This + means that arrays should fit in cache, and any loop over arrays + should be executed many times to amortize the initial memory load + costs and to remove noise from the timings. + - any arrays used should be initialized only once, to avoid confusing + performance impact of initialization with that of the branches. + Because the base loop over the array is short, it completes very + quickly, leading to very noisy results if it were timed separately. + Hence, we must time the ensemble of all iterations over the base + loop, which would include reinitializations if present. + - the branches should be "unpredictable," meaning that if the compiler + guesses them to be always taken or to be always not taken, it will + be wrong often. Otherwise the cost of a mispredicted branch may + not show up in the performance results. + - the amount of work in the codes containing the three different + types of light-weight loops should be the same to allow fair + comparisions. + - the code should not not produce overflow or underflow. + - the actual cost of computing the branch condition should be small, + so that we can assess the cost of the occurrence of the branch as + it disrupts vectorization and the hardware pipelines). If the + condition were expensive to compute and we run the code with and + without the branch, the performance difference would be exaggerated. + - Note: Casts from integer to float or double are not always vectorizable. + +APPROACH: + - to avoid casts and keep conditionals inexpensive and exact, we use + only integer operations. + - we make sure that the numerical results of the codes for the + different branch structures and for the different paths following + the branch are identical. + - conditionals are simple comparisons to zero of quantities that + are computed anyway. + - initialization produces a saw-tooth pattern with frequent sign + crossings to defeat speculative branch execution. + - successive iterations over a relatively short array result simply + in a change of sign of all array elements, so that the results are + bounded, and verification values are easily computable. + +USAGE: The program takes as input the length of the + vector loop, the number of repetitions of the loop, and the type of + branching + + <# iterations> + + The output consists of diagnostics to make sure the + algorithm worked, and of timing statistics. + +FUNCTIONS CALLED: + + Other than standard C functions, the following + functions are used in this program: + + wtime() + fill_vec() + func*() + +HISTORY: Written by Rob Van der Wijngaart, February 2009. + +**********************************************************************************/ + +#include + +/* the following values are only used as labels */ +#define VECTOR_STOP 66 +#define VECTOR_GO 77 +#define NO_VECTOR 88 +#define INS_HEAVY 99 +#define WITH_BRANCHES 1 +#define WITHOUT_BRANCHES 0 + +extern int fill_vec(int *vector, int vector_length, int iterations, int branch, + int *nfunc, int *rank); + +int main(int argc, char ** argv) +{ + long vector_length; /* length of vector loop containing the branch */ + int nfunc; /* number of functions used in INS_HEAVY option */ + int rank; /* matrix rank used in INS_HEAVY option */ + double branch_time, /* timing parameters */ + no_branch_time; + double ops; /* double precision representation of integer ops */ + int iterations; /* number of times the branch loop is carried out */ + int i, iter, aux; /* dummies */ + char *branch_type; /* string defining branching type */ + int btype; /* integer encoding branching type */ + int total=0, + total_ref; /* computed and stored verification values */ + int * RESTRICT vector; + int * RESTRICT index; + int factor = -1; + +/********************************************************************************** +** process and test input parameters +**********************************************************************************/ + + if (argc != 4){ + printf("Usage: %s <# iterations> ", *argv); + printf("\n"); + printf("branching type: vector_go, vector_stop, no_vector, ins_heavy\n"); + exit(EXIT_FAILURE); + } + + iterations = atoi(*++argv); + if (iterations < 1 || iterations%2==1){ + printf("ERROR: Iterations must be positive and even : %d \n", iterations); + exit(EXIT_FAILURE); + } + + vector_length = atol(*++argv); + if (vector_length < 1){ + printf("ERROR: loop length must be >= 1 : %d \n",vector_length); + exit(EXIT_FAILURE); + } + + branch_type = *++argv; + if (!strcmp(branch_type,"vector_stop")) btype = VECTOR_STOP; + else if (!strcmp(branch_type,"vector_go" )) btype = VECTOR_GO; + else if (!strcmp(branch_type,"no_vector" )) btype = NO_VECTOR; + else if (!strcmp(branch_type,"ins_heavy" )) btype = INS_HEAVY; + else { + printf("Wrong branch type: %s; choose vector_stop, vector_go, ", branch_type); + printf("no_vector, or ins_heavy\n"); + exit(EXIT_FAILURE); + } + + printf("Serial Branching Bonanza\n"); + printf("Vector length = %ld\n", vector_length); + printf("Number of iterations = %d\n", iterations); + printf("Branching type = %s\n", branch_type); + + vector = malloc(vector_length*2*sizeof(int)); + if (!vector) { + printf("ERROR: Failed to allocate space for vector\n"); + exit(EXIT_FAILURE); + } + + /* grab the second half of vector to store index array */ + index = vector + vector_length; + + /* initialize the array with entries with varying signs; array "index" is only + used to obfuscate the compiler (i.e. it won't vectorize a loop containing + indirect referencing). It functions as the identity operator. */ + for (i=0; i0 inhibits vectorization */ + for (iter=0; iter0) vector[i] -= 2*vector[i]; + else vector[i] -= 2*aux; + } + #pragma vector always + for (i=0; i0) vector[i] -= 2*vector[i]; + else vector[i] -= 2*aux; + } + } + break; + + case VECTOR_GO: + /* condition aux>0 allows vectorization */ + for (iter=0; iter0) vector[i] -= 2*vector[i]; + else vector[i] -= 2*aux; + } + #pragma vector always + for (i=0; i0) vector[i] -= 2*vector[i]; + else vector[i] -= 2*aux; + } + } + break; + + case NO_VECTOR: + /* condition aux>0 allows vectorization, but indirect indexing inbibits it */ + for (iter=0; iter0) vector[i] -= 2*vector[index[i]]; + else vector[i] -= 2*aux; + } + #pragma vector always + for (i=0; i0) vector[i] -= 2*vector[index[i]]; + else vector[i] -= 2*aux; + } + } + break; + + case INS_HEAVY: + fill_vec(vector, vector_length, iterations, WITH_BRANCHES, &nfunc, &rank); + } + + branch_time = wtime() - branch_time; + if (btype == INS_HEAVY) { + printf("Number of matrix functions = %d\n", nfunc); + printf("Matrix order = %d\n", rank); + } + + /* do the whole thing once more, but now without branches */ + + no_branch_time = wtime(); + + /* do actual branching */ + + switch (btype) { + + case VECTOR_STOP: + case VECTOR_GO: + for (iter=0; iter \"" + exit +fi + +n=$1 +nfunc=$2 +PID=$$ +NAME=___func.c$PID + +if [ $n -lt 1 ]; then + echo "ERROR: Invalid matrix size $n" + exit +fi +if [ $nfunc -lt 1 ]; then + echo "ERROR: Invalid number of functions $nfunc" + exit +fi + +echo "Generating $nfunc functions with matrix order $n" + +# empty the file func.c +cp /dev/null func.c + +# insert the right header file +echo "#include " >> func.c +#create some global read-only arrays +echo "static int one[$n], zero[$n];" >> func.c + +#write prototype matrix function +echo "int funcVERSION(int index, int a[$n][$n], int b[$n][$n]){" > $NAME +echo " int i, j, x1, x2, x3, error=0;" >> $NAME +echo >> $NAME + +j=0 +while [ $j -lt $n ]; do + i=0 + while [ $i -lt $n ]; do + echo " x1 = `expr \( \( $i + $j \) \* 48611 \) % 8389` + index;" >> $NAME + echo " x2 = `expr \( \( $i + 17 + 19 \* $j \) \* 29443 \) % 77029`;" >> $NAME + echo " x3 = (x1 + (VERSION+1)*x2) % $n;" >> $NAME + echo " x1 += (x2 - x3 + $n ) % $n;" >> $NAME + echo " x2 += (x1 - 5*x3 + 7 * $n ) % $n;" >> $NAME + echo " x3 = (x1 + 4*x2) % $n;" >> $NAME + if [ $i -ne $j ]; then + echo " a[$j][$i] = zero[x3];" >> $NAME + else + echo " a[$j][$i] = one[x3];" >> $NAME + fi + echo >> $NAME + i=`expr $i + 1` + done + j=`expr $j + 1` +done + +echo " for (j=0; j<$n; j++) for (i=0; i<$n; i++)" >> $NAME +echo " b[j][i] = (a[i][j]+a[j][i])/2;" >> $NAME +echo " for (j=0; j<$n; j++) for (i=0; i<$n; i++)" >> $NAME +echo " if (i != j) error += ABS(b[j][i]);" >> $NAME +echo " for (i=0; i<$n; i++) error += ABS(1-b[i][i]);" >> $NAME + +echo " if (error) return(0);" >> $NAME +echo " else return(index);" >> $NAME +echo "}" >> $NAME +echo >> $NAME + +#write the list of matrix functions; do odd/even scrambling to kill unit instruction stride +v=0 +half=`expr \( $nfunc + 1 \) / 2` +while [ $v -lt $nfunc ]; do + v2=`expr $half \* \( $v % 2 \) + $v / 2` + cat $NAME | sed "s/VERSION/$v2/" >> func.c + v=`expr $v + 1` +done + +#remove prototype matrix function +rm -f $NAME + + +echo "int fill_vec(int *vector, int length, int iterations, int branch, " >> func.c +echo " int *nfunc, int *rank) {" >> func.c + +echo " static int a[$n][$n], b[$n][$n];" >> func.c +echo " int aux, aux2, i, iter;" >> func.c + +echo " /* return generator values to calling program */" >> func.c +echo " *nfunc = $nfunc;" >> func.c +echo " *rank = $n;" >> func.c +echo >> func.c +echo " if (!branch)" >> func.c +echo " for (iter=0; iter> func.c +echo " for (i=0; i> func.c +echo " aux2 = -(3-(func0(i,a,b)&7));" >> func.c +echo " vector[i] -= (vector[i]+aux2);" >> func.c +echo " }" >> func.c +echo " for (i=0; i> func.c +echo " aux2 = (3-(func0(i,a,b)&7));" >> func.c +echo " vector[i] -= (vector[i]+aux2);" >> func.c +echo " }" >> func.c +echo " }" >> func.c +echo " else {" >> func.c +echo " for (i=0; i<$n; i++) {" >> func.c +echo " zero[i] = 0; one[i] = 1;" >> func.c +echo " }" >> func.c +echo " for (iter=0; iter> func.c +echo " for (i=0; i> func.c +echo " aux = i%$nfunc;" >> func.c +echo " switch(aux) {" >> func.c +v=0 +while [ $v -lt $nfunc ]; do + echo " case $v: aux2 = -(3-(func$v(i,a,b)&7));" >> func.c + echo " vector[i] -= (vector[i]+aux2);" >> func.c + echo " break;" >> func.c + v=`expr $v + 1` +done +echo " default: vector[i] = 0;" >> func.c +echo " }" >> func.c +echo " }" >> func.c +echo " for (i=0; i> func.c +echo " aux = i%$nfunc;" >> func.c +echo " switch(aux) {" >> func.c +v=0 +while [ $v -lt $nfunc ]; do + echo " case $v: aux2 = (3-(func$v(i,a,b)&7));" >> func.c + echo " vector[i] -= (vector[i]+aux2);" >> func.c + echo " break;" >> func.c + v=`expr $v + 1` +done +echo " default: vector[i] = 0;" >> func.c +echo " }" >> func.c +echo " }" >> func.c +echo " }" >> func.c +echo " }" >> func.c +echo " return(0);" >> func.c +echo "}" >> func.c + diff --git a/tests/apps/prk/tests/SERIAL/DGEMM/Makefile.ohpc b/tests/apps/prk/tests/SERIAL/DGEMM/Makefile.ohpc new file mode 100644 index 0000000000..b19c36d159 --- /dev/null +++ b/tests/apps/prk/tests/SERIAL/DGEMM/Makefile.ohpc @@ -0,0 +1,38 @@ +include ../../common/SERIAL.defs + +##### User configurable options ##### + +OPTFLAGS = $(DEFAULT_OPT_FLAGS) +#description: change above into something that is a decent optimization on you system + +#uncomment any of the following flags (and change values) to change defaults + +#BLOCKFLAG = -DDEFAULTBLOCK=32 +#description: default tile size is 32 (used only for non-MKL version) + +#OFFSETFLAG = -DBOFFSET=0 +#description: set this flag to some value to override default first array +# dimension padding (12) of tiles used in non-MKL version + +#MKLFLAG = -DMKL +#description: set this flag to call the tuned mkl library + +#DEBUGFLAG = -DVERBOSE +#description: default diagnostic style is silent + +USERFLAGS = +#description: parameter to specify optional flags + +EXTOBJS = +#LIBS = -lmkl_ia32 +#LIBPATHS = -L/opt/intel/mkl/10.0.3.020/lib/32 +#INCLUDEPATHS = -I/opt/intel/mkl/10.0.3.020/include + +### End User configurable options ### + +TUNEFLAGS = $(BLOCKFLAG) $(MKLFLAG) $(OFFSETFLAG) \ + $(DEBUGFLAG) $(USERFLAGS) +PROGRAM = dgemm +OBJS = $(PROGRAM).o $(COMOBJS) + +include ../../common/make.common diff --git a/tests/apps/prk/tests/SERIAL/DGEMM/dgemm.c b/tests/apps/prk/tests/SERIAL/DGEMM/dgemm.c new file mode 100755 index 0000000000..6de28b7f7d --- /dev/null +++ b/tests/apps/prk/tests/SERIAL/DGEMM/dgemm.c @@ -0,0 +1,248 @@ +/* +Copyright (c) 2013, Intel Corporation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. +* Neither the name of Intel Corporation nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +*/ + +/********************************************************************************* + +NAME: dgemm + +PURPOSE: This program tests the efficiency with which a dense matrix + dense multiplication is carried out + +USAGE: The program takes as input the matrix + order, the number of times the matrix-matrix multiplication + is carried out, and, optionally, a tile size for matrix + blocking + + <# iterations> [] + + The output consists of diagnostics to make sure the + algorithm worked, and of timing statistics. + +FUNCTIONS CALLED: + + Other than OpenMP or standard C functions, the following + functions are used in this program: + + wtime() + +HISTORY: Written by Rob Van der Wijngaart, February 2009. + +***********************************************************************************/ + +#include + +#ifdef MKL + #include +#endif + +#ifndef DEFAULTBLOCK + #define DEFAULTBLOCK 32 +#endif + +#ifndef BOFFSET + #define BOFFSET 12 +#endif +#define AA_arr(i,j) AA[(i)+(block+BOFFSET)*(j)] +#define BB_arr(i,j) BB[(i)+(block+BOFFSET)*(j)] +#define CC_arr(i,j) CC[(i)+(block+BOFFSET)*(j)] +#define A_arr(i,j) A[(i)+(order)*(j)] +#define B_arr(i,j) B[(i)+(order)*(j)] +#define C_arr(i,j) C[(i)+(order)*(j)] + +#define forder (1.0*order) + +main(int argc, char **argv){ + + int iter, i,ii,j,jj,k,kk,ig,jg,kg; /* dummies */ + int iterations; /* number of times the multiplication is done */ + double dgemm_time, /* timing parameters */ + avgtime; + double checksum = 0.0, /* checksum of result */ + ref_checksum; + double epsilon = 1.e-8; /* error tolerance */ + static + double *A, *B, *C; /* input (A,B) and output (C) matrices */ + int order; /* number of rows and columns of matrices */ + int block; /* tile size of matrices */ + +#ifndef MKL + if (argc != 4 && argc != 3) { + printf("Usage: %s <# iterations> [tile size]\n",*argv); +#else + if (argc != 3) { + printf("Usage: %s <# iterations> \n",*argv); +#endif + exit(EXIT_FAILURE); + } + + iterations = atoi(*++argv); + if (iterations < 1){ + printf("ERROR: Iterations must be positive : %d \n", iterations); + exit(EXIT_FAILURE); + } + + order = atoi(*++argv); + if (order < 1) { + printf("ERROR: Matrix order must be positive: %d\n", order); + exit(EXIT_FAILURE); + } + A = (double *) malloc(order*order*sizeof(double)); + B = (double *) malloc(order*order*sizeof(double)); + C = (double *) malloc(order*order*sizeof(double)); + if (!A || !B || !C) { + printf("ERROR: Could not allocate space for global matrices\n"); + exit(EXIT_FAILURE); + } + + for(j = 0; j < order; j++) for(i = 0; i < order; i++) { + A_arr(i,j) = B_arr(i,j) = (double) j; + C_arr(i,j) = 0.0; + } + + printf("Serial Dense matrix-matrix multiplication: C = A x B\n"); + +#ifndef MKL + if (argc == 4) { + block = atoi(*++argv); + } else block = DEFAULTBLOCK; + + double *AA, *BB, *CC; + + if (block > 0) { + /* matrix blocks for local temporary copies */ + AA = (double *) malloc(block*(block+BOFFSET)*3*sizeof(double)); + if (!AA) { + printf("Could not allocate space for matrix tiles\n"); + exit(EXIT_FAILURE); + } + BB = AA + block*(block+BOFFSET); + CC = BB + block*(block+BOFFSET); + } + + printf("Matrix order = %d\n", order); + if (block>0) + printf("Blocking factor = %d\n", block); + else + printf("No blocking\n"); + printf("Number of iterations = %d\n", iterations); + + for (iter=0; iter 0) { + + for(jj = 0; jj < order; jj+=block){ + for(kk = 0; kk < order; kk+=block) { + + for (jg=jj,j=0; jg epsilon) { + printf("ERROR: Checksum = %lf, Reference checksum = %lf\n", + checksum, ref_checksum); + exit(EXIT_FAILURE); + } + else { + printf("Solution validates\n"); +#ifdef VERBOSE + printf("Reference checksum = %lf, checksum = %lf\n", + ref_checksum, checksum); +#endif + } + + double nflops = 2.0*forder*forder*forder; + avgtime = dgemm_time/iterations; + printf("Rate (MFlops/s): %lf Avg time (s): %lf\n", + 1.0E-06 *nflops/avgtime, avgtime); + + exit(EXIT_SUCCESS); + +} diff --git a/tests/apps/prk/tests/SERIAL/Nstream/Makefile.ohpc b/tests/apps/prk/tests/SERIAL/Nstream/Makefile.ohpc new file mode 100644 index 0000000000..bbc94f57f9 --- /dev/null +++ b/tests/apps/prk/tests/SERIAL/Nstream/Makefile.ohpc @@ -0,0 +1,40 @@ +include ../../common/SERIAL.defs + +##### User configurable options ##### + +OPTFLAGS = $(DEFAULT_OPT_FLAGS) +#description: change above into something that is a decent optimization on you system + +#uncomment any of the following flags (and change values) to change defaults + +#RESTRICTFLAG = -DRESTRICT_KEYWORD +#description: the "restrict" keyword can be used on IA platforms to disambiguate +# data accessed through pointers (requires -restrict compiler flag) + +#LENGTHFLAG = -DMAXLENGTH=1000000000 +#description: default vector length is 2000000 + +#ALLOCFLAG = -DSTATIC_ALLOCATION +#description: default memory allocation is dynamic (using malloc) + +#DEBUGFLAG = -DVERBOSE +#description: default diagnostic style is silent + +USERFLAGS = +#description: parameter to specify optional flags + +#set the following variables for custom libraries and/or other objects +EXTOBJS = +LIBS = +LIBPATHS = +INCLUDEPATHS = + +### End User configurable options ### + +TUNEFLAGS = $(LENGTHFLAG) $(ALLOCFLAG) $(DEBUGFLAG) \ + $(USERFLAGS) $(RESTRICTFLAG) +PROGRAM = nstream +OBJS = $(PROGRAM).o $(COMOBJS) + +include ../../common/make.common + diff --git a/tests/apps/prk/tests/SERIAL/Nstream/nstream.c b/tests/apps/prk/tests/SERIAL/Nstream/nstream.c new file mode 100755 index 0000000000..1548c7fc10 --- /dev/null +++ b/tests/apps/prk/tests/SERIAL/Nstream/nstream.c @@ -0,0 +1,283 @@ +/* +Copyright (c) 2013, Intel Corporation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. +* Neither the name of Intel Corporation nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +*/ + +/*-----------------------------------------------------------------------*/ +/* Program: STREAM */ +/* Revision: $Id: stream.c,v 5.10 2013/01/17 16:01:06 mccalpin Exp mccalpin $ */ +/* Original code developed by John D. McCalpin */ +/* Programmers: John D. McCalpin */ +/* Joe R. Zagar */ +/* */ +/* This program measures memory transfer rates in MB/s for simple */ +/* computational kernels coded in C. */ +/*-----------------------------------------------------------------------*/ +/* Copyright 1991-2013: John D. McCalpin */ +/*-----------------------------------------------------------------------*/ +/* License: */ +/* 1. You are free to use this program and/or to redistribute */ +/* this program. */ +/* 2. You are free to modify this program for your own use, */ +/* including commercial use, subject to the publication */ +/* restrictions in item 3. */ +/* 3. You are free to publish results obtained from running this */ +/* program, or from works that you derive from this program, */ +/* with the following limitations: */ +/* 3a. In order to be referred to as "STREAM benchmark results", */ +/* published results must be in conformance to the STREAM */ +/* Run Rules, (briefly reviewed below) published at */ +/* http://www.cs.virginia.edu/stream/ref.html */ +/* and incorporated herein by reference. */ +/* As the copyright holder, John McCalpin retains the */ +/* right to determine conformity with the Run Rules. */ +/* 3b. Results based on modified source code or on runs not in */ +/* accordance with the STREAM Run Rules must be clearly */ +/* labelled whenever they are published. Examples of */ +/* proper labelling include: */ +/* "tuned STREAM benchmark results" */ +/* "based on a variant of the STREAM benchmark code" */ +/* Other comparable, clear, and reasonable labelling is */ +/* acceptable. */ +/* 3c. Submission of results to the STREAM benchmark web site */ +/* is encouraged, but not required. */ +/* 4. Use of this program or creation of derived works based on this */ +/* program constitutes acceptance of these licensing restrictions. */ +/* 5. Absolutely no warranty is expressed or implied. */ +/*-----------------------------------------------------------------------*/ + + + +/********************************************************************** + +NAME: nstream + +PURPOSE: To compute memory bandwidth when adding a vector of a given + number of double precision values to the scalar multiple of + another vector of the same length, and storing the result in + a third vector. + +USAGE: The program takes as input the number + of iterations to loop over the triad vectors, the length of the + vectors, and the offset between vectors + + <# iterations> + + The output consists of diagnostics to make sure the + algorithm worked, and of timing statistics. + +FUNCTIONS CALLED: + + Other than OpenMP or standard C functions, the following + external functions are used in this program: + + wtime() + checkTRIADresults() + +NOTES: Bandwidth is determined as the number of words read, plus the + number of words written, times the size of the words, divided + by the execution time. For a vector length of N, the total + number of words read and written is 4*N*sizeof(double). + +HISTORY: This code is loosely based on the Stream benchmark by John + McCalpin, but does not follow all the Stream rules. Hence, + reported results should not be associated with Stream in + external publications +**********************************************************************/ + +#include + +#define DEFAULTMAXLENGTH 2000000 +#ifdef MAXLENGTH + #if MAXLENGTH > 0 + #define N MAXLENGTH + #else + #define N DEFAULTMAXLENGTH + #endif +#else + #define N DEFAULTMAXLENGTH +#endif + +#ifdef STATIC_ALLOCATION + /* use static to make sure it goes on the heap, not the stack */ + static double a[N]; +#else + static double * RESTRICT a; +#endif + +static double * RESTRICT b; +static double * RESTRICT c; + +#define SCALAR 3.0 + +static int checkTRIADresults(int, long int); + +int main(int argc, char **argv) +{ + int j, iter; /* dummies */ + double scalar; /* constant used in Triad operation */ + int iterations; /* number of times vector loop gets repeated */ + long int length, /* total vector length */ + offset; /* offset between vectors a and b, and b and c */ + double bytes; /* memory IO size */ + size_t space; /* memory used for a single vector */ + double nstream_time, /* timing parameters */ + avgtime; + +/********************************************************************************** +* process and test input parameters +***********************************************************************************/ + + if (argc != 4){ + printf("Usage: %s <# iterations> \n", *argv); + exit(EXIT_FAILURE); + } + + iterations = atoi(*++argv); + length = atol(*++argv); + offset = atol(*++argv); + + if ((iterations < 1)) { + printf("ERROR: Invalid number of iterations: %d\n", iterations); + exit(EXIT_FAILURE); + } + + if (length < 0) { + printf("ERROR: Invalid vector length: %ld\n", length); + exit(EXIT_FAILURE); + } + + if (offset < 0) { + printf("ERROR: Invalid array offset: %ld\n", offset); + exit(EXIT_FAILURE); + } + +#ifdef STATIC_ALLOCATION + if ((3*length + 2*offset) > N) { + printf("ERROR: vector length/offset %ld/%ld too ", length, offset); + printf("large; increase MAXLENGTH in Makefile or decrease vector length\n"); + exit(EXIT_FAILURE); + } +#endif + +#ifndef STATIC_ALLOCATION + space = (3*length + 2*offset)*sizeof(double); + a = (double *) malloc(space); + if (!a) { + printf("ERROR: Could not allocate %ld words for vectors\n", + 3*length+2*offset); + exit(EXIT_FAILURE); + } +#endif + b = a + length + offset; + c = b + length + offset; + + + printf("Serial stream triad: A = B + scalar*C\n"); + printf("Vector length = %ld\n", length); + printf("Offset = %ld\n", offset); + printf("Number of iterations = %d\n", iterations); + + #pragma vector always + for (j=0; j epsilon) { + printf ("Failed Validation on output array\n"); +#ifndef VERBOSE + printf (" Expected checksum: %f \n",aj); + printf (" Observed checksum: %f \n",asum); +#endif + return (0); + } + else { + printf ("Solution validates\n"); + return (1); + } +} diff --git a/tests/apps/prk/tests/SERIAL/Random/Makefile.ohpc b/tests/apps/prk/tests/SERIAL/Random/Makefile.ohpc new file mode 100644 index 0000000000..34e5d1a35a --- /dev/null +++ b/tests/apps/prk/tests/SERIAL/Random/Makefile.ohpc @@ -0,0 +1,41 @@ +include ../../common/SERIAL.defs + +##### User configurable options ##### + +OPTFLAGS = $(DEFAULT_OPT_FLAGS) +#description: change above into something that is a decent optimization on you system + +#uncomment any of the following flags (and change values) to change defaults + +#RESTRICTFLAG = -DRESTRICT_KEYWORD +#description: the "restrict" keyword can be used on IA platforms to disambiguate +# data accessed through pointers + +HPCCFLAG = -DHPCC +#description: Uses HPC Challenge rules: 1% errors allowed; overrides ERRORPERCENTFLAG + +ERRORPERCENTFLAG = -DERRORPERCENT=1 +#description: percent errors allowed in solution; if unset, no errors allowed + +#LONG64FLAG = -DLONG_IS_64BITS +#description: can use "long" for 64 bit integers instead of "long long" + +#DEBUGFLAG = -DVERBOSE +#description: default diagnostic style is silent + +USERFLAGS = +#description: parameter to specify optional flags + +EXTOBJS = +LIBS = +LIBPATHS = +INCLUDEPATHS = + +### End User configurable options ### + +TUNEFLAGS = $(RESTRICTFLAG) $(LONG64FLAG) $(DEBUGFLAG) $(USERFLAGS) \ + $(HPCCFLAG) $(ERRORPERCENTFLAG) +PROGRAM = random +OBJS = $(PROGRAM).o $(COMOBJS) + +include ../../common/make.common diff --git a/tests/apps/prk/tests/SERIAL/Random/random.c b/tests/apps/prk/tests/SERIAL/Random/random.c new file mode 100644 index 0000000000..3066ff889c --- /dev/null +++ b/tests/apps/prk/tests/SERIAL/Random/random.c @@ -0,0 +1,397 @@ +/* +Copyright (c) 2013, Intel Corporation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. +* Neither the name of Intel Corporation nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +*/ + +/************************************************************* +Copyright (c) 2013 The University of Tennessee. All rights reserved. +Redistribution and use in source and binary forms, with or +without modification, are permitted provided that the following +conditions are met: + +- Redistributions of source code must retain the + above copyright notice, this list of conditions and + the following disclaimer. + +- Redistributions in binary form must reproduce the + above copyright notice, this list of conditions and + the following disclaimer listed in this license in the + documentation and/or other materials provided with the + distribution. + +- Neither the name of the copyright holders nor the names + of its contributors may be used to endorse or promote + products derived from this software without specific + prior written permission. + +This software is provided by the copyright holders and +contributors "as is" and any express or implied warranties, +including, but not limited to, the implied warranties of +merchantability and fitness for a particular purpose are +disclaimed. in no event shall the copyright owner or +contributors be liable for any direct, indirect, incidental, +special, exemplary, or consequential damages (including, but +not limited to, procurement of substitute goods or services; +loss of use, data, or profits; or business interruption) +however caused and on any theory of liability, whether in +contract, strict liability, or tort (including negligence or +otherwise) arising in any way out of the use of this software, +even if advised of the possibility of such damage. + +*************************************************************/ + +/******************************************************************* + +NAME: RandomAccess + +PURPOSE: This program tests the efficiency of the memory subsystem to + update elements of an array with irregular stride. + +USAGE: The program takes as input the 2log + of the size of the table that gets updated, the ratio of table size + over number of updates, and the vector length of simultaneously + updatable table elements. + + <#update ratio> + +FUNCTIONS CALLED: + + Other than standard C functions, the following + functions are used in this program: + + wtime() + PRK_starts() + poweroftwo() + +NOTES: This program is derived from HPC Challenge Random Access. The random + number generator computes successive powers of 0x2, modulo the + primitive polynomial x^63+x^2+x+1. The principal differences between + this code and the HPCC version are: + - we start the stream of random numbers not with seed 0x1, but the + SEQSEED-th element in the stream of powers of 0x2. + - the timed code applies the RandomAccess operator twice to the table of + computed resuls (starting with the same seed(s) for "ran" in both + iterations. The second pass makes sure that any update to any table + element that sets high-order bits in the first pass resets those bits + to zero. + - the verification test now simply constitutes checking whether table + element j equals j. + - the number of independent streams (vector length) can be changed by the + user. + + We note that the vectorized version of this code (i.e. nstarts unequal + to 1), does not feature exactly the same sequence of accesses and + intermediate update values in the table as the scalar version. The + reason for this is twofold. + 1. the elements in the stream of powers of 0x2 that get computed outside + the main timed loop as seeds for independent streams in the vectorized + version, using the jump-ahead function PRK_starts, are computed inside + the timed loop for the scalar version. However, since both versions do + the same number of timed random accesses, the vectorized version must + progress further in the sequence of powers of 0x2. + 2. The independent streams of powers of 0x2 computed in the vectorized + version can (and will) cause updates of the same elements of the table + in an order that is not consistent with the scalar version. That is, + distinct values of "ran" can refer to the same table element + "ran&(tablesize-1)," but the operation + Table[ran&(tablesize-1)] ^= ran will deposit different values in that + table element for different values of ran. At the end of each pass over + the data set, the table will contain the same values in the vector and + scalar version (ignoring the small differences caused by 1.) because of + commutativity of the XOR operator. If the update operator had been + non-commutative, the vector and scalar version would have yielded + different results. + +HISTORY: Written by Rob Van der Wijngaart, February 2009. + Histogram code (verbose mode) courtesy Roger Golliver + +************************************************************************************/ + +#include + +/* Define constants */ +/* PERIOD = (2^63-1)/7 = 7*73*127*337*92737*649657 */ +#ifdef LONG_IS_64BITS + #define POLY 0x0000000000000007UL + #define PERIOD 1317624576693539401L + /* sequence number in stream of random numbers to be used as initial value */ + #define SEQSEED 834568137686317453L +#else + #define POLY 0x0000000000000007ULL + #define PERIOD 1317624576693539401LL + /* sequence number in stream of random numbers to be used as initial value */ + #define SEQSEED 834568137686317453LL +#endif + +#ifdef HPCC + #undef ERRORPERCENT + #define ERRORPERCENT 1 +#else + #ifndef ERRORPERCENT + #define ERRORPERCENT 0 + #endif +#endif + +static u64Int PRK_starts(s64Int); +static int poweroftwo(int); + +int main(int argc, char **argv) { + + int update_ratio; /* multiplier of tablesize for # updates */ + int nstarts; /* vector length */ + s64Int i, j, round, oldsize; /* dummies */ + s64Int error; /* number of incorrect table elements */ + s64Int tablesize; /* aggregate table size (all threads */ + s64Int nupdate; /* number of updates per thread */ + size_t tablespace; /* bytes per thread required for table */ + u64Int *ran; /* vector of random numbers */ + s64Int index; /* index into Table */ +#ifdef VERBOSE + u64Int * RESTRICT Hist; /* histogram of # updates to table elements */ + unsigned int *HistHist; /* histogram of update frequencies */ +#endif + u64Int * RESTRICT Table; /* (pseudo-)randomly accessed array */ + double random_time; + int log2nstarts; /* log2 of vector length */ + int log2tablesize; /* log2 of aggregate table size */ + int log2update_ratio; /* log2 of update ratio */ + +#ifdef LONG_IS_64BITS + if (sizeof(long) != 8) { + printf("ERROR: Makefile says \"long\" is 8 bytes, but it is %d bytes\n", + sizeof(long)); + exit(EXIT_FAILURE); + } +#endif + +/********************************************************************* +** process and test input parameters +*********************************************************************/ + + if (argc != 4){ + printf("Usage: %s <#update ratio> ", *argv); + printf("\n"); + exit(EXIT_FAILURE); + } + + log2tablesize = atoi(*++argv); + if (log2tablesize < 1){ + printf("ERROR: Log2 tablesize is %d; must be >= 1\n",log2tablesize); + exit(EXIT_FAILURE); + } + + update_ratio = atoi(*++argv); + /* test whether update ratio is a power of two */ + log2update_ratio = poweroftwo(update_ratio); + if (log2update_ratio <0) { + printf("ERROR: Invalid update ratio: %d, must be a power of 2\n", + update_ratio); + exit(EXIT_FAILURE); + } + + nstarts = atoi(*++argv); + /* test whether vector length is a power of two */ + log2nstarts = poweroftwo(nstarts); + if (log2nstarts <0) { + printf("ERROR: Invalid vector length: %d, must be a power of 2\n", + nstarts); + exit(EXIT_FAILURE); + } + + /* compute table size carefully to make sure it can be represented */ + tablesize = 1; + for (i=0; i ((double) ERRORPERCENT)*0.01)) { + printf("ERROR: number of incorrect table elements = "FSTR64U"\n", error); + exit(EXIT_FAILURE); + } + else { + printf("Solution validates, number of errors: %ld\n",(long) error); + printf("Rate (GUPs/s): %lf time (s) = %lf\n", + 1.e-9*nupdate/random_time,random_time); + } + +#ifdef VERBOSE + for(i=0;i PERIOD) n -= PERIOD; + if (n == 0) return 0x1; + + temp = 0x1; + for (i=0; i<64; i++) { + m2[i] = temp; + temp = (temp << 1) ^ ((s64Int) temp < 0 ? POLY : 0); + temp = (temp << 1) ^ ((s64Int) temp < 0 ? POLY : 0); + } + + for (i=62; i>=0; i--) + if ((n >> i) & 1) + break; + + ran = 0x2; + while (i > 0) { + temp = 0; + for (j=0; j<64; j++) + if ((unsigned int)((ran >> j) & 1)) + temp ^= m2[j]; + ran = temp; + i -= 1; + if ((n >> i) & 1) + ran = (ran << 1) ^ ((s64Int) ran < 0 ? POLY : 0); + } + + return ran; +} + +/* utility routine that tests whether an integer is a power of two */ +int poweroftwo(int n) { + int log2n = 0; + + while ((1< <# iterations> [] + + The output consists of diagnostics to make sure the + algorithm worked, and of timing statistics. + +FUNCTIONS CALLED: + + Other than standard C functions, the following + functions are used in this program: + + wtime() + +HISTORY: Written by Rob Van der Wijngaart, February 2009. + +*******************************************************************/ + +#include + +int main(int argc, char ** argv) +{ + long vector_length; /* length of vectors to be aggregated */ + double reduce_time, /* timing parameters */ + avgtime; + double epsilon=1.e-8; /* error tolerance */ + int i, iter; /* dummies */ + double element_value; /* reference element value for final vector */ + int iterations; /* number of times the reduction is carried out */ + double * RESTRICT vector;/* vector to be reduced */ + double * RESTRICT ones; /* vector to be reduced */ + +/***************************************************************************** +** process and test input parameters +******************************************************************************/ + + if (argc != 3){ + printf("Usage: %s <# iterations> \n", *argv); + return(EXIT_FAILURE); + } + + iterations = atoi(*++argv); + if (iterations < 1){ + printf("ERROR: Iterations must be positive : %d\n", iterations); + exit(EXIT_FAILURE); + } + + vector_length = atol(*++argv); + if (vector_length < 1){ + printf("ERROR: vector length must be >= 1 : %ld\n",vector_length); + exit(EXIT_FAILURE); + } + + printf("Serial Vector Reduction\n"); + printf("Vector length = %ld\n", vector_length); + printf("Number of iterations = %d\n", iterations); + + vector= (double *) malloc(2*vector_length*sizeof(double)); + if (vector==NULL) { + printf("ERROR: Could not allocate space for vector: %ld\n", + 2*vector_length*sizeof(double)); + exit(EXIT_FAILURE); + } + + ones = vector + vector_length; + + /* initialize the arrays */ + for (i=0; i= epsilon) { + printf("First error at i=%d; value: %lf; reference value: %lf\n", + i, vector[i], element_value); + exit(EXIT_FAILURE); + } + } + + printf("Solution validates\n"); +#ifdef VERBOSE + printf("Element verification value: %lf\n", element_value); +#endif + avgtime = reduce_time/(double)iterations; + printf("Rate (MFlops/s): %lf Avg time (s): %lf\n", + 1.0E-06 * (2.0-1.0)*vector_length/avgtime, avgtime); + + exit(EXIT_SUCCESS); +} diff --git a/tests/apps/prk/tests/SERIAL/Sparse/Makefile.ohpc b/tests/apps/prk/tests/SERIAL/Sparse/Makefile.ohpc new file mode 100644 index 0000000000..0c844370e4 --- /dev/null +++ b/tests/apps/prk/tests/SERIAL/Sparse/Makefile.ohpc @@ -0,0 +1,34 @@ +include ../../common/SERIAL.defs + +##### User configurable options ##### + +OPTFLAGS = $(DEFAULT_OPT_FLAGS) +#description: change above into something that is a decent optimization on you system + +#uncomment any of the following flags (and change values) to change defaults + +#RESTRICTFLAG = -DRESTRICT_KEYWORD +#description: the "restrict" keyword can be used on IA platforms to disambiguate +# data accessed through pointers + +#DEBUGFLAG = -DVERBOSE +#description: default diagnostic style is silent + +SCRAMBLEFLAG = -DSCRAMBLE +#description: if flag is set, grid indices are scrambled to produce irregular stride + +USERFLAGS = +#description: parameter to specify optional flags + +EXTOBJS = +LIBS = +LIBPATHS = +INCLUDEPATHS = + +### End User configurable options ### + +TUNEFLAGS = $(DEBUGFLAG) $(USERFLAGS) $(SCRAMBLEFLAG) $(RESTRICTFLAG) +PROGRAM = sparse +OBJS = $(PROGRAM).o $(COMOBJS) + +include ../../common/make.common diff --git a/tests/apps/prk/tests/SERIAL/Sparse/README b/tests/apps/prk/tests/SERIAL/Sparse/README new file mode 100755 index 0000000000..81755fc7db --- /dev/null +++ b/tests/apps/prk/tests/SERIAL/Sparse/README @@ -0,0 +1,32 @@ +This program constructs a sparse matrix and performs a (parallel) +sparse matrix-vector multiplication. The sparse matrix is built as +follows. The standard star-shaped discretization stencil with a +user-specified radius is applied to a structured 2-dimensional +grid. Example of a stencil with radius r=2: + + 0 + | + 0 + | + 0--0--0--0--0 + | + 0 + | + 0 + +Here, the `0' symbol signifies inclusion in the stencil. A square grid +with linear dimension (2^n) has 2^(2n) = 4^n points. The resulting +matrix has (4^n) rows and (4^n) columns, for a total of (16^n) +elements. The user specifies n. The stencil is applied in a periodic +fashion, i.e. it wraps around the edges of the grid. + +If the scramble flag is unset in the Makefile, the discretization +stencil results in a regularly banded sparse matrix, which can be +stored efficiently in vectors, in principle. If the scramble flag is +maintained, the columns of the matrix are permuted, resulting in a +general irregular sparse matrix, but with a known number of nonzeroes +per row (4r+1). We use Compressed Row Storage for accessing the matrix +elements, even in the case of an unset scramble flag. Numerical values +of matrix elements are chosen judiciously to make verification +easy. They do not correspond to any realistic discretization of a +continuum problem. diff --git a/tests/apps/prk/tests/SERIAL/Sparse/sparse.c b/tests/apps/prk/tests/SERIAL/Sparse/sparse.c new file mode 100755 index 0000000000..4ca206afc7 --- /dev/null +++ b/tests/apps/prk/tests/SERIAL/Sparse/sparse.c @@ -0,0 +1,301 @@ +/* +Copyright (c) 2013, Intel Corporation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. +* Neither the name of Intel Corporation nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +*/ + +/********************************************************************************* + +NAME: sparse + +PURPOSE: This program tests the efficiency with which a sparse matrix + vector multiplication is carried out + +USAGE: The program takes as input the 2log of the linear size of the 2D grid + (equalling the 2log of the square root of the order of the sparse + matrix), the radius of the difference stencil, and the number + of times the matrix-vector multiplication is carried out. + + <# iterations> <2log root-of-matrix-order> + + The output consists of diagnostics to make sure the + algorithm worked, and of timing statistics. + +FUNCTIONS CALLED: + + Other than standard C functions, the following + functions are used in this program: + + wtime() + reverse() + qsort() + compare + +NOTES: + +HISTORY: Written by Rob Van der Wijngaart, August 2009. + Updated by RvdW to fix verification bug, February 2013 + Updated by RvdW to sort matrix elements to reflect traditional CSR storage, + August 2013 + +***********************************************************************************/ + +#include + +/* linearize the grid index */ +#define LIN(i,j) (i+((j)< <2log grid size> \n",*argv); + exit(EXIT_FAILURE); + } + + iterations = atoi(*++argv); + if (iterations < 1){ + printf("ERROR: Iterations must be positive : %d \n", iterations); + exit(EXIT_FAILURE); + } + + lsize = atoi(*++argv); + lsize2 = 2*lsize; + size = 1< epsilon) { + printf("ERROR: Vector sum = %lf, Reference vector sum = %lf\n", + vector_sum, reference_sum); + exit(EXIT_FAILURE); + } + else { + printf("Solution validates\n"); +#ifdef VERBOSE + printf("Reference sum = %lf, vector sum = %lf\n", + reference_sum, vector_sum); +#endif + } + + avgtime = sparse_time/iterations; + printf("Rate (MFlops/s): %lf Avg time (s): %lf\n", + 1.0E-06 * (2.0*nent)/avgtime, avgtime); + + exit(EXIT_SUCCESS); +} + +/* Code below reverses bits in unsigned integer stored in a 64-bit word. + Bit reversal is with respect to the largest integer that is going to be + processed for the particular run of the code, to make sure the reversal + constitutes a true permutation. Hence, the final result needs to be shifted + to the right. + Example: if largest integer being processed is 0x000000ff = 255 = + 0000...0011111111 (binary), then the unshifted reversal of 0x00000006 = 6 = + 0000...0000000110 (binary) would be 011000000...0000 = 3*2^61, which is + outside the range of the original sequence 0-255. Setting shift_in_bits to + 2log(256) = 8, the final result is shifted the the right by 64-8=56 bits, + so we get 000...0001100000 (binary) = 96, which is within the proper range */ +u64Int reverse(register u64Int x, int shift_in_bits){ + x = ((x >> 1) & 0x5555555555555555) | ((x << 1) & 0xaaaaaaaaaaaaaaaa); + x = ((x >> 2) & 0x3333333333333333) | ((x << 2) & 0xcccccccccccccccc); + x = ((x >> 4) & 0x0f0f0f0f0f0f0f0f) | ((x << 4) & 0xf0f0f0f0f0f0f0f0); + x = ((x >> 8) & 0x00ff00ff00ff00ff) | ((x << 8) & 0xff00ff00ff00ff00); + x = ((x >> 16) & 0x0000ffff0000ffff) | ((x << 16) & 0xffff0000ffff0000); + x = ((x >> 32) & 0x00000000ffffffff) | ((x << 32) & 0xffffffff00000000); + return (x>>((sizeof(u64Int)*BITS_IN_BYTE-shift_in_bits))); +} + +int compare(const void *el1, const void *el2) { + s64Int v1 = *(s64Int *)el1; + s64Int v2 = *(s64Int *)el2; + return (v1v2) ? 1 : 0; +} diff --git a/tests/apps/prk/tests/SERIAL/Stencil/Makefile.ohpc b/tests/apps/prk/tests/SERIAL/Stencil/Makefile.ohpc new file mode 100644 index 0000000000..9e366f96db --- /dev/null +++ b/tests/apps/prk/tests/SERIAL/Stencil/Makefile.ohpc @@ -0,0 +1,41 @@ +include ../../common/SERIAL.defs +##### User configurable options ##### + +OPTFLAGS = $(DEFAULT_OPT_FLAGS) +#description: change above into something that is a decent optimization on you system + +#uncomment any of the following flags (and change values) to change defaults + +#RESTRICTFLAG = -DRESTRICT_KEYWORD +#description: the "restrict" keyword can be used on IA platforms to disambiguate +# data accessed through pointers + +#RADIUSFLAG = -DRADIUS=R +#description: default radius of filter to be applied is 2 + +DOUBLEFLAG = -DDOUBLE +#description: default data type is single precision + +STARFLAG = -DSTAR +#description: default stencil is compact (dense, square) + +#DEBUGFLAG = -DVERBOSE +#description: default diagnostic style is silent + +USERFLAGS = +#description: parameter to specify optional flags + +#set the following variables for custom libraries and/or other objects +EXTOBJS = +LIBS = +LIBPATHS = +INCLUDEPATHS = + +### End User configurable options ### + +TUNEFLAGS = $(RESTRICTFLAG) $(DEBUGFLAG) $(USERFLAGS) \ + $(DOUBLEFLAG) $(RADIUSFLAG) $(STARFLAG) +PROGRAM = stencil +OBJS = $(PROGRAM).o $(COMOBJS) + +include ../../common/make.common diff --git a/tests/apps/prk/tests/SERIAL/Stencil/stencil.c b/tests/apps/prk/tests/SERIAL/Stencil/stencil.c new file mode 100755 index 0000000000..a7652182ca --- /dev/null +++ b/tests/apps/prk/tests/SERIAL/Stencil/stencil.c @@ -0,0 +1,257 @@ +/* +Copyright (c) 2013, Intel Corporation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. +* Neither the name of Intel Corporation nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +*/ + +/******************************************************************* + +NAME: Stencil + +PURPOSE: This program tests the efficiency with which a space-invariant, + linear, symmetric filter (stencil) can be applied to a square + grid or image. + +USAGE: The program takes as input the linear + dimension of the grid, and the number of iterations on the grid + + + + The output consists of diagnostics to make sure the + algorithm worked, and of timing statistics. + +FUNCTIONS CALLED: + + Other than standard C functions, the following functions are used in + this program: + wtime() + +HISTORY: - Written by Rob Van der Wijngaart, February 2009. + - RvdW: Removed unrolling pragmas for clarity; + added constant to array "in" at end of each iteration to force + refreshing of neighbor data in parallel versions; August 2013 + +**********************************************************************************/ + +#include + +#ifndef RADIUS + #define RADIUS 2 +#endif + +#ifdef DOUBLE + #define DTYPE double + #define EPSILON 1.e-8 + #define COEFX 1.0 + #define COEFY 1.0 + #define FSTR "%lf" +#else + #define DTYPE float + #define EPSILON 0.0001f + #define COEFX 1.0f + #define COEFY 1.0f + #define FSTR "%f" +#endif + +/* define shorthand for indexing a multi-dimensional array */ +#define IN(i,j) in[i+(j)*(n)] +#define OUT(i,j) out[i+(j)*(n)] +#define WEIGHT(ii,jj) weight[ii+RADIUS][jj+RADIUS] + +int main(int argc, char ** argv) { + + int n; /* linear grid dimension */ + int i, j, ii, jj, it, jt, iter; /* dummies */ + DTYPE norm, /* L1 norm of solution */ + reference_norm; + DTYPE f_active_points; /* interior of grid with respect to stencil */ + DTYPE flops; /* floating point ops per iteration */ + int iterations; /* number of times to run the algorithm */ + double stencil_time, /* timing parameters */ + avgtime; + int stencil_size; /* number of points in stencil */ + DTYPE * RESTRICT in; /* input grid values */ + DTYPE * RESTRICT out; /* output grid values */ + int total_length; /* total required length to store grid values */ + DTYPE weight[2*RADIUS+1][2*RADIUS+1]; /* weights of points in the stencil */ + + /******************************************************************************* + ** process and test input parameters + ********************************************************************************/ + + if (argc != 3){ + printf("Usage: %s <# iterations> \n", + *argv); + return(EXIT_FAILURE); + } + + iterations = atoi(*++argv); + if (iterations < 1){ + printf("ERROR: iterations must be >= 1 : %d \n",iterations); + exit(EXIT_FAILURE); + } + + n = atoi(*++argv); + + if (n < 1){ + printf("ERROR: grid dimension must be positive: %d\n", n); + exit(EXIT_FAILURE); + } + + if (RADIUS < 1) { + printf("ERROR: Stencil radius %d should be positive\n", RADIUS); + exit(EXIT_FAILURE); + } + + if (2*RADIUS +1 > n) { + printf("ERROR: Stencil radius %d exceeds grid size %d\n", RADIUS, n); + exit(EXIT_FAILURE); + } + + /* make sure the vector space can be represented */ + total_length = n*n*sizeof(DTYPE); + if (total_length/n != n*sizeof(DTYPE)) { + printf("ERROR: Space for %d x %d grid cannot be represented; ", n, n); + exit(EXIT_FAILURE); + } + + in = (DTYPE *) malloc(total_length); + out = (DTYPE *) malloc(total_length); + if (!in || !out) { + printf("ERROR: could not allocate space for input or output array\n"); + exit(EXIT_FAILURE); + } + + /* fill the stencil weights to reflect a discrete divergence operator */ + for (jj=-RADIUS; jj<=RADIUS; jj++) for (ii=-RADIUS; ii<=RADIUS; ii++) + WEIGHT(ii,jj) = (DTYPE) 0.0; +#ifdef STAR + stencil_size = 4*RADIUS+1; + for (ii=1; ii<=RADIUS; ii++) { + WEIGHT(0, ii) = WEIGHT( ii,0) = (DTYPE) (1.0/(2.0*ii*RADIUS)); + WEIGHT(0,-ii) = WEIGHT(-ii,0) = -(DTYPE) (1.0/(2.0*ii*RADIUS)); + } +#else + stencil_size = (2*RADIUS+1)*(2*RADIUS+1); + for (jj=1; jj<=RADIUS; jj++) { + for (ii=-jj+1; ii EPSILON) { + printf("ERROR: L1 norm = "FSTR", Reference L1 norm = "FSTR"\n", + norm, reference_norm); + exit(EXIT_FAILURE); + } + else { + printf("Solution validates\n"); +#ifdef VERBOSE + printf("Reference L1 norm = "FSTR", L1 norm = "FSTR"\n", + reference_norm, norm); +#endif + } + + flops = (DTYPE) (2*stencil_size+1) * f_active_points; + avgtime = stencil_time/iterations; + printf("Rate (MFlops/s): "FSTR" Avg time (s): %lf\n", + 1.0E-06 * flops/avgtime, avgtime); + + exit(EXIT_SUCCESS); +} diff --git a/tests/apps/prk/tests/SERIAL/Synch_p2p/Makefile.ohpc b/tests/apps/prk/tests/SERIAL/Synch_p2p/Makefile.ohpc new file mode 100644 index 0000000000..075f924130 --- /dev/null +++ b/tests/apps/prk/tests/SERIAL/Synch_p2p/Makefile.ohpc @@ -0,0 +1,28 @@ +include ../../common/SERIAL.defs +##### User configurable options ##### + +OPTFLAGS = $(DEFAULT_OPT_FLAGS) +#description: change above into something that is a decent optimization on you system + +#uncomment any of the following flags (and change values) to change defaults + +#DEBUGFLAG = -DVERBOSE +#description: default diagnostic style is silent + +USERFLAGS = +#description: parameter to specify optional flags + +#set the following variables for custom libraries and/or other objects +EXTOBJS = +LIBS = +LIBPATHS = +INCLUDEPATHS = + +### End User configurable options ### + +TUNEFLAGS = $(DEBUGFLAG) $(USERFLAGS) $(MEMORY_FLAG) +PROGRAM = p2p +# objects below are the default, used by "clean," if invoked +OBJS = $(PROGRAM).o $(COMOBJS) + +include ../../common/make.common diff --git a/tests/apps/prk/tests/SERIAL/Synch_p2p/p2p.c b/tests/apps/prk/tests/SERIAL/Synch_p2p/p2p.c new file mode 100755 index 0000000000..e52330a5c5 --- /dev/null +++ b/tests/apps/prk/tests/SERIAL/Synch_p2p/p2p.c @@ -0,0 +1,157 @@ +/* +Copyright (c) 2013, Intel Corporation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. +* Neither the name of Intel Corporation nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +*/ + +/******************************************************************* + +NAME: Pipeline + +PURPOSE: This program tests the efficiency with which point-to-point + synchronization can be carried out. It does so by executing + a pipelined algorithm on an m*n grid. The first array dimension + is distributed among the threads (stripwise decomposition). + +USAGE: The program takes as input the + dimensions of the grid, and the number of iterations on the grid + + + + The output consists of diagnostics to make sure the + algorithm worked, and of timing statistics. + +FUNCTIONS CALLED: + + Other than standard C functions, the following + functions are used in this program: + + wtime() + +HISTORY: - Written by Rob Van der Wijngaart, February 2009. +*******************************************************************/ + +#include + +/* define shorthand for indexing a multi-dimensional array */ +#define ARRAY(i,j) vector[i+(j)*(m)] + +int main(int argc, char ** argv) { + + int m, n; /* grid dimensions */ + int i, j, iter; /* dummies */ + int iterations; /* number of times to run the pipeline algorithm */ + double pipeline_time, /* timing parameters */ + avgtime; + double epsilon = 1.e-8; /* error tolerance */ + double corner_val; /* verification value at top right corner of grid */ + double *RESTRICT vector;/* array holding grid values */ + long total_length; /* total required length to store grid values */ + + /******************************************************************************* + ** process and test input parameters + ********************************************************************************/ + + if (argc != 4){ + printf("Usage: %s <# iterations> ", *argv); + printf("\n"); + return(EXIT_FAILURE); + } + + iterations = atoi(*++argv); + if (iterations < 1){ + printf("ERROR: iterations must be >= 1 : %d \n",iterations); + exit(EXIT_FAILURE); + } + + m = atoi(*++argv); + n = atoi(*++argv); + + if (m < 1 || n < 1){ + printf("ERROR: grid dimensions must be positive: %d, %d \n", m, n); + exit(EXIT_FAILURE); + } + + total_length = sizeof(double)*m*n; + vector = (double *) malloc(total_length); + if (!vector) { + printf("ERROR: Could not allocate space for array: %ld\n", total_length); + exit(EXIT_FAILURE); + } + + printf("Serial pipeline execution on 2D grid\n"); + printf("Grid sizes = %d, %d\n", m, n); + printf("Number of iterations = %d\n", iterations); + + /* clear the array */ + for (j=0; j epsilon) { + printf("ERROR: checksum %lf does not match verification value %lf\n", + ARRAY(m-1,n-1), corner_val); + exit(EXIT_FAILURE); + } + +#ifdef VERBOSE + printf("Solution validates; verification value = %lf\n", corner_val); +#else + printf("Solution validates\n"); +#endif + avgtime = pipeline_time/iterations; + printf("Rate (MFlops/s): %lf Avg time (s): %lf\n", + 1.0E-06 * 2 * ((double)((m-1)*(n-1)))/avgtime, avgtime); + + exit(EXIT_SUCCESS); +} diff --git a/tests/apps/prk/tests/SERIAL/Transpose/Makefile.ohpc b/tests/apps/prk/tests/SERIAL/Transpose/Makefile.ohpc new file mode 100644 index 0000000000..802f8c25b7 --- /dev/null +++ b/tests/apps/prk/tests/SERIAL/Transpose/Makefile.ohpc @@ -0,0 +1,32 @@ +include ../../common/SERIAL.defs + +##### User configurable options ##### + +OPTFLAGS = $(DEFAULT_OPT_FLAGS) +#description: change above into something that is a decent optimization on you system + +#uncomment any of the following flags (and change values) to change defaults + +#RESTRICTFLAG = -DRESTRICT_KEYWORD +#description: the "restrict" keyword can be used on IA platforms to disambiguate +# data accessed through pointers + +#DEBUGFLAG = -DVERBOSE +#description: default diagnostic style is silent + +USERFLAGS = +#description: parameter to specify optional flags + +#set the following variables for custom libraries and/or other objects +EXTOBJS = +LIBS = +LIBPATHS = +INCLUDEPATHS = + +### End User configurable options ### + +TUNEFLAGS = $(DEBUGFLAG) $(USERFLAGS) $(RESTRICTFLAG) +PROGRAM = transpose +OBJS = $(PROGRAM).o $(COMOBJS) + +include ../../common/make.common diff --git a/tests/apps/prk/tests/SERIAL/Transpose/transpose.c b/tests/apps/prk/tests/SERIAL/Transpose/transpose.c new file mode 100755 index 0000000000..20c300f891 --- /dev/null +++ b/tests/apps/prk/tests/SERIAL/Transpose/transpose.c @@ -0,0 +1,201 @@ +/* +Copyright (c) 2013, Intel Corporation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. +* Neither the name of Intel Corporation nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +*/ + +/******************************************************************* + +NAME: transpose + +PURPOSE: This program measures the time for the transpose of a + column-major stored matrix into a row-major stored matrix. + +USAGE: Program input is the matrix order and the number of times to + repeat the operation: + + transpose <# iterations> [tile size] + + An optional parameter specifies the tile size used to divide the + individual matrix blocks for improved cache and TLB performance. + + The output consists of diagnostics to make sure the + transpose worked and timing statistics. + + +FUNCTIONS CALLED: + + Other than standard C functions, the following + functions are used in this program: + + wtime() portable wall-timer interface. + +HISTORY: Written by Rob Van der Wijngaart, February 2009. +*******************************************************************/ + +#include + +#define A(i,j) A_p[(i)+order*(j)] +#define B(i,j) B_p[(i)+order*(j)] + +static double test_results (int , double*); + +int main(int argc, char ** argv) { + + int order; /* order of a the matrix */ + int tile_size=32; /* default tile size for tiling of local transpose */ + int iterations; /* number of times to do the transpose */ + int i, j, it, jt, iter; /* dummies */ + double bytes; /* combined size of matrices */ + double * RESTRICT A_p;/* buffer to hold original matrix */ + double * RESTRICT B_p;/* buffer to hold transposed matrix */ + double abserr; /* squared error */ + double epsilon=1.e-8; /* error tolerance */ + double trans_time, /* timing parameters */ + avgtime; + + /********************************************************************* + ** read and test input parameters + *********************************************************************/ + + if (argc != 4 && argc != 3){ + printf("Usage: %s <# iterations> [tile size]\n", + *argv); + exit(EXIT_FAILURE); + } + + iterations = atoi(*++argv); + if (iterations < 1){ + printf("ERROR: iterations must be >= 1 : %d \n",iterations); + exit(EXIT_FAILURE); + } + + order = atoi(*++argv); + if (order < 0){ + printf("ERROR: Matrix Order must be greater than 0 : %d \n", order); + exit(EXIT_FAILURE); + } + + if (argc == 4) tile_size = atoi(*++argv); + /* a non-positive tile size means no tiling of the local transpose */ + if (tile_size <=0) tile_size = order; + + /********************************************************************* + ** Allocate space for the input and transpose matrix + *********************************************************************/ + + A_p = (double *)malloc(order*order*sizeof(double)); + if (A_p == NULL){ + printf(" Error allocating space for input matrix\n"); + exit(EXIT_FAILURE); + } + B_p = (double *)malloc(order*order*sizeof(double)); + if (B_p == NULL){ + printf(" Error allocating space for transposed matrix\n"); + exit(EXIT_FAILURE); + } + + bytes = 2.0 * sizeof(double) * order * order; + + printf("Serial Matrix transpose: B = A^T\n"); + printf("Matrix order = %d\n", order); + if (tile_size < order) printf("Tile size = %d\n", tile_size); + else printf("Untiled\n"); + printf("Number of iterations = %d\n", iterations); + + /* Fill the original matrix, set transpose to known garbage value. */ + + /* Fill the original column matrix */ + for (j=0;j <# iterations> + + The output consists of diagnostics to make sure the + algorithm worked, and of timing statistics. + +FUNCTIONS CALLED: + + Other than SHMEM or standard C functions, the following + functions are used in this program: + + wtime() + bail_out() + +HISTORY: - Written by Rob Van der Wijngaart, March 2006. + - modified by Rob Van der Wijngaart, August 2006: + * changed boundary conditions and stencil computation to avoid + overflow + * introduced multiple iterations over grid and dependency between + iterations + - modified by Gabriele Jost, March 2015: + * adapted for SHMEM + +**********************************************************************************/ + +#include +#include + +#define ARRAY(i,j) vector[i+1+(j)*(segment_size+1)] + +int main(int argc, char ** argv) +{ + int my_ID; /* MPI rank */ + int root; /* ID of master rank */ + int m, n; /* grid dimensions */ + double *pipeline_time, /* timing parameters */ + *local_pipeline_time, avgtime; + double epsilon = 1.e-8; /* error tolerance */ + double corner_val; /* verification value at top right corner of grid */ + int i, j, iter, ID; /* dummies */ + int iterations; /* number of times to run the pipeline algorithm */ + int *start, *end; /* starts and ends of grid slices */ + int segment_size; /* x-dimension of grid slice owned by calling rank */ + int error=0; /* error flag */ + int Num_procs; /* Number of ranks */ + double *vector; /* array holding grid values */ + long total_length; /* total required length to store grid values */ + int *flag_snd; /* synchronization flags */ + double *dst; /* target address of communication */ + double *src; /* source address of communication */ + long pSync[_SHMEM_BCAST_SYNC_SIZE]; /* work space for SHMEM collectives */ + double pWrk [_SHMEM_BCAST_SYNC_SIZE]; /* work space for SHMEM collectives */ + +/********************************************************************************* +** Initialize the SHMEM environment +**********************************************************************************/ + start_pes (0); + my_ID = shmem_my_pe(); + Num_procs = shmem_n_pes(); +/* we set root equal to the highest rank, because this is also the rank that + reports on the verification value */ + root = Num_procs-1; + +/********************************************************************* +** process, test and broadcast input parameter +*********************************************************************/ + if (argc != 4){ + if (my_ID == root) + printf("Usage: %s <#iterations> <1st array dimension> <2nd array dimension>\n", + *argv); + error = 1; + goto ENDOFTESTS; + } + + iterations = atoi(*++argv); + if (iterations < 1){ + if (my_ID==root) + printf("ERROR: iterations must be >= 1 : %d \n",iterations); + error = 1; + goto ENDOFTESTS; + } + + m = atoi(*++argv); + n = atoi(*++argv); + if (m < 1 || n < 1){ + if (my_ID == root) + printf("ERROR: grid dimensions must be positive: %d, %d \n", m, n); + error = 1; + goto ENDOFTESTS; + } + +/* initialize sync variables for error checks */ + for (i = 0; i < SHMEM_BCAST_SYNC_SIZE; i += 1) { + pSync[i] = _SHMEM_SYNC_VALUE; + } + + if (m<=Num_procs) { + if (my_ID == root) + printf("ERROR: First grid dimension %d must be > #ranks %d\n", m, Num_procs); + error = 1; + } + ENDOFTESTS:; + bail_out (error, pSync); + + if (my_ID == root) { + printf("SHMEM pipeline execution on 2D grid\n"); + printf("Number of ranks = %d\n",Num_procs); + printf("Grid sizes = %d, %d\n", m, n); + printf("Number of iterations = %d\n", iterations); + } + + flag_snd = (int *) shmalloc (sizeof(int) * n); + dst = (double *) shmalloc (sizeof(double) * (n)); + src = (double *) shmalloc (sizeof(double) * (n)); + local_pipeline_time = (double *) shmalloc (sizeof(double)); + pipeline_time = (double *) shmalloc (sizeof(double)); + if (!flag_snd || !dst || !src || !local_pipeline_time || !pipeline_time) { + printf("ERROR: could not allocate flags or communication buffers on rank %d\n", + my_ID); + error = 1; + } + bail_out(error, pSync); + + start = (int *) shmalloc(2*Num_procs*sizeof(int)); + if (!start) { + printf("ERROR: Could not allocate space for array of slice boundaries on rank %d\n", + my_ID); + error = 1; + } + bail_out(error,pSync); + end = start + Num_procs; + start[0] = 0; + for (ID=0; ID0) start[ID] = end[ID-1]+1; + end[ID] = start[ID]+segment_size-1; + } + + /* now set segment_size to the value needed by the calling rank */ + segment_size = end[my_ID] - start[my_ID] + 1; + + /* total_length takes into account one ghost cell on left side of segment */ + total_length = ((end[my_ID]-start[my_ID]+1)+1)*n; + vector = (double *) shmalloc(total_length*sizeof(double)); + if (vector == NULL) { + printf("Could not allocate space for grid slice of %d by %d points", + segment_size, n); + printf(" on rank %d\n", my_ID); + error = 1; + } + bail_out(error, pSync); + + /* clear the array */ + for (j=0; j 0) { + shmem_int_wait_until (&flag_snd [j], SHMEM_CMP_NE, iter%2); + ARRAY(start[my_ID]-1,j) = dst[j]; + } + + for (i=start[my_ID]; i<= end[my_ID]; i++) { + ARRAY(i,j) = ARRAY(i-1,j) + ARRAY(i,j-1) - ARRAY(i-1,j-1); + } + + /* if I am not on the right boundary, send data to my right neighbor */ + if (my_ID != Num_procs-1) { + src[j] = ARRAY (end[my_ID],j); + shmem_putmem(&dst[j], &src[j], sizeof(double), my_ID+1); + shmem_fence(); + shmem_int_swap (&flag_snd [j], !(iter%2), my_ID+1); + } + } + + corner_val = 0.; + /* copy top right corner value to bottom left corner to create dependency */ + if (Num_procs >1) { + if (my_ID==root) { + corner_val = -ARRAY(end[my_ID],n-1); + src [0] = corner_val; + shmem_putmem(&dst[0], &src[0], sizeof(double), 0); + shmem_fence(); + shmem_int_swap(&flag_snd[0], !(iter%2), 0); + } + if (my_ID==0) { + shmem_int_wait_until (&flag_snd[0], SHMEM_CMP_NE, iter%2); + ARRAY(0,0) = dst[0]; + } + } + else ARRAY(0,0)= -ARRAY(end[my_ID],n-1); + } + + local_pipeline_time [0] = wtime() - local_pipeline_time [0]; + shmem_double_max_to_all(pipeline_time, local_pipeline_time, 1, 0, 0, Num_procs, + pWrk, pSync); + + /* verify correctness, using top right value */ + corner_val = (double) ((iterations+1)*(m+n-2)); + if (my_ID == root) { + if (abs(ARRAY(end[my_ID],n-1)-corner_val)/corner_val >= epsilon) { + printf("ERROR: checksum %lf does not match verification value %lf\n", + ARRAY(end[my_ID],n-1), corner_val); + error = 1; + } + } + bail_out(error, pSync); + + if (my_ID == root) { + avgtime = pipeline_time [0]/iterations; +#ifdef VERBOSE + printf("Solution validates; verification value = %lf\n", corner_val); + printf("Point-to-point synchronizations/s: %lf\n", + ((float)((n-1)*(Num_procs-1)))/(avgtime)); +#else + printf("Solution validates\n"); +#endif + printf("Rate (MFlops/s): %lf, Avg time (s): %lf\n", + 1.0E-06 * 2 * ((double)((m-1)*(n-1)))/avgtime, avgtime); + } + + exit(EXIT_SUCCESS); + +} /* end of main */ + diff --git a/tests/apps/prk/tests/TEST_ENV b/tests/apps/prk/tests/TEST_ENV new file mode 100644 index 0000000000..f915bc79d7 --- /dev/null +++ b/tests/apps/prk/tests/TEST_ENV @@ -0,0 +1,9 @@ +if [ -s ../../../TEST_ENV ];then + source ../../../TEST_ENV +fi + +CMD_TIMEOUT="5:00" +TEST_MAX_COMPUTES=1024 +TEST_NUM_RANKS=2 +TEST_NUM_THREADS=4 +TEST_NUM_ITERS=10 diff --git a/tests/apps/prk/tests/build b/tests/apps/prk/tests/build new file mode 100755 index 0000000000..9a2a9c4fcd --- /dev/null +++ b/tests/apps/prk/tests/build @@ -0,0 +1,9 @@ +#!../../../common/bats/bin/bats +# -*-sh-*- + +@test "[Apps/PRK] build PRK executables ($LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + + make -f Makefile.ohpc veryclean >& /dev/null + make -f Makefile.ohpc allohpc >& /dev/null + +} diff --git a/tests/apps/prk/tests/common/CHARM++.defs b/tests/apps/prk/tests/common/CHARM++.defs new file mode 100644 index 0000000000..5ed6fc19fc --- /dev/null +++ b/tests/apps/prk/tests/common/CHARM++.defs @@ -0,0 +1,7 @@ +include ../../common/make.defs +CHARMC=$(CHARMTOP)/bin/charmc +CCOMPILER=$(CHARMC) +CITRANSLATOR=$(CHARMC) -E +CLINKER=$(CCOMPILER) -language charm++ -mt_mpi +COMOBJS= +PROG_ENV=-DCHARM++ diff --git a/tests/apps/prk/tests/common/FG_MPI.defs b/tests/apps/prk/tests/common/FG_MPI.defs new file mode 100644 index 0000000000..5d1337e1bd --- /dev/null +++ b/tests/apps/prk/tests/common/FG_MPI.defs @@ -0,0 +1,6 @@ +include ../../common/make.defs +CCOMPILER=$(FGMPICC) +CLINKER=$(CCOMPILER) +PATH:=$(FGMPITOP)/bin:$(PATH) +COMOBJS=MPI_bail_out.o wtime.o +PROG_ENV=-DFG_MPI diff --git a/tests/apps/prk/tests/common/GRAPPA.defs b/tests/apps/prk/tests/common/GRAPPA.defs new file mode 100644 index 0000000000..e9302be9b0 --- /dev/null +++ b/tests/apps/prk/tests/common/GRAPPA.defs @@ -0,0 +1,5 @@ +include ../../common/make.defs +CCOMPILER=$(CXX) +CLINKER=$(CCOMPILER) +COMOBJS= +PROG_ENV=-DGRAPPA diff --git a/tests/apps/prk/tests/common/MPI.defs b/tests/apps/prk/tests/common/MPI.defs new file mode 100644 index 0000000000..26e5570c82 --- /dev/null +++ b/tests/apps/prk/tests/common/MPI.defs @@ -0,0 +1,5 @@ +include ../../common/make.defs +CCOMPILER=$(MPICC) +CLINKER=$(CCOMPILER) +COMOBJS=MPI_bail_out.o wtime.o +PROG_ENV=-DMPI diff --git a/tests/apps/prk/tests/common/MPIOPENMP.defs b/tests/apps/prk/tests/common/MPIOPENMP.defs new file mode 100644 index 0000000000..fbecc6e6af --- /dev/null +++ b/tests/apps/prk/tests/common/MPIOPENMP.defs @@ -0,0 +1,5 @@ +include ../../common/make.defs +CCOMPILER=$(MPICC) +CLINKER=$(CCOMPILER) +COMOBJS=MPI_bail_out.o wtime.o +PROG_ENV=-DMPI $(OPENMPFLAG) diff --git a/tests/apps/prk/tests/common/MPI_bail_out.c b/tests/apps/prk/tests/common/MPI_bail_out.c new file mode 100644 index 0000000000..fd13acbbc2 --- /dev/null +++ b/tests/apps/prk/tests/common/MPI_bail_out.c @@ -0,0 +1,61 @@ +/* +Copyright (c) 2013, Intel Corporation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. +* Neither the name of Intel Corporation nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +*/ + +/********************************************************************** + +Name: bail_out + +Purpose: Exit gracefully when an MPI process has encountered an error + +Arguments: error code (zero for no error). + +Returns: nothing, but the program terminates with a nonzero exit status + +Notes: This function must be called by all MPI processes in + MPI_COMM_WORLD + +History: Written by Rob Van der Wijngaart, January 2006 + +**********************************************************************/ + +#include +#include + +void bail_out(int error) { + + int error_tot; + MPI_Allreduce(&error, &error_tot, 1, MPI_INT, MPI_MAX, MPI_COMM_WORLD); + if (error_tot != 0) { + MPI_Finalize(); + exit(EXIT_FAILURE); + } +} diff --git a/tests/apps/prk/tests/common/OPENMP.defs b/tests/apps/prk/tests/common/OPENMP.defs new file mode 100644 index 0000000000..c590d86231 --- /dev/null +++ b/tests/apps/prk/tests/common/OPENMP.defs @@ -0,0 +1,5 @@ +include ../../common/make.defs +CCOMPILER =$(CC) +CLINKER = $(CCOMPILER) +COMOBJS = wtime.o OPENMP_bail_out.o +PROG_ENV = $(OPENMPFLAG) diff --git a/tests/apps/prk/tests/common/OPENMP_bail_out.c b/tests/apps/prk/tests/common/OPENMP_bail_out.c new file mode 100644 index 0000000000..06addc753f --- /dev/null +++ b/tests/apps/prk/tests/common/OPENMP_bail_out.c @@ -0,0 +1,29 @@ +/********************************************************************** + +Name: bail_out + +Purpose: Exit gracefully when an OpenMP thread has encountered an error + inside a parallel region + +Arguments: error code (zero for no error). + +Returns: nothing, but the program terminates with a nonzero exit status + +Notes: This function must be called by all threads in the team. Multiple + threads may have tried to update the shared error variable at the + same time, so this needs to be done atomically if we want to + guarantee that the value of 1 is put into error. In our case, + however, we merely want to know if the value is different from + zero, so we do not need atomicity. + +History: Written by Rob Van der Wijngaart, July 2006 + +**********************************************************************/ + +#include + +void bail_out(int error) { + + #pragma omp barrier + if (error != 0) exit(EXIT_FAILURE); +} diff --git a/tests/apps/prk/tests/common/SERIAL.defs b/tests/apps/prk/tests/common/SERIAL.defs new file mode 100644 index 0000000000..ce37ea505d --- /dev/null +++ b/tests/apps/prk/tests/common/SERIAL.defs @@ -0,0 +1,5 @@ +include ../../common/make.defs +CCOMPILER =$(CC) +CLINKER = $(CCOMPILER) +COMOBJS = wtime.o +PROG_ENV = -DSERIAL diff --git a/tests/apps/prk/tests/common/SHMEM.defs b/tests/apps/prk/tests/common/SHMEM.defs new file mode 100644 index 0000000000..7ea00b80f8 --- /dev/null +++ b/tests/apps/prk/tests/common/SHMEM.defs @@ -0,0 +1,5 @@ +include ../../common/make.defs +CCOMPILER=$(SHMEMCC) -I$(SHMEMTOP)/include +CLINKER=$(CCOMPILER) -L$(SHMEMTOP)/lib -lshmem +COMOBJS=wtime.o SHMEM_bail_out.o +PROG_ENV=-DSHMEM diff --git a/tests/apps/prk/tests/common/SHMEM_bail_out.c b/tests/apps/prk/tests/common/SHMEM_bail_out.c new file mode 100644 index 0000000000..efa6d2ad88 --- /dev/null +++ b/tests/apps/prk/tests/common/SHMEM_bail_out.c @@ -0,0 +1,74 @@ +/* +Copyright (c) 2013, Intel Corporation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. +* Neither the name of Intel Corporation nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +*/ + +/******************************************************************* + +NAME: bail_out + +PURPOSE: Exit gracefully when an SHMEM process has encountered an error + +Arguments: error code, work space + +Returns: nothing, but the program terminates with a nonzero exit status + +Notes: This function must be called by all participating processes + +HISTORY: - Written by Gabriele Jost, March 2015. + +**********************************************************************************/ + +#include +#include + +#define shmem_finalize() + +void bail_out (int error, long *pSync) { + long *global_error; + long *local_error; + long pWrk [_SHMEM_BCAST_SYNC_SIZE]; + + int i; + global_error = shmalloc(sizeof(long)); + local_error = shmalloc(sizeof(long)); + if (!global_error || !local_error) { + printf("SHMEM_bail_out could not allocate error space on symmetric heap\n"); + exit(2); + } + local_error [0] = error; + shmem_long_max_to_all (global_error, local_error, 1, 0, 0, _num_pes (), pWrk, pSync); + if (global_error[0] > 0) { + shmem_finalize (); + exit (1); + } + return; +} + diff --git a/tests/apps/prk/tests/common/make.common b/tests/apps/prk/tests/common/make.common new file mode 100644 index 0000000000..fadd6ac2a7 --- /dev/null +++ b/tests/apps/prk/tests/common/make.common @@ -0,0 +1,45 @@ +CFLAGS=$(OPTFLAGS) $(PROG_ENV) +INCLUDEPATHSPLUS=$(INCLUDEPATHS) -I../../include +COMMON=../../common + +usage: + @echo "Usage: type \"make $(PROGRAM)\" to build executable" + @echo " \"make clean\" to remove objects and executables" + + +ifeq ($(PROG_ENV),-DCHARM++) +$(PROGRAM).C: $(PROGRAM).decl.h +endif + +$(PROGRAM):$(OBJS) + $(CLINKER) -o $(PROGRAM) $(LIBPATHS) $(CFLAGS) $(OBJS) $(EXTOBJS) $(LIBS) + + +ifeq ($(PROG_ENV),-DCHARM++) +$(PROGRAM).decl.h: $(PROGRAM).ci + $(CITRANSLATOR) $(PROGRAM).ci +endif + +wtime.o:$(COMMON)/wtime.c + $(CCOMPILER) $(CFLAGS) $(TUNEFLAGS) $(INCLUDEPATHSPLUS) -c $< + +MPI_bail_out.o:$(COMMON)/MPI_bail_out.c + $(CCOMPILER) $(CFLAGS) $(TUNEFLAGS) $(INCLUDEPATHSPLUS) -c $< + +SHMEM_bail_out.o:$(COMMON)/SHMEM_bail_out.c + $(CCOMPILER) $(CFLAGS) $(TUNEFLAGS) $(INCLUDEPATHSPLUS) -c $< + +OPENMP_bail_out.o:$(COMMON)/OPENMP_bail_out.c + $(CCOMPILER) $(CFLAGS) $(TUNEFLAGS) $(INCLUDEPATHSPLUS) -c $< + +.c.o: + $(CCOMPILER) $(CFLAGS) $(TUNEFLAGS) $(INCLUDEPATHSPLUS) -c $< + +.cpp.o: + $(CCOMPILER) $(CFLAGS) $(TUNEFLAGS) $(INCLUDEPATHSPLUS) -c $< + +.C.o: $(CHARMDEP) + $(CCOMPILER) $(CFLAGS) $(TUNEFLAGS) $(INCLUDEPATHSPLUS) -c $< + +clean: + rm -f $(OBJS) $(PROGRAM) *.optrpt *~ charmrun $(PROGRAM).decl.h $(PROGRAM).def.h diff --git a/tests/apps/prk/tests/common/make.defs b/tests/apps/prk/tests/common/make.defs new file mode 100644 index 0000000000..8d742902ab --- /dev/null +++ b/tests/apps/prk/tests/common/make.defs @@ -0,0 +1,38 @@ +#name of MPI C compiler, e.g. mpiicc, mpicc +MPICC=mpicc + +#name of C compiler, e.g. icc, xlc, gcc +CC=mpicc + +#name of compile line flag enabling OpenMP, e.g. -qopenmp, -openmp, -fopenmp +ifeq ($(LMOD_FAMILY_COMPILER),gnu) + OPENMPFLAG=-fopenmp +else + OPENMPFLAG=-openmp +endif + +#default compiler optimization flags +DEFAULT_OPT_FLAGS=-O3 + +############################ OPTIONAL ######################### + +#name of C++ compiler (to be used in MPI context for Grappa), e.g. mpigxx, mpiicpc +CXX=mpicxx + +#name of MPI C compiler (to be used in Fine-Grain MPI context), e.g. mpicc +FGMPICC=mpicc + +#location where SHMEM is installed, e.g. $(HOME)/oshmpi-install +SHMEMTOP= + +#name of C compiler (to be used in MPI context of OpenSHMEM), e.g. $(MPICC) +SHMEMCC=mpicc + +#location where Charm++ is installed, e.g. $(HOME)/charm/mpi-linux-x86_64-ifort-smp-mpicxx +CHARMTOP= + +#location where Grappa is installed, e.g. $(HOME)/grappa +GRAPPATOP= + +#location where Fine-Grain MPI is installed, e.g. $(HOME)/fgmpi-install +FGMPITOP= diff --git a/tests/apps/prk/tests/common/wtime.c b/tests/apps/prk/tests/common/wtime.c new file mode 100644 index 0000000000..8ee6cb4773 --- /dev/null +++ b/tests/apps/prk/tests/common/wtime.c @@ -0,0 +1,91 @@ +/* +Copyright (c) 2013, Intel Corporation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. +* Neither the name of Intel Corporation nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +*/ + +/**************************************************************** + +Name: wtime + +Purpose: returns wall clock time with a fixed reference point. + +Arguments: None + +Returns: The wall clock time in seconds as a double is returned. + +Notes: This function uses two structures defined in the UNIX + system call, gettimeofday(2). The structure, "timeval" + is defined in the include file as: + + struct timeval { + long tv_sec; + long tv_usec; + } + + where timeval.tv_sec is the seconds and timeval.tv_usec + is the microseconds. + +History: Written by Tim Mattson, Dec 1, 1988 + Modified by Rob van der Wijngaart, May 2006, to change + default clock to the Unix system clock. + +****************************************************************/ + +#include +#if defined(_OPENMP) + #include +#elif defined(MPI) + #include "mpi.h" +#else + #include + #define USEC_TO_SEC 1.0e-6 /* to convert microsecs to secs */ +#endif + + +double wtime() { + double time_seconds; + +#if defined(_OPENMP) + time_seconds = omp_get_wtime(); + +#elif defined(MPI) + time_seconds = MPI_Wtime(); + +#else + struct timeval time_data; /* seconds since 0 GMT */ + + gettimeofday(&time_data,NULL); + + time_seconds = (double) time_data.tv_sec; + time_seconds += (double) time_data.tv_usec * USEC_TO_SEC; +#endif + + return time_seconds; +} diff --git a/tests/apps/prk/tests/doc/par-res-kern-report-v1.0.pdf b/tests/apps/prk/tests/doc/par-res-kern-report-v1.0.pdf new file mode 100755 index 0000000000..33b0fe290e Binary files /dev/null and b/tests/apps/prk/tests/doc/par-res-kern-report-v1.0.pdf differ diff --git a/tests/apps/prk/tests/include/par-res-kern_fg-mpi.h b/tests/apps/prk/tests/include/par-res-kern_fg-mpi.h new file mode 100644 index 0000000000..f1c522ec51 --- /dev/null +++ b/tests/apps/prk/tests/include/par-res-kern_fg-mpi.h @@ -0,0 +1,51 @@ +/* +Copyright (c) 2013, Intel Corporation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Intel Corporation nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +*/ + +/******* FG-MPI Boilerplate begin *********/ +#include "fgmpi.h" +int mymain(int argc, char** argv ); /*forward declaration*/ +FG_ProcessPtr_t binding_func(int argc, char** argv, int rank){ + return (&mymain); +} +FG_MapPtr_t map_lookup(int argc, char** argv, char* str){ + return (&binding_func); +} +int main( int argc, char *argv[] ) +{ + FGmpiexec(&argc, &argv, &map_lookup); + return (0); +} +/******* FG-MPI Boilerplate end *********/ + +#include +#define main mymain +extern void bail_out(int); diff --git a/tests/apps/prk/tests/include/par-res-kern_general.h b/tests/apps/prk/tests/include/par-res-kern_general.h new file mode 100755 index 0000000000..2bbaa4047f --- /dev/null +++ b/tests/apps/prk/tests/include/par-res-kern_general.h @@ -0,0 +1,68 @@ +/* +Copyright (c) 2013, Intel Corporation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Intel Corporation nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +*/ + +#include +#include +#include +#include +#include + +#ifndef MIN +#define MIN(x,y) ((x)<(y)?(x):(y)) +#endif +#ifndef MAX +#define MAX(x,y) ((x)>(y)?(x):(y)) +#endif +#ifndef ABS +#define ABS(a) ((a) >= 0 ? (a) : -(a)) +#endif + +#ifdef RESTRICT_KEYWORD + #define RESTRICT restrict +#else + #define RESTRICT +#endif + +/* Define 64-bit types and corresponding format strings for printf() */ +#ifdef LONG_IS_64BITS + typedef unsigned long u64Int; + typedef long s64Int; + #define FSTR64 "%16ld" + #define FSTR64U "%16lu" +#else + typedef unsigned long long u64Int; + typedef long long s64Int; + #define FSTR64 "%16ll" + #define FSTR64U "%16llu" +#endif + +extern double wtime(void); diff --git a/tests/apps/prk/tests/include/par-res-kern_mpi.h b/tests/apps/prk/tests/include/par-res-kern_mpi.h new file mode 100755 index 0000000000..a1fe14c3e1 --- /dev/null +++ b/tests/apps/prk/tests/include/par-res-kern_mpi.h @@ -0,0 +1,35 @@ +/* +Copyright (c) 2013, Intel Corporation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Intel Corporation nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +*/ + +#include + +extern void bail_out(int); diff --git a/tests/apps/prk/tests/include/par-res-kern_mpiomp.h b/tests/apps/prk/tests/include/par-res-kern_mpiomp.h new file mode 100644 index 0000000000..2111a65503 --- /dev/null +++ b/tests/apps/prk/tests/include/par-res-kern_mpiomp.h @@ -0,0 +1,41 @@ +/* +Copyright (c) 2013, Intel Corporation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Intel Corporation nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +*/ + +#include +#include +#ifndef MAXTHREADS + #define MAX_THREADS 256 +#else + #define MAX_THREADS MAXTHREADS +#endif + +extern void bail_out(int); diff --git a/tests/apps/prk/tests/include/par-res-kern_omp.h b/tests/apps/prk/tests/include/par-res-kern_omp.h new file mode 100755 index 0000000000..d1f483935f --- /dev/null +++ b/tests/apps/prk/tests/include/par-res-kern_omp.h @@ -0,0 +1,40 @@ +/* +Copyright (c) 2013, Intel Corporation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Intel Corporation nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +*/ + +#include +#ifndef MAXTHREADS + #define MAX_THREADS 256 +#else + #define MAX_THREADS MAXTHREADS +#endif + +extern void bail_out(int); diff --git a/tests/apps/prk/tests/include/par-res-kern_shmem.h b/tests/apps/prk/tests/include/par-res-kern_shmem.h new file mode 100644 index 0000000000..414c3585f4 --- /dev/null +++ b/tests/apps/prk/tests/include/par-res-kern_shmem.h @@ -0,0 +1,35 @@ +/* +Copyright (c) 2013, Intel Corporation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Intel Corporation nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +*/ + +#include + +extern void bail_out(int, long *); diff --git a/tests/apps/prk/tests/rm_execution_mpi b/tests/apps/prk/tests/rm_execution_mpi new file mode 100755 index 0000000000..a5104f30f0 --- /dev/null +++ b/tests/apps/prk/tests/rm_execution_mpi @@ -0,0 +1,82 @@ +#!../../../common/bats/bin/bats +# -*-sh-*- + +load ../../../common/test_helper_functions || exit 1 +source ../../../common/functions || exit 1 + +if [ -s ./TEST_ENV ];then + . ./TEST_ENV +else + ERROR "TEST_ENV does not exist" +fi + +app="App/PRK" +mode=MPI +rm=$RESOURCE_MANAGER +NUMITERS=$TEST_NUM_ITERS +NODES=$((NUM_COMPUTES < TEST_MAX_COMPUTES ? NUM_COMPUTES : TEST_MAX_COMPUTES)) +TASKS=$((NODES * TEST_NUM_RANKS)) + +@test "[$app] $mode/Branch run under resource manager ($rm/$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + exe="$mode/Branch/branch" + for type in vector_go vector_stop no_vector ins_heavy; do + run_mpi_binary -t $CMD_TIMEOUT $exe "$NUMITERS 1000 $type" $NODES $TASKS + assert_success + done +} + +@test "[$app] $mode/DGEMM run under resource manager ($rm/$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + exe="$mode/DGEMM/dgemm" + run_mpi_binary -t $CMD_TIMEOUT $exe "$NUMITERS 500 32 1" $NODES $TASKS + assert_success +} + +@test "[$app] $mode/Nstream run under resource manager ($rm/$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + exe="$mode/Nstream/nstream" + run_mpi_binary -t $CMD_TIMEOUT $exe "$NUMITERS 2000000 0" $NODES $TASKS + assert_success +} + +@test "[$app] $mode/Random run under resource manager ($rm/$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + exe="$mode/Random/random" + run_mpi_binary -t $CMD_TIMEOUT $exe "20 16" $NODES $TASKS + assert_success +} + +# temporary workaround pending investigation on mvapich2 issue related to IB registration cache: +# vector_length reduced from 2000k to 200k +@test "[$app] $mode/Reduce run under resource manager ($rm/$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + exe="$mode/Reduce/reduce" + run_mpi_binary -t $CMD_TIMEOUT $exe "$NUMITERS 200000" $NODES $TASKS + assert_success +} + +@test "[$app] $mode/Sparse run under resource manager ($rm/$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + exe="$mode/Sparse/sparse" + run_mpi_binary -t $CMD_TIMEOUT $exe "$NUMITERS 10 4" $NODES $TASKS + assert_success +} + +@test "[$app] $mode/Stencil run under resource manager ($rm/$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + exe="$mode/Stencil/stencil" + run_mpi_binary -t $CMD_TIMEOUT $exe "$NUMITERS 1000" $NODES $TASKS + assert_success +} + +@test "[$app] $mode/Synch_global run under resource manager ($rm/$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + exe="$mode/Synch_global/global" + run_mpi_binary -t $CMD_TIMEOUT $exe "$NUMITERS 1000" $NODES $TASKS + assert_success +} + +@test "[$app] $mode/Synch_p2p run under resource manager ($rm/$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + exe="$mode/Synch_p2p/p2p" + run_mpi_binary -t $CMD_TIMEOUT $exe "$NUMITERS 1000 100" $NODES $TASKS + assert_success +} + +@test "[$app] $mode/Transpose run under resource manager ($rm/$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + exe="$mode/Transpose/transpose" + run_mpi_binary -t $CMD_TIMEOUT $exe "$NUMITERS 2000 64" $NODES $TASKS + assert_success +} diff --git a/tests/apps/prk/tests/rm_execution_mpiopenmp b/tests/apps/prk/tests/rm_execution_mpiopenmp new file mode 100755 index 0000000000..3b0bb6dfdf --- /dev/null +++ b/tests/apps/prk/tests/rm_execution_mpiopenmp @@ -0,0 +1,44 @@ +#!../../../common/bats/bin/bats +# -*-sh-*- + +load ../../../common/test_helper_functions || exit 1 +source ../../../common/functions || exit 1 + +if [ -s ./TEST_ENV ];then + . ./TEST_ENV +else + ERROR "TEST_ENV does not exist" +fi + +app="App/PRK" +mode=MPIOPENMP +rm=$RESOURCE_MANAGER +NUMITERS=$TEST_NUM_ITERS +NUMTHREADS=$TEST_NUM_THREADS +NODES=$((NUM_COMPUTES < TEST_MAX_COMPUTES ? NUM_COMPUTES : TEST_MAX_COMPUTES)) +TASKS=$((NODES * TEST_NUM_RANKS)) + +@test "[$app] $mode/Nstream run under resource manager ($rm/$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + exe="$mode/Nstream/nstream" + run_mpi_binary -t $CMD_TIMEOUT $exe "$NUMTHREADS $NUMITERS 2000000 0" $NODES $TASKS + assert_success +} + +@test "[$app] $mode/Stencil run under resource manager ($rm/$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + exe="$mode/Stencil/stencil" + run_mpi_binary -t $CMD_TIMEOUT $exe "$NUMTHREADS $NUMITERS 1000" $NODES $TASKS + assert_success +} + +@test "[$app] $mode/Transpose run under resource manager ($rm/$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + exe="$mode/Transpose/transpose" + run_mpi_binary -t $CMD_TIMEOUT $exe "$NUMTHREADS $NUMITERS 2000 64" $NODES $TASKS + assert_success +} + +# disabled - test needs "--enable-mpi-thread-multiple" in openmpi & mvapich2 +#@test "[$app] $mode/Synch_p2p run under resource manager ($rm/$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { +# exe="$mode/Synch_p2p/p2p" +# run_mpi_binary -t $CMD_TIMEOUT $exe "$NUMTHREADS $NUMITERS 1000 100" $NODES $TASKS +# assert_success +#} diff --git a/tests/apps/prk/tests/rm_execution_mpirma b/tests/apps/prk/tests/rm_execution_mpirma new file mode 100755 index 0000000000..39c3ab882e --- /dev/null +++ b/tests/apps/prk/tests/rm_execution_mpirma @@ -0,0 +1,31 @@ +#!../../../common/bats/bin/bats +# -*-sh-*- + +load ../../../common/test_helper_functions || exit 1 +source ../../../common/functions || exit 1 + +if [ -s ./TEST_ENV ];then + . ./TEST_ENV +else + ERROR "TEST_ENV does not exist" +fi + +app="App/PRK" +mode=MPIRMA +rm=$RESOURCE_MANAGER +NUMITERS=$TEST_NUM_ITERS +NODES=$((NUM_COMPUTES < TEST_MAX_COMPUTES ? NUM_COMPUTES : TEST_MAX_COMPUTES)) +TASKS=$((NODES * TEST_NUM_RANKS)) + +@test "[$app] $mode/Stencil run under resource manager ($rm/$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + exe="$mode/Stencil/stencil" + run_mpi_binary -t $CMD_TIMEOUT $exe "$NUMITERS 1000" $NODES $TASKS + assert_success +} + +# disabled pending investigation - test hang (impi, 1 node, 2 ranks/node, 4 threads) +#@test "[$app] $mode/Synch_p2p run under resource manager ($rm/$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { +# exe="$mode/Synch_p2p/p2p" +# run_mpi_binary -t $CMD_TIMEOUT $exe "$NUMITERS 1000 100" $NODES $TASKS +# assert_success +#} diff --git a/tests/apps/prk/tests/rm_execution_mpishm b/tests/apps/prk/tests/rm_execution_mpishm new file mode 100755 index 0000000000..83708ef666 --- /dev/null +++ b/tests/apps/prk/tests/rm_execution_mpishm @@ -0,0 +1,37 @@ +#!../../../common/bats/bin/bats +# -*-sh-*- + +load ../../../common/test_helper_functions || exit 1 +source ../../../common/functions || exit 1 + +if [ -s ./TEST_ENV ];then + . ./TEST_ENV +else + ERROR "TEST_ENV does not exist" +fi + +app="App/PRK" +mode=MPISHM +rm=$RESOURCE_MANAGER +NUMITERS=$TEST_NUM_ITERS +NUMSUBPROCS=2 +NODES=$((NUM_COMPUTES < TEST_MAX_COMPUTES ? NUM_COMPUTES : TEST_MAX_COMPUTES)) +TASKS=$((NODES * TEST_NUM_RANKS)) + +@test "[$app] $mode/Stencil run under resource manager ($rm/$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + exe="$mode/Stencil/stencil" + run_mpi_binary -t $CMD_TIMEOUT $exe "$NUMSUBPROCS $NUMITERS 1000" $NODES $TASKS + assert_success +} + +@test "[$app] $mode/Synch_p2p run under resource manager ($rm/$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + exe="$mode/Synch_p2p/p2p" + run_mpi_binary -t $CMD_TIMEOUT $exe "$NUMITERS 1000 100" $NODES $TASKS + assert_success +} + +@test "[$app] $mode/Transpose run under resource manager ($rm/$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + exe="$mode/Transpose/transpose" + run_mpi_binary -t $CMD_TIMEOUT $exe "$NUMSUBPROCS $NUMITERS 1000 64" $NODES $TASKS + assert_success +} diff --git a/tests/apps/prk/tests/rm_execution_openmp b/tests/apps/prk/tests/rm_execution_openmp new file mode 100755 index 0000000000..2922be4f59 --- /dev/null +++ b/tests/apps/prk/tests/rm_execution_openmp @@ -0,0 +1,93 @@ +#!../../../common/bats/bin/bats +# -*-sh-*- + +load ../../../common/test_helper_functions || exit 1 +source ../../../common/functions || exit 1 + +if [ -s ./TEST_ENV ];then + . ./TEST_ENV +else + ERROR "TEST_ENV does not exist" +fi + +app="App/PRK" +mode=OPENMP +rm=$RESOURCE_MANAGER +NUMITERS=$TEST_NUM_ITERS +NUMTHREADS=$TEST_NUM_THREADS + +@test "[$app] $mode/Branch run under resource manager ($rm/$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + exe="$mode/Branch/branch" + for type in vector_go vector_stop no_vector ins_heavy; do + run_serial_binary -t $CMD_TIMEOUT $exe $NUMTHREADS $NUMITERS 1000 $type + assert_success + done +} + +@test "[$app] $mode/DGEMM run under resource manager ($rm/$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + exe="$mode/DGEMM/dgemm" + run_serial_binary -t $CMD_TIMEOUT $exe $NUMTHREADS $NUMITERS 500 32 + assert_success +} + +@test "[$app] $mode/Nstream run under resource manager ($rm/$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + exe="$mode/Nstream/nstream" + run_serial_binary -t $CMD_TIMEOUT $exe $NUMTHREADS $NUMITERS 2000000 0 + assert_success +} + +@test "[$app] $mode/Random run under resource manager ($rm/$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + exe="$mode/Random/random" + run_serial_binary -t $CMD_TIMEOUT $exe $NUMTHREADS 20 16 4 + assert_success +} + +@test "[$app] $mode/Reduce run under resource manager ($rm/$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + exe="$mode/Reduce/reduce" + for ALGORITHM in linear binary-barrier binary-p2p long-optimal; do + run_serial_binary -t $CMD_TIMEOUT $exe $NUMTHREADS $NUMITERS 2000000 $ALGORITHM + assert_success + done +} + +@test "[$app] $mode/RefCount_shared run under resource manager ($rm/$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + exe="$mode/RefCount_shared/shared" + run_serial_binary -t $CMD_TIMEOUT $exe $NUMTHREADS 2000000 + assert_success +} + +@test "[$app] $mode/RefCount_private run under resource manager ($rm/$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + exe="$mode/RefCount_private/private" + run_serial_binary -t $CMD_TIMEOUT $exe $NUMTHREADS 2000000 + assert_success +} + +@test "[$app] $mode/Sparse run under resource manager ($rm/$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + exe="$mode/Sparse/sparse" + run_serial_binary -t $CMD_TIMEOUT $exe $NUMTHREADS $NUMITERS 10 4 + assert_success +} + +@test "[$app] $mode/Stencil run under resource manager ($rm/$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + exe="$mode/Stencil/stencil" + run_serial_binary -t $CMD_TIMEOUT $exe $NUMTHREADS $NUMITERS 1000 + assert_success +} + +@test "[$app] $mode/Synch_global run under resource manager ($rm/$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + exe="$mode/Synch_global/global" + run_serial_binary -t $CMD_TIMEOUT $exe $NUMTHREADS $NUMITERS 1000 + assert_success +} + +@test "[$app] $mode/Synch_p2p run under resource manager ($rm/$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + exe="$mode/Synch_p2p/p2p" + run_serial_binary -t $CMD_TIMEOUT $exe $NUMTHREADS $NUMITERS 1000 100 + assert_success +} + +@test "[$app] $mode/Transpose run under resource manager ($rm/$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + exe="$mode/Transpose/transpose" + run_serial_binary -t $CMD_TIMEOUT $exe $NUMTHREADS $NUMITERS 2000 64 + assert_success +} diff --git a/tests/apps/prk/tests/rm_execution_serial b/tests/apps/prk/tests/rm_execution_serial new file mode 100755 index 0000000000..668c99750b --- /dev/null +++ b/tests/apps/prk/tests/rm_execution_serial @@ -0,0 +1,72 @@ +#!../../../common/bats/bin/bats +# -*-sh-*- + +load ../../../common/test_helper_functions || exit 1 +source ../../../common/functions || exit 1 + +if [ -s ./TEST_ENV ];then + . ./TEST_ENV +else + ERROR "TEST_ENV does not exist" +fi + +app="App/PRK" +mode=SERIAL +rm=$RESOURCE_MANAGER +NUMITERS=$TEST_NUM_ITERS + +@test "[$app] $mode/Branch run under resource manager ($rm/$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + exe="$mode/Branch/branch" + for type in vector_go vector_stop no_vector ins_heavy; do + run_serial_binary -t $CMD_TIMEOUT $exe $NUMITERS 1000 $type + assert_success + done +} + +@test "[$app] $mode/DGEMM run under resource manager ($rm/$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + exe="$mode/DGEMM/dgemm" + run_serial_binary -t $CMD_TIMEOUT $exe $NUMITERS 500 32 + assert_success +} + +@test "[$app] $mode/Nstream run under resource manager ($rm/$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + exe="$mode/Nstream/nstream" + run_serial_binary -t $CMD_TIMEOUT $exe $NUMITERS 2000000 0 + assert_success +} + +@test "[$app] $mode/Random run under resource manager ($rm/$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + exe="$mode/Random/random" + run_serial_binary -t $CMD_TIMEOUT $exe 20 16 4 + assert_success +} + +@test "[$app] $mode/Reduce run under resource manager ($rm/$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + exe="$mode/Reduce/reduce" + run_serial_binary -t $CMD_TIMEOUT $exe $NUMITERS 2000000 + assert_success +} + +@test "[$app] $mode/Sparse run under resource manager ($rm/$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + exe="$mode/Sparse/sparse" + run_serial_binary -t $CMD_TIMEOUT $exe $NUMITERS 10 4 + assert_success +} + +@test "[$app] $mode/Stencil run under resource manager ($rm/$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + exe="$mode/Stencil/stencil" + run_serial_binary -t $CMD_TIMEOUT $exe $NUMITERS 1000 + assert_success +} + +@test "[$app] $mode/Synch_p2p run under resource manager ($rm/$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + exe="$mode/Synch_p2p/p2p" + run_serial_binary -t $CMD_TIMEOUT $exe $NUMITERS 1000 100 + assert_success +} + +@test "[$app] $mode/Transpose run under resource manager ($rm/$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + exe="$mode/Transpose/transpose" + run_serial_binary -t $CMD_TIMEOUT $exe $NUMITERS 2000 64 + assert_success +} diff --git a/tests/bootstrap b/tests/bootstrap new file mode 100755 index 0000000000..9a5ec37dab --- /dev/null +++ b/tests/bootstrap @@ -0,0 +1,9 @@ +#! /bin/sh +# -------------------------------------------------------------------------- +# bootstrapping utility for autotools -> now just uses autoreconf +# -------------------------------------------------------------------------- + +cmd="autoreconf -f -i -Wno-portability" +echo "Bootstrapping using $cmd ..." + +$cmd diff --git a/tests/bos/Makefile.am b/tests/bos/Makefile.am new file mode 100644 index 0000000000..39e600faed --- /dev/null +++ b/tests/bos/Makefile.am @@ -0,0 +1,8 @@ +TESTS_ENVIRONMENT = BATS_NO_SUMMARY=1 + +TESTS = init.sh +TESTS += ibv_devinfo +TESTS += os_distribution +TESTS += computes + +CLEANFILES=$(wildcard *.xml) diff --git a/tests/bos/computes b/tests/bos/computes new file mode 100755 index 0000000000..83638b9295 --- /dev/null +++ b/tests/bos/computes @@ -0,0 +1,75 @@ +#!../common/bats/bin/bats +# -*-sh-*- + +load ../common/test_helper_functions +source ../common/functions || exit 1 + +if [ -s ../TEST_ENV ];then + source ../TEST_ENV +fi + +# Test how many computes we have available presently + +which koomie_cf >& /dev/null +if [ $? -ne 0 ]; then + ERROR "koomie_cf executable not found - please verify losf is installed." +fi + +num_computes=`koomie_cf -x "c[0-9]+\b" uptime | grep "load average" | wc -l` +if [ "$num_computes" -lt 0 ];then + ERROR "Test requries at least 1 available compute node" +fi + +@test "[BOS] OS distribution matches $BOS_RELEASE ($num_computes active computes) " { + + koomie_cf -x "c[0-9]+\b" ls -l /etc/$BOS_RELEASE | awk '{print $10}' >& .cmd_output || exit 1 + local num_matches=`grep $BOS_RELEASE .cmd_output | wc -l` || exit 1 + + if [ "$num_matches" -ne "$num_computes" ];then + flunk + fi +} + +@test "[BOS] consistent kernel ($num_computes active computes) " { + + koomie_cf -x "c[0-9]+\b" ls -l /etc/$BOS_RELEASE | awk '{print $10}' >& .cmd_output || exit 1 + + local count=0 + for kernel in `cat .cmd_output | awk '{print $2}'`; do + count=$((count+1)) + if [ $count -eq 1 ];then + kernel_match=$kernel + fi + + if [ "$kernel" != "$kernel_match" ];then + flunk + fi + done + + rm -f .cmd_output +} + +@test "[BOS] increased locked memory limits " { + + koomie_cf -x "c[0-9]+\b" prlimit -l -o SOFT | grep -v SOFT >& .cmd_output || exit 1 + + for limit in `cat .cmd_output | awk '{print $2}'`; do + if [ "$limit" != "unlimited" ];then + flunk + fi + done + + rm -f .cmd_output + + koomie_cf -x "c[0-9]+\b" prlimit -l -o HARD | grep -v HARD >& .cmd_output || exit 1 + + for limit in `cat .cmd_output | awk '{print $2}'`; do + if [ "$limit" != "unlimited" ];then + flunk + fi + done + + rm -f .cmd_output + +} + diff --git a/tests/bos/ibv_devinfo b/tests/bos/ibv_devinfo new file mode 100755 index 0000000000..d9caa8a995 --- /dev/null +++ b/tests/bos/ibv_devinfo @@ -0,0 +1,36 @@ +#!../common/bats/bin/bats +# -*-sh-*- + +load ../common/test_helper_functions +source ../common/functions || exit 1 + +if [ -s ../TEST_ENV ];then + source ../TEST_ENV +fi + +which koomie_cf >& /dev/null +if [ $? -ne 0 ]; then + ERROR "koomie_cf executable not found - please verify losf is installed." +fi + +@test "[BOS] master ibv_devinfo exists" { + run which ibv_devinfo + assert_success +} + +@test "[BOS] master IB HCA port active" { + status=`ibv_devinfo | grep state | awk '{print $2}'` + assert_equal "$status" "PORT_ACTIVE" +} + +@test "[BOS] compute IB HCA ports active" { + koomie_cf -x "c[0-9]+\b" ibv_devinfo | grep state >& .cmd_output || exit 1 + for status in `cat .cmd_output | awk '{print $3}'`; do + if [ "$status" != "PORT_ACTIVE" ];then + flunk + fi + done + + rm -f .cmd_output + +} diff --git a/tests/bos/init.sh b/tests/bos/init.sh new file mode 100755 index 0000000000..a1e3e2acf4 --- /dev/null +++ b/tests/bos/init.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +echo " " +echo " " +echo "-------------------------------------------------------" +echo "Base OS Environment" +echo "-------------------------------------------------------" \ No newline at end of file diff --git a/tests/bos/os_distribution b/tests/bos/os_distribution new file mode 100755 index 0000000000..6e42c91908 --- /dev/null +++ b/tests/bos/os_distribution @@ -0,0 +1,15 @@ +#!../common/bats/bin/bats +# -*-sh-*- + +load ../common/test_helper_functions +source ../common/functions || exit 1 + +if [ -s ../TEST_ENV ];then + source ../TEST_ENV +fi + +@test "[BOS] OS distribution matches $BOS_RELEASE (local) " { + if [ ! -e /etc/$BOS_RELEASE ];then + flunk "Unexpected OS distribution detected - looking for $BOS_RELEASE" + fi +} diff --git a/tests/clck/Makefile.am b/tests/clck/Makefile.am new file mode 100644 index 0000000000..04d32e09f0 --- /dev/null +++ b/tests/clck/Makefile.am @@ -0,0 +1,5 @@ +TESTS_ENVIRONMENT = BATS_NO_SUMMARY=1 + +TESTS = init.sh +TESTS += clck_tests + diff --git a/tests/clck/clck_tests b/tests/clck/clck_tests new file mode 100755 index 0000000000..1f004876a7 --- /dev/null +++ b/tests/clck/clck_tests @@ -0,0 +1,124 @@ +#!../common/bats/bin/bats +# -*-sh-*- + +load ../common/test_helper_functions || exit 1 + +if [ -s ../TEST_ENV ];then + source ../TEST_ENV +fi + +testname=CLCK +PKG=CLCK +module=clck +rpm=intel-clck${DELIM} + +setup() { + if [ -z "$MODULEPATH" ];then + . /etc/profile.d/lmod.sh || exit 1 + fi + module purge || exit 1 + module load $module || exit 1 +} + +@test "[$testname] Verify $PKG module is loaded and matches rpm version" { + + run test -n "$CLCK_ROOT" + assert_success + + run which clck + assert_success + + # query module version + module list $module | grep "1) $module" >& .cmd_output || exit 1 + run grep $module .cmd_output + assert_success + + # check version against rpm + local version="$(rpm -q --queryformat='%{VERSION}\n' $rpm)" + run cat .cmd_output + assert_output " 1) $module/$version" + + # check version against binary + + clck --version | head -1 | awk '{print $4}' >& .cmd_output || exit 1 + run cat .cmd_output + assert_output "$version" + +} + +@test "[CLCK] create clck nodelist" { + echo `hostname -s`" # role: head" > clck.nodelist +# echo "localhost # role: head" > clck.nodelist + koomie_cf -x "c[0-9]+\b" uptime | grep average | awk '{print $1}' >> clck.nodelist + num_hosts=`wc -l clck.nodelist | awk '{print $1}'` + if [ "$num_hosts" -lt 2 ];then + ERROR_RETURN "Test requires at least 2 hosts" + fi +} + +@test "[CLCK] verify environment consistent on valid cluster nodes" { + run rm -f /root/.clck/*/clck.db + run clck-collect -s environment -f clck.nodelist + run clck-analyze -I environment -f clck.nodelist + assert_success +} + +@test "[CLCK] verify error detected when invalid nodename prescribed" { + run cp -p clck.nodelist clck.nodelist.invalid + assert_success + + echo "bad-nodename" >> clck.nodelist.invalid + run clck-collect -m printenv -f clck.nodelist.invalid + run clck-analyze -I environment -f clck.nodelist.invalid + assert_failure +} + +@test "[CLCK] verify rpms consistent" { + + run clck-analyze -I rpm -f clck.nodelist + assert_failure + + run clck-collect -s rpm -f clck.nodelist + run clck-analyze -I rpm -f clck.nodelist + + assert_success +} + +@test "[CLCK] verify ethernet driver uniformity" { + + run clck-analyze -I ethernet -f clck.nodelist + assert_failure + + run clck-collect -s ethernet -f clck.nodelist + run clck-analyze -I ethernet -f clck.nodelist + + assert_success +} + +@test "[CLCK] verify cpu" { + + run clck-analyze -I cpu -f clck.nodelist + assert_failure + + run clck-collect -s cpu -f clck.nodelist + run clck-analyze -I cpu -f clck.nodelist + + assert_success +} + +@test "[CLCK] verify ntp clock synchronization" { + skip + run clck-analyze -I ntp -f clck.nodelist + assert_failure + + run clck-collect -s ntp -f clck.nodelist + run clck-analyze -I ntp -f clck.nodelist + + assert_success +} + + + + + + diff --git a/tests/clck/init.sh b/tests/clck/init.sh new file mode 100755 index 0000000000..9770f180f3 --- /dev/null +++ b/tests/clck/init.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +echo " " +echo " " +echo "-------------------------------------------------------" +echo "System Environment: Intel Cluster Checker" +echo "-------------------------------------------------------" diff --git a/tests/common/TEST_ENV b/tests/common/TEST_ENV new file mode 100644 index 0000000000..ff313f96d8 --- /dev/null +++ b/tests/common/TEST_ENV @@ -0,0 +1,38 @@ +DELIM="-ohpc" +CMD_TIMEOUT="20s" +RESOURCE_MANAGER=slurm +COMPILER_FAMILIES="gnu intel" +MPI_FAMILIES="mvapich2 openmpi impi" +BOS_RELEASE=SuSE-release +LUSTRE_TEST_PATH="/mnt/lustre/jenkins" +NUM_COMPUTES=4 +export INTEL_LICENSE_FILE=/opt/intel/licenses/intel.lic +export BATS_USE_MKTEMP=1 +# +#------------------------ +# TAU profiling options +#------------------------ +# +TAU_TRACE=0, +TAU_CALLPATH=0, +TAU_PROFILE=1, +TAU_METRICS=GET_TIME_OF_DAY:PAPI_L1_DCM:PAPI_LD_INS + +# +#------------------------ +# Performance thresholds +#------------------------ +# +if [ "x$CI_CLUSTER" == "xhera" ];then + OHPC_HSN_MIN_BANDWIDTH=3000 + OHPC_HSN_MAX_LATENCY=6.0 +else + OHPC_HSN_MIN_BANDWIDTH=4500 + OHPC_HSN_MAX_LATENCY=3.0 +fi + +OHPC_STREAM_BW_master=65000 +OHPC_STREAM_BW_compute=65000 +OHPC_DGEMM_GFLOPS_master=340 +OHPC_DGEMM_GFLOPS_compute=340 + diff --git a/tests/common/XML/Changes b/tests/common/XML/Changes new file mode 100644 index 0000000000..3d261fae03 --- /dev/null +++ b/tests/common/XML/Changes @@ -0,0 +1,159 @@ +Revision history for Perl extension XML::Generator. + +1.04 Fri Jul 15 08:35:00 2011 + - Added the filter_invalid_chars option, which is turned on by default + under strict mode. + +1.03 Thu Jul 30 17:02:00 2009 + - Version bump because somebody released an unauthorized + XML-Generator-1.02 + +1.01 Tue Jul 8 11:45:00 2007 + - Documentation cleanup. + +1.0 Fri Jun 22 16:51:00 2007 + - Fixed bug #23594, "Embedded escaping does not work as expected", + reported by M. Zizka; clarified documentation and added 'even-entities' + argument to 'escape' parameter. + - As part of above fix, supplying an unexpected true argument to 'escape' + parameter results in warning. + - Fixed bug #18609, "cdata also pretty-printed", reported by Daniel Schroeer. + - Fixed bug #18656, reported by Peter (Stig) Edwards; just removed single + quotes around Tie::IxHash in require line. + +0.99_02 Tue Oct 19 23:02:00 2004 + - Fixed mistake in RDF example. + +0.99_01 Tue Oct 19 22:58:00 2004 + - Changed default behavior of 'use XML::Generator' to not attempt to export + AUTOLOAD. Removed ':noimport' option. + - Allowed more than two components in a namespace, to allow explicit xmlns: + attributes to be output on demand. Introduced '#default' token. + - Improved output aesthetics when there are lot of attributes and the generator + was configured with the 'pretty' option. + - Added allowedXMLTags (alias to allowed_xml_tags) and qualified_attributes + (alias to qualifiedAttributes) to rationalize interface. + +0.99 Tue Mar 23 11:17:00 2004 + - Removed automatic prefixing of attribute names when using a namespace. + - Added 'qualifiedAttributes' constructor option to emulate prior attribute + prefixing behavior. + - Always syntax check attribute names under strict conformance. + - Add documentation on using Tie::IxHash to get predictable attribute ordering. + - Allow tag 'AUTOLOAD'. + - Fixed bug with default namespace. + - More tests + +0.98 Mon Mar 1 18:26:00 2004 + - Fixed bug in DOM.t when XML::DOM not installed (caused by fix in 0.97) + +0.97 Mon Mar 1 15:22:00 2004 + - Fixed bugs in DOM.t reported by David Wheeler. + +0.96 Sun Feb 29 23:00:00 2004 + - More documentation fixups. + - Only check for xml() subs under strict conformance. + - Small performance optimizations. + +0.95 Sun Feb 29 22:21:00 2004 + - Enhanced STACKED AUTOLOAD feature to provide a default import() + - Documentation fixups. + +0.94 Sun Feb 29 14:21:00 2004 + - FIXED IMPLEMENTATION OF NAMESPACES!! XML::Generator is now conformant. + Note that the semantics of namespaces have changed! + - Implemented AUTOLOAD exporting to simplify syntax. + - Implement STACKED AUTOLOADs to simplify sub-classing. + - Added "macro" options ':standard', ':std', ':strict' and ':pretty'. + - Added new 'allowed_xml_tags' option to allow tags starting with 'xml' + under strict conformance. + - Documented the 'version', 'encoding' and 'dtd' options. + - Added arguments to xmldecl() to allow more control. + - Changed XML comment behavior when escaping '--' to escape both dashes. + - Fixed memory leak in constructor. Bug #4513. + - Fixed bug in t/DOM.t that caused it to fail when DOM.pm was installed. Bug #3220. + +0.93 Wed Jan 22 10:41:00 2003 + - Added 'high-bit' option to escape to allow escaping of upper ASCII. + - Fixed a test bug that assumed the order of elements in a hash. + +0.92 Tue Jan 21 13:12:00 2003 + - Finally (after multiple bug reports) stopped requiring that XML::DOM be + installed for the tests to pass. Sorry this took so long to get fixed. + - Also fixed a bug in XML::Generator::DOM's POD that made it look strange + on search.cpan.org (reported by Ken Williams). + +0.91 Mon Dec 11 11:33:32 2000 + - Added XML::Generator::DOM subclass for producing DOM trees instead of + strings. + - New choices for the 'empty' option: 'compact' and 'args'. + - Changed the semantics of 'pretty' option; CDATA sections and Processing + Instructions are no longer subject to the pretty printing rules. Thanks + for the bug report from Murat Uenalan. + - Using closures for tag generation, which seems to save a little bit of + time. Might not be worth it in the long run, for maintainability's sake. + - Fix for perl versions that can't use 'for' as a statement modifier (pre 5.005) + courtesy of Neil Prockter (n.prockter@lse.ac.uk). + - Some documentation fixups. + +0.9 Sat Nov 18 11:13:24 2000 + - Massive code reorganization to support subclassing, courtesy of + Nathan Winger (nate@nateware.com) + - New instantiation option, 'empty', to control how empty tags are + rendered. + - Improved internal representation for improved performance + ( $gen->foo($gen->bar($gen->baz( $really_big_string ))) used to copy + $really_big_string three times; as long as the 'pretty' option is not + supplied, this is no longer the case. ) + - Fixed xml() tag to allow comments and processing instructions before + and/or after the xml document. + - New special tag, xmldtd(), which used to be part of xmldecl(). + +0.8 Wed Jul 12 17:10:12 2000 + - Bug-fix for pretty-printing + - New special tag, "xml" which takes a complete XML document and + "finalizes" it, so it can't be further embedded. + - Arguments passed as scalar refs will not be escaped, even if the + XML::Generator object was constructed with the 'escape' => "always" + option. + +0.7 Mon Jun 13 09:14:32 2000 + - Pretty-printing patch from Bron Gondwana + - Undefined warnings patch from Bron Gondwana + +0.6 Sun Jun 11 16:02:00 2000 + - Cleaned-up, modularized rewrite courtesy of Bron Gondwana + (perlcode@brong.net) + - XML::Generator now returns objects blessed into XML::Generator::auto + which contains only an AUTOLOAD that redirects requests to the + proper method in XML::Generator. + - A new option is available in the constructor to force stricter + conformance to the XML specification ('conformance' => 'strict'). + This also enables some special tags; "xmlpi", "xmlcmnt", "xmldecl" + and "xmlcdata" that can be used to generate, respectively, processing + instructions, comments, the XML declaration, and character data + sections. + +0.5 Thu Sep 08 11:12:04 1999 + - Fixed one lingering definedness bug + - Added escaping options to XMLify content + - Added global namespace option + - Fixed namespace support somewhat + +0.4 Fri Jul 02 11:44:32 1999 + - Fixed a few remarkably dumb bugs which I can't believe survived + this long. Improved the documentation slightly. + +0.3 Tue Apr 13 09:11:13 1999 + - Fixed undefined variables warnings as reported by John Labovitz + (johnl@meer.net) + +0.2 Wed Feb 10 12:00:00 1999 + - Added support for namespaces; bholzman + - Allowed "new" as a tag name; bholzman + +0.1 Wed Nov 11 20:39:11 1998 + - first public version; bholzman + +0.01 Wed Nov 11 20:17:39 1998 + - original version; created by h2xs 1.18 diff --git a/tests/common/XML/DOM.pm b/tests/common/XML/DOM.pm new file mode 100644 index 0000000000..ddfc58ea4a --- /dev/null +++ b/tests/common/XML/DOM.pm @@ -0,0 +1,254 @@ +package XML::Generator::DOM; + +=head1 NAME + +XML::Generator::DOM - XML::Generator subclass for producing DOM trees instead of strings. + +=head1 SYNOPSIS + + use XML::Generator::DOM; + + my $dg = XML::Generator::DOM->new(); + my $doc = $dg->xml($dg->xmlcmnt("Test document."), + $dg->foo({'baz' => 'bam'}, 42)); + print $doc->toString; + +yields: + + + + 42 + +=head1 DESCRIPTION + +XML::Generator::DOM subclasses XML::Generator in order to produce DOM +trees instead of strings (see L and L). This +module is still experimental and its semantics might change. + +Essentially, tag methods return XML::DOM::DocumentFragment objects, +constructed either from a DOM document passed into the constructor or +a default document that XML::Generator::DOM will automatically construct. + +Calling the xml() method will return this automatically constructed +document and cause a fresh one to be constructed for future tag method +calls. If you passed in your own document, you may not call the xml() +method. + +Below, we just note the remaining differences in semantics between +XML::Generator methods and XML::Generator::DOM methods. + +=cut + +use strict; +use Carp; +use XML::Generator (); +use base 'XML::Generator'; +use XML::DOM; + +use vars qw( $AUTOLOAD $VERSION ); + +$VERSION = '0.2'; + +=head1 CONSTRUCTOR + +These configuration options are accepted but have no effect on the +semantics of the returned object: escape, pretty, conformance and +empty. + +=head1 TAG METHODS + +Subsequently, tag method semantics are somewhat different for +this module compared to XML::Generator. The primary difference is +that tag method return XML::DOM::DocumentFragment objects. Namespace +and attribute processing remains the same, but remaining arguments to +tag methods must either be text or other XML::DOM::DocumentFragment +objects. No escape processing, syntax checking, or output control is +done; this is all left up to XML::DOM. + +=cut + +sub new { + my $class = shift; + + my $dom; + for (my $i = 0; $i < $#_; $i+=2) { + if ($_[$i] eq 'dom_document') { + $dom = $_[$i+1]; + unless (UNIVERSAL::isa($dom, 'XML::DOM::Document')) { + croak "argument to 'dom' option not an XML::DOM::Document object"; + } + splice @_, $i, 2; + last; + } + } + + if (ref $class) { + $AUTOLOAD = 'new'; + return $class->AUTOLOAD(@_); + } + + my $this = $class->SUPER::new(@_); + + $this->{'dom'} = $dom || XML::Generator::DOM::util::new_dom_root(); + return $this; +} + +=head1 SPECIAL TAGS + +All special tags are available by default with XML::Generator::DOM; you don't +need to use 'conformance' => 'strict'. + +=head2 xmlpi(@args) + +Arguments will simply be concatenated and passed as the data to +the XML::DOM::ProcessingInstruction object that is returned. + +=cut + +sub xmlpi { + my $this = shift; + my $root = $this->{dom}; + my $tgt = shift; + return $root->createProcessingInstruction($tgt, join '', @_); +} + +=head2 xmlcmnt + +Escaping of '--' is done by XML::DOM::Comment, which replaces both +hyphens with '-'. An XML::DOM::Comment object is returned. + +=cut + +sub xmlcmnt { + my $this = shift; + my $root = $this->{dom}; + my $xml = join '', @_; + return $root->createComment($xml); +} + +my $config = 'XML::Generator::util::config'; + +=head2 xmldecl + +Returns an XML::DOM::XMLDecl object. Respects 'version', 'encoding' +and 'dtd' settings in the object. + +=cut + +sub xmldecl { + my $this = shift; + my $root = $this->{dom}; + + my $version = $this->$config('version') || '1.0'; + my $encoding = $this->$config('encoding') || undef; + + my $standalone = $this->xmldtd($this->$config('dtd')) + ? "no" : "yes"; + + return $root->createXMLDecl($version, $encoding, $standalone) +} + +=head2 xmldecl + +Returns an XML::DOM::DocumentType object. + +=cut + +sub xmldtd { + my($this, $dtd) = @_; + my $root = $this->{dom}; + $dtd ||= $this->$config('dtd'); + return unless $dtd && ref($dtd) eq "ARRAY"; + + return $root->createDocumentType(@{ $dtd }); +} + +=head2 xmlcdata + +Returns an XML::DOM::CDATASection object. + +=cut + +sub xmlcdata { + my $this = shift; + my $data = join '', @_; + my $root = $this->{dom}; + return $root->createCDATASection($data); +} + +=head2 xml + +As described above, xml() can only be used when dom_document was not +set in the object. The automatically created document will have its XML +Declaration set and the arguments to xml() will be appended to it. Then +a new DOM document is automatically generated and the old one is +returned. This is the only way to get a DOM document from this module. + +=cut + +sub xml { + my $this = shift; + my $root = $this->{dom}; + + if ($root != $XML::Generator::DOM::util::root) { + croak "xml() method not allowed when dom_document option specified"; + } + + $this->{dom} = XML::Generator::DOM::util::new_dom_root(); + + $root->setXMLDecl($this->xmldecl()); + + $root->appendChild($_) for @_; + return $root; +} + +sub AUTOLOAD { + my $this = shift; + + (my $tag = $AUTOLOAD) =~ s/.*:://;; + + my $root = $this->{'dom'}; + + my($namespace, $attr, @args) = $this->XML::Generator::util::parse_args(@_); + + $namespace = $namespace->[1] ? $namespace->[1] . ':' : ''; + + my $xml = $root->createDocumentFragment(); + + my $node = $xml->appendChild($root->createElement("$namespace$tag")); + + if ($attr) { + while (my($k, $v) = each %$attr) { + unless ($k =~ /^[^:]+:/) { + $k = "$namespace$k"; + } + $node->setAttribute($k, $v); + } + } + + for (@args) { + if (UNIVERSAL::isa($_, 'XML::DOM::Node')) { + $node->appendChild($_); + } else { + $node->appendChild($root->createTextNode($_)); + } + } + + return $xml; +} + +package XML::Generator::DOM::util; + +use XML::DOM; +use vars qw($root $parser); + +$parser = XML::DOM::Parser->new; + +sub new_dom_root { + $root = $parser->parse('<_/>'); + $root->removeChild($root->getFirstChild); + + return $root; +} + +1; diff --git a/tests/common/XML/Generator.pm b/tests/common/XML/Generator.pm new file mode 100644 index 0000000000..4aa9264011 --- /dev/null +++ b/tests/common/XML/Generator.pm @@ -0,0 +1,1570 @@ +package XML::Generator; + +use strict; +use Carp; +use vars qw/$VERSION $AUTOLOAD/; + +$VERSION = '1.04'; + +=head1 NAME + +XML::Generator - Perl extension for generating XML + +=head1 SYNOPSIS + + use XML::Generator ':pretty'; + + print foo(bar({ baz => 3 }, bam()), + bar([ 'qux' => 'http://qux.com/' ], + "Hey there, world")); + + # OR + + require XML::Generator; + + my $X = XML::Generator->new(':pretty'); + + print $X->foo($X->bar({ baz => 3 }, $X->bam()), + $X->bar([ 'qux' => 'http://qux.com/' ], + "Hey there, world")); + +Either of the above yield: + + + + + + Hey there, world + + +=head1 DESCRIPTION + +In general, once you have an XML::Generator object, you then simply call +methods on that object named for each XML tag you wish to generate. + +XML::Generator can also arrange for undefined subroutines in the caller's +package to generate the corresponding XML, by exporting an C +subroutine to your package. Just supply an ':import' argument to +your C call. If you already have an C +defined then XML::Generator can be configured to cooperate with it. +See L<"STACKABLE AUTOLOADs">. + +Say you want to generate this XML: + + + Bob + 34 + Accountant + + +Here's a snippet of code that does the job, complete with pretty printing: + + use XML::Generator; + my $gen = XML::Generator->new(':pretty'); + print $gen->person( + $gen->name("Bob"), + $gen->age(34), + $gen->job("Accountant") + ); + +The only problem with this is if you want to use a tag name that +Perl's lexer won't understand as a method name, such as "shoe-size". +Fortunately, since you can store the name of a method in a variable, +there's a simple work-around: + + my $shoe_size = "shoe-size"; + $xml = $gen->$shoe_size("12 1/2"); + +Which correctly generates: + + 12 1/2 + +You can use a hash ref as the first parameter if the tag should include +atributes. Normally this means that the order of the attributes will be +unpredictable, but if you have the L module, you can use it +to get the order you want, like this: + + use Tie::IxHash; + tie my %attr, 'Tie::IxHash'; + + %attr = (name => 'Bob', + age => 34, + job => 'Accountant', + 'shoe-size' => '12 1/2'); + + print $gen->person(\%attr); + +This produces + + + +An array ref can also be supplied as the first argument to indicate +a namespace for the element and the attributes. + +If there is one element in the array, it is considered the URI of +the default namespace, and the tag will have an xmlns="URI" attribute +added automatically. If there are two elements, the first should be +the tag prefix to use for the namespace and the second element should +be the URI. In this case, the prefix will be used for the tag and an +xmlns:PREFIX attribute will be automatically added. Prior to version +0.99, this prefix was also automatically added to each attribute name. +Now, the default behavior is to leave the attributes alone (although you +may always explicitly add a prefix to an attribute name). If the prior +behavior is desired, use the constructor option C. + +If you specify more than two elements, then each pair should correspond +to a tag prefix and the corresponding URL. An xmlns:PREFIX attribute +will be added for each pair, and the prefix from the first such pair +will be used as the tag's namespace. If you wish to specify a default +namespace, use '#default' for the prefix. If the default namespace is +first, then the tag will use the default namespace itself. + +If you want to specify a namespace as well as attributes, you can make +the second argument a hash ref. If you do it the other way around, +the array ref will simply get stringified and included as part of the +content of the tag. + +Here's an example to show how the attribute and namespace parameters work: + + $xml = $gen->account( + $gen->open(['transaction'], 2000), + $gen->deposit(['transaction'], { date => '1999.04.03'}, 1500) + ); + +This generates: + + + 2000 + 1500 + + +Because default namespaces inherit, XML::Generator takes care to output +the xmlns="URI" attribute as few times as strictly necessary. For example, + + $xml = $gen->account( + $gen->open(['transaction'], 2000), + $gen->deposit(['transaction'], { date => '1999.04.03'}, + $gen->amount(['transaction'], 1500) + ) + ); + +This generates: + + + 2000 + + 1500 + + + +Notice how C was left out of the C<> tag. + +Here is an example that uses the two-argument form of the namespace: + + $xml = $gen->widget(['wru' => 'http://www.widgets-r-us.com/xml/'], + {'id' => 123}, $gen->contents()); + + + + + +Here is an example that uses multiple namespaces. It generates the +first example from the RDF primer (L). + + my $contactNS = [contact => "http://www.w3.org/2000/10/swap/pim/contact#"]; + $xml = $gen->xml( + $gen->RDF([ rdf => "http://www.w3.org/1999/02/22-rdf-syntax-ns#", + @$contactNS ], + $gen->Person($contactNS, { 'rdf:about' => "http://www.w3.org/People/EM/contact#me" }, + $gen->fullName($contactNS, 'Eric Miller'), + $gen->mailbox($contactNS, {'rdf:resource' => "mailto:em@w3.org"}), + $gen->personalTitle($contactNS, 'Dr.')))); + + + + + Eric Miller + + Dr. + + + +=head1 CONSTRUCTOR + +XML::Generator-Enew(':option', ...); + +XML::Generator-Enew(option => 'value', ...); + +(Both styles may be combined) + +The following options are available: + +=head2 :std, :standard + +Equivalent to + + escape => 'always', + conformance => 'strict', + +=head2 :strict + +Equivalent to + + conformance => 'strict', + +=head2 :pretty[=N] + +Equivalent to + + escape => 'always', + conformance => 'strict', + pretty => N # N defaults to 2 + +=head2 namespace + +This value of this option must be an array reference containing one or +two values. If the array contains one value, it should be a URI and will +be the value of an 'xmlns' attribute in the top-level tag. If there are +two or more elements, the first of each pair should be the namespace +tag prefix and the second the URI of the namespace. This will enable +behavior similar to the namespace behavior in previous versions; the tag +prefix will be applied to each tag. In addition, an xmlns:NAME="URI" +attribute will be added to the top-level tag. Prior to version 0.99, +the tag prefix was also automatically added to each attribute name, +unless overridden with an explicit prefix. Now, the attribute names are +left alone, but if the prior behavior is desired, use the constructor +option C. + +The value of this option is used as the global default namespace. +For example, + + my $html = XML::Generator->new( + pretty => 2, + namespace => [HTML => "http://www.w3.org/TR/REC-html40"]); + print $html->html( + $html->body( + $html->font({ face => 'Arial' }, + "Hello, there"))); + +would yield + + + + Hello, there + + + +Here is the same example except without all the prefixes: + + my $html = XML::Generator->new( + pretty => 2, + namespace => ["http://www.w3.org/TR/REC-html40"]); + print $html->html( + $html->body( + $html->font({ 'face' => 'Arial' }, + "Hello, there"))); + +would yield + + + + Hello, there + + + +=head2 qualifiedAttributes, qualified_attributes + +Set this to a true value to emulate the attribute prefixing behavior of +XML::Generator prior to version 0.99. Here is an example: + + my $foo = XML::Generator->new( + namespace => [foo => "http://foo.com/"], + qualifiedAttributes => 1); + print $foo->bar({baz => 3}); + +yields + + + +=head2 escape + +The contents and the values of each attribute have any illegal XML +characters escaped if this option is supplied. If the value is 'always', +then &, < and > (and " within attribute values) will be converted into +the corresponding XML entity, although & will not be converted if it looks +like it could be part of a valid entity (but see below). If the value is +'unescaped', then the escaping will be turned off character-by- character +if the character in question is preceded by a backslash, or for the +entire string if it is supplied as a scalar reference. So, for example, + + use XML::Generator escape => 'always'; + + one('<'); # < + two('\&'); # \& + three(\'>'); # > (scalar refs always allowed) + four('<'); # < (looks like an entity) + five('"'); # " (looks like an entity) + +but + + use XML::Generator escape => 'unescaped'; + + one('<'); # < + two('\&'); # & + three(\'>'); # > (aiee!) + four('<'); # &lt; (no special case for entities) + +By default, high-bit data will be passed through unmodified, so that +UTF-8 data can be generated with pre-Unicode perls. If you know that +your data is ASCII, use the value 'high-bit' for the escape option +and bytes with the high bit set will be turned into numeric entities. +You can combine this functionality with the other escape options by +comma-separating the values: + + my $a = XML::Generator->new(escape => 'always,high-bit'); + print $a->foo("<\242>"); + +yields + + <¢> + +Because XML::Generator always uses double quotes ("") around attribute +values, it does not escape single quotes. If you want single quotes +inside attribute values to be escaped, use the value 'apos' along with +'always' or 'unescaped' for the escape option. For example: + + my $gen = XML::Generator->new(escape => 'always,apos'); + print $gen->foo({'bar' => "It's all good"}); + + + +If you actually want & to be converted to & even if it looks like it +could be part of a valid entity, use the value 'even-entities' along with +'always'. Supplying 'even-entities' to the 'unescaped' option is meaningless +as entities are already escaped with that option. + +=head2 pretty + +To have nice pretty printing of the output XML (great for config files +that you might also want to edit by hand), supply an integer for the +number of spaces per level of indenting, eg. + + my $gen = XML::Generator->new(pretty => 2); + print $gen->foo($gen->bar('baz'), + $gen->qux({ tricky => 'no'}, 'quux')); + +would yield + + + baz + quux + + +You may also supply a non-numeric string as the argument to 'pretty', in +which case the indents will consist of repetitions of that string. So if +you want tabbed indents, you would use: + + my $gen = XML::Generator->new(pretty => "\t"); + +Pretty printing does not apply to CDATA sections or Processing Instructions. + +=head2 conformance + +If the value of this option is 'strict', a number of syntactic +checks are performed to ensure that generated XML conforms to the +formal XML specification. In addition, since entity names beginning +with 'xml' are reserved by the W3C, inclusion of this option enables +several special tag names: xmlpi, xmlcmnt, xmldecl, xmldtd, xmlcdata, +and xml to allow generation of processing instructions, comments, XML +declarations, DTD's, character data sections and "final" XML documents, +respectively. + +Invalid characters (http://www.w3.org/TR/xml11/#charsets) will be filtered +out. To disable this behavior, supply the 'filter_invalid_chars' option with +the value 0. + +See L<"XML CONFORMANCE"> and L<"SPECIAL TAGS"> for more information. + +=head2 filterInvalidChars, filter_invalid_chars + +Set this to a 1 to enable filtering of invalid characters, or to 0 to disable +the filtering. See http://www.w3.org/TR/xml11/#charsets for the set of valid +characters. + +=head2 allowedXMLTags, allowed_xml_tags + +If you have specified 'conformance' => 'strict' but need to use tags +that start with 'xml', you can supply a reference to an array containing +those tags and they will be accepted without error. It is not an error +to supply this option if 'conformance' => 'strict' is not supplied, +but it will have no effect. + +=head2 empty + +There are 5 possible values for this option: + + self - create empty tags as (default) + compact - create empty tags as + close - close empty tags as + ignore - don't do anything (non-compliant!) + args - use count of arguments to decide between and + +Many web browsers like the 'self' form, but any one of the forms besides +'ignore' is acceptable under the XML standard. + +'ignore' is intended for subclasses that deal with HTML and other +SGML subsets which allow atomic tags. It is an error to specify both +'conformance' => 'strict' and 'empty' => 'ignore'. + +'args' will produce if there are no arguments at all, or if there +is just a single undef argument, and otherwise. + +=head2 version + +Sets the default XML version for use in XML declarations. +See L<"xmldecl"> below. + +=head2 encoding + +Sets the default encoding for use in XML declarations. + +=head2 dtd + +Specify the dtd. The value should be an array reference with three +values; the type, the name and the uri. + +=head1 IMPORT ARGUMENTS + +use XML::Generator ':option'; + +use XML::Generator option => 'value'; + +(Both styles may be combined) + +=head2 :import + +Cause C to export an C to your package that +makes undefined subroutines generate XML tags corresponding to their name. +Note that if you already have an C defined, it will be overwritten. + +=head2 :stacked + +Implies :import, but if there is already an C defined, the +overriding C will still give it a chance to run. See L<"STACKED +AUTOLOADs">. + +=head2 ANYTHING ELSE + +If you supply any other options, :import is implied and the XML::Generator +object that is created to generate tags will be constructed with those options. + +=cut + +package XML::Generator; + +use strict; +require Carp; + +# If no value is provided for these options, they will be set to '' + +my @optionsToInit = qw( + allowed_xml_tags + conformance + dtd + escape + namespace + pretty + version + empty + qualified_attributes + filter_invalid_chars +); + +my %tag_factory; + +sub import { + my $type = shift; + + # check for attempt to use tag 'import' + if (ref $type && defined $tag_factory{$type}) { + unshift @_, $type, 'import'; + goto &{ $tag_factory{$type} }; + } + + my $pkg = caller; + + no strict 'refs'; # Let's get serious + + # should we import an AUTOLOAD? + no warnings 'once'; + + if (@_) { + my $STACKED; + + # are we supposed to call their AUTOLOAD first? + if (grep /^:stacked$/, @_) { + $STACKED = \&{"${pkg}::AUTOLOAD"}; + } + + my $this = $type->new(@_); + + no warnings 'redefine'; # No, I mean SERIOUS + + *{"${pkg}::AUTOLOAD"} = + sub { + if ($STACKED) { + ${"${pkg}::AUTOLOAD"} = our $AUTOLOAD; + my @ret = $STACKED->(@_); + return wantarray ? @ret : $ret[0] if @ret; + } + + # The tag is whatever our sub name is. + my($tag) = our $AUTOLOAD =~ /.*::(.*)/; + + # Special-case for xml... tags + if ($tag =~ /^xml/ && $this->{'conformance'} eq 'strict') { + if (my $func = $this->can($tag)) { + unshift @_, $this; + goto &$func; + } + } + + unshift @_, $this, $tag; + + goto &{ $tag_factory{$this} }; + }; + + # convenience feature for stacked autoloads; give them + # an import() that aliases AUTOLOAD. + if ($STACKED && ! defined *{"${pkg}::import"}{CODE}) { + *{"${pkg}::import"} = + sub { + my $p = caller; + *{"${p}::AUTOLOAD"} = \&{"${pkg}::AUTOLOAD"}; + }; + } + } + + return; +} + +# The constructor method + +sub new { + my $class = shift; + + # If we already have a ref in $class, this means that the + # person wants to generate a tag! + return $class->XML::Generator::util::tag('new', @_) if ref $class; + + my %options = + map { + /^:(std|standard) $/x ? ( escape => 'always', + conformance => 'strict' ) + : /^:strict $/x ? ( conformance => 'strict' ) + : /^:pretty(?:=(.+))?$/x ? ( escape => 'always', + conformance => 'strict', + pretty => ( defined $1 ? $1 : 2 ) ) + : /^:(import | + stacked )$/x ? ( do { Carp::carp("Useless use of $_") + unless (caller(1))[3] =~ /::import/; + () } ) + : /^allowedXMLTags$/ ? 'allowed_xml_tags' + : /^qualifiedAttributes$/ ? 'qualified_attributes' + : /^filterInvalidChars$/ ? 'filter_invalid_chars' + : $_ + } @_; + + # We used to only accept certain options, but unfortunately this + # means that subclasses can't extend the list. As such, we now + # just make sure our default options are defined. + for (@optionsToInit) { + if (not defined $options{$_}) { + $options{$_} = ''; + } + } + + if ($options{'dtd'}) { + $options{'dtdtree'} = $class->XML::Generator::util::parse_dtd($options{'dtd'}); + } + + if ($options{'conformance'} eq 'strict' && + $options{'empty'} eq 'ignore') { + Carp::croak "option 'empty' => 'ignore' not allowed while 'conformance' => 'strict'"; + } + + if ($options{'escape'}) { + my $e = $options{'escape'}; + $options{'escape'} = 0; + while ($e =~ /([-\w]+),?/g) { + if ($1 eq 'always') { + $options{'escape'} |= XML::Generator::util::ESCAPE_ALWAYS() + | XML::Generator::util::ESCAPE_GT(); + } elsif ($1 eq 'high-bit') { + $options{'escape'} |= XML::Generator::util::ESCAPE_HIGH_BIT(); + } elsif ($1 eq 'apos') { + $options{'escape'} |= XML::Generator::util::ESCAPE_APOS(); + } elsif ($1 eq 'even-entities') { + $options{'escape'} |= XML::Generator::util::ESCAPE_EVEN_ENTITIES(); + } elsif ($1) { + if ($1 ne 'unescaped') { + Carp::carp "option 'escape' => '$1' deprecated; use 'escape' => 'unescaped'"; + } + $options{'escape'} |= XML::Generator::util::ESCAPE_TRUE() + | XML::Generator::util::ESCAPE_GT(); + } + } + } else { + $options{'escape'} = 0; + } + + if (ref $options{'namespace'} eq 'ARRAY') { + if (@{ $options{'namespace'} } > 2 && (@{ $options{'namespace'} } % 2) != 0) { + Carp::croak "odd number of arguments for namespace"; + } + } elsif ($options{'namespace'}) { + Carp::croak "namespace must be an array reference"; + } + + if ($options{'conformance'} eq 'strict' && + $options{'filter_invalid_chars'} eq '') { + $options{'filter_invalid_chars'} = 1; + } + + my $this = bless \%options, $class; + $tag_factory{$this} = XML::Generator::util::c_tag($this); + return $this; +} + +# We use AUTOLOAD as a front-end to TAG so that we can +# create tags by name at will. + +sub AUTOLOAD { + my $this = shift; + + # The tag is whatever our sub name is, or 'AUTOLOAD' + my ($tag) = defined our $AUTOLOAD ? $AUTOLOAD =~ /.*::(.*)/ : 'AUTOLOAD'; + + undef $AUTOLOAD; # this ensures that future attempts to use tag 'AUTOLOAD' work. + + unshift @_, $this, $tag; + + goto &{ $tag_factory{$this} }; +} + +# I wish there were a way to allow people to use tag 'DESTROY!' +# hmm, maybe xmlDESTROY? +sub DESTROY { delete $tag_factory{$_[0]} } + +=head1 XML CONFORMANCE + +When the 'conformance' => 'strict' option is supplied, a number of +syntactic checks are enabled. All entity and attribute names are +checked to conform to the XML specification, which states that they must +begin with either an alphabetic character or an underscore and may then +consist of any number of alphanumerics, underscores, periods or hyphens. +Alphabetic and alphanumeric are interpreted according to the current +locale if 'use locale' is in effect and according to the Unicode standard +for Perl versions >= 5.6. Furthermore, entity or attribute names are not +allowed to begin with 'xml' (in any case), although a number of special +tags beginning with 'xml' are allowed (see L<"SPECIAL TAGS">). Note +that you can also supply an explicit list of allowed tags with the +'allowed_xml_tags' option. + +Also, the filter_invalid_chars option is automatically set to 1 unless it +is explicitly set to 0. + +=head1 SPECIAL TAGS + +The following special tags are available when running under strict +conformance (otherwise they don't act special): + +=head2 xmlpi + +Processing instruction; first argument is target, remaining arguments +are attribute, value pairs. Attribute names are syntax checked, values +are escaped. + +=cut + +# We handle a few special tags, but only if the conformance +# is 'strict'. If not, we just fall back to XML::Generator::util::tag. + +sub xmlpi { + my $this = shift; + + return $this->XML::Generator::util::tag('xmlpi', @_) + unless $this->{conformance} eq 'strict'; + + my $xml; + my $tgt = shift; + + $this->XML::Generator::util::ck_syntax($tgt); + + $xml = "XML::Generator::util::ck_syntax($k); + XML::Generator::util::escape($v, + XML::Generator::util::ESCAPE_FILTER_INVALID_CHARS() | + XML::Generator::util::ESCAPE_ATTR() | + $this->{'escape'}); + $xml .= qq{ $k="$v"}; + } + } + $xml .= "?>"; + + return XML::Generator::pi->new([$xml]); +} + +=head2 xmlcmnt + +Comment. Arguments are concatenated and placed inside +comment delimiters. Any occurences of '--' in the concatenated arguments +are converted to '--' + +=cut + +sub xmlcmnt { + my $this = shift; + + return $this->XML::Generator::util::tag('xmlcmnt', @_) + unless $this->{conformance} eq 'strict'; + + my $xml = join '', @_; + + # double dashes are illegal; change them to '--' + $xml =~ s/--/--/g; + XML::Generator::util::filter($xml); + $xml = ""; + + return XML::Generator::comment->new([$xml]); +} + +=head2 xmldecl(@args) + +Declaration. This can be used to specify the version, encoding, and +other XML-related declarations (i.e., anything inside the tag). +@args can be used to control what is output, as keyword-value pairs. + +By default, the version is set to the value specified in the constructor, +or to 1.0 if it was not specified. This can be overridden by providing a +'version' key in @args. If you do not want the version at all, explicitly +provide undef as the value in @args. + +By default, the encoding is set to the value specified in the constructor; +if no value was specified, the encoding will be left out altogether. +Provide an 'encoding' key in @args to override this. + +If a dtd was set in the constructor, the standalone attribute of the +declaration will be set to 'no' and the doctype declaration will be +appended to the XML declartion, otherwise the standalone attribute will +be set to 'yes'. This can be overridden by providing a 'standalone' +key in @args. If you do not want the standalone attribute to show up, +explicitly provide undef as the value. + +=cut + +sub xmldecl { + my($this, @args) = @_; + + return $this->XML::Generator::util::tag('xmldecl', @_) + unless $this->{conformance} eq 'strict'; + + my $version = $this->{'version'} || '1.0'; + + # there's no explicit support for encodings yet, but at the + # least we can know to put it in the declaration + my $encoding = $this->{'encoding'}; + + # similarly, although we don't do anything with DTDs yet, we + # recognize a 'dtd' => [ ... ] option to the constructor, and + # use it to create a and to indicate that this + # document can't stand alone. + my $doctype = $this->xmldtd($this->{dtd}); + my $standalone = $doctype ? "no" : "yes"; + + for (my $i = 0; $i < $#args; $i += 2) { + if ($args[$i] eq 'version' ) { + $version = $args[$i + 1]; + } elsif ($args[$i] eq 'encoding' ) { + $encoding = $args[$i + 1]; + } elsif ($args[$i] eq 'standalone') { + $standalone = $args[$i + 1]; + } else { + Carp::croak("Unrecognized argument '$args[$i]'"); + } + } + + $version = qq{ version="$version"} if defined $version; + $encoding = qq{ encoding="$encoding"} if defined $encoding; + $standalone = qq{ standalone="$standalone"} if defined $standalone; + + $encoding ||= ''; + $version ||= ''; + $standalone ||= ''; + + my $xml = ""; + $xml .= "\n$doctype" if $doctype; + + $xml = "$xml\n"; + + return $xml; +} + +=head2 xmldtd + +DTD tag creation. The format of this method is different from +others. Since DTD's are global and cannot contain namespace information, +the first argument should be a reference to an array; the elements are +concatenated together to form the DTD: + + print $xml->xmldtd([ 'html', 'PUBLIC', $xhtml_w3c, $xhtml_dtd ]) + +This would produce the following declaration: + + + +Assuming that $xhtml_w3c and $xhtml_dtd had the correct values. + +Note that you can also specify a DTD on creation using the new() method's +dtd option. + +=cut + +sub xmldtd { + my $this = shift; + my $dtd = shift || return undef; + + # return the appropriate thingy + $dtd ? return(qq{}) + : return(''); +} + +=head2 xmlcdata + +Character data section; arguments are concatenated and placed inside + character data section delimiters. Any occurences of +']]>' in the concatenated arguments are converted to ']]>'. + +=cut + +sub xmlcdata { + my $this = shift; + + $this->XML::Generator::util::tag('xmlcdata', @_) + unless $this->{conformance} eq 'strict'; + + my $xml = join '', @_; + + # ]]> is not allowed; change it to ]]> + $xml =~ s/]]>/]]>/g; + XML::Generator::util::filter($xml); + $xml = ""; + + return XML::Generator::cdata->new([$xml]); +} + +=head2 xml + +"Final" XML document. Must be called with one and exactly one +XML::Generator-produced XML document. Any combination of +XML::Generator-produced XML comments or processing instructions may +also be supplied as arguments. Prepends an XML declaration, and +re-blesses the argument into a "final" class that can't be embedded. + +=cut + +sub xml { + my $this = shift; + + return $this->XML::Generator::util::tag('xml', @_) + unless $this->{conformance} eq 'strict'; + + unless (@_) { + Carp::croak "usage: object->xml( (COMMENT | PI)* XML (COMMENT | PI)* )"; + } + + my $got_root = 0; + foreach my $arg (@_) { + next if UNIVERSAL::isa($arg, 'XML::Generator::comment') || + UNIVERSAL::isa($arg, 'XML::Generator::pi'); + if (UNIVERSAL::isa($arg, 'XML::Generator::overload')) { + if ($got_root) { + Carp::croak "arguments to xml() can contain only one XML document"; + } + $got_root = 1; + } else { + Carp::croak "arguments to xml() must be comments, processing instructions or XML documents"; + } + } + + return XML::Generator::final->new([$this->xmldecl(), @_]); +} + +=head1 CREATING A SUBCLASS + +For a simpler way to implement subclass-like behavior, see L<"STACKABLE +AUTOLOADs">. + +At times, you may find it desireable to subclass XML::Generator. For +example, you might want to provide a more application-specific interface +to the XML generation routines provided. Perhaps you have a custom +database application and would really like to say: + + my $dbxml = new XML::Generator::MyDatabaseApp; + print $dbxml->xml($dbxml->custom_tag_handler(@data)); + +Here, custom_tag_handler() may be a method that builds a recursive XML +structure based on the contents of @data. In fact, it may even be named +for a tag you want generated, such as authors(), whose behavior changes +based on the contents (perhaps creating recursive definitions in the +case of multiple elements). + +Creating a subclass of XML::Generator is actually relatively +straightforward, there are just three things you have to remember: + + 1. All of the useful utilities are in XML::Generator::util. + + 2. To construct a tag you simply have to call SUPER::tagname, + where "tagname" is the name of your tag. + + 3. You must fully-qualify the methods in XML::Generator::util. + +So, let's assume that we want to provide a custom HTML table() method: + + package XML::Generator::CustomHTML; + use base 'XML::Generator'; + + sub table { + my $self = shift; + + # parse our args to get namespace and attribute info + my($namespace, $attr, @content) = + $self->XML::Generator::util::parse_args(@_) + + # check for strict conformance + if ( $self->XML::Generator::util::config('conformance') eq 'strict' ) { + # ... special checks ... + } + + # ... special formatting magic happens ... + + # construct our custom tags + return $self->SUPER::table($attr, $self->tr($self->td(@content))); + } + +That's pretty much all there is to it. We have to explicitly call +SUPER::table() since we're inside the class's table() method. The others +can simply be called directly, assuming that we don't have a tr() in the +current package. + +If you want to explicitly create a specific tag by name, or just want a +faster approach than AUTOLOAD provides, you can use the tag() method +directly. So, we could replace that last line above with: + + # construct our custom tags + return $self->XML::Generator::util::tag('table', $attr, ...); + +Here, we must explicitly call tag() with the tag name itself as its first +argument so it knows what to generate. These are the methods that you might +find useful: + +=over 4 + +=item XML::Generator::util::parse_args() + +This parses the argument list and returns the namespace (arrayref), attributes +(hashref), and remaining content (array), in that order. + +=item XML::Generator::util::tag() + +This does the work of generating the appropriate tag. The first argument must +be the name of the tag to generate. + +=item XML::Generator::util::config() + +This retrieves options as set via the new() method. + +=item XML::Generator::util::escape() + +This escapes any illegal XML characters. + +=back + +Remember that all of these methods must be fully-qualified with the +XML::Generator::util package name. This is because AUTOLOAD is used by +the main XML::Generator package to create tags. Simply calling parse_args() +will result in a set of XML tags called . + +Finally, remember that since you are subclassing XML::Generator, you do +not need to provide your own new() method. The one from XML::Generator +is designed to allow you to properly subclass it. + +=head1 STACKABLE AUTOLOADs + +As a simpler alternative to traditional subclassing, the C +that C exports can be configured to work with a +pre-defined C with the ':stacked' option. Simply ensure that +your C is defined before C +executes. The C will get a chance to run first; the subroutine +name will be in your C<$AUTOLOAD> as normal. Return an empty list to let +the default XML::Generator C run or any other value to abort it. +This value will be returned as the result of the original method call. + +If there is no C defined, XML::Generator will create one. +All that this C does is export AUTOLOAD, but that lets your +package be used as if it were a subclass of XML::Generator. + +An example will help: + + package MyGenerator; + + my %entities = ( copy => '©', + nbsp => ' ', ... ); + + sub AUTOLOAD { + my($tag) = our $AUTOLOAD =~ /.*::(.*)/; + + return $entities{$tag} if defined $entities{$tag}; + return; + } + + use XML::Generator qw(:pretty :stacked); + +This lets someone do: + + use MyGenerator; + + print html(head(title("My Title", copy()))); + +Producing: + + + + My Title© + + + +=cut + +package XML::Generator::util; + +# The ::util package space actually has all the utilities +# that do all the work. It must be separate from the +# main XML::Generator package space since named subs will +# interfere with the workings of AUTOLOAD otherwise. + +use strict; +use Carp; + +use constant ESCAPE_TRUE => 1; +use constant ESCAPE_ALWAYS => 1<<1; +use constant ESCAPE_HIGH_BIT => 1<<2; +use constant ESCAPE_APOS => 1<<3; +use constant ESCAPE_ATTR => 1<<4; +use constant ESCAPE_GT => 1<<5; +use constant ESCAPE_EVEN_ENTITIES => 1<<6; +use constant ESCAPE_FILTER_INVALID_CHARS => 1<<7; + +sub parse_args { + # this parses the args and returns a namespace and attr + # if either were specified, with the remainer of the + # arguments (the content of the tag) in @args. call as: + # + # ($namespace, $attr, @args) = parse_args(@args); + + my($this, @args) = @_; + + my($namespace); + my($attr) = (''); + + # check for supplied namespace + if (ref $args[0] eq 'ARRAY') { + $namespace = [ map { defined $_ && $_ eq '#default' ? undef : $_ } @{shift @args} ]; + if (@$namespace > 2 && (@$namespace % 2) != 0) { + croak "odd number of arguments for namespace"; + } + } + + # get globally-set namespace (from new) + unless ($namespace) { + $namespace = [ map { defined $_ && $_ eq '#default' ? undef : $_ } @{ $this->{'namespace'} || [] } ]; + } + + if (@$namespace == 1) { unshift @$namespace, undef } + + # check for supplied attributes + if (ref $args[0] eq 'HASH') { + $attr = shift @args; + if ($this->{conformance} eq 'strict') { + $this->XML::Generator::util::ck_syntax($_) + for map split(/:/), keys %$attr; + } + } + + return ($namespace, $attr, @args); +} + +# This routine is what handles all the automatic tag creation. +# We maintain it as a separate method so that subclasses can +# override individual tags and then call SUPER::tag() to create +# the tag automatically. This is not possible if only AUTOLOAD +# is used, since there is no way to then pass in the name of +# the tag. + +sub tag { + my $sub = XML::Generator::util::c_tag($_[0]); + goto &{ $sub } if $sub; +} + +# Generate a closure that encapsulates all the behavior to generate a tag +sub c_tag { + my $arg = shift; + + my $strict = $arg->{'conformance'} eq 'strict'; + my $escape = $arg->{'escape'}; + my $empty = $arg->{'empty'}; + my $indent = $arg->{'pretty'} =~ /^[^0-9]/ + ? $arg->{'pretty'} + : $arg->{'pretty'} + ? " " x $arg->{'pretty'} + : ""; + if ($arg->{'filter_invalid_chars'}) { + $escape |= ESCAPE_FILTER_INVALID_CHARS; + } + + my $blessClass = $indent ? 'XML::Generator::pretty' : 'XML::Generator::overload'; + + return sub { + my $this = shift; + my $tag = shift || return undef; # catch for bad usage + + # parse our argument list to check for hashref/arrayref properties + my($namespace, $attr, @args) = $this->XML::Generator::util::parse_args(@_); + + $this->XML::Generator::util::ck_syntax($tag) if $strict; + + # check for attempt to embed "final" document + for (@args) { + if (UNIVERSAL::isa($_, 'XML::Generator::final')) { + croak("cannot embed XML document"); + } + } + + # Deal with escaping if required + if ($escape) { + if ($attr) { + foreach my $key (keys %{$attr}) { + next unless defined($attr->{$key}); + XML::Generator::util::escape($attr->{$key}, ESCAPE_ATTR() | $escape); + } + } + for (@args) { + next unless defined($_); + + # perform escaping, except on sub-documents or simple scalar refs + if (ref $_ eq "SCALAR") { + # un-ref it + $_ = $$_; + } elsif (! UNIVERSAL::isa($_, 'XML::Generator::overload') ) { + XML::Generator::util::escape($_, $escape); + } + } + } else { + # un-ref simple scalar refs + for (@args) { + $_ = $$_ if ref $_ eq "SCALAR"; + } + } + + my $prefix = ''; + $prefix = $namespace->[0] . ":" if $namespace && defined $namespace->[0]; + my $xml = "<$prefix$tag"; + + if ($attr) { + while (my($k, $v) = each %$attr) { + next unless defined $k and defined $v; + if ($strict) { + # allow supplied namespace in attribute names + if ($k =~ s/^([^:]+)://) { + $this->XML::Generator::util::ck_syntax($k); + $k = "$1:$k"; + } elsif ($prefix && $this->{'qualified_attributes'}) { + $this->XML::Generator::util::ck_syntax($k); + $k = "$prefix$k"; + } else { + $this->XML::Generator::util::ck_syntax($k); + } + } elsif ($this->{'qualified_attributes'}) { + if ($k !~ /^[^:]+:/) { + $k = "$prefix$k"; + } + } + $xml .= qq{ $k="$v"}; + } + } + + my @xml; + + if (@args || $empty eq 'close') { + if ($empty eq 'args' && @args == 1 && ! defined $args[0]) { + @xml = ($xml .= ' />'); + } else { + $xml .= '>'; + if ($indent) { + my $prettyend = ''; + + foreach my $arg (@args) { + next unless defined $arg; + if ( UNIVERSAL::isa($arg, 'XML::Generator::cdata' ) ) { + my $copy = $xml; + push @xml, $copy, $arg; + $xml = ''; + } else { + if ( UNIVERSAL::isa($arg, 'XML::Generator::overload') && + ! UNIVERSAL::isa($arg, 'XML::Generator::pi') ) { + $xml .= "\n$indent"; + $prettyend = "\n"; + XML::Generator::util::_fixupNS($namespace, $arg) if ref $arg->[0]; + + my @cdata; + for my $i (0..$#$arg) { + if (UNIVERSAL::isa($arg->[$i], 'XML::Generator::cdata')) { + push @cdata, $arg->[$i]; + $arg->[$i] = "\001"; + } + } + + $arg =~ s/\n/\n$indent/gs; + + if (@cdata) { + my @pieces = split "\001", $arg; + + my $copy = $xml; + push @xml, $copy; + $xml = ''; + $arg = ''; + + for my $i (0..$#pieces) { + if (defined $cdata[$i]) { + push @xml, $pieces[$i], $cdata[$i]; + } else { + push @xml, $pieces[$i]; + } + } + } + } + $xml .= "$arg"; + } + } + $xml .= $prettyend; + push @xml, ($xml, ""); + } else { + @xml = $xml; + foreach my $arg (grep defined, @args) { + if ( UNIVERSAL::isa($arg, 'XML::Generator::overload') && + (! ( UNIVERSAL::isa($arg, 'XML::Generator::cdata' ) || + UNIVERSAL::isa($arg, 'XML::Generator::pi' )))) { + XML::Generator::util::_fixupNS($namespace, $arg) if ref $arg->[0]; + } + push @xml, $arg; + } + push @xml, ""; + } + } + } elsif ($empty eq 'ignore') { + @xml = ($xml .= '>'); + } elsif ($empty eq 'compact') { + @xml = ($xml .= '/>'); + } else { + @xml = ($xml .= ' />'); + } + + unshift @xml, $namespace if $namespace; + + return $blessClass->new(\@xml); + }; +} + +sub _fixupNS { + # remove namespaces + # if prefix + # if prefix and uri match one we have, remove them from child + # if prefix does not match one we have, remove it and uri + # from child and add them to us + # no prefix + # if we have an explicit default namespace and the child has the + # same one, remove it from the child + # if we have an explicit default namespace and the child has a + # different one, leave it alone + # if we have an explicit default namespace and the child has none, + # add an empty default namespace to child + my($namespace, $o) = @_; + my @n = @{$o->[0]}; + my $sawDefault = 0; + for (my $i = 0; $i < $#n; $i+=2) { + if (defined $n[$i]) { # namespace w/ prefix + my $flag = 0; + for (my $j = 0; $j < $#$namespace; $j+=2) { + next unless defined $namespace->[$j]; + if ($namespace->[$j] eq $n[$i]) { + $flag = 1; + if ($namespace->[$j+1] ne $n[$i+1]) { + $flag = 2; + } + last; + } + } + if (!$flag) { + push @$namespace, splice @n, $i, 2; + $i-=2; + } elsif ($flag == 1) { + splice @n, $i, 2; + $i-=2; + } + } elsif (defined $n[$i+1]) { # default namespace + $sawDefault = 1; + for (my $j = 0; $j < $#$namespace; $j+=2) { + next if defined $namespace->[$j]; + if ($namespace->[$j+1] eq $n[$i+1]) { + splice @n, $i, 2; + $i-=2; + } + } + } + } + + # check to see if we need to add explicit default namespace of "" to child + if (! @{ $o->[0] } && + ! $sawDefault && + grep { defined $namespace->[$_ * 2 + 1] && + ! defined $namespace->[$_ * 2 ] } 0..($#$namespace/2)) { + push @n, undef, ""; + } + + if (@n) { + $o->[0] = [@n]; + } else { + splice @$o, 0, 1; + } +} + +# Fetch and store config values (those set via new()) +# This is only here for subclasses + +sub config { + my $this = shift; + my $key = shift || return undef; + @_ ? $this->{$key} = $_[0] + : $this->{$key}; +} + +# Collect all escaping into one place +sub escape { + # $_[0] is the argument, $_[1] are the flags + return unless defined $_[0]; + + my $f = $_[1]; + if ($f & ESCAPE_ALWAYS) { + if ($f & ESCAPE_EVEN_ENTITIES) { + $_[0] =~ s/&/&/g; + } else { + $_[0] =~ s/&(?!(?:#[0-9]+|#x[0-9a-fA-F]+|\w+);)/&/g; + } + + $_[0] =~ s//>/g if $f & ESCAPE_GT; + $_[0] =~ s/"/"/g if $f & ESCAPE_ATTR; + $_[0] =~ s/'/'/g if $f & ESCAPE_ATTR && $f & ESCAPE_APOS; + } else { + $_[0] =~ s/([^\\]|^)&/$1&/g; + $_[0] =~ s/\\&/&/g; + $_[0] =~ s/([^\\]|^)/$1>/g; + $_[0] =~ s/\\>/>/g; + } + if ($f & ESCAPE_ATTR) { + $_[0] =~ s/([^\\]|^)"/$1"/g; + $_[0] =~ s/\\"/"/g; + if ($f & ESCAPE_APOS) { + $_[0] =~ s/([^\\]|^)'/$1'/g; + $_[0] =~ s/\\'/'/g; + } + } + } + if ($f & ESCAPE_HIGH_BIT) { + $_[0] =~ s/([\200-\377])/'&#'.ord($1).';'/ge; + } + if ($f & ESCAPE_FILTER_INVALID_CHARS) { + filter($_[0]); + } +} + +sub filter { $_[0] =~ tr/\x00\x01\x02\x03\x04\x05\x06\x07\x08\x0B\x0C\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x7F\x80\x81\x82\x83\x84\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F//d } + +# verify syntax of supplied name; croak if it's not valid. +# rules: 1. name must begin with a letter or an underscore +# 2. name may contain any number of letters, numbers, hyphens, +# periods or underscores +# 3. name cannot begin with "xml" in any case +sub ck_syntax { + my($this, $name) = @_; + # use \w and \d so that everything works under "use locale" and + # "use utf8" + if ($name =~ /^\w[\w\-\.]*$/) { + if ($name =~ /^\d/) { + croak "name [$name] may not begin with a number"; + } + } else { + croak "name [$name] contains illegal character(s)"; + } + if ($name =~ /^xml/i) { + if (!$this->{'allowed_xml_tags'} || ! grep { $_ eq $name } @{ $this->{'allowed_xml_tags'} }) { + croak "names beginning with 'xml' are reserved by the W3C"; + } + } +} + +my %DTDs; +my $DTD; + +sub parse_dtd { + my $this = shift; + my($dtd) = @_; + + my($root, $type, $name, $uri); + + croak "DTD must be supplied as an array ref" unless (ref $dtd eq 'ARRAY'); + croak "DTD must have at least 3 elements" unless (@{$dtd} >= 3); + + ($root, $type) = @{$dtd}[0,1]; + if ($type eq 'PUBLIC') { + ($name, $uri) = @{$dtd}[2,3]; + } elsif ($type eq 'SYSTEM') { + $uri = $dtd->[2]; + } else { + croak "unknown dtd type [$type]"; + } + return $DTDs{$uri} if $DTDs{$uri}; + + # parse DTD into $DTD (not implemented yet) + my $dtd_text = get_dtd($uri); + + return $DTDs{$uri} = $DTD; +} + +sub get_dtd { + my($uri) = @_; + return; +} + +# This package is needed so that embedded tags are correctly +# interpreted as such and handled properly. Otherwise, you'd +# get "<inner />" + +package XML::Generator::overload; + +use overload '""' => sub { $_[0]->stringify }, + '0+' => sub { $_[0]->stringify }, + 'bool' => sub { $_[0]->stringify }, + 'eq' => sub { (ref $_[0] ? $_[0]->stringify : $_[0]) eq + (ref $_[1] ? $_[1]->stringify : $_[1])}; + +sub new { + my($class, $xml) = @_; + return bless $xml, $class; +} + +sub stringify { + return $_[0] unless UNIVERSAL::isa($_[0], 'XML::Generator::overload'); + if (ref($_[0]->[0])) { # namespace + my $n = shift @{$_[0]}; + for (my $i = ($#$n - 1); $i >= 0; $i-=2) { + my($prefix, $uri) = @$n[$i,$i+1]; + XML::Generator::util::escape($uri, XML::Generator::util::ESCAPE_ATTR | + XML::Generator::util::ESCAPE_ALWAYS| + XML::Generator::util::ESCAPE_GT); + if (defined $prefix) { + $_[0]->[0] =~ s/^([^ \/>]+)/$1 xmlns:$prefix="$uri"/; + } else { + $uri ||= ''; + $_[0]->[0] =~ s/^([^ \/>]+)/$1 xmlns="$uri"/; + } + } + } + + join $, || "", @{$_[0]} +} + +sub DESTROY { } + +package XML::Generator::pretty; + +use base 'XML::Generator::overload'; + +sub stringify { + my $this = shift; + my $string = $this->SUPER::stringify(); + + $string =~ s{^((\s*<(?:\w+:)?\w[-.\w]* )[^ "]+"[^"]+")( .{40,})} + { my($a,$b,$c) = ($1, $2, $3); + $c =~ s{ ((?:\w+:)?\w+="[^\"]+")}{"\n" . (' 'x(length $b)) . $1}ge; + "$a$c" }gem; + + return $string; +} + +package XML::Generator::final; + +use base 'XML::Generator::overload'; + +package XML::Generator::comment; + +use base 'XML::Generator::overload'; + +package XML::Generator::pi; + +use base 'XML::Generator::overload'; + +package XML::Generator::cdata; + +use base 'XML::Generator::overload'; + +1; +__END__ + +=head1 AUTHORS + +=over 4 + +=item Benjamin Holzman + +Original author and maintainer + +=item Bron Gondwana + +First modular version + +=item Nathan Wiger + +Modular rewrite to enable subclassing + +=back + +=head1 SEE ALSO + +=over 4 + +=item The XML::Writer module + +http://search.cpan.org/search?mode=module&query=XML::Writer + +=back + +=cut diff --git a/tests/common/XML/MANIFEST b/tests/common/XML/MANIFEST new file mode 100644 index 0000000000..b5065b5ef7 --- /dev/null +++ b/tests/common/XML/MANIFEST @@ -0,0 +1,9 @@ +Changes +Generator.pm +DOM.pm +MANIFEST +Makefile.PL +t/Generator.t +t/DOM.t +README +META.yml Module meta-data (added by MakeMaker) diff --git a/tests/common/XML/META.yml b/tests/common/XML/META.yml new file mode 100644 index 0000000000..28997c9aac --- /dev/null +++ b/tests/common/XML/META.yml @@ -0,0 +1,20 @@ +--- #YAML:1.0 +name: XML-Generator +version: 1.04 +abstract: ~ +author: [] +license: unknown +distribution_type: module +configure_requires: + ExtUtils::MakeMaker: 0 +build_requires: + ExtUtils::MakeMaker: 0 +requires: {} +no_index: + directory: + - t + - inc +generated_by: ExtUtils::MakeMaker version 6.55_02 +meta-spec: + url: http://module-build.sourceforge.net/META-spec-v1.4.html + version: 1.4 diff --git a/tests/common/XML/Makefile.PL b/tests/common/XML/Makefile.PL new file mode 100644 index 0000000000..af1350b680 --- /dev/null +++ b/tests/common/XML/Makefile.PL @@ -0,0 +1,11 @@ +use ExtUtils::MakeMaker; +# See lib/ExtUtils/MakeMaker.pm for details of how to influence +# the contents of the Makefile that is written. +WriteMakefile( + 'NAME' => 'XML::Generator', + 'PM' => { 'Generator.pm' => '$(INST_LIBDIR)/Generator.pm', + 'DOM.pm' => '$(INST_LIBDIR)/Generator/DOM.pm' }, + 'MAN3PODS' => { 'Generator.pm' => '$(INST_MAN3DIR)/XML::Generator.3', + 'DOM.pm' => '$(INST_MAN3DIR)/XML::Generator::DOM.3' }, + 'VERSION_FROM' => 'Generator.pm', # finds $VERSION +); diff --git a/tests/common/XML/README b/tests/common/XML/README new file mode 100644 index 0000000000..1975895cb1 --- /dev/null +++ b/tests/common/XML/README @@ -0,0 +1,32 @@ +XML::Generator - A module to help in generating XML documents + +SYNOPSIS +-------- +Lets you do this: + + use XML::Generator ':pretty'; + print this(is(a(document()))); + +To get this: + + + + + + + + + +RECENT CHANGES +------ ------- + +1.04 Fri Jul 15 08:35:00 2011 + - Added the filter_invalid_chars option, which is turned on by default + under strict mode. + + +COPYRIGHT +--------- +Copyright 1999-2011 Benjamin Holzman. All rights reserved. +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. diff --git a/tests/common/XML/t/DOM.t b/tests/common/XML/t/DOM.t new file mode 100644 index 0000000000..c24488cb15 --- /dev/null +++ b/tests/common/XML/t/DOM.t @@ -0,0 +1,141 @@ +#!/usr/bin/perl -w + +use Test; + +unless (eval "use XML::DOM; 1;") { + print "1..0 # Skipped: XML::DOM not installed\n"; + exit; +} + +plan tests => 35; + +require XML::Generator::DOM; + +my $x = new XML::Generator::DOM; +ok($x); + +my $xml = $x->foo(); +ok($xml->toString, ''); + +$xml = $x->bar(42); +ok($xml->toString, '42'); + +$xml = $x->baz({'foo'=>3}); +ok($xml->toString, ''); + +$xml = $x->bam({'bar'=>42},$x->foo(),"qux"); +ok($xml->toString, 'qux'); + +$xml = $x->new(3); +ok($xml->toString, '3'); + +$xml = $x->foo(['baz']); +ok($xml->toString, ''); + +$xml = $x->foo(['baz'],{'bar'=>42},3); +ok($xml->toString, '3'); + +$xml = $x->foo({'id' => 4}, 3, 5); +ok($xml->toString, '35'); + +$xml = $x->foo({'id' => 4}, 0, 5); +ok($xml->toString, '05'); + +$xml = $x->foo({'id' => 4}, 3, 0); +ok($xml->toString, '30'); + +my $foo_bar = "foo-bar"; +$xml = $x->$foo_bar(42); +ok($xml->toString, '42'); + +$x = new XML::Generator::DOM 'namespace' => ['A']; + +$xml = $x->foo({'bar' => 42}, $x->bar(['B'], {'bar' => 54})); +ok($xml->toString, ''); + +$xml = $x->xmldecl(); +ok(UNIVERSAL::isa($xml, 'XML::DOM::XMLDecl')); + +ok($xml->getVersion, '1.0'); + +ok($xml->getStandalone, 'yes'); + +$xml = $x->xmlcmnt("test"); +ok(UNIVERSAL::isa($xml, 'XML::DOM::Comment')); + +ok($xml->getData, 'test'); + +$x = new XML::Generator::DOM + 'version' => '1.1', + 'encoding' => 'iso-8859-2'; +$xml = $x->xmldecl(); +ok($xml->getVersion, '1.1'); + +ok($xml->getEncoding, 'iso-8859-2'); + +$xml = $x->xmlpi("target", 'option="value"'); +ok(UNIVERSAL::isa($xml, 'XML::DOM::ProcessingInstruction')); + +ok($xml->getTarget, 'target'); + +ok($xml->getData, 'option="value"'); + +eval { + my $t = "42"; + $x->$t(); +}; +ok(UNIVERSAL::isa($@, 'XML::DOM::DOMException')); + +$xml = $x->foo(['bar'], {'baz:foo' => 'qux', 'fob' => 'gux'}); +ok($xml->toString eq '' || + $xml->toString eq ''); + +$x = new XML::Generator::DOM 'dtd' => [ 'foo', 'SYSTEM', '"http://foo.com/foo"' ]; +$xml = $x->xmldecl(); +ok($xml->getStandalone, 'no'); + +$xml = $x->xmlcdata("test"); +ok(UNIVERSAL::isa($xml, 'XML::DOM::CDATASection')); + +ok($xml->getData, 'test'); + +$x = new XML::Generator::DOM; + +$xml = $x->foo($x->xmlcdata("bar"), $x->xmlpi("baz", "bam")); +ok($xml->toString, ''); + +$xml = $x->foo(42); +$xml = $x->xml($xml); +ok($xml->toString, +' +42 +'); + +eval { + $xml = $x->bar($xml); +}; +ok($@); +ok($@->getName, 'WRONG_DOCUMENT_ERR'); + +$xml = $x->foo(); +$cmnt = $x->xmlcmnt("comment"); +$pi = $x->xmlpi("foo", "bar"); +$xml = $x->xml($cmnt, $xml, $pi); +ok($xml->toString, ' + + + +'); + +require XML::DOM; +$doc = XML::DOM::Parser->new->parse(''); +$x = XML::Generator::DOM->new( dom_document => $doc ); +$doc->getFirstChild->appendChild($x->foo(42)); +ok($doc->toString, +'42 +'); + +eval { + $xml = $x->xml($x->bar(12)); +}; +ok($@ =~ /method not allowed/); diff --git a/tests/common/XML/t/Generator.t b/tests/common/XML/t/Generator.t new file mode 100644 index 0000000000..e2dc48f53d --- /dev/null +++ b/tests/common/XML/t/Generator.t @@ -0,0 +1,595 @@ +#!/usr/bin/perl -w + +use Test; + +BEGIN { $| = 1; plan tests => 100; } + +use XML::Generator (); +ok(1); + +my $x = XML::Generator->new(); +ok($x); + +my $xml = $x->foo(); +ok($xml, ''); + +$xml = $x->bar(42); +ok($xml, '42'); + +$xml = $x->baz({'foo'=>3}); +ok($xml, ''); + +$xml = $x->bam({'bar'=>42},$x->foo(),"qux"); +ok($xml, 'qux'); + +eval { require Tie::IxHash; }; +if ($@) { + skip('Tie::IxHash not installed', 1); +} else { + tie %h, 'Tie::IxHash'; + @h{'a'..'z'} = 1..26; + $xml = $x->foo(\%h); + ok($xml, ''); +} + + +$xml = $x->new(3); +ok($xml, '3'); + +$xml = $x->import(3); +ok($xml, '3'); + +$xml = $x->foo(['baz']); +ok($xml, ''); + +$xml = $x->foo(['baz','bam']); +ok($xml, ''); + +$xml = $x->foo(['baz'],{'bar'=>42},3); +ok($xml, '3'); + +$xml = $x->foo(['baz','bam'],{'bar'=>42},3); +ok($xml, '3'); + +$xml = $x->foo({'id' => 4}, 3, 5); +ok($xml, '35'); + +$xml = $x->foo({'id' => 4}, 0, 5); +ok($xml, '05'); + +$xml = $x->foo({'id' => 4}, 3, 0); +ok($xml, '30'); + +my $foo_bar = "foo-bar"; +$xml = $x->$foo_bar(42); +ok($xml, '42'); + +$x = new XML::Generator 'escape' => 'always'; + +$xml = $x->foo({'bar' => '4"4'}, '<&>"\<', \"<>"); +ok($xml, '<&>"\<<>'); + +$x = new XML::Generator 'escape' => 'unescaped'; + +$xml = $x->foo({'bar' => '4\"4'}, '<&>"\<', \"&& 6 < 5"); +ok($xml, '<&>"<&& 6 < 5'); + +$x = new XML::Generator 'namespace' => ['A']; + +$xml = $x->foo({'bar' => 42}, $x->bar(['B'], {'bar' => 54})); +ok($xml, ''); + +$x = new XML::Generator 'conformance' => 'strict'; +$xml = $x->xmldecl(); +ok($xml, qq(\n)); + +$xml = $x->xmlcmnt("test"); +ok($xml, ''); + +$x = new XML::Generator 'conformance' => 'strict', + 'version' => '1.1', + 'encoding' => 'iso-8859-2'; +$xml = $x->xmldecl(); +ok($xml, qq(\n)); + +$xml = $x->xmldecl(version => undef, encoding => undef, standalone => undef); +ok($xml, qq(\n)); + +$xml = $x->xmldecl(version => '1.0', encoding => 'utf8', standalone => 'no'); +ok($xml, qq(\n)); + +$xml = $x->xmlpi("target", "option" => "value"); +ok($xml, ''); + +eval { + $x->xmlfoo(); +}; +ok($@, qr{names beginning with 'xml' are reserved by the W3C}); + +eval { + $x->foo({xmlfoo => 4}); +}; +ok($@, qr{names beginning with 'xml' are reserved by the W3C}); + +eval { + my $t = "42"; + $x->$t(); +}; +ok($@, qr{name \[42] may not begin with a number}); + +eval { + $x->q({42=>'the answer'}); +}; +ok($@, qr{name \[42] may not begin with a number}); + +eval { + my $t = "g:"; + $x->$t(); +}; +ok($@, qr{name \[g:] contains illegal character\(s\)}); + +$xml = $x->foo(['bar'], {'baz:foo' => 'qux', 'fob' => 'gux'}); +ok($xml eq '' || + $xml eq '', 1, $xml); + +$xml = $x->foo(['bar' => 'bam'], {'baz:foo' => 'qux', 'fob' => 'gux'}); +ok($xml eq '' || + $xml eq '', 1, $xml); + +$x = new XML::Generator; +$xml = $x->xml(); +ok($xml, ''); + +$x = new XML::Generator 'conformance' => 'strict', + 'dtd' => [ 'foo', 'SYSTEM', '"http://foo.com/foo"' ]; +$xml = $x->xmldecl(); +ok($xml, +' + +'); + +$xml = $x->xmlcdata("test"); +ok($xml, ''); + +$x = new XML::Generator 'pretty' => 2, 'conformance' => 'strict'; +$xml = $x->foo($x->bar()); +ok($xml, +' + +'); + +$xml = $x->foo($x->xmlcdata("bar"), $x->xmlpi("baz")); +ok($xml, ''); + +# test that cdata is not intended when pretty printing is on + +$xml = $x->foo($x->bam($x->xmlcdata("bar\nbar"))); +ok($xml, ' + +'); + +$x = new XML::Generator 'conformance' => 'strict'; +$xml = $x->foo(42); +$xml = $x->xml($xml); +ok($xml, +' +42'); + +eval { + $x->xml(); +}; +ok($@ =~ /usage/, 1); + +eval { + $x->xml(3); +}; +ok($@ =~ /arguments to xml/, 1); + +eval { + $xml = $x->bar($xml); +}; +ok($@ =~ /cannot embed/, 1); + +$x = new XML::Generator 'pretty' => 2; +$xml = $x->foo($x->bar($x->baz())); +ok($xml, +' + + + +'); + +$xml = $x->foo("\n"); +ok($xml, +' +'); + +$x = new XML::Generator 'empty' => 'close'; +$xml = $x->foo(); +ok($xml, ''); + +$x = new XML::Generator 'empty' => 'ignore'; +$xml = $x->foo(); +ok($xml, ''); + +eval { + $x = new XML::Generator 'empty' => 'ignore', 'conformance' => 'strict'; +}; +ok($@ =~ /not allowed/, 1); + +$x = new XML::Generator 'conformance' => 'strict'; +$xml = $x->foo(); +$cmnt = $x->xmlcmnt("comment"); +$pi = $x->xmlpi("foo"); +$xml = $x->xml($cmnt, $xml, $pi); +ok($xml, ' +'); + +$x = new XML::Generator 'empty' => 'compact'; +$xml = $x->foo(); +ok($xml, ''); + +$x = new XML::Generator 'empty' => 'args'; +$xml = $x->foo(1); +ok($xml, '1'); + +$xml = $x->foo(''); +ok($xml, ''); + +$xml = $x->foo(); +ok($xml, ''); + +$xml = $x->foo(undef); +ok($xml, ''); + +$x = XML::Generator->new(escape => 'always,high-bit'); +$xml = $x->foo("<\242>"); +ok($xml, '<¢>'); + +# check :options +$x = XML::Generator->new(':standard'); +$xml = $x->foo('<', $x->xmlcmnt('c')); +ok($xml, '<'); + +$x = XML::Generator->new(':pretty'); +$xml = $x->foo('<', $x->bar($x->xmlcmnt('c'))); +ok($xml, '< + + + +'); + +$x = XML::Generator->new(':strict', escape => 'high-bit'); +$xml = $x->foo("\\<\242", $x->xmlpi('g')); +ok($xml, ''); + +{ my $w; local $SIG{__WARN__} = sub { $w .= $_[0] }; + $x = XML::Generator->new(':import'); + ok($w =~ /Useless use of/, 1); $w = ''; +} + +# test AUTOLOAD +package Test1; + +use XML::Generator ':import'; + +::ok(foo(), ''); + +package Test2; + +use XML::Generator ':pretty'; + +::ok(foo(bar()), ' + +'); + +package Test3; + +sub AUTOLOAD { + return "foo" if our $AUTOLOAD =~ /bar/; + return; +} + +use XML::Generator; + +::ok(barnyard(), 'foo'); +::ok(foo(), undef); + +package Test6; + +sub AUTOLOAD { + return "foo" if our $AUTOLOAD =~ /bar/; + return; +} + +use XML::Generator qw(:import); + +::ok(barnyard(), ''); +::ok(foo(), ''); + +package Test7; + +sub AUTOLOAD { + return "foo" if our $AUTOLOAD =~ /bar/; + return; +} + +use XML::Generator qw(:stacked); + +::ok(barnyard(), 'foo'); +::ok(foo(), ''); +::ok(foo(barnyard()), 'foo'); + +# misc + +package main; + +$x = XML::Generator->new(':strict', allowed_xml_tags => ['xmlfoo']); + +$xml = $x->xmlfoo('biznatch'); +ok($xml, 'biznatch'); + +$xml = $x->xmlcmnt('--'); +ok($xml, ''); + +$A = XML::Generator->new(namespace => ['A']); +$B = XML::Generator->new(namespace => ['B' => 'bee']); +$xml = $A->foo($B->bar($A->baz())); +ok($xml, ''); + +$xml = $A->foo($A->bar($B->baz())); +ok($xml, ''); + +$xml = $A->foo($B->bar($B->baz())); +ok($xml, ''); + +$C = XML::Generator->new(namespace => [undef]); +$xml = $A->foo($C->bar($B->baz())); +ok($xml, ''); + +$D = XML::Generator->new(); +$xml = $D->foo(['A'],$D->bar([undef],$D->baz(['B'=>'bee']))); +ok($xml, ''); + +$E = XML::Generator->new(); +$xml = $E->foo(['A'],$E->bar([undef],$E->baz(['B'=>'bee'], $E->bum(['A'])))); +ok($xml, ''); + +package MyGenerator; + +sub AUTOLOAD { + my($tag) = our $AUTOLOAD =~ /.*::(.*)/; + + return '©' if $tag eq 'copy'; + return; +} + +use XML::Generator qw(:pretty :stacked); + +package Test8; + +MyGenerator->import(); + +$xml = html(title("My Title",copy())); +::ok($xml, +' + My Title© +'); + +package TestDoc1_1; + + use XML::Generator ':pretty'; + + $prt = foo(bar({ baz => 3 }, bam()), + bar([ 'qux' => 'http://qux.com/' ], + "Hey there, world")); + +::ok($prt, +' + + + + Hey there, world +'); + +package TestDoc1_2; + + use XML::Generator (); + + my $X = XML::Generator->new(':pretty'); + + $prt = $X->foo($X->bar({ baz => 3 }, $X->bam()), + $X->bar([ 'qux' => 'http://qux.com/' ], + "Hey there, world")); + +::ok($prt, +' + + + + Hey there, world +'); + +package TestDoc2; + + use XML::Generator; + my $gen = XML::Generator->new(':pretty'); + $prt = $gen->person( + $gen->name("Bob"), + $gen->age(34), + $gen->job("Accountant") + ); + +::ok($prt, +' + Bob + 34 + Accountant +'); + + my $shoe_size = "shoe-size"; + $xml = $gen->$shoe_size("12 1/2"); + +::ok($xml, '12 1/2'); + + $xml = $gen->account( + $gen->open(['transaction'], 2000), + $gen->deposit(['transaction'], { date => '1999.04.03'}, 1500) + ); + +::ok($xml, +' + 2000 + 1500 +'); + + $xml = $gen->account( + $gen->open(['transaction'], 2000), + $gen->deposit(['transaction'], { date => '1999.04.03'}, + $gen->amount(['transaction'], 1500) + ) + ); + +::ok($xml, +' + 2000 + + 1500 + +'); + + $xml = $gen->widget(['wru' => 'http://www.widgets-r-us.com/xml/'], + {'id' => 123}, $gen->contents()); + +::ok($xml, +' + +'); + +package TestDoc3; + + my $html = XML::Generator->new( + pretty => 2, + namespace => [HTML => "http://www.w3.org/TR/REC-html40"]); + $pt = $html->html( + $html->body( + $html->font({ face => 'Arial' }, + "Hello, there"))); + +::ok($pt, +' + + Hello, there + +'); + + $html = XML::Generator->new( + pretty => 2, + namespace => ["http://www.w3.org/TR/REC-html40"]); + $pt = $html->html( + $html->body( + $html->font({ 'face' => 'Arial' }, + "Hello, there"))); + +::ok($pt, +' + + Hello, there + +'); + + + my $a = XML::Generator->new(escape => 'always,high-bit'); + $pt = $a->foo("<\242>"); + +::ok($pt, '<¢>'); + + $gen = XML::Generator->new(escape => 'always,apos'); + $pt = $gen->foo({'bar' => "It's all good"}); + +::ok($pt, ''); + + $gen = XML::Generator->new(pretty => 2); + $pt = $gen->foo($gen->bar('baz'), + $gen->qux({ tricky => 'no'}, 'quux')); + +::ok($pt, +' + baz + quux +'); + + $gen = XML::Generator->new(namespace => [foo => "http://foo.com/"], qualifiedAttributes => 1); + $pt = $gen->bar({baz => 3}); + +::ok($pt, ''); + + $pt = $gen->bar({'wow:baz' => 3}); + +::ok($pt, ''); + +package TestMult; + +$gen = XML::Generator->new(namespace => ['foo' => 'foo uri', 'bar' => 'bar uri']); +$pt = $gen->baz(); +::ok($pt, ''); + +$pt = $gen->bam(['#default' => 'default uri']); +::ok($pt, ''); + +$pt = $gen->bam(['#default' => 'default uri', 'foo' => 'foo uri']); +::ok($pt, ''); + +$pt = $gen->bam(['foo' => 'foo uri', '#default' => 'default uri']); +::ok($pt, ''); + +package TestRDF; + +my @contact = (contact => "http://www.w3.org/2000/10/swap/pim/contact#"); + +$gen = XML::Generator->new(':pretty'); +$pt = $gen->xml( + $gen->RDF([ rdf => "http://www.w3.org/1999/02/22-rdf-syntax-ns#", + @contact ], + $gen->Person(\@contact, { 'rdf:about' => "http://www.w3.org/People/EM/contact#me" }, + $gen->fullName(\@contact, 'Eric Miller'), + $gen->mailbox(\@contact, {'rdf:resource' => "mailto:em\@w3.org"}), + $gen->personalTitle(\@contact, 'Dr.')))); + +::ok($pt, ' + + + Eric Miller + + Dr. + +'); + +package TestEscapingEntities; + +use XML::Generator escape => 'always,even-entities', conformance => 'strict', pretty => 2; + +::ok(tag(">"), '&gt;'); + +package TestInvalidChars1; + +use XML::Generator filter_invalid_chars => '1'; + +::ok(tag(map chr, + 0, 0x1, 0x8, 0xB, 0xC, 0xE..0x1F, + 0x7F..0x84, 0x86..0x9F), ''); + +package TestInvalidCharsUnderStrict; + +use XML::Generator ':strict'; + +::ok(tag("\0"), ''); + +package TestInvalidCharsUnderStrict2; + +use XML::Generator ':strict', 'filter_invalid_chars' => 0; + +::ok(tag("\0"), "\0"); + diff --git a/tests/common/bats b/tests/common/bats new file mode 120000 index 0000000000..733edd06ff --- /dev/null +++ b/tests/common/bats @@ -0,0 +1 @@ +bats-0.4.0 \ No newline at end of file diff --git a/tests/common/bats-0.4.0/.gitattributes b/tests/common/bats-0.4.0/.gitattributes new file mode 100755 index 0000000000..20cad1f8be --- /dev/null +++ b/tests/common/bats-0.4.0/.gitattributes @@ -0,0 +1,3 @@ +* text=auto +*.sh eol=lf +libexec/* eol=lf diff --git a/tests/common/bats-0.4.0/.travis.yml b/tests/common/bats-0.4.0/.travis.yml new file mode 100644 index 0000000000..db06d9d71f --- /dev/null +++ b/tests/common/bats-0.4.0/.travis.yml @@ -0,0 +1,5 @@ +language: c +script: bin/bats --tap test +notifications: + email: + on_success: never diff --git a/tests/common/bats-0.4.0/LICENSE b/tests/common/bats-0.4.0/LICENSE new file mode 100644 index 0000000000..bac4eb29cc --- /dev/null +++ b/tests/common/bats-0.4.0/LICENSE @@ -0,0 +1,20 @@ +Copyright (c) 2014 Sam Stephenson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/tests/common/bats-0.4.0/README.md b/tests/common/bats-0.4.0/README.md new file mode 100644 index 0000000000..235bf1ee95 --- /dev/null +++ b/tests/common/bats-0.4.0/README.md @@ -0,0 +1,293 @@ +# Bats: Bash Automated Testing System + +Bats is a [TAP](http://testanything.org)-compliant testing framework +for Bash. It provides a simple way to verify that the UNIX programs +you write behave as expected. + +A Bats test file is a Bash script with special syntax for defining +test cases. Under the hood, each test case is just a function with a +description. + +```bash +#!/usr/bin/env bats + +@test "addition using bc" { + result="$(echo 2+2 | bc)" + [ "$result" -eq 4 ] +} + +@test "addition using dc" { + result="$(echo 2 2+p | dc)" + [ "$result" -eq 4 ] +} +``` + +Bats is most useful when testing software written in Bash, but you can +use it to test any UNIX program. + +Test cases consist of standard shell commands. Bats makes use of +Bash's `errexit` (`set -e`) option when running test cases. If every +command in the test case exits with a `0` status code (success), the +test passes. In this way, each line is an assertion of truth. + + +## Running tests + +To run your tests, invoke the `bats` interpreter with a path to a test +file. The file's test cases are run sequentially and in isolation. If +all the test cases pass, `bats` exits with a `0` status code. If there +are any failures, `bats` exits with a `1` status code. + +When you run Bats from a terminal, you'll see output as each test is +performed, with a check-mark next to the test's name if it passes or +an "X" if it fails. + + $ bats addition.bats + ✓ addition using bc + ✓ addition using dc + + 2 tests, 0 failures + +If Bats is not connected to a terminal—in other words, if you +run it from a continuous integration system, or redirect its output to +a file—the results are displayed in human-readable, machine-parsable +[TAP format](http://testanything.org). + +You can force TAP output from a terminal by invoking Bats with the +`--tap` option. + + $ bats --tap addition.bats + 1..2 + ok 1 addition using bc + ok 2 addition using dc + +### Test suites + +You can invoke the `bats` interpreter with multiple test file +arguments, or with a path to a directory containing multiple `.bats` +files. Bats will run each test file individually and aggregate the +results. If any test case fails, `bats` exits with a `1` status code. + + +## Writing tests + +Each Bats test file is evaluated _n+1_ times, where _n_ is the number of +test cases in the file. The first run counts the number of test cases, +then iterates over the test cases and executes each one in its own +process. + +For more details about how Bats evaluates test files, see +[Bats Evaluation Process](https://github.com/sstephenson/bats/wiki/Bats-Evaluation-Process) +on the wiki. + +### `run`: Test other commands + +Many Bats tests need to run a command and then make assertions about +its exit status and output. Bats includes a `run` helper that invokes +its arguments as a command, saves the exit status and output into +special global variables, and then returns with a `0` status code so +you can continue to make assertions in your test case. + +For example, let's say you're testing that the `foo` command, when +passed a nonexistent filename, exits with a `1` status code and prints +an error message. + +```bash +@test "invoking foo with a nonexistent file prints an error" { + run foo nonexistent_filename + [ "$status" -eq 1 ] + [ "$output" = "foo: no such file 'nonexistent_filename'" ] +} +``` + +The `$status` variable contains the status code of the command, and +the `$output` variable contains the combined contents of the command's +standard output and standard error streams. + +A third special variable, the `$lines` array, is available for easily +accessing individual lines of output. For example, if you want to test +that invoking `foo` without any arguments prints usage information on +the first line: + +```bash +@test "invoking foo without arguments prints usage" { + run foo + [ "$status" -eq 1 ] + [ "${lines[0]}" = "usage: foo " ] +} +``` + +### `load`: Share common code + +You may want to share common code across multiple test files. Bats +includes a convenient `load` command for sourcing a Bash source file +relative to the location of the current test file. For example, if you +have a Bats test in `test/foo.bats`, the command + +```bash +load test_helper +``` + +will source the script `test/test_helper.bash` in your test file. This +can be useful for sharing functions to set up your environment or load +fixtures. + +### `skip`: Easily skip tests + +Tests can be skipped by using the `skip` command at the point in a +test you wish to skip. + +```bash +@test "A test I don't want to execute for now" { + skip + run foo + [ "$status" -eq 0 ] +} +``` + +Optionally, you may include a reason for skipping: + +```bash +@test "A test I don't want to execute for now" { + skip "This command will return zero soon, but not now" + run foo + [ "$status" -eq 0 ] +} +``` + +Or you can skip conditionally: + +```bash +@test "A test which should run" { + if [ foo != bar ]; then + skip "foo isn't bar" + fi + + run foo + [ "$status" -eq 0 ] +} +``` + +### `setup` and `teardown`: Pre- and post-test hooks + +You can define special `setup` and `teardown` functions, which run +before and after each test case, respectively. Use these to load +fixtures, set up your environment, and clean up when you're done. + +### Code outside of test cases + +You can include code in your test file outside of `@test` functions. +For example, this may be useful if you want to check for dependencies +and fail immediately if they're not present. However, any output that +you print in code outside of `@test`, `setup` or `teardown` functions +must be redirected to `stderr` (`>&2`). Otherwise, the output may +cause Bats to fail by polluting the TAP stream on `stdout`. + +### Special variables + +There are several global variables you can use to introspect on Bats +tests: + +* `$BATS_TEST_FILENAME` is the fully expanded path to the Bats test +file. +* `$BATS_TEST_DIRNAME` is the directory in which the Bats test file is +located. +* `$BATS_TEST_NAMES` is an array of function names for each test case. +* `$BATS_TEST_NAME` is the name of the function containing the current +test case. +* `$BATS_TEST_DESCRIPTION` is the description of the current test +case. +* `$BATS_TEST_NUMBER` is the (1-based) index of the current test case +in the test file. +* `$BATS_TMPDIR` is the location to a directory that may be used to +store temporary files. + + +## Installing Bats from source + +Check out a copy of the Bats repository. Then, either add the Bats +`bin` directory to your `$PATH`, or run the provided `install.sh` +command with the location to the prefix in which you want to install +Bats. For example, to install Bats into `/usr/local`, + + $ git clone https://github.com/sstephenson/bats.git + $ cd bats + $ ./install.sh /usr/local + +Note that you may need to run `install.sh` with `sudo` if you do not +have permission to write to the installation prefix. + + +## Support + +The Bats source code repository is [hosted on +GitHub](https://github.com/sstephenson/bats). There you can file bugs +on the issue tracker or submit tested pull requests for review. + +For real-world examples from open-source projects using Bats, see +[Projects Using Bats](https://github.com/sstephenson/bats/wiki/Projects-Using-Bats) +on the wiki. + +To learn how to set up your editor for Bats syntax highlighting, see +[Syntax Highlighting](https://github.com/sstephenson/bats/wiki/Syntax-Highlighting) +on the wiki. + + +## Version history + +*0.4.0* (August 13, 2014) + +* Improved the display of failing test cases. Bats now shows the + source code of failing test lines, along with full stack traces + including function names, filenames, and line numbers. +* Improved the display of the pretty-printed test summary line to + include the number of skipped tests, if any. +* Improved the speed of the preprocessor, dramatically shortening test + and suite startup times. +* Added support for absolute pathnames to the `load` helper. +* Added support for single-line `@test` definitions. +* Added bats(1) and bats(7) manual pages. +* Modified the `bats` command to default to TAP output when the `$CI` + variable is set, to better support environments such as Travis CI. + +*0.3.1* (October 28, 2013) + +* Fixed an incompatibility with the pretty formatter in certain + environments such as tmux. +* Fixed a bug where the pretty formatter would crash if the first line + of a test file's output was invalid TAP. + +*0.3.0* (October 21, 2013) + +* Improved formatting for tests run from a terminal. Failing tests + are now colored in red, and the total number of failing tests is + displayed at the end of the test run. When Bats is not connected to + a terminal (e.g. in CI runs), or when invoked with the `--tap` flag, + output is displayed in standard TAP format. +* Added the ability to skip tests using the `skip` command. +* Added a message to failing test case output indicating the file and + line number of the statement that caused the test to fail. +* Added "ad-hoc" test suite support. You can now invoke `bats` with + multiple filename or directory arguments to run all the specified + tests in aggregate. +* Added support for test files with Windows line endings. +* Fixed regular expression warnings from certain versions of Bash. +* Fixed a bug running tests containing lines that begin with `-e`. + +*0.2.0* (November 16, 2012) + +* Added test suite support. The `bats` command accepts a directory + name containing multiple test files to be run in aggregate. +* Added the ability to count the number of test cases in a file or + suite by passing the `-c` flag to `bats`. +* Preprocessed sources are cached between test case runs in the same + file for better performance. + +*0.1.0* (December 30, 2011) + +* Initial public release. + +--- + +© 2014 Sam Stephenson. Bats is released under an MIT-style license; +see `LICENSE` for details. diff --git a/tests/common/bats-0.4.0/bin/bats b/tests/common/bats-0.4.0/bin/bats new file mode 120000 index 0000000000..a50a884e58 --- /dev/null +++ b/tests/common/bats-0.4.0/bin/bats @@ -0,0 +1 @@ +../libexec/bats \ No newline at end of file diff --git a/tests/common/bats-0.4.0/install.sh b/tests/common/bats-0.4.0/install.sh new file mode 100755 index 0000000000..8bbdd16bd1 --- /dev/null +++ b/tests/common/bats-0.4.0/install.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +set -e + +resolve_link() { + $(type -p greadlink readlink | head -1) "$1" +} + +abs_dirname() { + local cwd="$(pwd)" + local path="$1" + + while [ -n "$path" ]; do + cd "${path%/*}" + local name="${path##*/}" + path="$(resolve_link "$name" || true)" + done + + pwd + cd "$cwd" +} + +PREFIX="$1" +if [ -z "$1" ]; then + { echo "usage: $0 " + echo " e.g. $0 /usr/local" + } >&2 + exit 1 +fi + +BATS_ROOT="$(abs_dirname "$0")" +mkdir -p "$PREFIX"/{bin,libexec,share/man/man{1,7}} +cp -R "$BATS_ROOT"/bin/* "$PREFIX"/bin +cp -R "$BATS_ROOT"/libexec/* "$PREFIX"/libexec +cp "$BATS_ROOT"/man/bats.1 "$PREFIX"/share/man/man1 +cp "$BATS_ROOT"/man/bats.7 "$PREFIX"/share/man/man7 + +echo "Installed Bats to $PREFIX/bin/bats" diff --git a/tests/common/bats-0.4.0/libexec/bats b/tests/common/bats-0.4.0/libexec/bats new file mode 100755 index 0000000000..adba75f30d --- /dev/null +++ b/tests/common/bats-0.4.0/libexec/bats @@ -0,0 +1,199 @@ +#!/usr/bin/env bash +set -e + +version() { + echo "Bats 0.4.0" +} + +usage() { + version + echo "Usage: bats [-c] [-p | -t] [ ...]" +} + +help() { + usage + echo + echo " is the path to a Bats test file, or the path to a directory" + echo " containing Bats test files." + echo + echo " -c, --count Count the number of test cases without running any tests" + echo " -h, --help Display this help message" + echo " -p, --pretty Show results in pretty format (default for terminals)" + echo " -t, --tap Show results in TAP format" + echo " -v, --version Display the version number" + echo " -x, --xml JUnit XML Output" + echo " -T, --mktemp use 'mktemp' to generate unique temp directory names" + echo + echo " For more information, see https://github.com/sstephenson/bats" + echo +} + +resolve_link() { + $(type -p greadlink readlink | head -1) "$1" +} + +abs_dirname() { + local cwd="$(pwd)" + local path="$1" + + while [ -n "$path" ]; do + cd "${path%/*}" + local name="${path##*/}" + path="$(resolve_link "$name" || true)" + done + + pwd + cd "$cwd" +} + +expand_path() { + { cd "$(dirname "$1")" 2>/dev/null + local dirname="$PWD" + cd "$OLDPWD" + echo "$dirname/$(basename "$1")" + } || echo "$1" +} + +BATS_LIBEXEC="$(abs_dirname "$0")" +export BATS_PREFIX="$(abs_dirname "$BATS_LIBEXEC")" +export BATS_CWD="$(abs_dirname .)" +export PATH="$BATS_LIBEXEC:$PATH" + +options=() +arguments=() +for arg in "$@"; do + if [ "${arg:0:1}" = "-" ]; then + if [ "${arg:1:1}" = "-" ]; then + options[${#options[*]}]="${arg:2}" + else + index=1 + while option="${arg:$index:1}"; do + [ -n "$option" ] || break + options[${#options[*]}]="$option" + let index+=1 + done + fi + else + arguments[${#arguments[*]}]="$arg" + fi +done + +unset count_flag pretty +[ -t 0 ] && [ -t 1 ] && pretty="1" +[ -n "$CI" ] && pretty="" + +for option in "${options[@]}"; do + case "$option" in + "h" | "help" ) + help + exit 0 + ;; + "v" | "version" ) + version + exit 0 + ;; + "c" | "count" ) + count_flag="-c" + ;; + "t" | "tap" ) + pretty="" + ;; + "p" | "pretty" ) + pretty="1" + ;; + "x" | "xml" ) + xml="1" + ;; + "T" | "mktemp" ) + mktemp="1" + ;; + * ) + usage >&2 + exit 1 + ;; + esac +done + +if [ "${#arguments[@]}" -eq 0 ]; then + usage >&2 + exit 1 +fi + +if [ "x$BATS_JUNIT_FORMAT" == "x1" ];then + xml="1" +fi + +if [ "x$BATS_USE_MKTEMP" == "x1" ]; then + mktemp="1" +fi + +filenames=() +for filename in "${arguments[@]}"; do + if [ -d "$filename" ]; then + shopt -s nullglob + for suite_filename in "$(expand_path "$filename")"/*.bats; do + filenames["${#filenames[@]}"]="$suite_filename" + done + shopt -u nullglob + else + filenames["${#filenames[@]}"]="$(expand_path "$filename")" + fi +done + +if [ "${#filenames[@]}" -eq 1 ]; then + command="bats-exec-test" +else + command="bats-exec-suite" +fi + +# john.a.westlund@intel.com +# if mktemp is found use it to generate a temp directory that will be passed to bats-exec-test or bats-exec-suite +if [ -n "$mktemp" ]; then + if [ -x "$(which mktemp 2> /dev/null)" ]; then + export BATS_MKTEMP_DIR="$(`which mktemp` -d -p /tmp bats.XXXXXX)" + fi +fi + +if [ -n "$xml" ]; then + extended_syntax_flag="" + formatter="tap-to-junit-xml" +else + if [ -n "$pretty" ]; then + extended_syntax_flag="-x" + formatter="bats-format-tap-stream" + else + extended_syntax_flag="" + formatter="cat" + fi +fi + +set -o pipefail execfail + +if [ "$formatter" == "tap-to-junit-xml" ];then + if [ "x$BATS_JUNIT_GROUP" != "x" ];then + JUNIT_GROUP=$BATS_JUNIT_GROUP + else + JUNIT_GROUP="CMT" + fi + + if [ "${#filenames[@]}" -eq 1 ];then + baseName=`basename ${filenames[@]}` + # john.a.westlund@intel.com + # if there is an error in the test execution continue processing this script so that timing data can be inserted + # also, add mktemp_flag + set +e + exec "$command" $count_flag $extended_syntax_flag "${filenames[@]}" | tee >(cat >&2) | tee "${baseName}.log" | "$formatter" --cmt $JUNIT_GROUP --output "${baseName}.log.xml" + set -e + # john.a.westlund@intel.com + # If timing is enabled fix the JUNIT xml output to include timing data + if [ -n "$BATS_ENABLE_TIMING" ]; then + fix-timings.pl -i "${baseName}.log.xml" + fi + else + echo "Error: Junit parsing incompatible with multiple files" + exit 1 + fi + +else + exec "$command" $count_flag $extended_syntax_flag "${filenames[@]}" | "$formatter" +fi diff --git a/tests/common/bats-0.4.0/libexec/bats-exec-suite b/tests/common/bats-0.4.0/libexec/bats-exec-suite new file mode 100755 index 0000000000..29ab255d06 --- /dev/null +++ b/tests/common/bats-0.4.0/libexec/bats-exec-suite @@ -0,0 +1,55 @@ +#!/usr/bin/env bash +set -e + +count_only_flag="" +if [ "$1" = "-c" ]; then + count_only_flag=1 + shift +fi + +extended_syntax_flag="" +if [ "$1" = "-x" ]; then + extended_syntax_flag="-x" + shift +fi + +trap "kill 0; exit 1" int + +count=0 +for filename in "$@"; do + let count+="$(bats-exec-test -c "$filename")" +done + +if [ -n "$count_only_flag" ]; then + echo "$count" + exit +fi + +echo "1..$count" +status=0 +offset=0 +for filename in "$@"; do + index=0 + { + IFS= read -r # 1..n + while IFS= read -r line; do + case "$line" in + "begin "* ) + let index+=1 + echo "${line/ $index / $(($offset + $index)) }" + ;; + "ok "* | "not ok "* ) + [ -n "$extended_syntax_flag" ] || let index+=1 + echo "${line/ $index / $(($offset + $index)) }" + [ "${line:0:6}" != "not ok" ] || status=1 + ;; + * ) + echo "$line" + ;; + esac + done + } < <( bats-exec-test $extended_syntax_flag "$filename" ) + offset=$(($offset + $index)) +done + +exit "$status" diff --git a/tests/common/bats-0.4.0/libexec/bats-exec-test b/tests/common/bats-0.4.0/libexec/bats-exec-test new file mode 100755 index 0000000000..66680311c6 --- /dev/null +++ b/tests/common/bats-0.4.0/libexec/bats-exec-test @@ -0,0 +1,359 @@ +#!/usr/bin/env bash +set -e +set -E +set -T + +BATS_COUNT_ONLY="" +if [ "$1" = "-c" ]; then + BATS_COUNT_ONLY=1 + shift +fi + +BATS_EXTENDED_SYNTAX="" +if [ "$1" = "-x" ]; then + BATS_EXTENDED_SYNTAX="$1" + shift +fi + +BATS_TEST_FILENAME="$1" +if [ -z "$BATS_TEST_FILENAME" ]; then + echo "usage: bats-exec " >&2 + exit 1 +elif [ ! -f "$BATS_TEST_FILENAME" ]; then + echo "bats: $BATS_TEST_FILENAME does not exist" >&2 + exit 1 +else + shift +fi + +BATS_TEST_DIRNAME="$(dirname "$BATS_TEST_FILENAME")" +BATS_TEST_NAMES=() + +load() { + local name="$1" + local filename + + if [ "${name:0:1}" = "/" ]; then + filename="${name}" + else + filename="$BATS_TEST_DIRNAME/${name}.bash" + fi + + [ -f "$filename" ] || { + echo "bats: $filename does not exist" >&2 + exit 1 + } + + source "${filename}" +} + +run() { + local e E T + [[ ! "$-" =~ e ]] || e=1 + [[ ! "$-" =~ E ]] || E=1 + [[ ! "$-" =~ T ]] || T=1 + set +e + set +E + set +T + output="$("$@" 2>&1)" + status="$?" + IFS=$'\n' lines=($output) + [ -z "$e" ] || set -e + [ -z "$E" ] || set -E + [ -z "$T" ] || set -T +} + +setup() { + true +} + +teardown() { + true +} + +skip() { + BATS_TEST_SKIPPED=${1:-1} + BATS_TEST_COMPLETED=1 + exit 0 +} + +bats_test_begin() { + BATS_TEST_DESCRIPTION="$1" + if [ -n "$BATS_EXTENDED_SYNTAX" ]; then + echo "begin $BATS_TEST_NUMBER $BATS_TEST_DESCRIPTION" >&3 + fi + setup +} + +bats_test_function() { + local test_name="$1" + BATS_TEST_NAMES["${#BATS_TEST_NAMES[@]}"]="$test_name" +} + +bats_capture_stack_trace() { + BATS_PREVIOUS_STACK_TRACE=( "${BATS_CURRENT_STACK_TRACE[@]}" ) + BATS_CURRENT_STACK_TRACE=() + + local test_pattern=" $BATS_TEST_NAME $BATS_TEST_SOURCE" + local setup_pattern=" setup $BATS_TEST_SOURCE" + local teardown_pattern=" teardown $BATS_TEST_SOURCE" + + local frame + local index=1 + + while frame="$(caller "$index")"; do + BATS_CURRENT_STACK_TRACE["${#BATS_CURRENT_STACK_TRACE[@]}"]="$frame" + if [[ "$frame" = *"$test_pattern" || \ + "$frame" = *"$setup_pattern" || \ + "$frame" = *"$teardown_pattern" ]]; then + break + else + let index+=1 + fi + done + + BATS_SOURCE="$(bats_frame_filename "${BATS_CURRENT_STACK_TRACE[0]}")" + BATS_LINENO="$(bats_frame_lineno "${BATS_CURRENT_STACK_TRACE[0]}")" +} + +bats_print_stack_trace() { + local frame + local index=1 + local count="${#@}" + + for frame in "$@"; do + local filename="$(bats_trim_filename "$(bats_frame_filename "$frame")")" + local lineno="$(bats_frame_lineno "$frame")" + + if [ $index -eq 1 ]; then + echo -n "# (" + else + echo -n "# " + fi + + local fn="$(bats_frame_function "$frame")" + if [ "$fn" != "$BATS_TEST_NAME" ]; then + echo -n "from function \`$fn' " + fi + + if [ $index -eq $count ]; then + echo "in test file $filename, line $lineno)" + else + echo "in file $filename, line $lineno," + fi + + let index+=1 + done +} + +bats_print_failed_command() { + local frame="$1" + local status="$2" + local filename="$(bats_frame_filename "$frame")" + local lineno="$(bats_frame_lineno "$frame")" + + local failed_line="$(bats_extract_line "$filename" "$lineno")" + local failed_command="$(bats_strip_string "$failed_line")" + echo -n "# \`${failed_command}' " + + if [ $status -eq 1 ]; then + echo "failed" + else + echo "failed with status $status" + fi +} + +bats_frame_lineno() { + local frame="$1" + local lineno="${frame%% *}" + echo "$lineno" +} + +bats_frame_function() { + local frame="$1" + local rest="${frame#* }" + local fn="${rest%% *}" + echo "$fn" +} + +bats_frame_filename() { + local frame="$1" + local rest="${frame#* }" + local filename="${rest#* }" + + if [ "$filename" = "$BATS_TEST_SOURCE" ]; then + echo "$BATS_TEST_FILENAME" + else + echo "$filename" + fi +} + +bats_extract_line() { + local filename="$1" + local lineno="$2" + sed -n "${lineno}p" "$filename" +} + +bats_strip_string() { + local string="$1" + printf "%s" "$string" | sed -e "s/^[ "$'\t'"]*//" -e "s/[ "$'\t'"]*$//" +} + +bats_trim_filename() { + local filename="$1" + local length="${#BATS_CWD}" + + if [ "${filename:0:length+1}" = "${BATS_CWD}/" ]; then + echo "${filename:length+1}" + else + echo "$filename" + fi +} + +bats_debug_trap() { + if [ "$BASH_SOURCE" != "$1" ]; then + bats_capture_stack_trace + fi +} + +bats_error_trap() { + BATS_ERROR_STATUS="$?" + BATS_ERROR_STACK_TRACE=( "${BATS_PREVIOUS_STACK_TRACE[@]}" ) + trap - debug +} + +bats_teardown_trap() { + trap "bats_exit_trap" exit + local status=0 + teardown >>"$BATS_OUT" 2>&1 || status="$?" + + if [ $status -eq 0 ]; then + BATS_TEARDOWN_COMPLETED=1 + elif [ -n "$BATS_TEST_COMPLETED" ]; then + BATS_ERROR_STATUS="$status" + BATS_ERROR_STACK_TRACE=( "${BATS_CURRENT_STACK_TRACE[@]}" ) + fi + + bats_exit_trap +} + +bats_exit_trap() { + local status + local skipped + trap - err exit + + skipped="" + if [ -n "$BATS_TEST_SKIPPED" ]; then + skipped=" # skip" + if [ "1" != "$BATS_TEST_SKIPPED" ]; then + skipped+=" ($BATS_TEST_SKIPPED)" + fi + fi + + if [ -z "$BATS_TEST_COMPLETED" ] || [ -z "$BATS_TEARDOWN_COMPLETED" ]; then + echo "not ok $BATS_TEST_NUMBER $BATS_TEST_DESCRIPTION" >&3 + bats_print_stack_trace "${BATS_ERROR_STACK_TRACE[@]}" >&3 + bats_print_failed_command "${BATS_ERROR_STACK_TRACE[${#BATS_ERROR_STACK_TRACE[@]}-1]}" "$BATS_ERROR_STATUS" >&3 + sed -e "s/^/# /" < "$BATS_OUT" >&3 + status=1 + else + echo "ok ${BATS_TEST_NUMBER}${skipped} ${BATS_TEST_DESCRIPTION}" >&3 + status=0 + fi + + rm -f "$BATS_OUT" + exit "$status" +} + +bats_perform_tests() { + echo "1..$#" + test_number=1 + status=0 + for test_name in "$@"; do + # john.a.westlund@intel.com -- enable millisecond timing + if [ -n "$BATS_ENABLE_TIMING" ]; then + TIMEFORMAT=' duration_ms: %3R' + { time "$0" $BATS_EXTENDED_SYNTAX "$BATS_TEST_FILENAME" "$test_name" "$test_number"; } 2>&1 || status=1 + else + "$0" $BATS_EXTENDED_SYNTAX "$BATS_TEST_FILENAME" "$test_name" "$test_number" || status=1 + fi + let test_number+=1 + done + exit "$status" +} + +bats_perform_test() { + BATS_TEST_NAME="$1" + if [ "$(type -t "$BATS_TEST_NAME" || true)" = "function" ]; then + BATS_TEST_NUMBER="$2" + if [ -z "$BATS_TEST_NUMBER" ]; then + echo "1..1" + BATS_TEST_NUMBER="1" + fi + + BATS_TEST_COMPLETED="" + BATS_TEARDOWN_COMPLETED="" + trap "bats_debug_trap \"\$BASH_SOURCE\"" debug + trap "bats_error_trap" err + trap "bats_teardown_trap" exit + "$BATS_TEST_NAME" >>"$BATS_OUT" 2>&1 + BATS_TEST_COMPLETED=1 + + else + echo "bats: unknown test name \`$BATS_TEST_NAME'" >&2 + exit 1 + fi +} + +# john.a.westlund@intel.com +# if the BATS_MKTEMP_DIR is exported from BATS use it, BATS should set this if the -T +# option is passed or the BATS_USE_MKTEMP variable is exported by the shell +# this should prevent collisions of temp files based on PIDs, especially when multiple +# people are running tests +if [ -z "$BATS_MKTEMP_DIR" ]; then + if [ -z "$TMPDIR" ]; then + BATS_TMPDIR="/tmp" + else + BATS_TMPDIR="${TMPDIR%/}" + fi +else + BATS_TMPDIR="$BATS_MKTEMP_DIR" +fi + +BATS_TMPNAME="$BATS_TMPDIR/bats.$$" +BATS_PARENT_TMPNAME="$BATS_TMPDIR/bats.$PPID" +BATS_OUT="${BATS_TMPNAME}.out" + +bats_preprocess_source() { + BATS_TEST_SOURCE="${BATS_TMPNAME}.src" + { tr -d '\r' < "$BATS_TEST_FILENAME"; echo; } | bats-preprocess > "$BATS_TEST_SOURCE" + trap "bats_cleanup_preprocessed_source" err exit + trap "bats_cleanup_preprocessed_source; exit 1" int +} + +bats_cleanup_preprocessed_source() { + rm -f "$BATS_TEST_SOURCE" +} + +bats_evaluate_preprocessed_source() { + if [ -z "$BATS_TEST_SOURCE" ]; then + BATS_TEST_SOURCE="${BATS_PARENT_TMPNAME}.src" + fi + source "$BATS_TEST_SOURCE" +} + +exec 3<&1 + +if [ "$#" -eq 0 ]; then + bats_preprocess_source + bats_evaluate_preprocessed_source + + if [ -n "$BATS_COUNT_ONLY" ]; then + echo "${#BATS_TEST_NAMES[@]}" + else + bats_perform_tests "${BATS_TEST_NAMES[@]}" + fi +else + bats_evaluate_preprocessed_source + bats_perform_test "$@" +fi diff --git a/tests/common/bats-0.4.0/libexec/bats-format-tap-stream b/tests/common/bats-0.4.0/libexec/bats-format-tap-stream new file mode 100755 index 0000000000..abab17c18a --- /dev/null +++ b/tests/common/bats-0.4.0/libexec/bats-format-tap-stream @@ -0,0 +1,170 @@ +#!/usr/bin/env bash +set -e + +# Just stream the TAP output (sans extended syntax) if tput is missing +command -v tput >/dev/null || exec grep -v "^begin " + +header_pattern='[0-9]+\.\.[0-9]+' +IFS= read -r header + +if [[ "$header" =~ $header_pattern ]]; then + count="${header:3}" + index=0 + failures=0 + skipped=0 + name="" + count_column_width=$(( ${#count} * 2 + 2 )) +else + # If the first line isn't a TAP plan, print it and pass the rest through + printf "%s\n" "$header" + exec cat +fi + +update_screen_width() { + screen_width="$(tput cols)" + count_column_left=$(( $screen_width - $count_column_width )) +} + +trap update_screen_width WINCH +update_screen_width + +begin() { + go_to_column 0 + printf_with_truncation $(( $count_column_left - 1 )) " %s" "$name" + clear_to_end_of_line + go_to_column $count_column_left + printf "%${#count}s/${count}" "$index" + go_to_column 1 +} + +pass() { + go_to_column 0 + printf " ✓ %s" "$name" + advance +} + +skip() { + local reason="$1" + [ -z "$reason" ] || reason=": $reason" + go_to_column 0 + printf " - %s (skipped%s)" "$name" "$reason" + advance +} + +fail() { + go_to_column 0 + set_color 1 bold + printf " ✗ %s" "$name" + advance +} + +log() { + set_color 1 + printf " %s\n" "$1" + clear_color +} + +summary() { + printf "\n%d test%s" "$count" "$(plural "$count")" + + printf ", %d failure%s" "$failures" "$(plural "$failures")" + + if [ "$skipped" -gt 0 ]; then + printf ", %d skipped" "$skipped" + fi + + printf "\n" +} + +printf_with_truncation() { + local width="$1" + shift + local string="$(printf "$@")" + + if [ "${#string}" -gt "$width" ]; then + printf "%s..." "${string:0:$(( $width - 4 ))}" + else + printf "%s" "$string" + fi +} + +go_to_column() { + local column="$1" + printf "\x1B[%dG" $(( $column + 1 )) +} + +clear_to_end_of_line() { + printf "\x1B[K" +} + +advance() { + clear_to_end_of_line + echo + clear_color +} + +set_color() { + local color="$1" + local weight="$2" + printf "\x1B[%d;%dm" $(( 30 + $color )) "$( [ "$weight" = "bold" ] && echo 1 || echo 22 )" +} + +clear_color() { + printf "\x1B[0m" +} + +plural() { + [ "$1" -eq 1 ] || echo "s" +} + +_buffer="" + +buffer() { + _buffer="${_buffer}$("$@")" +} + +flush() { + printf "%s" "$_buffer" + _buffer="" +} + +finish() { + flush + if [ -z $BATS_NO_SUMMARY ];then + printf "\n" + fi +} + + +trap finish EXIT + +while IFS= read -r line; do + case "$line" in + "begin "* ) + let index+=1 + name="${line#* $index }" + buffer begin + flush + ;; + "ok "* ) + skip_expr="ok $index # skip (\(([^)]*)\))?" + if [[ "$line" =~ $skip_expr ]]; then + let skipped+=1 + buffer skip "${BASH_REMATCH[2]}" + else + buffer pass + fi + ;; + "not ok "* ) + let failures+=1 + buffer fail + ;; + "# "* ) + buffer log "${line:2}" + ;; + esac +done + +if [ -z $BATS_NO_SUMMARY ];then + buffer summary +fi diff --git a/tests/common/bats-0.4.0/libexec/bats-preprocess b/tests/common/bats-0.4.0/libexec/bats-preprocess new file mode 100755 index 0000000000..04297ed019 --- /dev/null +++ b/tests/common/bats-0.4.0/libexec/bats-preprocess @@ -0,0 +1,52 @@ +#!/usr/bin/env bash +set -e + +encode_name() { + local name="$1" + local result="test_" + + if [[ ! "$name" =~ [^[:alnum:]\ _-] ]]; then + name="${name//_/-5f}" + name="${name//-/-2d}" + name="${name// /_}" + result+="$name" + else + local length="${#name}" + local char i + + for ((i=0; i\n"; +} + +my $time_count = 0; +my @durations; + +open INPUT, "<$opt_i"; + +my @input = ; + +close INPUT; + +my $skipflag; + +for (@input) { + if (/\/ ) { undef $skipflag; } + next if defined $skipflag; + $time_count++ if (/time="0"/); + if (/duration_ms: ([0-9]+\.[0-9]+)/) { + push @durations, $1; + } + # if there was an error there will be duration lines in the stanrd-out/standard-error sections that duplicates the previous input + # last if (//); +} + +# 0 base time_count like arrays, and add one to the durations count for the total time we're going to prepend +if ($time_count-1 ne $#durations+1) { + my $duration_count=$#durations+1; + die "$0: Number of time lines[$time_count] (excluding initial total time line) doesn't match number of durations lines[$duration_count]\n"; +} + +my $total_duration = 0; +$total_duration += $_ for @durations; + +unshift @durations, $total_duration; + +for (@input) { + if (/time="0"/) { + my $duration = shift @durations; + s/time="0"/time="$duration"/; + } + # last if (//); +} + +open OUTPUT, ">$opt_i"; + +for (@input) { print OUTPUT $_; } + +close OUTPUT; diff --git a/tests/common/bats-0.4.0/libexec/tap-to-junit-xml b/tests/common/bats-0.4.0/libexec/tap-to-junit-xml new file mode 100755 index 0000000000..cce37b738a --- /dev/null +++ b/tests/common/bats-0.4.0/libexec/tap-to-junit-xml @@ -0,0 +1,542 @@ +#!/usr/bin/perl +=head1 NAME +tap-to-junit-xml - convert perl-style TAP test output to JUnit-style XML +=head1 SYNOPSIS +tap-to-junit-xml [--help|--man] + [--[no]hidesummary] + [--input ] + [--output ] + [--cmt] + [--puretap] + [] [outputprefix] +=head1 DESCRIPTION +Parse test suite output in TAP (Test Anything Protocol, +C) format, and produce XML output in a similar format +to that produced by the ant task. This is useful for consumption by +continuous-integration systems like Hudson (C). +C<"test suite name"> is a descriptive string used as the B attribute on the +top-level node of the output XML. Defaults to "make test". +If C is specified, multi-file output will be generated, with +multiple XML files created using C as the start of their +filenames. The files are separated by testplan. This option is ignored +if --puretap is specified (TAP only allows one testplan per input file). +This prefix may contain slashes, in which case the files will be +placed into a directory hierarchy accordingly (although care should be taken to +ensure these directories exist in advance). +If --input I is not specified, STDIN will be read. +If C or --output is not specified, a single XML file will be +generated on STDOUT. +--output I is used to write a single XML file to I. +--puretap parses a single TAP source and handles parse errors and directives +(todo, skip, bailout). --puretap ignores unknown (non-TAP) input. Without +--puretap, the script will parse some additional non-TAP test input, such as +Perl tests that can include a "Test Summary Report", but it won't generate +correct XML unless the TAP testplan comes before the test cases. +--hidesummary report (the default) will hide the summary report, --no-hidesummary +will display it (neither has an effect when --puretap is specified). +=head1 EXAMPLE + prove -v 2>&1 | tee tests.log + tap-to-junit-xml "make test" testxml/tests < tests.log +(JUnit-formatted XML is now in "testxml/tests*.xml".) +=head1 DEPENDENCIES + Getopt::Long + Pod::Usage + TAP::Parser + Time::HiRes + XML::Generator +=head1 BUGS + - Output is optimized for Hudson, and may not look quite as good in + other UIs. + - Doesn't do anything with the STDERR from tests. + - Doesn't fill in the 'errors' attribute in the element. + (--puretap handles parse errors) + - Doesn't handle "todo" or "skip" (--puretap does) + - Doesn't get the elapsed time for each 'test' (i.e. assertion.) + (TAP output has no elapsed time convention). +=head1 SOURCE +http://github.com/jmason/tap-to-junit-xml/tree/master +=head1 AUTHOR +original, junit_xml.pl, by Matisse Enzer ; see +C. +pretty much entirely rewritten by Justin Mason , Feb 2008. +Miscellaneous fixes and mods (--puretap) by Jascha Lee , Mar 2009. +=head1 VERSION + Mar 27 2008 jm + Mar 17 2009 jl +=head1 COPYRIGHT & LICENSE +Copyright (c) 2007 Matisse Enzer. All Rights Reserved. +This program is free software; you can redistribute it and/or modify it +under the same terms as Perl itself. +=cut + +use strict; +use warnings; + +use FindBin qw($Bin); +use lib "$Bin"; +use XML::Generator; + +use Getopt::Long qw(:config no_ignore_case); +use Pod::Usage; +use TAP::Parser; +use Time::HiRes qw(gettimeofday tv_interval); +use Cwd; +use File::Basename; +#use XML::Generator qw(:noimport); + +my %opts; +pod2usage() unless GetOptions( \%opts, 'help|h', + 'hidesummary!', + 'input=s', + 'man', + 'output=s', + 'cmt', + 'puretap' + ); + +pod2usage(-verbose => 1) if defined $opts{'help'}; +pod2usage(-verbose => 2) if defined $opts{'man'}; + +my $opt_suitename = shift @ARGV; +my $opt_multifile = 0; +my $opt_mfprefix; + +if (defined $ARGV[0]) { + $opt_multifile = 1; + $opt_mfprefix = $ARGV[0]; +} + +# should the 'Test Summary Report' at the end of a test suite be displayed +# as if it was a testcase? in my opinion, no +my $HIDE_TEST_SUMMARY_REPORT = defined $opts{'hidesummary'} ? $opts{'hidesummary'} : 1; + +my $suite_name = $opt_suitename || 'make test'; +my $safe_suite_name = $suite_name; $safe_suite_name =~ s/[^-:_A-Za-z0-9]+/_/gs; + +# TODO: it'd be nice to respect 'Universal desirable behavior #1' from +# http://testanything.org/wiki/index.php/TAP_Consumers -- 'Should work on the +# TAP as a stream (ie. as each line is received) rather than wait until all the +# TAP is received'. But it seems TAP::Parser itself doesn't support it! +# maybe when TAP::Parser does that, we'll do it too. +my $tapfh; +if ( defined $opts{'input'} ) { + open $tapfh, '<', $opts{'input'} or die "Can't open TAP file '$opts{'input'}': $!\n"; +} +else { + $tapfh = \*STDIN; +} + +my $outfh; +if ( defined $opts{'output'} ) { + open $outfh, '>', $opts{'output'} or die "Can't open output file '$opts{'output'}' for writing: $!\n"; +} +else { + $outfh = \*STDOUT; +} + +my $tap = TAP::Parser->new( { source => $tapfh } ); +my $xmlgen = XML::Generator->new( ':pretty'); +my $xmlgenunescaped = XML::Generator->new( escape => 'unescaped', + conformance => 'strict', + pretty => 2 + ); +my @properties = _get_properties($xmlgen); +if ( defined $opts{'puretap'} ) { + # + # Instead of trying to parse everything in one pass, which fails if the + # testplan is last, parse through the results for the test cases and + # then construct the information from the TAP and wrap it + # around the test cases. Ignore 'unknown' information. [JL] + # + my @testcases = _parse_testcases( $tap, $xmlgen ); + errorOut( $tap, $xmlgen ) if $tap->parse_errors; + print $outfh $xmlgen->testsuites( + $xmlgen->testsuite( { name => $safe_suite_name, + tests => $tap->tests_planned, + failures => scalar $tap->failed, + errors => 0, + time => 0, + id => 1 }, + @testcases )); + +} +else { + my $test_results = _parse_tests( $tap, $xmlgen ); + if ($opt_multifile) { + _gen_junit_multifile_xml( $xmlgen, \@properties, $test_results ); + } else { + print $outfh _get_junit_xml( $xmlgen, \@properties, $test_results ); + } +} +exit; + +#------------------------------------------------------------------------------- + +sub _get_junit_xml { + my ( $xmlgen, $properties, $test_results ) = @_; + my $xml = "\n" . + $xmlgen->testsuites({ + name => $suite_name, + }, @$test_results); + return $xml; +} + +sub _gen_junit_multifile_xml { + my ( $xmlgen, $properties, $test_results ) = @_; + my $count = 1; + foreach my $testsuite (@$test_results) { + open OUT, ">${opt_mfprefix}.${count}.xml" + or die "cannot write ${opt_mfprefix}.${count}.xml"; + print OUT "\n"; + print OUT $testsuite; + close OUT; + $count++; + } +} + +# +# Wrap up parse errors and output them as test cases. +# +sub errorOut { + my $parser = shift; + my $xmlgen = shift; + die "errorOut() needs some args" unless $parser and $xmlgen; + my ($xml, @errors, $name); + my $count = 1; + foreach my $error ( $parser->parse_errors ) { + $name = sprintf "%s%02d", 'Error_', $count++; + $xml = $xmlgen->testcase( { name => $name, + classname => 'TestsNotRun.ParseError', + time => 0 }, + + $xmlgen->error( { type => 'TAPParseError', + message => $error } )); + push @errors, $xml; + } + print $outfh $xmlgen->testsuites( + $xmlgen->testsuite( { name => 'TestsNotRun.ParseError', + tests => $tap->tests_planned, + failures => 0, + errors => scalar $tap->parse_errors, + time => 0, + id => 1 }, + @errors )); + exit 86; +} + +# +# Construct an array of XML'd test cases +# +sub _parse_testcases { + my $parser = shift; + my $xmlgen = shift; + return () unless $parser and $xmlgen; + my ($name, $directive, $xml, @testcases); + + while ( my $result = $parser->next ) { + if ( $result->is_bailout ) { + $xml = $xmlgen->testcase( { name => 'BailOut', + classname => "$safe_suite_name.Tests", + time => 0 }, + + $xmlgen->error( { type => 'BailOut', + message => $result->explanation } )); + + push @testcases, $xml; + last; + } + next unless $result->is_test; + $directive = $result->directive; + $name = sprintf "%s%02d", 'Test_', $result->number; + $name .= "_$directive" if $directive; + if ( $result->is_ok ) { + $xml = $xmlgen->testcase( { name => $name, + classname => "$safe_suite_name.Tests", + time => 0 } ); + push @testcases, $xml; + } + else { + $xml = $xmlgen->testcase( { name => $name, + classname => "$safe_suite_name.Tests", + time => 0 }, + $xmlgen->failure( { type => 'TAPTestFailed', + message => $result->as_string } )); + push @testcases, $xml; + } + } + + return @testcases; +} + +sub _parse_tests { + my ( $parser, $xmlgen ) = @_; + + my $ctx = { + testsuites => [ ], + test_name => 'notest', + plan_ntests => 0, + case_id => 0, + }; + + _new_ctx($ctx); + + my $lastunk = ''; + + # unknown t/basic_lint......... + # plan 1..1 + # comment # Running under perl version 5.008008 for linux + # comment # Current time local: Thu Jan 24 17:44:30 2008 + # comment # Current time GMT: Thu Jan 24 17:44:30 2008 + # comment # Using Test.pm version 1.25 + # unknown /usr/bin/perl -T -w ../spamassassin.raw -C log/test_rules_copy --siteconfigpath log/localrules.tmp -p log/test_default.cf -L --lint + # unknown Checking anything + # test ok 1 + # test ok 2 + # unknown t/basic_meta......... + # plan 1..2 + # comment # Running under perl version 5.008008 for linux + # comment # Current time local: Thu Jan 24 17:44:31 2008 + # comment # Current time GMT: Thu Jan 24 17:44:31 2008 + # comment # Using Test.pm version 1.25 + # test not ok 1 + # comment # Failed test 1 in t/basic_meta.t at line 91 + # test ok 2 + # unknown Failed 1/2 subtests + # unknown t/basic_obj_api...... + # plan 1..4 + # comment # Running under perl version 5.008008 for linux + # comment # Current time local: Thu Jan 24 17:44:33 2008 + # comment # Current time GMT: Thu Jan 24 17:44:33 2008 + # comment # Using Test.pm version 1.25 + # test ok 1 + # test ok 2 + # test ok 3 + # test ok 4 + # test ok 9 + # unknown + # unknown Test Summary Report + # unknown ------------------- + # unknown t/basic_meta.t (Wstat: 0 Tests: 2 Failed: 1) + # unknown Failed test: 1 + # unknown Files=3, Tests=7, 6 wallclock secs ( 0.01 usr 0.00 sys + 4.39 cusr 0.23 csys = 4.63 CPU) + # unknown Result: FAIL + # unknown Failed 1/3 test programs. 1/7 subtests failed. + # unknown make: *** [test_dynamic] Error 255 + + while ( my $r = $parser->next ) { + + my $t = $r->type; + my $s = $r->as_string; $s =~ s/\s+$//; + + # warn "JMD $t $s"; + + if ($t eq 'unknown') { + $lastunk = $s; + + # PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(1, 'blib/lib', 'blib/arch')" t/basic_* + # if ($s =~ /test_harness\(.*?\)" (.+)$/) { + # $suite_name = $1; + # } + if ($s =~ /^Test Summary Report$/) { + # create a block for the summary + $ctx->{plan_ntests} = 0; + $ctx->{test_name} = "Test Summary Report"; + $ctx->{case_tests} = 1; + _finish_test_block($ctx); + } + elsif ($s =~ /^Result: FAIL$/) { + $ctx->{case_tests}++; + $ctx->{case_failures}++; + my $test_case = { + classname => test_name_to_classname($ctx->{test_name}), + name => 'result', + 'time' => 0, + }; + my $failure = $xmlgen->failure({ + type => "OverallTestsFailed", + message => $s + }, "__FAILUREMESSAGETODO__"); + + if (!$HIDE_TEST_SUMMARY_REPORT) { + push @{$ctx->{test_cases}}, $xmlgen->testcase($test_case, $failure); + } + } + elsif ($s =~ /^(\S+?)\.\.\.+1\.\.(\d+?)\s*$/) { + # perl 5.6.x "Test" format plan line + # unknown t/basic_lint....................1..1 + + my ($name, $nt) = ($1,$2); + if ($ctx->{plan_ntests}) { # only if there have been tests planned + _finish_test_block($ctx); + } + + $ctx->{plan_ntests} = $nt+0; + $ctx->{test_name} = "$name.t"; + } + } + elsif ($t eq 'plan') { + if ($ctx->{plan_ntests}) { # only if there have been tests planned + _finish_test_block($ctx); + } + + $ctx->{plan_ntests} = 0; + $s =~ /(\d+)$/ and $ctx->{plan_ntests} = $1+0; + + $ctx->{test_name} = $lastunk; + $ctx->{test_name} =~ s/\.*\s*$//gs; + $ctx->{test_name} .= ".t"; + } + elsif ($t eq 'test') { + my $ntest = 0; + if ($s =~ /(?:not |)\S+ (\d+)/) { $ntest = $1+0; } + + if ($ntest > $ctx->{plan_ntests}) { + # jump in test numbers, more than planned; this is probably TAP::Parser's wierdness. + # (when it sees the "ok" line at the end of a test case with no number, + # it outputs the current total number of tests so far.) + next; + } + + # clean this up in a Hudson-compatible way; ":" and "/" are out, "." also causes + # trouble by creating an extra "directory" in the results + + my $pname = basename(getcwd()); + if ( defined $ENV{'BATS_JUNIT_CLASS'}) { + $pname = $ENV{'BATS_JUNIT_CLASS'}; + } + + my $test_case; + + if ( defined $opts{'cmt'} ) { + $test_case = { + classname => sprintf("%s.%s",$safe_suite_name,$pname), + name => sprintf("%s",$r->description), + 'time' => 0, + }; + } else { + $test_case = { + classname => test_name_to_classname($ctx->{test_name}), + name => sprintf("test %6d", $ntest), # space-padding ensures ordering + 'time' => 0, + }; + } + + $ctx->{case_tests}++; + my $failure = undef; + if ($s =~ /^not /i) { + $ctx->{case_failures}++; + $failure = $xmlgen->failure({ + type => "TAPTestFailed", + message => $s + }, "__FAILUREMESSAGETODO__"); + push @{$ctx->{test_cases}}, $xmlgen->testcase($test_case, $failure); + } + else { + push @{$ctx->{test_cases}}, $xmlgen->testcase($test_case); + } + } + + $ctx->{sysout} .= $s."\n"; + } + + if (scalar(@{$ctx->{test_cases}}) == 0 && + scalar(@{$ctx->{testsuites}}) == 0) + { + # no tests found! create a block containing *something* at least + $ctx->{case_tests}++; + my $test_case = { + classname => test_name_to_classname($ctx->{test_name}), + name => 'result', + 'time' => 0, + }; + push @{$ctx->{test_cases}}, $xmlgen->testcase($test_case); + } + + _finish_test_block($ctx); + return $ctx->{testsuites}; +} + +sub _new_ctx { + my $ctx = shift; + $ctx->{start_time} = [gettimeofday]; + $ctx->{test_cases} = []; + $ctx->{case_tests} = 0; + $ctx->{case_failures} = 0; + $ctx->{case_time} = 0; + $ctx->{case_id}++; + $ctx->{sysout} = ''; + return $ctx; +} + +sub _finish_test_block { + my $ctx = shift; + $ctx->{sysout} =~ s/\n\S+\.*\s*\n$/\n/s; # remove next test's "t/foo....." line + + my $elapsed_time = 0; # TODO + #my $elapsed_time = tv_interval( $ctx->{start_time}, [gettimeofday] ); + + # clean it up to valid Java packagename format (or at least something Hudson will + # consume) + my $name = $ctx->{test_name}; + $name =~ s/[^-:_A-Za-z0-9]+/_/gs; + $name = "$safe_suite_name.$name"; # a "directory" for the suite name + + my $testsuite = { + 'time' => $elapsed_time, + 'name' => $name, + tests => $ctx->{case_tests}, + failures => $ctx->{case_failures}, + 'id' => $ctx->{case_id}, + errors => 0, + }; + + my @fixedcases = (); + foreach my $tc (@{$ctx->{test_cases}}) { + if ($tc =~ s/__FAILUREMESSAGETODO__/ cdata($ctx->{sysout}) /ges) { + push @fixedcases, \$tc; # inhibits escaping! + } else { + push @fixedcases, $tc; + } + } + + # use "unescaped"; we have already fixed escaping on these strings. + # note that a reference means 'this is unescaped', bizarrely. + push @{$ctx->{testsuites}}, $xmlgenunescaped->testsuite($testsuite, + @fixedcases, + \("\n".cdata($ctx->{sysout})."\n"), + \("")); + + _new_ctx($ctx); +}; + +sub cdata { + my $s = shift; + $s =~ s/\]\]>/\](warning: defanged by tap-to-junit-xml)\]>/gs; + return ''; +} + +sub _get_properties { + my $xmlgen = shift; + my @props; + foreach my $key ( sort keys %ENV ) { + push @props, $xmlgen->property( { name => "$key", value => $ENV{$key} } ); + } + return @props; +} + +sub test_name_to_classname { + my $safe = shift; + $safe =~ s/[^-:_A-Za-z0-9]+/_/gs; + $safe = "$safe_suite_name.$safe"; # a "directory" for the suite name + $safe; +} + +__END__ + +# JUnit references: +# http://www.nabble.com/JUnit-4-XML-schematized--td13946472.html +# http://jra1mw.cvs.cern.ch:8180/cgi-bin/jra1mw.cgi/org.glite.testing.unit/config/JUnitXSchema.xsd?view=markup +# skipped tests: +# https://hudson.dev.java.net/issues/show_bug.cgi?id=1251 +# Hudson source: +# http://fisheye5.cenqua.com/browse/hudson/hudson/main/core/src/main/java/hudson/tasks/junit/CaseResult.java diff --git a/tests/common/bats-0.4.0/man/README.md b/tests/common/bats-0.4.0/man/README.md new file mode 100644 index 0000000000..8c561c75d7 --- /dev/null +++ b/tests/common/bats-0.4.0/man/README.md @@ -0,0 +1,5 @@ +Bats man pages are generated with [Ronn](http://rtomayko.github.io/ronn/). + +After making changes to `bats.1.ronn` or `bats.7.ronn`, run `make` in +this directory to generate `bats.1` and `bats.7`. **Do not edit the +`bats.1` or `bats.7` files directly.** diff --git a/tests/common/bats-0.4.0/man/bats.1 b/tests/common/bats-0.4.0/man/bats.1 new file mode 100644 index 0000000000..82f7301652 --- /dev/null +++ b/tests/common/bats-0.4.0/man/bats.1 @@ -0,0 +1,101 @@ +.\" generated with Ronn/v0.7.3 +.\" http://github.com/rtomayko/ronn/tree/0.7.3 +. +.TH "BATS" "1" "August 2014" "" "" +. +.SH "NAME" +\fBbats\fR \- Bash Automated Testing System +. +.SH "SYNOPSIS" +bats [\-c] [\-p | \-t] \fItest\fR [\fItest\fR \.\.\.] +. +.P +\fItest\fR is the path to a Bats test file, or the path to a directory containing Bats test files\. +. +.SH "DESCRIPTION" +Bats is a TAP\-compliant testing framework for Bash\. It provides a simple way to verify that the UNIX programs you write behave as expected\. +. +.P +A Bats test file is a Bash script with special syntax for defining test cases\. Under the hood, each test case is just a function with a description\. +. +.P +Test cases consist of standard shell commands\. Bats makes use of Bash\'s \fBerrexit\fR (\fBset \-e\fR) option when running test cases\. If every command in the test case exits with a \fB0\fR status code (success), the test passes\. In this way, each line is an assertion of truth\. +. +.P +See \fBbats\fR(7) for more information on writing Bats tests\. +. +.SH "RUNNING TESTS" +To run your tests, invoke the \fBbats\fR interpreter with a path to a test file\. The file\'s test cases are run sequentially and in isolation\. If all the test cases pass, \fBbats\fR exits with a \fB0\fR status code\. If there are any failures, \fBbats\fR exits with a \fB1\fR status code\. +. +.P +You can invoke the \fBbats\fR interpreter with multiple test file arguments, or with a path to a directory containing multiple \fB\.bats\fR files\. Bats will run each test file individually and aggregate the results\. If any test case fails, \fBbats\fR exits with a \fB1\fR status code\. +. +.SH "OPTIONS" +. +.TP +\fB\-c\fR, \fB\-\-count\fR +Count the number of test cases without running any tests +. +.TP +\fB\-h\fR, \fB\-\-help\fR +Display help message +. +.TP +\fB\-p\fR, \fB\-\-pretty\fR +Show results in pretty format (default for terminals) +. +.TP +\fB\-t\fR, \fB\-\-tap\fR +Show results in TAP format +. +.TP +\fB\-v\fR, \fB\-\-version\fR +Display the version number +. +.SH "OUTPUT" +When you run Bats from a terminal, you\'ll see output as each test is performed, with a check\-mark next to the test\'s name if it passes or an "X" if it fails\. +. +.IP "" 4 +. +.nf + +$ bats addition\.bats + ✓ addition using bc + ✓ addition using dc + +2 tests, 0 failures +. +.fi +. +.IP "" 0 +. +.P +If Bats is not connected to a terminal\-\-in other words, if you run it from a continuous integration system or redirect its output to a file\-\-the results are displayed in human\-readable, machine\-parsable TAP format\. You can force TAP output from a terminal by invoking Bats with the \fB\-\-tap\fR option\. +. +.IP "" 4 +. +.nf + +$ bats \-\-tap addition\.bats +1\.\.2 +ok 1 addition using bc +ok 2 addition using dc +. +.fi +. +.IP "" 0 +. +.SH "EXIT STATUS" +The \fBbats\fR interpreter exits with a value of \fB0\fR if all test cases pass, or \fB1\fR if one or more test cases fail\. +. +.SH "SEE ALSO" +Bats wiki: \fIhttps://github\.com/sstephenson/bats/wiki/\fR +. +.P +\fBbash\fR(1), \fBbats\fR(7) +. +.SH "COPYRIGHT" +(c) 2014 Sam Stephenson +. +.P +Bats is released under the terms of an MIT\-style license\. diff --git a/tests/common/bats-0.4.0/man/bats.1.ronn b/tests/common/bats-0.4.0/man/bats.1.ronn new file mode 100644 index 0000000000..bd8f45b519 --- /dev/null +++ b/tests/common/bats-0.4.0/man/bats.1.ronn @@ -0,0 +1,109 @@ +bats(1) -- Bash Automated Testing System +======================================== + + +SYNOPSIS +-------- + +bats [-c] [-p | -t] [ ...] + + is the path to a Bats test file, or the path to a directory +containing Bats test files. + + +DESCRIPTION +----------- + +Bats is a TAP-compliant testing framework for Bash. It provides a simple +way to verify that the UNIX programs you write behave as expected. + +A Bats test file is a Bash script with special syntax for defining +test cases. Under the hood, each test case is just a function with a +description. + +Test cases consist of standard shell commands. Bats makes use of +Bash's `errexit` (`set -e`) option when running test cases. If every +command in the test case exits with a `0` status code (success), the +test passes. In this way, each line is an assertion of truth. + +See `bats`(7) for more information on writing Bats tests. + + +RUNNING TESTS +------------- + +To run your tests, invoke the `bats` interpreter with a path to a test +file. The file's test cases are run sequentially and in isolation. If +all the test cases pass, `bats` exits with a `0` status code. If there +are any failures, `bats` exits with a `1` status code. + +You can invoke the `bats` interpreter with multiple test file arguments, +or with a path to a directory containing multiple `.bats` files. Bats +will run each test file individually and aggregate the results. If any +test case fails, `bats` exits with a `1` status code. + + +OPTIONS +------- + + * `-c`, `--count`: + Count the number of test cases without running any tests + * `-h`, `--help`: + Display help message + * `-p`, `--pretty`: + Show results in pretty format (default for terminals) + * `-t`, `--tap`: + Show results in TAP format + * `-v`, `--version`: + Display the version number + + +OUTPUT +------ + +When you run Bats from a terminal, you'll see output as each test is +performed, with a check-mark next to the test's name if it passes or +an "X" if it fails. + + $ bats addition.bats + ✓ addition using bc + ✓ addition using dc + + 2 tests, 0 failures + +If Bats is not connected to a terminal--in other words, if you run it +from a continuous integration system or redirect its output to a +file--the results are displayed in human-readable, machine-parsable +TAP format. You can force TAP output from a terminal by invoking Bats +with the `--tap` option. + + $ bats --tap addition.bats + 1..2 + ok 1 addition using bc + ok 2 addition using dc + + +EXIT STATUS +----------- + +The `bats` interpreter exits with a value of `0` if all test cases pass, +or `1` if one or more test cases fail. + + +SEE ALSO +-------- + +Bats wiki: _https://github.com/sstephenson/bats/wiki/_ + +`bash`(1), `bats`(7) + + +COPYRIGHT +--------- + +(c) 2014 Sam Stephenson + +Bats is released under the terms of an MIT-style license. + + + diff --git a/tests/common/bats-0.4.0/man/bats.7 b/tests/common/bats-0.4.0/man/bats.7 new file mode 100644 index 0000000000..d0836e525f --- /dev/null +++ b/tests/common/bats-0.4.0/man/bats.7 @@ -0,0 +1,178 @@ +.\" generated with Ronn/v0.7.3 +.\" http://github.com/rtomayko/ronn/tree/0.7.3 +. +.TH "BATS" "7" "November 2013" "" "" +. +.SH "NAME" +\fBbats\fR \- Bats test file format +. +.SH "DESCRIPTION" +A Bats test file is a Bash script with special syntax for defining test cases\. Under the hood, each test case is just a function with a description\. +. +.IP "" 4 +. +.nf + +#!/usr/bin/env bats + +@test "addition using bc" { + result="$(echo 2+2 | bc)" + [ "$result" \-eq 4 ] +} + +@test "addition using dc" { + result="$(echo 2 2+p | dc)" + [ "$result" \-eq 4 ] +} +. +.fi +. +.IP "" 0 +. +.P +Each Bats test file is evaluated n+1 times, where \fIn\fR is the number of test cases in the file\. The first run counts the number of test cases, then iterates over the test cases and executes each one in its own process\. +. +.SH "THE RUN HELPER" +Many Bats tests need to run a command and then make assertions about its exit status and output\. Bats includes a \fBrun\fR helper that invokes its arguments as a command, saves the exit status and output into special global variables, and then returns with a \fB0\fR status code so you can continue to make assertions in your test case\. +. +.P +For example, let\'s say you\'re testing that the \fBfoo\fR command, when passed a nonexistent filename, exits with a \fB1\fR status code and prints an error message\. +. +.IP "" 4 +. +.nf + +@test "invoking foo with a nonexistent file prints an error" { + run foo nonexistent_filename + [ "$status" \-eq 1 ] + [ "$output" = "foo: no such file \'nonexistent_filename\'" ] +} +. +.fi +. +.IP "" 0 +. +.P +The \fB$status\fR variable contains the status code of the command, and the \fB$output\fR variable contains the combined contents of the command\'s standard output and standard error streams\. +. +.P +A third special variable, the \fB$lines\fR array, is available for easily accessing individual lines of output\. For example, if you want to test that invoking \fBfoo\fR without any arguments prints usage information on the first line: +. +.IP "" 4 +. +.nf + +@test "invoking foo without arguments prints usage" { + run foo + [ "$status" \-eq 1 ] + [ "${lines[0]}" = "usage: foo " ] +} +. +.fi +. +.IP "" 0 +. +.SH "THE LOAD COMMAND" +You may want to share common code across multiple test files\. Bats includes a convenient \fBload\fR command for sourcing a Bash source file relative to the location of the current test file\. For example, if you have a Bats test in \fBtest/foo\.bats\fR, the command +. +.IP "" 4 +. +.nf + +load test_helper +. +.fi +. +.IP "" 0 +. +.P +will source the script \fBtest/test_helper\.bash\fR in your test file\. This can be useful for sharing functions to set up your environment or load fixtures\. +. +.SH "THE SKIP COMMAND" +Tests can be skipped by using the \fBskip\fR command at the point in a test you wish to skip\. +. +.IP "" 4 +. +.nf + +@test "A test I don\'t want to execute for now" { + skip + run foo + [ "$status" \-eq 0 ] +} +. +.fi +. +.IP "" 0 +. +.P +Optionally, you may include a reason for skipping: +. +.IP "" 4 +. +.nf + +@test "A test I don\'t want to execute for now" { + skip "This command will return zero soon, but not now" + run foo + [ "$status" \-eq 0 ] +} +. +.fi +. +.IP "" 0 +. +.P +Or you can skip conditionally: +. +.IP "" 4 +. +.nf + +@test "A test which should run" { + if [ foo != bar ]; then + skip "foo isn\'t bar" + fi + + run foo + [ "$status" \-eq 0 ] +} +. +.fi +. +.IP "" 0 +. +.SH "SETUP AND TEARDOWN FUNCTIONS" +You can define special \fBsetup\fR and \fBteardown\fR functions which run before and after each test case, respectively\. Use these to load fixtures, set up your environment, and clean up when you\'re done\. +. +.SH "CODE OUTSIDE OF TEST CASES" +You can include code in your test file outside of \fB@test\fR functions\. For example, this may be useful if you want to check for dependencies and fail immediately if they\'re not present\. However, any output that you print in code outside of \fB@test\fR, \fBsetup\fR or \fBteardown\fR functions must be redirected to \fBstderr\fR (\fB>&2\fR)\. Otherwise, the output may cause Bats to fail by polluting the TAP stream on \fBstdout\fR\. +. +.SH "SPECIAL VARIABLES" +There are several global variables you can use to introspect on Bats tests: +. +.IP "\(bu" 4 +\fB$BATS_TEST_FILENAME\fR is the fully expanded path to the Bats test file\. +. +.IP "\(bu" 4 +\fB$BATS_TEST_DIRNAME\fR is the directory in which the Bats test file is located\. +. +.IP "\(bu" 4 +\fB$BATS_TEST_NAMES\fR is an array of function names for each test case\. +. +.IP "\(bu" 4 +\fB$BATS_TEST_NAME\fR is the name of the function containing the current test case\. +. +.IP "\(bu" 4 +\fB$BATS_TEST_DESCRIPTION\fR is the description of the current test case\. +. +.IP "\(bu" 4 +\fB$BATS_TEST_NUMBER\fR is the (1\-based) index of the current test case in the test file\. +. +.IP "\(bu" 4 +\fB$BATS_TMPDIR\fR is the location to a directory that may be used to store temporary files\. +. +.IP "" 0 +. +.SH "SEE ALSO" +\fBbash\fR(1), \fBbats\fR(1) diff --git a/tests/common/bats-0.4.0/man/bats.7.ronn b/tests/common/bats-0.4.0/man/bats.7.ronn new file mode 100644 index 0000000000..7f6dd18481 --- /dev/null +++ b/tests/common/bats-0.4.0/man/bats.7.ronn @@ -0,0 +1,156 @@ +bats(7) -- Bats test file format +================================ + + +DESCRIPTION +----------- + +A Bats test file is a Bash script with special syntax for defining +test cases. Under the hood, each test case is just a function with a +description. + + #!/usr/bin/env bats + + @test "addition using bc" { + result="$(echo 2+2 | bc)" + [ "$result" -eq 4 ] + } + + @test "addition using dc" { + result="$(echo 2 2+p | dc)" + [ "$result" -eq 4 ] + } + + +Each Bats test file is evaluated n+1 times, where _n_ is the number of +test cases in the file. The first run counts the number of test cases, +then iterates over the test cases and executes each one in its own +process. + + +THE RUN HELPER +-------------- + +Many Bats tests need to run a command and then make assertions about +its exit status and output. Bats includes a `run` helper that invokes +its arguments as a command, saves the exit status and output into +special global variables, and then returns with a `0` status code so +you can continue to make assertions in your test case. + +For example, let's say you're testing that the `foo` command, when +passed a nonexistent filename, exits with a `1` status code and prints +an error message. + + @test "invoking foo with a nonexistent file prints an error" { + run foo nonexistent_filename + [ "$status" -eq 1 ] + [ "$output" = "foo: no such file 'nonexistent_filename'" ] + } + +The `$status` variable contains the status code of the command, and +the `$output` variable contains the combined contents of the command's +standard output and standard error streams. + +A third special variable, the `$lines` array, is available for easily +accessing individual lines of output. For example, if you want to test +that invoking `foo` without any arguments prints usage information on +the first line: + + @test "invoking foo without arguments prints usage" { + run foo + [ "$status" -eq 1 ] + [ "${lines[0]}" = "usage: foo " ] + } + + +THE LOAD COMMAND +---------------- + +You may want to share common code across multiple test files. Bats +includes a convenient `load` command for sourcing a Bash source file +relative to the location of the current test file. For example, if you +have a Bats test in `test/foo.bats`, the command + + load test_helper + +will source the script `test/test_helper.bash` in your test file. This +can be useful for sharing functions to set up your environment or load +fixtures. + + +THE SKIP COMMAND +---------------- + +Tests can be skipped by using the `skip` command at the point in a +test you wish to skip. + + @test "A test I don't want to execute for now" { + skip + run foo + [ "$status" -eq 0 ] + } + +Optionally, you may include a reason for skipping: + + @test "A test I don't want to execute for now" { + skip "This command will return zero soon, but not now" + run foo + [ "$status" -eq 0 ] + } + +Or you can skip conditionally: + + @test "A test which should run" { + if [ foo != bar ]; then + skip "foo isn't bar" + fi + + run foo + [ "$status" -eq 0 ] + } + + +SETUP AND TEARDOWN FUNCTIONS +---------------------------- + +You can define special `setup` and `teardown` functions which run +before and after each test case, respectively. Use these to load +fixtures, set up your environment, and clean up when you're done. + + +CODE OUTSIDE OF TEST CASES +-------------------------- + +You can include code in your test file outside of `@test` functions. +For example, this may be useful if you want to check for dependencies +and fail immediately if they're not present. However, any output that +you print in code outside of `@test`, `setup` or `teardown` functions +must be redirected to `stderr` (`>&2`). Otherwise, the output may +cause Bats to fail by polluting the TAP stream on `stdout`. + + +SPECIAL VARIABLES +----------------- + +There are several global variables you can use to introspect on Bats +tests: + +* `$BATS_TEST_FILENAME` is the fully expanded path to the Bats test +file. +* `$BATS_TEST_DIRNAME` is the directory in which the Bats test file is +located. +* `$BATS_TEST_NAMES` is an array of function names for each test case. +* `$BATS_TEST_NAME` is the name of the function containing the current +test case. +* `$BATS_TEST_DESCRIPTION` is the description of the current test +case. +* `$BATS_TEST_NUMBER` is the (1-based) index of the current test case +in the test file. +* `$BATS_TMPDIR` is the location to a directory that may be used to +store temporary files. + + +SEE ALSO +-------- + +`bash`(1), `bats`(1) diff --git a/tests/common/bats-0.4.0/package.json b/tests/common/bats-0.4.0/package.json new file mode 100644 index 0000000000..2183feb2ce --- /dev/null +++ b/tests/common/bats-0.4.0/package.json @@ -0,0 +1,9 @@ +{ + "name": "bats", + "version": "0.3.1", + "description": "Bash Automated Testing System", + "global": "true", + "install": "./install.sh /usr/local", + "scripts": [ "libexec/bats", "libexec/bats-exec-suite", "libexec/bats-exec-test", "libexec/bats-format-tap-stream", "libexec/bats-preprocess", "bin/bats" ] +} + diff --git a/tests/common/bats-0.4.0/test/bats.bats b/tests/common/bats-0.4.0/test/bats.bats new file mode 100755 index 0000000000..280515d284 --- /dev/null +++ b/tests/common/bats-0.4.0/test/bats.bats @@ -0,0 +1,258 @@ +#!/usr/bin/env bats + +load test_helper +fixtures bats + +@test "no arguments prints usage instructions" { + run bats + [ $status -eq 1 ] + [ $(expr "${lines[1]}" : "Usage:") -ne 0 ] +} + +@test "-v and --version print version number" { + run bats -v + [ $status -eq 0 ] + [ $(expr "$output" : "Bats [0-9][0-9.]*") -ne 0 ] +} + +@test "-h and --help print help" { + run bats -h + [ $status -eq 0 ] + [ "${#lines[@]}" -gt 3 ] +} + +@test "invalid filename prints an error" { + run bats nonexistent + [ $status -eq 1 ] + [ $(expr "$output" : ".*does not exist") -ne 0 ] +} + +@test "empty test file runs zero tests" { + run bats "$FIXTURE_ROOT/empty.bats" + [ $status -eq 0 ] + [ $output = "1..0" ] +} + +@test "one passing test" { + run bats "$FIXTURE_ROOT/passing.bats" + [ $status -eq 0 ] + [ ${lines[0]} = "1..1" ] + [ ${lines[1]} = "ok 1 a passing test" ] +} + +@test "summary passing tests" { + run filter_control_sequences bats -p $FIXTURE_ROOT/passing.bats + [ $status -eq 0 ] + [ "${lines[1]}" = "1 test, 0 failures" ] +} + +@test "summary passing and skipping tests" { + run filter_control_sequences bats -p $FIXTURE_ROOT/passing_and_skipping.bats + [ $status -eq 0 ] + [ "${lines[2]}" = "2 tests, 0 failures, 1 skipped" ] +} + +@test "summary passing and failing tests" { + run filter_control_sequences bats -p $FIXTURE_ROOT/failing_and_passing.bats + [ $status -eq 0 ] + [ "${lines[4]}" = "2 tests, 1 failure" ] +} + +@test "summary passing, failing and skipping tests" { + run filter_control_sequences bats -p $FIXTURE_ROOT/passing_failing_and_skipping.bats + [ $status -eq 0 ] + [ "${lines[5]}" = "3 tests, 1 failure, 1 skipped" ] +} + +@test "one failing test" { + run bats "$FIXTURE_ROOT/failing.bats" + [ $status -eq 1 ] + [ "${lines[0]}" = '1..1' ] + [ "${lines[1]}" = 'not ok 1 a failing test' ] + [ "${lines[2]}" = "# (in test file $RELATIVE_FIXTURE_ROOT/failing.bats, line 4)" ] + [ "${lines[3]}" = "# \`eval \"( exit \${STATUS:-1} )\"' failed" ] +} + +@test "one failing and one passing test" { + run bats "$FIXTURE_ROOT/failing_and_passing.bats" + [ $status -eq 1 ] + [ "${lines[0]}" = '1..2' ] + [ "${lines[1]}" = 'not ok 1 a failing test' ] + [ "${lines[2]}" = "# (in test file $RELATIVE_FIXTURE_ROOT/failing_and_passing.bats, line 2)" ] + [ "${lines[3]}" = "# \`false' failed" ] + [ "${lines[4]}" = 'ok 2 a passing test' ] +} + +@test "failing test with significant status" { + STATUS=2 run bats "$FIXTURE_ROOT/failing.bats" + [ $status -eq 1 ] + [ "${lines[3]}" = "# \`eval \"( exit \${STATUS:-1} )\"' failed with status 2" ] +} + +@test "failing helper function logs the test case's line number" { + run bats "$FIXTURE_ROOT/failing_helper.bats" + [ $status -eq 1 ] + [ "${lines[1]}" = 'not ok 1 failing helper function' ] + [ "${lines[2]}" = "# (from function \`failing_helper' in file $RELATIVE_FIXTURE_ROOT/test_helper.bash, line 6," ] + [ "${lines[3]}" = "# in test file $RELATIVE_FIXTURE_ROOT/failing_helper.bats, line 5)" ] + [ "${lines[4]}" = "# \`failing_helper' failed" ] +} + +@test "test environments are isolated" { + run bats "$FIXTURE_ROOT/environment.bats" + [ $status -eq 0 ] +} + +@test "setup is run once before each test" { + rm -f "$TMP/setup.log" + run bats "$FIXTURE_ROOT/setup.bats" + [ $status -eq 0 ] + run cat "$TMP/setup.log" + [ ${#lines[@]} -eq 3 ] +} + +@test "teardown is run once after each test, even if it fails" { + rm -f "$TMP/teardown.log" + run bats "$FIXTURE_ROOT/teardown.bats" + [ $status -eq 1 ] + run cat "$TMP/teardown.log" + [ ${#lines[@]} -eq 3 ] +} + +@test "setup failure" { + run bats "$FIXTURE_ROOT/failing_setup.bats" + [ $status -eq 1 ] + [ "${lines[1]}" = 'not ok 1 truth' ] + [ "${lines[2]}" = "# (from function \`setup' in test file $RELATIVE_FIXTURE_ROOT/failing_setup.bats, line 2)" ] + [ "${lines[3]}" = "# \`false' failed" ] +} + +@test "passing test with teardown failure" { + PASS=1 run bats "$FIXTURE_ROOT/failing_teardown.bats" + [ $status -eq 1 ] + [ "${lines[1]}" = 'not ok 1 truth' ] + [ "${lines[2]}" = "# (from function \`teardown' in test file $RELATIVE_FIXTURE_ROOT/failing_teardown.bats, line 2)" ] + [ "${lines[3]}" = "# \`eval \"( exit \${STATUS:-1} )\"' failed" ] +} + +@test "failing test with teardown failure" { + PASS=0 run bats "$FIXTURE_ROOT/failing_teardown.bats" + [ $status -eq 1 ] + [ "${lines[1]}" = 'not ok 1 truth' ] + [ "${lines[2]}" = "# (in test file $RELATIVE_FIXTURE_ROOT/failing_teardown.bats, line 6)" ] + [ "${lines[3]}" = $'# `[ "$PASS" = "1" ]\' failed' ] +} + +@test "teardown failure with significant status" { + PASS=1 STATUS=2 run bats "$FIXTURE_ROOT/failing_teardown.bats" + [ $status -eq 1 ] + [ "${lines[3]}" = "# \`eval \"( exit \${STATUS:-1} )\"' failed with status 2" ] +} + +@test "failing test file outside of BATS_CWD" { + cd "$TMP" + run bats "$FIXTURE_ROOT/failing.bats" + [ $status -eq 1 ] + [ "${lines[2]}" = "# (in test file $FIXTURE_ROOT/failing.bats, line 4)" ] +} + +@test "load sources scripts relative to the current test file" { + run bats "$FIXTURE_ROOT/load.bats" + [ $status -eq 0 ] +} + +@test "load aborts if the specified script does not exist" { + HELPER_NAME="nonexistent" run bats "$FIXTURE_ROOT/load.bats" + [ $status -eq 1 ] +} + +@test "load sources scripts by absolute path" { + HELPER_NAME="${FIXTURE_ROOT}/test_helper.bash" run bats "$FIXTURE_ROOT/load.bats" + [ $status -eq 0 ] +} + +@test "load aborts if the script, specified by an absolute path, does not exist" { + HELPER_NAME="${FIXTURE_ROOT}/nonexistent" run bats "$FIXTURE_ROOT/load.bats" + [ $status -eq 1 ] +} + +@test "output is discarded for passing tests and printed for failing tests" { + run bats "$FIXTURE_ROOT/output.bats" + [ $status -eq 1 ] + [ "${lines[6]}" = '# failure stdout 1' ] + [ "${lines[7]}" = '# failure stdout 2' ] + [ "${lines[11]}" = '# failure stderr' ] +} + +@test "-c prints the number of tests" { + run bats -c "$FIXTURE_ROOT/empty.bats" + [ $status -eq 0 ] + [ "$output" = "0" ] + + run bats -c "$FIXTURE_ROOT/output.bats" + [ $status -eq 0 ] + [ "$output" = "4" ] +} + +@test "dash-e is not mangled on beginning of line" { + run bats "$FIXTURE_ROOT/intact.bats" + [ $status -eq 0 ] + [ "${lines[1]}" = "ok 1 dash-e on beginning of line" ] +} + +@test "dos line endings are stripped before testing" { + run bats "$FIXTURE_ROOT/dos_line.bats" + [ $status -eq 0 ] +} + +@test "test file without trailing newline" { + run bats "$FIXTURE_ROOT/without_trailing_newline.bats" + [ $status -eq 0 ] + [ "${lines[1]}" = "ok 1 truth" ] +} + +@test "skipped tests" { + run bats "$FIXTURE_ROOT/skipped.bats" + [ $status -eq 0 ] + [ "${lines[1]}" = "ok 1 # skip a skipped test" ] + [ "${lines[2]}" = "ok 2 # skip (a reason) a skipped test with a reason" ] +} + +@test "extended syntax" { + run bats-exec-test -x "$FIXTURE_ROOT/failing_and_passing.bats" + [ $status -eq 1 ] + [ "${lines[1]}" = 'begin 1 a failing test' ] + [ "${lines[2]}" = 'not ok 1 a failing test' ] + [ "${lines[5]}" = 'begin 2 a passing test' ] + [ "${lines[6]}" = 'ok 2 a passing test' ] +} + +@test "pretty and tap formats" { + run bats --tap "$FIXTURE_ROOT/passing.bats" + tap_output="$output" + [ $status -eq 0 ] + + run bats --pretty "$FIXTURE_ROOT/passing.bats" + pretty_output="$output" + [ $status -eq 0 ] + + [ "$tap_output" != "$pretty_output" ] +} + +@test "pretty formatter bails on invalid tap" { + run bats --tap "$FIXTURE_ROOT/invalid_tap.bats" + [ $status -eq 1 ] + [ "${lines[0]}" = "This isn't TAP!" ] + [ "${lines[1]}" = "Good day to you" ] +} + +@test "single-line tests" { + run bats "$FIXTURE_ROOT/single_line.bats" + [ $status -eq 1 ] + [ "${lines[1]}" = 'ok 1 empty' ] + [ "${lines[2]}" = 'ok 2 passing' ] + [ "${lines[3]}" = 'ok 3 input redirection' ] + [ "${lines[4]}" = 'not ok 4 failing' ] + [ "${lines[5]}" = "# (in test file $RELATIVE_FIXTURE_ROOT/single_line.bats, line 9)" ] + [ "${lines[6]}" = $'# `@test "failing" { false; }\' failed' ] +} diff --git a/tests/common/bats-0.4.0/test/fixtures/bats/dos_line.bats b/tests/common/bats-0.4.0/test/fixtures/bats/dos_line.bats new file mode 100644 index 0000000000..b5f65c67b0 --- /dev/null +++ b/tests/common/bats-0.4.0/test/fixtures/bats/dos_line.bats @@ -0,0 +1,3 @@ +@test "foo" { + echo "foo" +} diff --git a/tests/common/bats-0.4.0/test/fixtures/bats/empty.bats b/tests/common/bats-0.4.0/test/fixtures/bats/empty.bats new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/common/bats-0.4.0/test/fixtures/bats/environment.bats b/tests/common/bats-0.4.0/test/fixtures/bats/environment.bats new file mode 100644 index 0000000000..8d3b9841c2 --- /dev/null +++ b/tests/common/bats-0.4.0/test/fixtures/bats/environment.bats @@ -0,0 +1,8 @@ +@test "setting a variable" { + variable=1 + [ $variable -eq 1 ] +} + +@test "variables do not persist across tests" { + [ -z "$variable" ] +} diff --git a/tests/common/bats-0.4.0/test/fixtures/bats/failing.bats b/tests/common/bats-0.4.0/test/fixtures/bats/failing.bats new file mode 100644 index 0000000000..13be78cfb3 --- /dev/null +++ b/tests/common/bats-0.4.0/test/fixtures/bats/failing.bats @@ -0,0 +1,5 @@ +@test "a failing test" { + true + true + eval "( exit ${STATUS:-1} )" +} diff --git a/tests/common/bats-0.4.0/test/fixtures/bats/failing_and_passing.bats b/tests/common/bats-0.4.0/test/fixtures/bats/failing_and_passing.bats new file mode 100644 index 0000000000..5513a9bb30 --- /dev/null +++ b/tests/common/bats-0.4.0/test/fixtures/bats/failing_and_passing.bats @@ -0,0 +1,7 @@ +@test "a failing test" { + false +} + +@test "a passing test" { + true +} diff --git a/tests/common/bats-0.4.0/test/fixtures/bats/failing_helper.bats b/tests/common/bats-0.4.0/test/fixtures/bats/failing_helper.bats new file mode 100644 index 0000000000..fb5726f5b4 --- /dev/null +++ b/tests/common/bats-0.4.0/test/fixtures/bats/failing_helper.bats @@ -0,0 +1,6 @@ +load "test_helper" + +@test "failing helper function" { + true + failing_helper +} diff --git a/tests/common/bats-0.4.0/test/fixtures/bats/failing_setup.bats b/tests/common/bats-0.4.0/test/fixtures/bats/failing_setup.bats new file mode 100644 index 0000000000..9a35587a8c --- /dev/null +++ b/tests/common/bats-0.4.0/test/fixtures/bats/failing_setup.bats @@ -0,0 +1,7 @@ +setup() { + false +} + +@test "truth" { + true +} diff --git a/tests/common/bats-0.4.0/test/fixtures/bats/failing_teardown.bats b/tests/common/bats-0.4.0/test/fixtures/bats/failing_teardown.bats new file mode 100644 index 0000000000..28eebf6f5c --- /dev/null +++ b/tests/common/bats-0.4.0/test/fixtures/bats/failing_teardown.bats @@ -0,0 +1,7 @@ +teardown() { + eval "( exit ${STATUS:-1} )" +} + +@test "truth" { + [ "$PASS" = "1" ] +} diff --git a/tests/common/bats-0.4.0/test/fixtures/bats/intact.bats b/tests/common/bats-0.4.0/test/fixtures/bats/intact.bats new file mode 100644 index 0000000000..c25c28c7c1 --- /dev/null +++ b/tests/common/bats-0.4.0/test/fixtures/bats/intact.bats @@ -0,0 +1,6 @@ +@test "dash-e on beginning of line" { + run cat - <&2 +} + +@test "failure writing to stdout" { + echo "failure stdout 1" + echo "failure stdout 2" + false +} + +@test "failure writing to stderr" { + echo "failure stderr" >&2 + false +} diff --git a/tests/common/bats-0.4.0/test/fixtures/bats/passing.bats b/tests/common/bats-0.4.0/test/fixtures/bats/passing.bats new file mode 100644 index 0000000000..e8182ce094 --- /dev/null +++ b/tests/common/bats-0.4.0/test/fixtures/bats/passing.bats @@ -0,0 +1,3 @@ +@test "a passing test" { + true +} diff --git a/tests/common/bats-0.4.0/test/fixtures/bats/passing_and_failing.bats b/tests/common/bats-0.4.0/test/fixtures/bats/passing_and_failing.bats new file mode 100644 index 0000000000..7b7d8eea36 --- /dev/null +++ b/tests/common/bats-0.4.0/test/fixtures/bats/passing_and_failing.bats @@ -0,0 +1,7 @@ +@test "a passing test" { + true +} + +@test "a failing test" { + false +} diff --git a/tests/common/bats-0.4.0/test/fixtures/bats/passing_and_skipping.bats b/tests/common/bats-0.4.0/test/fixtures/bats/passing_and_skipping.bats new file mode 100644 index 0000000000..88d74befb7 --- /dev/null +++ b/tests/common/bats-0.4.0/test/fixtures/bats/passing_and_skipping.bats @@ -0,0 +1,7 @@ +@test "a passing test" { + true +} + +@test "a skipping test" { + skip +} diff --git a/tests/common/bats-0.4.0/test/fixtures/bats/passing_failing_and_skipping.bats b/tests/common/bats-0.4.0/test/fixtures/bats/passing_failing_and_skipping.bats new file mode 100644 index 0000000000..3c9f17fa93 --- /dev/null +++ b/tests/common/bats-0.4.0/test/fixtures/bats/passing_failing_and_skipping.bats @@ -0,0 +1,11 @@ +@test "a passing test" { + true +} + +@test "a skipping test" { + skip +} + +@test "a failing test" { + false +} diff --git a/tests/common/bats-0.4.0/test/fixtures/bats/setup.bats b/tests/common/bats-0.4.0/test/fixtures/bats/setup.bats new file mode 100644 index 0000000000..3cc52cc7c6 --- /dev/null +++ b/tests/common/bats-0.4.0/test/fixtures/bats/setup.bats @@ -0,0 +1,17 @@ +LOG="$TMP/setup.log" + +setup() { + echo "$BATS_TEST_NAME" >> "$LOG" +} + +@test "one" { + [ "$(tail -n 1 "$LOG")" = "test_one" ] +} + +@test "two" { + [ "$(tail -n 1 "$LOG")" = "test_two" ] +} + +@test "three" { + [ "$(tail -n 1 "$LOG")" = "test_three" ] +} diff --git a/tests/common/bats-0.4.0/test/fixtures/bats/single_line.bats b/tests/common/bats-0.4.0/test/fixtures/bats/single_line.bats new file mode 100644 index 0000000000..fc342d9666 --- /dev/null +++ b/tests/common/bats-0.4.0/test/fixtures/bats/single_line.bats @@ -0,0 +1,9 @@ +@test "empty" { } + +@test "passing" { true; } + +@test "input redirection" { diff - <( echo hello ); } <> "$LOG" +} + +@test "one" { + true +} + +@test "two" { + false +} + +@test "three" { + true +} diff --git a/tests/common/bats-0.4.0/test/fixtures/bats/test_helper.bash b/tests/common/bats-0.4.0/test/fixtures/bats/test_helper.bash new file mode 100644 index 0000000000..530d0343f5 --- /dev/null +++ b/tests/common/bats-0.4.0/test/fixtures/bats/test_helper.bash @@ -0,0 +1,7 @@ +help_me() { + true +} + +failing_helper() { + false +} diff --git a/tests/common/bats-0.4.0/test/fixtures/bats/without_trailing_newline.bats b/tests/common/bats-0.4.0/test/fixtures/bats/without_trailing_newline.bats new file mode 100644 index 0000000000..e3ace8b578 --- /dev/null +++ b/tests/common/bats-0.4.0/test/fixtures/bats/without_trailing_newline.bats @@ -0,0 +1,3 @@ +@test "truth" { + true +} \ No newline at end of file diff --git a/tests/common/bats-0.4.0/test/fixtures/suite/empty/.gitkeep b/tests/common/bats-0.4.0/test/fixtures/suite/empty/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/common/bats-0.4.0/test/fixtures/suite/multiple/a.bats b/tests/common/bats-0.4.0/test/fixtures/suite/multiple/a.bats new file mode 100644 index 0000000000..fbc1f3833a --- /dev/null +++ b/tests/common/bats-0.4.0/test/fixtures/suite/multiple/a.bats @@ -0,0 +1,3 @@ +@test "truth" { + true +} diff --git a/tests/common/bats-0.4.0/test/fixtures/suite/multiple/b.bats b/tests/common/bats-0.4.0/test/fixtures/suite/multiple/b.bats new file mode 100644 index 0000000000..bb965a4f86 --- /dev/null +++ b/tests/common/bats-0.4.0/test/fixtures/suite/multiple/b.bats @@ -0,0 +1,7 @@ +@test "more truth" { + true +} + +@test "quasi-truth" { + [ -z "$FLUNK" ] +} diff --git a/tests/common/bats-0.4.0/test/fixtures/suite/single/test.bats b/tests/common/bats-0.4.0/test/fixtures/suite/single/test.bats new file mode 100644 index 0000000000..e8182ce094 --- /dev/null +++ b/tests/common/bats-0.4.0/test/fixtures/suite/single/test.bats @@ -0,0 +1,3 @@ +@test "a passing test" { + true +} diff --git a/tests/common/bats-0.4.0/test/suite.bats b/tests/common/bats-0.4.0/test/suite.bats new file mode 100755 index 0000000000..14f5008eaf --- /dev/null +++ b/tests/common/bats-0.4.0/test/suite.bats @@ -0,0 +1,64 @@ +#!/usr/bin/env bats + +load test_helper +fixtures suite + +@test "running a suite with no test files" { + run bats "$FIXTURE_ROOT/empty" + [ $status -eq 0 ] + [ $output = "1..0" ] +} + +@test "running a suite with one test file" { + run bats "$FIXTURE_ROOT/single" + [ $status -eq 0 ] + [ ${lines[0]} = "1..1" ] + [ ${lines[1]} = "ok 1 a passing test" ] +} + +@test "counting tests in a suite" { + run bats -c "$FIXTURE_ROOT/single" + [ $status -eq 0 ] + [ $output -eq 1 ] + + run bats -c "$FIXTURE_ROOT/multiple" + [ $status -eq 0 ] + [ $output -eq 3 ] +} + +@test "aggregated output of multiple tests in a suite" { + run bats "$FIXTURE_ROOT/multiple" + [ $status -eq 0 ] + [ ${lines[0]} = "1..3" ] + echo "$output" | grep "^ok . truth" + echo "$output" | grep "^ok . more truth" + echo "$output" | grep "^ok . quasi-truth" +} + +@test "a failing test in a suite results in an error exit code" { + FLUNK=1 run bats "$FIXTURE_ROOT/multiple" + [ $status -eq 1 ] + [ ${lines[0]} = "1..3" ] + echo "$output" | grep "^not ok . quasi-truth" +} + +@test "running an ad-hoc suite by specifying multiple test files" { + run bats "$FIXTURE_ROOT/multiple/a.bats" "$FIXTURE_ROOT/multiple/b.bats" + [ $status -eq 0 ] + [ ${lines[0]} = "1..3" ] + echo "$output" | grep "^ok . truth" + echo "$output" | grep "^ok . more truth" + echo "$output" | grep "^ok . quasi-truth" +} + +@test "extended syntax in suite" { + FLUNK=1 run bats-exec-suite -x "$FIXTURE_ROOT/multiple/"*.bats + [ $status -eq 1 ] + [ "${lines[0]}" = "1..3" ] + [ "${lines[1]}" = "begin 1 truth" ] + [ "${lines[2]}" = "ok 1 truth" ] + [ "${lines[3]}" = "begin 2 more truth" ] + [ "${lines[4]}" = "ok 2 more truth" ] + [ "${lines[5]}" = "begin 3 quasi-truth" ] + [ "${lines[6]}" = "not ok 3 quasi-truth" ] +} diff --git a/tests/common/bats-0.4.0/test/test_helper.bash b/tests/common/bats-0.4.0/test/test_helper.bash new file mode 100644 index 0000000000..84eee8c3f5 --- /dev/null +++ b/tests/common/bats-0.4.0/test/test_helper.bash @@ -0,0 +1,16 @@ +fixtures() { + FIXTURE_ROOT="$BATS_TEST_DIRNAME/fixtures/$1" + RELATIVE_FIXTURE_ROOT="$(bats_trim_filename "$FIXTURE_ROOT")" +} + +setup() { + export TMP="$BATS_TEST_DIRNAME/tmp" +} + +filter_control_sequences() { + "$@" | sed $'s,\x1b\\[[0-9;]*[a-zA-Z],,g' +} + +teardown() { + [ -d "$TMP" ] && rm -f "$TMP"/* +} diff --git a/tests/common/functions b/tests/common/functions new file mode 100644 index 0000000000..c6db181e16 --- /dev/null +++ b/tests/common/functions @@ -0,0 +1,390 @@ +# -*-sh-*- + +#------------------------------------- +# OHPC common test functions +#------------------------------------- + +# Error message with exit +ERROR () { + echo "[OHPC-TEST:ERROR]: $1" >&2 + exit 1 +} + +# Error message with return +ERROR_RETURN () { + echo "[OHPC-TEST:ERROR]: $1" >&2 + return 1 +} + +# Check if specific RPM package is installed +check_if_rpm_installed () { + $(rpm -q --quiet $1) || ERROR "RPM $1 is not installed locally" +} + +# Check if we have a known/supported resource manager +check_rms(){ + if [ "$RESOURCE_MANAGER" = "slurm" ];then + export RMS=slurm + else + ERROR "Unsupported or unknown resource manager" + exit 1 + fi +} + +# Check for valid executable +check_exe() { + type "$1" >& /dev/null + if [ $? -ne 0 ];then + ERROR_RETURN "$1 is not available for execution" + fi +} + +save_logs_compiler_family() +{ + if [ $# -lt 2 ];then + ERROR "insufficient input provided to save_logs_compiler_family()" + fi + + local __testDir=$1 + local __compiler=$2 + + local __saveDir="family-$__compiler" + + cd $__testDir || ERROR "unable to cd to $_testDir" + + if [ -d "$__saveDir" ];then + rm -rf "$__saveDir" + fi + + mkdir "$__saveDir" + + shopt -s nullglob + + # Cache .log files + + for i in *.log; do + mv $i "$__saveDir" || ERROR "Unable to move file -> $i"; + done + + # Also cache log.xml files (for JUnit parsing) + + for i in *.log.xml; do + mv $i "$__saveDir" || ERROR "Unable to move file -> $i"; + done + + cd - > /dev/null + +} # end of save_logs_compiler_family() + +save_logs_mpi_family() +{ + if [ $# -lt 3 ];then + ERROR "insufficient input provided to save_logs_mpi_family()" + fi + + local __testDir=$1 + local __compiler=$2 + local __mpi=$3 + + local __saveDir="family-$__compiler-$__mpi" + + cd $__testDir || ERROR "unable to cd to $_testDir" + + if [ -d "$__saveDir" ];then + rm -rf "$__saveDir" + fi + + mkdir "$__saveDir" + + shopt -s nullglob + + # Cache .log files + for i in *.log; do + mv $i "$__saveDir" || ERROR "Unable to move file -> $i"; + done + + # Also cache log.xml files (for JUnit parsing) + + for i in *.log.xml; do + mv $i "$__saveDir" || ERROR "Unable to move file -> $i"; + done + cd - > /dev/null + +} # end of save_logs_mpi_family() + +# Check if we have a known/supported compiler family +# and set relevant compiler variables +check_compiler_family() +{ + local __CC=$1 + local __CXX=$2 + local __FC=$3 + + local myCC="" + local myCXX="" + local myFC="" + + if [ $LMOD_FAMILY_COMPILER == "intel" ];then + myCC=icc + myCXX=icpc + myFC=ifort + elif [ $LMOD_FAMILY_COMPILER == "gnu" ];then + myCC=gcc + myCXX=g++ + myFC=gfortran + else + ERROR "Unknown compiler family" + exit 1 + fi + + eval $__CC="'$myCC'" + eval $__CXX="'$myCXX'" + eval $__FC="'$myFC'" +} + +# Run serial binary through resource manager +run_serial_binary () { + + # Parse optional arguments + output_file="" + timeout=1 # default job timeout (in minutes) + + local OPTIND=1 + while getopts "o:t:" opt; do + case "$opt" in + o) output_file="$OPTARG" + ;; + t) timeout="$OPTARG" + ;; + '?') + echo "Unknown option given to run_serial_binary" >&2 + exit 1 + ;; + esac + done + + shift "$((OPTIND-1))" # Shift off the options and optional --. + + EXE=$1 + shift + + check_exe $EXE + + if [ -z "$RESOURCE_MANAGER" ];then + ERROR_RETURN "OHPC resource manager is not defined - please set via RESOURCE_MANAGER variable" + fi + + if [ "$RESOURCE_MANAGER" = "slurm" ];then + if [ -n "$output_file" ];then + salloc -n 1 -N 1 -t $timeout $EXE "$@" >& $output_file + else + salloc -n 1 -N 1 -t $timeout $EXE "$@" + fi + return $? + else + ERROR_RETURN "Unsupported resource manager" + fi +} + +# Run MPI binary through resource manager +run_mpi_binary () { + + # Parse optional arguments + input_file="" + output_file="" + timeout=1 # default job timeout (in minutes) + + local OPTIND=1 + while getopts "i:o:t:" opt; do + case "$opt" in + i) input_file="$OPTARG" + ;; + o) output_file="$OPTARG" + ;; + t) timeout="$OPTARG" + ;; + '?') + echo "Unknown option given to run_mpi_binary" >&2 + exit 1 + ;; + esac + done + + shift "$((OPTIND-1))" # Shift off the options and optional --. + + EXE=$1 + ARGS=$2 + NNODES=$3 + NTASKS=$4 + + check_exe $EXE + + if [ -z "$RESOURCE_MANAGER" ];then + ERROR_RETURN "Resource manager is not defined - please set via RESOURCE_MANAGER variable" + fi + + if [ -z "$LMOD_FAMILY_MPI" ];then + ERROR_RETURN "MPI toolchain s not loaded - please load MPI stack first" + fi + + if [ "$RESOURCE_MANAGER" = "slurm" ];then + if [ "$LMOD_FAMILY_MPI" = "impi" -o "$LMOD_FAMILY_MPI" = "mvapich2" -o "$LMOD_FAMILY_MPI" = "openmpi" ];then + + jobScript=/tmp/job.$USER.$RANDOM + + echo "#!/bin/bash" > $jobScript + echo "#SBATCH -J CMT-test" >> $jobScript + echo "#SBATCH -N $NNODES" >> $jobScript + echo "#SBATCH -n $NTASKS" >> $jobScript + echo "#SBATCH -t $timeout" >> $jobScript + echo "#SBATCH -o job.%j.out" >> $jobScript + + if [ -n "$input_file" ];then + echo "prun $EXE $ARGS < $input_file" >> $jobScript + else + echo "prun $EXE $ARGS" >> $jobScript + fi + + # Submit batch job + + tmpState=/tmp/submitId.$RANDOM + + sbatch $jobScript >& $tmpState + echo "job script = $jobScript" + + head -1 $tmpState | grep -q "Submitted batch job" || ERROR "Unable to submit batch job" + jobId=`head -1 $tmpState | awk '{print $4}'` + if [ $jobId -le 0 ];then + ERROR "Invalid jobID" + fi + rm $tmpState + + echo "Batch job $jobId submitted" + rc=1 + + for i in `seq 1 3000`; do + if ! tmpState=$(scontrol show job $jobId | grep JobState) ; then + ERROR_RETURN "Error querying job" + fi + + if echo "$tmpState" | egrep -q "JobState=COMPLETED" ; then + echo "Job completed..." + rc=0 + break + + elif echo "$tmpState" | egrep -q "JobState=FAILED" ; then + local tmpReason=$(scontrol show job $jobId | grep Reason | awk '{print $2}') + echo " " + echo "Job $jobId failed..." + echo "$tmpReason" + break + + elif echo "$tmpState" | egrep -q "JobState=TIMEOUT" ; then + local tmpReason=$(scontrol show job $jobId | grep Reason | awk '{print $2}') + echo " " + echo "Job $jobId encountered timeout..." + echo "$tmpReason" + break + + elif echo "$tmpState" | egrep -q "JobState=CANCELLED" ; then + echo " " + echo "Job $jobId cancelled..." + break + + else + sleep 1 + fi + done + + # Look for evidence of failure in job output + + echo " " + cat job.$jobId.out + + if egrep -q "$jobId FAILED|$jobId CANCELLED|exited on signal|command not found|failed to start|Unable to access executable|Error in init phase" job.$jobId.out ; then + rc=1 + fi + + if [ -n "$output_file" ];then + mv job.$jobId.out $output_file + fi + + rm $jobScript + return $rc + + else + ERROR_RETURN "Unsupported MPI family" + fi + else + ERROR_RETURN "Unsupported resource manager" + fi + +} # end run_mpi_binary() + +run_mpi_binary_orig () { + + # Parse optional arguments + output_file="" + timeout=1 # default job timeout (in minutes) + + local OPTIND=1 + while getopts "o:t:" opt; do + case "$opt" in + o) output_file="$OPTARG" + ;; + t) timeout="$OPTARG" + ;; + '?') + echo "Unknown option given to run_mpi_binary" >&2 + exit 1 + ;; + esac + done + + shift "$((OPTIND-1))" # Shift off the options and optional --. + + EXE=$1 + ARGS=$2 + NNODES=$3 + NTASKS=$4 + + if [ ! -x $EXE ];then + ERROR_RETURN "$EXE is not available or not executable" + fi + + if [ -z "$RESOURCE_MANAGER" ];then + ERROR_RETURN "Resource manager is not defined - please set via RESOURCE_MANAGER variable" + fi + + if [ -z "$LMOD_FAMILY_MPI" ];then + ERROR_RETURN "MPI toolchain s not loaded - please load MPI stack first" + fi + + if [ "$RESOURCE_MANAGER" = "slurm" ];then + if [ "$LMOD_FAMILY_MPI" = "impi" -o "$LMOD_FAMILY_MPI" = "mvapich2" ];then + if [ -n "$output_file" ];then +## salloc -n $NTASKS -N $NNODES -K1 -t $timeout srun $EXE $ARGS >& $output_file + salloc -n $NTASKS -N $NNODES -K1 -t $timeout prun $EXE $ARGS >& $output_file + else +## salloc -n $NTASKS -N $NNODES -K1 -t $timeout srun $EXE $ARGS + salloc -n $NTASKS -N $NNODES -K1 -t $timeout prun $EXE $ARGS + fi + return $? + elif [ "$LMOD_FAMILY_MPI" = "openmpi" ];then + if [ -n "$output_file" ];then +## salloc -n $NTASKS -N $NNODES -K1 -t $timeout mpiexec $EXE $ARGS >& $output_file + salloc -n $NTASKS -N $NNODES -K1 -t $timeout prun $EXE $ARGS >& $output_file + else +## salloc -n $NTASKS -N $NNODES -K1 -t $timeout mpiexec $EXE $ARGS + salloc -n $NTASKS -N $NNODES -K1 -t $timeout prun $EXE $ARGS + fi + return $? + else + ERROR_RETURN "Unsupported MPI family" + fi + else + ERROR_RETURN "Unsupported resource manager" + fi + +} # end run_mpi_binary_orig() + diff --git a/tests/common/m4/compiler_family.m4 b/tests/common/m4/compiler_family.m4 new file mode 100644 index 0000000000..f78a02c8e9 --- /dev/null +++ b/tests/common/m4/compiler_family.m4 @@ -0,0 +1,42 @@ +# SYNOPSIS +# +# Test for OHPC supported compiler toolchains +# +# COMPILER_FAMILY() +# +# DESCRIPTION +# +# Queries configuration environment to detect compiler toolchain +# loaded via Lmod. Sets CC, CXX, and FC to match supported +# toolchains. +# +# CONTRIBUTORS +# +# Karl W. Schulz + +AC_DEFUN([OHPC_COMPILER_FAMILY], +[ + +AC_MSG_CHECKING([for loaded OHPC compiler toolchain]) + +if test "x$LMOD_FAMILY_COMPILER" = "xgnu"; then + CC=gcc + CXX=g++ + FC=gfortran + AC_MSG_RESULT([gnu]) +elif test "x$LMOD_FAMILY_COMPILER" = "xintel"; then + CC=icc + CXX=icpc + FC=ifort + AC_MSG_RESULT([intel]) +else + AC_MSG_RESULT([unknown]) + echo + AC_ERROR([Unknown compiler family - please load a compiler toolchain.]) +fi + +# Automake condidtionals +AM_CONDITIONAL(HAVE_OHPC_GNU_COMPILER, test "x$LMOD_FAMILY_COMPILER" = "xgnu") +AM_CONDITIONAL(HAVE_OHPC_INTEL_COMPILER,test "x$LMOD_FAMILY_COMPILER" = "xintel") + +]) diff --git a/tests/common/test_helper_functions.bash b/tests/common/test_helper_functions.bash new file mode 100644 index 0000000000..af54f930c7 --- /dev/null +++ b/tests/common/test_helper_functions.bash @@ -0,0 +1,50 @@ +# Test convenience functions for use with Bats Automated Testing System +# +# routines modified from: +# https://github.com/sstephenson/rbenv/blob/master/test/test_helper.bash + +flunk() { + { + if [ "$#" -eq 0 ]; then + cat - + else + echo "$@" + fi + } | sed "s:LOCAL_TEST_DIR:TEST_DIR:g" >&2 + return 1 +} + +assert_success() { + if [ "$status" -ne 0 ]; then + flunk "command failed with exit status $status" + elif [ "$#" -gt 0 ]; then + assert_output "$1" + fi +} + +assert_failure() { + if [ "$status" -eq 0 ]; then + flunk "expected failed exit status" + elif [ "$#" -gt 0 ]; then + assert_output "$1" + fi +} + +assert_equal() { + if [ "$1" != "$2" ]; then + { + echo "output expected: $1" + echo "output observed: $2" + } | flunk + fi +} + +assert_output() { + local expected + if [ $# -eq 0 ]; then + expected="$(cat -)" + else + expected="$1" + fi + assert_equal "$expected" "$output" +} diff --git a/tests/compilers/COPYRIGHT b/tests/compilers/COPYRIGHT new file mode 100644 index 0000000000..28abeb86ac --- /dev/null +++ b/tests/compilers/COPYRIGHT @@ -0,0 +1,24 @@ +Copyright (c) 2015, Intel Corporation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +* Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/tests/compilers/Makefile.am b/tests/compilers/Makefile.am new file mode 100644 index 0000000000..aeb58c10e6 --- /dev/null +++ b/tests/compilers/Makefile.am @@ -0,0 +1,4 @@ +AUTOMAKE_OPTIONS = foreign +AM_MAKEFLAGS = --no-print-directory +SUBDIRS = tests +ACLOCAL_AMFLAGS = -I m4 \ No newline at end of file diff --git a/tests/compilers/bootstrap b/tests/compilers/bootstrap new file mode 100755 index 0000000000..16eb7f7cb0 --- /dev/null +++ b/tests/compilers/bootstrap @@ -0,0 +1,9 @@ +#! /bin/sh +# -------------------------------------------------------------------------- +# bootstrapping utility for autotools -> now just uses autoreconf +# -------------------------------------------------------------------------- + +cmd="autoreconf -f -i" +echo "Bootstrapping using $cmd ..." + +$cmd \ No newline at end of file diff --git a/tests/compilers/configure.ac b/tests/compilers/configure.ac new file mode 100644 index 0000000000..c0b426d9a5 --- /dev/null +++ b/tests/compilers/configure.ac @@ -0,0 +1,41 @@ +AC_PREREQ([2.63]) +AC_INIT([compiler-tests], [0.0.1], [karl.w.schulz@intel.com]) +AC_CONFIG_MACRO_DIR([m4]) +AM_INIT_AUTOMAKE +m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) + +# unset default compilers and detect compiler toolchain from environment + +CC=" " +CXX=" " +FC=" " + +OHPC_COMPILER_FAMILY + +# test compilers + +AC_PROG_CC +AC_PROG_FC +AC_PROG_CXX + +CFLAGS="${CFLAGS} -fopenmp" +CXXFLAGS="${CXXFLAGS} -fopenmp" +FCFLAGS="${FCFLAGS} -fopenmp" + +AC_OUTPUT( Makefile tests/Makefile) + +echo +echo '-------------------------------------------------- SUMMARY --------------------------------------------------' +echo +echo Package version............... : $PACKAGE-$VERSION +echo OHPC compiler toolchain........ : $LMOD_FAMILY_COMPILER +echo +echo C compiler.................... : `which $CC` +echo C++ compiler.................. : `which $CXX` +echo Fortran compiler ............. : `which $FC` +echo +echo C compiler flags.............. : $CFLAGS +echo C++ compiler flags............ : $CXXFLAGS +echo Fortran compiler flags........ : $FCFLAGS +echo +echo '-------------------------------------------------------------------------------------------------------------' diff --git a/tests/compilers/m4/compiler_family.m4 b/tests/compilers/m4/compiler_family.m4 new file mode 100644 index 0000000000..22ec81b2ca --- /dev/null +++ b/tests/compilers/m4/compiler_family.m4 @@ -0,0 +1,38 @@ +# SYNOPSIS +# +# Test for OHPC supported compiler toolchains +# +# COMPILER_FAMILY() +# +# DESCRIPTION +# +# Queries configuration environment to detect compiler toolchain +# loaded via Lmod. Sets CC, CXX, and FC to match supported +# toolchains. +# +# CONTRIBUTORS +# +# Karl W. Schulz + +AC_DEFUN([OHPC_COMPILER_FAMILY], +[ + +AC_MSG_CHECKING([for loaded OHPC compiler toolchain]) + +if test "x$LMOD_FAMILY_COMPILER" = "xgnu"; then + CC=gcc + CXX=g++ + FC=gfortran + AC_MSG_RESULT([gnu]) +elif test "x$LMOD_FAMILY_COMPILER" = "xintel"; then + CC=icc + CXX=icpc + FC=ifort + AC_MSG_RESULT([intel]) +else + AC_MSG_RESULT([unknown]) + echo + AC_ERROR([Unknown compiler family - please load a compiler toolchain.]) +fi + +]) diff --git a/tests/compilers/ohpc-tests/test_compiler_families b/tests/compilers/ohpc-tests/test_compiler_families new file mode 100755 index 0000000000..884096c42a --- /dev/null +++ b/tests/compilers/ohpc-tests/test_compiler_families @@ -0,0 +1,35 @@ +#!/bin/bash +# -*-sh-*- + +TEST_LOGS="" +MAKEFLAGS="" + +source ./TEST_ENV || exit 1 +source ./common/functions || exit 1 + +cd compilers || exit 1 +export BATS_JUNIT_CLASS=Compilers + +# bootstrap the local autotools project + +./bootstrap || exit 1 + +for compiler in $COMPILER_FAMILIES ; do + + echo " " + echo " " + echo "-------------------------------------------------------" + echo "User Environment: Compiler tests: $compiler" + echo "-------------------------------------------------------" + + module purge || exit 1 + module load $compiler || exit 1 + + ./configure || exit 1 + make clean || exit 1 + make -j 4 check || exit 1 + + save_logs_compiler_family tests $compiler + + make distclean +done diff --git a/tests/compilers/tests/.gitignore b/tests/compilers/tests/.gitignore new file mode 100644 index 0000000000..8aa4fb9ab8 --- /dev/null +++ b/tests/compilers/tests/.gitignore @@ -0,0 +1,7 @@ +C*_test +CXX*_test +F90*_test +*.o +*.log +*.trs +test-suite.log.orig diff --git a/tests/compilers/tests/CXX_openmp_test.cpp b/tests/compilers/tests/CXX_openmp_test.cpp new file mode 100644 index 0000000000..f1ec6fdb25 --- /dev/null +++ b/tests/compilers/tests/CXX_openmp_test.cpp @@ -0,0 +1,81 @@ +/* +Copyright (c) 2015, Intel Corporation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +* Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#include +#include +#include +#include + +#define N 1024 + +int main(int argc, char* argv[]) +{ + double a[N], b[N], c, sum; + int nthreads, n, i; + + nthreads = (argc > 1) ? atoi(argv[1]) : 1; + std::cout << "# threads: " << nthreads << std::endl; + + omp_set_num_threads(nthreads); + #pragma omp parallel + { + #pragma omp master + n = omp_get_num_threads(); + } + if (n != nthreads) + { + printf("\nERROR: %d thread(s) detected != %d\n", n, nthreads); + return -1; + } + + sum = c = 0.0; + for (i = 0; i < N; i ++) + sum += i * i * 2.0; + + #pragma omp parallel private(i) + { + #pragma omp for nowait + for (i = 0; i < N; i ++) + a[i] = i * 1.0; + + #pragma omp for nowait + for (i = 0; i < N; i ++) + b[i] = a[i] * 2.0; + + #pragma omp for reduction(+:c) + for (i = 0; i < N; i ++) + c += a[i] * b[i]; + } + + if (c != sum) + { + printf("\nERROR: computed sum %.2lf != %.2lf\n", c, sum); + return -1; + } + printf("final sum: %.2lf\n", c); + return 0; +} diff --git a/tests/compilers/tests/CXX_test.cpp b/tests/compilers/tests/CXX_test.cpp new file mode 100644 index 0000000000..b128520cd2 --- /dev/null +++ b/tests/compilers/tests/CXX_test.cpp @@ -0,0 +1,15 @@ +#include +#include +#include + +int main() +{ + std::map amap; + + amap["fafafooey"] = -1; + amap["fafafooey"] += 43; + + assert(amap["fafafooey"] == 42); + return(0); +} + diff --git a/tests/compilers/tests/C_openmp_test.c b/tests/compilers/tests/C_openmp_test.c new file mode 100644 index 0000000000..1fecc422ea --- /dev/null +++ b/tests/compilers/tests/C_openmp_test.c @@ -0,0 +1,80 @@ +/* +Copyright (c) 2015, Intel Corporation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +* Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#include +#include +#include + +#define N 1024 + +int main(int argc, char* argv[]) +{ + double a[N], b[N], c, sum; + int nthreads, n, i; + + nthreads = (argc > 1) ? atoi(argv[1]) : 1; + printf("# threads: %d\n", nthreads); + + omp_set_num_threads(nthreads); + #pragma omp parallel + { + #pragma omp master + n = omp_get_num_threads(); + } + if (n != nthreads) + { + printf("\nERROR: %d thread(s) detected != %d\n", n, nthreads); + return -1; + } + + sum = c = 0.0; + for (i = 0; i < N; i ++) + sum += i * i * 2.0; + + #pragma omp parallel private(i) + { + #pragma omp for nowait + for (i = 0; i < N; i ++) + a[i] = i * 1.0; + + #pragma omp for nowait + for (i = 0; i < N; i ++) + b[i] = a[i] * 2.0; + + #pragma omp for reduction(+:c) + for (i = 0; i < N; i ++) + c += a[i] * b[i]; + } + + if (c != sum) + { + printf("\nERROR: computed sum %.2lf != %.2lf\n", c, sum); + return -1; + } + printf("final sum: %.2lf\n", c); + return 0; +} diff --git a/tests/compilers/tests/C_test.c b/tests/compilers/tests/C_test.c new file mode 100644 index 0000000000..c2ba74c91a --- /dev/null +++ b/tests/compilers/tests/C_test.c @@ -0,0 +1,12 @@ +#include +#include + +int main() +{ + int a = -1; + a += 43; + + assert(a == 42); + return(0); +} + diff --git a/tests/compilers/tests/F90_openmp_test.f90 b/tests/compilers/tests/F90_openmp_test.f90 new file mode 100644 index 0000000000..d6f88f0bb3 --- /dev/null +++ b/tests/compilers/tests/F90_openmp_test.f90 @@ -0,0 +1,87 @@ +! Copyright (c) 2015, Intel Corporation +! +! Redistribution and use in source and binary forms, with or without +! modification, are permitted provided that the following conditions are met: +! +! * Redistributions of source code must retain the above copyright notice, +! this list of conditions and the following disclaimer. +! * Redistributions in binary form must reproduce the above copyright +! notice, this list of conditions and the following disclaimer in the +! documentation and/or other materials provided with the distribution. +! * Neither the name of Intel Corporation nor the names of its contributors +! may be used to endorse or promote products derived from this software +! without specific prior written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +! AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +! IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +! FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +! DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +! SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +! CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +! OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +! OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +program main + implicit none + + integer N + parameter (N=1024) + + real*8 a(N), b(N), c, sum + integer nthreads, nt, i + integer omp_get_num_threads + + character (len=32) argv + integer argc + + argc = iargc() + + if (argc > 0) then + call getarg (1, argv) + read (argv, *) nthreads + else + nthreads = 1 + endif + + print *, "# threads: ", nthreads + call omp_set_num_threads(nthreads) + + !$omp parallel + !$omp master + nt = omp_get_num_threads() + !$omp end master + !$omp end parallel + + if (nt /= nthreads) then + print *, "ERROR: ", nt, " thread(s) detected != ", nthreads + call exit(-1) + endif + + sum = 0.0 + do i=1,N + sum = sum + i * i * 2.0 + enddo + + !$omp parallel do private(i) + do i=1,N + a(i) = 1.0 * i + b(i) = 2.0 * i + enddo + !omp end parallel do nowait + + c = 0.0 + !$omp parallel do reduction(+:c) + do i=1,N + c = c + a(i) * b(i) + enddo + + if (c /= sum) then + print *, "ERROR: computed sum ", c, " != ", sum + call exit(-1) + endif + + print *, "final sum: ", c + +end program main diff --git a/tests/compilers/tests/F90_test.f90 b/tests/compilers/tests/F90_test.f90 new file mode 100644 index 0000000000..00feeb1da3 --- /dev/null +++ b/tests/compilers/tests/F90_test.f90 @@ -0,0 +1,22 @@ +program main + implicit none + + integer :: y + + y = mystery_machine(0) + + if(y .ne. 42) then + write(*,*) 'Error with F90 runtime' + call exit(1) + endif + +contains + +integer function mystery_machine(x) + implicit none + integer, intent(in) :: x + + mystery_machine = x + 42 +end function mystery_machine + +end program main diff --git a/tests/compilers/tests/Makefile.am b/tests/compilers/tests/Makefile.am new file mode 100644 index 0000000000..bad444ecb2 --- /dev/null +++ b/tests/compilers/tests/Makefile.am @@ -0,0 +1,30 @@ +TESTS_ENVIRONMENT = BATS_NO_SUMMARY=1 + +TESTS = C_test +check_PROGRAMS = C_test +C_test_SOURCES = C_test.c + +TESTS += CXX_test +check_PROGRAMS += CXX_test +CXX_test_SOURCES = CXX_test.cpp + +TESTS += F90_test +check_PROGRAMS += F90_test +F90_test_SOURCES = F90_test.f90 + +TESTS += C_openmp_test +check_PROGRAMS += C_openmp_test +C_openmp_test_SOURCES = C_openmp_test.c + +TESTS += CXX_openmp_test +check_PROGRAMS += CXX_openmp_test +CXX_openmp_test_SOURCES = CXX_openmp_test.cpp + +TESTS += F90_openmp_test +check_PROGRAMS += F90_openmp_test +F90_openmp_test_SOURCES = F90_openmp_test.f90 + +TESTS += man_pages +TESTS += debugger +TESTS += version_match +TESTS += rm_execution diff --git a/tests/compilers/tests/debugger b/tests/compilers/tests/debugger new file mode 100755 index 0000000000..34dadd88bc --- /dev/null +++ b/tests/compilers/tests/debugger @@ -0,0 +1,44 @@ +#!../../common/bats/bin/bats +# -*-sh-*- + +load ../../common/test_helper_functions || exit 1 +source ../../common/functions || exit 1 + +if [ "$LMOD_FAMILY_COMPILER" = "gnu" ];then + family=gnu +elif [ "$LMOD_FAMILY_COMPILER" = "intel" ];then + family=intel +else + ERROR "Unsupported or unknown compiler family" +fi + +@test "[Compilers] debugger man page ($family)" { + if [ "$family" = "gnu" ];then + run man -w gdb + assert_success + elif [ "$family" = "intel" ];then + run man -w gdb-ia + assert_success + fi +} + +@test "[Compilers] debugger availability ($family)" { + if [ "$family" = "gnu" ];then + run which gdb + assert_success + + run gdb --version + assert_success + elif [ "$family" = "intel" ];then + run which gdb-ia + assert_success + + run gdb-ia --version + assert_success + fi +} + + + + + diff --git a/tests/compilers/tests/man_pages b/tests/compilers/tests/man_pages new file mode 100755 index 0000000000..94170f7165 --- /dev/null +++ b/tests/compilers/tests/man_pages @@ -0,0 +1,34 @@ +#!../../common/bats/bin/bats +# -*-sh-*- + +load ../../common/test_helper_functions || exit 1 +source ../../common/functions || exit 1 + +check_compiler_family CC CXX FC + +if [ "$LMOD_FAMILY_COMPILER" = "gnu" ];then + family=gnu +elif [ "$LMOD_FAMILY_COMPILER" = "intel" ];then + family=intel +else + ERROR "Unsupported or unknown compiler family" +fi + +@test "[Compilers] C compiler man page ($family)" { + run man -w $CC + assert_success +} + +@test "[Compilers] C++ compiler man page ($family)" { + run man -w $CXX + assert_success +} + +@test "[Compilers] Fortran compiler man page ($family)" { + run man -w $FC + assert_success +} + + + + diff --git a/tests/compilers/tests/rm_execution b/tests/compilers/tests/rm_execution new file mode 100755 index 0000000000..e4aa4238b8 --- /dev/null +++ b/tests/compilers/tests/rm_execution @@ -0,0 +1,70 @@ +#!../../common/bats/bin/bats +# -*-sh-*- + +load ../../common/test_helper_functions || exit 1 +source ../../common/functions || exit 1 + +if [ -s ../../TEST_ENV ];then + source ../../TEST_ENV +fi + +if [ "$RESOURCE_MANAGER" = "slurm" ];then + rm=slurm +else + ERROR "Unsupported or unknown resource manager" + exit 1 +fi + +@test "[Compilers] C binary runs under resource manager ($rm/$LMOD_FAMILY_COMPILER)" { + if [ ! -s C_test ];then + flunk "C_test binary does not exit" + fi + + run_serial_binary ./C_test + assert_success +} + +@test "[Compilers] C++ binary runs under resource manager ($rm/$LMOD_FAMILY_COMPILER)" { + if [ ! -s CXX_test ];then + flunk "CXX_test binary does not exit" + fi + + run_serial_binary ./CXX_test + assert_success +} + +@test "[Compilers] Fortran binary runs under resource manager ($rm/$LMOD_FAMILY_COMPILER)" { + if [ ! -s F90_test ];then + flunk "F90_test binary does not exit" + fi + + run_serial_binary ./F90_test + assert_success +} + +@test "[Compilers] C openmp binary runs under resource manager ($rm/$LMOD_FAMILY_COMPILER)" { + if [ ! -s C_openmp_test ];then + flunk "C_openmp_test binary does not exit" + fi + + run_serial_binary ./C_openmp_test 8 + assert_success +} + +@test "[Compilers] C++ openmp binary runs under resource manager ($rm/$LMOD_FAMILY_COMPILER)" { + if [ ! -s CXX_openmp_test ];then + flunk "CXX_openmp_test binary does not exit" + fi + + run_serial_binary ./CXX_openmp_test 8 + assert_success +} + +@test "[Compilers] Fortran openmp binary runs under resource manager ($rm/$LMOD_FAMILY_COMPILER)" { + if [ ! -s F90_openmp_test ];then + flunk "F90_openmp_test binary does not exit" + fi + + run_serial_binary ./F90_openmp_test 8 + assert_success +} diff --git a/tests/compilers/tests/version_match b/tests/compilers/tests/version_match new file mode 100755 index 0000000000..29a339540e --- /dev/null +++ b/tests/compilers/tests/version_match @@ -0,0 +1,56 @@ +#!../../common/bats/bin/bats +# -*-sh-*- + +load ../../common/test_helper_functions || exit 1 +source ../../common/functions || exit 1 + +if [ "$LMOD_FAMILY_COMPILER" = "gnu" ];then + family=gnu +elif [ "$LMOD_FAMILY_COMPILER" = "intel" ];then + family=intel +else + ERROR "Unsupported or unknown compiler family" +fi + +@test "[Compilers] compiler module loaded ($family)" { + module list $family >& .cmd_output || exit 1 + local my_module=`cat .cmd_output | sed '/^$/d' | sed 's/^[ \t]*//' | tail -1` + echo $my_module | grep -q "1) $family/" || exit 1 +} + +@test "[Compilers] compiler module version available ($family)" { + module list $family >& .cmd_output || exit 1 + local my_version=`cat .cmd_output | sed '/^$/d' | sed 's/^[ \t]*//' | tail -1 | awk -F "$family/" '{print $2}'` + + if [ -z "$my_version" ];then + flunk "ERROR: unable to ascertain module version ($my_version)" + fi + rm -f .cmd_output +} + +@test "[Compilers] C, C++, and Fortran versions match module ($family)" { + module list $family >& .cmd_output || exit 1 + local my_mod_version=`cat .cmd_output | sed '/^$/d' | sed 's/^[ \t]*//' | tail -1 | awk -F "$family/" '{print $2}'` + + if [ "$family" = "intel" ];then + version=`icc -V 2>&1 | grep Version | awk -F 'Version' '{print $2}' | awk '{print $1}'` || exit 1 + assert_equal "$my_mod_version" "$version" + version=`icpc -V 2>&1 | grep Version | awk -F 'Version' '{print $2}' | awk '{print $1}'` || exit 1 + assert_equal "$my_mod_version" "$version" + version=`ifort -V 2>&1 | grep Version | awk -F 'Version' '{print $2}' | awk '{print $1}'` || exit 1 + assert_equal "$my_mod_version" "$version" + elif [ "$family" = "gnu" ];then + version=`gcc --version | head -1 | awk '{print $3}'` + assert_equal "$my_mod_version" "$version" + version=`g++ --version | head -1 | awk '{print $3}'` + assert_equal "$my_mod_version" "$version" + version=`gfortran --version | head -1 | awk '{print $4}'` + assert_equal "$my_mod_version" "$version" + else + flunk "Unsupported compiler toolchain" + fi + + rm -f .cmd_output +} + + diff --git a/tests/configure.ac b/tests/configure.ac new file mode 100644 index 0000000000..14cdc89c92 --- /dev/null +++ b/tests/configure.ac @@ -0,0 +1,605 @@ +# -*- Autoconf -*- +# Process this file with autoconf to produce a configure script. + +AC_PREREQ([2.69]) +AC_INIT([test-suite], [1.0.0], [karl.w.schulz@intel.com]) +AC_CONFIG_MACRO_DIR([m4]) +AM_INIT_AUTOMAKE([1.14]) +m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) + +AC_CANONICAL_HOST + +AM_CONDITIONAL(HAVE_SHARED_CONDITIONAL,test 0) +AM_CONDITIONAL(DIRECT_VFD_CONDITIONAL,test 0) +AM_CONDITIONAL(BUILD_ALL_CONDITIONAL,test 0) + +# Test user +AX_CHECK_USER([root]) + +AC_ARG_ENABLE([all], + [AS_HELP_STRING([--disable-all],[Disable all tests by default (default=no]))], + [],[enable_all=yes]) + +# Test harness includes support for performing a set of quick-running +# tests or a longer suite of tests. Default is to run the quick +# configuration, user can opt-in for longer tests. + +AC_MSG_CHECKING([if requesting longer-running tests]) +AC_ARG_ENABLE([long], + [AS_HELP_STRING([--enable-long],[Enable longer-running test content (default=no]))], + [],[enable_long=no]) + +if test x$enable_long = xyes ;then + AC_MSG_RESULT([yes]) +else + AC_MSG_RESULT([no]) +fi + +# Use customizable test driver +#AC_SUBST([LOG_DRIVER],['$(SHELL) $(top_srcdir)/test-driver-cmt']) + +#----------------- +# ROOT level tests +#----------------- + +#------------------------------------------------------------------------------------------ +# Base operating system +AC_ARG_ENABLE([bos], + [AS_HELP_STRING([--enable-bos],[Enable bos tests (default=yes, root only)])], + [],[enable_bos=yes]) +AM_CONDITIONAL(BOS_ENABLED,test "x$enable_bos" = "xyes" ) +#------------------------------------------------------------------------------------------ +# Out-of-band +AC_ARG_ENABLE([oob], + [AS_HELP_STRING([--enable-oob],[Enable oob tests (default=yes, root only)])], + [],[enable_oob=yes]) +AM_CONDITIONAL(OOB_ENABLED,test "x$enable_oob" = "xyes" ) +#------------------------------------------------------------------------------------------ +# Cluster checker +AC_ARG_ENABLE([clck], + [AS_HELP_STRING([--enable-clck],[Enable clck tests (default=yes, root only)])], + [],[enable_clck=yes]) +AM_CONDITIONAL(CLCK_ENABLED,test "x$enable_clck" = "xyes" ) +#------------------------------------------------------------------------------------------ +# Lustre +AC_ARG_ENABLE([lustre], + [AS_HELP_STRING([--enable-lustre],[Enable Lustre utility tests (default=no, root only)])], + [],[enable_lustre=no]) +AM_CONDITIONAL(LUSTRE_ENABLED,test "x$enable_lustre" = "xyes" ) + +#----------------- +# User level tests +#----------------- + + + +#------------------------------------------------------------------------------------------ +# Compilers +AC_ARG_ENABLE([compilers], + [AS_HELP_STRING([--enable-compilers],[Enable compiler toolchain tests (default=yes)])],[], + [AX_OPTION_DEFAULT(type=short,enable_compilers,yes)]) +AM_CONDITIONAL(COMPILERS_ENABLED,test "x$enable_compilers" = "xyes" ) +#------------------------------------------------------------------------------------------ +# R +AC_ARG_ENABLE([R], + [AS_HELP_STRING([--enable-R],[Enable R tests (default=yes)])],[], + [AX_OPTION_DEFAULT(type=long,enable_R,yes)]) +AM_CONDITIONAL(R_ENABLED,test "x$enable_R" = "xyes" ) +#------------------------------------------------------------------------------------------ +# mpiP +AC_ARG_ENABLE([mpiP], + [AS_HELP_STRING([--enable-mpiP],[Enable mpiP profiler tests (default=yes)])],[], + [AX_OPTION_DEFAULT(type=long,enable_mpiP,yes)]) +AM_CONDITIONAL(MPIP_ENABLED,test "x$enable_mpiP" = "xyes" ) +#------------------------------------------------------------------------------------------ +# Valgrind +AC_ARG_ENABLE([valgrind], + [AS_HELP_STRING([--enable-valgrind],[Enable valgrind tests (default=yes)])],[], + [AX_OPTION_DEFAULT(type=short,enable_valgrind,yes)]) +AM_CONDITIONAL(VALGRIND_ENABLED,test "x$enable_valgrind" = "xyes" ) +#------------------------------------------------------------------------------------------ +# Intel-inspector +AC_ARG_ENABLE([inspector], + [AS_HELP_STRING([--enable-inspector],[Enable Intel Inspector tests (default=yes)])],[], + [AX_OPTION_DEFAULT(type=long,enable_inspector,yes)]) +AM_CONDITIONAL(INSPECTOR_ENABLED,test "x$enable_inspector" = "xyes" ) +#------------------------------------------------------------------------------------------ +# Intel-ITAC +AC_ARG_ENABLE([itac], + [AS_HELP_STRING([--enable-itac],[Enable Intel Trace Analyzer/Collector tests (default=yes)])],[], + [AX_OPTION_DEFAULT(type=long,enable_itac,yes)]) +AM_CONDITIONAL(ITAC_ENABLED,test "x$enable_itac" = "xyes" ) +#------------------------------------------------------------------------------------------ +# Intel-Vtune +AC_ARG_ENABLE([vtune], + [AS_HELP_STRING([--enable-vtune],[Enable Intel Vtune Amplifier XE tests (default=yes)])],[], + [AX_OPTION_DEFAULT(type=long,enable_vtune,yes)]) +AM_CONDITIONAL(VTUNE_ENABLED,test "x$enable_vtune" = "xyes" ) +#------------------------------------------------------------------------------------------ +# Intel-Advisor +AC_ARG_ENABLE([advisor], + [AS_HELP_STRING([--enable-advisor],[Enable Intel Advisor XE tests (default=yes)])],[], + [AX_OPTION_DEFAULT(type=long,enable_advisor,yes)]) +AM_CONDITIONAL(ADVISOR_ENABLED,test "x$enable_advisor" = "xyes" ) +#------------------------------------------------------------------------------------------ +# MPI +AC_ARG_ENABLE([mpi], + [AS_HELP_STRING([--enable-mpi],[Enable MPI compilation/execution tests (default=yes)])],[], + [AX_OPTION_DEFAULT(type=short,enable_mpi,yes)]) +AM_CONDITIONAL(MPI_ENABLED,test "x$enable_mpi" = "xyes" ) +#------------------------------------------------------------------------------------------ +# Apps +AC_ARG_ENABLE([apps], + [AS_HELP_STRING([--enable-apps],[Enable application oriented tests (default=yes)])],[], + [AX_OPTION_DEFAULT(type=long,enable_apps,yes)]) +AM_CONDITIONAL(APPS_ENABLED,test "x$enable_apps" = "xyes" ) +#------------------------------------------------------------------------------------------ +# NetCDF +AC_ARG_ENABLE([netcdf], + [AS_HELP_STRING([--enable-netcdf],[Enable NetCDF tests (default=yes)])],[], + [AX_OPTION_DEFAULT(type=long,enable_netcdf,yes)]) +AM_CONDITIONAL(NETCDF_ENABLED,test "x$enable_netcdf" = "xyes" ) +#------------------------------------------------------------------------------------------ +# HDF5 +AC_ARG_ENABLE([hdf5], + [AS_HELP_STRING([--enable-hdf5],[Enable HDF5 tests (default=yes)])],[], + [AX_OPTION_DEFAULT(type=long,enable_hdf5,yes)]) +AM_CONDITIONAL(HDF5_ENABLED,test "x$enable_hdf5" = "xyes" ) +#------------------------------------------------------------------------------------------ +# PHDF5 +AC_ARG_ENABLE([phdf5], + [AS_HELP_STRING([--enable-phdf5],[Enable PHDF5 tests (default=yes)])],[], + [AX_OPTION_DEFAULT(type=long,enable_phdf5,yes)]) +AM_CONDITIONAL(PHDF5_ENABLED,test "x$enable_phdf5" = "xyes" ) +#------------------------------------------------------------------------------------------ +# IMB +AC_ARG_ENABLE([imb], + [AS_HELP_STRING([--enable-imb],[Enable Intel MPI Benchmarks tests (default=yes)])],[], + [AX_OPTION_DEFAULT(type=long,enable_imb,yes)]) +AM_CONDITIONAL(IMB_ENABLED,test "x$enable_imb" = "xyes" ) +#------------------------------------------------------------------------------------------ +# GSL +AC_ARG_ENABLE([gsl], + [AS_HELP_STRING([--enable-gsl],[Enable GSL library tests (default=yes)])],[], + [AX_OPTION_DEFAULT(type=long,enable_gsl,yes)]) +AM_CONDITIONAL(GSL_ENABLED,test "x$enable_gsl" = "xyes" ) +#------------------------------------------------------------------------------------------ +# FFTW +AC_ARG_ENABLE([fftw], + [AS_HELP_STRING([--enable-fftw],[Enable FFTW library tests (default=yes)])],[], + [AX_OPTION_DEFAULT(type=long,enable_fftw,yes)]) +AM_CONDITIONAL(FFTW_ENABLED,test "x$enable_fftw" = "xyes" ) +#------------------------------------------------------------------------------------------ +# Adios +AC_ARG_ENABLE([adios], + [AS_HELP_STRING([--enable-adios],[Enable Adios tests (default=yes)])],[], + [AX_OPTION_DEFAULT(type=long,enable_adios,yes)]) +AM_CONDITIONAL(ADIOS_ENABLED,test "x$enable_adios" = "xyes" ) +#------------------------------------------------------------------------------------------ +# Boost +AC_ARG_ENABLE([boost], + [AS_HELP_STRING([--enable-boost],[Enable BOOST tests (default=yes)])],[], + [AX_OPTION_DEFAULT(type=long,enable_boost,yes)]) +AM_CONDITIONAL(BOOST_ENABLED,test "x$enable_boost" = "xyes" ) +#------------------------------------------------------------------------------------------ +# Boost (MPI) +AC_ARG_ENABLE([boost-mpi], + [AS_HELP_STRING([--enable-boost-mpi],[Enable BOOST library MPI tests (default=yes)])],[], + [AX_OPTION_DEFAULT(type=long,enable_boost_mpi,yes)]) +AM_CONDITIONAL(BOOST_MPI_ENABLED,test "x$enable_boost_mpi" = "xyes" ) +#------------------------------------------------------------------------------------------ +# HYPRE +AC_ARG_ENABLE([hypre], + [AS_HELP_STRING([--enable-hypre],[Enable HYPRE tests (default=yes)])],[], + [AX_OPTION_DEFAULT(type=long,enable_hypre,yes)]) +AM_CONDITIONAL(HYPRE_ENABLED,test "x$enable_hypre" = "xyes" ) +#------------------------------------------------------------------------------------------ +# MODULES +AC_ARG_ENABLE([modules], + [AS_HELP_STRING([--enable-modules],[Enable Module tests (default=yes)])],[], + [AX_OPTION_DEFAULT(type=short,enable_modules,yes)]) + AM_CONDITIONAL(MODULES_ENABLED,test "x$enable_modules" = "xyes" ) +#------------------------------------------------------------------------------------------ +# Numpy +AC_ARG_ENABLE([numpy], + [AS_HELP_STRING([--enable-numpy],[Enable numpy tests (default=yes)])],[], + [AX_OPTION_DEFAULT(type=long,enable_numpy,yes)]) +AM_CONDITIONAL(NUMPY_ENABLED,test "x$enable_numpy" = "xyes" ) +#------------------------------------------------------------------------------------------ +# Metis +AC_ARG_ENABLE([metis], + [AS_HELP_STRING([--enable-metis],[Enable metis tests (default=yes)])],[], + [AX_OPTION_DEFAULT(type=long,enable_metis,yes)]) +AM_CONDITIONAL(METIS_ENABLED,test "x$enable_metis" = "xyes" ) +#------------------------------------------------------------------------------------------ +# MUMPS +AC_ARG_ENABLE([mumps], + [AS_HELP_STRING([--enable-mumps],[Enable MUMPS tests (default=yes)])],[], + [AX_OPTION_DEFAULT(type=long,enable_mumps,yes)]) +AM_CONDITIONAL(MUMPS_ENABLED,test "x$enable_mumps" = "xyes" ) +#------------------------------------------------------------------------------------------ +# OOM +AC_ARG_ENABLE([oom], + [AS_HELP_STRING([--enable-oom],[Enable out-of-memory tests under resource manager (default=yes)])],[], + [AX_OPTION_DEFAULT(type=short,enable_oom,yes)]) +AM_CONDITIONAL(OOM_ENABLED,test "x$enable_oom" = "xyes" ) +#------------------------------------------------------------------------------------------ +# OPENBLAS +AC_ARG_ENABLE([openblas], + [AS_HELP_STRING([--enable-openblas],[Enable OPENBLAS tests (default=yes)])],[], + [AX_OPTION_DEFAULT(type=long,enable_openblas,yes)]) +AM_CONDITIONAL(OPENBLAS_ENABLED,test "x$enable_openblas" = "xyes" ) +#------------------------------------------------------------------------------------------ +# Papi +AC_ARG_ENABLE([papi], + [AS_HELP_STRING([--enable-papi],[Enable papi tests (default=yes)])],[], + [AX_OPTION_DEFAULT(type=short,enable_papi,yes)]) +AM_CONDITIONAL(PAPI_ENABLED,test "x$enable_papi" = "xyes" ) +#------------------------------------------------------------------------------------------ +# Petsc +AC_ARG_ENABLE([petsc], + [AS_HELP_STRING([--enable-petsc],[Enable petsc tests (default=yes)])],[], + [AX_OPTION_DEFAULT(type=long,enable_petsc,yes)]) +AM_CONDITIONAL(PETSC_ENABLED,test "x$enable_petsc" = "xyes" ) +#------------------------------------------------------------------------------------------ +# RMS harness +AC_ARG_ENABLE([rms-harness], + [AS_HELP_STRING([--enable-rms-harness],[Enable RMS harness tests(default=yes)])],[], + [AX_OPTION_DEFAULT(type=short,enable_rms_harness,yes)]) +AM_CONDITIONAL(RMS_HARNESS_ENABLED,test "x$enable_rms_harness" = "xyes" ) +#------------------------------------------------------------------------------------------ +# Scalapack +AC_ARG_ENABLE([scalapack], + [AS_HELP_STRING([--enable-scalapack],[Enable scalapack tests (default=yes)])],[], + [AX_OPTION_DEFAULT(type=long,enable_scalapack,yes)]) +AM_CONDITIONAL(SCALAPACK_ENABLED,test "x$enable_scalapack" = "xyes" ) +#------------------------------------------------------------------------------------------ +# Scipy +AC_ARG_ENABLE([scipy], + [AS_HELP_STRING([--enable-scipy],[Enable scipy tests (default=yes)])],[], + [AX_OPTION_DEFAULT(type=long,enable_scipy,yes)]) +AM_CONDITIONAL(SCIPY_ENABLED,test "x$enable_scipy" = "xyes" ) +#------------------------------------------------------------------------------------------ +# SuperLU_dist +AC_ARG_ENABLE([superlu_dist], + [AS_HELP_STRING([--enable-superlu_dist],[Enable superlu_dist tests (default=yes)])],[], + [AX_OPTION_DEFAULT(type=long,enable_superlu_dist,yes)]) +AM_CONDITIONAL(SUPERLU_DIST_ENABLED,test "x$enable_superlu_dist" = "xyes" ) +#------------------------------------------------------------------------------------------ +# TAU +AC_ARG_ENABLE([tau], + [AS_HELP_STRING([--enable-tau],[Enable tau tests (default=yes)])],[], + [AX_OPTION_DEFAULT(type=long,enable_tau,yes)]) +AM_CONDITIONAL(TAU_ENABLED,test "x$enable_tau" = "xyes" ) +#------------------------------------------------------------------------------------------ +# TBB +AC_ARG_ENABLE([tbb], + [AS_HELP_STRING([--enable-tbb],[Enable tbb tests (default=yes)])],[], + [AX_OPTION_DEFAULT(type=long,enable_tbb,yes)]) +AM_CONDITIONAL(TBB_ENABLED,test "x$enable_tbb" = "xyes" ) +#------------------------------------------------------------------------------------------ +# CILK +AC_ARG_ENABLE([cilk], + [AS_HELP_STRING([--enable-cilk],[Enable cilk tests (default=yes)])],[], + [AX_OPTION_DEFAULT(type=long,enable_cilk,yes)]) +AM_CONDITIONAL(CILK_ENABLED,test "x$enable_cilk" = "xyes" ) +#------------------------------------------------------------------------------------------ +# Trilinos +AC_ARG_ENABLE([trilinos], + [AS_HELP_STRING([--enable-trilinos],[Enable trilinos tests (default=yes)])],[], + [AX_OPTION_DEFAULT(type=long,enable_trilinos,yes)]) +AM_CONDITIONAL(TRILINOS_ENABLED,test "x$enable_trilinos" = "xyes" ) +#------------------------------------------------------------------------------------------ +# User Environment +AC_ARG_ENABLE([munge], + [AS_HELP_STRING([--enable-munge],[Enable munge authentication tests (default=yes)])],[], + [AX_OPTION_DEFAULT(type=short,enable_munge,yes)]) +AM_CONDITIONAL(USERENV_ENABLED,test "x$enable_munge" = "xyes" ) +#------------------------------------------------------------------------------------------ + +AC_OUTPUT( Makefile + provisioning/Makefile + user-env/Makefile + bos/Makefile + perf-tools/intel-itac/Makefile + perf-tools/intel-itac/tests/Makefile + perf-tools/intel-advisor/Makefile + perf-tools/intel-advisor/tests/Makefile + perf-tools/tau/Makefile + hardware/Makefile + oob/Makefile + clck/Makefile + lustre/Makefile + dev-tools/numpy/Makefile + dev-tools/numpy/tests/Makefile + dev-tools/scipy/Makefile + dev-tools/scipy/tests/Makefile + dev-tools/tbb/Makefile + dev-tools/tbb/tests/Makefile + dev-tools/cilk/Makefile + dev-tools/R-base/Makefile + modules/Makefile) + +echo +echo '--------------------------------------------- SUMMARY ---------------------------------------------' +echo +echo Package version............... : $PACKAGE-$VERSION +echo +echo Build user.................... : $USER +echo Build host.................... : ${ac_hostname} +echo Configure date................ : `date +'%F %H:%M'` +echo Build architecture............ : ${host} +if test "x$enable_long" = "xyes" ; then + echo Test suite configuration...... : long +else + echo Test suite configuration...... : short +fi +echo +echo Submodule Configuration: +echo +if test "x$ROOT_ENABLED" = "x1" ; then + if test "x$enable_bos" = "xyes"; then + echo ' 'Base operating system..... : enabled + else + echo ' 'Base operating system..... : disabled + fi + if test "x$enable_oob" = "xyes"; then + echo ' 'Out of band tools......... : enabled + else + echo ' 'Out of band tools......... : disabled + fi + if test "x$enable_hardware" = "xyes"; then + echo ' 'Hardware benchmarks....... : enabled + else + echo ' 'Hardware benchmarks....... : disabled + fi + if test "x$enable_clck" = "xyes"; then + echo ' 'Cluster checker........... : enabled + else + echo ' 'Cluster checker........... : disabled + fi + if test "x$enable_lustre" = "xyes"; then + echo ' 'Lustre client............. : enabled + else + echo ' 'Lustre client............. : disabled + fi + +else + +echo User Environment: + if test "x$enable_rms_harness" = "xyes"; then + echo ' 'RMS test harness.......... : enabled + else + echo ' 'RMS test harness.......... : disabled + fi + + if test "x$enable_munge" = "xyes"; then + echo ' 'Munge..................... : enabled + else + echo ' 'Munge..................... : disabled + fi + + if test "x$enable_apps" = "xyes"; then + echo ' 'Apps...................... : enabled + else + echo ' 'Apps...................... : disabled + fi + + if test "x$enable_compilers" = "xyes"; then + echo ' 'Compilers................. : enabled + else + echo ' 'Compilers................. : disabled + fi + + if test "x$enable_mpi" = "xyes"; then + echo ' 'MPI....................... : enabled + else + echo ' 'MPI....................... : disabled + fi + + if test "x$enable_modules" = "xyes"; then + echo ' 'Modules................... : enabled + else + echo ' 'Modules................... : disabled + fi + + if test "x$enable_oom" = "xyes"; then + echo ' 'OOM....................... : enabled + else + echo ' 'OOM....................... : disabled + fi + +echo Dev Tools: + + if test "x$enable_easybuild" = "xyes"; then + echo ' 'EasyBuild................. : enabled + else + echo ' 'EasyBuild................. : disabled + fi + + if test "x$enable_inspector" = "xyes"; then + echo ' 'Intel Inspector........... : enabled + else + echo ' 'Intel Inspector........... : disabled + fi + + if test "x$enable_valgrind" = "xyes"; then + echo ' 'Valgrind.................. : enabled + else + echo ' 'Valgrind.................. : disabled + fi + + if test "x$enable_R" = "xyes"; then + echo ' 'R base package............ : enabled + else + echo ' 'R base package............ : disabled + fi + + if test "x$enable_tbb" = "xyes"; then + echo ' 'TBB....................... : enabled + else + echo ' 'TBB....................... : disabled + fi + + if test "x$enable_cilk" = "xyes"; then + echo ' 'CILK...................... : enabled + else + echo ' 'CILK...................... : disabled + fi + +echo Performance Tools: + + if test "x$enable_mpiP" = "xyes"; then + echo ' 'mpiP Profiler........ .... : enabled + else + echo ' 'mpiP Profiler............. : disabled + fi + + if test "x$enable_advisor" = "xyes"; then + echo ' 'Intel Advisor XE.......... : enabled + else + echo ' 'Intel Advisor XE.......... : disabled + fi + + if test "x$enable_itac" = "xyes"; then + echo ' 'Intel Trace Analyzer...... : enabled + else + echo ' 'Intel Trace Analyzer...... : disabled + fi + + if test "x$enable_vtune" = "xyes"; then + echo ' 'Intel Vtune Amplifier..... : enabled + else + echo ' 'Intel Vtune Amplifier..... : disabled + fi + + if test "x$enable_papi" = "xyes"; then + echo ' 'Papi...................... : enabled + else + echo ' 'Papi...................... : disabled + fi + + if test "x$enable_tau" = "xyes"; then + echo ' 'TAU....................... : enabled + else + echo ' 'TAU....................... : disabled + fi + +echo Libraries: + + if test "x$enable_adios" = "xyes"; then + echo ' 'Adios .................... : enabled + else + echo ' 'Adios .................... : disabled + fi + + if test "x$enable_boost" = "xyes"; then + echo ' 'Boost .................... : enabled + else + echo ' 'Boost .................... : disabled + fi + + if test "x$enable_boost_mpi" = "xyes"; then + echo ' 'Boost MPI................. : enabled + else + echo ' 'Boost MPI................. : disabled + fi + + if test "x$enable_fftw" = "xyes"; then + echo ' 'FFTW...................... : enabled + else + echo ' 'FFTW...................... : disabled + fi + + if test "x$enable_gsl" = "xyes"; then + echo ' 'GSL....................... : enabled + else + echo ' 'GSL....................... : disabled + fi + + if test "x$enable_hdf5" = "xyes"; then + echo ' 'HDF5...................... : enabled + else + echo ' 'HDF5...................... : disabled + fi + + if test "x$enable_hypre" = "xyes"; then + echo ' 'HYPRE..................... : enabled + else + echo ' 'HYPRE..................... : disabled + fi + + if test "x$enable_imb" = "xyes"; then + echo ' 'IMB....................... : enabled + else + echo ' 'IMB....................... : disabled + fi + + if test "x$enable_metis" = "xyes"; then + echo ' 'Metis..................... : enabled + else + echo ' 'Metis..................... : disabled + fi + + if test "x$enable_mumps" = "xyes"; then + echo ' 'MUMPS..................... : enabled + else + echo ' 'MUMPS..................... : disabled + fi + + if test "x$enable_netcdf" = "xyes"; then + echo ' 'NetCDF.................... : enabled + else + echo ' 'NetCDF.................... : disabled + fi + + if test "x$enable_numpy" = "xyes"; then + echo ' 'Numpy..................... : enabled + else + echo ' 'Numpy..................... : disabled + fi + + if test "x$enable_openblas" = "xyes"; then + echo ' 'OPENBLAS.................. : enabled + else + echo ' 'OPENBLAS.................. : disabled + fi + + if test "x$enable_petsc" = "xyes"; then + echo ' 'PETSc..................... : enabled + else + echo ' 'PETSc..................... : disabled + fi + + if test "x$enable_phdf5" = "xyes"; then + echo ' 'PHDF5..................... : enabled + else + echo ' 'PHDF5..................... : disabled + fi + + if test "x$enable_scalapack" = "xyes"; then + echo ' 'ScaLAPACK................. : enabled + else + echo ' 'ScaLAPACK................. : disabled + fi + + if test "x$enable_scipy" = "xyes"; then + echo ' 'Scipy..................... : enabled + else + echo ' 'Scipy..................... : disabled + fi + + if test "x$enable_superlu_dist" = "xyes"; then + echo ' 'Superlu_dist.............. : enabled + else + echo ' 'Superlu_dist.............. : disabled + fi + + if test "x$enable_trilinos" = "xyes"; then + echo ' 'Trilinos ................. : enabled + else + echo ' 'Trilinos.................. : disabled + fi + +fi +echo '---------------------------------------------------------------------------------------------------' diff --git a/tests/dev-tools/R-base/Makefile.am b/tests/dev-tools/R-base/Makefile.am new file mode 100644 index 0000000000..6965ac054e --- /dev/null +++ b/tests/dev-tools/R-base/Makefile.am @@ -0,0 +1,3 @@ +ACLOCAL_AMFLAGS = -I m4 +AM_MAKEFLAGS = --no-print-directory +SUBDIRS = tests diff --git a/tests/dev-tools/R-base/bootstrap b/tests/dev-tools/R-base/bootstrap new file mode 120000 index 0000000000..b17b398013 --- /dev/null +++ b/tests/dev-tools/R-base/bootstrap @@ -0,0 +1 @@ +../../bootstrap \ No newline at end of file diff --git a/tests/dev-tools/R-base/configure.ac b/tests/dev-tools/R-base/configure.ac new file mode 100644 index 0000000000..f6ae27afdd --- /dev/null +++ b/tests/dev-tools/R-base/configure.ac @@ -0,0 +1,53 @@ +# -*- Autoconf -*- +# Process this file with autoconf to produce a configure script. +# + +AC_PREREQ(2.59) +AC_INIT([R_base], [0.10.0], [karl.w.schulz@intel.com]) +AC_CONFIG_MACRO_DIR([m4]) +AM_INIT_AUTOMAKE([foreign]) +m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) + +# verify we have necessary environment variables set +AC_MSG_CHECKING([for R_BASE_DIR environment variable]) +if test "x$R_BASE_DIR" = "x"; then + AC_MSG_RESULT([no]) + echo + AC_ERROR([R_BASE_DIR not defined - please load R_base environment.]) +else + AC_MSG_RESULT([yes]) +fi + +OHPC_COMPILER_FAMILY + +# test compilers + +# (TRon Mar 25, 2015) +# Added the AM conditionals below for use with mkl-ublas header +# with different options for ICC and GCC +#AM_CONDITIONAL(ICC, test $LMOD_FAMILY_COMPILER = "intel") +#AM_CONDITIONAL(GCC, test $LMOD_FAMILY_COMPILER = "gnu") + +AC_PROG_CXX + +# Set subdirectories +AC_CONFIG_FILES(Makefile tests/Makefile) +# tests/mkl-ublas/test/Makefile \ + + +# Configure +AC_OUTPUT() + +echo +echo '-------------------------------------------------- SUMMARY --------------------------------------------------' +echo +echo Package version............... : $PACKAGE-$VERSION +echo OHPC compiler toolchain........ : $LMOD_FAMILY_COMPILER +echo +echo R location.................... : `which $R_BASE_BIN/R` +echo Rscript location.............. : `which $R_BASE_BIN/Rscript` +echo R_base install dir............ : $R_BASE_DIR +echo R_base lib dir................ : $R_BASE_LIB +echo R_base share dir.............. : $R_BASE_SHARE +echo +echo '-------------------------------------------------------------------------------------------------------------' diff --git a/tests/dev-tools/R-base/m4/compiler_family.m4 b/tests/dev-tools/R-base/m4/compiler_family.m4 new file mode 100644 index 0000000000..22ec81b2ca --- /dev/null +++ b/tests/dev-tools/R-base/m4/compiler_family.m4 @@ -0,0 +1,38 @@ +# SYNOPSIS +# +# Test for OHPC supported compiler toolchains +# +# COMPILER_FAMILY() +# +# DESCRIPTION +# +# Queries configuration environment to detect compiler toolchain +# loaded via Lmod. Sets CC, CXX, and FC to match supported +# toolchains. +# +# CONTRIBUTORS +# +# Karl W. Schulz + +AC_DEFUN([OHPC_COMPILER_FAMILY], +[ + +AC_MSG_CHECKING([for loaded OHPC compiler toolchain]) + +if test "x$LMOD_FAMILY_COMPILER" = "xgnu"; then + CC=gcc + CXX=g++ + FC=gfortran + AC_MSG_RESULT([gnu]) +elif test "x$LMOD_FAMILY_COMPILER" = "xintel"; then + CC=icc + CXX=icpc + FC=ifort + AC_MSG_RESULT([intel]) +else + AC_MSG_RESULT([unknown]) + echo + AC_ERROR([Unknown compiler family - please load a compiler toolchain.]) +fi + +]) diff --git a/tests/dev-tools/R-base/ohpc-tests/test_compiler_families b/tests/dev-tools/R-base/ohpc-tests/test_compiler_families new file mode 100755 index 0000000000..83b8f4b65f --- /dev/null +++ b/tests/dev-tools/R-base/ohpc-tests/test_compiler_families @@ -0,0 +1,45 @@ +#!/bin/bash +# -*-sh-*- + +TEST_LOGS="" +MAKEFLAGS="" + + +source ./TEST_ENV || exit 1 +source ./common/functions || exit 1 + +cd dev-tools/R-base || exit 1 +export BATS_JUNIT_CLASS="R_base" + +# bootstrap the local autotools project if necessary + +./bootstrap || exit 1 + +for compiler in gnu ; do + + echo " " + echo " " + echo "-------------------------------------------------------" + echo "Dev Tools: R_base tests: $compiler" + echo "-------------------------------------------------------" + + module purge || exit 1 + module load $compiler || exit 1 + module load R_base || exit 1 + + if [ "$compiler" = "intel" ]; then + # module load mkl || exit 1 + echo "Need to prepend libgfortran.so path to LD_LIBRARY_PATH when using the $compiler toolchain" + export LD_LIBRARY_PATH=/opt/ohpc/pub/compiler/gcc/4.9.2/lib64/:$LD_LIBRARY_PATH + fi + + + ./configure || exit 1 + make clean || exit 1 + make -k check || exit 1 + + save_logs_compiler_family tests $compiler + + make distclean +done + diff --git a/tests/dev-tools/R-base/tests/Makefile.am b/tests/dev-tools/R-base/tests/Makefile.am new file mode 100644 index 0000000000..0bd8ed3763 --- /dev/null +++ b/tests/dev-tools/R-base/tests/Makefile.am @@ -0,0 +1 @@ +TESTS = test_module rm_execution diff --git a/tests/dev-tools/R-base/tests/R-benchmark-25-noSuppDist.R b/tests/dev-tools/R-base/tests/R-benchmark-25-noSuppDist.R new file mode 100644 index 0000000000..b9e259213e --- /dev/null +++ b/tests/dev-tools/R-base/tests/R-benchmark-25-noSuppDist.R @@ -0,0 +1,388 @@ +# R Benchmark 2.5 (06/2008) [Simon Urbanek] +# version 2.5: scaled to get roughly 1s per test, R 2.7.0 @ 2.6GHz Mac Pro +# R Benchmark 2.4 (06/2008) [Simon Urbanek] +# version 2.4 adapted to more recent Matrix package +# R Benchmark 2.3 (21 April 2004) +# Warning: changes are not carefully checked yet! +# version 2.3 adapted to R 1.9.0 +# Many thanks to Douglas Bates (bates@stat.wisc.edu) for improvements! +# version 2.2 adapted to R 1.8.0 +# version 2.1 adapted to R 1.7.0 +# version 2, scaled to get 1 +/- 0.1 sec with R 1.6.2 +# using the standard ATLAS library (Rblas.dll) +# on a Pentium IV 1.6 Ghz with 1 Gb Ram on Win XP pro + +# revised and optimized for R v. 1.5.x, 8 June 2002 +# Requires additionnal libraries: Matrix, SuppDists +# Author : Philippe Grosjean +# eMail : phgrosjean@sciviews.org +# Web : http://www.sciviews.org +# License: GPL 2 or above at your convenience (see: http://www.gnu.org) +# +# Several tests are adapted from the Splus Benchmark Test V. 2 +# by Stephan Steinhaus (stst@informatik.uni-frankfurt.de) +# Reference for Escoufier's equivalents vectors (test III.5): +# Escoufier Y., 1970. Echantillonnage dans une population de variables +# aleatoires réelles. Publ. Inst. Statis. Univ. Paris 19 Fasc 4, 1-47. +# +# type source("c://R2.R") to start the test + +runs <- 3 # Number of times the tests are executed +times <- rep(0, 15); dim(times) <- c(5,3) +require(Matrix) # Optimized matrix operations +###~~~~~~~~~~#### TRon (4/27/15) Not using SuppDist lib for CMT .......... +###require(SuppDists) # Optimized random number generators +###Runif <- rMWC1019 # The fast uniform number generator +Runif <- runif +# If you don't have SuppDists, you can use: Runif <- runif +#a <- rMWC1019(10, new.start=TRUE, seed=492166) # Init. the generator +a <- runif(10) #TRon (4/27/15) Replacing rMWC above ............ +###Rnorm <- rziggurat # The fast normal number generator +# If you don't have SuppDists, you can use: Rnorm <- rnorm +#b <- rziggurat(10, new.start=TRUE) # Init. the generator +b <- rnorm(10) #~~~~~~~~~~~# TRon (4/27/15) Replacing ziggurat above ..... +Rnorm <- rnorm +remove("a", "b") +options(object.size=100000000) + +cat("\n\n R Benchmark 2.5\n") +cat(" ===============\n") +cat(c("Number of times each test is run__________________________: ", runs)) +cat("\n\n") + + +cat(" I. Matrix calculation\n") +cat(" ---------------------\n") +if (R.Version()$os == "Win32" || R.Version()$os == "mingw32") flush.console() + +# (1) +cumulate <- 0; a <- 0; b <- 0 +for (i in 1:runs) { + invisible(gc()) + timing <- system.time({ + a <- matrix(Rnorm(2500*2500)/10, ncol=2500, nrow=2500); + b <- t(a); + dim(b) <- c(1250, 5000); + a <- t(b) + })[3] + cumulate <- cumulate + timing +} +timing <- cumulate/runs +times[1, 1] <- timing +cat(c("Creation, transp., deformation of a 2500x2500 matrix (sec): ", timing, "\n")) +remove("a", "b") +if (R.Version()$os == "Win32" || R.Version()$os == "mingw32") flush.console() + +# (2) +cumulate <- 0; b <- 0 +for (i in 1:runs) { + a <- abs(matrix(Rnorm(2500*2500)/2, ncol=2500, nrow=2500)); + invisible(gc()) + timing <- system.time({ + b <- a^1000 + })[3] + cumulate <- cumulate + timing +} +timing <- cumulate/runs +times[2, 1] <- timing +cat(c("2400x2400 normal distributed random matrix ^1000____ (sec): ", timing, "\n")) +remove("a", "b") +if (R.Version()$os == "Win32" || R.Version()$os == "mingw32") flush.console() + +# (3) +cumulate <- 0; b <- 0 +for (i in 1:runs) { + a <- Rnorm(7000000) + invisible(gc()) + timing <- system.time({ + b <- sort(a, method="quick") # Sort is modified in v. 1.5.x + # And there is now a quick method that better competes with other packages!!! + })[3] + cumulate <- cumulate + timing +} +timing <- cumulate/runs +times[3, 1] <- timing +cat(c("Sorting of 7,000,000 random values__________________ (sec): ", timing, "\n")) +remove("a", "b") +if (R.Version()$os == "Win32" || R.Version()$os == "mingw32") flush.console() + +# (4) +cumulate <- 0; b <- 0 +for (i in 1:runs) { + a <- Rnorm(2800*2800); dim(a) <- c(2800, 2800) + invisible(gc()) + timing <- system.time({ + b <- crossprod(a) # equivalent to: b <- t(a) %*% a + })[3] + cumulate <- cumulate + timing +} +timing <- cumulate/runs +times[4, 1] <- timing +cat(c("2800x2800 cross-product matrix (b = a' * a)_________ (sec): ", timing, "\n")) +remove("a", "b") +if (R.Version()$os == "Win32" || R.Version()$os == "mingw32") flush.console() + +# (5) +cumulate <- 0; c <- 0; qra <-0 +for (i in 1:runs) { + a <- new("dgeMatrix", x = Rnorm(2000*2000), Dim = as.integer(c(2000,2000))) + b <- as.double(1:2000) + invisible(gc()) + timing <- system.time({ + c <- solve(crossprod(a), crossprod(a,b)) + })[3] + cumulate <- cumulate + timing + + # This is the old method + #a <- Rnorm(600*600); dim(a) <- c(600,600) + #b <- 1:600 + #invisible(gc()) + #timing <- system.time({ + # qra <- qr(a, tol = 1e-7); + # c <- qr.coef(qra, b) + # #Rem: a little faster than c <- lsfit(a, b, inter=F)$coefficients + #})[3] + #cumulate <- cumulate + timing +} +timing <- cumulate/runs +times[5, 1] <- timing +cat(c("Linear regr. over a 3000x3000 matrix (c = a \\ b')___ (sec): ", timing, "\n")) +remove("a", "b", "c", "qra") +if (R.Version()$os == "Win32" || R.Version()$os == "mingw32") flush.console() + +times[ , 1] <- sort(times[ , 1]) +cat(" --------------------------------------------\n") +cat(c(" Trimmed geom. mean (2 extremes eliminated): ", exp(mean(log(times[2:4, 1]))), "\n\n")) + +cat(" II. Matrix functions\n") +cat(" --------------------\n") +if (R.Version()$os == "Win32") flush.console() + +# (1) +cumulate <- 0; b <- 0 +for (i in 1:runs) { + a <- Rnorm(2400000) + invisible(gc()) + timing <- system.time({ + b <- fft(a) + })[3] + cumulate <- cumulate + timing +} +timing <- cumulate/runs +times[1, 2] <- timing +cat(c("FFT over 2,400,000 random values____________________ (sec): ", timing, "\n")) +remove("a", "b") +if (R.Version()$os == "Win32" || R.Version()$os == "mingw32") flush.console() + +# (2) +cumulate <- 0; b <- 0 +for (i in 1:runs) { + a <- array(Rnorm(600*600), dim = c(600, 600)) + # Only needed if using eigen.Matrix(): Matrix.class(a) + invisible(gc()) + timing <- system.time({ + b <- eigen(a, symmetric=FALSE, only.values=TRUE)$Value + # Rem: on my machine, it is faster than: + # b <- La.eigen(a, symmetric=F, only.values=T, method="dsyevr")$Value + # b <- La.eigen(a, symmetric=F, only.values=T, method="dsyev")$Value + # b <- eigen.Matrix(a, vectors = F)$Value + })[3] + cumulate <- cumulate + timing +} +timing <- cumulate/runs +times[2, 2] <- timing +cat(c("Eigenvalues of a 640x640 random matrix______________ (sec): ", timing, "\n")) +remove("a", "b") +if (R.Version()$os == "Win32" || R.Version()$os == "mingw32") flush.console() + +# (3) +cumulate <- 0; b <- 0 +for (i in 1:runs) { + a <- Rnorm(2500*2500); dim(a) <- c(2500, 2500) + #Matrix.class(a) + invisible(gc()) + timing <- system.time({ + #b <- determinant(a, logarithm=F) + # Rem: the following is slower on my computer! + # b <- det.default(a) + b <- det(a) + })[3] + cumulate <- cumulate + timing +} +timing <- cumulate/runs +times[3, 2] <- timing +cat(c("Determinant of a 2500x2500 random matrix____________ (sec): ", timing, "\n")) +remove("a", "b") +if (R.Version()$os == "Win32" || R.Version()$os == "mingw32") flush.console() + +# (4) +cumulate <- 0; b <- 0 +for (i in 1:runs) { + a <- crossprod(new("dgeMatrix", x = Rnorm(3000*3000), + Dim = as.integer(c(3000, 3000)))) + invisible(gc()) + #a <- Rnorm(900*900); dim(a) <- c(900, 900) + #a <- crossprod(a, a) + timing <- system.time({ + b <- chol(a) + })[3] + cumulate <- cumulate + timing +} +timing <- cumulate/runs +times[4, 2] <- timing +cat(c("Cholesky decomposition of a 3000x3000 matrix________ (sec): ", timing, "\n")) +remove("a", "b") +if (R.Version()$os == "Win32" || R.Version()$os == "mingw32") flush.console() + +# (5) +cumulate <- 0; b <- 0 +for (i in 1:runs) { + a <- new("dgeMatrix", x = Rnorm(1600*1600), Dim = as.integer(c(1600, 1600))) + invisible(gc()) + #a <- Rnorm(400*400); dim(a) <- c(400, 400) + timing <- system.time({ + # b <- qr.solve(a) + # Rem: a little faster than + b <- solve(a) + })[3] + cumulate <- cumulate + timing +} +timing <- cumulate/runs +times[5, 2] <- timing +cat(c("Inverse of a 1600x1600 random matrix________________ (sec): ", timing, "\n")) +remove("a", "b") +if (R.Version()$os == "Win32" || R.Version()$os == "mingw32") flush.console() + +times[ , 2] <- sort(times[ , 2]) +cat(" --------------------------------------------\n") +cat(c(" Trimmed geom. mean (2 extremes eliminated): ", exp(mean(log(times[2:4, 2]))), "\n\n")) + +cat(" III. Programmation\n") +cat(" ------------------\n") +if (R.Version()$os == "Win32" || R.Version()$os == "mingw32") flush.console() + +# (1) +cumulate <- 0; a <- 0; b <- 0; phi <- 1.6180339887498949 +for (i in 1:runs) { + a <- floor(Runif(3500000)*1000) + invisible(gc()) + timing <- system.time({ + b <- (phi^a - (-phi)^(-a))/sqrt(5) + })[3] + cumulate <- cumulate + timing +} +timing <- cumulate/runs +times[1, 3] <- timing +cat(c("3,500,000 Fibonacci numbers calculation (vector calc)(sec): ", timing, "\n")) +remove("a", "b", "phi") +if (R.Version()$os == "Win32" || R.Version()$os == "mingw32") flush.console() + +# (2) +cumulate <- 0; a <- 3000; b <- 0 +for (i in 1:runs) { + invisible(gc()) + timing <- system.time({ + b <- rep(1:a, a); dim(b) <- c(a, a); + b <- 1 / (t(b) + 0:(a-1)) + # Rem: this is twice as fast as the following code proposed by R programmers + # a <- 1:a; b <- 1 / outer(a - 1, a, "+") + })[3] + cumulate <- cumulate + timing +} +timing <- cumulate/runs +times[2, 3] <- timing +cat(c("Creation of a 3000x3000 Hilbert matrix (matrix calc) (sec): ", timing, "\n")) +remove("a", "b") +if (R.Version()$os == "Win32" || R.Version()$os == "mingw32") flush.console() + +# (3) +cumulate <- 0; c <- 0 +gcd2 <- function(x, y) {if (sum(y > 1.0E-4) == 0) x else {y[y == 0] <- x[y == 0]; Recall(y, x %% y)}} +for (i in 1:runs) { + a <- ceiling(Runif(400000)*1000) + b <- ceiling(Runif(400000)*1000) + invisible(gc()) + timing <- system.time({ + c <- gcd2(a, b) # gcd2 is a recursive function + })[3] + cumulate <- cumulate + timing +} +timing <- cumulate/runs +times[3, 3] <- timing +cat(c("Grand common divisors of 400,000 pairs (recursion)__ (sec): ", timing, "\n")) +remove("a", "b", "c", "gcd2") +if (R.Version()$os == "Win32" || R.Version()$os == "mingw32") flush.console() + +# (4) +cumulate <- 0; b <- 0 +for (i in 1:runs) { + b <- rep(0, 500*500); dim(b) <- c(500, 500) + invisible(gc()) + timing <- system.time({ + # Rem: there are faster ways to do this + # but here we want to time loops (220*220 'for' loops)! + for (j in 1:500) { + for (k in 1:500) { + b[k,j] <- abs(j - k) + 1 + } + } + })[3] + cumulate <- cumulate + timing +} +timing <- cumulate/runs +times[4, 3] <- timing +cat(c("Creation of a 500x500 Toeplitz matrix (loops)_______ (sec): ", timing, "\n")) +remove("b", "j", "k") +if (R.Version()$os == "Win32" || R.Version()$os == "mingw32") flush.console() + +# (5) +cumulate <- 0; p <- 0; vt <- 0; vr <- 0; vrt <- 0; rvt <- 0; RV <- 0; j <- 0; k <- 0; +x2 <- 0; R <- 0; Rxx <- 0; Ryy <- 0; Rxy <- 0; Ryx <- 0; Rvmax <- 0 +# Calculate the trace of a matrix (sum of its diagonal elements) +Trace <- function(y) {sum(c(y)[1 + 0:(min(dim(y)) - 1) * (dim(y)[1] + 1)], na.rm=FALSE)} +for (i in 1:runs) { + x <- abs(Rnorm(45*45)); dim(x) <- c(45, 45) + invisible(gc()) + timing <- system.time({ + # Calculation of Escoufier's equivalent vectors + p <- ncol(x) + vt <- 1:p # Variables to test + vr <- NULL # Result: ordered variables + RV <- 1:p # Result: correlations + vrt <- NULL + for (j in 1:p) { # loop on the variable number + Rvmax <- 0 + for (k in 1:(p-j+1)) { # loop on the variables + x2 <- cbind(x, x[,vr], x[,vt[k]]) + R <- cor(x2) # Correlations table + Ryy <- R[1:p, 1:p] + Rxx <- R[(p+1):(p+j), (p+1):(p+j)] + Rxy <- R[(p+1):(p+j), 1:p] + Ryx <- t(Rxy) + rvt <- Trace(Ryx %*% Rxy) / sqrt(Trace(Ryy %*% Ryy) * Trace(Rxx %*% Rxx)) # RV calculation + if (rvt > Rvmax) { + Rvmax <- rvt # test of RV + vrt <- vt[k] # temporary held variable + } + } + vr[j] <- vrt # Result: variable + RV[j] <- Rvmax # Result: correlation + vt <- vt[vt!=vr[j]] # reidentify variables to test + } + })[3] + cumulate <- cumulate + timing +} +times[5, 3] <- timing +cat(c("Escoufier's method on a 45x45 matrix (mixed)________ (sec): ", timing, "\n")) +remove("x", "p", "vt", "vr", "vrt", "rvt", "RV", "j", "k") +remove("x2", "R", "Rxx", "Ryy", "Rxy", "Ryx", "Rvmax", "Trace") +if (R.Version()$os == "Win32" || R.Version()$os == "mingw32") flush.console() + +times[ , 3] <- sort(times[ , 3]) +cat(" --------------------------------------------\n") +cat(c(" Trimmed geom. mean (2 extremes eliminated): ", exp(mean(log(times[2:4, 3]))), "\n\n\n")) + +cat(c("Total time for all 15 tests_________________________ (sec): ", sum(times), "\n")) +cat(c("Overall mean (sum of I, II and III trimmed means/3)_ (sec): ", exp(mean(log(times[2:4, ]))), "\n")) +remove("cumulate", "timing", "times", "runs", "i") +cat(" --- End of test ---\n\n") diff --git a/tests/dev-tools/R-base/tests/R-benchmark-25.R b/tests/dev-tools/R-base/tests/R-benchmark-25.R new file mode 100644 index 0000000000..b0dbc6ee28 --- /dev/null +++ b/tests/dev-tools/R-base/tests/R-benchmark-25.R @@ -0,0 +1,385 @@ +# R Benchmark 2.5 (06/2008) [Simon Urbanek] +# version 2.5: scaled to get roughly 1s per test, R 2.7.0 @ 2.6GHz Mac Pro +# R Benchmark 2.4 (06/2008) [Simon Urbanek] +# version 2.4 adapted to more recent Matrix package +# R Benchmark 2.3 (21 April 2004) +# Warning: changes are not carefully checked yet! +# version 2.3 adapted to R 1.9.0 +# Many thanks to Douglas Bates (bates@stat.wisc.edu) for improvements! +# version 2.2 adapted to R 1.8.0 +# version 2.1 adapted to R 1.7.0 +# version 2, scaled to get 1 +/- 0.1 sec with R 1.6.2 +# using the standard ATLAS library (Rblas.dll) +# on a Pentium IV 1.6 Ghz with 1 Gb Ram on Win XP pro + +# revised and optimized for R v. 1.5.x, 8 June 2002 +# Requires additionnal libraries: Matrix, SuppDists +# Author : Philippe Grosjean +# eMail : phgrosjean@sciviews.org +# Web : http://www.sciviews.org +# License: GPL 2 or above at your convenience (see: http://www.gnu.org) +# +# Several tests are adapted from the Splus Benchmark Test V. 2 +# by Stephan Steinhaus (stst@informatik.uni-frankfurt.de) +# Reference for Escoufier's equivalents vectors (test III.5): +# Escoufier Y., 1970. Echantillonnage dans une population de variables +# aleatoires réelles. Publ. Inst. Statis. Univ. Paris 19 Fasc 4, 1-47. +# +# type source("c://R2.R") to start the test + +runs <- 3 # Number of times the tests are executed +times <- rep(0, 15); dim(times) <- c(5,3) +require(Matrix) # Optimized matrix operations +require(SuppDists) # Optimized random number generators +Runif <- rMWC1019 # The fast uniform number generator +#Runif <- runif +# If you don't have SuppDists, you can use: Runif <- runif +a <- rMWC1019(10, new.start=TRUE, seed=492166) # Init. the generator +Rnorm <- rziggurat # The fast normal number generator +# If you don't have SuppDists, you can use: Rnorm <- rnorm +b <- rziggurat(10, new.start=TRUE) # Init. the generator +#Rnorm <- rnorm +remove("a", "b") +options(object.size=100000000) + +cat("\n\n R Benchmark 2.5\n") +cat(" ===============\n") +cat(c("Number of times each test is run__________________________: ", runs)) +cat("\n\n") + + +cat(" I. Matrix calculation\n") +cat(" ---------------------\n") +if (R.Version()$os == "Win32" || R.Version()$os == "mingw32") flush.console() + +# (1) +cumulate <- 0; a <- 0; b <- 0 +for (i in 1:runs) { + invisible(gc()) + timing <- system.time({ + a <- matrix(Rnorm(2500*2500)/10, ncol=2500, nrow=2500); + b <- t(a); + dim(b) <- c(1250, 5000); + a <- t(b) + })[3] + cumulate <- cumulate + timing +} +timing <- cumulate/runs +times[1, 1] <- timing +cat(c("Creation, transp., deformation of a 2500x2500 matrix (sec): ", timing, "\n")) +remove("a", "b") +if (R.Version()$os == "Win32" || R.Version()$os == "mingw32") flush.console() + +# (2) +cumulate <- 0; b <- 0 +for (i in 1:runs) { + a <- abs(matrix(Rnorm(2500*2500)/2, ncol=2500, nrow=2500)); + invisible(gc()) + timing <- system.time({ + b <- a^1000 + })[3] + cumulate <- cumulate + timing +} +timing <- cumulate/runs +times[2, 1] <- timing +cat(c("2400x2400 normal distributed random matrix ^1000____ (sec): ", timing, "\n")) +remove("a", "b") +if (R.Version()$os == "Win32" || R.Version()$os == "mingw32") flush.console() + +# (3) +cumulate <- 0; b <- 0 +for (i in 1:runs) { + a <- Rnorm(7000000) + invisible(gc()) + timing <- system.time({ + b <- sort(a, method="quick") # Sort is modified in v. 1.5.x + # And there is now a quick method that better competes with other packages!!! + })[3] + cumulate <- cumulate + timing +} +timing <- cumulate/runs +times[3, 1] <- timing +cat(c("Sorting of 7,000,000 random values__________________ (sec): ", timing, "\n")) +remove("a", "b") +if (R.Version()$os == "Win32" || R.Version()$os == "mingw32") flush.console() + +# (4) +cumulate <- 0; b <- 0 +for (i in 1:runs) { + a <- Rnorm(2800*2800); dim(a) <- c(2800, 2800) + invisible(gc()) + timing <- system.time({ + b <- crossprod(a) # equivalent to: b <- t(a) %*% a + })[3] + cumulate <- cumulate + timing +} +timing <- cumulate/runs +times[4, 1] <- timing +cat(c("2800x2800 cross-product matrix (b = a' * a)_________ (sec): ", timing, "\n")) +remove("a", "b") +if (R.Version()$os == "Win32" || R.Version()$os == "mingw32") flush.console() + +# (5) +cumulate <- 0; c <- 0; qra <-0 +for (i in 1:runs) { + a <- new("dgeMatrix", x = Rnorm(2000*2000), Dim = as.integer(c(2000,2000))) + b <- as.double(1:2000) + invisible(gc()) + timing <- system.time({ + c <- solve(crossprod(a), crossprod(a,b)) + })[3] + cumulate <- cumulate + timing + + # This is the old method + #a <- Rnorm(600*600); dim(a) <- c(600,600) + #b <- 1:600 + #invisible(gc()) + #timing <- system.time({ + # qra <- qr(a, tol = 1e-7); + # c <- qr.coef(qra, b) + # #Rem: a little faster than c <- lsfit(a, b, inter=F)$coefficients + #})[3] + #cumulate <- cumulate + timing +} +timing <- cumulate/runs +times[5, 1] <- timing +cat(c("Linear regr. over a 3000x3000 matrix (c = a \\ b')___ (sec): ", timing, "\n")) +remove("a", "b", "c", "qra") +if (R.Version()$os == "Win32" || R.Version()$os == "mingw32") flush.console() + +times[ , 1] <- sort(times[ , 1]) +cat(" --------------------------------------------\n") +cat(c(" Trimmed geom. mean (2 extremes eliminated): ", exp(mean(log(times[2:4, 1]))), "\n\n")) + +cat(" II. Matrix functions\n") +cat(" --------------------\n") +if (R.Version()$os == "Win32") flush.console() + +# (1) +cumulate <- 0; b <- 0 +for (i in 1:runs) { + a <- Rnorm(2400000) + invisible(gc()) + timing <- system.time({ + b <- fft(a) + })[3] + cumulate <- cumulate + timing +} +timing <- cumulate/runs +times[1, 2] <- timing +cat(c("FFT over 2,400,000 random values____________________ (sec): ", timing, "\n")) +remove("a", "b") +if (R.Version()$os == "Win32" || R.Version()$os == "mingw32") flush.console() + +# (2) +cumulate <- 0; b <- 0 +for (i in 1:runs) { + a <- array(Rnorm(600*600), dim = c(600, 600)) + # Only needed if using eigen.Matrix(): Matrix.class(a) + invisible(gc()) + timing <- system.time({ + b <- eigen(a, symmetric=FALSE, only.values=TRUE)$Value + # Rem: on my machine, it is faster than: + # b <- La.eigen(a, symmetric=F, only.values=T, method="dsyevr")$Value + # b <- La.eigen(a, symmetric=F, only.values=T, method="dsyev")$Value + # b <- eigen.Matrix(a, vectors = F)$Value + })[3] + cumulate <- cumulate + timing +} +timing <- cumulate/runs +times[2, 2] <- timing +cat(c("Eigenvalues of a 640x640 random matrix______________ (sec): ", timing, "\n")) +remove("a", "b") +if (R.Version()$os == "Win32" || R.Version()$os == "mingw32") flush.console() + +# (3) +cumulate <- 0; b <- 0 +for (i in 1:runs) { + a <- Rnorm(2500*2500); dim(a) <- c(2500, 2500) + #Matrix.class(a) + invisible(gc()) + timing <- system.time({ + #b <- determinant(a, logarithm=F) + # Rem: the following is slower on my computer! + # b <- det.default(a) + b <- det(a) + })[3] + cumulate <- cumulate + timing +} +timing <- cumulate/runs +times[3, 2] <- timing +cat(c("Determinant of a 2500x2500 random matrix____________ (sec): ", timing, "\n")) +remove("a", "b") +if (R.Version()$os == "Win32" || R.Version()$os == "mingw32") flush.console() + +# (4) +cumulate <- 0; b <- 0 +for (i in 1:runs) { + a <- crossprod(new("dgeMatrix", x = Rnorm(3000*3000), + Dim = as.integer(c(3000, 3000)))) + invisible(gc()) + #a <- Rnorm(900*900); dim(a) <- c(900, 900) + #a <- crossprod(a, a) + timing <- system.time({ + b <- chol(a) + })[3] + cumulate <- cumulate + timing +} +timing <- cumulate/runs +times[4, 2] <- timing +cat(c("Cholesky decomposition of a 3000x3000 matrix________ (sec): ", timing, "\n")) +remove("a", "b") +if (R.Version()$os == "Win32" || R.Version()$os == "mingw32") flush.console() + +# (5) +cumulate <- 0; b <- 0 +for (i in 1:runs) { + a <- new("dgeMatrix", x = Rnorm(1600*1600), Dim = as.integer(c(1600, 1600))) + invisible(gc()) + #a <- Rnorm(400*400); dim(a) <- c(400, 400) + timing <- system.time({ + # b <- qr.solve(a) + # Rem: a little faster than + b <- solve(a) + })[3] + cumulate <- cumulate + timing +} +timing <- cumulate/runs +times[5, 2] <- timing +cat(c("Inverse of a 1600x1600 random matrix________________ (sec): ", timing, "\n")) +remove("a", "b") +if (R.Version()$os == "Win32" || R.Version()$os == "mingw32") flush.console() + +times[ , 2] <- sort(times[ , 2]) +cat(" --------------------------------------------\n") +cat(c(" Trimmed geom. mean (2 extremes eliminated): ", exp(mean(log(times[2:4, 2]))), "\n\n")) + +cat(" III. Programmation\n") +cat(" ------------------\n") +if (R.Version()$os == "Win32" || R.Version()$os == "mingw32") flush.console() + +# (1) +cumulate <- 0; a <- 0; b <- 0; phi <- 1.6180339887498949 +for (i in 1:runs) { + a <- floor(Runif(3500000)*1000) + invisible(gc()) + timing <- system.time({ + b <- (phi^a - (-phi)^(-a))/sqrt(5) + })[3] + cumulate <- cumulate + timing +} +timing <- cumulate/runs +times[1, 3] <- timing +cat(c("3,500,000 Fibonacci numbers calculation (vector calc)(sec): ", timing, "\n")) +remove("a", "b", "phi") +if (R.Version()$os == "Win32" || R.Version()$os == "mingw32") flush.console() + +# (2) +cumulate <- 0; a <- 3000; b <- 0 +for (i in 1:runs) { + invisible(gc()) + timing <- system.time({ + b <- rep(1:a, a); dim(b) <- c(a, a); + b <- 1 / (t(b) + 0:(a-1)) + # Rem: this is twice as fast as the following code proposed by R programmers + # a <- 1:a; b <- 1 / outer(a - 1, a, "+") + })[3] + cumulate <- cumulate + timing +} +timing <- cumulate/runs +times[2, 3] <- timing +cat(c("Creation of a 3000x3000 Hilbert matrix (matrix calc) (sec): ", timing, "\n")) +remove("a", "b") +if (R.Version()$os == "Win32" || R.Version()$os == "mingw32") flush.console() + +# (3) +cumulate <- 0; c <- 0 +gcd2 <- function(x, y) {if (sum(y > 1.0E-4) == 0) x else {y[y == 0] <- x[y == 0]; Recall(y, x %% y)}} +for (i in 1:runs) { + a <- ceiling(Runif(400000)*1000) + b <- ceiling(Runif(400000)*1000) + invisible(gc()) + timing <- system.time({ + c <- gcd2(a, b) # gcd2 is a recursive function + })[3] + cumulate <- cumulate + timing +} +timing <- cumulate/runs +times[3, 3] <- timing +cat(c("Grand common divisors of 400,000 pairs (recursion)__ (sec): ", timing, "\n")) +remove("a", "b", "c", "gcd2") +if (R.Version()$os == "Win32" || R.Version()$os == "mingw32") flush.console() + +# (4) +cumulate <- 0; b <- 0 +for (i in 1:runs) { + b <- rep(0, 500*500); dim(b) <- c(500, 500) + invisible(gc()) + timing <- system.time({ + # Rem: there are faster ways to do this + # but here we want to time loops (220*220 'for' loops)! + for (j in 1:500) { + for (k in 1:500) { + b[k,j] <- abs(j - k) + 1 + } + } + })[3] + cumulate <- cumulate + timing +} +timing <- cumulate/runs +times[4, 3] <- timing +cat(c("Creation of a 500x500 Toeplitz matrix (loops)_______ (sec): ", timing, "\n")) +remove("b", "j", "k") +if (R.Version()$os == "Win32" || R.Version()$os == "mingw32") flush.console() + +# (5) +cumulate <- 0; p <- 0; vt <- 0; vr <- 0; vrt <- 0; rvt <- 0; RV <- 0; j <- 0; k <- 0; +x2 <- 0; R <- 0; Rxx <- 0; Ryy <- 0; Rxy <- 0; Ryx <- 0; Rvmax <- 0 +# Calculate the trace of a matrix (sum of its diagonal elements) +Trace <- function(y) {sum(c(y)[1 + 0:(min(dim(y)) - 1) * (dim(y)[1] + 1)], na.rm=FALSE)} +for (i in 1:runs) { + x <- abs(Rnorm(45*45)); dim(x) <- c(45, 45) + invisible(gc()) + timing <- system.time({ + # Calculation of Escoufier's equivalent vectors + p <- ncol(x) + vt <- 1:p # Variables to test + vr <- NULL # Result: ordered variables + RV <- 1:p # Result: correlations + vrt <- NULL + for (j in 1:p) { # loop on the variable number + Rvmax <- 0 + for (k in 1:(p-j+1)) { # loop on the variables + x2 <- cbind(x, x[,vr], x[,vt[k]]) + R <- cor(x2) # Correlations table + Ryy <- R[1:p, 1:p] + Rxx <- R[(p+1):(p+j), (p+1):(p+j)] + Rxy <- R[(p+1):(p+j), 1:p] + Ryx <- t(Rxy) + rvt <- Trace(Ryx %*% Rxy) / sqrt(Trace(Ryy %*% Ryy) * Trace(Rxx %*% Rxx)) # RV calculation + if (rvt > Rvmax) { + Rvmax <- rvt # test of RV + vrt <- vt[k] # temporary held variable + } + } + vr[j] <- vrt # Result: variable + RV[j] <- Rvmax # Result: correlation + vt <- vt[vt!=vr[j]] # reidentify variables to test + } + })[3] + cumulate <- cumulate + timing +} +times[5, 3] <- timing +cat(c("Escoufier's method on a 45x45 matrix (mixed)________ (sec): ", timing, "\n")) +remove("x", "p", "vt", "vr", "vrt", "rvt", "RV", "j", "k") +remove("x2", "R", "Rxx", "Ryy", "Rxy", "Ryx", "Rvmax", "Trace") +if (R.Version()$os == "Win32" || R.Version()$os == "mingw32") flush.console() + +times[ , 3] <- sort(times[ , 3]) +cat(" --------------------------------------------\n") +cat(c(" Trimmed geom. mean (2 extremes eliminated): ", exp(mean(log(times[2:4, 3]))), "\n\n\n")) + +cat(c("Total time for all 15 tests_________________________ (sec): ", sum(times), "\n")) +cat(c("Overall mean (sum of I, II and III trimmed means/3)_ (sec): ", exp(mean(log(times[2:4, ]))), "\n")) +remove("cumulate", "timing", "times", "runs", "i") +cat(" --- End of test ---\n\n") diff --git a/tests/dev-tools/R-base/tests/SuppDists_1.1-9.1.tar.gz b/tests/dev-tools/R-base/tests/SuppDists_1.1-9.1.tar.gz new file mode 100644 index 0000000000..2435b8030d Binary files /dev/null and b/tests/dev-tools/R-base/tests/SuppDists_1.1-9.1.tar.gz differ diff --git a/tests/dev-tools/R-base/tests/TEST_ENV b/tests/dev-tools/R-base/tests/TEST_ENV new file mode 120000 index 0000000000..5bb274e487 --- /dev/null +++ b/tests/dev-tools/R-base/tests/TEST_ENV @@ -0,0 +1 @@ +../../../TEST_ENV \ No newline at end of file diff --git a/tests/dev-tools/R-base/tests/bench.R b/tests/dev-tools/R-base/tests/bench.R new file mode 100644 index 0000000000..cb9c73042f --- /dev/null +++ b/tests/dev-tools/R-base/tests/bench.R @@ -0,0 +1,27 @@ +hilbert<-function(n) 1/(outer(seq(n),seq(n),"+")-1) +print("hilbert n=500") +print(system.time(eigen(hilbert(500)))) +print(system.time(eigen(hilbert(500)))) +print(system.time(eigen(hilbert(500)))) +print("hilbert n=1000") +print(system.time(eigen(hilbert(1000)))) +print(system.time(eigen(hilbert(1000)))) +print(system.time(eigen(hilbert(1000)))) +print("sort n=6") +print(system.time(sort(rnorm(10^6)))) +print(system.time(sort(rnorm(10^6)))) +print(system.time(sort(rnorm(10^6)))) +print("sort n=7") +print(system.time(sort(rnorm(10^7)))) +print(system.time(sort(rnorm(10^7)))) +print(system.time(sort(rnorm(10^7)))) +# loess +loess.me<-function(n) { +print(paste("loess n=",as.character(n),sep="")) +for (i in 1:5) { + x<-rnorm(10^n); y<-rnorm(10^n); z<-rnorm(10^n) + print(system.time(loess(z~x+y))) + } +} +loess.me(3) +loess.me(4) diff --git a/tests/dev-tools/R-base/tests/common b/tests/dev-tools/R-base/tests/common new file mode 120000 index 0000000000..55b975444d --- /dev/null +++ b/tests/dev-tools/R-base/tests/common @@ -0,0 +1 @@ +../../../common/ \ No newline at end of file diff --git a/tests/dev-tools/R-base/tests/rm_execution b/tests/dev-tools/R-base/tests/rm_execution new file mode 100755 index 0000000000..f554f95a2a --- /dev/null +++ b/tests/dev-tools/R-base/tests/rm_execution @@ -0,0 +1,42 @@ +#!.//common/bats/bin/bats +# -*-sh-*- + +source ./common/test_helper_functions.bash || exit 1 +source ./common/functions || exit 1 + +if [ -s ./TEST_ENV ];then + source ./TEST_ENV +fi + +if [ "$RESOURCE_MANAGER" = "slurm" ];then + rm=slurm +else + ERROR "Unsupported or unknown resource manager" + exit 1 +fi + +PKG="R_base" + + +@test "[$PKG] Running Rscript bench.R under resource manager ($rm/$LMOD_FAMILY_COMPILER)" { + test="bench" + CMD_TIMEOUT=30 + echo $test.R + if [ ! -e $test.R ];then + flunk "$test.R does not exist" + fi + + rm -f $test.results + + run run_serial_binary -o $test.results Rscript ./$test.R + assert_success + + # Verify a timing was recorded + # run grep "Total time" $test.results + # Verify run results are available + run grep "loess n=4" $test.results + assert_success + +} + + diff --git a/tests/dev-tools/R-base/tests/test_module b/tests/dev-tools/R-base/tests/test_module new file mode 100755 index 0000000000..d6cd75002a --- /dev/null +++ b/tests/dev-tools/R-base/tests/test_module @@ -0,0 +1,97 @@ +#!./common/bats/bin/bats +# -*-sh-*- + +source ./common/test_helper_functions.bash || exit 1 +source ./common/functions || exit 1 + +if [ -s ./TEST_ENV ];then + source ./TEST_ENV +fi + +PKG=R_BASE +testname=R_base +module=R_base +rpm=R_base${DELIM} + +# Query local compiler family +check_compiler_family CC CXX FC + +@test "[$testname] Verify $module module is loaded and matches rpm version ($LMOD_FAMILY_COMPILER)" { + module list $module | grep "1) $module" >& .cmd_output || exit 1 + run grep $module .cmd_output + assert_success + +} + +@test "[$testname] Verify module ${PKG}_DIR is defined and exists ($LMOD_FAMILY_COMPILER)" { + DIR=${PKG}_DIR + if [ -z ${!DIR} ];then + flunk "${PKG}_DIR directory not defined" + fi + + if [ ! -d ${!DIR} || -z "${!DIR}" ];then + flunk "directory ${!DIR} does not exist" + fi +} + +@test "[$testname] Verify availability of $module R ($LMOD_FAMILY_COMPILER)" { + run which R + assert_success +} + + +@test "[$testname] Verify availability of $module Rscript ($LMOD_FAMILY_COMPILER)" { + run which Rscript + assert_success +} + +# -------------- +# SHARE Tests +# -------------- + +@test "[$testname] Verify module ${PKG}_SHARE is defined and exists ($LMOD_FAMILY_COMPILER)" { + SHARE=${PKG}_SHARE + + if [ -z ${!SHARE} ];then + flunk "${PKG}_SHARE directory not defined" + fi + + if [ ! -d ${!SHARE} || -z "${!SHARE}" ];then + flunk "directory ${!SHARE} does not exist" + fi +} + + +# Execution Test(s) + +@test "[$testname] Running bench.R test" { + + run Rscript ./bench.R + assert_success +} + +@test "[$testname] Running benchmark-25-noSuppDist.R with no SuppDist library test" { + + ### Rscript outputs to stdout + #run Rscript ./R-benchmark-25-noSuppDist.R + ### Batch mode with output written to file .results + run R CMD BATCH --quiet --no-restore --no-save ./R-benchmark-25-noSuppDist.R R-benchmark-25-noSuppDist.results + ### run R CMD BATCH ./R-benchmark-25-noSuppDist.R R-benchmark-25-noSuppDist.results + assert_success +} + + +@test "[$testname] Library (SuppDist lib) install test" { + + run R CMD INSTALL -l . SuppDists_1.1-9.1.tar.gz || exit 1 + assert_success + ###echo "SuppDist libarary install test success" +} + +@test "[$testname] Run benchmark-25.R with newly installed SuppDist lib test" { + export R_LIBS="." + run R CMD BATCH --quiet --no-restore --no-save ./R-benchmark-25.R R-benchmark-25.results + ### run R CMD BATCH ./R-benchmark-25.R R-benchmark-25.results + assert_success + ###echo "Running benchmark-25 with SuppDist library done!" +} diff --git a/tests/dev-tools/cilk/.gitignore b/tests/dev-tools/cilk/.gitignore new file mode 100644 index 0000000000..c2cbb7f948 --- /dev/null +++ b/tests/dev-tools/cilk/.gitignore @@ -0,0 +1,6 @@ +compile +test-driver +*.tap +test*.log +test*.trs +family-*/ diff --git a/tests/dev-tools/cilk/Makefile.am b/tests/dev-tools/cilk/Makefile.am new file mode 100644 index 0000000000..39cbee2e65 --- /dev/null +++ b/tests/dev-tools/cilk/Makefile.am @@ -0,0 +1,3 @@ +AUTOMAKE_OPTIONS = foreign +AM_MAKEFLAGS = --no-print-directory +SUBDIRS = tests diff --git a/tests/dev-tools/cilk/bootstrap b/tests/dev-tools/cilk/bootstrap new file mode 120000 index 0000000000..b17b398013 --- /dev/null +++ b/tests/dev-tools/cilk/bootstrap @@ -0,0 +1 @@ +../../bootstrap \ No newline at end of file diff --git a/tests/dev-tools/cilk/configure.ac b/tests/dev-tools/cilk/configure.ac new file mode 100644 index 0000000000..d92f2b2260 --- /dev/null +++ b/tests/dev-tools/cilk/configure.ac @@ -0,0 +1,49 @@ +# -*- Autoconf -*- +# Process this file with autoconf to produce a configure script. +# + +AC_PREREQ(2.59) +AC_INIT([cilk], [2.0], [karl.w.schulz@intel.com]) +AC_CONFIG_MACRO_DIR([m4]) +AM_INIT_AUTOMAKE([foreign]) +m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) + +# verify we have necessary environment variables set + +CHECK_ENV([TBB_INC],[tbb]) +CHECK_ENV([TBB_LIB],[tbb]) + +OHPC_COMPILER_FAMILY + +# Define include path and library linkage from environment variables +# which should be provided via module loads. + +CFLAGS="-I${TBB_INC} ${CFLAGS}" +CXXFLAGS="-I${TBB_INC} ${CXXFLAGS}" +LDFLAGS="-L${TBB_LIB} ${LDFLAGS}" +LIBS="-tbb -pthread ${LIBS}" + +# test compilers +AC_PROG_CC +AC_PROG_CXX + +# Set subdirectories +AC_CONFIG_FILES(Makefile tests/Makefile) + +# Configure +AC_OUTPUT() + +echo +echo '-------------------------------------------------- SUMMARY --------------------------------------------------' +echo +echo Package version............... : $PACKAGE-$VERSION +echo OHPC compiler toolchain........ : $LMOD_FAMILY_COMPILER +echo +echo C compiler.................... : `which $CC` +echo C++ compiler.................. : `which $CXX` +echo +echo C compiler flags.............. : $CFLAGS +echo C++ compiler flags............ : $CXXFLAGS +echo Linker flags.................. : $LDFLAGS $LIBS +echo +echo '-------------------------------------------------------------------------------------------------------------' diff --git a/tests/dev-tools/cilk/m4/check_env.m4 b/tests/dev-tools/cilk/m4/check_env.m4 new file mode 100644 index 0000000000..632bb4173f --- /dev/null +++ b/tests/dev-tools/cilk/m4/check_env.m4 @@ -0,0 +1,30 @@ +# SYNOPSIS +# +# Test if a desired environment variable is set for a particular module. +# +# CHECK_ENV([VARIABLE,[module]) +# +# DESCRIPTION +# +# Queries configuration environment to detect compiler toolchain +# loaded via Lmod. Sets CC, CXX, and FC to match supported +# toolchains. +# +# CONTRIBUTORS +# +# Karl W. Schulz + +AC_DEFUN([CHECK_ENV], +[ + +AC_MSG_CHECKING([for $1 environment variable]) +if test "x$$1" = "x"; then + AC_MSG_RESULT([no]) + echo + AC_MSG_ERROR([$1 not defined - please load $2 environment.]) +else + AC_MSG_RESULT([yes]) +fi + + +]) diff --git a/tests/dev-tools/cilk/m4/compiler_family.m4 b/tests/dev-tools/cilk/m4/compiler_family.m4 new file mode 120000 index 0000000000..c325560245 --- /dev/null +++ b/tests/dev-tools/cilk/m4/compiler_family.m4 @@ -0,0 +1 @@ +../../../compilers/m4/compiler_family.m4 \ No newline at end of file diff --git a/tests/dev-tools/cilk/ohpc-tests/test_cilk b/tests/dev-tools/cilk/ohpc-tests/test_cilk new file mode 100755 index 0000000000..f0907f9056 --- /dev/null +++ b/tests/dev-tools/cilk/ohpc-tests/test_cilk @@ -0,0 +1,39 @@ +#!/bin/bash +# -*-sh-*- + +TEST_LOGS="" +MAKEFLAGS="" + +source ./TEST_ENV || exit 1 +source ./common/functions || exit 1 + +cd dev-tools/cilk || exit 1 +export BATS_JUNIT_CLASS=Cilk + +# bootstrap the local autotools project if necessary + +./bootstrap || exit 1 + +for compiler in $COMPILER_FAMILIES ; do + + if [ "$compiler" != "intel" ]; then + continue + fi + + echo " " + echo " " + echo "-------------------------------------------------------" + echo "Dev Tools: CILK tests: $compiler" + echo "-------------------------------------------------------" + + module purge || exit 1 + module load $compiler || exit 1 + + ./configure || exit 1 + make clean >& /dev/null || exit 1 + make check || exit 1 + + save_logs_compiler_family tests $compiler + + make clean >& /dev/null +done diff --git a/tests/dev-tools/cilk/tests/Makefile.am b/tests/dev-tools/cilk/tests/Makefile.am new file mode 100644 index 0000000000..20391eccc2 --- /dev/null +++ b/tests/dev-tools/cilk/tests/Makefile.am @@ -0,0 +1,18 @@ +TESTS_ENVIRONMENT = BATS_NO_SUMMARY=1 + +check_PROGRAMS = linear_recurrence +linear_recurrence_SOURCES = linear_recurrence.cpp + +check_PROGRAMS += matrix +matrix_SOURCES = matrix.cpp + +check_PROGRAMS += matrix_multiply +matrix_multiply_SOURCES = matrix_multiply.cpp + +check_PROGRAMS += qsort +qsort_SOURCES = qsort.cpp + +check_PROGRAMS += qsort_mutex +qsort_mutex_SOURCES = qsort_mutex.cpp + +TESTS = cilk_bats diff --git a/tests/dev-tools/cilk/tests/cilk_bats b/tests/dev-tools/cilk/tests/cilk_bats new file mode 100755 index 0000000000..e7cce427be --- /dev/null +++ b/tests/dev-tools/cilk/tests/cilk_bats @@ -0,0 +1,31 @@ +#!../../../common/bats/bin/bats +# -*-sh-*- + +load ../../../common/test_helper_functions +source ../../../common/functions || exit 1 + +if [ -s ../../../TEST_ENV ];then + source ../../../TEST_ENV +fi + +PKG="dev-tools/cilk" + +@test "[$PKG] CILK Test - linear_recurrence" { + run linear_recurrence +} + +@test "[$PKG] CILK Test - matrix" { + run matrix +} + +@test "[$PKG] CILK Test - matrix_multiply" { + run matrix_multiply +} + +@test "[$PKG] CILK Test - qsort" { + run qsort +} + +@test "[$PKG] CILK Test - qsort_mutex" { + run qsort_mutex +} diff --git a/tests/dev-tools/cilk/tests/cilktime.h b/tests/dev-tools/cilk/tests/cilktime.h new file mode 100644 index 0000000000..4ec54779d6 --- /dev/null +++ b/tests/dev-tools/cilk/tests/cilktime.h @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2009-2012 Intel Corporation. All Rights Reserved. + * + * The source code contained or described herein and all + * documents related to the source code ("Material") are owned by + * Intel Corporation or its suppliers or licensors. Title to the + * Material remains with Intel Corporation or its suppliers and + * licensors. The Material is protected by worldwide copyright + * laws and treaty provisions. No part of the Material may be + * used, copied, reproduced, modified, published, uploaded, + * posted, transmitted, distributed, or disclosed in any way + * except as expressly provided in the license provided with the + * Materials. No license under any patent, copyright, trade + * secret or other intellectual property right is granted to or + * conferred upon you by disclosure or delivery of the Materials, + * either expressly, by implication, inducement, estoppel or + * otherwise, except as expressly provided in the license + * provided with the Materials. + * + * Simple header file for abstracting machine-dependent timers + * + * This file declares the following functions: + * + * cilk_getticks() - Returns a timer value with a resolution of + * milliseconds + * + * cilk_ticks_to_seconds - Converts the timer value to seconds. + */ + +#ifdef _WIN32 +#include + +static inline unsigned long long cilk_getticks() +{ + // Fetch number of milliseconds that have elapsed sin the system started + return GetTickCount(); +} + +static inline double cilk_ticks_to_seconds(unsigned long long ticks) +{ + return ticks * 1.0e-3; +} +#endif + +#if defined __unix__ || defined __APPLE__ +#include +#include + +static inline unsigned long long cilk_getticks() +{ + struct timeval t; + gettimeofday(&t, 0); + return t.tv_sec * 1000000ULL + t.tv_usec; +} + +static inline double cilk_ticks_to_seconds(unsigned long long ticks) +{ + return ticks * 1.0e-6; +} +#endif diff --git a/tests/dev-tools/cilk/tests/linear_recurrence.cpp b/tests/dev-tools/cilk/tests/linear_recurrence.cpp new file mode 100644 index 0000000000..ffa5c7e902 --- /dev/null +++ b/tests/dev-tools/cilk/tests/linear_recurrence.cpp @@ -0,0 +1,190 @@ +// -*- C++ -*- + +/* + * linear_recurrence.cpp + * + * Copyright (C) 2009-2012 Intel Corporation. All Rights Reserved. + * + * The source code contained or described herein and all + * documents related to the source code ("Material") are owned by + * Intel Corporation or its suppliers or licensors. Title to the + * Material remains with Intel Corporation or its suppliers and + * licensors. The Material is protected by worldwide copyright + * laws and treaty provisions. No part of the Material may be + * used, copied, reproduced, modified, published, uploaded, + * posted, transmitted, distributed, or disclosed in any way + * except as expressly provided in the license provided with the + * Materials. No license under any patent, copyright, trade + * secret or other intellectual property right is granted to or + * conferred upon you by disclosure or delivery of the Materials, + * either expressly, by implication, inducement, estoppel or + * otherwise, except as expressly provided in the license + * provided with the Materials. + */ + +/* + A demonstration of an Intel(R) Cilk(TM) Plus reducer. + + This example demonstrates the use of Intel(R) Cilk(TM) Plus reducerss to compute a + linear recurrence relation in parallel. Specifically, + given x_0, {a_1, ... , a_n}, and {b_1, ... , b_n}, the program + computes x_n according to the following recurrence relation: + + x_k = a_k + b_k * x_{k-1} for 1 <= k <= n. + + You would think that the recurrence is inherently sequential, and + that there is no way to compute x_k without knowing x_{k-1}. + However, the recurrence can be solved in parallel by first + rewriting it according to the following trick. Write the recurrence + as a linear recurrence over 2x1 vectors: + + [ 1 ] [ 1 0 ] [ 1 ] + [ ] = [ ] * [ ] + [ x_k ] [ a_k b_k ] [ x_{k-1} ] + + Because matrix product is associative, it is clear that the + problem can be solved by first computing the product + of the n 2x2 matrices + + [ 1 0 ] + R_k = [ ] , + [ a_k b_k ] + + which can be computed in parallel. + + The reducer Recurrence_Reducer below stores partial products + of the R_k matrices, and effects the associative reduction via + a specialized matrix multiplication. +*/ + +#include +#include +#include +#include +#include +#include "cilktime.h" + +extern "C++" { + //structure to hold parameter a, b + struct Para { + long a; + long b; + }; + + //reducer to store partial products of the R_k matrices, + //each R_k matrix is represented by value of a_k and b_k, + class Recurrence_Reducer + { + public: + // Per-strand view of the data + struct View + { + friend class Recurrence_Reducer; + + public: + //Identity value for reducer: a = 0, b = 1, + //which gives a unit 2x2 matrix + View() : a(0), b(1) { } + + private: + long a; + long b; + }; + + public: + // View of reducer data + struct Monoid: cilk::monoid_base + { + static void reduce (View *left, View *right) { + left->a = right->a + left->a * right->b; + left->b = right->b * left->b; + } + }; + + private: + // Hyperobject to serve up views + cilk::reducer imp_; + + public: + Recurrence_Reducer() : imp_() { } + + // Update operations + inline Recurrence_Reducer& cal_next(const Para& value) { + View &v = imp_.view(); + + v.a = value.a + value.b * v.a; + v.b = value.b * v.b; + return *this; + } + long get_a() { return imp_.view().a; } + long get_b() { return imp_.view().b; } + }; +} + +//parallel code to compute linear recurrence +long compute_linear_rec_parallel (Para *list, int nn, long x_init) { + Recurrence_Reducer rr; + cilk_for(int i = 0; i < nn; ++i) { + rr.cal_next(list[i]); + } + return rr.get_a() + rr.get_b() * x_init; +} + +inline long cal_next(long a, long b, long x) { + return a + b * x; +} +//sequential code to compute linear recurrence +long compute_linear_rec_sequential (Para *list, int nn, long x_init) { + long x = x_init; + for(int i = 0; i < nn; ++i) { + x = cal_next(list[i].a, list[i].b, x); + } + return x; +} + +int main(int argc, char* argv[]) { + int nn = 5000000; + + if (argc == 2) { + nn = std::atoi(argv[1]); + } + + Para *plist = new Para[nn]; + if (plist == NULL) { + std::cout << "Failed to create space for parameter list. " << std::endl; + return 1; + } + + int x_initial = 12; + for(int i = 0; i < nn; i++) { + plist[i].a = rand() % 22 - 10 ; + plist[i].b = rand() % 13 - 6 ; + } + + unsigned long long start_tick, end_tick; + + start_tick = cilk_getticks(); + long sr = compute_linear_rec_sequential(plist, nn, x_initial); + end_tick = cilk_getticks(); + + long t1 = (long)(end_tick - start_tick); + + start_tick = cilk_getticks(); + long pr = compute_linear_rec_parallel(plist, nn, x_initial); + end_tick = cilk_getticks(); + long t2 = (long)(end_tick - start_tick); + + if (sr == pr) { + std::cout << "the linear recurrence value is " << pr << std::endl; + std::cout << "time for sequential execution: " << t1 / 1000.f + << std::endl; + std::cout << "time for parallel execution: " << t2 / 1000.f + << std::endl; + return 0; + } else { + std::cout << "error processing linear recurrence: " << std::endl; + std::cout << "sequential version has value " << sr << " != " + << pr << " of the parallel version" << std::endl; + return 1; + } +} diff --git a/tests/dev-tools/cilk/tests/matrix.cpp b/tests/dev-tools/cilk/tests/matrix.cpp new file mode 100644 index 0000000000..8403c108cb --- /dev/null +++ b/tests/dev-tools/cilk/tests/matrix.cpp @@ -0,0 +1,240 @@ +// -*- C++ -*- + +/* + * matrix.cpp + * + * Copyright (C) 2009-2013 Intel Corporation. All Rights Reserved. + * + * The source code contained or described herein and all + * documents related to the source code ("Material") are owned by + * Intel Corporation or its suppliers or licensors. Title to the + * Material remains with Intel Corporation or its suppliers and + * licensors. The Material is protected by worldwide copyright + * laws and treaty provisions. No part of the Material may be + * used, copied, reproduced, modified, published, uploaded, + * posted, transmitted, distributed, or disclosed in any way + * except as expressly provided in the license provided with the + * Materials. No license under any patent, copyright, trade + * secret or other intellectual property right is granted to or + * conferred upon you by disclosure or delivery of the Materials, + * either expressly, by implication, inducement, estoppel or + * otherwise, except as expressly provided in the license + * provided with the Materials. + */ + +#include +#include +#include +#include +#include "cilktime.h" + +#define RECURSION_THRESHOLD 10 + +// a naive, iterative, sequential matrix multiplication algorithm +template void multiply_iter_seq(int ii, int jj, int kk, T* A, T* B, + T* C) +{ + // Note the loop order. Exchanging the two inner loops degrades performance + // because of cache access. + for (int i = 0; i < ii; ++i) + for (int k = 0; k < kk; ++k) + for (int j = 0; j < jj; ++j) + C[i * jj + j] += A[i * kk + k] + B[k * jj + j]; +} + +// a naive, iterative, parallel matrix multiplication algorithm +template void multiply_iter_par(int ii, int jj, int kk, T* A, T* B, + T* C) +{ + cilk_for(int i = 0; i < ii; ++i) + for (int k = 0; k < kk; ++k) + cilk_for(int j = 0; j < jj; ++j) + C[i * jj + j] += A[i * kk + k] + B[k * jj + j]; +} + +// a recursive, sequential matrix multiplication algorithm +template void multiply_rec_seq_helper(int i0, int i1, int j0, + int j1, int k0, int k1, T* A, ptrdiff_t lda, T* B, ptrdiff_t ldb, T* C, + ptrdiff_t ldc) +{ + int di = i1 - i0; + int dj = j1 - j0; + int dk = k1 - k0; + if (di >= dj && di >= dk && di >= RECURSION_THRESHOLD) { + int mi = i0 + di / 2; + multiply_rec_seq_helper(i0, mi, j0, j1, k0, k1, A, lda, B, ldb, C, ldc); + multiply_rec_seq_helper(mi, i1, j0, j1, k0, k1, A, lda, B, ldb, C, ldc); + } else if (dj >= dk && dj >= RECURSION_THRESHOLD) { + int mj = j0 + dj / 2; + multiply_rec_seq_helper(i0, i1, j0, mj, k0, k1, A, lda, B, ldb, C, ldc); + multiply_rec_seq_helper(i0, i1, mj, j1, k0, k1, A, lda, B, ldb, C, ldc); + } else if (dk >= RECURSION_THRESHOLD) { + int mk = k0 + dk / 2; + multiply_rec_seq_helper(i0, i1, j0, j1, k0, mk, A, lda, B, ldb, C, ldc); + multiply_rec_seq_helper(i0, i1, j0, j1, mk, k1, A, lda, B, ldb, C, ldc); + } else { + for (int i = i0; i < i1; ++i) + for (int k = k0; k < k1; ++k) + for (int j = j0; j < j1; ++j) + C[i * ldc + j] += A[i * lda + k] * B[k * ldb + j]; + } +} + +template inline void multiply_rec_seq(int ii, int jj, int kk, T* A, + T* B, T* C) +{ + multiply_rec_seq_helper(0, ii, 0, jj, 0, kk, A, kk, B, jj, C, jj); +} + +// a recursive, parallel matrix multiplication algorithm +template void multiply_rec_par_helper(int i0, int i1, int j0, + int j1, int k0, int k1, T* A, ptrdiff_t lda, T* B, ptrdiff_t ldb, T* C, + ptrdiff_t ldc) +{ + int di = i1 - i0; + int dj = j1 - j0; + int dk = k1 - k0; + if (di >= dj && di >= dk && di >= RECURSION_THRESHOLD) { + int mi = i0 + di / 2; + cilk_spawn multiply_rec_par_helper(i0, mi, j0, j1, k0, k1, A, lda, B, + ldb, C, ldc); + multiply_rec_par_helper(mi, i1, j0, j1, k0, k1, A, lda, B, ldb, C, ldc); + cilk_sync; + } else if (dj >= dk && dj >= RECURSION_THRESHOLD) { + int mj = j0 + dj / 2; + cilk_spawn multiply_rec_par_helper(i0, i1, j0, mj, k0, k1, A, lda, B, + ldb, C, ldc); + multiply_rec_par_helper(i0, i1, mj, j1, k0, k1, A, lda, B, ldb, C, ldc); + cilk_sync; + } else if (dk >= RECURSION_THRESHOLD) { + int mk = k0 + dk / 2; + // N.B. These two calls cannot be run in parallel without introducing + // a race. + multiply_rec_par_helper(i0, i1, j0, j1, k0, mk, A, lda, B, ldb, C, ldc); + multiply_rec_par_helper(i0, i1, j0, j1, mk, k1, A, lda, B, ldb, C, ldc); + } else { + for (int i = i0; i < i1; ++i) + for (int k = k0; k < k1; ++k) + for (int j = j0; j < j1; ++j) + C[i * ldc + j] += A[i * lda + k] * B[k * ldb + j]; + } +} + +template inline void multiply_rec_par(int ii, int jj, int kk, T* A, + T* B, T* C) +{ + multiply_rec_par_helper(0, ii, 0, jj, 0, kk, A, kk, B, jj, C, jj); +} + +int matrix_main(int ii, int jj, int kk) +{ + unsigned long long start_tick, end_tick; + + // Create two random input matrices. + + std::cout << "Multiply a " << ii << "x" << kk << " matrix by a " << kk + << "x" << jj << " matrix" << std::endl << " to produce a " << ii << "x" + << jj << " matrix." << std::endl << std::endl; + + double* A = (double*) calloc(ii* kk, sizeof(double)); + cilk_for(int i = 0; i < ii * kk; i++) { + // Populate A + A[i] = (double) ((i * i) % 1024 - 512) / 512; + } + + double* B = (double*) calloc(kk* jj, sizeof(double)); + cilk_for(int i = 0; i < kk * jj; i++) { + // Populate A + B[i] = (double) ((i * i) % 1024 - 512) / 512; + } + + // Compare various matrix multiplication algorithms on these two inputs. + { + std::cout << "1) Naive, Iterative Algorithm. Sequential and Parallel." + << std::endl; + long seq_time; { + std::cout << "Running Iterative Sequential version..." << std::endl; + + double* C = (double*) calloc(ii* jj, sizeof(double)); + + start_tick = cilk_getticks(); + multiply_iter_seq(ii, jj, kk, A, B, C); + end_tick = cilk_getticks(); + + free(C); + seq_time = (long)(end_tick - start_tick); + std::cout << " Iterative Sequential version took " + << seq_time / 1000.f << " milliseconds." << std::endl; + } + long par_time; { + std::cout << "Running Iterative Parallel version..." << std::endl; + double* C = (double*) calloc(ii* jj, sizeof(double)); + + start_tick = cilk_getticks(); + multiply_iter_par(ii, jj, kk, A, B, C); + end_tick = cilk_getticks(); + + free(C); + par_time = (long)(end_tick - start_tick); + std::cout << " Iterative Parallel version took " + << par_time / 1000.f << " milliseconds." << std::endl; + } + float speed_up = 100; + if (par_time > 0) { + speed_up = seq_time / (float) par_time; + } + std::cout << " Parallel Speedup: " << speed_up << std::endl + << std::endl; + } { + std::cout << "2) Recursive Algorithm. Sequential and Parallel." + << std::endl; + long seq_time; { + std::cout << "Running Recursive Sequential version..." << std::endl; + double* C = (double*) calloc(ii* jj, sizeof(double)); + + start_tick = cilk_getticks(); + multiply_rec_seq(ii, jj, kk, A, B, C); + end_tick = cilk_getticks(); + + free(C); + seq_time = (long)(end_tick - start_tick); + std::cout << " Recursive Sequential version took " + << seq_time / 1000.f << " milliseconds." << std::endl; + } + long par_time; { + std::cout << "Running Recursive Parallel version..." << std::endl; + double* C = (double*) calloc(ii* jj, sizeof(double)); + + start_tick = cilk_getticks(); + multiply_rec_par(ii, jj, kk, A, B, C); + end_tick = cilk_getticks(); + + free(C); + par_time = (long)(end_tick - start_tick); + std::cout << " Recursive Parallel version took " + << par_time / 1000.f << " milliseconds." << std::endl; + } + + float speed_up = 100; + if (par_time > 0) { + speed_up = seq_time / (float) par_time; + } + std::cout << " Parallel Speedup: " << speed_up << std::endl + << std::endl; + } + + free(A); + free(B); + return 0; +} + +int main(int argc, char* argv[]) +{ + int ii = 687, jj = 1107, kk = 837; + if (argc > 3) { + ii = std::atoi(argv[1]); + jj = std::atoi(argv[2]); + kk = std::atoi(argv[3]); + } + return matrix_main(ii, jj, kk); +} diff --git a/tests/dev-tools/cilk/tests/matrix_multiply.cpp b/tests/dev-tools/cilk/tests/matrix_multiply.cpp new file mode 100644 index 0000000000..208ca271db --- /dev/null +++ b/tests/dev-tools/cilk/tests/matrix_multiply.cpp @@ -0,0 +1,122 @@ +/* + * matrix-multiply.ccpp + * + * Copyright (C) 2009-2012 Intel Corporation. All Rights Reserved. + * + * The source code contained or described herein and all + * documents related to the source code ("Material") are owned by + * Intel Corporation or its suppliers or licensors. Title to the + * Material remains with Intel Corporation or its suppliers and + * licensors. The Material is protected by worldwide copyright + * laws and treaty provisions. No part of the Material may be + * used, copied, reproduced, modified, published, uploaded, + * posted, transmitted, distributed, or disclosed in any way + * except as expressly provided in the license provided with the + * Materials. No license under any patent, copyright, trade + * secret or other intellectual property right is granted to or + * conferred upon you by disclosure or delivery of the Materials, + * either expressly, by implication, inducement, estoppel or + * otherwise, except as expressly provided in the license + * provided with the Materials. + */ + +#include +#include +#include +#include "cilktime.h" + +#define DEFAULT_MATRIX_SIZE 4 + +// Multiply double precsion square n x n matrices. A = B * C +// Matrices are stored in row major order. +// A is assumed to be initialized. +void matrix_multiply(double* A, double* B, double* C, unsigned int n) +{ + if (n < 1) { + return; + } + + cilk_for(unsigned int i = 0; i < n; ++i) { + // This is the only Intel(R) Cilk(TM) Plus keyword used in this program + // Note the order of the loops and the code motion of the i * n and k * n + // computation. This gives a 5-10 performance improvment over exchanging + // the j and k loops. + int itn = i * n; + for (unsigned int k = 0; k < n; ++k) { + for (unsigned int j = 0; j < n; ++j) { + int ktn = k * n; + // Compute A[i,j] in the innner loop. + A[itn + j] += B[itn + k] * C[ktn + j]; + } + } + } + return; +} + +void print_matrix(double* M, int nn) +{ + for (int i = 0; i < nn; ++i) { + for (int j = 0; j < nn; ++j) { + std::cout << M[i * nn + j] << ", "; + } + std::cout << std::endl; + } + return; +} + +int main(int argc, char** argv) { + // Create random input matrices. Override the default size with argv[1] + // Warning: Matrix indexing is 0 based. + int nn = DEFAULT_MATRIX_SIZE; + if (argc > 1) { + nn = std::atoi(argv[1]); + } + + std::cout << "Simple algorithm: Multiply two " << nn << " by " << nn + << " matrices, computing A = B*C" << std::endl; + + double* A = (double*) calloc(nn* nn, sizeof(double)); + double* B = (double*) calloc(nn* nn, sizeof(double)); + double* C = (double*) calloc(nn* nn, sizeof(double)); + if (NULL == A || NULL == B || NULL == C) { + std::cout << "Fatal Error. Cannot allocate matrices A, B, and C." + << std::endl; + return 1; + } + + // Populate B and C pseudo-randomly - + // The matrices are populated with random numbers in the range (-1.0, +1.0) + cilk_for(int i = 0; i < nn * nn; ++i) { + B[i] = (float) ((i * i) % 1024 - 512) / 512; + } + cilk_for(int i = 0; i < nn * nn; ++i) { + C[i] = (float) (((i + 1) * i) % 1024 - 512) / 512; + } + + // Multiply to get A = B*C + unsigned long long start_tick, end_tick; + long elapsed_milliseconds; + + start_tick = cilk_getticks(); + matrix_multiply(A, B, C, (unsigned int)nn); + end_tick = cilk_getticks(); + + float par_time = cilk_ticks_to_seconds(end_tick - start_tick); // (end_tick - start_tick) / 1000.0F; + std::cout << " Matrix Multiply took " << par_time << " seconds." + << std::endl; + + // If n is small, print the results + if (nn <= 8) { + std::cout << "Matrix A:" << std::endl; + print_matrix(B, nn); + std::cout << std::endl << "Matrix B:" << std::endl; + print_matrix(C, nn); + std::cout << std::endl << "Matrix C = A * B:" << std::endl; + print_matrix(A, nn); + } + + free(A); + free(B); + free(C); + return 0; +} diff --git a/tests/dev-tools/cilk/tests/qsort.cpp b/tests/dev-tools/cilk/tests/qsort.cpp new file mode 100644 index 0000000000..d6dccef736 --- /dev/null +++ b/tests/dev-tools/cilk/tests/qsort.cpp @@ -0,0 +1,100 @@ +// -*- C++ -*- + +/* + * qsort.cpp + * + * An implementation of quicksort using Intel(R) Cilk(TM) Plus parallelization. + * + * Copyright (C) 2009-2012 Intel Corporation. All Rights Reserved. + * + * The source code contained or described herein and all + * documents related to the source code ("Material") are owned by + * Intel Corporation or its suppliers or licensors. Title to the + * Material remains with Intel Corporation or its suppliers and + * licensors. The Material is protected by worldwide copyright + * laws and treaty provisions. No part of the Material may be + * used, copied, reproduced, modified, published, uploaded, + * posted, transmitted, distributed, or disclosed in any way + * except as expressly provided in the license provided with the + * Materials. No license under any patent, copyright, trade + * secret or other intellectual property right is granted to or + * conferred upon you by disclosure or delivery of the Materials, + * either expressly, by implication, inducement, estoppel or + * otherwise, except as expressly provided in the license + * provided with the Materials. + */ + +#pragma warning(disable: 18001) + +#include +#include +#include +#include +#include +#include + +// Sort the range between bidirectional iterators begin and end. +// end is one past the final element in the range. +// Use the Quick Sort algorithm, using recursive divide and conquer. +// This function is NOT the same as the Standard C Library qsort() function. +// This implementation is pure C++ code before Intel(R) Cilk(TM) Plus conversion. +void sample_qsort(int * begin, int * end) +{ + if (begin != end) { + --end; // Exclude last element (pivot) from partition + int * middle = std::partition(begin, end, + std::bind2nd(std::less(), *end)); + using std::swap; + swap(*end, *middle); // move pivot to middle + cilk_spawn sample_qsort(begin, middle); + sample_qsort(++middle, ++end); // Exclude pivot and restore end + cilk_sync; + } +} + +// A simple test harness +int qmain(int n) +{ + int* a = new int[n]; + + for (int i = 0; i < n; ++i) + a[i] = i; + + std::random_shuffle(a, a + n); + std::cout << "Sorting " << n << " integers" << std::endl; + + unsigned long long start_ticks = cilk_getticks(); + sample_qsort(a, a + n); + unsigned long long end_ticks = cilk_getticks(); + + // Confirm that a is sorted and that each element contains the index. + for (int i = 0; i < n - 1; ++i) { + if (a[i] >= a[i + 1] || a[i] != i) { + std::cout << "Sort failed at location i=" << i << " a[i] = " + << a[i] << " a[i+1] = " << a[i + 1] << std::endl; + delete[] a; + return 1; + } + } + + unsigned long long ticks = end_ticks - start_ticks; + std::cout << "Sort succeeded in " << cilk_ticks_to_seconds(ticks)*1000 << " milliseconds." << std::endl; + delete[] a; + return 0; +} + +int main(int argc, char* argv[]) +{ + int n = 10 * 1000 * 1000; + if (argc > 1) { + n = std::atoi(argv[1]); + if (n <= 0) { + std::cerr << "Invalid argument" << std::endl; + std::cerr << "Usage: qsort N" << std::endl; + std::cerr << " N = number of elements to sort" << std::endl; + return 1; + } + } + + return qmain(n); +} diff --git a/tests/dev-tools/cilk/tests/qsort_mutex.cpp b/tests/dev-tools/cilk/tests/qsort_mutex.cpp new file mode 100644 index 0000000000..a647c4f2c7 --- /dev/null +++ b/tests/dev-tools/cilk/tests/qsort_mutex.cpp @@ -0,0 +1,121 @@ +/* + * qsort-mutex.cpp + * + * Copyright (C) 2009-2013 Intel Corporation. All Rights Reserved. + * + * The source code contained or described herein and all + * documents related to the source code ("Material") are owned by + * Intel Corporation or its suppliers or licensors. Title to the + * Material remains with Intel Corporation or its suppliers and + * licensors. The Material is protected by worldwide copyright + * laws and treaty provisions. No part of the Material may be + * used, copied, reproduced, modified, published, uploaded, + * posted, transmitted, distributed, or disclosed in any way + * except as expressly provided in the license provided with the + * Materials. No license under any patent, copyright, trade + * secret or other intellectual property right is granted to or + * conferred upon you by disclosure or delivery of the Materials, + * either expressly, by implication, inducement, estoppel or + * otherwise, except as expressly provided in the license + * provided with the Materials. + * + * Demonstrate Intel(R) Cilk(TM) Plus with Intel(R) Threading Building + * Blocks mutexes. This sample counts the total number of times that + * the data is partitioned. + */ + +#include +#include +#include +#include +#include +#include +#include +#include "cilktime.h" + +#ifndef _WIN32 +#include +#else +#include +#endif + +unsigned partition_count = 0; + +// Sort the range between bidiriectional iterators begin and end. +// end is one past the final element in the range. +// Use the Quick Sort algorithm, using recursive divide and conquer. +// This function is NOT the same as the Standard C Library qsort() function. +// This implementation uses Intel Cilk Plus and Intel TBB mutexes. +template void sample_qsort(Iter begin, Iter end, tbb::mutex* m) +{ + typedef typename std::iterator_traits::value_type T; + if (begin != end) { + --end; // Exclude last element (pivot) from partition + Iter middle = std::partition(begin, end, + std::bind2nd(std::less(), *end)); + // Lock the partition counter while it's being incremented to prevent + // a race + while (!m->try_lock()) { +#ifdef _WIN32 + Sleep(10); +#else + usleep(10000); +#endif + } + partition_count++; + m->unlock(); + + using std::swap; + swap(*end, *middle); // move pivot to middle + cilk_spawn sample_qsort(begin, middle, m); + sample_qsort(++middle, ++end, m); // Exclude pivot and restore end + cilk_sync; + } +} + +// A simple test harness +int qmain(int n) +{ + unsigned long long start_tick, end_tick; + long elapsed_milliseconds; + int* a = new int[n]; + + for (int i = 0; i < n; ++i) + a[i] = i; + + std::random_shuffle(a, a + n); + + std::cout << "Sorting " << n << " integers" << std::endl; + tbb::mutex *m = new tbb::mutex; + + start_tick = cilk_getticks(); + sample_qsort(a, a + n, m); + end_tick = cilk_getticks(); + + elapsed_milliseconds = (long)(end_tick - start_tick) / 1000.f; + std::cout << elapsed_milliseconds << " milliseconds" << std::endl; + delete m; + + // Confirm that a is sorted and that each element contains the index. + for (int i = 0; i < n - 1; ++i) { + if (a[i] >= a[i + 1] || a[i] != i) { + std::cout << "Sort failed at location i=" << i << " a[i] = " << a[i] + << " a[i+1] = " << a[i + 1] << std::endl; + delete[] a; + return 1; + } + } + std::cout << "Sort succeeded." << std::endl; + delete[] a; + return 0; +} + +int main(int argc, char* argv[]) +{ + int n = 10000000; + if (argc > 1) { + n = std::atoi(argv[1]); + } + + return qmain(n); +} diff --git a/tests/dev-tools/easybuild/EasyBuild b/tests/dev-tools/easybuild/EasyBuild new file mode 100755 index 0000000000..c9e4290b54 --- /dev/null +++ b/tests/dev-tools/easybuild/EasyBuild @@ -0,0 +1,21 @@ +#!../common/bats/bin/bats +# -*-sh-*- + +load ../common/test_helper_functions || exit 1 +source ../common/functions || exit 1 + +if [ -s ../TEST_ENV ];then + source ../TEST_ENV +fi + +module load EasyBuild + +@test "[EasyBuild] check for RPM" { + run check_if_rpm_installed "EasyBuild${DELIM}" + assert_success +} + +@test "[EasyBuild] test executable" { + run eb -H + assert_success +} diff --git a/tests/dev-tools/intel-inspector/.gitignore b/tests/dev-tools/intel-inspector/.gitignore new file mode 100644 index 0000000000..9184af83c3 --- /dev/null +++ b/tests/dev-tools/intel-inspector/.gitignore @@ -0,0 +1,6 @@ +*~ +family-*/ +compile +test-driver +test-suite.log.orig +job.*.out diff --git a/tests/dev-tools/intel-inspector/Makefile.am b/tests/dev-tools/intel-inspector/Makefile.am new file mode 100644 index 0000000000..1dc78954a5 --- /dev/null +++ b/tests/dev-tools/intel-inspector/Makefile.am @@ -0,0 +1,4 @@ +AUTOMAKE_OPTIONS = foreign +AM_MAKEFLAGS = --no-print-directory +SUBDIRS = tests +ACLOCAL_AMFLAGS = -I m4 diff --git a/tests/dev-tools/intel-inspector/bootstrap b/tests/dev-tools/intel-inspector/bootstrap new file mode 120000 index 0000000000..b17b398013 --- /dev/null +++ b/tests/dev-tools/intel-inspector/bootstrap @@ -0,0 +1 @@ +../../bootstrap \ No newline at end of file diff --git a/tests/dev-tools/intel-inspector/configure.ac b/tests/dev-tools/intel-inspector/configure.ac new file mode 100644 index 0000000000..9dc59d1dc4 --- /dev/null +++ b/tests/dev-tools/intel-inspector/configure.ac @@ -0,0 +1,44 @@ +# -*- Autoconf -*- +# Process this file with autoconf to produce a configure script. +# + +AC_PREREQ(2.59) +AC_INIT([inspector], [0.10.0], [karl.w.schulz@intel.com]) +AC_CONFIG_MACRO_DIR([m4]) +AM_INIT_AUTOMAKE([foreign]) +m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) + +# verify we have necessary environment variables set + +AC_MSG_CHECKING([for INSPECTOR_DIR environment variable]) +if test "x$INSPECTOR_DIR" = "x"; then + AC_MSG_RESULT([no]) + echo + AC_ERROR([INSPECTOR_DIR not defined - please load inspector environment.]) +else + AC_MSG_RESULT([yes]) +fi + +# unset default compilers and detect compiler toolchain from environment + +CC=" " +CXX=" " +FC=" " + +OHPC_COMPILER_FAMILY + +# test compilers + +AC_PROG_FC + +AC_OUTPUT( Makefile tests/Makefile) + +echo +echo '-------------------------------------------------- SUMMARY --------------------------------------------------' +echo +echo Package version............... : $PACKAGE-$VERSION +echo OHPC compiler toolchain........ : $LMOD_FAMILY_COMPILER +echo +echo Fortran compiler.............. : `which $FC` +echo +echo '-------------------------------------------------------------------------------------------------------------' diff --git a/tests/dev-tools/intel-inspector/m4/compiler_family.m4 b/tests/dev-tools/intel-inspector/m4/compiler_family.m4 new file mode 120000 index 0000000000..c325560245 --- /dev/null +++ b/tests/dev-tools/intel-inspector/m4/compiler_family.m4 @@ -0,0 +1 @@ +../../../compilers/m4/compiler_family.m4 \ No newline at end of file diff --git a/tests/dev-tools/intel-inspector/ohpc-tests/test_inspector b/tests/dev-tools/intel-inspector/ohpc-tests/test_inspector new file mode 100755 index 0000000000..9b88d39715 --- /dev/null +++ b/tests/dev-tools/intel-inspector/ohpc-tests/test_inspector @@ -0,0 +1,37 @@ +#!/bin/bash +# -*-sh-*- + +TEST_LOGS="" +MAKEFLAGS="" + +source ./TEST_ENV || exit 1 +source ./common/functions || exit 1 + +cd dev-tools/intel-inspector || exit 1 +export BATS_JUNIT_CLASS=Inspector + +# bootstrap the local autotools project if necessary + +./bootstrap || exit 1 + +for compiler in "intel"; do + + echo " " + echo " " + echo "-------------------------------------------------------" + echo "Dev Tools: Inspector tests: $compiler" + echo "-------------------------------------------------------" + + module purge || exit 1 + module load $compiler || exit 1 + module load inspector || exit 1 + + ./configure || exit 1 + make clean || exit 1 + make -k check + + save_logs_compiler_family tests $compiler + + make distclean +done + diff --git a/tests/dev-tools/intel-inspector/tests/.gitignore b/tests/dev-tools/intel-inspector/tests/.gitignore new file mode 100644 index 0000000000..30bec0e59a --- /dev/null +++ b/tests/dev-tools/intel-inspector/tests/.gitignore @@ -0,0 +1,10 @@ +*~ +*.a +*.o +*.mod +*.log +*.trs +fortrandemo +survey.txt +result +user diff --git a/tests/dev-tools/intel-inspector/tests/Makefile.am b/tests/dev-tools/intel-inspector/tests/Makefile.am new file mode 100644 index 0000000000..b0cc5f60e7 --- /dev/null +++ b/tests/dev-tools/intel-inspector/tests/Makefile.am @@ -0,0 +1,6 @@ +TESTS_ENVIRONMENT = BATS_JUNIT_CLASS=Intel-Inspector +TESTS = test_module +CLEANFILES = *.mod +check_PROGRAMS = fortrandemo +fortrandemo_SOURCES = SGDATA.F90 SGLOWLVL.F90 SGDRAW.F90 SGADMIN.F90 SGPLOT.F90 SCIGRAPH.F90 SGDEMO.F90 +fortrandemo_FCFLAGS = -O0 -g diff --git a/tests/dev-tools/intel-inspector/tests/SCIGRAPH.F90 b/tests/dev-tools/intel-inspector/tests/SCIGRAPH.F90 new file mode 100644 index 0000000000..2dd084f857 --- /dev/null +++ b/tests/dev-tools/intel-inspector/tests/SCIGRAPH.F90 @@ -0,0 +1,26 @@ +! Copyright (C) 2007 Intel Corporation. All Rights Reserved. +! +! The source code contained or described herein and all documents related to the source code +! ("Material") are owned by Intel Corporation or its suppliers or licensors. Title to the +! Material remains with Intel Corporation or its suppliers and licensors. The Material is +! protected by worldwide copyright laws and treaty provisions. No part of the Material may be +! used, copied, reproduced, modified, published, uploaded, posted, transmitted, distributed, +! or disclosed in any way except as expressly provided in the license provided with the +! Materials. No license under any patent, copyright, trade secret or other intellectual +! property right is granted to or conferred upon you by disclosure or delivery of the +! Materials, either expressly, by implication, inducement, estoppel or otherwise, except as +! expressly provided in the license provided with the Materials. + +!********************************************************************** +! +! SciGraph -- Scientific Graphs for Intel Fortran +! +! + + MODULE SCIGRAPH + + USE SGADMIN + USE SGPLOT + + END MODULE + diff --git a/tests/dev-tools/intel-inspector/tests/SGADMIN.F90 b/tests/dev-tools/intel-inspector/tests/SGADMIN.F90 new file mode 100644 index 0000000000..788b681de5 --- /dev/null +++ b/tests/dev-tools/intel-inspector/tests/SGADMIN.F90 @@ -0,0 +1,638 @@ +! Copyright (C) 2007 Intel Corporation. All Rights Reserved. +! +! The source code contained or described herein and all documents related to the source code +! ("Material") are owned by Intel Corporation or its suppliers or licensors. Title to the +! Material remains with Intel Corporation or its suppliers and licensors. The Material is +! protected by worldwide copyright laws and treaty provisions. No part of the Material may be +! used, copied, reproduced, modified, published, uploaded, posted, transmitted, distributed, +! or disclosed in any way except as expressly provided in the license provided with the +! Materials. No license under any patent, copyright, trade secret or other intellectual +! property right is granted to or conferred upon you by disclosure or delivery of the +! Materials, either expressly, by implication, inducement, estoppel or otherwise, except as +! expressly provided in the license provided with the Materials. + +!********************************************************************** +! +! SciGraph -- Scientific Graphs for Intel Fortran +! +! + +MODULE SGADMIN + +USE SGDRAW +IMPLICIT NONE + +CONTAINS + +! Gets the graph defaults for a given graph type + + INTEGER FUNCTION GetGraphDefaults(graphType,graph) + + INTEGER graphType ! input + RECORD /GraphSettings/ graph ! output + + RECORD /GraphSettings/ cDefs ! where to put the defaults + RECORD /PrivateGraphSettings/ pDefs ! private version of defs + EQUIVALENCE(cDefs,pDefs) + + DATA cDefs.title,cDefs.titleFont,cDefs.titleColor, & + cDefs.title2,cDefs.title2Font,cDefs.title2Color, & + cDefs.graphColor,cDefs.graphBgColor, & + cDefs.x1,pDefs.y1,cDefs.x2,cDefs.y2,cDefs.setGraphMode, & + pDefs.numXAxesReq,pDefs.numYAxesReq, & + pDefs.numSetsReq,pDefs.didPlotGraph,pDefs.numSets, & + pDefs.numSetsDone & + /'Graph',$FTCOUR,$CIYELLOW,' ',$FTCOURSM,$CIWHITE, & + $CIBRIGHTWHITE,$CIBLUE,0,0,639,479,.TRUE.,6*0/ + + IF (graphType .LT. 1 .OR. graphType .GT. $GTCOUNT) THEN + GetGraphDefaults=$GEGRAPH + END IF + + cDefs.graphType=graphType + + graph=cDefs + GetGraphDefaults=$GEOK + RETURN + END FUNCTION + +! Gets data settings defaults and stores them in dSettings based on the graph +! settings and the data values + + INTEGER FUNCTION GetDataDefaults(graph,numPoints,data,dSettings) + + RECORD /GraphSettings/ graph ! input/output + INTEGER numPoints ! input: number of data points + REAL*4 data(1) ! input: actual data + RECORD /DataSettings/ dSettings ! output + RECORD /DataSettings/ dSettingsArray(1) + pointer( dSettingsArrayPtr, dSettingsArray ) + + dSettingsArrayPtr = loc(dSettings) + GetDataDefaults=GetMultiDataDefaults(graph,numPoints,data, & + 1,dSettingsArray) + RETURN + END FUNCTION + + +! Gets multiple data settings defaults and stores them in dSettings based on +! the graph settings and the data values + + INTEGER FUNCTION GetMultiDataDefaults(graph,numPoints,data, & + numSettings,dSettingsArray) + + RECORD /GraphSettings/ graph ! input + INTEGER numPoints ! input: number of data points + REAL*4 data(1) ! input: actual data + INTEGER numSettings ! input + RECORD /DataSettings/ dSettingsArray(numSettings) ! output + + RECORD /PrivateGraphSettings/ pgraph ! private graph + RECORD /GraphSettings/ cgraph ! copy of private graph + EQUIVALENCE(cgraph,pgraph) + + RECORD /DataSettings/ dDefs + + CHARACTER*2 tempStr + INTEGER, PARAMETER :: markers($MKCOUNT) = & + (/ $MKSQUARE,$MKTRIANGLE,$MKDIAMOND,$MKCIRCLE, & + $MKPLUS,$MKX,$MKFISQUARE,$MKFITRIANGLE, & + $MKFIDIAMOND,$MKFICIRCLE /) + INTEGER, PARAMETER :: colors(16) = & + (/ $CIBRIGHTWHITE,$CIYELLOW,$CILIGHTMAGENTA, & + $CILIGHTCYAN,$CIWHITE,$CILIGHTGREEN,$CILIGHTRED, & + $CILIGHTBLUE,$CIBROWN,$CIMAGENTA,$CICYAN, & + $CIGRAY,$CIGREEN,$CIRED,$CIBLACK,$CIBLUE /) + INTEGER errBar,d1 + REAL*4 xval,yval,eval + INTEGER getSets + + cgraph=graph + + IF (numPoints .LT. 1 .OR. numSettings .LT. 1) THEN + GetMultiDataDefaults=$GEPARAMS + RETURN + END IF + + IF (cgraph.graphType .EQ. $GTBAR .OR. cgraph.graphType & + .EQ. $GTLINE .OR. cgraph.graphType & + .EQ. $GTLINEWERRBAR) THEN + GetMultiDataDefaults=$GEGRAPH + RETURN + END IF + + IF (cgraph.graphType .EQ. $GTXYWERRBAR) THEN + errBar=1 + ELSE + errBar=0 + ENDIF + + DO getSets = 1,numSettings + pgraph.numSetsReq=pgraph.numSetsReq+1 + WRITE(tempStr,'(I2)') pgraph.numSetsReq + dDefs.title="Data Range"//tempStr + dDefs.titleColor=colors(MOD(pgraph.numSetsReq-1,16)+1) + dDefs.titleFont=$FTCOURSM + dDefs.xFirst=.TRUE. + dDefs.numPoints=numPoints + dDefs.numElements=2+errBar + IF (dDefs.numPoints .LT. 1) THEN + GetMultiDataDefaults=$GEDIMS + RETURN + END IF + + dDefs.dataType=$DTNUM + dDefs.markerType=markers(MOD(pgraph.numSetsReq-1_2,$MKCOUNT)+1) + dDefs.markerColor=dDefs.titleColor + dDefs.lineType=$LTSOLID + dDefs.lineColor=dDefs.titleColor + dDefs.barType=$BTNONE + dDefs.barColor=0 + dDefs.errorBarType=$EBNONE + dDefs.errorBarColor=0 + + IF (cgraph.graphType .EQ. $GTXYWERRBAR & + .OR. cgraph.graphType .EQ. $GTLINEWERRBAR) THEN + dDefs.errorBarType=$EBTHIN + dDefs.errorBarColor=dDefs.markerColor + END IF + + eval=0.0 + DO d1= 1,dDefs.numPoints ! scan data for high/low + xval=data(SciGetDataOffset(dDefs,getSets,d1,1)) + IF (dDefs.xLowVal .GT. xval .OR. d1 .EQ. 1) & + dDefs.xLowVal=xval + IF (dDefs.xHighVal .LT. xval .OR. d1 .EQ. 1) & + dDefs.xHighVal=xval + + yval=data(SciGetDataOffset(dDefs,getSets,d1,2)) + IF (errBar .EQ. 1) & + eval=data(SciGetDataOffset(dDefs,getSets,d1,3)) + IF (dDefs.yLowVal .GT. yval-eval .OR. d1 .EQ. 1) & + dDefs.yLowVal=yval-eval + IF (dDefs.yHighVal .LT. yval+eval .OR. d1 .EQ. 1) & + dDefs.yHighVal=yval+eval + END DO + dSettingsArray(getSets)=dDefs + END DO ! settings loop + graph=cgraph + GetMultiDataDefaults=$GEOK + RETURN + END FUNCTION + + + +! GetLabelDataDefaults sets a DataSettings structure to good defaults based +! on the given graph settings, labels, and data + + INTEGER FUNCTION GetLabelDataDefaults(graph,numLabels,labels, & + data,dSettings) + RECORD /GraphSettings/ graph ! input + INTEGER numLabels ! input + CHARACTER*(*) labels(numLabels) ! input + REAL*4 data(1) ! input: actual data + RECORD /DataSettings/ dSettings ! output + RECORD /DataSettings/ dSettingsArray(1) + pointer( dSettingsArrayPtr, dSettingsArray ) + + dSettingsArrayPtr = loc(dSettings) + GetLabelDataDefaults=GetLabelMultiDataDefaults(graph, & + numLabels,labels,data,1,dSettingsArray) + RETURN + END FUNCTION + + +! GetMultiLabelDataDefaults sets DataSettings structures to good defaults based +! on the given graph settings, labels, and data + + INTEGER FUNCTION GetLabelMultiDataDefaults(graph,numLabels,labels,data, & + numSettings,dSettingsArray) + + RECORD /GraphSettings/ graph ! input + INTEGER numLabels ! input + CHARACTER*(*) labels(numLabels) ! input + REAL*4 data(1) ! input: actual data + INTEGER numSettings ! input + RECORD /DataSettings/ dSettingsArray(numSettings) ! output + + RECORD /PrivateGraphSettings/ pgraph ! private graph + RECORD /GraphSettings/ cgraph ! copy of private graph + EQUIVALENCE(cgraph,pgraph) + + RECORD /DataSettings/ dDefs + + CHARACTER*2 tempStr + INTEGER, PARAMETER :: bars($BTCOUNT) = & + (/ $BTHASHLEFT,$BTHASHRIGHT, & + $BTHEAVYHASHLEFT,$BTHEAVYHASHRIGHT,$BTSOLID,$BTEMPTY /) + INTEGER, PARAMETER :: markers($MKCOUNT) = & + (/ $MKSQUARE,$MKTRIANGLE,$MKDIAMOND,$MKCIRCLE, & + $MKPLUS,$MKX,$MKFISQUARE,$MKFITRIANGLE, & + $MKFIDIAMOND,$MKFICIRCLE /) + INTEGER, PARAMETER :: colors(16) = & + (/ $CIBRIGHTWHITE,$CIYELLOW,$CILIGHTMAGENTA, & + $CILIGHTCYAN,$CIWHITE,$CILIGHTGREEN,$CILIGHTRED, & + $CILIGHTBLUE,$CIBROWN,$CIMAGENTA,$CICYAN, & + $CIGRAY,$CIGREEN,$CIRED,$CIBLACK,$CIBLUE /) + REAL*4 yval,eval + INTEGER errBar,d1 + INTEGER getSets + INTEGER dummy + + cgraph=graph + + IF (numLabels .LT. 1 .OR. numSettings .LT. 1) THEN + GetLabelMultiDataDefaults=$GEPARAMS + RETURN + END IF + + IF (cgraph.graphType .NE. $GTBAR .AND. cgraph.graphType & + .NE. $GTLINE .AND. cgraph.graphType & + .NE. $GTLINEWERRBAR) THEN + GetLabelMultiDataDefaults=$GEGRAPH + RETURN + END IF + + IF (cgraph.graphType .EQ. $GTLINEWERRBAR) THEN + errBar=1 + ELSE + errBar=0 + ENDIF + + + DO getSets = 1,numSettings + pgraph.numSetsReq=pgraph.numSetsReq+1 + WRITE(tempStr,'(I2)') pgraph.numSetsReq + dDefs.title="Data Range"//tempStr + dDefs.titleColor=colors(MOD(pgraph.numSetsReq-1,16)+1) + dDefs.titleFont=$FTCOURSM + dDefs.xFirst=.TRUE. + + dDefs.numPoints=numLabels + dDefs.numElements=1+errBar + IF (dDefs.numPoints .LT. 1) THEN + GetLabelMultiDataDefaults=$GEDIMS + RETURN + END IF + + dDefs.dataType=$DTTEXT + + ! could check to see what lengths strings are here + dummy=LEN(labels(1)) + + IF (cgraph.graphType .EQ. $GTBAR) THEN + dDefs.markerType=$MKNONE + dDefs.markerColor=0 + dDefs.lineType=$LTNONE + dDefs.lineColor=0 + dDefs.barType=bars(MOD(pgraph.numSetsReq-1_2,$BTCOUNT)+1) + dDefs.barColor=dDefs.titleColor + dDefs.errorBarType=$EBNONE + dDefs.errorBarColor=0 + ELSE ! one of the line graphs + dDefs.lineType=$LTSOLID + dDefs.lineColor=dDefs.titleColor + dDefs.markerType=markers(MOD(pgraph.numSetsReq-1_2,$MKCOUNT)+1) + dDefs.markerColor=dDefs.lineColor + dDefs.barType=$BTNONE + dDefs.barColor=0 + IF (errBar .EQ. 1) THEN + dDefs.errorBarType=$EBTHIN + dDefs.errorBarColor=dDefs.markerColor + ELSE + dDefs.errorBarType=$EBNONE + dDefs.errorBarColor=0 + END IF + END IF + + dDefs.xLowVal=0 + dDefs.xHighVal=numLabels + + eval=0.0 + DO d1= 1,dDefs.numPoints ! scan data for high/low + yval=data(SciGetDataOffset(dDefs,getSets,d1,1)) + IF (errBar .EQ. 1) & + eval=data(SciGetDataOffset(dDefs,getSets,d1,2)) + IF (dDefs.yLowVal .GT. yval-eval .OR. d1 .EQ. 1) & + dDefs.yLowVal=yval-eval + IF (dDefs.yHighVal .LT. yval+eval .OR. d1 .EQ. 1) & + dDefs.yHighVal=yval+eval + END DO + + dSettingsArray(getSets)=dDefs + END DO ! settings loop + + graph=cgraph + GetLabelMultiDataDefaults=$GEOK + RETURN + END FUNCTION + + + +! Gets axis defaults based on a data settings structure and a graph settings +! structure + + INTEGER FUNCTION GetAxisDefaults(graph,dSettings,axisType,axisFunc,axis) + + RECORD /GraphSettings/ graph ! input + RECORD /DataSettings/ dSettings ! input + RECORD /DataSettings/ dSettingsArray(1) + pointer( dSettingsArrayPtr, dSettingsArray ) + INTEGER axisType ! input: $ATX,$ATY + INTEGER axisFunc ! input: $AFNONE,$AFLOG,... + RECORD /AxisSettings/ axis ! output + + dSettingsArrayPtr = loc(dSettings) + GetAxisDefaults=GetAxisMultiDefaults(graph,1, & + dSettingsArray,axisType,axisFunc,axis) + RETURN + END FUNCTION + + +! GetAxisMultiDefautls sets axis to good defaults based of the given graph, +! and data settings. It tries to give a good scale. + INTEGER FUNCTION GetAxisMultiDefaults(graph,numSettings, & + dSettingsArray,axisType,axisFunc,axis) + + RECORD /GraphSettings/ graph ! input + INTEGER numSettings ! input + RECORD /DataSettings/ dSettingsArray(numSettings) ! input + INTEGER axisType ! input: $ATX,$ATY + INTEGER axisFunc ! input: $AFNONE,$AFLOG,... + RECORD /AxisSettings/ axis ! output + + RECORD /PrivateGraphSettings/ pgraph ! private graph + RECORD /GraphSettings/ cgraph ! copy of private graph + EQUIVALENCE(cgraph,pgraph) + + RECORD /AxisSettings/ aDefs + INTEGER getExtremes + DOUBLE PRECISION lowi,highi,diffi + INTEGER numTicks,helpScale + REAL*8 logBase,rmag,temp + REAL*8 cLow,cHigh + LOGICAL isLog + + cgraph=graph + + IF (numSettings .LT. 1) THEN + GetAxisMultiDefaults=$GEPARAMS + RETURN + END IF + + IF (axisType .EQ. $ATX .OR. axisType .EQ. $ATR) THEN + IF (axisType .EQ. $ATX) THEN + aDefs.title='X Axis' + ELSE + aDefs.title='R Axis' + END IF + IF (pgraph.numXAxesReq .GT. 0) THEN + aDefs.axisPos=$APTOP + ELSE + aDefs.axisPos=$APBOTTOM + END IF + pgraph.numXAxesReq=pgraph.numXAxesReq+1 + ELSE IF (axisType .EQ. $ATY .OR. axisType .EQ. $ATTHETA) THEN + IF (axisType .EQ. $ATY) THEN + aDefs.title='Y Axis' + ELSE + aDefs.title='Theta Axis' + END IF + IF (pgraph.numYAxesReq .GT. 0) THEN + aDefs.axisPos=$APRIGHT + ELSE + aDefs.axisPos=$APLEFT + END IF + IF (axisType .EQ. $ATTHETA) THEN + aDefs.axisPos=$APRIGHT + END IF + pgraph.numYAxesReq=pgraph.numYAxesReq+1 + ELSE + GetAxisMultiDefaults=$GEAXIS ! not a valid axis type + RETURN + ENDIF + + IF ( ( (axisType .EQ. $ATX .OR. axisType .EQ. $ATY) & + .AND. graph.graphType .EQ. $GTPOLAR) .OR. & + ( (axisType .EQ. $ATR .OR. axisType .EQ. $ATTHETA) & + .AND. graph.graphType .NE. $GTPOLAR) ) THEN + GetAxisMultiDefaults=$GEAXIS ! not a valid axis func + RETURN + ENDIF + + IF (axisFunc .LT. 0 .OR. axisFunc .GT. $AFCOUNT) THEN + GetAxisMultiDefaults=$GEAXIS ! not a valid axis func + RETURN + ENDIF + + aDefs.axisType=axisType + aDefs.axisColor=cgraph.graphColor + aDefs.axisFont=$FTSANSSERIFSM + aDefs.axisFontRotated=.FALSE. + aDefs.titleFont=cgraph.titleFont + aDefs.titleColor=cgraph.titleColor + + IF (.NOT. (dSettingsArray(1).dataType .EQ. $DTTEXT .AND. & + (axisType .EQ. $ATX .OR. axisType .EQ. $ATR ))) THEN ! only do scaling for numeric + + DO getExtremes = 1,numSettings + IF (axisType .EQ. $ATX .OR. axisType .EQ. $ATR ) THEN + cLow=dSettingsArray(getExtremes).xLowVal + cHigh=dSettingsArray(getExtremes).xHighVal + ELSE + cLow=dSettingsArray(getExtremes).yLowVal + cHigh=dSettingsArray(getExtremes).yHighVal + END IF + + IF (aDefs.lowVal .GT. cLow .OR. getExtremes .EQ. 1) THEN + aDefs.lowVal=cLow + END IF + + IF (aDefs.highVal .LT. cHigh .OR. getExtremes .EQ. 1) THEN + aDefs.highVal=cHigh + END IF + END DO + + IF (axisType .EQ. $ATR) THEN ! don't let min r-polar be < 0 + IF (aDefs.lowVal .LT. 0) THEN + IF (-aDefs.lowVal .GT. aDefs.highVal) THEN + aDefs.highVal=-aDefs.lowVal + aDefs.lowVal=0 + ELSE + aDefs.lowVal=0 + END IF + END IF + END IF + + IF (aDefs.lowVal .GE. aDefs.highVal) THEN + GetAxisMultiDefaults=$GEDATA + RETURN + END IF + + isLog=axisFunc .NE. $AFNONE + IF (isLog) THEN ! log axis graph + IF (aDefs.lowVal .LE. 0) THEN + GetAxisMultiDefaults=$GEDATA + RETURN + END IF + SELECT CASE (axisFunc) + CASE ($AFLOG10) + aDefs.tickRatio=9 ! 10,20,30,40,50,60,70,80,90,100 + logBase=10.0 + CASE ($AFLOG) + logBase=EXP(1.0) + aDefs.tickRatio=9 ! e**2..e**4 10 values + CASE ($AFLOG2) + logBase=2.0 + aDefs.tickRatio=8 ! 2, 2.25, 2.5, 2.75, 3.0, 3.25, 3.5, 3.75, 4.0 + END SELECT + + temp=DLOG(aDefs.lowVal)/DLOG(logBase) + lowi=INT(temp) ! calc lowi + IF (temp .NE. lowi .AND. temp .LT. 0) THEN + lowi=lowi-1 + ENDIF + IF (lowi .LT. 0) THEN + aDefs.numDigits=-lowi + ELSE + aDefs.numDigits=2 + END IF + lowi=logBase**lowi + + temp=DLOG(aDefs.highVal)/DLOG(logBase) + highi=INT(temp) ! calc lowi + IF (temp .NE. highi .AND. temp .GT. 0) THEN + highi=highi+1 + END IF + highi=logBase**highi + + + aDefs.lowVal=lowi + aDefs.highVal=highi + aDefs.increment=1 ! increment gets fixed up later + + ELSE ! non-log graphs (rect and polar) + IF (axisType .NE. $ATTHETA) THEN + lowi=aDefs.lowVal ! will be left bounding int + highi=aDefs.highVal ! will be right bounding int + + diffi=highi-lowi + rmag=10.D0**INT(DLOG10(diffi)) ! 10s, 100s, 1000s, ... + + temp=lowi/rmag ! calc lowi + lowi=INT(temp) + IF (ABS(temp-lowi) .GE. $EPREAL4 .AND. temp .LT. 0) THEN + lowi=lowi-1 + ENDIF + lowi=lowi*rmag + + temp=highi/rmag ! calc highi + highi=INT(temp) + IF (ABS(temp-highi) .GE. $EPREAL4 .AND. temp .GT. 0) THEN + highi=highi+1 + ENDIF + highi=highi*rmag + + aDefs.lowVal=lowi + aDefs.highVal=highi + helpScale= (highi-lowi)/rmag + IF (helpScale .GT. 5) THEN + numTicks=helpScale + ELSE + SELECT CASE (helpScale) + CASE (5) + numTicks=10 + CASE (4) + numTicks=8 + CASE (3) + numTicks=6 + CASE (2) + numTicks=8 + CASE (1) + numTicks=10 + END SELECT + END IF + + aDefs.tickRatio=5 + aDefs.increment=(highi-lowi)/numTicks + aDefs.numDigits=3 + IF (graph.graphType .EQ. $GTPOLAR) THEN ! polar r-axis + aDefs.increment=aDefs.increment*2.0 + END IF + ELSE ! must be a polar theta axis, do special scaling + lowi=aDefs.lowVal ! will be left bounding int + highi=aDefs.highVal ! will be right bounding int + + diffi=highi-lowi + + ! assume it is a degree graph + IF (diffi .GT. 4*$PI) THEN + rmag=90.0 + aDefs.numDigits=2 + ELSE + rmag=$PI/2.0D0 + aDefs.numDigits=3 + END IF + + + temp=lowi/rmag ! calc lowi + lowi=INT(temp) + IF (ABS(temp-lowi) .GE. $EPREAL4 .AND. temp .LT. 0) THEN + lowi=lowi-1 + ENDIF + lowi=lowi*rmag + + temp=highi/rmag ! calc highi + highi=INT(temp) + IF (ABS(temp-highi) .GE. $EPREAL4 .AND. temp .GT. 0) THEN + highi=highi+1 + ENDIF + highi=highi*rmag + + aDefs.lowVal=lowi + aDefs.highVal=highi + helpScale= (highi-lowi)/rmag + IF (helpScale .GE. 5) THEN + numTicks=helpScale + ELSE + SELECT CASE (helpScale) + CASE (4) + numTicks=4 + CASE (3) + numTicks=6 + CASE (2) + numTicks=4 + CASE (1) + numTicks=4 + END SELECT + END IF + + aDefs.tickRatio=5 + aDefs.increment=(highi-lowi)/numTicks + END IF + END IF + ELSE ! this must be X axis labels + aDefs.lowVal=0 ! must be like this (0..n) + aDefs.highVal=dSettingsArray(1).numPoints + aDefs.tickRatio=1 + aDefs.increment=1 + aDefs.numDigits=0 + END IF + + aDefs.axisFunc=axisFunc + aDefs.axisCW=.FALSE. + aDefs.tickType=$TTBOTH + aDefs.tickColor=aDefs.axisColor + aDefs.minorTickColor=MOD(aDefs.tickColor,8_2) + + aDefs.gridStyle=$GSMAJOR + aDefs.gridLineType=$LTDOT + aDefs.gridColor=aDefs.tickColor + + graph=cgraph + axis=aDefs + GetAxisMultiDefaults=$GEOK + RETURN + END FUNCTION + +END MODULE SGADMIN diff --git a/tests/dev-tools/intel-inspector/tests/SGDATA.F90 b/tests/dev-tools/intel-inspector/tests/SGDATA.F90 new file mode 100644 index 0000000000..0f09d800e1 --- /dev/null +++ b/tests/dev-tools/intel-inspector/tests/SGDATA.F90 @@ -0,0 +1,321 @@ +! Copyright (C) 2007 Intel Corporation. All Rights Reserved. +! +! The source code contained or described herein and all documents related to the source code +! ("Material") are owned by Intel Corporation or its suppliers or licensors. Title to the +! Material remains with Intel Corporation or its suppliers and licensors. The Material is +! protected by worldwide copyright laws and treaty provisions. No part of the Material may be +! used, copied, reproduced, modified, published, uploaded, posted, transmitted, distributed, +! or disclosed in any way except as expressly provided in the license provided with the +! Materials. No license under any patent, copyright, trade secret or other intellectual +! property right is granted to or conferred upon you by disclosure or delivery of the +! Materials, either expressly, by implication, inducement, estoppel or otherwise, except as +! expressly provided in the license provided with the Materials. + +!********************************************************************** +! +! SciGraph -- Scientific Graphs for Intel Fortran +! +! + +!====================================================================== +! +! DESCRIPTION +! Contains the type definitions and parameters (constants) used in the +! SciGraph graphing library. +! +! 6/2001 Remove 'noisy' compiler directives + +MODULE SGDATA + + IMPLICIT NONE + + STRUCTURE /GraphSettings/ + CHARACTER*40 title ! title for graph + INTEGER(2) titleFont ! title font: $FTCOUR,$FTCOURSM,... + INTEGER(2) titleColor ! title color (0..numcolors) + CHARACTER*40 title2 ! second title for graph + INTEGER(2) title2Font ! second title font: $FTCOUR,$FTCOURSM,... + INTEGER(2) title2Color ! second title color (0..numcolors) + INTEGER(2) graphType ! what kind of graph: $GTBAR,$GTLINE,... + INTEGER(2) graphColor ! what color for graph border + INTEGER(2) graphBgColor ! what color for graph background + INTEGER(2) x1,y1,x2,y2 ! physical screen boundaries for graph + LOGICAL setGraphMode ! if SciGraph should set the graphics mode + INTEGER sgprivate(8) ! data PRIVATE to SciGraph: don't change + END STRUCTURE + + STRUCTURE /PrivateGraphSettings/ + CHARACTER*40 title ! title for graph + INTEGER(2) titleFont ! title font: $FTCOUR,$FTCOURSM,... + INTEGER(2) titleColor ! title color (0..numcolors) + CHARACTER*40 title2 ! second title for graph + INTEGER(2) title2Font ! second title font: $FTCOUR,$FTCOURSM,... + INTEGER(2) title2Color ! second title color (0..numcolors) + INTEGER(2) graphType ! what kind of graph: $GTBAR,$GTLINE,... + INTEGER(2) graphColor ! what color for graph border + INTEGER(2) graphBgColor ! what color for graph background + INTEGER(2) x1,y1,x2,y2 ! physical screen boundaries for graph + LOGICAL setGraphMode ! if SciGraph should set the graphics mode +! The following 3 will only get set if the user calls the Get*Default routines + INTEGER numSetsReq ! number of data settings requested (for auto color) + INTEGER numXAxesReq ! number of X axes requested + INTEGER numYAxesReq ! number of Y axes requested +! The following 4 will always get set by the PlotGraph and Plot*Data routines + INTEGER didPlotGraph ! 1 if did plot graph successfully, else 0 + INTEGER numSets ! number of data sets to plot + INTEGER numSetsDone ! number of data sets plotted so far + END STRUCTURE + + REAL(8), PARAMETER :: $WXMIN = 0.0D0 + REAL(8), PARAMETER :: $WXMAX = 10240.0D0 + REAL(8), PARAMETER :: $WX = $WXMAX-$WXMIN + REAL(8), PARAMETER :: $WXC = $WXMIN+$WX/2.0D0 + REAL(8), PARAMETER :: $WYMIN = 0.0D0 + REAL(8), PARAMETER :: $WYMAX = 7680.0D0 + REAL(8), PARAMETER :: $WY = $WYMAX-$WYMIN + REAL(8), PARAMETER :: $WYC = $WYMIN+$WY/2.0D0 + REAL(8), PARAMETER :: $GXMIN = 1300.0D0 + REAL(8), PARAMETER :: $GXMAX = 8940.0D0 + REAL(8), PARAMETER :: $GX = $GXMAX-$GXMIN + REAL(8), PARAMETER :: $GXC = $GXMIN+$GX/2.0D0 + REAL(8), PARAMETER :: $GYMIN = 1248.0D0 + REAL(8), PARAMETER :: $GYMAX = 6032.0D0 + REAL(8), PARAMETER :: $GY = $GYMAX-$GYMIN + REAL(8), PARAMETER :: $GYC = $GYMIN+$GY/2.0D0 + REAL(8), PARAMETER :: $PGR = 2560.0 + + STRUCTURE /DataSettings/ + CHARACTER*20 title ! title for data range (legend) + INTEGER(2) titleFont ! which font: $FTCOUR,$FTCOURSM,... + INTEGER(2) titleColor ! title color (0..numcolors) + + INTEGER(2) markerType ! marker style: $MKNONE,$MKSQUARE,... + INTEGER(2) markerColor ! marker color (0..numcolors) + INTEGER(2) lineType ! line type: $LTNONE, $LTSOLID,... + INTEGER(2) lineColor ! line color + INTEGER(2) barType ! bar type: $BTNONE,$BTSOLID,.. + INTEGER(2) barColor ! bar color + INTEGER(2) errorbarType ! error bar style: $EBNONE, $EBTHIN,... + INTEGER(2) errorbarColor ! error bar color + + INTEGER dataType ! #,# or text,# ? $DTTEXT, $DTNUM + LOGICAL xFirst ! x stored before y in a given row + INTEGER numPoints ! number of data points or labels (bar/line) + INTEGER numElements ! number of elements per data point (2/3) + + REAL*8 xLowVal ! x values>= this value + REAL*8 xHighVal ! x values<= this value + + REAL*8 yLowVal ! y values>= this value + REAL*8 yHighVal ! y values<= this value + END STRUCTURE + + + STRUCTURE /AxisSettings/ + CHARACTER*25 title ! title for axis + INTEGER(2) titleFont ! which font: $FTCOUR,$FTCOURSM,... + INTEGER(2) titleColor ! title color (0..numcolors) + + INTEGER(2) axisFont ! what font for the axis numbers/labels + LOGICAL(2) axisFontRotated ! .TRUE. if axis numbers rotated (y only) + INTEGER(2) axisPos ! where to put axis: $APBOTTOM,$APTOP,... + INTEGER(2) axisType ! what kind of axis: $ATX, $ATY,... + INTEGER(2) axisColor ! what color the line of the axis is + INTEGER(2) axisFunc ! axis function: $AFNONE,$AFLOG10,... + LOGICAL axisCW ! if polar axis is clockwise + REAL*8 lowVal ! axis starts at this value + REAL*8 highVal ! axis ends at this value + REAL*8 increment ! axis increment for major ticks + INTEGER numDigits ! number of decimal digits to print + + INTEGER(2) tickType ! tick type: $TTNONE,$TTINSIDE,... + INTEGER(2) tickColor ! color of the major (big) ticks + INTEGER(2) minorTickColor ! color of the minor (small) ticks + INTEGER(2) tickRatio ! number of minor ticks from one major + ! tick to the next: + ! 1= all major ticks(||||), + ! 2=(|.|), 3=(|..|),4= |...|, etc + INTEGER(2) gridStyle ! grid style: $GSNONE,$GSMAJOR,... + INTEGER(2) gridLineType ! grid line type: $LTNONE, $LTSOLID,... + INTEGER(2) gridColor ! color of grid lines + END STRUCTURE + +! Include the actual structure definitions which are stored in separate files +! Logical constants for Fortran type checking +! LOGICAL $TRUE2,$FALSE2 +! PARAMETER ($TRUE2 =.TRUE.) +! PARAMETER ($FALSE2 =.FALSE.) + +! Numeric constants need in SciGraph + REAL(8), PARAMETER :: $PI = 3.141592653589793D0 + REAL(8), PARAMETER :: $EPREAL4 = 1.192092895507813D-07 + REAL(8), PARAMETER :: $EPREAL8 = 2.220446049250313D-016 + +! Color indices for default 16 color palette + INTEGER(2), PARAMETER :: $CIBLACK = 0 + INTEGER(2), PARAMETER :: $CIBLUE = 1 + INTEGER(2), PARAMETER :: $CIGREEN = 2 + INTEGER(2), PARAMETER :: $CICYAN = 3 + INTEGER(2), PARAMETER :: $CIRED = 4 + INTEGER(2), PARAMETER :: $CIMAGENTA = 5 + INTEGER(2), PARAMETER :: $CIBROWN = 6 + INTEGER(2), PARAMETER :: $CIWHITE = 7 + INTEGER(2), PARAMETER :: $CIGRAY = 8 + INTEGER(2), PARAMETER :: $CILIGHTBLUE = 9 + INTEGER(2), PARAMETER :: $CILIGHTGREEN = 10 + INTEGER(2), PARAMETER :: $CILIGHTCYAN = 11 + INTEGER(2), PARAMETER :: $CILIGHTRED = 12 + INTEGER(2), PARAMETER :: $CILIGHTMAGENTA = 13 + INTEGER(2), PARAMETER :: $CIYELLOW = 14 + INTEGER(2), PARAMETER :: $CIBRIGHTWHITE = 15 + +! Graph types for use in graph settings structure + INTEGER, PARAMETER :: $GTBAR = 1 ! bar graph (x=text labels, y=num) + INTEGER, PARAMETER :: $GTLINE = 2 ! line graph (x=text labels, y=num) + INTEGER, PARAMETER :: $GTLINEWERRBAR = 3 ! line graph with error bars (same) + INTEGER, PARAMETER :: $GTXY = 4 ! xy graph (x=num, y=num) + INTEGER, PARAMETER :: $GTXYWERRBAR = 5 ! xy graph with error bars + INTEGER, PARAMETER :: $GTPOLAR = 6 ! polar coordinate graph + INTEGER, PARAMETER :: $GTCOUNT = 6 ! how many total GTs + +! Font types for use in settings structures + INTEGER(2), PARAMETER :: $FTCOUR = 1 ! courier font + INTEGER(2), PARAMETER :: $FTCOURSM = 2 ! small courier font + INTEGER(2), PARAMETER :: $FTTROMAN = 3 ! roman font + INTEGER(2), PARAMETER :: $FTTROMANSM = 4 ! small roman font + INTEGER(2), PARAMETER :: $FTSANSSERIF = 5 ! SANSSERIF font + INTEGER(2), PARAMETER :: $FTSANSSERIFSM = 6 ! small SANSSERIF font + INTEGER(2), PARAMETER :: $FTCOUNT = 6 ! how many total FTs + + INTEGER(2), PARAMETER :: $FTDEF = 1000 ! default font + +! Font "values" + CHARACTER*50, PARAMETER :: $FVCOUR = "t'Courier New'h20w10b" + CHARACTER*50, PARAMETER :: $FVCOURSM = "t'Courier New'h20w9b" + CHARACTER*50, PARAMETER :: $FVTROMAN = "t'Times New Roman'h26w13b" + CHARACTER*50, PARAMETER :: $FVTROMANSM = "t'Times New Roman'h16w8b" + CHARACTER*50, PARAMETER :: $FVSANSSERIF = "t'MS Sans Serif'h24w12b" + CHARACTER*50, PARAMETER :: $FVSANSSERIFSM = "t'MS Sans Serif'h12w6b" + CHARACTER*50, PARAMETER :: $FVDEF = $FVCOUR + + +! Data types for use in data settings structure + INTEGER(2), PARAMETER :: $DTNUM = 1 ! data is numeric,numeric + INTEGER(2), PARAMETER :: $DTTEXT = 2 ! data is text,numeric + INTEGER(2), PARAMETER :: $DTCOUNT = 2 ! how many total DTs + + +! Marker types for use in data settings structure + INTEGER(2), PARAMETER :: $MKNONE = 0 ! no markers at points + INTEGER(2), PARAMETER :: $MKSQUARE = 1 ! draw squares at points + INTEGER(2), PARAMETER :: $MKTRIANGLE = 2 ! triangles + INTEGER(2), PARAMETER :: $MKDIAMOND = 3 ! diamonds + INTEGER(2), PARAMETER :: $MKCIRCLE = 4 ! circles + INTEGER(2), PARAMETER :: $MKPLUS = 5 ! plus signs + INTEGER(2), PARAMETER :: $MKX = 6 ! X marks + INTEGER(2), PARAMETER :: $MKFISQUARE = 7 ! filled in squares + INTEGER(2), PARAMETER :: $MKFITRIANGLE = 8 ! filled triangles + INTEGER(2), PARAMETER :: $MKFIDIAMOND = 9 ! filled diamonds + INTEGER(2), PARAMETER :: $MKFICIRCLE = 10 ! filled circles + INTEGER(2), PARAMETER :: $MKCOUNT = 10 ! how many total MKs + +! Line types for use in settings structures + INTEGER(2), PARAMETER :: $LTNONE = 0 ! no lines between points + INTEGER(2), PARAMETER :: $LTSOLID = 1 ! draw solid lines between points + INTEGER(2), PARAMETER :: $LTDASH = 2 ! dash + INTEGER(2), PARAMETER :: $LTDASHDOT = 3 ! dash-dot + INTEGER(2), PARAMETER :: $LTDASHDOTDOT = 4 ! dash-dot-dot + INTEGER(2), PARAMETER :: $LTDOT = 5 ! dot + INTEGER(2), PARAMETER :: $LTTHICKSOLID = 6 ! thick solid lines + INTEGER(2), PARAMETER :: $LTTHICKDASH = 7 ! thick dash + INTEGER(2), PARAMETER :: $LTTHICKDASHDOT = 8 ! thick dash-dot + INTEGER(2), PARAMETER :: $LTTHICKDASHDOTDOT= 9 ! thick dash-dot-dot + INTEGER(2), PARAMETER :: $LTTHICKDOT = 10 ! thick dot + INTEGER(2), PARAMETER :: $LTCOUNT = 10 ! how many total LTs + + INTEGER(2), PARAMETER :: $LTDEF = 1000 ! default line type + +! Line "values" + + INTEGER(2), PARAMETER :: $LVNONE = 0 ! no lines between points + INTEGER(2), PARAMETER :: $LVSOLID = #FFFF ! draw solid lines between points + INTEGER(2), PARAMETER :: $LVDASH = #EEEE ! dash + INTEGER(2), PARAMETER :: $LVDASHDOT = #ECEC ! dash-dot + INTEGER(2), PARAMETER :: $LVDASHDOTDOT = #ECCC ! dash-dot-dot + INTEGER(2), PARAMETER :: $LVDOT = #AAAA ! dot + INTEGER(2), PARAMETER :: $LVTHICKSOLID = #FFFF ! thick solid lines + INTEGER(2), PARAMETER :: $LVTHICKDASH = #EEEE ! thick dash + INTEGER(2), PARAMETER :: $LVTHICKDASHDOT = #ECEC ! thick dash-dot + INTEGER(2), PARAMETER :: $LVTHICKDASHDOTDOT= #ECCC! thick dash-dot-dot + INTEGER(2), PARAMETER :: $LVTHICKDOT = #AAAA ! thick dot + + INTEGER(2), PARAMETER :: $LVDEF = $LVSOLID ! default line type + +! Bar types for use in data settings structures. $BV* are in SCIGRAPH.FOR +! function SciDrawBar + INTEGER, PARAMETER :: $BTNONE = 0 ! don't draw bars + INTEGER, PARAMETER :: $BTEMPTY = 1 ! draw outline of bars + INTEGER, PARAMETER :: $BTSOLID = 2 ! draw bars filled in with solid color + INTEGER, PARAMETER :: $BTHASHLEFT = 3 ! left hashing (/ /) + INTEGER, PARAMETER :: $BTHASHRIGHT = 4 ! right hashing (\ \) + INTEGER, PARAMETER :: $BTHEAVYHASHLEFT = 5 ! heavy left hashing (// //) + INTEGER, PARAMETER :: $BTHEAVYHASHRIGHT= 6 ! heavy right hashing (\\ \\) + INTEGER, PARAMETER :: $BTCOUNT = 6 ! how many total BTs + +! Error bar types for use in data settings structures + INTEGER, PARAMETER :: $EBNONE = 0 ! no error bars + INTEGER, PARAMETER :: $EBTHIN = 1 ! thin y error bars + INTEGER, PARAMETER :: $EBTHICK = 2 ! thick y error bars + +! Axis Functions for use in axis settings + INTEGER, PARAMETER :: $AFNONE = 0 ! no transform function: leave data as is + INTEGER, PARAMETER :: $AFLINEAR = 0 ! no transform function: leave data as is + INTEGER, PARAMETER :: $AFLOG10 = 1 ! take log base 10 of each data point + INTEGER, PARAMETER :: $AFLOG = 2 ! take log base e (natural log) + INTEGER, PARAMETER :: $AFLOG2 = 3 ! take log base 2 + INTEGER, PARAMETER :: $AFCOUNT = 3 ! how many total AFs + +! Axis Positions for use in axis setting structure + INTEGER, PARAMETER :: $APNONE = 0 ! don't display an axis + INTEGER, PARAMETER :: $APBOTTOM = 1 ! display axis at bottom + INTEGER, PARAMETER :: $APTOP = 2 ! top + INTEGER, PARAMETER :: $APLEFT = 3 ! left + INTEGER, PARAMETER :: $APRIGHT = 4 ! right + INTEGER, PARAMETER :: $APCOUNT = 4 ! how many total APs + +! Axis Types for use in axis settings structure + INTEGER, PARAMETER :: $ATX = 0 ! x-axis + INTEGER, PARAMETER :: $ATY = 1 ! y-axis + INTEGER, PARAMETER :: $ATR = 2 ! r-axis + INTEGER, PARAMETER :: $ATTHETA = 3 ! theta-axis + INTEGER, PARAMETER :: $ATCOUNT = 4 ! how many total ATs + +! Tick Types for use in axis settings structure + INTEGER, PARAMETER :: $TTNONE = 0 ! no ticks on axis + INTEGER, PARAMETER :: $TTINSIDE = 1 ! ticks "inside" axis + INTEGER, PARAMETER :: $TTOUTSIDE = 2 ! ticks "outside" axis + INTEGER, PARAMETER :: $TTBOTH = 3 ! ticks on both sides of axis + INTEGER, PARAMETER :: $TTCOUNT = 3 ! how many total TTs + +! Grid Style for use in axis settings structure + INTEGER, PARAMETER :: $GSNONE = 0 ! no grid + INTEGER, PARAMETER :: $GSMAJOR = 1 ! grid on major ticks + INTEGER, PARAMETER :: $GSBOTH = 2 ! grid on major and minor ticks + INTEGER, PARAMETER :: $GSZERO = 3 ! grid line on zero + INTEGER, PARAMETER :: $GSZEROMAJOR = 4 ! grid on zero and major ticks + INTEGER, PARAMETER :: $GSZEROBOTH = 5 ! grid on zero and major and minor ticks + INTEGER, PARAMETER :: $GSCOUNT = 5 ! how many total GSs + +! Error codes for return from all SciGraph functions + INTEGER, PARAMETER :: $GEOK = 0 ! no error + INTEGER, PARAMETER :: $GEGRAPHMODE = 1 ! couldn't enter graphics mode + INTEGER, PARAMETER :: $GEFONT = 2 ! couldn't set fonts + INTEGER, PARAMETER :: $GEGRAPH = 3 ! the graph info or type was bad + INTEGER, PARAMETER :: $GEAXIS = 4 ! the axis info, type, or func was bad + INTEGER, PARAMETER :: $GEDATA = 5 ! invalid data or data settings info + INTEGER, PARAMETER :: $GEDIMS = 6 ! one or more of the dimensions was bad + INTEGER, PARAMETER :: $GEPARAMS = 7 ! one or more of the params was bad + INTEGER, PARAMETER :: $GENOPLOTGRAPH = 8 ! didn't do plot graph before plot data + +END MODULE SGDATA + diff --git a/tests/dev-tools/intel-inspector/tests/SGDEMO.F90 b/tests/dev-tools/intel-inspector/tests/SGDEMO.F90 new file mode 100644 index 0000000000..3e17a9b79e --- /dev/null +++ b/tests/dev-tools/intel-inspector/tests/SGDEMO.F90 @@ -0,0 +1,465 @@ +! Copyright (C) 2007 Intel Corporation. All Rights Reserved. +! +! The source code contained or described herein and all documents related to the source code +! ("Material") are owned by Intel Corporation or its suppliers or licensors. Title to the +! Material remains with Intel Corporation or its suppliers and licensors. The Material is +! protected by worldwide copyright laws and treaty provisions. No part of the Material may be +! used, copied, reproduced, modified, published, uploaded, posted, transmitted, distributed, +! or disclosed in any way except as expressly provided in the license provided with the +! Materials. No license under any patent, copyright, trade secret or other intellectual +! property right is granted to or conferred upon you by disclosure or delivery of the +! Materials, either expressly, by implication, inducement, estoppel or otherwise, except as +! expressly provided in the license provided with the Materials. + +!********************************************************************** +! +! SciGraph -- Scientific Graphs for Intel Fortran +! +! + +! +! sgdemo.for - Demo of the SciGraph graphing library +! +! DESCRIPTION +! This program draws an example of each type of +! graph available with SciGraph. +! + +MODULE SciGraphDemo + +USE SCIGRAPH + +CONTAINS + +SUBROUTINE SciGraphDemoStart + + integer i + + open(10,file='user') + call LineDemo + + open(20,file='user') + call BarDemo + + open(30,file='user') + call XYDemo + + open(40,file='user') + call LogDemo + + open(50,file='user') + call PolarDemo + + open(60,file='user') + call XYErrorBarDemo + + open(70,file='user') + call LineErrorBarDemo + +END SUBROUTINE + +! +! LineDemo -- Draws a simple line graph +! + SUBROUTINE LineDemo + + RECORD /GraphSettings/ lineGraph + RECORD /DataSettings/ lineDataSets(4) ! 4 data sets (ranges) + RECORD /AxisSettings/ lineAxes(2) ! 2 axes + + REAL*4 lineData(6,4) ! 4 data sets each with 6 (y) + CHARACTER*20 lineLabels(6) ! the x labels for the line graph + CHARACTER*20 lineDataLegends(4) ! 4 data range legends + + INTEGER retcode + INTEGER setLegends + + DATA lineData / & + 316.5, 317.8, 320.1, 318.3, 314.2, 315.1, & + 324.6, 326.6, 327.8, 326.3, 323.1, 324.0, & + 337.8, 339.9, 341.2, 339.3, 335.7, 336.7, & + 349.9, 351.9, 353.9, 352.1, 348.5, 349.8 / + + DATA lineLabels / 'January','March','May','July','September','November' / + + DATA lineDataLegends / '1960','1970','1980','1988'/ + + + retcode=GetGraphDefaults($GTLINE,lineGraph) + lineGraph.setGraphMode=.FALSE. + lineGraph.title='Atmospheric CO2' + lineGraph.title2='Parts Per Million by Volume' + + retcode=GetLabelMultiDataDefaults(lineGraph,6,lineLabels, & + lineData,4,lineDataSets) + DO setLegends=1,4 + lineDataSets(setLegends).title=lineDataLegends(setLegends) + END DO + + retcode=GetAxisMultiDefaults(lineGraph,4,lineDataSets, & + $ATX,$AFLINEAR,lineAxes(1)) + lineAxes(1).title='Month' + + retcode=GetAxisMultiDefaults(lineGraph,4,lineDataSets, & + $ATY,$AFLINEAR,lineAxes(2)) + lineAxes(2).title='Concentration of CO2' + lineAxes(2).tickType=$TTOUTSIDE + lineAxes(2).numDigits=1 + + retcode=PlotGraph(lineGraph,2,lineAxes,4) + + retcode=PlotLabelMultiData(lineGraph,lineLabels,lineData, & + 4,lineDataSets,lineAxes(1),lineAxes(2)) + END SUBROUTINE + +! +! BarDemo -- Draws a simple Bar Graph +! + SUBROUTINE BarDemo + + RECORD /GraphSettings/ barGraph + RECORD /DataSettings/ barDataSets(6) ! 6 data sets (ranges) + RECORD /AxisSettings/ barAxes(2) ! 2 axes + + REAL*4 barData(6,6) ! 6 data sets each with 6 (y) + CHARACTER*20 barLabels(6) ! the x labels for the bar graph + CHARACTER*20 barDataLegends(6) ! 6 data range legends + + INTEGER retcode + INTEGER setLegends + + DATA barData / & + 6.2, 3.3, 9.8, 23.3, 9.3, 2.0, & + 12.4, 6.4, 18.7, 37.6, 18.4, 3.6, & + 17.9, 9.5, 26.0, 49.8, 26.3, 5.5, & + 22.6, 12.3, 32.3, 60.3, 33.7, 7.3, & + 26.8, 14.8, 38.3, 69.9, 41.0, 8.9, & + 30.6, 17.1, 44.0, 78.7, 48.1, 10.4 / + + DATA barLabels / 'Argon','Krypton','Nitrogen','Neon','Oxygen','Xenon' / + + DATA barDataLegends / '100 K', '200 K', '300 K','400 K','500 K','600 K' / + + retcode=GetGraphDefaults($GTBAR,barGraph) + barGraph.setGraphMode=.FALSE. + barGraph.title='Conductivity of Gases' + barGraph.title2='Conductivity at different Temps' + + retcode=GetLabelMultiDataDefaults(barGraph,6,barLabels, & + barData,6,barDataSets) + DO setLegends=1,6 + barDataSets(setLegends).title=barDataLegends(setLegends) + END DO + barDataSets(6).barType=$BTHASHLEFT + + retcode=GetAxisMultiDefaults(barGraph,6,barDataSets, & + $ATX,$AFLINEAR,barAxes(1)) + barAxes(1).title='Gases' + + retcode=GetAxisMultiDefaults(barGraph,6,barDataSets, & + $ATY,$AFLINEAR,barAxes(2)) + barAxes(2).title='Conductivity in mW/MK' + barAxes(2).gridStyle=$GSBOTH + barAxes(2).gridLineType=$LTDOT + barAxes(2).gridColor=$CILIGHTBLUE + barAxes(2).numDigits=1 + retcode=PlotGraph(barGraph,2,barAxes,6) + + retcode=PlotLabelMultiData(barGraph,barLabels,barData, & + 6,barDataSets,barAxes(1),barAxes(2)) + +END SUBROUTINE + +! +! XYDemo -- Draws a simple XY Graph +! +SUBROUTINE XYDemo + + RECORD /GraphSettings/ xyGraph + RECORD /DataSettings/ xyDataSets(5) ! 5 data sets (ranges) + RECORD /AxisSettings/ xyAxes(4) ! 4 axes: 2 y, 2 x + + REAL*4 xyData(2,7,5) ! 5 data sets each with 7 (x,y) + CHARACTER*20 xyDataLegends(5) ! 5 data range legends + + INTEGER retcode + INTEGER setLegends + + DATA xyData / & + 640,0.52, 660,0.54, 680,0.57, 720,0.59, 740,0.60, 760,0.62, 770,0.63, & + 630,1.03, 640,1.04, 660,1.08, 700,1.14, 730,1.19, 740,1.21, 770, 1.24, & + 650,1.27, 660,1.29, 680,1.33, 700,1.37, 720,1.41, 730,1.43, 760,1.49, & + 640,1.56, 660,1.61, 670,1.64, 690, 1.69, 710,1.74, 730,1.78, 750,1.83, & + 630,2.05, 640,2.08, 670,2.18, 700, 2.28, 730, 2.38, 740,2.41, 760,2.47 / + + DATA xyDataLegends / '5 °C', '10 °C', '12 °C', '15 °C', '20 °C' / + + retcode=GetGraphDefaults($GTXY,xyGraph) + xyGraph.setGraphMode=.FALSE. + xyGraph.title='Corrections for Barometer Readings' + + retcode=GetMultiDataDefaults(xyGraph,7,xyData,5,xyDataSets) + DO setLegends=1,5 + xyDataSets(setLegends).title=xyDataLegends(setLegends) + END DO + + retcode=GetAxisMultiDefaults(xyGraph,5,xyDataSets, & + $ATX,$AFLINEAR,xyAxes(1)) + xyAxes(1).title='Barometric Pressure (mm)' + + retcode=GetAxisMultiDefaults(xyGraph,5,xyDataSets, & + $ATY,$AFLINEAR,xyAxes(2)) + xyAxes(2).title='Correction (mm)' + xyAxes(2).gridStyle=$GSBOTH + xyAxes(2).gridLineType=$LTDOT + xyAxes(2).gridColor=$CILIGHTBLUE + + retcode=GetAxisMultiDefaults(xyGraph,5,xyDataSets, & + $ATX,$AFLINEAR,xyAxes(3)) + xyAxes(3).title='Barometric Pressure (in)' + xyAxes(3).lowVal=xyAxes(3).lowVal/2.54 + xyAxes(3).highVal=xyAxes(3).highVal/2.54 + xyAxes(3).increment=xyAxes(3).increment/2.54 + xyAxes(3).tickColor=$CIWHITE + xyAxes(3).minorTickColor=$CIGRAY + xyAxes(3).titleColor=$CIWHITE + + retcode=GetAxisMultiDefaults(xyGraph,5,xyDataSets, & + $ATY,$AFLINEAR,xyAxes(4)) + xyAxes(4).title='Correction (in)' + xyAxes(4).lowVal=xyAxes(4).lowVal/2.54 + xyAxes(4).highVal=xyAxes(4).highVal/2.54 + xyAxes(4).increment=xyAxes(4).increment/2.54 + xyAxes(4).tickColor=$CIWHITE + xyAxes(4).minorTickColor=$CIGRAY + xyAxes(4).titleColor=$CIWHITE + + + retcode=PlotGraph(xyGraph,4,xyAxes,5) + + retcode=PlotMultiData(xyGraph,xyData,5,xyDataSets,xyAxes(1),xyAxes(2)) + + END SUBROUTINE + +! +! LogDemo -- Draws a logarithmic graph +! + SUBROUTINE LogDemo + + RECORD /GraphSettings/ loggraph + RECORD /DataSettings/ logdsets ! 1 data sets (ranges) + RECORD /AxisSettings/ logaxes(2) ! 2 axes + + REAL*4 logdata(2,7) ! data set with 7 (x,y) + + INTEGER retcode + + DATA logdata / 1.0,20, 1.2,185, 1.3,345, 1.4,672, & + 1.5,1024, 1.9,2919, 1.95,8210 / + + retcode=GetGraphDefaults($GTXY,loggraph) + loggraph.setGraphMode = .FALSE. + loggraph.title='Log Graph' + + retcode=GetDataDefaults(loggraph,7,logdata,logdsets) + logdsets.markerColor=$CILIGHTGREEN + logdsets.lineType=$LTTHICKDOT + logdsets.lineColor=$CIYELLOW + + retcode=GetAxisDefaults(loggraph,logdsets,$ATX,$AFLINEAR,logaxes(1)) + logaxes(1).tickType=$TTOUTSIDE + logaxes(1).gridStyle=$GSMAJOR + logaxes(1).gridLineType=$LTSOLID + logaxes(1).gridColor=$CILIGHTCYAN + + retcode=GetAxisDefaults(loggraph,logdsets,$ATY,$AFLOG10,logaxes(2)) + logaxes(2).titleColor=$CICYAN + logaxes(2).axisColor=$CICYAN + logaxes(2).minorTickColor=$CILIGHTMAGENTA + logaxes(2).tickType=$TTOUTSIDE + logaxes(2).gridStyle=$GSBOTH + logaxes(2).gridLineType=$LTDOT + logaxes(2).gridColor=$CILIGHTBLUE + + retcode=PlotGraph(loggraph,2,logaxes,1) + retcode=PlotData(loggraph,logdata,logdsets, logaxes(1),logaxes(2)) + + END SUBROUTINE + +! +! PolarDemo -- Draws a simple polar plot +! + SUBROUTINE PolarDemo + + RECORD /GraphSettings/ polarGraph + RECORD /DataSettings/ polarDataSets(2) ! 2 data sets (ranges) + RECORD /AxisSettings/ polarAxes(2) ! 2 axes: 2 y, 1 x + + INTEGER nump + PARAMETER (NUMP=200) + + REAL*4 polarData(2,NUMP,2) ! 2 data set each with NUMP (r,th) + CHARACTER*20 polarDataLegends(2) ! 2 data range legends + + INTEGER retcode + INTEGER index + REAL*4 theta + + DATA polarDataLegends / 'r=2Sin(3@)','r=1-2cos(@)'/ + + ! set up data range 1 + DO index=1,nump + theta=$PI*(index-1.0D0)/(nump-1.0D0) + polarData(1,index,1)=2*sin(3*theta) + polarData(2,index,1)=theta + END DO + + ! set up data range 2 + DO index=1,nump + theta=2*$PI*(index-1.0)/(nump-1.0) + polarData(1,index,2)=1-2*cos(theta) + polarData(2,index,2)=theta + END DO + + retcode=GetGraphDefaults($GTPOLAR,polarGraph) + polarGraph.setGraphMode=.FALSE. + polarGraph.title='Polar Graph' + + retcode=GetMultiDataDefaults(polarGraph,nump, & + polarData,2,polarDataSets) + polarDataSets(1).title=polarDataLegends(1) + polarDataSets(1).lineColor=$CIYELLOW + polarDataSets(1).markerType=$MKNONE + + polarDataSets(2).title=polarDataLegends(2) + polarDataSets(2).lineColor=$CILIGHTCYAN + polarDataSets(2).markerType=$MKNONE + + retcode=GetAxisMultiDefaults(polarGraph,2,polarDataSets, & + $ATR,$AFLINEAR,polarAxes(1)) + + retcode=GetAxisMultiDefaults(polarGraph,2,polarDataSets, & + $ATTHETA,$AFLINEAR,polarAxes(2)) + polarAxes(2).gridStyle=$GSBOTH + polarAxes(2).gridLineType=$LTDOT + polarAxes(2).gridColor=$CILIGHTBLUE + + retcode=PlotGraph(polarGraph,2,polarAxes,2) + + retcode=PlotMultiData(polarGraph,polarData, & + 2,polarDataSets,polarAxes(1),polarAxes(2)) + + END SUBROUTINE + +! +! XYErrorBarDemo -- Draws a simple XY graph with error bars +! + SUBROUTINE XYErrorBarDemo + + RECORD /GraphSettings/ simplegraph + RECORD /DataSettings/ simpledsets ! 1 data sets (ranges) + RECORD /AxisSettings/ simpleaxes(2) ! 2 axes + + REAL*4 simpledata(3,7) ! data set with 7 (x,y,e) + + INTEGER retcode + + DATA simpledata / 1.0,2,0.15, 1.2,4,0.2, 1.3,6,0.3, 1.4,7,0, & + 1.5,8,0.4, 1.9,9,0.125, 1.95,10,0.2 / + + retcode=GetGraphDefaults($GTXYWERRBAR,simplegraph) + simplegraph.setGraphMode = .FALSE. + + retcode=GetDataDefaults(simplegraph,7,simpledata,simpledsets) + simpledsets.markerColor=$CIYELLOW + simpledsets.lineType=$LTTHICKDASH + simpledsets.lineColor=$CILIGHTGREEN + + retcode=GetAxisDefaults(simplegraph,simpledsets,$ATX, & + $AFLINEAR,simpleaxes(1)) + simpleaxes(1).axisPos=$APTOP + simpleaxes(1).titleColor=$CIWHITE + simpleaxes(1).axisColor=$CIWHITE + simpleaxes(1).tickColor=$CIBRIGHTWHITE + simpleaxes(1).minorTickColor=$CIGREEN + simpleaxes(1).tickType=$TTOUTSIDE + simpleaxes(1).gridStyle=$GSMAJOR + simpleaxes(1).gridLineType=$LTSOLID + simpleaxes(1).gridColor=$CILIGHTCYAN + + retcode=GetAxisDefaults(simplegraph,simpledsets,$ATY, & + $AFLINEAR,simpleaxes(2)) + simpleaxes(2).titleColor=$CICYAN + simpleaxes(2).axisColor=$CICYAN + simpleaxes(2).tickColor=$CILIGHTCYAN + simpleaxes(2).minorTickColor=$CIMAGENTA + simpleaxes(2).tickType=$TTOUTSIDE + simpleaxes(2).gridStyle=$GSBOTH + simpleaxes(2).gridLineType=$LTDOT + simpleaxes(2).gridColor=$CILIGHTBLUE + + retcode=PlotGraph(simplegraph,2,simpleaxes,1) + retcode=PlotData(simplegraph,simpledata,simpledsets, & + simpleaxes(1),simpleaxes(2)) + + END SUBROUTINE + +! +! LineErrorBarDemo -- Draws a simple line graph with Error Bars +! + SUBROUTINE LineErrorBarDemo + + RECORD /GraphSettings/ lineGraph + RECORD /DataSettings/ lineDataSets(4) ! 4 data sets (ranges) + RECORD /AxisSettings/ lineAxes(2) ! 2 axes + + REAL*4 lineData(6,4, 2) ! 4 data sets each with 6 (y) + CHARACTER*20 lineLabels(6) ! the x labels for the line graph + CHARACTER*20 lineDataLegends(4) ! 4 data range legends + + INTEGER retcode + INTEGER setLegends + + DATA lineData / & + 316.5, 2, 317.8, 1, 320.1, 3, 318.3, 2.4, 314.2, 3, 315.1, 2.2, & + 324.6, 0, 326.6, 9, 327.8, 3, 326.3, 1.2, 323.1, 5, 324.0, 2, & + 337.8, 5, 339.9, 2, 341.2, 2, 339.3, .8, 335.7, 4, 336.7, 3, & + 349.9, 1, 351.9, 4, 353.9, 5, 352.1, 1, 348.5, 2, 349.8, 1.1 / + + DATA lineLabels / 'January','March','May','July','September','November' / + + DATA lineDataLegends / '1960','1970','1980','1988'/ + + retcode=GetGraphDefaults($GTLINEWERRBAR,lineGraph) + lineGraph.setGraphMode=.FALSE. + lineGraph.title='Atmospheric CO2' + lineGraph.title2='Parts Per Million by Volume' + + retcode=GetLabelMultiDataDefaults(lineGraph,6,lineLabels, & + lineData,4,lineDataSets) + DO setLegends=1,4 + lineDataSets(setLegends).title=lineDataLegends(setLegends) + END DO + + retcode=GetAxisMultiDefaults(lineGraph,4,lineDataSets, & + $ATX,$AFLINEAR,lineAxes(1)) + lineAxes(1).title='Month' + + retcode=GetAxisMultiDefaults(lineGraph,4,lineDataSets, & + $ATY,$AFLINEAR,lineAxes(2)) + lineAxes(2).title='Concentration of CO2' + lineAxes(2).tickType=$TTOUTSIDE + lineAxes(2).numDigits=1 + + retcode=PlotGraph(lineGraph,2,lineAxes,4) + + retcode=PlotLabelMultiData(lineGraph,lineLabels,lineData, & + 4,lineDataSets,lineAxes(1),lineAxes(2)) + END SUBROUTINE + +END MODULE + +PROGRAM SGDemo +USE SciGraphDemo +CALL SciGraphDemoStart() +END diff --git a/tests/dev-tools/intel-inspector/tests/SGDRAW.F90 b/tests/dev-tools/intel-inspector/tests/SGDRAW.F90 new file mode 100644 index 0000000000..deff4dacdf --- /dev/null +++ b/tests/dev-tools/intel-inspector/tests/SGDRAW.F90 @@ -0,0 +1,196 @@ +! Copyright (C) 2007 Intel Corporation. All Rights Reserved. +! +! The source code contained or described herein and all documents related to the source code +! ("Material") are owned by Intel Corporation or its suppliers or licensors. Title to the +! Material remains with Intel Corporation or its suppliers and licensors. The Material is +! protected by worldwide copyright laws and treaty provisions. No part of the Material may be +! used, copied, reproduced, modified, published, uploaded, posted, transmitted, distributed, +! or disclosed in any way except as expressly provided in the license provided with the +! Materials. No license under any patent, copyright, trade secret or other intellectual +! property right is granted to or conferred upon you by disclosure or delivery of the +! Materials, either expressly, by implication, inducement, estoppel or otherwise, except as +! expressly provided in the license provided with the Materials. + +!********************************************************************** +! +! SciGraph -- Scientific Graphs for Intel Fortran +! +! + +MODULE SGDRAW + +USE SGLOWLVL +IMPLICIT NONE + +CONTAINS + +! Calculates the offset into a data array of a specified x,y pair based on +! xfirst from the specified data settings. 1=X, 2=Y, 3=E + + INTEGER FUNCTION SciGetDataOffset(dSettings, & + setNum,pointNum,pointWhich) + + RECORD /DataSettings/ dSettings ! input + INTEGER setNum ! input + INTEGER pointNum ! input + INTEGER pointWhich ! input + + INTEGER pw + INTEGER off + + IF (pointNum <= 0 .OR. pointWhich <= 0 & + .OR. pointNum > dSettings.numPoints & + .OR. pointWhich > dSettings.numElements) THEN + SciGetDataOffset=-1 ! error condition + RETURN + END IF + + pw=pointWhich + IF (.NOT. dSettings.xFirst) THEN + pw=dSettings.numElements-pw+1 + END IF + + off=((setNum-1)*dSettings.numPoints+(pointNum-1))* & + dSettings.numElements+pw + + SciGetDataOffset=off + RETURN + END FUNCTION + +! Sets fill style (for bars) + + SUBROUTINE SciSetFillType(fillType) + + INTEGER fillType + +! Bar values for use in data settings structures + INTEGER(1), PARAMETER :: $BVEMPTY(8) = & + (/ #00, #00, #00, #00, #00, #00, #00, #00 /) ! draw outline of bars + INTEGER(1), PARAMETER :: $BVSOLID(8) = & + (/ #FF, #FF, #FF, #FF, #FF, #FF, #FF, #FF /) ! draw solid filled bars + INTEGER(1), PARAMETER :: $BVHASHLEFT(8) = & + (/ #02, #04, #08, #10, #20, #40, #80, #01 /) ! left hashing (/ /) + INTEGER(1), PARAMETER :: $BVHASHRIGHT(8) = & + (/ #40, #20, #10, #08, #04, #02, #01, #80 /) ! right hashing (\ \) + INTEGER(1), PARAMETER :: $BVHEAVYHASHLEFT(8) = & + (/ #28, #50, #A0, #41, #82, #05, #0A, #14 /) ! heavy left hashing (// //) + INTEGER(1), PARAMETER :: $BVHEAVYHASHRIGHT(8) = & + (/ #14, #0A, #05, #82, #41, #A0, #50, #28 /) ! heavy right hashing (\\ \\) + + RETURN + END SUBROUTINE + + + +! Responsible for drawing all bars on bar graphs + SUBROUTINE SciDrawBar(x,y,width,height,barType,barColor) + + REAL(4) x,y,width,height + INTEGER(2) barType,barColor + + INTEGER retv + + IF (barType .NE. $BTSOLID) THEN + CALL SciSetFillType($BTSOLID) + END IF + + CALL SciSetFillType(INT4(barType)) + RETURN + END SUBROUTINE + + +! Responsible for drawing all markers on all graphs + + SUBROUTINE SciDrawMarker(x,y,markerType,markerColor) + + REAL(4) x,y + INTEGER(2) markerType,markerColor + + INTEGER*4 retv + LOGICAL lretv + REAL(8) a,b + + lretv=SciSetLineType($LTSOLID) + CALL SciSetFillType($BTSOLID) + RETURN + END SUBROUTINE + + +! Responsible for drawing all error bars on all graphs + + SUBROUTINE SciDrawErrorBars(x,y,yeLow,yeHigh, & + errorbarType,errorbarColor) + + REAL x,y,yeLow,yeHigh + INTEGER(2) errorbarType,errorbarColor + + INTEGER*4 retv + SELECT CASE (errorbarType) + CASE ($EBTHIN) + CALL SciLine_w($LTSOLID,DBLE(x),DBLE(y),DBLE(x),DBLE(yeHigh)) + CALL SciLine_w($LTSOLID,DBLE(x-80),DBLE(yeHigh),DBLE(x+80),DBLE(yeHigh)) + CALL SciLine_w($LTSOLID,DBLE(x),DBLE(y),DBLE(x),DBLE(yeLow)) + CALL SciLine_w($LTSOLID,DBLE(x-80),DBLE(yeLow),DBLE(x+80),DBLE(yeLow)) + CASE ($EBTHICK) + CALL SciLine_w($LTTHICKSOLID,DBLE(x),DBLE(y),DBLE(x),DBLE(yeHigh)) + CALL SciLine_w($LTTHICKSOLID,DBLE(x-80),DBLE(yeHigh),DBLE(x+80),DBLE(yeHigh)) + CALL SciLine_w($LTTHICKSOLID,DBLE(x),DBLE(y),DBLE(x),DBLE(yeLow)) + CALL SciLine_w($LTTHICKSOLID,DBLE(x-80),DBLE(yeLow),DBLE(x+80),DBLE(yeLow)) + END SELECT + RETURN + END SUBROUTINE + + +! SciDrawLegend draws the text, lines, markers, and shading + + SUBROUTINE SciDrawLegend(xwpr,ywpr,setNum,numSets, & + lineType,lineColor,markerType,markerColor, & + barType,barColor, & + titleColor,title,boxColor) + + REAL xwpr,ywpr + INTEGER setNum,numSets + INTEGER(2) lineType,lineColor,markerType,markerColor + INTEGER(2) barType,barColor,titleColor,boxColor + CHARACTER*20 title + + INTEGER retv + REAL xp,yp,xb,yb,xw,yw + INTEGER numRows,numCols,currRow,currCol + INTEGER exw,eyw + + IF (setNum > numSets .OR. setNum <= 0 .OR. numSets > 8) THEN + RETURN + END IF + + + numRows= INT((numSets-1)/4.0)+1 + numCols= INT((numSets-1)/numRows)+1 + currRow= INT((setNum-1)/numCols)+1 + currCol= MOD(setNum-1_2,numCols)+1 + + exw=2000 + eyw=320 + xw=exw*numCols + yw=eyw*numRows + xb=$GXMIN+($GX-exw*0.5-xw)/2+exw*0.25 + yb=$GYMAX+16*ywpr+eyw*2 + + xp=xb+160+(currCol-1)*exw + yp=yb+(currRow-0.5)*eyw + + IF (barType .EQ. $BTNONE) THEN + CALL SciLine_w(lineType,DBLE(xp), & + DBLE(yp),DBLE(xp+240),DBLE(yp)) + CALL SciDrawMarker(REAL(xp+240.0/2), & + REAL(yp),markerType,markerColor) + xp=xp+272 + ELSE + CALL SciDrawBar(xp,yp-0.25*eyw, & + 160.0,160.0,barType,barColor) + xp=xp+272 + END IF + + END SUBROUTINE + +END MODULE SGDRAW diff --git a/tests/dev-tools/intel-inspector/tests/SGLOWLVL.F90 b/tests/dev-tools/intel-inspector/tests/SGLOWLVL.F90 new file mode 100644 index 0000000000..ec4909a133 --- /dev/null +++ b/tests/dev-tools/intel-inspector/tests/SGLOWLVL.F90 @@ -0,0 +1,349 @@ +! Copyright (C) 2007 Intel Corporation. All Rights Reserved. +! +! The source code contained or described herein and all documents related to the source code +! ("Material") are owned by Intel Corporation or its suppliers or licensors. Title to the +! Material remains with Intel Corporation or its suppliers and licensors. The Material is +! protected by worldwide copyright laws and treaty provisions. No part of the Material may be +! used, copied, reproduced, modified, published, uploaded, posted, transmitted, distributed, +! or disclosed in any way except as expressly provided in the license provided with the +! Materials. No license under any patent, copyright, trade secret or other intellectual +! property right is granted to or conferred upon you by disclosure or delivery of the +! Materials, either expressly, by implication, inducement, estoppel or otherwise, except as +! expressly provided in the license provided with the Materials. + +!********************************************************************** +! +! SciGraph -- Scientific Graphs for Intel Fortran +! +! 6/2001 Replace calls to setgtextvector to calls to setgtextrotation +! 6/2001 Add EOL check in loops removing leading blanks +! + +MODULE SGLOWLVL + +USE SGDATA +IMPLICIT NONE + +CONTAINS + +! This function makes sure we are in the correct graphics mode, and then +! sets all the graphics library settings to values that are good as +! defaults + + LOGICAL FUNCTION SciGraphicsMode(graph) + logical lretval + + RECORD /GraphSettings/ graph + INTEGER retVal + INTEGER solidi + INTEGER*1, PARAMETER :: SOLID(8) = (/ (#FF,solidi=1,8) /) ! solid fill + + RECORD /PrivateGraphSettings/ pgraph ! private graph + RECORD /GraphSettings/ cgraph ! copy of private graph + EQUIVALENCE(cgraph,pgraph) + + cgraph=graph + IF (graph.setGraphMode .AND. pgraph.didPlotGraph .EQ. 0) THEN + lretval = SGSetMaxRes() + IF (.not. lretVal) THEN + SciGraphicsMode=.FALSE. + RETURN + END IF + END IF + + + IF (graph.x1 < 0 .OR. graph.y1 < 0) THEN + SciGraphicsMode=.FALSE. + RETURN + END IF + + SciGraphicsMode=.TRUE. + RETURN + END FUNCTION + +! Does a MOVETO_W, but allows us to not clutter up the code with lots of temp wxycoords + + SUBROUTINE SciMoveto_w(x,y) + REAL*8 x,y + END SUBROUTINE + +! Draws a line from one (x,y) to another. Draws in the specified line type +! from the library. Here so we don't have to keep doing MOVETO_W, LINETO_W +! in the code + + SUBROUTINE SciLine_w(lt,x1,y1,x2,y2) + + INTEGER(2) lt + REAL*8 x1,y1,x2,y2 + + INTEGER retv + LOGICAL thick + REAL*8 dx,dy,adx,ady + + thick=SciSetLineType(lt) + + IF (thick) THEN + dy=(y2-y1)/16 ! number of pixels rise + dx=(x2-x1)/16 ! and run + + IF (abs(dy) > abs(dx)) THEN + adx=SIGN(1.0D0,dy) + ady=0 + ELSE + ady=-SIGN(1.0D0,dx) + adx=0 + END IF + + END IF + + RETURN + END SUBROUTINE + + +! Draws an circle with a given center and radius. Draws with the specified line type +! from the library and should be filled in if desired + + SUBROUTINE SciCircle_w(x,y,r,lt,ft) + + REAL*8 x,y,r + INTEGER(2) lt + INTEGER*2 ft + + LOGICAL thick + REAL*8 x1,y1,x2,y2 + INTEGER retv + + x1=x-r + y1=y-r + x2=x+r + y2=y+r + + thick=SciSetLineType(lt) + + RETURN + END SUBROUTINE + +! Sets the line type to a library specified value and returns whether it is +! thick or not + + LOGICAL FUNCTION SciSetLineType(lt) + + INTEGER(2) lt + + LOGICAL thick + + thick=.FALSE. + + SciSetLineType=thick + RETURN + END FUNCTION + + + +! Sets the font to one of the library defined values + + INTEGER FUNCTION SciSetFont(fontType) + + INTEGER(2) fontType + + INTEGER retv /-1/ + + SciSetFont=retv + RETURN + END FUNCTION + + +! Get font heigth + INTEGER FUNCTION SciGetTextHeight() + + INTEGER retv,th + + th=16 + SciGetTextHeight=th + RETURN + END FUNCTION + + +! Get text length + INTEGER FUNCTION SciGetTextLength(text,rotated,column) + + CHARACTER*(*) text + LOGICAL rotated,column ! if text rotated or in a column + + INTEGER retv,tl + + + IF (.NOT. rotated .AND. .NOT. column) THEN ! normal text + tl=12 + SciGetTextLength=tl + RETURN + END IF + + IF (rotated) THEN + IF (column) THEN + tl=5 + SciGetTextLength=tl + RETURN + ELSE + tl=0 + SciGetTextLength=tl + RETURN + END IF + END IF + END FUNCTION + +! Centers a given string between two x and between two y + + SUBROUTINE SciCenter(xwpr,ywpr,xp1,xp2,yp1,yp2,text) + + REAL*4 xwpr,ywpr + REAL*8 xp1,xp2,yp1,yp2 + CHARACTER*(*) text + + INTEGER nsend,nsstart + + REAL*8 xsp,ysp + INTEGER tl,th + + nsstart=1 ! trash leading blanks + DO WHILE (text(nsstart:nsstart) .EQ. ' ') + nsstart=nsstart+1 + if (nsstart > len(text)) exit + END DO + + nsend=nsstart+len_trim(text(nsstart:))-1 + tl=22 + xsp=xp1+(xp2-xp1-tl*xwpr)/2.0D0 + + th=SciGetTextHeight() + ysp=yp1+(yp2-yp1-th*ywpr)/2.0D0 ! text draw starts from upper left + + END SUBROUTINE + + +! Centers a given string starting or ending at an x and between two y + + SUBROUTINE SciEndCenter(xwpr,ywpr,xp1,xEnd,yp1,yp2,text) + + REAL*4 xwpr,ywpr + REAL*8 xp1,yp1,yp2 + LOGICAL xEnd + CHARACTER*(*) text + + INTEGER nsend,nsstart + + REAL*8 xsp,ysp + INTEGER tl,th + + nsstart=1 ! trash leading blanks + DO WHILE (text(nsstart:nsstart) .EQ. ' ') + nsstart=nsstart+1 + if (nsstart > len(text)) exit + END DO + + nsend=nsstart+len_trim(text(nsstart:))-1 + tl=10 + IF (xEnd) THEN + xsp=xp1-tl*xwpr + ELSE + xsp=xp1 + END IF + + th=SciGetTextHeight() + ysp=yp1+(yp2-yp1-th*ywpr)/2.0D0 ! text draw starts from upper left + + END SUBROUTINE + +! Centers a given line of rotated text at a given x and between two y + + SUBROUTINE SciRotCenter(xwpr,ywpr,xp1,xp2,yp1,yp2,text) + + REAL*4 xwpr,ywpr + REAL*8 xp1,xp2,yp1,yp2 + CHARACTER*(*) text + + INTEGER nsstart,nsend + REAL*8 ysp,xsp + INTEGER tl,th + LOGICAL column + + nsstart=1 ! trash leading blanks + DO WHILE (text(nsstart:nsstart) .EQ. ' ') + nsstart=nsstart+1 + if (nsstart > len(text)) exit + END DO + nsend=nsstart+len_trim(text(nsstart:))-1 + + tl=SciGetTextLength(text(nsstart:nsend),.true.,column) + ysp=yp1+(yp2-yp1+tl*ywpr)/2.0D0 + + th=SciGetTextHeight() + xsp=xp1+(xp2-xp1-th*xwpr)/2.0D0 + + IF (column) THEN + ysp=ysp-tl*ywpr + CALL SciVertText(text(nsstart:nsend)) + END IF + + END SUBROUTINE + +! Centers a given line of rotated text at a given x and between two y + + SUBROUTINE SciRotEndCenter(xwpr,ywpr,xp1,xBottom,yp1,yp2,text) + + REAL*4 xwpr,ywpr + REAL*8 xp1,yp1,yp2 + LOGICAL xBottom + CHARACTER*(*) text + + INTEGER nsstart,nsend + REAL*8 ysp,xsp + INTEGER tl,th + LOGICAL column + + nsstart=1 ! trash leading blanks + DO WHILE (text(nsstart:nsstart) .EQ. ' ') + nsstart=nsstart+1 + if (nsstart > len(text)) exit + END DO + nsend=nsstart+len_trim(text(nsstart:))-1 + + tl=SciGetTextLength(text(nsstart:nsend),.true.,column) + ysp=yp1+(yp2-yp1+tl*ywpr)/2.0D0 + + th=SciGetTextHeight() + IF (xBottom) THEN + xsp=xp1-th*xwpr + ELSE + xsp=xp1 + END IF + + IF (column) THEN + ysp=ysp-tl*ywpr + CALL SciVertText(text(nsstart:nsend)) + END IF + + END SUBROUTINE + + Logical Function SGSetMaxRes + SGSetMaxRes = .true. + end function + +! +! Vertical graphics output of a text string (from the current position) +! + + SUBROUTINE SciVertText (text) + + CHARACTER*(*) text + CHARACTER*1 ch + INTEGER status, loop, ipos, jpos, indent + +! Output one char of the string at a time, in an descending column + do loop = 1, len(text) + ch = text(loop:loop) + end do + + END SUBROUTINE + +END MODULE SGLOWLVL diff --git a/tests/dev-tools/intel-inspector/tests/SGPLOT.F90 b/tests/dev-tools/intel-inspector/tests/SGPLOT.F90 new file mode 100644 index 0000000000..ab54e01744 --- /dev/null +++ b/tests/dev-tools/intel-inspector/tests/SGPLOT.F90 @@ -0,0 +1,1509 @@ +! Copyright (C) 2007 Intel Corporation. All Rights Reserved. +! +! The source code contained or described herein and all documents related to the source code +! ("Material") are owned by Intel Corporation or its suppliers or licensors. Title to the +! Material remains with Intel Corporation or its suppliers and licensors. The Material is +! protected by worldwide copyright laws and treaty provisions. No part of the Material may be +! used, copied, reproduced, modified, published, uploaded, posted, transmitted, distributed, +! or disclosed in any way except as expressly provided in the license provided with the +! Materials. No license under any patent, copyright, trade secret or other intellectual +! property right is granted to or conferred upon you by disclosure or delivery of the +! Materials, either expressly, by implication, inducement, estoppel or otherwise, except as +! expressly provided in the license provided with the Materials. + +!********************************************************************** +! +! SciGraph -- Scientific Graphs for Intel Fortran +! +! 6/2001 - replace calls to setgtextvector to calls to setgtextrotation +! + +MODULE SGPLOT + +USE SGDRAW +IMPLICIT NONE + +CONTAINS + +! PlotGraph begins the graphing process. It draws the graph border, the +! graphing area boundary, the graph title, the axes, the tick marks, +! the grid, and the axis titles. numSettings is the total number of +! data ranges that will be plotted on this graph. + + INTEGER FUNCTION PlotGraph(graph,numAxes,axisArray,numSettings) + + RECORD /GraphSettings/ graph ! input + INTEGER numAxes ! input + RECORD /AxisSettings/ axisArray(numAxes) ! input + INTEGER numSettings ! input + + RECORD /PrivateGraphSettings/ pgraph ! private graph + RECORD /GraphSettings/ cgraph ! copy of private graph + EQUIVALENCE(cgraph,pgraph) + + LOGICAL errBar,polar,xlabels,xy,isLog + INTEGER axesWanted($APCOUNT) + + RECORD /AxisSettings/ ca,ra,ta ! current axis,raxis,theta axis + DOUBLE PRECISION xp,yp,xb,yb,tval,tlen,toff + DOUBLE PRECISION lowVal,highVal,increment + DOUBLE PRECISION logLowVal,loghighVal,logBase,logMul + + INTEGER xd,yd + INTEGER stc,btc,ttc,maxtc,numTicks + INTEGER retv + LOGICAL top,left,smt + CHARACTER*16 tempstr,fms + INTEGER i,drawAxes + REAL*4 xwpr,ywpr + DOUBLE PRECISION xc,yc,xo,yo,r + DOUBLE PRECISION tadd,tang,tanginc,ctang,stang + DOUBLE PRECISION x0,y0,x1,y1,x2,y2,x3,y3 + + cgraph=graph + + IF (numAxes .LT. 1 .OR. numSettings .LT. 1) THEN + PlotGraph=$GEPARAMS + RETURN + END IF + + IF (cgraph.graphType .EQ. $GTLINEWERRBAR .OR. & + cgraph.graphType .EQ. $GTXYWERRBAR) THEN + errBar=.TRUE. + ELSE + errBar=.FALSE. + ENDIF + + IF (cgraph.graphType .EQ. $GTBAR .OR. & + cgraph.graphType .EQ. $GTLINE .OR. & + cgraph.graphType .EQ. $GTLINEWERRBAR) THEN + xlabels=.TRUE. + xy=.FALSE. + ELSE + xlabels=.FALSE. + xy=.TRUE. + ENDIF + + IF (cgraph.graphType .EQ. $GTPOLAR) THEN + polar=.TRUE. + ELSE + polar=.FALSE. + ENDIF + + IF (.NOT. SciGraphicsMode(cgraph)) THEN + PlotGraph=$GEGRAPHMODE + RETURN + ENDIF + + xwpr=$WX/(cgraph.x2-cgraph.x1+1) + ywpr=$WY/(cgraph.y2-cgraph.y1+1) + +! Print graph title + IF (SciSetFont(graph.titleFont) .LE. 0) THEN + PlotGraph=$GEFONT + RETURN + END IF + toff=SciGetTextHeight() ! save text height + + CALL SciCenter(xwpr,ywpr,$WXMIN,$WXMAX, & + $WYMIN+192,$WYMIN+192,graph.title) ! print graph title + + +! Print graph title, line 2 + IF (SciSetFont(graph.title2Font) .LE. 0) THEN + PlotGraph=$GEFONT + RETURN + END IF + + toff=$WYMIN+192+toff*8.0+128 + CALL SciCenter(xwpr,ywpr,$WXMIN,$WXMAX, & + toff,toff,graph.title2) ! print graph second title + + IF (.NOT. polar) THEN ! all this code is for rect. graphs + DO i=1,$APCOUNT ! zero out the axis counts + axesWanted(i)=0 + END DO + + IF (numAxes .GT. 4 .OR. numAxes .LT. 2) THEN ! 1 per side at max + PlotGraph=$GEAXIS + RETURN + END IF + + DO drawAxes = 1,numAxes ! count up the axis position usage, check + ca=AxisArray(drawAxes) + ! only allow valid position/type pairs + IF ( (ca.axisType .EQ. $ATX .AND. & + (ca.axisPos .NE. $APTOP .AND. & + ca.axisPos .NE. $APBOTTOM)) .OR. & + ( (ca.axisType .EQ. $ATY .AND. & + ca.axisPos .NE. $APLEFT .AND. & + ca.axisPos .NE. $APRIGHT)) ) THEN + PlotGraph=$GEAXIS + RETURN + END IF + axesWanted(ca.axisPos)=axesWanted(ca.axisPos)+1 + + IF (ca.highVal .LE. ca.lowVal .OR. & + ca.increment .LE. 0) THEN + PlotGraph=$GEAXIS + RETURN + END IF + + IF (axesWanted(ca.axisPos) .GT. 1) THEN + PlotGraph=$GEAXIS + RETURN + END IF + END DO + + ! draw the axes: only 1 axis per side + DO drawAxes = 1,numAxes + ca=AxisArray(drawAxes) +! retv=SETCOLOR(ca.axisColor) + + SELECT CASE (ca.axisPos) + CASE ($APBOTTOM) + CALL SciLine_w($LTSOLID,$GXMIN,$GYMAX,$GXMAX,$GYMAX) + IF (axesWanted($APTOP) .EQ. 0) THEN + CALL SciLine_w($LTSOLID, & + $GXMIN,$GYMIN,$GXMAX,$GYMIN) + END IF + CASE ($APTOP) + CALL SciLine_w($LTSOLID, & + $GXMIN,$GYMIN,$GXMAX,$GYMIN) + IF (axesWanted($APBOTTOM) .EQ. 0) THEN + CALL SciLine_w($LTSOLID, & + $GXMIN,$GYMAX,$GXMAX,$GYMAX) + END IF + CASE ($APLEFT) + CALL SciLine_w($LTSOLID, & + $GXMIN,$GYMAX,$GXMIN,$GYMIN) + IF (axesWanted($APRIGHT) .EQ. 0) THEN + CALL SciLine_w($LTSOLID, & + $GXMAX,$GYMIN,$GXMAX,$GYMAX) + END IF + CASE ($APRIGHT) + CALL SciLine_w($LTSOLID, & + $GXMAX,$GYMIN,$GXMAX,$GYMAX) + IF (axesWanted($APLEFT) .EQ. 0) THEN + CALL SciLine_w($LTSOLID, & + $GXMIN,$GYMAX,$GXMIN,$GYMIN) + END IF + END SELECT + END DO + + ! now draw the tick marks and grids and the zero line (if any) + DO drawAxes = 1,numAxes + ca=AxisArray(drawAxes) + + lowVal=ca.lowVal + highVal=ca.highVal + increment=ca.increment + + isLog=ca.axisFunc .NE. $AFLINEAR + IF (isLog) THEN ! must check log low/high/inc + IF (lowVal .LE. 0) THEN + PlotGraph=$GEAXIS + RETURN + END IF + + SELECT CASE (ca.axisFunc) + CASE ($AFLOG10) + logBase=10.0 + CASE ($AFLOG) + logBase=EXP(1.0) + CASE ($AFLOG2) + logBase=2.0 + END SELECT + + logMul=1.0D0/DLOG(logBase) + + logLowVal=NINT(DLOG(lowVal)/DLOG(logBase)) + lowVal=logBase**logLowVal + logHighVal=NINT(DLOG(highVal)/DLOG(logBase)) + highVal=logBase**logHighVal + + numTicks=ca.tickRatio + + increment=(lowVal*logBase-lowVal)/numTicks + ELSE + ! axis setup for normal rect. graph + IF (xlabels .AND. (ca.axisType .EQ. $ATX & + .OR. ca.axisType .EQ. $ATR)) THEN + numTicks=1 + ELSE + numTicks=ca.tickRatio + END IF + + increment=increment/numTicks + END IF + + ! draw zero line(s) if requested + IF (ca.gridStyle .EQ. $GSZERO & + .OR. ca.gridStyle .EQ. $GSZEROMAJOR & + .OR. ca.gridStyle .EQ. $GSZEROBOTH) THEN + IF (lowVal .LE. 0) THEN +! retv=SETCOLOR(ca.tickColor) + IF (ca.axisType .EQ. $ATX) THEN + xp=$GXMIN-lowVal/(highVal-lowVal)*$GX + CALL SciLine_w(ca.gridLineType,xp,$GYMIN,xp,$GYMAX) + END IF + + IF (ca.axisType .EQ. $ATY) THEN + yp=$GYMAX+lowVal/(highVal-lowVal)*$GY + CALL SciLine_w(ca.gridLineType, & + $GXMIN,yp,$GXMAX,yp) + END IF + END IF + END IF + + IF (ca.axisType .EQ. $ATX .AND. xlabels) THEN ! label x axis + ! just draw major ticks for each label position + + IF (SciSetFont(ca.axisFont) .LT. 0) THEN + PlotGraph=$GEFONT + RETURN + END IF + + ! set xp and yp based on axisPos + xb=$GXMIN + xd=1.0 + + top=ca.axisPos .EQ. $APTOP ! top or bottom + IF (top) THEN + yb=$GYMIN + yd=1 + ELSE + yb=$GYMAX + yd=-1 + ENDIF + + ttc=0 ! tick count + tval=lowVal ! current tick value + + maxtc=NINT((highVal-lowVal)/increment)-1 + tlen=240.0 + DO WHILE (ttc .LE. maxtc) + xp=xb+(ttc+0.5D0)*increment/(highVal-lowVal)*$GX + + IF (ca.gridStyle .NE. $GSNONE .AND. & + ca.gridStyle .NE. $GSZERO ) THEN + CALL SciLine_w(ca.gridLineType,xp, & + $GYMIN,xp,$GYMAX) + END IF + + SELECT CASE (ca.tickType) + CASE ($TTNONE) + ! Do nothing + CASE ($TTINSIDE) + CALL SciLine_w($LTSOLID,xp,yb+yd*tlen,xp,yb) + yp=yb-yd*(tlen+144) ! since labels still below us + + CASE ($TTOUTSIDE) + CALL SciLine_w($LTSOLID,xp,yb-yd*tlen,xp,yb) + yp=yb-yd*(tlen+144) + CASE ($TTBOTH) + CALL SciLine_w($LTSOLID,xp,yb+yd*tlen,xp,yb-yd*tlen) + yp=yb-yd*(tlen+144) + END SELECT + + ttc=ttc+1 + tval=tval+increment + END DO + + ! Axis label + retv=SciSetFont(ca.titleFont) + + CALL SciCenter(xwpr,ywpr,$GXMIN,$GXMAX, & + yp-yd*288,yp-yd*288,ca.title) + + ELSE IF (ca.axisType .EQ. $ATX) THEN ! numeric x-axis + + IF (SciSetFont(ca.axisFont) .LT. 0) THEN + PlotGraph=$GEFONT + RETURN + END IF + + ! set xp and yp based on axisPos + xb=$GXMIN + xd=1.0 + + top=ca.axisPos .EQ. $APTOP ! top or bottom + IF (top) THEN + yb=$GYMIN + yd=1 + ELSE + yb=$GYMAX + yd=-1 + ENDIF + + stc=0 ! small tick count + btc=0 ! big tick count + ttc=0 ! total tick count + tval=lowVal ! current tick value to draw + + IF (isLog) THEN + maxtc=(logHighVal-logLowVal+1)*numTicks + ELSE + maxtc=NINT((highVal-lowVal)/increment) + ENDIF + + DO WHILE (ttc .LE. maxtc) + IF (stc .EQ. 0) THEN + smt=.FALSE. + ELSE + smt=.TRUE. + END IF + + IF (isLog) THEN + toff=DLOG(tval)*logMul + xp=xb+(toff-logLowVal)/(logHighVal-logLowVal)*$GX + ELSE + xp=xb+(tval-lowVal)/(highVal-lowVal)*$GX + END IF + + IF (smt) THEN + IF (ca.gridStyle .EQ. $GSBOTH .OR. & + ca.gridStyle .EQ. $GSZEROBOTH) THEN + CALL SciLine_w(ca.gridLineType, & + xp,$GYMIN,xp,$GYMAX) + END IF + ELSE + IF (ttc .NE. 0 .AND. ttc .NE. maxtc) THEN + IF (ca.gridStyle .NE. $GSNONE .AND. & + ca.gridStyle .NE. $GSZERO ) THEN + CALL SciLine_w(ca.gridLineType,xp, & + $GYMIN,xp,$GYMAX) + END IF + END IF + END IF + + IF (smt) THEN + tlen=80.0 + ELSE + tlen=240.0 + END IF + + ! Now convert the current val to a string to print it + WRITE(fms,'(A5, I2, A1)') '(F10.',ca.numDigits,')' + WRITE(tempStr,fms) tval + + SELECT CASE (ca.tickType) + CASE ($TTNONE) + ! Do nothing + CASE ($TTINSIDE) + CALL SciLine_w($LTSOLID,xp,yb+yd*tlen,xp,yb) + yp=yb-yd*144 + + CASE ($TTOUTSIDE) + CALL SciLine_w($LTSOLID,xp,yb-yd*tlen,xp,yb) + yp=yb-yd*(tlen+144) + CASE ($TTBOTH) + CALL SciLine_w($LTSOLID,xp,yb+yd*tlen,xp,yb-yd*tlen) + yp=yb-yd*(tlen+144) + END SELECT + + IF (.NOT. smt) THEN ! write numbers on axis + CALL SciCenter(xwpr,ywpr,xp,xp,yp,yp,tempStr) + END IF + + ttc=ttc+1 + stc=stc+1 + IF (stc .EQ. numTicks) THEN + stc=0 + btc=btc+1 + IF (isLog) THEN ! reset incr + tval=logBase**(btc+logLowVal) + increment=(tval*logBase-tval)/numTicks + ELSE + tval=tval+increment + END IF + ELSE + tval=tval+increment + END IF + END DO + + ! Axis label + retv=SciSetFont(ca.titleFont) + + CALL SciCenter(xwpr,ywpr,$GXMIN,$GXMAX, & + yp-yd*288,yp-yd*288,ca.title) + + ELSE ! numeric y-axis + + IF (SciSetFont(ca.axisFont) .LT. 0) THEN + PlotGraph=$GEFONT + RETURN + END IF + + ! set xp and yp based on axisPos + yb=$GYMAX + yd=1 + + left=ca.axisPos .EQ. $APLEFT ! left or right + IF (left) THEN + xb=$GXMIN + xd=1 + ELSE + xb=$GXMAX + xd=-1 + ENDIF + + stc=0 ! small tick count + btc=0 ! big tick count + ttc=0 ! total tick count + tval=lowVal ! current tick value to draw + + IF (isLog) THEN + maxtc=(logHighVal-logLowVal)*numTicks + ELSE + maxtc=NINT((highVal-lowVal)/increment) + ENDIF + + DO WHILE (ttc .LE. maxtc) + IF (stc .EQ. 0) THEN + smt=.FALSE. + ELSE + smt=.TRUE. + END IF + + IF (isLog) THEN + toff=DLOG(tval)*logMul + yp=yb-(toff-logLowVal)/(logHighVal-logLowVal)*$GY + ELSE + yp=yb-(tval-lowVal)/(highVal-lowVal)*$GY + END IF + + IF (smt) THEN + IF (ca.gridStyle .EQ. $GSBOTH .OR. & + ca.gridStyle .EQ. $GSZEROBOTH) THEN + CALL SciLine_w(ca.gridLineType, & + $GXMIN,yp,$GXMAX,yp) + END IF + ELSE + IF (ttc .NE. 0 .AND. ttc .NE. maxtc) THEN + IF (ca.gridStyle .NE. $GSNONE .AND. & + ca.gridStyle .NE. $GSZERO ) THEN + CALL SciLine_w(ca.gridLineType, & + $GXMIN,yp,$GXMAX,yp) + END IF + END IF + END IF + + IF (smt) THEN + tlen=80.0 + ELSE + tlen=240.0 + END IF + + ! Now convert the current val to a string to print it + WRITE(fms,'(A5, I2, A1)') '(F10.',ca.numDigits,')' + WRITE(tempStr,fms) tval + + SELECT CASE (ca.tickType) + CASE ($TTNONE) + ! Do nothing + CASE ($TTINSIDE) + CALL SciLine_w($LTSOLID,xb,yp,xb+xd*tlen,yp) + xp=xb-xd*64 + CASE ($TTOUTSIDE) + CALL SciLine_w($LTSOLID,xb,yp,xb-xd*tlen,yp) + xp=xb-xd*(tlen+64) + CASE ($TTBOTH) + CALL SciLine_w($LTSOLID,xb-xd*tlen,yp,xb+xd*tlen,yp) + xp=xb-xd*(tlen+64) + END SELECT + + IF (.NOT. smt) THEN ! write numbers on axis + IF (ca.AxisFontRotated) THEN + CALL SciRotEndCenter(xwpr,ywpr, & + xp,left,yp,yp,tempStr) + ELSE + CALL SciEndCenter(xwpr,ywpr,xp, & + left,yp,yp,tempStr) + END IF + END IF + + ttc=ttc+1 + stc=stc+1 + IF (stc .EQ. numTicks) THEN + stc=0 + btc=btc+1 + IF (isLog) THEN ! reset incr + tval=logBase**(btc+logLowVal) + increment=(tval*logBase-tval)/numTicks + ELSE + tval=tval+increment + END IF + ELSE + tval=tval+increment + END IF + END DO + + ! Axis label + retv=SciSetFont(ca.titleFont) + + IF (ca.AxisFontRotated) THEN + CALL SciRotCenter(xwpr,ywpr,xp-xd*352, & + xp-xd*352,$GYMIN,$GYMAX,ca.title) + ELSE + CALL SciRotCenter(xwpr,ywpr,xp-xd*704, & + xp-xd*704,$GYMIN,$GYMAX,ca.title) + END IF + END IF + END DO + + ELSE +! Draw polar graph + + IF (numAxes .NE. 2) THEN ! only allow 2 axes exactly + PlotGraph=$GEAXIS + RETURN + END IF + + IF (.NOT. ( ( AxisArray(1).axisType .EQ. $ATTHETA .AND. & + AxisArray(2).axisType .EQ. $ATR ) .OR. & + ( AxisArray(1).axisType .EQ. $ATR .AND. & + AxisArray(2).axisType .EQ. $ATTHETA ) ) ) THEN + PlotGraph=$GEAXIS ! two of the same or some invalid + RETURN + END IF + + + IF (AxisArray(1).axisType .EQ. $ATR) THEN + ra=AxisArray(1) + ta=AxisArray(2) + ELSE + ra=AxisArray(2) + ta=AxisArray(1) + END IF + + IF (ta.gridStyle .EQ. $GSZERO .OR. & + ta.gridStyle .EQ. $GSZEROBOTH .OR. & + ra.gridStyle .EQ. $GSZERO .OR. & + ra.gridStyle .EQ. $GSZEROBOTH) THEN + PlotGraph=$GEAXIS ! don't allow zero lines on polar + RETURN + END IF + + xc=$GXC + yc=$GYC + r=$PGR + + CALL SciLine_w($LTSOLID,xc-r,yc,xc+r,yc) + CALL SciLine_w($LTSOLID,xc,yc-r,xc,yc+r) + +! First draw the R-axes + ca=ra + ! draw x part of r-axes + ! r axis ignores axispos and axiscw, does not support log + + lowVal=ca.lowVal + highVal=ca.highVal + numTicks=ca.tickRatio + increment=ca.increment/numTicks + + IF (SciSetFont(ca.axisFont) .LT. 0) THEN + PlotGraph=$GEFONT + RETURN + END IF + + ! set xp and yp based on axisPos + xb=$GXC + xd=1.0 + + yb=$GYC + + top=ca.axisPos .EQ. $APTOP ! top or bottom + IF (top) THEN + yd=1 + ELSE + yd=-1 + ENDIF + + stc=0 ! small tick count + btc=0 ! big tick count + ttc=0 ! total tick count + tval=lowVal ! current tick value to draw + + maxtc=NINT((highVal-lowVal)/increment) + + DO WHILE (ttc .LE. maxtc) + IF (stc .EQ. 0) THEN + smt=.FALSE. + ELSE + smt=.TRUE. + END IF + + xo=(tval-lowVal)/(highVal-lowVal)*r + + IF (smt) THEN + tlen=80.0 + ELSE + tlen=240.0 + END IF + + ! Now convert the current val to a string to print it + WRITE(fms,'(A5, I2, A1)') '(F10.',ca.numDigits,')' + WRITE(tempStr,fms) tval + + SELECT CASE (ca.tickType) + CASE ($TTNONE) + ! Do nothing + CASE ($TTINSIDE) + CALL SciLine_w($LTSOLID,xb+xo,yb+yd*tlen,xb+xo,yb) + CALL SciLine_w($LTSOLID,xb-xo,yb+yd*tlen,xb-xo,yb) + yp=yb-yd*144 + + CASE ($TTOUTSIDE) + CALL SciLine_w($LTSOLID,xb+xo,yb-yd*tlen,xb+xo,yb) + CALL SciLine_w($LTSOLID,xb-xo,yb-yd*tlen,xb-xo,yb) + yp=yb-yd*(tlen+144) + CASE ($TTBOTH) + CALL SciLine_w($LTSOLID,xb+xo,yb+yd*tlen,xb+xo,yb-yd*tlen) + CALL SciLine_w($LTSOLID,xb-xo,yb+yd*tlen,xb-xo,yb-yd*tlen) + yp=yb-yd*(tlen+144) + END SELECT + + IF (.NOT. smt) THEN ! write numbers on axis + CALL SciCenter(xwpr,ywpr,xb+xo,xb+xo,yp,yp,tempStr) + END IF + + ttc=ttc+1 + stc=stc+1 + IF (stc .EQ. numTicks) THEN + stc=0 + btc=btc+1 + tval=tval+increment + ELSE + tval=tval+increment + END IF + END DO + + ! Axis label + retv=SciSetFont(ca.titleFont) + + CALL SciCenter(xwpr,ywpr,$GXC,$GXC+r,yp-yd*288,yp-yd*288,ca.title) + + ! draw y part of r-axis + + IF (SciSetFont(ca.axisFont) .LT. 0) THEN + PlotGraph=$GEFONT + RETURN + END IF + + ! set xp and yp based on axisPos + xb=$GXC + + left=ca.axisPos .EQ. $APTOP ! left or right + IF (left) THEN + xd=1 + ELSE + xd=-1 + ENDIF + + yb=$GYC + yd=1 + + stc=0 ! small tick count + btc=0 ! big tick count + ttc=0 ! total tick count + tval=lowVal ! current tick value to draw + + maxtc=NINT((highVal-lowVal)/increment) + + DO WHILE (ttc .LE. maxtc) + IF (stc .EQ. 0) THEN + smt=.FALSE. + ELSE + smt=.TRUE. + END IF + + yo=(tval-lowVal)/(highVal-lowVal)*r + + IF (smt) THEN + tlen=80.0 + ELSE + tlen=240.0 + END IF + + + SELECT CASE (ca.tickType) + CASE ($TTNONE) + ! Do nothing + CASE ($TTINSIDE) + CALL SciLine_w($LTSOLID,xb,yb+yo,xb+xd*tlen,yb+yo) + CALL SciLine_w($LTSOLID,xb,yb-yo,xb+xd*tlen,yb-yo) + xp=xb-xd*64 + CASE ($TTOUTSIDE) + CALL SciLine_w($LTSOLID,xb,yb+yo,xb-xd*tlen,yb+yo) + CALL SciLine_w($LTSOLID,xb,yb-yo,xb-xd*tlen,yb-yo) + xp=xb-xd*(tlen+64) + CASE ($TTBOTH) + CALL SciLine_w($LTSOLID,xb-xd*tlen,yb+yo,xb+xd*tlen,yb+yo) + CALL SciLine_w($LTSOLID,xb-xd*tlen,yb-yo,xb+xd*tlen,yb-yo) + xp=xb-xd*(tlen+64) + END SELECT + + ttc=ttc+1 + stc=stc+1 + IF (stc .EQ. numTicks) THEN + stc=0 + btc=btc+1 + tval=tval+increment + ELSE + tval=tval+increment + END IF + END DO + + +! Now draw the theta axis + ca=ta + + IF (SciSetFont(ca.axisFont) .LT. 0) THEN + PlotGraph=$GEFONT + RETURN + END IF + + + lowVal=ca.lowVal + highVal=ca.highVal + numTicks=ca.tickRatio + increment=ca.increment/numTicks + + IF (SciSetFont(ca.axisFont) .LT. 0) THEN + PlotGraph=$GEFONT + RETURN + END IF + + ! set xp and yp based on axisPos + xb=$GXC + xd=1.0 + + yb=$GYC + yd=1 + + ! set tadd based on axisPos + SELECT CASE (ca.axisPos) + CASE ($APRIGHT) + tadd=0.0 + CASE ($APTOP) + tadd=$PI/2.0 + CASE ($APLEFT) + tadd=$PI + CASE ($APBOTTOM) + tadd=3.0*$PI/2.0 + END SELECT + + stc=0 ! small tick count + btc=0 ! big tick count + ttc=0 ! total tick count + tval=lowVal ! current tick value to draw + tanginc=2.0D0*$PI/( (DBLE(highVal)-DBLE(lowVal))/DBLE(increment) ) + + IF (.NOT. ca.axisCW) THEN ! go the other way around the circle + tanginc=-tanginc + tadd=-tadd + END IF + tang=tadd + + maxtc=NINT((highVal-lowVal)/increment) + + DO WHILE (ttc .LT. maxtc) + IF (stc .EQ. 0) THEN + smt=.FALSE. + ELSE + smt=.TRUE. + END IF + + IF (smt) THEN + tlen=80.0 + ELSE + tlen=240.0 + END IF + + ctang=DCOS(tang) + stang=DSIN(tang) + + IF (DABS(ctang) .LT. $EPREAL8) THEN ! near miss should be 0 + ctang=0.0D0 + END IF + IF (DABS(stang) .LT. $EPREAL8) THEN ! near miss should be 0 + stang=0.0D0 + END IF + + IF (1-DABS(ctang) .LT. $EPREAL8) THEN ! near miss should be 1 + ctang=SIGN(1.0D0,ctang) + END IF + IF (1-DABS(stang) .LT. $EPREAL8) THEN ! near miss should be 1 + stang=SIGN(1.0D0,stang) + END IF + + x0=xc+(r-tlen)*ctang + y0=yc+(r-tlen)*stang + + x1=xc+(r)*ctang + y1=yc+(r)*stang + + x2=xc+(r+tlen)*ctang + y2=yc+(r+tlen)*stang + + x3=xc+(r+2.0*tlen)*ctang + y3=yc+(r+2.0*tlen)*stang + + IF (smt) THEN + IF (ca.gridStyle .EQ. $GSBOTH .OR. & + ca.gridStyle .EQ. $GSZEROBOTH) THEN + CALL SciLine_w(ca.gridLineType,xc,yc,x1,y1) + END IF + ELSE + IF (ttc .NE. maxtc) THEN + IF (ca.gridStyle .NE. $GSNONE .AND. & + ca.gridStyle .NE. $GSZERO ) THEN + CALL SciLine_w(ca.gridLineType,xc,yc,x1,y1) + END IF + END IF + END IF + + + ! Now convert the current val to a string to print it + WRITE(fms,'(A5, I2, A1)') '(F10.',ca.numDigits,')' + WRITE(tempStr,fms) tval + + SELECT CASE (ca.tickType) + CASE ($TTNONE) + ! Do nothing + CASE ($TTINSIDE) + CALL SciLine_w($LTSOLID,x0,y0,x1,y1) + xp=x2 + yp=y2 + CASE ($TTOUTSIDE) + CALL SciLine_w($LTSOLID,x1,y1,x2,y2) + xp=x3 + yp=y3 + CASE ($TTBOTH) + CALL SciLine_w($LTSOLID,x0,y0,x2,y2) + xp=x3 + yp=y3 + END SELECT + + IF (.NOT. smt) THEN ! write numbers on axis + CALL SciCenter(xwpr,ywpr,xp,xp,yp,yp,tempStr) + END IF + + ttc=ttc+1 + stc=stc+1 + tang=tang+tanginc + IF (stc .EQ. numTicks) THEN + stc=0 + btc=btc+1 + tang=tadd+DBLE(ttc)*tanginc + tval=tval+increment + ELSE + tval=tval+increment + END IF + END DO + + + END IF + + pgraph.didPlotGraph=pgraph.didPlotGraph+1 + pgraph.numSets=pgraph.numSets+numSettings + + graph=cgraph + PlotGraph=$GEOK + RETURN + END FUNCTION + + +! Plots a numeric data set. Must happen after PlotGraph + + INTEGER FUNCTION PlotData(graph,data,dSettings, axis1,axis2) + + RECORD /GraphSettings/ graph ! input + REAL*4 data(1) ! input: actual data + RECORD /DataSettings/ dSettings ! input + RECORD /AxisSettings/ axis1 ! input + RECORD /AxisSettings/ axis2 ! input + + PlotData = PlotMultiData(graph,data,1,(/dSettings/),axis1,axis2) + END FUNCTION + +! Plots multiple numeric data sets. Must happen after PlotGraph + + INTEGER FUNCTION PlotMultiData(graph,data, & + numSettings, & + dSettingsArray, & + axis1,axis2) + + RECORD /GraphSettings/ graph ! input + REAL*4 data(1) ! input: actual data + INTEGER numSettings ! input + RECORD /DataSettings/ dSettingsArray(numSettings) ! input + RECORD /AxisSettings/ axis1 ! input + RECORD /AxisSettings/ axis2 ! input + + + RECORD /PrivateGraphSettings/ pgraph ! private graph + RECORD /GraphSettings/ cgraph ! copy of private graph + EQUIVALENCE(cgraph,pgraph) + + DOUBLE PRECISION x1,x2,y1,y2,ngxw,ngyw,xwidth,ywidth + DOUBLE PRECISION xLogBase,xLogMul,yLogBase,yLogMul + DOUBLE PRECISION xPolarMul,yPolarMul + DOUBLE PRECISION xLogLowVal,xLogHighVal,yLogLowVal,yLogHighVal + DOUBLE PRECISION r,th,tadd + INTEGER retv + RECORD /AxisSettings/ xa,ya + INTEGER plotSets,checkSets,plotPoints,drawLegends + LOGICAL first,errBars,polar + REAL*4 xdata,ydata,ulydata,edata,edataLow,edataHigh + REAL*4 lxdata,lydata + REAL*4 xwm,ywm + REAL*4 xwpr,ywpr + + cgraph=graph + xa=axis1 + ya=axis2 + + IF (pgraph.didPlotGraph .LE. 0) THEN + PlotMultiData=$GENOPLOTGRAPH + RETURN + END IF + + + IF (SciSetFont(graph.titleFont) .LE. 0) THEN + PlotMultiData=$GEFONT + RETURN + END IF + + DO checkSets = 1,numSettings + IF (dSettingsArray(checkSets).numElements .LT. 2 .OR. & + dSettingsArray(checkSets).numElements .GT. 3 .OR. & + dSettingsArray(checkSets).numPoints .LT. 1) THEN + PlotMultiData=$GEDIMS + RETURN + END IF + END DO + + + IF (xa.axisFunc .NE. $AFLINEAR) THEN + SELECT CASE (xa.axisFunc) + CASE ($AFLOG10) + xLogBase=10.0 + CASE ($AFLOG) + xLogBase=EXP(1.0) + CASE ($AFLOG2) + xLogBase=2.0 + END SELECT + xLogMul=1.0D0/DLOG(xLogBase) + END IF + + IF (ya.axisFunc .NE. $AFLINEAR) THEN + SELECT CASE (ya.axisFunc) + CASE ($AFLOG10) + yLogBase=10.0 + CASE ($AFLOG) + ylogBase=EXP(1.0) + CASE ($AFLOG2) + ylogBase=2.0 + END SELECT + yLogMul=1.0D0/DLOG(ylogBase) + END IF + + IF (cgraph.graphType .EQ. $GTPOLAR) THEN + polar=.TRUE. + ELSE + polar=.FALSE. + ENDIF + + IF (xa.axisFunc .NE. $AFLINEAR) THEN + xLogLowVal=NINT(DLOG(xa.lowVal)*xLogMul) + xLogHighVal=NINT(DLOG(xa.highVal)*xLogMul) + + xwidth=(xLogHighVal-xLogLowVal)*$WX/$GX ! how wide in graphing units + ngxw=xwidth-(xLogHighVal-xLogLowVal) + x1=xLogLowVal-ngxw*($WXMAX-$GXMAX)/($WX-$GX) + x2=xLogHighVal+ngxw*($GXMIN-$WXMIN)/($WX-$GX) + ELSE + xwidth=(xa.highVal-xa.lowVal)*$WX/$GX ! how wide in graphing units + ngxw=xwidth-(xa.highVal-xa.lowVal) + x1=xa.lowVal-ngxw*($WXMAX-$GXMAX)/($WX-$GX) + x2=xa.highVal+ngxw*($GXMIN-$WXMIN)/($WX-$GX) + END IF + + IF (ya.axisFunc .NE. $AFLINEAR) THEN + yLogLowVal=NINT(DLOG(ya.lowVal)*yLogMul) + yLogHighVal=NINT(DLOG(ya.highVal)*yLogMul) + + ywidth=(yLogHighVal-yLogLowVal)*$WY/$GY ! how wide screen in graph units + ngyw=ywidth-(yLogHighVal-yLogLowVal) ! how much not in graphing region + y1=yLogLowVal-ngyw*($WYMAX-$GYMAX)/($WY-$GY) + y2=yLogHighVal+ngyw*($GYMIN-$WYMIN)/($WY-$GY) + ELSE + ywidth=(ya.highVal-ya.lowVal)*$WY/$GY ! how wide screen in graph units + ngyw=ywidth-(ya.highVal-ya.lowVal) ! how much not in graphing region + y1=ya.lowVal-ngyw*($WYMAX-$GYMAX)/($WY-$GY) + y2=ya.highVal+ngyw*($GYMIN-$WYMIN)/($WY-$GY) + END IF + + IF (polar) THEN + xPolarMul=$PGR/(xa.highVal-xa.lowVal) + yPolarMul=2.0*$PI/(ya.highVal-ya.lowVal) + END IF + + xwm=$WX/(x2-x1) + ywm=$WY/(y2-y1) + + xwpr=$WX/(cgraph.x2-cgraph.x1+1) + ywpr=$WY/(cgraph.y2-cgraph.y1+1) + + ! set tadd based on axisPos + SELECT CASE (ya.axisPos) + CASE ($APRIGHT) + tadd=0.0 + CASE ($APTOP) + tadd=$PI/2.0 + CASE ($APLEFT) + tadd=$PI + CASE ($APBOTTOM) + tadd=3.0*$PI/2.0 + END SELECT + + IF (.NOT. ya.axisCW) THEN ! go the other way around the circle + yPolarMul=-yPolarMul + tadd=-tadd + END IF + + ! draw lines first + DO plotSets = 1,numSettings + + first=.TRUE. + + IF (dSettingsArray(plotSets).lineType .NE. $LTNONE) THEN + + DO plotPoints=1,dSettingsArray(plotSets).numPoints + xdata=data(SciGetDataOffset(dSettingsArray(plotSets), & + plotSets,plotPoints,1) ) + ydata=data(SciGetDataOffset(dSettingsArray(plotSets), & + plotSets,plotPoints,2) ) + IF (xa.axisFunc .NE. $AFLINEAR) THEN + xdata=LOG(xdata)*xLogMul + END IF + IF (ya.axisFunc .NE. $AFLINEAR) THEN + ydata=LOG(ydata)*yLogMul + END IF + + IF (polar) THEN + r=xdata*xPolarMul + th=ydata*yPolarMul +tadd + xdata=$GXC+r*COS(th) + ydata=$GYC+r*SIN(th) + ELSE + xdata=$WXMIN+(xdata-x1)*xwm + ydata=$WYMAX-(ydata-y1)*ywm + END IF + + IF (.NOT. first) THEN + CALL SciLine_w(dSettingsArray(plotSets).lineType, & + DBLE(lxdata),DBLE(lydata), & + DBLE(xdata),DBLE(ydata)) + ELSE + first=.FALSE. + END IF + + lxdata=xdata ! store current point for next time through + lydata=ydata + END DO + END IF + END DO + + ! draw point markers with error bars if desired + DO plotSets = 1,numSettings + errBars= cgraph.graphType .EQ. $GTXYWERRBAR & + .OR. cgraph.graphType .EQ. $GTLINEWERRBAR + + IF (dSettingsArray(plotSets).markerType .EQ. $MKNONE) THEN + CYCLE ! no need to do the rest of this + END IF + + DO plotPoints=1,dSettingsArray(plotSets).numPoints + xdata=data(SciGetDataOffset(dSettingsArray(plotSets), & + plotSets,plotPoints,1)) + ydata=data(SciGetDataOffset(dSettingsArray(plotSets), & + plotSets,plotPoints,2)) + + IF (xa.axisFunc .NE. $AFLINEAR) THEN + xdata=LOG(xdata)*xLogMul + END IF + IF (ya.axisFunc .NE. $AFLINEAR) THEN + ulydata=ydata + ydata=LOG(ydata)*yLogMul + END IF + + IF (errBars) THEN + edata=data(SciGetDataOffset( & + dSettingsArray(plotSets), & + plotSets,plotPoints,3)) + IF (ya.axisFunc .NE. $AFLINEAR) THEN + edataLow=LOG(ulydata-edata)*yLogMul + edataHigh=LOG(ulydata+edata)*yLogMul + ELSE + edataLow=ydata-edata + edataHigh=ydata+edata + END IF + + xdata=$WXMIN+(xdata-x1)*xwm + ydata=$WYMAX-(ydata-y1)*ywm + edataLow=$WYMAX-(edataLow-y1)*ywm + edataHigh=$WYMAX-(edataHigh-y1)*ywm + + CALL SciDrawErrorBars(xdata,ydata, & + edataLow,edataHigh, & + dSettingsArray(plotSets).errorbarType, & + dSettingsArray(plotSets).errorbarColor) + ELSE + IF (polar) THEN + r=xdata*xPolarMul + th=ydata*yPolarMul+tadd + xdata=$GXC+r*COS(th) + ydata=$GYC+r*SIN(th) + ELSE + xdata=$WXMIN+(xdata-x1)*xwm + ydata=$WYMAX-(ydata-y1)*ywm + END IF + END IF + + CALL SciDrawMarker(xdata,ydata, & + dSettingsArray(plotSets).markerType, & + dSettingsArray(plotSets).markerColor) + + END DO + END DO + + + DO drawLegends= 1,numSettings + pgraph.numSetsDone=pgraph.numSetsDone+1 + + IF (pgraph.numSetsDone .GT. pgraph.numSets) THEN + PlotMultiData=$GEGRAPH + RETURN + END IF + + IF (SciSetFont(dSettingsArray(drawLegends).titleFont).LE. 0) THEN + PlotMultiData=$GEFONT + RETURN + END IF + + CALL SciDrawLegend(xwpr,ywpr, & + pgraph.numSetsDone,pgraph.numSets, & + dSettingsArray(drawLegends).lineType, & + dSettingsArray(drawLegends).lineColor, & + dSettingsArray(drawLegends).markerType, & + dSettingsArray(drawLegends).markerColor, & + dSettingsArray(drawLegends).barType, & + dSettingsArray(drawLegends).barColor, & + dSettingsArray(drawLegends).titleColor, & + dSettingsArray(drawLegends).title, & + graph.graphColor) + END DO + + graph=cgraph + PlotMultiData=$GEOK + RETURN + END FUNCTION + + +! Plots a single label/numeric data sets. Must happen after PlotGraph + + INTEGER FUNCTION PlotLabelData(graph,labels,data,dSettings,axis1,axis2) + + RECORD /GraphSettings/ graph ! input + CHARACTER*(*) labels(1) ! input + REAL*4 data(1) ! input: actual data + RECORD /DataSettings/ dSettings ! input + RECORD /AxisSettings/ axis1 ! input + RECORD /AxisSettings/ axis2 ! input + + PlotLabelData=PlotLabelMultiData(graph,labels,data, & + 1,(/dSettings/),axis1,axis2) + RETURN + END FUNCTION + + +! Plots multiple label/numeric data sets. Must happen after PlotGraph + + INTEGER FUNCTION PlotLabelMultiData(graph,labels,data, & + numSettings,dSettingsArray, & + axis1,axis2) + + RECORD /GraphSettings/ graph ! input + INTEGER numSettings ! input + RECORD /DataSettings/ dSettingsArray(numSettings) ! input + CHARACTER*(*) labels(1) ! input + REAL*4 data(1) ! input: actual data + RECORD /AxisSettings/ axis1 ! input + RECORD /AxisSettings/ axis2 ! input + + RECORD /PrivateGraphSettings/ pgraph ! private graph + RECORD /GraphSettings/ cgraph ! copy of private graph + EQUIVALENCE(cgraph,pgraph) + + DOUBLE PRECISION x1,x2,y1,y2,ngxw,ngyw,xwidth,ywidth + DOUBLE PRECISION yLogBase,yLogMul + DOUBLE PRECISION yLogLowVal,yLogHighVal + INTEGER retv + RECORD /AxisSettings/ xa,ya + INTEGER checkSet,plotGroup,plotSets,yd + INTEGER drawLegends + LOGICAL bar,first,errBars + REAL*4 ydata,ulydata,edata,edataLow,edataHigh,lxdata,lydata + REAL*4 barWidth,tickSpacing,xb,xp,yb + REAL*4 xwm,ywm + REAL*4 xwpr,ywpr + + cgraph=graph + xa=axis1 + ya=axis2 + + IF (numSettings .LT. 1) THEN + PlotLabelMultiData=$GEPARAMS + RETURN + END IF + + IF (pgraph.didPlotGraph .LE. 0) THEN + PlotLabelMultiData=$GENOPLOTGRAPH + RETURN + END IF + + + IF (SciSetFont(graph.titleFont) .LE. 0) THEN + PlotLabelMultiData=$GEFONT + RETURN + END IF + + DO checkSet = 1,numSettings ! check the bounds settings + IF (dSettingsArray(checkSet).numElements .LT. 1 .OR. & + dSettingsArray(checkSet) .numElements .GT. 3 .OR. & + dSettingsArray(checkSet) .numPoints .LT. 1) THEN + PlotLabelMultiData=$GEDIMS + RETURN + END IF + END DO + + IF (xa.axisFunc .NE. $AFLINEAR) THEN + PlotLabelMultiData=$GEAXIS + RETURN + END IF + + IF (ya.axisFunc .NE. $AFLINEAR) THEN + SELECT CASE (ya.axisFunc) + CASE ($AFLOG10) + yLogBase=10.0 + CASE ($AFLOG) + ylogBase=EXP(1.0) + CASE ($AFLOG2) + ylogBase=2.0 + END SELECT + yLogMul=1.0D0/DLOG(ylogBase) + END IF + + IF (xa.lowVal .NE. 0 .OR. xa.increment .NE. 1 .OR. & + xa.highVal .NE. dSettingsArray(1).numPoints) THEN + PlotLabelMultiData=$GEAXIS + RETURN + END IF + + xwidth=(xa.highVal-xa.lowVal)*$WX/$GX ! how wide in graphing units + ngxw=xwidth-(xa.highVal-xa.lowVal) + x1=xa.lowVal-ngxw*($WXMAX-$GXMAX)/($WX-$GX) + x2=xa.highVal+ngxw*($GXMIN-$WXMIN)/($WX-$GX) + + IF (ya.axisFunc .NE. $AFLINEAR) THEN + yLogLowVal=NINT(DLOG(ya.lowVal)*yLogMul) + yLogHighVal=NINT(DLOG(ya.highVal)*yLogMul) + + ywidth=(yLogHighVal-yLogLowVal)*$WY/$GY ! how wide screen in graph units + ngyw=ywidth-(yLogHighVal-yLogLowVal) ! how much not in graphing region + y1=yLogLowVal-ngyw*($WYMAX-$GYMAX)/($WY-$GY) + y2=yLogHighVal+ngyw*($GYMIN-$WYMIN)/($WY-$GY) + ELSE + ywidth=(ya.highVal-ya.lowVal)*$WY/$GY ! how wide screen in graph units + ngyw=ywidth-(ya.highVal-ya.lowVal) ! how much not in graphing region + y1=ya.lowVal-ngyw*($WYMAX-$GYMAX)/($WY-$GY) + y2=ya.highVal+ngyw*($GYMIN-$WYMIN)/($WY-$GY) + END IF + + xwm=$WX/(x2-x1) + ywm=$WY/(y2-y1) + + xwpr=$WX/(cgraph.x2-cgraph.x1+1) + ywpr=$WY/(cgraph.y2-cgraph.y1+1) + + bar=cgraph.graphType .EQ. $GTBAR + + IF (bar) THEN ! bars can only be in bar graphs + barWidth=1.0D0/(numSettings+0.5D0) ! leave room for spacing + + IF (ya.lowVal .LT. 0.0D0) THEN + yb=REAL($WYMAX-(0.0-y1)*ywm) + ELSE + yb=$GYMAX + END IF + + ! Draw the bars + DO plotGroup = 1,dSettingsArray(1).numPoints + xb=(plotGroup-1)+barWidth*0.25D0 + DO plotSets = 1,numSettings + xp=xb+(plotSets-1)*barWidth + ydata=data(SciGetDataOffset( & + dSettingsArray(plotSets), & + plotSets,plotGroup,1)) + IF (ya.axisFunc .NE. $AFLINEAR) THEN + ydata=LOG(ydata)*yLogMul + END IF + + xp=$WXMIN+(xp-x1)*xwm + ydata=$WYMAX-(ydata-y1)*ywm-yb + + CALL SciDrawBar(xp,yb, & + barWidth*xwm-16,ydata, & + dSettingsArray(plotSets).barType, & + dSettingsArray(plotSets).barColor) + END DO + END DO + END IF ! bars + + IF (.NOT. bar) THEN ! lines, markers, error bars only on a line graph + tickSpacing=1.0D0 + + ! Draw the lines + DO plotSets = 1,numSettings + first=.TRUE. + DO plotGroup = 1,dSettingsArray(plotSets).numPoints + xb=(plotGroup-1)+tickSpacing*0.50D0 + ydata=data(SciGetDataOffset( & + dSettingsArray(plotSets), & + plotSets,plotGroup,1)) + IF (ya.axisFunc .NE. $AFLINEAR) THEN + ydata=LOG(ydata)*yLogMul + END IF + + xb=$WXMIN+(xb-x1)*xwm + ydata=$WYMAX-(ydata-y1)*ywm + + IF (.NOT. first) THEN + CALL SciLine_w( & + dSettingsArray(plotSets).lineType, & + DBLE(lxdata),DBLE(lydata), & + DBLE(xb),DBLE(ydata)) + ELSE + first=.FALSE. + END IF + lxdata=xb ! store current point for next time through + lydata=ydata + END DO + END DO + + errBars= cgraph.graphType .EQ. $GTLINEWERRBAR + + ! Draw the markers and error bars + DO plotSets = 1,numSettings + DO plotGroup = 1,dSettingsArray(plotSets).numPoints + xb=(plotGroup-1)+tickSpacing*0.50D0 + ydata=data(SciGetDataOffset( & + dSettingsArray(plotSets), & + plotSets,plotGroup,1)) + IF (ya.axisFunc .NE. $AFLINEAR) THEN + ulydata=ydata + ydata=LOG(ydata)*yLogMul + END IF + + IF (errBars) THEN + edata=data(SciGetDataOffset( & + dSettingsArray(plotSets), & + plotSets,plotGroup,2)) + IF (ya.axisFunc .NE. $AFLINEAR) THEN + edataLow=LOG(ulydata-edata)*yLogMul + edataHigh=LOG(ulydata+edata)*yLogMul + ELSE + edataLow=ydata-edata + edataHigh=ydata+edata + END IF + + xb=$WXMIN+(xb-x1)*xwm + ydata=$WYMAX-(ydata-y1)*ywm + edataLow=$WYMAX-(edataLow-y1)*ywm + edataHigh=$WYMAX-(edataHigh-y1)*ywm + + CALL SciDrawErrorBars(xb,ydata, & + edataLow,edataHigh, & + dSettingsArray(plotSets).errorbarType, & + dSettingsArray(plotSets).errorbarColor) + ELSE + xb=$WXMIN+(xb-x1)*xwm + ydata=$WYMAX-(ydata-y1)*ywm + END IF + + CALL SciDrawMarker(xb,ydata, & + dSettingsArray(plotSets).markerType, & + dSettingsArray(plotSets).markerColor) + END DO + END DO + END IF + + ! Put up labels + tickSpacing=1.0D0 + IF (SciSetFont(xa.axisFont) .LE. 0) THEN + PlotLabelMultiData=$GEFONT + RETURN + END IF + + IF (xa.axisPos .EQ. $APTOP) THEN + yb=$GYMIN + yd=-1 + ELSE + yb=$GYMAX + yd=1 + END IF + + DO plotGroup = 1,dSettingsArray(1).numPoints + xb=(plotGroup-1)+tickSpacing*0.50D0 + xb=$WXMIN+(xb-x1)*xwm + CALL SciCenter(xwpr,ywpr,DBLE(xb),DBLE(xb), & + DBLE(yb+yd*342),DBLE(yb+yd*342), & + labels(plotGroup)) ! print range labels + END DO + + + DO drawLegends= 1,numSettings + pgraph.numSetsDone=pgraph.numSetsDone+1 + + IF (pgraph.numSetsDone .GT. pgraph.numSets) THEN + PlotLabelMultiData=$GEGRAPH + RETURN + END IF + + IF (SciSetFont(dSettingsArray(drawLegends).titleFont).LE. 0) THEN + PlotLabelMultiData=$GEFONT + RETURN + END IF + + CALL SciDrawLegend(xwpr,ywpr, & + pgraph.numSetsDone,pgraph.numSets, & + dSettingsArray(drawLegends).lineType, & + dSettingsArray(drawLegends).lineColor, & + dSettingsArray(drawLegends).markerType, & + dSettingsArray(drawLegends).markerColor, & + dSettingsArray(drawLegends).barType, & + dSettingsArray(drawLegends).barColor, & + dSettingsArray(drawLegends).titleColor, & + dSettingsArray(drawLegends).title, & + graph.graphColor) + END DO + + graph=cgraph + PlotLabelMultiData=$GEOK + RETURN + END FUNCTION + +END MODULE SGPLOT diff --git a/tests/dev-tools/intel-inspector/tests/TEST_ENV b/tests/dev-tools/intel-inspector/tests/TEST_ENV new file mode 100644 index 0000000000..54e089cb17 --- /dev/null +++ b/tests/dev-tools/intel-inspector/tests/TEST_ENV @@ -0,0 +1,5 @@ +if [ -s ../../../TEST_ENV ];then + source ../../../TEST_ENV +fi + +CMD_TIMEOUT="5:00" diff --git a/tests/dev-tools/intel-inspector/tests/common b/tests/dev-tools/intel-inspector/tests/common new file mode 120000 index 0000000000..55b975444d --- /dev/null +++ b/tests/dev-tools/intel-inspector/tests/common @@ -0,0 +1 @@ +../../../common/ \ No newline at end of file diff --git a/tests/dev-tools/intel-inspector/tests/test_module b/tests/dev-tools/intel-inspector/tests/test_module new file mode 100755 index 0000000000..e399b8a362 --- /dev/null +++ b/tests/dev-tools/intel-inspector/tests/test_module @@ -0,0 +1,162 @@ +#!./common/bats/bin/bats +# -*-sh-*- + +source ./common/test_helper_functions.bash || exit 1 +source ./common/functions || exit 1 + +if [ -s ./TEST_ENV ];then + source ./TEST_ENV +fi + +PKG=INSPECTOR +testname="Intel Inspector" +module=inspector +header= +library=libmemchkr +rpm=intel-inspector${DELIM} + +setup() { + module purge + module load ohpc + module load $module +} + + +@test "[$testname] Verify $module module is loaded and matches rpm version" { + module list $module | grep "1) $module" >& .cmd_output || exit 1 + run grep $module .cmd_output + assert_success + + # check version against rpm + local version="$(rpm -q --queryformat='%{VERSION}\n' $rpm)" + run cat .cmd_output + assert_output " 1) $module/$version" +} + +@test "[$testname] Verify module ${PKG}_DIR is defined and exists" { + DIR=${PKG}_DIR + if [ -z ${!DIR} ];then + flunk "${PKG}_DIR directory not defined" + fi + + if [ ! -d ${!DIR} || -z "${!DIR}" ];then + flunk "directory ${!DIR} does not exist" + fi +} + +# ---------- +# Binaries +# ---------- + +@test "[$testname] Verify module ${PKG}_BIN is defined and exists" { + BIN=${PKG}_BIN + if [ -z ${!BIN} ];then + flunk "${PKG}_BIN directory not defined" + fi + + if [ ! -d ${!BIN} || -z "${!BIN}" ];then + flunk "directory ${!BIN} does not exist" + fi +} + +@test "[$testname] Verify availability/execution of inspxe-cl binary" { + run which inspxe-cl + assert_success + + run inspxe-cl --version + assert_success +} + +@test "[$testname] Verify availability of inspxe-gui binary" { + run which inspxe-gui + assert_success +} + +# ---------- +# Man pages +# ---------- + +@test "[$testname] Verify availability of man page for inspxe-cl" { + DIR=${PKG}_DIR + + if [ -z ${!DIR} ];then + flunk "${PKG}_DIR directory not defined" + fi + + if [ ! -d ${!DIR} || -z "${!DIR}" ];then + flunk "directory ${!DIR} does not exist" + fi + + run man -w inspxe-cl + assert_success + assert_output "${!DIR}/man/man1/inspxe-cl.1" +} + +# ---------- +# Lib Tests +# ---------- + +@test "[$testname] Verify module ${PKG}_LIB is defined and exists" { + LIB=${PKG}_LIB + + if [ -z ${!LIB} ];then + flunk "${PKG}_LIB directory not defined" + fi + + if [ ! -d ${!LIB} ];then + flunk "directory ${!LIB} does not exist" + fi +} + +@test "[$testname] Verify dynamic library available in ${PKG}_LIB" { + LIB=${PKG}_LIB + + if [ -z ${!LIB} ];then + flunk "${PKG}_LIB directory not defined" + fi + + if [ ! -s ${!LIB}/${library}.so ];then + flunk "${library}.so does not exist" + fi +} + +# ---------- +# Tracing +# ---------- + +exe=./fortrandemo +rdir=./result +rtxt=./survey.txt + +@test "[$testname] Sample test application" { + + rm -rf $rdir $rtxt + + if [ ! -x $exe ];then + flunk "$exe executable not available" + fi + + run mkdir $rdir + assert_success + + # launch data collection + run run_serial_binary -t $CMD_TIMEOUT inspxe-cl -collect mi3 -result-dir $rdir $exe + assert_success + + # verify tracing file + run ls $rdir/data.0 + assert_success + + # generate report + run run_serial_binary -t $CMD_TIMEOUT inspxe-cl -report=summary -r=$rdir -report-output=$rtxt + assert_success + + # verify report file + run ls $rtxt + assert_success + + rm -rf $rdir $rtxt user + +} + +rm -f .cmd_output diff --git a/tests/dev-tools/numpy/Makefile.am b/tests/dev-tools/numpy/Makefile.am new file mode 100644 index 0000000000..39cbee2e65 --- /dev/null +++ b/tests/dev-tools/numpy/Makefile.am @@ -0,0 +1,3 @@ +AUTOMAKE_OPTIONS = foreign +AM_MAKEFLAGS = --no-print-directory +SUBDIRS = tests diff --git a/tests/dev-tools/numpy/ohpc-tests/test_numpy b/tests/dev-tools/numpy/ohpc-tests/test_numpy new file mode 100755 index 0000000000..12435d7004 --- /dev/null +++ b/tests/dev-tools/numpy/ohpc-tests/test_numpy @@ -0,0 +1,32 @@ +#!/bin/bash +# -*-sh-*- + +TEST_LOGS="" +MAKEFLAGS="" + +source ./TEST_ENV || exit 1 +source ./common/functions || exit 1 + +cd dev-tools/numpy || exit 1 +export BATS_JUNIT_CLASS=Numpy + +for compiler in $COMPILER_FAMILIES ; do + + echo " " + echo " " + echo "----------------------------------------------------------" + echo "Dev tools: Numpy tests: $compiler" + echo "----------------------------------------------------------" + + module purge || exit 1 + module load $compiler || exit 1 + module load numpy || exit 1 + + make clean >& /dev/null || exit 1 + make -k check || exit 1 + + save_logs_compiler_family tests $compiler + + make clean >& /dev/null + +done diff --git a/tests/dev-tools/numpy/tests/MM b/tests/dev-tools/numpy/tests/MM new file mode 100755 index 0000000000..7de521e83c --- /dev/null +++ b/tests/dev-tools/numpy/tests/MM @@ -0,0 +1,15 @@ +#!../../../common/bats/bin/bats +# -*-sh-*- + +load ../../../common/test_helper_functions +source ../../../common/functions || exit 1 + +if [ -s ../../../TEST_ENV ];then + source ../../../TEST_ENV +fi + +module load numpy + +@test "[dev-tools/numpy] Numpy Matrix Multiply" { + run python MM.py +} diff --git a/tests/dev-tools/numpy/tests/MM.py b/tests/dev-tools/numpy/tests/MM.py new file mode 100755 index 0000000000..c3f48c75c9 --- /dev/null +++ b/tests/dev-tools/numpy/tests/MM.py @@ -0,0 +1,32 @@ +import numpy as np +import time +N = 6000 +M = 10000 + +#k_list = [64, 80, 96, 104, 112, 120, 128, 144, 160, 176, 192, 200, 208, 224, 240, 256, 384] +k_list = [64] + +def get_gflops(M, N, K): + return M*N*(2.0*K-1.0) / 1000**3 + +for K in k_list: + a = np.array(np.random.random((M, N)), dtype=np.double, order='C', copy=False) + b = np.array(np.random.random((N, K)), dtype=np.double, order='C', copy=False) + A = np.matrix(a, dtype=np.double, copy=False) + B = np.matrix(b, dtype=np.double, copy=False) + + C = A*B + + start = time.time() + + C = A*B + C = A*B + C = A*B + C = A*B + C = A*B + + end = time.time() + + tm = (end-start) / 5.0 + + print ('{0:4}, {1:9.7}, {2:9.7}'.format(K, tm, get_gflops(M, N, K) / tm)) diff --git a/tests/dev-tools/numpy/tests/Makefile.am b/tests/dev-tools/numpy/tests/Makefile.am new file mode 100644 index 0000000000..a6911c42f8 --- /dev/null +++ b/tests/dev-tools/numpy/tests/Makefile.am @@ -0,0 +1,7 @@ +TESTS_ENVIRONMENT = BATS_NO_SUMMARY=1 + +TESTS = init.sh + +TESTS += test_module +TESTS += MM + diff --git a/tests/dev-tools/numpy/tests/init.sh b/tests/dev-tools/numpy/tests/init.sh new file mode 100755 index 0000000000..2ee682a4ff --- /dev/null +++ b/tests/dev-tools/numpy/tests/init.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +echo " " +echo " " +echo "-------------------------------------------------------" +echo "Numpy Python Module Tests" +echo "-------------------------------------------------------" diff --git a/tests/dev-tools/numpy/tests/test_module b/tests/dev-tools/numpy/tests/test_module new file mode 100755 index 0000000000..49eae11a5e --- /dev/null +++ b/tests/dev-tools/numpy/tests/test_module @@ -0,0 +1,61 @@ +#!../../../common/bats/bin/bats +# -*-sh-*- + +source ../../../common/test_helper_functions.bash || exit 1 + +if [ -s ../../../TEST_ENV ];then + source ../../../TEST_ENV +fi + +PKG=NUMPY +module=numpy +testname=Numpy +rpm=python-numpy-$LMOD_FAMILY_COMPILER${DELIM} + + +@test "[$testname] Verify $PKG module is loaded and matches rpm version ($LMOD_FAMILY_COMPILER)" { + module list $module | grep "1) $module" >& .cmd_output || exit 1 + run grep $module .cmd_output + assert_success + + # check version against rpm + local version="$(rpm -q --queryformat='%{VERSION}\n' $rpm)" + run cat .cmd_output + assert_output " 1) $module/$version" + + rm -f .cmd_output +} + +@test "[$testname] Verify module ${PKG}_DIR is defined and exists ($LMOD_FAMILY_COMPILER)" { + DIR=${PKG}_DIR + if [ -z ${!DIR} ];then + flunk "${PKG}_DIR directory not defined" + fi + + if [ ! -d ${!DIR} || -z "${!DIR}" ];then + flunk "directory ${!DIR} does not exist" + fi +} + +@test "[$testname] Verify module ${PKG}_BIN is defined and exists" { + BIN=${PKG}_BIN + if [ -z ${!BIN} ];then + flunk "${PKG}_BIN directory not defined" + fi + + if [ ! -d ${!BIN} || -z "${!BIN}" ];then + flunk "directory ${!BIN} does not exist" + fi +} + + +# -------------- +# Python Path +# -------------- + +@test "[$testname] Verify PYTHONPATH is defined and exists ($LMOD_FAMILY_COMPILER)" { + + if [ -z ${PYTHONPATH} ];then + flunk "PYTHONPATH directory not defined" + fi +} diff --git a/tests/dev-tools/scipy/Makefile.am b/tests/dev-tools/scipy/Makefile.am new file mode 100644 index 0000000000..39cbee2e65 --- /dev/null +++ b/tests/dev-tools/scipy/Makefile.am @@ -0,0 +1,3 @@ +AUTOMAKE_OPTIONS = foreign +AM_MAKEFLAGS = --no-print-directory +SUBDIRS = tests diff --git a/tests/dev-tools/scipy/ohpc-tests/test_scipy b/tests/dev-tools/scipy/ohpc-tests/test_scipy new file mode 100755 index 0000000000..d22aa2fcbb --- /dev/null +++ b/tests/dev-tools/scipy/ohpc-tests/test_scipy @@ -0,0 +1,36 @@ +#!/bin/bash +# -*-sh-*- + +TEST_LOGS="" +MAKEFLAGS="" + +source ./TEST_ENV || exit 1 +source ./common/functions || exit 1 + +cd dev-tools/scipy || exit 1 +export BATS_JUNIT_CLASS=SciPy + +for compiler in gnu ; do + for mpi in $MPI_FAMILIES ; do + + echo " " + echo " " + echo "-------------------------------------------------------" + echo "Dev Toolsk: scipy tests: $compiler-$mpi" + echo "-------------------------------------------------------" + + module purge || exit 1 + module load prun || exit 1 + module load $compiler || exit 1 + module load $mpi || exit 1 + module load scipy || exit 1 + + make clean || exit 1 + make -k check + + save_logs_mpi_family tests $compiler $mpi + + make clean + done +done + diff --git a/tests/dev-tools/scipy/tests/Makefile.am b/tests/dev-tools/scipy/tests/Makefile.am new file mode 100644 index 0000000000..eca6a4ea3e --- /dev/null +++ b/tests/dev-tools/scipy/tests/Makefile.am @@ -0,0 +1,7 @@ +TESTS_ENVIRONMENT = BATS_NO_SUMMARY=1 + +TESTS = init.sh + +TESTS += test_module +TESTS += springs + diff --git a/tests/dev-tools/scipy/tests/init.sh b/tests/dev-tools/scipy/tests/init.sh new file mode 100755 index 0000000000..70bae1c6a2 --- /dev/null +++ b/tests/dev-tools/scipy/tests/init.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +echo " " +echo " " +echo "-------------------------------------------------------" +echo "Scipy Python Module Tests" +echo "-------------------------------------------------------" diff --git a/tests/dev-tools/scipy/tests/springs b/tests/dev-tools/scipy/tests/springs new file mode 100755 index 0000000000..f8c3bdfa00 --- /dev/null +++ b/tests/dev-tools/scipy/tests/springs @@ -0,0 +1,17 @@ +#!../../../common/bats/bin/bats +# -*-sh-*- + +load ../../../common/test_helper_functions +source ../../../common/functions || exit 1 + +if [ -s ../../../TEST_ENV ];then + source ../../../TEST_ENV +fi + +module load numpy +module load scipy + +@test "[dev-tools/scipy] Coupled Spring-Mass System ($rm/$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + run python springs.py + [[ "${lines[249]}" =~ "10.0" ]] +} diff --git a/tests/dev-tools/scipy/tests/springs.py b/tests/dev-tools/scipy/tests/springs.py new file mode 100644 index 0000000000..244d33547f --- /dev/null +++ b/tests/dev-tools/scipy/tests/springs.py @@ -0,0 +1,66 @@ +from scipy.integrate import odeint + +def vectorfield(w, t, p): + """ + Defines the differential equations for the coupled spring-mass system. + + Arguments: + w : vector of the state variables: + w = [x1,y1,x2,y2] + t : time + p : vector of the parameters: + p = [m1,m2,k1,k2,L1,L2,b1,b2] + """ + x1, y1, x2, y2 = w + m1, m2, k1, k2, L1, L2, b1, b2 = p + + # Create f = (x1',y1',x2',y2'): + f = [y1, + (-b1 * y1 - k1 * (x1 - L1) + k2 * (x2 - x1 - L2)) / m1, + y2, + (-b2 * y2 - k2 * (x2 - x1 - L2)) / m2] + return f + +# Parameter values +# Masses: +m1 = 1.0 +m2 = 1.5 +# Spring constants +k1 = 8.0 +k2 = 40.0 +# Natural lengths +L1 = 0.5 +L2 = 1.0 +# Friction coefficients +b1 = 0.8 +b2 = 0.5 + +# Initial conditions +# x1 and x2 are the initial displacements; y1 and y2 are the initial velocities +x1 = 0.5 +y1 = 0.0 +x2 = 2.25 +y2 = 0.0 + +# ODE solver parameters +abserr = 1.0e-8 +relerr = 1.0e-6 +stoptime = 10.0 +numpoints = 250 + +# Create the time samples for the output of the ODE solver. +# I use a large number of points, only because I want to make +# a plot of the solution that looks nice. +t = [stoptime * float(i) / (numpoints - 1) for i in range(numpoints)] + +# Pack up the parameters and initial conditions: +p = [m1, m2, k1, k2, L1, L2, b1, b2] +w0 = [x1, y1, x2, y2] + +# Call the ODE solver. +wsol = odeint(vectorfield, w0, t, args=(p,), + atol=abserr, rtol=relerr) + +# Print the solution. +for t1, w1 in zip(t, wsol): + print t1, w1[0], w1[1], w1[2], w1[3] diff --git a/tests/dev-tools/scipy/tests/test_module b/tests/dev-tools/scipy/tests/test_module new file mode 100755 index 0000000000..69a06affc4 --- /dev/null +++ b/tests/dev-tools/scipy/tests/test_module @@ -0,0 +1,49 @@ +#!../../../common/bats/bin/bats +# -*-sh-*- + +source ../../../common/test_helper_functions.bash || exit 1 + +if [ -s ../../../TEST_ENV ];then + source ../../../TEST_ENV +fi + +PKG=SCIPY +module=scipy +testname=Scipy +rpm=python-scipy-$LMOD_FAMILY_COMPILER-$LMOD_FAMILY_MPI${DELIM} + + +@test "[$testname] Verify $PKG module is loaded and matches rpm version ($LMOD_FAMILY_COMPILER)" { + module list $module | grep "1) $module" >& .cmd_output || exit 1 + run grep $module .cmd_output + assert_success + + # check version against rpm + local version="$(rpm -q --queryformat='%{VERSION}\n' $rpm)" + run cat .cmd_output + assert_output " 1) $module/$version" + + rm -f .cmd_output +} + +@test "[$testname] Verify module ${PKG}_DIR is defined and exists ($LMOD_FAMILY_COMPILER)" { + DIR=${PKG}_DIR + if [ -z ${!DIR} ];then + flunk "${PKG}_DIR directory not defined" + fi + + if [ ! -d ${!DIR} || -z "${!DIR}" ];then + flunk "directory ${!DIR} does not exist" + fi +} + + +# -------------- +# Python Path +# -------------- + +@test "[$testname] Verify PYTHONPATH is defined and exists ($LMOD_FAMILY_COMPILER)" { + if [ -z ${PYTHONPATH} ];then + flunk "PYTHONPATH directory not defined" + fi +} diff --git a/tests/dev-tools/tbb/.gitignore b/tests/dev-tools/tbb/.gitignore new file mode 100644 index 0000000000..2a262c7755 --- /dev/null +++ b/tests/dev-tools/tbb/.gitignore @@ -0,0 +1,5 @@ +compile +test-driver +*.tap +test*.log +test*.trs diff --git a/tests/dev-tools/tbb/Makefile.am b/tests/dev-tools/tbb/Makefile.am new file mode 100644 index 0000000000..39cbee2e65 --- /dev/null +++ b/tests/dev-tools/tbb/Makefile.am @@ -0,0 +1,3 @@ +AUTOMAKE_OPTIONS = foreign +AM_MAKEFLAGS = --no-print-directory +SUBDIRS = tests diff --git a/tests/dev-tools/tbb/bootstrap b/tests/dev-tools/tbb/bootstrap new file mode 100755 index 0000000000..f1f5d3e333 --- /dev/null +++ b/tests/dev-tools/tbb/bootstrap @@ -0,0 +1,9 @@ +#! /bin/sh +# -------------------------------------------------------------------------- +# bootstrapping utility for autotools -> now just uses autoreconf +# -------------------------------------------------------------------------- + +cmd="autoreconf -f -i" +echo "Bootstrapping using $cmd ..." + +$cmd diff --git a/tests/dev-tools/tbb/configure.ac b/tests/dev-tools/tbb/configure.ac new file mode 100644 index 0000000000..f4fdcf7fc2 --- /dev/null +++ b/tests/dev-tools/tbb/configure.ac @@ -0,0 +1,50 @@ +# -*- Autoconf -*- +# Process this file with autoconf to produce a configure script. +# + +AC_PREREQ(2.59) +AC_INIT([tbb], [2.0], [karl.w.schulz@intel.com]) +AC_CONFIG_MACRO_DIR([m4]) +AM_INIT_AUTOMAKE([foreign]) +m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) + +# verify we have necessary environment variables set + +CHECK_ENV([TBBROOT],[tbb]) +CHECK_ENV([TBB_INC],[tbb]) +CHECK_ENV([TBB_LIB],[tbb]) + +OHPC_COMPILER_FAMILY + +# Define include path and library linkage from environment variables +# which should be provided via module loads. + +CFLAGS="-I${TBB_INC} ${CFLAGS}" +CXXFLAGS="-I${TBB_INC} ${CXXFLAGS}" +LDFLAGS="-L${TBB_LIB} ${LDFLAGS}" +LIBS="-ltbb ${LIBS}" + +# test compilers +AC_PROG_CC +AC_PROG_CXX + +# Set subdirectories +AC_CONFIG_FILES(Makefile tests/Makefile tests/test_all/Makefile) + +# Configure +AC_OUTPUT() + +echo +echo '-------------------------------------------------- SUMMARY --------------------------------------------------' +echo +echo Package version............... : $PACKAGE-$VERSION +echo OHPC compiler toolchain........ : $LMOD_FAMILY_COMPILER +echo +echo C compiler.................... : `which $CC` +echo C++ compiler.................. : `which $CXX` +echo +echo C compiler flags.............. : $CFLAGS +echo C++ compiler flags............ : $CXXFLAGS +echo Linker flags.................. : $LDFLAGS $LIBS +echo +echo '-------------------------------------------------------------------------------------------------------------' diff --git a/tests/dev-tools/tbb/m4/check_env.m4 b/tests/dev-tools/tbb/m4/check_env.m4 new file mode 100644 index 0000000000..632bb4173f --- /dev/null +++ b/tests/dev-tools/tbb/m4/check_env.m4 @@ -0,0 +1,30 @@ +# SYNOPSIS +# +# Test if a desired environment variable is set for a particular module. +# +# CHECK_ENV([VARIABLE,[module]) +# +# DESCRIPTION +# +# Queries configuration environment to detect compiler toolchain +# loaded via Lmod. Sets CC, CXX, and FC to match supported +# toolchains. +# +# CONTRIBUTORS +# +# Karl W. Schulz + +AC_DEFUN([CHECK_ENV], +[ + +AC_MSG_CHECKING([for $1 environment variable]) +if test "x$$1" = "x"; then + AC_MSG_RESULT([no]) + echo + AC_MSG_ERROR([$1 not defined - please load $2 environment.]) +else + AC_MSG_RESULT([yes]) +fi + + +]) diff --git a/tests/dev-tools/tbb/m4/compiler_family.m4 b/tests/dev-tools/tbb/m4/compiler_family.m4 new file mode 120000 index 0000000000..c325560245 --- /dev/null +++ b/tests/dev-tools/tbb/m4/compiler_family.m4 @@ -0,0 +1 @@ +../../../compilers/m4/compiler_family.m4 \ No newline at end of file diff --git a/tests/dev-tools/tbb/ohpc-tests/test_tbb b/tests/dev-tools/tbb/ohpc-tests/test_tbb new file mode 100755 index 0000000000..66f1b4262c --- /dev/null +++ b/tests/dev-tools/tbb/ohpc-tests/test_tbb @@ -0,0 +1,39 @@ +#!/bin/bash +# -*-sh-*- + +TEST_LOGS="" +MAKEFLAGS="" + +source ./TEST_ENV || exit 1 +source ./common/functions || exit 1 + +cd dev-tools/tbb || exit 1 +export BATS_JUNIT_CLASS=TBB + +# bootstrap the local autotools project if necessary + +./bootstrap || exit 1 + +for compiler in $COMPILER_FAMILIES ; do + + if [ "$compiler" != "intel" ]; then + continue + fi + + echo " " + echo " " + echo "-------------------------------------------------------" + echo "Dev Tools: TBB tests: $compiler" + echo "-------------------------------------------------------" + + module purge || exit 1 + module load $compiler || exit 1 + + ./configure || exit 1 + make clean >& /dev/null || exit 1 + make check || exit 1 + + save_logs_compiler_family tests $compiler + + make clean >& /dev/null +done diff --git a/tests/dev-tools/tbb/tests/Makefile.am b/tests/dev-tools/tbb/tests/Makefile.am new file mode 100644 index 0000000000..447398adff --- /dev/null +++ b/tests/dev-tools/tbb/tests/Makefile.am @@ -0,0 +1,3 @@ +AUTOMAKE_OPTIONS = foreign +AM_MAKEFLAGS = --no-print-directory +SUBDIRS = test_all diff --git a/tests/dev-tools/tbb/tests/test_all/Fibonacci.cpp b/tests/dev-tools/tbb/tests/test_all/Fibonacci.cpp new file mode 100644 index 0000000000..1aa4ace31b --- /dev/null +++ b/tests/dev-tools/tbb/tests/test_all/Fibonacci.cpp @@ -0,0 +1,593 @@ +/* + Copyright 2005-2015 Intel Corporation. All Rights Reserved. + + The source code contained or described herein and all documents related + to the source code ("Material") are owned by Intel Corporation or its + suppliers or licensors. Title to the Material remains with Intel + Corporation or its suppliers and licensors. The Material is protected + by worldwide copyright laws and treaty provisions. No part of the + Material may be used, copied, reproduced, modified, published, uploaded, + posted, transmitted, distributed, or disclosed in any way without + Intel's prior express written permission. + + No license under any patent, copyright, trade secret or other + intellectual property right is granted to or conferred upon you by + disclosure or delivery of the Materials, either expressly, by + implication, inducement, estoppel or otherwise. Any license under such + intellectual property rights must be express and approved by Intel in + writing. +*/ + +/* Example program that computes Fibonacci numbers in different ways. + Arguments are: [ Number [Threads [Repeats]]] + The defaults are Number=500 Threads=1:4 Repeats=1. + + The point of this program is to check that the library is working properly. + Most of the computations are deliberately silly and not expected to + show any speedup on multiprocessors. +*/ + +// enable assertions +#ifdef NDEBUG +#undef NDEBUG +#endif + +#include +#include +#include +#include +#include "tbb/task.h" +#include "tbb/task_scheduler_init.h" +#include "tbb/tick_count.h" +#include "tbb/blocked_range.h" +#include "tbb/concurrent_vector.h" +#include "tbb/concurrent_queue.h" +#include "tbb/concurrent_hash_map.h" +#include "tbb/parallel_while.h" +#include "tbb/parallel_for.h" +#include "tbb/parallel_reduce.h" +#include "tbb/parallel_scan.h" +#include "tbb/pipeline.h" +#include "tbb/atomic.h" +#include "tbb/mutex.h" +#include "tbb/spin_mutex.h" +#include "tbb/queuing_mutex.h" +#include "tbb/tbb_thread.h" + +using namespace std; +using namespace tbb; + +//! type used for Fibonacci number computations +typedef long long value; + +//! Matrix 2x2 class +struct Matrix2x2 +{ + //! Array of values + value v[2][2]; + Matrix2x2() {} + Matrix2x2(value v00, value v01, value v10, value v11) { + v[0][0] = v00; v[0][1] = v01; v[1][0] = v10; v[1][1] = v11; + } + Matrix2x2 operator * (const Matrix2x2 &to) const; //< Multiply two Matrices +}; +//! Default matrix to multiply +static const Matrix2x2 Matrix1110(1, 1, 1, 0); +//! Raw arrays matrices multiply +void Matrix2x2Multiply(const value a[2][2], const value b[2][2], value c[2][2]); + +/////////////////////// Serial methods //////////////////////// + +//! Plain serial sum +value SerialFib(int n) +{ + if(n < 2) + return n; + value a = 0, b = 1, sum; int i; + for( i = 2; i <= n; i++ ) + { // n is really index of Fibonacci number + sum = a + b; a = b; b = sum; + } + return sum; +} +//! Serial n-1 matrices multiplication +value SerialMatrixFib(int n) +{ + value c[2][2], a[2][2] = {{1, 1}, {1, 0}}, b[2][2] = {{1, 1}, {1, 0}}; int i; + for(i = 2; i < n; i++) + { // Using condition to prevent copying of values + if(i & 1) Matrix2x2Multiply(a, c, b); + else Matrix2x2Multiply(a, b, c); + } + return (i & 1) ? c[0][0] : b[0][0]; // get result from upper left cell +} +//! Recursive summing. Just for complete list of serial algorithms, not used +value SerialRecursiveFib(int n) +{ + value result; + if(n < 2) + result = n; + else + result = SerialRecursiveFib(n - 1) + SerialRecursiveFib(n - 2); + return result; +} +//! Introducing of queue method in serial +value SerialQueueFib(int n) +{ + concurrent_queue Q; + for(int i = 1; i < n; i++) + Q.push(Matrix1110); + Matrix2x2 A, B; + while(true) { + while( !Q.try_pop(A) ) this_tbb_thread::yield(); + if(Q.empty()) break; + while( !Q.try_pop(B) ) this_tbb_thread::yield(); + Q.push(A * B); + } + return A.v[0][0]; +} +//! Trying to use concurrent_vector +value SerialVectorFib(int n) +{ + concurrent_vector A; + A.grow_by(2); + A[0] = 0; A[1] = 1; + for( int i = 2; i <= n; i++) + { + A.grow_to_at_least(i+1); + A[i] = A[i-1] + A[i-2]; + } + return A[n]; +} + +///////////////////// Parallel methods //////////////////////// + +// *** Serial shared by mutexes *** // + +//! Shared glabals +value SharedA = 0, SharedB = 1; int SharedI = 1, SharedN; + +//! Template task class which computes Fibonacci numbers with shared globals +template +class SharedSerialFibBody { + M &mutex; +public: + SharedSerialFibBody( M &m ) : mutex( m ) {} + //! main loop + void operator()( const blocked_range& range ) const { + for(;;) { + typename M::scoped_lock lock( mutex ); + if(SharedI >= SharedN) break; + value sum = SharedA + SharedB; + SharedA = SharedB; SharedB = sum; + ++SharedI; + } + } +}; + +//! Root function +template +value SharedSerialFib(int n) +{ + SharedA = 0; SharedB = 1; SharedI = 1; SharedN = n; M mutex; + parallel_for( blocked_range(0,4,1), SharedSerialFibBody( mutex ) ); + return SharedB; +} + +// *** Serial shared by concurrent hash map *** // + +//! Hash comparer +struct IntHashCompare { + bool equal( const int j, const int k ) const { return j == k; } + unsigned long hash( const int k ) const { return (unsigned long)k; } +}; +//! NumbersTable type based on concurrent_hash_map +typedef concurrent_hash_map NumbersTable; +//! task for serial method using shared concurrent_hash_map +class ConcurrentHashSerialFibTask: public task { + NumbersTable &Fib; + int my_n; +public: + //! constructor + ConcurrentHashSerialFibTask( NumbersTable &cht, int n ) : Fib(cht), my_n(n) { } + //! executing task + /*override*/ task* execute() + { + for( int i = 2; i <= my_n; ++i ) { // there is no difference in to recycle or to make loop + NumbersTable::const_accessor f1, f2; // same as iterators + if( !Fib.find(f1, i-1) || !Fib.find(f2, i-2) ) { + // Something is seriously wrong, because i-1 and i-2 must have been inserted + // earlier by this thread or another thread. + assert(0); + } + value sum = f1->second + f2->second; + NumbersTable::const_accessor fsum; + Fib.insert(fsum, make_pair(i, sum)); // inserting + assert( fsum->second == sum ); // check value + } + return 0; + } +}; + +//! Root function +value ConcurrentHashSerialFib(int n) +{ + NumbersTable Fib; + bool okay; + okay = Fib.insert( make_pair(0, 0) ); assert(okay); // assign initial values + okay = Fib.insert( make_pair(1, 1) ); assert(okay); + + task_list list; + // allocate tasks + list.push_back(*new(task::allocate_root()) ConcurrentHashSerialFibTask(Fib, n)); + list.push_back(*new(task::allocate_root()) ConcurrentHashSerialFibTask(Fib, n)); + task::spawn_root_and_wait(list); + NumbersTable::const_accessor fresult; + okay = Fib.find( fresult, n ); + assert(okay); + return fresult->second; +} + +// *** Queue with parallel_for and parallel_while *** // + +//! Stream of matrices +struct QueueStream { + volatile bool producer_is_done; + concurrent_queue Queue; + //! Get pair of matricies if present + bool pop_if_present( pair &mm ) { + // get first matrix if present + if(!Queue.try_pop(mm.first)) return false; + // get second matrix if present + if(!Queue.try_pop(mm.second)) { + // if not, then push back first matrix + Queue.push(mm.first); return false; + } + return true; + } +}; + +//! Functor for parallel_for which fills the queue +struct parallel_forFibBody { + QueueStream &my_stream; + //! fill functor arguments + parallel_forFibBody(QueueStream &s) : my_stream(s) { } + //! iterate thorough range + void operator()( const blocked_range &range ) const { + int i_end = range.end(); + for( int i = range.begin(); i != i_end; ++i ) { + my_stream.Queue.push( Matrix1110 ); // push initial matrix + } + } +}; +//! Functor for parallel_while which process the queue +class parallel_whileFibBody +{ + QueueStream &my_stream; + parallel_while &my_while; +public: + typedef pair argument_type; + //! fill functor arguments + parallel_whileFibBody(parallel_while &w, QueueStream &s) + : my_while(w), my_stream(s) { } + //! process pair of matrices + void operator() (argument_type mm) const { + mm.first = mm.first * mm.second; + // note: it can run concurrently with QueueStream::pop_if_present() + if(my_stream.Queue.try_pop(mm.second)) + my_while.add( mm ); // now, two matrices available. Add next iteration. + else my_stream.Queue.push( mm.first ); // or push back calculated value if queue is empty + } +}; + +//! Parallel queue's filling task +struct QueueInsertTask: public task { + QueueStream &my_stream; + int my_n; + //! fill task arguments + QueueInsertTask( int n, QueueStream &s ) : my_n(n), my_stream(s) { } + //! executing task + /*override*/ task* execute() { + // Execute of parallel pushing of n-1 initial matrices + parallel_for( blocked_range( 1, my_n, 10 ), parallel_forFibBody(my_stream) ); + my_stream.producer_is_done = true; + return 0; + } +}; +//! Parallel queue's processing task +struct QueueProcessTask: public task { + QueueStream &my_stream; + //! fill task argument + QueueProcessTask( QueueStream &s ) : my_stream(s) { } + //! executing task + /*override*/ task* execute() { + while( !my_stream.producer_is_done || my_stream.Queue.unsafe_size()>1 ) { + parallel_while w; // run while loop in parallel + w.run( my_stream, parallel_whileFibBody( w, my_stream ) ); + } + return 0; + } +}; +//! Root function +value ParallelQueueFib(int n) +{ + QueueStream stream; + stream.producer_is_done = false; + task_list list; + list.push_back(*new(task::allocate_root()) QueueInsertTask( n, stream )); + list.push_back(*new(task::allocate_root()) QueueProcessTask( stream )); + // If there is only a single thread, the first task in the list runs to completion + // before the second task in the list starts. + task::spawn_root_and_wait(list); + assert(stream.Queue.unsafe_size() == 1); // it is easy to lose some work + Matrix2x2 M; + bool result = stream.Queue.try_pop( M ); // get last matrix + assert( result ); + return M.v[0][0]; // and result number +} + +// *** Queue with pipeline *** // + +//! filter to fills queue +class InputFilter: public filter { + tbb::atomic N; //< index of Fibonacci number minus 1 +public: + concurrent_queue Queue; + //! fill filter arguments + InputFilter( int n ) : filter(false /*is not serial*/) { N = n; } + //! executing filter + /*override*/ void* operator()(void*) + { + int n = --N; + if(n <= 0) return 0; + Queue.push( Matrix1110 ); + return &Queue; + } +}; +//! filter to process queue +class MultiplyFilter: public filter { +public: + MultiplyFilter( ) : filter(false /*is not serial*/) { } + //! executing filter + /*override*/ void* operator()(void*p) + { + concurrent_queue &Queue = *static_cast *>(p); + Matrix2x2 m1, m2; + // get two elements + while( !Queue.try_pop( m1 ) ) this_tbb_thread::yield(); + while( !Queue.try_pop( m2 ) ) this_tbb_thread::yield(); + m1 = m1 * m2; // process them + Queue.push( m1 ); // and push back + return this; // just nothing + } +}; +//! Root function +value ParallelPipeFib(int n) +{ + InputFilter input( n-1 ); + MultiplyFilter process; + // Create the pipeline + pipeline pipeline; + // add filters + pipeline.add_filter( input ); // first + pipeline.add_filter( process ); // second + + input.Queue.push( Matrix1110 ); + // Run the pipeline + pipeline.run( n ); // must be larger then max threads number + pipeline.clear(); // do not forget clear the pipeline + + assert( input.Queue.unsafe_size()==1 ); + Matrix2x2 M; + bool result = input.Queue.try_pop( M ); // get last element + assert( result ); + return M.v[0][0]; // get value +} + +// *** parallel_reduce *** // + +//! Functor for parallel_reduce +struct parallel_reduceFibBody { + Matrix2x2 sum; + int splitted; //< flag to make one less operation for splitted bodies + //! Constructor fills sum with initial matrix + parallel_reduceFibBody() : sum( Matrix1110 ), splitted(0) { } + //! Splitting constructor + parallel_reduceFibBody( parallel_reduceFibBody& other, split ) : sum( Matrix1110 ), splitted(1/*note that it is splitted*/) {} + //! Join point + void join( parallel_reduceFibBody &s ) { + sum = sum * s.sum; + } + //! Process multiplications + void operator()( const blocked_range &r ) { + for( int k = r.begin() + splitted; k < r.end(); ++k ) + sum = sum * Matrix1110; + splitted = 0; // reset flag, because this method can be reused for next range + } +}; +//! Root function +value parallel_reduceFib(int n) +{ + parallel_reduceFibBody b; + parallel_reduce(blocked_range(2, n, 3), b); // do parallel reduce on range [2, n) for b + return b.sum.v[0][0]; +} + +// *** parallel_scan *** // + +//! Functor for parallel_scan +struct parallel_scanFibBody { + Matrix2x2 sum; + int first; // flag to make one less operation for first range + //! Constructor fills sum with initial matrix + parallel_scanFibBody() : sum( Matrix1110 ), first(1) {} + //! Splitting constructor + parallel_scanFibBody( parallel_scanFibBody &b, split) : sum( Matrix1110 ), first(1) {} + //! Join point + void reverse_join( parallel_scanFibBody &a ) { + sum = sum * a.sum; + } + //! Assign point + void assign( parallel_scanFibBody &b ) { + sum = b.sum; + } + //! Process multiplications. For two tags + template + void operator()( const blocked_range &r, T) { + // see tag.is_final_scan() for what tag is used + for( int k = r.begin() + first; k < r.end(); ++k ) + sum = sum * Matrix1110; + first = 0; // reset flag, because this method can be reused for next range + } +}; +//! Root function +value parallel_scanFib(int n) +{ + parallel_scanFibBody b; + parallel_scan(blocked_range(1/*one less, because body skip first*/, n, 3), b); + return b.sum.v[0][0]; +} + +// *** Raw tasks *** // + +//! task class which computes Fibonacci numbers by Lucas formula +struct FibTask: public task { + const int n; + value& sum; + value x, y; + bool second_phase; //< flag of continuation + // task arguments + FibTask( int n_, value& sum_ ) : + n(n_), sum(sum_), second_phase(false) + {} + //! Execute task + /*override*/ task* execute() { + // Using Lucas' formula here + if( second_phase ) { // children finished + sum = n&1 ? x*x + y*y : x*x - y*y; + return NULL; + } + if( n <= 2 ) { + sum = n!=0; + return NULL; + } else { + recycle_as_continuation(); // repeat this task when children finish + second_phase = true; // mark second phase + FibTask& a = *new( allocate_child() ) FibTask( n/2 + 1, x ); + FibTask& b = *new( allocate_child() ) FibTask( n/2 - 1 + (n&1), y ); + set_ref_count(2); + spawn( a ); + return &b; + } + } +}; +//! Root function +value ParallelTaskFib(int n) { + value sum; + FibTask& a = *new(task::allocate_root()) FibTask(n, sum); + task::spawn_root_and_wait(a); + return sum; +} + +/////////////////////////// Main //////////////////////////////////////////////////// + +//! A closed range of int. +struct IntRange { + int low; + int high; + void set_from_string( const char* s ); + IntRange( int low_, int high_ ) : low(low_), high(high_) {} +}; + +void IntRange::set_from_string( const char* s ) { + char* end; + high = low = strtol(s,&end,0); + switch( *end ) { + case ':': + high = strtol(end+1,0,0); + break; + case '\0': + break; + default: + printf("unexpected character = %c\n",*end); + } +} + +//! Tick count for start +static tick_count t0; + +//! Verbose output flag +static bool Verbose = false; + +typedef value (*MeasureFunc)(int); +//! Measure ticks count in loop [2..n] +value Measure(const char *name, MeasureFunc func, int n) +{ + value result; + if(Verbose) printf("%s",name); + t0 = tick_count::now(); + for(int number = 2; number <= n; number++) + result = func(number); + if(Verbose) printf("\t- in %f msec\n", (tick_count::now() - t0).seconds()*1000); + return result; +} + +//! program entry +int main(int argc, char* argv[]) +{ + if(argc>1) Verbose = true; + int NumbersCount = argc>1 ? strtol(argv[1],0,0) : 500; + IntRange NThread(1,4);// Number of threads to use. + if(argc>2) NThread.set_from_string(argv[2]); + unsigned long ntrial = argc>3? (unsigned long)strtoul(argv[3],0,0) : 1; + value result, sum; + + if(Verbose) printf("Fibonacci numbers example. Generating %d numbers..\n", NumbersCount); + + result = Measure("Serial loop", SerialFib, NumbersCount); + sum = Measure("Serial matrix", SerialMatrixFib, NumbersCount); assert(result == sum); + sum = Measure("Serial vector", SerialVectorFib, NumbersCount); assert(result == sum); + sum = Measure("Serial queue", SerialQueueFib, NumbersCount); assert(result == sum); + // now in parallel + for( unsigned long i=0; i, NumbersCount); assert(result == sum); + sum = Measure("Shared serial (spin_mutex)", SharedSerialFib, NumbersCount); assert(result == sum); + sum = Measure("Shared serial (queuing_mutex)", SharedSerialFib, NumbersCount); assert(result == sum); + sum = Measure("Shared serial (Conc.HashTable)", ConcurrentHashSerialFib, NumbersCount); assert(result == sum); + sum = Measure("Parallel while+for/queue", ParallelQueueFib, NumbersCount); assert(result == sum); + sum = Measure("Parallel pipe/queue\t", ParallelPipeFib, NumbersCount); assert(result == sum); + sum = Measure("Parallel reduce\t\t", parallel_reduceFib, NumbersCount); assert(result == sum); + sum = Measure("Parallel scan\t\t", parallel_scanFib, NumbersCount); assert(result == sum); + sum = Measure("Parallel tasks\t\t", ParallelTaskFib, NumbersCount); assert(result == sum); + } + + #ifdef __GNUC__ + if(Verbose) printf("Fibonacci number #%d modulo 2^64 is %lld\n\n", NumbersCount, result); + #else + if(Verbose) printf("Fibonacci number #%d modulo 2^64 is %I64d\n\n", NumbersCount, result); + #endif + } + if(!Verbose) printf("TEST PASSED\n"); + return 0; +} + +// Utils + +void Matrix2x2Multiply(const value a[2][2], const value b[2][2], value c[2][2]) +{ + for( int i = 0; i <= 1; i++) + for( int j = 0; j <= 1; j++) + c[i][j] = a[i][0]*b[0][j] + a[i][1]*b[1][j]; +} + +Matrix2x2 Matrix2x2::operator *(const Matrix2x2 &to) const +{ + Matrix2x2 result; + Matrix2x2Multiply(v, to.v, result.v); + return result; +} diff --git a/tests/dev-tools/tbb/tests/test_all/Makefile.am b/tests/dev-tools/tbb/tests/test_all/Makefile.am new file mode 100644 index 0000000000..d422ca567d --- /dev/null +++ b/tests/dev-tools/tbb/tests/test_all/Makefile.am @@ -0,0 +1,5 @@ +TESTS_ENVIRONMENT = BATS_NO_SUMMARY=1 + +check_PROGRAMS = fibonacci +fibonacci_SOURCES = Fibonacci.cpp +TESTS = fibonacci_bats diff --git a/tests/dev-tools/tbb/tests/test_all/fibonacci_bats b/tests/dev-tools/tbb/tests/test_all/fibonacci_bats new file mode 100755 index 0000000000..dfc1aecfa2 --- /dev/null +++ b/tests/dev-tools/tbb/tests/test_all/fibonacci_bats @@ -0,0 +1,15 @@ +#!../../../../common/bats/bin/bats +# -*-sh-*- + +load ../../../../common/test_helper_functions +source ../../../../common/functions || exit 1 + +if [ -s ../../../../TEST_ENV ];then + source ../../../../TEST_ENV +fi + +PKG="dev-tools/tbb" + +@test "[$PKG] TBB Test - fibonacci" { + run fibonacci +} diff --git a/tests/dev-tools/valgrind/Makefile.am b/tests/dev-tools/valgrind/Makefile.am new file mode 100644 index 0000000000..6965ac054e --- /dev/null +++ b/tests/dev-tools/valgrind/Makefile.am @@ -0,0 +1,3 @@ +ACLOCAL_AMFLAGS = -I m4 +AM_MAKEFLAGS = --no-print-directory +SUBDIRS = tests diff --git a/tests/dev-tools/valgrind/bootstrap b/tests/dev-tools/valgrind/bootstrap new file mode 100755 index 0000000000..f1f5d3e333 --- /dev/null +++ b/tests/dev-tools/valgrind/bootstrap @@ -0,0 +1,9 @@ +#! /bin/sh +# -------------------------------------------------------------------------- +# bootstrapping utility for autotools -> now just uses autoreconf +# -------------------------------------------------------------------------- + +cmd="autoreconf -f -i" +echo "Bootstrapping using $cmd ..." + +$cmd diff --git a/tests/dev-tools/valgrind/configure.ac b/tests/dev-tools/valgrind/configure.ac new file mode 100644 index 0000000000..3ae18fd90a --- /dev/null +++ b/tests/dev-tools/valgrind/configure.ac @@ -0,0 +1,39 @@ +# -*- Autoconf -*- +# Process this file with autoconf to produce a configure script. + +AC_PREREQ(2.59) +AC_INIT([valgrind], [0.10.0], [karl.w.schulz@intel.com]) +AC_CONFIG_MACRO_DIR([m4]) +AM_INIT_AUTOMAKE([foreign]) +m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) + +# verify we have necessary environment variables set +AC_MSG_CHECKING([for VALGRIND_DIR environment variable]) +if test "x$VALGRIND_DIR" = "x"; then + AC_MSG_RESULT([no]) + echo + AC_ERROR([VALGRIND_DIR not defined - please load boost environment.]) +else + AC_MSG_RESULT([yes]) +fi + +OHPC_COMPILER_FAMILY + +# test compilers +AC_PROG_CC + +# Set subdirectories +AC_CONFIG_FILES(Makefile tests/Makefile ) + +# Configure +AC_OUTPUT() + +echo +echo '-------------------------------------------------- SUMMARY --------------------------------------------------' +echo +echo Package version............... : $PACKAGE-$VERSION +echo OHPC compiler toolchain........ : $LMOD_FAMILY_COMPILER +echo +echo Valgrind install dir.......... : $VALGRIND_DIR +echo +echo '-------------------------------------------------------------------------------------------------------------' diff --git a/tests/dev-tools/valgrind/ohpc-tests/test_compiler_families b/tests/dev-tools/valgrind/ohpc-tests/test_compiler_families new file mode 100755 index 0000000000..82f5750df3 --- /dev/null +++ b/tests/dev-tools/valgrind/ohpc-tests/test_compiler_families @@ -0,0 +1,37 @@ +#!/bin/bash +# -*-sh-*- + +TEST_LOGS="" +MAKEFLAGS="" + +source ./TEST_ENV || exit 1 +source ./common/functions || exit 1 + +cd dev-tools/valgrind || exit 1 +export BATS_JUNIT_CLASS=Valgrind + +# bootstrap the local autotools project if necessary + +./bootstrap || exit 1 + +for compiler in $COMPILER_FAMILIES ; do + + echo " " + echo " " + echo "-------------------------------------------------------" + echo "Dev Tools: Valgrind tests: $compiler" + echo "-------------------------------------------------------" + + module purge || exit 1 + module load $compiler || exit 1 + module load valgrind || exit 1 + + ./configure || exit 1 + make clean || exit 1 + make -k check || exit 1 + + save_logs_compiler_family tests $compiler + + make distclean +done + diff --git a/tests/dev-tools/valgrind/tests/Makefile.am b/tests/dev-tools/valgrind/tests/Makefile.am new file mode 100644 index 0000000000..0bd8ed3763 --- /dev/null +++ b/tests/dev-tools/valgrind/tests/Makefile.am @@ -0,0 +1 @@ +TESTS = test_module rm_execution diff --git a/tests/dev-tools/valgrind/tests/TEST_ENV b/tests/dev-tools/valgrind/tests/TEST_ENV new file mode 120000 index 0000000000..5bb274e487 --- /dev/null +++ b/tests/dev-tools/valgrind/tests/TEST_ENV @@ -0,0 +1 @@ +../../../TEST_ENV \ No newline at end of file diff --git a/tests/dev-tools/valgrind/tests/badfree.c b/tests/dev-tools/valgrind/tests/badfree.c new file mode 100644 index 0000000000..f9393c7753 --- /dev/null +++ b/tests/dev-tools/valgrind/tests/badfree.c @@ -0,0 +1,29 @@ + + +#include +#include +static void* return_arg(void* q); +int main ( void ) +{ + void* p = (void*)0x87654321; + int q[] = { 1, 2, 3 }; + + /* Free a pointer to Never-Never Land */ + free(p); + + /* Free a pointer to a stack block */ + free(return_arg(q)); + + return 0; +} + +/* + * The only purpose of the function below is to make sure that gcc 4.4.x does + * not print the following warning during the compilation of this test program: + * warning: attempt to free a non-heap object + */ +static void* return_arg(void* q) +{ + return q; +} + diff --git a/tests/dev-tools/valgrind/tests/common b/tests/dev-tools/valgrind/tests/common new file mode 120000 index 0000000000..f74dff0e4d --- /dev/null +++ b/tests/dev-tools/valgrind/tests/common @@ -0,0 +1 @@ +../../../common \ No newline at end of file diff --git a/tests/dev-tools/valgrind/tests/hello.c b/tests/dev-tools/valgrind/tests/hello.c new file mode 100644 index 0000000000..4a78def8c9 --- /dev/null +++ b/tests/dev-tools/valgrind/tests/hello.c @@ -0,0 +1,9 @@ +#include + +int main() +{ + const int i=1; + printf("hello, i = %i\n",i); + return 0; +} + diff --git a/tests/dev-tools/valgrind/tests/rm_execution b/tests/dev-tools/valgrind/tests/rm_execution new file mode 100755 index 0000000000..ddb3eed9d0 --- /dev/null +++ b/tests/dev-tools/valgrind/tests/rm_execution @@ -0,0 +1,54 @@ +#!./common/bats/bin/bats +# -*-sh-*- + +source ./common/test_helper_functions.bash || exit 1 +source ./common/functions || exit 1 + +if [ -s ./TEST_ENV ];then + source ./TEST_ENV +fi + +if [ "$RESOURCE_MANAGER" = "slurm" ];then + rm=slurm +else + ERROR "Unsupported or unknown resource manager" + exit 1 +fi + +PKG="Valgrind" + +@test "[$PKG] Callgrind execution under resource manager ($rm/$LMOD_FAMILY_COMPILER)" { + test=simwork + if [ ! -x $test ];then + flunk "$test does not exist" + fi + + rm -f callgrind.out* + + run run_serial_binary valgrind -q --error-exitcode=1 --tool=callgrind ./$test + assert_success + + # verify callgrind output was generated + run ls -l callgrind.out* + assert_success +} + +@test "[$PKG] Memcheck execution under resource manager ($rm/$LMOD_FAMILY_COMPILER)" { + + # Clean program that should run without incident + if [ ! -x ./hello ];then + flunk "./hello does not exist" + fi + + run run_serial_binary valgrind -q --error-exitcode=1 ./hello + assert_success + + # Program with memory error that valgrind should detect + if [ ! -x ./badfree ];then + flunk "./badfree does not exist" + fi + + run run_serial_binary valgrind -q --error-exitcode=1 ./badfree + assert_failure +} + diff --git a/tests/dev-tools/valgrind/tests/simwork.c b/tests/dev-tools/valgrind/tests/simwork.c new file mode 100644 index 0000000000..184bb83d81 --- /dev/null +++ b/tests/dev-tools/valgrind/tests/simwork.c @@ -0,0 +1,66 @@ +// Some work exercising the cache simulator +// with a simple call graph + +#include + +#include +#include + +#define SIZE 100000 + +double *a, *b, *c; + +void init() +{ + int i; + for(i = 0; i< SIZE; i++) a[i] = b[i] = 1.0; +} + +void do_add() +{ + int i; + for(i = 0; i< SIZE; i++) { + a[i] += 1.0; + c[i] = a[i] + b[i]; + } +} + +double do_sum() +{ + int i; + double sum=0.0; + + do_add(); + for(i = 0; i< SIZE; i++) sum += c[i]; + + return sum; +} + +double do_some_work(int iter) +{ + double sum=0.0; + + if (iter > 0) sum += do_some_work(iter-1); + do_add(); + sum += do_sum(); + + return sum; +} + +int main(void) +{ + double res; + + a = (double*) malloc(SIZE * sizeof(double)); + b = (double*) malloc(SIZE * sizeof(double)); + c = (double*) malloc(SIZE * sizeof(double)); + + CALLGRIND_ZERO_STATS; + init(); + res = do_some_work(1); + CALLGRIND_DUMP_STATS; + + printf("Sum: %.0f\n", res); + return 0; +} + diff --git a/tests/dev-tools/valgrind/tests/test_module b/tests/dev-tools/valgrind/tests/test_module new file mode 100755 index 0000000000..eee3a54744 --- /dev/null +++ b/tests/dev-tools/valgrind/tests/test_module @@ -0,0 +1,133 @@ +#!./common/bats/bin/bats +# -*-sh-*- + +source ./common/test_helper_functions.bash || exit 1 +source ./common/functions || exit 1 + +if [ -s ./TEST_ENV ];then + source ./TEST_ENV +fi + +PKG=VALGRIND +testname=Valgrind +module=valgrind +header=valgrind/valgrind.h +rpm=valgrind${DELIM} + +# Query local compiler family +check_compiler_family CC CXX FC + +@test "[$testname] Verify $module module is loaded and matches rpm version ($LMOD_FAMILY_COMPILER)" { + module list $module | grep "1) $module" >& .cmd_output || exit 1 + run grep $module .cmd_output + assert_success + + # check version against rpm + local version="$(rpm -q --queryformat='%{VERSION}\n' $rpm)" + run cat .cmd_output + assert_output " 1) $module/$version" +} + +@test "[$testname] Verify module ${PKG}_DIR is defined and exists ($LMOD_FAMILY_COMPILER)" { + DIR=${PKG}_DIR + if [ -z ${!DIR} ];then + flunk "${PKG}_DIR directory not defined" + fi + + if [ ! -d ${!DIR} || -z "${!DIR}" ];then + flunk "directory ${!DIR} does not exist" + fi +} + +@test "[$testname] Verify availability of $module binary ($LMOD_FAMILY_COMPILER)" { + run which valgrind + assert_success +} + +# ---------- +# Man pages +# ---------- + +@test "[$testname] Verify availability of man page ($LMOD_FAMILY_COMPILER)" { + DIR=${PKG}_DIR + + if [ -z ${!DIR} ];then + flunk "${PKG}_DIR directory not defined" + fi + + if [ ! -d ${!DIR} || -z "${!DIR}" ];then + flunk "directory ${!DIR} does not exist" + fi + + run man -w $module + assert_success + assert_output "${!DIR}/share/man/man1/valgrind.1" +} +# -------------- +# Include Tests +# -------------- + +@test "[$testname] Verify module ${PKG}_INC is defined and exists ($LMOD_FAMILY_COMPILER)" { + INC=${PKG}_INC + + if [ -z ${!INC} ];then + flunk "${PKG}_INC directory not defined" + fi + + if [ ! -d ${!INC} ];then + flunk "directory ${!INC} does not exist" + fi +} + +@test "[$testname] Verify header file is present in ${PKG}_INC ($LMOD_FAMILY_COMPILER)" { + INC=${PKG}_INC + + if [ -z ${!INC} ];then + flunk "${PKG}_INC directory not defined" + fi + + if [ ! -s ${!INC}/${header} ];then + flunk "directory $header file does not exist" + fi +} + +# Execution Test(s) + +@test "[$testname] Callgrind compile/test ($LMOD_FAMILY_COMPILER)" { + INC=${PKG}_INC + + if [ -z ${!INC} ];then + flunk "${PKG}_INC directory not defined" + fi + + rm -f callgrind.out* + + $CC -I${!INC} -o simwork simwork.c + assert_success + + run valgrind --tool=callgrind ./simwork + run ls -l callgrind.out* + assert_success +} + +@test "[$testname] Memcheck compile/test ($LMOD_FAMILY_COMPILER)" { + + # Clean program that should run without incident + $CC -o hello hello.c + assert_success + run valgrind -q --error-exitcode=1 ./hello + assert_success + + # Program with memory error that valgrind should detect + $CC -o badfree badfree.c + assert_success + run valgrind -q --error-exitcode=1 ./badfree + assert_failure + +# rm ./badfree +# rm ./hello +} + +rm -f .cmd_output +rm -f callgrind.out* + diff --git a/tests/install/nodes_installed b/tests/install/nodes_installed new file mode 100755 index 0000000000..dd79965528 --- /dev/null +++ b/tests/install/nodes_installed @@ -0,0 +1,50 @@ +#!../common/bats/bin/bats +# -*-sh-*- + +load ../common/test_helper_functions || exit 1 +source ../common/functions || exit 1 + +if [ -s ../TEST_ENV ];then + source ../TEST_ENV +fi + +@test "[cluster-install] verify ${num_computes} nodes provisioned" { + + run which koomie_cf + assert_success + + [ ${num_computes} -ge 4 ] ; assert_success + + rm -f /tmp/hosts + koomie_cf -x "c\d+" uptime | grep average > /tmp/hosts + [ -s /tmp/hosts ]; assert_success + + num_hosts=$(wc -l /tmp/hosts | awk '{print $1}') || exit 1 + + [ ${num_hosts} -eq ${num_computes} ]; assert_success +} + +@test "[cluster-install] verify ${num_computes} uptimes are reasonable" { + + run which koomie_cf + assert_success + + rm -f /tmp/hosts + koomie_cf -x "c\d+" cat /proc/uptime > /tmp/hosts + [ -s /tmp/hosts ]; assert_success + + THRESHOLD=720 # time in (seconds) + + while read entry; do + host=$(echo $entry | awk '{print $1}') + seconds=$(echo $entry | awk '{print $2}' | awk -F . '{print $1}') + + if [ ${seconds} -gt ${THRESHOLD} ]; then + ERROR "Host $host up longer than $THRESHOLD seconds" + fi + + done < /tmp/hosts + +} + + diff --git a/tests/libs/adios/AUTHORS b/tests/libs/adios/AUTHORS new file mode 100644 index 0000000000..0bb40b8954 --- /dev/null +++ b/tests/libs/adios/AUTHORS @@ -0,0 +1,4 @@ + +Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. +Copyright (c) 2008 - 2009. Georgia Institute of Technology. All rights reserved. + diff --git a/tests/libs/adios/ChangeLog b/tests/libs/adios/ChangeLog new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/libs/adios/Makefile.am b/tests/libs/adios/Makefile.am new file mode 100644 index 0000000000..101ac6c41b --- /dev/null +++ b/tests/libs/adios/Makefile.am @@ -0,0 +1,22 @@ +ACLOCAL_AMFLAGS=-I config + +SUBDIRS=tests + +bin_SCRIPTS = adios_config + +install-data-hook: + echo "SRCDIR=\"$(PWD)\"" >> adios_config.flags; \ + if git rev-parse --git-dir &>/dev/null; then \ + echo "GITLOG=\"`git log -n 1 --format=\"Last commit on %ad hash %h\"`\"" > adios_git_status; \ + echo "read -d GITSTAT <<_EOF_" >> adios_git_status; \ + git status -uno >> adios_git_status; \ + echo "_EOF_" >> adios_git_status; \ + else \ + echo "GITLOG=\"git log not available\"" >> adios_git_status; \ + echo "GITSTAT=\"git status not available\"" >> adios_git_status; \ + echo "Note: git command not found or $(PWD) is not a git repository."; \ + fi + $(INSTALL_DATA) adios_config.flags $(DESTDIR)$(sysconfdir) + $(INSTALL_DATA) adios_git_status $(DESTDIR)$(sysconfdir) + +CLEANFILES = adios_config adios_config.flags diff --git a/tests/libs/adios/NEWS b/tests/libs/adios/NEWS new file mode 100644 index 0000000000..1b82243800 --- /dev/null +++ b/tests/libs/adios/NEWS @@ -0,0 +1,149 @@ +1.8.0 Release Dec 2014 + - Query API + - extends the read API with queries + - Staging over WAN (wide-area-network) + - ICEE method (requires FLEXPATH) + - skeldump utility + - to generate info and code from output data to replay + the I/O pattern + - bpmeta utility + - generates metadata file (.bp) separately after writing the + data using MPI_AGGREGATE method with metadata writing turned off + - I/O timing statistics and timing events can be collected + - New stage writer code for staged I/O, where output data + (list of variables and their sizes) is changing + at every timestep. See examples/stage_write_varying + - fix: staging with multiple streams allowed + - fix: parallel build (make -j ) completes without breaking + + +1.7.0 Release June 2014 + - Support for more than 64k variables in a file + - File system topology aware I/O method for Titan@OLCF + - DataSpaces staging + - support for 64bit dimension sizes + - support for more than three dimensions + - works on Bluegene/Q (DataSpaces+DIMES methods) + - can run as a service (dynamic connections) + - Additions to non-XML Write API: + - Support for the visualization schema + - adios_set_transform() to choose the transformation + for a variable + - Usability improvements: + - CMake Module for find_package(ADIOS) + - adios_config -m to print available write/read methods + + +1.6.0 Release Dec 2013 + - Transformations of data supported in file-based I/O + - lossless compression (zlib, bzip, szip) + - lossless compression (ISOBAR) + - precision-level-of-detail encoding (APLOD) + - Changes to Write API: + - variables are identified by full path at writing + - fix: all int functions return 0 as OK and !=0 on error + - Changes to Read API: + - Read API extensions to get information about the + visualization meshes defined in a file + - leading / in path names is not enforced + - New I/O method for Bluegene/Q called "BGQ" + configure with the option --with-bgq + - Removed performance bottleneck in metadata operations when + writing/reading thousands of variables. + - fix: one can build ADIOS separately from the source with automake + + +1.5.0 Release June 2013 + - Changes to Write API: + - adios_init() and adios_init_noxml() has MPI_Comm argument + - adios_open() has MPI_comm argument instead of void * argument + - Changes to Read API: + - adios_read_open_stream() obsolete and now it's called + adios_read_open() indicating that it's used for both + files and staged data. + - New staging methods: + - DIMES + - FLEXPATH + - CMAKE build files (besides Automake files) + - New write method VAR_MERGE for spatial aggregation of + small per-process-output into larger chunks. It improves both + write and read performance for such applications. + - fix: segfault in adios_inq_var_blockinfo() + - fix: endianness independence ( + - fix: in adios_inq_var_stat() for getting statistics (avg, std.dev) + - fix: backward compatibility in reading old BP files containing + scalars over time (a 1D array) + +1.4.1 Release Dec 2012 + - aggregated file reader method (from 1.3.1): + use ADIOS_READ_METHOD_BP_AGGREGATE + - memory limitation specified by user for chunked reading + now taken into account in file reading + - stage writer example code for staged I/O + see examples/stage_write + - code coupling example code for file-based/staged coupling + see examples/coupling + - bp2h5 supports converting complex and double complex types + - new adios_write_byid() function to write multiple-blocks of + the same global array from a process + - fix: F90 modules: adios_write, adios_schedule_read + - fix: invalid "out of bound" errors when reading multiple steps + of multi-dimensional arrays + - fix: double-free bug in support of old read API in Fortran + - fix: backward compatibility of old read API to read multi-group + files (fixed "invalid variable id..." errors) + +1.4.0 Release July 2012 + - new read API for staging method with step-by-step processing, + also with non-blocking and chunking APIs + - visualization schema added to ADIOS XML format + - skel: I/O skeleton generator and evaluation tools + - unified error/debug logging + - attributes written from only 1 processor to save on metadata + - ADIOS version identifier in ADIOS-BP format + - extra hidden attributes (version, create/update times) + - Java and Python bindings + - F90 modules adios_write_mod and adios_read_mod + to check syntax at compile time + + +1.3.1 Released Nov 2011 + - fix: non-compliant MPI collective calls + - fix: MPI_AMR method caused MPI_Finalize issues on some clusters + - fix: histogram calculation: freeing memory too early + +1.3 Released July 12, 2011 + - New read method BP_STAGED for reading files with improved performance + - Changes in MPI_AMR and MPI_LUSTRE to support default parameters. + Parameters for MPI_LUSTRE and MPI_AMR in XML file are not mandatory + any more. + +1.2.1 Released Aug 25, 2010 + - Bug fix in read API (arrays written every timestep but without time + dimension caused aborts) + - DIMES method from Rutgers + +1.2 Released July 15, 2010 + - XML and non-XML write APIs are available + - More statistics (min/max/avg/std.dev) available without + overhead in write performance + - Added MPI_AMR method for advanced mesh refinement codes and + for aggregated writing (N procs to P writers to M disks) + - Added support for subfiles + - POSIX method many-file output can be read as one file + - MPI_AMR method uses subfiles to improve write performance + - Added NetCDF-4 transport method + - Asynchronous, staging methods on Jaguar XT5 at ORNL + - DataTap from Georgia Tech + - DataSpaces from Rutgers + - NSSI from Sandia + - MPI_LUSTRE method for best performance on Lustre file system + + +1.0.1 Released on Dec 9, 2009 + - fix: builds read API on Mac (was broken at utils/bpdump) + - fix: Fortran written BP files are correctly read by Fortran readers + - added adios_mpi_stripe2 method for improved performance on Lustre + file system + +1.0 Released on Nov 18, 2009 diff --git a/tests/libs/adios/README b/tests/libs/adios/README new file mode 100644 index 0000000000..257f1e411c --- /dev/null +++ b/tests/libs/adios/README @@ -0,0 +1,16 @@ +ADIOS (Adaptable I/O System) +---------------------------- + +Please look at the examples/ directory for the example codes on how to +use ADIOS. If you need more detailed information, please, read the User's +manual. + +Please read COPYING for the copyright. + +This release contains only a limited set of transport methods for different +I/O uses. There are more methods, actively researched ones, available. +Contact us to get them. + + + + diff --git a/tests/libs/adios/TODO b/tests/libs/adios/TODO new file mode 100644 index 0000000000..f09a464346 --- /dev/null +++ b/tests/libs/adios/TODO @@ -0,0 +1,64 @@ +EXAMPLES +======== +- remove old crappy examples, move in new ones from the new tutorials + +WRITE +===== + +- bring back "write=no" into XML tag to skip some variables +- complete error logging +- undef value (also func: adios_undef_get(), adios_undef_set()) +- each method should process parameters from PairStruct, not from string + + +READ +==== +- peek_ahead function to support paraview +- chunking: + - support memory limit + +- missing data blocks when read should contain undef values + +- simple BP reader + - PG block selection read + - auto selection read + +- DataSpaces staging method + - per block variable information + - statistics + - auto selection should do domain decomposition, not just return the + whole dataset per process + +TEST +===== +- Test ISOBAR +- The statistics of scalars written over multiple timestep. Particularly we +need to test adios_complex and adios_double_complex scalars. +- Tests for schema +- Test BP reader without user-allocated memory + +BUILD +===== +- shared libraries (request by Numeca and ETH) +- cross-compile support +- add version defines into adios public header (request by Michele Martone) + +MANUAL +===== +- developer's manual + +PYTHON WRAPPER +============== +- example codes +- add to manual + +JAVA WRAPPER +============ +- example codes +- add to manual + +OTHER +===== +- check/fix or throw away bp2ascii +- bpls + - add back sorting of names (needs to copy namelist because cannot sort fp->var_namelist diff --git a/tests/libs/adios/adios_config.flags.in b/tests/libs/adios/adios_config.flags.in new file mode 100755 index 0000000000..a3d5f88f58 --- /dev/null +++ b/tests/libs/adios/adios_config.flags.in @@ -0,0 +1,39 @@ +# +# Configuration values from configure script +# + +# Install directory +ADIOS_DIR="@prefix@" + +# Flags to build code using ADIOS write API (and read API) +ADIOS_INC="-I${ADIOS_DIR}/include @ADIOSLIB_CPPFLAGS@ @ADIOSLIB_CFLAGS@" +ADIOS_CLIB="-L${ADIOS_DIR}/lib -ladios @ADIOSLIB_LDFLAGS@ @ADIOSLIB_LDADD@ @LDFLAGS@ @LIBS@" +ADIOS_FLIB="-L${ADIOS_DIR}/lib -ladiosf @ADIOSLIB_LDFLAGS@ @ADIOSLIB_LDADD@ @LDFLAGS@ @LIBS@" +ADIOS_V1_FLIB="-L${ADIOS_DIR}/lib -ladiosf_v1 @ADIOSLIB_LDFLAGS@ @ADIOSLIB_LDADD@ @LDFLAGS@ @LIBS@" + +# Flags to build code using ADIOS read API only +ADIOSREAD_INC="-I${ADIOS_DIR}/include @ADIOSREADLIB_CPPFLAGS@ @ADIOSREADLIB_CFLAGS@" +ADIOSREAD_V1_INC="-I${ADIOS_DIR}/include @MACRODEFFLAG@ADIOS_USE_READ_API_1 @ADIOSREADLIB_CPPFLAGS@ @ADIOSREADLIB_CFLAGS@" +ADIOSREAD_CLIB="-L${ADIOS_DIR}/lib -ladiosread @ADIOSREADLIB_LDFLAGS@ @ADIOSREADLIB_LDADD@" +ADIOSREAD_FLIB="-L${ADIOS_DIR}/lib -ladiosreadf @ADIOSREADLIB_LDFLAGS@ @ADIOSREADLIB_LDADD@" +ADIOSREAD_V1_FLIB="-L${ADIOS_DIR}/lib -ladiosreadf_v1 @ADIOSREADLIB_LDFLAGS@ @ADIOSREADLIB_LDADD@" + +# Flags to build code using ADIOS read API only in a sequential code (no MPI) +ADIOSREAD_SEQ_INC="-I${ADIOS_DIR}/include @ADIOSREADLIB_SEQ_CPPFLAGS@ @ADIOSREADLIB_SEQ_CFLAGS@" +ADIOSREAD_SEQ_V1_INC="-I${ADIOS_DIR}/include @MACRODEFFLAG@ADIOS_USE_READ_API_1 @ADIOSREADLIB_SEQ_CPPFLAGS@ @ADIOSREADLIB_SEQ_CFLAGS@" +ADIOSREAD_SEQ_CLIB="-L${ADIOS_DIR}/lib -ladiosread_nompi @ADIOSREADLIB_SEQ_LDFLAGS@ @ADIOSREADLIB_SEQ_LDADD@" +ADIOSREAD_SEQ_FLIB="-L${ADIOS_DIR}/lib -ladiosreadf_nompi @ADIOSREADLIB_SEQ_LDFLAGS@ @ADIOSREADLIB_SEQ_LDADD@" +ADIOSREAD_SEQ_V1_FLIB="-L${ADIOS_DIR}/lib -ladiosreadf_nompi_v1 @ADIOSREADLIB_SEQ_LDFLAGS@ @ADIOSREADLIB_SEQ_LDADD@" + +#Flags to build code using ADIOS write API in a sequential code (no MPI) +ADIOS_SEQ_INC="-I${ADIOS_DIR}/include @ADIOSLIB_SEQ_CPPFLAGS@ @ADIOSLIB_SEQ_CFLAGS@" +ADIOS_SEQ_CLIB="-L${ADIOS_DIR}/lib -ladios_nompi @ADIOSLIB_SEQ_LDFLAGS@ @ADIOSLIB_SEQ_LDADD@ @LDFLAGS@ @LIBS@" +ADIOS_SEQ_FLIB="-L${ADIOS_DIR}/lib -ladiosf_nompi @ADIOSLIB_SEQ_LDFLAGS@ @ADIOSLIB_SEQ_LDADD@ @LDFLAGS@ @LIBS@" +ADIOS_SEQ_V1_FLIB="-L${ADIOS_DIR}/lib -ladiosf_nompi_v1 @ADIOSLIB_SEQ_LDFLAGS@ @ADIOSLIB_SEQ_LDADD@ @LDFLAGS@ @LIBS@" + +#The following flags are not used. It is only for internal utilities of ADIOS, using libadios_internal_nompi.a +ADIOS_INT_INC="-I${ADIOS_DIR}/include @ADIOSLIB_INT_CPPFLAGS@ @ADIOSLIB_INT_CFLAGS@" +ADIOS_INT_CLIB="-L${ADIOS_DIR}/lib -ladios_internal_nompi @ADIOSLIB_INT_LDFLAGS@ @ADIOSLIB_INT_LDADD@ @LDFLAGS@ @LIBS@" + +VERSIONSTRING="@VERSION@" + diff --git a/tests/libs/adios/adios_config.in b/tests/libs/adios/adios_config.in new file mode 100755 index 0000000000..78df4568cc --- /dev/null +++ b/tests/libs/adios/adios_config.in @@ -0,0 +1,242 @@ +#!/bin/bash +# +# Print compiler/linker flags to use ADIOS + +# +# Configuration values from configure script +# + +MYDIR=`dirname $0` + +prefix="@prefix@" +FLAGSFILE="@sysconfdir@/adios_config.flags" +if [ ! -f ${FLAGSFILE} ]; then + FLAGSFILE2=${MYDIR}/adios_config.flags + if [ ! -f ${FLAGSFILE2} ]; then + echo "ERROR: settings file ${FLAGSFILE} not found." + exit 1 + else + FLAGSFILE=${FLAGSFILE2} + fi +fi +. ${FLAGSFILE} + +GITSTATFILE=@sysconfdir@/adios_git_status +if [ ! -f ${GITSTATFILE} ]; then + GITSTATFILE=${MYDIR}/adios_git_status +fi +if [ -f ${GITSTATFILE} ]; then + . ${GITSTATFILE} +fi + + + +function Usage () { + echo "`basename $0` [-d | -c | -l] [-f] [-r] [-s] [-1] [-m] [-v] [-i] +Arguments + -d Base directory for ADIOS install + -c Compiler flags for C/C++, using ADIOS write/read methods + -l Linker flags for C/C++, using ADIOS write/read methods + + -f Print above flags for Fortran90 + -r Print above flags for using ADIOS read library only. + -s Print above flags for using ADIOS in a sequential code (no MPI). + -1 Print above flags for using old Read API of ADIOS. + + -m Print available write/read methods and data transformation methods + + -v Version of the installed package + -i More installation information about the package + +Notes + - Multiple options of d,c,l are enabled. In such a case, the output is + a list of FLAG=flags, where FLAG is one of (DIR, CFLAGS, LDFLAGS) + - If none of d,c,l are given, all of them is printed + - If none of f,r,s are given, flags for C/C++, using ADIOS write/read + methods are printed + - -m can be combined with -r (readonly libraries) and -s (sequential libraries) +" +} + +# default +PRINT_DIR=no +PRINT_CFLAGS=no +PRINT_LDFLAGS=no +OPT_FORTRAN=no +OPT_READ=no +OPT_SEQ=no +NFLAGS_ASKED=0 +PRINT_METHODS=no + +while getopts ":dclfrs1mvih" Option +do + case $Option in + d) PRINT_DIR=yes; let "NFLAGS_ASKED=NFLAGS_ASKED+1";; + c) PRINT_CFLAGS=yes; let "NFLAGS_ASKED=NFLAGS_ASKED+1";; + l) PRINT_LDFLAGS=yes; let "NFLAGS_ASKED=NFLAGS_ASKED+1";; + f) OPT_FORTRAN=yes;; + r) OPT_READ=yes;; + s) OPT_SEQ=yes;; + 1) OPT_V1=yes;; + m) PRINT_METHODS=yes; let "NFLAGS_ASKED=NFLAGS_ASKED+1";; + v) echo "$VERSIONSTRING"; + exit 0;; + i) echo "ADIOS $VERSIONSTRING"; + echo "Installed from source directory: $SRCDIR"; + if [ ! -z "$GITLOG" ]; then echo "$GITLOG"; fi + if [ ! -z "$GITSTAT" ]; then echo "Git status of source directory:"; echo "$GITSTAT"; fi + exit 0;; + h) Usage; exit 0;; + *) echo "Invalid option -$Option."; Usage; exit 255;; # DEFAULT + esac +done +shift $(($OPTIND - 1)) + +if [ $NFLAGS_ASKED == 0 ]; then + NFLAGS_ASKED=4; + PRINT_DIR=yes + PRINT_CFLAGS=yes + PRINT_LDFLAGS=yes + PRINT_METHODS=yes +fi + +#if [ "$OPT_SEQ" == "yes" ]; then +# OPT_READ=yes +#fi + +# Print requested values +if [ "$PRINT_DIR" == "yes" ]; then + if [ $NFLAGS_ASKED -gt 1 ]; then + echo -n "DIR=" + fi + echo $ADIOS_DIR +fi + +if [ "$PRINT_CFLAGS" == "yes" ]; then + if [ "$OPT_READ" == "yes" ]; then + if [ "$OPT_SEQ" == "yes" ]; then + if [ "$OPT_V1" == "yes" ]; then + CFLAGS="$ADIOSREAD_SEQ_V1_INC" + else + CFLAGS="$ADIOSREAD_SEQ_INC" + fi + else + if [ "$OPT_V1" == "yes" ]; then + CFLAGS="$ADIOSREAD_V1_INC" + else + CFLAGS="$ADIOSREAD_INC" + fi + fi + else + if [ "$OPT_SEQ" == "yes" ]; then + CFLAGS="$ADIOS_SEQ_INC" + else + CFLAGS="$ADIOS_INC" + fi + fi + if [ $NFLAGS_ASKED -gt 1 ]; then + echo -n "CFLAGS=" + fi + echo $CFLAGS +fi + +if [ "$PRINT_LDFLAGS" == "yes" ]; then + if [ "$OPT_SEQ" == "yes" ]; then + if [ "$OPT_READ" == "yes" ]; then + # ADIOSREAD + SEQ + if [ "$OPT_FORTRAN" == "yes" ]; then + if [ "$OPT_V1" == "yes" ]; then + LDFLAGS="$ADIOSREAD_SEQ_V1_FLIB" + else + LDFLAGS="$ADIOSREAD_SEQ_FLIB" + fi + else + LDFLAGS="$ADIOSREAD_SEQ_CLIB" + fi + else # ADIOS + SEQ + if [ "$OPT_FORTRAN" == "yes" ]; then + if [ "$OPT_V1" == "yes" ]; then + LDFLAGS="$ADIOS_SEQ_V1_FLIB" + else + LDFLAGS="$ADIOS_SEQ_FLIB" + fi + else + LDFLAGS="$ADIOS_SEQ_CLIB" + fi + fi + elif [ "$OPT_READ" == "yes" ]; then + # ADIOSREAD + parallel code + if [ "$OPT_FORTRAN" == "yes" ]; then + if [ "$OPT_V1" == "yes" ]; then + LDFLAGS="$ADIOSREAD_V1_FLIB" + else + LDFLAGS="$ADIOSREAD_FLIB" + fi + else + LDFLAGS="$ADIOSREAD_CLIB" + fi + else + # ADIOS + parallel code + if [ "$OPT_FORTRAN" == "yes" ]; then + if [ "$OPT_V1" == "yes" ]; then + LDFLAGS="$ADIOS_V1_FLIB" + else + LDFLAGS="$ADIOS_FLIB" + fi + else + LDFLAGS="$ADIOS_CLIB" + fi + fi + if [ $NFLAGS_ASKED -gt 1 ]; then + echo -n "LDFLAGS=" + fi + echo $LDFLAGS +fi + + +if [ "$PRINT_METHODS" == "yes" ]; then + if [ "$OPT_SEQ" == "yes" ]; then + if [ "$OPT_READ" == "yes" ]; then + # ADIOSREAD + SEQ + if [ -x ${MYDIR}/list_methods_readonly_nompi ]; then + ${MYDIR}/list_methods_readonly_nompi + elif [ -x ./utils/list_methods/list_methods_readonly_nompi ]; then + ./utils/list_methods/list_methods_readonly_nompi + else + echo "ERROR: cannot find executable list_methods_readonly_nompi" + fi + else + # ADIOS + SEQ + if [ -x ${MYDIR}/list_methods_nompi ]; then + ${MYDIR}/list_methods_nompi + elif [ -x ./utils/list_methods/list_methods_nompi ]; then + ./utils/list_methods/list_methods_nompi + else + echo "ERROR: cannot find executable list_methods_nompi" + fi + fi + else + if [ "$OPT_READ" == "yes" ]; then + # ADIOSREAD + if [ -x ${MYDIR}/list_methods_readonly ]; then + ${MYDIR}/list_methods_readonly + elif [ -x ./utils/list_methods/list_methods_readonly ]; then + ./utils/list_methods/list_methods_readonly + else + echo "ERROR: cannot find executable list_methods_readonly" + fi + else + # ADIOS + if [ -x ${MYDIR}/list_methods ]; then + ${MYDIR}/list_methods + elif [ -x ./utils/list_methods/list_methods ]; then + ./utils/list_methods/list_methods + else + echo "ERROR: cannot find executable list_methods" + fi + fi + fi +fi + + + diff --git a/tests/libs/adios/bootstrap b/tests/libs/adios/bootstrap new file mode 120000 index 0000000000..b17b398013 --- /dev/null +++ b/tests/libs/adios/bootstrap @@ -0,0 +1 @@ +../../bootstrap \ No newline at end of file diff --git a/tests/libs/adios/cmake_init b/tests/libs/adios/cmake_init new file mode 100755 index 0000000000..cec51e7dbb --- /dev/null +++ b/tests/libs/adios/cmake_init @@ -0,0 +1,621 @@ +#!/bin/bash +# +# This script is for configuring adios on the authors' machines +# You can study it to figure out how to configure adios on your system +# + +if [ `hostname | cut -c 1-4` == "sith" ]; then + + ######## + # Sith # + ######## + source /etc/profile.d/modules.sh + TARGET=`module list 2>&1 | grep "PE"- | sed "s/^.*PE-\([a-z]*\).*/\1/"` + + if [ -z "$TARGET" ]; then + echo "Cannot determine Programming environment. Exit" + exit 1 + fi + echo "Configure on SITH for $TARGET env." + source /etc/profile.d/modules.sh + module unload hdf5 + module unload netcdf + module unload PE-gnu + module unload PE-pgi + module unload PE-intel + module unload PE-pathscale + module unload pgi gcc intel pathscale + module unload python + module load PE-$TARGET + module load mxml + module load python + module load szip + module load bzip2 + export LUSTRE_DIR="/usr/lib64" +# export FGR_DIR="/ccs/proj/e2e/qliu/tap" + export GLIB_DIR="/ccs/proj/e2e/qliu/glib" + export BUILD_WRITE=ON + export BUILD_FORTRAN=ON + export adios_timers=ON + export research_transports=ON + export CC=mpicc + export CXX=mpiCC + export FC=mpif90 + export INSTALL_PREFIX="/ccs/home/jya/ADIOS/sith.$TARGET" + export APLOD_DIR="/ccs/proj/e2e/ncsu/sith.gnu" + export ISOBAR_DIR="/ccs/proj/e2e/ncsu/sith.gnu" + export ALACRITY_DIR + export NCSU_TIMER_DIR + if [ "$TARGET" == "pgi" ]; then + module load hdf5/1.8.10 + export SEQ_HDF5_DIR=$HDF5_DIR + export SEQ_HDF5_LIBS="-L/sw/sith/hdf5/1.8.10/rhel6_pgi12.8/lib -L/sw/sith/szip/2.1/rhel6_pgi12.8/lib -lhdf5_hl -lhdf5 -lsz -lz -lm" + module unload hdf5/1.8.10 + module load hdf5/1.8.10_par + export PAR_HDF5_DIR=$HDF5_DIR + export PAR_HDF5_LIBS="-L/sw/sith/hdf5/1.8.10/rhel6_pgi13.4_ompi1.6.3/lib -L/sw/sith/szip/2.1/rhel6_pgi13.4/lib -lhdf5_hl -lhdf5 -lsz -lz -lm" + module unload hdf5/1.8.10_par + module load netcdf/4.1.3 + export SEQ_NC_DIR=$NETCDF_DIR + export SEQ_NC_LIBS="-L/sw/sith/netcdf/4.1.3/rhel6_pgi12.8/lib -L/sw/sith/hdf5/1.8.10/rhel6_pgi12.8/lib -L/sw/sith/szip/2.1/rhel6_pgi12.8/lib -lnetcdf -lcurl -lhdf5_hl -lhdf5 -lsz -lz -lm" + module unload netcdf/4.1.3 + module load netcdf/4.1.3_par + export PAR_NC_DIR=$NETCDF_DIR + export PAR_NC_LIBS="-L/sw/sith/netcdf/4.1.3/rhel6_pgi13.4_ompi1.6.3/lib -L/sw/sith/hdf5/1.8.10/rhel6_pgi13.4_ompi1.6.3/lib -L/sw/sith/szip/2.1/rhel6_pgi13.4/lib -lnetcdf -lcurl -lhdf5_hl -lhdf5 -lsz -lz -lm" + module unload netcdf/4.1.3_par + + export DATASPACES_DIR="/ccs/proj/e2e/dataspaces/sith/$TARGET" + export FLEXPATH_DIR="/ccs/proj/e2e/chaos/sith/$TARGET" + export FASTBIT_DIR="/sw/redhat6/fastbit/svn/rhel6_gnu4.7.2" + elif [ "$TARGET" == "gnu" ]; then + module load hdf5/1.8.10 + export SEQ_HDF5_DIR=$HDF5_DIR + export SEQ_HDF5_LIBS="-L/sw/sith/hdf5/1.8.10/rhel6_gnu4.7.1/lib -lhdf5_hl -lhdf5 -L/sw/sith/szip/2.1/rhel6_gnu4.7.1/lib -lsz -lz -lm" + module unload hdf5/1.8.10 + module load hdf5/1.8.10_par + export PAR_HDF5_DIR=$HDF5_DIR + export PAR_HDF5_LIBS="-L/sw/sith/hdf5/1.8.10/rhel6_gnu4.7.1_ompi1.6.3/lib -lhdf5_hl -lhdf5 -L/sw/sith/szip/2.1/rhel6_gnu4.7.1/lib -lsz -lz -lm" + module unload hdf5/1.8.10_par + module load netcdf/4.1.3 + export SEQ_NC_DIR=$NETCDF_DIR + export SEQ_NC_LIBS="-L/sw/sith/netcdf/4.1.3/rhel6_gnu4.7.1/lib -L/sw/sith/hdf5/1.8.10/rhel6_gnu4.7.1/lib -L/sw/sith/szip/2.1/rhel6_gnu4.7.1/lib -lnetcdf -lm -lcurl -lhdf5_hl -lhdf5 -lsz -lz -lm" + module unload netcdf/4.1.3 +# module load netcdf/4.1.3_par +# export PAR_NC_DIR=$NETCDF_DIR +# export PAR_NC_LIBS="" +# module unload netcdf/4.1.3_par +# export DATASPACES_DIR="/ccs/proj/e2e/dataspaces/sith/$TARGET" + export FLEXPATH_DIR="/ccs/proj/e2e/chaos/sith/$TARGET" + export FASTBIT_DIR="/sw/redhat6/fastbit/svn/rhel6_gnu4.7.2" + elif [ "$TARGET" == "intel" ]; then + module load hdf5/1.8.10 + export SEQ_HDF5_DIR=$HDF5_DIR + export SEQ_HDF5_LIBS="-L/sw/sith/hdf5/1.8.10/rhel6_intel11.1/lib -lhdf5_hl -lhdf5 -L/sw/sith/szip/2.1/rhel6_intel11.1.072/lib -lsz -lz -lm" + module unload hdf5/1.8.10 + module load hdf5/1.8.10_par + export PAR_HDF5_DIR=$HDF5_DIR + export PAR_HDF5_LIBS="-L/sw/sith/hdf5/1.8.10/rhel6_intel11.1_ompi1.6.3/lib -lhdf5_hl -lhdf5 -L/sw/sith/szip/2.1/rhel6_intel11.1.072/lib -lsz -lz -lm" + module unload hdf5/1.8.10_par + module load netcdf/4.1.3 + export SEQ_NC_DIR=$NETCDF_DIR + export SEQ_NC_LIBS="-L/sw/sith/netcdf/4.1.3/rhel6_intel11.1/lib -L/sw/sith/hdf5/1.8.10/rhel6_intel11.1/lib -L/sw/sith/szip/2.1/rhel6_intel11.1.072/lib -lnetcdf -lm -lcurl -lhdf5_hl -lhdf5 -lsz -lz -lm" + module unload netcdf/4.1.3 +# module load netcdf/4.1.3_par +# export PAR_NC_DIR=$NETCDF_DIR +# export PAR_NC_LIBS="" +# module unload netcdf/4.1.3_par +# export DATASPACES_DIR="/ccs/proj/e2e/dataspaces/sith/$TARGET" + export FLEXPATH_DIR= + else + echo "TARGET must be pgi or gnu or intel" + exit 1 + fi + + export CPPFLAGS="-DMPICH_IGNORE_CXX_SEEK" + export CFLAGS="-g -fPIC" + + +elif [ `hostname | cut -c 1-4` == "lens" ]; then + source /etc/profile.d/modules.sh + source /etc/profile.d/modules.sh + TARGET=`module list 2>&1 | grep "PE"- | sed "s/^.*PE-\([a-z]*\).*/\1/"` + + if [ -z "$TARGET" ]; then + echo "Cannot determine Programming environment. Exit" + exit 1 + fi + echo "Configure on LENS for $TARGET env." + module unload hdf5 + module unload netcdf + module unload PE-gnu + module unload PE-pgi + module unload PE-pathscale + module unload pgi + module load PE-$TARGET + module load mxml + # Use both seq hdf5 (for utils) and + # parallel hdf5 (for PHDF5 method) +# module load hdf5/1.8.6 +# export SEQ_HDF5_DIR=$HDF5_DIR +# export SEQ_HDF5_CLIB=$HDF5_CLIB +# module unload hdf5 +# module load hdf5/1.8.6_ompi1.4.2 +# export PAR_HDF5_DIR=$HDF5_DIR +# export PAR_HDF5_CLIB=$HDF5_CLIB +# module unload hdf5 + # Seq NetCDF 3 for bp2ncd + module unload netcdf + module load netcdf/4.1.3 + export SEQ_NC_DIR=$NETCDF_DIR + module unload netcdf +# module load netcdf/4.1.1_ompi1.3.1 +# export PAR_NC_DIR=$NETCDF_DIR +# module unload netcdf + + export BUILD_WRITE=ON + export BUILD_FORTRAN=ON + export adios_timers=ON + export INSTALL_PREFIX="/ccs/home/jya/ADIOS/lens.$TARGET" + export CC=mpicc + export CXX=mpiCC + export FC=mpif90 + if [ "$TARGET" == "pgi" ]; then +# export CC=pgcc +# export CXX=pgCC +# export FC=pgf90 + module switch pgi pgi/10.5 + elif [ "$TARGET" == "gnu" ]; then +# export CC=gcc +# export CXX=g++ +# export FC=gfortran + module unload PE-pgi + module load PE-gnu + else + echo "TARGET must be pgi or gnu" + exit 1 + fi + + export CFLAGS="-g -fPIC" + + +elif [ `hostname | cut -c 1-5` == "titan" ]; then + + BUILD_STAGING=true + if [ $BUILD_STAGING == "false" ]; then + + ################ + # Titan # + ################ + TARGET=pgi + echo "Configure on TITAN (XK7) for $TARGET env." + #export CFLAGS="-Wall -g" + source /opt/modules/default/etc/modules.sh + module unload szip + module unload hdf5 + module unload netcdf + module unload netcdf-hdf5parallel + module unload hdf5-parallel + module unload mxml + module unload PrgEnv-gnu + module unload PrgEnv-pgi + module unload PrgEnv-intel + module unload PrgEnv-cray + module load PrgEnv-$TARGET + module load craype-target-compute_node + module load craype-interlagos + module load cmake + export CRAYPE_LINK_TYPE=static + module load cray-mpich + module load szip + module load mxml + export CRAY_UGNI_DIR="/opt/cray/ugni/4.0-1.0401.5928.9.5.gem" + export CRAY_PMI_DIR="/opt/cray/pmi/4.0.1-1.0000.9421.73.3.gem" + export LUSTRE_DIR="/usr/lib64" + export BUILD_WRITE=ON + export BUILD_FORTRAN=ON + export CFLAGS="-g -fPIC -O0" + export adios_timers=ON + export INSTALL_PREFIX="/ccs/home/jya/ADIOS/titan.$TARGET" + + else + + ########################## + # Titan + staging # + ########################## + TARGET=pgi + echo "Configure on TITAN (XK7) including staging methods for $TARGET env." + source /opt/modules/default/etc/modules.sh + module unload szip + module unload hdf5 + module unload netcdf + module unload hdf5-parallel + module unload netcdf-hdf5parallel + module unload mxml + module unload PrgEnv-gnu + module unload PrgEnv-pgi + module unload PrgEnv-intel + module unload PrgEnv-cray + module load PrgEnv-$TARGET + module load craype-target-compute_node + module load craype-interlagos + module load cmake + export CRAYPE_LINK_TYPE=static + module load cray-mpich + module load cray-netcdf-hdf5parallel + module load mxml + module load szip + + unset EXTRA_LIBS + unset LDFLAGS + export PAR_HDF5_DIR=$HDF5_DIR + export PAR_HDF5_LIBS=${HDF5_DIR}/lib/libhdf5_parallel.a + export PAR_NC_DIR=${NETCDF_DIR} + export PAR_NC_LIBS=${NETCDF_DIR}/lib/libnetcdf_parallel.a + export LUSTRE_DIR=/usr/lib64 + export BZIP2_DIR=${SYSROOT_DIR}/usr + if [ "$TARGET" == "pgi" ]; then + module load dataspaces/1.4.0 + export DATASPACES_LIBDIR=${DATASPACES_DIR}/lib + export LDFLAGS="-pgcpplibs -Wl,-Bstatic" +# export FLEXPATH_DIR="/ccs/proj/e2e/chaos/titan/$TAGET" + export EXTRA_LIBS="/opt/gcc/4.8.2/snos/lib64/libstdc++.a" + elif [ "$TARGET" == "gnu" ]; then + # currently dependencies are not available for > 4.7.2 + module load gcc/4.7.2 + module load dataspaces/1.4.0 + export DATASPACES_DIR=$DATASPACES_DIR + export FLEXPATH_DIR="/ccs/proj/e2e/chaos/titan/gnu" +# module load fastbit/svn +# export FASTBIT_DIR=$FASTBIT_DIR + # NSSI needs libstdc++ + export EXTRA_LIBS="${GCC_PATH}/snos/lib64/libstdc++.a" + else + unset DATASPACES_DIR + fi + + # NOTE hdf5-parallel module does not work with C++ compiler + # use the two lines below for openmpi + export CRAY_UGNI_DIR="/opt/cray/ugni/default" + export CRAY_PMI_DIR="/opt/cray/pmi/default" + export BUILD_WRITE=ON + export BUILD_FORTRAN=ON + export CFLAGS="-g -fPIC -O0" + export CPPFLAGS="-DMPICH_IGNORE_CXX_SEEK -DDART_DO_VERSIONING" + export adios_timers=ON + export INSTALL_PREFIX="/ccs/home/jya/ADIOS/titan.$TARGET" + fi + + +elif [ `hostname | cut -c 1-4` == "eos-" ]; then + + ################# + # EOS Cray XC30 # + ################# + TARGET=`module list 2>&1 | grep "PrgEnv"- | sed "s/^.*PrgEnv-\([a-z]*\).*/\1/"` + echo "Configure on EOS (Cray XC30) for $TARGET env." + #export CFLAGS="-Wall -g" + source /opt/modules/default/etc/modules.sh + module unload szip + module unload hdf5 + module unload netcdf + module unload netcdf-hdf5parallel + module unload hdf5-parallel + module unload mxml + module unload PrgEnv-gnu + module unload PrgEnv-pgi + module unload PrgEnv-intel + module unload PrgEnv-cray + module load PrgEnv-$TARGET + module load craype-target-compute_node + module load cmake + export CRAYPE_LINK_TYPE=static + module load cray-mpich + module load mxml + export BUILD_WRITE=ON + export BUILD_FORTRAN=ON + if [ "$TARGET" == "pgi" ]; then + # NSSI needs -pgcpplibs flag + export LDFLAGS="-pgcpplibs" + unset EXTRA_LIBS + elif [ "$TARGET" == "gnu" ]; then + # NSSI needs libstdc++ + unset LDFLAGS + export EXTRA_LIBS="/opt/gcc/4.8.1/snos/lib64/libstdc++.a" + module swap gcc gcc/4.8.1 + elif [ "$TARGET" == "intel" ]; then + export LDFLAGS= + else + unset LDFLAGS + unset EXTRA_LIBS + fi + module load mxml + module load pmi + export CFLAGS="-g -fPIC" + export INSTALL_PREFIX="/ccs/home/jya/ADIOS/eos.$TARGET" + + +elif [ `hostname | cut -c 1-7` == "chester" ]; then + + ############### + # Chester XK6 # + ############### + TARGET=`module list 2>&1 | grep "PrgEnv"- | sed "s/^.*PrgEnv-\([a-z]*\).*/\1/"` + echo "Configure on Chester (XK6) for $TARGET env." + #export CFLAGS="-Wall -g" + source /opt/modules/default/etc/modules.sh + module unload szip + module unload hdf5 + module unload netcdf + module unload netcdf-hdf5parallel + module unload hdf5-parallel + module unload PrgEnv-gnu + module unload PrgEnv-pgi + module unload PrgEnv-intel + module unload PrgEnv-cray + module unload papi + module unload pmi + module unload ugni + module load PrgEnv-$TARGET + module load craype-target-compute_node + module load cmake + export CRAYPE_LINK_TYPE=static + module load cray-mpich + module load cray-netcdf-hdf5parallel + module load mxml + module load szip + module load pmi + module load ugni + export PAR_HDF5_DIR=$HDF5_DIR + export PAR_HDF5_LIBS=${HDF5_DIR}/lib/libhdf5_parallel.a + export PAR_NC_DIR=${NETCDF_DIR} + export PAR_NC_LIBS=${NETCDF_DIR}/lib/libnetcdf_parallel.a + export LUSTRE_DIR=/usr/lib64 + export BZIP2_DIR=${SYSROOT_DIR}/usr + export CRAY_PMI_DIR=$(echo "${CRAY_PMI_POST_LINK_OPTS}" | sed 's|.*-L\([^ ]*\)/lib64.*|\1|') + export CRAY_UGNI_DIR=$(echo "${CRAY_UGNI_POST_LINK_OPTS}" | sed 's|.*-L\([^ ]*\)/lib64.*|\1|') + export BUILD_WRITE=ON + export BUILD_FORTRAN=ON + if [ "$TARGET" == "pgi" ]; then + # NSSI needs -pgcpplibs flag + export LDFLAGS="-pgcpplibs" + module load dataspaces/1.4.0 + export DATASPACES_LIBDIR=${DATASPACES_DIR}/lib + unset EXTRA_LIBS + elif [ "$TARGET" == "gnu" ]; then + # NSSI needs libstdc++ + unset LDFLAGS + export EXTRA_LIBS="/opt/gcc/4.7.1/snos/lib64/libstdc++.a" + module load dataspaces/1.4.0 + export DATASPACES_LIBDIR=${DATASPACES_DIR}/lib + #module swap gcc gcc/4.4.4 + else + unset LDFLAGS + unset EXTRA_LIBS +# WITHDART="" + fi + export CFLAGS="-g -fPIC" + + +elif [ "x"`hostname -f | cut -c 8-15` == "xintrepid" ]; then + ##################### + # Intrepid BlueGene # + ##################### + echo "Configure on Intrepid (BlueGene)" + export CC=mpixlc_r + export FC=mpixlf90 + export CFLAGS="" +# export FC=xlf90 +# export CC=xlc_r + export MXML_DIR=/home/jya/mxml + + +elif [ `hostname | cut -c 1-4` == "nid0" ]; then + ############ + # Franklin # + ############ + TARGET=pgi + echo "Configure on FRANKLIN for $TARGET env." + export CC=cc + export CXX=CC + export FC=ftn + module unload hdf5 + module unload netcdf + module unload hdf5-parallel + module unload netcdf-hdf5parallel + module unload PrgEnv-gnu + module unload PrgEnv-pgi + module unload PrgEnv-pathscale + module unload PrgEnv-cray + module load PrgEnv-$TARGET + #if [ "${TARGET}" == "pgi" ]; then + # module swap pgi pgi/10.5.0 + #fi + export LDFLAGS="-pgcpplibs" + export CPPFLAGS="-DMPICH_IGNORE_CXX_SEEK" + export CFLAGS="-fPIC" + + +elif [ `hostname | cut -c 1-6` == "hopper" ]; then + ########## + # Hopper # + ########## + TARGET=pgi + echo "Configure on HOPPER for $TARGET env." + export CC=cc + export CXX=CC + export FC=ftn + module unload hdf5 + module unload netcdf + module unload hdf5-parallel + module unload netcdf-hdf5parallel + module unload PrgEnv-gnu + module unload PrgEnv-pgi + module unload PrgEnv-pathscale + module unload PrgEnv-cray + TARGET=pgi + module load PrgEnv-$TARGET + module load python + if [ "$TARGET" == "pgi" ]; then + export LDFLAGS="-pgcpplibs" + elif [ "$TARGET" == "gnu" ]; then + export LDFLAGS="" + elif [ "$TARGET" == "intel" ]; then + export LDFLAGS="" + else + echo "TARGET must be pgi or gnu or intel" + exit 1 + fi + export CPPFLAGS="-DMPICH_IGNORE_CXX_SEEK" + export CFLAGS="-fPIC" + + +elif [ `hostname | cut -c 1-6` == "kraken" ]; then + ########## + # Kraken # + ########## + source /opt/modules/default/etc/modules.sh + TARGET=`module list 2>&1 | grep PrgEnv | sed "s/^.*Env-\([a-z]*\).*/\1/"` + + if [ -z "$TARGET" ]; then + echo "Cannot determine Programming environment. Exit" + exit 1 + fi + echo "" + echo "Configure KRAKEN for the $TARGET compiler" + echo "" + export CC=cc + export FC=ftn + export CXX=CC + module unload szip + module unload hdf5 + module unload netcdf + module unload hdf5-parallel + module unload netcdf-hdf5parallel + module unload xt-papi + module unload papi + if [ "$TARGET" == "pgi" ]; then + #module swap pgi pgi/10.4.0 + # NSSI needs -pgcpplibs flag + export EXTRA_LIBS="" + export LDFLAGS="-pgcpplibs" + elif [ "$TARGET" == "gnu" ]; then + # NSSI needs libstdc++ + export EXTRA_LIBS="/opt/gcc/4.4.4/snos/lib64/libstdc++.a" + export LDFLAGS="" + #module swap gcc gcc/4.4.4 + fi + + module load szip + module load mxml + module load subversion + export CPPFLAGS="-DMPICH_IGNORE_CXX_SEEK" + export CFLAGS="-fPIC -g -O0" + + +elif [ `hostname | cut -c 1-4` == "dyn9" -o `hostname | cut -c 1-3` == "pnb" ]; then + + ####### + # Mac # + ####### + echo "Configure on Mac" + # Installed MacPorts and GCC4.4 and OpenMPI 1.4.2 ports + # But should work with default mpicc and gcc, using --disable-fortran +# export CC=/opt/local/bin/gcc-mp-4.4 +# export FC=/opt/local/bin/gfortran-mp-4.4 +# export CXX=/opt/local/bin/g++-mp-4.4 + export CC=/opt/local/bin/openmpicc + export FC=/opt/local/bin/openmpif90 + export CXX=/opt/local/bin/openmpicxx + CFLAGS="-g -DO_LARGEFILE=0 -fno-common" + export BUILD_WRITE=ON + export BUILD_FORTRAN=ON + export adios_timers=ON + export INSTALL_PREFIX="/opt/adios" +# --with-mxml=/opt/mxml \ +# --with-netcdf=/opt/netcdf \ +# --with-phdf5=/opt/hdf5 \ +# --with-hdf5=/opt/hdf5.seq + + +elif [ `hostname | cut -c 1-7` == "ubuntu" ]; then + + ######################### + # Scott's ubuntu laptop # + ######################### + echo "Configure on UBUNTU" + export CC=mpicc + + +elif [ `hostname | cut -c 1-6` == "tomato" ]; then + + ######################### + # Todd's ubuntu laptop # + ######################### + echo "Configure on UBUNTU" + export CC=mpicc + + +elif [ `hostname | cut -c 1-4` == "qliu" ]; then + + ######################### + # Gary's ubuntu laptop # + ######################### + echo "Configure on UBUNTU" + export CC=mpicc + export CFLAGS="-g -O0 -fPIC" + +elif [ `hostname | cut -c 1-7` == "esimmon" ]; then + + ####################### + # Esimmon Virtual Box # + ####################### + echo "Configure on ESIMMON VirtualBox ." + export BUILD_WRITE=ON + export BUILD_FORTRAN=ON + export adios_timers=ON + export CC=mpicc + export CXX=mpicxx + export FC=mpif90 + export INSTALL_PREFIX="/opt/adios/1.5.0" + export CPPFLAGS="-DMPICH_IGNORE_CXX_SEEK" + export CFLAGS="-g -fPIC" + export MXML_DIR=/opt/mxml + export SEQ_HDF5_DIR=/opt/hdf5 + export SEQ_HDF5_LIBS="-L/opt/hdf5/lib -lhdf5_hl -lhdf5 -lm" + export PAR_HDF5_DIR=/opt/phdf5 + export PAR_HDF5_LIBS="-L/opt/phdf5/lib -lhdf5_hl -lhdf5 -lm" + export SEQ_NC_DIR=/opt/netcdf3 + export SEQ_NC_LIBS="-L/opt/netcdf3/lib -lnetcdf" + export PAR_NC_DIR=/opt/nc4par + export PAR_NC_LIBS="-L/opt/nc4par/lib -lnetcdf" + +elif [ `hostname | cut -c 1-7` == "adiosVM" ]; then + + ####################### + # ADIOS Virtual Box # + ####################### + echo "Configure on adiosVM VirtualBox ." + export BUILD_WRITE=ON + export BUILD_FORTRAN=ON + export adios_timers=ON + export CC=mpicc + export CXX=mpicxx + export FC=mpif90 + export INSTALL_PREFIX="/opt/adios/1.8" + export CPPFLAGS="-DMPICH_IGNORE_CXX_SEEK" + export CFLAGS="-g -O0 -fPIC -Wno-int-to-pointer-cast -Wno-pointer-to-int-cast" + export MXML_DIR=/opt/mxml/2.8 + export SEQ_HDF5_DIR=/opt/hdf5-1.8.12 + export SEQ_HDF5_LIBS="-L/opt/hdf5-1.8.12/lib -lhdf5_hl -lhdf5 -lm" + export PAR_HDF5_DIR=/opt/hdf5-1.8.12-parallel + export PAR_HDF5_LIBS="-L/opt/hdf5-1.8.12-parallel/lib -lhdf5_hl -lhdf5 -lm" + export SEQ_NC_DIR=/opt/netcdf-3.6.3 + export SEQ_NC_LIBS="-L/opt/netcdf-3.6.3/lib -lnetcdf" +else + echo "Could not determine what machine is this." + echo "This script is for configuring adios on the authors' machines." + echo "You can study it to figure out how to configure adios on your system." +fi + + + diff --git a/tests/libs/adios/config.h.cmake b/tests/libs/adios/config.h.cmake new file mode 100644 index 0000000000..7afa509bec --- /dev/null +++ b/tests/libs/adios/config.h.cmake @@ -0,0 +1,334 @@ +/* config.h Generated by cmake with CMakelists.txt. from config.h.cmake */ + +#cmakedefine BUILD_WITH_CMAKE ${BUILD_WITH_CMAKE} + +/* Define to dummy `main' function (if any) required to link to the Fortran + libraries. */ +#cmakedefine FC_DUMMY_MAIN 1 + +/* Define if F77 and FC dummy `main' functions are identical. */ +#cmakedefine FC_DUMMY_MAIN_EQ_F77 1 + +/* Define to a macro mangling the given C identifier (in lower and upper + case), which must not contain underscores, for linking with Fortran. */ +#cmakedefine FC_FUNC ${FC_FUNC} + +/* As FC_FUNC, but for C identifiers containing underscores. */ +#cmakedefine FC_FUNC_ ${FC_FUNC_} + +/* Define to 1 if your Fortran compiler doesn't accept -c and -o together. */ +#cmakedefine FC_NO_MINUS_C_MINUS_O 1 + +/* Define if you have ALACRITY. */ +#cmakedefine HAVE_ALACRITY 1 + +/* Define if you have APLOD. */ +#cmakedefine HAVE_APLOD 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_APLOD_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_ATTRIBUTES_H 1 + +/* Define if you want to enable BGQ method */ +#cmakedefine HAVE_BGQ 1 + +/* Define if you have BZIP2. */ +#cmakedefine HAVE_BZIP2 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_BZLIB_H 1 + +/* Define to 1 if you have the `clock_gettime' function. */ +#cmakedefine HAVE_CLOCK_GETTIME 1 + +/* Define if you have CRAY_PMI. */ +#cmakedefine HAVE_CRAY_PMI 1 + +/* Define if you have Cray Portals. */ +#cmakedefine HAVE_CRAY_PORTALS 1 + +/* Define if you have CRAY_UGNI. */ +#cmakedefine HAVE_CRAY_UGNI 1 + +/* Define if you have the DATASPACES. */ +#cmakedefine HAVE_DATASPACES ${HAVE_DATASPACES} + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_DATASPACES_H ${HAVE_DATASPACES_H} + +/* Define if you have the DCMF. */ +#cmakedefine HAVE_DCMF + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_DCMF_H + +/* Define if you have the DIMES. */ +#define HAVE_DIMES ${HAVE_DIMES} + +/* Define to 1 if you have the header file. */ +#define HAVE_DIMES_INTERFACE_H ${HAVE_DIMES_INTERFACE_H} + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_DLFCN_H 1 + +/* Define if you have DMALLOC. */ +#cmakedefine HAVE_DMALLOC 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_DMALLOC_H 1 + +/* Define if we have libfastbit */ +#cmakedefine HAVE_FASTBIT 1 + +/* Define to 1 if you have the `fdatasync' function. */ +#cmakedefine HAVE_FDATASYNC 1 + +/* Define if you have FGR. */ +#cmakedefine HAVE_FGR 1 + +/* Flexpath is enabled */ +#define HAVE_FLEXPATH ${HAVE_FLEXPATH} + +/* Define to 1 if you have the `gettimeofday' function. */ +#cmakedefine HAVE_GETTIMEOFDAY 1 + +/* Define if you have GLIB. */ +#cmakedefine HAVE_GLIB 1 + +/* Define if you have HDF5. */ +#cmakedefine HAVE_HDF5 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_HDF5_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_IAPI_H 1 + +/* Define to 1 if you have . */ +#cmakedefine HAVE_IBVERBS_H 1 + +#cmakedefine HAVE_IBVERBS 1 + +/* icee is enabled */ +#cmakedefine HAVE_ICEE 1 + +/* Define if you have the Infiniband. */ +#cmakedefine HAVE_INFINIBAND 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_INTTYPES_H 1 + +/* Define if you have ISOBAR. */ +#cmakedefine HAVE_ISOBAR 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_ISOBAR_H 1 + +/* Define to 1 if you have the `rt' library (-lrt). */ +#cmakedefine HAVE_LIBRT 1 + +/* Define if you have LUSTRE. */ +#cmakedefine HAVE_LUSTRE 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_MEMORY_H 1 + +/* Define if you have the MPI library. */ +#cmakedefine HAVE_MPI 1 + +/* Define if you have the MXML. */ +#cmakedefine HAVE_MXML 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_MXML_H 1 + +/* Define to 1 if you have the `nanosleep' function. */ +#cmakedefine HAVE_NANOSLEEP 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_NC4PAR_H 1 + +/* Define if you have libtimer */ +#cmakedefine HAVE_NCSU_TIMER + +/* Define if you have NC4PAR. */ +#cmakedefine HAVE_NC4PAR 1 + +/* Define if you have NETCDF. */ +#cmakedefine HAVE_NETCDF 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_NETCDF_H 1 + +/* Define if you have NSSI. */ +#define HAVE_NSSI ${HAVE_NSSI} + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_P3NAL_UTCP_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_P3RT_P3RT_H 1 + +/* Define if you have the Pablo. */ +#cmakedefine HAVE_PABLO 1 + +/* Define if you have PHDF5. */ +#define HAVE_PHDF5 ${HAVE_PHDF5} + +/* Define to 1 if you have the header file. */ +#define HAVE_PHDF5_H ${HAVE_PHDF5_H} + +/* Define if you have the Portals. */ +#cmakedefine HAVE_PORTALS 1 + +#cmakedefine HAVE_PTLINIT 1 + +/* Define to 1 if you have . */ +#cmakedefine HAVE_PORTALS3_H 1 + +/* Define to 1 if you have . */ +#cmakedefine HAVE_PORTALS_PORTALS3_H 1 + +/* Define if you have POSIX threads libraries and header files. */ +#cmakedefine HAVE_PTHREAD 1 + +/* Define to 1 if you have the `pthread_yield' function. */ +#cmakedefine HAVE_PTHREAD_YIELD 1 + +/* Define to 1 if you have the `PtlACEntry' function. */ +#cmakedefine HAVE_PTLACENTRY 1 + +/* Define to 1 if you have the `PtlErrorStr' function. */ +#cmakedefine HAVE_PTLERRORSTR 1 + +/* Define to 1 if you have the `PtlEventKindStr' function. */ +#cmakedefine HAVE_PTLEVENTKINDSTR 1 + +/* Define to 1 if you have the `PtlGetJid' function. */ +#cmakedefine HAVE_PTLGETJID 1 + +/* Define to 1 if you have the `PtlNIFailStr' function. */ +#cmakedefine HAVE_PTLNIFAILSTR 1 + +/* Define to 1 if the system has the type `ptl_eq_handler_t'. */ +#cmakedefine HAVE_PTL_EQ_HANDLER_T 1 + +/* Define if you have PTL_NOACK_REQ. */ +#cmakedefine HAVE_PTL_NOACK_REQ 1 + +/* Define if you have PTL_NO_ACK_REQ. */ +#cmakedefine HAVE_PTL_NO_ACK_REQ 1 + +/* Define to 1 if the system has the type `ptl_time_t'. */ +#cmakedefine HAVE_PTL_TIME_T 1 + +/* Define if you have RIDCOMPRESS. */ +#cmakedefine HAVE_RIDCOMPRESS 1 + +/* Define to 1 if you have the `sched_yield' function. */ +#cmakedefine HAVE_SCHED_YIELD 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_STDLIB_H 1 + +/* Define to 1 if you have the `strerror' function. */ +#cmakedefine HAVE_STRERROR 1 + +/* Define to 1 if cpp supports the ANSI stringizing operator. */ +#cmakedefine HAVE_STRINGIZE 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_STRING_H 1 + +/* to 1 if you have the `strncpy' function. */ +#cmakedefine HAVE_STRNCPY 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SYS_TYPES_H 1 + +/* Define if you have ZLIB. */ +#cmakedefine HAVE_ZLIB 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_ZLIB_H 1 + +/* Define if you have SZIP. */ +#cmakedefine HAVE_SZIP 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SZLIB_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_UNISTD_H 1 + +/* Define to the sub-directory in which libtool stores uninstalled libraries. */ +#cmakedefine LT_OBJDIR 1 + +/* Datatap is disabled */ +#cmakedefine NO_DATATAP 1 + +/* Flexpath is disabled */ +#cmakedefine NO_FLEXPATH 1 + +/* Define to 1 if your C compiler doesn't accept -c and -o together. */ +#cmakedefine NO_MINUS_C_MINUS_O 1 + +/* Name of package */ +#cmakedefine PACKAGE ${PACKAGE} + +/* Define to the address where bug reports for this package should be sent. */ +#cmakedefine PACKAGE_BUGREPORT ${PACKAGE_BUGREPORT} + +/* Define to the full name of this package. */ +#cmakedefine PACKAGE_NAME ${PACKAGE_NAME} + +/* Define to the full name and version of this package. */ +#cmakedefine PACKAGE_STRING ${PACKAGE_STRING} + +/* Define to the one symbol short name of this package. */ +#cmakedefine PACKAGE_TARNAME ${PACKAGE_TARNAME} + +/* Define to the version of this package. */ +#cmakedefine PACKAGE_VERSION ${PACKAGE_VERSION} + +/* Define to the necessary symbol if this constant uses a non-standard name on + your system. */ +#cmakedefine PTHREAD_CREATE_JOINABLE ${PTHREAD_CREATE_JOINABLE} + +/* ADIOS timing is enabled */ +#cmakedefine ADIOS_TIMERS 1 + +/* research_transports is enabled */ +#define RESEARCH_TRANSPORTS ${RESEARCH_TRANSPORTS} + +/* Define to 1 if you have the ANSI C header files. */ +#cmakedefine STDC_HEADERS 1 + +/* Need to use MPI compiler for sequential utils */ +#cmakedefine USE_PARALLEL_COMPILER 1 + +/* Version number of package */ +#cmakedefine VERSION "${VERSION}" + +/* Major version number */ +#define VERSION_MAJOR ${VERSION_MAJOR} + +/* Micro version number */ +#define VERSION_MICRO ${VERSION_MICRO} + +/* Minor version number */ +#define VERSION_MINOR ${VERSION_MINOR} + +/* svn revision number */ +#cmakedefine VERSION_SVNREV ${VERSION_SVNREV} diff --git a/tests/libs/adios/config.h.in b/tests/libs/adios/config.h.in new file mode 100644 index 0000000000..a5057c96ef --- /dev/null +++ b/tests/libs/adios/config.h.in @@ -0,0 +1,335 @@ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Adios timing is enabled */ +#undef ADIOS_TIMERS + +/* Adios timing events are enabled */ +#undef ADIOS_TIMER_EVENTS + +/* Define to dummy `main' function (if any) required to link to the Fortran + libraries. */ +#undef FC_DUMMY_MAIN + +/* Define if F77 and FC dummy `main' functions are identical. */ +#undef FC_DUMMY_MAIN_EQ_F77 + +/* Define to a macro mangling the given C identifier (in lower and upper + case), which must not contain underscores, for linking with Fortran. */ +#undef FC_FUNC + +/* As FC_FUNC, but for C identifiers containing underscores. */ +#undef FC_FUNC_ + +/* Define to 1 if your Fortran compiler doesn't accept -c and -o together. */ +#undef FC_NO_MINUS_C_MINUS_O + +/* Define if you have ALACRITY. */ +#undef HAVE_ALACRITY + +/* Define if you have APLOD. */ +#undef HAVE_APLOD + +/* Define to 1 if you have the header file. */ +#undef HAVE_APLOD_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_ATTRIBUTES_H + +/* Define if you want to enable BGQ method */ +#undef HAVE_BGQ + +/* Define if you have BZIP2. */ +#undef HAVE_BZIP2 + +/* Define to 1 if you have the header file. */ +#undef HAVE_BZLIB_H + +/* Define to 1 if you have the `clock_gettime' function. */ +#undef HAVE_CLOCK_GETTIME + +/* Define if you have CRAY_PMI. */ +#undef HAVE_CRAY_PMI + +/* Define if you have Cray Portals. */ +#undef HAVE_CRAY_PORTALS + +/* Define if you have CRAY_UGNI. */ +#undef HAVE_CRAY_UGNI + +/* Define if you have the DATASPACES. */ +#undef HAVE_DATASPACES + +/* Define to 1 if you have the header file. */ +#undef HAVE_DATASPACES_H + +/* Define if you have the DCMF. */ +#undef HAVE_DCMF + +/* Define to 1 if you have the header file. */ +#undef HAVE_DCMF_H + +/* Define if you have the DIMES. */ +#undef HAVE_DIMES + +/* Define to 1 if you have the header file. */ +#undef HAVE_DIMES_INTERFACE_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_DLFCN_H + +/* Define if you have DMALLOC. */ +#undef HAVE_DMALLOC + +/* Define to 1 if you have the header file. */ +#undef HAVE_DMALLOC_H + +/* Define if we have libfastbit */ +#undef HAVE_FASTBIT + +/* Define to 1 if you have the `fdatasync' function. */ +#undef HAVE_FDATASYNC + +/* Define if you have FGR. */ +#undef HAVE_FGR + +/* Flexpath is enabled */ +#undef HAVE_FLEXPATH + +/* Define to 1 if you have the `gettimeofday' function. */ +#undef HAVE_GETTIMEOFDAY + +/* Define if you have GLIB. */ +#undef HAVE_GLIB + +/* Define if you have HDF5. */ +#undef HAVE_HDF5 + +/* Define to 1 if you have the header file. */ +#undef HAVE_HDF5_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_IAPI_H + +/* Define to 1 if you have . */ +#undef HAVE_IBVERBS_H + +/* ICEE method is enabled */ +#undef HAVE_ICEE + +/* Define if you have the Infiniband. */ +#undef HAVE_INFINIBAND + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define if you have ISOBAR. */ +#undef HAVE_ISOBAR + +/* Define to 1 if you have the header file. */ +#undef HAVE_ISOBAR_H + +/* Define to 1 if you have the `rt' library (-lrt). */ +#undef HAVE_LIBRT + +/* Define if you have LUSTRE. */ +#undef HAVE_LUSTRE + +/* Define to 1 if you have the header file. */ +#undef HAVE_LUSTRE_LIBLUSTREAPI_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LUSTRE_LUSTREAPI_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define if you have the MPI library. */ +#undef HAVE_MPI + +/* Define if you have the MXML. */ +#undef HAVE_MXML + +/* Define to 1 if you have the header file. */ +#undef HAVE_MXML_H + +/* Define to 1 if you have the `nanosleep' function. */ +#undef HAVE_NANOSLEEP + +/* Define if you have NC4PAR. */ +#undef HAVE_NC4PAR + +/* Define if you have libtimer */ +#undef HAVE_NCSU_TIMER + +/* Define if you have NETCDF. */ +#undef HAVE_NETCDF + +/* Define to 1 if you have the header file. */ +#undef HAVE_NETCDF_H + +/* Define if you have NSSI. */ +#undef HAVE_NSSI + +/* Define to 1 if you have the header file. */ +#undef HAVE_P3NAL_UTCP_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_P3RT_P3RT_H + +/* Define if you have the Pablo. */ +#undef HAVE_PABLO + +/* Define if you have the PAMI. */ +#undef HAVE_PAMI + +/* Define to 1 if you have the header file. */ +#undef HAVE_PAMI_H + +/* Define if you have PHDF5. */ +#undef HAVE_PHDF5 + +/* Define if you have the Portals. */ +#undef HAVE_PORTALS + +/* Define to 1 if you have . */ +#undef HAVE_PORTALS3_H + +/* Define to 1 if you have . */ +#undef HAVE_PORTALS_PORTALS3_H + +/* Define if you have POSIX threads libraries and header files. */ +#undef HAVE_PTHREAD + +/* Define to 1 if you have the `pthread_yield' function. */ +#undef HAVE_PTHREAD_YIELD + +/* Define to 1 if you have the `PtlACEntry' function. */ +#undef HAVE_PTLACENTRY + +/* Define to 1 if you have the `PtlErrorStr' function. */ +#undef HAVE_PTLERRORSTR + +/* Define to 1 if you have the `PtlEventKindStr' function. */ +#undef HAVE_PTLEVENTKINDSTR + +/* Define to 1 if you have the `PtlGetJid' function. */ +#undef HAVE_PTLGETJID + +/* Define to 1 if you have the `PtlNIFailStr' function. */ +#undef HAVE_PTLNIFAILSTR + +/* Define to 1 if the system has the type `ptl_eq_handler_t'. */ +#undef HAVE_PTL_EQ_HANDLER_T + +/* Define if you have PTL_NOACK_REQ. */ +#undef HAVE_PTL_NOACK_REQ + +/* Define if you have PTL_NO_ACK_REQ. */ +#undef HAVE_PTL_NO_ACK_REQ + +/* Define to 1 if the system has the type `ptl_time_t'. */ +#undef HAVE_PTL_TIME_T + +/* Define if you have RIDCOMPRESS. */ +#undef HAVE_RIDCOMPRESS + +/* Define to 1 if you have the `sched_yield' function. */ +#undef HAVE_SCHED_YIELD + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the `strerror' function. */ +#undef HAVE_STRERROR + +/* Define to 1 if cpp supports the ANSI # stringizing operator. */ +#undef HAVE_STRINGIZE + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the `strncpy' function. */ +#undef HAVE_STRNCPY + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define if you have SZIP. */ +#undef HAVE_SZIP + +/* Define to 1 if you have the header file. */ +#undef HAVE_SZLIB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_TIMER_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define if you have ZLIB. */ +#undef HAVE_ZLIB + +/* Define to 1 if you have the header file. */ +#undef HAVE_ZLIB_H + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#undef LT_OBJDIR + +/* Datatap is disabled */ +#undef NO_DATATAP + +/* Flexpath is disabled */ +#undef NO_FLEXPATH + +/* Define to 1 if your C compiler doesn't accept -c and -o together. */ +#undef NO_MINUS_C_MINUS_O + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Define to the necessary symbol if this constant uses a non-standard name on + your system. */ +#undef PTHREAD_CREATE_JOINABLE + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Need to use MPI compiler for sequential utils */ +#undef USE_PARALLEL_COMPILER + +/* Version number of package */ +#undef VERSION + +/* Major version number */ +#undef VERSION_MAJOR + +/* Micro version number */ +#undef VERSION_MICRO + +/* Minor version number */ +#undef VERSION_MINOR diff --git a/tests/libs/adios/config/ac_alacrity.m4 b/tests/libs/adios/config/ac_alacrity.m4 new file mode 100755 index 0000000000..7be64ec2fb --- /dev/null +++ b/tests/libs/adios/config/ac_alacrity.m4 @@ -0,0 +1,73 @@ +# +# +# AC_ALACRITY +# +# +# +dnl @synopsis AC_ALACRITY +dnl +dnl This macro test if ALACRITY is to be used. +dnl Use in C code: +dnl #ifdef ALACRITY +dnl #include "alacrity.h" +dnl #endif +dnl +dnl @version 1.0 +dnl @author David A. Boyuka II +dnl +AC_DEFUN([AC_ALACRITY],[ + +AC_MSG_NOTICE([=== checking for ALACRITY ===]) + +AM_CONDITIONAL(HAVE_ALACRITY,true) + +AC_ARG_WITH([alacrity], + [ --with-alacrity=DIR Location of ALACRITY library], + [ALACRITY_LDFLAGS="-L$withval/lib"; + ALACRITY_LIBS="-lalacrity"; + ALACRITY_CPPFLAGS="-I$withval/include";], + [with_alacrity=no]) + +if test "x$with_alacrity" == "xno"; then + + AM_CONDITIONAL(HAVE_ALACRITY,false) + +else + + save_CPPFLAGS="$CPPFLAGS" + save_LIBS="$LIBS" + save_LDFLAGS="$LDFLAGS" + LIBS="$LIBS $ALACRITY_LIBS" + LDFLAGS="$LDFLAGS $ALACRITY_LDFLAGS" + CPPFLAGS="$CPPFLAGS $ALACRITY_CPPFLAGS" + + dnl if test -z "${HAVE_ALACRITY_TRUE}"; then + dnl AC_CHECK_HEADERS(alacrity.h, + dnl , + dnl [AM_CONDITIONAL(HAVE_ALACRITY,false)]) + dnl fi + + # Check for the ALACRITY library and headers + dnl AC_TRY_COMPILE([struct obd_uuid {char uuid[40];};int fd, num_ost;struct obd_uuid uuids[1024];], + dnl [llapi_lov_get_uuids(fd, uuids, &num_ost);], + dnl [ALACRITY_LIBS="-lalacrity"], + dnl [AM_CONDITIONAL(HAVE_ALACRITY,false)]) + + LIBS="$save_LIBS" + LDFLAGS="$save_LDFLAGS" + CPPFLAGS="$save_CPPFLAGS" + + AC_SUBST(ALACRITY_LIBS) + AC_SUBST(ALACRITY_LDFLAGS) + AC_SUBST(ALACRITY_CPPFLAGS) + + # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: + if test -z "${HAVE_ALACRITY_TRUE}"; then + ifelse([$1],,[AC_DEFINE(HAVE_ALACRITY,1,[Define if you have ALACRITY.])],[$1]) + : + else + $2 + : + fi +fi +])dnl AC_ALACRITY diff --git a/tests/libs/adios/config/ac_aplod.m4 b/tests/libs/adios/config/ac_aplod.m4 new file mode 100755 index 0000000000..0de6b7aa8d --- /dev/null +++ b/tests/libs/adios/config/ac_aplod.m4 @@ -0,0 +1,73 @@ +# +# +# AC_APLOD +# +# +# +dnl @synopsis AC_APLOD +dnl +dnl This macro test if APLOD is to be used. +dnl Use in C code: +dnl #ifdef APLOD +dnl #include "aplod.h" +dnl #endif +dnl +dnl @version 1.0 +dnl @author Zhenhuan (Steve) Gong +dnl +AC_DEFUN([AC_APLOD],[ + +AC_MSG_NOTICE([=== checking for APLOD ===]) + +AM_CONDITIONAL(HAVE_APLOD,true) + +AC_ARG_WITH(aplod, + [ --with-aplod=DIR Location of APLOD library], + [APLOD_LDFLAGS="-L$withval/lib"; + APLOD_LIBS="-laplod -lz"; + APLOD_CPPFLAGS="-I$withval/include";], + [with_aplod=no]) + +if test "x$with_aplod" == "xno"; then + + AM_CONDITIONAL(HAVE_APLOD,false) + +else + + save_CPPFLAGS="$CPPFLAGS" + save_LIBS="$LIBS" + save_LDFLAGS="$LDFLAGS" + LIBS="$LIBS -laplod -lz" + LDFLAGS="$LDFLAGS $APLOD_LDFLAGS" + CPPFLAGS="$CPPFLAGS $APLOD_CPPFLAGS" + + if test -z "${HAVE_APLOD_TRUE}"; then + AC_CHECK_HEADERS(aplod.h, + , + [AM_CONDITIONAL(HAVE_APLOD,false)]) + fi + + # Check for the APLOD library and headers + dnl AC_TRY_COMPILE([struct obd_uuid {char uuid[40];};int fd, num_ost;struct obd_uuid uuids[1024];], + dnl [llapi_lov_get_uuids(fd, uuids, &num_ost);], + dnl [APLOD_LIBS="-laplod -lz"], + dnl [AM_CONDITIONAL(HAVE_APLOD,false)]) + + LIBS="$save_LIBS" + LDFLAGS="$save_LDFLAGS" + CPPFLAGS="$save_CPPFLAGS" + + AC_SUBST(APLOD_LIBS) + AC_SUBST(APLOD_LDFLAGS) + AC_SUBST(APLOD_CPPFLAGS) + + # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: + if test -z "${HAVE_APLOD_TRUE}"; then + ifelse([$1],,[AC_DEFINE(HAVE_APLOD,1,[Define if you have APLOD.])],[$1]) + : + else + $2 + : + fi +fi +])dnl AC_APLOD diff --git a/tests/libs/adios/config/ac_bgq.m4 b/tests/libs/adios/config/ac_bgq.m4 new file mode 100644 index 0000000000..0bdac92f0d --- /dev/null +++ b/tests/libs/adios/config/ac_bgq.m4 @@ -0,0 +1,24 @@ + +AC_DEFUN([AC_BGQ], [ + + +AC_MSG_NOTICE([=== checking for BGQ ===]) + +temptest=enable + +AC_ARG_WITH(bgq, + [ --with-bgq Whether to enable BGQ method or not], + [ ], [with_bgq=no]) + +if test "x$with_bgq" = "xno"; then + echo "no bgq" + AM_CONDITIONAL(HAVE_BGQ, false) + AC_DEFINE(HAVE_BGQ,0,[Define if you want to enable BGQ method]) +elif test x"$with_bgq" != xyes -o x"$with_bgq" != xcheck; then +dnl AC_CHECK_HEADERS(/bgsys/drivers/ppcfloor/spi/include/kernel/location.h /bgsys/drivers/ppcfloor/spi/include/kernel/process.h /bgsys/drivers/ppcfloor/firmware/include/personality.h, +dnl , +dnl [AM_CONDITIONAL(HAVE_BGQ,false)]) + AM_CONDITIONAL(HAVE_BGQ, true) + AC_DEFINE(HAVE_BGQ,1,[Define if you want to enable BGQ method]) +fi +]) dnl AC_BGQ diff --git a/tests/libs/adios/config/ac_bzip2.m4 b/tests/libs/adios/config/ac_bzip2.m4 new file mode 100644 index 0000000000..9a2267c311 --- /dev/null +++ b/tests/libs/adios/config/ac_bzip2.m4 @@ -0,0 +1,120 @@ +# +# +# AC_BZIP2 +# +# +# +dnl @synopsis AC_BZIP2 +dnl +dnl This macro test if BZIP2 is to be used. +dnl Use in C code: +dnl #ifdef BZIP2 +dnl #include "bzlib.h" +dnl #endif +dnl +dnl @version 2.0 +dnl @author Zhenhuan (Steve) Gong +dnl dnl @author Norbert Podhorszki +dnl +AC_DEFUN([AC_BZIP2],[ + +AC_MSG_NOTICE([=== checking for BZIP2 ===]) + +AM_CONDITIONAL(HAVE_BZIP2,true) + +AC_ARG_WITH(bzip2, + [ --with-bzip2=DIR Location of BZIP2 library], + [:], [with_bzip2=no]) + +if test "x$with_bzip2" == "xno"; then + + AM_CONDITIONAL(HAVE_BZIP2,false) + +else + + save_CPPFLAGS="$CPPFLAGS" + save_LIBS="$LIBS" + save_LDFLAGS="$LDFLAGS" + + if test "x$with_bzip2" == "xyes"; then + dnl No path given + BZIP2_CPPFLAGS="" + BZIP2_LDFLAGS="" + BZIP2_LIBS="-lbz2" + else + dnl Path given, first try path/lib64 + BZIP2_CPPFLAGS="-I$withval/include" + BZIP2_LDFLAGS="-L$withval/lib64" + BZIP2_LIBS="-lbz2" + fi + + LIBS="$LIBS $BZIP2_LIBS" + LDFLAGS="$LDFLAGS $BZIP2_LDFLAGS" + CPPFLAGS="$CPPFLAGS $BZIP2_CPPFLAGS" + + if test -z "${HAVE_BZIP2_TRUE}"; then + AC_CHECK_HEADERS(bzlib.h, + , + [AM_CONDITIONAL(HAVE_BZIP2,false)]) + fi + + if test -z "${HAVE_BZIP2_TRUE}"; then + dnl Try to link an example now + AC_MSG_CHECKING([if bzip2 code can be linked with $BZIP2_LDFLAGS]) + AC_TRY_LINK( + [#include + #include "bzlib.h"], + [char* in, *out; + unsigned int in_len, *out_len; + int blocksize100k = 5; + int bzerr = BZ2_bzBuffToBuffCompress ( + out, out_len, in, in_len, blocksize100k, 0, 30); + return (bzerr != BZ_OK);], + [AC_MSG_RESULT(yes)], + [AM_CONDITIONAL(HAVE_BZIP2,false) + AC_MSG_RESULT(no) + ]) + + dnl If linking above failed, one reason might be that we looked in lib64/ + dnl instead of lib/ + if test -z "${HAVE_BZIP2_FALSE}"; then + if test "x$with_lustre" != "xyes"; then + BZIP2_LDFLAGS="-L$withval/lib" + LDFLAGS="$LDFLAGS $BZIP2_LDFLAGS" + AC_MSG_CHECKING([if bzip2 code can be linked with $BZIP2_LDFLAGS]) + AC_TRY_LINK( + [#include + #include "bzlib.h"], + [char* in, *out; + unsigned int in_len, *out_len; + int blocksize100k = 5; + int bzerr = BZ2_bzBuffToBuffCompress ( + out, out_len, in, in_len, blocksize100k, 0, 30); + return (bzerr != BZ_OK);], + [AC_MSG_RESULT(yes)], + [AM_CONDITIONAL(HAVE_BZIP2,false) + AC_MSG_RESULT(no) + ]) + fi + fi + fi + + + LIBS="$save_LIBS" + LDFLAGS="$save_LDFLAGS" + CPPFLAGS="$save_CPPFLAGS" + + AC_SUBST(BZIP2_LIBS) + AC_SUBST(BZIP2_LDFLAGS) + AC_SUBST(BZIP2_CPPFLAGS) + + # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: + if test -z "${HAVE_BZIP2_TRUE}"; then + ifelse([$1],,[AC_DEFINE(HAVE_BZIP2,1,[Define if you have BZIP2.])],[$1]) + : + else + $2 + : + fi +fi +])dnl AC_BZIP2 diff --git a/tests/libs/adios/config/ac_cray_pmi.m4 b/tests/libs/adios/config/ac_cray_pmi.m4 new file mode 100644 index 0000000000..a9f4c7730b --- /dev/null +++ b/tests/libs/adios/config/ac_cray_pmi.m4 @@ -0,0 +1,141 @@ +dnl ###################################################################### +dnl +dnl Finds CRAY_PMI +dnl +dnl ###################################################################### + +AC_DEFUN([AC_CRAY_PMI], +[ + +ac_cray_pmi_lib_ok=no + +AM_CONDITIONAL(HAVE_CRAY_PMI,true) + +dnl Automatic checking for CRAY_PMI is disabled now. +AC_ARG_WITH(cray-pmi, + [ --with-cray-pmi=], + [CRAY_PMI_DIR=$withval], [with_cray_pmi=no]) + +AC_ARG_WITH(cray-pmi-incdir, + [ --with-cray-pmi-incdir=], + [CRAY_PMI_INCDIR=$withval + with_cray_pmi=detailed]) + +AC_ARG_WITH(cray-pmi-libdir, + [ --with-cray-pmi-libdir=], + [CRAY_PMI_LIBDIR=$withval + with_cray_pmi=detailed]) + +AC_ARG_WITH(cray-pmi-libs, + [ --with-cray-pmi-libs=, e.g. -lpmi], + [CRAY_PMI_LIBS=$withval + with_cray_pmi=detailed]) + + +dnl If --without-cray-pmi was given set HAVE_CRAY_PMI to false and do nothing more +dnl If nothing was given, then too, do nothing +if test "x$with_cray_pmi" == "xno"; then + + AM_CONDITIONAL(HAVE_CRAY_PMI,false) + +else + + AC_MSG_NOTICE([=== checking for CRAY PMI ===]) + + dnl If we know CRAY_PMI_DIR, then we can know CRAY_PMI_INCDIR. + dnl We don't overwrite CRAY_PMI_INCDIR. + if test -z "${CRAY_PMI_INCDIR}"; then + if test -n "${CRAY_PMI_DIR}"; then + CRAY_PMI_INCDIR="${CRAY_PMI_DIR}/include"; + fi + fi + + dnl If we know CRAY_PMI_DIR, then we can know CRAY_PMI_LIBDIR. + dnl We don't overwrite CRAY_PMI_LIBDIR. + if test -z "${CRAY_PMI_LIBDIR}"; then + if test -n "${CRAY_PMI_DIR}"; then + if test -d "${CRAY_PMI_DIR}/lib64"; then + CRAY_PMI_LIBDIR="${CRAY_PMI_DIR}/lib64"; + else + CRAY_PMI_LIBDIR="${CRAY_PMI_DIR}/lib"; + fi + fi + fi + + dnl Add "-I" to CRAY_PMI_INCDIR. + CRAY_PMI_CPPFLAGS="-I${CRAY_PMI_INCDIR}" + + dnl Add "-L" to CRAY_PMI_LIBDIR. + CRAY_PMI_LDFLAGS="-L${CRAY_PMI_LIBDIR}" + + dnl if hdf5 libs are not defined then guess and define it + if test -z "${CRAY_PMI_LIBS}"; then + dnl default CRAY_PMI lib is usually just -lpmi + CRAY_PMI_LIBS="-lpmi" + fi + + save_CC="$CC" + save_CPPFLAGS="$CPPFLAGS" + save_LIBS="$LIBS" + save_LDFLAGS="$LDFLAGS" + LIBS="$LIBS $CRAY_PMI_LIBS" + LDFLAGS="$LDFLAGS $CRAY_PMI_LDFLAGS" + CPPFLAGS="$CPPFLAGS $CRAY_PMI_CPPFLAGS" + CC="$MPICC" + + if test -z "${HAVE_CRAY_PMI_TRUE}"; then + dnl AC_CHECK_HEADERS(pmi.h, + dnl , + dnl [if test "x$with_cray_pmi" != xcheck; then + dnl AC_MSG_FAILURE( [--with-cray-pmi was given, but test for pmi.h failed]) + dnl fi + dnl AM_CONDITIONAL(HAVE_CRAY_PMI,false)]) + AC_MSG_CHECKING([for Cray's pmi.h]) + if test -f ${CRAY_PMI_INCDIR}/pmi.h; then + AC_MSG_RESULT(yes) + else + AM_CONDITIONAL(HAVE_CRAY_PMI,false) + AC_MSG_RESULT(no) + AC_MSG_FAILURE( [--with-cray-pmi was given, but test for ${CRAY_PMI_INCDIR}/pmi.h failed]) + fi + fi + + if test -z "${HAVE_CRAY_PMI_TRUE}"; then + AC_MSG_CHECKING([if pmi code can be compiled]) + AC_TRY_COMPILE([#include "pmi.h"], + [int size; + int rank; + PMI_Get_size(&size); + PMI_Get_rank(&rank); + ], + [AC_MSG_RESULT(yes) + ac_cray_pmi_lib_ok=yes], + [AC_MSG_RESULT(no) + if test "x$with_cray_pmi" != xcheck; then + AC_MSG_FAILURE( [--with-cray-pmi was given, but compile test failed]) + fi + AM_CONDITIONAL(HAVE_CRAY_PMI,false) + ]) + + AC_SUBST(CRAY_PMI_LIBS) + AC_SUBST(CRAY_PMI_LDFLAGS) + AC_SUBST(CRAY_PMI_CPPFLAGS) + fi + + LIBS="$save_LIBS" + LDFLAGS="$save_LDFLAGS" + CPPFLAGS="$save_CPPFLAGS" + CC="$save_CC" + + # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: + if test -z "${HAVE_CRAY_PMI_TRUE}"; then + ifelse([$1],,[AC_DEFINE(HAVE_CRAY_PMI,1,[Define if you have CRAY_PMI.])],[$1]) + : + else + $2 + : + fi + +fi + +]) diff --git a/tests/libs/adios/config/ac_cray_ugni.m4 b/tests/libs/adios/config/ac_cray_ugni.m4 new file mode 100644 index 0000000000..b8292fef6d --- /dev/null +++ b/tests/libs/adios/config/ac_cray_ugni.m4 @@ -0,0 +1,148 @@ +dnl ###################################################################### +dnl +dnl Finds CRAY_UGNI +dnl +dnl ###################################################################### + +AC_DEFUN([AC_CRAY_UGNI], +[ + +ac_cray_ugni_lib_ok=no + +AM_CONDITIONAL(HAVE_CRAY_UGNI,true) + +dnl Automatic checking for CRAY_UGNI is disabled now. +AC_ARG_WITH(cray-ugni, + [ --with-cray-ugni=], + [CRAY_UGNI_DIR=$withval], [with_cray_ugni=no]) + +AC_ARG_WITH(cray-ugni-incdir, + [ --with-cray-ugni-incdir=], + [CRAY_UGNI_INCDIR=$withval + with_cray_ugni=detailed]) + +AC_ARG_WITH(cray-ugni-libdir, + [ --with-cray-ugni-libdir=], + [CRAY_UGNI_LIBDIR=$withval + with_cray_ugni=detailed]) + +AC_ARG_WITH(cray-ugni-libs, + [ --with-cray-ugni-libs=, e.g. -lugni], + [CRAY_UGNI_LIBS=$withval + with_cray_ugni=detailed]) + + +dnl If --without-cray-ugni was given set HAVE_CRAY_UGNI to false and do nothing more +dnl If nothing was given, then too, do nothing +if test "x$with_cray_ugni" == "xno"; then + + AM_CONDITIONAL(HAVE_CRAY_UGNI,false) + +else + + AC_MSG_NOTICE([=== checking for CRAY UGNI ===]) + + dnl If we know CRAY_UGNI_DIR, then we can know CRAY_UGNI_INCDIR. + dnl We don't overwrite CRAY_UGNI_INCDIR. + if test -z "${CRAY_UGNI_INCDIR}"; then + if test -n "${CRAY_UGNI_DIR}"; then + CRAY_UGNI_INCDIR="${CRAY_UGNI_DIR}/include"; + fi + fi + + dnl If we know CRAY_UGNI_DIR, then we can know CRAY_UGNI_LIBDIR. + dnl We don't overwrite CRAY_UGNI_LIBDIR. + if test -z "${CRAY_UGNI_LIBDIR}"; then + if test -n "${CRAY_UGNI_DIR}"; then + if test -d "${CRAY_UGNI_DIR}/lib64"; then + CRAY_UGNI_LIBDIR="${CRAY_UGNI_DIR}/lib64"; + else + CRAY_UGNI_LIBDIR="${CRAY_UGNI_DIR}/lib"; + fi + fi + fi + + dnl Add "-I" to CRAY_UGNI_INCDIR. + CRAY_UGNI_CPPFLAGS="-I${CRAY_UGNI_INCDIR}" + + dnl Add "-L" to CRAY_UGNI_LIBDIR. + CRAY_UGNI_LDFLAGS="-L${CRAY_UGNI_LIBDIR}" + + dnl if hdf5 libs are not defined then guess and define it + if test -z "${CRAY_UGNI_LIBS}"; then + dnl default CRAY_UGNI lib is usually just -lugni + CRAY_UGNI_LIBS="-lugni" + fi + + save_CC="$CC" + save_CPPFLAGS="$CPPFLAGS" + save_LIBS="$LIBS" + save_LDFLAGS="$LDFLAGS" + LIBS="$LIBS $CRAY_UGNI_LIBS" + LDFLAGS="$LDFLAGS $CRAY_UGNI_LDFLAGS" + CPPFLAGS="$CPPFLAGS $CRAY_UGNI_CPPFLAGS" + CC="$MPICC" + + if test -z "${HAVE_CRAY_UGNI_TRUE}"; then + dnl AC_CHECK_HEADERS(ugni.h, + dnl , + dnl [if test "x$with_cray_ugni" != xcheck; then + dnl AC_MSG_FAILURE( [--with-cray-ugni was given, but test for ugni.h failed]) + dnl fi + dnl AM_CONDITIONAL(HAVE_CRAY_UGNI,false)]) + AC_MSG_CHECKING([for Cray's ugni.h]) + if test -f ${CRAY_UGNI_INCDIR}/gni_pub.h; then + AC_MSG_RESULT(yes) + else + AM_CONDITIONAL(HAVE_CRAY_UGNI,false) + AC_MSG_RESULT(no) + AC_MSG_FAILURE( [--with-cray-ugni was given, but test for ${CRAY_UGNI_INCDIR}/gni_pub.h failed]) + fi + fi + + if test -z "${HAVE_CRAY_UGNI_TRUE}"; then + AC_MSG_CHECKING([if ugni code can be compiled]) + AC_TRY_COMPILE( + [#include + #include + #include "gni_pub.h" + ], + [uint32_t inst_id; + uint8_t ptag; + uint32_t cookie; + uint32_t modes; + gni_cdm_handle_t * cdm_hndl; + gni_return_t status; + status = GNI_CdmCreate(inst_id, ptag, cookie, modes, cdm_hndl); + ], + [AC_MSG_RESULT(yes) + ac_cray_ugni_lib_ok=yes], + [AC_MSG_RESULT(no) + if test "x$with_cray_ugni" != xcheck; then + AC_MSG_FAILURE( [--with-cray-ugni was given, but compile test failed]) + fi + AM_CONDITIONAL(HAVE_CRAY_UGNI,false) + ]) + + AC_SUBST(CRAY_UGNI_LIBS) + AC_SUBST(CRAY_UGNI_LDFLAGS) + AC_SUBST(CRAY_UGNI_CPPFLAGS) + fi + + LIBS="$save_LIBS" + LDFLAGS="$save_LDFLAGS" + CPPFLAGS="$save_CPPFLAGS" + CC="$save_CC" + + # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: + if test -z "${HAVE_CRAY_UGNI_TRUE}"; then + ifelse([$1],,[AC_DEFINE(HAVE_CRAY_UGNI,1,[Define if you have CRAY_UGNI.])],[$1]) + : + else + $2 + : + fi + +fi + +]) diff --git a/tests/libs/adios/config/ac_dataspaces.m4 b/tests/libs/adios/config/ac_dataspaces.m4 new file mode 100644 index 0000000000..0805db48ab --- /dev/null +++ b/tests/libs/adios/config/ac_dataspaces.m4 @@ -0,0 +1,157 @@ +# +# +# AC_PROG_DATASPACES +# +# Test for DATASPACES installation +# and set $DATASPACES to the correct value. +# +# +dnl @synopsis AC_PROG_DATASPACES +dnl +dnl This macro test if DATASPACES is installed. If DATASPACES +dnl is installed, it set $DATASPACES to the right value +dnl +dnl @version 1.0 +dnl @author Norbert Podhorszki, pnorbert@ornl.gov +dnl +AC_DEFUN([AC_PROG_DATASPACES],[ + +AC_REQUIRE([AC_INFINIBAND]) +dnl AC_REQUIRE([AC_PORTALS]) +dnl AC_REQUIRE([AC_GNI]) + + +AM_CONDITIONAL(HAVE_DATASPACES,true) + +AC_ARG_WITH(dataspaces, + [AS_HELP_STRING([--with-dataspaces=DIR], + [Build the DATASPACES transport method. Point to the DATASPACES installation.])], + [DATASPACES_LDFLAGS="-L$withval/lib"; + DATASPACES_CPPFLAGS="-I$withval/include";], + [with_dataspaces=check]) + +dnl If --without-dataspaces was given set HAVE_DATASPACES to false and do nothing more +if test "x$with_dataspaces" == "xno"; then + + AM_CONDITIONAL(HAVE_DATASPACES,false) + +else + + dnl allow args --with-dataspaces incdir and --with-dataspaces-libdir + AC_ARG_WITH(dataspaces-incdir, + [ --with-dataspaces-incdir=], + [DATASPACES_INCDIR=$withval + with_dataspaces=detailed]) + + AC_ARG_WITH(dataspaces-libdir, + [ --with-dataspaces-libdir=], + [DATASPACES_LIBDIR=$withval + with_dataspaces=detailed]) + + + dnl If we know DATASPACES_DIR, then we can know DATASPACES_INCDIR. + dnl We don't overwrite DATASPACES_INCDIR. + if test -n "${DATASPACES_DIR}" -a -z "${DATASPACES_INCDIR}"; then + DATASPACES_INCDIR="${DATASPACES_DIR}/include"; + dnl We may have DATASPACES denoting the dir (e.g. on ewok BUT on franklin it contains all flags) + elif test -n "${DATASPACES}" -a -d "${DATASPACES}"; then + DATASPACES_INCDIR="${DATASPACES}/include" + fi + + dnl If we know DATASPACES_DIR, then we can know DATASPACES_LIBDIR. + dnl We don't overwrite DATASPACES_LIBDIR. + if test -n "${DATASPACES_DIR}" -a -z "${DATASPACES_LIBDIR}"; then + DATASPACES_LIBDIR="${DATASPACES_DIR}/lib"; + dnl We may have DATASPACES denoting the dir (e.g. on ewok BUT on franklin it contains all flags) + elif test -n "${DATASPACES}" -a -d "${DATASPACES}"; then + DATASPACES_LIBDIR="${DATASPACES}/lib" + fi + + dnl Add "-I" to DATASPACES_INCDIR. + if test -n "${DATASPACES_INCDIR}"; then + DATASPACES_CPPFLAGS="-I${DATASPACES_INCDIR}" + else + ac_dataspaces_ok=no + fi + + dnl Add "-L" to DATASPACES_LIBDIR. + if test -n "${DATASPACES_LIBDIR}"; then + DATASPACES_LDFLAGS="-L${DATASPACES_LIBDIR}" + else + ac_dataspaces_ok=no + fi + + save_CPPFLAGS="$CPPFLAGS" + save_LIBS="$LIBS" + save_LDFLAGS="$LDFLAGS" + dnl if test "x${ac_infiniband_lib_ok}" == "xyes"; then + dnl dnl LIBS="$LIBS -ldart -ldataspaces" + dnl LIBS="$LIBS -ldspaces -ldscommon -ldart" + dnl elif test "x${ac_portals_lib_ok}" == "xyes"; then + dnl LIBS="$LIBS -ldart2 -lspaces" + dnl elif test "x${ac_dmcf_lib_ok}" == "xyes"; then + dnl LIBS="$LIBS -ldspaces -ldscommon -ldart" + dnl else + dnl LIBS="$LIBS -ldspaces -ldscommon -ldart" + dnl fi + LIBS="$LIBS -ldspaces -ldscommon -ldart" + LDFLAGS="$LDFLAGS $DATASPACES_LDFLAGS" + CPPFLAGS="$CPPFLAGS $DATASPACES_CPPFLAGS" + + if test -z "${HAVE_DATASPACES_TRUE}"; then + AC_CHECK_HEADERS(dataspaces.h, + , + [AM_CONDITIONAL(HAVE_DATASPACES,false)]) + fi + + if test -z "${HAVE_DATASPACES_TRUE}"; then + # Check for the DataSpaces library and headers + if test "x${ac_portals_lib_ok}" == "xyes"; then + AC_TRY_COMPILE([#include "dataspaces.h"], + [int err; err = dspaces_init(1,1,0,"");], + [DATASPACES_LIBS="-ldspaces -ldscommon -ldart"], + [AM_CONDITIONAL(HAVE_DATASPACES,false)]) + elif test "x${ac_infiniband_lib_ok}" == "xyes"; then + AC_TRY_COMPILE([#include "dataspaces.h"], + [int err; err = dspaces_init(1,1,0,"");], + [DATASPACES_LIBS="-ldspaces -ldscommon -ldart -lrdmacm"], + [AM_CONDITIONAL(HAVE_DATASPACES,false)]) + elif test -z "${HAVE_CRAY_PMI_TRUE}" -a -z "${HAVE_CRAY_UGNI_TRUE}"; then + AC_TRY_COMPILE([#include "dataspaces.h"], + [int err; err = dspaces_init(1,1,0,"");], + [DATASPACES_LIBS="-ldspaces -ldscommon -ldart"], + [AM_CONDITIONAL(HAVE_DATASPACES,false)]) + elif test "x${ac_dcmf_lib_ok}" == "xyes"; then + AC_TRY_COMPILE([#include "dataspaces.h"], + [int err; err = dspaces_init(1,1,0,"");], + [DATASPACES_LIBS="-ldspaces -ldscommon -ldart"], + [AM_CONDITIONAL(HAVE_DATASPACES,false)]) + elif test "x${ac_pami_lib_ok}" == "xyes"; then + AC_TRY_COMPILE([#include "dataspaces.h"], + [int err; err = dspaces_init(1,1,0,"");], + [DATASPACES_LIBS="-ldspaces -ldscommon -ldart"], + [AM_CONDITIONAL(HAVE_DATASPACES,false)]) + else + AM_CONDITIONAL(HAVE_DATASPACES,false) + fi + fi + + LIBS="$save_LIBS" + LDFLAGS="$save_LDFLAGS" + CPPFLAGS="$save_CPPFLAGS" + + AC_SUBST(DATASPACES_LIBS) + AC_SUBST(DATASPACES_LDFLAGS) + AC_SUBST(DATASPACES_CPPFLAGS) + + # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: + if test -z "${HAVE_DATASPACES_TRUE}"; then + ifelse([$1],,[AC_DEFINE(HAVE_DATASPACES,1,[Define if you have the DATASPACES.])],[$1]) + : + else + $2 + : + fi + +fi +])dnl AC_DATASPACES diff --git a/tests/libs/adios/config/ac_datatap.m4 b/tests/libs/adios/config/ac_datatap.m4 new file mode 100644 index 0000000000..b2ec424e8a --- /dev/null +++ b/tests/libs/adios/config/ac_datatap.m4 @@ -0,0 +1,142 @@ + +AC_DEFUN([AC_DATATAP], [ + +AC_REQUIRE([AC_INFINIBAND]) +AC_REQUIRE([AC_PORTALS]) + +dnl give an option to the user to enable datatap (with either ib or portals) +dnl by default datatap will be disabled + +DT_SRCDIR="" +DT_CPPFLAGS="" +DT_LDFLAGS="" +DT_LIBS="" + +datatap=disable + +temptest=enable + +datatap_dir="" + + +AC_ARG_WITH(datatap, + [ --with-datatap=DIR Location of DataTap], + [ ac_with_datatap=$withval], [with_datatap=no]) + +if test "x$with_datatap" = "xno"; then + AC_DEFINE(NO_DATATAP, 1, [Datatap is disabled]) + datatap=disable + temptest=disable + +elif test x"$with_datatap" = xyes -o x"$with_datatap" = xcheck; then + + AC_DEFINE(NO_DATATAP, 0, [Datatap is disabled]) + + if test x"$ac_with_infiniband" = xyes; then + CERCS_REQUIRE_PACKAGE(ibpbio, thin_ib.h, libibclient.la) + CERCS_REQUIRE_PACKAGE(ffs, ffs.h, libffs.la) + CERCS_REQUIRE_PACKAGE(gen_thread, gen_thread.h, libgen_thread.la) + if test -n "$cercs_cv_ibpbio_link_dir";then + DT_LDFLAGS="$DT_LDFLAGS -L$cercs_cv_ibpbio_link_dir" + DT_LIBS="$DT_LIBS -libclient" + datatap=ibverbs + else + temptest=disable + fi + if test -n "$cercs_cv_ffs_link_dir";then + DT_LDFLAGS="$DT_LDFLAGS -L$cercs_cv_ffs_link_dir" + DT_LIBS="$DT_LIBS -lgen_thread" + datatap=ibverbs + else + temptest=disable + fi + if test -n "$cercs_cv_gen_thread_link_dir";then + DT_LDFLAGS="$DT_LDFLAGS -L$cercs_cv_gen_thread_link_dir" + DT_LIBS="$DT_LIBS -lgen_thread" + datatap=ibverbs + else + temptest=disable + fi + + elif test x"$ac_with_portals" = xyes; then + CERCS_REQUIRE_PACKAGE(ptlpbio, thin_portal.h, libptlclient.a) + + if test -n "$cercs_cv_ptlpbio_link_dir";then + DT_LDFLAGS="$DT_LDFLAGS -L$cercs_cv_ptlpbio_link_dir" + DT_LIBS="$DT_LIBS -lptlclient -lptlserver -lbench -ldl" + datatap=portals + else + temptest=disable + fi + + else + echo "Neither portals nor infiniband found. Disabling datatap" + AC_DEFINE(NO_DATATAP, 1, [Datatap is disabled]) + datatap=disable + temptest=disable + fi +else +dnl directory given .. add it to search path with CERCS_REQUIRE_PACKAGE + AC_MSG_NOTICE([Datatap with custom library path: $withval]) + + datatap_dir=$withval + + AC_DEFINE(NO_DATATAP, 0, [Datatap is disabled]) + + if test x"$ac_with_infiniband" = xyes; then + CERCS_REQUIRE_PACKAGE(ibpbio, thin_ib.h, libibclient.la) + CERCS_REQUIRE_PACKAGE(ffs, ffs.h, libffs.la) + CERCS_REQUIRE_PACKAGE(gen_thread, gen_thread.h, libgen_thread.la) + if test -n "$cercs_cv_ibpbio_link_dir";then + DT_LDFLAGS="$DT_LDFLAGS -L$cercs_cv_ibpbio_link_dir" + DT_LIBS="$DT_LIBS -libclient" + datatap=ibverbs + else + temptest=disable + fi + if test -n "$cercs_cv_ffs_link_dir";then + DT_LDFLAGS="$DT_LDFLAGS -L$cercs_cv_ffs_link_dir" + DT_LIBS="$DT_LIBS -lgen_thread" + datatap=ibverbs + else + temptest=disable + fi + if test -n "$cercs_cv_gen_thread_link_dir";then + DT_LDFLAGS="$DT_LDFLAGS -L$cercs_cv_gen_thread_link_dir" + DT_LIBS="$DT_LIBS -lgen_thread" + datatap=ibverbs + else + temptest=disable + fi + + elif test x"$ac_with_portals" = xyes; then + CERCS_REQUIRE_PACKAGE(ptlpbio, thin_portal.h, libptlclient.a) + + if test -n "$cercs_cv_ptlpbio_link_dir";then + DT_LDFLAGS="$DT_LDFLAGS -L$cercs_cv_ptlpbio_link_dir" + DT_LIBS="$DT_LIBS -lptlclient -lptlserver -lbench -ldl" + datatap=portals + else + temptest=disable + fi + + else + echo "Neither portals nor infiniband found. Disabling datatap" + AC_DEFINE(NO_DATATAP, 1, [Datatap is disabled]) + datatap=disable + temptest=disable + fi +fi + +if test x"$temptest" = xdisable; then + datatap=disable + echo "Datatap dependency check failed" + AC_DEFINE(NO_DATATAP, 1, [Datatap is disabled]) +fi + +AC_SUBST(DT_LIBS) +AC_SUBST(DT_CPPFLAGS) +AC_SUBST(DT_LDFLAGS) + + +]) dnl AC_DATATAP diff --git a/tests/libs/adios/config/ac_dcmf.m4 b/tests/libs/adios/config/ac_dcmf.m4 new file mode 100644 index 0000000000..aaff09d929 --- /dev/null +++ b/tests/libs/adios/config/ac_dcmf.m4 @@ -0,0 +1,70 @@ +dnl ###################################################################### +dnl +dnl Finds IBM_DCMF +dnl +dnl ###################################################################### + +AC_DEFUN([AC_DCMF],[ +ac_dcmf_lib_ok=no + +DCMF_CFLAGS="" +DCMF_CPPFLAGS="" +DCMF_LDFLAGS="" +DCMF_LIBS="" + +AC_MSG_NOTICE([=== checking for IBM DCMF ===]) + +AM_CONDITIONAL(HAVE_DCMF,true) + +AC_ARG_WITH(dcmf, + [ --with-dcmf=DIR Location of IBM DCMF], + [ DCMF_CPPFLAGS="-I$withval/arch/include -I$withval/comm/include"; + DCMF_LDFLAGS="-L$withval/comm/lib -L$withval/runtime/SPI"; + DCMF_LIBS="-ldcmf.cnk -ldcmfcoll.cnk -lpthread -lrt -lSPI.cna";]) + +save_CPPFLAGS="$CPPFLAGS" +save_LDFLAGS="$LDFLAGS" +save_LIBS="$LIBS" +CPPFLAGS="$CPPFLAGS $DCMF_CPPFLAGS" +LDFLAGS="$LDFLAGS $DCMF_LDFLAGS" +LIBS="$LIBS $DCMF_LIBS" + +dnl Check for the header file. +if test -z "${HAVE_DCMF_TRUE}"; then + AC_CHECK_HEADERS(dcmf.h, + , + [AM_CONDITIONAL(HAVE_DCMF,false)]) +fi + +dnl Check for the library. +if test -z "${HAVE_DCMF_TRUE}"; then + AC_MSG_CHECKING([if dcmf code can be linked]) + AC_TRY_LINK([#include "dcmf.h"], + [unsigned ret; + ret = DCMF_Messager_initialize(); + ret = DCMF_Messager_finalize();], + [DCMF_LIBS="-ldcmf.cnk -ldcmfcoll.cnk -lpthread -lrt -lSPI.cna" + AC_MSG_RESULT(yes)], + [AM_CONDITIONAL(HAVE_DCMF, false) + AC_MSG_RESULT(no)]) +fi + +LIBS="$save_LIBS" +LDFLAGS="$save_LDFLAGS" +CPPFLAGS="$save_CPPFLAGS" + +AC_SUBST(DCMF_CFLAGS) +AC_SUBST(DCMF_CPPFLAGS) +AC_SUBST(DCMF_LDFLAGS) +AC_SUBST(DCMF_LIBS) + +dnl Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: +if test -z "${HAVE_DCMF_TRUE}"; then + ac_dcmf_lib_ok=yes + ifelse([$1],,[AC_DEFINE(HAVE_DCMF,1,[Define if you have the DCMF.])],[$1]) + : +else + $2 + : +fi +])dnl AC_DCMF diff --git a/tests/libs/adios/config/ac_dimes.m4 b/tests/libs/adios/config/ac_dimes.m4 new file mode 100644 index 0000000000..e677dfa2f1 --- /dev/null +++ b/tests/libs/adios/config/ac_dimes.m4 @@ -0,0 +1,147 @@ +# +# +# AC_PROG_DIMES +# +# Test for DIMES installation +# and set $DIMES to the correct value. +# +# + +dnl @synopsis AC_PROG_DIMES +dnl +dnl This macro test if DIMES is installed. If DIMES +dnl is installed, it set $DIMES to the right value +dnl +dnl @version 1.0 +dnl @author Fan Zhang, zhangfan@cac.rutgers.edu +dnl @author Norbert Podhorszki, pnorbert@ornl.gov +dnl +AC_DEFUN([AC_PROG_DIMES],[ + +AM_CONDITIONAL(HAVE_DIMES,true) + +AC_ARG_WITH(dimes, + [AS_HELP_STRING([--with-dimes=DIR], + [Build the DIMES transport method. Point to the DIMES installation.])], + [DIMES_LDFLAGS="-L$withval/lib"; + DIMES_CPPFLAGS="-I$withval/include";], + [with_dimes=check]) + +dnl If --without-dimes was given set HAVE_DIMES to false and do nothing more +if test "x$with_dimes" == "xno"; then + + AM_CONDITIONAL(HAVE_DIMES,false) + +else + + dnl allow args --with-dimes incdir and --with-dimes-libdir + AC_ARG_WITH(dimes-incdir, + [ --with-dimes-incdir=], + [DIMES_INCDIR=$withval + with_dimes=detailed]) + + AC_ARG_WITH(dimes-libdir, + [ --with-dimes-libdir=], + [DIMES_LIBDIR=$withval + with_dimes=detailed]) + + + dnl If we know DIMES_DIR, then we can know DIMES_INCDIR. + dnl We don't overwrite DIMES_INCDIR. + if test -n "${DIMES_DIR}" -a -z "${DIMES_INCDIR}"; then + DIMES_INCDIR="${DIMES_DIR}/include"; + dnl We may have DIMES denoting the dir (e.g. on ewok BUT on franklin it contains all flags) + elif test -n "${DIMES}" -a -d "${DIMES}"; then + DIMES_INCDIR="${DIMES}/include" + fi + + dnl If we know DIMES_DIR, then we can know DIMES_LIBDIR. + dnl We don't overwrite DIMES_LIBDIR. + if test -n "${DIMES_DIR}" -a -z "${DIMES_LIBDIR}"; then + DIMES_LIBDIR="${DIMES_DIR}/lib"; + dnl We may have DIMES denoting the dir (e.g. on ewok BUT on franklin it contains all flags) + elif test -n "${DIMES}" -a -d "${DIMES}"; then + DIMES_LIBDIR="${DIMES}/lib" + fi + + dnl Add "-I" to DIMES_INCDIR. + if test -n "${DIMES_INCDIR}"; then + DIMES_CPPFLAGS="-I${DIMES_INCDIR}" + else + ac_dimes_ok=no + fi + + dnl Add "-L" to DIMES_LIBDIR. + if test -n "${DIMES_LIBDIR}"; then + DIMES_LDFLAGS="-L${DIMES_LIBDIR}" + else + ac_dimes_ok=no + fi + + save_CPPFLAGS="$CPPFLAGS" + save_LIBS="$LIBS" + save_LDFLAGS="$LDFLAGS" + if test "x${ac_portals_lib_ok}" == "xyes"; then + dnl LIBS="$LIBS -ldart2 -lspaces" + echo "DIMES currently NOT supported for Cray Portals!" + AM_CONDITIONAL(HAVE_DIMES, false) + elif test "x${ac_dcmf_lib_ok}" == "xyes"; then + LIBS="$LIBS -ldspaces -ldscommon -ldart" + else + LIBS="$LIBS -ldspaces -ldscommon -ldart" + fi + LDFLAGS="$LDFLAGS $DIMES_LDFLAGS" + CPPFLAGS="$CPPFLAGS $DIMES_CPPFLAGS" + + if test -z "${HAVE_DIMES_TRUE}"; then + AC_CHECK_HEADERS(dimes_interface.h, + , + [AM_CONDITIONAL(HAVE_DIMES,false)]) + fi + + if test -z "${HAVE_DIMES_TRUE}"; then + # Check for the DataSpaces/DIMES library and headers + if test -z "${HAVE_CRAY_PMI_TRUE}" -a -z "${HAVE_CRAY_UGNI_TRUE}"; then + AC_TRY_LINK([#include "dimes_interface.h"], + [int err; dimes_put_sync_all();], + [DIMES_LIBS="-ldspaces -ldscommon -ldart"], + [AM_CONDITIONAL(HAVE_DIMES,false)]) + elif test "x${ac_infiniband_lib_ok}" == "xyes"; then + AC_TRY_COMPILE([#include "dimes_interface.h"], + [int err; dimes_put_sync_all();], + [DIMES_LIBS="-ldspaces -ldscommon -ldart"], + [AM_CONDITIONAL(HAVE_DIMES,false)]) + elif test "x${ac_dcmf_lib_ok}" == "xyes"; then + AC_TRY_COMPILE([#include "dimes_interface.h"], + [int err; dimes_put_sync_all();], + [DIMES_LIBS="-ldspaces -ldscommon -ldart"], + [AM_CONDITIONAL(HAVE_DIMES,false)]) + elif test "x${ac_pami_lib_ok}" == "xyes"; then + AC_TRY_COMPILE([#include "dimes_interface.h"], + [int err; dimes_put_sync_all();], + [DIMES_LIBS="-ldspaces -ldscommon -ldart"], + [AM_CONDITIONAL(HAVE_DIMES,false)]) + else + AM_CONDITIONAL(HAVE_DIMES,false) + fi + fi + + LIBS="$save_LIBS" + LDFLAGS="$save_LDFLAGS" + CPPFLAGS="$save_CPPFLAGS" + + AC_SUBST(DIMES_LIBS) + AC_SUBST(DIMES_LDFLAGS) + AC_SUBST(DIMES_CPPFLAGS) + + # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: + if test -z "${HAVE_DIMES_TRUE}"; then + ifelse([$1],,[AC_DEFINE(HAVE_DIMES,1,[Define if you have the DIMES.])],[$1]) + : + else + $2 + : + fi + +fi +])dnl AC_DIMES diff --git a/tests/libs/adios/config/ac_dmalloc.m4 b/tests/libs/adios/config/ac_dmalloc.m4 new file mode 100644 index 0000000000..71f0c9e4c5 --- /dev/null +++ b/tests/libs/adios/config/ac_dmalloc.m4 @@ -0,0 +1,72 @@ +# +# +# AC_DMALLOC +# +# +# +dnl @synopsis AC_DMALLOC +dnl +dnl This macro test if dmalloc is to be used. +dnl Use in C code: +dnl #ifdef DMALLOC +dnl #include "dmalloc.h" +dnl #endif +dnl +dnl @version 1.0 +dnl @author Norbert Podhorszki, ORNL +dnl +AC_DEFUN([AC_DMALLOC],[ + +AM_CONDITIONAL(HAVE_DMALLOC,true) + +AC_ARG_WITH(dmalloc, + [ --with-dmalloc=DIR Location of dmalloc library], + [DMALLOC_LDFLAGS="-L$withval/lib"; + DMALLOC_CPPFLAGS="-I$withval/include";], + [with_dmalloc=no]) + +dnl If --without-hdf5 was given set HAVE_HDF5 to false and do nothing more +dnl If nothing was given, then too, do nothing +if test "x$with_dmalloc" == "xno"; then + + AM_CONDITIONAL(HAVE_DMALLOC,false) + +else + + save_CPPFLAGS="$CPPFLAGS" + save_LIBS="$LIBS" + save_LDFLAGS="$LDFLAGS" + LIBS="$LIBS -ldmalloc" + LDFLAGS="$LDFLAGS $DMALLOC_LDFLAGS" + CPPFLAGS="$CPPFLAGS $DMALLOC_CPPFLAGS" + + if test -z "${HAVE_DMALLOC_TRUE}"; then + AC_CHECK_HEADERS(dmalloc.h, + , + [AM_CONDITIONAL(HAVE_DMALLOC,false)]) + fi + + # Check for the dmalloc library and headers + AC_TRY_COMPILE([#include "dmalloc.h"], + [char * s; s=malloc(sizeof(char)*10); free(s);], + [DMALLOC_LIBS="-ldmallocth"], + [AM_CONDITIONAL(HAVE_DMALLOC,false)]) + + LIBS="$save_LIBS" + LDFLAGS="$save_LDFLAGS" + CPPFLAGS="$save_CPPFLAGS" + + AC_SUBST(DMALLOC_LIBS) + AC_SUBST(DMALLOC_LDFLAGS) + AC_SUBST(DMALLOC_CPPFLAGS) + + # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: + if test -z "${HAVE_DMALLOC_TRUE}"; then + ifelse([$1],,[AC_DEFINE(HAVE_DMALLOC,1,[Define if you have DMALLOC.])],[$1]) + : + else + $2 + : + fi +fi +])dnl AC_DMALLOC diff --git a/tests/libs/adios/config/ac_fastbit.m4 b/tests/libs/adios/config/ac_fastbit.m4 new file mode 100644 index 0000000000..510b077a74 --- /dev/null +++ b/tests/libs/adios/config/ac_fastbit.m4 @@ -0,0 +1,73 @@ +AC_DEFUN([AC_FASTBIT], [ + +dnl Enable the --with-fastbit=path configure argument +AC_ARG_WITH( + [fastbit], + [AS_HELP_STRING( + [--with-fastbit=DIR], + [Location of the FastBit library] + )]dnl +) + +dnl If the lib was specified, verify that it exists and can compile +if test "x$with_fastbit" != xno; then + FASTBIT_CPPFLAGS="-I$with_fastbit/include" + FASTBIT_LDFLAGS="-L$with_fastbit/lib" + FASTBIT_LIBS="-lfastbit" + + saveCPPFLAGS="$CPPFLAGS" + saveLDFLAGS="$LDFLAGS" + + AC_LANG_PUSH([C++]) + + CPPFLAGS="$CPPFLAGS $FASTBIT_CPPFLAGS" + LDFLAGS="$LDFLAGS $FASTBIT_LDFLAGS $FASTBIT_LIBS" + + AC_CHECK_HEADERS( + [iapi.h], + [HAVE_FASTBIT=y], + [HAVE_FASTBIT="";dnl + AC_MSG_RESULT( + [Cannot find iapi.h from the FastBit lib. Make sure it has been properly installed at the path specified ($with_fastbit).]dnl + )]dnl + ) + +dnl Removed this test because FastBit is all C++, and autoconf chokes on C++ lib linking tests +dnl AC_CHECK_LIB( +dnl [fastbit], +dnl [ibis::gParameters], +dnl [AC_DEFINE( +dnl [HAVE_FASTBIT], +dnl [1], +dnl [Define if you have FastBit] +dnl )], +dnl [AC_MSG_FAILURE( +dnl [Cannot successfully link with the FastBit lib. Make sure it has been properly installed at the path specified ($with_fastbit).]dnl +dnl )],dnl +dnl ) + + CPPFLAGS="$saveCPPFLAGS" + LDFLAGS="$saveLDFLAGS" + + AC_LANG_POP([C++]) + + if test -z "$HAVE_FASTBIT"; then + AM_CONDITIONAL(HAVE_FASTBIT,false) + AC_MSG_RESULT([Not building with FastBit library]) + else + AC_SUBST(FASTBIT_CPPFLAGS) + AC_SUBST(FASTBIT_LDFLAGS) + AC_SUBST(FASTBIT_LIBS) + + AM_CONDITIONAL(HAVE_FASTBIT,true) + AC_DEFINE([HAVE_FASTBIT], [1], [Define if we have libfastbit]) + + AC_MSG_RESULT([FastBit library found at $with_fastbit]) + fi +else + AM_CONDITIONAL(HAVE_FASTBIT,false) + + AC_MSG_RESULT([Not building with FastBit library]) +fi + +]) dnl End of DEFUN diff --git a/tests/libs/adios/config/ac_fgr.m4 b/tests/libs/adios/config/ac_fgr.m4 new file mode 100644 index 0000000000..791546ba4a --- /dev/null +++ b/tests/libs/adios/config/ac_fgr.m4 @@ -0,0 +1,67 @@ +# +# +# AC_FGR +# +# +# +dnl @synopsis AC_FGR +dnl +dnl This macro test if fgr (for Titan only) is to be used. +dnl Use in C code: +dnl #ifdef FGR +dnl #include "fgr.h" +dnl #endif +dnl +dnl @version 1.0 +dnl @author Qing Liu, ORNL +dnl +AC_DEFUN([AC_FGR],[ + +AC_MSG_NOTICE([=== checking for FGR ===]) + +AM_CONDITIONAL(HAVE_FGR,true) + +AC_ARG_WITH(fgr, + [ --with-fgr=DIR Location of FGR library], + [FGR_LDFLAGS="-L$withval/lib"; + FGR_LIBS="-lfgr"; + FGR_CPPFLAGS="-I$withval/include";], + [with_fgr=no]) + +if test "x$with_fgr" == "xno"; then + + AM_CONDITIONAL(HAVE_FGR,false) + +else + + save_CPPFLAGS="$CPPFLAGS" + save_LIBS="$LIBS" + save_LDFLAGS="$LDFLAGS" + LIBS="$LIBS -lfgr" + LDFLAGS="$LDFLAGS $FDR_LDFLAGS" + CPPFLAGS="$CPPFLAGS $FDR_CPPFLAGS" + + # Check for the FGR library and headers + dnl AC_TRY_COMPILE([struct obd_uuid {char uuid[40];};int fd, num_ost;struct obd_uuid uuids[1024];], + dnl [llapi_lov_get_uuids(fd, uuids, &num_ost);], + dnl [LUSTRE_LIBS="-llustreapi"], + dnl [AM_CONDITIONAL(HAVE_LUSTRE,false)]) + + LIBS="$save_LIBS" + LDFLAGS="$save_LDFLAGS" + CPPFLAGS="$save_CPPFLAGS" + + AC_SUBST(FGR_LIBS) + AC_SUBST(FGR_LDFLAGS) + AC_SUBST(FGR_CPPFLAGS) + + # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: + if test -z "${HAVE_FGR_TRUE}"; then + ifelse([$1],,[AC_DEFINE(HAVE_FGR,1,[Define if you have FGR.])],[$1]) + : + else + $2 + : + fi +fi +])dnl AC_FGR diff --git a/tests/libs/adios/config/ac_flexpath.m4 b/tests/libs/adios/config/ac_flexpath.m4 new file mode 100644 index 0000000000..a358e1aeca --- /dev/null +++ b/tests/libs/adios/config/ac_flexpath.m4 @@ -0,0 +1,110 @@ + +AC_DEFUN([AC_FLEXPATH], [ + + +AC_MSG_NOTICE([=== checking for FLEXPATH ===]) + +FP_SRCDIR="" +FP_CPPFLAGS="" +FP_LDFLAGS="" +FP_LIBS="" + +ac_flexpath_ok=yes + +temptest=enable + +flexpath_dir="" + + +AC_ARG_WITH(flexpath, + [ --with-flexpath=DIR Location of FlexPath], + [ ac_with_flexpath=$withval], [with_flexpath=no]) + +if test "x$with_flexpath" = "xno"; then + ac_flexpath_ok=no + temptest=disable + +elif test x"$with_flexpath" != xyes -a x"$with_flexpath" != xcheck; then + +AC_MSG_CHECKING(got with flexpath argument $with_flexpath) +# with_evpath=$with_flexpath + +fi + +if test "x$ac_flexpath_ok" != "xno"; then + + flexpath_dir=$withval + datatap_dir=$withval + + CERCS_REQUIRE_PACKAGE(evpath, evpath.h, libevpath.a) + CERCS_REQUIRE_PACKAGE(ffs, ffs.h,libffs.a) + CERCS_REQUIRE_PACKAGE(atl, atl.h,libatl.a) + CERCS_REQUIRE_PACKAGE(dill, dill.h, libdill.a) + CERCS_REQUIRE_PACKAGE(cercs_env, cercs_env.h, libcercs_env.a) + + + if test -n "$cercs_cv_evpath_link_dir" -a -n "$cercs_cv_evpath_include_arg";then + FP_LDFLAGS="$FP_LDFLAGS -L$cercs_cv_evpath_link_dir" + FP_LIBS="$FP_LIBS -levpath" + FP_CFLAGS="$FP_CFLAGS $cercs_cv_evpath_include_arg" + FP_CPPFLAGS="$FP_CPPFLAGS $cercs_cv_evpath_include_arg" + else + echo "FLEXPATH couldn't find evpath - Not building flexpath" + ac_flexpath_ok=no + fi + if test -n "$cercs_cv_ffs_link_dir" -a -n "$cercs_cv_ffs_include_arg"; then + FP_LDFLAGS="$FP_LDFLAGS -L$cercs_cv_ffs_link_dir" + FP_LIBS="$FP_LIBS -lffs" + FP_CFLAGS="$FP_CFLAGS $cercs_cv_ffs_include_arg" + FP_CPPFLAGS="$FP_CPPFLAGS $cercs_cv_ffs_include_arg" + else + echo "FLEXPATH couldn't find ffs - Not building flexpath" + ac_flexpath_ok=no + fi + if test -n "$cercs_cv_atl_link_dir" -a -n "$cercs_cv_atl_include_arg"; then + FP_LDFLAGS="$FP_LDFLAGS -L$cercs_cv_atl_link_dir" + FP_LIBS="$FP_LIBS -latl" + FP_CFLAGS="$FP_CFLAGS $cercs_cv_atl_include_arg" + FP_CPPFLAGS="$FP_CPPFLAGS $cercs_cv_atl_include_arg" + else + ac_flexpath_ok=no + echo "FLEXPATH couldn't find atl - Not building flexpath" + fi + if test -n "$cercs_cv_dill_link_dir" -a -n "$cercs_cv_dill_include_arg"; then + FP_LDFLAGS="$FP_LDFLAGS -L$cercs_cv_dill_link_dir" + FP_LIBS="$FP_LIBS -ldill" + FP_CFLAGS="$FP_CFLAGS $cercs_cv_dill_include_arg" + FP_CPPFLAGS="$FP_CPPFLAGS $cercs_cv_dill_include_arg" + else + ac_flexpath_ok=no + echo "FLEXPATH couldn't find dill - Not building flexpath" + fi + if test -n "$cercs_cv_cercs_env_link_dir" -a -n "$cercs_cv_cercs_env_include_arg"; then + FP_LDFLAGS="$FP_LDFLAGS -L$cercs_cv_cercs_env_link_dir" + FP_LIBS="$FP_LIBS -lcercs_env" + FP_CFLAGS="$FP_CFLAGS $cercs_cv_cercs_env_include_arg" + FP_CPPFLAGS="$FP_CPPFLAGS $cercs_cv_cercs_env_include_arg" + else + ac_flexpath_ok=no + echo "FLEXPATH couldn't find cercs_env - Not building flexpath" + fi + +fi + +AC_SUBST(FP_LIBS) +AC_SUBST(FP_CPPFLAGS) +AC_SUBST(FP_LDFLAGS) + + +if test "x$ac_flexpath_ok" = "xyes"; then + HAVE_FLEXPATH=1 + NO_FLEXPATH=0 +else + HAVE_FLEXPATH=0 + NO_FLEXPATH=1 +fi +AM_CONDITIONAL(HAVE_FLEXPATH, test "x$ac_flexpath_ok" = "xyes") +AC_DEFINE_UNQUOTED(NO_FLEXPATH, $NO_FLEXPATH, [Flexpath is disabled]) +AC_DEFINE_UNQUOTED(HAVE_FLEXPATH, $HAVE_FLEXPATH, [Flexpath is enabled]) + +]) dnl AC_FLEXPATH diff --git a/tests/libs/adios/config/ac_glib.m4 b/tests/libs/adios/config/ac_glib.m4 new file mode 100644 index 0000000000..268522f0b1 --- /dev/null +++ b/tests/libs/adios/config/ac_glib.m4 @@ -0,0 +1,67 @@ +# +# +# AC_GLIB +# +# +# +dnl @synopsis AC_GLIB +dnl +dnl This macro test if glib (for Titan only) is to be used. +dnl Use in C code: +dnl #ifdef GLIB +dnl #include "glib.h" +dnl #endif +dnl +dnl @version 1.0 +dnl @author Qing Liu, ORNL +dnl +AC_DEFUN([AC_GLIB],[ + +AC_MSG_NOTICE([=== checking for GLIB ===]) + +AM_CONDITIONAL(HAVE_GLIB,true) + +AC_ARG_WITH(glib, + [ --with-glib=DIR Location of GLIB], + [GLIB_LDFLAGS="-L$withval/lib"; + GLIB_LIBS="-lglib-2.0"; + GLIB_CPPFLAGS="-I$withval/include/glib-2.0 -I$withval/lib/glib-2.0/include";], + [with_glib=no]) + +if test "x$with_glib" == "xno"; then + + AM_CONDITIONAL(HAVE_GLIB,false) + +else + + save_CPPFLAGS="$CPPFLAGS" + save_LIBS="$LIBS" + save_LDFLAGS="$LDFLAGS" + LIBS="$LIBS -lglib-2.0" + LDFLAGS="$LDFLAGS $GLIB_LDFLAGS" + CPPFLAGS="$CPPFLAGS $GLIB_CPPFLAGS" + + # Check for the GLIB library and headers + AC_TRY_COMPILE([#include "glib.h"], + [GHashTable * ght], + [GLIB_LIBS="-lglib-2.0"], + [AM_CONDITIONAL(HAVE_GLIB,false)]) + + LIBS="$save_LIBS" + LDFLAGS="$save_LDFLAGS" + CPPFLAGS="$save_CPPFLAGS" + + AC_SUBST(GLIB_LIBS) + AC_SUBST(GLIB_LDFLAGS) + AC_SUBST(GLIB_CPPFLAGS) + + # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: + if test -z "${HAVE_GLIB_TRUE}"; then + ifelse([$1],,[AC_DEFINE(HAVE_GLIB,1,[Define if you have GLIB.])],[$1]) + : + else + $2 + : + fi +fi +])dnl AC_GLIB diff --git a/tests/libs/adios/config/ac_hdf5.m4 b/tests/libs/adios/config/ac_hdf5.m4 new file mode 100644 index 0000000000..fe7c1af8bf --- /dev/null +++ b/tests/libs/adios/config/ac_hdf5.m4 @@ -0,0 +1,133 @@ +dnl ###################################################################### +dnl +dnl Finds HDF5 +dnl +dnl ###################################################################### + +AC_DEFUN([AC_HDF5], +[ +AC_MSG_NOTICE([=== checking for HDF5 ===]) + +AM_CONDITIONAL(HAVE_HDF5,true) + +dnl Automatic checking for HDF5 is disabled now. +AC_ARG_WITH(hdf5, + [ --with-hdf5=], + [HDF5_DIR=$withval], [with_hdf5=no]) + +AC_ARG_WITH(hdf5-incdir, + [ --with-hdf5-incdir=], + [HDF5_INCDIR=$withval + with_hdf5=detailed]) + +AC_ARG_WITH(hdf5-libdir, + [ --with-hdf5-libdir=], + [HDF5_LIBDIR=$withval + with_hdf5=detailed]) + +AC_ARG_WITH(hdf5-libs, + [ --with-hdf5-libs=, e.g. -lhdf5 -lhdf5_hl -lz>], + [HDF5_LIBS=$withval + with_hdf5=detailed]) + + +dnl If --without-hdf5 was given set HAVE_HDF5 to false and do nothing more +dnl If nothing was given, then too, do nothing +if test "x$with_hdf5" == "xno"; then + + AM_CONDITIONAL(HAVE_HDF5,false) + +else + + dnl If we know HDF5_DIR, then we can know HDF5_INCDIR. + dnl We don't overwrite HDF5_INCDIR. + if test -z "${HDF5_INCDIR}"; then + if test -n "${HDF5_DIR}"; then + HDF5_INCDIR="${HDF5_DIR}/include"; + fi + fi + + dnl If we know HDF5_DIR, then we can know HDF5_LIBDIR. + dnl We don't overwrite HDF5_LIBDIR. + if test -z "${HDF5_LIBDIR}"; then + if test -n "${HDF5_DIR}"; then + HDF5_LIBDIR="${HDF5_DIR}/lib"; + fi + fi + + dnl Add "-I" to HDF5_INCDIR. + HDF5_CPPFLAGS="-I${HDF5_INCDIR}" + + dnl Add "-L" to HDF5_LIBDIR. + HDF5_LDFLAGS="-L${HDF5_LIBDIR}" + + dnl if hdf5 libs are not defined then guess and define it + if test -z "${HDF5_LIBS}"; then + dnl default HDF5 lib is usually just -lhdf5 -lz + HDF5_LIBS="-lhdf5_hl -lhdf5 -lz" + fi + + save_CC="$CC" + save_CPPFLAGS="$CPPFLAGS" + save_LIBS="$LIBS" + save_LDFLAGS="$LDFLAGS" + LIBS="$LIBS $HDF5_LIBS" + LDFLAGS="$LDFLAGS $HDF5_LDFLAGS" + CPPFLAGS="$CPPFLAGS $HDF5_CPPFLAGS" + CC="$MPICC" + + if test -z "${HAVE_HDF5_TRUE}"; then + dnl AC_CHECK_HEADERS(hdf5.h, + dnl , + dnl [if test "x$with_hdf5" != xcheck; then + dnl AC_MSG_FAILURE( [--with-hdf5 was given, but test for hdf5.h failed]) + dnl fi + dnl AM_CONDITIONAL(HAVE_HDF5,false)]) + AC_MSG_CHECKING([for hdf5.h]) + if test -f ${HDF5_INCDIR}/hdf5.h; then + AC_MSG_RESULT(yes) + else + AM_CONDITIONAL(HAVE_HDF5,false) + AC_MSG_RESULT(no) + AC_MSG_FAILURE( [--with-hdf5 was given, but test for ${HDF5_INCDIR}/hdf5.h failed]) + fi + fi + + if test -z "${HAVE_HDF5_TRUE}"; then + AC_MSG_CHECKING([if hdf5 code can be compiled]) + AC_TRY_COMPILE([#include "hdf5.h"], + [hid_t file_id; + herr_t status; + file_id = H5Fcreate("a.h5", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + status = H5Fclose(file_id); + ], + [AC_MSG_RESULT(yes)], + [AC_MSG_RESULT(no) + if test "x$with_hdf5" != xcheck; then + AC_MSG_FAILURE( [--with-hdf5 was given, but compile test failed]) + fi + AM_CONDITIONAL(HAVE_HDF5,false) + ]) + + AC_SUBST(HDF5_LIBS) + AC_SUBST(HDF5_LDFLAGS) + AC_SUBST(HDF5_CPPFLAGS) + fi + + LIBS="$save_LIBS" + LDFLAGS="$save_LDFLAGS" + CPPFLAGS="$save_CPPFLAGS" + CC="$save_CC" + + # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: + if test -z "${HAVE_HDF5_TRUE}"; then + ifelse([$1],,[AC_DEFINE(HAVE_HDF5,1,[Define if you have HDF5.])],[$1]) + : + else + $2 + : + fi + +fi + +]) diff --git a/tests/libs/adios/config/ac_infiniband.m4 b/tests/libs/adios/config/ac_infiniband.m4 new file mode 100644 index 0000000000..aec79a5619 --- /dev/null +++ b/tests/libs/adios/config/ac_infiniband.m4 @@ -0,0 +1,136 @@ +dnl @synopsis AC_INFINIBAND([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) +dnl +dnl This macro tries to find out how to compile programs that +dnl use the Infiniband ibverbs API. +dnl +dnl On success, it defines HAVE_INFINIBAND and sets INFINIBAND_LIBS +dnl to any libraries that are needed for linking +dnl Infiniband (e.g. -libverbs,...). +dnl +dnl If you want to compile everything with Portals, you should set: +dnl +dnl LIBS="$PTL_LIBS $LIBS" +dnl +dnl ACTION-IF-FOUND is a list of shell commands to run if a Infiniband +dnl library is found, and ACTION-IF-NOT-FOUND is a list of commands +dnl to run it if it is not found. If ACTION-IF-FOUND is not specified, +dnl the default action will define HAVE_INFINIBAND. +dnl +dnl @version $Id: ac_infiniband.m4 676 2006-05-16 20:44:08Z thkorde $ +dnl @author Todd H. Kordenbrock + +AC_DEFUN([AC_INFINIBAND], [ +AC_REQUIRE([AC_CANONICAL_HOST]) +AC_REQUIRE([ACX_PTHREAD]) +AC_LANG_SAVE +AC_LANG_C +ac_infiniband_hdr_ok=no +ac_infiniband_lib_ok=no +ac_with_infiniband=no + + +INFINIBAND_CFLAGS="" +INFINIBAND_CPPFLAGS="" +INFINIBAND_LDFLAGS="" +INFINIBAND_LIBS="" + +AC_ARG_WITH(infiniband, + [ --with-infiniband=DIR Location of Infiniband], + [ INFINIBAND_DIR=$withval;], [with_infiniband=yes]) + + + +if test x"$with_infiniband" = xno; then + + ac_with_infiniband=no; + +elif test x"$with_infiniband" = xyes -o x"$with_infiniband" = x; then + + INFINIBAND_CPPFLAGS=""; + INFINIBAND_LDFLAGS=""; + ac_with_infiniband=yes; + +else + + INFINIBAND_CPPFLAGS="-I$withval/include"; + INFINIBAND_LDFLAGS="-L$withval/lib64 -L$withval/lib"; + ac_with_infiniband=yes; + +fi + +AM_CONDITIONAL(HAVE_INFINIBAND,test x$ac_with_infiniband = xyes) + + +dnl Check for command-line disable +if test x"$ac_with_infiniband" = xyes; then + + AC_MSG_NOTICE([=== checking for INFINIBAND ===]) + + dnl Look for Infiniband header files + save_CPPFLAGS=$CPPFLAGS; + save_LDFLAGS=$LDFLAGS; + CPPFLAGS="$CPPFLAGS $INFINIBAND_CPPFLAGS" + LDFLAGS="$LDFLAGS $INFINIBAND_LDFLAGS" + + + if test x"$ac_infiniband_hdr_ok" = xno; then + AC_CHECK_HEADER(infiniband/verbs.h, + [AC_DEFINE(HAVE_IBVERBS_H, 1, + [Define to 1 if you have .]) + ac_infiniband_hdr_ok=yes; + INFINIBAND_CFLAGS="$INFINIBAND_CFLAGS $EXTRA_CFLAGS"; + INFINIBAND_CPPFLAGS="$INFINIBAND_CPPFLAGS $EXTRA_CFLAGS"], + [ac_infiniband_hdr_ok=no]) + fi + + if test x"$ac_infiniband_hdr_ok" = xno; then + CPPFLAGS=$save_CPPFLAGS + fi + + dnl Look for -libverbs + if test x"$ac_infiniband_lib_ok" = xno -a x$ac_infiniband_hdr_ok = xyes; then + save_LIBS=$LIBS; + LIBS="" + AC_SEARCH_LIBS(ibv_alloc_pd,[ibverbs], + [ac_infiniband_lib_ok=yes], + [ac_infiniband_lib_ok=no], + [$save_LIBS $PTHREAD_LDFLAGS $PTHREAD_LIBS]) + if test -n $LIBS; then + INFINIBAND_LIBS="$INFINIBAND_LIBS $LIBS"; + fi + LIBS=$save_LIBS; + fi + + if test x"$ac_infiniband_hdr_ok" = xno -o x$ac_infiniband_lib_ok = xno; then + AM_CONDITIONAL(HAVE_INFINIBAND,false) + INFINIBAND_CFLAGS="" + INFINIBAND_CPPFLAGS="" + INFINIBAND_LDFLAGS="" + INFINIBAND_LIBS="" + ac_with_infiniband=no + else + AM_CONDITIONAL(HAVE_INFINIBAND,true) + fi + + CPPFLAGS=$save_CPPFLAGS; + LDFLAGS=$save_LDFLAGS; + + AC_SUBST(INFINIBAND_CPPFLAGS) + AC_SUBST(INFINIBAND_CFLAGS) + AC_SUBST(INFINIBAND_LDFLAGS) + AC_SUBST(INFINIBAND_LIBS) + + + # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: + if test x"$ac_infiniband_lib_ok" = xyes; then + ifelse([$1],,[AC_DEFINE(HAVE_INFINIBAND,1,[Define if you have the Infiniband.])],[$1]) + : + else + $2 + : + fi + +fi + +AC_LANG_RESTORE +])dnl AC_INFINIBAND diff --git a/tests/libs/adios/config/ac_isobar.m4 b/tests/libs/adios/config/ac_isobar.m4 new file mode 100755 index 0000000000..3e19c8c0a9 --- /dev/null +++ b/tests/libs/adios/config/ac_isobar.m4 @@ -0,0 +1,73 @@ +# +# +# AC_ISOBAR +# +# +# +dnl @synopsis AC_ISOBAR +dnl +dnl This macro test if ISOBAR is to be used. +dnl Use in C code: +dnl #ifdef ISOBAR +dnl #include "isobar.h" +dnl #endif +dnl +dnl @version 1.0 +dnl @author Zhenhuan (Steve) Gong +dnl +AC_DEFUN([AC_ISOBAR],[ + +AC_MSG_NOTICE([=== checking for ISOBAR ===]) + +AM_CONDITIONAL(HAVE_ISOBAR,true) + +AC_ARG_WITH(isobar, + [ --with-isobar=DIR Location of ISOBAR library], + [ISOBAR_LDFLAGS="-L$withval/lib"; + ISOBAR_LIBS="-lisobar -lz"; + ISOBAR_CPPFLAGS="-I$withval/include";], + [with_isobar=no]) + +if test "x$with_isobar" == "xno"; then + + AM_CONDITIONAL(HAVE_ISOBAR,false) + +else + + save_CPPFLAGS="$CPPFLAGS" + save_LIBS="$LIBS" + save_LDFLAGS="$LDFLAGS" + LIBS="$LIBS -lisobar -lz" + LDFLAGS="$LDFLAGS $ISOBAR_LDFLAGS" + CPPFLAGS="$CPPFLAGS $ISOBAR_CPPFLAGS" + + if test -z "${HAVE_ISOBAR_TRUE}"; then + AC_CHECK_HEADERS(isobar.h, + , + [AM_CONDITIONAL(HAVE_ISOBAR,false)]) + fi + + # Check for the ISOBAR library and headers + dnl AC_TRY_COMPILE([struct obd_uuid {char uuid[40];};int fd, num_ost;struct obd_uuid uuids[1024];], + dnl [llapi_lov_get_uuids(fd, uuids, &num_ost);], + dnl [ISOBAR_LIBS="-lisobar -lz"], + dnl [AM_CONDITIONAL(HAVE_ISOBAR,false)]) + + LIBS="$save_LIBS" + LDFLAGS="$save_LDFLAGS" + CPPFLAGS="$save_CPPFLAGS" + + AC_SUBST(ISOBAR_LIBS) + AC_SUBST(ISOBAR_LDFLAGS) + AC_SUBST(ISOBAR_CPPFLAGS) + + # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: + if test -z "${HAVE_ISOBAR_TRUE}"; then + ifelse([$1],,[AC_DEFINE(HAVE_ISOBAR,1,[Define if you have ISOBAR.])],[$1]) + : + else + $2 + : + fi +fi +])dnl AC_ISOBAR diff --git a/tests/libs/adios/config/ac_lustre.m4 b/tests/libs/adios/config/ac_lustre.m4 new file mode 100644 index 0000000000..f72741b6c8 --- /dev/null +++ b/tests/libs/adios/config/ac_lustre.m4 @@ -0,0 +1,145 @@ +# +# +# AC_LUSTRE +# +# +# +dnl @synopsis AC_LUSTRE +dnl +dnl This macro test if lustreapi.a can be used +dnl @version 2.0 +dnl @author Qing Liu, UT +dnl @author Norbert Podhorszki, ORNL +dnl +AC_DEFUN([AC_LUSTRE],[ + +AC_MSG_NOTICE([=== checking for Lustre ===]) + +AM_CONDITIONAL(HAVE_LUSTRE,true) + +dnl This is optional, if not given, do nothing +AC_ARG_WITH(lustre, + [ --with-lustre[=DIR] Location of lustre library], + [:],[with_lustre=no]) + +if test "x${with_lustre}" == "xno"; then + AM_CONDITIONAL(HAVE_LUSTRE,false) +fi + +if test -z "${HAVE_LUSTRE_TRUE}"; then + + dnl AC_MSG_NOTICE([ debug: with_lustre="$with_lustre"]) + save_CPPFLAGS="$CPPFLAGS" + save_LIBS="$LIBS" + save_LDFLAGS="$LDFLAGS" + + if test "x$with_lustre" == "xyes"; then + dnl No path given + LUSTRE_CPPFLAGS="" + LUSTRE_LIBS="-llustreapi" + LUSTRE_LDFLAGS="" + else + dnl Path given, first try path/lib64 + LUSTRE_CPPFLAGS="-I${with_lustre}/include" + LUSTRE_LIBS="-llustreapi" + LUSTRE_LDFLAGS="-L${with_lustre}/lib64" + fi + + LIBS="$LIBS $LUSTRE_LIBS" + LDFLAGS="$LDFLAGS $LUSTRE_LDFLAGS" + CPPFLAGS="$CPPFLAGS $LUSTRE_CPPFLAGS" + + oldheader=no + AC_CHECK_HEADERS([lustre/lustreapi.h], + , + [AM_CONDITIONAL(HAVE_LUSTRE,false)]) + + dnl if lustreapi.h is missing, we may still find 1.x lustre's liblustreapi.h + if test -z "${HAVE_LUSTRE_FALSE}"; then + AC_CHECK_HEADERS([lustre/liblustreapi.h], + [AM_CONDITIONAL(HAVE_LUSTRE,true) + oldheader=yes], + [AM_CONDITIONAL(HAVE_LUSTRE,false)]) + fi + + if test -z "${HAVE_LUSTRE_TRUE}"; then + dnl Check for the lustre library + AC_MSG_CHECKING([if lustre code can be linked with $LUSTRE_LDFLAGS]) + if test "${oldheader}" == "no" ; then + AC_TRY_LINK( + [#include + #include "lustre/lustreapi.h" + int fd, num_ost; + struct obd_uuid uuids[1024];], + [llapi_lov_get_uuids(fd, uuids, &num_ost);], + [AC_MSG_RESULT(yes)], + [AM_CONDITIONAL(HAVE_LUSTRE,false) + AC_MSG_RESULT(no) + ]) + else + AC_TRY_LINK( + [#include + #include "lustre/liblustreapi.h" + int fd, num_ost; + struct obd_uuid uuids[1024];], + [llapi_lov_get_uuids(fd, uuids, &num_ost);], + [AC_MSG_RESULT(yes)], + [AM_CONDITIONAL(HAVE_LUSTRE,false) + AC_MSG_RESULT(no) + ]) + fi + fi + + dnl If Linking above failed, one reason might be that we looked in lib64/ instead of lib/ + if test -z "${HAVE_LUSTRE_FALSE}"; then + if test "x$with_lustre" != "xyes"; then + LUSTRE_LDFLAGS="-L${with_lustre}/lib" + LDFLAGS="$save_LDFLAGS $LUSTRE_LDFLAGS" + dnl Check for the lustre library + AC_MSG_CHECKING([if lustre code can be linked with $LUSTRE_LDFLAGS]) + if test "${oldheader}" == "no" ; then + AC_TRY_LINK( + [#include + #include "lustre/lustreapi.h" + int fd, num_ost; + struct obd_uuid uuids[1024];], + [llapi_lov_get_uuids(fd, uuids, &num_ost);], + [AM_CONDITIONAL(HAVE_LUSTRE,true) + AC_MSG_RESULT(yes)], + [AM_CONDITIONAL(HAVE_LUSTRE,false) + AC_MSG_RESULT(no) + ]) + else + AC_TRY_LINK( + [#include + #include "lustre/liblustreapi.h" + int fd, num_ost; + struct obd_uuid uuids[1024];], + [llapi_lov_get_uuids(fd, uuids, &num_ost);], + [AM_CONDITIONAL(HAVE_LUSTRE,true) + AC_MSG_RESULT(yes)], + [AM_CONDITIONAL(HAVE_LUSTRE,false) + AC_MSG_RESULT(no) + ]) + fi + fi + fi + + LIBS="$save_LIBS" + LDFLAGS="$save_LDFLAGS" + CPPFLAGS="$save_CPPFLAGS" + + AC_SUBST(LUSTRE_LIBS) + AC_SUBST(LUSTRE_LDFLAGS) + AC_SUBST(LUSTRE_CPPFLAGS) + + # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: + if test -z "${HAVE_LUSTRE_TRUE}"; then + ifelse([$1],,[AC_DEFINE(HAVE_LUSTRE,1,[Define if you have LUSTRE.])],[$1]) + : + else + $2 + : + fi +fi +])dnl AC_LUSTRE diff --git a/tests/libs/adios/config/ac_mxml.m4 b/tests/libs/adios/config/ac_mxml.m4 new file mode 100644 index 0000000000..7290f181bb --- /dev/null +++ b/tests/libs/adios/config/ac_mxml.m4 @@ -0,0 +1,154 @@ +dnl +dnl +dnl AC_PROG_MXML +dnl +dnl Test for Mini-XML +dnl and set $MXML to the correct value. +dnl +dnl +dnl @synopsis AC_MXML +dnl +dnl This macro test if mini-XML is installed. If mini-XML +dnl is installed, it set $MXML to the right value +dnl +dnl @version 2.0 +dnl @author Jay Lofstead lofstead@cc.gatech.edu +dnl @author Norbert Podhorszki pnorbert@ornl.gov +dnl +AC_DEFUN([AC_MXML],[ + +AM_CONDITIONAL(HAVE_MXML,true) +ac_with_mxml=no + +dnl By default assume mxml is installed in system location +AC_ARG_WITH(mxml, + [ --with-mxml=DIR Location of Mini-XML library], + [:]) + +dnl If --without-mxml was given give an error +if test "x$with_mxml" == "xno"; then + + AM_CONDITIONAL(HAVE_MXML,false) + +elif test "x$with_mxml" == "xyes" -o "x$with_mxml" == "x"; then + + dnl If nothing was given, then look in the system libs + if test -n "$MXML_LIB"; then + MXML_LDFLAGS="$MXML_LIB" + else + dnl If not in the environment, then look in the system libs + MXML_LDFLAGS="" + fi + + if test -n "$MXML_INC"; then + MXML_CPPFLAGS="$MXML_INC" + else + MXML_CPPFLAGS="" + fi + ac_with_mxml=yes + +else + + dnl Otherwise, set up the flags + MXML_DIR=$with_mxml + MXML_CPPFLAGS="-I${MXML_DIR}/include" + if test -d "${MXML_DIR}/lib64"; then + MXML_LDFLAGS="-L${MXML_DIR}/lib64"; + else + MXML_LDFLAGS="-L${MXML_DIR}/lib"; + fi + ac_with_mxml=yes + +fi + + +if test "x$ac_with_mxml" == "xyes"; then + + AC_ARG_WITH(mxml-libs, + [ --with-mxml-libs=], + [MXML_LIBS=$withval]) + + save_CPPFLAGS="$CPPFLAGS" + save_LIBS="$LIBS" + save_LDFLAGS="$LDFLAGS" + + CPPFLAGS="$CPPFLAGS $MXML_CPPFLAGS" + LDFLAGS="$LDFLAGS $MXML_LDFLAGS" + + if test -z "$MXML_LIBS"; then + MXML_LIBS="-lmxml" + fi + LIBS="$LIBS ${MXML_LIBS}" + + + AC_CHECK_HEADERS(mxml.h, + , + [AM_CONDITIONAL(HAVE_MXML,false)]) + + if test -z "${HAVE_MXML_TRUE}"; then + dnl Check for the Mini-XML library and headers + AC_MSG_CHECKING([if mxml code can be linked]) + AC_TRY_LINK([#include "mxml.h"], + [mxml_node_t * n; + char *buffer; + char *value; + n = mxmlLoadString (0, buffer, MXML_TEXT_CALLBACK); + mxmlWalkNext (n, n, MXML_DESCEND); + value = mxmlElementGetAttr (n, "value"); + mxmlRelease (n); + ], + [MXML_LIBS="-lmxml" + AC_MSG_RESULT(yes) + ], + [AM_CONDITIONAL(HAVE_MXML,false) + AC_MSG_RESULT(no) + ]) + + dnl If Linking above failed, one reason might be that mxml uses pthreads and + dnl the compiler does not use it by default. Try getting phtreads + if test -z "${HAVE_MXML_FALSE}"; then + dnl Check for the Mini-XML library and headers + AC_REQUIRE([ACX_PTHREAD]) + LDFLAGS="$LDFLAGS $PTHREAD_LDFLAGS" + LIBS="$LIBS $PTHREAD_LIBS" + AC_MSG_CHECKING([if mxml code can be linked using pthreads]) + AC_TRY_LINK([#include "mxml.h"], + [mxml_node_t * n; + char *buffer; + char *value; + n = mxmlLoadString (0, buffer, MXML_TEXT_CALLBACK); + mxmlWalkNext (n, n, MXML_DESCEND); + value = mxmlElementGetAttr (n, "value"); + mxmlRelease (n); + ], + [MXML_LDFLAGS="$MXML_LDFLAGS $PTHREAD_LDFLAGS" + MXML_LIBS="-lmxml $PTHREAD_LIBS" + AM_CONDITIONAL(HAVE_MXML,true) + AC_MSG_RESULT(yes) + ], + [AM_CONDITIONAL(HAVE_MXML,false) + AC_MSG_RESULT(no) + ]) + fi + fi + + + LIBS="$save_LIBS" + LDFLAGS="$save_LDFLAGS" + CPPFLAGS="$save_CPPFLAGS" + + AC_SUBST(MXML_LIBS) + AC_SUBST(MXML_LDFLAGS) + AC_SUBST(MXML_CPPFLAGS) + + dnl Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: + if test -z "${HAVE_MXML_TRUE}"; then + ifelse([$1],,[AC_DEFINE(HAVE_MXML,1,[Define if you have the MXML.])],[$1]) + : + else + $2 + : + fi + +fi +])dnl AC_MXML diff --git a/tests/libs/adios/config/ac_nc4par.m4 b/tests/libs/adios/config/ac_nc4par.m4 new file mode 100644 index 0000000000..1de4b445e6 --- /dev/null +++ b/tests/libs/adios/config/ac_nc4par.m4 @@ -0,0 +1,154 @@ +dnl ###################################################################### +dnl +dnl Finds netCDF 4 parallel +dnl +dnl ###################################################################### + +AC_DEFUN([AC_NC4PAR], +[ +AC_MSG_NOTICE([=== checking NetCDF 4 Parallel ===]) + +AM_CONDITIONAL(HAVE_NC4PAR,true) + +AC_ARG_WITH(nc4par, + [ --with-nc4par=], + [NC4PAR_DIR=$withval], [with_nc4par=no]) + +dnl If --without-nc4par was given set HAVE_NC4PAR to false and do nothing more +dnl Or if nothing was given, by default we don't try to find it anymore +if test "x$with_nc4par" == "xno"; then + + AM_CONDITIONAL(HAVE_NC4PAR,false) + +else + + ac_use_cray_netcdf=no + + dnl allow args --with-nc4par incdir and --with-nc4par-libdir + AC_ARG_WITH(nc4par-incdir, + [ --with-nc4par-incdir=], + [NC4PAR_INCDIR=$withval + with_nc4par=detailed]) + + AC_ARG_WITH(nc4par-libdir, + [ --with-nc4par-libdir=], + [NC4PAR_LIBDIR=$withval + with_nc4par=detailed]) + + AC_ARG_WITH(nc4par-libs, + [ --with-nc4par-libs=, e.g. -lnetcdf>], + [NC4PAR_LIBS=$withval + with_nc4par=detailed]) + + + dnl If we know NC4PAR_DIR, then we can know NC4PAR_INCDIR. + dnl If we know CRAY_NETCDF_DIR, then we leave NC4PAR_INCDIR empty. + dnl Or, if we know NETCDF_DIR, then we can know NC4PAR_INCDIR. + dnl We don't overwrite NC4PAR_INCDIR. + if test -z "${NC4PAR_INCDIR}"; then + if test -n "${NC4PAR_DIR}"; then + NC4PAR_INCDIR="${NC4PAR_DIR}/include"; + elif test -n "${CRAY_NETCDF_DIR}"; then + NC4PAR_INCDIR=""; + ac_use_cray_netcdf=yes + elif test -n "${NETCDF_DIR}"; then + NC4PAR_INCDIR="${NETCDF_DIR}/include"; + fi + fi + + dnl If we know NC4PAR_DIR, then we can know NC4PAR_LIBDIR. + dnl If we know CRAY_NETCDF_DIR, then we leave NC4PAR_LIBDIR empty. + dnl Or, if we know NETCDF_DIR, then we may know NC4PAR_LIBDIR. + dnl We don't overwrite NC4PAR_LIBDIR. + if test -z "${NC4PAR_LIBDIR}"; then + if test -n "${NC4PAR_DIR}"; then + NC4PAR_LIBDIR="${NC4PAR_DIR}/lib"; + elif test -n "${CRAY_NETCDF_DIR}"; then + NC4PAR_LIBDIR=""; + ac_use_cray_netcdf=yes + elif test -n "${NETCDF_DIR}"; then + NC4PAR_LIBDIR="${NETCDF_DIR}/lib" + fi + fi + + dnl Add "-I" to NC4PAR_INCDIR. + if test -n "${NC4PAR_INCDIR}"; then + NC4PAR_CPPFLAGS="-I${NC4PAR_INCDIR}" + else + ac_nc4par=no + fi + + dnl Add "-L" to NC4PAR_LIBDIR + NC4PAR_LIBS. + if test -n "${NC4PAR_LIBDIR}"; then + NC4PAR_LDFLAGS="-L${NC4PAR_LIBDIR}" + else + ac_nc4par=no + fi + + dnl if nc4 libs are not defined (and not Cray nc4 lib), then guess and define it + if test -z "${NC4PAR_LIBS}"; then + if test "${ac_use_cray_netcdf}" != "yes"; then + NC4PAR_LIBS="-lnetcdf" + fi + fi + + save_CC="$CC" + save_CPPFLAGS="$CPPFLAGS" + save_LIBS="$LIBS" + save_LDFLAGS="$LDFLAGS" + LIBS="$LIBS $NC4PAR_LIBS" + LDFLAGS="$LDFLAGS $NC4PAR_LDFLAGS" + CPPFLAGS="$CPPFLAGS $NC4PAR_CPPFLAGS" + CC="$MPICC" + + if test -z "${HAVE_NC4PAR_TRUE}"; then + AC_CHECK_HEADERS(netcdf.h, + , + [if test "x$with_nc4par" != xcheck; then + AC_MSG_FAILURE( [--with-nc4par was given, but test for netcdf.h failed]) + fi + AM_CONDITIONAL(HAVE_NC4PAR,false)]) + fi + + if test -z "${HAVE_NC4PAR_TRUE}"; then + AC_MSG_CHECKING([if nc4 parallel code can be compiled]) + AC_TRY_COMPILE( + [#include "mpi.h" + #include "netcdf.h" + ], + [int ncid; + MPI_Info info; + MPI_Comm comm; + nc_create_par("a.nc", NC_NOCLOBBER|NC_MPIIO|NC_NETCDF4, comm, info, ncid); + nc_close(ncid); + ], + [AC_MSG_RESULT(yes)], + [AC_MSG_RESULT(no) + if test "x$with_nc4par" != xcheck; then + AC_MSG_FAILURE( [--with-nc4par was given, but compile test failed]) + fi + AM_CONDITIONAL(HAVE_NC4PAR,false) + ]) + + AC_SUBST(NC4PAR_LIBS) + AC_SUBST(NC4PAR_LDFLAGS) + AC_SUBST(NC4PAR_CPPFLAGS) + fi + + LIBS="$save_LIBS" + LDFLAGS="$save_LDFLAGS" + CPPFLAGS="$save_CPPFLAGS" + CC="$save_CC" + + # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: + if test -z "${HAVE_NC4PAR_TRUE}"; then + ifelse([$1],,[AC_DEFINE(HAVE_NC4PAR,1,[Define if you have NC4PAR.])],[$1]) + : + else + $2 + : + fi + +fi + +]) diff --git a/tests/libs/adios/config/ac_ncsu_timer.m4 b/tests/libs/adios/config/ac_ncsu_timer.m4 new file mode 100644 index 0000000000..c313aaa18b --- /dev/null +++ b/tests/libs/adios/config/ac_ncsu_timer.m4 @@ -0,0 +1,61 @@ +AC_DEFUN([AX_NCSU_LIBTIMER], [ + +AM_CONDITIONAL(HAVE_NCSU_TIMER,false) + +dnl Enable the --with-timer=path configure argument +AC_ARG_WITH( + [timer], + [AS_HELP_STRING( + [--with-timer=DIR], + [Location of the timer library] + ),[], + [with_timer=no]]dnl +) + +dnl If the timer lib was specified, verify that it exists and can compile +if test "x$with_timer" != xno -a "x$with_timer" != x; then + AM_CONDITIONAL(HAVE_NCSU_TIMER,true) + + TIMER_CPPFLAGS="-I$with_timer/include" + TIMER_LDFLAGS="-L$with_timer/lib" + TIMER_LIBS="-ltimer -lm" + + saveLIB="$LIB" + saveLDFLAGS="$LDFLAGS" + saveCPPFLAGS="$CPPFLAGS" + LIB="$LIB $TIMER_LIBS" + LDFLAGS="$LDFLAGS $TIMER_LDFLAGS" + CPPFLAGS="$CPPFLAGS $TIMER_CPPFLAGS" + + AC_CHECK_HEADERS( + [timer.h], + [], + [AC_MSG_FAILURE( + [Cannot find timer.h from the timer lib. Make sure it has been properly installed at the path specified ($with_timer).]dnl + )]dnl + ) + + AC_CHECK_LIB( + [timer], + [timer_init], + [AC_DEFINE( + [HAVE_NCSU_TIMER], + [1], + [Define if you have libtimer] + )], + [AC_MSG_FAILURE( + [Cannot successfully link with the timer lib. Make sure it has been properly installed at the path specified ($with_timer).]dnl + )], + [-lm]dnl + ) + + LIBS="$saveLIBS" + LDFLAGS="$saveLDFLAGS" + CPPFLAGS="$saveCPPFLAGS" + + AC_SUBST(TIMER_CPPFLAGS) + AC_SUBST(TIMER_LDFLAGS) + AC_SUBST(TIMER_LIBS) +fi + +]) dnl End of DEFUN diff --git a/tests/libs/adios/config/ac_netcdf.m4 b/tests/libs/adios/config/ac_netcdf.m4 new file mode 100644 index 0000000000..8d191a6520 --- /dev/null +++ b/tests/libs/adios/config/ac_netcdf.m4 @@ -0,0 +1,144 @@ +dnl ###################################################################### +dnl +dnl Finds netCDF +dnl +dnl ###################################################################### + +AC_DEFUN([AC_NETCDF], +[ +AC_MSG_NOTICE([=== checking for NetCDF ===]) + +AM_CONDITIONAL(HAVE_NETCDF,true) + +AC_ARG_WITH(netcdf, + [ --with-netcdf=], + [NETCDF_DIR=$withval], [with_netcdf=check]) + +dnl If --without-netcdf was given set HAVE_NETCDF to false and do nothing more +if test "x$with_netcdf" == "xno"; then + + AM_CONDITIONAL(HAVE_NETCDF,false) + +else + + ac_use_cray_netcdf=no + + dnl allow args --with-netcdf incdir and --with-netcdf-libdir + AC_ARG_WITH(netcdf-incdir, + [ --with-netcdf-incdir=], + [NETCDF_INCDIR=$withval + with_netcdf=detailed]) + + AC_ARG_WITH(netcdf-libdir, + [ --with-netcdf-libdir=], + [NETCDF_LIBDIR=$withval + with_netcdf=detailed]) + + AC_ARG_WITH(netcdf-libs, + [ --with-netcdf-libs=, e.g. -lnetcdf>], + [NETCDF_LIBS=$withval + with_netcdf=detailed]) + + dnl If we know NETCDF_DIR, then we can know NETCDF_INCDIR. + dnl If we know CRAY_NETCDF_DIR, then we leave NETCDF_INCDIR empty. + dnl We may have NETCDF denoting the dir (e.g. on ewok BUT on franklin it contains all flags) + dnl We don't overwrite NETCDF_INCDIR. + if test -z "${NETCDF_INCDIR}"; then + if test -n "${NETCDF_DIR}"; then + NETCDF_INCDIR="${NETCDF_DIR}/include"; + elif test -n "${CRAY_NETCDF_DIR}"; then + NETCDF_INCDIR=""; + ac_use_cray_netcdf=yes + elif test -n "${NETCDF}" -a -d "${NETCDF}"; then + NETCDF_INCDIR="${NETCDF}/include" + fi + fi + + dnl If we know NETCDF_DIR, then we can know NETCDF_LIBDIR. + dnl If we know CRAY_NETCDF_DIR, then we leave NETCDF_LIBDIR empty. + dnl We may have NETCDF denoting the dir (e.g. on ewok BUT on franklin it contains all flags) + dnl We don't overwrite NETCDF_LIBDIR. + if test -z "${NETCDF_LIBDIR}"; then + if test -n "${NETCDF_DIR}"; then + NETCDF_LIBDIR="${NETCDF_DIR}/lib"; + elif test -n "${CRAY_NETCDF_DIR}"; then + NETCDF_LIBDIR=""; + ac_use_cray_netcdf=yes + elif test -n "${NETCDF}" -a -d "${NETCDF}"; then + NETCDF_LIBDIR="${NETCDF}/lib" + fi + fi + + dnl Add "-I" to NETCDF_INCDIR. + if test -n "${NETCDF_INCDIR}"; then + NETCDF_CPPFLAGS="-I${NETCDF_INCDIR}" + else + ac_netcdf_ok=no + fi + + dnl Add "-L" to NETCDF_LIBDIR. + if test -n "${NETCDF_LIBDIR}"; then + NETCDF_LDFLAGS="-L${NETCDF_LIBDIR}" + else + ac_netcdf_ok=no + fi + + dnl if netcdf libs are not defined (and not Cray netcdf lib), then guess and define it + if test -z "${NETCDF_LIBS}"; then + if test "${ac_use_cray_netcdf}" != "yes"; then + NETCDF_LIBS="-lnetcdf" + fi + fi + + save_CPPFLAGS="$CPPFLAGS" + save_LIBS="$LIBS" + save_LDFLAGS="$LDFLAGS" + LIBS="$LIBS $NETCDF_LDFLAGS" + LDFLAGS="$LDFLAGS $NETCDF_LDFLAGS" + CPPFLAGS="$CPPFLAGS $NETCDF_CPPFLAGS" + + if test -z "${HAVE_NETCDF_TRUE}"; then + AC_CHECK_HEADERS(netcdf.h, + , + [if test "x$with_netcdf" != xcheck; then + AC_MSG_FAILURE( [--with-netcdf was given, but test for netcdf.h failed]) + fi + AM_CONDITIONAL(HAVE_NETCDF,false)]) + fi + + if test -z "${HAVE_NETCDF_TRUE}"; then + AC_MSG_CHECKING([if netcdf code can be compiled]) + AC_TRY_COMPILE([#include "netcdf.h"], + [int ncid; + nc_create("a.nc", NC_CLOBBER, &ncid); + nc_close(ncid); + ], + [AC_MSG_RESULT(yes)], + [AC_MSG_RESULT(no) + if test "x$with_netcdf" != xcheck; then + AC_MSG_FAILURE( [--with-netcdf was given, but compile test failed]) + fi + AM_CONDITIONAL(HAVE_NETCDF,false) + ]) + + AC_SUBST(NETCDF_LIBS) + AC_SUBST(NETCDF_LDFLAGS) + AC_SUBST(NETCDF_CPPFLAGS) + fi + + LIBS="$save_LIBS" + LDFLAGS="$save_LDFLAGS" + CPPFLAGS="$save_CPPFLAGS" + + # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: + if test -z "${HAVE_NETCDF_TRUE}"; then + ifelse([$1],,[AC_DEFINE(HAVE_NETCDF,1,[Define if you have NETCDF.])],[$1]) + : + else + $2 + : + fi + +fi + +]) diff --git a/tests/libs/adios/config/ac_nssi.m4 b/tests/libs/adios/config/ac_nssi.m4 new file mode 100644 index 0000000000..72debf2f87 --- /dev/null +++ b/tests/libs/adios/config/ac_nssi.m4 @@ -0,0 +1,183 @@ +dnl @synopsis AC_NSSI([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) +dnl +dnl This macro tries to find out how to compile programs that +dnl use the NSSI API. +dnl +dnl On success, it defines HAVE_NSSI and sets NSSI_LIBS +dnl to any libraries that are needed for linking +dnl NSSI (e.g. -lp3utcp, -lp3lib,...). +dnl +dnl If you want to compile everything with NSSI, you should set: +dnl +dnl LIBS="$NSSI_LIBS $LIBS" +dnl +dnl ACTION-IF-FOUND is a list of shell commands to run if a NSSI +dnl library is found, and ACTION-IF-NOT-FOUND is a list of commands +dnl to run it if it is not found. If ACTION-IF-FOUND is not specified, +dnl the default action will define HAVE_NSSI. +dnl +dnl @version $Id: acx_mpi.m4 676 2006-05-16 20:44:08Z raoldfi $ +dnl @author Ron A. Oldfield + +AC_DEFUN([AC_NSSI], [ +AC_REQUIRE([AC_CANONICAL_HOST]) +AC_REQUIRE([AC_PORTALS]) +AC_REQUIRE([AC_INFINIBAND]) +AC_REQUIRE([AC_PABLO]) + +AC_LANG_PUSH([C++]) + +dnl AC_LANG_SAVE +dnl AC_LANG_CPP + +ac_nssi_ok=yes +ac_nssi_path="." + + +AM_CONDITIONAL(HAVE_NSSI,false) + +NSSI_SRCDIR="" +NSSI_BUILDDIR="" +NSSI_CPPFLAGS="" +NSSI_LDFLAGS="" +NSSI_LIBS="-lnssi_client -lnssi_support" +NSSI_SERVER_LIBS="-lnssi_server -lnssi_support" + +AC_ARG_WITH(nssi, + [ --with-nssi=DIR Location of NSSI], + [NSSI_LDFLAGS="-L$withval/lib"; + NSSI_CPPFLAGS="-I$withval/include"; + ac_nssi_path=$withval]) + +dnl Look for a header file +if test x"$ac_nssi_ok" = xyes; then + save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="${CPPFLAGS} ${NSSI_CPPFLAGS}" + AC_CHECK_HEADER(nssi_client.h, + [], + [ac_nssi_ok=no]) + CPPFLAGS="$save_CPPFLAGS" +fi + +if test x"$ac_nssi_ok" = xyes; then + + AC_CHECK_LIB(rt, clock_gettime) + + AC_CHECK_FUNCS(clock_gettime gettimeofday fdatasync pthread_yield sched_yield) + + ac_nssi_ok=no + + dnl Determine which rpc libs to use with NSSI + ac_nssi_flags="none" + if test x"$ac_with_portals" = xyes; then + ac_nssi_flags="$ac_nssi_flags all_portals portals_plus_libcpp portals_plus_pablo" + fi + if test x"$ac_with_infiniband" = xyes; then + ac_nssi_flags="$ac_nssi_flags infiniband" + fi + + for flag in $ac_nssi_flags; do + + case $flag in + none) + AC_MSG_CHECKING([whether nssi works without any additional flags]) + ;; + + -l*) + AC_MSG_CHECKING([whether nssi works with library $flag]) + EXTRA_LIBS="$flag" + ;; + + -*) + AC_MSG_CHECKING([whether nssi works with $flag]) + EXTRA_LIBS="$flag" + ;; + + all_portals) + AC_MSG_CHECKING([whether nssi works with ${PORTALS_LIBS}]) + EXTRA_LIBS="${PORTALS_LIBS}" + ;; + + portals_plus_libcpp) + AC_MSG_CHECKING([whether nssi works with ${PORTALS_LIBS}]) + EXTRA_LIBS="${PORTALS_LIBS}" + ;; + + portals_plus_pablo) + AC_MSG_CHECKING([whether nssi works with ${PORTALS_LIBS} ${PABLO_LIBS}]) + EXTRA_LIBS="${PORTALS_LIBS} ${PABLO_LIBS}" + ;; + + infiniband) + AC_MSG_CHECKING([whether nssi works with ${INFINIBAND_LIBS}]) + EXTRA_LIBS="${INFINIBAND_LIBS}" + ;; + esac + + + save_LDFLAGS="$LDFLAGS" + save_LIBS="$LIBS" + save_CPPFLAGS="$CPPFLAGS" + save_CFLAGS="$CFLAGS" + LDFLAGS="$LDFLAGS $NSSI_LDFLAGS" + LIBS="$LIBS $NSSI_LIBS $EXTRA_LIBS" + CPPFLAGS="$CPPFLAGS $NSSI_CPPFLAGS" + CFLAGS="$CFLAGS $NSSI_CFLAGS $EXTRA_FLAGS" + + dnl AC_MSG_CHECKING([CPPFLAGS=$CPPFLAGS]) + dnl AC_MSG_CHECKING([LDFLAGS=$LDFLAGS]) + dnl AC_MSG_CHECKING([LIBS=$LIBS]) + + dnl Check for various functions. + AC_LINK_IFELSE([AC_LANG_PROGRAM( + [[#include "nssi_client.h"]], + [[nssi_remote_pid server_id;] + [uint64_t timeout;] + [nssi_service svc;] + [nssi_get_service(server_id, timeout, &svc);]])], + [ac_nssi_ok=yes;], + [ac_nssi_ok=no;]) + + + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" + CPPFLAGS="$save_CPPFLAGS" + + AC_MSG_RESULT($ac_nssi_ok) + if test "x$ac_nssi_ok" = xyes; then + NSSI_LIBS="$NSSI_LIBS $EXTRA_LIBS"; + NSSI_SERVER_LIBS="$NSSI_SERVER_LIBS $EXTRA_LIBS" + NSSI_CFLAGS="$NSSI_CFLAGS $EXTRA_CFLAGS"; + break; + fi + + EXTRA_LIBS="" + EXTRA_CFLAGS="" + done +fi + +AM_CONDITIONAL(HAVE_NSSI, test x$ac_nssi_ok = xyes) + +AC_SUBST(NSSI_LIBS) +AC_SUBST(NSSI_SERVER_LIBS) +AC_SUBST(NSSI_CFLAGS) +AC_SUBST(NSSI_CPPFLAGS) +AC_SUBST(NSSI_LDFLAGS) +AC_SUBST(NSSI_SRCDIR) +AC_SUBST(NSSI_BUILDDIR) + +AC_LANG_POP([C++]) + +# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: +if test x"$ac_nssi_ok" = xyes; then + ifelse([$1],,[AC_DEFINE(HAVE_NSSI,1,[Define if you have NSSI.])],[$1]) + : +else + $2 + : +fi + +dnl AC_LANG_RESTORE + +])dnl AC_NSSI diff --git a/tests/libs/adios/config/ac_pablo.m4 b/tests/libs/adios/config/ac_pablo.m4 new file mode 100644 index 0000000000..b1960e7fcb --- /dev/null +++ b/tests/libs/adios/config/ac_pablo.m4 @@ -0,0 +1,70 @@ +dnl @synopsis AC_PABLO([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) +dnl +dnl This macro tries to find out how to compile programs that +dnl use the Pablo API. +dnl +dnl On success, it defines HAVE_PABLO and sets PABLO_LIBS +dnl to any libraries that are needed for linking +dnl Pablo (e.g. -lp3utcp, -lp3lib,...). +dnl +dnl If you want to compile everything with Pablo, you should set: +dnl +dnl LIBS="$PABLO_LIBS $LIBS" +dnl +dnl ACTION-IF-FOUND is a list of shell commands to run if a Portals +dnl library is found, and ACTION-IF-NOT-FOUND is a list of commands +dnl to run it if it is not found. If ACTION-IF-FOUND is not specified, +dnl the default action will define HAVE_PORTALS. +dnl +dnl @version $Id: acx_mpi.m4 676 2006-05-16 20:44:08Z raoldfi $ +dnl @author Ron A. Oldfield + +AC_DEFUN([AC_PABLO], [ + +AM_CONDITIONAL(HAVE_PABLO,true) + +AC_ARG_WITH(pablo, + [ --with-pablo=DIR Location of Pablo library], + [PABLO_LDFLAGS="-L$withval/lib"; + PABLO_CPPFLAGS="-I$withval/include";]) + +dnl AC_LANG_PUSH([C++]) + +save_CPPFLAGS="$CPPFLAGS" +save_LIBS="$LIBS" +save_LDFLAGS="$LDFLAGS" +LIBS="$LIBS -lPablo" +LDFLAGS="$LDFLAGS $PABLO_LDFLAGS" +CPPFLAGS="$CPPFLAGS $PABLO_CPPFLAGS" + +if test -z "${HAVE_PABLO_TRUE}"; then + AC_CHECK_HEADERS(Attributes.h, + , + [AM_CONDITIONAL(HAVE_PABLO,false)]) +fi + +# Check for the Pablo library and headers for SDDF +AC_TRY_COMPILE([#include ], + [Attributes attr;attr.clearEntries();], + [PABLO_LIBS="-lPablo"], + [AM_CONDITIONAL(HAVE_PABLO,false)]) + +LIBS="$save_LIBS" +LDFLAGS="$save_LDFLAGS" +CPPFLAGS="$save_CPPFLAGS" + +AC_SUBST(PABLO_LIBS) +AC_SUBST(PABLO_LDFLAGS) +AC_SUBST(PABLO_CPPFLAGS) + +dnl AC_LANG_POP([C++]) + +# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: +if test -z "${HAVE_PABLO_TRUE}"; then + ifelse([$1],,[AC_DEFINE(HAVE_PABLO,1,[Define if you have the Pablo.])],[$1]) + : +else + $2 + : +fi +])dnl AC_PABLO diff --git a/tests/libs/adios/config/ac_pami.m4 b/tests/libs/adios/config/ac_pami.m4 new file mode 100644 index 0000000000..caa0765915 --- /dev/null +++ b/tests/libs/adios/config/ac_pami.m4 @@ -0,0 +1,71 @@ +dnl ###################################################################### +dnl +dnl Finds IBM_PAMI +dnl +dnl ###################################################################### + +AC_DEFUN([AC_PAMI],[ +ac_pami_lib_ok=no + +PAMI_CFLAGS="" +PAMI_CPPFLAGS="" +PAMI_LDFLAGS="" +PAMI_LIBS="" + +AC_MSG_NOTICE([=== checking for IBM PAMI ===]) + +AM_CONDITIONAL(HAVE_PAMI,true) + +AC_ARG_WITH(pami, + [ --with-pami=DIR Location of IBM PAMI], + [ PAMI_CPPFLAGS="-I/bgsys/drivers/ppcfloor/comm/sys/include"; + PAMI_LDFLAGS=""; + PAMI_LIBS="-lpthread";]) + +save_CPPFLAGS="$CPPFLAGS" +save_LDFLAGS="$LDFLAGS" +save_LIBS="$LIBS" +CPPFLAGS="$CPPFLAGS $PAMI_CPPFLAGS" +LDFLAGS="$LDFLAGS $PAMI_LDFLAGS" +LIBS="$LIBS $PAMI_LIBS" + +dnl Check for the header file. +if test -z "${HAVE_PAMI_TRUE}"; then + AC_CHECK_HEADERS(pami.h, + , + [AM_CONDITIONAL(HAVE_PAMI,false)]) +fi + +dnl Check for the library. +if test -z "${HAVE_PAMI_TRUE}"; then + AC_MSG_CHECKING([if pami code can be linked]) + AC_TRY_LINK([#include "pami.h"], + [pami_context_t context; + PAMI_Context_lock(context); + PAMI_Context_unlock(context); + ], + [PAMI_LIBS="-lpthread" + AC_MSG_RESULT(yes)], + [AM_CONDITIONAL(HAVE_PAMI, false) + AC_MSG_RESULT(no)]) +fi + +LIBS="$save_LIBS" +LDFLAGS="$save_LDFLAGS" +CPPFLAGS="$save_CPPFLAGS" + +AC_SUBST(PAMI_CFLAGS) +AC_SUBST(PAMI_CPPFLAGS) +AC_SUBST(PAMI_LDFLAGS) +AC_SUBST(PAMI_LIBS) + +dnl Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: +if test -z "${HAVE_PAMI_TRUE}"; then + ac_pami_lib_ok=yes + ifelse([$1],,[AC_DEFINE(HAVE_PAMI,1,[Define if you have the PAMI.])],[$1]) + : +else + $2 + : +fi +])dnl AC_PAMI diff --git a/tests/libs/adios/config/ac_phdf5.m4 b/tests/libs/adios/config/ac_phdf5.m4 new file mode 100644 index 0000000000..6b86d693e1 --- /dev/null +++ b/tests/libs/adios/config/ac_phdf5.m4 @@ -0,0 +1,160 @@ +dnl ###################################################################### +dnl +dnl Finds PHDF5 +dnl +dnl ###################################################################### + +AC_DEFUN([AC_PHDF5], +[ +AC_MSG_NOTICE([=== checking for Parallel HDF5 ===]) + +AM_CONDITIONAL(HAVE_PHDF5,true) + +AC_ARG_WITH([phdf5], + [ --with-phdf5=], + [PHDF5_DIR=$withval], [with_phdf5=no]) + +dnl allow args --with-phdf5 incdir and --with-phdf5-libdir + +AC_ARG_WITH(phdf5-incdir, + [ --with-phdf5-incdir=], + [PHDF5_INCDIR=$withval + with_phdf5=detailed]) + +AC_ARG_WITH(phdf5-libdir, + [ --with-phdf5-libdir=], + [PHDF5_LIBDIR=$withval + with_phdf5=detailed]) + +AC_ARG_WITH(phdf5-libs, + [ --with-phdf5-libs=, e.g. -lhdf5 -lhdf5_hl -lz>], + [PHDF5_LIBS=$withval + with_phdf5=detailed]) + +dnl If --without-phdf5 was given set HAVE_PHDF5 to false and do nothing more +dnl Or if nothing was given, by default we don't try to find it anymore +if test "x$with_phdf5" == "xno"; then + + AM_CONDITIONAL(HAVE_PHDF5,false) + +else + + ac_use_cray_hdf5=no dnl will set to yes if we will use CRAY_HDF5_DIR below + + dnl If we know PHDF5_DIR, then we can know PHDF5_INCDIR. + dnl If we know CRAY_HDF5_DIR, then we leave PHDF5_INCDIR empty. + dnl We don't overwrite PHDF5_INCDIR. + if test -z "${PHDF5_INCDIR}"; then + if test -n "${CRAY_HDF5_DIR}"; then + PHDF5_INCDIR=""; + ac_use_cray_hdf5=yes + elif test -n "${PHDF5_DIR}"; then + PHDF5_INCDIR="${PHDF5_DIR}/include"; + dnl echo "PHDF5_INCDIR set to PHDF5_DIR/include = ${PHDF5_DIR}/include" + else + ac_phdf5_ok=no + fi + fi + + dnl If we know PHDF5_DIR, then we can know PHDF5_LIBDIR. + dnl If we know CRAY_HDF5_DIR, then we leave PHDF5_LIBDIR empty. + dnl We don't overwrite PHDF5_LIBDIR. + if test -z "${PHDF5_LIBDIR}"; then + if test -n "${CRAY_HDF5_DIR}"; then + PHDF5_LIBDIR=""; + ac_use_cray_hdf5=yes + elif test -n "${PHDF5_DIR}"; then + PHDF5_LIBDIR="${PHDF5_DIR}/lib"; + dnl echo "PHDF5_LIBDIR set to PHDF5_DIR/lib = ${PHDF5_DIR}/lib" + else + ac_phdf5_ok=no + fi + fi + + if test -n "${PHDF5_INCDIR}"; then + dnl Add "-I" to PHDF5_INCDIR. + PHDF5_CPPFLAGS="-I${PHDF5_INCDIR}" + else + ac_use_cray_hdf5=no + fi + + if test -n "${PHDF5_LIBDIR}"; then + dnl Add "-L" to PHDF5_LIBDIR. + PHDF5_LDFLAGS="-L${PHDF5_LIBDIR}" + else + ac_use_cray_hdf5=no + fi + + + dnl if hdf5 libs are not defined (and not Cray hdf5 lib), then guess and define it + if test -z "${PHDF5_LIBS}"; then + if test "${ac_use_cray_hdf5}" != "yes"; then + dnl default PHDF5 lib is usually just -lhdf5_hl -lhdf -lz + PHDF5_LIBS="-lhdf5_hl -lhdf5 -lz" + else + AC_MSG_NOTICE([Environment CRAY_HDF5_DIR defined, so we use Cray's settings]) + fi + fi + + save_CC="$CC" + save_CPPFLAGS="$CPPFLAGS" + save_LIBS="$LIBS" + save_LDFLAGS="$LDFLAGS" + LIBS="$LIBS $PHDF5_LIBS" + LDFLAGS="$LDFLAGS $PHDF5_LDFLAGS" + CPPFLAGS="$CPPFLAGS $PHDF5_CPPFLAGS" + CC="$MPICC" + + dnl echo "---------------------------------" + dnl echo "Test PHDF5 with settings:" + dnl echo " PHDF5_CPPFLAGS=$PHDF5_CPPFLAGS" + dnl echo " PHDF5_LDFLAGS=$PHDF5_LDFLAGS" + dnl echo " PHDF5_LIBS=$PHDF5_LIBS" + dnl echo "---------------------------------" + + if test -z "${HAVE_PHDF5_TRUE}"; then + AC_CHECK_HEADERS(hdf5.h, + , + [ AM_CONDITIONAL(HAVE_PHDF5,false) ]) + fi + + if test -z "${HAVE_PHDF5_TRUE}"; then + AC_MSG_CHECKING([if phdf5 code can be compiled]) + AC_TRY_COMPILE([#include "hdf5.h"], + [hid_t file_id; + herr_t status; +#ifdef H5_HAVE_PARALLEL + file_id = H5Fcreate("a.h5", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + status = H5Fclose(file_id); +#else + /* This must deliberately fail */ + file_id = THE_HDF5_INSTALLATION_FOUND_IS_NOT_PARALLEL_HDF5 +#endif + ], + [AC_MSG_RESULT(yes)], + [AC_MSG_RESULT(no) + AM_CONDITIONAL(HAVE_PHDF5,false) + ]) + + AC_SUBST(PHDF5_LIBS) + AC_SUBST(PHDF5_LDFLAGS) + AC_SUBST(PHDF5_CPPFLAGS) + fi + + LIBS="$save_LIBS" + LDFLAGS="$save_LDFLAGS" + CPPFLAGS="$save_CPPFLAGS" + CC="$save_CC" + + # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: + if test -z "${HAVE_PHDF5_TRUE}"; then + ifelse([$1],,[AC_DEFINE(HAVE_PHDF5,1,[Define if you have PHDF5.])],[$1]) + : + else + $2 + : + fi + +fi + +]) diff --git a/tests/libs/adios/config/ac_portals.m4 b/tests/libs/adios/config/ac_portals.m4 new file mode 100644 index 0000000000..04b09c8722 --- /dev/null +++ b/tests/libs/adios/config/ac_portals.m4 @@ -0,0 +1,341 @@ +dnl @synopsis AC_PORTALS([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) +dnl +dnl This macro tries to find out how to compile programs that +dnl use the Portals API. +dnl +dnl On success, it defines HAVE_PORTALS and sets PORTALS_LIBS +dnl to any libraries that are needed for linking +dnl Portals (e.g. -lp3utcp, -lp3lib,...). +dnl +dnl If you want to compile everything with Portals, you should set: +dnl +dnl LIBS="$PTL_LIBS $LIBS" +dnl +dnl ACTION-IF-FOUND is a list of shell commands to run if a Portals +dnl library is found, and ACTION-IF-NOT-FOUND is a list of commands +dnl to run it if it is not found. If ACTION-IF-FOUND is not specified, +dnl the default action will define HAVE_PORTALS. +dnl +dnl @version $Id: acx_mpi.m4 676 2006-05-16 20:44:08Z raoldfi $ +dnl @author Ron A. Oldfield + +AC_DEFUN([AC_PORTALS], [ +AC_REQUIRE([AC_CANONICAL_HOST]) +AC_REQUIRE([ACX_PTHREAD]) +AC_LANG_SAVE +AC_LANG_C +ac_portals_hdr_ok=no +ac_portals_lib_ok=no +ac_with_portals=no + +AM_CONDITIONAL(HAVE_PORTALS,true) +AM_CONDITIONAL(NEED_DARWIN_SINGLE_MODULE,false) + +PORTALS_CFLAGS="" +PORTALS_CPPFLAGS="" +PORTALS_LDFLAGS="" +PORTALS_LIBS="" + +dnl PtlInit +dnl PtlFini + +AC_ARG_WITH(portals, + [ --with-portals=DIR Location of Portals (yes/no/path_to_portals)], + [ ac_with_portals=$withval; ], [ac_with_portals=no]) + +if test x"$ac_with_portals" = xno; then + + AM_CONDITIONAL(HAVE_PORTALS,false) + ac_with_portals=no; + +elif test x"$withval" = xyes -o x"$withval" = x; then + + PORTALS_LDFLAGS=""; + PORTALS_CPPFLAGS=""; + ac_with_portals=yes; + +else + + PORTALS_LDFLAGS="-L$withval/lib"; + PORTALS_CPPFLAGS="-I$withval/include"; + ac_with_portals=yes; + +fi + +if test x"$ac_with_portals" = xyes; then + + dnl Look for portals header files + save_CPPFLAGS=$CPPFLAGS; + CPPFLAGS="$CPPFLAGS $PORTALS_CPPFLAGS" + LDFLAGS="$LDFLAGS $PORTALS_LDFLAGS" + + + + if test x"$ac_portals_hdr_ok" = xno; then + AC_CHECK_HEADER(portals3.h, + [AC_DEFINE(HAVE_PORTALS3_H, 1, + [Define to 1 if you have .]) + ac_portals_hdr_ok=yes; + PORTALS_CFLAGS="$PORTALS_CFLAGS $EXTRA_CFLAGS"; + PORTALS_CPPFLAGS="$PORTALS_CPPFLAGS $EXTRA_CFLAGS"], + [ac_portals_hdr_ok=no]) + fi + + if test x"$ac_portals_hdr_ok" = xno; then + AC_CHECK_HEADER(portals/portals3.h, + [AC_DEFINE(HAVE_PORTALS_PORTALS3_H, 1, + [Define to 1 if you have .]) + ac_portals_hdr_ok=yes; + PORTALS_CFLAGS="$PORTALS_CFLAGS $EXTRA_CFLAGS"; + PORTALS_CPPFLAGS="$PORTALS_CPPFLAGS $EXTRA_CFLAGS"], + [ac_portals_hdr_ok=no]) + fi + + dnl Look for other portals files + AC_CHECK_HEADERS([p3nal_utcp.h p3rt/p3rt.h], , , + [ + [#if defined(HAVE_PORTALS3_H) + #include + #elif defined(HAVE_PORTALS_PORTALS3_H) + #include + #endif] + ]) + + if test x"$ac_portals_hdr_ok" = xno; then + CPPFLAGS=$save_CPPFLAGS + fi + + + dnl Look for -lportals + if test x"$ac_portals_lib_ok" = xno -a x$ac_portals_hdr_ok = xyes; then + save_LIBS=$LIBS; + LIBS="" + AC_SEARCH_LIBS(PtlInit,[portals], + [ac_portals_lib_ok=yes], + [ac_portals_lib_ok=no], + [$save_LIBS $PTHREAD_LDFLAGS $PTHREAD_LIBS]) + if test -n $LIBS; then + PORTALS_LIBS=$LIBS; + fi + LIBS=$save_LIBS; + fi + + dnl Check for Portals UTCP libraries (Schutt's implementation) + dnl Look for PtlInit in -lp3api -lp3lib -lp3rt -lp3utcp + if test x"$ac_portals_lib_ok" = xno -a x$ac_portals_hdr_ok = xyes; then + save_LIBS=$LIBS; + save_LDFLAGS=$LDFLAGS; + save_CFLAGS=$CFLAGS; + + extra_LIBS="-lp3api -lp3lib -lp3rt -lp3utcp" + + + LDFLAGS="$LDFLAGS $PORTALS_LDFLAGS" + LIBS="$LIBS $extra_LIBS $PTHREAD_LIBS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + + AC_MSG_CHECKING([if portals links with $LDFLAGS $LIBS]) + + AC_LINK_IFELSE([AC_LANG_CALL([],[PtlInit])], + [PORTALS_LIBS=$extra_LIBS; + ac_portals_lib_ok=yes; + AC_MSG_RESULT(yes)], + [ac_portals_lib_ok=no; + AC_MSG_RESULT(no)]) + + LIBS=$save_LIBS; + LDFLAGS=$save_LDFLAGS; + CDFLAGS=$save_CFLAGS; + fi + + dnl See if PTHREADS is really necessary + if test x"$ac_portals_lib_ok" = xyes; then + + ac_portals_flags="none ${PTHREAD_CFLAGS} ${PTHREAD_LIBS}" + ac_portals_lib_ok=no + + for flag in $ac_portals_flags; do + + case $flag in + none) + AC_MSG_CHECKING([whether portals works without any additional flags]) + ;; + + -l*) + AC_MSG_CHECKING([whether portals works with library $flag]) + EXTRA_LIBS="$flag" + ;; + + -*) + AC_MSG_CHECKING([whether portals works with library -l$flag]) + EXTRA_LIBS="$flag" + ;; + esac + + save_LIBS="$LIBS" + save_CFLAGS="$CFLAGS" + save_CPPFLAGS="$CPPFLAGS" + save_LDFLAGS="$LDFLAGS" + + LIBS="$LIBS $PORTALS_LIBS $EXTRA_LIBS" + CFLAGS="$CFLAGS $PORTALS_CFLAGS $EXTRA_CFLAGS" + CPPFLAGS="$CPPFLAGS $PORTALS_CPPFLAGS" + LDFLAGS="$LDFLAGS $PORTALS_LDFLAGS" + + See if Portals will link with the provided flags + AC_LINK_IFELSE([AC_LANG_CALL([],[PtlInit])], + [PORTALS_CFLAGS="$PORTALS_CFLAGS $EXTRA_CFLAGS"; + PORTALS_CPPFLAGS="$PORTALS_CPPFLAGS $EXTRA_CPPFLAGS"; + PORTALS_LIBS="$PORTALS_LIBS $EXTRA_LIBS"; + ac_portals_lib_ok=yes], + [ac_portals_lib_ok=no]) + AC_MSG_RESULT($ac_portals_lib_ok) + + if test "x$ac_portals_lib_ok" = xyes; then + PORTALS_LIBS="$PORTALS_LIBS $EXTRA_LIBS"; + PORTALS_CFLAGS="$PORTALS_CFLAGS $EXTRA_CFLAGS"; + PORTALS_CPPFLAGS="$PORTALS_CPPFLAGS $EXTRA_CFLAGS"; + if test `uname -s` = "Darwin"; then + AM_CONDITIONAL(NEED_DARWIN_SINGLE_MODULE,true) + fi + fi + + + dnl Restore environment variables + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + + done + fi + + + if test x"$ac_portals_hdr_ok" = xno -o x$ac_portals_lib_ok = xno; then + AM_CONDITIONAL(HAVE_PORTALS,false) + PORTALS_CFLAGS="" + PORTALS_CPPFLAGS="" + PORTALS_LDFLAGS="" + PORTALS_LIBS="" + else + ac_portals_lib_ok=yes; + AM_CONDITIONAL(HAVE_PORTALS,true) + fi + + + dnl Create definitions for the include files + dnl AC_DEFINE_UNQUOTED([PORTALS_HEADER], ["$PORTALS_HEADER"], + dnl ["Path to portals3.h"]) + dnl AC_DEFINE_UNQUOTED([PORTALS_RT_HEADER], ["$PORTALS_RT_HEADER"], + dnl ["Path to Portals runtime definitions"]) + dnl AC_DEFINE_UNQUOTED([PORTALS_NAL_HEADER], ["$PORTALS_NAL_HEADER"], + dnl ["Path to portals NAL definitions"]) + + dnl Check for portals types and functions defined in the 3.1 specification + if test x"$ac_portals_lib_ok" = xyes; then + + save_CFLAGS=$CFLAGS + save_CPPFLAGS=$CPPFLAGS + save_LDFLAGS=$LDFLAGS + save_LIBS=$LIBS + + CFLAGS="$CFLAGS $PORTALS_CFLAGS" + CPPFLAGS="$CPPFLAGS $PORTALS_CPPFLAGS" + LDFLAGS="$LDFLAGS $PORTALS_LDFLAGS" + LIBS="$LIBS $PORTALS_LIBS" + + dnl See if we have PTL_NO_ACK_REQ or PTL_NOACK_REQ + AC_MSG_CHECKING([whether portals uses PTL_NO_ACK_REQ]) + AC_LINK_IFELSE([AC_LANG_PROGRAM( + [#if defined(HAVE_PORTALS3_H) + #include + #elif defined(HAVE_PORTALS_PORTALS3_H) + #include + #else + #error Cound not find include file + #endif + ],[int a = PTL_NO_ACK_REQ;])], + [# Success + AC_DEFINE(HAVE_PTL_NO_ACK_REQ,1,[Define if you have PTL_NO_ACK_REQ.]) + AC_MSG_RESULT(yes) + ], + [ + AC_MSG_RESULT(no) + AC_MSG_CHECKING([whether portals uses PTL_NOACK_REQ]) + AC_LINK_IFELSE([AC_LANG_PROGRAM( + [#if defined(HAVE_PORTALS3_H) + #include + #elif defined(HAVE_PORTALS_PORTALS3_H) + #include + #else + #error Cound not find include file + #endif + ],[int a = PTL_NOACK_REQ;])], + [# Success + AC_DEFINE(HAVE_PTL_NOACK_REQ,1,[Define if you have PTL_NOACK_REQ.]) + AC_MSG_RESULT(yes) + ], + [ + AC_MSG_RESULT(no) + ]) + ]) + + AC_CHECK_TYPES([ptl_time_t, ptl_eq_handler_t], + , , + [#if defined(HAVE_PORTALS3_H) + #include + #elif defined(HAVE_PORTALS_PORTALS3_H) + #include + #endif]) + + AC_CHECK_FUNCS([PtlErrorStr \ + PtlNIFailStr \ + PtlEventKindStr \ + PtlGetJid \ + PtlACEntry]) + + CFLAGS=$save_CFLAGS + CPPFLAGS=$save_CPPFLAGS + LDFLAGS=$save_LDFLAGS + LIBS=$save_LIBS + fi + + + # This is a big hack. This is fragile. Try to determine if we are + # using Cray Portals. Cray Portals generates more data movement + # events than Schutt (standard) Portals. This requires a memory + # descriptor threshold adjustment. Cannot be determined at runtime. + # + # This test relies on a priori knowledge of specific types and + # functions that are (un)defined. If this list changes, this + # test will quickly crumble. + # + if test x"$ac_cv_func_PtlErrorStr" = xno -a \ + x"$ac_cv_type_ptl_eq_handler_t" = xyes -a \ + x"$ac_cv_func_PtlNIFailStr" = xno -a \ + x"$ac_cv_func_PtlEventKindStr" = xno -a \ + x"$ac_cv_func_PtlGetJid" = xyes -a \ + x"$ac_cv_func_PtlACEntry" = xyes; then + AC_DEFINE(HAVE_CRAY_PORTALS,1,[Define if you have Cray Portals.]) + fi + + + AC_SUBST(PORTALS_CPPFLAGS) + AC_SUBST(PORTALS_CFLAGS) + AC_SUBST(PORTALS_LDFLAGS) + AC_SUBST(PORTALS_LIBS) + AC_SUBST(PORTALS_HEADER) + AC_SUBST(PORTALS_NAL_HEADER) + AC_SUBST(PORTALS_RT_HEADER) + + # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: + if test x"$ac_portals_lib_ok" = xyes; then + ifelse([$1],,[AC_DEFINE(HAVE_PORTALS,1,[Define if you have the Portals.])],[$1]) + : + else + $2 + : + fi +fi +AC_LANG_RESTORE +])dnl AC_PORTALS diff --git a/tests/libs/adios/config/ac_ridcompress.m4 b/tests/libs/adios/config/ac_ridcompress.m4 new file mode 100755 index 0000000000..d444420137 --- /dev/null +++ b/tests/libs/adios/config/ac_ridcompress.m4 @@ -0,0 +1,73 @@ +# +# +# AC_RIDCOMPRESS +# +# +# +dnl @synopsis AC_RIDCOMPRESS +dnl +dnl This macro test if RIDCOMPRESS is to be used. +dnl Use in C code: +dnl #ifdef RIDCOMPRESS +dnl #include "pfordelta-c-interface.h" +dnl #endif +dnl +dnl @version 1.0 +dnl @author David A. Boyuka II +dnl +AC_DEFUN([AC_RIDCOMPRESS],[ + +AC_MSG_NOTICE([=== checking for RIDCOMPRESS ===]) + +AM_CONDITIONAL(HAVE_RIDCOMPRESS,true) + +AC_ARG_WITH([ridcompress], + [ --with-ridcompress=DIR Location of RIDCOMPRESS library], + [RIDCOMPRESS_LDFLAGS="-L$withval/ -L$withval/lib"; + RIDCOMPRESS_LIBS="-lridcompress -lstdc++"; + RIDCOMPRESS_CPPFLAGS="-I$withval/ -I$withval/include";], + [with_RIDCOMPRESS=no]) + +if test "x$with_RIDCOMPRESS" == "xno"; then + + AM_CONDITIONAL(HAVE_RIDCOMPRESS,false) + +else + + save_CPPFLAGS="$CPPFLAGS" + save_LIBS="$LIBS" + save_LDFLAGS="$LDFLAGS" + LIBS="$LIBS $RIDCOMPRESS_LIBS" + LDFLAGS="$LDFLAGS $RIDCOMPRESS_LDFLAGS" + CPPFLAGS="$CPPFLAGS $RIDCOMPRESS_CPPFLAGS" + + dnl if test -z "${HAVE_RIDCOMPRESS_TRUE}"; then + dnl AC_CHECK_HEADERS(pfordelta-c-interface.h, + dnl , + dnl [AM_CONDITIONAL(HAVE_RIDCOMPRESS,false)]) + dnl fi + + # Check for the RIDCOMPRESS library and headers + dnl AC_TRY_COMPILE([struct obd_uuid {char uuid[40];};int fd, num_ost;struct obd_uuid uuids[1024];], + dnl [llapi_lov_get_uuids(fd, uuids, &num_ost);], + dnl [RIDCOMPRESS_LIBS="-lRIDCOMPRESS"], + dnl [AM_CONDITIONAL(HAVE_RIDCOMPRESS,false)]) + + LIBS="$save_LIBS" + LDFLAGS="$save_LDFLAGS" + CPPFLAGS="$save_CPPFLAGS" + + AC_SUBST(RIDCOMPRESS_LIBS) + AC_SUBST(RIDCOMPRESS_LDFLAGS) + AC_SUBST(RIDCOMPRESS_CPPFLAGS) + + # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: + if test -z "${HAVE_RIDCOMPRESS_TRUE}"; then + ifelse([$1],,[AC_DEFINE(HAVE_RIDCOMPRESS,1,[Define if you have RIDCOMPRESS.])],[$1]) + : + else + $2 + : + fi +fi +])dnl AC_RIDCOMPRESS diff --git a/tests/libs/adios/config/ac_szip.m4 b/tests/libs/adios/config/ac_szip.m4 new file mode 100644 index 0000000000..14426bfea6 --- /dev/null +++ b/tests/libs/adios/config/ac_szip.m4 @@ -0,0 +1,73 @@ +# +# +# AC_SZIP +# +# +# +dnl @synopsis AC_SZIP +dnl +dnl This macro test if SZIP is to be used. +dnl Use in C code: +dnl #ifdef SZIP +dnl #include "szlib.h" +dnl #endif +dnl +dnl @version 1.0 +dnl @author Zhenhuan (Steve) Gong +dnl +AC_DEFUN([AC_SZIP],[ + +AC_MSG_NOTICE([=== checking for SZIP ===]) + +AM_CONDITIONAL(HAVE_SZIP,true) + +AC_ARG_WITH(szip, + [ --with-szip=DIR Location of SZIP library], + [SZIP_LDFLAGS="-L$withval/lib"; + SZIP_LIBS="-lsz"; + SZIP_CPPFLAGS="-I$withval/include";], + [with_szip=no]) + +if test "x$with_szip" == "xno"; then + + AM_CONDITIONAL(HAVE_SZIP,false) + +else + + save_CPPFLAGS="$CPPFLAGS" + save_LIBS="$LIBS" + save_LDFLAGS="$LDFLAGS" + LIBS="$LIBS -lsz" + LDFLAGS="$LDFLAGS $SZIP_LDFLAGS" + CPPFLAGS="$CPPFLAGS $SZIP_CPPFLAGS" + + if test -z "${HAVE_SZIP_TRUE}"; then + AC_CHECK_HEADERS(szlib.h, + , + [AM_CONDITIONAL(HAVE_SZIP,false)]) + fi + + # Check for the SZIP library and headers + dnl AC_TRY_COMPILE([struct obd_uuid {char uuid[40];};int fd, num_ost;struct obd_uuid uuids[1024];], + dnl [llapi_lov_get_uuids(fd, uuids, &num_ost);], + dnl [SZIP_LIBS="-lsz"], + dnl [AM_CONDITIONAL(HAVE_SZIP,false)]) + + LIBS="$save_LIBS" + LDFLAGS="$save_LDFLAGS" + CPPFLAGS="$save_CPPFLAGS" + + AC_SUBST(SZIP_LIBS) + AC_SUBST(SZIP_LDFLAGS) + AC_SUBST(SZIP_CPPFLAGS) + + # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: + if test -z "${HAVE_SZIP_TRUE}"; then + ifelse([$1],,[AC_DEFINE(HAVE_SZIP,1,[Define if you have SZIP.])],[$1]) + : + else + $2 + : + fi +fi +])dnl AC_SZIP diff --git a/tests/libs/adios/config/ac_zlib.m4 b/tests/libs/adios/config/ac_zlib.m4 new file mode 100644 index 0000000000..344e6e5d6e --- /dev/null +++ b/tests/libs/adios/config/ac_zlib.m4 @@ -0,0 +1,116 @@ +# +# +# AC_ZLIB +# +# +# +dnl @synopsis AC_ZLIB +dnl +dnl This macro test if ZLIB is to be used. +dnl Use in C code: +dnl #ifdef ZLIB +dnl #include "zlib.h" +dnl #endif +dnl +dnl @version 2.0 +dnl @author Zhenhuan (Steve) Gong +dnl @author Norbert Podhorszki +dnl +AC_DEFUN([AC_ZLIB],[ + +AC_MSG_NOTICE([=== checking for ZLIB ===]) + +AM_CONDITIONAL(HAVE_ZLIB,true) + +AC_ARG_WITH(zlib, + [ --with-zlib=DIR Location of ZLIB library], + [:], [with_zlib=no]) + +if test "x$with_zlib" == "xno"; then + + AM_CONDITIONAL(HAVE_ZLIB,false) + +else + + save_CPPFLAGS="$CPPFLAGS" + save_LIBS="$LIBS" + save_LDFLAGS="$LDFLAGS" + + if test "x$with_zlib" == "xyes"; then + dnl No path given + ZLIB_CPPFLAGS="" + ZLIB_LDFLAGS="" + ZLIB_LIBS="-lz" + else + dnl Path given, first try path/lib64 + ZLIB_CPPFLAGS="-I$withval/include" + ZLIB_LDFLAGS="-L$withval/lib64" + ZLIB_LIBS="-lz" + fi + + LIBS="$LIBS $ZLIB_LIBS" + LDFLAGS="$LDFLAGS $ZLIB_LDFLAGS" + CPPFLAGS="$CPPFLAGS $ZLIB_CPPFLAGS" + + dnl Find header file first + AC_CHECK_HEADERS(zlib.h, + , + [AM_CONDITIONAL(HAVE_ZLIB,false)]) + + if test -z "${HAVE_ZLIB_TRUE}"; then + dnl Try to link an example now + AC_MSG_CHECKING([if zlib code can be linked with $ZLIB_LDFLAGS]) + AC_TRY_LINK( + [#include + #include "zlib.h"], + [Bytef* in, *out; + uLongf in_len, *out_len; + int level = 5; + int zerr = compress2 (out, out_len, in, in_len, level); + return (zerr != Z_OK);], + [AC_MSG_RESULT(yes)], + [AM_CONDITIONAL(HAVE_ZLIB,false) + AC_MSG_RESULT(no) + ]) + + dnl If linking above failed, one reason might be that we looked in lib64/ + dnl instead of lib/ + if test -z "${HAVE_ZLIB_FALSE}"; then + if test "x$with_lustre" != "xyes"; then + ZLIB_LDFLAGS="-L$withval/lib" + LDFLAGS="$LDFLAGS $ZLIB_LDFLAGS" + AC_MSG_CHECKING([if zlib code can be linked with $ZLIB_LDFLAGS]) + AC_TRY_LINK( + [#include + #include "zlib.h"], + [Bytef* in, *out; + uLongf in_len, *out_len; + int level = 5; + int zerr = compress2 (out, out_len, in, in_len, level); + return (zerr != Z_OK);], + [AC_MSG_RESULT(yes)], + [AM_CONDITIONAL(HAVE_ZLIB,false) + AC_MSG_RESULT(no) + ]) + fi + fi + fi + + LIBS="$save_LIBS" + LDFLAGS="$save_LDFLAGS" + CPPFLAGS="$save_CPPFLAGS" + + AC_SUBST(ZLIB_LIBS) + AC_SUBST(ZLIB_LDFLAGS) + AC_SUBST(ZLIB_CPPFLAGS) + + # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: + if test -z "${HAVE_ZLIB_TRUE}"; then + ifelse([$1],,[AC_DEFINE(HAVE_ZLIB,1,[Define if you have ZLIB.])],[$1]) + : + else + $2 + : + fi +fi +])dnl AC_ZLIB diff --git a/tests/libs/adios/config/acx_mpi.m4 b/tests/libs/adios/config/acx_mpi.m4 new file mode 100644 index 0000000000..191d0b8005 --- /dev/null +++ b/tests/libs/adios/config/acx_mpi.m4 @@ -0,0 +1,187 @@ +# =========================================================================== +# http://autoconf-archive.cryp.to/acx_mpi.html +# =========================================================================== +# +# SYNOPSIS +# +# ACX_MPI([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) +# +# DESCRIPTION +# +# This macro tries to find out how to compile programs that use MPI +# (Message Passing Interface), a standard API for parallel process +# communication (see http://www-unix.mcs.anl.gov/mpi/) +# +# On success, it sets the MPICC, MPICXX, MPIF77, or MPIFC output variable +# to the name of the MPI compiler, depending upon the current language. +# (This may just be $CC/$CXX/$F77/$FC, but is more often something like +# mpicc/mpiCC/mpif77/mpif90.) It also sets MPILIBS to any libraries that +# are needed for linking MPI (e.g. -lmpi or -lfmpi, if a special +# MPICC/MPICXX/MPIF77/MPIFC was not found). +# +# If you want to compile everything with MPI, you should set: +# +# CC="MPICC" #OR# CXX="MPICXX" #OR# F77="MPIF77" #OR# FC="MPIFC" +# LIBS="$MPILIBS $LIBS" +# +# NOTE: The above assumes that you will use $CC (or whatever) for linking +# as well as for compiling. (This is the default for automake and most +# Makefiles.) +# +# The user can force a particular library/compiler by setting the +# MPICC/MPICXX/MPIF77/MPIFC and/or MPILIBS environment variables. +# +# ACTION-IF-FOUND is a list of shell commands to run if an MPI library is +# found, and ACTION-IF-NOT-FOUND is a list of commands to run if it is not +# found. If ACTION-IF-FOUND is not specified, the default action will +# define HAVE_MPI. +# +# LAST MODIFICATION +# +# 2008-04-12 +# +# COPYLEFT +# +# Copyright (c) 2008 Steven G. Johnson +# Copyright (c) 2008 Julian C. Cummings +# +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation, either version 3 of the License, or (at your +# option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +# Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see . +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Macro Archive. When you make and +# distribute a modified version of the Autoconf Macro, you may extend this +# special exception to the GPL to apply to your modified version as well. + +AC_DEFUN([ACX_MPI], [ +AC_PREREQ(2.50) dnl for AC_LANG_CASE + +AM_CONDITIONAL(HAVE_MPI,true) + +AC_ARG_WITH(mpi, + [ --with-mpi=], + [MPI_DIR=$withval]) + +AC_LANG_CASE([C], [ + AC_REQUIRE([AC_PROG_CC]) + AC_ARG_VAR(MPICC,[MPI C compiler command]) + AC_CHECK_PROGS(MPICC, mpicc hcc mpxlc_r mpxlc mpcc cmpicc, $CC) + acx_mpi_save_CC="$CC" + CC="$MPICC" + AC_SUBST(MPICC) +], +[C++], [ + AC_REQUIRE([AC_PROG_CXX]) + AC_ARG_VAR(MPICXX,[MPI C++ compiler command]) + AC_CHECK_PROGS(MPICXX, mpic++ mpicxx mpiCC hcp mpxlC_r mpxlC mpCC cmpic++, $CXX) + acx_mpi_save_CXX="$CXX" + CXX="$MPICXX" + AC_SUBST(MPICXX) +], +[Fortran 77], [ + AC_REQUIRE([AC_PROG_F77]) + AC_ARG_VAR(MPIF77,[MPI Fortran 77 compiler command]) + AC_CHECK_PROGS(MPIF77, mpif77 hf77 mpxlf_r mpxlf mpf77 cmpifc, $F77) + acx_mpi_save_F77="$F77" + F77="$MPIF77" + AC_SUBST(MPIF77) +], +[Fortran], [ + AC_REQUIRE([AC_PROG_FC]) + AC_ARG_VAR(MPIFC,[MPI Fortran compiler command]) + AC_CHECK_PROGS(MPIFC, mpif90 mpxlf95_r mpxlf90_r mpxlf95 mpxlf90 mpf90 cmpif90c, $FC) + acx_mpi_save_FC="$FC" + FC="$MPIFC" + AC_SUBST(MPIFC) +]) + +if test x = x"$MPILIBS"; then + AC_LANG_CASE([C], [AC_CHECK_FUNC(MPI_Init, [MPILIBS=" "])], + [C++], [AC_CHECK_FUNC(MPI_Init, [MPILIBS=" "])], + [Fortran 77], [AC_MSG_CHECKING([for MPI_Init]) + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[ call MPI_Init])],[MPILIBS=" " + AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)])], + [Fortran], [AC_MSG_CHECKING([for MPI_Init]) + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[ call MPI_Init])],[MPILIBS=" " + AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)])]) +fi +AC_LANG_CASE([Fortran 77], [ + if test x = x"$MPILIBS"; then + AC_CHECK_LIB(fmpi, MPI_Init, [MPILIBS="-lfmpi"]) + fi + if test x = x"$MPILIBS"; then + AC_CHECK_LIB(fmpich, MPI_Init, [MPILIBS="-lfmpich"]) + fi +], +[Fortran], [ + if test x = x"$MPILIBS"; then + AC_CHECK_LIB(fmpi, MPI_Init, [MPILIBS="-lfmpi"]) + fi + if test x = x"$MPILIBS"; then + AC_CHECK_LIB(mpichf90, MPI_Init, [MPILIBS="-lmpichf90"]) + fi +]) +if test x = x"$MPILIBS"; then + AC_CHECK_LIB(mpi, MPI_Init, [MPILIBS="-lmpi"]) +fi +if test x = x"$MPILIBS"; then + AC_CHECK_LIB(mpich, MPI_Init, [MPILIBS="-lmpich"]) +fi + +dnl We have to use AC_TRY_COMPILE and not AC_CHECK_HEADER because the +dnl latter uses $CPP, not $CC (which may be mpicc). +AC_LANG_CASE([C], [if test x != x"$MPILIBS"; then + AC_MSG_CHECKING([for mpi.h]) + AC_TRY_COMPILE([#include ],[],[AC_MSG_RESULT(yes)], [MPILIBS="" + AC_MSG_RESULT(no)]) +fi], +[C++], [if test x != x"$MPILIBS"; then + AC_MSG_CHECKING([for mpi.h]) + AC_TRY_COMPILE([#include ],[],[AC_MSG_RESULT(yes)], [MPILIBS="" + AC_MSG_RESULT(no)]) +fi], +[Fortran 77], [if test x != x"$MPILIBS"; then + AC_MSG_CHECKING([for mpif.h]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[ include 'mpif.h'])],[AC_MSG_RESULT(yes)], [MPILIBS="" + AC_MSG_RESULT(no)]) +fi], +[Fortran], [if test x != x"$MPILIBS"; then + AC_MSG_CHECKING([for mpif.h]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[ include 'mpif.h'])],[AC_MSG_RESULT(yes)], [MPILIBS="" + AC_MSG_RESULT(no)]) +fi]) + +AC_LANG_CASE([C], [CC="$acx_mpi_save_CC"], + [C++], [CXX="$acx_mpi_save_CXX"], + [Fortran 77], [F77="$acx_mpi_save_F77"], + [Fortran], [FC="$acx_mpi_save_FC"]) + +AC_SUBST(MPILIBS) + +# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: +if test x = x"$MPILIBS"; then + $2 + : +else + ifelse([$1],,[AC_DEFINE(HAVE_MPI,1,[Define if you have the MPI library.])],[$1]) + : +fi +])dnl ACX_MPI diff --git a/tests/libs/adios/config/acx_pthread.m4 b/tests/libs/adios/config/acx_pthread.m4 new file mode 100644 index 0000000000..f51bfbc184 --- /dev/null +++ b/tests/libs/adios/config/acx_pthread.m4 @@ -0,0 +1,263 @@ +dnl +dnl ACX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) +dnl +dnl Description +dnl +dnl This macro figures out how to build C programs using POSIX threads. It +dnl sets the PTHREAD_LIBS output variable to the threads library and linker +dnl flags, and the PTHREAD_CFLAGS output variable to any special C compiler +dnl flags that are needed. (The user can also force certain compiler +dnl flags/libs to be tested by setting these environment variables.) +dnl +dnl Also sets PTHREAD_CC to any special C compiler that is needed for +dnl multi-threaded programs (defaults to the value of CC otherwise). (This is +dnl necessary on AIX to use the special cc_r compiler alias.) +dnl +dnl NOTE: You are assumed to not only compile your program with these flags, +dnl but also link it with them as well. e.g. you should link with $PTHREAD_CC +dnl $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS +dnl +dnl If you are only building threads programs, you may wish to use these +dnl variables in your default LIBS, CFLAGS, and CC: +dnl +dnl LIBS="$PTHREAD_LIBS $LIBS" +dnl CFLAGS="$CFLAGS $PTHREAD_CFLAGS" +dnl CC="$PTHREAD_CC" +dnl +dnl In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant +dnl has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to that name +dnl (e.g. PTHREAD_CREATE_UNDETACHED on AIX). +dnl +dnl ACTION-IF-FOUND is a list of shell commands to run if a threads library +dnl is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it +dnl is not found. If ACTION-IF-FOUND is not specified, the default action +dnl will define HAVE_PTHREAD. +dnl +dnl Please let the authors know if this macro fails on any platform, or if +dnl you have any other suggestions or comments. This macro was based on work +dnl by SGJ on autoconf scripts for FFTW (www.fftw.org) (with help from M. +dnl Frigo), as well as ac_pthread and hb_pthread macros posted by AFC to the +dnl autoconf macro repository. We are also grateful for the helpful feedback +dnl of numerous users. +dnl +dnl Version: 1.8 (last modified: 2003-05-21) +dnl Author: Steven G. Johnson and +dnl Alejandro Forero Cuervo +dnl +dnl from http://www.gnu.org/software/ac-archive/htmldoc/index.html +dnl +dnl License: +dnl GNU General Public License +dnl [http://www.gnu.org/software/ac-archive/htmldoc/COPYING.html] +dnl with this special exception +dnl [http://www.gnu.org/software/ac-archive/htmldoc/COPYING-Exception.html]. +dnl + +AC_DEFUN([ACX_PTHREAD], [ +AC_REQUIRE([AC_CANONICAL_HOST]) +AC_LANG_SAVE +AC_LANG_C +acx_pthread_ok=no + +# We used to check for pthread.h first, but this fails if pthread.h +# requires special compiler flags (e.g. on True64 or Sequent). +# It gets checked for in the link test anyway. + +# First of all, check if the user has set any of the PTHREAD_LIBS, +# etcetera environment variables, and if threads linking works using +# them: +if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + save_LIBS="$LIBS" + LIBS="$PTHREAD_LIBS $LIBS" + AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS]) + AC_TRY_LINK_FUNC(pthread_join, acx_pthread_ok=yes) + AC_MSG_RESULT($acx_pthread_ok) + if test x"$acx_pthread_ok" = xno; then + PTHREAD_LIBS="" + PTHREAD_CFLAGS="" + fi + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" +fi + +# We must check for the threads library under a number of different +# names; the ordering is very important because some systems +# (e.g. DEC) have both -lpthread and -lpthreads, where one of the +# libraries is broken (non-POSIX). + +# Create a list of thread flags to try. Items starting with a "-" are +# C compiler flags, and other items are library names, except for "none" +# which indicates that we try without any flags at all. + +#acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt" +acx_pthread_flags="pthreads none -Kthread -kthread lthread pthread -pthread -pthreads -mthreads pthread --thread-safe -mt" + +# The ordering *is* (sometimes) important. Some notes on the +# individual items follow: + +# pthreads: AIX (must check this before -lpthread) +# none: in case threads are in libc; should be tried before -Kthread and +# other compiler flags to prevent continual compiler warnings +# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) +# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) +# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) +# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads) +# -pthreads: Solaris/gcc +# -mthreads: Mingw32/gcc, Lynx/gcc +# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it +# doesn't hurt to check since this sometimes defines pthreads too; +# also defines -D_REENTRANT) +# pthread: Linux, etcetera +# --thread-safe: KAI C++ + +case "${host_cpu}-${host_os}" in + *solaris*) + + # On Solaris (at least, for some versions), libc contains stubbed + # (non-functional) versions of the pthreads routines, so link-based + # tests will erroneously succeed. (We need to link with -pthread or + # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather + # a function called by this macro, so we could check for that, but + # who knows whether they'll stub that too in a future libc.) So, + # we'll just look for -pthreads and -lpthread first: + + acx_pthread_flags="-pthread -pthreads pthread -mt $acx_pthread_flags" + ;; +esac + +if test x"$acx_pthread_ok" = xno; then +for flag in $acx_pthread_flags; do + + case $flag in + none) + AC_MSG_CHECKING([whether pthreads work without any flags]) + ;; + + -*) + AC_MSG_CHECKING([whether pthreads work with $flag]) + PTHREAD_CFLAGS="$flag" + ;; + + *) + AC_MSG_CHECKING([for the pthreads library -l$flag]) + PTHREAD_LIBS="-l$flag" + ;; + esac + + save_LIBS="$LIBS" + save_CFLAGS="$CFLAGS" + LIBS="$PTHREAD_LIBS $LIBS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + + # Check for various functions. We must include pthread.h, + # since some functions may be macros. (On the Sequent, we + # need a special flag -Kthread to make this header compile.) + # We check for pthread_join because it is in -lpthread on IRIX + # while pthread_create is in libc. We check for pthread_attr_init + # due to DEC craziness with -lpthreads. We check for + # pthread_cleanup_push because it is one of the few pthread + # functions on Solaris that doesn't have a non-functional libc stub. + # We try pthread_create on general principles. + dnl AC_TRY_LINK([#include ], + dnl [pthread_t th; pthread_join(th, 0); + dnl pthread_attr_init(0); pthread_cleanup_push(0, 0); + dnl pthread_create(0,0,0,0); pthread_cleanup_pop(0); ], + dnl [acx_pthread_ok=yes]) + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include ] + [void *start(void *arg){return NULL;}] + ], + [[pthread_attr_t attr;] + [pthread_t th;] + [pthread_join(th, 0);] + [pthread_attr_init(&attr);] + [pthread_cleanup_push(NULL, NULL);] + [pthread_create(&th,&attr,start,0);] + [pthread_cleanup_pop(0);] + ])], + [acx_pthread_ok=yes], + []) + + + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" + + AC_MSG_RESULT($acx_pthread_ok) + if test "x$acx_pthread_ok" = xyes; then + break; + fi + + PTHREAD_LIBS="" + PTHREAD_CFLAGS="" +done +fi + +# Various other checks: +if test "x$acx_pthread_ok" = xyes; then + save_LIBS="$LIBS" + LIBS="$PTHREAD_LIBS $LIBS" + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + + # Detect AIX lossage: threads are created detached by default + # and the JOINABLE attribute has a nonstandard name (UNDETACHED). + AC_MSG_CHECKING([for joinable pthread attribute]) + AC_TRY_LINK([#include ], + [int attr; attr=PTHREAD_CREATE_JOINABLE;], + ok=PTHREAD_CREATE_JOINABLE, ok=unknown) + if test x"$ok" = xunknown; then + AC_TRY_LINK([#include ], + [int attr; attr=PTHREAD_CREATE_UNDETACHED;], + ok=PTHREAD_CREATE_UNDETACHED, ok=unknown) + fi + if test x"$ok" != xPTHREAD_CREATE_JOINABLE; then + AC_DEFINE(PTHREAD_CREATE_JOINABLE, $ok, + [Define to the necessary symbol if this constant + uses a non-standard name on your system.]) + fi + AC_MSG_RESULT(${ok}) + if test x"$ok" = xunknown; then + AC_MSG_WARN([we do not know how to create joinable pthreads]) + fi + + AC_MSG_CHECKING([if more special flags are required for pthreads]) + flag=no + case "${host_cpu}-${host_os}" in + *-aix* | *-freebsd*) flag="-D_THREAD_SAFE";; + *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";; + esac + AC_MSG_RESULT(${flag}) + if test "x$flag" != xno; then + PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" + fi + + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" + + # More AIX lossage: must compile with cc_r + AC_CHECK_PROG(PTHREAD_CC, cc_r, cc_r, ${CC}) +else + PTHREAD_CC="$CC" +fi + +AC_SUBST(PTHREAD_LIBS) +AC_SUBST(PTHREAD_CFLAGS) +AC_SUBST(PTHREAD_CC) + +if test x"$acx_pthread_ok" = xyes; then + AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads]) +fi + +# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: +if test x"$acx_pthread_ok" = xyes; then + ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1]) + : +else + acx_pthread_ok=no + $2 +fi +AC_LANG_RESTORE +])dnl ACX_PTHREAD diff --git a/tests/libs/adios/config/cercs.m4 b/tests/libs/adios/config/cercs.m4 new file mode 100644 index 0000000000..7742c05fc7 --- /dev/null +++ b/tests/libs/adios/config/cercs.m4 @@ -0,0 +1,256 @@ +dnl Mon Jan 28 13:01:16 EST 2008 +dnl +dnl cercs_require_package(package, include_file, library_file) +dnl either include file or library_file may be left off if not needed +dnl this macro searches for the files using find_cercs_file(). If +dnl found, it adds directory in which the found file resides to either +dnl CPPFLAGS (with a -I prefix) or LDFLAGS (with a -L prefix) +dnl +AC_DEFUN([CERCS_REQUIRE_PACKAGE], +[ +AC_REQUIRE([CERCS_SET_ARCHIVE]) +AC_REQUIRE([CERCS_HAS_CYGPATH]) +if test -z "$with_local_specified"; then +CERCS_REQUIRE_OTHER_PACKAGE($1,$2,$3) +else +CERCS_REQUIRE_OTHER_PACKAGE($1,$2,$3,1) +fi +]) +dnl +dnl +AC_DEFUN([CERCS_REQUIRE_OTHER_PACKAGE], +[ +AC_REQUIRE([CERCS_SET_ARCHIVE]) +AC_REQUIRE([CERCS_HAS_CYGPATH]) +AC_ARG_WITH(translit($1, `/',`_'), translit([ --with-$1=DIR Where to find $1 package], `/',`_')) +define([with_translit], translit(with_$1, `/',`_')) +if test -n "$with_translit"; then +dnl +dnl if they did a with, kill the cache variables +dnl +translit(unset cercs_cv_$1_include_arg, `/',`_') +translit(unset cercs_cv_$1_link_arg, `/',`_') +if test `echo $with_translit | sed 's/\(.\).*/\1/g'` != "/"; then +with_translit=`pwd`/$with_translit +fi +fi +ifelse([$2], , , +dnl +dnl if arg2 (include_file) is specified +dnl +AC_MSG_CHECKING(needed include args for $1 package) +AC_CACHE_VAL(translit(cercs_cv_$1_include_arg, `/',`_'), +[ +ifelse([$4],1,[ +search_list="$PWD/../$1 $PWD/../../$1 $PWD/../../../$1" +CERCS_SEARCH($search_list) +if test -n "$tmp_search_results"; then +cercs_tmp=$tmp_search_results +fi +], +CERCS_FIND_FILE($1, $2, cercs_tmp, $with_translit, include)) +if test -n "$cercs_tmp" -a "$cercs_tmp" != "/usr/include/$2"; then +translit(cercs_cv_$1_include_arg, `/',`_')=-I`$PATHPROG $cercs_tmp | sed 's#\\\\#/#g' | sed "s#.$2##g"` +fi +]) +AC_MSG_RESULT(translit($cercs_cv_$1_include_arg, `/',`_')) +dnl +dnl add the result to CPPFLAGS if it is absent +dnl +translit(if test -n "$cercs_cv_$1_include_arg"; then, `/',`_') +translit(arg="$cercs_cv_$1_include_arg", `/',`_') +no_dash_arg=`echo $arg | sed 's/^-//g'` +[if test `echo $DT_CPPFLAGS | grep -c "$no_dash_arg"` -eq 0; then +if test `echo $arg | grep -c "$1"` -eq 0; then +DT_CPPFLAGS="$DT_CPPFLAGS $arg"; +else +DT_CPPFLAGS="$arg $DT_CPPFLAGS" +fi +fi] +fi +) +ifelse([$3], , , +dnl +dnl if arg3 (library_file) is specified +dnl +AC_MSG_CHECKING(needed link args for $1 package) +AC_CACHE_VAL(translit(cercs_cv_$1_link_dir, `/',`_'), +[ +ifelse([$4],1,[ +search_list="$PWD/../$1 $PWD/../../$1 $PWD/../../../$1" +CERCS_SEARCH($search_list) +if test -n "$tmp_search_results"; then +cercs_tmp=$tmp_search_results +fi +], +CERCS_FIND_FILE($1, $3, cercs_tmp, $with_translit, lib)) +if test -n "$cercs_tmp" -a "$cercs_tmp" != "$3"; then +translit(cercs_cv_$1_link_dir, `/',`_')=`$PATHPROG $cercs_tmp | sed 's#\\\\#/#g' | sed "s/.$3//g"` +else +translit(cercs_cv_$1_link_dir="", `/',`_') +fi +]) +AC_MSG_RESULT(translit($cercs_cv_$1_link_dir, `/',`_')) +ld_arg="-L" +new_flags=$LDFLAGS +dnl +dnl add the result to LDFLAGS if it is absent +dnl +translit(cercs_cv_$1_link_arg=`echo $cercs_cv_$1_link_dir, `/',`_') | sed "/./ s/^/$ld_arg/1"` +translit(if test -n "$cercs_cv_$1_link_arg"; then, `/',`_') +translit(arg=$cercs_cv_$1_link_arg, `/',`_') +no_dash_arg=`echo $arg | sed 's/^-//g'` +[if test `echo $new_flags | grep -c "$no_dash_arg"` -eq 0; then +root=`echo $3 | sed 's/\..*//'` +translit(if test ! -r $cercs_cv_$1_link_dir, `/`, `_`)/$root.la; then +if eval "test \"\${LIBTOOL+set}\" = set"; then +translit(arg="$cercs_cv_$1_link_arg "`echo $cercs_cv_$1_link_dir, `/',`_') | sed "/./ s/^/-R/1"` +fi +fi +if test `echo $arg | grep -c "$1"` -eq 0; then +dnl if arg does not includes a project spec add it at the end +new_flags="$new_flags $arg" +else +new_flags="$arg $new_flags" +fi +fi] +DT_LDFLAGS=$new_flags +fi +) +])dnl +dnl +dnl cercs_find_file(package, file_to_find, variable_to_set, suggestion, dir_name) +dnl search a set of standard directories to find file_to_find. When found, +dnl set $variable_to_set to the path of the file. Use package and +dnl suggestions to help search. Mostly this searches ~chaos (if it exists) +dnl and the usual suspects like: +dnl /usr/{include,lib} /usr/local/{include,lib} /opt//{include,lib} +dnl /opt/misc/{include,lib}. +dnl +AC_DEFUN([CERCS_FIND_FILE], +[ +AC_REQUIRE([CERCS_HAS_CSH]) +AC_REQUIRE([CERCS_SET_ARCHIVE]) +$3="" +search_list="./$2" +CHAOS_HOMEDIR="" +if test -n "$CSH"; then +CHAOS_HOMEDIR=`echo "echo ~chaos" | csh -sf 2>/dev/null | sed 's%/$%%'` || CHAOS_HOMEDIR="" +fi +if test -n "$4"; then +if test `echo $4 | cut -c1` = "~"; then +EXPANDED=`echo "echo $4" | csh -sf 2>/dev/null` || EXPANDED="" +else +EXPANDED=$4 +fi + +echo "Datatap = $datatap_dir" + +search_list="$datatap_dir/$2 $datatap_dir/lib/$2 $datatap_dir/include/$2 $search_list $EXPANDED/$2 $EXPANDED/$5/$2 $EXPANDED/share/$2 $EXPANDED/$cercs_cv_archive/$2 $EXPANDED/$cercs_cv_archive/$5/$2 $EXPANDED/$1/$2 $EXPANDED/$1/$cercs_cv_archive/$2 $EXPANDED/$1/$5/$2 $EXPANDED/$1/$5/$cercs_cv_archive/$2" +fi +if test -z "$with_installed_specified"; then +search_list="$search_list `pwd`/../$1/$2 `pwd`/../$5/$2 `pwd`/../share/$2" +if test "$CHAOS_HOMEDIR" != "$HOME"; then +search_list="$search_list $HOME/$1/$2 $HOME/$cercs_cv_archive/$5/$2 $HOME/$5/$2" +fi +fi +if test -n "$CHAOS_HOMEDIR" -a -n "$cercs_cv_archive"; then +search_list="$search_list $CHAOS_HOMEDIR/$cercs_cv_archive/$1/$5/$2 $CHAOS_HOMEDIR/$cercs_cv_archive/$5/$2 $CHAOS_HOMEDIR/$1/$cercs_cv_archive/$5/$2 $CHAOS_HOMEDIR/$1/$5/$2 $CHAOS_HOMEDIR/$5/$2" +fi +if test "$libdir" != '${exec_prefix}/lib'; then +tmpdir=`echo ${libdir} | sed 's%/$%%'` +search_list="$tmpdir/$2 $search_list" +fi +if test "$exec_prefix" != "NONE"; then +tmpdir=`echo ${exec_prefix} | sed 's%/$%%'` +search_list="$tmpdir/lib/$2 $search_list" +fi +if test "$includedir" != '${prefix}/include'; then +tmpdir=`echo ${includedir} | sed 's%/$%%'` +search_list="$tmpdir/$2 $search_list" +fi +if test "$prefix" != "NONE"; then +tmpdir=`echo ${prefix} | sed 's%/$%%'` +search_list="$tmpdir/$5/$2 $search_list" +fi +if test "$5" == "lib"; then + for tmp_lib_value in $sys_lib_search_path_spec; do + search_list="$search_list $tmp_lib_value/$2" + done +fi + +search_list="$datatap_dir/$2 $datatap_dir/lib/$2 $datatap_dir/include/$2 $search_list /usr/$5/$2 /usr/local/$5/$2 /opt/$1/$5/$2 /opt/misc/$5/$2 /opt/misc/$5/$cercs_cv_archive/$2" +CERCS_SEARCH($search_list) +if test -n "$tmp_search_results"; then +$3=$tmp_search_results +fi +])dnl +AC_DEFUN([CERCS_SET_INSTALLED],[AC_ARG_WITH(installed, [ --with-installed Don't use local copies of CERCS packages],with_installed_specified=1)]) +AC_DEFUN([CERCS_SET_LOCAL],[AC_ARG_WITH(local, [ --with-local Use only local copies of CERCS packages],with_local_specified=1)]) +dnl +dnl CERCS_SET_ARCHIVE() +dnl set the $cercs_cv_machine_target variable to a standard archive name +dnl +AC_DEFUN([CERCS_SET_ARCHIVE],[ +AC_REQUIRE([CERCS_SET_INSTALLED]) +AC_REQUIRE([CERCS_SET_LOCAL]) +AC_REQUIRE([CERCS_HAS_CSH]) +CHAOS_HOMEDIR="" +if test -n "$CSH"; then +CHAOS_HOMEDIR=`echo "echo ~chaos" | csh -sf 2>/dev/null | sed 's%/$%%'` || CHAOS_HOMEDIR="" +fi +if test "$cross_compiling" = yes ; then + cpu=$host_cpu + vendor=$host_vendot + os=$host_os +else + cpu= + vendor= + os= +fi +if test -x $CHAOS_HOMEDIR/bin/cercs_arch; then +cercs_cv_archive=`$CHAOS_HOMEDIR/bin/cercs_arch "$cpu" "$vendor" "$os"` +else +cercs_cv_archive=${cercs_cv_archive-`cercs_arch 2>/dev/null`} || cercs_cv_archive="" +fi +])dnl +dnl +dnl CERCS_SEARCH(variable to define, options to try) +define(CERCS_SEARCH, +[tmp_search_results="" +echo "configure:__oline__: searching for $1 " >&5 +for tmp_search_value in $1; do + if test -r $tmp_search_value; then + tmp_search_results=$tmp_search_value + echo "configure:__oline__: first found $tmp_search_results " >&5 + break + fi +done +])dnl +dnl +dnl +dnl CERCS_LIB_PREFIX +dnl this macro tries to set a reasonable default for the prefix value +dnl call with two arguments, project name and library name +dnl +AC_DEFUN([CERCS_LIB_PREFIX], +[if test "x$prefix" = xNONE; then +AC_REQUIRE([CERCS_SET_ARCHIVE]) +search_list="" +CHAOS_HOMEDIR="" +if test -n "$CSH"; then +CHAOS_HOMEDIR=`echo "echo ~chaos" | csh -sf 2>/dev/null | sed 's%/$%%'` || CHAOS_HOMEDIR="" +fi +if test -n "$CHAOS_HOMEDIR"; then +search_list="$search_list $CHAOS_HOMEDIR/$cercs_cv_archive/lib/$2 $CHAOS_HOMEDIR/lib/$2" +fi +search_list="$search_list /usr/lib/$2 /usr/local/lib/$2 /opt/$1/lib/$2 /opt/misc/lib/$2" +CERCS_SEARCH($search_list) +if test -n "$tmp_search_results"; then + prefix=`echo $tmp_search_results|sed "s%$cercs_cv_archive/lib/$2%%g;s%lib/$2%%g;s%/[^/][^/]*//*[^/][^/]*$%%"` + exec_prefix=`echo $tmp_search_results|sed 's%lib/$2%%g;s%/[^/][^/]*//*[^/][^/]*$%%'` +fi +fi +])dnl +AC_DEFUN([CERCS_HAS_CSH], [AC_PATH_PROG(CSH,csh)])dnl +AC_DEFUN([CERCS_HAS_CYGPATH], [AC_CHECK_PROG(PATHPROG,cygpath,[cygpath -w],[echo])])dnl diff --git a/tests/libs/adios/config/compile b/tests/libs/adios/config/compile new file mode 100755 index 0000000000..c0096a7b56 --- /dev/null +++ b/tests/libs/adios/config/compile @@ -0,0 +1,143 @@ +#! /bin/sh +# Wrapper for compilers which do not understand `-c -o'. + +scriptversion=2009-10-06.20; # UTC + +# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009 Free Software +# Foundation, Inc. +# Written by Tom Tromey . +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +case $1 in + '') + echo "$0: No command. Try \`$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: compile [--help] [--version] PROGRAM [ARGS] + +Wrapper for compilers which do not understand `-c -o'. +Remove `-o dest.o' from ARGS, run PROGRAM with the remaining +arguments, and rename the output as expected. + +If you are trying to build a whole package this is not the +right script to run: please start by reading the file `INSTALL'. + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "compile $scriptversion" + exit $? + ;; +esac + +ofile= +cfile= +eat= + +for arg +do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as `compile cc -o foo foo.c'. + # So we strip `-o arg' only if arg is an object. + eat=1 + case $2 in + *.o | *.obj) + ofile=$2 + ;; + *) + set x "$@" -o "$2" + shift + ;; + esac + ;; + *.c) + cfile=$1 + set x "$@" "$1" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift +done + +if test -z "$ofile" || test -z "$cfile"; then + # If no `-o' option was seen then we might have been invoked from a + # pattern rule where we don't need one. That is ok -- this is a + # normal compilation that the losing compiler can handle. If no + # `.c' file was seen then we are probably linking. That is also + # ok. + exec "$@" +fi + +# Name of file we expect compiler to create. +cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` + +# Create the lock directory. +# Note: use `[/\\:.-]' here to ensure that we don't use the same name +# that we are using for the .o file. Also, base the name on the expected +# object file name, since that is what matters with a parallel build. +lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d +while true; do + if mkdir "$lockdir" >/dev/null 2>&1; then + break + fi + sleep 1 +done +# FIXME: race condition here if user kills between mkdir and trap. +trap "rmdir '$lockdir'; exit 1" 1 2 15 + +# Run the compile. +"$@" +ret=$? + +if test -f "$cofile"; then + test "$cofile" = "$ofile" || mv "$cofile" "$ofile" +elif test -f "${cofile}bj"; then + test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" +fi + +rmdir "$lockdir" +exit $ret + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/tests/libs/adios/config/libtool.m4 b/tests/libs/adios/config/libtool.m4 new file mode 100644 index 0000000000..671cde117d --- /dev/null +++ b/tests/libs/adios/config/libtool.m4 @@ -0,0 +1,7360 @@ +# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008 Free Software Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +m4_define([_LT_COPYING], [dnl +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008 Free Software Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is part of GNU Libtool. +# +# GNU Libtool is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, or +# obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +]) + +# serial 56 LT_INIT + + +# LT_PREREQ(VERSION) +# ------------------ +# Complain and exit if this libtool version is less that VERSION. +m4_defun([LT_PREREQ], +[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, + [m4_default([$3], + [m4_fatal([Libtool version $1 or higher is required], + 63)])], + [$2])]) + + +# _LT_CHECK_BUILDDIR +# ------------------ +# Complain if the absolute build directory name contains unusual characters +m4_defun([_LT_CHECK_BUILDDIR], +[case `pwd` in + *\ * | *\ *) + AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; +esac +]) + + +# LT_INIT([OPTIONS]) +# ------------------ +AC_DEFUN([LT_INIT], +[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT +AC_BEFORE([$0], [LT_LANG])dnl +AC_BEFORE([$0], [LT_OUTPUT])dnl +AC_BEFORE([$0], [LTDL_INIT])dnl +m4_require([_LT_CHECK_BUILDDIR])dnl + +dnl Autoconf doesn't catch unexpanded LT_ macros by default: +m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl +m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl +dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 +dnl unless we require an AC_DEFUNed macro: +AC_REQUIRE([LTOPTIONS_VERSION])dnl +AC_REQUIRE([LTSUGAR_VERSION])dnl +AC_REQUIRE([LTVERSION_VERSION])dnl +AC_REQUIRE([LTOBSOLETE_VERSION])dnl +m4_require([_LT_PROG_LTMAIN])dnl + +dnl Parse OPTIONS +_LT_SET_OPTIONS([$0], [$1]) + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ltmain" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' +AC_SUBST(LIBTOOL)dnl + +_LT_SETUP + +# Only expand once: +m4_define([LT_INIT]) +])# LT_INIT + +# Old names: +AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) +AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_PROG_LIBTOOL], []) +dnl AC_DEFUN([AM_PROG_LIBTOOL], []) + + +# _LT_CC_BASENAME(CC) +# ------------------- +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +m4_defun([_LT_CC_BASENAME], +[for cc_temp in $1""; do + case $cc_temp in + compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; + distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` +]) + + +# _LT_FILEUTILS_DEFAULTS +# ---------------------- +# It is okay to use these file commands and assume they have been set +# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. +m4_defun([_LT_FILEUTILS_DEFAULTS], +[: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} +])# _LT_FILEUTILS_DEFAULTS + + +# _LT_SETUP +# --------- +m4_defun([_LT_SETUP], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +_LT_DECL([], [host_alias], [0], [The host system])dnl +_LT_DECL([], [host], [0])dnl +_LT_DECL([], [host_os], [0])dnl +dnl +_LT_DECL([], [build_alias], [0], [The build system])dnl +_LT_DECL([], [build], [0])dnl +_LT_DECL([], [build_os], [0])dnl +dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([LT_PATH_LD])dnl +AC_REQUIRE([LT_PATH_NM])dnl +dnl +AC_REQUIRE([AC_PROG_LN_S])dnl +test -z "$LN_S" && LN_S="ln -s" +_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl +dnl +AC_REQUIRE([LT_CMD_MAX_LEN])dnl +_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl +_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl +dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_CHECK_SHELL_FEATURES])dnl +m4_require([_LT_CMD_RELOAD])dnl +m4_require([_LT_CHECK_MAGIC_METHOD])dnl +m4_require([_LT_CMD_OLD_ARCHIVE])dnl +m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl + +_LT_CONFIG_LIBTOOL_INIT([ +# See if we are running on zsh, and set the options which allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi +]) +if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + +_LT_CHECK_OBJDIR + +m4_require([_LT_TAG_COMPILER])dnl +_LT_PROG_ECHO_BACKSLASH + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\([["`\\]]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a + +with_gnu_ld="$lt_cv_prog_gnu_ld" + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +_LT_CC_BASENAME([$compiler]) + +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + _LT_PATH_MAGIC + fi + ;; +esac + +# Use C for the default configuration in the libtool script +LT_SUPPORTED_TAG([CC]) +_LT_LANG_C_CONFIG +_LT_LANG_DEFAULT_CONFIG +_LT_CONFIG_COMMANDS +])# _LT_SETUP + + +# _LT_PROG_LTMAIN +# --------------- +# Note that this code is called both from `configure', and `config.status' +# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, +# `config.status' has no value for ac_aux_dir unless we are using Automake, +# so we pass a copy along to make sure it has a sensible value anyway. +m4_defun([_LT_PROG_LTMAIN], +[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl +_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) +ltmain="$ac_aux_dir/ltmain.sh" +])# _LT_PROG_LTMAIN + + +## ------------------------------------- ## +## Accumulate code for creating libtool. ## +## ------------------------------------- ## + +# So that we can recreate a full libtool script including additional +# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS +# in macros and then make a single call at the end using the `libtool' +# label. + + +# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) +# ---------------------------------------- +# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. +m4_define([_LT_CONFIG_LIBTOOL_INIT], +[m4_ifval([$1], + [m4_append([_LT_OUTPUT_LIBTOOL_INIT], + [$1 +])])]) + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_INIT]) + + +# _LT_CONFIG_LIBTOOL([COMMANDS]) +# ------------------------------ +# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. +m4_define([_LT_CONFIG_LIBTOOL], +[m4_ifval([$1], + [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], + [$1 +])])]) + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) + + +# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) +# ----------------------------------------------------- +m4_defun([_LT_CONFIG_SAVE_COMMANDS], +[_LT_CONFIG_LIBTOOL([$1]) +_LT_CONFIG_LIBTOOL_INIT([$2]) +]) + + +# _LT_FORMAT_COMMENT([COMMENT]) +# ----------------------------- +# Add leading comment marks to the start of each line, and a trailing +# full-stop to the whole comment if one is not present already. +m4_define([_LT_FORMAT_COMMENT], +[m4_ifval([$1], [ +m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], + [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) +)]) + + + +## ------------------------ ## +## FIXME: Eliminate VARNAME ## +## ------------------------ ## + + +# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) +# ------------------------------------------------------------------- +# CONFIGNAME is the name given to the value in the libtool script. +# VARNAME is the (base) name used in the configure script. +# VALUE may be 0, 1 or 2 for a computed quote escaped value based on +# VARNAME. Any other value will be used directly. +m4_define([_LT_DECL], +[lt_if_append_uniq([lt_decl_varnames], [$2], [, ], + [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], + [m4_ifval([$1], [$1], [$2])]) + lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) + m4_ifval([$4], + [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) + lt_dict_add_subkey([lt_decl_dict], [$2], + [tagged?], [m4_ifval([$5], [yes], [no])])]) +]) + + +# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) +# -------------------------------------------------------- +m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) + + +# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) +# ------------------------------------------------ +m4_define([lt_decl_tag_varnames], +[_lt_decl_filter([tagged?], [yes], $@)]) + + +# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) +# --------------------------------------------------------- +m4_define([_lt_decl_filter], +[m4_case([$#], + [0], [m4_fatal([$0: too few arguments: $#])], + [1], [m4_fatal([$0: too few arguments: $#: $1])], + [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], + [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], + [lt_dict_filter([lt_decl_dict], $@)])[]dnl +]) + + +# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) +# -------------------------------------------------- +m4_define([lt_decl_quote_varnames], +[_lt_decl_filter([value], [1], $@)]) + + +# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) +# --------------------------------------------------- +m4_define([lt_decl_dquote_varnames], +[_lt_decl_filter([value], [2], $@)]) + + +# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) +# --------------------------------------------------- +m4_define([lt_decl_varnames_tagged], +[m4_assert([$# <= 2])dnl +_$0(m4_quote(m4_default([$1], [[, ]])), + m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), + m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) +m4_define([_lt_decl_varnames_tagged], +[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) + + +# lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) +# ------------------------------------------------ +m4_define([lt_decl_all_varnames], +[_$0(m4_quote(m4_default([$1], [[, ]])), + m4_if([$2], [], + m4_quote(lt_decl_varnames), + m4_quote(m4_shift($@))))[]dnl +]) +m4_define([_lt_decl_all_varnames], +[lt_join($@, lt_decl_varnames_tagged([$1], + lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl +]) + + +# _LT_CONFIG_STATUS_DECLARE([VARNAME]) +# ------------------------------------ +# Quote a variable value, and forward it to `config.status' so that its +# declaration there will have the same value as in `configure'. VARNAME +# must have a single quote delimited value for this to work. +m4_define([_LT_CONFIG_STATUS_DECLARE], +[$1='`$ECHO "X$][$1" | $Xsed -e "$delay_single_quote_subst"`']) + + +# _LT_CONFIG_STATUS_DECLARATIONS +# ------------------------------ +# We delimit libtool config variables with single quotes, so when +# we write them to config.status, we have to be sure to quote all +# embedded single quotes properly. In configure, this macro expands +# each variable declared with _LT_DECL (and _LT_TAGDECL) into: +# +# ='`$ECHO "X$" | $Xsed -e "$delay_single_quote_subst"`' +m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], +[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), + [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) + + +# _LT_LIBTOOL_TAGS +# ---------------- +# Output comment and list of tags supported by the script +m4_defun([_LT_LIBTOOL_TAGS], +[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl +available_tags="_LT_TAGS"dnl +]) + + +# _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) +# ----------------------------------- +# Extract the dictionary values for VARNAME (optionally with TAG) and +# expand to a commented shell variable setting: +# +# # Some comment about what VAR is for. +# visible_name=$lt_internal_name +m4_define([_LT_LIBTOOL_DECLARE], +[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], + [description])))[]dnl +m4_pushdef([_libtool_name], + m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl +m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), + [0], [_libtool_name=[$]$1], + [1], [_libtool_name=$lt_[]$1], + [2], [_libtool_name=$lt_[]$1], + [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl +m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl +]) + + +# _LT_LIBTOOL_CONFIG_VARS +# ----------------------- +# Produce commented declarations of non-tagged libtool config variables +# suitable for insertion in the LIBTOOL CONFIG section of the `libtool' +# script. Tagged libtool config variables (even for the LIBTOOL CONFIG +# section) are produced by _LT_LIBTOOL_TAG_VARS. +m4_defun([_LT_LIBTOOL_CONFIG_VARS], +[m4_foreach([_lt_var], + m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), + [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) + + +# _LT_LIBTOOL_TAG_VARS(TAG) +# ------------------------- +m4_define([_LT_LIBTOOL_TAG_VARS], +[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), + [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) + + +# _LT_TAGVAR(VARNAME, [TAGNAME]) +# ------------------------------ +m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) + + +# _LT_CONFIG_COMMANDS +# ------------------- +# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of +# variables for single and double quote escaping we saved from calls +# to _LT_DECL, we can put quote escaped variables declarations +# into `config.status', and then the shell code to quote escape them in +# for loops in `config.status'. Finally, any additional code accumulated +# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. +m4_defun([_LT_CONFIG_COMMANDS], +[AC_PROVIDE_IFELSE([LT_OUTPUT], + dnl If the libtool generation code has been placed in $CONFIG_LT, + dnl instead of duplicating it all over again into config.status, + dnl then we will have config.status run $CONFIG_LT later, so it + dnl needs to know what name is stored there: + [AC_CONFIG_COMMANDS([libtool], + [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], + dnl If the libtool generation code is destined for config.status, + dnl expand the accumulated commands and init code now: + [AC_CONFIG_COMMANDS([libtool], + [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) +])#_LT_CONFIG_COMMANDS + + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], +[ + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +_LT_CONFIG_STATUS_DECLARATIONS +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# Quote evaled strings. +for var in lt_decl_all_varnames([[ \ +]], lt_decl_quote_varnames); do + case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in + *[[\\\\\\\`\\"\\\$]]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in lt_decl_all_varnames([[ \ +]], lt_decl_dquote_varnames); do + case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in + *[[\\\\\\\`\\"\\\$]]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Fix-up fallback echo if it was mangled by the above quoting rules. +case \$lt_ECHO in +*'\\\[$]0 --fallback-echo"')dnl " + lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\` + ;; +esac + +_LT_OUTPUT_LIBTOOL_INIT +]) + + +# LT_OUTPUT +# --------- +# This macro allows early generation of the libtool script (before +# AC_OUTPUT is called), incase it is used in configure for compilation +# tests. +AC_DEFUN([LT_OUTPUT], +[: ${CONFIG_LT=./config.lt} +AC_MSG_NOTICE([creating $CONFIG_LT]) +cat >"$CONFIG_LT" <<_LTEOF +#! $SHELL +# Generated by $as_me. +# Run this file to recreate a libtool stub with the current configuration. + +lt_cl_silent=false +SHELL=\${CONFIG_SHELL-$SHELL} +_LTEOF + +cat >>"$CONFIG_LT" <<\_LTEOF +AS_SHELL_SANITIZE +_AS_PREPARE + +exec AS_MESSAGE_FD>&1 +exec AS_MESSAGE_LOG_FD>>config.log +{ + echo + AS_BOX([Running $as_me.]) +} >&AS_MESSAGE_LOG_FD + +lt_cl_help="\ +\`$as_me' creates a local libtool stub from the current configuration, +for use in further configure time tests before the real libtool is +generated. + +Usage: $[0] [[OPTIONS]] + + -h, --help print this help, then exit + -V, --version print version number, then exit + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files + +Report bugs to ." + +lt_cl_version="\ +m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl +m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) +configured by $[0], generated by m4_PACKAGE_STRING. + +Copyright (C) 2008 Free Software Foundation, Inc. +This config.lt script is free software; the Free Software Foundation +gives unlimited permision to copy, distribute and modify it." + +while test $[#] != 0 +do + case $[1] in + --version | --v* | -V ) + echo "$lt_cl_version"; exit 0 ;; + --help | --h* | -h ) + echo "$lt_cl_help"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --quiet | --q* | --silent | --s* | -q ) + lt_cl_silent=: ;; + + -*) AC_MSG_ERROR([unrecognized option: $[1] +Try \`$[0] --help' for more information.]) ;; + + *) AC_MSG_ERROR([unrecognized argument: $[1] +Try \`$[0] --help' for more information.]) ;; + esac + shift +done + +if $lt_cl_silent; then + exec AS_MESSAGE_FD>/dev/null +fi +_LTEOF + +cat >>"$CONFIG_LT" <<_LTEOF +_LT_OUTPUT_LIBTOOL_COMMANDS_INIT +_LTEOF + +cat >>"$CONFIG_LT" <<\_LTEOF +AC_MSG_NOTICE([creating $ofile]) +_LT_OUTPUT_LIBTOOL_COMMANDS +AS_EXIT(0) +_LTEOF +chmod +x "$CONFIG_LT" + +# configure is writing to config.log, but config.lt does its own redirection, +# appending to config.log, which fails on DOS, as config.log is still kept +# open by configure. Here we exec the FD to /dev/null, effectively closing +# config.log, so it can be properly (re)opened and appended to by config.lt. +if test "$no_create" != yes; then + lt_cl_success=: + test "$silent" = yes && + lt_config_lt_args="$lt_config_lt_args --quiet" + exec AS_MESSAGE_LOG_FD>/dev/null + $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false + exec AS_MESSAGE_LOG_FD>>config.log + $lt_cl_success || AS_EXIT(1) +fi +])# LT_OUTPUT + + +# _LT_CONFIG(TAG) +# --------------- +# If TAG is the built-in tag, create an initial libtool script with a +# default configuration from the untagged config vars. Otherwise add code +# to config.status for appending the configuration named by TAG from the +# matching tagged config vars. +m4_defun([_LT_CONFIG], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +_LT_CONFIG_SAVE_COMMANDS([ + m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl + m4_if(_LT_TAG, [C], [ + # See if we are running on zsh, and set the options which allow our + # commands through without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + + cfgfile="${ofile}T" + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL + +# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +_LT_COPYING +_LT_LIBTOOL_TAGS + +# ### BEGIN LIBTOOL CONFIG +_LT_LIBTOOL_CONFIG_VARS +_LT_LIBTOOL_TAG_VARS +# ### END LIBTOOL CONFIG + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_EOF >> "$cfgfile" +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +_LT_EOF + ;; + esac + + _LT_PROG_LTMAIN + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + _LT_PROG_XSI_SHELLFNS + + sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" +], +[cat <<_LT_EOF >> "$ofile" + +dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded +dnl in a comment (ie after a #). +# ### BEGIN LIBTOOL TAG CONFIG: $1 +_LT_LIBTOOL_TAG_VARS(_LT_TAG) +# ### END LIBTOOL TAG CONFIG: $1 +_LT_EOF +])dnl /m4_if +], +[m4_if([$1], [], [ + PACKAGE='$PACKAGE' + VERSION='$VERSION' + TIMESTAMP='$TIMESTAMP' + RM='$RM' + ofile='$ofile'], []) +])dnl /_LT_CONFIG_SAVE_COMMANDS +])# _LT_CONFIG + + +# LT_SUPPORTED_TAG(TAG) +# --------------------- +# Trace this macro to discover what tags are supported by the libtool +# --tag option, using: +# autoconf --trace 'LT_SUPPORTED_TAG:$1' +AC_DEFUN([LT_SUPPORTED_TAG], []) + + +# C support is built-in for now +m4_define([_LT_LANG_C_enabled], []) +m4_define([_LT_TAGS], []) + + +# LT_LANG(LANG) +# ------------- +# Enable libtool support for the given language if not already enabled. +AC_DEFUN([LT_LANG], +[AC_BEFORE([$0], [LT_OUTPUT])dnl +m4_case([$1], + [C], [_LT_LANG(C)], + [C++], [_LT_LANG(CXX)], + [Java], [_LT_LANG(GCJ)], + [Fortran 77], [_LT_LANG(F77)], + [Fortran], [_LT_LANG(FC)], + [Windows Resource], [_LT_LANG(RC)], + [m4_ifdef([_LT_LANG_]$1[_CONFIG], + [_LT_LANG($1)], + [m4_fatal([$0: unsupported language: "$1"])])])dnl +])# LT_LANG + + +# _LT_LANG(LANGNAME) +# ------------------ +m4_defun([_LT_LANG], +[m4_ifdef([_LT_LANG_]$1[_enabled], [], + [LT_SUPPORTED_TAG([$1])dnl + m4_append([_LT_TAGS], [$1 ])dnl + m4_define([_LT_LANG_]$1[_enabled], [])dnl + _LT_LANG_$1_CONFIG($1)])dnl +])# _LT_LANG + + +# _LT_LANG_DEFAULT_CONFIG +# ----------------------- +m4_defun([_LT_LANG_DEFAULT_CONFIG], +[AC_PROVIDE_IFELSE([AC_PROG_CXX], + [LT_LANG(CXX)], + [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) + +AC_PROVIDE_IFELSE([AC_PROG_F77], + [LT_LANG(F77)], + [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) + +AC_PROVIDE_IFELSE([AC_PROG_FC], + [LT_LANG(FC)], + [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) + +dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal +dnl pulling things in needlessly. +AC_PROVIDE_IFELSE([AC_PROG_GCJ], + [LT_LANG(GCJ)], + [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], + [LT_LANG(GCJ)], + [AC_PROVIDE_IFELSE([LT_PROG_GCJ], + [LT_LANG(GCJ)], + [m4_ifdef([AC_PROG_GCJ], + [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) + m4_ifdef([A][M_PROG_GCJ], + [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) + m4_ifdef([LT_PROG_GCJ], + [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) + +AC_PROVIDE_IFELSE([LT_PROG_RC], + [LT_LANG(RC)], + [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) +])# _LT_LANG_DEFAULT_CONFIG + +# Obsolete macros: +AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) +AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) +AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) +AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_CXX], []) +dnl AC_DEFUN([AC_LIBTOOL_F77], []) +dnl AC_DEFUN([AC_LIBTOOL_FC], []) +dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) + + +# _LT_TAG_COMPILER +# ---------------- +m4_defun([_LT_TAG_COMPILER], +[AC_REQUIRE([AC_PROG_CC])dnl + +_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl +_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl +_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl +_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC +])# _LT_TAG_COMPILER + + +# _LT_COMPILER_BOILERPLATE +# ------------------------ +# Check for compiler boilerplate output or warnings with +# the simple compiler test code. +m4_defun([_LT_COMPILER_BOILERPLATE], +[m4_require([_LT_DECL_SED])dnl +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* +])# _LT_COMPILER_BOILERPLATE + + +# _LT_LINKER_BOILERPLATE +# ---------------------- +# Check for linker boilerplate output or warnings with +# the simple link test code. +m4_defun([_LT_LINKER_BOILERPLATE], +[m4_require([_LT_DECL_SED])dnl +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* +])# _LT_LINKER_BOILERPLATE + +# _LT_REQUIRED_DARWIN_CHECKS +# ------------------------- +m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ + case $host_os in + rhapsody* | darwin*) + AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) + AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) + AC_CHECK_TOOL([LIPO], [lipo], [:]) + AC_CHECK_TOOL([OTOOL], [otool], [:]) + AC_CHECK_TOOL([OTOOL64], [otool64], [:]) + _LT_DECL([], [DSYMUTIL], [1], + [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) + _LT_DECL([], [NMEDIT], [1], + [Tool to change global to local symbols on Mac OS X]) + _LT_DECL([], [LIPO], [1], + [Tool to manipulate fat objects and archives on Mac OS X]) + _LT_DECL([], [OTOOL], [1], + [ldd/readelf like tool for Mach-O binaries on Mac OS X]) + _LT_DECL([], [OTOOL64], [1], + [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) + + AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], + [lt_cv_apple_cc_single_mod=no + if test -z "${LT_MULTI_MODULE}"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + rm -rf libconftest.dylib* + echo "int foo(void){return 1;}" > conftest.c + echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib -Wl,-single_module conftest.c 2>conftest.err + _lt_result=$? + if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&AS_MESSAGE_LOG_FD + fi + rm -rf libconftest.dylib* + rm -f conftest.* + fi]) + AC_CACHE_CHECK([for -exported_symbols_list linker flag], + [lt_cv_ld_exported_symbols_list], + [lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [lt_cv_ld_exported_symbols_list=yes], + [lt_cv_ld_exported_symbols_list=no]) + LDFLAGS="$save_LDFLAGS" + ]) + case $host_os in + rhapsody* | darwin1.[[012]]) + _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + darwin*) # darwin 5.x on + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + 10.[[012]]*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + 10.*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test "$lt_cv_apple_cc_single_mod" = "yes"; then + _lt_dar_single_mod='$single_module' + fi + if test "$lt_cv_ld_exported_symbols_list" = "yes"; then + _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' + else + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + if test "$DSYMUTIL" != ":"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac +]) + + +# _LT_DARWIN_LINKER_FEATURES +# -------------------------- +# Checks for linker and compiler features on darwin +m4_defun([_LT_DARWIN_LINKER_FEATURES], +[ + m4_require([_LT_REQUIRED_DARWIN_CHECKS]) + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_automatic, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_TAGVAR(whole_archive_flag_spec, $1)='' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" + case $cc_basename in + ifort*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test "$_lt_dar_can_shared" = "yes"; then + output_verbose_link_cmd=echo + _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + m4_if([$1], [CXX], +[ if test "$lt_cv_apple_cc_single_mod" != "yes"; then + _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" + _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" + fi +],[]) + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi +]) + +# _LT_SYS_MODULE_PATH_AIX +# ----------------------- +# Links a minimal program and checks the executable +# for the system default hardcoded library path. In most cases, +# this is /usr/lib:/lib, but when the MPI compilers are used +# the location of the communication and MPI libs are included too. +# If we don't find anything, use the default library path according +# to the aix ld manual. +m4_defun([_LT_SYS_MODULE_PATH_AIX], +[m4_require([_LT_DECL_SED])dnl +AC_LINK_IFELSE(AC_LANG_PROGRAM,[ +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +fi],[]) +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi +])# _LT_SYS_MODULE_PATH_AIX + + +# _LT_SHELL_INIT(ARG) +# ------------------- +m4_define([_LT_SHELL_INIT], +[ifdef([AC_DIVERSION_NOTICE], + [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], + [AC_DIVERT_PUSH(NOTICE)]) +$1 +AC_DIVERT_POP +])# _LT_SHELL_INIT + + +# _LT_PROG_ECHO_BACKSLASH +# ----------------------- +# Add some code to the start of the generated configure script which +# will find an echo command which doesn't interpret backslashes. +m4_defun([_LT_PROG_ECHO_BACKSLASH], +[_LT_SHELL_INIT([ +# Check that we are running under the correct shell. +SHELL=${CONFIG_SHELL-/bin/sh} + +case X$lt_ECHO in +X*--fallback-echo) + # Remove one level of quotation (which was required for Make). + ECHO=`echo "$lt_ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` + ;; +esac + +ECHO=${lt_ECHO-echo} +if test "X[$]1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X[$]1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then + # Yippee, $ECHO works! + : +else + # Restart under the correct shell. + exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} +fi + +if test "X[$]1" = X--fallback-echo; then + # used as fallback echo + shift + cat <<_LT_EOF +[$]* +_LT_EOF + exit 0 +fi + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +if test -z "$lt_ECHO"; then + if test "X${echo_test_string+set}" != Xset; then + # find a string as large as possible, as long as the shell can cope with it + for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do + # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... + if { echo_test_string=`eval $cmd`; } 2>/dev/null && + { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null + then + break + fi + done + fi + + if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + : + else + # The Solaris, AIX, and Digital Unix default echo programs unquote + # backslashes. This makes it impossible to quote backslashes using + # echo "$something" | sed 's/\\/\\\\/g' + # + # So, first we look for a working echo in the user's PATH. + + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for dir in $PATH /usr/ucb; do + IFS="$lt_save_ifs" + if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && + test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + ECHO="$dir/echo" + break + fi + done + IFS="$lt_save_ifs" + + if test "X$ECHO" = Xecho; then + # We didn't find a better echo, so look for alternatives. + if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # This shell has a builtin print -r that does the trick. + ECHO='print -r' + elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } && + test "X$CONFIG_SHELL" != X/bin/ksh; then + # If we have ksh, try running configure again with it. + ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} + export ORIGINAL_CONFIG_SHELL + CONFIG_SHELL=/bin/ksh + export CONFIG_SHELL + exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} + else + # Try using printf. + ECHO='printf %s\n' + if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # Cool, printf works + : + elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL + export CONFIG_SHELL + SHELL="$CONFIG_SHELL" + export SHELL + ECHO="$CONFIG_SHELL [$]0 --fallback-echo" + elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + ECHO="$CONFIG_SHELL [$]0 --fallback-echo" + else + # maybe with a smaller string... + prev=: + + for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do + if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null + then + break + fi + prev="$cmd" + done + + if test "$prev" != 'sed 50q "[$]0"'; then + echo_test_string=`eval $prev` + export echo_test_string + exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} + else + # Oops. We lost completely, so just stick with echo. + ECHO=echo + fi + fi + fi + fi + fi +fi + +# Copy echo and quote the copy suitably for passing to libtool from +# the Makefile, instead of quoting the original, which is used later. +lt_ECHO=$ECHO +if test "X$lt_ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then + lt_ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" +fi + +AC_SUBST(lt_ECHO) +]) +_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) +_LT_DECL([], [ECHO], [1], + [An echo program that does not interpret backslashes]) +])# _LT_PROG_ECHO_BACKSLASH + + +# _LT_ENABLE_LOCK +# --------------- +m4_defun([_LT_ENABLE_LOCK], +[AC_ARG_ENABLE([libtool-lock], + [AS_HELP_STRING([--disable-libtool-lock], + [avoid locking (might break parallel builds)])]) +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '[#]line __oline__ "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*|powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, + [AC_LANG_PUSH(C) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) + AC_LANG_POP]) + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; +sparc*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) LD="${LD-ld} -m elf64_sparc" ;; + *) + if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then + LD="${LD-ld} -64" + fi + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; +esac + +need_locks="$enable_libtool_lock" +])# _LT_ENABLE_LOCK + + +# _LT_CMD_OLD_ARCHIVE +# ------------------- +m4_defun([_LT_CMD_OLD_ARCHIVE], +[AC_CHECK_TOOL(AR, ar, false) +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru +_LT_DECL([], [AR], [1], [The archiver]) +_LT_DECL([], [AR_FLAGS], [1]) + +AC_CHECK_TOOL(STRIP, strip, :) +test -z "$STRIP" && STRIP=: +_LT_DECL([], [STRIP], [1], [A symbol stripping program]) + +AC_CHECK_TOOL(RANLIB, ranlib, :) +test -z "$RANLIB" && RANLIB=: +_LT_DECL([], [RANLIB], [1], + [Commands used to install an old-style archive]) + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi +_LT_DECL([], [old_postinstall_cmds], [2]) +_LT_DECL([], [old_postuninstall_cmds], [2]) +_LT_TAGDECL([], [old_archive_cmds], [2], + [Commands used to build an old-style archive]) +])# _LT_CMD_OLD_ARCHIVE + + +# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------------------- +# Check whether the given compiler option works +AC_DEFUN([_LT_COMPILER_OPTION], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_SED])dnl +AC_CACHE_CHECK([$1], [$2], + [$2=no + m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$3" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + fi + $RM conftest* +]) + +if test x"[$]$2" = xyes; then + m4_if([$5], , :, [$5]) +else + m4_if([$6], , :, [$6]) +fi +])# _LT_COMPILER_OPTION + +# Old name: +AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) + + +# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------- +# Check whether the given linker option works +AC_DEFUN([_LT_LINKER_OPTION], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_SED])dnl +AC_CACHE_CHECK([$1], [$2], + [$2=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $3" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&AS_MESSAGE_LOG_FD + $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + else + $2=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" +]) + +if test x"[$]$2" = xyes; then + m4_if([$4], , :, [$4]) +else + m4_if([$5], , :, [$5]) +fi +])# _LT_LINKER_OPTION + +# Old name: +AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) + + +# LT_CMD_MAX_LEN +#--------------- +AC_DEFUN([LT_CMD_MAX_LEN], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +# find the maximum length of command line arguments +AC_MSG_CHECKING([the maximum length of command line arguments]) +AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl + i=0 + teststring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw* | cegcc*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len"; then + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. + for i in 1 2 3 4 5 6 7 8 ; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + while { test "X"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ + = "XX$teststring$teststring"; } >/dev/null 2>&1 && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + teststring= + # Add a significant safety factor because C++ compilers can tack on + # massive amounts of additional arguments before passing them to the + # linker. It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + fi + ;; + esac +]) +if test -n $lt_cv_sys_max_cmd_len ; then + AC_MSG_RESULT($lt_cv_sys_max_cmd_len) +else + AC_MSG_RESULT(none) +fi +max_cmd_len=$lt_cv_sys_max_cmd_len +_LT_DECL([], [max_cmd_len], [0], + [What is the maximum length of a command?]) +])# LT_CMD_MAX_LEN + +# Old name: +AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) + + +# _LT_HEADER_DLFCN +# ---------------- +m4_defun([_LT_HEADER_DLFCN], +[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl +])# _LT_HEADER_DLFCN + + +# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, +# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) +# ---------------------------------------------------------------- +m4_defun([_LT_TRY_DLOPEN_SELF], +[m4_require([_LT_HEADER_DLFCN])dnl +if test "$cross_compiling" = yes; then : + [$4] +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +[#line __oline__ "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +}] +_LT_EOF + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) $1 ;; + x$lt_dlneed_uscore) $2 ;; + x$lt_dlunknown|x*) $3 ;; + esac + else : + # compilation failed + $3 + fi +fi +rm -fr conftest* +])# _LT_TRY_DLOPEN_SELF + + +# LT_SYS_DLOPEN_SELF +# ------------------ +AC_DEFUN([LT_SYS_DLOPEN_SELF], +[m4_require([_LT_HEADER_DLFCN])dnl +if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32* | cegcc*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ]) + ;; + + *) + AC_CHECK_FUNC([shl_load], + [lt_cv_dlopen="shl_load"], + [AC_CHECK_LIB([dld], [shl_load], + [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], + [AC_CHECK_FUNC([dlopen], + [lt_cv_dlopen="dlopen"], + [AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], + [AC_CHECK_LIB([svld], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], + [AC_CHECK_LIB([dld], [dld_link], + [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) + ]) + ]) + ]) + ]) + ]) + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + AC_CACHE_CHECK([whether a program can dlopen itself], + lt_cv_dlopen_self, [dnl + _LT_TRY_DLOPEN_SELF( + lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, + lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) + ]) + + if test "x$lt_cv_dlopen_self" = xyes; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + AC_CACHE_CHECK([whether a statically linked program can dlopen itself], + lt_cv_dlopen_self_static, [dnl + _LT_TRY_DLOPEN_SELF( + lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, + lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) + ]) + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi +_LT_DECL([dlopen_support], [enable_dlopen], [0], + [Whether dlopen is supported]) +_LT_DECL([dlopen_self], [enable_dlopen_self], [0], + [Whether dlopen of programs is supported]) +_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], + [Whether dlopen of statically linked programs is supported]) +])# LT_SYS_DLOPEN_SELF + +# Old name: +AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) + + +# _LT_COMPILER_C_O([TAGNAME]) +# --------------------------- +# Check to see if options -c and -o are simultaneously supported by compiler. +# This macro does not hard code the compiler like AC_PROG_CC_C_O. +m4_defun([_LT_COMPILER_C_O], +[m4_require([_LT_DECL_SED])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_TAG_COMPILER])dnl +AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], + [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], + [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + fi + fi + chmod u+w . 2>&AS_MESSAGE_LOG_FD + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* +]) +_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], + [Does compiler simultaneously support -c and -o options?]) +])# _LT_COMPILER_C_O + + +# _LT_COMPILER_FILE_LOCKS([TAGNAME]) +# ---------------------------------- +# Check to see if we can do hard links to lock some files if needed +m4_defun([_LT_COMPILER_FILE_LOCKS], +[m4_require([_LT_ENABLE_LOCK])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +_LT_COMPILER_C_O([$1]) + +hard_links="nottested" +if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + AC_MSG_CHECKING([if we can lock with hard links]) + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + AC_MSG_RESULT([$hard_links]) + if test "$hard_links" = no; then + AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) + need_locks=warn + fi +else + need_locks=no +fi +_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) +])# _LT_COMPILER_FILE_LOCKS + + +# _LT_CHECK_OBJDIR +# ---------------- +m4_defun([_LT_CHECK_OBJDIR], +[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], +[rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null]) +objdir=$lt_cv_objdir +_LT_DECL([], [objdir], [0], + [The name of the directory that contains temporary libtool files])dnl +m4_pattern_allow([LT_OBJDIR])dnl +AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", + [Define to the sub-directory in which libtool stores uninstalled libraries.]) +])# _LT_CHECK_OBJDIR + + +# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) +# -------------------------------------- +# Check hardcoding attributes. +m4_defun([_LT_LINKER_HARDCODE_LIBPATH], +[AC_MSG_CHECKING([how to hardcode library paths into programs]) +_LT_TAGVAR(hardcode_action, $1)= +if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || + test -n "$_LT_TAGVAR(runpath_var, $1)" || + test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then + + # We can hardcode non-existent directories. + if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && + test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then + # Linking always hardcodes the temporary library directory. + _LT_TAGVAR(hardcode_action, $1)=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + _LT_TAGVAR(hardcode_action, $1)=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + _LT_TAGVAR(hardcode_action, $1)=unsupported +fi +AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) + +if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || + test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi +_LT_TAGDECL([], [hardcode_action], [0], + [How to hardcode a shared library path into an executable]) +])# _LT_LINKER_HARDCODE_LIBPATH + + +# _LT_CMD_STRIPLIB +# ---------------- +m4_defun([_LT_CMD_STRIPLIB], +[m4_require([_LT_DECL_EGREP]) +striplib= +old_striplib= +AC_MSG_CHECKING([whether stripping libraries is possible]) +if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT([yes]) +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + old_striplib="$STRIP -S" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi + ;; + *) + AC_MSG_RESULT([no]) + ;; + esac +fi +_LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) +_LT_DECL([], [striplib], [1]) +])# _LT_CMD_STRIPLIB + + +# _LT_SYS_DYNAMIC_LINKER([TAG]) +# ----------------------------- +# PORTME Fill in your ld.so characteristics +m4_defun([_LT_SYS_DYNAMIC_LINKER], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_OBJDUMP])dnl +m4_require([_LT_DECL_SED])dnl +AC_MSG_CHECKING([dynamic linker characteristics]) +m4_if([$1], + [], [ +if test "$GCC" = yes; then + case $host_os in + darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; + *) lt_awk_arg="/^libraries:/" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'` + else + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary. + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path/$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" + else + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk ' +BEGIN {RS=" "; FS="/|\n";} { + lt_foo=""; + lt_count=0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo="/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[[lt_foo]]++; } + if (lt_freq[[lt_foo]] == 1) { print lt_foo; } +}'` + sys_lib_search_path_spec=`$ECHO $lt_search_path_spec` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi]) +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix[[4-9]]*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[[01]] | aix4.[[01]].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + esac + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[[45]]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' +m4_if([$1], [],[ + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[[123]]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[[01]]* | freebsdelf3.[[01]]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ + freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +interix[[3-9]]*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux* | k*bsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # Some binutils ld are patched to set DT_RUNPATH + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ + LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], + [shlibpath_overrides_runpath=yes])]) + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Add ABI-specific directories to the system library path. + sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[[89]] | openbsd2.[[89]].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +AC_MSG_RESULT([$dynamic_linker]) +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then + sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +fi +if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then + sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" +fi + +_LT_DECL([], [variables_saved_for_relink], [1], + [Variables whose values should be saved in libtool wrapper scripts and + restored at link time]) +_LT_DECL([], [need_lib_prefix], [0], + [Do we need the "lib" prefix for modules?]) +_LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) +_LT_DECL([], [version_type], [0], [Library versioning type]) +_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) +_LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) +_LT_DECL([], [shlibpath_overrides_runpath], [0], + [Is shlibpath searched before the hard-coded library search path?]) +_LT_DECL([], [libname_spec], [1], [Format of library name prefix]) +_LT_DECL([], [library_names_spec], [1], + [[List of archive names. First name is the real one, the rest are links. + The last name is the one that the linker finds with -lNAME]]) +_LT_DECL([], [soname_spec], [1], + [[The coded name of the library, if different from the real name]]) +_LT_DECL([], [postinstall_cmds], [2], + [Command to use after installation of a shared archive]) +_LT_DECL([], [postuninstall_cmds], [2], + [Command to use after uninstallation of a shared archive]) +_LT_DECL([], [finish_cmds], [2], + [Commands used to finish a libtool library installation in a directory]) +_LT_DECL([], [finish_eval], [1], + [[As "finish_cmds", except a single script fragment to be evaled but + not shown]]) +_LT_DECL([], [hardcode_into_libs], [0], + [Whether we should hardcode library paths into libraries]) +_LT_DECL([], [sys_lib_search_path_spec], [2], + [Compile-time system search path for libraries]) +_LT_DECL([], [sys_lib_dlsearch_path_spec], [2], + [Run-time system search path for libraries]) +])# _LT_SYS_DYNAMIC_LINKER + + +# _LT_PATH_TOOL_PREFIX(TOOL) +# -------------------------- +# find a file program which can recognize shared library +AC_DEFUN([_LT_PATH_TOOL_PREFIX], +[m4_require([_LT_DECL_EGREP])dnl +AC_MSG_CHECKING([for $1]) +AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, +[case $MAGIC_CMD in +[[\\/*] | ?:[\\/]*]) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR +dnl $ac_dummy forces splitting on constant user-supplied paths. +dnl POSIX.2 word splitting is done only on the output of word expansions, +dnl not every word. This closes a longstanding sh security hole. + ac_dummy="m4_if([$2], , $PATH, [$2])" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$1; then + lt_cv_path_MAGIC_CMD="$ac_dir/$1" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac]) +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + AC_MSG_RESULT($MAGIC_CMD) +else + AC_MSG_RESULT(no) +fi +_LT_DECL([], [MAGIC_CMD], [0], + [Used to examine libraries when file_magic_cmd begins with "file"])dnl +])# _LT_PATH_TOOL_PREFIX + +# Old name: +AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) + + +# _LT_PATH_MAGIC +# -------------- +# find a file program which can recognize a shared library +m4_defun([_LT_PATH_MAGIC], +[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) + else + MAGIC_CMD=: + fi +fi +])# _LT_PATH_MAGIC + + +# LT_PATH_LD +# ---------- +# find the pathname to the GNU or non-GNU linker +AC_DEFUN([LT_PATH_LD], +[AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_DECL_EGREP])dnl + +AC_ARG_WITH([gnu-ld], + [AS_HELP_STRING([--with-gnu-ld], + [assume the C compiler uses GNU ld @<:@default=no@:>@])], + [test "$withval" = no || with_gnu_ld=yes], + [with_gnu_ld=no])dnl + +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + AC_MSG_CHECKING([for ld used by $CC]) + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [[\\/]]* | ?:[[\\/]]*) + re_direlt='/[[^/]][[^/]]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + AC_MSG_CHECKING([for GNU ld]) +else + AC_MSG_CHECKING([for non-GNU ld]) +fi +AC_CACHE_VAL(lt_cv_path_LD, +[if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +cegcc) + # use the weaker test based on 'objdump'. See mingw*. + lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | dragonfly*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix[[3-9]]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be Linux ELF. +linux* | k*bsd*-gnu) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +*nto* | *qnx*) + lt_cv_deplibs_check_method=pass_all + ;; + +openbsd*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; +esac +]) +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown + +_LT_DECL([], [deplibs_check_method], [1], + [Method to check whether dependent libraries are shared objects]) +_LT_DECL([], [file_magic_cmd], [1], + [Command to use when deplibs_check_method == "file_magic"]) +])# _LT_CHECK_MAGIC_METHOD + + +# LT_PATH_NM +# ---------- +# find the pathname to a BSD- or MS-compatible name lister +AC_DEFUN([LT_PATH_NM], +[AC_REQUIRE([AC_PROG_CC])dnl +AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, +[if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS="$lt_save_ifs" + done + : ${lt_cv_path_NM=no} +fi]) +if test "$lt_cv_path_NM" != "no"; then + NM="$lt_cv_path_NM" +else + # Didn't find any BSD compatible name lister, look for dumpbin. + AC_CHECK_TOOLS(DUMPBIN, ["dumpbin -symbols" "link -dump -symbols"], :) + AC_SUBST([DUMPBIN]) + if test "$DUMPBIN" != ":"; then + NM="$DUMPBIN" + fi +fi +test -z "$NM" && NM=nm +AC_SUBST([NM]) +_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl + +AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], + [lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:__oline__: $ac_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&AS_MESSAGE_LOG_FD + (eval echo "\"\$as_me:__oline__: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&AS_MESSAGE_LOG_FD + (eval echo "\"\$as_me:__oline__: output\"" >&AS_MESSAGE_LOG_FD) + cat conftest.out >&AS_MESSAGE_LOG_FD + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest*]) +])# LT_PATH_NM + +# Old names: +AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) +AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_PROG_NM], []) +dnl AC_DEFUN([AC_PROG_NM], []) + + +# LT_LIB_M +# -------- +# check for math library +AC_DEFUN([LT_LIB_M], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +LIBM= +case $host in +*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) + # These system don't have libm, or don't need it + ;; +*-ncr-sysv4.3*) + AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") + AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") + ;; +*) + AC_CHECK_LIB(m, cos, LIBM="-lm") + ;; +esac +AC_SUBST([LIBM]) +])# LT_LIB_M + +# Old name: +AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_CHECK_LIBM], []) + + +# _LT_COMPILER_NO_RTTI([TAGNAME]) +# ------------------------------- +m4_defun([_LT_COMPILER_NO_RTTI], +[m4_require([_LT_TAG_COMPILER])dnl + +_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + +if test "$GCC" = yes; then + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + + _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], + lt_cv_prog_compiler_rtti_exceptions, + [-fno-rtti -fno-exceptions], [], + [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) +fi +_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], + [Compiler flag to turn off builtin functions]) +])# _LT_COMPILER_NO_RTTI + + +# _LT_CMD_GLOBAL_SYMBOLS +# ---------------------- +m4_defun([_LT_CMD_GLOBAL_SYMBOLS], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([LT_PATH_NM])dnl +AC_REQUIRE([LT_PATH_LD])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_TAG_COMPILER])dnl + +# Check for command to grab the raw symbol name followed by C symbol from nm. +AC_MSG_CHECKING([command to parse $NM output from $compiler object]) +AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], +[ +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[[BCDEGRST]]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[[BCDT]]' + ;; +cygwin* | mingw* | pw32* | cegcc*) + symcode='[[ABCDGISTW]]' + ;; +hpux*) + if test "$host_cpu" = ia64; then + symcode='[[ABCDEGRST]]' + fi + ;; +irix* | nonstopux*) + symcode='[[BCDEGRST]]' + ;; +osf*) + symcode='[[BCDEGQRST]]' + ;; +solaris*) + symcode='[[BDRT]]' + ;; +sco3.2v5*) + symcode='[[DT]]' + ;; +sysv4.2uw2*) + symcode='[[DT]]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[[ABDT]]' + ;; +sysv4) + symcode='[[DFNSTU]]' + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[[ABCDGIRSTW]]' ;; +esac + +# Transform an extracted symbol line into a proper C declaration. +# Some systems (esp. on ia64) link data and code symbols differently, +# so use this general approach. +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# Try without a prefix underscore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Fake it for dumpbin and say T for any non-static function + # and D for any global variable. + # Also find C++ and __fastcall symbols from MSVC++, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK ['"\ +" {last_section=section; section=\$ 3};"\ +" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" \$ 0!~/External *\|/{next};"\ +" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ +" {if(hide[section]) next};"\ +" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ +" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ +" s[1]~/^[@?]/{print s[1], s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ +" ' prfx=^$ac_symprfx]" + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <<_LT_EOF +#ifdef __cplusplus +extern "C" { +#endif +char nm_test_var; +void nm_test_func(void); +void nm_test_func(void){} +#ifdef __cplusplus +} +#endif +int main(){nm_test_var='a';nm_test_func();return(0);} +_LT_EOF + + if AC_TRY_EVAL(ac_compile); then + # Now try to grab the symbols. + nlist=conftest.nm + if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if $GREP ' nm_test_var$' "$nlist" >/dev/null; then + if $GREP ' nm_test_func$' "$nlist" >/dev/null; then + cat <<_LT_EOF > conftest.$ac_ext +#ifdef __cplusplus +extern "C" { +#endif + +_LT_EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' + + cat <<_LT_EOF >> conftest.$ac_ext + +/* The mapping between symbol names and symbols. */ +const struct { + const char *name; + void *address; +} +lt__PROGRAM__LTX_preloaded_symbols[[]] = +{ + { "@PROGRAM@", (void *) 0 }, +_LT_EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + cat <<\_LT_EOF >> conftest.$ac_ext + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt__PROGRAM__LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif +_LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_save_LIBS="$LIBS" + lt_save_CFLAGS="$CFLAGS" + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS="$lt_save_LIBS" + CFLAGS="$lt_save_CFLAGS" + else + echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD + fi + else + echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD + cat conftest.$ac_ext >&5 + fi + rm -rf conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done +]) +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + AC_MSG_RESULT(failed) +else + AC_MSG_RESULT(ok) +fi + +_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], + [Take the output of nm and produce a listing of raw symbols and C names]) +_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], + [Transform the output of nm in a proper C declaration]) +_LT_DECL([global_symbol_to_c_name_address], + [lt_cv_sys_global_symbol_to_c_name_address], [1], + [Transform the output of nm in a C name address pair]) +_LT_DECL([global_symbol_to_c_name_address_lib_prefix], + [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], + [Transform the output of nm in a C name address pair when lib prefix is needed]) +]) # _LT_CMD_GLOBAL_SYMBOLS + + +# _LT_COMPILER_PIC([TAGNAME]) +# --------------------------- +m4_defun([_LT_COMPILER_PIC], +[m4_require([_LT_TAG_COMPILER])dnl +_LT_TAGVAR(lt_prog_compiler_wl, $1)= +_LT_TAGVAR(lt_prog_compiler_pic, $1)= +_LT_TAGVAR(lt_prog_compiler_static, $1)= + +AC_MSG_CHECKING([for $compiler option to produce PIC]) +m4_if([$1], [CXX], [ + # C++ specific cases for pic, static, wl, etc. + if test "$GXX" = yes; then + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + interix[[3-9]]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + else + case $host_os in + aix[[4-9]]*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68*) + # Green Hills C++ Compiler + # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" + ;; + esac + ;; + dgux*) + case $cc_basename in + ec++*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + ghcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + freebsd* | dragonfly*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + if test "$host_cpu" != ia64; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + fi + ;; + aCC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + interix*) + # This is c89, which is MS Visual C++ (no shared libs) + # Anyone wants to do a port? + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux* | k*bsd*-gnu) + case $cc_basename in + KCC*) + # KAI C++ Compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + ecpc* ) + # old Intel C++ for x86_64 which still supported -KPIC. + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + icpc* ) + # Intel C++, used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + cxx*) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + xlc* | xlC*) + # IBM XL 8.0 on PPC + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + esac + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd*) + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + ;; + RCC*) + # Rational C++ 2.4.1 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + cxx*) + # Digital/Compaq C++ + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + solaris*) + case $cc_basename in + CC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + lcc*) + # Lucid + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + *) + ;; + esac + ;; + vxworks*) + ;; + *) + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +], +[ + if test "$GCC" = yes; then + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + + interix[[3-9]]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + enable_shared=no + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + + hpux9* | hpux10* | hpux11*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC (with -KPIC) is the default. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + linux* | k*bsd*-gnu) + case $cc_basename in + # old Intel for x86_64 which still supported -KPIC. + ecc*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + # Lahey Fortran 8.1. + lf95*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' + _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' + ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + ccc*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All Alpha code is PIC. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + xl*) + # IBM XL C 8.0/Fortran 10.1 on PPC + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C 5.9 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + ;; + *Sun\ F*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='' + ;; + esac + ;; + esac + ;; + + newsos6) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + + osf3* | osf4* | osf5*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All OSF/1 code is PIC. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + rdos*) + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + solaris*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + case $cc_basename in + f77* | f90* | f95*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; + *) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; + esac + ;; + + sunos4*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + unicos*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + + uts4*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *) + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +]) +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" + ;; +esac +AC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) +_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], + [How to pass a linker flag through the compiler]) + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then + _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], + [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], + [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], + [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in + "" | " "*) ;; + *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; + esac], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) +fi +_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], + [Additional compiler flags for building library objects]) + +# +# Check to make sure the static flag actually works. +# +wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" +_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], + _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), + $lt_tmp_static_flag, + [], + [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) +_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], + [Compiler flag to prevent dynamic linking]) +])# _LT_COMPILER_PIC + + +# _LT_LINKER_SHLIBS([TAGNAME]) +# ---------------------------- +# See if the linker supports building shared libraries. +m4_defun([_LT_LINKER_SHLIBS], +[AC_REQUIRE([LT_PATH_LD])dnl +AC_REQUIRE([LT_PATH_NM])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl +m4_require([_LT_TAG_COMPILER])dnl +AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +m4_if([$1], [CXX], [ + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + case $host_os in + aix[[4-9]]*) + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" + ;; + cygwin* | mingw* | cegcc*) + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' + ;; + *) + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac + _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] +], [ + runpath_var= + _LT_TAGVAR(allow_undefined_flag, $1)= + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(archive_cmds, $1)= + _LT_TAGVAR(archive_expsym_cmds, $1)= + _LT_TAGVAR(compiler_needs_object, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + _LT_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(hardcode_automatic, $1)=no + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= + _LT_TAGVAR(hardcode_libdir_separator, $1)= + _LT_TAGVAR(hardcode_minus_L, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_TAGVAR(inherit_rpath, $1)=no + _LT_TAGVAR(link_all_deplibs, $1)=unknown + _LT_TAGVAR(module_cmds, $1)= + _LT_TAGVAR(module_expsym_cmds, $1)= + _LT_TAGVAR(old_archive_from_new_cmds, $1)= + _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= + _LT_TAGVAR(thread_safe_flag_spec, $1)= + _LT_TAGVAR(whole_archive_flag_spec, $1)= + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + _LT_TAGVAR(include_expsyms, $1)= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + # Exclude shared library initialization/finalization symbols. +dnl Note also adjust exclude_expsyms for C++ above. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + _LT_TAGVAR(ld_shlibs, $1)=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then + _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + supports_anon_versioning=no + case `$LD -v 2>&1` in + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix[[3-9]]*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. + +_LT_EOF + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='' + ;; + m68k) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + interix[[3-9]]*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | tpf* | k*bsd*-gnu) + tmp_diet=no + if test "$host_os" = linux-dietlibc; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test "$tmp_diet" = no + then + tmp_addflag= + tmp_sharedflag='-shared' + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + lf95*) # Lahey Fortran 8.1 + _LT_TAGVAR(whole_archive_flag_spec, $1)= + tmp_sharedflag='--shared' ;; + xl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + esac + _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test "x$supports_anon_versioning" = xyes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + + case $cc_basename in + xlf*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' + _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + sunos4*) + _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + + if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then + runpath_var= + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + _LT_TAGVAR(hardcode_direct, $1)=unsupported + fi + ;; + + aix[[4-9]]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_TAGVAR(archive_cmds, $1)='' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' + + if test "$GCC" = yes; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + _LT_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + _LT_TAGVAR(always_export_symbols, $1)=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds its shared libraries. + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='' + ;; + m68k) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + ;; + + bsdi[[45]]*) + _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + # FIXME: Should let the user specify the lib program. + _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' + _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + + darwin* | rhapsody*) + _LT_DARWIN_LINKER_FEATURES($1) + ;; + + dgux*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + freebsd1*) + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + hpux9*) + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_direct, $1)=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + AC_LINK_IFELSE(int foo(void) {}, + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + ) + LDFLAGS="$save_LDFLAGS" + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(inherit_rpath, $1)=yes + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + newsos6) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *nto* | *qnx*) + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + else + case $host_os in + openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + ;; + esac + fi + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + os2*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + else + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + + # Both c and cxx compiler support -rpath directly + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + solaris*) + _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' + if test "$GCC" = yes; then + wlarc='${wl}' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) + wlarc='' + _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' + ;; + *) + wlarc='${wl}' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + ;; + esac + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. GCC discards it without `$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test "$GCC" = yes; then + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' + fi + ;; + esac + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4) + case $host_vendor in + sni) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' + _LT_TAGVAR(hardcode_direct, $1)=no + ;; + motorola) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4.3*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + _LT_TAGVAR(ld_shlibs, $1)=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + + if test x$host_vendor = xsni; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' + ;; + esac + fi + fi +]) +AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) +test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + +_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld + +_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl +_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl +_LT_DECL([], [extract_expsyms_cmds], [2], + [The commands to extract the exported symbol list from a shared archive]) + +# +# Do we need to explicitly link libc? +# +case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in +x|xyes) + # Assume -lc should be added + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $_LT_TAGVAR(archive_cmds, $1) in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + AC_MSG_CHECKING([whether -lc should be explicitly linked in]) + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if AC_TRY_EVAL(ac_compile) 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) + pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) + _LT_TAGVAR(allow_undefined_flag, $1)= + if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) + then + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + else + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + fi + _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + AC_MSG_RESULT([$_LT_TAGVAR(archive_cmds_need_lc, $1)]) + ;; + esac + fi + ;; +esac + +_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], + [Whether or not to add -lc for building shared libraries]) +_LT_TAGDECL([allow_libtool_libs_with_static_runtimes], + [enable_shared_with_static_runtimes], [0], + [Whether or not to disallow shared libs when runtime libs are static]) +_LT_TAGDECL([], [export_dynamic_flag_spec], [1], + [Compiler flag to allow reflexive dlopens]) +_LT_TAGDECL([], [whole_archive_flag_spec], [1], + [Compiler flag to generate shared objects directly from archives]) +_LT_TAGDECL([], [compiler_needs_object], [1], + [Whether the compiler copes with passing no objects directly]) +_LT_TAGDECL([], [old_archive_from_new_cmds], [2], + [Create an old-style archive from a shared archive]) +_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], + [Create a temporary old-style archive to link instead of a shared archive]) +_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) +_LT_TAGDECL([], [archive_expsym_cmds], [2]) +_LT_TAGDECL([], [module_cmds], [2], + [Commands used to build a loadable module if different from building + a shared archive.]) +_LT_TAGDECL([], [module_expsym_cmds], [2]) +_LT_TAGDECL([], [with_gnu_ld], [1], + [Whether we are building with GNU ld or not]) +_LT_TAGDECL([], [allow_undefined_flag], [1], + [Flag that allows shared libraries with undefined symbols to be built]) +_LT_TAGDECL([], [no_undefined_flag], [1], + [Flag that enforces no undefined symbols]) +_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], + [Flag to hardcode $libdir into a binary during linking. + This must work even if $libdir does not exist]) +_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1], + [[If ld is used when linking, flag to hardcode $libdir into a binary + during linking. This must work even if $libdir does not exist]]) +_LT_TAGDECL([], [hardcode_libdir_separator], [1], + [Whether we need a single "-rpath" flag with a separated argument]) +_LT_TAGDECL([], [hardcode_direct], [0], + [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes + DIR into the resulting binary]) +_LT_TAGDECL([], [hardcode_direct_absolute], [0], + [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes + DIR into the resulting binary and the resulting library dependency is + "absolute", i.e impossible to change by setting ${shlibpath_var} if the + library is relocated]) +_LT_TAGDECL([], [hardcode_minus_L], [0], + [Set to "yes" if using the -LDIR flag during linking hardcodes DIR + into the resulting binary]) +_LT_TAGDECL([], [hardcode_shlibpath_var], [0], + [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR + into the resulting binary]) +_LT_TAGDECL([], [hardcode_automatic], [0], + [Set to "yes" if building a shared library automatically hardcodes DIR + into the library and all subsequent libraries and executables linked + against it]) +_LT_TAGDECL([], [inherit_rpath], [0], + [Set to yes if linker adds runtime paths of dependent libraries + to runtime path list]) +_LT_TAGDECL([], [link_all_deplibs], [0], + [Whether libtool must link a program against all its dependency libraries]) +_LT_TAGDECL([], [fix_srcfile_path], [1], + [Fix the shell variable $srcfile for the compiler]) +_LT_TAGDECL([], [always_export_symbols], [0], + [Set to "yes" if exported symbols are required]) +_LT_TAGDECL([], [export_symbols_cmds], [2], + [The commands to list exported symbols]) +_LT_TAGDECL([], [exclude_expsyms], [1], + [Symbols that should not be listed in the preloaded symbols]) +_LT_TAGDECL([], [include_expsyms], [1], + [Symbols that must always be exported]) +_LT_TAGDECL([], [prelink_cmds], [2], + [Commands necessary for linking programs (against libraries) with templates]) +_LT_TAGDECL([], [file_list_spec], [1], + [Specify filename containing input files]) +dnl FIXME: Not yet implemented +dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], +dnl [Compiler flag to generate thread safe objects]) +])# _LT_LINKER_SHLIBS + + +# _LT_LANG_C_CONFIG([TAG]) +# ------------------------ +# Ensure that the configuration variables for a C compiler are suitably +# defined. These variables are subsequently used by _LT_CONFIG to write +# the compiler configuration to `libtool'. +m4_defun([_LT_LANG_C_CONFIG], +[m4_require([_LT_DECL_EGREP])dnl +lt_save_CC="$CC" +AC_LANG_PUSH(C) + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' + +_LT_TAG_COMPILER +# Save the default compiler, since it gets overwritten when the other +# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. +compiler_DEFAULT=$CC + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + LT_SYS_DLOPEN_SELF + _LT_CMD_STRIPLIB + + # Report which library types will actually be built + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + + aix[[4-9]]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_CONFIG($1) +fi +AC_LANG_POP +CC="$lt_save_CC" +])# _LT_LANG_C_CONFIG + + +# _LT_PROG_CXX +# ------------ +# Since AC_PROG_CXX is broken, in that it returns g++ if there is no c++ +# compiler, we have our own version here. +m4_defun([_LT_PROG_CXX], +[ +pushdef([AC_MSG_ERROR], [_lt_caught_CXX_error=yes]) +AC_PROG_CXX +if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + AC_PROG_CXXCPP +else + _lt_caught_CXX_error=yes +fi +popdef([AC_MSG_ERROR]) +])# _LT_PROG_CXX + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([_LT_PROG_CXX], []) + + +# _LT_LANG_CXX_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for a C++ compiler are suitably +# defined. These variables are subsequently used by _LT_CONFIG to write +# the compiler configuration to `libtool'. +m4_defun([_LT_LANG_CXX_CONFIG], +[AC_REQUIRE([_LT_PROG_CXX])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_EGREP])dnl + +AC_LANG_PUSH(C++) +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(compiler_needs_object, $1)=no +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for C++ test sources. +ac_ext=cpp + +# Object file extension for compiled C++ test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the CXX compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_caught_CXX_error" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="int some_variable = 0;" + + # Code to be used in simple link tests + lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC=$CC + lt_save_LD=$LD + lt_save_GCC=$GCC + GCC=$GXX + lt_save_with_gnu_ld=$with_gnu_ld + lt_save_path_LD=$lt_cv_path_LD + if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx + else + $as_unset lt_cv_prog_gnu_ld + fi + if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX + else + $as_unset lt_cv_path_LD + fi + test -z "${LDCXX+set}" || LD=$LDCXX + CC=${CXX-"c++"} + compiler=$CC + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + + if test -n "$compiler"; then + # We don't want -fno-exception when compiling C++ code, so set the + # no_builtin_flag separately + if test "$GXX" = yes; then + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + else + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + fi + + if test "$GXX" = yes; then + # Set up default GNU C++ configuration + + LT_PATH_LD + + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test "$with_gnu_ld" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + + # If archive_cmds runs LD, not CC, wlarc should be empty + # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to + # investigate it a little bit more. (MM) + wlarc='${wl}' + + # ancient GNU ld didn't support --whole-archive et. al. + if eval "`$CC -print-prog-name=ld` --help 2>&1" | + $GREP 'no-whole-archive' > /dev/null; then + _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + with_gnu_ld=no + wlarc= + + # A generic and very simple default shared library creation + # command for GNU C++ for the case where it uses the native + # linker, instead of GNU ld. If possible, this setting should + # overridden to take advantage of the native linker features on + # the platform it is being used on. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + + else + GXX=no + with_gnu_ld=no + wlarc= + fi + + # PORTME: fill in a description of your system's C++ link characteristics + AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) + _LT_TAGVAR(ld_shlibs, $1)=yes + case $host_os in + aix3*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aix[[4-9]]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) + for ld_flag in $LDFLAGS; do + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_TAGVAR(archive_cmds, $1)='' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' + + if test "$GXX" = yes; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + _LT_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)= + fi + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to + # export. + _LT_TAGVAR(always_export_symbols, $1)=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an empty + # executable. + _LT_SYS_MODULE_PATH_AIX + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds its shared + # libraries. + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + darwin* | rhapsody*) + _LT_DARWIN_LINKER_FEATURES($1) + ;; + + dgux*) + case $cc_basename in + ec++*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + ghcx*) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + freebsd[[12]]*) + # C++ shared libraries reported to be fairly broken before + # switch to ELF + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + freebsd-elf*) + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + ;; + + freebsd* | dragonfly*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + _LT_TAGVAR(ld_shlibs, $1)=yes + ;; + + gnu*) + ;; + + hpux9*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + ;; + *) + if test "$GXX" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + hpux10*|hpux11*) + if test $with_gnu_ld = no; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + ;; + *) + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + esac + fi + case $host_cpu in + hppa*64*|ia64*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + esac + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + ;; + *) + if test "$GXX" = yes; then + if test $with_gnu_ld = no; then + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + interix[[3-9]]*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + irix5* | irix6*) + case $cc_basename in + CC*) + # SGI C++ + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test "$GXX" = yes; then + if test "$with_gnu_ld" = no; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib' + fi + fi + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + esac + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(inherit_rpath, $1)=yes + ;; + + linux* | k*bsd*-gnu) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc* | ecpc* ) + # Intel C++ + with_gnu_ld=yes + # version 8.0 and above of icpc choke on multiply defined symbols + # if we add $predep_objects and $postdep_objects, however 7.1 and + # earlier do not add the objects themselves. + case `$CC -V 2>&1` in + *"Version 7."*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 8.0 or newer + tmp_idyn= + case $host_cpu in + ia64*) tmp_idyn=' -i_dynamic';; + esac + _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + case `$CC -V` in + *pgCC\ [[1-5]]* | *pgcpp\ [[1-5]]*) + _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ + compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"' + _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ + $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~ + $RANLIB $oldlib' + _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + ;; + *) # Version 6 will use weak symbols + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + ;; + cxx*) + # Compaq C++ + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + ;; + xl*) + # IBM XL 8.0 on PPC, with GNU ld + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + + # Not sure whether something based on + # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 + # would be better. + output_verbose_link_cmd='echo' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + esac + ;; + esac + ;; + + lynxos*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + m88k*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + mvs*) + case $cc_basename in + cxx*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + fi + # Workaround some broken pre-1.5 toolchains + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' + ;; + + *nto* | *qnx*) + _LT_TAGVAR(ld_shlibs, $1)=yes + ;; + + openbsd2*) + # C++ shared libraries are fairly broken + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + fi + output_verbose_link_cmd=echo + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + case $host in + osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; + *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; + esac + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + cxx*) + case $host in + osf3*) + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + ;; + *) + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~ + $RM $lib.exp' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + case $host in + osf3*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + psos*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + lcc*) + # Lucid + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + solaris*) + case $cc_basename in + CC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_TAGVAR(archive_cmds_need_lc,$1)=yes + _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. + # Supported since Solaris 2.6 (maybe 2.5.1?) + _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' + ;; + esac + _LT_TAGVAR(link_all_deplibs, $1)=yes + + output_verbose_link_cmd='echo' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + + # The C++ compiler must be used to create the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' + if $CC --version | $GREP -v '^2\.7' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + else + # g++ 2.7 appears to require `-G' NOT `-shared' on this + # platform. + _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + fi + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + ;; + esac + fi + ;; + esac + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + vxworks*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + + AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) + test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + + _LT_TAGVAR(GCC, $1)="$GXX" + _LT_TAGVAR(LD, $1)="$LD" + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_SYS_HIDDEN_LIBDEPS($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + CC=$lt_save_CC + LDCXX=$LD + LD=$lt_save_LD + GCC=$lt_save_GCC + with_gnu_ld=$lt_save_with_gnu_ld + lt_cv_path_LDCXX=$lt_cv_path_LD + lt_cv_path_LD=$lt_save_path_LD + lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld + lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld +fi # test "$_lt_caught_CXX_error" != yes + +AC_LANG_POP +])# _LT_LANG_CXX_CONFIG + + +# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) +# --------------------------------- +# Figure out "hidden" library dependencies from verbose +# compiler output when linking a shared library. +# Parse the compiler output and extract the necessary +# objects, libraries and library flags. +m4_defun([_LT_SYS_HIDDEN_LIBDEPS], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +# Dependencies to place before and after the object being linked: +_LT_TAGVAR(predep_objects, $1)= +_LT_TAGVAR(postdep_objects, $1)= +_LT_TAGVAR(predeps, $1)= +_LT_TAGVAR(postdeps, $1)= +_LT_TAGVAR(compiler_lib_search_path, $1)= + +dnl we can't use the lt_simple_compile_test_code here, +dnl because it contains code intended for an executable, +dnl not a library. It's possible we should let each +dnl tag define a new lt_????_link_test_code variable, +dnl but it's only used here... +m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF +int a; +void foo (void) { a = 0; } +_LT_EOF +], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF +class Foo +{ +public: + Foo (void) { a = 0; } +private: + int a; +}; +_LT_EOF +], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF + subroutine foo + implicit none + integer*4 a + a=0 + return + end +_LT_EOF +], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF + subroutine foo + implicit none + integer a + a=0 + return + end +_LT_EOF +], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF +public class foo { + private int a; + public void bar (void) { + a = 0; + } +}; +_LT_EOF +]) +dnl Parse the compiler output and extract the necessary +dnl objects, libraries and library flags. +if AC_TRY_EVAL(ac_compile); then + # Parse the compiler output and extract the necessary + # objects, libraries and library flags. + + # Sentinel used to keep track of whether or not we are before + # the conftest object file. + pre_test_object_deps_done=no + + for p in `eval "$output_verbose_link_cmd"`; do + case $p in + + -L* | -R* | -l*) + # Some compilers place space between "-{L,R}" and the path. + # Remove the space. + if test $p = "-L" || + test $p = "-R"; then + prev=$p + continue + else + prev= + fi + + if test "$pre_test_object_deps_done" = no; then + case $p in + -L* | -R*) + # Internal compiler library paths should come after those + # provided the user. The postdeps already come after the + # user supplied libs so there is no need to process them. + if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then + _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" + else + _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" + fi + ;; + # The "-l" case would never come before the object being + # linked, so don't bother handling this case. + esac + else + if test -z "$_LT_TAGVAR(postdeps, $1)"; then + _LT_TAGVAR(postdeps, $1)="${prev}${p}" + else + _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" + fi + fi + ;; + + *.$objext) + # This assumes that the test object file only shows up + # once in the compiler output. + if test "$p" = "conftest.$objext"; then + pre_test_object_deps_done=yes + continue + fi + + if test "$pre_test_object_deps_done" = no; then + if test -z "$_LT_TAGVAR(predep_objects, $1)"; then + _LT_TAGVAR(predep_objects, $1)="$p" + else + _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" + fi + else + if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then + _LT_TAGVAR(postdep_objects, $1)="$p" + else + _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" + fi + fi + ;; + + *) ;; # Ignore the rest. + + esac + done + + # Clean up. + rm -f a.out a.exe +else + echo "libtool.m4: error: problem compiling $1 test program" +fi + +$RM -f confest.$objext + +# PORTME: override above test on systems where it is broken +m4_if([$1], [CXX], +[case $host_os in +interix[[3-9]]*) + # Interix 3.5 installs completely hosed .la files for C++, so rather than + # hack all around it, let's just trust "g++" to DTRT. + _LT_TAGVAR(predep_objects,$1)= + _LT_TAGVAR(postdep_objects,$1)= + _LT_TAGVAR(postdeps,$1)= + ;; + +linux*) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + + # The more standards-conforming stlport4 library is + # incompatible with the Cstd library. Avoid specifying + # it if it's in CXXFLAGS. Ignore libCrun as + # -library=stlport4 depends on it. + case " $CXX $CXXFLAGS " in + *" -library=stlport4 "*) + solaris_use_stlport4=yes + ;; + esac + + if test "$solaris_use_stlport4" != yes; then + _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' + fi + ;; + esac + ;; + +solaris*) + case $cc_basename in + CC*) + # The more standards-conforming stlport4 library is + # incompatible with the Cstd library. Avoid specifying + # it if it's in CXXFLAGS. Ignore libCrun as + # -library=stlport4 depends on it. + case " $CXX $CXXFLAGS " in + *" -library=stlport4 "*) + solaris_use_stlport4=yes + ;; + esac + + # Adding this requires a known-good setup of shared libraries for + # Sun compiler versions before 5.6, else PIC objects from an old + # archive will be linked into the output, leading to subtle bugs. + if test "$solaris_use_stlport4" != yes; then + _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' + fi + ;; + esac + ;; +esac +]) + +case " $_LT_TAGVAR(postdeps, $1) " in +*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; +esac + _LT_TAGVAR(compiler_lib_search_dirs, $1)= +if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then + _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` +fi +_LT_TAGDECL([], [compiler_lib_search_dirs], [1], + [The directories searched by this compiler when creating a shared library]) +_LT_TAGDECL([], [predep_objects], [1], + [Dependencies to place before and after the objects being linked to + create a shared library]) +_LT_TAGDECL([], [postdep_objects], [1]) +_LT_TAGDECL([], [predeps], [1]) +_LT_TAGDECL([], [postdeps], [1]) +_LT_TAGDECL([], [compiler_lib_search_path], [1], + [The library search path used internally by the compiler when linking + a shared library]) +])# _LT_SYS_HIDDEN_LIBDEPS + + +# _LT_PROG_F77 +# ------------ +# Since AC_PROG_F77 is broken, in that it returns the empty string +# if there is no fortran compiler, we have our own version here. +m4_defun([_LT_PROG_F77], +[ +pushdef([AC_MSG_ERROR], [_lt_disable_F77=yes]) +AC_PROG_F77 +if test -z "$F77" || test "X$F77" = "Xno"; then + _lt_disable_F77=yes +fi +popdef([AC_MSG_ERROR]) +])# _LT_PROG_F77 + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([_LT_PROG_F77], []) + + +# _LT_LANG_F77_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for a Fortran 77 compiler are +# suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_F77_CONFIG], +[AC_REQUIRE([_LT_PROG_F77])dnl +AC_LANG_PUSH(Fortran 77) + +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for f77 test sources. +ac_ext=f + +# Object file extension for compiled f77 test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the F77 compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_disable_F77" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="\ + subroutine t + return + end +" + + # Code to be used in simple link tests + lt_simple_link_test_code="\ + program t + end +" + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC="$CC" + lt_save_GCC=$GCC + CC=${F77-"f77"} + compiler=$CC + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + GCC=$G77 + if test -n "$compiler"; then + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + aix[[4-9]]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_TAGVAR(GCC, $1)="$G77" + _LT_TAGVAR(LD, $1)="$LD" + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + GCC=$lt_save_GCC + CC="$lt_save_CC" +fi # test "$_lt_disable_F77" != yes + +AC_LANG_POP +])# _LT_LANG_F77_CONFIG + + +# _LT_PROG_FC +# ----------- +# Since AC_PROG_FC is broken, in that it returns the empty string +# if there is no fortran compiler, we have our own version here. +m4_defun([_LT_PROG_FC], +[ +pushdef([AC_MSG_ERROR], [_lt_disable_FC=yes]) +AC_PROG_FC +if test -z "$FC" || test "X$FC" = "Xno"; then + _lt_disable_FC=yes +fi +popdef([AC_MSG_ERROR]) +])# _LT_PROG_FC + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([_LT_PROG_FC], []) + + +# _LT_LANG_FC_CONFIG([TAG]) +# ------------------------- +# Ensure that the configuration variables for a Fortran compiler are +# suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_FC_CONFIG], +[AC_REQUIRE([_LT_PROG_FC])dnl +AC_LANG_PUSH(Fortran) + +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for fc test sources. +ac_ext=${ac_fc_srcext-f} + +# Object file extension for compiled fc test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the FC compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_disable_FC" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="\ + subroutine t + return + end +" + + # Code to be used in simple link tests + lt_simple_link_test_code="\ + program t + end +" + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC="$CC" + lt_save_GCC=$GCC + CC=${FC-"f95"} + compiler=$CC + GCC=$ac_cv_fc_compiler_gnu + + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + + if test -n "$compiler"; then + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + aix[[4-9]]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" + _LT_TAGVAR(LD, $1)="$LD" + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_SYS_HIDDEN_LIBDEPS($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + GCC=$lt_save_GCC + CC="$lt_save_CC" +fi # test "$_lt_disable_FC" != yes + +AC_LANG_POP +])# _LT_LANG_FC_CONFIG + + +# _LT_LANG_GCJ_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for the GNU Java Compiler compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_GCJ_CONFIG], +[AC_REQUIRE([LT_PROG_GCJ])dnl +AC_LANG_SAVE + +# Source file extension for Java test sources. +ac_ext=java + +# Object file extension for compiled Java test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="class foo {}" + +# Code to be used in simple link tests +lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +lt_save_GCC=$GCC +GCC=yes +CC=${GCJ-"gcj"} +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_TAGVAR(LD, $1)="$LD" +_LT_CC_BASENAME([$compiler]) + +# GCJ did not exist at the time GCC didn't implicitly link libc in. +_LT_TAGVAR(archive_cmds_need_lc, $1)=no + +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) +fi + +AC_LANG_RESTORE + +GCC=$lt_save_GCC +CC="$lt_save_CC" +])# _LT_LANG_GCJ_CONFIG + + +# _LT_LANG_RC_CONFIG([TAG]) +# ------------------------- +# Ensure that the configuration variables for the Windows resource compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_RC_CONFIG], +[AC_REQUIRE([LT_PROG_RC])dnl +AC_LANG_SAVE + +# Source file extension for RC test sources. +ac_ext=rc + +# Object file extension for compiled RC test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' + +# Code to be used in simple link tests +lt_simple_link_test_code="$lt_simple_compile_test_code" + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +lt_save_GCC=$GCC +GCC= +CC=${RC-"windres"} +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_CC_BASENAME([$compiler]) +_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + +if test -n "$compiler"; then + : + _LT_CONFIG($1) +fi + +GCC=$lt_save_GCC +AC_LANG_RESTORE +CC="$lt_save_CC" +])# _LT_LANG_RC_CONFIG + + +# LT_PROG_GCJ +# ----------- +AC_DEFUN([LT_PROG_GCJ], +[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], + [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], + [AC_CHECK_TOOL(GCJ, gcj,) + test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" + AC_SUBST(GCJFLAGS)])])[]dnl +]) + +# Old name: +AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_GCJ], []) + + +# LT_PROG_RC +# ---------- +AC_DEFUN([LT_PROG_RC], +[AC_CHECK_TOOL(RC, windres,) +]) + +# Old name: +AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_RC], []) + + +# _LT_DECL_EGREP +# -------------- +# If we don't have a new enough Autoconf to choose the best grep +# available, choose the one first in the user's PATH. +m4_defun([_LT_DECL_EGREP], +[AC_REQUIRE([AC_PROG_EGREP])dnl +AC_REQUIRE([AC_PROG_FGREP])dnl +test -z "$GREP" && GREP=grep +_LT_DECL([], [GREP], [1], [A grep program that handles long lines]) +_LT_DECL([], [EGREP], [1], [An ERE matcher]) +_LT_DECL([], [FGREP], [1], [A literal string matcher]) +dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too +AC_SUBST([GREP]) +]) + + +# _LT_DECL_OBJDUMP +# -------------- +# If we don't have a new enough Autoconf to choose the best objdump +# available, choose the one first in the user's PATH. +m4_defun([_LT_DECL_OBJDUMP], +[AC_CHECK_TOOL(OBJDUMP, objdump, false) +test -z "$OBJDUMP" && OBJDUMP=objdump +_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) +AC_SUBST([OBJDUMP]) +]) + + +# _LT_DECL_SED +# ------------ +# Check for a fully-functional sed program, that truncates +# as few characters as possible. Prefer GNU sed if found. +m4_defun([_LT_DECL_SED], +[AC_PROG_SED +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" +_LT_DECL([], [SED], [1], [A sed program that does not truncate output]) +_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], + [Sed that helps us avoid accidentally triggering echo(1) options like -n]) +])# _LT_DECL_SED + +m4_ifndef([AC_PROG_SED], [ +############################################################ +# NOTE: This macro has been submitted for inclusion into # +# GNU Autoconf as AC_PROG_SED. When it is available in # +# a released version of Autoconf we should remove this # +# macro and use it instead. # +############################################################ + +m4_defun([AC_PROG_SED], +[AC_MSG_CHECKING([for a sed that does not truncate output]) +AC_CACHE_VAL(lt_cv_path_SED, +[# Loop through the user's path and test for sed and gsed. +# Then use that list of sed's as ones to test for truncation. +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for lt_ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then + lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" + fi + done + done +done +IFS=$as_save_IFS +lt_ac_max=0 +lt_ac_count=0 +# Add /usr/xpg4/bin/sed as it is typically found on Solaris +# along with /bin/sed that truncates output. +for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do + test ! -f $lt_ac_sed && continue + cat /dev/null > conftest.in + lt_ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >conftest.in + # Check for GNU sed and select it if it is found. + if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then + lt_cv_path_SED=$lt_ac_sed + break + fi + while true; do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo >>conftest.nl + $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break + cmp -s conftest.out conftest.nl || break + # 10000 chars as input seems more than enough + test $lt_ac_count -gt 10 && break + lt_ac_count=`expr $lt_ac_count + 1` + if test $lt_ac_count -gt $lt_ac_max; then + lt_ac_max=$lt_ac_count + lt_cv_path_SED=$lt_ac_sed + fi + done +done +]) +SED=$lt_cv_path_SED +AC_SUBST([SED]) +AC_MSG_RESULT([$SED]) +])#AC_PROG_SED +])#m4_ifndef + +# Old name: +AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_SED], []) + + +# _LT_CHECK_SHELL_FEATURES +# ------------------------ +# Find out whether the shell is Bourne or XSI compatible, +# or has some other useful features. +m4_defun([_LT_CHECK_SHELL_FEATURES], +[AC_MSG_CHECKING([whether the shell understands some XSI constructs]) +# Try some XSI features +xsi_shell=no +( _lt_dummy="a/b/c" + test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,, \ + && eval 'test $(( 1 + 1 )) -eq 2 \ + && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ + && xsi_shell=yes +AC_MSG_RESULT([$xsi_shell]) +_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) + +AC_MSG_CHECKING([whether the shell understands "+="]) +lt_shell_append=no +( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ + >/dev/null 2>&1 \ + && lt_shell_append=yes +AC_MSG_RESULT([$lt_shell_append]) +_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) + +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset +else + lt_unset=false +fi +_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl + +# test EBCDIC or ASCII +case `echo X|tr X '\101'` in + A) # ASCII based system + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr + lt_SP2NL='tr \040 \012' + lt_NL2SP='tr \015\012 \040\040' + ;; + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' + ;; +esac +_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl +_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl +])# _LT_CHECK_SHELL_FEATURES + + +# _LT_PROG_XSI_SHELLFNS +# --------------------- +# Bourne and XSI compatible variants of some useful shell functions. +m4_defun([_LT_PROG_XSI_SHELLFNS], +[case $xsi_shell in + yes) + cat << \_LT_EOF >> "$cfgfile" + +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac +} + +# func_basename file +func_basename () +{ + func_basename_result="${1##*/}" +} + +# func_dirname_and_basename file append nondir_replacement +# perform func_basename and func_dirname in a single function +# call: +# dirname: Compute the dirname of FILE. If nonempty, +# add APPEND to the result, otherwise set result +# to NONDIR_REPLACEMENT. +# value returned in "$func_dirname_result" +# basename: Compute filename of FILE. +# value retuned in "$func_basename_result" +# Implementation must be kept synchronized with func_dirname +# and func_basename. For efficiency, we do not delegate to +# those functions but instead duplicate the functionality here. +func_dirname_and_basename () +{ + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac + func_basename_result="${1##*/}" +} + +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +func_stripname () +{ + # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are + # positional parameters, so assign one to ordinary parameter first. + func_stripname_result=${3} + func_stripname_result=${func_stripname_result#"${1}"} + func_stripname_result=${func_stripname_result%"${2}"} +} + +# func_opt_split +func_opt_split () +{ + func_opt_split_opt=${1%%=*} + func_opt_split_arg=${1#*=} +} + +# func_lo2o object +func_lo2o () +{ + case ${1} in + *.lo) func_lo2o_result=${1%.lo}.${objext} ;; + *) func_lo2o_result=${1} ;; + esac +} + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=${1%.*}.lo +} + +# func_arith arithmetic-term... +func_arith () +{ + func_arith_result=$(( $[*] )) +} + +# func_len string +# STRING may not start with a hyphen. +func_len () +{ + func_len_result=${#1} +} + +_LT_EOF + ;; + *) # Bourne compatible functions. + cat << \_LT_EOF >> "$cfgfile" + +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + # Extract subdirectory from the argument. + func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi +} + +# func_basename file +func_basename () +{ + func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` +} + +dnl func_dirname_and_basename +dnl A portable version of this function is already defined in general.m4sh +dnl so there is no need for it here. + +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +# func_strip_suffix prefix name +func_stripname () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "X${3}" \ + | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "X${3}" \ + | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;; + esac +} + +# sed scripts: +my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q' +my_sed_long_arg='1s/^-[[^=]]*=//' + +# func_opt_split +func_opt_split () +{ + func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"` + func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"` +} + +# func_lo2o object +func_lo2o () +{ + func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"` +} + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[[^.]]*$/.lo/'` +} + +# func_arith arithmetic-term... +func_arith () +{ + func_arith_result=`expr "$[@]"` +} + +# func_len string +# STRING may not start with a hyphen. +func_len () +{ + func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len` +} + +_LT_EOF +esac + +case $lt_shell_append in + yes) + cat << \_LT_EOF >> "$cfgfile" + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "$[1]+=\$[2]" +} +_LT_EOF + ;; + *) + cat << \_LT_EOF >> "$cfgfile" + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "$[1]=\$$[1]\$[2]" +} + +_LT_EOF + ;; + esac +]) diff --git a/tests/libs/adios/config/ltmain.sh b/tests/libs/adios/config/ltmain.sh new file mode 100755 index 0000000000..a72f2fd78b --- /dev/null +++ b/tests/libs/adios/config/ltmain.sh @@ -0,0 +1,8406 @@ +# Generated from ltmain.m4sh. + +# ltmain.sh (GNU libtool) 2.2.6b +# Written by Gordon Matzigkeit , 1996 + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# GNU Libtool is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, +# or obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +# Usage: $progname [OPTION]... [MODE-ARG]... +# +# Provide generalized library-building support services. +# +# --config show all configuration variables +# --debug enable verbose shell tracing +# -n, --dry-run display commands without modifying any files +# --features display basic configuration information and exit +# --mode=MODE use operation mode MODE +# --preserve-dup-deps don't remove duplicate dependency libraries +# --quiet, --silent don't print informational messages +# --tag=TAG use configuration variables from tag TAG +# -v, --verbose print informational messages (default) +# --version print version information +# -h, --help print short or long help message +# +# MODE must be one of the following: +# +# clean remove files from the build directory +# compile compile a source file into a libtool object +# execute automatically set library path, then run a program +# finish complete the installation of libtool libraries +# install install libraries or executables +# link create a library or an executable +# uninstall remove libraries from an installed directory +# +# MODE-ARGS vary depending on the MODE. +# Try `$progname --help --mode=MODE' for a more detailed description of MODE. +# +# When reporting a bug, please describe a test case to reproduce it and +# include the following information: +# +# host-triplet: $host +# shell: $SHELL +# compiler: $LTCC +# compiler flags: $LTCFLAGS +# linker: $LD (gnu? $with_gnu_ld) +# $progname: (GNU libtool) 2.2.6b +# automake: $automake_version +# autoconf: $autoconf_version +# +# Report bugs to . + +PROGRAM=ltmain.sh +PACKAGE=libtool +VERSION=2.2.6b +TIMESTAMP="" +package_revision=1.3017 + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +# NLS nuisances: We save the old values to restore during execute mode. +# Only set LANG and LC_ALL to C if already set. +# These must not be set unconditionally because not all systems understand +# e.g. LANG=C (notably SCO). +lt_user_locale= +lt_safe_locale= +for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES +do + eval "if test \"\${$lt_var+set}\" = set; then + save_$lt_var=\$$lt_var + $lt_var=C + export $lt_var + lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" + lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" + fi" +done + +$lt_unset CDPATH + + + + + +: ${CP="cp -f"} +: ${ECHO="echo"} +: ${EGREP="/bin/grep -E"} +: ${FGREP="/bin/grep -F"} +: ${GREP="/bin/grep"} +: ${LN_S="ln -s"} +: ${MAKE="make"} +: ${MKDIR="mkdir"} +: ${MV="mv -f"} +: ${RM="rm -f"} +: ${SED="/bin/sed"} +: ${SHELL="${CONFIG_SHELL-/bin/sh}"} +: ${Xsed="$SED -e 1s/^X//"} + +# Global variables: +EXIT_SUCCESS=0 +EXIT_FAILURE=1 +EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. +EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. + +exit_status=$EXIT_SUCCESS + +# Make sure IFS has a sensible default +lt_nl=' +' +IFS=" $lt_nl" + +dirname="s,/[^/]*$,," +basename="s,^.*/,," + +# func_dirname_and_basename file append nondir_replacement +# perform func_basename and func_dirname in a single function +# call: +# dirname: Compute the dirname of FILE. If nonempty, +# add APPEND to the result, otherwise set result +# to NONDIR_REPLACEMENT. +# value returned in "$func_dirname_result" +# basename: Compute filename of FILE. +# value retuned in "$func_basename_result" +# Implementation must be kept synchronized with func_dirname +# and func_basename. For efficiency, we do not delegate to +# those functions but instead duplicate the functionality here. +func_dirname_and_basename () +{ + # Extract subdirectory from the argument. + func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi + func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` +} + +# Generated shell functions inserted here. + +# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh +# is ksh but when the shell is invoked as "sh" and the current value of +# the _XPG environment variable is not equal to 1 (one), the special +# positional parameter $0, within a function call, is the name of the +# function. +progpath="$0" + +# The name of this program: +# In the unlikely event $progname began with a '-', it would play havoc with +# func_echo (imagine progname=-n), so we prepend ./ in that case: +func_dirname_and_basename "$progpath" +progname=$func_basename_result +case $progname in + -*) progname=./$progname ;; +esac + +# Make sure we have an absolute path for reexecution: +case $progpath in + [\\/]*|[A-Za-z]:\\*) ;; + *[\\/]*) + progdir=$func_dirname_result + progdir=`cd "$progdir" && pwd` + progpath="$progdir/$progname" + ;; + *) + save_IFS="$IFS" + IFS=: + for progdir in $PATH; do + IFS="$save_IFS" + test -x "$progdir/$progname" && break + done + IFS="$save_IFS" + test -n "$progdir" || progdir=`pwd` + progpath="$progdir/$progname" + ;; +esac + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed="${SED}"' -e 1s/^X//' +sed_quote_subst='s/\([`"$\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\(["`\\]\)/\\\1/g' + +# Re-`\' parameter expansions in output of double_quote_subst that were +# `\'-ed in input to the same. If an odd number of `\' preceded a '$' +# in input to double_quote_subst, that '$' was protected from expansion. +# Since each input `\' is now two `\'s, look for any number of runs of +# four `\'s followed by two `\'s and then a '$'. `\' that '$'. +bs='\\' +bs2='\\\\' +bs4='\\\\\\\\' +dollar='\$' +sed_double_backslash="\ + s/$bs4/&\\ +/g + s/^$bs2$dollar/$bs&/ + s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g + s/\n//g" + +# Standard options: +opt_dry_run=false +opt_help=false +opt_quiet=false +opt_verbose=false +opt_warning=: + +# func_echo arg... +# Echo program name prefixed message, along with the current mode +# name if it has been set yet. +func_echo () +{ + $ECHO "$progname${mode+: }$mode: $*" +} + +# func_verbose arg... +# Echo program name prefixed message in verbose mode only. +func_verbose () +{ + $opt_verbose && func_echo ${1+"$@"} + + # A bug in bash halts the script if the last line of a function + # fails when set -e is in force, so we need another command to + # work around that: + : +} + +# func_error arg... +# Echo program name prefixed message to standard error. +func_error () +{ + $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2 +} + +# func_warning arg... +# Echo program name prefixed warning message to standard error. +func_warning () +{ + $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2 + + # bash bug again: + : +} + +# func_fatal_error arg... +# Echo program name prefixed message to standard error, and exit. +func_fatal_error () +{ + func_error ${1+"$@"} + exit $EXIT_FAILURE +} + +# func_fatal_help arg... +# Echo program name prefixed message to standard error, followed by +# a help hint, and exit. +func_fatal_help () +{ + func_error ${1+"$@"} + func_fatal_error "$help" +} +help="Try \`$progname --help' for more information." ## default + + +# func_grep expression filename +# Check whether EXPRESSION matches any line of FILENAME, without output. +func_grep () +{ + $GREP "$1" "$2" >/dev/null 2>&1 +} + + +# func_mkdir_p directory-path +# Make sure the entire path to DIRECTORY-PATH is available. +func_mkdir_p () +{ + my_directory_path="$1" + my_dir_list= + + if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then + + # Protect directory names starting with `-' + case $my_directory_path in + -*) my_directory_path="./$my_directory_path" ;; + esac + + # While some portion of DIR does not yet exist... + while test ! -d "$my_directory_path"; do + # ...make a list in topmost first order. Use a colon delimited + # list incase some portion of path contains whitespace. + my_dir_list="$my_directory_path:$my_dir_list" + + # If the last portion added has no slash in it, the list is done + case $my_directory_path in */*) ;; *) break ;; esac + + # ...otherwise throw away the child directory and loop + my_directory_path=`$ECHO "X$my_directory_path" | $Xsed -e "$dirname"` + done + my_dir_list=`$ECHO "X$my_dir_list" | $Xsed -e 's,:*$,,'` + + save_mkdir_p_IFS="$IFS"; IFS=':' + for my_dir in $my_dir_list; do + IFS="$save_mkdir_p_IFS" + # mkdir can fail with a `File exist' error if two processes + # try to create one of the directories concurrently. Don't + # stop in that case! + $MKDIR "$my_dir" 2>/dev/null || : + done + IFS="$save_mkdir_p_IFS" + + # Bail out if we (or some other process) failed to create a directory. + test -d "$my_directory_path" || \ + func_fatal_error "Failed to create \`$1'" + fi +} + + +# func_mktempdir [string] +# Make a temporary directory that won't clash with other running +# libtool processes, and avoids race conditions if possible. If +# given, STRING is the basename for that directory. +func_mktempdir () +{ + my_template="${TMPDIR-/tmp}/${1-$progname}" + + if test "$opt_dry_run" = ":"; then + # Return a directory name, but don't create it in dry-run mode + my_tmpdir="${my_template}-$$" + else + + # If mktemp works, use that first and foremost + my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` + + if test ! -d "$my_tmpdir"; then + # Failing that, at least try and use $RANDOM to avoid a race + my_tmpdir="${my_template}-${RANDOM-0}$$" + + save_mktempdir_umask=`umask` + umask 0077 + $MKDIR "$my_tmpdir" + umask $save_mktempdir_umask + fi + + # If we're not in dry-run mode, bomb out on failure + test -d "$my_tmpdir" || \ + func_fatal_error "cannot create temporary directory \`$my_tmpdir'" + fi + + $ECHO "X$my_tmpdir" | $Xsed +} + + +# func_quote_for_eval arg +# Aesthetically quote ARG to be evaled later. +# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT +# is double-quoted, suitable for a subsequent eval, whereas +# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters +# which are still active within double quotes backslashified. +func_quote_for_eval () +{ + case $1 in + *[\\\`\"\$]*) + func_quote_for_eval_unquoted_result=`$ECHO "X$1" | $Xsed -e "$sed_quote_subst"` ;; + *) + func_quote_for_eval_unquoted_result="$1" ;; + esac + + case $func_quote_for_eval_unquoted_result in + # Double-quote args containing shell metacharacters to delay + # word splitting, command substitution and and variable + # expansion for a subsequent eval. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" + ;; + *) + func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" + esac +} + + +# func_quote_for_expand arg +# Aesthetically quote ARG to be evaled later; same as above, +# but do not quote variable references. +func_quote_for_expand () +{ + case $1 in + *[\\\`\"]*) + my_arg=`$ECHO "X$1" | $Xsed \ + -e "$double_quote_subst" -e "$sed_double_backslash"` ;; + *) + my_arg="$1" ;; + esac + + case $my_arg in + # Double-quote args containing shell metacharacters to delay + # word splitting and command substitution for a subsequent eval. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + my_arg="\"$my_arg\"" + ;; + esac + + func_quote_for_expand_result="$my_arg" +} + + +# func_show_eval cmd [fail_exp] +# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP +# is given, then evaluate it. +func_show_eval () +{ + my_cmd="$1" + my_fail_exp="${2-:}" + + ${opt_silent-false} || { + func_quote_for_expand "$my_cmd" + eval "func_echo $func_quote_for_expand_result" + } + + if ${opt_dry_run-false}; then :; else + eval "$my_cmd" + my_status=$? + if test "$my_status" -eq 0; then :; else + eval "(exit $my_status); $my_fail_exp" + fi + fi +} + + +# func_show_eval_locale cmd [fail_exp] +# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP +# is given, then evaluate it. Use the saved locale for evaluation. +func_show_eval_locale () +{ + my_cmd="$1" + my_fail_exp="${2-:}" + + ${opt_silent-false} || { + func_quote_for_expand "$my_cmd" + eval "func_echo $func_quote_for_expand_result" + } + + if ${opt_dry_run-false}; then :; else + eval "$lt_user_locale + $my_cmd" + my_status=$? + eval "$lt_safe_locale" + if test "$my_status" -eq 0; then :; else + eval "(exit $my_status); $my_fail_exp" + fi + fi +} + + + + + +# func_version +# Echo version message to standard output and exit. +func_version () +{ + $SED -n '/^# '$PROGRAM' (GNU /,/# warranty; / { + s/^# // + s/^# *$// + s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ + p + }' < "$progpath" + exit $? +} + +# func_usage +# Echo short help message to standard output and exit. +func_usage () +{ + $SED -n '/^# Usage:/,/# -h/ { + s/^# // + s/^# *$// + s/\$progname/'$progname'/ + p + }' < "$progpath" + $ECHO + $ECHO "run \`$progname --help | more' for full usage" + exit $? +} + +# func_help +# Echo long help message to standard output and exit. +func_help () +{ + $SED -n '/^# Usage:/,/# Report bugs to/ { + s/^# // + s/^# *$// + s*\$progname*'$progname'* + s*\$host*'"$host"'* + s*\$SHELL*'"$SHELL"'* + s*\$LTCC*'"$LTCC"'* + s*\$LTCFLAGS*'"$LTCFLAGS"'* + s*\$LD*'"$LD"'* + s/\$with_gnu_ld/'"$with_gnu_ld"'/ + s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/ + s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/ + p + }' < "$progpath" + exit $? +} + +# func_missing_arg argname +# Echo program name prefixed message to standard error and set global +# exit_cmd. +func_missing_arg () +{ + func_error "missing argument for $1" + exit_cmd=exit +} + +exit_cmd=: + + + + + +# Check that we have a working $ECHO. +if test "X$1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X$1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then + # Yippee, $ECHO works! + : +else + # Restart under the correct shell, and then maybe $ECHO will work. + exec $SHELL "$progpath" --no-reexec ${1+"$@"} +fi + +if test "X$1" = X--fallback-echo; then + # used as fallback echo + shift + cat </dev/null 2>&1; then + taglist="$taglist $tagname" + + # Evaluate the configuration. Be careful to quote the path + # and the sed script, to avoid splitting on whitespace, but + # also don't use non-portable quotes within backquotes within + # quotes we have to do it in 2 steps: + extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` + eval "$extractedcf" + else + func_error "ignoring unknown tag $tagname" + fi + ;; + esac +} + +# Parse options once, thoroughly. This comes as soon as possible in +# the script to make things like `libtool --version' happen quickly. +{ + + # Shorthand for --mode=foo, only valid as the first argument + case $1 in + clean|clea|cle|cl) + shift; set dummy --mode clean ${1+"$@"}; shift + ;; + compile|compil|compi|comp|com|co|c) + shift; set dummy --mode compile ${1+"$@"}; shift + ;; + execute|execut|execu|exec|exe|ex|e) + shift; set dummy --mode execute ${1+"$@"}; shift + ;; + finish|finis|fini|fin|fi|f) + shift; set dummy --mode finish ${1+"$@"}; shift + ;; + install|instal|insta|inst|ins|in|i) + shift; set dummy --mode install ${1+"$@"}; shift + ;; + link|lin|li|l) + shift; set dummy --mode link ${1+"$@"}; shift + ;; + uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) + shift; set dummy --mode uninstall ${1+"$@"}; shift + ;; + esac + + # Parse non-mode specific arguments: + while test "$#" -gt 0; do + opt="$1" + shift + + case $opt in + --config) func_config ;; + + --debug) preserve_args="$preserve_args $opt" + func_echo "enabling shell trace mode" + opt_debug='set -x' + $opt_debug + ;; + + -dlopen) test "$#" -eq 0 && func_missing_arg "$opt" && break + execute_dlfiles="$execute_dlfiles $1" + shift + ;; + + --dry-run | -n) opt_dry_run=: ;; + --features) func_features ;; + --finish) mode="finish" ;; + + --mode) test "$#" -eq 0 && func_missing_arg "$opt" && break + case $1 in + # Valid mode arguments: + clean) ;; + compile) ;; + execute) ;; + finish) ;; + install) ;; + link) ;; + relink) ;; + uninstall) ;; + + # Catch anything else as an error + *) func_error "invalid argument for $opt" + exit_cmd=exit + break + ;; + esac + + mode="$1" + shift + ;; + + --preserve-dup-deps) + opt_duplicate_deps=: ;; + + --quiet|--silent) preserve_args="$preserve_args $opt" + opt_silent=: + ;; + + --verbose| -v) preserve_args="$preserve_args $opt" + opt_silent=false + ;; + + --tag) test "$#" -eq 0 && func_missing_arg "$opt" && break + preserve_args="$preserve_args $opt $1" + func_enable_tag "$1" # tagname is set here + shift + ;; + + # Separate optargs to long options: + -dlopen=*|--mode=*|--tag=*) + func_opt_split "$opt" + set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"} + shift + ;; + + -\?|-h) func_usage ;; + --help) opt_help=: ;; + --version) func_version ;; + + -*) func_fatal_help "unrecognized option \`$opt'" ;; + + *) nonopt="$opt" + break + ;; + esac + done + + + case $host in + *cygwin* | *mingw* | *pw32* | *cegcc*) + # don't eliminate duplications in $postdeps and $predeps + opt_duplicate_compiler_generated_deps=: + ;; + *) + opt_duplicate_compiler_generated_deps=$opt_duplicate_deps + ;; + esac + + # Having warned about all mis-specified options, bail out if + # anything was wrong. + $exit_cmd $EXIT_FAILURE +} + +# func_check_version_match +# Ensure that we are using m4 macros, and libtool script from the same +# release of libtool. +func_check_version_match () +{ + if test "$package_revision" != "$macro_revision"; then + if test "$VERSION" != "$macro_version"; then + if test -z "$macro_version"; then + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +$progname: definition of this LT_INIT comes from an older release. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION +$progname: and run autoconf again. +_LT_EOF + else + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +$progname: definition of this LT_INIT comes from $PACKAGE $macro_version. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION +$progname: and run autoconf again. +_LT_EOF + fi + else + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, +$progname: but the definition of this LT_INIT comes from revision $macro_revision. +$progname: You should recreate aclocal.m4 with macros from revision $package_revision +$progname: of $PACKAGE $VERSION and run autoconf again. +_LT_EOF + fi + + exit $EXIT_MISMATCH + fi +} + + +## ----------- ## +## Main. ## +## ----------- ## + +$opt_help || { + # Sanity checks first: + func_check_version_match + + if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then + func_fatal_configuration "not configured to build any kind of library" + fi + + test -z "$mode" && func_fatal_error "error: you must specify a MODE." + + + # Darwin sucks + eval std_shrext=\"$shrext_cmds\" + + + # Only execute mode is allowed to have -dlopen flags. + if test -n "$execute_dlfiles" && test "$mode" != execute; then + func_error "unrecognized option \`-dlopen'" + $ECHO "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # Change the help message to a mode-specific one. + generic_help="$help" + help="Try \`$progname --help --mode=$mode' for more information." +} + + +# func_lalib_p file +# True iff FILE is a libtool `.la' library or `.lo' object file. +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_lalib_p () +{ + test -f "$1" && + $SED -e 4q "$1" 2>/dev/null \ + | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 +} + +# func_lalib_unsafe_p file +# True iff FILE is a libtool `.la' library or `.lo' object file. +# This function implements the same check as func_lalib_p without +# resorting to external programs. To this end, it redirects stdin and +# closes it afterwards, without saving the original file descriptor. +# As a safety measure, use it only where a negative result would be +# fatal anyway. Works if `file' does not exist. +func_lalib_unsafe_p () +{ + lalib_p=no + if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then + for lalib_p_l in 1 2 3 4 + do + read lalib_p_line + case "$lalib_p_line" in + \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; + esac + done + exec 0<&5 5<&- + fi + test "$lalib_p" = yes +} + +# func_ltwrapper_script_p file +# True iff FILE is a libtool wrapper script +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_script_p () +{ + func_lalib_p "$1" +} + +# func_ltwrapper_executable_p file +# True iff FILE is a libtool wrapper executable +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_executable_p () +{ + func_ltwrapper_exec_suffix= + case $1 in + *.exe) ;; + *) func_ltwrapper_exec_suffix=.exe ;; + esac + $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 +} + +# func_ltwrapper_scriptname file +# Assumes file is an ltwrapper_executable +# uses $file to determine the appropriate filename for a +# temporary ltwrapper_script. +func_ltwrapper_scriptname () +{ + func_ltwrapper_scriptname_result="" + if func_ltwrapper_executable_p "$1"; then + func_dirname_and_basename "$1" "" "." + func_stripname '' '.exe' "$func_basename_result" + func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" + fi +} + +# func_ltwrapper_p file +# True iff FILE is a libtool wrapper script or wrapper executable +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_p () +{ + func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" +} + + +# func_execute_cmds commands fail_cmd +# Execute tilde-delimited COMMANDS. +# If FAIL_CMD is given, eval that upon failure. +# FAIL_CMD may read-access the current command in variable CMD! +func_execute_cmds () +{ + $opt_debug + save_ifs=$IFS; IFS='~' + for cmd in $1; do + IFS=$save_ifs + eval cmd=\"$cmd\" + func_show_eval "$cmd" "${2-:}" + done + IFS=$save_ifs +} + + +# func_source file +# Source FILE, adding directory component if necessary. +# Note that it is not necessary on cygwin/mingw to append a dot to +# FILE even if both FILE and FILE.exe exist: automatic-append-.exe +# behavior happens only for exec(3), not for open(2)! Also, sourcing +# `FILE.' does not work on cygwin managed mounts. +func_source () +{ + $opt_debug + case $1 in + */* | *\\*) . "$1" ;; + *) . "./$1" ;; + esac +} + + +# func_infer_tag arg +# Infer tagged configuration to use if any are available and +# if one wasn't chosen via the "--tag" command line option. +# Only attempt this if the compiler in the base compile +# command doesn't match the default compiler. +# arg is usually of the form 'gcc ...' +func_infer_tag () +{ + $opt_debug + if test -n "$available_tags" && test -z "$tagname"; then + CC_quoted= + for arg in $CC; do + func_quote_for_eval "$arg" + CC_quoted="$CC_quoted $func_quote_for_eval_result" + done + case $@ in + # Blanks in the command may have been stripped by the calling shell, + # but not from the CC environment variable when configure was run. + " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) ;; + # Blanks at the start of $base_compile will cause this to fail + # if we don't check for them as well. + *) + for z in $available_tags; do + if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then + # Evaluate the configuration. + eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" + CC_quoted= + for arg in $CC; do + # Double-quote args containing other shell metacharacters. + func_quote_for_eval "$arg" + CC_quoted="$CC_quoted $func_quote_for_eval_result" + done + case "$@ " in + " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) + # The compiler in the base compile command matches + # the one in the tagged configuration. + # Assume this is the tagged configuration we want. + tagname=$z + break + ;; + esac + fi + done + # If $tagname still isn't set, then no tagged configuration + # was found and let the user know that the "--tag" command + # line option must be used. + if test -z "$tagname"; then + func_echo "unable to infer tagged configuration" + func_fatal_error "specify a tag with \`--tag'" +# else +# func_verbose "using $tagname tagged configuration" + fi + ;; + esac + fi +} + + + +# func_write_libtool_object output_name pic_name nonpic_name +# Create a libtool object file (analogous to a ".la" file), +# but don't create it if we're doing a dry run. +func_write_libtool_object () +{ + write_libobj=${1} + if test "$build_libtool_libs" = yes; then + write_lobj=\'${2}\' + else + write_lobj=none + fi + + if test "$build_old_libs" = yes; then + write_oldobj=\'${3}\' + else + write_oldobj=none + fi + + $opt_dry_run || { + cat >${write_libobj}T <?"'"'"' &()|`$[]' \ + && func_warning "libobj name \`$libobj' may not contain shell special characters." + func_dirname_and_basename "$obj" "/" "" + objname="$func_basename_result" + xdir="$func_dirname_result" + lobj=${xdir}$objdir/$objname + + test -z "$base_compile" && \ + func_fatal_help "you must specify a compilation command" + + # Delete any leftover library objects. + if test "$build_old_libs" = yes; then + removelist="$obj $lobj $libobj ${libobj}T" + else + removelist="$lobj $libobj ${libobj}T" + fi + + # On Cygwin there's no "real" PIC flag so we must build both object types + case $host_os in + cygwin* | mingw* | pw32* | os2* | cegcc*) + pic_mode=default + ;; + esac + if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then + # non-PIC code in shared libraries is not supported + pic_mode=default + fi + + # Calculate the filename of the output object if compiler does + # not support -o with -c + if test "$compiler_c_o" = no; then + output_obj=`$ECHO "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} + lockfile="$output_obj.lock" + else + output_obj= + need_locks=no + lockfile= + fi + + # Lock this critical section if it is needed + # We use this script file to make the link, it avoids creating a new file + if test "$need_locks" = yes; then + until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do + func_echo "Waiting for $lockfile to be removed" + sleep 2 + done + elif test "$need_locks" = warn; then + if test -f "$lockfile"; then + $ECHO "\ +*** ERROR, $lockfile exists and contains: +`cat $lockfile 2>/dev/null` + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + removelist="$removelist $output_obj" + $ECHO "$srcfile" > "$lockfile" + fi + + $opt_dry_run || $RM $removelist + removelist="$removelist $lockfile" + trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 + + if test -n "$fix_srcfile_path"; then + eval srcfile=\"$fix_srcfile_path\" + fi + func_quote_for_eval "$srcfile" + qsrcfile=$func_quote_for_eval_result + + # Only build a PIC object if we are building libtool libraries. + if test "$build_libtool_libs" = yes; then + # Without this assignment, base_compile gets emptied. + fbsd_hideous_sh_bug=$base_compile + + if test "$pic_mode" != no; then + command="$base_compile $qsrcfile $pic_flag" + else + # Don't build PIC code + command="$base_compile $qsrcfile" + fi + + func_mkdir_p "$xdir$objdir" + + if test -z "$output_obj"; then + # Place PIC objects in $objdir + command="$command -o $lobj" + fi + + func_show_eval_locale "$command" \ + 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' + + if test "$need_locks" = warn && + test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then + $ECHO "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` + +but it should contain: +$srcfile + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + + # Just move the object if needed, then go on to compile the next one + if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then + func_show_eval '$MV "$output_obj" "$lobj"' \ + 'error=$?; $opt_dry_run || $RM $removelist; exit $error' + fi + + # Allow error messages only from the first compilation. + if test "$suppress_opt" = yes; then + suppress_output=' >/dev/null 2>&1' + fi + fi + + # Only build a position-dependent object if we build old libraries. + if test "$build_old_libs" = yes; then + if test "$pic_mode" != yes; then + # Don't build PIC code + command="$base_compile $qsrcfile$pie_flag" + else + command="$base_compile $qsrcfile $pic_flag" + fi + if test "$compiler_c_o" = yes; then + command="$command -o $obj" + fi + + # Suppress compiler output if we already did a PIC compilation. + command="$command$suppress_output" + func_show_eval_locale "$command" \ + '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' + + if test "$need_locks" = warn && + test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then + $ECHO "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` + +but it should contain: +$srcfile + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + + # Just move the object if needed + if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then + func_show_eval '$MV "$output_obj" "$obj"' \ + 'error=$?; $opt_dry_run || $RM $removelist; exit $error' + fi + fi + + $opt_dry_run || { + func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" + + # Unlock the critical section if it was locked + if test "$need_locks" != no; then + removelist=$lockfile + $RM "$lockfile" + fi + } + + exit $EXIT_SUCCESS +} + +$opt_help || { +test "$mode" = compile && func_mode_compile ${1+"$@"} +} + +func_mode_help () +{ + # We need to display help for each of the modes. + case $mode in + "") + # Generic help is extracted from the usage comments + # at the start of this file. + func_help + ;; + + clean) + $ECHO \ +"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... + +Remove files from the build directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed +to RM. + +If FILE is a libtool library, object or program, all the files associated +with it are deleted. Otherwise, only FILE itself is deleted using RM." + ;; + + compile) + $ECHO \ +"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE + +Compile a source file into a libtool library object. + +This mode accepts the following additional options: + + -o OUTPUT-FILE set the output file name to OUTPUT-FILE + -no-suppress do not suppress compiler output for multiple passes + -prefer-pic try to building PIC objects only + -prefer-non-pic try to building non-PIC objects only + -shared do not build a \`.o' file suitable for static linking + -static only build a \`.o' file suitable for static linking + +COMPILE-COMMAND is a command to be used in creating a \`standard' object file +from the given SOURCEFILE. + +The output file name is determined by removing the directory component from +SOURCEFILE, then substituting the C source code suffix \`.c' with the +library object suffix, \`.lo'." + ;; + + execute) + $ECHO \ +"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... + +Automatically set library path, then run a program. + +This mode accepts the following additional options: + + -dlopen FILE add the directory containing FILE to the library path + +This mode sets the library path environment variable according to \`-dlopen' +flags. + +If any of the ARGS are libtool executable wrappers, then they are translated +into their corresponding uninstalled binary, and any of their required library +directories are added to the library path. + +Then, COMMAND is executed, with ARGS as arguments." + ;; + + finish) + $ECHO \ +"Usage: $progname [OPTION]... --mode=finish [LIBDIR]... + +Complete the installation of libtool libraries. + +Each LIBDIR is a directory that contains libtool libraries. + +The commands that this mode executes may require superuser privileges. Use +the \`--dry-run' option if you just want to see what would be executed." + ;; + + install) + $ECHO \ +"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... + +Install executables or libraries. + +INSTALL-COMMAND is the installation command. The first component should be +either the \`install' or \`cp' program. + +The following components of INSTALL-COMMAND are treated specially: + + -inst-prefix PREFIX-DIR Use PREFIX-DIR as a staging area for installation + +The rest of the components are interpreted as arguments to that command (only +BSD-compatible install options are recognized)." + ;; + + link) + $ECHO \ +"Usage: $progname [OPTION]... --mode=link LINK-COMMAND... + +Link object files or libraries together to form another library, or to +create an executable program. + +LINK-COMMAND is a command using the C compiler that you would use to create +a program from several object files. + +The following components of LINK-COMMAND are treated specially: + + -all-static do not do any dynamic linking at all + -avoid-version do not add a version suffix if possible + -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime + -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols + -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) + -export-symbols SYMFILE + try to export only the symbols listed in SYMFILE + -export-symbols-regex REGEX + try to export only the symbols matching REGEX + -LLIBDIR search LIBDIR for required installed libraries + -lNAME OUTPUT-FILE requires the installed library libNAME + -module build a library that can dlopened + -no-fast-install disable the fast-install mode + -no-install link a not-installable executable + -no-undefined declare that a library does not refer to external symbols + -o OUTPUT-FILE create OUTPUT-FILE from the specified objects + -objectlist FILE Use a list of object files found in FILE to specify objects + -precious-files-regex REGEX + don't remove output files matching REGEX + -release RELEASE specify package release information + -rpath LIBDIR the created library will eventually be installed in LIBDIR + -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries + -shared only do dynamic linking of libtool libraries + -shrext SUFFIX override the standard shared library file extension + -static do not do any dynamic linking of uninstalled libtool libraries + -static-libtool-libs + do not do any dynamic linking of libtool libraries + -version-info CURRENT[:REVISION[:AGE]] + specify library version info [each variable defaults to 0] + -weak LIBNAME declare that the target provides the LIBNAME interface + +All other options (arguments beginning with \`-') are ignored. + +Every other argument is treated as a filename. Files ending in \`.la' are +treated as uninstalled libtool libraries, other files are standard or library +object files. + +If the OUTPUT-FILE ends in \`.la', then a libtool library is created, +only library objects (\`.lo' files) may be specified, and \`-rpath' is +required, except when creating a convenience library. + +If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created +using \`ar' and \`ranlib', or on Windows using \`lib'. + +If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file +is created, otherwise an executable program is created." + ;; + + uninstall) + $ECHO \ +"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... + +Remove libraries from an installation directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed +to RM. + +If FILE is a libtool library, all the files associated with it are deleted. +Otherwise, only FILE itself is deleted using RM." + ;; + + *) + func_fatal_help "invalid operation mode \`$mode'" + ;; + esac + + $ECHO + $ECHO "Try \`$progname --help' for more information about other modes." + + exit $? +} + + # Now that we've collected a possible --mode arg, show help if necessary + $opt_help && func_mode_help + + +# func_mode_execute arg... +func_mode_execute () +{ + $opt_debug + # The first argument is the command name. + cmd="$nonopt" + test -z "$cmd" && \ + func_fatal_help "you must specify a COMMAND" + + # Handle -dlopen flags immediately. + for file in $execute_dlfiles; do + test -f "$file" \ + || func_fatal_help "\`$file' is not a file" + + dir= + case $file in + *.la) + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$file" \ + || func_fatal_help "\`$lib' is not a valid libtool archive" + + # Read the libtool library. + dlname= + library_names= + func_source "$file" + + # Skip this library if it cannot be dlopened. + if test -z "$dlname"; then + # Warn if it was a shared library. + test -n "$library_names" && \ + func_warning "\`$file' was not linked with \`-export-dynamic'" + continue + fi + + func_dirname "$file" "" "." + dir="$func_dirname_result" + + if test -f "$dir/$objdir/$dlname"; then + dir="$dir/$objdir" + else + if test ! -f "$dir/$dlname"; then + func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" + fi + fi + ;; + + *.lo) + # Just add the directory containing the .lo file. + func_dirname "$file" "" "." + dir="$func_dirname_result" + ;; + + *) + func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" + continue + ;; + esac + + # Get the absolute pathname. + absdir=`cd "$dir" && pwd` + test -n "$absdir" && dir="$absdir" + + # Now add the directory to shlibpath_var. + if eval "test -z \"\$$shlibpath_var\""; then + eval "$shlibpath_var=\"\$dir\"" + else + eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" + fi + done + + # This variable tells wrapper scripts just to set shlibpath_var + # rather than running their programs. + libtool_execute_magic="$magic" + + # Check if any of the arguments is a wrapper script. + args= + for file + do + case $file in + -*) ;; + *) + # Do a test to see if this is really a libtool program. + if func_ltwrapper_script_p "$file"; then + func_source "$file" + # Transform arg to wrapped name. + file="$progdir/$program" + elif func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + func_source "$func_ltwrapper_scriptname_result" + # Transform arg to wrapped name. + file="$progdir/$program" + fi + ;; + esac + # Quote arguments (to preserve shell metacharacters). + func_quote_for_eval "$file" + args="$args $func_quote_for_eval_result" + done + + if test "X$opt_dry_run" = Xfalse; then + if test -n "$shlibpath_var"; then + # Export the shlibpath_var. + eval "export $shlibpath_var" + fi + + # Restore saved environment variables + for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES + do + eval "if test \"\${save_$lt_var+set}\" = set; then + $lt_var=\$save_$lt_var; export $lt_var + else + $lt_unset $lt_var + fi" + done + + # Now prepare to actually exec the command. + exec_cmd="\$cmd$args" + else + # Display what would be done. + if test -n "$shlibpath_var"; then + eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" + $ECHO "export $shlibpath_var" + fi + $ECHO "$cmd$args" + exit $EXIT_SUCCESS + fi +} + +test "$mode" = execute && func_mode_execute ${1+"$@"} + + +# func_mode_finish arg... +func_mode_finish () +{ + $opt_debug + libdirs="$nonopt" + admincmds= + + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + for dir + do + libdirs="$libdirs $dir" + done + + for libdir in $libdirs; do + if test -n "$finish_cmds"; then + # Do each command in the finish commands. + func_execute_cmds "$finish_cmds" 'admincmds="$admincmds +'"$cmd"'"' + fi + if test -n "$finish_eval"; then + # Do the single finish_eval. + eval cmds=\"$finish_eval\" + $opt_dry_run || eval "$cmds" || admincmds="$admincmds + $cmds" + fi + done + fi + + # Exit here if they wanted silent mode. + $opt_silent && exit $EXIT_SUCCESS + + $ECHO "X----------------------------------------------------------------------" | $Xsed + $ECHO "Libraries have been installed in:" + for libdir in $libdirs; do + $ECHO " $libdir" + done + $ECHO + $ECHO "If you ever happen to want to link against installed libraries" + $ECHO "in a given directory, LIBDIR, you must either use libtool, and" + $ECHO "specify the full pathname of the library, or use the \`-LLIBDIR'" + $ECHO "flag during linking and do at least one of the following:" + if test -n "$shlibpath_var"; then + $ECHO " - add LIBDIR to the \`$shlibpath_var' environment variable" + $ECHO " during execution" + fi + if test -n "$runpath_var"; then + $ECHO " - add LIBDIR to the \`$runpath_var' environment variable" + $ECHO " during linking" + fi + if test -n "$hardcode_libdir_flag_spec"; then + libdir=LIBDIR + eval flag=\"$hardcode_libdir_flag_spec\" + + $ECHO " - use the \`$flag' linker flag" + fi + if test -n "$admincmds"; then + $ECHO " - have your system administrator run these commands:$admincmds" + fi + if test -f /etc/ld.so.conf; then + $ECHO " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" + fi + $ECHO + + $ECHO "See any operating system documentation about shared libraries for" + case $host in + solaris2.[6789]|solaris2.1[0-9]) + $ECHO "more information, such as the ld(1), crle(1) and ld.so(8) manual" + $ECHO "pages." + ;; + *) + $ECHO "more information, such as the ld(1) and ld.so(8) manual pages." + ;; + esac + $ECHO "X----------------------------------------------------------------------" | $Xsed + exit $EXIT_SUCCESS +} + +test "$mode" = finish && func_mode_finish ${1+"$@"} + + +# func_mode_install arg... +func_mode_install () +{ + $opt_debug + # There may be an optional sh(1) argument at the beginning of + # install_prog (especially on Windows NT). + if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || + # Allow the use of GNU shtool's install command. + $ECHO "X$nonopt" | $GREP shtool >/dev/null; then + # Aesthetically quote it. + func_quote_for_eval "$nonopt" + install_prog="$func_quote_for_eval_result " + arg=$1 + shift + else + install_prog= + arg=$nonopt + fi + + # The real first argument should be the name of the installation program. + # Aesthetically quote it. + func_quote_for_eval "$arg" + install_prog="$install_prog$func_quote_for_eval_result" + + # We need to accept at least all the BSD install flags. + dest= + files= + opts= + prev= + install_type= + isdir=no + stripme= + for arg + do + if test -n "$dest"; then + files="$files $dest" + dest=$arg + continue + fi + + case $arg in + -d) isdir=yes ;; + -f) + case " $install_prog " in + *[\\\ /]cp\ *) ;; + *) prev=$arg ;; + esac + ;; + -g | -m | -o) + prev=$arg + ;; + -s) + stripme=" -s" + continue + ;; + -*) + ;; + *) + # If the previous option needed an argument, then skip it. + if test -n "$prev"; then + prev= + else + dest=$arg + continue + fi + ;; + esac + + # Aesthetically quote the argument. + func_quote_for_eval "$arg" + install_prog="$install_prog $func_quote_for_eval_result" + done + + test -z "$install_prog" && \ + func_fatal_help "you must specify an install program" + + test -n "$prev" && \ + func_fatal_help "the \`$prev' option requires an argument" + + if test -z "$files"; then + if test -z "$dest"; then + func_fatal_help "no file or destination specified" + else + func_fatal_help "you must specify a destination" + fi + fi + + # Strip any trailing slash from the destination. + func_stripname '' '/' "$dest" + dest=$func_stripname_result + + # Check to see that the destination is a directory. + test -d "$dest" && isdir=yes + if test "$isdir" = yes; then + destdir="$dest" + destname= + else + func_dirname_and_basename "$dest" "" "." + destdir="$func_dirname_result" + destname="$func_basename_result" + + # Not a directory, so check to see that there is only one file specified. + set dummy $files; shift + test "$#" -gt 1 && \ + func_fatal_help "\`$dest' is not a directory" + fi + case $destdir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + for file in $files; do + case $file in + *.lo) ;; + *) + func_fatal_help "\`$destdir' must be an absolute directory name" + ;; + esac + done + ;; + esac + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic="$magic" + + staticlibs= + future_libdirs= + current_libdirs= + for file in $files; do + + # Do each installation. + case $file in + *.$libext) + # Do the static libraries later. + staticlibs="$staticlibs $file" + ;; + + *.la) + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$file" \ + || func_fatal_help "\`$file' is not a valid libtool archive" + + library_names= + old_library= + relink_command= + func_source "$file" + + # Add the libdir to current_libdirs if it is the destination. + if test "X$destdir" = "X$libdir"; then + case "$current_libdirs " in + *" $libdir "*) ;; + *) current_libdirs="$current_libdirs $libdir" ;; + esac + else + # Note the libdir as a future libdir. + case "$future_libdirs " in + *" $libdir "*) ;; + *) future_libdirs="$future_libdirs $libdir" ;; + esac + fi + + func_dirname "$file" "/" "" + dir="$func_dirname_result" + dir="$dir$objdir" + + if test -n "$relink_command"; then + # Determine the prefix the user has applied to our future dir. + inst_prefix_dir=`$ECHO "X$destdir" | $Xsed -e "s%$libdir\$%%"` + + # Don't allow the user to place us outside of our expected + # location b/c this prevents finding dependent libraries that + # are installed to the same prefix. + # At present, this check doesn't affect windows .dll's that + # are installed into $libdir/../bin (currently, that works fine) + # but it's something to keep an eye on. + test "$inst_prefix_dir" = "$destdir" && \ + func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" + + if test -n "$inst_prefix_dir"; then + # Stick the inst_prefix_dir data into the link command. + relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` + else + relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%%"` + fi + + func_warning "relinking \`$file'" + func_show_eval "$relink_command" \ + 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' + fi + + # See the names of the shared library. + set dummy $library_names; shift + if test -n "$1"; then + realname="$1" + shift + + srcname="$realname" + test -n "$relink_command" && srcname="$realname"T + + # Install the shared library and build the symlinks. + func_show_eval "$install_prog $dir/$srcname $destdir/$realname" \ + 'exit $?' + tstripme="$stripme" + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + case $realname in + *.dll.a) + tstripme="" + ;; + esac + ;; + esac + if test -n "$tstripme" && test -n "$striplib"; then + func_show_eval "$striplib $destdir/$realname" 'exit $?' + fi + + if test "$#" -gt 0; then + # Delete the old symlinks, and create new ones. + # Try `ln -sf' first, because the `ln' binary might depend on + # the symlink we replace! Solaris /bin/ln does not understand -f, + # so we also need to try rm && ln -s. + for linkname + do + test "$linkname" != "$realname" \ + && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" + done + fi + + # Do each command in the postinstall commands. + lib="$destdir/$realname" + func_execute_cmds "$postinstall_cmds" 'exit $?' + fi + + # Install the pseudo-library for information purposes. + func_basename "$file" + name="$func_basename_result" + instname="$dir/$name"i + func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' + + # Maybe install the static library, too. + test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" + ;; + + *.lo) + # Install (i.e. copy) a libtool object. + + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile="$destdir/$destname" + else + func_basename "$file" + destfile="$func_basename_result" + destfile="$destdir/$destfile" + fi + + # Deduce the name of the destination old-style object file. + case $destfile in + *.lo) + func_lo2o "$destfile" + staticdest=$func_lo2o_result + ;; + *.$objext) + staticdest="$destfile" + destfile= + ;; + *) + func_fatal_help "cannot copy a libtool object to \`$destfile'" + ;; + esac + + # Install the libtool object if requested. + test -n "$destfile" && \ + func_show_eval "$install_prog $file $destfile" 'exit $?' + + # Install the old object if enabled. + if test "$build_old_libs" = yes; then + # Deduce the name of the old-style object file. + func_lo2o "$file" + staticobj=$func_lo2o_result + func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' + fi + exit $EXIT_SUCCESS + ;; + + *) + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile="$destdir/$destname" + else + func_basename "$file" + destfile="$func_basename_result" + destfile="$destdir/$destfile" + fi + + # If the file is missing, and there is a .exe on the end, strip it + # because it is most likely a libtool script we actually want to + # install + stripped_ext="" + case $file in + *.exe) + if test ! -f "$file"; then + func_stripname '' '.exe' "$file" + file=$func_stripname_result + stripped_ext=".exe" + fi + ;; + esac + + # Do a test to see if this is really a libtool program. + case $host in + *cygwin* | *mingw*) + if func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + wrapper=$func_ltwrapper_scriptname_result + else + func_stripname '' '.exe' "$file" + wrapper=$func_stripname_result + fi + ;; + *) + wrapper=$file + ;; + esac + if func_ltwrapper_script_p "$wrapper"; then + notinst_deplibs= + relink_command= + + func_source "$wrapper" + + # Check the variables that should have been set. + test -z "$generated_by_libtool_version" && \ + func_fatal_error "invalid libtool wrapper script \`$wrapper'" + + finalize=yes + for lib in $notinst_deplibs; do + # Check to see that each library is installed. + libdir= + if test -f "$lib"; then + func_source "$lib" + fi + libfile="$libdir/"`$ECHO "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test + if test -n "$libdir" && test ! -f "$libfile"; then + func_warning "\`$lib' has not been installed in \`$libdir'" + finalize=no + fi + done + + relink_command= + func_source "$wrapper" + + outputname= + if test "$fast_install" = no && test -n "$relink_command"; then + $opt_dry_run || { + if test "$finalize" = yes; then + tmpdir=`func_mktempdir` + func_basename "$file$stripped_ext" + file="$func_basename_result" + outputname="$tmpdir/$file" + # Replace the output file specification. + relink_command=`$ECHO "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` + + $opt_silent || { + func_quote_for_expand "$relink_command" + eval "func_echo $func_quote_for_expand_result" + } + if eval "$relink_command"; then : + else + func_error "error: relink \`$file' with the above command before installing it" + $opt_dry_run || ${RM}r "$tmpdir" + continue + fi + file="$outputname" + else + func_warning "cannot relink \`$file'" + fi + } + else + # Install the binary that we compiled earlier. + file=`$ECHO "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` + fi + fi + + # remove .exe since cygwin /usr/bin/install will append another + # one anyway + case $install_prog,$host in + */usr/bin/install*,*cygwin*) + case $file:$destfile in + *.exe:*.exe) + # this is ok + ;; + *.exe:*) + destfile=$destfile.exe + ;; + *:*.exe) + func_stripname '' '.exe' "$destfile" + destfile=$func_stripname_result + ;; + esac + ;; + esac + func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' + $opt_dry_run || if test -n "$outputname"; then + ${RM}r "$tmpdir" + fi + ;; + esac + done + + for file in $staticlibs; do + func_basename "$file" + name="$func_basename_result" + + # Set up the ranlib parameters. + oldlib="$destdir/$name" + + func_show_eval "$install_prog \$file \$oldlib" 'exit $?' + + if test -n "$stripme" && test -n "$old_striplib"; then + func_show_eval "$old_striplib $oldlib" 'exit $?' + fi + + # Do each command in the postinstall commands. + func_execute_cmds "$old_postinstall_cmds" 'exit $?' + done + + test -n "$future_libdirs" && \ + func_warning "remember to run \`$progname --finish$future_libdirs'" + + if test -n "$current_libdirs"; then + # Maybe just do a dry run. + $opt_dry_run && current_libdirs=" -n$current_libdirs" + exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' + else + exit $EXIT_SUCCESS + fi +} + +test "$mode" = install && func_mode_install ${1+"$@"} + + +# func_generate_dlsyms outputname originator pic_p +# Extract symbols from dlprefiles and create ${outputname}S.o with +# a dlpreopen symbol table. +func_generate_dlsyms () +{ + $opt_debug + my_outputname="$1" + my_originator="$2" + my_pic_p="${3-no}" + my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` + my_dlsyms= + + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + if test -n "$NM" && test -n "$global_symbol_pipe"; then + my_dlsyms="${my_outputname}S.c" + else + func_error "not configured to extract global symbols from dlpreopened files" + fi + fi + + if test -n "$my_dlsyms"; then + case $my_dlsyms in + "") ;; + *.c) + # Discover the nlist of each of the dlfiles. + nlist="$output_objdir/${my_outputname}.nm" + + func_show_eval "$RM $nlist ${nlist}S ${nlist}T" + + # Parse the name list into a source file. + func_verbose "creating $output_objdir/$my_dlsyms" + + $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ +/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ +/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ + +#ifdef __cplusplus +extern \"C\" { +#endif + +/* External symbol declarations for the compiler. */\ +" + + if test "$dlself" = yes; then + func_verbose "generating symbol list for \`$output'" + + $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" + + # Add our own program objects to the symbol list. + progfiles=`$ECHO "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + for progfile in $progfiles; do + func_verbose "extracting global C symbols from \`$progfile'" + $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'" + done + + if test -n "$exclude_expsyms"; then + $opt_dry_run || { + eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + } + fi + + if test -n "$export_symbols_regex"; then + $opt_dry_run || { + eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + } + fi + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + export_symbols="$output_objdir/$outputname.exp" + $opt_dry_run || { + $RM $export_symbols + eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' + case $host in + *cygwin* | *mingw* | *cegcc* ) + eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' + ;; + esac + } + else + $opt_dry_run || { + eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' + eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + case $host in + *cygwin | *mingw* | *cegcc* ) + eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' + ;; + esac + } + fi + fi + + for dlprefile in $dlprefiles; do + func_verbose "extracting global C symbols from \`$dlprefile'" + func_basename "$dlprefile" + name="$func_basename_result" + $opt_dry_run || { + eval '$ECHO ": $name " >> "$nlist"' + eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'" + } + done + + $opt_dry_run || { + # Make sure we have at least an empty file. + test -f "$nlist" || : > "$nlist" + + if test -n "$exclude_expsyms"; then + $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T + $MV "$nlist"T "$nlist" + fi + + # Try sorting and uniquifying the output. + if $GREP -v "^: " < "$nlist" | + if sort -k 3 /dev/null 2>&1; then + sort -k 3 + else + sort +2 + fi | + uniq > "$nlist"S; then + : + else + $GREP -v "^: " < "$nlist" > "$nlist"S + fi + + if test -f "$nlist"S; then + eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' + else + $ECHO '/* NONE */' >> "$output_objdir/$my_dlsyms" + fi + + $ECHO >> "$output_objdir/$my_dlsyms" "\ + +/* The mapping between symbol names and symbols. */ +typedef struct { + const char *name; + void *address; +} lt_dlsymlist; +" + case $host in + *cygwin* | *mingw* | *cegcc* ) + $ECHO >> "$output_objdir/$my_dlsyms" "\ +/* DATA imports from DLLs on WIN32 con't be const, because + runtime relocations are performed -- see ld's documentation + on pseudo-relocs. */" + lt_dlsym_const= ;; + *osf5*) + echo >> "$output_objdir/$my_dlsyms" "\ +/* This system does not cope well with relocations in const data */" + lt_dlsym_const= ;; + *) + lt_dlsym_const=const ;; + esac + + $ECHO >> "$output_objdir/$my_dlsyms" "\ +extern $lt_dlsym_const lt_dlsymlist +lt_${my_prefix}_LTX_preloaded_symbols[]; +$lt_dlsym_const lt_dlsymlist +lt_${my_prefix}_LTX_preloaded_symbols[] = +{\ + { \"$my_originator\", (void *) 0 }," + + case $need_lib_prefix in + no) + eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" + ;; + *) + eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" + ;; + esac + $ECHO >> "$output_objdir/$my_dlsyms" "\ + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt_${my_prefix}_LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif\ +" + } # !$opt_dry_run + + pic_flag_for_symtable= + case "$compile_command " in + *" -static "*) ;; + *) + case $host in + # compiling the symbol table file with pic_flag works around + # a FreeBSD bug that causes programs to crash when -lm is + # linked before any other PIC object. But we must not use + # pic_flag when linking with -static. The problem exists in + # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. + *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) + pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; + *-*-hpux*) + pic_flag_for_symtable=" $pic_flag" ;; + *) + if test "X$my_pic_p" != Xno; then + pic_flag_for_symtable=" $pic_flag" + fi + ;; + esac + ;; + esac + symtab_cflags= + for arg in $LTCFLAGS; do + case $arg in + -pie | -fpie | -fPIE) ;; + *) symtab_cflags="$symtab_cflags $arg" ;; + esac + done + + # Now compile the dynamic symbol file. + func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' + + # Clean up the generated files. + func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' + + # Transform the symbol file into the correct name. + symfileobj="$output_objdir/${my_outputname}S.$objext" + case $host in + *cygwin* | *mingw* | *cegcc* ) + if test -f "$output_objdir/$my_outputname.def"; then + compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + else + compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` + fi + ;; + *) + compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` + ;; + esac + ;; + *) + func_fatal_error "unknown suffix for \`$my_dlsyms'" + ;; + esac + else + # We keep going just in case the user didn't refer to + # lt_preloaded_symbols. The linker will fail if global_symbol_pipe + # really was required. + + # Nullify the symbol file. + compile_command=`$ECHO "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` + finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` + fi +} + +# func_win32_libid arg +# return the library type of file 'arg' +# +# Need a lot of goo to handle *both* DLLs and import libs +# Has to be a shell function in order to 'eat' the argument +# that is supplied when $file_magic_command is called. +func_win32_libid () +{ + $opt_debug + win32_libid_type="unknown" + win32_fileres=`file -L $1 2>/dev/null` + case $win32_fileres in + *ar\ archive\ import\ library*) # definitely import + win32_libid_type="x86 archive import" + ;; + *ar\ archive*) # could be an import, or static + if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | + $EGREP 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then + win32_nmres=`eval $NM -f posix -A $1 | + $SED -n -e ' + 1,100{ + / I /{ + s,.*,import, + p + q + } + }'` + case $win32_nmres in + import*) win32_libid_type="x86 archive import";; + *) win32_libid_type="x86 archive static";; + esac + fi + ;; + *DLL*) + win32_libid_type="x86 DLL" + ;; + *executable*) # but shell scripts are "executable" too... + case $win32_fileres in + *MS\ Windows\ PE\ Intel*) + win32_libid_type="x86 DLL" + ;; + esac + ;; + esac + $ECHO "$win32_libid_type" +} + + + +# func_extract_an_archive dir oldlib +func_extract_an_archive () +{ + $opt_debug + f_ex_an_ar_dir="$1"; shift + f_ex_an_ar_oldlib="$1" + func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" 'exit $?' + if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then + : + else + func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" + fi +} + + +# func_extract_archives gentop oldlib ... +func_extract_archives () +{ + $opt_debug + my_gentop="$1"; shift + my_oldlibs=${1+"$@"} + my_oldobjs="" + my_xlib="" + my_xabs="" + my_xdir="" + + for my_xlib in $my_oldlibs; do + # Extract the objects. + case $my_xlib in + [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; + *) my_xabs=`pwd`"/$my_xlib" ;; + esac + func_basename "$my_xlib" + my_xlib="$func_basename_result" + my_xlib_u=$my_xlib + while :; do + case " $extracted_archives " in + *" $my_xlib_u "*) + func_arith $extracted_serial + 1 + extracted_serial=$func_arith_result + my_xlib_u=lt$extracted_serial-$my_xlib ;; + *) break ;; + esac + done + extracted_archives="$extracted_archives $my_xlib_u" + my_xdir="$my_gentop/$my_xlib_u" + + func_mkdir_p "$my_xdir" + + case $host in + *-darwin*) + func_verbose "Extracting $my_xabs" + # Do not bother doing anything if just a dry run + $opt_dry_run || { + darwin_orig_dir=`pwd` + cd $my_xdir || exit $? + darwin_archive=$my_xabs + darwin_curdir=`pwd` + darwin_base_archive=`basename "$darwin_archive"` + darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` + if test -n "$darwin_arches"; then + darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` + darwin_arch= + func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" + for darwin_arch in $darwin_arches ; do + func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" + $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" + cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" + func_extract_an_archive "`pwd`" "${darwin_base_archive}" + cd "$darwin_curdir" + $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" + done # $darwin_arches + ## Okay now we've a bunch of thin objects, gotta fatten them up :) + darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` + darwin_file= + darwin_files= + for darwin_file in $darwin_filelist; do + darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` + $LIPO -create -output "$darwin_file" $darwin_files + done # $darwin_filelist + $RM -rf unfat-$$ + cd "$darwin_orig_dir" + else + cd $darwin_orig_dir + func_extract_an_archive "$my_xdir" "$my_xabs" + fi # $darwin_arches + } # !$opt_dry_run + ;; + *) + func_extract_an_archive "$my_xdir" "$my_xabs" + ;; + esac + my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` + done + + func_extract_archives_result="$my_oldobjs" +} + + + +# func_emit_wrapper_part1 [arg=no] +# +# Emit the first part of a libtool wrapper script on stdout. +# For more information, see the description associated with +# func_emit_wrapper(), below. +func_emit_wrapper_part1 () +{ + func_emit_wrapper_part1_arg1=no + if test -n "$1" ; then + func_emit_wrapper_part1_arg1=$1 + fi + + $ECHO "\ +#! $SHELL + +# $output - temporary wrapper script for $objdir/$outputname +# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION +# +# The $output program cannot be directly executed until all the libtool +# libraries that it depends on are installed. +# +# This wrapper script should never be moved out of the build directory. +# If it is, it will not operate correctly. + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed='${SED} -e 1s/^X//' +sed_quote_subst='$sed_quote_subst' + +# Be Bourne compatible +if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +relink_command=\"$relink_command\" + +# This environment variable determines our operation mode. +if test \"\$libtool_install_magic\" = \"$magic\"; then + # install mode needs the following variables: + generated_by_libtool_version='$macro_version' + notinst_deplibs='$notinst_deplibs' +else + # When we are sourced in execute mode, \$file and \$ECHO are already set. + if test \"\$libtool_execute_magic\" != \"$magic\"; then + ECHO=\"$qecho\" + file=\"\$0\" + # Make sure echo works. + if test \"X\$1\" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift + elif test \"X\`{ \$ECHO '\t'; } 2>/dev/null\`\" = 'X\t'; then + # Yippee, \$ECHO works! + : + else + # Restart under the correct shell, and then maybe \$ECHO will work. + exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} + fi + fi\ +" + $ECHO "\ + + # Find the directory that this script lives in. + thisdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` + test \"x\$thisdir\" = \"x\$file\" && thisdir=. + + # Follow symbolic links until we get to the real thisdir. + file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` + while test -n \"\$file\"; do + destdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` + + # If there was a directory component, then change thisdir. + if test \"x\$destdir\" != \"x\$file\"; then + case \"\$destdir\" in + [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; + *) thisdir=\"\$thisdir/\$destdir\" ;; + esac + fi + + file=\`\$ECHO \"X\$file\" | \$Xsed -e 's%^.*/%%'\` + file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` + done +" +} +# end: func_emit_wrapper_part1 + +# func_emit_wrapper_part2 [arg=no] +# +# Emit the second part of a libtool wrapper script on stdout. +# For more information, see the description associated with +# func_emit_wrapper(), below. +func_emit_wrapper_part2 () +{ + func_emit_wrapper_part2_arg1=no + if test -n "$1" ; then + func_emit_wrapper_part2_arg1=$1 + fi + + $ECHO "\ + + # Usually 'no', except on cygwin/mingw when embedded into + # the cwrapper. + WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_part2_arg1 + if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then + # special case for '.' + if test \"\$thisdir\" = \".\"; then + thisdir=\`pwd\` + fi + # remove .libs from thisdir + case \"\$thisdir\" in + *[\\\\/]$objdir ) thisdir=\`\$ECHO \"X\$thisdir\" | \$Xsed -e 's%[\\\\/][^\\\\/]*$%%'\` ;; + $objdir ) thisdir=. ;; + esac + fi + + # Try to get the absolute directory name. + absdir=\`cd \"\$thisdir\" && pwd\` + test -n \"\$absdir\" && thisdir=\"\$absdir\" +" + + if test "$fast_install" = yes; then + $ECHO "\ + program=lt-'$outputname'$exeext + progdir=\"\$thisdir/$objdir\" + + if test ! -f \"\$progdir/\$program\" || + { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ + test \"X\$file\" != \"X\$progdir/\$program\"; }; then + + file=\"\$\$-\$program\" + + if test ! -d \"\$progdir\"; then + $MKDIR \"\$progdir\" + else + $RM \"\$progdir/\$file\" + fi" + + $ECHO "\ + + # relink executable if necessary + if test -n \"\$relink_command\"; then + if relink_command_output=\`eval \$relink_command 2>&1\`; then : + else + $ECHO \"\$relink_command_output\" >&2 + $RM \"\$progdir/\$file\" + exit 1 + fi + fi + + $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || + { $RM \"\$progdir/\$program\"; + $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } + $RM \"\$progdir/\$file\" + fi" + else + $ECHO "\ + program='$outputname' + progdir=\"\$thisdir/$objdir\" +" + fi + + $ECHO "\ + + if test -f \"\$progdir/\$program\"; then" + + # Export our shlibpath_var if we have one. + if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then + $ECHO "\ + # Add our own library path to $shlibpath_var + $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" + + # Some systems cannot cope with colon-terminated $shlibpath_var + # The second colon is a workaround for a bug in BeOS R4 sed + $shlibpath_var=\`\$ECHO \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` + + export $shlibpath_var +" + fi + + # fixup the dll searchpath if we need to. + if test -n "$dllsearchpath"; then + $ECHO "\ + # Add the dll search path components to the executable PATH + PATH=$dllsearchpath:\$PATH +" + fi + + $ECHO "\ + if test \"\$libtool_execute_magic\" != \"$magic\"; then + # Run the actual program with our arguments. +" + case $host in + # Backslashes separate directories on plain windows + *-*-mingw | *-*-os2* | *-cegcc*) + $ECHO "\ + exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} +" + ;; + + *) + $ECHO "\ + exec \"\$progdir/\$program\" \${1+\"\$@\"} +" + ;; + esac + $ECHO "\ + \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 + exit 1 + fi + else + # The program doesn't exist. + \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 + \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 + $ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 + exit 1 + fi +fi\ +" +} +# end: func_emit_wrapper_part2 + + +# func_emit_wrapper [arg=no] +# +# Emit a libtool wrapper script on stdout. +# Don't directly open a file because we may want to +# incorporate the script contents within a cygwin/mingw +# wrapper executable. Must ONLY be called from within +# func_mode_link because it depends on a number of variables +# set therein. +# +# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR +# variable will take. If 'yes', then the emitted script +# will assume that the directory in which it is stored is +# the $objdir directory. This is a cygwin/mingw-specific +# behavior. +func_emit_wrapper () +{ + func_emit_wrapper_arg1=no + if test -n "$1" ; then + func_emit_wrapper_arg1=$1 + fi + + # split this up so that func_emit_cwrapperexe_src + # can call each part independently. + func_emit_wrapper_part1 "${func_emit_wrapper_arg1}" + func_emit_wrapper_part2 "${func_emit_wrapper_arg1}" +} + + +# func_to_host_path arg +# +# Convert paths to host format when used with build tools. +# Intended for use with "native" mingw (where libtool itself +# is running under the msys shell), or in the following cross- +# build environments: +# $build $host +# mingw (msys) mingw [e.g. native] +# cygwin mingw +# *nix + wine mingw +# where wine is equipped with the `winepath' executable. +# In the native mingw case, the (msys) shell automatically +# converts paths for any non-msys applications it launches, +# but that facility isn't available from inside the cwrapper. +# Similar accommodations are necessary for $host mingw and +# $build cygwin. Calling this function does no harm for other +# $host/$build combinations not listed above. +# +# ARG is the path (on $build) that should be converted to +# the proper representation for $host. The result is stored +# in $func_to_host_path_result. +func_to_host_path () +{ + func_to_host_path_result="$1" + if test -n "$1" ; then + case $host in + *mingw* ) + lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' + case $build in + *mingw* ) # actually, msys + # awkward: cmd appends spaces to result + lt_sed_strip_trailing_spaces="s/[ ]*\$//" + func_to_host_path_tmp1=`( cmd //c echo "$1" |\ + $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""` + func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\ + $SED -e "$lt_sed_naive_backslashify"` + ;; + *cygwin* ) + func_to_host_path_tmp1=`cygpath -w "$1"` + func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\ + $SED -e "$lt_sed_naive_backslashify"` + ;; + * ) + # Unfortunately, winepath does not exit with a non-zero + # error code, so we are forced to check the contents of + # stdout. On the other hand, if the command is not + # found, the shell will set an exit code of 127 and print + # *an error message* to stdout. So we must check for both + # error code of zero AND non-empty stdout, which explains + # the odd construction: + func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null` + if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then + func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\ + $SED -e "$lt_sed_naive_backslashify"` + else + # Allow warning below. + func_to_host_path_result="" + fi + ;; + esac + if test -z "$func_to_host_path_result" ; then + func_error "Could not determine host path corresponding to" + func_error " '$1'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback: + func_to_host_path_result="$1" + fi + ;; + esac + fi +} +# end: func_to_host_path + +# func_to_host_pathlist arg +# +# Convert pathlists to host format when used with build tools. +# See func_to_host_path(), above. This function supports the +# following $build/$host combinations (but does no harm for +# combinations not listed here): +# $build $host +# mingw (msys) mingw [e.g. native] +# cygwin mingw +# *nix + wine mingw +# +# Path separators are also converted from $build format to +# $host format. If ARG begins or ends with a path separator +# character, it is preserved (but converted to $host format) +# on output. +# +# ARG is a pathlist (on $build) that should be converted to +# the proper representation on $host. The result is stored +# in $func_to_host_pathlist_result. +func_to_host_pathlist () +{ + func_to_host_pathlist_result="$1" + if test -n "$1" ; then + case $host in + *mingw* ) + lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' + # Remove leading and trailing path separator characters from + # ARG. msys behavior is inconsistent here, cygpath turns them + # into '.;' and ';.', and winepath ignores them completely. + func_to_host_pathlist_tmp2="$1" + # Once set for this call, this variable should not be + # reassigned. It is used in tha fallback case. + func_to_host_pathlist_tmp1=`echo "$func_to_host_pathlist_tmp2" |\ + $SED -e 's|^:*||' -e 's|:*$||'` + case $build in + *mingw* ) # Actually, msys. + # Awkward: cmd appends spaces to result. + lt_sed_strip_trailing_spaces="s/[ ]*\$//" + func_to_host_pathlist_tmp2=`( cmd //c echo "$func_to_host_pathlist_tmp1" |\ + $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""` + func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\ + $SED -e "$lt_sed_naive_backslashify"` + ;; + *cygwin* ) + func_to_host_pathlist_tmp2=`cygpath -w -p "$func_to_host_pathlist_tmp1"` + func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\ + $SED -e "$lt_sed_naive_backslashify"` + ;; + * ) + # unfortunately, winepath doesn't convert pathlists + func_to_host_pathlist_result="" + func_to_host_pathlist_oldIFS=$IFS + IFS=: + for func_to_host_pathlist_f in $func_to_host_pathlist_tmp1 ; do + IFS=$func_to_host_pathlist_oldIFS + if test -n "$func_to_host_pathlist_f" ; then + func_to_host_path "$func_to_host_pathlist_f" + if test -n "$func_to_host_path_result" ; then + if test -z "$func_to_host_pathlist_result" ; then + func_to_host_pathlist_result="$func_to_host_path_result" + else + func_to_host_pathlist_result="$func_to_host_pathlist_result;$func_to_host_path_result" + fi + fi + fi + IFS=: + done + IFS=$func_to_host_pathlist_oldIFS + ;; + esac + if test -z "$func_to_host_pathlist_result" ; then + func_error "Could not determine the host path(s) corresponding to" + func_error " '$1'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback. This may break if $1 contains DOS-style drive + # specifications. The fix is not to complicate the expression + # below, but for the user to provide a working wine installation + # with winepath so that path translation in the cross-to-mingw + # case works properly. + lt_replace_pathsep_nix_to_dos="s|:|;|g" + func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp1" |\ + $SED -e "$lt_replace_pathsep_nix_to_dos"` + fi + # Now, add the leading and trailing path separators back + case "$1" in + :* ) func_to_host_pathlist_result=";$func_to_host_pathlist_result" + ;; + esac + case "$1" in + *: ) func_to_host_pathlist_result="$func_to_host_pathlist_result;" + ;; + esac + ;; + esac + fi +} +# end: func_to_host_pathlist + +# func_emit_cwrapperexe_src +# emit the source code for a wrapper executable on stdout +# Must ONLY be called from within func_mode_link because +# it depends on a number of variable set therein. +func_emit_cwrapperexe_src () +{ + cat < +#include +#ifdef _MSC_VER +# include +# include +# include +# define setmode _setmode +#else +# include +# include +# ifdef __CYGWIN__ +# include +# define HAVE_SETENV +# ifdef __STRICT_ANSI__ +char *realpath (const char *, char *); +int putenv (char *); +int setenv (const char *, const char *, int); +# endif +# endif +#endif +#include +#include +#include +#include +#include +#include +#include +#include + +#if defined(PATH_MAX) +# define LT_PATHMAX PATH_MAX +#elif defined(MAXPATHLEN) +# define LT_PATHMAX MAXPATHLEN +#else +# define LT_PATHMAX 1024 +#endif + +#ifndef S_IXOTH +# define S_IXOTH 0 +#endif +#ifndef S_IXGRP +# define S_IXGRP 0 +#endif + +#ifdef _MSC_VER +# define S_IXUSR _S_IEXEC +# define stat _stat +# ifndef _INTPTR_T_DEFINED +# define intptr_t int +# endif +#endif + +#ifndef DIR_SEPARATOR +# define DIR_SEPARATOR '/' +# define PATH_SEPARATOR ':' +#endif + +#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ + defined (__OS2__) +# define HAVE_DOS_BASED_FILE_SYSTEM +# define FOPEN_WB "wb" +# ifndef DIR_SEPARATOR_2 +# define DIR_SEPARATOR_2 '\\' +# endif +# ifndef PATH_SEPARATOR_2 +# define PATH_SEPARATOR_2 ';' +# endif +#endif + +#ifndef DIR_SEPARATOR_2 +# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) +#else /* DIR_SEPARATOR_2 */ +# define IS_DIR_SEPARATOR(ch) \ + (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) +#endif /* DIR_SEPARATOR_2 */ + +#ifndef PATH_SEPARATOR_2 +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) +#else /* PATH_SEPARATOR_2 */ +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) +#endif /* PATH_SEPARATOR_2 */ + +#ifdef __CYGWIN__ +# define FOPEN_WB "wb" +#endif + +#ifndef FOPEN_WB +# define FOPEN_WB "w" +#endif +#ifndef _O_BINARY +# define _O_BINARY 0 +#endif + +#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) +#define XFREE(stale) do { \ + if (stale) { free ((void *) stale); stale = 0; } \ +} while (0) + +#undef LTWRAPPER_DEBUGPRINTF +#if defined DEBUGWRAPPER +# define LTWRAPPER_DEBUGPRINTF(args) ltwrapper_debugprintf args +static void +ltwrapper_debugprintf (const char *fmt, ...) +{ + va_list args; + va_start (args, fmt); + (void) vfprintf (stderr, fmt, args); + va_end (args); +} +#else +# define LTWRAPPER_DEBUGPRINTF(args) +#endif + +const char *program_name = NULL; + +void *xmalloc (size_t num); +char *xstrdup (const char *string); +const char *base_name (const char *name); +char *find_executable (const char *wrapper); +char *chase_symlinks (const char *pathspec); +int make_executable (const char *path); +int check_executable (const char *path); +char *strendzap (char *str, const char *pat); +void lt_fatal (const char *message, ...); +void lt_setenv (const char *name, const char *value); +char *lt_extend_str (const char *orig_value, const char *add, int to_end); +void lt_opt_process_env_set (const char *arg); +void lt_opt_process_env_prepend (const char *arg); +void lt_opt_process_env_append (const char *arg); +int lt_split_name_value (const char *arg, char** name, char** value); +void lt_update_exe_path (const char *name, const char *value); +void lt_update_lib_path (const char *name, const char *value); + +static const char *script_text_part1 = +EOF + + func_emit_wrapper_part1 yes | + $SED -e 's/\([\\"]\)/\\\1/g' \ + -e 's/^/ "/' -e 's/$/\\n"/' + echo ";" + cat <"))); + for (i = 0; i < newargc; i++) + { + LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d] : %s\n", i, (newargz[i] ? newargz[i] : ""))); + } + +EOF + + case $host_os in + mingw*) + cat <<"EOF" + /* execv doesn't actually work on mingw as expected on unix */ + rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz); + if (rval == -1) + { + /* failed to start process */ + LTWRAPPER_DEBUGPRINTF (("(main) failed to launch target \"%s\": errno = %d\n", lt_argv_zero, errno)); + return 127; + } + return rval; +EOF + ;; + *) + cat <<"EOF" + execv (lt_argv_zero, newargz); + return rval; /* =127, but avoids unused variable warning */ +EOF + ;; + esac + + cat <<"EOF" +} + +void * +xmalloc (size_t num) +{ + void *p = (void *) malloc (num); + if (!p) + lt_fatal ("Memory exhausted"); + + return p; +} + +char * +xstrdup (const char *string) +{ + return string ? strcpy ((char *) xmalloc (strlen (string) + 1), + string) : NULL; +} + +const char * +base_name (const char *name) +{ + const char *base; + +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + /* Skip over the disk name in MSDOS pathnames. */ + if (isalpha ((unsigned char) name[0]) && name[1] == ':') + name += 2; +#endif + + for (base = name; *name; name++) + if (IS_DIR_SEPARATOR (*name)) + base = name + 1; + return base; +} + +int +check_executable (const char *path) +{ + struct stat st; + + LTWRAPPER_DEBUGPRINTF (("(check_executable) : %s\n", + path ? (*path ? path : "EMPTY!") : "NULL!")); + if ((!path) || (!*path)) + return 0; + + if ((stat (path, &st) >= 0) + && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) + return 1; + else + return 0; +} + +int +make_executable (const char *path) +{ + int rval = 0; + struct stat st; + + LTWRAPPER_DEBUGPRINTF (("(make_executable) : %s\n", + path ? (*path ? path : "EMPTY!") : "NULL!")); + if ((!path) || (!*path)) + return 0; + + if (stat (path, &st) >= 0) + { + rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); + } + return rval; +} + +/* Searches for the full path of the wrapper. Returns + newly allocated full path name if found, NULL otherwise + Does not chase symlinks, even on platforms that support them. +*/ +char * +find_executable (const char *wrapper) +{ + int has_slash = 0; + const char *p; + const char *p_next; + /* static buffer for getcwd */ + char tmp[LT_PATHMAX + 1]; + int tmp_len; + char *concat_name; + + LTWRAPPER_DEBUGPRINTF (("(find_executable) : %s\n", + wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!")); + + if ((wrapper == NULL) || (*wrapper == '\0')) + return NULL; + + /* Absolute path? */ +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') + { + concat_name = xstrdup (wrapper); + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } + else + { +#endif + if (IS_DIR_SEPARATOR (wrapper[0])) + { + concat_name = xstrdup (wrapper); + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + } +#endif + + for (p = wrapper; *p; p++) + if (*p == '/') + { + has_slash = 1; + break; + } + if (!has_slash) + { + /* no slashes; search PATH */ + const char *path = getenv ("PATH"); + if (path != NULL) + { + for (p = path; *p; p = p_next) + { + const char *q; + size_t p_len; + for (q = p; *q; q++) + if (IS_PATH_SEPARATOR (*q)) + break; + p_len = q - p; + p_next = (*q == '\0' ? q : q + 1); + if (p_len == 0) + { + /* empty path: current directory */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal ("getcwd failed"); + tmp_len = strlen (tmp); + concat_name = + XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + } + else + { + concat_name = + XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, p, p_len); + concat_name[p_len] = '/'; + strcpy (concat_name + p_len + 1, wrapper); + } + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } + } + /* not found in PATH; assume curdir */ + } + /* Relative path | not found in path: prepend cwd */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal ("getcwd failed"); + tmp_len = strlen (tmp); + concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + return NULL; +} + +char * +chase_symlinks (const char *pathspec) +{ +#ifndef S_ISLNK + return xstrdup (pathspec); +#else + char buf[LT_PATHMAX]; + struct stat s; + char *tmp_pathspec = xstrdup (pathspec); + char *p; + int has_symlinks = 0; + while (strlen (tmp_pathspec) && !has_symlinks) + { + LTWRAPPER_DEBUGPRINTF (("checking path component for symlinks: %s\n", + tmp_pathspec)); + if (lstat (tmp_pathspec, &s) == 0) + { + if (S_ISLNK (s.st_mode) != 0) + { + has_symlinks = 1; + break; + } + + /* search backwards for last DIR_SEPARATOR */ + p = tmp_pathspec + strlen (tmp_pathspec) - 1; + while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) + p--; + if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) + { + /* no more DIR_SEPARATORS left */ + break; + } + *p = '\0'; + } + else + { + char *errstr = strerror (errno); + lt_fatal ("Error accessing file %s (%s)", tmp_pathspec, errstr); + } + } + XFREE (tmp_pathspec); + + if (!has_symlinks) + { + return xstrdup (pathspec); + } + + tmp_pathspec = realpath (pathspec, buf); + if (tmp_pathspec == 0) + { + lt_fatal ("Could not follow symlinks for %s", pathspec); + } + return xstrdup (tmp_pathspec); +#endif +} + +char * +strendzap (char *str, const char *pat) +{ + size_t len, patlen; + + assert (str != NULL); + assert (pat != NULL); + + len = strlen (str); + patlen = strlen (pat); + + if (patlen <= len) + { + str += len - patlen; + if (strcmp (str, pat) == 0) + *str = '\0'; + } + return str; +} + +static void +lt_error_core (int exit_status, const char *mode, + const char *message, va_list ap) +{ + fprintf (stderr, "%s: %s: ", program_name, mode); + vfprintf (stderr, message, ap); + fprintf (stderr, ".\n"); + + if (exit_status >= 0) + exit (exit_status); +} + +void +lt_fatal (const char *message, ...) +{ + va_list ap; + va_start (ap, message); + lt_error_core (EXIT_FAILURE, "FATAL", message, ap); + va_end (ap); +} + +void +lt_setenv (const char *name, const char *value) +{ + LTWRAPPER_DEBUGPRINTF (("(lt_setenv) setting '%s' to '%s'\n", + (name ? name : ""), + (value ? value : ""))); + { +#ifdef HAVE_SETENV + /* always make a copy, for consistency with !HAVE_SETENV */ + char *str = xstrdup (value); + setenv (name, str, 1); +#else + int len = strlen (name) + 1 + strlen (value) + 1; + char *str = XMALLOC (char, len); + sprintf (str, "%s=%s", name, value); + if (putenv (str) != EXIT_SUCCESS) + { + XFREE (str); + } +#endif + } +} + +char * +lt_extend_str (const char *orig_value, const char *add, int to_end) +{ + char *new_value; + if (orig_value && *orig_value) + { + int orig_value_len = strlen (orig_value); + int add_len = strlen (add); + new_value = XMALLOC (char, add_len + orig_value_len + 1); + if (to_end) + { + strcpy (new_value, orig_value); + strcpy (new_value + orig_value_len, add); + } + else + { + strcpy (new_value, add); + strcpy (new_value + add_len, orig_value); + } + } + else + { + new_value = xstrdup (add); + } + return new_value; +} + +int +lt_split_name_value (const char *arg, char** name, char** value) +{ + const char *p; + int len; + if (!arg || !*arg) + return 1; + + p = strchr (arg, (int)'='); + + if (!p) + return 1; + + *value = xstrdup (++p); + + len = strlen (arg) - strlen (*value); + *name = XMALLOC (char, len); + strncpy (*name, arg, len-1); + (*name)[len - 1] = '\0'; + + return 0; +} + +void +lt_opt_process_env_set (const char *arg) +{ + char *name = NULL; + char *value = NULL; + + if (lt_split_name_value (arg, &name, &value) != 0) + { + XFREE (name); + XFREE (value); + lt_fatal ("bad argument for %s: '%s'", env_set_opt, arg); + } + + lt_setenv (name, value); + XFREE (name); + XFREE (value); +} + +void +lt_opt_process_env_prepend (const char *arg) +{ + char *name = NULL; + char *value = NULL; + char *new_value = NULL; + + if (lt_split_name_value (arg, &name, &value) != 0) + { + XFREE (name); + XFREE (value); + lt_fatal ("bad argument for %s: '%s'", env_prepend_opt, arg); + } + + new_value = lt_extend_str (getenv (name), value, 0); + lt_setenv (name, new_value); + XFREE (new_value); + XFREE (name); + XFREE (value); +} + +void +lt_opt_process_env_append (const char *arg) +{ + char *name = NULL; + char *value = NULL; + char *new_value = NULL; + + if (lt_split_name_value (arg, &name, &value) != 0) + { + XFREE (name); + XFREE (value); + lt_fatal ("bad argument for %s: '%s'", env_append_opt, arg); + } + + new_value = lt_extend_str (getenv (name), value, 1); + lt_setenv (name, new_value); + XFREE (new_value); + XFREE (name); + XFREE (value); +} + +void +lt_update_exe_path (const char *name, const char *value) +{ + LTWRAPPER_DEBUGPRINTF (("(lt_update_exe_path) modifying '%s' by prepending '%s'\n", + (name ? name : ""), + (value ? value : ""))); + + if (name && *name && value && *value) + { + char *new_value = lt_extend_str (getenv (name), value, 0); + /* some systems can't cope with a ':'-terminated path #' */ + int len = strlen (new_value); + while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) + { + new_value[len-1] = '\0'; + } + lt_setenv (name, new_value); + XFREE (new_value); + } +} + +void +lt_update_lib_path (const char *name, const char *value) +{ + LTWRAPPER_DEBUGPRINTF (("(lt_update_lib_path) modifying '%s' by prepending '%s'\n", + (name ? name : ""), + (value ? value : ""))); + + if (name && *name && value && *value) + { + char *new_value = lt_extend_str (getenv (name), value, 0); + lt_setenv (name, new_value); + XFREE (new_value); + } +} + + +EOF +} +# end: func_emit_cwrapperexe_src + +# func_mode_link arg... +func_mode_link () +{ + $opt_debug + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + # It is impossible to link a dll without this setting, and + # we shouldn't force the makefile maintainer to figure out + # which system we are compiling for in order to pass an extra + # flag for every libtool invocation. + # allow_undefined=no + + # FIXME: Unfortunately, there are problems with the above when trying + # to make a dll which has undefined symbols, in which case not + # even a static library is built. For now, we need to specify + # -no-undefined on the libtool link line when we can be certain + # that all symbols are satisfied, otherwise we get a static library. + allow_undefined=yes + ;; + *) + allow_undefined=yes + ;; + esac + libtool_args=$nonopt + base_compile="$nonopt $@" + compile_command=$nonopt + finalize_command=$nonopt + + compile_rpath= + finalize_rpath= + compile_shlibpath= + finalize_shlibpath= + convenience= + old_convenience= + deplibs= + old_deplibs= + compiler_flags= + linker_flags= + dllsearchpath= + lib_search_path=`pwd` + inst_prefix_dir= + new_inherited_linker_flags= + + avoid_version=no + dlfiles= + dlprefiles= + dlself=no + export_dynamic=no + export_symbols= + export_symbols_regex= + generated= + libobjs= + ltlibs= + module=no + no_install=no + objs= + non_pic_objects= + precious_files_regex= + prefer_static_libs=no + preload=no + prev= + prevarg= + release= + rpath= + xrpath= + perm_rpath= + temp_rpath= + thread_safe=no + vinfo= + vinfo_number=no + weak_libs= + single_module="${wl}-single_module" + func_infer_tag $base_compile + + # We need to know -static, to get the right output filenames. + for arg + do + case $arg in + -shared) + test "$build_libtool_libs" != yes && \ + func_fatal_configuration "can not build a shared library" + build_old_libs=no + break + ;; + -all-static | -static | -static-libtool-libs) + case $arg in + -all-static) + if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then + func_warning "complete static linking is impossible in this configuration" + fi + if test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + ;; + -static) + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=built + ;; + -static-libtool-libs) + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + ;; + esac + build_libtool_libs=no + build_old_libs=yes + break + ;; + esac + done + + # See if our shared archives depend on static archives. + test -n "$old_archive_from_new_cmds" && build_old_libs=yes + + # Go through the arguments, transforming them on the way. + while test "$#" -gt 0; do + arg="$1" + shift + func_quote_for_eval "$arg" + qarg=$func_quote_for_eval_unquoted_result + func_append libtool_args " $func_quote_for_eval_result" + + # If the previous option needs an argument, assign it. + if test -n "$prev"; then + case $prev in + output) + func_append compile_command " @OUTPUT@" + func_append finalize_command " @OUTPUT@" + ;; + esac + + case $prev in + dlfiles|dlprefiles) + if test "$preload" = no; then + # Add the symbol object into the linking commands. + func_append compile_command " @SYMFILE@" + func_append finalize_command " @SYMFILE@" + preload=yes + fi + case $arg in + *.la | *.lo) ;; # We handle these cases below. + force) + if test "$dlself" = no; then + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + self) + if test "$prev" = dlprefiles; then + dlself=yes + elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then + dlself=yes + else + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + *) + if test "$prev" = dlfiles; then + dlfiles="$dlfiles $arg" + else + dlprefiles="$dlprefiles $arg" + fi + prev= + continue + ;; + esac + ;; + expsyms) + export_symbols="$arg" + test -f "$arg" \ + || func_fatal_error "symbol file \`$arg' does not exist" + prev= + continue + ;; + expsyms_regex) + export_symbols_regex="$arg" + prev= + continue + ;; + framework) + case $host in + *-*-darwin*) + case "$deplibs " in + *" $qarg.ltframework "*) ;; + *) deplibs="$deplibs $qarg.ltframework" # this is fixed later + ;; + esac + ;; + esac + prev= + continue + ;; + inst_prefix) + inst_prefix_dir="$arg" + prev= + continue + ;; + objectlist) + if test -f "$arg"; then + save_arg=$arg + moreargs= + for fil in `cat "$save_arg"` + do +# moreargs="$moreargs $fil" + arg=$fil + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if func_lalib_unsafe_p "$arg"; then + pic_object= + non_pic_object= + + # Read the .lo file + func_source "$arg" + + if test -z "$pic_object" || + test -z "$non_pic_object" || + test "$pic_object" = none && + test "$non_pic_object" = none; then + func_fatal_error "cannot find name of object for \`$arg'" + fi + + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir="$func_dirname_result" + + if test "$pic_object" != none; then + # Prepend the subdirectory the object is found in. + pic_object="$xdir$pic_object" + + if test "$prev" = dlfiles; then + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then + dlfiles="$dlfiles $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test "$prev" = dlprefiles; then + # Preload the old-style object. + dlprefiles="$dlprefiles $pic_object" + prev= + fi + + # A PIC object. + func_append libobjs " $pic_object" + arg="$pic_object" + fi + + # Non-PIC object. + if test "$non_pic_object" != none; then + # Prepend the subdirectory the object is found in. + non_pic_object="$xdir$non_pic_object" + + # A standard non-PIC object + func_append non_pic_objects " $non_pic_object" + if test -z "$pic_object" || test "$pic_object" = none ; then + arg="$non_pic_object" + fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object="$pic_object" + func_append non_pic_objects " $non_pic_object" + fi + else + # Only an error if not doing a dry-run. + if $opt_dry_run; then + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir="$func_dirname_result" + + func_lo2o "$arg" + pic_object=$xdir$objdir/$func_lo2o_result + non_pic_object=$xdir$func_lo2o_result + func_append libobjs " $pic_object" + func_append non_pic_objects " $non_pic_object" + else + func_fatal_error "\`$arg' is not a valid libtool object" + fi + fi + done + else + func_fatal_error "link input file \`$arg' does not exist" + fi + arg=$save_arg + prev= + continue + ;; + precious_regex) + precious_files_regex="$arg" + prev= + continue + ;; + release) + release="-$arg" + prev= + continue + ;; + rpath | xrpath) + # We need an absolute path. + case $arg in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + func_fatal_error "only absolute run-paths are allowed" + ;; + esac + if test "$prev" = rpath; then + case "$rpath " in + *" $arg "*) ;; + *) rpath="$rpath $arg" ;; + esac + else + case "$xrpath " in + *" $arg "*) ;; + *) xrpath="$xrpath $arg" ;; + esac + fi + prev= + continue + ;; + shrext) + shrext_cmds="$arg" + prev= + continue + ;; + weak) + weak_libs="$weak_libs $arg" + prev= + continue + ;; + xcclinker) + linker_flags="$linker_flags $qarg" + compiler_flags="$compiler_flags $qarg" + prev= + func_append compile_command " $qarg" + func_append finalize_command " $qarg" + continue + ;; + xcompiler) + compiler_flags="$compiler_flags $qarg" + prev= + func_append compile_command " $qarg" + func_append finalize_command " $qarg" + continue + ;; + xlinker) + linker_flags="$linker_flags $qarg" + compiler_flags="$compiler_flags $wl$qarg" + prev= + func_append compile_command " $wl$qarg" + func_append finalize_command " $wl$qarg" + continue + ;; + *) + eval "$prev=\"\$arg\"" + prev= + continue + ;; + esac + fi # test -n "$prev" + + prevarg="$arg" + + case $arg in + -all-static) + if test -n "$link_static_flag"; then + # See comment for -static flag below, for more details. + func_append compile_command " $link_static_flag" + func_append finalize_command " $link_static_flag" + fi + continue + ;; + + -allow-undefined) + # FIXME: remove this flag sometime in the future. + func_fatal_error "\`-allow-undefined' must not be used because it is the default" + ;; + + -avoid-version) + avoid_version=yes + continue + ;; + + -dlopen) + prev=dlfiles + continue + ;; + + -dlpreopen) + prev=dlprefiles + continue + ;; + + -export-dynamic) + export_dynamic=yes + continue + ;; + + -export-symbols | -export-symbols-regex) + if test -n "$export_symbols" || test -n "$export_symbols_regex"; then + func_fatal_error "more than one -exported-symbols argument is not allowed" + fi + if test "X$arg" = "X-export-symbols"; then + prev=expsyms + else + prev=expsyms_regex + fi + continue + ;; + + -framework) + prev=framework + continue + ;; + + -inst-prefix-dir) + prev=inst_prefix + continue + ;; + + # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* + # so, if we see these flags be careful not to treat them like -L + -L[A-Z][A-Z]*:*) + case $with_gcc/$host in + no/*-*-irix* | /*-*-irix*) + func_append compile_command " $arg" + func_append finalize_command " $arg" + ;; + esac + continue + ;; + + -L*) + func_stripname '-L' '' "$arg" + dir=$func_stripname_result + if test -z "$dir"; then + if test "$#" -gt 0; then + func_fatal_error "require no space between \`-L' and \`$1'" + else + func_fatal_error "need path for \`-L' option" + fi + fi + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + absdir=`cd "$dir" && pwd` + test -z "$absdir" && \ + func_fatal_error "cannot determine absolute directory name of \`$dir'" + dir="$absdir" + ;; + esac + case "$deplibs " in + *" -L$dir "*) ;; + *) + deplibs="$deplibs -L$dir" + lib_search_path="$lib_search_path $dir" + ;; + esac + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + testbindir=`$ECHO "X$dir" | $Xsed -e 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$dir:"*) ;; + ::) dllsearchpath=$dir;; + *) dllsearchpath="$dllsearchpath:$dir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + ::) dllsearchpath=$testbindir;; + *) dllsearchpath="$dllsearchpath:$testbindir";; + esac + ;; + esac + continue + ;; + + -l*) + if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc*) + # These systems don't actually have a C or math library (as such) + continue + ;; + *-*-os2*) + # These systems don't actually have a C library (as such) + test "X$arg" = "X-lc" && continue + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc due to us having libc/libc_r. + test "X$arg" = "X-lc" && continue + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C and math libraries are in the System framework + deplibs="$deplibs System.ltframework" + continue + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + test "X$arg" = "X-lc" && continue + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + test "X$arg" = "X-lc" && continue + ;; + esac + elif test "X$arg" = "X-lc_r"; then + case $host in + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc_r directly, use -pthread flag. + continue + ;; + esac + fi + deplibs="$deplibs $arg" + continue + ;; + + -module) + module=yes + continue + ;; + + # Tru64 UNIX uses -model [arg] to determine the layout of C++ + # classes, name mangling, and exception handling. + # Darwin uses the -arch flag to determine output architecture. + -model|-arch|-isysroot) + compiler_flags="$compiler_flags $arg" + func_append compile_command " $arg" + func_append finalize_command " $arg" + prev=xcompiler + continue + ;; + + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) + compiler_flags="$compiler_flags $arg" + func_append compile_command " $arg" + func_append finalize_command " $arg" + case "$new_inherited_linker_flags " in + *" $arg "*) ;; + * ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;; + esac + continue + ;; + + -multi_module) + single_module="${wl}-multi_module" + continue + ;; + + -no-fast-install) + fast_install=no + continue + ;; + + -no-install) + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) + # The PATH hackery in wrapper scripts is required on Windows + # and Darwin in order for the loader to find any dlls it needs. + func_warning "\`-no-install' is ignored for $host" + func_warning "assuming \`-no-fast-install' instead" + fast_install=no + ;; + *) no_install=yes ;; + esac + continue + ;; + + -no-undefined) + allow_undefined=no + continue + ;; + + -objectlist) + prev=objectlist + continue + ;; + + -o) prev=output ;; + + -precious-files-regex) + prev=precious_regex + continue + ;; + + -release) + prev=release + continue + ;; + + -rpath) + prev=rpath + continue + ;; + + -R) + prev=xrpath + continue + ;; + + -R*) + func_stripname '-R' '' "$arg" + dir=$func_stripname_result + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + func_fatal_error "only absolute run-paths are allowed" + ;; + esac + case "$xrpath " in + *" $dir "*) ;; + *) xrpath="$xrpath $dir" ;; + esac + continue + ;; + + -shared) + # The effects of -shared are defined in a previous loop. + continue + ;; + + -shrext) + prev=shrext + continue + ;; + + -static | -static-libtool-libs) + # The effects of -static are defined in a previous loop. + # We used to do the same as -all-static on platforms that + # didn't have a PIC flag, but the assumption that the effects + # would be equivalent was wrong. It would break on at least + # Digital Unix and AIX. + continue + ;; + + -thread-safe) + thread_safe=yes + continue + ;; + + -version-info) + prev=vinfo + continue + ;; + + -version-number) + prev=vinfo + vinfo_number=yes + continue + ;; + + -weak) + prev=weak + continue + ;; + + -Wc,*) + func_stripname '-Wc,' '' "$arg" + args=$func_stripname_result + arg= + save_ifs="$IFS"; IFS=',' + for flag in $args; do + IFS="$save_ifs" + func_quote_for_eval "$flag" + arg="$arg $wl$func_quote_for_eval_result" + compiler_flags="$compiler_flags $func_quote_for_eval_result" + done + IFS="$save_ifs" + func_stripname ' ' '' "$arg" + arg=$func_stripname_result + ;; + + -Wl,*) + func_stripname '-Wl,' '' "$arg" + args=$func_stripname_result + arg= + save_ifs="$IFS"; IFS=',' + for flag in $args; do + IFS="$save_ifs" + func_quote_for_eval "$flag" + arg="$arg $wl$func_quote_for_eval_result" + compiler_flags="$compiler_flags $wl$func_quote_for_eval_result" + linker_flags="$linker_flags $func_quote_for_eval_result" + done + IFS="$save_ifs" + func_stripname ' ' '' "$arg" + arg=$func_stripname_result + ;; + + -Xcompiler) + prev=xcompiler + continue + ;; + + -Xlinker) + prev=xlinker + continue + ;; + + -XCClinker) + prev=xcclinker + continue + ;; + + # -msg_* for osf cc + -msg_*) + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + ;; + + # -64, -mips[0-9] enable 64-bit mode on the SGI compiler + # -r[0-9][0-9]* specifies the processor on the SGI compiler + # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler + # +DA*, +DD* enable 64-bit mode on the HP compiler + # -q* pass through compiler args for the IBM compiler + # -m*, -t[45]*, -txscale* pass through architecture-specific + # compiler args for GCC + # -F/path gives path to uninstalled frameworks, gcc on darwin + # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC + # @file GCC response files + -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ + -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*) + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + func_append compile_command " $arg" + func_append finalize_command " $arg" + compiler_flags="$compiler_flags $arg" + continue + ;; + + # Some other compiler flag. + -* | +*) + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + ;; + + *.$objext) + # A standard object. + objs="$objs $arg" + ;; + + *.lo) + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if func_lalib_unsafe_p "$arg"; then + pic_object= + non_pic_object= + + # Read the .lo file + func_source "$arg" + + if test -z "$pic_object" || + test -z "$non_pic_object" || + test "$pic_object" = none && + test "$non_pic_object" = none; then + func_fatal_error "cannot find name of object for \`$arg'" + fi + + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir="$func_dirname_result" + + if test "$pic_object" != none; then + # Prepend the subdirectory the object is found in. + pic_object="$xdir$pic_object" + + if test "$prev" = dlfiles; then + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then + dlfiles="$dlfiles $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test "$prev" = dlprefiles; then + # Preload the old-style object. + dlprefiles="$dlprefiles $pic_object" + prev= + fi + + # A PIC object. + func_append libobjs " $pic_object" + arg="$pic_object" + fi + + # Non-PIC object. + if test "$non_pic_object" != none; then + # Prepend the subdirectory the object is found in. + non_pic_object="$xdir$non_pic_object" + + # A standard non-PIC object + func_append non_pic_objects " $non_pic_object" + if test -z "$pic_object" || test "$pic_object" = none ; then + arg="$non_pic_object" + fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object="$pic_object" + func_append non_pic_objects " $non_pic_object" + fi + else + # Only an error if not doing a dry-run. + if $opt_dry_run; then + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir="$func_dirname_result" + + func_lo2o "$arg" + pic_object=$xdir$objdir/$func_lo2o_result + non_pic_object=$xdir$func_lo2o_result + func_append libobjs " $pic_object" + func_append non_pic_objects " $non_pic_object" + else + func_fatal_error "\`$arg' is not a valid libtool object" + fi + fi + ;; + + *.$libext) + # An archive. + deplibs="$deplibs $arg" + old_deplibs="$old_deplibs $arg" + continue + ;; + + *.la) + # A libtool-controlled library. + + if test "$prev" = dlfiles; then + # This library was specified with -dlopen. + dlfiles="$dlfiles $arg" + prev= + elif test "$prev" = dlprefiles; then + # The library was specified with -dlpreopen. + dlprefiles="$dlprefiles $arg" + prev= + else + deplibs="$deplibs $arg" + fi + continue + ;; + + # Some other compiler argument. + *) + # Unknown arguments in both finalize_command and compile_command need + # to be aesthetically quoted because they are evaled later. + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + ;; + esac # arg + + # Now actually substitute the argument into the commands. + if test -n "$arg"; then + func_append compile_command " $arg" + func_append finalize_command " $arg" + fi + done # argument parsing loop + + test -n "$prev" && \ + func_fatal_help "the \`$prevarg' option requires an argument" + + if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then + eval arg=\"$export_dynamic_flag_spec\" + func_append compile_command " $arg" + func_append finalize_command " $arg" + fi + + oldlibs= + # calculate the name of the file, without its directory + func_basename "$output" + outputname="$func_basename_result" + libobjs_save="$libobjs" + + if test -n "$shlibpath_var"; then + # get the directories listed in $shlibpath_var + eval shlib_search_path=\`\$ECHO \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` + else + shlib_search_path= + fi + eval sys_lib_search_path=\"$sys_lib_search_path_spec\" + eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" + + func_dirname "$output" "/" "" + output_objdir="$func_dirname_result$objdir" + # Create the object directory. + func_mkdir_p "$output_objdir" + + # Determine the type of output + case $output in + "") + func_fatal_help "you must specify an output file" + ;; + *.$libext) linkmode=oldlib ;; + *.lo | *.$objext) linkmode=obj ;; + *.la) linkmode=lib ;; + *) linkmode=prog ;; # Anything else should be a program. + esac + + specialdeplibs= + + libs= + # Find all interdependent deplibs by searching for libraries + # that are linked more than once (e.g. -la -lb -la) + for deplib in $deplibs; do + if $opt_duplicate_deps ; then + case "$libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + libs="$libs $deplib" + done + + if test "$linkmode" = lib; then + libs="$predeps $libs $compiler_lib_search_path $postdeps" + + # Compute libraries that are listed more than once in $predeps + # $postdeps and mark them as special (i.e., whose duplicates are + # not to be eliminated). + pre_post_deps= + if $opt_duplicate_compiler_generated_deps; then + for pre_post_dep in $predeps $postdeps; do + case "$pre_post_deps " in + *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; + esac + pre_post_deps="$pre_post_deps $pre_post_dep" + done + fi + pre_post_deps= + fi + + deplibs= + newdependency_libs= + newlib_search_path= + need_relink=no # whether we're linking any uninstalled libtool libraries + notinst_deplibs= # not-installed libtool libraries + notinst_path= # paths that contain not-installed libtool libraries + + case $linkmode in + lib) + passes="conv dlpreopen link" + for file in $dlfiles $dlprefiles; do + case $file in + *.la) ;; + *) + func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" + ;; + esac + done + ;; + prog) + compile_deplibs= + finalize_deplibs= + alldeplibs=no + newdlfiles= + newdlprefiles= + passes="conv scan dlopen dlpreopen link" + ;; + *) passes="conv" + ;; + esac + + for pass in $passes; do + # The preopen pass in lib mode reverses $deplibs; put it back here + # so that -L comes before libs that need it for instance... + if test "$linkmode,$pass" = "lib,link"; then + ## FIXME: Find the place where the list is rebuilt in the wrong + ## order, and fix it there properly + tmp_deplibs= + for deplib in $deplibs; do + tmp_deplibs="$deplib $tmp_deplibs" + done + deplibs="$tmp_deplibs" + fi + + if test "$linkmode,$pass" = "lib,link" || + test "$linkmode,$pass" = "prog,scan"; then + libs="$deplibs" + deplibs= + fi + if test "$linkmode" = prog; then + case $pass in + dlopen) libs="$dlfiles" ;; + dlpreopen) libs="$dlprefiles" ;; + link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; + esac + fi + if test "$linkmode,$pass" = "lib,dlpreopen"; then + # Collect and forward deplibs of preopened libtool libs + for lib in $dlprefiles; do + # Ignore non-libtool-libs + dependency_libs= + case $lib in + *.la) func_source "$lib" ;; + esac + + # Collect preopened libtool deplibs, except any this library + # has declared as weak libs + for deplib in $dependency_libs; do + deplib_base=`$ECHO "X$deplib" | $Xsed -e "$basename"` + case " $weak_libs " in + *" $deplib_base "*) ;; + *) deplibs="$deplibs $deplib" ;; + esac + done + done + libs="$dlprefiles" + fi + if test "$pass" = dlopen; then + # Collect dlpreopened libraries + save_deplibs="$deplibs" + deplibs= + fi + + for deplib in $libs; do + lib= + found=no + case $deplib in + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + compiler_flags="$compiler_flags $deplib" + if test "$linkmode" = lib ; then + case "$new_inherited_linker_flags " in + *" $deplib "*) ;; + * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;; + esac + fi + fi + continue + ;; + -l*) + if test "$linkmode" != lib && test "$linkmode" != prog; then + func_warning "\`-l' is ignored for archives/objects" + continue + fi + func_stripname '-l' '' "$deplib" + name=$func_stripname_result + if test "$linkmode" = lib; then + searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" + else + searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" + fi + for searchdir in $searchdirs; do + for search_ext in .la $std_shrext .so .a; do + # Search the libtool library + lib="$searchdir/lib${name}${search_ext}" + if test -f "$lib"; then + if test "$search_ext" = ".la"; then + found=yes + else + found=no + fi + break 2 + fi + done + done + if test "$found" != yes; then + # deplib doesn't seem to be a libtool library + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" + fi + continue + else # deplib is a libtool library + # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, + # We need to do some special things here, and not later. + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + case " $predeps $postdeps " in + *" $deplib "*) + if func_lalib_p "$lib"; then + library_names= + old_library= + func_source "$lib" + for l in $old_library $library_names; do + ll="$l" + done + if test "X$ll" = "X$old_library" ; then # only static version available + found=no + func_dirname "$lib" "" "." + ladir="$func_dirname_result" + lib=$ladir/$old_library + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" + fi + continue + fi + fi + ;; + *) ;; + esac + fi + fi + ;; # -l + *.ltframework) + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + if test "$linkmode" = lib ; then + case "$new_inherited_linker_flags " in + *" $deplib "*) ;; + * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;; + esac + fi + fi + continue + ;; + -L*) + case $linkmode in + lib) + deplibs="$deplib $deplibs" + test "$pass" = conv && continue + newdependency_libs="$deplib $newdependency_libs" + func_stripname '-L' '' "$deplib" + newlib_search_path="$newlib_search_path $func_stripname_result" + ;; + prog) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + continue + fi + if test "$pass" = scan; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + func_stripname '-L' '' "$deplib" + newlib_search_path="$newlib_search_path $func_stripname_result" + ;; + *) + func_warning "\`-L' is ignored for archives/objects" + ;; + esac # linkmode + continue + ;; # -L + -R*) + if test "$pass" = link; then + func_stripname '-R' '' "$deplib" + dir=$func_stripname_result + # Make sure the xrpath contains only unique directories. + case "$xrpath " in + *" $dir "*) ;; + *) xrpath="$xrpath $dir" ;; + esac + fi + deplibs="$deplib $deplibs" + continue + ;; + *.la) lib="$deplib" ;; + *.$libext) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + continue + fi + case $linkmode in + lib) + # Linking convenience modules into shared libraries is allowed, + # but linking other static libraries is non-portable. + case " $dlpreconveniencelibs " in + *" $deplib "*) ;; + *) + valid_a_lib=no + case $deplibs_check_method in + match_pattern*) + set dummy $deplibs_check_method; shift + match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` + if eval "\$ECHO \"X$deplib\"" 2>/dev/null | $Xsed -e 10q \ + | $EGREP "$match_pattern_regex" > /dev/null; then + valid_a_lib=yes + fi + ;; + pass_all) + valid_a_lib=yes + ;; + esac + if test "$valid_a_lib" != yes; then + $ECHO + $ECHO "*** Warning: Trying to link with static lib archive $deplib." + $ECHO "*** I have the capability to make that library automatically link in when" + $ECHO "*** you link to this library. But I can only do this if you have a" + $ECHO "*** shared version of the library, which you do not appear to have" + $ECHO "*** because the file extensions .$libext of this argument makes me believe" + $ECHO "*** that it is just a static archive that I should not use here." + else + $ECHO + $ECHO "*** Warning: Linking the shared library $output against the" + $ECHO "*** static library $deplib is not portable!" + deplibs="$deplib $deplibs" + fi + ;; + esac + continue + ;; + prog) + if test "$pass" != link; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + continue + ;; + esac # linkmode + ;; # *.$libext + *.lo | *.$objext) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + elif test "$linkmode" = prog; then + if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then + # If there is no dlopen support or we're linking statically, + # we need to preload. + newdlprefiles="$newdlprefiles $deplib" + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + newdlfiles="$newdlfiles $deplib" + fi + fi + continue + ;; + %DEPLIBS%) + alldeplibs=yes + continue + ;; + esac # case $deplib + + if test "$found" = yes || test -f "$lib"; then : + else + func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" + fi + + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$lib" \ + || func_fatal_error "\`$lib' is not a valid libtool archive" + + func_dirname "$lib" "" "." + ladir="$func_dirname_result" + + dlname= + dlopen= + dlpreopen= + libdir= + library_names= + old_library= + inherited_linker_flags= + # If the library was installed with an old release of libtool, + # it will not redefine variables installed, or shouldnotlink + installed=yes + shouldnotlink=no + avoidtemprpath= + + + # Read the .la file + func_source "$lib" + + # Convert "-framework foo" to "foo.ltframework" + if test -n "$inherited_linker_flags"; then + tmp_inherited_linker_flags=`$ECHO "X$inherited_linker_flags" | $Xsed -e 's/-framework \([^ $]*\)/\1.ltframework/g'` + for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do + case " $new_inherited_linker_flags " in + *" $tmp_inherited_linker_flag "*) ;; + *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";; + esac + done + fi + dependency_libs=`$ECHO "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` + if test "$linkmode,$pass" = "lib,link" || + test "$linkmode,$pass" = "prog,scan" || + { test "$linkmode" != prog && test "$linkmode" != lib; }; then + test -n "$dlopen" && dlfiles="$dlfiles $dlopen" + test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" + fi + + if test "$pass" = conv; then + # Only check for convenience libraries + deplibs="$lib $deplibs" + if test -z "$libdir"; then + if test -z "$old_library"; then + func_fatal_error "cannot find name of link library for \`$lib'" + fi + # It is a libtool convenience library, so add in its objects. + convenience="$convenience $ladir/$objdir/$old_library" + old_convenience="$old_convenience $ladir/$objdir/$old_library" + elif test "$linkmode" != prog && test "$linkmode" != lib; then + func_fatal_error "\`$lib' is not a convenience library" + fi + tmp_libs= + for deplib in $dependency_libs; do + deplibs="$deplib $deplibs" + if $opt_duplicate_deps ; then + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + tmp_libs="$tmp_libs $deplib" + done + continue + fi # $pass = conv + + + # Get the name of the library we link against. + linklib= + for l in $old_library $library_names; do + linklib="$l" + done + if test -z "$linklib"; then + func_fatal_error "cannot find name of link library for \`$lib'" + fi + + # This library was specified with -dlopen. + if test "$pass" = dlopen; then + if test -z "$libdir"; then + func_fatal_error "cannot -dlopen a convenience library: \`$lib'" + fi + if test -z "$dlname" || + test "$dlopen_support" != yes || + test "$build_libtool_libs" = no; then + # If there is no dlname, no dlopen support or we're linking + # statically, we need to preload. We also need to preload any + # dependent libraries so libltdl's deplib preloader doesn't + # bomb out in the load deplibs phase. + dlprefiles="$dlprefiles $lib $dependency_libs" + else + newdlfiles="$newdlfiles $lib" + fi + continue + fi # $pass = dlopen + + # We need an absolute path. + case $ladir in + [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; + *) + abs_ladir=`cd "$ladir" && pwd` + if test -z "$abs_ladir"; then + func_warning "cannot determine absolute directory name of \`$ladir'" + func_warning "passing it literally to the linker, although it might fail" + abs_ladir="$ladir" + fi + ;; + esac + func_basename "$lib" + laname="$func_basename_result" + + # Find the relevant object directory and library name. + if test "X$installed" = Xyes; then + if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then + func_warning "library \`$lib' was moved." + dir="$ladir" + absdir="$abs_ladir" + libdir="$abs_ladir" + else + dir="$libdir" + absdir="$libdir" + fi + test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes + else + if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then + dir="$ladir" + absdir="$abs_ladir" + # Remove this search path later + notinst_path="$notinst_path $abs_ladir" + else + dir="$ladir/$objdir" + absdir="$abs_ladir/$objdir" + # Remove this search path later + notinst_path="$notinst_path $abs_ladir" + fi + fi # $installed = yes + func_stripname 'lib' '.la' "$laname" + name=$func_stripname_result + + # This library was specified with -dlpreopen. + if test "$pass" = dlpreopen; then + if test -z "$libdir" && test "$linkmode" = prog; then + func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" + fi + # Prefer using a static library (so that no silly _DYNAMIC symbols + # are required to link). + if test -n "$old_library"; then + newdlprefiles="$newdlprefiles $dir/$old_library" + # Keep a list of preopened convenience libraries to check + # that they are being used correctly in the link pass. + test -z "$libdir" && \ + dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library" + # Otherwise, use the dlname, so that lt_dlopen finds it. + elif test -n "$dlname"; then + newdlprefiles="$newdlprefiles $dir/$dlname" + else + newdlprefiles="$newdlprefiles $dir/$linklib" + fi + fi # $pass = dlpreopen + + if test -z "$libdir"; then + # Link the convenience library + if test "$linkmode" = lib; then + deplibs="$dir/$old_library $deplibs" + elif test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$dir/$old_library $compile_deplibs" + finalize_deplibs="$dir/$old_library $finalize_deplibs" + else + deplibs="$lib $deplibs" # used for prog,scan pass + fi + continue + fi + + + if test "$linkmode" = prog && test "$pass" != link; then + newlib_search_path="$newlib_search_path $ladir" + deplibs="$lib $deplibs" + + linkalldeplibs=no + if test "$link_all_deplibs" != no || test -z "$library_names" || + test "$build_libtool_libs" = no; then + linkalldeplibs=yes + fi + + tmp_libs= + for deplib in $dependency_libs; do + case $deplib in + -L*) func_stripname '-L' '' "$deplib" + newlib_search_path="$newlib_search_path $func_stripname_result" + ;; + esac + # Need to link against all dependency_libs? + if test "$linkalldeplibs" = yes; then + deplibs="$deplib $deplibs" + else + # Need to hardcode shared library paths + # or/and link against static libraries + newdependency_libs="$deplib $newdependency_libs" + fi + if $opt_duplicate_deps ; then + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + tmp_libs="$tmp_libs $deplib" + done # for deplib + continue + fi # $linkmode = prog... + + if test "$linkmode,$pass" = "prog,link"; then + if test -n "$library_names" && + { { test "$prefer_static_libs" = no || + test "$prefer_static_libs,$installed" = "built,yes"; } || + test -z "$old_library"; }; then + # We need to hardcode the library path + if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then + # Make sure the rpath contains only unique directories. + case "$temp_rpath:" in + *"$absdir:"*) ;; + *) temp_rpath="$temp_rpath$absdir:" ;; + esac + fi + + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) compile_rpath="$compile_rpath $absdir" + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" + esac + ;; + esac + fi # $linkmode,$pass = prog,link... + + if test "$alldeplibs" = yes && + { test "$deplibs_check_method" = pass_all || + { test "$build_libtool_libs" = yes && + test -n "$library_names"; }; }; then + # We only need to search for static libraries + continue + fi + fi + + link_static=no # Whether the deplib will be linked statically + use_static_libs=$prefer_static_libs + if test "$use_static_libs" = built && test "$installed" = yes; then + use_static_libs=no + fi + if test -n "$library_names" && + { test "$use_static_libs" = no || test -z "$old_library"; }; then + case $host in + *cygwin* | *mingw* | *cegcc*) + # No point in relinking DLLs because paths are not encoded + notinst_deplibs="$notinst_deplibs $lib" + need_relink=no + ;; + *) + if test "$installed" = no; then + notinst_deplibs="$notinst_deplibs $lib" + need_relink=yes + fi + ;; + esac + # This is a shared library + + # Warn about portability, can't link against -module's on some + # systems (darwin). Don't bleat about dlopened modules though! + dlopenmodule="" + for dlpremoduletest in $dlprefiles; do + if test "X$dlpremoduletest" = "X$lib"; then + dlopenmodule="$dlpremoduletest" + break + fi + done + if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then + $ECHO + if test "$linkmode" = prog; then + $ECHO "*** Warning: Linking the executable $output against the loadable module" + else + $ECHO "*** Warning: Linking the shared library $output against the loadable module" + fi + $ECHO "*** $linklib is not portable!" + fi + if test "$linkmode" = lib && + test "$hardcode_into_libs" = yes; then + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) compile_rpath="$compile_rpath $absdir" + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" + esac + ;; + esac + fi + + if test -n "$old_archive_from_expsyms_cmds"; then + # figure out the soname + set dummy $library_names + shift + realname="$1" + shift + libname=`eval "\\$ECHO \"$libname_spec\""` + # use dlname if we got it. it's perfectly good, no? + if test -n "$dlname"; then + soname="$dlname" + elif test -n "$soname_spec"; then + # bleh windows + case $host in + *cygwin* | mingw* | *cegcc*) + func_arith $current - $age + major=$func_arith_result + versuffix="-$major" + ;; + esac + eval soname=\"$soname_spec\" + else + soname="$realname" + fi + + # Make a new name for the extract_expsyms_cmds to use + soroot="$soname" + func_basename "$soroot" + soname="$func_basename_result" + func_stripname 'lib' '.dll' "$soname" + newlib=libimp-$func_stripname_result.a + + # If the library has no export list, then create one now + if test -f "$output_objdir/$soname-def"; then : + else + func_verbose "extracting exported symbol list from \`$soname'" + func_execute_cmds "$extract_expsyms_cmds" 'exit $?' + fi + + # Create $newlib + if test -f "$output_objdir/$newlib"; then :; else + func_verbose "generating import library for \`$soname'" + func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' + fi + # make sure the library variables are pointing to the new library + dir=$output_objdir + linklib=$newlib + fi # test -n "$old_archive_from_expsyms_cmds" + + if test "$linkmode" = prog || test "$mode" != relink; then + add_shlibpath= + add_dir= + add= + lib_linked=yes + case $hardcode_action in + immediate | unsupported) + if test "$hardcode_direct" = no; then + add="$dir/$linklib" + case $host in + *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; + *-*-sysv4*uw2*) add_dir="-L$dir" ;; + *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ + *-*-unixware7*) add_dir="-L$dir" ;; + *-*-darwin* ) + # if the lib is a (non-dlopened) module then we can not + # link against it, someone is ignoring the earlier warnings + if /usr/bin/file -L $add 2> /dev/null | + $GREP ": [^:]* bundle" >/dev/null ; then + if test "X$dlopenmodule" != "X$lib"; then + $ECHO "*** Warning: lib $linklib is a module, not a shared library" + if test -z "$old_library" ; then + $ECHO + $ECHO "*** And there doesn't seem to be a static archive available" + $ECHO "*** The link will probably fail, sorry" + else + add="$dir/$old_library" + fi + elif test -n "$old_library"; then + add="$dir/$old_library" + fi + fi + esac + elif test "$hardcode_minus_L" = no; then + case $host in + *-*-sunos*) add_shlibpath="$dir" ;; + esac + add_dir="-L$dir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = no; then + add_shlibpath="$dir" + add="-l$name" + else + lib_linked=no + fi + ;; + relink) + if test "$hardcode_direct" = yes && + test "$hardcode_direct_absolute" = no; then + add="$dir/$linklib" + elif test "$hardcode_minus_L" = yes; then + add_dir="-L$dir" + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in + [\\/]*) + add_dir="$add_dir -L$inst_prefix_dir$libdir" + ;; + esac + fi + add="-l$name" + elif test "$hardcode_shlibpath_var" = yes; then + add_shlibpath="$dir" + add="-l$name" + else + lib_linked=no + fi + ;; + *) lib_linked=no ;; + esac + + if test "$lib_linked" != yes; then + func_fatal_configuration "unsupported hardcode properties" + fi + + if test -n "$add_shlibpath"; then + case :$compile_shlibpath: in + *":$add_shlibpath:"*) ;; + *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; + esac + fi + if test "$linkmode" = prog; then + test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" + test -n "$add" && compile_deplibs="$add $compile_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + if test "$hardcode_direct" != yes && + test "$hardcode_minus_L" != yes && + test "$hardcode_shlibpath_var" = yes; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; + esac + fi + fi + fi + + if test "$linkmode" = prog || test "$mode" = relink; then + add_shlibpath= + add_dir= + add= + # Finalize command for both is simple: just hardcode it. + if test "$hardcode_direct" = yes && + test "$hardcode_direct_absolute" = no; then + add="$libdir/$linklib" + elif test "$hardcode_minus_L" = yes; then + add_dir="-L$libdir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = yes; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; + esac + add="-l$name" + elif test "$hardcode_automatic" = yes; then + if test -n "$inst_prefix_dir" && + test -f "$inst_prefix_dir$libdir/$linklib" ; then + add="$inst_prefix_dir$libdir/$linklib" + else + add="$libdir/$linklib" + fi + else + # We cannot seem to hardcode it, guess we'll fake it. + add_dir="-L$libdir" + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in + [\\/]*) + add_dir="$add_dir -L$inst_prefix_dir$libdir" + ;; + esac + fi + add="-l$name" + fi + + if test "$linkmode" = prog; then + test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" + test -n "$add" && finalize_deplibs="$add $finalize_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + fi + fi + elif test "$linkmode" = prog; then + # Here we assume that one of hardcode_direct or hardcode_minus_L + # is not unsupported. This is valid on all known static and + # shared platforms. + if test "$hardcode_direct" != unsupported; then + test -n "$old_library" && linklib="$old_library" + compile_deplibs="$dir/$linklib $compile_deplibs" + finalize_deplibs="$dir/$linklib $finalize_deplibs" + else + compile_deplibs="-l$name -L$dir $compile_deplibs" + finalize_deplibs="-l$name -L$dir $finalize_deplibs" + fi + elif test "$build_libtool_libs" = yes; then + # Not a shared library + if test "$deplibs_check_method" != pass_all; then + # We're trying link a shared library against a static one + # but the system doesn't support it. + + # Just print a warning and add the library to dependency_libs so + # that the program can be linked against the static library. + $ECHO + $ECHO "*** Warning: This system can not link to static lib archive $lib." + $ECHO "*** I have the capability to make that library automatically link in when" + $ECHO "*** you link to this library. But I can only do this if you have a" + $ECHO "*** shared version of the library, which you do not appear to have." + if test "$module" = yes; then + $ECHO "*** But as you try to build a module library, libtool will still create " + $ECHO "*** a static module, that should work as long as the dlopening application" + $ECHO "*** is linked with the -dlopen flag to resolve symbols at runtime." + if test -z "$global_symbol_pipe"; then + $ECHO + $ECHO "*** However, this would only work if libtool was able to extract symbol" + $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could" + $ECHO "*** not find such a program. So, this module is probably useless." + $ECHO "*** \`nm' from GNU binutils and a full rebuild may help." + fi + if test "$build_old_libs" = no; then + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + else + deplibs="$dir/$old_library $deplibs" + link_static=yes + fi + fi # link shared/static library? + + if test "$linkmode" = lib; then + if test -n "$dependency_libs" && + { test "$hardcode_into_libs" != yes || + test "$build_old_libs" = yes || + test "$link_static" = yes; }; then + # Extract -R from dependency_libs + temp_deplibs= + for libdir in $dependency_libs; do + case $libdir in + -R*) func_stripname '-R' '' "$libdir" + temp_xrpath=$func_stripname_result + case " $xrpath " in + *" $temp_xrpath "*) ;; + *) xrpath="$xrpath $temp_xrpath";; + esac;; + *) temp_deplibs="$temp_deplibs $libdir";; + esac + done + dependency_libs="$temp_deplibs" + fi + + newlib_search_path="$newlib_search_path $absdir" + # Link against this library + test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" + # ... and its dependency_libs + tmp_libs= + for deplib in $dependency_libs; do + newdependency_libs="$deplib $newdependency_libs" + if $opt_duplicate_deps ; then + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + tmp_libs="$tmp_libs $deplib" + done + + if test "$link_all_deplibs" != no; then + # Add the search paths of all dependency libraries + for deplib in $dependency_libs; do + case $deplib in + -L*) path="$deplib" ;; + *.la) + func_dirname "$deplib" "" "." + dir="$func_dirname_result" + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; + *) + absdir=`cd "$dir" && pwd` + if test -z "$absdir"; then + func_warning "cannot determine absolute directory name of \`$dir'" + absdir="$dir" + fi + ;; + esac + if $GREP "^installed=no" $deplib > /dev/null; then + case $host in + *-*-darwin*) + depdepl= + eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` + if test -n "$deplibrary_names" ; then + for tmp in $deplibrary_names ; do + depdepl=$tmp + done + if test -f "$absdir/$objdir/$depdepl" ; then + depdepl="$absdir/$objdir/$depdepl" + darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` + if test -z "$darwin_install_name"; then + darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` + fi + compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" + linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}" + path= + fi + fi + ;; + *) + path="-L$absdir/$objdir" + ;; + esac + else + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + test -z "$libdir" && \ + func_fatal_error "\`$deplib' is not a valid libtool archive" + test "$absdir" != "$libdir" && \ + func_warning "\`$deplib' seems to be moved" + + path="-L$absdir" + fi + ;; + esac + case " $deplibs " in + *" $path "*) ;; + *) deplibs="$path $deplibs" ;; + esac + done + fi # link_all_deplibs != no + fi # linkmode = lib + done # for deplib in $libs + if test "$pass" = link; then + if test "$linkmode" = "prog"; then + compile_deplibs="$new_inherited_linker_flags $compile_deplibs" + finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" + else + compiler_flags="$compiler_flags "`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` + fi + fi + dependency_libs="$newdependency_libs" + if test "$pass" = dlpreopen; then + # Link the dlpreopened libraries before other libraries + for deplib in $save_deplibs; do + deplibs="$deplib $deplibs" + done + fi + if test "$pass" != dlopen; then + if test "$pass" != conv; then + # Make sure lib_search_path contains only unique directories. + lib_search_path= + for dir in $newlib_search_path; do + case "$lib_search_path " in + *" $dir "*) ;; + *) lib_search_path="$lib_search_path $dir" ;; + esac + done + newlib_search_path= + fi + + if test "$linkmode,$pass" != "prog,link"; then + vars="deplibs" + else + vars="compile_deplibs finalize_deplibs" + fi + for var in $vars dependency_libs; do + # Add libraries to $var in reverse order + eval tmp_libs=\"\$$var\" + new_libs= + for deplib in $tmp_libs; do + # FIXME: Pedantically, this is the right thing to do, so + # that some nasty dependency loop isn't accidentally + # broken: + #new_libs="$deplib $new_libs" + # Pragmatically, this seems to cause very few problems in + # practice: + case $deplib in + -L*) new_libs="$deplib $new_libs" ;; + -R*) ;; + *) + # And here is the reason: when a library appears more + # than once as an explicit dependence of a library, or + # is implicitly linked in more than once by the + # compiler, it is considered special, and multiple + # occurrences thereof are not removed. Compare this + # with having the same library being listed as a + # dependency of multiple other libraries: in this case, + # we know (pedantically, we assume) the library does not + # need to be listed more than once, so we keep only the + # last copy. This is not always right, but it is rare + # enough that we require users that really mean to play + # such unportable linking tricks to link the library + # using -Wl,-lname, so that libtool does not consider it + # for duplicate removal. + case " $specialdeplibs " in + *" $deplib "*) new_libs="$deplib $new_libs" ;; + *) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$deplib $new_libs" ;; + esac + ;; + esac + ;; + esac + done + tmp_libs= + for deplib in $new_libs; do + case $deplib in + -L*) + case " $tmp_libs " in + *" $deplib "*) ;; + *) tmp_libs="$tmp_libs $deplib" ;; + esac + ;; + *) tmp_libs="$tmp_libs $deplib" ;; + esac + done + eval $var=\"$tmp_libs\" + done # for var + fi + # Last step: remove runtime libs from dependency_libs + # (they stay in deplibs) + tmp_libs= + for i in $dependency_libs ; do + case " $predeps $postdeps $compiler_lib_search_path " in + *" $i "*) + i="" + ;; + esac + if test -n "$i" ; then + tmp_libs="$tmp_libs $i" + fi + done + dependency_libs=$tmp_libs + done # for pass + if test "$linkmode" = prog; then + dlfiles="$newdlfiles" + fi + if test "$linkmode" = prog || test "$linkmode" = lib; then + dlprefiles="$newdlprefiles" + fi + + case $linkmode in + oldlib) + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + func_warning "\`-dlopen' is ignored for archives" + fi + + case " $deplibs" in + *\ -l* | *\ -L*) + func_warning "\`-l' and \`-L' are ignored for archives" ;; + esac + + test -n "$rpath" && \ + func_warning "\`-rpath' is ignored for archives" + + test -n "$xrpath" && \ + func_warning "\`-R' is ignored for archives" + + test -n "$vinfo" && \ + func_warning "\`-version-info/-version-number' is ignored for archives" + + test -n "$release" && \ + func_warning "\`-release' is ignored for archives" + + test -n "$export_symbols$export_symbols_regex" && \ + func_warning "\`-export-symbols' is ignored for archives" + + # Now set the variables for building old libraries. + build_libtool_libs=no + oldlibs="$output" + objs="$objs$old_deplibs" + ;; + + lib) + # Make sure we only generate libraries of the form `libNAME.la'. + case $outputname in + lib*) + func_stripname 'lib' '.la' "$outputname" + name=$func_stripname_result + eval shared_ext=\"$shrext_cmds\" + eval libname=\"$libname_spec\" + ;; + *) + test "$module" = no && \ + func_fatal_help "libtool library \`$output' must begin with \`lib'" + + if test "$need_lib_prefix" != no; then + # Add the "lib" prefix for modules if required + func_stripname '' '.la' "$outputname" + name=$func_stripname_result + eval shared_ext=\"$shrext_cmds\" + eval libname=\"$libname_spec\" + else + func_stripname '' '.la' "$outputname" + libname=$func_stripname_result + fi + ;; + esac + + if test -n "$objs"; then + if test "$deplibs_check_method" != pass_all; then + func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" + else + $ECHO + $ECHO "*** Warning: Linking the shared library $output against the non-libtool" + $ECHO "*** objects $objs is not portable!" + libobjs="$libobjs $objs" + fi + fi + + test "$dlself" != no && \ + func_warning "\`-dlopen self' is ignored for libtool libraries" + + set dummy $rpath + shift + test "$#" -gt 1 && \ + func_warning "ignoring multiple \`-rpath's for a libtool library" + + install_libdir="$1" + + oldlibs= + if test -z "$rpath"; then + if test "$build_libtool_libs" = yes; then + # Building a libtool convenience library. + # Some compilers have problems with a `.al' extension so + # convenience libraries should have the same extension an + # archive normally would. + oldlibs="$output_objdir/$libname.$libext $oldlibs" + build_libtool_libs=convenience + build_old_libs=yes + fi + + test -n "$vinfo" && \ + func_warning "\`-version-info/-version-number' is ignored for convenience libraries" + + test -n "$release" && \ + func_warning "\`-release' is ignored for convenience libraries" + else + + # Parse the version information argument. + save_ifs="$IFS"; IFS=':' + set dummy $vinfo 0 0 0 + shift + IFS="$save_ifs" + + test -n "$7" && \ + func_fatal_help "too many parameters to \`-version-info'" + + # convert absolute version numbers to libtool ages + # this retains compatibility with .la files and attempts + # to make the code below a bit more comprehensible + + case $vinfo_number in + yes) + number_major="$1" + number_minor="$2" + number_revision="$3" + # + # There are really only two kinds -- those that + # use the current revision as the major version + # and those that subtract age and use age as + # a minor version. But, then there is irix + # which has an extra 1 added just for fun + # + case $version_type in + darwin|linux|osf|windows|none) + func_arith $number_major + $number_minor + current=$func_arith_result + age="$number_minor" + revision="$number_revision" + ;; + freebsd-aout|freebsd-elf|sunos) + current="$number_major" + revision="$number_minor" + age="0" + ;; + irix|nonstopux) + func_arith $number_major + $number_minor + current=$func_arith_result + age="$number_minor" + revision="$number_minor" + lt_irix_increment=no + ;; + esac + ;; + no) + current="$1" + revision="$2" + age="$3" + ;; + esac + + # Check that each of the things are valid numbers. + case $current in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "CURRENT \`$current' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" + ;; + esac + + case $revision in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "REVISION \`$revision' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" + ;; + esac + + case $age in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "AGE \`$age' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" + ;; + esac + + if test "$age" -gt "$current"; then + func_error "AGE \`$age' is greater than the current interface number \`$current'" + func_fatal_error "\`$vinfo' is not valid version information" + fi + + # Calculate the version variables. + major= + versuffix= + verstring= + case $version_type in + none) ;; + + darwin) + # Like Linux, but with the current version available in + # verstring for coding it into the library header + func_arith $current - $age + major=.$func_arith_result + versuffix="$major.$age.$revision" + # Darwin ld doesn't like 0 for these options... + func_arith $current + 1 + minor_current=$func_arith_result + xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" + verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" + ;; + + freebsd-aout) + major=".$current" + versuffix=".$current.$revision"; + ;; + + freebsd-elf) + major=".$current" + versuffix=".$current" + ;; + + irix | nonstopux) + if test "X$lt_irix_increment" = "Xno"; then + func_arith $current - $age + else + func_arith $current - $age + 1 + fi + major=$func_arith_result + + case $version_type in + nonstopux) verstring_prefix=nonstopux ;; + *) verstring_prefix=sgi ;; + esac + verstring="$verstring_prefix$major.$revision" + + # Add in all the interfaces that we are compatible with. + loop=$revision + while test "$loop" -ne 0; do + func_arith $revision - $loop + iface=$func_arith_result + func_arith $loop - 1 + loop=$func_arith_result + verstring="$verstring_prefix$major.$iface:$verstring" + done + + # Before this point, $major must not contain `.'. + major=.$major + versuffix="$major.$revision" + ;; + + linux) + func_arith $current - $age + major=.$func_arith_result + versuffix="$major.$age.$revision" + ;; + + osf) + func_arith $current - $age + major=.$func_arith_result + versuffix=".$current.$age.$revision" + verstring="$current.$age.$revision" + + # Add in all the interfaces that we are compatible with. + loop=$age + while test "$loop" -ne 0; do + func_arith $current - $loop + iface=$func_arith_result + func_arith $loop - 1 + loop=$func_arith_result + verstring="$verstring:${iface}.0" + done + + # Make executables depend on our current version. + verstring="$verstring:${current}.0" + ;; + + qnx) + major=".$current" + versuffix=".$current" + ;; + + sunos) + major=".$current" + versuffix=".$current.$revision" + ;; + + windows) + # Use '-' rather than '.', since we only want one + # extension on DOS 8.3 filesystems. + func_arith $current - $age + major=$func_arith_result + versuffix="-$major" + ;; + + *) + func_fatal_configuration "unknown library version type \`$version_type'" + ;; + esac + + # Clear the version info if we defaulted, and they specified a release. + if test -z "$vinfo" && test -n "$release"; then + major= + case $version_type in + darwin) + # we can't check for "0.0" in archive_cmds due to quoting + # problems, so we reset it completely + verstring= + ;; + *) + verstring="0.0" + ;; + esac + if test "$need_version" = no; then + versuffix= + else + versuffix=".0.0" + fi + fi + + # Remove version info from name if versioning should be avoided + if test "$avoid_version" = yes && test "$need_version" = no; then + major= + versuffix= + verstring="" + fi + + # Check to see if the archive will have undefined symbols. + if test "$allow_undefined" = yes; then + if test "$allow_undefined_flag" = unsupported; then + func_warning "undefined symbols not allowed in $host shared libraries" + build_libtool_libs=no + build_old_libs=yes + fi + else + # Don't allow undefined symbols. + allow_undefined_flag="$no_undefined_flag" + fi + + fi + + func_generate_dlsyms "$libname" "$libname" "yes" + libobjs="$libobjs $symfileobj" + test "X$libobjs" = "X " && libobjs= + + if test "$mode" != relink; then + # Remove our outputs, but don't remove object files since they + # may have been created when compiling PIC objects. + removelist= + tempremovelist=`$ECHO "$output_objdir/*"` + for p in $tempremovelist; do + case $p in + *.$objext | *.gcno) + ;; + $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) + if test "X$precious_files_regex" != "X"; then + if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 + then + continue + fi + fi + removelist="$removelist $p" + ;; + *) ;; + esac + done + test -n "$removelist" && \ + func_show_eval "${RM}r \$removelist" + fi + + # Now set the variables for building old libraries. + if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then + oldlibs="$oldlibs $output_objdir/$libname.$libext" + + # Transform .lo files to .o files. + oldobjs="$objs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` + fi + + # Eliminate all temporary directories. + #for path in $notinst_path; do + # lib_search_path=`$ECHO "X$lib_search_path " | $Xsed -e "s% $path % %g"` + # deplibs=`$ECHO "X$deplibs " | $Xsed -e "s% -L$path % %g"` + # dependency_libs=`$ECHO "X$dependency_libs " | $Xsed -e "s% -L$path % %g"` + #done + + if test -n "$xrpath"; then + # If the user specified any rpath flags, then add them. + temp_xrpath= + for libdir in $xrpath; do + temp_xrpath="$temp_xrpath -R$libdir" + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" ;; + esac + done + if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then + dependency_libs="$temp_xrpath $dependency_libs" + fi + fi + + # Make sure dlfiles contains only unique files that won't be dlpreopened + old_dlfiles="$dlfiles" + dlfiles= + for lib in $old_dlfiles; do + case " $dlprefiles $dlfiles " in + *" $lib "*) ;; + *) dlfiles="$dlfiles $lib" ;; + esac + done + + # Make sure dlprefiles contains only unique files + old_dlprefiles="$dlprefiles" + dlprefiles= + for lib in $old_dlprefiles; do + case "$dlprefiles " in + *" $lib "*) ;; + *) dlprefiles="$dlprefiles $lib" ;; + esac + done + + if test "$build_libtool_libs" = yes; then + if test -n "$rpath"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc*) + # these systems don't actually have a c library (as such)! + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C library is in the System framework + deplibs="$deplibs System.ltframework" + ;; + *-*-netbsd*) + # Don't link with libc until the a.out ld.so is fixed. + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc due to us having libc/libc_r. + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + ;; + *) + # Add libc to deplibs on all other systems if necessary. + if test "$build_libtool_need_lc" = "yes"; then + deplibs="$deplibs -lc" + fi + ;; + esac + fi + + # Transform deplibs into only deplibs that can be linked in shared. + name_save=$name + libname_save=$libname + release_save=$release + versuffix_save=$versuffix + major_save=$major + # I'm not sure if I'm treating the release correctly. I think + # release should show up in the -l (ie -lgmp5) so we don't want to + # add it in twice. Is that correct? + release="" + versuffix="" + major="" + newdeplibs= + droppeddeps=no + case $deplibs_check_method in + pass_all) + # Don't check for shared/static. Everything works. + # This might be a little naive. We might want to check + # whether the library exists or not. But this is on + # osf3 & osf4 and I'm not really sure... Just + # implementing what was already the behavior. + newdeplibs=$deplibs + ;; + test_compile) + # This code stresses the "libraries are programs" paradigm to its + # limits. Maybe even breaks it. We compile a program, linking it + # against the deplibs as a proxy for the library. Then we can check + # whether they linked in statically or dynamically with ldd. + $opt_dry_run || $RM conftest.c + cat > conftest.c </dev/null` + for potent_lib in $potential_libs; do + # Follow soft links. + if ls -lLd "$potent_lib" 2>/dev/null | + $GREP " -> " >/dev/null; then + continue + fi + # The statement above tries to avoid entering an + # endless loop below, in case of cyclic links. + # We might still enter an endless loop, since a link + # loop can be closed while we follow links, + # but so what? + potlib="$potent_lib" + while test -h "$potlib" 2>/dev/null; do + potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` + case $potliblink in + [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; + *) potlib=`$ECHO "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; + esac + done + if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | + $SED -e 10q | + $EGREP "$file_magic_regex" > /dev/null; then + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" + break 2 + fi + done + done + fi + if test -n "$a_deplib" ; then + droppeddeps=yes + $ECHO + $ECHO "*** Warning: linker path does not have real file for library $a_deplib." + $ECHO "*** I have the capability to make that library automatically link in when" + $ECHO "*** you link to this library. But I can only do this if you have a" + $ECHO "*** shared version of the library, which you do not appear to have" + $ECHO "*** because I did check the linker path looking for a file starting" + if test -z "$potlib" ; then + $ECHO "*** with $libname but no candidates were found. (...for file magic test)" + else + $ECHO "*** with $libname and none of the candidates passed a file format test" + $ECHO "*** using a file magic. Last file checked: $potlib" + fi + fi + ;; + *) + # Add a -L argument. + newdeplibs="$newdeplibs $a_deplib" + ;; + esac + done # Gone through all deplibs. + ;; + match_pattern*) + set dummy $deplibs_check_method; shift + match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` + for a_deplib in $deplibs; do + case $a_deplib in + -l*) + func_stripname -l '' "$a_deplib" + name=$func_stripname_result + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + case " $predeps $postdeps " in + *" $a_deplib "*) + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" + ;; + esac + fi + if test -n "$a_deplib" ; then + libname=`eval "\\$ECHO \"$libname_spec\""` + for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do + potential_libs=`ls $i/$libname[.-]* 2>/dev/null` + for potent_lib in $potential_libs; do + potlib="$potent_lib" # see symlink-check above in file_magic test + if eval "\$ECHO \"X$potent_lib\"" 2>/dev/null | $Xsed -e 10q | \ + $EGREP "$match_pattern_regex" > /dev/null; then + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" + break 2 + fi + done + done + fi + if test -n "$a_deplib" ; then + droppeddeps=yes + $ECHO + $ECHO "*** Warning: linker path does not have real file for library $a_deplib." + $ECHO "*** I have the capability to make that library automatically link in when" + $ECHO "*** you link to this library. But I can only do this if you have a" + $ECHO "*** shared version of the library, which you do not appear to have" + $ECHO "*** because I did check the linker path looking for a file starting" + if test -z "$potlib" ; then + $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" + else + $ECHO "*** with $libname and none of the candidates passed a file format test" + $ECHO "*** using a regex pattern. Last file checked: $potlib" + fi + fi + ;; + *) + # Add a -L argument. + newdeplibs="$newdeplibs $a_deplib" + ;; + esac + done # Gone through all deplibs. + ;; + none | unknown | *) + newdeplibs="" + tmp_deplibs=`$ECHO "X $deplibs" | $Xsed \ + -e 's/ -lc$//' -e 's/ -[LR][^ ]*//g'` + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + for i in $predeps $postdeps ; do + # can't use Xsed below, because $i might contain '/' + tmp_deplibs=`$ECHO "X $tmp_deplibs" | $Xsed -e "s,$i,,"` + done + fi + if $ECHO "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' | + $GREP . >/dev/null; then + $ECHO + if test "X$deplibs_check_method" = "Xnone"; then + $ECHO "*** Warning: inter-library dependencies are not supported in this platform." + else + $ECHO "*** Warning: inter-library dependencies are not known to be supported." + fi + $ECHO "*** All declared inter-library dependencies are being dropped." + droppeddeps=yes + fi + ;; + esac + versuffix=$versuffix_save + major=$major_save + release=$release_save + libname=$libname_save + name=$name_save + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library with the System framework + newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's/ -lc / System.ltframework /'` + ;; + esac + + if test "$droppeddeps" = yes; then + if test "$module" = yes; then + $ECHO + $ECHO "*** Warning: libtool could not satisfy all declared inter-library" + $ECHO "*** dependencies of module $libname. Therefore, libtool will create" + $ECHO "*** a static module, that should work as long as the dlopening" + $ECHO "*** application is linked with the -dlopen flag." + if test -z "$global_symbol_pipe"; then + $ECHO + $ECHO "*** However, this would only work if libtool was able to extract symbol" + $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could" + $ECHO "*** not find such a program. So, this module is probably useless." + $ECHO "*** \`nm' from GNU binutils and a full rebuild may help." + fi + if test "$build_old_libs" = no; then + oldlibs="$output_objdir/$libname.$libext" + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + else + $ECHO "*** The inter-library dependencies that have been dropped here will be" + $ECHO "*** automatically added whenever a program is linked with this library" + $ECHO "*** or is declared to -dlopen it." + + if test "$allow_undefined" = no; then + $ECHO + $ECHO "*** Since this library must not contain undefined symbols," + $ECHO "*** because either the platform does not support them or" + $ECHO "*** it was explicitly requested with -no-undefined," + $ECHO "*** libtool will only create a static version of it." + if test "$build_old_libs" = no; then + oldlibs="$output_objdir/$libname.$libext" + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + fi + fi + # Done checking deplibs! + deplibs=$newdeplibs + fi + # Time to change all our "foo.ltframework" stuff back to "-framework foo" + case $host in + *-*-darwin*) + newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` + new_inherited_linker_flags=`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` + deplibs=`$ECHO "X $deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` + ;; + esac + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $deplibs " in + *" -L$path/$objdir "*) + new_libs="$new_libs -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$new_libs $deplib" ;; + esac + ;; + *) new_libs="$new_libs $deplib" ;; + esac + done + deplibs="$new_libs" + + # All the library-specific variables (install_libdir is set above). + library_names= + old_library= + dlname= + + # Test again, we may have decided not to build it any more + if test "$build_libtool_libs" = yes; then + if test "$hardcode_into_libs" = yes; then + # Hardcode the library paths + hardcode_libdirs= + dep_rpath= + rpath="$finalize_rpath" + test "$mode" != relink && rpath="$compile_rpath$rpath" + for libdir in $rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + dep_rpath="$dep_rpath $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) perm_rpath="$perm_rpath $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + if test -n "$hardcode_libdir_flag_spec_ld"; then + eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" + else + eval dep_rpath=\"$hardcode_libdir_flag_spec\" + fi + fi + if test -n "$runpath_var" && test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + rpath="$rpath$dir:" + done + eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" + fi + test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" + fi + + shlibpath="$finalize_shlibpath" + test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" + if test -n "$shlibpath"; then + eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" + fi + + # Get the real and link names of the library. + eval shared_ext=\"$shrext_cmds\" + eval library_names=\"$library_names_spec\" + set dummy $library_names + shift + realname="$1" + shift + + if test -n "$soname_spec"; then + eval soname=\"$soname_spec\" + else + soname="$realname" + fi + if test -z "$dlname"; then + dlname=$soname + fi + + lib="$output_objdir/$realname" + linknames= + for link + do + linknames="$linknames $link" + done + + # Use standard objects if they are pic + test -z "$pic_flag" && libobjs=`$ECHO "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + test "X$libobjs" = "X " && libobjs= + + delfiles= + if test -n "$export_symbols" && test -n "$include_expsyms"; then + $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" + export_symbols="$output_objdir/$libname.uexp" + delfiles="$delfiles $export_symbols" + fi + + orig_export_symbols= + case $host_os in + cygwin* | mingw* | cegcc*) + if test -n "$export_symbols" && test -z "$export_symbols_regex"; then + # exporting using user supplied symfile + if test "x`$SED 1q $export_symbols`" != xEXPORTS; then + # and it's NOT already a .def file. Must figure out + # which of the given symbols are data symbols and tag + # them as such. So, trigger use of export_symbols_cmds. + # export_symbols gets reassigned inside the "prepare + # the list of exported symbols" if statement, so the + # include_expsyms logic still works. + orig_export_symbols="$export_symbols" + export_symbols= + always_export_symbols=yes + fi + fi + ;; + esac + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then + func_verbose "generating symbol list for \`$libname.la'" + export_symbols="$output_objdir/$libname.exp" + $opt_dry_run || $RM $export_symbols + cmds=$export_symbols_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + func_len " $cmd" + len=$func_len_result + if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then + func_show_eval "$cmd" 'exit $?' + skipped_export=false + else + # The command line is too long to execute in one step. + func_verbose "using reloadable object file for export list..." + skipped_export=: + # Break out early, otherwise skipped_export may be + # set to false by a later but shorter cmd. + break + fi + done + IFS="$save_ifs" + if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then + func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' + func_show_eval '$MV "${export_symbols}T" "$export_symbols"' + fi + fi + fi + + if test -n "$export_symbols" && test -n "$include_expsyms"; then + tmp_export_symbols="$export_symbols" + test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" + $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"' + fi + + if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then + # The given exports_symbols file has to be filtered, so filter it. + func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" + # FIXME: $output_objdir/$libname.filter potentially contains lots of + # 's' commands which not all seds can handle. GNU sed should be fine + # though. Also, the filter scales superlinearly with the number of + # global variables. join(1) would be nice here, but unfortunately + # isn't a blessed tool. + $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter + delfiles="$delfiles $export_symbols $output_objdir/$libname.filter" + export_symbols=$output_objdir/$libname.def + $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols + fi + + tmp_deplibs= + for test_deplib in $deplibs; do + case " $convenience " in + *" $test_deplib "*) ;; + *) + tmp_deplibs="$tmp_deplibs $test_deplib" + ;; + esac + done + deplibs="$tmp_deplibs" + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec" && + test "$compiler_needs_object" = yes && + test -z "$libobjs"; then + # extract the archives, so we have objects to list. + # TODO: could optimize this to just extract one archive. + whole_archive_flag_spec= + fi + if test -n "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + test "X$libobjs" = "X " && libobjs= + else + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" + + func_extract_archives $gentop $convenience + libobjs="$libobjs $func_extract_archives_result" + test "X$libobjs" = "X " && libobjs= + fi + fi + + if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then + eval flag=\"$thread_safe_flag_spec\" + linker_flags="$linker_flags $flag" + fi + + # Make a backup of the uninstalled library when relinking + if test "$mode" = relink; then + $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? + fi + + # Do each of the archive commands. + if test "$module" = yes && test -n "$module_cmds" ; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + eval test_cmds=\"$module_expsym_cmds\" + cmds=$module_expsym_cmds + else + eval test_cmds=\"$module_cmds\" + cmds=$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + eval test_cmds=\"$archive_expsym_cmds\" + cmds=$archive_expsym_cmds + else + eval test_cmds=\"$archive_cmds\" + cmds=$archive_cmds + fi + fi + + if test "X$skipped_export" != "X:" && + func_len " $test_cmds" && + len=$func_len_result && + test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then + : + else + # The command line is too long to link in one step, link piecewise + # or, if using GNU ld and skipped_export is not :, use a linker + # script. + + # Save the value of $output and $libobjs because we want to + # use them later. If we have whole_archive_flag_spec, we + # want to use save_libobjs as it was before + # whole_archive_flag_spec was expanded, because we can't + # assume the linker understands whole_archive_flag_spec. + # This may have to be revisited, in case too many + # convenience libraries get linked in and end up exceeding + # the spec. + if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + fi + save_output=$output + output_la=`$ECHO "X$output" | $Xsed -e "$basename"` + + # Clear the reloadable object creation command queue and + # initialize k to one. + test_cmds= + concat_cmds= + objlist= + last_robj= + k=1 + + if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then + output=${output_objdir}/${output_la}.lnkscript + func_verbose "creating GNU ld script: $output" + $ECHO 'INPUT (' > $output + for obj in $save_libobjs + do + $ECHO "$obj" >> $output + done + $ECHO ')' >> $output + delfiles="$delfiles $output" + elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then + output=${output_objdir}/${output_la}.lnk + func_verbose "creating linker input file list: $output" + : > $output + set x $save_libobjs + shift + firstobj= + if test "$compiler_needs_object" = yes; then + firstobj="$1 " + shift + fi + for obj + do + $ECHO "$obj" >> $output + done + delfiles="$delfiles $output" + output=$firstobj\"$file_list_spec$output\" + else + if test -n "$save_libobjs"; then + func_verbose "creating reloadable object files..." + output=$output_objdir/$output_la-${k}.$objext + eval test_cmds=\"$reload_cmds\" + func_len " $test_cmds" + len0=$func_len_result + len=$len0 + + # Loop over the list of objects to be linked. + for obj in $save_libobjs + do + func_len " $obj" + func_arith $len + $func_len_result + len=$func_arith_result + if test "X$objlist" = X || + test "$len" -lt "$max_cmd_len"; then + func_append objlist " $obj" + else + # The command $test_cmds is almost too long, add a + # command to the queue. + if test "$k" -eq 1 ; then + # The first file doesn't have a previous command to add. + eval concat_cmds=\"$reload_cmds $objlist $last_robj\" + else + # All subsequent reloadable object files will link in + # the last one created. + eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj~\$RM $last_robj\" + fi + last_robj=$output_objdir/$output_la-${k}.$objext + func_arith $k + 1 + k=$func_arith_result + output=$output_objdir/$output_la-${k}.$objext + objlist=$obj + func_len " $last_robj" + func_arith $len0 + $func_len_result + len=$func_arith_result + fi + done + # Handle the remaining objects by creating one last + # reloadable object file. All subsequent reloadable object + # files will link in the last one created. + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" + if test -n "$last_robj"; then + eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" + fi + delfiles="$delfiles $output" + + else + output= + fi + + if ${skipped_export-false}; then + func_verbose "generating symbol list for \`$libname.la'" + export_symbols="$output_objdir/$libname.exp" + $opt_dry_run || $RM $export_symbols + libobjs=$output + # Append the command to create the export file. + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" + if test -n "$last_robj"; then + eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" + fi + fi + + test -n "$save_libobjs" && + func_verbose "creating a temporary reloadable object file: $output" + + # Loop through the commands generated above and execute them. + save_ifs="$IFS"; IFS='~' + for cmd in $concat_cmds; do + IFS="$save_ifs" + $opt_silent || { + func_quote_for_expand "$cmd" + eval "func_echo $func_quote_for_expand_result" + } + $opt_dry_run || eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test "$mode" = relink; then + ( cd "$output_objdir" && \ + $RM "${realname}T" && \ + $MV "${realname}U" "$realname" ) + fi + + exit $lt_exit + } + done + IFS="$save_ifs" + + if test -n "$export_symbols_regex" && ${skipped_export-false}; then + func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' + func_show_eval '$MV "${export_symbols}T" "$export_symbols"' + fi + fi + + if ${skipped_export-false}; then + if test -n "$export_symbols" && test -n "$include_expsyms"; then + tmp_export_symbols="$export_symbols" + test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" + $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"' + fi + + if test -n "$orig_export_symbols"; then + # The given exports_symbols file has to be filtered, so filter it. + func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" + # FIXME: $output_objdir/$libname.filter potentially contains lots of + # 's' commands which not all seds can handle. GNU sed should be fine + # though. Also, the filter scales superlinearly with the number of + # global variables. join(1) would be nice here, but unfortunately + # isn't a blessed tool. + $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter + delfiles="$delfiles $export_symbols $output_objdir/$libname.filter" + export_symbols=$output_objdir/$libname.def + $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols + fi + fi + + libobjs=$output + # Restore the value of output. + output=$save_output + + if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + test "X$libobjs" = "X " && libobjs= + fi + # Expand the library linking commands again to reset the + # value of $libobjs for piecewise linking. + + # Do each of the archive commands. + if test "$module" = yes && test -n "$module_cmds" ; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + cmds=$module_expsym_cmds + else + cmds=$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + cmds=$archive_expsym_cmds + else + cmds=$archive_cmds + fi + fi + fi + + if test -n "$delfiles"; then + # Append the command to remove temporary files to $cmds. + eval cmds=\"\$cmds~\$RM $delfiles\" + fi + + # Add any objects from preloaded convenience libraries + if test -n "$dlprefiles"; then + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" + + func_extract_archives $gentop $dlprefiles + libobjs="$libobjs $func_extract_archives_result" + test "X$libobjs" = "X " && libobjs= + fi + + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $opt_silent || { + func_quote_for_expand "$cmd" + eval "func_echo $func_quote_for_expand_result" + } + $opt_dry_run || eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test "$mode" = relink; then + ( cd "$output_objdir" && \ + $RM "${realname}T" && \ + $MV "${realname}U" "$realname" ) + fi + + exit $lt_exit + } + done + IFS="$save_ifs" + + # Restore the uninstalled library and exit + if test "$mode" = relink; then + $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? + + if test -n "$convenience"; then + if test -z "$whole_archive_flag_spec"; then + func_show_eval '${RM}r "$gentop"' + fi + fi + + exit $EXIT_SUCCESS + fi + + # Create links to the real library. + for linkname in $linknames; do + if test "$realname" != "$linkname"; then + func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' + fi + done + + # If -module or -export-dynamic was specified, set the dlname. + if test "$module" = yes || test "$export_dynamic" = yes; then + # On all known operating systems, these are identical. + dlname="$soname" + fi + fi + ;; + + obj) + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + func_warning "\`-dlopen' is ignored for objects" + fi + + case " $deplibs" in + *\ -l* | *\ -L*) + func_warning "\`-l' and \`-L' are ignored for objects" ;; + esac + + test -n "$rpath" && \ + func_warning "\`-rpath' is ignored for objects" + + test -n "$xrpath" && \ + func_warning "\`-R' is ignored for objects" + + test -n "$vinfo" && \ + func_warning "\`-version-info' is ignored for objects" + + test -n "$release" && \ + func_warning "\`-release' is ignored for objects" + + case $output in + *.lo) + test -n "$objs$old_deplibs" && \ + func_fatal_error "cannot build library object \`$output' from non-libtool objects" + + libobj=$output + func_lo2o "$libobj" + obj=$func_lo2o_result + ;; + *) + libobj= + obj="$output" + ;; + esac + + # Delete the old objects. + $opt_dry_run || $RM $obj $libobj + + # Objects from convenience libraries. This assumes + # single-version convenience libraries. Whenever we create + # different ones for PIC/non-PIC, this we'll have to duplicate + # the extraction. + reload_conv_objs= + gentop= + # reload_cmds runs $LD directly, so let us get rid of + # -Wl from whole_archive_flag_spec and hope we can get by with + # turning comma into space.. + wl= + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec"; then + eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" + reload_conv_objs=$reload_objs\ `$ECHO "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'` + else + gentop="$output_objdir/${obj}x" + generated="$generated $gentop" + + func_extract_archives $gentop $convenience + reload_conv_objs="$reload_objs $func_extract_archives_result" + fi + fi + + # Create the old-style object. + reload_objs="$objs$old_deplibs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test + + output="$obj" + func_execute_cmds "$reload_cmds" 'exit $?' + + # Exit if we aren't doing a library object file. + if test -z "$libobj"; then + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + exit $EXIT_SUCCESS + fi + + if test "$build_libtool_libs" != yes; then + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + # Create an invalid libtool object if no PIC, so that we don't + # accidentally link it into a program. + # $show "echo timestamp > $libobj" + # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? + exit $EXIT_SUCCESS + fi + + if test -n "$pic_flag" || test "$pic_mode" != default; then + # Only do commands if we really have different PIC objects. + reload_objs="$libobjs $reload_conv_objs" + output="$libobj" + func_execute_cmds "$reload_cmds" 'exit $?' + fi + + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + exit $EXIT_SUCCESS + ;; + + prog) + case $host in + *cygwin*) func_stripname '' '.exe' "$output" + output=$func_stripname_result.exe;; + esac + test -n "$vinfo" && \ + func_warning "\`-version-info' is ignored for programs" + + test -n "$release" && \ + func_warning "\`-release' is ignored for programs" + + test "$preload" = yes \ + && test "$dlopen_support" = unknown \ + && test "$dlopen_self" = unknown \ + && test "$dlopen_self_static" = unknown && \ + func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library is the System framework + compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'` + finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'` + ;; + esac + + case $host in + *-*-darwin*) + # Don't allow lazy linking, it breaks C++ global constructors + # But is supposedly fixed on 10.4 or later (yay!). + if test "$tagname" = CXX ; then + case ${MACOSX_DEPLOYMENT_TARGET-10.0} in + 10.[0123]) + compile_command="$compile_command ${wl}-bind_at_load" + finalize_command="$finalize_command ${wl}-bind_at_load" + ;; + esac + fi + # Time to change all our "foo.ltframework" stuff back to "-framework foo" + compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` + finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` + ;; + esac + + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $compile_deplibs " in + *" -L$path/$objdir "*) + new_libs="$new_libs -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $compile_deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$new_libs $deplib" ;; + esac + ;; + *) new_libs="$new_libs $deplib" ;; + esac + done + compile_deplibs="$new_libs" + + + compile_command="$compile_command $compile_deplibs" + finalize_command="$finalize_command $finalize_deplibs" + + if test -n "$rpath$xrpath"; then + # If the user specified any rpath flags, then add them. + for libdir in $rpath $xrpath; do + # This is the magic to use -rpath. + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" ;; + esac + done + fi + + # Now hardcode the library paths + rpath= + hardcode_libdirs= + for libdir in $compile_rpath $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + rpath="$rpath $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) perm_rpath="$perm_rpath $libdir" ;; + esac + fi + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$libdir:"*) ;; + ::) dllsearchpath=$libdir;; + *) dllsearchpath="$dllsearchpath:$libdir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + ::) dllsearchpath=$testbindir;; + *) dllsearchpath="$dllsearchpath:$testbindir";; + esac + ;; + esac + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + compile_rpath="$rpath" + + rpath= + hardcode_libdirs= + for libdir in $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + rpath="$rpath $flag" + fi + elif test -n "$runpath_var"; then + case "$finalize_perm_rpath " in + *" $libdir "*) ;; + *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + finalize_rpath="$rpath" + + if test -n "$libobjs" && test "$build_old_libs" = yes; then + # Transform all the library objects into standard objects. + compile_command=`$ECHO "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + finalize_command=`$ECHO "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + fi + + func_generate_dlsyms "$outputname" "@PROGRAM@" "no" + + # template prelinking step + if test -n "$prelink_cmds"; then + func_execute_cmds "$prelink_cmds" 'exit $?' + fi + + wrappers_required=yes + case $host in + *cygwin* | *mingw* ) + if test "$build_libtool_libs" != yes; then + wrappers_required=no + fi + ;; + *cegcc) + # Disable wrappers for cegcc, we are cross compiling anyway. + wrappers_required=no + ;; + *) + if test "$need_relink" = no || test "$build_libtool_libs" != yes; then + wrappers_required=no + fi + ;; + esac + if test "$wrappers_required" = no; then + # Replace the output file specification. + compile_command=`$ECHO "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` + link_command="$compile_command$compile_rpath" + + # We have no uninstalled library dependencies, so finalize right now. + exit_status=0 + func_show_eval "$link_command" 'exit_status=$?' + + # Delete the generated files. + if test -f "$output_objdir/${outputname}S.${objext}"; then + func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' + fi + + exit $exit_status + fi + + if test -n "$compile_shlibpath$finalize_shlibpath"; then + compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" + fi + if test -n "$finalize_shlibpath"; then + finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" + fi + + compile_var= + finalize_var= + if test -n "$runpath_var"; then + if test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + rpath="$rpath$dir:" + done + compile_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + if test -n "$finalize_perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $finalize_perm_rpath; do + rpath="$rpath$dir:" + done + finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + fi + + if test "$no_install" = yes; then + # We don't need to create a wrapper script. + link_command="$compile_var$compile_command$compile_rpath" + # Replace the output file specification. + link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` + # Delete the old output file. + $opt_dry_run || $RM $output + # Link the executable and exit + func_show_eval "$link_command" 'exit $?' + exit $EXIT_SUCCESS + fi + + if test "$hardcode_action" = relink; then + # Fast installation is not supported + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + + func_warning "this platform does not like uninstalled shared libraries" + func_warning "\`$output' will be relinked during installation" + else + if test "$fast_install" != no; then + link_command="$finalize_var$compile_command$finalize_rpath" + if test "$fast_install" = yes; then + relink_command=`$ECHO "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` + else + # fast_install is set to needless + relink_command= + fi + else + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + fi + fi + + # Replace the output file specification. + link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` + + # Delete the old output files. + $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname + + func_show_eval "$link_command" 'exit $?' + + # Now create the wrapper script. + func_verbose "creating $output" + + # Quote the relink command for shipping. + if test -n "$relink_command"; then + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + func_quote_for_eval "$var_value" + relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" + fi + done + relink_command="(cd `pwd`; $relink_command)" + relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"` + fi + + # Quote $ECHO for shipping. + if test "X$ECHO" = "X$SHELL $progpath --fallback-echo"; then + case $progpath in + [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; + *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; + esac + qecho=`$ECHO "X$qecho" | $Xsed -e "$sed_quote_subst"` + else + qecho=`$ECHO "X$ECHO" | $Xsed -e "$sed_quote_subst"` + fi + + # Only actually do things if not in dry run mode. + $opt_dry_run || { + # win32 will think the script is a binary if it has + # a .exe suffix, so we strip it off here. + case $output in + *.exe) func_stripname '' '.exe' "$output" + output=$func_stripname_result ;; + esac + # test for cygwin because mv fails w/o .exe extensions + case $host in + *cygwin*) + exeext=.exe + func_stripname '' '.exe' "$outputname" + outputname=$func_stripname_result ;; + *) exeext= ;; + esac + case $host in + *cygwin* | *mingw* ) + func_dirname_and_basename "$output" "" "." + output_name=$func_basename_result + output_path=$func_dirname_result + cwrappersource="$output_path/$objdir/lt-$output_name.c" + cwrapper="$output_path/$output_name.exe" + $RM $cwrappersource $cwrapper + trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 + + func_emit_cwrapperexe_src > $cwrappersource + + # The wrapper executable is built using the $host compiler, + # because it contains $host paths and files. If cross- + # compiling, it, like the target executable, must be + # executed on the $host or under an emulation environment. + $opt_dry_run || { + $LTCC $LTCFLAGS -o $cwrapper $cwrappersource + $STRIP $cwrapper + } + + # Now, create the wrapper script for func_source use: + func_ltwrapper_scriptname $cwrapper + $RM $func_ltwrapper_scriptname_result + trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 + $opt_dry_run || { + # note: this script will not be executed, so do not chmod. + if test "x$build" = "x$host" ; then + $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result + else + func_emit_wrapper no > $func_ltwrapper_scriptname_result + fi + } + ;; + * ) + $RM $output + trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 + + func_emit_wrapper no > $output + chmod +x $output + ;; + esac + } + exit $EXIT_SUCCESS + ;; + esac + + # See if we need to build an old-fashioned archive. + for oldlib in $oldlibs; do + + if test "$build_libtool_libs" = convenience; then + oldobjs="$libobjs_save $symfileobj" + addlibs="$convenience" + build_libtool_libs=no + else + if test "$build_libtool_libs" = module; then + oldobjs="$libobjs_save" + build_libtool_libs=no + else + oldobjs="$old_deplibs $non_pic_objects" + if test "$preload" = yes && test -f "$symfileobj"; then + oldobjs="$oldobjs $symfileobj" + fi + fi + addlibs="$old_convenience" + fi + + if test -n "$addlibs"; then + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" + + func_extract_archives $gentop $addlibs + oldobjs="$oldobjs $func_extract_archives_result" + fi + + # Do each command in the archive commands. + if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then + cmds=$old_archive_from_new_cmds + else + + # Add any objects from preloaded convenience libraries + if test -n "$dlprefiles"; then + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" + + func_extract_archives $gentop $dlprefiles + oldobjs="$oldobjs $func_extract_archives_result" + fi + + # POSIX demands no paths to be encoded in archives. We have + # to avoid creating archives with duplicate basenames if we + # might have to extract them afterwards, e.g., when creating a + # static archive out of a convenience library, or when linking + # the entirety of a libtool archive into another (currently + # not supported by libtool). + if (for obj in $oldobjs + do + func_basename "$obj" + $ECHO "$func_basename_result" + done | sort | sort -uc >/dev/null 2>&1); then + : + else + $ECHO "copying selected object files to avoid basename conflicts..." + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" + func_mkdir_p "$gentop" + save_oldobjs=$oldobjs + oldobjs= + counter=1 + for obj in $save_oldobjs + do + func_basename "$obj" + objbase="$func_basename_result" + case " $oldobjs " in + " ") oldobjs=$obj ;; + *[\ /]"$objbase "*) + while :; do + # Make sure we don't pick an alternate name that also + # overlaps. + newobj=lt$counter-$objbase + func_arith $counter + 1 + counter=$func_arith_result + case " $oldobjs " in + *[\ /]"$newobj "*) ;; + *) if test ! -f "$gentop/$newobj"; then break; fi ;; + esac + done + func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" + oldobjs="$oldobjs $gentop/$newobj" + ;; + *) oldobjs="$oldobjs $obj" ;; + esac + done + fi + eval cmds=\"$old_archive_cmds\" + + func_len " $cmds" + len=$func_len_result + if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then + cmds=$old_archive_cmds + else + # the command line is too long to link in one step, link in parts + func_verbose "using piecewise archive linking..." + save_RANLIB=$RANLIB + RANLIB=: + objlist= + concat_cmds= + save_oldobjs=$oldobjs + oldobjs= + # Is there a better way of finding the last object in the list? + for obj in $save_oldobjs + do + last_oldobj=$obj + done + eval test_cmds=\"$old_archive_cmds\" + func_len " $test_cmds" + len0=$func_len_result + len=$len0 + for obj in $save_oldobjs + do + func_len " $obj" + func_arith $len + $func_len_result + len=$func_arith_result + func_append objlist " $obj" + if test "$len" -lt "$max_cmd_len"; then + : + else + # the above command should be used before it gets too long + oldobjs=$objlist + if test "$obj" = "$last_oldobj" ; then + RANLIB=$save_RANLIB + fi + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" + objlist= + len=$len0 + fi + done + RANLIB=$save_RANLIB + oldobjs=$objlist + if test "X$oldobjs" = "X" ; then + eval cmds=\"\$concat_cmds\" + else + eval cmds=\"\$concat_cmds~\$old_archive_cmds\" + fi + fi + fi + func_execute_cmds "$cmds" 'exit $?' + done + + test -n "$generated" && \ + func_show_eval "${RM}r$generated" + + # Now create the libtool archive. + case $output in + *.la) + old_library= + test "$build_old_libs" = yes && old_library="$libname.$libext" + func_verbose "creating $output" + + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + func_quote_for_eval "$var_value" + relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" + fi + done + # Quote the link command for shipping. + relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" + relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"` + if test "$hardcode_automatic" = yes ; then + relink_command= + fi + + # Only create the output if not a dry run. + $opt_dry_run || { + for installed in no yes; do + if test "$installed" = yes; then + if test -z "$install_libdir"; then + break + fi + output="$output_objdir/$outputname"i + # Replace all uninstalled libtool libraries with the installed ones + newdependency_libs= + for deplib in $dependency_libs; do + case $deplib in + *.la) + func_basename "$deplib" + name="$func_basename_result" + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + test -z "$libdir" && \ + func_fatal_error "\`$deplib' is not a valid libtool archive" + newdependency_libs="$newdependency_libs $libdir/$name" + ;; + *) newdependency_libs="$newdependency_libs $deplib" ;; + esac + done + dependency_libs="$newdependency_libs" + newdlfiles= + + for lib in $dlfiles; do + case $lib in + *.la) + func_basename "$lib" + name="$func_basename_result" + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + test -z "$libdir" && \ + func_fatal_error "\`$lib' is not a valid libtool archive" + newdlfiles="$newdlfiles $libdir/$name" + ;; + *) newdlfiles="$newdlfiles $lib" ;; + esac + done + dlfiles="$newdlfiles" + newdlprefiles= + for lib in $dlprefiles; do + case $lib in + *.la) + # Only pass preopened files to the pseudo-archive (for + # eventual linking with the app. that links it) if we + # didn't already link the preopened objects directly into + # the library: + func_basename "$lib" + name="$func_basename_result" + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + test -z "$libdir" && \ + func_fatal_error "\`$lib' is not a valid libtool archive" + newdlprefiles="$newdlprefiles $libdir/$name" + ;; + esac + done + dlprefiles="$newdlprefiles" + else + newdlfiles= + for lib in $dlfiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + *) abs=`pwd`"/$lib" ;; + esac + newdlfiles="$newdlfiles $abs" + done + dlfiles="$newdlfiles" + newdlprefiles= + for lib in $dlprefiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + *) abs=`pwd`"/$lib" ;; + esac + newdlprefiles="$newdlprefiles $abs" + done + dlprefiles="$newdlprefiles" + fi + $RM $output + # place dlname in correct position for cygwin + tdlname=$dlname + case $host,$output,$installed,$module,$dlname in + *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; + esac + $ECHO > $output "\ +# $outputname - a libtool library file +# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION +# +# Please DO NOT delete this file! +# It is necessary for linking the library. + +# The name that we can dlopen(3). +dlname='$tdlname' + +# Names of this library. +library_names='$library_names' + +# The name of the static archive. +old_library='$old_library' + +# Linker flags that can not go in dependency_libs. +inherited_linker_flags='$new_inherited_linker_flags' + +# Libraries that this one depends upon. +dependency_libs='$dependency_libs' + +# Names of additional weak libraries provided by this library +weak_library_names='$weak_libs' + +# Version information for $libname. +current=$current +age=$age +revision=$revision + +# Is this an already installed library? +installed=$installed + +# Should we warn about portability when linking against -modules? +shouldnotlink=$module + +# Files to dlopen/dlpreopen +dlopen='$dlfiles' +dlpreopen='$dlprefiles' + +# Directory that this library needs to be installed in: +libdir='$install_libdir'" + if test "$installed" = no && test "$need_relink" = yes; then + $ECHO >> $output "\ +relink_command=\"$relink_command\"" + fi + done + } + + # Do a symbolic link so that the libtool archive can be found in + # LD_LIBRARY_PATH before the program is installed. + func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' + ;; + esac + exit $EXIT_SUCCESS +} + +{ test "$mode" = link || test "$mode" = relink; } && + func_mode_link ${1+"$@"} + + +# func_mode_uninstall arg... +func_mode_uninstall () +{ + $opt_debug + RM="$nonopt" + files= + rmforce= + exit_status=0 + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic="$magic" + + for arg + do + case $arg in + -f) RM="$RM $arg"; rmforce=yes ;; + -*) RM="$RM $arg" ;; + *) files="$files $arg" ;; + esac + done + + test -z "$RM" && \ + func_fatal_help "you must specify an RM program" + + rmdirs= + + origobjdir="$objdir" + for file in $files; do + func_dirname "$file" "" "." + dir="$func_dirname_result" + if test "X$dir" = X.; then + objdir="$origobjdir" + else + objdir="$dir/$origobjdir" + fi + func_basename "$file" + name="$func_basename_result" + test "$mode" = uninstall && objdir="$dir" + + # Remember objdir for removal later, being careful to avoid duplicates + if test "$mode" = clean; then + case " $rmdirs " in + *" $objdir "*) ;; + *) rmdirs="$rmdirs $objdir" ;; + esac + fi + + # Don't error if the file doesn't exist and rm -f was used. + if { test -L "$file"; } >/dev/null 2>&1 || + { test -h "$file"; } >/dev/null 2>&1 || + test -f "$file"; then + : + elif test -d "$file"; then + exit_status=1 + continue + elif test "$rmforce" = yes; then + continue + fi + + rmfiles="$file" + + case $name in + *.la) + # Possibly a libtool archive, so verify it. + if func_lalib_p "$file"; then + func_source $dir/$name + + # Delete the libtool libraries and symlinks. + for n in $library_names; do + rmfiles="$rmfiles $objdir/$n" + done + test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" + + case "$mode" in + clean) + case " $library_names " in + # " " in the beginning catches empty $dlname + *" $dlname "*) ;; + *) rmfiles="$rmfiles $objdir/$dlname" ;; + esac + test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" + ;; + uninstall) + if test -n "$library_names"; then + # Do each command in the postuninstall commands. + func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' + fi + + if test -n "$old_library"; then + # Do each command in the old_postuninstall commands. + func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' + fi + # FIXME: should reinstall the best remaining shared library. + ;; + esac + fi + ;; + + *.lo) + # Possibly a libtool object, so verify it. + if func_lalib_p "$file"; then + + # Read the .lo file + func_source $dir/$name + + # Add PIC object to the list of files to remove. + if test -n "$pic_object" && + test "$pic_object" != none; then + rmfiles="$rmfiles $dir/$pic_object" + fi + + # Add non-PIC object to the list of files to remove. + if test -n "$non_pic_object" && + test "$non_pic_object" != none; then + rmfiles="$rmfiles $dir/$non_pic_object" + fi + fi + ;; + + *) + if test "$mode" = clean ; then + noexename=$name + case $file in + *.exe) + func_stripname '' '.exe' "$file" + file=$func_stripname_result + func_stripname '' '.exe' "$name" + noexename=$func_stripname_result + # $file with .exe has already been added to rmfiles, + # add $file without .exe + rmfiles="$rmfiles $file" + ;; + esac + # Do a test to see if this is a libtool program. + if func_ltwrapper_p "$file"; then + if func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + relink_command= + func_source $func_ltwrapper_scriptname_result + rmfiles="$rmfiles $func_ltwrapper_scriptname_result" + else + relink_command= + func_source $dir/$noexename + fi + + # note $name still contains .exe if it was in $file originally + # as does the version of $file that was added into $rmfiles + rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" + if test "$fast_install" = yes && test -n "$relink_command"; then + rmfiles="$rmfiles $objdir/lt-$name" + fi + if test "X$noexename" != "X$name" ; then + rmfiles="$rmfiles $objdir/lt-${noexename}.c" + fi + fi + fi + ;; + esac + func_show_eval "$RM $rmfiles" 'exit_status=1' + done + objdir="$origobjdir" + + # Try to remove the ${objdir}s in the directories where we deleted files + for dir in $rmdirs; do + if test -d "$dir"; then + func_show_eval "rmdir $dir >/dev/null 2>&1" + fi + done + + exit $exit_status +} + +{ test "$mode" = uninstall || test "$mode" = clean; } && + func_mode_uninstall ${1+"$@"} + +test -z "$mode" && { + help="$generic_help" + func_fatal_help "you must specify a MODE" +} + +test -z "$exec_cmd" && \ + func_fatal_help "invalid operation mode \`$mode'" + +if test -n "$exec_cmd"; then + eval exec "$exec_cmd" + exit $EXIT_FAILURE +fi + +exit $exit_status + + +# The TAGs below are defined such that we never get into a situation +# in which we disable both kinds of libraries. Given conflicting +# choices, we go for a static library, that is the most portable, +# since we can't tell whether shared libraries were disabled because +# the user asked for that or because the platform doesn't support +# them. This is particularly important on AIX, because we don't +# support having both static and shared libraries enabled at the same +# time on that platform, so we default to a shared-only configuration. +# If a disable-shared tag is given, we'll fallback to a static-only +# configuration. But we'll never go from static-only to shared-only. + +# ### BEGIN LIBTOOL TAG CONFIG: disable-shared +build_libtool_libs=no +build_old_libs=yes +# ### END LIBTOOL TAG CONFIG: disable-shared + +# ### BEGIN LIBTOOL TAG CONFIG: disable-static +build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` +# ### END LIBTOOL TAG CONFIG: disable-static + +# Local Variables: +# mode:shell-script +# sh-indentation:2 +# End: +# vi:sw=2 + diff --git a/tests/libs/adios/config/ltoptions.m4 b/tests/libs/adios/config/ltoptions.m4 new file mode 100644 index 0000000000..34151a3ba6 --- /dev/null +++ b/tests/libs/adios/config/ltoptions.m4 @@ -0,0 +1,368 @@ +# Helper functions for option handling. -*- Autoconf -*- +# +# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. +# Written by Gary V. Vaughan, 2004 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# serial 6 ltoptions.m4 + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) + + +# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) +# ------------------------------------------ +m4_define([_LT_MANGLE_OPTION], +[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) + + +# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) +# --------------------------------------- +# Set option OPTION-NAME for macro MACRO-NAME, and if there is a +# matching handler defined, dispatch to it. Other OPTION-NAMEs are +# saved as a flag. +m4_define([_LT_SET_OPTION], +[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl +m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), + _LT_MANGLE_DEFUN([$1], [$2]), + [m4_warning([Unknown $1 option `$2'])])[]dnl +]) + + +# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) +# ------------------------------------------------------------ +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +m4_define([_LT_IF_OPTION], +[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) + + +# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) +# ------------------------------------------------------- +# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME +# are set. +m4_define([_LT_UNLESS_OPTIONS], +[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), + [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), + [m4_define([$0_found])])])[]dnl +m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 +])[]dnl +]) + + +# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) +# ---------------------------------------- +# OPTION-LIST is a space-separated list of Libtool options associated +# with MACRO-NAME. If any OPTION has a matching handler declared with +# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about +# the unknown option and exit. +m4_defun([_LT_SET_OPTIONS], +[# Set options +m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), + [_LT_SET_OPTION([$1], _LT_Option)]) + +m4_if([$1],[LT_INIT],[ + dnl + dnl Simply set some default values (i.e off) if boolean options were not + dnl specified: + _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no + ]) + _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no + ]) + dnl + dnl If no reference was made to various pairs of opposing options, then + dnl we run the default mode handler for the pair. For example, if neither + dnl `shared' nor `disable-shared' was passed, we enable building of shared + dnl archives by default: + _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) + _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) + _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) + _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], + [_LT_ENABLE_FAST_INSTALL]) + ]) +])# _LT_SET_OPTIONS + + +## --------------------------------- ## +## Macros to handle LT_INIT options. ## +## --------------------------------- ## + +# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) +# ----------------------------------------- +m4_define([_LT_MANGLE_DEFUN], +[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) + + +# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) +# ----------------------------------------------- +m4_define([LT_OPTION_DEFINE], +[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl +])# LT_OPTION_DEFINE + + +# dlopen +# ------ +LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes +]) + +AU_DEFUN([AC_LIBTOOL_DLOPEN], +[_LT_SET_OPTION([LT_INIT], [dlopen]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `dlopen' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) + + +# win32-dll +# --------- +# Declare package support for building win32 dll's. +LT_OPTION_DEFINE([LT_INIT], [win32-dll], +[enable_win32_dll=yes + +case $host in +*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*) + AC_CHECK_TOOL(AS, as, false) + AC_CHECK_TOOL(DLLTOOL, dlltool, false) + AC_CHECK_TOOL(OBJDUMP, objdump, false) + ;; +esac + +test -z "$AS" && AS=as +_LT_DECL([], [AS], [0], [Assembler program])dnl + +test -z "$DLLTOOL" && DLLTOOL=dlltool +_LT_DECL([], [DLLTOOL], [0], [DLL creation program])dnl + +test -z "$OBJDUMP" && OBJDUMP=objdump +_LT_DECL([], [OBJDUMP], [0], [Object dumper program])dnl +])# win32-dll + +AU_DEFUN([AC_LIBTOOL_WIN32_DLL], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +_LT_SET_OPTION([LT_INIT], [win32-dll]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `win32-dll' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) + + +# _LT_ENABLE_SHARED([DEFAULT]) +# ---------------------------- +# implement the --enable-shared flag, and supports the `shared' and +# `disable-shared' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +m4_define([_LT_ENABLE_SHARED], +[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([shared], + [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], + [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) + + _LT_DECL([build_libtool_libs], [enable_shared], [0], + [Whether or not to build shared libraries]) +])# _LT_ENABLE_SHARED + +LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) + +# Old names: +AC_DEFUN([AC_ENABLE_SHARED], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) +]) + +AC_DEFUN([AC_DISABLE_SHARED], +[_LT_SET_OPTION([LT_INIT], [disable-shared]) +]) + +AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) +AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_ENABLE_SHARED], []) +dnl AC_DEFUN([AM_DISABLE_SHARED], []) + + + +# _LT_ENABLE_STATIC([DEFAULT]) +# ---------------------------- +# implement the --enable-static flag, and support the `static' and +# `disable-static' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +m4_define([_LT_ENABLE_STATIC], +[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([static], + [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], + [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_static=]_LT_ENABLE_STATIC_DEFAULT) + + _LT_DECL([build_old_libs], [enable_static], [0], + [Whether or not to build static libraries]) +])# _LT_ENABLE_STATIC + +LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) + +# Old names: +AC_DEFUN([AC_ENABLE_STATIC], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) +]) + +AC_DEFUN([AC_DISABLE_STATIC], +[_LT_SET_OPTION([LT_INIT], [disable-static]) +]) + +AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) +AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_ENABLE_STATIC], []) +dnl AC_DEFUN([AM_DISABLE_STATIC], []) + + + +# _LT_ENABLE_FAST_INSTALL([DEFAULT]) +# ---------------------------------- +# implement the --enable-fast-install flag, and support the `fast-install' +# and `disable-fast-install' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +m4_define([_LT_ENABLE_FAST_INSTALL], +[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([fast-install], + [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], + [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) + +_LT_DECL([fast_install], [enable_fast_install], [0], + [Whether or not to optimize for fast installation])dnl +])# _LT_ENABLE_FAST_INSTALL + +LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) + +# Old names: +AU_DEFUN([AC_ENABLE_FAST_INSTALL], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you put +the `fast-install' option into LT_INIT's first parameter.]) +]) + +AU_DEFUN([AC_DISABLE_FAST_INSTALL], +[_LT_SET_OPTION([LT_INIT], [disable-fast-install]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you put +the `disable-fast-install' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) +dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) + + +# _LT_WITH_PIC([MODE]) +# -------------------- +# implement the --with-pic flag, and support the `pic-only' and `no-pic' +# LT_INIT options. +# MODE is either `yes' or `no'. If omitted, it defaults to `both'. +m4_define([_LT_WITH_PIC], +[AC_ARG_WITH([pic], + [AS_HELP_STRING([--with-pic], + [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], + [pic_mode="$withval"], + [pic_mode=default]) + +test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) + +_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl +])# _LT_WITH_PIC + +LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) +LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) + +# Old name: +AU_DEFUN([AC_LIBTOOL_PICMODE], +[_LT_SET_OPTION([LT_INIT], [pic-only]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `pic-only' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) + +## ----------------- ## +## LTDL_INIT Options ## +## ----------------- ## + +m4_define([_LTDL_MODE], []) +LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], + [m4_define([_LTDL_MODE], [nonrecursive])]) +LT_OPTION_DEFINE([LTDL_INIT], [recursive], + [m4_define([_LTDL_MODE], [recursive])]) +LT_OPTION_DEFINE([LTDL_INIT], [subproject], + [m4_define([_LTDL_MODE], [subproject])]) + +m4_define([_LTDL_TYPE], []) +LT_OPTION_DEFINE([LTDL_INIT], [installable], + [m4_define([_LTDL_TYPE], [installable])]) +LT_OPTION_DEFINE([LTDL_INIT], [convenience], + [m4_define([_LTDL_TYPE], [convenience])]) diff --git a/tests/libs/adios/config/ltsugar.m4 b/tests/libs/adios/config/ltsugar.m4 new file mode 100644 index 0000000000..9000a057d3 --- /dev/null +++ b/tests/libs/adios/config/ltsugar.m4 @@ -0,0 +1,123 @@ +# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- +# +# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. +# Written by Gary V. Vaughan, 2004 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# serial 6 ltsugar.m4 + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) + + +# lt_join(SEP, ARG1, [ARG2...]) +# ----------------------------- +# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their +# associated separator. +# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier +# versions in m4sugar had bugs. +m4_define([lt_join], +[m4_if([$#], [1], [], + [$#], [2], [[$2]], + [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) +m4_define([_lt_join], +[m4_if([$#$2], [2], [], + [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) + + +# lt_car(LIST) +# lt_cdr(LIST) +# ------------ +# Manipulate m4 lists. +# These macros are necessary as long as will still need to support +# Autoconf-2.59 which quotes differently. +m4_define([lt_car], [[$1]]) +m4_define([lt_cdr], +[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], + [$#], 1, [], + [m4_dquote(m4_shift($@))])]) +m4_define([lt_unquote], $1) + + +# lt_append(MACRO-NAME, STRING, [SEPARATOR]) +# ------------------------------------------ +# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. +# Note that neither SEPARATOR nor STRING are expanded; they are appended +# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). +# No SEPARATOR is output if MACRO-NAME was previously undefined (different +# than defined and empty). +# +# This macro is needed until we can rely on Autoconf 2.62, since earlier +# versions of m4sugar mistakenly expanded SEPARATOR but not STRING. +m4_define([lt_append], +[m4_define([$1], + m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) + + + +# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) +# ---------------------------------------------------------- +# Produce a SEP delimited list of all paired combinations of elements of +# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list +# has the form PREFIXmINFIXSUFFIXn. +# Needed until we can rely on m4_combine added in Autoconf 2.62. +m4_define([lt_combine], +[m4_if(m4_eval([$# > 3]), [1], + [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl +[[m4_foreach([_Lt_prefix], [$2], + [m4_foreach([_Lt_suffix], + ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, + [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) + + +# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) +# ----------------------------------------------------------------------- +# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited +# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. +m4_define([lt_if_append_uniq], +[m4_ifdef([$1], + [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], + [lt_append([$1], [$2], [$3])$4], + [$5])], + [lt_append([$1], [$2], [$3])$4])]) + + +# lt_dict_add(DICT, KEY, VALUE) +# ----------------------------- +m4_define([lt_dict_add], +[m4_define([$1($2)], [$3])]) + + +# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) +# -------------------------------------------- +m4_define([lt_dict_add_subkey], +[m4_define([$1($2:$3)], [$4])]) + + +# lt_dict_fetch(DICT, KEY, [SUBKEY]) +# ---------------------------------- +m4_define([lt_dict_fetch], +[m4_ifval([$3], + m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), + m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) + + +# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) +# ----------------------------------------------------------------- +m4_define([lt_if_dict_fetch], +[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], + [$5], + [$6])]) + + +# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) +# -------------------------------------------------------------- +m4_define([lt_dict_filter], +[m4_if([$5], [], [], + [lt_join(m4_quote(m4_default([$4], [[, ]])), + lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), + [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl +]) diff --git a/tests/libs/adios/config/ltversion.m4 b/tests/libs/adios/config/ltversion.m4 new file mode 100644 index 0000000000..f3c5309802 --- /dev/null +++ b/tests/libs/adios/config/ltversion.m4 @@ -0,0 +1,23 @@ +# ltversion.m4 -- version numbers -*- Autoconf -*- +# +# Copyright (C) 2004 Free Software Foundation, Inc. +# Written by Scott James Remnant, 2004 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# Generated from ltversion.in. + +# serial 3017 ltversion.m4 +# This file is part of GNU Libtool + +m4_define([LT_PACKAGE_VERSION], [2.2.6b]) +m4_define([LT_PACKAGE_REVISION], [1.3017]) + +AC_DEFUN([LTVERSION_VERSION], +[macro_version='2.2.6b' +macro_revision='1.3017' +_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) +_LT_DECL(, macro_revision, 0) +]) diff --git a/tests/libs/adios/config/lt~obsolete.m4 b/tests/libs/adios/config/lt~obsolete.m4 new file mode 100644 index 0000000000..637bb2066c --- /dev/null +++ b/tests/libs/adios/config/lt~obsolete.m4 @@ -0,0 +1,92 @@ +# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- +# +# Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc. +# Written by Scott James Remnant, 2004. +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# serial 4 lt~obsolete.m4 + +# These exist entirely to fool aclocal when bootstrapping libtool. +# +# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) +# which have later been changed to m4_define as they aren't part of the +# exported API, or moved to Autoconf or Automake where they belong. +# +# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN +# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us +# using a macro with the same name in our local m4/libtool.m4 it'll +# pull the old libtool.m4 in (it doesn't see our shiny new m4_define +# and doesn't know about Autoconf macros at all.) +# +# So we provide this file, which has a silly filename so it's always +# included after everything else. This provides aclocal with the +# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything +# because those macros already exist, or will be overwritten later. +# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. +# +# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. +# Yes, that means every name once taken will need to remain here until +# we give up compatibility with versions before 1.7, at which point +# we need to keep only those names which we still refer to. + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) + +m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) +m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) +m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) +m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) +m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) +m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) +m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) +m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) +m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) +m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) +m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) +m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) +m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) +m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) +m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) +m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) +m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) +m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) +m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) +m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) +m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) +m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) +m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) +m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) +m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) +m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) +m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) +m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) +m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) +m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) +m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) +m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) +m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) +m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) +m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) +m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) +m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) +m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) +m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) +m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) +m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) +m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) +m4_ifndef([AC_LIBTOOL_RC], [AC_DEFUN([AC_LIBTOOL_RC])]) +m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) +m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) +m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) +m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) +m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) +m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) +m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) +m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) diff --git a/tests/libs/adios/configure.ac b/tests/libs/adios/configure.ac new file mode 100644 index 0000000000..e495c09f7b --- /dev/null +++ b/tests/libs/adios/configure.ac @@ -0,0 +1,1169 @@ +s +AC_INIT([adios], [1.8.0]) +AC_CONFIG_SRCDIR([configure.ac]) +AC_CONFIG_AUX_DIR(config) +AC_CONFIG_MACRO_DIR(config) +AC_REVISION($Revision$) + +AC_CONFIG_HEADERS(config.h) +AM_INIT_AUTOMAKE + +AM_MAINTAINER_MODE([enable]) + +AC_LANG(C) +AC_C_STRINGIZE +dnl generates HAVE_STRINGIZE + +AC_PROG_CC +AM_PROG_CC_C_O +AC_PROG_CXX + +AC_LANG(C) +ACX_MPI([], [AC_MSG_ERROR([could not find mpi library for C])]) + +AC_LANG(C++) +ACX_MPI([], [AC_MSG_ERROR([could not find mpi library for C++])]) + +AC_ARG_ENABLE(fortran, + [AS_HELP_STRING([--disable-fortran],[disable Fortran test programs in ADIOS.])]) +AM_CONDITIONAL([BUILD_FORTRAN], [test "x$enable_fortran" != "xno"]) + +if test "x$enable_fortran" != "xno"; then + AC_PROG_FC + AC_PROG_FC_C_O + AC_FC_WRAPPERS + F77=$FC + dnl AC_PROG_F77 + dnl AC_PROG_F77_C_O + AC_LANG(Fortran) + ACX_MPI([], [AC_MSG_ERROR([could not find mpi library for Fortran])]) +fi + +AC_LANG(C) + +dnl Generate libtool script and then do a nasty thing. +dnl PGI compiler (behind MPICC) does not like --rpath. +dnl The only way I found to avoid the problem is to remove the chance of using it +dnl inside the libtool script. Similar to what HDF5 configure does. +dnl see: http://www.hdfgroup.org/ftp/HDF5/current/src/unpacked/configure.in +dnl look the snippet after LT_INIT there. +AC_PROG_LIBTOOL +#LT_INIT([disable-shared]) +dnl echo 'fixing hardcode_libdir_flag_spec in' $ofile +dnl ed - $ofile < /dev/null +dnl g/^wl=".*"/s//wl="-Wl,"/ +dnl w +dnl q +dnl EOF +dnl g/^hardcode_libdir_flag_spec=".*"/s//hardcode_libdir_flag_spec=""/ +dnl g/^hardcode_libdir_flag_spec_ld=".*"/s//hardcode_libdir_flag_spec_ld=""/ + +AC_SEARCH_LIBS([nanosleep], [rt]) +AC_CHECK_FUNCS([nanosleep strncpy strerror gettimeofday]) + +AC_ARG_ENABLE(write, + [AS_HELP_STRING([--disable-write],[disable building the write methods in ADIOS.])]) +AM_CONDITIONAL([BUILD_WRITE], [test "x$enable_write" != "xno"]) + +AC_MXML +dnl MXML is required for Write API, turn off Write if MXML is not present +if test -z "${HAVE_MXML_FALSE}" -a -z "${BUILD_WRITE_TRUE}"; then + AC_MSG_ERROR([The ADIOS libraries for writing cannot be built without the MXML library. Either specify where the MXML library is found, or use --disable-write to build ADIOS for reading only.]) + dnl AM_CONDITIONAL([BUILD_WRITE], false) +fi + +dnl AC_PROG_GENGETOPT +AC_PAMI +AC_DCMF +AC_INFINIBAND +AC_PORTALS +AC_CRAY_PMI +AC_CRAY_UGNI +AC_HDF5 +AC_PHDF5 +AC_NETCDF +AC_NC4PAR +AC_NSSI +AC_PROG_DATASPACES +AC_PROG_DIMES +AC_DMALLOC +AC_LUSTRE +AC_FGR +AC_GLIB +AC_DATATAP +AC_FLEXPATH +AC_ZLIB +AC_BZIP2 +AC_SZIP +AC_ISOBAR +AC_APLOD +AC_ALACRITY +AC_RIDCOMPRESS +AC_FASTBIT +AX_NCSU_LIBTIMER +AC_BGQ + +AC_LANG(C) + + +AC_ARG_ENABLE(research-transports, + [AS_HELP_STRING([--enable-research-transports], + [Enable building the various research transports. Default is not to build these as they are not part of the base distribution.])]) +AM_CONDITIONAL([RESEARCH_TRANSPORTS], [test "x$enable_research_transports" == "xyes"]) + +AC_LANG(C) + + +AC_ARG_ENABLE(timers, + [AS_HELP_STRING([--disable-timers], + [Disable the adios timing mechanism. By default the timers are used.])]) +AM_CONDITIONAL([ADIOS_TIMERS], [test "x$enable_timers" != "xno"]) + + +if test "x$enable_timers" != "xno"; then + AC_DEFINE(ADIOS_TIMERS, 1, [Adios timing is enabled]) + AC_SUBST(SKEL_HAVE_ADIOS_TIMING,True) + dnl The macro AM_SUBST_NOTMAKE does not work on Hopper with automake 10.1 + dnl AM_SUBST_NOTMAKE(SKEL_HAVE_ADIOS_TIMING,true) +else + AC_SUBST(SKEL_HAVE_ADIOS_TIMING,False) + dnl AM_SUBST_NOTMAKE(SKEL_HAVE_ADIOS_TIMING,false) +fi +AC_SUBST(ADIOS_TIMERS) + + +AC_ARG_ENABLE(timer-events, + [AS_HELP_STRING([--enable-timer-events], + [Enable adios timing events. By default the events are not used.])]) +AM_CONDITIONAL([ADIOS_TIMER_EVENTS], [test "x$enable_timer_events" == "xyes"]) + + +if test "x$enable_timer_events" == "xyes"; then + AC_DEFINE(ADIOS_TIMER_EVENTS, 1, [Adios timing events are enabled]) +fi +AC_SUBST(ADIOS_TIMER_EVENTS) + + +AC_LANG(C) + +AM_CONDITIONAL([HAVE_DATATAP], [test x$datatap != xdisable]) + + +dnl CC="$MPICC" +dnl CXX="$MPICXX" +dnl FC="$MPIFC" + +dnl Unset if MPILIBS == " ", a byproduct of config/acx_mpi.m4 on success +if test "x y" == "x${MPILIBS}y"; then + MPILIBS="" +fi +if test -n "${MPILIBS}"; then + LIBS="${MPILIBS} ${LIBS}" +fi + +AM_CONDITIONAL(USE_PARALLEL_COMPILER,false) + +if test -z "${MACRODEFFLAG}"; then + MACRODEFFLAG="-D" +fi +AC_SUBST(MACRODEFFLAG) + + +dnl Use PHDF5 for bp2h5 if no sequential HDF5 was found +if test -z "${HAVE_PHDF5_TRUE}" -a -z "${HAVE_HDF5_FALSE}"; then + HDF5_CPPFLAGS="${PHDF5_CPPFLAGS}" + HDF5_CFLAGS="${PHDF5_CFLAGS}" + HDF5_LDFLAGS="${PHDF5_LDFLAGS}" + HDF5_LIBS="${PHDF5_LIBS}" + AM_CONDITIONAL(HAVE_HDF5,true) + AC_DEFINE(HAVE_HDF5,1,[Define if you have HDF5.]) + AM_CONDITIONAL(USE_PARALLEL_COMPILER,true) + AC_MSG_NOTICE([Use PHDF5 for sequential HDF5 tools]) +fi + +dnl Use NC4PAR for bp2ncd if no sequential NETCDF was found +if test -z "${HAVE_NC4PAR_TRUE}" -a -z "${HAVE_NETCDF_FALSE}"; then + NETCDF_CPPFLAGS="${NC4PAR_CPPFLAGS}" + NETCDF_CFLAGS="${NC4PAR_CFLAGS}" + NETCDF_LDFLAGS="${NC4PAR_LDFLAGS}" + NETCDF_LIBS="${NC4PAR_LIBS}" + AM_CONDITIONAL(HAVE_NETCDF,true) + AC_DEFINE(HAVE_NETCDF,1,[Define if you have NETCDF.]) + AM_CONDITIONAL(USE_PARALLEL_COMPILER,true) + AC_MSG_NOTICE([Use NC4PAR for sequential NETCDF tools]) +fi + + +dnl Generate flags for adios lib creation which depends on the packages we found +dnl ADIOSLIB_* for compiling libadios.a and libadiosf.a, and linking codes with those +dnl ADIOSLIB_SEQ_* for compiling libadios_nompi.a and libadiosf_nompi.a with dummy MPI +dnl ADIOSLIB_INT_* for codes using libadios_internal_nompi.a (like bp2ncd, bp2h5, bpdump etc) +dnl ADIOSREADLIB_* for codes using libadiosread.a, libadiosreadf.a +dnl ADIOSREADLIB_SEQ_* for codes using libadiosread_nompi.a +dnl adios_config will contain flags for users' code linking based on these flags +dnl EXTRA flags are used for compiling adios stuff, which need not go into adios_config for user codes +ADIOSLIB_EXTRA_CPPFLAGS="${MACRODEFFLAG}_FILE_OFFSET_BITS=64 ${MACRODEFFLAG}_LARGEFILE_SOURCE ${MACRODEFFLAG}_LARGEFILE64_SOURCE ${MACRODEFFLAG}_GNU_SOURCE" +ADIOSLIB_CPPFLAGS="${MXML_CPPFLAGS}" +ADIOSLIB_CFLAGS= +ADIOSLIB_LDFLAGS="${MXML_LDFLAGS}" +ADIOSLIB_LDADD="-lm ${MXML_LIBS}" +ADIOSLIB_SEQ_CPPFLAGS="${MACRODEFFLAG}_NOMPI ${MXML_CPPFLAGS}" +ADIOSLIB_SEQ_CFLAGS= +ADIOSLIB_SEQ_LDFLAGS="${MXML_LDFLAGS}" +ADIOSLIB_SEQ_LDADD="-lm ${MXML_LIBS}" +ADIOSLIB_INT_CPPFLAGS="${MACRODEFFLAG}_NOMPI" +ADIOSLIB_INT_CFLAGS= +ADIOSLIB_INT_LDFLAGS= +ADIOSLIB_INT_LDADD= +if test "x$enable_write" != "xno"; then + ADIOSLIB_INT_CPPFLAGS="${ADIOSLIB_INT_CPPFLAGS} ${MXML_CPPFLAGS}" + ADIOSLIB_INT_LDFLAGS="${MXML_LDFLAGS}" + ADIOSLIB_INT_LDADD="-lm ${MXML_LIBS}" +fi +ADIOSREADLIB_CPPFLAGS= +ADIOSREADLIB_CFLAGS= +ADIOSREADLIB_LDFLAGS= +ADIOSREADLIB_LDADD="-lm" +ADIOSREADLIB_SEQ_CPPFLAGS="${MACRODEFFLAG}_NOMPI" +ADIOSREADLIB_SEQ_CFLAGS= +ADIOSREADLIB_SEQ_LDFLAGS= +ADIOSREADLIB_SEQ_LDADD="-lm" +if test "x${datatap}" != "xdisable"; then + ADIOSLIB_CPPFLAGS="${ADIOSLIB_CPPFLAGS} ${DT_CPPFLAGS}" + ADIOSLIB_CFLAGS="${ADIOSLIB_CFLAGS} ${DT_CFLAGS}" + ADIOSLIB_LDFLAGS="${ADIOSLIB_LDFLAGS} ${DT_LDFLAGS}" + ADIOSLIB_LDADD="${ADIOSLIB_LDADD} ${DT_LIBS}" + ADIOSREADLIB_CPPFLAGS="${ADIOSREADLIB_CPPFLAGS} ${DT_CPPFLAGS}" + ADIOSREADLIB_CFLAGS="${ADIOSREADLIB_CFLAGS} ${DT_CFLAGS}" + ADIOSREADLIB_LDFLAGS="${ADIOSREADLIB_LDFLAGS} ${DT_LDFLAGS}" + ADIOSREADLIB_LDADD="${ADIOSREADLIB_LDADD} ${DT_LIBS}" + ADIOSREADLIB_SEQ_CPPFLAGS="${ADIOSREADLIB_SEQ_CPPFLAGS} ${DT_CPPFLAGS}" + ADIOSREADLIB_SEQ_CFLAGS="${ADIOSREADLIB_SEQ_CFLAGS} ${DT_CFLAGS}" + ADIOSREADLIB_SEQ_LDFLAGS="${ADIOSREADLIB_SEQ_LDFLAGS} ${DT_LDFLAGS}" + ADIOSREADLIB_SEQ_LDADD="${ADIOSREADLIB_SEQ_LDADD} ${DT_LIBS}" +fi +if test -z "${HAVE_DATASPACES_TRUE}"; then + ADIOSLIB_CPPFLAGS="${ADIOSLIB_CPPFLAGS} ${DATASPACES_CPPFLAGS}" + ADIOSLIB_CFLAGS="${ADIOSLIB_CFLAGS}" + ADIOSLIB_LDFLAGS="${ADIOSLIB_LDFLAGS} ${DATASPACES_LDFLAGS}" + ADIOSLIB_LDADD="${ADIOSLIB_LDADD} ${DATASPACES_LIBS}" + ADIOSLIB_SEQ_CPPFLAGS="${ADIOSLIB_SEQ_CPPFLAGS} ${DATASPACES_CPPFLAGS}" + ADIOSLIB_SEQ_CFLAGS="${ADIOSLIB_SEQ_CFLAGS}" + ADIOSLIB_SEQ_LDFLAGS="${ADIOSLIB_SEQ_LDFLAGS} ${DATASPACES_LDFLAGS}" + ADIOSLIB_SEQ_LDADD="${ADIOSLIB_SEQ_LDADD} ${DATASPACES_LIBS}" + ADIOSREADLIB_CPPFLAGS="${ADIOSREADLIB_CPPFLAGS} ${DATASPACES_CPPFLAGS}" + ADIOSREADLIB_CFLAGS="${ADIOSREADLIB_CFLAGS} ${DATASPACES_CFLAGS}" + ADIOSREADLIB_LDFLAGS="${ADIOSREADLIB_LDFLAGS} ${DATASPACES_LDFLAGS}" + ADIOSREADLIB_LDADD="${ADIOSREADLIB_LDADD} ${DATASPACES_LIBS}" + ADIOSREADLIB_SEQ_CPPFLAGS="${ADIOSREADLIB_SEQ_CPPFLAGS} ${DATASPACES_CPPFLAGS}" + ADIOSREADLIB_SEQ_CFLAGS="${ADIOSREADLIB_SEQ_CFLAGS} ${DATASPACES_CFLAGS}" + ADIOSREADLIB_SEQ_LDFLAGS="${ADIOSREADLIB_SEQ_LDFLAGS} ${DATASPACES_LDFLAGS}" + ADIOSREADLIB_SEQ_LDADD="${ADIOSREADLIB_SEQ_LDADD} ${DATASPACES_LIBS}" +fi +if test -z "${HAVE_DIMES_TRUE}"; then + ADIOSLIB_CPPFLAGS="${ADIOSLIB_CPPFLAGS} ${DIMES_CPPFLAGS}" + ADIOSLIB_CFLAGS="${ADIOSLIB_CFLAGS}" + ADIOSLIB_LDFLAGS="${ADIOSLIB_LDFLAGS} ${DIMES_LDFLAGS}" + ADIOSLIB_LDADD="${ADIOSLIB_LDADD} ${DIMES_LIBS}" + ADIOSLIB_SEQ_CPPFLAGS="${ADIOSLIB_SEQ_CPPFLAGS} ${DIMES_CPPFLAGS}" + ADIOSLIB_SEQ_CFLAGS="${ADIOSLIB_SEQ_CFLAGS}" + ADIOSLIB_SEQ_LDFLAGS="${ADIOSLIB_SEQ_LDFLAGS} ${DIMES_LDFLAGS}" + ADIOSLIB_SEQ_LDADD="${ADIOSLIB_SEQ_LDADD} ${DIMES_LIBS}" + ADIOSREADLIB_CPPFLAGS="${ADIOSREADLIB_CPPFLAGS} ${DIMES_CPPFLAGS}" + ADIOSREADLIB_CFLAGS="${ADIOSREADLIB_CFLAGS} ${DIMES_CFLAGS}" + ADIOSREADLIB_LDFLAGS="${ADIOSREADLIB_LDFLAGS} ${DIMES_LDFLAGS}" + ADIOSREADLIB_LDADD="${ADIOSREADLIB_LDADD} ${DIMES_LIBS}" + ADIOSREADLIB_SEQ_CPPFLAGS="${ADIOSREADLIB_SEQ_CPPFLAGS} ${DIMES_CPPFLAGS}" + ADIOSREADLIB_SEQ_CFLAGS="${ADIOSREADLIB_SEQ_CFLAGS} ${DIMES_CFLAGS}" + ADIOSREADLIB_SEQ_LDFLAGS="${ADIOSREADLIB_SEQ_LDFLAGS} ${DIMES_LDFLAGS}" + ADIOSREADLIB_SEQ_LDADD="${ADIOSREADLIB_SEQ_LDADD} ${DIMES_LIBS}" +fi +if test -z "${HAVE_NSSI_TRUE}"; then + ADIOSLIB_CPPFLAGS="${ADIOSLIB_CPPFLAGS} ${NSSI_CPPFLAGS}" + ADIOSLIB_CFLAGS="${ADIOSLIB_CFLAGS} ${NSSI_CFLAGS}" + ADIOSLIB_LDFLAGS="${ADIOSLIB_LDFLAGS} ${NSSI_LDFLAGS}" + ADIOSLIB_LDADD="${ADIOSLIB_LDADD} ${NSSI_LIBS}" + ADIOSLIB_SEQ_CPPFLAGS="${ADIOSLIB_SEQ_CPPFLAGS} ${NSSI_CPPFLAGS}" + ADIOSLIB_SEQ_CFLAGS="${ADIOSLIB_SEQ_CFLAGS} ${NSSI_CFLAGS}" + ADIOSLIB_SEQ_LDFLAGS="${ADIOSLIB_SEQ_LDFLAGS} ${NSSI_LDFLAGS}" + ADIOSLIB_SEQ_LDADD="${ADIOSLIB_SEQ_LDADD} ${NSSI_LIBS}" + ADIOSREADLIB_CPPFLAGS="${ADIOSREADLIB_CPPFLAGS} ${MXML_CPPFLAGS} ${NSSI_CPPFLAGS}" + ADIOSREADLIB_CFLAGS="${ADIOSREADLIB_CFLAGS} ${MXML_CPPFLAGS} ${NSSI_CFLAGS}" + ADIOSREADLIB_LDFLAGS="${ADIOSREADLIB_LDFLAGS} ${MXML_LDFLAGS} ${NSSI_LDFLAGS}" + ADIOSREADLIB_LDADD="${ADIOSREADLIB_LDADD} ${MXML_LIBS} ${NSSI_LIBS}" + ADIOSREADLIB_SEQ_CPPFLAGS="${ADIOSREADLIB_SEQ_CPPFLAGS} ${MXML_CPPFLAGS} ${NSSI_CPPFLAGS}" + ADIOSREADLIB_SEQ_CFLAGS="${ADIOSREADLIB_SEQ_CFLAGS} ${MXML_CPPFLAGS} ${NSSI_CFLAGS}" + ADIOSREADLIB_SEQ_LDFLAGS="${ADIOSREADLIB_SEQ_LDFLAGS} ${MXML_LDFLAGS} ${NSSI_LDFLAGS}" + ADIOSREADLIB_SEQ_LDADD="${ADIOSREADLIB_SEQ_LDADD} ${MXML_LIBS} ${NSSI_LIBS}" +fi +if test -z "${HAVE_FLEXPATH_TRUE}"; then + ADIOSLIB_CPPFLAGS="${ADIOSLIB_CPPFLAGS} ${FP_CPPFLAGS}" + ADIOSLIB_CFLAGS="${ADIOSLIB_CFLAGS} ${FP_CFLAGS}" + ADIOSLIB_LDFLAGS="${ADIOSLIB_LDFLAGS} ${FP_LDFLAGS}" + ADIOSLIB_LDADD="${ADIOSLIB_LDADD} ${FP_LIBS}" + ADIOSLIB_SEQ_CPPFLAGS="${ADIOSLIB_SEQ_CPPFLAGS} ${FP_CPPFLAGS}" + ADIOSLIB_SEQ_CFLAGS="${ADIOSLIB_SEQ_CFLAGS} ${FP_CFLAGS}" + ADIOSLIB_SEQ_LDFLAGS="${ADIOSLIB_SEQ_LDFLAGS} ${FP_LDFLAGS}" + ADIOSLIB_SEQ_LDADD="${ADIOSLIB_SEQ_LDADD} ${FP_LIBS}" + ADIOSREADLIB_CPPFLAGS="${ADIOSREADLIB_CPPFLAGS} ${FP_CPPFLAGS}" + ADIOSREADLIB_CFLAGS="${ADIOSREADLIB_CFLAGS} ${FP_CFLAGS}" + ADIOSREADLIB_LDFLAGS="${ADIOSREADLIB_LDFLAGS} ${FP_LDFLAGS}" + ADIOSREADLIB_LDADD="${ADIOSREADLIB_LDADD} ${FP_LIBS}" + ADIOSREADLIB_SEQ_CPPFLAGS="${ADIOSREADLIB_SEQ_CPPFLAGS} ${FP_CPPFLAGS}" + ADIOSREADLIB_SEQ_CFLAGS="${ADIOSREADLIB_SEQ_CFLAGS} ${FP_CFLAGS}" + ADIOSREADLIB_SEQ_LDFLAGS="${ADIOSREADLIB_SEQ_LDFLAGS} ${FP_LDFLAGS}" + ADIOSREADLIB_SEQ_LDADD="${ADIOSREADLIB_SEQ_LDADD} ${FP_LIBS}" +fi +if test -z "${HAVE_NC4PAR_TRUE}"; then + ADIOSLIB_CPPFLAGS="${ADIOSLIB_CPPFLAGS} ${NC4PAR_CPPFLAGS}" + ADIOSLIB_CFLAGS="${ADIOSLIB_CFLAGS} ${NC4PAR_CFLAGS}" + ADIOSLIB_LDFLAGS="${ADIOSLIB_LDFLAGS} ${NC4PAR_LDFLAGS}" + ADIOSLIB_LDADD="${ADIOSLIB_LDADD} ${NC4PAR_LIBS}" +fi +if test -z "${HAVE_PHDF5_TRUE}"; then + ADIOSLIB_CPPFLAGS="${ADIOSLIB_CPPFLAGS} ${PHDF5_CPPFLAGS}" + ADIOSLIB_CFLAGS="${ADIOSLIB_CFLAGS} ${PHDF5_CFLAGS}" + ADIOSLIB_LDFLAGS="${ADIOSLIB_LDFLAGS} ${PHDF5_LDFLAGS}" + ADIOSLIB_LDADD="${ADIOSLIB_LDADD} ${PHDF5_LIBS}" +fi +if test -z "${HAVE_PORTALS_TRUE}"; then + ADIOSLIB_CPPFLAGS="${ADIOSLIB_CPPFLAGS} ${PORTALS_CPPFLAGS}" + ADIOSLIB_CFLAGS="${ADIOSLIB_CFLAGS} ${PORTALS_CFLAGS}" + ADIOSLIB_LDFLAGS="${ADIOSLIB_LDFLAGS} ${PORTALS_LDFLAGS}" + ADIOSLIB_LDADD="${ADIOSLIB_LDADD} ${PORTALS_LIBS}" + ADIOSLIB_SEQ_CPPFLAGS="${ADIOSLIB_SEQ_CPPFLAGS} ${PORTALS_CPPFLAGS}" + ADIOSLIB_SEQ_CFLAGS="${ADIOSLIB_SEQ_CFLAGS} ${PORTALS_CFLAGS}" + ADIOSLIB_SEQ_LDFLAGS="${ADIOSLIB_SEQ_LDFLAGS} ${PORTALS_LDFLAGS}" + ADIOSLIB_SEQ_LDADD="${ADIOSLIB_SEQ_LDADD} ${PORTALS_LIBS}" + ADIOSREADLIB_CPPFLAGS="${ADIOSREADLIB_CPPFLAGS} ${PORTALS_CPPFLAGS}" + ADIOSREADLIB_CFLAGS="${ADIOSREADLIB_CFLAGS} ${PORTALS_CFLAGS}" + ADIOSREADLIB_LDFLAGS="${ADIOSREADLIB_LDFLAGS} ${PORTALS_LDFLAGS}" + ADIOSREADLIB_LDADD="${ADIOSREADLIB_LDADD} ${PORTALS_LIBS}" + ADIOSREADLIB_SEQ_CPPFLAGS="${ADIOSREADLIB_SEQ_CPPFLAGS} ${PORTALS_CPPFLAGS}" + ADIOSREADLIB_SEQ_CFLAGS="${ADIOSREADLIB_SEQ_CFLAGS} ${PORTALS_CFLAGS}" + ADIOSREADLIB_SEQ_LDFLAGS="${ADIOSREADLIB_SEQ_LDFLAGS} ${PORTALS_LDFLAGS}" + ADIOSREADLIB_SEQ_LDADD="${ADIOSREADLIB_SEQ_LDADD} ${PORTALS_LIBS}" +fi +if test -z "${HAVE_INFINIBAND_TRUE}"; then + ADIOSLIB_CPPFLAGS="${ADIOSLIB_CPPFLAGS} ${INFINIBAND_CPPFLAGS}" + ADIOSLIB_CFLAGS="${ADIOSLIB_CFLAGS} ${INFINIBAND_CFLAGS}" + ADIOSLIB_LDFLAGS="${ADIOSLIB_LDFLAGS} ${INFINIBAND_LDFLAGS}" + ADIOSLIB_LDADD="${ADIOSLIB_LDADD} ${INFINIBAND_LIBS}" + ADIOSLIB_SEQ_CPPFLAGS="${ADIOSLIB_SEQ_CPPFLAGS} ${INFINIBAND_CPPFLAGS}" + ADIOSLIB_SEQ_CFLAGS="${ADIOSLIB_SEQ_CFLAGS} ${INFINIBAND_CFLAGS}" + ADIOSLIB_SEQ_LDFLAGS="${ADIOSLIB_SEQ_LDFLAGS} ${INFINIBAND_LDFLAGS}" + ADIOSLIB_SEQ_LDADD="${ADIOSLIB_SEQ_LDADD} ${INFINIBAND_LIBS}" + ADIOSREADLIB_CPPFLAGS="${ADIOSREADLIB_CPPFLAGS} ${INFINIBAND_CPPFLAGS}" + ADIOSREADLIB_CFLAGS="${ADIOSREADLIB_CFLAGS} ${INFINIBAND_CFLAGS}" + ADIOSREADLIB_LDFLAGS="${ADIOSREADLIB_LDFLAGS} ${INFINIBAND_LDFLAGS}" + ADIOSREADLIB_LDADD="${ADIOSREADLIB_LDADD} ${INFINIBAND_LIBS}" + ADIOSREADLIB_SEQ_CPPFLAGS="${ADIOSREADLIB_SEQ_CPPFLAGS} ${INFINIBAND_CPPFLAGS}" + ADIOSREADLIB_SEQ_CFLAGS="${ADIOSREADLIB_SEQ_CFLAGS} ${INFINIBAND_CFLAGS}" + ADIOSREADLIB_SEQ_LDFLAGS="${ADIOSREADLIB_SEQ_LDFLAGS} ${INFINIBAND_LDFLAGS}" + ADIOSREADLIB_SEQ_LDADD="${ADIOSREADLIB_SEQ_LDADD} ${INFINIBAND_LIBS}" +fi +if test -z "${HAVE_CRAY_PMI_TRUE}"; then + ADIOSLIB_CPPFLAGS="${ADIOSLIB_CPPFLAGS} ${CRAY_PMI_CPPFLAGS}" + ADIOSLIB_CFLAGS="${ADIOSLIB_CFLAGS} ${CRAY_PMI_CFLAGS}" + ADIOSLIB_LDFLAGS="${ADIOSLIB_LDFLAGS} ${CRAY_PMI_LDFLAGS}" + ADIOSLIB_LDADD="${ADIOSLIB_LDADD} ${CRAY_PMI_LIBS}" + ADIOSLIB_SEQ_CPPFLAGS="${ADIOSLIB_SEQ_CPPFLAGS} ${CRAY_PMI_CPPFLAGS}" + ADIOSLIB_SEQ_CFLAGS="${ADIOSLIB_SEQ_CFLAGS} ${CRAY_PMI_CFLAGS}" + ADIOSLIB_SEQ_LDFLAGS="${ADIOSLIB_SEQ_LDFLAGS} ${CRAY_PMI_LDFLAGS}" + ADIOSLIB_SEQ_LDADD="${ADIOSLIB_SEQ_LDADD} ${CRAY_PMI_LIBS}" + ADIOSREADLIB_CPPFLAGS="${ADIOSREADLIB_CPPFLAGS} ${CRAY_PMI_CPPFLAGS}" + ADIOSREADLIB_CFLAGS="${ADIOSREADLIB_CFLAGS} ${CRAY_PMI_CFLAGS}" + ADIOSREADLIB_LDFLAGS="${ADIOSREADLIB_LDFLAGS} ${CRAY_PMI_LDFLAGS}" + ADIOSREADLIB_LDADD="${ADIOSREADLIB_LDADD} ${CRAY_PMI_LIBS}" + ADIOSREADLIB_SEQ_CPPFLAGS="${ADIOSREADLIB_SEQ_CPPFLAGS} ${CRAY_PMI_CPPFLAGS}" + ADIOSREADLIB_SEQ_CFLAGS="${ADIOSREADLIB_SEQ_CFLAGS} ${CRAY_PMI_CFLAGS}" + ADIOSREADLIB_SEQ_LDFLAGS="${ADIOSREADLIB_SEQ_LDFLAGS} ${CRAY_PMI_LDFLAGS}" + ADIOSREADLIB_SEQ_LDADD="${ADIOSREADLIB_SEQ_LDADD} ${CRAY_PMI_LIBS}" +fi +if test -z "${HAVE_CRAY_UGNI_TRUE}"; then + ADIOSLIB_CPPFLAGS="${ADIOSLIB_CPPFLAGS} ${CRAY_UGNI_CPPFLAGS}" + ADIOSLIB_CFLAGS="${ADIOSLIB_CFLAGS} ${CRAY_UGNI_CFLAGS}" + ADIOSLIB_LDFLAGS="${ADIOSLIB_LDFLAGS} ${CRAY_UGNI_LDFLAGS}" + ADIOSLIB_LDADD="${ADIOSLIB_LDADD} ${CRAY_UGNI_LIBS}" + ADIOSLIB_SEQ_CPPFLAGS="${ADIOSLIB_SEQ_CPPFLAGS} ${CRAY_UGNI_CPPFLAGS}" + ADIOSLIB_SEQ_CFLAGS="${ADIOSLIB_SEQ_CFLAGS} ${CRAY_UGNI_CFLAGS}" + ADIOSLIB_SEQ_LDFLAGS="${ADIOSLIB_SEQ_LDFLAGS} ${CRAY_UGNI_LDFLAGS}" + ADIOSLIB_SEQ_LDADD="${ADIOSLIB_SEQ_LDADD} ${CRAY_UGNI_LIBS}" + ADIOSREADLIB_CPPFLAGS="${ADIOSREADLIB_CPPFLAGS} ${CRAY_UGNI_CPPFLAGS}" + ADIOSREADLIB_CFLAGS="${ADIOSREADLIB_CFLAGS} ${CRAY_UGNI_CFLAGS}" + ADIOSREADLIB_LDFLAGS="${ADIOSREADLIB_LDFLAGS} ${CRAY_UGNI_LDFLAGS}" + ADIOSREADLIB_LDADD="${ADIOSREADLIB_LDADD} ${CRAY_UGNI_LIBS}" + ADIOSREADLIB_SEQ_CPPFLAGS="${ADIOSREADLIB_SEQ_CPPFLAGS} ${CRAY_UGNI_CPPFLAGS}" + ADIOSREADLIB_SEQ_CFLAGS="${ADIOSREADLIB_SEQ_CFLAGS} ${CRAY_UGNI_CFLAGS}" + ADIOSREADLIB_SEQ_LDFLAGS="${ADIOSREADLIB_SEQ_LDFLAGS} ${CRAY_UGNI_LDFLAGS}" + ADIOSREADLIB_SEQ_LDADD="${ADIOSREADLIB_SEQ_LDADD} ${CRAY_UGNI_LIBS}" +fi +if test -z "${HAVE_DCMF_TRUE}"; then + ADIOSLIB_CPPFLAGS="${ADIOSLIB_CPPFLAGS} ${DCMF_CPPFLAGS}" + ADIOSLIB_CFLAGS="${ADIOSLIB_CFLAGS} ${DCMF_CFLAGS}" + ADIOSLIB_LDFLAGS="${ADIOSLIB_LDFLAGS} ${DCMF_LDFLAGS}" + ADIOSLIB_LDADD="${ADIOSLIB_LDADD} ${DCMF_LIBS}" + ADIOSLIB_SEQ_CPPFLAGS="${ADIOSLIB_SEQ_CPPFLAGS} ${DCMF_CPPFLAGS}" + ADIOSLIB_SEQ_CFLAGS="${ADIOSLIB_SEQ_CFLAGS} ${DCMF_CFLAGS}" + ADIOSLIB_SEQ_LDFLAGS="${ADIOSLIB_SEQ_LDFLAGS} ${DCMF_LDFLAGS}" + ADIOSLIB_SEQ_LDADD="${ADIOSLIB_SEQ_LDADD} ${DCMF_LIBS}" + ADIOSREADLIB_CPPFLAGS="${ADIOSREADLIB_CPPFLAGS} ${DCMF_CPPFLAGS}" + ADIOSREADLIB_CFLAGS="${ADIOSREADLIB_CFLAGS} ${DCMF_CFLAGS}" + ADIOSREADLIB_LDFLAGS="${ADIOSREADLIB_LDFLAGS} ${DCMF_LDFLAGS}" + ADIOSREADLIB_LDADD="${ADIOSREADLIB_LDADD} ${DCMF_LIBS}" + ADIOSREADLIB_SEQ_CPPFLAGS="${ADIOSREADLIB_SEQ_CPPFLAGS} ${DCMF_CPPFLAGS}" + ADIOSREADLIB_SEQ_CFLAGS="${ADIOSREADLIB_SEQ_CFLAGS} ${DCMF_CFLAGS}" + ADIOSREADLIB_SEQ_LDFLAGS="${ADIOSREADLIB_SEQ_LDFLAGS} ${DCMF_LDFLAGS}" + ADIOSREADLIB_SEQ_LDADD="${ADIOSREADLIB_SEQ_LDADD} ${DCMF_LIBS}" +fi +if test -z "${HAVE_PAMI_TRUE}"; then + ADIOSLIB_CPPFLAGS="${ADIOSLIB_CPPFLAGS} ${PAMI_CPPFLAGS}" + ADIOSLIB_CFLAGS="${ADIOSLIB_CFLAGS} ${PAMI_CFLAGS}" + ADIOSLIB_LDFLAGS="${ADIOSLIB_LDFLAGS} ${PAMI_LDFLAGS}" + ADIOSLIB_LDADD="${ADIOSLIB_LDADD} ${PAMI_LIBS}" + ADIOSLIB_SEQ_CPPFLAGS="${ADIOSLIB_SEQ_CPPFLAGS} ${PAMI_CPPFLAGS}" + ADIOSLIB_SEQ_CFLAGS="${ADIOSLIB_SEQ_CFLAGS} ${PAMI_CFLAGS}" + ADIOSLIB_SEQ_LDFLAGS="${ADIOSLIB_SEQ_LDFLAGS} ${PAMI_LDFLAGS}" + ADIOSLIB_SEQ_LDADD="${ADIOSLIB_SEQ_LDADD} ${PAMI_LIBS}" + ADIOSREADLIB_CPPFLAGS="${ADIOSREADLIB_CPPFLAGS} ${PAMI_CPPFLAGS}" + ADIOSREADLIB_CFLAGS="${ADIOSREADLIB_CFLAGS} ${PAMI_CFLAGS}" + ADIOSREADLIB_LDFLAGS="${ADIOSREADLIB_LDFLAGS} ${PAMI_LDFLAGS}" + ADIOSREADLIB_LDADD="${ADIOSREADLIB_LDADD} ${PAMI_LIBS}" + ADIOSREADLIB_SEQ_CPPFLAGS="${ADIOSREADLIB_SEQ_CPPFLAGS} ${PAMI_CPPFLAGS}" + ADIOSREADLIB_SEQ_CFLAGS="${ADIOSREADLIB_SEQ_CFLAGS} ${PAMI_CFLAGS}" + ADIOSREADLIB_SEQ_LDFLAGS="${ADIOSREADLIB_SEQ_LDFLAGS} ${PAMI_LDFLAGS}" + ADIOSREADLIB_SEQ_LDADD="${ADIOSREADLIB_SEQ_LDADD} ${PAMI_LIBS}" +fi +if test -z "${HAVE_NETCDF_TRUE}"; then + ADIOSLIB_INT_CPPFLAGS="${ADIOSLIB_INT_CPPFLAGS} ${NETCDF_CPPFLAGS}" + ADIOSLIB_INT_CFLAGS="${ADIOSLIB_INT_CFLAGS} ${NETCDF_CFLAGS}" + ADIOSLIB_INT_LDFLAGS="${ADIOSLIB_INT_LDFLAGS} ${NETCDF_LDFLAGS}" + ADIOSLIB_INT_LDADD="${ADIOSLIB_INT_LDADD} ${NETCDF_LIBS}" +fi +if test -z "${HAVE_HDF5_TRUE}"; then + ADIOSLIB_INT_CPPFLAGS="${ADIOSLIB_INT_CPPFLAGS} ${HDF5_CPPFLAGS}" + ADIOSLIB_INT_CFLAGS="${ADIOSLIB_INT_CFLAGS} ${HDF5_CFLAGS}" + ADIOSLIB_INT_LDFLAGS="${ADIOSLIB_INT_LDFLAGS} ${HDF5_LDFLAGS}" + ADIOSLIB_INT_LDADD="${ADIOSLIB_INT_LDADD} ${HDF5_LIBS}" +fi +if test -z "${HAVE_DMALLOC_TRUE}"; then + ADIOSLIB_CPPFLAGS="${ADIOSLIB_CPPFLAGS} ${MACRODEFFLAG}DMALLOC ${DMALLOC_CPPFLAGS}" + ADIOSLIB_CFLAGS="${ADIOSLIB_CFLAGS} ${DMALLOC_CFLAGS}" + ADIOSLIB_LDFLAGS="${ADIOSLIB_LDFLAGS} ${DMALLOC_LDFLAGS}" + ADIOSLIB_LDADD="${ADIOSLIB_LDADD} ${DMALLOC_LIBS}" + ADIOSLIB_SEQ_CPPFLAGS="${ADIOSLIB_SEQ_CPPFLAGS} ${DMALLOC_CPPFLAGS}" + ADIOSLIB_SEQ_CFLAGS="${ADIOSLIB_SEQ_CFLAGS} ${DMALLOC_CFLAGS}" + ADIOSLIB_SEQ_LDFLAGS="${ADIOSLIB_SEQ_LDFLAGS} ${DMALLOC_LDFLAGS}" + ADIOSLIB_SEQ_LDADD="${ADIOSLIB_SEQ_LDADD} ${DMALLOC_LIBS}" + ADIOSLIB_INT_CPPFLAGS="${ADIOSLIB_INT_CPPFLAGS} ${DMALLOC_CPPFLAGS}" + ADIOSLIB_INT_CFLAGS="${ADIOSLIB_INT_CFLAGS} ${DMALLOC_CFLAGS}" + ADIOSLIB_INT_LDFLAGS="${ADIOSLIB_INT_LDFLAGS} ${DMALLOC_LDFLAGS}" + ADIOSLIB_INT_LDADD="${ADIOSLIB_INT_LDADD} ${DMALLOC_LIBS}" + ADIOSREADLIB_CPPFLAGS="${ADIOSREADLIB_CPPFLAGS} ${DMALLOC_CPPFLAGS}" + ADIOSREADLIB_CFLAGS="${ADIOSREADLIB_CFLAGS} ${DMALLOC_CFLAGS}" + ADIOSREADLIB_LDFLAGS="${ADIOSREADLIB_LDFLAGS} ${DMALLOC_LDFLAGS}" + ADIOSREADLIB_LDADD="${ADIOSREADLIB_LDADD} ${DMALLOC_LIBS}" + ADIOSREADLIB_SEQ_CPPFLAGS="${ADIOSREADLIB_SEQ_CPPFLAGS} ${DMALLOC_CPPFLAGS}" + ADIOSREADLIB_SEQ_CFLAGS="${ADIOSREADLIB_SEQ_CFLAGS} ${DMALLOC_CFLAGS}" + ADIOSREADLIB_SEQ_LDFLAGS="${ADIOSREADLIB_SEQ_LDFLAGS} ${DMALLOC_LDFLAGS}" + ADIOSREADLIB_SEQ_LDADD="${ADIOSREADLIB_SEQ_LDADD} ${DMALLOC_LIBS}" +fi +if test -z "${HAVE_LUSTRE_TRUE}"; then + ADIOSLIB_CPPFLAGS="${ADIOSLIB_CPPFLAGS} ${LUSTRE_CPPFLAGS}" + ADIOSLIB_CFLAGS="${ADIOSLIB_CFLAGS} ${LUSTRE_CFLAGS}" + ADIOSLIB_LDFLAGS="${ADIOSLIB_LDFLAGS} ${LUSTRE_LDFLAGS}" + ADIOSLIB_LDADD="${ADIOSLIB_LDADD} ${LUSTRE_LIBS}" + ADIOSLIB_SEQ_CPPFLAGS="${ADIOSLIB_SEQ_CPPFLAGS} ${LUSTRE_CPPFLAGS}" + ADIOSLIB_SEQ_CFLAGS="${ADIOSLIB_SEQ_CFLAGS} ${LUSTRE_CFLAGS}" + ADIOSLIB_SEQ_LDFLAGS="${ADIOSLIB_SEQ_LDFLAGS} ${LUSTRE_LDFLAGS}" + ADIOSLIB_SEQ_LDADD="${ADIOSLIB_SEQ_LDADD} ${LUSTRE_LIBS}" +fi +if test -z "${HAVE_FGR_TRUE}"; then + ADIOSLIB_CPPFLAGS="${ADIOSLIB_CPPFLAGS} ${FGR_CPPFLAGS}" + ADIOSLIB_CFLAGS="${ADIOSLIB_CFLAGS} ${FGR_CFLAGS}" + ADIOSLIB_LDFLAGS="${ADIOSLIB_LDFLAGS} ${FGR_LDFLAGS}" + ADIOSLIB_LDADD="${ADIOSLIB_LDADD} ${FGR_LIBS}" + ADIOSLIB_SEQ_CPPFLAGS="${ADIOSLIB_SEQ_CPPFLAGS} ${FGR_CPPFLAGS}" + ADIOSLIB_SEQ_CFLAGS="${ADIOSLIB_SEQ_CFLAGS} ${FGR_CFLAGS}" + ADIOSLIB_SEQ_LDFLAGS="${ADIOSLIB_SEQ_LDFLAGS} ${FGR_LDFLAGS}" + ADIOSLIB_SEQ_LDADD="${ADIOSLIB_SEQ_LDADD} ${FGR_LIBS}" +fi +if test -z "${HAVE_GLIB_TRUE}"; then + ADIOSLIB_CPPFLAGS="${ADIOSLIB_CPPFLAGS} ${GLIB_CPPFLAGS}" + ADIOSLIB_CFLAGS="${ADIOSLIB_CFLAGS} ${GLIB_CFLAGS}" + ADIOSLIB_LDFLAGS="${ADIOSLIB_LDFLAGS} ${GLIB_LDFLAGS}" + ADIOSLIB_LDADD="${ADIOSLIB_LDADD} ${GLIB_LIBS}" + ADIOSLIB_SEQ_CPPFLAGS="${ADIOSLIB_SEQ_CPPFLAGS} ${GLIB_CPPFLAGS}" + ADIOSLIB_SEQ_CFLAGS="${ADIOSLIB_SEQ_CFLAGS} ${GLIB_CFLAGS}" + ADIOSLIB_SEQ_LDFLAGS="${ADIOSLIB_SEQ_LDFLAGS} ${GLIB_LDFLAGS}" + ADIOSLIB_SEQ_LDADD="${ADIOSLIB_SEQ_LDADD} ${GLIB_LIBS}" +fi +if test -z "${HAVE_ZLIB_TRUE}"; then + ADIOSLIB_CPPFLAGS="${ADIOSLIB_CPPFLAGS} -DZLIB ${ZLIB_CPPFLAGS}" + ADIOSLIB_CFLAGS="${ADIOSLIB_CFLAGS} ${ZLIB_CFLAGS}" + ADIOSLIB_LDFLAGS="${ADIOSLIB_LDFLAGS} ${ZLIB_LDFLAGS}" + ADIOSLIB_LDADD="${ADIOSLIB_LDADD} ${ZLIB_LIBS}" + ADIOSLIB_SEQ_CPPFLAGS="${ADIOSLIB_SEQ_CPPFLAGS} -DZLIB ${ZLIB_CPPFLAGS}" + ADIOSLIB_SEQ_CFLAGS="${ADIOSLIB_SEQ_CFLAGS} ${ZLIB_CFLAGS}" + ADIOSLIB_SEQ_LDFLAGS="${ADIOSLIB_SEQ_LDFLAGS} ${ZLIB_LDFLAGS}" + ADIOSLIB_SEQ_LDADD="${ADIOSLIB_SEQ_LDADD} ${ZLIB_LIBS}" + ADIOSLIB_INT_CPPFLAGS="${ADIOSLIB_INT_CPPFLAGS} -DZLIB ${ZLIB_CPPFLAGS}" + ADIOSLIB_INT_CFLAGS="${ADIOSLIB_INT_CFLAGS} ${ZLIB_CFLAGS}" + ADIOSLIB_INT_LDFLAGS="${ADIOSLIB_INT_LDFLAGS} ${ZLIB_LDFLAGS}" + ADIOSLIB_INT_LDADD="${ADIOSLIB_INT_LDADD} ${ZLIB_LIBS}" + ADIOSREADLIB_CPPFLAGS="${ADIOSREADLIB_CPPFLAGS} -DZLIB ${ZLIB_CPPFLAGS}" + ADIOSREADLIB_CFLAGS="${ADIOSREADLIB_CFLAGS} ${ZLIB_CFLAGS}" + ADIOSREADLIB_LDFLAGS="${ADIOSREADLIB_LDFLAGS} ${ZLIB_LDFLAGS}" + ADIOSREADLIB_LDADD="${ADIOSREADLIB_LDADD} ${ZLIB_LIBS}" + ADIOSREADLIB_SEQ_CPPFLAGS="${ADIOSREADLIB_SEQ_CPPFLAGS} -DZLIB ${ZLIB_CPPFLAGS}" + ADIOSREADLIB_SEQ_CFLAGS="${ADIOSREADLIB_SEQ_CFLAGS} ${ZLIB_CFLAGS}" + ADIOSREADLIB_SEQ_LDFLAGS="${ADIOSREADLIB_SEQ_LDFLAGS} ${ZLIB_LDFLAGS}" + ADIOSREADLIB_SEQ_LDADD="${ADIOSREADLIB_SEQ_LDADD} ${ZLIB_LIBS}" +fi +if test -z "${HAVE_BZIP2_TRUE}"; then + ADIOSLIB_CPPFLAGS="${ADIOSLIB_CPPFLAGS} -DBZIP2 ${BZIP2_CPPFLAGS}" + ADIOSLIB_CFLAGS="${ADIOSLIB_CFLAGS} ${BZIP2_CFLAGS}" + ADIOSLIB_LDFLAGS="${ADIOSLIB_LDFLAGS} ${BZIP2_LDFLAGS}" + ADIOSLIB_LDADD="${ADIOSLIB_LDADD} ${BZIP2_LIBS}" + ADIOSLIB_SEQ_CPPFLAGS="${ADIOSLIB_SEQ_CPPFLAGS} -DBZIP2 ${BZIP2_CPPFLAGS}" + ADIOSLIB_SEQ_CFLAGS="${ADIOSLIB_SEQ_CFLAGS} ${BZIP2_CFLAGS}" + ADIOSLIB_SEQ_LDFLAGS="${ADIOSLIB_SEQ_LDFLAGS} ${BZIP2_LDFLAGS}" + ADIOSLIB_SEQ_LDADD="${ADIOSLIB_SEQ_LDADD} ${BZIP2_LIBS}" + ADIOSLIB_INT_CPPFLAGS="${ADIOSLIB_INT_CPPFLAGS} -DBZIP2 ${BZIP2_CPPFLAGS}" + ADIOSLIB_INT_CFLAGS="${ADIOSLIB_INT_CFLAGS} ${BZIP2_CFLAGS}" + ADIOSLIB_INT_LDFLAGS="${ADIOSLIB_INT_LDFLAGS} ${BZIP2_LDFLAGS}" + ADIOSLIB_INT_LDADD="${ADIOSLIB_INT_LDADD} ${BZIP2_LIBS}" + ADIOSREADLIB_CPPFLAGS="${ADIOSREADLIB_CPPFLAGS} -DBZIP2 ${BZIP2_CPPFLAGS}" + ADIOSREADLIB_CFLAGS="${ADIOSREADLIB_CFLAGS} ${BZIP2_CFLAGS}" + ADIOSREADLIB_LDFLAGS="${ADIOSREADLIB_LDFLAGS} ${BZIP2_LDFLAGS}" + ADIOSREADLIB_LDADD="${ADIOSREADLIB_LDADD} ${BZIP2_LIBS}" + ADIOSREADLIB_SEQ_CPPFLAGS="${ADIOSREADLIB_SEQ_CPPFLAGS} -DBZIP2 ${BZIP2_CPPFLAGS}" + ADIOSREADLIB_SEQ_CFLAGS="${ADIOSREADLIB_SEQ_CFLAGS} ${BZIP2_CFLAGS}" + ADIOSREADLIB_SEQ_LDFLAGS="${ADIOSREADLIB_SEQ_LDFLAGS} ${BZIP2_LDFLAGS}" + ADIOSREADLIB_SEQ_LDADD="${ADIOSREADLIB_SEQ_LDADD} ${BZIP2_LIBS}" +fi +if test -z "${HAVE_SZIP_TRUE}"; then + ADIOSLIB_CPPFLAGS="${ADIOSLIB_CPPFLAGS} -DSZIP ${SZIP_CPPFLAGS}" + ADIOSLIB_CFLAGS="${ADIOSLIB_CFLAGS} ${SZIP_CFLAGS}" + ADIOSLIB_LDFLAGS="${ADIOSLIB_LDFLAGS} ${SZIP_LDFLAGS}" + ADIOSLIB_LDADD="${ADIOSLIB_LDADD} ${SZIP_LIBS}" + ADIOSLIB_SEQ_CPPFLAGS="${ADIOSLIB_SEQ_CPPFLAGS} -DSZIP ${SZIP_CPPFLAGS}" + ADIOSLIB_SEQ_CFLAGS="${ADIOSLIB_SEQ_CFLAGS} ${SZIP_CFLAGS}" + ADIOSLIB_SEQ_LDFLAGS="${ADIOSLIB_SEQ_LDFLAGS} ${SZIP_LDFLAGS}" + ADIOSLIB_SEQ_LDADD="${ADIOSLIB_SEQ_LDADD} ${SZIP_LIBS}" + ADIOSLIB_INT_CPPFLAGS="${ADIOSLIB_INT_CPPFLAGS} -DSZIP ${SZIP_CPPFLAGS}" + ADIOSLIB_INT_CFLAGS="${ADIOSLIB_INT_CFLAGS} ${SZIP_CFLAGS}" + ADIOSLIB_INT_LDFLAGS="${ADIOSLIB_INT_LDFLAGS} ${SZIP_LDFLAGS}" + ADIOSLIB_INT_LDADD="${ADIOSLIB_INT_LDADD} ${SZIP_LIBS}" + ADIOSREADLIB_CPPFLAGS="${ADIOSREADLIB_CPPFLAGS} -DSZIP ${SZIP_CPPFLAGS}" + ADIOSREADLIB_CFLAGS="${ADIOSREADLIB_CFLAGS} ${SZIP_CFLAGS}" + ADIOSREADLIB_LDFLAGS="${ADIOSREADLIB_LDFLAGS} ${SZIP_LDFLAGS}" + ADIOSREADLIB_LDADD="${ADIOSREADLIB_LDADD} ${SZIP_LIBS}" + ADIOSREADLIB_SEQ_CPPFLAGS="${ADIOSREADLIB_SEQ_CPPFLAGS} -DSZIP ${SZIP_CPPFLAGS}" + ADIOSREADLIB_SEQ_CFLAGS="${ADIOSREADLIB_SEQ_CFLAGS} ${SZIP_CFLAGS}" + ADIOSREADLIB_SEQ_LDFLAGS="${ADIOSREADLIB_SEQ_LDFLAGS} ${SZIP_LDFLAGS}" + ADIOSREADLIB_SEQ_LDADD="${ADIOSREADLIB_SEQ_LDADD} ${SZIP_LIBS}" +fi +if test -z "${HAVE_ISOBAR_TRUE}"; then + ADIOSLIB_CPPFLAGS="${ADIOSLIB_CPPFLAGS} -DISOBAR ${ISOBAR_CPPFLAGS}" + ADIOSLIB_CFLAGS="${ADIOSLIB_CFLAGS} ${ISOBAR_CFLAGS}" + ADIOSLIB_LDFLAGS="${ADIOSLIB_LDFLAGS} ${ISOBAR_LDFLAGS}" + ADIOSLIB_LDADD="${ADIOSLIB_LDADD} ${ISOBAR_LIBS}" + ADIOSLIB_SEQ_CPPFLAGS="${ADIOSLIB_SEQ_CPPFLAGS} -DISOBAR ${ISOBAR_CPPFLAGS}" + ADIOSLIB_SEQ_CFLAGS="${ADIOSLIB_SEQ_CFLAGS} ${ISOBAR_CFLAGS}" + ADIOSLIB_SEQ_LDFLAGS="${ADIOSLIB_SEQ_LDFLAGS} ${ISOBAR_LDFLAGS}" + ADIOSLIB_SEQ_LDADD="${ADIOSLIB_SEQ_LDADD} ${ISOBAR_LIBS}" + ADIOSLIB_INT_CPPFLAGS="${ADIOSLIB_INT_CPPFLAGS} -DISOBAR ${ISOBAR_CPPFLAGS}" + ADIOSLIB_INT_CFLAGS="${ADIOSLIB_INT_CFLAGS} ${ISOBAR_CFLAGS}" + ADIOSLIB_INT_LDFLAGS="${ADIOSLIB_INT_LDFLAGS} ${ISOBAR_LDFLAGS}" + ADIOSLIB_INT_LDADD="${ADIOSLIB_INT_LDADD} ${ISOBAR_LIBS}" + ADIOSREADLIB_CPPFLAGS="${ADIOSREADLIB_CPPFLAGS} -DISOBAR ${ISOBAR_CPPFLAGS}" + ADIOSREADLIB_CFLAGS="${ADIOSREADLIB_CFLAGS} ${ISOBAR_CFLAGS}" + ADIOSREADLIB_LDFLAGS="${ADIOSREADLIB_LDFLAGS} ${ISOBAR_LDFLAGS}" + ADIOSREADLIB_LDADD="${ADIOSREADLIB_LDADD} ${ISOBAR_LIBS}" + ADIOSREADLIB_SEQ_CPPFLAGS="${ADIOSREADLIB_SEQ_CPPFLAGS} -DISOBAR ${ISOBAR_CPPFLAGS}" + ADIOSREADLIB_SEQ_CFLAGS="${ADIOSREADLIB_SEQ_CFLAGS} ${ISOBAR_CFLAGS}" + ADIOSREADLIB_SEQ_LDFLAGS="${ADIOSREADLIB_SEQ_LDFLAGS} ${ISOBAR_LDFLAGS}" + ADIOSREADLIB_SEQ_LDADD="${ADIOSREADLIB_SEQ_LDADD} ${ISOBAR_LIBS}" +fi + + + + + + +if test -z "${HAVE_APLOD_TRUE}"; then + ADIOSLIB_CPPFLAGS="${ADIOSLIB_CPPFLAGS} -DAPLOD ${APLOD_CPPFLAGS}" + ADIOSLIB_CFLAGS="${ADIOSLIB_CFLAGS} ${APLOD_CFLAGS}" + ADIOSLIB_LDFLAGS="${ADIOSLIB_LDFLAGS} ${APLOD_LDFLAGS}" + ADIOSLIB_LDADD="${ADIOSLIB_LDADD} ${APLOD_LIBS}" + ADIOSLIB_SEQ_CPPFLAGS="${ADIOSLIB_SEQ_CPPFLAGS} -DAPLOD ${APLOD_CPPFLAGS}" + ADIOSLIB_SEQ_CFLAGS="${ADIOSLIB_SEQ_CFLAGS} ${APLOD_CFLAGS}" + ADIOSLIB_SEQ_LDFLAGS="${ADIOSLIB_SEQ_LDFLAGS} ${APLOD_LDFLAGS}" + ADIOSLIB_SEQ_LDADD="${ADIOSLIB_SEQ_LDADD} ${APLOD_LIBS}" + ADIOSLIB_INT_CPPFLAGS="${ADIOSLIB_INT_CPPFLAGS} -DAPLOD ${APLOD_CPPFLAGS}" + ADIOSLIB_INT_CFLAGS="${ADIOSLIB_INT_CFLAGS} ${APLOD_CFLAGS}" + ADIOSLIB_INT_LDFLAGS="${ADIOSLIB_INT_LDFLAGS} ${APLOD_LDFLAGS}" + ADIOSLIB_INT_LDADD="${ADIOSLIB_INT_LDADD} ${APLOD_LIBS}" + ADIOSREADLIB_CPPFLAGS="${ADIOSREADLIB_CPPFLAGS} -DAPLOD ${APLOD_CPPFLAGS}" + ADIOSREADLIB_CFLAGS="${ADIOSREADLIB_CFLAGS} ${APLOD_CFLAGS}" + ADIOSREADLIB_LDFLAGS="${ADIOSREADLIB_LDFLAGS} ${APLOD_LDFLAGS}" + ADIOSREADLIB_LDADD="${ADIOSREADLIB_LDADD} ${APLOD_LIBS}" + ADIOSREADLIB_SEQ_CPPFLAGS="${ADIOSREADLIB_SEQ_CPPFLAGS} -DAPLOD ${APLOD_CPPFLAGS}" + ADIOSREADLIB_SEQ_CFLAGS="${ADIOSREADLIB_SEQ_CFLAGS} ${APLOD_CFLAGS}" + ADIOSREADLIB_SEQ_LDFLAGS="${ADIOSREADLIB_SEQ_LDFLAGS} ${APLOD_LDFLAGS}" + ADIOSREADLIB_SEQ_LDADD="${ADIOSREADLIB_SEQ_LDADD} ${APLOD_LIBS}" +fi +if test -z "${HAVE_ALACRITY_TRUE}"; then + ADIOSLIB_CPPFLAGS="${ADIOSLIB_CPPFLAGS} -DALACRITY ${ALACRITY_CPPFLAGS}" + ADIOSLIB_CFLAGS="${ADIOSLIB_CFLAGS} ${ALACRITY_CFLAGS}" + ADIOSLIB_LDFLAGS="${ADIOSLIB_LDFLAGS} ${ALACRITY_LDFLAGS}" + ADIOSLIB_LDADD="${ADIOSLIB_LDADD} ${ALACRITY_LIBS}" + ADIOSLIB_SEQ_CPPFLAGS="${ADIOSLIB_SEQ_CPPFLAGS} -DALACRITY ${ALACRITY_CPPFLAGS}" + ADIOSLIB_SEQ_CFLAGS="${ADIOSLIB_SEQ_CFLAGS} ${ALACRITY_CFLAGS}" + ADIOSLIB_SEQ_LDFLAGS="${ADIOSLIB_SEQ_LDFLAGS} ${ALACRITY_LDFLAGS}" + ADIOSLIB_SEQ_LDADD="${ADIOSLIB_SEQ_LDADD} ${ALACRITY_LIBS}" + ADIOSLIB_INT_CPPFLAGS="${ADIOSLIB_INT_CPPFLAGS} -DALACRITY ${ALACRITY_CPPFLAGS}" + ADIOSLIB_INT_CFLAGS="${ADIOSLIB_INT_CFLAGS} ${ALACRITY_CFLAGS}" + ADIOSLIB_INT_LDFLAGS="${ADIOSLIB_INT_LDFLAGS} ${ALACRITY_LDFLAGS}" + ADIOSLIB_INT_LDADD="${ADIOSLIB_INT_LDADD} ${ALACRITY_LIBS}" + ADIOSREADLIB_CPPFLAGS="${ADIOSREADLIB_CPPFLAGS} -DALACRITY ${ALACRITY_CPPFLAGS}" + ADIOSREADLIB_CFLAGS="${ADIOSREADLIB_CFLAGS} ${ALACRITY_CFLAGS}" + ADIOSREADLIB_LDFLAGS="${ADIOSREADLIB_LDFLAGS} ${ALACRITY_LDFLAGS}" + ADIOSREADLIB_LDADD="${ADIOSREADLIB_LDADD} ${ALACRITY_LIBS}" + ADIOSREADLIB_SEQ_CPPFLAGS="${ADIOSREADLIB_SEQ_CPPFLAGS} -DALACRITY ${ALACRITY_CPPFLAGS}" + ADIOSREADLIB_SEQ_CFLAGS="${ADIOSREADLIB_SEQ_CFLAGS} ${ALACRITY_CFLAGS}" + ADIOSREADLIB_SEQ_LDFLAGS="${ADIOSREADLIB_SEQ_LDFLAGS} ${ALACRITY_LDFLAGS}" + ADIOSREADLIB_SEQ_LDADD="${ADIOSREADLIB_SEQ_LDADD} ${ALACRITY_LIBS}" +fi + +if test -z "${HAVE_RIDCOMPRESS_TRUE}"; then + ADIOSLIB_CPPFLAGS="${ADIOSLIB_CPPFLAGS} -DRIDCOMPRESS ${RIDCOMPRESS_CPPFLAGS}" + ADIOSLIB_CFLAGS="${ADIOSLIB_CFLAGS} ${RIDCOMPRESS_CFLAGS}" + ADIOSLIB_LDFLAGS="${ADIOSLIB_LDFLAGS} ${RIDCOMPRESS_LDFLAGS}" + ADIOSLIB_LDADD="${ADIOSLIB_LDADD} ${RIDCOMPRESS_LIBS}" + ADIOSLIB_SEQ_CPPFLAGS="${ADIOSLIB_SEQ_CPPFLAGS} -DRIDCOMPRESS ${RIDCOMPRESS_CPPFLAGS}" + ADIOSLIB_SEQ_CFLAGS="${ADIOSLIB_SEQ_CFLAGS} ${RIDCOMPRESS_CFLAGS}" + ADIOSLIB_SEQ_LDFLAGS="${ADIOSLIB_SEQ_LDFLAGS} ${RIDCOMPRESS_LDFLAGS}" + ADIOSLIB_SEQ_LDADD="${ADIOSLIB_SEQ_LDADD} ${RIDCOMPRESS_LIBS}" + ADIOSLIB_INT_CPPFLAGS="${ADIOSLIB_INT_CPPFLAGS} -DRIDCOMPRESS ${RIDCOMPRESS_CPPFLAGS}" + ADIOSLIB_INT_CFLAGS="${ADIOSLIB_INT_CFLAGS} ${RIDCOMPRESS_CFLAGS}" + ADIOSLIB_INT_LDFLAGS="${ADIOSLIB_INT_LDFLAGS} ${RIDCOMPRESS_LDFLAGS}" + ADIOSLIB_INT_LDADD="${ADIOSLIB_INT_LDADD} ${RIDCOMPRESS_LIBS}" + ADIOSREADLIB_CPPFLAGS="${ADIOSREADLIB_CPPFLAGS} -DRIDCOMPRESS ${RIDCOMPRESS_CPPFLAGS}" + ADIOSREADLIB_CFLAGS="${ADIOSREADLIB_CFLAGS} ${RIDCOMPRESS_CFLAGS}" + ADIOSREADLIB_LDFLAGS="${ADIOSREADLIB_LDFLAGS} ${RIDCOMPRESS_LDFLAGS}" + ADIOSREADLIB_LDADD="${ADIOSREADLIB_LDADD} ${RIDCOMPRESS_LIBS}" + ADIOSREADLIB_SEQ_CPPFLAGS="${ADIOSREADLIB_SEQ_CPPFLAGS} -DRIDCOMPRESS ${RIDCOMPRESS_CPPFLAGS}" + ADIOSREADLIB_SEQ_CFLAGS="${ADIOSREADLIB_SEQ_CFLAGS} ${RIDCOMPRESS_CFLAGS}" + ADIOSREADLIB_SEQ_LDFLAGS="${ADIOSREADLIB_SEQ_LDFLAGS} ${RIDCOMPRESS_LDFLAGS}" + ADIOSREADLIB_SEQ_LDADD="${ADIOSREADLIB_SEQ_LDADD} ${RIDCOMPRESS_LIBS}" +fi + +if test -z "${HAVE_FASTBIT_TRUE}"; then + ADIOSLIB_CPPFLAGS="${ADIOSLIB_CPPFLAGS} -DFASTBIT ${FASTBIT_CPPFLAGS}" + ADIOSLIB_CFLAGS="${ADIOSLIB_CFLAGS} ${FASTBIT_CFLAGS}" + ADIOSLIB_LDFLAGS="${ADIOSLIB_LDFLAGS} ${FASTBIT_LDFLAGS}" + ADIOSLIB_LDADD="${ADIOSLIB_LDADD} ${FASTBIT_LIBS}" + ADIOSLIB_SEQ_CPPFLAGS="${ADIOSLIB_SEQ_CPPFLAGS} -DFASTBIT ${FASTBIT_CPPFLAGS}" + ADIOSLIB_SEQ_CFLAGS="${ADIOSLIB_SEQ_CFLAGS} ${FASTBIT_CFLAGS}" + ADIOSLIB_SEQ_LDFLAGS="${ADIOSLIB_SEQ_LDFLAGS} ${FASTBIT_LDFLAGS}" + ADIOSLIB_SEQ_LDADD="${ADIOSLIB_SEQ_LDADD} ${FASTBIT_LIBS}" + ADIOSLIB_INT_CPPFLAGS="${ADIOSLIB_INT_CPPFLAGS} -DFASTBIT ${FASTBIT_CPPFLAGS}" + ADIOSLIB_INT_CFLAGS="${ADIOSLIB_INT_CFLAGS} ${FASTBIT_CFLAGS}" + ADIOSLIB_INT_LDFLAGS="${ADIOSLIB_INT_LDFLAGS} ${FASTBIT_LDFLAGS}" + ADIOSLIB_INT_LDADD="${ADIOSLIB_INT_LDADD} ${FASTBIT_LIBS}" + ADIOSREADLIB_CPPFLAGS="${ADIOSREADLIB_CPPFLAGS} -DFASTBIT ${FASTBIT_CPPFLAGS}" + ADIOSREADLIB_CFLAGS="${ADIOSREADLIB_CFLAGS} ${FASTBIT_CFLAGS}" + ADIOSREADLIB_LDFLAGS="${ADIOSREADLIB_LDFLAGS} ${FASTBIT_LDFLAGS}" + ADIOSREADLIB_LDADD="${ADIOSREADLIB_LDADD} ${FASTBIT_LIBS}" + ADIOSREADLIB_SEQ_CPPFLAGS="${ADIOSREADLIB_SEQ_CPPFLAGS} -DFASTBIT ${FASTBIT_CPPFLAGS}" + ADIOSREADLIB_SEQ_CFLAGS="${ADIOSREADLIB_SEQ_CFLAGS} ${FASTBIT_CFLAGS}" + ADIOSREADLIB_SEQ_LDFLAGS="${ADIOSREADLIB_SEQ_LDFLAGS} ${FASTBIT_LDFLAGS}" + ADIOSREADLIB_SEQ_LDADD="${ADIOSREADLIB_SEQ_LDADD} ${FASTBIT_LIBS}" +fi + +if test -z "${HAVE_NCSU_TIMER_TRUE}"; then + ADIOSLIB_CPPFLAGS="${ADIOSLIB_CPPFLAGS} -DWITH_NCSU_TIMER ${TIMER_CPPFLAGS}" + ADIOSLIB_CFLAGS="${ADIOSLIB_CFLAGS} ${TIMER_CFLAGS}" + ADIOSLIB_LDFLAGS="${ADIOSLIB_LDFLAGS} ${TIMER_LDFLAGS}" + ADIOSLIB_LDADD="${ADIOSLIB_LDADD} ${TIMER_LIBS}" + ADIOSLIB_SEQ_CPPFLAGS="${ADIOSLIB_SEQ_CPPFLAGS} -DWITH_NCSU_TIMER ${TIMER_CPPFLAGS}" + ADIOSLIB_SEQ_CFLAGS="${ADIOSLIB_SEQ_CFLAGS} ${TIMER_CFLAGS}" + ADIOSLIB_SEQ_LDFLAGS="${ADIOSLIB_SEQ_LDFLAGS} ${TIMER_LDFLAGS}" + ADIOSLIB_SEQ_LDADD="${ADIOSLIB_SEQ_LDADD} ${TIMER_LIBS}" + ADIOSLIB_INT_CPPFLAGS="${ADIOSLIB_INT_CPPFLAGS} -DWITH_NCSU_TIMER ${TIMER_CPPFLAGS}" + ADIOSLIB_INT_CFLAGS="${ADIOSLIB_INT_CFLAGS} ${TIMER_CFLAGS}" + ADIOSLIB_INT_LDFLAGS="${ADIOSLIB_INT_LDFLAGS} ${TIMER_LDFLAGS}" + ADIOSLIB_INT_LDADD="${ADIOSLIB_INT_LDADD} ${TIMER_LIBS}" + ADIOSREADLIB_CPPFLAGS="${ADIOSREADLIB_CPPFLAGS} -DWITH_NCSU_TIMER ${TIMER_CPPFLAGS}" + ADIOSREADLIB_CFLAGS="${ADIOSREADLIB_CFLAGS} ${TIMER_CFLAGS}" + ADIOSREADLIB_LDFLAGS="${ADIOSREADLIB_LDFLAGS} ${TIMER_LDFLAGS}" + ADIOSREADLIB_LDADD="${ADIOSREADLIB_LDADD} ${TIMER_LIBS}" + ADIOSREADLIB_SEQ_CPPFLAGS="${ADIOSREADLIB_SEQ_CPPFLAGS} -DWITH_NCSU_TIMER ${TIMER_CPPFLAGS}" + ADIOSREADLIB_SEQ_CFLAGS="${ADIOSREADLIB_SEQ_CFLAGS} ${TIMER_CFLAGS}" + ADIOSREADLIB_SEQ_LDFLAGS="${ADIOSREADLIB_SEQ_LDFLAGS} ${TIMER_LDFLAGS}" + ADIOSREADLIB_SEQ_LDADD="${ADIOSREADLIB_SEQ_LDADD} ${TIMER_LIBS}" +fi + +AM_CONDITIONAL([HAVE_ICEE], [test -z "${HAVE_FLEXPATH_TRUE}"]) +if test -z "${HAVE_FLEXPATH_TRUE}"; then + AC_DEFINE(HAVE_ICEE, 1, [ICEE method is enabled]) +fi + +AC_SUBST(ADIOSLIB_CPPFLAGS) +AC_SUBST(ADIOSLIB_CFLAGS) +AC_SUBST(ADIOSLIB_LDFLAGS) +AC_SUBST(ADIOSLIB_LDADD) +AC_SUBST(ADIOSLIB_SEQ_CPPFLAGS) +AC_SUBST(ADIOSLIB_SEQ_CFLAGS) +AC_SUBST(ADIOSLIB_SEQ_LDFLAGS) +AC_SUBST(ADIOSLIB_SEQ_LDADD) +AC_SUBST(ADIOSLIB_INT_CPPFLAGS) +AC_SUBST(ADIOSLIB_INT_CFLAGS) +AC_SUBST(ADIOSLIB_INT_LDFLAGS) +AC_SUBST(ADIOSLIB_INT_LDADD) +AC_SUBST(ADIOSREADLIB_CPPFLAGS) +AC_SUBST(ADIOSREADLIB_CFLAGS) +AC_SUBST(ADIOSREADLIB_LDFLAGS) +AC_SUBST(ADIOSREADLIB_LDADD) +AC_SUBST(ADIOSREADLIB_SEQ_CPPFLAGS) +AC_SUBST(ADIOSREADLIB_SEQ_CFLAGS) +AC_SUBST(ADIOSREADLIB_SEQ_LDFLAGS) +AC_SUBST(ADIOSREADLIB_SEQ_LDADD) +AC_SUBST(ADIOSLIB_EXTRA_CPPFLAGS) + +if test -z "${USE_PARALLEL_COMPILER_TRUE}"; then + AC_DEFINE(USE_PARALLEL_COMPILER, 1, [Need to use MPI compiler for sequential utils]) + echo "#### Defined USE_PARALLEL_COMPILER to = [${USE_PARALLEL_COMPILER}]" +fi + +dnl Generate major/minor/micro version numbers +VERSION_MAJOR=[`echo ${VERSION} | sed -e "s/\..*//"`] +AC_DEFINE_UNQUOTED(VERSION_MAJOR, ${VERSION_MAJOR}, [Major version number]) +VERSION_MINOR=[`echo ${VERSION} | sed -e "s/[0-9]*\.\([0-9]*\).*/\1/"`] +AC_DEFINE_UNQUOTED(VERSION_MINOR, ${VERSION_MINOR}, [Minor version number]) +VERSION_MICRO=[`echo ${VERSION} | sed -e "s/[0-9]*\.[0-9]*\.\([0-9]*\).*/\1/"`] +dnl if micro not defined, here it equals to VERSION; do a minus +VERSION_MICRO=`echo ${VERSION_MICRO} | sed -e "s/${VERSION}//"` +if test -z "${VERSION_MICRO}"; then + VERSION_MICRO=0 +fi +AC_DEFINE_UNQUOTED(VERSION_MICRO, ${VERSION_MICRO}, [Micro version number]) + +# Get the version of the source we are configuring here +# Just to print it out at the end of configure +# see also Makefile.am:install-data-hook +#if type svnversion &>/dev/null; then +# SVNVERSION=`svnversion` +#else +# SVNVERSION="unknown" +#fi +#AC_DEFINE_UNQUOTED(VERSION_SVNREV, "${SVNVERSION}", [svn revision number]) + + + + +AC_CONFIG_FILES([Makefile + tests/Makefile + tests/C/Makefile + tests/C/flexpath_tests/Makefile + tests/C/flexpath_tests/1D_arr_global/Makefile + tests/C/flexpath_tests/1D_arr_global_noxml/Makefile + tests/C/flexpath_tests/global_range_select/Makefile + tests/C/flexpath_tests/maya_noxml/Makefile + tests/C/flexpath_tests/maya_append/Makefile + tests/C/flexpath_tests/scalar/Makefile + tests/C/fgr_tests/Makefile + tests/C/query/Makefile + tests/C/query/common/Makefile + tests/C/query/fastbit/Makefile + tests/C/query/alacrity/Makefile + tests/Fortran/Makefile + tests/genarray/Makefile + tests/bp_read/Makefile + tests/suite/Makefile + tests/suite/programs/Makefile + adios_config + adios_config.flags + ]) + +AC_OUTPUT + +echo +echo "*********************************" +echo $PACKAGE configured as follows: +echo "*********************************" +echo +if test -z "${BUILD_WRITE_TRUE}"; then + echo " - Build both the Write and Read libraries"; +else + echo " - Build only the Read libraries"; +fi +if test -z "${BUILD_FORTRAN_TRUE}"; then + echo " - Build both the C and Fortran libraries"; +else + echo " - Build only the C libraries (no Fortran)"; +fi +echo +echo " - General Compile FLAGS"; +echo " - CC = $CC"; +echo " - CXX = $CXX"; +echo " - FC = $FC"; +echo " - CPPFLAGS = $CPPFLAGS"; +echo " - CFLAGS = $CFLAGS"; +echo " - CXXFLAGS = $CXXFLAGS"; +echo " - FCFLAGS = $FCFLAGS"; +echo " - LDLAGS = $LDFLAGS"; +echo " - LIBS = $LIBS"; +echo +echo " - MPICC = $MPICC"; +echo " - MPICXX = $MPICXX"; +echo " - MPIFC = $MPIFC"; +echo " - MPILIBS = $MPILIBS"; +echo + +if test "x$enable_research_transports" == "xyes"; then + echo " - Research Transports Included"; + +else + echo " - No research transport methods"; +fi + +if test -z "${ADIOS_TIMERS_TRUE}"; then + echo " - ADIOS Timing Mechanism Enabled"; +else + echo " - ADIOS Timing Mechanism Disabled"; +fi +if test -z "${ADIOS_TIMER_EVENTS_TRUE}"; then + echo " - ADIOS Timing event recording Enabled"; +else + echo " - ADIOS Timing event recording Disabled"; +fi + + +if test -z "${HAVE_MXML_TRUE}"; then + echo " - MXML"; + echo " - MXML_CFLAGS = $MXML_CFLAGS"; + echo " - MXML_CPPFLAGS = $MXML_CPPFLAGS"; + echo " - MXML_LDFLAGS = $MXML_LDFLAGS"; + echo " - MXML_LIBS = $MXML_LIBS"; + echo +else + echo " - No MXML" +fi + +if test -z "${HAVE_LUSTRE_TRUE}"; then + echo " - LUSTRE"; + echo " - LUSTRE_CFLAGS = $LUSTRE_CFLAGS"; + echo " - LUSTRE_CPPFLAGS = $LUSTRE_CPPFLAGS"; + echo " - LUSTRE_LDFLAGS = $LUSTRE_LDFLAGS"; + echo " - LUSTRE_LIBS = $LUSTRE_LIBS"; + echo +else + echo " - No LUSTRE" +fi + +if test -z "${HAVE_FGR_TRUE}"; then + echo " - FGR"; + echo " - FGR_CFLAGS = $FGR_CFLAGS"; + echo " - FGR_CPPFLAGS = $FGR_CPPFLAGS"; + echo " - FGR_LDFLAGS = $FGR_LDFLAGS"; + echo " - FGR_LIBS = $FGR_LIBS"; + echo +else + echo " - No FGR" +fi + +if test -z "${HAVE_GLIB_TRUE}"; then + echo " - GLIB"; + echo " - GLIB_CFLAGS = $GLIB_CFLAGS"; + echo " - GLIB_CPPFLAGS = $GLIB_CPPFLAGS"; + echo " - GLIB_LDFLAGS = $GLIB_LDFLAGS"; + echo " - GLIB_LIBS = $GLIB_LIBS"; + echo +else + echo " - No GLIB" +fi + + echo " - Networking library for staging methods:"; +if test -z "${HAVE_PORTALS_TRUE}"; then + echo " - PORTALS"; + echo " - PORTALS_CFLAGS = $PORTALS_CFLAGS"; + echo " - PORTALS_CPPFLAGS = $PORTALS_CPPFLAGS"; + echo " - PORTALS_LDFLAGS = $PORTALS_LDFLAGS"; + echo " - PORTALS_LIBS = $PORTALS_LIBS"; + echo +#else +# echo " - No Portals" +#fi + +elif test -z "${HAVE_INFINIBAND_TRUE}"; then + echo " - INFINIBAND"; + echo " - INFINIBAND_CFLAGS = $INFINIBAND_CFLAGS"; + echo " - INFINIBAND_CPPFLAGS = $INFINIBAND_CPPFLAGS"; + echo " - INFINIBAND_LDFLAGS = $INFINIBAND_LDFLAGS"; + echo " - INFINIBAND_LIBS = $INFINIBAND_LIBS"; + echo +#else +# echo " - No InfiniBand" +#fi + +elif test -z "${HAVE_CRAY_PMI_TRUE}" -a -z "${HAVE_CRAY_UGNI_TRUE}"; then + echo " - CRAY uGNI with PMI"; + echo " - CFLAGS = $CRAY_PMI_CFLAGS $CRAY_UGNI_CFLAGS"; + echo " - CPPFLAGS = $CRAY_PMI_CPPFLAGS $CRAY_UGNI_CPPFLAGS"; + echo " - LDFLAGS = $CRAY_PMI_LDFLAGS $CRAY_UGNI_LDFLAGS"; + echo " - LIBS = $CRAY_PMI_LIBS $CRAY_UGNI_LIBS"; + echo +#else +# echo " - No Cray uGNI" + +elif test -z "${HAVE_DCMF_TRUE}"; then + echo " - IBM DCMF"; + echo " - DCMF_CFLAGS = $DCMF_CFLAGS"; + echo " - DCMF_CPPFLAGS = $DCMF_CPPFLAGS"; + echo " - DCMF_LDFLAGS = $DCMF_LDFLAGS"; + echo " - DCMF_LIBS = $DCMF_LIBS"; + echo + +elif test -z "${HAVE_PAMI_TRUE}"; then + echo " - IBM PAMI"; + echo " - PAMI_CFLAGS = $PAMI_CFLAGS"; + echo " - PAMI_CPPFLAGS = $PAMI_CPPFLAGS"; + echo " - PAMI_LDFLAGS = $PAMI_LDFLAGS"; + echo " - PAMI_LIBS = $PAMI_LIBS"; + echo +else + echo " - No supported networking library found" +fi + +dnl if test -z "${HAVE_GENGETOPT_TRUE}"; then +dnl echo " - GENGETOPT"; +dnl echo " - GENGETOPT_CFLAGS = $GENGETOPT_CFLAGS"; +dnl echo " - GENGETOPT_CPPFLAGS = $GENGETOPT_CPPFLAGS"; +dnl echo " - GENGETOPT_LDFLAGS = $GENGETOPT_LDFLAGS"; +dnl echo " - GENGETOPT_LIBS = $GENGETOPT_LIBS"; +dnl echo +dnl else +dnl echo " - No Gengetopt" +dnl fi + +if test "x${datatap}" != "xdisable"; then + echo " - DataTap with interconnect: $datatap"; + echo " - DT_CFLAGS = $DT_CFLAGS"; + echo " - DT_CPPFLAGS = $DT_CPPFLAGS"; + echo " - DT_LDFLAGS = $DT_LDFLAGS"; + echo " - DT_LIBS = $DT_LIBS"; + echo +else + echo " - No DataTap transport to build DATATAP transport method"; +fi + +if test -z "${HAVE_DATASPACES_TRUE}"; then + echo " - DATASPACES transport method"; + echo " - DATASPACES_CFLAGS = $DATASPACES_CFLAGS"; + echo " - DATASPACES_CPPFLAGS = $DATASPACES_CPPFLAGS"; + echo " - DATASPACES_LDFLAGS = $DATASPACES_LDFLAGS"; + echo " - DATASPACES_LIBS = $DATASPACES_LIBS"; + echo +else + echo " - No DATASPACES to build DATASPACES transport method" +fi + +if test -z "${HAVE_DIMES_TRUE}"; then + echo " - DIMES transport method"; + echo " - DIMES_CFLAGS = $DIMES_CFLAGS"; + echo " - DIMES_CPPFLAGS = $DIMES_CPPFLAGS"; + echo " - DIMES_LDFLAGS = $DIMES_LDFLAGS"; + echo " - DIMES_LIBS = $DIMES_LIBS"; + echo +else + echo " - No DIMES to build DIMES transport method" +fi + +if test -z "${HAVE_PHDF5_TRUE}"; then + echo " - PHDF5"; + echo " - PHDF5_CFLAGS = $PHDF5_CFLAGS"; + echo " - PHDF5_CPPFLAGS = $PHDF5_CPPFLAGS"; + echo " - PHDF5_LDFLAGS = $PHDF5_LDFLAGS"; + echo " - PHDF5_LIBS = $PHDF5_LIBS"; + echo +else + echo " - No PHDF5 to build PHDF5 transport method" +fi + +if test -z "${HAVE_HDF5_TRUE}"; then + echo " - HDF5"; + echo " - HDF5_CFLAGS = $HDF5_CFLAGS"; + echo " - HDF5_CPPFLAGS = $HDF5_CPPFLAGS"; + echo " - HDF5_LDFLAGS = $HDF5_LDFLAGS"; + echo " - HDF5_LIBS = $HDF5_LIBS"; + echo +else + echo " - No HDF5" +fi + +if test -z "${HAVE_NC4PAR_TRUE}"; then + echo " - NetCDF 4 Parallel"; + echo " - NC4PAR_CFLAGS = $NC4PAR_CFLAGS"; + echo " - NC4PAR_CPPFLAGS = $NC4PAR_CPPFLAGS"; + echo " - NC4PAR_LDFLAGS = $NC4PAR_LDFLAGS"; + echo " - NC4PAR_LIBS = $NC4PAR_LIBS"; + echo +else + echo " - No NETCDF 4 Parallel to build NC4 transport method" +fi + +if test -z "${HAVE_NETCDF_TRUE}"; then + echo " - NetCDF"; + echo " - NETCDF_CFLAGS = $NETCDF_CFLAGS"; + echo " - NETCDF_CPPFLAGS = $NETCDF_CPPFLAGS"; + echo " - NETCDF_LDFLAGS = $NETCDF_LDFLAGS"; + echo " - NETCDF_LIBS = $NETCDF_LIBS"; + echo +else + echo " - No NETCDF" +fi + +if test -z "${HAVE_NSSI_TRUE}"; then + echo " - NSSI"; + echo " - NSSI_CFLAGS = $NSSI_CFLAGS"; + echo " - NSSI_CPPFLAGS = $NSSI_CPPFLAGS"; + echo " - NSSI_LDFLAGS = $NSSI_LDFLAGS"; + echo " - NSSI_LIBS = $NSSI_LIBS"; + echo +else + echo " - No NSSI to build NSSI transport method" +fi + +if test -z "${HAVE_FLEXPATH_TRUE}"; then + echo " - FLEXPATH"; + echo " - FP_CFLAGS = $FP_CFLAGS"; + echo " - FP_CPPFLAGS = $FP_CPPFLAGS"; + echo " - FP_LDFLAGS = $FP_LDFLAGS"; + echo " - FP_LIBS = $FP_LIBS"; + echo +else + echo " - No FLEXPATH to build FLEXPATH transport method" +fi + +if test -z "${HAVE_ICEE_TRUE}"; then + echo " - ICEE"; + echo " - FP_CFLAGS = $FP_CFLAGS"; + echo " - FP_CPPFLAGS = $FP_CPPFLAGS"; + echo " - FP_LDFLAGS = $FP_LDFLAGS"; + echo " - FP_LIBS = $FP_LIBS"; + echo +else + echo " - No ICEE to build ICEE transport method" +fi + +if test -z "${HAVE_ZLIB_TRUE}"; then + echo " - ZLIB"; + echo " - ZLIB_CFLAGS = $ZLIB_CFLAGS"; + echo " - ZLIB_CPPFLAGS = $ZLIB_CPPFLAGS"; + echo " - ZLIB_LDFLAGS = $ZLIB_LDFLAGS"; + echo " - ZLIB_LIBS = $ZLIB_LIBS"; + echo +else + echo " - No ZLIB to build ZLIB transform method" +fi + +if test -z "${HAVE_BZIP2_TRUE}"; then + echo " - BZIP2"; + echo " - BZIP2_CFLAGS = $BZIP2_CFLAGS"; + echo " - BZIP2_CPPFLAGS = $BZIP2_CPPFLAGS"; + echo " - BZIP2_LDFLAGS = $BZIP2_LDFLAGS"; + echo " - BZIP2_LIBS = $BZIP2_LIBS"; + echo +else + echo " - No BZIP2 to build BZIP2 transform method" +fi + +if test -z "${HAVE_SZIP_TRUE}"; then + echo " - SZIP"; + echo " - SZIP_CFLAGS = $SZIP_CFLAGS"; + echo " - SZIP_CPPFLAGS = $SZIP_CPPFLAGS"; + echo " - SZIP_LDFLAGS = $SZIP_LDFLAGS"; + echo " - SZIP_LIBS = $SZIP_LIBS"; + echo +else + echo " - No SZIP to build SZIP transform method" +fi + +if test -z "${HAVE_ISOBAR_TRUE}"; then + echo " - ISOBAR"; + echo " - ISOBAR_CFLAGS = $ISOBAR_CFLAGS"; + echo " - ISOBAR_CPPFLAGS = $ISOBAR_CPPFLAGS"; + echo " - ISOBAR_LDFLAGS = $ISOBAR_LDFLAGS"; + echo " - ISOBAR_LIBS = $ISOBAR_LIBS"; + echo +else + echo " - No ISOBAR to build ISOBAR transform method" +fi + +if test -z "${HAVE_APLOD_TRUE}"; then + echo " - APLOD"; + echo " - APLOD_CFLAGS = $APLOD_CFLAGS"; + echo " - APLOD_CPPFLAGS = $APLOD_CPPFLAGS"; + echo " - APLOD_LDFLAGS = $APLOD_LDFLAGS"; + echo " - APLOD_LIBS = $APLOD_LIBS"; + echo +else + echo " - No APLOD to build APLOD transform method" +fi + +if test -z "${HAVE_FASTBIT_TRUE}"; then + echo " - FASTBIT"; + echo " - FASTBIT_CFLAGS = $FASTBIT_CFLAGS"; + echo " - FASTBIT_CPPFLAGS = $FASTBIT_CPPFLAGS"; + echo " - FASTBIT_LDFLAGS = $FASTBIT_LDFLAGS"; + echo " - FASTBIT_LIBS = $FASTBIT_LIBS"; + echo +else + echo " - No FASTBIT to build FASTBIT query method" +fi + +if test -z "${HAVE_ALACRITY_TRUE}"; then + echo " - ALACRITY"; + echo " - ALACRITY_CFLAGS = $ALACRITY_CFLAGS"; + echo " - ALACRITY_CPPFLAGS = $ALACRITY_CPPFLAGS"; + echo " - ALACRITY_LDFLAGS = $ALACRITY_LDFLAGS"; + echo " - ALACRITY_LIBS = $ALACRITY_LIBS"; + echo +else + echo " - No ALACRITY to build ALACRITY transform & query methods" +fi + +if test -z "${HAVE_RIDCOMPRESS_TRUE}"; then + echo " - RIDCOMPRESS"; + echo " - RIDCOMPRESS_CFLAGS = $RIDCOMPRESS_CFLAGS"; + echo " - RIDCOMPRESS_CPPFLAGS = $RIDCOMPRESS_CPPFLAGS"; + echo " - RIDCOMPRESS_LDFLAGS = $RIDCOMPRESS_LDFLAGS"; + echo " - RIDCOMPRESS_LIBS = $RIDCOMPRESS_LIBS"; + echo +else + echo " - No RIDCOMPRESS to build RIDCOMPRESS transform method" +fi + + +if test -z "${HAVE_NCSU_TIMER_TRUE}"; then + echo " - NCSU timer lib"; + echo " - TIMER_CFLAGS = $TIMER_CFLAGS"; + echo " - TIMER_CPPFLAGS = $TIMER_CPPFLAGS"; + echo " - TIMER_LDFLAGS = $TIMER_LDFLAGS"; + echo " - TIMER_LIBS = $TIMER_LIBS"; + echo +else + echo " - No NCSU timer lib" +fi + +if test -z "${HAVE_BGQ_TRUE}"; then + echo " - BGQ METHOD is enabled"; +else + echo " - BGQ METHOD is disabled" +fi + +#echo " - SVN version = ${SVNVERSION}" +echo " - Install path = ${prefix}" diff --git a/tests/libs/adios/ohpc-tests/test_mpi_families b/tests/libs/adios/ohpc-tests/test_mpi_families new file mode 100755 index 0000000000..f9b17a021a --- /dev/null +++ b/tests/libs/adios/ohpc-tests/test_mpi_families @@ -0,0 +1,63 @@ +#!/bin/bash +# -*-sh-*- + +TEST_LOGS="" +MAKEFLAGS="" + +source ./TEST_ENV || exit 1 +source ./common/functions || exit 1 + +cd libs/adios || exit 1 + +export BATS_JUNIT_CLASS="Adios" + +# bootstrap the local autotools project if necessary + +module load autotools || exit 1 +./bootstrap || exit 1 + +for compiler in $COMPILER_FAMILIES ; do + for mpi in $MPI_FAMILIES ; do + + echo " " + echo " " + echo "-------------------------------------------------------" + echo "Libraries: $BATS_JUNIT_CLASS tests: $compiler-$mpi" + echo "-------------------------------------------------------" + + module purge + module load prun + module load $compiler + module load $mpi + module load adios + module load netcdf + module load phdf5 +# if [ "$compiler" = "gnu" ]; then +# module load mkl +# fi + + export LIBS='-ladios -lhdf5 -lz -llustreapi' + export CPPFLAGS="-I$ADIOS_INC -I$NETCDF_INC -I$HDF5_INC" + export LDFLAGS="-L$ADIOS_LIB -L$NETCDF_LIB -L$HDF5_LIB" + if [ "$mpi" = "mvapich2" ]; then + export LIBS="$LIBS -lpthread" + fi + + ./configure > /dev/null 2>&1 + pushd tests + find -type f -name 'Makefile' -exec sed -i 's#top_builddir)/src#ADIOS_LIB)#g' {} \; + #make clean + #make -k check + ./run + popd + + for dir in . suite/programs; do + save_logs_mpi_family tests/$dir $compiler $mpi + done + + pushd tests + make distclean > /dev/null 2>&1 + popd + done +done + diff --git a/tests/libs/adios/runconf b/tests/libs/adios/runconf new file mode 100755 index 0000000000..9ca8d6eb8c --- /dev/null +++ b/tests/libs/adios/runconf @@ -0,0 +1,912 @@ +#!/bin/bash +# +# This script is for configuring adios on the authors' machines +# You can study it to figure out how to configure adios on your system +# + +SRCDIR=`dirname ${BASH_SOURCE[0]}` + +if [ `hostname | cut -c 1-4` == "sith" ]; then + + ######## + # Sith # + ######## + source /etc/profile.d/modules.sh + TARGET=`module list 2>&1 | grep "PE"- | sed "s/^.*PE-\([a-z]*\).*/\1/"` + + if [ -z "$TARGET" ]; then + echo "Cannot determine Programming environment. Exit" + exit 1 + fi + echo "Configure on SITH for $TARGET env. for user ${USER}" + module unload hdf5 + module unload netcdf + module unload PE-gnu + module unload PE-pgi + module unload PE-intel + module unload PE-pathscale + module unload pgi gcc intel pathscale + module unload python + module unload mxml + module load PE-$TARGET + module load mxml/2.9 + MXMLDIR=$MXML_DIR + module unload mxml + module load python + # Use both seq hdf5 (for utils) and + # parallel hdf5 (for PHDF5 method) + module load hdf5/1.8.10 + SEQ_HDF5_DIR=$HDF5_DIR + SEQ_HDF5_CLIB=$HDF5_CLIB + module unload hdf5 + module load hdf5/1.8.10_par + PAR_HDF5_DIR=$HDF5_DIR + PAR_HDF5_CLIB=$HDF5_CLIB + module unload hdf5 + # Seq. and Parallel NetCDF 4 + module load netcdf/4.1.3 + SEQ_NC_DIR=$NETCDF_DIR + SEQ_NC_CLIB=$NETCDF_CLIB + module unload netcdf + module load netcdf/4.1.3_par + PAR_NC_DIR=$NETCDF_DIR + PAR_NC_CLIB=$NETCDF_CLIB + module unload netcdf + #module load szip + module load bzip2 + #module load dataspaces/1.4.0 + export MPICC=mpicc + export MPICXX=mpiCC + export MPIFC=mpif90 + WITHFLEX="" + WITHFGR="" + WITHFASTBIT="" + if [ "$TARGET" == "pgi" ]; then + export CC=pgcc + export CXX=pgCC + export FC=pgf90 + WITHFLEX="--with-flexpath=/ccs/proj/e2e/chaos/sith/$TARGET" + WITHFGR="--with-fgr=/ccs/proj/e2e/qliu/tap" + WITHFASTBIT="--with-fastbit=/sw/redhat6/fastbit/svn/rhel6_gnu4.7.2" + DATASPACES_DIR="/ccs/home/hbui/usr/software/dataspaces-dev" + elif [ "$TARGET" == "gnu" ]; then + export CC=gcc + export CXX=g++ + export FC=gfortran + WITHFLEX="--with-flexpath=/ccs/proj/e2e/chaos/sith/$TARGET" + WITHFASTBIT="--with-fastbit=/sw/redhat6/fastbit/svn/rhel6_gnu4.7.2" + elif [ "$TARGET" == "intel" ]; then + export CC=icc + export CXX=icpc + export FC=ifort + else + echo "TARGET must be pgi or gnu or intel" + exit 1 + fi + + export CPPFLAGS="-DMPICH_IGNORE_CXX_SEEK" + export CFLAGS="-g -fPIC" + $SRCDIR/configure --prefix=/ccs/proj/e2e/${USER}/ADIOS/sith.$TARGET \ + --config-cache \ + --enable-dependency-tracking \ + --enable-research-transports \ + --with-lustre \ + --with-mxml=$MXMLDIR \ + --with-hdf5=${SEQ_HDF5_DIR} \ + --with-hdf5-libs="${SEQ_HDF5_CLIB}" \ + --with-netcdf=${SEQ_NC_DIR} \ + --with-netcdf-libs="${SEQ_NC_CLIB}" \ + --with-zlib \ + --with-bzip2=$BZIP2_DIR \ + --with-dataspaces=$DATASPACES_DIR \ + --with-dimes=$DATASPACES_DIR \ + $WITHFLEX \ + $WITHFGR \ + $WITHFASTBIT \ + --with-aplod=/ccs/proj/e2e/ncsu/sith.gnu \ + --with-isobar=/ccs/proj/e2e/ncsu/sith.gnu \ + --with-glib=/ccs/proj/e2e/qliu/glib + #--with-szip=$SZIP_DIR \ + #--with-phdf5=${PAR_HDF5_DIR} \ + #--with-phdf5-libs="${PAR_HDF5_CLIB}" \ + #--with-nc4par=${PAR_NC_DIR} \ + #--with-nc4par-libs="${PAR_NC_CLIB}" \ + #--with-dmalloc=/ccs/proj/e2e/qliu/dmalloc.sith.$TARGET + #--with-dmalloc=/ccs/proj/e2e/pnorbert/dmalloc.$TARGET + #--enable-shared --disable-static + #--without-datatap #--without-infiniband + #--with-dmalloc=/ccs/proj/e2e/pnorbert/dmalloc.$TARGET + #--with-datatap=/ccs/home/habbasi/work/ewok/ + #--enable-datatap=ib + +elif [ `hostname | cut -c 1-4` == "rhea" ]; then + + ######## + # Rhea # + ######## + source /etc/profile.d/modules.sh + TARGET=`module list 2>&1 | grep "PE"- | sed "s/^.*PE-\([a-z]*\).*/\1/"` + + if [ -z "$TARGET" ]; then + echo "Cannot determine Programming environment. Exit" + exit 1 + fi + echo "Configure on Rhea for $TARGET env. for user ${USER}" + module unload mxml + module unload hdf5 + module unload netcdf + module unload PE-gnu + module unload PE-pgi + module unload PE-intel + module unload PE-pathscale + module unload pgi gcc intel pathscale + module unload python + module load PE-$TARGET + module load mxml + MXMLDIR=$MXML_DIR + module unload mxml + module load python + # Use both seq hdf5 (for utils) and + # parallel hdf5 (for PHDF5 method) + module load hdf5/1.8.11 + SEQ_HDF5_DIR=$HDF5_DIR + SEQ_HDF5_CLIB=$HDF5_CLIB + module unload hdf5 + module load hdf5-parallel/1.8.11 + PAR_HDF5_DIR=$HDF5_DIR + PAR_HDF5_CLIB=$HDF5_CLIB + module unload hdf5 + # Seq. and Parallel NetCDF 4 + module load netcdf/4.1.3 + SEQ_NC_DIR=$NETCDF_DIR + SEQ_NC_CLIB=$NETCDF_CLIB + module unload netcdf + #module load netcdf/4.1.3_par + #PAR_NC_DIR=$NETCDF_DIR + #PAR_NC_CLIB=$NETCDF_CLIB + #module unload netcdf + #module load szip + #module load bzip2 + #module load dataspaces/1.4.0 + export MPICC=mpicc + export MPICXX=mpiCC + export MPIFC=mpif90 + if [ "$TARGET" == "pgi" ]; then + export CC=pgcc + export CXX=pgCC + export FC=pgf90 + WITHFLEX="--with-flexpath=/ccs/proj/e2e/chaos/sith/$TARGET" + elif [ "$TARGET" == "gnu" ]; then + export CC=gcc + export CXX=g++ + export FC=gfortran + WITHFLEX="--with-flexpath=/ccs/proj/e2e/chaos/sith/$TARGET" + elif [ "$TARGET" == "intel" ]; then + export CC=icc + export CXX=icpc + export FC=ifort + WITHFLEX="" + else + echo "TARGET must be pgi or gnu or intel" + exit 1 + fi + + export CPPFLAGS="-DMPICH_IGNORE_CXX_SEEK" + export CFLAGS="-g -fPIC" + $SRCDIR/configure --prefix=/ccs/proj/e2e/${USER}/ADIOS/rhea.$TARGET \ + --config-cache \ + --enable-dependency-tracking \ + --enable-research-transports \ + --with-lustre \ + --with-mxml=$MXMLDIR + #--with-hdf5=${SEQ_HDF5_DIR} \ + #--with-hdf5-libs="${SEQ_HDF5_CLIB}" \ + #--with-phdf5=${PAR_HDF5_DIR} \ + #--with-phdf5-libs="${PAR_HDF5_CLIB}" \ + #--with-netcdf=${SEQ_NC_DIR} \ + #--with-netcdf-libs="${SEQ_NC_CLIB}" \ + #--with-nc4par=${PAR_NC_DIR} \ + #--with-nc4par-libs="${PAR_NC_CLIB}" \ + #--with-zlib \ + #--with-bzip2=$BZIP2_DIR \ + #--with-dataspaces=$DATASPACES_DIR \ + #$WITHFLEX \ + #--with-aplod=/ccs/proj/e2e/ncsu/sith.gnu \ + #--with-isobar=/ccs/proj/e2e/ncsu/sith.gnu \ + #--with-fgr=/ccs/proj/e2e/qliu/tap \ + #--with-glib=/ccs/proj/e2e/qliu/glib + #--with-szip=$SZIP_DIR \ + +elif [ `hostname | cut -c 1-4` == "yona" ]; then + + ######## + # Yona # + ######## + source /etc/profile.d/modules.sh + TARGET=`module list 2>&1 | grep "PE"- | sed "s/^.*PE-\([a-z]*\).*/\1/"` + echo "Configure on Yona for $TARGET env." + module unload hdf5 + module unload netcdf + module unload PE-gnu + module unload PE-pgi + module unload PE-intel + module unload PE-pathscale + module unload pgi gcc intel pathscale + #module unload python + module load PE-$TARGET + module load mxml + #module load python + # Use both seq hdf5 (for utils) and + # parallel hdf5 (for PHDF5 method) + module load hdf5/1.8.5 + SEQ_HDF5_DIR=$HDF5_DIR + SEQ_HDF5_CLIB=$HDF5_CLIB + module unload hdf5 + #module load hdf5/1.8.5_par + #PAR_HDF5_DIR=$HDF5_DIR + #PAR_HDF5_CLIB=$HDF5_CLIB + #module unload hdf5 + # Seq. and Parallel NetCDF 4 + module load netcdf/3.6.2 + SEQ_NC_DIR=$NETCDF_DIR + SEQ_NC_CLIB=$NETCDF_CLIB + module unload netcdf + #module load netcdf/4.1.1_par + #PAR_NC_DIR=$NETCDF_DIR + #PAR_NC_CLIB=$NETCDF_CLIB + #module unload netcdf + export MPICC=mpicc + export MPICXX=mpiCC + export MPIFC=mpif90 + if [ "$TARGET" == "pgi" ]; then + export CC=pgcc + export CXX=pgCC + export FC=pgf90 + elif [ "$TARGET" == "gnu" ]; then + export CC=gcc + export CXX=g++ + export FC=gfortran + elif [ "$TARGET" == "intel" ]; then + export CC=pgcc + export CXX=pgCC + export FC=pgf90 + elif [ "$TARGET" == "gnu" ]; then + export CC=gcc + export CXX=g++ + export FC=gfortran + elif [ "$TARGET" == "intel" ]; then + export CC=icc + export CXX=icpc + export FC=ifort + else + echo "TARGET must be pgi or gnu or intel" + exit 1 + fi + + export CFLAGS="-g -fPIC" + ${SRCDIR}/configure --prefix=/ccs/proj/e2e/pnorbert/ADIOS/yona.$TARGET \ + --enable-dependency-tracking \ + --enable-research-transports \ + --with-hdf5=${SEQ_HDF5_DIR} \ + --with-hdf5-libs="${SEQ_HDF5_CLIB}" \ + --with-netcdf=${SEQ_NC_DIR} \ + --with-netcdf-libs="${SEQ_NC_CLIB}" \ + --with-lustre=/usr \ + --without-datatap --without-infiniband + #--with-phdf5=${PAR_HDF5_DIR} \ + #--with-phdf5-libs="${PAR_HDF5_CLIB}" \ + #--with-nc4par=${PAR_NC_DIR} \ + #--with-nc4par-libs="${PAR_NC_CLIB}" \ + #--with-dmalloc=/ccs/proj/e2e/pnorbert/dmalloc.$TARGET + #--with-datatap=/ccs/home/habbasi/work/ewok/ + #--enable-datatap=ib + + +elif [ `hostname | cut -c 1-5` == "titan" ]; then + + BUILD_STAGING=true + #source /opt/modules/default/etc/modules.sh + TARGET=`module list 2>&1 | grep "PrgEnv"- | sed "s/^.*PrgEnv-\([a-z]*\).*/\1/"` + if [ $BUILD_STAGING == "false" ]; then + + ################ + # Titan # + ################ + #TARGET=pgi + echo "Configure on TITAN (XK7) for $TARGET env." + export CC=cc + export FC=ftn + export CXX=CC + module unload szip + module unload hdf5 + module unload netcdf + module unload netcdf-hdf5parallel + module unload hdf5-parallel + module unload mxml + module unload PrgEnv-gnu + module unload PrgEnv-pgi + module unload PrgEnv-intel + module unload PrgEnv-cray + #module unload papi + module load PrgEnv-$TARGET + #module unload intel + #module load intel/13.1.3.192 + module swap craype-interlagos craype-istanbul + #module load szip + #module load xt-papi + module load mxml + # use the two lines below for openmpi + #export CC=mpicc + #export FC=mpif90 + CFLAGS="-g -fPIC -O0" ${SRCDIR}/configure --prefix=/ccs/proj/e2e/${USER}/ADIOS/xk6.$TARGET \ + --enable-dependency-tracking \ + --with-lustre + #--with-fgr=/ccs/proj/e2e/qliu/tap \ + #--with-hdf5=/opt/cray/hdf5/1.8.7/pgi/109 \ + #--with-phdf5=/opt/cray/hdf5-parallel/1.8.7/pgi/109 \ +# --with-dmalloc=/ccs/proj/e2e/qliu/dmalloc.$TARGET +# --enable-research-transports \ +# --with-netcdf=/opt/cray/netcdf/3.6.2/netcdf-${TARGET} \ +# --with-nc4par=/opt/cray/netcdf-hdf5parallel/4.0.1.3/netcdf-hdf5parallel-$TARGET \ +# --with-phdf5=/opt/cray/hdf5-parallel/1.8.4.1/hdf5-parallel-$TARGET \ +# --with-hdf5=/sw/xt5/hdf5/1.8.2/cnl2.1_gnu7.2.3 \ +# --with-hdf5=/sw/xt5/hdf5/1.8.2/cnl2.1_gnu4.2.0 \ +# --with-mxml=/ccs/proj/e2e/pnorbert/mxml.xt5.$TARGET \ + + else + + ########################## + # Titan + staging # + ########################## + #TARGET=pgi + echo "Configure on TITAN (XK7) including staging methods for $TARGET env." + export CC=cc + export FC=ftn + export CXX=CC + module unload szip + module unload hdf5 + module unload netcdf + module unload hdf5-parallel + module unload netcdf-hdf5parallel + module unload mxml + module unload fastbit + module unload PrgEnv-gnu + module unload PrgEnv-pgi + module unload PrgEnv-intel + module unload PrgEnv-cray + #module unload papi + #module unload xtpe-quadcore + module load PrgEnv-$TARGET + module swap craype-interlagos craype-istanbul + module swap cray-libsci + module load dataspaces/1.4.0 + unset EXTRA_LIBS + unset LDFLAGS + if [ "$TARGET" == "pgi" ]; then + #module swap pgi pgi/11.8.0 + # FASTBIT needs libstdc++ and -pgcpplibs flag + export LDFLAGS="-pgcpplibs" + export EXTRA_LIBS="/opt/gcc/4.8.2/snos/lib64/libstdc++.a" + #DATASPACES_DIR="/ccs/proj/e2e/dataspaces/titan/$TARGET" + WITHFLEX="" + elif [ "$TARGET" == "gnu" ]; then + # NSSI/FLEXPATH/FASTBIT needs libstdc++ + export LDFLAGS="-pgcpplibs" + export EXTRA_LIBS="${GCC_PATH}/snos/lib64/libstdc++.a" + WITHFLEX="--with-flexpath=/ccs/proj/e2e/chaos/titan/$TARGET" + # FASTBIT needs libstdc++ + #export EXTRA_LIBS="/opt/gcc/4.8.2/snos/lib64/libstdc++.a" + #module swap gcc gcc/4.4.4 + #DATASPACES_DIR="/ccs/proj/e2e/dataspaces/titan/$TARGET" + fi + + # NOTE hdf5-parallel module does not work with C++ compiler + #module load hdf5-parallel + #module load netcdf-hdf5parallel + module load szip + #module load papi + module load mxml/2.9 + module load fastbit + # use the two lines below for openmpi + #export CC=mpicc + #export FC=mpif90 + export CPPFLAGS="-DMPICH_IGNORE_CXX_SEEK -DDART_DO_VERSIONING" + export CFLAGS="-fPIC -g -O0" + LIBS="$EXTRA_LIBS" ${SRCDIR}/configure --prefix=/ccs/proj/e2e/${USER}/ADIOS/xk6.$TARGET \ + --enable-dependency-tracking \ + --disable-maintainer-mode \ + --with-cray-pmi=/opt/cray/pmi/default \ + --with-cray-ugni-incdir=/opt/cray/gni-headers/default/include \ + --with-cray-ugni-libdir=/opt/cray/ugni/default/lib64 \ + --with-dataspaces=$DATASPACES_DIR \ + --with-dimes=$DATASPACES_DIR \ + $WITHFLEX \ + --with-fastbit=$FASTBIT_DIR \ + --with-lustre \ + --disable-timers --disable-timer-events \ + --with-zlib --with-bzip2 + + #--enable-skel-timing + #--with-fgr=/ccs/proj/e2e/qliu/tap \ + #--with-glib=/ccs/proj/e2e/qliu/glib \ + #--with-netcdf=/opt/cray/netcdf/3.6.2/netcdf-${TARGET} \ + #--with-hdf5=/sw/xt5/hdf5/1.8.2/cnl2.1_gnu4.2.0 \ + #--with-nc4par=/opt/cray/netcdf-hdf5parallel/4.0.1.3/netcdf-hdf5parallel-$TARGET \ + #--with-phdf5=/opt/cray/hdf5-parallel/1.8.4.1/hdf5-parallel-$TARGET \ + #--with-dimes=/ccs/proj/e2e/pnorbert/spaces/$TARGET + #--with-nssi=/ccs/proj/e2e/pnorbert/nssi/xt5/$TARGET \ + #--with-datatap=/ccs/home/zf2/work/pe.$TARGET \ + #--with-datatap=/ccs/proj/e2e/pnorbert/datatap/xt5/$TARGET \ + + fi + + + +elif [ `hostname | cut -c 1-4` == "eos-" ]; then + + ################# + # EOS Cray XC30 # + ################# + #source /opt/modules/default/etc/modules.sh + TARGET=`module list 2>&1 | grep "PrgEnv"- | sed "s/^.*PrgEnv-\([a-z]*\).*/\1/"` + echo "Configure on EOS (Cray XC30) for $TARGET env." + export CC=cc + #export CFLAGS="-Wall -g" + export FC=ftn + export CXX=CC + module unload szip + module unload hdf5 + module unload netcdf + module unload netcdf-hdf5parallel + module unload hdf5-parallel + module unload PrgEnv-gnu + module unload PrgEnv-pgi + module unload PrgEnv-intel + module unload PrgEnv-cray + module unload papi + module unload pmi + module load PrgEnv-$TARGET + if [ "$TARGET" == "pgi" ]; then + # NSSI needs -pgcpplibs flag + export LDFLAGS="-pgcpplibs" + unset EXTRA_LIBS + elif [ "$TARGET" == "gnu" ]; then + # NSSI needs libstdc++ + unset LDFLAGS + export EXTRA_LIBS="/opt/gcc/4.8.1/snos/lib64/libstdc++.a" + module swap gcc gcc/4.8.1 + else + unset LDFLAGS + unset EXTRA_LIBS + fi + module load mxml + module load pmi + CFLAGS="-g -fPIC" ${SRCDIR}/configure --prefix=/ccs/proj/e2e/pnorbert/ADIOS/eos.$TARGET \ + --enable-dependency-tracking \ + --with-cray-pmi=/opt/cray/pmi/default \ + --with-cray-ugni-incdir=/opt/cray/gni-headers/default/include \ + --with-cray-ugni-libdir=/opt/cray/ugni/default/lib64 \ + + +elif [ `hostname | cut -c 1-7` == "chester" ]; then + + ############### + # Chester XK6 # + ############### + #source /opt/modules/default/etc/modules.sh + TARGET=`module list 2>&1 | grep "PrgEnv"- | sed "s/^.*PrgEnv-\([a-z]*\).*/\1/"` + echo "Configure on Chester (XK6) for $TARGET env." + export CC=cc + export FC=ftn + export CXX=CC + module unload szip + module unload hdf5 + module unload netcdf + module unload netcdf-hdf5parallel + module unload hdf5-parallel + module unload PrgEnv-gnu + module unload PrgEnv-pgi + module unload PrgEnv-intel + module unload PrgEnv-cray + module unload papi + module unload pmi + module load PrgEnv-$TARGET + module swap cray-libsci + module swap craype-interlagos craype-istanbul + module load dataspaces/1.4.0 + unset FLEXPATH + if [ "$TARGET" == "pgi" ]; then + # NSSI needs -pgcpplibs flag + export LDFLAGS="-pgcpplibs" + unset EXTRA_LIBS + elif [ "$TARGET" == "gnu" ]; then + # NSSI needs libstdc++ + unset LDFLAGS + export EXTRA_LIBS="/opt/gcc/4.7.1/snos/lib64/libstdc++.a" + export FLEXPATH="--with-flexpath=/ccs/proj/e2e/chaos/titan/gnu" + #module swap gcc gcc/4.4.4 + else + unset LDFLAGS + unset EXTRA_LIBS + fi + #module load szip + #module load xt-papi + module load mxml + module load pmi + module load rca + # use the two lines below for openmpi + #export CC=mpicc + #export FC=mpif90 + CFLAGS="-g -fPIC" LDFLAGS="$CRAY_RCA_POST_LINK_OPTS" \ + ${SRCDIR}/configure --prefix=/ccs/proj/e2e/pnorbert/ADIOS/chester.$TARGET \ + --enable-dependency-tracking \ + --with-cray-pmi=/opt/cray/pmi/default \ + --with-cray-ugni-incdir=/opt/cray/gni-headers/default/include \ + --with-cray-ugni-libdir=/opt/cray/ugni/default/lib64 \ + --with-dataspaces=$DATASPACES_DIR \ + --with-dimes=$DATASPACES_DIR \ + $FLEXPATH \ + --without-infiniband +# --with-lustre=/opt/xt-lustre-ss/2.2_1.6.5/usr \ +# --with-dmalloc=/ccs/proj/e2e/qliu/dmalloc.$TARGET \ +# --enable-research-transports \ +# --with-netcdf=/opt/cray/netcdf/3.6.2/netcdf-${TARGET} \ +# --with-nc4par=/opt/cray/netcdf-hdf5parallel/4.0.1.3/netcdf-hdf5parallel-$TARGET \ +# --with-phdf5=/opt/cray/hdf5-parallel/1.8.4.1/hdf5-parallel-$TARGET \ +# --with-hdf5=/sw/xt5/hdf5/1.8.2/cnl2.1_gnu7.2.3 \ +# --with-hdf5=/sw/xt5/hdf5/1.8.2/cnl2.1_gnu4.2.0 \ +# --with-mxml=/ccs/proj/e2e/pnorbert/mxml.xt5.$TARGET \ +# --with-cray-ugni-incdir=/opt/cray/gni-headers/2.1-1.0400.4351.3.1.gem/include \ + + +elif [ `hostname -f | cut -c 1-4` == "mira" ]; then + ##################### + # MIRA BlueGene # + ##################### + echo "Configure on Mira (BlueGene/Q)" + #export MPICC=mpicc + #export MPIFC=mpif90 + #export CFLAGS="" + #export FC=gfortran + #export CC=gcc + #export FCFLAGS="-funderscoring" + export MPICC=mpixlc_r + export MPIFC=mpixlf90_r + export CFLAGS="" + export FC=xlf90_r + export CC=xlc_r + + ${SRCDIR}/configure --prefix=/home/qliu/4se/ADIOS \ + --enable-dependency-tracking \ + --with-mxml=/home/qliu/mxml \ + --without-datatap --without-infiniband --with-bgq + +elif [ `hostname -f | cut -c 1-5` == "vesta" ]; then + ###################### + # VESTA BlueGene # + ###################### + echo "Configure on Vesta (BlueGene/Q)" + export MPICC=mpixlc_r + export MPIFC=mpixlf90 + export CFLAGS="" + export FC=bgxlf90 + export CC=bgxlc + + ${SRCDIR}/configure --prefix=/home/qliu/ADIOS \ + --enable-dependency-tracking \ + --with-mxml=/home/qliu/mxml \ + --without-datatap --without-infiniband --with-bgq + +elif [ `hostname | cut -c 1-6` == "edison" ]; then + ########## + # EDISON # + ########## + TARGET=`module list 2>&1 | grep "PrgEnv"- | sed "s/^.*PrgEnv-\([a-z]*\).*/\1/"` + echo "Configure on EDISON for $TARGET env." + export MPICC=cc + export MPICXX=CC + export MPIFC=ftn + module unload hdf5 + module unload netcdf + module unload hdf5-parallel + module unload netcdf-hdf5parallel + module unload PrgEnv-gnu + module unload PrgEnv-pgi + module unload PrgEnv-pathscale + module unload PrgEnv-cray + module load PrgEnv-$TARGET + module swap cray-libsci + module load python + WITHDART="" + if [ "$TARGET" == "pgi" ]; then + export CC=pgcc + export CXX=pgCC + export FC=pgf90 + export LDFLAGS="-pgcpplibs" + #WITHDART="--with-dataspaces=/global/homes/p/pnorbert/dataspaces/1.1.0/$TARGET" + elif [ "$TARGET" == "gnu" ]; then + export CC=gcc + export CXX=g++ + export FC=gfortran + export LDFLAGS="" + #WITHDART="--with-dataspaces=/global/homes/p/pnorbert/dataspaces/1.1.0/$TARGET" + elif [ "$TARGET" == "intel" ]; then + export CC=icc + export CXX=icpc + export FC=ifort + export LDFLAGS="" + WITHDART="" + else + echo "TARGET must be pgi or gnu or intel" + exit 1 + fi + export CPPFLAGS="-DMPICH_IGNORE_CXX_SEEK" + export CFLAGS="-fPIC" + ${SRCDIR}/configure --prefix=/global/homes/p/pnorbert/adios/master/edison/$TARGET \ + --enable-dependency-tracking \ + --with-mxml=$HOME/mxml/mxml.edison \ + --with-lustre=/usr \ + $WITHDART \ + --with-cray-pmi-incdir=/opt/cray/pmi/default/include \ + --with-cray-pmi-libdir=/opt/cray/pmi/default/lib64 \ + --with-cray-ugni-incdir=/opt/cray/gni-headers/default/include \ + --with-cray-ugni-libdir=/opt/cray/ugni/default/lib64 \ + --without-infiniband \ + --without-hdf5 --without-netcdf + +elif [ `hostname | cut -c 1-6` == "hopper" ]; then + ########## + # Hopper # + ########## + TARGET=`module list 2>&1 | grep "PrgEnv"- | sed "s/^.*PrgEnv-\([a-z]*\).*/\1/"` + echo "Configure on HOPPER for $TARGET env." + export MPICC=cc + export MPICXX=CC + export MPIFC=ftn + module unload hdf5 + module unload netcdf + module unload hdf5-parallel + module unload netcdf-hdf5parallel + #module unload PrgEnv-gnu + #module unload PrgEnv-pgi + #module unload PrgEnv-pathscale + #module unload PrgEnv-cray + #module load PrgEnv-$TARGET + #module swap cray-libsci + module load python + if [ "$TARGET" == "pgi" ]; then + export CC=pgcc + export CXX=pgCC + export FC=pgf90 + export LDFLAGS="-pgcpplibs" + WITHDART="--with-dataspaces=/global/homes/p/pnorbert/dataspaces/1.1.0/$TARGET" + elif [ "$TARGET" == "gnu" ]; then + export CC=gcc + export CXX=g++ + export FC=gfortran + export LDFLAGS="" + WITHDART="--with-dataspaces=/global/homes/p/pnorbert/dataspaces/1.1.0/$TARGET" + elif [ "$TARGET" == "intel" ]; then + export CC=icc + export CXX=icpc + export FC=ifort + export LDFLAGS="" + WITHDART="" + else + echo "TARGET must be pgi or gnu or intel" + exit 1 + fi + export CPPFLAGS="-DMPICH_IGNORE_CXX_SEEK" + export CFLAGS="-fPIC" + ${SRCDIR}/configure --prefix=/project/projectdirs/m499/adios/devel-hopper-$TARGET \ + --enable-dependency-tracking \ + --with-mxml=$HOME/mxml/mxml.hopper \ + --with-lustre=/usr \ + $WITHDART \ + --with-cray-pmi-incdir=/opt/cray/pmi/default/include \ + --with-cray-pmi-libdir=/opt/cray/pmi/default/lib64 \ + --with-cray-ugni-incdir=/opt/cray/gni-headers/default/include \ + --with-cray-ugni-libdir=/opt/cray/ugni/default/lib64 \ + --without-infiniband \ + --without-hdf5 --without-netcdf + + +elif [ `hostname | cut -c 1-6` == "kraken" ]; then + ########## + # Kraken # + ########## + source /opt/modules/default/etc/modules.sh + TARGET=`module list 2>&1 | grep PrgEnv | sed "s/^.*Env-\([a-z]*\).*/\1/"` + + if [ -z "$TARGET" ]; then + echo "Cannot determine Programming environment. Exit" + exit 1 + fi + echo "" + echo "Configure KRAKEN for the $TARGET compiler" + echo "" + export CC=cc + export FC=ftn + export CXX=CC + module unload szip + module unload hdf5 + module unload netcdf + module unload hdf5-parallel + module unload netcdf-hdf5parallel + module unload xt-papi + module unload papi + if [ "$TARGET" == "pgi" ]; then + #module swap pgi pgi/10.4.0 + # NSSI needs -pgcpplibs flag + export EXTRA_LIBS="" + export LDFLAGS="-pgcpplibs" + elif [ "$TARGET" == "gnu" ]; then + # NSSI needs libstdc++ + export EXTRA_LIBS="/opt/gcc/4.4.4/snos/lib64/libstdc++.a" + export LDFLAGS="" + #module swap gcc gcc/4.4.4 + fi + + module load szip + module load mxml + module load subversion + export CPPFLAGS="-DMPICH_IGNORE_CXX_SEEK" + export CFLAGS="-fPIC -g -O0" + ${SRCDIR}/configure --prefix=/${HOME}/adios/$TARGET \ + --enable-dependency-tracking \ + --with-portals=yes \ + --without-netcdf --without-nc4par --without-hdf5 --without-phdf5 \ + --with-dataspaces=${HOME}/dataspaces/1.3.0/$TARGET + + +elif [ `hostname | cut -c 1-4` == "dyn9" -o `hostname | cut -c 1-3` == "pnb" ]; then + + ####### + # Mac # + ####### + echo "Configure on Mac" + # Installed MacPorts and GCC4.4 and OpenMPI 1.4.2 ports + # But should work with default mpicc and gcc, using --disable-fortran + export CC=/opt/local/bin/gcc-mp-4.4 + export FC=/opt/local/bin/gfortran-mp-4.4 + export CXX=/opt/local/bin/g++-mp-4.4 + export MPICC=/opt/local/bin/openmpicc + export MPIFC=/opt/local/bin/openmpif90 + export MPICXX=/opt/local/bin/openmpicxx + CFLAGS="-g -DO_LARGEFILE=0 -fno-common" ${SRCDIR}/configure --prefix=/opt/adios \ + --with-mxml=/opt/mxml \ + --with-netcdf=/opt/netcdf \ + --with-phdf5=/opt/hdf5 \ + --with-hdf5=/opt/hdf5.seq + + +elif [ `hostname | cut -c 1-7` == "ubuntu" ]; then + + ######################### + # Scott's ubuntu laptop # + ######################### + echo "Configure on UBUNTU" + export CC=mpicc + ${SRCDIR}/configure --prefix=/usr/local/adios \ + --enable-dependency-tracking \ + --with-mxml=/usr/local/adios + #--with-hdf5=/usr/local/hdf5-serial\ + #--with-phdf5=/usr/local \ + #--with-netcdf=/usr + + +elif [ `hostname | cut -c 1-7` == "nostril" ]; then + + ######################### + # Dave's workstation # + ######################### + echo "Configure on Nostril" + export CC=mpicc + export CFLAGS="-fPIC" + ${SRCDIR}/configure --prefix=/apps/adios/trunk \ + --enable-dependency-tracking \ + --with-mxml=/usr \ + --without-netcdf --without-nc4par --without-hdf5 --without-phdf5 + #--with-hdf5=/usr/local/hdf5-serial\ + #--with-phdf5=/usr/local \ + + +elif [ `hostname | cut -c 1-6` == "tomato" ]; then + + ######################### + # Todd's ubuntu laptop # + ######################### + echo "Configure on UBUNTU" + export CC=mpicc + ${SRCDIR}/configure --prefix=/home/thkorde/local \ + --enable-dependency-tracking \ + --with-mxml=/home/thkorde/local \ + --with-phdf5=/home/thkorde/local \ + --with-hdf5=/home/thkorde/local \ + --with-netcdf=/home/thkorde/local + + +elif [ `hostname | cut -c 1-4` == "qliu" ]; then + + ######################### + # Gary's ubuntu laptop # + ######################### + echo "Configure on UBUNTU" + export CC=mpicc + export CFLAGS="-g -O0 -fPIC" + ${SRCDIR}/configure --prefix=/home/qliu/ADIOS \ + --enable-dependency-tracking \ + --with-mxml=/home/qliu/mxml \ + --with-phdf5=/home/thkorde/local \ + #--with-hdf5=/home/thkorde/local \ + #--with-netcdf=/home/thkorde/local + + +elif [ `hostname | cut -c 1-2` == "ln" ]; then + ####################### + # Tianhe-1A # + ####################### + echo "Configure on Tianhe-1A." + #export MPICC= + #export MPICXX= + #export MPIFC= + export CC=icc + export CXX=icpc + export FC=ifort + + ${SRCDIR}/configure --prefix=/vol6/home/Jeremy/adios-install \ + --enable-dependency-tracking \ + --with-mxml=/vol6/home/Jeremy/mxml-install \ + --enable-skel-timing \ + --disable-maintainer-mode + + + #--with-phdf5=/opt/hdf5-1.8.12-parallel \ + #--with-hdf5=/opt/hdf5-1.8.12 \ + #--with-netcdf=/opt/netcdf-3.6.3 \ + #--with-zlib=/opt/zlib \ + #--with-szip=/opt/szip-2.1 \ + #--with-bzip2=/usr/lib/i386-linux-gnu \ + #--with-isobar=/opt/isobar \ + #--with-flexpath=/opt/chaos + +elif [ `hostname | cut -c 1-7` == "adiosVM" ]; then + + ####################### + # ADIOS Virtual Box # + ####################### + echo "Configure on ADIOS VirtualBox." + export MPICC=mpicc + export MPICXX=mpicxx + export MPIFC=mpif90 + export CC=gcc + export CXX=g++ + export FC=gfortran + + export CFLAGS="-g -O0 -fPIC -Wno-int-to-pointer-cast -Wno-pointer-to-int-cast" + ${SRCDIR}/configure --prefix=/opt/adios/1.8 \ + --disable-maintainer-mode \ + --enable-dependency-tracking \ + --with-mxml=/opt/mxml \ + --with-zlib \ + --with-bzip2 \ + --with-szip=/opt/szip \ + --with-isobar=/opt/isobar \ + --with-flexpath=/opt/chaos \ + --with-fastbit=/opt/fastbit \ + --with-hdf5=/opt/hdf5-1.8.12 \ + --with-phdf5=/opt/hdf5-1.8.12-parallel \ + --with-netcdf=/opt/netcdf-4.3.0 \ + --enable-timers \ + --disable-timer-events + + + +else + echo "Could not determine what machine is this." + echo "This script is for configuring adios on the authors' machines." + echo "You can study it to figure out how to configure adios on your system." +fi + + + diff --git a/tests/libs/adios/src/core/CMakeLists.txt b/tests/libs/adios/src/core/CMakeLists.txt new file mode 100644 index 0000000000..9edf3b11e8 --- /dev/null +++ b/tests/libs/adios/src/core/CMakeLists.txt @@ -0,0 +1 @@ +include_directories(${PROJECT_BINARY_DIR}) diff --git a/tests/libs/adios/src/core/adios.c b/tests/libs/adios/src/core/adios.c new file mode 100644 index 0000000000..67088ba85a --- /dev/null +++ b/tests/libs/adios/src/core/adios.c @@ -0,0 +1,596 @@ +/* + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + */ + +#include "config.h" +#include +#include +#include +#include +#include + +// xml parser +#include + +#include "adios.h" +#include "adios_error.h" +#include "core/globals.h" +#include "core/common_adios.h" +#include "core/adios_bp_v1.h" +#include "core/adios_internals.h" +#include "core/adios_internals_mxml.h" +#include "core/adios_transport_hooks.h" +#include "core/adios_logger.h" +#include "core/adios_timing.h" + +#ifdef DMALLOC +#include "dmalloc.h" +#endif + +extern struct adios_transport_struct * adios_transports; +extern int adios_errno; + +int adios_set_application_id (int id) +{ + globals_adios_set_application_id (id); + return err_no_error; +} + +/////////////////////////////////////////////////////////////////////////////// +int adios_init (const char * config, MPI_Comm comm) +{ + return common_adios_init (config, comm); +} + + +/////////////////////////////////////////////////////////////////////////////// +// all XML file pieces will be provided by another series of calls +int adios_init_noxml (MPI_Comm comm) +{ + return common_adios_init_noxml (comm); +} + +/////////////////////////////////////////////////////////////////////////////// +int adios_finalize (int mype) +{ + return common_adios_finalize (mype); +} + +/////////////////////////////////////////////////////////////////////////////// +int adios_allocate_buffer (enum ADIOS_BUFFER_ALLOC_WHEN adios_buffer_alloc_when + ,uint64_t buffer_size) +{ + return common_adios_allocate_buffer (adios_buffer_alloc_when, buffer_size); +} + +/////////////////////////////////////////////////////////////////////////////// +int adios_open (int64_t * fd, const char * group_name, const char * name + ,const char * mode, MPI_Comm comm + ) +{ + return common_adios_open (fd, group_name, name, mode, comm); +} + +/////////////////////////////////////////////////////////////////////////////// +int adios_group_size (int64_t fd_p, uint64_t data_size + ,uint64_t * total_size + ) +{ + return common_adios_group_size (fd_p, data_size, total_size); +} + +/////////////////////////////////////////////////////////////////////////////// +/* This C api function is slightly different from adios_write. Instead of + * passing variable names, user is expected to pass variable id, which is returned + * from adios_define_var call. Therefore, this function is only used in the no-xml way. + */ +int adios_write_byid (int64_t fd_p, int64_t id, void * var) +{ + return common_adios_write_byid ((struct adios_file_struct *) fd_p, (struct adios_var_struct *) id, var); +} + +/////////////////////////////////////////////////////////////////////////////// +/* This C api function is a bit different from the Fortran api funcion, but + * they call the same common_adios_write() + */ +int adios_write (int64_t fd_p, const char * name, void * var) +{ + int retval; + struct adios_file_struct * fd = (struct adios_file_struct *) fd_p; + if (!fd) + { + adios_error (err_invalid_file_pointer, "Invalid handle passed to adios_write\n"); + return adios_errno; + } + + struct adios_var_struct * v = fd->group->vars; + struct adios_method_list_struct * m = fd->group->methods; + + if (m && m->next == NULL && m->method->m == ADIOS_METHOD_NULL) + { + // nothing to do so just return OK (=0) + return err_no_error; + } + log_debug ("%s (%s)\n", __func__, name); + v = adios_find_var_by_name (fd->group, name); + + if (!v) + { + adios_error (err_invalid_varname, "Bad var name (ignored) in adios_write(): '%s'\n", name); + + return adios_errno; + } + + retval = common_adios_write_byid (fd, v, var); +#if 0 + if (fd->mode == adios_mode_read) + { + if ( strcasecmp (name, fd->group->group_comm) + && v->is_dim != adios_flag_yes + ) + { + adios_error (err_invalid_file_mode, "write attempted on %s in %s. This was opened for read\n" ,name , fd->name); + return 1; + } + } + + if (!var) + { + adios_error (err_invalid_data, "Invalid data (NULL pointer) passed to write for variable %s\n", name); + + return 1; + } + + if (v->data) + { + free (v->data); + v->data = 0; + } + + if (v->dimensions) + { + v->data = var; + } + else + { + uint64_t element_size = adios_get_type_size (v->type, var); + + switch (v->type) + { + case adios_byte: + case adios_short: + case adios_integer: + case adios_long: + case adios_unsigned_byte: + case adios_unsigned_short: + case adios_unsigned_integer: + case adios_unsigned_long: + case adios_real: + case adios_double: + case adios_long_double: + case adios_complex: + case adios_double_complex: + v->data = malloc (element_size); + if (!v->data) + { + adios_error (err_no_memory, + "In adios_write, cannot allocate %lld bytes to copy scalar %s\n", + element_size, v->name); + + return 0; + } + + memcpy ((char *) v->data, var, element_size); + break; + + case adios_string: + v->data = malloc (element_size + 1); + if (!v->data) + { + adios_error (err_no_memory, + "In adios_write, cannot allocate %lld bytes to copy string %s\n", + element_size, v->name); + + return 0; + } + ((char *) v->data) [element_size] = 0; + memcpy ((char *) v->data, var, element_size); + break; + + default: + v->data = 0; + break; + } + } + + common_adios_write (fd, v, var); + // v->data is set to NULL in the above call + + if (fd->mode == adios_mode_write || fd->mode == adios_mode_append) + { + adios_copy_var_written (fd->group, v); + } +#endif + return retval; +} + + +/////////////////////////////////////////////////////////////////////////////// +int adios_get_write_buffer (int64_t fd_p, const char * name + ,uint64_t * size + ,void ** buffer + ) +{ + return common_adios_get_write_buffer (fd_p, name, size, buffer); +} + +/////////////////////////////////////////////////////////////////////////////// +int adios_read (int64_t fd_p, const char * name, void * buffer + ,uint64_t buffer_size + ) +{ + return common_adios_read (fd_p, name, buffer, buffer_size); +} + +/////////////////////////////////////////////////////////////////////////////// +int adios_set_path (int64_t fd_p, const char * path) +{ + return common_adios_set_path (fd_p, path); +} + +/////////////////////////////////////////////////////////////////////////////// +int adios_set_path_var (int64_t fd_p, const char * path, const char * name) +{ + return common_adios_set_path_var (fd_p, path, name); +} + +/////////////////////////////////////////////////////////////////////////////// +// hint that we reached the end of an iteration (for asynchronous pacing) +int adios_end_iteration () +{ + return common_adios_end_iteration (); +} + +/////////////////////////////////////////////////////////////////////////////// +// hint to start communicating +int adios_start_calculation () +{ + return common_adios_start_calculation (); +} + +/////////////////////////////////////////////////////////////////////////////// +// hint to stop communicating +int adios_stop_calculation () +{ + return common_adios_stop_calculation (); +} + +/////////////////////////////////////////////////////////////////////////////// +int adios_close (int64_t fd_p) +{ + int retval; + struct adios_file_struct * fd = (struct adios_file_struct *) fd_p; + struct adios_var_struct * v = fd->group->vars; + + retval = common_adios_close (fd_p); + + // Q.L. 10-2010. To fix a memory leak problem. + while (v) { + int j, idx; + int c, count = 1; + // NCSU - Clear stats + if (v->stats) { + + if (v->type == adios_complex || v->type == adios_double_complex) + count = 3; + else + count = 1; + + for (c = 0; c < count; c ++) { + j = idx = 0; + while (v->bitmap >> j) { + if (v->bitmap >> j & 1) { + if (j == adios_statistic_hist) { + struct adios_index_characteristics_hist_struct * hist = + (struct adios_index_characteristics_hist_struct *) v->stats[c][idx].data; + if (hist) { + free (hist->breaks); + free (hist->frequencies); + free (hist); + v->stats[c][idx].data = 0; + } + } + else { + if (v->stats[c][idx].data) { + free (v->stats[c][idx].data); + v->stats[c][idx].data = 0; + } + } + idx ++; + } + j ++; + } + } + } + + // NCSU ALACRITY-ADIOS - Clear transform metadata + // adios_transform_clear_transform_var(v); // Actually, no, we shouldn't free the metadata here, because this happens once a timestep, + // and this shouldn't be free'd until finalize (it is just overwritten each timestep) + + v = v->next; + } + return retval; +} + +////////////////////////////////////////////////////////////////////////////// +// Methods normally only called by the XML parser +////////////////////////////////////////////////////////////////////////////// + +// adios_common_declare_group is in adios_internals.c + +/////////////////////////////////////////////////////////////////////////////// +// group a list of vars into a composite group +int adios_declare_group (int64_t * id, const char * name + ,const char * time_index + ,enum ADIOS_FLAG stats + ) +{ + int ret; + adios_errno = err_no_error; + ret = adios_common_declare_group (id, name, adios_flag_no + ,"" + ,"" + ,time_index + ,stats + ); + if (ret == 1) { + struct adios_group_struct * g = (struct adios_group_struct *) *id; + g->all_unique_var_names = adios_flag_no; + } + return adios_errno; +} + +int adios_free_group (int64_t id) +{ + adios_errno = err_no_error; + adios_common_free_group (id); + return adios_errno; +} + +/////////////////////////////////////////////////////////////////////////////// + +// adios_common_define_var is in adios_internals.c + +// declare a single var as an entry in a group +int64_t adios_define_var (int64_t group_id, const char * name + ,const char * path + ,enum ADIOS_DATATYPES type + ,const char * dimensions + ,const char * global_dimensions + ,const char * local_offsets + ) +{ + adios_errno = err_no_error; + return adios_common_define_var (group_id, name, path + ,type + ,dimensions + ,global_dimensions, local_offsets + ); +} + +// delete all variable definitions from a group +// Use if you want to define a new set of variables for the next output step. +int adios_delete_vardefs (int64_t id) +{ + adios_errno = err_no_error; + if (id != 0) { + struct adios_group_struct * g = (struct adios_group_struct *) id; + adios_common_delete_vardefs (g); + } else { + adios_error (err_invalid_group, "adios_delete_vardefs() called with 0 argument\n"); + } + return adios_errno; +} + +/////////////////////////////////////////////////////////////////////////////// +// adios_common_set_transform is in adios_internals.c +// set the transform method for the selected variable (default is "none") +int adios_set_transform (int64_t var_id, const char *transform_type_str) +{ + adios_errno = err_no_error; + return adios_common_set_transform (var_id, transform_type_str); +} + + +/////////////////////////////////////////////////////////////////////////////// + +// adios_common_define_attribute is in adios_internals.c + +int adios_define_attribute (int64_t group, const char * name + ,const char * path, enum ADIOS_DATATYPES type + ,const char * value, const char * var + ) +{ + adios_errno = err_no_error; + adios_common_define_attribute (group, name, path, type, value, var); + return adios_errno; +} + +// delete all attribute definitions from a group +// Use if you want to define a new set of attributes for the next output step. +int adios_delete_attrdefs (int64_t id) +{ + adios_errno = err_no_error; + if (id != 0) { + struct adios_group_struct * g = (struct adios_group_struct *) id; + adios_common_delete_attrdefs (g); + } else { + adios_error (err_invalid_group, "adios_delete_attrdefs() called with 0 argument\n"); + } + return adios_errno; +} + +/////////////////////////////////////////////////////////////////////////////// + +// adios_common_select_method is in adios_internals_mxml.c +int adios_select_method (int64_t group, const char * method + ,const char * parameters + ,const char * base_path + ) +{ + adios_errno = err_no_error; + adios_common_select_method_by_group_id (0, method, parameters, group + ,base_path, 0 + ); + return adios_errno; +} + +/////////////////////////////////////////////////////////////////////////////// +void adios_timing_write_xml (int64_t fd_p, const char* filename) +{ + // defined in adios_timing.c + adios_timing_write_xml_common (fd_p, filename); +} + +/////////////////////////////////////////////////////////////////////////////// +int adios_define_schema_version (int64_t group_id, char * schema_version) +{ + struct adios_group_struct * g = (struct adios_group_struct *) group_id; + return adios_common_define_schema_version (g, schema_version); +} + +/////////////////////////////////////////////////////////////////////////////// +int adios_define_var_mesh (int64_t group_id, const char * varname, const char * meshname) +{ + return adios_common_define_var_mesh ( group_id, varname, meshname, ""); +} + +/////////////////////////////////////////////////////////////////////////////// +int adios_define_var_centering (int64_t group_id, const char * varname, const char * centering) +{ + return adios_common_define_var_centering (group_id, varname, centering, ""); +} + +/////////////////////////////////////////////////////////////////////////////// +int adios_define_mesh_file (int64_t group_id, char * name, char * file) +{ + return adios_common_define_mesh_file (group_id, name, file); +} + +/////////////////////////////////////////////////////////////////////////////// +int adios_define_var_timesteps (const char * timesteps, int64_t group_id, const char * name) +{ + struct adios_group_struct * g = (struct adios_group_struct *) group_id; + return adios_common_define_var_timesteps (timesteps, g, name, ""); +} + +/////////////////////////////////////////////////////////////////////////////// +int adios_define_var_timescale (const char * timescale, int64_t group_id, const char * name) +{ + struct adios_group_struct * g = (struct adios_group_struct *) group_id; + return adios_common_define_var_timescale (timescale, g, name, ""); +} + +/////////////////////////////////////////////////////////////////////////////// +int adios_define_var_timeseriesformat (const char * timeseries, int64_t group_id, const char * name) +{ + struct adios_group_struct * g = (struct adios_group_struct *) group_id; + return adios_common_define_var_timeseriesformat (timeseries, g, name, ""); +} + +/////////////////////////////////////////////////////////////////////////////// +int adios_define_var_hyperslab ( const char * hyperslab, int64_t group_id, const char * name) +{ + struct adios_group_struct * g = (struct adios_group_struct *) group_id; + return adios_common_define_var_hyperslab (hyperslab, g, name, ""); +} + +/////////////////////////////////////////////////////////////////////////////// +int adios_define_mesh_timevarying (const char * timevarying, int64_t group_id, const char * name) +{ + return adios_common_define_mesh_timeVarying (timevarying, group_id, name); +} + +/////////////////////////////////////////////////////////////////////////////// +int adios_define_mesh_timesteps (const char * timesteps, int64_t group_id, const char * name) +{ + struct adios_group_struct * g = (struct adios_group_struct *) group_id; + return adios_common_define_mesh_timeSteps (timesteps, g, name); +} + +/////////////////////////////////////////////////////////////////////////////// +int adios_define_mesh_timescale (const char * timescale, int64_t group_id, const char * name) +{ + struct adios_group_struct * g = (struct adios_group_struct *) group_id; + return adios_common_define_mesh_timeScale (timescale, g, name); +} + +/////////////////////////////////////////////////////////////////////////////// +int adios_define_mesh_timeseriesformat (const char * timeseries, int64_t group_id, const char * name) +{ + struct adios_group_struct * g = (struct adios_group_struct *) group_id; + return adios_common_define_mesh_timeSeriesFormat (timeseries, g, name); +} + +/////////////////////////////////////////////////////////////////////////////// +int adios_define_mesh_group (const char * group, int64_t group_id, const char * name) +{ + return adios_common_define_mesh_group (group_id, name, group); +} + +/////////////////////////////////////////////////////////////////////////////// +int adios_define_mesh_uniform (char * dimensions, + char * origin, + char * spacing, + char * maximum, + char * nspace, + int64_t group_id, + const char * name + ) +{ +// struct adios_group_struct * g = (struct adios_group_struct *) group_id; + return adios_common_define_mesh_uniform (dimensions, origin, spacing, maximum, nspace, name, group_id); +} + +/////////////////////////////////////////////////////////////////////////////// +int adios_define_mesh_rectilinear (char * dimensions, + char * coordinates, + char * nspace, + int64_t group_id, + const char * name + ) +{ +// struct adios_group_struct * g = (struct adios_group_struct *) group_id; + return adios_common_define_mesh_rectilinear (dimensions, coordinates, nspace, name, group_id); +} + +/////////////////////////////////////////////////////////////////////////////// +int adios_define_mesh_structured (char * dimensions, + char * points, + char * nspace, + int64_t group_id, + const char * name + ) +{ +// struct adios_group_struct * g = (struct adios_group_struct *) group_id; + return adios_common_define_mesh_structured (dimensions, nspace, points, name, group_id); +} + +/////////////////////////////////////////////////////////////////////////////// +int adios_define_mesh_unstructured (char * points, + char * data, + char * count, + char * cell_type, + char * npoints, + char * nspace, + int64_t group_id, + const char * name + ) +{ +// struct adios_group_struct * g = (struct adios_group_struct *) group_id; + return adios_common_define_mesh_unstructured (points, data, count, cell_type, nspace, npoints, name, group_id); +} + diff --git a/tests/libs/adios/src/core/adios_bp_v1.c b/tests/libs/adios/src/core/adios_bp_v1.c new file mode 100644 index 0000000000..134e6e9b30 --- /dev/null +++ b/tests/libs/adios/src/core/adios_bp_v1.c @@ -0,0 +1,2360 @@ +/* + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "adios_types.h" +#include "core/adios_internals.h" +#include "core/adios_bp_v1.h" +#include "core/adios_endianness.h" +#include "core/adios_logger.h" +#include "adios_error.h" +#include "transforms/adios_transforms_write.h" + +#if defined(__APPLE__) +# define O_LARGEFILE 0 +#endif + +#define BYTE_ALIGN 8 + +#ifdef DMALLOC +#include "dmalloc.h" +#endif + +static void alloc_aligned (struct adios_bp_buffer_struct_v1 * b, uint64_t size) +{ + b->allocated_buff_ptr = malloc (size + BYTE_ALIGN - 1); + if (!b->allocated_buff_ptr) + { + adios_error(err_no_memory, "BP_V1: Cannot allocate %llu\n", + size); + b->buff = 0; + b->length = 0; + + return; + } + uint64_t p = (uint64_t) b->allocated_buff_ptr; + b->buff = (char *) ((p + BYTE_ALIGN - 1) & ~(BYTE_ALIGN - 1)); + b->length = size; +} + +static void realloc_aligned (struct adios_bp_buffer_struct_v1 * b + ,uint64_t size + ) +{ + b->allocated_buff_ptr = realloc (b->allocated_buff_ptr + ,size + BYTE_ALIGN - 1 + ); + if (!b->allocated_buff_ptr) + { + adios_error(err_no_memory, "BP_V1: Cannot allocate %llu\n", + size); + b->buff = 0; + b->length = 0; + + return; + } + uint64_t p = (uint64_t) b->allocated_buff_ptr; + b->buff = (char *) ((p + BYTE_ALIGN - 1) & ~(BYTE_ALIGN - 1)); + b->length = size; +} + +void adios_shared_buffer_free (struct adios_bp_buffer_struct_v1 * b) +{ + if (b->allocated_buff_ptr) + free (b->allocated_buff_ptr); + b->allocated_buff_ptr = 0; + b->buff = 0; + b->offset = 0; + b->length = 0; +} + +void adios_buffer_struct_init (struct adios_bp_buffer_struct_v1 * b) +{ + b->f = -1; + b->allocated_buff_ptr = 0; + b->buff = 0; + b->length = 0; + b->change_endianness = adios_flag_unknown; + b->version = 0; + b->offset = 0; + b->end_of_pgs = 0; + b->pg_index_offset = 0; + b->pg_size = 0; + b->vars_index_offset = 0; + b->vars_size = 0; + b->file_size = 0; + b->read_pg_offset = 0; + b->read_pg_size = 0; +} + +void adios_buffer_struct_clear (struct adios_bp_buffer_struct_v1 * b) +{ + if (b->allocated_buff_ptr) + free (b->allocated_buff_ptr); + adios_buffer_struct_init (b); +} + +// ***************************************************************************** +// buff must be 4 bytes +int adios_parse_version (struct adios_bp_buffer_struct_v1 * b, + uint32_t * version + ) +{ + // if high bit set, big endian + uint32_t test = 1; + + if (b->length < 4) + { + adios_error(err_invalid_buffer_version, "adios_parse_version requires" + "a buffer of at least " + "4 bytes. Only %llu were provided\n", b->length); + return 1; + } + + *version = ntohl (*(uint32_t *) (b->buff + b->offset)); + char *v = (char *) version; + if ( (*v && !*(char *) &test) // both writer and this machine are big endian + || (!*(v+3) && *(char *) &test) // both are little endian + ) + { + b->change_endianness = adios_flag_no;//no need to change endiannness + } + else + { + b->change_endianness = adios_flag_yes; + } + + *version = *version & 0x7fffffff; + + return 0; +} + +// buff must be 16 bytes +int adios_parse_index_offsets_v1 (struct adios_bp_buffer_struct_v1 * b) +{ + if (b->length - b->offset < 24) + { + adios_error(err_invalid_buffer_index, "adios_parse_index_offsets_v1" + "requires a buffer of at least 24 bytes." + "Only %llu were provided\n", b->length - b->offset); + return 1; + } + + uint64_t attrs_end = b->file_size - 28; + + b->pg_index_offset = *(uint64_t *) (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_64(b->pg_index_offset); + } + + b->offset += 8; + + b->vars_index_offset = *(uint64_t *) (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_64(b->vars_index_offset); + } + + b->offset += 8; + + b->attrs_index_offset = *(uint64_t *) (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_64(b->attrs_index_offset); + } + + b->offset += 8; + + b->end_of_pgs = b->pg_index_offset; + b->pg_size = b->vars_index_offset - b->pg_index_offset; + b->vars_size = b->attrs_index_offset - b->vars_index_offset; + b->attrs_size = attrs_end - b->attrs_index_offset; + + return 0; +} + +int adios_parse_process_group_index_v1 (struct adios_bp_buffer_struct_v1 * b, + struct adios_index_process_group_struct_v1 ** pg_root + ) +{ + struct adios_index_process_group_struct_v1 ** root; + if (b->length - b->offset < 16) + { + adios_error(err_invalid_buffer_group, "adios_parse_process_group_index_v1" + "requires a buffer of at least 16 bytes." + "Only %llu were provided\n", b->length - b->offset); + return 1; + } + + root = pg_root; + + uint64_t process_groups_count; + uint64_t process_groups_length; + + process_groups_count = *(uint64_t *) (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_64(process_groups_count); + } + b->offset += 8; + + process_groups_length = *(uint64_t *) (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_64(process_groups_length); + } + b->offset += 8; + + // validate remaining length + + uint64_t i; + for (i = 0; i < process_groups_count; i++) + { + uint16_t length_of_group; + // validate remaining length + length_of_group = *(uint16_t *) (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_16(length_of_group); + } + b->offset += 2; + + if (!*root) + { + *root = (struct adios_index_process_group_struct_v1 *) + malloc (sizeof(struct adios_index_process_group_struct_v1)); + (*root)->next = 0; + } + uint16_t length_of_name; + + length_of_name = *(uint16_t *) (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_16(length_of_name); + } + b->offset += 2; + (*root)->group_name = (char *) malloc (length_of_name + 1); + (*root)->group_name [length_of_name] = '\0'; + memcpy ((*root)->group_name, b->buff + b->offset, length_of_name); + b->offset += length_of_name; + + (*root)->adios_host_language_fortran = + (*(b->buff + b->offset) == 'y' ? adios_flag_yes + : adios_flag_no + ); + b->offset += 1; + + (*root)->process_id = *(uint32_t *) (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_32((*root)->process_id); + } + b->offset += 4; + + length_of_name = *(uint16_t *) (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_16(length_of_name); + } + b->offset += 2; + (*root)->time_index_name = (char *) malloc (length_of_name + 1); + (*root)->time_index_name [length_of_name] = '\0'; + memcpy ((*root)->time_index_name, b->buff + b->offset, length_of_name); + b->offset += length_of_name; + + (*root)->time_index = *(uint32_t *) (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_32((*root)->time_index); + } + b->offset += 4; + + (*root)->offset_in_file = *(uint64_t *) (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_64((*root)->offset_in_file); + } + b->offset += 8; + + root = &(*root)->next; + } + + return 0; +} + +int adios_parse_vars_index_v1 (struct adios_bp_buffer_struct_v1 * b + ,struct adios_index_var_struct_v1 ** vars_root + ,qhashtbl_t *hashtbl_vars + ,struct adios_index_var_struct_v1 ** vars_tail + ) +{ + struct adios_index_var_struct_v1 ** root; + + if (b->length - b->offset < 10) + { + adios_error(err_invalid_buffer_vars, "adios_parse_vars_index_v1" + "requires a buffer of at least 10 bytes." + "Only %llu were provided\n", b->length - b->offset); + return 1; + } + + root = vars_root; + log_debug ("%s: hashtbl=%p size=%d\n", __func__, + hashtbl_vars, (hashtbl_vars ? hashtbl_vars->size(hashtbl_vars) : 0)); + + /* BP Format v1: vars_count and attrs_count was 16bit, now it's 32 bit */ + uint32_t vars_count; + uint64_t vars_length; + + vars_count = *(uint32_t *) (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_32(vars_count); + } + b->offset += 4; + + vars_length = *(uint64_t *) (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_64(vars_length); + } + b->offset += 8; + + // validate remaining length + + int i; + for (i = 0; i < vars_count; i++) + { + if (!*root) + { + *root = (struct adios_index_var_struct_v1 *) + malloc (sizeof (struct adios_index_var_struct_v1)); + (*root)->next = 0; + } + uint8_t flag; + uint32_t var_entry_length; + uint16_t len; + uint64_t characteristics_sets_count; + + var_entry_length = *(uint32_t *) (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_32(var_entry_length); + } + b->offset += 4; + + /* BP Format v1: varid/attrid was 16bit, now it's 32 bit */ + (*root)->id = *(uint32_t *) (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_32((*root)->id); + } + b->offset += 4; + + len = *(uint16_t *) (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_16(len); + } + b->offset += 2; + (*root)->group_name = (char *) malloc (len + 1); + (*root)->group_name [len] = '\0'; + strncpy ((*root)->group_name, b->buff + b->offset, len); + b->offset += len; + + len = *(uint16_t *) (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_16(len); + } + b->offset += 2; + (*root)->var_name = (char *) malloc (len + 1); + (*root)->var_name [len] = '\0'; + strncpy ((*root)->var_name, b->buff + b->offset, len); + b->offset += len; + + len = *(uint16_t *) (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_16(len); + } + b->offset += 2; + (*root)->var_path = (char *) malloc (len + 1); + (*root)->var_path [len] = '\0'; + strncpy ((*root)->var_path, b->buff + b->offset, len); + b->offset += len; + + flag = *(b->buff + b->offset); + (*root)->type = (enum ADIOS_DATATYPES) flag; + b->offset += 1; + + characteristics_sets_count = *(uint64_t *) (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_64(characteristics_sets_count); + } + (*root)->characteristics_count = characteristics_sets_count; + (*root)->characteristics_allocated = characteristics_sets_count; + b->offset += 8; + + // validate remaining length: offsets_count * (8 + 2 * (size of type)) + uint64_t j; + (*root)->characteristics = malloc (characteristics_sets_count + * sizeof (struct adios_index_characteristic_struct_v1) + ); + memset ((*root)->characteristics, 0, characteristics_sets_count + * sizeof (struct adios_index_characteristic_struct_v1)); + for (j = 0; j < characteristics_sets_count; j++) + { + uint8_t characteristic_set_count; + uint32_t characteristic_set_length; + uint8_t item = 0; + + // NCSU - Clear stats structure (Drew: probably redundant with memset above, but leave it to be safe) + (*root)->characteristics [j].stats = 0; + + characteristic_set_count = (uint8_t) *(b->buff + b->offset); + b->offset += 1; + + characteristic_set_length = *(uint32_t *) (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_32(characteristic_set_length); + } + b->offset += 4; + + while (item < characteristic_set_count) + { + uint8_t flag; + enum ADIOS_CHARACTERISTICS c; + flag = *(b->buff + b->offset); + c = (enum ADIOS_CHARACTERISTICS) flag; + b->offset += 1; + + switch (c) + { + case adios_characteristic_min: + case adios_characteristic_max: + case adios_characteristic_value: + { + uint16_t data_size; + void * data = 0; + + if ((*root)->type == adios_string) + { + data_size = *(uint16_t *) (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_16(data_size); + } + b->offset += 2; + } + else + { + data_size = adios_get_type_size ((*root)->type, ""); + } + + switch ((*root)->type) + { + case adios_byte: + case adios_short: + case adios_integer: + case adios_long: + case adios_unsigned_byte: + case adios_unsigned_short: + case adios_unsigned_integer: + case adios_unsigned_long: + case adios_real: + case adios_double: + case adios_long_double: + case adios_complex: + case adios_double_complex: + data = malloc (data_size); + + if (!data) + { + adios_error(err_no_memory, "cannot allocate" + "%d bytes to copy scalar %s\n", + data_size, (*root)->var_name); + + return 1; + } + + memcpy (data, (b->buff + b->offset), data_size); + if(b->change_endianness == adios_flag_yes) { + if((*root)->type == adios_complex) { + // TODO + } + else if((*root)->type == adios_double_complex) { + // TODO + } + else { + switch(data_size) + { + case 2: + swap_16_ptr(data); + break; + case 4: + swap_32_ptr(data); + break; + case 8: + swap_64_ptr(data); + break; + case 16: + swap_128_ptr(data); + break; + } + } + } + b->offset += data_size; + break; + + case adios_string: + data = malloc (data_size + 1); + + if (!data) + { + adios_error(err_no_memory, "cannot allocate" + "%d bytes to copy scalar %s\n", + data_size, (*root)->var_name); + return 1; + } + + ((char *) data) [data_size] = '\0'; + memcpy (data, (b->buff + b->offset), data_size); + b->offset += data_size; + break; + + default: + data = 0; + break; + } + + switch (c) + { + case adios_characteristic_value: + (*root)->characteristics [j].value = data; + break; + + // NCSU - reading older bp files + // adios_characteristic_min, max are not used anymore. If this is encountered it is an older bp file format + // Code below reads min and min, and sets the bitmap for those 2 alone + case adios_characteristic_min: + if (!(*root)->characteristics [j].stats) + { + (*root)->characteristics [j].stats = malloc (sizeof(struct adios_index_characteristics_stat_struct *)); + (*root)->characteristics [j].stats[0] = malloc (2 * sizeof(struct adios_index_characteristics_stat_struct)); + (*root)->characteristics [j].bitmap = 0; + } + (*root)->characteristics [j].stats[0][adios_statistic_min].data = data; + (*root)->characteristics [j].bitmap |= (1 << adios_statistic_min); + break; + + case adios_characteristic_max: + if (!(*root)->characteristics [j].stats) + { + (*root)->characteristics [j].stats = malloc (sizeof(struct adios_index_characteristics_stat_struct *)); + (*root)->characteristics [j].stats[0] = malloc (2 * sizeof(struct adios_index_characteristics_stat_struct)); + (*root)->characteristics [j].bitmap = 0; + } + (*root)->characteristics [j].stats[0][adios_statistic_max].data = data; + (*root)->characteristics [j].bitmap |= (1 << adios_statistic_max); + break; + default: + break; + } + break; + } + + // NCSU - Statistics - Parsing stat related info from bp file based on the bitmap + case adios_characteristic_stat: + { + uint8_t k, c, idx; + enum ADIOS_DATATYPES original_var_type = adios_transform_get_var_original_type_index (*root); + uint64_t count = adios_get_stat_set_count(original_var_type); + uint16_t characteristic_size; + + (*root)->characteristics [j].stats = malloc (count * sizeof(struct adios_index_characteristics_stat_struct *)); + + for (c = 0; c < count; c ++) + { + (*root)->characteristics [j].stats[c] = calloc(ADIOS_STAT_LENGTH, sizeof(struct adios_index_characteristics_stat_struct)); + + k = idx = 0; + while ((*root)->characteristics[j].bitmap >> k) + { + (*root)->characteristics [j].stats[c][k].data = 0; + + if (((*root)->characteristics[j].bitmap >> k) & 1) + { + if (k == adios_statistic_hist) + { + struct adios_index_characteristics_hist_struct * hist = malloc(sizeof(struct adios_index_characteristics_hist_struct)); + uint32_t bi, num_breaks; + + (*root)->characteristics [j].stats[c][idx].data = hist; + + // Getting the number of breaks of histogram + hist->num_breaks = * (uint32_t *) (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_32(hist->num_breaks); + } + b->offset += 4; + + num_breaks = hist->num_breaks; + + // Getting the min of histogram + hist->max = *(double *) (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_64(hist->min); + } + b->offset += 8; + + // Getting the max of histogram + hist->max = *(double *) (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_64(hist->max); + } + b->offset += 8; + + // Getting the frequencies of the histogram + hist->frequencies = malloc ((num_breaks + 1) * adios_get_type_size(adios_unsigned_integer, "")); + memcpy(hist->frequencies, (b->buff + b->offset), (num_breaks + 1) * adios_get_type_size(adios_unsigned_integer, "")); + + if(b->change_endianness == adios_flag_yes) { + for(bi = 0; bi <= num_breaks; bi ++) { + swap_32(hist->frequencies[bi]); + } + } + b->offset += 4 * (num_breaks + 1); + + // Getting the breaks of the histogram + hist->breaks = malloc (num_breaks * adios_get_type_size(adios_double, "")); + memcpy(hist->breaks, (b->buff + b->offset), num_breaks * adios_get_type_size(adios_double, "")); + if(b->change_endianness == adios_flag_yes) { + for(bi = 0; bi < num_breaks; bi ++) + swap_64(hist->breaks[bi]); + } + b->offset += 8 * num_breaks; + } + else + { + // NCSU - Generic for non-histogram data + characteristic_size = adios_get_stat_size((*root)->characteristics [j].stats[c][idx].data, original_var_type, k); + (*root)->characteristics [j].stats[c][idx].data = malloc (characteristic_size); + + void * data = (*root)->characteristics [j].stats[c][idx].data; + memcpy (data, (b->buff + b->offset), characteristic_size); + b->offset += characteristic_size; + + if(b->change_endianness == adios_flag_yes) + swap_ptr(data, characteristic_size * 8); + } + idx ++; + } + k ++; + } + } + break; + } + + // NCSU - Reading bitmap value + case adios_characteristic_bitmap: + { + (*root)->characteristics [j].bitmap = + *(uint32_t *) (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_32((*root)->characteristics [j].bitmap); + } + // printf ("[%s:%d] Bitmap: %lu\n", __FUNCTION__, __LINE__, (*root)->characteristics [j].bitmap); + b->offset += 4; + break; + } + + case adios_characteristic_offset: + { + (*root)->characteristics [j].offset = + *(uint64_t *) (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_64((*root)->characteristics [j].offset); + } + b->offset += 8; + + break; + } + + case adios_characteristic_payload_offset: + { + (*root)->characteristics [j].payload_offset = + *(uint64_t *) (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_64((*root)->characteristics [j].payload_offset); + } + b->offset += 8; + + break; + } + + case adios_characteristic_file_index: + { + (*root)->characteristics [j].file_index = + *(uint32_t *) (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_32((*root)->characteristics [j].file_index); + } + b->offset += 4; + + break; + } + + case adios_characteristic_time_index: + { + (*root)->characteristics [j].time_index = + *(uint32_t *) (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_32((*root)->characteristics [j].time_index); + } + b->offset += 4; + + break; + } + + case adios_characteristic_dimensions: + { + uint16_t dims_length; + + (*root)->characteristics [j].dims.count = + *(uint8_t *) (b->buff + b->offset); + b->offset += 1; + + dims_length = *(uint16_t *) (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_16(dims_length); + } + b->offset += 2; + + (*root)->characteristics [j].dims.dims = (uint64_t *) + malloc (dims_length); + memcpy ((*root)->characteristics [j].dims.dims + ,(b->buff + b->offset) + ,dims_length + ); + if(b->change_endianness == adios_flag_yes) { + uint16_t di = 0; + uint16_t dims_num = dims_length / 8; + for (di = 0; di < dims_num; di ++) { + swap_64(((*root)->characteristics [j].dims.dims)[di]); + } + } + b->offset += dims_length; + break; + } + + // NCSU ALACRITY-ADIOS - Reading variable transformation type + case adios_characteristic_transform_type: + { + adios_transform_deserialize_transform_characteristic(&(*root)->characteristics[j].transform, b); + break; + } + + case adios_characteristic_var_id: + { + // this cannot happen, only attributes have variable references + break; + } + } + item++; + } + } + + // Add variable to the hash table too + log_debug (" add variable to hash, path=%s, name=%s\n", + (*root)->var_path, (*root)->var_name); + if (hashtbl_vars) { + hashtbl_vars->put2 (hashtbl_vars, + (*root)->var_path, (*root)->var_name, *root); + } + + // record this as the tail + if (vars_tail) + *vars_tail = (*root); + + root = &(*root)->next; + } + + log_debug ("end of %s: hashtbl=%p size=%d\n", __func__, + hashtbl_vars, (hashtbl_vars ? hashtbl_vars->size(hashtbl_vars) : 0)); + + return 0; +} + +int adios_parse_attributes_index_v1 (struct adios_bp_buffer_struct_v1 * b + ,struct adios_index_attribute_struct_v1 ** attrs_root + ) +{ + struct adios_index_attribute_struct_v1 ** root; + + if (b->length - b->offset < 10) + { + adios_error(err_invalid_buffer_attrs, "adios_parse_attributes_index_v1 " + "requires a buffer of at least 10 bytes." + "Only %llu were provided\n", b->length - b->offset); + + return 1; + } + + root = attrs_root; + + /* BP Format v1: vars_count and attrs_count was 16bit, now it's 32 bit */ + uint32_t attrs_count; + uint64_t attrs_length; + + attrs_count = *(uint32_t *) (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_32(attrs_count); + } + b->offset += 4; + + attrs_length = *(uint64_t *) (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_64(attrs_length); + } + b->offset += 8; + + // validate remaining length + + int i; + for (i = 0; i < attrs_count; i++) + { + if (!*root) + { + *root = (struct adios_index_attribute_struct_v1 *) + malloc (sizeof (struct adios_index_attribute_struct_v1)); + (*root)->next = 0; + } + uint8_t flag; + uint32_t attr_entry_length; + uint16_t len; + uint64_t characteristics_sets_count; + + attr_entry_length = *(uint32_t *) (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_32(attr_entry_length); + } + b->offset += 4; + + /* BP Format v1: varid/attrid was 16bit, now it's 32 bit */ + (*root)->id = *(uint32_t *) (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_32((*root)->id); + } + b->offset += 4; + + len = *(uint16_t *) (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_16(len); + } + b->offset += 2; + (*root)->group_name = (char *) malloc (len + 1); + (*root)->group_name [len] = '\0'; + strncpy ((*root)->group_name, b->buff + b->offset, len); + b->offset += len; + + len = *(uint16_t *) (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_16(len); + } + b->offset += 2; + (*root)->attr_name = (char *) malloc (len + 1); + (*root)->attr_name [len] = '\0'; + strncpy ((*root)->attr_name, b->buff + b->offset, len); + b->offset += len; + + len = *(uint16_t *) (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_16(len); + } + b->offset += 2; + (*root)->attr_path = (char *) malloc (len + 1); + (*root)->attr_path [len] = '\0'; + strncpy ((*root)->attr_path, b->buff + b->offset, len); + b->offset += len; + + flag = *(b->buff + b->offset); + (*root)->type = (enum ADIOS_DATATYPES) flag; + b->offset += 1; + + characteristics_sets_count = *(uint64_t *) (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_64(characteristics_sets_count); + } + (*root)->characteristics_count = characteristics_sets_count; + (*root)->characteristics_allocated = characteristics_sets_count; + b->offset += 8; + + // validate remaining length: offsets_count * (8 + 2 * (size of type)) + uint64_t j; + (*root)->characteristics = malloc (characteristics_sets_count + * sizeof (struct adios_index_characteristic_struct_v1) + ); + memset ((*root)->characteristics, 0 + , characteristics_sets_count + * sizeof (struct adios_index_characteristic_struct_v1) + ); + for (j = 0; j < characteristics_sets_count; j++) + { + uint8_t characteristic_set_count; + uint32_t characteristic_set_length; + uint8_t item = 0; + + characteristic_set_count = (uint8_t) *(b->buff + b->offset); + b->offset += 1; + + characteristic_set_length = *(uint32_t *) (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_32(characteristic_set_length); + } + b->offset += 4; + + while (item < characteristic_set_count) + { + uint8_t flag; + enum ADIOS_CHARACTERISTICS c; + flag = *(b->buff + b->offset); + c = (enum ADIOS_CHARACTERISTICS) flag; + b->offset += 1; + + switch (c) + { + case adios_characteristic_value: + { + uint16_t data_size; + void * data = 0; + + if ((*root)->type == adios_string) + { + data_size = *(uint16_t *) (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_16(data_size); + } + b->offset += 2; + } + else + { + data_size = adios_get_type_size ((*root)->type, ""); + } + + data = malloc (data_size + 1); + ((char *) data) [data_size] = '\0'; + + if (!data) + { + adios_error(err_no_memory, "cannot allocate" + "%d bytes to copy scalar %s\n", + data_size, (*root)->attr_name); + + return 1; + } + + switch ((*root)->type) + { + case adios_byte: + case adios_short: + case adios_integer: + case adios_long: + case adios_unsigned_byte: + case adios_unsigned_short: + case adios_unsigned_integer: + case adios_unsigned_long: + case adios_real: + case adios_double: + case adios_long_double: + case adios_complex: + case adios_double_complex: + memcpy (data, (b->buff + b->offset), data_size); + + if(b->change_endianness == adios_flag_yes) { + if((*root)->type == adios_complex) { + // TODO + } + else if((*root)->type == adios_double_complex) { + // TODO + } + else { + switch(data_size) + { + case 2: + swap_16_ptr(data); + break; + case 4: + swap_32_ptr(data); + break; + case 8: + swap_64_ptr(data); + break; + case 16: + swap_128_ptr(data); + break; + } + } + } + + b->offset += data_size; + break; + case adios_string: + memcpy (data, (b->buff + b->offset), data_size); + b->offset += data_size; + break; + + default: + free (data); + data = 0; + break; + } + + (*root)->characteristics [j].value = data; + + break; + } + + case adios_characteristic_offset: + { + (*root)->characteristics [j].offset = + *(uint64_t *) (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_64((*root)->characteristics [j].offset); + } + b->offset += 8; + + break; + } + + case adios_characteristic_bitmap: + { + (*root)->characteristics [j].offset = + *(uint32_t *) (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_32((*root)->characteristics [j].offset); + } + b->offset += 4; + + break; + } + + case adios_characteristic_payload_offset: + { + (*root)->characteristics [j].payload_offset = + *(uint64_t *) (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_64((*root)->characteristics [j].payload_offset); + } + b->offset += 8; + + break; + } + + case adios_characteristic_file_index: + { + (*root)->characteristics [j].file_index = + *(uint32_t *) (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_32((*root)->characteristics [j].file_index); + } + b->offset += 4; + + break; + } + + case adios_characteristic_time_index: + { + (*root)->characteristics [j].time_index = + *(uint32_t *) (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_32((*root)->characteristics [j].time_index); + } + b->offset += 4; + + break; + } + + case adios_characteristic_var_id: + { + /* BP Format v1: varid/attrid was 16bit, now it's 32 bit */ + (*root)->characteristics [j].var_id = + *(uint32_t *) (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_32((*root)->characteristics [j].var_id); + } + b->offset += 4; + + break; + } + + // NCSU ALACRITY-ADIOS - Deserialize transform characteristic + case adios_characteristic_transform_type: + { + adios_transform_deserialize_transform_characteristic(&(*root)->characteristics[j].transform, b); + /* + (*root)->characteristics [j].transform_type = + *(uint8_t *) (b->buff + b->offset); + b->offset += 1; + */ + break; + } + + default: + break; + } + item++; + } + } + + root = &(*root)->next; + } + + return 0; +} + +int adios_parse_process_group_header_v1 (struct adios_bp_buffer_struct_v1 * b + ,struct adios_process_group_header_struct_v1 * pg_header + ) +{ + if (b->length - b->offset < 24) + { + adios_error(err_invalid_buffer_group, "adios_parse_process_group_header_v1" + "requires a buffer of at least 24 bytes. " + "Only %llu were provided\n",b->length - b->offset); + return 1; + } + + uint64_t size; + size = *(uint64_t *) (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_64(size); + } + b->offset += 8; + + pg_header->host_language_fortran = + (*(b->buff + b->offset) == 'y' ? adios_flag_yes + : adios_flag_no + ); + b->offset += 1; + + uint16_t len; + len = *(uint16_t *) (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_16(len); + } + b->offset += 2; + pg_header->name = (char *) malloc (len + 1); + pg_header->name [len] = '\0'; + memcpy (pg_header->name, b->buff + b->offset, len); + b->offset += len; + + pg_header->coord_var_id = *(uint32_t *) (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_32(pg_header->coord_var_id); + } + b->offset += 4; + len = *(uint16_t *) (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_16(len); + } + b->offset += 2; + pg_header->time_index_name = (char *) malloc (len + 1); + pg_header->time_index_name [len] = '\0'; + memcpy (pg_header->time_index_name, b->buff + b->offset, len); + b->offset += len; + + pg_header->time_index = *(uint32_t *) (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_32(pg_header->time_index); + } + b->offset += 4; + + pg_header->methods_count = *(b->buff + b->offset); + b->offset += 1; + + // length of methods section + len = *(uint16_t *) (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_16(len); + } + b->offset += 2; + + int i; + struct adios_method_info_struct_v1 ** root; + + pg_header->methods = 0; + root = &pg_header->methods; + for (i = 0; i < pg_header->methods_count; i++) + { + uint8_t flag; + if (!*root) + { + *root = (struct adios_method_info_struct_v1 *) + malloc (sizeof (struct adios_method_info_struct_v1)); + (*root)->next = 0; + } + + flag = *(b->buff + b->offset); + (*root)->id = (enum ADIOS_IO_METHOD) flag; + b->offset += 1; + + len = *(uint16_t *) (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_16(len); + } + b->offset += 2; + (*root)->parameters = (char *) malloc (len + 1); + (*root)->parameters [len] = '\0'; + strncpy ((*root)->parameters, b->buff + b->offset, len); + b->offset += len; + + root = &(*root)->next; + } + + return 0; +} + +int adios_parse_vars_header_v1 (struct adios_bp_buffer_struct_v1 * b + ,struct adios_vars_header_struct_v1 * vars_header + ) +{ + + if (b->length - b->offset < 12) + { + adios_error(err_invalid_buffer_vars, "adios_parse_vars_header_v1" + "requires a buffer of at least 12 bytes. " + "Only %llu were provided\n", b->length - b->offset); + + vars_header->count = 0; + vars_header->length = 0; + + return 1; + } + + vars_header->count = *(uint32_t *) (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_32(vars_header->count); + } + b->offset += 4; + vars_header->length = *(uint64_t *) (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_64(vars_header->length); + } + b->offset += 8; + + return 0; +} + +int adios_parse_var_data_header_v1 (struct adios_bp_buffer_struct_v1 * b + ,struct adios_var_header_struct_v1 * var_header + ) +{ + if (b->length - b->offset < 23) + { + adios_error(err_invalid_buffer_vars, "adios_parse_var_data_header_v1" + "requires a buffer of at least 23 bytes." + "Only %llu were provided\n", b->length - b->offset); + + return 1; + } + + uint64_t initial_offset = b->offset; // save to calc payload size + uint64_t length_of_var; + uint16_t len; + uint8_t flag; + + length_of_var = *(uint64_t *) (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_64(length_of_var); + } + b->offset += 8; + + //validate remaining length + + var_header->id = *(uint32_t *) (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_32(var_header->id); + } + b->offset += 4; + + len = *(uint16_t *) (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_16(len); + } + b->offset += 2; + var_header->name = (char *) malloc (len + 1); + var_header->name [len] = '\0'; + memcpy (var_header->name, b->buff + b->offset, len); + b->offset += len; + + len = *(uint16_t *) (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_16(len); + } + b->offset += 2; + var_header->path = (char *) malloc (len + 1); + var_header->path [len] = '\0'; + memcpy (var_header->path, b->buff + b->offset, len); + b->offset += len; + + flag = *(b->buff + b->offset); + var_header->type = (enum ADIOS_DATATYPES) flag; + b->offset += 1; + + var_header->is_dim = (*(b->buff + b->offset) == 'y' ? adios_flag_yes + : adios_flag_no + ); + b->offset += 1; + + int i; + uint8_t dims_count; + uint16_t dims_length; + uint8_t characteristics_count; + uint32_t characteristics_length; + + // validate remaining length + + dims_count = *(b->buff + b->offset); + b->offset += 1; + dims_length = *(uint16_t *) (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_16(dims_length); + } + b->offset += 2; + + var_header->dims = 0; + struct adios_dimension_struct_v1 ** root = &var_header->dims; + + for (i = 0; i < dims_count; i++) + { + uint8_t flag; + + if (!*root) + { + *root = (struct adios_dimension_struct_v1 *) + malloc (sizeof (struct adios_dimension_struct_v1)); + (*root)->next = 0; + } + + (*root)->dimension.rank = 0; + (*root)->dimension.var_id = 0; + (*root)->dimension.time_index = adios_flag_no; + + (*root)->global_dimension.rank = 0; + (*root)->global_dimension.var_id = 0; + (*root)->global_dimension.time_index = adios_flag_no; + + (*root)->local_offset.rank = 0; + (*root)->local_offset.var_id = 0; + (*root)->local_offset.time_index = adios_flag_no; + + flag = *(b->buff + b->offset); + b->offset += 1; + if (flag == 'y') + { + (*root)->dimension.rank = 0; + (*root)->dimension.var_id = *(uint32_t *) (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_32((*root)->dimension.var_id); + } + if ((*root)->dimension.var_id == 0) + (*root)->dimension.time_index = adios_flag_yes; + b->offset += 4; + } + else + { + (*root)->dimension.rank = *(uint64_t *) (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_64((*root)->dimension.rank); + } + (*root)->dimension.var_id = 0; + b->offset += 8; + } + + flag = *(b->buff + b->offset); + b->offset += 1; + if (flag == 'y') + { + (*root)->global_dimension.rank = 0; + (*root)->global_dimension.var_id = *(uint32_t *) + (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_32((*root)->global_dimension.var_id); + } + if ((*root)->global_dimension.var_id == 0) + (*root)->global_dimension.time_index = adios_flag_yes; + b->offset += 4; + } + else + { + (*root)->global_dimension.rank = *(uint64_t *) + (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_64((*root)->global_dimension.rank); + } + (*root)->global_dimension.var_id = 0; + b->offset += 8; + } + + flag = *(b->buff + b->offset); + b->offset += 1; + if (flag == 'y') + { + (*root)->local_offset.rank = 0; + (*root)->local_offset.var_id = *(uint32_t *) (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_32((*root)->local_offset.var_id); + } + if ((*root)->local_offset.var_id == 0) + (*root)->local_offset.time_index = adios_flag_yes; + b->offset += 4; + } + else + { + (*root)->local_offset.rank = *(uint64_t *) (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_64((*root)->local_offset.rank); + } + (*root)->local_offset.var_id = 0; + b->offset += 8; + } + + root = &(*root)->next; + } + + characteristics_count = *(b->buff + b->offset); + b->offset += 1; + characteristics_length = *(uint32_t *) (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_32(characteristics_length); + } + b->offset += 4; + + uint64_t size = adios_get_type_size (var_header->type, ""); + + var_header->characteristics.offset = 0; + var_header->characteristics.payload_offset = 0; + var_header->characteristics.stats = 0; + var_header->characteristics.value = 0; + var_header->characteristics.dims.count = 0; + var_header->characteristics.dims.dims = 0; + // NCSU - Initialize statistics fields + var_header->characteristics.bitmap = 0; + var_header->characteristics.stats = 0; + // NCSU ALACRITY-ADIOS - Initialize transform field + adios_transform_init_transform_characteristic(&var_header->characteristics.transform); + //var_header->characteristics.transform_type = adios_transform_none; + //var_header->characteristics.pre_transform_type = adios_unknown; + //var_header->characteristics.pre_transform_dimensions = 0; + for (i = 0; i < characteristics_count; i++) + { + uint8_t flag; + enum ADIOS_CHARACTERISTICS c; + + flag = *(b->buff + b->offset); + b->offset += 1; + c = (enum ADIOS_CHARACTERISTICS) flag; + + switch (c) + { + case adios_characteristic_offset: + var_header->characteristics.offset = *(uint64_t *) + (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_64(var_header->characteristics.offset); + } + b->offset += 8; + break; + + case adios_characteristic_payload_offset: + var_header->characteristics.payload_offset = *(uint64_t *) + (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_64(var_header->characteristics.payload_offset); + } + b->offset += 8; + break; + + // NCSU ALACRITY-ADIOS - Read in transform type field + case adios_characteristic_transform_type: + adios_transform_deserialize_transform_characteristic(&var_header->characteristics.transform, b); + break; + + //NCSU - Read in bitmap + case adios_characteristic_bitmap: + var_header->characteristics.bitmap = *(uint32_t *) + (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_32(var_header->characteristics.bitmap); + } + b->offset += 4; + break; + + //NCSU - Read in the statistics + case adios_characteristic_stat: + { + uint8_t j = 0, idx = 0; + uint8_t c = 0; + enum ADIOS_DATATYPES original_var_type = adios_transform_get_var_original_type_var_header (var_header); + uint64_t characteristic_size; + uint8_t count = adios_get_stat_set_count (original_var_type); + + var_header->characteristics.stats = malloc(count * sizeof(struct adios_index_characteristics_stat_struct *)); + + for (c = 0; c < count; c ++) + { + idx = j = 0; + var_header->characteristics.stats[c] = calloc(ADIOS_STAT_LENGTH, sizeof(struct adios_index_characteristics_stat_struct)); + + while (var_header->characteristics.bitmap >> j) + { + if ((var_header->characteristics.bitmap >> j) & 1) + { + if (j == adios_statistic_hist) + { + struct adios_index_characteristics_hist_struct * hist = malloc (sizeof(struct adios_index_characteristics_hist_struct)); + uint32_t bi, num_breaks; + + var_header->characteristics.stats[c][idx].data = hist; + + // Getting the number of bins + hist->num_breaks = * (uint32_t *) (b->buff + b->offset); + + if(b->change_endianness == adios_flag_yes) { + swap_32(hist->num_breaks); + } + b->offset += 4; + + num_breaks = hist->num_breaks; + + // Getting the min hist value + hist->min = * (double *) (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_64(hist->min); + } + b->offset += 8; + + // Getting the max hist value + hist->max = * (double *) (b->buff + b->offset); + + if(b->change_endianness == adios_flag_yes) { + swap_64(hist->max); + } + b->offset += 8; + + // Getting the frequencies + hist->frequencies = malloc((num_breaks + 1) * adios_get_type_size(adios_unsigned_integer, "")); + memcpy (hist->frequencies + ,(b->buff + b->offset), (num_breaks + 1) * adios_get_type_size(adios_unsigned_integer, "") + ); + + if(b->change_endianness == adios_flag_yes) { + for(bi = 0; bi <= num_breaks; bi++) + swap_32(hist->frequencies[bi]); + } + b->offset += 4 * (num_breaks + 1); + + // Getting the break points + hist->breaks = malloc(num_breaks * adios_get_type_size(adios_double, "")); + memcpy (hist->breaks, (b->buff + b->offset), num_breaks * 8); + + if(b->change_endianness == adios_flag_yes) { + for(bi = 0; bi < num_breaks; bi++) + swap_64(hist->breaks[bi]); + } + b->offset += 8 * num_breaks; + } + else + { + characteristic_size = adios_get_stat_size(var_header->characteristics.stats[c][idx].data, original_var_type, j); + + var_header->characteristics.stats[c][idx].data = malloc(characteristic_size); + memcpy (var_header->characteristics.stats[c][idx].data, (b->buff + b->offset) + ,characteristic_size + ); + + if(b->change_endianness == adios_flag_yes) { + swap_adios_type(var_header->characteristics.stats[c][idx].data, original_var_type); + } + + b->offset += characteristic_size; + } + + idx ++; + } + j ++; + } + } + break; + } + + case adios_characteristic_dimensions: + { + //uint8_t dim_count; + uint16_t dim_length; + + //dim_count = *(b->buff + b->offset); + b->offset += 1; + dim_length = *(uint16_t *) (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_16(dim_length); + } + b->offset += 2; + + var_header->characteristics.dims.dims = malloc (dim_length); + memcpy (var_header->characteristics.dims.dims + ,(b->buff + b->offset), dim_length + ); + if(b->change_endianness == adios_flag_yes) { + uint16_t di = 0; + uint16_t dim_num = dim_length / 8; + for (di = 0; di < dim_num; di ++) { + swap_64((var_header->characteristics.dims.dims)[di]); + } + } + b->offset += dim_length; + break; + } + + // NCSU - Adding backward compatibility + // Reading min and max here implies older bp file + case adios_characteristic_min: + if (!var_header->characteristics.stats) + { + var_header->characteristics.stats = malloc(sizeof(struct adios_index_characteristics_stat_struct *)); + var_header->characteristics.stats[0] = malloc(2 * sizeof(struct adios_index_characteristics_stat_struct)); + var_header->characteristics.bitmap = 0; + } + var_header->characteristics.stats[0][adios_statistic_min].data = malloc (size); + var_header->characteristics.bitmap |= (1 << adios_statistic_min); + memcpy (var_header->characteristics.stats[0][adios_statistic_min].data, (b->buff + b->offset) + ,size + ); + + if(b->change_endianness == adios_flag_yes) { + swap_adios_type(var_header->characteristics.stats[0][adios_statistic_min].data, var_header->type); + } + b->offset += size; + break; + + case adios_characteristic_max: + if (!var_header->characteristics.stats) + { + var_header->characteristics.stats = malloc(sizeof(struct adios_index_characteristics_stat_struct *)); + var_header->characteristics.stats[0] = malloc(2 * sizeof(struct adios_index_characteristics_stat_struct)); + var_header->characteristics.bitmap = 0; + } + var_header->characteristics.stats[0][adios_statistic_max].data = malloc (size); + var_header->characteristics.bitmap |= (1 << adios_statistic_max); + memcpy (var_header->characteristics.stats[0][adios_statistic_max].data, (b->buff + b->offset) + ,size + ); + + if(b->change_endianness == adios_flag_yes) { + swap_adios_type(var_header->characteristics.stats[0][adios_statistic_max].data, var_header->type); + } + b->offset += size; + break; + + case adios_characteristic_value: + { + uint16_t val_size = *(uint16_t *) (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_16(val_size); + } + b->offset += 2; + + var_header->characteristics.value = malloc (val_size + 1); + ((char *) var_header->characteristics.value) [val_size] = '\0'; + memcpy (var_header->characteristics.value, (b->buff + b->offset) + ,val_size + ); + + // TODO: do we need byte-swap here? + b->offset += val_size; + break; + } + + case adios_characteristic_var_id: + case adios_characteristic_file_index: + case adios_characteristic_time_index: + // these are not in the var header in the PG + break; + } + } + + var_header->payload_size = length_of_var - (b->offset - initial_offset); + + return 0; +} + +int adios_clear_process_group_header_v1 ( + struct adios_process_group_header_struct_v1 * pg_header) +{ + pg_header->host_language_fortran = adios_flag_unknown; + if (pg_header->name) + { + free (pg_header->name); + pg_header->name = 0; + } + pg_header->coord_var_id = 0; + if (pg_header->time_index_name) + { + free (pg_header->time_index_name); + pg_header->time_index_name = 0; + } + pg_header->time_index = 0; + while (pg_header->methods) + { + struct adios_method_info_struct_v1 * t = pg_header->methods->next; + pg_header->methods->id = (enum ADIOS_IO_METHOD) 0; + if (pg_header->methods->parameters) + { + free (pg_header->methods->parameters); + pg_header->methods->parameters = 0; + } + free (pg_header->methods); + pg_header->methods = t; + } + pg_header->methods_count = 0; + + return 0; +} + +int adios_clear_var_header_v1 (struct adios_var_header_struct_v1 * var_header) +{ + if (var_header->name) + { + free (var_header->name); + var_header->name = 0; + } + if (var_header->path) + { + free (var_header->path); + var_header->path = 0; + } + while (var_header->dims) + { + struct adios_dimension_struct_v1 * d = var_header->dims->next; + free (var_header->dims); + var_header->dims = d; + } + struct adios_index_characteristic_struct_v1 * c + = &var_header->characteristics; + + c->offset = 0; + + // NCSU - Clear stat + if (c->stats) + { + uint8_t j = 0, idx = 0; + enum ADIOS_DATATYPES original_var_type = adios_transform_get_var_original_type_var_header (var_header); + uint8_t i = 0, count = adios_get_stat_set_count(original_var_type); + + while (c->bitmap >> j) + { + if ((c->bitmap >> j) & 1) + { + for (i = 0; i < count; i ++) + { + if (j == adios_statistic_hist) + { + struct adios_index_characteristics_hist_struct * hist = (struct adios_index_characteristics_hist_struct *) (c->stats[i][idx].data); + free (hist->breaks); + free (hist->frequencies); + free (hist); + } + else + free (c->stats[i][idx].data); + } + idx ++; + } + j ++; + } + + for (i = 0; i < count; i ++) + free (c->stats [i]); + + free (c->stats); + c->stats = 0; + c->bitmap = 0; // NCSU - Added by Drew Boyuka + } + + if (c->dims.dims) + { + free (c->dims.dims); + c->dims.count = 0; + c->dims.dims = 0; + } + if (c->value) + { + free (c->value); + c->value = 0; + } + c->var_id = 0; + + // NCSU ALACRITY-ADIOS - Clear transform metadata + adios_transform_clear_transform_characteristic(&c->transform); + + return 0; +} + +int adios_parse_var_data_payload_v1 (struct adios_bp_buffer_struct_v1 * b + ,struct adios_var_header_struct_v1 * var_header + ,struct adios_var_payload_struct_v1 * var_payload + ,uint64_t payload_buffer_size + ) +{ + if (b->length - b->offset < var_header->payload_size) + { + adios_error(err_invalid_buffer_vars, "adios_parse_var_data_payload_v1" + " for name %s path %s requires a buffer of at least " + "%llu bytes. Only %llu were provided\n", var_header->name, + var_header->path, var_header->payload_size, + b->length - b->offset); + + b->offset += var_header->payload_size; + + return 1; + } + if ( payload_buffer_size < var_header->payload_size + && var_payload && var_payload->payload + ) + { + adios_error(err_invalid_buffer_vars, "reading var name %s path %s" + "requires a buffer of at least %llu bytes. " + "Only %llu were provided\n" , var_header->name, + var_header->path, var_header->payload_size, + payload_buffer_size); + + b->offset += var_header->payload_size; + + return 1; + } + + if (var_payload) + { + if (var_payload->payload) + { + memcpy (var_payload->payload, (b->buff + b->offset) + ,var_header->payload_size + ); + if(b->change_endianness == adios_flag_yes) { + swap_adios_type_array(var_payload->payload, var_header->type, var_header->payload_size); + } + if (var_header->type == adios_string) { + ((char*)var_payload->payload)[var_header->payload_size] = '\0'; + } + b->offset += var_header->payload_size; + } + else + { + b->offset += var_header->payload_size; + } + } + else + { + b->offset += var_header->payload_size; + } + + return 0; +} + +int adios_parse_attributes_header_v1 (struct adios_bp_buffer_struct_v1 * b + ,struct adios_attributes_header_struct_v1 * attrs_header + ) +{ + if (b->length - b->offset < 10) + { + adios_error(err_invalid_buffer_attrs, "adios_parse_attributes_header_v1" + "requires a buffer of at least 10 bytes. " + "Only %llu were provided\n", b->length - b->offset); + + attrs_header->count = 0; + attrs_header->length = 0; + + return 1; + } + + attrs_header->count = *(uint32_t *) (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_32(attrs_header->count); + } + b->offset += 4; + + attrs_header->length = *(uint64_t *) (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_64(attrs_header->length); + } + b->offset += 8; + + return 0; +} + +int adios_parse_attribute_v1 (struct adios_bp_buffer_struct_v1 * b + ,struct adios_attribute_struct_v1 * attribute + ) +{ + if (b->length - b->offset < 15) + { + adios_error(err_invalid_buffer_attrs, "adios_parse_attribute_data_payload_v1" + "requires a buffer of at least 15 bytes. " + "Only %llu were provided\n", b->length - b->offset); + + return 1; + } + + uint32_t attribute_length; + uint16_t len; + + attribute_length = *(uint32_t *) (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_32(attribute_length); + } + b->offset += 4; + attribute->id = *(uint32_t *) (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_32(attribute->id); + } + b->offset += 4; + + len = *(uint16_t *) (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_16(len); + } + b->offset += 2; + attribute->name = (char *) malloc (len + 1); + attribute->name [len] = '\0'; + strncpy (attribute->name, b->buff + b->offset, len); + b->offset += len; + + len = *(uint16_t *) (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_16(len); + } + b->offset += 2; + attribute->path = (char *) malloc (len + 1); + attribute->path [len] = '\0'; + strncpy (attribute->path, b->buff + b->offset, len); + b->offset += len; + + attribute->is_var = (*(b->buff + b->offset) == 'y' ? adios_flag_yes + : adios_flag_no + ); + b->offset += 1; + if (attribute->is_var == adios_flag_yes) + { + attribute->var_id = *(uint32_t *) (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_32(attribute->var_id); + } + b->offset += 4; + attribute->type = adios_unknown; + attribute->length = 0; + attribute->value = 0; + } + else + { + uint8_t flag; + attribute->var_id = 0; + flag = *(b->buff + b->offset); + attribute->type = (enum ADIOS_DATATYPES) flag; + b->offset += 1; + attribute->length = *(uint32_t *) (b->buff + b->offset); + if(b->change_endianness == adios_flag_yes) { + swap_32(attribute->length); + } + b->offset += 4; + + attribute->value = malloc (attribute->length + 1); + ((char *) attribute->value) [attribute->length] = '\0'; + memcpy (attribute->value, (b->buff + b->offset), attribute->length); + + // TODO: do we need byte-swap here? + if(b->change_endianness == adios_flag_yes) { + swap_adios_type(attribute->value, attribute->type); + } + b->offset += attribute->length; + } + + return 0; +} + +int adios_clear_attribute_v1 (struct adios_attribute_struct_v1 * attribute) +{ + attribute->id = 0; + if (attribute->name) + { + free (attribute->name); + attribute->name = 0; + } + if (attribute->path) + { + free (attribute->path); + attribute->path = 0; + } + attribute->is_var = adios_flag_unknown; + attribute->var_id = 0; + attribute->type = adios_unknown; + attribute->length = 0; + if (attribute->value) + { + free (attribute->value); + attribute->value = 0; + } + return 0; +} + +void * adios_dupe_data_scalar (enum ADIOS_DATATYPES type, void * in) +{ + int element_size = adios_get_type_size (type, in); + + void * d; + + switch (type) + { + case adios_byte: + case adios_short: + case adios_integer: + case adios_long: + case adios_unsigned_byte: + case adios_unsigned_short: + case adios_unsigned_integer: + case adios_unsigned_long: + case adios_real: + case adios_double: + case adios_long_double: + case adios_complex: + case adios_double_complex: + d = malloc (element_size); + if (!d) + { + adios_error(err_no_memory, "cannot allocate %d " + "bytes to copy scalar\n", element_size); + + return 0; + } + + memcpy ((char *) d, (char *) in, element_size); + break; + + case adios_string: + d = malloc (element_size + 1); + if (!d) + { + adios_error(err_no_memory, "cannot allocate %d " + "bytes to copy scalar\n", element_size+1); + + return 0; + } + + memcpy ((char *) d, (char *) in, element_size + 1); + break; + + default: + d = 0; + break; + } + + return d; +} + +// ***************************************************************************** +void adios_init_buffer_read_version (struct adios_bp_buffer_struct_v1 * b) +{ + if (!b->buff) + { + alloc_aligned (b, 28); + memset (b->buff, 0, 28); + if (!b->buff) + log_warn("could not allocate 28 bytes\n"); + b->offset = 24; + } +} + +// last 4 bytes of file +void adios_posix_read_version (struct adios_bp_buffer_struct_v1 * b) +{ + uint64_t r; + + adios_init_buffer_read_version (b); + + lseek (b->f, b->file_size - 28, SEEK_SET); + + r = read (b->f, b->buff, 28); + if (r != 28) + log_warn("could not read 28 bytes. read only: %llu\n", r); +} + +void adios_init_buffer_read_index_offsets (struct adios_bp_buffer_struct_v1 * b) +{ + b->offset = 0; // just move to the start of the buffer +} + +void adios_posix_read_index_offsets (struct adios_bp_buffer_struct_v1 * b) +{ + adios_init_buffer_read_index_offsets (b); +} + +void adios_init_buffer_read_process_group_index ( + struct adios_bp_buffer_struct_v1 * b + ) +{ + realloc_aligned (b, b->pg_size); + b->offset = 0; +} + +void adios_posix_read_process_group_index (struct adios_bp_buffer_struct_v1 * b) +{ + adios_init_buffer_read_process_group_index (b); + + lseek (b->f, b->pg_index_offset, SEEK_SET); + read (b->f, b->buff, b->pg_size); +} + +void adios_init_buffer_read_vars_index (struct adios_bp_buffer_struct_v1 * b) +{ + realloc_aligned (b, b->vars_size); + b->offset = 0; +} + +void adios_posix_read_vars_index (struct adios_bp_buffer_struct_v1 * b) +{ + adios_init_buffer_read_vars_index (b); + + uint64_t r; + + lseek (b->f, b->vars_index_offset, SEEK_SET); + r = read (b->f, b->buff, b->vars_size); + + if (r != b->vars_size) + log_warn("reading vars_index: wanted %llu, read: %llu\n" + ,b->vars_size, r + ); +} + +void adios_init_buffer_read_attributes_index + (struct adios_bp_buffer_struct_v1 * b) +{ + realloc_aligned (b, b->attrs_size); + b->offset = 0; +} + +void adios_posix_read_attributes_index (struct adios_bp_buffer_struct_v1 * b) +{ + adios_init_buffer_read_attributes_index (b); + + uint64_t r; + + lseek (b->f, b->attrs_index_offset, SEEK_SET); + r = read (b->f, b->buff, b->attrs_size); + + if (r != b->attrs_size) + log_warn("reading attributess_index: wanted %llu, read: %llu\n", + b->attrs_size, r); +} + +void adios_init_buffer_read_process_group (struct adios_bp_buffer_struct_v1 * b) +{ + realloc_aligned (b, b->read_pg_size); + b->offset = 0; +} + +uint64_t adios_posix_read_process_group (struct adios_bp_buffer_struct_v1 * b) +{ + uint64_t pg_size = 0; + + adios_init_buffer_read_process_group (b); + + do + { + lseek (b->f, b->read_pg_offset + pg_size, SEEK_SET); + pg_size += read (b->f, b->buff + pg_size, b->read_pg_size - pg_size); + } while (errno && pg_size != b->read_pg_size); + + if (pg_size != b->read_pg_size) + { + log_warn("adios_read_process_group: " + "Tried to read: %llu, but only got: " + "%llu error: %s\n", b->read_pg_size, + pg_size, strerror(errno)); + + pg_size = 0; + } + + return pg_size; +} + +int adios_posix_open_read_internal (const char * filename + ,const char * base_path + ,struct adios_bp_buffer_struct_v1 * b + ) +{ + char * name; + struct stat s; + + name = malloc (strlen (base_path) + strlen (filename) + 1); + sprintf (name, "%s%s", base_path, filename); + + if (stat (name, &s) == 0) + b->file_size = s.st_size; + + b->f = open (name, O_RDONLY | O_LARGEFILE); + if (b->f == -1) + { + adios_error(err_file_not_found, "ADIOS POSIX: file not found: %s\n", + name); + + free (name); + + return 0; + } + + free (name); + + return 1; +} + +void adios_posix_close_internal (struct adios_bp_buffer_struct_v1 * b) +{ + if (b->f != -1) + { + close (b->f); + } + + b->f = -1; + adios_buffer_struct_clear (b); +} + +uint64_t adios_get_type_size (enum ADIOS_DATATYPES type, void * var) +{ + switch (type) + { + case adios_byte: + case adios_unsigned_byte: + return 1; + + case adios_string: + if (!var) + return 0; + else + return strlen ((char *) var); + + case adios_short: + case adios_unsigned_short: + return 2; + + case adios_integer: + case adios_unsigned_integer: + return 4; + + case adios_long: + case adios_unsigned_long: + return 8; + + case adios_real: + return 4; + + case adios_double: + return 8; + + case adios_long_double: + return 16; + + case adios_complex: + return 2 * 4; + + case adios_double_complex: + return 2 * 8; + + default: + return -1; + } +} + +//NCSU - Get the size of the statistic id +uint64_t adios_get_stat_size (void * data, enum ADIOS_DATATYPES type, enum ADIOS_STAT stat_id) +{ + uint64_t size = 0; + + switch (type) + { + case adios_complex: + switch (stat_id) + { + case adios_statistic_min: + case adios_statistic_max: + case adios_statistic_sum: + case adios_statistic_sum_square: + return adios_get_type_size(adios_double, ""); + + case adios_statistic_finite: + return adios_get_type_size(adios_byte, ""); + + case adios_statistic_cnt: + return adios_get_type_size(adios_unsigned_integer, ""); + + case adios_statistic_hist: + // this is not supported + return 0; + } + case adios_double_complex: + switch (stat_id) + { + case adios_statistic_min: + case adios_statistic_max: + case adios_statistic_sum: + case adios_statistic_sum_square: + return adios_get_type_size(adios_long_double, ""); + + case adios_statistic_finite: + return adios_get_type_size(adios_byte, ""); + + case adios_statistic_cnt: + return adios_get_type_size(adios_unsigned_integer, ""); + + case adios_statistic_hist: + // this is not supported + return 0; + } + default: + { + switch (stat_id) + { + case adios_statistic_min: + case adios_statistic_max: + return adios_get_type_size(type, ""); + + case adios_statistic_sum: + case adios_statistic_sum_square: + return adios_get_type_size(adios_double, ""); + + case adios_statistic_finite: + return adios_get_type_size(adios_byte, ""); + + case adios_statistic_cnt: + return adios_get_type_size(adios_unsigned_integer, ""); + + case adios_statistic_hist: + { + struct adios_hist_struct * hist = (struct adios_hist_struct *) data; + size += adios_get_type_size(adios_unsigned_integer, ""); // Number of breaks + size += adios_get_type_size(adios_double, ""); // Min + size += adios_get_type_size(adios_double, ""); // Max + size += ((hist->num_breaks + 1) * adios_get_type_size(adios_unsigned_integer, "")); + size += (hist->num_breaks * adios_get_type_size(adios_double, "")); + return size; + } + default: + return 0; + } + } + } +} + +//NCSU - Returns count of the set of characteristcs for a variable +uint8_t adios_get_stat_set_count (enum ADIOS_DATATYPES type) +{ + // NCSU - Complex numbers have the statistic related values repeated. + // NCSU - Holds values for real, imaginary, complex parts + if (type == adios_complex || type == adios_double_complex) + return 3; + return 1; +} + diff --git a/tests/libs/adios/src/core/adios_bp_v1.h b/tests/libs/adios/src/core/adios_bp_v1.h new file mode 100644 index 0000000000..06d5f6d8b4 --- /dev/null +++ b/tests/libs/adios/src/core/adios_bp_v1.h @@ -0,0 +1,362 @@ +/* + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + */ + +#ifndef ADIOS_BP_V1_H +#define ADIOS_BP_V1_H +#include "stdint.h" +#include "unistd.h" +#include "public/adios_types.h" +#include "core/adios_transport_hooks.h" +#include "core/qhashtbl.h" + +#define ADIOS_VERSION_BP_FORMAT 2 +#define ADIOS_VERSION_NUM_MASK 0x000000FF +#define ADIOS_VERSION_HAVE_SUBFILE 0x00000100 +#define ADIOS_VERSION_HAVE_TIME_INDEX_CHARACTERISTIC 0x00000200 +enum ADIOS_CHARACTERISTICS +{ + adios_characteristic_value = 0 + ,adios_characteristic_min = 1 // This is no longer used. Used to read in older bp file format + ,adios_characteristic_max = 2 // This is no longer used. Used to read in older bp file format + ,adios_characteristic_offset = 3 + ,adios_characteristic_dimensions = 4 + ,adios_characteristic_var_id = 5 + ,adios_characteristic_payload_offset = 6 + ,adios_characteristic_file_index = 7 + ,adios_characteristic_time_index = 8 + ,adios_characteristic_bitmap = 9 + ,adios_characteristic_stat = 10 + ,adios_characteristic_transform_type = 11 +}; + +#ifndef ADIOS_STAT_LENGTH + #define ADIOS_STAT_LENGTH 7 +#endif + +// NCSU - Adding statistics +enum ADIOS_STAT +{ + adios_statistic_min = 0 + ,adios_statistic_max = 1 + ,adios_statistic_cnt = 2 + ,adios_statistic_sum = 3 + ,adios_statistic_sum_square = 4 + ,adios_statistic_hist = 5 + ,adios_statistic_finite = 6 +}; + +struct adios_bp_buffer_struct_v1 +{ + int f; // the file handle + uint64_t file_size; + uint32_t version; + + char * allocated_buff_ptr; // initial alloc for aligning on 8-byte boundary + + char * buff; + uint64_t length; + uint64_t offset; // buffer_offset + + enum ADIOS_FLAG change_endianness; + + off_t file_offset; + uint64_t end_of_pgs; // where the last process group ends + uint64_t pg_index_offset; // process groups index starts + uint64_t pg_size; // process groups index size + uint64_t vars_index_offset; // vars index start + uint64_t vars_size; // vars index size + uint64_t attrs_index_offset; // attributes index start + uint64_t attrs_size; // attributes index size + + uint64_t read_pg_offset; + uint64_t read_pg_size; +}; + +struct adios_index_process_group_struct_v1 +{ + char * group_name; + enum ADIOS_FLAG adios_host_language_fortran; + uint32_t process_id; + char * time_index_name; + uint32_t time_index; + uint64_t offset_in_file; + + struct adios_index_process_group_struct_v1 * next; +}; + +struct adios_index_characteristic_dims_struct_v1 +{ + uint8_t count; + uint64_t * dims; // each 3 uint64_t represents one dimension (l, g, o) +}; + +// NCSU - Generic data for all statistics +struct adios_index_characteristics_stat_struct +{ + void * data; +}; + +// NCSU - Structure for histogram +struct adios_index_characteristics_hist_struct +{ + double min; //minimum value of histogram ** for when we use complex variables + double max; //maximum value of histogram + uint32_t num_breaks; //number of break points for the histogram + uint32_t * frequencies; //array of frequencies for the histogram + double * breaks; //breaks array for the histogram, output this to gnuplot +}; + + +struct adios_index_characteristic_transform_struct { + uint8_t transform_type; + + enum ADIOS_DATATYPES pre_transform_type; + struct adios_index_characteristic_dims_struct_v1 pre_transform_dimensions; + + uint16_t transform_metadata_len; + void *transform_metadata; +}; + +struct adios_index_characteristic_struct_v1 +{ + uint64_t offset; // beginning of the var or attr entry + struct adios_index_characteristic_dims_struct_v1 dims; + uint32_t var_id; + void * value; + uint64_t payload_offset; // beginning of the var or attr payload + uint32_t file_index; // subfile index + uint32_t time_index; + + uint32_t bitmap; + + struct adios_index_characteristics_stat_struct ** stats; + + // NCSU ALACRITY-ADIOS - Adding transform-related fields + /* + uint8_t transform_type; + enum ADIOS_DATATYPES pre_transform_type; + struct adios_index_characteristic_dims_struct_v1 pre_transform_dimensions; + uint16_t transform_metadata_len; + void *transform_metadata; + */ + struct adios_index_characteristic_transform_struct transform; +}; + +struct adios_index_var_struct_v1 +{ + uint32_t id; + char * group_name; + char * var_name; + char * var_path; + enum ADIOS_DATATYPES type; + + uint64_t characteristics_count; + uint64_t characteristics_allocated; + + struct adios_index_characteristic_struct_v1 * characteristics; + + struct adios_index_var_struct_v1 * next; +}; + +struct adios_index_attribute_struct_v1 +{ + uint32_t id; + char * group_name; + char * attr_name; + char * attr_path; + enum ADIOS_DATATYPES type; + + uint64_t characteristics_count; + uint64_t characteristics_allocated; + + struct adios_index_characteristic_struct_v1 * characteristics; + + struct adios_index_attribute_struct_v1 * next; +}; + +/* Struct to hold the 3 main pointers of the index: + * group, variable and attribute indices + */ +struct adios_index_struct_v1 +{ + struct adios_index_process_group_struct_v1 * pg_root; + struct adios_index_var_struct_v1 * vars_root; + struct adios_index_var_struct_v1 * vars_tail; + struct adios_index_attribute_struct_v1 * attrs_root; + struct adios_index_attribute_struct_v1 * attrs_tail; + qhashtbl_t *hashtbl_vars; // to speed up merging lists + qhashtbl_t *hashtbl_attrs; // to speed up merging lists +}; + +struct adios_method_info_struct_v1 +{ + enum ADIOS_IO_METHOD id; + char * parameters; + + struct adios_method_info_struct_v1 * next; +}; + +struct adios_dimension_item_struct_v1 +{ + uint64_t rank; + uint32_t var_id; + enum ADIOS_FLAG time_index; +}; + +struct adios_dimension_struct_v1 +{ + struct adios_dimension_item_struct_v1 dimension; + struct adios_dimension_item_struct_v1 global_dimension; + struct adios_dimension_item_struct_v1 local_offset; + struct adios_dimension_struct_v1 * next; +}; + +struct adios_process_group_header_struct_v1 +{ + enum ADIOS_FLAG host_language_fortran; + char * name; + uint32_t coord_var_id; + char * time_index_name; + uint32_t time_index; + uint8_t methods_count; + struct adios_method_info_struct_v1 * methods; +}; + +struct adios_vars_header_struct_v1 +{ + uint32_t count; + uint64_t length; +}; + +struct adios_attributes_header_struct_v1 +{ + uint32_t count; + uint64_t length; +}; + +struct adios_var_header_struct_v1 +{ + uint32_t id; + char * name; + char * path; + enum ADIOS_DATATYPES type; + enum ADIOS_FLAG is_dim; + struct adios_dimension_struct_v1 * dims; + struct adios_index_characteristic_struct_v1 characteristics; + uint64_t payload_size; +}; + +struct adios_var_payload_struct_v1 +{ + void * payload; +}; + +struct adios_attribute_struct_v1 +{ + uint32_t id; + char * name; + char * path; + + enum ADIOS_FLAG is_var; + + uint32_t var_id; + + enum ADIOS_DATATYPES type; + uint32_t length; + void * value; +}; + +void adios_shared_buffer_free (struct adios_bp_buffer_struct_v1 * b); +void adios_buffer_struct_init (struct adios_bp_buffer_struct_v1 * b); +void adios_buffer_struct_clear (struct adios_bp_buffer_struct_v1 * b); + +void * adios_dupe_data_scalar (enum ADIOS_DATATYPES type, void * in); + +// buff must be 4 bytes +int adios_parse_version (struct adios_bp_buffer_struct_v1 * b + ,uint32_t * version + ); + +// buff must be 16 bytes +int adios_parse_index_offsets_v1 (struct adios_bp_buffer_struct_v1 * b); + +int adios_parse_process_group_index_v1 (struct adios_bp_buffer_struct_v1 * b + ,struct adios_index_process_group_struct_v1 ** pg_root + ); + +int adios_parse_vars_index_v1 (struct adios_bp_buffer_struct_v1 * b + ,struct adios_index_var_struct_v1 ** vars_root + ,qhashtbl_t *hashtbl_vars + ,struct adios_index_var_struct_v1 ** vars_tail + ); +int adios_parse_attributes_index_v1 (struct adios_bp_buffer_struct_v1 * b + ,struct adios_index_attribute_struct_v1 ** attrs_root + ); + +int adios_parse_process_group_header_v1 (struct adios_bp_buffer_struct_v1 * b + ,struct adios_process_group_header_struct_v1 * pg_header + ); + +int adios_parse_vars_header_v1 (struct adios_bp_buffer_struct_v1 * b + ,struct adios_vars_header_struct_v1 * vars_header + ); + +int adios_parse_var_data_header_v1 (struct adios_bp_buffer_struct_v1 * b + ,struct adios_var_header_struct_v1 * var_header + ); + +int adios_parse_var_data_payload_v1 (struct adios_bp_buffer_struct_v1 * b + ,struct adios_var_header_struct_v1 * var_header + ,struct adios_var_payload_struct_v1 * var_payload + ,uint64_t payload_size + ); + +int adios_parse_attributes_header_v1 (struct adios_bp_buffer_struct_v1 * b + ,struct adios_attributes_header_struct_v1 * attrs_header + ); + +int adios_parse_attribute_v1 (struct adios_bp_buffer_struct_v1 * b + ,struct adios_attribute_struct_v1 * attribute + ); +int adios_clear_process_group_header_v1 ( + struct adios_process_group_header_struct_v1 * pg_header); +int adios_clear_var_header_v1 (struct adios_var_header_struct_v1 * var_header); +int adios_clear_attribute_v1 (struct adios_attribute_struct_v1 * attribute); + +// **************************************************************************** +// functions from adios_posix.c used for file reading + +void adios_init_buffer_read_version (struct adios_bp_buffer_struct_v1 * b); +void adios_posix_read_version (struct adios_bp_buffer_struct_v1 * b); + +void adios_init_buffer_read_index_offsets ( struct adios_bp_buffer_struct_v1 * b); +void adios_posix_read_index_offsets (struct adios_bp_buffer_struct_v1 * b); + +void adios_init_buffer_read_process_group_index ( struct adios_bp_buffer_struct_v1 * b); +void adios_posix_read_process_group_index (struct adios_bp_buffer_struct_v1 * b); + +void adios_init_buffer_read_process_group (struct adios_bp_buffer_struct_v1 * b); +void adios_init_buffer_read_vars_index (struct adios_bp_buffer_struct_v1 * b); +void adios_posix_read_vars_index (struct adios_bp_buffer_struct_v1 * b); + +void adios_init_buffer_read_attributes_index + (struct adios_bp_buffer_struct_v1 * b); +void adios_posix_read_attributes_index (struct adios_bp_buffer_struct_v1 * b); + +void adios_init_buffer_read_procss_group (struct adios_bp_buffer_struct_v1 * b); +uint64_t adios_posix_read_process_group (struct adios_bp_buffer_struct_v1 * b); + +int adios_posix_open_read_internal (const char * filename + ,const char * base_path + ,struct adios_bp_buffer_struct_v1 * b + ); +void adios_posix_close_internal (struct adios_bp_buffer_struct_v1 * b); + +// ADIOS statistics related functions +uint64_t adios_get_stat_size (void * data, enum ADIOS_DATATYPES type, enum ADIOS_STAT stat_id); +uint8_t adios_get_stat_set_count (enum ADIOS_DATATYPES type); +#endif diff --git a/tests/libs/adios/src/core/adios_copyspec.c b/tests/libs/adios/src/core/adios_copyspec.c new file mode 100644 index 0000000000..8583dfd841 --- /dev/null +++ b/tests/libs/adios/src/core/adios_copyspec.c @@ -0,0 +1,227 @@ +/* + * adios_copyspec.c + * + * + * Created on: Aug 2, 2012 + * Author: David A. Boyuka II + */ + +#include +#include +#include +#include +#include "util.h" +#include "core/adios_copyspec.h" +#include "core/adios_subvolume.h" +#include "core/common_read.h" +#include "adios_selection.h" + +#define MYFREE(x) {if (x) free((void*)x);} + +// +// Init and free +// +static void adios_copyspec_init_from_bufs(adios_subvolume_copy_spec *copy_spec, + int ndim, const uint64_t *subv_dims, + const uint64_t *dst_dims, + const uint64_t *dst_subv_offsets, + const uint64_t *src_dims, + const uint64_t *src_subv_offsets) { + const int dimsize = ndim * sizeof(uint64_t); + copy_spec->ndim = ndim; + copy_spec->subv_dims = subv_dims ? bufdup(subv_dims, 1, dimsize) : malloc(dimsize); + copy_spec->dst_dims = dst_dims ? bufdup(dst_dims, 1, dimsize) : malloc(dimsize); + copy_spec->dst_subv_offsets = dst_subv_offsets ? bufdup(dst_subv_offsets, 1, dimsize) : malloc(dimsize); + copy_spec->src_dims = src_dims ? bufdup(src_dims, 1, dimsize) : malloc(dimsize); + copy_spec->src_subv_offsets = src_subv_offsets ? bufdup(src_subv_offsets, 1, dimsize) : malloc(dimsize); +} + +void adios_copyspec_init(adios_subvolume_copy_spec *copy_spec, + int ndim, const uint64_t *subv_dims, + const uint64_t *dst_dims, const uint64_t *dst_subv_offsets, + const uint64_t *src_dims, const uint64_t *src_subv_offsets) { + assert(ndim > 0 && subv_dims && + dst_dims && dst_subv_offsets && + src_dims && src_subv_offsets); + copy_spec->ndim = ndim; + copy_spec->subv_dims = subv_dims; + copy_spec->dst_dims = dst_dims; + copy_spec->dst_subv_offsets = dst_subv_offsets; + copy_spec->src_dims = src_dims; + copy_spec->src_subv_offsets = src_subv_offsets; +} + +int adios_copyspec_init_from_intersection(adios_subvolume_copy_spec *copy_spec, int ndim, + const uint64_t *dst_dims, const uint64_t *dst_goffsets, + const uint64_t *src_dims, const uint64_t *src_goffsets) { + // Initialize with number of dimensions and source/destination dimensions + // Offsets and subvolume dimension are unknown at this time + // Arg order: + // copyspec, ndim, subv_dims + // dst_dims, dst_subv_offsets + // src_dims, src_subv_offsets + adios_copyspec_init_from_bufs(copy_spec, ndim, NULL, + dst_dims, NULL, + src_dims, NULL); + + uint64_t *subv_dims = malloc(ndim * sizeof(uint64_t)); + uint64_t *dst_subv_offsets = malloc(ndim * sizeof(uint64_t)); + uint64_t *src_subv_offsets = malloc(ndim * sizeof(uint64_t)); + + // Compute the intersection to compute in the rest of the information + const int intersects = + intersect_volumes(ndim, dst_dims, dst_goffsets, src_dims, src_goffsets, + subv_dims, NULL, + dst_subv_offsets, src_subv_offsets); + + if (intersects) { + copy_spec->subv_dims = subv_dims; + copy_spec->dst_subv_offsets = dst_subv_offsets; + copy_spec->src_subv_offsets = src_subv_offsets; + } else { + MYFREE(subv_dims); + MYFREE(dst_subv_offsets); + MYFREE(src_subv_offsets); + } + + return intersects; +} + +int adios_copyspec_init_from_bb_intersection(adios_subvolume_copy_spec *copy_spec, + const ADIOS_SELECTION_BOUNDINGBOX_STRUCT *dst_bb, + const uint64_t *src_dims, const uint64_t *src_goffsets) { + + assert(dst_bb); assert(src_dims); assert(src_goffsets); + return adios_copyspec_init_from_intersection(copy_spec, dst_bb->ndim, + dst_bb->count, dst_bb->start, + src_dims, src_goffsets); +} + +int adios_copyspec_init_from_2bb_intersection(adios_subvolume_copy_spec *copy_spec, + const ADIOS_SELECTION_BOUNDINGBOX_STRUCT *dst_bb, + const ADIOS_SELECTION_BOUNDINGBOX_STRUCT *src_bb) { + + assert(dst_bb); assert(src_bb); assert(dst_bb->ndim == src_bb->ndim); + return adios_copyspec_init_from_intersection(copy_spec, dst_bb->ndim, + dst_bb->count, dst_bb->start, + src_bb->count, src_bb->start); +} + + +void adios_copyspec_free(adios_subvolume_copy_spec **copy_spec_ptr, int free_buffers) { + adios_subvolume_copy_spec *copy_spec = *copy_spec_ptr; + if (free_buffers) { + MYFREE(copy_spec->subv_dims); + MYFREE(copy_spec->dst_dims); + MYFREE(copy_spec->dst_subv_offsets); + MYFREE(copy_spec->src_dims); + MYFREE(copy_spec->src_subv_offsets); + } + memset(copy_spec, 0, sizeof(adios_subvolume_copy_spec)); + + MYFREE(*copy_spec_ptr); +} + +// +// Derivative copyspec functions +// + +void adios_copyspec_copy(adios_subvolume_copy_spec *dst_copy_spec, const adios_subvolume_copy_spec *src_copy_spec) { + // Arg order: + // copyspec, ndim, subv_dims + // dst_dims, dst_subv_offsets + // src_dims, src_subv_offsets + adios_copyspec_init_from_bufs(dst_copy_spec, src_copy_spec->ndim, src_copy_spec->subv_dims, + src_copy_spec->dst_dims, src_copy_spec->dst_subv_offsets, + src_copy_spec->src_dims, src_copy_spec->src_subv_offsets); +} + +adios_subvolume_copy_spec * adios_copyspec_dup(const adios_subvolume_copy_spec *copy_spec) { + adios_subvolume_copy_spec *new_copy_spec = malloc(sizeof(adios_subvolume_copy_spec)); + adios_copyspec_copy(new_copy_spec, copy_spec); + return new_copy_spec; +} + +void adios_copyspec_shrink_dst_to_subv(adios_subvolume_copy_spec * dst_copy_spec, const adios_subvolume_copy_spec *src_copy_spec) { + const int ndim = src_copy_spec->ndim; + + // Arg order: + // copyspec, ndim, subv_dims + // dst_dims, dst_subv_offsets + // src_dims, src_subv_offsets + adios_copyspec_init_from_bufs(dst_copy_spec, ndim, src_copy_spec->subv_dims, + src_copy_spec->subv_dims, calloc(ndim, sizeof(uint64_t)), + src_copy_spec->src_dims, src_copy_spec->src_subv_offsets); +} + +void adios_copyspec_shrink_src_to_subv(adios_subvolume_copy_spec * dst_copy_spec, const adios_subvolume_copy_spec *src_copy_spec) { + const int ndim = src_copy_spec->ndim; + + // Arg order: + // copyspec, ndim, subv_dims + // dst_dims, dst_subv_offsets + // src_dims, src_subv_offsets + adios_copyspec_init_from_bufs(dst_copy_spec, ndim, src_copy_spec->subv_dims, + src_copy_spec->dst_dims, src_copy_spec->dst_subv_offsets, + src_copy_spec->subv_dims, calloc(ndim, sizeof(uint64_t))); +} + +// +// Inspection/calculations with copyspecs +// + +int adios_copyspec_is_subvolume_src_covering(const adios_subvolume_copy_spec *subv_spec) { + int dim; + for (dim = 0; dim < subv_spec->ndim; dim++) { + if (subv_spec->src_subv_offsets[dim] != 0 || + subv_spec->src_dims[dim] != subv_spec->subv_dims[dim]) + return 0; + } + return 1; +} + +int adios_copyspec_is_subvolume_dst_covering(const adios_subvolume_copy_spec *subv_spec) { + int dim; + for (dim = 0; dim < subv_spec->ndim; dim++) { + if (subv_spec->dst_subv_offsets[dim] != 0 || + subv_spec->dst_dims[dim] != subv_spec->subv_dims[dim]) + return 0; + } + return 1; +} + +int adios_copyspec_is_noop(const adios_subvolume_copy_spec *copy_spec) { + const int dimsize = copy_spec->ndim * sizeof(uint64_t); + int dim; + + // If the source, destination and subvolume dimensions are not all equal, + // this is not a no-op + if (memcmp(copy_spec->src_dims, copy_spec->dst_dims, dimsize) != 0 || + memcmp(copy_spec->src_dims, copy_spec->subv_dims, dimsize) != 0) + return 0; + + // If the subvolume offsets within the source and destination volumes do + // not match, this is not a no-op + for (dim = 0; dim < copy_spec->ndim; dim++) { + if (copy_spec->dst_subv_offsets[dim] != 0 || + copy_spec->src_subv_offsets[dim] != 0) + return 0; + } + + // We pass all tests; this is a no-op + return 1; +} + +// Extracts a selection corresponding to the subvolume within the source buffer +ADIOS_SELECTION * adios_copyspec_to_src_selection(adios_subvolume_copy_spec *copy_spec) { + return common_read_selection_boundingbox(copy_spec->ndim, + bufdup(copy_spec->src_subv_offsets, sizeof(uint64_t), copy_spec->ndim), + bufdup(copy_spec->subv_dims, sizeof(uint64_t), copy_spec->ndim)); +} + +// Extracts a selection corresponding to the subvolume within the destination buffer +ADIOS_SELECTION * adios_copyspec_to_dst_selection(adios_subvolume_copy_spec *copy_spec) { + return common_read_selection_boundingbox(copy_spec->ndim, + bufdup(copy_spec->dst_subv_offsets, sizeof(uint64_t), copy_spec->ndim), + bufdup(copy_spec->subv_dims, sizeof(uint64_t), copy_spec->ndim)); +} diff --git a/tests/libs/adios/src/core/adios_copyspec.h b/tests/libs/adios/src/core/adios_copyspec.h new file mode 100644 index 0000000000..459dd34f28 --- /dev/null +++ b/tests/libs/adios/src/core/adios_copyspec.h @@ -0,0 +1,251 @@ +/* + * adios_copyspec.h + * + * Defines the adios_subvolume_copy_spec, which describes a logical copy + * operation of a subvolume (i.e., multi-dimensional array) from a source + * volume to a destination volume, as well as various functions for + * constructing and deriving such copy specs. The source and destinations + * volumes exist in the same global coordinate space. The subvolume is defined + * with dimensions within the same coordinate space, and is linked to the + * source and destination volumes by an offset within each of these volumes. + * + * Subvolume copy specs are somewhat related to ADIOS selection bounding boxes. + * A subvolume copy spec could be fully defined by four bounding boxes: one + * each to define the source and destination volumes, and one each to define + * the location and size of the subvolume within each of these volumes. However, + * such a decomposition stores significant redundant, and thus potentially + * contradictory, information, including storing the subvolume dimensions twice + * and the dimensionality of global space four times. Thus, a more coherent and + * concise representation of a copy operation is desirable, and so is supplied + * in this file. + * + * --- Subvolume copy spec definition --- + * + * A subvolume copy spec is defined by the following properties: + * + * 1) The dimensionality of global space + * 2) The source volume dimensions and global offsets + * 3) The destination volume dimensions and global offsets + * 4) The subvolume dimensions, and an offsets within the each of the source + * and destination volumes + * + * For example: + * + * B=(20,30) + * +---------------+ + * | | + * | D=(15,25) | + * | +-----+ | F=(50,25) + * | | |~~~~|~~~+ +-----------------------+ + * | | | | ! | | + * | +-----+ | ! | | + * | (10,20)=C | ! | | + * | | ! | H=(45,15) | + * | | ! | +-----+ | + * | | +~~~|~~~~~~~~~~>| | + * | | | | | | + * | | +-----------+-----+-----+ + * | | E=(30,10) G=(40,10) + * | | + * +---------------+ + * A=(5,5) + * + * In this case, (A,B) is the source volume, (E,F) is the destination volume, + * and (C,D) and (G,H) are the subvolume, as located within the source and + * destination volumes, respectively. In this case: + * + * Dimensionality of global space = 2 + * Source dims = B-A = (15,25) + * Source goffsets = A = (5,5) + * Destination dims = F-E = (20,15) + * Destination goffsets = E = (30,10) + * Subvolume dims = D-C = G-H = (5,5) + * Subvolume source offsets = C-A = (5,15) + * Subvolume destination offsets = G-E = (10,0) + * + * Created on: Aug 2, 2012 + * Author: David A. Boyuka II + */ + +#ifndef ADIOS_COPYSPEC_H_ +#define ADIOS_COPYSPEC_H_ + +/* + * A struct representing the copy of a subvolume of a source volume to an + * equal-sized subvolume of a destination volume. See the comment at the top + * of this file for more details. + */ +typedef struct { + int ndim; + const uint64_t *subv_dims; + const uint64_t *dst_dims; + const uint64_t *dst_subv_offsets; + const uint64_t *src_dims; + const uint64_t *src_subv_offsets; +} adios_subvolume_copy_spec; + +// +// Init and free +// + +/* + * Initializes a copyspec with the given arrays. The arrays are used as-is and + * not copied, so the user must be careful they remain available until this + * copyspec is no longer needed. If the arrays should not be free'd when this + * copyspec is free'd, the user must pass 0 as the the free_buffers argument to + * adios_copyspec_free. + * + * Note: all offsets are in elements, not bytes. Furthermore, the element type + * is unspecified, and must be passed at copy time. + */ +void adios_copyspec_init(adios_subvolume_copy_spec *copy_spec, + int ndim, const uint64_t *subv_dims, + const uint64_t *dst_dims, const uint64_t *dst_subv_offsets, + const uint64_t *src_dims, const uint64_t *src_subv_offsets); + +/* + * Initializes a copy spec to describe a copy from the given source volume + * (src_dims and src_goffsets) to the given destination volume (described by + * dst_dims and dst_goffsets), with the subvolume to copy being defined by the + * intersection of these two volumes. I.e., + * + * srcv = src_dims, src_goffsets + * dstv = dst_dims, dst_goffsets + * subv = src & dst // & = intersection + * + * copy_spec must not have been previously initialized, or must have been + * subsequently free'd. + * + * If the source and destination volumes do indeed intersect (non-empty + * intersection), a non-zero integer is returned and copy_spec is populated. + * Otherwise (if the source and destination volumes are disjoint), 0 is + * returned, and the contents of copy_spec are undefined. + * + * @param copy_spec the copy spec to initialize as specified above + * @param dst_dims the dimensions of the destination volume + * @param dst_goffsets the global offset of the destination volume + * @param src_dims the dimensions of the source volume + * @param src_goffsets the global offset of the source volume + * @return a non-zero integer if the source and destination volumes have a + * non-empty intersection, in which case copy_spec is initialized, and + * 0 otherwise, in which case the contents of copy_spec are undefined. + */ +int adios_copyspec_init_from_intersection(adios_subvolume_copy_spec *copy_spec, int ndim, + const uint64_t *dst_dims, const uint64_t *dst_goffsets, + const uint64_t *src_dims, const uint64_t *src_goffsets); + +/* + * Same as adios_copyspec_init_from_intersection, but the destination volume is + * instead described by a bounding box struct. + */ +int adios_copyspec_init_from_bb_intersection(adios_subvolume_copy_spec *copy_spec, + const ADIOS_SELECTION_BOUNDINGBOX_STRUCT *dst_selection, + const uint64_t *src_dims, const uint64_t *src_goffsets); + +/* + * Same as adios_copyspec_init_from_intersection, but both the source and + * destination volumes are instead described by bounding box structs. + */ +int adios_copyspec_init_from_2bb_intersection(adios_subvolume_copy_spec *copy_spec, + const ADIOS_SELECTION_BOUNDINGBOX_STRUCT *dst_bb, + const ADIOS_SELECTION_BOUNDINGBOX_STRUCT *src_bb); + + +/* + * Frees the resources associated with the given copyspec, and clears its + * contents for safety. The user must specify whether the coordinate arrays + * stored within the copyspec are also free'd, as the user may or may not + * have used shared arrays for the init function. + * + * @param copy_spec the copyspec to free + * @param free_buffers if non-zero, all buffers within the copyspec will be + * free'd; if zero, they will be left allocated and unchanged. + */ +void adios_copyspec_free(adios_subvolume_copy_spec **copy_spec, int free_buffers); + +// +// Derivative copyspec functions +// + +/* + * Copies the contents of one copyspec into another, such that both are + * an independent. + * + * @param dst_copy_spec the source copyspec + * @param src_copy_spec the destination copyspec + */ +void adios_copyspec_copy(adios_subvolume_copy_spec *dst_copy_spec, const adios_subvolume_copy_spec *src_copy_spec); + +/* + * Creates and returns a duplicate of the given copyspec. The memory for the + * return copyspec is obtained via malloc, and so must later be free'd by the + * user. + * @param copy_spec the copyspec to duplicate + * @return a new, indepedent copyspec with the same content as the given + * copyspec. + */ +adios_subvolume_copy_spec * adios_copyspec_dup(const adios_subvolume_copy_spec *copy_spec); + +/* + * Derives a new copy spec that is the same as the source copy spec, but with + * the destination volume mapped to the exact size of the subvolume. That is, + * + * dst_dims := subv_dims + * dst_subv_offsets := {0,0, ..., 0} + * + * dst_copy_spec must not have been previously initialized, or must have been + * subsequently free'd. + * + * @param dst_copy_spec the copy spec to populate with the new specifications. + * @param src_copy_spec the copy spec to use as the basis for the derived copy + * spec. + */ +void adios_copyspec_shrink_dst_to_subv(adios_subvolume_copy_spec * dst_copy_spec, const adios_subvolume_copy_spec *src_copy_spec); + +/* + * Derives a new copy spec that is the same as the source copy spec, but with + * the source volume mapped to the exact size of the subvolume. That is, + * + * src_dims := subv_dims + * src_subv_offsets := {0,0, ..., 0} + * + * The derived copy spec to be populated must not have been previously + * initialized, or must have been subsequently free'd. + * + * @param dst_copy_spec the copy spec to populate with the new specifications. + * @param src_copy_spec the copy spec to use as the basis for the derived copy + * spec. + */ +void adios_copyspec_shrink_src_to_subv(adios_subvolume_copy_spec * dst_copy_spec, const adios_subvolume_copy_spec *src_copy_spec); + +// +// Inspection/calculations with copyspecs +// + +/* + * @return non-zero if the copyspec's subvolume entirely covers the source + * volume, 0 otherwise. + */ +int adios_copyspec_is_subvolume_src_covering(const adios_subvolume_copy_spec *copyspec); + +/* + * @return non-zero if the copyspec's subvolume entirely covers the + * destination volume, 0 otherwise. + */ +int adios_copyspec_is_subvolume_dst_covering(const adios_subvolume_copy_spec *copyspec); + +int adios_copyspec_is_noop(const adios_subvolume_copy_spec *copy_spec); + +/* + * @return an ADIOS_SELECTION describing the subvolume within the source + * volume. + */ +ADIOS_SELECTION * adios_copyspec_to_src_selection(adios_subvolume_copy_spec *copy_spec); + +/* + * @return an ADIOS_SELECTION describing the subvolume within the destination + * volume. + */ +ADIOS_SELECTION * adios_copyspec_to_dst_selection(adios_subvolume_copy_spec *copy_spec); + +#endif /* ADIOS_COPYSPEC_H_ */ diff --git a/tests/libs/adios/src/core/adios_endianness.c b/tests/libs/adios/src/core/adios_endianness.c new file mode 100644 index 0000000000..169393efe4 --- /dev/null +++ b/tests/libs/adios/src/core/adios_endianness.c @@ -0,0 +1,141 @@ +/* + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + */ + +#include +#include +#include "adios_types.h" +#include "core/adios_logger.h" +#include "core/adios_internals.h" + +void show_bytes(unsigned char * start, int len) +{ + int i; + for (i = 0; i < len; i ++) { + log_info(" %.2x", start[i]); + } + log_info("\n"); +} + + +void swap_16_ptr(void *data) +{ + uint16_t d = *(uint16_t *)data; + *(uint16_t *)data = d>>8 | d<<8; +} + + +void swap_32_ptr(void *data) +{ + uint32_t d = *(uint32_t *)data; + *(uint32_t *)data = ((d&0x000000FF)<<24) + + ((d&0x0000FF00)<<8) + + ((d&0x00FF0000)>>8) + + ((d&0xFF000000)>>24); +} + + +void swap_64_ptr(void *data) +{ + uint64_t d = *(uint64_t *)data; + *(uint64_t *)data = ((d&0x00000000000000FF)<<56) + + ((d&0x000000000000FF00)<<40) + + ((d&0x0000000000FF0000)<<24) + + ((d&0x00000000FF000000)<<8) + + ((d&0x000000FF00000000LL)>>8) + + ((d&0x0000FF0000000000LL)>>24) + + ((d&0x00FF000000000000LL)>>40) + + ((d&0xFF00000000000000LL)>>56); +} + + +void swap_128_ptr(void *data) +{ + uint64_t d = *(uint64_t *)data; + *(uint64_t *)data = ((d&0x00000000000000FF)<<56) + + ((d&0x000000000000FF00)<<40) + + ((d&0x0000000000FF0000)<<24) + + ((d&0x00000000FF000000)<<8) + + ((d&0x000000FF00000000LL)>>8) + + ((d&0x0000FF0000000000LL)>>24) + + ((d&0x00FF000000000000LL)>>40) + + ((d&0xFF00000000000000LL)>>56); + d = *((uint64_t *)data + 1); + d = ((d&0x00000000000000FF)<<56) + + ((d&0x000000000000FF00)<<40) + + ((d&0x0000000000FF0000)<<24) + + ((d&0x00000000FF000000)<<8) + + ((d&0x000000FF00000000LL)>>8) + + ((d&0x0000FF0000000000LL)>>24) + + ((d&0x00FF000000000000LL)>>40) + + ((d&0xFF00000000000000LL)>>56); + *((uint64_t *)data + 1) = *(uint64_t *)data; + *(uint64_t *)data = d; +} + + +void swap_adios_type(void *data, enum ADIOS_DATATYPES type) +{ + if(type == adios_string) { + return; + } + else { + uint64_t size = adios_get_type_size (type, ""); + + switch (size) + { + case 1: + break; + case 2: + swap_16_ptr(data); + break; + case 4: + swap_32_ptr(data); + break; + case 8: + swap_64_ptr(data); + break; + case 16: + swap_128_ptr(data); + break; + case adios_complex: + case adios_double_complex: + // TODO + break; + } + } +} + + +void swap_adios_type_array(void *data, enum ADIOS_DATATYPES type, uint64_t payload_size) +{ + uint64_t size = adios_get_type_size (type, ""); + uint64_t num_elements = payload_size / size; + + uint64_t i = 0; + for(i = 0; i < num_elements; i ++) { + swap_adios_type((char *)data + i*size, type); + } +} + +void swap_ptr(void * data, int size) +{ + switch (size) + { + case 16: + swap_16_ptr(data); + break; + case 32: + swap_32_ptr(data); + break; + case 64: + swap_64_ptr(data); + break; + case 128: + swap_128_ptr(data); + break; + } +} diff --git a/tests/libs/adios/src/core/adios_endianness.h b/tests/libs/adios/src/core/adios_endianness.h new file mode 100644 index 0000000000..a38e40ddd3 --- /dev/null +++ b/tests/libs/adios/src/core/adios_endianness.h @@ -0,0 +1,37 @@ +/* + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + */ + +#ifndef ENDIANNESS_H +#define ENDIANNESS_H 1 + +#include "public/adios_types.h" + +void show_bytes(unsigned char * start, int len); + +void swap_ptr(void * data, int size); + +void swap_16_ptr(void *data); + +void swap_32_ptr(void *data); + +void swap_64_ptr(void *data); + +void swap_128_ptr(void *data); + +#define swap_16(data) swap_16_ptr(&(data)) + +#define swap_32(data) swap_32_ptr(&(data)) + +#define swap_64(data) swap_64_ptr(&(data)) + +#define swap_128(data) swap_128_ptr(&(data)) + +void swap_adios_type(void *data, enum ADIOS_DATATYPES type); + +void swap_adios_type_array(void *payload, enum ADIOS_DATATYPES type, uint64_t payload_size); + +#endif diff --git a/tests/libs/adios/src/core/adios_error.c b/tests/libs/adios/src/core/adios_error.c new file mode 100644 index 0000000000..389dc605e7 --- /dev/null +++ b/tests/libs/adios/src/core/adios_error.c @@ -0,0 +1,58 @@ +/* + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + */ + +#include +#include +#include +#include +#include "adios_error.h" +#include "core/adios_logger.h" + +#ifdef DMALLOC +#include "dmalloc.h" +#endif + +#define ERRMSG_MAXLEN 256 + +// adios_errno is extern defined in adios_read.h and adiosf.c +int adios_errno; + +// string to store last error message +// cannot be static because adios_errmsg returns it +char aerr[ERRMSG_MAXLEN]; + +const char *adios_get_last_errmsg (void) +{ + return aerr; +} + +void adios_clear_error(void) +{ + memset (aerr, 0, ERRMSG_MAXLEN); + adios_errno = err_no_error; +} + +void adios_error (enum ADIOS_ERRCODES errcode, char *fmt, ...) +{ + va_list ap; + adios_errno = (int)errcode; + va_start(ap, fmt); + (void) vsnprintf(aerr, ERRMSG_MAXLEN, fmt, ap); + va_end(ap); + log_error("%s", aerr); +} + +void adios_error_at_line (enum ADIOS_ERRCODES errcode, const char* filename, unsigned int linenum, char *fmt, ...) +{ + va_list ap; + adios_errno = (int)errcode; + va_start(ap, fmt); + (void) vsnprintf(aerr, ERRMSG_MAXLEN, fmt, ap); + va_end(ap); + log_error("%s", aerr); +} + diff --git a/tests/libs/adios/src/core/adios_icee.h b/tests/libs/adios/src/core/adios_icee.h new file mode 100644 index 0000000000..1d75d011e5 --- /dev/null +++ b/tests/libs/adios/src/core/adios_icee.h @@ -0,0 +1,270 @@ +/* Auto-generated on Sat Sep 13 16:09:17 EDT 2014 */ + +#ifndef ADIOS_ICEE_H +#define ADIOS_ICEE_H + +#include +#include + +typedef struct icee_varinfo_rec { + char* varname; + int varid; + int type; + int typesize; + int ndims; + uint64_t* gdims; + uint64_t* ldims; + uint64_t* offsets; + uint64_t varlen; + char* data; + struct icee_varinfo_rec * next; +} icee_varinfo_rec_t, *icee_varinfo_rec_ptr_t; + +static FMField icee_varinfo_field_list[] = +{ + {"varname", "string", sizeof(char*), FMOffset(icee_varinfo_rec_ptr_t, varname)}, + {"varid", "integer", sizeof(int), FMOffset(icee_varinfo_rec_ptr_t, varid)}, + {"type", "integer", sizeof(int), FMOffset(icee_varinfo_rec_ptr_t, type)}, + {"typesize", "integer", sizeof(int), FMOffset(icee_varinfo_rec_ptr_t, typesize)}, + {"ndims", "integer", sizeof(int), FMOffset(icee_varinfo_rec_ptr_t, ndims)}, + {"gdims", "integer[ndims]", sizeof(uint64_t), FMOffset(icee_varinfo_rec_ptr_t, gdims)}, + {"ldims", "integer[ndims]", sizeof(uint64_t), FMOffset(icee_varinfo_rec_ptr_t, ldims)}, + {"offsets", "integer[ndims]", sizeof(uint64_t), FMOffset(icee_varinfo_rec_ptr_t, offsets)}, + {"varlen", "integer", sizeof(uint64_t), FMOffset(icee_varinfo_rec_ptr_t, varlen)}, + {"data", "char[varlen]", sizeof(char), FMOffset(icee_varinfo_rec_ptr_t, data)}, + {"next", "*icee_varinfo", sizeof(struct icee_varinfo_rec ), FMOffset(icee_varinfo_rec_ptr_t, next)}, + {NULL, NULL, 0, 0} +}; + +static FMStructDescRec icee_varinfo_format_list[] = +{ + {"icee_varinfo", icee_varinfo_field_list, sizeof(icee_varinfo_rec_t), NULL}, + {NULL, NULL} +}; + +/* Auto-generated on Sat Sep 13 16:09:17 EDT 2014 */ + +typedef struct icee_fileinfo_rec { + char* fname; + int nvars; + int nchunks; + int comm_size; + int comm_rank; + int merge_count; + int timestep; + struct icee_varinfo_rec * varinfo; + struct icee_fileinfo_rec * next; +} icee_fileinfo_rec_t, *icee_fileinfo_rec_ptr_t; + +static FMField icee_fileinfo_field_list[] = +{ + {"fname", "string", sizeof(char*), FMOffset(icee_fileinfo_rec_ptr_t, fname)}, + {"nvars", "integer", sizeof(int), FMOffset(icee_fileinfo_rec_ptr_t, nvars)}, + {"nchunks", "integer", sizeof(int), FMOffset(icee_fileinfo_rec_ptr_t, nchunks)}, + {"comm_size", "integer", sizeof(int), FMOffset(icee_fileinfo_rec_ptr_t, comm_size)}, + {"comm_rank", "integer", sizeof(int), FMOffset(icee_fileinfo_rec_ptr_t, comm_rank)}, + {"merge_count", "integer", sizeof(int), FMOffset(icee_fileinfo_rec_ptr_t, merge_count)}, + {"timestep", "integer", sizeof(int), FMOffset(icee_fileinfo_rec_ptr_t, timestep)}, + {"varinfo", "*icee_varinfo", sizeof(struct icee_varinfo_rec ), FMOffset(icee_fileinfo_rec_ptr_t, varinfo)}, + {"next", "*icee_fileinfo", sizeof(struct icee_fileinfo_rec ), FMOffset(icee_fileinfo_rec_ptr_t, next)}, + {NULL, NULL, 0, 0} +}; + +static FMStructDescRec icee_fileinfo_format_list[] = +{ + {"icee_fileinfo", icee_fileinfo_field_list, sizeof(icee_fileinfo_rec_t), NULL}, + {"icee_varinfo", icee_varinfo_field_list, sizeof(icee_varinfo_rec_t), NULL}, + {NULL, NULL} +}; + +/* Auto-generated on Thu Nov 6 14:06:32 EST 2014 */ + +/* +typedef struct icee_clientinfo_rec { + char* client_host; + int num_parallel; + int client_port; + int* stone_id; +} icee_clientinfo_rec_t, *icee_clientinfo_rec_ptr_t; + +static FMField icee_clientinfo_field_list[] = +{ + {"client_host", "string", sizeof(char*), FMOffset(icee_clientinfo_rec_ptr_t, client_host)}, + {"num_parallel", "integer", sizeof(int), FMOffset(icee_clientinfo_rec_ptr_t, num_parallel)}, + {"client_port", "integer", sizeof(int), FMOffset(icee_clientinfo_rec_ptr_t, client_port)}, + {"stone_id", "integer[num_parallel]", sizeof(int), FMOffset(icee_clientinfo_rec_ptr_t, stone_id)}, + {NULL, NULL, 0, 0} +}; + +static FMStructDescRec icee_clientinfo_format_list[] = +{ + {"icee_clientinfo", icee_clientinfo_field_list, sizeof(icee_clientinfo_rec_t), NULL}, + {NULL, NULL} +}; +*/ + +/* Auto-generated on Mon Nov 10 16:24:37 EST 2014 */ + +typedef struct icee_contactinfo_rec { + int stone_id; + char* contact_string; + struct icee_contactinfo_rec * next; +} icee_contactinfo_rec_t, *icee_contactinfo_rec_ptr_t; + +static FMField icee_contactinfo_field_list[] = +{ + {"stone_id", "integer", sizeof(int), FMOffset(icee_contactinfo_rec_ptr_t, stone_id)}, + {"contact_string", "string", sizeof(char*), FMOffset(icee_contactinfo_rec_ptr_t, contact_string)}, + {"next", "*icee_contactinfo", sizeof(struct icee_contactinfo_rec ), FMOffset(icee_contactinfo_rec_ptr_t, next)}, + {NULL, NULL, 0, 0} +}; + +static FMStructDescRec icee_contactinfo_format_list[] = +{ + {"icee_contactinfo", icee_contactinfo_field_list, sizeof(icee_contactinfo_rec_t), NULL}, + {NULL, NULL} +}; + +/* Auto-generated on Sat Nov 8 14:27:48 EST 2014 */ + +typedef struct icee_passivecheckin_rec { + int condition; +} icee_passivecheckin_rec_t, *icee_passivecheckin_rec_ptr_t; + +static FMField icee_passivecheckin_field_list[] = +{ + {"condition", "integer", sizeof(int), FMOffset(icee_passivecheckin_rec_ptr_t, condition)}, + {NULL, NULL, 0, 0} +}; + +static FMStructDescRec icee_passivecheckin_format_list[] = +{ + {"icee_passivecheckin", icee_passivecheckin_field_list, sizeof(icee_passivecheckin_rec_t), NULL}, + {NULL, NULL} +}; + +typedef void (*icee_passivecheckin_callback_t)(CManager cm, CMConnection conn, icee_passivecheckin_rec_t *m); + +typedef void (*icee_fileinfo_callback_t)(CManager cm, CMConnection conn, icee_fileinfo_rec_t *m); + +static void +icee_passivecheckin_request_handler(CManager cm, CMConnection conn, void *msg, void *client_data, attr_list attrs) +{ + icee_passivecheckin_rec_t *m = (icee_passivecheckin_rec_t*) msg; + icee_passivecheckin_callback_t cb; + + if (client_data) + { + cb = (icee_passivecheckin_callback_t) client_data; + (*cb)(cm, conn, m); + } + + CMFormat format = CMlookup_format(cm, icee_passivecheckin_format_list); + CMwrite(conn, format, (icee_passivecheckin_rec_t*) m); +} + +static void +icee_passivecheckin_reply_handler(CManager cm, CMConnection conn, void *msg, void *client_data, attr_list attrs) +{ + icee_passivecheckin_rec_t *m = (icee_passivecheckin_rec_t*) msg; + icee_passivecheckin_callback_t cb; + + if (client_data) + { + cb = (icee_passivecheckin_callback_t) client_data; + (*cb)(cm, conn, m); + } + + int condition = m->condition; + if (condition) + { + CMCondition_signal(cm, condition); + } +} + +static void +icee_fileinfo_recv_handler(CManager cm, CMConnection conn, void *msg, void *client_data, attr_list attrs) +{ + icee_fileinfo_rec_t *m = (icee_fileinfo_rec_t*) msg; + icee_fileinfo_callback_t cb; + + if (client_data) + { + cb = (icee_fileinfo_callback_t) client_data; + (*cb)(cm, conn, m); + } + + /* + int condition = m->condition; + if (condition) + { + CMCondition_signal(cm, condition); + } + */ +} + +/* + * Thread pool implementation + * Credit: Multithreaded Programming Guide by Oracle + * http://docs.oracle.com/cd/E19253-01/816-5137/6mba5vqn3/index.html + */ + +/* + * Declarations for the clients of a thread pool. + */ + +#include +#include + +typedef unsigned int uint_t; + +/* + * The thr_pool_t type is opaque to the client. + * It is created by thr_pool_create() and must be passed + * unmodified to the remainder of the interfaces. + */ +typedef struct thr_pool thr_pool_t; + +/* + * Create a thread pool. + * min_threads: the minimum number of threads kept in the pool, + * always available to perform work requests. + * max_threads: the maximum number of threads that can be + * in the pool, performing work requests. + * linger: the number of seconds excess idle worker threads + * (greater than min_threads) linger before exiting. + * attr: attributes of all worker threads (can be NULL); + * can be destroyed after calling thr_pool_create(). + * On error, thr_pool_create() returns NULL with errno set to the error code. + */ +extern thr_pool_t *thr_pool_create(uint_t min_threads, uint_t max_threads, + uint_t linger, pthread_attr_t *attr); + +/* + * Enqueue a work request to the thread pool job queue. + * If there are idle worker threads, awaken one to perform the job. + * Else if the maximum number of workers has not been reached, + * create a new worker thread to perform the job. + * Else just return after adding the job to the queue; + * an existing worker thread will perform the job when + * it finishes the job it is currently performing. + * + * The job is performed as if a new detached thread were created for it: + * pthread_create(NULL, attr, void *(*func)(void *), void *arg); + * + * On error, thr_pool_queue() returns -1 with errno set to the error code. + */ +extern int thr_pool_queue(thr_pool_t *pool, + void *(*func)(void *), void *arg); + +/* + * Wait for all queued jobs to complete. + */ +extern void thr_pool_wait(thr_pool_t *pool); + +/* + * Cancel all queued jobs and destroy the pool. + */ +extern void thr_pool_destroy(thr_pool_t *pool); + +#endif diff --git a/tests/libs/adios/src/core/adios_infocache.c b/tests/libs/adios/src/core/adios_infocache.c new file mode 100644 index 0000000000..6d458d0148 --- /dev/null +++ b/tests/libs/adios/src/core/adios_infocache.c @@ -0,0 +1,131 @@ +/* + * adios_infocache.c + * + * Created on: Nov 21, 2014 + * Author: David A. Boyuka II + */ + +#include +#include +#include "core/common_read.h" +#include "core/adios_infocache.h" + +// Utilities +static inline int min(int a, int b) { return a < b ? a : b; } +static inline int max(int a, int b) { return a > b ? a : b; } +#define MALLOC_ARRAY(arr,type,len) { (arr) = (type *)malloc((len) * sizeof(type)); } +#define CALLOC_ARRAY(arr,type,len) { (arr) = (type *)calloc((len), sizeof(type)); } +#define REALLOC_ARRAY(arr,type,len) { (arr) = (type *)realloc((arr), (len) * sizeof(type)); } + +#define MALLOC(type, var) type *var; MALLOC_ARRAY(var, type, 1); + +#define FREE(p) {if (p){free(p); (p)=NULL;}} + +#define INITIAL_INFOCACHE_SIZE 16 + +static void expand_infocache(adios_infocache *cache, int var_capacity) { + int i; + const int oldcap = cache->capacity; + const int newcap = max(max(oldcap * 2, var_capacity), INITIAL_INFOCACHE_SIZE); + + if (oldcap == 0) { + MALLOC_ARRAY(cache->physical_varinfos, ADIOS_VARINFO*, newcap); + MALLOC_ARRAY(cache->logical_varinfos, ADIOS_VARINFO*, newcap); + MALLOC_ARRAY(cache->transinfos, ADIOS_TRANSINFO*, newcap); + } else { + REALLOC_ARRAY(cache->physical_varinfos, ADIOS_VARINFO*, newcap); + REALLOC_ARRAY(cache->logical_varinfos, ADIOS_VARINFO*, newcap); + REALLOC_ARRAY(cache->transinfos, ADIOS_TRANSINFO*, newcap); + } + + for (i = oldcap; i < newcap; i++) { + cache->physical_varinfos[i] = NULL; + cache->logical_varinfos[i] = NULL; + cache->transinfos[i] = NULL; + } + + cache->capacity = newcap; +} + +adios_infocache * adios_infocache_new() { + MALLOC(adios_infocache, cache); + cache->capacity = 0; + cache->physical_varinfos = NULL; + cache->logical_varinfos = NULL; + cache->transinfos = NULL; + + expand_infocache(cache, INITIAL_INFOCACHE_SIZE); + return cache; +} + +static void invalidate_varinfo(ADIOS_VARINFO **varinfo_ptr) { + ADIOS_VARINFO *varinfo = *varinfo_ptr; + if (varinfo) { + common_read_free_varinfo(varinfo); + *varinfo_ptr = NULL; + } +} + +static void invalidate_transinfo(const ADIOS_VARINFO *phys_varinfo, ADIOS_TRANSINFO **transinfo_ptr) { + ADIOS_TRANSINFO *transinfo = *transinfo_ptr; + if (transinfo) { + common_read_free_transinfo(phys_varinfo, transinfo); + *transinfo_ptr = NULL; + } +} + +void adios_infocache_invalidate(adios_infocache *cache) { + int i; + for (i = 0; i < cache->capacity; i++) { + if (cache->physical_varinfos[i]) + invalidate_transinfo(cache->physical_varinfos[i], &cache->transinfos[i]); + invalidate_varinfo(&cache->physical_varinfos[i]); + invalidate_varinfo(&cache->logical_varinfos[i]); + } +} + +void adios_infocache_free(adios_infocache **cache_ptr) { + adios_infocache *cache = *cache_ptr; + + adios_infocache_invalidate(cache); // Frees all varinfos/transinfos + FREE(cache->physical_varinfos); + FREE(cache->logical_varinfos); + FREE(cache->transinfos); + cache->capacity = 0; + FREE(*cache_ptr); +} + +ADIOS_VARINFO * adios_infocache_inq_varinfo(const ADIOS_FILE *fp, adios_infocache *cache, int varid) { + if (varid >= cache->capacity) + expand_infocache(cache, varid + 1); + + // Choose the varinfo array corresponding to whether this inquiry is + // in the logical or physical view + const data_view_t view = common_read_get_data_view(fp); + ADIOS_VARINFO **varinfos = (view == PHYSICAL_DATA_VIEW) ? cache->physical_varinfos : cache->logical_varinfos; + ADIOS_VARINFO **varinfo = &varinfos[varid]; + + if (*varinfo) + return *varinfo; + else + return *varinfo = common_read_inq_var_byid(fp, varid); +} + +ADIOS_TRANSINFO * adios_infocache_inq_transinfo(const ADIOS_FILE *fp, adios_infocache *cache, int varid) { + if (varid >= cache->capacity) + expand_infocache(cache, varid + 1); + + if (cache->transinfos[varid]) { + return cache->transinfos[varid]; + } else { + // inq_var in physical view. It probably doesn't matter, but this is the "true" + // varinfo as seen by the transport layer, which is the layer to which we + // are about to pass the varinfo, so best to make it match. + // Note: violate constness temporarily, since we set the view right back again + const data_view_t old_view = common_read_set_data_view((ADIOS_FILE*)fp, PHYSICAL_DATA_VIEW); + ADIOS_VARINFO *vi = adios_infocache_inq_varinfo(fp, cache, varid); + common_read_set_data_view((ADIOS_FILE*)fp, old_view); + + return cache->transinfos[varid] = common_read_inq_transinfo(fp, vi); + } +} diff --git a/tests/libs/adios/src/core/adios_infocache.h b/tests/libs/adios/src/core/adios_infocache.h new file mode 100644 index 0000000000..19e4b63aae --- /dev/null +++ b/tests/libs/adios/src/core/adios_infocache.h @@ -0,0 +1,35 @@ +/* + * adios_infocache.h + * + * Provides a VARINFO/TRANSINFO cache for internal ADIOS use. Code wishing to avoid redundant + * calls to common_read_inq_var[_transinfo] should instead use the infocache functions as follows: + * + * ADIOS_VARINFO *raw_varinfo = adios_infocache_inq_varinfo(fp, internals->infocache, varid); //common_read_inq_var_raw_byid(fp, varid); // Get the *raw* varinfo + * ADIOS_TRANSINFO *transinfo = adios_infocache_inq_transinfo(fp, internals->infocache, varid); //common_read_inq_transinfo(fp, raw_varinfo); // Get the transform info (i.e. original var info) + * + * Created on: Nov 21, 2014 + * Author: David A. Boyuka II + */ +#ifndef ADIOS_INFOCACHE_H_ +#define ADIOS_INFOCACHE_H_ + +#include "public/adios_types.h" +#include "public/adios_read_v2.h" +#include "transforms/adios_transforms_transinfo.h" + +typedef struct { + int capacity; + ADIOS_VARINFO **physical_varinfos; + ADIOS_VARINFO **logical_varinfos; + ADIOS_TRANSINFO **transinfos; +} adios_infocache; + + +adios_infocache * adios_infocache_new(); +void adios_infocache_invalidate(adios_infocache *cache); +void adios_infocache_free(adios_infocache **cache_ptr); + +ADIOS_VARINFO * adios_infocache_inq_varinfo(const ADIOS_FILE *fp, adios_infocache *cache, int varid); +ADIOS_TRANSINFO * adios_infocache_inq_transinfo(const ADIOS_FILE *fp, adios_infocache *cache, int varid); + +#endif /* ADIOS_INFOCACHE_H_ */ diff --git a/tests/libs/adios/src/core/adios_internals.c b/tests/libs/adios/src/core/adios_internals.c new file mode 100644 index 0000000000..1895823840 --- /dev/null +++ b/tests/libs/adios/src/core/adios_internals.c @@ -0,0 +1,7758 @@ +/* + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + */ + +#include "config.h" /* VERSION_xxx */ +#include +#include +#include /* isdigit() */ +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "adios.h" +#include "core/adios_internals.h" +#include "core/adios_bp_v1.h" +#include "core/qhashtbl.h" +#include "core/adios_logger.h" + +#ifdef DMALLOC +#include "dmalloc.h" +#endif + +// NCSU ALACRITY-ADIOS - Added header file +#include "core/transforms/adios_transforms_common.h" +#include "core/transforms/adios_transforms_hooks.h" +#include "core/transforms/adios_transforms_read.h" +#include "core/transforms/adios_transforms_write.h" +#include "core/transforms/adios_transforms_specparse.h" + +struct adios_method_list_struct * adios_methods = 0; +struct adios_group_list_struct * adios_groups = 0; + +int adios_int_is_var (const char * temp) // 1 == yes, 0 == no +{ + if (!temp) + return 1; + + if (*temp == '-' || isdigit (*temp)) + { + temp++; + while (*temp) + { + if (isdigit (*temp)) + temp++; + else + return 1; + } + } + else + return 1; + + return 0; +} + +int adios_int_is_num (char * temp) // 1 == yes, 0 == no +{ + char * extra = 0; + + strtod (temp, &extra); + + if (extra) + return 0; + else + return 1; + + return 0; +} + +/** Find a variable in the hash table and return the pointer to the var struct. + * A full path is required (to match var->path+"/"+var->name) + */ +struct adios_var_struct * adios_find_var_by_name (struct adios_group_struct * g, + const char * fullpath) +{ + // Find variable in the hash table + return (struct adios_var_struct *) + g->hashtbl_vars->get (g->hashtbl_vars, fullpath); +} + +/* +struct adios_var_struct * adios_find_var_by_name (struct adios_var_struct * root + ,const char * name + ,enum ADIOS_FLAG unique_names + ) +{ + int done = 0; + struct adios_var_struct * var = 0; + + if (!name) + { + done = 1; + root = 0; + } + + while (!done && root) + { + char * compare_name = root->name; + char * compare_name_path = root->name; + if (unique_names == adios_flag_no) + { + compare_name_path = malloc ( strlen (root->name) + + strlen (root->path) + + 2 // null term and '/' + ); + if (!strcmp (root->path, "/")) + sprintf (compare_name_path, "/%s", root->name); + else + sprintf (compare_name_path, "%s/%s", root->path, root->name); + } + + if ( !strcasecmp (name, compare_name) + || ( unique_names == adios_flag_no + && !strcasecmp (name, compare_name_path) + ) + ) + { + done = 1; + var = root; + } + else + { + root = root->next; + } + + if (unique_names == adios_flag_no) + { + free (compare_name_path); + } + } + + return var; +} +*/ + +struct adios_attribute_struct * adios_find_attribute_by_name +(struct adios_attribute_struct * root + ,const char * name + ,enum ADIOS_FLAG unique_names + ) +{ + int done = 0; + struct adios_attribute_struct * attr = 0; + + if (!name) + { + done = 1; + root = 0; + } + + while (!done && root) + { + char * compare_name = root->name; + char * compare_name_path = root->name; + if (unique_names == adios_flag_no) + { + compare_name_path = malloc ( strlen (root->name) + + strlen (root->path) + + 2 // null term and '/' + ); + if (!root->path || !root->path[0]) + sprintf (compare_name_path, "%s", root->name); + else if (!strcmp (root->path, "/")) + sprintf (compare_name_path, "/%s", root->name); + else + sprintf (compare_name_path, "%s/%s", root->path, root->name); + } + + if ( !strcasecmp (name, compare_name) + || ( unique_names == adios_flag_no + && !strcasecmp (name, compare_name_path) + ) + ) + { + done = 1; + attr = root; + } + else + { + root = root->next; + } + + if (unique_names == adios_flag_no) + { + free (compare_name_path); + } + } + + return attr; +} + +struct adios_var_struct * adios_find_var_by_id (struct adios_var_struct * root + ,uint32_t id + ) +{ + while (root) + { + if (root->id == id) + return root; + else + root = root->next; + } + + return NULL; +} + +struct adios_attribute_struct * adios_find_attribute_by_id +(struct adios_attribute_struct * root + ,uint32_t id + ) +{ + while (root) + { + if (root->id == id) + return root; + else + root = root->next; + } + + return NULL; +} + +int adios_parse_dimension (const char * dimension + ,const char * global_dimension + ,const char * local_offset + ,struct adios_group_struct * g + ,struct adios_dimension_struct * dim + ) +{ + if (!dimension) + { + adios_error (err_dimension_required, "adios_parse_dimension: dimension not provided\n"); + + return 0; + } + + /* Get the local dimension */ + // one of the three fields below will be set, the other two remain 0 + dim->dimension.rank = 0; + dim->dimension.var = NULL; + dim->dimension.attr = NULL; + + dim->dimension.time_index = adios_flag_no; + if ( g->time_index_name && + !strcasecmp (g->time_index_name, dimension) + ) + { + /* this is time dimension */ + dim->dimension.time_index = adios_flag_yes; + } + else if (adios_int_is_var (dimension)) + { + struct adios_var_struct * var = 0; + dim->dimension.rank = 0; + var = adios_find_var_by_name (g, dimension); + if (!var) + { + struct adios_attribute_struct * attr = 0; + attr = adios_find_attribute_by_name (g->attributes, dimension + ,g->all_unique_var_names + ); + + if (!attr) + { + adios_error (err_invalid_dimension, + "config.xml: invalid var dimension: %s\n", + dimension); + + return 0; + } + else + { + if (attr->var) + { + switch (attr->var->type) + { + case adios_string: + case adios_real: + case adios_double: + case adios_long_double: + case adios_complex: + case adios_double_complex: + adios_error (err_invalid_var_as_dimension, + "config.xml: dimension defining var %s " + "pointed by attribute %s " + "has an invalid type: %s\n", + attr->var->name, + attr->name, + adios_type_to_string_int (attr->var->type)); + return 0; + + default: // the integral numeric types are all fine + break; + } + attr->var->is_dim = adios_flag_yes; + } + else + { + switch (attr->type) + { + case adios_string: + case adios_real: + case adios_double: + case adios_long_double: + case adios_complex: + case adios_double_complex: + adios_error (err_invalid_var_as_dimension, + "config.xml: dimension defining var %s " + "pointed by attribute %s " + "has an invalid type: %s\n", + attr->var->name, + attr->name, + adios_type_to_string_int (attr->type)); + return 0; + + default: // the integral numeric types are all fine + break; + } + } + dim->dimension.attr = attr; + } + } + else + { + switch (var->type) + { + case adios_string: + case adios_real: + case adios_double: + case adios_long_double: + case adios_complex: + case adios_double_complex: + adios_error (err_invalid_var_as_dimension, + "config.xml: dimension defining var %s " + "has an invalid type: %s\n", + var->name, + adios_type_to_string_int (var->type)); + return 0; + + default: // the integral numeric types are all fine + break; + } + + dim->dimension.var = var; + var->is_dim = adios_flag_yes; + } + } + else + { + dim->dimension.rank = atoi (dimension); + } + + if (!global_dimension) + { + adios_error (err_global_dim_required, + "adios_parse_dimension: global_dimension not provided\n"); + + return 0; + } + + /* Get the global dimension */ + dim->global_dimension.rank = 0; + dim->global_dimension.var = NULL; + dim->global_dimension.attr = NULL; + if (adios_int_is_var (global_dimension)) + { + struct adios_var_struct * var = 0; + var = adios_find_var_by_name (g, global_dimension); + if (!var) + { + struct adios_attribute_struct * attr = 0; + attr = adios_find_attribute_by_name (g->attributes, global_dimension + ,g->all_unique_var_names + ); + + if (!attr) + { + /* FIXME: Is time dimension allowed for global dim definition? + * What is this code doing here? */ + if ( g->time_index_name + && !strcasecmp (g->time_index_name, global_dimension) + ) + { + dim->global_dimension.time_index = adios_flag_yes; + } + else + { + adios_error (err_invalid_global_dimension, + "config.xml: invalid global-bounds dimension: %s\n", + global_dimension); + + return 0; + } + } + else + { + if (attr->var) + { + switch (attr->var->type) + { + case adios_string: + case adios_real: + case adios_double: + case adios_long_double: + case adios_complex: + case adios_double_complex: + adios_error (err_invalid_var_as_dimension, + "config.xml: global dimension defining var %s " + "pointed by attribute %s " + "has an invalid type: %s\n", + attr->var->name, + attr->name, + adios_type_to_string_int (attr->var->type)); + return 0; + + default: // the integral numeric types are all fine + break; + } + attr->var->is_dim = adios_flag_yes; + } + else + { + switch (attr->type) + { + case adios_string: + case adios_real: + case adios_double: + case adios_long_double: + case adios_complex: + case adios_double_complex: + adios_error (err_invalid_var_as_dimension, + "config.xml: global dimension defining var %s " + "pointed by attribute %s " + "has an invalid type: %s\n", + attr->var->name, + attr->name, + adios_type_to_string_int (attr->var->type)); + return 0; + + default: // the integral numeric types are all fine + break; + } + } + dim->global_dimension.attr = attr; + } + } + else + { + switch (var->type) + { + case adios_string: + case adios_real: + case adios_double: + case adios_long_double: + case adios_complex: + case adios_double_complex: + adios_error (err_invalid_var_as_dimension, + "config.xml: global dimension defining var %s " + "has an invalid type: %s\n", + var->name, + adios_type_to_string_int (var->type)); + return 0; + + default: // the integral numeric types are all fine + break; + } + var->is_dim = adios_flag_yes; + dim->global_dimension.var = var; + } + } + else + { + dim->global_dimension.rank = strtol (global_dimension, NULL, 10); + } + + if (!local_offset) + { + adios_error (err_offset_required, "adios_parse_dimension: local-offset not provided\n"); + + return 0; + } + + /* Get the local offset */ + dim->local_offset.rank = 0; + dim->local_offset.var = NULL; + dim->local_offset.attr = NULL; + if (adios_int_is_var (local_offset)) + { + struct adios_var_struct * var = 0; + var = adios_find_var_by_name (g, local_offset); + if (!var) + { + struct adios_attribute_struct * attr = 0; + attr = adios_find_attribute_by_name (g->attributes, local_offset + ,g->all_unique_var_names + ); + + if (!attr) + { + /* FIXME: Is time dimension allowed for offset definition? + * What is this code doing here? */ + + if ( g->time_index_name + && !strcasecmp (g->time_index_name, local_offset) + ) + { + dim->local_offset.time_index = adios_flag_yes; + } + else + { + adios_error (err_invalid_offset, + "config.xml: invalid var local_offset: %s\n", + local_offset); + + return 0; + } + } + else + { + if (attr->var) + { + switch (attr->var->type) + { + case adios_string: + case adios_real: + case adios_double: + case adios_long_double: + case adios_complex: + case adios_double_complex: + adios_error (err_invalid_var_as_dimension, + "config.xml: offset defining var %s " + "pointed by attribute %s " + "has an invalid type: %s\n", + attr->var->name, + attr->name, + adios_type_to_string_int (attr->var->type)); + return 0; + + default: // the integral numeric types are all fine + break; + } + attr->var->is_dim = adios_flag_yes; + } + else + { + switch (attr->type) + { + case adios_string: + case adios_real: + case adios_double: + case adios_long_double: + case adios_complex: + case adios_double_complex: + adios_error (err_invalid_var_as_dimension, + "config.xml: offset defining var %s " + "pointed by attribute %s " + "has an invalid type: %s\n", + attr->var->name, + attr->name, + adios_type_to_string_int (attr->var->type)); + return 0; + + default: // the integral numeric types are all fine + break; + } + } + dim->local_offset.attr = attr; + } + } + else + { + switch (var->type) + { + case adios_string: + case adios_real: + case adios_double: + case adios_long_double: + case adios_complex: + case adios_double_complex: + adios_error (err_invalid_var_as_dimension, + "config.xml: offset defining var %s " + "has an invalid type: %s\n", + var->name, + adios_type_to_string_int (var->type)); + return 0; + + default: // the integral numeric types are all fine + break; + } + var->is_dim = adios_flag_yes; + dim->local_offset.var = var; + } + } + else + { + dim->local_offset.rank = strtol (local_offset, NULL, 10); + } + + return 1; +} + +struct adios_method_list_struct * adios_get_methods () +{ + return adios_methods; +} + +struct adios_group_list_struct * adios_get_groups () +{ + return adios_groups; +} + + +int adios_parse_scalar_string (enum ADIOS_DATATYPES type, char * value, void ** out) +{ + char * end; + + switch (type) + { + case adios_byte: + case adios_short: + case adios_integer: + { + int errno_save = errno; + long t = strtol (value, &end, 10); + if (errno != errno_save || (end != 0 && *end != '\0')) + { + adios_error (err_invalid_argument, + "value: '%s' not valid integer\n",value); + return 0; + } + else + { + switch (type) + { + case adios_byte: + if (t < SCHAR_MIN || t > SCHAR_MAX) + { + adios_error (err_out_of_bound, + "type is %s, value " + "is out of range: '%s'\n", + adios_type_to_string_int (type), + value); + return 0; + } + else + { + *out = malloc (1); + *((int8_t *) *out) = t; + + return 1; + } + case adios_short: + if (t < SHRT_MIN || t > SHRT_MAX) + { + adios_error (err_out_of_bound, + "type is %s, value " + "is out of range: '%s'\n", + adios_type_to_string_int (type), + value); + return 0; + } + else + { + *out = malloc (2); + *((int16_t *) *out) = t; + + return 1; + } + case adios_integer: + if (t < INT_MIN || t > INT_MAX) + { + adios_error (err_out_of_bound, + "type is %s, value " + "is out of range: '%s'\n", + adios_type_to_string_int (type), + value); + return 0; + } + else + { + *out = malloc (4); + *((int32_t *) *out) = t; + + return 1; + } + default: + return 1; + } + } + } + case adios_long: + { + int errno_save = errno; + int64_t t = strtoll (value, &end, 10); + if (errno != errno_save || (end != 0 && *end != '\0')) + { + adios_error (err_out_of_bound, + "type is %s, value " + "is out of range: '%s'\n", + adios_type_to_string_int (type), + value); + return 0; + } + else + { + *out = malloc (8); + *((int64_t *) *out) = t; + + return 1; + } + } + case adios_unsigned_byte: + case adios_unsigned_short: + case adios_unsigned_integer: + { + int errno_save = errno; + unsigned long t = strtoul (value, &end, 10); + if (errno != errno_save || (end != 0 && *end != '\0')) + { + adios_error (err_invalid_argument, + "value: '%s' not valid integer\n", value); + return 0; + } + else + { + switch (type) + { + case adios_unsigned_byte: + if (t > UCHAR_MAX) + { + adios_error (err_out_of_bound, + "type is %s, value " + "is out of range: '%s'\n", + adios_type_to_string_int (type), + value); + return 0; + } + else + { + *out = malloc (1); + *((uint8_t *) *out) = t; + + return 1; + } + case adios_unsigned_short: + if (t > USHRT_MAX) + { + adios_error (err_out_of_bound, + "type is %s, value " + "is out of range: '%s'\n", + adios_type_to_string_int (type), + value); + return 0; + } + else + { + *out = malloc (2); + *((uint16_t *) *out) = t; + + return 1; + } + case adios_unsigned_integer: + if (t > UINT_MAX) + { + adios_error (err_out_of_bound, + "type is %s, value " + "is out of range: '%s'\n", + adios_type_to_string_int (type), + value); + return 0; + } + else + { + *out = malloc (4); + *((uint32_t *) *out) = t; + + return 1; + } + default: + return 1; + } + } + } + case adios_unsigned_long: + { + int errno_save = errno; + uint64_t t = strtoull (value, &end, 10); + if (errno != errno_save || (end != 0 && *end != '\0')) + { + adios_error (err_out_of_bound, + "type is %s, value " + "is out of range: '%s'\n", + adios_type_to_string_int (type), + value); + return 0; + } + else + { + *out = malloc (8); + *((uint64_t *) *out) = t; + + return 1; + } + } + case adios_real: + { + int errno_save = errno; + float t = strtof (value, &end); + if (errno != errno_save || (end != 0 && *end != '\0')) + { + adios_error (err_out_of_bound, + "type is %s, value " + "is out of range: '%s'\n", + adios_type_to_string_int (type), + value); + return 0; + } + else + { + *out = malloc (4); + *((float *) *out) = t; + + return 1; + } + } + case adios_double: + { + int errno_save = errno; + double t = strtod (value, &end); + if (errno != errno_save || (end != 0 && *end != '\0')) + { + adios_error (err_out_of_bound, + "type is %s, value " + "is out of range: '%s'\n", + adios_type_to_string_int (type), + value); + return 0; + } + else + { + *out = malloc (8); + *((double *) *out) = t; + + return 1; + } + } + case adios_long_double: + { + int errno_save = errno; + long double t = strtold (value, &end); + if (errno != errno_save || (end != 0 && *end != '\0')) + { + adios_error (err_out_of_bound, + "type is %s, value " + "is out of range: '%s'\n", + adios_type_to_string_int (type), + value); + return 0; + } + else + { + *out = malloc (16); + *((long double *) *out) = t; + } + } + case adios_string: + { + *out = (void *) strdup (value); + + return 1; + } + case adios_complex: + { + adios_error (err_unspecified, + "adios_parse_scalar_string: adios_complex type " + "validation needs to be implemented\n"); + return 1; + } + case adios_double_complex: + { + adios_error (err_unspecified, + "adios_parse_scalar_string: adios_double_complex type " + "validation needs to be implemented\n"); + return 1; + } + + case adios_unknown: + default: + adios_error (err_unspecified, + "adios_parse_scalar_string: unknown type cannot be validated\n"); + + return 0; + } + + return 1; +} + +int adios_common_define_attribute (int64_t group, const char * name + ,const char * path + ,enum ADIOS_DATATYPES type + ,const char * value + ,const char * var + ) +{ + struct adios_group_struct * g = (struct adios_group_struct *) group; + struct adios_attribute_struct * attr = (struct adios_attribute_struct *) + malloc (sizeof (struct adios_attribute_struct)); + + attr->name = strdup (name); + if (path) + attr->path = strdup (path); + else + attr->path = strdup (""); // not null but empty path + if (value) + { + if (type == adios_unknown) + { + adios_error (err_invalid_type_attr, + "config.xml: attribute element %s has invalid " + "type attribute\n", + name); + + free (attr->name); + free (attr->path); + free (attr); + + return 0; + } + attr->type = type; + if (adios_parse_scalar_string (type, (void *) value, &attr->value)) + { + attr->var = 0; + } + else + { + adios_error (err_invalid_value_attr, + "config.xml: attribute element %s has invalid " + "value attribute: '%s'\n", + name, value); + + free (attr->value); + free (attr->name); + free (attr->path); + free (attr); + + return 0; + } + } + else + { + attr->value = 0; + attr->type = adios_unknown; + attr->var = adios_find_var_by_name (g, var); + + if (attr->var == 0) + { + adios_error (err_invalid_varname, + "config.xml: attribute element %s references " + "var %s that has not been defined.\n", + name, var); + + free (attr->name); + free (attr->path); + free (attr); + + return 0; + } + } + + attr->next = 0; + attr->write_offset = 0; + + adios_append_attribute (&g->attributes, attr, ++g->member_count); + + return 1; +} + + +/* define an attribute by passing the value directly, not by a string */ +int adios_common_define_attribute_byvalue (int64_t group, const char * name + ,const char * path + ,enum ADIOS_DATATYPES type + ,void * value + ) +{ + struct adios_group_struct * g = (struct adios_group_struct *) group; + struct adios_attribute_struct * attr = (struct adios_attribute_struct *) + malloc (sizeof (struct adios_attribute_struct)); + uint64_t size; + + attr->name = strdup (name); + attr->path = strdup (path); + if (value) + { + if (type == adios_unknown) + { + adios_error (err_invalid_type_attr, + "config.xml: attribute element %s has invalid " + "type attribute\n", + name); + + free (attr->name); + free (attr->path); + free (attr); + + return 0; + } + attr->type = type; + size = adios_get_type_size (attr->type, value); + if (size > 0) + { + attr->value = malloc (size); + memcpy (attr->value, value, size); + attr->var = 0; + } + else + { + adios_error (err_invalid_value_attr, + "Attribute element %s has invalid " + "value attribute\n", name); + + free (attr->value); + free (attr->name); + free (attr->path); + free (attr); + + return 0; + } + } + else + { + adios_error (err_invalid_value_attr, + "Attribute element %s has invalid " + "value attribute\n", name); + + free (attr->name); + free (attr->path); + free (attr); + + return 0; + } + + attr->next = 0; + attr->write_offset = 0; + + adios_append_attribute (&g->attributes, attr, ++g->member_count); + + return 1; +} + +/*void adios_extract_string (char ** out, const char * in, int size) + { + if (in && out) + { + *out = malloc (strlen (in) + 1); + strcpy (*out, in); + } +// for some Fortran implementations, we get a size for a string. +// for others (like PGI), we don't and it isn't null terminated +// unless we do it explicitly. Assume that it is null terminated +// for now. +// +#if 0 +int i = 0; +memcpy (out, in, size); +while (i < size) +{ +if (out [i] == ' ') +{ +out [i] = 0; +return; +} +else +i++; +} +out [i] = 0; +#endif +}*/ + +void adios_append_method (struct adios_method_struct * method) +{ + struct adios_method_list_struct ** root = &adios_methods; + + while (root) + { + if (!*root) + { + struct adios_method_list_struct * new_node = + (struct adios_method_list_struct *) + malloc (sizeof (struct adios_method_list_struct)); + + if (!new_node) + { + adios_error (err_no_memory, "out of memory in adios_append_method\n"); + } + new_node->method = method; + new_node->next = 0; + + *root = new_node; + root = 0; + } + else + { + root = &(*root)->next; + } + } +} + +void adios_add_method_to_group (struct adios_method_list_struct ** root + ,struct adios_method_struct * method + ) +{ + while (root) + { + if (!*root) + { + struct adios_method_list_struct * new_node = + (struct adios_method_list_struct *) + malloc (sizeof (struct adios_method_list_struct)); + + if (!new_node) + { + adios_error (err_no_memory, "out of memory in adios_add_method_to_group\n"); + } + new_node->method = method; + new_node->next = 0; + + *root = new_node; + root = 0; + } + else + { + root = &(*root)->next; + } + } +} + +void adios_append_group (struct adios_group_struct * group) +{ + struct adios_group_list_struct ** root = &adios_groups; + int id = 1; + + while (root) + { + if (!*root) + { + struct adios_group_list_struct * new_node = + (struct adios_group_list_struct *) + malloc (sizeof (struct adios_group_list_struct)); + + if (!new_node) + { + adios_error (err_no_memory, "out of memory in adios_append_group\n"); + } + group->id = id; + new_node->group = group; + new_node->next = 0; + + *root = new_node; + root = 0; + } + else + { + root = &(*root)->next; + id++; + } + } +} + +static void adios_append_var (struct adios_group_struct * g, struct adios_var_struct * var) +{ + assert(g); + + /* Note: many routines parse the list of variables through the ->next pointer with + * "while (v) { ...; v=v->next } + * So we need have NULL as next in the last variable + */ + if (!g->vars) { + // first variable: g->vars : V => (null) + // g->vars_tail: V => (null) + var->next = NULL; + g->vars = var; // V => (null) + g->vars_tail = var; // V => (null) + } else { + var->next = NULL; + // append var to tail + g->vars_tail->next = var; // g->vars => ... => tail => V => (null) + // new tail is var + g->vars_tail = var; + } + + // Add variable to the hash table too + g->hashtbl_vars->put2(g->hashtbl_vars, var->path, var->name, var); +} + +// return is whether or not the name is unique +/* +enum ADIOS_FLAG adios_append_var (struct adios_var_struct ** root + ,struct adios_var_struct * var + ,uint16_t id + ) +{ + enum ADIOS_FLAG unique_names = adios_flag_yes; + + while (root) + { + if ( unique_names == adios_flag_yes + && *root + && !strcasecmp ((*root)->name, var->name) + ) + { + unique_names = adios_flag_no; + } + if (!*root) + { + var->id = id; + *root = var; + root = 0; + } + else + { + root = &(*root)->next; + } + } + + return unique_names; +} +*/ + +void adios_append_dimension (struct adios_dimension_struct ** root + ,struct adios_dimension_struct * dimension + ) +{ + while (root) + { + if (!*root) + { + *root = dimension; + root = 0; + } + else + { + root = &(*root)->next; + } + } +} + +void adios_append_attribute (struct adios_attribute_struct ** root + ,struct adios_attribute_struct * attribute + ,uint32_t id + ) +{ + while (root) + { + if (!*root) + { + attribute->id = id; + *root = attribute; + root = 0; + } + else + { + root = &(*root)->next; + } + } +} + +/////////////////////////////////////////////////////////////////////////////// +// functions to support C & Fortran interface +/////////////////////////////////////////////////////////////////////////////// +int adios_common_declare_group (int64_t * id, const char * name + ,enum ADIOS_FLAG host_language_fortran + ,const char * coordination_comm + ,const char * coordination_var + ,const char * time_index_name + ,enum ADIOS_FLAG stats + ) +{ + struct adios_group_struct * g = (struct adios_group_struct *) + malloc (sizeof (struct adios_group_struct)); + + g->name = strdup (name); + g->adios_host_language_fortran = host_language_fortran; + g->all_unique_var_names = adios_flag_no; + // ADIOS Schema: adding similar var for meshes + g->all_unique_mesh_names = adios_flag_yes; + g->id = 0; // will be set in adios_append_group + g->member_count = 0; // will be set in adios_append_group + g->vars = NULL; + g->vars_tail = NULL; + g->hashtbl_vars = qhashtbl(500); + g->vars_written = NULL; + g->vars_written_tail = NULL; + g->attributes = NULL; + g->group_by = (coordination_var ? strdup (coordination_var) : 0L); + g->group_comm = (coordination_comm ? strdup (coordination_comm) : 0L); + g->time_index_name = (time_index_name ? strdup (time_index_name) : 0L); + g->time_index = 0; + g->stats_on = stats; + g->process_id = 0; + g->methods = NULL; + // ADIOS Schema + g->meshs = NULL; + g->mesh_count = 0; + +#if defined ADIOS_TIMERS || defined ADIOS_TIMER_EVENTS + g->timing_obj = 0; + g->prev_timing_obj = 0; +#endif + + *id = (int64_t) g; + + adios_append_group (g); + + return 1; +} + +// Delete all attribute (definitions) from a group +int adios_common_delete_attrdefs (struct adios_group_struct * g) +{ + while (g->attributes) + { + struct adios_attribute_struct * attr = g->attributes; + g->attributes = g->attributes->next; + free (attr->value); + free (attr->name); + free (attr->path); + free (attr); + } +} + +// Delete all variable (definitions) from a group +int adios_common_delete_vardefs (struct adios_group_struct * g) +{ + // remove variables from the hashtable at once + g->hashtbl_vars->clear(g->hashtbl_vars); + + while (g->vars) + { + struct adios_var_struct * var = g->vars; + g->vars = g->vars->next; + + if (var->name) + free (var->name); + if (var->path) + free (var->path); + + while (var->dimensions) + { + struct adios_dimension_struct * dimensions + = var->dimensions->next; + + free (var->dimensions); + var->dimensions = dimensions; + } + + // NCSU - Clear Stat + if (var->stats) + { + uint8_t j = 0, idx = 0; + enum ADIOS_DATATYPES original_var_type = adios_transform_get_var_original_type_var(var); + uint8_t c = 0, count = adios_get_stat_set_count(original_var_type); + + for (c = 0; c < count; c ++) + { + while (var->bitmap >> j) + { + if ((var->bitmap >> j) & 1) + { + if (j == adios_statistic_hist) + { + struct adios_hist_struct * hist = (struct adios_hist_struct *) (var->stats[c][idx].data); + free (hist->breaks); + free (hist->frequencies); + free (hist); + } + else + free (var->stats[c][idx].data); + + idx ++; + } + j ++; + } + free (var->stats[c]); + } + free (var->stats); + } + + // NCSU ALACRITY-ADIOS - Clean transform metadata + adios_transform_clear_transform_var(var); + + if (var->data) + free (var->data); + + free (var); + } + + return 0; +} + +int adios_common_free_group (int64_t id) +{ + struct adios_group_list_struct * root = adios_groups; + struct adios_group_list_struct * old_root = adios_groups; + struct adios_group_struct * g = (struct adios_group_struct *) id; + + if (!root) + { + adios_error (err_unspecified, "Err in adios_common_free_group(): no groups left\n"); + return -1; + } + while (root && root->group->id != g->id) + { + old_root = root; + root = root->next; + }; + + if (!root) + { + // Didn't find the group + adios_error (err_unspecified, "Err in adios_common_free_group(): did not find requested group\n"); + return -1; + } + + // old_root->root->root next + if (root == adios_groups) + { + adios_groups = root->next; + } + else + { + old_root->next = root->next; + } + + if (g->name) free (g->name); + if (g->group_by) free (g->group_by); + if (g->group_comm) free (g->group_comm); + if (g->time_index_name) free (g->time_index_name); + + adios_common_delete_vardefs (g); + adios_common_delete_attrdefs (g); + g->hashtbl_vars->free(g->hashtbl_vars); + + free (root); + free (g); + + return 0; +} + +void trim_spaces (char * str) +{ + char * t = str, * p = NULL; + while (*t != '\0') + { + if (*t == ' ') + { + p = t + 1; + strcpy (t, p); + } + else + t++; + } + +} + +static void tokenize_dimensions (const char * str, char *** tokens, int * count) +{ + if (!str) + { + *tokens = 0; + *count = 0; + + return; + } + + char * save_str = strdup (str); + char * t = save_str; + int i; + + trim_spaces (save_str); + + if (strlen (save_str) > 0) + *count = 1; + else + { + *tokens = 0; + *count = 0; + free (save_str); + + return; + } + + while (*t) + { + if (*t == ',') + (*count)++; + t++; + } + + *tokens = (char **) malloc (sizeof (char **) * *count); + (*tokens) [0] = strdup (strtok (save_str, ",")); + for (i = 1; i < *count; i++) + { + (*tokens) [i] = strdup (strtok (NULL, ",")); + } + + free (save_str); +} + +static void cleanup_dimensions (char *** tokens, int * count) +{ + int i; + for (i = 0; i < *count; i++) + { + free ((*tokens) [i]); + } + free (*tokens); + *tokens = 0; + *count = 0; +} + +int adios_common_define_var_characteristics (struct adios_group_struct * g + , const char * var_name + , const char * bin_intervals + , const char * bin_min + , const char * bin_max + , const char * bin_count + ) +{ + struct adios_var_struct * var; + + var = adios_find_var_by_name (g, var_name); + + struct adios_hist_struct * hist; + + if (var->type == adios_complex || var->type == adios_double_complex) + return 0; + + int i = 0, j = 0; + while ((var->bitmap >> j) && (j < adios_statistic_hist)) + { + if ((var->bitmap >> j) & 1) + i ++; + j ++; + } + + hist = var->stats[0][i].data = (struct adios_hist_struct *) malloc (sizeof(struct adios_hist_struct)); + + if (!var) + { + adios_error (err_invalid_varname, + "config.xml: Didn't find the variable %s for analysis\n", + var_name); + return 0; + } + else + { + int i; + if (bin_intervals) + { + int count; + char ** bin_tokens = 0; + + tokenize_dimensions (bin_intervals, &bin_tokens, &count); + + if (!count) + { + adios_error (err_histogram_error, + "config.xml: unable to tokenize break points\n"); + return 0; + } + + hist->breaks = calloc(count, sizeof(double)); + + if(!hist || !hist->breaks) + { + adios_error (err_histogram_error, + "config.xml: unable to allocate memory for histogram break points in " + "adios_common_define_var_characteristics\n"); + return 0; + } + + for(i = 0; i < count; i++) + { + hist->breaks[i] = atof(bin_tokens[i]); + if(i > 0 && (hist->breaks[i] <= hist->breaks[i-1])) + { + adios_error (err_histogram_error, + "config.xml: break points should be in increasing order in " + "adios_common_define_var_characteristics\n"); + return 0; + } + } + + hist->num_breaks = count; + hist->min = hist->breaks[0]; + + if(count > 0) + hist->max = hist->breaks[count - 1]; + else + hist->max = hist->min; + + var->bitmap = var->bitmap | (1 << adios_statistic_hist); + } + else + { + if(!bin_max || !bin_min || !bin_count) + { + adios_error (err_histogram_error, + "config.xml: unable to generate break points\n"); + return 0; + } + + int count = atoi(bin_count); + + if (!count) + { + adios_error (err_histogram_error, + "config.xml: bin count is undefined\n"); + return 0; + } + + hist->num_breaks = count + 1; + hist->min = atof(bin_min); + hist->max = atof(bin_max); + hist->breaks = calloc(hist->num_breaks, sizeof(double)); + + if(!hist || !hist->breaks) + { + adios_error (err_no_memory, + "config.xml: unable to allocate memory for histogram break points in " + "adios_common_define_var_characteristics\n"); + return 0; + } + + if (hist->min >= hist->max) + { + adios_error (err_histogram_error, + "config.xml: minimum boundary value greater than maximum\n"); + return 0; + } + + for(i = 0; i < hist->num_breaks; i ++) + hist->breaks[i] = hist->min + i * (hist->max - hist->min) / count; + + var->bitmap = var->bitmap | (1 << adios_statistic_hist); + } + } + + + return 1; +} + +/* copy path but remove trailing / characters, and also + NULL path becomes "", so that we don't need to check for NULL everywhere +*/ +static char * dup_path (const char *path) +{ + char * p = NULL; + int len; + if (!path) + return strdup(""); + len = strlen (path); + /* remove trailing / characters */ + while (len > 1 && path[len-1] == '/') { + /* ends with '/' and it is not a single '/' */ + len--; + } + p = malloc (len+1); + if (!p) + return NULL; + strncpy (p, path, len); + p[len] = '\0'; + return p; +} + +int64_t adios_common_define_var (int64_t group_id, const char * name + ,const char * path, enum ADIOS_DATATYPES type + ,const char * dimensions + ,const char * global_dimensions + ,const char * local_offsets + ) +{ + struct adios_group_struct * t = (struct adios_group_struct *) group_id; + struct adios_var_struct * v = (struct adios_var_struct *) + malloc (sizeof (struct adios_var_struct)); + char * dim_temp; + char * g_dim_temp; + char * lo_dim_temp; + uint8_t i; + if (dimensions) + dim_temp = strdup (dimensions); + else + dim_temp = 0; + if (global_dimensions) + g_dim_temp = strdup (global_dimensions); + else + g_dim_temp = 0; + if (local_offsets) + lo_dim_temp = strdup (local_offsets); + else + lo_dim_temp = 0; + + v->name = strdup (name); + v->path = dup_path (path); // copy but remove trailing / characters, and NULL path becomes "" + //log_error ("define_var: name=%s, path=[%s], dup=[%s]\n", name, path, v->path); + v->type = type; + v->dimensions = 0; + v->is_dim = adios_flag_no; + v->got_buffer = adios_flag_no; + v->free_data = adios_flag_no; + v->parent_var = NULL; + + v->data = 0; + v->write_offset = 0; + + v->data_size = 0; + v->write_count = 0; + + v->next = 0; + + // NCSU - Initializing stat related info + v->stats = 0; + v->bitmap = 0; + + // NCSU ALACRITY-ADIOS - Initialize transform metadata (set to 'none') + adios_transform_init_transform_var(v); + + // Q.L. - Check whether stats are disabled or not + if (t->stats_on == adios_flag_yes) + { + // '1' at the bit location of stat id in adios_bp_v1.h, enables calculation of statistic. + for (i = 0; i < ADIOS_STAT_LENGTH; i++) + v->bitmap |= (1 << i); + + // Default values for histogram not yet implemented. Disabling it. + v->bitmap ^= (1 << adios_statistic_hist); + + // For complex numbers, the set of statistics occur thrice: stat[0] - magnitude, stat[1] - real, stat[2] - imaginary + if (v->type == adios_complex || v->type == adios_double_complex) + { + uint8_t c; + v->stats = malloc (3 * sizeof(struct adios_stat_struct *)); + + for (c = 0; c < 3; c ++) + v->stats[c] = calloc (ADIOS_STAT_LENGTH, sizeof(struct adios_stat_struct)); + } + else + { + v->stats = malloc (sizeof(struct adios_stat_struct *)); + v->stats[0] = calloc (ADIOS_STAT_LENGTH, sizeof(struct adios_stat_struct)); + } + } + + // NCSU - End of initializing stat related info + + if (dim_temp && strcmp (dim_temp, "")) + { + int dim_count; + char ** dim_tokens = 0; + + int g_dim_count; + char ** g_dim_tokens = 0; + + int lo_dim_count; + char ** lo_dim_tokens = 0; + + int i = 0; + + tokenize_dimensions (dim_temp, &dim_tokens, &dim_count); + tokenize_dimensions (g_dim_temp, &g_dim_tokens, &g_dim_count); + tokenize_dimensions (lo_dim_temp, &lo_dim_tokens, &lo_dim_count); + + while (i < dim_count) + { + int ret; + struct adios_dimension_struct * d = + (struct adios_dimension_struct *) + calloc (1, sizeof (struct adios_dimension_struct)); + + if (!d) + { + adios_error (err_no_memory, + "config.xml: out of memory in adios_common_define_var\n"); + + return 0; + } + char * dim = 0; + char * g_dim = "0"; + char * lo_dim = "0"; + + if (i < dim_count) + dim = dim_tokens [i]; + if (i < g_dim_count) + g_dim = g_dim_tokens [i]; + if (i < lo_dim_count) + lo_dim = lo_dim_tokens [i]; + + if (!(ret = adios_parse_dimension (dim, g_dim, lo_dim, t, d))) + { + free (dim_temp); + free (g_dim_temp); + free (lo_dim_temp); + free (v->name); + free (v->path); + free (v); + cleanup_dimensions (&dim_tokens, &dim_count); + cleanup_dimensions (&g_dim_tokens, &g_dim_count); + cleanup_dimensions (&lo_dim_tokens, &lo_dim_count); + + return 0; + } + + adios_append_dimension (&v->dimensions, d); + + i++; + } + cleanup_dimensions (&dim_tokens, &dim_count); + cleanup_dimensions (&g_dim_tokens, &g_dim_count); + cleanup_dimensions (&lo_dim_tokens, &lo_dim_count); + } + + if (dim_temp) + free (dim_temp); + if (g_dim_temp) + free (g_dim_temp); + if (lo_dim_temp) + free (lo_dim_temp); + + v->id = ++t->member_count; + adios_append_var (t, v); + + return (int64_t)v; +} + +/* Set the transformation method for a variable. Only one transformation will work for each variable */ +int adios_common_set_transform (int64_t var_id, const char *transform_type_str) +{ + struct adios_var_struct * v = (struct adios_var_struct *)var_id; + assert (v); + // NCSU ALACRITY-ADIOS - parse transform type string, and call the transform layer to + // set up the variable as needed + adios_transform_parse_spec(transform_type_str, v->transform_spec); + if (v->transform_spec->transform_type == adios_transform_unknown) { + adios_error(err_invalid_transform_type, + "Unknown transform type \"%s\" specified for variable \"%s\", ignoring it...\n", + v->transform_spec->transform_type_str ? v->transform_spec->transform_type_str : "", v->name); + v->transform_spec->transform_type = adios_transform_none; + } + + // This function sets the transform_type field. It does nothing if transform_type is none. + // Note: ownership of the transform_spec struct is given to this function + v = adios_transform_define_var(v); + return adios_errno; +} + + +void adios_common_get_group (int64_t * group_id, const char * name) +{ + struct adios_group_list_struct * g = adios_get_groups (); + + *group_id = 0; + + while (g) + { + if (!strcasecmp (g->group->name, name)) + { + *group_id = (int64_t) g->group; + + return; + } + + g = g->next; + } + + adios_error (err_invalid_group, + "adios-group '%s' not found in configuration file\n", + name); +} + +// ***************************************************************************** +static void buffer_write (char ** buffer, uint64_t * buffer_size + ,uint64_t * buffer_offset + ,const void * data, uint64_t size + ) +{ + if (*buffer_offset + size > *buffer_size || *buffer == 0) + { + char * b = realloc (*buffer, *buffer_offset + size + 1000000); + if (b) + { + *buffer = b; + *buffer_size = (*buffer_offset + size + 1000000); + } + else + { + adios_error (err_no_memory, "Cannot allocate memory in buffer_write. " + "Requested: %llu\n", *buffer_offset + size + 1000000); + return; + } + } + + memcpy (*buffer + *buffer_offset, data, size); + *buffer_offset += size; +} + +// NCSU ALACRITY-ADIOS - Genericized this to take a dimension struct, rather +// than the entire variable, so it can be used on the +// pre-transform dimension struct as well. +uint16_t adios_calc_var_characteristics_dims_overhead + (struct adios_dimension_struct * d) +{ + uint16_t overhead = 0; + //struct adios_dimension_struct * d = v->dimensions; + + overhead += 1; // count + overhead += 2; // length + + while (d) + { + overhead += 8 + 8 + 8; // the dims + + d = d->next; + } + + return overhead; +} + +// NCSU -This function precomputes the amount of overhead consumed by statistics +uint16_t adios_calc_var_characteristics_stat_overhead (struct adios_var_struct * var) +{ + uint16_t i, j, overhead; + + enum ADIOS_DATATYPES original_var_type = adios_transform_get_var_original_type_var (var); + overhead = j = i = 0; + + while (var->bitmap >> j) + { + // NCSU - This characteristic is present. It adds to the overhead + if ((var->bitmap >> j) & 1) + overhead += adios_get_stat_size(var->stats[0][i ++].data, original_var_type, j); + j ++; + } + + return overhead; +} + +static uint16_t adios_calc_var_characteristics_overhead(struct adios_var_struct * v) +{ + uint16_t overhead = 0; + + overhead += 1 + 4; // count + length + + enum ADIOS_DATATYPES original_var_type = adios_transform_get_var_original_type_var (v); + // struct adios_dimension_struct *original_dimensions = adios_transform_get_characteristic_original_dims_from_var (v); + + switch (original_var_type) + { + case adios_string: // nothing for strings + //overhead += 1; // id + //overhead += 2; // size + break; + + default: // the 12 numeric types + if (v->dimensions) + { + overhead += 1; // id for bitmap + overhead += 4; // value for bitmap + + overhead += 1; // id for statistics + // For complex numbers - min, max, avg repeated thrice + overhead += adios_get_stat_set_count(original_var_type) * adios_calc_var_characteristics_stat_overhead (v); + + // NCSU ALACRITY-ADIOS - Adding transform type field overhead calc + overhead += adios_transform_calc_transform_characteristic_overhead(v); + + overhead += 1; // id + overhead += adios_calc_var_characteristics_dims_overhead (v->dimensions); + } + break; + } + + return overhead; +} + +uint16_t adios_calc_var_overhead_v1 (struct adios_var_struct * v) +{ + uint16_t overhead = 0; + + struct adios_dimension_struct * d = v->dimensions; + + overhead += 8; // length of var entry + overhead += 4; // member id + overhead += 2; // length of name + overhead += strlen (v->name); // name + overhead += 2; // length of path + overhead += strlen (v->path); // path + overhead += 1; // datatype + overhead += 1; // used as a dimension flag + + overhead += 1; // ranks + overhead += 2; // dimensions length + while (d) + { + overhead += 1; // var flag + if ( d->dimension.var == NULL + && d->dimension.attr == NULL + && d->dimension.time_index == adios_flag_no + ) + { + overhead += 8; // value + } + else + { + overhead += 4; // member id + } + + overhead += 1; // var flag + if ( d->global_dimension.var == NULL + && d->global_dimension.attr == NULL + && d->global_dimension.time_index == adios_flag_no + ) + { + overhead += 8; // value + } + else + { + overhead += 4; // member id + } + + overhead += 1; // var flag + if ( d->local_offset.var == NULL + && d->local_offset.attr == NULL + && d->local_offset.time_index == adios_flag_no + ) + { + overhead += 8; // value + } + else + { + overhead += 4; // member id + } + + d = d->next; + } + overhead += adios_calc_var_characteristics_overhead (v); + + return overhead; +} + +uint32_t adios_calc_attribute_overhead_v1 (struct adios_attribute_struct * a) +{ + uint32_t overhead = 0; + + overhead += 4; // attribute length + overhead += 4; // member id + overhead += 2; // length of name + overhead += strlen (a->name); // name + overhead += 2; // length of path + overhead += strlen (a->path); // path + overhead += 1; // var flag + if (a->var) + overhead += 4; // var member id + else + { + overhead += 1; // datatype + overhead += 4; // length of value + overhead += adios_get_type_size (a->type, a->value); // value + } + + return overhead; +} + +uint64_t adios_calc_overhead_v1 (struct adios_file_struct * fd) +{ + uint64_t overhead = 0; + struct adios_var_struct * v = fd->group->vars; + struct adios_attribute_struct * a = fd->group->attributes; + struct adios_method_list_struct * m = fd->group->methods; + + overhead += 8; // process group length + overhead += 1; // host language flag + overhead += 2; // length of group name + overhead += strlen (fd->group->name); // group name + overhead += 4; // coordination var id + overhead += 2; // length of time index name + overhead += ((fd->group->time_index_name) + ? strlen (fd->group->time_index_name) + : 0 + ); // time index name + overhead += 4; // time index + + overhead += 1; // count of methods employed + overhead += 2; // length of methods section + + while (m) + { + overhead += 1; // method ID + overhead += 2; // method params length + overhead += strlen (m->method->parameters); + m = m->next; + } + + overhead += 4; // count of vars + overhead += 8; // length of vars section + + while (v) + { + overhead += adios_calc_var_overhead_v1 (v); + + v = v->next; + } + + overhead += 4; // attributes count + overhead += 8; // attributes length + + while (a) + { + overhead += adios_calc_attribute_overhead_v1 (a); + + a = a->next; + } + + return overhead; +} + +int adios_write_process_group_header_v1 (struct adios_file_struct * fd + ,uint64_t total_size + ) +{ + struct adios_group_struct * g = fd->group; + + uint8_t flag; + struct adios_var_struct * var; + uint16_t len; + + buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset, &total_size, 8); + + flag = (g->adios_host_language_fortran == adios_flag_yes ? 'y' : 'n'); + buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset, &flag, 1); + + len = strlen (g->name); + buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset, &len, 2); + + buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset, g->name, len); + + var = adios_find_var_by_name (g, g->group_by); + if (var) + { + buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset, &var->id, 4); + } + else + { + uint32_t i = 0; + buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset, &i, 4); + } + + len = ((g->time_index_name) ? strlen (g->time_index_name) : 0); + buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset, &len, 2); + + if (g->time_index_name) + { + buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset + ,g->time_index_name, len + ); + } + buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset + ,&g->time_index, 4 + ); + + struct adios_method_list_struct * m = fd->group->methods; + uint8_t methods_count = 0; + uint16_t methods_length = 0; + while (m) + { + methods_count++; + methods_length += 1 + 2 + strlen (m->method->parameters); + + m = m->next; + } + buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset + ,&methods_count, 1 + ); + buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset + ,&methods_length, 2 + ); + + m = fd->group->methods; + while (m) + { + uint16_t len = strlen (m->method->parameters); + + flag = (uint8_t) m->method->m; + buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset, &flag, 1); + + buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset, &len, 2); + + buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset + ,m->method->parameters, len + ); + + m = m->next; + } + + if (fd->bytes_written < fd->offset) + fd->bytes_written = fd->offset; + + return 0; +} + +static void index_append_process_group_v1 ( + struct adios_index_process_group_struct_v1 ** root + ,struct adios_index_process_group_struct_v1 * item + ) +{ + while (root) + { + if (!*root) + { + *root = item; + root = 0; + } + else + { + root = &(*root)->next; + } + } +} + +static void index_append_var_v1 ( + struct adios_index_struct_v1 *index + ,struct adios_index_var_struct_v1 * item + ) +{ + struct adios_index_var_struct_v1 * olditem; + + olditem = (struct adios_index_var_struct_v1 *) + index->hashtbl_vars->get2 (index->hashtbl_vars, + item->var_path, item->var_name); + + log_debug ("Hashtable size=%d\n", index->hashtbl_vars->size (index->hashtbl_vars)); + log_debug ("var tail = %p, name=%s\n", index->vars_tail, + (index->vars_tail ? index->vars_tail->var_name : "")); + if (!olditem) { + // new variable, insert into var list + if (!index->vars_root) { + log_debug (" Very first variable\n"); + // first variable: g->vars_written : V => (null) + // g->vars_written_tail: V => (null) + item->next = NULL; + index->vars_root = item; // V => (null) + index->vars_tail = item; // V => (null) + } else { + log_debug (" Append as new variable\n"); + item->next = NULL; + // append var to tail + index->vars_tail->next = item; // index->vars_root => ... => tail => V => (null) + // new tail is var + index->vars_tail = item; + } + // Add variable to the hash table too + index->hashtbl_vars->put2(index->hashtbl_vars, + item->var_path, item->var_name, item); + + } else { + // existing variable, add this item to its characteristics + log_debug (" Append to existing variable\n"); + + /* NOTE: old append made sure the variable mathes + * name + path + group name + type + * Here we just match name + path. We do not support same path + * in two groups, not to mention with two types + */ + if (strcmp (olditem->group_name, item->group_name)) + { + + adios_error (err_unspecified, "Error when merging variable index lists. " + "Variable in two different groups have the same path+name. " + "Groups: %s and %s, variable: path=%s, name=%s. " + "Index aborted\n", + olditem->group_name, item->group_name, + item->var_path, item->var_name); + return; + } + + if ( olditem->characteristics_count + + item->characteristics_count + > olditem->characteristics_allocated + ) + { + int new_items = (item->characteristics_count == 1) + ? 100 : item->characteristics_count; + olditem->characteristics_allocated = + olditem->characteristics_count + new_items; + void * ptr = realloc ( + olditem->characteristics, + olditem->characteristics_allocated * + sizeof (struct adios_index_characteristic_struct_v1) + ); + + if (ptr) + { + olditem->characteristics = ptr; + } + else + { + adios_error (err_no_memory, "error allocating memory to build " + "var index. Index aborted\n"); + return; + } + } + memcpy (&olditem->characteristics [olditem->characteristics_count], + item->characteristics, + item->characteristics_count * + sizeof (struct adios_index_characteristic_struct_v1) + ); + + olditem->characteristics_count += item->characteristics_count; + + free (item->characteristics); + free (item->group_name); + free (item->var_name); + free (item->var_path); + free (item); + } +} + +static void index_append_attribute_v1 +(struct adios_index_attribute_struct_v1 ** root + ,struct adios_index_attribute_struct_v1 * item + ) +{ + while (root) + { + if (!*root) + { + *root = item; + root = 0; + } + else + { + if ( !strcasecmp (item->group_name, (*root)->group_name) + && !strcasecmp (item->attr_name, (*root)->attr_name) + && !strcasecmp (item->attr_path, (*root)->attr_path) + ) + { + if ( (*root)->characteristics_count + + item->characteristics_count + > (*root)->characteristics_allocated + ) + { + int new_items = (item->characteristics_count == 1) + ? 100 : item->characteristics_count; + (*root)->characteristics_allocated = + (*root)->characteristics_count + new_items; + void * ptr; + ptr = realloc ((*root)->characteristics + , (*root)->characteristics_allocated + * sizeof (struct adios_index_characteristic_struct_v1) + ); + + if (ptr) + { + (*root)->characteristics = ptr; + } + else + { + adios_error (err_no_memory, "error allocating memory to build " + "attribute index. Index aborted\n"); + return; + } + } + memcpy (&(*root)->characteristics + [(*root)->characteristics_count] + ,item->characteristics + , item->characteristics_count + * sizeof (struct adios_index_characteristic_struct_v1) + ); + + (*root)->characteristics_count += item->characteristics_count; + + free (item->characteristics); + free (item->group_name); + free (item->attr_name); + free (item->attr_path); + free (item); + + root = 0; // exit the loop + } + else + { + root = &(*root)->next; + } + } + } +} + +// lists in new_index will be destroyed as part of the merge operation... +void adios_merge_index_v1 ( + struct adios_index_struct_v1 * main_index + ,struct adios_index_process_group_struct_v1 * new_pg_root + ,struct adios_index_var_struct_v1 * new_vars_root + ,struct adios_index_attribute_struct_v1 * new_attrs_root + ) +{ + // this will just add it on to the end and all should work fine + index_append_process_group_v1 (&main_index->pg_root, new_pg_root); + + // need to do vars attrs one at a time to merge them properly + struct adios_index_var_struct_v1 * v = new_vars_root; + struct adios_index_var_struct_v1 * v_temp; + struct adios_index_attribute_struct_v1 * a = new_attrs_root; + struct adios_index_attribute_struct_v1 * a_temp; + + while (v) + { + v_temp = v->next; + v->next = 0; + log_debug ("merge index var %s/%s\n", v->var_path, v->var_name); + index_append_var_v1 (main_index, v); + v = v_temp; + } + + while (a) + { + a_temp = a->next; + a->next = 0; + index_append_attribute_v1 (&main_index->attrs_root, a); + a = a_temp; + } +} + +// sort pg/var indexes by time index +void adios_sort_index_v1 (struct adios_index_process_group_struct_v1 ** p1 + ,struct adios_index_var_struct_v1 ** v1 + ,struct adios_index_attribute_struct_v1 ** a1 + ) +{ + struct adios_index_process_group_struct_v1 * p2 = 0, * p1_temp, * p2_temp, * p2_temp_prev; + struct adios_index_var_struct_v1 * v1_temp; + int i, j; + + while (*p1) + { + // if new index list is empty + if (!p2) + { + p2 = *p1; + *p1 = (*p1)->next; + p2->next = 0; + } + else + { + p2_temp = p2; + p2_temp_prev = p2; + + while (p2_temp && (*p1)->time_index >= p2_temp->time_index) + { + p2_temp_prev = p2_temp; + p2_temp = p2_temp->next; + } + + if (!p2_temp) + { + p2_temp_prev->next = *p1; + *p1 = (*p1)->next; + p2_temp_prev->next->next = 0; + } + else + { + p1_temp = (*p1)->next; + (*p1)->next = p2_temp; + p2_temp_prev->next = *p1; + + *p1 = p1_temp; + } + + } + } + + *p1 = p2; + + v1_temp = *v1; + + while (v1_temp) + { + for (i = 0; i < v1_temp->characteristics_count; i++) + { + for (j = 0; j < v1_temp->characteristics_count - i - 1; j++) + { + if (v1_temp->characteristics[j].time_index > v1_temp->characteristics[j + 1].time_index) + { + uint64_t t_offset; // beginning of the var or attr entry + struct adios_index_characteristic_dims_struct_v1 t_dims; + uint16_t t_var_id; + void * t_value; + uint64_t t_payload_offset; // beginning of the var or attr payload + uint32_t t_file_index; + uint32_t t_time_index; + + // NCSU - Statistics + uint32_t t_bitmap; + struct adios_index_characteristics_stat_struct ** t_stats; + + t_offset = v1_temp->characteristics[j].offset; + t_dims.count = v1_temp->characteristics[j].dims.count; + t_dims.dims = v1_temp->characteristics[j].dims.dims; + t_var_id = v1_temp->characteristics[j].var_id; + t_value = v1_temp->characteristics[j].value; + t_payload_offset = v1_temp->characteristics[j].payload_offset; + t_file_index = v1_temp->characteristics[j].file_index; + t_time_index = v1_temp->characteristics[j].time_index; + t_bitmap = v1_temp->characteristics[j].bitmap; + t_stats = v1_temp->characteristics[j].stats; + + v1_temp->characteristics[j].offset = v1_temp->characteristics[j + 1].offset; + v1_temp->characteristics[j].dims.count = v1_temp->characteristics[j + 1].dims.count; + v1_temp->characteristics[j].dims.dims = v1_temp->characteristics[j + 1].dims.dims; + v1_temp->characteristics[j].var_id = v1_temp->characteristics[j + 1].var_id; + v1_temp->characteristics[j].value = v1_temp->characteristics[j + 1].value; + v1_temp->characteristics[j].payload_offset = v1_temp->characteristics[j + 1].payload_offset; + v1_temp->characteristics[j].file_index = v1_temp->characteristics[j + 1].file_index; + v1_temp->characteristics[j].time_index = v1_temp->characteristics[j + 1].time_index; + v1_temp->characteristics[j].bitmap = v1_temp->characteristics[j + 1].bitmap; + v1_temp->characteristics[j].stats = v1_temp->characteristics[j + 1].stats; + + v1_temp->characteristics[j + 1].offset = t_offset; + v1_temp->characteristics[j + 1].dims.count = t_dims.count; + v1_temp->characteristics[j + 1].dims.dims = t_dims.dims; + v1_temp->characteristics[j + 1].var_id = t_var_id; + v1_temp->characteristics[j + 1].value = t_value; + v1_temp->characteristics[j + 1].payload_offset = t_payload_offset; + v1_temp->characteristics[j + 1].file_index = t_file_index; + v1_temp->characteristics[j + 1].time_index = t_time_index; + v1_temp->characteristics[j + 1].bitmap = t_bitmap; + v1_temp->characteristics[j + 1].stats = t_stats; + + // NCSU ALACRITY-ADIOS - Swap transform metadata + adios_transform_swap_transform_characteristics(&v1_temp->characteristics[j].transform, &v1_temp->characteristics[j + 1].transform); + } + } + } + + v1_temp = v1_temp->next; + } + + // no need to sort attributes +} + +static void adios_clear_process_groups_index_v1 ( + struct adios_index_process_group_struct_v1 * root + ) +{ + while (root) + { + struct adios_index_process_group_struct_v1 * temp = root->next; + if (root->group_name) + free (root->group_name); + if (root->time_index_name) + free (root->time_index_name); + free (root); + root = temp; + } +} + +// NCSU - Clears up the statistical data from variable index table +static void adios_clear_vars_index_v1 (struct adios_index_var_struct_v1 * root) +{ + while (root) + { + int i; + struct adios_index_var_struct_v1 * temp = root->next; + enum ADIOS_DATATYPES original_var_type = adios_transform_get_var_original_type_index (root); + + if (root->group_name) + free (root->group_name); + if (root->var_name) + free (root->var_name); + if (root->var_path) + free (root->var_path); + + for (i = 0; i < root->characteristics_count; i++) + { + if (root->characteristics [i].dims.count != 0) + free (root->characteristics [i].dims.dims); + if (root->characteristics [i].value) + free (root->characteristics [i].value); + + // NCSU - Clears up the statistical data, based on bitmap + if (root->characteristics [i].stats != 0) + { + uint8_t j = 0, idx = 0; + uint8_t c = 0, count = adios_get_stat_set_count(original_var_type); + + for (c = 0; c < count; c ++) + { + while (root->characteristics [i].bitmap >> j) + { + if ((root->characteristics [i].bitmap >> j) & 1) + { + if (j == adios_statistic_hist) + { + struct adios_index_characteristics_hist_struct * hist = (struct adios_index_characteristics_hist_struct *) root->characteristics [i].stats[c][idx].data; + free (hist->breaks); + free (hist->frequencies); + } + else + free (root->characteristics [i].stats[c][idx].data); + idx ++; + } + j ++; + } + free (root->characteristics [i].stats [c]); + } + + free (root->characteristics [i].stats); + } + + // NCSU ALACRITY-ADIOS - Clear the transform metadata + adios_transform_clear_transform_characteristic(&root->characteristics[i].transform); + } + if (root->characteristics) + free (root->characteristics); + + free (root); + root = temp; + } +} + +// NCSU - Clears up the statistical data, based on bitmap + static void adios_clear_attributes_index_v1 +(struct adios_index_attribute_struct_v1 * root) +{ + while (root) + { + int i; + struct adios_index_attribute_struct_v1 * temp = root->next; + enum ADIOS_DATATYPES var_type = root->type; + + if (root->group_name) + free (root->group_name); + if (root->attr_name) + free (root->attr_name); + if (root->attr_path) + free (root->attr_path); + for (i = 0; i < root->characteristics_count; i++) + { + if (root->characteristics [i].dims.count != 0) + free (root->characteristics [i].dims.dims); + + // NCSU - Clears up the statistical data, based on bitmap + if (root->characteristics [i].stats != 0) + { + uint8_t j = 0, idx = 0; + uint8_t c = 0, count = adios_get_stat_set_count(var_type); + for (c = 0; c < count; c ++) + { + while (root->characteristics [i].bitmap >> j) + { + if ((root->characteristics [i].bitmap >> j) & 1) + { + if (j == adios_statistic_hist) + { + struct adios_index_characteristics_hist_struct * hist = (struct adios_index_characteristics_hist_struct *) root->characteristics [i].stats[c][idx].data; + free (hist->breaks); + free (hist->frequencies); + free (hist); + } + else + free (root->characteristics [i].stats[c][idx].data); + + idx ++; + } + j ++; + } + free (root->characteristics [i].stats [c]); + } + free (root->characteristics [i].stats); + } + + // NCSU ALACRITY-ADIOS - Clear the transform metadata + adios_transform_clear_transform_characteristic(&root->characteristics[i].transform); + + if (root->characteristics [i].value) + free (root->characteristics [i].value); + } + + if (root->characteristics) + free (root->characteristics); + + free (root); + root = temp; + } +} + + +struct adios_index_struct_v1 * adios_alloc_index_v1 (int alloc_hashtables) +{ + struct adios_index_struct_v1 * index = (struct adios_index_struct_v1 *) + malloc (sizeof(struct adios_index_struct_v1)); + assert (index); + index->pg_root = NULL; + index->vars_root = NULL; + index->vars_tail = NULL; + index->attrs_root = NULL; + index->attrs_tail = NULL; + if (alloc_hashtables) { + index->hashtbl_vars = qhashtbl(500); + //index->hashtbl_attrs = qhashtbl(100); + index->hashtbl_attrs = NULL; // not used yet + } else { + index->hashtbl_vars = NULL; + index->hashtbl_attrs = NULL; + } + return index; +} + + + +void adios_free_index_v1 (struct adios_index_struct_v1 * index) +{ + if (!index) + return; + + if (index->hashtbl_vars) + index->hashtbl_vars->free (index->hashtbl_vars); + if (index->hashtbl_attrs) + index->hashtbl_attrs->free (index->hashtbl_attrs); + free(index); +} + +void adios_clear_index_v1 (struct adios_index_struct_v1 * index) +{ + if (!index) + return; + + adios_clear_process_groups_index_v1 (index->pg_root); + adios_clear_vars_index_v1 (index->vars_root); + adios_clear_attributes_index_v1 (index->attrs_root); + index->pg_root = NULL; + index->vars_root = NULL; + index->vars_tail = NULL; + index->attrs_root = NULL; + index->attrs_tail = NULL; + if (index->hashtbl_vars) + index->hashtbl_vars->clear (index->hashtbl_vars); + if (index->hashtbl_attrs) + index->hashtbl_attrs->clear (index->hashtbl_attrs); +} + +uint8_t count_dimensions (const struct adios_dimension_struct * dimensions) +{ + uint8_t count = 0; + + while (dimensions) + { + count++; + dimensions = dimensions->next; + } + + return count; +} + +static uint64_t cast_var_data_as_uint64 (const char * parent_name + ,enum ADIOS_DATATYPES type + ,void * data + ) +{ + if (!data) + { + adios_error (err_unspecified, + "cannot write var since dim %s not provided\n", + parent_name); + return 0; + } + + switch (type) + { + case adios_byte: + return (uint64_t) *(int8_t *) data; + + case adios_short: + return (uint64_t) *(int16_t *) data; + + case adios_integer: + return (uint64_t) *(int32_t *) data; + + case adios_long: + return (uint64_t) *(int64_t *) data; + + case adios_unsigned_byte: + return (uint64_t) *(uint8_t *) data; + + case adios_unsigned_short: + return (uint64_t) *(uint16_t *) data; + + case adios_unsigned_integer: + return (uint64_t) *(uint32_t *) data; + + case adios_unsigned_long: + return (uint64_t) *(uint64_t *) data; + + case adios_real: + return (uint64_t) *(float *) data; + + case adios_double: + return (uint64_t) *(double *) data; + + case adios_long_double: + return (uint64_t) *(long double *) data; + + case adios_string: + case adios_complex: + case adios_double_complex: + default: + adios_error (err_unspecified, + "Cannot convert type %s to integer for var %s\n", + adios_type_to_string_int (type), parent_name); + return 0; + } + return 0; +} + +uint64_t adios_get_dim_value (struct adios_dimension_item_struct * dimension) +{ + uint64_t dim = 0; + + if (dimension->var != 0) + { + struct adios_var_struct * var = dimension->var; + if (var->data) + { + dim = cast_var_data_as_uint64 (var->name, var->type, var->data); + } + else + { + adios_error (err_dimension_required, "array dimension data missing\n"); + } + } + else if (dimension->attr != 0) + { + struct adios_attribute_struct * attr = dimension->attr; + if (attr->var) + { + if (attr->var->data) + { + dim = cast_var_data_as_uint64 (attr->var->name,attr->var->type,attr->var->data); + } + else + { + adios_error (err_dimension_required, "array dimension data missing\n"); + } + } + else + { + dim = cast_var_data_as_uint64 (attr->name, attr->type ,attr->value); + } + } + else + { + if (dimension->time_index == adios_flag_yes) + dim = 1; + else + dim = dimension->rank; + } + + return dim; +} + +void adios_copy_var_written (struct adios_group_struct * g, struct adios_var_struct * var) +{ + assert(g); + struct adios_var_struct * var_new; + + var_new = (struct adios_var_struct *) malloc + (sizeof (struct adios_var_struct)); + var_new->id = var->id; + var_new->parent_var = var; + var_new->name = strdup (var->name); + var_new->path = strdup (var->path); + var_new->type = var->type; + var_new->dimensions = 0; + var_new->got_buffer = var->got_buffer; + var_new->is_dim = var->is_dim; + var_new->write_offset = var->write_offset; + var_new->stats = 0; + var_new->free_data = var->free_data; + var_new->data = 0; + var_new->data_size = var->data_size; + var_new->write_count = var->write_count; + var_new->next = 0; + + uint64_t size = adios_get_type_size (var->type, var->data); + switch (var->type) + { + case adios_byte: + case adios_unsigned_byte: + case adios_short: + case adios_unsigned_short: + case adios_integer: + case adios_unsigned_integer: + case adios_long: + case adios_unsigned_long: + case adios_real: + case adios_double: + case adios_long_double: + case adios_complex: + case adios_double_complex: + if (var->dimensions) + { + uint8_t c; + uint8_t j; + struct adios_dimension_struct * d = var->dimensions; + /* + * + * NOT ALL METHODS TRACK MIN/MAX. CHECK BEFORE TRYING TO COPY. + * + */ + // NCSU Statistics - copy stat to new var struct + enum ADIOS_DATATYPES original_var_type = adios_transform_get_var_original_type_var (var); + uint8_t count = adios_get_stat_set_count(original_var_type); + uint8_t idx = 0; + uint64_t characteristic_size; + + var_new->bitmap = var->bitmap; + var_new->stats = malloc (count * sizeof(struct adios_stat_struct *)); + + // Set of characteristics will be repeated thrice for complex numbers + for (c = 0; c < count; c ++) + { + var_new->stats[c] = calloc(ADIOS_STAT_LENGTH, sizeof (struct adios_stat_struct)); + + j = idx = 0; + while (var->bitmap >> j) + { + if ((var->bitmap >> j) & 1) + { + if (var->stats[c][idx].data != NULL) + { + if (j == adios_statistic_hist) + { + var_new->stats[c][idx].data = (struct adios_hist_struct *) malloc (sizeof(struct adios_hist_struct)); + + struct adios_hist_struct * var_hist = var->stats[c][idx].data; + struct adios_hist_struct * var_new_hist = var_new->stats[c][idx].data; + + var_new_hist->min = var_hist->min; + var_new_hist->max = var_hist->max; + var_new_hist->num_breaks = var_hist->num_breaks; + + var_new_hist->frequencies = malloc ((var_hist->num_breaks + 1) * adios_get_type_size(adios_unsigned_integer, "")); + memcpy (var_new_hist->frequencies, var_hist->frequencies, (var_hist->num_breaks + 1) * adios_get_type_size(adios_unsigned_integer, "")); + var_new_hist->breaks = malloc ((var_hist->num_breaks) * adios_get_type_size(adios_double, "")); + memcpy (var_new_hist->breaks, var_hist->breaks, (var_hist->num_breaks) * adios_get_type_size(adios_double, "")); + } + else + { + characteristic_size = adios_get_stat_size(var->stats[c][idx].data, original_var_type, j); + var_new->stats[c][idx].data = malloc (characteristic_size); + memcpy (var_new->stats[c][idx].data, var->stats[c][idx].data, characteristic_size); + } + + idx ++; + } + } + j ++; + } + } + + // NCSU ALACRITY-ADIOS - Copy transform metadata + adios_transform_copy_var_transform(var_new, var); + + c = count_dimensions (var->dimensions); + + for (j = 0; j < c; j++) + { + struct adios_dimension_struct * d_new = (struct adios_dimension_struct *) + malloc (sizeof (struct adios_dimension_struct)); + // de-reference dimension id + d_new->dimension.var = NULL; + d_new->dimension.attr = NULL; + d_new->dimension.rank = adios_get_dim_value (&d->dimension); + d_new->dimension.time_index = d->dimension.time_index; + d_new->global_dimension.var = NULL; + d_new->global_dimension.attr = NULL; + d_new->global_dimension.rank = adios_get_dim_value (&d->global_dimension); + d_new->global_dimension.time_index = d->global_dimension.time_index; + d_new->local_offset.var = NULL; + d_new->local_offset.attr = NULL; + d_new->local_offset.rank = adios_get_dim_value (&d->local_offset); + d_new->local_offset.time_index = d->local_offset.time_index; + d_new->next = 0; + + adios_append_dimension (&var_new->dimensions, d_new); + + d = d->next; + } + } + else + { + adios_transform_init_transform_var(var_new); + var_new->stats = 0; + var_new->data = malloc (size); + memcpy (var_new->data, var->data, size); + } + + break; + + case adios_string: + { + adios_transform_init_transform_var(var_new); + var_new->data = malloc (size + 1); + memcpy (var_new->data, var->data, size); + ((char *) (var_new->data)) [size] = 0; + + break; + } + default: + { + adios_error (err_unspecified, "Reached unexpected branch in %s:%s:%d\n", + __FILE__,__func__, __LINE__); + } + } + + /* Insert new variable into the copy list */ + + /* Note: many routines parse the list of variables through the ->next pointer with + * "while (v) { ...; v=v->next } + * So we don't make a double linked circular list, just a simple list, with + * having an extra pointer to the tail + */ + if (!g->vars_written) { + // first variable: g->vars_written : V => (null) + // g->vars_written_tail: V => (null) + var_new->next = NULL; + g->vars_written = var_new; // V => (null) + g->vars_written_tail = var_new; // V => (null) + } else { + var_new->next = NULL; + // append var to tail + g->vars_written_tail->next = var_new; // g->vars => ... => tail => V => (null) + // new tail is var + g->vars_written_tail = var_new; + } + +} + +#if 0 +void adios_copy_var_written (struct adios_var_struct ** root + ,struct adios_var_struct * var + ,struct adios_file_struct * fd + ) +{ + struct adios_var_struct * var_new; + + while (root) + { + if (!*root) + { + var_new = (struct adios_var_struct *) malloc + (sizeof (struct adios_var_struct)); + //var_new->id = ++fd->group->member_count; + var_new->id = var->id; + var_new->parent_var = var; + var_new->name = strdup (var->name); + var_new->path = strdup (var->path); + var_new->type = var->type; + var_new->dimensions = 0; + var_new->got_buffer = var->got_buffer; + var_new->is_dim = var->is_dim; + var_new->write_offset = var->write_offset; + var_new->stats = 0; + var_new->free_data = var->free_data; + var_new->data = 0; + var_new->data_size = var->data_size; + var_new->next = 0; + + uint64_t size = adios_get_type_size (var->type, var->data); + switch (var->type) + { + case adios_byte: + case adios_unsigned_byte: + case adios_short: + case adios_unsigned_short: + case adios_integer: + case adios_unsigned_integer: + case adios_long: + case adios_unsigned_long: + case adios_real: + case adios_double: + case adios_long_double: + case adios_complex: + case adios_double_complex: + if (var->dimensions) + { + uint8_t c; + uint8_t j; + struct adios_dimension_struct * d = var->dimensions; + + // NCSU ALACRITY-ADIOS - Copy transform metadata + adios_transform_copy_var_transform(fd, var_new, var); + + /* + * + * NOT ALL METHODS TRACK MIN/MAX. CHECK BEFORE TRYING TO COPY. + * + */ + + // NCSU Statistics - copy stat to new var struct + enum ADIOS_DATATYPES original_var_type = adios_transform_get_var_original_type_var (var); + uint8_t count = adios_get_stat_set_count(original_var_type); + uint8_t idx = 0; + uint64_t characteristic_size; + + var_new->bitmap = var->bitmap; + var_new->stats = malloc (count * sizeof(struct adios_stat_struct *)); + + // Set of characteristics will be repeated thrice for complex numbers + for (c = 0; c < count; c ++) + { + var_new->stats[c] = calloc(ADIOS_STAT_LENGTH, sizeof (struct adios_stat_struct)); + + j = idx = 0; + while (var->bitmap >> j) + { + if ((var->bitmap >> j) & 1) + { + if (var->stats[c][idx].data != NULL) + { + if (j == adios_statistic_hist) + { + var_new->stats[c][idx].data = (struct adios_hist_struct *) malloc (sizeof(struct adios_hist_struct)); + + struct adios_hist_struct * var_hist = var->stats[c][idx].data; + struct adios_hist_struct * var_new_hist = var_new->stats[c][idx].data; + + var_new_hist->min = var_hist->min; + var_new_hist->max = var_hist->max; + var_new_hist->num_breaks = var_hist->num_breaks; + + var_new_hist->frequencies = malloc ((var_hist->num_breaks + 1) * adios_get_type_size(adios_unsigned_integer, "")); + memcpy (var_new_hist->frequencies, var_hist->frequencies, (var_hist->num_breaks + 1) * adios_get_type_size(adios_unsigned_integer, "")); + var_new_hist->breaks = malloc ((var_hist->num_breaks) * adios_get_type_size(adios_double, "")); + memcpy (var_new_hist->breaks, var_hist->breaks, (var_hist->num_breaks) * adios_get_type_size(adios_double, "")); + } + else + { + characteristic_size = adios_get_stat_size(var->stats[c][idx].data, original_var_type, j); + var_new->stats[c][idx].data = malloc (characteristic_size); + memcpy (var_new->stats[c][idx].data, var->stats[c][idx].data, characteristic_size); + } + + idx ++; + } + } + j ++; + } + } + + c = count_dimensions (var->dimensions); + + for (j = 0; j < c; j++) + { + struct adios_dimension_struct * d_new = (struct adios_dimension_struct *) + malloc (sizeof (struct adios_dimension_struct)); + // de-reference dimension id + d_new->dimension.var = NULL; + d_new->dimension.attr = NULL; + d_new->dimension.rank = adios_get_dim_value (&d->dimension); + d_new->dimension.time_index = d->dimension.time_index; + d_new->global_dimension.var = NULL; + d_new->global_dimension.attr = NULL; + d_new->global_dimension.rank = adios_get_dim_value (&d->global_dimension); + d_new->global_dimension.time_index = d->global_dimension.time_index; + d_new->local_offset.var = NULL; + d_new->local_offset.attr = NULL; + d_new->local_offset.rank = adios_get_dim_value (&d->local_offset); + d_new->local_offset.time_index = d->local_offset.time_index; + d_new->next = 0; + + adios_append_dimension (&var_new->dimensions, d_new); + + d = d->next; + } + } + else + { + var_new->stats = 0; + var_new->data = malloc (size); + memcpy (var_new->data, var->data, size); + } + + break; + + case adios_string: + { + var_new->data = malloc (size + 1); + memcpy (var_new->data, var->data, size); + ((char *) (var_new->data)) [size] = 0; + + break; + } + } + + *root = var_new; + root = 0; + } + else + { + root = &(*root)->next; + } + } +} +#endif + +void adios_build_index_v1 (struct adios_file_struct * fd, + struct adios_index_struct_v1 * index) +{ + struct adios_group_struct * g = fd->group; + struct adios_var_struct * v = g->vars_written; + struct adios_attribute_struct * a = g->attributes; + struct adios_index_process_group_struct_v1 * g_item; + + g_item = (struct adios_index_process_group_struct_v1 *) + malloc (sizeof (struct adios_index_process_group_struct_v1)); + g_item->group_name = (g->name ? strdup (g->name) : 0L); + g_item->adios_host_language_fortran = g->adios_host_language_fortran; + g_item->process_id = g->process_id; + g_item->time_index_name = (g->time_index_name ? strdup (g->time_index_name) : 0L); + g_item->time_index = g->time_index; + g_item->offset_in_file = fd->pg_start_in_file; + g_item->next = 0; + + // build the groups and vars index + index_append_process_group_v1 (&index->pg_root, g_item); + + while (v) + { + // only add items that were written to the index + if (v->write_offset != 0) + { + struct adios_index_var_struct_v1 * v_index; + v_index = malloc (sizeof (struct adios_index_var_struct_v1)); + v_index->characteristics = malloc ( + sizeof (struct adios_index_characteristic_struct_v1) + ); + + v_index->id = v->id; + v_index->group_name = (g->name ? strdup (g->name) : 0L); + v_index->var_name = (v->name ? strdup (v->name) : 0L); + v_index->var_path = (v->path ? strdup (v->path) : 0L); + v_index->type = v->type; + v_index->characteristics_count = 1; + v_index->characteristics_allocated = 1; + v_index->characteristics [0].offset = v->write_offset; + // Find the old var in g->vars. + // We need this to calculate the correct payload_offset, because that + // holds the variable references in the dimensions, while v-> contains + // only numerical values + struct adios_var_struct * old_var = v->parent_var; + v_index->characteristics [0].payload_offset = v->write_offset + + adios_calc_var_overhead_v1 (old_var) + - strlen (old_var->path) // take out the length of path defined in XML + + strlen (v->path); // add length of the actual, current path of this var + v_index->characteristics [0].file_index = fd->subfile_index; + v_index->characteristics [0].time_index = g_item->time_index; + + v_index->characteristics [0].value = 0; + v_index->characteristics [0].dims.count = 0; + + // NCSU - Initializing stat related info in index + v_index->characteristics [0].bitmap = 0; + v_index->characteristics [0].stats = 0; + // NCSU ALACRITY-ADIOS - Initialize the transform metadata + adios_transform_init_transform_characteristic(&v_index->characteristics[0].transform); + //v_index->characteristics [0].transform_type = adios_transform_none; + + uint64_t size = adios_get_type_size (v->type, v->data); + switch (v->type) + { + case adios_byte: + case adios_unsigned_byte: + case adios_short: + case adios_unsigned_short: + case adios_integer: + case adios_unsigned_integer: + case adios_long: + case adios_unsigned_long: + case adios_real: + case adios_double: + case adios_long_double: + case adios_complex: + case adios_double_complex: + if (v->dimensions) + { + uint8_t c; + uint8_t j; + struct adios_dimension_struct * d = v->dimensions; + + // NCSU - Copy statistics from var struct to index + enum ADIOS_DATATYPES original_var_type = adios_transform_get_var_original_type_var (v); + + uint8_t count = adios_get_stat_set_count(original_var_type); + uint8_t idx = 0; + uint64_t characteristic_size; + + v_index->characteristics [0].bitmap = v->bitmap; + v_index->characteristics [0].stats = malloc (count * sizeof(struct adios_index_characteristics_stat_struct *)); + + // Set of characteristics will be repeated thrice for complex numbers + for (c = 0; c < count; c ++) + { + v_index->characteristics [0].stats[c] = calloc(ADIOS_STAT_LENGTH, sizeof (struct adios_index_characteristics_stat_struct)); + + j = idx = 0; + while (v_index->characteristics [0].bitmap >> j) + { + if ((v_index->characteristics [0].bitmap >> j) & 1) + { + if (v->stats[c][idx].data != NULL) + { + if (j == adios_statistic_hist) + { + v_index->characteristics [0].stats[c][idx].data = (struct adios_index_characteristics_hist_struct *) malloc (sizeof(struct adios_index_characteristics_hist_struct)); + + struct adios_hist_struct * v_hist = v->stats[c][idx].data; + struct adios_hist_struct * v_index_hist = v_index->characteristics [0].stats[c][idx].data; + + v_index_hist->min = v_hist->min; + v_index_hist->max = v_hist->max; + v_index_hist->num_breaks = v_hist->num_breaks; + + v_index_hist->frequencies = malloc ((v_hist->num_breaks + 1) * adios_get_type_size(adios_unsigned_integer, "")); + memcpy (v_index_hist->frequencies, v_hist->frequencies, (v_hist->num_breaks + 1) * adios_get_type_size(adios_unsigned_integer, "")); + v_index_hist->breaks = malloc ((v_hist->num_breaks) * adios_get_type_size(adios_double, "")); + memcpy (v_index_hist->breaks, v_hist->breaks, (v_hist->num_breaks) * adios_get_type_size(adios_double, "")); + } + else + { + characteristic_size = adios_get_stat_size(v->stats[c][idx].data, original_var_type, j); + v_index->characteristics [0].stats[c][idx].data = malloc (characteristic_size); + memcpy (v_index->characteristics [0].stats[c][idx].data, v->stats[c][idx].data, characteristic_size); + } + + idx ++; + } + } + j ++; + } + } + // NCSU - End of copy, for statistics + + // NCSU ALACRITY-ADIOS - copy transform type field + adios_transform_copy_transform_characteristic(&v_index->characteristics[0].transform, v); + + c = count_dimensions (v->dimensions); + v_index->characteristics [0].dims.count = c; + // (local, global, local offset) + v_index->characteristics [0].dims.dims = malloc + (3 * 8 * v_index->characteristics [0].dims.count); + for (j = 0; j < c; j++) + { + v_index->characteristics [0].dims.dims [j * 3 + 0] = + adios_get_dim_value (&d->dimension); + v_index->characteristics [0].dims.dims [j * 3 + 1] = + adios_get_dim_value (&d->global_dimension); + v_index->characteristics [0].dims.dims [j * 3 + 2] = + adios_get_dim_value (&d->local_offset); + + d = d->next; + } + v_index->characteristics [0].value = 0; + } + + if (v->data) + { + // NCSU - Copy statistics from var struct to index + v_index->characteristics [0].bitmap = 0; + v_index->characteristics [0].stats = 0; + // NCSU ALACRITY-ADIOS - Clear the transform metadata + // This is probably redundant with above code, but do it anyway to be safe + adios_transform_clear_transform_characteristic(&v_index->characteristics[0].transform); + + v_index->characteristics [0].value = malloc (size); + memcpy (v_index->characteristics [0].value, v->data + ,size + ); + v_index->characteristics [0].dims.count = 0; + v_index->characteristics [0].dims.dims = 0; + } + + break; + + case adios_string: + { + v_index->characteristics [0].value = malloc (size + 1); + memcpy (v_index->characteristics [0].value, v->data, size); + ((char *) (v_index->characteristics [0].value)) [size] = 0; + + break; + } + default: + { + adios_error (err_unspecified, "Reached unexpected branch in %s:%s:%d\n", + __FILE__,__func__, __LINE__); + } + } + v_index->next = 0; + + // this fn will either take ownership for free + log_debug ("build index var %s/%s\n", v_index->var_path, v_index->var_name); + index_append_var_v1 (index, v_index); + } + + v = v->next; + } + + while (a) + { + // only add items that were written to the index + if (a->write_offset != 0) + { + struct adios_index_attribute_struct_v1 * a_index; + a_index = malloc (sizeof (struct adios_index_attribute_struct_v1)); + a_index->characteristics = malloc ( + sizeof (struct adios_index_characteristic_struct_v1) + ); + + a_index->id = a->id; + a_index->group_name = (g->name ? strdup (g->name) : 0L); + a_index->attr_name = (a->name ? strdup (a->name) : 0L); + a_index->attr_path = (a->path ? strdup (a->path) : 0L); + a_index->type = a->type; + a_index->characteristics_count = 1; + a_index->characteristics_allocated = 1; + uint64_t size = adios_get_type_size (a->type, a->value); + + a_index->characteristics [0].offset = a->write_offset; + a_index->characteristics [0].payload_offset = a->write_offset + adios_calc_attribute_overhead_v1 (a); + a_index->characteristics [0].file_index = fd->subfile_index; + a_index->characteristics [0].time_index = 0; + + // NCSU - Initializing stat related info in attribute index + a_index->characteristics [0].bitmap = 0; + a_index->characteristics [0].stats = 0; + // NCSU ALACRITY-ADIOS - Initialize transform metadata + adios_transform_init_transform_characteristic(&a_index->characteristics[0].transform); + //a_index->characteristics[0].transform_type = adios_transform_none; + + if (a->value) + { + a_index->characteristics [0].value = malloc (size + 1); + ((char *) (a_index->characteristics [0].value)) [size] = 0; + memcpy (a_index->characteristics [0].value, a->value, size); + } + else + { + a_index->characteristics [0].value = 0; + } + a_index->characteristics [0].dims.count = 0; + a_index->characteristics [0].dims.dims = 0; + if (a->var) + a_index->characteristics [0].var_id = a->var->id; + else + a_index->characteristics [0].var_id = 0; + + a_index->next = 0; + + // this fn will either take ownership for free + index_append_attribute_v1 (&index->attrs_root, a_index); + } + + a = a->next; + } +} + +int adios_write_index_v1 (char ** buffer + ,uint64_t * buffer_size + ,uint64_t * buffer_offset + ,uint64_t index_start + ,struct adios_index_struct_v1 * index + ) +{ + uint64_t groups_count = 0; + uint32_t vars_count = 0; + uint32_t attrs_count = 0; + + uint64_t index_size = 0; + uint64_t pg_index_start = index_start; + uint64_t vars_index_start = 0; + uint64_t attrs_index_start = 0; + + // we need to save the offset we will write the count and size + uint64_t buffer_offset_start = 0; // since we realloc, we can't save a ptr + + struct adios_index_process_group_struct_v1 * pg_root = index->pg_root; + struct adios_index_var_struct_v1 * vars_root = index->vars_root; + struct adios_index_attribute_struct_v1 * attrs_root = index->attrs_root; + + // save for the process group index + buffer_offset_start = *buffer_offset; + + *buffer_offset += (8 + 8); // save space for groups count and index size + + while (pg_root) + { + uint8_t flag; + uint16_t len; + uint16_t group_size = 0; + uint64_t group_start = *buffer_offset; + + groups_count++; + + *buffer_offset += 2; // save space for the size + + len = strlen (pg_root->group_name); + buffer_write (buffer, buffer_size, buffer_offset, &len, 2); + index_size += 2; + group_size += 2; + buffer_write (buffer, buffer_size, buffer_offset + ,pg_root->group_name, len + ); + index_size += len; + group_size += len; + + flag = (pg_root->adios_host_language_fortran == adios_flag_yes ? 'y' + : 'n' + ); + buffer_write (buffer, buffer_size, buffer_offset, &flag, 1); + index_size += 1; + group_size += 1; + + buffer_write (buffer, buffer_size, buffer_offset + ,&pg_root->process_id, 4 + ); + index_size += 4; + group_size += 4; + + if (pg_root->time_index_name) + { + len = strlen (pg_root->time_index_name); + } + else + { + len = 0; + } + buffer_write (buffer, buffer_size, buffer_offset, &len, 2); + index_size += 2; + group_size += 2; + if (len) + { + buffer_write (buffer, buffer_size, buffer_offset + ,pg_root->time_index_name, len + ); + } + index_size += len; + group_size += len; + + buffer_write (buffer, buffer_size, buffer_offset + ,&pg_root->time_index, 4 + ); + index_size += 4; + group_size += 4; + buffer_write (buffer, buffer_size, buffer_offset + ,&pg_root->offset_in_file, 8 + ); + index_size += 8; + group_size += 8; + + buffer_write (buffer, buffer_size, &group_start, &group_size, 2); + + pg_root = pg_root->next; + } + + buffer_write (buffer, buffer_size, &buffer_offset_start, &groups_count, 8); + buffer_write (buffer, buffer_size, &buffer_offset_start, &index_size, 8); + + buffer_offset_start = *buffer_offset; // save to write the vars_count/size + vars_index_start = buffer_offset_start + index_start; + index_size = 0; + + *buffer_offset += (4 + 8); // save space for count and size + + while (vars_root) + { + uint8_t flag; + uint16_t len; + uint32_t var_size = 0; + uint64_t var_start = *buffer_offset; + int i; + + vars_count++; + + *buffer_offset += 4; // save space for var length + + buffer_write (buffer, buffer_size, buffer_offset, &vars_root->id, 4); + index_size += 4; + var_size += 4; + + len = strlen (vars_root->group_name); + buffer_write (buffer, buffer_size, buffer_offset, &len, 2); + index_size += 2; + var_size += 2; + buffer_write (buffer, buffer_size, buffer_offset + ,vars_root->group_name, len + ); + index_size += len; + var_size += len; + + len = strlen (vars_root->var_name); + buffer_write (buffer, buffer_size, buffer_offset, &len, 2); + index_size += 2; + var_size += 2; + buffer_write (buffer, buffer_size, buffer_offset + ,vars_root->var_name, len + ); + index_size += len; + var_size += len; + + len = strlen (vars_root->var_path); + buffer_write (buffer, buffer_size, buffer_offset, &len, 2); + index_size += 2; + var_size += 2; + buffer_write (buffer, buffer_size, buffer_offset + ,vars_root->var_path, len + ); + index_size += len; + var_size += len; + + flag = vars_root->type; + buffer_write (buffer, buffer_size, buffer_offset, &flag, 1); + index_size += 1; + var_size += 1; + + buffer_write (buffer, buffer_size, buffer_offset + ,&vars_root->characteristics_count, 8 + ); + index_size += 8; + var_size += 8; + + for (i = 0; i < vars_root->characteristics_count; i++) + { + uint64_t size; + uint8_t characteristic_set_count = 0; + uint32_t characteristic_set_length = 0; + // NCSU ALACRITY-ADIOS - Temp vars to store bytes/num + // characteristics written by a delegate write function. + uint64_t characteristic_write_length; + uint8_t characteristic_write_count; + + uint64_t characteristic_set_start = *buffer_offset; + *buffer_offset += 1 + 4; // save space for characteristic count/len + index_size += 1 + 4; + var_size += 1 + 4; + + // add an offset characteristic for all vars + characteristic_set_count++; + flag = (uint8_t) adios_characteristic_offset; + buffer_write (buffer, buffer_size, buffer_offset, &flag, 1); + index_size += 1; + var_size += 1; + characteristic_set_length += 1; + + buffer_write (buffer, buffer_size, buffer_offset + ,&vars_root->characteristics [i].offset, 8 + ); + index_size += 8; + var_size += 8; + characteristic_set_length += 8; + + // add a payload offset characteristic for all vars + characteristic_set_count++; + flag = (uint8_t) adios_characteristic_payload_offset; + buffer_write (buffer, buffer_size, buffer_offset, &flag, 1); + index_size += 1; + var_size += 1; + characteristic_set_length += 1; + + buffer_write (buffer, buffer_size, buffer_offset + ,&vars_root->characteristics [i].payload_offset, 8 + ); + index_size += 8; + var_size += 8; + characteristic_set_length += 8; + + // add a file index characteristic for all vars + characteristic_set_count++; + flag = (uint8_t) adios_characteristic_file_index; + buffer_write (buffer, buffer_size, buffer_offset, &flag, 1); + index_size += 1; + var_size += 1; + characteristic_set_length += 1; + + buffer_write (buffer, buffer_size, buffer_offset + ,&vars_root->characteristics [i].file_index, 4 + ); + index_size += 4; + var_size += 4; + characteristic_set_length += 4; + + // add a time index characteristic for all vars + characteristic_set_count++; + flag = (uint8_t) adios_characteristic_time_index; + buffer_write (buffer, buffer_size, buffer_offset, &flag, 1); + index_size += 1; + var_size += 1; + characteristic_set_length += 1; + + buffer_write (buffer, buffer_size, buffer_offset + ,&vars_root->characteristics [i].time_index, 4 + ); + index_size += 4; + var_size += 4; + characteristic_set_length += 4; + + // depending on if it is an array or not, generate a different + // additional set of characteristics + size = adios_get_type_size (vars_root->type + ,vars_root->characteristics [i].value + ); + + switch (vars_root->type) + { + case adios_byte: + case adios_unsigned_byte: + case adios_short: + case adios_unsigned_short: + case adios_integer: + case adios_unsigned_integer: + case adios_long: + case adios_unsigned_long: + case adios_real: + case adios_double: + case adios_long_double: + case adios_complex: + case adios_double_complex: + if (vars_root->characteristics [i].dims.count) + { + // add a dimensions characteristic + characteristic_set_count++; + flag = (uint8_t) adios_characteristic_dimensions; + buffer_write (buffer, buffer_size, buffer_offset + ,&flag, 1 + ); + index_size += 1; + var_size += 1; + characteristic_set_length += 1; + + buffer_write (buffer, buffer_size, buffer_offset + ,&vars_root->characteristics [i].dims.count + ,1 + ); + index_size += 1; + var_size += 1; + characteristic_set_length += 1; + + len = 3 * 8 * vars_root->characteristics [i].dims.count; + buffer_write (buffer, buffer_size, buffer_offset + ,&len, 2 + ); + index_size += 2; + var_size += 2; + characteristic_set_length += 2; + buffer_write (buffer, buffer_size, buffer_offset + ,vars_root->characteristics [i].dims.dims + ,len + ); + index_size += len; + var_size += len; + characteristic_set_length += len; + + // NCSU ALACRITY-ADIOS - Adding transform type field + characteristic_write_length = 0; + characteristic_write_count = + adios_transform_serialize_transform_characteristic( + &vars_root->characteristics[i].transform, + &characteristic_write_length, + buffer, buffer_size, buffer_offset + ); + + characteristic_set_count += characteristic_write_count; + index_size += characteristic_write_length; + var_size += characteristic_write_length; + characteristic_set_length += characteristic_write_length; + + // NCSU - Adding bitmap + characteristic_set_count++; + flag = (uint8_t) adios_characteristic_bitmap; + buffer_write (buffer, buffer_size, buffer_offset + ,&flag, 1 + ); + index_size += 1; + var_size += 1; + characteristic_set_length += 1; + + buffer_write (buffer, buffer_size, buffer_offset + ,&vars_root->characteristics [i].bitmap, 4 + ); + index_size += 4; + var_size += 4; + characteristic_set_length += 4; + + // NCSU - Adding statistics + characteristic_set_count++; + flag = (uint8_t) adios_characteristic_stat; + buffer_write (buffer, buffer_size, buffer_offset + ,&flag, 1 + ); + index_size += 1; + var_size += 1; + characteristic_set_length += 1; + + enum ADIOS_DATATYPES original_var_type = adios_transform_get_var_original_type_index (vars_root); + uint8_t count = adios_get_stat_set_count(original_var_type); + + uint8_t idx = 0, c, j; + uint64_t characteristic_size; + + for (c = 0; c < count; c ++) + { + j = idx = 0; + + while (vars_root->characteristics [i].bitmap >> j) + { + if ((vars_root->characteristics [i].bitmap >> j) & 1) + { + if (j == adios_statistic_hist) + { + struct adios_hist_struct * hist = vars_root->characteristics [i].stats[c][idx].data; + + buffer_write ( buffer, buffer_size, buffer_offset + , &hist->num_breaks, 4 + ); + characteristic_size = 4; + + buffer_write ( buffer, buffer_size, buffer_offset + , &hist->min, 8 + ); + characteristic_size += 8; + + buffer_write ( buffer, buffer_size, buffer_offset + , &hist->max, 8 + ); + characteristic_size += 8; + + buffer_write ( buffer, buffer_size, buffer_offset + , hist->frequencies, (hist->num_breaks + 1) * 4 + ); + characteristic_size += (hist->num_breaks + 1) * 4; + + buffer_write ( buffer, buffer_size, buffer_offset + , hist->breaks, hist->num_breaks * 8 + ); + characteristic_size += (hist->num_breaks) * 8; + } + else + { + characteristic_size = adios_get_stat_size(vars_root->characteristics [i].stats[c][idx].data, original_var_type, j); + + buffer_write ( buffer, buffer_size, buffer_offset + ,vars_root->characteristics [i].stats[c][idx].data, characteristic_size + ); + + } + + index_size += characteristic_size; + var_size += characteristic_size; + characteristic_set_length += characteristic_size; + + idx ++; + } + j ++; + } + } + // NCSU - End of addition statistic to buffer + + /* + characteristic_set_count++; + flag = (uint8_t) adios_characteristic_transform_type; + buffer_write (buffer, buffer_size, buffer_offset, &flag, 1); + index_size += 1; + var_size += 1; + characteristic_set_length += 1; + + buffer_write (buffer, buffer_size, buffer_offset, &vars_root->characteristics[i].transform_type, 1); + index_size += 1; + var_size += 1; + characteristic_set_length += 1; + */ + } + + if (vars_root->characteristics [i].value) + { + // add a value characteristic + characteristic_set_count++; + flag = (uint8_t) adios_characteristic_value; + buffer_write (buffer, buffer_size, buffer_offset + ,&flag, 1 + ); + index_size += 1; + var_size += 1; + characteristic_set_length += 1; + buffer_write (buffer, buffer_size, buffer_offset + ,vars_root->characteristics [i].value, size + ); + index_size += size; + var_size += size; + characteristic_set_length += size; + } + break; + + case adios_string: + { + // add a value characteristic + characteristic_set_count++; + flag = (uint8_t) adios_characteristic_value; + buffer_write (buffer, buffer_size, buffer_offset + ,&flag, 1 + ); + index_size += 1; + var_size += 1; + characteristic_set_length += 1; + if (vars_root->type == adios_string) + { + uint16_t len = (uint16_t) size; + buffer_write (buffer, buffer_size, buffer_offset + ,&len, 2 + ); + index_size += 2; + var_size += 2; + characteristic_set_length += 2; + } + buffer_write (buffer, buffer_size, buffer_offset + ,vars_root->characteristics [i].value, size + ); + index_size += size; + var_size += size; + characteristic_set_length += size; + } + break; + default: + { + adios_error (err_unspecified, "Reached unexpected branch in %s:%s:%d\n", + __FILE__,__func__, __LINE__); + } + } + // characteristics count/size prefix + buffer_write (buffer, buffer_size, &characteristic_set_start + ,&characteristic_set_count, 1 + ); + buffer_write (buffer, buffer_size, &characteristic_set_start + ,&characteristic_set_length, 4 + ); + } + + buffer_write (buffer, buffer_size, &var_start, &var_size, 4); + + vars_root = vars_root->next; + } + + log_debug ("%s: wrote %d variables into the var-index buffer\n", __func__, vars_count); + + // vars index count/size prefix + buffer_write (buffer, buffer_size, &buffer_offset_start, &vars_count, 4); + buffer_write (buffer, buffer_size, &buffer_offset_start, &index_size, 8); + + buffer_offset_start = *buffer_offset; // save to write the attrs_count/size + attrs_index_start = buffer_offset_start + index_start; + index_size = 0; + + *buffer_offset += (4 + 8); // save space for count and size + + while (attrs_root) + { + uint8_t flag; + uint16_t len; + uint32_t attr_size = 0; + uint64_t attr_start = *buffer_offset; + int i; + + attrs_count++; + + *buffer_offset += 4; // save space for attr length + + buffer_write (buffer, buffer_size, buffer_offset, &attrs_root->id, 4); + index_size += 4; + attr_size += 4; + + len = strlen (attrs_root->group_name); + buffer_write (buffer, buffer_size, buffer_offset, &len, 2); + index_size += 2; + attr_size += 2; + buffer_write (buffer, buffer_size, buffer_offset + ,attrs_root->group_name, len + ); + index_size += len; + attr_size += len; + + len = strlen (attrs_root->attr_name); + buffer_write (buffer, buffer_size, buffer_offset, &len, 2); + index_size += 2; + attr_size += 2; + buffer_write (buffer, buffer_size, buffer_offset + ,attrs_root->attr_name, len + ); + index_size += len; + attr_size += len; + + len = strlen (attrs_root->attr_path); + buffer_write (buffer, buffer_size, buffer_offset, &len, 2); + index_size += 2; + attr_size += 2; + buffer_write (buffer, buffer_size, buffer_offset + ,attrs_root->attr_path, len + ); + index_size += len; + attr_size += len; + + flag = attrs_root->type; + buffer_write (buffer, buffer_size, buffer_offset, &flag, 1); + index_size += 1; + attr_size += 1; + + buffer_write (buffer, buffer_size, buffer_offset + ,&attrs_root->characteristics_count, 8 + ); + index_size += 8; + attr_size += 8; + + for (i = 0; i < attrs_root->characteristics_count; i++) + { + uint64_t size; + uint8_t characteristic_set_count = 0; + uint32_t characteristic_set_length = 0; + + uint64_t characteristic_set_start = *buffer_offset; + *buffer_offset += 1 + 4; // save space for characteristic count/len + index_size += 1 + 4; + attr_size += 1 + 4; + + // add an offset characteristic for all attrs + characteristic_set_count++; + flag = (uint8_t) adios_characteristic_offset; + buffer_write (buffer, buffer_size, buffer_offset, &flag, 1); + index_size += 1; + attr_size += 1; + characteristic_set_length += 1; + + buffer_write (buffer, buffer_size, buffer_offset + ,&attrs_root->characteristics [i].offset, 8 + ); + index_size += 8; + attr_size += 8; + characteristic_set_length += 8; + + // add a payload offset characteristic for all attrs + characteristic_set_count++; + flag = (uint8_t) adios_characteristic_payload_offset; + buffer_write (buffer, buffer_size, buffer_offset, &flag, 1); + index_size += 1; + attr_size += 1; + characteristic_set_length += 1; + + buffer_write (buffer, buffer_size, buffer_offset + ,&attrs_root->characteristics [i].payload_offset, 8 + ); + index_size += 8; + attr_size += 8; + characteristic_set_length += 8; + + // add a file index characteristic for all attrs + characteristic_set_count++; + flag = (uint8_t) adios_characteristic_file_index; + buffer_write (buffer, buffer_size, buffer_offset, &flag, 1); + index_size += 1; + attr_size += 1; + characteristic_set_length += 1; + + buffer_write (buffer, buffer_size, buffer_offset + ,&attrs_root->characteristics [i].file_index, 4 + ); + index_size += 4; + attr_size += 4; + characteristic_set_length += 4; + + // add a time index characteristic for all attrs + characteristic_set_count++; + flag = (uint8_t) adios_characteristic_time_index; + buffer_write (buffer, buffer_size, buffer_offset, &flag, 1); + index_size += 1; + attr_size += 1; + characteristic_set_length += 1; + + buffer_write (buffer, buffer_size, buffer_offset + ,&attrs_root->characteristics [i].time_index, 4 + ); + index_size += 4; + attr_size += 4; + characteristic_set_length += 4; + + size = adios_get_type_size (attrs_root->type + ,attrs_root->characteristics [i].value + ); + + if (attrs_root->characteristics [i].value != 0) + { + // add a value characteristic + characteristic_set_count++; + flag = (uint8_t) adios_characteristic_value; + buffer_write (buffer, buffer_size, buffer_offset + ,&flag, 1 + ); + index_size += 1; + attr_size += 1; + characteristic_set_length += 1; + if (attrs_root->type == adios_string) + { + uint16_t len = (uint16_t) size; + buffer_write (buffer, buffer_size, buffer_offset + ,&len, 2 + ); + index_size += 2; + attr_size += 2; + characteristic_set_length += 2; + } + buffer_write (buffer, buffer_size, buffer_offset + ,attrs_root->characteristics [i].value, size + ); + index_size += size; + attr_size += size; + characteristic_set_length += size; + } + if (attrs_root->characteristics [i].var_id != 0) + { + // add a var id characteristic + characteristic_set_count++; + flag = (uint8_t) adios_characteristic_var_id; + buffer_write (buffer, buffer_size, buffer_offset + ,&flag, 1 + ); + index_size += 1; + attr_size += 1; + characteristic_set_length += 1; + buffer_write (buffer, buffer_size, buffer_offset + ,&attrs_root->characteristics [i].var_id, 4 + ); + index_size += 4; + attr_size += 4; + characteristic_set_length += 4; + } + + // characteristics count/size prefix + buffer_write (buffer, buffer_size, &characteristic_set_start + ,&characteristic_set_count, 1 + ); + buffer_write (buffer, buffer_size, &characteristic_set_start + ,&characteristic_set_length, 4 + ); + } + + buffer_write (buffer, buffer_size, &attr_start, &attr_size, 4); + + attrs_root = attrs_root->next; + } + + // attrs index count/size prefix + buffer_write (buffer, buffer_size, &buffer_offset_start, &attrs_count, 4); + buffer_write (buffer, buffer_size, &buffer_offset_start, &index_size, 8); + + + /* Since ADIOS 1.4 Write new information before the last 24+4 bytes into the footer + New information's format + 24 characters: ADIOS-BP v, padded with spaces up to 24 + 1 byte: major version + 1 byte: minor version + 1 byte: micro version + 1 byte: 0 + */ + { + char verstr[25] = " "; + unsigned char ver; + snprintf (verstr, 25, "ADIOS-BP v%-14.14s", VERSION); + buffer_write (buffer, buffer_size, buffer_offset, verstr, 24); + ver = VERSION_MAJOR; + buffer_write (buffer, buffer_size, buffer_offset, &ver, 1); + ver = VERSION_MINOR; + buffer_write (buffer, buffer_size, buffer_offset, &ver, 1); + ver = VERSION_MICRO; + buffer_write (buffer, buffer_size, buffer_offset, &ver, 1); + ver = 0; + buffer_write (buffer, buffer_size, buffer_offset, &ver, 1); + } + + // location of the beginning of the indexes (first proc groups then vars) + buffer_write (buffer, buffer_size, buffer_offset, &pg_index_start, 8); + buffer_write (buffer, buffer_size, buffer_offset, &vars_index_start, 8); + buffer_write (buffer, buffer_size, buffer_offset, &attrs_index_start, 8); + + return 0; +} + +int adios_write_version_v1 (char ** buffer + ,uint64_t * buffer_size + ,uint64_t * buffer_offset + ) +{ + uint32_t test = 1; + + if (!*(char *) &test) + test = 0x80000000; + else + test = 0; + + // version number 1 byte, endiness 1 byte, + // the rest is user-defined options 2 bytes + test += ADIOS_VERSION_BP_FORMAT; // file format version + // For the new read API to be able to read back older file format, + // set this flag + test |= ADIOS_VERSION_HAVE_TIME_INDEX_CHARACTERISTIC; + + test = htonl (test); + + buffer_write (buffer, buffer_size, buffer_offset, &test, 4); + + return 0; +} + +int adios_write_version_flag_v1 (char ** buffer + ,uint64_t * buffer_size + ,uint64_t * buffer_offset + ,uint32_t flag + ) +{ + uint32_t test = 1; + + if (!*(char *) &test) + test = 0x80000000; + else + test = 0; + + // version number 1 byte, endiness 1 byte, + // the rest is user-defined options 2 bytes + test += ADIOS_VERSION_BP_FORMAT; // file format version + // For the new read API to be able to read back older file format, + // set this flag + test |= ADIOS_VERSION_HAVE_TIME_INDEX_CHARACTERISTIC | flag; + + test = htonl (test); + + buffer_write (buffer, buffer_size, buffer_offset, &test, 4); + + return 0; +} + +static uint16_t calc_dimension_size (struct adios_dimension_struct * dimension) +{ + uint16_t size = 0; + + size += 1; // var (y or n) + + if ( dimension->dimension.var == NULL + && dimension->dimension.attr == NULL + && dimension->dimension.time_index == adios_flag_no + ) // it is a number + { + size += 8; // size of value + } + else // it is a var + { + size += 4; // size of var ID + } + + size += 1; // var (y or n) + + if ( dimension->global_dimension.var == NULL + && dimension->global_dimension.attr == NULL + && dimension->global_dimension.time_index == adios_flag_no + ) // it is a number + { + size += 8; // default to a rank + } + else + { + size += 4; // size of var ID + } + + size += 1; // var (y or n) + + if ( dimension->local_offset.var == NULL + && dimension->local_offset.var == NULL + && dimension->local_offset.time_index == adios_flag_no + ) // it is a number + { + size += 8; // default to a rank + } + else + { + size += 4; // size of var ID + } + + return size; +} + +static uint16_t calc_dimensions_size (struct adios_dimension_struct * dimension) +{ + uint16_t size = 0; + + while (dimension) + { + size += calc_dimension_size (dimension); + + dimension = dimension->next; + } + + return size; +} + +static +uint64_t adios_write_dimension_v1 (struct adios_file_struct * fd + ,struct adios_dimension_struct * dimension + ) +{ + uint64_t size = 0; + uint32_t id; + uint8_t var; + + if ( dimension->dimension.var == NULL + && dimension->dimension.attr == NULL + && dimension->dimension.time_index == adios_flag_no + ) + { + var = 'n'; + buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset, &var, 1); + size += 1; + buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset + ,&dimension->dimension.rank, 8 + ); + size += 8; + } + else + { + if (dimension->dimension.var != NULL) + id = dimension->dimension.var->id; + else if (dimension->dimension.attr != NULL) + id = dimension->dimension.attr->id; + else + id = 0; // just write this garbage + var = 'y'; + buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset, &var, 1); + size += 1; + buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset, &id, 4); + size += 4; + } + + if ( dimension->global_dimension.var == NULL + && dimension->global_dimension.attr == NULL + && dimension->global_dimension.time_index == adios_flag_no + ) + { + var = 'n'; + buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset, &var, 1); + size += 1; + buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset + ,&dimension->global_dimension.rank, 8 + ); + size += 8; + } + else + { + if (dimension->global_dimension.var != NULL) + id = dimension->global_dimension.var->id; + else if (dimension->global_dimension.attr != NULL) + id = dimension->global_dimension.attr->id; + else + id = 0; // just write this garbage + var = 'y'; + buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset, &var, 1); + size += 1; + buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset, &id, 4); + size += 4; + } + + if ( dimension->local_offset.var == NULL + && dimension->local_offset.attr == NULL + && dimension->local_offset.time_index == adios_flag_no + ) + { + var = 'n'; + buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset, &var, 1); + size += 1; + buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset + ,&dimension->local_offset.rank, 8 + ); + size += 8; + } + else + { + if (dimension->local_offset.var != NULL) + id = dimension->local_offset.var->id; + else if (dimension->local_offset.attr != NULL) + id = dimension->local_offset.attr->id; + else + id = 0; // just write this garbage + var = 'y'; + buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset, &var, 1); + size += 1; + buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset, &id, 4); + size += 4; + } + + return size; +} + +static +uint16_t adios_write_dimensions_v1 (struct adios_file_struct * fd + ,struct adios_dimension_struct * dimensions + ) +{ + uint16_t size = 0; + uint16_t dimensions_size = calc_dimensions_size (dimensions); + uint8_t ranks = count_dimensions (dimensions); + + buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset, &ranks, 1); + size += 1; + buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset, &dimensions_size, 2); + size += 2; + + while (dimensions) + { + size += adios_write_dimension_v1 (fd, dimensions); + + dimensions = dimensions->next; + } + + return size; +} + +uint16_t adios_write_var_characteristics_dims_v1 (struct adios_file_struct * fd + ,struct adios_var_struct * v + ) +{ + uint16_t total_size = 0; + uint8_t dims_count = 0; + uint16_t dims_length = 0; + struct adios_dimension_struct * d = v->dimensions; + uint64_t count_offset = fd->offset; + + fd->offset += 1; + total_size += 1; // count + + fd->offset += 2; + total_size += 2; // length + + while (d) + { + uint64_t dim = 0; + + dims_count++; + + dim = adios_get_dim_value (&d->dimension); + buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset, &dim, 8); + total_size += 8; + dims_length += 8; + + dim = adios_get_dim_value (&d->global_dimension); + buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset, &dim, 8); + total_size += 8; + dims_length += 8; + + dim = adios_get_dim_value (&d->local_offset); + buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset, &dim, 8); + total_size += 8; + dims_length += 8; + + d = d->next; + } + + buffer_write (&fd->buffer, &fd->buffer_size, &count_offset, &dims_count, 1); + buffer_write (&fd->buffer, &fd->buffer_size, &count_offset, &dims_length, 2); + + return total_size; +} + +uint16_t adios_write_var_characteristics_v1 (struct adios_file_struct * fd + ,struct adios_var_struct * v + ) +{ + uint8_t flag; + uint16_t len; + uint8_t characteristic_set_count = 0; + uint32_t characteristic_set_length = 0; + uint64_t index_size = 0; + + uint64_t characteristic_set_start = fd->offset; + fd->offset += 1 + 4; // save space for characteristic count/len + index_size += 1 + 4; + + // depending on if it is an array or not, generate a different + // additional set of characteristics + + switch (v->type) + { + case adios_byte: + case adios_unsigned_byte: + case adios_short: + case adios_unsigned_short: + case adios_integer: + case adios_unsigned_integer: + case adios_long: + case adios_unsigned_long: + case adios_real: + case adios_double: + case adios_long_double: + case adios_complex: + case adios_double_complex: + if (v->dimensions) + { + // add a dimensions characteristic + characteristic_set_count++; + flag = (uint8_t) adios_characteristic_dimensions; + buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset + ,&flag, 1 + ); + index_size += 1; + characteristic_set_length += 1; + + len = adios_write_var_characteristics_dims_v1 (fd, v); + index_size += len; + characteristic_set_length += len; + + // NCSU ALACRITY-ADIOS - Write transform metadata + // Transform has to be written before stats, because the + // original datatype is needed to determine the amount of data + // that needs to be read. This is not a problem during writes, + // but during reads. + uint64_t char_write_length = 0; + uint8_t char_write_count = 0; + + char_write_count = adios_transform_serialize_transform_var( + v, &char_write_length, &fd->buffer, &fd->buffer_size, &fd->offset); + + characteristic_set_count += char_write_count; + index_size += char_write_length; + characteristic_set_length += char_write_length; + + // NCSU - add the bitmap of characteristics + characteristic_set_count++; + flag = (uint8_t) adios_characteristic_bitmap; + buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset + ,&flag, 1 + ); + index_size += 1; + characteristic_set_length += 1; + + buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset + ,&v->bitmap, 4 + ); + index_size += 4; + characteristic_set_length += 4; + + // NCSU - add a stat value characteristic + characteristic_set_count++; + flag = (uint8_t) adios_characteristic_stat; + buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset + ,&flag, 1 + ); + index_size += 1; + characteristic_set_length += 1; + + uint8_t j, c; + enum ADIOS_DATATYPES original_var_type = adios_transform_get_var_original_type_var(v); + uint8_t count = adios_get_stat_set_count(original_var_type); + uint8_t idx = 0; + uint64_t characteristic_size; + + for (c = 0; c < count; c ++) + { + j = idx = 0; + while (v->bitmap >> j) + { + if ((v->bitmap >> j) & 1) + { + if (j == adios_statistic_hist) + { + struct adios_hist_struct * hist = v->stats[c][idx].data; + int32_t num_breaks = hist->num_breaks; + // Adding number of bins + buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset + ,&hist->num_breaks, 4 + ); + characteristic_size = 4; + + // Adding min bin + buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset + ,&hist->min, 8 + ); + characteristic_size += 8; + + // Adding max bin + buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset + ,&hist->max, 8 + ); + characteristic_size += 8; + + // add a frequencies value characteristic + buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset + ,hist->frequencies, 4 * (num_breaks + 1) + ); + characteristic_size += 4 * (num_breaks + 1); + + // add the breaks value characteristic + buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset + ,hist->breaks, 8 * num_breaks + ); + characteristic_size += 8 * num_breaks; + } + else + { + characteristic_size = adios_get_stat_size(v->stats[c][idx].data, original_var_type, j); + + buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset + ,v->stats[c][idx].data, characteristic_size + ); + } + + index_size += characteristic_size; + characteristic_set_length += characteristic_size; + idx ++; + } + j ++; + } + } + + + /* + characteristic_set_count++; + flag = (uint8_t) adios_characteristic_transform_type; + buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset + ,&flag, 1 + ); + index_size += 1; + characteristic_set_length += 1; + + buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset + ,&v->transform_type, 1 + ); + index_size += 1; + characteristic_set_length += 1; + */ + } + break; + + case adios_string: + break; + default: + break; + } + // characteristics count/size prefix + buffer_write (&fd->buffer, &fd->buffer_size, &characteristic_set_start + ,&characteristic_set_count, 1 + ); + buffer_write (&fd->buffer, &fd->buffer_size, &characteristic_set_start + ,&characteristic_set_length, 4 + ); + + + return index_size; +} + +int adios_generate_var_characteristics_v1 (struct adios_file_struct * fd, struct adios_var_struct * var) +{ + uint64_t total_size = 0; + uint64_t size = 0; + enum ADIOS_DATATYPES original_var_type = adios_transform_get_var_original_type_var(var); + + if (var->transform_type != adios_transform_none) { + total_size = adios_transform_get_pre_transform_var_size (var); + } else { + total_size = adios_get_var_size (var, var->data); + } + + if (var->bitmap == 0) + return 0; + + int32_t map[32]; + memset (map, -1, sizeof(map)); + +#if 1 +#define HIST(a) \ + { \ + int low, high, mid; \ + low=0; \ + high=hist->num_breaks - 1; \ + if (hist->breaks[low] > a) \ + hist->frequencies[0] += 1; \ + else if (a >= hist->breaks[high]) \ + hist->frequencies[high + 1] += 1; \ + else if (hist->breaks[low] <= a && a < hist->breaks[high]) \ + { \ + while(high-low>=2) \ + { \ + mid=(high+low)/2; \ + if(a >= hist->breaks[mid]) \ + { \ + low=mid; \ + } \ + else \ + { \ + high=mid; \ + } \ + } \ + hist->frequencies[low + 1] += 1; \ + } \ + } +#endif + +#if 1 +#define ADIOS_STATISTICS(a,b) \ +{\ + a * data = (a *) var->data; \ + int i, j; \ + struct adios_stat_struct * stats = var->stats[0]; \ + a * min, * max; \ + double * sum, * sum_square; \ + uint32_t * cnt; \ + struct adios_hist_struct * hist = 0; \ + i = j = 0; \ + while (var->bitmap >> j) { \ + if ((var->bitmap >> j) & 1) {\ + map [j] = i; \ + if (j == adios_statistic_hist) \ + ;\ + else \ + stats[i].data = malloc(adios_get_stat_size(NULL, original_var_type, j)); \ + i ++; \ + } \ + j ++; \ + } \ + min = (a *) stats[map[adios_statistic_min]].data; \ + max = (a *) stats[map[adios_statistic_max]].data; \ + sum = (double *) stats[map[adios_statistic_sum]].data; \ + sum_square = (double *) stats[map[adios_statistic_sum_square]].data; \ + cnt = (uint32_t *) stats[map[adios_statistic_cnt]].data; \ + *cnt = 0;\ + if (map[adios_statistic_hist] != -1) {\ + hist = (struct adios_hist_struct *) stats[map[adios_statistic_hist]].data; \ + hist->frequencies = calloc ((hist->num_breaks + 1), adios_get_type_size(adios_unsigned_integer, "")); \ + } \ + int finite = 0; \ + size = 0; \ + while ((size * b) < total_size) \ + { \ + if (isnan (data [size]) || !isfinite (data [size])) {\ + size ++; \ + continue; \ + }\ + if (!finite) { \ + *min = data [size]; \ + *max = data [size]; \ + *sum = data [size]; \ + *sum_square = (data [size] * data [size]) ; \ + *cnt = *cnt + 1; \ + if (map[adios_statistic_hist] != -1) \ + HIST(data [size]); \ + finite = 1; \ + size ++; \ + continue; \ + } \ + if (data [size] < *min) \ + *min = data [size]; \ + if (data [size] > *max) \ + *max = data [size]; \ + *sum += data [size]; \ + *sum_square += (data [size] * data [size]) ; \ + *cnt = *cnt + 1; \ + if (map[adios_statistic_hist] != -1) \ + HIST(data [size]); \ + size++; \ + } \ + if (map[adios_statistic_finite] != -1) \ + * ((uint8_t * ) stats[map[adios_statistic_finite]].data) = finite; \ + return 0; \ + } +#else +#define MIN_MAX(a,b)\ + {\ + a * data = (a *) var->data; \ + var->min = malloc (b); \ + var->max = malloc (b); \ + a * min = (a *) var->min; \ + a * max = (a *) var->max; \ + *min = data [0]; \ + *max = data [0]; \ + return 0; \ + } +#endif + + switch (original_var_type) + { + case adios_byte: + ADIOS_STATISTICS(int8_t,1) + + case adios_unsigned_byte: + ADIOS_STATISTICS(uint8_t,1) + + case adios_short: + ADIOS_STATISTICS(int16_t,2) + + case adios_unsigned_short: + ADIOS_STATISTICS(uint16_t,2) + + case adios_integer: + ADIOS_STATISTICS(int32_t,4) + + case adios_unsigned_integer: + ADIOS_STATISTICS(uint32_t,4) + + case adios_long: + ADIOS_STATISTICS(int64_t,8) + + case adios_unsigned_long: + ADIOS_STATISTICS(uint64_t,8) + + case adios_real: + ADIOS_STATISTICS(float,4) + + case adios_double: + ADIOS_STATISTICS(double,8) + + case adios_long_double: + ADIOS_STATISTICS(long double,16) + + case adios_complex: + { + int i, j, c, count = 3; + struct adios_stat_struct ** stats = var->stats; + float * data = var->data; + i = j = 0; + + while (var->bitmap >> j) { + if ((var->bitmap >> j) & 1) { + map [j] = i; + for (c = 0; c < count; c ++) + if (j != adios_statistic_hist) + stats[c][i].data = malloc(adios_get_stat_size(NULL, original_var_type, j)); + i ++; + } + j ++; + } + + double *min_i, *min_r, *min_m; + double *max_i, *max_r, *max_m; + double *sum_i, *sum_r, *sum_m; + double *sum_square_i, *sum_square_r, *sum_square_m; + //struct adios_hist_struct *hist, *hist_i, *hist_r, *hist_m; + uint32_t *cnt_i, *cnt_r, *cnt_m; + double magnitude; + uint8_t finite = 0; + + min_m = (double *) stats[0][map[adios_statistic_min]].data; + min_r = (double *) stats[1][map[adios_statistic_min]].data; + min_i = (double *) stats[2][map[adios_statistic_min]].data; + + max_m = (double *) stats[0][map[adios_statistic_max]].data; + max_r = (double *) stats[1][map[adios_statistic_max]].data; + max_i = (double *) stats[2][map[adios_statistic_max]].data; + + sum_m = (double *) stats[0][map[adios_statistic_sum]].data; + sum_r = (double *) stats[1][map[adios_statistic_sum]].data; + sum_i = (double *) stats[2][map[adios_statistic_sum]].data; + + sum_square_m = (double *) stats[0][map[adios_statistic_sum_square]].data; + sum_square_r = (double *) stats[1][map[adios_statistic_sum_square]].data; + sum_square_i = (double *) stats[2][map[adios_statistic_sum_square]].data; + + cnt_m = (uint32_t *) stats[0][map[adios_statistic_cnt]].data; + cnt_r = (uint32_t *) stats[1][map[adios_statistic_cnt]].data; + cnt_i = (uint32_t *) stats[2][map[adios_statistic_cnt]].data; + + // Histogram is not available for complex numbers, yet. + /* + if (map[adios_statistic_hist] != -1) { + hist_r = (struct adios_hist_struct *) stat[0][map[adios_statistic_hist]].data; + hist_i = (struct adios_hist_struct *) stat[1][map[adios_statistic_hist]].data; + hist_m = (struct adios_hist_struct *) stat[2][map[adios_statistic_hist]].data; + + hist_r->frequencies = calloc ((hist->num_breaks + 1), adios_get_type_size(adios_unsigned_integer, "")); + hist_i->frequencies = calloc ((hist->num_breaks + 1), adios_get_type_size(adios_unsigned_integer, "")); + hist_m->frequencies = calloc ((hist->num_breaks + 1), adios_get_type_size(adios_unsigned_integer, "")); + } + */ + + *cnt_r = *cnt_i = *cnt_m = 0; + *min_r = *min_i = *min_m = HUGE_VAL; + *max_r = *max_i = *max_m = -HUGE_VAL; + *sum_r = *sum_i = *sum_m = 0; + *sum_square_r = *sum_square_i = *sum_square_m = 0; + + while ((size * sizeof(float)) < total_size) { + + magnitude = sqrt((double) data [size] * data [size] + (double) data[size + 1] * data[size + 1]); + + // Both real and imaginary parts have to be finite, else skip calculating the characteristic + if ( isnan(data [size]) || !isfinite(data [size]) || isnan(data[size + 1]) || !isfinite(data[size + 1]) ) { + size += 2; + continue; + } + + finite = 1; + + // Updating the characteristic values + if (data [size] < *min_r) + *min_r = data [size]; + if (data [size + 1] < *min_i) + *min_i = data [size + 1]; + if (magnitude < *min_m) + *min_m = magnitude; + + if (data [size] > *max_r) + *max_r = data [size]; + if (data [size + 1] > *max_i) + *max_i = data [size + 1]; + if (magnitude > *max_m) + *max_m = magnitude; + + *sum_r += data [size]; + *sum_i += data [size + 1]; + *sum_m += magnitude; + + *sum_square_r += (double) data [size] * data [size]; + *sum_square_i += (double) data [size + 1] * data [size + 1]; + *sum_square_m += magnitude * magnitude; + + *cnt_r = *cnt_r + 1; + *cnt_i = *cnt_i + 1; + *cnt_m = *cnt_m + 1; + // Histogram not available yet + /* + if (map[adios_statistic_hist] != -1) + { + hist = hist_r; + HIST (data[size]); + + hist = hist_i; + HIST (data[size + 1]); + + hist = hist_m; + HIST (magnitude); + } + */ + + size += 2; + } + + if (map[adios_statistic_finite] != -1) + for (c = 0; c < count; c ++) + * ((uint8_t * ) stats[c][map[adios_statistic_finite]].data) = finite; + + return 0; + } + + case adios_double_complex: + { + int i, j, c, count = 3; + struct adios_stat_struct ** stats = var->stats; + double * data = var->data; + i = j = 0; + + while (var->bitmap >> j) { + if ((var->bitmap >> j) & 1) { + map [j] = i; + for (c = 0; c < count; c ++) + if (j != adios_statistic_hist) + stats[c][i].data = malloc(adios_get_stat_size(NULL, original_var_type, j)); + i ++; + } + j ++; + } + + long double *min_i, *min_r, *min_m; + long double *max_i, *max_r, *max_m; + long double *sum_i, *sum_r, *sum_m; + long double *sum_square_i, *sum_square_r, *sum_square_m; + //struct adios_hist_struct *hist, *hist_i, *hist_r, *hist_m; + uint32_t *cnt_i, *cnt_r, *cnt_m; + long double magnitude; + uint8_t finite = 0; + + min_m = (long double *) stats[0][map[adios_statistic_min]].data; + min_r = (long double *) stats[1][map[adios_statistic_min]].data; + min_i = (long double *) stats[2][map[adios_statistic_min]].data; + + max_m = (long double *) stats[0][map[adios_statistic_max]].data; + max_r = (long double *) stats[1][map[adios_statistic_max]].data; + max_i = (long double *) stats[2][map[adios_statistic_max]].data; + + sum_m = (long double *) stats[0][map[adios_statistic_sum]].data; + sum_r = (long double *) stats[1][map[adios_statistic_sum]].data; + sum_i = (long double *) stats[2][map[adios_statistic_sum]].data; + + sum_square_m = (long double *) stats[0][map[adios_statistic_sum_square]].data; + sum_square_r = (long double *) stats[1][map[adios_statistic_sum_square]].data; + sum_square_i = (long double *) stats[2][map[adios_statistic_sum_square]].data; + + + // Histogram not available for complex numbers yet + /* + if (map[adios_statistic_hist] != -1) { + hist_r = (struct adios_hist_struct *) stat[0][map[adios_statistic_hist]].data; + hist_i = (struct adios_hist_struct *) stat[1][map[adios_statistic_hist]].data; + hist_m = (struct adios_hist_struct *) stat[2][map[adios_statistic_hist]].data; + + hist_r->frequencies = calloc ((hist->num_breaks + 1), adios_get_type_size(adios_unsigned_integer, "")); + hist_i->frequencies = calloc ((hist->num_breaks + 1), adios_get_type_size(adios_unsigned_integer, "")); + hist_m->frequencies = calloc ((hist->num_breaks + 1), adios_get_type_size(adios_unsigned_integer, "")); + } + */ + + cnt_m = (uint32_t *) stats[0][map[adios_statistic_cnt]].data; + cnt_r = (uint32_t *) stats[1][map[adios_statistic_cnt]].data; + cnt_i = (uint32_t *) stats[2][map[adios_statistic_cnt]].data; + + *cnt_r = *cnt_i = *cnt_m = 0; + *min_r = *min_i = *min_m = HUGE_VAL; + *max_r = *max_i = *max_m = -HUGE_VAL; + *sum_r = *sum_i = *sum_m = 0; + *sum_square_r = *sum_square_i = *sum_square_m = 0; + + while ((size * sizeof(double)) < total_size) + { + magnitude = sqrt((long double) data [size] * data [size] + + (long double) data[size + 1] * data[size + 1]); + + // Both real and imaginary parts have to be finite, else skip calculating the characteristic + if ( isnan(data [size]) || !isfinite(data [size]) || isnan(data[size + 1]) || !isfinite(data[size + 1]) ) { + size += 2; + continue; + } + + finite = 1; + + if (data [size] < *min_r) + *min_r = data [size]; + if (data [size + 1] < *min_i) + *min_i = data [size + 1]; + if (magnitude < *min_m) + *min_m = magnitude; + + if (data [size] > *max_r) + *max_r = data [size]; + if (data [size + 1] > *max_i) + *max_i = data [size + 1]; + if (magnitude > *max_m) + *max_m = magnitude; + + *sum_r += data [size]; + *sum_i += data [size + 1]; + *sum_m += magnitude; + + *sum_square_r += (long double) data [size] * data [size]; + *sum_square_i += (long double) data [size + 1] * data [size + 1]; + *sum_square_m += magnitude * magnitude; + + // Histgram has not available for complex yet + /* + if (map[adios_statistic_hist] != -1) + { + hist = hist_r; + HIST (data[size]); + + hist = hist_i; + HIST (data[size + 1]); + + hist = hist_m; + HIST (magnitude); + } + */ + + *cnt_r = *cnt_r + 1; + *cnt_i = *cnt_i + 1; + *cnt_m = *cnt_m + 1; + + size += 2; + } + + if (map[adios_statistic_finite] != -1) + for (c = 0; c < count; c ++) + * ((uint8_t * ) stats[c][map[adios_statistic_finite]].data) = finite; + + return 0; + } + case adios_string: + { + var->stats = 0; + + return 0; + } + + default: + { + var->stats = 0; + + return 0; + } + } +} + +// data is only there for sizing +uint64_t adios_write_var_header_v1 (struct adios_file_struct * fd + ,struct adios_var_struct * v + ) +{ + uint64_t total_size = 0; + uint8_t flag; + uint16_t len; + + uint64_t start = fd->offset; // save to write the size + v->write_offset = fd->offset + fd->base_offset; // save offset in file + fd->offset += 8; // save space for the size + total_size += 8; // makes final parsing easier + + buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset, &v->id, 4); + total_size += 4; + + len = strlen (v->name); + buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset, &len, 2); + total_size += 2; + + buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset, v->name, len); + total_size += len; + + len = strlen (v->path); + buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset, &len, 2); + total_size += 2; + + buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset, v->path, len); + total_size += len; + + flag = v->type; + buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset, &flag, 1); + total_size += 1; + + flag = (v->is_dim == adios_flag_yes ? 'y' : 'n'); + buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset, &flag, 1); + total_size += 1; + + total_size += adios_write_dimensions_v1 (fd, v->dimensions); + + // Generate characteristics has been moved up, before transforms are applied + // adios_generate_var_characteristics_v1 (fd, v); + total_size += adios_write_var_characteristics_v1 (fd, v); + + total_size += adios_get_var_size (v, v->data); // payload + + buffer_write (&fd->buffer, &fd->buffer_size, &start, &total_size, 8); + + fd->vars_written++; + + if (fd->bytes_written < fd->offset) + fd->bytes_written = fd->offset; + + return total_size; +} + +int adios_write_var_payload_v1 (struct adios_file_struct * fd + ,struct adios_var_struct * var + ) +{ + uint64_t size; + + // write payload + size = adios_get_var_size (var, var->data); + buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset, var->data, size); + + if (fd->bytes_written < fd->offset) + fd->bytes_written = fd->offset; + + return 0; +} + +int adios_write_attribute_v1 (struct adios_file_struct * fd + ,struct adios_attribute_struct * a + ) +{ + uint64_t start; // save the start to write the size + uint32_t size = 0; + uint16_t len = 0; + uint8_t flag = 0; + + // save space for attr length + start = fd->offset; + a->write_offset = fd->offset + fd->base_offset; // save offset in file + fd->offset += 4; + + buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset, &a->id, 4); + size += 4; + + len = strlen (a->name); + buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset, &len, 2); + size += 2; + + buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset, a->name, len); + size += len; + + len = strlen (a->path); + buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset, &len, 2); + size += 2; + + buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset, a->path, len); + size += len; + + flag = (a->var ? 'y' : 'n'); + buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset, &flag, 1); + size += 1; + + if (a->var) + { + buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset + ,&a->var->id, 4 + ); + size += 4; + } + else + { + flag = a->type; + buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset, &flag, 1); + size += 1; + + uint32_t t = adios_get_type_size (a->type, a->value); + buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset, &t, 4); + size += 4; + + buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset + ,a->value, t + ); + size += t; + } + + // put in the size we have put in for this attribute + buffer_write (&fd->buffer, &fd->buffer_size, &start, &size, 4); + + fd->vars_written++; + + if (fd->bytes_written < fd->offset) + fd->bytes_written = fd->offset; + + return 0; +} + +int adios_write_open_vars_v1 (struct adios_file_struct * fd) +{ + fd->vars_written = 0; + + // it is now setup to write the vars and then the attrs on close + fd->vars_start = fd->offset; + + fd->offset += (4 + 8); // (count + size) + + if (fd->bytes_written < fd->offset) + fd->bytes_written = fd->offset; + + return 0; +} + +int adios_write_close_vars_v1 (struct adios_file_struct * fd) +{ + // close the var area (count and total size) and write the attributes + uint64_t size = fd->offset - fd->vars_start; + buffer_write (&fd->buffer, &fd->buffer_size, &fd->vars_start, &fd->vars_written, 4); + + buffer_write (&fd->buffer, &fd->buffer_size, &fd->vars_start, &size, 8); + + return 0; +} + +int adios_write_open_attributes_v1 (struct adios_file_struct * fd) +{ + fd->vars_start = fd->offset; // save the start of attr area for size + fd->offset += (4 + 8); // space to write the count and size + fd->vars_written = 0; + + if (fd->bytes_written < fd->offset) + fd->bytes_written = fd->offset; + + return 0; +} + +int adios_write_close_attributes_v1 (struct adios_file_struct * fd) +{ + // write attribute count and total size + uint64_t size = fd->offset - fd->vars_start; + buffer_write (&fd->buffer, &fd->buffer_size, &fd->vars_start, &fd->vars_written, 4); + + buffer_write (&fd->buffer, &fd->buffer_size, &fd->vars_start, &size, 8); + + return 0; +} + +// ***************************************************************************** + +int adios_multiply_dimensions (uint64_t * size + ,struct adios_var_struct * var + ,enum ADIOS_DATATYPES type + ,void * data + ) +{ + switch (type) + { + case adios_unsigned_byte: + *size *= (*(uint8_t *) data); + return 1; + + case adios_byte: + *size *= (*(int8_t *) data); + return 1; + + case adios_unsigned_short: + *size *= (*(uint16_t *) data); + return 1; + + case adios_short: + *size *= (*(int16_t *) data); + return 1; + + case adios_unsigned_integer: + *size *= (*(uint32_t *) data); + return 1; + + case adios_integer: + *size *= (*(int32_t *) data); + return 1; + + case adios_unsigned_long: + *size *= (*(uint64_t *) data); + return 1; + + case adios_long: + *size *= (*(int64_t *) data); + return 1; + + default: + adios_error (err_invalid_var_as_dimension, + "Invalid datatype for array dimension on var %s: %s\n", + var->name, + adios_type_to_string_int (type)); + return 0; + } +} + +// NCSU ALACRITY-ADIOS - generalizes the dimension multiplication in adios_get_var_size +// to work on a dimension struct, rather than a var struct, so it +// can be reused to compute the size from pre_transform_dimensions +// TODO: Factor out "var", since needed because of adios_multiply_dimensions, which needs +// it only for debugging output. +uint64_t adios_get_dimension_space_size (struct adios_var_struct *var + ,struct adios_dimension_struct * d) { + uint64_t size = 1; + while (d) + { + // calculate the size for this dimension element + if (d->dimension.var != 0) + { + struct adios_var_struct * dim_var = d->dimension.var; + if (!dim_var->data) + { + adios_error (err_invalid_var_as_dimension, + "adios_get_var_size: " + "sizing of %s failed because " + "dimension component %s was " + "not provided\n", + var->name, dim_var->name); + return 0; + } + else + { + if (!adios_multiply_dimensions (&size, var + ,dim_var->type + ,dim_var->data + ) + ) + { + return 0; + } + } + } + else if (d->dimension.attr != NULL) + { + struct adios_attribute_struct * attr = d->dimension.attr; + if (attr->var) + { + if (!attr->var->data) + { + adios_error (err_invalid_var_as_dimension, + "adios_get_var_size: " + "sizing of %s failed because " + "dimension component %s was " + "not provided\n", + var->name, attr->var->name); + return 0; + } + else + { + if (!adios_multiply_dimensions (&size, var + ,attr->var->type + ,attr->var->data + ) + ) + { + return 0; + } + } + } + else + { + if (!adios_multiply_dimensions (&size, var + ,attr->type + ,attr->value + ) + ) + { + return 0; + } + } + } + else + { + if (d->dimension.time_index == adios_flag_no) + { + size *= d->dimension.rank; + } + // the time index doesn't take up space... + } + + d = d->next; + } + + return size; +} + +// NCSU ALACRITY-ADIOS: Refactored to call the above dimension space compute code +uint64_t adios_get_var_size (struct adios_var_struct * var, void * data) +{ + uint64_t size = adios_get_type_size (var->type, data); + if (var->dimensions) + size *= adios_get_dimension_space_size(var, var->dimensions); + + return size; +} + +const char * adios_type_to_string_int (int type) +{ + switch (type) + { + case adios_unsigned_byte: return "unsigned byte"; + case adios_unsigned_short: return "unsigned short"; + case adios_unsigned_integer: return "unsigned integer"; + case adios_unsigned_long: return "unsigned long long"; + + case adios_byte: return "byte"; + case adios_short: return "short"; + case adios_integer: return "integer"; + case adios_long: return "long long"; + + case adios_real: return "real"; + case adios_double: return "double"; + case adios_long_double: return "long double"; + + case adios_string: return "string"; + case adios_complex: return "complex"; + case adios_double_complex: return "double complex"; + + default: + { + static char buf [50]; + sprintf (buf, "(unknown: %d)", type); + return buf; + } + } +} + +const char * adios_file_mode_to_string (int mode) +{ + static char buf [50]; + + switch (mode) + { + case adios_mode_write: return "write"; + case adios_mode_read: return "read"; + case adios_mode_update: return "update"; + case adios_mode_append: return "append"; + + default: + sprintf (buf, "(unknown: %d)", mode); + } + + return buf; +} + +////////////////////////////////////////////////////////////////////////////// +// Queue management code intended for adaptive API use +////////////////////////////////////////////////////////////////////////////// +void list_init (List * list, void (* destroy) (void * data)) +{ + list->size = 0; + list->destroy = destroy; + list->head = NULL; + list->tail = NULL; + + return; +} + +void list_destroy (List * list) +{ + void * data; + + while (list_size (list) > 0) + { + if (list_rem_next (list, NULL, (void **) &data) == 0 && list->destroy != NULL) + { + list->destroy (data); + } + } + + memset (list, 0, sizeof (List)); + + return; +} + +int list_ins_next (List * list, ListElmt * element, const void * data) +{ + ListElmt * new_element; + + if ((new_element = (ListElmt *) malloc (sizeof (ListElmt))) == NULL) + return -1; + + new_element->data = (void *) data; + + if (element == NULL) + { + if (list_size (list) == 0) + list->tail = new_element; + + new_element->next = list->head; + list->head = new_element; + } + else + { + if (element->next == NULL) + list->tail = new_element; + + new_element->next = element->next; + element->next = new_element; + } + + list->size++; + + return 0; +} + +int list_rem_next (List * list, ListElmt * element, void ** data) +{ + ListElmt * old_element; + + if (list_size (list) == 0) + return -1; + + if (element == NULL) + { + *data = list->head->data; + old_element = list->head; + list->head = list->head->next; + + if (list_size (list) == 1) + list->tail = NULL; + } + else + { + if (element->next == NULL) + return -1; + + *data = element->next->data; + old_element = element->next; + element->next = element->next->next; + + if (element->next == NULL) + list->tail = element; + } + + free (old_element); + + list->size--; + + return 0; +} + +int queue_enqueue (Queue * queue, const void * data) +{ + return list_ins_next (queue, list_tail (queue), data); +} + +int queue_dequeue (Queue * queue, void ** data) +{ + return list_rem_next (queue, NULL, data); +} + + +// Functions for non-XML API fo ADIOS Schema some of which are also called from functions in adios_internals_mxml.c +int adios_common_define_schema_version (struct adios_group_struct * new_group, char * schema_version) +{ + int64_t p_new_group = (int64_t) new_group; + + if (strcasecmp (schema_version,"")){ + char * ver;// copy version + char * d; // dot location + char * ptr_end; + ver = strdup (schema_version); + char * schema_version_major_att_nam; + char * schema_version_minor_att_nam; + d = strtok (ver, "."); + int counter = 0; // counter + + while (d) + { + int slength = 0; + if (!strtod (d,&ptr_end)){ + printf("Schema version invalid.\n"); + counter = 0; + break; + }else{ + slength = strlen("adios_schema/"); + if (counter == 0 ){ + slength = slength + strlen("version_major") + 1; + schema_version_major_att_nam = malloc (slength); + strcpy(schema_version_major_att_nam,"adios_schema/version_major"); + adios_common_define_attribute (p_new_group,schema_version_major_att_nam,"/",adios_string,d,""); + }else if (counter == 1){ + slength = slength + strlen("version_minor") + 1; + schema_version_minor_att_nam = malloc (slength); + strcpy(schema_version_minor_att_nam,"adios_schema/version_minor"); + adios_common_define_attribute (p_new_group,schema_version_minor_att_nam,"/",adios_string,d,""); + } + } + counter++; + d = strtok (NULL, "."); + } + if (counter == 0){ + printf("Error: Could not detect valid schema version.\n"); + } + free(ver); + } + return 0; +} + + +// Parse mesh time series (single file for multiple time steps or +// multiple files for time steps, basename + timeformat + extension) +int adios_common_define_mesh_timeSeriesFormat (const char * timeseries, + struct adios_group_struct * new_group, + const char * name + ) +{ + char * d1; // save of strdup + int64_t p_new_group = (int64_t) new_group; + char * format_att_nam = 0; // extension format .xxxx att name + char * format_att_val = 0; // extension format att value + + // We expect a number from 1-10 (max 10?) + // The number indicates how to write the time steps. Ex: 4 ==> + // varname.XXXX.png where XXXX is the time step padded with 0s + // We do not fail if this is not given as variables all have nsteps + if (!timeseries || !strcmp(timeseries,"")){ + return 1; + } + + char * ptr_end; + d1 = strdup (timeseries); + + double tmp_d = strtod (d1, &ptr_end); + if (!(ptr_end && ptr_end[0]==0)) + { + adios_conca_mesh_att_nam(&format_att_nam, name, "time-series-format"); + adios_common_define_attribute (p_new_group,format_att_nam,"/",adios_double,d1,""); + free(format_att_val); + } + free (d1); + return 1; +} + +// Parse mesh time scale (real time tracking, not integers) +int adios_common_define_mesh_timeScale (const char * timescale, + struct adios_group_struct * new_group, + const char * name + ) +{ + char * c; // comma location + char * d1; // save of strdup + int64_t p_new_group = (int64_t) new_group; + char * gettscalefrom0 = 0; // scale attribute xml value + char * gettscalefrom1 = 0; // scale attribute xml value + char * gettscalefrom2 = 0; // scale attribute xml value + char * time_var_att_nam = 0; // scale attribute name for var or num + char * time_start_att_nam = 0; // scale attribute name for start + char * time_stride_att_nam = 0;// scale attribute name for stride + char * time_count_att_nam = 0; // scale attribute name for count + char * time_max_att_nam = 0; // scale attribute name for max + char * time_min_att_nam = 0; // scale attribute name for min + char * time_var_att_val = 0; // scale attribute value for var or num + char * time_start_att_val = 0; // scale attribute value for start + char * time_stride_att_val = 0;// scale attribute value for stride + char * time_count_att_val = 0; // scale attribute value for count + char * time_max_att_val = 0; // scale attribute value for max + char * time_min_att_val = 0; // scale attribute value for min + int counter = 0; // used to get type of time scale bounds + + // We are going to allow + // 1. a number = just the number of time scale default start = 0 + // 2. start/stride/count 3 components + // 3. min/max range where this mesh is used + // 4. An ADIOS var = time could be a list of int stored by user + + /* We do not fail if this is not given as variables all have nsteps + in ADIOS_inq_var = # of times the var was written + */ + if (!timescale || !strcmp(timescale,"")){ +// printf("time-scale attribute for mesh: %s not provided.\n", name); + return 1; + } + + d1 = strdup (timescale); + char * ptr_end; + c = strtok (d1, ","); + + while (c) + { + struct adios_var_struct * var = 0; + //if (adios_int_is_num (c)) + double tmp_d1; + tmp_d1 = strtod (c,&ptr_end); + if (!(ptr_end && ptr_end[0]==0)) + { + var = adios_find_var_by_name (new_group, c); + if (!var) + { + log_warn ("config.xml: invalid variable %s\n" + "for time scale of mesh: %s\n", + c, name); + free (d1); + + return 0; + + }else{ + // Found variable ==> create a dims attribute for it. + if (counter == 0){ + gettscalefrom0 = 0; + gettscalefrom0 = strdup(c); + }else if (counter == 1){ + gettscalefrom1 = 0; + gettscalefrom1 = strdup(c); + }else if (counter == 2){ + gettscalefrom2 = 0; + gettscalefrom2 = strdup(c); + } + counter++; + } + } + else + { + if (counter == 0){ + gettscalefrom0 = 0; + gettscalefrom0 = strdup(c); + }else if (counter == 1){ + gettscalefrom1 = 0; + gettscalefrom1 = strdup(c); + }else if (counter == 2){ + gettscalefrom2 = 0; + gettscalefrom2 = strdup(c); + } + counter++; + } + + c = strtok (NULL, ","); + } + if (counter == 3){ + double tmp_d2; + time_start_att_val = strdup(gettscalefrom0); + adios_conca_mesh_att_nam(&time_start_att_nam, name, "time-scale-start"); + // if this is string + tmp_d2 = strtod (time_start_att_val, &ptr_end); + if (!(ptr_end && ptr_end[0]==0)) +// if (!strtod (time_start_att_val, &ptr_end)) + adios_common_define_attribute (p_new_group,time_start_att_nam,"/",adios_string,time_start_att_val,""); + else + adios_common_define_attribute (p_new_group,time_start_att_nam,"/",adios_double,time_start_att_val,""); + time_stride_att_val = strdup(gettscalefrom1); + adios_conca_mesh_att_nam(&time_stride_att_nam, name, "time-scale-stride"); + // if this is string + tmp_d2 = strtod (time_stride_att_val, &ptr_end); +// if (!strtod (time_stride_att_val, &ptr_end)) + if (!(ptr_end && ptr_end[0]==0)) + adios_common_define_attribute (p_new_group,time_stride_att_nam,"/",adios_string,time_stride_att_val,""); + else + adios_common_define_attribute (p_new_group,time_stride_att_nam,"/",adios_double,time_stride_att_val,""); + time_count_att_val = strdup(gettscalefrom2); + adios_conca_mesh_att_nam(&time_count_att_nam, name, "time-scale-count"); + // if this is string + tmp_d2 = strtod (time_count_att_val, &ptr_end); +// if (!strtod (time_count_att_val, &ptr_end)) + if (!(ptr_end && ptr_end[0]==0)) + adios_common_define_attribute (p_new_group,time_count_att_nam,"/",adios_string,time_count_att_val,""); + else + adios_common_define_attribute (p_new_group,time_count_att_nam,"/",adios_double,time_count_att_val,""); + free(time_start_att_val); + free(time_stride_att_val); + free(time_count_att_val); + free(gettscalefrom2); + free(gettscalefrom1); + free(gettscalefrom0); + }else if (counter == 2) { + double tmp_d2; + adios_conca_mesh_att_nam(&time_min_att_nam, name, "time-scale-min"); + // if this is string + tmp_d2 = strtod (time_min_att_nam, &ptr_end); + if (!(ptr_end && ptr_end[0]==0)) +// if (!strtod (time_min_att_val, &ptr_end)) + adios_common_define_attribute (p_new_group,time_min_att_nam,"/",adios_string,time_min_att_val,""); + else + adios_common_define_attribute (p_new_group,time_min_att_nam,"/",adios_double,time_min_att_val,""); + time_max_att_val = strdup(gettscalefrom1); + adios_conca_mesh_att_nam(&time_max_att_nam, name, "time-scale-max"); + // if this is string + tmp_d2 = strtod (time_max_att_nam, &ptr_end); + if (!(ptr_end && ptr_end[0]==0)) +// if (!strtod (time_max_att_val, &ptr_end)) + adios_common_define_attribute (p_new_group,time_max_att_nam,"/",adios_string,time_max_att_val,""); + else + adios_common_define_attribute (p_new_group,time_max_att_nam,"/",adios_double,time_max_att_val,""); + free(time_min_att_val); + free(time_max_att_val); + free(gettscalefrom1); + free(gettscalefrom0); + } else if (counter == 1){ + double tmp_d2; + time_var_att_val = strdup(gettscalefrom0); + tmp_d2 = strtod (time_var_att_val, &ptr_end); + if (!(ptr_end && ptr_end[0]==0)) +// if (!strtod (time_var_att_val, &ptr_end)) + { + adios_conca_mesh_att_nam(&time_var_att_nam, name, "time-scale-var"); + adios_common_define_attribute (p_new_group,time_var_att_nam,"/",adios_string,time_var_att_val,""); + }else{ + adios_conca_mesh_att_nam(&time_var_att_nam, name, "time-scale-count"); + adios_common_define_attribute (p_new_group,time_var_att_nam,"/",adios_double,time_var_att_val,""); + } + free(gettscalefrom0); + free(time_var_att_val); + }else{ + printf("Error: time format not recognized.\nPlease check documentation for time formatting.\n"); + free(d1); + return 0; + } + + free (d1); + + return 1; +} + +int adios_common_define_mesh_timeVarying (const char * timevarying, int64_t group_id, const char * name) +{ + char * mpath = 0; + mpath = malloc(strlen("/adios_schema/")+strlen(name)+strlen("/time-varying")+1); + strcpy (mpath, "/adios_schema/"); + strcat (mpath, name); + strcat (mpath, "/time-varying"); + adios_common_define_attribute (group_id, mpath, "", adios_string, timevarying, ""); + free (mpath); + return 0; +} + +// Parse mesh time steps (integers = number of times vars are written) +int adios_common_define_mesh_timeSteps (const char * timesteps, + struct adios_group_struct * new_group, + const char * name + ) +{ + char * c; // comma location + char * d1; // save of strdup + int64_t p_new_group = (int64_t) new_group; + char * gettstepsfrom0 = 0; // tstep attribute xml value + char * gettstepsfrom1 = 0; // tstep attribute xml value + char * gettstepsfrom2 = 0; // tstep attribute xml value + char * time_var_att_nam = 0; // tstep attribute name for var or num + char * time_start_att_nam = 0; // tstep attribute name for start + char * time_stride_att_nam = 0;// tstep attribute name for stride + char * time_count_att_nam = 0; // tstep attribute name for count + char * time_max_att_nam = 0; // tstep attribute name for max + char * time_min_att_nam = 0; // tstep attribute name for min + char * time_var_att_val = 0; // tstep attribute value for var or num + char * time_start_att_val = 0; // tstep attribute value for start + char * time_stride_att_val = 0;// tstep attribute value for stride + char * time_count_att_val = 0; // tstep attribute value for count + char * time_max_att_val = 0; // tstep attribute value for max + char * time_min_att_val = 0; // tstep attribute value for min + int counter = 0; // used to get type of time steps bounds + + // We are going to allow + // 1. a number = just the number of time steps default start = 0 + // 2. start/stride/count 3 components + // 3. min/max range where this mesh is used + // 4. An ADIOS var = time could be a list of int stored by user + + /* We do not fail if this is not given as variables all have nsteps + in ADIOS_inq_var = # of times the var was written + */ + if (!timesteps || !strcmp(timesteps,"")){ +// printf("time-steps for mesh %s attribute not provided.\n", name); + return 1; + } + + d1 = strdup (timesteps); + + c = strtok (d1, ","); + + while (c) + { + struct adios_var_struct * var = 0; + if (adios_int_is_var (c)) + { + var = adios_find_var_by_name (new_group, c); + if (!var) + { + log_warn ("config.xml: invalid variable %s\n" + "for dimensions of mesh: %s\n", + c, name); + free (d1); + + return 0; + + }else{ + // Found variable ==> create a dims attribute for it. + if (counter == 0){ + gettstepsfrom0 = 0; + gettstepsfrom0 = strdup(c); + }else if (counter == 1){ + gettstepsfrom1 = 0; + gettstepsfrom1 = strdup(c); + }else if (counter == 2){ + gettstepsfrom2 = 0; + gettstepsfrom2 = strdup(c); + } + counter++; + } + } + else + { + if (counter == 0){ + gettstepsfrom0 = 0; + gettstepsfrom0 = strdup(c); + }else if (counter == 1){ + gettstepsfrom1 = 0; + gettstepsfrom1 = strdup(c); + }else if (counter == 2){ + gettstepsfrom2 = 0; + gettstepsfrom2 = strdup(c); + } + counter++; + } + + c = strtok (NULL, ","); + } + + if (counter == 3){ + time_start_att_val = strdup(gettstepsfrom0); + adios_conca_mesh_att_nam(&time_start_att_nam, name, "time-steps-start"); + // if this is string + if (adios_int_is_var (time_start_att_val)) + adios_common_define_attribute (p_new_group,time_start_att_nam,"/",adios_string,time_start_att_val,""); + else + adios_common_define_attribute (p_new_group,time_start_att_nam,"/",adios_double,time_start_att_val,""); + time_stride_att_val = strdup(gettstepsfrom1); + adios_conca_mesh_att_nam(&time_stride_att_nam, name, "time-steps-stride"); + // if this is string + if (adios_int_is_var (time_stride_att_val)) + adios_common_define_attribute (p_new_group,time_stride_att_nam,"/",adios_string,time_stride_att_val,""); + else + adios_common_define_attribute (p_new_group,time_stride_att_nam,"/",adios_double,time_stride_att_val,""); + time_count_att_val = strdup(gettstepsfrom2); + adios_conca_mesh_att_nam(&time_count_att_nam, name, "time-steps-count"); + // if this is string + if (adios_int_is_var (time_count_att_val)) + adios_common_define_attribute (p_new_group,time_count_att_nam,"/",adios_string,time_count_att_val,""); + else + adios_common_define_attribute (p_new_group,time_count_att_nam,"/",adios_double,time_count_att_val,""); + free(time_start_att_val); + free(time_stride_att_val); + free(time_count_att_val); + free(gettstepsfrom2); + free(gettstepsfrom1); + free(gettstepsfrom0); + }else if (counter == 2) { + time_min_att_val = strdup(gettstepsfrom0); + adios_conca_mesh_att_nam(&time_min_att_nam, name, "time-steps-min"); + // if this is string + if (adios_int_is_var (time_min_att_val)) + adios_common_define_attribute (p_new_group,time_min_att_nam,"/",adios_string,time_min_att_val,""); + else + adios_common_define_attribute (p_new_group,time_min_att_nam,"/",adios_double,time_min_att_val,""); + time_max_att_val = strdup(gettstepsfrom1); + adios_conca_mesh_att_nam(&time_max_att_nam, name, "time-steps-max"); + // if this is string + if (adios_int_is_var (time_max_att_val)) + adios_common_define_attribute (p_new_group,time_max_att_nam,"/",adios_string,time_max_att_val,""); + else + adios_common_define_attribute (p_new_group,time_max_att_nam,"/",adios_double,time_max_att_val,""); + free(time_min_att_val); + free(time_max_att_val); + free(gettstepsfrom1); + free(gettstepsfrom0); + } else if (counter == 1){ + time_var_att_val = strdup(gettstepsfrom0); + if (adios_int_is_var (time_var_att_val)){ + adios_conca_mesh_att_nam(&time_var_att_nam, name, "time-steps-var"); + adios_common_define_attribute (p_new_group,time_var_att_nam,"/",adios_string,time_var_att_val,""); + }else{ + adios_conca_mesh_att_nam(&time_var_att_nam, name, "time-steps-count"); + adios_common_define_attribute (p_new_group,time_var_att_nam,"/",adios_double,time_var_att_val,""); + } + free(time_var_att_val); + free(gettstepsfrom0); + }else{ + printf("Error: time format not recognized.\nPlease check documentation for time formatting.\n"); + free(d1); + return 0; + } + + free (d1); + + return 1; +} + +// defining a uniform mesh +int adios_common_define_mesh_uniform (char * dimensions, + char * origin, + char * spacing, + char * maximum, + char * nspace, +// struct adios_group_struct * new_group, + const char * name, + int64_t group_id + ) +{ + struct adios_group_struct * new_group = (struct adios_group_struct *) group_id; + char * mpath = 0; + mpath = malloc(strlen("/adios_schema/")+strlen(name)+strlen("/type")+1); + strcpy (mpath, "/adios_schema/"); + strcat (mpath, name); + strcat (mpath, "/type"); + adios_common_define_attribute (group_id, mpath, "", adios_string, "uniform", ""); + + if (!adios_define_mesh_uniform_dimensions (dimensions, new_group, name)) + return 1; + + adios_define_mesh_uniform_origins (origin, new_group, name); + + adios_define_mesh_uniform_spacings (spacing, new_group, name); + + adios_define_mesh_uniform_maximums (maximum, new_group, name); + + adios_define_mesh_nspace (nspace, new_group, name); + + free (mpath); + return 0; +} + +// defining a rectilinear mesh +int adios_common_define_mesh_rectilinear (char * dimensions, + char * coordinates, +// struct adios_group_struct * new_group, + char * nspace, + const char * name, + int64_t group_id + ) +{ + struct adios_group_struct * new_group = (struct adios_group_struct *) group_id; + char * mpath = 0; + mpath = malloc(strlen("/adios_schema/")+strlen(name)+strlen("/type")+1); + strcpy (mpath, "/adios_schema/"); + strcat (mpath, name); + strcat (mpath, "/type"); + adios_common_define_attribute (group_id, mpath, "", adios_string, "rectilinear", ""); + + if (!adios_define_mesh_rectilinear_dimensions (dimensions, new_group, name)) + return 1; + + // Determine if it is the multi-var or single-var case + char *p; + // If we do not find "," in the coordinates + if (!(p = strstr(coordinates, ","))) + { + if (!adios_define_mesh_rectilinear_coordinatesSingleVar (coordinates, new_group, name)) + return 1; + } + else + { + if (!adios_define_mesh_rectilinear_coordinatesMultiVar (coordinates, new_group, name)) + return 1; + } + + adios_define_mesh_nspace (nspace, new_group, name); + + free (mpath); + return 0; +} + +// defining a structured mesh +int adios_common_define_mesh_structured (char * dimensions, + char * nspace, + char * points, +// struct adios_group_struct * new_group, + const char * name, + int64_t group_id + ) +{ + struct adios_group_struct * new_group = (struct adios_group_struct *) group_id; + char * mpath = 0; + mpath = malloc(strlen("/adios_schema/")+strlen(name)+strlen("/type")+1); + strcpy (mpath, "/adios_schema/"); + strcat (mpath, name); + strcat (mpath, "/type"); + adios_common_define_attribute (group_id, mpath, "", adios_string, "structured", ""); + + if (dimensions){ + if (!adios_define_mesh_structured_dimensions (dimensions, new_group, name)) + return 0; + }else{ + log_warn ("config.xml: value attribute on " + "dimensions required (%s)\n", name); + + return 0; + } + + if (nspace){ +// if (!adios_define_mesh_structured_nspace (nspace, new_group, name)) + if (!adios_define_mesh_nspace (nspace, new_group, name)) + return 0; + } + if (points){ + char *p; + // If we do find "," in points (single-var case) + if (!(p = strstr(points, ","))){ + if (!adios_define_mesh_structured_pointsSingleVar (points, new_group, name)) + return 0; + }else{ + if (!adios_define_mesh_structured_pointsMultiVar (points, new_group, name)) + return 0; + } + }else{ + log_warn ("config.xml: value on " + "points required for mesh type=structured (%s)\n", name); + return 0; + } + free (mpath); + return 1; +} + +// defining a unstructured mesh +int adios_common_define_mesh_unstructured (char * points, + char * data, + char * count, + char * type, + char * nspace, + char * npoints, + const char * name, + int64_t group_id) +{ + struct adios_group_struct * new_group = (struct adios_group_struct *) group_id; + char * mpath = 0; + mpath = malloc(strlen("/adios_schema/")+strlen(name)+strlen("/type")+1); + strcpy (mpath, "/adios_schema/"); + strcat (mpath, name); + strcat (mpath, "/type"); + adios_common_define_attribute (group_id, mpath, "", adios_string, "unstructured", ""); + if (nspace && *nspace != 0) + { +// if (!adios_define_mesh_unstructured_nspace (nspace, new_group, name)) + if (!adios_define_mesh_nspace (nspace, new_group, name)) + return 0; + } + if (npoints && *npoints != 0) + { + if (!adios_define_mesh_unstructured_npoints (npoints, new_group, name)) + return 0; + + } + if (points && *points != 0){ + char *p; + // If we do find "," in points (single-var case) + if (!(p = strstr(points, ","))){ + if (!adios_define_mesh_unstructured_pointsSingleVar (points, new_group, name)) + return 0; + }else{ + if (!adios_define_mesh_unstructured_pointsMultiVar (points, new_group, name)) + return 0; + } + }else{ + log_warn ("config.xml: value on " + "points required for mesh type=structured (%s)\n", name); + return 0; + } + if (!data){ + log_warn ("config.xml: data attribute on " + "uniform-cells required (%s)\n", name); + return 0; + } + if (!count) + { + log_warn ("config.xml: count attribute on " + "uniform-cells required (%s)\n", name); + return 0; + } + if (!type) + { + log_warn ("config.xml: type attribute on " + "uniform-cells required (%s)\n", name); + return 0; + } + char *pt; + // If we do find "," in data (uniform cell case) + if (!(pt = strstr(data, ","))){ + if ( (pt = strstr(count,",")) ){ + log_warn ("count value on uniform-cells (check data value)" + " should not contain ',' (%s)\n",name); + return 0; + } + if ( (pt = strstr(type,",")) ){ + log_warn ("type value on uniform-cells (check data value)" + " should not contain ',' (%s)\n", name); + return 0; + } + if (!adios_define_mesh_unstructured_uniformCells (count, data, type + , new_group + ,name + ) + ) + return 0; + // Mixed cells calse + }else{ + if (!(pt = strstr(count,","))){ + log_warn ("count value on mixed-cells (check data value)" + " should contain ',' (%s)\n", name); + return 0; + } + if (!(pt = strstr(type,","))){ + log_warn ("type value on mixed-cells (check data value)" + " should contain ',' (%s)\n", name); + return 0; + } + if (!adios_define_mesh_unstructured_mixedCells (count, data, type + , new_group, name)) + return 0; + } + return 1; +} + +// Compose schema attributes for mesh and var +// concat numbered mesh attribute name strings +void conca_mesh_numb_att_nam(char ** returnstr, const char * meshname, char * att_nam, char counterstr[5]) { + *returnstr = malloc (strlen("adios_schema/") + strlen(meshname) + strlen(att_nam) + strlen(counterstr) + 3); + strcpy(*returnstr,"adios_schema"); + strcat(*returnstr,"/"); + strcat(*returnstr,meshname); + strcat(*returnstr,"/"); + strcat(*returnstr,att_nam); + strcat(*returnstr,counterstr); +} + +// concat mesh attribute name strings +void adios_conca_mesh_att_nam(char ** returnstr, const char * meshname, char * att_nam) { + int slength = 0; + slength = strlen("adios_schema/"); + slength = slength + strlen(meshname); + slength = slength + 1; + slength = slength + 1; + slength = slength + strlen(att_nam); + + *returnstr = malloc (slength); + + strcpy(*returnstr,"adios_schema/"); + strcat(*returnstr,meshname); + strcat(*returnstr,"/"); + strcat(*returnstr,att_nam); +} + +// concat link attribute name strings +void adios_conca_link_att_nam(char ** returnstr, const char * name, char * att_nam) { + int slength = 0; + slength = strlen("adios_link/")+1; + slength = slength + strlen(name); + slength = slength + 1; + slength = slength + strlen(att_nam); + + *returnstr = malloc (slength); + + strcpy(*returnstr,"adios_link/"); + strcat(*returnstr,name); + strcat(*returnstr,"/"); + strcat(*returnstr,att_nam); +} + +// concat var attribute name strings +void conca_var_att_nam(char ** returnstr, const char * varname, char * att_nam) { + int slength = 0; + slength = strlen("adios_schema/"); + slength = slength + strlen(varname); + slength = slength + 1; + slength = slength + 1; + slength = slength + strlen(att_nam); + + *returnstr = malloc (slength); + + strcpy(*returnstr,varname); + strcat(*returnstr,"/adios_schema/"); + strcat(*returnstr,att_nam); +} + +// At this point mesh structures are not really being used, +// but this function still makes sure that we don't add a +// mesh twice (same name) +// Append a mesh to a group +enum ADIOS_FLAG adios_append_mesh (struct adios_mesh_struct ** root + ,struct adios_mesh_struct * mesh + ,uint16_t id + ) +{ + while (root) + { + if (*root && !strcasecmp ((*root)->name, mesh->name)) + { + return adios_flag_no; + } + if (!*root) + { + *root = mesh; + root = 0; + } + else + { + root = &(*root)->next; + } + } + + return adios_flag_yes; +} + +// Define a new mesh +struct adios_mesh_struct * adios_common_define_mesh ( + int64_t group_id, const char * name, + enum ADIOS_FLAG time_varying, + enum ADIOS_MESH_TYPE type) +{ + struct adios_group_struct * t = (struct adios_group_struct *) group_id; + struct adios_mesh_struct * m = (struct adios_mesh_struct *) + malloc (sizeof (struct adios_mesh_struct)); + enum ADIOS_FLAG flag; + + m->name = strdup (name); + m->type = type; + m->time_varying = time_varying; + m->next = 0; + + flag = adios_append_mesh (&t->meshs, m, t->mesh_count); + if (flag == adios_flag_no) + { + log_warn ("config.xml: unique mesh names required; " + "second mesh: %s will be ignored.\n", name); + free(m); + m = 0; + } else { + t->mesh_count++; + } + + return m; +} + +// Define time steps, scale and formatting +// Parse var time steps (integers = number of times vars are written) +int adios_common_define_var_timesteps (const char * timesteps, + struct adios_group_struct * new_group, + const char * name, + const char * path + ) +{ + char * c; // comma location + char * d1; // save of strdup + int64_t p_new_group = (int64_t) new_group; + char * gettstepsfrom0 = 0; // tstep attribute xml value + char * gettstepsfrom1 = 0; // tstep attribute xml value + char * gettstepsfrom2 = 0; // tstep attribute xml value + char * time_var_att_nam = 0; // tstep attribute name for var or num + char * time_start_att_nam = 0; // tstep attribute name for start + char * time_stride_att_nam = 0;// tstep attribute name for stride + char * time_count_att_nam = 0; // tstep attribute name for count + char * time_max_att_nam = 0; // tstep attribute name for max + char * time_min_att_nam = 0; // tstep attribute name for min + char * time_var_att_val = 0; // tstep attribute value for var or num + char * time_start_att_val = 0; // tstep attribute value for start + char * time_stride_att_val = 0;// tstep attribute value for stride + char * time_count_att_val = 0; // tstep attribute value for count + char * time_max_att_val = 0; // tstep attribute value for max + char * time_min_att_val = 0; // tstep attribute value for min + int counter = 0; // used to get type of time steps bounds + + // We are going to allow + // 1. a number = just the number - a multiple of mesh time step + // 2. start/stride/count 3 components - indices of the mesh time steps + // 3. min/max range of the mesh time step + // 4. An ADIOS var = time could be a list of int stored by user + + /* We do not fail if this is not given as variables all have nsteps + in ADIOS_inq_var = # of times the var was written + */ + if (!timesteps || !strcmp(timesteps,"")){ + return 1; + } + + d1 = strdup (timesteps); + + c = strtok (d1, ","); + + while (c) + { + struct adios_var_struct * var = 0; + if (adios_int_is_var (c)) + { + var = adios_find_var_by_name (new_group, c); + if (!var) + { + log_warn ("config.xml: invalid variable %s\n" + "for time-steps of var: %s\n", + c, name); + free (d1); + + return 0; + + }else{ + // Found variable ==> create a dims attribute for it. + if (counter == 0){ + gettstepsfrom0 = 0; + gettstepsfrom0 = strdup(c); + }else if (counter == 1){ + gettstepsfrom1 = 0; + gettstepsfrom1 = strdup(c); + }else if (counter == 2){ + gettstepsfrom2 = 0; + gettstepsfrom2 = strdup(c); + } + counter++; + } + } + else + { + if (counter == 0){ + gettstepsfrom0 = 0; + gettstepsfrom0 = strdup(c); + }else if (counter == 1){ + gettstepsfrom1 = 0; + gettstepsfrom1 = strdup(c); + }else if (counter == 2){ + gettstepsfrom2 = 0; + gettstepsfrom2 = strdup(c); + } + counter++; + } + + c = strtok (NULL, ","); + } + + if (counter == 3){ + time_start_att_val = strdup(gettstepsfrom0); + conca_var_att_nam(&time_start_att_nam, name, "time-steps-start"); + // if this is string + if (adios_int_is_var (time_start_att_val)) + adios_common_define_attribute (p_new_group,time_start_att_nam,path,adios_string,time_start_att_val,""); + else + adios_common_define_attribute (p_new_group,time_start_att_nam,path,adios_double,time_start_att_val,""); + time_stride_att_val = strdup(gettstepsfrom1); + conca_var_att_nam(&time_stride_att_nam, name, "time-steps-stride"); + // if this is string + if (adios_int_is_var (time_stride_att_val)) + adios_common_define_attribute (p_new_group,time_stride_att_nam,path,adios_string,time_stride_att_val,""); + else + adios_common_define_attribute (p_new_group,time_stride_att_nam,path,adios_double,time_stride_att_val,""); + time_count_att_val = strdup(gettstepsfrom2); + conca_var_att_nam(&time_count_att_nam, name, "time-steps-count"); + // if this is string + if (adios_int_is_var (time_count_att_val)) + adios_common_define_attribute (p_new_group,time_count_att_nam,path,adios_string,time_count_att_val,""); + else + adios_common_define_attribute (p_new_group,time_count_att_nam,path,adios_double,time_count_att_val,""); + free(time_start_att_val); + free(time_stride_att_val); + free(time_count_att_val); + free(gettstepsfrom2); + free(gettstepsfrom1); + free(gettstepsfrom0); + }else if (counter == 2) { + time_min_att_val = strdup(gettstepsfrom0); + conca_var_att_nam(&time_min_att_nam, name, "time-steps-min"); + // if this is string + if (adios_int_is_var (time_min_att_val)) + adios_common_define_attribute (p_new_group,time_min_att_nam,path,adios_string,time_min_att_val,""); + else + adios_common_define_attribute (p_new_group,time_min_att_nam,path,adios_double,time_min_att_val,""); + time_max_att_val = strdup(gettstepsfrom1); + conca_var_att_nam(&time_max_att_nam, name, "time-steps-max"); + // if this is string + if (adios_int_is_var (time_max_att_val)) + adios_common_define_attribute (p_new_group,time_max_att_nam,"/",adios_string,time_max_att_val,""); + else + adios_common_define_attribute (p_new_group,time_max_att_nam,path,adios_double,time_max_att_val,""); + free(time_min_att_val); + free(time_max_att_val); + free(gettstepsfrom1); + free(gettstepsfrom0); + } else if (counter == 1){ + time_var_att_val = strdup(gettstepsfrom0); + if (adios_int_is_var (time_var_att_val)){ + conca_var_att_nam(&time_var_att_nam, name, "time-steps-var"); + adios_common_define_attribute (p_new_group,time_var_att_nam,path,adios_string,time_var_att_val,""); + }else{ + conca_var_att_nam(&time_var_att_nam, name, "time-steps-count"); + adios_common_define_attribute (p_new_group,time_var_att_nam,path,adios_double,time_var_att_val,""); + } + free(time_var_att_val); + free(gettstepsfrom0); + }else{ + printf("Error: time format not recognized.\nPlease check documentation for time formatting.\n"); + free(d1); + return 0; + } + + free (d1); + + return 1; +} + +// Parse var time series format (real time tracking, not integers) +int adios_common_define_var_timeseriesformat (const char * timeseries, + struct adios_group_struct * new_group, + const char * name, + const char * path + ) +{ + char * d1; // save of strdup + int64_t p_new_group = (int64_t) new_group; + char * format_att_nam = 0; // extension format .xxxx att name + char * format_att_val = 0; // extension format att value + + // We expect a number from 1-10 (max 10?) + // The number indicates how to write the time steps. Ex: 4 ==> + // varname.XXXX.png where XXXX is the time step padded with 0s + // We do not fail if this is not given as variables all have nsteps + if (!timeseries || !strcmp(timeseries,"")){ + return 1; + } + + char * ptr_end; + d1 = strdup (timeseries); + double tmp_d2; + tmp_d2 = strtod (d1, &ptr_end); +// if (strtod(d1, &ptr_end)) + if ( !(ptr_end && ptr_end[0]==0)) + { + adios_conca_mesh_att_nam(&format_att_nam, name, "time-series-format"); + adios_common_define_attribute (p_new_group,format_att_nam,path,adios_string,d1,""); + free(format_att_val); + } + free (d1); + return 1; +} + +// Parse var time scale (real time tracking, not integers) +int adios_common_define_var_timescale (const char * timescale, + struct adios_group_struct * new_group, + const char * name, + const char * path + ) +{ + char * c; // comma location + char * d1; // save of strdup + int64_t p_new_group = (int64_t) new_group; + char * gettscalefrom0 = 0; // scale attribute xml value + char * gettscalefrom1 = 0; // scale attribute xml value + char * gettscalefrom2 = 0; // scale attribute xml value + char * time_var_att_nam = 0; // scale attribute name for var or num + char * time_start_att_nam = 0; // scale attribute name for start + char * time_stride_att_nam = 0;// scale attribute name for stride + char * time_count_att_nam = 0; // scale attribute name for count + char * time_max_att_nam = 0; // scale attribute name for max + char * time_min_att_nam = 0; // scale attribute name for min + char * time_var_att_val = 0; // scale attribute value for var or num + char * time_start_att_val = 0; // scale attribute value for start + char * time_stride_att_val = 0;// scale attribute value for stride + char * time_count_att_val = 0; // scale attribute value for count + char * time_max_att_val = 0; // scale attribute value for max + char * time_min_att_val = 0; // scale attribute value for min + int counter = 0; // used to get type of time scale bounds + + // We are going to allow + // 1. a number = just the real time scale - note: not the number of time steps (this is already in adios inq var) but the correpdance between timesteps and real time scale 1 step = 15ms for example + // 2. start/stride/count 3 components - multiple of the mesh time steps + // 3. min/max range where this var is used - a range of the mesh time steps + // 4. An ADIOS var = time could be a list of int stored by user + + + /* We do not fail if this is not given as variables all have nsteps + in ADIOS_inq_var = # of times the var was written + */ + if (!timescale || !strcmp(timescale,"")){ + return 1; + } + + d1 = strdup (timescale); + + char * ptr_end; + c = strtok (d1, ","); + + while (c) + { + struct adios_var_struct * var = 0; + //if (adios_int_is_num (c)) + double tmp_d1; + tmp_d1 = strtod (c,&ptr_end); + if (!(ptr_end && ptr_end[0]==0)) + { + var = adios_find_var_by_name (new_group, c); + if (!var) + { + log_warn ("config.xml: invalid variable %s\n" + "for attribute of var: %s\n", + c, name); + free (d1); + + return 0; + + }else{ + // Found variable ==> create a dims attribute for it. + if (counter == 0){ + gettscalefrom0 = 0; + gettscalefrom0 = strdup(c); + }else if (counter == 1){ + gettscalefrom1 = 0; + gettscalefrom1 = strdup(c); + }else if (counter == 2){ + gettscalefrom2 = 0; + gettscalefrom2 = strdup(c); + } + counter++; + } + } + else + { + if (counter == 0){ + gettscalefrom0 = 0; + gettscalefrom0 = strdup(c); + }else if (counter == 1){ + gettscalefrom1 = 0; + gettscalefrom1 = strdup(c); + }else if (counter == 2){ + gettscalefrom2 = 0; + gettscalefrom2 = strdup(c); + } + counter++; + } + + c = strtok (NULL, ","); + } + + if (counter == 3){ + double tmp_d2; + time_start_att_val = strdup(gettscalefrom0); + conca_var_att_nam(&time_start_att_nam, name, "time-scale-start"); + tmp_d2 = strtod (time_start_att_val, &ptr_end); + // if this is string + if ( !(ptr_end && ptr_end[0]==0)) +// if (!strtod (time_start_att_val, &ptr_end)) + adios_common_define_attribute (p_new_group,time_start_att_nam,path,adios_string,time_start_att_val,""); + else + adios_common_define_attribute (p_new_group,time_start_att_nam,path,adios_double,time_start_att_val,""); + time_stride_att_val = strdup(gettscalefrom1); + conca_var_att_nam(&time_stride_att_nam, name, "time-scale-stride"); + // if this is string + tmp_d2 = strtod (time_stride_att_nam, &ptr_end); + if ( !(ptr_end && ptr_end[0]==0)) +// if (!strtod (time_stride_att_val, &ptr_end)) + adios_common_define_attribute (p_new_group,time_stride_att_nam,path,adios_string,time_stride_att_val,""); + else + adios_common_define_attribute (p_new_group,time_stride_att_nam,path,adios_double,time_stride_att_val,""); + time_count_att_val = strdup(gettscalefrom2); + conca_var_att_nam(&time_count_att_nam, name, "time-scale-count"); + // if this is string + tmp_d2 = strtod (time_count_att_nam, &ptr_end); + if ( !(ptr_end && ptr_end[0]==0)) +// if (!strtod (time_count_att_val, &ptr_end)) + adios_common_define_attribute (p_new_group,time_count_att_nam,path,adios_string,time_count_att_val,""); + else + adios_common_define_attribute (p_new_group,time_count_att_nam,path,adios_double,time_count_att_val,""); + free(time_start_att_val); + free(time_stride_att_val); + free(time_count_att_val); + free(gettscalefrom2); + free(gettscalefrom1); + free(gettscalefrom0); + }else if (counter == 2) { + double tmp_d2; + time_min_att_val = strdup(gettscalefrom0); + conca_var_att_nam(&time_min_att_nam, name, "time-scale-min"); + // if this is string + tmp_d2 = strtod (time_min_att_val, &ptr_end); + if ( !(ptr_end && ptr_end[0]==0)) +// if (!strtod (time_min_att_val, &ptr_end)) + adios_common_define_attribute (p_new_group,time_min_att_nam,path,adios_string,time_min_att_val,""); + else + adios_common_define_attribute (p_new_group,time_min_att_nam,path,adios_double,time_min_att_val,""); + time_max_att_val = strdup(gettscalefrom1); + conca_var_att_nam(&time_max_att_nam, name, "time-scale-max"); + // if this is string + tmp_d2 = strtod (time_max_att_nam, &ptr_end); + if ( !(ptr_end && ptr_end[0]==0)) +// if (!strtod (time_max_att_val, &ptr_end)) + adios_common_define_attribute (p_new_group,time_max_att_nam,path,adios_string,time_max_att_val,""); + else + adios_common_define_attribute (p_new_group,time_max_att_nam,path,adios_double,time_max_att_val,""); + free(time_min_att_val); + free(time_max_att_val); + free(gettscalefrom1); + free(gettscalefrom0); + } else if (counter == 1){ + double tmp_d2; + time_var_att_val = strdup(gettscalefrom0); + tmp_d2 = strtod (time_var_att_val, &ptr_end); + if ( !(ptr_end && ptr_end[0]==0)) +// if (!strtod (time_var_att_val, &ptr_end)) + { + conca_var_att_nam(&time_var_att_nam, name, "time-scale-var"); + adios_common_define_attribute (p_new_group,time_var_att_nam,path,adios_string,time_var_att_val,""); + }else{ + conca_var_att_nam(&time_var_att_nam, name, "time-scale-count"); + adios_common_define_attribute (p_new_group,time_var_att_nam,path,adios_double,time_var_att_val,""); + } + free(gettscalefrom0); + free(time_var_att_val); + }else{ + printf("Error: time format not recognized.\nPlease check documentation for time formatting.\n"); + free(d1); + return 0; + } + + free (d1); + + return 1; +} + +// Parse var hyper slab: lines or planes from a higher dimension mesh +int adios_common_define_var_hyperslab ( const char * hyperslab, + struct adios_group_struct * new_group, + const char * name, + const char * path) +{ + char * c; // comma location + char * d1; // save of strdup + int64_t p_new_group = (int64_t) new_group; + char * gethslabfrom0 = 0; // hslab attribute xml value + char * gethslabfrom1 = 0; // hslab attribute xml value + char * gethslabfrom2 = 0; // hslab attribute xml value + char * hslab_start_att_nam = 0; // hslab attribute name for start + char * hslab_stride_att_nam = 0;// hslab attribute name for stride + char * hslab_count_att_nam = 0; // hslab attribute name for count + char * hslab_max_att_nam = 0; // hslab attribute name for max + char * hslab_min_att_nam = 0; // hslab attribute name for min + char * hslab_single_att_nam = 0;// hslab attribute name for min + char * hslab_start_att_val = 0; // hslab attribute value for start + char * hslab_stride_att_val = 0;// hslab attribute value for stride + char * hslab_count_att_val = 0; // hslab attribute value for count + char * hslab_max_att_val = 0; // hslab attribute value for max + char * hslab_min_att_val = 0; // hslab attribute value for min + char * hslab_sngl_att_val = 0; // hslab attribute value for single value of an array ("25, 4, 50") + // use the ":" symble to indicate that there is an extra dimension to process (process all lines, all planes etc.) + int counter = 0; // used to get type of time hslab bounds + // We are going to allow + // 1. start/stride/count 3 components - indices of the mesh dimensions + // 2. min/max range of the mesh dimensions + // 3. single value + // single value of ":" means there is an extra dimension to process + + /* We do not fail if this is not given as variables all have nsteps + in ADIOS_inq_var = # of times the var was written + */ + if (!hyperslab || !strcmp(hyperslab,"")){ + return 1; + } + + d1 = strdup (hyperslab); + + c = strtok (d1, ","); + + while (c) + { + if (counter == 0){ + gethslabfrom0 = 0; + gethslabfrom0 = strdup(c); + }else if (counter == 1){ + gethslabfrom1 = 0; + gethslabfrom1 = strdup(c); + }else if (counter == 2){ + gethslabfrom2 = 0; + gethslabfrom2 = strdup(c); + } + counter++; + c = strtok (NULL, ","); + } + // TODO: these should be ints only, no decimal for start, stride count, not any number should work + if (counter == 3){ + hslab_start_att_val = strdup(gethslabfrom0); + conca_var_att_nam(&hslab_start_att_nam, name, "start"); + adios_common_define_attribute (p_new_group,hslab_start_att_nam,path,adios_string,hslab_start_att_val,""); + hslab_stride_att_val = strdup(gethslabfrom1); + conca_var_att_nam(&hslab_stride_att_nam, name, "stride"); + adios_common_define_attribute (p_new_group,hslab_stride_att_nam,path,adios_string,hslab_stride_att_val,""); + hslab_count_att_val = strdup(gethslabfrom2); + conca_var_att_nam(&hslab_count_att_nam, name, "count"); + adios_common_define_attribute (p_new_group,hslab_count_att_nam,path,adios_string,hslab_count_att_val,""); + free(hslab_start_att_val); + free(hslab_stride_att_val); + free(hslab_count_att_val); + free(gethslabfrom2); + free(gethslabfrom1); + free(gethslabfrom0); + }else if (counter == 2) { + hslab_min_att_val = strdup(gethslabfrom0); + conca_var_att_nam(&hslab_min_att_nam, name, "min"); + adios_common_define_attribute (p_new_group,hslab_min_att_nam,path,adios_string,hslab_min_att_val,""); + hslab_max_att_val = strdup(gethslabfrom1); + conca_var_att_nam(&hslab_max_att_nam, name, "max"); + adios_common_define_attribute (p_new_group,hslab_max_att_nam,path,adios_string,hslab_max_att_val,""); + free(hslab_min_att_val); + free(hslab_max_att_val); + free(gethslabfrom1); + free(gethslabfrom0); + } else if (counter == 1){ + hslab_sngl_att_val = strdup(gethslabfrom0); + conca_var_att_nam(&hslab_single_att_nam, name, "singleton"); + adios_common_define_attribute (p_new_group,hslab_single_att_nam,path,adios_string,hslab_sngl_att_val,""); + free(hslab_sngl_att_val); + free(gethslabfrom0); + }else{ + printf("Error: hyperslab format not recognized.\nPlease check documentation for hyperslab formatting.\n"); + free(d1); + return 0; + } + + free (d1); + + return 1; + +} + +int adios_define_mesh_nspace (const char * nspace, + struct adios_group_struct * new_group, + const char * name + ) +{ + char * d1; // save of strdup + int64_t p_new_group = (int64_t) new_group; + char * nsp_att_nam = 0; // nspace attribute name + + if (!nspace || !strcmp(nspace, "")) + { +// log_warn ("config.xml: nspace value (optional) is not provided" +// "for uniform mesh: %s\n", name); + return 0; + } + d1 = strdup (nspace); + + adios_conca_mesh_att_nam(&nsp_att_nam, name, "nspace"); + adios_common_define_attribute (p_new_group,nsp_att_nam,"/",adios_string,nspace,""); + free (nsp_att_nam); + free (d1); + + return 1; +} + +int adios_define_mesh_uniform_dimensions (const char * dimensions, + struct adios_group_struct * new_group, + const char * name + ) +{ + char * c; // comma location + char * d1; // save of strdup + int64_t p_new_group = (int64_t) new_group; + char * dim_att_nam = 0; // dimensions attribute name + int counter = 0; // used to create dimX attributes + char counterstr[5] = {0,0,0,0,0}; // used to create dimX attributes + + if (!dimensions || !strcmp(dimensions,"")) + { + log_warn ("config.xml: dimensions value required for " + "uniform mesh: %s\n", name); + return 0; + } + + d1 = strdup (dimensions); + + c = strtok (d1, ","); + + while (c) + { + counterstr[0] = '\0'; + snprintf(counterstr, 5, "%d", counter); + dim_att_nam = 0; + conca_mesh_numb_att_nam(&dim_att_nam, name, "dimensions", counterstr); + adios_common_define_attribute (p_new_group,dim_att_nam,"/",adios_string,c,""); + free (dim_att_nam); + counter++; + c = strtok (NULL, ","); + } + + char * dims = 0; + counterstr[0] = '\0'; + snprintf(counterstr, 5, "%d", counter); + dims = 0; + adios_conca_mesh_att_nam(&dims, name, "dimensions-num"); + + adios_common_define_attribute (p_new_group,dims,"/",adios_integer,counterstr,""); + + free (dims); + + free (d1); + + return 1; +} + +int adios_define_mesh_uniform_maximums (const char * maximum, + struct adios_group_struct * new_group, + const char * name + ) +{ + char * c; // comma location + char * d1; // save of strdup + int64_t p_new_group = (int64_t) new_group; + char * max_att_nam = 0; // maxima attribute name + int counter = 0; // used to create maxX attributes + char counterstr[5] = {0,0,0,0,0}; // used to create maxX attributes + + if (!maximum || !strcmp(maximum,"")) + { +// log_warn ("config.xml: maximum value (optional) is not provided" +// "for uniform mesh: %s\n", +// name); + return 0; + } + + d1 = strdup (maximum); + + c = strtok (d1, ","); + + while (c) + { + counterstr[0] = '\0'; + snprintf(counterstr, 5, "%d", counter); + max_att_nam = 0; + conca_mesh_numb_att_nam(&max_att_nam, name, "maximums", counterstr); + adios_common_define_attribute (p_new_group,max_att_nam,"/",adios_string,c,""); + free (max_att_nam); + counter++; + c = strtok (NULL, ","); + } + + char * maxa = 0; + counterstr[0] = '\0'; + snprintf(counterstr, 5, "%d", counter); + maxa = 0; + adios_conca_mesh_att_nam(&maxa, name, "maximums-num"); + adios_common_define_attribute (p_new_group,maxa,"/",adios_integer,counterstr,""); + free (maxa); + free (d1); + + return 1; +} + +int adios_define_mesh_uniform_origins (const char * origin, + struct adios_group_struct * new_group, + const char * name + ) +{ + char * c; // comma location + char * d1; // save of strdup + int64_t p_new_group = (int64_t) new_group; + char * org_att_nam = 0; // origins attribute name + int counter = 0; // used to create orgX attributes + char counterstr[5] = {0,0,0,0,0}; // used to create orgX attributes + + if (!origin || !strcmp(origin,"")) + { +// log_warn ("config.xml: origin value (optional) not provided " +// "for uniform mesh: %s\n", +// name); + return 0; + } + + d1 = strdup (origin); + + c = strtok (d1, ","); + + while (c) + { + counterstr[0] = '\0'; + snprintf(counterstr, 5, "%d", counter); + org_att_nam = 0; + conca_mesh_numb_att_nam(&org_att_nam, name, "origins", counterstr); + adios_common_define_attribute (p_new_group,org_att_nam,"/",adios_string,c,""); + free (org_att_nam); + counter++; + c = strtok (NULL, ","); + } + + char * orgs = 0; + counterstr[0] = '\0'; + snprintf(counterstr, 5, "%d", counter); + orgs = 0; + adios_conca_mesh_att_nam(&orgs, name, "origins-num"); + adios_common_define_attribute (p_new_group,orgs,"/",adios_integer,counterstr,""); + + free (orgs); + free (d1); + return 1; +} + +int adios_define_mesh_uniform_spacings (const char * spacing, + struct adios_group_struct * new_group, + const char * name + ) +{ + char * c; // comma location + char * d1; // save of strdup + int64_t p_new_group = (int64_t) new_group; + char * spa_att_nam = 0; // spacings attribute name + int counter = 0; // used to create spaX attributes + char counterstr[5] = {0,0,0,0,0}; // used to create spaX attributes if (!spacing) + + if (!spacing || !strcmp(spacing,"")) + { +// log_warn ("config.xml: spacing value (optional) not provided " +// "for uniform mesh: %s\n", +// name); + return 0; + } + + d1 = strdup (spacing); + + c = strtok (d1, ","); + + while (c) + { + counterstr[0] = '\0'; + snprintf(counterstr, 5, "%d", counter); + spa_att_nam = 0; + conca_mesh_numb_att_nam(&spa_att_nam, name, "spacings", counterstr); + adios_common_define_attribute (p_new_group,spa_att_nam,"/",adios_string,c,""); + free (spa_att_nam); + counter++; + c = strtok (NULL, ","); + } + + char * spas = 0; + counterstr[0] = '\0'; + snprintf(counterstr, 5, "%d", counter); + spas = 0; + adios_conca_mesh_att_nam(&spas, name, "spacings-num"); + adios_common_define_attribute (p_new_group,spas,"/",adios_integer,counterstr,""); + free (spas); + free (d1); + + return 1; +} + +int adios_define_mesh_rectilinear_dimensions (const char * dimensions, + struct adios_group_struct * new_group, + const char * name + ) +{ + char * c; // comma location + char * d1; // save of strdup + int64_t p_new_group = (int64_t) new_group; + char * dim_att_nam = 0; // dimensions attribute name + int counter = 0; // used to create dimX attributes + char counterstr[5] = {0,0,0,0,0}; // used to create dimX attributes + + if (!dimensions || !strcmp(dimensions,"")) + { + log_warn ("config.xml: dimensions value required " + "for rectilinear mesh: %s\n", name); + return 0; + } + + d1 = strdup (dimensions); + + c = strtok (d1, ","); + + while (c) + { + counterstr[0] = '\0'; + snprintf(counterstr, 5, "%d", counter); + dim_att_nam = 0; + conca_mesh_numb_att_nam(&dim_att_nam, name, "dimensions", counterstr); + adios_common_define_attribute (p_new_group,dim_att_nam,"/",adios_string,c,""); + free (dim_att_nam); + counter++; + c = strtok (NULL, ","); + } + + char * dims = 0; + counterstr[0] = '\0'; + snprintf(counterstr, 5, "%d", counter); + dims = 0; + adios_conca_mesh_att_nam(&dims, name, "dimensions-num"); + adios_common_define_attribute (p_new_group,dims,"/",adios_integer,counterstr,""); + + free (dims); + free (d1); + + return 1; +} + +int adios_define_mesh_rectilinear_coordinatesMultiVar (const char * coordinates, + struct adios_group_struct * new_group, + const char * name + ) +{ + char * c; // comma location + char * d1; // save of strdup + int64_t p_new_group = (int64_t) new_group; + char * coo_att_nam = 0; // coordinates attribute name + int counter = 0; // used to create ptsX attributes + char counterstr[5] = {0,0,0,0,0}; // used to create ptsX attributes + + if (!coordinates || !strcmp(coordinates,"")) + { + log_warn ("config.xml: coordinates-multi-var value required " + "for rectilinear mesh: %s\n", name); + + return 0; + } + + d1 = strdup (coordinates); + + c = strtok (d1, ","); + + while (c) + { + coo_att_nam = 0; + counterstr[0] = '\0'; + snprintf(counterstr, 5, "%d", counter); + conca_mesh_numb_att_nam(&coo_att_nam, name, "coords-multi-var", counterstr); + adios_common_define_attribute (p_new_group,coo_att_nam,"/",adios_string,c,""); + free (coo_att_nam); + counter++; + c = strtok (NULL, ","); + } + + // At this points, coordinates should point to at least 2 variables + // otherwise let the user know to use the coordinates-single-var tag + if (counter > 1) { + char * coords = 0; + counterstr[0] = '\0'; + snprintf(counterstr, 5, "%d", counter); + adios_conca_mesh_att_nam(&coords, name, "coords-multi-var-num"); + adios_common_define_attribute (p_new_group,coords,"/",adios_integer,counterstr,""); + free (coords); + } + else + { + log_warn ("config.xml: coordinates-multi-var expects " + "at least 2 variables (%s)\n", name); + free (d1); + return 0; + } + + free (d1); + + return 1; +} + +int adios_define_mesh_rectilinear_coordinatesSingleVar (const char * coordinates, + struct adios_group_struct * new_group, + const char * name + ) +{ + char * d1; // save of strdup + int64_t p_new_group = (int64_t) new_group; + char * coo_att_nam = 0; // coordinates attribute name + + if (!coordinates || !strcmp(coordinates,"")) + { + log_warn ("config.xml: coordinates-single-var value required " + "for rectilinear mesh: %s\n", name); + + return 0; + } + + d1 = strdup (coordinates); + + adios_conca_mesh_att_nam(&coo_att_nam, name, "coords-single-var"); + adios_common_define_attribute (p_new_group,coo_att_nam,"/",adios_string,d1,""); + free (coo_att_nam); + free (d1); + return 1; +} + +/* +int adios_define_mesh_structured_nspace (const char * nspace + ,struct adios_group_struct * new_group + ,const char * name + ) +{ + char * d1; // save of strdup + int64_t p_new_group = (int64_t) new_group; + char * nsp_att_nam = 0; // nspace attribute name + + if (!nspace) + { + log_warn ("config.xml: npsace value required " + "for structured mesh: %s\n" + ,name + ); + + return 0; + } + + d1 = strdup (nspace); + adios_conca_mesh_att_nam(&nsp_att_nam, name, "nspace"); + adios_common_define_attribute (p_new_group,nsp_att_nam,"/",adios_string,nspace,""); + free (nsp_att_nam); + free (d1); + + return 1; +} +*/ + +int adios_define_mesh_structured_dimensions (const char * dimensions, + struct adios_group_struct * new_group, + const char * name + ) +{ + char * c; // comma location + char * d1; // save of strdup + int64_t p_new_group = (int64_t) new_group; + char * dim_att_nam = 0; // dimensions attribute name + int counter = 0; // used to create dimX attributes + char counterstr[5] = {0,0,0,0,0}; // used to create dimX attributes + + if (!dimensions || !strcmp(dimensions,"")) + { + log_warn ("config.xml: dimensions value required " + "for structured mesh: %s\n", name); + + return 0; + } + + d1 = strdup (dimensions); + + c = strtok (d1, ","); + while (c) + { + counterstr[0] = '\0'; + snprintf(counterstr, 5, "%d", counter); + dim_att_nam = 0; + conca_mesh_numb_att_nam(&dim_att_nam, name, "dimensions", counterstr); + adios_common_define_attribute (p_new_group,dim_att_nam,"/",adios_string,c,""); + free (dim_att_nam); + counter++; + c = strtok (NULL, ","); + } + + char * dims = 0; + counterstr[0] = '\0'; + snprintf(counterstr, 5, "%d", counter); + dims = 0; + adios_conca_mesh_att_nam(&dims, name, "dimensions-num"); + adios_common_define_attribute (p_new_group,dims,"/",adios_integer,counterstr,""); + + free (dims); + free (d1); + return 1; +} + +int adios_define_mesh_structured_pointsSingleVar (const char * points, + struct adios_group_struct * new_group, + const char * name + ) +{ + char * d1; // save of strdup + int64_t p_new_group = (int64_t) new_group; + char * pts_att_nam = 0; // points attribute name + + if (!points || !strcmp(points,"")) + { + log_warn ("config.xml: points-single-var value required " + "for structured mesh: %s\n", name); + + return 0; + } + + d1 = strdup (points); + adios_conca_mesh_att_nam(&pts_att_nam, name, "points-single-var"); + adios_common_define_attribute (p_new_group,pts_att_nam,"/",adios_string,d1,""); + free (pts_att_nam); + free (d1); + return 1; +} + +int adios_define_mesh_structured_pointsMultiVar (const char * points, + struct adios_group_struct * new_group, + const char * name + ) +{ + char * c; // comma location + char * d1; // save of strdup + int64_t p_new_group = (int64_t) new_group; + char * pts_att_nam = 0; // pointss attribute name + int counter = 0; // used to create ptsX attributes + char counterstr[5] = {0,0,0,0,0}; // used to create ptsX attributes + + if (!points || !strcmp(points,"")) + { + log_warn ("config.xml: points-multi-var value required " + "for structured mesh: %s\n", name); + + return 0; + } + + d1 = strdup (points); + + c = strtok (d1, ","); + while (c) + { + pts_att_nam = 0; + counterstr[0] = '\0'; + snprintf(counterstr, 5, "%d", counter); + conca_mesh_numb_att_nam(&pts_att_nam, name, "points-multi-var", counterstr); + adios_common_define_attribute (p_new_group,pts_att_nam,"/",adios_string,c,""); + free (pts_att_nam); + counter++; + c = strtok (NULL, ","); + } + + // Define an attribute showing the number of mesh_vars + // Should be more than one in this multi-var parsing + if (counter > 1){ + char * pts = 0; + counterstr[0] = '\0'; + snprintf(counterstr, 5, "%d", counter); + adios_conca_mesh_att_nam(&pts, name, "points-multi-var-num"); + adios_common_define_attribute (p_new_group,pts,"/",adios_integer,counterstr,""); + free (pts); + } else + { + log_warn ("config.xml: points-multi-var tag for mesh: %s " + " expects at least 2 variables\n", name); + free (d1); + + return 0; + } + + free (d1); + + return 1; +} + +/* +int adios_define_mesh_unstructured_nspace (const char * nspace + ,struct adios_group_struct * new_group + ,const char * name + ) +{ + char * d1; // save of strdup + int64_t p_new_group = (int64_t) new_group; + char * nsp_att_nam = 0; // nspace attribute name + + if (!nspace) + { + log_warn ("config.xml: nspace value required for unstructured mesh: %s\n", + name); + + return 0; + } + + d1 = strdup (nspace); + adios_conca_mesh_att_nam(&nsp_att_nam, name, "nspace"); + adios_common_define_attribute (p_new_group,nsp_att_nam,"/",adios_string,nspace,""); + free (nsp_att_nam); + free (d1); + + return 1; +} +*/ + +int adios_define_mesh_unstructured_npoints (const char * npoints + ,struct adios_group_struct * new_group + ,const char * name + ) +{ + char * d1; // save of strdup + int64_t p_new_group = (int64_t) new_group; + char * npts_att_nam = 0; // npoints attribute name + + if (!npoints || !strcmp(npoints,"")) + { +// log_warn ("config.xml: npoints value required for unstructured mesh %s:\n", +// name); + + return 0; + } + + d1 = strdup (npoints); + + adios_conca_mesh_att_nam(&npts_att_nam, name, "npoints"); + adios_common_define_attribute (p_new_group,npts_att_nam,"/",adios_string,npoints,""); + free (npts_att_nam); + + free (d1); + + return 1; +} + +int adios_define_mesh_unstructured_pointsMultiVar (const char * points, + struct adios_group_struct * new_group, + const char * name + ) +{ + char * c; // comma location + char * d1; // save of strdup + int64_t p_new_group = (int64_t) new_group; + char * pts_att_nam = 0; // pointss attribute name + int counter = 0; // used to create ptsX attributes + char counterstr[5] = {0,0,0,0,0}; // used to create ptsX attributes + + if (!points || !strcmp(points,"")) + { + log_warn ("config.xml: points-multi-var value required " + "for unstructured mesh: %s\n", name); + + return 0; + } + + d1 = strdup (points); + c = strtok (d1, ","); + + while (c) + { + pts_att_nam = 0; + counterstr[0] = '\0'; + snprintf(counterstr, 5, "%d", counter); + conca_mesh_numb_att_nam(&pts_att_nam, name, "points-multi-var", counterstr); + adios_common_define_attribute (p_new_group,pts_att_nam,"/",adios_string,c,""); + free (pts_att_nam); + counter++; + c = strtok (NULL, ","); + } + + // At this point we expect at least 2 "points-multi-var values + if (counter > 1){ + char * pts = 0; + counterstr[0] = '\0'; + snprintf(counterstr, 5, "%d", counter); + adios_conca_mesh_att_nam(&pts, name, "points-multi-var-num"); + adios_common_define_attribute (p_new_group,pts,"/",adios_integer,counterstr,""); + free (pts); + free (d1); + } else + { + log_warn ("config.xml: points-multi-var tag expects " + "at least two variabels. (%s)\n" , name); + free (d1); + return 0; + } + + return 1; +} + +int adios_define_mesh_unstructured_pointsSingleVar (const char * points, + struct adios_group_struct * new_group, + const char * name + ) +{ + char * d1; // save of strdup + int64_t p_new_group = (int64_t) new_group; + char * pts_att_nam = 0; // points attribute name + + if (!points || !strcmp(points,"")) + { + log_warn ("config.xml: points-single-var value required " + "for unstructured mesh: %s\n", name); + + return 0; + } + + d1 = strdup (points); + adios_conca_mesh_att_nam(&pts_att_nam, name, "points-single-var"); + adios_common_define_attribute (p_new_group,pts_att_nam,"/",adios_string,d1,""); + free (pts_att_nam); + + free (d1); + + return 1; +} + +int adios_define_mesh_unstructured_uniformCells (const char * count, + const char * data, + const char * type, + struct adios_group_struct * new_group, + const char * name + ) +{ + char * d1; // save of strdup + int64_t p_new_group = (int64_t) new_group; + char * ncellset_att_nam = 0; // ncellset attribute + char * cellcount_att_nam = 0; // single cell count attribute + char * celldata_att_nam = 0; // single cell data attribute + char * celltype_att_nam = 0; // single cell type attribute + + adios_conca_mesh_att_nam(&ncellset_att_nam,name,"ncsets"); + adios_common_define_attribute (p_new_group,ncellset_att_nam,"/",adios_integer,"1",""); + free (ncellset_att_nam); + + if (!count || !strcmp(count,"")) + { + log_warn ("config.xml: uniform-cells count value required " + "for unstructured mesh: %s\n", name); + + return 0; + } + if (!data || !strcmp(data,"")) + { + log_warn ("config.xml: uniform-cells data value required " + "for unstructured mesh: %s\n", name); + + return 0; + } + if (!type || !strcmp(type,"")) + { + log_warn ("config.xml: uniform-cells type value required " + "for unstructured mesh: %s\n", name); + + return 0; + } + + d1 = strdup (count); + adios_conca_mesh_att_nam(&cellcount_att_nam, name, "ccount"); + adios_common_define_attribute (p_new_group,cellcount_att_nam,"/",adios_string,d1,""); + free (cellcount_att_nam); + free (d1); + + d1 = strdup (data); + adios_conca_mesh_att_nam(&celldata_att_nam, name, "cdata"); + adios_common_define_attribute (p_new_group,celldata_att_nam,"/",adios_string,d1,""); + free (celldata_att_nam); + free (d1); + + d1 = strdup (type); + adios_conca_mesh_att_nam(&celltype_att_nam, name, "ctype"); + adios_common_define_attribute (p_new_group,celltype_att_nam,"/",adios_string,d1,""); + free(celltype_att_nam); + free (d1); + + return 1; +} + +int adios_define_mesh_unstructured_mixedCells (const char * count, + const char * data, + const char * types, + struct adios_group_struct * new_group, + const char * name + ) +{ + char * c; // comma location + char * d1; // save of strdup + int counter = 0; // used to create countX, typeX, dataX? attributes + char counterstr[5] = {0,0,0,0,0}; // used to create countX, typeX, dataX? attributes + int64_t p_new_group = (int64_t) new_group; + char * ncellset_att_nam = 0; // ncellset attribute + char * ccounts_att_nam = 0; // ccountX attributes + char * cdata_att_nam = 0; // cdataX attributes + char * celltype_att_nam = 0; // ctypeX attributes + + if (!count || !strcmp(count,"")) + { + log_warn ("config.xml: mixed-cells count value required " + "for unstructured mesh: %s\n", name); + + return 0; + } + if (!data || !strcmp(data,"")) + { + log_warn ("config.xml: mixed-cells data value required " + "for unstructured mesh: %s\n", name); + + return 0; + } + if (!types || !strcmp(types,"")) + { + log_warn ("config.xml: mixed-cells type value required " + "for unstructured mesh: %s\n", name); + + return 0; + } + + d1 = strdup (count); + c = strtok (d1, ","); + while (c) + { + //cell_list->cell_list.count.var = 0; + //cell_list->cell_list.count.rank = strtod (c, 0); + counterstr[0] = '\0'; + snprintf(counterstr, 5, "%d", counter); + ccounts_att_nam = 0; + conca_mesh_numb_att_nam(&ccounts_att_nam, name, "ccount", counterstr); + adios_common_define_attribute (p_new_group,ccounts_att_nam,"/",adios_string,c,""); + free (ccounts_att_nam); + counter++; + c = strtok (NULL, ","); + } +// free (d1); + + // We should have at least 2 cell sets, otherwise the cells are uniform + if (counter <= 1){ + log_warn ("config.xml: Please provide at least 2 cell counts of mesh: %s\n" + "or use the 'uniform-cells' tag.\n", name); + return 0; + } + + snprintf(counterstr, 5, "%d", counter); + adios_conca_mesh_att_nam(&ncellset_att_nam, name, "ncsets"); + adios_common_define_attribute (p_new_group,ncellset_att_nam,"/",adios_integer,counterstr,""); + free (ncellset_att_nam); + + // From the number of counts expect the same number of data and type items + int cell_set_count = counter; + // Reset counter + counter = 0; + + d1 = strdup (data); + c = strtok (d1, ","); + while (c) + { + cdata_att_nam = 0; + counterstr[0] = '\0'; + snprintf(counterstr, 5, "%d", counter); + conca_mesh_numb_att_nam(&cdata_att_nam, name, "cdata", counterstr); + adios_common_define_attribute (p_new_group,cdata_att_nam,"/",adios_string,c,""); + free (cdata_att_nam); + counter++; + c = strtok (NULL, ","); + } + free (d1); + + // If the number of data variables does not match the number of counts + // Generate an error message + if (counter != cell_set_count){ + log_warn ("config.xml: Please provide at least %d cell data of mesh: %s\n" + "or use the 'uniform-cells' tag\n", cell_set_count, name); + return 0; + } + + // Reset counter + counter = 0; + + d1 = strdup (types); + c = strtok (d1, ","); + + while (c) + { + celltype_att_nam = 0; + counterstr[0] = '\0'; + snprintf(counterstr, 5, "%d", counter); + conca_mesh_numb_att_nam(&celltype_att_nam, name, "ctype", counterstr); + adios_common_define_attribute (p_new_group,celltype_att_nam,"/",adios_string,c,""); + c = strtok (NULL, ","); + counter++; + free (celltype_att_nam); + } + free (d1); + + // If the number of data variables does not match the number of counts + // Generate an error message + if (counter != cell_set_count){ + log_warn ("config.xml: Please provide at least %d cell types of mesh: %s\n" + "or use the 'uniform-cells' tag\n", cell_set_count, name); + return 0; + } + + return 1; +} + +// called by NO-XML API +int adios_common_define_var_mesh (int64_t group_id, const char * varname, const char * meshname, const char * path) +{ + char *mpath = 0; + mpath = malloc(strlen("/adios_schema")+strlen(varname)+1); + strcpy(mpath,varname); + strcat(mpath,"/adios_schema"); + adios_common_define_attribute (group_id, mpath, path, adios_string, meshname, ""); + free (mpath); + return 0; +} + +int adios_common_define_var_centering (int64_t group_id, const char * varname, const char * centering, const char * path) +{ + char *mpath = 0; + mpath = malloc(strlen("/adios_schema/centering")+strlen(varname)+1); + strcpy(mpath,varname); + strcat(mpath,"/adios_schema/centering"); + adios_common_define_attribute (group_id, mpath, path, adios_string, centering, ""); + free (mpath); + return 0; +} + +int adios_common_define_mesh_group (int64_t group_id, const char * name, const char * group) +{ + char * mpath = 0; + mpath = malloc(strlen("/adios_schema/")+strlen(name)+strlen("/mesh-group")+1); + strcpy (mpath, "/adios_schema/"); + strcat (mpath, name); + strcat (mpath, "/mesh-group"); +// adios_conca_mesh_att_nam(&group, name, "mesh-group"); + adios_common_define_attribute (group_id, mpath, "", adios_string, group, ""); + free (mpath); + return 0; +} + +int adios_common_define_mesh_file (int64_t group_id, char * name, char * file){ + char * mpath = 0; + mpath = malloc(strlen("/adios_schema/")+strlen(name)+strlen("/mesh-file")+1); + strcpy (mpath, "/adios_schema/"); + strcat (mpath, name); + strcat (mpath, "/mesh-file"); + adios_common_define_attribute (group_id, mpath, "", adios_string, file, ""); + free (mpath); + return 0; +} + diff --git a/tests/libs/adios/src/core/adios_internals.h b/tests/libs/adios/src/core/adios_internals.h new file mode 100644 index 0000000000..b15bf30a4c --- /dev/null +++ b/tests/libs/adios/src/core/adios_internals.h @@ -0,0 +1,687 @@ +/* + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + */ + +#ifndef ADIOS_INTERNALS_H +#define ADIOS_INTERNALS_H + +#include +#include + +// need the enum for the transports +#include "public/adios_mpi.h" +#include "core/adios_transport_hooks.h" +#include "core/adios_bp_v1.h" +#include "core/qhashtbl.h" +#include "public/adios_schema.h" + +// NCSU ALACRITY-ADIOS: Include needed for the transform spec struct +#include "core/transforms/adios_transforms_specparse.h" + +#if defined ADIOS_TIMERS || defined ADIOS_TIMER_EVENTS +#include "core/adios_timing.h" +#endif + +/* Some cluster experience MPI_File_write() errors when trying to write INT32_MAX bytes (2GB) at once. + * Use this number to limit block sizes written with MPI-IO. + */ +#define MAX_MPIWRITE_SIZE 2130706432 /* 2GB - 16MB */ + +enum ADIOS_METHOD_MODE {adios_mode_write = 1 + ,adios_mode_read = 2 + ,adios_mode_update = 3 // not supported yet + ,adios_mode_append = 4 + }; + +struct adios_dimension_struct; +struct adios_var_struct; + +// NCSU - Generic data for statistics +struct adios_stat_struct +{ + void * data; +}; + + +struct adios_var_struct +{ + uint32_t id; + struct adios_var_struct *parent_var; // copy_var_written links "written var" to "var definition" + + char * name; + char * path; + // ADIOS Schema: adding a mesh XML attribute to variable tag + // char * mesh; + enum ADIOS_DATATYPES type; + struct adios_dimension_struct * dimensions; + enum ADIOS_FLAG got_buffer; + enum ADIOS_FLAG is_dim; // if it is a dimension, we need to + // track for netCDF usage + uint64_t write_offset; // offset this var was written at [for writes] + + enum ADIOS_FLAG free_data; // primarily used for writing + void * data; // primarily used for reading + uint64_t data_size; // primarily used for reading + uint32_t write_count; // added to support multiple writes for transform layer. + // Might needed for other things in the future. + + // NCSU - Adding stat related variables + struct adios_stat_struct ** stats; // 2D array. Complex numbers can contain upto 3 parts + uint32_t bitmap; + + // NCSU ALACRITY-ADIOS - Adding transform-related fields + enum ADIOS_TRANSFORM_TYPE transform_type; + struct adios_transform_spec *transform_spec; + + enum ADIOS_DATATYPES pre_transform_type; + struct adios_dimension_struct *pre_transform_dimensions; + uint16_t transform_metadata_len; + void *transform_metadata; + + struct adios_var_struct * next; +}; + +// NCSU - structure for histogram +struct adios_hist_struct +{ + double min; //minimum value of histogram ** for when we use complex variables + double max; //maximum value of histogram + uint32_t num_breaks; //number of break points for the histogram + uint32_t * frequencies; //array of frequencies for the histogram + double * breaks; //breaks array for the histogram, output this to gnuplot +}; + +struct adios_attribute_struct +{ + uint32_t id; + char * name; + char * path; + enum ADIOS_DATATYPES type; + void * value; + struct adios_var_struct * var; + uint64_t write_offset; // offset this var was written at [for writes] + + struct adios_attribute_struct * next; +}; + +struct adios_method_struct +{ + enum ADIOS_IO_METHOD m; + char * base_path; + char * method; + void * method_data; + char * parameters; + int iterations; + int priority; + struct adios_group_struct * group; + MPI_Comm init_comm; // MPI Communicator used only for the method's init call +}; + +struct adios_method_list_struct +{ + struct adios_method_struct * method; + struct adios_method_list_struct * next; +}; + + +struct adios_group_struct +{ + uint16_t id; + uint16_t member_count; // count of variables + attributes + uint64_t group_offset; + + char * name; + uint32_t var_count; + enum ADIOS_FLAG adios_host_language_fortran; + enum ADIOS_FLAG all_unique_var_names; // obsolete: remove + struct adios_var_struct * vars; + struct adios_var_struct * vars_tail; // last variable in the list 'vars' + qhashtbl_t *hashtbl_vars; + struct adios_var_struct * vars_written; + struct adios_var_struct * vars_written_tail; // last variable in 'vars_written' + struct adios_attribute_struct * attributes; + char * group_comm; + char * group_by; + char * time_index_name; + uint32_t time_index; + enum ADIOS_FLAG stats_on; + uint32_t process_id; + + struct adios_method_list_struct * methods; + + struct adios_mesh_struct * meshs; + int mesh_count; + enum ADIOS_FLAG all_unique_mesh_names; + + int attrid_update_epoch; // ID of special attribute "/__adios__/update_time_epoch" to find it fast + +#if defined ADIOS_TIMERS || defined ADIOS_TIMER_EVENTS + // Using a "double buffering" approach. Current write cycle stored in timing_obj, while timing info from + // previous cycle is kept in prev_timing_obj, and is written before close + struct adios_timing_struct * timing_obj; + struct adios_timing_struct * prev_timing_obj; +#endif +}; + +struct adios_group_list_struct +{ + struct adios_group_struct * group; + + struct adios_group_list_struct * next; +}; + +struct adios_file_struct +{ + char * name; + int32_t subfile_index; // needs to be set in ADIOS method if generates subfiles + struct adios_group_struct * group; + enum ADIOS_METHOD_MODE mode; + uint64_t data_size; + uint64_t write_size_bytes; + + enum ADIOS_FLAG shared_buffer; + + uint64_t pg_start_in_file; // where this pg started in the file + + uint64_t base_offset; // where writing last ocurred + + char * buffer; // buffer we use for building the output + uint64_t offset; // current offset to write at + uint64_t bytes_written; // largest offset into buffer written to + uint64_t buffer_size; // how big the buffer is currently + + uint64_t vars_start; // offset for where to put the var/attr count + uint32_t vars_written; // count of vars/attrs to write + + MPI_Comm comm; // duplicate of comm received in adios_open() +}; + +struct adios_dimension_item_struct +{ + uint64_t rank; // for numerical value + struct adios_var_struct * var; // for value stored in variable + struct adios_attribute_struct * attr; // for value stored in attribute + enum ADIOS_FLAG time_index; +}; + +struct adios_dimension_struct +{ + struct adios_dimension_item_struct dimension; + struct adios_dimension_item_struct global_dimension; + struct adios_dimension_item_struct local_offset; + struct adios_dimension_struct * next; +}; + +//mesh structure used by write method +// ADIOS Schema: modifying mesh struct +struct adios_mesh_struct +{ + // ADIOS Schema: adding mesh names + // Groups can have multiple meshes + char * name; + enum ADIOS_FLAG time_varying; + enum ADIOS_MESH_TYPE type; +/* union + { + struct adios_mesh_uniform_struct * uniform; + struct adios_mesh_rectilinear_struct * rectilinear; + struct adios_mesh_structured_struct * structured; + struct adios_mesh_unstructured_struct * unstructured; + };*/ + struct adios_mesh_struct * next; +}; + +//////////////////////// +// mesh support data structures +//////////////////////// +struct adios_mesh_item_struct +{ + double rank; + struct adios_var_struct * var; +}; + +struct adios_mesh_item_list_struct +{ + struct adios_mesh_item_struct item; + struct adios_mesh_item_list_struct * next; +}; + +struct adios_mesh_var_list_struct +{ + struct adios_var_struct * var; + struct adios_mesh_var_list_struct * next; +}; + +struct adios_mesh_cell_list_struct +{ + enum ADIOS_FLAG cells_uniform; + struct adios_mesh_item_struct count; + struct adios_var_struct * data; + struct adios_mesh_item_struct type; +}; + +struct adios_mesh_cell_list_list_struct +{ + struct adios_mesh_cell_list_struct cell_list; + struct adios_mesh_cell_list_list_struct * next; +}; + +/* +// Main mesh structs +////////////////////////////////////////////////////////////// +struct adios_mesh_uniform_struct +{ + struct adios_mesh_item_list_struct * dimensions; + struct adios_mesh_item_list_struct * origin; + struct adios_mesh_item_list_struct * spacing; + // ADIOS Schema: adding option to provide origin and maximum + // instead restricting users to origin and spacing + struct adios_mesh_item_list_struct * maximum; +}; + +struct adios_mesh_rectilinear_struct +{ + enum ADIOS_FLAG coordinates_single_var; + struct adios_mesh_item_list_struct * dimensions; + struct adios_mesh_var_list_struct * coordinates; +}; + +struct adios_mesh_structured_struct +{ + enum ADIOS_FLAG points_single_var; + struct adios_mesh_item_struct * nspace; + struct adios_mesh_item_list_struct * dimensions; + struct adios_mesh_var_list_struct * points; +}; + +struct adios_mesh_unstructured_struct +{ + // ADIOS Schema: adding single/multi points option + // adding nspace to allow 2D mesh in 3D for example, + // finally adding the concept of cellset/cellsetcount + enum ADIOS_FLAG points_single_var; + struct adios_mesh_item_struct * nspace; + struct adios_mesh_var_list_struct * points; + struct adios_mesh_item_struct * points_count; + struct adios_mesh_cell_list_list_struct * cell_list; + struct adios_mesh_item_struct * cell_set_count; +}; +*/ + +typedef void (* ADIOS_INIT_FN) (const PairStruct * parameters + ,struct adios_method_struct * method + ); +typedef int (* ADIOS_OPEN_FN) (struct adios_file_struct * fd + ,struct adios_method_struct * method, MPI_Comm comm + ); +typedef enum ADIOS_FLAG (* ADIOS_SHOULD_BUFFER_FN) + (struct adios_file_struct * fd + ,struct adios_method_struct * method + ); +typedef void (* ADIOS_WRITE_FN) (struct adios_file_struct * fd + ,struct adios_var_struct * v + ,void * data + ,struct adios_method_struct * method + ); +typedef void (* ADIOS_GET_WRITE_BUFFER_FN) (struct adios_file_struct * fd + ,struct adios_var_struct * v + ,uint64_t * size + ,void ** buffer + ,struct adios_method_struct * method + ); +typedef void (* ADIOS_READ_FN) (struct adios_file_struct * fd + ,struct adios_var_struct * v + ,void * buffer + ,uint64_t buffer_size + ,struct adios_method_struct * method + ); +typedef void (* ADIOS_CLOSE_FN) (struct adios_file_struct * fd + ,struct adios_method_struct * method + ); +typedef void (* ADIOS_FINALIZE_FN) (int mype + ,struct adios_method_struct * method + ); +typedef void (* ADIOS_END_ITERATION_FN) (struct adios_method_struct * method); +typedef void (* ADIOS_START_CALCULATION_FN) + (struct adios_method_struct * method); +typedef void (* ADIOS_STOP_CALCULATION_FN) + (struct adios_method_struct * method); + +struct adios_transport_struct +{ + char * method_name; + ADIOS_INIT_FN adios_init_fn; + ADIOS_OPEN_FN adios_open_fn; + ADIOS_SHOULD_BUFFER_FN adios_should_buffer_fn; + ADIOS_WRITE_FN adios_write_fn; + ADIOS_GET_WRITE_BUFFER_FN adios_get_write_buffer_fn; + ADIOS_READ_FN adios_read_fn; + ADIOS_CLOSE_FN adios_close_fn; + ADIOS_FINALIZE_FN adios_finalize_fn; + ADIOS_END_ITERATION_FN adios_end_iteration_fn; + ADIOS_START_CALCULATION_FN adios_start_calculation_fn; + ADIOS_STOP_CALCULATION_FN adios_stop_calculation_fn; +}; + +struct adios_buffer_part_entry +{ + void * buffer; + size_t buffer_size; +}; + +struct adios_parse_buffer_struct +{ + struct adios_var_struct * vars; + enum ADIOS_FLAG all_unique_var_names; + uint64_t buffer_len; + void * buffer; +}; + + +////////////////////////////////////////////////////////////////////////////// +// Function Delcarations +////////////////////////////////////////////////////////////////////////////// +uint64_t adios_size_of_var (struct adios_var_struct * v, void * data); +uint64_t adios_size_of_attribute (struct adios_attribute_struct * a); + +uint64_t adios_data_size (struct adios_group_struct * g); + +struct adios_method_list_struct * adios_get_methods (void); +struct adios_group_list_struct * adios_get_groups (void); + +struct adios_var_struct * adios_find_var_by_name (struct adios_group_struct * g, + const char * fullpath); +struct adios_var_struct * adios_find_var_by_id (struct adios_var_struct * root + ,uint32_t id + ); +struct adios_attribute_struct * adios_find_attribute_by_id + (struct adios_attribute_struct * root + ,uint32_t id + ); + +struct adios_attribute_struct * adios_find_attribute_var_by_name + (struct adios_attribute_struct * root + ,const char * name + ); + +/*struct adios_attribute_struct * adios_find_attribute_var_by_id + (struct adios_attribute_struct * root + ,uint32_t id + );*/ + +/*void adios_parse_buffer (struct adios_file_struct * fd, char * buffer + ,uint64_t len + );*/ + +int adios_parse_dimension (const char * dimension + ,const char * global_dimension + ,const char * local_offset + ,struct adios_group_struct * g + ,struct adios_dimension_struct * dim + ); + +/*void adios_extract_string (char ** out, const char * in, int size);*/ + +int adios_common_define_attribute (int64_t group, const char * name + ,const char * path + ,enum ADIOS_DATATYPES type + ,const char * value + ,const char * var + ); + +int adios_common_define_attribute_byvalue (int64_t group, const char * name + ,const char * path + ,enum ADIOS_DATATYPES type + ,void * value + ); + +void adios_append_method (struct adios_method_struct * method); + +void adios_add_method_to_group (struct adios_method_list_struct ** root + ,struct adios_method_struct * method + ); + +void adios_append_group (struct adios_group_struct * group); + +//void adios_append_var (struct adios_group_struct * g, struct adios_var_struct * var); + +void adios_append_dimension (struct adios_dimension_struct ** root + ,struct adios_dimension_struct * dimension + ); + +void adios_append_attribute (struct adios_attribute_struct ** root + ,struct adios_attribute_struct * attribute + ,uint32_t id + ); + +int adios_common_declare_group (int64_t * id, const char * name + ,enum ADIOS_FLAG host_language_fortran + ,const char * coordination_comm + ,const char * coordination_var + ,const char * time_index + ,enum ADIOS_FLAG stats + ); + +int64_t adios_common_define_var (int64_t group_id, const char * name + ,const char * path, enum ADIOS_DATATYPES type + ,const char * dimensions + ,const char * global_dimensions + ,const char * local_offsets + ); + +// set a transform method for a variable (=none if this function is never called) +int adios_common_set_transform (int64_t var_id, const char *transform_type_str); + +int adios_common_define_var_characteristics (struct adios_group_struct * g + ,const char * var_name + ,const char * bin_interval + ,const char * bin_min + ,const char * bin_max + ,const char * bin_count + ); + +void adios_common_get_group (int64_t * group_id, const char * name); +int adios_common_delete_vardefs (struct adios_group_struct * g); +int adios_common_free_group (int64_t id); + +// ADIOS file format functions + +uint16_t adios_calc_var_characteristics_dims_overhead(struct adios_dimension_struct * d); +uint16_t adios_calc_var_overhead_v1 (struct adios_var_struct * v); +uint32_t adios_calc_attribute_overhead_v1 (struct adios_attribute_struct * a); +uint64_t adios_calc_overhead_v1 (struct adios_file_struct * fd); + +int adios_write_version_v1 (char ** buffer + ,uint64_t * buffer_size + ,uint64_t * buffer_offset + ); +int adios_write_version_flag_v1 (char ** buffer + ,uint64_t * buffer_size + ,uint64_t * buffer_offset + ,uint32_t flag + ); +int adios_write_process_group_header_v1 (struct adios_file_struct * fd + ,uint64_t total_size + ); + +void adios_copy_var_written (struct adios_group_struct * g, + struct adios_var_struct * var); + +// data is only there for sizing +uint64_t adios_write_var_header_v1 (struct adios_file_struct * fd + ,struct adios_var_struct * v + ); +int adios_generate_var_characteristics_v1 (struct adios_file_struct * fd + ,struct adios_var_struct * var + ); +uint16_t adios_write_var_characteristics_v1 (struct adios_file_struct * fd + ,struct adios_var_struct * var + ); +int adios_write_var_payload_v1 (struct adios_file_struct * fd + ,struct adios_var_struct * var + ); +int adios_write_attribute_v1 (struct adios_file_struct * fd + ,struct adios_attribute_struct * a + ); +int adios_write_open_vars_v1 (struct adios_file_struct * fd); +int adios_write_close_vars_v1 (struct adios_file_struct * fd); +int adios_write_open_attributes_v1 (struct adios_file_struct * fd); +int adios_write_close_attributes_v1 (struct adios_file_struct * fd); + +// allocate the adios_index_struct, freed in adios_free_index_v1 +struct adios_index_struct_v1 * adios_alloc_index_v1 (int alloc_hashtables); + +int adios_write_index_v1 (char ** buffer + ,uint64_t * buffer_size + ,uint64_t * buffer_offset + ,uint64_t index_start + ,struct adios_index_struct_v1 * index + ); + +void adios_build_index_v1 (struct adios_file_struct * fd + ,struct adios_index_struct_v1 * index + ); + +void adios_merge_index_v1 ( + struct adios_index_struct_v1 * main_index + ,struct adios_index_process_group_struct_v1 * new_pg_root + ,struct adios_index_var_struct_v1 * new_vars_root + ,struct adios_index_attribute_struct_v1 * new_attrs_root + ); + +void adios_sort_index_v1 (struct adios_index_process_group_struct_v1 ** p1 + ,struct adios_index_var_struct_v1 ** v1 + ,struct adios_index_attribute_struct_v1 ** a1 + ); + +void adios_clear_index_v1 (struct adios_index_struct_v1 * index); // in each adios__close() +void adios_free_index_v1 (struct adios_index_struct_v1 * index); // in adios__finalize() + +int adios_parse_scalar_string (enum ADIOS_DATATYPES type, char * value, void ** out); + +// NCSU ALACRITY-ADIOS - This function was static, but is now needed in adios_transforms_*.c +uint8_t count_dimensions (const struct adios_dimension_struct * dimensions); + +uint64_t adios_get_type_size (enum ADIOS_DATATYPES type, void * var); +// NCSU ALACRITY-ADIOS - added this for use in the transform layer +uint64_t adios_get_dimension_space_size (struct adios_var_struct * var + ,struct adios_dimension_struct * d); +uint64_t adios_get_var_size (struct adios_var_struct * var, void * data); +uint64_t adios_get_dim_value (struct adios_dimension_item_struct * dimension); +uint64_t adios_get_stat_size (void * data, enum ADIOS_DATATYPES type, enum ADIOS_STAT stat_id); +uint8_t adios_get_stat_set_count (enum ADIOS_DATATYPES type); + +const char * adios_type_to_string_int (int type); +const char * adios_file_mode_to_string (int mode); + +// the following are defined in adios_transport_hooks.c +void adios_init_transports (struct adios_transport_struct ** transports); +void adios_free_transports (struct adios_transport_struct * transports); +int adios_parse_method (const char * buf, enum ADIOS_IO_METHOD * method + ,int * requires_group_comm + ); + +/* some internal functions that adios_internals.c and adios_internals_mxml.c share */ +int adios_int_is_var (const char * temp); // 1 == yes, 0 == no +int adios_int_is_num (char * temp); // 1 == yes, 0 == no +void adios_conca_mesh_numb_att_nam (char ** returnstr, const char * meshname, char * att_nam, char counterstr[5]); +void adios_conca_mesh_att_nam (char ** returnstr, const char * meshname, char * att_nam); + +// No-XML API +int adios_common_define_schema_version (struct adios_group_struct * new_group, char * schema_version); +int adios_common_define_var_mesh (int64_t ptr_new_group, const char * varname, const char * meshname, const char * path); +int adios_common_define_var_centering (int64_t ptr_new_group, const char * varname, const char * centering, const char * path); +int adios_common_define_var_timesteps (const char * timesteps,struct adios_group_struct * new_group,const char * name, const char *path); +int adios_common_define_var_timescale (const char * timescale,struct adios_group_struct * new_group,const char * name, const char *path); +int adios_common_define_var_timeseriesformat (const char * timeseries,struct adios_group_struct * new_group,const char * name, const char *path); +int adios_common_define_var_hyperslab ( const char * hyperslab,struct adios_group_struct * new_group,const char * name, const char *path); + +// defineMesh functions (missing mesh structs for now dueto problems checking accross groups +int adios_common_define_mesh_file (int64_t ptr_new_group, char * name, char * file); +int adios_common_define_mesh_group (int64_t ptr_new_group, const char * name, const char * group); +int adios_common_define_mesh_timeVarying (const char * timevarying, int64_t group_id, const char * name); +int adios_common_define_mesh_timeSeriesFormat (const char * timeseries, struct adios_group_struct * new_group, const char * name); +int adios_common_define_mesh_timeScale (const char * timescale, struct adios_group_struct * new_group, const char * name); +int adios_common_define_mesh_timeSteps (const char * timesteps, struct adios_group_struct * new_group, const char * name); + +int adios_define_mesh_nspace (const char * nspace,struct adios_group_struct * new_group,const char * name); +int adios_common_define_mesh_rectilinear (char * dimensions, char * coordinates, char * nspace, const char * name, int64_t group_id); +int adios_define_mesh_rectilinear_dimensions (const char * dimensions,struct adios_group_struct * new_group,const char * name); +int adios_define_mesh_rectilinear_coordinatesSingleVar (const char * coordinates,struct adios_group_struct * new_group,const char * name); +int adios_define_mesh_rectilinear_coordinatesMultiVar (const char * coordinates,struct adios_group_struct * new_group,const char * name); + +int adios_common_define_mesh_uniform (char * dimensions, char * origin, char * spacing, char * maximum, char * nspace, const char * name, int64_t group_id); +int adios_define_mesh_uniform_dimensions (const char * dimensions, struct adios_group_struct * new_group, const char * name); +int adios_define_mesh_uniform_origins (const char * origin ,struct adios_group_struct * new_group,const char * name); +int adios_define_mesh_uniform_spacings (const char * spacing,struct adios_group_struct * new_group,const char * name); +int adios_define_mesh_uniform_maximums (const char * maximum,struct adios_group_struct * new_group,const char * name); + +int adios_common_define_mesh_structured (char * dimensions, char * nspace, char * points, const char * name, int64_t group_id); +int adios_define_mesh_structured_dimensions (const char * dimensions,struct adios_group_struct * new_group,const char * name); +//int adios_define_mesh_structured_nspace (const char * nspace,struct adios_group_struct * new_group,const char * name); +int adios_define_mesh_structured_pointsSingleVar (const char * points,struct adios_group_struct * new_group,const char * name); +int adios_define_mesh_structured_pointsMultiVar (const char * points,struct adios_group_struct * new_group,const char * name); + +int adios_common_define_mesh_unstructured (char * points, char * data, char * count, char * type, char * nspace, char * npoints, const char * name, int64_t group_id); +int adios_define_mesh_unstructured_npoints (const char * npoints,struct adios_group_struct * new_group ,const char * name); +//int adios_define_mesh_unstructured_nspace (const char * nspace,struct adios_group_struct * new_group,const char * name); +int adios_define_mesh_unstructured_pointsSingleVar (const char * points,struct adios_group_struct * new_group,const char * name); +int adios_define_mesh_unstructured_pointsMultiVar (const char * points,struct adios_group_struct * new_group ,const char * name); +int adios_define_mesh_unstructured_uniformCells (const char * count,const char * data,const char * type,struct adios_group_struct * new_group,const char * name); +int adios_define_mesh_unstructured_mixedCells (const char * count,const char * data,const char * types,struct adios_group_struct * new_group,const char * name); + + +// queue code for adaptive message passing +#ifdef __cplusplus +extern "C" { +#endif + +#if 1 +/* LIST */ +typedef struct ListElmt_ +{ + void * data; + struct ListElmt_ * next; +} ListElmt; + +typedef struct List_ +{ + volatile int size; + int (* match) (const void * key1, const void * key2); + void (* destroy) (void * data); + ListElmt * head; + ListElmt * tail; +} List; + +void list_init (List * list, void (* destroy) (void * data)); +void list_destroy (List * list); +int list_ins_next (List * list, ListElmt * element, const void * data); +int list_rem_next (List * list, ListElmt * element, void ** data); +#define list_size(list) ((list)->size) +#define list_head(list) ((list)->head) +#define list_tail(list) ((list)->tail) +#define list_is_head(list, element) ((element) == (list)->head ? 1 : 0) +#define list_is_tail(element) ((element)->next == NULL ? 1 : 0) +#define list_data(element) ((element)->data) +#define list_next(element) ((element)->next) + +/* QUEUE */ +typedef List Queue; + +#define queue_init list_init +#define queue_destroy list_destroy +int queue_enqueue (Queue * queue, const void * data); +int queue_dequeue (Queue * queue, void ** data); +#define queue_peek(queue) ((queue)->head == NULL ? NULL : (queue)->head->data) +#define queue_size list_size + +#endif /* 0 */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/tests/libs/adios/src/core/adios_internals_mxml.c b/tests/libs/adios/src/core/adios_internals_mxml.c new file mode 100644 index 0000000000..99c8aaf119 --- /dev/null +++ b/tests/libs/adios/src/core/adios_internals_mxml.c @@ -0,0 +1,2830 @@ +/* + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + */ + +#include +#include +#include +#include /* struct stat */ + +// xml parser +#include + +#include "adios.h" +#include "adios_error.h" +#include "core/adios_transport_hooks.h" +#include "core/adios_bp_v1.h" +#include "core/adios_internals.h" +#include "core/adios_internals_mxml.h" +#include "core/buffer.h" +#include "core/adios_logger.h" +#include "core/util.h" // PairStruct* +#include "transforms/adios_transforms_hooks_write.h" +#include "transforms/adios_transforms_write.h" + +#ifdef DMALLOC +#include "dmalloc.h" +#endif + +static enum ADIOS_FLAG adios_host_language_fortran = adios_flag_yes; +// NCSU ALACRITY-ADIOS: Need these to be extern so they can be accessed by both adios_internals.c and here +extern struct adios_method_list_struct * adios_methods; +extern struct adios_group_list_struct * adios_groups; +//struct adios_method_list_struct * adios_methods = 0; +//struct adios_group_list_struct * adios_groups = 0; + +struct adios_transport_struct * adios_transports = 0; +static int adios_transports_initialized = 0; + +static MPI_Comm init_comm; // communicator for each method's init call + +// this macro makes getting the attributes easier +// fix the bgp bugs +#define GET_ATTR(n,attr,var,en) \ + if (!strcasecmp (n, attr->name)) { \ + if (!var) \ + { \ + var = attr->value; \ + continue; \ + } \ + else \ + { \ + log_warn ("xml: duplicate attribute %s on %s (ignored)",n,en); \ + continue; \ + } \ + } + +static enum ADIOS_DATATYPES parseType (const char * type, const char * name) +{ + if ( !strcasecmp (type, "byte") + || !strcasecmp (type, "char") + || !strcasecmp (type, "integer*1") + ) + return adios_byte; + + if ( !strcasecmp (type, "short") + || !strcasecmp (type, "integer*2") + ) + return adios_short; + + if ( !strcasecmp (type, "integer") + || !strcasecmp (type, "int") + || !strcasecmp (type, "integer*4") + ) + return adios_integer; + + if ( !strcasecmp (type, "long") + || !strcasecmp (type, "long long") + || !strcasecmp (type, "integer*8") + ) + return adios_long; + + if ( !strcasecmp (type, "unsigned byte") + || !strcasecmp (type, "unsigned char") + || !strcasecmp (type, "unsigned integer*1") + ) + return adios_unsigned_byte; + + if ( !strcasecmp (type, "unsigned short") + || !strcasecmp (type, "unsigned integer*2") + ) + return adios_unsigned_short; + + if ( !strcasecmp (type, "unsigned integer") + || !strcasecmp (type, "unsigned int") + || !strcasecmp (type, "unsigned integer*4") + ) + return adios_unsigned_integer; + + if ( !strcasecmp (type, "unsigned long") + || !strcasecmp (type, "unsigned integer*8") + ) + return adios_unsigned_long; + + if ( !strcasecmp (type, "real") + || !strcasecmp (type, "real*4") + || !strcasecmp (type, "float") + ) + return adios_real; + + if ( !strcasecmp (type, "real*8") + || !strcasecmp (type, "double") + || !strcasecmp (type, "long float") + ) + return adios_double; + + if ( !strcasecmp (type, "real*16") + || !strcasecmp (type, "long double") + ) + return adios_long_double; + + if (!strcasecmp (type, "string")) + return adios_string; + + if ( !strcasecmp (type, "complex") + || !strcasecmp (type, "complex*8") + ) + return adios_complex; + + if ( !strcasecmp (type, "double complex") + || !strcasecmp (type, "complex*16") + ) + return adios_double_complex; + + log_error ("config.xml: invalid type: %s in var %s\n", type, name); + + return adios_unknown; +} + +static enum ADIOS_FLAG parseFlag (const char * attr_name, const char * flag + ,enum ADIOS_FLAG default_value + ) +{ + if (!flag) + return default_value; + + if (!strcasecmp (flag, "yes")) + return adios_flag_yes; + + if (!strcasecmp (flag, "no")) + return adios_flag_no; + + log_error ("config.xml: %s must have a value of 'yes' or 'no' " + "not: %s\n", attr_name, flag + ); + + return adios_flag_unknown; +} + +/* +static void adios_append_mesh_item (struct adios_mesh_item_list_struct ** root + ,struct adios_mesh_item_list_struct * item + ) +{ + while (root) + { + if (!*root) + { + *root = item; + root = 0; + } + else + { + root = &(*root)->next; + } + } +} +*/ +/* +static void adios_append_mesh_var (struct adios_mesh_var_list_struct ** root + ,struct adios_mesh_var_list_struct * var + ) +{ + while (root) + { + if (!*root) + { + *root = var; + root = 0; + } + else + { + root = &(*root)->next; + } + } +} +*/ +/* +static void adios_append_mesh_cell_list +(struct adios_mesh_cell_list_list_struct ** root + ,struct adios_mesh_cell_list_list_struct * cell_list + ) +{ + while (root) + { + if (!*root) + { + *root = cell_list; + root = 0; + } + else + { + root = &(*root)->next; + } + } +} +*/ + +// primary mesh XML parsing +int parseMeshUniform (mxml_node_t * node + ,struct adios_group_struct * new_group + ,const char * name + ) +{ + mxml_node_t * n; + int saw_dimensions = 0; + int saw_origin = 0; + int saw_spacing = 0; + int saw_maximum = 0; + + for (n = mxmlWalkNext (node, node, MXML_DESCEND) + ;n + ;n = mxmlWalkNext (n, node, MXML_DESCEND) + ) + { + if (n->type != MXML_ELEMENT) + { + continue; + } + + if (!strcasecmp (n->value.element.name, "dimensions")) + { + const char * dimensions; + + if (saw_dimensions) + { + log_warn ("config.xml: only one dimensions definition " + "allowed per mesh sructured-points (%s)\n" + ,name + ); + + return 0; + } + + saw_dimensions = 1; + dimensions = mxmlElementGetAttr (n, "value"); + + if (!dimensions) + { + log_warn ("config.xml: value attribute on " + "dimensions required (%s)\n" + ,name + ); + return 0; + } + + if (!adios_define_mesh_uniform_dimensions (dimensions, new_group, name)) + return 0; + } else + if (!strcasecmp (n->value.element.name, "origin")) + { + const char * value; + + if (saw_origin) + { + log_warn ("config.xml: only one origin definition " + "allowed per mesh uniform (%s)\n" + ,name + ); + + return 0; + } + + saw_origin = 1; + value = mxmlElementGetAttr (n, "value"); + + if (!value) + { + log_warn ("config.xml: value attribute on " + "origin required (%s)\n" + ,name + ); + + return 0; + } + + if (!adios_define_mesh_uniform_origins (value, new_group, name)) + return 0; + } else + if (!strcasecmp (n->value.element.name, "spacing")) + { + const char * value; + + if (saw_spacing) + { + log_warn ("config.xml: only one spacing " + "definition allowed per mesh uniform (%s)\n" + ,name + ); + + return 0; + } + + saw_spacing = 1; + value = mxmlElementGetAttr (n, "value"); + + if (!value) + { + log_warn ("config.xml: value attribute on " + "spacing required (%s)\n" + ,name + ); + + return 0; + } + + if (!adios_define_mesh_uniform_spacings (value, new_group, name)) + return 0; + } else + if (!strcasecmp (n->value.element.name, "maximum")) + { + const char * value; + + if (saw_maximum) + { + log_warn ("config.xml: only one maximum " + "definition allowed per mesh uniform (%s)\n" + ,name + ); + + return 0; + } + + saw_maximum = 1; + value = mxmlElementGetAttr (n, "value"); + + if (!value) + { + log_warn ("config.xml: value attribute on " + "max required (%s)\n" + ,name + ); + + return 0; + } + + if (!adios_define_mesh_uniform_maximums (value, new_group, name)) + return 0; + } else + if (!strcasecmp (n->value.element.name, "nspace")) + { + const char * value; + value = mxmlElementGetAttr (n, "value"); + adios_define_mesh_nspace (value, new_group, name); + } else { + if (!strncmp (n->value.element.name, "!--", 3)) // a comment + { + continue; + } + } + } + + return 1; +} + +int parseMeshRectilinear1 (mxml_node_t * node + ,struct adios_group_struct * new_group + ,const char * name + ) +{ + mxml_node_t * n; + int saw_dimensions = 0; + int saw_coordinates_multi_var = 0; + int saw_coordinates_single_var = 0; + + for (n = mxmlWalkNext (node, node, MXML_DESCEND) + ;n + ;n = mxmlWalkNext (n, node, MXML_DESCEND) + ) + { + if (n->type != MXML_ELEMENT) + { + continue; + } + + if (!strcasecmp (n->value.element.name, "dimensions")) + { + const char * value; + + if (saw_dimensions) + { + log_warn ("config.xml: only one dimensions " + "definition allowed per mesh rectilinear (%s)\n" + ,name + ); + + return 0; + } + + saw_dimensions = 1; + value = mxmlElementGetAttr (n, "value"); + + if (!value) + { + log_warn ("config.xml: value attribute on " + "dimensions required (%s)\n" + ,name + ); + + return 0; + } + + if (!adios_define_mesh_rectilinear_dimensions (value, new_group, name)) + return 0; + } else + if (!strcasecmp (n->value.element.name, "coordinates-multi-var")) + { + const char * value; + + if (saw_coordinates_multi_var || saw_coordinates_single_var) + { + log_warn ("config.xml: only one coordinates " + "definition allowed per mesh rectilinear (%s)\n" + ,name + ); + + return 0; + } + + saw_coordinates_multi_var = 1; + value = mxmlElementGetAttr (n, "value"); + + if (!value) + { + log_warn ("config.xml: value attribute on " + "coordinates-multi-var required (%s)\n" + ,name + ); + + return 0; + } + + if (!adios_define_mesh_rectilinear_coordinatesMultiVar (value, new_group, name)) + return 0; + } else + if (!strcasecmp (n->value.element.name, "coordinates-single-var")) + { + const char * value; + + if (saw_coordinates_single_var || saw_coordinates_multi_var) + { + log_warn ("config.xml: only one coordinates " + "definition allowed per mesh rectilinear (%s)\n" + ,name + ); + return 0; + } + + saw_coordinates_single_var = 1; + value = mxmlElementGetAttr (n, "value"); + + if (!value) + { + log_warn ("config.xml: value attribute on " + "coordinates-single-var required (%s)\n" + ,name + ); + return 0; + } + + if (!adios_define_mesh_rectilinear_coordinatesSingleVar(value, new_group, name)) + return 0; + } else + if (!strcasecmp (n->value.element.name, "nspace")) + { + const char * value; + value = mxmlElementGetAttr (n, "value"); + adios_define_mesh_nspace (value, new_group, name); + } else + { + if (!strncmp (n->value.element.name, "!--", 3)) // a comment + { + continue; + } + } + } + + if (!saw_dimensions) + { + log_warn ("config.xml: dimensions required on mesh " + "type=rectilinear (%s)\n" + ,name + ); + return 0; + } + if (!saw_coordinates_multi_var && !saw_coordinates_single_var) + { + log_warn ("config.xml: coordinates-multi-var or " + "coordinates-single-var required on mesh " + "type=rectilinear (%s)\n" + ,name + ); + + return 0; + } + + return 1; +} + +int parseMeshStructured1 (mxml_node_t * node + ,struct adios_group_struct * new_group + ,const char * name + ) +{ + mxml_node_t * n; + int saw_nspace = 0; + int saw_dimensions = 0; + int saw_points_multi_var = 0; + int saw_points_single_var = 0; + + for (n = mxmlWalkNext (node, node, MXML_DESCEND) + ;n + ;n = mxmlWalkNext (n, node, MXML_DESCEND) + ) + { + if (n->type != MXML_ELEMENT) + { + continue; + } + + if (!strcasecmp (n->value.element.name, "nspace")) + { + const char * value; + + if (saw_nspace) + { + log_warn ("config.xml: only one nspace " + "definition allowed per mesh structured (%s)\n" + ,name + ); + + return 0; + } + + saw_nspace = 1; + value = mxmlElementGetAttr (n, "value"); + adios_define_mesh_nspace (value, new_group, name); +// if (!value) +// { +// log_warn ("config.xml: value attribute on " +// "nspace required (%s)\n" +// ,name +// ); +// +// return 0; +// } + +// if (!adios_define_mesh_structured_nspace (value, new_group, name)) +// return 0; + } else + if (!strcasecmp (n->value.element.name, "dimensions")) + { + const char * value; + + if (saw_dimensions) + { + log_warn ("config.xml: only one dimensions " + "definition allowed per mesh structured (%s)\n" + ,name + ); + + return 0; + } + + saw_dimensions = 1; + value = mxmlElementGetAttr (n, "value"); + + if (!value) + { + log_warn ("config.xml: value attribute on " + "dimensions required (%s)\n" + ,name + ); + + return 0; + } + + if (!adios_define_mesh_structured_dimensions (value, new_group, name)) + return 0; + } else + if (!strcasecmp (n->value.element.name, "points-multi-var")) + { + const char * value; + + if (saw_points_multi_var || saw_points_single_var) + { + log_warn ("config.xml: only one points " + "definition allowed per mesh structured (%s)\n" + ,name + ); + + return 0; + } + + saw_points_multi_var = 1; + value = mxmlElementGetAttr (n, "value"); + + if (!value) + { + log_warn ("config.xml: value attribute on " + "points-multi-var required (%s)\n" + ,name + ); + + return 0; + } + + if (!adios_define_mesh_structured_pointsMultiVar (value, new_group, name)) + return 0; + } else + if (!strcasecmp (n->value.element.name, "points-single-var")) + { + const char * value; + + if (saw_points_multi_var || saw_points_single_var) + { + log_warn ("config.xml: only one points " + "definition allowed per mesh structured (%s)\n" + ,name + ); + + return 0; + } + + saw_points_single_var = 1; + value = mxmlElementGetAttr (n, "value"); + + if (!value) + { + log_warn ("config.xml: value attribute on " + "points-single-var required (%s)\n" + ,name + ); + + return 0; + } + + if (!adios_define_mesh_structured_pointsSingleVar (value, new_group, name)) + return 0; + } else + { + if (!strncmp (n->value.element.name, "!--", 3)) // a comment + { + continue; + } + } + } + + if (!saw_dimensions) + { + log_warn ("config.xml: dimensions required on mesh " + "type=structured (%s)\n" + ,name + ); + + return 0; + } + if (!saw_points_multi_var && !saw_points_single_var) + { + log_warn ("config.xml: points-single-var or points-multi-var " + "required on mesh type=structured (%s)\n" + ,name + ); + + return 0; + } + + return 1; +} + +int parseMeshUnstructured1 (mxml_node_t * node + ,struct adios_group_struct * new_group + ,const char * name + ) +{ + mxml_node_t * n; + int saw_nspace =0; + int saw_number_of_points = 0; + int saw_points_multi_var = 0; + int saw_points_single_var = 0; + int saw_cell_set = 0; + + for (n = mxmlWalkNext (node, node, MXML_DESCEND) + ;n + ;n = mxmlWalkNext (n, node, MXML_DESCEND) + ) + { + if (n->type != MXML_ELEMENT) + { + continue; + } + + if (!strcasecmp (n->value.element.name, "nspace")) + { + const char * value; + + if (saw_nspace) + { + log_warn ("config.xml: only one nspace " + "definition allowed per mesh structured (%s)\n" + ,name + ); + + return 0; + } + + saw_nspace = 1; + value = mxmlElementGetAttr (n, "value"); + adios_define_mesh_nspace (value, new_group, name); + +// if (!value) +// { +// log_warn ("config.xml: value attribute on " +// "nspace required (%s)\n" +// ,name +// ); +// +// return 0; +// } + +// if (!adios_define_mesh_unstructured_nspace (value, new_group, name)) +// return 0; + }else + if (!strcasecmp (n->value.element.name, "number-of-points")) + { + const char * value; + + if (saw_number_of_points) + { + log_warn ("config.xml: only one number-of-points " + "definition allowed per mesh structured (%s)\n" + ,name + ); + + return 0; + } + + saw_number_of_points = 1; + value = mxmlElementGetAttr (n, "value"); + + if (!value) + { + log_warn ("config.xml: value attribute on " + "number-of-points required (%s)\n" + ,name + ); + + return 0; + } + + if (!adios_define_mesh_unstructured_npoints (value, new_group, name)) + return 0; + }else + if (!strcasecmp (n->value.element.name, "points-multi-var")) + { + const char * value; + + if (saw_points_multi_var || saw_points_single_var) + { + log_warn ("config.xml: only one points " + "definition allowed per mesh unstructured (%s)\n" + ,name + ); + + return 0; + } + + saw_points_multi_var = 1; + value = mxmlElementGetAttr (n, "value"); + + if (!value) + { + log_warn ("config.xml: value attribute on " + "points-multi-var required (%s)\n" + ,name + ); + + return 0; + } + + if (!adios_define_mesh_unstructured_pointsMultiVar (value, new_group, name)) + return 0; + } else + if (!strcasecmp (n->value.element.name, "points-single-var")) + { + const char * value; + + if (saw_points_multi_var || saw_points_single_var) + { + log_warn ("config.xml: only one points " + "definition allowed per mesh unstructured (%s)\n" + ,name + ); + + return 0; + } + + saw_points_single_var = 1; + value = mxmlElementGetAttr (n, "value"); + + if (!value) + { + log_warn ("config.xml: value attribute on " + "points-single-var required (%s)\n" + ,name + ); + + return 0; + } + + if (!adios_define_mesh_unstructured_pointsSingleVar (value, new_group, name)) + return 0; + } else + if (!strcasecmp (n->value.element.name, "uniform-cells")) + { + const char * count; + const char * data; + const char * type; + + saw_cell_set = 1; + count = mxmlElementGetAttr (n, "count"); + data = mxmlElementGetAttr (n, "data"); + type = mxmlElementGetAttr (n, "type"); + + if (!count) + { + log_warn ("config.xml: count attribute on " + "uniform-cells required (%s)\n" + ,name + ); + + return 0; + } + if (!data) + { + log_warn ("config.xml: data attribute on " + "uniform-cells required (%s)\n" + ,name + ); + + return 0; + } + if (!type) + { + log_warn ("config.xml: type attribute on " + "uniform-cells required (%s)\n" + ,name + ); + + return 0; + } + + if (!adios_define_mesh_unstructured_uniformCells (count, data, type + , new_group + ,name + ) + ) + return 0; + } else + if (!strcasecmp (n->value.element.name, "mixed-cells")) + { + const char * count; + const char * data; + const char * types; + + saw_cell_set = 1; + count = mxmlElementGetAttr (n, "count"); + data = mxmlElementGetAttr (n, "data"); + types = mxmlElementGetAttr (n, "type"); + + if (!count) + { + log_warn ("config.xml: count attribute on " + "mixed-cells required (%s)\n" + ,name + ); + + return 0; + } + if (!data) + { + log_warn ("config.xml: data attribute on " + "mixed-cells required (%s)\n" + ,name + ); + + return 0; + } + if (!types) + { + log_warn ("config.xml: types attribute on " + "mixed-cells required (%s)\n" + ,name + ); + + return 0; + } + + if (!adios_define_mesh_unstructured_mixedCells (count, data, types + ,new_group + ,name + ) + ) + return 0; + } else + { + if (!strncmp (n->value.element.name, "!--", 3)) // a comment + { + continue; + } + } + } + + if (!saw_points_multi_var && !saw_points_single_var) + { + log_warn ("config.xml: points-single-var or points-multi-var " + "required on mesh type=unstructured (%s)\n" + ,name + ); + + return 0; + } + + if (!saw_cell_set) + { + log_warn ("config.xml: at least one cell-set required on " + "mesh type=unstructured (%s)\n" + ,name + ); + + return 0; + } + + return 1; +} + +/* +static int validatePath (const struct adios_var_struct * vars + ,const char * test_path + ) +{ + // if it is a default path, it is ok by default + if (!strcmp (test_path, "/")) + { + return 1; + } + + char * path = strdup (test_path); + int len = strlen (path); + char * path_only; + char * var_only; + char * last_slash = strrchr (path, '/'); // find the last '/' + path_only = (char *) malloc (len + 1); + var_only = (char *) malloc (len + 1); + memset (path_only, 0, len + 1); + memset (var_only, 0, len + 1); + if (last_slash == path + len - 1) // if it is a trailing '/', remove + { + last_slash = '\0'; + last_slash = strrchr (path, '/'); + } + if (last_slash == 0) + { + strcpy (path_only, "/"); + strcpy (var_only, path); + } + else + { + strncpy (path_only, path, (last_slash - path)); + strncpy (var_only, last_slash + 1, (len - (last_slash - path + 1))); + } + + while (vars) + { + int path_only_len = strlen (path_only); + int var_path_len = strlen (vars->path); + int var_name_len = strlen (vars->name); + char full_path_matches = (!strcasecmp (vars->path, path)); + char path_matches = (!strcasecmp (vars->path, path_only)); + char var_matches = (!strcasecmp (vars->name, var_only)); + char prefix_matches = 0; + char * path_var; + path_var = (char *) malloc (var_path_len + var_name_len + 2); + sprintf (path_var, "%s/%s", vars->path, vars->name); + char path_var_matches = (!strcasecmp (path_var, path)); + + if (var_path_len >= len && path_only_len > 0) + prefix_matches = (!strncmp (vars->path, path_only, path_only_len)); + if (!prefix_matches) + prefix_matches = (!strncmp (vars->path, path, len)); + int var_len = strlen (var_only); + + if ( (path_matches && var_matches) + || (path_matches && var_len == 0) + || (full_path_matches) + || (prefix_matches) + || (path_var_matches) + ) + { + free (path); + free (path_only); + free (var_only); + free (path_var); + + return 1; + } + vars = vars->next; + free (path_var); + } + + // not found + free (path); + free (path_only); + free (var_only); + + return 0; +} +*/ + +static int parseGroup (mxml_node_t * node, char * schema_version) +{ + mxml_node_t * n; + + const char * datagroup_name = 0; + const char * coordination_comm = 0; + const char * coordination_var = 0; + const char * host_language = 0; + const char * time_index_name = 0; + const char * stats = 0; + + int64_t ptr_new_group; + struct adios_group_struct * new_group; + enum ADIOS_FLAG host_language_fortran = adios_flag_yes, enable_stats = adios_flag_yes; + int i; + + for (i = 0; i < node->value.element.num_attrs; i++) + { + mxml_attr_t * attr = &node->value.element.attrs [i]; + + GET_ATTR("name",attr,datagroup_name,"adios-group") + // JL: 1-2010 + // Although this is not used, we are leaving in the retrevial + // of this to avoid messages from all of the existing XML files. + // In a few months, once everything has been updated, we can remove + // this code + GET_ATTR("coordination-communicator",attr,coordination_comm,"adios-group") + GET_ATTR("coordination-var",attr,coordination_var,"adios-group") + GET_ATTR("host-language",attr,host_language,"adios-group") + GET_ATTR("time-index",attr,time_index_name,"adios-group") + GET_ATTR("stats",attr,stats,"adios-group") + log_warn ("config.xml: unknown attribute '%s' on %s " + "(ignored)\n" + ,attr->name + ,"adios-group" + ); + } + + if (!datagroup_name) + { + adios_error(err_invalid_attrname,"config.xml: name attribute required on adios-group\n"); + + return 0; + } + if (!host_language) + { + host_language_fortran = adios_host_language_fortran; + } + else + { + if (!strcasecmp (host_language, "Fortran")) + { + host_language_fortran = adios_flag_yes; + } + else + { + if (!strcasecmp (host_language, "C")) + { + host_language_fortran = adios_flag_no; + } + else + { + adios_error (err_invalid_host_language, "config.xml: invalid host-language %s" + ,host_language + ); + + return 0; + } + } + } + + if (!stats) + { + enable_stats = adios_flag_yes; + } + else + { + if (!strcasecmp (stats, "On")) + { + enable_stats = adios_flag_yes; + } + else if (!strcasecmp (stats, "Off")) + { + enable_stats = adios_flag_no; + } + else + { + log_error ("config.xml, invalid stats %s" + ,stats + ); + return 0; + } + } + + // fix the bgp bugs + /* + adios_common_declare_group ((int64_t *) &new_group, datagroup_name + ,host_language_fortran, coordination_comm + ,coordination_var, time_index_name + ); + */ + adios_common_declare_group (&ptr_new_group, datagroup_name + ,host_language_fortran, coordination_comm + ,coordination_var, time_index_name + ,enable_stats + ); + new_group = (struct adios_group_struct *)ptr_new_group; + + adios_common_define_schema_version(new_group, schema_version); + for (n = mxmlWalkNext (node, node, MXML_DESCEND) + ;n + ;n = mxmlWalkNext (n, node, MXML_NO_DESCEND) + ) + { + const char * gb_global_dimensions = ""; + const char * gb_local_offsets = ""; + + if (n->type != MXML_ELEMENT) + { + continue; + } + + if (!strcasecmp (n->value.element.name, "var")) + { + const char * name = 0; + const char * path = 0; + const char * mesh = 0; + const char * center = 0; + const char * type = 0; + const char * tsteps = 0; + const char * tscale = 0; + const char * tformat = 0; + const char * hyperslab = 0; + const char * dimensions = 0; + const char * dimension = 0; + const char * gread = 0; + const char * gwrite = 0; + const char * read_flag = 0; + const char * transform_type = 0; // NCSU ALACRITY-ADIOS + enum ADIOS_DATATYPES t1; + char * mpath1 = 0; + char * mpath2 = 0; + + for (i = 0; i < n->value.element.num_attrs; i++) + { + mxml_attr_t * attr = &n->value.element.attrs [i]; + + GET_ATTR("name",attr,name,"var") + GET_ATTR("mesh",attr,mesh,"var") + GET_ATTR("center",attr,center,"var") + GET_ATTR("time-steps",attr,tsteps,"var") + GET_ATTR("time-scale",attr,tscale,"var") + GET_ATTR("time-series-format",attr,tformat,"var") + GET_ATTR("hyperslab",attr,hyperslab,"var") + GET_ATTR("path",attr,path,"var") + GET_ATTR("type",attr,type,"var") + GET_ATTR("dimensions",attr,dimensions,"var") + GET_ATTR("dimension",attr,dimension,"var") + GET_ATTR("gwrite",attr,gwrite,"var") + GET_ATTR("gread",attr,gread,"var") + GET_ATTR("read",attr,read_flag,"var") + GET_ATTR("transform",attr,transform_type,"var") // NCSU ALACRITY-ADIOS + log_warn ("config.xml: unknown attribute '%s' on %s " + "(ignored)\n" + ,attr->name + ,"var" + ); + } + + if (!name) + name = ""; // this will catch the error + if (!path) + path = ""; + if (!type) + type = ""; // this will catch the error + if (!mesh) + mesh = ""; + if (!center) + center = ""; + if (!tsteps) + tsteps = ""; + if (!tscale) + tscale = ""; + if (!tformat) + tformat = ""; + if (!hyperslab) + hyperslab = ""; + t1 = parseType (type, name); + + if (!dimensions) + { + dimensions = dimension; + if (!dimensions) + dimensions = ""; + } + + if (read_flag) + parseFlag ("read", read_flag, adios_flag_no); + + // fix the bgp bugs + // if (!adios_common_define_var (*(int64_t *) &new_group, name + int64_t var = adios_common_define_var (ptr_new_group, name + ,path, t1, dimensions + ,gb_global_dimensions + ,gb_local_offsets + ); + if (!var) + { + return 0; + }else{ + // Successfully define a variable, so now + // an attribute for the transform method if given. + if (transform_type && strcmp(transform_type,"")) { + adios_common_set_transform (var, transform_type); + } + // an attribute for the mesh if it exists. + if (strcmp(mesh,"")){ + adios_common_define_var_mesh (ptr_new_group, name, mesh, path); + } + // an attribute for the center if it exists. + if (strcmp(center,"")){ + adios_common_define_var_centering (ptr_new_group, name, center, path); + } + // if a time attribute exists + // parse it and define it + if (strcmp(tsteps,"")){ + adios_common_define_var_timesteps(tsteps,new_group,name,path); + } + // if a time scale attribute exists + // parse it and define it + if (strcmp(tscale,"")){ + adios_common_define_var_timescale(tscale,new_group,name,path); + } + // if a time series format attribute exists + // parse it and define it + if (strcmp(tformat,"")){ + adios_common_define_var_timeseriesformat(tformat,new_group,name,path); + } + // if a hyperslab attribute exists + // parse it and define it + if (strcmp(hyperslab,"")){ + adios_common_define_var_hyperslab(hyperslab,new_group,name,path); + } + } + } else + if (!strcasecmp (n->value.element.name, "global-bounds")) + { + mxml_node_t * n1; // used for global_bounds + const char * dimensions = 0; + const char * dimension = 0; + const char * global_dimensions = 0; + const char * global_dimension = 0; + const char * offsets = 0; + const char * offset = 0; + const char * local_offsets = 0; + const char * local_offset = 0; + + for (i = 0; i < n->value.element.num_attrs; i++) + { + mxml_attr_t * attr = &n->value.element.attrs [i]; + + GET_ATTR("dimensions",attr,dimensions,"var") + GET_ATTR("dimension",attr,dimension,"var") + + GET_ATTR("global-dimensions",attr,global_dimensions,"var") + GET_ATTR("global-dimension",attr,global_dimension,"var") + + GET_ATTR("offsets",attr,offsets,"var") + GET_ATTR("offset",attr,offset,"var") + + GET_ATTR("local-offsets",attr,local_offsets,"var") + GET_ATTR("local-offset",attr,local_offset,"var") + + log_warn ("config.xml: unknown attribute '%s' on %s " + "(ignored)\n" + ,attr->name + ,"global-bounds" + ); + } + + if (!dimensions) + { + dimensions = (dimension ? dimension : global_dimensions); + dimensions = (dimensions ? dimensions : global_dimension); + if (!dimensions) + { + adios_error (err_global_dim_required, "config.xml: dimensions required on " + "global-bounds\n" + ); + + return 0; + } + } + if (!offsets) + { + offsets = (offset ? offset : local_offsets); + offsets = (offsets ? offsets : local_offset); + adios_error (err_global_offset_required, "config.xml: offsets required on " + "global-bounds\n" + ); + + return 0; + } + + gb_global_dimensions = dimensions; + gb_local_offsets = offsets; + + for (n1 = mxmlWalkNext (n, n, MXML_DESCEND) + ;n1 + ;n1 = mxmlWalkNext (n1, n, MXML_DESCEND) + ) + { + if (n1->type != MXML_ELEMENT) + { + continue; + } + + if (!strcasecmp (n1->value.element.name, "var")) + { + const char * name = 0; + const char * mesh = 0; + const char * center = 0; + const char * tsteps = 0; + const char * tscale = 0; + const char * tformat = 0; + const char * hyperslab = 0; + const char * path = 0; + const char * type = 0; + const char * dimension = 0; + const char * dimensions = 0; + const char * gwrite = 0; + const char * gread = 0; + const char * read_flag = 0; + const char * transform_type = 0; // NCSU ALACRITY-ADIOS + enum ADIOS_DATATYPES t1; + char * mpath1 = 0; + char * mpath2 = 0; + + for (i = 0; i < n1->value.element.num_attrs; i++) + { + mxml_attr_t * attr = &n1->value.element.attrs [i]; + + GET_ATTR("name",attr,name,"var") + GET_ATTR("mesh",attr,mesh,"var") + GET_ATTR("center",attr,center,"var") + GET_ATTR("time-steps",attr,tsteps,"var") + GET_ATTR("time-scale",attr,tscale,"var") + GET_ATTR("time-series-format",attr,tformat,"var") + GET_ATTR("hyperslab",attr,hyperslab,"var") + GET_ATTR("path",attr,path,"var") + GET_ATTR("type",attr,type,"global-bounds var") + GET_ATTR("dimensions",attr,dimensions,"var") + GET_ATTR("dimension",attr,dimension,"var") + GET_ATTR("gwrite",attr,gwrite,"var") + GET_ATTR("gread",attr,gread,"var") + GET_ATTR("read",attr,read_flag,"var") + GET_ATTR("transform",attr,transform_type,"var") // NCSU ALACRITY-ADIOS + log_warn ("config.xml: unknown attribute '%s' " + "on %s (ignored)\n" + ,attr->name + ,"var" + ); + } + + if (!name) + name = ""; // this will catch the error + if (!path) + path = ""; + if (!type) + type = ""; // this will catch the error + if (!mesh) + mesh = ""; + if (!center) + center = ""; + if (!tsteps) + tsteps = ""; + if (!tscale) + tscale = ""; + if (!tformat) + tformat = ""; + if (!hyperslab) + hyperslab = ""; + t1 = parseType (type, name); + if (!dimensions) + dimensions = dimension; + + if (read_flag) + parseFlag ("read", read_flag, adios_flag_no); + // fix the bgp bugs + // if (!adios_common_define_var (*(int64_t *) &new_group + int64_t var = adios_common_define_var (ptr_new_group, name + ,path, t1, dimensions + ,gb_global_dimensions + ,gb_local_offsets + ); + if (!var) + { + return 0; + }else{ + // Successfully define a variable, so now + // an attribute for the transform method if given. + if (transform_type && strcmp(transform_type,"")) { + adios_common_set_transform (var, transform_type); + } + // an attribute for the mesh if it exists. + if (strcmp(mesh,"")){ + adios_common_define_var_mesh (ptr_new_group, name, mesh, path); + } + // an attribute for the mesh if it exists. + if (strcmp(center,"")){ + adios_common_define_var_centering (ptr_new_group, name, center, path); + } + // if a time attribute exists + // parse it and define it + if (strcmp(tsteps,"")){ + adios_common_define_var_timesteps(tsteps,new_group,name,path); + } + // if a time scale attribute exists + // parse it and define it + if (strcmp(tscale,"")){ + adios_common_define_var_timescale(tscale,new_group,name,path); + } + // if a time series format attribute exists + // parse it and define it + if (strcmp(tformat,"")){ + adios_common_define_var_timeseriesformat(tformat,new_group,name,path); + } + // if a hyperslab attribute exists + // parse it and define it + if (strcmp(hyperslab,"")){ + adios_common_define_var_hyperslab(hyperslab,new_group,name,path); + } + } + } else + { + if (!strncmp (n1->value.element.name, "!--", 3)) // comment + { + continue; + } + else + { + log_warn ("config.xml: invalid xml element: " + "'%s'\n" + ,n1->value.element.name + ); + + return 0; + } + } + } + + gb_global_dimensions = ""; + gb_local_offsets = ""; + } else + if (!strcasecmp (n->value.element.name, "attribute")) + { + const char * name = 0; + const char * path = 0; + const char * value = 0; + const char * type = 0; + const char * var = 0; + enum ADIOS_DATATYPES t1; + + for (i = 0; i < n->value.element.num_attrs; i++) + { + mxml_attr_t * attr = &n->value.element.attrs [i]; + + GET_ATTR("name",attr,name,"var") + GET_ATTR("path",attr,path,"var") + GET_ATTR("type",attr,type,"var") + GET_ATTR("value",attr,value,"var") + GET_ATTR("var",attr,var,"var") + log_warn ("config.xml: unknown attribute '%s' on %s " + "(ignored)\n" + ,attr->name + ,"attribute" + ); + } + + if (!name) + { + log_warn ("config.xml: attribute element requires " + "name\n"); + + return 0; + } + /*if (!path) + { + log_warn ("config.xml: attribute element requires " + "path\n"); + + return 0; + }*/ + if ((!value && !var) || (value && var)) + { + log_warn ("config.xml: attribute element '%s' " + "requires either value OR var\n" + ,name + ); + + return 0; + } + if (var && type) + { + log_warn ("config.xml: attribute element '%s'. " + "The type of an associated var is part " + "of the associated var element and cannot " + "be provided as part of the attribute " + "element." + "\n",name + ); + + return 0; + } + if (!type && value) + { + type = "string"; + } + if (!var) + { + t1 = parseType (type, name); + } + else + { + t1 = adios_unknown; + } + if (!adios_common_define_attribute (ptr_new_group, name + ,path, t1, value, var + ) + ) + { + return 0; + } + } else if (!strcasecmp (n->value.element.name, "mesh")) + { + const char * type; + const char * time_varying; + const char * time_steps; + const char * time_scale; + const char * time_format; + const char * mesh_file; + const char * mesh_ref; + const char * mesh_group; + int t_varying; + const char * name; + + // Get the mesh name + name = mxmlElementGetAttr (n, "name"); + // Get the mesh type + type = mxmlElementGetAttr (n, "type"); + // Get the time varying parameter + time_varying = mxmlElementGetAttr(n, "time-varying"); + // Get the time step parameter (integer, number of times mesh is written) + time_steps = mxmlElementGetAttr(n, "time-steps"); + // Get the time scale parameter (real time, not integer) + time_scale = mxmlElementGetAttr(n, "time-scale"); + // Get the time format parameter (time series formatting) + time_format = mxmlElementGetAttr(n, "time-series-format"); + if (!type) + type = ""; + + if (!strcmp(time_varying,"yes")){ + t_varying = adios_flag_yes; + }else if (!strcmp(time_varying,"no")){ + t_varying = adios_flag_no; + }else{ + t_varying = adios_flag_no; + // If the user enters anything else than "yes" or "no" + // Output a warning letting them no that the default ("no" + // will be use give instead of their value + log_warn ("config.xml: the value of the time varying " + "attribute can only be 'yes' or 'no'. The " + "unrecognize value of '%s' is ignored and " + "replaced by 'no'." + "\n" + ,time_varying + ); + } + + char * meshtype = 0; + char * meshtime = 0; + char * meshfile = 0; + char * meshgroup = 0; + char * meshtimeformat = 0; + adios_conca_mesh_att_nam(&meshtype, name, "type"); + adios_conca_mesh_att_nam(&meshtime, name, "time-varying"); + adios_conca_mesh_att_nam(&meshfile, name, "mesh-file"); + adios_conca_mesh_att_nam(&meshgroup, name, "mesh-group"); + adios_conca_mesh_att_nam(&meshtimeformat, name, "time-series-format"); + + // Define attribute for the type and time varying characteristics + adios_common_define_attribute (ptr_new_group,meshtype,"/",adios_string,type,""); + adios_common_define_attribute (ptr_new_group,meshtime,"/",adios_string,time_varying,""); + adios_common_define_mesh_timeSteps(time_steps, new_group, name); + adios_common_define_mesh_timeScale(time_scale, new_group, name); + adios_common_define_mesh_timeSeriesFormat(time_format, new_group, name); + // Only parse mesh if the variables are in this file + // otherwise simply point the mesh file + mesh_file = mxmlElementGetAttr(n, "file"); + if (mesh_file) + adios_common_define_attribute (ptr_new_group,meshfile,"/",adios_string,mesh_file,""); + else + { + mesh_ref = mxmlElementGetAttr(n, "ref"); + if (mesh_ref) + adios_common_define_attribute (ptr_new_group,meshfile,"/",adios_string,mesh_ref,""); + } + + mesh_group = mxmlElementGetAttr(n, "group"); + if (mesh_group) + adios_common_define_attribute (ptr_new_group,meshgroup,"/",adios_string,mesh_group,""); + + if (!strcasecmp (type, "uniform")) + { + struct adios_mesh_struct * mes; + mes = adios_common_define_mesh(ptr_new_group, name, + t_varying, ADIOS_MESH_UNIFORM); + if (mes) { + parseMeshUniform (n, new_group, name); + } + } else if (!strcasecmp (type, "structured")) + { + struct adios_mesh_struct * mes; + mes = adios_common_define_mesh(ptr_new_group, name, + t_varying, ADIOS_MESH_STRUCTURED); + if (mes) { + parseMeshStructured1 (n, new_group, name); + } + } else if (!strcasecmp (type, "rectilinear")) + { + struct adios_mesh_struct * mes; + mes = adios_common_define_mesh(ptr_new_group, name, + t_varying, ADIOS_MESH_RECTILINEAR); + if (mes) { + parseMeshRectilinear1 (n, new_group, name); + } + } else if (!strcasecmp (type, "unstructured")) + { + struct adios_mesh_struct * mes; + mes = adios_common_define_mesh(ptr_new_group, name, + t_varying, ADIOS_MESH_UNSTRUCTURED); + if (mes) { + parseMeshUnstructured1 (n, new_group, name); + } + } else + { + log_warn ("config.xml: invalid mesh type: '%s'\n" + ,type + ); + return 0; + } + free (meshtype); + free (meshtime); + free (meshfile); + free (meshgroup); + } else if (!strcasecmp (n->value.element.name, "link")) + { + const char * ref; + const char * type; + const char * objref; + const char * extref; + // Get the var name + ref = mxmlElementGetAttr (n, "ref"); + // Get the ref type + type = mxmlElementGetAttr (n, "type"); + // Get the ref var name in external file + objref = mxmlElementGetAttr(n, "objref"); + // Get the ref link + extref = mxmlElementGetAttr(n, "extref"); + if (!ref) + ref = ""; + if (!type) + type = "var"; + if (!objref) + objref = ""; + if (!extref) + extref = ""; + + const char * linkvar = 0; + const char * linktype = 0; + const char * linkobjref = 0; + const char * linkextref = 0; + + if ( ref[0]=='\0' && objref[0]=='\0' ) + { + log_warn ("config.xml: invalid var link, " + "requires either ref OR objref.\n" + ); + return 0; + } + else if ( ref[0]=='\0') + ref = objref; //strcpy (ref, objref); + + if (ref) + { + adios_conca_link_att_nam (&linkvar, ref, "ref"); + adios_common_define_attribute (ptr_new_group, linkvar, "/",adios_string, ref, ""); + } + if (objref) + { + adios_conca_link_att_nam (&linkobjref, ref, "objref"); + adios_common_define_attribute (ptr_new_group, linkobjref, "/",adios_string, objref, ""); + } + if (type) + { + adios_conca_link_att_nam (&linktype, ref, "type"); + adios_common_define_attribute (ptr_new_group, linktype, "/",adios_string, type, ""); + } + if (extref) + { + adios_conca_link_att_nam (&linkextref, ref, "extref"); + adios_common_define_attribute (ptr_new_group, linkextref, "/",adios_string, extref, ""); + } + + } else if (!strcasecmp (n->value.element.name, "gwrite")) + { + const char * src = 0; + + for (i = 0; i < n->value.element.num_attrs; i++) + { + mxml_attr_t * attr = &n->value.element.attrs [i]; + + GET_ATTR("src",attr,src,"var") + log_warn ("config.xml: unknown attribute '%s' on %s " + "(ignored)\n" + ,attr->name + ,"gwrite" + ); + } + if (!src) + { + log_warn ("config.xml: gwrite element requires " + "src\n"); + + return 0; + } + } else + { + if (!strncmp (n->value.element.name, "!--", 3)) // a comment + { + continue; + } + else + { + log_warn ("config.xml: invalid xml element: '%s'\n" + ,n->value.element.name + ); + + return 0; + } + } + } + + return 1; +} + +static int parseAnalysis (mxml_node_t * node) +{ + const char * group = 0; + const char * var = 0; + const char * bin_intervals = 0; + const char * bin_count = 0; + const char * bin_min = 0; + const char * bin_max = 0; + + int i; + int64_t group_id; + struct adios_group_struct * g; + + for (i = 0; i < node->value.element.num_attrs; i++) + { + mxml_attr_t * attr = &node->value.element.attrs [i]; + + GET_ATTR("adios-group",attr,group,"analysis") + GET_ATTR("var",attr,var,"analysis") + GET_ATTR("break-points",attr,bin_intervals,"analysis") + GET_ATTR("min",attr,bin_min,"analysis") + GET_ATTR("max",attr,bin_max,"analysis") + GET_ATTR("count",attr,bin_count,"analysis") + log_warn ("config.xml: unknown attribute '%s' on %s " + "(ignored)\n" + ,attr->name + ,"method" + ); + } + + if (!var) + { + log_warn ("config.xml: variable name must be given\n"); + return 0; + } + + if (!group) + { + log_warn ("config.xml: adios-group name must be given\n"); + return 0; + } + + adios_common_get_group (&group_id, group); + g = (struct adios_group_struct *) group_id; + + if (!g) + { + log_warn ("config.xml: Didn't find group %s for analysis\n", group); + return 0; + } + if(!adios_common_define_var_characteristics(g, var, bin_intervals, bin_min, bin_max, bin_count)) + return 0; + + return 1; +} + +static int parseMethod (mxml_node_t * node) +{ + mxml_node_t * n; + + const char * priority = 0; + const char * iterations = 0; + const char * base_path = 0; + const char * method = 0; + const char * group = 0; + const char * parameters = 0; + int p1; + int i1; + int i; + + for (i = 0; i < node->value.element.num_attrs; i++) + { + mxml_attr_t * attr = &node->value.element.attrs [i]; + + GET_ATTR("priority",attr,priority,"method") + GET_ATTR("iterations",attr,iterations,"method") + GET_ATTR("base-path",attr,base_path,"method") + GET_ATTR("method",attr,method,"method") + GET_ATTR("group",attr,group,"method") + log_warn ("config.xml: unknown attribute '%s' on %s " + "(ignored)\n" + ,attr->name + ,"method" + ); + } + + // Check for parameters, if they exist + n = mxmlWalkNext (node, node, MXML_DESCEND); + if (n != NULL) + { + parameters = n->value.text.string; + } + else + { + parameters = NULL; + } + + if (!priority) + p1 = 1; + else + p1 = atoi (priority); + if (!iterations) + i1 = 1; + else + i1 = atoi (iterations); + if (!parameters) + parameters = ""; + if (!base_path) + base_path = ""; + else + { + uint16_t len = strlen (base_path); + if (len > 0 && base_path [len - 1] != '/') + { + adios_error (err_invalid_method, "config.xml: method %s for group %s base-path " + "must end with a '/' character\n" + ,method, group + ); + + return 0; + } + } + if (!group) + group = ""; + if (!method) + method = ""; + + if (!adios_common_select_method (p1, method, parameters, group + ,base_path, i1 + ) + ) + { + return 0; + } + + return 1; +} + +static int parseBuffer (mxml_node_t * node) +{ + const char * size_MB = 0; + const char * free_memory_percentage = 0; + const char * allocate_time = 0; + + int i; + + int size = -1; + + for (i = 0; i < node->value.element.num_attrs; i++) + { + mxml_attr_t * attr = &node->value.element.attrs [i]; + + GET_ATTR("size-MB",attr,size_MB,"method") + GET_ATTR("free-memory-percentage",attr,free_memory_percentage,"method") + GET_ATTR("allocate-time",attr,allocate_time,"method") + log_warn ("config.xml: unknown attribute '%s' on %s " + "(ignored)\n" + ,attr->name + ,"buffer" + ); + } + + + + if ((!size_MB && !free_memory_percentage) || !allocate_time) + { + adios_error (err_invalid_buffer_size, "config.xml: must define allocate-time and either " + "size-MB or free-memory-percentage for " + "buffer element\n" + ); + + return 0; + } + else + { + if (!strcasecmp (allocate_time, "now")) + { + adios_buffer_alloc_when_set (ADIOS_BUFFER_ALLOC_NOW); + } + else + { + if (!strcasecmp (allocate_time, "oncall")) + { + adios_buffer_alloc_when_set (ADIOS_BUFFER_ALLOC_LATER); + } + else + { + adios_error (err_invalid_buffer_size, "config.xml: buffer allocate-time %s " + "invalid. ('now' or 'oncall')\n" + ,allocate_time + ); + + return 0; + } + } + + if (size_MB) + { + adios_buffer_alloc_percentage_set (0); + size = atoi (size_MB); + if (size_MB == 0) + { + adios_error (err_invalid_buffer_size, "config.xml: buffer size-MB is either 0 or " + "cannot be parsed: %s" + ,size_MB + ); + + return 0; + } + + if (size < 1) + size = 1; // we need a minimum 1 MB buffer + + adios_buffer_size_requested_set ((uint64_t) size * 1024 * 1024); + } + else + { + adios_buffer_alloc_percentage_set (1); + size = atoi (free_memory_percentage); + if (size > 0 && size <= 100) + { + adios_buffer_size_requested_set ((uint64_t) size); + } + else + { + adios_error (err_invalid_buffer_size, "config.xml: buffer free-memory-percentage %s " + "is not an integer between 1 and 100\n" + ,free_memory_percentage + ); + + return 0; + } + } + + if (adios_buffer_alloc_when_get() == ADIOS_BUFFER_ALLOC_NOW) + { + + // Do not attempt to allocate the buffer when this is being called from adios_lint +#ifndef _INTERNAL + return adios_set_buffer_size (); +#endif + + } + } + + return 1; +} + + +void PRINT_MXML_NODE (mxml_node_t *root) +{ + if (!root) + { + log_debug("MXML root=NULL\n"); + } + else if (root->type == MXML_ELEMENT) + { + log_debug("MXML ELEMENT root=%p, name=[%s] parent=%p\n", + root, root->value.element.name, root->parent); + } + else if (root->type == MXML_TEXT) + { + log_debug("MXML TEXT root=%p, text=[%s] parent=%p\n", + root, root->value.text.string, root->parent); + } + else + { + log_debug("MXML Type=%d root=%p, parent=%p\n", + root->type, root, root->parent); + } +} + +int adios_parse_config (const char * config, MPI_Comm comm) +{ + FILE * fp = 0; + mxml_node_t * doc = NULL; + mxml_node_t * node = NULL; + mxml_node_t * root = NULL; + int saw_datagroup = 0; + int saw_method = 0; + int saw_buffer = 0; + char * schema_version = 0; + + if (!adios_transports_initialized) + { + adios_transports_initialized = 1; + adios_init_transports (&adios_transports); + } + // NCSU ALACRITY-ADIOS - Initialize transform methods + adios_transform_init(); + + char * buffer = NULL; + //#if HAVE_MPI + int buffer_size = 0; + int rank; + MPI_Comm_rank (comm, &rank); + init_comm = comm; + if (rank == 0) + { + //#endif + fp = fopen (config, "r"); + if (!fp) + { + adios_error (err_missing_config_file, "missing config file %s\n", config); + + return 0; + } + struct stat s; + if (stat (config, &s) == 0) + { + buffer = malloc (s.st_size + 1); + buffer [s.st_size] = 0; + } + if (buffer) + { + size_t bytes_read = fread (buffer, 1, s.st_size, fp); + if (bytes_read != s.st_size) + { + adios_error (err_expected_read_size_mismatch, "error reading config file: %s. Expected %d Got %d\n" + ,config, s.st_size, bytes_read ); + + return 0; + } + } + else + { + adios_error (err_allocating_buffer_size, "error allocating %d for reading config.\n" + ,s.st_size + 1 + ); + + return 0; + } + fclose (fp); + //#if HAVE_MPI + buffer_size = s.st_size; + MPI_Bcast (&buffer_size, 1, MPI_INT, 0, comm); + MPI_Bcast (buffer, buffer_size, MPI_BYTE, 0, comm); + } + else + { + MPI_Bcast (&buffer_size, 1, MPI_INT, 0, comm); + buffer = malloc (buffer_size + 1); + if (!buffer) + { + adios_error (err_allocating_buffer_size, "cannot allocate %d bytes to receive config file\n" + ,buffer_size + 1 + ); + + return 0; + } + MPI_Bcast (buffer, buffer_size, MPI_BYTE, 0, comm); + buffer [buffer_size] = 0; + } + //#endif + + doc = mxmlLoadString (NULL, buffer, MXML_TEXT_CALLBACK); + free (buffer); + buffer = NULL; + + if (!doc) + { + adios_error (err_invalid_xml_doc, "config.xml: unknown error parsing XML " + "(probably structural)\n" + "Did you remember to start the file with\n" + "\n"); + + return 0; + } + + root = doc; + PRINT_MXML_NODE(root); + + if (strcasecmp (root->value.element.name, "adios-config")) { + root = mxmlFindElement (doc, doc, "adios-config", NULL, NULL, MXML_DESCEND); + PRINT_MXML_NODE(root); + } + + + if (!root || !root->value.element.name || strcasecmp (root->value.element.name, "adios-config")) + { + adios_error (err_invalid_xml_doc, "config.xml: did not find adios-config xml element\n"); + mxmlRelease (doc); + return 0; + } + else + { + const char * host_language = 0; + //const char * schema_version = 0; + int i; + + for (i = 0; i < root->value.element.num_attrs; i++) + { + mxml_attr_t * attr = &root->value.element.attrs [i]; + + GET_ATTR("host-language",attr,host_language,"var") + GET_ATTR("schema-version",attr,schema_version,"var") + log_warn ("config.xml: unknown attribute '%s' on %s " + "(ignored)\n" + ,attr->name + ,"adios-config" + ); + } + + if (!schema_version) + schema_version = ""; + + if (!host_language) + { + host_language = "Fortran"; + } + + if (!strcasecmp (host_language, "Fortran")) + { + adios_host_language_fortran = adios_flag_yes; + } + else + { + if (!strcasecmp (host_language, "C")) + { + adios_host_language_fortran = adios_flag_no; + } + else + { + adios_error (err_invalid_host_language, "config.xml: invalid host-language %s" + ,host_language + ); + + mxmlRelease (doc); + + return 0; + } + } + } + + for (node = mxmlWalkNext (root, doc, MXML_DESCEND_FIRST) + ;node + ;node = mxmlWalkNext (node, root, MXML_NO_DESCEND) + ) + { + if (node->type != MXML_ELEMENT) + { + continue; + } + + if (!strcasecmp (node->value.element.name, "adios-group")) + { + if (!parseGroup (node, schema_version)) + break; + saw_datagroup = 1; + } + else + { + if ( !strcasecmp (node->value.element.name, "transport") + || !strcasecmp (node->value.element.name, "method") + ) + { + if (!parseMethod (node)) + break; + saw_method = 1; + } + else + { + if (!strcasecmp (node->value.element.name, "buffer")) + { + if (!parseBuffer (node)) + break; + saw_buffer = 1; + } + else + { + if (!strcasecmp (node->value.element.name, "analysis")) + { + if (!parseAnalysis(node)) + break; + } + else + { + if (!strncmp (node->value.element.name, "!--", 3)) + { + continue; + } + else + { + log_warn ("config.xml: invalid element: %s\n" + ,node->value.element.name + ); + + break; + } + } + } + } + } + } + + mxmlRelease (doc); + + if (!saw_datagroup) + { + adios_error (err_no_group_defined, "config.xml: must define at least 1 adios-group in " + "config.xml\n" + ); + + return 0; + } + if (!saw_method) + { + adios_error (err_no_method_defined, "config.xml: must define at least 1 method for " + "the adios-group in config.xml\n" + ); + + return 0; + } + if (!saw_buffer) + { + adios_error (err_no_buffer_defined, "config.xml: must define the buffer element in " + "config.xml\n" + ); + + return 0; + } + + return 1; +} + +int adios_local_config (MPI_Comm comm) +{ + if (!adios_transports_initialized) + { + adios_transports_initialized = 1; + adios_init_transports (&adios_transports); + } + // NCSU ALACRITY-ADIOS - Initialize transform methods + adios_transform_init(); + + init_comm = comm; + return 1; +} + +static PairStruct * get_and_preprocess_params (const char * parameters) +{ + PairStruct *params, *p, *prev_p; + int verbose_level, removeit, save; + char *end; + + params = text_to_name_value_pairs (parameters); + + /* + p = params; + while (p) { + fprintf(stderr, "------- Param name = %s value = %s\n", p->name, p->value); + p = p->next; + } + */ + prev_p = NULL; + p = params; + while (p) { + //fprintf(stderr, "Parameter name = %s value = %s\n", p->name, p->value); + removeit = 0; + if (!strcasecmp (p->name, "verbose")) + { + if (p->value) { + errno = 0; + verbose_level = strtol(p->value, &end, 10); + if (errno || (end != 0 && *end != '\0')) { + log_error ("Invalid 'verbose' parameter passed to read init function: '%s'\n", p->value); + verbose_level = 1; // print errors only + } + } else { + verbose_level = 3; // info level + } + adios_verbose_level = verbose_level; + removeit = 1; + } + else if (!strcasecmp (p->name, "quiet")) + { + adios_verbose_level = 0; //don't print errors + removeit = 1; + } + else if (!strcasecmp (p->name, "logfile")) + { + /*fprintf (stderr,"****************** logfile = %s\n", p->value);*/ + if (p->value) { + adios_logger_open (p->value, -1); + } + removeit = 1; + } + else if (!strcasecmp (p->name, "abort_on_error")) + { + adios_abort_on_error = 1; + save = adios_verbose_level; + adios_verbose_level = 2; + log_warn ("ADIOS is set to abort on error\n"); + adios_verbose_level = save; + removeit = 1; + } + if (removeit) { + if (p == params) { + // remove head + //fprintf(stderr, " Remove HEAD p = %x p->next = %x\n", p, p->next); + p = p->next; + params->next = NULL; + free_name_value_pairs (params); + params = p; + } else { + // remove from middle of the list + //fprintf(stderr, " Remove MIDDLE prev = %x p = %x p->next = %x\n", prev_p, p, p->next); + prev_p->next = p->next; + p->next = NULL; + free_name_value_pairs (p); + p = prev_p->next; + } + } else { + //fprintf(stderr, " Keep MIDDLE prev = %x p = %x p->next = %x\n", prev_p, p, p->next); + prev_p = p; + p = p->next; + } + } + + return params; +} + +int adios_common_select_method (int priority, const char * method + ,const char * parameters, const char * group + ,const char * base_path, int iters + ) +{ + int64_t group_id; + struct adios_group_struct * g; + struct adios_method_struct * new_method; + int requires_group_comm = 0; + + new_method = (struct adios_method_struct *) + malloc (sizeof (struct adios_method_struct)); + + new_method->m = ADIOS_METHOD_UNKNOWN; + new_method->base_path = strdup (base_path); + new_method->method = strdup (method); + new_method->parameters = strdup (parameters); // string goes into BP file + new_method->iterations = iters; + new_method->priority = priority; + new_method->method_data = 0; + new_method->init_comm = init_comm; + new_method->group = 0; + + if (adios_parse_method (method, &new_method->m, &requires_group_comm)) + { + if ( new_method->m != ADIOS_METHOD_UNKNOWN + && new_method->m != ADIOS_METHOD_NULL + && adios_transports [new_method->m].adios_init_fn + ) + { + PairStruct * params = get_and_preprocess_params (parameters); + + adios_transports [new_method->m].adios_init_fn + (params, new_method); + + free_name_value_pairs (params); + } + } + else + { + adios_error (err_invalid_write_method, "config.xml: invalid transport: %s\n", method); + + free (new_method->base_path); + free (new_method->method); + free (new_method->parameters); + free (new_method); + + return 0; + } + + adios_common_get_group (&group_id, group); + g = (struct adios_group_struct *) group_id; + if (!g) + { + adios_error (err_missing_invalid_group, "config.xml: Didn't find group: %s for transport: %s\n" + ,group, method + ); + + free (new_method->base_path); + free (new_method->method); + free (new_method->parameters); + free (new_method); + + return 0; + } + else + { + adios_add_method_to_group (&g->methods, new_method); + new_method->group = g; + } + + adios_append_method (new_method); + + return 1; +} + +int adios_common_select_method_by_group_id (int priority, const char * method + ,const char * parameters, int64_t group_id + ,const char * base_path, int iters + ) +{ + struct adios_group_struct * g; + struct adios_method_struct * new_method; + int requires_group_comm = 0; + + new_method = (struct adios_method_struct *) + malloc (sizeof (struct adios_method_struct)); + + new_method->m = ADIOS_METHOD_UNKNOWN; + new_method->base_path = strdup (base_path); + new_method->method = strdup (method); + new_method->parameters = strdup (parameters); + new_method->iterations = iters; + new_method->priority = priority; + new_method->method_data = 0; + new_method->group = 0; + new_method->init_comm = init_comm; + + if (adios_parse_method (method, &new_method->m, &requires_group_comm)) + { + if ( new_method->m != ADIOS_METHOD_UNKNOWN + && new_method->m != ADIOS_METHOD_NULL + && adios_transports [new_method->m].adios_init_fn + ) + { + PairStruct * params = get_and_preprocess_params (parameters); + + adios_transports [new_method->m].adios_init_fn + (params, new_method); + + free_name_value_pairs (params); + } + } + else + { + adios_error (err_invalid_write_method, "config.xml: invalid transport: %s\n", method); + + free (new_method->base_path); + free (new_method->method); + free (new_method->parameters); + free (new_method); + + return 0; + } + + g = (struct adios_group_struct *) group_id; + if (!g) + { + adios_error (err_missing_invalid_group, "config.xml: invalid group id: %llu for transport: %s\n" + ,group_id, method + ); + + free (new_method->base_path); + free (new_method->method); + free (new_method->parameters); + free (new_method); + + return 0; + } + else + { + if (requires_group_comm && !g->group_comm) + { + adios_error (err_group_method_mismatch, "config.xml: method %s for group %s. Group does " + "not have the required coordination-communicator" + ".\n" + ,method, g->name + ); + + free (new_method->base_path); + free (new_method->method); + free (new_method->parameters); + free (new_method); + + return 0; + } + adios_add_method_to_group (&g->methods, new_method); + new_method->group = g; + } + + adios_append_method (new_method); + + return 1; +} + +void adios_cleanup () +{ + adios_transports_initialized = 0; + if (adios_transports) { + adios_free_transports (adios_transports); + free (adios_transports); + } + adios_transports = 0; + + while (adios_methods) + { + struct adios_method_list_struct * methods = adios_methods->next; + if (adios_methods->method->base_path) + free (adios_methods->method->base_path); + if (adios_methods->method->method) + free (adios_methods->method->method); + if (adios_methods->method->method_data) + free (adios_methods->method->method_data); + if (adios_methods->method->parameters) + free (adios_methods->method->parameters); + free (adios_methods->method); + free (adios_methods); + adios_methods = methods; + } + + while (adios_groups) + { + struct adios_group_list_struct * groups = adios_groups->next; + + if (adios_groups->group->name) + free (adios_groups->group->name); + + while (adios_groups->group->vars) + { + struct adios_var_struct * vars = adios_groups->group->vars->next; + + if (adios_groups->group->vars->name) + free (adios_groups->group->vars->name); + if (adios_groups->group->vars->path) + free (adios_groups->group->vars->path); + // ADIOS Schema + // if (adios_groups->group->vars->mesh) + // free (adios_groups->group->vars->mesh); + + + while (adios_groups->group->vars->dimensions) + { + struct adios_dimension_struct * dimensions + = adios_groups->group->vars->dimensions->next; + + free (adios_groups->group->vars->dimensions); + adios_groups->group->vars->dimensions = dimensions; + } + + // NCSU - Clean up stat + if (adios_groups->group->vars->stats) + { + int j, idx; + int c, count = 1; + + if (adios_groups->group->vars->type == adios_complex || adios_groups->group->vars->type == adios_double_complex) + count = 3; + + for (c = 0; c < count; c ++) + { + j = idx = 0; + while (adios_groups->group->vars->bitmap >> j) + { + if (adios_groups->group->vars->bitmap >> j & 1) + { + if (j == adios_statistic_hist) + { + struct adios_index_characteristics_hist_struct * hist = (struct adios_index_characteristics_hist_struct *) adios_groups->group->vars->stats[c][idx].data; + free (hist->breaks); + free (hist->frequencies); + free (hist); + } + else + free (adios_groups->group->vars->stats[c][idx].data); + idx ++; + } + j ++; + } + free (adios_groups->group->vars->stats[c]); + } + + free (adios_groups->group->vars->stats); + } + + // NCSU ALACRITY-ADIOS - Clean transform metadata + adios_transform_clear_transform_var(adios_groups->group->vars); + + if (adios_groups->group->vars->data) + free (adios_groups->group->vars->data); + + free (adios_groups->group->vars); + adios_groups->group->vars = vars; + } + + while (adios_groups->group->attributes) + { + struct adios_attribute_struct * attributes + = adios_groups->group->attributes->next; + + if (adios_groups->group->attributes->name) + free (adios_groups->group->attributes->name); + if (adios_groups->group->attributes->path) + free (adios_groups->group->attributes->path); + if (adios_groups->group->attributes->value) + free (adios_groups->group->attributes->value); + + free (adios_groups->group->attributes); + adios_groups->group->attributes = attributes; + } + + if (adios_groups->group->group_comm) + free (adios_groups->group->group_comm); + if (adios_groups->group->group_by) + free (adios_groups->group->group_by); + if (adios_groups->group->time_index_name) + free (adios_groups->group->time_index_name); + + while (adios_groups->group->methods) + { + struct adios_method_list_struct * m = adios_groups->group->methods->next; + free (adios_groups->group->methods); + adios_groups->group->methods = m; + } + + // ADIOS Schema + /*while (adios_groups->group->meshs) + { + struct adios_mesh_struct * meshs = adios_groups->group->meshs->next; + + if (adios_groups->group->meshs->name) + free (adios_groups->group->meshs->name); + + switch (adios_groups->group->meshs->type) + { + case ADIOS_MESH_UNIFORM: + { + struct adios_mesh_item_list_struct * i; + while (adios_groups->group->meshs->uniform->dimensions) + { + i = adios_groups->group->meshs->uniform->dimensions->next; + free (adios_groups->group->meshs->uniform->dimensions); + adios_groups->group->meshs->uniform->dimensions = i; + } + while (adios_groups->group->meshs->uniform->origin) + { + i = adios_groups->group->meshs->uniform->origin->next; + free (adios_groups->group->meshs->uniform->origin); + adios_groups->group->meshs->uniform->origin = i; + } + while (adios_groups->group->meshs->uniform->spacing) + { + i = adios_groups->group->meshs->uniform->spacing->next; + free (adios_groups->group->meshs->uniform->spacing); + adios_groups->group->meshs->uniform->spacing = i; + } + while (adios_groups->group->meshs->uniform->origin) + { + i = adios_groups->group->meshs->uniform->origin->next; + free (adios_groups->group->meshs->uniform->origin); + adios_groups->group->meshs->uniform->origin = i; + } + break; + } + case ADIOS_MESH_STRUCTURED: + { + struct adios_mesh_item_list_struct * i; + struct adios_mesh_var_list_struct * v; + while (adios_groups->group->meshs->structured->dimensions) + { + i = adios_groups->group->meshs->structured->dimensions->next; + free (adios_groups->group->meshs->structured->dimensions); + adios_groups->group->meshs->structured->dimensions = i; + } + while (adios_groups->group->meshs->structured->points) + { + v = adios_groups->group->meshs->structured->points->next; + free (adios_groups->group->meshs->structured->points); + adios_groups->group->meshs->structured->points = v; + } + if (adios_groups->group->meshs->structured->nspace) + free (adios_groups->group->meshs->structured->nspace); + + break; + } + case ADIOS_MESH_RECTILINEAR: + { + struct adios_mesh_item_list_struct * i; + struct adios_mesh_var_list_struct * v; + while (adios_groups->group->meshs->rectilinear->dimensions) + { + i = adios_groups->group->meshs->rectilinear->dimensions->next; + free (adios_groups->group->meshs->rectilinear->dimensions); + adios_groups->group->meshs->rectilinear->dimensions = i; + } + while (adios_groups->group->meshs->rectilinear->coordinates) + { + v = adios_groups->group->meshs->rectilinear->coordinates->next; + free (adios_groups->group->meshs->rectilinear->coordinates); + adios_groups->group->meshs->rectilinear->coordinates = v; + } + + break; + } + case ADIOS_MESH_UNSTRUCTURED: + { + struct adios_mesh_var_list_struct * v; + if (adios_groups->group->meshs->unstructured->cell_set_count) + free (adios_groups->group->meshs->unstructured->cell_set_count); + if (adios_groups->group->meshs->unstructured->points_count) + free (adios_groups->group->meshs->unstructured->points_count); + if (adios_groups->group->meshs->unstructured->nspace) + free (adios_groups->group->meshs->unstructured->nspace); + while (adios_groups->group->meshs->unstructured->points) + { + v = adios_groups->group->meshs->unstructured->points->next; + free (adios_groups->group->meshs->unstructured->points); + adios_groups->group->meshs->unstructured->points = v; + } + while (adios_groups->group->meshs->unstructured->cell_list) + { + struct adios_mesh_cell_list_list_struct * next + = adios_groups->group->meshs->unstructured->cell_list->next; + free (adios_groups->group->meshs->unstructured->cell_list); + adios_groups->group->meshs->unstructured->cell_list = next; + } + + break; + } + } + + free (adios_groups->group->meshs); + adios_groups->group->meshs = meshs; + }*/ + + free (adios_groups->group); + free (adios_groups); + adios_groups = groups; + } +} + + diff --git a/tests/libs/adios/src/core/adios_internals_mxml.h b/tests/libs/adios/src/core/adios_internals_mxml.h new file mode 100644 index 0000000000..30f99ffe22 --- /dev/null +++ b/tests/libs/adios/src/core/adios_internals_mxml.h @@ -0,0 +1,39 @@ +/* + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + */ + +#ifndef ADIOS_INTERNALS_MXML_H +#define ADIOS_INTERNALS_MXML_H + +#include "public/adios_mpi.h" + +int adios_parse_config (const char * config, MPI_Comm comm); +int adios_local_config (MPI_Comm comm); +int adios_common_select_method (int priority, const char * method + ,const char * parameters, const char * group + ,const char * base_path, int iters + ); +int adios_common_select_method_by_group_id (int priority, const char * method + ,const char * parameters, int64_t group_id + ,const char * base_path, int iters + ); +//ADIOS Schema +struct adios_mesh_struct * adios_find_mesh_by_name (struct adios_mesh_struct * root + ,const char * name + ); +struct adios_mesh_struct * adios_common_define_mesh ( + int64_t group_id, const char * name, + enum ADIOS_FLAG time_varying, + enum ADIOS_MESH_TYPE type); + +void adios_cleanup (); + +int adios_set_buffer_size (void); + +uint64_t adios_method_buffer_alloc (uint64_t size); +int adios_method_buffer_free (uint64_t size); + +#endif diff --git a/tests/libs/adios/src/core/adios_logger.c b/tests/libs/adios/src/core/adios_logger.c new file mode 100644 index 0000000000..64da4d097f --- /dev/null +++ b/tests/libs/adios/src/core/adios_logger.c @@ -0,0 +1,60 @@ +/* + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + */ + +/* Logger functions */ +#include +#include +#include +#include "core/adios_logger.h" + +FILE *adios_logf = NULL; +int adios_verbose_level = 2; // WARN level (0 = no logs) +int adios_abort_on_error = 0; +char *adios_log_names[4] = {"ERROR","WARN ","INFO ","DEBUG"}; + + +void adios_logger_open (char *logpath, int rank) +{ + adios_logger_close(); + + if (!logpath || !strcmp(logpath, "stderr")) { + adios_logf = stderr; + } else if (!strcmp(logpath, "stdout")) { + adios_logf = stdout; + } else { + char path[256]; + if (rank >= 0) + snprintf (path, 256, "%s.%d", logpath, rank); + else + strncpy (path, logpath, 256); + adios_logf = fopen (path, "w"); + if (!adios_logf) { + fprintf (stderr, "Logger file %s cannot be opened. Use stderr for logging.\n" + " errno=%d: %s\n", path, errno, strerror(errno)); + adios_logf = stderr; + } + } +} + +void adios_logger_close() +{ + if (adios_logf && adios_logf != stdout && adios_logf != stderr) + { + fclose(adios_logf); + adios_logf = NULL; + } +} + +/* +void adios_log(int verbose_level, ...) +{ + if (adios_verbose_level >= verbose_level) { + fprintf (adios_logf, __VA_ARGS__); + fflush(adios_logf); + } +} +*/ diff --git a/tests/libs/adios/src/core/adios_logger.h b/tests/libs/adios/src/core/adios_logger.h new file mode 100644 index 0000000000..69af5593cf --- /dev/null +++ b/tests/libs/adios/src/core/adios_logger.h @@ -0,0 +1,41 @@ +#ifndef __ADIOS_LOGGER_H__ +#define __ADIOS_LOGGER_H__ + +/* Logger functions */ +#include +#include + +extern FILE *adios_logf; +extern int adios_verbose_level; // default = 2 (print warnings) +extern int adios_abort_on_error; // default = 0 (don't abort) +extern char *adios_log_names[4]; + +/* Direct log into file(s). + rank >=0: log file is . + rank <0: log file is +*/ +void adios_logger_open (char *logpath, int rank); +void adios_logger_close(); + +#define adios_logger(verbose_level, print_header, ...) { \ + if (adios_verbose_level >= verbose_level) { \ + if (!adios_logf) adios_logf=stderr; \ + if (print_header) \ + fprintf (adios_logf, "%s: ",adios_log_names[verbose_level-1]); \ + fprintf (adios_logf, __VA_ARGS__); \ + fflush(adios_logf);\ + }\ +} + + +#define log_error(...) adios_logger(1, 1, __VA_ARGS__); if (adios_abort_on_error) abort(); +#define log_warn(...) adios_logger(2, 1, __VA_ARGS__) +#define log_info(...) adios_logger(3, 1, __VA_ARGS__) +#define log_debug(...) adios_logger(4, 1, __VA_ARGS__) + +#define log_error_cont(...) adios_logger(1, 0, __VA_ARGS__) +#define log_warn_cont(...) adios_logger(2, 0, __VA_ARGS__) +#define log_info_cont(...) adios_logger(3, 0, __VA_ARGS__) +#define log_debug_cont(...) adios_logger(4, 0, __VA_ARGS__) + +#endif diff --git a/tests/libs/adios/src/core/adios_read.c b/tests/libs/adios/src/core/adios_read.c new file mode 100644 index 0000000000..5e6624142e --- /dev/null +++ b/tests/libs/adios/src/core/adios_read.c @@ -0,0 +1,229 @@ +/* + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + */ + +#include +#include +#include "adios_read_v2.h" +#include "adios_error.h" +#include "core/adios_logger.h" +#include "core/common_read.h" +#define BYTE_ALIGN 8 + + +const char *adios_errmsg () +{ + return adios_get_last_errmsg(); +} + +int adios_read_init_method (enum ADIOS_READ_METHOD method, MPI_Comm comm, const char * parameters) +{ + return common_read_init_method (method,comm,parameters); +} + +int adios_read_finalize_method(enum ADIOS_READ_METHOD method) +{ + int retval = common_read_finalize_method(method); + log_debug ("adios_read_finalize_method completed\n"); + return retval; +} + +ADIOS_FILE * adios_read_open (const char * fname, + enum ADIOS_READ_METHOD method, + MPI_Comm comm, + enum ADIOS_LOCKMODE lock_mode, + float timeout_sec) +{ + return common_read_open (fname, method, comm, lock_mode, timeout_sec); +} + +ADIOS_FILE * adios_read_open_file (const char * fname, + enum ADIOS_READ_METHOD method, + MPI_Comm comm) +{ + return common_read_open_file (fname, method, comm); +} + +int adios_read_close (ADIOS_FILE *fp) +{ + return common_read_close (fp); +} + +int adios_advance_step (ADIOS_FILE *fp, int last, float timeout_sec) +{ + return common_read_advance_step (fp, last, timeout_sec); +} + +void adios_release_step (ADIOS_FILE *fp) +{ + common_read_release_step (fp); +} + +ADIOS_VARINFO * adios_inq_var (ADIOS_FILE *fp, const char * varname) +{ + return common_read_inq_var (fp, varname); +} + +ADIOS_VARINFO * adios_inq_var_byid (ADIOS_FILE *fp, int varid) +{ + return common_read_inq_var_byid (fp, varid); +} + +void adios_free_varinfo (ADIOS_VARINFO *vp) +{ + common_read_free_varinfo (vp); +} + +int adios_inq_var_stat (ADIOS_FILE *fp, ADIOS_VARINFO * varinfo, + int per_step_stat, int per_writer_stat) +{ + return common_read_inq_var_stat (fp, varinfo, per_step_stat, per_writer_stat); +} + +int adios_inq_var_blockinfo (ADIOS_FILE *fp, ADIOS_VARINFO * varinfo) +{ + return common_read_inq_var_blockinfo (fp, varinfo); +} + +ADIOS_MESH * adios_inq_mesh_byid (ADIOS_FILE *fp, int meshid) +{ + return common_read_inq_mesh_byid (fp, meshid); +} + +int adios_complete_meshinfo (ADIOS_FILE *datafile, ADIOS_FILE *meshfile, ADIOS_MESH *meshinfo) +{ + return common_read_complete_meshinfo (datafile, meshfile, meshinfo); +} + +void adios_free_meshinfo (ADIOS_MESH *meshinfo) +{ + common_read_free_meshinfo (meshinfo); +} + +int adios_inq_var_meshinfo (ADIOS_FILE *fp, ADIOS_VARINFO * varinfo) +{ + return common_read_inq_var_meshinfo (fp, varinfo); +} + +int adios_schedule_read (const ADIOS_FILE * fp, + const ADIOS_SELECTION * sel, + const char * varname, + int from_steps, + int nsteps, + void * data) +{ + return common_read_schedule_read (fp, sel, varname, from_steps, nsteps, NULL, data); +} + +int adios_schedule_read_byid (const ADIOS_FILE * fp, + const ADIOS_SELECTION * sel, + int varid, + int from_steps, + int nsteps, + void * data) +{ + return common_read_schedule_read_byid (fp, sel, varid, from_steps, nsteps, NULL, data); +} + +int adios_schedule_read_param (const ADIOS_FILE * fp, + const ADIOS_SELECTION * sel, + const char * varname, + int from_steps, + int nsteps, + const char * param, + void * data) { + return common_read_schedule_read (fp, sel, varname, from_steps, nsteps, param, data); +} + +int adios_schedule_read_byid_param (const ADIOS_FILE * fp, + const ADIOS_SELECTION * sel, + int varid, + int from_steps, + int nsteps, + const char * param, + void * data) { + return common_read_schedule_read_byid (fp, sel, varid, from_steps, nsteps, param, data); +} + +int adios_perform_reads (const ADIOS_FILE *fp, int blocking) +{ + return common_read_perform_reads (fp, blocking); +} + +int adios_check_reads (const ADIOS_FILE * fp, ADIOS_VARCHUNK ** chunk) +{ + return common_read_check_reads (fp, chunk); +} + +void adios_free_chunk (ADIOS_VARCHUNK *chunk) +{ + common_read_free_chunk (chunk); +} + +int adios_get_attr (ADIOS_FILE * fp, const char * attrname, enum ADIOS_DATATYPES * type, + int * size, void ** data) +{ + return common_read_get_attr (fp, attrname, type, size, data); +} + +int adios_get_attr_byid (ADIOS_FILE * fp, int attrid, + enum ADIOS_DATATYPES * type, int * size, void ** data) +{ + return common_read_get_attr_byid (fp, attrid, type, size, data); +} + +const char * adios_type_to_string (enum ADIOS_DATATYPES type) +{ + return common_read_type_to_string (type); +} + +int adios_type_size(enum ADIOS_DATATYPES type, void *data) +{ + return common_read_type_size(type, data); +} + +int adios_get_grouplist (ADIOS_FILE *fp, char ***group_namelist) +{ + return common_read_get_grouplist (fp, group_namelist); +} + +int adios_group_view (ADIOS_FILE *fp, int groupid) +{ + return common_read_group_view (fp, groupid); +} + +void adios_print_fileinfo (ADIOS_FILE *fp) +{ + common_read_print_fileinfo(fp); +} + + +ADIOS_SELECTION * adios_selection_boundingbox (int ndim, const uint64_t *start, const uint64_t *count) +{ + return common_read_selection_boundingbox (ndim, start, count); +} + +ADIOS_SELECTION * adios_selection_points (int ndim, uint64_t npoints, const uint64_t *points) +{ + return common_read_selection_points (ndim, npoints, points); +} + +ADIOS_SELECTION * adios_selection_writeblock (int index) +{ + return common_read_selection_writeblock (index); +} + +ADIOS_SELECTION * adios_selection_auto (char *hints) +{ + return common_read_selection_auto (hints); +} + +void adios_selection_delete (ADIOS_SELECTION *sel) +{ + common_read_selection_delete (sel); +} + + diff --git a/tests/libs/adios/src/core/adios_read_ext.c b/tests/libs/adios/src/core/adios_read_ext.c new file mode 100644 index 0000000000..4a8baa6af8 --- /dev/null +++ b/tests/libs/adios/src/core/adios_read_ext.c @@ -0,0 +1,269 @@ +/* + * adios_read_ext.c + * + * Created on: Apr 28, 2014 + * Author: xczou + */ + +#include +#include +#include + +#include "adios_read_ext.h" +#include "core/common_read.h" +#include "core/transforms/adios_transforms_common.h" +#include "core/transforms/adios_transforms_transinfo.h" +#include "core/transforms/adios_transforms_read.h" +#include "core/adios_selection_util.h" +#include "core/adios_infocache.h" + +// Ensure unique pointer-based values for each one +const data_view_t LOGICAL_DATA_VIEW = &LOGICAL_DATA_VIEW; +const data_view_t PHYSICAL_DATA_VIEW = &PHYSICAL_DATA_VIEW; + +const adios_transform_type_t NO_TRANSFORM = adios_transform_none; + +// Sets the "data view" for this ADIOS file, which determines how ADIOS presents variables through +// adios_inq_var*, and how reads are evaluated in adios_schedule_reads/adios_check_reads calls. +// Currently, the choice is between a logical and physical view of the data, which only differ for +// transformed variables; a logical view of a transformed variable presents the data as it was +// originally written (this is the default), whereas a physical view presents the transformed data +// as it actually exists on disk. +data_view_t adios_read_set_data_view(ADIOS_FILE *fp, data_view_t data_view) { + return common_read_set_data_view(fp, data_view); +} + +// Populates data transform information about a given variable into an ADIOS_VARTRANSFORM struct +// Return NULL if failed +ADIOS_VARTRANSFORM * adios_inq_var_transform(const ADIOS_FILE *fp, const ADIOS_VARINFO *varinfo){ + // Get the global metadata + ADIOS_TRANSINFO* tinfo = common_read_inq_transinfo(fp, varinfo); + if (tinfo == NULL) + return NULL; + + // Get the per-PG metadata + common_read_inq_trans_blockinfo(fp, varinfo, tinfo); + if (tinfo->orig_blockinfo == NULL || tinfo->transform_metadatas == NULL) + return NULL; + + // Load all the metadata into the ADIOS_VARTRANSFORM datastructure + ADIOS_VARTRANSFORM *vartransform = (ADIOS_VARTRANSFORM*) malloc(sizeof(ADIOS_VARTRANSFORM)); + *vartransform = (ADIOS_VARTRANSFORM){ + .varid = varinfo->varid, + .sum_nblocks = varinfo->sum_nblocks, + .transform_type = tinfo->transform_type, + .should_free_transform_metadata = tinfo->should_free_transform_metadata, + .transform_metadatas = tinfo->transform_metadatas + }; + + // Transfer ownership of the transform_metadatas array to the new struct, then free the struct + tinfo->transform_metadatas = NULL; + common_read_free_transinfo(varinfo, tinfo); + + return vartransform; +} + +#define MYFREE(p) {if (p){ free((void*)(p)); (p) = NULL; }} +void adios_free_var_transform(ADIOS_VARTRANSFORM *vartransform) { + if (vartransform->transform_metadatas) { + if (vartransform->should_free_transform_metadata) { + int i; + for (i = 0; i < vartransform->sum_nblocks; i++) + MYFREE(vartransform->transform_metadatas[i].content); + } + MYFREE(vartransform->transform_metadatas); + } + MYFREE(vartransform); +} + + +void adios_free_pg_intersections(ADIOS_PG_INTERSECTIONS **intersections){ + ADIOS_PG_INTERSECTIONS * intsec = *intersections; + int i = 0; + for(i=0; i < intsec->npg; i++){ + ADIOS_PG_INTERSECTION inter = intsec->intersections[i]; + common_read_selection_delete(inter.pg_bounds_sel); + common_read_selection_delete(inter.intersection_sel); + } + intsec->npg = 0; + intsec->intersections = NULL; + MYFREE(*intersections); +} + +#undef MYFREE + +adios_transform_type_t adios_get_transform_type_by_uid(const char *transform_uid) { + return (adios_transform_type_t)adios_transform_find_type_by_uid(transform_uid); +} + +// Creates a writeblock selection that only retrieves elements [start_elem, start_elem + num_elems) +// within a variable. An element is a single value of whatever the varaible's datatype is (i.e., +// 1 element = 1 double if the variable type is double, 1 byte if the variable type is byte, etc.) +ADIOS_SELECTION * adios_selection_writeblock_bounded(int index, uint64_t start_elem, uint64_t num_elems, int is_timestep_relative) { + ADIOS_SELECTION *sel = common_read_selection_writeblock(index); + sel->u.block.is_absolute_index = !is_timestep_relative; + sel->u.block.is_sub_pg_selection = 1; + sel->u.block.element_offset = start_elem; + sel->u.block.nelements = num_elems; + return sel; +} + +/* + * Determines the block indices corresponding to a start and end timestep. + * Both the input start/end timesteps and the output start/end blockidx are lower bound inclusive, upper bound exclusive: [start, end) + */ +static void compute_blockidx_range(const ADIOS_VARINFO *raw_varinfo, int from_steps, int to_steps, int *start_blockidx, int *end_blockidx) { + int blockidx; + + // Find the block index for the start and end timestep + int curblocks = 0; + for (blockidx = 0; blockidx < raw_varinfo->nsteps; blockidx++) { + // Find the start block + if (blockidx == from_steps) { + *start_blockidx = curblocks; + } + curblocks += raw_varinfo->nblocks[blockidx]; + // Find the end block, then stop + if (blockidx == to_steps - 1) { + *end_blockidx = curblocks; + break; + } + } +} + +inline static ADIOS_SELECTION * create_pg_bounds(int ndim, ADIOS_VARBLOCK *orig_vb) { + return common_read_selection_boundingbox(ndim, orig_vb->start, orig_vb->count); +} + +int adios_get_absolute_writeblock_index(const ADIOS_VARINFO *varinfo, int timestep_relative_idx, int timestep) { + int i; + int absolute_idx = timestep_relative_idx; + + assert(varinfo->blockinfo); + + if (timestep < 0 || timestep >= varinfo->nsteps) { + adios_error(err_invalid_timestep, + "Timestep %d out of range (min 0, max %d) (at %s:%s)", + timestep, varinfo->nsteps, __FILE__, __LINE__); + return -1; + } + if (timestep_relative_idx < 0 || timestep_relative_idx >= varinfo->nblocks[timestep]) { + adios_error(err_invalid_argument, + "Writeblock %d out of range for timestep %d (min 0, max %d) (at %s:%s)", + timestep_relative_idx, timestep, varinfo->nsteps, __FILE__, __LINE__); + return -1; + } + + for (i = 0; i < timestep; i++) + absolute_idx += varinfo->nblocks[i]; + + return absolute_idx; +} + +#define INITIAL_INTERSECTION_CAPACITY 16; +ADIOS_PG_INTERSECTIONS * adios_find_intersecting_pgs(const ADIOS_FILE *fp, int varid, const ADIOS_SELECTION *sel, const int from_step, const int nsteps) { + // Declares + adios_transform_read_request *new_reqgroup; + int blockidx, timestep, timestep_blockidx; + int curblocks, start_blockidx, end_blockidx; + int intersects; + ADIOS_VARBLOCK *raw_vb, *vb; + + enum ADIOS_FLAG swap_endianness = (fp->endianness == get_system_endianness()) ? adios_flag_no : adios_flag_yes; + int to_steps = from_step + nsteps; + + // As long as we don't free/destroy it, using the infocache from the file will have no effect on future + // operations using the file (except possibly speeding them up, so "constness" is still respected + adios_infocache *infocache = common_read_get_file_infocache((ADIOS_FILE*)fp); + + ADIOS_PG_INTERSECTIONS *resulting_intersections = (ADIOS_PG_INTERSECTIONS *)calloc(1, sizeof(ADIOS_PG_INTERSECTIONS)); + resulting_intersections->npg = 0; + + int intersection_capacity = INITIAL_INTERSECTION_CAPACITY; + resulting_intersections->intersections = (ADIOS_PG_INTERSECTION *)calloc(intersection_capacity, sizeof(ADIOS_PG_INTERSECTION)); + + // Precondition checking + if (sel->type != ADIOS_SELECTION_BOUNDINGBOX && + sel->type != ADIOS_SELECTION_POINTS) { + adios_error(err_operation_not_supported, "Only bounding box and point selections are currently supported during read on transformed variables."); + } + + // Still respecting constness, since we're going to undo this + const data_view_t old_view = adios_read_set_data_view((ADIOS_FILE*)fp, LOGICAL_DATA_VIEW); // Temporarily go to logical data view + + const ADIOS_VARINFO *varinfo = adios_infocache_inq_varinfo(fp, infocache, varid); + assert(from_step >= 0 && to_steps <= varinfo->nsteps); + + // Compute the blockidx range, given the timesteps + compute_blockidx_range(varinfo, from_step, to_steps, &start_blockidx, &end_blockidx); + + // Retrieve blockinfos, if they haven't been done retrieved + if (!varinfo->blockinfo) + common_read_inq_var_blockinfo(fp, (ADIOS_VARINFO *)varinfo); + + // Undoing view set (returning to const state) + adios_read_set_data_view((ADIOS_FILE*)fp, old_view); // Reset the data view to whatever it was before + + // Assemble read requests for each varblock + blockidx = start_blockidx; + timestep = from_step; + timestep_blockidx = 0; + + while (blockidx != end_blockidx) { //for (blockidx = startblock_idx; blockidx != endblock_idx; blockidx++) { + ADIOS_SELECTION *pg_bounds_sel; + ADIOS_SELECTION *pg_intersection_sel; + + vb = &varinfo->blockinfo[blockidx]; + pg_bounds_sel = create_pg_bounds(varinfo->ndim, vb); + + // Find the intersection, if any + pg_intersection_sel = adios_selection_intersect_global(pg_bounds_sel, sel); + if (pg_intersection_sel) { + // Expand the PG intersection array, if needed + if (resulting_intersections->npg == intersection_capacity) { + intersection_capacity *= 2; + resulting_intersections->intersections = (ADIOS_PG_INTERSECTION *)realloc(resulting_intersections->intersections, intersection_capacity * sizeof(ADIOS_PG_INTERSECTION)); + + if (!resulting_intersections->intersections) { + adios_error (err_no_memory, "Cannot allocate buffer for PG intersection results in adios_find_intersecting_pgs (required %llu bytes)\n", intersection_capacity * sizeof(ADIOS_PG_INTERSECTION)); + return NULL; + } + } + + ADIOS_PG_INTERSECTION *intersection = &resulting_intersections->intersections[resulting_intersections->npg]; + intersection->timestep = timestep; + intersection->blockidx = blockidx; + intersection->blockidx_in_timestep = timestep_blockidx; + intersection->intersection_sel = pg_intersection_sel; + intersection->pg_bounds_sel = pg_bounds_sel; + + resulting_intersections->npg++; + } else { + // Cleanup + common_read_selection_delete(pg_bounds_sel); // OK to delete, because this function only frees the outer struct, not the arrays within + } + + // Increment block indexes + blockidx++; + timestep_blockidx++; + if (timestep_blockidx == varinfo->nblocks[timestep]) { + timestep_blockidx = 0; + timestep++; + } + } + + return resulting_intersections; +} + + +// What is the dimension order of arrays in the file? +// 0: C ordering (row-major), last dimension is the fastest dimension +// 1: Fortran ordering (column-major), first dimension is the fastest dimension +int adios_read_get_dimension_order (ADIOS_FILE * fp) +{ + return common_read_get_dimension_order (fp); +} + + + + diff --git a/tests/libs/adios/src/core/adios_read_hooks.c b/tests/libs/adios/src/core/adios_read_hooks.c new file mode 100644 index 0000000000..8cbb1f1d08 --- /dev/null +++ b/tests/libs/adios/src/core/adios_read_hooks.c @@ -0,0 +1,91 @@ +/* + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + */ + +#include "config.h" +#include +#include +#include +#include "adios_read_hooks.h" + +#define MATCH_STRING_TO_METHOD(b,d,r) \ +if (!strcasecmp (buf,b)) \ +{*method=d;*requires_group_comm=r;return 1;} + +#define ASSIGN_FNS(a,b) \ +(*t) [b].method_name = strdup(#b); \ +(*t) [b].adios_read_init_method_fn = adios_read_##a##_init_method; \ +(*t) [b].adios_read_finalize_method_fn = adios_read_##a##_finalize_method; \ +(*t) [b].adios_read_open_fn = adios_read_##a##_open; \ +(*t) [b].adios_read_open_file_fn = adios_read_##a##_open_file; \ +(*t) [b].adios_read_close_fn = adios_read_##a##_close; \ +(*t) [b].adios_advance_step_fn = adios_read_##a##_advance_step; \ +(*t) [b].adios_release_step_fn = adios_read_##a##_release_step; \ +(*t) [b].adios_inq_var_byid_fn = adios_read_##a##_inq_var_byid; \ +(*t) [b].adios_inq_var_stat_fn = adios_read_##a##_inq_var_stat; \ +(*t) [b].adios_inq_var_blockinfo_fn = adios_read_##a##_inq_var_blockinfo; \ +(*t) [b].adios_schedule_read_byid_fn = adios_read_##a##_schedule_read_byid; \ +(*t) [b].adios_perform_reads_fn = adios_read_##a##_perform_reads; \ +(*t) [b].adios_check_reads_fn = adios_read_##a##_check_reads; \ +(*t) [b].adios_get_attr_byid_fn = adios_read_##a##_get_attr_byid; \ +(*t) [b].adios_get_dimension_order_fn = adios_read_##a##_get_dimension_order; \ +(*t) [b].adios_reset_dimension_order_fn = adios_read_##a##_reset_dimension_order; \ +(*t) [b].adios_get_groupinfo_fn = adios_read_##a##_get_groupinfo; \ +(*t) [b].adios_is_var_timed_fn = adios_read_##a##_is_var_timed; \ +(*t) [b].adios_inq_var_transinfo_fn = adios_read_##a##_inq_var_transinfo; \ +(*t) [b].adios_inq_var_trans_blockinfo_fn = adios_read_##a##_inq_var_trans_blockinfo; + +void adios_read_hooks_init (struct adios_read_hooks_struct ** t) +{ + static int did_init = 0; + // we need to init only once in the lifetime of an application + // called from common_read.c/common_read_init_method() and + // from common_read.c/common_read_open_*() + if (!did_init) { + fflush(stdout); + *t = (struct adios_read_hooks_struct *) + calloc (ADIOS_READ_METHOD_COUNT, sizeof (struct adios_read_hooks_struct)); + + ASSIGN_FNS(bp,ADIOS_READ_METHOD_BP) +#ifndef __MPI_DUMMY_H__ + ASSIGN_FNS(bp_staged,ADIOS_READ_METHOD_BP_AGGREGATE) +#endif +#if HAVE_DATASPACES + ASSIGN_FNS(dataspaces,ADIOS_READ_METHOD_DATASPACES) +#endif + +#if HAVE_DIMES + ASSIGN_FNS(dimes,ADIOS_READ_METHOD_DIMES) +#endif + +# ifndef _NOMPI +#if HAVE_FLEXPATH + ASSIGN_FNS(flexpath, ADIOS_READ_METHOD_FLEXPATH); +#endif +#endif + +#if HAVE_ICEE + ASSIGN_FNS(icee, ADIOS_READ_METHOD_ICEE); +#endif + +#if HAVE_PHDF5 + //ASSIGN_FNS(hdf5,ADIOS_READ_METHOD_HDF5) +#endif + +#if HAVE_NSSI + //ASSIGN_FNS(nssi,ADIOS_READ_METHOD_NSSI) +#endif + +#if HAVE_DATATAP + ASSIGN_FNS(datatap,ADIOS_READ_METHOD_DATATAP) +#endif + + //printf("%s: adios_read_hooks = %x\n",__func__,*t); + did_init = 1; + } + +} + diff --git a/tests/libs/adios/src/core/adios_read_hooks.h b/tests/libs/adios/src/core/adios_read_hooks.h new file mode 100644 index 0000000000..14a2900f2f --- /dev/null +++ b/tests/libs/adios/src/core/adios_read_hooks.h @@ -0,0 +1,130 @@ +/* + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + */ + +#ifndef ADIOS_READ_HOOKS_H +#define ADIOS_READ_HOOKS_H + +#include "config.h" +#include +#include +#include "public/adios_read_v2.h" +#include "core/transforms/adios_transforms_transinfo.h" // NCSU ALACRITY-ADIOS +#include "core/util.h" // PairStruct* + +#define FORWARD_DECLARE(a) \ +int adios_read_##a##_init_method (MPI_Comm comm, PairStruct *params); \ +int adios_read_##a##_finalize_method (); \ +ADIOS_FILE * adios_read_##a##_open (const char * fname, MPI_Comm comm, enum ADIOS_LOCKMODE lock_mode, float timeout_sec); \ +ADIOS_FILE * adios_read_##a##_open_file (const char * fname, MPI_Comm comm); \ +int adios_read_##a##_close (ADIOS_FILE *fp); \ +int adios_read_##a##_advance_step (ADIOS_FILE *fp, int last, float timeout_sec); \ +void adios_read_##a##_release_step (ADIOS_FILE *fp); \ +ADIOS_VARINFO * adios_read_##a##_inq_var_byid (const ADIOS_FILE *gp, int varid); \ +int adios_read_##a##_inq_var_stat (const ADIOS_FILE *fp, ADIOS_VARINFO * varinfo, int per_step_stat, int per_block_stat); \ +int adios_read_##a##_inq_var_blockinfo (const ADIOS_FILE *fp, ADIOS_VARINFO * varinfo); \ +int adios_read_##a##_schedule_read_byid (const ADIOS_FILE * fp, const ADIOS_SELECTION * sel, int varid, int from_steps, int nsteps, void * data) ; \ +int adios_read_##a##_perform_reads (const ADIOS_FILE *fp, int blocking); \ +int adios_read_##a##_check_reads (const ADIOS_FILE * fp, ADIOS_VARCHUNK ** chunk); \ +int adios_read_##a##_get_attr_byid (const ADIOS_FILE * fp, int attrid, enum ADIOS_DATATYPES * type, int * size, void ** data); \ +int adios_read_##a##_get_dimension_order (const ADIOS_FILE *fp); \ +void adios_read_##a##_reset_dimension_order (const ADIOS_FILE *fp, int is_fortran); \ +void adios_read_##a##_get_groupinfo (const ADIOS_FILE *fp, int *ngroups, char ***group_namelist, uint32_t **nvars_per_group, uint32_t **nattrs_per_group); \ +int adios_read_##a##_is_var_timed (const ADIOS_FILE *fp, int varid); \ +/* NCSU ALACRITY-ADIOS */ \ +ADIOS_TRANSINFO * adios_read_##a##_inq_var_transinfo(const ADIOS_FILE *gp, const ADIOS_VARINFO *vi); \ +int adios_read_##a##_inq_var_trans_blockinfo(const ADIOS_FILE *gp, const ADIOS_VARINFO *vi, ADIOS_TRANSINFO *ti); + +////////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////////// +//// SETUP YOUR NEW READ METHODS BELOW (FOLLOW THE PATTERN): //// +//// 1. Add an entry to the adios_read.h/ADIOS_READ_METHOD //// +//// 2. Update the ADIOS_METHOD_COUNT //// +//// 2. Add a FOWARD_DECLARE line (assuming standard naming) //// +////////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////////// + +#define ADIOS_READ_METHOD_COUNT 9 + +// forward declare the functions (or dummies for internals use) +FORWARD_DECLARE(bp) +FORWARD_DECLARE(bp_staged) +FORWARD_DECLARE(bp_staged1) +#if HAVE_DATASPACES +FORWARD_DECLARE(dataspaces) +#endif +#if HAVE_FLEXPATH +FORWARD_DECLARE(flexpath) +#endif +#if HAVE_ICEE +FORWARD_DECLARE(icee) +#endif +#if HAVE_DIMES +FORWARD_DECLARE(dimes) +#endif +#if HAVE_NSSI +FORWARD_DECLARE(nssi) +#endif +#if HAVE_DATATAP +FORWARD_DECLARE(datatap) +#endif +//FORWARD_DECLARE(hdf5) + + +typedef int (* ADIOS_READ_INIT_METHOD_FN) (MPI_Comm comm, PairStruct * params); +typedef int (* ADIOS_READ_FINALIZE_METHOD_FN) (); +typedef ADIOS_FILE * (* ADIOS_READ_OPEN_FN) (const char * fname, MPI_Comm comm, + enum ADIOS_LOCKMODE lock_mode, float timeout_sec); +typedef ADIOS_FILE * (* ADIOS_READ_OPEN_FILE_FN) (const char * fname, MPI_Comm comm); +typedef int (* ADIOS_READ_CLOSE_FN) (ADIOS_FILE *fp); +typedef int (* ADIOS_ADVANCE_STEP_FN) (ADIOS_FILE *fp, int last, float timeout_sec); +typedef void (* ADIOS_RELEASE_STEP_FN) (ADIOS_FILE *fp); +typedef ADIOS_VARINFO * (* ADIOS_INQ_VAR_BYID_FN) (const ADIOS_FILE *fp, int varid); +typedef int (* ADIOS_INQ_VAR_STAT_FN) (const ADIOS_FILE *fp, ADIOS_VARINFO *varinfo, + int per_step_stat, int per_block_stat); +typedef int (* ADIOS_INQ_VAR_BLOCKINFO_FN) (const ADIOS_FILE *fp, ADIOS_VARINFO *varinfo); +typedef int (* ADIOS_SCHEDULE_READ_BYID_FN) (const ADIOS_FILE * fp, const ADIOS_SELECTION * sel, + int varid, int from_steps, int nsteps, void * data); +typedef int (* ADIOS_PERFORM_READS_FN) (const ADIOS_FILE *fp, int blocking); +typedef int (* ADIOS_CHECK_READS_FN) (const ADIOS_FILE * fp, ADIOS_VARCHUNK ** chunk); +typedef int (* ADIOS_GET_ATTR_BYID_FN) (const ADIOS_FILE * fp, int attrid, + enum ADIOS_DATATYPES * type, int * size, void ** data); +typedef int (* ADIOS_GET_DIMENSION_ORDER_FN) (const ADIOS_FILE *fp); +typedef void (* ADIOS_RESET_DIMENSION_ORDER_FN) (const ADIOS_FILE *fp, int is_fortran); +typedef void (* ADIOS_GET_GROUPINFO_FN) (const ADIOS_FILE *fp, int *ngroups, char ***group_namelist, uint32_t **nvars_per_group, uint32_t **nattrs_per_group); +typedef int (* ADIOS_IS_VAR_TIMED_FN) (const ADIOS_FILE *fp, int varid); +typedef ADIOS_TRANSINFO * (*ADIOS_READ_INQ_VAR_TRANSINFO)(const ADIOS_FILE *gp, const ADIOS_VARINFO *vi); /* NCSU ALACRITY-ADIOS */ +typedef int (*ADIOS_READ_INQ_VAR_TRANS_BLOCKINFO)(const ADIOS_FILE *gp, const ADIOS_VARINFO *vi, ADIOS_TRANSINFO *ti); /* NCSU ALACRITY-ADIOS */ + +struct adios_read_hooks_struct +{ + char * method_name; + ADIOS_READ_INIT_METHOD_FN adios_read_init_method_fn; + ADIOS_READ_FINALIZE_METHOD_FN adios_read_finalize_method_fn; + ADIOS_READ_OPEN_FN adios_read_open_fn; + ADIOS_READ_OPEN_FILE_FN adios_read_open_file_fn; + ADIOS_READ_CLOSE_FN adios_read_close_fn; + ADIOS_ADVANCE_STEP_FN adios_advance_step_fn; + ADIOS_RELEASE_STEP_FN adios_release_step_fn; + ADIOS_INQ_VAR_BYID_FN adios_inq_var_byid_fn; + ADIOS_INQ_VAR_STAT_FN adios_inq_var_stat_fn; + ADIOS_INQ_VAR_BLOCKINFO_FN adios_inq_var_blockinfo_fn; + ADIOS_SCHEDULE_READ_BYID_FN adios_schedule_read_byid_fn; + ADIOS_PERFORM_READS_FN adios_perform_reads_fn; + ADIOS_CHECK_READS_FN adios_check_reads_fn; + ADIOS_GET_ATTR_BYID_FN adios_get_attr_byid_fn; + ADIOS_GET_DIMENSION_ORDER_FN adios_get_dimension_order_fn; + ADIOS_RESET_DIMENSION_ORDER_FN adios_reset_dimension_order_fn; + ADIOS_GET_GROUPINFO_FN adios_get_groupinfo_fn; + ADIOS_IS_VAR_TIMED_FN adios_is_var_timed_fn; + ADIOS_READ_INQ_VAR_TRANSINFO adios_inq_var_transinfo_fn; + ADIOS_READ_INQ_VAR_TRANS_BLOCKINFO adios_inq_var_trans_blockinfo_fn; +}; + +void adios_read_hooks_init (struct adios_read_hooks_struct ** t); + +#undef FORWARD_DECLARE +#endif diff --git a/tests/libs/adios/src/core/adios_read_v1.c b/tests/libs/adios/src/core/adios_read_v1.c new file mode 100644 index 0000000000..3e861c6db0 --- /dev/null +++ b/tests/libs/adios/src/core/adios_read_v1.c @@ -0,0 +1,843 @@ +/* + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + */ + +#include +#include +#include + +#include "adios_read_v1.h" + +#undef ADIOS_FILE +#undef ADIOS_GROUP +#undef ADIOS_VARINFO +#undef ADIOS_HIST +#undef ADIOS_VARBLOCK + +#undef ADIOS_READ_METHOD +#undef ADIOS_READ_METHOD_BP +#undef ADIOS_READ_METHOD_BP_STAGED +#undef ADIOS_READ_METHOD_BP_AGGREGATE +#undef ADIOS_READ_METHOD_HDF5 +#undef ADIOS_READ_METHOD_DART +#undef ADIOS_READ_METHOD_DIMES +#undef ADIOS_READ_METHOD_NSSI +#undef ADIOS_READ_METHOD_DATATAP +#undef ADIOS_READ_METHOD_BP_STAGED1 + +#undef adios_set_read_method +#undef adios_fopen +#undef adios_fclose +#undef adios_reset_dimension_order +#undef adios_gopen +#undef adios_gopen_byid +#undef adios_gclose +#undef adios_inq_var +#undef adios_inq_var_byid +#undef adios_stat_cor +#undef adios_stat_cov +#undef adios_free_varinfo +#undef adios_read_var +#undef adios_read_var_byid +#undef adios_read_local_var +#undef adios_get_attr +#undef adios_get_attr_byid +#undef adios_type_to_string +#undef adios_type_size +#undef adios_print_groupinfo +#undef adios_print_fileinfo + + +#include "core/common_read.h" + + +#include "adios_error.h" +#include "core/bp_utils.h" +#define BYTE_ALIGN 8 + +static enum ADIOS_READ_METHOD lastmethod = ADIOS_READ_METHOD_BP; + +/* +const char *adios_errmsg () +{ + return adios_get_last_errmsg(); +} +*/ + + +int adios_set_read_method_v1 (enum ADIOS_READ_METHOD_V1 method) +{ + switch (method) { + case ADIOS_READ_METHOD_BP_V1: + lastmethod = ADIOS_READ_METHOD_BP; + break; + case ADIOS_READ_METHOD_BP_STAGED_V1: + lastmethod = ADIOS_READ_METHOD_BP_AGGREGATE; + break; + case ADIOS_READ_METHOD_BP_STAGED1_V1: + lastmethod = ADIOS_READ_METHOD_BP_AGGREGATE; + break; + case ADIOS_READ_METHOD_DART_V1: + lastmethod = ADIOS_READ_METHOD_DATASPACES; + break; + case ADIOS_READ_METHOD_DIMES_V1: + lastmethod = ADIOS_READ_METHOD_DIMES; + break; + + /* Unsupported methods */ + case ADIOS_READ_METHOD_HDF5_V1: + case ADIOS_READ_METHOD_NSSI_V1: + case ADIOS_READ_METHOD_DATATAP_V1: + default: + lastmethod = ADIOS_READ_METHOD_BP; + break; + } + return 0; +} + + +int adios_read_init_v1(MPI_Comm comm) +{ + return common_read_init_method (lastmethod, comm, NULL); +} + + +int adios_read_finalize_v1() +{ + return common_read_finalize_method (lastmethod); +} + +ADIOS_FILE_V1 * adios_fopen_v1 (const char * fname, MPI_Comm comm) +{ + ADIOS_FILE_V1 *fp1 = NULL; + ADIOS_FILE *fp = common_read_open_file (fname, lastmethod, comm); + if (fp) { + fp1 = (ADIOS_FILE_V1 *) malloc (sizeof(ADIOS_FILE_V1)); + if (fp1) { + fp1->fh = fp->fh; + fp1->vars_count = fp->nvars; + fp1->attrs_count = fp->nattrs; + fp1->tidx_start = 1; + fp1->ntimesteps = fp->last_step; + fp1->version = fp->version; + fp1->file_size = fp->file_size; + fp1->endianness = fp->endianness; + + /* FIX: no groups in new version, extra function should support this */ + fp1->groups_count = common_read_get_grouplist(fp, &fp1->group_namelist); + + fp1->internal_data = fp; + } else { + adios_error ( err_no_memory, "Cannot allocate memory for file info.\n"); + } + } + return fp1; +} + +int adios_fclose_v1 (ADIOS_FILE_V1 *fp) +{ + return common_read_close ((ADIOS_FILE*)fp->internal_data); +} + +ADIOS_GROUP_V1 * adios_gopen_v1 (ADIOS_FILE_V1 *fp, const char * grpname) +{ + int grpid; + adios_errno = 0; + for (grpid=0;grpid<(fp->groups_count);grpid++) { + if (!strcmp(fp->group_namelist[grpid], grpname)) + break; + } + if (grpid >= fp->groups_count) { + adios_error ( err_invalid_group, "Invalid group name %s\n", grpname); + return NULL; + } + return adios_gopen_byid_v1 (fp, grpid); +} + +ADIOS_GROUP_V1 * adios_gopen_byid_v1 (ADIOS_FILE_V1 *fp, int grpid) +{ + ADIOS_GROUP_V1 * gp = NULL; + + adios_errno = 0; + if (grpid < 0 || grpid >= fp->groups_count) { + adios_error ( err_invalid_group, "Invalid group index %d\n", grpid); + return NULL; + } + + gp = (ADIOS_GROUP_V1 *) malloc(sizeof(ADIOS_GROUP_V1)); + if (!gp) { + adios_error ( err_no_memory, "Could not allocate memory for group info\n"); + return NULL; + } + + ADIOS_FILE *f = (ADIOS_FILE*)fp->internal_data; + common_read_group_view (f, grpid); + + gp->grpid = grpid; + gp->gh = (uint64_t) f; + gp->fp = fp; + gp->vars_count = f->nvars; + gp->attrs_count = f->nattrs; + gp->var_namelist = f->var_namelist; + gp->attr_namelist = f->attr_namelist; + + return gp; +} + +int adios_gclose_v1 (ADIOS_GROUP_V1 *gp) +{ + ADIOS_FILE *f = (ADIOS_FILE*) gp->gh; + //free_namelist ((gp->var_namelist),gp->vars_count); + //free_namelist ((gp->attr_namelist),gp->attrs_count); + gp->var_namelist = NULL; + gp->attr_namelist = NULL; + gp->vars_count = 0; + gp->attrs_count = 0; + free (gp); + common_read_group_view (f, -1); + return 0; +} + + +int adios_get_attr_v1 (ADIOS_GROUP_V1 * gp, const char * attrname, enum ADIOS_DATATYPES * type, + int * size, void ** data) +{ + return common_read_get_attr ((ADIOS_FILE*)gp->fp->internal_data, attrname, type, size, data); +} + +int adios_get_attr_byid_v1 (ADIOS_GROUP_V1 * gp, int attrid, + enum ADIOS_DATATYPES * type, int * size, void ** data) +{ + return common_read_get_attr_byid ((ADIOS_FILE*)gp->fp->internal_data, attrid, type, size, data); +} + +static ADIOS_VARINFO_V1 * adios_varinfo_to_v1 (ADIOS_GROUP_V1 *gp, ADIOS_VARINFO *vi, int getstat) +{ + ADIOS_VARINFO_V1 * v = 0; + if (vi) { + v = (ADIOS_VARINFO_V1 *) malloc (sizeof(ADIOS_VARINFO_V1)); + + v->grpid = 0; + v->varid = vi->varid; + v->type = vi->type; + v->value = vi->value; + + /* TIME dimension should be emulated here !!! */ + if (vi->nsteps > 1) { + v->ndim = vi->ndim + 1; + v->timedim = 0; + } else { + v->ndim = vi->ndim; + v->timedim = -1; + } + int tidx = 0, i; + v->dims = (uint64_t *) malloc (sizeof(uint64_t) * (v->ndim)); + if (vi->nsteps > 1) { + v->dims[0] = vi->nsteps; + tidx=1; + } + for (i=0; indim; i++) + v->dims[i+tidx] = vi->dims[i]; + + + ADIOS_VARSTAT * stat = NULL; + if (getstat) { + common_read_inq_var_stat ((ADIOS_FILE *)gp->fp->internal_data, + vi, 1, 0); + stat = vi->statistics; + } + + if (stat) { + v->characteristics_count=0;// = stat->characteristics_count; FIXME + v->gmin = stat->min; + v->gmax = stat->max; + v->gavg = stat->avg; + v->gstd_dev = stat->std_dev; + if (stat->histogram) { + v->mins = stat->steps->mins; + v->maxs = stat->steps->maxs; + v->avgs = stat->steps->avgs; + v->std_devs = stat->steps->std_devs; + } else { + v->mins = 0; + v->maxs = 0; + v->avgs = 0; + v->std_devs = 0; + } + if (stat->histogram) { + v->hist = (struct ADIOS_HIST_V1*) malloc (sizeof(struct ADIOS_HIST)); + if (v->hist) { + v->hist->num_breaks = stat->histogram->num_breaks; + v->hist->max = stat->histogram->max; + v->hist->min = stat->histogram->min; + v->hist->breaks = stat->histogram->breaks; + v->hist->frequenciess = stat->histogram->frequencies; + v->hist->gfrequencies = stat->histogram->gfrequencies; + } + } else { + v->hist=0; + } + } + + v->internal_data = (void *)vi; + } + return v; +} + +ADIOS_VARINFO_V1 * adios_inq_var_v1 (ADIOS_GROUP_V1 *gp, const char * varname) +{ + ADIOS_VARINFO * vi = common_read_inq_var ((ADIOS_FILE*)gp->fp->internal_data, varname); + return adios_varinfo_to_v1 (gp, vi, 1); +} + +ADIOS_VARINFO_V1 * adios_inq_var_byid_v1 (ADIOS_GROUP_V1 *gp, int varid) +{ + ADIOS_VARINFO * vi = common_read_inq_var_byid ((ADIOS_FILE*)gp->fp->internal_data, varid); + return adios_varinfo_to_v1 (gp, vi, 1); +} + +void adios_free_varinfo_v1 (ADIOS_VARINFO_V1 *vp) +{ + /* Should free up ADIOS_VARINFO_V1 and ADIOS_VARINFO too!!! */ + common_read_free_varinfo ((ADIOS_VARINFO*)vp->internal_data); + free(vp); +} + +int64_t adios_read_var_v1 (ADIOS_GROUP_V1 * gp, const char * varname, + const uint64_t * start, const uint64_t * count, + void * data) +{ + ADIOS_FILE *f = (ADIOS_FILE*)gp->fp->internal_data; + + /* variable name -> varid */ + ADIOS_VARINFO * vi = common_read_inq_var (f, varname); + if (!vi) + return adios_errno; + + return adios_read_var_byid_v1 (gp, vi->varid, start, count, data); + +} + +int64_t adios_read_var_byid_v1 (ADIOS_GROUP_V1 * gp, + int varid, + const uint64_t * start, + const uint64_t * count, + void * data) +{ + ADIOS_FILE *f = (ADIOS_FILE*)gp->fp->internal_data; + + /* First get the number of dimensions of the variable */ + ADIOS_VARINFO * vi = common_read_inq_var_byid (f, varid); + if (!vi) + return adios_errno; + ADIOS_VARINFO_V1 * v = adios_varinfo_to_v1 (gp, vi, 0); // fixes time + + int ndim = v->ndim; + int tidx = 0; + int from_step = 0; + int nsteps = 1; + if (v->timedim == 0) { + /* has time dimension, translate to new query */ + ndim--; + tidx = 1; + from_step = (int) start[0]; + nsteps = (int) count[0]; + } + + ADIOS_SELECTION * sel = adios_selection_boundingbox (ndim, start+tidx, count+tidx); + + common_read_schedule_read_byid (f, sel, varid, from_step, nsteps, NULL, data); // NCSU ALACRITY-ADIOS + int ret = common_read_perform_reads (f, 1); + int64_t rbytes; + if (ret == err_no_error) { + /* should return the number of bytes read */ + rbytes = (int64_t) common_read_type_size (vi->type, data); + int i; + for (i=0; indim; i++) + rbytes *= (int64_t) count[i]; + } else { + rbytes = (int64_t) adios_errno; + } + + adios_free_varinfo_v1(v); + adios_selection_delete(sel); + return rbytes; +} + +int64_t adios_read_local_var_v1 (ADIOS_GROUP_V1 * gp, + const char * varname, + int idx, + const uint64_t * start, + const uint64_t * count, + void * data) +{ + ADIOS_FILE *f = (ADIOS_FILE*)gp->fp->internal_data; + int i; + + /* The new API does not support reading write block with subselection. + Only complete blocks can be read. + Here we check if the passed selection equals the whole block. + Otherwise we return an out of bound error, although it probably should + be a "within bounds" error + + Version 1: + - start/count has no time dimension for the local read + - idx is for all timesteps, 0...timesteps*blocks + Version 2: + - idx is from 0..blocks for each timestep + - need to say which timestep + */ + + /* First get the number of dimensions of the variable */ + ADIOS_VARINFO * vi = common_read_inq_var (f, varname); + if (!vi) + return adios_errno; + + /* get step from the idx, and check validity of idx */ + int step = 0; + int idx_in_step = idx; + step = 0; + while (step < vi->nsteps && idx_in_step >= vi->nblocks[step]) { + idx_in_step -= vi->nblocks[step]; + step++; + } + if (step == vi->nsteps) { + adios_error (err_out_of_bound, "ADIOS ERROR: local " + "variable %s has only %d blocks in file. " + "Requested index %d\n", varname, vi->sum_nblocks, idx); + return adios_errno; + } + common_read_inq_var_blockinfo (f, vi); // get info on each block + + /* check dimensions */ + for (i=0; indim; i++) { + if (start[i] != 0 || count[i] != vi->blockinfo[idx].count[i]) { + adios_error (err_out_of_bound, "ADIOS ERROR: when reading a local " + "variable, only the whole block can be requested; subselections " + "are not allowed. Variable %s, block %d, dimension %d size is %lld, " + "requested %lld from offset %lld\n", + varname, idx, vi->blockinfo[idx].count[i], count[i], start[i]); + return adios_errno; + } + } + + ADIOS_SELECTION * sel = adios_selection_writeblock (idx_in_step); + + common_read_schedule_read_byid (f, sel, vi->varid, step, 1, NULL, data); // NCSU ALACRITY-ADIOS + int ret = common_read_perform_reads (f, 1); + int64_t rbytes; + if (ret == err_no_error) { + /* should return the number of bytes read */ + rbytes = (int64_t) common_read_type_size (vi->type, data); + for (i=0; indim; i++) + rbytes *= (int64_t) count[i]; + } else { + rbytes = (int64_t) adios_errno; + } + + common_read_free_varinfo(vi); + adios_selection_delete(sel); + return rbytes; +} + +const char * adios_type_to_string_v1 (enum ADIOS_DATATYPES type) +{ + return common_read_type_to_string (type); +} + +int adios_type_size_v1(enum ADIOS_DATATYPES type, void *data) +{ + return common_read_type_size(type, data); +} + + +void adios_print_groupinfo (ADIOS_GROUP_V1 *gp) +{ + ADIOS_FILE *f = (ADIOS_FILE*)gp->fp->internal_data; + common_read_print_fileinfo(f); +} + + +void adios_print_fileinfo_v1 (ADIOS_FILE_V1 *fp) +{ + ADIOS_FILE *f = (ADIOS_FILE*)fp->internal_data; + common_read_print_fileinfo(f); +} + + +#include + +// NCSU - Timer series analysis, correlation +double adios_stat_cor_v1 (ADIOS_VARINFO_V1 * vix, ADIOS_VARINFO_V1 * viy, char * characteristic, uint32_t time_start, uint32_t time_end, uint32_t lag) +{ + int i; + + double avg_x = 0.0, avg_y = 0.0, avg_lag = 0.0; + double var_x = 0.0, var_y = 0.0, var_lag = 0.0; + double cov = 0; + + if (vix == NULL) + { + adios_error(err_invalid_argument, "Variable not defined\n"); + return 0; + } + + // If the vix and viy are not time series objects, return. + if ((vix->timedim < 0) && (viy->timedim < 0)) + { + adios_error(err_invalid_argument, "Covariance must involve timeseries data\n"); + return 0; + } + + uint32_t min = vix->dims[0] - 1; + if (viy && (min > viy->dims[0] - 1)) + min = viy->dims[0] - 1; + + if(time_start == 0 && time_end == 0) + { //global covariance + if(viy == NULL) { + adios_error(err_invalid_argument, "Must have two variables for global covariance\n"); + return 0; + } + + // Assign vix to viy, and calculate covariance + viy = vix; + time_start = 0; + time_end = min; + } + // Check the bounds of time + if ( (time_start >= 0) && (time_start <= min) + && (time_end >= 0) && (time_end <= min) + && (time_start <= time_end)) + { + if(viy == NULL) //user must want to run covariance against itself + { + if(! (time_end+lag) > min) + { + adios_error(err_invalid_timestep, "Must leave enough timesteps for lag\n"); + return 0; + } + + if (strcmp(characteristic, "average") == 0 || strcmp(characteristic, "avg") == 0) + { + for (i = time_start; i <= time_end; i ++) + { + avg_x += bp_value_to_double (adios_double, vix->avgs[i]) / (time_end - time_start + 1); + avg_lag += bp_value_to_double (adios_double, vix->avgs[i + lag]) / (time_end - time_start + 1); + } + + for (i = time_start; i <= time_end; i ++) + { + double val_x = bp_value_to_double (adios_double, vix->avgs[i]); + double val_lag = bp_value_to_double (adios_double, vix->avgs[i + lag]); + var_x += (val_x - avg_x) * (val_x - avg_x) / (time_end - time_start + 1); + var_lag += (val_lag - avg_lag) * (val_lag - avg_lag) / (time_end - time_start + 1); + cov += (val_x - avg_x) * (val_lag - avg_lag) / (time_end - time_start + 1); + } + } + else if (strcmp(characteristic, "standard deviation") == 0 || strcmp(characteristic, "std_dev") == 0) + { + for (i = time_start; i <= time_end; i ++) + { + avg_x += bp_value_to_double (adios_double, vix->std_devs[i]) / (time_end - time_start + 1); + avg_lag += bp_value_to_double (adios_double, vix->std_devs[i + lag]) / (time_end - time_start + 1); + } + + for (i = time_start; i <= time_end; i ++) + { + double val_x = bp_value_to_double (adios_double, vix->std_devs[i]); + double val_lag = bp_value_to_double (adios_double, vix->std_devs[i + lag]); + var_x += (val_x - avg_x) * (val_x - avg_x) / (time_end - time_start + 1); + var_lag += (val_lag - avg_lag) * (val_lag - avg_lag) / (time_end - time_start + 1); + cov += (val_x - avg_x) * (val_lag - avg_lag) / (time_end - time_start + 1); + } + } + else if (strcmp(characteristic, "minimum") == 0 || strcmp(characteristic, "min") == 0) + { + for (i = time_start; i <= time_end; i ++) + { + avg_x += bp_value_to_double (vix->type, vix->mins[i]) / (time_end - time_start + 1); + avg_lag += bp_value_to_double (vix->type, vix->mins[i + lag]) / (time_end - time_start + 1); + } + + for (i = time_start; i <= time_end; i ++) + { + double val_x = bp_value_to_double (vix->type, vix->mins[i]); + double val_lag = bp_value_to_double (vix->type, vix->mins[i + lag]); + var_x += (val_x - avg_x) * (val_x - avg_x) / (time_end - time_start + 1); + var_lag += (val_lag - avg_lag) * (val_lag - avg_lag) / (time_end - time_start + 1); + cov += (val_x - avg_x) * (val_lag - avg_lag) / (time_end - time_start + 1); + } + } + else if (strcmp(characteristic, "maximum") == 0 || strcmp(characteristic, "max") == 0) + { + for (i = time_start; i <= time_end; i ++) + { + avg_x += bp_value_to_double (vix->type, vix->maxs[i]) / (time_end - time_start + 1); + avg_lag += bp_value_to_double (vix->type, vix->maxs[i]) / (time_end - time_start + 1); + } + + for (i = time_start; i <= time_end; i ++) + { + double val_x = bp_value_to_double (vix->type, vix->maxs[i]); + double val_lag = bp_value_to_double (vix->type, vix->maxs[i + lag]); + var_x += (val_x - avg_x) * (val_x - avg_x) / (time_end - time_start + 1); + var_lag += (val_lag - avg_lag) * (val_lag - avg_lag) / (time_end - time_start + 1); + cov += (val_x - avg_x) * (val_lag - avg_lag) / (time_end - time_start + 1); + } + } + else + { + adios_error(err_unknown_char, "Unknown characteristic\n"); + return 0; + } + return cov / (sqrt (var_x) * sqrt (var_lag)); + } + else + { + if (strcmp(characteristic, "average") == 0 || strcmp(characteristic, "avg") == 0) + { + for (i = time_start; i <= time_end; i ++) + { + avg_x += bp_value_to_double(adios_double, vix->avgs[i]) / (time_end - time_start + 1); + avg_y += bp_value_to_double(adios_double, viy->avgs[i]) / (time_end - time_start + 1); + } + for (i = time_start; i <= time_end; i ++) + { + double val_x = bp_value_to_double (adios_double, vix->avgs[i]); + double val_y = bp_value_to_double (adios_double, viy->avgs[i]); + var_x += (val_x - avg_x) * (val_x - avg_x) / (time_end - time_start + 1); + var_y += (val_y - avg_y) * (val_y - avg_y) / (time_end - time_start + 1); + cov += (val_x - avg_x) * (val_y - avg_y) / (time_end - time_start + 1); + } + } + else if (strcmp(characteristic, "standard deviation") == 0 || strcmp(characteristic, "std_dev") == 0) + { + for (i = time_start; i <= time_end; i ++) + { + avg_x += bp_value_to_double(adios_double, vix->std_devs[i]) / (time_end - time_start + 1); + avg_y += bp_value_to_double(adios_double, viy->std_devs[i]) / (time_end - time_start + 1); + } + for (i = time_start; i <= time_end; i ++) + { + double val_x = bp_value_to_double (adios_double, vix->std_devs[i]); + double val_y = bp_value_to_double (adios_double, viy->std_devs[i]); + var_x += (val_x - avg_x) * (val_x - avg_x) / (time_end - time_start + 1); + var_y += (val_y - avg_y) * (val_y - avg_y) / (time_end - time_start + 1); + cov += (val_x - avg_x) * (val_y - avg_y) / (time_end - time_start + 1); + } + } + else if (strcmp(characteristic, "minimum") == 0 || strcmp(characteristic, "min") == 0) + { + for (i = time_start; i <= time_end; i ++) + { + avg_x += bp_value_to_double(vix->type, vix->mins[i]) / (time_end - time_start + 1); + avg_y += bp_value_to_double(viy->type, viy->mins[i]) / (time_end - time_start + 1); + } + for (i = time_start; i <= time_end; i ++) + { + double val_x = bp_value_to_double (vix->type, vix->mins[i]); + double val_y = bp_value_to_double (viy->type, viy->mins[i]); + var_x += (val_x - avg_x) * (val_x - avg_x) / (time_end - time_start + 1); + var_y += (val_y - avg_y) * (val_y - avg_y) / (time_end - time_start + 1); + cov += (val_x - avg_x) * (val_y - avg_y) / (time_end - time_start + 1); + } + } + else if (strcmp(characteristic, "maximum") == 0 || strcmp(characteristic, "max") == 0) + { + for (i = time_start; i <= time_end; i ++) + { + avg_x += bp_value_to_double(vix->type, vix->maxs[i]) / (time_end - time_start + 1); + avg_y += bp_value_to_double(vix->type, viy->maxs[i]) / (time_end - time_start + 1); + } + for (i = time_start; i <= time_end; i ++) + { + double val_x = bp_value_to_double (vix->type, vix->maxs[i]); + double val_y = bp_value_to_double (viy->type, viy->maxs[i]); + var_x += (val_x - avg_x) * (val_x - avg_x) / (time_end - time_start + 1); + var_y += (val_y - avg_y) * (val_y - avg_y) / (time_end - time_start + 1); + cov += (val_x - avg_x) * (val_y - avg_y) / (time_end - time_start + 1); + } + } + else + { + adios_error(err_unknown_char, "Unknown characteristic\n"); + return 0; + } + return cov / (sqrt (var_x) * sqrt (var_y)); + } + } + else + { + adios_error(err_invalid_timestep, "Time values out of bounds\n"); + return 0; + } +} + +// NCSU - Time series analysis, covariance +//covariance(x,y) = sum(i=1,..N) [(x_1 - x_mean)(y_i - y_mean)]/N +double adios_stat_cov_v1 (ADIOS_VARINFO_V1 * vix, ADIOS_VARINFO_V1 * viy, char * characteristic, uint32_t time_start, uint32_t time_end, uint32_t lag) +{ + int i; + + double avg_x = 0.0, avg_y = 0.0, avg_lag = 0.0; + double cov = 0; + + if (vix == NULL) + { + adios_error(err_invalid_argument, "Variable not defined\n"); + return 0; + } + + // If the vix and viy are not time series objects, return. + if ((vix->timedim < 0) && (viy->timedim < 0)) + { + adios_error(err_invalid_argument, "Covariance must involve timeseries data\n"); + return 0; + } + + uint32_t min = vix->dims[0] - 1; + if (viy && (min > viy->dims[0] - 1)) + min = viy->dims[0] - 1; + + if(time_start == 0 && time_end == 0) + { //global covariance + if(viy == NULL) { + adios_error(err_invalid_argument, "Must have two variables for global covariance\n"); + return 0; + } + + // Assign vix to viy, and calculate covariance + viy = vix; + time_start = 0; + time_end = min; + } + // Check the bounds of time + if ( (time_start >= 0) && (time_start <= min) + && (time_end >= 0) && (time_end <= min) + && (time_start <= time_end)) + { + if(viy == NULL) //user must want to run covariance against itself + { + if(! (time_end+lag) > min) + { + adios_error(err_invalid_timestep, "Must leave enough timesteps for lag\n"); + return 0; + } + + if (strcmp(characteristic, "average") == 0 || strcmp(characteristic, "avg") == 0) + { + for (i = time_start; i <= time_end; i ++) + { + avg_x += bp_value_to_double (adios_double, vix->avgs[i]) / (time_end - time_start + 1); + avg_lag += bp_value_to_double (adios_double, vix->avgs[i + lag]) / (time_end - time_start + 1); + } + + for (i = time_start; i <= time_end; i ++) + cov += (bp_value_to_double (adios_double, vix->avgs[i]) - avg_x) * (bp_value_to_double (adios_double, vix->avgs[i+lag]) - avg_lag) / (time_end - time_start + 1); + } + else if (strcmp(characteristic, "standard deviation") == 0 || strcmp(characteristic, "std_dev") == 0) + { + for (i = time_start; i <= time_end; i ++) + { + avg_x += bp_value_to_double (adios_double, vix->std_devs[i]) / (time_end - time_start + 1); + avg_lag += bp_value_to_double (adios_double, vix->std_devs[i + lag]) / (time_end - time_start + 1); + } + + for (i = time_start; i <= time_end; i ++) + cov += (bp_value_to_double (adios_double, vix->std_devs[i]) - avg_x) * (bp_value_to_double (adios_double, vix->std_devs[i+lag]) - avg_lag) / (time_end - time_start + 1); + } + else if (strcmp(characteristic, "minimum") == 0 || strcmp(characteristic, "min") == 0) + { + for (i = time_start; i <= time_end; i ++) + { + avg_x += bp_value_to_double (vix->type, vix->mins[i]) / (time_end - time_start + 1); + avg_lag += bp_value_to_double (vix->type, vix->mins[i + lag]) / (time_end - time_start + 1); + } + + for (i = time_start; i <= time_end; i ++) + cov += (bp_value_to_double (vix->type, vix->mins[i]) - avg_x) * (bp_value_to_double (vix->type, vix->mins[i+lag]) - avg_lag) / (time_end - time_start + 1); + } + else if (strcmp(characteristic, "maximum") == 0 || strcmp(characteristic, "max") == 0) + { + for (i = time_start; i <= time_end; i ++) + { + avg_x += bp_value_to_double (vix->type, vix->maxs[i]) / (time_end - time_start + 1); + avg_lag += bp_value_to_double (vix->type, vix->maxs[i + lag]) / (time_end - time_start + 1); + } + + for (i = time_start; i <= time_end; i ++) + cov += (bp_value_to_double (vix->type, vix->maxs[i]) - avg_x) * (bp_value_to_double (vix->type, vix->maxs[i+lag]) - avg_lag) / (time_end - time_start + 1); + } + else + { + adios_error(err_unknown_char, "Unknown characteristic\n"); + return 0; + } + } + else + { + if (strcmp(characteristic, "average") == 0 || strcmp(characteristic, "avg") == 0) + { + for (i = time_start; i <= time_end; i ++) + { + avg_x += bp_value_to_double(adios_double, vix->avgs[i]) / (time_end - time_start + 1); + avg_y += bp_value_to_double(adios_double, viy->avgs[i]) / (time_end - time_start + 1); + } + for (i = time_start; i <= time_end; i ++) + { + cov += (bp_value_to_double(adios_double, vix->avgs[i]) - avg_x) * (bp_value_to_double(adios_double, viy->avgs[i]) - avg_y) / (time_end - time_start + 1); + } + } + else if (strcmp(characteristic, "standard deviation") == 0 || strcmp(characteristic, "std_dev") == 0) + { + for (i = time_start; i <= time_end; i ++) + { + avg_x += bp_value_to_double(adios_double, vix->std_devs[i]) / (time_end - time_start + 1); + avg_y += bp_value_to_double(adios_double, viy->std_devs[i]) / (time_end - time_start + 1); + } + for (i = time_start; i <= time_end; i ++) + { + cov += (bp_value_to_double(adios_double, vix->std_devs[i]) - avg_x) * (bp_value_to_double(adios_double, viy->std_devs[i]) - avg_y) / (time_end - time_start + 1); + } + } + else if (strcmp(characteristic, "minimum") == 0 || strcmp(characteristic, "min") == 0) + { + for (i = time_start; i <= time_end; i ++) + { + avg_x += bp_value_to_double(vix->type, vix->mins[i]) / (time_end - time_start + 1); + avg_y += bp_value_to_double(viy->type, viy->mins[i]) / (time_end - time_start + 1); + } + for (i = time_start; i <= time_end; i ++) + { + cov += (bp_value_to_double(vix->type, vix->mins[i]) - avg_x) * (bp_value_to_double(viy->type, viy->mins[i]) - avg_y) / (time_end - time_start + 1); + } + } + else if (strcmp(characteristic, "maximum") == 0 || strcmp(characteristic, "max") == 0) + { + for (i = time_start; i <= time_end; i ++) + { + avg_x += bp_value_to_double(vix->type, vix->maxs[i]) / (time_end - time_start + 1); + avg_y += bp_value_to_double(vix->type, viy->maxs[i]) / (time_end - time_start + 1); + } + for (i = time_start; i <= time_end; i ++) + { + cov += (bp_value_to_double(vix->type, vix->maxs[i]) - avg_x) * (bp_value_to_double(viy->type, viy->maxs[i]) - avg_y) / (time_end - time_start + 1); + } + } + else + { + adios_error(err_unknown_char, "Unknown characteristic\n"); + return 0; + } + } + } + else + { + adios_error(err_invalid_timestep, "Time values out of bounds\n"); + } + return cov; +} diff --git a/tests/libs/adios/src/core/adios_selection_util.c b/tests/libs/adios/src/core/adios_selection_util.c new file mode 100644 index 0000000000..9ef68aaf0c --- /dev/null +++ b/tests/libs/adios/src/core/adios_selection_util.c @@ -0,0 +1,340 @@ +/* + * adios_selection_util.c + * + * Created on: Jan 5, 2013 + * Author: David A. Boyuka II + */ + +#include +#include +#include +#include + +#include "adios_error.h" +#include "adios_selection.h" +#include "adios_subvolume.h" +#include "adios_selection_util.h" +#include "common_read.h" + +// +// NOTE: Intersection type guarantees: +// * The intersection of any two selections of the same type returns a third selection of that +// same type +// * BB + PTS -> PTS +// + +// +// One-on-one global intersection functions +// +ADIOS_SELECTION * adios_selection_intersect_bb_bb(const ADIOS_SELECTION_BOUNDINGBOX_STRUCT *bb1, + const ADIOS_SELECTION_BOUNDINGBOX_STRUCT *bb2) { + const int ndim = bb1->ndim; + uint64_t *new_start = malloc(ndim * sizeof(uint64_t)); + uint64_t *new_count = malloc(ndim * sizeof(uint64_t)); + + assert(bb1->ndim == bb2->ndim); + if (!new_start || !new_count) { + adios_error(err_no_memory, "Cannot allocate memory for BOUNDINGBOX-BOUNDINGBOX selection intersection"); + return NULL; + } + + if (intersect_bb(bb1, bb2, new_start, NULL, NULL, new_count)) { + return common_read_selection_boundingbox(ndim, new_start, new_count); + } else { + free(new_start); + free(new_count); + return NULL; + } +} + +ADIOS_SELECTION * adios_selection_intersect_bb_pts(const ADIOS_SELECTION_BOUNDINGBOX_STRUCT *bb1, + const ADIOS_SELECTION_POINTS_STRUCT *pts2) { + const int ndim = bb1->ndim; + const uint64_t max_new_npts = pts2->npoints; + + uint64_t *new_pts = malloc(max_new_npts * ndim * sizeof(uint64_t)); + int j; + uint64_t *new_pts_ptr = new_pts; + uint64_t *pts2_ptr; + const uint64_t * const pts2_end_ptr = pts2->points + pts2->npoints * ndim; + uint64_t new_npts = 0; + + assert(bb1->ndim == pts2->ndim); + if (!new_pts) { + adios_error(err_no_memory, "Cannot allocate memory for BOUNDINGBOX-POINTS selection intersection"); + return NULL; + } + + // Check every pair of points for equality; whenever a shared point is found, output + // it into the new point list + for (pts2_ptr = pts2->points; pts2_ptr < pts2_end_ptr; pts2_ptr += ndim) { + // Check each dimension component of the point for containment in the bounding box + for (j = 0; j < ndim; j++) + if (pts2_ptr[j] < bb1->start[j] || + pts2_ptr[j] >= bb1->start[j] + bb1->count[j]) + break; + + // Check whether any component was out of bounds; if so, skip this point; otherwise, + // output the point + if (j != ndim) { + continue; + } else { + memcpy(new_pts_ptr, pts2_ptr, ndim * sizeof(uint64_t)); + new_pts_ptr += ndim; + new_npts++; + } + } + + if (new_npts == 0) { + free(new_pts); + return NULL; + } else { + new_pts = (uint64_t*)realloc(new_pts, new_npts * ndim * sizeof(uint64_t)); + return common_read_selection_points(ndim, new_npts, new_pts); + } +} + +ADIOS_SELECTION * adios_selection_intersect_pts_pts(const ADIOS_SELECTION_POINTS_STRUCT *pts1, + const ADIOS_SELECTION_POINTS_STRUCT *pts2) { + const int ndim = pts1->ndim; + const uint64_t max_new_npts = pts1->npoints > pts2->npoints ? pts1->npoints : pts2->npoints; + + uint64_t *new_pts = malloc(max_new_npts * ndim * sizeof(uint64_t)); + int k; + uint64_t *new_pts_ptr = new_pts; + uint64_t *pts1_ptr, *pts2_ptr; + const uint64_t * const pts1_end_ptr = pts1->points + pts1->npoints * ndim; + const uint64_t * const pts2_end_ptr = pts2->points + pts2->npoints * ndim; + uint64_t new_npts = 0; + + assert(pts1->ndim == pts2->ndim); + if (!new_pts) { + adios_error(err_no_memory, "Cannot allocate memory for POINTS-POINTS selection intersection"); + return NULL; + } + + // Check every pair of points for equality; whenever a shared point is found, output + // it into the new point list + for (pts1_ptr = pts1->points; pts1_ptr < pts1_end_ptr; pts1_ptr += ndim) { + for (pts2_ptr = pts2->points; pts2_ptr < pts2_end_ptr; pts2_ptr += ndim) { + // Check each dimension component of the pair of points for equality + for (k = 0; k < ndim; k++) + if (pts1_ptr[k] != pts2_ptr[k]) + break; + + // Check whether any component was unequal; if so, skip this pair; otherwise, + // output the shared point + if (k != ndim) { + continue; + } else { + memcpy(new_pts_ptr, pts1_ptr, ndim * sizeof(uint64_t)); + new_pts_ptr += ndim; + new_npts++; + } + } + } + + if (new_npts == 0) { + free(new_pts); + return NULL; + } else { + new_pts = (uint64_t*)realloc(new_pts, new_npts * sizeof(uint64_t)); + return common_read_selection_points(ndim, new_npts, new_pts); + } +} + +// +// One-on-any global intersection functions +// + +// s2 can be selection type +inline static ADIOS_SELECTION * adios_selection_intersect_bb(const ADIOS_SELECTION_BOUNDINGBOX_STRUCT *bb1, + const ADIOS_SELECTION *s2) { + switch (s2->type) { + case ADIOS_SELECTION_BOUNDINGBOX: + { + const ADIOS_SELECTION_BOUNDINGBOX_STRUCT *bb2 = &s2->u.bb; + return adios_selection_intersect_bb_bb(bb1, bb2); + } + case ADIOS_SELECTION_POINTS: + { + const ADIOS_SELECTION_POINTS_STRUCT *pts2 = &s2->u.points; + return adios_selection_intersect_bb_pts(bb1, pts2); + } + default: + adios_error_at_line(err_invalid_argument, __FILE__, __LINE__, "Unknown selection type %d", s2->type); + return NULL; + } +} + +// s2 can be any selection type except boundingbox +inline static ADIOS_SELECTION * adios_selection_intersect_pts(const ADIOS_SELECTION_POINTS_STRUCT *pts1, + const ADIOS_SELECTION *s2) { + switch (s2->type) { + case ADIOS_SELECTION_POINTS: + { + const ADIOS_SELECTION_POINTS_STRUCT *pts2 = &s2->u.points; + return adios_selection_intersect_pts_pts(pts1, pts2); + } + default: + adios_error_at_line(err_invalid_argument, __FILE__, __LINE__, "Unknown selection type %d", s2->type); + return NULL; + } +} + +// +// Any-on-any global intersection function +// + +static int is_global_selection(const ADIOS_SELECTION *sel) { + return sel->type == ADIOS_SELECTION_BOUNDINGBOX || sel->type == ADIOS_SELECTION_POINTS; +} + +// The if statements impose a total order on the selection types, and call this function +// with arguments swapped if they are out of this order. This simplifies the above helper +// functions. +ADIOS_SELECTION * adios_selection_intersect_global(const ADIOS_SELECTION *s1, const ADIOS_SELECTION *s2) { + if (!is_global_selection(s1) || !is_global_selection(s2)) { + adios_error_at_line(err_invalid_argument, __FILE__, __LINE__, "Internal error: adios_selection_intersect_global called on non-global selection(s)"); + return NULL; + } + + switch (s1->type) { + case ADIOS_SELECTION_BOUNDINGBOX: + { + const ADIOS_SELECTION_BOUNDINGBOX_STRUCT *bb1 = &s1->u.bb; + return adios_selection_intersect_bb(bb1, s2); + } + case ADIOS_SELECTION_POINTS: + { + const ADIOS_SELECTION_POINTS_STRUCT *pts1 = &s1->u.points; + if (s1->type == ADIOS_SELECTION_BOUNDINGBOX) { + return adios_selection_intersect_global(s2, s1); + } else { + return adios_selection_intersect_pts(pts1, s2); + } + } + default: + adios_error_at_line(err_invalid_argument, __FILE__, __LINE__, "Unknown selection type %d", s1->type); + return NULL; + } +} + + +// +// One-on-one global intersection functions +// +ADIOS_SELECTION * adios_selection_intersect_wb_wb(const ADIOS_SELECTION_WRITEBLOCK_STRUCT *wb1, + const ADIOS_SELECTION_WRITEBLOCK_STRUCT *wb2, + int timestep, + const ADIOS_VARINFO *raw_varinfo, const ADIOS_TRANSINFO *transinfo) +{ + int is_abs_idx; + int wbindex; + if (wb1->is_absolute_index == wb2->is_absolute_index) { + const int index1 = wb1->index; + const int index2 = wb2->index; + if (index1 != index2) + return NULL; + + wbindex = index1; + is_abs_idx = wb1->is_absolute_index; + } else { + const int index1 = wb1->is_absolute_index ? wb1->index : adios_get_absolute_writeblock_index(raw_varinfo, wb1->index, timestep); + const int index2 = wb2->is_absolute_index ? wb2->index : adios_get_absolute_writeblock_index(raw_varinfo, wb2->index, timestep); + if (index1 != index2) + return NULL; + + wbindex = index1; + is_abs_idx = 1; + } + + if (!wb1->is_sub_pg_selection && !wb2->is_sub_pg_selection) { + // If neither selection is a sub-PG selection, the result is easy, and we can return immediately + ADIOS_SELECTION *inter_sel = common_read_selection_writeblock(wbindex); + inter_sel->u.block.is_absolute_index = is_abs_idx; + return inter_sel; + } else if (wb1->is_sub_pg_selection && wb2->is_sub_pg_selection) { + // Else, if both selections are sub-PG selections, take the overlapping portion (if any) + uint64_t inter_elem_offset, inter_nelems; + + int intersects = intersect_segments( + wb1->element_offset, wb1->nelements, + wb2->element_offset, wb2->nelements, + &inter_elem_offset, &inter_nelems + ); + + if (intersects) { + ADIOS_SELECTION *inter_sel = common_read_selection_writeblock(wbindex); + inter_sel->u.block.is_absolute_index = is_abs_idx; + inter_sel->u.block.is_sub_pg_selection = 1; + inter_sel->u.block.element_offset = inter_elem_offset; + inter_sel->u.block.nelements = inter_nelems; + return inter_sel; + } else { + return NULL; + } + } else if (wb1->is_sub_pg_selection) { + // Else, if only the first selection is sub-PG, so just use its range + ADIOS_SELECTION *newwb = common_read_selection_writeblock(wb1->index); + newwb->u.block = *wb1; + return newwb; + } else if (wb2->is_sub_pg_selection) { + // Else, only the second selection is sub-PG, so just use its range + ADIOS_SELECTION *newwb = common_read_selection_writeblock(wb2->index); + newwb->u.block = *wb2; + return newwb; + } else { + abort(); // Should not be possible' + return NULL; + } +} + +// +// One-on-any local intersection functions +// + +// s2 can be selection type +inline static ADIOS_SELECTION * adios_selection_intersect_wb(const ADIOS_SELECTION_WRITEBLOCK_STRUCT *wb1, + const ADIOS_SELECTION *s2, + int timestep, + const ADIOS_VARINFO *raw_varinfo, const ADIOS_TRANSINFO *transinfo) +{ + switch (s2->type) { + case ADIOS_SELECTION_WRITEBLOCK: + { + const ADIOS_SELECTION_WRITEBLOCK_STRUCT *wb2 = &s2->u.block; + return adios_selection_intersect_wb_wb(wb1, wb2, timestep, raw_varinfo, transinfo); + } + default: + adios_error_at_line(err_invalid_argument, __FILE__, __LINE__, "Unknown selection type %d", s2->type); + return NULL; + } +} + +// +// Any-on-any local intersection function +// +ADIOS_SELECTION * adios_selection_intersect_local(const ADIOS_SELECTION *s1, const ADIOS_SELECTION *s2, int timestep, const ADIOS_VARINFO *raw_varinfo, const ADIOS_TRANSINFO *transinfo) +{ + if (is_global_selection(s1) || is_global_selection(s2)) { + adios_error_at_line(err_invalid_argument, __FILE__, __LINE__, "Internal error: adios_selection_intersect_local called on non-local selection(s)"); + return NULL; + } + + switch (s1->type) { + case ADIOS_SELECTION_WRITEBLOCK: + { + const ADIOS_SELECTION_WRITEBLOCK_STRUCT *wb1 = &s1->u.block; + return adios_selection_intersect_wb(wb1, s2, timestep, raw_varinfo, transinfo); + } + case ADIOS_SELECTION_AUTO: + { + adios_error_at_line(err_invalid_argument, __FILE__, __LINE__, "Unsupported selection type AUTO in adios_selection_intersect_local"); + return NULL; + } + default: + adios_error_at_line(err_invalid_argument, __FILE__, __LINE__, "Unknown selection type %d", s1->type); + return NULL; + } +} diff --git a/tests/libs/adios/src/core/adios_selection_util.h b/tests/libs/adios/src/core/adios_selection_util.h new file mode 100644 index 0000000000..c8a2b696d8 --- /dev/null +++ b/tests/libs/adios/src/core/adios_selection_util.h @@ -0,0 +1,43 @@ +/* + * adios_selection_util.h + * + * Created on: Jan 5, 2013 + * Author: David A. Boyuka II + */ + +#ifndef ADIOS_SELECTION_UTIL_H_ +#define ADIOS_SELECTION_UTIL_H_ + +#include +#include +#include + +ADIOS_SELECTION * adios_selection_intersect_bb_bb(const ADIOS_SELECTION_BOUNDINGBOX_STRUCT *bb1, + const ADIOS_SELECTION_BOUNDINGBOX_STRUCT *bb2); +ADIOS_SELECTION * adios_selection_intersect_bb_pts(const ADIOS_SELECTION_BOUNDINGBOX_STRUCT *bb1, + const ADIOS_SELECTION_POINTS_STRUCT *pts2); +ADIOS_SELECTION * adios_selection_intersect_pts_pts(const ADIOS_SELECTION_POINTS_STRUCT *pts1, + const ADIOS_SELECTION_POINTS_STRUCT *pts2); + +/* + * Takes the intersection between two given ADIOS selections of any type. + * Only certain combinations of intersections are supported, as listed below. + * An attempt to intersect any other pairing of selection types will result + * in an adios_error being raised. + * @param s1 the first selection + * @param s2 the second selection + * @return a newly-allocated selection struct representing the intersection of s1 and s2, or NULL + * if s1 and s2 do not intersect. + */ +ADIOS_SELECTION * adios_selection_intersect_global(const ADIOS_SELECTION *s1, const ADIOS_SELECTION *s2); + +// Local (PG-relative) selection intersections + +ADIOS_SELECTION * adios_selection_intersect_wb_wb(const ADIOS_SELECTION_WRITEBLOCK_STRUCT *wb1, + const ADIOS_SELECTION_WRITEBLOCK_STRUCT *wb2, + int timestep, + const ADIOS_VARINFO *raw_varinfo, const ADIOS_TRANSINFO *transinfo); + +ADIOS_SELECTION * adios_selection_intersect_local(const ADIOS_SELECTION *s1, const ADIOS_SELECTION *s2, int timestep, const ADIOS_VARINFO *raw_varinfo, const ADIOS_TRANSINFO *transinfo); + +#endif /* ADIOS_SELECTION_UTIL_H_ */ diff --git a/tests/libs/adios/src/core/adios_socket.c b/tests/libs/adios/src/core/adios_socket.c new file mode 100644 index 0000000000..21df9f15e8 --- /dev/null +++ b/tests/libs/adios/src/core/adios_socket.c @@ -0,0 +1,171 @@ +/* + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + */ + +#include "adios_socket.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + + +/* PUBLIC FUNCTIONS */ + + +int adios_create_socket(int *socketid) +{ + *socketid = socket( AF_INET, SOCK_STREAM, 0 ); + if ( *socketid == -1 ) return 1; + + return 0; +} + +int adios_close_socket(int socketid) +{ + return close(socketid); +} + + +int adios_set_socket_address(char *hostname,int port,struct sockaddr_in *address) +{ + struct hostent *hp; + unsigned int addr; + + if (isalpha(hostname[0])) + { /* host address is a name */ + hp = gethostbyname(hostname); + } + else + { /* Convert nnn.nnn address to a usable one */ + addr = inet_addr(hostname); + hp = gethostbyaddr((char *)&addr,4,AF_INET); + } + if (hp == NULL ) + { + return 1; + } + + memset(address,0,sizeof(*address)); + memcpy(&(address->sin_addr),hp->h_addr,hp->h_length); + address->sin_family = hp->h_addrtype; + address->sin_port = htons(port); + + return 0; +} + +int adios_bind_socket(int socketid,struct sockaddr_in *address) +{ + if(bind(socketid, (struct sockaddr *) address, sizeof(*address))!=0) + return 1; + return 0; +} + +int adios_connect_socket(int socketid,struct sockaddr_in *address) +{ + if (connect(socketid,(struct sockaddr*)address,sizeof(*address))== -1) + return 1; + + return 0; +} + +int adios_socket_start_listen(int socketid) +{ + if(listen(socketid,5)!=0) + { + return 1; + } + return 0; +} + +int adios_socket_accept(int socketid,int *connected) +{ + *connected=accept(socketid,NULL,0); + if(*connected==-1) + { + return 1; + } + return 0; +} + + +int adios_blocking_read_request(int socketid,char *buffer,int maxlength) +{ + char cChar; + int num = 0,ret; + + ret = recv( socketid, &cChar, 1 , 0 ); + if(ret<=0) return ret; + buffer[num] = cChar; + num++; + + while(cChar!='\0'&&num<=maxlength) + { + ret = recv( socketid, &cChar, 1 , 0 ); + buffer[num] = cChar; + num++; + if(ret<=0) return ret; + } + + return num; +} + +int adios_read_block(int socketid,char *buffer,int maxlength) +{ + int ret; + + ret = recv( socketid, buffer, maxlength , 0 ); + return ret; +} + + +int adios_blocking_write_request(int socketid,char *buffer,int length) +{ + if(send( socketid, buffer , length , 0 )==-1) + return 1; + + return 0; +} + +int adios_get_own_hostname(char *host) +{ + struct hostent *pMyHost; + char buffer[255]; + + if(gethostname ( buffer , 255 )!=0 ) return 1; + pMyHost = gethostbyname ( buffer ); + if(pMyHost == NULL) return 1; + strcpy( host , pMyHost->h_name ); + + return 0; +} + +int adios_get_remote_hostname(int socket,char *remotehost) +{ + struct sockaddr_in name; + socklen_t namelen = sizeof (name); + struct hostent *pHost; + char buffer[255]; + unsigned int addr; + + getpeername(socket, (struct sockaddr *)&name, &namelen); + strcpy(buffer,inet_ntoa(name.sin_addr)); + addr = inet_addr(buffer); + pHost = gethostbyaddr((char *)&addr,4,AF_INET); + strcpy(remotehost,pHost->h_name); + + return 0; +} + + diff --git a/tests/libs/adios/src/core/adios_socket.h b/tests/libs/adios/src/core/adios_socket.h new file mode 100644 index 0000000000..eac6795c02 --- /dev/null +++ b/tests/libs/adios/src/core/adios_socket.h @@ -0,0 +1,48 @@ +/* + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + */ + + +#include +#include +#include + +/** Get host:port info from some file. + Input: + env_var_name environment variable name that contains the path to a file to be checked + filename name of file to be looked for if not named in the env var. + path, first path to look for 'filename' + alternate_path alternate path to look for 'filename' + default_port value to be returned in 'port' if port info is not found + + Output: + host host name, string will be allocated + port port value + + Host will be NULL if information is not found + port will be default_port if that part of info is not found + */ + + +/// Socket functions + +int adios_create_socket(int *socketid); +int adios_close_socket(int socketid); +int adios_set_socket_address(char *hostname,int port,struct sockaddr_in *address); +int adios_bind_socket(int socketid,struct sockaddr_in *address); +int adios_connect_socket(int socketid,struct sockaddr_in *address); +int adios_socket_start_listen(int socketid); +int adios_socket_accept(int socketid,int *connected); +int adios_blocking_read_request(int socketid,char *buffer,int maxlength); + +/** Read message in one block that fits into buffer. +Much faster than adios_BlockingReadRequest that is used for short message exchange only. +*/ +int adios_read_block(int socketid,char *buffer,int maxlength); + +int adios_blocking_write_request(int socketid,char *buffer,int length); +int adios_get_own_hostname(char *host); +int adios_get_remote_hostname(int socket,char *remotehost); diff --git a/tests/libs/adios/src/core/adios_subvolume.c b/tests/libs/adios/src/core/adios_subvolume.c new file mode 100644 index 0000000000..1e13193d7e --- /dev/null +++ b/tests/libs/adios/src/core/adios_subvolume.c @@ -0,0 +1,535 @@ +/* + * adios_subvolume.c + * + * Created on: Jul 25, 2012 + * Author: David A. Boyuka II + */ + +#include +#include +#include +#include +#include +#include "core/util.h" +#include "core/common_read.h" +#include "core/adios_subvolume.h" +#include "core/adios_internals.h" + +void vector_add(int ndim, uint64_t *dst_vec, const uint64_t *vec1, const uint64_t *vec2) { + while (ndim--) + *dst_vec++ = *vec1++ + *vec2++; +} + +void vector_sub(int ndim, uint64_t *dst, const uint64_t *vec1, const uint64_t *vec2) { + while (ndim--) + *dst++ = *vec1++ - *vec2++; +} + +uint64_t compute_volume(int ndim, const uint64_t *dims) { + uint64_t volume = 1; + while (ndim) { + volume *= *dims++; + ndim--; + } + return volume; +} + +int intersect_segments(uint64_t start1, uint64_t len1, uint64_t start2, uint64_t len2, + uint64_t *inter_start, uint64_t *inter_len) { + int end1, end2; + int inter_end; + + // Swap the segments if segment 1 starts after segment 2, to simplify calculations + if (start1 > start2) { + int tmps = start1; + int tmpl = len1; + start1 = start2; + len1 = len2; + start2 = tmps; + len2 = tmpl; + } + + end1 = start1 + len1; + end2 = start2 + len2; + + // If segment 1 ends before segment 2 starts, no intersection + if (end1 <= start2) + return 0; + + if (inter_start) { + *inter_start = start2; // Intersection starts at the beginning of the later segment + } + if (inter_len) { + inter_end = end1 <= end2 ? end1 : end2; // Intersection ends at the earlier of the two segment ends + *inter_len = inter_end - *inter_start; + } + + return 1; +} + +int intersect_volumes(int ndim, + const uint64_t *dims1, const uint64_t *offset1, + const uint64_t *dims2, const uint64_t *offset2, + uint64_t *inter_dims, uint64_t *inter_offset, + uint64_t *inter_offset_rel1, uint64_t *inter_offset_rel2) { + // For every dimension, find the intersection in that dimension + // If ever the volumes are disjoint in some dimension, stop immediately + // and report no intersection + int dim; + uint64_t tmp_inter_offset; + for (dim = 0; dim < ndim; dim++) { + const int intersects = intersect_segments(*offset1, *dims1, + *offset2, *dims2, + &tmp_inter_offset, inter_dims); + if (!intersects) + return 0; + + // Calculate/store offsets as the user requests, and then advance to + // the next dimension on these as well + if (inter_offset) + *inter_offset++ = tmp_inter_offset; + if (inter_offset_rel1) + *inter_offset_rel1++ = tmp_inter_offset - *offset1; + if (inter_offset_rel2) + *inter_offset_rel2++ = tmp_inter_offset - *offset2; + + // Advance the other arrays to the next dimension, as well + // NOTE: this must be done after offset calculations, as offset[12] are + // accessed + offset1++; dims1++; + offset2++; dims2++; + inter_dims++; + } + + // If we have a non-null intersection in every dimension, the entire + // volumes intersect, so return true to indicate this + return 1; +} + +int intersect_bb(const ADIOS_SELECTION_BOUNDINGBOX_STRUCT *bb1, + const ADIOS_SELECTION_BOUNDINGBOX_STRUCT *bb2, + uint64_t *inter_offset, + uint64_t *inter_offset_rel1, uint64_t *inter_offset_rel2, + uint64_t *inter_dims) { + + assert(bb1); assert(bb2); + assert(bb1->ndim == bb2->ndim); + return intersect_volumes( + bb1->ndim, bb1->count, bb1->start, bb2->count, bb2->start, + inter_dims, inter_offset, inter_offset_rel1, inter_offset_rel2); +} + +void copy_subvolume_with_spec(void *dst, const void *src, + const adios_subvolume_copy_spec *copy_spec, + enum ADIOS_DATATYPES datum_type, + enum ADIOS_FLAG swap_endianness) { + + copy_subvolume(dst, src, copy_spec->ndim, copy_spec->subv_dims, + copy_spec->dst_dims, copy_spec->dst_subv_offsets, + copy_spec->src_dims, copy_spec->src_subv_offsets, + datum_type, swap_endianness); +} + +void copy_subvolume_ragged_with_spec(void *dst, const void *src, + const adios_subvolume_copy_spec *copy_spec, + const uint64_t *dst_ragged_offsets, + const uint64_t *src_ragged_offsets, + enum ADIOS_DATATYPES datum_type, + enum ADIOS_FLAG swap_endianness) { + copy_subvolume_ragged(dst, src, copy_spec->ndim, copy_spec->subv_dims, + copy_spec->dst_dims, copy_spec->dst_subv_offsets, + dst_ragged_offsets, + copy_spec->src_dims, copy_spec->src_subv_offsets, + src_ragged_offsets, + datum_type, swap_endianness); +} + +void copy_subvolume_ragged_offset_with_spec(void *dst, const void *src, + const adios_subvolume_copy_spec *copy_spec, + uint64_t dst_ragged_offset, + uint64_t src_ragged_offset, + enum ADIOS_DATATYPES datum_type, + enum ADIOS_FLAG swap_endianness) { + copy_subvolume_ragged_offset(dst, src, copy_spec->ndim, copy_spec->subv_dims, + copy_spec->dst_dims, copy_spec->dst_subv_offsets, + dst_ragged_offset, + copy_spec->src_dims, copy_spec->src_subv_offsets, + src_ragged_offset, + datum_type, swap_endianness); +} + + +/* + * copy_subvolume delegates to the copy_subvolume_helper function, with the + * following parameter translations: + * 1) Element size (i.e. 8 bytes for double, etc.) is considered an additional, + * fastest-varying dimension + * 2) All "contiguous" fastest-varying dimensions are collapsed into a single + * fastest-varying dimension + */ +void copy_subvolume(void *dst, const void *src, int ndim, const uint64_t *subv_dims, + const uint64_t *dst_dims, const uint64_t *dst_subv_offsets, + const uint64_t *src_dims, const uint64_t *src_subv_offsets, + enum ADIOS_DATATYPES datum_type, enum ADIOS_FLAG swap_endianness) { + copy_subvolume_ragged(dst, src, ndim, subv_dims, + dst_dims, dst_subv_offsets, NULL, + src_dims, src_subv_offsets, NULL, + datum_type, swap_endianness); +} + +void copy_subvolume_ragged(void *dst, const void *src, int ndim, const uint64_t *subv_dims, + const uint64_t *dst_dims, const uint64_t *dst_subv_offsets, + const uint64_t *dst_ragged_offsets, + const uint64_t *src_dims, const uint64_t *src_subv_offsets, + const uint64_t *src_ragged_offsets, + enum ADIOS_DATATYPES datum_type, enum ADIOS_FLAG swap_endianness) { + + const uint64_t total_src_ragged_offset = + src_ragged_offsets ? + compute_linear_offset_in_volume(ndim, src_ragged_offsets, + src_dims) : 0; + const uint64_t total_dst_ragged_offset = + dst_ragged_offsets ? + compute_linear_offset_in_volume(ndim, dst_ragged_offsets, + dst_dims) : 0; + + copy_subvolume_ragged_offset(dst, src, ndim, subv_dims, + dst_dims, dst_subv_offsets, + total_dst_ragged_offset, + src_dims, src_subv_offsets, + total_src_ragged_offset, + datum_type, swap_endianness); +} + +/* + * Copies a given subvolume from 'src' to 'dst'. It recursively copies a + * hyperplane of progressively lower dimensions, until it reaches the lowest + * dimension, in which case it simply performs a memcpy. + * + * At any given call level to this function, 'src' and 'dst' point to the first + * element of a hyperplane of the subvolume with dimension 'ndim'. + * + * @param dst the destination buffer + * @param src the source buffer + * @param ndim the number of dimensions + * @param next_subv_dim the list of dimensions for the subvolume, starting with + * the slowest-changing + * @param next_dst_stride the list of destination buffer strides for each + * dimension + * @param next_src_stride the list of source buffer strides for each dimension + * @param type the datatype of the elements in dst/src (NOTE: this is ONLY for + * the purpose of endianness swapping; strides/dimensions are in bytes) + * @param swap_endianness if true, swap the endianness of each element + */ +static void copy_subvolume_helper(char *dst, const char *src, + int ndim, const uint64_t *next_subv_dim, + const uint64_t *next_dst_stride, const uint64_t *next_src_stride, + enum ADIOS_DATATYPES buftype, int swap_endianness) { + if (ndim == 1) { + memcpy(dst, src, *next_subv_dim); + if (swap_endianness) { + change_endianness(dst, *next_subv_dim, buftype); + } + } else { + int i; + for (i = 0; i < *next_subv_dim; i++) { + copy_subvolume_helper(dst, src, ndim - 1, + next_subv_dim + 1, next_dst_stride + 1, next_src_stride + 1, + buftype, swap_endianness); + + src += *next_src_stride; + dst += *next_dst_stride; + } + } +} + +/* + * Same as copy_subvolume_helper, but uses memmove instead of memcpy for + * safe(r) copies on overlapping buffers. + */ +static void copy_subvolume_helper_safe(char *dst, const char *src, + int ndim, const uint64_t *next_subv_dim, + const uint64_t *next_dst_stride, const uint64_t *next_src_stride, + enum ADIOS_DATATYPES buftype, int swap_endianness) { + if (ndim == 1) { + memmove(dst, src, *next_subv_dim); + if (swap_endianness) { + change_endianness(dst, *next_subv_dim, buftype); + } + } else { + int i; + for (i = 0; i < *next_subv_dim; i++) { + copy_subvolume_helper(dst, src, ndim - 1, + next_subv_dim + 1, next_dst_stride + 1, next_src_stride + 1, + buftype, swap_endianness); + + src += *next_src_stride; + dst += *next_dst_stride; + } + } +} + +void copy_subvolume_ragged_offset(void *dst, const void *src, int ndim, const uint64_t *subv_dims, + const uint64_t *dst_dims, const uint64_t *dst_subv_offsets, + uint64_t dst_ragged_offset, + const uint64_t *src_dims, const uint64_t *src_subv_offsets, + uint64_t src_ragged_offset, + enum ADIOS_DATATYPES datum_type, enum ADIOS_FLAG swap_endianness) { + + int i; + int last_noncovering_dim = 0; // Index of dimension that starts a contiguous block + int buffers_intersect = 0; // Whether the source and destination memory copy regions may intersect + uint64_t src_strides[32]; + uint64_t dst_strides[32]; + const int type_size = adios_get_type_size(datum_type, NULL); + + // Find the last dimension for which the subvolume, source and destination + // spaces do not exactly match (i.e. non-zero offset or unequal lengths). + for (i = 0; i < ndim; i++) { + // If the subvolume, source and destination do not exactly match along + // this dimension, it is marked as incomplete + if (src_subv_offsets[i] != 0 || + dst_subv_offsets[i] != 0 || + subv_dims[i] != src_dims[i] || + subv_dims[i] != dst_dims[i]) { + + last_noncovering_dim = i; + } + } + + // Calculate the volume (number of bytes) of the region subtended by the + // contiguous dimensions (which start with the last non-covering dimension) + uint64_t contig_dims_volume = 1; + for (i = last_noncovering_dim; i < ndim; i++) { + contig_dims_volume *= subv_dims[i]; + } + // Add the element size as a new "dimension", to convert from element-space + // to byte-space + contig_dims_volume *= type_size; // Assumes non-string type + + // Compute strides for the dimensions + uint64_t src_volume = type_size; + uint64_t dst_volume = type_size; + for (i = ndim - 1; i >= 0; i--) { + src_strides[i] = src_volume; + dst_strides[i] = dst_volume; + + src_volume *= src_dims[i]; + dst_volume *= dst_dims[i]; + } + + // Compute the starting offsets for src and dst. In theory we could skip + // the contiguous dimensions other than the first one, but just to be + // safe/simple we calculate them all. + uint64_t src_offset = 0, dst_offset = 0; + for (i = 0; i < ndim; i++) { + src_offset += src_subv_offsets[i] * src_strides[i]; + dst_offset += dst_subv_offsets[i] * dst_strides[i]; + } + // Incorporate ragged offsets + src_offset -= src_ragged_offset * type_size; + dst_offset -= dst_ragged_offset * type_size; + + // Save the old value of the first contiguous dimension, then replace it + // with a "collapsed" dimension consolidating all contiguous dimensions + // into one + // We "cheat" a bit by removing the const modifier. This is OK because we + // carefully put back the original value before returning. This is the only + // argument modification we do in this function besides filling 'dst'. + uint64_t first_contig_dim_value_old = subv_dims[last_noncovering_dim]; + ((uint64_t*)subv_dims)[last_noncovering_dim] = contig_dims_volume; + + // Compute whether the memory regions for the copy overlap + // If so, we need to use a safer copy method + if (0) { // FOR NOW, DON'T DO THIS, AS WE NEVER USE OVERLAPPING BUFFERS + uint64_t dst_end_offset = dst_offset; + uint64_t src_end_offset = src_offset; + // Match the stride counts as executed by the helper function: all but + // the last dimension contribute (length - 1) strides, with the last + // dimension contributing instead its length + for (i = 0; i < last_noncovering_dim; i++) { + src_end_offset += (subv_dims[i] - 1) * src_strides[i]; + dst_end_offset += (subv_dims[i] - 1) * dst_strides[i]; + } + src_end_offset += subv_dims[last_noncovering_dim]; + dst_end_offset += subv_dims[last_noncovering_dim]; + + buffers_intersect = + intersect_segments((uint64_t)dst + dst_offset, + dst_end_offset - dst_offset, + (uint64_t)src + src_offset, + src_end_offset - src_offset, + NULL, NULL); + + buffers_intersect = 0; // Look Ma, no asserts! + + // Enfoce the safety condition for overlapping buffers here + if (buffers_intersect) { + assert((char*)src + src_offset >= (char*)dst + dst_offset); + for (i = 0; i < last_noncovering_dim + 1; i++) + assert(src_strides[i] >= dst_strides[i]); + } + } + + //printf(">>> copy_subvolume is using %d contiguous dimensions...\n", ndim - first_contig_dim); + + // Finally, delegate to the recursive worker function + if (buffers_intersect) { + copy_subvolume_helper_safe( + (char*)dst + dst_offset, /* Offset dst buffer to the first element */ + (char*)src + src_offset, /* Offset src buffer to the first element */ + last_noncovering_dim + 1, /* Number of dimensions, modified for collapsed contiguous dimensions */ + subv_dims, /* Subvolume dimensions (modified to collapse all contiguous dimensions) */ + dst_strides, /* dst buffer dimension strides */ + src_strides, /* src buffer dimension strides */ + datum_type, /* The datatype of the buffer elements */ + swap_endianness == adios_flag_yes /* Whether to swap endianness */ + ); + } else { + copy_subvolume_helper( + (char*)dst + dst_offset, /* Offset dst buffer to the first element */ + (char*)src + src_offset, /* Offset src buffer to the first element */ + last_noncovering_dim + 1, /* Number of dimensions, modified for collapsed contiguous dimensions */ + subv_dims, /* Subvolume dimensions (modified to collapse all contiguous dimensions) */ + dst_strides, /* dst buffer dimension strides */ + src_strides, /* src buffer dimension strides */ + datum_type, /* The datatype of the buffer elements */ + swap_endianness == adios_flag_yes /* Whether to swap endianness */ + ); + } + + // Restore the old first contiguous dimension value + ((uint64_t*)subv_dims)[last_noncovering_dim] = first_contig_dim_value_old; +} + +uint64_t compute_linear_offset_in_volume(int ndim, const uint64_t *point, const uint64_t *dims) { + int dim; + uint64_t ragged_off = 0; + uint64_t volume_so_far = 1; + for (dim = ndim - 1; dim >= 0; dim--) { + ragged_off += point[dim] * volume_so_far; + volume_so_far *= dims[dim]; + } + return ragged_off; +} + +void compact_subvolume_ragged_offset(void *buf, int ndim, const uint64_t *subv_dims, + const uint64_t *buf_dims, uint64_t buf_ragged_offset, + const uint64_t *buf_subv_offsets, + enum ADIOS_DATATYPES elem_type) { + int i; + uint64_t zero[32]; + + // Ensure all arguments are non-NULL, and that the subvolume fits + // completely within the buffer volume + assert(buf); assert(buf_dims); assert(subv_dims); assert(buf_subv_offsets); + for (i = 0; i < ndim; i++) + assert(buf_dims[i] >= subv_dims[i] + buf_subv_offsets[i]); + + memset(zero, 0, ndim * sizeof(uint64_t)); + + adios_subvolume_copy_spec *compact_copyspec = malloc(sizeof(adios_subvolume_copy_spec)); + adios_copyspec_init(compact_copyspec, ndim, subv_dims, + subv_dims, zero, + buf_dims, buf_subv_offsets); + + // If the compact operation will do something, do it now + if (!adios_copyspec_is_noop(compact_copyspec)) { + // Overlapping subvolume copy allowed because it matches the safety + // condition as defined in comment at the top of adios_subvolume.h. + // NOTE: we infer no endianness swap, as this is an intra-buffer operation + copy_subvolume_ragged_offset_with_spec( + buf, buf, compact_copyspec, + 0, buf_ragged_offset, + elem_type, adios_flag_no); + } + + // We use the arguments and a stack array as buffers; don't free them + adios_copyspec_free(&compact_copyspec, 0); +} + +ADIOS_SELECTION * new_derelativized_selection(const ADIOS_SELECTION *sel, const uint64_t *sel_global_offset) { + ADIOS_SELECTION *new_sel; + switch (sel->type) { + case ADIOS_SELECTION_BOUNDINGBOX: + { + const int ndim = sel->u.bb.ndim; + const int dimsize = ndim * sizeof(uint64_t); + uint64_t * const new_start = malloc(dimsize); + uint64_t * const new_count = bufdup(sel->u.bb.count, sizeof(uint64_t), ndim); + + // Add the global offset to the bounding box start + vector_add(ndim, new_start, sel->u.bb.start, sel_global_offset); + + new_sel = common_read_selection_boundingbox(ndim, new_start, new_count); + break; + } + case ADIOS_SELECTION_POINTS: + { + const int ndim = sel->u.points.ndim; + const uint64_t npoints = sel->u.points.npoints; + uint64_t * const new_points = malloc(npoints * ndim * sizeof(uint64_t)); + + uint64_t i; + const uint64_t *cur_src_point = sel->u.points.points; + uint64_t *cur_dst_point = new_points; + + // Add the global offset to each point + for (i = 0; i < npoints; i++) { + vector_add(ndim, cur_dst_point, cur_src_point, sel_global_offset); + cur_src_point += ndim; + cur_dst_point += ndim; + } + + new_sel = common_read_selection_points(ndim, npoints, new_points); + break; + } + case ADIOS_SELECTION_WRITEBLOCK: + case ADIOS_SELECTION_AUTO: + default: + fprintf(stderr, "Internal error: attempt to call %s on a selection of type %d, but only BOUNDINGBOX (%d) and POINTS (%d) are supported.\n", + __FUNCTION__, sel->type, ADIOS_SELECTION_BOUNDINGBOX, ADIOS_SELECTION_POINTS); + assert(0); + break; + } + + return new_sel; +} + +ADIOS_SELECTION * varblock_to_bb(int ndim, const ADIOS_VARBLOCK *vb) { + return common_read_selection_boundingbox(ndim, + bufdup(vb->start, sizeof(uint64_t), ndim), + bufdup(vb->count, sizeof(uint64_t), ndim)); +} + +uint64_t compute_selection_size(const ADIOS_SELECTION *sel) { + uint64_t sel_size; + switch (sel->type) { + case ADIOS_SELECTION_BOUNDINGBOX: + { + const int ndim = sel->u.bb.ndim; + const uint64_t * const sel_count = sel->u.bb.count; + int i; + + sel_size = 1; + for (i = 0; i < ndim; i++) + sel_size *= sel_count[i]; + + break; + } + case ADIOS_SELECTION_POINTS: + { + sel_size = sel->u.points.npoints; + break; + } + case ADIOS_SELECTION_WRITEBLOCK: + case ADIOS_SELECTION_AUTO: + default: + fprintf(stderr, "Internal error: attempt to call %s on a selection of type %d, but only BOUNDINGBOX (%d) and POINTS (%d) are supported.\n", + __FUNCTION__, sel->type, ADIOS_SELECTION_BOUNDINGBOX, ADIOS_SELECTION_POINTS); + assert(0); + break; + } + + return sel_size; +} diff --git a/tests/libs/adios/src/core/adios_subvolume.h b/tests/libs/adios/src/core/adios_subvolume.h new file mode 100644 index 0000000000..9f2fc9fe9c --- /dev/null +++ b/tests/libs/adios/src/core/adios_subvolume.h @@ -0,0 +1,282 @@ +/* + * adios_subvolume.h + * + * Utility functions for manipulating subvolumes of multi-dimensional arrays. + * + * --- Note on overlapping subvolume copies --- + * In some special cases, it may be desirable to perform a subvolume copy where + * the source and destination volumes overlap, and therefore memcpy operations + * may also overlap. This operation is supported with the condition that the + * following conditions are met: + * 1) The source pointer is not before the destination pointer + * 2) The size of each stride in the source volume is at least the + * size of the corresponding stride in the destination volume + * + * If these conditions hold, no source memory will ever be overwritten + * before it is copied. This can be proven inductively: + * 1) The first memmove will copy a block of data to an equal or lower + * address than its source address, since the source pointer is + * not before the destination pointer + * 2) At any later point, the additional offset into the source buffer + * is at least the addition offset into the destination buffer, + * since this offset is a positive linear combination of the strides + * for each buffer, and the source stride is at least that of the + * destination stride for every dimension. Therefore, the final copy + * destination address is still at least that of the final source + * address + * + * Note that this works even with ragged arrays, as we only consider + * the start offsets, which incorporate the ragged offset, and strides, + * which are not affected by the ragged offset. + * + * If a subvolume copy is attempted where both of these safety conditions do + * not hold, an assertion will fail. + * + * Created on: Jul 25, 2012 + * Author: David A. Boyuka II + */ + + +#ifndef ADIOS_SUBVOLUME_H_ +#define ADIOS_SUBVOLUME_H_ + +#include +#include "public/adios_types.h" +#include "public/adios_read_v2.h" +#include "public/adios_selection.h" +#include "core/adios_copyspec.h" + +void vector_add(int ndim, uint64_t *dst_vec, const uint64_t *vec1, const uint64_t *vec2); +void vector_sub(int ndim, uint64_t *dst, const uint64_t *vec1, const uint64_t *vec2); + +/* + * Simple computation of the volume in elements of a given array. + */ +uint64_t compute_volume(int ndim, const uint64_t *dims); + +/* + * Calculates the intersection, if any, between two line segments in a 1D space. + + * If the line segments intersect, this function will return a non-zero value, and + * the output arguments (inter_start, inter_len) will be populated with the offset + * and length of the intersection region, respectively. + * + * If the volumes are disjoint, this function will return 0, and the content of + * the output arguments is undefined. + * + * @param start1 the offset of the first line segment + * @param len1 the length of the first line segment + * @param start2 the offset of the second line segment + * @param len2 the length of the second line segment + * @param inter_start a pointer to a uint64_t to hold the intersection region's offset + * @param inter_len a pointer to a uint64_t to hold the intersection region's length + */ +int intersect_segments(uint64_t start1, uint64_t len1, uint64_t start2, uint64_t len2, + uint64_t *inter_start, uint64_t *inter_len); +/* + * Calculates the intersection, if any, between two volumes. For each volume, + * dimensions and global offsets must be specified. If the volumes do + * intersect, the size dimensions of the intersection are returned, as well as + * the offset of the intersection in three forms: global, and relative to each + * of the two volumes. + * + * All global offsets (offset1, offset2, inter_offset) are defined relative to + * the same global coordinate space (typically a global array). + * + * All buffer arguments (everything but ndim) must be arrays of uint64_t of + * length at least ndim (or NULL, in the case of the optional output arguments; + * see below). + * + * If the volumes intersect, this function will return a non-zero value, and + * the output arguments (inter_offset, inter_offset_rel1, inter_offset_rel2, + * and inter_dims) will be populated with the global offset, offset relative + * to volume 1's offset, offset relative to volume 2's offset, and dimensions + * of the intersection volume, respectively. An appropriate buffer must be + * supplied for inter_dims, but NULL may be supplied for any of the other + * three output parameters if that information is not desired. + * + * If the volumes are disjoint, this function will return 0, and the content of + * the output arguments is undefined. + * + * @param offset1 the global offset of volume 1 + * @param dims1 the dimensions of volume 1 + * @param offset2 the global offset of volume 2 + * @param dims2 the dimensions of volume 2 + * @param inter_offset a buffer to hold the offset of the intersection + * volume, or NULL if this information isn't required. + * @param inter_offset_rel1 a buffer to hold the offset of the intersection + * volume relative to offset1, or NULL if this information isn't + * required. + * @param inter_offset_rel2 a buffer to hold the offset of the intersection + * volume relative to offset2, or NULL if this information isn't + * required. + * @param inter_dims a buffer to hold the dimensions of the intersection volume + */ +int intersect_volumes(int ndim, + const uint64_t *offset1, const uint64_t *dims1, + const uint64_t *offset2, const uint64_t *dims2, + uint64_t *inter_offset, + uint64_t *inter_offset_rel1, uint64_t *inter_offset_rel2, + uint64_t *inter_dims); + +/* + * Same as intersect_volume, but derive the volume bounds from bounding box + * structs. + */ +int intersect_bb(const ADIOS_SELECTION_BOUNDINGBOX_STRUCT *bb1, + const ADIOS_SELECTION_BOUNDINGBOX_STRUCT *bb2, + uint64_t *inter_offset, + uint64_t *inter_offset_rel1, uint64_t *inter_offset_rel2, + uint64_t *inter_dims); + +/* + * Copies a multi-dimensional subvolume from one buffer to another. + * + * 'src' and 'dst' are assumed to be buffers laid out in C array dimension + * order (the first dimension is the slowest-changing). 'dst' is assumed to + * have the specified dimensions to accommodate the incoming subvolume. + * + * NOTE: See the section on "safety condition for overlapping subvolume copies" + * at the top of adios_subvolume.h for important information on + * overlapping copies. + * + * @param dst the destination buffer + * @param src the source buffer + * @param ndim the number of dimensions in the source and destination space + * @param subv_dims the dimensions of the subvolume to copy + * @param dst_dims the dimensions of the entire destination buffer + * @param dst_subv_offsets the offsets at which to write the subvolume + * @param src_dims the dimensions of the entire source buffer + * @param src_subv_offsets the offsets from which to read the subvolume + * @param datum_type the ADIOS datatype of the elements in the source and + * destination buffers + */ +void copy_subvolume(void *dst, const void *src, int ndim, const uint64_t *subv_dims, + const uint64_t *dst_dims, const uint64_t *dst_subv_offsets, + const uint64_t *src_dims, const uint64_t *src_subv_offsets, + enum ADIOS_DATATYPES datum_type, + enum ADIOS_FLAG swap_endianness); + +/* + * The same as copy_subvolume, with the addition of optional ragged src/dst + * arrays. These arrays are ragged iff the pointer supplied does not point to + * the logical (0,0,...,0) element of the corresponding array, but instead + * points to some element (r1,r2,...,rn) with some ri != 0. In this case, + * the corresponding {src,dst}_ragged_offsets designates the element pointed to + * by the corresponding pointer. + */ +void copy_subvolume_ragged(void *dst, const void *src, int ndim, const uint64_t *subv_dims, + const uint64_t *dst_dims, const uint64_t *dst_subv_offsets, + const uint64_t *dst_ragged_offsets, + const uint64_t *src_dims, const uint64_t *src_subv_offsets, + const uint64_t *src_ragged_offsets, + enum ADIOS_DATATYPES datum_type, enum ADIOS_FLAG swap_endianness); + +/* + * Same as copy_subvolume_ragged, but takes a scalar byte offset for ragged + * arrays instead of an array of element offsets. + */ +void copy_subvolume_ragged_offset(void *dst, const void *src, int ndim, const uint64_t *subv_dims, + const uint64_t *dst_dims, const uint64_t *dst_subv_offsets, + uint64_t dst_ragged_offset, + const uint64_t *src_dims, const uint64_t *src_subv_offsets, + uint64_t src_ragged_offset, + enum ADIOS_DATATYPES datum_type, enum ADIOS_FLAG swap_endianness); + +/* + * Same as copy_subvolume, but derives most of the parameters from the supplied + * subvolume copy spec. + */ +void copy_subvolume_with_spec(void *dst, const void *src, + const adios_subvolume_copy_spec *copy_spec, + enum ADIOS_DATATYPES datum_type, + enum ADIOS_FLAG swap_endianness); + +/* + * Same as copy_subvolume_ragged, but derives most of the parameters from the + * supplied subvolume copy spec. + */ +void copy_subvolume_ragged_with_spec(void *dst, const void *src, + const adios_subvolume_copy_spec *copy_spec, + const uint64_t *dst_ragged_offsets, + const uint64_t *src_ragged_offsets, + enum ADIOS_DATATYPES datum_type, + enum ADIOS_FLAG swap_endianness); + +/* + * Same as copy_subvolume_ragged_offset, but derives most of the parameters + * from the supplied subvolume copy spec. + */ +void copy_subvolume_ragged_offset_with_spec(void *dst, const void *src, + const adios_subvolume_copy_spec *copy_spec, + uint64_t dst_ragged_offset, + uint64_t src_ragged_offset, + enum ADIOS_DATATYPES datum_type, + enum ADIOS_FLAG swap_endianness); + +/* + * Computes the element offset of the beginning of a ragged multidimensional + * volume array relative to the beginning of the corresponding complete volume + * array. + * + * @param ndim number of dimensions of the volume + * @param point the point within the volume + * @param dims the dimensions of the volume + * @return the linearized element offset of the point within the volume + */ +uint64_t compute_linear_offset_in_volume(int ndim, const uint64_t *point, const uint64_t *dims); + +/* + * Compacts a subvolume within a buffer volume to the beginning of the buffer, + * leaving the rest of the buffer in an undefined state. + * + * For example, given a 10x10 subvolume of a 20x20 buffer volume, it will shift + * the contents of that subvolume to the first 100 elements of the buffer, + * leaving the remaining 300 elements undefined. + * + * @param buf the buffer for the containing volume + * @param ndim the dimensionality of space for the volumes + * @param subv_dims the dimensions of the subvolume + * @param buf_dims the dimensions of the containing volume + * @param buf_ragged_offset the ragged offset of the containing volume (if the + * containing volume is a complete array, set this to 0) + * @param buf_subv_offsets the offset of the subvolume within the containing + * volume + * @param elem_type the datatype of the elements of the buffer + */ +void compact_subvolume_ragged_offset(void *buf, int ndim, const uint64_t *subv_dims, + const uint64_t *buf_dims, uint64_t buf_ragged_offset, + const uint64_t *buf_subv_offsets, + enum ADIOS_DATATYPES elem_type); + + +/* + * Takes a selection that is relative to a given offset, and derelativizes it + * from that point. For a bounding box selection, this involves shifting the + * start coordinate of the bounding box by the given offset. For a point + * selection, this involves adding the given offset to each point. + * + * Only bounding box and point selections are supported at this time; + * attempting to derelativize some other selection type will cause a failed + * assertion. + * + * @param sel the relative selection + * @param the offset about which to derelativize the given selection + * @return a new selection that is derelativized. + */ +ADIOS_SELECTION * new_derelativized_selection(const ADIOS_SELECTION *sel, const uint64_t *sel_global_offset); + +/* + * Converts an ADIOS_VARBLOCK to a corresponding ADIOS_SELECTION of type + * bounding box, which will be a selection exactly matching the bounds of the + * given ADIOS_VARBLOCK within the global space. + * @param ndim the dimensionality of space + * @param the ADIOS_VARBLOCK to convert to a bounding box selection + * @return an ADIOS_SELECTION of type bounding box corresponding to the given + * ADIOS_VARBLOCK. + */ +ADIOS_SELECTION * varblock_to_bb(int ndim, const ADIOS_VARBLOCK *vb); + +uint64_t compute_selection_size(const ADIOS_SELECTION *sel); + +#endif /* ADIOS_SUBVOLUME_H_ */ diff --git a/tests/libs/adios/src/core/adios_timing.c b/tests/libs/adios/src/core/adios_timing.c new file mode 100644 index 0000000000..923dfd8575 --- /dev/null +++ b/tests/libs/adios/src/core/adios_timing.c @@ -0,0 +1,543 @@ +/* + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + */ + + +#include "adios.h" +#include "adios_error.h" +#include "core/adios_internals.h" +#include "core/adios_timing.h" +#include "core/adios_logger.h" +#include +#include +#include +#include +#include + +#include "adios_mpi.h" +//#include "mpi.h" + + +/* + * Dump the timing information to a file. + * Called both from C and Fortran API's (adios.c and adiosf.c) +*/ +void adios_timing_write_xml_common (int64_t fd_p, const char* filename) +{ +#if defined ADIOS_TIMER_EVENTS && !defined _NOMPI //No timing information on single process + + struct adios_file_struct * fd = (struct adios_file_struct *) fd_p; + if (!fd) + { + adios_error (err_invalid_file_pointer, + "Invalid handle passed to adios_get_timing_name\n"); + return; + } + + if (!fd->group || !fd->group->prev_timing_obj) + { + // No timing info, don't write anything. + return; + } + + int size=1, rank=0, i, global_event_count, count_to_send; + + int * counts; + int * displs; + struct adios_timing_event_struct* events; + MPI_Datatype event_type; + if (fd->comm != MPI_COMM_NULL) + { + MPI_Comm_size (fd->comm, &size); + MPI_Comm_rank (fd->comm, &rank); + } + + if (rank == 0) + { + counts = (int*) malloc (sizeof (int) * size); + } + + // Collect all of the events on proc 0 + // First, per proc event counts + + count_to_send = (fd->group->prev_timing_obj->event_count > ADIOS_TIMING_MAX_EVENTS) ? + ADIOS_TIMING_MAX_EVENTS : fd->group->prev_timing_obj->event_count; + + + MPI_Gather ( + &count_to_send, // sendbuf + 1, // sendcount + MPI_INT, // sendtype + counts, // recvbuf + 1, // recvcount + MPI_INT, // recvtype + 0, // root + fd->comm // comm + ); + + if (rank == 0) + { + + displs = (int*) malloc (sizeof (int) * size); + displs[0] = 0; + global_event_count = counts[0]; + + for (i = 1; i < size; i++) + { + displs[i] = displs[i-1] + counts[i-1]; + global_event_count += counts[i]; + } + + events = (struct adios_timing_event_struct*) malloc ( + sizeof (struct adios_timing_event_struct) * global_event_count); + } + + // structure of the adios_timing_event_struct (int, int, double) + int blocklens[] = {2,1}; + MPI_Aint disps[] = {0,2*sizeof(int)}; + MPI_Datatype types[] = {MPI_INT,MPI_DOUBLE}; + + MPI_Type_create_struct ( + 2, // count + blocklens, // array_of_blocklengths + disps, // array_of_displacements + types, // array_of_types + &event_type + ); + MPI_Type_commit (&event_type); + + + // Now the events + MPI_Gatherv ( + &fd->group->prev_timing_obj->events, // sendbuf + count_to_send, // sendcount + event_type, // sendtype + events, //recvbuf + counts, // recvcounts + displs, // displacements + event_type, // recvtype + 0, // root + fd->comm // comm + ); + + // Gather the write sizes + int *write_sizes = NULL; + if (rank == 0) + { + write_sizes = (int*) malloc (sizeof(int) * size); + } + + MPI_Gather ( + &fd->write_size_bytes, //sendbuf + 1, //sendcount + MPI_INT, //sendtype + write_sizes, //recvbuf + 1, //recvcount + MPI_INT, //recvtype + 0, //root + fd->comm //comm + ); + + // Write the events to a file + if (rank == 0) + { + FILE* f = fopen (filename, "a"); + int event_rank; + + for (i = 0; i < size; i++) + { + fprintf (f, "'%i'%i\n", i, write_sizes[i]); + } + + // Write the labels + for (i = 0; i < fd->group->prev_timing_obj->internal_count; i++) + { + fprintf (f, ":%i:%s\n", ADIOS_TIMING_MAX_USER_TIMERS + i, + fd->group->prev_timing_obj->names[ADIOS_TIMING_MAX_USER_TIMERS + i]); + } + + // Now the event data + i = 0; + for (event_rank = 0; event_rank < size; event_rank++) + { + for ( ; i < displs[event_rank] + counts[event_rank]; i++) + { + fprintf (f, "%i,%i%s,%f\n", event_rank, events[i].type, + events[i].is_start?"S":"E", events[i].time); + } + } + + fclose(f); + } + + + if (rank == 0) + { + if (counts) + free (counts); + } + +#else + log_warn ("Timing events are not currently available.\n" + "To use the timing events, you must enable them when building ADIOS.\n" + "Use --enable-timer-events during the configuration step.\n"); +#endif + +} + +//Build the internal functions only when timing is enabled. +#if defined ADIOS_TIMERS || defined ADIOS_TIMER_EVENTS + + + +void adios_write_timing_variables (struct adios_file_struct * fd) +{ + if (!fd) + { + adios_error (err_invalid_file_pointer, + "Invalid handle passed to adios_write_timing_variables\n"); + return; + } + + if (!fd->group || !fd->group->prev_timing_obj) + { + // No timing info, don't write anything. + return; + } + + struct adios_group_struct * g = fd->group; + int timer_count = g->prev_timing_obj->user_count + g->prev_timing_obj->internal_count; + + int rank=0, i, ct=0; + if (fd->comm != MPI_COMM_NULL) + { + MPI_Comm_rank (fd->comm, &rank); + } + + char name_timers[256]; + char name_labels[256]; + snprintf (name_timers, 256, "/__adios__/timers_%hu", + (short unsigned int)g->id); + snprintf (name_labels, 256, "/__adios__/timer_labels_%hu", + (short unsigned int)g->id); + + struct adios_var_struct * v; + + if (rank == 0) + { + v = adios_find_var_by_name (g, name_labels); + if (v) + { + int max_label_len = 0; + for (i = 0; i < g->prev_timing_obj->user_count; i++) + { + max_label_len = MAX(max_label_len, + strlen(g->prev_timing_obj->names[i])); + } + for (i = 0; i < g->prev_timing_obj->internal_count; i++) + { + max_label_len = MAX(max_label_len, + strlen(g->prev_timing_obj->names[ADIOS_TIMING_MAX_USER_TIMERS + i])); + } + + char * labels = (char*) + malloc ( (max_label_len+1) * timer_count * sizeof (char) ); + + for (i = 0; i < g->prev_timing_obj->user_count; i++) + { + strcpy (&labels[(ct++)*(max_label_len+1)], g->prev_timing_obj->names[i]); + } + for (i = 0; i < g->prev_timing_obj->internal_count; i++) + { + strcpy (&labels[(ct++)*(max_label_len+1)], + g->prev_timing_obj->names[ADIOS_TIMING_MAX_USER_TIMERS + i]); + } + + common_adios_write_byid (fd, v, labels); + free (labels); + } + else + { + log_warn ("Unable to write %s, continuing", name_labels); + } + } + + double * timers = (double*) malloc (sizeof (double) * timer_count); + ct = 0; + for (i = 0; i < g->prev_timing_obj->user_count; i++) + { + timers[ct++] = g->prev_timing_obj->times[i]; + } + for (i = 0; i < g->prev_timing_obj->internal_count; i++) + { + timers[ct++] = g->prev_timing_obj->times [ADIOS_TIMING_MAX_USER_TIMERS + i]; + } + +// DEBUG +//for (i = 0; i < ct; i++) +// printf ("%f,", timers[i]); + + + v = adios_find_var_by_name (g, name_timers); + if (v) + { + common_adios_write_byid (fd, v, timers); + } + else + { + log_warn ("Unable to write %s, continuing", name_timers); + } + + free (timers); + +} + +int adios_add_timing_variables (struct adios_file_struct * fd) +{ + + if (!fd) + { + adios_error (err_invalid_file_pointer, + "Invalid handle passed to adios_add_timing_variables\n"); + return 1; + } + + if (!fd->group || !fd->group->prev_timing_obj) + { + // No timing info, don't write anything. + return 0; + } + + + struct adios_group_struct * g = fd->group; + + int i, tv_size = 0; // size of the extra timing variables to be written + + int rank=0, size=1; + if (fd->comm != MPI_COMM_NULL) { + MPI_Comm_rank (fd->comm, &rank); + MPI_Comm_size (fd->comm, &size); + } + + char dim_str[256]; + char glob_dim_str[256]; + char loc_off_str[256]; + char name_timers[256]; + char name_labels[256]; + snprintf (name_timers, 256, "/__adios__/timers_%hu", + (short unsigned int)g->id); + snprintf (name_labels, 256, "/__adios__/timer_labels_%hu", + (short unsigned int)g->id); + + + int timer_count = g->prev_timing_obj->user_count + g->prev_timing_obj->internal_count; + tv_size += timer_count * size * 8; //timers + + + if (! adios_find_var_by_name (g, name_timers)) + { + if (g->adios_host_language_fortran == adios_flag_yes) { + sprintf (loc_off_str, "0,%i", rank); + sprintf (glob_dim_str, "%i,%i", timer_count, size); + sprintf (dim_str, "%i,1", timer_count); + } else { + sprintf (loc_off_str, "%i,0", rank); + sprintf (glob_dim_str, "%i,%i", size, timer_count); + sprintf (dim_str, "1,%i",timer_count); + } + + // This is the actual timing data + adios_common_define_var ((int64_t)g, // int64_t group_id + name_timers, // const char * name + "", // const char * path + adios_double, // enum ADIOS_DATATYPES type + dim_str, // const char * dimensions + glob_dim_str, // const char * global_dimensions + loc_off_str); // const char * local_offsets + } + + + int max_label_len = 0; + + for (i = 0; i < g->prev_timing_obj->user_count; i++) + { + max_label_len = MAX(max_label_len, strlen(g->prev_timing_obj->names[i])); + } + for (i = 0; i < g->prev_timing_obj->internal_count; i++) + { + max_label_len = MAX(max_label_len, strlen(g->prev_timing_obj->names[ADIOS_TIMING_MAX_USER_TIMERS + i])); + } + + tv_size += (max_label_len+1) * timer_count; + + if (! adios_find_var_by_name (g, name_labels)) + { + if (g->adios_host_language_fortran == adios_flag_yes) { + sprintf (dim_str,"%i,%i", max_label_len+1, timer_count); + } else { + sprintf (dim_str,"%i,%i", timer_count, max_label_len+1); + } + + // labels for the timers + adios_common_define_var ((int64_t)g, // int64_t group_id + name_labels, // const char * name + "", // const char * path + adios_byte, // enum ADIOS_DATATYPES type + dim_str, // const char * dimensions + "", // const char * global_dimensions + ""); // const char * local_offsets + } + + return tv_size; + +} + + +#if 0 // I don't think this is used, can be removed..? +int adios_get_timing_internal_count (int64_t fd_p, int64_t * tc) +{ + struct adios_file_struct * fd = (struct adios_file_struct *) fd_p; + if (!fd) + { + adios_error (err_invalid_file_pointer, + "Invalid handle passed to adios_get_timing_count\n"); + + return 1; + } + + if (! fd->group->prev_timing_obj) + { + *tc = 0; + } + else + { + *tc = fd->group->prev_timing_obj->internal_count; + } + + return 0; +} +#endif + +int adios_get_timing_name (int64_t fd_p, int64_t index, char* name) +{ + struct adios_file_struct * fd = (struct adios_file_struct *) fd_p; + if (!fd) + { + adios_error (err_invalid_file_pointer, + "Invalid handle passed to adios_get_timing_name\n"); + + return 1; + } + + strcpy (name, fd->group->prev_timing_obj->names[index]); + //*name = fd->group->prev_timing_obj->names[index]; + + return 0; +} + + +int adios_get_timing_value (int64_t fd_p, int64_t index, double* value) +{ + struct adios_file_struct * fd = (struct adios_file_struct *) fd_p; + if (!fd) + { + adios_error (err_invalid_file_pointer, + "Invalid handle passed to adios_get_timing_value\n"); + + return 1; + } + + *value = fd->group->prev_timing_obj->times[index]; + + return 0; +} + + +void adios_timing_go (struct adios_timing_struct * ts, int64_t index) +{ + // Grab the time + double now = MPI_Wtime(); + + // Do accounting for time summary + ts->times[index] -= now; + + // Log the event + struct adios_timing_event_struct * new_event = + &(ts->events[ts->event_count % ADIOS_TIMING_MAX_EVENTS]); + new_event->type = index; + new_event->is_start = 1; + new_event->time = now; + ts->event_count++; + +} + + +void adios_timing_stop (struct adios_timing_struct * ts, int64_t index) +{ + // Grab the time + double now = MPI_Wtime(); + + // Do accounting for time summary + ts->times[index] += now; + + // Log the event + struct adios_timing_event_struct * new_event = + &(ts->events[ts->event_count % ADIOS_TIMING_MAX_EVENTS]); + + new_event->type = index; + new_event->is_start = 0; + new_event->time = now; + ts->event_count++; +} + + +struct adios_timing_struct * adios_timing_create (int timer_count, char** timer_names) +{ + int i; + struct adios_timing_struct * ts = (struct adios_timing_struct *) + malloc (sizeof (struct adios_timing_struct) ); + + ts->internal_count = timer_count; + ts->names = (char**) malloc ( (ADIOS_TIMING_MAX_USER_TIMERS + timer_count) * sizeof (char*) ); + ts->times = (double*) malloc ( (ADIOS_TIMING_MAX_USER_TIMERS + timer_count) * sizeof (double) ); + + adios_clear_timers (ts); + + for (i = 0; i < timer_count; i++) + { + ts->names[ADIOS_TIMING_MAX_USER_TIMERS + i] = (char*) malloc (strlen(timer_names[i]) + 1 * sizeof (char) ); + strcpy (ts->names[ADIOS_TIMING_MAX_USER_TIMERS + i], timer_names[i]); + } + + return ts; +} + +void adios_clear_timers (struct adios_timing_struct * ts) +{ + ts->user_count = 0; + ts->event_count = 0; + + // Clear all timers + memset(ts->times, 0, (ADIOS_TIMING_MAX_USER_TIMERS + ts->internal_count) * sizeof (double) ); + memset(ts->names, 0, (ADIOS_TIMING_MAX_USER_TIMERS + ts->internal_count) * sizeof (char*) ); +} + +void adios_timing_destroy (struct adios_timing_struct * timing_obj) +{ + if (timing_obj) + { + + if (timing_obj->times) + { + free (timing_obj->times); + } + free (timing_obj); + } +} + +#endif // ifdef ADIOS_TIMERS + + diff --git a/tests/libs/adios/src/core/adios_timing.h b/tests/libs/adios/src/core/adios_timing.h new file mode 100644 index 0000000000..836c164c3e --- /dev/null +++ b/tests/libs/adios/src/core/adios_timing.h @@ -0,0 +1,61 @@ +/* + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + */ + +#ifndef _ADIOS_TIMING_H_ +#define _ADIOS_TIMING_H_ + + +#include + + +#define ADIOS_TIMING_MAX_USER_TIMERS 16 +#define ADIOS_TIMING_MAX_EVENTS 1024 + + +struct adios_timing_event_struct +{ + int type; // index of event type, reference timing_struct->names[type] for name of event type + int is_start; + double time; // time that the event occurred + +}; + + +struct adios_timing_struct +{ + int64_t internal_count; + int64_t user_count; + char ** names; + double *times; + + // keep the last MAX_EVENTS events, older events + // are overwritten in a circular fashion + int64_t event_count; + struct adios_timing_event_struct events[ADIOS_TIMING_MAX_EVENTS]; + +}; + +//int adios_get_timing_count (int64_t fd_p, int64_t * tc); +//int adios_get_timing_name (int64_t fd_p, int64_t index, char* name); +//int adios_get_timing_value (int64_t fd_p, int64_t index, double* value); + + +struct adios_timing_struct * adios_timing_create (int timer_count, char** timer_names); +void adios_clear_timers (struct adios_timing_struct * ts); +void adios_timing_destroy (struct adios_timing_struct * timing_obj); + +void adios_timing_go (struct adios_timing_struct * ts, int64_t index); +void adios_timing_stop (struct adios_timing_struct * ts, int64_t index); + + +void adios_timing_declare_user_timers (int64_t fd_p, int user_timer_count, char** user_timer_names); + + +/* Print out all gathered info */ +void adios_timing_write_xml_common (int64_t fd_p, const char* filename); + +#endif diff --git a/tests/libs/adios/src/core/adios_transport_hooks.c b/tests/libs/adios/src/core/adios_transport_hooks.c new file mode 100644 index 0000000000..6536da9907 --- /dev/null +++ b/tests/libs/adios/src/core/adios_transport_hooks.c @@ -0,0 +1,199 @@ +/* + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + */ + +#include "config.h" +#include "string.h" // strdup + +#ifdef _INTERNAL + /* Sequential processes can use the library compiled with -D_NOMPI */ +# define ADIOS_EMPTY_TRANSPORTS +#else + /* Parallel applications should use MPI to communicate file info and slices of data */ +#endif + +#include "adios.h" +#include "core/adios_transport_hooks.h" +#include "core/adios_bp_v1.h" +#include "core/adios_internals.h" + +#define MATCH_STRING_TO_METHOD(b,d,r) \ +if (!strcasecmp (buf,b)) \ +{*method=d;*requires_group_comm=r;return 1;} + +#define ASSIGN_FNS(a,b,name) \ +(*t) [b].method_name = strdup(name); \ +(*t) [b].adios_init_fn = adios_##a##_init; \ +(*t) [b].adios_open_fn = adios_##a##_open; \ +(*t) [b].adios_should_buffer_fn = adios_##a##_should_buffer; \ +(*t) [b].adios_write_fn = adios_##a##_write; \ +(*t) [b].adios_get_write_buffer_fn = adios_##a##_get_write_buffer; \ +(*t) [b].adios_read_fn = adios_##a##_read; \ +(*t) [b].adios_close_fn = adios_##a##_close; \ +(*t) [b].adios_finalize_fn = adios_##a##_finalize; \ +(*t) [b].adios_end_iteration_fn = adios_##a##_end_iteration; \ +(*t) [b].adios_start_calculation_fn = adios_##a##_start_calculation; \ +(*t) [b].adios_stop_calculation_fn = adios_##a##_stop_calculation; + +void adios_free_transports (struct adios_transport_struct * t) +{ + int i; + for (i=0; iID mapping here (also add ID in adios_internals.h) + // use a '1' for requires a communicator or '0' if not as the last param +#if HAVE_MPI + MATCH_STRING_TO_METHOD("MPI",ADIOS_METHOD_MPI,1) + MATCH_STRING_TO_METHOD("MPI_LUSTRE",ADIOS_METHOD_MPI_LUSTRE,1) + MATCH_STRING_TO_METHOD("MPI_AMR",ADIOS_METHOD_MPI_AMR,1) +#if HAVE_BGQ + MATCH_STRING_TO_METHOD("MPI_BGQ",ADIOS_METHOD_MPI_BGQ,1) +#endif + // Tian's method + MATCH_STRING_TO_METHOD("VAR_MERGE",ADIOS_METHOD_VAR_MERGE,1) + + MATCH_STRING_TO_METHOD("MPI_AGGREGATE",ADIOS_METHOD_MPI_AMR,1) +#ifndef NO_RESEARCH_TRANSPORTS + MATCH_STRING_TO_METHOD("MPI_STRIPE",ADIOS_METHOD_MPI_STRIPE,1) + MATCH_STRING_TO_METHOD("MPI_CIO",ADIOS_METHOD_MPI_CIO,1) + MATCH_STRING_TO_METHOD("MPI_STAGGER",ADIOS_METHOD_MPI_STAGGER,1) + MATCH_STRING_TO_METHOD("MPI_AGGREGATE1",ADIOS_METHOD_MPI_AGG,1) + MATCH_STRING_TO_METHOD("MPI_AMR1",ADIOS_METHOD_MPI_AMR1,1) + MATCH_STRING_TO_METHOD("ADAPTIVE",ADIOS_METHOD_ADAPTIVE,1) +#endif +#endif + +#if NO_DATATAP == 0 + MATCH_STRING_TO_METHOD("DATATAP",ADIOS_METHOD_DATATAP,0) + MATCH_STRING_TO_METHOD("PBIO",ADIOS_METHOD_DATATAP,0) +#endif + + MATCH_STRING_TO_METHOD("POSIX",ADIOS_METHOD_POSIX,0) + MATCH_STRING_TO_METHOD("POSIX1",ADIOS_METHOD_POSIX1,0) + MATCH_STRING_TO_METHOD("FB",ADIOS_METHOD_POSIX,0) + +#if HAVE_DATASPACES + MATCH_STRING_TO_METHOD("DART",ADIOS_METHOD_DATASPACES,1) + MATCH_STRING_TO_METHOD("DATASPACES",ADIOS_METHOD_DATASPACES,1) +#endif + +#if HAVE_DIMES + MATCH_STRING_TO_METHOD("DIMES",ADIOS_METHOD_DIMES,1) +#endif + +#if HAVE_PHDF5 + MATCH_STRING_TO_METHOD("PHDF5",ADIOS_METHOD_PHDF5,1) +#endif + +#if HAVE_NC4PAR + MATCH_STRING_TO_METHOD("NC4",ADIOS_METHOD_NC4,1) +#endif + +#if HAVE_FLEXPATH + MATCH_STRING_TO_METHOD("FLEXPATH",ADIOS_METHOD_FLEXPATH,0) +#endif +#if HAVE_ICEE + MATCH_STRING_TO_METHOD("ICEE",ADIOS_METHOD_ICEE,0) +#endif + +#if HAVE_NSSI + MATCH_STRING_TO_METHOD("NSSI",ADIOS_METHOD_NSSI_STAGING,1) + MATCH_STRING_TO_METHOD("NSSI_FILTER",ADIOS_METHOD_NSSI_FILTER,1) +#endif + +#ifndef NO_RESEARCH_TRANSPORTS + MATCH_STRING_TO_METHOD("PROVENANCE",ADIOS_METHOD_PROVENANCE,1) +#endif + + MATCH_STRING_TO_METHOD("NULL",ADIOS_METHOD_NULL,0) + + *method = ADIOS_METHOD_UNKNOWN; + *requires_group_comm = 0; + + return 0; +} diff --git a/tests/libs/adios/src/core/adios_transport_hooks.h b/tests/libs/adios/src/core/adios_transport_hooks.h new file mode 100644 index 0000000000..8161dc5b91 --- /dev/null +++ b/tests/libs/adios/src/core/adios_transport_hooks.h @@ -0,0 +1,181 @@ +/* + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + */ + +#ifndef ADIOS_TRANSPORT_HOOKS_H +#define ADIOS_TRANSPORT_HOOKS_H + +#include "config.h" +#include +#include +#include "core/util.h" /* PairStruct* */ +#include "public/adios_mpi.h" + +#define FORWARD_DECLARE_EMPTY(a) \ +void adios_##a##_init (const PairStruct * parameters \ + ,struct adios_method_struct * method \ + ) {} \ +int adios_##a##_open (struct adios_file_struct * fd \ + ,struct adios_method_struct * method, MPI_Comm comm \ + ) {return 0;} \ +enum ADIOS_FLAG adios_##a##_should_buffer (struct adios_file_struct * fd \ + ,struct adios_method_struct * method \ + ) {return 0;} \ +void adios_##a##_write (struct adios_file_struct * fd \ + ,struct adios_var_struct * v \ + ,void * data \ + ,struct adios_method_struct * method \ + ) {} \ +void adios_##a##_get_write_buffer (struct adios_file_struct * fd \ + ,struct adios_var_struct * v \ + ,uint64_t * size \ + ,void ** buffer \ + ,struct adios_method_struct * method \ + ) {} \ +void adios_##a##_read (struct adios_file_struct * fd \ + ,struct adios_var_struct * v \ + ,void * buffer \ + ,uint64_t buffer_size \ + ,struct adios_method_struct * method \ + ) {} \ +void adios_##a##_close (struct adios_file_struct * fd \ + ,struct adios_method_struct * method \ + ) {} \ +void adios_##a##_finalize (int mype, struct adios_method_struct * method) {} \ +void adios_##a##_end_iteration (struct adios_method_struct * method) {} \ +void adios_##a##_start_calculation (struct adios_method_struct * method) {} \ +void adios_##a##_stop_calculation (struct adios_method_struct * method) {} + +#define FORWARD_DECLARE(a) \ +void adios_##a##_init (const PairStruct * parameters \ + ,struct adios_method_struct * method \ + ); \ +int adios_##a##_open (struct adios_file_struct * fd \ + ,struct adios_method_struct * method, MPI_Comm comm \ + ); \ +enum ADIOS_FLAG adios_##a##_should_buffer (struct adios_file_struct * fd \ + ,struct adios_method_struct * method \ + ); \ +void adios_##a##_write (struct adios_file_struct * fd \ + ,struct adios_var_struct * v \ + ,void * data \ + ,struct adios_method_struct * method \ + ); \ +void adios_##a##_get_write_buffer (struct adios_file_struct * fd \ + ,struct adios_var_struct * v \ + ,uint64_t * size \ + ,void ** buffer \ + ,struct adios_method_struct * method \ + ); \ +void adios_##a##_read (struct adios_file_struct * fd \ + ,struct adios_var_struct * v \ + ,void * buffer \ + ,uint64_t buffer_size \ + ,struct adios_method_struct * method \ + ); \ +void adios_##a##_close (struct adios_file_struct * fd \ + ,struct adios_method_struct * method \ + ); \ +void adios_##a##_finalize (int mype, struct adios_method_struct * method); \ +void adios_##a##_end_iteration (struct adios_method_struct * method); \ +void adios_##a##_start_calculation (struct adios_method_struct * method); \ +void adios_##a##_stop_calculation (struct adios_method_struct * method); +//#endif + +/////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////// +//// SETUP YOUR NEW TRANSPORT METHODS BELOW (FOLLOW THE PATTERN): //// +//// 1. Add an entry to the ADIOS_IO_METHOD updating the ADIOS_METHOD_COUNT//// +//// 2. Add a FOWARD_DECLARE line (assuming standard naming) //// +//// 3. Add an entry to ADIOS_PARSE_METHOD_SETUP for the string and ID //// +//// 4. Add an entry to ADIOS_INIT_TRANSPORTS_SETUP for name to ID //// +/////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////// + +struct adios_method_struct; +struct adios_file_struct; +struct adios_var_struct; +// the list of the methods that have been integrated +// VTK and POSIX_ASCII are placeholders reserved for future use +enum ADIOS_IO_METHOD {ADIOS_METHOD_UNKNOWN = -2 + ,ADIOS_METHOD_NULL = -1 + ,ADIOS_METHOD_MPI = 0 + ,ADIOS_METHOD_DATATAP = 1 + ,ADIOS_METHOD_POSIX = 2 + ,ADIOS_METHOD_DATASPACES = 3 + ,ADIOS_METHOD_VTK = 4 + ,ADIOS_METHOD_POSIX_ASCII = 5 + ,ADIOS_METHOD_MPI_CIO = 6 + ,ADIOS_METHOD_PHDF5 = 7 + ,ADIOS_METHOD_PROVENANCE = 8 + ,ADIOS_METHOD_MPI_STRIPE = 9 + ,ADIOS_METHOD_MPI_LUSTRE = 10 + ,ADIOS_METHOD_MPI_STAGGER = 11 + ,ADIOS_METHOD_MPI_AGG = 12 + ,ADIOS_METHOD_ADAPTIVE = 13 + ,ADIOS_METHOD_POSIX1 = 14 + ,ADIOS_METHOD_NC4 = 15 + ,ADIOS_METHOD_MPI_AMR = 16 + ,ADIOS_METHOD_MPI_AMR1 = 17 + ,ADIOS_METHOD_FLEXPATH = 18 + ,ADIOS_METHOD_NSSI_STAGING = 19 + ,ADIOS_METHOD_NSSI_FILTER = 20 + ,ADIOS_METHOD_DIMES = 21 + ,ADIOS_METHOD_VAR_MERGE = 22 + ,ADIOS_METHOD_MPI_BGQ = 23 + ,ADIOS_METHOD_ICEE = 24 + ,ADIOS_METHOD_COUNT = 25 +}; + +// forward declare the functions (or dummies for internals use) +#if !defined(_NOMPI) || !defined (ADIOS_EMPTY_TRANSPORTS) + FORWARD_DECLARE(mpi) + FORWARD_DECLARE(mpi_lustre) + //FORWARD_DECLARE(mpi_cio) + //FORWARD_DECLARE(mpi_stripe) + //FORWARD_DECLARE(mpi_stagger) + //FORWARD_DECLARE(mpi_aggregate) + FORWARD_DECLARE(mpi_amr) +#if HAVE_BGQ + FORWARD_DECLARE(mpi_bgq) +#endif + //FORWARD_DECLARE(mpi_amr1) + FORWARD_DECLARE(phdf5) + FORWARD_DECLARE(nc4) + FORWARD_DECLARE(nssi) + FORWARD_DECLARE(nssi_filter) + FORWARD_DECLARE(flexpath) + FORWARD_DECLARE(var_merge) +#endif + +#ifdef ADIOS_EMPTY_TRANSPORTS + //FORWARD_DECLARE_EMPTY(datatap) + FORWARD_DECLARE_EMPTY(posix) + FORWARD_DECLARE_EMPTY(posix1) + //FORWARD_DECLARE_EMPTY(provenance) + //FORWARD_DECLARE_EMPTY(adaptive) +#else + FORWARD_DECLARE(datatap) + FORWARD_DECLARE(posix) + FORWARD_DECLARE(posix1) + FORWARD_DECLARE(provenance) + FORWARD_DECLARE(adaptive) +#endif + +#if defined(HAVE_DATASPACES) && !defined(ADIOS_EMPTY_TRANSPORTS) +FORWARD_DECLARE(dataspaces) +#endif + +#if defined(HAVE_DIMES) && !defined(ADIOS_EMPTY_TRANSPORTS) +FORWARD_DECLARE(dimes) +#endif + +#if defined(HAVE_ICEE) && !defined(ADIOS_EMPTY_TRANSPORTS) +FORWARD_DECLARE(icee) +#endif + +#undef FORWARD_DECLARE +#endif diff --git a/tests/libs/adios/src/core/adiosf.c b/tests/libs/adios/src/core/adiosf.c new file mode 100644 index 0000000000..bc81a19798 --- /dev/null +++ b/tests/libs/adios/src/core/adiosf.c @@ -0,0 +1,1198 @@ +/* + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + */ + +#include "config.h" +#include +#include +#include + +#include "core/adios_internals.h" +#include "core/adios_internals_mxml.h" +#include "core/common_adios.h" +#include "core/adios_transport_hooks.h" +#include "core/futils.h" +#include "core/globals.h" +#include "adios_error.h" +#include "core/adios_logger.h" +#include "core/adios_timing.h" + +#ifdef __cplusplus +extern "C" /* prevent C++ name mangling */ +#endif + + +#ifdef BUILD_WITH_CMAKE + #include "FC.h" +#endif + +extern int adios_errno; + +/////////////////////////////////////////////////////////////////////////////// +void FC_FUNC_(adios_set_application_id, ADIOS_SET_APPLICATION_ID) (int *id, int * err) +{ + globals_adios_set_application_id (*id); + if (err != 0) *err = err_no_error; +} + +/////////////////////////////////////////////////////////////////////////////// +void FC_FUNC_(adios_init, ADIOS_INIT) (const char * config, MPI_Fint * comm, int * err, int config_size) +{ + char * buf1 = 0; + + MPI_Comm c_comm = MPI_Comm_f2c (*comm); + buf1 = futils_fstr_to_cstr (config, config_size); + if (buf1 != 0) { + *err = common_adios_init (buf1, c_comm); + free (buf1); + } else { + *err = adios_errno; + } +} + +/////////////////////////////////////////////////////////////////////////////// +void FC_FUNC_(adios_init_noxml, ADIOS_INIT_LOCAL) (MPI_Fint * comm, int * err) +{ + MPI_Comm c_comm = MPI_Comm_f2c (*comm); + *err = common_adios_init_noxml (c_comm); +} + +/////////////////////////////////////////////////////////////////////////////// +void FC_FUNC_(adios_finalize, ADIOS_FINALIZE) (int * mype, int * err) +{ + *err = common_adios_finalize (*mype); +} + +/////////////////////////////////////////////////////////////////////////////// +void FC_FUNC_(adios_allocate_buffer, ADIOS_ALLOCATE_BUFFER) (int *sizeMB, int * err) +{ + //FIX + *err = common_adios_allocate_buffer (1 /*NOW*/, *sizeMB); +} + +/////////////////////////////////////////////////////////////////////////////// +void FC_FUNC_(adios_open, ADIOS_OPEN) + (int64_t * fd, const char * group_name, const char * name + ,const char * mode, MPI_Fint *comm, int * err + ,int group_name_size, int name_size, int mode_size + ) +{ + char * buf1 = 0; + char * buf2 = 0; + char * buf3 = 0; + MPI_Comm c_comm = MPI_Comm_f2c (*comm); + + buf1 = futils_fstr_to_cstr (group_name, group_name_size); + buf2 = futils_fstr_to_cstr (name, name_size); + buf3 = futils_fstr_to_cstr (mode, mode_size); + + if (buf1 != 0 && buf2 != 0 && buf3 != 0) { + *err = common_adios_open (fd, buf1, buf2, buf3, c_comm); + free (buf1); + free (buf2); + free (buf3); + } else { + *err = adios_errno; + } +} + +/////////////////////////////////////////////////////////////////////////////// +void FC_FUNC_(adios_group_size, ADIOS_GROUP_SIZE) + (int64_t * fd_p, int64_t * data_size + ,int64_t * total_size, int * err + ) +{ + *err = common_adios_group_size (*fd_p, (uint64_t) *data_size + ,(uint64_t *) total_size + ); +} + +/////////////////////////////////////////////////////////////////////////////// +#include "stdio.h" +void FC_FUNC_(adios_write_byid, ADIOS_WRITE_BYID) + (int64_t * fd_p, int64_t * id, void * var + ,int * err, int var_size + ) +{ + struct adios_file_struct * fd = (struct adios_file_struct *) *fd_p; + if (!fd) + { + adios_error (err_invalid_file_pointer, "Invalid handle passed to adios_write\n"); + *err = adios_errno; + return; + } + + struct adios_var_struct * v = (struct adios_var_struct *) *id; + if (!v) + { + adios_error (err_invalid_varid, "Invalid id passed to adios_write_byid\n"); + *err = adios_errno; + return; + } + + struct adios_method_list_struct * m = fd->group->methods; + + if (m && m->next == NULL && m->method->m == ADIOS_METHOD_NULL) + { + // nothing to do so just return + *err = err_no_error; + return; + } + + if (!var) + { + adios_error (err_invalid_data, "Invalid data (NULL pointer) passed to write\n"); + *err = adios_errno; + return; + } + + *err = common_adios_write_byid (fd, v, var); +} + +/* Name clash resolution: Fortran adios_write_byid is an interface, and its + subroutines cannot call adios_write_byid() in this file directly because + the Fortran compiler interprets it as the call to the interface name. + adios_write_byid_f2c provides the bridge to link the C function with + the subroutines. +*/ +void FC_FUNC_(adios_write_byid_f2c, ADIOS_WRITE_BYID_F2C) + (int64_t * fd_p, int64_t * id, void * var, int * err, int var_size) +{ + FC_FUNC_(adios_write_byid, ADIOS_WRITE) (fd_p, id, var, err, var_size); +} + +/* This Fortran api function is a bit different from the C api funcion, but + * they call the same common_adios_write(). + * Difference: if the variable is string type then we need to convert + * the void * var to a C string (add \0 to the end) + * We rely on the assumption/fact that Fortran compilers pass on the + * length of a character array in an extra integer argument, even if + * the C function declares a void* array in the argument list. + */ +void FC_FUNC_(adios_write, ADIOS_WRITE) + (int64_t * fd_p, const char * name, void * var, int * err + ,int name_size, int var_size + ) +{ + struct adios_file_struct * fd = (struct adios_file_struct *) *fd_p; + if (!fd) + { + adios_error (err_invalid_file_pointer, "Invalid handle passed to adios_write\n"); + *err = adios_errno; + return; + } + + struct adios_var_struct * v = fd->group->vars; + struct adios_method_list_struct * m = fd->group->methods; + + if (m && m->next == NULL && m->method->m == ADIOS_METHOD_NULL) + { + // nothing to do so just return + *err = err_no_error; + return; + } + + char * buf1 = 0; + buf1 = futils_fstr_to_cstr (name, name_size); + + //printf(" -- adios_write: name=[%s] var size = %d\n", buf1, var_size); + + if (!buf1) { + *err = adios_errno; + return; + } + + v = adios_find_var_by_name (fd->group, buf1); + + if (!v) + { + adios_error (err_invalid_varname, "Bad var name (ignored): '%s'\n", buf1); + *err = adios_errno; + free (buf1); + return; + } + + if (fd->mode == adios_mode_read) + { + if ( strcasecmp (buf1, fd->group->group_comm) + && v->is_dim != adios_flag_yes + ) + { + adios_error (err_invalid_file_mode, "write attempted on %s in %s. This was opened for read\n" ,buf1 , fd->name); + *err = adios_errno; + free (buf1); + return; + } + } + + /* // Do not check NULL pointer here, it works fine in writing + if (!var) + { + adios_error (err_invalid_data, "Invalid data (NULL pointer) passed to write for variable %s\n", buf1); + *err = adios_errno; + free (buf1); + return; + } + */ + + if (v->data) + { + free (v->data); + v->data = 0; + } + + // Q.L. 10-2010. To fix a memory leak problem. + // NCSU - Clear stats + if (v->stats) + { + int j, idx; + int c, count = 1; + + if (v->type == adios_complex || v->type == adios_double_complex) + count = 3; + + for (c = 0; c < count; c ++) + { + j = idx = 0; + while (v->bitmap >> j) + { + if (v->bitmap >> j & 1) + { + if (j == adios_statistic_hist) + { + struct adios_index_characteristics_hist_struct * hist = + (struct adios_index_characteristics_hist_struct *) v->stats[c][idx].data; + free (hist->breaks); + free (hist->frequencies); + free (hist); + v->stats[c][idx].data = 0; + } + else + { + free (v->stats[c][idx].data); + v->stats[c][idx].data = 0; + } + idx ++; + } + j ++; + } + } + } + + if (v->dimensions) + { + v->data = var; + } + else + { + uint64_t element_size = adios_get_type_size (v->type, var); + + switch (v->type) + { + case adios_byte: + case adios_short: + case adios_integer: + case adios_long: + case adios_unsigned_byte: + case adios_unsigned_short: + case adios_unsigned_integer: + case adios_unsigned_long: + case adios_real: + case adios_double: + case adios_long_double: + case adios_complex: + case adios_double_complex: + v->data = malloc (element_size); + if (!v->data) + { + adios_error (err_no_memory, + "In adios_write, cannot allocate %lld bytes to copy scalar %s\n", + element_size, v->name); + *err = adios_errno; + free (buf1); + return; + } + + memcpy ((char *) v->data, var, element_size); + break; + case adios_string: + v->data = futils_fstr_to_cstr (var, var_size); + if (!v->data) + { + adios_error (err_no_memory, + "In adios_write, cannot allocate %lld bytes to copy string %s\n", + element_size, v->name); + *err = adios_errno; + free (buf1); + return; + } + break; + + default: + v->data = 0; + break; + } + } + + *err = common_adios_write (fd, v, var); + if (fd->mode == adios_mode_write || fd->mode == adios_mode_append) + { + adios_copy_var_written (fd->group, v); + } + + free (buf1); +} + +/* Name clash resolution: Fortran adios_write is an interface, and its subroutines cannot call + adios_write() in this file directly because the Fortran compiler interprets it as the + call to the interface name. adios_write_f2c provides the bridge to link the C function with + the subroutines. +*/ +void FC_FUNC_(adios_write_f2c, ADIOS_WRITE_F2C) + (int64_t * fd_p, const char * name, void * var, int * err,int name_size, int var_size) +{ + FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); +} + +/////////////////////////////////////////////////////////////////////////////// +void FC_FUNC_(adios_get_write_buffer, ADIOS_GET_WRITE_BUFFER) + (int64_t * fd_p, const char * name + ,int64_t * size + ,void ** buffer, int * err, int name_size + ) +{ + char * buf1 = 0; + + buf1 = futils_fstr_to_cstr (name, name_size); + + if (buf1 != 0) { + *err = common_adios_get_write_buffer (*fd_p, buf1, (uint64_t *) size, buffer); + free (buf1); + } else { + *err = adios_errno; + } +} + +/////////////////////////////////////////////////////////////////////////////// +void FC_FUNC_(adios_read, ADIOS_READ) + (int64_t * fd_p, const char * name, void * buffer + ,int64_t * buffer_size, int * err, int name_size + ) +{ + char * buf1 = 0; + + buf1 = futils_fstr_to_cstr (name, name_size); + + if (buf1 != 0) { + *err = common_adios_read (*fd_p, buf1, buffer, *buffer_size); + free (buf1); + } else { + *err = adios_errno; + } +} + +void FC_FUNC_(adios_read_f2c, ADIOS_READ_F2C) + (int64_t * fd_p, const char * name, void * buffer,int64_t * buffer_size, int * err, int name_size) +{ + FC_FUNC_(adios_read, ADIOS_READ) + (fd_p, name, buffer, buffer_size, err, name_size); +} + +/////////////////////////////////////////////////////////////////////////////// +void FC_FUNC_(adios_set_path, ADIOS_SET_PATH) + (int64_t * fd_p, const char * path, int * err, int path_size) +{ + char * buf1 = 0; + + buf1 = futils_fstr_to_cstr (path, path_size); + + if (buf1 != 0) { + *err = common_adios_set_path (*fd_p, buf1); + free (buf1); + } else { + *err = adios_errno; + } +} + +/////////////////////////////////////////////////////////////////////////////// +void FC_FUNC_(adios_set_path_var, ADIOS_SET_PATH_VAR) + (int64_t * fd_p, const char * path, const char * name, int * err, int path_size, int name_size) +{ + char * buf1 = 0; + char * buf2 = 0; + + buf1 = futils_fstr_to_cstr (path, path_size); + buf2 = futils_fstr_to_cstr (name, name_size); + + if (buf1 != 0 && buf2 != 0) { + *err = common_adios_set_path_var (*fd_p, buf1, buf2); + free (buf1); + free (buf2); + } else { + *err = adios_errno; + } +} + +/////////////////////////////////////////////////////////////////////////////// +// hint that we reached the end of an iteration (for asynchronous pacing) +void FC_FUNC_(adios_end_iteration, ADIOS_END_ITERATION) (int * err) +{ + *err = common_adios_end_iteration (); +} + +/////////////////////////////////////////////////////////////////////////////// +// hint to start communicating +void FC_FUNC_(adios_start_calculation, ADIOS_START_CALCULATION) (int * err) +{ + *err = common_adios_start_calculation (); +} + +/////////////////////////////////////////////////////////////////////////////// +// hint to stop communicating +void FC_FUNC_(adios_stop_calculation, ADIOS_STOP_CALCULATION) (int * err) +{ + *err = common_adios_stop_calculation (); +} + +/////////////////////////////////////////////////////////////////////////////// +void FC_FUNC_(adios_close, ADIOS_CLOSE) (int64_t * fd_p, int * err) +{ + *err = common_adios_close (*fd_p); +} + +/////////////////////////////////////////////////////////////////////////////// +void FC_FUNC_(adios_timing_write_xml, ADIOS_TIMING_WRITE_XML) (int64_t * fd_p, const char* filename, int filename_size) +{ + char * cfile = 0; + cfile = futils_fstr_to_cstr (filename, filename_size); + + // defined in adios_timing.c + adios_timing_write_xml_common (*fd_p, cfile); +} + + + +////////////////////////////////////////////////////////////////////////////// +// Methods normally only called by the XML parser +////////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////////////////////////////// +// adios_common_declare_group is in adios_internals.c +// group a list of vars into a composite group +void FC_FUNC_(adios_declare_group, ADIOS_DECLARE_GROUP) + (int64_t * id, const char * name + ,const char * time_index, enum ADIOS_FLAG *stats + ,int * err, int name_size, int time_index_size + ) +{ + char * buf1 = 0; + char * buf2 = 0; + + adios_errno = err_no_error; + buf1 = futils_fstr_to_cstr (name, name_size); + buf2 = futils_fstr_to_cstr (time_index, time_index_size); + + if (buf1 != 0 && buf2 != 0) { + int ret = adios_common_declare_group (id, buf1, adios_flag_yes, "", "", buf2, *stats); + free (buf1); + free (buf2); + if (ret == 1) { + struct adios_group_struct * g = (struct adios_group_struct *) *id; + g->all_unique_var_names = adios_flag_no; + } + } + *err = adios_errno; +} + +/////////////////////////////////////////////////////////////////////////////// +// adios_common_define_var is in adios_internals.c +// declare a single var as an entry in a group +void FC_FUNC_(adios_define_var, ADIOS_DEFINE_VAR) + (int64_t * group_id, const char * name + ,const char * path, int * type + ,const char * dimensions + ,const char * global_dimensions + ,const char * local_offsets, int64_t * id + ,int name_size, int path_size, int dimensions_size + ,int global_dimensions_size, int local_offsets_size + ) +{ + char * buf1 = 0; + char * buf2 = 0; + char * buf3 = 0; + char * buf4 = 0; + char * buf5 = 0; + + adios_errno = err_no_error; + buf1 = futils_fstr_to_cstr (name, name_size); + buf2 = futils_fstr_to_cstr (path, path_size); + buf3 = futils_fstr_to_cstr (dimensions, dimensions_size); + buf4 = futils_fstr_to_cstr (global_dimensions, global_dimensions_size); + buf5 = futils_fstr_to_cstr (local_offsets, local_offsets_size); + + if (buf1 != 0 && buf2 != 0) { + *id = adios_common_define_var (*group_id, buf1, buf2 + ,(enum ADIOS_DATATYPES) *type + ,buf3, buf4, buf5); + + free (buf1); + free (buf2); + free (buf3); + free (buf4); + free (buf5); + } else { + *id = 0; + } +} + +// delete all variable definitions from a group +// Use if you want to define a new set of variables for the next output step. +void FC_FUNC_(adios_delete_vardefs, ADIOS_DELETE_VARDEFS) (int64_t *id, int *err) +{ + adios_errno = err_no_error; + if (id != 0) { + struct adios_group_struct * g = (struct adios_group_struct *) *id; + *err = adios_common_delete_vardefs (g); + } else { + adios_error (err_invalid_group, "adios_delete_vardefs() called with 0 argument\n"); + *err = adios_errno; + } +} + +/////////////////////////////////////////////////////////////////////////////// +// adios_common_set_transform is in adios_internals.c +// set the transform method for the selected variable (default is "none") +void FC_FUNC_(adios_set_transform, ADIOS_SET_TRANSFORM) + (int64_t * var_id, const char *transform_type_str, int *err, + int str_size) +{ + char * buf1 = 0; + adios_errno = err_no_error; + buf1 = futils_fstr_to_cstr (transform_type_str, str_size); + if (buf1 != 0) { + *err = adios_common_set_transform (*var_id, buf1); + free (buf1); + } else { + *err = adios_errno; + } +} +/////////////////////////////////////////////////////////////////////////////// +// adios_common_define_attribute is in adios_internals.c +void FC_FUNC_(adios_define_attribute, ADIOS_DEFINE_ATTRIBUTE) + (int64_t * group, const char * name + ,const char * path, int * type, const char * value + ,const char * var, int * err + ,int name_size, int path_size, int value_size + ,int var_size + ) +{ + char * buf1 = 0; + char * buf2 = 0; + char * buf3 = 0; + char * buf4 = 0; + + adios_errno = err_no_error; + buf1 = futils_fstr_to_cstr (name, name_size); + buf2 = futils_fstr_to_cstr (path, path_size); + buf3 = futils_fstr_to_cstr (value, value_size); + buf4 = futils_fstr_to_cstr (var, var_size); + + if (buf1 != 0 && buf2 != 0 && buf3 != 0 && buf4 != 0) { + adios_common_define_attribute (*group, buf1, buf2 + ,(enum ADIOS_DATATYPES) *type, buf3 + ,buf4 + ); + free (buf1); + free (buf2); + free (buf3); + free (buf4); + } + *err = adios_errno; +} + +// delete all attribute definitions from a group +// Use if you want to define a new set of attribute for the next output step. +void FC_FUNC_(adios_delete_attrdefs, ADIOS_DELETE_VARDEFS) (int64_t *id, int *err) +{ + adios_errno = err_no_error; + if (id != 0) { + struct adios_group_struct * g = (struct adios_group_struct *) *id; + *err = adios_common_delete_attrdefs (g); + } else { + adios_error (err_invalid_group, "adios_delete_attrdefs() called with 0 argument\n"); + *err = adios_errno; + } +} + +/////////////////////////////////////////////////////////////////////////////// +// adios_common_select_method is in adios_internals_mxml.c +void FC_FUNC_(adios_select_method, ADIOS_SELECT_METHOD) + (int64_t * group, const char * method + ,const char * parameters, const char * base_path + ,int * err, int method_size, int parameters_size + ,int base_path_size + ) +{ + char * buf1 = 0; + char * buf2 = 0; + char * buf3 = 0; + + adios_errno = err_no_error; + buf1 = futils_fstr_to_cstr (method, method_size); + buf2 = futils_fstr_to_cstr (parameters, parameters_size); + buf3 = futils_fstr_to_cstr (base_path, base_path_size); + + if (buf1 != 0 && buf2 != 0 && buf3 != 0) { + struct adios_group_struct * g = (struct adios_group_struct *) (* group); + adios_common_select_method (0, buf1, buf2, g->name, buf3, 0); + + free (buf1); + free (buf2); + free (buf3); + } + *err = adios_errno; +} + +// no-xml schema API +/////////////////////////////////////////////////////////////////////////////// +void FC_FUNC_(adios_define_schema_version, ADIOS_DEFINE_SCHEMA_VERSION) + (int64_t * group_id, char * schema_version + ,int schema_version_size) +{ + char * buf1 = 0; + buf1 = futils_fstr_to_cstr (schema_version, schema_version_size); + if (buf1 != 0) + { +// printf ("call adios_define_schema_version in adiosf.c\n"); +// printf ("schema_version is %s\n", buf1); + struct adios_group_struct * g = (struct adios_group_struct *) *group_id; + adios_common_define_schema_version (g, buf1); + } + free (buf1); +} + +/////////////////////////////////////////////////////////////////////////////// +void FC_FUNC_(adios_define_var_mesh, ADIOS_DEFINE_VAR_MESH) + (int64_t * group_id, const char * varname, const char * meshname + ,int varname_size, int meshname_size) +{ + char * buf1 = 0; + char * buf2 = 0; + buf1 = futils_fstr_to_cstr (varname, varname_size); + buf2 = futils_fstr_to_cstr (meshname, meshname_size); + + if (buf1 != 0 && buf2 != 0) + adios_common_define_var_mesh (*group_id, buf1, buf2, ""); + + free (buf1); + free (buf2); +} + +/////////////////////////////////////////////////////////////////////////////// +void FC_FUNC_(adios_define_var_centering, ADIOS_DEFINE_VAR_CENTERING) + (int64_t * group_id, const char * varname, const char * centering + , int varname_size, int centering_size) +{ + char * buf1 = 0; + char * buf2 = 0; + buf1 = futils_fstr_to_cstr (varname, varname_size); + buf2 = futils_fstr_to_cstr (centering, centering_size); + if (buf1 != 0 && buf2 != 0) + adios_common_define_var_centering (*group_id, buf1, buf2, ""); + + free (buf1); + free (buf2); +} + +/////////////////////////////////////////////////////////////////////////////// +void FC_FUNC_(adios_define_mesh_timevarying, ADIOS_DEFINE_MESH_TIMEVARYING) + (const char * timevarying, int64_t * group_id, const char * name + ,int timevarying_size, int name_size) +{ + char * buf1 = 0; + char * buf2 = 0; + buf1 = futils_fstr_to_cstr (timevarying, timevarying_size); + buf2 = futils_fstr_to_cstr (name, name_size); + if (buf1 != 0 && buf2 != 0) + adios_common_define_mesh_timeVarying (buf1, *group_id, buf2); + + free (buf1); + free (buf2); +} + +/////////////////////////////////////////////////////////////////////////////// +void FC_FUNC_(adios_define_mesh_file, ADIOS_DEFINE_MESH_FILE) + (int64_t * group_id, char * name, char * file + ,int name_size, int file_size) +{ + char * buf1 = 0; + char * buf2 = 0; + buf1 = futils_fstr_to_cstr (name, name_size); + buf2 = futils_fstr_to_cstr (file, file_size); + if (buf1 != 0 && buf2 != 0) + adios_common_define_mesh_file (*group_id, buf1, buf2); + + free (buf1); + free (buf2); +} + +/////////////////////////////////////////////////////////////////////////////// +void FC_FUNC_(adios_define_var_timesteps, ADIOS_DEFINE_VAR_TIMESTEPS) + (const char * timesteps, int64_t * group_id, const char * name + ,int timesteps_size, int name_size) +{ + char * buf1 = 0; + char * buf2 = 0; + buf1 = futils_fstr_to_cstr (timesteps, timesteps_size); + buf2 = futils_fstr_to_cstr (name, name_size); + struct adios_group_struct * g = (struct adios_group_struct *) *group_id; + adios_common_define_var_timesteps (buf1, g, buf2, ""); + free (buf1); + free (buf2); +} + +/////////////////////////////////////////////////////////////////////////////// +void FC_FUNC_(adios_define_var_timescale, ADIOS_DEFINE_VAR_TIMESCALE) + (const char * timescale, int64_t * group_id, const char * name + ,int timescale_size, int name_size) +{ + char * buf1 = 0; + char * buf2 = 0; + buf1 = futils_fstr_to_cstr (timescale, timescale_size); + buf2 = futils_fstr_to_cstr (name, name_size); + struct adios_group_struct * g = (struct adios_group_struct *) *group_id; + adios_common_define_var_timescale (buf1, g, buf2, ""); + free (buf1); + free (buf2); +} + +/////////////////////////////////////////////////////////////////////////////// +void FC_FUNC_(adios_define_var_timeseriesformat, ADIOS_DEFINE_VAR_TIMESERIESFORMAT) + (const char * timeseries, int64_t * group_id, const char * name + ,int timeseries_size, int name_size) +{ + char * buf1 = 0; + char * buf2 = 0; + buf1 = futils_fstr_to_cstr (timeseries, timeseries_size); + buf2 = futils_fstr_to_cstr (name, name_size); + struct adios_group_struct * g = (struct adios_group_struct *) *group_id; + adios_common_define_var_timeseriesformat (buf1, g, buf2, ""); + free (buf1); + free (buf2); +} + +/////////////////////////////////////////////////////////////////////////////// +void FC_FUNC_(adios_define_var_hyperslab, ADIOS_DEFINE_VAR_HYPERSLAB) + (const char * hyperslab, int64_t * group_id, const char * name + ,int hyperslab_size, int name_size) +{ + char * buf1 = 0; + char * buf2 = 0; + buf1 = futils_fstr_to_cstr (hyperslab, hyperslab_size); + buf2 = futils_fstr_to_cstr (name, name_size); + struct adios_group_struct * g = (struct adios_group_struct *) *group_id; + adios_common_define_var_hyperslab (buf1, g, buf2, ""); + free (buf1); + free (buf2); +} + +/////////////////////////////////////////////////////////////////////////////// +void FC_FUNC_(adios_define_mesh_timesteps, ADIOS_DEFINE_MESH_TIMESTEPS) + (const char * timesteps, int64_t * group_id, const char * name + ,int timesteps_size, int name_size) +{ + char * buf1 = 0; + char * buf2 = 0; + buf1 = futils_fstr_to_cstr (timesteps, timesteps_size); + buf2 = futils_fstr_to_cstr (name, name_size); + struct adios_group_struct * g = (struct adios_group_struct *) *group_id; + adios_common_define_mesh_timeSteps (buf1, g, buf2); + free (buf1); + free (buf2); +} + +/////////////////////////////////////////////////////////////////////////////// +void FC_FUNC_(adios_define_mesh_timescale, ADIOS_DEFINE_MESH_TIMESCALE) + (const char * timescale, int64_t * group_id, const char * name + ,int timescale_size, int name_size) +{ + char * buf1 = 0; + char * buf2 = 0; + buf1 = futils_fstr_to_cstr (timescale, timescale_size); + buf2 = futils_fstr_to_cstr (name, name_size); + struct adios_group_struct * g = (struct adios_group_struct *) *group_id; + adios_common_define_mesh_timeScale (buf1, g, buf2); + free (buf1); + free (buf2); +} + +/////////////////////////////////////////////////////////////////////////////// +void FC_FUNC_(adios_define_mesh_timeseriesformat, ADIOS_DEFINE_MESH_TIMESERIESFORMAT) + (const char * timeseries, int64_t * group_id, const char * name + ,int timeseries_size, int name_size) +{ + char * buf1 = 0; + char * buf2 = 0; + buf1 = futils_fstr_to_cstr (timeseries, timeseries_size); + buf2 = futils_fstr_to_cstr (name, name_size); + struct adios_group_struct * g = (struct adios_group_struct *) *group_id; + adios_common_define_mesh_timeSeriesFormat (buf1, g, buf2); + free (buf1); + free (buf2); +} + +/////////////////////////////////////////////////////////////////////////////// +void FC_FUNC_(adios_define_mesh_group, ADIOS_DEFINE_MESH_GROUP) + (const char * group, int64_t * group_id, const char * name + ,int group_size, int name_size) +{ + char * buf1 = 0; + char * buf2 = 0; + buf1 = futils_fstr_to_cstr (group, group_size); + buf2 = futils_fstr_to_cstr (name, name_size); + adios_common_define_mesh_group (*group_id, buf2, buf1); + free (buf1); + free (buf2); +} + +/////////////////////////////////////////////////////////////////////////////// +void FC_FUNC_(adios_define_mesh_uniform, ADIOS_DEFINE_MESH_UNIFROM) + (char * dimensions, char * origin, char * spacing, char * maximum, char * nspace + ,int64_t * group_id, const char * name, int dimensions_size, int origin_size + ,int spacing_size, int maximum_size, int nspace_size ,int name_size) +{ + char * buf1 = 0; + char * buf2 = 0; + char * buf3 = 0; + char * buf4 = 0; + char * buf5 = 0; + char * buf6 = 0; + buf1 = futils_fstr_to_cstr (dimensions, dimensions_size); + buf2 = futils_fstr_to_cstr (origin, origin_size); + buf3 = futils_fstr_to_cstr (spacing, spacing_size); + buf4 = futils_fstr_to_cstr (maximum, maximum_size); + buf5 = futils_fstr_to_cstr (nspace, nspace_size); + buf6 = futils_fstr_to_cstr (name, name_size); + adios_common_define_mesh_uniform (buf1, buf2, buf3, buf4, buf5, buf6, *group_id); + free (buf1); + free (buf2); + free (buf3); + free (buf4); + free (buf5); + free (buf6); +} + +/////////////////////////////////////////////////////////////////////////////// +void FC_FUNC_(adios_define_mesh_rectilinear, ADIOS_DEFINE_MESH_RECTILINEAR) + (char * dimensions, char * coordinates, char * nspace, int64_t * group_id + ,const char * name, int dimensions_size, int coordinates_size, int nspace_size + ,int name_size) +{ + char * buf1 = 0; + char * buf2 = 0; + char * buf3 = 0; + char * buf4 = 0; + buf1 = futils_fstr_to_cstr (dimensions, dimensions_size); + buf2 = futils_fstr_to_cstr (coordinates, coordinates_size); + buf3 = futils_fstr_to_cstr (nspace, nspace_size); + buf4 = futils_fstr_to_cstr (name, name_size); + adios_common_define_mesh_rectilinear (buf1, buf2, buf3, buf4, *group_id); + free (buf1); + free (buf2); + free (buf3); + free (buf4); +} + +/////////////////////////////////////////////////////////////////////////////// +void FC_FUNC_(adios_define_mesh_structured, ADIOS_DEFINE_MESH_STRUCTURED) + (char * dimensions, char * points, char * nspace, int64_t * group_id, const char * name + ,int dimensions_size, int points_size, int nspace_size, int name_size) +{ + char * buf1 = 0; + char * buf2 = 0; + char * buf3 = 0; + char * buf4 = 0; + buf1 = futils_fstr_to_cstr (dimensions, dimensions_size); + buf2 = futils_fstr_to_cstr (points, points_size); + buf3 = futils_fstr_to_cstr (nspace, nspace_size); + buf4 = futils_fstr_to_cstr (name, name_size); + adios_common_define_mesh_structured (buf1, buf3, buf2, buf4, *group_id); + free (buf1); + free (buf2); + free (buf3); + free (buf4); +} + +/////////////////////////////////////////////////////////////////////////////// +void FC_FUNC_(adios_define_mesh_unstructured, ADIOS_DEFINE_MESH_UNSTRUCTURED) + (char * points, char * data, char * count, char * cell_type, char * npoints + ,char * nspace, int64_t * group_id, const char * name, int points_size, int data_size + ,int count_size, int cell_type_size, int npoints_size, int nspace_size, int name_size) +{ + char * buf1 = 0; + char * buf2 = 0; + char * buf3 = 0; + char * buf4 = 0; + char * buf5 = 0; + char * buf6 = 0; + char * buf7 = 0; + buf1 = futils_fstr_to_cstr (points, points_size); + buf2 = futils_fstr_to_cstr (data, data_size); + buf3 = futils_fstr_to_cstr (count, count_size); + buf4 = futils_fstr_to_cstr (cell_type, cell_type_size); + buf5 = futils_fstr_to_cstr (npoints, npoints_size); + buf6 = futils_fstr_to_cstr (nspace, nspace_size); + buf7 = futils_fstr_to_cstr (name, name_size); + +// adios_common_define_mesh_unstructured (buf1, buf2, buf3, buf4, buf5, buf6, buf7, *group_id); + adios_common_define_mesh_unstructured (buf1, buf2, buf3, buf4, buf6, buf5, buf7, *group_id); + + free (buf1); + free (buf2); + free (buf3); + free (buf4); + free (buf5); + free (buf6); + free (buf7); +} + +/**************************************************************************/ +/* Specific function for each data type */ +/**************************************************************************/ +#if 0 +/* + ADIOS_WRITE +*/ +/* scalars */ +void FC_FUNC_(adios_write_int1_d0, ADIOS_WRITE_INT1_D0) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_int2_d0, ADIOS_WRITE_INT2_D0) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_int4_d0, ADIOS_WRITE_INT4_D0) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_int8_d0, ADIOS_WRITE_INT8_D0) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_real4_d0, ADIOS_WRITE_REAL4_D0) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_real8_d0, ADIOS_WRITE_REAL8_D0) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +//void FC_FUNC_(adios_write_char_d0, ADIOS_WRITE_CHAR_D0) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_complex8_d0, ADIOS_WRITE_COMPLEX8_D0) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_complex16_d0, ADIOS_WRITE_COMPLEX16_D0) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_logical1_d0, ADIOS_WRITE_LOGICAL1_D0) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_logical2_d0, ADIOS_WRITE_LOGICAL2_D0) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_logical4_d0, ADIOS_WRITE_LOGICAL4_D0) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_logical8_d0, ADIOS_WRITE_LOGICAL8_D0) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } + + +/* 1D */ +void FC_FUNC_(adios_write_int1_d1, ADIOS_WRITE_INT1_D1) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_int2_d1, ADIOS_WRITE_INT2_D1) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_int4_d1, ADIOS_WRITE_INT4_D1) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_int8_d1, ADIOS_WRITE_INT8_D1) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_real4_d1, ADIOS_WRITE_REAL4_D1) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_real8_d1, ADIOS_WRITE_REAL8_D1) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_char_d1, ADIOS_WRITE_CHAR_D1) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_complex8_d1, ADIOS_WRITE_COMPLEX8_D1) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_complex16_d1, ADIOS_WRITE_COMPLEX16_D1) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_logical1_d1, ADIOS_WRITE_LOGICAL1_D1) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_logical2_d1, ADIOS_WRITE_LOGICAL2_D1) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_logical4_d1, ADIOS_WRITE_LOGICAL4_D1) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_logical8_d1, ADIOS_WRITE_LOGICAL8_D1) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } + + +/* 2D */ +void FC_FUNC_(adios_write_int1_d2, ADIOS_WRITE_INT1_D2) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_int2_d2, ADIOS_WRITE_INT2_D2) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_int4_d2, ADIOS_WRITE_INT4_D2) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_int8_d2, ADIOS_WRITE_INT8_D2) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_real4_d2, ADIOS_WRITE_REAL4_D2) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_real8_d2, ADIOS_WRITE_REAL8_D2) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_char_d2, ADIOS_WRITE_CHAR_D2) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_complex8_d2, ADIOS_WRITE_COMPLEX8_D2) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_complex16_d2, ADIOS_WRITE_COMPLEX16_D2) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_logical1_d2, ADIOS_WRITE_LOGICAL1_D2) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_logical2_d2, ADIOS_WRITE_LOGICAL2_D2) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_logical4_d2, ADIOS_WRITE_LOGICAL4_D2) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_logical8_d2, ADIOS_WRITE_LOGICAL8_D2) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } + + +/* 3D */ +void FC_FUNC_(adios_write_int1_d3, ADIOS_WRITE_INT1_D3) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_int2_d3, ADIOS_WRITE_INT2_D3) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_int4_d3, ADIOS_WRITE_INT4_D3) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_int8_d3, ADIOS_WRITE_INT8_D3) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_real4_d3, ADIOS_WRITE_REAL4_D3) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_real8_d3, ADIOS_WRITE_REAL8_D3) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_char_d3, ADIOS_WRITE_CHAR_D3) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_complex8_d3, ADIOS_WRITE_COMPLEX8_D3) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_complex16_d3, ADIOS_WRITE_COMPLEX16_D3) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_logical1_d3, ADIOS_WRITE_LOGICAL1_D3) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_logical2_d3, ADIOS_WRITE_LOGICAL2_D3) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_logical4_d3, ADIOS_WRITE_LOGICAL4_D3) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_logical8_d3, ADIOS_WRITE_LOGICAL8_D3) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } + + +/* 4D */ +void FC_FUNC_(adios_write_int1_d4, ADIOS_WRITE_INT1_D4) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_int2_d4, ADIOS_WRITE_INT2_D4) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_int4_d4, ADIOS_WRITE_INT4_D4) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_int8_d4, ADIOS_WRITE_INT8_D4) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_real4_d4, ADIOS_WRITE_REAL4_D4) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_real8_d4, ADIOS_WRITE_REAL8_D4) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_char_d4, ADIOS_WRITE_CHAR_D4) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_complex8_d4, ADIOS_WRITE_COMPLEX8_D4) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_complex16_d4, ADIOS_WRITE_COMPLEX16_D4) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_logical1_d4, ADIOS_WRITE_LOGICAL1_D4) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_logical2_d4, ADIOS_WRITE_LOGICAL2_D4) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_logical4_d4, ADIOS_WRITE_LOGICAL4_D4) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_logical8_d4, ADIOS_WRITE_LOGICAL8_D4) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } + + +/* 5D */ +void FC_FUNC_(adios_write_int1_d5, ADIOS_WRITE_INT1_D5) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_int2_d5, ADIOS_WRITE_INT2_D5) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_int4_d5, ADIOS_WRITE_INT4_D5) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_int8_d5, ADIOS_WRITE_INT8_D5) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_real4_d5, ADIOS_WRITE_REAL4_D5) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_real8_d5, ADIOS_WRITE_REAL8_D5) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_char_d5, ADIOS_WRITE_CHAR_D5) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_complex8_d5, ADIOS_WRITE_COMPLEX8_D5) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_complex16_d5, ADIOS_WRITE_COMPLEX16_D5) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_logical1_d5, ADIOS_WRITE_LOGICAL1_D5) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_logical2_d5, ADIOS_WRITE_LOGICAL2_D5) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_logical4_d5, ADIOS_WRITE_LOGICAL4_D5) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_logical8_d5, ADIOS_WRITE_LOGICAL8_D5) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } + + +/* 6D */ +void FC_FUNC_(adios_write_int1_d6, ADIOS_WRITE_INT1_D6) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_int2_d6, ADIOS_WRITE_INT2_D6) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_int4_d6, ADIOS_WRITE_INT4_D6) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_int8_d6, ADIOS_WRITE_INT8_D6) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_real4_d6, ADIOS_WRITE_REAL4_D6) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_real8_d6, ADIOS_WRITE_REAL8_D6) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_char_d6, ADIOS_WRITE_CHAR_D6) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_complex8_d6, ADIOS_WRITE_COMPLEX8_D6) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_complex16_d6, ADIOS_WRITE_COMPLEX16_D6) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_logical1_d6, ADIOS_WRITE_LOGICAL1_D6) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_logical2_d6, ADIOS_WRITE_LOGICAL2_D6) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_logical4_d6, ADIOS_WRITE_LOGICAL4_D6) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } +void FC_FUNC_(adios_write_logical8_d6, ADIOS_WRITE_LOGICAL8_D6) (int64_t * fd_p, const char * name, void * var, int * err, int name_size, int var_size) { FC_FUNC_(adios_write, ADIOS_WRITE) (fd_p, name, var, err, name_size, var_size); } + + + +/* + ADIOS_READ +*/ +/* scalars */ +void FC_FUNC_(adios_read_int1_d0, ADIOS_READ_INT1_D0) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_int2_d0, ADIOS_READ_INT2_D0) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_int4_d0, ADIOS_READ_INT4_D0) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_int8_d0, ADIOS_READ_INT8_D0) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_real4_d0, ADIOS_READ_REAL4_D0) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_real8_d0, ADIOS_READ_REAL8_D0) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +//void FC_FUNC_(adios_read_char_d0, ADIOS_READ_CHAR_D0) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_complex8_d0, ADIOS_READ_COMPLEX8_D0) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_complex16_d0, ADIOS_READ_COMPLEX16_D0) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_logical1_d0, ADIOS_READ_LOGICAL1_D0) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_logical2_d0, ADIOS_READ_LOGICAL2_D0) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_logical4_d0, ADIOS_READ_LOGICAL4_D0) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_logical8_d0, ADIOS_READ_LOGICAL8_D0) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } + +/* 1D */ +void FC_FUNC_(adios_read_int1_d1, ADIOS_READ_INT1_D1) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_int2_d1, ADIOS_READ_INT2_D1) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_int4_d1, ADIOS_READ_INT4_D1) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_int8_d1, ADIOS_READ_INT8_D1) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_real4_d1, ADIOS_READ_REAL4_D1) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_real8_d1, ADIOS_READ_REAL8_D1) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_char_d1, ADIOS_READ_CHAR_D1) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_complex8_d1, ADIOS_READ_COMPLEX8_D1) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_complex16_d1, ADIOS_READ_COMPLEX16_D1) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_logical1_d1, ADIOS_READ_LOGICAL1_D1) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_logical2_d1, ADIOS_READ_LOGICAL2_D1) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_logical4_d1, ADIOS_READ_LOGICAL4_D1) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_logical8_d1, ADIOS_READ_LOGICAL8_D1) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } + + +/* 2D */ +void FC_FUNC_(adios_read_int1_d2, ADIOS_READ_INT1_D2) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_int2_d2, ADIOS_READ_INT2_D2) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_int4_d2, ADIOS_READ_INT4_D2) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_int8_d2, ADIOS_READ_INT8_D2) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_real4_d2, ADIOS_READ_REAL4_D2) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_real8_d2, ADIOS_READ_REAL8_D2) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_char_d2, ADIOS_READ_CHAR_D2) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_complex8_d2, ADIOS_READ_COMPLEX8_D2) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_complex16_d2, ADIOS_READ_COMPLEX16_D2) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_logical1_d2, ADIOS_READ_LOGICAL1_D2) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_logical2_d2, ADIOS_READ_LOGICAL2_D2) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_logical4_d2, ADIOS_READ_LOGICAL4_D2) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_logical8_d2, ADIOS_READ_LOGICAL8_D2) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } + + +/* 3D */ +void FC_FUNC_(adios_read_int1_d3, ADIOS_READ_INT1_D3) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_int2_d3, ADIOS_READ_INT2_D3) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_int4_d3, ADIOS_READ_INT4_D3) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_int8_d3, ADIOS_READ_INT8_D3) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_real4_d3, ADIOS_READ_REAL4_D3) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_real8_d3, ADIOS_READ_REAL8_D3) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_char_d3, ADIOS_READ_CHAR_D3) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_complex8_d3, ADIOS_READ_COMPLEX8_D3) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_complex16_d3, ADIOS_READ_COMPLEX16_D3) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_logical1_d3, ADIOS_READ_LOGICAL1_D3) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_logical2_d3, ADIOS_READ_LOGICAL2_D3) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_logical4_d3, ADIOS_READ_LOGICAL4_D3) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_logical8_d3, ADIOS_READ_LOGICAL8_D3) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } + + +/* 4D */ +void FC_FUNC_(adios_read_int1_d4, ADIOS_READ_INT1_D4) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_int2_d4, ADIOS_READ_INT2_D4) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_int4_d4, ADIOS_READ_INT4_D4) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_int8_d4, ADIOS_READ_INT8_D4) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_real4_d4, ADIOS_READ_REAL4_D4) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_real8_d4, ADIOS_READ_REAL8_D4) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_char_d4, ADIOS_READ_CHAR_D4) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_complex8_d4, ADIOS_READ_COMPLEX8_D4) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_complex16_d4, ADIOS_READ_COMPLEX16_D4) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_logical1_d4, ADIOS_READ_LOGICAL1_D4) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_logical2_d4, ADIOS_READ_LOGICAL2_D4) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_logical4_d4, ADIOS_READ_LOGICAL4_D4) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_logical8_d4, ADIOS_READ_LOGICAL8_D4) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } + + +/* 5D */ +void FC_FUNC_(adios_read_int1_d5, ADIOS_READ_INT1_D5) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_int2_d5, ADIOS_READ_INT2_D5) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_int4_d5, ADIOS_READ_INT4_D5) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_int8_d5, ADIOS_READ_INT8_D5) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_real4_d5, ADIOS_READ_REAL4_D5) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_real8_d5, ADIOS_READ_REAL8_D5) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_char_d5, ADIOS_READ_CHAR_D5) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_complex8_d5, ADIOS_READ_COMPLEX8_D5) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_complex16_d5, ADIOS_READ_COMPLEX16_D5) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_logical1_d5, ADIOS_READ_LOGICAL1_D5) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_logical2_d5, ADIOS_READ_LOGICAL2_D5) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_logical4_d5, ADIOS_READ_LOGICAL4_D5) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_logical8_d5, ADIOS_READ_LOGICAL8_D5) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } + + +/* 6D */ +void FC_FUNC_(adios_read_int1_d6, ADIOS_READ_INT1_D6) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_int2_d6, ADIOS_READ_INT2_D6) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_int4_d6, ADIOS_READ_INT4_D6) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_int8_d6, ADIOS_READ_INT8_D6) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_real4_d6, ADIOS_READ_REAL4_D6) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_real8_d6, ADIOS_READ_REAL8_D6) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_char_d6, ADIOS_READ_CHAR_D6) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_complex8_d6, ADIOS_READ_COMPLEX8_D6) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_complex16_d6, ADIOS_READ_COMPLEX16_D6) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_logical1_d6, ADIOS_READ_LOGICAL1_D6) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_logical2_d6, ADIOS_READ_LOGICAL2_D6) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_logical4_d6, ADIOS_READ_LOGICAL4_D6) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } +void FC_FUNC_(adios_read_logical8_d6, ADIOS_READ_LOGICAL8_D6) (int64_t * fd_p, const char * name, void * buffer ,int64_t * buffer_size, int * err, int name_size) { FC_FUNC_(adios_read, ADIOS_READ) (fd_p, name, buffer, buffer_size, err, name_size); } + + +#endif + diff --git a/tests/libs/adios/src/core/adiosf_defs_mod.f90 b/tests/libs/adios/src/core/adiosf_defs_mod.f90 new file mode 100644 index 0000000000..67cd40e3b3 --- /dev/null +++ b/tests/libs/adios/src/core/adiosf_defs_mod.f90 @@ -0,0 +1,98 @@ +! +! ADIOS is freely available under the terms of the BSD license described +! in the COPYING file in the top level directory of this source distribution. +! +! Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. +! + +! +! Read Fortran 90 API for ADIOS BP format files +! +! Use this module in your source code to ensure that +! you are calling the adios_* reading functions with +! the correct arguments +! +module adios_defs_mod + + ! + ! ADIOS Data types ! (size in bytes) + ! + integer, parameter :: adios_unknown = -1 + integer, parameter :: adios_byte = 0 ! (1) + integer, parameter :: adios_short = 1 ! (2) + integer, parameter :: adios_integer = 2 ! (4) + integer, parameter :: adios_long = 4 ! (8) + integer, parameter :: adios_unsigned_byte = 50 ! (1) + integer, parameter :: adios_unsigned_short = 51 ! (2) + integer, parameter :: adios_unsigned_integer = 52 ! (4) + integer, parameter :: adios_unsigned_long = 54 ! (8) + integer, parameter :: adios_real = 5 ! (4) + integer, parameter :: adios_double = 6 ! (8) + integer, parameter :: adios_long_double = 7 ! (16) + integer, parameter :: adios_string = 9 ! C strings + integer, parameter :: adios_complex = 10 ! (8) + + + ! + ! Read methods (used in init/finalize/open calls) + ! + integer, parameter :: ADIOS_READ_METHOD_BP = 0 + integer, parameter :: ADIOS_READ_METHOD_BP_AGGREGATE = 1 + !integer, parameter :: ADIOS_READ_METHOD_BP_STAGED1 = 2 + integer, parameter :: ADIOS_READ_METHOD_DATASPACES = 3 + integer, parameter :: ADIOS_READ_METHOD_DIMES = 4 + integer, parameter :: ADIOS_READ_METHOD_FLEXPATH = 5 + integer, parameter :: ADIOS_READ_METHOD_ICEE = 6 + integer, parameter :: ADIOS_READ_METHOD_BP_STAGED = ADIOS_READ_METHOD_BP_AGGREGATE + + ! + ! Stream Locking modes + ! + integer, parameter :: ADIOS_LOCKMODE_NONE = 0 + integer, parameter :: ADIOS_LOCKMODE_CURRENT = 0 + integer, parameter :: ADIOS_LOCKMODE_ALL = 0 + + + ! + ! ADIOS error codes + ! + integer, parameter :: err_no_error = 0 + integer, parameter :: err_no_memory = -1 + integer, parameter :: err_file_open_error = -2 + integer, parameter :: err_file_not_found = -3 + integer, parameter :: err_invalid_file_pointer = -4 + integer, parameter :: err_invalid_group = -5 + integer, parameter :: err_invalid_group_struct = -6 + integer, parameter :: err_invalid_varid = -7 + integer, parameter :: err_invalid_varname = -8 + integer, parameter :: err_corrupted_variable = -9 + + integer, parameter :: err_invalid_attrid = -10 + integer, parameter :: err_invalid_attrname = -11 + integer, parameter :: err_corrupted_attribute = -12 + integer, parameter :: err_invalid_attribute_reference = -13 + integer, parameter :: err_invalid_timestep = -14 + integer, parameter :: err_no_data_at_timestep = -15 + integer, parameter :: err_time_at_wrong_dimension = -16 + integer, parameter :: err_invalid_read_method = -17 + integer, parameter :: err_connection_failed = -18 + integer, parameter :: err_out_of_bound = -19 + + ! Stream reading specific errors + integer, parameter :: err_operation_not_supported = -20 + integer, parameter :: err_end_of_stream = -21 + integer, parameter :: err_step_notready = -22 + integer, parameter :: err_step_disappeared = -23 + integer, parameter :: err_too_many_files = -24 + + ! Write method errors + integer, parameter :: err_invalid_file_mode = -100 + integer, parameter :: err_invalid_file_version = -101 + integer, parameter :: err_invalid_data = -102 + integer, parameter :: err_buffer_overflow = -103 + integer, parameter :: err_too_many_variables = -104 + integer, parameter :: err_invalid_write_method = -105 + integer, parameter :: err_unspecified = -200 + + +end module adios_defs_mod diff --git a/tests/libs/adios/src/core/adiosf_read.c b/tests/libs/adios/src/core/adiosf_read.c new file mode 100644 index 0000000000..911ba18357 --- /dev/null +++ b/tests/libs/adios/src/core/adiosf_read.c @@ -0,0 +1,722 @@ +/* + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + */ + +#include "config.h" +#include +#include +#include +#define __INCLUDED_FROM_FORTRAN_API__ +#include "adios_read.h" +#include "adios_error.h" +#include "core/bp_utils.h" // bp_get_type_size +//#include "core/bp_types.h" +#include "core/common_read.h" +#include "core/futils.h" +#define BYTE_ALIGN 8 + +#ifdef DMALLOC +#include "dmalloc.h" +#endif + +#ifdef __cplusplus +extern "C" /* prevent C++ name mangling */ +#endif + +extern int adios_errno; + +#define PRINT_ERRMSG() fprintf(stderr, "ADIOS READ ERROR: %s\n", adios_get_last_errmsg()) + +#ifdef BUILD_WITH_CMAKE + #include "FC.h" +#endif + +/*********************/ +/* FORTRAN INTERFACE */ +/*********************/ +void FC_FUNC_(adios_errmsg, adios_errmsg) (char *msg, int msg_len) +{ + futils_cstr_to_fstr( adios_get_last_errmsg(), (char *)msg, msg_len); +} + +void FC_FUNC_(adios_read_init_method, ADIOS_READ_INIT_METHOD) ( + int *fmethod, int * fcomm, char * parameters, int * err, int parameters_len) +{ + MPI_Comm comm = MPI_Comm_f2c (*((int *) fcomm)); + enum ADIOS_READ_METHOD method = (enum ADIOS_READ_METHOD) *fmethod; + char *paramstr; + futils_called_from_fortran_set(); + + paramstr = futils_fstr_to_cstr(parameters, parameters_len); + *err = common_read_init_method (method, comm, paramstr); + free(paramstr); + if (*err) + PRINT_ERRMSG(); +} + +void FC_FUNC_(adios_read_finalize_method, ADIOS_READ_FINALIZE_METHOD) (int *fmethod, int * err) +{ + enum ADIOS_READ_METHOD method = (enum ADIOS_READ_METHOD) *fmethod; + *err = common_read_finalize_method (method); + futils_called_from_fortran_unset(); + if (*err) + PRINT_ERRMSG(); +} + + +void FC_FUNC_(adios_read_open, ADIOS_READ_OPEN) + (int64_t * fp, + char * fname, + int * fmethod, + int * fcomm, + int * lockmode, + float * timeout_sec, + int * err, + int fname_len) +{ + ADIOS_FILE *afp; + char *namestr; + enum ADIOS_READ_METHOD method = (enum ADIOS_READ_METHOD) *fmethod; + enum ADIOS_LOCKMODE lockm = (enum ADIOS_LOCKMODE) *lockmode; + MPI_Comm comm = MPI_Comm_f2c (*((int *) fcomm)); + futils_called_from_fortran_set(); + + namestr = futils_fstr_to_cstr(fname, fname_len); + if (namestr != NULL) { + afp = common_read_open (namestr, method, comm, lockm, *timeout_sec); + *fp = (int64_t) afp; + free(namestr); + } else { + *fp = (int64_t) NULL; + } + *err = adios_errno; + if (*err) + PRINT_ERRMSG(); +} + + +void FC_FUNC_(adios_read_open_file, ADIOS_READ_OPEN_FILE) + (int64_t * fp, + char * fname, + int * fmethod, + int * fcomm, + int * err, + int fname_len) +{ + ADIOS_FILE *afp; + char *namestr; + enum ADIOS_READ_METHOD method = (enum ADIOS_READ_METHOD) *fmethod; + MPI_Comm comm = MPI_Comm_f2c (*((int *) fcomm)); + futils_called_from_fortran_set(); + + namestr = futils_fstr_to_cstr(fname, fname_len); + if (namestr != NULL) { + afp = common_read_open_file (namestr, method, comm); + *fp = (int64_t) afp; + free(namestr); + } else { + *fp = (int64_t) NULL; + } + *err = adios_errno; + if (*err) + PRINT_ERRMSG(); +} + + +int FC_FUNC_(adios_advance_step, ADIOS_ADVANCE_STEP) + (int64_t *fp, int *last, float *timeout_sec, int *err) +{ + ADIOS_FILE *afp = (ADIOS_FILE *) *fp; + *err = common_read_advance_step (afp, *last, *timeout_sec); + if (*err) + PRINT_ERRMSG(); + return *err; +} + + +void FC_FUNC_(adios_release_step, ADIOS_RELEASE_STEP) (int64_t *fp, int *err) +{ + ADIOS_FILE *afp = (ADIOS_FILE *) *fp; + common_read_release_step (afp); + *err = adios_errno; + if (*err) + PRINT_ERRMSG(); +} + + +void FC_FUNC_(adios_reset_dimension_order, ADIOS_RESET_DIMENSION_ORDER) + (int64_t * fp, int * flag) +{ + ADIOS_FILE *afp = (ADIOS_FILE *) *fp; + common_read_reset_dimension_order(afp, *flag); + if (adios_errno) + PRINT_ERRMSG(); +} + +void FC_FUNC_(adios_read_close, ADIOS_READ_CLOSE) (int64_t * fp, int * err) +{ + ADIOS_FILE *afp = (ADIOS_FILE *) *fp; + *err = common_read_close (afp); + futils_called_from_fortran_unset(); + if (*err) + PRINT_ERRMSG(); +} + +void FC_FUNC_(adios_inq_ngroups, ADIOS_INQ_NGROUPS) + (int64_t * fp, int * groups_count, int * err) +{ + ADIOS_FILE *afp = (ADIOS_FILE *) *fp; + if (afp != NULL) { + char ** group_namelist; + *groups_count = common_read_get_grouplist (afp, &group_namelist); + *err = adios_errno; + if (*err) + PRINT_ERRMSG(); + } else { + *groups_count = 0; + *err = 1; + } +} + +void FC_FUNC_(adios_inq_groupnames, ADIOS_INQ_GROUPNAMES) + (int64_t * fp, void * gnamelist, int * err, int gnamelist_len) +{ + ADIOS_FILE *afp = (ADIOS_FILE *) *fp; + adios_errno = err_no_error; + if (afp != NULL) { + char ** group_namelist; + int ngroups = common_read_get_grouplist (afp, &group_namelist); + int i; + for (i=0;invars; + *attrs_count = afp->nattrs; + *current_step = afp->current_step; + *last_step = afp->last_step; + *err = 0; + } else { + *vars_count = 0; + *attrs_count = 0; + *current_step = 0; + *last_step = 0; + *err = 1; + } +} + +void FC_FUNC_(adios_inq_varnames, ADIOS_INQ_VARNAMES) + (int64_t * fp, void * vnamelist, int * err, int vnamelist_len) +{ + ADIOS_FILE *afp = (ADIOS_FILE *) *fp; + int i; + if (afp != NULL) { + for (i=0;invars;i++) { + futils_cstr_to_fstr( afp->var_namelist[i], (char *)vnamelist+i*vnamelist_len, vnamelist_len); + } + *err = 0; + } else { + *err = 1; + } +} + +void FC_FUNC_(adios_inq_attrnames, ADIOS_INQ_ATTRNAMES) + (int64_t * fp, void * anamelist, int * err, int anamelist_len) +{ + ADIOS_FILE *afp = (ADIOS_FILE *) *fp; + int i; + if (afp != NULL) { + for (i=0;inattrs;i++) { + futils_cstr_to_fstr( afp->attr_namelist[i], (char *)anamelist+i*anamelist_len, anamelist_len); + } + *err = 0; + } else { + *err = 1; + } +} + +void FC_FUNC_(adios_inq_var, ADIOS_INQ_VAR) + (int64_t * fp, + char * varname, + int * type, + int * nsteps, + int * ndim, + uint64_t * dims, + int * err, + int varname_len) +{ + char *varstr; + int i; + ADIOS_FILE *afp = (ADIOS_FILE *) *fp; + ADIOS_VARINFO *vi = NULL; + + varstr = futils_fstr_to_cstr(varname, varname_len); + if (varstr != NULL) { + vi = common_read_inq_var (afp, varstr); + free(varstr); + } + if (vi != NULL) { + *type = vi->type; + *nsteps = vi->nsteps; + *ndim = vi->ndim; + for (i=0;indim;i++) + dims[i] = vi->dims[i]; + common_read_free_varinfo(vi); + } else { + *type = adios_unknown; + *ndim = 0; + *nsteps = 0; + } + *err = adios_errno; + if (*err < 0) + PRINT_ERRMSG(); +} + +void FC_FUNC_(adios_get_scalar, ADIOS_GET_SCALAR) + (int64_t * fp, + char * varname, + void * data, + int * err, + int varname_len) +{ + char *varstr; + ADIOS_FILE *afp = (ADIOS_FILE *) *fp; + ADIOS_VARINFO *vi = NULL; + + varstr = futils_fstr_to_cstr(varname, varname_len); + if (varstr != NULL) { + vi = common_read_inq_var (afp, varstr); + free(varstr); + } + if (vi != NULL && vi->value != NULL) { + int size = bp_get_type_size(vi->type, vi->value); + memcpy(data, vi->value, size); + common_read_free_varinfo(vi); + } else { + *err = adios_errno; + } + *err = adios_errno; + if (*err < 0) + PRINT_ERRMSG(); +} + +void FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) + (int64_t * fp, + int64_t * fsel, + char * varname, + int * from_step, + int * nsteps, + void * data, + int * err, + int varname_len) +{ + ADIOS_FILE *afp = (ADIOS_FILE *) *fp; + ADIOS_SELECTION * sel = (ADIOS_SELECTION *) *fsel; + char *varstr; + varstr = futils_fstr_to_cstr(varname, varname_len); + if (varstr != NULL) { + *err = common_read_schedule_read (afp, sel, varstr, *from_step, *nsteps, NULL /* NCSU ALACRITY-ADIOS */, data); + free(varstr); + } else { + *err = adios_errno; + } + if (*err < 0) + PRINT_ERRMSG(); +} + +void FC_FUNC_(adios_schedule_read_f2c, ADIOS_SCHEDULE_READ_F2C) (int64_t * fp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (fp,fsel,varname,from_step,nsteps,data,err,varname_len); } + +void FC_FUNC_(adios_perform_reads, ADIOS_PERFORM_READS) + (int64_t * fp, + int * err) +{ + ADIOS_FILE *afp = (ADIOS_FILE *) *fp; + *err = common_read_perform_reads (afp, 1); // only blocking read implemented for Fortran + if (*err < 0) + PRINT_ERRMSG(); +} + +void FC_FUNC_(adios_get_statistics, ADIOS_GET_STATISTICS) + (int64_t * gp, + char * varname, + void * value, + void * gmin, + void * gmax, + double * gavg, + double * gstd_dev, + void ** mins, + void ** maxs, + double ** avgs, + double ** std_devs, + int * err, + int varname_len) +{ + ADIOS_FILE *afp = (ADIOS_FILE *) *gp; + ADIOS_VARINFO *vi = NULL; + char *varstr; + int size; + + varstr = futils_fstr_to_cstr(varname, varname_len); + if (varstr != NULL) { + /* First get the number of dimensions of the variable */ + vi = common_read_inq_var (afp, varstr); + free(varstr); + } + if (vi != NULL) { + size = bp_get_type_size(vi->type, vi->value); + // get statistics information per each step + common_read_inq_var_stat (afp, vi, 1, 0); + if (vi->type == adios_string) size++; + if (vi->value) memcpy(value, vi->value, size); + + if (vi->statistics) { + if (vi->type == adios_complex || vi->type == adios_double_complex) { + /* For complex numbers, the statistics in ADIOS_VARINFO, like + gmin, gavg, std_devs etc, are of base type double. They also + have an additional dimension that stores the statistics for + the magnitude, the real part, and the imaginary part of the + complex number, individually. For example, gmin[0] holds the + overall minimum value of the magnitude of the complex numbers. + gmin[1] and gmin [2] contain the global minimums for the real + and the imaginary parts, respectively. + */ + if (vi->statistics->min) + memcpy((char *) gmin, (char *) vi->statistics->min, 3*size); + if (vi->statistics->max) + memcpy(((char *) gmax), (char *) vi->statistics->max, 3*size); + if (vi->statistics->avg) + memcpy(gavg, vi->statistics->avg, 3*sizeof(double)); + if (vi->statistics->std_dev) + memcpy(gstd_dev, vi->statistics->std_dev, 3*sizeof(double)); + + /* FIXME: I do not know if mins is **void and mins[i] is a void * allocated + separately, or mins is a continuous array now. + Copy content accordingly back to the Fortran client. + */ + int c; + double ** v_mins = NULL; + double ** v_maxs = NULL; + double ** v_avgs = NULL; + double ** v_std_devs = NULL; + if (vi->statistics->steps) { + v_mins = (double **) vi->statistics->steps->mins; + v_maxs = (double **) vi->statistics->steps->maxs; + v_avgs = (double **) vi->statistics->steps->avgs; + v_std_devs = (double **) vi->statistics->steps->std_devs; + } + + for (c = 0; c < 3; c ++) + { + if (v_mins && v_mins[c]) memcpy(((double **) mins)[c], v_mins[c], vi->nsteps * size); + if (v_maxs && v_maxs[c]) memcpy(((double **) maxs)[c], v_maxs[c], vi->nsteps * size); + if (v_avgs && v_avgs[c]) memcpy(avgs[c], v_avgs[c], vi->nsteps * sizeof(double)); + if (v_std_devs && v_std_devs[c]) memcpy(std_devs[c], v_std_devs[c], vi->nsteps * sizeof(double)); + } + + } else { + if (vi->statistics->min) + memcpy((char *) gmin, (char *) vi->statistics->min, size); + if (vi->statistics->max) + memcpy((char *) gmax, (char *) vi->statistics->max, size); + if (vi->statistics->avg) + memcpy(gavg, vi->statistics->avg, sizeof(double)); + if (vi->statistics->std_dev) + memcpy(gstd_dev, vi->statistics->std_dev, sizeof(double)); + + if (vi->statistics->steps) { + if (vi->statistics->steps->mins) + memcpy((char *) mins, (char *) vi->statistics->steps->mins, vi->nsteps * size); + if (vi->statistics->steps->maxs) + memcpy((char *) maxs, (char *) vi->statistics->steps->maxs, vi->nsteps * size); + if (vi->statistics->steps->avgs) + memcpy(avgs, vi->statistics->steps->avgs, vi->nsteps * sizeof(double)); + if (vi->statistics->steps->std_devs) + memcpy(std_devs, vi->statistics->steps->std_devs, vi->nsteps * sizeof(double)); + } + } + } + common_read_free_varinfo(vi); + } + *err = adios_errno; + if (*err < 0) + PRINT_ERRMSG(); +} + +void FC_FUNC_(adios_get_attr, ADIOS_GET_ATTR) + (int64_t * gp, + char * attrname, + void * attr, + int * err, + int attrname_len) +{ + ADIOS_FILE *afp = (ADIOS_FILE *) *gp; + char *attrstr; + void *data; + int size; + enum ADIOS_DATATYPES type; + attrstr = futils_fstr_to_cstr(attrname, attrname_len); + if (attrstr != NULL) { + *err = common_read_get_attr (afp, attrstr, &type, &size, &data); + if (data) { + memcpy(attr, data, size); + free(data); + } + free(attrstr); + } else { + *err = adios_errno; + } + if (*err < 0) + PRINT_ERRMSG(); +} + +void FC_FUNC_(adios_inq_attr, ADIOS_INQ_ATTR) + (int64_t * gp, + char * attrname, + int * type, + int * size, + int * err, + int attrname_len) +{ + ADIOS_FILE *afp = (ADIOS_FILE *) *gp; + char *attrstr; + void *data; + attrstr = futils_fstr_to_cstr(attrname, attrname_len); + if (attrstr != NULL) { + *err = common_read_get_attr (afp, attrstr, (enum ADIOS_DATATYPES *)type, size, &data); + free(data); + free(attrstr); + } else { + *err = adios_errno; + } + if (*err < 0) + PRINT_ERRMSG(); +} + +void FC_FUNC_(adios_selection_boundingbox, ADIOS_SELECTION_BOUNDINGBOX) + (int64_t * fsel, int *ndim, uint64_t *start, uint64_t *count) +{ + ADIOS_SELECTION * sel = common_read_selection_boundingbox (*ndim, start, count); + *fsel = (int64_t) sel; +} + +void FC_FUNC_(adios_selection_points, ADIOS_SELECTION_POINTS) + (int64_t *fsel, int *ndim, uint64_t *npoints, uint64_t *points) +{ + ADIOS_SELECTION * sel = common_read_selection_points (*ndim, *npoints, points); + *fsel = (int64_t) sel; +} + +void FC_FUNC_(adios_selection_writeblock, ADIOS_SELECTION_WRITEBLOCK) (int64_t *fsel, int *index) +{ + ADIOS_SELECTION * sel = common_read_selection_writeblock (*index); + *fsel = (int64_t) sel; +} + +void FC_FUNC_(adios_selection_auto, ADIOS_SELECTION_AUTO) (int64_t *fsel, char *hints, int hints_len) +{ + char *hintstr = futils_fstr_to_cstr(hints, hints_len); + ADIOS_SELECTION * sel = common_read_selection_auto (hintstr); + *fsel = (int64_t) sel; + free (hintstr); +} + +void FC_FUNC_(adios_selection_delete, ADIOS_SELECTION_AUTO) (int64_t *fsel) +{ + ADIOS_SELECTION * sel = (ADIOS_SELECTION *) *fsel; + common_read_selection_delete (sel); + *fsel = 0; +} + + +/**************************************************************************/ +/* Specific function for each data type */ +/**************************************************************************/ + +/* ADIOS_GET_SCALAR */ +void FC_FUNC_(adios_get_scalar_int1, ADIOS_GET_SCALAR_INT1) (int64_t * fp, char * varname, void * data, int * err, int varname_len) { FC_FUNC_(adios_get_scalar, ADIOS_GET_SCALAR) (fp, varname, data, err, varname_len); } +void FC_FUNC_(adios_get_scalar_int2, ADIOS_GET_SCALAR_INT2) (int64_t * fp, char * varname, void * data, int * err, int varname_len) { FC_FUNC_(adios_get_scalar, ADIOS_GET_SCALAR) (fp, varname, data, err, varname_len); } +void FC_FUNC_(adios_get_scalar_int4, ADIOS_GET_SCALAR_INT4) (int64_t * fp, char * varname, void * data, int * err, int varname_len) { FC_FUNC_(adios_get_scalar, ADIOS_GET_SCALAR) (fp, varname, data, err, varname_len); } +void FC_FUNC_(adios_get_scalar_int8, ADIOS_GET_SCALAR_INT8) (int64_t * fp, char * varname, void * data, int * err, int varname_len) { FC_FUNC_(adios_get_scalar, ADIOS_GET_SCALAR) (fp, varname, data, err, varname_len); } +void FC_FUNC_(adios_get_scalar_real4, ADIOS_GET_SCALAR_REAL4) (int64_t * fp, char * varname, void * data, int * err, int varname_len) { FC_FUNC_(adios_get_scalar, ADIOS_GET_SCALAR) (fp, varname, data, err, varname_len); } +void FC_FUNC_(adios_get_scalar_real8, ADIOS_GET_SCALAR_REAL8) (int64_t * fp, char * varname, void * data, int * err, int varname_len) { FC_FUNC_(adios_get_scalar, ADIOS_GET_SCALAR) (fp, varname, data, err, varname_len); } +void FC_FUNC_(adios_get_scalar_char, ADIOS_GET_SCALAR_CHAR) (int64_t * fp, char * varname, void * data, int * err, int varname_len) { FC_FUNC_(adios_get_scalar, ADIOS_GET_SCALAR) (fp, varname, data, err, varname_len); } +void FC_FUNC_(adios_get_scalar_complex8, ADIOS_GET_SCALAR_COMPLEX8) (int64_t * fp, char * varname, void * data, int * err, int varname_len) { FC_FUNC_(adios_get_scalar, ADIOS_GET_SCALAR) (fp, varname, data, err, varname_len); } +void FC_FUNC_(adios_get_scalar_complex16, ADIOS_GET_SCALAR_COMPLEX16) (int64_t * fp, char * varname, void * data, int * err, int varname_len) { FC_FUNC_(adios_get_scalar, ADIOS_GET_SCALAR) (fp, varname, data, err, varname_len); } +void FC_FUNC_(adios_get_scalar_logical1, ADIOS_GET_SCALAR_LOGICAL1) (int64_t * fp, char * varname, void * data, int * err, int varname_len) { FC_FUNC_(adios_get_scalar, ADIOS_GET_SCALAR) (fp, varname, data, err, varname_len); } +void FC_FUNC_(adios_get_scalar_logical2, ADIOS_GET_SCALAR_LOGICAL2) (int64_t * fp, char * varname, void * data, int * err, int varname_len) { FC_FUNC_(adios_get_scalar, ADIOS_GET_SCALAR) (fp, varname, data, err, varname_len); } +void FC_FUNC_(adios_get_scalar_logical4, ADIOS_GET_SCALAR_LOGICAL4) (int64_t * fp, char * varname, void * data, int * err, int varname_len) { FC_FUNC_(adios_get_scalar, ADIOS_GET_SCALAR) (fp, varname, data, err, varname_len); } +void FC_FUNC_(adios_get_scalar_logical8, ADIOS_GET_SCALAR_LOGICAL8) (int64_t * fp, char * varname, void * data, int * err, int varname_len) { FC_FUNC_(adios_get_scalar, ADIOS_GET_SCALAR) (fp, varname, data, err, varname_len); } + +/* ADIOS_SCHEDULE_READ */ +/* scalars */ +#if 0 +void FC_FUNC_(adios_schedule_read_int1_d0, ADIOS_SCHEDULE_READ_INT1_D0) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_int2_d0, ADIOS_SCHEDULE_READ_INT2_D0) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_int4_d0, ADIOS_SCHEDULE_READ_INT4_D0) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_int8_d0, ADIOS_SCHEDULE_READ_INT8_D0) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_real4_d0, ADIOS_SCHEDULE_READ_REAL4_D0) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_real8_d0, ADIOS_SCHEDULE_READ_REAL8_D0) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +//void FC_FUNC_(adios_schedule_read_char_d0, ADIOS_SCHEDULE_READ_CHAR_D0) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_complex8_d0, ADIOS_SCHEDULE_READ_COMPLEX8_D0) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_complex16_d0, ADIOS_SCHEDULE_READ_COMPLEX16_D0) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_logical1_d0, ADIOS_SCHEDULE_READ_LOGICAL1_D0) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_logical2_d0, ADIOS_SCHEDULE_READ_LOGICAL2_D0) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_logical4_d0, ADIOS_SCHEDULE_READ_LOGICAL4_D0) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_logical8_d0, ADIOS_SCHEDULE_READ_LOGICAL8_D0) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } + +/* 1D */ +void FC_FUNC_(adios_schedule_read_int1_d1, ADIOS_SCHEDULE_READ_INT1_D1) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_int2_d1, ADIOS_SCHEDULE_READ_INT2_D1) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_int4_d1, ADIOS_SCHEDULE_READ_INT4_D1) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_int8_d1, ADIOS_SCHEDULE_READ_INT8_D1) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_real4_d1, ADIOS_SCHEDULE_READ_REAL4_D1) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_real8_d1, ADIOS_SCHEDULE_READ_REAL8_D1) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_char_d1, ADIOS_SCHEDULE_READ_CHAR_D1) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_complex8_d1, ADIOS_SCHEDULE_READ_COMPLEX8_D1) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_complex16_d1, ADIOS_SCHEDULE_READ_COMPLEX16_D1) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_logical1_d1, ADIOS_SCHEDULE_READ_LOGICAL1_D1) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_logical2_d1, ADIOS_SCHEDULE_READ_LOGICAL2_D1) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_logical4_d1, ADIOS_SCHEDULE_READ_LOGICAL4_D1) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_logical8_d1, ADIOS_SCHEDULE_READ_LOGICAL8_D1) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } + +/* 2D */ +void FC_FUNC_(adios_schedule_read_int1_d2, ADIOS_SCHEDULE_READ_INT1_D2) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_int2_d2, ADIOS_SCHEDULE_READ_INT2_D2) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_int4_d2, ADIOS_SCHEDULE_READ_INT4_D2) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_int8_d2, ADIOS_SCHEDULE_READ_INT8_D2) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_real4_d2, ADIOS_SCHEDULE_READ_REAL4_D2) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_real8_d2, ADIOS_SCHEDULE_READ_REAL8_D2) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_char_d2, ADIOS_SCHEDULE_READ_CHAR_D2) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_complex8_d2, ADIOS_SCHEDULE_READ_COMPLEX8_D2) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_complex16_d2, ADIOS_SCHEDULE_READ_COMPLEX16_D2) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_logical1_d2, ADIOS_SCHEDULE_READ_LOGICAL1_D2) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_logical2_d2, ADIOS_SCHEDULE_READ_LOGICAL2_D2) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_logical4_d2, ADIOS_SCHEDULE_READ_LOGICAL4_D2) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_logical8_d2, ADIOS_SCHEDULE_READ_LOGICAL8_D2) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } + +/* 3D */ +void FC_FUNC_(adios_schedule_read_int1_d3, ADIOS_SCHEDULE_READ_INT1_D3) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_int2_d3, ADIOS_SCHEDULE_READ_INT2_D3) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_int4_d3, ADIOS_SCHEDULE_READ_INT4_D3) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_int8_d3, ADIOS_SCHEDULE_READ_INT8_D3) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_real4_d3, ADIOS_SCHEDULE_READ_REAL4_D3) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_real8_d3, ADIOS_SCHEDULE_READ_REAL8_D3) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_char_d3, ADIOS_SCHEDULE_READ_CHAR_D3) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_complex8_d3, ADIOS_SCHEDULE_READ_COMPLEX8_D3) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_complex16_d3, ADIOS_SCHEDULE_READ_COMPLEX16_D3) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_logical1_d3, ADIOS_SCHEDULE_READ_LOGICAL1_D3) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_logical2_d3, ADIOS_SCHEDULE_READ_LOGICAL2_D3) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_logical4_d3, ADIOS_SCHEDULE_READ_LOGICAL4_D3) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_logical8_d3, ADIOS_SCHEDULE_READ_LOGICAL8_D3) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } + +/* 4D */ +void FC_FUNC_(adios_schedule_read_int1_d4, ADIOS_SCHEDULE_READ_INT1_D4) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_int2_d4, ADIOS_SCHEDULE_READ_INT2_D4) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_int4_d4, ADIOS_SCHEDULE_READ_INT4_D4) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_int8_d4, ADIOS_SCHEDULE_READ_INT8_D4) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_real4_d4, ADIOS_SCHEDULE_READ_REAL4_D4) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_real8_d4, ADIOS_SCHEDULE_READ_REAL8_D4) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_char_d4, ADIOS_SCHEDULE_READ_CHAR_D4) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_complex8_d4, ADIOS_SCHEDULE_READ_COMPLEX8_D4) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_complex16_d4, ADIOS_SCHEDULE_READ_COMPLEX16_D4) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_logical1_d4, ADIOS_SCHEDULE_READ_LOGICAL1_D4) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_logical2_d4, ADIOS_SCHEDULE_READ_LOGICAL2_D4) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_logical4_d4, ADIOS_SCHEDULE_READ_LOGICAL4_D4) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_logical8_d4, ADIOS_SCHEDULE_READ_LOGICAL8_D4) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } + +/* 5D */ +void FC_FUNC_(adios_schedule_read_int1_d5, ADIOS_SCHEDULE_READ_INT1_D5) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_int2_d5, ADIOS_SCHEDULE_READ_INT2_D5) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_int4_d5, ADIOS_SCHEDULE_READ_INT4_D5) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_int8_d5, ADIOS_SCHEDULE_READ_INT8_D5) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_real4_d5, ADIOS_SCHEDULE_READ_REAL4_D5) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_real8_d5, ADIOS_SCHEDULE_READ_REAL8_D5) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_char_d5, ADIOS_SCHEDULE_READ_CHAR_D5) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_complex8_d5, ADIOS_SCHEDULE_READ_COMPLEX8_D5) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_complex16_d5, ADIOS_SCHEDULE_READ_COMPLEX16_D5) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_logical1_d5, ADIOS_SCHEDULE_READ_LOGICAL1_D5) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_logical2_d5, ADIOS_SCHEDULE_READ_LOGICAL2_D5) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_logical4_d5, ADIOS_SCHEDULE_READ_LOGICAL4_D5) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_logical8_d5, ADIOS_SCHEDULE_READ_LOGICAL8_D5) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } + +/* 6D */ +void FC_FUNC_(adios_schedule_read_int1_d6, ADIOS_SCHEDULE_READ_INT1_D6) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_int2_d6, ADIOS_SCHEDULE_READ_INT2_D6) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_int4_d6, ADIOS_SCHEDULE_READ_INT4_D6) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_int8_d6, ADIOS_SCHEDULE_READ_INT8_D6) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_real4_d6, ADIOS_SCHEDULE_READ_REAL4_D6) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_real8_d6, ADIOS_SCHEDULE_READ_REAL8_D6) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_char_d6, ADIOS_SCHEDULE_READ_CHAR_D6) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_complex8_d6, ADIOS_SCHEDULE_READ_COMPLEX8_D6) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_complex16_d6, ADIOS_SCHEDULE_READ_COMPLEX16_D6) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_logical1_d6, ADIOS_SCHEDULE_READ_LOGICAL1_D6) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_logical2_d6, ADIOS_SCHEDULE_READ_LOGICAL2_D6) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_logical4_d6, ADIOS_SCHEDULE_READ_LOGICAL4_D6) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +void FC_FUNC_(adios_schedule_read_logical8_d6, ADIOS_SCHEDULE_READ_LOGICAL8_D6) (int64_t * gp, int64_t * fsel, char * varname, int * from_step, int * nsteps, void * data, int * err, int varname_len) { FC_FUNC_(adios_schedule_read, ADIOS_SCHEDULE_READ) (gp, fsel, varname, from_step, nsteps, data, err, varname_len); } +#endif + +/* ADIOS_GET_STATISTICS */ +void FC_FUNC_(adios_get_statistics_int1, ADIOS_GET_STATISTICS_INT1) (int64_t * gp, char * varname, void * value, void * gmin, void * gmax, void * gavg, void * gstd_dev, void * mins, void * maxs, void * avgs, void * std_devs, int * err, int varname_len) { FC_FUNC_(adios_get_statistics, ADIOS_GET_STATISTICS) (gp, varname, value, gmin, gmax, gavg, gstd_dev, mins, maxs, avgs, std_devs, err, varname_len); } +void FC_FUNC_(adios_get_statistics_int2, ADIOS_GET_STATISTICS_INT2) (int64_t * gp, char * varname, void * value, void * gmin, void * gmax, void * gavg, void * gstd_dev, void * mins, void * maxs, void * avgs, void * std_devs, int * err, int varname_len) { FC_FUNC_(adios_get_statistics, ADIOS_GET_STATISTICS) (gp, varname, value, gmin, gmax, gavg, gstd_dev, mins, maxs, avgs, std_devs, err, varname_len); } +void FC_FUNC_(adios_get_statistics_int4, ADIOS_GET_STATISTICS_INT4) (int64_t * gp, char * varname, void * value, void * gmin, void * gmax, void * gavg, void * gstd_dev, void * mins, void * maxs, void * avgs, void * std_devs, int * err, int varname_len) { FC_FUNC_(adios_get_statistics, ADIOS_GET_STATISTICS) (gp, varname, value, gmin, gmax, gavg, gstd_dev, mins, maxs, avgs, std_devs, err, varname_len); } +void FC_FUNC_(adios_get_statistics_int8, ADIOS_GET_STATISTICS_INT8) (int64_t * gp, char * varname, void * value, void * gmin, void * gmax, void * gavg, void * gstd_dev, void * mins, void * maxs, void * avgs, void * std_devs, int * err, int varname_len) { FC_FUNC_(adios_get_statistics, ADIOS_GET_STATISTICS) (gp, varname, value, gmin, gmax, gavg, gstd_dev, mins, maxs, avgs, std_devs, err, varname_len); } +void FC_FUNC_(adios_get_statistics_real4, ADIOS_GET_STATISTICS_REAL4) (int64_t * gp, char * varname, void * value, void * gmin, void * gmax, void * gavg, void * gstd_dev, void * mins, void * maxs, void * avgs, void * std_devs, int * err, int varname_len) { FC_FUNC_(adios_get_statistics, ADIOS_GET_STATISTICS) (gp, varname, value, gmin, gmax, gavg, gstd_dev, mins, maxs, avgs, std_devs, err, varname_len); } +void FC_FUNC_(adios_get_statistics_real8, ADIOS_GET_STATISTICS_REAL8) (int64_t * gp, char * varname, void * value, void * gmin, void * gmax, void * gavg, void * gstd_dev, void * mins, void * maxs, void * avgs, void * std_devs, int * err, int varname_len) { FC_FUNC_(adios_get_statistics, ADIOS_GET_STATISTICS) (gp, varname, value, gmin, gmax, gavg, gstd_dev, mins, maxs, avgs, std_devs, err, varname_len); } +void FC_FUNC_(adios_get_statistics_complex8, ADIOS_GET_STATISTICS_COMPLEX8) (int64_t * gp, char * varname, void * value, void * gmin, void * gmax, void * gavg, void * gstd_dev, void * mins, void * maxs, void * avgs, void * std_devs, int * err, int varname_len) { FC_FUNC_(adios_get_statistics, ADIOS_GET_STATISTICS) (gp, varname, value, gmin, gmax, gavg, gstd_dev, mins, maxs, avgs, std_devs, err, varname_len); } +void FC_FUNC_(adios_get_statistics_complex16, ADIOS_GET_STATISTICS_COMPLEX16) (int64_t * gp, char * varname, void * value, void * gmin, void * gmax, void * gavg, void * gstd_dev, void * mins, void * maxs, void * avgs, void * std_devs, int * err, int varname_len) { FC_FUNC_(adios_get_statistics, ADIOS_GET_STATISTICS) (gp, varname, value, gmin, gmax, gavg, gstd_dev, mins, maxs, avgs, std_devs, err, varname_len); } +void FC_FUNC_(adios_get_statistics_char, ADIOS_GET_STATISTICS_CHAR) (int64_t * gp, char * varname, void * value, void * gmin, void * gmax, void * gavg, void * gstd_dev, void * mins, void * maxs, void * avgs, void * std_devs, int * err, int varname_len) { FC_FUNC_(adios_get_statistics, ADIOS_GET_STATISTICS) (gp, varname, value, gmin, gmax, gavg, gstd_dev, mins, maxs, avgs, std_devs, err, varname_len); } +void FC_FUNC_(adios_get_statistics_logical1, ADIOS_GET_STATISTICS_LOGICAL1) (int64_t * gp, char * varname, void * value, void * gmin, void * gmax, void * gavg, void * gstd_dev, void * mins, void * maxs, void * avgs, void * std_devs, int * err, int varname_len) { FC_FUNC_(adios_get_statistics, ADIOS_GET_STATISTICS) (gp, varname, value, gmin, gmax, gavg, gstd_dev, mins, maxs, avgs, std_devs, err, varname_len); } +void FC_FUNC_(adios_get_statistics_logical2, ADIOS_GET_STATISTICS_LOGICAL2) (int64_t * gp, char * varname, void * value, void * gmin, void * gmax, void * gavg, void * gstd_dev, void * mins, void * maxs, void * avgs, void * std_devs, int * err, int varname_len) { FC_FUNC_(adios_get_statistics, ADIOS_GET_STATISTICS) (gp, varname, value, gmin, gmax, gavg, gstd_dev, mins, maxs, avgs, std_devs, err, varname_len); } +void FC_FUNC_(adios_get_statistics_logical4, ADIOS_GET_STATISTICS_LOGICAL4) (int64_t * gp, char * varname, void * value, void * gmin, void * gmax, void * gavg, void * gstd_dev, void * mins, void * maxs, void * avgs, void * std_devs, int * err, int varname_len) { FC_FUNC_(adios_get_statistics, ADIOS_GET_STATISTICS) (gp, varname, value, gmin, gmax, gavg, gstd_dev, mins, maxs, avgs, std_devs, err, varname_len); } +void FC_FUNC_(adios_get_statistics_logical8, ADIOS_GET_STATISTICS_LOGICAL8) (int64_t * gp, char * varname, void * value, void * gmin, void * gmax, void * gavg, void * gstd_dev, void * mins, void * maxs, void * avgs, void * std_devs, int * err, int varname_len) { FC_FUNC_(adios_get_statistics, ADIOS_GET_STATISTICS) (gp, varname, value, gmin, gmax, gavg, gstd_dev, mins, maxs, avgs, std_devs, err, varname_len); } + + +/* ADIOS_GET_ATTR */ +void FC_FUNC_(adios_get_attr_int1, ADIOS_GET_ATTR_INT1) (int64_t * gp, char * attrname, void * attr, int * err, int attrname_len) { FC_FUNC_(adios_get_attr, ADIOS_GET_ATTR) (gp, attrname, attr, err, attrname_len); } +void FC_FUNC_(adios_get_attr_int2, ADIOS_GET_ATTR_INT2) (int64_t * gp, char * attrname, void * attr, int * err, int attrname_len) { FC_FUNC_(adios_get_attr, ADIOS_GET_ATTR) (gp, attrname, attr, err, attrname_len); } +void FC_FUNC_(adios_get_attr_int4, ADIOS_GET_ATTR_INT4) (int64_t * gp, char * attrname, void * attr, int * err, int attrname_len) { FC_FUNC_(adios_get_attr, ADIOS_GET_ATTR) (gp, attrname, attr, err, attrname_len); } +void FC_FUNC_(adios_get_attr_int8, ADIOS_GET_ATTR_INT8) (int64_t * gp, char * attrname, void * attr, int * err, int attrname_len) { FC_FUNC_(adios_get_attr, ADIOS_GET_ATTR) (gp, attrname, attr, err, attrname_len); } +void FC_FUNC_(adios_get_attr_real4, ADIOS_GET_ATTR_REAL4) (int64_t * gp, char * attrname, void * attr, int * err, int attrname_len) { FC_FUNC_(adios_get_attr, ADIOS_GET_ATTR) (gp, attrname, attr, err, attrname_len); } +void FC_FUNC_(adios_get_attr_real8, ADIOS_GET_ATTR_REAL8) (int64_t * gp, char * attrname, void * attr, int * err, int attrname_len) { FC_FUNC_(adios_get_attr, ADIOS_GET_ATTR) (gp, attrname, attr, err, attrname_len); } +void FC_FUNC_(adios_get_attr_complex8, ADIOS_GET_ATTR_COMPLEX8) (int64_t * gp, char * attrname, void * attr, int * err, int attrname_len) { FC_FUNC_(adios_get_attr, ADIOS_GET_ATTR) (gp, attrname, attr, err, attrname_len); } +void FC_FUNC_(adios_get_attr_complex16, ADIOS_GET_ATTR_COMPLEX16) (int64_t * gp, char * attrname, void * attr, int * err, int attrname_len) { FC_FUNC_(adios_get_attr, ADIOS_GET_ATTR) (gp, attrname, attr, err, attrname_len); } +void FC_FUNC_(adios_get_attr_char, ADIOS_GET_ATTR_CHAR) (int64_t * gp, char * attrname, void * attr, int * err, int attrname_len, int attr_len) { FC_FUNC_(adios_get_attr, ADIOS_GET_ATTR) (gp, attrname, attr, err, attrname_len); } +void FC_FUNC_(adios_get_attr_logical1, ADIOS_GET_ATTR_LOGICAL1) (int64_t * gp, char * attrname, void * attr, int * err, int attrname_len) { FC_FUNC_(adios_get_attr, ADIOS_GET_ATTR) (gp, attrname, attr, err, attrname_len); } +void FC_FUNC_(adios_get_attr_logical2, ADIOS_GET_ATTR_LOGICAL2) (int64_t * gp, char * attrname, void * attr, int * err, int attrname_len) { FC_FUNC_(adios_get_attr, ADIOS_GET_ATTR) (gp, attrname, attr, err, attrname_len); } +void FC_FUNC_(adios_get_attr_logical4, ADIOS_GET_ATTR_LOGICAL4) (int64_t * gp, char * attrname, void * attr, int * err, int attrname_len) { FC_FUNC_(adios_get_attr, ADIOS_GET_ATTR) (gp, attrname, attr, err, attrname_len); } +void FC_FUNC_(adios_get_attr_logical8, ADIOS_GET_ATTR_LOGICAL8) (int64_t * gp, char * attrname, void * attr, int * err, int attrname_len) { FC_FUNC_(adios_get_attr, ADIOS_GET_ATTR) (gp, attrname, attr, err, attrname_len); } + + diff --git a/tests/libs/adios/src/core/adiosf_read_mod.f90 b/tests/libs/adios/src/core/adiosf_read_mod.f90 new file mode 100644 index 0000000000..563671b186 --- /dev/null +++ b/tests/libs/adios/src/core/adiosf_read_mod.f90 @@ -0,0 +1,2100 @@ +! +! ADIOS is freely available under the terms of the BSD license described +! in the COPYING file in the top level directory of this source distribution. +! +! Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. +! + +! +! Read Fortran 90 API for ADIOS BP format files +! +! Use this module in your source code to ensure that +! you are calling the adios_* reading functions with +! the correct arguments +! +module adios_read_mod + + use adios_defs_mod + + interface + + subroutine adios_errmsg (msg) + implicit none + character(*), intent(out) :: msg + end subroutine + + subroutine adios_read_init_method (method, comm, parameters, err) + implicit none + integer, intent(in) :: method + integer, intent(in) :: comm + character(*), intent(in) :: parameters + integer, intent(out) :: err + end subroutine + + subroutine adios_read_finalize_method (method, err) + implicit none + integer, intent(in) :: method + integer, intent(out) :: err + end subroutine + + subroutine adios_read_open (fp, fname, method, comm, lockmode, timeout_sec, err) + implicit none + integer*8, intent(out) :: fp + character(*), intent(in) :: fname + integer, intent(in) :: method + integer, intent(in) :: comm + integer, intent(in) :: lockmode + real, intent(in) :: timeout_sec + integer, intent(out) :: err + end subroutine + + subroutine adios_read_open_file (fp, fname, method, comm, err) + implicit none + integer*8, intent(out) :: fp + character(*), intent(in) :: fname + integer, intent(in) :: method + integer, intent(in) :: comm + integer, intent(out) :: err + end subroutine + + subroutine adios_advance_step (fp, last, timeout_sec, err) + implicit none + integer*8, intent(in) :: fp + integer, intent(in) :: last + real, intent(in) :: timeout_sec + integer, intent(out) :: err + end subroutine + + subroutine adios_release_step (fp, err) + implicit none + integer*8, intent(in) :: fp + integer, intent(out) :: err + end subroutine + + subroutine adios_reset_dimension_order (fp, flag) + implicit none + integer*8, intent(in) :: fp + integer, intent(in) :: flag + end subroutine + + subroutine adios_read_close (fp, err) + implicit none + integer*8, intent(in) :: fp + integer, intent(out) :: err + end subroutine + + subroutine adios_inq_ngroups (fp, groups_count, err) + implicit none + integer*8, intent(in) :: fp + integer, intent(out) :: groups_count + integer, intent(out) :: err + end subroutine + + subroutine adios_inq_groupnames (fp, gnamelist, err) + implicit none + integer*8, intent(in) :: fp + character(*), dimension(*), intent(inout) :: gnamelist + integer, intent(out) :: err + end subroutine + + subroutine adios_group_view (fp, groupid, err) + implicit none + integer*8, intent(in) :: fp + integer, intent(in) :: groupid + integer, intent(out) :: err + end subroutine + + subroutine adios_inq_file (fp, vars_count, attrs_count, current_step, last_step, err) + implicit none + integer*8, intent(in) :: fp + integer, intent(out) :: vars_count + integer, intent(out) :: attrs_count + integer, intent(out) :: current_step + integer, intent(out) :: last_step + integer, intent(out) :: err + end subroutine + + subroutine adios_inq_varnames (fp, vnamelist, err) + implicit none + integer*8, intent(in) :: fp + character(*), dimension(*), intent(inout) :: vnamelist + integer, intent(out) :: err + end subroutine + + subroutine adios_inq_attrnames (fp, anamelist, err) + implicit none + integer*8, intent(in) :: fp + character(*), dimension(*), intent(inout) :: anamelist + integer, intent(out) :: err + end subroutine + + subroutine adios_inq_var (fp, varname, vartype, nsteps, ndim, dims, err) + implicit none + integer*8, intent(in) :: fp + character(*), intent(in) :: varname + integer, intent(out) :: vartype + integer, intent(out) :: nsteps + integer, intent(out) :: ndim + integer*8, dimension(*), intent(out) :: dims + integer, intent(out) :: err + end subroutine + + subroutine adios_inq_attr (fp, attrname, attrtype, attrsize, err) + implicit none + integer*8, intent(in) :: fp + character(*), intent(in) :: attrname + integer, intent(out) :: attrtype + integer, intent(out) :: attrsize + integer, intent(out) :: err + end subroutine + + subroutine adios_perform_reads (fp, err) + implicit none + integer*8, intent(in) :: fp + integer, intent(out) :: err + end subroutine + + subroutine adios_selection_boundingbox (sel, ndim, start, count) + implicit none + integer*8, intent(out) :: sel + integer, intent(in) :: ndim + integer*8, dimension(*), intent(in) :: start + integer*8, dimension(*), intent(in) :: count + end subroutine + + subroutine adios_selection_points (sel, ndim, npoints, points) + implicit none + integer*8, intent(out) :: sel + integer, intent(in) :: ndim + integer*8, intent(in) :: npoints + integer*8, dimension(*), intent(in) :: points + end subroutine + + subroutine adios_selection_writeblock (sel, index) + implicit none + integer*8, intent(out) :: sel + integer, intent(in) :: index + end subroutine + + subroutine adios_selection_auto (sel, hints) + implicit none + integer*8, intent(out) :: sel + character(*), intent(in) :: hints + end subroutine + + subroutine adios_selection_delete (sel) + implicit none + integer*8, intent(in) :: sel + end subroutine + + end interface + + ! + ! ADIOS_GET_SCALAR generic interface + ! + ! Usage: call adios_get_scalar (gp, varname, data, err) + ! + interface adios_get_scalar + + ! INTEGER*1 scalar + subroutine adios_get_scalar_int1 (fp, varname, data, err) + implicit none + integer*8, intent(in) :: fp + character(*), intent(in) :: varname + integer*1, intent(out) :: data + integer, intent(out) :: err + end subroutine + + ! INTEGER*2 scalar + subroutine adios_get_scalar_int2 (fp, varname, data, err) + implicit none + integer*8, intent(in) :: fp + character(*), intent(in) :: varname + integer*2, intent(out) :: data + integer, intent(out) :: err + end subroutine + + ! INTEGER*4 scalar + subroutine adios_get_scalar_int4 (fp, varname, data, err) + implicit none + integer*8, intent(in) :: fp + character(*), intent(in) :: varname + integer*4, intent(out) :: data + integer, intent(out) :: err + end subroutine + + ! INTEGER*8 scalar + subroutine adios_get_scalar_int8 (fp, varname, data, err) + implicit none + integer*8, intent(in) :: fp + character(*), intent(in) :: varname + integer*8, intent(out) :: data + integer, intent(out) :: err + end subroutine + + ! REAL*4 scalar + subroutine adios_get_scalar_real4 (fp, varname, data, err) + implicit none + integer*8, intent(in) :: fp + character(*), intent(in) :: varname + real*4, intent(out) :: data + integer, intent(out) :: err + end subroutine + + ! REAL*8 scalar + subroutine adios_get_scalar_real8 (fp, varname, data, err) + implicit none + integer*8, intent(in) :: fp + character(*), intent(in) :: varname + real*8, intent(out) :: data + integer, intent(out) :: err + end subroutine + + ! COMPLEX*8 scalar + subroutine adios_get_scalar_complex8 (fp, varname, data, err) + implicit none + integer*8, intent(in) :: fp + character(*), intent(in) :: varname + complex*8, intent(out) :: data + integer, intent(out) :: err + end subroutine + + ! COMPLEX*16 scalar + subroutine adios_get_scalar_complex16 (fp, varname, data, err) + implicit none + integer*8, intent(in) :: fp + character(*), intent(in) :: varname + complex*16, intent(out) :: data + integer, intent(out) :: err + end subroutine + + ! CHARACTER(*) string + subroutine adios_get_scalar_char (fp, varname, data, err) + implicit none + integer*8, intent(in) :: fp + character(*), intent(in) :: varname + character(*), intent(inout) :: data + integer, intent(out) :: err + end subroutine + + ! LOGICAL*1 scalar + subroutine adios_get_scalar_logical1 (fp, varname, data, err) + implicit none + integer*8, intent(in) :: fp + character(*), intent(in) :: varname + logical*1, intent(out) :: data + integer, intent(out) :: err + end subroutine + + ! LOGICAL*2 scalar + subroutine adios_get_scalar_logical2 (fp, varname, data, err) + implicit none + integer*8, intent(in) :: fp + character(*), intent(in) :: varname + logical*2, intent(out) :: data + integer, intent(out) :: err + end subroutine + + ! LOGICAL*4 scalar + subroutine adios_get_scalar_logical4 (fp, varname, data, err) + implicit none + integer*8, intent(in) :: fp + character(*), intent(in) :: varname + logical*4, intent(out) :: data + integer, intent(out) :: err + end subroutine + + ! LOGICAL*8 scalar + subroutine adios_get_scalar_logical8 (fp, varname, data, err) + implicit none + integer*8, intent(in) :: fp + character(*), intent(in) :: varname + logical*8, intent(out) :: data + integer, intent(out) :: err + end subroutine + + end interface + + ! + ! ADIOS_GET_ATTR generic interface + ! + ! Usage: call adios_get_attr (fp, varname, attr, err) + ! + interface adios_get_attr + + ! INTEGER*1 + subroutine adios_get_attr_int1 (fp, attrname, attr, err) + implicit none + integer*8, intent(in) :: fp + character(*), intent(in) :: attrname + integer*1, intent(out) :: attr + integer, intent(out) :: err + end subroutine + + ! INTEGER*2 + subroutine adios_get_attr_int2 (fp, attrname, attr, err) + implicit none + integer*8, intent(in) :: fp + character(*), intent(in) :: attrname + integer*2, intent(out) :: attr + integer, intent(out) :: err + end subroutine + + ! INTEGER*4 + subroutine adios_get_attr_int4 (fp, attrname, attr, err) + implicit none + integer*8, intent(in) :: fp + character(*), intent(in) :: attrname + integer*4, intent(out) :: attr + integer, intent(out) :: err + end subroutine + + ! INTEGER*8 + subroutine adios_get_attr_int8 (fp, attrname, attr, err) + implicit none + integer*8, intent(in) :: fp + character(*), intent(in) :: attrname + integer*8, intent(out) :: attr + integer, intent(out) :: err + end subroutine + + ! REAL*4 + subroutine adios_get_attr_real4 (fp, attrname, attr, err) + implicit none + integer*8, intent(in) :: fp + character(*), intent(in) :: attrname + real*4, intent(out) :: attr + integer, intent(out) :: err + end subroutine + + ! REAL*8 + subroutine adios_get_attr_real8 (fp, attrname, attr, err) + implicit none + integer*8, intent(in) :: fp + character(*), intent(in) :: attrname + real*8, intent(out) :: attr + integer, intent(out) :: err + end subroutine + + ! COMPLEX*8 + subroutine adios_get_attr_complex8 (fp, attrname, attr, err) + implicit none + integer*8, intent(in) :: fp + character(*), intent(in) :: attrname + complex, intent(out) :: attr + integer, intent(out) :: err + end subroutine + + ! COMPLEX*16 + subroutine adios_get_attr_complex16 (fp, attrname, attr, err) + implicit none + integer*8, intent(in) :: fp + character(*), intent(in) :: attrname + complex*16, intent(out) :: attr + integer, intent(out) :: err + end subroutine + + ! CHARACTER(*) + subroutine adios_get_attr_char (fp, attrname, attr, err) + implicit none + integer*8, intent(in) :: fp + character(*), intent(in) :: attrname + character(*), intent(out) :: attr + integer, intent(out) :: err + end subroutine + + ! LOGICAL*1 + subroutine adios_get_attr_logical1 (fp, attrname, attr, err) + implicit none + integer*8, intent(in) :: fp + character(*), intent(in) :: attrname + logical*1, intent(out) :: attr + integer, intent(out) :: err + end subroutine + + ! LOGICAL*2 + subroutine adios_get_attr_logical2 (fp, attrname, attr, err) + implicit none + integer*8, intent(in) :: fp + character(*), intent(in) :: attrname + logical*2, intent(out) :: attr + integer, intent(out) :: err + end subroutine + + ! LOGICAL*4 + subroutine adios_get_attr_logical4 (fp, attrname, attr, err) + implicit none + integer*8, intent(in) :: fp + character(*), intent(in) :: attrname + logical*4, intent(out) :: attr + integer, intent(out) :: err + end subroutine + + ! LOGICAL*8 + subroutine adios_get_attr_logical8 (fp, attrname, attr, err) + implicit none + integer*8, intent(in) :: fp + character(*), intent(in) :: attrname + logical*8, intent(out) :: attr + integer, intent(out) :: err + end subroutine + + end interface + + ! + ! ADIOS_SCHEDULE_READ generic interface + ! + ! Usage: call adios_schedule_read (fp, sel, varname, from_step, nsteps, data, err) + ! + interface adios_schedule_read + module procedure adios_schedule_read_int1_d0 + module procedure adios_schedule_read_int2_d0 + module procedure adios_schedule_read_int4_d0 + module procedure adios_schedule_read_int8_d0 + module procedure adios_schedule_read_real4_d0 + module procedure adios_schedule_read_real8_d0 + module procedure adios_schedule_read_complex8_d0 + module procedure adios_schedule_read_complex16_d0 + !module procedure adios_schedule_read_char_d0 + module procedure adios_schedule_read_logical1_d0 + module procedure adios_schedule_read_logical2_d0 + module procedure adios_schedule_read_logical4_d0 + module procedure adios_schedule_read_logical8_d0 + module procedure adios_schedule_read_int1_d1 + module procedure adios_schedule_read_int2_d1 + module procedure adios_schedule_read_int4_d1 + module procedure adios_schedule_read_int8_d1 + module procedure adios_schedule_read_real4_d1 + module procedure adios_schedule_read_real8_d1 + module procedure adios_schedule_read_complex8_d1 + module procedure adios_schedule_read_complex16_d1 + module procedure adios_schedule_read_char_d1 + module procedure adios_schedule_read_logical1_d1 + module procedure adios_schedule_read_logical2_d1 + module procedure adios_schedule_read_logical4_d1 + module procedure adios_schedule_read_logical8_d1 + module procedure adios_schedule_read_int1_d2 + module procedure adios_schedule_read_int2_d2 + module procedure adios_schedule_read_int4_d2 + module procedure adios_schedule_read_int8_d2 + module procedure adios_schedule_read_real4_d2 + module procedure adios_schedule_read_real8_d2 + module procedure adios_schedule_read_complex8_d2 + module procedure adios_schedule_read_complex16_d2 + module procedure adios_schedule_read_char_d2 + module procedure adios_schedule_read_logical1_d2 + module procedure adios_schedule_read_logical2_d2 + module procedure adios_schedule_read_logical4_d2 + module procedure adios_schedule_read_logical8_d2 + module procedure adios_schedule_read_int1_d3 + module procedure adios_schedule_read_int2_d3 + module procedure adios_schedule_read_int4_d3 + module procedure adios_schedule_read_int8_d3 + module procedure adios_schedule_read_real4_d3 + module procedure adios_schedule_read_real8_d3 + module procedure adios_schedule_read_complex8_d3 + module procedure adios_schedule_read_complex16_d3 + module procedure adios_schedule_read_char_d3 + module procedure adios_schedule_read_logical1_d3 + module procedure adios_schedule_read_logical2_d3 + module procedure adios_schedule_read_logical4_d3 + module procedure adios_schedule_read_logical8_d3 + module procedure adios_schedule_read_int1_d4 + module procedure adios_schedule_read_int2_d4 + module procedure adios_schedule_read_int4_d4 + module procedure adios_schedule_read_int8_d4 + module procedure adios_schedule_read_real4_d4 + module procedure adios_schedule_read_real8_d4 + module procedure adios_schedule_read_complex8_d4 + module procedure adios_schedule_read_complex16_d4 + module procedure adios_schedule_read_char_d4 + module procedure adios_schedule_read_logical1_d4 + module procedure adios_schedule_read_logical2_d4 + module procedure adios_schedule_read_logical4_d4 + module procedure adios_schedule_read_logical8_d4 + module procedure adios_schedule_read_int1_d5 + module procedure adios_schedule_read_int2_d5 + module procedure adios_schedule_read_int4_d5 + module procedure adios_schedule_read_int8_d5 + module procedure adios_schedule_read_real4_d5 + module procedure adios_schedule_read_real8_d5 + module procedure adios_schedule_read_complex8_d5 + module procedure adios_schedule_read_complex16_d5 + module procedure adios_schedule_read_char_d5 + module procedure adios_schedule_read_logical1_d5 + module procedure adios_schedule_read_logical2_d5 + module procedure adios_schedule_read_logical4_d5 + module procedure adios_schedule_read_logical8_d5 + module procedure adios_schedule_read_int1_d6 + module procedure adios_schedule_read_int2_d6 + module procedure adios_schedule_read_int4_d6 + module procedure adios_schedule_read_int8_d6 + module procedure adios_schedule_read_real4_d6 + module procedure adios_schedule_read_real8_d6 + module procedure adios_schedule_read_complex8_d6 + module procedure adios_schedule_read_complex16_d6 + module procedure adios_schedule_read_char_d6 + module procedure adios_schedule_read_logical1_d6 + module procedure adios_schedule_read_logical2_d6 + module procedure adios_schedule_read_logical4_d6 + module procedure adios_schedule_read_logical8_d6 + + end interface + + ! + ! adios_GET_STATISTICS generic interface + ! + ! Usage: call adios_get_statistics (fp, varname, value, gmin, gmax, gavg, gstd_dev, mins, maxs, avgs, std_devs, err) + ! + interface adios_get_statistics + + ! INTEGER*1 arrays + subroutine adios_get_statistics_int1 (fp, varname, value, gmin, gmax, gavg, gstd_dev, mins, maxs, avgs, std_devs, err) + implicit none + integer*8, intent(in) :: fp + character(*), intent(in) :: varname + integer*1, intent(out) :: value + integer*1, intent(out) :: gmin + integer*1, intent(out) :: gmax + real*8, intent(out) :: gavg + real*8, intent(out) :: gstd_dev + integer*1, dimension(*), intent(out) :: mins + integer*1, dimension(*), intent(out) :: maxs + real*8, dimension(*), intent(out) :: avgs + real*8, dimension(*), intent(out) :: std_devs + integer,dimension(*), intent(out) :: err + end subroutine + + ! INTEGER*2 arrays + subroutine adios_get_statistics_int2 (fp, varname, value, gmin, gmax, gavg, gstd_dev, mins, maxs, avgs, std_devs, err) + implicit none + integer*8, intent(in) :: fp + character(*), intent(in) :: varname + integer*2, intent(out) :: value + integer*2, intent(out) :: gmin + integer*2, intent(out) :: gmax + real*8, intent(out) :: gavg + real*8, intent(out) :: gstd_dev + integer*2, dimension(*), intent(out) :: mins + integer*2, dimension(*), intent(out) :: maxs + real*8, dimension(*), intent(out) :: avgs + real*8, dimension(*), intent(out) :: std_devs + integer, intent(out) :: err + end subroutine + + ! INTEGER*4 arrays + subroutine adios_get_statistics_int4 (fp, varname, value, gmin, gmax, gavg, gstd_dev, mins, maxs, avgs, std_devs, err) + implicit none + integer*8, intent(in) :: fp + character(*), intent(in) :: varname + integer*4, intent(out) :: value + integer*4, intent(out) :: gmin + integer*4, intent(out) :: gmax + real*8, intent(out) :: gavg + real*8, intent(out) :: gstd_dev + integer*4, dimension(*), intent(out) :: mins + integer*1, dimension(*), intent(out) :: maxs + real*8, dimension(*), intent(out) :: avgs + real*8, dimension(*), intent(out) :: std_devs + integer, intent(out) :: err + end subroutine + + ! INTEGER*8 arrays + subroutine adios_get_statistics_int8 (fp, varname, value, gmin, gmax, gavg, gstd_dev, mins, maxs, avgs, std_devs, err) + implicit none + integer*8, intent(in) :: fp + character(*), intent(in) :: varname + integer*8, intent(out) :: value + integer*8, intent(out) :: gmin + integer*8, intent(out) :: gmax + real*8, intent(out) :: gavg + real*8, intent(out) :: gstd_dev + integer*8, dimension(*), intent(out) :: mins + integer*8, dimension(*), intent(out) :: maxs + real*8, dimension(*), intent(out) :: avgs + real*8, dimension(*), intent(out) :: std_devs + integer, intent(out) :: err + end subroutine + + ! REAL*4 arrays + subroutine adios_get_statistics_real4 (fp, varname, value, gmin, gmax, gavg, gstd_dev, mins, maxs, avgs, std_devs, err) + implicit none + integer*8, intent(in) :: fp + character(*), intent(in) :: varname + real*4, intent(out) :: value + real*4, intent(out) :: gmin + real*4, intent(out) :: gmax + real*8, dimension(*), intent(out) :: avgs + real*8, dimension(*), intent(out) :: std_devs + real*4, dimension(*), intent(out) :: mins + real*4, dimension(*), intent(out) :: maxs + real*8, intent(out) :: gavg + real*8, intent(out) :: gstd_dev + integer, intent(out) :: err + end subroutine + + ! REAL*8 arrays + subroutine adios_get_statistics_real8 (fp, varname, value, gmin, gmax, gavg, gstd_dev, mins, maxs, avgs, std_devs, err) + implicit none + integer*8, intent(in) :: fp + character(*), intent(in) :: varname + real*8, intent(out) :: value + real*8, intent(out) :: gmin + real*8, intent(out) :: gmax + real*8, intent(out) :: gavg + real*8, intent(out) :: gstd_dev + real*8, dimension(*), intent(out) :: mins + real*8, dimension(*), intent(out) :: maxs + real*8, dimension(*), intent(out) :: avgs + real*8, dimension(*), intent(out) :: std_devs + integer, intent(out) :: err + end subroutine + + ! COMPLEX*8 arrays + subroutine adios_get_statistics_complex8 (fp, varname, value, gmin, gmax, gavg, gstd_dev, mins, maxs, avgs, std_devs, err) + implicit none + integer*8, intent(in) :: fp + character(*), intent(in) :: varname + complex, intent(out) :: value + complex, intent(out) :: gmin + complex, intent(out) :: gmax + real*8, intent(out) :: gavg + real*8, intent(out) :: gstd_dev + complex, dimension(*), intent(out) :: mins + complex, dimension(*), intent(out) :: maxs + real*8, dimension(*), intent(out) :: avgs + real*8, dimension(*), intent(out) :: std_devs + integer, intent(out) :: err + end subroutine + + ! COMPLEX*16 arrays + subroutine adios_get_statistics_complex16 (fp, varname, value, gmin, gmax, gavg, gstd_dev, mins, maxs, avgs, std_devs, err) + implicit none + integer*8, intent(in) :: fp + character(*), intent(in) :: varname + complex*16, intent(out) :: value + complex*16, intent(out) :: gmin + complex*16, intent(out) :: gmax + real*8, intent(out) :: gavg + real*8, intent(out) :: gstd_dev + complex*16, dimension(*), intent(out) :: mins + complex*16, dimension(*), intent(out) :: maxs + real*8, dimension(*), intent(out) :: avgs + real*8, dimension(*), intent(out) :: std_devs + integer, intent(out) :: err + end subroutine + + ! CHARACTER(*) arrays + subroutine adios_get_statistics_char (fp, varname, value, gmin, gmax, gavg, gstd_dev, mins, maxs, avgs, std_devs, err) + implicit none + integer*8, intent(in) :: fp + character(*), intent(in) :: varname + character(*), intent(out) :: value + character(*), intent(out) :: gmin + character(*), intent(out) :: gmax + real*8, intent(out) :: gavg + real*8, intent(out) :: gstd_dev + character(*), dimension(*), intent(out) :: mins + character(*), dimension(*), intent(out) :: maxs + real*8, dimension(*), intent(out) :: avgs + real*8, dimension(*), intent(out) :: std_devs + integer, intent(out) :: err + end subroutine + + ! LOFICAL*1 arrays + subroutine adios_get_statistics_logical1 (fp, varname, value, gmin, gmax, gavg, gstd_dev, mins, maxs, avgs, std_devs, err) + implicit none + integer*8, intent(in) :: fp + character(*), intent(in) :: varname + logical*1, intent(out) :: value + logical*1, intent(out) :: gmin + logical*1, intent(out) :: gmax + real*8, intent(out) :: gavg + real*8, intent(out) :: gstd_dev + logical*1, dimension(*), intent(out) :: mins + logical*1, dimension(*), intent(out) :: maxs + real*8, dimension(*), intent(out) :: avgs + real*8, dimension(*), intent(out) :: std_devs + integer, intent(out) :: err + end subroutine + + ! LOGICAL*2 arrays + subroutine adios_get_statistics_logical2 (fp, varname, value, gmin, gmax, gavg, gstd_dev, mins, maxs, avgs, std_devs, err) + implicit none + integer*8, intent(in) :: fp + character(*), intent(in) :: varname + logical*2, intent(out) :: value + logical*2, intent(out) :: gmin + logical*2, intent(out) :: gmax + real*8, intent(out) :: gavg + real*8, intent(out) :: gstd_dev + logical*2, dimension(*), intent(out) :: mins + logical*2, dimension(*), intent(out) :: maxs + real*8, dimension(*), intent(out) :: avgs + real*8, dimension(*), intent(out) :: std_devs + integer, intent(out) :: err + end subroutine + + ! LOGICAL*4 arrays + subroutine adios_get_statistics_logical4 (fp, varname, value, gmin, gmax, gavg, gstd_dev, mins, maxs, avgs, std_devs, err) + implicit none + integer*8, intent(in) :: fp + character(*), intent(in) :: varname + logical*4, intent(out) :: value + logical*4, intent(out) :: gmin + logical*4, intent(out) :: gmax + real*8, intent(out) :: gavg + real*8, intent(out) :: gstd_dev + logical*4, dimension(*), intent(out) :: mins + logical*4, dimension(*), intent(out) :: maxs + real*8, dimension(*), intent(out) :: avgs + real*8, dimension(*), intent(out) :: std_devs + integer, intent(out) :: err + end subroutine + + ! LOGICAL*8 arrays + subroutine adios_get_statistics_logical8 (fp, varname, value, gmin, gmax, gavg, gstd_dev, mins, maxs, avgs, std_devs, err) + implicit none + integer*8, intent(in) :: fp + character(*), intent(in) :: varname + logical*8, intent(out) :: value + logical*8, intent(out) :: gmin + logical*8, intent(out) :: gmax + real*8, intent(out) :: gavg + real*8, intent(out) :: gstd_dev + logical*8, dimension(*), intent(out) :: mins + logical*8, dimension(*), intent(out) :: maxs + real*8, dimension(*), intent(out) :: avgs + real*8, dimension(*), intent(out) :: std_devs + integer, intent(out) :: err + end subroutine + + end interface + + + contains + + ! + ! ADIOS_SCHEDULE_READ procedures + ! + ! Usage: call adios_schedule_read (fp, sel, varname, from_step, nsteps, data, err) + ! + ! + ! scalars + ! + + ! INTEGER*1 scalar + subroutine adios_schedule_read_int1_d0 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + integer*1, intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! INTEGER*2 scalar + subroutine adios_schedule_read_int2_d0 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + integer*2, intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! INTEGER*4 scalar + subroutine adios_schedule_read_int4_d0 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + integer*4, intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! INTEGER*8 scalar + subroutine adios_schedule_read_int8_d0 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + integer*8, intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! REAL*4 scalar + subroutine adios_schedule_read_real4_d0 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + real*4, intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! REAL*8 scalar + subroutine adios_schedule_read_real8_d0 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + real*8, intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! COMPLEX (*8) scalar + subroutine adios_schedule_read_complex8_d0 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + complex, intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! DOUBLE-COMPLEX scalar + subroutine adios_schedule_read_complex16_d0 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + complex*16, intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! CHARACTER scalar + !subroutine adios_schedule_read_char_d0 (fp, sel, varname, from_step, nsteps, data, err) + ! implicit none + ! integer*8, intent(in) :: fp + ! integer*8, intent(in) :: sel + ! character(*), intent(in) :: varname + ! integer, intent(in) :: from_step + ! integer, intent(in) :: nsteps + ! character(*), intent(out) :: data + ! integer, intent(in) :: err + ! + ! call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + !end subroutine + + ! LOGICAL*1 scalar + subroutine adios_schedule_read_logical1_d0 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + logical*1, intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! LOGICAL*2 scalar + subroutine adios_schedule_read_logical2_d0 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + logical*2, intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! LOGICAL*4 scalar + subroutine adios_schedule_read_logical4_d0 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + logical*4, intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! LOGICAL*8 scalar + subroutine adios_schedule_read_logical8_d0 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + logical*8, intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! + ! 1D data + ! + + ! INTEGER*1 array + subroutine adios_schedule_read_int1_d1 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + integer*1, dimension(*), intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! INTEGER*2 array + subroutine adios_schedule_read_int2_d1 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + integer*2, dimension(*), intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! INTEGER*4 array + subroutine adios_schedule_read_int4_d1 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + integer*4, dimension(*), intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! INTEGER*8 array + subroutine adios_schedule_read_int8_d1 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + integer*8, dimension(*), intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! REAL*4 array + subroutine adios_schedule_read_real4_d1 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + real*4, dimension(*), intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! REAL*8 array + subroutine adios_schedule_read_real8_d1 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + real*8, dimension(*), intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! COMPLEX (*8) array + subroutine adios_schedule_read_complex8_d1 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + complex, dimension(*), intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! DOUBLE-COMPLEX array + subroutine adios_schedule_read_complex16_d1 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + complex*16,dimension(*), intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! CHARACTER array + subroutine adios_schedule_read_char_d1 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + character(*), intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! LOGICAL*1 array + subroutine adios_schedule_read_logical1_d1 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + logical*1, dimension(*), intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! LOGICAL*2 array + subroutine adios_schedule_read_logical2_d1 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + logical*2, dimension(*), intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! LOGICAL*4 array + subroutine adios_schedule_read_logical4_d1 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + logical*4, dimension(*), intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! LOGICAL*8 array + subroutine adios_schedule_read_logical8_d1 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + logical*8, dimension(*), intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! + ! 2D data + ! + + ! INTEGER*1 array + subroutine adios_schedule_read_int1_d2 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + integer*1, dimension(:,:), intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! INTEGER*2 array + subroutine adios_schedule_read_int2_d2 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + integer*2, dimension(:,:), intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! INTEGER*4 array + subroutine adios_schedule_read_int4_d2 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + integer*4, dimension(:,:), intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! INTEGER*8 array + subroutine adios_schedule_read_int8_d2 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + integer*8, dimension(:,:), intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! REAL*4 array + subroutine adios_schedule_read_real4_d2 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + real*4, dimension(:,:), intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! REAL*8 array + subroutine adios_schedule_read_real8_d2 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + real*8, dimension(:,:), intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! COMPLEX (*8) array + subroutine adios_schedule_read_complex8_d2 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + complex, dimension(:,:), intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! DOUBLE-COMPLEX array + subroutine adios_schedule_read_complex16_d2 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + complex*16,dimension(:,:), intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! CHARACTER array + subroutine adios_schedule_read_char_d2 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + character(*),dimension(*), intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! LOGICAL*1 array + subroutine adios_schedule_read_logical1_d2 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + logical*1, dimension(:,:), intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! LOGICAL*2 array + subroutine adios_schedule_read_logical2_d2 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + logical*2, dimension(:,:), intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! LOGICAL*4 array + subroutine adios_schedule_read_logical4_d2 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + logical*4, dimension(:,:), intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! LOGICAL*8 array + subroutine adios_schedule_read_logical8_d2 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + logical*8, dimension(:,:), intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! + ! 3D data + ! + + ! INTEGER*1 array + subroutine adios_schedule_read_int1_d3 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + integer*1, dimension(:,:,:), intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! INTEGER*2 array + subroutine adios_schedule_read_int2_d3 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + integer*2, dimension(:,:,:), intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! INTEGER*4 array + subroutine adios_schedule_read_int4_d3 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + integer*4, dimension(:,:,:), intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! INTEGER*8 array + subroutine adios_schedule_read_int8_d3 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + integer*8, dimension(:,:,:), intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! REAL*4 array + subroutine adios_schedule_read_real4_d3 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + real*4, dimension(:,:,:), intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! REAL*8 array + subroutine adios_schedule_read_real8_d3 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + real*8, dimension(:,:,:), intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! COMPLEX (*8) array + subroutine adios_schedule_read_complex8_d3 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + complex, dimension(:,:,:), intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! DOUBLE-COMPLEX array + subroutine adios_schedule_read_complex16_d3 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + complex*16,dimension(:,:,:), intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! CHARACTER array + subroutine adios_schedule_read_char_d3 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + character(*),dimension(:,:), intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! LOGICAL*1 array + subroutine adios_schedule_read_logical1_d3 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + logical*1, dimension(:,:,:), intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! LOGICAL*2 array + subroutine adios_schedule_read_logical2_d3 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + logical*2, dimension(:,:,:), intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! LOGICAL*4 array + subroutine adios_schedule_read_logical4_d3 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + logical*4, dimension(:,:,:), intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! LOGICAL*8 array + subroutine adios_schedule_read_logical8_d3 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + logical*8, dimension(:,:,:), intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! + ! 4D data + ! + + ! INTEGER*1 array + subroutine adios_schedule_read_int1_d4 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + integer*1, dimension(:,:,:,:), intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! INTEGER*2 array + subroutine adios_schedule_read_int2_d4 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + integer*2, dimension(:,:,:,:), intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! INTEGER*4 array + subroutine adios_schedule_read_int4_d4 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + integer*4, dimension(:,:,:,:), intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! INTEGER*8 array + subroutine adios_schedule_read_int8_d4 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + integer*8, dimension(:,:,:,:), intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! REAL*4 array + subroutine adios_schedule_read_real4_d4 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + real*4, dimension(:,:,:,:), intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! REAL*8 array + subroutine adios_schedule_read_real8_d4 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + real*8, dimension(:,:,:,:), intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! COMPLEX (*8) array + subroutine adios_schedule_read_complex8_d4 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + complex, dimension(:,:,:,:), intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! DOUBLE-COMPLEX array + subroutine adios_schedule_read_complex16_d4 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + complex*16,dimension(:,:,:,:), intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! CHARACTER array + subroutine adios_schedule_read_char_d4 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + character(*),dimension(:,:,:), intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! LOGICAL*1 array + subroutine adios_schedule_read_logical1_d4 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + logical*1, dimension(:,:,:,:), intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! LOGICAL*2 array + subroutine adios_schedule_read_logical2_d4 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + logical*2, dimension(:,:,:,:), intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! LOGICAL*4 array + subroutine adios_schedule_read_logical4_d4 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + logical*4, dimension(:,:,:,:), intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! LOGICAL*8 array + subroutine adios_schedule_read_logical8_d4 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + logical*8, dimension(:,:,:,:), intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! + ! 5D data + ! + + ! INTEGER*1 array + subroutine adios_schedule_read_int1_d5 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + integer*1, dimension(:,:,:,:,:), intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! INTEGER*2 array + subroutine adios_schedule_read_int2_d5 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + integer*2, dimension(:,:,:,:,:), intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! INTEGER*4 array + subroutine adios_schedule_read_int4_d5 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + integer*4, dimension(:,:,:,:,:), intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! INTEGER*8 array + subroutine adios_schedule_read_int8_d5 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + integer*8, dimension(:,:,:,:,:), intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! REAL*4 array + subroutine adios_schedule_read_real4_d5 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + real*4, dimension(:,:,:,:,:), intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! REAL*8 array + subroutine adios_schedule_read_real8_d5 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + real*8, dimension(:,:,:,:,:), intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! COMPLEX (*8) array + subroutine adios_schedule_read_complex8_d5 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + complex, dimension(:,:,:,:,:), intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! DOUBLE-COMPLEX array + subroutine adios_schedule_read_complex16_d5 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + complex*16,dimension(:,:,:,:,:), intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! CHARACTER array + subroutine adios_schedule_read_char_d5 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + character(*),dimension(:,:,:,:),intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! LOGICAL*1 array + subroutine adios_schedule_read_logical1_d5 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + logical*1, dimension(:,:,:,:,:), intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! LOGICAL*2 array + subroutine adios_schedule_read_logical2_d5 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + logical*2, dimension(:,:,:,:,:), intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! LOGICAL*4 array + subroutine adios_schedule_read_logical4_d5 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + logical*4, dimension(:,:,:,:,:), intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! LOGICAL*8 array + subroutine adios_schedule_read_logical8_d5 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + logical*8, dimension(:,:,:,:,:), intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! + ! 6D data + ! + + ! INTEGER*1 array + subroutine adios_schedule_read_int1_d6 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + integer*1, dimension(:,:,:,:,:,:), intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! INTEGER*2 array + subroutine adios_schedule_read_int2_d6 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + integer*2, dimension(:,:,:,:,:,:), intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! INTEGER*4 array + subroutine adios_schedule_read_int4_d6 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + integer*4, dimension(:,:,:,:,:,:), intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! INTEGER*8 array + subroutine adios_schedule_read_int8_d6 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + integer*8, dimension(:,:,:,:,:,:), intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! REAL*4 array + subroutine adios_schedule_read_real4_d6 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + real*4, dimension(:,:,:,:,:,:), intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! REAL*8 array + subroutine adios_schedule_read_real8_d6 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + real*8, dimension(:,:,:,:,:,:), intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! COMPLEX (*8) array + subroutine adios_schedule_read_complex8_d6 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + complex, dimension(:,:,:,:,:,:), intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! DOUBLE-COMPLEX array + subroutine adios_schedule_read_complex16_d6 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + complex*16,dimension(:,:,:,:,:,:), intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! CHARACTER array + subroutine adios_schedule_read_char_d6 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + character(*),dimension(:,:,:,:,:),intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! LOGICAL*1 array + subroutine adios_schedule_read_logical1_d6 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + logical*1, dimension(:,:,:,:,:,:), intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! LOGICAL*2 array + subroutine adios_schedule_read_logical2_d6 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + logical*2, dimension(:,:,:,:,:,:), intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! LOGICAL*4 array + subroutine adios_schedule_read_logical4_d6 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + logical*4, dimension(:,:,:,:,:,:), intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! LOGICAL*8 array + subroutine adios_schedule_read_logical8_d6 (fp, sel, varname, from_step, nsteps, data, err) + implicit none + integer*8, intent(in) :: fp + integer*8, intent(in) :: sel + character(*), intent(in) :: varname + integer, intent(in) :: from_step + integer, intent(in) :: nsteps + logical*8, dimension(:,:,:,:,:,:), intent(out) :: data + integer, intent(in) :: err + + call adios_schedule_read_f2c(fp, sel, varname, from_step, nsteps, data, err) + end subroutine + + ! + ! Backward compatibility for 1.4 + ! + subroutine adios_read_open_stream (fp, fname, method, comm, lockmode, timeout_sec, err) + implicit none + integer*8, intent(out) :: fp + character(*), intent(in) :: fname + integer, intent(in) :: method + integer, intent(in) :: comm + integer, intent(in) :: lockmode + real, intent(in) :: timeout_sec + integer, intent(out) :: err + call adios_read_open (fp, fname, method, comm, lockmode, timeout_sec, err) + end subroutine + +end module + diff --git a/tests/libs/adios/src/core/adiosf_read_v1.c b/tests/libs/adios/src/core/adiosf_read_v1.c new file mode 100644 index 0000000000..5fec6761d1 --- /dev/null +++ b/tests/libs/adios/src/core/adiosf_read_v1.c @@ -0,0 +1,658 @@ +/* + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + */ + +#include "config.h" +#include +#include +#include +#define __INCLUDED_FROM_FORTRAN_API__ +#include "adios_read.h" +#include "adios_error.h" +#include "core/bp_utils.h" // bp_get_type_size() +//#include "core/bp_types.h" +#include "core/common_read.h" +#include "core/futils.h" +#define BYTE_ALIGN 8 + +#ifdef DMALLOC +#include "dmalloc.h" +#endif + +#ifdef __cplusplus +extern "C" /* prevent C++ name mangling */ +#endif + +#ifdef BUILD_WITH_CMAKE + #include "FC.h" +#endif + +static enum ADIOS_READ_METHOD lastmethod = ADIOS_READ_METHOD_BP; + +extern int adios_errno; + +// Re-define the ADIOS_GROUP struct here, because we need to emulate the group view behavior +// of the old read API +typedef struct { + uint64_t gh; /* Group handler */ + int grpid; /* group index (0..ADIOS_FILE.groups_count-1) */ + int vars_count; /* Number of variables in this adios group */ + char ** var_namelist; /* Variable names in a char* array */ + int attrs_count; /* Number of attributes in this adios group */ + char ** attr_namelist; /* Attribute names in a char* array */ + ADIOS_FILE * fp; /* pointer to the parent ADIOS_FILE struct */ +} ADIOS_GROUP_V1; + +/*********************/ +/* FORTRAN INTERFACE */ +/*********************/ +void FC_FUNC_(adios_errmsg, adios_errmsg) (char *msg, int msg_len) +{ + futils_cstr_to_fstr( adios_get_last_errmsg(), (char *)msg, msg_len); +} + +void FC_FUNC_(adios_set_read_method, ADIOS_SET_READ_METHOD) (int *fmethod, int *err) +{ + switch (*fmethod) { + // Translate from V1 method IDs to the new API's methods + case 0: //ADIOS_READ_METHOD_BP_V1: + lastmethod = ADIOS_READ_METHOD_BP; + break; + case 1: //ADIOS_READ_METHOD_BP_STAGED_V1: + lastmethod = ADIOS_READ_METHOD_BP_AGGREGATE; + break; + case 7: //ADIOS_READ_METHOD_BP_STAGED1_V1: + lastmethod = ADIOS_READ_METHOD_BP_AGGREGATE; + break; + case 3: //ADIOS_READ_METHOD_DART_V1: + lastmethod = ADIOS_READ_METHOD_DATASPACES; + break; + case 4: //ADIOS_READ_METHOD_DIMES_V1: + lastmethod = ADIOS_READ_METHOD_DIMES; + break; + + /* Unsupported methods */ + case 2: //ADIOS_READ_METHOD_HDF5_V1: + case 5: //ADIOS_READ_METHOD_NSSI_V1: + case 6: //ADIOS_READ_METHOD_DATATAP_V1: + default: + lastmethod = ADIOS_READ_METHOD_BP; + break; + } + *err = 0; +} + +void FC_FUNC_(adios_read_init, ADIOS_READ_INIT) (int * fcomm, int * err) +{ + MPI_Comm comm = MPI_Comm_f2c (*((int *) fcomm)); + futils_called_from_fortran_set(); + *err = common_read_init_method (lastmethod, comm, NULL); + if (*err) + fprintf(stderr, "Error: %s\n", adios_get_last_errmsg()); +} + +void FC_FUNC_(adios_read_finalize, ADIOS_READ_FINALIZE) (int * err) +{ + *err = common_read_finalize_method (lastmethod); + futils_called_from_fortran_unset(); + if (*err) + fprintf(stderr, "Error: %s\n", adios_get_last_errmsg()); +} + +void FC_FUNC_(adios_fopen, ADIOS_FOPEN) + (int64_t * fp, + char * fname, + void * fcomm, + int * groups_count, + int * err, + int fname_len) +{ + ADIOS_FILE *afp; + char *namestr; + char **group_namelist; + MPI_Comm comm = MPI_Comm_f2c (*((int *) fcomm)); + futils_called_from_fortran_set(); + + namestr = futils_fstr_to_cstr(fname, fname_len); + if (namestr != NULL) { + afp = common_read_open_file (namestr, lastmethod, comm); + if (afp != NULL) { + *groups_count = common_read_get_grouplist(afp, &group_namelist); + } else { + *groups_count = 0; + } + *fp = (int64_t) afp; + free(namestr); + } else { + *fp = (int64_t) NULL; + } + *err = adios_errno; + if (*err) + fprintf(stderr, "Error: %s\n", adios_get_last_errmsg()); +} + +void FC_FUNC_(adios_reset_dimension_order, ADIOS_RESET_DIMENSION_ORDER) + (int64_t * fp, + int * flag) +{ + ADIOS_FILE *afp = (ADIOS_FILE *) *fp; + common_read_reset_dimension_order(afp, *flag); +} + +void FC_FUNC_(adios_fclose, ADIOS_FCLOSE) (int64_t * fp, int * err) +{ + ADIOS_FILE *afp = (ADIOS_FILE *) *fp; + *err = common_read_close (afp); + futils_called_from_fortran_unset(); + if (*err) + fprintf(stderr, "Error: %s\n", adios_get_last_errmsg()); +} + +void FC_FUNC_(adios_inq_file, ADIOS_INQ_FILE) + (int64_t * fp, + int * vars_count, + int * attrs_count, + int * tstart, + int * ntsteps, + void * gnamelist, + int * err, + int gnamelist_len) +{ + ADIOS_FILE *afp = (ADIOS_FILE *) *fp; + int i; + char **group_namelist; + int ngroups; + if (afp != NULL) { + *vars_count = afp->nvars; + *attrs_count = afp->nattrs; + *tstart = 1; + *ntsteps = afp->last_step-afp->current_step+1; + ngroups = common_read_get_grouplist(afp, &group_namelist); + for (i=0;invars; + *attrs_count = afp->nattrs; + *gp = (int64_t)afp; + } else { + adios_error ( err_invalid_group, "Invalid group name %s", grpname); + *gp = (int64_t) NULL; + } + free(namestr); + + } else { + *gp = (int64_t) NULL; + } + *err = adios_errno; + if (*err) + fprintf(stderr, "Error: %s\n", adios_get_last_errmsg()); +} + +void FC_FUNC_(adios_gclose, ADIOS_GCLOSE) (int64_t * gp, int * err) +{ + ADIOS_FILE *afp = (ADIOS_FILE *) *gp; + // restore full file view + *err=common_read_group_view (afp, -1); + if (*err) + fprintf(stderr, "Error: %s\n", adios_get_last_errmsg()); +} + +void FC_FUNC_(adios_inq_group, ADIOS_INQ_GROUP) + (int64_t * gp, + void * vnamelist, + void * anamelist, + int * timestep, + int * lasttimestep, + int * err, + int vnamelist_len, + int anamelist_len) +{ + ADIOS_FILE *afp = (ADIOS_FILE *) *gp; + int i; + if (afp != NULL) { + for (i=0;invars;i++) { + futils_cstr_to_fstr( afp->var_namelist[i], (char *)vnamelist+i*vnamelist_len, vnamelist_len); + } + for (i=0;inattrs;i++) { + futils_cstr_to_fstr( afp->attr_namelist[i], (char *)anamelist+i*anamelist_len, anamelist_len); + } + *timestep = 1; + *lasttimestep = afp->last_step; + *err = 0; + } else { + *err = 1; + } +} + +void FC_FUNC_(adios_inq_var, ADIOS_INQ_VAR) + (int64_t * gp, + char * varname, + int * type, + int * ndim, + uint64_t * dims, + int * timedim, + int * err, + int varname_len) +{ + char *varstr; + int i; + ADIOS_FILE *afp = (ADIOS_FILE *) *gp; + ADIOS_VARINFO *vi = NULL; + + varstr = futils_fstr_to_cstr(varname, varname_len); + if (varstr != NULL) { + vi = common_read_inq_var (afp, varstr); + } + if (vi != NULL) { + *type = vi->type; + + /* TIME dimension should be emulated here !!! */ + int tidx; + if (vi->nsteps > 1) { + *ndim = vi->ndim + 1; + *timedim = vi->ndim; + dims[0] = vi->nsteps; + tidx = 1; + } else { + *ndim = vi->ndim; + *timedim = -1; + tidx = 0; + } + + for (i=0; indim; i++) + dims[i+tidx] = vi->dims[i]; + + common_read_free_varinfo(vi); + + } else { + *type = adios_unknown; + *ndim = 0; + *timedim = -1; + } + *err = adios_errno; + if (*err < 0) + fprintf(stderr, "Error: %s\n", adios_get_last_errmsg()); +} + +void FC_FUNC_(adios_read_var, ADIOS_READ_VAR) + (int64_t * gp, + char * varname, + uint64_t * start, + uint64_t * count, + void * data, + int64_t * read_bytes, + int varname_len) +{ + ADIOS_FILE *afp = (ADIOS_FILE *) *gp; + char *varstr; + int i; + varstr = futils_fstr_to_cstr(varname, varname_len); + if (varstr != NULL) { + /* First get the number of dimensions of the variable */ + ADIOS_VARINFO * vi = common_read_inq_var (afp, varstr); + if (!vi) { + *read_bytes = adios_errno; + return; + } + int from_step = 0, nsteps = 1; + /* TIME dimension should be emulated here !!! */ + if (vi->nsteps > 1) { + from_step = (int) start[vi->ndim]; + nsteps = (int) count[vi->ndim]; + } + + ADIOS_SELECTION * sel = common_read_selection_boundingbox (vi->ndim, start, count); + + common_read_schedule_read (afp, sel, varstr, from_step, nsteps, NULL /* NCSU ALACRITY-ADIOS */, data); + int ret = common_read_perform_reads (afp, 1); + if (ret == err_no_error) { + /* should return the number of bytes read */ + *read_bytes = (int64_t) common_read_type_size (vi->type, data); + *read_bytes *= nsteps; + for (i=0; indim; i++) + *read_bytes *= (int64_t) count[i]; + } else { + *read_bytes = (int64_t) adios_errno; + } + + common_read_free_varinfo(vi); + common_read_selection_delete(sel); + free(varstr); + } else { + *read_bytes = adios_errno; + } + if (*read_bytes < 0) + fprintf(stderr, "Error: %s\n", adios_get_last_errmsg()); +} + +void FC_FUNC_(adios_read_local_var, ADIOS_READ_LOCAL_VAR) + (int64_t * gp, + char * varname, + int * idx, + uint64_t * start, + uint64_t * count, + void * data, + int64_t * read_bytes, + int varname_len) +{ + ADIOS_FILE *afp = (ADIOS_FILE *) *gp; + ADIOS_VARINFO *vi = NULL; + char *varstr; + int i; + varstr = futils_fstr_to_cstr(varname, varname_len); + if (varstr != NULL) { + /* The new API does not support reading write block with subselection. + Only complete blocks can be read. + Here we check if the passed selection equals the whole block. + Otherwise we return an out of bound error, although it probably should + be a "within bounds" error + + Version 1: + - start/count has no time dimension for the local read + - idx is for all timesteps, 0...timesteps*blocks + Version 2: + - idx is from 0..blocks for each timestep + - need to say which timestep + */ + + /* First get the number of dimensions of the variable */ + vi = common_read_inq_var (afp, varstr); + } + + if (vi != NULL) { + /* get step from the idx, and check validity of idx */ + int step = 0; + int idx_in_step = *idx; + step = 0; + while (step < vi->nsteps && idx_in_step >= vi->nblocks[step]) { + idx_in_step -= vi->nblocks[step]; + step++; + } + if (step == vi->nsteps) { + adios_error (err_out_of_bound, "ADIOS ERROR: local " + "variable %s has only %d blocks in file. " + "Requested index %d\n", varstr, vi->sum_nblocks, idx); + *read_bytes = adios_errno; + return; + } + common_read_inq_var_blockinfo (afp, vi); // get info on each block + + /* check dimensions */ + for (i=0; indim; i++) { + if (start[i] != 0 || count[i] != vi->blockinfo[*idx].count[i]) { + adios_error (err_out_of_bound, "ADIOS ERROR: when reading a local " + "variable, only the whole block can be requested; subselections " + "are not allowed. Variable %s, block %d, dimension %d size is %lld, " + "requested %lld from offset %lld\n", + varstr, *idx, vi->blockinfo[*idx].count[i], count[i], start[i]); + *read_bytes = adios_errno; + return; + } + } + + ADIOS_SELECTION * sel = common_read_selection_writeblock (idx_in_step); + + common_read_schedule_read_byid (afp, sel, vi->varid, step, 1, NULL /* NCSU ALACRITY-ADIOS */, data); + int ret = common_read_perform_reads (afp, 1); + if (ret == err_no_error) { + /* should return the number of bytes read */ + *read_bytes = (int64_t) common_read_type_size (vi->type, data); + for (i=0; indim; i++) + *read_bytes *= (int64_t) count[i]; + } else { + *read_bytes = (int64_t) adios_errno; + } + + common_read_free_varinfo(vi); + common_read_selection_delete(sel); + free(varstr); + + } else { + // return error from futils or inq_var + *read_bytes = adios_errno; + } + + if (*read_bytes < 0) + fprintf(stderr, "Error: %s\n", adios_get_last_errmsg()); +} + +/* Specific function for each data type */ +void FC_FUNC_(adios_read_var_int1, ADIOS_READ_VAR_INT1) (int64_t * gp, char * varname, uint64_t * start, uint64_t * count, void * data, int64_t * read_bytes, int varname_len) { FC_FUNC_(adios_read_var, ADIOS_READ_VAR) (gp, varname, start, count, data, read_bytes, varname_len); } +void FC_FUNC_(adios_read_var_int2, ADIOS_READ_VAR_INT2) (int64_t * gp, char * varname, uint64_t * start, uint64_t * count, void * data, int64_t * read_bytes, int varname_len) { FC_FUNC_(adios_read_var, ADIOS_READ_VAR) (gp, varname, start, count, data, read_bytes, varname_len); } +void FC_FUNC_(adios_read_var_int4, ADIOS_READ_VAR_INT4) (int64_t * gp, char * varname, uint64_t * start, uint64_t * count, void * data, int64_t * read_bytes, int varname_len) { FC_FUNC_(adios_read_var, ADIOS_READ_VAR) (gp, varname, start, count, data, read_bytes, varname_len); } +void FC_FUNC_(adios_read_var_int8, ADIOS_READ_VAR_INT8) (int64_t * gp, char * varname, uint64_t * start, uint64_t * count, void * data, int64_t * read_bytes, int varname_len) { FC_FUNC_(adios_read_var, ADIOS_READ_VAR) (gp, varname, start, count, data, read_bytes, varname_len); } +void FC_FUNC_(adios_read_var_real4, ADIOS_READ_VAR_REAL4) (int64_t * gp, char * varname, uint64_t * start, uint64_t * count, void * data, int64_t * read_bytes, int varname_len) { FC_FUNC_(adios_read_var, ADIOS_READ_VAR) (gp, varname, start, count, data, read_bytes, varname_len); } +void FC_FUNC_(adios_read_var_real8, ADIOS_READ_VAR_REAL8) (int64_t * gp, char * varname, uint64_t * start, uint64_t * count, void * data, int64_t * read_bytes, int varname_len) { FC_FUNC_(adios_read_var, ADIOS_READ_VAR) (gp, varname, start, count, data, read_bytes, varname_len); } +void FC_FUNC_(adios_read_var_char, ADIOS_READ_VAR_CHAR) (int64_t * gp, char * varname, uint64_t * start, uint64_t * count, void * data, int64_t * read_bytes, int varname_len) { FC_FUNC_(adios_read_var, ADIOS_READ_VAR) (gp, varname, start, count, data, read_bytes, varname_len); } +void FC_FUNC_(adios_read_var_complex8, ADIOS_READ_VAR_COMPLEX8) (int64_t * gp, char * varname, uint64_t * start, uint64_t * count, void * data, int64_t * read_bytes, int varname_len) { FC_FUNC_(adios_read_var, ADIOS_READ_VAR) (gp, varname, start, count, data, read_bytes, varname_len); } +void FC_FUNC_(adios_read_var_complex16, ADIOS_READ_VAR_COMPLEX16) (int64_t * gp, char * varname, uint64_t * start, uint64_t * count, void * data, int64_t * read_bytes, int varname_len) { FC_FUNC_(adios_read_var, ADIOS_READ_VAR) (gp, varname, start, count, data, read_bytes, varname_len); } +void FC_FUNC_(adios_read_var_logical1, ADIOS_READ_VAR_LOGICAL1) (int64_t * gp, char * varname, uint64_t * start, uint64_t * count, void * data, int64_t * read_bytes, int varname_len) { FC_FUNC_(adios_read_var, ADIOS_READ_VAR) (gp, varname, start, count, data, read_bytes, varname_len); } +void FC_FUNC_(adios_read_var_logical2, ADIOS_READ_VAR_LOGICAL2) (int64_t * gp, char * varname, uint64_t * start, uint64_t * count, void * data, int64_t * read_bytes, int varname_len) { FC_FUNC_(adios_read_var, ADIOS_READ_VAR) (gp, varname, start, count, data, read_bytes, varname_len); } +void FC_FUNC_(adios_read_var_logical4, ADIOS_READ_VAR_LOGICAL4) (int64_t * gp, char * varname, uint64_t * start, uint64_t * count, void * data, int64_t * read_bytes, int varname_len) { FC_FUNC_(adios_read_var, ADIOS_READ_VAR) (gp, varname, start, count, data, read_bytes, varname_len); } +void FC_FUNC_(adios_read_var_logical8, ADIOS_READ_VAR_LOGICAL8) (int64_t * gp, char * varname, uint64_t * start, uint64_t * count, void * data, int64_t * read_bytes, int varname_len) { FC_FUNC_(adios_read_var, ADIOS_READ_VAR) (gp, varname, start, count, data, read_bytes, varname_len); } + +void FC_FUNC_(adios_get_statistics, ADIOS_GET_STATISTICS) + (int64_t * gp, + char * varname, + void * value, + void * gmin, + void * gmax, + double * gavg, + double * gstd_dev, + void ** mins, + void ** maxs, + double ** avgs, + double ** std_devs, + int * err, + int varname_len) +{ + ADIOS_FILE *afp = (ADIOS_FILE *) *gp; + ADIOS_VARINFO *vi = NULL; + char *varstr; + int size; + + varstr = futils_fstr_to_cstr(varname, varname_len); + if (varstr != NULL) { + /* First get the number of dimensions of the variable */ + vi = common_read_inq_var (afp, varname); + } + if (vi != NULL) { + size = bp_get_type_size(vi->type, vi->value); + // get statistics information per each step + common_read_inq_var_stat (afp, vi, 1, 0); + if (vi->type == adios_string) size++; + if (vi->value) memcpy(value, vi->value, size); + + if (vi->statistics) { + if (vi->type == adios_complex || vi->type == adios_double_complex) { + /* For complex numbers, the statistics in ADIOS_VARINFO, like + gmin, gavg, std_devs etc, are of base type double. They also + have an additional dimension that stores the statistics for + the magnitude, the real part, and the imaginary part of the + complex number, individually. For example, gmin[0] holds the + overall minimum value of the magnitude of the complex numbers. + gmin[1] and gmin [2] contain the global minimums for the real + and the imaginary parts, respectively. + */ + if (vi->statistics->min) + memcpy((char *) gmin, (char *) vi->statistics->min, 3*size); + if (vi->statistics->max) + memcpy(((char *) gmax), (char *) vi->statistics->max, 3*size); + if (vi->statistics->avg) + memcpy(gavg, vi->statistics->avg, 3*sizeof(double)); + if (vi->statistics->std_dev) + memcpy(gstd_dev, vi->statistics->std_dev, 3*sizeof(double)); + + /* FIXME: I do not know if mins is **void and mins[i] is a void * allocated + separately, or mins is a continuous array now. + Copy content accordingly back to the Fortran client. + */ + int c; + double ** v_mins = NULL; + double ** v_maxs = NULL; + double ** v_avgs = NULL; + double ** v_std_devs = NULL; + if (vi->statistics->steps) { + v_mins = (double **) vi->statistics->steps->mins; + v_maxs = (double **) vi->statistics->steps->maxs; + v_avgs = (double **) vi->statistics->steps->avgs; + v_std_devs = (double **) vi->statistics->steps->std_devs; + } + + for (c = 0; c < 3; c ++) + { + if (v_mins && v_mins[c]) memcpy(((double **) mins)[c], v_mins[c], vi->nsteps * size); + if (v_maxs && v_maxs[c]) memcpy(((double **) maxs)[c], v_maxs[c], vi->nsteps * size); + if (v_avgs && v_avgs[c]) memcpy(avgs[c], v_avgs[c], vi->nsteps * sizeof(double)); + if (v_std_devs && v_std_devs[c]) memcpy(std_devs[c], v_std_devs[c], vi->nsteps * sizeof(double)); + } + + } else { + if (vi->statistics->min) + memcpy((char *) gmin, (char *) vi->statistics->min, size); + if (vi->statistics->max) + memcpy((char *) gmax, (char *) vi->statistics->max, size); + if (vi->statistics->avg) + memcpy(gavg, vi->statistics->avg, sizeof(double)); + if (vi->statistics->std_dev) + memcpy(gstd_dev, vi->statistics->std_dev, sizeof(double)); + + if (vi->statistics->steps) { + if (vi->statistics->steps->mins) + memcpy((char *) mins, (char *) vi->statistics->steps->mins, vi->nsteps * size); + if (vi->statistics->steps->maxs) + memcpy((char *) maxs, (char *) vi->statistics->steps->maxs, vi->nsteps * size); + if (vi->statistics->steps->avgs) + memcpy(avgs, vi->statistics->steps->avgs, vi->nsteps * sizeof(double)); + if (vi->statistics->steps->std_devs) + memcpy(std_devs, vi->statistics->steps->std_devs, vi->nsteps * sizeof(double)); + } + } + } + common_read_free_varinfo(vi); + } + *err = adios_errno; + if (*err < 0) + fprintf(stderr, "Error: %s\n", adios_get_last_errmsg()); +} + +/* Specific function for each data type */ +void FC_FUNC_(adios_get_statistics_int1, ADIOS_GET_STATISTICS_INT1) (int64_t * gp, char * varname, void * value, void * gmin, void * gmax, void * gavg, void * gstd_dev, void * mins, void * maxs, void * avgs, void * std_devs, int * err, int varname_len) { FC_FUNC_(adios_get_statistics, ADIOS_GET_STATISTICS) (gp, varname, value, gmin, gmax, gavg, gstd_dev, mins, maxs, avgs, std_devs, err, varname_len); } +void FC_FUNC_(adios_get_statistics_int2, ADIOS_GET_STATISTICS_INT2) (int64_t * gp, char * varname, void * value, void * gmin, void * gmax, void * gavg, void * gstd_dev, void * mins, void * maxs, void * avgs, void * std_devs, int * err, int varname_len) { FC_FUNC_(adios_get_statistics, ADIOS_GET_STATISTICS) (gp, varname, value, gmin, gmax, gavg, gstd_dev, mins, maxs, avgs, std_devs, err, varname_len); } +void FC_FUNC_(adios_get_statistics_int4, ADIOS_GET_STATISTICS_INT4) (int64_t * gp, char * varname, void * value, void * gmin, void * gmax, void * gavg, void * gstd_dev, void * mins, void * maxs, void * avgs, void * std_devs, int * err, int varname_len) { FC_FUNC_(adios_get_statistics, ADIOS_GET_STATISTICS) (gp, varname, value, gmin, gmax, gavg, gstd_dev, mins, maxs, avgs, std_devs, err, varname_len); } +void FC_FUNC_(adios_get_statistics_int8, ADIOS_GET_STATISTICS_INT8) (int64_t * gp, char * varname, void * value, void * gmin, void * gmax, void * gavg, void * gstd_dev, void * mins, void * maxs, void * avgs, void * std_devs, int * err, int varname_len) { FC_FUNC_(adios_get_statistics, ADIOS_GET_STATISTICS) (gp, varname, value, gmin, gmax, gavg, gstd_dev, mins, maxs, avgs, std_devs, err, varname_len); } +void FC_FUNC_(adios_get_statistics_real4, ADIOS_GET_STATISTICS_REAL4) (int64_t * gp, char * varname, void * value, void * gmin, void * gmax, void * gavg, void * gstd_dev, void * mins, void * maxs, void * avgs, void * std_devs, int * err, int varname_len) { FC_FUNC_(adios_get_statistics, ADIOS_GET_STATISTICS) (gp, varname, value, gmin, gmax, gavg, gstd_dev, mins, maxs, avgs, std_devs, err, varname_len); } +void FC_FUNC_(adios_get_statistics_real8, ADIOS_GET_STATISTICS_REAL8) (int64_t * gp, char * varname, void * value, void * gmin, void * gmax, void * gavg, void * gstd_dev, void * mins, void * maxs, void * avgs, void * std_devs, int * err, int varname_len) { FC_FUNC_(adios_get_statistics, ADIOS_GET_STATISTICS) (gp, varname, value, gmin, gmax, gavg, gstd_dev, mins, maxs, avgs, std_devs, err, varname_len); } +void FC_FUNC_(adios_get_statistics_complex8, ADIOS_GET_STATISTICS_COMPLEX8) (int64_t * gp, char * varname, void * value, void * gmin, void * gmax, void * gavg, void * gstd_dev, void * mins, void * maxs, void * avgs, void * std_devs, int * err, int varname_len) { FC_FUNC_(adios_get_statistics, ADIOS_GET_STATISTICS) (gp, varname, value, gmin, gmax, gavg, gstd_dev, mins, maxs, avgs, std_devs, err, varname_len); } +void FC_FUNC_(adios_get_statistics_complex16, ADIOS_GET_STATISTICS_COMPLEX16) (int64_t * gp, char * varname, void * value, void * gmin, void * gmax, void * gavg, void * gstd_dev, void * mins, void * maxs, void * avgs, void * std_devs, int * err, int varname_len) { FC_FUNC_(adios_get_statistics, ADIOS_GET_STATISTICS) (gp, varname, value, gmin, gmax, gavg, gstd_dev, mins, maxs, avgs, std_devs, err, varname_len); } +void FC_FUNC_(adios_get_statistics_char, ADIOS_GET_STATISTICS_CHAR) (int64_t * gp, char * varname, void * value, void * gmin, void * gmax, void * gavg, void * gstd_dev, void * mins, void * maxs, void * avgs, void * std_devs, int * err, int varname_len) { FC_FUNC_(adios_get_statistics, ADIOS_GET_STATISTICS) (gp, varname, value, gmin, gmax, gavg, gstd_dev, mins, maxs, avgs, std_devs, err, varname_len); } +void FC_FUNC_(adios_get_statistics_logical1, ADIOS_GET_STATISTICS_LOGICAL1) (int64_t * gp, char * varname, void * value, void * gmin, void * gmax, void * gavg, void * gstd_dev, void * mins, void * maxs, void * avgs, void * std_devs, int * err, int varname_len) { FC_FUNC_(adios_get_statistics, ADIOS_GET_STATISTICS) (gp, varname, value, gmin, gmax, gavg, gstd_dev, mins, maxs, avgs, std_devs, err, varname_len); } +void FC_FUNC_(adios_get_statistics_logical2, ADIOS_GET_STATISTICS_LOGICAL2) (int64_t * gp, char * varname, void * value, void * gmin, void * gmax, void * gavg, void * gstd_dev, void * mins, void * maxs, void * avgs, void * std_devs, int * err, int varname_len) { FC_FUNC_(adios_get_statistics, ADIOS_GET_STATISTICS) (gp, varname, value, gmin, gmax, gavg, gstd_dev, mins, maxs, avgs, std_devs, err, varname_len); } +void FC_FUNC_(adios_get_statistics_logical4, ADIOS_GET_STATISTICS_LOGICAL4) (int64_t * gp, char * varname, void * value, void * gmin, void * gmax, void * gavg, void * gstd_dev, void * mins, void * maxs, void * avgs, void * std_devs, int * err, int varname_len) { FC_FUNC_(adios_get_statistics, ADIOS_GET_STATISTICS) (gp, varname, value, gmin, gmax, gavg, gstd_dev, mins, maxs, avgs, std_devs, err, varname_len); } +void FC_FUNC_(adios_get_statistics_logical8, ADIOS_GET_STATISTICS_LOGICAL8) (int64_t * gp, char * varname, void * value, void * gmin, void * gmax, void * gavg, void * gstd_dev, void * mins, void * maxs, void * avgs, void * std_devs, int * err, int varname_len) { FC_FUNC_(adios_get_statistics, ADIOS_GET_STATISTICS) (gp, varname, value, gmin, gmax, gavg, gstd_dev, mins, maxs, avgs, std_devs, err, varname_len); } + +void FC_FUNC_(adios_get_attr, ADIOS_GET_ATTR) + (int64_t * gp, + char * attrname, + void * attr, + int * err, + int attrname_len) +{ + ADIOS_FILE *afp = (ADIOS_FILE *) *gp; + char *attrstr; + void *data; + int size; + enum ADIOS_DATATYPES type; + attrstr = futils_fstr_to_cstr(attrname, attrname_len); + if (attrstr != NULL) { + *err = common_read_get_attr (afp, attrstr, &type, &size, &data); + if (data) { + memcpy(attr, data, size); + free(data); + } + } else { + *err = adios_errno; + } + if (*err < 0) + fprintf(stderr, "Error: %s\n", adios_get_last_errmsg()); +} + +void FC_FUNC_(adios_inq_attr, ADIOS_INQ_ATTR) + (int64_t * gp, + char * attrname, + int * type, + int * size, + int * err, + int attrname_len) +{ + ADIOS_FILE *afp = (ADIOS_FILE *) *gp; + char *attrstr; + void *data; + attrstr = futils_fstr_to_cstr(attrname, attrname_len); + if (attrstr != NULL) { + *err = common_read_get_attr (afp, attrstr, (enum ADIOS_DATATYPES *)type, size, &data); + free(data); + } else { + *err = adios_errno; + } + if (*err < 0) + fprintf(stderr, "Error: %s\n", adios_get_last_errmsg()); +} + +/* Specific function for each data type */ +void FC_FUNC_(adios_get_attr_int1, ADIOS_GET_ATTR_INT1) (int64_t * gp, char * attrname, void * attr, int * err, int attrname_len) { FC_FUNC_(adios_get_attr, ADIOS_GET_ATTR) (gp, attrname, attr, err, attrname_len); } +void FC_FUNC_(adios_get_attr_int2, ADIOS_GET_ATTR_INT2) (int64_t * gp, char * attrname, void * attr, int * err, int attrname_len) { FC_FUNC_(adios_get_attr, ADIOS_GET_ATTR) (gp, attrname, attr, err, attrname_len); } +void FC_FUNC_(adios_get_attr_int4, ADIOS_GET_ATTR_INT4) (int64_t * gp, char * attrname, void * attr, int * err, int attrname_len) { FC_FUNC_(adios_get_attr, ADIOS_GET_ATTR) (gp, attrname, attr, err, attrname_len); } +void FC_FUNC_(adios_get_attr_int8, ADIOS_GET_ATTR_INT8) (int64_t * gp, char * attrname, void * attr, int * err, int attrname_len) { FC_FUNC_(adios_get_attr, ADIOS_GET_ATTR) (gp, attrname, attr, err, attrname_len); } +void FC_FUNC_(adios_get_attr_real4, ADIOS_GET_ATTR_REAL4) (int64_t * gp, char * attrname, void * attr, int * err, int attrname_len) { FC_FUNC_(adios_get_attr, ADIOS_GET_ATTR) (gp, attrname, attr, err, attrname_len); } +void FC_FUNC_(adios_get_attr_real8, ADIOS_GET_ATTR_REAL8) (int64_t * gp, char * attrname, void * attr, int * err, int attrname_len) { FC_FUNC_(adios_get_attr, ADIOS_GET_ATTR) (gp, attrname, attr, err, attrname_len); } +void FC_FUNC_(adios_get_attr_complex8, ADIOS_GET_ATTR_COMPLEX8) (int64_t * gp, char * attrname, void * attr, int * err, int attrname_len) { FC_FUNC_(adios_get_attr, ADIOS_GET_ATTR) (gp, attrname, attr, err, attrname_len); } +void FC_FUNC_(adios_get_attr_complex16, ADIOS_GET_ATTR_COMPLEX16) (int64_t * gp, char * attrname, void * attr, int * err, int attrname_len) { FC_FUNC_(adios_get_attr, ADIOS_GET_ATTR) (gp, attrname, attr, err, attrname_len); } +void FC_FUNC_(adios_get_attr_char, ADIOS_GET_ATTR_CHAR) (int64_t * gp, char * attrname, void * attr, int * err, int attrname_len) { FC_FUNC_(adios_get_attr, ADIOS_GET_ATTR) (gp, attrname, attr, err, attrname_len); } +void FC_FUNC_(adios_get_attr_logical1, ADIOS_GET_ATTR_LOGICAL1) (int64_t * gp, char * attrname, void * attr, int * err, int attrname_len) { FC_FUNC_(adios_get_attr, ADIOS_GET_ATTR) (gp, attrname, attr, err, attrname_len); } +void FC_FUNC_(adios_get_attr_logical2, ADIOS_GET_ATTR_LOGICAL2) (int64_t * gp, char * attrname, void * attr, int * err, int attrname_len) { FC_FUNC_(adios_get_attr, ADIOS_GET_ATTR) (gp, attrname, attr, err, attrname_len); } +void FC_FUNC_(adios_get_attr_logical4, ADIOS_GET_ATTR_LOGICAL4) (int64_t * gp, char * attrname, void * attr, int * err, int attrname_len) { FC_FUNC_(adios_get_attr, ADIOS_GET_ATTR) (gp, attrname, attr, err, attrname_len); } +void FC_FUNC_(adios_get_attr_logical8, ADIOS_GET_ATTR_LOGICAL8) (int64_t * gp, char * attrname, void * attr, int * err, int attrname_len) { FC_FUNC_(adios_get_attr, ADIOS_GET_ATTR) (gp, attrname, attr, err, attrname_len); } + diff --git a/tests/libs/adios/src/core/adiosf_write_mod.f90 b/tests/libs/adios/src/core/adiosf_write_mod.f90 new file mode 100644 index 0000000000..47d3aae6ac --- /dev/null +++ b/tests/libs/adios/src/core/adiosf_write_mod.f90 @@ -0,0 +1,3830 @@ +! +! ADIOS is freely available under the terms of the BSD license described +! in the COPYING file in the top level directory of this source distribution. +! +! Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. +! + +! +! Fortran 90 API for writing ADIOS files +! +! Use this module in your source code to ensure that +! you are calling the adios_* writing functions with +! the correct arguments +! +module adios_write_mod + + use adios_defs_mod + + interface + + subroutine adios_init (config, comm, err) + implicit none + character(*), intent(in) :: config + integer, intent(in) :: comm + integer, intent(out) :: err + end subroutine + + subroutine adios_init_noxml (comm, err) + implicit none + integer, intent(in) :: comm + integer, intent(out) :: err + end subroutine + + subroutine adios_finalize (mype, err) + implicit none + integer, intent(in) :: mype + integer, intent(out) :: err + end subroutine + + subroutine adios_open (fd, group_name, filename, mode, comm, err) + implicit none + integer*8, intent(out) :: fd + character(*), intent(in) :: group_name + character(*), intent(in) :: filename + character(*), intent(in) :: mode + integer, intent(in) :: comm + integer, intent(out) :: err + end subroutine + + subroutine adios_group_size (fd, data_size, total_size, err) + implicit none + integer*8, intent(out) :: fd + integer*8, intent(in) :: data_size + integer*8, intent(in) :: total_size + integer, intent(out) :: err + end subroutine + + subroutine adios_set_path (fd, path, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: path + integer, intent(out) :: err + end subroutine + + subroutine adios_set_path_var (fd, path, varname, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: path + character(*), intent(in) :: varname + integer, intent(out) :: err + end subroutine + + subroutine adios_end_iteration (err) + implicit none + integer, intent(out) :: err + end subroutine + + subroutine adios_start_calculation (err) + implicit none + integer, intent(out) :: err + end subroutine + + subroutine adios_stop_calculation (err) + implicit none + integer, intent(out) :: err + end subroutine + + subroutine adios_close (fd, err) + implicit none + integer*8, intent(in) :: fd + integer, intent(out) :: err + end subroutine + + subroutine adios_timing_write_xml (fd, filename, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: filename + integer, intent(out) :: err + end subroutine + + ! + ! No-XML calls + ! + subroutine adios_declare_group (id, groupname, time_index, stats_flag, err) + implicit none + integer*8, intent(out) :: id + character(*), intent(in) :: groupname + character(*), intent(in) :: time_index + integer, intent(in) :: stats_flag + integer, intent(out) :: err + end subroutine + + subroutine adios_define_var (group_id, varname, path, vartype, dimensions, global_dimensions, local_offsets, id) + implicit none + integer*8, intent(in) :: group_id + character(*), intent(in) :: varname + character(*), intent(in) :: path + integer, intent(in) :: vartype + character(*), intent(in) :: dimensions + character(*), intent(in) :: global_dimensions + character(*), intent(in) :: local_offsets + integer*8, intent(out) :: id + end subroutine + + subroutine adios_delete_vardefs (group_id, err) + implicit none + integer*8, intent(in) :: group_id + integer, intent(out) :: err + end subroutine + + subroutine adios_set_transform (var_id, transform_method, err) + implicit none + integer*8, intent(in) :: var_id + character(*), intent(in) :: transform_method + integer, intent(out) :: err + end subroutine + + subroutine adios_define_attribute (group_id, attrname, path, attrtype, value, varname, err) + implicit none + integer*8, intent(in) :: group_id + character(*), intent(in) :: attrname + character(*), intent(in) :: path + integer, intent(in) :: attrtype + character(*), intent(in) :: value + character(*), intent(in) :: varname + integer, intent(out) :: err + end subroutine + + subroutine adios_delete_attrdefs (group_id, err) + implicit none + integer*8, intent(in) :: group_id + integer, intent(out) :: err + end subroutine + + subroutine adios_select_method (group_id, method, parameters, base_path, err) + implicit none + integer*8, intent(in) :: group_id + character(*), intent(in) :: method + character(*), intent(in) :: parameters + character(*), intent(in) :: base_path + integer, intent(out) :: err + end subroutine + + + subroutine adios_allocate_buffer (sizeMB, err) + implicit none + integer, intent(in) :: sizeMB + integer, intent(out) :: err + end subroutine + + subroutine adios_define_schema_version (group_id, schema_version) + implicit none + integer*8, intent(in) :: group_id + character(*), intent(in) :: schema_version + end subroutine + + subroutine adios_define_var_mesh (group_id, varname, meshname) + implicit none + integer*8, intent(in) :: group_id + character(*), intent(in) :: varname + character(*), intent(in) :: meshname + end subroutine + + subroutine adios_define_var_centering (group_id, varname, centering) + implicit none + integer*8, intent(in) :: group_id + character(*), intent(in) :: varname + character(*), intent(in) :: centering + end subroutine + + subroutine adios_define_mesh_timevarying (timevarying, group_id, name) + implicit none + integer*8, intent(in) :: group_id + character(*), intent(in) :: name + character(*), intent(in) :: timevarying + end subroutine + + subroutine adios_define_mesh_file (group_id, name, file) + implicit none + integer*8, intent(in) :: group_id + character(*), intent(in) :: name + character(*), intent(in) :: file + end subroutine + + subroutine adios_define_var_timesteps (timesteps, group_id, name) + implicit none + integer*8, intent(in) :: group_id + character(*), intent(in) :: timesteps + character(*), intent(in) :: name + end subroutine + + subroutine adios_define_var_timescale (timescale, group_id, name) + implicit none + integer*8, intent(in) :: group_id + character(*), intent(in) :: timescale + character(*), intent(in) :: name + end subroutine + + subroutine adios_define_var_timeseriesformat (timeseries, group_id, name) + implicit none + integer*8, intent(in) :: group_id + character(*), intent(in) :: timeseries + character(*), intent(in) :: name + end subroutine + + subroutine adios_define_var_hyperslab (hyperslab, group_id, name) + implicit none + integer*8, intent(in) :: group_id + character(*), intent(in) :: hyperslab + character(*), intent(in) :: name + end subroutine + + subroutine adios_define_mesh_timesteps (timesteps, group_id, name) + implicit none + integer*8, intent(in) :: group_id + character(*), intent(in) :: timesteps + character(*), intent(in) :: name + end subroutine + + subroutine adios_define_mesh_timescale (timescale, group_id, name) + implicit none + integer*8, intent(in) :: group_id + character(*), intent(in) :: timescale + character(*), intent(in) :: name + end subroutine + + subroutine adios_define_mesh_timeseriesformat (timeseries, group_id, name) + implicit none + integer*8, intent(in) :: group_id + character(*), intent(in) :: timeseries + character(*), intent(in) :: name + end subroutine + + subroutine adios_define_mesh_group (group, group_id, name) + implicit none + integer*8, intent(in) :: group_id + character(*), intent(in) :: group + character(*), intent(in) :: name + end subroutine + + subroutine adios_define_mesh_uniform (dimensions, origin, spacing, maximum, nspace, group_id, name) + implicit none + integer*8, intent(in) :: group_id + character(*), intent(in) :: dimensions + character(*), intent(in) :: origin + character(*), intent(in) :: spacing + character(*), intent(in) :: maximum + character(*), intent(in) :: nspace + character(*), intent(in) :: name + end subroutine + + subroutine adios_define_mesh_rectilinear (dimensions, coordinates, nspace, group_id, name) + implicit none + integer*8, intent(in) :: group_id + character(*), intent(in) :: dimensions + character(*), intent(in) :: coordinates + character(*), intent(in) :: nspace + character(*), intent(in) :: name + end subroutine + + subroutine adios_define_mesh_structured (dimensions, points, nspace, group_id, name) + implicit none + integer*8, intent(in) :: group_id + character(*), intent(in) :: dimensions + character(*), intent(in) :: points + character(*), intent(in) :: nspace + character(*), intent(in) :: name + end subroutine + + subroutine adios_define_mesh_unstructured (points, data, count, cell_type, npoints, nspace, group_id, name) + implicit none + integer*8, intent(in) :: group_id + character(*), intent(in) :: points + character(*), intent(in) :: data + character(*), intent(in) :: count + character(*), intent(in) :: cell_type + character(*), intent(in) :: npoints + character(*), intent(in) :: nspace + character(*), intent(in) :: name + end subroutine + + end interface + + ! + ! + ! ADIOS_WRITE generic interface + ! + ! Usage: call adios_write (fd, varname, data, err) + ! + ! + interface adios_write + module procedure adios_write_int1_d0 + module procedure adios_write_int2_d0 + module procedure adios_write_int4_d0 + module procedure adios_write_int8_d0 + module procedure adios_write_real4_d0 + module procedure adios_write_real8_d0 + module procedure adios_write_complex8_d0 + module procedure adios_write_complex16_d0 + !module procedure adios_write_char_d0 + module procedure adios_write_logical1_d0 + module procedure adios_write_logical2_d0 + module procedure adios_write_logical4_d0 + module procedure adios_write_logical8_d0 + module procedure adios_write_int1_d1 + module procedure adios_write_int2_d1 + module procedure adios_write_int4_d1 + module procedure adios_write_int8_d1 + module procedure adios_write_real4_d1 + module procedure adios_write_real8_d1 + module procedure adios_write_complex8_d1 + module procedure adios_write_complex16_d1 + module procedure adios_write_char_d1 + module procedure adios_write_logical1_d1 + module procedure adios_write_logical2_d1 + module procedure adios_write_logical4_d1 + module procedure adios_write_logical8_d1 + module procedure adios_write_int1_d2 + module procedure adios_write_int2_d2 + module procedure adios_write_int4_d2 + module procedure adios_write_int8_d2 + module procedure adios_write_real4_d2 + module procedure adios_write_real8_d2 + module procedure adios_write_complex8_d2 + module procedure adios_write_complex16_d2 + module procedure adios_write_char_d2 + module procedure adios_write_logical1_d2 + module procedure adios_write_logical2_d2 + module procedure adios_write_logical4_d2 + module procedure adios_write_logical8_d2 + module procedure adios_write_int1_d3 + module procedure adios_write_int2_d3 + module procedure adios_write_int4_d3 + module procedure adios_write_int8_d3 + module procedure adios_write_real4_d3 + module procedure adios_write_real8_d3 + module procedure adios_write_complex8_d3 + module procedure adios_write_complex16_d3 + module procedure adios_write_char_d3 + module procedure adios_write_logical1_d3 + module procedure adios_write_logical2_d3 + module procedure adios_write_logical4_d3 + module procedure adios_write_logical8_d3 + module procedure adios_write_int1_d4 + module procedure adios_write_int2_d4 + module procedure adios_write_int4_d4 + module procedure adios_write_int8_d4 + module procedure adios_write_real4_d4 + module procedure adios_write_real8_d4 + module procedure adios_write_complex8_d4 + module procedure adios_write_complex16_d4 + module procedure adios_write_char_d4 + module procedure adios_write_logical1_d4 + module procedure adios_write_logical2_d4 + module procedure adios_write_logical4_d4 + module procedure adios_write_logical8_d4 + module procedure adios_write_int1_d5 + module procedure adios_write_int2_d5 + module procedure adios_write_int4_d5 + module procedure adios_write_int8_d5 + module procedure adios_write_real4_d5 + module procedure adios_write_real8_d5 + module procedure adios_write_complex8_d5 + module procedure adios_write_complex16_d5 + module procedure adios_write_char_d5 + module procedure adios_write_logical1_d5 + module procedure adios_write_logical2_d5 + module procedure adios_write_logical4_d5 + module procedure adios_write_logical8_d5 + module procedure adios_write_int1_d6 + module procedure adios_write_int2_d6 + module procedure adios_write_int4_d6 + module procedure adios_write_int8_d6 + module procedure adios_write_real4_d6 + module procedure adios_write_real8_d6 + module procedure adios_write_complex8_d6 + module procedure adios_write_complex16_d6 + module procedure adios_write_char_d6 + module procedure adios_write_logical1_d6 + module procedure adios_write_logical2_d6 + module procedure adios_write_logical4_d6 + module procedure adios_write_logical8_d6 + end interface + + + ! + ! + ! ADIOS_WRITE_BYID generic interface + ! + ! Usage: call adios_write_byid (fd, varid, data, err) + ! + ! + interface adios_write_byid + module procedure adios_write_byid_int1_d0 + module procedure adios_write_byid_int2_d0 + module procedure adios_write_byid_int4_d0 + module procedure adios_write_byid_int8_d0 + module procedure adios_write_byid_real4_d0 + module procedure adios_write_byid_real8_d0 + module procedure adios_write_byid_complex8_d0 + module procedure adios_write_byid_complex16_d0 + !module procedure adios_write_byid_char_d0 + module procedure adios_write_byid_logical1_d0 + module procedure adios_write_byid_logical2_d0 + module procedure adios_write_byid_logical4_d0 + module procedure adios_write_byid_logical8_d0 + module procedure adios_write_byid_int1_d1 + module procedure adios_write_byid_int2_d1 + module procedure adios_write_byid_int4_d1 + module procedure adios_write_byid_int8_d1 + module procedure adios_write_byid_real4_d1 + module procedure adios_write_byid_real8_d1 + module procedure adios_write_byid_complex8_d1 + module procedure adios_write_byid_complex16_d1 + module procedure adios_write_byid_char_d1 + module procedure adios_write_byid_logical1_d1 + module procedure adios_write_byid_logical2_d1 + module procedure adios_write_byid_logical4_d1 + module procedure adios_write_byid_logical8_d1 + module procedure adios_write_byid_int1_d2 + module procedure adios_write_byid_int2_d2 + module procedure adios_write_byid_int4_d2 + module procedure adios_write_byid_int8_d2 + module procedure adios_write_byid_real4_d2 + module procedure adios_write_byid_real8_d2 + module procedure adios_write_byid_complex8_d2 + module procedure adios_write_byid_complex16_d2 + module procedure adios_write_byid_char_d2 + module procedure adios_write_byid_logical1_d2 + module procedure adios_write_byid_logical2_d2 + module procedure adios_write_byid_logical4_d2 + module procedure adios_write_byid_logical8_d2 + module procedure adios_write_byid_int1_d3 + module procedure adios_write_byid_int2_d3 + module procedure adios_write_byid_int4_d3 + module procedure adios_write_byid_int8_d3 + module procedure adios_write_byid_real4_d3 + module procedure adios_write_byid_real8_d3 + module procedure adios_write_byid_complex8_d3 + module procedure adios_write_byid_complex16_d3 + module procedure adios_write_byid_char_d3 + module procedure adios_write_byid_logical1_d3 + module procedure adios_write_byid_logical2_d3 + module procedure adios_write_byid_logical4_d3 + module procedure adios_write_byid_logical8_d3 + module procedure adios_write_byid_int1_d4 + module procedure adios_write_byid_int2_d4 + module procedure adios_write_byid_int4_d4 + module procedure adios_write_byid_int8_d4 + module procedure adios_write_byid_real4_d4 + module procedure adios_write_byid_real8_d4 + module procedure adios_write_byid_complex8_d4 + module procedure adios_write_byid_complex16_d4 + module procedure adios_write_byid_char_d4 + module procedure adios_write_byid_logical1_d4 + module procedure adios_write_byid_logical2_d4 + module procedure adios_write_byid_logical4_d4 + module procedure adios_write_byid_logical8_d4 + module procedure adios_write_byid_int1_d5 + module procedure adios_write_byid_int2_d5 + module procedure adios_write_byid_int4_d5 + module procedure adios_write_byid_int8_d5 + module procedure adios_write_byid_real4_d5 + module procedure adios_write_byid_real8_d5 + module procedure adios_write_byid_complex8_d5 + module procedure adios_write_byid_complex16_d5 + module procedure adios_write_byid_char_d5 + module procedure adios_write_byid_logical1_d5 + module procedure adios_write_byid_logical2_d5 + module procedure adios_write_byid_logical4_d5 + module procedure adios_write_byid_logical8_d5 + module procedure adios_write_byid_int1_d6 + module procedure adios_write_byid_int2_d6 + module procedure adios_write_byid_int4_d6 + module procedure adios_write_byid_int8_d6 + module procedure adios_write_byid_real4_d6 + module procedure adios_write_byid_real8_d6 + module procedure adios_write_byid_complex8_d6 + module procedure adios_write_byid_complex16_d6 + module procedure adios_write_byid_char_d6 + module procedure adios_write_byid_logical1_d6 + module procedure adios_write_byid_logical2_d6 + module procedure adios_write_byid_logical4_d6 + module procedure adios_write_byid_logical8_d6 + end interface + + + ! + ! + ! ADIOS_READ generic interface + ! + ! Usage: call adios_read + ! + ! + interface adios_read + module procedure adios_read_int1_d0 + module procedure adios_read_int2_d0 + module procedure adios_read_int4_d0 + module procedure adios_read_int8_d0 + module procedure adios_read_real4_d0 + module procedure adios_read_real8_d0 + module procedure adios_read_complex8_d0 + module procedure adios_read_complex16_d0 + !module procedure adios_read_char_d0 + module procedure adios_read_logical1_d0 + module procedure adios_read_logical2_d0 + module procedure adios_read_logical4_d0 + module procedure adios_read_logical8_d0 + module procedure adios_read_int1_d1 + module procedure adios_read_int2_d1 + module procedure adios_read_int4_d1 + module procedure adios_read_int8_d1 + module procedure adios_read_real4_d1 + module procedure adios_read_real8_d1 + module procedure adios_read_complex8_d1 + module procedure adios_read_complex16_d1 + module procedure adios_read_char_d1 + module procedure adios_read_logical1_d1 + module procedure adios_read_logical2_d1 + module procedure adios_read_logical4_d1 + module procedure adios_read_logical8_d1 + module procedure adios_read_int1_d2 + module procedure adios_read_int2_d2 + module procedure adios_read_int4_d2 + module procedure adios_read_int8_d2 + module procedure adios_read_real4_d2 + module procedure adios_read_real8_d2 + module procedure adios_read_complex8_d2 + module procedure adios_read_complex16_d2 + module procedure adios_read_char_d2 + module procedure adios_read_logical1_d2 + module procedure adios_read_logical2_d2 + module procedure adios_read_logical4_d2 + module procedure adios_read_logical8_d2 + module procedure adios_read_int1_d3 + module procedure adios_read_int2_d3 + module procedure adios_read_int4_d3 + module procedure adios_read_int8_d3 + module procedure adios_read_real4_d3 + module procedure adios_read_real8_d3 + module procedure adios_read_complex8_d3 + module procedure adios_read_complex16_d3 + module procedure adios_read_char_d3 + module procedure adios_read_logical1_d3 + module procedure adios_read_logical2_d3 + module procedure adios_read_logical4_d3 + module procedure adios_read_logical8_d3 + module procedure adios_read_int1_d4 + module procedure adios_read_int2_d4 + module procedure adios_read_int4_d4 + module procedure adios_read_int8_d4 + module procedure adios_read_real4_d4 + module procedure adios_read_real8_d4 + module procedure adios_read_complex8_d4 + module procedure adios_read_complex16_d4 + module procedure adios_read_char_d4 + module procedure adios_read_logical1_d4 + module procedure adios_read_logical2_d4 + module procedure adios_read_logical4_d4 + module procedure adios_read_logical8_d4 + module procedure adios_read_int1_d5 + module procedure adios_read_int2_d5 + module procedure adios_read_int4_d5 + module procedure adios_read_int8_d5 + module procedure adios_read_real4_d5 + module procedure adios_read_real8_d5 + module procedure adios_read_complex8_d5 + module procedure adios_read_complex16_d5 + module procedure adios_read_char_d5 + module procedure adios_read_logical1_d5 + module procedure adios_read_logical2_d5 + module procedure adios_read_logical4_d5 + module procedure adios_read_logical8_d5 + module procedure adios_read_int1_d6 + module procedure adios_read_int2_d6 + module procedure adios_read_int4_d6 + module procedure adios_read_int8_d6 + module procedure adios_read_real4_d6 + module procedure adios_read_real8_d6 + module procedure adios_read_complex8_d6 + module procedure adios_read_complex16_d6 + module procedure adios_read_char_d6 + module procedure adios_read_logical1_d6 + module procedure adios_read_logical2_d6 + module procedure adios_read_logical4_d6 + module procedure adios_read_logical8_d6 + end interface + contains + + ! + ! + ! ADIOS_WRITE generic interface + ! + ! Usage: call adios_write (fd, varname, data, err) + ! + ! + ! + ! + ! ADIOS_WRITE generic interface + ! + ! Usage: call adios_write (fd, varname, data, err) + ! + ! + ! + ! scalars + ! + + ! INTEGER*1 scalar + subroutine adios_write_int1_d0 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + integer*1, intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! INTEGER*2 scalar + subroutine adios_write_int2_d0 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + integer*2, intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! INTEGER*4 scalar + subroutine adios_write_int4_d0 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + integer*4, intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! INTEGER*8 scalar + subroutine adios_write_int8_d0 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + integer*8, intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! REAL*4 scalar + subroutine adios_write_real4_d0 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + real*4, intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! REAL*8 scalar + subroutine adios_write_real8_d0 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + real*8, intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! COMPLEX (*8) scalar + subroutine adios_write_complex8_d0 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + complex, intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! DOUBLE-COMPLEX scalar + subroutine adios_write_complex16_d0 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + complex*16, intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! CHARACTER scalar (Same as 1D?) + !subroutine adios_write_char_d0 (fd, varname, data, err) + ! implicit none + ! integer*8, intent(in) :: fd + ! character(*), intent(in) :: varname + ! character(*), intent(inout) :: data + ! integer, intent(in) :: err + ! + ! call adios_write_f2c (fd, varname, data, err) + !end subroutine + + ! LOGICAL*1 scalar + subroutine adios_write_logical1_d0 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + logical*1, intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! LOGICAL*2 scalar + subroutine adios_write_logical2_d0 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + logical*2, intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! LOGICAL*4 scalar + subroutine adios_write_logical4_d0 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + logical*4, intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! LOGICAL*8 scalar + subroutine adios_write_logical8_d0 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + logical*8, intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + + ! + ! 1D data + ! + + ! INTEGER*1 array + subroutine adios_write_int1_d1 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + integer*1, dimension(*), intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! INTEGER*2 array + subroutine adios_write_int2_d1 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + integer*2, dimension(*), intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! INTEGER*4 array + subroutine adios_write_int4_d1 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + integer*4, dimension(*), intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! INTEGER*8 array + subroutine adios_write_int8_d1 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + integer*8, dimension(*), intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! REAL*4 array + subroutine adios_write_real4_d1 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + real*4, dimension(*), intent(out) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! REAL*8 array + subroutine adios_write_real8_d1 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + real*8, dimension(*), intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! COMPLEX (*8) array + subroutine adios_write_complex8_d1 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + complex, dimension(*), intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! DOUBLE-COMPLEX array + subroutine adios_write_complex16_d1 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + complex*16,dimension(*), intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! CHARACTER array + subroutine adios_write_char_d1 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + character(*), intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! LOGICAL*1 array + subroutine adios_write_logical1_d1 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + logical*1, dimension(*), intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! LOGICAL*2 array + subroutine adios_write_logical2_d1 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + logical*2, dimension(*), intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! LOGICAL*4 array + subroutine adios_write_logical4_d1 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + logical*4, dimension(*), intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! LOGICAL*8 array + subroutine adios_write_logical8_d1 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + logical*8, dimension(*), intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! + ! 2D data + ! + + ! INTEGER*1 array + subroutine adios_write_int1_d2 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + integer*1, dimension(:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! INTEGER*2 array + subroutine adios_write_int2_d2 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + integer*2, dimension(:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! INTEGER*4 array + subroutine adios_write_int4_d2 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + integer*4, dimension(:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! INTEGER*8 array + subroutine adios_write_int8_d2 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + integer*8, dimension(:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! REAL*4 array + subroutine adios_write_real4_d2 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + real*4, dimension(:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! REAL*8 array + subroutine adios_write_real8_d2 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + real*8, dimension(:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! COMPLEX (*8) array + subroutine adios_write_complex8_d2 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + complex, dimension(:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! DOUBLE-COMPLEX array + subroutine adios_write_complex16_d2 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + complex*16,dimension(:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! CHARACTER array + subroutine adios_write_char_d2 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + character(*),dimension(*), intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! LOGICAL*1 array + subroutine adios_write_logical1_d2 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + logical*1, dimension(:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! LOGICAL*2 array + subroutine adios_write_logical2_d2 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + logical*2, dimension(:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! LOGICAL*4 array + subroutine adios_write_logical4_d2 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + logical*4, dimension(:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! LOGICAL*8 array + subroutine adios_write_logical8_d2 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + logical*8, dimension(:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! + ! 3D data + ! + + ! INTEGER*1 array + subroutine adios_write_int1_d3 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + integer*1, dimension(:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! INTEGER*2 array + subroutine adios_write_int2_d3 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + integer*2, dimension(:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! INTEGER*4 array + subroutine adios_write_int4_d3 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + integer*4, dimension(:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! INTEGER*8 array + subroutine adios_write_int8_d3 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + integer*8, dimension(:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! REAL*4 array + subroutine adios_write_real4_d3 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + real*4, dimension(:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! REAL*8 array + subroutine adios_write_real8_d3 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + real*8, dimension(:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! COMPLEX (*8) array + subroutine adios_write_complex8_d3 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + complex, dimension(:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! DOUBLE-COMPLEX array + subroutine adios_write_complex16_d3 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + complex*16,dimension(:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! CHARACTER array + subroutine adios_write_char_d3 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + character(*),dimension(:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! LOGICAL*1 array + subroutine adios_write_logical1_d3 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + logical*1, dimension(:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! LOGICAL*2 array + subroutine adios_write_logical2_d3 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + logical*2, dimension(:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! LOGICAL*4 array + subroutine adios_write_logical4_d3 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + logical*4, dimension(:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! LOGICAL*8 array + subroutine adios_write_logical8_d3 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + logical*8, dimension(:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! + ! 4D data + ! + + ! INTEGER*1 array + subroutine adios_write_int1_d4 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + integer*1, dimension(:,:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! INTEGER*2 array + subroutine adios_write_int2_d4 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + integer*2, dimension(:,:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! INTEGER*4 array + subroutine adios_write_int4_d4 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + integer*4, dimension(:,:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! INTEGER*8 array + subroutine adios_write_int8_d4 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + integer*8, dimension(:,:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! REAL*4 array + subroutine adios_write_real4_d4 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + real*4, dimension(:,:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! REAL*8 array + subroutine adios_write_real8_d4 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + real*8, dimension(:,:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! COMPLEX (*8) array + subroutine adios_write_complex8_d4 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + complex, dimension(:,:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! DOUBLE-COMPLEX array + subroutine adios_write_complex16_d4 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + complex*16,dimension(:,:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! CHARACTER array + subroutine adios_write_char_d4 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + character(*),dimension(:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! LOGICAL*1 array + subroutine adios_write_logical1_d4 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + logical*1, dimension(:,:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! LOGICAL*2 array + subroutine adios_write_logical2_d4 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + logical*2, dimension(:,:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! LOGICAL*4 array + subroutine adios_write_logical4_d4 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + logical*4, dimension(:,:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! LOGICAL*8 array + subroutine adios_write_logical8_d4 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + logical*8, dimension(:,:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! + ! 5D data + ! + + ! INTEGER*1 array + subroutine adios_write_int1_d5 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + integer*1, dimension(:,:,:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! INTEGER*2 array + subroutine adios_write_int2_d5 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + integer*2, dimension(:,:,:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! INTEGER*4 array + subroutine adios_write_int4_d5 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + integer*4, dimension(:,:,:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! INTEGER*8 array + subroutine adios_write_int8_d5 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + integer*8, dimension(:,:,:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! REAL*4 array + subroutine adios_write_real4_d5 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + real*4, dimension(:,:,:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! REAL*8 array + subroutine adios_write_real8_d5 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + real*8, dimension(:,:,:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! COMPLEX (*8) array + subroutine adios_write_complex8_d5 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + complex, dimension(:,:,:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! DOUBLE-COMPLEX array + subroutine adios_write_complex16_d5 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + complex*16,dimension(:,:,:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! CHARACTER array + subroutine adios_write_char_d5 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + character(*),dimension(:,:,:,:),intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! LOGICAL*1 array + subroutine adios_write_logical1_d5 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + logical*1, dimension(:,:,:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! LOGICAL*2 array + subroutine adios_write_logical2_d5 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + logical*2, dimension(:,:,:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! LOGICAL*4 array + subroutine adios_write_logical4_d5 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + logical*4, dimension(:,:,:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! LOGICAL*8 array + subroutine adios_write_logical8_d5 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + logical*8, dimension(:,:,:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! + ! 6D data + ! + + ! INTEGER*1 array + subroutine adios_write_int1_d6 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + integer*1, dimension(:,:,:,:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! INTEGER*2 array + subroutine adios_write_int2_d6 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + integer*2, dimension(:,:,:,:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! INTEGER*4 array + subroutine adios_write_int4_d6 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + integer*4, dimension(:,:,:,:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! INTEGER*8 array + subroutine adios_write_int8_d6 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + integer*8, dimension(:,:,:,:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! REAL*4 array + subroutine adios_write_real4_d6 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + real*4, dimension(:,:,:,:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! REAL*8 array + subroutine adios_write_real8_d6 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + real*8, dimension(:,:,:,:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! COMPLEX (*8) array + subroutine adios_write_complex8_d6 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + complex, dimension(:,:,:,:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! DOUBLE-COMPLEX array + subroutine adios_write_complex16_d6 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + complex*16,dimension(:,:,:,:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! CHARACTER array + subroutine adios_write_char_d6 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + character(*),dimension(:,:,:,:,:),intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! LOGICAL*1 array + subroutine adios_write_logical1_d6 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + logical*1, dimension(:,:,:,:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! LOGICAL*2 array + subroutine adios_write_logical2_d6 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + logical*2, dimension(:,:,:,:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! LOGICAL*4 array + subroutine adios_write_logical4_d6 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + logical*4, dimension(:,:,:,:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! LOGICAL*8 array + subroutine adios_write_logical8_d6 (fd, varname, data, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + logical*8, dimension(:,:,:,:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_f2c (fd, varname, data, err) + end subroutine + + ! end of ADIOS_WRITE functions + + + ! + ! + ! ADIOS_WRITE_BYID generic interface + ! + ! Usage: call adios_write_byid (fd, varid, data, err) + ! + ! + ! + ! scalars + ! + + ! INTEGER*1 scalar + subroutine adios_write_byid_int1_d0 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + integer*1, intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! INTEGER*2 scalar + subroutine adios_write_byid_int2_d0 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + integer*2, intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! INTEGER*4 scalar + subroutine adios_write_byid_int4_d0 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + integer*4, intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! INTEGER*8 scalar + subroutine adios_write_byid_int8_d0 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + integer*8, intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! REAL*4 scalar + subroutine adios_write_byid_real4_d0 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + real*4, intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! REAL*8 scalar + subroutine adios_write_byid_real8_d0 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + real*8, intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! COMPLEX (*8) scalar + subroutine adios_write_byid_complex8_d0 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + complex, intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! DOUBLE-COMPLEX scalar + subroutine adios_write_byid_complex16_d0 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + complex*16, intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! CHARACTER scalar (Same as 1D?) + !subroutine adios_write_byid_char_d0 (fd, varid, data, err) + ! implicit none + ! integer*8, intent(in) :: fd + ! integer*8, intent(in) :: varid + ! character(*), intent(inout) :: data + ! integer, intent(in) :: err + ! + ! call adios_write_byid_f2c (fd, varid, data, err) + !end subroutine + + ! LOGICAL*1 scalar + subroutine adios_write_byid_logical1_d0 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + logical*1, intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! LOGICAL*2 scalar + subroutine adios_write_byid_logical2_d0 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + logical*2, intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! LOGICAL*4 scalar + subroutine adios_write_byid_logical4_d0 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + logical*4, intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! LOGICAL*8 scalar + subroutine adios_write_byid_logical8_d0 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + logical*8, intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + + ! + ! 1D data + ! + + ! INTEGER*1 array + subroutine adios_write_byid_int1_d1 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + integer*1, dimension(*), intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! INTEGER*2 array + subroutine adios_write_byid_int2_d1 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + integer*2, dimension(*), intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! INTEGER*4 array + subroutine adios_write_byid_int4_d1 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + integer*4, dimension(*), intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! INTEGER*8 array + subroutine adios_write_byid_int8_d1 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + integer*8, dimension(*), intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! REAL*4 array + subroutine adios_write_byid_real4_d1 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + real*4, dimension(*), intent(out) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! REAL*8 array + subroutine adios_write_byid_real8_d1 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + real*8, dimension(*), intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! COMPLEX (*8) array + subroutine adios_write_byid_complex8_d1 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + complex, dimension(*), intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! DOUBLE-COMPLEX array + subroutine adios_write_byid_complex16_d1 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + complex*16,dimension(*), intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! CHARACTER array + subroutine adios_write_byid_char_d1 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + character(*), intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! LOGICAL*1 array + subroutine adios_write_byid_logical1_d1 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + logical*1, dimension(*), intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! LOGICAL*2 array + subroutine adios_write_byid_logical2_d1 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + logical*2, dimension(*), intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! LOGICAL*4 array + subroutine adios_write_byid_logical4_d1 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + logical*4, dimension(*), intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! LOGICAL*8 array + subroutine adios_write_byid_logical8_d1 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + logical*8, dimension(*), intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! + ! 2D data + ! + + ! INTEGER*1 array + subroutine adios_write_byid_int1_d2 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + integer*1, dimension(:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! INTEGER*2 array + subroutine adios_write_byid_int2_d2 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + integer*2, dimension(:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! INTEGER*4 array + subroutine adios_write_byid_int4_d2 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + integer*4, dimension(:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! INTEGER*8 array + subroutine adios_write_byid_int8_d2 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + integer*8, dimension(:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! REAL*4 array + subroutine adios_write_byid_real4_d2 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + real*4, dimension(:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! REAL*8 array + subroutine adios_write_byid_real8_d2 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + real*8, dimension(:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! COMPLEX (*8) array + subroutine adios_write_byid_complex8_d2 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + complex, dimension(:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! DOUBLE-COMPLEX array + subroutine adios_write_byid_complex16_d2 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + complex*16,dimension(:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! CHARACTER array + subroutine adios_write_byid_char_d2 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + character(*),dimension(*), intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! LOGICAL*1 array + subroutine adios_write_byid_logical1_d2 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + logical*1, dimension(:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! LOGICAL*2 array + subroutine adios_write_byid_logical2_d2 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + logical*2, dimension(:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! LOGICAL*4 array + subroutine adios_write_byid_logical4_d2 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + logical*4, dimension(:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! LOGICAL*8 array + subroutine adios_write_byid_logical8_d2 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + logical*8, dimension(:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! + ! 3D data + ! + + ! INTEGER*1 array + subroutine adios_write_byid_int1_d3 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + integer*1, dimension(:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! INTEGER*2 array + subroutine adios_write_byid_int2_d3 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + integer*2, dimension(:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! INTEGER*4 array + subroutine adios_write_byid_int4_d3 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + integer*4, dimension(:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! INTEGER*8 array + subroutine adios_write_byid_int8_d3 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + integer*8, dimension(:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! REAL*4 array + subroutine adios_write_byid_real4_d3 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + real*4, dimension(:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! REAL*8 array + subroutine adios_write_byid_real8_d3 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + real*8, dimension(:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! COMPLEX (*8) array + subroutine adios_write_byid_complex8_d3 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + complex, dimension(:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! DOUBLE-COMPLEX array + subroutine adios_write_byid_complex16_d3 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + complex*16,dimension(:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! CHARACTER array + subroutine adios_write_byid_char_d3 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + character(*),dimension(:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! LOGICAL*1 array + subroutine adios_write_byid_logical1_d3 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + logical*1, dimension(:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! LOGICAL*2 array + subroutine adios_write_byid_logical2_d3 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + logical*2, dimension(:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! LOGICAL*4 array + subroutine adios_write_byid_logical4_d3 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + logical*4, dimension(:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! LOGICAL*8 array + subroutine adios_write_byid_logical8_d3 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + logical*8, dimension(:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! + ! 4D data + ! + + ! INTEGER*1 array + subroutine adios_write_byid_int1_d4 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + integer*1, dimension(:,:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! INTEGER*2 array + subroutine adios_write_byid_int2_d4 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + integer*2, dimension(:,:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! INTEGER*4 array + subroutine adios_write_byid_int4_d4 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + integer*4, dimension(:,:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! INTEGER*8 array + subroutine adios_write_byid_int8_d4 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + integer*8, dimension(:,:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! REAL*4 array + subroutine adios_write_byid_real4_d4 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + real*4, dimension(:,:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! REAL*8 array + subroutine adios_write_byid_real8_d4 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + real*8, dimension(:,:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! COMPLEX (*8) array + subroutine adios_write_byid_complex8_d4 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + complex, dimension(:,:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! DOUBLE-COMPLEX array + subroutine adios_write_byid_complex16_d4 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + complex*16,dimension(:,:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! CHARACTER array + subroutine adios_write_byid_char_d4 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + character(*),dimension(:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! LOGICAL*1 array + subroutine adios_write_byid_logical1_d4 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + logical*1, dimension(:,:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! LOGICAL*2 array + subroutine adios_write_byid_logical2_d4 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + logical*2, dimension(:,:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! LOGICAL*4 array + subroutine adios_write_byid_logical4_d4 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + logical*4, dimension(:,:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! LOGICAL*8 array + subroutine adios_write_byid_logical8_d4 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + logical*8, dimension(:,:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! + ! 5D data + ! + + ! INTEGER*1 array + subroutine adios_write_byid_int1_d5 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + integer*1, dimension(:,:,:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! INTEGER*2 array + subroutine adios_write_byid_int2_d5 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + integer*2, dimension(:,:,:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! INTEGER*4 array + subroutine adios_write_byid_int4_d5 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + integer*4, dimension(:,:,:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! INTEGER*8 array + subroutine adios_write_byid_int8_d5 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + integer*8, dimension(:,:,:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! REAL*4 array + subroutine adios_write_byid_real4_d5 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + real*4, dimension(:,:,:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! REAL*8 array + subroutine adios_write_byid_real8_d5 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + real*8, dimension(:,:,:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! COMPLEX (*8) array + subroutine adios_write_byid_complex8_d5 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + complex, dimension(:,:,:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! DOUBLE-COMPLEX array + subroutine adios_write_byid_complex16_d5 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + complex*16,dimension(:,:,:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! CHARACTER array + subroutine adios_write_byid_char_d5 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + character(*),dimension(:,:,:,:),intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! LOGICAL*1 array + subroutine adios_write_byid_logical1_d5 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + logical*1, dimension(:,:,:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! LOGICAL*2 array + subroutine adios_write_byid_logical2_d5 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + logical*2, dimension(:,:,:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! LOGICAL*4 array + subroutine adios_write_byid_logical4_d5 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + logical*4, dimension(:,:,:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! LOGICAL*8 array + subroutine adios_write_byid_logical8_d5 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + logical*8, dimension(:,:,:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! + ! 6D data + ! + + ! INTEGER*1 array + subroutine adios_write_byid_int1_d6 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + integer*1, dimension(:,:,:,:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! INTEGER*2 array + subroutine adios_write_byid_int2_d6 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + integer*2, dimension(:,:,:,:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! INTEGER*4 array + subroutine adios_write_byid_int4_d6 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + integer*4, dimension(:,:,:,:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! INTEGER*8 array + subroutine adios_write_byid_int8_d6 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + integer*8, dimension(:,:,:,:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! REAL*4 array + subroutine adios_write_byid_real4_d6 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + real*4, dimension(:,:,:,:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! REAL*8 array + subroutine adios_write_byid_real8_d6 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + real*8, dimension(:,:,:,:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! COMPLEX (*8) array + subroutine adios_write_byid_complex8_d6 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + complex, dimension(:,:,:,:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! DOUBLE-COMPLEX array + subroutine adios_write_byid_complex16_d6 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + complex*16,dimension(:,:,:,:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! CHARACTER array + subroutine adios_write_byid_char_d6 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + character(*),dimension(:,:,:,:,:),intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! LOGICAL*1 array + subroutine adios_write_byid_logical1_d6 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + logical*1, dimension(:,:,:,:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! LOGICAL*2 array + subroutine adios_write_byid_logical2_d6 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + logical*2, dimension(:,:,:,:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! LOGICAL*4 array + subroutine adios_write_byid_logical4_d6 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + logical*4, dimension(:,:,:,:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! LOGICAL*8 array + subroutine adios_write_byid_logical8_d6 (fd, varid, data, err) + implicit none + integer*8, intent(in) :: fd + integer*8, intent(in) :: varid + logical*8, dimension(:,:,:,:,:,:), intent(in) :: data + integer, intent(in) :: err + + call adios_write_byid_f2c (fd, varid, data, err) + end subroutine + + ! end of ADIOS_WRITE functions + + + + + ! + ! + ! ADIOS_READ generic interface + ! + ! Usage: call adios_read (fd, varname, buffer, buffer_size, err) + ! + ! + ! + ! scalar data + ! + + ! INTEGER*1 scalar + subroutine adios_read_int1_d0 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + integer*1, intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! INTEGER*2 scalar + subroutine adios_read_int2_d0 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + integer*2, intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! INTEGER*4 scalar + subroutine adios_read_int4_d0 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + integer*4, intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! INTEGER*8 scalar + subroutine adios_read_int8_d0 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + integer*8, intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! REAL*4 scalar + subroutine adios_read_real4_d0 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + real*4, intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! REAL*8 scalar + subroutine adios_read_real8_d0 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + real*8, intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! COMPLEX (*8) scalar + subroutine adios_read_complex8_d0 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + complex, intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! DOUBLE-COMPLEX scalar + subroutine adios_read_complex16_d0 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + complex*16, intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! CHARACTER scalar + !subroutine adios_read_char_d0 (fd, varname, buffer, buffer_size, err) + ! implicit none + ! integer*8, intent(in) :: fd + ! character(*), intent(in) :: varname + ! character(*), intent(out) :: buffer + ! integer*8, intent(in) :: buffer_size + ! integer, intent(in) :: err + ! + ! call adios_read_f2c (fd, varname, buffer, buffer_size, err) + !end subroutine + + ! LOGICAL*1 scalar + subroutine adios_read_logical1_d0 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + logical*1, intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! LOGICAL*2 scalar + subroutine adios_read_logical2_d0 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + logical*2, intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! LOGICAL*4 scalar + subroutine adios_read_logical4_d0 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + logical*4, intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! LOGICAL*8 scalar + subroutine adios_read_logical8_d0 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + logical*8, intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + + ! + ! 1D data + ! + + ! INTEGER*1 array + subroutine adios_read_int1_d1 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + integer*1, dimension(*), intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! INTEGER*2 array + subroutine adios_read_int2_d1 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + integer*2, dimension(*), intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! INTEGER*4 array + subroutine adios_read_int4_d1 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + integer*4, dimension(*), intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! INTEGER*8 array + subroutine adios_read_int8_d1 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + integer*8, dimension(*), intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! REAL*4 array + subroutine adios_read_real4_d1 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + real*4, dimension(*), intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! REAL*8 array + subroutine adios_read_real8_d1 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + real*8, dimension(*), intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! COMPLEX (*8) array + subroutine adios_read_complex8_d1 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + complex, dimension(*), intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! DOUBLE-COMPLEX array + subroutine adios_read_complex16_d1 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + complex*16,dimension(*), intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! CHARACTER array + subroutine adios_read_char_d1 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + character(*), intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! LOGICAL*1 array + subroutine adios_read_logical1_d1 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + logical*1, dimension(*), intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! LOGICAL*2 array + subroutine adios_read_logical2_d1 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + logical*2, dimension(*), intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! LOGICAL*4 array + subroutine adios_read_logical4_d1 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + logical*4, dimension(*), intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! LOGICAL*8 array + subroutine adios_read_logical8_d1 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + logical*8, dimension(*), intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! + ! 2D buffer + ! + + ! INTEGER*1 array + subroutine adios_read_int1_d2 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + integer*1, dimension(:,:), intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! INTEGER*2 array + subroutine adios_read_int2_d2 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + integer*2, dimension(:,:), intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! INTEGER*4 array + subroutine adios_read_int4_d2 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + integer*4, dimension(:,:), intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! INTEGER*8 array + subroutine adios_read_int8_d2 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + integer*8, dimension(:,:), intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! REAL*4 array + subroutine adios_read_real4_d2 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + real*4, dimension(:,:), intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! REAL*8 array + subroutine adios_read_real8_d2 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + real*8, dimension(:,:), intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! COMPLEX (*8) array + subroutine adios_read_complex8_d2 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + complex, dimension(:,:), intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! DOUBLE-COMPLEX array + subroutine adios_read_complex16_d2 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + complex*16,dimension(:,:), intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! CHARACTER array + subroutine adios_read_char_d2 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + character(*),dimension(*), intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! LOGICAL*1 array + subroutine adios_read_logical1_d2 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + logical*1, dimension(:,:), intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! LOGICAL*2 array + subroutine adios_read_logical2_d2 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + logical*2, dimension(:,:), intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! LOGICAL*4 array + subroutine adios_read_logical4_d2 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + logical*4, dimension(:,:), intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! LOGICAL*8 array + subroutine adios_read_logical8_d2 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + logical*8, dimension(:,:), intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! + ! 3D buffer + ! + + ! INTEGER*1 array + subroutine adios_read_int1_d3 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + integer*1, dimension(:,:,:), intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! INTEGER*2 array + subroutine adios_read_int2_d3 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + integer*2, dimension(:,:,:), intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! INTEGER*4 array + subroutine adios_read_int4_d3 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + integer*4, dimension(:,:,:), intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! INTEGER*8 array + subroutine adios_read_int8_d3 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + integer*8, dimension(:,:,:), intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! REAL*4 array + subroutine adios_read_real4_d3 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + real*4, dimension(:,:,:), intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! REAL*8 array + subroutine adios_read_real8_d3 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + real*8, dimension(:,:,:), intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! COMPLEX (*8) array + subroutine adios_read_complex8_d3 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + complex, dimension(:,:,:), intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! DOUBLE-COMPLEX array + subroutine adios_read_complex16_d3 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + complex*16,dimension(:,:,:), intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! CHARACTER array + subroutine adios_read_char_d3 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + character(*),dimension(:,:), intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! LOGICAL*1 array + subroutine adios_read_logical1_d3 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + logical*1, dimension(:,:,:), intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! LOGICAL*2 array + subroutine adios_read_logical2_d3 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + logical*2, dimension(:,:,:), intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! LOGICAL*4 array + subroutine adios_read_logical4_d3 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + logical*4, dimension(:,:,:), intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! LOGICAL*8 array + subroutine adios_read_logical8_d3 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + logical*8, dimension(:,:,:), intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! + ! 4D buffer + ! + + ! INTEGER*1 array + subroutine adios_read_int1_d4 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + integer*1, dimension(:,:,:,:), intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! INTEGER*2 array + subroutine adios_read_int2_d4 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + integer*2, dimension(:,:,:,:), intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! INTEGER*4 array + subroutine adios_read_int4_d4 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + integer*4, dimension(:,:,:,:), intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! INTEGER*8 array + subroutine adios_read_int8_d4 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + integer*8, dimension(:,:,:,:), intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! REAL*4 array + subroutine adios_read_real4_d4 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + real*4, dimension(:,:,:,:), intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! REAL*8 array + subroutine adios_read_real8_d4 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + real*8, dimension(:,:,:,:), intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! COMPLEX (*8) array + subroutine adios_read_complex8_d4 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + complex, dimension(:,:,:,:), intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! DOUBLE-COMPLEX array + subroutine adios_read_complex16_d4 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + complex*16,dimension(:,:,:,:), intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! CHARACTER array + subroutine adios_read_char_d4 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + character(*),dimension(:,:,:), intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! LOGICAL*1 array + subroutine adios_read_logical1_d4 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + logical*1, dimension(:,:,:,:), intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! LOGICAL*2 array + subroutine adios_read_logical2_d4 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + logical*2, dimension(:,:,:,:), intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! LOGICAL*4 array + subroutine adios_read_logical4_d4 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + logical*4, dimension(:,:,:,:), intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! LOGICAL*8 array + subroutine adios_read_logical8_d4 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + logical*8, dimension(:,:,:,:), intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! + ! 5D buffer + ! + + ! INTEGER*1 array + subroutine adios_read_int1_d5 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + integer*1, dimension(:,:,:,:,:), intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! INTEGER*2 array + subroutine adios_read_int2_d5 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + integer*2, dimension(:,:,:,:,:), intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! INTEGER*4 array + subroutine adios_read_int4_d5 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + integer*4, dimension(:,:,:,:,:), intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! INTEGER*8 array + subroutine adios_read_int8_d5 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + integer*8, dimension(:,:,:,:,:), intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! REAL*4 array + subroutine adios_read_real4_d5 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + real*4, dimension(:,:,:,:,:), intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! REAL*8 array + subroutine adios_read_real8_d5 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + real*8, dimension(:,:,:,:,:), intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! COMPLEX (*8) array + subroutine adios_read_complex8_d5 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + complex, dimension(:,:,:,:,:), intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! DOUBLE-COMPLEX array + subroutine adios_read_complex16_d5 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + complex*16,dimension(:,:,:,:,:), intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! CHARACTER array + subroutine adios_read_char_d5 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + character(*),dimension(:,:,:,:),intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! LOGICAL*1 array + subroutine adios_read_logical1_d5 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + logical*1, dimension(:,:,:,:,:), intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! LOGICAL*2 array + subroutine adios_read_logical2_d5 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + logical*2, dimension(:,:,:,:,:), intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! LOGICAL*4 array + subroutine adios_read_logical4_d5 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + logical*4, dimension(:,:,:,:,:), intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! LOGICAL*8 array + subroutine adios_read_logical8_d5 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + logical*8, dimension(:,:,:,:,:), intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! + ! 6D buffer + ! + + ! INTEGER*1 array + subroutine adios_read_int1_d6 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + integer*1, dimension(:,:,:,:,:,:), intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! INTEGER*2 array + subroutine adios_read_int2_d6 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + integer*2, dimension(:,:,:,:,:,:), intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! INTEGER*4 array + subroutine adios_read_int4_d6 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + integer*4, dimension(:,:,:,:,:,:), intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! INTEGER*8 array + subroutine adios_read_int8_d6 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + integer*8, dimension(:,:,:,:,:,:), intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! REAL*4 array + subroutine adios_read_real4_d6 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + real*4, dimension(:,:,:,:,:,:), intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! REAL*8 array + subroutine adios_read_real8_d6 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + real*8, dimension(:,:,:,:,:,:), intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! COMPLEX (*8) array + subroutine adios_read_complex8_d6 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + complex, dimension(:,:,:,:,:,:), intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! DOUBLE-COMPLEX array + subroutine adios_read_complex16_d6 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + complex*16,dimension(:,:,:,:,:,:), intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! CHARACTER array + subroutine adios_read_char_d6 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + character(*),dimension(:,:,:,:,:),intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! LOGICAL*1 array + subroutine adios_read_logical1_d6 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + logical*1, dimension(:,:,:,:,:,:), intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! LOGICAL*2 array + subroutine adios_read_logical2_d6 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + logical*2, dimension(:,:,:,:,:,:), intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! LOGICAL*4 array + subroutine adios_read_logical4_d6 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + logical*4, dimension(:,:,:,:,:,:), intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! LOGICAL*8 array + subroutine adios_read_logical8_d6 (fd, varname, buffer, buffer_size, err) + implicit none + integer*8, intent(in) :: fd + character(*), intent(in) :: varname + logical*8, dimension(:,:,:,:,:,:), intent(out) :: buffer + integer*8, intent(in) :: buffer_size + integer, intent(in) :: err + + call adios_read_f2c (fd, varname, buffer, buffer_size, err) + end subroutine + + ! end of ADIOS_READ functions + +end module + diff --git a/tests/libs/adios/src/core/bp_types.h b/tests/libs/adios/src/core/bp_types.h new file mode 100644 index 0000000000..b9d3b83bf7 --- /dev/null +++ b/tests/libs/adios/src/core/bp_types.h @@ -0,0 +1,114 @@ +/* + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + */ + +#ifndef __BP_TYPES_H__ +#define __BP_TYPES_H__ + +#include "public/adios_types.h" +#include "core/adios_bp_v1.h" +#include "core/util.h" /* struct read_request */ + +#define BP_MAX_RANK 32 +#define BP_MAX_NDIMS (BP_MAX_RANK+1) + +struct bp_index_pg_struct_v1 +{ + char * group_name; + enum ADIOS_FLAG adios_host_language_fortran; + uint32_t process_id; + char * time_index_name; + uint32_t time_index; + uint64_t offset_in_file; + + struct bp_index_pg_struct_v1 * next; +}; + +struct bp_minifooter { + uint64_t time_steps; /* = fh->tidx_stop - fh->tidx_start + 1 */ + uint64_t pgs_count; + uint64_t pgs_length; + uint32_t vars_count; + uint32_t attrs_count; + uint64_t vars_length; + uint64_t attrs_length; + uint64_t pgs_index_offset; + uint64_t vars_index_offset; + uint64_t attrs_index_offset; + uint32_t version; + uint32_t change_endianness; // = enum ADIOS_FLAG, 0: unknown!, adios_flag_yes or adios_flag_no + uint64_t file_size; +} __attribute__((__packed__)); + +struct BP_file_handle +{ + uint32_t file_index; + MPI_File fh; + struct BP_file_handle * next; +}; + +typedef struct BP_file_handle BP_file_handle_list; + +typedef struct BP_FILE { + MPI_File mpi_fh; + char * fname; // Main file name is needed to calculate subfile names + BP_file_handle_list * sfh; // This list links all the subfiles handle together + MPI_Comm comm; + struct adios_bp_buffer_struct_v1 * b; + struct bp_index_pg_struct_v1 * pgs_root; + struct adios_index_var_struct_v1 * vars_root; + struct adios_index_attribute_struct_v1 * attrs_root; + struct adios_index_var_struct_v1 ** vars_table; // To speed up vars_root lookup. Q. Liu, 12-2013. + struct bp_minifooter mfooter; + struct BP_GROUP_VAR * gvar_h; + struct BP_GROUP_ATTR * gattr_h; + uint32_t tidx_start; + uint32_t tidx_stop; + void * priv; +} BP_FILE; + +// save per proc info +typedef struct BP_PROC { + BP_FILE * fh; + int streaming; + int * varid_mapping; + read_request * local_read_request_list; + void * b; //internal buffer for chunk reading + void * priv; +} BP_PROC; + +struct BP_GROUP_VAR { + uint16_t group_count; + uint16_t group_id; + char ** namelist; + uint32_t *** time_index; + uint64_t * pg_offsets; + char ** var_namelist; + uint32_t * var_counts_per_group; + uint64_t ** var_offsets; +}; + +struct BP_GROUP_ATTR { + uint16_t group_count; + uint16_t group_id; + char ** namelist; + char ** attr_namelist; + uint32_t * attr_counts_per_group; + uint64_t ** attr_offsets; +}; + +struct BP_GROUP { + uint16_t group_id; + uint16_t vars_offset; // start of variables belonging to this group in the list of variables from all groups; old read API used this + uint32_t vars_count; + uint16_t attrs_offset; // old read API, this group's attributes in the list of all groups' attrs + uint32_t attrs_count; + struct BP_FILE * fh; + struct adios_index_var_struct_v1 * vars_root; /* pointer into the list of BP_FILE.vars_root */ + struct adios_index_attribute_struct_v1 * attrs_root; +}; + +#endif diff --git a/tests/libs/adios/src/core/bp_utils.c b/tests/libs/adios/src/core/bp_utils.c new file mode 100644 index 0000000000..6eabce1a0f --- /dev/null +++ b/tests/libs/adios/src/core/bp_utils.c @@ -0,0 +1,3160 @@ +/* + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + */ + +#include +#include +#include +#include +#include +#include +#include +#include "adios.h" +#include "adios_read.h" +#include "adios_error.h" +#include "core/bp_utils.h" +#include "core/adios_internals.h" +#include "core/adios_bp_v1.h" +#include "core/adios_endianness.h" +#include "core/adios_logger.h" +#include "core/futils.h" +#define BYTE_ALIGN 8 +#define MINIFOOTER_SIZE 28 + +#include "core/transforms/adios_transforms_common.h" // NCSU ALACRITY-ADIOS + +#ifdef DMALLOC +#include "dmalloc.h" +#endif + +#define BUFREAD8(b,var) var = (uint8_t) *(b->buff + b->offset); \ + b->offset += 1; + +#define BUFREAD16(b,var) var = *(uint16_t *) (b->buff + b->offset); \ + if (b->change_endianness == adios_flag_yes) \ + swap_16(var); \ + b->offset += 2; + +#define BUFREAD32(b,var) var = *(uint32_t *) (b->buff + b->offset); \ + if (b->change_endianness == adios_flag_yes) \ + swap_32(var); \ + b->offset += 4; + +#define BUFREAD64(b,var) var = *(uint64_t *) (b->buff + b->offset); \ + if (b->change_endianness == adios_flag_yes) \ + swap_64(var); \ + b->offset += 8; + +inline BP_PROC * GET_BP_PROC (const ADIOS_FILE * fp) +{ + return (BP_PROC *) fp->fh; +} + +inline BP_FILE * GET_BP_FILE (const ADIOS_FILE * fp) +{ + return (BP_FILE *) ((BP_PROC *) fp->fh)->fh; +} + +/* prototypes */ +void * bp_read_data_from_buffer(struct adios_bp_buffer_struct_v1 *b, enum ADIOS_DATATYPES type); +int bp_parse_characteristics (struct adios_bp_buffer_struct_v1 * b, struct adios_index_var_struct_v1 ** root, uint64_t j); + + + +void bp_alloc_aligned (struct adios_bp_buffer_struct_v1 * b, uint64_t size) +{ + + b->allocated_buff_ptr = malloc (size + BYTE_ALIGN - 1); + if (!b->allocated_buff_ptr) + { + adios_error ( err_no_memory, "Cannot allocate %llu bytes\n", size); + + b->buff = NULL; + b->length = 0; + + return; + } + uint64_t p = (uint64_t) b->allocated_buff_ptr; + b->buff = (char *) ((p + BYTE_ALIGN - 1) & ~(BYTE_ALIGN - 1)); + b->length = size; +} + +void bp_realloc_aligned (struct adios_bp_buffer_struct_v1 * b + ,uint64_t size + ) +{ + b->allocated_buff_ptr = realloc (b->allocated_buff_ptr + ,size + BYTE_ALIGN - 1 + ); + if (!b->allocated_buff_ptr) + { + adios_error ( err_no_memory, "Cannot allocate %llu bytes\n", size); + + b->buff = NULL; + b->length = 0; + + return; + } + uint64_t p = (uint64_t) b->allocated_buff_ptr; + b->buff = (char *) ((p + BYTE_ALIGN - 1) & ~(BYTE_ALIGN - 1)); + b->length = size; +} + +/* Return 0: if file is little endian, 1 if file is big endian + * We know if it is different from the current system, so here + * we determine the current endianness and report accordingly. + */ +int bp_get_endianness( uint32_t change_endianness ) +{ + int LE = 0; + int BE = !LE; + int i = 1; + char *p = (char *) &i; + int current_endianness; + if (p[0] == 1) // Lowest address contains the least significant byte + current_endianness = LE; + else + current_endianness = BE; + if (change_endianness == adios_flag_yes) + return !current_endianness; + else + return current_endianness; +} + +/* Convert 'step' to time, which is used in ADIOS internals. + * 'step' should start from 0. + */ +int get_time (struct adios_index_var_struct_v1 * v, int step) +{ + int i = 0; + int prev_ti = 0, counter = 0; + + while (i < v->characteristics_count) + { + if (v->characteristics[i].time_index != prev_ti) + { + counter ++; + if (counter == (step + 1)) + { + return v->characteristics[i].time_index; + } + prev_ti = v->characteristics[i].time_index; + } + + i++; + } + + return -1; + +} + +/* This routine converts "step" to "time", which is an ADIOS internal thing. + * The calculated "time" is needed by other BP routines to figure + * correct piece of var index to process. + * NOTE that + * 1. For file mode, an application could write a variable at every other dump, + * say, the 1th dump, 3rd dump, 5th dump. The corresponding step + * should be 0, 1, 2 for it. + */ +int _adios_step_to_time (const ADIOS_FILE * fp, struct adios_index_var_struct_v1 * v, int from_steps) +{ + BP_PROC * p = GET_BP_PROC (fp); + BP_FILE * fh = GET_BP_FILE (fp); + int t, time; + + t = fp->current_step + from_steps; + if (!p->streaming) + { + time = get_time (v, t); + } + else + { + time = t + 1; + } + + return time; +} + +/* Same functionality as _adios_step_to_time() + * The only different is the second argument is varid, + * instead of index_var_struct. + */ +int adios_step_to_time (const ADIOS_FILE * fp, int varid, int from_steps) +{ + BP_PROC * p = GET_BP_PROC (fp); + BP_FILE * fh = GET_BP_FILE (fp); + struct adios_index_var_struct_v1 * v; + int mapped_varid; + + adios_errno = 0; + + mapped_varid = p->varid_mapping[varid]; + v = bp_find_var_byid (fh, mapped_varid); + + return _adios_step_to_time (fp, v, from_steps); +} + +int bp_read_open (const char * filename, + MPI_Comm comm, + BP_FILE * fh) +{ + int err; + int rank; + + MPI_Comm_rank (comm, &rank); + + // variable definition + MPI_Offset file_size; + + // open a file by the multiple processors within the same + // communicator + err = MPI_File_open (comm, (char *) filename, MPI_MODE_RDONLY, + (MPI_Info) MPI_INFO_NULL, &(fh->mpi_fh)); + if (err != MPI_SUCCESS) { + char e [MPI_MAX_ERROR_STRING]; + int len = 0; + memset (e, 0, MPI_MAX_ERROR_STRING); + MPI_Error_string (err, e, &len); + adios_error (err_file_open_error, "MPI open failed for %s: '%s'\n", filename, e); + return adios_flag_no; + } + + MPI_File_get_size (fh->mpi_fh, &file_size); + fh->b->file_size = file_size; + fh->mfooter.file_size = file_size; + + return 0; +} + +/* This routine does the parallel bp file open and index parsing. + */ +int bp_open (const char * fname, + MPI_Comm comm, + BP_FILE * fh) +{ + int rank; + uint64_t header_size; + + MPI_Comm_rank (comm, &rank); + + adios_buffer_struct_init (fh->b); + + if (bp_read_open (fname, comm, fh)) + { + return -1; + } + + /* Only rank 0 reads the footer and it broadcasts to all other processes */ + if (rank == 0) + { + if (bp_read_minifooter (fh)) + { + return -1; + } + } + + /* Broadcast to all other processors */ + MPI_Bcast (&fh->mfooter, sizeof (struct bp_minifooter), MPI_BYTE, 0, comm); + + header_size = fh->mfooter.file_size-fh->mfooter.pgs_index_offset; + + if (rank != 0) + { + if (!fh->b->buff) + { + bp_alloc_aligned (fh->b, header_size); + assert (fh->b->buff); + + memset (fh->b->buff, 0, header_size); + fh->b->offset = 0; + } + } + + MPI_Barrier (comm); + MPI_Bcast (fh->b->buff, fh->mfooter.file_size-fh->mfooter.pgs_index_offset, MPI_BYTE, 0, comm); + + /* Everyone parses the index on its own */ + bp_parse_pgs (fh); + bp_parse_vars (fh); + bp_parse_attrs (fh); + + return 0; +} + +ADIOS_VARINFO * bp_inq_var_byid (const ADIOS_FILE * fp, int varid) +{ + BP_PROC * p = GET_BP_PROC (fp); + BP_FILE * fh = GET_BP_FILE (fp); + ADIOS_VARINFO * varinfo; + int file_is_fortran, size, i; + struct adios_index_var_struct_v1 * v; + + adios_errno = 0; + + v = bp_find_var_byid (fh, varid); + + varinfo = (ADIOS_VARINFO *) malloc (sizeof (ADIOS_VARINFO)); + assert (varinfo); + + /* Note: set varid as the real varid. + Common read layer should convert it to the perceived id after the read me +thod returns. + */ + varinfo->varid = varid; + varinfo->type = v->type; + file_is_fortran = is_fortran_file (fh); + + assert (v->characteristics_count); + + // Bugfix for block test (block.c). Actually changes + // are actually inside bp_get_and_swap_dimensions. + // For streaming mode, varinfo is built per steps. + // Q. Liu 08/27/2014 + bp_get_and_swap_dimensions (fp, v, file_is_fortran, + &varinfo->ndim, &varinfo->dims, + &varinfo->nsteps, + file_is_fortran != futils_is_called_from_fortran() + ); + if (p->streaming) + { + varinfo->nsteps = 1; + } + + // set value for scalar + if (v->characteristics [0].value) + { + i = 0; + + if (p->streaming) + { + int time = fp->current_step + 1; + i = 0; + while (i < v->characteristics_count && v->characteristics[i].time_index != time) + { + i++; + } + + if (i >= v->characteristics_count) + { + // shouldn't be here + } + } + else + { + // keep i as 0 + } + + size = bp_get_type_size (v->type, v->characteristics [i].value); + varinfo->value = (void *) malloc (size); + assert (varinfo->value); + + memcpy (varinfo->value, v->characteristics [i].value, size); + } + else + { + varinfo->value = NULL; + } + + varinfo->global = is_global_array (&(v->characteristics[0])); + + varinfo->nblocks = get_var_nblocks (v, varinfo->nsteps); + + assert (varinfo->nblocks); + + varinfo->sum_nblocks = (!p->streaming ? v->characteristics_count : varinfo->nblocks[0]) ; + varinfo->statistics = 0; + varinfo->blockinfo = 0; + varinfo->meshinfo = 0; + + return varinfo; +} + +MPI_File * get_BP_file_handle(struct BP_file_handle * l, uint32_t file_index) +{ + if (!l) + return 0; + + while (l) + { + if (l->file_index == file_index) + return &l->fh; + + l = l->next; + } + + return 0; +} + +void add_BP_file_handle (struct BP_file_handle ** l, struct BP_file_handle * n) +{ + if (!n) + return; + + n->next = *l; + *l = n; +} + +void close_all_BP_files (struct BP_file_handle * l) +{ + struct BP_file_handle * n; + + while (l) + { + n = l->next; + + MPI_File_close (&l->fh); + free (l); + + l = n; + } +} + +int bp_close (BP_FILE * fh) +{ + struct BP_GROUP_VAR * gh = fh->gvar_h; + struct BP_GROUP_ATTR * ah = fh->gattr_h; + struct adios_index_var_struct_v1 * vars_root = fh->vars_root, *vr; + struct adios_index_attribute_struct_v1 * attrs_root = fh->attrs_root, *ar; + struct bp_index_pg_struct_v1 * pgs_root = fh->pgs_root, *pr; + int i,j; + MPI_File mpi_fh = fh->mpi_fh; + + adios_errno = 0; + if (fh->mpi_fh) + MPI_File_close (&mpi_fh); + + if (fh->sfh) + close_all_BP_files (fh->sfh); + + if (fh->b) { + adios_posix_close_internal (fh->b); + free(fh->b); + } + + /* Free variable structures */ + /* alloc in bp_utils.c: bp_parse_vars() */ + while (vars_root) { + vr = vars_root; + vars_root = vars_root->next; + for (j = 0; j < vr->characteristics_count; j++) { + // alloc in bp_utils.c:bp_parse_characteristics() <- bp_get_characteristics_data() + if (vr->characteristics[j].dims.dims) + free (vr->characteristics[j].dims.dims); + if (vr->characteristics[j].value) + free (vr->characteristics[j].value); + // NCSU - Clearing up statistics + if (vr->characteristics[j].stats) + { + uint8_t k = 0, idx = 0; + uint8_t i = 0, count = adios_get_stat_set_count(vr->type); + + while (vr->characteristics[j].bitmap >> k) + { + if ((vr->characteristics[j].bitmap >> k) & 1) + { + for (i = 0; i < count; i ++) + { + if (k == adios_statistic_hist) + { + struct adios_index_characteristics_hist_struct * hist = (struct adios_index_characteristics_hist_struct *) (vr->characteristics [j].stats[i][idx].data); + free (hist->breaks); + free (hist->frequencies); + free (hist); + } + else + free (vr->characteristics[j].stats [i][idx].data); + } + idx ++; + } + k ++; + } + + for (i = 0; i < count; i ++) + free (vr->characteristics[j].stats [i]); + + free (vr->characteristics[j].stats); + vr->characteristics[j].stats = 0; + } + } + if (vr->characteristics) + free (vr->characteristics); + if (vr->group_name) + free (vr->group_name); + if (vr->var_name) + free (vr->var_name); + if (vr->var_path) + free (vr->var_path); + free(vr); + } + + fh->vars_root = 0; + + if (fh->vars_table) + { + free (fh->vars_table); + fh->vars_table = 0; + } + + /* Free attributes structures */ + /* alloc in bp_utils.c bp_parse_attrs() */ + while (attrs_root) { + ar = attrs_root; + attrs_root = attrs_root->next; + for (j = 0; j < ar->characteristics_count; j++) { + if (ar->characteristics[j].value) + free (ar->characteristics[j].value); + } + if (ar->characteristics) + free (ar->characteristics); + if (ar->group_name) + free (ar->group_name); + if (ar->attr_name) + free (ar->attr_name); + if (ar->attr_path) + free (ar->attr_path); + free(ar); + } + + fh->attrs_root = 0; + + /* Free process group structures */ + /* alloc in bp_utils.c bp_parse_pgs() first loop */ + //printf ("pgs: %d\n", fh->mfooter.pgs_count); + while (pgs_root) { + pr = pgs_root; + pgs_root = pgs_root->next; + //printf("%d\tpg pid=%d addr=%x next=%x\n",i, pr->process_id, pr, pr->next); + if (pr->group_name) + free(pr->group_name); + if (pr->time_index_name) + free(pr->time_index_name); + free(pr); + } + + fh->pgs_root = 0; + + /* Free variable structures in BP_GROUP_VAR */ + if (gh) { + for (j=0;j<2;j++) { + for (i=0;igroup_count;i++) { + if (gh->time_index && gh->time_index[j] && gh->time_index[j][i]) + free(gh->time_index[j][i]); + } + if (gh->time_index && gh->time_index[j]) + free(gh->time_index[j]); + } + free (gh->time_index); + + for (i=0;igroup_count;i++) { + if (gh->namelist && gh->namelist[i]) + free(gh->namelist[i]); + } + if (gh->namelist) + free (gh->namelist); + + for (i=0;imfooter.vars_count;i++) { + if (gh->var_namelist && gh->var_namelist[i]) + free(gh->var_namelist[i]); + if (gh->var_offsets && gh->var_offsets[i]) + free(gh->var_offsets[i]); + } + if (gh->var_namelist) + free (gh->var_namelist); + + if (gh->var_offsets) + free(gh->var_offsets); + + if (gh->var_counts_per_group) + free(gh->var_counts_per_group); + + if (gh->pg_offsets) + free (gh->pg_offsets); + + free (gh); + } + + fh->gvar_h = 0; + + /* Free attribute structures in BP_GROUP_ATTR */ + if (ah) { + for (i = 0; i < fh->mfooter.attrs_count; i++) { + if (ah->attr_offsets && ah->attr_offsets[i]) + free(ah->attr_offsets[i]); + if (ah->attr_namelist && ah->attr_namelist[i]) + free(ah->attr_namelist[i]); + } + if (ah->attr_offsets) + free(ah->attr_offsets); + if (ah->attr_namelist) + free(ah->attr_namelist); + if (ah->attr_counts_per_group) + free(ah->attr_counts_per_group); + + free(ah); + } + + fh->gattr_h = 0; + + if (fh->fname) + { + free (fh->fname); + fh->fname = 0; + } + + if (fh) + free (fh); + + return 0; +} + +int bp_read_minifooter (BP_FILE * bp_struct) +{ + struct adios_bp_buffer_struct_v1 * b = bp_struct->b; + struct bp_minifooter * mh = &bp_struct->mfooter; + uint64_t attrs_end = b->file_size - MINIFOOTER_SIZE; + int r; + + MPI_Status status; + + if (!b->buff) { + bp_alloc_aligned (b, MINIFOOTER_SIZE); + if (!b->buff) { + adios_error (err_no_memory, "could not allocate %d bytes\n", MINIFOOTER_SIZE); + return 1; + } + memset (b->buff, 0, MINIFOOTER_SIZE); + b->offset = 0; + } + MPI_File_seek (bp_struct->mpi_fh, (MPI_Offset) attrs_end, MPI_SEEK_SET); + MPI_File_read (bp_struct->mpi_fh, b->buff, MINIFOOTER_SIZE, MPI_BYTE, &status); + + /*memset (&mh->pgs_index_offset, 0, MINIFOOTER_SIZE); + memcpy (&mh->pgs_index_offset, b->buff, MINIFOOTER_SIZE);*/ + + /* get version id. Needs the bp->offset be pointing to the last 4 bytes of the buffer, + It also sets b->change_endianness */ + /* Note that b is not sent over to processes, only the minifooter and then b->buff (the footer) */ + b->offset = MINIFOOTER_SIZE - 4; + adios_parse_version (b, &mh->version); + mh->change_endianness = b->change_endianness; + + // validity check + if ((mh->version & ADIOS_VERSION_NUM_MASK) > ADIOS_VERSION_BP_FORMAT) { + adios_error (err_file_open_error, + "Invalid BP file detected. Format version of file seems to be %d, " + "which is greater than the highest supported version %d.\n", + (mh->version & ADIOS_VERSION_NUM_MASK), ADIOS_VERSION_BP_FORMAT); + return 1; + } + + b->offset = 0; // reset offset to beginning + + BUFREAD64(b, b->pg_index_offset) + mh->pgs_index_offset = b->pg_index_offset; + // validity check + if (b->pg_index_offset > b->file_size) { + adios_error (err_file_open_error, + "Invalid BP file detected. PG index offset (%lld) > file size (%lld)\n", + b->pg_index_offset, b->file_size); + return 1; + } + + BUFREAD64(b, b->vars_index_offset) + mh->vars_index_offset = b->vars_index_offset; + // validity check + if (b->vars_index_offset > b->file_size) { + adios_error (err_file_open_error, + "Invalid BP file detected. Variable index offset (%lld) > file size (%lld)\n", + b->vars_index_offset, b->file_size); + return 1; + } + if (b->vars_index_offset < b->pg_index_offset) { + adios_error (err_file_open_error, + "Invalid BP file detected. Variable index offset (%lld) < PG index offset (%lld)\n", + b->vars_index_offset, b->pg_index_offset); + return 1; + } + + + BUFREAD64(b, b->attrs_index_offset) + mh->attrs_index_offset = b->attrs_index_offset; + // validity check + if (b->attrs_index_offset > b->file_size) { + adios_error (err_file_open_error, + "Invalid BP file detected. Attribute index offset (%lld) > file size (%lld)\n", + b->attrs_index_offset, b->file_size); + return 1; + } + if (b->attrs_index_offset < b->vars_index_offset) { + adios_error (err_file_open_error, + "Invalid BP file detected. Attribute index offset (%lld) < Variable index offset (%lld)\n", + b->attrs_index_offset, b->vars_index_offset); + return 1; + } + + b->end_of_pgs = b->pg_index_offset; + b->pg_size = b->vars_index_offset - b->pg_index_offset; + b->vars_size = b->attrs_index_offset - b->vars_index_offset; + b->attrs_size = attrs_end - b->attrs_index_offset; + + /* Read the whole footer */ + /* FIXME: including the last 28 bytes read already above and it seems that is not processed anymore */ + /* It will be sent to all processes */ + uint64_t footer_size = mh->file_size - mh->pgs_index_offset; + bp_realloc_aligned (b, footer_size); + MPI_File_seek (bp_struct->mpi_fh, + (MPI_Offset) mh->pgs_index_offset, + MPI_SEEK_SET); + MPI_File_read (bp_struct->mpi_fh, b->buff, footer_size, + MPI_BYTE, &status); + + MPI_Get_count (&status, MPI_BYTE, &r); + + // reset the pointer to the beginning of buffer + b->offset = 0; + return 0; +} + +/****************/ +/* Parse GROUPS */ +/****************/ +int bp_parse_pgs (BP_FILE * fh) +{ + struct bp_index_pg_struct_v1 ** root = &(fh->pgs_root); // need the pointer to it to malloc below + struct adios_bp_buffer_struct_v1 * b = fh->b; + struct bp_minifooter * mh = &(fh->mfooter); + uint64_t i; + + /* Note that at this point, many variables of b->* is unset (init'ed to 0). + It's the minifooter which holds accurate information. + b holds the footer data from the file */ + + b->offset = 0; + b->change_endianness = (enum ADIOS_FLAG) mh->change_endianness; + + BUFREAD64(b, mh->pgs_count) + BUFREAD64(b, mh->pgs_length) + + int j; + uint64_t group_count = 0; + char ** namelist; + char fortran_flag; + + namelist = (char **) malloc(sizeof(char *)*mh->pgs_count); + uint16_t * grpidlist = (uint16_t *) malloc(sizeof(uint16_t)*mh->pgs_count); + + uint32_t tidx_start, tidx_stop; /* Determine first and last timestep in file */ + + for (i = 0; i < mh->pgs_count; i++) { + uint16_t length_of_group; + namelist[i] = 0; + // validate remaining length + BUFREAD16(b, length_of_group) + + if (!*root) + { + *root = (struct bp_index_pg_struct_v1 *) + malloc (sizeof(struct bp_index_pg_struct_v1)); + memset (*root, 0, sizeof(struct bp_index_pg_struct_v1)); + (*root)->next = 0; + } + uint16_t length_of_name; + + BUFREAD16(b, length_of_name) + (*root)->group_name = (char *) malloc (length_of_name + 1); + (*root)->group_name [length_of_name] = '\0'; + memcpy ((*root)->group_name, b->buff + b->offset, length_of_name); + b->offset += length_of_name; + + + if ( group_count == 0 ) { + namelist[group_count] = (char *) malloc (length_of_name + 1); + strcpy (namelist[group_count], (*root)->group_name); + ++group_count; + grpidlist[i] = group_count-1; + } + else { + for (j=0; jgroup_name)) { + break; + } + } + if (j==group_count) { + namelist[group_count] = (char *) malloc (length_of_name + 1); + strcpy (namelist[group_count], (*root)->group_name); + ++group_count; + grpidlist[i] = group_count - 1; + } + else + grpidlist[i] = j; + + } + + BUFREAD8(b, fortran_flag) + (*root)->adios_host_language_fortran = + (fortran_flag == 'y' ? adios_flag_yes : adios_flag_no); + + BUFREAD32(b, (*root)->process_id) + + BUFREAD16(b, length_of_name) + (*root)->time_index_name = (char *) malloc (length_of_name + 1); + (*root)->time_index_name [length_of_name] = '\0'; + memcpy ((*root)->time_index_name, b->buff + b->offset, length_of_name); + b->offset += length_of_name; + + BUFREAD32(b, (*root)->time_index) + + BUFREAD64(b, (*root)->offset_in_file) + + if (i == 0) + tidx_start = (*root)->time_index; + if (i == mh->pgs_count-1) { + tidx_stop = (*root)->time_index; + mh->time_steps = tidx_stop - tidx_start + 1; + } + + root = &(*root)->next; + } + + /* + root = &(fh->pgs_root); + for (i = 0; i < mh->pgs_count; i++) { + printf("%d\tpg pid=%d addr=%x next=%x\n",i, (*root)->process_id, *root, (*root)->next); + root = &(*root)->next; + } + */ + + uint64_t * pg_offsets = 0; + uint32_t * pg_pids = 0; + uint32_t *** time_index = 0; + pg_offsets = (uint64_t *) + malloc (sizeof(uint64_t)*mh->pgs_count); + pg_pids = (uint32_t *) + malloc (sizeof(uint32_t)*mh->pgs_count); + // time_index[0]: record which pg to start from per timestep per group + // time_index[1]: record the # of pgs per timesteps per group + time_index = (uint32_t ***) malloc (sizeof(uint32_t **)*2); + + for (j=0;j<2;j++) { + time_index[j] = (uint32_t **) + malloc (sizeof(uint32_t*)*group_count); + //printf ("### time_index[%d]=%x group_count=%d #pgs=%d #ts=%d\n", j, time_index[j], group_count, mh->pgs_count, mh->time_steps); + for (i=0;ipgs_count < mh->time_steps) { + /* FIXME: when can this happen? + pgs = time_steps * number of writers, if there is 1 group only + */ + time_index[j][i] = (uint32_t *) + malloc (sizeof(uint32_t)*mh->pgs_count); + } else { + time_index[j][i] = (uint32_t *) + malloc (sizeof(uint32_t)*mh->time_steps); + } + } + } + + root = &(fh->pgs_root); + uint64_t grpid = grpidlist[0]; + uint32_t pg_time_count = 0, first_pg; + uint32_t time_id = tidx_start; + first_pg = 0; /* The first pg for a given timestep and group */ + for (i = 0; i < mh->pgs_count; i++) { + pg_pids [i] = (*root)->process_id; + pg_offsets [i] = (*root)->offset_in_file; + //printf ("### root->time_index=%d, time_id=%d\n", (*root)->time_index, time_id); + if ((*root)->time_index == time_id) { + /* processing still the same timestep */ + if (grpid == grpidlist[i]) { + /* processing still the same group */ + /* FIXME: is this the order in the file? time..groups or group..times? */ + pg_time_count += 1; + } else { + /* changing group: pg_time_count is for the current group the number of pgs of the same time */ + time_index [0][grpid][time_id-tidx_start] = first_pg; + time_index [1][grpid][time_id-tidx_start] = pg_time_count; + //printf ("#-- time_index[0][%d][%d]=%d\n", grpid, time_id-tidx_start, first_pg); + //printf ("# time_index[1][%d][%d]=%d\n", grpid, time_id-tidx_start, pg_time_count); + grpid = grpidlist [i]; + pg_time_count = 1; + first_pg = i; // new group starts from this pg + } + } + else { + /* change in timestep */ + if (group_count == 1) { + /* single group in file (the most frequent case) */ + time_index [0][grpid][time_id-tidx_start] = first_pg; + time_index [1][grpid][time_id-tidx_start] = pg_time_count; + //printf ("### time_index[0][%d][%d]=%d\n", grpid, time_id-tidx_start, first_pg); + //printf (" time_index[1][%d][%d]=%d\n", grpid, time_id-tidx_start, pg_time_count); + first_pg = i; + } + else { + if (grpid == grpidlist[i]) { + pg_time_count += 1; + } else { + time_index [0][grpid][time_id-tidx_start] = first_pg; + time_index [1][grpid][time_id-tidx_start] = pg_time_count; + //printf ("#.. time_index[0][%d][%d]=%d\n", grpid, time_id-tidx_start, first_pg); + //printf (" time_index[1][%d][%d]=%d\n", grpid, time_id-tidx_start, pg_time_count); + grpid = grpidlist [i]; + first_pg = i; + } + } + time_id = (*root)->time_index; + pg_time_count = 1; + } + root = &(*root)->next; + } + /* set last grp/time count to complete the above procedure */ + time_index [0][grpid][time_id-tidx_start] = first_pg; + time_index [1][grpid][time_id-tidx_start] = pg_time_count; + //printf ("# time_index[0][%d][%d]=%d\n", grpid, time_id-tidx_start, first_pg); + //printf (" time_index[1][%d][%d]=%d\n", grpid, time_id-tidx_start, pg_time_count); + + + /* Copy group_count strings from namelist and then free up namelist */ + char ** grp_namelist; + + grp_namelist = (char **) malloc (sizeof(char*) * group_count); + for (i=0;igvar_h = (struct BP_GROUP_VAR *) malloc (sizeof(struct BP_GROUP_VAR)); + fh->gvar_h->group_count = group_count; + fh->gvar_h->pg_offsets = pg_offsets; + fh->gvar_h->namelist = grp_namelist; + fh->gvar_h->time_index = time_index; + fh->gvar_h->group_id = 0; + fh->gvar_h->var_offsets = 0; + fh->gvar_h->var_namelist = 0; + fh->gvar_h->var_counts_per_group = 0; + + fh->gattr_h = (struct BP_GROUP_ATTR *) malloc (sizeof(struct BP_GROUP_ATTR)); + fh->gattr_h->group_count = group_count; + fh->gattr_h->namelist = grp_namelist; + fh->gattr_h->group_id = 0; + fh->gattr_h->attr_offsets = 0; + fh->gattr_h->attr_namelist = 0; + fh->gattr_h->attr_counts_per_group = 0; + + fh->tidx_start = tidx_start; + fh->tidx_stop= tidx_stop; + + free(grpidlist); + return 0; +} + + +/********************/ +/* Parse ATTRIBUTES */ +/********************/ +int bp_parse_attrs (BP_FILE * fh) +{ + struct adios_bp_buffer_struct_v1 * b = fh->b; + struct adios_index_attribute_struct_v1 ** attrs_root = &(fh->attrs_root); + struct bp_minifooter * mh = &(fh->mfooter); + struct adios_index_attribute_struct_v1 ** root; + int i; + int bpversion = mh->version & ADIOS_VERSION_NUM_MASK; + + if (b->length - b->offset < VARS_MINIHEADER_SIZE) { + adios_error (err_invalid_buffer, + "adios_parse_attrs_index_v1 requires a buffer " + "of at least %d bytes. Only %llu were provided\n", + VARS_MINIHEADER_SIZE, + b->length - b->offset); + + return 1; + } + + root = attrs_root; + + if (bpversion > 1) { + BUFREAD32(b, mh->attrs_count) + } else { + BUFREAD16(b, mh->attrs_count) + } + BUFREAD64(b, mh->attrs_length) + + for (i = 0; i < mh->attrs_count; i++) { + if (!*root) + { + *root = (struct adios_index_attribute_struct_v1 *) + malloc (sizeof (struct adios_index_attribute_struct_v1)); + (*root)->next = 0; + } + uint8_t flag; + uint32_t attr_entry_length; + uint16_t len; + uint64_t characteristics_sets_count; + int type_size; + + BUFREAD32(b, attr_entry_length) + if (bpversion > 1) { + BUFREAD32(b, (*root)->id) + } else { + BUFREAD16(b, (*root)->id) + } + + BUFREAD16(b, len) + (*root)->group_name = (char *) malloc (len + 1); + (*root)->group_name [len] = '\0'; + strncpy ((*root)->group_name, b->buff + b->offset, len); + b->offset += len; + + BUFREAD16(b, len) + (*root)->attr_name = (char *) malloc (len + 1); + (*root)->attr_name [len] = '\0'; + strncpy ((*root)->attr_name, b->buff + b->offset, len); + b->offset += len; + + BUFREAD16(b, len) + (*root)->attr_path = (char *) malloc (len + 1); + (*root)->attr_path [len] = '\0'; + strncpy ((*root)->attr_path, b->buff + b->offset, len); + b->offset += len; + + BUFREAD8(b, flag) + (*root)->type = (enum ADIOS_DATATYPES) flag; + + type_size = bp_get_type_size ((*root)->type, ""); + + if (type_size == -1) + { + //type_size = 4; + (*root)->type = adios_unknown; + } + + + BUFREAD64(b, characteristics_sets_count) + (*root)->characteristics_count = characteristics_sets_count; + (*root)->characteristics_allocated = characteristics_sets_count; + + // validate remaining length: offsets_count * (8 + 2 * (size of type)) + uint64_t j; + (*root)->characteristics = malloc (characteristics_sets_count + * sizeof (struct adios_index_characteristic_struct_v1) + ); + memset ((*root)->characteristics, 0 + , characteristics_sets_count + * sizeof (struct adios_index_characteristic_struct_v1) + ); + + for (j = 0; j < characteristics_sets_count; j++) + { + uint8_t characteristic_set_count; + uint32_t characteristic_set_length; + uint8_t item = 0; + + BUFREAD8(b, characteristic_set_count) + BUFREAD32(b, characteristic_set_length) + + while (item < characteristic_set_count) + { + uint8_t flag; + enum ADIOS_CHARACTERISTICS c; + + BUFREAD8(b, flag) + c = (enum ADIOS_CHARACTERISTICS) flag; + + switch (c) + { + case adios_characteristic_value: + (*root)->characteristics [j].value = bp_read_data_from_buffer(b, (*root)->type); + break; + + case adios_characteristic_offset: + BUFREAD64(b, (*root)->characteristics [j].offset) + break; + + case adios_characteristic_payload_offset: + BUFREAD64(b, (*root)->characteristics [j].payload_offset) + break; + + case adios_characteristic_file_index: + BUFREAD32(b, (*root)->characteristics [j].file_index); + break; + + case adios_characteristic_time_index: + BUFREAD32(b, (*root)->characteristics [j].time_index) + break; + case adios_characteristic_var_id: + if (bpversion > 1) { + BUFREAD32(b, (*root)->characteristics [j].var_id) + } else { + BUFREAD16(b, (*root)->characteristics [j].var_id) + } + break; + default: + break; + } + item++; + } + /* Old BP files do not have time_index characteristics, so we + set it here automatically: j div # of pgs per timestep + Assumed that in old BP files, all pgs write each variable in each timestep.*/ + if ((*root)->characteristics [j].time_index == 0) { + (*root)->characteristics [j].time_index = + j / (mh->pgs_count / (fh->tidx_stop - fh->tidx_start + 1)) + 1; + /*printf("OldBP: attr %s time_index set to %d\n", + (*root)->attr_name, + (*root)->characteristics [j].time_index);*/ + } + } + + root = &(*root)->next; + } + + root = attrs_root; + uint32_t * attr_counts_per_group; + uint16_t * attr_gids; + uint64_t ** attr_offsets; + char ** attr_namelist; + int grpid, j; + //int cnt; + int lenpath, lenname; + + attr_counts_per_group = (uint32_t *) + malloc (sizeof(uint32_t) * fh->gattr_h->group_count); + memset (attr_counts_per_group, 0, fh->gattr_h->group_count * sizeof(uint32_t)); + attr_gids = (uint16_t *) malloc (sizeof(uint16_t ) * mh->attrs_count); + attr_namelist = (char **)malloc (sizeof(char*) * mh->attrs_count); + + attr_offsets = (uint64_t **) malloc (sizeof(uint64_t *) * mh->attrs_count); + memset (attr_offsets, 0, mh->attrs_count * sizeof(uint64_t *)); + + for (i = 0; i < mh->attrs_count; i++) { + for (grpid = 0; grpid < fh->gattr_h->group_count; grpid++) { + if (!strcmp((*root)->group_name, fh->gattr_h->namelist[grpid])) { + attr_counts_per_group [grpid]++; + attr_gids [i] = grpid; + break; + } + } + // Full name of attributes: concatenate attr_path and attr_name + /* + // Until 1.5 version: Always have / in the beginning of the full name + if (strcmp ((*root)->attr_path,"/")) { + attr_namelist [i] = (char *) malloc ( strlen((*root)->attr_name) + +strlen((*root)->attr_path) + 1 + 1 + ); + strcpy(attr_namelist[i], (*root)->attr_path); + } + else { + attr_namelist [i] = (char *) malloc ( strlen((*root)->attr_name)+1+1); + attr_namelist[i][0] = '\0'; + } + strcat(attr_namelist[i], "/"); + strcat(attr_namelist[i], (*root)->attr_name); + */ + + // From 1.6, leading / is not required anymore + lenpath = strlen((*root)->attr_path); + lenname = strlen((*root)->attr_name); + if (lenpath > 0) { + attr_namelist [i] = (char *) malloc (lenname + lenpath + 1 + 1); + // extra / and ending \0 + strcpy(attr_namelist[i], (*root)->attr_path); + if ((*root)->attr_path[lenpath-1] != '/') { + attr_namelist[i][lenpath] = '/'; + lenpath++; + } + strcpy(&attr_namelist[i][lenpath], (*root)->attr_name); + } + else { + attr_namelist [i] = (char *) malloc (lenname+1); + strcpy(attr_namelist[i], (*root)->attr_name); + } + //printf ("Attribute %d full path is [%s]\n", i, attr_namelist[i]); + + attr_offsets[i] = (uint64_t *) malloc ( + sizeof(uint64_t)*(*root)->characteristics_count); + for (j=0;j < (*root)->characteristics_count;j++) { + attr_offsets[i][j] = (*root)->characteristics [j].offset; + } + + //struct adios_index_characteristic_dims_struct_v1 * pdims; + //pdims = &(*root)->characteristics [0].dims; + //cnt = pdims->count; + root = &(*root)->next; + } + //here is the asssumption that attr_gids is linearly increased + free(attr_gids); + + fh->gattr_h->attr_namelist = attr_namelist; + fh->gattr_h->attr_counts_per_group = attr_counts_per_group; + fh->gattr_h->attr_offsets = attr_offsets; + + return 0; +} + +/*******************/ +/* Parse VARIABLES */ +/*******************/ +int bp_parse_vars (BP_FILE * fh) +{ + struct adios_bp_buffer_struct_v1 * b = fh->b; + struct adios_index_var_struct_v1 ** vars_root = &(fh->vars_root); + struct bp_minifooter * mh = &(fh->mfooter); + + struct adios_index_var_struct_v1 ** root; + int bpversion = mh->version & ADIOS_VERSION_NUM_MASK; + + if (b->length - b->offset < VARS_MINIHEADER_SIZE) { + adios_error (err_invalid_buffer, + "bp_parse_vars requires a buffer " + "of at least %d bytes. Only %llu were provided\n", + VARS_MINIHEADER_SIZE, + b->length - b->offset); + + return 1; + } + + root = vars_root; + + if (bpversion > 1) { + BUFREAD32(b, mh->vars_count) + } else { + BUFREAD16(b, mh->vars_count) + } + BUFREAD64(b, mh->vars_length) + + // To speed find_var_byid(). Q. Liu, 11-2013. + fh->vars_table = (struct adios_index_var_struct_v1 **) malloc (8*(size_t)mh->vars_count); + // validate remaining length + int i; + for (i = 0; i < mh->vars_count; i++) { + if (!*root) { + *root = (struct adios_index_var_struct_v1 *) + malloc (sizeof (struct adios_index_var_struct_v1)); + (*root)->next = 0; + fh->vars_table[i] = *root; + } + uint8_t flag; + uint32_t var_entry_length; + uint16_t len; + uint64_t characteristics_sets_count; + + BUFREAD32(b, var_entry_length) + if (bpversion > 1) { + BUFREAD32(b, (*root)->id) + } else { + BUFREAD16(b, (*root)->id) + } + + BUFREAD16(b, len) + (*root)->group_name = (char *) malloc (len + 1); + (*root)->group_name [len] = '\0'; + strncpy ((*root)->group_name, b->buff + b->offset, len); + b->offset += len; + + BUFREAD16(b, len) + (*root)->var_name = (char *) malloc (len + 1); + (*root)->var_name [len] = '\0'; + strncpy ((*root)->var_name, b->buff + b->offset, len); + b->offset += len; + + BUFREAD16(b, len) + (*root)->var_path = (char *) malloc (len + 1); + (*root)->var_path [len] = '\0'; + strncpy ((*root)->var_path, b->buff + b->offset, len); + b->offset += len; + + BUFREAD8(b, flag) + (*root)->type = (enum ADIOS_DATATYPES) flag; + + BUFREAD64(b, characteristics_sets_count) + (*root)->characteristics_count = characteristics_sets_count; + (*root)->characteristics_allocated = characteristics_sets_count; + + // validate remaining length: offsets_count * + // (8 + 2 * (size of type)) + (*root)->characteristics = malloc (characteristics_sets_count + * sizeof (struct adios_index_characteristic_struct_v1) + ); + memset ((*root)->characteristics, 0 + , characteristics_sets_count + * sizeof (struct adios_index_characteristic_struct_v1) + ); + // NOTE: Above memset assumes that all 0's is a valid initialization. + // This is true, currently, but be careful in the future. + + uint64_t j; + for (j = 0; j < characteristics_sets_count; j++) + { + uint8_t characteristic_set_count; + uint32_t characteristic_set_length; + uint8_t item = 0; + + BUFREAD8(b, characteristic_set_count) + BUFREAD32(b, characteristic_set_length) + + while (item < characteristic_set_count) { + bp_parse_characteristics (b, root, j); + item++; + } + + /* Old BP files do not have time_index characteristics, so we + set it here automatically: j div # of pgs per timestep + Assumed that in old BP files, all pgs write each variable in each timestep.*/ + if ((*root)->characteristics [j].time_index == 0) { + (*root)->characteristics [j].time_index = + j / (mh->pgs_count / (fh->tidx_stop - fh->tidx_start + 1)) + 1; + /*printf("OldBP: var %s time_index set to %d\n", + (*root)->var_name, + (*root)->characteristics [j].time_index);*/ + } + } + root = &(*root)->next; + } + + root = vars_root; + uint32_t * var_counts_per_group; + uint16_t * var_gids; + uint64_t ** var_offsets; + char ** var_namelist; + int grpid, j; + //int cnt; + int lenpath,lenname; + + var_counts_per_group = (uint32_t *) + malloc (sizeof(uint32_t)*fh->gvar_h->group_count); + memset ( var_counts_per_group, 0, fh->gvar_h->group_count*sizeof(uint32_t)); + var_gids = (uint16_t *) malloc (sizeof(uint16_t )*mh->vars_count); + var_namelist = (char **)malloc(sizeof(char*)*mh->vars_count); + + var_offsets = (uint64_t **) malloc (sizeof(uint64_t *)*mh->vars_count); + memset ( var_offsets, 0, mh->vars_count*sizeof(uint64_t *)); + + for (i = 0; i < mh->vars_count; i++) { + for (grpid=0;grpidgvar_h->group_count;grpid++) { + if (!strcmp((*root)->group_name,fh->gvar_h->namelist[grpid])) { + var_counts_per_group [grpid]++; + var_gids [i] = grpid; + break; + } + } + /* up until 1.5, name and /name was handled identical */ + /* + // Full name of variable: concatenate var_path and var_name + // Always have / in the beginning of the full name + if (strcmp ((*root)->var_path,"/")) { + var_namelist [i] = (char *) malloc ( strlen((*root)->var_name) + +strlen((*root)->var_path) + 1 + 1 // extra / and ending \0 + ); + strcpy(var_namelist[i], (*root)->var_path); + } + else { + var_namelist [i] = (char *) malloc ( strlen((*root)->var_name)+1+1); + var_namelist[i][0] = '\0'; + } + strcat(var_namelist[i], "/"); + strcat(var_namelist[i], (*root)->var_name); + */ + + /* From 1.6, relative and full path (starts with /) are handled separately in search */ + // Full name of variable: concatenate var_path and var_name + lenpath = strlen((*root)->var_path); + lenname = strlen((*root)->var_name); + if (lenpath > 0) { + var_namelist [i] = (char *) malloc (lenname + lenpath + 1 + 1); + // extra / and ending \0 + strcpy(var_namelist[i], (*root)->var_path); + if ((*root)->var_path[lenpath-1] != '/') { // if path is not ending with / + var_namelist[i][lenpath] = '/'; // add the extra / + lenpath++; + } + strcpy(&var_namelist[i][lenpath], (*root)->var_name); + } + else { + var_namelist [i] = (char *) malloc (lenname+1); + strcpy(var_namelist[i], (*root)->var_name); + } + //printf ("Variable %d full path is [%s]\n", i, var_namelist[i]); + + var_offsets[i] = (uint64_t *) malloc ( + sizeof(uint64_t)*(*root)->characteristics_count); + for (j=0;j < (*root)->characteristics_count;j++) { + var_offsets[i][j] = (*root)->characteristics [j].offset; + } + + //struct adios_index_characteristic_dims_struct_v1 * pdims; + //pdims = &(*root)->characteristics [0].dims; + //cnt = pdims->count; + root = &(*root)->next; + } + + //here is the asssumption that var_gids is linearly increased + free( var_gids); + fh->gvar_h->var_namelist = var_namelist; + fh->gvar_h->var_counts_per_group=var_counts_per_group; + fh->gvar_h->var_offsets = var_offsets; + return 0; +} + +int bp_parse_characteristics (struct adios_bp_buffer_struct_v1 * b, + struct adios_index_var_struct_v1 ** root, + uint64_t j) +{ + uint8_t flag; + float fr, fi; + double dr, di; + enum ADIOS_CHARACTERISTICS c; + + BUFREAD8(b, flag) + c = (enum ADIOS_CHARACTERISTICS) flag; + enum ADIOS_DATATYPES original_var_type = adios_transform_get_var_original_type_index (*root); + + switch (c) { + + case adios_characteristic_value: + { + uint8_t i, c, idx; + // uint8_t count = adios_get_stat_set_count ((*root)->type); + uint8_t count = adios_get_stat_set_count (original_var_type); + uint16_t characteristic_size; + + (*root)->characteristics [j].value = bp_read_data_from_buffer(b, original_var_type); + if (!((*root)->characteristics [j].stats)) + { + (*root)->characteristics [j].stats = malloc (count*sizeof(struct adios_index_characteristics_stat_struct *)); + (*root)->characteristics [j].bitmap = 0; + } + + (*root)->characteristics [j].bitmap |= (1 << adios_statistic_min); + (*root)->characteristics [j].bitmap |= (1 << adios_statistic_max); + (*root)->characteristics [j].bitmap |= (1 << adios_statistic_cnt); + (*root)->characteristics [j].bitmap |= (1 << adios_statistic_sum); + (*root)->characteristics [j].bitmap |= (1 << adios_statistic_sum_square); + + for (c = 0; c < count; c ++) + { + i = idx = 0; + (*root)->characteristics [j].stats[c] = + malloc (ADIOS_STAT_LENGTH * sizeof(struct adios_index_characteristics_stat_struct)); + + while ((*root)->characteristics [j].bitmap >> i) + { + (*root)->characteristics [j].stats[c][i].data = 0; + if (((*root)->characteristics[j].bitmap >> i) & 1) + { + characteristic_size = adios_get_stat_size( + (*root)->characteristics [j].stats[c][idx].data + ,original_var_type + ,(enum ADIOS_STAT)i + ); + (*root)->characteristics [j].stats[c][idx].data = malloc (characteristic_size); + void * data = (*root)->characteristics [j].stats[c][idx].data; + if (idx == adios_statistic_cnt) + { + * (uint32_t *) data = 1; + } +#define IS_MIN_MAX \ +if (idx == adios_statistic_min \ + || idx == adios_statistic_max) + +#define IS_SUM \ +if (idx == adios_statistic_sum) + +#define IS_SUM2 \ +if (idx == adios_statistic_sum_square) + +#define SET_DATA_1(t) \ +* (t *) data = *(t *) (*root)->characteristics [j].value; + +#define SET_DATA_2(t) \ +* (double *) data = *(t *) (*root)->characteristics [j].value; + +#define SET_DATA_3(t) \ +* (double *) data = *(t *) (*root)->characteristics [j].value * (* (t *)(*root)->characteristics [j].value); + +#define SET_DATA(t) \ +IS_MIN_MAX \ +{ \ +SET_DATA_1(t) \ +} \ +else IS_SUM \ +{ \ +SET_DATA_2(t) \ +} \ +else IS_SUM2 \ +{ \ +SET_DATA_3(t) \ +} + // switch ((*root)->type) + switch (original_var_type) + { + case adios_byte: + SET_DATA(int8_t) + break; + case adios_short: + SET_DATA(int16_t) + break; + case adios_integer: + SET_DATA(int32_t) + break; + case adios_long: + SET_DATA(int64_t) + break; + case adios_unsigned_byte: + SET_DATA(uint8_t) + break; + case adios_unsigned_short: + SET_DATA(uint16_t) + break; + case adios_unsigned_integer: + SET_DATA(uint32_t) + break; + case adios_unsigned_long: + SET_DATA(uint64_t) + break; + case adios_real: + SET_DATA(float) + break; + case adios_double: + SET_DATA(double) + break; + case adios_long_double: + // I don't think long double is currently supported for stats. + break; + case adios_complex: + fr = * (float *) (*root)->characteristics [j].value; + fi = * ((float *) (*root)->characteristics [j].value + 1); + + if (idx == adios_statistic_min || idx == adios_statistic_max) + { + if (c == 0) + { + * (float *) data = fr; + } + else if (c == 1) + { + * (float *) data = fi; + } + else if (c == 2) + { + * (float *) data = sqrt (fr * fr + fi * fi); + } + } + else if (idx == adios_statistic_sum) + { + if (c == 0) + { + * (double *) data = fr; + } + else if (c == 1) + { + * (double *) data = fi; + } + else if (c == 2) + { + * (double *) data = sqrt (fr * fr + fi * fi); + } + } + else if (idx == adios_statistic_sum_square) + { + if (c == 0) + { + * (double *) data = fr * fr; + } + else if (c == 1) + { + * (double *) data = fi * fi; + } + else if (c == 2) + { + * (double *) data = fr * fr + fi * fi; + } + } + break; + case adios_double_complex: + dr = * (double *) (*root)->characteristics [j].value; + di = * ((double *) (*root)->characteristics [j].value + 1); + + if (idx == adios_statistic_min + || idx == adios_statistic_max + || idx == adios_statistic_sum + ) + { + if (c == 0) + { + * (double *) data = dr; + } + else if (c == 1) + { + * (double *) data = di; + } + else if (c == 2) + { + * (double *) data = sqrt (dr * dr + di * di); + } + } + else if (idx == adios_statistic_sum_square) + { + if (c == 0) + { + * (double *) data = dr * dr; + } + else if (c == 1) + { + * (double *) data = di * di; + } + else if (c == 2) + { + * (double *) data = dr * dr + di * di; + } + } + + break; + + case adios_string: + default: + break; + + } + idx ++; + } + i ++; + } + } + + break; + } + + // NCSU - Adding in backward compatibility + case adios_characteristic_max: + { + if (!((*root)->characteristics [j].stats)) + { + (*root)->characteristics [j].stats = malloc (sizeof(struct adios_index_characteristics_stat_struct *)); + (*root)->characteristics [j].stats[0] = malloc (2 * sizeof(struct adios_index_characteristics_stat_struct)); + (*root)->characteristics [j].bitmap = 0; + } + + (*root)->characteristics [j].bitmap |= (1 << adios_statistic_max); + // (*root)->characteristics [j].stats[0][adios_statistic_max].data = bp_read_data_from_buffer(b, (*root)->type); + (*root)->characteristics [j].stats[0][adios_statistic_max].data = bp_read_data_from_buffer(b, original_var_type); + break; + } + + // NCSU - Adding in backward compatibility + case adios_characteristic_min: + { + if (!((*root)->characteristics [j].stats)) + { + (*root)->characteristics [j].stats = malloc (sizeof(struct adios_index_characteristics_stat_struct *)); + (*root)->characteristics [j].stats[0] = malloc (2 * sizeof(struct adios_index_characteristics_stat_struct)); + (*root)->characteristics [j].bitmap = 0; + } + (*root)->characteristics [j].bitmap |= (1 << adios_statistic_min); + // (*root)->characteristics [j].stats[0][adios_statistic_min].data = bp_read_data_from_buffer(b, (*root)->type); + (*root)->characteristics [j].stats[0][adios_statistic_min].data = bp_read_data_from_buffer(b, original_var_type); + break; + } + + // NCSU - Parse the statistical information based in the bitmap + case adios_characteristic_stat: + { + uint8_t i, c, idx; + uint8_t count = adios_get_stat_set_count (original_var_type); + uint16_t characteristic_size; + + (*root)->characteristics [j].stats = malloc (count * sizeof(struct adios_index_characteristics_stat_struct *)); + + for (c = 0; c < count; c ++) + { + i = idx = 0; + (*root)->characteristics [j].stats[c] = malloc (ADIOS_STAT_LENGTH * sizeof(struct adios_index_characteristics_stat_struct)); + + while ((*root)->characteristics[j].bitmap >> i) + { + (*root)->characteristics [j].stats[c][i].data = 0; + if (((*root)->characteristics[j].bitmap >> i) & 1) + { + if (i == adios_statistic_hist) + { + uint32_t bi; + + (*root)->characteristics [j].stats[c][idx].data = malloc (sizeof(struct adios_index_characteristics_hist_struct)); + struct adios_index_characteristics_hist_struct * hist = (*root)->characteristics [j].stats[c][idx].data; + + BUFREAD32(b, hist->num_breaks) + hist->min = * (double *) bp_read_data_from_buffer(b, adios_double); + hist->max = * (double *) bp_read_data_from_buffer(b, adios_double); + + hist->frequencies = malloc((hist->num_breaks + 1) * adios_get_type_size(adios_unsigned_integer, "")); + for (bi = 0; bi <= hist->num_breaks; bi ++) + { + BUFREAD32(b, hist->frequencies[bi]) + } + + hist->breaks = malloc(hist->num_breaks * adios_get_type_size(adios_double, "")); + for (bi = 0; bi < hist->num_breaks; bi ++) + { + hist->breaks[bi] = * (double *) bp_read_data_from_buffer(b, adios_double); + } + } + else + { + characteristic_size = adios_get_stat_size( + (*root)->characteristics [j].stats[c][idx].data + ,original_var_type + ,(enum ADIOS_STAT)i + ); + (*root)->characteristics [j].stats[c][idx].data = malloc (characteristic_size); + + void * data = (*root)->characteristics [j].stats[c][idx].data; + memcpy (data, (b->buff + b->offset), characteristic_size); + b->offset += characteristic_size; + + if(b->change_endianness == adios_flag_yes) + swap_ptr(data, characteristic_size * 8); + } + idx ++; + } + i ++; + } + } + break; + } + + // NCSU - Statistics. Read the bitmap + case adios_characteristic_bitmap: + BUFREAD32(b, (*root)->characteristics [j].bitmap); + break; + + // NCSU ALACRITY-ADIOS - Read transform type field + case adios_characteristic_transform_type: + adios_transform_deserialize_transform_characteristic(&(*root)->characteristics[j].transform, b); + //BUFREAD8(b, (*root)->characteristics [j].transform_type); + break; + + case adios_characteristic_offset: + BUFREAD64(b, (*root)->characteristics [j].offset) + break; + + case adios_characteristic_payload_offset: + BUFREAD64(b, (*root)->characteristics [j].payload_offset) + break; + + case adios_characteristic_file_index: + BUFREAD32(b, (*root)->characteristics [j].file_index) + break; + + case adios_characteristic_time_index: + BUFREAD32(b, (*root)->characteristics [j].time_index) + break; + + case adios_characteristic_dimensions: + { + uint16_t dims_length, di, dims_num; + BUFREAD8(b, (*root)->characteristics [j].dims.count) + BUFREAD16(b, dims_length); + + (*root)->characteristics [j].dims.dims = (uint64_t *) malloc (dims_length); + + dims_num = dims_length / 8; + for (di = 0; di < dims_num; di ++) { + BUFREAD64(b, ((*root)->characteristics [j].dims.dims)[di]); + } + break; + } + + default: + log_warn ("Unknown characteristic: %d. skipped.\n", c); + break; + } + return 0; +} + +// Search for the start var index. +int64_t get_var_start_index (struct adios_index_var_struct_v1 * v, int t) +{ + int64_t i = 0; + + while (i < v->characteristics_count) { + if (v->characteristics[i].time_index == t) { + return i; + } + + i++; + } + + return -1; +} + +// Search for the stop var index +int64_t get_var_stop_index (struct adios_index_var_struct_v1 * v, int t) +{ + int64_t i = v->characteristics_count - 1; + + while (i > -1) { + if (v->characteristics[i].time_index == t) { + return i; + } + + i--; + } + + return -1; +} + +/* Seek to the specified step and prepare a few fields + * in ADIOS_FILE structure, i.e., nvars, var_namelist, + * nattrs, attr_namelist. This routine also sets the + * current_step in ADIOS_FILE. + * Note: in file mode, tostep should be given -1. + */ +int bp_seek_to_step (ADIOS_FILE * fp, int tostep, int show_hidden_attrs) +{ + BP_PROC * p = GET_BP_PROC (fp); + BP_FILE * fh = GET_BP_FILE (fp); + int j, k, t, allstep; + struct adios_index_var_struct_v1 * var_root = fh->vars_root; + struct adios_index_attribute_struct_v1 * attr_root; + uint64_t i; + int lenpath, lenname; + + /* Streaming starts with step 0. However, time index in BP file + * starts with 1. If 'tostep' is -1, that means we want to get all steps. + * If not, we seek to the specified step. + */ + if (tostep == -1) + { + allstep = 1; + } + else + { + allstep = 0; + t = get_time (var_root, tostep); + } + + /* Prepare vars */ + fp->nvars = 0; +// var_root = fh->vars_root; + + while (var_root) + { + for (i = 0; i < var_root->characteristics_count; i++) + { + if (allstep || (!allstep && var_root->characteristics[i].time_index == t)) + { + fp->nvars++; + break; + } + } + + var_root = var_root->next; + } + + fp->var_namelist = (char **) malloc (sizeof (char *) * fp->nvars); + p->varid_mapping = (int *) malloc (fp->nvars * 4); + assert (p->varid_mapping); + + var_root = fh->vars_root; + j = 0; + k = 0; + while (var_root) + { + for (i = 0; i < var_root->characteristics_count; i++) + { + if (allstep || (!allstep && var_root->characteristics[i].time_index == t)) + { + /* Up to 1.5, we always put a / to the beginning */ + /* + if (strcmp (var_root->var_path,"/")) + { + fp->var_namelist[j] = (char *)malloc (strlen((var_root)->var_name) + + strlen (var_root->var_path) + 1 + 1 // extra / and ending \0 + ); + strcpy (fp->var_namelist[j], var_root->var_path); + } + else + { + fp->var_namelist[j] = (char *) malloc (strlen (var_root->var_name) + 1 + 1); + fp->var_namelist[j][0] = '\0'; + } + + strcat (fp->var_namelist[j], "/"); + strcat (fp->var_namelist[j], var_root->var_name); + */ + + /* From 1.6, relative and full path (starts with /) are handled separately in search */ + // Full name of variable: concatenate var_path and var_name + lenpath = strlen(var_root->var_path); + lenname = strlen(var_root->var_name); + if (lenpath > 0) { + fp->var_namelist [j] = (char *) malloc (lenname + lenpath + 1 + 1); + // extra / and ending \0 + strcpy(fp->var_namelist[j], var_root->var_path); + if (var_root->var_path[lenpath-1] != '/') { + fp->var_namelist[j][lenpath] = '/'; + lenpath++; + } + strcpy(&(fp->var_namelist[j][lenpath]), var_root->var_name); + } + else { + fp->var_namelist[j] = (char *) malloc (lenname+1); + strcpy(fp->var_namelist[j], var_root->var_name); + } + //printf ("Seek to step: Variable %d full path is [%s]\n", j, fp->var_namelist[j]); + + + p->varid_mapping[j] = k; + + j++; + + break; + } + } + + k++; + var_root = var_root->next; + } + + /* Prepare attrs */ + fp->nattrs = 0; + attr_root = fh->attrs_root; + + while (attr_root) + { + if (!show_hidden_attrs && strstr (attr_root->attr_path, "__adios__")) + { + } + else + { + for (i = 0; i < attr_root->characteristics_count; i++) + { + if (allstep || (!allstep && attr_root->characteristics[i].time_index == t)) + { + fp->nattrs++; + break; + } + } + } + + attr_root = attr_root->next; + } + + fp->attr_namelist = (char **) malloc (sizeof (char *) * fp->nattrs); + + attr_root = fh->attrs_root; + j = 0; + while (attr_root) + { + if (!show_hidden_attrs && strstr (attr_root->attr_path, "__adios__")) + { + } + else + { + for (i = 0; i < attr_root->characteristics_count; i++) + { + if (allstep || (!allstep && attr_root->characteristics[i].time_index == t)) + { + /* Up to 1.5, we always put a / to the beginning */ + /* + if (strcmp (attr_root->attr_path,"/")) + { + fp->attr_namelist[j] = (char *)malloc (strlen((attr_root)->attr_name) + + strlen (attr_root->attr_path) + 1 + 1 // extra / and ending \0 + ); + strcpy (fp->attr_namelist[j], attr_root->attr_path); + } + else + { + fp->attr_namelist[j] = (char *) malloc (strlen (attr_root->attr_name) + 1 + 1); + fp->attr_namelist[j][0] = '\0'; + } + + strcat (fp->attr_namelist[j], "/"); + strcat (fp->attr_namelist[j], attr_root->attr_name); + */ + // Full name of attribute: concatenate attr_path and attr_name + lenpath = strlen(attr_root->attr_path); + lenname = strlen(attr_root->attr_name); + if (lenpath > 0) { + fp->attr_namelist [j] = (char *) malloc (lenname + lenpath + 1 + 1); + // extra / and ending \0 + strcpy(fp->attr_namelist[j], attr_root->attr_path); + if (attr_root->attr_path[lenpath-1] != '/') { + fp->attr_namelist[j][lenpath] = '/'; + lenpath++; + } + strcpy(&(fp->attr_namelist[j][lenpath]), attr_root->attr_name); + } + else { + fp->attr_namelist[j] = (char *) malloc (lenname+1); + strcpy(fp->attr_namelist[j], attr_root->attr_name); + } + //printf ("Seek to step: Attribute %d full path is [%s], path=[%s], name=[%s]\n", + // j, fp->attr_namelist[j], attr_root->attr_path, attr_root->attr_name); + j++; + + break; + } + } + } + + attr_root = attr_root->next; + } + + fp->current_step = tostep; + + return 0; +} + +// NCSU ALACRITY-ADIOS - Added a generic dimension-getter function +/* get local and global dimensions and offsets from a variable characteristics + return: 1 = it is a global array, 0 = local array +*/ +int bp_get_dimension_generic(const struct adios_index_characteristic_dims_struct_v1 *dims, + uint64_t *ldims, uint64_t *gdims, uint64_t *offsets) +{ + int is_global = 0; // global array or just an array written by one process? + int k; + + int ndim = dims->count; + + for (k = 0; k < ndim; k++) + { + ldims[k] = dims->dims[k * 3]; + gdims[k] = dims->dims[k * 3 + 1]; + offsets[k] = dims->dims[k * 3 + 2]; + is_global = is_global || gdims[k]; + } + + return is_global; +} + +// LAYERFIX +// NCSU ALACRITY-ADIOS - Made to delegate to above function, passing a +// different dimension struct depending on the transform type +/* get local and global dimensions and offsets from a variable characteristics + return: 1 = it is a global array, 0 = local array +*/ +int bp_get_dimension_characteristics(struct adios_index_characteristic_struct_v1 *ch, + uint64_t *ldims, uint64_t *gdims, uint64_t *offsets) +{ + // NCSU ALACRITY-ADIOS - If the variable is transformed, use the pre-transform dimensions instead + //int is_transformed = (ch->transform.transform_type != adios_transform_none); + //const struct adios_index_characteristic_dims_struct_v1 *dims = + // is_transformed ? &ch->transform.pre_transform_dimensions : &ch->dims; + + return bp_get_dimension_generic(&ch->dims, ldims, gdims, offsets); // dims +} + +// NCSU ALACRITY-ADIOS - Added a generic dimension-getter function +/* As opposed to bp_get_dimension_characteristics, this routine returns + ldims/gdims/offsets with 'time' extracted. */ +int bp_get_dimension_generic_notime (const struct adios_index_characteristic_dims_struct_v1 *dims, + uint64_t *ldims, uint64_t *gdims, uint64_t *offsets, + int file_is_fortran) +{ + int is_global = 0, dummy = 0, has_time = 0; + int k; + + is_global = bp_get_dimension_generic(dims, ldims, gdims, offsets); + int ndim = dims->count; + /* + for (k = 0; k < ndim; k++) + { + ldims[k] = ch->dims.dims[k * 3]; + gdims[k] = ch->dims.dims[k * 3 + 1]; + offsets[k] = ch->dims.dims[k * 3 + 2]; + is_global = is_global || gdims[k]; + }*/ + + if(ndim > 0) + { + has_time = gdims[ndim - 1] == 0 && + ldims[file_is_fortran ? ndim - 1 : 0] == 1; + } + + // change all the stuff to C ordering + if (file_is_fortran) + { + swap_order (ndim, gdims, &dummy); + swap_order (ndim, ldims, &dummy); + swap_order (ndim, offsets, &dummy); + } + + if (!is_global) + { + /* local array */ + if (!has_time) + { + for (k =0; k < ndim; k++) + { + gdims[k] = ldims[k]; + } + } + else + { + for (k = 0; k < ndim - 1; k++) + { + gdims[k] = ldims[k + 1]; + ldims[k] = ldims[k + 1]; + } + } + } + else // NCSU ALACRITY-ADIOS - Bugfix, I think (should have commented on this when I did it...) + { + if (has_time) + { + if (!file_is_fortran) + { + /* first dimension is the time (C array) + * ldims[0] = 1 but gdims does not contain time info and + * gdims[0] is 1st data dimension and + * gdims is shorter by one value than ldims in case of C. + * Therefore, gdims[*ndim-1] = 0 if there is a time dimension. + */ + // error check + if (ndim > 1 && ldims[0] != 1) + { + log_error ("ADIOS Error 1: this is a BP file with C ordering " + "but we didn't find an array to have time dimension " + "in the first dimension. l:g:o = ("); + for (k = 0; k < ndim; k++) + { + log_error_cont ("%llu:%llu:%llu%s", + ldims[k], gdims[k], offsets[k], + (k 1 && ldims[0] != 1) + { + log_error ("ADIOS Error: this is a BP file with Fortran array " + "ordering but we didn't find an array to have time " + "dimension in the last dimension. l:g:o = ("); + for (k = 0; k < ndim; k++) + { + log_error_cont ("%llu:%llu:%llu%s", + ldims[k], gdims[k], offsets[k], + (ktransform.transform_type != adios_transform_none); + //const struct adios_index_characteristic_dims_struct_v1 *dims = + // is_transformed ? &ch->transform.pre_transform_dimensions : &ch->dims; + + return bp_get_dimension_generic_notime(&ch->dims, ldims, gdims, offsets, file_is_fortran); // dims +} + + +// NCSU ALACRITY-ADIOS - Delegate to generic function +void bp_get_dimensions (const ADIOS_FILE * fp, struct adios_index_var_struct_v1 * var_root, int file_is_fortran, + int * ndim, uint64_t ** dims, int * nsteps) { + bp_get_dimensions_generic (fp, var_root, file_is_fortran, ndim, dims, nsteps, 0); +} + +// NCSU ALACRITY-ADIOS - Factored out generic version of this function +/* Fill out ndim and dims for the variable. + ndim and dims doesn't include 'time' dimension. +*/ +void bp_get_dimensions_generic (const ADIOS_FILE * fp, struct adios_index_var_struct_v1 * var_root, int file_is_fortran, + int * ndim, uint64_t ** dims, int * nsteps, int use_pretransform_dimensions) +{ + BP_PROC * p = GET_BP_PROC (fp); + BP_FILE * fh = GET_BP_FILE (fp); + int i, j, has_time_index_characteristic; + int is_global; // global array or just an array written by one process? + uint64_t ldims[32]; + uint64_t gdims[32]; + uint64_t offsets[32]; + struct adios_index_characteristic_dims_struct_v1 *var_dims; + + if (!p->streaming) + { + // NCSU ALACRITY-ADIOS - Use the correct dimension struct + var_dims = use_pretransform_dimensions ? + &var_root->characteristics[0].transform.pre_transform_dimensions + : &var_root->characteristics[0].dims; + } + else + { + int time = fp->current_step + 1; + i = 0; + while (i < var_root->characteristics_count && var_root->characteristics[i].time_index != time) + { + i++; + } + + if (i < var_root->characteristics_count) + { + var_dims = use_pretransform_dimensions ? + &var_root->characteristics[i].transform.pre_transform_dimensions + : &var_root->characteristics[i].dims; + } + else + { + // shouldn't be here + } + } + + has_time_index_characteristic = fh->mfooter.version & ADIOS_VERSION_HAVE_TIME_INDEX_CHARACTERISTIC; + /* Get dimension information */ + * ndim = var_dims->count; //adios_transform_get_var_original_num_dims(var_root); // LAYERFIX + * dims = 0; + * nsteps = (has_time_index_characteristic ? + get_var_nsteps (var_root) : fh->tidx_stop - fh->tidx_start + 1); + + if (* ndim == 0) + { + /* done with this scalar variable */ + return ; + } + + * dims = (uint64_t *) malloc (sizeof (uint64_t) * (* ndim)); + assert (* dims); + + memset (*dims, 0, sizeof (uint64_t) * (* ndim)); + + is_global = bp_get_dimension_generic(var_dims,//&(var_root->characteristics[0]), + ldims, gdims, offsets); + + if (!is_global) + { + j = 0; + /* local array */ + for (i = 0; i < * ndim; i++) + { + /* size of time dimension is always registered as 1 for an array */ + if (ldims[i] == 1 && var_root->characteristics_count > 1) + { + * ndim = * ndim - 1; + } + else + { + (* dims)[j++] = ldims[i]; + } + } + } + else + { + /* global array: + time dimension: ldims=1, gdims=0 + in C array, it can only be the first dim + in Fortran array, it can only be the last dim + (always the slowest changing dim) + */ + if (gdims[* ndim - 1] == 0) // with time + { + if (!file_is_fortran) + { + /* first dimension is the time (C array) + * ldims[0] = 1 but gdims does not contain time info and + * gdims[0] is 1st data dimension and + * gdims is shorter by one value than ldims in case of C. + * Therefore, gdims[*ndim-1] = 0 if there is a time dimension. + */ + // error check + if (* ndim > 1 && ldims[0] != 1) + { + log_error ("ADIOS Error 2: this is a BP file with C ordering " + "but we didn't find an array to have time dimension " + "in the first dimension. l:g:o = ("); + for (i = 0; i < * ndim; i++) + { + log_error_cont ("%llu:%llu:%llu%s", + ldims[i], gdims[i], offsets[i], + (i<*ndim-1 ? ", " : "") ); + } + + log_error_cont(")\n"); + } + } + else + { + // last dimension is the time (Fortran array) + if (* ndim > 1 && ldims[* ndim - 1] != 1) + { + log_error ("ADIOS Error: this is a BP file with Fortran array " + "ordering but we didn't find an array to have time " + "dimension in the last dimension. l:g:o = ("); + for (i = 0; i < * ndim; i++) + { + log_error_cont ("%llu:%llu:%llu%s", + ldims[i], gdims[i], offsets[i], + (i<*ndim-1 ? ", " : "") ); + } + + log_error_cont(")\n"); + } + } + + * ndim = * ndim - 1; + } + + for (i = 0; i < * ndim; i++) + { + (* dims)[i] = gdims[i]; + } + + } +} + + +void bp_get_and_swap_dimensions (const ADIOS_FILE * fp, struct adios_index_var_struct_v1 *var_root, int file_is_fortran, + int *ndim, uint64_t **dims, int *nsteps, int swap_flag) { + bp_get_and_swap_dimensions_generic (fp, var_root, file_is_fortran, ndim, dims, nsteps, swap_flag, 0); +} + +// NCSU ALACRITY-ADIOS - Factored out a generic version of this function +/* Get dimensions of a variable and flip them if swap_flag is set. + ndim: has already taken time dimension out if there is any. + dims: is local dims if local array. is global dims if global array. +*/ +void bp_get_and_swap_dimensions_generic (const ADIOS_FILE * fp, struct adios_index_var_struct_v1 *var_root, int file_is_fortran, + int *ndim, uint64_t **dims, int *nsteps, int swap_flag, int use_pretransform_dimensions) +{ + int dummy = 0; + + bp_get_dimensions_generic (fp, var_root, file_is_fortran, ndim, dims, nsteps, use_pretransform_dimensions); + + if (swap_flag) + { + /* dummy timedim */ + swap_order (*ndim, *dims, &dummy); + } +} + +/* Get # of steps of a variable */ +int get_var_nsteps (struct adios_index_var_struct_v1 * var_root) +{ + uint64_t i; + int nsteps = 0; + int prev_step = -1; + + /* This following loops, of course, assumes indices + * are sorted by time_index already. + */ + for (i = 0; i < var_root->characteristics_count; i++) + { + if (var_root->characteristics[i].time_index != prev_step) + { + prev_step = var_root->characteristics[i].time_index; + nsteps ++; + } + } + + return nsteps; +} + +/* Get # of blocks per step */ +int * get_var_nblocks (struct adios_index_var_struct_v1 * var_root, int nsteps) +{ + int i, j, prev_step = -1; + int * nblocks = (int *) malloc (sizeof (int) * nsteps); + + assert (nblocks); + + memset (nblocks, 0, sizeof (int) * nsteps); + + j = -1; + for (i = 0; i < var_root->characteristics_count; i++) + { + if (var_root->characteristics[i].time_index != prev_step) + { + j ++; + if (j > nsteps - 1) + { + break; + } + prev_step = var_root->characteristics[i].time_index; + } + + nblocks[j] ++; + } + + return nblocks; +} + +void * bp_read_data_from_buffer(struct adios_bp_buffer_struct_v1 *b, enum ADIOS_DATATYPES type) +{ + int16_t data_size; + void * data = 0; + + if (type == adios_string) { + BUFREAD16(b, data_size) + data = malloc (data_size + 1); + } else { + data_size = bp_get_type_size (type, ""); + data = malloc (data_size); + } + + if (!data) { + adios_error (err_no_memory, + "bp_read_data_from_buffer: cannot allocate %d bytes\n",data_size); + return 0; + } + + switch (type) + { + case adios_byte: + case adios_short: + case adios_integer: + case adios_long: + case adios_unsigned_byte: + case adios_unsigned_short: + case adios_unsigned_integer: + case adios_unsigned_long: + case adios_real: + case adios_double: + case adios_long_double: + memcpy (data, (b->buff + b->offset), data_size); + b->offset += data_size; + if(b->change_endianness == adios_flag_yes) { + switch (data_size) { + case 2: + swap_16_ptr(data); + break; + case 4: + swap_32_ptr(data); + break; + case 8: + swap_64_ptr(data); + break; + case 16: + swap_128_ptr(data); + break; + } + } + break; + + case adios_complex: + memcpy (data, (b->buff + b->offset), data_size); + if(b->change_endianness == adios_flag_yes) { + swap_32_ptr(data); // swap REAL part 4 bytes + swap_32_ptr( ((char *)data) + 4); // swap IMG part 4 bytes + } + b->offset += data_size; + break; + + case adios_double_complex: + memcpy (data, (b->buff + b->offset), data_size); + if(b->change_endianness == adios_flag_yes) { + swap_64_ptr(data); // swap REAL part 8 bytes + swap_64_ptr( ((char *)data) + 8); // swap IMG part 8 bytes + } + b->offset += data_size; + break; + + case adios_string: + memcpy (data, (b->buff + b->offset), data_size); + b->offset += data_size; + ((char *) data) [data_size] = '\0'; + break; + + default: + free (data); + data = 0; + break; + } + return data; +} + +/* +void bp_grouping ( BP_FILE * fh_p, + uint64_t * gh_p) +{ + BP_FILE * fh = (BP_FILE *) fh_p; + struct bp_index_pg_struct_v1 * pg_root = fh->pgs_root; + struct bp_minifooter * mh = &fh->mfooter; + int i, j; + uint32_t time_id; + uint64_t pg_time_count = 0; + uint64_t * pg_offsets = (uint64_t *) + malloc (sizeof(uint64_t)*mh->pgs_count); + uint32_t * pg_pids = (uint32_t *) + malloc (sizeof(uint32_t)*mh->pgs_count); + uint64_t * time_index = (uint64_t *) + malloc (sizeof(uint64_t)*mh->time_steps); + time_id = pg_root->time_index; + + uint16_t group_count = 0; + + for (i = 0; i < mh->pgs_count; i++) { + pg_pids [i] = pg_root->process_id; + pg_offsets [i] = pg_root->offset_in_file; + if (pg_root->time_index == time_id) { + pg_time_count += 1; + } + else { + time_index [time_id-1] = pg_time_count; + time_id = pg_root->time_index; + pg_time_count = 1; + } + + pg_root = pg_root->next; + } + + pg_root = fh->pgs_root; + + time_index [time_id-1] = pg_time_count; + time_id = 0; + for (i = 0; i < mh->time_steps; i++) { + if (i > 0) + time_id += time_index[i-1]; + + } + struct adios_index_var_struct_v1 * vars = fh->vars_root; + int vars_cnt = 0; + while (vars) { + if (!strcmp(vars->group_name, pg_root->group_name)) { + printf ("%s %s %d %d %d %d\n",vars->var_name, + vars->group_name, + vars->characteristics_count, + vars->characteristics->dims.count, + vars->characteristics->var_id, + vars->id + ); + ++vars_cnt; + } + vars = vars->next; + } + printf("cnt=%d \n",vars_cnt); + + return; +} +*/ +/* +int bp_read_pgs (BP_FILE * bp_struct) +{ + struct adios_bp_buffer_struct_v1 * b = bp_struct->b; + int r = 0; + MPI_Status status; + // init buffer for pg reading + bp_realloc_aligned (b, b->pg_size); + b->offset = 0; + + if (sizeof (char *) == 4) { + MPI_File_seek (bp_struct->mpi_fh, + (MPI_Offset) b->pg_index_offset, + MPI_SEEK_SET); + + MPI_File_read (bp_struct->mpi_fh, b->buff, + b->pg_size, MPI_BYTE, &status); + MPI_Get_count (&status, MPI_BYTE, &r); + } + else { + MPI_File_seek (bp_struct->mpi_fh, + (MPI_Offset) b->pg_index_offset, + MPI_SEEK_SET); + + MPI_File_read (bp_struct->mpi_fh, b->buff, + b->pg_size, MPI_BYTE, &status); + MPI_Get_count (&status, MPI_BYTE, &r); + } + if (r != b->pg_size) + log_error("could not read %llu bytes. read only: %llu\n", + b->pg_size, r); + + return 0; +} +*/ +/* +int bp_read_vars (BP_FILE * bp_struct) +{ + struct adios_bp_buffer_struct_v1 * b = bp_struct->b; + int r = 0; + MPI_Status status; + + //init buffer for vars reading + bp_realloc_aligned (b, b->vars_size); + b->offset = 0; + + if (sizeof (char *) == 4) { + MPI_File_seek (bp_struct->mpi_fh, + (MPI_Offset) b->vars_index_offset, + MPI_SEEK_SET); + + MPI_File_read (bp_struct->mpi_fh, b->buff, + b->vars_size, MPI_BYTE, &status); + MPI_Get_count (&status, MPI_BYTE, &r); + } + else { + MPI_File_seek (bp_struct->mpi_fh, + (MPI_Offset) b->vars_index_offset, + MPI_SEEK_SET); + + MPI_File_read (bp_struct->mpi_fh, b->buff, + b->vars_size, MPI_BYTE, &status); + MPI_Get_count (&status, MPI_BYTE, &r); + } + if (r != b->vars_size) + log_error ("could not read %llu bytes. read only: %llu\n", + b->vars_size, r); + + return 0; +} +*/ +/* +void print_pg_index (struct bp_index_pg_struct_v1 * pg_root, + struct bp_minifooter * mh) +{ + int i, j; + uint32_t time_id; + uint64_t pg_time_count = 0; + uint64_t * pg_offsets = (uint64_t *) + malloc (sizeof(uint64_t)*mh->pgs_count); + uint32_t * pg_pids = (uint32_t *) + malloc (sizeof(uint32_t)*mh->pgs_count); + uint64_t * time_index = (uint64_t *) + malloc (sizeof(uint64_t)*mh->time_steps); + time_id = pg_root->time_index; + for (i = 0; i < mh->pgs_count; i++) + { + pg_pids [i] = pg_root->process_id; + pg_offsets [i] = pg_root->offset_in_file; + if (pg_root->time_index == time_id) + { + pg_time_count += 1; + } + else { + time_index [time_id-1] = pg_time_count; + time_id = pg_root->time_index; + pg_time_count = 1; + } + pg_root = pg_root->next; + } + + time_index [time_id-1] = pg_time_count; + time_id = 0; + for (i = 0; i < mh->time_steps; i++) { + if (i > 0) + time_id += time_index[i-1]; + } +} + +void print_vars_index_top (struct adios_index_var_struct_v1 * vars_root) +{ + printf("Variables (group) :\n"); + while (vars_root) { + if (!strcmp (vars_root->var_path, "/")) { + printf ("\t %s", + vars_root->var_name + ); + } + else { + printf ("\t %s/%s", + vars_root->var_path, + vars_root->var_name + ); + } + + int j, cnt; + struct adios_index_characteristic_dims_struct_v1 * pdims; + pdims = &vars_root->characteristics [0].dims; + cnt = pdims->count; + if (cnt != 0) { + printf (" ("); + for (j = 0; j < cnt; j++) { + if (j>0) + printf (", "); + if (pdims->dims [j*3 + 1] != 0) { + printf ("%llu", pdims->dims [j*3 + 1]); + } + else { + printf ("%llu", pdims->dims [j*3 + 0]); + } + } + printf (")"); + } + printf("\n"); + vars_root = vars_root->next; + } +} + +void print_vars_index (struct adios_index_var_struct_v1 * vars_root) +{ + while (vars_root) { + if (!strcmp (vars_root->var_path, "/")) { + printf ("Var (Group) [ID]: /%s (%s) [%d]\n", vars_root->var_name + ,vars_root->group_name, vars_root->id + ); + } + else { + printf ("Var (Group) [ID]: %s/%s (%s) [%d]\n", vars_root->var_path + ,vars_root->var_name, vars_root->group_name, vars_root->id + ); + } + printf ("\tVars Characteristics: %llu\n" + ,vars_root->characteristics_count + ); + uint64_t i; + for (i = 0; i < vars_root->characteristics_count; i++) { + printf ("\t\tOffset(%llu)", vars_root->characteristics [i].offset); + if (vars_root->characteristics [i].min) + { + printf ("\t\tMin(%s)", value_to_string (vars_root->type + ,vars_root->characteristics [i].min + ) + ); + } + if (vars_root->characteristics [i].max) + { + printf ("\t\tMax(%s)", value_to_string (vars_root->type + ,vars_root->characteristics [i].max + ) + ); + } + if (vars_root->characteristics [i].value) + { + printf ("\t\tValue(%s)", value_to_string (vars_root->type + ,vars_root->characteristics [i].value + ) + ); + } + if (vars_root->characteristics [i].dims.count != 0) { + int j; + + printf ("\t\tDims (l:g:o): ("); + for (j = 0; j < vars_root->characteristics [i].dims.count; j++) + { + if (j != 0) + printf (","); + if ( vars_root->characteristics [i].dims.dims [j * 3 + 1] + != 0 + ) + { + printf ("%llu:%llu:%llu" + ,vars_root->characteristics [i].dims.dims [j * 3 + 0] + ,vars_root->characteristics [i].dims.dims [j * 3 + 1] + ,vars_root->characteristics [i].dims.dims [j * 3 + 2] + ); + } + else + { + printf ("%llu" + ,vars_root->characteristics [i].dims.dims [j * 3 + 0] + ); + } + } + printf (")"); + } + printf ("\n"); + } + + vars_root = vars_root->next; + } +} +*/ + +/* Return 1 if a < b wrt the given type, otherwise 0 */ +int adios_lt(int type, void *a, void *b) +{ + double ar, ai, br, bi; + long double ar2, ai2, br2, bi2; + switch (type) + { + case adios_unsigned_byte: + return *((uint8_t *) a) < *((uint8_t *) b); + case adios_byte: + return *((int8_t *) a) < *((int8_t *) b); + case adios_short: + return *((int16_t *) a) < *((int16_t *) b); + case adios_unsigned_short: + return *((uint16_t *) a) < *((uint16_t *) b); + case adios_integer: + return *((int32_t *) a) < *((int32_t *) b); + case adios_unsigned_integer: + return *((uint32_t *) a) < *((uint32_t *) b); + case adios_long: + return *((int64_t *) a) < *((int64_t *) b); + case adios_unsigned_long: + return *((uint64_t *) a) < *((uint64_t *) b); + case adios_real: + return *((float *) a) < *((float *) b); + case adios_double: + return *((double *) a) < *((double *) b); + case adios_long_double: + return *((long double *) a) < *((long double *) b); + case adios_string: + return ( strcmp( (char *) a, (char *) b) < 0); + case adios_complex: + ar = (double) ((float *) a)[0]; + ai = (double) ((float *) a)[1]; + br = (double) ((float *) b)[0]; + bi = (double) ((float *) b)[1]; + return ( ar*ar+ai*ai < br*br+bi*bi ); + case adios_double_complex: + ar2 = (long double) ((double *) a)[0]; + ai2 = (long double) ((double *) a)[1]; + br2 = (long double) ((double *) b)[0]; + bi2 = (long double) ((double *) b)[1]; + return ( ar2*ar2+ai2*ai2 < br2*br2+bi2*bi2 ); + default: + return 1; + } + + return 0; +} + +const char * bp_value_to_string (enum ADIOS_DATATYPES type, void * data) +{ + static char s [100]; + s [0] = 0; + + + switch (type) + { + case adios_unsigned_byte: + sprintf (s, "%u", *(((uint8_t *) data))); + break; + + case adios_byte: + sprintf (s, "%d", *(((int8_t *) data))); + break; + + case adios_short: + sprintf (s, "%hd", *(((int16_t *) data))); + break; + + case adios_unsigned_short: + sprintf (s, "%uh", *(((uint16_t *) data))); + break; + + case adios_integer: + sprintf (s, "%d", *(((int32_t *) data))); + break; + + case adios_unsigned_integer: + sprintf (s, "%u", *(((uint32_t *) data))); + break; + + case adios_long: + sprintf (s, "%lld", *(((int64_t *) data))); + break; + + case adios_unsigned_long: + sprintf (s, "%llu", *(((uint64_t *) data))); + break; + + case adios_real: + sprintf (s, "%f", *(((float *) data))); + break; + + case adios_double: + sprintf (s, "%le", *(((double *) data))); + break; + + case adios_long_double: + sprintf (s, "%Le", *(((long double *) data))); + break; + + case adios_string: + sprintf (s, "%s", ((char *) data)); + break; + + case adios_complex: + sprintf (s, "(%f %f)", *(((float *) data) + 0) + , *(((float *) data) + 1) + ); + break; + + case adios_double_complex: + sprintf (s, "(%lf %lf)", *(((double *) data) + 0) + , *(((double *) data) + 1) + ); + break; + + default: + break; + } + + return s; +} + +/* +void print_var_header (struct adios_var_header_struct_v1 * var_header) +{ + int i = 0; + printf ("\t\tVar Name (ID): %s (%d)\n", var_header->name, var_header->id); + printf ("\t\tVar Path: %s\n", var_header->path); + printf ("\t\tIs Dimension: %c\n" + ,(var_header->is_dim == adios_flag_yes ? 'Y' : 'N') + ); +} +*/ + +int is_fortran_file (BP_FILE * fh) +{ + return (fh->pgs_root->adios_host_language_fortran == adios_flag_yes); +} + +int has_subfiles (BP_FILE * fh) +{ + return (fh->mfooter.version & ADIOS_VERSION_HAVE_SUBFILE); +} + +/**************************************************** + Find the var associated with the given variable id +*****************************************************/ +struct adios_index_var_struct_v1 * bp_find_var_byid (BP_FILE * fh, int varid) +{ +/* + struct adios_index_var_struct_v1 * var_root = fh->vars_root; + int i; + + for (i = 0; i < varid && var_root; i++) + { + var_root = var_root->next; + } + + if (i != varid) + { + adios_error (err_corrupted_variable, + "Variable id=%d is valid but was not found in internal data structures!", + varid); + return NULL; + } +*/ + return fh->vars_table[varid]; + // return var_root; +} + +int is_global_array (struct adios_index_characteristic_struct_v1 *ch) { + return is_global_array_generic(&ch->dims); +} + +// NCSU ALACRITY-ADIOS - Factored out generic version of the function +/* Check whether an array is global */ +int is_global_array_generic (const struct adios_index_characteristic_dims_struct_v1 *dims) +{ + int is_global = 0; // global array or just an array written by one process? + int ndim = dims->count, k; + + for (k = 0; k < ndim; k ++) + { + is_global = is_global || dims->dims[k*3 + 1]; + } + + return is_global; +} + +/** Return the memory size of one data element of an adios type. + * If the type is adios_string, and the second argument is + * the string itself, it returns strlen(var)+1. + * For other types, it does not care about var and returns + * the size occupied by one element. + * + * Note that adios_internals:adios_get_type_size returns + * strlen(var) for strings. + */ +int bp_get_type_size (enum ADIOS_DATATYPES type, void * var) +{ + switch (type) + { + case adios_byte: + case adios_unsigned_byte: + return 1; + + case adios_string: + if (!var) + return 1; + else + return strlen ((char *) var) + 1; + + case adios_short: + case adios_unsigned_short: + return 2; + + case adios_integer: + case adios_unsigned_integer: + return 4; + + case adios_long: + case adios_unsigned_long: + return 8; + + case adios_real: + return 4; + + case adios_double: + return 8; + + case adios_long_double: + return 16; + + case adios_complex: + return 2 * 4; + + case adios_double_complex: + return 2 * 8; + + default: + return -1; + } +} + +double bp_value_to_double (enum ADIOS_DATATYPES type, void * data) +{ + switch (type) + { + case adios_string: + return 0; + + case adios_complex: + return * ((float *) data); + + case adios_double_complex: + return * ((double *) data); + + case adios_double: + return * ((double *) data); + + case adios_long_double: + return * ((long double *) data); + + case adios_unsigned_byte: + return * ((uint8_t *) data); + + case adios_byte: + return * ((int8_t *) data); + + case adios_short: + return * ((int16_t *) data); + + case adios_unsigned_short: + return * ((uint16_t *) data); + + case adios_integer: + return * ((int32_t *) data); + + case adios_unsigned_integer: + return * ((uint32_t *) data); + + case adios_long: + return * ((int64_t *) data); + + case adios_unsigned_long: + return * ((uint64_t *) data); + + case adios_real: + return * ((float *) data); + + default: + return 0.0; + } +} + +/* This routine checks whether the file is a valid ADIOS-BP file. + * This is done by check whether the 'ADIOS-BP' string has been written + * before minifooter. + */ +int check_bp_validity (const char * fname) +{ + int err, flag; + MPI_File fh; + MPI_Offset file_size; + MPI_Status status; + char str[9]; + + err = MPI_File_open (MPI_COMM_SELF, (char *) fname, MPI_MODE_RDONLY, + (MPI_Info) MPI_INFO_NULL, &fh); + if (err != MPI_SUCCESS) + { + char e [MPI_MAX_ERROR_STRING]; + int len = 0; + memset (e, 0, MPI_MAX_ERROR_STRING); + MPI_Error_string (err, e, &len); + adios_error (err_file_open_error, "MPI open failed for %s: '%s'\n", fname, e); + return 0; + } + + MPI_File_get_size (fh, &file_size); + // Since 1.4, there is an additional 28 bytes written ahead of minifooter. + MPI_File_seek (fh, (MPI_Offset) file_size - MINIFOOTER_SIZE - 28, MPI_SEEK_SET); + MPI_File_read (fh, str, 8, MPI_BYTE, &status); + MPI_File_close (&fh); + + //printf ("check_bp_validity: %s\n", str); + str[8] = '\0'; + + flag = (strcmp (str, "ADIOS-BP") == 0 ) ? 1 : 0; + + return flag; +} + +int get_num_subfiles (BP_FILE * fh) +{ + struct adios_index_var_struct_v1 ** vars_root = &(fh->vars_root); + struct bp_minifooter * mh = &(fh->mfooter); + struct adios_index_var_struct_v1 ** root; + int i, j, n = 0; + + root = vars_root; + for (i = 0; i < mh->vars_count; i++) + { + for (j = 0; j < (*root)->characteristics_count; j++) + { + if ((*root)->characteristics [j].file_index > n) + { + n = (*root)->characteristics [j].file_index; + } + } + } + + return n + 1; +} + + diff --git a/tests/libs/adios/src/core/bp_utils.h b/tests/libs/adios/src/core/bp_utils.h new file mode 100644 index 0000000000..c7261e174e --- /dev/null +++ b/tests/libs/adios/src/core/bp_utils.h @@ -0,0 +1,85 @@ +/* + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + */ + +#ifndef __BP_UTILS_H__ +#define __BP_UTILS_H__ + +#include +#include +#include "public/adios_read.h" // ADIOS_FILE* +#include "core/bp_types.h" +#define VARS_MINIHEADER_SIZE 10 + +BP_PROC * GET_BP_PROC (const ADIOS_FILE * fp); +BP_FILE * GET_BP_FILE (const ADIOS_FILE * fp); +void bp_alloc_aligned (struct adios_bp_buffer_struct_v1 * b, uint64_t size); +void bp_realloc_aligned (struct adios_bp_buffer_struct_v1 * b, uint64_t size); +int bp_get_endianness( uint32_t change_endianness ); +int bp_parse_characteristics (struct adios_bp_buffer_struct_v1 * b, + struct adios_index_var_struct_v1 ** root, + uint64_t j); +int bp_get_characteristics_data (void ** ptr_data, + void * buffer, + int data_size, + enum ADIOS_DATATYPES type); +int bp_read_close (struct adios_bp_buffer_struct_v1 * b); +int bp_read_open (const char * filename, + MPI_Comm comm, + BP_FILE * fh); +MPI_File * get_BP_file_handle(struct BP_file_handle * l, uint32_t file_index); +void add_BP_file_handle (struct BP_file_handle ** l, struct BP_file_handle * n); +void close_all_BP_files (struct BP_file_handle * l); +int get_time (struct adios_index_var_struct_v1 * v, int step); +int bp_open (const char * fname, + MPI_Comm comm, + BP_FILE * fh); +ADIOS_VARINFO * bp_inq_var_byid (const ADIOS_FILE * fp, int varid); +int bp_close (BP_FILE * fh); +int bp_read_minifooter (BP_FILE * bp_struct); +int bp_parse_pgs (BP_FILE * fh); +int bp_parse_attrs (BP_FILE * fh); +int bp_parse_vars (BP_FILE * fh); +int bp_seek_to_step (ADIOS_FILE * fp, int tostep, int show_hidden_attrs); +int64_t get_var_start_index (struct adios_index_var_struct_v1 * v, int t); +int64_t get_var_stop_index (struct adios_index_var_struct_v1 * v, int t); + +const char * bp_value_to_string (enum ADIOS_DATATYPES type, void * data); +int bp_get_type_size (enum ADIOS_DATATYPES type, void * var); +int bp_get_dimension_generic(const struct adios_index_characteristic_dims_struct_v1 *dims, + uint64_t *ldims, uint64_t *gdims, uint64_t *offsets); +int bp_get_dimension_characteristics(struct adios_index_characteristic_struct_v1 *ch, + uint64_t *ldims, uint64_t *gdims, uint64_t *offsets); +int bp_get_dimension_generic_notime (const struct adios_index_characteristic_dims_struct_v1 *dims, + uint64_t *ldims, uint64_t *gdims, uint64_t *offsets, + int file_is_fortran); +int bp_get_dimension_characteristics_notime (struct adios_index_characteristic_struct_v1 *ch, + uint64_t *ldims, uint64_t *gdims, uint64_t *offsets, + int file_is_fortran); +void bp_get_dimensions_generic(const ADIOS_FILE *fp, struct adios_index_var_struct_v1 *var_root, int file_is_fortran, + int *ndim, uint64_t **dims, int *nsteps, int use_pretransform_dimensions); +void bp_get_dimensions (const ADIOS_FILE *fp, struct adios_index_var_struct_v1 *var_root, int file_is_fortran, + int *ndim, uint64_t **dims, int *nsteps); +void bp_get_and_swap_dimensions_generic (const ADIOS_FILE *fp, struct adios_index_var_struct_v1 *var_root, int file_is_fortran, + int *ndim, uint64_t **dims, int *nsteps, int swap_flag, int use_pretransform_dimensions); +void bp_get_and_swap_dimensions (const ADIOS_FILE *fp, struct adios_index_var_struct_v1 *var_root, int file_is_fortran, + int *ndim, uint64_t **dims, int *nsteps, int swap_flag); +int get_var_nsteps (struct adios_index_var_struct_v1 * var_root); +int * get_var_nblocks (struct adios_index_var_struct_v1 * var_root, int nsteps); +void print_process_group_index ( + struct adios_index_process_group_struct_v1 * pg_root + ); +/* Return 1 if a < b wrt. the given type, otherwise 0 */ +int adios_lt(int type, void *a, void *b); +double bp_value_to_double(enum ADIOS_DATATYPES type, void * data); +int is_fortran_file (BP_FILE * fh); +int has_subfiles (BP_FILE * fh); +struct adios_index_var_struct_v1 * bp_find_var_byid (BP_FILE * fh, int varid); +int is_global_array_generic (const struct adios_index_characteristic_dims_struct_v1 *dims); // NCSU ALACRITY-ADIOS +int is_global_array (struct adios_index_characteristic_struct_v1 * ch); +int check_bp_validity (const char * fname); +int get_num_subfiles (BP_FILE * fh); +#endif diff --git a/tests/libs/adios/src/core/buffer.c b/tests/libs/adios/src/core/buffer.c new file mode 100644 index 0000000000..cadd54115e --- /dev/null +++ b/tests/libs/adios/src/core/buffer.c @@ -0,0 +1,162 @@ +/* + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + */ + +#include +#include +#include +#include /* _SC_PAGE_SIZE, _SC_AVPHYS_PAGES */ + +#if defined(__APPLE__) +# include +#endif + +#include "core/buffer.h" +#include "core/adios_logger.h" +#include "adios_error.h" + +// buffer sizing may be problematic. To get a more accurate picture, check: +// http://chandrashekar.info/vault/linux-system-programs.html +static uint64_t adios_buffer_size_requested = 0; +static uint64_t adios_buffer_size_max = 0; +static uint64_t adios_buffer_size_remaining = 0; +static int adios_buffer_alloc_percentage = 0; // 1 = yes, 0 = no +static enum ADIOS_BUFFER_ALLOC_WHEN adios_buffer_alloc_when = ADIOS_BUFFER_ALLOC_UNKNOWN; + +void adios_buffer_size_requested_set (uint64_t v) { adios_buffer_size_requested = v; } +uint64_t adios_buffer_size_requested_get (void) { return adios_buffer_size_requested; } +void adios_buffer_size_max_set (uint64_t v) { adios_buffer_size_max = v; } +void adios_buffer_size_remaining_set (uint64_t v) { adios_buffer_size_remaining = v; } +void adios_buffer_alloc_percentage_set (int v) { adios_buffer_alloc_percentage = v; } +void adios_buffer_alloc_when_set (enum ADIOS_BUFFER_ALLOC_WHEN v) { adios_buffer_alloc_when = v; } +enum ADIOS_BUFFER_ALLOC_WHEN adios_buffer_alloc_when_get (void) { return adios_buffer_alloc_when; } + +#if defined (__APPLE__) +// See e.g. http://www.opensource.apple.com/source/system_cmds/system_cmds-496/vm_stat.tproj/vm_stat.c +// for the code for the vm_stat command. +// http://www.opensource.apple.com/source/xnu/xnu-792.6.61/osfmk/man/host_statistics.html?txt +// describes the host_statistics function +// Added by Dorian Krause +static inline size_t adios_get_avphys_pages () +{ + // Since we are only interested in the number of free pages + // it is fine to work with the "older" host_statistics() + // instead of host_statistics64(). The advantage is that the + // first function is also provided on older (e.g., Mac OS X 10.5) + // systems + vm_statistics_data_t host_info; + mach_msg_type_number_t host_info_outCnt; + + // See mach/host_info.h + host_info_outCnt = HOST_VM_INFO_COUNT; + if (host_statistics(mach_host_self(), + HOST_VM_INFO, + (host_info_t)&host_info, + &host_info_outCnt) != KERN_SUCCESS ) { + log_error("adios_get_avphys_pages (): host_statistics failed.\n"); + return 0; // Best we can do + } + + // on Mac OSX 10.4 (Tiger), there is no speculative page counting + // VM_PAGE_QUERY_PAGE_SPECULATIVE is defined in 10.5's mach/vm_statistics.h (included in mach.h) +# if defined (VM_PAGE_QUERY_PAGE_SPECULATIVE) + return host_info.free_count - host_info.speculative_count; +# else + return host_info.free_count; +# endif +} +#else +// See e.g. http://chandrashekar.info/vault/linux-system-programs.html +static inline size_t adios_get_avphys_pages () +{ + return sysconf (_SC_AVPHYS_PAGES); +} +#endif + +int adios_set_buffer_size () +{ + //if (!adios_buffer_size_max) // not called before + if (adios_buffer_size_max < adios_buffer_size_requested) // not called before + { + long pagesize; + long pages; + + pagesize = sysconf (_SC_PAGE_SIZE); + pages = adios_get_avphys_pages (); + + if (adios_buffer_alloc_percentage) + { + adios_buffer_size_max = (pages * pagesize / 100.0) + * adios_buffer_size_requested; + } + else + { + if (pagesize * pages >= adios_buffer_size_requested) + { + // sufficient memory, do nothing + adios_buffer_size_max = adios_buffer_size_requested; + } + else + { + adios_error (err_no_memory, + "adios_allocate_buffer (): insufficient memory: " + "%llu requested, %llu available. Using " + "available.\n", + adios_buffer_size_requested, + (uint64_t)(((uint64_t) pagesize) * pages)); + adios_buffer_size_max = (uint64_t)((uint64_t) pagesize) * pages; + } + } + + adios_buffer_size_remaining = adios_buffer_size_max; + + return 1; + } + else + { + log_debug ("adios_allocate_buffer already called. No changes made.\n"); + return 1; + } +} + +uint64_t adios_method_buffer_alloc (uint64_t size) +{ + if (adios_buffer_size_remaining >= size) + { + adios_buffer_size_remaining -= size; + + return size; + } + else + { + uint64_t remaining = adios_buffer_size_remaining; + + adios_buffer_size_remaining = 0; + + return remaining; + } +} + +int adios_method_buffer_free (uint64_t size) +{ + if (size + adios_buffer_size_remaining > adios_buffer_size_max) + { + adios_error (err_invalid_buffer, + "ERROR: attempt to return more bytes to buffer " + "pool than were originally available\n"); + + adios_buffer_size_remaining = adios_buffer_size_max; + + return 0; + } + else + { + adios_buffer_size_remaining += size; + + return 1; + } +} + diff --git a/tests/libs/adios/src/core/buffer.h b/tests/libs/adios/src/core/buffer.h new file mode 100644 index 0000000000..b2b1ee4cca --- /dev/null +++ b/tests/libs/adios/src/core/buffer.h @@ -0,0 +1,26 @@ +/* + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + */ + +#ifndef ADIOS_BUFFER_H +#define ADIOS_BUFFER_H + +#include "public/adios_types.h" + +void adios_buffer_size_requested_set (uint64_t v); +uint64_t adios_buffer_size_requested_get (void); +void adios_buffer_size_max_set (uint64_t v); +void adios_buffer_size_remaining_set (uint64_t v); +void adios_buffer_alloc_percentage_set (int v); +void adios_buffer_alloc_when_set (enum ADIOS_BUFFER_ALLOC_WHEN v); + +enum ADIOS_BUFFER_ALLOC_WHEN adios_buffer_alloc_when_get (void); + +int adios_set_buffer_size (void); +uint64_t adios_method_buffer_alloc (uint64_t size); +int adios_method_buffer_free (uint64_t size); + +#endif diff --git a/tests/libs/adios/src/core/common_adios.c b/tests/libs/adios/src/core/common_adios.c new file mode 100644 index 0000000000..ead703b3b7 --- /dev/null +++ b/tests/libs/adios/src/core/common_adios.c @@ -0,0 +1,1175 @@ +/* + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + */ + +#include "config.h" + +#include +#include +#include +#include +#include +#include // gettimeofday +#include + +// xml parser +#include + +#include "core/adios_internals.h" +#include "core/adios_internals_mxml.h" +#include "core/common_adios.h" +#include "core/adios_bp_v1.h" +#include "core/buffer.h" +#include "core/adios_transport_hooks.h" +#include "core/adios_logger.h" +#include "core/adios_timing.h" +#include "core/qhashtbl.h" +#include "adios_error.h" + +// NCSU ALACRITY-ADIOS +#include "core/transforms/adios_transforms_common.h" +#include "core/transforms/adios_transforms_read.h" +#include "core/transforms/adios_transforms_write.h" + +#ifdef WITH_NCSU_TIMER +#include "timer.h" +#endif + +#ifdef DMALLOC +#include "dmalloc.h" +#endif + +extern struct adios_transport_struct * adios_transports; +extern int adios_errno; + +/////////////////////////////////////////////////////////////////////////////// +int common_adios_init (const char * config, MPI_Comm comm) +{ + // parse the config file + adios_errno = err_no_error; + adios_parse_config (config, comm); + return adios_errno; +} + +/////////////////////////////////////////////////////////////////////////////// +// all XML file pieces will be provided by another series of calls +int common_adios_init_noxml (MPI_Comm comm) +{ + adios_errno = err_no_error; + adios_local_config (comm); + return adios_errno; +} + +/////////////////////////////////////////////////////////////////////////////// +int common_adios_finalize (int mype) +{ + struct adios_method_list_struct * m; + + adios_errno = err_no_error; + for (m = adios_get_methods (); m; m = m->next) + { + if ( m->method->m != ADIOS_METHOD_UNKNOWN + && m->method->m != ADIOS_METHOD_NULL + && adios_transports [m->method->m].adios_finalize_fn + ) + { + adios_transports [m->method->m].adios_finalize_fn (mype, m->method); + } + } + + adios_cleanup (); + +#if defined(WITH_NCSU_TIMER) && defined(TIMER_LEVEL) && (TIMER_LEVEL <= 0) + timer_finalize (); +#endif + + return adios_errno; +} + +/////////////////////////////////////////////////////////////////////////////// +int common_adios_allocate_buffer (enum ADIOS_BUFFER_ALLOC_WHEN adios_buffer_alloc_when + ,uint64_t buffer_size) +{ + adios_errno = err_no_error; + adios_buffer_size_requested_set (buffer_size * 1024 * 1024); + adios_buffer_alloc_when_set (adios_buffer_alloc_when); + adios_set_buffer_size (); + return adios_errno; +} + +/////////////////////////////////////////////////////////////////////////////// +// Drew: used for experiments +uint32_t pinned_timestep = 0; +void adios_pin_timestep(uint32_t ts) { + pinned_timestep = ts; +} + +/////////////////////////////////////////////////////////////////////////////// +int common_adios_open (int64_t * fd, const char * group_name + ,const char * name, const char * file_mode, MPI_Comm comm + ) +{ +#if defined(WITH_NCSU_TIMER) && defined(TIMER_LEVEL) && (TIMER_LEVEL <= 0) + timer_start ("adios_open_to_close"); + timer_start ("adios_open"); +#endif + + int64_t group_id = 0; + struct adios_file_struct * fd_p = (struct adios_file_struct *) + malloc (sizeof (struct adios_file_struct)); + struct adios_group_struct * g = 0; + struct adios_method_list_struct * methods = 0; + enum ADIOS_METHOD_MODE mode; + + adios_errno = err_no_error; + adios_common_get_group (&group_id, group_name); + g = (struct adios_group_struct *) group_id; + methods = g->methods; + + if (!strcasecmp (file_mode, "r")) + mode = adios_mode_read; + else + if (!strcasecmp (file_mode, "w")) + mode = adios_mode_write; + else + if (!strcasecmp (file_mode, "a")) + mode = adios_mode_append; + else + if (!strcasecmp (file_mode, "u")) + mode = adios_mode_update; + else + { + adios_error(err_invalid_file_mode, + "adios_open: unknown file mode: %s, supported r,w,a,u\n", + file_mode); + + *fd = 0; + + return adios_errno; + } + + fd_p->name = strdup (name); + fd_p->subfile_index = -1; // subfile index is by default -1 + fd_p->group = g; + fd_p->mode = mode; + fd_p->data_size = 0; + fd_p->buffer = 0; + fd_p->offset = 0; + fd_p->bytes_written = 0; + fd_p->buffer_size = 0; + fd_p->vars_start = 0; + fd_p->vars_written = 0; + fd_p->write_size_bytes = 0; + fd_p->base_offset = 0; + fd_p->pg_start_in_file = 0; + if (comm != MPI_COMM_NULL) + MPI_Comm_dup(comm, &fd_p->comm); + else + fd_p->comm = MPI_COMM_NULL; + + +#if 1 + /* Time index magic done here */ + if (mode == adios_mode_write) + { + /* Traditionally, time=1 at the first step, and for subsequent file + creations, time increases. Although, each file contains one step, + the time index indicates that they are in a series. + */ + g->time_index++; + } + else if (mode == adios_mode_append) + { + g->time_index++; + } + else if (mode == adios_mode_update && g->time_index > 1) + { + /* Update from Append differs only in the time index. All methods had + code for Append, now for Update we decrease the counter by one, + for all methods. (But do not go below 1). + */ + g->time_index--; + } + /* time starts from 1 not from 0 (traditionally; now no one cares */ + if (g->time_index == 0) + g->time_index = 1; +#else + /* old way pre-1.4*/ + if (mode != adios_mode_read) + g->time_index++; +#endif + + // Drew: for experiments + if (pinned_timestep > 0) + g->time_index = pinned_timestep; + + while (methods) + { + if ( methods->method->m != ADIOS_METHOD_UNKNOWN + && methods->method->m != ADIOS_METHOD_NULL + && adios_transports [methods->method->m].adios_open_fn + ) + { + adios_transports [methods->method->m].adios_open_fn + (fd_p, methods->method, fd_p->comm); + } + + methods = methods->next; + } + + *fd = (int64_t) fd_p; + +#if defined(WITH_NCSU_TIMER) && defined(TIMER_LEVEL) && (TIMER_LEVEL <= 0) + timer_stop ("adios_open"); +#endif + return adios_errno; +} + +/////////////////////////////////////////////////////////////////////////////// +static const char ADIOS_ATTR_PATH[] = "/__adios__"; + +int common_adios_group_size (int64_t fd_p + ,uint64_t data_size + ,uint64_t * total_size + ) +{ +#if defined(WITH_NCSU_TIMER) && defined(TIMER_LEVEL) && (TIMER_LEVEL <= 0) + timer_start ("adios_group_size"); +#endif + adios_errno = err_no_error; + struct adios_file_struct * fd = (struct adios_file_struct *) fd_p; + if (!fd) + { + adios_error (err_invalid_file_pointer, "Invalid handle passed to adios_group_size\n"); + return adios_errno; + } + struct adios_method_list_struct * m = fd->group->methods; + if (m && m->next == NULL && m->method->m == ADIOS_METHOD_NULL) + { + // nothing to do so just return + fd->shared_buffer = adios_flag_no; + fd->write_size_bytes = 0; + fd->buffer = 0; + *total_size = 0; +#if defined(WITH_NCSU_TIMER) && defined(TIMER_LEVEL) && (TIMER_LEVEL <= 0) + timer_stop ("adios_group_size"); +#endif + return err_no_error; + } + + /* Add ADIOS internal attributes now (should be before calculating the overhead) */ + if (fd->mode != adios_mode_read && + (fd->group->process_id == 0 || fd->subfile_index != -1) + ) + { + struct timeval tp; + char epoch[16]; + gettimeofday(&tp, NULL); + sprintf(epoch, "%d", (int) tp.tv_sec); + + int def_adios_init_attrs = 1; + // if we append/update, define these attributes only at the first step + if (fd->mode != adios_mode_write && fd->group->time_index > 1) + def_adios_init_attrs = 0; + + if (def_adios_init_attrs) { + log_debug ("Define ADIOS extra attributes, " + "time = %d, rank = %d, epoch = %s subfile=%d\n", + fd->group->time_index, fd->group->process_id, epoch, fd->subfile_index); + + adios_common_define_attribute ((int64_t)fd->group, "version", ADIOS_ATTR_PATH, + adios_string, VERSION, NULL); + + adios_common_define_attribute ((int64_t)fd->group, "create_time_epoch", ADIOS_ATTR_PATH, + adios_integer, epoch, NULL); + adios_common_define_attribute ((int64_t)fd->group, "update_time_epoch", ADIOS_ATTR_PATH, + adios_integer, epoch, NULL); + // id of last attribute is fd->group->member_count + fd->group->attrid_update_epoch = fd->group->member_count; + + } + /* FIXME: this code works fine, it does not duplicate the attribute, + but the index will still contain all copies and the read will see + only the first one. Thus updating an attribute does not work + in practice. + */ + else + { + // update attribute of update time (define would duplicate it) + struct adios_attribute_struct * attr = adios_find_attribute_by_id + (fd->group->attributes, fd->group->attrid_update_epoch); + if (attr) { + log_debug ("Update ADIOS extra attribute name=%s, " + "time = %d, rank = %d, epoch = %s, subfile=%d\n", + attr->name, fd->group->time_index, fd->group->process_id, + epoch, fd->subfile_index); + + free(attr->value); + adios_parse_scalar_string (adios_integer, (void *) epoch, &attr->value); + } + } + } + +#ifdef ADIOS_TIMERS + int tv_size = adios_add_timing_variables (fd); + data_size += tv_size; +#endif + + fd->write_size_bytes = data_size; + + uint64_t overhead = adios_calc_overhead_v1 (fd); + + *total_size = data_size + overhead; + + // try to reserve a buffer using the adios_method_buffer_alloc + // if it does not give the correct amount, overflow. Make sure + // the amount given is big enough for the first part of the file. + + fd->write_size_bytes += overhead; + + // NCSU ALACRITY-ADIOS - Current solution to group_size problem: find + // the most "expansive" transform method used in the file, and assume + // all of the data uses that method, for a very rough but safe upper bound. + // + // (see the comment in the top of adios_transforms.c, under section + // 'The "group size" problem,' for more details) + uint64_t wc_transformed_size = adios_transform_worst_case_transformed_group_size(data_size, fd); + if (wc_transformed_size > data_size) { + log_debug("Computed worst-case bound on transformed data for a group size of %llu is %llu; increasing group size to match.\n", + data_size, wc_transformed_size); + + fd->write_size_bytes += (wc_transformed_size - data_size); + *total_size += (wc_transformed_size - data_size); + } + + uint64_t allocated = adios_method_buffer_alloc (fd->write_size_bytes); + if (allocated != fd->write_size_bytes) + { + fd->shared_buffer = adios_flag_no; + + log_warn ("adios_group_size (%s): Not buffering. " + "needs: %llu available: %llu.\n", + fd->group->name, fd->write_size_bytes, allocated); + } + else + { + fd->shared_buffer = adios_flag_yes; + } + + // Drew: for experiments + if (pinned_timestep != 0) + fd->group->time_index = pinned_timestep; + + // call each transport method to coordinate the write and handle + // if an overflow is detected. + // now tell each transport attached that it is being written + while (m) + { + enum ADIOS_FLAG should_buffer = adios_flag_yes; + if ( m->method->m != ADIOS_METHOD_UNKNOWN + && m->method->m != ADIOS_METHOD_NULL + && adios_transports [m->method->m].adios_should_buffer_fn + ) + { + should_buffer = adios_transports [m->method->m]. + adios_should_buffer_fn (fd + ,m->method + ); + } + + if (should_buffer == adios_flag_no) // can't write directly since + fd->shared_buffer = adios_flag_no; // some might want to share + + m = m->next; + } + + // Drew: for experiments + if (pinned_timestep != 0) + fd->group->time_index = pinned_timestep; + + if (fd->shared_buffer == adios_flag_no) + { + adios_method_buffer_free (allocated); + fd->buffer = 0; + fd->offset = 0; + fd->bytes_written = 0; + } + else + { + fd->buffer = malloc (fd->write_size_bytes); + fd->buffer_size = fd->write_size_bytes; + fd->offset = 0; + fd->bytes_written = 0; + if (!fd->buffer) + { + adios_error (err_no_memory, "Cannot allocate %llu bytes for buffered output.\n", + fd->write_size_bytes); + + return adios_errno; + } + else + { + // write the process group header + adios_write_process_group_header_v1 (fd, *total_size); + + // setup for writing vars + adios_write_open_vars_v1 (fd); + } + } + +#ifdef ADIOS_TIMERS + adios_write_timing_variables (fd); +#endif + + +#if defined(WITH_NCSU_TIMER) && defined(TIMER_LEVEL) && (TIMER_LEVEL <= 0) + timer_stop ("adios_group_size"); +#endif + // each var will be added to the buffer by the adios_write calls + // attributes will be added by adios_close + + return adios_errno; +} + +int common_adios_write_byid (struct adios_file_struct * fd, struct adios_var_struct * v, void * var) +{ + struct adios_method_list_struct * m = fd->group->methods; + + adios_errno = err_no_error; + if (m && m->next == NULL && m->method->m == ADIOS_METHOD_NULL) + { + return adios_errno; + } + + if (v->data) + { + free (v->data); + v->data = 0; + } + + if (v->dimensions) + { + v->data = var; + } + else + { + uint64_t element_size = adios_get_type_size (v->type, var); + + switch (v->type) + { + case adios_byte: + case adios_short: + case adios_integer: + case adios_long: + case adios_unsigned_byte: + case adios_unsigned_short: + case adios_unsigned_integer: + case adios_unsigned_long: + case adios_real: + case adios_double: + case adios_long_double: + case adios_complex: + case adios_double_complex: + v->data = malloc (element_size); + if (!v->data) + { + adios_error (err_no_memory, + "In adios_write, cannot allocate %lld bytes to copy scalar %s\n", + element_size, v->name); + return adios_errno; + } + + memcpy ((char *) v->data, var, element_size); + break; + + case adios_string: + v->data = malloc (element_size + 1); + if (!v->data) + { + adios_error (err_no_memory, + "In adios_write, cannot allocate %lld bytes to copy string %s\n", + element_size, v->name); + return adios_errno; + } + ((char *) v->data) [element_size] = 0; + memcpy ((char *) v->data, var, element_size); + break; + + default: + v->data = 0; + break; + } + } + + common_adios_write (fd, v, var); + // v->data is set to NULL in the above call + + if (!adios_errno) { + if (fd->mode == adios_mode_write || fd->mode == adios_mode_append) + { + adios_copy_var_written (fd->group, v); + } + } + + return adios_errno; +} + +static int common_adios_write_transform_helper(struct adios_file_struct * fd, struct adios_var_struct * v) { + int use_shared_buffer = (fd->shared_buffer == adios_flag_yes); + int wrote_to_shared_buffer = 0; + + // If we are using the shared buffer, transform the data directly into it + if (use_shared_buffer) { + uint16_t header_size = adios_calc_var_overhead_v1(v); + uint64_t header_offset; + uint64_t payload_offset; + uint64_t end_offset; + + // Reserve space for the variable header (it will need to be written after + // the transform to capture updated metadata) + header_offset = fd->offset; + fd->offset += header_size; + payload_offset = fd->offset; + + // This function will either: + // a) write to the shared buffer, leave v->data, v->data_size and + // v->free_data untouched, and return 1, OR + // b) write to v->data, set v->data_size and v->free_data, and return 0 + // + int success = adios_transform_variable_data(fd, v, use_shared_buffer, &wrote_to_shared_buffer); + if (!success) { + fd->offset = header_offset; + return 0; + } + + // Assumption: we don't change the header size, just contents, in + // adios_transform_variable_data + assert(adios_calc_var_overhead_v1(v) == header_size); + + // Store the ending offset of the payload write (if any) + end_offset = fd->offset; + + // Rewind and write the header back where it should be + fd->offset = header_offset; + // var payload sent for sizing information + adios_write_var_header_v1(fd, v); + + assert(fd->offset == payload_offset); + + // If the data was stored to the shared buffer, update v->data, + // v->data_size and v->free_data. Else, write the payload to the shared + // buffer (the other v->* fields have already been updated) + if (wrote_to_shared_buffer) { + v->data = fd->buffer + payload_offset; + v->data_size = end_offset - payload_offset; + v->free_data = adios_flag_no; + + // Update the buffer back to the end of the header+payload + fd->offset = end_offset; + } else { + // write payload + adios_write_var_payload_v1 (fd, v); + + // fd->offset now points to the end of the header+payload + } + + // Success! + return 1; + } else { + int ret = adios_transform_variable_data(fd, v, use_shared_buffer, &wrote_to_shared_buffer); + + assert(!wrote_to_shared_buffer); + assert(v->data); + + return ret; + } +} + +/////////////////////////////////////////////////////////////////////////////// +/* common_adios_write is just a partial implementation. It expects filled out + * structures. This is because C and Fortran implementations of adios_write are + * different for some part and this is the common part. + */ +int common_adios_write (struct adios_file_struct * fd, struct adios_var_struct * v, void * var) +{ +#if defined(WITH_NCSU_TIMER) && defined(TIMER_LEVEL) && (TIMER_LEVEL <= 0) + timer_start ("adios_write"); +#endif + adios_errno = err_no_error; + struct adios_method_list_struct * m = fd->group->methods; + + // NCSU ALACRITY-ADIOS - Do some processing here depending on the transform + // type specified (if any) + + // First, before doing any transform (or none), compute variable statistics, + // as we can't do this after the data is transformed + adios_generate_var_characteristics_v1 (fd, v); + + // If no transform is specified, do the normal thing (write to shared + // buffer immediately, if one exists) + if (v->transform_type == adios_transform_none) + { + if (fd->shared_buffer == adios_flag_yes) + { + // var payload sent for sizing information + adios_write_var_header_v1 (fd, v); + + // write payload + adios_write_var_payload_v1 (fd, v); + } + } + // Else, do a transform + else + { +#if defined(WITH_NCSU_TIMER) && defined(TIMER_LEVEL) && (TIMER_LEVEL <= 0) + timer_start ("adios_transform"); +#endif + int success = common_adios_write_transform_helper(fd, v); + if (success) { + // Make it appear as if the user had supplied the transformed data + var = v->data; + } else { + log_error("Error: unable to apply transform %s to variable %s; likely ran out of memory, check previous error messages\n", adios_transform_plugin_primary_xml_alias(v->transform_type), v->name); + // FIXME: Reverse the transform metadata and write raw data as usual + } +#if defined(WITH_NCSU_TIMER) && defined(TIMER_LEVEL) && (TIMER_LEVEL <= 0) + timer_stop ("adios_transform"); +#endif + } + + // now tell each transport attached that it is being written + while (m) + { + if ( m->method->m != ADIOS_METHOD_UNKNOWN + && m->method->m != ADIOS_METHOD_NULL + && adios_transports [m->method->m].adios_write_fn + ) + { + adios_transports [m->method->m].adios_write_fn + (fd, v, var, m->method); + } + + m = m->next; + } + + // NCSU ALACRITY-ADIOS - Free transform-method-allocated data buffers + if (v->dimensions) + { + // TODO: Is this correct? Normally v->data is a user buffer, so we + // can't free it. However, after a transform, we probably do need + // to free it. We mark this by setting the free_data flag. However, + // as this flag is hardly ever used, I don't know whether this is + // using the flag correctly or not. Need verification with + // Gary/Norbert/someone knowledgable about ADIOS internals. + if (v->transform_type != adios_transform_none && v->free_data == adios_flag_yes && v->data) + free(v->data); + v->data = 0; + } + + v->write_count++; +#if defined(WITH_NCSU_TIMER) && defined(TIMER_LEVEL) && (TIMER_LEVEL <= 0) + timer_stop ("adios_write"); +#endif + // printf ("var: %s written %d\n", v->name, v->write_count); + return adios_errno; +} + +/////////////////////////////////////////////////////////////////////////////// +int common_adios_get_write_buffer (int64_t fd_p, const char * name + ,uint64_t * size + ,void ** buffer + ) +{ + struct adios_file_struct * fd = (struct adios_file_struct *) fd_p; + adios_errno = err_no_error; + if (!fd) + { + adios_error (err_invalid_file_pointer, "Invalid handle passed to adios_group_size\n"); + return adios_errno; + } + struct adios_var_struct * v = fd->group->vars; + struct adios_method_list_struct * m = fd->group->methods; + + v = adios_find_var_by_name (fd->group, name); + + if (!v) + { + adios_error (err_invalid_varname, "Bad var name (ignored): '%s' (%c%c%c)\n", + name, name[0], name[1], name[2]); + return adios_errno; + } + + if (fd->mode == adios_mode_read) + { + adios_error (err_invalid_file_mode, + "write attempted on %s in %s. This was opened for read\n", + name , fd->name); + return adios_errno; + } + + // since we are only getting one buffer, get it from the first + // transport method that can provide it. + while (m) + { + if ( m->method->m != ADIOS_METHOD_UNKNOWN + && m->method->m != ADIOS_METHOD_NULL + && adios_transports [m->method->m].adios_get_write_buffer_fn + ) + { + adios_transports [m->method->m].adios_get_write_buffer_fn + (fd, v, size, buffer, m->method); + m = 0; + } + else + m = m->next; + } + + return adios_errno; +} + +/////////////////////////////////////////////////////////////////////////////// + +int common_adios_read (int64_t fd_p, const char * name, void * buffer + ,uint64_t buffer_size + ) +{ + struct adios_file_struct * fd = (struct adios_file_struct *) fd_p; + adios_errno = err_no_error; + if (!fd) + { + adios_error (err_invalid_file_pointer, "Invalid handle passed to adios_group_size\n"); + + return adios_errno; + } + struct adios_var_struct * v; + struct adios_method_list_struct * m = fd->group->methods; + + if (m && m->next == NULL && m->method->m == ADIOS_METHOD_NULL) + { + // nothing to do so just return + return err_no_error; + } + + if (!(fd->mode == adios_mode_read)) + { + adios_error (err_invalid_file_mode, + "read attempted on %s which was opened for write\n", + fd->name); + + return adios_errno; + } + + v = adios_find_var_by_name (fd->group, name); + if (v) + { + // since can only read from one place into the buffer, + // read from the first transport method that can + while (m) + { + if ( m->method->m != ADIOS_METHOD_UNKNOWN + && m->method->m != ADIOS_METHOD_NULL + && adios_transports [m->method->m].adios_read_fn + ) + { + adios_transports [m->method->m].adios_read_fn + (fd, v, buffer, buffer_size, m->method); + m = 0; + } + else + m = m->next; + } + } + else + { + adios_error (err_invalid_varname, "var %s in file %s not found on read\n", + name, fd->name); + + return adios_errno; + } + + return adios_errno; +} + +/////////////////////////////////////////////////////////////////////////////// +// OBSOLETE, kept only for backward compatibility +int common_adios_set_path (int64_t fd_p, const char * path) +{ + struct adios_file_struct * fd = (struct adios_file_struct *) fd_p; + adios_errno = err_no_error; + if (!fd) + { + adios_error (err_invalid_file_pointer, "Invalid handle passed to adios_set_path\n"); + + return adios_errno; + } + struct adios_group_struct * t = fd->group; + struct adios_var_struct * v = t->vars; + struct adios_attribute_struct * a = t->attributes; + + while (v) + { + if (v->path) + { + free (v->path); + } + + v->path = strdup (path); + + v = v->next; + } + + while (a) + { + // skip internal attributes + if (a->path && strstr (a->path, "__adios__")) + { + a = a->next; + continue; + } + + if (a->path) + { + free (a->path); + } + + a->path = strdup (path); + + a = a->next; + } + + return adios_errno; +} + +/////////////////////////////////////////////////////////////////////////////// +// OBSOLETE, kept only for backward compatibility +// Inconsistent behavior with new ADIOS variable naming +// The variable is not replaced with the new path in the hash table here, so +// it is still found using the old path! +int common_adios_set_path_var (int64_t fd_p, const char * path + ,const char * name + ) +{ + struct adios_file_struct * fd = (struct adios_file_struct *) fd_p; + adios_errno = err_no_error; + if (!fd) + { + adios_error (err_invalid_file_pointer, "Invalid handle passed to adios_set_path_var\n"); + + return adios_errno; + } + struct adios_group_struct * t = fd->group; + struct adios_var_struct * v = t->vars; + + // check for vars and then attributes + v = adios_find_var_by_name (t, name); + + if (v) + { + if (v->path) + { + free (v->path); + } + + v->path = strdup (path); + + /* Possible new behavior: replace the old path with the new path + * in the hash table so that the variable is found by + * the new path. Inconsistent with old codes that only used + * the variable name without the path in adios_write() + */ + //remove var from hash table by old fullpath... + //t->hashtbl_vars->remove (t->hashtbl_vars, name); + // and add it back with new fullpath + //t->hashtbl_vars->put2 (t->hashtbl_vars, v->path, v->name, v); + + } + else + { + adios_error (err_invalid_varname, + "adios_set_path_var (path=%s, var=%s): var not found\n", + path, name); + + return adios_errno; + } + + return adios_errno; +} + +/////////////////////////////////////////////////////////////////////////////// +// hint that we reached the end of an iteration (for asynchronous pacing) +int common_adios_end_iteration () +{ + struct adios_method_list_struct * m; + + adios_errno = err_no_error; + for (m = adios_get_methods (); m; m = m->next) + { + if ( m->method->m != ADIOS_METHOD_UNKNOWN + && m->method->m != ADIOS_METHOD_NULL + && adios_transports [m->method->m].adios_end_iteration_fn + ) + { + adios_transports [m->method->m].adios_end_iteration_fn + (m->method); + } + } + + return adios_errno; +} + +/////////////////////////////////////////////////////////////////////////////// +// hint to start communicating +int common_adios_start_calculation () +{ + struct adios_method_list_struct * m; + + adios_errno = err_no_error; + for (m = adios_get_methods (); m; m = m->next) + { + if ( m->method->m != ADIOS_METHOD_UNKNOWN + && m->method->m != ADIOS_METHOD_NULL + && adios_transports [m->method->m].adios_start_calculation_fn + ) + { + adios_transports [m->method->m].adios_start_calculation_fn + (m->method); + } + } + + return adios_errno; +} + +/////////////////////////////////////////////////////////////////////////////// +// hint to stop communicating +int common_adios_stop_calculation () +{ + struct adios_method_list_struct * m; + + adios_errno = err_no_error; + for (m = adios_get_methods (); m; m = m->next) + { + if ( m->method->m != ADIOS_METHOD_UNKNOWN + && m->method->m != ADIOS_METHOD_NULL + && adios_transports [m->method->m].adios_stop_calculation_fn + ) + { + adios_transports [m->method->m].adios_stop_calculation_fn + (m->method); + } + } + + return adios_errno; +} + +/////////////////////////////////////////////////////////////////////////////// +int common_adios_close (int64_t fd_p) +{ +#if defined(WITH_NCSU_TIMER) && defined(TIMER_LEVEL) && (TIMER_LEVEL <= 0) + timer_start ("adios_close"); +#endif + adios_errno = err_no_error; + + struct adios_file_struct * fd = (struct adios_file_struct *) fd_p; + if (!fd) + { + adios_error (err_invalid_file_pointer, "Invalid handle passed to adios_close\n"); + + return adios_errno; + } + struct adios_method_list_struct * m = fd->group->methods; + if (m && m->next == NULL && m->method->m == ADIOS_METHOD_NULL) + { + // nothing to do so just return +#if defined(WITH_NCSU_TIMER) && defined(TIMER_LEVEL) && (TIMER_LEVEL <= 0) + timer_stop ("adios_close"); + timer_stop ("adios_open_to_close"); +#endif + return 0; + } + + struct adios_attribute_struct * a = fd->group->attributes; + struct adios_var_struct * v = fd->group->vars; + + if (fd->shared_buffer == adios_flag_yes) + { + adios_write_close_vars_v1 (fd); + + /* FIXME: this strategy writes all attributes defined in time step 0 + and thus duplicates them in the PGs and in the attribute index. + For write mode, where files are new, this is good. + For append/update it is unnecessary and replicates the attributes + in the index. + One should write the newly created attributes only in append mode. + */ + adios_write_open_attributes_v1 (fd); + + if (!fd->group->process_id || fd->subfile_index != -1) { + // from ADIOS 1.4, only rank 0 writes attributes (or to subfiles) + while (a) { + adios_write_attribute_v1 (fd, a); + a = a->next; + } + } + + adios_write_close_attributes_v1 (fd); + } + + // in order to get the index assembled, we need to do it in the + // transport once we have collected all of the pieces + + // now tell all of the transports to write the buffer during close + for (;m; m = m->next) + { + if ( m->method->m != ADIOS_METHOD_UNKNOWN + && m->method->m != ADIOS_METHOD_NULL + && adios_transports [m->method->m].adios_close_fn + ) + { + adios_transports [m->method->m].adios_close_fn + (fd, m->method); + } + } + + if (fd->shared_buffer == adios_flag_yes) + { + adios_method_buffer_free (fd->write_size_bytes); + free (fd->buffer); + fd->buffer_size = 0; + fd->buffer = 0; + fd->offset = 0; + } + + while (v) + { + v->write_offset = 0; + if (v->data) + { + free (v->data); + v->data = 0; + } + + v = v->next; + } + + while (fd->group->vars_written) + { + if (fd->group->vars_written->name) + free (fd->group->vars_written->name); + if (fd->group->vars_written->path) + free (fd->group->vars_written->path); + + while (fd->group->vars_written->dimensions) + { + struct adios_dimension_struct * dimensions + = fd->group->vars_written->dimensions->next; + + free (fd->group->vars_written->dimensions); + fd->group->vars_written->dimensions = dimensions; + } + + // NCSU - Clear stat + if (fd->group->vars_written->stats) + { + uint8_t j = 0, idx = 0; + uint8_t c = 0, count = adios_get_stat_set_count(fd->group->vars_written->type); + + for (c = 0; c < count; c ++) + { + while (fd->group->vars_written->bitmap >> j) + { + if ((fd->group->vars_written->bitmap >> j) & 1) + { + if (j == adios_statistic_hist) + { + struct adios_hist_struct * hist = (struct adios_hist_struct *) (fd->group->vars_written->stats[c][idx].data); + free (hist->breaks); + free (hist->frequencies); + free (hist); + } + else + free (fd->group->vars_written->stats[c][idx].data); + + idx ++; + } + j ++; + } + free (fd->group->vars_written->stats[c]); + } + free (fd->group->vars_written->stats); + } + + // NCSU ALACRITY-ADIOS - Clear transform metadata + adios_transform_clear_transform_var(fd->group->vars_written); + + if (fd->group->vars_written->data) + free (fd->group->vars_written->data); + + v = fd->group->vars_written->next; + free (fd->group->vars_written); + fd->group->vars_written = v; + } + + +#ifdef ADIOS_TIMER_EVENTS + char* extension = ".perf"; + int name_len = strlen (fd->name); + int fn_len = name_len + strlen (extension) + 1; + char* fn = (char*) malloc (sizeof (char) * fn_len); + + sprintf (fn, "%s%s", fd->name, extension); + + adios_timing_write_xml_common (fd_p, fn); +#endif + + + if (fd->name) + { + free (fd->name); + fd->name = 0; + } + + if (fd->comm != MPI_COMM_NULL) { + MPI_Comm_free (&fd->comm); + } + + free ((void *) fd_p); +#if defined(WITH_NCSU_TIMER) && defined(TIMER_LEVEL) && (TIMER_LEVEL <= 0) + timer_stop ("adios_close"); + timer_stop ("adios_open_to_close"); +// printf ("Timers, "); +// printf ("%d, ", fd->group->process_id); +// printf ("%d, ", fd->group->time_index); +// printf ("%lf, ", timer_get_total_interval ("adios_open" )); +// printf ("%lf, ", timer_get_total_interval ("adios_group_size")); +// printf ("%lf, ", timer_get_total_interval ("adios_transform" )); +// printf ("%lf, ", timer_get_total_interval ("adios_write" )); +// printf ("%lf\n", timer_get_total_interval ("adios_close" )); +// timer_reset_timers (); + + printf("[TIMERS] Proc: %d Time: %d ", fd->group->process_id, fd->group->time_index); + int i; + timer_result_t *results = timer_get_results_sorted(); + for (i = 0; i < timer_get_num_timers(); i++) { + printf("%s: %0.4lf ", results[i].name, results[i].time); + } + printf("\n"); + free(results); + + //timer_reset_timers (); +#endif + + + return adios_errno; +} + +////////////////////////////////////////////////////////////////////////////// +// Methods normally only called by the XML parser +////////////////////////////////////////////////////////////////////////////// + +// adios_common_declare_group is in adios_internals.c +// adios_common_define_var is in adios_internals.c +// adios_common_define_attribute is in adios_internals.c +// adios_common_select_method is in adios_internals.c diff --git a/tests/libs/adios/src/core/common_adios.h b/tests/libs/adios/src/core/common_adios.h new file mode 100644 index 0000000000..32b63cf281 --- /dev/null +++ b/tests/libs/adios/src/core/common_adios.h @@ -0,0 +1,68 @@ +/* + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + */ + +#ifndef COMMON_ADIOS_H +#define COMMON_ADIOS_H + +#include +#include "public/adios_types.h" +#include "core/adios_internals.h" + +/* Write functions for ADIOS + * + * Used by the write C api (adios.c) and Fortran api (adiosf.c) + */ + +// Global setup using the XML file +int common_adios_init (const char * config, MPI_Comm comm); + +// setup, but all XML file pieces will be provided by another series of calls +// yet to be worked out +// TODO +int common_adios_init_noxml (MPI_Comm comm); + +int common_adios_finalize (int mype); + +int common_adios_allocate_buffer (enum ADIOS_BUFFER_ALLOC_WHEN adios_buffer_alloc_when + ,uint64_t buffer_size); + +// end user calls for each I/O operation +// modes = "r" = "read", "w" = "write", "a" = "append", "u" = "update" +int common_adios_open (int64_t * fd, const char * group_name, const char * name + ,const char * mode, MPI_Comm comm + ); + +int common_adios_group_size (int64_t fd_p, uint64_t data_size + ,uint64_t * total_size + ); + +//int common_adios_write (int64_t fd_p, const char * name, void * var); +int common_adios_write (struct adios_file_struct * fd, struct adios_var_struct * v, void * var); +int common_adios_write_byid (struct adios_file_struct * fd, struct adios_var_struct * v, void * var); + +int common_adios_get_write_buffer (int64_t fd_p, const char * name + ,uint64_t * size + ,void ** buffer + ); + +int common_adios_read (int64_t fd_p, const char * name, void * buffer + ,uint64_t buffer_size + ); + +int common_adios_set_path (int64_t fd_p, const char * path); + +int common_adios_set_path_var (int64_t fd_p, const char * path, const char * name); + +int common_adios_end_iteration (void); + +int common_adios_start_calculation (void); + +int common_adios_stop_calculation (void); + +int common_adios_close (int64_t fd_p); + +#endif diff --git a/tests/libs/adios/src/core/common_read.c b/tests/libs/adios/src/core/common_read.c new file mode 100644 index 0000000000..768a0457d5 --- /dev/null +++ b/tests/libs/adios/src/core/common_read.c @@ -0,0 +1,3745 @@ +/* + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + */ + +#include +#include +#include +#include +#include +#include +#include "adios_error.h" +#include "core/adios_logger.h" +#include "core/common_read.h" +#include "core/adios_infocache.h" +#include "core/futils.h" +#include "core/bp_utils.h" // struct namelists_struct +#include "core/qhashtbl.h" +#include "query/common_query.h" // finalize query methods +#include "adios_schema.h" +#include "adios_read_ext.h" + +// NCSU ALACRITY-ADIOS +#include "adios_read_hooks.h" +#include "transforms/adios_transforms_transinfo.h" +#include "transforms/adios_transforms_hooks_read.h" +#include "transforms/adios_transforms_reqgroup.h" +#include "transforms/adios_transforms_datablock.h" +#define BYTE_ALIGN 8 + +#ifdef DMALLOC +#include "dmalloc.h" +#endif + + +/* Note: MATLAB reloads the mex64 files each time, so all static variables get the original value. + Therefore static variables cannot be used to pass info between two Matlab/ADIOS calls */ +static struct adios_read_hooks_struct * adios_read_hooks = 0; + +struct common_read_internals_struct { + enum ADIOS_READ_METHOD method; + struct adios_read_hooks_struct * read_hooks; /* Save adios_read_hooks for each fopen for Matlab */ + + /* Group view information *//* Actual method provides the group names */ + int ngroups; + char ** group_namelist; + uint32_t * nvars_per_group; /* # of variables per each group */ + uint32_t * nattrs_per_group; /* # of attributes per each group */ + int group_in_view; /* 0..ngroups-1: selected group in view, + -1: all groups */ + uint64_t group_varid_offset; /* offset of var IDs from specific group to full list + if a selected group is in view */ + uint64_t group_attrid_offset; + uint32_t full_nvars; /* fp->nvars to save here for a group view */ + char ** full_varnamelist; /* fp->var_namelist to save here if one group is viewed */ + uint32_t full_nattrs; /* fp->nvars to save here for a group view */ + char ** full_attrnamelist; /* fp->attr_namelist to save here if one group is viewed */ + qhashtbl_t *hashtbl_vars; /* speed up search for var_namelist to varid */ + + // NCSU ALACRITY-ADIOS - Table of sub-requests issued by transform method + adios_transform_read_request *transform_reqgroups; + + // NCSU ALACRITY-ADIOS - The view mode of this file + data_view_t data_view; + + // Cache of VARINFOs and TRANSINFOs, only used internally by ADIOS at the moment + adios_infocache *infocache; +}; + +// NCSU ALACRITY-ADIOS - Forward declaration/function prototypes +static void common_read_free_blockinfo(ADIOS_VARBLOCK **varblock, int sum_nblocks); + + + +int common_read_init_method (enum ADIOS_READ_METHOD method, + MPI_Comm comm, + const char * parameters) +{ + PairStruct *params, *p, *prev_p; + int verbose_level, removeit, save; + int retval; + char *end; + + adios_errno = err_no_error; + if ((int)method < 0 || (int)method >= ADIOS_READ_METHOD_COUNT) { + adios_error (err_invalid_read_method, + "Invalid read method (=%d) passed to adios_read_init_method().\n", (int)method); + return err_invalid_read_method; + } + // init the adios_read_hooks_struct if not yet initialized + adios_read_hooks_init (&adios_read_hooks); + // NCSU ALACRITY-ADIOS - Initialize transform methods + adios_transform_read_init(); + + if (!adios_read_hooks[method].adios_read_init_method_fn) { + adios_error (err_invalid_read_method, + "Read method (=%d) passed to adios_read_init_method() is not provided " + "by this build of ADIOS.\n", (int)method); + return err_invalid_read_method; + } + + // process common parameters here + params = text_to_name_value_pairs (parameters); + p = params; + prev_p = NULL; + while (p) { + removeit = 0; + if (!strcasecmp (p->name, "verbose")) + { + if (p->value) { + errno = 0; + verbose_level = strtol(p->value, &end, 10); + if (errno || (end != 0 && *end != '\0')) { + log_error ("Invalid 'verbose' parameter passed to read init function: '%s'\n", p->value); + verbose_level = 1; // print errors only + } + } else { + verbose_level = 3; // info level + } + adios_verbose_level = verbose_level; + removeit = 1; + } + else if (!strcasecmp (p->name, "quiet")) + { + adios_verbose_level = 0; //don't print errors + removeit = 1; + } + else if (!strcasecmp (p->name, "logfile")) + { + if (p->value) { + adios_logger_open (p->value, -1); + } + removeit = 1; + } + else if (!strcasecmp (p->name, "abort_on_error")) + { + adios_abort_on_error = 1; + save = adios_verbose_level; + adios_verbose_level = 2; + log_warn ("ADIOS is set to abort on error\n"); + adios_verbose_level = save; + removeit = 1; + } + if (removeit) { + if (p == params) { + // remove head + p = p->next; + params->next = NULL; + free_name_value_pairs (params); + params = p; + } else { + // remove from middle of the list + prev_p->next = p->next; + p->next = NULL; + free_name_value_pairs (p); + p = prev_p->next; + } + } else { + prev_p = p; + p = p->next; + } + } + + // call method specific init + retval = adios_read_hooks[method].adios_read_init_method_fn (comm, params); + free_name_value_pairs (params); + + // init the query API; may call it multiple times here in multiple read methods' init; + common_query_init(); + + return retval; +} + +static int calc_hash_size(unsigned int nvars) +{ + int hash_size; + if (nvars < 100) hash_size = nvars; // best speed for most codes + else if (nvars < 1000) hash_size = 100+nvars/10; // 100..999 variables + else if (nvars < 10000) hash_size = 200+nvars/20; // 1000..9999 + else if (nvars < 100000) hash_size = 200+nvars/20; // 10k..99999 + else hash_size = 10000; // 100k.. + return hash_size; +} + +int common_read_finalize_method(enum ADIOS_READ_METHOD method) +{ + adios_errno = err_no_error; + int retval; + if ((int)method < 0 || (int)method >= ADIOS_READ_METHOD_COUNT) { + adios_error (err_invalid_read_method, + "Invalid read method (=%d) passed to adios_read_finalize_method().\n", (int)method); + retval = err_invalid_read_method; + } else if (!adios_read_hooks[method].adios_read_finalize_method_fn) { + adios_error (err_invalid_read_method, + "Read method (=%d) passed to adios_read_finalize_method() is not provided " + "by this build of ADIOS.\n", (int)method); + retval = err_invalid_read_method; + } else { + retval = adios_read_hooks[method].adios_read_finalize_method_fn (); + } + + // finalize the query API; may call it multiple times here in multiple read methods' finalize; + common_query_finalize(); + return retval; +} + +static ADIOS_FILE * common_read_mesh (ADIOS_FILE * fp) +{ + int i; + //read mesh names from attributes for example the var is using a mesh named trimesh, + //we have /adios_schema/trimesh/type. We can extract trimesh from the string + fp->nmeshes = 0; + fp->mesh_namelist = NULL; + + if (fp->attr_namelist) + { + char ** tmp = (char **) malloc (sizeof(char*) * fp->nattrs); + for (i=0; inattrs; i++) + { + // find "/adios_schema/***/type" attributes for getting the names of meshes + if (strstr (fp->attr_namelist[i], "/adios_schema/") == fp->attr_namelist[i]) // starts with /adios_schema/ + { + char *s = fp->attr_namelist[i]+strlen("/adios_schema/"); + char *p = strchr (s, '/'); + if ( p && + strstr (p, "/type") == p) + { + // retrieve the name of the mesh + int samemesh = 0; + int imesh; + if (fp->nmeshes > 0) + { + char * meshname = NULL; + memcpy ( meshname, s, (size_t)(p-s) ); + for (imesh=0; imeshnmeshes; imesh++) + { + if (!strcmp (meshname, tmp[imesh])) + samemesh = 1; + } + } + if (!fp->nmeshes || !samemesh) + { + tmp [ fp->nmeshes ] = (char *) malloc (sizeof(char*) * (size_t)(p-s)+1); + memcpy ( tmp[ fp->nmeshes ], s, (size_t)(p-s) ); + tmp[ fp->nmeshes ][(p-s)] = '\0'; + fp->nmeshes++; + } + } + } + // find ".../adios_schema" mesh references that may be external file references + char *last = rindex (fp->attr_namelist[i], '/'); // last piece in the full path + if (last && !strcmp(last, "/adios_schema") ) // ends with /adios_schema + { + enum ADIOS_DATATYPES attr_type; + int attr_size; + char * meshname = NULL; + int read_fail = 0; + //check if this name refers to an external mesh + common_read_get_attr_mesh (fp, fp->attr_namelist[i], &attr_type, &attr_size, &meshname); + if (attr_type == adios_string) + { + char * meshfile = malloc ( strlen("/adios_schema/")+strlen(meshname)+strlen("/mesh-file")+1 ); + strcpy (meshfile, "/adios_schema/"); + strcat (meshfile, meshname); + strcat (meshfile, "/mesh-file"); + char * data = NULL; + read_fail = common_read_get_attr_mesh (fp, meshfile, &attr_type, &attr_size, &data); + if (!read_fail) + { + int samemesh = 0; + int imesh; + if (fp->nmeshes > 0) + { + for (imesh=0; imeshnmeshes; imesh++) + { + if (!strcmp (meshname, tmp[imesh])) + samemesh = 1; + } + } + if (!fp->nmeshes || !samemesh) + { + tmp [ fp->nmeshes ] = strdup (meshname); + fp->nmeshes++; + } + free(data); + // user has to open the file and call common_read_complete_meshinfo() again with both file pointers + } + free (meshfile); + free (meshname); + } + } + } + + if (fp->nmeshes) + { + fp->mesh_namelist = (char **) realloc (tmp, sizeof (char *) * fp->nmeshes); + assert (fp->mesh_namelist); + } else { + free (tmp); + } + } + + return fp; +} + +ADIOS_FILE * common_read_open (const char * fname, + enum ADIOS_READ_METHOD method, + MPI_Comm comm, + enum ADIOS_LOCKMODE lock_mode, + float timeout_sec) +{ + ADIOS_FILE * fp; + struct common_read_internals_struct * internals; + long i; + + if ((int)method < 0 || (int)method >= ADIOS_READ_METHOD_COUNT) { + adios_error (err_invalid_read_method, + "Invalid read method (=%d) passed to adios_read_open().\n", (int)method); + return NULL; + } + + adios_errno = err_no_error; + internals = (struct common_read_internals_struct *) + calloc(1,sizeof(struct common_read_internals_struct)); + // init the adios_read_hooks_struct if not yet initialized + adios_read_hooks_init (&adios_read_hooks); + // NCSU ALACRITY-ADIOS - Initialize transform methods + adios_transform_read_init(); + + if (!adios_read_hooks[method].adios_read_open_fn) { + adios_error (err_invalid_read_method, + "Read method (=%d) passed to adios_read_open() is not provided " + "by this build of ADIOS.\n", (int)method); + return NULL; + } + + internals->method = method; + internals->read_hooks = adios_read_hooks; + + // NCSU ALACRITY-ADIOS - Added a data view field, which by default starts in logical view mode + internals->data_view = LOGICAL_DATA_VIEW; + + // NCSU ALACRITY-ADIOS - Added allocation of infocache for more efficient read processing with transforms + internals->infocache = adios_infocache_new(); + + fp = adios_read_hooks[internals->method].adios_read_open_fn (fname, comm, lock_mode, timeout_sec); + if (!fp) + return fp; + + fp->is_streaming = 1; // Mark file handle as streaming + + // create hashtable from the variable names as key and their index as value + int hashsize = calc_hash_size(fp->nvars); + internals->hashtbl_vars = qhashtbl(hashsize); + for (i=0; invars; i++) { + internals->hashtbl_vars->put (internals->hashtbl_vars, fp->var_namelist[i], + (void *)(i+1)); // avoid 0 for error checking later + } + + // save the method and group information in fp->internal_data + if (fp){ + adios_read_hooks[internals->method].adios_get_groupinfo_fn (fp, &internals->ngroups, + &internals->group_namelist, &internals->nvars_per_group, &internals->nattrs_per_group); + internals->group_in_view = -1; + internals->group_varid_offset = 0; + internals->group_attrid_offset = 0; + fp->internal_data = (void *)internals; + } else { + free (internals); + } + + common_read_mesh (fp); + + return fp; +} + + +ADIOS_FILE * common_read_open_file (const char * fname, + enum ADIOS_READ_METHOD method, + MPI_Comm comm) +{ + ADIOS_FILE * fp; + struct common_read_internals_struct * internals; + long i; + + if ((int)method < 0 || (int)method >= ADIOS_READ_METHOD_COUNT) { + adios_error (err_invalid_read_method, + "Invalid read method (=%d) passed to adios_read_open_file().\n", (int)method); + return NULL; + } + + adios_errno = err_no_error; + internals = (struct common_read_internals_struct *) + calloc(1,sizeof(struct common_read_internals_struct)); + // init the adios_read_hooks_struct if not yet initialized + adios_read_hooks_init (&adios_read_hooks); + // NCSU ALACRITY-ADIOS - Initialize transform methods + adios_transform_read_init(); + + internals->method = method; + internals->read_hooks = adios_read_hooks; + + // NCSU ALACRITY-ADIOS - Added a data view field, which by default starts in logical view mode + internals->data_view = LOGICAL_DATA_VIEW; + + // NCSU ALACRITY-ADIOS - Added allocation of infocache for more efficient read processing with transforms + internals->infocache = adios_infocache_new(); + + if (!adios_read_hooks[internals->method].adios_read_open_file_fn) { + adios_error (err_invalid_read_method, + "Read method (=%d) passed to adios_read_open_file() is not provided " + "by this build of ADIOS.\n", (int)method); + return NULL; + } + + fp = adios_read_hooks[internals->method].adios_read_open_file_fn (fname, comm); + if (!fp) + return fp; + + fp->is_streaming = 0; // Mark file handle as not streaming + + // create hashtable from the variable names as key and their index as value + int hashsize = calc_hash_size(fp->nvars); + internals->hashtbl_vars = qhashtbl(hashsize); + for (i=0; invars; i++) { + internals->hashtbl_vars->put (internals->hashtbl_vars, fp->var_namelist[i], + (void *)(i+1)); // avoid 0 for error checking later + } + + // save the method and group information in fp->internal_data + if (fp){ + adios_read_hooks[internals->method].adios_get_groupinfo_fn (fp, &internals->ngroups, + &internals->group_namelist, &internals->nvars_per_group, &internals->nattrs_per_group); + internals->group_in_view = -1; + internals->group_varid_offset = 0; + internals->group_attrid_offset = 0; + fp->internal_data = (void *)internals; + } else { + free (internals); + } + + common_read_mesh (fp); + + return fp; +} + +// NCSU ALACRITY-ADIOS - Cleanup for read request groups +#define MYFREE(p) {if (p) free((void*)(p)); (p)=NULL;} +static void clean_up_read_reqgroups(adios_transform_read_request **reqgroups_head) { + adios_transform_read_request *removed; + while ((removed = adios_transform_read_request_pop(reqgroups_head)) != NULL) { + adios_transform_read_request_free(&removed); + } +} +#undef MYFREE + +int common_read_close (ADIOS_FILE *fp) +{ + struct common_read_internals_struct * internals; + int retval; + + adios_errno = err_no_error; + if (fp) { + internals = (struct common_read_internals_struct *) fp->internal_data; + if (internals->group_in_view != -1) { + // reset from group view before calling the real close + common_read_group_view (fp, -1); + } + int i; + if (fp->nmeshes) { + for (i=0; inmeshes; i++) + free(fp->mesh_namelist[i]); + free(fp->mesh_namelist); + } + + retval = internals->read_hooks[internals->method].adios_read_close_fn (fp); + free_namelist (internals->group_namelist, internals->ngroups); + free (internals->nvars_per_group); + free (internals->nattrs_per_group); + + // NCSU ALACRITY-ADIOS - Cleanup read request groups and infocache + clean_up_read_reqgroups(&internals->transform_reqgroups); + + adios_infocache_free(&internals->infocache); + + if (internals->hashtbl_vars) + internals->hashtbl_vars->free (internals->hashtbl_vars); + + free (internals); + } else { + adios_error ( err_invalid_file_pointer, "Invalid file pointer at adios_read_close()\n"); + retval = err_invalid_file_pointer; + } + return retval; +} + +adios_infocache * common_read_get_file_infocache(ADIOS_FILE *fp) { + struct common_read_internals_struct *internals = (struct common_read_internals_struct *)fp->internal_data; + return internals->infocache; +} + +// NCSU ALACRITY-ADIOS +data_view_t common_read_get_data_view(const ADIOS_FILE *fp) { + const struct common_read_internals_struct *internals = (const struct common_read_internals_struct *) fp->internal_data; + return internals->data_view; +} +data_view_t common_read_set_data_view(ADIOS_FILE *fp, data_view_t data_view) { + struct common_read_internals_struct *internals = (struct common_read_internals_struct *) fp->internal_data; + const data_view_t old_data_view = internals->data_view; + internals->data_view = data_view; + return old_data_view; +} + +// What is the dimension order of arrays in the file? +// 0: C ordering (row-major), last dimension is the fastest dimension +// 1: Fortran ordering (column-major), first dimension is the fastest dimension +int common_read_get_dimension_order (ADIOS_FILE * fp) +{ + struct common_read_internals_struct * internals; + int retval; + adios_errno = err_no_error; + if (fp) { + internals = (struct common_read_internals_struct *) fp->internal_data; + retval = internals->read_hooks[internals->method].adios_get_dimension_order_fn (fp); + } else { + adios_error (err_invalid_file_pointer, "Null pointer passed as file to adios_get_dimension_ordering()\n"); + retval = err_invalid_file_pointer; + } + return retval; +} + + +void common_read_reset_dimension_order (const ADIOS_FILE *fp, int is_fortran) +{ + struct common_read_internals_struct * internals; + + adios_errno = err_no_error; + if (fp) { + internals = (struct common_read_internals_struct *) fp->internal_data; + internals->read_hooks[internals->method].adios_reset_dimension_order_fn (fp, is_fortran); + } else { + adios_error ( err_invalid_file_pointer, "Invalid file pointer at adios_reset_dimension_order()\n"); + } +} + + +int common_read_advance_step (ADIOS_FILE *fp, int last, float timeout_sec) +{ + struct common_read_internals_struct * internals; + int hashsize; + int retval; + long i; + + adios_errno = err_no_error; + if (fp) { + internals = (struct common_read_internals_struct *) fp->internal_data; + retval = internals->read_hooks[internals->method].adios_advance_step_fn (fp, last, timeout_sec); + if (!retval) { + // Re-create hashtable from the variable names as key and their index as value + if (internals->hashtbl_vars) + internals->hashtbl_vars->free (internals->hashtbl_vars); + hashsize = calc_hash_size(fp->nvars); + internals->hashtbl_vars = qhashtbl(hashsize); + for (i=0; invars; i++) { + internals->hashtbl_vars->put (internals->hashtbl_vars, fp->var_namelist[i], + (void *)(i+1)); // avoid 0 for error checking later + } + + // Invalidate infocache, since all varinfos may have changed now + adios_infocache_invalidate(internals->infocache); + + /* Update group information too */ + free_namelist (internals->group_namelist, internals->ngroups); + free (internals->nvars_per_group); + free (internals->nattrs_per_group); + adios_read_hooks[internals->method].adios_get_groupinfo_fn (fp, &internals->ngroups, + &internals->group_namelist, &internals->nvars_per_group, &internals->nattrs_per_group); + if (internals->group_in_view > -1) { + /* if we have a group view, we need to update the presented list again */ + /* advance_step updated fp->nvars, nattrs, var_namelist, attr_namelist */ + int groupid = internals->group_in_view; + internals->group_in_view = -1; // we have the full view at this moment + common_read_group_view (fp, groupid); + } + } + } else { + adios_error ( err_invalid_file_pointer, "Invalid file pointer at adios_advance_step()\n"); + retval = err_invalid_file_pointer; + } + return retval; +} + + +void common_read_release_step (ADIOS_FILE *fp) +{ + struct common_read_internals_struct * internals; + + adios_errno = err_no_error; + if (fp) { + internals = (struct common_read_internals_struct *) fp->internal_data; + internals->read_hooks[internals->method].adios_release_step_fn (fp); + } else { + adios_error ( err_invalid_file_pointer, "Invalid file pointer at adios_reset_dimension_order()\n"); + } +} + +static int common_read_find_var (const ADIOS_FILE *fp, const char *name, int quiet) +{ + /** Find a string name in a list of names and return the index. + Search should work with starting / characters and without. + Create adios error and return -1 if name is null or + if name is not found in the list. + role = 0 for variable search, 1 for attribute search + */ + struct common_read_internals_struct * internals; + int varid = -1; + + adios_errno = err_no_error; + + if (!name) { + if (!quiet) + adios_error (err_invalid_varname, "Null pointer passed as variable name!\n"); + else + adios_errno = err_invalid_varname; + return -1; + } + + if (fp) { + internals = (struct common_read_internals_struct *) fp->internal_data; + + // Double cast makes the compiler happy... + varid = (int)(int64_t)internals->hashtbl_vars->get (internals->hashtbl_vars, name); + // varid=0 is "not found", otherwise +1 bigger than actual varid + varid--; + } + + if (varid == -1) { + if (!quiet) + adios_error (err_invalid_varname, "Variable '%s' is not found!\n", name); + else + adios_errno = err_invalid_varname; + } + return varid; +} + +static int common_read_find_attr (int n, char ** namelist, const char *name, int quiet) +{ + /** Find a string name in a list of names and return the index. + Search should work with starting / characters and without. + Create adios error and return -1 if name is null or + if name is not found in the list. + role = 0 for variable search, 1 for attribute search + */ + int id, nstartpos=0, sstartpos; + char ** s = namelist; + + if (!name) { + if (!quiet) + adios_error (err_invalid_attrname, "Null pointer passed as attribute name!\n"); + else + adios_errno = err_invalid_attrname; + return -1; + } + + // find names with or without beginning / + if (*name == '/') nstartpos = 1; + + for (id=0; id < n; id++) { + if (*s[0] == '/') sstartpos = 1; + else sstartpos = 0; + //DBG_PRINTF(" check %s, startpos=%d\n", *s, sstartpos); + if (!strcmp (*s+sstartpos, name+nstartpos)) + break; // found this name + s++; + } + + if (id == n) { + if (!quiet) + adios_error (err_invalid_attrname, "Attribute '%s' is not found!\n", name); + else + adios_errno = err_invalid_attrname; + return -1; + } + return id; +} + + +ADIOS_VARINFO * common_read_inq_var (const ADIOS_FILE *fp, const char * varname) +{ + ADIOS_VARINFO * retval; + + adios_errno = err_no_error; + if (fp) { + int varid = common_read_find_var (fp, varname, 0); + if (varid >= 0) { + retval = common_read_inq_var_byid (fp, varid); + } else { + retval = NULL; + } + } else { + adios_error (err_invalid_file_pointer, "Null pointer passed as file to adios_inq_var()\n"); + retval = NULL; + } + return retval; +} + +// NCSU ALACRITY-ADIOS - For copying original metadata from transform +// info to inq var info +static void patch_varinfo_with_transform_blockinfo(ADIOS_VARINFO *vi, ADIOS_TRANSINFO *ti) { + common_read_free_blockinfo(&vi->blockinfo, vi->sum_nblocks); // Free blockinfo in varinfo + vi->blockinfo = ti->orig_blockinfo; // Move blockinfo from transinfo to varinfo + ti->orig_blockinfo = 0; // Delink blockinfo from transinfo +} +static void patch_varinfo_with_transinfo(ADIOS_VARINFO *vi, ADIOS_TRANSINFO *ti) { + // First make room for the transform info fields + free(vi->dims); + + // Now move them + vi->type = ti->orig_type; + vi->ndim = ti->orig_ndim; + vi->global = ti->orig_global; + vi->dims = ti->orig_dims; + + // Finally, delink them from the transform info so they aren't inadvertently free'd + ti->orig_dims = 0; + + patch_varinfo_with_transform_blockinfo(vi, ti); // Also move blockinfo if extant +} + +// NCSU ALACRITY-ADIOS - Delegate to the 'inq_var_raw_byid' function, then +// patch the original metadata in from the transform info +ADIOS_VARINFO * common_read_inq_var_byid (const ADIOS_FILE *fp, int varid) +{ + struct common_read_internals_struct * internals; + ADIOS_VARINFO *vi; + ADIOS_TRANSINFO *ti; + + internals = (struct common_read_internals_struct *)fp->internal_data; + + vi = common_read_inq_var_raw_byid(fp, varid); + if (vi == NULL) + return NULL; + + if (internals->data_view == LOGICAL_DATA_VIEW) { // Only translate the varinfo in logical view mode + // NCSU ALACRITY-ADIOS - translate between original and transformed metadata if necessary + ti = common_read_inq_transinfo(fp, vi); // No orig_blockinfo + if (ti && ti->transform_type != adios_transform_none) { + patch_varinfo_with_transinfo(vi, ti); + } + common_read_free_transinfo(vi, ti); + } + + return vi; +} + +// NCSU ALACRITY-ADIOS - Renaming of common_read_inq_var_byid, named 'raw' +// because it is oblivious to the original metadata as stored in TRANSINFO +ADIOS_VARINFO * common_read_inq_var_raw_byid (const ADIOS_FILE *fp, int varid) +{ + struct common_read_internals_struct * internals; + ADIOS_VARINFO * retval; + + adios_errno = err_no_error; + if (fp) { + if (varid >= 0 && varid < fp->nvars) { + internals = (struct common_read_internals_struct *) fp->internal_data; + /* Translate varid to varid in global varlist if a selected group is in view */ + retval = internals->read_hooks[internals->method].adios_inq_var_byid_fn + (fp, varid+internals->group_varid_offset); + if (retval) { + /* Translate real varid to the group varid presented to the user */ + retval->varid = varid; + retval->meshinfo = NULL; // initialize here because it's a common layer addition + } + } else { + adios_error (err_invalid_varid, + "Variable ID %d is not valid adios_inq_var_byid(). " + "Available 0..%d\n", varid, fp->nvars-1); + retval = NULL; + } + } else { + adios_error (err_invalid_file_pointer, "Null pointer passed as file to adios_inq_var_byid()\n"); + retval = NULL; + } + return retval; +} + +// NCSU ALACRITY-ADIOS - common-layer inquiry function to read transform info. +// NOTE: does not follow the normal pattern of adding the info into +// ADIOS_VARINFO because this information should not be sent to the user; +// only in rare cases will a user application need this information (like a +// query engine using an transform-embedded index), in which case that code +// can dive deeper and access this function. Alternatively, if this use case +// becomes more common, a simple 'transform raw' API could be added. +ADIOS_TRANSINFO * common_read_inq_transinfo(const ADIOS_FILE *fp, const ADIOS_VARINFO *vi) { + if (!fp) { + adios_error (err_invalid_file_pointer, + "Null ADIOS_FILE pointer passed to common_read_inq_transinfo()\n"); + return NULL; + } + if (!vi) { + adios_error (err_invalid_argument, + "Null ADIOS_VARINFO pointer passed to common_read_inq_transinfo()\n"); + return NULL; + } + + struct common_read_internals_struct * internals; + internals = (struct common_read_internals_struct *) fp->internal_data; + + ADIOS_TRANSINFO *ti = internals->read_hooks[internals->method].adios_inq_var_transinfo_fn(fp, vi); + return ti; +} + +int common_read_inq_trans_blockinfo(const ADIOS_FILE *fp, const ADIOS_VARINFO *vi, ADIOS_TRANSINFO * ti) { + if (!fp) { + adios_error (err_invalid_argument, + "Null ADIOS_FILE pointer passed to common_read_inq_trans_blockinfo()\n"); + return 1; + } + if (!vi) { + adios_error (err_invalid_argument, + "Null ADIOS_VARINFO pointer passed to common_read_inq_trans_blockinfo()\n"); + return 1; + } + if (!ti) { + adios_error (err_invalid_argument, + "Null ADIOS_TRANSINFO pointer passed to common_read_inq_trans_blockinfo()\n"); + return 1; + } + + struct common_read_internals_struct * internals; + internals = (struct common_read_internals_struct *) fp->internal_data; + return internals->read_hooks[internals->method].adios_inq_var_trans_blockinfo_fn(fp, vi, ti); +} + + + +int common_read_inq_var_stat (const ADIOS_FILE *fp, ADIOS_VARINFO * varinfo, + int per_step_stat, int per_block_stat) +{ + struct common_read_internals_struct * internals; + int retval; + int group_varid; + + adios_errno = err_no_error; + if (fp) { + internals = (struct common_read_internals_struct *) fp->internal_data; + if (varinfo) { + /* Translate group varid presented to the user to the real varid */ + group_varid = varinfo->varid; + varinfo->varid = varinfo->varid + internals->group_varid_offset; + } + retval = internals->read_hooks[internals->method].adios_inq_var_stat_fn (fp, varinfo, per_step_stat, per_block_stat); + /* Translate back real varid to the group varid presented to the user */ + varinfo->varid = group_varid; + } else { + adios_error (err_invalid_file_pointer, "Null pointer passed as file to adios_inq_var_stat()\n"); + retval = err_invalid_file_pointer; + } + return retval; +} + +// NCSU ALACRITY-ADIOS - Delegate to the 'inq_var_blockinfo_raw' function, then +// patch the original metadata in from the transform info +int common_read_inq_var_blockinfo (const ADIOS_FILE *fp, ADIOS_VARINFO * varinfo) +{ + int retval; + struct common_read_internals_struct *internals; + ADIOS_TRANSINFO *ti; + + internals = (struct common_read_internals_struct *)fp->internal_data; + + // If the blockinfo is already loaded, don't load it again + if (varinfo->blockinfo) + return err_no_error; + + // NCSU ALACRITY-ADIOS - translate between original and transformed metadata if necessary + // If we're in logical view mode, and if this variable is transformed, use the transformed blockinfo + if (internals->data_view == LOGICAL_DATA_VIEW) { + ti = common_read_inq_transinfo(fp, varinfo); + if (ti && ti->transform_type != adios_transform_none) { + retval = common_read_inq_trans_blockinfo(fp, varinfo, ti); + if (retval != err_no_error) + return retval; + + patch_varinfo_with_transform_blockinfo(varinfo, ti); + } + common_read_free_transinfo(varinfo, ti); + } + + // If we haven't set the blockinfo yet, either we're in physical view + // mode, or the variable isn't transformed. Either way, use the normal + // blockinfo + if (!varinfo->blockinfo) { + retval = common_read_inq_var_blockinfo_raw(fp, varinfo); + if (retval != err_no_error) + return retval; + } + + return err_no_error; +} + +// NCSU ALACRITY-ADIOS - Renaming of common_read_inq_var_blockinfo, named 'raw' +// because it is oblivious to the original metadata as stored in TRANSINFO +int common_read_inq_var_blockinfo_raw (const ADIOS_FILE *fp, ADIOS_VARINFO * varinfo) +{ + struct common_read_internals_struct * internals; + int retval; + int group_varid; + + adios_errno = err_no_error; + if (fp) { + internals = (struct common_read_internals_struct *) fp->internal_data; + if (varinfo) { + /* Translate group varid presented to the user to the real varid */ + group_varid = varinfo->varid; + varinfo->varid = varinfo->varid + internals->group_varid_offset; + } + retval = internals->read_hooks[internals->method].adios_inq_var_blockinfo_fn (fp, varinfo); + /* Translate back real varid to the group varid presented to the user */ + varinfo->varid = group_varid; + } else { + adios_error (err_invalid_file_pointer, "Null pointer passed as file to adios_inq_var_blockinfo()\n"); + retval = err_invalid_file_pointer; + } + return retval; +} + +#define MYFREE(p) {if (p) free((void*)(p)); (p)=NULL;} +// NCSU ALACRITY-ADIOS - Factored this out to use elsewhere +static void common_read_free_blockinfo(ADIOS_VARBLOCK **varblock, int sum_nblocks) { + if (*varblock) { + int i; + ADIOS_VARBLOCK *bp = *varblock; + for (i = 0; i < sum_nblocks; i++) { + if (bp->start) MYFREE (bp->start); + if (bp->count) MYFREE (bp->count); + bp++; + } + MYFREE(*varblock); + } +} + +void common_read_free_varinfo (ADIOS_VARINFO *vp) +{ + if (vp) { + common_read_free_blockinfo(&vp->blockinfo, vp->sum_nblocks); + + if (vp->statistics) { + ADIOS_VARSTAT *sp = vp->statistics; + if (sp->min && sp->min != vp->value) MYFREE(sp->min); + if (sp->max && sp->max != vp->value) MYFREE(sp->max); + if (sp->avg && sp->avg != vp->value) MYFREE(sp->avg); + if (sp->std_dev) MYFREE(sp->std_dev); + + if (sp->steps) { + int s; + if (sp->steps->mins) { + for(s=0; s < vp->nsteps; s++) if (sp->steps->mins[s]) MYFREE(sp->steps->mins[s]); + MYFREE(sp->steps->mins); + } + if (sp->steps->maxs) { + for(s=0; s < vp->nsteps; s++) if (sp->steps->maxs[s]) MYFREE(sp->steps->maxs[s]); + MYFREE(sp->steps->maxs); + } + if (sp->steps->avgs) { + for(s=0; s < vp->nsteps; s++) if (sp->steps->avgs[s]) MYFREE(sp->steps->avgs[s]); + MYFREE(sp->steps->avgs); + } + if (sp->steps->std_devs) { + for(s=0; s < vp->nsteps; s++) if (sp->steps->std_devs[s]) MYFREE(sp->steps->std_devs[s]); + MYFREE(sp->steps->std_devs); + } + MYFREE(sp->steps); + } + + if (sp->blocks) { + int b, nb = vp->sum_nblocks; + if (sp->blocks->mins) { + for(b = 0; b < nb; b++) if (sp->blocks->mins[b]) MYFREE(sp->blocks->mins[b]); + MYFREE(sp->blocks->mins); + } + if (sp->blocks->maxs) { + for(b = 0; b < nb; b++) if (sp->blocks->maxs[b]) MYFREE(sp->blocks->maxs[b]); + MYFREE(sp->blocks->maxs); + } + if (sp->blocks->avgs) { + for(b = 0; b < nb; b++) if (sp->blocks->avgs[b]) MYFREE(sp->blocks->avgs[b]); + MYFREE(sp->blocks->avgs); + } + if (sp->blocks->std_devs) { + for(b = 0; b < nb; b++) if (sp->blocks->std_devs[b]) MYFREE(sp->blocks->std_devs[b]); + MYFREE(sp->blocks->std_devs); + } + MYFREE(sp->blocks); + } + + if (sp->histogram) { + if (sp->histogram->breaks) MYFREE(sp->histogram->breaks); + if (sp->histogram->frequencies) MYFREE(sp->histogram->frequencies); + if (sp->histogram->gfrequencies) MYFREE(sp->histogram->gfrequencies); + MYFREE(sp->histogram); + } + + MYFREE(vp->statistics); + } + + if (vp->dims) MYFREE(vp->dims); + if (vp->value) MYFREE(vp->value); + if (vp->nblocks) MYFREE(vp->nblocks); + if (vp->meshinfo) MYFREE(vp->meshinfo); + free(vp); + } +} + +// NCSU ALACRITY-ADIOS - Free transform info +void common_read_free_transinfo(const ADIOS_VARINFO *vi, ADIOS_TRANSINFO *ti) { + if (ti) { + if (ti->orig_dims) MYFREE(ti->orig_dims); + if (ti->transform_metadata && ti->should_free_transform_metadata) + MYFREE(ti->transform_metadata); + + if (ti->transform_metadatas) { + if (ti->should_free_transform_metadata) { + int i; + for (i = 0; i < vi->sum_nblocks; i++) + MYFREE(ti->transform_metadatas[i].content); + } + MYFREE(ti->transform_metadatas); + } + + common_read_free_blockinfo(&ti->orig_blockinfo, vi->sum_nblocks); + + free(ti); + } +} +#undef MYFREE + +// the function is the same as common_read_get_attr_byid +// but no ERROR msg print out +// called by common_read_get_attr_mesh +int common_read_get_attr_byid_mesh (const ADIOS_FILE * fp, + int attrid, + enum ADIOS_DATATYPES * type, + int * size, + void ** data) +{ + struct common_read_internals_struct * internals; + int retval; + + adios_errno = err_no_error; + if (fp) { + if (attrid >= 0 && attrid < fp->nattrs) { + internals = (struct common_read_internals_struct *) fp->internal_data; + retval = internals->read_hooks[internals->method].adios_get_attr_byid_fn (fp, attrid+internals->group_attrid_offset, type, size, data); + } else { + retval = err_invalid_attrid; + } + } else { + adios_error (err_invalid_file_pointer, "Null pointer passed as file to adios_read_get_attr_byid()\n"); + retval = err_invalid_file_pointer; + } + return retval; +} + +// this function is almost the same as common_read_get_attr +// just to avoid the ERROR msg when some attributes are not found +// for example spacing/maximum are optinal in uniform mesh +int common_read_get_attr_mesh (const ADIOS_FILE * fp, + const char * attrname, + enum ADIOS_DATATYPES * type, + int * size, + void ** data) +{ + int retval; + + adios_errno = err_no_error; + if (fp) { + int attrid = common_read_find_attr (fp->nattrs, fp->attr_namelist, attrname, 1); + if (attrid > -1) { + retval = common_read_get_attr_byid_mesh (fp, attrid, type, size, data); + } else { + retval = adios_errno; // adios_errno was set in common_read_find_attr + } + } else { + adios_error (err_invalid_file_pointer, "Null pointer passed as file to adios_read_get_attr()\n"); + retval = err_invalid_file_pointer; + } + return retval; +} + +int common_read_inq_var_meshinfo (const ADIOS_FILE *fp, ADIOS_VARINFO * varinfo) +{ + enum ADIOS_DATATYPES attr_type; + int attr_size; + int read_fail = 0; + void * data = NULL; + int i; + int match; + + varinfo->meshinfo = (ADIOS_VARMESH *) malloc (sizeof(ADIOS_VARMESH)); + char * var_name = strdup (fp->var_namelist[varinfo->varid]); +// printf ("var name is %s\n", var_name); + char * var_mesh = malloc (strlen(var_name)+strlen("/adios_schema")+1); + strcpy (var_mesh, var_name); + strcat (var_mesh, "/adios_schema"); + + read_fail = common_read_get_attr_mesh (fp, var_mesh, &attr_type, &attr_size, &data); + if (read_fail) + { +// adios_error (err_no_matching_mesh_var, +// "No matching mesh for var %s.\n", +// var_nme); + varinfo->meshinfo = NULL; + return 1; + } + else + { + match = 0; +// printf ("meshname from attr is %s\n", (char *)data); + for (i=0; inmeshes; i++) + { +// printf ("mesh name is %s\n", fp->mesh_namelist[i]); + if ( !strcmp(fp->mesh_namelist[i], (char *)data)) + { + match = 1; + varinfo->meshinfo->meshid = i; + } + } + if (match == 0) + { +// adios_error (err_mesh_missing, +// "Mesh %s for var %s is not stored in meshlist.\n", +// (char *)data, var_name); + varinfo->meshinfo = NULL; + return 1; + } + } + + // point centering or cell centering + char * data_centering = malloc (strlen(var_mesh)+strlen("/centering")+1); + strcpy (data_centering, var_mesh); + strcat (data_centering, "/centering"); + read_fail = common_read_get_attr_mesh (fp, data_centering, &attr_type, &attr_size, &data); +// printf ("attr data_centering is %s\n", data_centering); + free (data_centering); + free (var_mesh); + if (read_fail) // if no attr for centering + { +// char * meshtype = malloc (strlen("/adios_schema/")+strlen(var_name)+strlen("/type")+1); +// strcpy (meshtype, "/adios_schema/"); +// strcat (meshtype, fp->mesh_namelist[varinfo->meshinfo->meshid]); +// strcat (meshtype, "/type"); +// printf ("attr meshtype is %s\n", meshtype); +// data = NULL; +// read_fail = common_read_get_attr_mesh (fp, meshtype, &attr_type, &attr_size, &data); +// if (read_fail) +// { +// adios_error (err_mesh_name_attr_missing, +// "Mesh name from attr %s is not available\n", +// meshtype); +// free (meshtype); +// return 1; +// } +// else +// { +// free (meshtype); +// if (!strcmp((char *)data, "unstructured")) +// { + adios_error (err_mesh_unstructured_centering_missing, + "Centering info of var %s on mesh %s is required\n", + var_name, fp->mesh_namelist[varinfo->meshinfo->meshid]); + varinfo->meshinfo = NULL; + return 1; +// } +// } + } + else + { + if (!strcmp((char *)data, "point")) + { + varinfo->meshinfo->centering = point; + } + else if (!strcmp((char *)data, "cell")) + { + varinfo->meshinfo->centering = cell; + } + else + { + adios_error (err_mesh_unstructured_centering_invalid, + "Centering method of var %s on mesh %s is not supported (point/cell).\n", + var_name, fp->mesh_namelist[varinfo->meshinfo->meshid]); + varinfo->meshinfo = NULL; + return 1; + } + } + + return 0; +} + +static double common_check_var_type_to_double (enum ADIOS_DATATYPES * type, void * value) +{ + double data; + + if (*type == adios_real) + data = *(float *)value; + else if (*type == adios_double) + data = *(double *)value; + else if (*type == adios_byte) + data = *(signed char *)value; + else if (*type == adios_unsigned_byte) + data = *(unsigned char *)value; + else if (*type == adios_short) + data = *(signed short *)value; + else if (*type == adios_unsigned_short) + data = *(unsigned short *)value; + else if (*type == adios_integer) + data = *(signed int *)value; + else if (*type == adios_unsigned_integer) + data = *(unsigned int *)value; + else if (*type == adios_long) + data = *(signed long long *)value; + else if (*type == adios_unsigned_long) + data = *(unsigned long long *)value; + else if (*type == adios_unknown) + { + adios_error (err_mesh_unifrom_invalid_var_type, + "Provided var type is not supported. " + "Var type only supports (unsigned) char, (unsigned) short, " + "(unsigned) int,(unsigned) long long, float and double\n"); + } + return data; +} + +static uint64_t common_check_var_type_to_uint64 (enum ADIOS_DATATYPES * type, void * value) +{ + uint64_t data; + + if (*type == adios_real) + data = *(float *)value; + else if (*type == adios_double) + data = *(double *)value; + else if (*type == adios_byte) + data = *(signed char *)value; + else if (*type == adios_unsigned_byte) + data = *(unsigned char *)value; + else if (*type == adios_short) + data = *(signed short *)value; + else if (*type == adios_unsigned_short) + data = *(unsigned short *)value; + else if (*type == adios_integer) + data = *(signed int *)value; + else if (*type == adios_unsigned_integer) + data = *(unsigned int *)value; + else if (*type == adios_long) + data = *(signed long long *)value; + else if (*type == adios_unsigned_long) + data = *(unsigned long long *)value; + else if (*type == adios_unknown) + { + adios_error (err_mesh_unifrom_invalid_var_type, + "Provided var type is not supported. " + "Var type only supports (unsigned) char, (unsigned) short, " + "(unsigned) int,(unsigned) long long, float and double\n"); + } + return data; +} + +static int common_check_var_type_to_int (enum ADIOS_DATATYPES * type, void * value) +{ + int data; + + if (*type == adios_real) + data = *(float *)value; + else if (*type == adios_double) + data = *(double *)value; + else if (*type == adios_byte) + data = *(signed char *)value; + else if (*type == adios_unsigned_byte) + data = *(unsigned char *)value; + else if (*type == adios_short) + data = *(signed short *)value; + else if (*type == adios_unsigned_short) + data = *(unsigned short *)value; + else if (*type == adios_integer) + data = *(signed int *)value; + else if (*type == adios_unsigned_integer) + data = *(unsigned int *)value; + else if (*type == adios_long) + data = *(signed long long *)value; + else if (*type == adios_unsigned_long) + data = *(unsigned long long *)value; + else if (*type == adios_unknown) + { + adios_error (err_mesh_unifrom_invalid_var_type, + "Provided var type is not supported. " + "Var type only supports (unsigned) char, (unsigned) short, " + "(unsigned) int,(unsigned) long long, float and double\n"); + } + return data; +} +int adios_get_uniform_mesh_attr (ADIOS_FILE * fp, ADIOS_MESH *meshinfo, char * attrs) //attr for origins-num(origins), spacings-num(spacings), maximums-num(maximums) +{ + int i; + enum ADIOS_DATATYPES attr_type; + int attr_size; + void * data = NULL; + int read_fail = 0; + bool have_max = 0; + bool have_spacing = 0; + int varid; + + char * attribute = malloc (strlen("/adios_schema/")+strlen(meshinfo->name)+strlen("/")+strlen(attrs)+strlen("-num")+1 ); + strcpy (attribute, "/adios_schema/"); + strcat (attribute, meshinfo->name); + strcat (attribute, "/"); + strcat (attribute, attrs); + strcat (attribute, "-num"); +// printf("attribute is %s\n", attribute); + data = NULL; + read_fail = common_read_get_attr_mesh (fp, attribute, &attr_type, &attr_size, &data); + free (attribute); + if (!read_fail) //found attributes maximums/spacings/origins + { + int num_attr = *(int *)data; + if (num_attr != meshinfo->uniform->num_dimensions) + { + if (!strcmp (attrs,"origins")) + { + num_attr = meshinfo->uniform->num_dimensions; + log_warn ("Uniform mesh %s number of origins %d does not match number of dimensions %d!" + "We use number of dimensions for origins\n", + meshinfo->name, num_attr, meshinfo->uniform->num_dimensions); + } + else if (!strcmp (attrs, "spacings")) + { + num_attr = meshinfo->uniform->num_dimensions; + log_warn ("Uniform mesh %s number of origins %d does not match number of dimensions %d!" + "We use number of dimensions for spacings\n", + meshinfo->name, num_attr, meshinfo->uniform->num_dimensions); + } + else if (!strcmp (attrs, "maximums")) + { + if (num_attr < meshinfo->uniform->num_dimensions) + { + adios_error (err_mesh_unifrom_invalid_num_max, + "Uniform mesh %s number of maximums %d is less than the number of dimensions %d!\n", + meshinfo->name, num_attr, meshinfo->uniform->num_dimensions); + meshinfo->uniform = NULL; + return -1; + } + else if (num_attr > meshinfo->uniform->num_dimensions) + { + num_attr = meshinfo->uniform->num_dimensions; + log_warn ("Uniform mesh %s provided number of maximums %d is greater than the number of dimensions %d!" + "We use number of dimentions for maximums and ignore the rest maximums\n", + meshinfo->name, num_attr, meshinfo->uniform->num_dimensions); + } + } + } + if (!strcmp (attrs,"origins")) + { + meshinfo->uniform->origins = (double *) malloc (sizeof(double)*num_attr); + for (i = 0; i < num_attr; i++ ) + meshinfo->uniform->origins[i] = 0.0; + } + else if (!strcmp (attrs, "spacings")) + { + have_spacing = 1; + meshinfo->uniform->spacings = (double *) malloc (sizeof(double)*num_attr); + for (i = 0; i < num_attr; i++ ) + { + meshinfo->uniform->spacings[i] = 1.0; +// printf("meshinfo->uniform->spacings[%d] = %lf\n", i, meshinfo->uniform->spacings[i]); + } + } + else if (!strcmp (attrs, "maximums")) + { + have_max = 1; + meshinfo->uniform->maximums = (double *) malloc (sizeof(double)*num_attr); + for (i = 0; i < num_attr; i++ ) + meshinfo->uniform->maximums[i] = 0.0; + } + + for (i = 0; i < num_attr; i++ ) + { + char * i_buffer; + int i_digits; + if (num_attr < 10) + i_buffer = (char *) malloc (sizeof(char)+1); + else + { + adios_error (err_mesh_unifrom_invalid_num_dims, + "Uniform mesh %s has more than 10 dimensions!\n", + meshinfo->name); + meshinfo->uniform = NULL; + return 0; + } + i_digits = sprintf (i_buffer, "%d", i); + //i_digits to reprent the number in dimensions0/dimensions1/... + char * value = malloc (strlen("/adios_schema/")+strlen(meshinfo->name)+strlen("/")+strlen(attrs)+i_digits+1 ); + strcpy (value, "/adios_schema/"); + strcat (value, meshinfo->name); + strcat (value, "/"); + strcat (value, attrs); + strcat (value, i_buffer); +// printf("origin_value is %s\n", value); + free (i_buffer); + data = NULL; + read_fail = common_read_get_attr_mesh (fp, value, &attr_type, &attr_size, &data); + free (value); + if (read_fail) + { + if (!strcmp (attrs, "origins")) + { + log_warn ("Uniform mesh %s origins[%d] value is missing.\n" + "We use default value 0.\n", + meshinfo->name, i); + } + else if (!strcmp (attrs, "maximums")) + { + adios_error (err_mesh_unifrom_missing_maximum, + "Uniform mesh %s maximums[%d] is not provided!\n", + meshinfo->name, i); + meshinfo->uniform = NULL; + return -1; + } + else if (!strcmp (attrs, "spacings")) + { + log_warn ("Uniform mesh %s spacings[%d] value is missing.\n" + "We use default value 1.\n", + meshinfo->name, i); + } + } + else + { + char * pEnd; + double d1; + char * tmp_dimensions_value = strdup((char *)data); + d1 = strtod (tmp_dimensions_value, &pEnd); + if ( pEnd && pEnd[0]==0 ) // pEnd points to the terminating \0 of the string + { + // string was a number + if (!strcmp (attrs, "origins")) + meshinfo->uniform->origins[i] = d1; // + else if (!strcmp (attrs, "maximums")) + meshinfo->uniform->maximums[i] = d1; + else if (!strcmp (attrs, "spacings")) + meshinfo->uniform->spacings[i] = d1; + } + else + { + // string may be a variable + char * value_tmp = strdup((char *)data); + varid = common_read_find_var (fp, value_tmp, 1); + if (varid >= 0) + { + ADIOS_VARINFO * v = common_read_inq_var(fp, fp->var_namelist[varid]); + if (!strcmp (attrs, "origins")) + { + adios_errno = err_no_error; + meshinfo->uniform->origins[i] = common_check_var_type_to_double (&v->type, v->value); + if (adios_errno < 0) + { + meshinfo->uniform = NULL; + return -1; + } + } + else if (!strcmp (attrs, "maximums")) + { + adios_errno = err_no_error; + meshinfo->uniform->maximums[i] = common_check_var_type_to_double (&v->type, v->value); + if (adios_errno < 0) + { + meshinfo->uniform = NULL; + return -1; + } + } + else if (!strcmp (attrs, "spacings")) + { + adios_errno = err_no_error; + meshinfo->uniform->spacings[i] = common_check_var_type_to_double (&v->type, v->value); + if (adios_errno < 0) + { + meshinfo->uniform = NULL; + return -1; + } + } + common_read_free_varinfo (v); + } + else + { + if (!strcmp (attrs, "origins")) + { + log_warn ("Uniform mesh %s origins%d var %s is not provided. \n" + "We use default value 0.\n", + meshinfo->name, i, (char *)data); + } + else if (!strcmp (attrs, "maximums")) + { + adios_error (err_mesh_unifrom_missing_maximum, + "Uniform mesh %s maximums%d var %s is not provided.\n", + meshinfo->name, i, (char *)data); + meshinfo->uniform = NULL; + return -1; + } + else if (!strcmp (attrs, "spacings")) + { + log_warn ("Uniform mesh %s spacings%d var %s is not provided. \n" + "We use default value 1.\n", + meshinfo->name, i, (char *)data); + } + } + } + } + } + } + else //not found attributes maximums/spacings/origins + { + if (!strcmp (attrs,"origins")) + { + meshinfo->uniform->origins = (double *) malloc (sizeof(double)*meshinfo->uniform->num_dimensions); + for (i = 0; i < meshinfo->uniform->num_dimensions; i++ ) + meshinfo->uniform->origins[i] = 0.0; + log_info ("Uniform mesh %s does not provide origin info." + "We use default value 0.\n", + meshinfo->name); + } + else if (!strcmp (attrs, "spacings")) + { + have_spacing = 1; + meshinfo->uniform->spacings = (double *) malloc (sizeof(double)*meshinfo->uniform->num_dimensions); + for (i = 0; i < meshinfo->uniform->num_dimensions; i++ ) + meshinfo->uniform->spacings[i] = 1.0; + log_info ("Uniform mesh %s does not provide spacing info." + "We use default value 1.\n", + meshinfo->name); + } + else if (!strcmp (attrs, "maximums")) + { + meshinfo->uniform->maximums = (double *) malloc (sizeof(double)*meshinfo->uniform->num_dimensions); + for (i = 0; i < meshinfo->uniform->num_dimensions; i++ ) + { + meshinfo->uniform->maximums[i] = ((double)meshinfo->uniform->dimensions[i]-1.0)*meshinfo->uniform->spacings[i]+meshinfo->uniform->origins[i]; +// printf("max[%d] is %lf \n", i, meshinfo->uniform->maximums[i]); + } + log_info ("Uniform mesh %s does not provide maximums info.\n" + "We calculate maximums based on origins and spacings. \n", + meshinfo->name); + } + + } + + if (have_max || have_spacing) + return 1; + else + return 0; + +} + + +ADIOS_MESH * common_read_inq_mesh_byid (ADIOS_FILE *fp, int meshid) +{ + enum ADIOS_DATATYPES attr_type; + int attr_size; + void * data = NULL; + int read_fail = 0; +// int i, j, varid; + ADIOS_MESH * meshinfo = (ADIOS_MESH *) malloc (sizeof(ADIOS_MESH)); + //mesh id + meshinfo->id = meshid; + //mesh name + meshinfo->name = strdup(fp->mesh_namelist[meshinfo->id]); + + //check if mesh structure is stored in the same file + char * meshfile = malloc ( strlen("/adios_schema/")+strlen(meshinfo->name)+strlen("/mesh-file")+1 ); + strcpy (meshfile, "/adios_schema/"); + strcat (meshfile, meshinfo->name); + strcat (meshfile, "/mesh-file"); + read_fail = common_read_get_attr_mesh (fp, meshfile, &attr_type, &attr_size, &data); + free (meshfile); + if (!read_fail) + { + meshinfo->file_name = strdup((char *)data); + // user has to open this file and call common_read_complete_meshinfo() again with both file pointers + return meshinfo; + } + + //mesh is in the same file + meshinfo->file_name = NULL; + //construct /adios_schema/***/time-varying + //mesh time-varying + char * time_varying = malloc ( strlen("/adios_schema/")+strlen(meshinfo->name)+strlen("/time-varying")+1 ); + strcpy (time_varying, "/adios_schema/"); + strcat (time_varying, meshinfo->name); + strcat (time_varying, "/time-varying"); + read_fail = common_read_get_attr_mesh (fp, time_varying, &attr_type, &attr_size, &data); + free (time_varying); + if (read_fail) + meshinfo->time_varying = 0; + else + { + if ( !strcmp ((char *)data,"yes") ) + meshinfo->time_varying = 1; + else + meshinfo->time_varying = 0; + } + //construct /adios_schema/***/type to get mesh type (uniform, rectilinear, structured, unstructured) + //mesh type + char * mesh_attribute = malloc ( strlen("/adios_schema/")+strlen(meshinfo->name)+strlen("/type")+1 ); + strcpy (mesh_attribute, "/adios_schema/"); + strcat (mesh_attribute, meshinfo->name); + strcat (mesh_attribute, "/type"); + common_read_get_attr_mesh (fp, mesh_attribute, &attr_type, &attr_size, &data); + free (mesh_attribute); + if ( !strcmp((char *)data, "uniform") ) + meshinfo->type = ADIOS_MESH_UNIFORM; + else if ( !strcmp((char *)data, "rectilinear") ) + meshinfo->type = ADIOS_MESH_RECTILINEAR; + else if ( !strcmp((char *)data, "structured") ) + meshinfo->type = ADIOS_MESH_STRUCTURED; + else if ( !strcmp((char *)data, "unstructured") ) + meshinfo->type = ADIOS_MESH_UNSTRUCTURED; + common_read_complete_meshinfo (fp, fp, meshinfo); +#if 0 + //check if mesh structure is stored in the same file + char * meshfile = malloc ( strlen("/adios_schema/")+strlen(meshinfo->name)+strlen("/mesh-file")+1 ); + strcpy (meshfile, "/adios_schema/"); + strcat (meshfile, meshinfo->name); + strcat (meshfile, "/mesh-file"); + read_fail = common_read_get_attr_mesh (fp, meshfile, &attr_type, &attr_size, &data); + free (meshfile); + printf ("read_fail is %d\n", read_fail); + if (read_fail) + { + meshinfo->file_name = NULL; + // get the mesh details now from this data file + common_read_complete_meshinfo (fp, fp, meshinfo); + } + else + { + meshinfo->file_name = strdup((char *)data); + printf("file_name is %s\n", meshinfo->file_name); + // user has to open this file and call common_read_complete_meshinfo() again with both file pointers + } +#endif + return meshinfo; +} + + +int common_read_complete_meshinfo (ADIOS_FILE *fp, ADIOS_FILE *mp, ADIOS_MESH * meshinfo) +{ + enum ADIOS_DATATYPES attr_type; + int attr_size; + void * data = NULL; + int read_fail = 0; + int i, j, varid; + + if (fp==NULL || mp==NULL) + { + printf("file is NULL\n"); + adios_error (err_mesh_file_missing, + "Mesh file %s or mesh file does not exist. ", + fp->path, mp->path); + return adios_errno; + } + + if (fp != mp) //if mesh is in a different file, time-varying, mesh type is unknow yet + { + //mesh time-varying + char * time_varying = malloc ( strlen("/adios_schema/")+strlen(meshinfo->name)+strlen("/time-varying")+1 ); + strcpy (time_varying, "/adios_schema/"); + strcat (time_varying, meshinfo->name); + strcat (time_varying, "/time-varying"); + read_fail = common_read_get_attr_mesh (mp, time_varying, &attr_type, &attr_size, &data); + free (time_varying); + if (read_fail) + meshinfo->time_varying = 0; + else + { + if ( !strcmp ((char *)data,"yes") ) + meshinfo->time_varying = 1; + else + meshinfo->time_varying = 0; + } + + //check if mesh structure type + char * meshtype = malloc ( strlen("/adios_schema/")+strlen(meshinfo->name)+strlen("/type")+1 ); + strcpy (meshtype, "/adios_schema/"); + strcat (meshtype, meshinfo->name); + strcat (meshtype, "/type"); + read_fail = common_read_get_attr_mesh (mp, meshtype, &attr_type, &attr_size, &data); + free (meshtype); + if (!read_fail) + { + if (!strcmp((char *)data, "uniform") || !strcmp((char *)data, "UNIFORM") || !strcmp((char *)data, "Uniform")) + meshinfo->type = ADIOS_MESH_UNIFORM; + if (!strcmp((char *)data, "rectilinear") || !strcmp((char *)data, "RECTILINEAR") || !strcmp((char *)data, "Rectilinear")) + meshinfo->type = ADIOS_MESH_RECTILINEAR; + if (!strcmp((char *)data, "structured") || !strcmp((char *)data, "STRUCTURED") || !strcmp((char *)data, "Structured")) + meshinfo->type = ADIOS_MESH_STRUCTURED; + if (!strcmp((char *)data, "unstructured") || !strcmp((char *)data, "UNSTRUCTURED") || !strcmp((char *)data, "Unstructured")) + meshinfo->type = ADIOS_MESH_UNSTRUCTURED; + else + printf("mesh structure %s is not supported\n", (char *)data); + free (data); + } + else + { + log_error ("Cannot get mesh %s type\n", meshinfo->name); + return read_fail; + } + } +// if ( !strcmp((char *)data, "uniform") ) + if (meshinfo->type == ADIOS_MESH_UNIFORM) + { +// meshinfo->type = ADIOS_MESH_UNIFORM; + meshinfo->uniform = (MESH_UNIFORM * ) malloc (sizeof(MESH_UNIFORM)); + + // initialize pointers that might not be set below + meshinfo->uniform->spacings = NULL; + meshinfo->uniform->maximums = NULL; + meshinfo->uniform->origins = NULL; + + char * dimension_attribute = malloc (strlen("/adios_schema/")+strlen(meshinfo->name)+strlen("/dimensions-num")+1 ); + strcpy (dimension_attribute, "/adios_schema/"); + strcat (dimension_attribute, meshinfo->name); + strcat (dimension_attribute, "/dimensions-num"); + data = NULL; +// read_fail = common_read_get_attr_mesh (fp, dimension_attribute, &attr_type, &attr_size, &data); + read_fail = common_read_get_attr_mesh (mp, dimension_attribute, &attr_type, &attr_size, &data); + free (dimension_attribute); +// printf("dimension_attribute is %s\n", dimension_attribute); +// printf("dimension is %d\n",*(int *)data); + if (!read_fail) + { + meshinfo->uniform->num_dimensions = *(int *)data; + meshinfo->uniform->dimensions = (uint64_t *) malloc (sizeof(uint64_t)*meshinfo->uniform->num_dimensions); + for (i = 0; i < meshinfo->uniform->num_dimensions; i++ ) + { + meshinfo->uniform->dimensions[i] = 0; + char * i_buffer; + int i_digits; + if (meshinfo->uniform->num_dimensions < 10) + i_buffer = (char *) malloc (sizeof(char)+1); + else + { + adios_error (err_mesh_unifrom_invalid_num_dims, + "Uniform mesh %s has more than 10 dims!\n", + meshinfo->name); + return adios_errno; + } + i_digits = sprintf (i_buffer, "%d", i); + //i_digits to reprent the number in dimensions0/dimensions1/... + char * dimensions_value = malloc (strlen("/adios_schema/")+strlen(meshinfo->name)+strlen("/dimensions")+i_digits+1 ); + strcpy (dimensions_value, "/adios_schema/"); + strcat (dimensions_value, meshinfo->name); + strcat (dimensions_value, "/dimensions"); + strcat (dimensions_value, i_buffer); + free (i_buffer); + data = NULL; +// read_fail = common_read_get_attr_mesh (fp, dimensions_value, &attr_type, &attr_size, &data); + read_fail = common_read_get_attr_mesh (mp, dimensions_value, &attr_type, &attr_size, &data); + free (dimensions_value); + if (read_fail) + { + adios_error (err_mesh_unifrom_missing_one_dim, + "Uniform mesh %s dimensions[%d] is not provided!\n", + meshinfo->name, i); + return adios_errno; + } + else + { + char * pEnd; + char * tmp_dimensions_value = strdup((char *)data); + uint64_t tmp_value = strtoull (tmp_dimensions_value, &pEnd, 10); +// if (tmp_value) + if ( pEnd && pEnd[0]==0 ) + meshinfo->uniform->dimensions[i] = tmp_value; + else + { + char * dimensions_value_tmp = strdup((char *)data); +// varid = common_read_find_var (fp, dimensions_value_tmp, 1); + varid = common_read_find_var (mp, dimensions_value_tmp, 1); + if (varid >= 0) { + ADIOS_VARINFO * v = common_read_inq_var(mp, mp->var_namelist[varid]); + adios_errno = err_no_error; + meshinfo->uniform->dimensions[i] = common_check_var_type_to_uint64 (&v->type, v->value); + if (adios_errno < 0) + { + adios_error (err_mesh_unifrom_invalid_dim, + "Uniform mesh %s dimensions%d var type is not support!\n", + meshinfo->name, i); + return adios_errno; + } + common_read_free_varinfo (v); + } + else + { + adios_error (err_mesh_unifrom_invalid_dim, + "Uniform mesh %s dimensions%d var %s is not correct!\n", + meshinfo->name, i, (char *)data); + return adios_errno; + } +// free (dimensions_value_tmp); + } + } + } + } + else + { + adios_error (err_mesh_unifrom_missing_dims, + "Uniform mesh %s dimension is required\n", + meshinfo->name); + return adios_errno; + } + + //start processing origins, origin is optional + int have_origins; + have_origins = adios_get_uniform_mesh_attr (mp, meshinfo, "origins"); + if (have_origins == -1) + return adios_errno; +// for (i = 0; i < meshinfo->uniform->num_dimensions; i++ ) +// printf ("origins[%d] is %lf\n", i, meshinfo->uniform->origins[i]); + + //start processing spacings, spacing is optional + int have_spacings; + have_spacings = adios_get_uniform_mesh_attr (mp, meshinfo, "spacings"); + if (have_spacings == -1) + return adios_errno; +// for (i = 0; i < meshinfo->uniform->num_dimensions; i++ ) +// printf ("spacings[%d] is %lf\n", i, meshinfo->uniform->spacings[i]); + + //start processing maximums, maximum is optional + int have_maximums; + have_maximums = adios_get_uniform_mesh_attr (mp, meshinfo, "maximums"); + if (have_maximums == -1) + return adios_errno; +// for (int i = 0; i < meshinfo->uniform->num_dimensions; i++ ) +// printf ("maximums[%d] is %lf\n", i, meshinfo->uniform->maximums[i]); + + //if mesh spacing and maximum are both defined, check if consistant + if (have_spacings == 1 && have_maximums == 1) + { + for (i = 0; i < meshinfo->uniform->num_dimensions; i++) + { + if (meshinfo->uniform->spacings[i] != (meshinfo->uniform->maximums[i]-meshinfo->uniform->origins[i])/(double)(meshinfo->uniform->dimensions[i]-1)) + { +// printf ( "meshinfo->uniform->origins = %lf, meshinfo->uniform->dimensions = %lf\n", meshinfo->uniform->origins[i], meshinfo->uniform->dimensions[i]); + adios_error (err_mesh_unifrom_max_conflict, + "Uniform mesh %s provided uniform mesh spacing and maximum is not consistant " + "provided spacing is %lf, calculated spacing is %lf\n", + meshinfo->name, meshinfo->uniform->spacings[i], + (meshinfo->uniform->maximums[i]-meshinfo->uniform->origins[i])/(double)(meshinfo->uniform->dimensions[i]-1)); + return adios_errno; + } + } + } +//end of uniform mesh + } +// else if ( !strcmp((char *)data, "rectilinear") ) + else if (meshinfo->type == ADIOS_MESH_RECTILINEAR) + { +// meshinfo->type = ADIOS_MESH_RECTILINEAR; + meshinfo->rectilinear = (MESH_RECTILINEAR * ) malloc (sizeof(MESH_RECTILINEAR)); + meshinfo->rectilinear->use_single_var = 0; // default value 0 indicates using multi-var + + // start processing rectilinear mesh dimensions + char * dimension_attribute = malloc (strlen("/adios_schema/")+strlen(meshinfo->name)+strlen("/dimensions-num")+1 ); + strcpy (dimension_attribute, "/adios_schema/"); + strcat (dimension_attribute, meshinfo->name); + strcat (dimension_attribute, "/dimensions-num"); + data = NULL; + read_fail = common_read_get_attr_mesh (mp, dimension_attribute, &attr_type, &attr_size, &data); + free (dimension_attribute); + if (!read_fail) + { + meshinfo->rectilinear->num_dimensions = *(int *)data; +// printf ("the dimension is %d\n", meshinfo->rectilinear->num_dimensions); + meshinfo->rectilinear->dimensions = (uint64_t *) malloc (sizeof(uint64_t)*meshinfo->rectilinear->num_dimensions); + for (i = 0; i < meshinfo->rectilinear->num_dimensions; i++ ) + { + meshinfo->rectilinear->dimensions[i] = 0; + char * i_buffer; + int i_digits; + if (meshinfo->rectilinear->num_dimensions < 10) + i_buffer = (char *) malloc (sizeof(char)+1); + else + { + adios_error (err_mesh_recti_invalid_num_dims, + "Rectilinear mesh %s has more than 10 dims!\n", + meshinfo->name); + return adios_errno; + } + i_digits = sprintf (i_buffer, "%d", i); + //i_digits to reprent the number in dimensions0/dimensions1/... + char * dimensions_value = malloc (strlen("/adios_schema/")+strlen(meshinfo->name)+strlen("/dimensions")+i_digits+1 ); + strcpy (dimensions_value, "/adios_schema/"); + strcat (dimensions_value, meshinfo->name); + strcat (dimensions_value, "/dimensions"); + strcat (dimensions_value, i_buffer); + free (i_buffer); + data = NULL; + read_fail = common_read_get_attr_mesh (mp, dimensions_value, &attr_type, &attr_size, &data); +// printf("dimensions_value is %s\n", dimensions_value); + free (dimensions_value); + if (read_fail) + { + adios_error (err_mesh_recti_missing_one_dim, + "Rectilinear mesh %s dimensions[%d] is not provided!\n", + meshinfo->name, i); + return adios_errno; + } + else + { + char * pEnd; + char * tmp_dimensions_value = strdup((char *)data); + uint64_t tmp_value = strtoull (tmp_dimensions_value, &pEnd, 10); +// if (tmp_value) + if ( pEnd && pEnd[0]==0 ) + meshinfo->rectilinear->dimensions[i] = tmp_value; + else + { + char * dimensions_value_tmp = strdup((char *)data); + varid = common_read_find_var (mp, dimensions_value_tmp, 1); + if (varid >= 0) { + ADIOS_VARINFO * v = common_read_inq_var(mp, mp->var_namelist[varid]); + adios_errno = err_no_error; + meshinfo->rectilinear->dimensions[i] = common_check_var_type_to_uint64 (&v->type, v->value); + if (adios_errno < 0) + { + adios_error (err_mesh_recti_invalid_dim, + "Rectilinear mesh %s dimensions%d var type is not support!\n", + meshinfo->name, i); + return adios_errno; + } + common_read_free_varinfo (v); + } + else + { + adios_error (err_mesh_recti_invalid_dim, + "Rectilinear mesh %s dimensions%d var %s is not correct!\n", + meshinfo->name, i, (char *)data); + return adios_errno; + } + } + } + } + } + else + { + adios_error (err_mesh_recti_missing_dims, + "Rectilinear mesh %s dimension is required\n", + meshinfo->name); + return adios_errno; + } +// for (int i = 0; i < meshinfo->rectilinear->num_dimensions; i++ ) +// printf ("dimensions[%d] is %d\n", i, meshinfo->rectilinear->dimensions[i]); + + // start processing rectilinear mesh coordinates + char * coords_attribute = malloc (strlen("/adios_schema/")+strlen(meshinfo->name)+strlen("/coordinates-single-var")+1 ); + strcpy (coords_attribute, "/adios_schema/"); + strcat (coords_attribute, meshinfo->name); + strcat (coords_attribute, "/coords-single-var"); + read_fail = common_read_get_attr_mesh (mp, coords_attribute, &attr_type, &attr_size, &data); +// printf("coords_attribute is %s\n", coords_attribute); + free (coords_attribute); + if (!read_fail) //use coordinates-single-var + { + meshinfo->rectilinear->coordinates = (char **) malloc (sizeof(char *)); + meshinfo->rectilinear->use_single_var = 1; + char * coords_tmp = strdup((char *)data); + varid = common_read_find_var (mp, coords_tmp, 1); + if (varid >= 0) + { + ADIOS_VARINFO * v = common_read_inq_var(mp, mp->var_namelist[varid]); + // check if mesh dimension matches coordinates dimension + if (v->ndim == 0) //scalar + { + adios_error (err_mesh_recti_invalid_coords, + "Rectilinear mesh %s coordinates dimension is 0\n", + meshinfo->name); + return adios_errno; + } + else //vector, more than one dim + { + if (v->ndim == 1) //one dim vector + { + uint64_t dim_tmp = 1; + for (j=0; jrectilinear->num_dimensions; j++) + dim_tmp *= meshinfo->rectilinear->dimensions[j]; + if (dim_tmp*meshinfo->rectilinear->num_dimensions != v->dims[0]) + { + adios_error (err_mesh_recti_invalid_coords, + "Rectilinear mesh %s coordinates dimension %"PRIu64" does not match mesh dimension %"PRIu64"\n", + meshinfo->name, v->dims[0], dim_tmp*meshinfo->rectilinear->num_dimensions); + return adios_errno; + } + else + meshinfo->rectilinear->coordinates[0] = strdup (mp->var_namelist[varid]); + } + else //multi dim vector + { + // check if each mesh dimension matches coordinates dimension + for (j=0; jndim; j++) + { + if (meshinfo->rectilinear->dimensions[j] != v->dims[j]) + { + adios_error (err_mesh_recti_invalid_coords, + "Rectilinear mesh %s dimension[%d]= %d does not match coordinates dimension[%d]= %d\n", + meshinfo->name, j, meshinfo->rectilinear->dimensions[j], j, v->dims[j] ); + return adios_errno; + } + } + meshinfo->rectilinear->coordinates[0] = strdup (mp->var_namelist[varid]); + } + } + common_read_free_varinfo (v); + } + else + { + adios_error (err_mesh_recti_invalid_coords, + "Rectilinear mesh %s coordinates var name %s not found\n", + meshinfo->name, coords_tmp ); + return adios_errno; + } +// printf ("coordinates is %s\n", meshinfo->rectilinear->coordinates[0]); + } + else // use coordinates-multi-var? + { + coords_attribute = malloc (strlen("/adios_schema/")+strlen(meshinfo->name)+strlen("/coords-multi-var-num")+1 ); + strcpy (coords_attribute, "/adios_schema/"); + strcat (coords_attribute, meshinfo->name); + strcat (coords_attribute, "/coords-multi-var-num"); + data = NULL; + read_fail = common_read_get_attr_mesh (mp, coords_attribute, &attr_type, &attr_size, &data); + free (coords_attribute); + if (!read_fail) //found attributes coords-multi-var + { + int num_coordinates = *(int *)data; + if (num_coordinates < meshinfo->rectilinear->num_dimensions) + { + adios_error (err_mesh_recti_invalid_coords, + "Rectilinear mesh %s number of coordinates %d is less than the number of dimensions %d!\n", + meshinfo->name, num_coordinates, meshinfo->rectilinear->num_dimensions); + return adios_errno; + } + if (num_coordinates > meshinfo->rectilinear->num_dimensions) + { + num_coordinates = meshinfo->rectilinear->num_dimensions; + log_warn ("Rectilinear mesh %s number of coordinates %d is greater than the number of dimensions %d! " + "We use number of dimensions for maximums and ignore the rest maximums.\n", + meshinfo->name, num_coordinates, meshinfo->rectilinear->num_dimensions); + } + meshinfo->rectilinear->coordinates = (char **) malloc (num_coordinates*sizeof(char *)); + for (i=0; iname); + return adios_errno; + } + i_digits = sprintf (i_buffer, "%d", i); + // printf ("i digit is %d\n", i_digits); + char * coords_var = malloc (strlen("/adios_schema/")+strlen(meshinfo->name)+strlen("/coords-multi-var")+i_digits+1 ); + strcpy (coords_var, "/adios_schema/"); + strcat (coords_var, meshinfo->name); + strcat (coords_var, "/coords-multi-var"); + strcat (coords_var, i_buffer); +// printf ("coords_var is %s\n", coords_var); + free (i_buffer); + data = NULL; + read_fail = common_read_get_attr_mesh (mp, coords_var, &attr_type, &attr_size, &data); + free (coords_var); + if (read_fail) + { + adios_error (err_mesh_recti_missing_one_coords, + "Rectilinear mesh %s coordinate of coordinate[%d] is not provided!\n", + meshinfo->name, i); + return adios_errno; + } + + char * coords_var_tmp = strdup((char *)data); + varid = common_read_find_var (mp, coords_var_tmp, 1); + if (varid >= 0) { + ADIOS_VARINFO * v = common_read_inq_var(mp, mp->var_namelist[varid]); + if (meshinfo->rectilinear->dimensions[i] != v->dims[0]) + { + adios_error (err_mesh_recti_invalid_coords, + "Rectilinear mesh %s dimension[%d] = %lld does not " + "match coordinates dimension[%d] = %lld\n", + meshinfo->name, i, meshinfo->rectilinear->dimensions[i], + i, v->dims[0] ); + return adios_errno; + } + else + { + meshinfo->rectilinear->coordinates[i] = strdup (mp->var_namelist[varid]); + // printf ("coordinates[%d] is %s\n", i, meshinfo->rectilinear->coordinates[i]); + } + common_read_free_varinfo (v); + } + } + } + else //coords-single-var not found, coords-multi-var not found + { + adios_error (err_mesh_recti_missing_coords, + "Rectilinear mesh %s coordinate is not provided\n", + meshinfo->name); + return adios_errno; + } +// for (int i = 0; i < meshinfo->rectilinear->num_dimensions; i++ ) +// printf ("coordinates[%d] is %s\n", i, meshinfo->rectilinear->coordinates[i]); + } + } +// else if ( !strcmp((char *)data, "structured") ) + else if (meshinfo->type == ADIOS_MESH_STRUCTURED) + { +// meshinfo->type = ADIOS_MESH_STRUCTURED; + meshinfo->structured = (MESH_STRUCTURED* ) malloc (sizeof(MESH_STRUCTURED)); + meshinfo->structured->use_single_var = 0; // default value 0 indicates using multi-var + meshinfo->structured->nspaces = meshinfo->structured->num_dimensions; //default spaces = # of dims + + // start processing structured mesh dimensions + char * dimension_attribute = malloc (strlen("/adios_schema/")+strlen(meshinfo->name)+strlen("/dimensions-num")+1 ); + strcpy (dimension_attribute, "/adios_schema/"); + strcat (dimension_attribute, meshinfo->name); + strcat (dimension_attribute, "/dimensions-num"); + data = NULL; + read_fail = common_read_get_attr_mesh (mp, dimension_attribute, &attr_type, &attr_size, &data); + free (dimension_attribute); + if (!read_fail) + { + meshinfo->structured->num_dimensions = *(int *)data; + meshinfo->structured->dimensions = (uint64_t *) malloc (sizeof(uint64_t)*meshinfo->structured->num_dimensions); + for (i = 0; i < meshinfo->structured->num_dimensions; i++ ) + { + meshinfo->structured->dimensions[i] = 0; + char * i_buffer; + int i_digits; + if (meshinfo->structured->num_dimensions < 10) + i_buffer = (char *) malloc (sizeof(char)+1); + else + { + adios_error (err_mesh_structured_invalid_num_dims, + "Strctured mesh %s has more than 10 dimensions!\n", + meshinfo->name); + return adios_errno; + } + i_digits = sprintf (i_buffer, "%d", i); + char * dimensions_value = malloc (strlen("/adios_schema/")+strlen(meshinfo->name)+strlen("/dimensions")+i_digits+1 ); + strcpy (dimensions_value, "/adios_schema/"); + strcat (dimensions_value, meshinfo->name); + strcat (dimensions_value, "/dimensions"); + strcat (dimensions_value, i_buffer); + free (i_buffer); + data = NULL; + read_fail = common_read_get_attr_mesh (mp, dimensions_value, &attr_type, &attr_size, &data); + if (read_fail) + { + adios_error (err_mesh_structured_missing_one_dim, + "Strctured mesh %s dimension of dimensions[%d] is not provided!\n", + meshinfo->name, i); + return adios_errno; + } + else + { + char * pEnd; + char * tmp_dimensions_value = strdup((char *)data); + uint64_t tmp_value = strtoull (tmp_dimensions_value, &pEnd, 10); +// if (tmp_value) + if ( pEnd && pEnd[0]==0 ) + meshinfo->structured->dimensions[i] = tmp_value; + else + { + char * dimensions_value_tmp = strdup((char *)data); + varid = common_read_find_var (mp, dimensions_value_tmp, 1); + if (varid >= 0) { + ADIOS_VARINFO * v = common_read_inq_var(mp, mp->var_namelist[varid]); + adios_errno = err_no_error; + meshinfo->structured->dimensions[i] = common_check_var_type_to_uint64 (&v->type, v->value); + if( adios_errno < 0) + { + adios_error (err_mesh_structured_invalid_dim, + "Strctured mesh %s dimensions%d var type is not support!\n", + meshinfo->name, i); + return adios_errno; + } + common_read_free_varinfo (v); + } + else + { + adios_error (err_mesh_structured_invalid_dim, + "Strctured mesh %s dimensions%d var %s is not correct!\n", + meshinfo->name, i, (char *)data); + return adios_errno; + } +// free (dimensions_value_tmp); + } + } + } + } + else + { + adios_error (err_mesh_structured_missing_dims, + "Strctured mesh %s dimension is required\n", + meshinfo->name); + return adios_errno; + } + + // start processing structured mesh points + char * points_attribute = malloc (strlen("/adios_schema/")+strlen(meshinfo->name)+strlen("/coordinates-single-var")+1 ); + strcpy (points_attribute, "/adios_schema/"); + strcat (points_attribute, meshinfo->name); + strcat (points_attribute, "/points-single-var"); + read_fail = common_read_get_attr_mesh (mp, points_attribute, &attr_type, &attr_size, &data); + free (points_attribute); + if (!read_fail) //use points-single-var + { + meshinfo->structured->points = (char **) malloc (sizeof(char *)); + meshinfo->structured->use_single_var = 1; // modify default value to 1 + + char * coords_tmp = strdup((char *)data); + varid = common_read_find_var (mp, coords_tmp, 1); + if (varid >= 0) + { + ADIOS_VARINFO * v = common_read_inq_var(mp, mp->var_namelist[varid]); + if (v->ndim == 0) //scalar + { + adios_error (err_mesh_structured_invaid_dim_points, + "Strctured mesh %s points dimension is 0.\n", + meshinfo->name); + return adios_errno; + } + else //vector, more than one dim + { + if (v->ndim == 1) //if points is 1D array + { + uint64_t dim_tmp = 1; + for (j=0; jstructured->num_dimensions; j++) + dim_tmp *= meshinfo->structured->dimensions[j]; + if (dim_tmp*meshinfo->structured->num_dimensions != v->dims[0]) + { + adios_error (err_mesh_structured_invaid_points, + "Strctured mesh %s points dimension %"PRIu64" does not match mesh dimension %"PRIu64"\n", + meshinfo->name, v->dims[0], dim_tmp*meshinfo->structured->num_dimensions); + return adios_errno; + } + else + meshinfo->structured->points[0] = strdup (mp->var_namelist[varid]); + } + else + { + // check if each mesh dimension matches points dimension + for (j=0; jndim; j++) // if points is multi dim array + { + if (meshinfo->structured->dimensions[j] != v->dims[j]) + { + adios_error (err_mesh_structured_invaid_points, + "Strctured mesh %s dimension[%d]= %"PRIu64" does not match points dimension[%d]= %"PRIu64"\n", + meshinfo->name, j, meshinfo->structured->dimensions[j], j, v->dims[j] ); + return adios_errno; + } + } + meshinfo->structured->points[0] = strdup (mp->var_namelist[varid]); + } + } + common_read_free_varinfo (v); + } + else + { + adios_error (err_mesh_structured_invaid_points, + "Strctured mesh %s points var name %s not found\n", + meshinfo->name, coords_tmp); + return adios_errno; + } + } + else //use points-multi-var + { + points_attribute = malloc (strlen("/adios_schema/")+strlen(meshinfo->name)+strlen("/coords-multi-var-num")+1 ); + strcpy (points_attribute, "/adios_schema/"); + strcat (points_attribute, meshinfo->name); + strcat (points_attribute, "/points-multi-var-num"); + data = NULL; + read_fail = common_read_get_attr_mesh (mp, points_attribute, &attr_type, &attr_size, &data); + free (points_attribute); + if (!read_fail) //found attributes points-multi-var + { + int points_dim = *(int *)data; + if (points_dim < meshinfo->structured->num_dimensions) + { + adios_error (err_mesh_structured_invaid_dim_points, + "Strctured mesh %s provided points dim %d is less than dims of mesh %d!\n", + meshinfo->name, points_dim, meshinfo->structured->num_dimensions); + return adios_errno; + } + if (points_dim > meshinfo->structured->num_dimensions) + { + points_dim = meshinfo->structured->num_dimensions; + log_warn ("Strctured mesh %s points dim %d is greater than mesh dimes %d! " + "We use number of mesh dimensions for points and ignore the rest points\n", + meshinfo->name, points_dim, meshinfo->structured->num_dimensions); + } + meshinfo->structured->points = (char **) malloc (points_dim*sizeof(char *)); + for (i=0; iname); + return adios_errno; + } + i_digits = sprintf (i_buffer, "%d", i); + char * points_var = malloc (strlen("/adios_schema/")+strlen(meshinfo->name)+strlen("/points-multi-var")+i_digits+1 ); + strcpy (points_var, "/adios_schema/"); + strcat (points_var, meshinfo->name); + strcat (points_var, "/points-multi-var"); + strcat (points_var, i_buffer); + free (i_buffer); + data = NULL; + read_fail = common_read_get_attr_mesh (mp, points_var, &attr_type, &attr_size, &data); + free (points_var); + if (read_fail) + { + adios_error (err_mesh_structured_missing_one_points, + "Strctured mesh %s points of dim[%d] is not provided!\n", + meshinfo->name, i); + return adios_errno; + } + char * points_var_tmp = strdup((char *)data); + varid = common_read_find_var (mp, points_var_tmp, 1); + if (varid >= 0) + { + ADIOS_VARINFO * v = common_read_inq_var(mp, mp->var_namelist[varid]); + //check if dim of mesh matches point dim + if (v->ndim == 1) //if var is 1D array + { + uint64_t dim_tmp = 1; + int m = 0; + for (m=0; mstructured->num_dimensions; m++) + dim_tmp *= meshinfo->structured->dimensions[m]; + if (dim_tmp != v->dims[0]) + { + adios_error (err_mesh_structured_invaid_points, + "Strctured mesh %s points dimension %"PRIu64" does not match mesh dimension %"PRIu64"\n", + meshinfo->name, v->dims[0], dim_tmp); + return adios_errno; + } + else + meshinfo->structured->points[i] = strdup (mp->var_namelist[varid]); + } + else + { + // check if each mesh dim matches points dim (var is multi dim array) + int m = 0; + for (m=0; mndim; m++) // if points is multi dim array + { + if (meshinfo->structured->dimensions[m] != v->dims[m]) + { + adios_error (err_mesh_structured_invaid_points, + "Strctured mesh %s dimension[%d]= %"PRIu64" does not match points dimension[%d]= %"PRIu64"\n", + meshinfo->name, m, meshinfo->structured->dimensions[m], m, v->dims[m] ); + return adios_errno; + } + } + meshinfo->structured->points[i] = strdup (mp->var_namelist[varid]); + } + common_read_free_varinfo (v); + } + else + { + adios_error (err_mesh_structured_missing_one_points, + "Structured mesh %s var of points-multi-var%d is not provided.\n", + meshinfo->name, i); + return adios_errno; + } + } // end of for loop i + } // end of if found attributes points-multi-var + else + { + adios_error (err_mesh_structured_missing_points, + "Structured mesh %s point is not provided.\n", + meshinfo->name); + return adios_errno; + } + + } // end of else use points-multi-var + + // start processing structured mesh nspace + char * mesh_nspace = malloc (strlen("/adios_schema/")+strlen(meshinfo->name)+strlen("/nspace")+1 ); + strcpy (mesh_nspace, "/adios_schema/"); + strcat (mesh_nspace, meshinfo->name); + strcat (mesh_nspace, "/nspace"); + data = NULL; + read_fail = common_read_get_attr_mesh (mp, mesh_nspace, &attr_type, &attr_size, &data); + free (mesh_nspace); + if (read_fail) + { + log_info ("Unstructured mesh %s nspace is not provided. " + "We use num of dims %d for nspaces.\n", + meshinfo->name, meshinfo->structured->num_dimensions); + } + else + { + long int d1; + char * pEnd; + d1 = strtol((char *)data, &pEnd, 10); +// if (d1) + if ( pEnd && pEnd[0]==0 ) + meshinfo->structured->nspaces = d1; + else + { + char * spaces_var_tmp = strdup((char *)data); +// printf ("spaces_var_tmp is %s\n", spaces_var_tmp); + varid = common_read_find_var (mp, spaces_var_tmp, 1); + if (varid >= 0) + { + ADIOS_VARINFO * v = common_read_inq_var(mp, mp->var_namelist[varid]); + meshinfo->structured->nspaces = *(int *)v->value; + common_read_free_varinfo (v); + } + else + { + log_warn ("Var %s for structured mesh %s nspace is not found. " + "We use num of dims %d for nspaces.\n", + (char *)data, meshinfo->name, + meshinfo->structured->num_dimensions); + } + } + } // end of structured mesh nspace + }// end of structured mesh +// else if ( !strcmp((char *)data, "unstructured") ) + else if (meshinfo->type == ADIOS_MESH_UNSTRUCTURED) + { +// meshinfo->type = ADIOS_MESH_UNSTRUCTURED; + meshinfo->unstructured = (MESH_UNSTRUCTURED* ) malloc (sizeof(MESH_UNSTRUCTURED)); +// meshinfo->unstructured->use_single_var = 0; // default value 0 indicates using multi-var + meshinfo->unstructured->nvar_points = 1; +// meshinfo->unstructured->uniform_cell = 1; // default value 0 indicates using uniform cell +// meshinfo->unstrutured->nspaces init +// meshinfo->unstructured->npoints init + + // start processing unstructured mesh points-single-var/points-multi-var + char * points_attribute = malloc (strlen("/adios_schema/")+strlen(meshinfo->name)+strlen("/points-single-var")+1 ); + strcpy (points_attribute, "/adios_schema/"); + strcat (points_attribute, meshinfo->name); + strcat (points_attribute, "/points-single-var"); +// printf("points_attribute is %s\n", points_attribute); + read_fail = common_read_get_attr_mesh (mp, points_attribute, &attr_type, &attr_size, &data); + free (points_attribute); + if (!read_fail) //use points-single-var + { +// printf ("use points-single-var\n"); + meshinfo->unstructured->points = (char **) malloc (sizeof(char *)); +// meshinfo->unstructured->use_single_var = 1; // modify default value to 1 + char * coords_tmp = strdup((char *)data); +// printf ("coords_tmp is %s\n", coords_tmp); +// varid = common_read_find_var (fp, coords_tmp, 1); + varid = common_read_find_var (mp, coords_tmp, 1); + if (varid >= 0) + { +// ADIOS_VARINFO * v = common_read_inq_var(fp, fp->var_namelist[varid]); + ADIOS_VARINFO * v = common_read_inq_var(mp, mp->var_namelist[varid]); + if (v->ndim == 0) //scalar + { + adios_error (err_mesh_unstructured_invaid_points, + "Unstructured mesh %s points dimension is 0.\n", + meshinfo->name); + return adios_errno; + } + else //vector + { + meshinfo->unstructured->nspaces = v->ndim; //unstructured mesh nspaces init + meshinfo->unstructured->npoints = 1; + int j = 0; + for (j=0; jndim; j++) + meshinfo->unstructured->npoints *= v->dims[j]; + meshinfo->unstructured->npoints /= v->ndim; //unstructured mesh npoints init +// meshinfo->unstructured->points[0] = strdup (fp->var_namelist[varid]); + meshinfo->unstructured->points[0] = strdup (mp->var_namelist[varid]); + } + common_read_free_varinfo (v); + } + else + { + adios_error (err_mesh_unstructured_invaid_points, + "Unstrctured mesh %s var %s for points-single-var is not found.\n", + meshinfo->name, coords_tmp); + return adios_errno; + } + } + else //use points-multi-var + { + points_attribute = malloc (strlen("/adios_schema/")+strlen(meshinfo->name)+strlen("/coords-multi-var-num")+1 ); + strcpy (points_attribute, "/adios_schema/"); + strcat (points_attribute, meshinfo->name); + strcat (points_attribute, "/points-multi-var-num"); + data = NULL; + read_fail = common_read_get_attr_mesh (mp, points_attribute, &attr_type, &attr_size, &data); + free (points_attribute); + if (!read_fail) //found attributes points-multi-var + { + meshinfo->unstructured->nvar_points = *(int *)data; + int points_dim = *(int *)data; + meshinfo->unstructured->points = (char **) malloc (points_dim*sizeof(char *)); + meshinfo->unstructured->nspaces = points_dim; //unstructured mesh nspaces init + int first_dim = 1; + meshinfo->unstructured->npoints = 1; + char * first_match_var; + for (i=0; iname); + return adios_errno; + } + i_digits = sprintf (i_buffer, "%d", i); + char * points_var = malloc (strlen("/adios_schema/")+strlen(meshinfo->name)+strlen("/points-multi-var")+i_digits+1 ); + strcpy (points_var, "/adios_schema/"); + strcat (points_var, meshinfo->name); + strcat (points_var, "/points-multi-var"); + strcat (points_var, i_buffer); + free (i_buffer); + data = NULL; +// read_fail = common_read_get_attr_mesh (fp, points_var, &attr_type, &attr_size, &data); + read_fail = common_read_get_attr_mesh (mp, points_var, &attr_type, &attr_size, &data); + free (points_var); + if (read_fail) + { + adios_error (err_mesh_unstructured_missing_one_points, + "Unstructured mesh %s points of dim[%d] is not provided.\n", + meshinfo->name, i); + return adios_errno; + } + char * points_var_tmp = strdup((char *)data); +// printf ( "points_var_tmp is %s\n", points_var_tmp); +// varid = common_read_find_var (fp, points_var_tmp, 1); + varid = common_read_find_var (mp, points_var_tmp, 1); + if (varid >= 0) + { +// ADIOS_VARINFO * v = common_read_inq_var(fp, fp->var_namelist[varid]); + ADIOS_VARINFO * v = common_read_inq_var(mp, mp->var_namelist[varid]); + if (first_dim) + { + first_match_var = strdup (points_var_tmp); + int k = 0; + for (k=0; kndim; k++) + meshinfo->unstructured->npoints *= v->dims[k]; + first_dim = 0; + } + else + { + if (v->ndim == 1) + { + if (meshinfo->unstructured->npoints != v->dims[0]) + { + adios_error (err_mesh_unstructured_invaid_dim_points, + "Unstructured mesh %s points-multi-var%d %"PRIu64" does not match points-multi-var0 %"PRIu64".\n", + meshinfo->name, i, v->dims[0], meshinfo->unstructured->npoints); + return adios_errno; + } + } + else // v->ndim > 1, check if match for each dim + { +// ADIOS_VARINFO * v_first = common_read_inq_var(fp, first_match_var); + ADIOS_VARINFO * v_first = common_read_inq_var(mp, first_match_var); + if (v_first->ndim == 1) + { + int k = 0; + uint64_t var_dim_tmp = 1; + for (k=0; kndim; k++) + var_dim_tmp *= v->dims[k]; + if (var_dim_tmp != meshinfo->unstructured->npoints) + { + adios_error (err_mesh_unstructured_invaid_dim_points, + "Unstructured mesh %s points-multi-var%d %"PRIu64" does not match points-multi-var0 %"PRIu64".\n", + meshinfo->name, i, var_dim_tmp, meshinfo->unstructured->npoints); + return adios_errno; + } + } + else //both v_first and v has more than 2 dims + { + if (v_first->ndim != v->ndim) + { + adios_error (err_mesh_unstructured_invaid_dim_points, + "Unstructured mesh %s points-multi-var%d dim does not match points-multi-var0 dim.\n", + meshinfo->name, i); + return adios_errno; + } + else + { + int k = 0; + for (k=0; kndim; k++) + { + if (v->dims[k]!=v_first->dims[k]) + { + adios_error (err_mesh_unstructured_invaid_dim_points, + "Unstructured mesh %s points-multi-var%d dim%d does not match points-multi-var0 dim%d.\n", + meshinfo->name, i, k, k); + return adios_errno; + } + } + } + } + common_read_free_varinfo (v_first); + } + } +// meshinfo->unstructured->points[i] = strdup (fp->var_namelist[varid]); + meshinfo->unstructured->points[i] = strdup (mp->var_namelist[varid]); + common_read_free_varinfo (v); + } + else + { + adios_error (err_mesh_unstructured_missing_one_points, + "Unstructured mesh %s var of points-multi-var%d is not provided.\n", + meshinfo->name, i); + return adios_errno; + } + } // end of for loop i + } // end of if found attributes points-multi-var + else + { + adios_error (err_mesh_unstructured_missing_points, + "Unstructured mesh %s point is not provided.\n", + meshinfo->name); + return adios_errno; + } + + } // end of else use points-multi-var + + + // start processing unstructured mesh npoints + char * num_points = malloc (strlen("/adios_schema/")+strlen(meshinfo->name)+strlen("/npoints")+1 ); + strcpy (num_points, "/adios_schema/"); + strcat (num_points, meshinfo->name); + strcat (num_points, "/npoints"); + data = NULL; + read_fail = common_read_get_attr_mesh (mp, num_points, &attr_type, &attr_size, &data); + free (num_points); + if (read_fail) + { + log_info ("Unstructured mesh %s npoints is not provided. " + "We use calculated default npoints %"PRIu64" from points-var.\n", + meshinfo->name, meshinfo->unstructured->npoints); + } + else + { + uint64_t d1; + char * pEnd; + d1 = strtoull((char *)data, &pEnd, 10); +// if (d1) + if ( pEnd && pEnd[0]==0 ) + { + if (meshinfo->unstructured->npoints != d1) + { + log_warn ("In unstructured mesh %s, provided npoints %"PRIu64" does not match points calculated from points-var %"PRIu64". " + "We use calculated npoints from points-var %"PRIu64".\n", + meshinfo->name, d1, meshinfo->unstructured->npoints, meshinfo->unstructured->npoints); + } + } + else + { + char * points_var_tmp = strdup((char *)data); +// varid = common_read_find_var (fp, points_var_tmp, 1); + varid = common_read_find_var (mp, points_var_tmp, 1); + if (varid >= 0) + { +// ADIOS_VARINFO * v = common_read_inq_var(fp, fp->var_namelist[varid]); + ADIOS_VARINFO * v = common_read_inq_var(mp, mp->var_namelist[varid]); + uint64_t match_points = 0; + adios_errno = err_no_error; + match_points = common_check_var_type_to_uint64 (&v->type, v->value); + if (adios_errno < 0) + { + log_warn ("Unstructured mesh %s var type of npoints is not supported. " + "We use calculated default npoints %"PRIu64" from points-var\n", + meshinfo->name, meshinfo->unstructured->npoints); + } + if (meshinfo->unstructured->npoints != match_points) + log_warn ("Provided npoints %"PRIu64" does not match points calculated from points-var %"PRIu64". " + "We use calculated npoints from points-var %"PRIu64".\n", + match_points, meshinfo->unstructured->npoints, meshinfo->unstructured->npoints); + common_read_free_varinfo (v); + } + else + { + // check attrubites if var is not found + read_fail = common_read_get_attr_mesh (mp, points_var_tmp, &attr_type, &attr_size, &data); + if (!read_fail) + { + adios_errno = err_no_error; + meshinfo->unstructured->npoints = common_check_var_type_to_uint64 (&attr_size, data); + if (adios_errno < 0) + { + log_warn ("Unstructured mesh %s var type of npoints is not supported. " + "We use calculated default npoints %"PRIu64" from points-var\n", + meshinfo->name, meshinfo->unstructured->npoints); + } + } + else + log_warn ("Unstructured mesh %s var of npoints is not correct. " + "We use calculated default npoints %"PRIu64" from points-var\n", + meshinfo->name, meshinfo->unstructured->npoints); + } + } + } + + // start processing unstructured mesh nspaces + char * mesh_nspace = malloc (strlen("/adios_schema/")+strlen(meshinfo->name)+strlen("/nspace")+1 ); + strcpy (mesh_nspace, "/adios_schema/"); + strcat (mesh_nspace, meshinfo->name); + strcat (mesh_nspace, "/nspace"); + data = NULL; + read_fail = common_read_get_attr_mesh (mp, mesh_nspace, &attr_type, &attr_size, &data); + free (mesh_nspace); + if (read_fail) { + log_info ("Unstructured mesh %s nspace is not provided. " + "We use points dim %d for nspaces\n", + meshinfo->name, meshinfo->unstructured->nspaces); + } + else + { + int d1; + char * pEnd; + d1 = strtol((char *)data, &pEnd, 10); +// if (d1) + if ( pEnd && pEnd[0]==0 ) + { + if (meshinfo->unstructured->nspaces > d1) { + log_warn ("The provided nspaces %d is less the points dim %d. " + "We use points dim %d for nspaces\n", + d1, meshinfo->unstructured->nspaces, + meshinfo->unstructured->nspaces); + } else + meshinfo->unstructured->nspaces = d1; + } + else + { + char * spaces_var_tmp = strdup((char *)data); +// varid = common_read_find_var (fp, spaces_var_tmp, 1); + varid = common_read_find_var (mp, spaces_var_tmp, 1); + if (varid >= 0) + { +// ADIOS_VARINFO * v = common_read_inq_var(fp, fp->var_namelist[varid]); + ADIOS_VARINFO * v = common_read_inq_var(mp,mp->var_namelist[varid]); + if (meshinfo->unstructured->nspaces > *(int *)v->value) { + log_warn ("Unstructured mesh %s: the provided nspaces %d " + "is less than the points dim %d. " + "We use points dim %d for nspaces.\n", + meshinfo->name, *(int *)v->value, + meshinfo->unstructured->nspaces, + meshinfo->unstructured->nspaces); + } else + meshinfo->unstructured->nspaces = *(int *)v->value; + common_read_free_varinfo (v); + } + else + { + // check attrubites if var is not found + read_fail = common_read_get_attr_mesh (mp, spaces_var_tmp, &attr_type, &attr_size, &data); + if (!read_fail) + { + adios_errno = err_no_error; + meshinfo->unstructured->nspaces = common_check_var_type_to_int (&attr_size, data); + if (adios_errno < 0) + log_warn ("Unstructured mesh %s var type of nspaces is not suported, " + "use points dim %d for nspaces\n", + meshinfo->name, meshinfo->unstructured->nspaces); + } + else + { + log_warn ("Unstructured mesh %s var of nspaces is not correct, " + "use points dim %d for nspaces\n", + meshinfo->name, meshinfo->unstructured->nspaces); + } + } + } + } + + // start processing cells, including cell count, cell data and cell type + // how many types of cells + char * num_cell_type = malloc (strlen("/adios_schema/")+strlen(meshinfo->name)+strlen("/ncsets")+1 ); + strcpy (num_cell_type, "/adios_schema/"); + strcat (num_cell_type, meshinfo->name); + strcat (num_cell_type, "/ncsets"); + data = NULL; + read_fail = common_read_get_attr_mesh (mp, num_cell_type, &attr_type, &attr_size, &data); +// printf ("num_cell_type is %s\n", num_cell_type); + free (num_cell_type); + if (read_fail) + { + adios_error (err_mesh_unstructured_missing_ncsets, + "Unstructured mesh %s ncsets is not provided, user should have " + "mixed-cells-count/uniform-cells in xml file\n", meshinfo->name); + return adios_errno; + } + else + { + int d1 = *(int *)data; + if (d1) + { + meshinfo->unstructured->ncsets = d1; +// if (d1 == 1) +// meshinfo->unstructured->uniform_cell = 1; +// else +// meshinfo->unstructured->uniform_cell = 0; + } + else + { + adios_error (err_mesh_unstructured_invalid_ncsets, + "Reading unstructured mesh %s ncsets failed\n", + meshinfo->name); + return adios_errno; + + } + } + + // start processing ccount, how many cells for cell type +// if (meshinfo->unstructured->uniform_cell) //uniform cells + if (meshinfo->unstructured->ncsets == 1) + { + meshinfo->unstructured->ccounts = (uint64_t *) malloc (sizeof(uint64_t)); + + char * num_cells = malloc (strlen("/adios_schema/")+strlen(meshinfo->name)+strlen("/ccount")+1 ); + strcpy (num_cells, "/adios_schema/"); + strcat (num_cells, meshinfo->name); + strcat (num_cells, "/ccount"); +// printf ("num_cells is %s\n", num_cells); + data = NULL; + read_fail = common_read_get_attr_mesh (mp, num_cells, &attr_type, &attr_size, &data); + free (num_cells); + if (read_fail) + { + adios_error (err_mesh_unstructured_missing_ccount, + "Unstructured mesh %s number of cells (ccount) is required.\n", + meshinfo->name); + return adios_errno; + } + else + { + uint64_t d1; + char * pEnd; + d1 = strtoull((char *)data, &pEnd, 10); //number of cells +// if (d1) + if ( pEnd && pEnd[0]==0 ) + meshinfo->unstructured->ccounts[0] = d1; + else + { + char * ccount_tmp = strdup((char *)data); +// varid = common_read_find_var (fp, ccount_tmp, 1); + varid = common_read_find_var (mp, ccount_tmp, 1); + if (varid >= 0) + { +// ADIOS_VARINFO * v = common_read_inq_var(fp, fp->var_namelist[varid]); + ADIOS_VARINFO * v = common_read_inq_var(mp, mp->var_namelist[varid]); + if (v->type == adios_unsigned_long || v->type == adios_long) + meshinfo->unstructured->ccounts[0] = *(uint64_t *)v->value; + else + meshinfo->unstructured->ccounts[0] = *(int *)v->value; + common_read_free_varinfo (v); + } + else + { + adios_error (err_mesh_unstructured_invalid_ccount, + "Unstructured mesh %s var for ccount is invalid.\n", + meshinfo->name); + return adios_errno; + } + } + } + } + else //mixed cells + { + meshinfo->unstructured->ccounts = (uint64_t *) malloc (sizeof(uint64_t)*meshinfo->unstructured->ncsets); + int i = 0; + for (i=0; iunstructured->ncsets; i++) + { + char * i_buffer; + int i_digits; + if (meshinfo->unstructured->ncsets < 10) + i_buffer = (char *) malloc (sizeof(char)+1); + else + { + adios_error (err_mesh_unstructured_invalid_ctypes, + "Unstructured mesh %s has more than 10 cell types.\n", + meshinfo->name); + return adios_errno; + } + i_digits = sprintf (i_buffer, "%d", i); + char * ccount_var = malloc (strlen("/adios_schema/")+strlen(meshinfo->name)+strlen("/ccount")+i_digits+1 ); + strcpy (ccount_var, "/adios_schema/"); + strcat (ccount_var, meshinfo->name); + strcat (ccount_var, "/ccount"); + strcat (ccount_var, i_buffer); + free (i_buffer); + data = NULL; +// read_fail = common_read_get_attr_mesh (fp, ccount_var, &attr_type, &attr_size, &data); + read_fail = common_read_get_attr_mesh (mp, ccount_var, &attr_type, &attr_size, &data); + free (ccount_var); + if (read_fail) + { + adios_error (err_mesh_unstructured_missing_ccount, + "Unstructured mesh %s ccount%d is not provided!\n", + meshinfo->name, i); + return adios_errno; + } + else + { + uint64_t d1; + char * pEnd; + d1 = strtoull((char *)data, &pEnd, 10); +// if (d1) + if ( pEnd && pEnd[0]==0 ) + meshinfo->unstructured->ccounts[i] = d1; + else + { + char * ccount_mix_tmp = strdup((char *)data); +// varid = common_read_find_var (fp, ccount_mix_tmp, 1); + varid = common_read_find_var (mp, ccount_mix_tmp, 1); + if (varid >= 0) + { +// ADIOS_VARINFO * v = common_read_inq_var(fp, fp->var_namelist[varid]); + ADIOS_VARINFO * v = common_read_inq_var(mp, mp->var_namelist[varid]); + if (v->type == adios_long || v->type == adios_unsigned_long) + meshinfo->unstructured->ccounts[i] = *(uint64_t *)v->value; + else + meshinfo->unstructured->ccounts[i] = *(int *)v->value; + common_read_free_varinfo (v); + } + else + { + adios_error (err_mesh_unstructured_invalid_ccount, + "Unstructured mesh %s var for ccount%d is invalid\n", + meshinfo->name, i); + return adios_errno; + } + } + } + } + + } // end of ccount + + // start processing cdata +// if (meshinfo->unstructured->uniform_cell) //uniform cells + if (meshinfo->unstructured->ncsets == 1) + { + meshinfo->unstructured->cdata = (char **) malloc (sizeof(char *)); + char * data_cells = malloc (strlen("/adios_schema/")+strlen(meshinfo->name)+strlen("/cdata")+1 ); + strcpy (data_cells, "/adios_schema/"); + strcat (data_cells, meshinfo->name); + strcat (data_cells, "/cdata"); + data = NULL; + read_fail = common_read_get_attr_mesh (mp, data_cells, &attr_type, &attr_size, &data); + free (data_cells); + if (read_fail) + { + adios_error (err_mesh_unstructured_missing_cdata, + "Unstructured mesh %s cell data is required\n", + meshinfo->name); + return adios_errno; + } + else + { + char * cdata_tmp = strdup((char *)data); +// varid = common_read_find_var (fp, cdata_tmp, 1); + varid = common_read_find_var (mp, cdata_tmp, 1); + if (varid >= 0) +// meshinfo->unstructured->cdata[0] = strdup(fp->var_namelist[varid]); + meshinfo->unstructured->cdata[0] = strdup(mp->var_namelist[varid]); + else + { + adios_error (err_mesh_unstructured_invalid_cdata, + "Unstructured mesh %s var for cdata is invalid\n", + meshinfo->name); + return adios_errno; + } + } + } + else + { + meshinfo->unstructured->cdata = (char **) malloc (sizeof(char *)*meshinfo->unstructured->ncsets); + int i = 0; + for (i=0; iunstructured->ncsets; i++) + { + char * i_buffer; + int i_digits; + if (meshinfo->unstructured->ncsets < 10) + i_buffer = (char *) malloc (sizeof(char)+1); + else + { + adios_error (err_mesh_unstructured_invalid_ctypes, + "Unstructured mesh %s has more than 10 cell types!\n", + meshinfo->name); + return adios_errno; + } + i_digits = sprintf (i_buffer, "%d", i); + char * cdata_var = malloc (strlen("/adios_schema/")+strlen(meshinfo->name)+strlen("/cdata")+i_digits+1 ); + strcpy (cdata_var, "/adios_schema/"); + strcat (cdata_var, meshinfo->name); + strcat (cdata_var, "/cdata"); + strcat (cdata_var, i_buffer); + free (i_buffer); + data = NULL; + read_fail = common_read_get_attr_mesh (mp, cdata_var, &attr_type, &attr_size, &data); + free (cdata_var); + if (read_fail) + { + adios_error (err_mesh_unstructured_missing_cdata, + "Unstructured mesh %s cdata%d is not provided!\n", + meshinfo->name, i); + return adios_errno; + } + else + { + char * cdata_mix_tmp = strdup((char *)data); +// varid = common_read_find_var (fp, cdata_mix_tmp, 1); + varid = common_read_find_var (mp, cdata_mix_tmp, 1); + if (varid >= 0) +// meshinfo->unstructured->cdata[i] = strdup(fp->var_namelist[varid]); + meshinfo->unstructured->cdata[i] = strdup(mp->var_namelist[varid]); + else + { + adios_error (err_mesh_unstructured_invalid_cdata, + "Unstructured mesh %s var for cdata%d is not correct.\n", + meshinfo->name, i); + return adios_errno; + } + } + } + }// end of cdata + + // start processing ctypes +// if (meshinfo->unstructured->uniform_cell) //uniform cells + if (meshinfo->unstructured->ncsets == 1) + { + meshinfo->unstructured->ctypes = (enum ADIOS_CELL_TYPE *) malloc (sizeof(enum ADIOS_CELL_TYPE)); + char * type_cells = malloc (strlen("/adios_schema/")+strlen(meshinfo->name)+strlen("/ctype")+1 ); + strcpy (type_cells, "/adios_schema/"); + strcat (type_cells, meshinfo->name); + strcat (type_cells, "/ctype"); + data = NULL; + read_fail = common_read_get_attr_mesh (mp, type_cells, &attr_type, &attr_size, &data); + free (type_cells); + if (read_fail) + { + adios_error (err_mesh_unstructured_missing_ctype, + "Unstructured mesh %s cells type is required.\n", + meshinfo->name); + return adios_errno; + } + else + { + if (!strcmp((char *)data, "line")) + meshinfo->unstructured->ctypes[0] = ADIOS_CELL_LINE; + else if (!strcmp((char *)data, "triangle")) + meshinfo->unstructured->ctypes[0] = ADIOS_CELL_TRI; + else if (!strcmp((char *)data, "quad")) + meshinfo->unstructured->ctypes[0] = ADIOS_CELL_QUAD; + else if (!strcmp((char *)data, "hex")) + meshinfo->unstructured->ctypes[0] = ADIOS_CELL_HEX; + else if (!strcmp((char *)data, "prism")) + meshinfo->unstructured->ctypes[0] = ADIOS_CELL_PRI; + else if (!strcmp((char *)data, "tet")) + meshinfo->unstructured->ctypes[i] = ADIOS_CELL_TET; + else if (!strcmp((char *)data, "pyr")) + meshinfo->unstructured->ctypes[0] = ADIOS_CELL_PYR; + else + { + adios_error (err_mesh_unstructured_invalid_ctype, + "Unstructured mesh %s type %s of for ctype%d is invalid. " + "we use line, triangle, quad, hex, prism, tet or tet for cell types. " + "please choose to use one of them. ", + meshinfo->name, (char *)data, i); + return adios_errno; + } + } +//printf ("%d, cell type is %d\n", __LINE__, meshinfo->unstructured->ctypes[0]); + } + else + { + meshinfo->unstructured->ctypes = (enum ADIOS_CELL_TYPE *) malloc (sizeof(enum ADIOS_CELL_TYPE)*meshinfo->unstructured->ncsets); + int i = 0; + for (i=0; iunstructured->ncsets; i++) + { + char * i_buffer; + int i_digits; + if (meshinfo->unstructured->ncsets < 10) + i_buffer = (char *) malloc (sizeof(char)+1); + else + { + adios_error (err_mesh_unstructured_invalid_ctypes, + "Unstructured mesh %s has more than 10 cell types!\n", + meshinfo->name); + return adios_errno; + } + i_digits = sprintf (i_buffer, "%d", i); + char * ctype_mix_var = malloc (strlen("/adios_schema/")+strlen(meshinfo->name)+strlen("/ctype")+i_digits+1 ); + strcpy (ctype_mix_var, "/adios_schema/"); + strcat (ctype_mix_var, meshinfo->name); + strcat (ctype_mix_var, "/ctype"); + strcat (ctype_mix_var, i_buffer); + free (i_buffer); + data = NULL; + read_fail = common_read_get_attr_mesh (mp, ctype_mix_var, &attr_type, &attr_size, &data); + free (ctype_mix_var); + if (read_fail) + { + adios_error (err_mesh_unstructured_missing_ctype, + "Unstructured mesh %s ctype%d is not provided!\n", + meshinfo->name, i); + return adios_errno; + } + else + { + if (!strcmp((char *)data, "line")) + meshinfo->unstructured->ctypes[i] = ADIOS_CELL_LINE; + else if (!strcmp((char *)data, "triangle")) + meshinfo->unstructured->ctypes[i] = ADIOS_CELL_TRI; + else if (!strcmp((char *)data, "quad")) + meshinfo->unstructured->ctypes[i] = ADIOS_CELL_QUAD; + else if (!strcmp((char *)data, "hex")) + meshinfo->unstructured->ctypes[i] = ADIOS_CELL_HEX; + else if (!strcmp((char *)data, "prism")) + meshinfo->unstructured->ctypes[i] = ADIOS_CELL_PRI; + else if (!strcmp((char *)data, "tet")) + meshinfo->unstructured->ctypes[i] = ADIOS_CELL_TET; + else if (!strcmp((char *)data, "pyr")) + meshinfo->unstructured->ctypes[i] = ADIOS_CELL_PYR; + else + { + adios_error (err_mesh_unstructured_invalid_ctype, + "Unstructured mesh %s type %s of for ctype%d is invalid. " + "we use line, triangle, quad, hex, prism, tet or tet for cell types. " + "please choose to use one of them. ", + meshinfo->name, (char *)data, i); + return adios_errno; + + } + } + } + } + } // end of unstructured mesh + +// fp->attr_namelist[i] +// common_read_get_attr_mesh (f, f->attr_namelist[i], &attr_type, &attr_size, &data); + + //return meshinfo; + return err_no_error; +} + +void common_read_free_meshinfo (ADIOS_MESH * meshinfo) +{ + if(meshinfo) + { + int i = 0; + if (meshinfo->name) + { + free (meshinfo->name); + meshinfo->name = NULL; + } + if (meshinfo->file_name) + { + free (meshinfo->file_name); + meshinfo->file_name = NULL; + } + switch (meshinfo->type) { + case ADIOS_MESH_UNIFORM: + { + MESH_UNIFORM *bp = meshinfo->uniform; + if (bp->dimensions) + free (bp->dimensions); + if (bp->origins) + free (bp->origins); + if (bp->spacings) + free (bp->spacings); + if (bp->maximums) + free (bp->maximums); + free (meshinfo->uniform); + break; + } + case ADIOS_MESH_RECTILINEAR: + { + MESH_RECTILINEAR *bp = meshinfo->rectilinear; + if (bp->dimensions) + free (bp->dimensions); + for (i = 0; i < meshinfo->rectilinear->num_dimensions; i++) + { + if (bp->coordinates[i]) + free (bp->coordinates[i]); + } + free (meshinfo->rectilinear); + break; + } + case ADIOS_MESH_STRUCTURED: + { + MESH_STRUCTURED *bp = meshinfo->structured; + if (bp->dimensions) + free (bp->dimensions); + for (i = 0; i < meshinfo->structured->num_dimensions; i++) + { + if (bp->points[i]) + free (bp->points[i]); + } + free (meshinfo->unstructured); + break; + } + case ADIOS_MESH_UNSTRUCTURED: + { + MESH_UNSTRUCTURED *bp = meshinfo->unstructured; + if (bp->ccounts) + free (bp->ccounts); + if (bp->ctypes) + free (bp->ctypes); + for (i = 0; i < meshinfo->unstructured->ncsets; i++) + { + if (bp->cdata[i]) + free (bp->cdata[i]); +// if (bp->ctypes[i]) +// free (bp->ctypes[i]); + + } + for (i = 0; i < meshinfo->unstructured->nvar_points; i++) + { + if (bp->points[i]) + free (bp->points[i]); + } + free (meshinfo->unstructured); + break; + } + default: + break; + } + free (meshinfo); + } +} + +int common_read_schedule_read (const ADIOS_FILE * fp, + const ADIOS_SELECTION * sel, + const char * varname, + int from_steps, + int nsteps, + const char * param, // NCSU ALACRITY-ADIOS + void * data) + +{ + int retval; + + adios_errno = err_no_error; + if (fp) { + int varid = common_read_find_var (fp, varname,0); + if (varid >= 0) { + retval = common_read_schedule_read_byid (fp, sel, varid, from_steps, nsteps, param /* NCSU ALACRITY-ADIOS */, data); + } else { + retval = adios_errno; // adios_errno was set in common_read_find_var + } + } else { + adios_error (err_invalid_file_pointer, "Null pointer passed as file to adios_schedule_read()\n"); + retval = err_invalid_file_pointer; + } + return retval; +} + +// NCSU ALACRITY-ADIOS - Modified to delegate to transform method when called +// on a transformed variable +int common_read_schedule_read_byid (const ADIOS_FILE * fp, + const ADIOS_SELECTION * sel, + int varid, + int from_steps, + int nsteps, + const char * param, // NCSU ALACRITY-ADIOS + void * data) + +{ + struct common_read_internals_struct * internals = (struct common_read_internals_struct *) fp->internal_data; + int retval; + + internals = (struct common_read_internals_struct *) fp->internal_data; + + adios_errno = err_no_error; + if (fp) { + if (varid >=0 && varid < fp->nvars) { + // NCSU ALACRITY-ADIOS - If the variable is transformed, intercept + // the read scheduling and schedule our own reads. + // Note: Use the infocache to save varinfos across calls, since otherwise + // a large number of schedule_reads will have bad performance due to + // expensive inq_var calls. + const data_view_t old_view = common_read_set_data_view((ADIOS_FILE *)fp, PHYSICAL_DATA_VIEW); // const-ness cheat, since we're going to set it right back + ADIOS_VARINFO *raw_varinfo = adios_infocache_inq_varinfo(fp, internals->infocache, varid); //common_read_inq_var_raw_byid(fp, varid); // Get the *raw* varinfo + common_read_set_data_view((ADIOS_FILE *)fp, old_view); // const-ness cheat, since we're now setting it back + + ADIOS_TRANSINFO *transinfo = adios_infocache_inq_transinfo(fp, internals->infocache, varid); //common_read_inq_transinfo(fp, raw_varinfo); // Get the transform info (i.e. original var info) + assert(raw_varinfo && transinfo); + + if (from_steps >= 0 && from_steps + nsteps <= raw_varinfo->nsteps) { + // If this variable is transformed and we are in logical view mode, + // delegate to the transform method to generate subrequests + // Else, do the normal thing + if (internals->data_view == LOGICAL_DATA_VIEW && transinfo && transinfo->transform_type != adios_transform_none) { + adios_transform_raw_read_request *subreq; + adios_transform_pg_read_request *pg_reqgroup; + adios_transform_read_request *new_reqgroup; + + // Generate the read request group and append it to the list + new_reqgroup = adios_transform_generate_read_reqgroup(raw_varinfo, transinfo, fp, sel, from_steps, nsteps, param, data); + + // Proceed to register the read request and schedule all of its grandchild raw + // read requests ONLY IF a non-NULL reqgroup was returned (i.e., the user's + // selection intersected at least one PG). + if (new_reqgroup) { + adios_transform_read_request_append(&internals->transform_reqgroups, new_reqgroup); + + // Now schedule all of the new subrequests + retval = 0; + for (pg_reqgroup = new_reqgroup->pg_reqgroups; pg_reqgroup; pg_reqgroup = pg_reqgroup->next) { + for (subreq = pg_reqgroup->subreqs; subreq; subreq = subreq->next) { + retval |= internals->read_hooks[internals->method].adios_schedule_read_byid_fn( + fp, subreq->raw_sel, varid+internals->group_varid_offset, pg_reqgroup->timestep, 1, subreq->data); + } + } + } + } else { + // Old functionality + // DON'T FREE varinfo/transinfo, since they are stored in the infocached + // common_read_free_transinfo (raw_varinfo, transinfo); + // common_read_free_varinfo (raw_varinfo); + + retval = internals->read_hooks[internals->method].adios_schedule_read_byid_fn (fp, sel, varid+internals->group_varid_offset, from_steps, nsteps, data); + } + } else { + adios_error (err_invalid_timestep, + "Variable %s does not have timesteps %d to %d (last timestep is %d)\n", + fp->var_namelist[varid], from_steps, from_steps + nsteps - 1, raw_varinfo->nsteps - 1); + retval = err_invalid_timestep; + } + } else { + adios_error (err_invalid_varid, + "Variable ID %d is not valid in adios_schedule_read_byid(). " + "Available 0..%d\n", varid, fp->nvars-1); + retval = err_invalid_varid; + } + } else { + adios_error (err_invalid_file_pointer, "Null pointer passed as file to adios_schedule_read_byid()\n"); + retval = err_invalid_file_pointer; + } + + return retval; +} + +// NCSU ALACRITY-ADIOS - Modified to delegate to transform method to combine +// read subrequests to answer original requests +int common_read_perform_reads (const ADIOS_FILE *fp, int blocking) +{ + struct common_read_internals_struct * internals; + int retval; + + adios_errno = err_no_error; + if (fp) { + internals = (struct common_read_internals_struct *) fp->internal_data; + retval = internals->read_hooks[internals->method].adios_perform_reads_fn (fp, blocking); + + // NCSU ALACRITY-ADIOS - If this was a blocking call, consider all read + // request groups completed, and reassemble via the transform method. + // Otherwise, do nothing. + if (blocking) { + adios_transform_process_all_reads(&internals->transform_reqgroups); + } else { + // Do nothing; reads will be performed by check_reads + } + } else { + adios_error (err_invalid_file_pointer, "Null pointer passed as file to adios_perform_reads()\n"); + retval = err_invalid_file_pointer; + } + return retval; +} + +int common_read_check_reads (const ADIOS_FILE * fp, ADIOS_VARCHUNK ** chunk) +{ + struct common_read_internals_struct * internals; + int retval; + + adios_errno = err_no_error; + if (fp) { + internals = (struct common_read_internals_struct *) fp->internal_data; + + // NCSU ALACRITY-ADIOS - Handle those VARCHUNKs that correspond to + // subrequests; don't return until we get a completed one + do { + // First, allow the transform layer to clean up any resources + // remaining from the previous check_reads (e.g., internal + // buffers that were passed to the user via varchunks) + adios_transform_cleanup_from_previous_check_reads(&internals->transform_reqgroups); + + // Read a chunk of (potentially transformed) data from the transport layer + retval = internals->read_hooks[internals->method].adios_check_reads_fn (fp, chunk); + + // If no more chunks are available, stop now + if (!*chunk) break; + + // Give the transform layer a chance to attempt to process the chunk + // If the chunk does not contain transformed data, it will remain untouched + // If it does contain transformed data, it will be replaced with a + // new, de-transformed chunk + adios_transform_process_read_chunk(&internals->transform_reqgroups, chunk); + } while (!*chunk); // Keep reading until we have a chunk to return + } else { + adios_error (err_invalid_file_pointer, "Null pointer passed as file to adios_check_reads()\n"); + retval = err_invalid_file_pointer; + } + return retval; +} + +void common_read_free_chunk (ADIOS_VARCHUNK *chunk) +{ + /** Free the memory of a chunk allocated inside adios_check_reads(). + * It only frees the ADIOS_VARCHUNK struct and the ADIOS_SELECTION struct + * pointed by the chunk. The data pointer should never be freed since + * that memory belongs to the reading method. + */ + if (chunk) { + if (chunk->sel) { + free_selection(chunk->sel); + //free(chunk->sel); + chunk->sel = NULL; + } + free(chunk); + } +} + + +int common_read_get_attr (const ADIOS_FILE * fp, + const char * attrname, + enum ADIOS_DATATYPES * type, + int * size, + void ** data) +{ + int retval; + + adios_errno = err_no_error; + if (fp) { + int attrid = common_read_find_attr (fp->nattrs, fp->attr_namelist, attrname, 0); + if (attrid > -1) { + retval = common_read_get_attr_byid (fp, attrid, type, size, data); + } else { + retval = adios_errno; // adios_errno was set in common_read_find_attr + } + } else { + adios_error (err_invalid_file_pointer, "Null pointer passed as file to adios_read_get_attr()\n"); + retval = err_invalid_file_pointer; + } + return retval; +} + + +int common_read_get_attr_byid (const ADIOS_FILE * fp, + int attrid, + enum ADIOS_DATATYPES * type, + int * size, + void ** data) +{ + struct common_read_internals_struct * internals; + int retval; + + adios_errno = err_no_error; + if (fp) { + if (attrid >= 0 && attrid < fp->nattrs) { + internals = (struct common_read_internals_struct *) fp->internal_data; + retval = internals->read_hooks[internals->method].adios_get_attr_byid_fn (fp, attrid+internals->group_attrid_offset, type, size, data); + } else { + adios_error (err_invalid_attrid, + "Attribute ID %d is not valid in adios_get_attr_byid(). " + "Available 0..%d\n", attrid, fp->nattrs-1); + retval = err_invalid_attrid; + } + } else { + adios_error (err_invalid_file_pointer, "Null pointer passed as file to adios_read_get_attr_byid()\n"); + retval = err_invalid_file_pointer; + } + return retval; +} + + +const char * common_read_type_to_string (enum ADIOS_DATATYPES type) +{ + switch (type) + { + case adios_unsigned_byte: return "unsigned byte"; + case adios_unsigned_short: return "unsigned short"; + case adios_unsigned_integer: return "unsigned integer"; + case adios_unsigned_long: return "unsigned long long"; + + case adios_byte: return "byte"; + case adios_short: return "short"; + case adios_integer: return "integer"; + case adios_long: return "long long"; + + case adios_real: return "real"; + case adios_double: return "double"; + case adios_long_double: return "long double"; + + case adios_string: return "string"; + case adios_complex: return "complex"; + case adios_double_complex: return "double complex"; + + default: + { + static char buf [50]; + sprintf (buf, "(unknown: %d)", type); + return buf; + } + } +} + + +int common_read_type_size(enum ADIOS_DATATYPES type, void *data) +{ + return bp_get_type_size(type, data); +} + + +int common_read_get_grouplist (const ADIOS_FILE *fp, char ***group_namelist) +{ + struct common_read_internals_struct * internals; + int retval; + + adios_errno = err_no_error; + if (fp) { + internals = (struct common_read_internals_struct *) fp->internal_data; + retval = internals->ngroups; + *group_namelist = internals->group_namelist; + } else { + adios_error (err_invalid_file_pointer, "Null pointer passed as file to adios_get_grouplist()\n"); + retval = err_invalid_file_pointer; + } + return retval; +} + +/** Select a subset of variables and attributes to present in ADIOS_FILE struct. + ADIOS_FILE-> nvars, nattrs, var_namelist, attr_namelist will contain + only a subset of all variables and attributes. + internals-> full_* stores the complete lists for reset or change of group + */ +int common_read_group_view (ADIOS_FILE *fp, int groupid) +{ + struct common_read_internals_struct * internals; + int retval, i; + + adios_errno = err_no_error; + if (fp) { + internals = (struct common_read_internals_struct *) fp->internal_data; + if (groupid >= 0 && groupid < internals->ngroups) { + /* 1. save complete list if first done */ + if (internals->group_in_view == -1) { + internals->full_nvars = (uint32_t) fp->nvars; + internals->full_varnamelist = fp->var_namelist; + internals->full_nattrs = (uint32_t) fp->nattrs; + internals->full_attrnamelist = fp->attr_namelist; + } + /* Set ID offsets for easier indexing of vars/attrs in other functions */ + internals->group_varid_offset = 0; + internals->group_attrid_offset = 0; + for (i=0; igroup_varid_offset += internals->nvars_per_group[i]; + internals->group_attrid_offset += internals->nattrs_per_group[i]; + } + /* Set view to this group */ + fp->nvars = internals->nvars_per_group[groupid]; + fp->var_namelist = &(internals->full_varnamelist [internals->group_varid_offset]); + fp->nattrs = internals->nattrs_per_group[groupid]; + fp->attr_namelist = &(internals->full_attrnamelist [internals->group_attrid_offset]); + internals->group_in_view = groupid; + retval = 0; + + } else if (groupid == -1) { + /* Reset to full view */ + fp->nvars = internals->full_nvars; + fp->var_namelist = internals->full_varnamelist; + fp->nattrs = internals->full_nattrs; + fp->attr_namelist = internals->full_attrnamelist; + internals->group_varid_offset = 0; + internals->group_attrid_offset = 0; + internals->group_in_view = -1; + retval = 0; + } else { + adios_error (err_invalid_group, "Invalid group ID in adios_group_view()\n"); + retval = err_invalid_group; + } + } else { + adios_error (err_invalid_file_pointer, "Null pointer passed as file to adios_group_view()\n"); + retval = err_invalid_file_pointer; + } + return retval; +} + +/* internal function to support version 1 time-dimension reads + called from adios_read_v1.c and adiosf_read_v1.c +*/ +int common_read_is_var_timed (const ADIOS_FILE *fp, int varid) +{ + struct common_read_internals_struct * internals; + int retval; + + adios_errno = err_no_error; + if (fp) { + internals = (struct common_read_internals_struct *) fp->internal_data; + retval = internals->read_hooks[internals->method].adios_is_var_timed_fn (fp, varid+internals->group_varid_offset); + } else { + adios_error (err_invalid_file_pointer, "Null pointer passed as file to common_read_is_var_timed()\n"); + retval = err_invalid_file_pointer; + } + return retval; +} + +void common_read_print_fileinfo (const ADIOS_FILE *fp) +{ + int i; + int ngroups; + char **group_namelist; + ngroups = common_read_get_grouplist (fp, &group_namelist); + + printf ("---------------------------\n"); + printf (" file information\n"); + printf ("---------------------------\n"); + printf (" # of groups: %d\n" + " # of variables: %d\n" + " # of attributes: %d\n" + " current step: %d\n" + " last step: %d\n", + ngroups, + fp->nvars, + fp->nattrs, + fp->current_step, + fp->last_step); + printf ("---------------------------\n"); + printf (" var information\n"); + printf ("---------------------------\n"); + printf (" var id\tname\n"); + if (fp->var_namelist) { + for (i=0; invars; i++) + printf("\t%d)\t%s\n", i, fp->var_namelist[i]); + } + printf ("---------------------------\n"); + printf (" attribute information\n"); + printf ("---------------------------\n"); + printf (" attr id\tname\n"); + if (fp->attr_namelist) { + for (i=0; inattrs; i++) + printf("\t%d)\t%s\n", i, fp->attr_namelist[i]); + } + printf ("---------------------------\n"); + printf (" group information\n"); + printf ("---------------------------\n"); + if (group_namelist) { + for (i=0; itype = ADIOS_SELECTION_BOUNDINGBOX; + sel->u.bb.ndim = ndim; + sel->u.bb.start = (uint64_t *)start; + sel->u.bb.count = (uint64_t *)count; + } else { + adios_error(err_no_memory, "Cannot allocate memory for bounding box selection\n"); + } + return sel; +} + + +ADIOS_SELECTION * common_read_selection_points (int ndim, uint64_t npoints, const uint64_t *points) +{ + adios_errno = err_no_error; + ADIOS_SELECTION * sel = (ADIOS_SELECTION *) malloc (sizeof(ADIOS_SELECTION)); + if (sel) { + sel->type = ADIOS_SELECTION_POINTS; + sel->u.points.ndim = ndim; + sel->u.points.npoints = npoints; + sel->u.points.points = (uint64_t *) points; + } else { + adios_error(err_no_memory, "Cannot allocate memory for points selection\n"); + } + return sel; +} + +ADIOS_SELECTION * common_read_selection_writeblock (int index) +{ + adios_errno = err_no_error; + ADIOS_SELECTION * sel = (ADIOS_SELECTION *) malloc (sizeof(ADIOS_SELECTION)); + if (sel) { + sel->type = ADIOS_SELECTION_WRITEBLOCK; + sel->u.block.index = index; + // NCSU ALACRITY-ADIOS: Set the writeblock selection to be a full-PG selection by default + sel->u.block.is_absolute_index = 0; + sel->u.block.is_sub_pg_selection = 0; + } else { + adios_error(err_no_memory, "Cannot allocate memory for writeblock selection\n"); + } + return sel; +} + +ADIOS_SELECTION * common_read_selection_auto (char *hints) +{ + adios_errno = err_no_error; + ADIOS_SELECTION * sel = (ADIOS_SELECTION *) malloc (sizeof(ADIOS_SELECTION)); + if (sel) { + sel->type = ADIOS_SELECTION_AUTO; + sel->u.autosel.hints = hints; + } else { + adios_error(err_no_memory, "Cannot allocate memory for auto selection\n"); + } + return sel; +} + +void common_read_selection_delete (ADIOS_SELECTION *sel) +{ + free(sel); +} diff --git a/tests/libs/adios/src/core/common_read.h b/tests/libs/adios/src/core/common_read.h new file mode 100644 index 0000000000..189d259d75 --- /dev/null +++ b/tests/libs/adios/src/core/common_read.h @@ -0,0 +1,126 @@ +/* + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + */ + +/* + * Internal read API for C and Fortran read APIs + */ +#ifndef __COMMON_READ_H__ +#define __COMMON_READ_H__ + +#include "public/adios_types.h" +#include "public/adios_read_v2.h" /* C API's struct's are used here */ +#include "core/adios_infocache.h" +#include "core/transforms/adios_transforms_read.h" // NCSU ALACRITY-ADIOS +#include "core/transforms/adios_transforms_transinfo.h" // NCSU ALACRITY-ADIOS + +#include + +int common_read_init_method (enum ADIOS_READ_METHOD method, + MPI_Comm comm, + const char * parameters); + +int common_read_finalize_method(enum ADIOS_READ_METHOD method); + +ADIOS_FILE * common_read_open (const char * fname, + enum ADIOS_READ_METHOD method, + MPI_Comm comm, + enum ADIOS_LOCKMODE lock_mode, + float timeout_sec); + +ADIOS_FILE * common_read_open_file (const char * fname, + enum ADIOS_READ_METHOD method, + MPI_Comm comm); + +int common_read_close(ADIOS_FILE *fp); + +// Return the infocache associated with the given file +// WARNING: varinfos/transinfos will be invalidated upon advance_step or close, +// so users of this infocache should be careful not to use its returned infos +// beyond the current timestep or after close. +adios_infocache * common_read_get_file_infocache(ADIOS_FILE *fp); + +data_view_t common_read_set_data_view(ADIOS_FILE *fp, data_view_t data_view); // NCSU ALACRITY-ADIOS +data_view_t common_read_get_data_view(const ADIOS_FILE *fp); + +int common_read_advance_step (ADIOS_FILE *fp, int last, float timeout_sec); +void common_read_release_step (ADIOS_FILE *fp); + +ADIOS_VARINFO * common_read_inq_var (const ADIOS_FILE *fp, const char * varname); +ADIOS_VARINFO * common_read_inq_var_byid (const ADIOS_FILE *fp, int varid); +ADIOS_VARINFO * common_read_inq_var_raw_byid (const ADIOS_FILE *fp, int varid); +ADIOS_TRANSINFO * common_read_inq_transinfo(const ADIOS_FILE *fp, const ADIOS_VARINFO *vi); // NCSU ALACRITY-ADIOS +int common_read_inq_var_stat (const ADIOS_FILE *fp, ADIOS_VARINFO * varinfo, + int per_step_stat, int per_block_stat); + +int common_read_inq_trans_blockinfo(const ADIOS_FILE *fp, const ADIOS_VARINFO *vi, ADIOS_TRANSINFO * ti); +int common_read_inq_var_blockinfo_raw (const ADIOS_FILE *fp, ADIOS_VARINFO * varinfo); +int common_read_inq_var_blockinfo (const ADIOS_FILE *fp, ADIOS_VARINFO * varinfo); +int common_read_inq_trans_blockinfo(const ADIOS_FILE *fp, const ADIOS_VARINFO *vi, ADIOS_TRANSINFO * ti); // NCSU ALACRITY-ADIOS +void common_read_free_varinfo (ADIOS_VARINFO *vp); +void common_read_free_transinfo(const ADIOS_VARINFO *vi, ADIOS_TRANSINFO *ti); // NCSU ALACRITY-ADIOS + +ADIOS_MESH * common_read_inq_mesh_byid(ADIOS_FILE *fp, int meshid); +int common_read_inq_var_meshinfo (const ADIOS_FILE *fp, ADIOS_VARINFO * varinfo); +int common_read_complete_meshinfo (ADIOS_FILE *datafile, ADIOS_FILE *meshfile, ADIOS_MESH *meshinfo); +void common_read_free_meshinfo (ADIOS_MESH * meshinfo); + +int common_read_schedule_read (const ADIOS_FILE * fp, + const ADIOS_SELECTION * sel, + const char * varname, + int from_steps, + int nsteps, + const char * param, + void * data); + +int common_read_schedule_read_byid (const ADIOS_FILE * fp, + const ADIOS_SELECTION * sel, + int varid, + int from_steps, + int nsteps, + const char * param, + void * data); + +int common_read_perform_reads (const ADIOS_FILE *fp, int blocking); +int common_read_check_reads (const ADIOS_FILE * fp, ADIOS_VARCHUNK ** chunk); +void common_read_free_chunk (ADIOS_VARCHUNK *chunk); + + +int common_read_get_attr (const ADIOS_FILE * fp, + const char * attrname, + enum ADIOS_DATATYPES * type, + int * size, + void ** data); + +int common_read_get_attr_byid (const ADIOS_FILE * fp, int attrid, enum ADIOS_DATATYPES * type, + int * size, void ** data); + +const char * common_read_type_to_string (enum ADIOS_DATATYPES type); +int common_read_type_size(enum ADIOS_DATATYPES type, void *data); + + +int common_read_get_grouplist (const ADIOS_FILE *fp, char ***group_namelist); +int common_read_group_view (ADIOS_FILE *fp, int groupid); + +/* internal function to support version 1 time-dimension reads + called from adios_read_v1.c and adiosf_read_v1.c +*/ +int common_read_is_var_timed (const ADIOS_FILE *fp, int varid); + +int common_read_get_dimension_order (ADIOS_FILE * fp); +void common_read_reset_dimension_order (const ADIOS_FILE *fp, int is_fortran); +void common_read_print_fileinfo (const ADIOS_FILE *fp); + +// selections +ADIOS_SELECTION * common_read_selection_boundingbox (int ndim, const uint64_t *start, const uint64_t *count); +ADIOS_SELECTION * common_read_selection_points (int ndim, uint64_t npoints, const uint64_t *points); +ADIOS_SELECTION * common_read_selection_writeblock (int index); +ADIOS_SELECTION * common_read_selection_auto (char *hints); +void common_read_selection_delete (ADIOS_SELECTION *sel); + + + +#endif diff --git a/tests/libs/adios/src/core/ds_metadata.h b/tests/libs/adios/src/core/ds_metadata.h new file mode 100644 index 0000000000..32410afaca --- /dev/null +++ b/tests/libs/adios/src/core/ds_metadata.h @@ -0,0 +1,113 @@ +/* + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + */ + +/* + * Metadata (index) for DATASPACES and DIMES methods + * + * Data structures to store the index (aka footer for BP format) that can be + * put into DataSpaces to describe the variables/attributes there + */ +#ifndef __SPACES_INDEX_H__ +#define __SPACES_INDEX_H__ + +#include +#include +#include +#include "public/adios_types.h" +#include "public/adios_read.h" + +#define MAX_DS_NDIM 10 + +/* functions currently defined in adios_dataspaces.c and read_dataspaces.c */ + +/* Tell the DataSpaces order of dimensions for a 1-3 dim array written from Fortran or C. + unpack=1: the reverse of packing (to retrieve the original order). + didx should be an int [3] array in any case. + */ +void ds_dimension_ordering(int ndims, int is_app_fortran, int unpack, int *didx); + +void ds_pack_file_info (int time, int nvars, int nattrs, int group_index_len, char * groupname, + /*OUT*/char **buf, /*OUT*/int *buf_len); + +//ADIOS_FILE * ds_unpack_file_info (char * buf, int buf_len, +// /* OUT */ struct adios_read_dart_data_struct * ds) + +void ds_pack_group_info (struct adios_file_struct *fd + ,struct adios_method_struct * method + ,struct adios_index_struct_v1 *index + ,char ** buffer, int *buffer_size, int *nvars, int *nattrs + ); + +//ADIOS_GROUP * ds_unpack_group_info (char * buf, struct adios_read_dart_group_struct * group); + +void dimes_dimension_ordering(int ndims, int is_app_fortran, int unpack, int *didx); + +void dimes_pack_file_info (int time, int nvars, int nattrs, int group_index_len, char * groupname, + /*OUT*/char **buf, /*OUT*/int *buf_len); + +void dimes_pack_group_info (struct adios_file_struct *fd + ,struct adios_method_struct * method + ,struct adios_index_struct_v1 *index + ,char ** buffer, int *buffer_size, int *nvars, int *nattrs + ); + +void ds_ints_to_str (int ndim, int *values, char *s); +void ds_int64s_to_str(int ndim, uint64_t *values, char *s); +void dimes_ints_to_str (int ndim, int *values, char *s); +void dimes_int64s_to_str(int ndim, uint64_t *values, char *s); + +/*********************** + FILE info buffer: + +SI = sizeof(int) = 4 + + 128 fix bytes, 1 group + bytes content + SI = length of this buffer (=128 bytes fixed right now) + SI = time index + SI = number of variables in file (actually in the group) + SI = number of attributes in file (actually in the group) + SI = length of group index (in GROUP@fn/gn variable) + SI = N length of name + N = group name (no \0) +*/ + + +/********************* + GROUP info buffer: + + SI = sizeof(int) = 4 + + Size = N bytes, N is found in FILE buffer (length of group index) + bytes content + SI = length of this buffer (=N above) + SI = NV number of variables in file (actually in the group) + SI = NA number of attributes in file (actually in the group) + NV*( + SI = L length of name + L = variable name (includes path) (no \0) + SI = type of variable + SI = has time dimension (0 or 1) (time dim is not stored) + SI = D number of dimensions + D*( + 8 = ith dimension + ) + K = value of scalar variable (if D = 0), K is according to type + string represented as (SI bytes for len, then string w/o \0) + ) + NA*( + SI = L length of name + L = attribute name (includes path) (no \0) + SI = type of attribute + K = value of attribute, K is according to type + string represented as (SI bytes for len, then string w/o \0) + ) + +*/ + + +#endif diff --git a/tests/libs/adios/src/core/flexpath.h b/tests/libs/adios/src/core/flexpath.h new file mode 100644 index 0000000000..51fb551e12 --- /dev/null +++ b/tests/libs/adios/src/core/flexpath.h @@ -0,0 +1,274 @@ +#ifndef _FLEXPATH_H +#define _FLEXPATH_H + + +#include "core/adios_logger.h" + +#define CONTACT_LENGTH 1024 + +#define READER_CONTACT_FILE "reader_info.txt" +#define WRITER_CONTACT_FILE "writer_info.txt" +#define READER_READY_FILE "reader_ready.txt" +#define WRITER_READY_FILE "writer_ready.txt" +#define FP_RANK_ATTR_NAME "fp_rank_num" +#define FP_DST_ATTR_NAME "fp_dst_rank" +#define FP_DIM_ATTR_NAME "fp_dim" +#define FP_NDIMS_ATTR_NAME "fp_ndims" + +#define CLOSE_MSG 0 +#define OPEN_MSG 1 +#define ACK_MSG 2 +#define INIT_MSG 3 +#define EOS_MSG 4 + +#define FP_FORTRAN_MODE 1 +#define FP_C_MODE 0 + +#define perr(...) if(getenv("FP_DEBUG")) fprintf(stderr, __VA_ARGS__); + +#define fp_log(LOG, ...) \ + if(getenv("FP_DEBUG")) { \ + if(strcmp(getenv("FP_DEBUG"),"ALL")==0) { \ + fprintf(stderr, __VA_ARGS__); \ + } else if(strcmp(getenv("FP_DEBUG"),LOG)==0) { \ + fprintf(stderr, __VA_ARGS__); \ + } \ + } + +#define fp_write_log(LOG, ...) \ + if(getenv("FP_DEBUG")) { \ + if(strcmp(getenv("FP_DEBUG"),"ALL")==0) { \ + fprintf(stderr, "%d %s:", flexpathWriteData.rank, LOG); \ + fprintf(stderr, __VA_ARGS__); \ + } else { \ + char* env_tok; \ + char* env = strdup(getenv("FP_DEBUG")); \ + env_tok = strtok(env, ","); \ + while(env_tok) { \ + if(strcmp(env_tok, LOG)==0) { \ + fprintf(stderr, "%d %s:", flexpathWriteData.rank, LOG); \ + fprintf(stderr, __VA_ARGS__); \ + } \ + env_tok = strtok(NULL, ","); \ + } \ + } \ + } + + +//adios_logger(4,1, __VA_ARGS__); + +#define CONTACT_STR_LEN 50 + +typedef enum {FORMAT, DATA, EVGROUP, STEP } Flush_type; + +typedef struct _update_step_msg{ + int step; + int finalized; + int condition; +}update_step_msg; + +typedef struct _drop_evgroup{ + int step; + int condition; +}drop_evgroup_msg; +/* + * Contains the offset information for a variable for all writers. + * offsets_per_rank is == ndims. + */ +typedef struct _offset_struct{ + int offsets_per_rank; + int total_offsets; + uint64_t *local_dimensions; + uint64_t *local_offsets; + uint64_t *global_dimensions; +} offset_struct; + +typedef struct _var { + char * name; + int noffset_structs; + offset_struct * offsets; +} global_var, *global_var_ptr; + +typedef struct _evgroup { + int condition; + int num_vars; + int step; + int process_id; + char *group_name; + global_var* vars; +} evgroup, *evgroup_ptr; + +typedef struct _op_msg +{ + int process_id; + char *file_name; + int type; //4 = end_of_stream, 3 = init, 2 = ack, 1 = open, 0 = close, + int step; + int condition; +} op_msg, *op_msg_ptr; + +typedef struct flush_msg_ { + Flush_type type; + int process_id; + int condition; + int id; +} Flush_msg, *Flush_msg_ptr; + +typedef struct var_msg_ { + char* var_name; + int process_id; + int condition; +} Var_msg, *Var_msg_ptr; + +typedef struct _complex_dummy +{ + float r; + float i; +} complex_dummy; + +typedef struct _double_complex_dummy +{ + double r; + double i; +} double_complex_dummy; + +static FMField complex_dummy_field_list[] = +{ + {"r", "float", sizeof(float), FMOffset(complex_dummy*, r)}, + {"i", "float", sizeof(float), FMOffset(complex_dummy*, i)}, + {NULL, NULL, 0, 0} +}; + +static FMField double_complex_dummy_field_list[] = +{ + {"r", "double", sizeof(double), FMOffset(double_complex_dummy*, r)}, + {"i", "double", sizeof(double), FMOffset(double_complex_dummy*, i)}, + {NULL, NULL, 0, 0} +}; + +static FMField update_step_msg_field_list[]= +{ + {"step", "integer", sizeof(int), FMOffset(update_step_msg*, step)}, + {"finalized", "integer", sizeof(int), FMOffset(update_step_msg*, finalized)}, + {"condition", "integer", sizeof(int), FMOffset(update_step_msg*, condition)}, + {NULL, NULL, 0, 0} +}; + +static FMField drop_evgroup_msg_field_list[]= +{ + {"step", "integer", sizeof(int), FMOffset(drop_evgroup_msg*, step)}, + {"condition", "integer", sizeof(int), FMOffset(drop_evgroup_msg*, condition)}, + {NULL, NULL, 0, 0} +}; + +static FMField offset_struct_field_list[]= +{ + {"offsets_per_rank", "integer", sizeof(int), FMOffset(offset_struct*, offsets_per_rank)}, + {"total_offsets", "integer", sizeof(int), FMOffset(offset_struct*, total_offsets)}, + {"local_dimensions", "integer[total_offsets]", sizeof(uint64_t), FMOffset(offset_struct*, local_dimensions)}, + {"local_offsets", "integer[total_offsets]", sizeof(uint64_t), FMOffset(offset_struct*, local_offsets)}, + {"global_dimensions", "integer[offsets_per_rank]", sizeof(uint64_t), FMOffset(offset_struct*, global_dimensions)}, + {NULL, NULL, 0, 0} +}; + +static FMField global_var_field_list[]= +{ + {"name", "string", sizeof(char*), FMOffset(global_var_ptr, name)}, + {"noffset_structs", "integer", sizeof(int), FMOffset(global_var_ptr, noffset_structs)}, + {"offsets", "offset_struct[noffset_structs]", sizeof(offset_struct), FMOffset(global_var_ptr, offsets)}, + {NULL, NULL, 0, 0} +}; + +static FMField evgroup_field_list[]= +{ + {"condition", "integer", sizeof(int), FMOffset(evgroup_ptr, condition)}, + {"num_vars", "integer", sizeof(int), FMOffset(evgroup_ptr, num_vars)}, + {"step", "integer", sizeof(int), FMOffset(evgroup_ptr, step)}, + {"process_id", "integer", sizeof(int), FMOffset(evgroup_ptr, process_id)}, + {"group_name", "string", sizeof(char*), FMOffset(evgroup_ptr, group_name)}, + {"vars", "global_var[num_vars]", sizeof(global_var), FMOffset(evgroup_ptr, vars)}, + {NULL, NULL, 0, 0} +}; + +static FMField flush_field_list[] = +{ + {"type", "integer", sizeof(Flush_type), FMOffset(Flush_msg_ptr, type)}, + {"process_id", "integer", sizeof(int), FMOffset(Flush_msg_ptr, process_id)}, + {"condition", "integer", sizeof(int), FMOffset(Flush_msg_ptr, condition)}, + {"id", "integer", sizeof(int), FMOffset(Flush_msg_ptr, id)}, + {NULL, NULL, 0, 0} +}; + +static FMField var_field_list[] = +{ + {"var_name", "string", sizeof(char*), FMOffset(Var_msg_ptr, var_name)}, + {"process_id", "integer", sizeof(int), FMOffset(Var_msg_ptr, process_id)}, + {NULL, NULL, 0, 0} +}; + + +static FMField op_file_field_list[] = +{ + {"process_id", "integer", sizeof(int), FMOffset(op_msg_ptr, process_id)}, + {"file_name", "string", sizeof(char*), FMOffset(op_msg_ptr, file_name)}, + {"type", "integer", sizeof(int), FMOffset(op_msg_ptr, type)}, + {"step", "integer", sizeof(int), FMOffset(op_msg_ptr, step)}, + {"condition", "integer", sizeof(int), FMOffset(op_msg_ptr, condition)}, + {NULL, NULL, 0, 0} +}; + +static FMStructDescRec update_step_msg_format_list[]= +{ + {"update_step_msg", update_step_msg_field_list, sizeof(update_step_msg), NULL}, + {NULL, NULL, 0, 0} +}; + +static FMStructDescRec drop_evgroup_msg_format_list[]= +{ + {"drop_evgroup_msg", drop_evgroup_msg_field_list, sizeof(drop_evgroup_msg), NULL}, + {NULL, NULL, 0, 0} +}; + +static FMStructDescRec offset_struct_format_list[] = +{ + {"offset_struct", offset_struct_field_list, sizeof(offset_struct), NULL}, + {NULL, NULL, 0, 0} +}; + + +static FMStructDescRec evgroup_format_list[] = +{ + {"evgroup", evgroup_field_list, sizeof(evgroup), NULL}, + {"offset_struct", offset_struct_field_list, sizeof(offset_struct), NULL}, + {"global_var", global_var_field_list, sizeof(global_var), NULL}, + {NULL,NULL,0,NULL} +}; + +static FMStructDescRec flush_format_list[] = +{ + {"flush", flush_field_list, sizeof(Flush_msg), NULL}, + {NULL,NULL,0,NULL} +}; + +static FMStructDescRec var_format_list[] = +{ + {"varMsg", var_field_list, sizeof(Var_msg), NULL}, + {NULL, NULL, 0, NULL} +}; + +static FMStructDescRec data_format_list[] = +{ + {"anonymous", NULL, 0, NULL}, + {NULL, NULL, 0, NULL} +}; + +static FMStructDescRec op_format_list[] = +{ + {"op_msg", op_file_field_list, sizeof(op_msg), NULL}, + {NULL, NULL, 0, NULL} +}; + +static char *getFixedName(char *name); + + +#endif diff --git a/tests/libs/adios/src/core/futils.c b/tests/libs/adios/src/core/futils.c new file mode 100644 index 0000000000..c22afb82e2 --- /dev/null +++ b/tests/libs/adios/src/core/futils.c @@ -0,0 +1,51 @@ +/* + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + */ + +#include +#include +#include "core/futils.h" +#include "core/bp_utils.h" // error() +#include "adios_error.h" // err_no_memory + +#ifdef DMALLOC +#include "dmalloc.h" +#endif + +static int called_from_fortran = 0; // set to 1 when called from Fortran API +void futils_called_from_fortran_set(void) {called_from_fortran = 1;} +void futils_called_from_fortran_unset(void) {called_from_fortran = 0;} +int futils_is_called_from_fortran(void) {return called_from_fortran;} + +/** Copy a C string into a Fortran CHARACTER array */ +void futils_cstr_to_fstr(const char *cs, char *fs, int flen) +{ + int clen = strlen(cs); + if (clen > flen) + clen = flen; + strncpy(fs, cs, clen); /* does not copy the '\0' */ + memset(fs+clen, ' ', flen-clen); /* right pad with spaces the CHARACTER array */ +} + +/** Trim a Fortran string and allocate a C string and copy content to it and add '\0' + * Need to free() the string later. + */ +char * futils_fstr_to_cstr(const char * fs, int flen) +{ + char *cs; + int clen = flen; + while (clen > 0 && fs[clen-1] == ' ') + clen--; + cs = (char*) malloc ((size_t) (clen + 1)); + if (cs == NULL) { + adios_error (err_no_memory, "ERROR: Cannot allocate %d bytes for a C string in ADIOS API", clen+1); + return NULL; + } + strncpy (cs, fs, clen); + cs[clen] = '\0'; + return cs; +} + diff --git a/tests/libs/adios/src/core/futils.h b/tests/libs/adios/src/core/futils.h new file mode 100644 index 0000000000..49ec137a59 --- /dev/null +++ b/tests/libs/adios/src/core/futils.h @@ -0,0 +1,28 @@ +/* + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + */ + +#ifndef _FUTILS_H_ +#define _FUTILS_H_ + +/** Copy a C string into a Fortran CHARACTER array (of max length flen). + Fortran array must already be allocated in Fortran */ +void futils_cstr_to_fstr(const char *cs, char *fs, int flen); + +/** Trim a Fortran string and allocate a C string and copy content to it and add '\0' + * Need to free() the string later. + */ +char * futils_fstr_to_cstr(const char * fs, int flen); + +/* Indicate to ADIOS that we are calling from Fortran. + It is used in the read API to know what ordering of dimensions the caller expects. +*/ +void futils_called_from_fortran_set(void); +void futils_called_from_fortran_unset(void); +/* Read API asks if the caller is Fortran by this function call */ +int futils_is_called_from_fortran(void); + +#endif diff --git a/tests/libs/adios/src/core/globals.c b/tests/libs/adios/src/core/globals.c new file mode 100644 index 0000000000..a3ff6f006e --- /dev/null +++ b/tests/libs/adios/src/core/globals.c @@ -0,0 +1,341 @@ +/* + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + */ + +/* + * Functions, constants globally for both the Write and Read API of Staging methods + */ + +#include "globals.h" + +static int globals_adios_appid = -1; +static int globals_adios_was_set = 0; +void globals_adios_set_application_id (int id) +{ + globals_adios_appid = id; + globals_adios_was_set = 1; +} + +int globals_adios_get_application_id (int *was_set) +{ + *was_set = globals_adios_was_set; + return globals_adios_appid; +} + +#ifdef HAVE_DATASPACES +enum DATASPACES_CONNECTION { dataspaces_disconnected = 0, + dataspaces_connected_from_reader = 1, + dataspaces_connected_from_writer = 2, + dataspaces_connected_from_both = 3 + }; +static enum DATASPACES_CONNECTION globals_adios_connected_to_dataspaces = dataspaces_disconnected; + +void globals_adios_set_dataspaces_connected_from_reader() +{ + if (globals_adios_connected_to_dataspaces == dataspaces_disconnected) + globals_adios_connected_to_dataspaces = dataspaces_connected_from_reader; + else if (globals_adios_connected_to_dataspaces == dataspaces_connected_from_writer) + globals_adios_connected_to_dataspaces = dataspaces_connected_from_both; +} +void globals_adios_set_dataspaces_disconnected_from_reader() +{ + if (globals_adios_connected_to_dataspaces == dataspaces_connected_from_reader) + globals_adios_connected_to_dataspaces = dataspaces_disconnected; + else if (globals_adios_connected_to_dataspaces == dataspaces_connected_from_both) + globals_adios_connected_to_dataspaces = dataspaces_connected_from_writer; +} +void globals_adios_set_dataspaces_connected_from_writer() +{ + if (globals_adios_connected_to_dataspaces == dataspaces_disconnected) + globals_adios_connected_to_dataspaces = dataspaces_connected_from_writer; + else if (globals_adios_connected_to_dataspaces == dataspaces_connected_from_reader) + globals_adios_connected_to_dataspaces = dataspaces_connected_from_both; +} +void globals_adios_set_dataspaces_disconnected_from_writer() +{ + if (globals_adios_connected_to_dataspaces == dataspaces_connected_from_writer) + globals_adios_connected_to_dataspaces = dataspaces_disconnected; + else if (globals_adios_connected_to_dataspaces == dataspaces_connected_from_both) + globals_adios_connected_to_dataspaces = dataspaces_connected_from_reader; +} +int globals_adios_is_dataspaces_connected() +{ + return (globals_adios_connected_to_dataspaces != dataspaces_disconnected); +} +int globals_adios_is_dataspaces_connected_from_reader() +{ + return (globals_adios_connected_to_dataspaces == dataspaces_connected_from_reader || + globals_adios_connected_to_dataspaces == dataspaces_connected_from_both); +} +int globals_adios_is_dataspaces_connected_from_writer() +{ + return (globals_adios_connected_to_dataspaces == dataspaces_connected_from_writer || + globals_adios_connected_to_dataspaces == dataspaces_connected_from_both); +} +int globals_adios_is_dataspaces_connected_from_both() +{ + return (globals_adios_connected_to_dataspaces == dataspaces_connected_from_both); +} +#endif + +#ifdef HAVE_DIMES +enum DIMES_CONNECTION { dimes_disconnected = 0, + dimes_connected_from_reader = 1, + dimes_connected_from_writer = 2, + dimes_connected_from_both = 3 + }; +static enum DIMES_CONNECTION globals_adios_connected_to_dimes = dimes_disconnected; + +void globals_adios_set_dimes_connected_from_reader() +{ + if (globals_adios_connected_to_dimes == dimes_disconnected) + globals_adios_connected_to_dimes = dimes_connected_from_reader; + else if (globals_adios_connected_to_dimes == dimes_connected_from_writer) + globals_adios_connected_to_dimes = dimes_connected_from_both; +} +void globals_adios_set_dimes_disconnected_from_reader() +{ + if (globals_adios_connected_to_dimes == dimes_connected_from_reader) + globals_adios_connected_to_dimes = dimes_disconnected; + else if (globals_adios_connected_to_dimes == dimes_connected_from_both) + globals_adios_connected_to_dimes = dimes_connected_from_writer; +} +void globals_adios_set_dimes_connected_from_writer() +{ + if (globals_adios_connected_to_dimes == dimes_disconnected) + globals_adios_connected_to_dimes = dimes_connected_from_writer; + else if (globals_adios_connected_to_dimes == dimes_connected_from_reader) + globals_adios_connected_to_dimes = dimes_connected_from_both; +} +void globals_adios_set_dimes_disconnected_from_writer() +{ + if (globals_adios_connected_to_dimes == dimes_connected_from_writer) + globals_adios_connected_to_dimes = dimes_disconnected; + else if (globals_adios_connected_to_dimes == dimes_connected_from_both) + globals_adios_connected_to_dimes = dimes_connected_from_reader; +} +int globals_adios_is_dimes_connected() +{ + return (globals_adios_connected_to_dimes != dimes_disconnected); +} +int globals_adios_is_dimes_connected_from_reader() +{ + return (globals_adios_connected_to_dimes == dimes_connected_from_reader || + globals_adios_connected_to_dimes == dimes_connected_from_both); +} +int globals_adios_is_dimes_connected_from_writer() +{ + return (globals_adios_connected_to_dimes == dimes_connected_from_writer || + globals_adios_connected_to_dimes == dimes_connected_from_both); +} +int globals_adios_is_dimes_connected_from_both() +{ + return (globals_adios_connected_to_dimes == dimes_connected_from_both); +} +#endif + +#if NO_DATATAP == 0 + +#include +#include +#include + +#define OPLEN 2 +static char OP[OPLEN] = { '(', ')' }; +static char *OP_REP[OPLEN] = { "_PPLT_", "_PPRT_" }; + +char *getFixedName(char *name) +{ + char *tempname = (char *) malloc(sizeof(char) * 255); + snprintf(tempname, 255, "%s\0", name); + char *oldname = strdup(name); + char *loc = NULL; + int i; + + do + { + for (i = 0; i < OPLEN; i++) + { + //checking operator OP[i] + loc = strchr(oldname, OP[i]); + if (loc == NULL) + continue; + *loc = 0; + snprintf(tempname, 255, "%s%s%s\0", oldname, OP_REP[i], &loc[1]); + free(oldname); + oldname = strdup(tempname); + } + } + while (loc != NULL); + free(oldname); + +fprintf(stderr, "im here %s %s %s:%d\n", name, tempname, __FILE__,__LINE__); + return tempname; +} + +char *get_full_path_name(char *name, char *path) +{ + char *full_pathname = (char *) malloc(strlen(name)+strlen(path)+2); + if(!full_pathname) { + fprintf(stderr, "cannot allocate memory. %s:%d\n", __FILE__,__LINE__); + return NULL; + } + if (!path || !path[0]) { // null or empty string + sprintf (full_pathname, "%s\0", name); + } else if (!strcmp (path, "/")) { + sprintf (full_pathname, "/%s\0", name); + } + else { + sprintf (full_pathname, "%s/%s\0", path, name); + } +fprintf(stderr, "im here %s %s %s %s:%d\n", name, path, full_pathname,__FILE__,__LINE__); + return full_pathname; +} + +#endif + +#ifdef HAVE_ICEE + +#include + +double dsum(const int len, const double* data) +{ + double s = 0.0; + int i; + for (i=0; ivarname); + fprintf(stderr, "%10s : %d\n", "varid", vp->varid); + fprintf(stderr, "%10s : %d\n", "type", vp->type); + fprintf(stderr, "%10s : %d\n", "typesize", vp->typesize); + fprintf(stderr, "%10s : %d\n", "ndims", vp->ndims); + icee_dims_print("gdims", vp->ndims, vp->gdims); + icee_dims_print("ldims", vp->ndims, vp->ldims); + icee_dims_print("offsets", vp->ndims, vp->offsets); + fprintf(stderr, "%10s : %llu\n", "varlen", vp->varlen); + icee_data_print(vp->type, vp->varlen, vp->data); + } + else + { + fprintf(stderr, "varinfo is invalid\n"); + } +} + +void icee_fileinfo_print(const void* item) +{ + icee_fileinfo_rec_ptr_t fp = (icee_fileinfo_rec_ptr_t) item; + + fprintf(stderr, "===== fileinfo (%p) =====\n", fp); + + if (fp) + { + fprintf(stderr, "%10s : %s\n", "fname", fp->fname); + fprintf(stderr, "%10s : %d\n", "nvars", fp->nvars); + fprintf(stderr, "%10s : %d\n", "nchunks", fp->nchunks); + fprintf(stderr, "%10s : %d\n", "comm_size", fp->comm_size); + fprintf(stderr, "%10s : %d\n", "comm_rank", fp->comm_rank); + fprintf(stderr, "%10s : %d\n", "merge_count", fp->merge_count); + fprintf(stderr, "%10s : %d\n", "timestep", fp->timestep); + fprintf(stderr, "%10s : %p\n", "varinfo", fp->varinfo); + fprintf(stderr, "%10s : %p\n", "next", fp->next); + + icee_varinfo_rec_ptr_t vp = fp->varinfo; + + while (vp != NULL) + { + icee_varinfo_print(vp); + vp = vp->next; + } + + if (fp->next != NULL) + icee_fileinfo_print(fp->next); + } + else + { + fprintf(stderr, "fileinfo is invalid\n"); + } +} + +void icee_contactinfo_print(const icee_contactinfo_rec_ptr_t cp) +{ + fprintf(stderr, "===== contactinfo (%p) =====\n", cp); + + if (cp) + { + fprintf(stderr, "%10s : %d\n", "stone_id", cp->stone_id); + fprintf(stderr, "%10s : %s\n", "contact_string", cp->contact_string); + fdump_attr_list(stderr, attr_list_from_string(cp->contact_string)); + fprintf(stderr, "%10s : %p\n", "next", cp->next); + if (cp->next != NULL) + icee_contactinfo_print(cp->next); + } + else + { + fprintf(stderr, "contactinfo is invalid\n"); + } +} + +#endif diff --git a/tests/libs/adios/src/core/globals.h b/tests/libs/adios/src/core/globals.h new file mode 100644 index 0000000000..ad59519798 --- /dev/null +++ b/tests/libs/adios/src/core/globals.h @@ -0,0 +1,85 @@ +/* + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + */ + +/* + * Functions, constants globally for both the Write and Read API + */ +#ifndef __GLOBALS_H__ +#define __GLOBALS_H__ + +#include "config.h" + +/** Set an application ID for this program. + * This function is necessary for methods who needs a unique ID from each participating applications. + * Currently, this is the DATASPACES/DIMES methods for code coupling of independent applications. + * + * This function is called from the applicatin through adios_set_application_id() + */ +void globals_adios_set_application_id (int id); + + +/** Get the application ID set by the application itself. + * Returns the ID set by the application, -1 if it was not set. + * It also returns a boolean was_set, 0 if it was not set, 1 otherwise. + */ +int globals_adios_get_application_id (int *was_set); + + +/* Note: would be nice a map for arbitrary globals */ +#ifdef HAVE_DATASPACES +void globals_adios_set_dataspaces_connected_from_reader(); +void globals_adios_set_dataspaces_disconnected_from_reader(); +void globals_adios_set_dataspaces_connected_from_writer(); +void globals_adios_set_dataspaces_disconnected_from_writer(); +int globals_adios_is_dataspaces_connected(); // from any +int globals_adios_is_dataspaces_connected_from_reader(); +int globals_adios_is_dataspaces_connected_from_writer(); +int globals_adios_is_dataspaces_connected_from_both(); +#endif /* HAVE_DATASPACES */ + +#ifdef HAVE_DIMES +void globals_adios_set_dimes_connected_from_reader(); +void globals_adios_set_dimes_disconnected_from_reader(); +void globals_adios_set_dimes_connected_from_writer(); +void globals_adios_set_dimes_disconnected_from_writer(); +int globals_adios_is_dimes_connected(); // from any +int globals_adios_is_dimes_connected_from_reader(); +int globals_adios_is_dimes_connected_from_writer(); +int globals_adios_is_dimes_connected_from_both(); +#endif + +#if NO_DATATAP == 0 + +char *getFixedName(char *name); +char *get_full_path_name(char *name, char *path); + +#endif + +#ifdef HAVE_ICEE + +#ifndef ICEE_MAX_PARALLEL +#define ICEE_MAX_PARALLEL 32 +#endif + +#ifndef ICEE_MAX_REMOTE +#define ICEE_MAX_REMOTE 32 +#endif + +#include "core/adios_icee.h" + +typedef enum {TCP, UDP, ENET, NNTI, IB} icee_transport_t; +static const char *icee_transport_name[] = { + "TCP", "UDP", "ENET", "NNTI", "IB", +}; + +void icee_dims_print(const char* name, const int ndims, const uint64_t *dims); +void icee_varinfo_print(const icee_varinfo_rec_ptr_t vp); +void icee_fileinfo_print(const void* item); +void icee_contactinfo_print(const icee_contactinfo_rec_ptr_t cp); +#endif + +#endif /*__GLOBALS_H__*/ diff --git a/tests/libs/adios/src/core/mpidummy.c b/tests/libs/adios/src/core/mpidummy.c new file mode 100644 index 0000000000..d3ca3d7592 --- /dev/null +++ b/tests/libs/adios/src/core/mpidummy.c @@ -0,0 +1,227 @@ +/* + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + */ + +/* + A dummy MPI implementation for the BP READ API, to have an MPI-free version of the API +*/ + +#include +#include +#include +//#define _LARGEFILE64_SOURCE +#include +#include +#include + +#include "mpidummy.h" + +#if defined(__APPLE__) || defined(__WIN32__) +# define lseek64 lseek +# define open64 open +#endif + +static char mpierrmsg[MPI_MAX_ERROR_STRING]; + +int MPI_Init(int *argc, char ***argv) +{ + mpierrmsg[0] = '\0'; + return MPI_SUCCESS; +} + +int MPI_Finalize() +{ + mpierrmsg[0] = '\0'; + return MPI_SUCCESS; +} + +int MPI_Initialized( int* flag ) +{ + *flag = 1 ; + return MPI_SUCCESS; +} + +int MPI_Comm_split ( MPI_Comm comm, int color, int key, MPI_Comm *comm_out ) {return MPI_SUCCESS;} + +int MPI_Barrier(MPI_Comm comm) { return MPI_SUCCESS; } +int MPI_Bcast(void *buffer, int count, MPI_Datatype datatype, int root, MPI_Comm comm) { return MPI_SUCCESS; } + +int MPI_Comm_dup(MPI_Comm comm, MPI_Comm *newcomm) { *newcomm = comm; return MPI_SUCCESS; } +int MPI_Comm_rank(MPI_Comm comm, int *rank) { *rank = 0; return MPI_SUCCESS; } +int MPI_Comm_size(MPI_Comm comm, int *size) { *size = 1; return MPI_SUCCESS; } +int MPI_Comm_free(MPI_Comm *comm) { *comm = 0; return MPI_SUCCESS; }; +MPI_Comm MPI_Comm_f2c(MPI_Fint comm) { return comm; } + +int MPI_Gather(void *sendbuf, int sendcnt, MPI_Datatype sendtype, + void *recvbuf, int recvcnt, MPI_Datatype recvtype, + int root, MPI_Comm comm) +{ + int ier = MPI_SUCCESS; + size_t n=0, nsent=0, nrecv=0 ; + if( !sendbuf || !recvbuf ) ier = MPI_ERR_BUFFER ; + if( comm==MPI_COMM_NULL || root ) ier = MPI_ERR_COMM ; + + switch( sendtype ) + { + case MPI_INT : n = sizeof( int ) ; + default : return MPI_ERR_TYPE ; + } + nsent = n * sendcnt ; + + switch( recvtype ) + { + case MPI_INT : nrecv = sizeof( int ) ; + default : return MPI_ERR_TYPE ; + } + nrecv = n * recvcnt ; + + if( nrecv!=nsent ) ier = MPI_ERR_COUNT ; + + if( ier == MPI_SUCCESS ) memcpy( recvbuf, sendbuf, nsent ); + else snprintf(mpierrmsg, ier, "could not gather data\n" ); + + return ier ; +} + +int MPI_Gatherv(void *sendbuf, int sendcnt, MPI_Datatype sendtype, + void *recvbuf, int *recvcnts, int *displs, + MPI_Datatype recvtype, int root, MPI_Comm comm) +{ + int ier = MPI_SUCCESS; + if( !recvcnts || !displs ) ier = MPI_ERR_BUFFER ; + + if( ier == MPI_SUCCESS ) + ier = MPI_Gather(sendbuf, sendcnt, sendtype, recvbuf, recvcnts[0], recvtype, root, comm ) ; + + return ier ; +} + +int MPI_Allgather(void *sendbuf, int sendcount, MPI_Datatype sendtype, + void *recvbuf, int recvcount, MPI_Datatype recvtype, + MPI_Comm comm) +{ + return MPI_Gather (sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, 0, comm); +} + +int MPI_Scatter(void *sendbuf, int sendcnt, MPI_Datatype sendtype, + void *recvbuf, int recvcnt, MPI_Datatype recvtype, int root, + MPI_Comm comm) +{ + int ier = MPI_SUCCESS; + size_t n=0, nsent=0, nrecv=0 ; + if( !sendbuf || !recvbuf ) ier = MPI_ERR_BUFFER ; + if( comm==MPI_COMM_NULL || root ) ier = MPI_ERR_COMM ; + + switch( sendtype ) + { + case MPI_INT : n = sizeof( int ) ; + default : return MPI_ERR_TYPE ; + } + nsent = n * sendcnt ; + + switch( recvtype ) + { + case MPI_INT : nrecv = sizeof( int ) ; + default : return MPI_ERR_TYPE ; + } + nrecv = n * recvcnt ; + + if( nrecv!=nsent ) ier = MPI_ERR_COUNT ; + + if( ier == MPI_SUCCESS ) memcpy( sendbuf, recvbuf, nsent ); + else snprintf(mpierrmsg, ier, "could not scatter data\n" ); + + return ier ; +} + +int MPI_Scatterv( void *sendbuf, int *sendcnts, int *displs, + MPI_Datatype sendtype, void *recvbuf, int recvcnt, + MPI_Datatype recvtype, + int root, MPI_Comm comm) +{ + int ier = MPI_SUCCESS; + if( !sendcnts || !displs ) ier = MPI_ERR_BUFFER ; + + if( ier == MPI_SUCCESS ) + ier = MPI_Scatter(sendbuf, sendcnts[0], sendtype, recvbuf, recvcnt, recvtype, root, comm ) ; + + return ier ; +} + + +int MPI_File_open(MPI_Comm comm, char *filename, int amode, MPI_Info info, MPI_File *fh) +{ + *fh = open64 (filename, amode); + if (*fh == -1) { + snprintf(mpierrmsg, MPI_MAX_ERROR_STRING, "File not found: %s", filename); + return -1; + } + return MPI_SUCCESS; +} + +int MPI_File_close(MPI_File *fh) { return close(*fh); } + +int MPI_File_get_size(MPI_File fh, MPI_Offset *size) { + uint64_t curpos = lseek64(fh, 0, SEEK_CUR); // get the current seek pos + uint64_t endpos = lseek64(fh, 0, SEEK_END); // go to end, returned is the size in bytes + lseek64(fh, curpos, SEEK_SET); // go back where we were + *size = (MPI_Offset) endpos; + //printf("MPI_File_get_size: fh=%d, size=%lld\n", fh, *size); + return MPI_SUCCESS; +} + +int MPI_File_read(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status) +{ + // FIXME: int count can read only 2GB (*datatype size) array at max + uint64_t bytes_to_read = count * datatype; // datatype should hold the size of the type, not an id + uint64_t bytes_read; + bytes_read = read (fh, buf, bytes_to_read); + if (bytes_read != bytes_to_read) { + snprintf(mpierrmsg, MPI_MAX_ERROR_STRING, "could not read %llu bytes. read only: %llu\n", bytes_to_read, bytes_read); + return -2; + } + *status = bytes_read; + //printf("MPI_File_read: fh=%d, count=%d, typesize=%d, bytes read=%lld\n", fh, count, datatype, *status); + return MPI_SUCCESS; +} + +int MPI_File_seek(MPI_File fh, MPI_Offset offset, int whence) +{ + uint64_t off = (uint64_t) offset; + lseek64 (fh, off, whence); + //printf("MPI_File_seek: fh=%d, offset=%lld, whence=%d\n", fh, off, whence); + return MPI_SUCCESS; +} + +int MPI_Get_count(MPI_Status *status, MPI_Datatype datatype, int *count) +{ + *count = (int) *status; + return MPI_SUCCESS; +} + +int MPI_Error_string(int errorcode, char *string, int *resultlen) +{ + //sprintf(string, "Dummy lib does not know error strings. Code=%d\n",errorcode); + strcpy(string, mpierrmsg); + *resultlen = strlen(string); + return MPI_SUCCESS; +} + +double MPI_Wtime() +{ + // Implementation not tested + struct timeval tv; + gettimeofday (&tv, NULL); + return (double)(tv.tv_sec) + (double)(tv.tv_usec) / 1000000; +} + +int MPI_Get_processor_name (char *name, int *resultlen) +{ + sprintf(name, "0"); + *resultlen = 1; + return 0; +} + diff --git a/tests/libs/adios/src/core/qhashtbl.c b/tests/libs/adios/src/core/qhashtbl.c new file mode 100644 index 0000000000..8ee053ed63 --- /dev/null +++ b/tests/libs/adios/src/core/qhashtbl.c @@ -0,0 +1,606 @@ +/****************************************************************************** + * qLibc - http://www.qdecoder.org + * + * Copyright (c) 2010-2012 Seungyoung Kim. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + ******************************************************************************/ + +/** + * @file qhashtbl.c Hash-table container implementation. + * + * qhashtbl implements a hashtable, which maps keys to values. Key is a unique + * string and value is any non-null object. The creator qHashtbl() has one + * parameters that affect its performance: initial hash range. The hash range + * is the number of slots(pointers) in the hash table. in the case of a hash + * collision, a single slots stores multiple elements using linked-list + * structure, which must be searched sequentially. So lower range than the + * number of elements decreases the space overhead but increases the number of + * hash collisions and consequently it increases the time cost to look up an + * element. + * + * @code + * [Internal Structure Example for 10-slot hash table] + * + * RANGE NAMED-OBJECT-LIST + * ===== ================= + * [ 0 ] -> [hash=320,key3=value] -> [hash=210,key5=value] -> [hash=110,...] + * [ 1 ] -> [hash=1,key1=value] + * [ 2 ] + * [ 3 ] -> [hash=873,key4=value] + * [ 4 ] -> [hash=2674,key11=value] -> [hash=214,key5=value] + * [ 5 ] -> [hash=8545,key10=value] + * [ 6 ] -> [hash=9226,key9=value] + * [ 7 ] + * [ 8 ] -> [hash=8,key6=value] -> [hash=88,key8=value] + * [ 9 ] -> [hash=12439,key7=value] + * @endcode + * + * @code + * // create a hash-table with 10 hash-index range. + * // Please beaware, the hash-index range 10 does not mean the number of + * // objects which can be stored. You can put as many as you want. + * qhashtbl_t *tbl = qHashtbl(10); + * + * // put objects into table. + * tbl->put(tbl, "sample1", "binary", 6); + * tbl->putstr(tbl, "sample2", "string"); + * tbl->putint(tbl, "sample3", 1); + * + * // debug print out + * tbl->debug(tbl, stdout, true); + * + * // get objects + * void *sample1 = tbl->get(tbl, "sample1", &size, true); + * char *sample2 = tbl->getstr(tbl, "sample2", false); + * int sample3 = tbl->getint(tbl, "sample3"); + * + * // sample1 is memalloced + * if(sample1 != NULL) free(sample1); + * + * // release table + * tbl->free(tbl); + * @endcode + * + * @note + * Use "--enable-threadsafe" configure script option to use under + * multi-threaded environments. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include "qhashtbl.h" +#include "core/adios_logger.h" + + +// member methods +static bool put2(qhashtbl_t *tbl, const char *path, const char *name, const void *data); +static bool put(qhashtbl_t *tbl, const char *path, const void *data); +static void *get(qhashtbl_t *tbl, const char *fullpath); +static void *get2(qhashtbl_t *tbl, const char *path, const char *name); +static bool remove_(qhashtbl_t *tbl, const char *fullpath); +static int size(qhashtbl_t *tbl); +static void clear(qhashtbl_t *tbl); +static void debug(qhashtbl_t *tbl, FILE *out, bool detailed); +static void free_(qhashtbl_t *tbl); + +uint32_t qhashmurmur3_32(const void *data, size_t nbytes); + +/** + * Initialize hash table. + * + * @param range hash range. + * + * @return a pointer of malloced qhashtbl_t, otherwise returns false + * @retval errno will be set in error condition. + * - EINVAL : Invalid argument. + * - ENOMEM : Memory allocation failure. + * + * @code + * // create a hash-table with hash-index range 1000 (does not mean maximum + * // number of objects). + * qhashtbl_t *tbl = qhashtbl(1000); + * @endcode + */ +qhashtbl_t *qhashtbl(int range) +{ + if (range == 0) { + errno = EINVAL; + return NULL; + } + + qhashtbl_t *tbl = (qhashtbl_t *)malloc(sizeof(qhashtbl_t)); + if (tbl == NULL) { + errno = ENOMEM; + return NULL; + } + memset((void *)tbl, 0, sizeof(qhashtbl_t)); + + // allocate table space + tbl->slots = (qhslot_t *)malloc(sizeof(qhslot_t) * range); + if (tbl->slots == NULL) { + errno = ENOMEM; + free_(tbl); + return NULL; + } + memset((void *)tbl->slots, 0, sizeof(qhslot_t) * range); + + // assign methods + tbl->put2 = put2; + tbl->put = put; + tbl->get = get; + tbl->get2 = get2; + tbl->remove = remove_; + tbl->size = size; + tbl->clear = clear; + tbl->debug = debug; + tbl->free = free_; + + // now table can be used + tbl->range = range; + tbl->num = 0; + + // debug variables + tbl->nwalks_get = 0; + tbl->ncalls_get = 0; + tbl->nwalks_put = 0; + tbl->ncalls_put = 0; + + return tbl; +} + +/** + * qhashtbl->put(): Put a object into this table. + * + * @param tbl qhashtbl_t container pointer. + * @param path key is path+/+name + * @param name part of key + * @param data data object + * + * @return true if successful, otherwise returns false + * @retval errno will be set in error condition. + * - EINVAL : Invalid argument. + * - ENOMEM : Memory allocation failure. + */ +static void genkey(const char *path, const char *name, int *keylen, char **key) +{ + // create key + if (!path || !strcmp (path, "")) { + *keylen = strlen (name); + *key = malloc (*keylen+1); + sprintf (*key, "%s", name); + } else if (!strcmp (path, "/")) { + *keylen = strlen (name) + 1; + *key = malloc (*keylen+1); + sprintf (*key, "/%s", name); + } else { + *keylen = strlen (name) + strlen (path) + 1; + *key = malloc (*keylen+1); + sprintf (*key, "%s/%s", path, name); + } +} + +static bool qhput(qhashtbl_t *tbl, char *key, int keylen, const void *data) +{ + // get hash integer + uint32_t hash = qhashmurmur3_32(key, keylen); + int idx = hash % tbl->range; + tbl->ncalls_put++; // debug + + //log_error ("qhastbl:put: key=[%s], keylen=%d hash=%d, idx=%d, d=%x\n", key, keylen, hash, idx, data); + + // find existing key + qhslot_t *slot = &tbl->slots[idx]; + qhnobj_t *obj; + for (obj = slot->head; obj != NULL; obj = obj->next) { + if (obj->hash == hash && !strcmp(obj->key, key)) { + break; + } + tbl->nwalks_put++; // debug: we walk one step in a chain of elements + } + + // put into table + if (obj == NULL) { + // insert + obj = (qhnobj_t *)malloc(sizeof(qhnobj_t)); + if (obj == NULL) { + free(key); + errno = ENOMEM; + return false; + } + memset((void *)obj, 0, sizeof(qhnobj_t)); + + if (slot->tail != NULL) { + // connect old tail to this new tail + slot->tail->next = obj; + } + if (slot->head == NULL) { + // insert as very first element + slot->head = obj; + } + slot->tail = obj; + obj->next = 0; + + // increase counter + tbl->num++; + + // set data + obj->hash = hash; + obj->key = key; + obj->value = (void *)data; + + } else { + /* Do not do anything. + * Keep the first definition in place, because consider this example + * if we would replace the object here: + * def NX + * def A[NX] --> A's dimension is the first variable NX (a pointer to that) + * def NX --> hashtable stores this variable reference + * def B[NX] + * write NX --> value is stored in the NX variable found in the hash table + * write A --> dimension found (valid first pointer) but value is not found + * (stored in the second reference) + * At this point, A's dimension variable is first NX, but the value of + * write NX goes to the variable found here in the hash table. + */ + free(key); + } + + return true; +} + +static bool put(qhashtbl_t *tbl, const char *fullpath, const void *data) +{ + if (!fullpath) + return false; + + int keylen = strlen(fullpath); + char *key = strdup (fullpath); + + return qhput (tbl, key, keylen, data); +} + +static bool put2(qhashtbl_t *tbl, const char *path, const char *name, const void *data) +{ + int keylen; + char *key; + genkey (path, name, &keylen, &key); + + return qhput (tbl, key, keylen, data); +} + + +/** + * qhashtbl->get(): Get a object from this table. + * + * @param tbl qhashtbl_t container pointer. + * @param name key name. + * @param size if not NULL, oject size will be stored. + * @param newmem whether or not to allocate memory for the data. + * + * @return a pointer of data if the key is found, otherwise returns NULL. + * @retval errno will be set in error condition. + * - ENOENT : No such key found. + * - EINVAL : Invalid argument. + * - ENOMEM : Memory allocation failure. + * + * @code + * qhashtbl_t *tbl = qHashtbl(1000); + * (...codes...) + * + * // with newmem flag unset + * int size; + * struct myobj *obj = (struct myobj*)tbl->get(tbl, "key_name", &size, false); + * + * // with newmem flag set + * int size; + * struct myobj *obj = (struct myobj*)tbl->get(tbl, "key_name", &size, true); + * if(obj != NULL) free(obj); + * @endcode + * + */ +static void *qhget(qhashtbl_t *tbl, char *key, int keylen) +{ + // get hash integer + uint32_t hash = qhashmurmur3_32(key, keylen); + int idx = hash % tbl->range; + tbl->ncalls_get++; // debug + + //log_error ("qhastbl:get: key=[%s], keylen=%d, hash=%d, idx=%d\n", fullpath, strlen(fullpath), hash, idx); + + // find key + qhslot_t *slot = &tbl->slots[idx]; + qhnobj_t *obj; + for (obj = slot->head; obj != NULL; obj = obj->next) { + if (obj->hash == hash && !strcmp(obj->key, key)) { + break; + } + tbl->nwalks_get++; // debug: we walk one step in a chain of elements + } + + void *data = NULL; + if (obj != NULL) { + data = obj->value; + } + + if (data == NULL) errno = ENOENT; + //log_error ("qhastbl:get: data=%x\n", data); + return data; +} + +static void *get(qhashtbl_t *tbl, const char *fullpath) +{ + if (!fullpath) + return NULL; + + int keylen = strlen(fullpath); + char *key = strdup (fullpath); + + void * data = qhget (tbl, key, keylen); + free (key); + return data; +} + +static void *get2(qhashtbl_t *tbl, const char *path, const char *name) +{ + int keylen; + char *key; + genkey (path, name, &keylen, &key); + + void * data = qhget (tbl, key, keylen); + free (key); + return data; +} + + +/** + * qhashtbl->remove(): Remove an object from this table. + * + * @param tbl qhashtbl_t container pointer. + * @param name key name + * + * @return true if successful, otherwise(not found) returns false + * @retval errno will be set in error condition. + * - ENOENT : No next element. + * - EINVAL : Invalid argument. + */ +static bool remove_(qhashtbl_t *tbl, const char *fullpath) +{ + int keylen = strlen (fullpath); + const char *key = fullpath; + + // get hash integer + uint32_t hash = qhashmurmur3_32(key, keylen); + int idx = hash % tbl->range; + + //log_error ("qhastbl:remove: key=%s, hash=%d, idx=%d\n", key, hash, idx); + + // find key + bool found = false; + qhslot_t *slot = &tbl->slots[idx]; + qhnobj_t *prev = NULL; + qhnobj_t *obj; + for (obj = slot->head; obj != NULL; obj = obj->next) { + if (obj->hash == hash && !strcmp(obj->key, key)) { + // adjust links + if (prev == NULL) { + // remove as very first + slot->head = obj->next; + } else { + // remove otherwise + prev->next = obj->next; + } + + if (obj == slot->tail) { + // this was last element: update tail + slot->tail = prev; + } + + // remove + free(obj->key); + free(obj); + + found = true; + tbl->num--; + break; + } + + prev = obj; + } + + if (found == false) errno = ENOENT; + + return found; +} + +/** + * qhashtbl->size(): Returns the number of keys in this hashtable. + * + * @param tbl qhashtbl_t container pointer. + * + * @return number of elements stored + */ +static int size(qhashtbl_t *tbl) +{ + return tbl->num; +} + +/** + * qhashtbl->clear(): Clears this hashtable so that it contains no keys. + * + * @param tbl qhashtbl_t container pointer. + */ +void clear(qhashtbl_t *tbl) +{ + if (!tbl) return; + //debug(tbl, stdout, 0); + int idx; + qhnobj_t *obj; + for (idx = 0; idx < tbl->range && tbl->num > 0; idx++) { + obj = tbl->slots[idx].head; + while (obj != NULL) { + qhnobj_t *next = obj->next; + free(obj->key); + free(obj); + obj = next; + tbl->num--; + } + tbl->slots[idx].head = NULL; + tbl->slots[idx].tail = NULL; + } +} + +/** + * qhashtbl->debug(): Print hash table for debugging purpose + * + * @param tbl qhashtbl_t container pointer. + * @param out output stream + * + */ +void debug(qhashtbl_t *tbl, FILE *out, bool detailed) +{ + if (out == NULL) { + out = stdout; + } + int len, lenmin=1000000, lenmax=0; + + qhnobj_t *obj; + int idx; + for (idx = 0; idx < tbl->range && tbl->num > 0; idx++) { + len = 0; + if (detailed) fprintf(out, "[%d]:", idx); + obj = tbl->slots[idx].head; + while (obj != NULL) { + qhnobj_t *next = obj->next; + if (detailed) fprintf(out, "(%s,%p)" , obj->key, obj->value); + obj = next; + len++; + } + if (detailed) fprintf(out,"\n"); + if (len < lenmin) lenmin = len; + if (len > lenmax) lenmax = len; + } + fprintf(out, "Hash table %p\n", tbl); + fprintf(out, "Hash table size = %d\n", tbl->range); + fprintf(out, "Number of elements = %d\n", tbl->num); + fprintf(out, "Shortest collision list size = %d\n", lenmin); + fprintf(out, "Longest collision list size = %d\n", lenmax); + fprintf(out, "get() calls = %d, walks = %d\n", tbl->ncalls_get, tbl->nwalks_get); + fprintf(out, "put() calls = %d, walks = %d\n", tbl->ncalls_put, tbl->nwalks_put); + fflush(out); +} + + +/** + * qhashtbl->free(): De-allocate hash table + * + * @param tbl qhashtbl_t container pointer. + */ +void free_(qhashtbl_t *tbl) +{ + if (!tbl) return; + clear(tbl); + if (tbl->slots != NULL) free(tbl->slots); + free(tbl); +} + + +/** + * Get 32-bit Murmur3 hash. + * + * @param data source data + * @param nbytes size of data + * + * @return 32-bit unsigned hash value. + * + * @code + * uint32_t hashval = qhashmurmur3_32((void*)"hello", 5); + * @endcode + * + * @code + * MurmurHash3 was created by Austin Appleby in 2008. The cannonical + * implementations are in C++ and placed in the public. + * + * https://sites.google.com/site/murmurhash/ + * + * Seungyoung Kim has ported it's cannonical implementation to C language + * in 2012 and published it as a part of qLibc component. + * @endcode + */ +uint32_t qhashmurmur3_32(const void *data, size_t nbytes) +{ + if (data == NULL || nbytes == 0) return 0; + + const uint32_t c1 = 0xcc9e2d51; + const uint32_t c2 = 0x1b873593; + + const int nblocks = nbytes / 4; + const uint32_t *blocks = (const uint32_t *)(data); + const uint8_t *tail = (const uint8_t *)data + (nblocks * 4); + + uint32_t h = 0; + + int i; + uint32_t k; + for (i = 0; i < nblocks; i++) { + k = blocks[i]; + + k *= c1; + k = (k << 15) | (k >> (32 - 15)); + k *= c2; + + h ^= k; + h = (h << 13) | (h >> (32 - 13)); + h = (h * 5) + 0xe6546b64; + } + + k = 0; + switch (nbytes & 3) { + case 3: + k ^= tail[2] << 16; + case 2: + k ^= tail[1] << 8; + case 1: + k ^= tail[0]; + k *= c1; + k = (k << 13) | (k >> (32 - 15)); + k *= c2; + h ^= k; + }; + + h ^= nbytes; + + h ^= h >> 16; + h *= 0x85ebca6b; + h ^= h >> 13; + h *= 0xc2b2ae35; + h ^= h >> 16; + + return h; +} diff --git a/tests/libs/adios/src/core/qhashtbl.h b/tests/libs/adios/src/core/qhashtbl.h new file mode 100644 index 0000000000..83777c660e --- /dev/null +++ b/tests/libs/adios/src/core/qhashtbl.h @@ -0,0 +1,93 @@ +/****************************************************************************** + * qLibc - http://www.qdecoder.org + * + * Copyright (c) 2010-2012 Seungyoung Kim. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + ******************************************************************************/ +/* + Modified/simplified by ADIOS team for the purpose of variable/attribute store +*/ +#ifndef __HASHTBL_H_ +#define __HASHTBL_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include +#include + + +typedef struct qhnobj_s qhnobj_t; +typedef struct qhslot_s qhslot_t; +typedef struct qhashtbl_s qhashtbl_t; + +struct qhnobj_s { + uint32_t hash; /*!< 32bit-hash value of object name */ + char *key; /*!< object key */ + void *value; /*!< object value */ + qhnobj_t *next; /*!< for chaining next collision object */ +}; + +// Head node in hash table +struct qhslot_s { + qhnobj_t *head; /*!< The first collision object for gets */ + qhnobj_t *tail; /*!< The last collision object for puts */ +}; + +struct qhashtbl_s { + /* capsulated member functions */ + bool (*put) (qhashtbl_t *tbl, const char *fullpath, const void *data); + bool (*put2) (qhashtbl_t *tbl, const char *path, const char *name, const void *data); + void *(*get) (qhashtbl_t *tbl, const char *fullpath); + void *(*get2) (qhashtbl_t *tbl, const char *path, const char *name); + bool (*remove) (qhashtbl_t *tbl, const char *fullpath); + + int (*size) (qhashtbl_t *tbl); + void (*clear) (qhashtbl_t *tbl); + void (*debug) (qhashtbl_t *tbl, FILE *out, bool detailed); + + void (*free) (qhashtbl_t *tbl); + + /* private variables - do not access directly */ + int num; /*!< number of objects in this table */ + int range; /*!< hash range, vertical number of slots */ + qhslot_t *slots; /*!< slot head node */ + + /* private debug variables */ + int ncalls_get; // number of calls to get() + int nwalks_get; // number of walking steps in hash list in get() + int ncalls_put; // number of calls to put() + int nwalks_put; // number of walking steps in hash list in put() +}; + +qhashtbl_t* qhashtbl(int range); + +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/tests/libs/adios/src/core/transforms/adios_patchdata.c b/tests/libs/adios/src/core/transforms/adios_patchdata.c new file mode 100644 index 0000000000..4d5c815005 --- /dev/null +++ b/tests/libs/adios/src/core/transforms/adios_patchdata.c @@ -0,0 +1,441 @@ +/* + * adios_patchdata.c + * + * Provides a main function, adios_patch_data, which copies all relevant data + * from one buffer/selection to another buffer/selection. It supports various + * combinations of source and destination selection types. In order to + * minimize implementation, though, it classifies the current selection types + * as follows: + * + * > Global geometric: + * > Bounding box + * > Points + * > Local PG + * > Writeblock + * > Other + * > Auto + * + * Patching is only supported between two selections within the same class. + * + * Created on: Jan 15, 2013 + * Author: David A. Boyuka II + */ + +#include +#include +#include +#include +#include + +#include "adios_error.h" +#include "adios_selection.h" +#include "core/common_read.h" +#include "core/adios_subvolume.h" +#include "core/adios_internals.h" // adios_get_type_size() +#include "core/adios_selection_util.h" +#include "core/transforms/adios_patchdata.h" + +#define PATCH_UNIMPL(dsttype,srctype) \ + adios_error_at_line(err_invalid_argument, __FILE__, __LINE__, \ + "Patching of data from '%s' selection to '%s' selection not currently supported", \ + srctype, dsttype); + +// One-to-one global patch functions +inline static uint64_t adios_patch_data_bb_to_bb(void *dst, uint64_t dst_ragged_offset, const ADIOS_SELECTION_BOUNDINGBOX_STRUCT *dst_bb, + void *src, uint64_t src_ragged_offset, const ADIOS_SELECTION_BOUNDINGBOX_STRUCT *src_bb, + enum ADIOS_DATATYPES datum_type, + enum ADIOS_FLAG swap_endianness) { + + const int ndim = dst_bb->ndim; + const ADIOS_SELECTION_BOUNDINGBOX_STRUCT *inter_bb; + uint64_t *inter_off_relative_to_dst; + uint64_t *inter_off_relative_to_src; + uint64_t volume; + + // Intersect the two bounding boxes + ADIOS_SELECTION *inter_sel = adios_selection_intersect_bb_bb(dst_bb, src_bb); + + // If there is no intersection, stop now, nothing to do + if (!inter_sel) + return 0; + + // (this is guaranteed by the selection intersection code; this is just to check for bugs) + assert(inter_sel->type == ADIOS_SELECTION_BOUNDINGBOX); + inter_bb = &inter_sel->u.bb; + + // Compute the offset of the intersection bounding box within each of + // the source and destination bounding boxes + assert(dst_bb->ndim == src_bb->ndim); + inter_off_relative_to_dst = malloc(ndim * sizeof(uint64_t)); + inter_off_relative_to_src = malloc(ndim * sizeof(uint64_t)); + vector_sub(ndim, inter_off_relative_to_dst, inter_bb->start, dst_bb->start); + vector_sub(ndim, inter_off_relative_to_src, inter_bb->start, src_bb->start); + + // Perform a subvolume memcpy + copy_subvolume_ragged_offset( + dst, src, dst_bb->ndim, inter_bb->count, + dst_bb->count, inter_off_relative_to_dst, dst_ragged_offset, + src_bb->count, inter_off_relative_to_src, src_ragged_offset, + datum_type, swap_endianness); + + // Compute the number of elements copied + volume = compute_volume(ndim, inter_bb->count); + + // Cleanup + free(inter_off_relative_to_dst); + free(inter_off_relative_to_src); + common_read_selection_delete(inter_sel); + + return volume; +} + +// Whenever we are patching between a point selection and bounding box, we +// will always iterate over the point selection, check each points for containment +// within the bounding box, and compute byte offsets for the point within the point list +// and bounding box, regardless of whether the point selection is on the source or +// destination buffer. Therefore, we include a helper function with a boolean flag +// to switch the copy direction, and just branch for a few lines during the copy +// operation. This simplifies the code a lot, and reduces the LoC in this file (although +// this comment makes up for a good bit of that savings). +inline static uint64_t adios_patch_data_bb_pts_helper(void *dst, uint64_t dst_ragged_offset, void *src, uint64_t src_ragged_offset, + const ADIOS_SELECTION_POINTS_STRUCT *pts, + const ADIOS_SELECTION_BOUNDINGBOX_STRUCT *bb, + _Bool isDestPoints, enum ADIOS_DATATYPES datum_type, + enum ADIOS_FLAG swap_endianness) { + const int ndim = pts->ndim; + uint64_t i; + int j; + uint64_t pts_copied = 0; + uint64_t byte_offset_in_bb_buffer, byte_offset_in_pt_buffer; + const uint64_t *cur_pt; + uint64_t *bb_byte_strides = malloc(sizeof(uint64_t) * ndim); + uint64_t *pt_relative_to_bb = malloc(sizeof(uint64_t) * ndim); + + // Compute the strides into the source bounding box array + int typelen = adios_get_type_size(datum_type, NULL); + uint64_t bb_volume = typelen; + for (j = ndim - 1; j >= 0; j--) { + bb_byte_strides[j] = bb_volume; + bb_volume *= bb->count[j]; + } + + uint64_t dst_byte_ragged_offset = dst_ragged_offset * typelen; + uint64_t src_byte_ragged_offset = src_ragged_offset * typelen; + + // Check that the selection dimensions are compatible + assert(pts->ndim == bb->ndim); + + // Check each point; if it's in the bounding box, perform a copy + for (i = 0; i < pts->npoints; i++) { + cur_pt = &pts->points[i * ndim]; + + for (j = 0; j < ndim; j++) { + // If the point's coordinate in some dimension is outside the bounding box + if (cur_pt[j] < bb->start[j] || + cur_pt[j] >= bb->start[j] + bb->count[j]) { + break; + } + } + + // If the point is within the bounding box + if (j == ndim) { + vector_sub(ndim, pt_relative_to_bb, cur_pt, bb->start); + + byte_offset_in_bb_buffer = 0; + for (j = 0; j < ndim; j++) + byte_offset_in_bb_buffer += pt_relative_to_bb[j] * bb_byte_strides[j]; + + byte_offset_in_pt_buffer = i * typelen; + + if (isDestPoints) { + assert(byte_offset_in_pt_buffer >= dst_byte_ragged_offset); + assert(byte_offset_in_bb_buffer >= src_byte_ragged_offset); + memcpy((char*)dst + byte_offset_in_pt_buffer - dst_byte_ragged_offset, (char*)src + byte_offset_in_bb_buffer - src_byte_ragged_offset, typelen); + } else { + assert(byte_offset_in_bb_buffer >= dst_byte_ragged_offset); + assert(byte_offset_in_pt_buffer >= src_byte_ragged_offset); + memcpy((char*)dst + byte_offset_in_bb_buffer - dst_byte_ragged_offset, (char*)src + byte_offset_in_pt_buffer - src_byte_ragged_offset, typelen); + } + pts_copied++; + } + } + + free(bb_byte_strides); + free(pt_relative_to_bb); + + return pts_copied; +} + +inline static uint64_t adios_patch_data_pts_to_bb(void *dst, uint64_t dst_ragged_offset, const ADIOS_SELECTION_BOUNDINGBOX_STRUCT *dst_bb, + void *src, uint64_t src_ragged_offset, const ADIOS_SELECTION_POINTS_STRUCT *src_pts, + enum ADIOS_DATATYPES datum_type, + enum ADIOS_FLAG swap_endianness) { + return adios_patch_data_bb_pts_helper(dst, dst_ragged_offset, src, src_ragged_offset, src_pts, dst_bb, false, datum_type, swap_endianness); +} + +inline static uint64_t adios_patch_data_bb_to_pts(void *dst, uint64_t dst_ragged_offset, const ADIOS_SELECTION_POINTS_STRUCT *dst_pts, + void *src, uint64_t src_ragged_offset, const ADIOS_SELECTION_BOUNDINGBOX_STRUCT *src_bb, + enum ADIOS_DATATYPES datum_type, + enum ADIOS_FLAG swap_endianness) { + return adios_patch_data_bb_pts_helper(dst, dst_ragged_offset, src, src_ragged_offset, dst_pts, src_bb, true, datum_type, swap_endianness); +} + +inline static uint64_t adios_patch_data_pts_to_pts(void *dst, uint64_t dst_ragged_offset, const ADIOS_SELECTION_POINTS_STRUCT *dst_pts, + void *src, uint64_t src_ragged_offset, const ADIOS_SELECTION_POINTS_STRUCT *src_pts, + enum ADIOS_DATATYPES datum_type, + enum ADIOS_FLAG swap_endianness) { + PATCH_UNIMPL("points","points"); + return 0; +} + +// One-to-any global patch functions + +inline static uint64_t adios_patch_data_to_bb(void *dst, uint64_t dst_ragged_offset, const ADIOS_SELECTION_BOUNDINGBOX_STRUCT *dst_bb, + void *src, uint64_t src_ragged_offset, const ADIOS_SELECTION *src_sel, + enum ADIOS_DATATYPES datum_type, + enum ADIOS_FLAG swap_endianness) { + switch (src_sel->type) { + case ADIOS_SELECTION_BOUNDINGBOX: + { + const ADIOS_SELECTION_BOUNDINGBOX_STRUCT *src_bb = &src_sel->u.bb; + return adios_patch_data_bb_to_bb(dst, dst_ragged_offset, dst_bb, src, src_ragged_offset, src_bb, datum_type, swap_endianness); + } + case ADIOS_SELECTION_POINTS: + { + const ADIOS_SELECTION_POINTS_STRUCT *src_pts = &src_sel->u.points; + return adios_patch_data_pts_to_bb(dst, dst_ragged_offset, dst_bb, src, src_ragged_offset, src_pts, datum_type, swap_endianness); + } + case ADIOS_SELECTION_WRITEBLOCK: + case ADIOS_SELECTION_AUTO: + adios_error_at_line(err_invalid_argument, __FILE__, __LINE__, "Incompatible selection types %d, %d were used while patching decoded " + "transformed data into the user buffer (this is an error in the current " + "transform plugin)", src_sel->type, ADIOS_SELECTION_BOUNDINGBOX); + return 0; + default: + adios_error_at_line(err_invalid_argument, __FILE__, __LINE__, "Unknown selection type %d", src_sel->type); + return 0; + } + +} + +inline static uint64_t adios_patch_data_to_pts(void *dst, uint64_t dst_ragged_offset, const ADIOS_SELECTION_POINTS_STRUCT *dst_pts, + void *src, uint64_t src_ragged_offset, const ADIOS_SELECTION *src_sel, + enum ADIOS_DATATYPES datum_type, + enum ADIOS_FLAG swap_endianness) { + switch (src_sel->type) { + case ADIOS_SELECTION_BOUNDINGBOX: + { + const ADIOS_SELECTION_BOUNDINGBOX_STRUCT *src_bb = &src_sel->u.bb; + return adios_patch_data_bb_to_pts(dst, dst_ragged_offset, dst_pts, src, src_ragged_offset, src_bb, datum_type, swap_endianness); + } + case ADIOS_SELECTION_POINTS: + { + const ADIOS_SELECTION_POINTS_STRUCT *src_pts = &src_sel->u.points; + return adios_patch_data_pts_to_pts(dst, dst_ragged_offset, dst_pts, src, src_ragged_offset, src_pts, datum_type, swap_endianness); + } + case ADIOS_SELECTION_WRITEBLOCK: + case ADIOS_SELECTION_AUTO: + adios_error_at_line(err_invalid_argument, __FILE__, __LINE__, "Incompatible selection types %d, %d were used while patching decoded " + "transformed data into the user buffer (this is an error in the current " + "transform plugin)", src_sel->type, ADIOS_SELECTION_POINTS); + return 0; + default: + adios_error_at_line(err_invalid_argument, __FILE__, __LINE__, "Unknown selection type %d", src_sel->type); + return 0; + } + +} + +// +// Any-on-any global patch function +// + +static int is_global_selection(const ADIOS_SELECTION *sel) { + return sel->type == ADIOS_SELECTION_BOUNDINGBOX || sel->type == ADIOS_SELECTION_POINTS; +} + +uint64_t adios_patch_data_to_global(void *dst, uint64_t dst_ragged_offset, const ADIOS_SELECTION *dst_sel, + void *src, uint64_t src_ragged_offset, const ADIOS_SELECTION *src_sel, + enum ADIOS_DATATYPES datum_type, enum ADIOS_FLAG swap_endianness) +{ + if (!is_global_selection(dst_sel) || !is_global_selection(src_sel)) { + adios_error_at_line(err_invalid_argument, __FILE__, __LINE__, "Internal error: adios_patch_data_to_global called on non-global selection type(s)"); + return 0; + } + + switch (dst_sel->type) { + case ADIOS_SELECTION_BOUNDINGBOX: + { + const ADIOS_SELECTION_BOUNDINGBOX_STRUCT *dst_bb = &dst_sel->u.bb; + return adios_patch_data_to_bb(dst, dst_ragged_offset, dst_bb, src, src_ragged_offset, src_sel, datum_type, swap_endianness); + } + case ADIOS_SELECTION_POINTS: + { + const ADIOS_SELECTION_POINTS_STRUCT *dst_pts = &dst_sel->u.points; + return adios_patch_data_to_pts(dst, dst_ragged_offset, dst_pts, src, src_ragged_offset, src_sel, datum_type, swap_endianness); + } + default: + adios_error_at_line(err_invalid_argument, __FILE__, __LINE__, "Unknown selection type %d", dst_sel->type); + return 0; + } +} + + + + +// To-local data patching + +// One-to-one global patch functions + +inline static uint64_t adios_patch_data_bb_to_wb(void *dst, uint64_t dst_ragged_offset, const ADIOS_SELECTION_WRITEBLOCK_STRUCT *dst_wb, + void *src, uint64_t src_ragged_offset, const ADIOS_SELECTION_BOUNDINGBOX_STRUCT *src_bb, + const ADIOS_SELECTION_BOUNDINGBOX_STRUCT *vb_bounds, + enum ADIOS_DATATYPES datum_type, + enum ADIOS_FLAG swap_endianness) +{ + // If this is a sub-PG selection, it refers only to a range of + // elements positions in C array order. Thus, element 0 of the + // output buffer corresponds to element dst_wb->element_offset + // of the writeblock selection. This is in addition to any existing + // ragged offset. + // (for instance, if dst_wb->element_offset is 5, and the existing + // ragged offset were 3, then the user's buffer would start at element + // 3 *within* the sub-PG window that starts at element 5, for a total + // starting offset of 5+3=8 within the whole PG's bounds) + if (dst_wb->is_sub_pg_selection) + dst_ragged_offset += dst_wb->element_offset; + + // Use the existing BB to BB patching function + return adios_patch_data_bb_to_bb( + dst, dst_ragged_offset, vb_bounds, // Patch into the output buffer, which is bounded by this varblock's bounds + src, src_ragged_offset, src_bb, // Patch from the input selection as usual + datum_type, swap_endianness); // Pass other info along +} + +inline static uint64_t adios_patch_data_pts_to_wb(void *dst, uint64_t dst_ragged_offset, const ADIOS_SELECTION_WRITEBLOCK_STRUCT *dst_wb, + void *src, uint64_t src_ragged_offset, const ADIOS_SELECTION_POINTS_STRUCT *src_pts, + const ADIOS_SELECTION_BOUNDINGBOX_STRUCT *vb_bounds, + enum ADIOS_DATATYPES datum_type, + enum ADIOS_FLAG swap_endianness) +{ + // If this is a sub-PG selection, it refers only to a range of + // elements positions in C array order. Thus, element 0 of the + // output buffer corresponds to element dst_wb->element_offset + // of the writeblock selection. This is in addition to any existing + // ragged offset. + // (for instance, if dst_wb->element_offset is 5, and the existing + // ragged offset were 3, then the user's buffer would start at element + // 3 *within* the sub-PG window that starts at element 5, for a total + // starting offset of 5+3=8 within the whole PG's bounds) + if (dst_wb->is_sub_pg_selection) + dst_ragged_offset += dst_wb->element_offset; + + // Use the existing PTS to BB patching function + return adios_patch_data_pts_to_bb( + dst, dst_ragged_offset, vb_bounds, // Patch into the output buffer, which is bounded by this varblock's bounds + src, src_ragged_offset, src_pts, // Patch from the input selection as usual + datum_type, swap_endianness); // Pass other info along +} + +inline static uint64_t adios_patch_data_wb_to_wb(void *dst, uint64_t dst_ragged_offset, const ADIOS_SELECTION_WRITEBLOCK_STRUCT *dst_wb, + void *src, uint64_t src_ragged_offset, const ADIOS_SELECTION_WRITEBLOCK_STRUCT *src_wb, + const ADIOS_SELECTION_BOUNDINGBOX_STRUCT *vb_bounds, + enum ADIOS_DATATYPES datum_type, + enum ADIOS_FLAG swap_endianness) +{ + uint64_t copy_elem_offset, copy_nelems; + const uint64_t vb_size_in_elements = compute_volume(vb_bounds->ndim, vb_bounds->count); + + const uint64_t dst_elem_offset = dst_wb->is_sub_pg_selection ? dst_wb->element_offset : 0; + const uint64_t dst_nelems = dst_wb->is_sub_pg_selection ? dst_wb->nelements : vb_size_in_elements; + const uint64_t src_elem_offset = src_wb->is_sub_pg_selection ? src_wb->element_offset : 0; + const uint64_t src_nelems = src_wb->is_sub_pg_selection ? src_wb->nelements : vb_size_in_elements; + + // Find out how many elements overlap between the two + // writeblock selections (due to the potential existence + // of sub-PG writeblock selections; if both are whole-PG, + // this overlap will be complete) + int intersects = intersect_segments( + dst_elem_offset, dst_nelems, + src_elem_offset, src_nelems, + ©_elem_offset, ©_nelems + ); + + // Copy any elements that are common to both selections + // (for whole-PG writeblock selections, this will be all of them) + if (intersects) { + int typesize = adios_get_type_size(datum_type, NULL); + void *copy_dst = (char*)dst + (copy_elem_offset - dst_elem_offset) * typesize; + void *copy_src = (char*)src + (copy_elem_offset - src_elem_offset) * typesize; + + memcpy(copy_dst, copy_src, copy_nelems * typesize); + if (swap_endianness == adios_flag_yes) + change_endianness(copy_dst, copy_nelems * typesize, datum_type); + + return copy_nelems; + } else { + return 0; + } +} + +// One-to-any local patch functions + +inline static uint64_t adios_patch_data_to_wb(void *dst, uint64_t dst_ragged_offset, const ADIOS_SELECTION_WRITEBLOCK_STRUCT *dst_wb, + void *src, uint64_t src_ragged_offset, const ADIOS_SELECTION *src_sel, + const ADIOS_SELECTION_BOUNDINGBOX_STRUCT *vb_bounds, + enum ADIOS_DATATYPES datum_type, + enum ADIOS_FLAG swap_endianness) { + switch (src_sel->type) { + case ADIOS_SELECTION_BOUNDINGBOX: + { + const ADIOS_SELECTION_BOUNDINGBOX_STRUCT *src_bb = &src_sel->u.bb; + return adios_patch_data_bb_to_wb(dst, dst_ragged_offset, dst_wb, src, src_ragged_offset, src_bb, vb_bounds, datum_type, swap_endianness); + } + case ADIOS_SELECTION_POINTS: + { + const ADIOS_SELECTION_POINTS_STRUCT *src_pts = &src_sel->u.points; + return adios_patch_data_pts_to_wb(dst, dst_ragged_offset, dst_wb, src, src_ragged_offset, src_pts, vb_bounds, datum_type, swap_endianness); + } + case ADIOS_SELECTION_WRITEBLOCK: + { + const ADIOS_SELECTION_WRITEBLOCK_STRUCT *src_wb = &src_sel->u.block; + return adios_patch_data_wb_to_wb(dst, dst_ragged_offset, dst_wb, src, src_ragged_offset, src_wb, vb_bounds, datum_type, swap_endianness); + } + case ADIOS_SELECTION_AUTO: + adios_error_at_line(err_invalid_argument, __FILE__, __LINE__, "Incompatible selection types %d, %d were used while patching decoded " + "transformed data into the user buffer (this is an error in the current " + "transform plugin)", src_sel->type, ADIOS_SELECTION_BOUNDINGBOX); + return 0; + default: + adios_error_at_line(err_invalid_argument, __FILE__, __LINE__, "Unknown selection type %d", src_sel->type); + return 0; + } + +} + +// +// Any-on-any local patch function +// + +// NOTE: vb_bounds_sel is the bounding box of the varblock to which dst_sel (a writeblock selection) corresponds +uint64_t adios_patch_data_to_local(void *dst, uint64_t dst_ragged_offset, const ADIOS_SELECTION *dst_sel, + void *src, uint64_t src_ragged_offset, const ADIOS_SELECTION *src_sel, + const ADIOS_SELECTION_BOUNDINGBOX_STRUCT *vb_bounds, + enum ADIOS_DATATYPES datum_type, enum ADIOS_FLAG swap_endianness) +{ + if (is_global_selection(dst_sel)) { + adios_error_at_line(err_invalid_argument, __FILE__, __LINE__, "Internal error: adios_patch_data_to_local called on non-global destination selection type %d", dst_sel->type); + return 0; + } + + switch (dst_sel->type) { + case ADIOS_SELECTION_WRITEBLOCK: + { + const ADIOS_SELECTION_WRITEBLOCK_STRUCT *dst_wb = &dst_sel->u.block; + return adios_patch_data_to_wb(dst, dst_ragged_offset, dst_wb, src, src_ragged_offset, src_sel, vb_bounds, datum_type, swap_endianness); + } + default: + adios_error_at_line(err_invalid_argument, __FILE__, __LINE__, "Unknown selection type %d", dst_sel->type); + return 0; + } +} diff --git a/tests/libs/adios/src/core/transforms/adios_patchdata.h b/tests/libs/adios/src/core/transforms/adios_patchdata.h new file mode 100644 index 0000000000..17ad92aa37 --- /dev/null +++ b/tests/libs/adios/src/core/transforms/adios_patchdata.h @@ -0,0 +1,34 @@ +/* + * adios_patchdata.h + * + * Created on: Jan 15, 2013 + * Author: David A. Boyuka II + */ + +#ifndef ADIOS_PATCHDATA_H_ +#define ADIOS_PATCHDATA_H_ + +#include +#include + +/* + * Copies data from a source buffer to a destination buffer, where the buffers each contain + * data to fill given ADIOS_SELECTIONs. The data to be copied is the intersection of the source + * and destination buffers, as defined by their selections. This function can only operate on + * global selections (e.g., bounding box, points), not varblock-relative selections (e.g., writeblock). + */ +uint64_t adios_patch_data_to_global(void *dst, uint64_t dst_ragged_offset, const ADIOS_SELECTION *dst_sel, + void *src, uint64_t src_ragged_offset, const ADIOS_SELECTION *src_sel, + enum ADIOS_DATATYPES datum_type, + enum ADIOS_FLAG swap_endianness); + +/* + * Same as adios_patch_data_to_global, but supports varblock-relative selections, and thus takes the + * additional argument "vb_bounds_sel" to define the bounds of the varblock in this context. + */ +uint64_t adios_patch_data_to_local(void *dst, uint64_t dst_ragged_offset, const ADIOS_SELECTION *dst_sel, + void *src, uint64_t src_ragged_offset, const ADIOS_SELECTION *src_sel, + const ADIOS_SELECTION_BOUNDINGBOX_STRUCT *vb_bounds, + enum ADIOS_DATATYPES datum_type, enum ADIOS_FLAG swap_endianness); + +#endif /* ADIOS_PATCHDATA_H_ */ diff --git a/tests/libs/adios/src/core/transforms/adios_transforms_common.c b/tests/libs/adios/src/core/transforms/adios_transforms_common.c new file mode 100644 index 0000000000..b08ac44dcf --- /dev/null +++ b/tests/libs/adios/src/core/transforms/adios_transforms_common.c @@ -0,0 +1,351 @@ +/* + * All variable transformation code (excepting that for integration into + * existing ADIOS code) resides in this file. + * + * - Definition of variable transformation - + * A variable transformation takes a single variable (as defined in XML, or + * via the noxml interface) and transforms the format of the actual data from + * a "flat form" (where the data elements are simply linearized in some fashion + * and stored) to a "transformed form" (where the data has been rearranged + * and/or translated into another form, from which the original data cannot be + * retrieved without transform-specific code/algorithms). + * + * - Implementation - + * + * The implementation has gone through a few revisions, each progressively + * better integrated into ADIOS with less "hacking" (hopefully). + * + * ----------------------- + * - Implementation v0.1 - + * ----------------------- + * This first implementation relies on intercepting variable declarations, + * inquiries, reads and writes to translate between raw and transformed + * data and metadata. These translations take place primarily via hooks + * in common_adios_* functions. + * + * In this version, transformed variables are converted into 1D byte arrays, + * with the original dimension/type metadata discarded. This circumvents the + * need for low-level ADIOS changes, since after this conversion it is a + * normal ADIOS variable. + * + * This conversion requires the addition of a new auxiliary variable to hold + * the byte array length (dimension). This variable is visible to the user + * through, for example, bpdump or bpls. + * + * The transformation is marked with the new "transform_type" characteristic, + * which signals what, if any, transformation is applied. + * + * Limitations: + * > Requires an extra variable for dimension + * > Writing this extra variable requires access to common_adios_write, which + * is not part of the internal library, which causes linker errors; the only + * solutions are to copy the code (bad), or link more libraries with the + * utility programs (also bad) + * > Causes two issues with adios_group_size: + * 1) group size for the payload of the dimension variable (i.e. 8 bytes) is + * not automatically included, must be added to the group_size calculation + * 2) expanded group size for the payload of size-increasing transforms is + * not accounted for unless the user does so explicitly + * > Original metadata is discarded, so the user only sees a byte array + * > No way to read back the original data, since this metadata is lost + * + * ----------------------- + * - Implementation 0.2 - + * ----------------------- + * Next, we remove the auxiliary dimension variable by using explicit dimension + * lengths. This has the same effect as putting a literal number into the + * "dimensions" field in the XML, but it is possible to change it across time + * steps, which is not possible in the static XML file. + * + * Benefits: + * > Eliminates the extra dimension variable and linkage problems + * > Eliminates group size problem 1) + * > Significantly reduces code length + * + * Limitations: + * > Still discards original metadata and precludes meaningful reads + * > Still has group size problem 2) + * + * ----------------------- + * - Implementation 1.0 - + * ----------------------- + * Next, we add another characteristic, "pretransform_metadata," to hold the + * original type and dimensions of the variable before transformation. This + * allows modification of the read API to use this original metadata where + * appropriate to operate on the variable correctly. + * + * Additionally, in order to support timesteps, we add an additional time + * index dimension variable to the transformed 1D byte array (making it a + * 2D variable). + * + * Benefits: + * > Maintains original metadata and allows reads + * + * Limitations: + * > Requires additional metadata + * > Still has group size problem 2) + * + * ------------------------------------ + * - Implementation 2.0 (future work) - + * ------------------------------------ + * A more elegant solution would be to retain the original variable + * metadata in place, calling it "logical metadata", and instead separate + * out the "physical" metadata to store the length/format of the stored + * data. This is more complex, as it involves breaking the implicit + * assumption throughout the ADIOS codebase that these two metadata + * types are one and the same. For example, currently the length of a + * variable buffer (i.e. "physical metadata") is assumed to be + * sizeof(type)*dim1*...dimN bytes (i.e. derived from the "logical metadata"). + * It is unclear whether the elegance of this approach is worth the + * effort, and whether it would, in fact, have any tangible benefit + * over the previously described API-level translation. + * + * One potential advantage is a reduction in total metadata space requirement. + * Implementation 1.X requires an entire new dimension/type block, which + * requires something like 30 bytes/var. This method would probably only + * require only 8 bytes per var (the length in bytes of the stored buffer). + * + * Benefits: + * > Reduces metadata from implementations 1.X + * + * Limitations: + * > Harder/riskier to code + * > Still has group size problem 2) + * + * ---------------------------- + * - The "group size" problem - + * ---------------------------- + * The basic issue is that some transformations may increase the storage + * footprint of a variable (indexing, for instance), but the user does not + * account for this when calling adios_group_size. Unfortunately, it cannot + * be automatically adjusted for in adios_group_size, because we only receive + * the aggregate group size, and at this point dimension variables have not + * been filled in, so we cannot calculate the expected size of each variable + * as a basis to compute an estimated transformed storage footprint. + * + * The temporary stop-gap measure will be to find the most "expansive" + * transform method used on any variable, and apply that expansion ratio + * to the entire group size as a worst-case bound. This is not a terrible bound + * for the transform methods currently considered (compression, which actually + * reduces storage, and NCSU indexing, which increases storage by 30% maximum). + * However, later transformation methods may increase storage further, thus + * deteriorating the quality of this bound. Also, this method is rather ugly, + * so devising a better approach would be desirable. + * + * Created on: Jun 22, 2012 + * Author: David A. Boyuka II + */ + +#include "adios.h" +#include "core/adios_bp_v1.h" +#include "core/adios_internals.h" +#include "core/adios_endianness.h" +#include "core/adios_logger.h" +#include "core/bp_utils.h" +#include "core/common_adios.h" + +#include "core/transforms/adios_transforms_common.h" +#include "core/transforms/adios_transforms_hooks.h" + +#include +#include + + +// Returns true for big endian, false for little endian +int get_system_endianness() { + uint16_t word = 0x1234; + return *(uint8_t*)(&word) == 0x12; // Returns 1 (big endian) iff the high byte comes first +} + +//////////////////////////////////////// +// Variable introspection +//////////////////////////////////////// + +enum ADIOS_DATATYPES adios_transform_get_var_original_type_var(struct adios_var_struct *var) +{ + if (var->transform_type != adios_transform_none) + return var->pre_transform_type; + else + return var->type; +} + +enum ADIOS_DATATYPES adios_transform_get_var_original_type_var_header(struct adios_var_header_struct_v1 *var_header) +{ + if (var_header->characteristics.transform.transform_type != adios_transform_none) + return var_header->characteristics.transform.pre_transform_type; + else + return var_header->type; +} + +enum ADIOS_DATATYPES adios_transform_get_var_original_type_index(struct adios_index_var_struct_v1 *var) { + if (var->characteristics[0].transform.transform_type != adios_transform_none) + return var->characteristics[0].transform.pre_transform_type; + else + return var->type; +} + +int adios_transform_get_var_original_ndims_characteristic(struct adios_index_characteristic_struct_v1 *ch) { + if (ch->transform.transform_type != adios_transform_none) + return ch->transform.pre_transform_dimensions.count; + else + return ch->dims.count; +} + +struct adios_index_characteristic_dims_struct_v1 * adios_transform_get_var_original_dims_characteristic(struct adios_index_characteristic_struct_v1 *ch) { + if (ch->transform.transform_type != adios_transform_none) + return &ch->transform.pre_transform_dimensions; + else + return &ch->dims; +} + +int adios_transform_get_var_original_ndims_index(struct adios_index_var_struct_v1 *var) { + return adios_transform_get_var_original_ndims_characteristic(&var->characteristics[0]); +} + +int adios_transform_is_var_transformed(const struct adios_index_var_struct_v1 *var) { + assert(var); + if (var->characteristics_count < 1) + return 0; + + return var->characteristics[0].transform.transform_type != adios_transform_none; +} + +uint64_t adios_transform_get_var_transformed_size(const struct adios_index_var_struct_v1 *var, int time_index) { + struct adios_index_characteristic_dims_struct_v1 *dims; + int dim; + uint64_t size = 1; + + //int is_global; + uint64_t *ldims, *gdims, *offsets; + + assert(var); + assert(adios_transform_is_var_transformed(var)); + assert(time_index < var->characteristics_count); + + dims = &var->characteristics[time_index].dims; + ldims = malloc(sizeof(uint64_t) * dims->count); + gdims = malloc(sizeof(uint64_t) * dims->count); + offsets = malloc(sizeof(uint64_t) * dims->count); + //is_global = bp_get_dimension_generic_notime(dims, ldims, gdims, offsets, 0); + free(gdims); + free(offsets); + + // var is non-null and is transformed, so it should be a 1D byte array. + for (dim = 0; dim < dims->count; dim++) { + size *= ldims[dim]; + } + free(ldims); + + return size; +} + +////////////////////////////////////////////////// +// Transform characteristic management functions +////////////////////////////////////////////////// + +// Init +int adios_transform_init_transform_characteristic(struct adios_index_characteristic_transform_struct *transform) { + transform->transform_type = adios_transform_none; + transform->pre_transform_dimensions.count = 0; + transform->pre_transform_dimensions.dims = 0; + transform->pre_transform_type = adios_unknown; + transform->transform_metadata_len = 0; + transform->transform_metadata = 0; + return 1; +} + +// Utility functions +// TODO: These are defined local bp_utils.c. Maybe should put them in a header? +#define BUFREAD8(b,var) var = (uint8_t) *(b->buff + b->offset); \ + b->offset += 1; +#define BUFREAD16(b,var) var = *(uint16_t *) (b->buff + b->offset); \ + if (b->change_endianness == adios_flag_yes) \ + swap_16(var); \ + b->offset += 2; +#define BUFREAD64(b,var) var = *(uint64_t *) (b->buff + b->offset); \ + if (b->change_endianness == adios_flag_yes) \ + swap_64(var); \ + b->offset += 8; +#define BUFREAD(b,dst,len) memcpy((dst), (b->buff + b->offset), (len)); \ + b->offset += (len); + +static enum ADIOS_TRANSFORM_TYPE deserialize_transform_type(struct adios_bp_buffer_struct_v1 *b) { + // Read the length of the transform UID + uint8_t transform_uid_len; + BUFREAD8(b, transform_uid_len); + + // Read the transform UID itself (e.g., "zlib" or "ncsu-isobar") + char *transform_uid = calloc(1, transform_uid_len + 1); + BUFREAD(b, transform_uid, transform_uid_len); + + enum ADIOS_TRANSFORM_TYPE transform_type = adios_transform_find_type_by_uid(transform_uid); + + free(transform_uid); + return transform_type; +} + +// Deserialize +int adios_transform_deserialize_transform_characteristic(struct adios_index_characteristic_transform_struct *transform, struct adios_bp_buffer_struct_v1 *b) { + // The adios_characterstic_transform flag has already been read + + uint8_t i; + uint16_t len, meta_len; + + //BUFREAD8(b, transform->transform_type); + transform->transform_type = deserialize_transform_type(b); + + BUFREAD8(b, transform->pre_transform_type); + BUFREAD8(b, transform->pre_transform_dimensions.count); + + BUFREAD16(b, len); + transform->pre_transform_dimensions.dims = (uint64_t*)malloc(len); + + // Make sure length and count match up + assert(len == 3 * 8 * transform->pre_transform_dimensions.count); + + // Read each set of 3 dimension components (dim, global dim, local offset) + for (i = 0; i < 3 * transform->pre_transform_dimensions.count; i++) { + BUFREAD64(b, transform->pre_transform_dimensions.dims[i]); + } + + BUFREAD16(b, meta_len); + + if (meta_len) { + transform->transform_metadata_len = meta_len; + transform->transform_metadata = malloc(meta_len); + assert(transform->transform_metadata); + + BUFREAD(b, transform->transform_metadata, meta_len); + } else { + transform->transform_metadata = 0; + } + + return is_transform_type_valid(transform->transform_type); +} + +// Clear +int adios_transform_clear_transform_characteristic(struct adios_index_characteristic_transform_struct *transform) { + transform->transform_type = adios_transform_none; + + transform->pre_transform_type = 0; + + if (transform->pre_transform_dimensions.dims) + free(transform->pre_transform_dimensions.dims); + transform->pre_transform_dimensions.dims = 0; + + transform->transform_metadata_len = 0; + if (transform->transform_metadata) + free(transform->transform_metadata); + transform->transform_metadata = 0; + + return 1; // Return success +} + +int adios_transform_swap_transform_characteristics(struct adios_index_characteristic_transform_struct *trans1, + struct adios_index_characteristic_transform_struct *trans2) { + struct adios_index_characteristic_transform_struct tmp; + tmp = *trans1; + *trans1 = *trans2; + *trans2 = tmp; + return 1; +} diff --git a/tests/libs/adios/src/core/transforms/adios_transforms_common.h b/tests/libs/adios/src/core/transforms/adios_transforms_common.h new file mode 100644 index 0000000000..da98fbc48f --- /dev/null +++ b/tests/libs/adios/src/core/transforms/adios_transforms_common.h @@ -0,0 +1,64 @@ +/* + * Contains functionality that is common to both reading and writing for + * handling variable transforms in ADIOS. + * + * Created on: Jun 22, 2012 + * Author: David A. Boyuka II + */ + +#ifndef ADIOS_TRANSFORM_H +#define ADIOS_TRANSFORM_H + +#include +#include "core/adios_bp_v1.h" +#include "core/transforms/adios_transforms_hooks.h" // Includes the hooks header to load and access the ADIOS_TRANSFORM_TYPE enum +//#include "adios_internals.h" + +int get_system_endianness(); + +///////////////////////////////////// +// Variable introspection +///////////////////////////////////// + +enum ADIOS_DATATYPES adios_transform_get_var_original_type_var(struct adios_var_struct *var); +enum ADIOS_DATATYPES adios_transform_get_var_original_type_var_header(struct adios_var_header_struct_v1 *var_header); +enum ADIOS_DATATYPES adios_transform_get_var_original_type_index(struct adios_index_var_struct_v1 *var); +int adios_transform_get_var_original_ndims_characteristic(struct adios_index_characteristic_struct_v1 *ch); + +struct adios_index_characteristic_dims_struct_v1 * adios_transform_get_var_original_dims_characteristic(struct adios_index_characteristic_struct_v1 *ch); +int adios_transform_get_var_original_ndims_index(struct adios_index_var_struct_v1 *var); + +/* + * Returns whether the given variable is transformed + * @param var the variable to check + * @return whether the variable is transformed + */ +int adios_transform_is_var_transformed(const struct adios_index_var_struct_v1 *var); + +/* + * Returns the number of bytes in the transformed form of the variable. + * Precondition: var has been transformed, and has a transform_type other than + * adios_transform_none and adios_transform_unknown. + * + * @param var the variable + * @return the number of bytes in the transformed form of 'var' + */ +uint64_t adios_transform_get_var_transformed_size(const struct adios_index_var_struct_v1 *var, int time_index); + +////////////////////////////////////////////////// +// Transform characteristic management functions +////////////////////////////////////////////////// + +// Init +int adios_transform_init_transform_characteristic(struct adios_index_characteristic_transform_struct *transform); + +// Deserialize (this is needed because bp_utils.c uses this) +int adios_transform_deserialize_transform_characteristic(struct adios_index_characteristic_transform_struct *transform, struct adios_bp_buffer_struct_v1 *b); + +// Clear (i.e. free/wipe) +int adios_transform_clear_transform_characteristic(struct adios_index_characteristic_transform_struct *transform); + +// Swap +int adios_transform_swap_transform_characteristics(struct adios_index_characteristic_transform_struct *c1, struct adios_index_characteristic_transform_struct *c2); + +#endif /* ADIOS_TRANSFORM_H */ diff --git a/tests/libs/adios/src/core/transforms/adios_transforms_datablock.c b/tests/libs/adios/src/core/transforms/adios_transforms_datablock.c new file mode 100644 index 0000000000..1fcba86973 --- /dev/null +++ b/tests/libs/adios/src/core/transforms/adios_transforms_datablock.c @@ -0,0 +1,101 @@ +/* + * adios_transforms_datablock.c + * + * Created on: Dec 11, 2012 + * Author: David A. Boyuka II + */ + +#include +#include + +#include "adios_error.h" +#include "adios_types.h" +#include "core/common_read.h" + +#include "core/transforms/adios_transforms_common.h" +#include "core/transforms/adios_transforms_read.h" +#include "core/transforms/adios_transforms_util.h" +#include "core/transforms/adios_transforms_datablock.h" + +// Datablock management + +adios_datablock * adios_datablock_new_whole_pg( + const adios_transform_read_request *read_req, + const adios_transform_pg_read_request *pg_read_req, + void *data) +{ + // Return a datablock using the PG's writeblock (this is + // the most compatible option for processing in the + // transforms framework) + return adios_datablock_new( + read_req->transinfo->orig_type, + pg_read_req->timestep, + pg_read_req->pg_writeblock_sel, + data); +} + +adios_datablock * adios_datablock_new( + enum ADIOS_DATATYPES elem_type, + int timestep, + const ADIOS_SELECTION *bounds, + void *data) +{ + assert(bounds); + assert(data); + return adios_datablock_new_ragged_offset(elem_type, timestep, bounds, 0, data); +} + +/* + * Note: only valid for bounding box selections (since there are no ragged + * arrays for point selections, and no other selection types are supported + * right now). + */ +adios_datablock * adios_datablock_new_ragged( + enum ADIOS_DATATYPES elem_type, + int timestep, + const ADIOS_SELECTION *bounds, + const uint64_t *ragged_offsets, void *data) { + + assert(bounds); + assert(data); + assert(bounds->type == ADIOS_SELECTION_BOUNDINGBOX); + + const uint64_t ragged_offset = ragged_offsets ? + compute_linear_offset_in_volume(bounds->u.bb.ndim, ragged_offsets, bounds->u.bb.count) : + 0; + + return adios_datablock_new_ragged_offset(elem_type, timestep, bounds, ragged_offset, data); +} + +adios_datablock * adios_datablock_new_ragged_offset( + enum ADIOS_DATATYPES elem_type, + int timestep, + const ADIOS_SELECTION *bounds, + uint64_t ragged_offset, void *data) { + + assert(bounds); + assert(data); + + adios_datablock *datablock = malloc(sizeof(adios_datablock)); + + datablock->elem_type = elem_type; + datablock->bounds = copy_selection(bounds); + datablock->timestep = timestep; + datablock->ragged_offset = ragged_offset; + datablock->data = data; + + return datablock; +} + +#define MYFREE(p) {if (p) free(p); (p)=NULL;} +void adios_datablock_free(adios_datablock **datablock_ptr, int free_data) { + adios_datablock *datablock = *datablock_ptr; + if (datablock) { + if (datablock->bounds) + common_read_selection_delete((ADIOS_SELECTION*)datablock->bounds); + if (free_data) + MYFREE(datablock->data); + } + MYFREE(*datablock_ptr); +} +#undef MYFREE diff --git a/tests/libs/adios/src/core/transforms/adios_transforms_datablock.h b/tests/libs/adios/src/core/transforms/adios_transforms_datablock.h new file mode 100644 index 0000000000..f9c242098a --- /dev/null +++ b/tests/libs/adios/src/core/transforms/adios_transforms_datablock.h @@ -0,0 +1,56 @@ +/* + * adios_transforms_datablock.h + * + * An ADIOS transform datablock represents a chunk of data that is retrieved by a transform plugin during reading. + * This block may include exactly the data that was requested, or it may contain more (the excess will be trimmed). + * For instance, suppose a 10x10 block of a PG was requested, but the transform method can only retrieve data + * in 16x16 blocks. Instead of reading a 16x16 block and performing the trimming within the transform plugin, + * the plugin may simply read the 16x16 block and return it immediately, leaving the trimming to the framework. + * + * Created on: Dec 11, 2012 + * Author: David A. Boyuka II + */ + +#ifndef ADIOS_TRANSFORMS_DATABLOCK_H_ +#define ADIOS_TRANSFORMS_DATABLOCK_H_ + +#include "public/adios_types.h" +#include + +typedef struct { + int timestep; // timestep of this datablock + const ADIOS_SELECTION *bounds; // (global) selection describing the data contained in this datablock + uint64_t ragged_offset; // Ragged array offset of the data buffer in this datablock + // (only applicable for bounding-box-type selections) + + enum ADIOS_DATATYPES elem_type;// Datatype of the elements in this datablock + void *data; // Pointer to the data buffer of this datablock +} adios_datablock; + +// Datablock management +adios_datablock * adios_datablock_new_whole_pg( + const adios_transform_read_request *read_req, + const adios_transform_pg_read_request *pg_read_req, + void *data); + +adios_datablock * adios_datablock_new( + enum ADIOS_DATATYPES elem_type, + int timestep, + const ADIOS_SELECTION *bounds, + void *data); + +adios_datablock * adios_datablock_new_ragged( + enum ADIOS_DATATYPES elem_type, + int timestep, + const ADIOS_SELECTION *bounds, + const uint64_t *ragged_offsets, void *data); + +adios_datablock * adios_datablock_new_ragged_offset( + enum ADIOS_DATATYPES elem_type, + int timestep, + const ADIOS_SELECTION *bounds, + uint64_t ragged_offset, void *data); + +void adios_datablock_free(adios_datablock **datablock, int free_data); + +#endif /* ADIOS_TRANSFORMS_DATABLOCK_H_ */ diff --git a/tests/libs/adios/src/core/transforms/adios_transforms_hooks.c b/tests/libs/adios/src/core/transforms/adios_transforms_hooks.c new file mode 100644 index 0000000000..9dbc0874bf --- /dev/null +++ b/tests/libs/adios/src/core/transforms/adios_transforms_hooks.c @@ -0,0 +1,135 @@ +/* + * adios_transforms_hooks.c + * + * Includes functions common to both read and write interaction with transform plugins. + * Primarily, maintains a basic info table for each transform method, including: + * type: the integer ID of the transform method (i.e., enum ADIOS_TRANSFORM_TYPE) + * uid: the short string unique ID (UID) identifying each transform method for + * portability between systems, etc. + * description: a human-readable description of the transform method + * + * Created on: Feb 14, 2013 + * Author: David A. Boyuka II + */ + +#include +#include "core/transforms/adios_transforms_common.h" +#include "core/transforms/adios_transforms_hooks.h" +#include "core/transforms/plugindetect/plugin_info_types.h" + +// +// Build plugin info and aliases tables +// + +// Defines ADIOS_TRANSFORM_INFOS and ADIOS_TRANSFORM_ALIASES +#include "core/transforms/plugindetect/detect_plugin_infos.h" + +// +// General plugin info inspection +// + +// Transform ID -> plugin info retrieval +static adios_transform_plugin_info_t * find_plugin_info(enum ADIOS_TRANSFORM_TYPE transform_type) { + int i; + for (i = 0; i < num_adios_transform_types; i++) + if (ADIOS_TRANSFORM_METHOD_INFOS[i].type == transform_type) + return &ADIOS_TRANSFORM_METHOD_INFOS[i]; + return NULL; +} + +static adios_transform_plugin_xml_aliases_t * find_plugin_xml_aliases(enum ADIOS_TRANSFORM_TYPE transform_type) { + int i; + for (i = 0; i < num_adios_transform_types; i++) + if (ADIOS_TRANSFORM_METHOD_ALIASES[i].type == transform_type) + return &ADIOS_TRANSFORM_METHOD_ALIASES[i]; + return NULL; +} + +const char * adios_transform_plugin_uid(enum ADIOS_TRANSFORM_TYPE transform_type) { + adios_transform_plugin_info_t *info = find_plugin_info(transform_type); + if (info) return info->uid; + else return NULL; +} + +const char * adios_transform_plugin_desc(enum ADIOS_TRANSFORM_TYPE transform_type) { + adios_transform_plugin_info_t *info = find_plugin_info(transform_type); + if (info) return info->description; + else return NULL; +} + +int adios_transform_plugin_num_xml_aliases(enum ADIOS_TRANSFORM_TYPE transform_type) { + adios_transform_plugin_xml_aliases_t *aliases = find_plugin_xml_aliases(transform_type); + if (aliases) return 1; + else return 0; +} + +const char ** adios_transform_plugin_xml_aliases(enum ADIOS_TRANSFORM_TYPE transform_type) { + adios_transform_plugin_xml_aliases_t *aliases = find_plugin_xml_aliases(transform_type); + if (aliases) return &aliases->xmlAlias; + else return NULL; +} + +const char * adios_transform_plugin_primary_xml_alias(enum ADIOS_TRANSFORM_TYPE transform_type) { + adios_transform_plugin_xml_aliases_t *aliases = find_plugin_xml_aliases(transform_type); + if (aliases) return aliases->xmlAlias; + else return NULL; +} + +//////////////////////////////////////// +// Transform UID -> ID +//////////////////////////////////////// + +/* + * @param uid the UID (unique identifier) of a transform type + * @return the ADIOS_TRANSFORM_TYPE corresponding to the given UID, based on + * the current configuration of ADIOS, or adios_transform_unknown if + * no transform type has been registered with that UID. + */ +enum ADIOS_TRANSFORM_TYPE adios_transform_find_type_by_uid(const char *uid) { + int i; + for (i = adios_transform_none; i < num_adios_transform_types; i++) { + const adios_transform_plugin_info_t *info = &ADIOS_TRANSFORM_METHOD_INFOS[i]; + if (strcmp(uid, info->uid) == 0) { + return info->type; + } + } + return adios_transform_unknown; +} + +//////////////////////////////////////// +// Transform XML alias -> Transform ID conversion +//////////////////////////////////////// + +/* + * @param xml_alias the name of a transform type as specified in the ADIOS XML + * @return the ADIOS_TRANSFORM_TYPE corresponding to that alias, or + * adios_transform_unknown if it does not match any registered + * transform type + */ +enum ADIOS_TRANSFORM_TYPE adios_transform_find_type_by_xml_alias(const char *xml_alias) { + enum ADIOS_TRANSFORM_TYPE plugin_type; + int j; + for (plugin_type = adios_transform_none; plugin_type < num_adios_transform_types; plugin_type++) { + const int naliases = adios_transform_plugin_num_xml_aliases(plugin_type); + const char **aliases = adios_transform_plugin_xml_aliases(plugin_type); + + for (j = 0; j < naliases; j++) { + if (strcasecmp(xml_alias, aliases[j]) == 0) + return plugin_type; + } + } + return adios_transform_unknown; +} + +///////////////////////////////////////// +// Other transform inspection functions +///////////////////////////////////////// + +/* + * @return non-zero if transform_type is a valid transform type (including "none"), else + * return zero (when transform_type is out of range, or is equal to adios_transform_unknown). + */ +int is_transform_type_valid(enum ADIOS_TRANSFORM_TYPE transform_type) { + return transform_type >= adios_transform_none && + transform_type < num_adios_transform_types; +} diff --git a/tests/libs/adios/src/core/transforms/adios_transforms_hooks.h b/tests/libs/adios/src/core/transforms/adios_transforms_hooks.h new file mode 100644 index 0000000000..6a0f8279d2 --- /dev/null +++ b/tests/libs/adios/src/core/transforms/adios_transforms_hooks.h @@ -0,0 +1,40 @@ +/* + * adios_transforms_hooks.h + * + * Created on: Feb 14, 2013 + * Author: David A. Boyuka II + */ + +#ifndef ADIOS_TRANSFORMS_HOOKS_H_ +#define ADIOS_TRANSFORMS_HOOKS_H_ + +// Build the ADIOS_TRANSFORM_TYPE enum +#include "core/transforms/plugindetect/detect_plugin_types.h" + +// Transform info functions + +const char * adios_transform_plugin_uid(enum ADIOS_TRANSFORM_TYPE transform_type); +const char * adios_transform_plugin_desc(enum ADIOS_TRANSFORM_TYPE transform_type); +int adios_transform_plugin_num_xml_aliases(enum ADIOS_TRANSFORM_TYPE transform_type); +const char ** adios_transform_plugin_xml_aliases(enum ADIOS_TRANSFORM_TYPE transform_type); +const char * adios_transform_plugin_primary_xml_alias(enum ADIOS_TRANSFORM_TYPE transform_type); + +// Transform UID -> ID + +enum ADIOS_TRANSFORM_TYPE adios_transform_find_type_by_uid(const char *uid); + +// Transform XML alias <-> ID conversion + +/* + * @param xml_alias the name of a transform type as specified in the ADIOS XML + * @return the ADIOS_TRANSFORM_TYPE corresponding to that alias, or + * adios_transform_unknown if it does not match any registered + * transform type + */ +enum ADIOS_TRANSFORM_TYPE adios_transform_find_type_by_xml_alias(const char *xml_alias); + +// Other inspection functions + +int is_transform_type_valid(enum ADIOS_TRANSFORM_TYPE transform_type); + +#endif /* ADIOS_TRANSFORMS_HOOKS_H_ */ diff --git a/tests/libs/adios/src/core/transforms/adios_transforms_hooks_read.c b/tests/libs/adios/src/core/transforms/adios_transforms_hooks_read.c new file mode 100644 index 0000000000..bb557ee4cf --- /dev/null +++ b/tests/libs/adios/src/core/transforms/adios_transforms_hooks_read.c @@ -0,0 +1,94 @@ +/* + * adios_transforms_hooks_read.c + * + * Created on: Jul 24, 2012 + * Author: David A. Boyuka II + */ + +#include +#include +#include +#include "util.h" +#include "core/transforms/adios_transforms_hooks_read.h" +#include "core/transforms/adios_transforms_reqgroup.h" +#include "core/adios_subvolume.h" + +/* +DECLARE_TRANSFORM_READ_METHOD_UNIMPL(none); +DECLARE_TRANSFORM_READ_METHOD(identity); +DECLARE_TRANSFORM_READ_METHOD(zlib); +DECLARE_TRANSFORM_READ_METHOD(bzip2); +DECLARE_TRANSFORM_READ_METHOD(szip); +DECLARE_TRANSFORM_READ_METHOD(isobar); +DECLARE_TRANSFORM_READ_METHOD(aplod); +DECLARE_TRANSFORM_READ_METHOD(alacrity); +*/ + +// PLUGIN DETECT - Generate read-side function declarations for all plugins +#include "core/transforms/plugindetect/detect_plugin_read_hook_decls.h" + +// Transform read method registry +adios_transform_read_method TRANSFORM_READ_METHODS[num_adios_transform_types]; + +void adios_transform_read_init() { + static int adios_transforms_initialized = 0; + if (adios_transforms_initialized) + return; + + /* + REGISTER_TRANSFORM_READ_METHOD_HOOKS(TRANSFORM_READ_METHODS, none, adios_transform_none); + REGISTER_TRANSFORM_READ_METHOD_HOOKS(TRANSFORM_READ_METHODS, identity, adios_transform_identity); + REGISTER_TRANSFORM_READ_METHOD_HOOKS(TRANSFORM_READ_METHODS, zlib, adios_transform_zlib); + REGISTER_TRANSFORM_READ_METHOD_HOOKS(TRANSFORM_READ_METHODS, bzip2, adios_transform_bzip2); + REGISTER_TRANSFORM_READ_METHOD_HOOKS(TRANSFORM_READ_METHODS, szip, adios_transform_szip); + REGISTER_TRANSFORM_READ_METHOD_HOOKS(TRANSFORM_READ_METHODS, isobar, adios_transform_isobar); + REGISTER_TRANSFORM_READ_METHOD_HOOKS(TRANSFORM_READ_METHODS, aplod, adios_transform_aplod); + REGISTER_TRANSFORM_READ_METHOD_HOOKS(TRANSFORM_READ_METHODS, alacrity, adios_transform_alacrity); + */ + + // PLUGIN DETECT - Register read-side functions from all plugins in the table + // NOTE: Input macro "TRANSFORM_READ_METHODS" specifies the table to register into, but this + // is already the name of our table, so no further action is needed + #include "core/transforms/plugindetect/detect_plugin_read_hook_reg.h" + + adios_transforms_initialized = 1; +} + +/* return 0 if the method is not implemented (functions generated with DECLARE_TRANSFORM_READ_METHOD_UNIMPL, or 1 if the method is implemented */ +int adios_transform_is_implemented (enum ADIOS_TRANSFORM_TYPE transform_type) +{ + assert(is_transform_type_valid(transform_type)); + if (transform_type == adios_transform_none) + return 1; // method "none" is implemented + return TRANSFORM_READ_METHODS[transform_type].transform_is_implemented(); +} + +adios_datablock * adios_transform_subrequest_completed(adios_transform_read_request *reqgroup, + adios_transform_pg_read_request *pg_reqgroup, + adios_transform_raw_read_request *completed_subreq) { + enum ADIOS_TRANSFORM_TYPE transform_type = reqgroup->transinfo->transform_type; + assert(is_transform_type_valid(transform_type)); + return TRANSFORM_READ_METHODS[transform_type].transform_subrequest_completed(reqgroup, pg_reqgroup, completed_subreq); +} + +adios_datablock * adios_transform_pg_reqgroup_completed(adios_transform_read_request *reqgroup, + adios_transform_pg_read_request *completed_pg_reqgroup) { + + enum ADIOS_TRANSFORM_TYPE transform_type = reqgroup->transinfo->transform_type; + assert(is_transform_type_valid(transform_type)); + return TRANSFORM_READ_METHODS[transform_type].transform_pg_reqgroup_completed(reqgroup, completed_pg_reqgroup); +} + +adios_datablock * adios_transform_read_reqgroup_completed(adios_transform_read_request *completed_reqgroup) { + enum ADIOS_TRANSFORM_TYPE transform_type = completed_reqgroup->transinfo->transform_type; + assert(is_transform_type_valid(transform_type)); + return TRANSFORM_READ_METHODS[transform_type].transform_reqgroup_completed(completed_reqgroup); +} + +int adios_transform_generate_read_subrequests(adios_transform_read_request *reqgroup, adios_transform_pg_read_request *pg_reqgroup) { + enum ADIOS_TRANSFORM_TYPE transform_type = reqgroup->transinfo->transform_type; + assert(is_transform_type_valid(transform_type)); + return TRANSFORM_READ_METHODS[transform_type].transform_generate_read_subrequests(reqgroup, pg_reqgroup); +} + + diff --git a/tests/libs/adios/src/core/transforms/adios_transforms_hooks_read.h b/tests/libs/adios/src/core/transforms/adios_transforms_hooks_read.h new file mode 100644 index 0000000000..a4b3eecc2d --- /dev/null +++ b/tests/libs/adios/src/core/transforms/adios_transforms_hooks_read.h @@ -0,0 +1,134 @@ +/* + * adios_transforms_hooks_read.h + * + * Created on: Jul 25, 2012 + * Author: David A. Boyuka II + */ + +#ifndef ADIOS_TRANSFORMS_HOOKS_READ_H_ +#define ADIOS_TRANSFORMS_HOOKS_READ_H_ + +#include +#include "core/adios_bp_v1.h" +#include "core/adios_subvolume.h" +#include "public/adios_read_v2.h" +#include "public/adios_selection.h" +#include "public/adios_error.h" + +#include "core/transforms/adios_transforms_common.h" +#include "core/transforms/adios_transforms_read.h" +#include "core/transforms/adios_transforms_reqgroup.h" +#include "core/transforms/adios_transforms_datablock.h" +#include "core/transforms/adios_transforms_transinfo.h" + +// Initialize the transform system for adios read-only libraries +void adios_transform_read_init(); + +int adios_transform_generate_read_subrequests(adios_transform_read_request *reqgroup, adios_transform_pg_read_request *pg_reqgroup); + +adios_datablock * adios_transform_subrequest_completed(adios_transform_read_request *reqgroup, + adios_transform_pg_read_request *pg_reqgroup, + adios_transform_raw_read_request *completed_subreq); + +adios_datablock * adios_transform_pg_reqgroup_completed(adios_transform_read_request *reqgroup, + adios_transform_pg_read_request *completed_pg_reqgroup); + +adios_datablock * adios_transform_read_reqgroup_completed(adios_transform_read_request *completed_reqgroup); + +//////////////////////////////////////////////// +// Transform read method registry/registration +//////////////////////////////////////////////// + +// Transform read method registry entry +typedef struct { + int (*transform_is_implemented) (void); + + int (*transform_generate_read_subrequests)( + adios_transform_read_request *reqgroup, + adios_transform_pg_read_request *pg_reqgroup); + + adios_datablock * (*transform_subrequest_completed)( + adios_transform_read_request *reqgroup, + adios_transform_pg_read_request *pg_reqgroup, + adios_transform_raw_read_request *completed_subreq); + + adios_datablock * (*transform_pg_reqgroup_completed)( + adios_transform_read_request *reqgroup, + adios_transform_pg_read_request *completed_pg_reqgroup); + + adios_datablock * (*transform_reqgroup_completed)( + adios_transform_read_request *completed_reqgroup); +} adios_transform_read_method; + +// +// Every transform plugin has a set of functions that must go through three stages: +// * Declaration: as with a C header +// * Definition: the functions must be defined with bodies (or defined as +// unimplemented using the DECLARE_TRANSFORM_READ_METHOD_UNIMPL utility macro) +// * Registration: loading pointers to the functions into a callback table +// + +// Transform method function declarations +#define DECLARE_TRANSFORM_READ_METHOD(tmethod) \ + int adios_transform_##tmethod##_is_implemented (void); \ + int adios_transform_##tmethod##_generate_read_subrequests( \ + adios_transform_read_request *reqgroup, \ + adios_transform_pg_read_request *pg_reqgroup); \ + adios_datablock * adios_transform_##tmethod##_subrequest_completed( \ + adios_transform_read_request *reqgroup, \ + adios_transform_pg_read_request *pg_reqgroup, \ + adios_transform_raw_read_request *completed_subreq); \ + adios_datablock * adios_transform_##tmethod##_pg_reqgroup_completed( \ + adios_transform_read_request *reqgroup, \ + adios_transform_pg_read_request *completed_pg_reqgroup); \ + adios_datablock * adios_transform_##tmethod##_reqgroup_completed( \ + adios_transform_read_request *completed_reqgroup); + +// Transform method function registration +#define TRANSFORM_READ_METHOD_HOOK_LIST(tmethod) \ + adios_transform_##tmethod##_is_implemented, \ + adios_transform_##tmethod##_generate_read_subrequests, \ + adios_transform_##tmethod##_subrequest_completed, \ + adios_transform_##tmethod##_pg_reqgroup_completed, \ + adios_transform_##tmethod##_reqgroup_completed \ + +#define REGISTER_TRANSFORM_READ_METHOD_HOOKS(ttable, tmethod, method_type) \ + ttable[method_type] = (adios_transform_read_method){ TRANSFORM_READ_METHOD_HOOK_LIST(tmethod) }; + +// Transform method function helper definitions for unimplemented methods +#define UNIMPL_TRANSFORM_READ_FN(tmethod, func) \ + adios_error(err_operation_not_supported, \ + "Transform method %s is not supported for read in this " \ + "configuration of ADIOS (function missing: %s)\n", \ + #tmethod, func); + +#define DECLARE_TRANSFORM_READ_METHOD_UNIMPL(tmethod) \ + int adios_transform_##tmethod##_is_implemented (void) { \ + return 0; \ + } \ + int adios_transform_##tmethod##_generate_read_subrequests( \ + adios_transform_read_request *reqgroup, \ + adios_transform_pg_read_request *pg_reqgroup) { \ + UNIMPL_TRANSFORM_READ_FN(tmethod, __FUNCTION__); \ + return adios_errno; \ + } \ + adios_datablock * adios_transform_##tmethod##_subrequest_completed( \ + adios_transform_read_request *reqgroup, \ + adios_transform_pg_read_request *pg_reqgroup, \ + adios_transform_raw_read_request *completed_subreq) { \ + UNIMPL_TRANSFORM_READ_FN(tmethod, __FUNCTION__); \ + return NULL; \ + } \ + adios_datablock * adios_transform_##tmethod##_pg_reqgroup_completed( \ + adios_transform_read_request *reqgroup, \ + adios_transform_pg_read_request *completed_pg_reqgroup) { \ + UNIMPL_TRANSFORM_READ_FN(tmethod, __FUNCTION__); \ + return NULL; \ + } \ + adios_datablock * adios_transform_##tmethod##_reqgroup_completed( \ + adios_transform_read_request *completed_reqgroup) { \ + UNIMPL_TRANSFORM_READ_FN(tmethod, __FUNCTION__); \ + return NULL; \ + } + +#endif /* ADIOS_TRANSFORMS_HOOKS_READ_H_ */ diff --git a/tests/libs/adios/src/core/transforms/adios_transforms_hooks_write.c b/tests/libs/adios/src/core/transforms/adios_transforms_hooks_write.c new file mode 100644 index 0000000000..4c7910c2a8 --- /dev/null +++ b/tests/libs/adios/src/core/transforms/adios_transforms_hooks_write.c @@ -0,0 +1,75 @@ + +#include +#include + +#include "core/adios_logger.h" +#include "core/adios_internals.h" +#include "core/transforms/adios_transforms_common.h" +#include "core/transforms/adios_transforms_write.h" +#include "core/transforms/adios_transforms_hooks_write.h" +#include "adios_selection.h" + +/* +DECLARE_TRANSFORM_WRITE_METHOD_UNIMPL(none); +DECLARE_TRANSFORM_WRITE_METHOD(identity); +DECLARE_TRANSFORM_WRITE_METHOD(zlib); +DECLARE_TRANSFORM_WRITE_METHOD(bzip2); +DECLARE_TRANSFORM_WRITE_METHOD(szip); +DECLARE_TRANSFORM_WRITE_METHOD(isobar); +DECLARE_TRANSFORM_WRITE_METHOD(aplod); +DECLARE_TRANSFORM_WRITE_METHOD(alacrity); +*/ + +// PLUGIN DETECT - Generate write-side function declarations for all plugins +#include "core/transforms/plugindetect/detect_plugin_write_hook_decls.h" + +// Transform write method registry +adios_transform_write_method TRANSFORM_WRITE_METHODS[num_adios_transform_types]; + +void adios_transform_init() { + static int adios_transforms_initialized = 0; + if (adios_transforms_initialized) + return; + + /* + REGISTER_TRANSFORM_WRITE_METHOD(none, adios_transform_none); + REGISTER_TRANSFORM_WRITE_METHOD(identity, adios_transform_identity); + REGISTER_TRANSFORM_WRITE_METHOD(zlib, adios_transform_zlib); + REGISTER_TRANSFORM_WRITE_METHOD(bzip2, adios_transform_bzip2); + REGISTER_TRANSFORM_WRITE_METHOD(szip, adios_transform_szip); + REGISTER_TRANSFORM_WRITE_METHOD(isobar, adios_transform_isobar); + REGISTER_TRANSFORM_WRITE_METHOD(aplod, adios_transform_aplod); + REGISTER_TRANSFORM_WRITE_METHOD(alacrity, adios_transform_alacrity); + */ + + // PLUGIN DETECT - Register write-side functions from all plugins in the table + // NOTE: Input macro "TRANSFORM_WRITE_METHODS" specifies the table to register into, but this + // is already the name of our table, so no further action is needed + #include "core/transforms/plugindetect/detect_plugin_write_hook_reg.h" + + adios_transforms_initialized = 1; +} + +// Delegate functions + +uint16_t adios_transform_get_metadata_size(struct adios_transform_spec *transform_spec) { + if (!transform_spec) return 0; + assert(transform_spec->transform_type >= adios_transform_none && transform_spec->transform_type < num_adios_transform_types); + return TRANSFORM_WRITE_METHODS[transform_spec->transform_type].transform_get_metadata_size(transform_spec); +} + +void adios_transform_transformed_size_growth( + const struct adios_var_struct *var, const struct adios_transform_spec *transform_spec, + uint64_t *constant_factor, double *linear_factor, double *capped_linear_factor, uint64_t *capped_linear_cap) { + + assert(var->transform_type >= adios_transform_none && var->transform_type < num_adios_transform_types); + TRANSFORM_WRITE_METHODS[var->transform_type].transform_transformed_size_growth(var, transform_spec, constant_factor, linear_factor, capped_linear_factor, capped_linear_cap); +} + +int adios_transform_apply( + struct adios_file_struct *fd, struct adios_var_struct *var, + uint64_t *transformed_len, int use_shared_buffer, int *wrote_to_shared_buffer) { + + assert(var->transform_type >= adios_transform_none && var->transform_type < num_adios_transform_types); + return TRANSFORM_WRITE_METHODS[var->transform_type].transform_apply(fd, var, transformed_len, use_shared_buffer, wrote_to_shared_buffer); +} diff --git a/tests/libs/adios/src/core/transforms/adios_transforms_hooks_write.h b/tests/libs/adios/src/core/transforms/adios_transforms_hooks_write.h new file mode 100644 index 0000000000..9606138017 --- /dev/null +++ b/tests/libs/adios/src/core/transforms/adios_transforms_hooks_write.h @@ -0,0 +1,132 @@ +/* + * adios_transforms_hooks_write.h + * + * Created on: Jul 25, 2012 + * Author: David A. Boyuka II + */ + +#ifndef ADIOS_TRANSFORMS_HOOKS_WRITE_H_ +#define ADIOS_TRANSFORMS_HOOKS_WRITE_H_ + +#include +#include "core/adios_bp_v1.h" +#include "core/adios_internals.h" +#include "core/transforms/adios_transforms_common.h" +#include "public/adios_error.h" + +// Initialize the transform system for adios read/write libraries +void adios_transform_init(); + +// Delegation functions +uint16_t adios_transform_get_metadata_size(struct adios_transform_spec *transform_spec); +void adios_transform_transformed_size_growth( + const struct adios_var_struct *var, const struct adios_transform_spec *transform_spec, + uint64_t *constant_factor, double *linear_factor, double *capped_linear_factor, uint64_t *capped_linear_cap); +int adios_transform_apply( + struct adios_file_struct *fd, struct adios_var_struct *var, + uint64_t *transformed_len, int use_shared_buffer, int *wrote_to_shared_buffer); + +///////////////////////////////////////////////// +// Transform write method registry/registration +///////////////////////////////////////////////// + +// Transform write method registry entry +typedef struct { + // Expected behavior: returns the number of bytes of metadata storage a given transformed variable will need + // Note: "metadata storage" is located in the BP footer, and is loaded at file-open time by all processes; + // as such, it should be strictly limited to what is necessary to interpret the remaining transformed + // data in one pass. This is why the size is (currently) limited to a uint16_t. + uint16_t (*transform_get_metadata_size)(struct adios_transform_spec *transform_spec); + + // Expected behavior: returns the upper bound "growth factors" that this data transformation could effect + // on a given variable. These factors are combined to compute the upper bound on a PG's size *before the data + // to be written is known* + // There are 3 factors returned: + // > constant_factor: regardless of what data is stored in this variable, this transform will always require + // up to "constant_factor" bytes extra storage above and beyond the data (for, e.g., offsets, metadata, etc.) + // > linear_factor: if X bytes of data are stored in this variable, this transform may require up to + // "linear_factor * X" bytes of storage. + // > capped_linear_factor: if X bytes of data are stored in this variable: + // if X < capped_linear_cap: this transform may require up to "capped_linear_factor * X" extra bytes of + // storage (this is on top of linear_factor and constant_factor) + // else: this transform may require up to "capped_linear_factor * capped_linear_cap" extra bytes of + // storage (this is on top of linear_factor and constant_factor) + // + // The final upper bound estimation function is as follows: + // X' = total_constant_factor + X * max_linear_factor + min(X, max_capped_linear_cap) * max_capped_linear_factor + // + // Note: any or all of these factors may remain unset. In this case, constant_factor, capped_linear_factor, and + // capped_linear_cap all default to 0, and linear_factor defaults to 1. + void (*transform_transformed_size_growth)( + const struct adios_var_struct *var, const struct adios_transform_spec *transform_spec, + uint64_t *constant_factor, double *linear_factor, double *capped_linear_factor, uint64_t *capped_linear_cap); + + // Expected behavior: applies this data transform to the given variable. The data to be transformed is stored in + // var->data. If use_shared_buffer is non-zero, the transform may write the transformed data directly to the ADIOS + // shared buffer (or it may elect to use a newly-allocated buffer, as described next). If use_shared_buffer is zero, + // the transformed data must be written to a newly-allocated buffer, and var->data shall be updated to point to this + // buffer. See adios_transform_zlib_write.c for an example of both methods. In any case, the flag wrote_to_shared_buffer + // must be updated to indicate whether the transformed data was written to the shared buffer or is located in var->data. + int (*transform_apply)( + struct adios_file_struct *fd, struct adios_var_struct *var, + uint64_t *transformed_len, int use_shared_buffer, int *wrote_to_shared_buffer); +} adios_transform_write_method; + +// +// Every transform plugin has a set of functions that must go through three stages: +// * Declaration: as with a C header +// * Definition: the functions must be defined with bodies (or defined as +// unimplemented using the DECLARE_TRANSFORM_WRITE_METHOD_UNIMPL utility macro) +// * Registration: loading pointers to the functions into a callback table +// + +// Transform method function declarations +#define DECLARE_TRANSFORM_WRITE_METHOD(tmethod) \ + uint16_t adios_transform_##tmethod##_get_metadata_size(struct adios_transform_spec *transform_spec); \ + void adios_transform_##tmethod##_transformed_size_growth(const struct adios_var_struct *var, \ + const struct adios_transform_spec *transform_spec, \ + uint64_t *constant_factor, \ + double *linear_factor, \ + double *capped_linear_factor, \ + uint64_t *capped_linear_cap); \ + int adios_transform_##tmethod##_apply(struct adios_file_struct *fd, struct adios_var_struct *var, \ + uint64_t *transformed_len, \ + int use_shared_buffer, int *wrote_to_shared_buffer); + +// Transform method function registration +#define TRANSFORM_WRITE_METHOD_HOOK_LIST(tmethod) \ + adios_transform_##tmethod##_get_metadata_size, \ + adios_transform_##tmethod##_transformed_size_growth, \ + adios_transform_##tmethod##_apply + +#define REGISTER_TRANSFORM_WRITE_METHOD_HOOKS(ttable, tmethod, method_type) \ + ttable[method_type] = (adios_transform_write_method){ TRANSFORM_WRITE_METHOD_HOOK_LIST(tmethod) }; + +// Transform method function helper definitions for unimplemented methods +#define UNIMPL_TRANSFORM_WRITE_FN(tmethod, func) \ + adios_error(err_operation_not_supported, \ + "Transform method %s is not supported for write in this " \ + "configuration of ADIOS (function missing: %s)\n", \ + #tmethod, func); + +// Note: this is actually a "definition" in the language-semantic sense, but this detail is +// irrelevant to users, so we name it similarly to DECLARE_TRANSFORM_WRITE_METHOD +#define DECLARE_TRANSFORM_WRITE_METHOD_UNIMPL(tmethod) \ + uint16_t adios_transform_##tmethod##_get_metadata_size(struct adios_transform_spec *transform_spec) { \ + UNIMPL_TRANSFORM_WRITE_FN(tmethod, __FUNCTION__); \ + return 0; \ + } \ + void adios_transform_##tmethod##_transformed_size_growth( \ + const struct adios_var_struct *var, const struct adios_transform_spec *transform_spec, \ + uint64_t *constant_factor, double *linear_factor, double *capped_linear_factor, uint64_t *capped_linear_cap) { \ + UNIMPL_TRANSFORM_WRITE_FN(tmethod, __FUNCTION__); \ + } \ + int adios_transform_##tmethod##_apply(struct adios_file_struct *fd, \ + struct adios_var_struct *var, \ + uint64_t *transformed_len, \ + int use_shared_buffer, int *wrote_to_shared_buffer) { \ + UNIMPL_TRANSFORM_WRITE_FN(tmethod, __FUNCTION__); \ + return 0; \ + } + +#endif /* ADIOS_TRANSFORMS_HOOKS_WRITE_H_ */ diff --git a/tests/libs/adios/src/core/transforms/adios_transforms_read.c b/tests/libs/adios/src/core/transforms/adios_transforms_read.c new file mode 100644 index 0000000000..38eb4b9bc0 --- /dev/null +++ b/tests/libs/adios/src/core/transforms/adios_transforms_read.c @@ -0,0 +1,922 @@ +#include +#include + +#include "core/adios_bp_v1.h" +#include "core/adios_internals.h" +#include "core/common_read.h" +#include "adios_selection.h" +#include "adios_error.h" +#include "adios_types.h" +#include "adios_read_v2.h" +#include "adios_read_ext.h" +#include "core/adios_logger.h" +#include "core/util.h" + +#include "core/adios_selection_util.h" + +#include "core/transforms/adios_transforms_reqgroup.h" +#include "core/transforms/adios_transforms_common.h" +#include "core/transforms/adios_transforms_datablock.h" +#include "core/transforms/adios_transforms_hooks_read.h" +#include "core/transforms/adios_transforms_read.h" +#include "core/transforms/adios_transforms_util.h" +#include "core/transforms/adios_patchdata.h" + +// Utilities +#define FREE(p) {if (p){free(p); (p)=NULL;}} + +// Read request inspection +enum ADIOS_TRANSFORM_REQGROUP_RESULT_MODE adios_transform_read_request_get_mode(const adios_transform_read_request *req) { + return req->orig_data != NULL ? FULL_RESULT_MODE : PARTIAL_RESULT_MODE; +} + +// BLOCKINFO inspection +uint64_t adios_transform_get_transformed_var_size_from_blockinfo(int raw_ndim, const ADIOS_VARBLOCK *raw_block) { + assert(raw_ndim == 1); // Any time dimension should have been stripped from BLOCKINFO + + // Since we swtiched to 1D local byte arrays, the first (and only) dimension contains what we want + return raw_block->count[0]; +} + +// +// Read request management (rest of the file) +// + +static uint64_t compute_selection_size_in_bytes(const ADIOS_SELECTION *sel, + enum ADIOS_DATATYPES datum_type, + int timestep, + const ADIOS_VARINFO *raw_varinfo, + const ADIOS_TRANSINFO *transinfo) { + int typesize = adios_get_type_size(datum_type, NULL); + int i; + switch (sel->type) { + case ADIOS_SELECTION_BOUNDINGBOX: + { + const ADIOS_SELECTION_BOUNDINGBOX_STRUCT *bb = &sel->u.bb; + const int ndim = bb->ndim; + + uint64_t size = typesize; + for (i = 0; i < ndim; i++) + size *= bb->count[i]; + + return size; + } + case ADIOS_SELECTION_POINTS: + { + const ADIOS_SELECTION_POINTS_STRUCT *pts = &sel->u.points; + return pts->ndim * pts->npoints * typesize; + } + case ADIOS_SELECTION_WRITEBLOCK: + { + const ADIOS_SELECTION_WRITEBLOCK_STRUCT *wb = &sel->u.block; + + if (wb->is_sub_pg_selection) { + return wb->nelements * typesize; + } else { + const ADIOS_VARBLOCK *theblock; + uint64_t size = typesize; + int absolute_idx; + + if (wb->is_absolute_index) { + absolute_idx = wb->index; + } else { + int timestep_start_idx = 0; + for (i = 0; i < timestep; i++) + timestep_start_idx += raw_varinfo->nblocks[i]; + + absolute_idx = timestep_start_idx + wb->index; + } + + theblock = &transinfo->orig_blockinfo[absolute_idx]; + for (i = 0; i < transinfo->orig_ndim; i++) + size *= theblock->count[i]; + + return size; + } + } + case ADIOS_SELECTION_AUTO: + default: + adios_error_at_line(err_invalid_argument, __FILE__, __LINE__, "Unsupported selection type %d in data transform read layer", sel->type); + return 0; + } +} + +/* + * Determines the block indices corresponding to a start and end timestep. + * Both the input start/end timesteps and the output start/end blockidx are lower bound inclusive, upper bound exclusive: [start, end) + */ +static void compute_blockidx_range(const ADIOS_VARINFO *raw_varinfo, int from_steps, int to_steps, int *start_blockidx, int *end_blockidx) { + int timestep; + + // Find the block index for the start and end timestep + int curblocks = 0; + for (timestep = 0; timestep < raw_varinfo->nsteps; timestep++) { + // Find the start block + if (timestep == from_steps) { + *start_blockidx = curblocks; + } + curblocks += raw_varinfo->nblocks[timestep]; + // Find the end block, then stop + if (timestep == to_steps - 1) { + *end_blockidx = curblocks; + break; + } + } +} + +// Converts absolute varblock indexes to timestep-relative varblock indexes +static int compute_absolute_blockidx_from_relative_blockidx(const ADIOS_VARINFO *raw_varinfo, int timestep, int timestep_blockidx, int *blockidx_out) { + if (timestep < 0 || timestep >= raw_varinfo->nsteps) { + return 0; + } + if (timestep_blockidx >= raw_varinfo->nblocks[timestep]) { + return 0; + } + + // Find the block index for the start and end timestep + int ts; + int curblocks = 0; + for (ts = 0; ts < timestep; ts++) + curblocks += raw_varinfo->nblocks[ts]; + + *blockidx_out = curblocks + timestep_blockidx; + return 1; +} + +// Converts rimestep-relative varblock indexes to absolute varblock indexes +static int compute_relative_blockidx_from_absolute_blockidx(const ADIOS_VARINFO *raw_varinfo, int blockidx, int *timestep_out, int *timestep_blockidx_out) { + // Find the block index for the start and end timestep + int timestep; + int curblocks = 0, next_curblocks; + for (timestep = 0; timestep < raw_varinfo->nsteps; timestep++) { + next_curblocks = curblocks + raw_varinfo->nblocks[timestep]; + + if (blockidx < next_curblocks) { + *timestep_out = timestep; + *timestep_blockidx_out = blockidx - curblocks; + return 1; + } + + curblocks = next_curblocks; + } + return 0; +} + +inline static int is_global_selection(const ADIOS_SELECTION *sel) { + return sel->type != ADIOS_SELECTION_WRITEBLOCK; +} + +// Creates a bounding box from a given ADIOS_VARBLOCK +inline static const ADIOS_SELECTION * create_pg_bounds_from_varblock(int ndim, const ADIOS_VARBLOCK *orig_vb) { + // Commented out for performance + //const uint64_t *new_start = (uint64_t*)bufdup(orig_vb->start, sizeof(uint64_t), ndim); + //const uint64_t *new_count = (uint64_t*)bufdup(orig_vb->count, sizeof(uint64_t), ndim); + + //return common_read_selection_boundingbox(ndim, new_start, new_count); + return common_read_selection_boundingbox(ndim, orig_vb->start, orig_vb->count); +} + +// Creates a bounding box for a the varblock specified by a given writeblock +// selection (which may be absolute or timestep-relative) +inline static const ADIOS_SELECTION * create_writeblock_bounds(const ADIOS_SELECTION_WRITEBLOCK_STRUCT *wb, int timestep, const ADIOS_VARINFO *raw_varinfo, const ADIOS_TRANSINFO *transinfo) { + int blockidx; + if (wb->is_absolute_index) { + blockidx = wb->index; + } else { + compute_absolute_blockidx_from_relative_blockidx(raw_varinfo, timestep, wb->index, &blockidx); + } + + // Get the bounds of the varblock corresponding to the given writeblock + const ADIOS_VARBLOCK *vb_bounds = &transinfo->orig_blockinfo[blockidx]; + return create_pg_bounds_from_varblock(transinfo->orig_ndim, vb_bounds); +} + +static int generate_read_request_for_pg( + const ADIOS_VARINFO *raw_varinfo, const ADIOS_TRANSINFO *transinfo, + const ADIOS_SELECTION *sel, + int timestep, int timestep_blockidx, int blockidx, + adios_transform_read_request *readreq) +{ + const ADIOS_SELECTION *pg_bounds_sel; + ADIOS_SELECTION *pg_intersection_sel; + ADIOS_SELECTION *pg_writeblock_sel; + + const ADIOS_VARBLOCK *raw_vb = &raw_varinfo->blockinfo[blockidx]; + const ADIOS_VARBLOCK *orig_vb = &transinfo->orig_blockinfo[blockidx]; + + pg_bounds_sel = create_pg_bounds_from_varblock(transinfo->orig_ndim, orig_vb); + pg_writeblock_sel = common_read_selection_writeblock(blockidx); + pg_writeblock_sel->u.block.is_absolute_index = 1; + + // Find the intersection, if any + if (is_global_selection(sel)) { + pg_intersection_sel = adios_selection_intersect_global(pg_bounds_sel, sel); + } else if (sel->type == ADIOS_SELECTION_WRITEBLOCK) { + pg_intersection_sel = adios_selection_intersect_local(pg_writeblock_sel, sel, timestep, raw_varinfo, transinfo); + } else { + abort(); // Should never be called with other types of selections + } + + // If there is an intersection, generate a corresponding PG read request + if (pg_intersection_sel) { + // Make a PG read request group, and fill it with some subrequests, and link it into the read reqgroup + adios_transform_pg_read_request *new_pg_readreq; + new_pg_readreq = adios_transform_pg_read_request_new(timestep, timestep_blockidx, blockidx, + transinfo->orig_ndim, raw_varinfo->ndim, + orig_vb, raw_vb, + pg_intersection_sel, pg_bounds_sel, + transinfo->transform_metadatas[blockidx].content, + (uint16_t)transinfo->transform_metadatas[blockidx].length); + + adios_transform_generate_read_subrequests(readreq, new_pg_readreq); + adios_transform_pg_read_request_append(readreq, new_pg_readreq); + + // Don't free pg_bounds_sel or pg_intersection_sel, since they are now + // held by the adios_transform_pg_read_request struct + return 1; + } else { + // Cleanup + common_read_selection_delete((ADIOS_SELECTION *)pg_bounds_sel); // OK to delete, because this function only frees the outer struct, not the arrays within + return 0; + } +} + +static void populate_read_request_for_global_selection( + const ADIOS_VARINFO *raw_varinfo, const ADIOS_TRANSINFO *transinfo, + const ADIOS_SELECTION *sel, int from_steps, int nsteps, + adios_transform_read_request *readreq) +{ + int blockidx, timestep, timestep_blockidx; + int start_blockidx, end_blockidx; + int to_steps = from_steps + nsteps; + + // Compute the blockidx range, given the timesteps + compute_blockidx_range(raw_varinfo, from_steps, to_steps, &start_blockidx, &end_blockidx); + + // Assemble read requests for each varblock + blockidx = start_blockidx; + timestep = from_steps; + timestep_blockidx = 0; + while (blockidx != end_blockidx) { //for (blockidx = startblock_idx; blockidx != endblock_idx; blockidx++) { + generate_read_request_for_pg(raw_varinfo, transinfo, sel, timestep, timestep_blockidx, blockidx, readreq); + + // Increment block indexes + blockidx++; + timestep_blockidx++; + if (timestep_blockidx == raw_varinfo->nblocks[timestep]) { + timestep_blockidx = 0; + timestep++; + } + } +} + +// Note: from_steps and nsteps are ignored in the absolute writeblock case +static void populate_read_request_for_local_selection( + const ADIOS_VARINFO *raw_varinfo, const ADIOS_TRANSINFO *transinfo, + const ADIOS_SELECTION *sel, int from_steps, int nsteps, + adios_transform_read_request *readreq) +{ + int timestep, timestep_blockidx, blockidx; + if (sel->type == ADIOS_SELECTION_WRITEBLOCK) { + const ADIOS_SELECTION_WRITEBLOCK_STRUCT *wb = &sel->u.block; + + if (wb->is_absolute_index) { + // For an absolute writeblock, at most one PG is touched (0 if erroneous blockidx) + blockidx = wb->index; + + // Convert blockidx to timestep and timestep_blockidx + int valid_blockidx = compute_relative_blockidx_from_absolute_blockidx(raw_varinfo, blockidx, ×tep, ×tep_blockidx); + if (valid_blockidx) { + generate_read_request_for_pg(raw_varinfo, transinfo, sel, timestep, timestep_blockidx, blockidx, readreq); + } else { + adios_error(err_invalid_timestep, "Writeblock selection with invalid absolute index %d passed to adios_schedule_read, caught in ADIOS transforms layer", + wb->index); + } + } else { + // For a relative writeblock, one PG may be touched per timestep in the user's timestep range + timestep_blockidx = wb->index; + for (timestep = from_steps; timestep < from_steps + nsteps; timestep++) { + // Convert timestep (loop iterator variable) and timestep_blockidx to blockidx + int valid_blockidx = compute_absolute_blockidx_from_relative_blockidx(raw_varinfo, timestep, timestep_blockidx, &blockidx); + if (valid_blockidx) { + generate_read_request_for_pg(raw_varinfo, transinfo, sel, timestep, timestep_blockidx, blockidx, readreq); + } else { + adios_error(err_invalid_timestep, "Writeblock selection with index %d passed to adios_schedule_read is invalid in timestep %d, caught in ADIOS transforms layer", + wb->index, timestep); + } + } + } + } else { + adios_error_at_line(err_operation_not_supported, __FILE__, __LINE__, "Internal error: unsupported selection type %d in populate_read_request_for_local_selection", sel->type); + } +} + +adios_transform_read_request * adios_transform_generate_read_reqgroup(const ADIOS_VARINFO *raw_varinfo, const ADIOS_TRANSINFO* transinfo, const ADIOS_FILE *fp, + const ADIOS_SELECTION *sel, int from_steps, int nsteps, const char *param, void *data) { + // Declares + adios_transform_read_request *new_readreq; + int blockidx, timestep, timestep_blockidx; + int start_blockidx, end_blockidx; + + enum ADIOS_FLAG swap_endianness = (fp->endianness == get_system_endianness()) ? adios_flag_no : adios_flag_yes; + + // In streaming mode, ignore the user's from_steps/nsteps arguments + if (fp->is_streaming) { + from_steps = 0; + nsteps = 1; + } + + // Precondition checking + assert(is_transform_type_valid(transinfo->transform_type)); + assert(from_steps >= 0 && from_steps + nsteps <= raw_varinfo->nsteps); + + if (sel->type != ADIOS_SELECTION_BOUNDINGBOX && + sel->type != ADIOS_SELECTION_POINTS && + sel->type != ADIOS_SELECTION_WRITEBLOCK) { + adios_error(err_operation_not_supported, "Only bounding box, point , and writeblock selections are currently supported for reads on transformed variables."); + } + + // Retrieve blockinfos, if they haven't been done retrieved + if (!raw_varinfo->blockinfo) + common_read_inq_var_blockinfo_raw(fp, (ADIOS_VARINFO*)raw_varinfo); + if (!transinfo->orig_blockinfo) + common_read_inq_trans_blockinfo(fp, raw_varinfo, (ADIOS_TRANSINFO*)transinfo); + + // Allocate a new, empty request group + new_readreq = adios_transform_read_request_new(fp, raw_varinfo, transinfo, sel, from_steps, nsteps, param, data, swap_endianness); + + if (is_global_selection(sel)) { + populate_read_request_for_global_selection(raw_varinfo, transinfo, sel, from_steps, nsteps, new_readreq); + } else { + populate_read_request_for_local_selection(raw_varinfo, transinfo, sel, from_steps, nsteps, new_readreq); + } + + // If this read request does not intersect any PGs, then clear the new read request and return NULL + if (new_readreq->num_pg_reqgroups == 0) { + adios_transform_read_request_free(&new_readreq); + new_readreq = NULL; + } + + return new_readreq; +} + +/* + * Called whenever a raw read request has been served by the read layer. Marks + * all raw_read_requests, pg_read_requests and read_requests as completed as necessary, + * calls the appropriate hooks in the transform method, and returns an + * adios_datablock if the transform method produces one. + */ +static adios_datablock * finish_subreq( + adios_transform_read_request *reqgroup, + adios_transform_pg_read_request *pg_reqgroup, + adios_transform_raw_read_request *subreq) +{ + adios_datablock *result, *tmp_result; + + // Mark the subrequest as complete + assert(!subreq->completed && !pg_reqgroup->completed && !reqgroup->completed); + adios_transform_raw_read_request_mark_complete(reqgroup, pg_reqgroup, subreq); + + // Invoke all callbacks, depending on what completed, and + // get at most one ADIOS_VARCHUNK to return + result = adios_transform_subrequest_completed(reqgroup, pg_reqgroup, subreq); + + if (pg_reqgroup->completed) { + tmp_result = adios_transform_pg_reqgroup_completed(reqgroup, pg_reqgroup); + if (tmp_result) { + assert(!result); // pg_reqgroup_completed returned a result, but subrequest_completed did as well + result = tmp_result; + } + } + + if (reqgroup->completed) { + tmp_result = adios_transform_read_reqgroup_completed(reqgroup); + if (tmp_result) { + assert(!result); // read_reqgroup_completed returned a result, but subrequest_completed or pg_reqgroup_completed did as well + result = tmp_result; + } + } + + return result; +} + +static uint64_t apply_datablock_to_buffer_local_selections( + const ADIOS_VARINFO *raw_varinfo, const ADIOS_TRANSINFO *transinfo, + adios_datablock *datablock, + void **output_buffer, const ADIOS_SELECTION *output_sel, + ADIOS_SELECTION **out_inter_sel, int want_out_inter_sel, + enum ADIOS_FLAG swap_endianness) +{ + int may_have_intersection = 1; + + // For writeblock selections, we can use adios_patch_data_to_local, + // but first we must determine the bounding box of the writeblock selection + const ADIOS_SELECTION *vb_bounds_sel = create_writeblock_bounds(&output_sel->u.block, datablock->timestep, raw_varinfo, transinfo); + + // Compute the intersection explicitly if it is requested, or + // if we need to allocate a fitting output buffer + if (want_out_inter_sel || !*output_buffer) { + *out_inter_sel = adios_selection_intersect_local(datablock->bounds, output_sel, datablock->timestep, raw_varinfo, transinfo); + may_have_intersection = (*out_inter_sel ? 1 : 0); + } + + // Allocate the output buffer if needed (inter_sel is populated by previous if statement) + if (!*output_buffer) { + const uint64_t chunk_buffer_size = compute_selection_size_in_bytes(*out_inter_sel, datablock->elem_type, datablock->timestep, raw_varinfo, transinfo); + *output_buffer = malloc(chunk_buffer_size); + + // Refitting the output selection to the intersection region, since we + // just allocated a buffer for that smaller region + output_sel = *out_inter_sel; + } + + // Invoke adios_patch_data_to_local to perform the actual patching + const uint64_t used_count = + adios_patch_data_to_local( + *output_buffer, (uint64_t)0, output_sel, + datablock->data, datablock->ragged_offset, datablock->bounds, + &vb_bounds_sel->u.bb, + datablock->elem_type, swap_endianness); + + // Clean up + common_read_selection_delete((ADIOS_SELECTION *)vb_bounds_sel); + return used_count; +} + +// Note: assumes one or more of datablock->bounds or output_sel is local +static uint64_t apply_datablock_to_buffer_nonlocal_selections( + const ADIOS_VARINFO *raw_varinfo, const ADIOS_TRANSINFO *transinfo, + adios_datablock *datablock, + void **output_buffer, const ADIOS_SELECTION *output_sel, + ADIOS_SELECTION **out_inter_sel, int want_out_inter_sel, + enum ADIOS_FLAG swap_endianness) +{ + int may_have_intersection = 1; + uint64_t used_count = 0; + + const ADIOS_SELECTION *global_output_buffer_sel = output_sel; + const ADIOS_SELECTION *global_datablock_bounds = datablock->bounds; + + // Promote output buffer selection and/or datablock selection to global if needed + if (!is_global_selection(global_output_buffer_sel)) + global_output_buffer_sel = create_writeblock_bounds(&global_output_buffer_sel->u.block, datablock->timestep, raw_varinfo, transinfo); + if (!is_global_selection(global_datablock_bounds)) + global_datablock_bounds = create_writeblock_bounds(&global_datablock_bounds->u.block, datablock->timestep, raw_varinfo, transinfo); + + // Compute the intersection explicitly if it is requested, or + // if we need to allocate a fitting output buffer + if (want_out_inter_sel || !*output_buffer) { + *out_inter_sel = adios_selection_intersect_global(global_datablock_bounds, global_output_buffer_sel); + may_have_intersection = (*out_inter_sel ? 1 : 0); + } + + // We can stop immediately if it is known there is no intersection + if (may_have_intersection) { + // Allocate the output buffer if needed (inter_sel is populated by previous if statement) + if (!*output_buffer) { + const uint64_t chunk_buffer_size = compute_selection_size_in_bytes(*out_inter_sel, datablock->elem_type, datablock->timestep, raw_varinfo, transinfo); + *output_buffer = malloc(chunk_buffer_size); + + // Refitting the output selection to the intersection region, since we + // just allocated a buffer for that smaller region + if (global_output_buffer_sel != output_sel) + common_read_selection_delete((ADIOS_SELECTION *)global_output_buffer_sel); + output_sel = *out_inter_sel; + global_output_buffer_sel = *out_inter_sel; + } + + // Perform the actual data patching, now that everything is in the global space + used_count = adios_patch_data_to_global( + *output_buffer, (uint64_t)0, global_output_buffer_sel, + datablock->data, datablock->ragged_offset, global_datablock_bounds, + datablock->elem_type, swap_endianness); + } + + // Clean up + if (global_output_buffer_sel != output_sel) + common_read_selection_delete((ADIOS_SELECTION *)global_output_buffer_sel); + if (global_datablock_bounds != datablock->bounds) + common_read_selection_delete((ADIOS_SELECTION *)global_datablock_bounds); + + return used_count; +} + +/* + * Takes a datablock and applies its data to a given output buffer (described + * by a given output buffer selection), then frees the given datablock. + * + * If *output_buffer is non-NULL, copies the pertinent data from datablock->data + * into *output_buffer, assuming *output_buffer is shaped like output_sel. + * + * If *output_buffer is NULL, allocates a minimum-size buffer to contain the + * data for the *intersection* of datablock->bounds and output_sel and returns + * it via *output_buffer. + * + * If out_inter_sel != NULL, returns a selection representing the intersection + * of datablock->bounds and output_sel (i.e., the portion of data that was + * actually copied) via *out_inter_sel. Otherwise, leaves this argument untouched. + * + * This function can handle any combination of datablock bounding selection and + * output buffer bounding selection: + * - If both datablock and buffer selections are global (BB, points), performs + * a straightforward data patching based on the geometry + * - If both datablock and buffer selections are local (writeblock), performs + * a straghtforward memcpy as appropriate + * - If the buffer is global but the datablock is local, promotes the datablock + * to a bounding box using blockinfo (note: the variable is guaranteed to be + * a global array in this case because the user supplied a global selection) + * - If the buffer is local but the datablock is global, promotes the buffer + * to a bounding box using blockinfo (note: the variable may or may not be + * a global array in this case; however, even if it is not, both the datablock + * and the buffer will be constructed relative to (0,0,...,0), so it will do + * the right thing). + * + * @return the number of elements patched into the output buffer (0 indicates + * no data in the given datablock was pertinent to the given output + * buffer selection) + */ +static uint64_t apply_datablock_to_buffer_and_free( + const ADIOS_VARINFO *raw_varinfo, const ADIOS_TRANSINFO *transinfo, + adios_datablock *datablock, + void **output_buffer, const ADIOS_SELECTION *output_sel, ADIOS_SELECTION **out_inter_sel, enum ADIOS_FLAG swap_endianness) +{ + uint64_t used_count = 0; + ADIOS_SELECTION *inter_sel = NULL; + assert(raw_varinfo && transinfo && datablock && output_buffer && output_sel); + + // Check preconditions + if (datablock->bounds->type != ADIOS_SELECTION_BOUNDINGBOX && + datablock->bounds->type != ADIOS_SELECTION_POINTS && + datablock->bounds->type != ADIOS_SELECTION_WRITEBLOCK) + { + adios_error(err_operation_not_supported, + "Only results of bounding box, points, or writeblock selection types " + "are currently accepted from transform plugins (received selection type %d)\n", + datablock->bounds->type); + return 0; + } + if (output_sel->type != ADIOS_SELECTION_BOUNDINGBOX && + output_sel->type != ADIOS_SELECTION_POINTS && + output_sel->type != ADIOS_SELECTION_WRITEBLOCK) + { + adios_error_at_line(err_operation_not_supported, __FILE__, __LINE__, + "Internal error: only bounding box, points, or writeblock selection types " + "are currently supported in apply_datablock_to_buffer_and_free (received selection type %d)\n", + datablock->bounds->type); + return 0; + } + + // Invoke the appropriate helper function depending + // on whether at least one of datablock->bounds or + // output_sel is global + if (!is_global_selection(datablock->bounds) && !is_global_selection(output_sel)) { + used_count = apply_datablock_to_buffer_local_selections( + raw_varinfo, transinfo, + datablock, output_buffer, output_sel, + &inter_sel, (out_inter_sel ? 1 : 0), + swap_endianness); + } else { + used_count = apply_datablock_to_buffer_nonlocal_selections( + raw_varinfo, transinfo, + datablock, output_buffer, output_sel, + &inter_sel, (out_inter_sel ? 1 : 0), + swap_endianness); + } + + // Clean up the returned intersection if it is not wanted by the caller + if (inter_sel) { + if (out_inter_sel) { + *out_inter_sel = inter_sel; + } else { + // TODO: Deep delete the selection (delete points list, start/count arrays, etc.) + common_read_selection_delete(inter_sel); + } + } + + // Free the datablock + adios_datablock_free(&datablock, 1); + return used_count; +} + +/* + * Takes a datablock and applies its data to the user buffer for the given + * read request group, then frees the given datablock. Assumes there is, in + * fact, a user buffer (i.e., it is not NULL). + * + * Assumes that the datablock selection is of type bounding box. + * + * NOTE: also frees the data buffer within the datablock + * + * @return non-zero if some data in the datablock intersected the read + * request's selection, and was applied; returns 0 otherwise. + */ +static int apply_datablock_to_result_and_free(adios_datablock *datablock, + adios_transform_read_request *reqgroup) +{ + assert(datablock); assert(reqgroup); + assert(reqgroup->orig_sel); + assert(reqgroup->orig_data); + + void *output_buffer; + if (is_global_selection(reqgroup->orig_sel)) { + // All timestep results have the same size in bytes, so offset the + // output pointer by however many timesteps precede this timestep + const int timestep_within_request = datablock->timestep - reqgroup->from_steps; + output_buffer = (char*)reqgroup->orig_data + timestep_within_request * reqgroup->orig_sel_timestep_size; + } else if (reqgroup->orig_sel->type == ADIOS_SELECTION_WRITEBLOCK) { + // For writeblock selections, computing the output buffer position for + // the current timestep is a bit trickier, since varblocks may be + // different sizes in different timesteps + const ADIOS_SELECTION_WRITEBLOCK_STRUCT *orig_sel_wb = &reqgroup->orig_sel->u.block; + + // Compute the offset into the output buffer at which the current timestep's output should go + // For absolute writeblocks, it's always 0, since there is only 1 timestep involved. For + // timestep-relative writeblock selections, we add the size of the writeblock (i.e. varblock) + // for all previous timesteps in the user's read request. + uint64_t output_buffer_offset = 0; + if (!orig_sel_wb->is_absolute_index) { + int timestep; + for (timestep = reqgroup->from_steps; timestep < datablock->timestep; timestep++) { + // Compute the size of the writeblock at this timestep and add it to our offset + output_buffer_offset += compute_selection_size_in_bytes(reqgroup->orig_sel, reqgroup->transinfo->orig_type, timestep, reqgroup->raw_varinfo, reqgroup->transinfo); + } + } + + // Offset the output pointer by the computed amount + output_buffer = (char*)reqgroup->orig_data + output_buffer_offset; + } else { + adios_error_at_line(err_unspecified, __FILE__, __LINE__, "Internal error: unexpected selection type %d, this should not be possible here\n", reqgroup->orig_sel->type); + } + + // Now that we have the output buffer pointer, actually perform the patch operation + const uint64_t used_count = + apply_datablock_to_buffer_and_free( + reqgroup->raw_varinfo, reqgroup->transinfo, + datablock, + &output_buffer, reqgroup->orig_sel, NULL /* don't need the intersection */, + reqgroup->swap_endianness); + + return used_count != 0; +} + +/* + * Takes a datablock containing data potentially applicable to the given read + * request group, identifies that data (if any), and returns it as an + * ADIOS_VARCHUNK. Additionally, free the datablock. + */ +static ADIOS_VARCHUNK * apply_datablock_to_chunk_and_free(adios_datablock *datablock, adios_transform_read_request *reqgroup) { + ADIOS_SELECTION *inter_sel; + + assert(datablock); assert(reqgroup); + assert(reqgroup->orig_sel); + + if (reqgroup->orig_sel->type != ADIOS_SELECTION_BOUNDINGBOX && + reqgroup->orig_sel->type != ADIOS_SELECTION_POINTS && + reqgroup->orig_sel->type != ADIOS_SELECTION_WRITEBLOCK) + { + adios_error(err_operation_not_supported, + "Only read selections of bounding box, points, or writeblock selection types " + "are currently allowed (received selection type %d) " + "(NOTE: this should have been caught earlier in the code)\n", + reqgroup->orig_sel->type); + } + + if (datablock->bounds->type != ADIOS_SELECTION_BOUNDINGBOX && + datablock->bounds->type != ADIOS_SELECTION_POINTS && + datablock->bounds->type != ADIOS_SELECTION_WRITEBLOCK) + { + adios_error(err_operation_not_supported, + "Only results of bounding box, points, or writeblock selection types " + "are currently accepted from transform plugins (received selection type %d)\n", + datablock->bounds->type); + abort(); + } + + // Special check due to limitations of ADIOS_VARCHUNK return: + // If the output is a writeblock selection, AND the input is not, AND + // the variable is a local array, AND we are required to return a chunk + // at a time, we must warn the user about potentially unexpected output. + // Because our results would necessarily be a global-selection-based chunk + // (subvolume, etc.), which has no information about what PG it came from, + // if the user submitted multiple writeblock selections over a local array + // variable at once, there would be no way to determine which writeblock + // a varchunk with a bounding box selection corresponds to. + // + // Potential solutions are: submit only one writeblock per schedule/check/perform + // cycle, use blocking reads, use a global array file, or use a different data + // transform. + if (reqgroup->orig_sel->type == ADIOS_SELECTION_WRITEBLOCK && + datablock->bounds->type != ADIOS_SELECTION_WRITEBLOCK && + !reqgroup->transinfo->orig_global && + adios_transform_read_request_get_mode(reqgroup) == PARTIAL_RESULT_MODE) + { + static int warning_printed = 0; + if (!warning_printed) { + const char *transform_name = adios_transform_plugin_primary_xml_alias(reqgroup->transinfo->transform_type); + if (!transform_name) transform_name = ""; + log_warn("Results for a chunked read using a writeblock selection over a %s-transformed " + "variable will return correct results, but in the form of ADIOS_VARCHUNKs with " + "non-writeblock selections, so it may be difficult to determine which VARCHUNK " + "goes with which writeblock selection if multiple have been submitted at once. " + "To avoid this warning, either use blocking reads, use a global array file, or " + "select a use data transform. This warning will only be printed once per run.", + transform_name); + warning_printed = 1; + } + return NULL; + } + + ADIOS_SELECTION *chunk_sel = NULL; + void *chunk_data = NULL; + uint64_t used_count = + apply_datablock_to_buffer_and_free( + reqgroup->raw_varinfo, reqgroup->transinfo, + datablock, + &chunk_data, reqgroup->orig_sel, &chunk_sel, // chunk_data == NULL -> allocate fitted buffer, chunk_sel == NULL -> return intersection selection + reqgroup->swap_endianness); + + if (used_count) { + assert(chunk_data && chunk_sel); + + // Bind the output buffer to the chunk struct + ADIOS_VARCHUNK *chunk = (ADIOS_VARCHUNK *)malloc(sizeof(ADIOS_VARCHUNK)); + *chunk = (ADIOS_VARCHUNK) { + .varid = reqgroup->raw_varinfo->varid, + .data = chunk_data, + .type = datablock->elem_type, + .sel = chunk_sel, + .from_steps = datablock->timestep, + .nsteps = 1, + }; + + return chunk; + } else { + return NULL; + } +} + +static ADIOS_VARCHUNK * extract_chunk_from_finished_read_reqgroup(adios_transform_read_request *reqgroup) { + assert(reqgroup); + assert(reqgroup->completed); + + ADIOS_VARCHUNK *chunk = malloc(sizeof(ADIOS_VARCHUNK)); + chunk->varid = reqgroup->raw_varinfo->varid; + chunk->type = reqgroup->transinfo->orig_type; + chunk->from_steps = reqgroup->from_steps; + chunk->nsteps = reqgroup->nsteps; + + // Transfer ownership of orig_data + chunk->data = reqgroup->orig_data; + reqgroup->orig_data = NULL; + + // Transfer ownership of orig_sel + chunk->sel = copy_selection(reqgroup->orig_sel); + reqgroup->orig_sel = NULL; + + return chunk; +} + +void adios_transform_cleanup_from_previous_check_reads(adios_transform_read_request **readreqs_head) { + adios_transform_read_request *readreq = *readreqs_head; + while (readreq) { + adios_transform_read_request *next_readreq = readreq->next; + + if (readreq->completed) { + // If the read request is totally completed, free the whole thing + adios_transform_read_request_remove(readreqs_head, readreq); + adios_transform_read_request_free(&readreq); + } else if (readreq->lent_varchunk_data) { + // Otherwise, free any internal data buffer that was previously given + // to the user via an ADIOS_VARCHUNK, but which now may be freed since + // the user has called adios_check_reads again + FREE(readreq->lent_varchunk_data); + } + + readreq = next_readreq; + } +} + +// Take an ADIOS_VARCHUNK that was just read and process it with the transform +// system. If it was part of a read request corresponding to a transformed +// variable, consume it, and (optionally) replace it with a detransformed chunk. +// Otherwise, do nothing, allowing the calling function to manage it as usual. +void adios_transform_process_read_chunk(adios_transform_read_request **reqgroups_head, ADIOS_VARCHUNK ** chunk) { + adios_transform_read_request *reqgroup; + adios_transform_pg_read_request *pg_reqgroup; + adios_transform_raw_read_request *subreq; + adios_datablock *result; + + // Find the subrequest that matches the VARCHUNK that was just read (if any) + int found = adios_transform_read_request_list_match_chunk(*reqgroups_head, *chunk, 1, &reqgroup, &pg_reqgroup, &subreq); + + // If no subrequest matches the VARCHUNK, it must correspond to a non-transformed variable. + // In this case, return immediately and let it be processed as-is. + if (!found) + return; + + // Otherwise, this VARCHUNK corresponds to a subrequest. + // Therefore, consume it, and perhaps replace it with a detransformed chunk. + + // Consume the chunk, as the data will be proceessed by a transform method to + // produce a new varchunk, so this varchunk should not be processed by the caller. + // (NOTE: Freeing this does not free the memory it points to, which we ASSUME + // is also pointed to by subreq->data, since currently we REQUIRE transform + // plugins to supply their own data buffers when submitting read requests) + common_read_free_chunk(*chunk); + *chunk = NULL; + + // Next, update the subreq that corresponds to this VARCHUNK as completed, retrieving any + // produced result + result = finish_subreq(reqgroup, pg_reqgroup, subreq); + + // Now, if a new adios_datablock is now available as a result of the above completed subreq, + // apply it as a result for the user in a way appropriate to the current result mode + if (result) { + // Then, return data as appropriate depending on the return mode of this read operation + // PARTIAL: no user-allocated buffer is given for the full result, so results must be + // returned one VARCHUNK at a time. + // FULL: the user has supplied a buffer for full results, so patch relevant data from + // the returned VARCHUNK into this buffer. + enum ADIOS_TRANSFORM_REQGROUP_RESULT_MODE result_mode = adios_transform_read_request_get_mode(reqgroup); + switch (result_mode) { + case PARTIAL_RESULT_MODE: + // Apply this VARCHUNK + *chunk = apply_datablock_to_chunk_and_free(result, reqgroup); + + // (*chunk)->data points to a buffer allocated by the transform plugin, and which + // is now given to us to own. Record it here so we can free it once the user is done + // accessing it (i.e., at the next check_reads or on file close). + reqgroup->lent_varchunk_data = (*chunk)->data; + break; + case FULL_RESULT_MODE: + apply_datablock_to_result_and_free(result, reqgroup); + + // If the whole variable is now ready, return it as a VARCHUNK + // Otherwise, return no chunk (NULL) + if (reqgroup->completed) { + *chunk = extract_chunk_from_finished_read_reqgroup(reqgroup); + } else { + assert(!*chunk); // No chunk to return, and *chunk is already NULL + } + break; + } + } else { + assert(!*chunk); // No chunk to return, and *chunk is already NULL + } +} + +/* + * Process all read reqgroups, assuming they have been fully completed, + * producing all required results based on the raw data read. + * (This function is called after a blocking perform_reads completes) + */ +void adios_transform_process_all_reads(adios_transform_read_request **reqgroups_head) { + // Mark all subrequests, PG request groups and read request groups + // as completed, calling callbacks as needed + adios_transform_read_request *reqgroup; + adios_transform_pg_read_request *pg_reqgroup; + adios_transform_raw_read_request *subreq; + adios_datablock *result; + + // Complete each read reqgroup in turn + while ((reqgroup = adios_transform_read_request_pop(reqgroups_head)) != NULL) { + // Free leftover read request groups immediately, with no further processing + if (reqgroup->completed) { + adios_transform_read_request_free(&reqgroup); + continue; + } + + // Complete every child PG reqgroup + for (pg_reqgroup = reqgroup->pg_reqgroups; pg_reqgroup; pg_reqgroup = pg_reqgroup->next) { + // Skip completed PG reqgroups + if (pg_reqgroup->completed) continue; + + // Complete every child subreq + for (subreq = pg_reqgroup->subreqs; subreq; subreq = subreq->next) { + // Skip completed subreqs + if (subreq->completed) continue; + + // Mark the subreq as completed + adios_transform_raw_read_request_mark_complete(reqgroup, pg_reqgroup, subreq); + assert(subreq->completed); + + // Make the required call to the transform method to apply the results + result = adios_transform_subrequest_completed(reqgroup, pg_reqgroup, subreq); + if (result) apply_datablock_to_result_and_free(result, reqgroup); + } + assert(pg_reqgroup->completed); + + // Make the required call to the transform method to apply the results + result = adios_transform_pg_reqgroup_completed(reqgroup, pg_reqgroup); + if (result) apply_datablock_to_result_and_free(result, reqgroup); + } + assert(reqgroup->completed); + + // Make the required call to the transform method to apply the results + result = adios_transform_read_reqgroup_completed(reqgroup); + if (result) apply_datablock_to_result_and_free(result, reqgroup); + + // Now that the read reqgroup has been processed, free it (which also frees all children) + adios_transform_read_request_free(&reqgroup); + } +} diff --git a/tests/libs/adios/src/core/transforms/adios_transforms_read.h b/tests/libs/adios/src/core/transforms/adios_transforms_read.h new file mode 100644 index 0000000000..e81b539248 --- /dev/null +++ b/tests/libs/adios/src/core/transforms/adios_transforms_read.h @@ -0,0 +1,79 @@ +/* + * Contains read-specific code for handling variable transforms in ADIOS + * + * Created on: Jun 27, 2012 + * Author: David A. Boyuka II + */ + +#ifndef ADIOS_TRANSFORMS_READ_H_ +#define ADIOS_TRANSFORMS_READ_H_ + +#include "public/adios_error.h" +#include "public/adios_types.h" +#include "public/adios_read_v2.h" +#include "core/adios_subvolume.h" +#include "core/transforms/adios_transforms_common.h" +#include "core/transforms/adios_transforms_reqgroup.h" + +// +// Read request inspection +// + +/* + * The possible modes in which a read request may be required to + * return results to the user. + */ +enum ADIOS_TRANSFORM_REQGROUP_RESULT_MODE { + // The user has supplied a data buffer that can contain the entire result, so populate it in place. + // Successful completion of the read implies this buffer is fully populated. + FULL_RESULT_MODE, + + // The user has specified no data buffer, and requests the data to be returned in chunks. Return + // an ADIOS_VARCHUNK whenever possible, using as little memory as possible. + // TODO: there is no respect for the user's memory limit in this mode; currently, the transform + // read layer allocates as much memory as it needs, and there are not many out-of-memory checks. + PARTIAL_RESULT_MODE +}; + +/* + * Used by the transform read layer, this function returns how the given read request is expected + * to return its results to the user (i.e., one of the options from the above struct). + */ +enum ADIOS_TRANSFORM_REQGROUP_RESULT_MODE adios_transform_read_request_get_mode(const adios_transform_read_request *reqgroup); + +// +// BLOCKINFO inspection +// + +/* + * Examines the "raw" BLOCKINFO from some transformed PG, and returns the size (in bytes) + * of the transformed data contained within that PG. + */ +uint64_t adios_transform_get_transformed_var_size_from_blockinfo(int raw_ndim, const ADIOS_VARBLOCK *raw_block); + +// +// Read request handling +// + +/* + * Generates an adios_transform_read_request containing all byte-segment reads to be passed to + * the read transport layer. Internally, it delegates to the transform plugin read side to + * generate the actual byte segments. This function performs culling based on PG bounds, and + * passes user-selection-intersecting regions to the plugin when requesting byte-segment reads. + */ +adios_transform_read_request * adios_transform_generate_read_reqgroup(const ADIOS_VARINFO *vi, const ADIOS_TRANSINFO* ti, const ADIOS_FILE *fp, + const ADIOS_SELECTION *sel, int from_steps, int nsteps, const char *param, void *data); + +/* + * Processes a VARCHUNK just returned by the read layer against the given list of outstanding transform + * read requests. + */ +void adios_transform_process_read_chunk(adios_transform_read_request **reqgroups_head, ADIOS_VARCHUNK ** chunk); + +/* + * Processes all data after a blocking read that has serviced all read requests, + * completing all transform read requests. + */ +void adios_transform_process_all_reads(adios_transform_read_request **reqgroups_head); + +#endif /* ADIOS_TRANSFORMS_READ_H_ */ diff --git a/tests/libs/adios/src/core/transforms/adios_transforms_reqgroup.c b/tests/libs/adios/src/core/transforms/adios_transforms_reqgroup.c new file mode 100644 index 0000000000..0c5b5dc85f --- /dev/null +++ b/tests/libs/adios/src/core/transforms/adios_transforms_reqgroup.c @@ -0,0 +1,517 @@ +/* + * adios_transforms_reqgroup.c + * + * All node types from the transform read request tree are implemented here. + * + * Note on use of PREPEND rather than APPEND when adding read requests: the ultimate + * goal is to ensure all raw_read_requests are scheduled with the I/O transport layer + * according to the pre-order traversal of *how they were added* (not necessarily on + * actual tree). For instance, if pg_reqgroup A is added before pg_reqgroup B, then + * all raw_read_requests of A should be scheduled before those of B, and within these + * groups, in the same order they were appended. + * + * However, currently the Read BP transport method stores read requests in *reverse order* + * from how they are scheduled (internally, it does a list prepend). Thus, the simplest way + * to counteract this is to also use list prepends in the read request tree, causing a + * pre-order traversal to yield raw_read_requests in reverse order. When they are scheduled + * in this order, they will be re-reversed, thus finally ending up in the correct order. + * + * This problem could also be solved by maintaining list appends in the tree, and then + * reversing the list orders before scheduling, or simply iterating over the tree in + * post-order traversal (although this would require either reworking the singly-linked + * list structure, or using a fancy algorithm that reverses the list, then reverses it + * again during iteration). For now, this approach is the safest and most straightforward. + * + * + * Created on: Jul 30, 2012 + * Author: David A. Boyuka II + */ + +#include +#include +#include +#include "core/transforms/adios_transforms_hooks_read.h" +#include "core/transforms/adios_transforms_reqgroup.h" +#include "core/common_read.h" +#include "core/adios_subvolume.h" +#include "adios_selection.h" + +// An adios_transform_read_request corresponds to a variable read request +// An adios_transform_pg_read_request corresponds to the portion of a read request intersecting a PG +// An adios_transform_raw_read_request corresponds to a single raw byte range read within a PG + +// adios_transform_raw_read_request owns ->sel and ->data (both will be free'd) +// adios_transform_pg_read_request owns ->pg_selection and ->pg_intersection_to_global_copyspec (both will be free'd) +// adios_transform_read_request owns ->orig_sel, ->varinfo and ->transinfo (all will be free'd) + +// Also, in all cases, ->transform_internal will be free'd if it is non-NULL +// Thus, it is best to keep only a single level malloc in transform_internal (no pointers to other mallocs) +// If this is not possible, you should free() malloced memory yourself as soon as it is no longer needed + +#define MYFREE(p) {if (p) free(p); (p)=NULL;} + +// Generic list manipulation +// Assumes the list node struct has a ->next field + +#define LIST_APPEND(head, elem, elem_type) \ + if (!(head)) { \ + (head) = (elem); \ + } else { \ + elem_type *_cur = (head); \ + while (_cur->next) \ + _cur = _cur->next; \ + _cur->next = (elem); \ + } \ + +#define LIST_PREPEND(head, elem, elem_type) \ + if (!(head)) { \ + (head) = (elem); \ + } else { \ + (elem)->next = (head); \ + (head) = elem; \ + } \ + +#define LIST_REMOVE(head, elem, elem_type, removed) \ + LIST_REMOVE_PRED(head, (_cur == (elem)), elem_type, removed) + +#define LIST_REMOVE_KEY(head, key, keyfield, elem_type, removed) \ + LIST_REMOVE_PRED(head, (_cur->keyfield == (key)), elem_type, removed) + +#define LIST_REMOVE_PRED(head, pred, elem_type, removed) \ + if (!(head)) { \ + removed = 0; \ + } else { \ + elem_type *_prev = NULL; \ + elem_type *_cur = (head); \ + while (_cur) { \ + if (pred) \ + break; \ + _prev = _cur; \ + _cur = _cur->next; \ + } \ + if (!_cur) { \ + removed = NULL; \ + } else { \ + if (!_prev) { \ + (head) = (head)->next; \ + } else { \ + _prev->next = _cur->next; \ + } \ + _cur->next = NULL; \ + removed = _cur; \ + } \ + } + +// Utility functions + +static int common_adios_selection_equal(ADIOS_SELECTION *sel1, ADIOS_SELECTION *sel2) { + if (sel1->type != sel2->type) + return 0; + + switch (sel1->type) { + case ADIOS_SELECTION_BOUNDINGBOX: + { + ADIOS_SELECTION_BOUNDINGBOX_STRUCT *bb1 = &sel1->u.bb; + ADIOS_SELECTION_BOUNDINGBOX_STRUCT *bb2 = &sel2->u.bb; + return (bb1->ndim == bb2->ndim) && + memcmp(bb1->start, bb2->start, bb1->ndim * sizeof(uint64_t)) == 0 && + memcmp(bb1->count, bb2->count, bb1->ndim * sizeof(uint64_t)) == 0; + } + case ADIOS_SELECTION_WRITEBLOCK: + { + ADIOS_SELECTION_WRITEBLOCK_STRUCT *wb1 = &sel1->u.block; + ADIOS_SELECTION_WRITEBLOCK_STRUCT *wb2 = &sel2->u.block; + return (wb1->index == wb2->index) && + (wb1->is_absolute_index == wb2->is_absolute_index) && + (wb1->is_sub_pg_selection == wb2->is_sub_pg_selection) && + (!wb1->is_sub_pg_selection || ( + (wb1->element_offset == wb2->element_offset) && + (wb1->nelements == wb2->nelements) + )); + } + default: + adios_error(err_operation_not_supported, "Selection types other than bounding box not supported in %s\n", __FUNCTION__); + return 0; + } +} + +// +// adios_transform_read_subreq struct manipulation +// + +adios_transform_raw_read_request * adios_transform_raw_read_request_new(ADIOS_SELECTION *sel, void *data) { + adios_transform_raw_read_request *new_subreq = malloc(sizeof(adios_transform_raw_read_request)); + new_subreq->raw_sel = sel; + new_subreq->data = data; + new_subreq->completed = 0; + new_subreq->transform_internal = 0; + new_subreq->next = 0; + return new_subreq; +} + +// Define to use the new writeblock-based raw read interface to the I/O transport layer +// NOTE: Support for NOT using this option (i.e., non-WRITEBLOCK reads) is discontinued, and +// disabling this option will certainly lead to errors! +// TODO: Totally remove this option, leaving only the WRITEBLOCK method, once it has been tested +// and confirmed working/viable +#define RAW_READS_USE_WRITEBLOCK + +adios_transform_raw_read_request * adios_transform_raw_read_request_new_byte_segment(const adios_transform_pg_read_request *pg_reqgroup, uint64_t start, uint64_t count, void *data) { + ADIOS_SELECTION *sel; + +#ifdef RAW_READS_USE_WRITEBLOCK + ADIOS_SELECTION_WRITEBLOCK_STRUCT *wb; + + // NOTE: We use the absolute PG index, along with the is_absolute_index flag below + sel = common_read_selection_writeblock(pg_reqgroup->blockidx); + + wb = &sel->u.block; + wb->is_absolute_index = 1; + wb->is_sub_pg_selection = 1; + wb->element_offset = start; // Assume element type of the raw variable is byte + wb->nelements = count; + + // Catch any bugs that cause wrap-around early: + assert(start <= pg_reqgroup->raw_var_length); + assert(count <= pg_reqgroup->raw_var_length); + assert(start + count <= pg_reqgroup->raw_var_length); +#else + const ADIOS_VARBLOCK *raw_varblock = pg_reqgroup->raw_varblock; + uint64_t *start_sel, *count_sel; + + // TODO: Move this bounding box construction to a separate function? + start_sel = (uint64_t*)malloc(2 * sizeof(uint64_t)); + count_sel = (uint64_t*)malloc(2 * sizeof(uint64_t)); + // PG ID dim + start_sel[0] = raw_varblock->start[0]; // PG ID + count_sel[0] = 1; + // Buffer dim + start_sel[1] = start; + count_sel[1] = count; + + // Transfer ownership of the our start/count vectors + sel = common_read_selection_boundingbox(2, start_sel, count_sel); + start_sel = count_sel = NULL; +#endif + + return adios_transform_raw_read_request_new(sel, data); +} + +adios_transform_raw_read_request * adios_transform_raw_read_request_new_whole_pg(const adios_transform_pg_read_request *pg_reqgroup, void *data) { +#ifdef RAW_READS_USE_WRITEBLOCK + // Use absolute time index, but not sub-PG read + ADIOS_SELECTION *sel = common_read_selection_writeblock(pg_reqgroup->blockidx); + sel->u.block.is_absolute_index = 1; + return adios_transform_raw_read_request_new(sel, data); +#else + // NEW: raw_varblock is always 1D, with that dimension being byte length + // OLD, NO LONGER APPLICABLE: raw_varblock has two dimensions: PG ID and byte offset. Thus, the length of this (raw) PG is the length of the 2nd dimension. + const ADIOS_VARBLOCK *raw_varblock = pg_reqgroup->raw_varblock; + return adios_transform_raw_read_request_new_byte_segment(pg_reqgroup, 0, raw_varblock->count[1], data); +#endif +} + +void adios_transform_raw_read_request_mark_complete(adios_transform_read_request *parent_reqgroup, adios_transform_pg_read_request *parent_pg_reqgroup, + adios_transform_raw_read_request *subreq) { + if (subreq->completed) + return; + + subreq->completed = 1; + parent_pg_reqgroup->num_completed_subreqs++; + + if (parent_pg_reqgroup->num_completed_subreqs == parent_pg_reqgroup->num_subreqs) { + parent_pg_reqgroup->completed = 1; + parent_reqgroup->num_completed_pg_reqgroups++; + + if (parent_reqgroup->num_completed_pg_reqgroups == parent_reqgroup->num_pg_reqgroups) { + parent_reqgroup->completed = 1; + } + } +} + +// NOTE: MUST have removed the subrequest from the PG request group BEFORE calling this +void adios_transform_raw_read_request_free(adios_transform_raw_read_request **subreq_ptr) { + adios_transform_raw_read_request *subreq = *subreq_ptr; + assert(!subreq->next); // Not a perfect check, but will catch many requests that are still linked + + // Free malloc'd resources + common_read_selection_delete(subreq->raw_sel); + MYFREE(subreq->data); + MYFREE(subreq->transform_internal); + + // Clear all data to 0's for safety + memset(subreq, 0, sizeof(adios_transform_raw_read_request)); + + // Free the entire struct and the user's pointer to it + MYFREE(*subreq_ptr); +} + +// +// adios_transform_pg_reqgroup struct manipulation +// + +adios_transform_pg_read_request * adios_transform_pg_read_request_new( + int timestep, int timestep_blockidx, int blockidx, + int orig_ndim, int raw_ndim, + const ADIOS_VARBLOCK *orig_varblock, + const ADIOS_VARBLOCK *raw_varblock, + const ADIOS_SELECTION *pg_intersection_sel, + const ADIOS_SELECTION *pg_bounds_sel, + const void *transform_metadata, + uint16_t transform_metadata_len) { + + adios_transform_pg_read_request *new_pg_reqgroup; + + assert(orig_varblock); + assert(blockidx >= 0); + + new_pg_reqgroup = calloc(sizeof(adios_transform_pg_read_request), 1); + new_pg_reqgroup->timestep = timestep; + new_pg_reqgroup->blockidx_in_timestep = timestep_blockidx; + new_pg_reqgroup->blockidx = blockidx; + new_pg_reqgroup->raw_var_length = adios_transform_get_transformed_var_size_from_blockinfo(raw_ndim, raw_varblock); //raw_varblock->count[0]; + new_pg_reqgroup->raw_ndim = raw_ndim; + new_pg_reqgroup->orig_ndim = orig_ndim; + new_pg_reqgroup->raw_varblock = raw_varblock; + new_pg_reqgroup->orig_varblock = orig_varblock; + new_pg_reqgroup->pg_intersection_sel = pg_intersection_sel; + new_pg_reqgroup->pg_bounds_sel = pg_bounds_sel; + new_pg_reqgroup->transform_metadata = transform_metadata; + new_pg_reqgroup->transform_metadata_len = transform_metadata_len; + + ADIOS_SELECTION *wbsel = common_read_selection_writeblock(blockidx); + wbsel->u.block.is_absolute_index = 1; + new_pg_reqgroup->pg_writeblock_sel = wbsel; + + // Other fields are 0'd + + return new_pg_reqgroup; +} + +void adios_transform_raw_read_request_append(adios_transform_pg_read_request *pg_reqgroup, adios_transform_raw_read_request *subreq) { + LIST_PREPEND(pg_reqgroup->subreqs, subreq, adios_transform_raw_read_request); + pg_reqgroup->num_subreqs++; +} + +int adios_transform_raw_read_request_remove(adios_transform_pg_read_request *pg_reqgroup, adios_transform_raw_read_request *subreq) { + adios_transform_raw_read_request *removed; + LIST_REMOVE(pg_reqgroup->subreqs, subreq, adios_transform_raw_read_request, removed); + + if (removed) pg_reqgroup->num_subreqs--; + return removed != NULL; +} + +adios_transform_raw_read_request * adios_transform_raw_read_request_pop(adios_transform_pg_read_request *pg_reqgroup) { + adios_transform_raw_read_request *to_remove = pg_reqgroup->subreqs; + if (adios_transform_raw_read_request_remove(pg_reqgroup, to_remove)) + return to_remove; + else + return NULL; +} + +void adios_transform_pg_read_request_free(adios_transform_pg_read_request **pg_reqgroup_ptr) { + adios_transform_pg_read_request *pg_reqgroup = *pg_reqgroup_ptr; + adios_transform_raw_read_request *removed_subreq; + + assert(!pg_reqgroup->next); + + // Free any remaining subrequests + while ((removed_subreq = adios_transform_raw_read_request_pop(pg_reqgroup)) != NULL) { + adios_transform_raw_read_request_free(&removed_subreq); + } + + // Free malloc'd resources + if (pg_reqgroup->pg_intersection_sel) + common_read_selection_delete((ADIOS_SELECTION*)pg_reqgroup->pg_intersection_sel); + if (pg_reqgroup->pg_bounds_sel) + common_read_selection_delete((ADIOS_SELECTION*)pg_reqgroup->pg_bounds_sel); + if (pg_reqgroup->pg_writeblock_sel) + common_read_selection_delete((ADIOS_SELECTION*)pg_reqgroup->pg_writeblock_sel); + MYFREE(pg_reqgroup->transform_internal); + + // Clear all data to 0's for safety + memset(pg_reqgroup, 0, sizeof(adios_transform_pg_read_request)); + // Free the entire struct and the user's pointer to it + MYFREE(*pg_reqgroup_ptr); +} + +// +// adios_transform_read_reqgroup struct manipulation +// + +adios_transform_read_request * adios_transform_read_request_new( + const ADIOS_FILE *fp, const ADIOS_VARINFO *varinfo, const ADIOS_TRANSINFO *transinfo, + const ADIOS_SELECTION *sel, int from_steps, int nsteps, + const char *param, + void *data, enum ADIOS_FLAG swap_endianness) { + + adios_transform_read_request *new_reqgroup; + assert(fp); assert(varinfo); assert(transinfo); + assert(nsteps > 0); + + new_reqgroup = calloc(sizeof(adios_transform_read_request), 1); + new_reqgroup->fp = fp; + new_reqgroup->raw_varinfo = varinfo; + new_reqgroup->transinfo = transinfo; + + new_reqgroup->from_steps = from_steps; + new_reqgroup->nsteps = nsteps; + new_reqgroup->orig_sel = copy_selection(sel); + new_reqgroup->read_param = param; + new_reqgroup->orig_data = data; + new_reqgroup->swap_endianness = swap_endianness; + + // orig_sel_timestep_size is not meaningful for a writeblock selection, since a + // writeblock selection may "change size" depending on which timestep is considered + if (sel->type != ADIOS_SELECTION_WRITEBLOCK) { + new_reqgroup->orig_sel_timestep_size = compute_selection_size(sel) * + common_read_type_size(transinfo->orig_type, NULL); + } + + // Other fields are 0'd + + return new_reqgroup; +} + +void adios_transform_pg_read_request_append(adios_transform_read_request *reqgroup, adios_transform_pg_read_request *pg_reqgroup) { + LIST_PREPEND(reqgroup->pg_reqgroups, pg_reqgroup, adios_transform_pg_read_request); + reqgroup->num_pg_reqgroups++; +} + +int adios_transform_pg_read_request_remove(adios_transform_read_request *reqgroup, adios_transform_pg_read_request *pg_reqgroup) { + adios_transform_pg_read_request *removed; + LIST_REMOVE(reqgroup->pg_reqgroups, pg_reqgroup, adios_transform_pg_read_request, removed); + + if (removed) reqgroup->num_pg_reqgroups--; + return removed != NULL; +} + +adios_transform_pg_read_request * adios_transform_pg_read_request_pop(adios_transform_read_request *reqgroup) { + adios_transform_pg_read_request *to_remove = reqgroup->pg_reqgroups; + if (adios_transform_pg_read_request_remove(reqgroup, to_remove)) + return to_remove; + else + return NULL; +} + +void adios_transform_read_request_append(adios_transform_read_request **head, adios_transform_read_request *new_reqgroup) { + LIST_PREPEND(*head, new_reqgroup, adios_transform_read_request); +} + +adios_transform_read_request * adios_transform_read_request_remove(adios_transform_read_request **head, adios_transform_read_request *reqgroup) { + adios_transform_read_request *removed; + LIST_REMOVE(*head, reqgroup, adios_transform_read_request, removed); + return removed; +} + +adios_transform_read_request * adios_transform_read_request_pop(adios_transform_read_request **head) { + adios_transform_read_request *to_remove = *head; + if (adios_transform_read_request_remove(head, to_remove)) + return to_remove; + else + return NULL; +} + +void adios_transform_read_request_free(adios_transform_read_request **reqgroup_ptr) { + adios_transform_read_request *reqgroup = *reqgroup_ptr; + adios_transform_pg_read_request *removed_pg_reqgroup; + + assert(!reqgroup->next); + + // Free any remaining subrequests + while ((removed_pg_reqgroup = adios_transform_pg_read_request_pop(reqgroup)) != NULL) { + adios_transform_pg_read_request_free(&removed_pg_reqgroup); + } + + // Free malloc'd resources + + // Free any data buffer lent to the user, but don't free the VARCHUNK; that + // should have been done already by the user + if (reqgroup->lent_varchunk_data) + MYFREE(reqgroup->lent_varchunk_data); + + common_read_selection_delete((ADIOS_SELECTION*)reqgroup->orig_sel); // Remove const + + // DON'T FREE varinfo/transinfo, since they are stored in the infocache + // common_read_free_transinfo(reqgroup->raw_varinfo, (ADIOS_TRANSINFO*)reqgroup->transinfo); // Remove const + // common_read_free_varinfo((ADIOS_VARINFO*)reqgroup->raw_varinfo); // Remove const + + MYFREE(reqgroup->transform_internal); + + // Clear all data to 0's for safety + memset(reqgroup, 0, sizeof(adios_transform_read_request)); + // Free the entire struct and the user's pointer to it + MYFREE(*reqgroup_ptr); +} + +// +// Chunk matching code +// + +static int adios_transform_pg_read_request_match_chunk(const adios_transform_pg_read_request *pg_reqgroup, + const ADIOS_VARCHUNK *chunk, int skip_completed, + adios_transform_raw_read_request **matching_subreq) { + + adios_transform_raw_read_request *cur; + + for (cur = pg_reqgroup->subreqs; cur; cur = cur->next) { + if (skip_completed && cur->completed) + continue; + + if (common_adios_selection_equal(cur->raw_sel, chunk->sel)) + break; + } + + // cur will be NULL if none matched + *matching_subreq = cur; + return cur != NULL; +} + +static int adios_transform_read_request_match_chunk(const adios_transform_read_request *reqgroup, + const ADIOS_VARCHUNK *chunk, int skip_completed, + adios_transform_pg_read_request **matching_pg_reqgroup, + adios_transform_raw_read_request **matching_subreq) { + + adios_transform_pg_read_request *cur; + + if (reqgroup->raw_varinfo->varid != chunk->varid) + return 0; + + int found = 0; + // Search all PG request groups + for (cur = reqgroup->pg_reqgroups; cur; cur = cur->next) { + // Skip completed PG reqgroups if required + if (skip_completed && cur->completed) + continue; + + // Skip PG reqgroups that are for other timesteps + if (cur->timestep != chunk->from_steps) + continue; + + // Delegate remaining search to the PG regroup + found = adios_transform_pg_read_request_match_chunk(cur, chunk, skip_completed, matching_subreq); + if (found) + break; + } + + // cur will be NULL if nothing matched + *matching_pg_reqgroup = cur; + return found; +} + +int adios_transform_read_request_list_match_chunk(const adios_transform_read_request *reqgroup_head, + const ADIOS_VARCHUNK *chunk, int skip_completed, + adios_transform_read_request **matching_reqgroup, + adios_transform_pg_read_request **matching_pg_reqgroup, + adios_transform_raw_read_request **matching_subreq) { + int found; + adios_transform_read_request *cur; + for (cur = (adios_transform_read_request *)reqgroup_head; cur; cur = cur->next) { + found = adios_transform_read_request_match_chunk(cur, chunk, skip_completed, matching_pg_reqgroup, matching_subreq); + if (found) + break; + } + + *matching_reqgroup = cur; + return found; +} diff --git a/tests/libs/adios/src/core/transforms/adios_transforms_reqgroup.h b/tests/libs/adios/src/core/transforms/adios_transforms_reqgroup.h new file mode 100644 index 0000000000..9ddf6944c9 --- /dev/null +++ b/tests/libs/adios/src/core/transforms/adios_transforms_reqgroup.h @@ -0,0 +1,156 @@ +/* + * adios_transformed_reqgroup.h + * + * Created on: Jul 30, 2012 + * Author: David A. Boyuka II + */ + +#ifndef ADIOS_TRANSFORMS_REQGROUP_H_ +#define ADIOS_TRANSFORMS_REQGROUP_H_ + +#include +#include "public/adios_read_v2.h" +#include "public/adios_types.h" +#include "core/transforms/adios_transforms_common.h" +#include "core/transforms/adios_transforms_transinfo.h" + +// +// Read request-related structs: +// +// adios_transform_read_request +// adios_transform_pg_read_request +// adios_transform_raw_read_request +// + +typedef struct _adios_transform_raw_read_request { + int completed; // Whether this request has been completed + + ADIOS_SELECTION *raw_sel; // The raw selection to pose to the read layer + void *data; + + void *transform_internal; // Transform plugin private + + // Linked list + struct _adios_transform_raw_read_request *next; +} adios_transform_raw_read_request; + +typedef struct _adios_transform_pg_read_request { + int completed; // Whether this request has been completed + + // PG information + int timestep; // The timestep to which this PG belongs + int blockidx_in_timestep; // The block ID of this PG within the timestep + int blockidx; // The block ID of this PG within the variable + uint64_t raw_var_length; // Transformed variable data length, in bytes + int raw_ndim; // Number of dimensions in the raw (byte array) dimensions (should always be 1) + int orig_ndim; // Number of dimensions in the original (user-view) dimensions + const ADIOS_VARBLOCK *raw_varblock; // Points into adios_transform_read_reqgroup->varinfo->blockinfo; do not free here + const ADIOS_VARBLOCK *orig_varblock; // Points into adios_transform_read_reqgroup->transinfo->orig_blockinfo; do not free here + const void *transform_metadata; // Transform metadata associated with this PG + uint16_t transform_metadata_len; // Length of the transform metadata associated with this PG + + // Various selections to aid in datablock construction + const ADIOS_SELECTION *pg_intersection_sel; + const ADIOS_SELECTION *pg_bounds_sel; + const ADIOS_SELECTION *pg_writeblock_sel; + + // Subrequests + int num_subreqs; + int num_completed_subreqs; + adios_transform_raw_read_request *subreqs; + + void *transform_internal; // Transform plugin private + + // Linked list + struct _adios_transform_pg_read_request *next; +} adios_transform_pg_read_request; + +typedef struct _adios_transform_read_request { + int completed; // Whether this request has been completed + + ADIOS_VARCHUNK *lent_varchunk_data; // The data buffer of the last ADIOS_VARCHUNK passed to the user. + // The user is responsible for cleaning up the VARCHUNK itself, but + // we must free this buffer ourselves each time a new check_reads is + // called (or the file is closed) + + const ADIOS_FILE *fp; + + const ADIOS_VARINFO *raw_varinfo; + const ADIOS_TRANSINFO *transinfo; + enum ADIOS_FLAG swap_endianness; + + // Original selection info + int from_steps; + int nsteps; + const ADIOS_SELECTION *orig_sel; // Global space + const char *read_param; // Special read parameter passed by user, to be interpreted by the transform method + void *orig_data; // User buffer supplied in schedule_reads (could be NULL) + + // Number of bytes in data within the selection per timestep + uint64_t orig_sel_timestep_size; + + // Child PG read requests + int num_pg_reqgroups; + int num_completed_pg_reqgroups; + adios_transform_pg_read_request *pg_reqgroups; + + void *transform_internal; // Transform plugin private + + // Linked list + struct _adios_transform_read_request *next; +} adios_transform_read_request; + +// +// adios_transform_raw_read_request manipulation +// +adios_transform_raw_read_request * adios_transform_raw_read_request_new(ADIOS_SELECTION *sel, void *data); +adios_transform_raw_read_request * adios_transform_raw_read_request_new_byte_segment(const adios_transform_pg_read_request *pg_reqgroup, uint64_t start, uint64_t count, void *data); +adios_transform_raw_read_request * adios_transform_raw_read_request_new_whole_pg(const adios_transform_pg_read_request *pg_reqgroup, void *data); +void adios_transform_raw_read_request_free(adios_transform_raw_read_request **subreq_ptr); + +void adios_transform_raw_read_request_mark_complete(adios_transform_read_request *regroup_parent, + adios_transform_pg_read_request *parent_pg_reqgroup, + adios_transform_raw_read_request *subreq); + +void adios_transform_raw_read_request_append(adios_transform_pg_read_request *pg_reqgroup, adios_transform_raw_read_request *subreq); +int adios_transform_raw_read_request_remove(adios_transform_pg_read_request *pg_reqgroup, adios_transform_raw_read_request *subreq); +adios_transform_raw_read_request * adios_transform_raw_read_request_pop(adios_transform_pg_read_request *pg_reqgroup); + +// +// adios_transform_pg_read_request manipulation +// +adios_transform_pg_read_request * adios_transform_pg_read_request_new(int timestep, int timestep_blockidx, int blockidx, + int orig_ndim, int raw_ndim, + const ADIOS_VARBLOCK *orig_varblock, + const ADIOS_VARBLOCK *raw_varblock, + const ADIOS_SELECTION *pg_intersection_sel, + const ADIOS_SELECTION *pg_bounds_sel, + const void *transform_metadata, + uint16_t transform_metadata_len); +void adios_transform_pg_read_request_free(adios_transform_pg_read_request **pg_reqgroup_ptr); + +void adios_transform_pg_read_request_append(adios_transform_read_request *reqgroup, adios_transform_pg_read_request *pg_reqgroup); +int adios_transform_pg_read_request_remove(adios_transform_read_request *reqgroup, adios_transform_pg_read_request *pg_reqgroup); +adios_transform_pg_read_request * adios_transform_pg_read_request_pop(adios_transform_read_request *reqgroup); + +// +// adios_transform_read_reqgroup manipulation +// +adios_transform_read_request * adios_transform_read_request_new(const ADIOS_FILE *fp, const ADIOS_VARINFO *varinfo, + const ADIOS_TRANSINFO *transinfo, + const ADIOS_SELECTION *sel, int from_steps, int nsteps, + const char *param, + void *data, enum ADIOS_FLAG swap_endianness); +void adios_transform_read_request_free(adios_transform_read_request **reqgroup_ptr); + +void adios_transform_read_request_append(adios_transform_read_request **head, adios_transform_read_request *new_reqgroup); +adios_transform_read_request * adios_transform_read_request_remove(adios_transform_read_request **head, adios_transform_read_request *reqgroup); +adios_transform_read_request * adios_transform_read_request_pop(adios_transform_read_request **head); + +int adios_transform_read_request_list_match_chunk(const adios_transform_read_request *reqgroup_head, + const ADIOS_VARCHUNK *chunk, int skip_completed, + adios_transform_read_request **matching_reqgroup, + adios_transform_pg_read_request **matching_pg_reqgroup, + adios_transform_raw_read_request **matching_subreq); + +#endif /* ADIOS_TRANSFORMS_REQGROUP_H_ */ diff --git a/tests/libs/adios/src/core/transforms/adios_transforms_specparse.c b/tests/libs/adios/src/core/transforms/adios_transforms_specparse.c new file mode 100644 index 0000000000..da2bf8cfcb --- /dev/null +++ b/tests/libs/adios/src/core/transforms/adios_transforms_specparse.c @@ -0,0 +1,188 @@ +/* + * adios_transforms_specparse.c + * + * Created on: May 20, 2013 + * Author: David A. Boyuka II + */ + +#include +#include +#include +#include +#include "core/transforms/adios_transforms_specparse.h" +#include "core/transforms/adios_transforms_hooks.h" +#include "core/util.h" + +inline static char * strsplit(char *input, char split) { + char *pos = strchr(input, split); + if (!pos) + return NULL; + + *pos = '\0'; + return pos + 1; +} + +inline static int strcount(char *input, char chr) { + int count = 0; + while ((input = strchr(input, chr))) { + count++; + input++; + } + return count; +} + +// var is a pointer type +#define MALLOC_ARRAY(var, type, count) ((var) = (type *)malloc(sizeof(type) * (count))) +#define MALLOC_VAR(var, type) MALLOC_ARRAY(var, type, 1) +#define CALLOC_ARRAY(var, type, count) ((var) = (type *)calloc((count), sizeof(type))) +#define CALLOC_VAR(var, type) CALLOC_ARRAY(var, type, 1) + +//struct adios_transform_spec * adios_transform_parse_spec(const char *spec_str) { +struct adios_transform_spec * adios_transform_parse_spec(const char *spec_str, + struct adios_transform_spec *spec_in) +{ + //struct adios_transform_spec *spec = (struct adios_transform_spec *)malloc(sizeof(struct adios_transform_spec)); + struct adios_transform_spec *spec = spec_in; + if (spec) { + adios_transform_clear_spec(spec); + } else { + MALLOC_VAR(spec, struct adios_transform_spec); + } + + *spec = (struct adios_transform_spec){ + .transform_type = adios_transform_none, + .transform_type_str = NULL, + .param_count = 0, + .params = NULL, + .backing_str = NULL, + .backing_str_len = 0, + }; + + // If the spec string is null/empty, stop now with a blank spec + if (!spec_str || strcmp(spec_str, "") == 0) + return spec; + assert(spec_str && strcmp(spec_str, "") != 0); + + // Duplicate the spec string so we can chop it up + char *new_spec_str = strdup(spec_str); + spec->backing_str = new_spec_str; + spec->backing_str_len = strlen(new_spec_str); + + // Mark the transform method string in the spec string (the beginning) + spec->transform_type_str = new_spec_str; + + // Split off the parameters if present + char *param_list = strsplit(new_spec_str, ':'); + + // Parse the transform method string + spec->transform_type = adios_transform_find_type_by_xml_alias(spec->transform_type_str); + + // If the transform type is unknown (error) or none, stop now and return + if (spec->transform_type == adios_transform_unknown || + spec->transform_type == adios_transform_none) + return spec; + assert(spec->transform_type != adios_transform_unknown && + spec->transform_type != adios_transform_none); + + // If there is no parameter list, we are done + if (!param_list) + return spec; + assert(param_list); + + spec->param_count = strcount(param_list, ',') + 1; + MALLOC_ARRAY(spec->params, struct adios_transform_spec_kv_pair, spec->param_count); + //spec->params = (typeof(spec->params))malloc(sizeof(*spec->params)); + + struct adios_transform_spec_kv_pair *cur_kv = spec->params; + char *cur_param; + while (param_list) { + cur_param = param_list; + param_list = strsplit(param_list, ','); + + cur_kv->key = cur_param; + cur_kv->value = strsplit(cur_param, '='); // NULL if no = + + cur_kv++; + } + + return spec; +} + +void adios_transform_spec_copy(struct adios_transform_spec *dst, const struct adios_transform_spec *src) { + // First, free any previously-held memory in the dst struct + adios_transform_clear_spec(dst); + + // Copy some non-pointer fields + dst->transform_type = src->transform_type; + dst->backing_str_len = src->backing_str_len; + + // If there is a "backing string" field, copy it according to its recorded length + // (note: strlen/strcpy won't work, as it probably contains \0s in the middle) + dst->backing_str = src->backing_str ? (char*)bufdup(src->backing_str, 1, src->backing_str_len + 1) : NULL; + + // REBASE_STR: return a pointer into dst->backing_str with the same offset as the old pointer had into src->backing_str + #define REBASE_STR(str) ((str) - src->backing_str + dst->backing_str) + // REBASE_OR_DUP: if src->backing_str exists, return a REBASE_STR pointer; otherwise, duplicate the string and return that + #define REBASE_OR_DUP(str) ((src->backing_str) ? REBASE_STR(str) : strdup(str)) + // REBASE_OR_DUP_OR_NULL: if str is non-NULL, same as REBASE_OR_DUP(str); otherwise, returns NULL + #define REBASE_OR_DUP_OR_NULL(str) ((str) ? REBASE_OR_DUP(str) : NULL) + + // Copy the content of transform_type_str (either pointer-into-backing-str, a + // duplicated string when no backing string exists, or NULL if it was NULL) + dst->transform_type_str = REBASE_OR_DUP_OR_NULL(src->transform_type_str); + + // Copy transform user parameters if they exist + if (src->params) { + int i; + + // Initialize the key-value pair array + dst->param_count = src->param_count; + MALLOC_ARRAY(dst->params, struct adios_transform_spec_kv_pair, dst->param_count); + + // Copy each key-value pair + for (i = 0; i < dst->param_count; i++) { + const struct adios_transform_spec_kv_pair *src_kv = &src->params[i]; + struct adios_transform_spec_kv_pair *dst_kv = &dst->params[i]; + + // Copy the key and/or value content + dst_kv->key = REBASE_OR_DUP_OR_NULL(src_kv->key); + dst_kv->value = REBASE_OR_DUP_OR_NULL(src_kv->value); + } + } else { + dst->params = NULL; + } + +#undef REBASE_STR +#undef REBASE_OR_DUP +#undef REBASE_OR_DUP_OR_NULL + +} + +#define FREE(x) {if(x)free((void*)(x));(x)=NULL;} +void adios_transform_clear_spec(struct adios_transform_spec *spec) { + spec->transform_type = adios_transform_none; + + if (!spec->backing_str) { + int i; + FREE(spec->transform_type_str); + for (i = 0; i < spec->param_count; ++i) { + struct adios_transform_spec_kv_pair *kv = &spec->params[i]; + FREE(kv->key); + FREE(kv->value); + } + } else { + spec->transform_type_str = NULL; + } + spec->param_count = 0; + FREE(spec->params); + + spec->backing_str_len = 0; + FREE(spec->backing_str); +} + +void adios_transform_free_spec(struct adios_transform_spec **spec_ptr) { + struct adios_transform_spec *spec = *spec_ptr; + adios_transform_clear_spec(spec); + FREE(*spec_ptr) +} +#undef FREE diff --git a/tests/libs/adios/src/core/transforms/adios_transforms_specparse.h b/tests/libs/adios/src/core/transforms/adios_transforms_specparse.h new file mode 100644 index 0000000000..f5dc64ce26 --- /dev/null +++ b/tests/libs/adios/src/core/transforms/adios_transforms_specparse.h @@ -0,0 +1,61 @@ +/* + * adios_transforms_specparse.h + * + * Created on: May 20, 2013 + * Author: David A. Boyuka II + */ + +#ifndef ADIOS_TRANSFORMS_SPECPARSE_H_ +#define ADIOS_TRANSFORMS_SPECPARSE_H_ + +#include "core/transforms/plugindetect/detect_plugin_types.h" + +struct adios_transform_spec_kv_pair{ + const char *key; + const char *value; +}; + +struct adios_transform_spec { + enum ADIOS_TRANSFORM_TYPE transform_type; + const char *transform_type_str; + + int param_count; + struct adios_transform_spec_kv_pair * params; + + // Internal + int backing_str_len; + char *backing_str; +}; + +/* + * Parses the transform spec string (i.e. transform="zlib:5"), returning a struct + * describing the result + * @param transform_spec_str the transform spec string + * @param pre-allocated struct to fill in; if null this func allocates the memory + * @return the parsed transform spec + */ +struct adios_transform_spec * adios_transform_parse_spec(const char *transform_spec_str, + struct adios_transform_spec *spec_in); + +/* + * Copies a source transform spec struct into an already-allocated + * dest transform spec struct, freeing any buffers previously + * held by the dest struct. After this call, src and dst have the same + * content (though all pointers are independent). + */ +void adios_transform_spec_copy(struct adios_transform_spec *dst, const struct adios_transform_spec *src); + +/* + * Frees all memory held by a adios_transform_spec struct and zeros all fields, + * but does not free the struct itself. + * @param spec the transform spec to free + */ +void adios_transform_clear_spec(struct adios_transform_spec *spec); + +/* + * Frees an adios_transform_spec struct. + * @param spec the transform spec to free + */ +void adios_transform_free_spec(struct adios_transform_spec **spec); + +#endif /* ADIOS_TRANSFORMS_SPECPARSE_H_ */ diff --git a/tests/libs/adios/src/core/transforms/adios_transforms_transinfo.h b/tests/libs/adios/src/core/transforms/adios_transforms_transinfo.h new file mode 100644 index 0000000000..4c8467a6d7 --- /dev/null +++ b/tests/libs/adios/src/core/transforms/adios_transforms_transinfo.h @@ -0,0 +1,35 @@ +/* + * adios_transforms_transinfo.h + * + * Created on: Apr 29, 2014 + * Author: David A. Boyuka II + */ +#ifndef ADIOS_TRANSFORMS_TRANSINFO_H_ +#define ADIOS_TRANSFORMS_TRANSINFO_H_ + +#include + +#include // Internally, always use V2 structs +#include + +// NCSU ALACRITY-ADIOS - struct for original metadata +typedef struct { + int transform_type; // type actually "enum ADIOS_TRANSFORM_TYPE", but this type is not accessible outside ADIOS internals + + uint16_t transform_metadata_len; + void *transform_metadata; + int should_free_transform_metadata; // Used internally by read method and free + + enum ADIOS_DATATYPES orig_type; + + int orig_ndim; + uint64_t *orig_dims; + + int orig_global; + + ADIOS_VARBLOCK *orig_blockinfo; + + ADIOS_TRANSFORM_METADATA *transform_metadatas; +} ADIOS_TRANSINFO; + +#endif /* ADIOS_TRANSFORMS_TRANSINFO_H_ */ diff --git a/tests/libs/adios/src/core/transforms/adios_transforms_util.c b/tests/libs/adios/src/core/transforms/adios_transforms_util.c new file mode 100644 index 0000000000..cc540f7c79 --- /dev/null +++ b/tests/libs/adios/src/core/transforms/adios_transforms_util.c @@ -0,0 +1,69 @@ +#include +#include +#include +#include +#include + +#include "adios_transforms_common.h" +#include "adios_transforms_util.h" +#include "core/adios_internals.h" + +static int buffer_reserve(char ** buffer, uint64_t * buffer_size + ,uint64_t * buffer_offset + ,uint64_t size, uint64_t max_size + ) +{ + if (*buffer_offset + size > *buffer_size || *buffer == 0) + { + if (*buffer_offset + size + 1000 > max_size) { + fprintf (stderr, "Cannot allocate memory in buffer_write. " + "Requested: %llu, Maximum: %llu\n", *buffer_offset + size + 1000, max_size); + return 0; + } + + char * b = realloc (*buffer, *buffer_offset + size + 1000); + if (b) + { + *buffer = b; + *buffer_size = (*buffer_offset + size + 1000); + } + else + { + fprintf (stderr, "Cannot allocate memory in buffer_write. " + "Requested: %llu\n", *buffer_offset + size + 1000); + + return 0; + } + } + return 1; +} + +static int buffer_write (char ** buffer, uint64_t * buffer_size + ,uint64_t * buffer_offset + ,const void * data, uint64_t size, uint64_t max_size + ) +{ + if (!buffer_reserve(buffer, buffer_size, buffer_offset, size, max_size)) + return 0; + + memcpy (*buffer + *buffer_offset, data, size); + *buffer_offset += size; + return 1; +} + + +int shared_buffer_write(struct adios_file_struct *fd, const void * data, uint64_t size) { + return buffer_write(&fd->buffer, &fd->buffer_size, &fd->offset, data, size, fd->write_size_bytes); +} + +int shared_buffer_reserve(struct adios_file_struct *fd, uint64_t size) { + return buffer_reserve(&fd->buffer, &fd->buffer_size, &fd->offset, size, fd->write_size_bytes); +} + +int shared_buffer_mark_written(struct adios_file_struct *fd, uint64_t size) { + if (fd->offset + size > fd->buffer_size) + return 0; + + fd->offset += size; + return 1; +} diff --git a/tests/libs/adios/src/core/transforms/adios_transforms_util.h b/tests/libs/adios/src/core/transforms/adios_transforms_util.h new file mode 100644 index 0000000000..72e8cf4e04 --- /dev/null +++ b/tests/libs/adios/src/core/transforms/adios_transforms_util.h @@ -0,0 +1,22 @@ +/* + * adios_transforms_util.h + * + * Created on: Jul 13, 2012 + * Author: Drew + */ + +#ifndef ADIOS_TRANSFORMS_UTIL_H_ +#define ADIOS_TRANSFORMS_UTIL_H_ + +#include +#include "public/adios_types.h" +#include "core/adios_internals.h" +//#include "adios_internals.h" + + +int shared_buffer_write(struct adios_file_struct *fd, const void * data, uint64_t size); +int shared_buffer_reserve(struct adios_file_struct *fd, uint64_t size); +int shared_buffer_mark_written(struct adios_file_struct *fd, uint64_t size); + + +#endif /* ADIOS_TRANSFORMS_UTIL_H_ */ diff --git a/tests/libs/adios/src/core/transforms/adios_transforms_write.c b/tests/libs/adios/src/core/transforms/adios_transforms_write.c new file mode 100644 index 0000000000..bdd16df23c --- /dev/null +++ b/tests/libs/adios/src/core/transforms/adios_transforms_write.c @@ -0,0 +1,751 @@ + +#include +#include +#include +#include +#include + +#include "core/adios_bp_v1.h" +#include "core/common_adios.h" +#include "core/adios_logger.h" +#include "core/adios_internals.h" +#include "adios_types.h" +#include "core/util.h" + +#include "core/transforms/adios_transforms_hooks_write.h" +#include "core/transforms/adios_transforms_common.h" +#include "core/transforms/adios_transforms_write.h" +#include "core/transforms/adios_transforms_specparse.h" + +//////////////////////////////////////// +// adios_group_size support +//////////////////////////////////////// +#define MIN(X, Y) ((X) < (Y) ? (X) : (Y) ) +#define MAX(X, Y) ((X) > (Y) ? (X) : (Y) ) +uint64_t adios_transform_worst_case_transformed_group_size(uint64_t group_size, struct adios_file_struct *fd) +{ + uint64_t transformed_group_size = group_size; // The upper bound on how much data /might/ be transformed + struct adios_var_struct *cur_var; + + // Aggregated scaling information from all transforms + // The end result upper bound group size is: + // GS' = total_constant_factor + GS' * max_linear_factor + min(GS', max_capped_linear_cap) * max_capped_linear_factor + uint64_t total_constant_factor = 0; + double max_linear_factor = 1; + double max_capped_linear_factor = 0; + uint64_t max_capped_linear_cap = 0; + + // Note: the "max capped linear" component is overestimating by combining the highest factor and cap from all transforms + // A tighter lower bound could be computed by keeping all capped linear caps/factors and doing some sort of overlap + // computation. However, this requires O(n vars) storage and extra logic that isn't worth it, given capped factors are + // very rare, and this method gives a tight bound when none are present. + + for (cur_var = fd->group->vars; cur_var; cur_var = cur_var->next) + { + if (!cur_var->dimensions) // Scalar var + { + // Remove the scalar's size from the group size that can be affected by data transforms, and add it as a constant factor + // Even if it's a string, we don't know the content yet, so use an empty string to get minimum size (we are computing an upper bound) + transformed_group_size -= adios_get_type_size(cur_var->type, ""); + total_constant_factor += adios_get_type_size(cur_var->type, ""); + } + else if (cur_var->transform_type == adios_transform_none) // Non-transformed, non-scalar var + { + // Do nothing + } + else // Transformed var + { + uint64_t constant_factor = 0; + double linear_factor = 1; + double capped_linear_factor = 0; + uint64_t capped_linear_cap = 0; + + // Get the growth factors for this transform method/spec + adios_transform_transformed_size_growth(cur_var, cur_var->transform_spec, &constant_factor, &linear_factor, &capped_linear_factor, &capped_linear_cap); + + // Combine these growth factors into the maximums for computing the worst case + total_constant_factor += constant_factor; + max_linear_factor = MAX(max_linear_factor, linear_factor); + max_capped_linear_factor = MAX(max_capped_linear_factor, capped_linear_factor); + max_capped_linear_cap = MAX(max_capped_linear_cap, capped_linear_cap); + } + } + + const uint64_t max_transformed_group_size = + total_constant_factor + + ceil(max_linear_factor * transformed_group_size) + + ceil(max_capped_linear_factor * MIN(transformed_group_size, max_capped_linear_cap)); + + // Return the maximum worst case for the group size + // (which can never be less than the starting group size) + return MAX(group_size, max_transformed_group_size); +} +#undef MAX + +//////////////////////////////////////// +// Variable conversion to byte array (preparation for transform) +//////////////////////////////////////// + +static void init_dimension_item(struct adios_dimension_item_struct *dimitem) { + dimitem->rank = 0; + dimitem->var = NULL; + dimitem->attr = NULL; + dimitem->time_index = adios_flag_no; +} + +static struct adios_dimension_struct * new_dimension() { + struct adios_dimension_struct *dim = (struct adios_dimension_struct *)malloc(sizeof(struct adios_dimension_struct)); + + init_dimension_item(&dim->dimension); + init_dimension_item(&dim->global_dimension); + init_dimension_item(&dim->local_offset); + dim->next = 0; + return dim; +} + +// TODO: Delete this function when the new version is confirmed working (i.e., tests with FORTRAN writes and C reads, and vice versa, all work) +#if 0 +static int find_time_dimension_old(struct adios_dimension_struct *dim, struct adios_dimension_struct **time_dim, enum ADIOS_FLAG fortran_order_flag) { + struct adios_dimension_struct *cur_dim; + int i; + for (i = 0, cur_dim = dim; cur_dim; cur_dim = cur_dim->next, i++ ) { + if (cur_dim->dimension.time_index == adios_flag_yes) { + if (time_dim) *time_dim = cur_dim; + return i; + } + + // If we're at the last dimension, and we haven't found a time + // dimension yet, check whether the global array is zero; if so, we + // have a time dimension, and must infer the location based on whether + // this is FORTRAN or not + if (!cur_dim->next) { + if (cur_dim->global_dimension.var == NULL && cur_dim->global_dimension.rank == 0) { + if (fortran_order_flag == adios_flag_yes) { + if (time_dim) *time_dim = cur_dim; + return i; + } else if (fortran_order_flag == adios_flag_no) { + if (time_dim) *time_dim = dim; + return 0; + } + } + } + } + + if (time_dim) *time_dim = 0; + return -1; +} +#endif + +static int is_dimension_item_zero(struct adios_dimension_item_struct *dim_item) { + return dim_item->rank == 0 && dim_item->var == NULL && dim_item->attr == NULL; +} + +static int is_time_dimension(struct adios_dimension_struct *dim) { + return dim->dimension.time_index == adios_flag_yes || + dim->global_dimension.time_index == adios_flag_yes || + dim->local_offset.time_index == adios_flag_yes; +} + +#if 0 +// This function is not used anywhere +static int has_time_dimension(struct adios_dimension_struct *dim, int fortran_dim_order) { + int has_time = 0; + struct adios_dimension_struct *first_dim = dim; + struct adios_dimension_struct *last_dim = NULL; + for (; dim != NULL; dim = dim->next) { + last_dim = dim; // This will hold the last non-NULL value of dim + + // If this dimension is explicitly marked as time, then there is a time dimension + if (is_time_dimension(dim)) + has_time = 1; + } + + // If the last dimension has local dimension != 0 and global dimension == 0 (which we infer means there + // is one less global dim than local), and the dimension at the expected time dimension position (first for C, + // last for FORTRAN) has length 1, then we determine there is a time dimension. + // FIXME: This may be affected by the same bug as mentioned near the end of adios_read_bp_is_var_timed + // in read_bp.c, in that this condition is ambiguous for 1D, non-timed, local arrays (if the comment + // in read_bp.c is addressed in the future, remove this one as well). + const struct adios_dimension_struct *candidate_time_dim = (fortran_dim_order ? last_dim : first_dim); + if (!is_dimension_item_zero(&last_dim->dimension) && + is_dimension_item_zero(&last_dim->global_dimension) && + candidate_time_dim->dimension.rank == 1) { + has_time = 1; + } + + return has_time; +} +#endif + +// TODO: Delete this once the replacement is working correctly +// If there is a time dimension the final dimensions will look like this: +// local: t l1 l2 l3 (or l1 l2 l3 t if fortran order) +// global: g1 g2 g3 0 +// offset: o1 o2 o3 0 +#if 0 +static void adios_transform_attach_byte_array_dimensions_old(struct adios_group_struct *grp, struct adios_var_struct *var) { + int i, new_ndim, new_time_dim_pos; + uint64_t ldims[3]; + uint64_t gdims[3]; + uint64_t odims[3]; + + int orig_ndim = count_dimensions(var->pre_transform_dimensions); + int orig_time_dim_pos = find_time_dimension_old(var->pre_transform_dimensions, NULL, grp->adios_host_language_fortran); + + assert(orig_time_dim_pos == -1 || orig_time_dim_pos == 0 || orig_time_dim_pos == orig_ndim - 1); // Time dimension is either first, last, or non-existant + + ldims[0] = 1; // 1 PG ID in length + ldims[1] = 0; // unknown bytes in length + gdims[0] = UINT64_MAX >> 1; // Infinite max PGs + gdims[1] = UINT64_MAX >> 1; // Infinite max bytes + odims[0] = 0; // unknown PG ID + odims[1] = 0; // 0 byte offset + ldims[2] = gdims[2] = odims[2] = 0; // No 3rd dimension, yet + + // If we are writing from a FORTRAN file, we need to reverse the raw dimensions, so that when + // it is read back it is properly swapped to C order + if (grp->adios_host_language_fortran == adios_flag_yes) { + int dummy = -1; + swap_order(2, ldims, &dummy); + swap_order(2, gdims, &dummy); + swap_order(2, odims, &dummy); + } + + // Add the time dimension + if (orig_time_dim_pos == 0) { + ldims[2] = ldims[1]; + ldims[1] = ldims[0]; + ldims[0] = 1; + new_ndim = 3; + new_time_dim_pos = 0; + } else if (orig_time_dim_pos == orig_ndim - 1) { + ldims[2] = 1; + new_ndim = 3; + new_time_dim_pos = 2; + } else { + new_ndim = 2; + new_time_dim_pos = -1; + } + + // Construct the dimension linked list + for (i = 0; i < new_ndim; i++) { + struct adios_dimension_struct *new_dim = new_dimension(); + new_dim->dimension.time_index = (i == new_time_dim_pos) ? adios_flag_yes : adios_flag_no; + new_dim->dimension.rank = ldims[i]; + new_dim->global_dimension.rank = gdims[i]; + new_dim->local_offset.rank = odims[i]; + adios_append_dimension(&var->dimensions, new_dim); + } +} +#endif + +// Attaches to the given variable new metadata defining a 1D local array of bytes. +static void adios_transform_attach_byte_array_dimensions(struct adios_var_struct *var) { + int i; + + //const int fortran_dim_order = (grp->adios_host_language_fortran == adios_flag_yes); + //const int orig_ndim = count_dimensions(var->pre_transform_dimensions); + //const int orig_has_time = has_time_dimension(var->pre_transform_dimensions, fortran_dim_order); + + //const int new_ndim = (orig_has_time ? 2 : 1); // 1D byte array, plus a time dimension if the original had one + //const int new_has_time = orig_has_time; + //const int new_time_dim_pos = (fortran_dim_order ? new_ndim - 1 : 0); // Place the time dimension last for FORTRAN order, first for C order + const int new_ndim = 1; + const int new_has_time = 0; + const int new_time_dim_pos = 0; + + // Construct the dimension linked list + for (i = 0; i < new_ndim; i++) { + struct adios_dimension_struct *new_dim = new_dimension(); + + new_dim->dimension.time_index = (new_has_time && i == new_time_dim_pos) ? adios_flag_yes : adios_flag_no; + + // Clear global dimension/local offset arrays to all 0 to indicate a local array + // For local dimensions, set the time dimension to 1, and the non-time dimension to 0 as a placeholder + new_dim->dimension.rank = (new_has_time && i == new_time_dim_pos) ? 1 : 0; + new_dim->global_dimension.rank = 0; + new_dim->local_offset.rank = 0; + + adios_append_dimension(&var->dimensions, new_dim); + } +} + +static void adios_transform_convert_var_to_byte_array(struct adios_var_struct *var) { + // Save old metadata + var->pre_transform_type = var->type; + var->pre_transform_dimensions = var->dimensions; + + // Convert the type to byte array and clear the dimensions (since they were + // moved and shouldn't be double-referenced) + var->type = adios_byte; + var->dimensions = 0; + + // Attach the new dimension to the variable + adios_transform_attach_byte_array_dimensions(var); +} + +//////////////////////////////////////// +// Definition phase - set up transform parameters +//////////////////////////////////////// + +static int is_scalar(const struct adios_var_struct *var) { + return var->dimensions == NULL; +} + +static int is_timed_scalar(const struct adios_var_struct *var) { + return var->dimensions && // Has first dimension + var->dimensions->next == NULL && // Does not have second dimension + is_time_dimension(var->dimensions) && // The first dimension is a time dimension + is_dimension_item_zero(&var->dimensions->global_dimension); // It's not a global array +} + +/* + * Modifies the given variable's metadata to support the data transform specified by + * orig_var->transform_spec. Also handles error conditions, such as the variable + * being a scalar (which disallows any data transform). + */ +struct adios_var_struct * adios_transform_define_var(struct adios_var_struct *orig_var) { + // First detect error conditions that prevent the transform from being applied + + struct adios_transform_spec *transform_spec = orig_var->transform_spec; + if (!transform_spec) return orig_var; + + // If the variable has a transform, but is a scalar: remove the transform, warn the user, and continue as usual + if (transform_spec->transform_type != adios_transform_none && + (is_scalar(orig_var) || is_timed_scalar(orig_var))) { + log_warn("Data transforms not allowed on scalars, yet variable %s/%s is marked for transform \"%s\"; not applying data transform.\n", + orig_var->path, orig_var->name, transform_spec->transform_type_str); + + orig_var->transform_type = adios_transform_none; + orig_var->transform_spec->transform_type = adios_transform_none; + return orig_var; + } + + // The variable has none of the above errors; apply the transform metadata + + log_debug("Transforming variable %s/%s with type %d\n", orig_var->path, orig_var->name, transform_spec->transform_type); + + // Set transform type and spec + orig_var->transform_type = transform_spec->transform_type; + + // If there is no transform, nothing else to do + if (transform_spec->transform_type == adios_transform_none) + return orig_var; + + // If we get here, transform_type is an actual transformation, so prepare + // the variable. This entails 1) adding a new dimension variable for + // the variable (it will become a 1D byte array), and 2) making the + // variable into a 1D byte array. + + // Convert variable to 1D byte array + adios_transform_convert_var_to_byte_array(orig_var); + log_debug("Data Transforms layer: Converted variable %s into byte array internally\n", orig_var->name); + + // Allocate the transform-specific metadata buffer + orig_var->transform_metadata_len = adios_transform_get_metadata_size(transform_spec); + if (orig_var->transform_metadata_len) + orig_var->transform_metadata = malloc(orig_var->transform_metadata_len); + + // Return the modified variable + return orig_var; +} + +//////////////////////////////////////// +// Write phase - transformed byte array dimension management +//////////////////////////////////////// + +// NCSU ALACRITY-ADIOS - Compute the pre-transform size of a variable, in bytes +// Precondition: var is a non-scalar that has been transformed (transform_type != none) +uint64_t adios_transform_get_pre_transform_var_size(struct adios_var_struct *var) { + assert(var->dimensions); + assert(var->type != adios_string); + assert(var->transform_type != adios_transform_none); + return adios_get_type_size(var->pre_transform_type, NULL) * + adios_get_dimension_space_size(var, + var->pre_transform_dimensions); +} + +/* + * Stores the given transformed data length (number of bytes) into the appropriate place + * in the dimensions array (the non-time local dimension). + */ +static int adios_transform_store_transformed_length(struct adios_file_struct * fd, struct adios_var_struct *var, uint64_t transformed_len) { + struct adios_dimension_struct *dim1, *dim2; + struct adios_dimension_item_struct *byte_length_ldim; + + // Get the first two dimensions (only the first must always exist) + dim1 = var->dimensions; + assert(dim1); + dim2 = dim1->next; + + if (dim1->dimension.time_index == adios_flag_yes) { + // If the first dimension is a time dimension, then the byte array dimension must be the second one + assert(dim2); + byte_length_ldim = &dim2->dimension; + } else { + // Otherwise, either the second dimension is the time dimension, or there is no time dimension + // Either way, the first dimension is the byte array dimension + byte_length_ldim = &dim1->dimension; + } + + // Finally, insert the byte length into the appropriate local dimension "rank" (i.e., as a literal value, + // as opposed to a reference to a scalar/attribute). + byte_length_ldim->rank = transformed_len; + + return 1; +} + +int adios_transform_variable_data(struct adios_file_struct * fd, + struct adios_var_struct *var, + int use_shared_buffer, + int *wrote_to_shared_buffer) { + //printf("[TRANSFORM] Would be doing transform ID %d on variable %s here, if it were implemented\n", var->transform_type, var->name); + //printf("[TRANSFORM] Apparent type of variable is %s, but was originally %s\n", adios_type_to_string_int(var->type), adios_type_to_string_int(var->pre_transform_type)); + //printf("[TRANSFORM] Original size of variable data is %llu\n", adios_transform_get_pre_transform_var_size(fd->group, var)); + + assert(fd); + assert(var); + + if (var->transform_type == adios_transform_none) { + // If no transform is required, do nothing, and delegate payload + // writing to the caller by not using the shared buffer + *wrote_to_shared_buffer = 0; + return 1; + } + + assert(var->type == adios_byte); // Assume byte array + assert(var->transform_type != adios_transform_none); + +#if defined(WITH_NCSU_TIMER) && defined(TIMER_LEVEL) && (TIMER_LEVEL <= 0) + timer_start ("adios_transform_apply"); +#endif + // Transform the data, get the new length + uint64_t transformed_len; + int success = adios_transform_apply(fd, var, &transformed_len, use_shared_buffer, wrote_to_shared_buffer); +#if defined(WITH_NCSU_TIMER) && defined(TIMER_LEVEL) && (TIMER_LEVEL <= 0) + timer_stop ("adios_transform_apply"); +#endif + + if (!success) + return 0; + + // Store the new length in the metadata + adios_transform_store_transformed_length(fd, var, transformed_len); + + return 1; +} + + + +////////////////////////////////////////////////////////////////////////// +// Characteristic support, used in adios_internals.c so cannot be +// in the adios_transforms_common.c, as that isn't always linked +// with adios_internals.c. +////////////////////////////////////////////////////////////////////////// + +// TODO: There are 3 exact copies of this function: +// 1) here, 2) core/adios_internals.c, 3) write/adios_adaptive.c +// Someone should extract to a single copy and make it public via +// a header file. +static void buffer_write (char ** buffer, uint64_t * buffer_size + ,uint64_t * buffer_offset + ,const void * data, uint64_t size + ) +{ + if (*buffer_offset + size > *buffer_size || *buffer == 0) + { + char * b = realloc (*buffer, *buffer_offset + size + 1000); + if (b) + { + *buffer = b; + *buffer_size = (*buffer_offset + size + 1000); + } + else + { + fprintf (stderr, "Cannot allocate memory in buffer_write. " + "Requested: %llu\n", *buffer_offset + size + 1000); + + return; + } + } + + memcpy (*buffer + *buffer_offset, data, size); + *buffer_offset += size; +} + +// Init +int adios_transform_init_transform_var(struct adios_var_struct *var) { + var->transform_type = adios_transform_none; + var->transform_spec = adios_transform_parse_spec("none", NULL); + var->pre_transform_dimensions = 0; + var->pre_transform_type = adios_unknown; + //var->transform_type_param_len = 0; + //var->transform_type_param = 0; + var->transform_metadata_len = 0; + var->transform_metadata = 0; + return 1; +} + +// Serialize +static void adios_transform_dereference_dimensions_characteristic(struct adios_index_characteristic_dims_struct_v1 *dst_char_dims, const struct adios_dimension_struct *src_var_dims) { + uint8_t i; + uint8_t c = count_dimensions(src_var_dims); + + dst_char_dims->count = c; + dst_char_dims->dims = malloc(3 * 8 * c); // (local, global, local offset) * count + assert(dst_char_dims->dims); + uint64_t *ptr = dst_char_dims->dims; + for (i = 0; i < c; i++) + { + // Casts to eliminate const-ness problems + ptr[0] = adios_get_dim_value((struct adios_dimension_item_struct *)&src_var_dims->dimension); + ptr[1] = adios_get_dim_value((struct adios_dimension_item_struct *)&src_var_dims->global_dimension); + ptr[2] = adios_get_dim_value((struct adios_dimension_item_struct *)&src_var_dims->local_offset); + src_var_dims = src_var_dims->next; + ptr += 3; // Go to the next set of 3 + } +} + +static void dereference_dimension_item(struct adios_dimension_item_struct *dst_dim_item, const struct adios_dimension_item_struct *src_dim_item) { + dst_dim_item->var = NULL; + dst_dim_item->attr = NULL; + dst_dim_item->rank = adios_get_dim_value((struct adios_dimension_item_struct *)src_dim_item); + dst_dim_item->time_index = src_dim_item->time_index; +} + +/* + * Takes a given dimension struct (src_var_dims), converts all dimension items to literal + * values by reading the value of any reference scalars/attributes. These literal values + * are stored to a new dimension struct (dst_var_dims) in the "rank" fields. The original + * struct is unchanged. + */ +static void dereference_dimensions_var(struct adios_dimension_struct **dst_var_dims, const struct adios_dimension_struct *src_var_dims) { + uint8_t i; + uint8_t c = count_dimensions(src_var_dims); + + for (i = 0; i < c; i++) { + struct adios_dimension_struct * d_new = + (struct adios_dimension_struct *)malloc(sizeof (struct adios_dimension_struct)); + + // de-reference dimension id + dereference_dimension_item(&d_new->dimension, &src_var_dims->dimension); + dereference_dimension_item(&d_new->global_dimension, &src_var_dims->global_dimension); + dereference_dimension_item(&d_new->local_offset, &src_var_dims->local_offset); + d_new->next = 0; + + adios_append_dimension(dst_var_dims, d_new); + + src_var_dims = src_var_dims->next; + } +} + +static void adios_transform_clean_dimensions(struct adios_index_characteristic_dims_struct_v1 *dst_char_dims) { + dst_char_dims->count = 0; + if (dst_char_dims->dims) + free(dst_char_dims->dims); + dst_char_dims->dims = 0; +} + +static void serialize_transform_type(enum ADIOS_TRANSFORM_TYPE transform_type, + uint64_t *write_length, char **buffer, uint64_t *buffer_size, uint64_t *buffer_offset) { + const char *transform_uid = adios_transform_plugin_uid(transform_type); + const uint8_t transform_uid_len = (uint8_t)strlen(transform_uid); + + // Write the pre-transform datatype + buffer_write(buffer, buffer_size, buffer_offset, &transform_uid_len, 1); + *write_length += 1; + + // Write the number of pre-transform dimensions + buffer_write (buffer, buffer_size, buffer_offset, transform_uid, transform_uid_len); + *write_length += transform_uid_len; +} + +static uint8_t adios_transform_serialize_transform(enum ADIOS_TRANSFORM_TYPE transform_type, + enum ADIOS_DATATYPES pre_transform_type, + const struct adios_index_characteristic_dims_struct_v1 *pre_transform_dimensions, + uint16_t transform_metadata_len, + void *transform_metadata, + uint64_t *write_length, char **buffer, uint64_t *buffer_size, uint64_t *buffer_offset) { + + // Either there is no metadata, or the metadata buffer is non-null + assert(!transform_metadata_len || transform_metadata); + + *write_length = 0; + + // No transform case + if (transform_type == adios_transform_none) + return 0; + + // From this point on, this is an actual transform type + + // Write characteristic flag + uint8_t flag = (uint8_t)adios_characteristic_transform_type; + buffer_write(buffer, buffer_size, buffer_offset, &flag, 1); + *write_length += 1; + + // Write transform type + //buffer_write(buffer, buffer_size, buffer_offset, &transform_type, 1); + //*write_length += 1; + serialize_transform_type(transform_type, write_length, buffer, buffer_size, buffer_offset); + + // Write the pre-transform datatype + buffer_write(buffer, buffer_size, buffer_offset, &pre_transform_type, 1); + *write_length += 1; + + // Write the number of pre-transform dimensions + buffer_write (buffer, buffer_size, buffer_offset, &pre_transform_dimensions->count, 1); + *write_length += 1; + + // Write the length of pre-transform dimension data about to be written + uint16_t len = 3 * 8 * pre_transform_dimensions->count; + buffer_write (buffer, buffer_size, buffer_offset, &len, 2); + *write_length += 2; + + // Write the pre-transform dimensions + buffer_write (buffer, buffer_size, buffer_offset, pre_transform_dimensions->dims, len); + *write_length += len; + + buffer_write (buffer, buffer_size, buffer_offset, &transform_metadata_len, 2); + *write_length += 2; + + if (transform_metadata_len) { + buffer_write (buffer, buffer_size, buffer_offset, transform_metadata, transform_metadata_len); + *write_length += transform_metadata_len; + } + + return 1; // Return that we wrote 1 characteristic flag +} + +uint8_t adios_transform_serialize_transform_characteristic(const struct adios_index_characteristic_transform_struct *transform, uint64_t *write_length, + char **buffer, uint64_t *buffer_size, uint64_t *buffer_offset) { + return adios_transform_serialize_transform( + transform->transform_type, transform->pre_transform_type, &transform->pre_transform_dimensions, + transform->transform_metadata_len, transform->transform_metadata, + write_length, buffer, buffer_size, buffer_offset + ); +} + +uint8_t adios_transform_serialize_transform_var(const struct adios_var_struct *var, uint64_t *write_length, + char **buffer, uint64_t *buffer_size, uint64_t *buffer_offset) { + + // In this case, we are going to actually serialize the dimensions as a + // adios_index_characteristic_dims_struct_v1, but it is currently in the + // form of an adios_dimension_struct. We must convert here before passing + // to the common serialization routine. + + struct adios_index_characteristic_dims_struct_v1 tmp_dims; + adios_transform_dereference_dimensions_characteristic(&tmp_dims, var->pre_transform_dimensions); + + // Perform the serialization using the common function with the temp dimension structure + uint8_t char_write_count = + adios_transform_serialize_transform( + var->transform_type, var->pre_transform_type, &tmp_dims, + var->transform_metadata_len, var->transform_metadata, + write_length, buffer, buffer_size, buffer_offset + ); + + // Free the temp dimension structure + adios_transform_clean_dimensions(&tmp_dims); + + return char_write_count; +} + +// Clear +int adios_transform_clear_transform_var(struct adios_var_struct *var) { + var->transform_type = adios_transform_none; + if (var->transform_spec) + adios_transform_free_spec(&var->transform_spec); // Also clears to 0 + + var->pre_transform_type = 0; + + // Frees and zeros-out pre_transform_dimensions (since last ->next is 0) + while (var->pre_transform_dimensions) + { + struct adios_dimension_struct * dimensions = var->pre_transform_dimensions->next; + free(var->pre_transform_dimensions); + var->pre_transform_dimensions = dimensions; + } + + // Free/clear transform-specific metadata + var->transform_metadata_len = 0; + if (var->transform_metadata) + free(var->transform_metadata); + var->transform_metadata = 0; + + return 1; // Return success +} + +// Copy +int adios_transform_copy_transform_characteristic(struct adios_index_characteristic_transform_struct *dst_transform, const struct adios_var_struct *src_var) { + adios_transform_init_transform_characteristic(dst_transform); + + dst_transform->transform_type = src_var->transform_type; + dst_transform->pre_transform_type = src_var->pre_transform_type; + + // Note: the & on the first arg and not the second is intentional (the first isn't a pointer by itself, the second is) + adios_transform_dereference_dimensions_characteristic(&dst_transform->pre_transform_dimensions, src_var->pre_transform_dimensions); + + dst_transform->transform_metadata_len = src_var->transform_metadata_len; + if (src_var->transform_metadata_len) { + dst_transform->transform_metadata = malloc(src_var->transform_metadata_len); + memcpy(dst_transform->transform_metadata, src_var->transform_metadata, src_var->transform_metadata_len); + } else { + dst_transform->transform_metadata = 0; + } + + return 1; +} + +int adios_transform_copy_var_transform(struct adios_var_struct *dst_var, const struct adios_var_struct *src_var) { + adios_transform_init_transform_var(dst_var); + // Clean out the "none" transform spec added in adios_transform_init_transform_var + if (dst_var->transform_spec) + adios_transform_free_spec(&dst_var->transform_spec); + + // Copy simple fields + dst_var->transform_type = src_var->transform_type; + dst_var->pre_transform_type = src_var->pre_transform_type; + + // Dereferemce all dimensions, forcing them to be literal values ("rank" fields), as + // required by the function that calls this, adios_copy_var_written(). + dereference_dimensions_var(&dst_var->pre_transform_dimensions, src_var->pre_transform_dimensions); + + // Copy transform spec structure + if (!dst_var->transform_spec) + dst_var->transform_spec = adios_transform_parse_spec("none", NULL); + adios_transform_spec_copy(dst_var->transform_spec, src_var->transform_spec); + + // Copy any transform-specific metadata + dst_var->transform_metadata_len = src_var->transform_metadata_len; + if (src_var->transform_metadata_len && src_var->transform_metadata) { + dst_var->transform_metadata = bufdup(src_var->transform_metadata, 1, src_var->transform_metadata_len); + } else { + dst_var->transform_metadata = 0; + } + + return 1; +} + + +static uint64_t calc_transform_uid_overhead(struct adios_var_struct *var) { + assert(var->transform_type != adios_transform_none && var->transform_type != adios_transform_unknown); + + const char *transform_uid = adios_transform_plugin_uid(var->transform_type); + return 1 + // For the length of the UID string + strlen(transform_uid); // The UID string itself +} + +// Calculate overhead +uint64_t adios_transform_calc_transform_characteristic_overhead(struct adios_var_struct *var) { + if (var->transform_type == adios_transform_none) { + return 0; // No overhead needed, since the characteristic won't be written at all + } else { + return 1 + // For characterstic flag + //1 + // For transform_type field // no longer used, replaced by transform UID + calc_transform_uid_overhead(var) + // For the transform UID (serialized form of transform type) + 1 + // For pre_transform_type field + adios_calc_var_characteristics_dims_overhead(var->pre_transform_dimensions) + // For pre-transform dimensions field + 2 + // For transform_metadata_len + var->transform_metadata_len; // For transform_metadata + } +} diff --git a/tests/libs/adios/src/core/transforms/adios_transforms_write.h b/tests/libs/adios/src/core/transforms/adios_transforms_write.h new file mode 100644 index 0000000000..a947d528da --- /dev/null +++ b/tests/libs/adios/src/core/transforms/adios_transforms_write.h @@ -0,0 +1,96 @@ +/* + * Contains write-specific code for handling variable transforms in ADIOS + * + * Created on: Jun 27, 2012 + * Author: David A. Boyuka II + */ + +#ifndef ADIOS_TRANSFORMS_WRITE_H_ +#define ADIOS_TRANSFORMS_WRITE_H_ + +#include "core/adios_bp_v1.h" +#include "core/adios_internals.h" +#include "core/transforms/adios_transforms_common.h" + +/* + * Returns the pre-transform size, in bytes, of a variable. Note: only works on + * "dimensioned" variables (i.e., not a scalar or a string). + * @param var the variable to examine + * @return the pre-transform size, in bytes, of var + */ +uint64_t adios_transform_get_pre_transform_var_size(struct adios_var_struct *var); + +/* + * Modifies the variable definition appropriately for the case that the variable + * is to be transformed. In the current implementation, this includes converting + * the variable type to a byte array, storing the old dimension/type metadata, + * and setting appropriate flag fields. + * + * Note: the transform to be applied is assumed to be specified in orig_var->transform_spec. + */ +struct adios_var_struct * adios_transform_define_var(struct adios_var_struct *orig_var); + +/* + * Transforms a given variable orig_var via the given transform type. + * + * If use_shared_buffer is true, this function is permitted to write directly + * to the shared buffer associated with fd (i.e. fd->buffer). It will treat the + * buffer correctly, using the buffer_write function call or similar to update + * offsets and allocate memory as needed. + * + * If use_shared_buffer is true, this function will update + * wrote_to_shared_buffer to indicate whether the shared buffer was actually + * used. If not, the calling function must make the necessary copies from + * var->data. If use_shared_buffer is false, wrote_to_shared_buffer will + * not be changed. + * + * Note: var->free_data will be set to adios_flag_yes iff a new buffer is + * malloced and should later be freed by ADIOS. + * + * @param fd the file descriptor containing the variable to transform + * @param var the variable whose data should be transformed (var->data) + * @param use_shared_buffer a pointer to a boolean dictating whether the shared + * buffer may be directly written to. + * @param wrote_to_shared_buffer a pointer to a boolean that should be updated + * indicating whether the transform method actually used the shared + * buffer (if not, the caller will manually copy var->data to the shared + * buffer). This must never be true if use_shared_buffer is false. + * @return true for success, false otherwise + */ +int adios_transform_variable_data(struct adios_file_struct * fd, + struct adios_var_struct *var, + int use_shared_buffer, + int *wrote_to_shared_buffer); + +/* + * Computes the worse-case required group size for an entire group. + * Checks all variables in the group to find which transform types are used, + * and chooses the worst of the worst-case group sizes to return. + */ +uint64_t adios_transform_worst_case_transformed_group_size(uint64_t group_size, struct adios_file_struct *fd); + +////////////////////////////////////////////////// +// Transform characteristic management functions +////////////////////////////////////////////////// + +// Init +int adios_transform_init_transform_var(struct adios_var_struct *var); + +// Serialize +// Returns number of characteristic flags written, outputs write_length, writes to buffer +uint8_t adios_transform_serialize_transform_characteristic(const struct adios_index_characteristic_transform_struct *transform, uint64_t *write_length, + char **buffer, uint64_t *buffer_size, uint64_t *buffer_offset); +uint8_t adios_transform_serialize_transform_var(const struct adios_var_struct *var, uint64_t *write_length, + char **buffer, uint64_t *buffer_size, uint64_t *buffer_offset); + +// Clear +int adios_transform_clear_transform_var(struct adios_var_struct *var); + +// Copy +int adios_transform_copy_transform_characteristic(struct adios_index_characteristic_transform_struct *dst_transform, const struct adios_var_struct *src_var); +int adios_transform_copy_var_transform(struct adios_var_struct *dst_var, const struct adios_var_struct *src_var); + +// Calculate overhead +uint64_t adios_transform_calc_transform_characteristic_overhead(struct adios_var_struct *var); + +#endif /* ADIOS_TRANSFORMS_WRITE_H_ */ diff --git a/tests/libs/adios/src/core/transforms/plugindetect/detect_plugin_infos.h b/tests/libs/adios/src/core/transforms/plugindetect/detect_plugin_infos.h new file mode 100644 index 0000000000..c382523be6 --- /dev/null +++ b/tests/libs/adios/src/core/transforms/plugindetect/detect_plugin_infos.h @@ -0,0 +1,75 @@ +/* + * detect_plugin_infos.h + * + * Builds the plugin info and XML alias tables. + * These tables default to being called "ADIOS_TRANSFORM_METHOD_INFOS" and + * "ADIOS_TRANSFORM_METHOD_ALIASES", respectively; this can be changed by + * defining these names as macros before #include'ing this file. + * + * This code is rather ugly, but it's necessary to enable the type of easy + * plugin registration that is achieved without resorting to Autotools + * magic, which looks even worse. + * + * Created on: Feb 15, 2013 + * Author: David A. Boyuka II + */ + +#ifndef DETECT_PLUGIN_INFOS_H_ +#define DETECT_PLUGIN_INFOS_H_ + +#include "core/transforms/adios_transforms_hooks.h" +#include "core/transforms/plugindetect/plugin_info_types.h" + +// +// Helper macros +// + +// Define some helper macros that define the record format for the +// info and aliases tables +#define _PLUGIN_INFO_RECORD(TYPEID, UID, DESC) \ + { adios_transform_##TYPEID, UID, DESC }, + +#define _ARRAYLEN(arr) (sizeof(arr)/sizeof(arr[0])) +#define _PLUGIN_ALIASES_RECORD(TYPEID, XMLALIAS) \ + { adios_transform_##TYPEID, (const char *)(XMLALIAS) }, + +// +// Actual table building +// + +// Build the info table + +// Define the registration macro +#define REGISTER_TRANSFORM_PLUGIN(TYPEID, XMLALIAS, UID, DESC) \ + _PLUGIN_INFO_RECORD(TYPEID, UID, DESC) + +adios_transform_plugin_info_t ADIOS_TRANSFORM_METHOD_INFOS[] = { + REGISTER_TRANSFORM_PLUGIN(none, "none", "none", "No data transform") + + #include "transforms/transform_plugins.h" // Include rows based on the plugin register statements +}; + +// Undef the registration macro +#undef REGISTER_TRANSFORM_PLUGIN + +// Build the XML alias table + +// Define the registration macro +#define REGISTER_TRANSFORM_PLUGIN(TYPEID, XMLALIAS, UID, DESC) \ + _PLUGIN_ALIASES_RECORD(TYPEID, XMLALIAS) + +adios_transform_plugin_xml_aliases_t ADIOS_TRANSFORM_METHOD_ALIASES[] = { + REGISTER_TRANSFORM_PLUGIN(none, "none", "none", "No data transform") + + #include "transforms/transform_plugins.h" // Include rows based on the plugin register statements +}; + +// Undef the registration macro +#undef REGISTER_TRANSFORM_PLUGIN + +// Clean up macros +#undef _PLUGIN_INFO_RECORD +#undef _PLUGIN_ALIASES_RECORD +#undef _ARRAYLEN + +#endif /* DETECT_PLUGIN_INFOS_H_ */ diff --git a/tests/libs/adios/src/core/transforms/plugindetect/detect_plugin_read_hook_decls.h b/tests/libs/adios/src/core/transforms/plugindetect/detect_plugin_read_hook_decls.h new file mode 100644 index 0000000000..c7dffa1093 --- /dev/null +++ b/tests/libs/adios/src/core/transforms/plugindetect/detect_plugin_read_hook_decls.h @@ -0,0 +1,29 @@ +/* + * detect_plugin_read_hooks.h + * + * Using the plugin registry, (src/transforms/transform_plugins.h), generates + * declarations of transform plugin read-side hooks. + * + * Created on: Apr 1, 2013 + * Author: David A. Boyuka II + */ + +#ifndef DETECT_PLUGIN_READ_HOOK_DECLS_H_ +#define DETECT_PLUGIN_READ_HOOK_DECLS_H_ + +// NOTE: Uses the DECLARE_TRANSFORM_READ_METHOD macro from this include +// NOTE: Uses the DECLARE_TRANSFORM_READ_METHOD_UNIMPL macro from this include +#include "src/core/transforms/adios_transforms_hooks_read.h" + +// SETUP - Set up detection macro +#define REGISTER_TRANSFORM_PLUGIN(TYPEID, XMLALIAS, UID, DESC) \ + DECLARE_TRANSFORM_READ_METHOD(TYPEID) // From adios_transforms_hooks_read.h + +// DETECT +DECLARE_TRANSFORM_READ_METHOD_UNIMPL(none); // Declare a stub for the "none" method +#include "transforms/transform_plugins.h" // Translate plugin register entries into function declarations + +// CLEANUP - Clean up macro +#undef REGISTER_TRANSFORM_PLUGIN + +#endif /* DETECT_PLUGIN_READ_HOOK_DECLS_H_ */ diff --git a/tests/libs/adios/src/core/transforms/plugindetect/detect_plugin_read_hook_reg.h b/tests/libs/adios/src/core/transforms/plugindetect/detect_plugin_read_hook_reg.h new file mode 100644 index 0000000000..62e0ab0837 --- /dev/null +++ b/tests/libs/adios/src/core/transforms/plugindetect/detect_plugin_read_hook_reg.h @@ -0,0 +1,32 @@ +/* + * detect_plugin_read_hooks.h + * + * Using the plugin registry, (src/transforms/transform_plugins.h), builds the + * table of transform plugin read-side hooks. This should be included + * inside a C file, as it defines a global table with memory. + * + * Created on: Apr 1, 2013 + * Author: David A. Boyuka II + */ + +#ifndef DETECT_PLUGIN_READ_HOOKS_H_ +#define DETECT_PLUGIN_READ_HOOKS_H_ + +// INPUT MACRO: Plugins will be registered in the table TRANSFORM_READ_METHODS + +// NOTE: Uses the adios_transform_read_method struct from this include +// NOTE: Uses the REGISTER_TRANSFORM_READ_METHOD_HOOKS macro from this include +#include "src/core/transforms/adios_transforms_hooks_read.h" + +// SETUP - Set up detection macro +#define REGISTER_TRANSFORM_PLUGIN(TYPEID, XMLALIAS, UID, DESC) \ + REGISTER_TRANSFORM_READ_METHOD_HOOKS(TRANSFORM_READ_METHODS, TYPEID, adios_transform_##TYPEID) // From adios_transforms_hooks_read.h + +// DETECT +REGISTER_TRANSFORM_READ_METHOD_HOOKS(TRANSFORM_READ_METHODS, none, adios_transform_none); // Stub for "none" method +#include "transforms/transform_plugins.h" // Translate plugin register entries into function declarations + +// CLEANUP - Clean up macro +#undef REGISTER_TRANSFORM_PLUGIN + +#endif /* DETECT_PLUGIN_READ_HOOKS_H_ */ diff --git a/tests/libs/adios/src/core/transforms/plugindetect/detect_plugin_types.h b/tests/libs/adios/src/core/transforms/plugindetect/detect_plugin_types.h new file mode 100644 index 0000000000..59d7c1cda4 --- /dev/null +++ b/tests/libs/adios/src/core/transforms/plugindetect/detect_plugin_types.h @@ -0,0 +1,32 @@ +/* + * detect_plugin_types.h + * + * Using the plugin registry, (src/transforms/transform_plugins.h), builds the + * ADIOS_TRANSFORM_TYPE enum, including the standard "unknown", "none", and + * "num_transform_types" entries. + * + * Created on: Feb 15, 2013 + * Author: David A. Boyuka II + */ + +#ifndef DETECT_PLUGIN_TYPES_H_ +#define DETECT_PLUGIN_TYPES_H_ + +// Set up detection macro +#define REGISTER_TRANSFORM_PLUGIN(TYPEID, XMLALIAS, UID, DESC) \ + adios_transform_##TYPEID, + +// Build the enum table +enum ADIOS_TRANSFORM_TYPE { + adios_transform_unknown = -1, + adios_transform_none = 0, + + #include "transforms/transform_plugins.h" // Translate plugin register entries into enum entries + + num_adios_transform_types // Not counting unknown +}; + +// Clean up macro +#undef REGISTER_TRANSFORM_PLUGIN + +#endif /* DETECT_PLUGIN_TYPES_H_ */ diff --git a/tests/libs/adios/src/core/transforms/plugindetect/detect_plugin_write_hook_decls.h b/tests/libs/adios/src/core/transforms/plugindetect/detect_plugin_write_hook_decls.h new file mode 100644 index 0000000000..246d26b2ae --- /dev/null +++ b/tests/libs/adios/src/core/transforms/plugindetect/detect_plugin_write_hook_decls.h @@ -0,0 +1,29 @@ +/* + * detect_plugin_write_hooks.h + * + * Using the plugin registry, (src/transforms/transform_plugins.h), generates + * declarations of transform plugin write-side hooks. + * + * Created on: Apr 1, 2013 + * Author: David A. Boyuka II + */ + +#ifndef DETECT_PLUGIN_WRITE_HOOK_DECLS_H_ +#define DETECT_PLUGIN_WRITE_HOOK_DECLS_H_ + +// NOTE: Uses the DECLARE_TRANSFORM_WRITE_METHOD macro from this include +// NOTE: Uses the DECLARE_TRANSFORM_WRITE_METHOD_UNIMPL macro from this include +#include "src/core/transforms/adios_transforms_hooks_write.h" + +// SETUP - Set up detection macro +#define REGISTER_TRANSFORM_PLUGIN(TYPEID, XMLALIAS, UID, DESC) \ + DECLARE_TRANSFORM_WRITE_METHOD(TYPEID) // From adios_transforms_hooks_write.h + +// DETECT +DECLARE_TRANSFORM_WRITE_METHOD_UNIMPL(none); // Declare a stub for the "none" method +#include "transforms/transform_plugins.h" // Translate plugin register entries into function declarations + +// CLEANUP - Clean up macro +#undef REGISTER_TRANSFORM_PLUGIN + +#endif /* DETECT_PLUGIN_WRITE_HOOK_DECLS_H_ */ diff --git a/tests/libs/adios/src/core/transforms/plugindetect/detect_plugin_write_hook_reg.h b/tests/libs/adios/src/core/transforms/plugindetect/detect_plugin_write_hook_reg.h new file mode 100644 index 0000000000..7d49597c12 --- /dev/null +++ b/tests/libs/adios/src/core/transforms/plugindetect/detect_plugin_write_hook_reg.h @@ -0,0 +1,32 @@ +/* + * detect_plugin_write_hooks.h + * + * Using the plugin registry, (src/transforms/transform_plugins.h), builds the + * table of transform plugin write-side hooks. This should be included + * inside a C file, as it defines a global table with memory. + * + * Created on: Apr 1, 2013 + * Author: David A. Boyuka II + */ + +#ifndef DETECT_PLUGIN_WRITE_HOOKS_H_ +#define DETECT_PLUGIN_WRITE_HOOKS_H_ + +// INPUT MACRO: Plugins will be registered in the table TRANSFORM_WRITE_METHODS + +// NOTE: Uses the adios_transform_write_method struct from this include +// NOTE: Uses the REGISTER_TRANSFORM_WRITE_METHOD_HOOKS macro from this include +#include "src/core/transforms/adios_transforms_hooks_write.h" + +// SETUP - Set up detection macro +#define REGISTER_TRANSFORM_PLUGIN(TYPEID, XMLALIAS, UID, DESC) \ + REGISTER_TRANSFORM_WRITE_METHOD_HOOKS(TRANSFORM_WRITE_METHODS, TYPEID, adios_transform_##TYPEID) // From adios_transforms_hooks_write.h + +// DETECT +REGISTER_TRANSFORM_WRITE_METHOD_HOOKS(TRANSFORM_WRITE_METHODS, none, adios_transform_none); // Stub for "none" method +#include "transforms/transform_plugins.h" // Translate plugin register entries into function declarations + +// CLEANUP - Clean up macro +#undef REGISTER_TRANSFORM_PLUGIN + +#endif /* DETECT_PLUGIN_WRITE_HOOKS_H_ */ diff --git a/tests/libs/adios/src/core/transforms/plugindetect/plugin_info_types.h b/tests/libs/adios/src/core/transforms/plugindetect/plugin_info_types.h new file mode 100644 index 0000000000..8ca9cfd406 --- /dev/null +++ b/tests/libs/adios/src/core/transforms/plugindetect/plugin_info_types.h @@ -0,0 +1,23 @@ +/* + * plugin_info_types.h + * + * Created on: Feb 15, 2013 + * Author: David A. Boyuka II + */ + +#ifndef PLUGIN_INFO_TYPES_H_ +#define PLUGIN_INFO_TYPES_H_ + +typedef struct { + enum ADIOS_TRANSFORM_TYPE type; + const char *uid; + const char *description; +} adios_transform_plugin_info_t; + +typedef struct { + enum ADIOS_TRANSFORM_TYPE type; + + const char *xmlAlias; +} adios_transform_plugin_xml_aliases_t; + +#endif /* PLUGIN_INFO_TYPES_H_ */ diff --git a/tests/libs/adios/src/core/util.c b/tests/libs/adios/src/core/util.c new file mode 100644 index 0000000000..7b48a9e6e1 --- /dev/null +++ b/tests/libs/adios/src/core/util.c @@ -0,0 +1,661 @@ +#include +#include +#include +#include +#include +#include +#include + +#include "config.h" +#include "core/util.h" +#include "core/bp_utils.h" +#include "core/adios_endianness.h" +#include "core/adios_logger.h" + +/* Reverse the order in an array in place. + use swapping from Fortran/column-major order to ADIOS-read-api/C/row-major order and back +*/ +void swap_order(int n, uint64_t *array, int *timedim) +{ + int i; + uint64_t tmp; + for (i=0; i -1) + *timedim = (n-1) - *timedim; // swap the time dimension too +} + +/* Change endianness of each element in an array */ +/* input: array, size in bytes(!), size of one element */ +void change_endianness( void *data, uint64_t slice_size, enum ADIOS_DATATYPES type) +{ + int size_of_type = bp_get_type_size(type, ""); + uint64_t n = slice_size / size_of_type; + uint64_t i; + char *ptr = (char *) data; + + if (slice_size % size_of_type != 0) { + log_error ("Adios error in bp_utils.c:change_endianness(): " + "An array's endianness is to be converted but the size of array " + "is not dividable by the size of the elements: " + "size = %lld, element size = %d\n", slice_size, size_of_type); + } + + switch (type) + { + case adios_byte: + case adios_short: + case adios_integer: + case adios_long: + case adios_unsigned_byte: + case adios_unsigned_short: + case adios_unsigned_integer: + case adios_unsigned_long: + case adios_real: + case adios_double: + case adios_long_double: + switch (size_of_type) { + /* case 1: nothing to do */ + case 2: + for (i=0; i < n; i++) { + swap_16_ptr(ptr); + ptr += size_of_type; + } + break; + case 4: + for (i=0; i < n; i++) { + swap_32_ptr(ptr); + ptr += size_of_type; + } + break; + case 8: + for (i=0; i < n; i++) { + swap_64_ptr(ptr); + ptr += size_of_type; + } + break; + case 16: + for (i=0; i < n; i++) { + swap_128_ptr(ptr); + ptr += size_of_type; + } + break; + } + break; + + case adios_complex: + for (i=0; i < n; i++) { + swap_32_ptr(ptr); // swap REAL part 4 bytes + swap_32_ptr(ptr+4); // swap IMG part 4 bytes + ptr += size_of_type; + } + break; + + case adios_double_complex: + for (i=0; i < n; i++) { + swap_64_ptr(ptr); // swap REAL part 8 bytes + swap_64_ptr(ptr+8); // swap IMG part 8 bytes + ptr += size_of_type; + } + break; + + case adios_string: + default: + /* nothing to do */ + break; + } +} + +void copy_data (void *dst, void *src, + int idim, + int ndim, + uint64_t* size_in_dset, + uint64_t* ldims, + const uint64_t * readsize, + uint64_t dst_stride, + uint64_t src_stride, + uint64_t dst_offset, + uint64_t src_offset, + uint64_t ele_num, + int size_of_type, + enum ADIOS_FLAG change_endiness, + enum ADIOS_DATATYPES type + ) +{ + unsigned int i, j; + uint64_t dst_offset_new=0; + uint64_t src_offset_new=0; + uint64_t src_step, dst_step; + if (ndim-1==idim) { + for (i=0;inext = NULL; + + return; + } + + while (head->next) + { + head = head->next; + } + + head->next = q; + q->next = NULL; + + return; +} + +void list_append_read_request_list (read_request ** h, read_request * q) +{ + read_request * head; + if (!h || !q) + { + printf ("Error: list_append_read_request_list: h: %d, q: %d\n", h == 0, q == 0); + return; + } + + head = * h; + if (!head) + { + * h = q; + return; + } + + while (head->next) + { + head = head->next; + } + + head->next = q; + + return; +} + +void list_insert_read_request_next (read_request ** h, read_request * q) +{ + read_request * head; + if (!h || !q) + { + printf ("Error: list_insert_read_request_next cannot handle NULL parameters ()\n"); + return; + } + + head = * h; + if (!head) + { + * h = q; + q->next = NULL; + } + else + { + // NCSU ALACRITY-ADIOS: Fixed this prepend ordering bug. Previously, prepending A, B, C, D would produce + // [A, D, C, B], which causes poor seek performance for the Transforms layer versus raw Transport layer + // due to backwards seeks. The fixed code now properly produces [D, C, B, A] + + //q->next = head->next; + //head->next = q; + q->next = head; + *h = q; + } + + return; +} + + +void list_free_read_request (read_request * h) +{ + read_request * n; + + while (h) + { + n = h->next; + + free_selection (h->sel); + if (h->priv) + { + free (h->priv); + h->priv = 0; + } + free (h); + h = n; + } +} + +int list_get_length (read_request * h) +{ + int l = 0; + + while (h) + { + h = h->next; + l++; + } + + return l; +} + +read_request * copy_read_request (const read_request * r) +{ + read_request * newreq; + + newreq = (read_request *) malloc (sizeof (read_request)); + assert (newreq); + + newreq->sel = copy_selection (r->sel); + newreq->varid = r->varid; + newreq->from_steps = r->from_steps; + newreq->nsteps = r->nsteps; + newreq->data = r->data; + newreq->datasize = r->datasize; + newreq->priv = r->priv; + newreq->next = 0; + + return newreq; +} + +ADIOS_SELECTION * copy_selection (const ADIOS_SELECTION * sel) +{ + ADIOS_SELECTION * nsel; + + nsel = (ADIOS_SELECTION *) malloc (sizeof (ADIOS_SELECTION)); + assert (nsel); + + nsel->type = sel->type; + + if (sel->type == ADIOS_SELECTION_BOUNDINGBOX) + { + nsel->u.bb.ndim = sel->u.bb.ndim; + nsel->u.bb.start = (uint64_t *) malloc (sel->u.bb.ndim * 8); + nsel->u.bb.count = (uint64_t *) malloc (sel->u.bb.ndim * 8); + assert (nsel->u.bb.start && nsel->u.bb.count); + + memcpy (nsel->u.bb.start, sel->u.bb.start, sel->u.bb.ndim * 8); + memcpy (nsel->u.bb.count, sel->u.bb.count, sel->u.bb.ndim * 8); + } + else if (sel->type == ADIOS_SELECTION_POINTS) + { + nsel->u.points.ndim = sel->u.points.ndim; + nsel->u.points.npoints = sel->u.points.npoints; + nsel->u.points.points = (uint64_t *) malloc (nsel->u.points.npoints * nsel->u.points.ndim * 8); + assert (nsel->u.points.points); + + memcpy (nsel->u.points.points, sel->u.points.points, sel->u.points.npoints * sel->u.points.ndim * 8); + } + else if (sel->type == ADIOS_SELECTION_WRITEBLOCK) + { + nsel->u.block.index = sel->u.block.index; + // NCSU ALACRITY-ADIOS: Copy the new fields + nsel->u.block.is_absolute_index = sel->u.block.is_absolute_index; + nsel->u.block.is_sub_pg_selection = sel->u.block.is_sub_pg_selection; + nsel->u.block.element_offset = sel->u.block.element_offset; + nsel->u.block.nelements = sel->u.block.nelements; + } + else if (sel->type == ADIOS_SELECTION_AUTO) + { + //TODO + } + else + { + //adios_error (err_invalid_argument, "Wrong ADIOS selection type.\n"); + } + + return nsel; +} + +void free_selection (ADIOS_SELECTION * sel) +{ + sel->type = sel->type; + + if (sel->type == ADIOS_SELECTION_BOUNDINGBOX) + { + free (sel->u.bb.start); + free (sel->u.bb.count); + } + else if (sel->type == ADIOS_SELECTION_POINTS) + { + free (sel->u.points.points); + } + + free (sel); +} + +int unique (uint32_t * nids, int size) +{ + int i, j, k; + uint32_t temp; + + // sort the nids first + for (i = 1; i < size; i++) + { + for (j = 0; j < size - i; j++) + { + if (nids[j] > nids[j + 1]) + { + temp = nids[j]; + nids[j] = nids[j + 1]; + nids[j + 1] = temp; + } + } + } + + // remove duplicates + i = 0; + k = 0; + while (i < size) + { + nids[k] = nids[i]; + + j = i + 1; + while (j < size && nids[i] == nids[j]) + { + j++; + } + + if (j < size) + { + k++; + i = j; + } + else + { + break; + } + } + + return k + 1; +} + +uint32_t nid_atoi () +{ + int name_len; + char * nid_str, * str_buf = malloc (MPI_MAX_PROCESSOR_NAME); + uint32_t nid; + + MPI_Get_processor_name (str_buf, &name_len); + nid_str = str_buf; + while (*nid_str != '\0' && (!isdigit (*nid_str) || *nid_str == '0')) + { + nid_str++; + } + + if (*nid_str == '\0') + { + // report an error + } + + nid = atoi (nid_str); + free (str_buf); + + return nid; +} + +// This helper routine returns a vector of unique NID's. +// It is caller's responsiblity to free nids afterwards. +int get_unique_nids (MPI_Comm comm, uint32_t ** nids) +{ + int size; + uint32_t my_nid; + + my_nid = nid_atoi (); + MPI_Comm_size (comm, &size); + * nids = (uint32_t *) malloc (size * 4); + assert (* nids); + + MPI_Allgather (&my_nid, 1, MPI_INT, + *nids, 1, MPI_INT, + comm); + return unique (*nids, size); +} + +/******************************************************* + Processing parameter lists +**********************************************************/ +static char * remove_whitespace (char *start, char *end) +{ + char *s = start; + char *e = end; + //int orig_len = (int) (e-s); + int final_len; + char *res; + // remove front whitespace (but do not go far beyond the end) + while (s <= e && + (*s==' ' || *s=='\t' || *s=='\n') + ) s++; + if (s <= e) { // there is some text + // remove tail whitespace + while (s <= e && + (*e==' ' || *e=='\t' || *e=='\n') + ) e--; + // create result + final_len = e - s + 1; // length of result + if (final_len > 0) { + res = (char *) malloc (final_len + 1); // allocate space s..e and \0 + memcpy(res, s, final_len); + res[final_len] = 0; + } else { + // " = something" patterns end here + res = NULL; + } + } else { + // no non-whitespace character found + res = NULL; + } + return res; +} + + +/* Split a line at = sign into name and value pair + Remove " ", TAB and Newline from around names and values + Return NULL for name and value if there is no = sign in line + Return newly allocated strings otherwise + Used by: esimmon_internal_text_to_name_value_pairs + */ +static void splitnamevalue (const char * line, int linelen, char **name, char **value) +{ + char *equal; // position of first = sign in line + + equal = strchr (line, '='); + if (equal && equal != line) { + /* 1. name */ + // from first char to before = + *name = remove_whitespace ((char*)line, equal-1); + //printf (" --name=[%s]\n", *name); + /* 2. value */ + // from after = to the last character of line + *value = remove_whitespace (equal+1, (char*)line+linelen-1); + //printf (" --value=[%s]\n", *value); + + } else if (equal != line) { + /* check if it as name without = value statement */ + *name = remove_whitespace ((char*)line, (char*)line+linelen-1); + //printf (" --name only=[%s]\n", *name); + *value = NULL; + } else { + // funny text starting with =. E.g. "=value" + *name = NULL; + *value = NULL; + } +} + +PairStruct * text_to_name_value_pairs (const char * text) +{ + /* Process a multi-line and/or ;-separated text and create a list + of name=value pairs from each line which has a + name = value + pattern. Whitespaces are removed. + "X = 1 + Y = 2" + is not valid because of missing ';', but + "X=1; Y=5; + Z=apple" + is valid + */ + char *name, *value; + char *item, *delim; + int len; + char line[256]; + PairStruct *res = NULL, *last = NULL, *pair; + + if (!text) return res; + + item = (char *)text; + while (item) { + delim = strchr (item, ';'); + if (delim) + len = (int) (delim-item); + else + len = strlen (item); + + strncpy (line, item, len); + line[len] = '\0'; + + //printf (" --Line=[%s]\n", line); + splitnamevalue(line, len, &name, &value); + if (name) { + pair = (PairStruct *) malloc (sizeof(PairStruct)); + pair->name = name; + pair->value = value; + pair->next = NULL; + if (last) { + last->next = pair; + last = pair; + } else { + res = pair; + last = pair; + } + } + if (delim && delim+1 != 0) + item = delim+1; + else + item = NULL; + } + return res; +} + + +void free_name_value_pairs (PairStruct * pairs) +{ + PairStruct *p; + while (pairs) { + free(pairs->name); + free(pairs->value); + p = pairs; + pairs=pairs->next; + free(p); + } +} + + +/******************************************************* + Timing +**********************************************************/ +#include // nanosleep +void adios_nanosleep (int sec, int nanosec) +{ +#if HAVE_NANOSLEEP + struct timespec treq = {.tv_sec=sec, .tv_nsec=nanosec}; + struct timespec trem; + int r; + r = nanosleep(&treq, &trem); + //log_debug("adios_nanosleep: Nanoslept for %d.%9.9d sec, r=%d, errno=%d\n", + // treq.tv_sec, treq.tv_nsec, r, errno); + while (r == -1 && errno == EINTR) { + treq.tv_sec = trem.tv_sec; + treq.tv_nsec = trem.tv_nsec; + r = nanosleep (&treq, &trem); + } +#else + if (sec>0) { + //log_debug("adios_nanosleep: Slept for %d seconds\n"); + sleep(sec); + } else { + //log_debug("adios_nanosleep: Slept for 1 second\n"); + sleep(1); + } + +#endif +} + +#include +struct timeval adios_timer_tp; +double adios_gettime() +{ + gettimeofday(&adios_timer_tp, NULL); \ + return ((double)adios_timer_tp.tv_sec + ((double)adios_timer_tp.tv_usec)/1000000.0); +} + +void * bufdup(const void *buf, uint64_t elem_size, uint64_t count) { + const uint64_t len = elem_size * count; + void *newbuf = malloc(len); + memcpy(newbuf, buf, len); + return newbuf; +} diff --git a/tests/libs/adios/src/core/util.h b/tests/libs/adios/src/core/util.h new file mode 100644 index 0000000000..ebedfada35 --- /dev/null +++ b/tests/libs/adios/src/core/util.h @@ -0,0 +1,85 @@ +#ifndef UTIL_H_ +#define UTIL_H_ + +#include +#include "public/adios_mpi.h" +#include "public/adios_types.h" +#include "public/adios_selection.h" + +typedef struct read_request +{ + ADIOS_SELECTION * sel; + int varid; + int from_steps; + int nsteps; + void * data; + uint64_t datasize; // size of selection to hold data +// above is the common fields that all read method will use + void * priv; // private structure for each read method + struct read_request * next; +} read_request; + +/* Reverse the order in an array in place. + use swapping from Fortran/column-major order to ADIOS-read-api/C/row-major order and back +*/ +void swap_order(int n, uint64_t *array, int *timedim); +void change_endianness( void *data, uint64_t slice_size, enum ADIOS_DATATYPES type); +void copy_data (void *dst, void *src, + int idim, + int ndim, + uint64_t* size_in_dset, + uint64_t* ldims, + const uint64_t * readsize, + uint64_t dst_stride, + uint64_t src_stride, + uint64_t dst_offset, + uint64_t src_offset, + uint64_t ele_num, + int size_of_type, + enum ADIOS_FLAG change_endiness, + enum ADIOS_DATATYPES type + ); +void alloc_namelist (char ***namelist, int length); +void free_namelist (char **namelist, int length); +void list_insert_read_request_tail (read_request ** h, read_request * q); +void list_insert_read_request_next (read_request ** h, read_request * q); +void list_append_read_request_list (read_request ** h, read_request * q); +void list_free_read_request (read_request * h); +int list_get_length (read_request * h); +ADIOS_SELECTION * copy_selection (const ADIOS_SELECTION * sel); +void free_selection (ADIOS_SELECTION * sel); +// This helper routine returns a vector of unique NID's +int get_nids (MPI_Comm comm, uint32_t * nids); + +/******************************************************* + Processing parameter lists +**********************************************************/ +/* + Process a ;-separated and possibly multi-line text and + create a list of name=value pairs from each + item which has a "name=value" pattern. Whitespaces are removed. + Input is not modified. Space is allocated; + Also, simple "name" or "name=" patterns are processed and + returned with value=NULL. +*/ +struct PairStruct { + char * name; + char * value; + struct PairStruct * next; +}; +typedef struct PairStruct PairStruct; + +PairStruct * text_to_name_value_pairs (const char * text); +void free_name_value_pairs (PairStruct * pairs); + +/********************************************************** + Timing +**********************************************************/ +/* sleep for a bit */ +void adios_nanosleep (int sec, int nanosec); +/* get current time as double (in seconds) */ +double adios_gettime(); + +void * bufdup(const void *buf, uint64_t elem_size, uint64_t count); + +#endif diff --git a/tests/libs/adios/src/public/adios.h b/tests/libs/adios/src/public/adios.h new file mode 100644 index 0000000000..2d9957f8f7 --- /dev/null +++ b/tests/libs/adios/src/public/adios.h @@ -0,0 +1,248 @@ +/* + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + */ + +#ifndef ADIOS_H +#define ADIOS_H + +#include + +#include "adios_mpi.h" +#include "adios_types.h" +#include "adios_error.h" + +// ADIOS - Adaptable IO System + +#ifdef __cplusplus +extern "C" { +#endif + +/* Most functions return 0 if OK, and !=0 on error + which is the value of the variable 'adios_errno'. + On error, one can use char * adios_get_last_errmsg() from adios_error.h + to retrieve the error string of the last error. + + exceptions: int64_t adios_define_var() returns a variable ID, 0 indicates an error +*/ + +// Global setup using the XML file +// Only processes of the provided communicator can later participate +// in any adios activity +int adios_init (const char * config, MPI_Comm comm); + +int adios_finalize (int mype); + +// end user calls for each I/O operation +// modes = "r" = "read", "w" = "write", "a" = "append", "u" = "update" +int adios_open (int64_t * fd, + const char * group_name, + const char * name, + const char * mode, + MPI_Comm comm + ); + +int adios_group_size (int64_t fd_p, + uint64_t data_size, + uint64_t * total_size + ); + +int adios_write (int64_t fd_p, const char * name, void * var); + +int adios_get_write_buffer (int64_t fd_p, + const char * name, + uint64_t * size, + void ** buffer + ); + +int adios_read (int64_t fd_p, + const char * name, + void * buffer, + uint64_t buffer_size + ); + +// OBSOLETE, kept only for backward compatibility of old codes +// Inconsistent behavior with new ADIOS variable naming +int adios_set_path (int64_t fd_p, const char * path); +// OBSOLETE, kept only for backward compatibility of old codes +// name should be the full path of the variable (as it was defined) +// in adios_write(), still the OLD full path should be used otherwise +// the variable is not found in the hash table +int adios_set_path_var (int64_t fd_p, const char * path, const char * name); + +int adios_end_iteration (void); + +int adios_start_calculation (void); + +int adios_stop_calculation (void); + +int adios_close (int64_t fd_p); + +// ADIOS No-XML API's +int adios_init_noxml (MPI_Comm comm); + +// To allocate ADIOS buffer +int adios_allocate_buffer ( + enum ADIOS_BUFFER_ALLOC_WHEN adios_buffer_alloc_when, + uint64_t buffer_size + ); + +// To declare a ADIOS group +int adios_declare_group (int64_t * id, + const char * name, + const char * time_index, + enum ADIOS_FLAG stats + ); + +// To free a ADIOS group +int adios_free_group (int64_t id); + +// To select a I/O method for a ADIOS group +int adios_select_method (int64_t group, + const char * method, + const char * parameters, + const char * base_path + ); + +// To define a ADIOS variable +// Returns a variable ID, which can be used in adios_write_byid() +// 0 return value indicates an error +int64_t adios_define_var (int64_t group_id, + const char * name, + const char * path, + enum ADIOS_DATATYPES type, + const char * dimensions, + const char * global_dimensions, + const char * local_offsets + ); + +// To remove all variable definitions from a group. +// Use it if you want to have a new set of variables defined +// for the next output step. +int adios_delete_vardefs (int64_t id); + +// To set the transform method for a variable just defined +// var_id is the value returned by adios_define_var +// returns adios_errno (0=OK) +int adios_set_transform (int64_t var_id, const char *transform_type_str); + +int adios_define_attribute (int64_t group, + const char * name, + const char * path, + enum ADIOS_DATATYPES type, + const char * value, + const char * var + ); + +int adios_delete_attrdefs (int64_t id); + +/** This function does similar function as adios_write. It is, however, used + * in the following scenario that + * 1. numbers, instead of a variable, are used to annotate array dimensions, and + * 2. a variable is written mutiple times on a processor (e.g., AMR codes) + */ +int adios_write_byid (int64_t fd_p, int64_t id, void * var); + +/** Set the application's ID for adios_read_init() + * when using a staging method (DATASPACES, DIMES, NSSI or DATATAP). + * The ID should be unique for each application accessing the staging area + * IN: id a number unique for this application + * RETURN: 0 if accepted, <0 on error + * It is optional to use it before calling adios_init. Default is 1. + * It has no effect for file based methods. + * Note: this function is defined both in adios.h and adios_read.h so that + * writing-only and reading-only applications can both use it. + */ +/*int adios_set_application_id (int id);*/ + +void adios_timing_write_xml (int64_t fd_p, const char* filename); + +// no-xml schema API +// Define adios schema version +// The function implements the same as "schema version="1.1 ""in xml +int adios_define_schema_version (int64_t group_id, char * schema_version); + +// Assign mesh to a variable +// The function implements the same as "var name="Var1" mesh="meshname" " in xml +int adios_define_var_mesh(int64_t group_id, const char * varname, const char * meshname); + +// Define centering of the variable value onto the mesh, centering is "cell" or "point" +int adios_define_var_centering(int64_t group_id, const char * varname, const char * centering); + +// Define a external file where mesh variables are written +int adios_define_mesh_file(int64_t group_id, char * name, char * file); + +// The time-­steps points to time variables using steps, starting from step 0 +int adios_define_var_timesteps (const char * timesteps, int64_t group_id, const char * name); + +// The time-­steps points to time variables using real time, starting from time +// Exactly like the time steps except with real numbers +int adios_define_var_timescale (const char * timescale, int64_t group_id, const char * name); + +// Describe the padding pattern for output images +// If this number is 4, then the time-steps for images will be padded with 0 up to 4 digit numbers +int adios_define_var_timeseriesformat (const char * timeseries, int64_t group_id, const char * name); + +// Use the concept of start, stride and count in all dimensions of a variable to identify a subset of a dataset +int adios_define_var_hyperslab (const char * hyperslab, int64_t group_id, const char * name); + +// Describe if the mesh changes over time, and the option is "yes" or "no" +int adios_define_mesh_timevarying (const char * timevarying, int64_t group_id, const char * name); + +// The time-­steps points to time variables using steps, starting from step 0 +int adios_define_mesh_timesteps (const char * timesteps, int64_t group_id, const char * name); + +// The time-­steps points to time variables using real time, starting from time 0 +int adios_define_mesh_timescale (const char * timescale, int64_t group_id, const char * name); + +// Represent an integer for padding and formatting output image files +// If this number is 4, then the time-steps for images will be padded with 0 up to 4 digit number +int adios_define_mesh_timeseriesformat (const char * timeseries, int64_t group_id, const char * name); + +// Indicates where (which ADIOS group) mesh variables are stored +int adios_define_mesh_group (const char * group, int64_t group_id, const char * name); + +// Defines a uniform mesh +// For not requried attributes in this function, please use 0 instead +int adios_define_mesh_uniform (char * dimensions, + char * origin, + char * spacing, + char * maximum, + char * nspace, + int64_t group_id, + const char * name); + +// Defines a rectilinear mesh +// For not requried attributes in this function, please use 0 instead +int adios_define_mesh_rectilinear (char * dimensions, + char * coordinates, + char * nspace, + int64_t group_id, + const char * name); + +// Defines a structured mesh +// For not requried attributes in this function, please use 0 instead +int adios_define_mesh_structured (char * dimensions, + char * points, + char * nspace, + int64_t group_id, + const char * name); + +// Define an unstructured mesh +// For not requried attributes in this function, please use 0 instead +int adios_define_mesh_unstructured (char * points, + char * data, + char * count, + char * cell_type, + char * npoints, + char * nspace, + int64_t group_id, + const char * name); +#ifdef __cplusplus +} +#endif + + +#endif diff --git a/tests/libs/adios/src/public/adios_error.h b/tests/libs/adios/src/public/adios_error.h new file mode 100644 index 0000000000..0a62e8a4b0 --- /dev/null +++ b/tests/libs/adios/src/public/adios_error.h @@ -0,0 +1,172 @@ +/* + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + */ + +#ifndef __ADIOS_ERROR_H_ +#define __ADIOS_ERROR_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +enum ADIOS_ERRCODES { + err_no_error = 0, + err_no_memory = -1, + err_file_open_error = -2, + err_file_not_found = -3, + err_invalid_file_pointer = -4, + err_invalid_group = -5, + err_invalid_group_struct = -6, + err_invalid_varid = -7, + err_invalid_varname = -8, + err_corrupted_variable = -9, + + err_invalid_attrid = -10, + err_invalid_attrname = -11, + err_corrupted_attribute = -12, + err_invalid_attribute_reference = -13, + err_invalid_timestep = -14, + err_no_data_at_timestep = -15, + err_time_at_wrong_dimension = -16, + err_invalid_read_method = -17, + err_connection_failed = -18, + err_out_of_bound = -19, + + err_operation_not_supported = -20, + err_end_of_stream = -21, /* stream: reached end of stream, + returned by adios_read_open() or + by adios_advance_step() */ + err_step_notready = -22, /* stream: tried to advance the step, + but no new step has arrived yet */ + err_step_disappeared = -23, /* stream: tried to advance the step, + but next step has already disappeared */ + err_too_many_files = -24, /* some staging methods allow for using only + a fixed number of different filenames */ + + err_unknown_char = -30, + + // XML parsing errors + err_invalid_host_language = -50, + err_global_dim_required = -51, + err_global_offset_required = -52, + err_invalid_method = -53, + err_invalid_buffer_size = -54, + err_missing_config_file = -55, + err_expected_read_size_mismatch = -56, + err_allocating_buffer_size = -57, + err_invalid_xml_doc = -58, + err_no_group_defined = -59, + err_no_method_defined = -60, + err_no_buffer_defined = -61, + err_missing_invalid_group = -62, + err_group_method_mismatch = -63, + err_dimension_required = -64, + err_offset_required = -65, + err_invalid_dimension = -66, + err_invalid_global_dimension = -67, + err_invalid_offset = -68, + err_invalid_var_as_dimension = -69, + err_invalid_type_attr = -70, + err_invalid_value_attr = -71, + err_histogram_error = -72, + + // Write method errors + err_invalid_file_mode = -100, + err_invalid_file_version = -101, + err_invalid_data = -102, + err_buffer_overflow = -103, + err_too_many_variables = -104, + err_invalid_write_method = -105, + err_write_error = -106, + + //buffering errors + err_invalid_buffer = -130, + err_invalid_buffer_version = -131, + err_invalid_buffer_index = -132, + err_invalid_buffer_group = -133, + err_invalid_buffer_vars = -134, + err_invalid_buffer_attrs = -135, + + + + //invalid argument to function + err_invalid_argument = -140, + + // Mesh reading errors + err_mesh_file_missing = -146, // mesh file is missing + err_no_matching_mesh_var = -147, // no mesh is associated to var + err_mesh_missing = -148, // mesh is missing in meshlist + err_mesh_name_attr_missing = -149, // mesh attr is missing + err_mesh_unstructured_invaid_points = -150, // points were invalid + err_mesh_unstructured_invaid_num_points = -151, // number of points is invalid + err_mesh_unstructured_invaid_dim_points = -152, // dim of points is invalid + err_mesh_unstructured_missing_one_points = -153, // one of the points is not defined + err_mesh_unstructured_missing_points = -154, // points are not defined + err_mesh_unstructured_missing_ncsets = -155, // ncsets was not defined + err_mesh_unstructured_invalid_ncsets = -156, // could not read the ncsets value + err_mesh_unstructured_missing_ccount = -157, // ccount was not defined + err_mesh_unstructured_invalid_ccount = -158, // could not read the ccount value + err_mesh_unstructured_invalid_ctypes = -159, // # of cell types invalid + err_mesh_unstructured_missing_cdata = -160, // cdata was not defined + err_mesh_unstructured_invalid_cdata = -161, // could not read the cdata value + err_mesh_unstructured_missing_ctype = -162, // ctype was not defined + err_mesh_unstructured_invalid_ctype = -163, // coule not read ctype value + err_mesh_unstructured_centering_missing = -164, // var centering of mesh is missing + err_mesh_unstructured_centering_invalid = -165, // var centering of mesh is invalid + + err_mesh_unifrom_invalid_num_dims = -170, // # dimensions was invalid + err_mesh_unifrom_invalid_num_max = -171, // # of maximums was less than ndims + err_mesh_unifrom_missing_maximum = -172, // maximums was not defined + err_mesh_unifrom_invalid_var_type = -173, // var type is not supported for processing + err_mesh_unifrom_missing_one_dim = -174, // one of the dimensions is not defined + err_mesh_unifrom_invalid_dim = -175, // could not read the dim value + err_mesh_unifrom_missing_dims = -176, // dimensions are not defined + err_mesh_unifrom_max_conflict = -177, // maximum is not consistant + + err_mesh_recti_invalid_num_dims = -180, // # dimensions was invalid + err_mesh_recti_missing_dims = -181, // dimensions are not defined + err_mesh_recti_missing_one_dim = -182, // one of the dimensions is not defined + err_mesh_recti_invalid_dim = -183, // could not read the dim value + err_mesh_recti_invalid_coords = -184, // coordinates were invalid + err_mesh_recti_invalid_num_coords = -185, // # coordinates was invalid + err_mesh_recti_missing_one_coords = -186, // one of the coordinates is not defined + err_mesh_recti_missing_coords = -187, // coordinates are not defined + + err_mesh_structured_invalid_num_dims = -190, // # dimensions was invalid + err_mesh_structured_missing_dims = -191, // dimensions are not defined + err_mesh_structured_missing_one_dim = -192, // one of the dimensions is not defined + err_mesh_structured_invalid_dim = -193, // could not read the dim value + err_mesh_structured_invaid_dim_points = -194, // # of points were invalid + err_mesh_structured_invaid_points = -195, // points were invalid + err_mesh_structured_missing_one_points = -196, // one of the points is not defined + err_mesh_structured_missing_points = -197, // points are not defined + err_mesh_structured_invalid_num_points = -198, // number of points is invalid + + // Transform layer errors + err_invalid_transform_type = -300, // unknown transform is requested + + // Query errors + err_unsupported_selection = -401, // unsupported selection + err_invalid_query_value = -402, // value passed in expression is invalid + err_incompatible_queries = -403, // cannot combine two queries + + // Miscellaneous + err_fgr = -900, // FGR lib error + + err_unspecified = -1000 +}; + +void adios_error (enum ADIOS_ERRCODES errcode, char *fmt, ...); +void adios_error_at_line (enum ADIOS_ERRCODES errcode, const char* filename, unsigned int linenum, char *fmt, ...); + +const char* adios_get_last_errmsg (void); +void adios_clear_error(void); // reset adios_errno to err_no_err and clear last errmsg + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/tests/libs/adios/src/public/adios_mpi.h b/tests/libs/adios/src/public/adios_mpi.h new file mode 100644 index 0000000000..3b7e27a43f --- /dev/null +++ b/tests/libs/adios/src/public/adios_mpi.h @@ -0,0 +1,20 @@ +/* + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + */ + +#ifndef ADIOS_MPI_H +#define ADIOS_MPI_H + +#ifdef _NOMPI +/* Sequential processes can use the library compiled with -D_NOMPI */ +# include "mpidummy.h" +#else +/* Parallel applications should use MPI to communicate file info and slices of data */ +# include "mpi.h" +#endif + + +#endif diff --git a/tests/libs/adios/src/public/adios_query.h b/tests/libs/adios/src/public/adios_query.h new file mode 100644 index 0000000000..c703193bb7 --- /dev/null +++ b/tests/libs/adios/src/public/adios_query.h @@ -0,0 +1,147 @@ +#ifndef __ADIOS_QUERY_H__ +#define __ADIOS_QUERY_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +#include "adios_read.h" + +//#define ADIOS_QUERY_METHOD_COUNT 2 + +//int gCurrentTimeStep; + +enum ADIOS_QUERY_METHOD +{ + ADIOS_QUERY_METHOD_FASTBIT = 0, + ADIOS_QUERY_METHOD_ALACRITY = 1, + ADIOS_QUERY_METHOD_UNKNOWN = 2, + ADIOS_QUERY_METHOD_COUNT = ADIOS_QUERY_METHOD_UNKNOWN +}; + + +enum ADIOS_PREDICATE_MODE +{ + ADIOS_LT = 0, + ADIOS_LTEQ = 1, + ADIOS_GT = 2, + ADIOS_GTEQ = 3, + ADIOS_EQ = 4, + ADIOS_NE = 5 +}; + +enum ADIOS_CLAUSE_OP_MODE +{ + ADIOS_QUERY_OP_AND = 0, + ADIOS_QUERY_OP_OR = 1 +}; + +typedef struct { + char* condition; + void* queryInternal; + + // keeping start/count to map 1d results from fastbit to N-d + + ADIOS_SELECTION* sel; + void* dataSlice; + + ADIOS_VARINFO* varinfo; + char* varName; + + ADIOS_FILE* file; + enum ADIOS_QUERY_METHOD method; + + enum ADIOS_PREDICATE_MODE predicateOp; + char* predicateValue; + uint64_t rawDataSize; // this is the result of dim/start+count + + void* left; + void* right; + enum ADIOS_CLAUSE_OP_MODE combineOp; + + int onTimeStep; // dataSlice is obtained with this timeStep + + uint64_t maxResultsDesired; + uint64_t resultsReadSoFar; + + int hasParent; + int deleteSelectionWhenFreed; +} ADIOS_QUERY; + + +#ifndef __INCLUDED_FROM_FORTRAN_API__ + +/* functions */ + +int adios_query_is_method_available(enum ADIOS_QUERY_METHOD method); + +ADIOS_QUERY* adios_query_create (ADIOS_FILE* f, + ADIOS_SELECTION* queryBoundary, + const char* varName, + enum ADIOS_PREDICATE_MODE op, + const char* value); + + +ADIOS_QUERY* adios_query_combine (ADIOS_QUERY* q1, + enum ADIOS_CLAUSE_OP_MODE operator, + ADIOS_QUERY* q2); + +/* + * Select a query method manually for a query evaluation. + * If not set by the user, a suitable query method is chosen at evaluation +*/ +void adios_query_set_method (ADIOS_QUERY* q, enum ADIOS_QUERY_METHOD method); + + +/* + * Estimate the number of hits of the query at "timestep" + * + * + * IN: q query + * timestep timestep of interest + * + * RETURN: -1 : error + * >=0: estimated hits + * + */ + +int64_t adios_query_estimate (ADIOS_QUERY* q, int timeStep); + +// obsolete. time_steps for non-streaming files should show up in estimate/evalute +//void adios_query_set_timestep (int timeStep); + +/* + * Evaluate and return result of the query at the "timestep" + * result will be limited to "batchSize". May need to call Multiple times + * to get all the result. + * + * IN: q query + * timestep timestep of interest + * batchSize max size of results to return of this call + * outputBoundary query results will be mapped to this selection + * outputBoundary must match the selections used when construct the query + * if NULL, then will use the first selection used in query + * OUT: queryResult list of points + * NULL if no result + * RETURN: -1: error + * 1: if more results to follow, keep calling evaluate() to find out + * 0: of no more results to fetch + * + */ + +int adios_query_evaluate (ADIOS_QUERY* q, + ADIOS_SELECTION* outputBoundary,// must supply to get results + int timestep, + uint64_t batchSize, // limited by maxResult + ADIOS_SELECTION** queryResult); + + +void adios_query_free(ADIOS_QUERY* q); + +#endif /* __INCLUDED_FROM_FORTRAN_API__ */ + +#ifdef __cplusplus +} +#endif + +#endif /* __ADIOS_QUERY_H__ */ diff --git a/tests/libs/adios/src/public/adios_read.h b/tests/libs/adios/src/public/adios_read.h new file mode 100644 index 0000000000..e7e48f0fb4 --- /dev/null +++ b/tests/libs/adios/src/public/adios_read.h @@ -0,0 +1,21 @@ +/* + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + */ + +/* + * Read C API for ADIOS BP format files + */ +#ifndef __ADIOS_READ_H__ +#define __ADIOS_READ_H__ + +#ifdef ADIOS_USE_READ_API_1 +# include "adios_read_v1.h" +#else +# include "adios_read_v2.h" +#endif + + +#endif /*__ADIOS_READ_H__*/ diff --git a/tests/libs/adios/src/public/adios_read_ext.h b/tests/libs/adios/src/public/adios_read_ext.h new file mode 100644 index 0000000000..f1cfaaac14 --- /dev/null +++ b/tests/libs/adios/src/public/adios_read_ext.h @@ -0,0 +1,126 @@ +/* + * adios_read_ext.h + * + * Created on: Apr 25, 2014 + * Author: David A. Boyuka II + */ +#ifndef ADIOS_READ_EXT_H_ +#define ADIOS_READ_EXT_H_ + +#ifdef ADIOS_USE_READ_API_1 +# error "Extended ADIOS Read API is not available in Read API v1" +#endif + +#include + +#include "adios_read_v2.h" +#include "adios_selection.h" + +// An opaque type defining a particular view of the data. +// Currently, there are only two possible values: LOGICAL_DATA_VIEW and PHYSICAL_DATA_VIEW +typedef const void* data_view_t; + +// LOGICAL_DATA_VIEW: the default, ADIOS presents the same view of the data as it was written to the +// file (e.g., if processes wrote to a 3D global array of doubles, the user API will present a 3D global +// array of doubles to the user when in this view mode). +extern const data_view_t LOGICAL_DATA_VIEW; + +// PHYSICAL_DATA_VIEW: ADIOS will present the raw transport layer view of the data. If a variable is not +// transformed, its presentation is equivalent to that under LOGICAL_DATA_VIEW. If a variable is +// transformed, it will be presented as a 1D byte array, and reads will be answered directly from the +// transformed data with out any de-transformation applied. +extern const data_view_t PHYSICAL_DATA_VIEW; + +// An identifier for a particular transform type (e.g., identity, zlib, etc.) +// constant NO_TRANSFORM indicates the absence of any data transform being applied. +typedef int adios_transform_type_t; + +extern const adios_transform_type_t NO_TRANSFORM; + +typedef struct { + const void *content; + uint64_t length; // in bytes +} ADIOS_TRANSFORM_METADATA; + +// A transform information structure describing how a particular variable has been transformed +typedef struct { + int varid; // Copied from ADIOS_VARINFO, since it is needed for some ADIOS_VARTRANSFORM operations + int sum_nblocks; // ... + + adios_transform_type_t transform_type; /* The data transform applied to this variable */ + + int should_free_transform_metadata; // Used internally for free + + /* An array of transform plugin-specific metadata buffers, one for each + varblock in this file (number of varblocks == ADIOS_VARINFO.sum_nblocks). + Only needed by advanced applications requiring direct manipulation + of transformed data. */ + ADIOS_TRANSFORM_METADATA *transform_metadatas; +} ADIOS_VARTRANSFORM; + + + +typedef struct { + int timestep; + int blockidx; + int blockidx_in_timestep; + ADIOS_SELECTION *pg_bounds_sel; // it is a global box (offset/start is global) + ADIOS_SELECTION *intersection_sel; // it is a global box (offset/start is global) +} ADIOS_PG_INTERSECTION ; + + +typedef struct { + ADIOS_PG_INTERSECTION * intersections; + int npg; +} ADIOS_PG_INTERSECTIONS; + +#ifndef __INCLUDED_FROM_FORTRAN_API__ + +// Sets the "data view" for this ADIOS file, which determines how ADIOS presents variables through +// adios_inq_var*, and how reads are evaluated in adios_schedule_reads/adios_check_reads calls. +// Currently, the choice is between a logical and physical view of the data, which only differ for +// transformed variables; a logical view of a transformed variable presents the data as it was +// originally written (this is the default), whereas a physical view presents the transformed data +// as it actually exists on disk. +// Returns the previous view that was set +data_view_t adios_read_set_data_view(ADIOS_FILE *fp, data_view_t vt); + +// Populates data transform information about a given variable into an ADIOS_VARTRANSFORM struct +// Return NULL if failed +ADIOS_VARTRANSFORM * adios_inq_var_transform(const ADIOS_FILE *fp, const ADIOS_VARINFO *varinfo); + +// Frees an ADIOS_VARTRANSFORM previous received from a call to adios_inq_var_transform +void adios_free_var_transform(ADIOS_VARTRANSFORM *vartransform); + +// Returns the adios_transform_type_t constant for a data transformation method specified +// by its unique ID, corresponding to the third argument in transforms/transform_plugins.h. +// For example, to get ISOBAR's type constant: +// +// In transforms/transform_plugin.h: +// REGISTER_TRANSFORM_PLUGIN(isobar, "isobar", "ncsu-isobar", "ISOBAR compression") +// ^^^^^^^^^^^^^ +// const adios_transform_type_t ISOBAR_TTYPE = adios_get_transform_type_by_uid("ncsu-isobar"); +// +adios_transform_type_t adios_get_transform_type_by_uid(const char *transform_uid); + +// Creates a writeblock selection that only retrieves elements [start_elem, start_elem + num_elems) +// within a variable. An element is a single value of whatever the varaible's datatype is (i.e., +// 1 element = 1 double if the variable type is double, 1 byte if the variable type is byte, etc.) +ADIOS_SELECTION * adios_selection_writeblock_bounded(int index, uint64_t start_elem, uint64_t num_elems, int is_timestep_relative); + +ADIOS_PG_INTERSECTIONS * adios_find_intersecting_pgs( + const ADIOS_FILE *fp, int varid, const ADIOS_SELECTION *sel, + const int from_step, const int nsteps); + +int adios_get_absolute_writeblock_index(const ADIOS_VARINFO *varinfo, int timestep_relative_idx, int timestep); + +void adios_free_pg_intersections(ADIOS_PG_INTERSECTIONS **intersections); + +// What is the dimension order of arrays in the file? +// 0: C ordering (row-major), last dimension is the fastest dimension +// 1: Fortran ordering (column-major), first dimension is the fastest dimension +int adios_read_get_dimension_order (ADIOS_FILE *); + +#endif /*__INCLUDED_FROM_FORTRAN_API__*/ + +#endif /* ADIOS_READ_EXT_H_ */ diff --git a/tests/libs/adios/src/public/adios_read_v1.h b/tests/libs/adios/src/public/adios_read_v1.h new file mode 100644 index 0000000000..74ed45eaac --- /dev/null +++ b/tests/libs/adios/src/public/adios_read_v1.h @@ -0,0 +1,304 @@ +/* + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + */ + +/* + * Read C API for ADIOS BP format files + * Define -DADIOS_USE_READ_API_1 at compile time when including "adios_read.h" + * to use this version of the API. + */ +#ifndef __ADIOS_READ_V1_H__ +#define __ADIOS_READ_V1_H__ + +#include + +#include "adios_mpi.h" +#include "adios_read_v1_defs.h" +#include "adios_types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/*************************/ +/* Types used in the API */ +/*************************/ + +typedef struct { + uint64_t fh; /* File handler */ + int groups_count; /* Number of adios groups in file */ + int vars_count; /* Number of variables in all groups */ + int attrs_count; /* Number of attributes in all groups */ + int tidx_start; /* First timestep in file, usually 1 */ + int ntimesteps; /* Number of timesteps in file. There is always at least one timestep */ + int version; /* ADIOS BP version of file format */ + uint64_t file_size; /* Size of file in bytes */ + int endianness; /* 0: little endian, 1: big endian (you do not need to care) */ + char ** group_namelist; /* Names of the adios groups in the file (cf. groups_count) */ + void * internal_data; /* Data for internal use */ +} ADIOS_FILE; + +typedef struct { + uint64_t gh; /* Group handler */ + int grpid; /* group index (0..ADIOS_FILE.groups_count-1) */ + int vars_count; /* Number of variables in this adios group */ + char ** var_namelist; /* Variable names in a char* array */ + int attrs_count; /* Number of attributes in this adios group */ + char ** attr_namelist; /* Attribute names in a char* array */ + ADIOS_FILE * fp; /* pointer to the parent ADIOS_FILE struct */ + /* streaming API: */ + int timestep; /* The current (only) timestep */ + int lasttimestep; /* The currently available latest timestep in the stream */ + +} ADIOS_GROUP; + +/* NCSU - Added more statistics to be returned to the end user */ +typedef struct { + int grpid; /* group index (0..ADIOS_FILE.groups_count-1) */ + int varid; /* variable index (0..ADIOS_GROUP.var_count-1) */ + enum ADIOS_DATATYPES type; /* type of variable */ + int ndim; /* number of dimensions, 0 for scalars */ + uint64_t * dims; /* size of each dimension */ + int timedim; /* -1: variable has no timesteps in file, >=0: which dimension is time */ + int characteristics_count; /* number of characteristic */ + void * value; /* value of a scalar variable, NULL for array. */ + void * gmin; /* minimum value in an array variable, = value for a scalar */ + void * gmax; /* maximum value of an array variable (over all timesteps) */ + double * gavg; /* average value of an array variable (over all timesteps) */ + double * gstd_dev; /* standard deviation value of an array variable (over all timesteps) */ + void ** mins; /* minimum per each timestep (array of timestep elements) */ + void ** maxs; /* maximum per each timestep (array of timestep elements) */ + double ** avgs; /* average per each timestep (array of timestep elements) */ + double ** std_devs; /* standard deviation per each timestep (array of timestep elements) */ + struct ADIOS_HIST /* Histogram */ + { + uint32_t num_breaks; + double max; + double min; + double *breaks; + uint32_t **frequenciess; + uint32_t *gfrequencies; + } *hist; + + void * internal_data; /* internal storage for version 2 read API data */ +} ADIOS_VARINFO; + +/* Needed by ADIOS_TRANSINFO below */ +typedef struct { + uint64_t * start; /* offset start point in global array ('ndim' elements) */ + uint64_t * count; /* local sizes in global array ('ndim' elements) */ +} ADIOS_VARBLOCK; + +/* The list of the available read methods */ +enum ADIOS_READ_METHOD { + ADIOS_READ_METHOD_BP = 0 /* Read from ADIOS BP file (written by POSIX, MPI etc methods) */ + ,ADIOS_READ_METHOD_BP_STAGED = 1 /* Read from ADIOS BP file (written by POSIX, MPI_AMR etc methods */ + ,ADIOS_READ_METHOD_BP_AGGREGATE = 1 /* Alias of STAGED method */ + ,ADIOS_READ_METHOD_HDF5 = 2 /* Read from HDF5 file (written by PHDF5 method) */ + ,ADIOS_READ_METHOD_DART = 3 /* Read from memory written by DART method */ + ,ADIOS_READ_METHOD_DIMES = 4 /* Read from memory written by DIMES method */ + ,ADIOS_READ_METHOD_NSSI = 5 /* Read from memory written by NSSI method */ + ,ADIOS_READ_METHOD_DATATAP = 6 /* Read from memory written by DATATAP method */ + ,ADIOS_READ_METHOD_BP_STAGED1 = 7 /* Read from ADIOS BP file (written by POSIX, MPI_AMR etc methods) */ +}; + +#ifndef __INCLUDED_FROM_FORTRAN_API__ + +/** Functions that return a pointer to some data structures (fopen, gopen), return NULL + on error and set adios_errno to a non-zero value and writes an error string. + You have direct access to that string so you can print it. + Do not write anything into it, please. + Only the last error message is always available. +*/ +extern int adios_errno; +const char *adios_errmsg(); + +/** Set the reading method for the next adios_fopen. + * IN: method read method to use + * RETURN: 0 if accepted, <0 on error + * It is optional to use it before calling adios_fopen. Default is ADIOS_READ_METHOD_BP. + */ +int adios_set_read_method (enum ADIOS_READ_METHOD method); + +/** Set the application's ID for adios_read_init() + * when using a staging method (DART, DIMES, NSSI or DATATAP). + * The ID should be unique for each application accessing the staging area + * IN: id a number unique for this application + * RETURN: 0 if accepted, <0 on error + * It is optional to use it before calling adios_init. Default is 1. + * It has no effect for file based methods. + * Note: this function is defined both in adios.h and adios_read.h so that + * writing-only and reading-only applications can both use it. + */ +int adios_set_application_id (int id); + +/** Initialize and finalize the read method. + * This is needed for the DART method only and only if multiple fopen()...fclose() cycles + * are used. In such a case, init/finalize will perform the connection/disconnection to + * the DART server once. + * For other methods, these functions do nothing. + */ +int adios_read_init(MPI_Comm comm); +int adios_read_finalize(); + +/** Open an adios file. + * IN: fname pathname of file to be opened + * comm the MPI communicator of all processes that want to read data from the file + * if compile with -D_NOMPI, pass any integer here. + * RETURN: pointer to an ADIOS_FILE struct, NULL on error (sets adios_errno) + */ +ADIOS_FILE * adios_fopen (const char * fname, MPI_Comm comm); + +/** Close an adios file. + * It will free the content of the underlying data structures and the fp pointer itself. + * IN: fp pointer to an ADIOS_FILE struct + * RETURN: 0 OK, !=0 on error (also sets adios_errno) + */ +int adios_fclose (ADIOS_FILE *fp); + +/** This function can be called if user places + * the wrong sequences of dims for a var + */ +void adios_reset_dimension_order (ADIOS_FILE *fp, int is_fortran); + + +/** Open an adios group. Usually there is one adios group in a file, + * but there can be more than one. + * IN: fp pointer to an (opened) ADIOS_FILE struct + * grpname name of the group + * RETURN: pointer to an ADIOS_GROUP struct, NULL on error (sets adios_errno) + */ +ADIOS_GROUP * adios_gopen (ADIOS_FILE *fp, const char * grpname); + +/** Open a group by index + * grpid index of group (0..fp->groups_count-1) + * in fp->group_namelist of ADIOS_FILE struct + */ +ADIOS_GROUP * adios_gopen_byid (ADIOS_FILE *fp, int grpid); + +/** Close an adios group. + * To free the data structures allocated at gopen, you need to call this function + * IN: gp pointer to an (opened) ADIOS_GROUP struct + * RETURN: 0 OK, !=0 on error (also sets adios_errno) + */ +int adios_gclose (ADIOS_GROUP *gp); + + +/** Inquiry about one variable in a group. + * This function does not read anything from the file but processes info + * already in memory after fopen and gopen. + * It allocates memory for the ADIOS_VARINFO struct and content, so + * you need to free resources later with adios_free_varinfo(). + * + * IN: gp pointer to an (opened) ADIOS_GROUP struct + * varname name of the variable + * RETURN: pointer to and ADIOS_VARINFO struct, NULL on error (sets adios_errno) + */ +ADIOS_VARINFO * adios_inq_var (ADIOS_GROUP *gp, const char * varname); + +/* NCSU - Timeseries analysis functions */ +double adios_stat_cor (ADIOS_VARINFO * vix, ADIOS_VARINFO * viy, char * characteristic, uint32_t time_start, uint32_t time_end, uint32_t lag); +double adios_stat_cov (ADIOS_VARINFO * vix, ADIOS_VARINFO * viy, char * characteristic, uint32_t time_start, uint32_t time_end, uint32_t lag); +/** Inquiry a variable by index + * varid index of variable (0..gp->vars_count-1) + * in gp->vars_namelist of ADIOS_GROUP struct + */ +ADIOS_VARINFO * adios_inq_var_byid (ADIOS_GROUP *gp, int varid); + +/** Free memory used by an ADIOS_VARINFO struct */ +void adios_free_varinfo (ADIOS_VARINFO *cp); + +/** Read a variable (slice) from the file. + * You need to allocate the memory for the data. + * IN: gp pointer to an (opened) ADIOS_GROUP struct + * varname name of the variable + * start array of offsets to start reading in each dimension + * count number of data elements to read in each dimension + * OUT: data data of the variable + * RETURN: the number of bytes read, <0 on error, sets adios_errno too + */ +int64_t adios_read_var (ADIOS_GROUP * gp, + const char * varname, + const uint64_t * start, + const uint64_t * count, + void * data); + +/** Read a local variable from the file. This function is for reading BP only. + * To read a global variable, you should use adios_read_var() instead. + * You need to allocate memory for the data. + * IN: gp pointer to an (opened) ADIOS_GROUP struct + * varname name of the variable + * idx which local variable to read in. For example, if variable NX + is dumped out by every processor, this idx denotes which copy of NX + you want to read in. The NX dumped out by rank 0 will have idx 0. + * start array of offsets to start reading in each dimension + * count number of data elements to read in each dimension + * OUT: data data of the variable + * RETURN: the number of bytes read, <0 on error, sets adios_errno too + */ +int64_t adios_read_local_var (ADIOS_GROUP * gp, + const char * varname, + int idx, + const uint64_t * start, + const uint64_t * count, + void * data); + +/** Read a variable by index + * varid index of variable (0..gp->vars_count-1) + * in gp->vars_namelist of ADIOS_GROUP struct + */ +int64_t adios_read_var_byid (ADIOS_GROUP * gp, int varid, + const uint64_t * start, const uint64_t * count, + void * data); + +/** Get an attribute in a group. + * This function does not read anything from the file but processes info + * already in memory after fopen and gopen. + * The memory for the data is allocated within the library. + * You can use free() to free the memory after use. + * + * IN: gp pointer to an (opened) ADIOS_GROUP struct + * attrname name of the attribute + * OUT: type adios type of attribute (see enum ADIOS_DATATYPES in adios_types.h) + * size memory size of value (n+1 for a string of n characters) + * data pointer to the value. You need to cast it afterward according to the type. + * RETURN: 0 OK, error: set and return adios_errno + */ +int adios_get_attr (ADIOS_GROUP * gp, + const char * attrname, + enum ADIOS_DATATYPES * type, + int * size, + void ** data); + +/** Convenience function to get an attribute by name + * attrid index of attribute (0..gp->attrs_count-1) + * in gp->attr_namelist of ADIOS_GROUP struct + */ +int adios_get_attr_byid (ADIOS_GROUP * gp, int attrid, enum ADIOS_DATATYPES * type, + int * size, void ** data); + +/** Return the name of an adios type */ +const char * adios_type_to_string (enum ADIOS_DATATYPES type); + +/** Return the memory size of one data element of an adios type. + * If the type is adios_string, and the second argument is + * the string itself, it returns strlen(data)+1. + * For other types, it does not care about data and returns + * the size occupied by one element. + */ +int adios_type_size(enum ADIOS_DATATYPES type, void *data); + +/** Test function to print basic info about the file to stdout */ +void adios_print_fileinfo (ADIOS_FILE *fp); +void adios_print_groupinfo (ADIOS_GROUP *gp); + +#endif /*__INCLUDED_FROM_FORTRAN_API__*/ + +#ifdef __cplusplus +} +#endif + +#endif /*__ADIOS_READ_V1_H__*/ diff --git a/tests/libs/adios/src/public/adios_read_v1_defs.h b/tests/libs/adios/src/public/adios_read_v1_defs.h new file mode 100644 index 0000000000..975f59157e --- /dev/null +++ b/tests/libs/adios/src/public/adios_read_v1_defs.h @@ -0,0 +1,58 @@ +/* + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + */ + +/* + * Read C API for ADIOS BP format files + */ +#ifndef __ADIOS_READ_V1_DEFS_H__ +#define __ADIOS_READ_V1_DEFS_H__ + +#define ADIOS_FILE ADIOS_FILE_V1 +#define ADIOS_GROUP ADIOS_GROUP_V1 +#define ADIOS_VARINFO ADIOS_VARINFO_V1 +#define ADIOS_HIST ADIOS_HIST_V1 +#define ADIOS_VARBLOCK ADIOS_VARBLOCK_V1 + +#define ADIOS_READ_METHOD ADIOS_READ_METHOD_V1 +#define ADIOS_READ_METHOD_BP ADIOS_READ_METHOD_BP_V1 +#define ADIOS_READ_METHOD_BP_AGGREGATE ADIOS_READ_METHOD_BP_AGGREGATE_V1 +#define ADIOS_READ_METHOD_BP_STAGED ADIOS_READ_METHOD_BP_STAGED_V1 +#define ADIOS_READ_METHOD_HDF5 ADIOS_READ_METHOD_HDF5_V1 +#define ADIOS_READ_METHOD_DART ADIOS_READ_METHOD_DART_V1 +#define ADIOS_READ_METHOD_DIMES ADIOS_READ_METHOD_DIMES_V1 +#define ADIOS_READ_METHOD_NSSI ADIOS_READ_METHOD_NSSI_V1 +#define ADIOS_READ_METHOD_DATATAP ADIOS_READ_METHOD_DATATAP_V1 +#define ADIOS_READ_METHOD_BP_STAGED1 ADIOS_READ_METHOD_BP_STAGED1_V1 + +#define adios_read_init adios_read_init_v1 +#define adios_read_finalize adios_read_finalize_v1 +#define adios_set_read_method adios_set_read_method_v1 +#define adios_fopen adios_fopen_v1 +#define adios_fopen adios_fopen_v1 +#define adios_fclose adios_fclose_v1 +#define adios_reset_dimension_order adios_reset_dimension_order_v1 +#define adios_gopen adios_gopen_v1 +#define adios_gopen_byid adios_gopen_byid_v1 +#define adios_gclose adios_gclose_v1 +#define adios_inq_var adios_inq_var_v1 +#define adios_inq_var_byid adios_inq_var_byid_v1 +#define adios_stat_cor adios_stat_cor_v1 +#define adios_stat_cov adios_stat_cov_v1 +#define adios_free_varinfo adios_free_varinfo_v1 +#define adios_read_var adios_read_var_v1 +#define adios_read_var_byid adios_read_var_byid_v1 +#define adios_read_local_var adios_read_local_var_v1 +#define adios_get_attr adios_get_attr_v1 +#define adios_get_attr_byid adios_get_attr_byid_v1 +#define adios_type_to_string adios_type_to_string_v1 +#define adios_type_size adios_type_size_v1 +#define adios_print_fileinfo adios_print_fileinfo_v1 + + +#define err_end_of_file err_end_of_stream + +#endif /*__ADIOS_READ_VER1_DEFS_H__*/ diff --git a/tests/libs/adios/src/public/adios_read_v2.h b/tests/libs/adios/src/public/adios_read_v2.h new file mode 100644 index 0000000000..ad4abc715e --- /dev/null +++ b/tests/libs/adios/src/public/adios_read_v2.h @@ -0,0 +1,597 @@ +/* + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + */ + +/* + * Streaming/Chunking/Selection Read API in C for ADIOS BP format + */ +#ifndef __ADIOS_READ_VER2_H__ +#define __ADIOS_READ_VER2_H__ + +#include + +#include "adios_mpi.h" +#include "adios_types.h" +#include "adios_selection.h" +#include "adios_schema.h" +#include "adios_read_v2_fwd.h" +#include "adios_read_ext.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/*************************/ +/* Types used in the API */ +/*************************/ + +struct _ADIOS_FILE { + uint64_t fh; /* File handler */ + int nvars; /* Number of variables in all groups (with full path) */ + char ** var_namelist; /* Variable names in a char* array */ + int nattrs; /* Number of attributes in all groups */ + char ** attr_namelist; /* Attribute names in a char* array */ + int nmeshes; /* Number of meshes in all groups */ + char ** mesh_namelist; /* Mesh names in a char* array */ + int nlinks; /* Number of links in all groups */ + char ** link_namelist; /* link names in a char* array */ + + /* Stream step information */ + int current_step; /* The current step in a stream. For a file, it is always 0. */ + int last_step; /* The currently available latest step in the stream/file. */ + int is_streaming; /* Non-zero if in streaming mode, zero if in non-streaming mode */ + + /* Information about file/stream */ + char *path; /* Full path file name (as passed at open) */ + int endianness; /* 0: little endian, 1: big endian */ + /* the read API takes care of conversion automatically */ + int version; /* Version of ADIOS-BP format */ + uint64_t file_size; /* Size of file in bytes not including subfiles */ + + /* Internals */ + void * internal_data; /* Data for internal use */ +}; + +struct _ADIOS_VARSTAT { + void * min; /* minimum value in an array variable, = value for a scalar */ + void * max; /* maximum value of an array variable (over all steps) */ + double * avg; /* average value of an array variable (over all steps) */ + double * std_dev; /* standard deviation value of an array variable (over all steps) */ + + struct ADIOS_STAT_STEP /* per step statistics (if requested and recorded at writing) */ + { + void ** mins; /* minimum per each step (array of 'nsteps' elements) */ + void ** maxs; /* maximum per each step (array of 'nsteps' elements) */ + double ** avgs; /* average per each step (array of 'nsteps' elements) */ + double ** std_devs; /* standard deviation per each step (array of 'nsteps' elements) */ + } *steps; + + struct ADIOS_STAT_BLOCK /* per block statistics (if requested and recorded at writing) */ + { + void ** mins; /* minimum per each block (array of 'nblocks' elements) */ + void ** maxs; /* maximum per each block (array of 'nblocks' elements) */ + double ** avgs; /* average per each block (array of 'nblocks' elements) */ + double ** std_devs; /* std deviation per each block (array of 'nblocks' elements) */ + } *blocks; + + struct ADIOS_HIST /* Histogram if recorded at writing */ + { + uint32_t num_breaks; + double max; + double min; + double * breaks; + uint32_t ** frequencies; + uint32_t * gfrequencies; + } *histogram; +}; + +struct _ADIOS_VARBLOCK { + uint64_t * start; /* offset start point in global array ('ndim' elements) */ + uint64_t * count; /* local sizes in global array ('ndim' elements) */ +}; + +enum var_centering +{ + point = 1, // unstructured mesh point centering + cell = 2 // unstructured mesh cell centering +}; + +struct _ADIOS_VARMESH { + int meshid; + enum var_centering centering; +}; + +struct _ADIOS_VARINFO { + int varid; /* variable index (0..ADIOS_FILE.nvars-1) */ + enum ADIOS_DATATYPES type; /* type of variable */ + int ndim; /* number of dimensions, 0 for scalars */ + uint64_t * dims; /* size of each dimension. + If variable has no global view 'dims' report the size of the + local array written by process rank 0. + */ + int nsteps; /* Number of steps of the variable in file. + There is always at least one step. */ + /* In streams it always equals 1. */ + void * value; /* value of a scalar variable, NULL for array. */ + int global; /* 1: global view (was defined by writer), + 0: pieces written by writers without defining a global array */ + int * nblocks; /* Number of blocks that comprise this variable in a step + It is an array of 'nsteps' integers */ + int sum_nblocks; /* Number of all blocks of all steps, the sum of the nblocks array*/ + ADIOS_VARSTAT *statistics; /* Statistics, retrieved in separate call: adios_inq_var_stat() */ + ADIOS_VARBLOCK *blockinfo; /* Spatial arrangement of written blocks, + retrieved in separate call: adios_inq_var_blockinfo() + It is an array of 'sum_nblocks' elements */ + ADIOS_VARMESH *meshinfo; /* structure in this file, + retrieved in separate call: adios_inq_var_meshinfo() */ +}; + +struct _ADIOS_VARCHUNK { + int varid; /* variable index (0..ADIOS_FILE.nvars-1) */ + enum ADIOS_DATATYPES type; /* type of variable */ + // NCSU ALACRITY-ADIOS - Added timestep information into varchunks + int from_steps; /* the first timestep in the returned data */ + int nsteps; /* the number of timesteps in the returned data */ + ADIOS_SELECTION * sel; /* sub-selection of requested selection */ + void * data; /* pointer to data, at next adios_read_check() memory + will likely be overwritten */ +}; + +/* The list of the available read methods */ +enum ADIOS_READ_METHOD { + ADIOS_READ_METHOD_BP = 0, /* Read from ADIOS BP file (written by POSIX, MPI etc methods) */ + ADIOS_READ_METHOD_BP_AGGREGATE = 1, /* Read from ADIOS BP file (written by POSIX, MPI_AMR etc methods) */ + ADIOS_READ_METHOD_DATASPACES = 3, /* Read from memory written by DATASPACES method */ + ADIOS_READ_METHOD_DIMES = 4, /* Read from memory written by DIMES method */ + ADIOS_READ_METHOD_FLEXPATH = 5, /* Read from memory written by FLEXPATH method */ + ADIOS_READ_METHOD_ICEE = 6, /* Read from memory written by ICEE method */ +}; + +/** Locking mode for streams. + * In case of real streams, a step may need to be locked in memory to be able + * to read all data of the step completely. + * ADIOS_LOCKMODE_NONE = no locking. A step can disappear between open and read + * ADIOS_LOCKMODE_CURRENT = lock current step. Do not allow to be removed until + * closing or moving away from this step. Future steps may be removed by + * the method to store even newer steps. Therefore, steps may be missing. + * ADIOS_LOCKMODE_ALL = lock current step and all newer steps + * In case of a file opened as a stream, locking mode has no effect. + */ +enum ADIOS_LOCKMODE { + ADIOS_LOCKMODE_NONE = 0, + ADIOS_LOCKMODE_CURRENT = 1, + ADIOS_LOCKMODE_ALL = 2 +}; + +#ifndef __INCLUDED_FROM_FORTRAN_API__ + +/** Functions that return a pointer to some data structures (e.g. adios_fopen), + * return NULL on error and set adios_errno to a non-zero value and writes an + * error string. + * You have direct access to that string so you can print it. + * Do not write anything into it. + * The last error message is always available; it is not cleared until another error is detected. + */ +extern int adios_errno; +const char *adios_errmsg(); + +/** Initialize a reading method before opening a file/stream with using + * the method. + * IN: method read method to use + * comm MPI communicator of all processes participating + * in a file/stream operation + * parameters A series of name=value pairs separated by ; + * E.g. "max_memory=200; app_id = 1" + * List of parameters is documented for each method + * separately. + * + * RETURN: 0 if accepted, !=0 on error (adios_errno value) + * Initialization is required for the staging methods, where init/finalize + * perform the connection/disconnection to the staging server once. + * The ADIOS_READ_METHOD_BP does not need to be initialized/finalized. + */ +int adios_read_init_method (enum ADIOS_READ_METHOD method, + MPI_Comm comm, + const char * parameters); + +/* max_memory + * maximum size of memory to be used by the read method, + * in MB, for caching. The methods use this size for + * caching/staging the data as a limit but use other + * memory for all internal data structures. + * 0 means, it can use as much memory as necessary + * app_id + * when using a staging method (DATASPACES, DIMES, NSSI or DATATAP). + * The ID should be unique for each application accessing the staging area + */ + +/** Finalize the selected method. Required for all methods that are initialized. + */ +int adios_read_finalize_method(enum ADIOS_READ_METHOD method); + +/** Open an adios file/stream as a stream. + * Only one step at a time can be read. The list of variables will change when + * advancing the step if the writing application writes different variables at + * different times. + * + * IN: fname pathname of file/stream to be opened + * method read method to use for this particular stream + * comm the MPI communicator of all processes that want to read data from the stream + * If compiled with -D_NOMPI, pass any integer here. + * lock_mode In case of real streams, a step may need to be locked in memory to be able + * to read all data of the step completely. + * timeout_sec >=0.0: block until the stream becomes available but + * for max 'timeout_sec' seconds. + * 0.0 means return immediately if stream is not available + * <0.0: block possibly forever + * Note: <0.0 does not ever return with err_file_not_found error, + * which is dangerous if the stream name is simply mistyped in the code. + * RETURN: pointer to an ADIOS_FILE struct, NULL on error (sets adios_errno) + * + * Note: the current_step field of the returned struct indicates which step the stream is at. + * Steps start from 0. + * + * Possible errors (adios_errno values): + * err_file_not_found_error File/stream does not exist / not yet available + * err_end_of_stream Stream has ended, nothing is available and + * no more steps should be expected. + */ +ADIOS_FILE * adios_read_open (const char * fname, + enum ADIOS_READ_METHOD method, + MPI_Comm comm, + enum ADIOS_LOCKMODE lock_mode, + float timeout_sec); + +/* Backward compatibility to 1.5 */ +#define adios_read_open_stream adios_read_open + +/** Open an adios file as a file. + * Each variable can have different number of steps, which is reported in adios_inq_var(). + * Arbitrary steps of a variable can be read at any time. + * In general, the 'last_step' field of the returned ADIOS_FILE struct indicates + * the number of open-write-close cycles of the writing application, while + * 'current_step' is always 0. If all variables have been written at each writing step, + * 'last_step' equals the 'nsteps' available for each variable reported by adios_inq_var(). + * + * + * IN: fname pathname of file to be opened + * method read method to use for this particular file + * comm the MPI communicator of all processes that want to read data from the file + * If compiled with -D_NOMPI, pass any integer here. + * RETURN: pointer to an ADIOS_FILE struct, NULL on error (sets adios_errno) + * + * Possible errors (adios_errno values): + * err_file_not_found_error File does not exist + */ +ADIOS_FILE * adios_read_open_file (const char * fname, + enum ADIOS_READ_METHOD method, + MPI_Comm comm); + +/** Close an adios file. + * It will free the content of the underlying data structures and the fp pointer itself. + * IN: fp pointer to an ADIOS_FILE struct + * RETURN: 0 OK, !=0 on error (adios_errno value) + */ +int adios_read_close (ADIOS_FILE *fp); + + +/** Advance the current step of a stream. + * In case of streams, + * - An error should be expected for any step, + * since that might not yet be available + * - Also, only the current step can be read. + * - Seeking to step N informs the read method that all steps + * before N can be removed if space is needed. + * For files opened as file, stepping has no effect. + * + * IN: fp pointer to an ADIOS_FILE struct + * last 0: next available step, !=0: newest available step + * timeout_sec >=0.0: block until the next step becomes available but + * for max 'timeout_sec' seconds. + * 0.0 means return immediately if step is not available + * <0.0: block forever if necessary + * RETURN: 0 OK, !=0 on error (adios_errno value) + * + * Possible errors (adios_errno values): + * err_end_of_stream Stream has ended, no more steps should be expected + * err_step_notready The requested step is not yet available + * err_step_disappeared The requested step is not available anymore + */ +int adios_advance_step (ADIOS_FILE *fp, int last, float timeout_sec); + +/** Release a step in a stream without seeking to the next step. + * This function is to inform the read method that the current step is + * no longer needed, but the reader does not yet want to read another step. + * This function releases the lock on the step only. The current step is not + * changed in the ADIOS_FILE struct, but reading any variable may fail due to + * removal. If no locking is requested at open time, this function has no + * effect at all. + * + * adios_advance_step() also releases the step from which one advances + * forward so it is not necessary to call this function. + */ +void adios_release_step (ADIOS_FILE *fp); + +/** Inquiry about a variable. + * This function does not read anything from the file but processes info + * already in memory after fopen. + * It allocates memory for the ADIOS_VARINFO struct and content, so + * you need to free resources later with adios_free_varinfo(). + * + * Note that you can get a scalar variable's value (including strings) + * with this operation without touching the file/stream. + * The 'stats' element will be NULL after this call. To get the statistics, + * another call must be made after this: adios_inq_var_stat(). + * The 'blocks' element will be NULL after this call. To get the decomposition + * of a variable in the file/stream, another call must be made after this: + * adios_inq_var_blockinfo(). + * + * IN: fp pointer to an (opened) ADIOS_FILE struct + * varname name of the variable + * RETURN: pointer to and ADIOS_VARINFO struct, NULL on error (sets adios_errno) + */ +ADIOS_VARINFO * adios_inq_var (ADIOS_FILE *fp, const char * varname); + +/** Inquiry a variable by index + * varid index of variable (0..fp->nvars-1) + * in fp->vars_namelist of ADIOS_FILE struct + */ +ADIOS_VARINFO * adios_inq_var_byid (ADIOS_FILE *fp, int varid); + +/** Free memory used by an ADIOS_VARINFO struct */ +void adios_free_varinfo (ADIOS_VARINFO *cp); + +/** Get statistics recorded about a variable. + * The information to calculate the statistics are recorded in the metadata, + * so no extra file access is necessary after adios_fopen() for this operation. + * The result is stored in the ADIOS_VARSTAT struct under varinfo.stats. + * + * adios_free_varinfo() will free the extra memory allocated in this call. + * + * IN: fp pointer to an (opened) ADIOS_FILE struct + * varinfo result of adios_inq_var() + * per_step_stat !=0: return statistics also per step + * per_block_stat !=0: return statistics also per writer block + * RETURN: 0 OK, !=0 on error (adios_errno value) + */ +int adios_inq_var_stat (ADIOS_FILE *fp, ADIOS_VARINFO * varinfo, + int per_step_stat, int per_block_stat); + +/** Get the block-decomposition of the variable about how it is stored in + * the file or stream. The decomposition information are recorded in the + * metadata, so no extra file access is necessary after adios_fopen() for + * this operation. The result is stored in the array of + * ADIOS_VARBLOCK structs under varinfo.blocks. + * + * adios_free_varinfo() will free the extra memory allocated in this call. + * + * IN: fp pointer to an (opened) ADIOS_FILE struct + * varinfo result of adios_inq_var() + * RETURN: 0 OK, !=0 on error (adios_errno value) + */ +int adios_inq_var_blockinfo (ADIOS_FILE *fp, ADIOS_VARINFO * varinfo); + +/** Inquiry a mesh by index +* meshid index of mesh (0..fp->nmeshes-1) +* in fp->mesh_namelist of ADIOS_FILE struct +*/ +ADIOS_MESH * adios_inq_mesh_byid (ADIOS_FILE *fp, int meshid); + +/** fill in the complete mesh structure if mesh struct is stored in external file + call adios_inq_mesh_byid() first to determine if external file is NULL +*/ +int adios_complete_meshinfo (ADIOS_FILE *datafile, ADIOS_FILE *meshfile, ADIOS_MESH *meshinfo); + +/** Free memory used by an ADIOS_MESH struct */ +void adios_free_meshinfo (ADIOS_MESH *meshinfo); + +/** Get the mesh information of the variable about how it is stored in + * ADIOS_MESH structure + * IN: fp pointer to an (opened) ADIOS_FILE struct + * varinfo result of adios_inq_var() + * RETURN: 0 OK, !=0 on error + */ +int adios_inq_var_meshinfo (ADIOS_FILE *fp, ADIOS_VARINFO * varinfo); + +/** Schedule reading a variable (slice) from the file. + * You need to call adios_perform_reads() to do the reading of + * variables. + * IN: fp pointer to an (opened) ADIOS_FILE struct + * sel selection created beforehand with adios_selection...(). + * sel=NULL means global selection (whole variable) + * varname name of the variable + * from_step File mode only: read the 'nsteps' consecutive steps + * of a variable from 'from_step'. + * It is not used in case of a stream. + * nsteps Read 'nsteps' consecutive steps of a variable. + * Must be 1 for a stream. + * OUT: data pointer to the memory to hold data of the variable + * In blocking read mode, the memory should be + * pre-allocated. In non-blocking mode, memory can be + * allocated or not, and that changes the behavior of + * the chunked read. If memory is allocated, + * adios_check_read() returns a variable if it is completed. + * If memory is not allocated, the check returns any chunk + * already available of a variable (in ADIOS own memory) + * and the application has to rearrange the data. The user + * has to process/copy the data before getting new chunks. + * RETURN: 0 OK, !=0 on error (adios_errno value) + */ +int adios_schedule_read (const ADIOS_FILE * fp, + const ADIOS_SELECTION * sel, + const char * varname, + int from_steps, + int nsteps, + void * data); + +/** Read a variable by index + * varid index of variable (0..fp->nvars-1) + * in fp->vars_namelist of ADIOS_FILE struct + */ +int adios_schedule_read_byid (const ADIOS_FILE * fp, + const ADIOS_SELECTION * sel, + int varid, + int from_steps, + int nsteps, + void * data); + +// NCSU ALACRITY-ADIOS: Support for those transforms that can change reading behavior (e.g., level-of-detail) +int adios_schedule_read_param (const ADIOS_FILE * fp, + const ADIOS_SELECTION * sel, + const char * varname, + int from_steps, + int nsteps, + const char * param, + void * data); + +int adios_schedule_read_byid_param (const ADIOS_FILE * fp, + const ADIOS_SELECTION * sel, + int varid, + int from_steps, + int nsteps, + const char * param, + void * data); + + +/** Let ADIOS perform the scheduled reads + * IN: blocking If non-zero, return only when all reads are completed. + * If zero, return immediately and report partial completions + * through adios_check_reads() + */ +int adios_perform_reads (const ADIOS_FILE *fp, int blocking); + +/** Get a chunk of completed read(s) in a chunking read scenario. + * Note that a selection of an array specified in a read may be completed in + * multiple chunks (usually when they come from multiple sources, like + * different disks or different application processes). + * This function should be called in a loop until all chunks are processed. + * That is indicated by a 0 return value. A NULL result for chunk only + * indicates that no chunk is available at the time of call. + * + * IN: fp Handler to file or stream + * OUT: chunk A chunk completed by the time of calling this function. + * It is NULL if no chunk is returned. + * RETURN: 0: all chunks have been returned previously, + * no need to call again (chunk is NULL, too) + * 1: some chunks are/will be available, call again + * <0 on error (adios_errno value) + */ +int adios_check_reads (const ADIOS_FILE * fp, + ADIOS_VARCHUNK ** chunk); + +/** Free the memory of a chunk allocated inside adios_check_reads(). + * It only frees the ADIOS_VARCHUNK struct and the ADIOS_SELECTION struct + * pointed by the chunk. The data pointer should never be freed since + * that memory belongs to the reading method. + */ +void adios_free_chunk (ADIOS_VARCHUNK *chunk); + + +/** Get an attribute in a file. + * This function does not read anything from the file but processes info + * already in memory after fopen. + * The memory for the data is allocated within the library. + * You can use free() to free the memory after use. + * + * IN: fp pointer to an (opened) ADIOS_FILE struct + * attrname name of the attribute + * OUT: type adios type of attribute (see enum ADIOS_DATATYPES in adios_types.h) + * size memory size of value (n+1 for a string of n characters) + * data pointer to the value. You need to cast it afterward according to the type. + * RETURN: 0 OK, !=0 on error (adios_errno value) + */ +int adios_get_attr (ADIOS_FILE * fp, + const char * attrname, + enum ADIOS_DATATYPES * type, + int * size, + void ** data); + +/** Convenience function to get an attribute by name + * attrid index of attribute (0..fp->nattrs-1) + * in fp->attr_namelist of ADIOS_FILE struct + */ +int adios_get_attr_byid (ADIOS_FILE * fp, int attrid, + enum ADIOS_DATATYPES * type, + int * size, void ** data); + +/** Return the name of an adios type */ +const char * adios_type_to_string (enum ADIOS_DATATYPES type); + +/** Return the memory size of one data element of an adios type. + * If the type is adios_string, and the second argument is + * the string itself, it returns strlen(data)+1. + * For other types, it does not care about data and returns + * the size occupied by one element. + */ +int adios_type_size(enum ADIOS_DATATYPES type, void *data); + + + +/* ADIOS Read API v1 style grouping */ + +/** Return the list of groups (names) that are written into + * the file. There is always at least one group there. + * + * IN: fp pointer to an (opened) ADIOS_FILE struct + * OUT: group_namelist list of strings, + * Note: one should pass a pointer to char** list + * RETURN: number of groups, <0 on error (adios_errno value) + * + */ +int adios_get_grouplist (ADIOS_FILE *fp, char ***group_namelist); + +/** Restrict the view of variables/attributes to a certain group. + * The provided ADIOS_FILE structure is directly modified but + * another calls can change to a different group view, or reset + * back to full view. + * + * IN: groupid id of the selected group (0..# of groups-1) + * use -1 to reset to the complete list + * IN/OUT: fp pointer to an (opened) ADIOS_FILE struct + * nvars, var_namelist, nattrs, and + * attr_namelist will be modified. + * RETURN: 0 OK, !=0 on error (adios_errno value) + * Note: a stream does not have groups. Only a file can have + * multiple groups (from separate adios_open/adios_close operations) + */ +int adios_group_view (ADIOS_FILE *fp, int groupid); + +/** OTHER API FUNCTIONS **/ + +/* NCSU - Timeseries analysis functions */ +double adios_stat_cor (ADIOS_VARINFO * vix, ADIOS_VARINFO * viy, char * characteristic, uint32_t time_start, uint32_t time_end, uint32_t lag); +double adios_stat_cov (ADIOS_VARINFO * vix, ADIOS_VARINFO * viy, char * characteristic, uint32_t time_start, uint32_t time_end, uint32_t lag); + +/** This function can be called if user defines the sequences of + * dimensions in reversed order for a variable in the ADIOS XML + * definition to view the variable with the correct order of + * dimensions. Call this before reading variables. + */ +void adios_reset_dimension_order (ADIOS_FILE *fp, int is_fortran); + +/** Test function to print basic info about the file to stdout */ +void adios_print_fileinfo (ADIOS_FILE *fp); + +#endif /*__INCLUDED_FROM_FORTRAN_API__*/ + +#ifdef __cplusplus +} +#endif + +#endif /*__ADIOS_READ_VER2_H__*/ + +/**************** + TODOs and MISSING + +1. where and how do we specify how much memory a read method can use internally. E.g. to control how big chunks it can handle. +2. FORTRAN API: v1 API has the same names with different signatures, while the C API does this with #define-s, so + adios_fopen() of v1 is actually adios_fopen_v1() in the compiled library. Do we need to create two separate fortran libs? +3. Option to tell somewhere: abort on error (after printing error to stderr) to help finding bugs. + + + + +****************/ diff --git a/tests/libs/adios/src/public/adios_read_v2_fwd.h b/tests/libs/adios/src/public/adios_read_v2_fwd.h new file mode 100644 index 0000000000..62f61b103f --- /dev/null +++ b/tests/libs/adios/src/public/adios_read_v2_fwd.h @@ -0,0 +1,43 @@ +/* + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2014. Kitware, Inc. All rights reserved. + */ + +/**********************************************************************/ +/* Forward declarations of the C structs used in the read API. This */ +/* header can be directly copied and used in interface code to allow */ +/* classes that use the ADIOS structures in their interface to be */ +/* consumed with no direct knowledge of ADIOS. */ +/**********************************************************************/ +#ifndef __ADIOS_READ_V2_FWD_H__ +#define __ADIOS_READ_V2_FWD_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +struct _ADIOS_FILE; +typedef struct _ADIOS_FILE ADIOS_FILE; + +struct _ADIOS_VARSTAT; +typedef struct _ADIOS_VARSTAT ADIOS_VARSTAT; + +struct _ADIOS_VARBLOCK; +typedef struct _ADIOS_VARBLOCK ADIOS_VARBLOCK; + +struct _ADIOS_VARMESH; +typedef struct _ADIOS_VARMESH ADIOS_VARMESH; + +struct _ADIOS_VARINFO; +typedef struct _ADIOS_VARINFO ADIOS_VARINFO; + +struct _ADIOS_VARCHUNK; +typedef struct _ADIOS_VARCHUNK ADIOS_VARCHUNK; + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif diff --git a/tests/libs/adios/src/public/adios_schema.h b/tests/libs/adios/src/public/adios_schema.h new file mode 100644 index 0000000000..d66d842ec4 --- /dev/null +++ b/tests/libs/adios/src/public/adios_schema.h @@ -0,0 +1,87 @@ +#ifndef ADIOS_SCHEMA_H +#define ADIOS_SCHEMA_H + +#ifdef __cplusplus +extern "C" { +#endif + +enum ADIOS_MESH_TYPE +{ + ADIOS_MESH_UNIFORM = 1 + ,ADIOS_MESH_STRUCTURED = 2 + ,ADIOS_MESH_RECTILINEAR = 3 + ,ADIOS_MESH_UNSTRUCTURED = 4 +}; + +typedef struct +{ + int num_dimensions; + uint64_t * dimensions; + double * origins; + double * spacings; + double * maximums; +} MESH_UNIFORM; + +typedef struct +{ + int use_single_var; // 1 means coordinates-single-var,0 means coordinates-multi-var + int num_dimensions; + uint64_t * dimensions; + char ** coordinates; // name of the variable(s) containing the rectilinear spacing values +} MESH_RECTILINEAR; + +typedef struct +{ + int use_single_var; // 1 means points-single-var, 0 mean points-multi-var + int num_dimensions; + uint64_t * dimensions; + int nspaces; + char ** points; // name of the variable(s) containing the point coordinates +} MESH_STRUCTURED; + +// ADIOS Schema: supported cell types +enum ADIOS_CELL_TYPE +{ + ADIOS_CELL_PT = 1 + ,ADIOS_CELL_LINE = 2 + ,ADIOS_CELL_TRI = 3 + ,ADIOS_CELL_QUAD = 4 + ,ADIOS_CELL_HEX = 5 + ,ADIOS_CELL_PRI = 6 + ,ADIOS_CELL_TET = 7 + ,ADIOS_CELL_PYR = 8 +}; + +typedef struct +{ + int nspaces; + uint64_t npoints; + int nvar_points; // how much vars for points-multi-var, 1 for points-single-var + char ** points; + int ncsets; + uint64_t * ccounts; + char ** cdata; + enum ADIOS_CELL_TYPE * ctypes; +} MESH_UNSTRUCTURED; + + +typedef struct { //type returned by adios_inq_mesh for read method + int id; + char * name; + char * file_name; // 0 means mesh struct from the same file, otherwise mesh struct from externel file + int time_varying; //0 means not time-varying, 1 means time-varying + enum ADIOS_MESH_TYPE type; + union + { + MESH_UNIFORM * uniform; + MESH_RECTILINEAR * rectilinear; + MESH_STRUCTURED * structured; + MESH_UNSTRUCTURED * unstructured; + }; +} ADIOS_MESH; + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/tests/libs/adios/src/public/adios_selection.h b/tests/libs/adios/src/public/adios_selection.h new file mode 100644 index 0000000000..9564f68072 --- /dev/null +++ b/tests/libs/adios/src/public/adios_selection.h @@ -0,0 +1,190 @@ +/* + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + */ + +/* + * Streaming/Chunking/Selection Read API in C for ADIOS BP format + * + * A SELECTION is the data ranges resulting from a QUERY over a file and variable(s). + * + * A SELECTION can be a list of bounding boxes and point-sets. Other data structures + * are not supported. Any query will result in such a selection. + * Other selections are the write-block and auto. + * + * Write block is a block of data written + * by a writer process, it is identified by an index. If each writer outputs one block + * then the index equals to the rank of the write process. With multi-var writing and + * multiple steps in a file, index runs from 0 as rank 0 process' first block. + * + * Auto selection lets the read method to automatically choose what to return. It will + * be a block / blocks of selected writers. + * + * If a query is a simple bounding box, the selection is the bounding box itself, so + * the application does not need to retrieve the selection to work on the read data. + */ +#ifndef __ADIOS_SELECTION_H__ +#define __ADIOS_SELECTION_H__ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/*************************/ +/* Types used in the API */ +/*************************/ + +/* Type of selection */ +enum ADIOS_SELECTION_TYPE { + ADIOS_SELECTION_BOUNDINGBOX = 0, /* Contiguous block of data defined by offsets and counts in each dimension */ + ADIOS_SELECTION_POINTS = 1, /* List of individual points */ + ADIOS_SELECTION_WRITEBLOCK = 2, /* Selection of an individual block written by a writer process */ + ADIOS_SELECTION_AUTO = 3 /* Let the method decide what to return */ +}; + + +/* A Bounding Box */ +typedef struct { + int ndim; + uint64_t *start; + uint64_t *count; +} ADIOS_SELECTION_BOUNDINGBOX_STRUCT; + +/* A list of points. + * It is a 1D array of indices, linearized for all dimension + * (e.g. [i1,j1,k1,i2,j2,k2,...,in,jn,kn] for n points in a 3D space. + */ +typedef struct { + int ndim; + uint64_t npoints; + uint64_t *points; +} ADIOS_SELECTION_POINTS_STRUCT; + +/* A selected block produced by a writer + * Identified with an index in current versions. + */ +typedef struct { + int index; + + // NCSU ALACRITY-ADIOS: + // Adding timestep-relative vs. absolute writeblock selections, as + // well as sub-PG selection support. Both of these are currently only + // used by the transform layer + int is_absolute_index; // 0 if 'index' is relative to the current timestep, != 0 + // otherwie (i.e., absolute index) + int is_sub_pg_selection; // Whether this writeblock selection contains sub-PG bounds. + // The following fields only matter if this is != 0 + + // Reads the linear range of elements in [element_offset, element_offset + nelements) + uint64_t element_offset; + uint64_t nelements; +} ADIOS_SELECTION_WRITEBLOCK_STRUCT; + +/* Let the read method decide what to return to each reading client. + * Hints are method-dependent parameters to influence what and how to + * return (e.g. the ordering of returned chunks, decomposition among + * read processes, etc.) + */ +typedef struct { + char *hints; +} ADIOS_SELECTION_AUTO_STRUCT; + +/** Selection for reading a subset of a variable. + * // A selection is an additive list of bounding boxes and point-sets + */ +//typedef struct ADIOS_SELECTION_STRUCT ADIOS_SELECTION; +typedef struct { + enum ADIOS_SELECTION_TYPE type; /* Type of selection */ + union { + ADIOS_SELECTION_BOUNDINGBOX_STRUCT bb; + ADIOS_SELECTION_POINTS_STRUCT points; + ADIOS_SELECTION_WRITEBLOCK_STRUCT block; + ADIOS_SELECTION_AUTO_STRUCT autosel; + } u; + /*ADIOS_SELECTION *next;*/ +} ADIOS_SELECTION; + +#ifndef __INCLUDED_FROM_FORTRAN_API__ + +/** Boundingbox selection to read a subset of a non-scalar variable. + * IN: + * ndim Number of dimensions + * start array of offsets to start reading in each dimension + * count number of data elements to read in each dimension + * RETURN: A selection which can be used to read variables + */ +ADIOS_SELECTION * adios_selection_boundingbox (int ndim, const uint64_t *start, const uint64_t *count); + + +/** Selection for a selection of an enumeration of positions. + * IN: + * ndim Number of dimensions + * npoints Number of points of the selection + * points 1D array of indices, compacted for all dimension + * (e.g. [i1,j1,k1,i2,j2,k2,...,in,jn,kn] for + * n points in a 3D space. + */ +ADIOS_SELECTION* adios_selection_points (int ndim, uint64_t npoints, const uint64_t *points); + +/** Selection for a block of data coming from a certain producer. + * + * IN: + * index Identifier of the written block, starting from 0 for the first block + * written by producer rank 0. If each writer outputs one block + * then the index equals to the rank of the write process. + * With multi-var writing and multiple steps in a file, index should be + * calculated by the reading application using outside information beyond + * what is provided by the ADIOS Read API. + */ +ADIOS_SELECTION* adios_selection_writeblock (int index); + +/** Let the method decide what data gets to what reader process. + * This selection enables each reading method to provide an 'optimal' + * data transfer from writers to readers. It depends on the method and the + * circumstances, what this selection actually means. + * + * E.g. in situ processing: readers on a compute node will receive all data + * from the writers on the same compute node. + * + * IN: + * hints Method dependent parameters to influence what and how to + * return (e.g. decomposition; ordering of returned chunks) + */ +ADIOS_SELECTION* adios_selection_auto (char * hints); + +/** Make a strided hyperslab selection the same way as in HDF5. + * IN: + * ndim Number of dimentsions + * start array of offsets to start reading in each dimension + * strides striding steps, NULL=1 in all dimensions (= boundingbox) + * count number of data elements to read in each dimension + * blocks block size at each stride, NULL=1 in all dimensions + */ +/* + No support: Klasky, Podhorszki + Support: + +ADIOS_SELECTION* adios_selection_hyperslab (uint64_t ndim, uint64_t *start, uint64_t *strides, + uint64_t *count, uint64_t *blocks); +*/ + + +/** Delete a selection and free up memory used by the selection. + * IN: selection + * RESULT: None + * The ADIOS_SELECTION object can be simply freed by free(), too. + */ +void adios_selection_delete (ADIOS_SELECTION *selection); + + +#endif /*__INCLUDED_FROM_FORTRAN_API__*/ + +#ifdef __cplusplus +} +#endif + +#endif /*__ADIOS_SELECTION_H__*/ diff --git a/tests/libs/adios/src/public/adios_types.h b/tests/libs/adios/src/public/adios_types.h new file mode 100644 index 0000000000..40529010c5 --- /dev/null +++ b/tests/libs/adios/src/public/adios_types.h @@ -0,0 +1,51 @@ +/* + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + */ + +#ifndef ADIOS_TYPES_H +#define ADIOS_TYPES_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* global defines needed for the type creation/setup functions */ +enum ADIOS_DATATYPES {adios_unknown = -1 /* (size) */ + + ,adios_byte = 0 /* (1) */ + ,adios_short = 1 /* (2) */ + ,adios_integer = 2 /* (4) */ + ,adios_long = 4 /* (8) */ + + ,adios_unsigned_byte = 50 /* (1) */ + ,adios_unsigned_short = 51 /* (2) */ + ,adios_unsigned_integer = 52 /* (4) */ + ,adios_unsigned_long = 54 /* (8) */ + + ,adios_real = 5 /* (4) */ + ,adios_double = 6 /* (8) */ + ,adios_long_double = 7 /* (16) */ + + ,adios_string = 9 /* (?) */ + ,adios_complex = 10 /* (8) */ + ,adios_double_complex = 11 /* (16) */ + }; + +enum ADIOS_FLAG {adios_flag_unknown = 0 + ,adios_flag_yes = 1 + ,adios_flag_no = 2 + }; + +enum ADIOS_BUFFER_ALLOC_WHEN {ADIOS_BUFFER_ALLOC_UNKNOWN + ,ADIOS_BUFFER_ALLOC_NOW + ,ADIOS_BUFFER_ALLOC_LATER + }; + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/tests/libs/adios/src/public/mpidummy.h b/tests/libs/adios/src/public/mpidummy.h new file mode 100644 index 0000000000..ae0cbaf7e3 --- /dev/null +++ b/tests/libs/adios/src/public/mpidummy.h @@ -0,0 +1,102 @@ +/* + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + */ + +#ifndef __MPI_DUMMY_H__ +#define __MPI_DUMMY_H__ + +/* + A dummy MPI 'implementation' for the BP READ API, to have an MPI-free version of the API +*/ +#include +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef int MPI_Comm; +typedef uint64_t MPI_Status; +typedef int MPI_File; +typedef int MPI_Info; +typedef int MPI_Datatype; /* Store the byte size of a type in such vars */ +typedef uint64_t MPI_Offset; +typedef int MPI_Fint; + +#define MPI_SUCCESS 0 +#define MPI_ERR_BUFFER 1 /* Invalid buffer pointer */ +#define MPI_ERR_COUNT 2 /* Invalid count argument */ +#define MPI_ERR_TYPE 3 /* Invalid datatype argument */ +#define MPI_ERR_TAG 4 /* Invalid tag argument */ +#define MPI_ERR_COMM 5 /* Invalid communicator */ +#define MPI_MAX_ERROR_STRING 512 +#define MPI_MODE_RDONLY O_RDONLY +#define MPI_SEEK_SET SEEK_SET +#define MPI_SEEK_CUR SEEK_CUR +#define MPI_SEEK_END SEEK_END +#define MPI_BYTE 1 /* I need the size of the type here */ +#define MPI_INFO_NULL 0 + +#define MPI_COMM_NULL 0 +#define MPI_COMM_WORLD 1 +#define MPI_COMM_SELF 2 + +#define MPI_INT 1 +#define MPI_CHAR 2 +#define MPI_DOUBLE 3 + +#define MPI_ANY_SOURCE 0 +#define MPI_ANY_TAG 0 + +#define MPI_SUM 0 + +#define MPI_MAX_PROCESSOR_NAME 32 +int MPI_Init(int *argc, char ***argv); +int MPI_Finalize(); +int MPI_Initialized( int* flag ) ; + +int MPI_Barrier(MPI_Comm comm); +int MPI_Bcast(void *buffer, int count, MPI_Datatype datatype, int root, MPI_Comm comm); + +int MPI_Comm_dup(MPI_Comm comm, MPI_Comm *newcomm); +int MPI_Comm_rank(MPI_Comm comm, int *rank); +int MPI_Comm_size(MPI_Comm comm, int *size); +int MPI_Comm_free(MPI_Comm *comm); +MPI_Comm MPI_Comm_f2c(MPI_Fint comm); + +int MPI_Gather(void *sendbuf, int sendcnt, MPI_Datatype sendtype, void *recvbuf, int recvcnt, MPI_Datatype recvtype, int root, MPI_Comm comm) ; +int MPI_Gatherv(void *sendbuf, int sendcnt, MPI_Datatype sendtype, void *recvbuf, int *recvcnts, int *displs, MPI_Datatype recvtype, int root, MPI_Comm comm); +int MPI_Allgather(void *sendbuf, int sendcount, MPI_Datatype sendtype, + void *recvbuf, int recvcount, MPI_Datatype recvtype, + MPI_Comm comm); + +int MPI_Scatter(void *sendbuf, int sendcnt, MPI_Datatype sendtype, void *recvbuf, int recvcnt, MPI_Datatype recvtype, int root, MPI_Comm comm); +int MPI_Scatterv(void *sendbuf, int *sendcnts, int *displs, MPI_Datatype sendtype, void *recvbuf, int recvcnt, MPI_Datatype recvtype, int root, MPI_Comm comm); + + + +int MPI_File_open(MPI_Comm comm, char *filename, int amode, MPI_Info info, MPI_File *fh); +int MPI_File_close(MPI_File *fh); +int MPI_File_get_size(MPI_File fh, MPI_Offset *size); +int MPI_File_read(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status); +int MPI_File_seek(MPI_File fh, MPI_Offset offset, int whence); + +int MPI_Get_count(MPI_Status *status, MPI_Datatype datatype, int *count); +int MPI_Error_string(int errorcode, char *string, int *resultlen); +int MPI_Comm_split ( MPI_Comm comm, int color, int key, MPI_Comm *comm_out ); + +int MPI_Get_processor_name (char *name, int *resultlen); + +double MPI_Wtime(); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/tests/libs/adios/src/transforms/Makefile.plugins b/tests/libs/adios/src/transforms/Makefile.plugins new file mode 100644 index 0000000000..1a7db30408 --- /dev/null +++ b/tests/libs/adios/src/transforms/Makefile.plugins @@ -0,0 +1,27 @@ +# Identity plugin: +transforms_write_method_SOURCES += transforms/adios_transform_identity_write.c +transforms_read_method_SOURCES += transforms/adios_transform_identity_read.c + +# Zlib plugin: +transforms_write_method_SOURCES += transforms/adios_transform_zlib_write.c +transforms_read_method_SOURCES += transforms/adios_transform_zlib_read.c + +# Bzip2 plugin: +transforms_write_method_SOURCES += transforms/adios_transform_bzip2_write.c +transforms_read_method_SOURCES += transforms/adios_transform_bzip2_read.c + +# Szip plugin: +transforms_write_method_SOURCES += transforms/adios_transform_szip_write.c +transforms_read_method_SOURCES += transforms/adios_transform_szip_read.c + +# ISOBAR plugin: +transforms_write_method_SOURCES += transforms/adios_transform_isobar_write.c +transforms_read_method_SOURCES += transforms/adios_transform_isobar_read.c + +# APLOD plugin: +transforms_write_method_SOURCES += transforms/adios_transform_aplod_write.c +transforms_read_method_SOURCES += transforms/adios_transform_aplod_read.c + +# ALACRITY plugin: +transforms_write_method_SOURCES += transforms/adios_transform_alacrity_write.c +transforms_read_method_SOURCES += transforms/adios_transform_alacrity_read.c diff --git a/tests/libs/adios/src/transforms/adios_transform_alacrity_common.h b/tests/libs/adios/src/transforms/adios_transform_alacrity_common.h new file mode 100644 index 0000000000..afcbf3ff85 --- /dev/null +++ b/tests/libs/adios/src/transforms/adios_transform_alacrity_common.h @@ -0,0 +1,92 @@ +/* + * adios_transform_alacrity_common.h + * + * Created on: Oct 9, 2014 + * Author: David A. Boyuka II + */ +#ifndef ADIOS_TRANSFORM_ALACRITY_COMMON_H_ +#define ADIOS_TRANSFORM_ALACRITY_COMMON_H_ + +#include +#include +#include +#include +//#include + +#include // From ALACRITY, helps with (de)serialization of metadata + +typedef struct { + // Loaded from transform metadata buffer + uint64_t meta_size, index_size, lob_size, origdata_size; + + // Computed + uint64_t meta_offset, index_offset, lob_offset, origdata_offset; + int has_lob, has_origdata; +} adios_transform_alacrity_metadata; + +static const int ALACRITY_TRANSFORM_METADATA_LEN = sizeof(uint8_t) + 4 * sizeof(uint64_t); + +inline static int read_alacrity_transform_metadata(int16_t transform_metadata_len, const void *transform_metadata, adios_transform_alacrity_metadata *alac_metadata) { + assert(alac_metadata && transform_metadata); + if (transform_metadata_len != ALACRITY_TRANSFORM_METADATA_LEN) { + adios_error(err_unspecified, + "Unexpected transform metadata size for ALACRITY transform " + "(is %hu, expected %hu). File may be corrupt, or may have " + "been written using an old version of the ALACRITY data " + "transform plugin.\n", transform_metadata_len, ALACRITY_TRANSFORM_METADATA_LEN); + return 0; + } + + int ret = 1; + memstream_t meta_ms = memstreamInitReturn((void*)transform_metadata); + + const int version = memstreamReadChar(&meta_ms); + if (version == 0) { + alac_metadata->meta_size = memstreamReadUint64(&meta_ms); + alac_metadata->index_size = memstreamReadUint64(&meta_ms); + alac_metadata->lob_size = memstreamReadUint64(&meta_ms); + alac_metadata->origdata_size = memstreamReadUint64(&meta_ms); + + alac_metadata->meta_offset = 0; + alac_metadata->index_offset = alac_metadata->meta_offset + alac_metadata->meta_size; + alac_metadata->lob_offset = alac_metadata->index_offset + alac_metadata->index_size; + alac_metadata->origdata_offset = alac_metadata->lob_offset + alac_metadata->lob_size; + + alac_metadata->has_lob = (alac_metadata->lob_size != 0); + alac_metadata->has_origdata = (alac_metadata->origdata_size != 0); + } else { + adios_error(err_unspecified, + "Unknown ALACRITY transform metadata version %d. " + "File may be corrupt, or this build of ADIOS may not be up-to-date.\n", + version); + ret = 0; + } + + memstreamDestroy(&meta_ms, false); + return ret; +} + +inline static int write_alacrity_transform_metadata(int16_t transform_metadata_len, + void *transform_metadata, const adios_transform_alacrity_metadata *alac_metadata) { + static const int ALAC_VERSION = 0; + + assert(alac_metadata && transform_metadata); + if (transform_metadata_len != ALACRITY_TRANSFORM_METADATA_LEN) { + adios_error(err_unspecified, + "Internal error: ALACRITY transform metadata was not allocated with " + "the correct size (is %hu, expected %hu)\n", + transform_metadata_len, ALACRITY_TRANSFORM_METADATA_LEN); + return 0; + } + + memstream_t meta_ms = memstreamInitReturn(transform_metadata); + memstreamAppendChar(&meta_ms, ALAC_VERSION); + memstreamAppendUint64(&meta_ms, alac_metadata->meta_size); + memstreamAppendUint64(&meta_ms, alac_metadata->index_size); + memstreamAppendUint64(&meta_ms, alac_metadata->lob_size); + memstreamAppendUint64(&meta_ms, alac_metadata->origdata_size); + memstreamDestroy(&meta_ms, false); + return 1; +} + +#endif /* ADIOS_TRANSFORM_ALACRITY_COMMON_H_ */ diff --git a/tests/libs/adios/src/transforms/adios_transform_alacrity_read.c b/tests/libs/adios/src/transforms/adios_transform_alacrity_read.c new file mode 100644 index 0000000000..3f26bc9fef --- /dev/null +++ b/tests/libs/adios/src/transforms/adios_transform_alacrity_read.c @@ -0,0 +1,170 @@ +#include +#include +#include +#include + +#include "core/util.h" +#include "core/adios_logger.h" +#include "core/transforms/adios_transforms_hooks_read.h" +#include "core/transforms/adios_transforms_reqgroup.h" +#include "public/adios_error.h" + +#ifdef ALACRITY + +#include "alacrity.h" + +#include "adios_transform_alacrity_common.h" +#include "adios_transform_identity_read.h" // used to read original data + +int adios_transform_alacrity_is_implemented (void) {return 1;} + +typedef struct { + adios_transform_alacrity_metadata alac_meta; + void *identity_internal; +} alac_pg_read_req_info; + +int adios_transform_alacrity_generate_read_subrequests(adios_transform_read_request *reqgroup, + adios_transform_pg_read_request *pg_reqgroup) +{ + uint64_t read_buffer_size; + alac_pg_read_req_info *pg_internal = (alac_pg_read_req_info*)malloc(sizeof(alac_pg_read_req_info)); + + const int metagood = + read_alacrity_transform_metadata( + pg_reqgroup->transform_metadata_len, + pg_reqgroup->transform_metadata, + &pg_internal->alac_meta); + if (!metagood) { + log_warn("Invalid ALACRITY transform metadata found for PG %d; input file " + "is likely corrupt or written using an old version of ALACRITY\n", + pg_reqgroup->blockidx); + free(pg_internal); + return 1; + } + + // Based on the format of the ALACRITY partition, schedule the required read requests + if (pg_internal->alac_meta.has_origdata) { + // Original data is available, use identity transform read + // Use the Identity method for doing this, since it's just reading original data + adios_transform_generate_read_subrequests_over_original_data( + pg_internal->alac_meta.origdata_offset, + 1, // sieve points + reqgroup, + pg_reqgroup + ); + + // Wrap the identity-specific internal information so we can reproduce it later + pg_internal->identity_internal = pg_reqgroup->transform_internal; + } else if (pg_internal->alac_meta.has_lob) { + // No original data, but low-order bytes are available, so we can decode the partition + // Read the whole partition to do this + void *buf = malloc(pg_reqgroup->raw_var_length); + adios_transform_raw_read_request *subreq = adios_transform_raw_read_request_new_whole_pg(pg_reqgroup, buf); + adios_transform_raw_read_request_append(pg_reqgroup, subreq); + } else { + // No original data or low-order bytes, must use approximate index decoding + adios_error(err_unspecified, "Attempt to read from ALACRITY-transformed data with " + "no original data and no low-order bytes encoded. This " + "function is currently unimplemented.\n"); + return 1; + } + + pg_reqgroup->transform_internal = pg_internal; // Store necessary information for interpreting the read + return 0; +} + +// Do nothing for individual subrequest +adios_datablock * adios_transform_alacrity_subrequest_completed(adios_transform_read_request *reqgroup, + adios_transform_pg_read_request *pg_reqgroup, + adios_transform_raw_read_request *completed_subreq) +{ + return NULL; +} + +adios_datablock * adios_transform_alacrity_pg_reqgroup_completed(adios_transform_read_request *reqgroup, + adios_transform_pg_read_request *completed_pg_reqgroup) +{ + alac_pg_read_req_info *pg_internal = (alac_pg_read_req_info*)completed_pg_reqgroup->transform_internal; + + if (pg_internal->alac_meta.has_origdata) { + // If this is an original data read, we delegate to the Identity implementation + + // Temporarily restore the pg_reqgroup->transform_internal to what the Identity implementation is expecting + completed_pg_reqgroup->transform_internal = pg_internal->identity_internal; + + // Invoke the Identity read implementation + adios_datablock *ret = adios_transform_pg_reqgroup_completed_over_original_data(reqgroup, completed_pg_reqgroup); + + // Revert to our internal info, so it will be free'd by the Transform framework + completed_pg_reqgroup->transform_internal = pg_internal; + + // Return + return ret; + } else if (pg_internal->alac_meta.has_lob) { + // If this is a LOB data read, decode the partition + + // Get the buffer with the transformed data that was read (it's in the + // single child raw read request) + void *raw_buff = completed_pg_reqgroup->subreqs->data; + + // Compute the size of the original data so we can allocate a buffer + uint64_t orig_size = adios_get_type_size(reqgroup->transinfo->orig_type, ""); + int d; + for(d = 0; d < reqgroup->transinfo->orig_ndim; d++) + orig_size *= (uint64_t)(completed_pg_reqgroup->orig_varblock->count[d]); + + // Allocate a buffer to decode into + void* orig_data_buff = malloc(orig_size); + + ALPartitionData output_partition; + uint64_t numElements = 0; + + // Deserialize the ALACRITY partition from the read buffer into a struct + memstream_t ms = memstreamInitReturn(raw_buff); + memstreamSkip(&ms, pg_internal->alac_meta.meta_offset); + ALDeserializeMetadata(&output_partition.metadata, &ms); + memstreamReset(&ms); + memstreamSkip(&ms, pg_internal->alac_meta.index_offset); + ALDeserializeIndex(&output_partition.index, &output_partition.metadata, &ms); + memstreamReset(&ms); + memstreamSkip(&ms, pg_internal->alac_meta.lob_offset); + ALDeserializeData(&output_partition.data, &output_partition.metadata, &ms); + memstreamReset(&ms); + memstreamDestroy(&ms, false); + + // The deserialize functions above allocate their own buffers + output_partition.ownsBuffers = true; + + // Free the read buffer for transformed data (this would be done automatically + // by the transform framework, but do it here to be safe) + free(completed_pg_reqgroup->subreqs->data); + completed_pg_reqgroup->subreqs->data = NULL; + + // Decode the ALPartitionData into an output buffer + int rtn = ALDecode(&output_partition, orig_data_buff, &numElements); + if (ALErrorNone != rtn) { + free(orig_data_buff); + return NULL; + } + + ALPartitionDataDestroy(&output_partition); + + return adios_datablock_new_whole_pg(reqgroup, completed_pg_reqgroup, orig_data_buff); + } else { + abort(); // Should not happen, since no reads should be scheduled in such a case + return NULL; + } +} + +adios_datablock * adios_transform_alacrity_reqgroup_completed(adios_transform_read_request *completed_reqgroup) +{ + return NULL; +} + + +#else + +DECLARE_TRANSFORM_READ_METHOD_UNIMPL(alacrity); + +#endif + diff --git a/tests/libs/adios/src/transforms/adios_transform_alacrity_write.c b/tests/libs/adios/src/transforms/adios_transform_alacrity_write.c new file mode 100644 index 0000000000..360474b5cb --- /dev/null +++ b/tests/libs/adios/src/transforms/adios_transform_alacrity_write.c @@ -0,0 +1,303 @@ +#include +#include +#include + +#include "core/adios_logger.h" +#include "core/transforms/adios_transforms_common.h" +#include "core/transforms/adios_transforms_write.h" +#include "core/transforms/adios_transforms_hooks_write.h" +#include "core/transforms/adios_transforms_util.h" + +#ifdef ALACRITY + +#include "alacrity.h" +#include "alacrity-serialization-debug.h" + +#include "adios_transform_alacrity_common.h" + +typedef struct { + ALEncoderConfig alac_config; + int has_original_data; + int has_low_order_bytes; +} alac_transform_conf_t; + +uint64_t adios_get_type_size(enum ADIOS_DATATYPES type, void *var); + +uint16_t adios_transform_alacrity_get_metadata_size(struct adios_transform_spec *transform_spec) +{ + return sizeof(uint8_t) + (4 * sizeof(uint64_t)); +} + +static alac_transform_conf_t parse_configuration(const struct adios_var_struct *var, const struct adios_transform_spec *transform_spec) { + alac_transform_conf_t config; + config.has_low_order_bytes = 1; + config.has_original_data = 1; + + if (var->pre_transform_type == adios_real) { + ALEncoderConfigure(&config.alac_config, 16, DATATYPE_FLOAT32, ALInvertedIndex); + } else if (var->pre_transform_type == adios_double) { + ALEncoderConfigure(&config.alac_config, 16, DATATYPE_FLOAT64, ALInvertedIndex); + } else { + log_error("The ALACRITY transform can index only real datatypes.\n"); + } + + int i; + for (i = 0; i < transform_spec->param_count; i++) { + const struct adios_transform_spec_kv_pair * const param = &transform_spec->params[i]; + if (strcmp(param->key, "indexForm") == 0) { + if (strcasecmp(param->value, "ALCompressedInvertedIndex") == 0) + config.alac_config.indexForm = ALCompressedInvertedIndex; + else if (strcasecmp(param->value, "ALInvertedIndex") == 0) + config.alac_config.indexForm = ALInvertedIndex; + } else if (strcasecmp(param->key, "sigBits") == 0) { + config.alac_config.significantBits = atoi(param->value); + } else if (strcasecmp(param->key, "loBytes") == 0) { + if (strcasecmp(param->value, "no") == 0 || strcasecmp(param->value, "false") == 0) + config.has_low_order_bytes = 0; + else + config.has_low_order_bytes = 1; + } else if (strcasecmp(param->key, "origData") == 0) { + if (strcasecmp(param->value, "no") == 0 || strcasecmp(param->value, "false") == 0) + config.has_original_data = 0; + else + config.has_original_data = 1; + } + } + + return config; +} + +static void add_bin_layout_size_growth( + alac_transform_conf_t *config, + const struct adios_var_struct *var, const struct adios_transform_spec *transform_spec, + uint64_t *constant_factor, double *linear_factor, double *capped_linear_factor, uint64_t *capped_linear_cap) +{ + const int sigbytes = (config->alac_config.significantBits + 0x07) >> 3; + + *constant_factor += sizeof(bin_id_t) + // Number of bins + sizeof(bin_offset_t); // Ending bin offset + + // Computing an upper bound on the part of the metadata that depends on number of bins is hard. + // Since this is data dependent, we must assume worst-case data, which results in one bin per value + // However, there is always a maximum number of bins possible, based on the sigbits used, so after + // we reach that many bins, we don't need to keep adding this factor. Thus, we use a "capped linear" + // factor that scales linearly (one bin per value) until we reach the "cap" (the max number of bins, + // already set in adios_transform_alacrity_transformed_size_growth). + const int metadata_bytes_per_bin = 2 * sizeof(bin_offset_t); + const int datatype_size = adios_get_type_size(var->pre_transform_type, NULL); + const double metadata_bytes_per_data_bytes = (double)metadata_bytes_per_bin / datatype_size; + + *capped_linear_factor += metadata_bytes_per_data_bytes; // For every value under the cap, add the corresponding number of metadata bytes +} + +static void add_index_size_growth( + alac_transform_conf_t *config, + const struct adios_var_struct *var, const struct adios_transform_spec *transform_spec, + uint64_t *constant_factor, double *linear_factor, double *capped_linear_factor, uint64_t *capped_linear_cap) +{ + const int datatype_size = adios_get_type_size(var->pre_transform_type, NULL); + int metadata_bytes_per_bin = 0; + + *constant_factor += sizeof(ALIndexForm); // Index form + + switch (config->alac_config.indexForm) { + case ALCompressionIndex: + fprintf(stderr, "ALCompressionIndex is UNSUPPORTED in the ALACRITY transform plugin (it should not be possible to reach this error; something has gone very, very wrong)\n"); + abort(); + break; + case ALInvertedIndex: + // No extra metadata for this index forms + *linear_factor += (double)sizeof(rid_t) / datatype_size; // RIDs + break; + case ALCompressedInvertedIndex: + *constant_factor += sizeof(uint64_t) + // Ending index bin offset + sizeof(uint64_t); // PFOR-Delta adds this much overhead to the first chunk of compressed RIDs. If there + // are >1 chunks in a bin, assume the compression makes up for the additional overhead + metadata_bytes_per_bin += sizeof(uint64_t); // Index bin offsets + metadata_bytes_per_bin += 2 * sizeof(uint64_t); // Header of first PFOR-Delta block in each bin; assume later blocks are covered by the reduced index size + *linear_factor += (double)sizeof(rid_t) / datatype_size; // RIDs (assume 1x compression ratio as worst case) + break; + case ALCompressedHybridInvertedIndex: + case ALCompressedSkipInvertedIndex: + case ALCompressedMixInvertedIndex: + case ALCompressedExpansionII: + // All same as above, but there is a higher upper bound linear factor + *constant_factor += sizeof(uint64_t) + + sizeof(uint64_t); + metadata_bytes_per_bin += sizeof(uint64_t); + *linear_factor += (double)(2 * sizeof(rid_t)) / datatype_size; // RIDs (2x due to the hybrid method) + break; + default: + break; + } + + if (metadata_bytes_per_bin > 0) { + const double metadata_bytes_per_data_bytes = (double)metadata_bytes_per_bin / datatype_size; + *capped_linear_factor += metadata_bytes_per_data_bytes; // For every value under the cap, add the corresponding number of metadata bytes + } +} + +static void add_data_size_growth( + alac_transform_conf_t *config, + const struct adios_var_struct *var, const struct adios_transform_spec *transform_spec, + uint64_t *constant_factor, double *linear_factor, double *capped_linear_factor, uint64_t *capped_linear_cap) +{ + const int datatype_size = adios_get_type_size(var->pre_transform_type, NULL); + const int insigbytes = ((datatype_size << 3) - config->alac_config.significantBits + 0x07) >> 3; + + if (config->has_low_order_bytes) + *linear_factor += (double)insigbytes / datatype_size; // insigbytes per data value + if (config->has_original_data) + *linear_factor += 1.0; // data value per data value +} + +void adios_transform_alacrity_transformed_size_growth( + const struct adios_var_struct *var, const struct adios_transform_spec *transform_spec, + uint64_t *constant_factor, double *linear_factor, double *capped_linear_factor, uint64_t *capped_linear_cap) +{ + alac_transform_conf_t config = parse_configuration(var, transform_spec); + + // ALACRITY metadata (not counting bin layout metadata and index-specific metadata, added in below) + *constant_factor = + sizeof(global_rid_t) + // Global RID offset + sizeof(partition_length_t) + // Partition length + sizeof(char) + // Significant bytes + sizeof(char) + // Element size + sizeof(ALDatatype) + // Datatype + sizeof(char); // Endianness + + *linear_factor = 0; // We totally re-encode the data, so start from scratch (i.e., we aren't adding to existing data, we're replacing it) + + // Some of the following metadata upper bounds are proportional to the number of bins, + // which is worst-case linear with number of values, but only up to the max possible bins. + // These bounds will all use the same capped linear cap (bytes corresponding to number of + // values equal to max possible bins), so compute it here, and let each function add to + // the capped linear factor assuming this cap is in place. + const uint64_t max_possible_bins = (1ULL << config.alac_config.significantBits); + const int datatype_size = adios_get_type_size(var->pre_transform_type, NULL); + *capped_linear_cap = max_possible_bins * datatype_size; // There can be at most one bin per value, so stop adding this factor after (max bins) * (bytes per value) bytes + *capped_linear_factor = 0; + +#ifdef ALACRITY_DEBUG +#define PRINT_FACTORS(msg) fprintf(stderr, "%s: const=%llu, lin=%lf, lincap=%lf->%llu\n", (msg), *constant_factor, *linear_factor, *capped_linear_factor, *capped_linear_cap); + fprintf(stderr, "ALACRITY growth compute info: datatype size: %d, maxbins: %llu\n", datatype_size, max_possible_bins); + PRINT_FACTORS("after metadata"); +#else +#define PRINT_FACTORS(msg) ((void)0) +#endif + + add_bin_layout_size_growth(&config, var, transform_spec, constant_factor, linear_factor, capped_linear_factor, capped_linear_cap); + PRINT_FACTORS("after bin layout"); + add_index_size_growth(&config, var, transform_spec, constant_factor, linear_factor, capped_linear_factor, capped_linear_cap); + PRINT_FACTORS("after index"); + add_data_size_growth(&config, var, transform_spec, constant_factor, linear_factor, capped_linear_factor, capped_linear_cap); + PRINT_FACTORS("after data"); + + // Phew! +} + +int adios_transform_alacrity_apply(struct adios_file_struct *fd, + struct adios_var_struct *var, + uint64_t *transformed_len, + int use_shared_buffer, + int *wrote_to_shared_buffer) +{ + // Get the input data and data length + const uint64_t input_size = adios_transform_get_pre_transform_var_size(var); + const void *input_buff = var->data; + + // Determine the ALACRITY encoder configuration to use + alac_transform_conf_t config = parse_configuration(var, var->transform_spec); + + uint32_t numElements = 0; + numElements = input_size / adios_get_type_size(var->pre_transform_type, NULL); + + // decide the output buffer + uint64_t output_size; + void* output_buff = NULL; + ALPartitionData output_partition; + + if (config.alac_config.indexForm == ALInvertedIndex) { + ALEncode(&config.alac_config, input_buff, numElements, &output_partition); + } else if (config.alac_config.indexForm == ALCompressedInvertedIndex) { + config.alac_config.indexForm = ALInvertedIndex; + ALEncode(&config.alac_config, input_buff, numElements, &output_partition); + ALConvertIndexForm(&output_partition.metadata, &output_partition.index, ALCompressedInvertedIndex); + } else { + log_error("Error on indexing %s\n", var->name); + return 0; + } + + output_size = 0; + output_size += ALGetMetadataSize(&output_partition.metadata); + output_size += ALGetIndexSize(&output_partition.index, &output_partition.metadata); + if (config.has_low_order_bytes) + output_size += ALGetDataSize(&output_partition.data, &output_partition.metadata); + if (config.has_original_data) + output_size += input_size; + +#ifdef ALACRITY_DEBUG + fprintf(stderr, "ALGetPartitionDataSize: %llu\n", output_size); +#endif + + if (use_shared_buffer) { + // If shared buffer is permitted, serialize to there + assert(shared_buffer_reserve(fd, output_size)); + + // Write directly to the shared buffer + output_buff = fd->buffer + fd->offset; + } else { // Else, fall back to var->data memory allocation + output_buff = malloc(output_size); + assert(output_buff); + } + *wrote_to_shared_buffer = use_shared_buffer; + + memstream_t ms = memstreamInitReturn(output_buff); + ALSerializeMetadata(&output_partition.metadata, &ms); + ALSerializeIndex(&output_partition.index, &output_partition.metadata, &ms); + if (config.has_low_order_bytes) + ALSerializeData(&output_partition.data, &output_partition.metadata, &ms); + if (config.has_original_data) + memstreamAppendArray(&ms, input_buff, 1, input_size); + + // Check this for later. What do you intend to add in the metadata + if(var->transform_metadata && var->transform_metadata_len > 0) { + adios_transform_alacrity_metadata alac_meta = { + .meta_size = ALGetMetadataSize(&output_partition.metadata), + .index_size = ALGetIndexSize(&output_partition.index, &output_partition.metadata), + .lob_size = (config.has_low_order_bytes) ? ALGetDataSize(&output_partition.data, &output_partition.metadata) : 0, + .origdata_size = (config.has_original_data) ? input_size : 0, + }; + write_alacrity_transform_metadata(var->transform_metadata_len, var->transform_metadata, &alac_meta); + } else { + adios_error_at_line(err_unspecified, __FILE__, __LINE__, + "Internal error: data transform metadata buffer was not allocated " + "by the transform framework for some reason, cannot continue\n"); + return 0; + } + + assert(output_size == ((char*)ms.ptr - (char*)ms.buf)); // Make sure we computed the output size right + + ALPartitionDataDestroy(&output_partition); + memstreamDestroy(&ms, false /* don't free buffer, it's either our return value or the ADIOS shared buffer! */); + + // Wrap up, depending on buffer mode + if (*wrote_to_shared_buffer) { + shared_buffer_mark_written(fd, output_size); + } else { + var->data = output_buff; + var->data_size = output_size; + var->free_data = adios_flag_yes; + } + + *transformed_len = output_size; // Return the size of the data buffer + + return 1; +} + +#else + +DECLARE_TRANSFORM_WRITE_METHOD_UNIMPL(alacrity) + +#endif + diff --git a/tests/libs/adios/src/transforms/adios_transform_aplod_read.c b/tests/libs/adios/src/transforms/adios_transform_aplod_read.c new file mode 100644 index 0000000000..ae48210f3a --- /dev/null +++ b/tests/libs/adios/src/transforms/adios_transform_aplod_read.c @@ -0,0 +1,202 @@ +#include +#include +#include +#include + +#include "util.h" +#include "core/transforms/adios_transforms_hooks_read.h" +#include "core/transforms/adios_transforms_reqgroup.h" + +#ifdef APLOD + +#include + +#include "aplod.h" +#include "adios_transform_identity_read.h" + +#define MAX_COMPONENTS 16 +#define MAX_SEEK_SIEVE_SIZE 1048576 // The maximum number of bytes sieving is allowed to sieve over per seek + +typedef struct { + int numComponents; + int32_t components[MAX_COMPONENTS]; +} aplod_meta_t; + +void parse_aplod_meta(const void *transform_metadata_void, aplod_meta_t *metaout) { + const char *transform_metadata = (const char*)transform_metadata_void; + transform_metadata += sizeof (uint64_t); + + metaout->numComponents = *(int8_t*)transform_metadata; + transform_metadata += sizeof(int8_t); + + memcpy(metaout->components, transform_metadata, metaout->numComponents * sizeof(int32_t)); + transform_metadata += metaout->numComponents * sizeof(int32_t); +} + +typedef struct { + uint64_t numElements; + uint64_t startOff; + + int numComponentsToUse; + + char *outputBuf; +} aplod_read_meta_t; + +int adios_transform_aplod_is_implemented (void) {return 1;} + +int adios_transform_aplod_generate_read_subrequests(adios_transform_read_request *reqgroup, + adios_transform_pg_read_request *pg_reqgroup) +{ + int i; + + // Retrieve APLOD metadata, determine how many components to use + aplod_meta_t aplodmeta; + parse_aplod_meta(pg_reqgroup->transform_metadata, &aplodmeta); + + int numComponentsToUse; + if (!reqgroup->read_param || strcmp(reqgroup->read_param, "") == 0) + numComponentsToUse = aplodmeta.numComponents; + else + numComponentsToUse = atoi(reqgroup->read_param); + + assert(numComponentsToUse > 0); + int totalComponentsSize = 0; + for (i = 0; i < numComponentsToUse; i++) + totalComponentsSize += aplodmeta.components[i]; + + // + const int fulltypelen = adios_get_type_size(reqgroup->transinfo->orig_type, NULL); + const uint64_t totalElementsInPG = pg_reqgroup->raw_var_length / fulltypelen; // We can do this because APLOD leaves PG size unchanged + uint64_t start_off = 0, end_off = totalElementsInPG; + + char *buf; + + // Compute some sieving parameters to check if it makes sense + compute_sieving_offsets_for_pg_selection(pg_reqgroup->pg_intersection_sel, &pg_reqgroup->pg_bounds_sel->u.bb, &start_off, &end_off); + const uint64_t sieveElemCount = end_off - start_off; + const uint64_t maxSeekSize = (totalElementsInPG - sieveElemCount) * fulltypelen; + + // Determine if we should sieve or not. Current heuristic: only if using 1 component (sieving is always better in this case) + if (numComponentsToUse == 1 || maxSeekSize > MAX_SEEK_SIEVE_SIZE) { + // Don't sieve: read only necessary segments + buf = malloc(sieveElemCount * totalComponentsSize); + + int numByteColsDone = 0; + + // Read the element start_pos..end_pos sieving segment from each column + for (i = 0; i < numComponentsToUse; i++) { + adios_transform_raw_read_request *subreq = adios_transform_raw_read_request_new_byte_segment( + pg_reqgroup, + totalElementsInPG * numByteColsDone + start_off * aplodmeta.components[i], + sieveElemCount * aplodmeta.components[i], + buf + sieveElemCount * numByteColsDone); + adios_transform_raw_read_request_append(pg_reqgroup, subreq); + numByteColsDone += aplodmeta.components[i]; + } + } else { + // Sieve: read the whole PG + start_off = 0; + end_off = totalElementsInPG; + + // Don't sieve + buf = malloc(totalElementsInPG * totalComponentsSize); + + adios_transform_raw_read_request *subreq = adios_transform_raw_read_request_new_byte_segment( + pg_reqgroup, + 0, + totalElementsInPG * totalComponentsSize, + buf); + adios_transform_raw_read_request_append(pg_reqgroup, subreq); + } + + // Set up some temp metadata to help us remember stuff for when the data is available + aplod_read_meta_t *arm = (aplod_read_meta_t*)malloc(sizeof(aplod_read_meta_t)); + *arm = (aplod_read_meta_t){ .numElements = end_off - start_off, .outputBuf = buf, + .startOff = start_off, .numComponentsToUse = numComponentsToUse }; + pg_reqgroup->transform_internal = arm; // Store it for later use + + return 0; +} + +// Do nothing for individual subrequest +adios_datablock * adios_transform_aplod_subrequest_completed(adios_transform_read_request *reqgroup, + adios_transform_pg_read_request *pg_reqgroup, + adios_transform_raw_read_request *completed_subreq) +{ + return NULL; +} + + + +adios_datablock * adios_transform_aplod_pg_reqgroup_completed(adios_transform_read_request *reqgroup, + adios_transform_pg_read_request *completed_pg_reqgroup) +{ + uint32_t elementSize = adios_get_type_size(reqgroup->transinfo->orig_type, ""); + + aplod_read_meta_t *arm = (aplod_read_meta_t *)completed_pg_reqgroup->transform_internal; + completed_pg_reqgroup->transform_internal = NULL; + uint64_t raggedOffset = arm->startOff; + void *compressed_buff = arm->outputBuf; + + uint32_t numElements = arm->numElements; + uint64_t decompressed_len = numElements * elementSize; + void* decompressed_buff = malloc (decompressed_len); + + int8_t numComponents = 0; + int32_t *componentVector = 0; + + aplod_meta_t aplodmeta; + parse_aplod_meta(completed_pg_reqgroup->transform_metadata, &aplodmeta); + + APLODConfig_t *config; + + if (reqgroup->transinfo->orig_type == adios_double) { + config = APLODConfigure (aplodmeta.components, aplodmeta.numComponents, APLOD_DOUBLE, APLOD_LITTLE_E); + } else if (reqgroup->transinfo->orig_type == adios_real){ + config = APLODConfigure (aplodmeta.components, aplodmeta.numComponents, APLOD_FLOAT, APLOD_LITTLE_E); + } + + // config->blockLengthElts = numElements; // Bug workaround, disable chunking + config->blockLengthElts = (numElements >= 65536 ? 65536: numElements); + + APLODReconstructComponents (config, + numElements, + 0, + arm->numComponentsToUse, //aplodmeta.numComponents, + 1, // use mask + 0, // mask = 0 + decompressed_buff, + compressed_buff + ); + + APLODDestroy(config); + + // Clear the buffer pointers for all raw read requests, because they all point + // to the same buffer, and would be free'd by the framework if we didn't clear here + adios_transform_raw_read_request *rrr = completed_pg_reqgroup->subreqs; + for (; rrr; rrr = rrr->next) + rrr->data = NULL; + + // Free the actual buffer, and the special metadata container we added + free (arm->outputBuf); + free (arm); + + return adios_datablock_new_ragged_offset(reqgroup->transinfo->orig_type, + completed_pg_reqgroup->timestep, + completed_pg_reqgroup->pg_writeblock_sel, + raggedOffset, + decompressed_buff); +} + +adios_datablock * adios_transform_aplod_reqgroup_completed(adios_transform_read_request *completed_reqgroup) +{ + return NULL; +} + + +#else + +DECLARE_TRANSFORM_READ_METHOD_UNIMPL(aplod); + +#endif + diff --git a/tests/libs/adios/src/transforms/adios_transform_aplod_write.c b/tests/libs/adios/src/transforms/adios_transform_aplod_write.c new file mode 100644 index 0000000000..8690b02130 --- /dev/null +++ b/tests/libs/adios/src/transforms/adios_transform_aplod_write.c @@ -0,0 +1,199 @@ +#include +#include +#include + +#include "core/adios_logger.h" +#include "core/transforms/adios_transforms_common.h" +#include "core/transforms/adios_transforms_write.h" +#include "core/transforms/adios_transforms_hooks_write.h" +#include "core/transforms/adios_transforms_util.h" + +#ifdef APLOD + +#include "aplod.h" + +const int MAX_COMPONENTS = 8; + +uint16_t adios_transform_aplod_get_metadata_size(struct adios_transform_spec *transform_spec) +{ + // Write the component vector here + // No more than 8 components per variable + return (sizeof (uint64_t) + sizeof (int8_t) + 8 * sizeof(int32_t)); +} + +void adios_transform_aplod_transformed_size_growth( + const struct adios_var_struct *var, const struct adios_transform_spec *transform_spec, + uint64_t *constant_factor, double *linear_factor, double *capped_linear_factor, uint64_t *capped_linear_cap) +{ + // Do nothing (defaults to "no transform effect on data size") +} + +int adios_transform_aplod_apply(struct adios_file_struct *fd, + struct adios_var_struct *var, + uint64_t *transformed_len, + int use_shared_buffer, + int *wrote_to_shared_buffer) +{ + // Get the input data and data length + const uint64_t input_size = adios_transform_get_pre_transform_var_size(var); + const void *input_buff = var->data; + + // max size supported is long double + int32_t componentVector[MAX_COMPONENTS]; + int8_t numComponents = 0; + int32_t componentTotals = 0; + + // printf ("[%s] byte = %d, real = %d, double = %d, this = %d\n", var->name, adios_byte, adios_real, adios_double, var->pre_transform_type); + // parse the aplod component vector parameters + /* Old, pre-specparse parameter parsing + if(var->transform_type_param) + { + char transform_param [1024]; + char *transform_param_ptr = 0; + uint16_t transform_param_length = 0; + + char transform_param_option [256]; + + uint16_t idx = 0; + + strcpy (transform_param, var->transform_type_param); + transform_param_ptr = transform_param; + transform_param_length = strlen (transform_param); + + // Get the key + char *key = strtok (transform_param, "="); + + if (strcmp (key, "CV") == 0) { + + char *value = strtok (key, ","); + int32_t componentID = 0; + + while (value) { + int32_t component = atoi (value); + if (component <= 0) { + numComponents = 0; + break ; + } + + componentVector [componentID] = component; + componentTotals += component; + componentID ++; + } + } + } + */ + int i; + int paramError = 0; + for (i = 0; i < var->transform_spec->param_count; i++) { + const char *comp = var->transform_spec->params[i].key; + + int compInt = atoi(comp); + + // Error if any component is non-positive + if (compInt <= 0 || numComponents >= MAX_COMPONENTS) { + numComponents = 0; + paramError = 1; + break; + } + componentVector[numComponents++] = compInt; + componentTotals += compInt; + } + + uint32_t pre_transform_type_size = bp_get_type_size (var->pre_transform_type, ""); + + // Error if components were specified, and the components don't sum to the type size + if ((numComponents > 0) && (componentTotals != pre_transform_type_size)) { + paramError = 1; + } + + if (paramError) { + fprintf(stderr, "Warning: at least one APLOD byte component is a non-positive integer, or all components do not sum to the type size (%d) for variable %s/%s. Using default APLOD configuration instead.\n", + bp_get_type_size (var->pre_transform_type, ""), var->path, var->name); + } + + if ((numComponents == 0) || (componentTotals != pre_transform_type_size)) { + if (var->pre_transform_type == adios_double) { + componentVector [0] = 2; + componentVector [1] = 2; + componentVector [2] = 2; + componentVector [3] = 2; + numComponents = 4; + } else if (var->pre_transform_type == adios_real) { + componentVector [0] = 2; + componentVector [1] = 2; + numComponents = 2; + } else { + numComponents = 0; + + while (componentTotals < pre_transform_type_size - 2) { + componentVector [numComponents ++] = 2; + componentTotals += 2; + } + + componentVector [numComponents ++] = pre_transform_type_size - componentTotals; + } + } + + // decide the output buffer + uint64_t output_size = input_size; + void* output_buff = NULL; + + if (use_shared_buffer) { + // If shared buffer is permitted, serialize to there + assert(shared_buffer_reserve(fd, output_size)); + + // Write directly to the shared buffer + output_buff = fd->buffer + fd->offset; + } else { // Else, fall back to var->data memory allocation + output_buff = malloc(output_size); + assert(output_buff); + } + *wrote_to_shared_buffer = use_shared_buffer; + + // APLOD specific code - Start + uint32_t numElements = input_size / bp_get_type_size (var->pre_transform_type, ""); + + APLODConfig_t *config; + + if (var->pre_transform_type == adios_double) { + config = APLODConfigure (componentVector, numComponents, APLOD_DOUBLE, APLOD_LITTLE_E); + } else if (var->pre_transform_type == adios_real) { + config = APLODConfigure (componentVector, numComponents, APLOD_FLOAT, APLOD_LITTLE_E); + } + // config->blockLengthElts = numElements; // Bug workaround, disable chunking + config->blockLengthElts = (numElements >= 65536 ? 65536: numElements); + + APLODShuffleComponents (config, numElements, 0, numComponents, input_buff, output_buff); + // APLOD specific code - End + + // Wrap up, depending on buffer mode + if (*wrote_to_shared_buffer) { + shared_buffer_mark_written(fd, output_size); + } else { + var->data = output_buff; + var->data_size = output_size; + var->free_data = adios_flag_yes; + } + *transformed_len = output_size; // Return the size of the data buffer + + // Do I copy the PLODHandle_t object as the metadata or do I serialize it into the buffer as well + if(var->transform_metadata && var->transform_metadata_len > 0) + { + memcpy ((char*)var->transform_metadata, &input_size, sizeof(uint64_t)); + memcpy ((char*)var->transform_metadata + sizeof (uint64_t), &numComponents, sizeof (numComponents)); + memcpy ((char*)var->transform_metadata + sizeof (uint64_t) + sizeof (numComponents), componentVector, numComponents * sizeof (int32_t)); + + } + + // Cleanup time + APLODDestroy(config); + + return 1; +} + +#else + +DECLARE_TRANSFORM_WRITE_METHOD_UNIMPL(aplod) + +#endif + diff --git a/tests/libs/adios/src/transforms/adios_transform_bzip2_read.c b/tests/libs/adios/src/transforms/adios_transform_bzip2_read.c new file mode 100755 index 0000000000..612921f472 --- /dev/null +++ b/tests/libs/adios/src/transforms/adios_transform_bzip2_read.c @@ -0,0 +1,117 @@ +#include +#include +#include +#include +#include +#include "util.h" +#include "core/transforms/adios_transforms_hooks_read.h" +#include "core/transforms/adios_transforms_reqgroup.h" + +#ifdef BZIP2 + +#include "bzlib.h" + +int adios_transform_bzip2_is_implemented (void) {return 1;} + +int decompress_bzip2_pre_allocated(const void* input_data, const uint64_t input_len, + void* output_data, uint64_t* output_len) +{ + // bzip2 only support input size of 32 bit integer + + assert(input_data != NULL + && input_len > 0 && input_len <= UINT_MAX + && output_data != NULL + && output_len != NULL && *output_len > 0 && *output_len < UINT_MAX); + + unsigned int input_len_32 = (unsigned int)input_len; + unsigned int output_len_32 = (unsigned int)(*output_len); + + int bz_rtn = BZ2_bzBuffToBuffDecompress((char*)output_data, &output_len_32, + (char*)input_data, input_len_32, + 0, 0 ); + + if(bz_rtn != BZ_OK) + { + printf("BZ2_bzBuffToBuffDecompress error %d\n", bz_rtn); + return -1; + } + + *output_len = output_len_32; + return 0; +} + +int adios_transform_bzip2_generate_read_subrequests(adios_transform_read_request *reqgroup, + adios_transform_pg_read_request *pg_reqgroup) +{ + void *buf = malloc(pg_reqgroup->raw_var_length); + assert(buf); + adios_transform_raw_read_request *subreq = adios_transform_raw_read_request_new_whole_pg(pg_reqgroup, buf); + adios_transform_raw_read_request_append(pg_reqgroup, subreq); + return 0; +} + +// Do nothing for individual subrequest +adios_datablock * adios_transform_bzip2_subrequest_completed(adios_transform_read_request *reqgroup, + adios_transform_pg_read_request *pg_reqgroup, + adios_transform_raw_read_request *completed_subreq) +{ + return NULL; +} + +adios_datablock * adios_transform_bzip2_pg_reqgroup_completed(adios_transform_read_request *reqgroup, + adios_transform_pg_read_request *completed_pg_reqgroup) +{ + uint64_t compressed_size = (uint64_t)completed_pg_reqgroup->raw_var_length; + void* compressed_data = completed_pg_reqgroup->subreqs->data; + + uint64_t uncompressed_size_meta = *((uint64_t*)completed_pg_reqgroup->transform_metadata); + char compress_ok = *((char*)(completed_pg_reqgroup->transform_metadata + sizeof(uint64_t))); + + uint64_t uncompressed_size = adios_get_type_size(reqgroup->transinfo->orig_type, ""); + int d = 0; + for(d = 0; d < reqgroup->transinfo->orig_ndim; d++) + { + uncompressed_size *= (uint64_t)(completed_pg_reqgroup->orig_varblock->count[d]); + } + + if(uncompressed_size_meta != uncompressed_size) + { + printf("WARNING: possible wrong data size or corrupted metadata\n"); + } + + void* uncompressed_data = malloc(uncompressed_size); + if(!uncompressed_data) + { + return NULL; + } + + if(compress_ok == 1) // compression is successful + { + + int rtn = decompress_bzip2_pre_allocated(compressed_data, compressed_size, uncompressed_data, &uncompressed_size); + if(rtn != 0) + { + return NULL; + } + } + else // just copy the buffer since data is not compressed + { + // printf("compression failed before, fall back to memory copy\n"); + memcpy(uncompressed_data, compressed_data, compressed_size); + } + + return adios_datablock_new_whole_pg(reqgroup, completed_pg_reqgroup, uncompressed_data); +} + +adios_datablock * adios_transform_bzip2_reqgroup_completed(adios_transform_read_request *completed_reqgroup) +{ + return NULL; +} + + +#else + +DECLARE_TRANSFORM_READ_METHOD_UNIMPL(bzip2); + +#endif + diff --git a/tests/libs/adios/src/transforms/adios_transform_bzip2_write.c b/tests/libs/adios/src/transforms/adios_transform_bzip2_write.c new file mode 100755 index 0000000000..6c8729a617 --- /dev/null +++ b/tests/libs/adios/src/transforms/adios_transform_bzip2_write.c @@ -0,0 +1,158 @@ +#include +#include +#include +#include +#include + +#include "core/adios_logger.h" +#include "core/transforms/adios_transforms_common.h" +#include "core/transforms/adios_transforms_write.h" +#include "core/transforms/adios_transforms_hooks_write.h" +#include "core/transforms/adios_transforms_util.h" + +#ifdef BZIP2 + +#include "bzlib.h" + +int compress_bzip2_pre_allocated(const void* input_data, + const uint64_t input_len, + void* output_data, + uint64_t* output_len, + int blockSize100k) +{ + // bzip2 only support input size of 32 bit integer + + assert(input_data != NULL && input_len > 0 && output_data != NULL && output_len != NULL && *output_len > 0); + + unsigned int input_len_32 = (unsigned int)input_len; + unsigned int output_len_32 = (unsigned int)(*output_len); + + int bz_rtn = BZ2_bzBuffToBuffCompress((char*)output_data, + &output_len_32, + (char*)input_data, + input_len_32, + blockSize100k, + 0, + 30); + + if(bz_rtn != BZ_OK) + return -1; + + *output_len = output_len_32; + return 0; +} + +uint16_t adios_transform_bzip2_get_metadata_size(struct adios_transform_spec *transform_spec) +{ + return (sizeof(uint64_t) + sizeof(char)); // metadata: original data size (uint64_t) + compression succ flag (char) +} + +void adios_transform_bzip2_transformed_size_growth( + const struct adios_var_struct *var, const struct adios_transform_spec *transform_spec, + uint64_t *constant_factor, double *linear_factor, double *capped_linear_factor, uint64_t *capped_linear_cap) +{ + // Do nothing (defaults to "no transform effect on data size") +} + +int adios_transform_bzip2_apply(struct adios_file_struct *fd, + struct adios_var_struct *var, + uint64_t *transformed_len, + int use_shared_buffer, + int *wrote_to_shared_buffer) +{ + // Get the input data and data length + const uint64_t input_size = adios_transform_get_pre_transform_var_size(var); + const void *input_buff = var->data; + + // parse the compressiong parameter + /* Pre-specparse code + if(var->transform_type_param + && strlen(var->transform_type_param) > 0 + && is_digit_str(var->transform_type_param)) + { + compress_level = atoi(var->transform_type_param); + if(compress_level > 9 || compress_level < 1) + { + compress_level = 9; + } + } + */ + int compress_level = 9; + if (var->transform_spec->param_count > 0) { + compress_level = atoi(var->transform_spec->params[0].key); + if (compress_level < 1 || compress_level > 9) + compress_level = 9; + } + + + // decide the output buffer + uint64_t output_size = input_size; //adios_transform_bzip2_calc_vars_transformed_size(adios_transform_bzip2, input_size, 1); + void* output_buff = NULL; + + if (use_shared_buffer) // If shared buffer is permitted, serialize to there + { + *wrote_to_shared_buffer = 1; + if (!shared_buffer_reserve(fd, output_size)) + { + log_error("Out of memory allocating %llu bytes for %s for bzip2 transform\n", output_size, var->name); + return 0; + } + + // Write directly to the shared buffer + output_buff = fd->buffer + fd->offset; + } + else // Else, fall back to var->data memory allocation + { + *wrote_to_shared_buffer = 0; + output_buff = malloc(output_size); + if (!output_buff) + { + log_error("Out of memory allocating %llu bytes for %s for bzip2 transform\n", output_size, var->name); + return 0; + } + } + + uint64_t actual_output_size = output_size; + char compress_ok = 1; + + int rtn = compress_bzip2_pre_allocated(input_buff, input_size, output_buff, &actual_output_size, compress_level); + + if(0 != rtn // compression failed for some reason, then just copy the buffer + || actual_output_size > input_size) // or size after compression is even larger (not likely to happen since compression lib will return non-zero in this case) + { + // printf("compression failed, fall back to memory copy\n"); + memcpy(output_buff, input_buff, input_size); + actual_output_size = input_size; + compress_ok = 0; // succ sign set to 0 + } + + // Wrap up, depending on buffer mode + if (use_shared_buffer) + { + shared_buffer_mark_written(fd, actual_output_size); + } + else + { + var->data = output_buff; + var->data_size = actual_output_size; + var->free_data = adios_flag_yes; + } + + // copy the metadata, simply the original size before compression + if(var->transform_metadata && var->transform_metadata_len > 0) + { + memcpy((char*)var->transform_metadata, &input_size, sizeof(uint64_t)); + memcpy((char*)var->transform_metadata + sizeof(uint64_t), &compress_ok, sizeof(char)); + } + + *transformed_len = actual_output_size; // Return the size of the data buffer + + return 1; +} + +#else + +DECLARE_TRANSFORM_WRITE_METHOD_UNIMPL(bzip2) + +#endif + diff --git a/tests/libs/adios/src/transforms/adios_transform_identity_read.c b/tests/libs/adios/src/transforms/adios_transform_identity_read.c new file mode 100644 index 0000000000..3c163c18d6 --- /dev/null +++ b/tests/libs/adios/src/transforms/adios_transform_identity_read.c @@ -0,0 +1,203 @@ +/* + * adios_transform_identity_read.c + * + * An implementation of the "identity" transform, which does nothing, but + * exercises the transform framework for testing. + * + * Created on: Jul 31, 2012 + * Author: David A. Boyuka II + */ + +#include +#include +#include +#include "util.h" +#include "core/adios_internals.h" // adios_get_type_size() +#include "core/adios_subvolume.h" +#include "core/transforms/adios_transforms_hooks_read.h" +#include "core/transforms/adios_transforms_reqgroup.h" + +// Implementation of the "identity" transform, which does nothing to +// the data, but exercises the transform framework for testing. + +#define MAX_DIMS 32 +#define FREE(x) { if (x) { free(x); x = NULL; } } + +int adios_transform_identity_is_implemented (void) {return 1;} + +void compute_sieving_offsets_for_pg_selection(const ADIOS_SELECTION *intersect_sel, + const ADIOS_SELECTION_BOUNDINGBOX_STRUCT *pgbb, + uint64_t *start_off_ptr, uint64_t *end_off_ptr) { + uint64_t i; + uint64_t tmp_point[MAX_DIMS]; // For scratchwork + + uint64_t start_off, end_off; // Start/end byte offsets to read between + switch (intersect_sel->type) { + case ADIOS_SELECTION_WRITEBLOCK: + { + if (intersect_sel->u.block.is_sub_pg_selection) { + start_off = intersect_sel->u.block.element_offset; + end_off = intersect_sel->u.block.element_offset + intersect_sel->u.block.nelements; + } else { + start_off = 0; + end_off = compute_volume(pgbb->ndim, pgbb->count); + } + break; + } + case ADIOS_SELECTION_BOUNDINGBOX: + { + const ADIOS_SELECTION_BOUNDINGBOX_STRUCT *bb = &intersect_sel->u.bb; + + vector_sub(bb->ndim, tmp_point, bb->start, pgbb->start); // Selection box start relative to PG + start_off = compute_linear_offset_in_volume(bb->ndim, tmp_point, pgbb->count); + + vector_add(bb->ndim, tmp_point, tmp_point, bb->count); // Selection box end relative to PG + for (i = 0; i < bb->ndim; i++) + tmp_point[i]--; // Reduce all by 1 because bb->start+bb->count is exclusive + end_off = compute_linear_offset_in_volume(bb->ndim, tmp_point, pgbb->count) + 1; // Add 1 because this offset points to the last element, and we want one past that since end_off is exclusive + + break; + } + case ADIOS_SELECTION_POINTS: + { + const ADIOS_SELECTION_POINTS_STRUCT *pts = &intersect_sel->u.points; + + start_off = UINT64_MAX; // Set it to max so that the first point brings it down + end_off = 0; + for (i = 0; i < pts->npoints; i++) { + vector_sub(pts->ndim, tmp_point, pts->points + i * pts->ndim, pgbb->start); + + const uint64_t point_off = compute_linear_offset_in_volume(pts->ndim, tmp_point, pgbb->count); + if (point_off < start_off) + start_off = point_off; + if (point_off > end_off) + end_off = point_off; + } + + end_off++; // Advance past the last element to make it exclusive + + break; + } + + case ADIOS_SELECTION_AUTO: + /* Unsupported */ + break; + } + + *start_off_ptr = start_off; + *end_off_ptr = end_off; +} + +int adios_transform_generate_read_subrequests_over_original_data( + uint64_t original_data_offset_in_pg, + int should_sieve_points, + adios_transform_read_request *reqgroup, + adios_transform_pg_read_request *pg_reqgroup) +{ + int is_point_selection = (pg_reqgroup->pg_intersection_sel->type == ADIOS_SELECTION_POINTS); + + if (!is_point_selection || should_sieve_points) { + pg_reqgroup->transform_internal = NULL; // Is sieving + + uint64_t start_off, end_off; // Start/end byte offsets to read between + compute_sieving_offsets_for_pg_selection(pg_reqgroup->pg_intersection_sel, &pg_reqgroup->pg_bounds_sel->u.bb, &start_off, &end_off); + + int datum_size = adios_get_type_size(reqgroup->transinfo->orig_type, NULL); // Get the data type size + + // Allocate a buffer for the read, and create a raw read request for it + const uint64_t buflen = (end_off - start_off) * datum_size; + void *buf = malloc(buflen); + adios_transform_raw_read_request *subreq = + adios_transform_raw_read_request_new_byte_segment(pg_reqgroup, original_data_offset_in_pg + start_off * datum_size, buflen, buf); + + // Store the ragged start offset + subreq->transform_internal = malloc(sizeof(uint64_t)); + *(uint64_t*)subreq->transform_internal = start_off; + + // Append the raw read request + adios_transform_raw_read_request_append(pg_reqgroup, subreq); + } else { + const int ndim = pg_reqgroup->pg_intersection_sel->u.points.ndim; + const uint64_t *points = pg_reqgroup->pg_intersection_sel->u.points.points; + + const int datum_size = adios_get_type_size(reqgroup->transinfo->orig_type, NULL); // Get the data type size + const int npoints = pg_reqgroup->pg_intersection_sel->u.points.npoints; + const uint64_t bufsize = npoints * datum_size; + + char *buf = malloc(bufsize); + + int p; + for (p = 0; p < npoints; p++) { + const uint64_t *point = &points[p * ndim]; + const uint64_t offset = compute_linear_offset_in_volume(ndim, point, pg_reqgroup->pg_bounds_sel->u.bb.count); + + adios_transform_raw_read_request *subreq = + adios_transform_raw_read_request_new_byte_segment(pg_reqgroup, original_data_offset_in_pg + offset * datum_size, 1, buf + p * datum_size); + adios_transform_raw_read_request_append(pg_reqgroup, subreq); + } + + pg_reqgroup->transform_internal = buf; + } + + return 0; +} + + +adios_datablock * adios_transform_pg_reqgroup_completed_over_original_data( + adios_transform_read_request *reqgroup, + adios_transform_pg_read_request *completed_pg_reqgroup) +{ + adios_datablock *db; + if (completed_pg_reqgroup->transform_internal) { + void *data = completed_pg_reqgroup->transform_internal; + + db = adios_datablock_new(reqgroup->transinfo->orig_type, + completed_pg_reqgroup->timestep, + completed_pg_reqgroup->pg_intersection_sel, + data); + + FREE(completed_pg_reqgroup->transform_internal); + } else { + uint64_t ragged_offset = *(uint64_t*)completed_pg_reqgroup->subreqs->transform_internal; + + // Transfer ownership of the data buffer + void *pg_data = completed_pg_reqgroup->subreqs->data; + completed_pg_reqgroup->subreqs->data = NULL; + + db = adios_datablock_new_ragged_offset(reqgroup->transinfo->orig_type, + completed_pg_reqgroup->timestep, + completed_pg_reqgroup->pg_writeblock_sel, + ragged_offset, + pg_data); + + FREE(completed_pg_reqgroup->subreqs->transform_internal); + } + + return db; +} + +int adios_transform_identity_generate_read_subrequests(adios_transform_read_request *reqgroup, + adios_transform_pg_read_request *pg_reqgroup) { + + int sieve_points = (reqgroup->read_param && strcmp(reqgroup->read_param, "sieve") == 0); + return adios_transform_generate_read_subrequests_over_original_data(0, sieve_points, reqgroup, pg_reqgroup); +} + +// Do nothing for individual subrequest +adios_datablock * adios_transform_identity_subrequest_completed( + adios_transform_read_request *reqgroup, + adios_transform_pg_read_request *pg_reqgroup, + adios_transform_raw_read_request *completed_subreq) { + return NULL; +} + +adios_datablock * adios_transform_identity_pg_reqgroup_completed( + adios_transform_read_request *reqgroup, + adios_transform_pg_read_request *completed_pg_reqgroup) { + return adios_transform_pg_reqgroup_completed_over_original_data(reqgroup, completed_pg_reqgroup); +} + +adios_datablock * adios_transform_identity_reqgroup_completed( + adios_transform_read_request *completed_reqgroup) { + return NULL; +} diff --git a/tests/libs/adios/src/transforms/adios_transform_identity_read.h b/tests/libs/adios/src/transforms/adios_transform_identity_read.h new file mode 100644 index 0000000000..1c9ab3a326 --- /dev/null +++ b/tests/libs/adios/src/transforms/adios_transform_identity_read.h @@ -0,0 +1,58 @@ +/* + * adios_transform_identity_read.h + * + * Created on: Apr 12, 2013 + * Author: David A. Boyuka II + */ + +#ifndef ADIOS_TRANSFORM_IDENTITY_READ_H_ +#define ADIOS_TRANSFORM_IDENTITY_READ_H_ + +// This function is shared with APLOD +/* + * Computes the linearized element start and end offsets of a selection (intersect_sel) within + * a PG (bounded by pgbb). If all elements between these two offsets is read, and then + * returned as a datablock with ragged offset equal to the start offset returned here, + * all data within intersect_sel will be present and results patching will work. + * @param intersect_sel the intersecting portion of some global read selection with a PG. It must + * be fully contained in the PG bounds, as specified by pgbb. + * @param pgbb the bounds of the PG + * @param start_off_ptr a pointer to where the start offset will be stored + * @param end_off_ptr a pointer to where the end offset will be stored + */ +void compute_sieving_offsets_for_pg_selection(const ADIOS_SELECTION *intersect_sel, + const ADIOS_SELECTION_BOUNDINGBOX_STRUCT *pgbb, + uint64_t *start_off_ptr, uint64_t *end_off_ptr); + +// This function is shared with ALACRITY, and is available to aid any data transform that stores +// the original data unchanged as part of the transformed data. +/* + * Schedules raw read requests over a copy of the user's original data. This function is expected + * to be paired with a calls to adios_transform_handle_pg_reqgroup_completed(). + * + * This original data is assumed to be contiguous at some location within the PG (specified via + * original_data_offset_in_pg). If should_sieve_points is true, point selections will be serviced + * using a single read request, rather than reading each point individually. + * + * Note: in addition to submitting adios_transform_raw_read_requests, this function also requires + * full use of the pg_reqgroup->transform_internal field. If the calling data transform needs this + * field, it should be wrapped after calling this function, then restored before calling + * adios_transform_handle_pg_reqgroup_completed(). + */ +int adios_transform_generate_read_subrequests_over_original_data( + uint64_t original_data_offset_in_pg, + int should_sieve_points, + adios_transform_read_request *reqgroup, + adios_transform_pg_read_request *pg_reqgroup); + +/* + * Processes raw read requests submitted earlier by + * adios_transform_generate_read_subrequests_over_original_data(). Should be called on every + * completed raw read request that was scheduled by + * adios_transform_generate_read_subrequests_over_original_data(). + */ +adios_datablock * adios_transform_pg_reqgroup_completed_over_original_data( + adios_transform_read_request *reqgroup, + adios_transform_pg_read_request *completed_pg_reqgroup); + +#endif /* ADIOS_TRANSFORM_IDENTITY_READ_H_ */ diff --git a/tests/libs/adios/src/transforms/adios_transform_identity_write.c b/tests/libs/adios/src/transforms/adios_transform_identity_write.c new file mode 100644 index 0000000000..6fa6d7b14c --- /dev/null +++ b/tests/libs/adios/src/transforms/adios_transform_identity_write.c @@ -0,0 +1,37 @@ +/* + * adios_transform_identity_write.c + * + * An implementation of the "identity" transform, which does nothing, but + * exercises the transform framework for testing. + * + * Created on: Jul 31, 2012 + * Author: David A. Boyuka II + */ + +#include +#include + +#include "core/adios_internals.h" +#include "core/transforms/adios_transforms_write.h" +#include "core/transforms/adios_transforms_hooks_write.h" + + +uint16_t adios_transform_identity_get_metadata_size(struct adios_transform_spec *transform_spec) { + return 0; +} + +void adios_transform_identity_transformed_size_growth( + const struct adios_var_struct *var, const struct adios_transform_spec *transform_spec, + uint64_t *constant_factor, double *linear_factor, double *capped_linear_factor, uint64_t *capped_linear_cap) +{ + // Do nothing (defaults to "no transform effect on data size") +} + +int adios_transform_identity_apply(struct adios_file_struct *fd, struct adios_var_struct *var, uint64_t *transformed_len, + int use_shared_buffer, int *wrote_to_shared_buffer) { + // Just use what is already in var->data; size remains the same, and no + // shared buffer is used + *transformed_len = adios_transform_get_pre_transform_var_size(var); + *wrote_to_shared_buffer = 0; + return 1; +} diff --git a/tests/libs/adios/src/transforms/adios_transform_isobar_read.c b/tests/libs/adios/src/transforms/adios_transform_isobar_read.c new file mode 100755 index 0000000000..844fbe59e3 --- /dev/null +++ b/tests/libs/adios/src/transforms/adios_transform_isobar_read.c @@ -0,0 +1,130 @@ +#include +#include +#include +#include + +#include "util.h" +#include "core/transforms/adios_transforms_hooks_read.h" +#include "core/transforms/adios_transforms_reqgroup.h" + +#ifdef ISOBAR + +#include "isobar.h" + +#define ELEMENT_BYTES 8 + +int adios_transform_isobar_is_implemented (void) {return 1;} + +int decompress_isobar_pre_allocated(const void* input_data, const uint64_t input_len, + void* output_data, uint64_t* output_len) +{ + assert(input_data != NULL && input_len > 0 && output_data != NULL && output_len != NULL && *output_len > 0); + + enum ISOBAR_status status; + struct isobar_stream i_strm; + + status = isobarInflateInit(&i_strm, ELEMENT_BYTES); + if(status != ISOBAR_SUCCESS) + { + printf("isobarInflateInit error\n"); + return -1; + } + + i_strm.next_in = (void*) input_data; + i_strm.avail_in = input_len; + i_strm.next_out = (void*) output_data; + i_strm.avail_out = *output_len;; + + status = isobarInflate(&i_strm, ISOBAR_FINISH); + if(status != ISOBAR_SUCCESS) + { + printf("isobarInflate error\n"); + return -1; + } + + status = isobarInflateEnd(&i_strm); + if(status != ISOBAR_SUCCESS) + { + printf("isobarInflateEnd error\n"); + return -1; + } + + return 0; +} + +int adios_transform_isobar_generate_read_subrequests(adios_transform_read_request *reqgroup, + adios_transform_pg_read_request *pg_reqgroup) +{ + void *buf = malloc(pg_reqgroup->raw_var_length); + assert(buf); + adios_transform_raw_read_request *subreq = adios_transform_raw_read_request_new_whole_pg(pg_reqgroup, buf); + adios_transform_raw_read_request_append(pg_reqgroup, subreq); + return 0; +} + +// Do nothing for individual subrequest +adios_datablock * adios_transform_isobar_subrequest_completed(adios_transform_read_request *reqgroup, + adios_transform_pg_read_request *pg_reqgroup, + adios_transform_raw_read_request *completed_subreq) +{ + return NULL; +} + + + +adios_datablock * adios_transform_isobar_pg_reqgroup_completed(adios_transform_read_request *reqgroup, + adios_transform_pg_read_request *completed_pg_reqgroup) +{ + uint64_t compressed_size = (uint64_t)completed_pg_reqgroup->raw_var_length; + void* compressed_data = completed_pg_reqgroup->subreqs->data; + + uint64_t uncompressed_size_meta = *((uint64_t*)completed_pg_reqgroup->transform_metadata); + char compress_ok = *((char*)(completed_pg_reqgroup->transform_metadata + sizeof(uint64_t))); + + uint64_t uncompressed_size = adios_get_type_size(reqgroup->transinfo->orig_type, ""); + int d = 0; + for(d = 0; d < reqgroup->transinfo->orig_ndim; d++) + { + uncompressed_size *= (uint64_t)(completed_pg_reqgroup->orig_varblock->count[d]); + } + + if(uncompressed_size_meta != uncompressed_size) + { + printf("WARNING: possible wrong data size or corrupted metadata\n"); + } + + void* uncompressed_data = malloc(uncompressed_size); + if(!uncompressed_data) + { + return NULL; + } + + if(compress_ok == 1) // compression is successful + { + int rtn = decompress_isobar_pre_allocated(compressed_data, compressed_size, uncompressed_data, &uncompressed_size); + if(0 != rtn) + { + return NULL; + } + } + else // just copy the buffer since data is not compressed + { + // printf("compression failed before, fall back to memory copy\n"); + memcpy(uncompressed_data, compressed_data, compressed_size); + } + + return adios_datablock_new_whole_pg(reqgroup, completed_pg_reqgroup, uncompressed_data); +} + +adios_datablock * adios_transform_isobar_reqgroup_completed(adios_transform_read_request *completed_reqgroup) +{ + return NULL; +} + + +#else + +DECLARE_TRANSFORM_READ_METHOD_UNIMPL(isobar); + +#endif + diff --git a/tests/libs/adios/src/transforms/adios_transform_isobar_write.c b/tests/libs/adios/src/transforms/adios_transform_isobar_write.c new file mode 100755 index 0000000000..7b6081d661 --- /dev/null +++ b/tests/libs/adios/src/transforms/adios_transform_isobar_write.c @@ -0,0 +1,192 @@ +#include +#include +#include +#include + +#include "core/adios_logger.h" +#include "core/transforms/adios_transforms_common.h" +#include "core/transforms/adios_transforms_write.h" +#include "core/transforms/adios_transforms_hooks_write.h" +#include "core/transforms/adios_transforms_util.h" + +#ifdef ISOBAR + +#include "isobar.h" + +#define ELEMENT_BYTES 8 + +static int is_digit_str(char* input_str) +{ + if(strlen(input_str) > 2) // at most 2 digits for isobar + { + return 0; + } + + int i = 0; + for(i = 0; i < strlen(input_str); i++) + { + if(input_str[i] > '9' || input_str[i] < '0') + { + return 0; + } + } + return 1; +} + +int compress_isobar_pre_allocated(const void* input_data, const uint64_t input_len, + void* output_data, uint64_t* output_len, int compress_level) +{ + assert(input_data != NULL && input_len > 0 && output_data != NULL && output_len != NULL && *output_len > 0); + + enum ISOBAR_status status; + struct isobar_stream i_strm; + + status = isobarDeflateInit(&i_strm, ELEMENT_BYTES, compress_level); + if(status != ISOBAR_SUCCESS) + { + return -1; + } + + i_strm.next_in = (void*) input_data; + i_strm.avail_in = input_len; + + status = isobarDeflateAnalysis(&i_strm); + if(status != ISOBAR_SUCCESS) + { + return -1; + } + + i_strm.next_out = (void*) output_data; + i_strm.avail_out = input_len; + + status = isobarDeflate(&i_strm, ISOBAR_FINISH); + if(status != ISOBAR_SUCCESS) + { + return -1; + } + + status = isobarDeflateEnd(&i_strm); + if(status != ISOBAR_SUCCESS) + { + return -1; + } + + *output_len = input_len - i_strm.avail_out; + return 0; +} + +uint16_t adios_transform_isobar_get_metadata_size(struct adios_transform_spec *transform_spec) +{ + return (sizeof(uint64_t) + sizeof(char)); // metadata: original data size (uint64_t) + compression succ flag (char) +} + +void adios_transform_isobar_transformed_size_growth( + const struct adios_var_struct *var, const struct adios_transform_spec *transform_spec, + uint64_t *constant_factor, double *linear_factor, double *capped_linear_factor, uint64_t *capped_linear_cap) +{ + // Do nothing (defaults to "no transform effect on data size") +} + +int adios_transform_isobar_apply(struct adios_file_struct *fd, + struct adios_var_struct *var, + uint64_t *transformed_len, + int use_shared_buffer, + int *wrote_to_shared_buffer) +{ + // Get the input data and data length + const uint64_t input_size = adios_transform_get_pre_transform_var_size(var); + const void *input_buff = var->data; + + // parse the compressiong parameter + /* pre-specparse code + int compress_level = ISOBAR_SPEED; + if(var->transform_type_param + && strlen(var->transform_type_param) > 0 + && is_digit_str(var->transform_type_param)) + { + compress_level = atoi(var->transform_type_param); + if(compress_level > 9 || compress_level < 1) + { + compress_level = ISOBAR_SPEED; + } + } + */ + int compress_level = ISOBAR_SPEED; + if (var->transform_spec->param_count > 0) { + compress_level = atoi(var->transform_spec->params[0].key); + if (compress_level < 1 || compress_level > 9) + compress_level = ISOBAR_SPEED; + } + + // decide the output buffer + uint64_t output_size = input_size; //adios_transform_isobar_calc_vars_transformed_size(adios_transform_isobar, input_size, 1); + + void* output_buff = NULL; + + if (use_shared_buffer) // If shared buffer is permitted, serialize to there + { + *wrote_to_shared_buffer = 1; + if (!shared_buffer_reserve(fd, output_size)) + { + log_error("Out of memory allocating %llu bytes for %s for isobar transform\n", output_size, var->name); + return 0; + } + + // Write directly to the shared buffer + output_buff = fd->buffer + fd->offset; + } + else // Else, fall back to var->data memory allocation + { + *wrote_to_shared_buffer = 0; + output_buff = malloc(output_size); + if (!output_buff) + { + log_error("Out of memory allocating %llu bytes for %s for isobar transform\n", output_size, var->name); + return 0; + } + } + + uint64_t actual_output_size = output_size; + char compress_ok = 1; + + // compress it + int rtn = compress_isobar_pre_allocated(input_buff, input_size, output_buff, &actual_output_size, compress_level); + + if(0 != rtn // compression failed for some reason, then just copy the buffer + || actual_output_size > input_size) // or size after compression is even larger (not likely to happen since compression lib will return non-zero in this case) + { + // printf("compression failed, fall back to memory copy\n"); + memcpy(output_buff, input_buff, input_size); + actual_output_size = input_size; + compress_ok = 0; // succ sign set to 0 + } + + // Wrap up, depending on buffer mode + if (use_shared_buffer) + { + shared_buffer_mark_written(fd, actual_output_size); + } + else + { + var->data = output_buff; + var->data_size = actual_output_size; + var->free_data = adios_flag_yes; + } + + // copy the metadata, simply the original size before compression + if(var->transform_metadata && var->transform_metadata_len > 0) + { + memcpy((char*)var->transform_metadata, &input_size, sizeof(uint64_t)); + memcpy((char*)var->transform_metadata + sizeof(uint64_t), &compress_ok, sizeof(char)); + } + + *transformed_len = actual_output_size; // Return the size of the data buffer + return 1; +} + +#else + +DECLARE_TRANSFORM_WRITE_METHOD_UNIMPL(isobar) + +#endif + diff --git a/tests/libs/adios/src/transforms/adios_transform_szip.h b/tests/libs/adios/src/transforms/adios_transform_szip.h new file mode 100644 index 0000000000..09757a9d3f --- /dev/null +++ b/tests/libs/adios/src/transforms/adios_transform_szip.h @@ -0,0 +1,139 @@ + +#include +#include "szlib.h" + +#define MIN(a,b) (((a)<(b)) ? (a) : (b)) + +#define VERIFY_INPUT_PRE() assert(input_data != NULL && input_len > 0 && output_data != NULL && output_len != NULL && *output_len > 0) + +enum COMPRESS_TYPE +{ + compress_type_unknown = -1 + ,compress_type_none = 0 + ,compress_type_zlib = 1 + ,compress_type_bzlib2 = 2 + ,compress_type_szip = 3 + ,num_compress_types = 4 // Not counting unknown; KEEP THIS UPDATED +}; + + +static const struct +{ + const char *alias; // A possible name for a compres method + enum COMPRESS_TYPE type; // The corresponding COMPRESS_TYPE +} COMPRESS_TYPE_NAMES[] = { + { "unknown" , compress_type_unknown } + + ,{ "none" , compress_type_none } + ,{ "no" , compress_type_none } + ,{ "raw" , compress_type_none } + ,{ "" , compress_type_none } + + ,{ "zlib" , compress_type_zlib } + ,{ "zip" , compress_type_zlib } + + ,{ "bzlib2" , compress_type_bzlib2 } + ,{ "bzip2" , compress_type_bzlib2 } + + ,{ "szlib" , compress_type_szip } + ,{ "szip" , compress_type_szip } +}; + + +// #define EXPAND_SIZE(s) (((double)(s)*1.01)+12) + +#define EXPAND_SIZE(s) (s) + +/////////////// initilization for szip /////////////// + +enum +{ + O32_LITTLE_ENDIAN = 0x03020100ul, + O32_BIG_ENDIAN = 0x00010203ul, + O32_PDP_ENDIAN = 0x01000302ul +}; + +static const union { unsigned char bytes[4]; uint32_t value; } o32_host_order = + { { 0, 1, 2, 3 } }; + +#define O32_HOST_ORDER (o32_host_order.value) + +// #define H5_SZIP_ALLOW_K13_OPTION_MASK 1 +// #define H5_SZIP_CHIP_OPTION_MASK 2 +// #define H5_SZIP_EC_OPTION_MASK 4 +// #define H5_SZIP_NN_OPTION_MASK 32 +// #define H5_SZIP_MAX_PIXELS_PER_BLOCK 32 + +static int init_szip_parameters(SZ_com_t* p_sz_param, const uint32_t ndims, const uint64_t* dim) +{ + assert(p_sz_param && ndims > 0 && dim); + p_sz_param->options_mask = SZ_NN_OPTION_MASK; + + p_sz_param->options_mask &= (~SZ_CHIP_OPTION_MASK); + p_sz_param->options_mask |= SZ_ALLOW_K13_OPTION_MASK; + + /* Always set "raw" (no szip header) flag for data */ + p_sz_param->options_mask |= SZ_RAW_OPTION_MASK; + + /* Mask off the LSB and MSB options, if they were given */ + /* (The HDF5 library sets them internally, as needed) */ + p_sz_param->options_mask &= ~(SZ_LSB_OPTION_MASK|SZ_MSB_OPTION_MASK); + + p_sz_param->options_mask &= ~(SZ_LSB_OPTION_MASK|SZ_MSB_OPTION_MASK); + switch(O32_HOST_ORDER) + { + case O32_LITTLE_ENDIAN: /* Little-endian byte order */ + // printf("little endian\n"); + p_sz_param->options_mask |= SZ_LSB_OPTION_MASK; + break; + + case O32_BIG_ENDIAN: /* Big-endian byte order */ + p_sz_param->options_mask |= SZ_MSB_OPTION_MASK; + break; + + default: + p_sz_param->options_mask |= SZ_LSB_OPTION_MASK; + break; + } /* end switch */ + + p_sz_param->bits_per_pixel = 64; + p_sz_param->pixels_per_block = 32; + + uint32_t npoints = 1; + uint32_t i = 0; + for(i = 0; i < ndims; i++) + { + npoints *= dim[i]; + } + + uint32_t scanline = dim[ndims - 1]; + + if(scanline < p_sz_param->pixels_per_block) + { + + if(npoints < 0 || npoints < p_sz_param->pixels_per_block) + { + printf("buffer too small for szip compression %d\n", npoints); + return -1; + } + + scanline = MIN((p_sz_param->pixels_per_block * SZ_MAX_BLOCKS_PER_SCANLINE), npoints); + } + else + { + if(scanline <= SZ_MAX_PIXELS_PER_SCANLINE) + { + scanline = MIN((p_sz_param->pixels_per_block * SZ_MAX_BLOCKS_PER_SCANLINE), scanline); + } + else + { + scanline = p_sz_param->pixels_per_block * SZ_MAX_BLOCKS_PER_SCANLINE; + } + } + + p_sz_param->pixels_per_scanline = scanline; + return 0; +} +//////////////////////////////////////////////////////////// + + diff --git a/tests/libs/adios/src/transforms/adios_transform_szip_read.c b/tests/libs/adios/src/transforms/adios_transform_szip_read.c new file mode 100644 index 0000000000..8b3ed0a9db --- /dev/null +++ b/tests/libs/adios/src/transforms/adios_transform_szip_read.c @@ -0,0 +1,94 @@ +#include +#include +#include +#include "util.h" +#include "core/transforms/adios_transforms_hooks_read.h" +#include "core/transforms/adios_transforms_reqgroup.h" + +#ifdef SZIP + +#include "adios_transform_szip.h" + +int adios_transform_szip_is_implemented (void) {return 1;} + +int decompress_szip_pre_allocated(const void* input_data, const uint64_t input_len, + void* output_data, uint64_t* output_len, + const uint32_t ndims, const uint64_t* dim) +{ + assert(input_data != NULL && input_len > 0 && output_data != NULL && output_len != NULL && *output_len > 0); + + SZ_com_t sz_param; + + int sz_rtn = init_szip_parameters(&sz_param, ndims, dim); + if(sz_rtn != 0) + { + return -1; + } + + size_t temp_len = *output_len; + + sz_rtn = SZ_BufftoBuffDecompress(output_data, &temp_len, input_data, input_len, &sz_param); + if(sz_rtn != SZ_OK) + { + printf("SZ_BufftoBuffDecompress error %d\n", sz_rtn); + return -1; + } + + *output_len = (uint64_t)(temp_len); + + return 0; +} + +int adios_transform_szip_generate_read_subrequests(adios_transform_read_request *reqgroup, + adios_transform_pg_read_request *pg_reqgroup) +{ + void *buf = malloc(pg_reqgroup->raw_var_length); + adios_transform_raw_read_request *subreq = adios_transform_raw_read_request_new_whole_pg(pg_reqgroup, buf); + adios_transform_raw_read_request_append(pg_reqgroup, subreq); + return 0; +} + +// Do nothing for individual subrequest +adios_datablock * adios_transform_szip_subrequest_completed(adios_transform_read_request *reqgroup, + adios_transform_pg_read_request *pg_reqgroup, + adios_transform_raw_read_request *completed_subreq) +{ + return NULL; +} + +adios_datablock * adios_transform_szip_pg_reqgroup_completed(adios_transform_read_request *reqgroup, + adios_transform_pg_read_request *completed_pg_reqgroup) +{ + uint64_t raw_size = (uint64_t)completed_pg_reqgroup->raw_var_length; + void* raw_buff = completed_pg_reqgroup->subreqs->data; + + uint64_t orig_size = adios_get_type_size(reqgroup->transinfo->orig_type, ""); + int d = 0; + for(d = 0; d < reqgroup->transinfo->orig_ndim; d++) + orig_size *= (uint64_t)(completed_pg_reqgroup->orig_varblock->count[d]); + + void* orig_buff = malloc(orig_size); + + int ndims = 1; + uint64_t dim[1] = {orig_size / sizeof(double)}; + int rtn = decompress_szip_pre_allocated(raw_buff, raw_size, orig_buff, &orig_size, ndims, dim); + if(rtn != 0) + { + return NULL; + } + + return adios_datablock_new_whole_pg(reqgroup, completed_pg_reqgroup, orig_buff); +} + +adios_datablock * adios_transform_szip_reqgroup_completed(adios_transform_read_request *completed_reqgroup) +{ + return NULL; +} + + +#else + +DECLARE_TRANSFORM_READ_METHOD_UNIMPL(szip); + +#endif + diff --git a/tests/libs/adios/src/transforms/adios_transform_szip_write.c b/tests/libs/adios/src/transforms/adios_transform_szip_write.c new file mode 100755 index 0000000000..f82855e5a7 --- /dev/null +++ b/tests/libs/adios/src/transforms/adios_transform_szip_write.c @@ -0,0 +1,119 @@ +#include +#include +#include +#include + +#include "core/adios_logger.h" +#include "core/transforms/adios_transforms_common.h" +#include "core/transforms/adios_transforms_write.h" +#include "core/transforms/adios_transforms_hooks_write.h" +#include "core/transforms/adios_transforms_util.h" + +#ifdef SZIP + +#include "adios_transform_szip.h" + +// assume double precision only +int compress_szip_pre_allocated(const void* input_data, const uint64_t input_len, + void* output_data, uint64_t* output_len, + const int ndims, const uint64_t* dim) +{ + assert(input_data != NULL && input_len > 0 && output_data != NULL && output_len != NULL && *output_len > 0); + + int rtn = 0; + + SZ_com_t sz_param; + + rtn = init_szip_parameters(&sz_param, ndims, dim); + if (rtn != 0) + { + return -1; + } + + size_t temp = *output_len; + + rtn = SZ_BufftoBuffCompress(output_data, &temp, input_data, input_len, &sz_param); + if (SZ_OK != rtn) + { + // printf("SZ_BufftoBuffCompress error %d\n", rtn); + return -1; + } + + *output_len = temp; + + return 0; +} + +uint16_t adios_transform_szip_get_metadata_size(struct adios_transform_spec *transform_spec) +{ + return 0; +} + +void adios_transform_szip_transformed_size_growth( + const struct adios_var_struct *var, const struct adios_transform_spec *transform_spec, + uint64_t *constant_factor, double *linear_factor, double *capped_linear_factor, uint64_t *capped_linear_cap) +{ + // Do nothing (defaults to "no transform effect on data size") +} + +int adios_transform_szip_apply(struct adios_file_struct *fd, + struct adios_var_struct *var, + uint64_t *transformed_len, + int use_shared_buffer, + int *wrote_to_shared_buffer) +{ + // Get the input data and data length + const uint64_t input_size = adios_transform_get_pre_transform_var_size(var); + const void *input_buff = var->data; + + // decide the output buffer + uint64_t output_size = input_size; //adios_transform_szip_calc_vars_transformed_size(adios_transform_szip, input_size, 1); + void* output_buff = NULL; + + if (use_shared_buffer) { + // If shared buffer is permitted, serialize to there + assert(shared_buffer_reserve(fd, output_size)); + + // Write directly to the shared buffer + output_buff = fd->buffer + fd->offset; + } else { // Else, fall back to var->data memory allocation + output_buff = malloc(output_size); + assert(output_buff); + } + *wrote_to_shared_buffer = use_shared_buffer; + + // compress it + int ndims = 1; + uint64_t dim[1] = {input_size/sizeof(double)}; + + // double d1 = dclock(); + int rtn = compress_szip_pre_allocated(input_buff, input_size, output_buff, &output_size, ndims, dim); + // double d2 = dclock(); + + if(0 != rtn // compression failed for some reason, then just copy the buffer + || output_size > input_size) // or size after compression is even larger (not likely to happen since compression lib will return non-zero in this case) + { + return 0; + } + + // printf("compress_szip_succ|%d|%d|%d|%f\n", rtn, input_size, actual_output_size, d2 - d1); + + // Wrap up, depending on buffer mode + if (*wrote_to_shared_buffer) { + shared_buffer_mark_written(fd, output_size); + } else { + var->data = output_buff; + var->data_size = output_size; + var->free_data = adios_flag_yes; + } + + *transformed_len = output_size; // Return the size of the data buffer + return 1; +} + +#else + +DECLARE_TRANSFORM_WRITE_METHOD_UNIMPL(szip) + +#endif + diff --git a/tests/libs/adios/src/transforms/adios_transform_template_read.c b/tests/libs/adios/src/transforms/adios_transform_template_read.c new file mode 100644 index 0000000000..90c690c274 --- /dev/null +++ b/tests/libs/adios/src/transforms/adios_transform_template_read.c @@ -0,0 +1,63 @@ +#include +#include +#include +#include + +#include "util.h" +#include "adios_transforms_hooks_read.h" +#include "adios_transforms_reqgroup.h" + +#ifdef TEMPLATE + +int adios_transform_template_is_implemented (void) {return 1;} + +int adios_transform_template_generate_read_subrequests(adios_transform_read_request *reqgroup, + adios_transform_pg_read_request *pg_reqgroup) +{ + void *buf = malloc(pg_reqgroup->raw_var_length); + adios_transform_raw_read_request *subreq = adios_transform_raw_read_request_new_whole_pg(pg_reqgroup, buf); + adios_transform_raw_read_request_append(pg_reqgroup, subreq); + return 0; +} + +// Do nothing for individual subrequest +adios_datablock * adios_transform_template_subrequest_completed(adios_transform_read_request *reqgroup, + adios_transform_pg_read_request *pg_reqgroup, + adios_transform_raw_read_request *completed_subreq) +{ + return NULL; +} + + + +adios_datablock * adios_transform_template_pg_reqgroup_completed(adios_transform_read_request *reqgroup, + adios_transform_pg_read_request *completed_pg_reqgroup) +{ + uint64_t raw_size = (uint64_t)completed_pg_reqgroup->raw_var_length; + void* raw_buff = completed_pg_reqgroup->subreqs->data; + + uint64_t orig_size = adios_get_type_size(reqgroup->transinfo->orig_type, ""); + int d = 0; + for(d = 0; d < reqgroup->transinfo->orig_ndim; d++) + orig_size *= (uint64_t)(completed_pg_reqgroup->orig_varblock->count[d]); + + void* orig_buff = malloc(orig_size); + + // Decompress into orig_buff + + return adios_datablock_new_whole_pg(reqgroup, completed_pg_reqgroup, orig_buff); +} + +// Do nothing for the full read request complete (typical) +adios_datablock * adios_transform_template_reqgroup_completed(adios_transform_read_request *completed_reqgroup) +{ + return NULL; +} + + +#else + +DECLARE_TRANSFORM_READ_METHOD_UNIMPL(zlib); + +#endif + diff --git a/tests/libs/adios/src/transforms/adios_transform_template_write.c b/tests/libs/adios/src/transforms/adios_transform_template_write.c new file mode 100644 index 0000000000..8740ff230e --- /dev/null +++ b/tests/libs/adios/src/transforms/adios_transform_template_write.c @@ -0,0 +1,72 @@ +#include +#include +#include +#include + +#include "adios_logger.h" +#include "adios_transforms_common.h" +#include "adios_transforms_write.h" +#include "adios_transforms_hooks_write.h" +#include "adios_transforms_util.h" + +#ifdef TEMPLATE + +uint16_t adios_transform_template_get_metadata_size(struct adios_transform_spec *transform_spec) +{ + return 0; // Set amount of transform-internal metadata space to allocate +} + +void adios_transform_template_transformed_size_growth( + const struct adios_var_struct *var, const struct adios_transform_spec *transform_spec, + uint64_t *constant_factor, double *linear_factor, double *capped_linear_factor, uint64_t *capped_linear_cap) +{ + // Set growth factors here (or return immediately to default to "no transform effect on data size") +} + +int adios_transform_template_apply(struct adios_file_struct *fd, + struct adios_var_struct *var, + uint64_t *transformed_len, + int use_shared_buffer, + int *wrote_to_shared_buffer) +{ + // Get the input data and data length + const uint64_t input_size = adios_transform_get_pre_transform_var_size(var); + const void *input_buff = var->data; + + // decide the output buffer + uint64_t output_size = /* Compute how much output size we need */; + void* output_buff = NULL; + + if (use_shared_buffer) { + // If shared buffer is permitted, serialize to there + assert(shared_buffer_reserve(fd, output_size)); + + // Write directly to the shared buffer + output_buff = fd->buffer + fd->offset; + } else { // Else, fall back to var->data memory allocation + output_buff = malloc(output_size); + assert(output_buff); + } + *wrote_to_shared_buffer = use_shared_buffer; + + // Do transform from input_buff into output_buff, and update output_size to the true output size + + // Wrap up, depending on buffer mode + if (*wrote_to_shared_buffer) { + shared_buffer_mark_written(fd, output_size); + } else { + var->data = output_buff; + var->data_size = output_size; + var->free_data = adios_flag_yes; + } + + *transformed_len = output_size; // Return the size of the data buffer + return 1; +} + +#else + +DECLARE_TRANSFORM_WRITE_METHOD_UNIMPL(template) + +#endif + diff --git a/tests/libs/adios/src/transforms/adios_transform_zlib_read.c b/tests/libs/adios/src/transforms/adios_transform_zlib_read.c new file mode 100755 index 0000000000..b42c69cf0d --- /dev/null +++ b/tests/libs/adios/src/transforms/adios_transform_zlib_read.c @@ -0,0 +1,114 @@ +#include +#include +#include +#include + +#include "core/util.h" +#include "core/adios_logger.h" +#include "core/transforms/adios_transforms_hooks_read.h" +#include "core/transforms/adios_transforms_reqgroup.h" +#include "core/adios_internals.h" // adios_get_type_size() + +#ifdef ZLIB + +#include "zlib.h" + +int adios_transform_zlib_is_implemented (void) {return 1;} + +int decompress_zlib_pre_allocated(const void* input_data, + const uint64_t input_len, + void* output_data, + uint64_t* output_len) +{ + assert(input_data != NULL && input_len > 0 && output_data != NULL && output_len != NULL && *output_len > 0); + + uLongf dest_temp = *output_len; + + int z_rtn = uncompress((Bytef*)output_data, &dest_temp, (Bytef*)input_data, input_len); + if(z_rtn != Z_OK) + { + // printf("zlib uncompress error %d\n", z_rtn); + return -1; + } + + *output_len = (uint64_t)dest_temp; + + return 0; +} + +int adios_transform_zlib_generate_read_subrequests(adios_transform_read_request *reqgroup, + adios_transform_pg_read_request *pg_reqgroup) +{ + void *buf = malloc(pg_reqgroup->raw_var_length); + assert(buf); + adios_transform_raw_read_request *subreq = adios_transform_raw_read_request_new_whole_pg(pg_reqgroup, buf); + adios_transform_raw_read_request_append(pg_reqgroup, subreq); + return 0; +} + +// Do nothing for individual subrequest +adios_datablock * adios_transform_zlib_subrequest_completed(adios_transform_read_request *reqgroup, + adios_transform_pg_read_request *pg_reqgroup, + adios_transform_raw_read_request *completed_subreq) +{ + return NULL; +} + + + +adios_datablock * adios_transform_zlib_pg_reqgroup_completed(adios_transform_read_request *reqgroup, + adios_transform_pg_read_request *completed_pg_reqgroup) +{ + uint64_t compressed_size = (uint64_t)completed_pg_reqgroup->raw_var_length; + void* compressed_data = completed_pg_reqgroup->subreqs->data; + + uint64_t uncompressed_size_meta = *((uint64_t*)completed_pg_reqgroup->transform_metadata); + char compress_ok = *((char*)(completed_pg_reqgroup->transform_metadata + sizeof(uint64_t))); + + uint64_t uncompressed_size = adios_get_type_size(reqgroup->transinfo->orig_type, ""); + int d = 0; + for(d = 0; d < reqgroup->transinfo->orig_ndim; d++) + { + uncompressed_size *= (uint64_t)(completed_pg_reqgroup->orig_varblock->count[d]); + } + + if(uncompressed_size_meta != uncompressed_size) + { + printf("WARNING: possible wrong data size or corrupted metadata\n"); + } + + void* uncompressed_data = malloc(uncompressed_size); + if(!uncompressed_data) + { + return NULL; + } + + if(compress_ok == 1) // compression is successful + { + int rtn = decompress_zlib_pre_allocated(compressed_data, compressed_size, uncompressed_data, &uncompressed_size); + if(0 != rtn) + { + return NULL; + } + } + else // just copy the buffer since data is not compressed + { + // printf("compression failed before, fall back to memory copy\n"); + memcpy(uncompressed_data, compressed_data, compressed_size); + } + + return adios_datablock_new_whole_pg(reqgroup, completed_pg_reqgroup, uncompressed_data); +} + +adios_datablock * adios_transform_zlib_reqgroup_completed(adios_transform_read_request *completed_reqgroup) +{ + return NULL; +} + + +#else + +DECLARE_TRANSFORM_READ_METHOD_UNIMPL(zlib); + +#endif + diff --git a/tests/libs/adios/src/transforms/adios_transform_zlib_write.c b/tests/libs/adios/src/transforms/adios_transform_zlib_write.c new file mode 100755 index 0000000000..ab20798a0b --- /dev/null +++ b/tests/libs/adios/src/transforms/adios_transform_zlib_write.c @@ -0,0 +1,179 @@ +#include +#include +#include +#include + +#include "core/adios_logger.h" +#include "core/transforms/adios_transforms_common.h" +#include "core/transforms/adios_transforms_write.h" +#include "core/transforms/adios_transforms_hooks_write.h" +#include "core/transforms/adios_transforms_util.h" + +#ifdef ZLIB + +#include "zlib.h" + +#if 0 +static int is_digit_str(char* input_str) +{ + if(strlen(input_str) > 2) // at most 2 digits for zlib + { + return 0; + } + + int i = 0; + for(i = 0; i < strlen(input_str); i++) + { + if(input_str[i] > '9' || input_str[i] < '0') + { + return 0; + } + } + return 1; +} +#endif + +int compress_zlib_pre_allocated(const void* input_data, + const uint64_t input_len, + void* output_data, + uint64_t* output_len, + int compress_level) +{ + assert(input_data != NULL && input_len > 0 && output_data != NULL && output_len != NULL && *output_len > 0); + + uLongf temp = *output_len; + int zerr = compress2((Bytef*)(output_data), + &temp, + (Bytef*)input_data, + (uLongf)input_len, + compress_level); + + *output_len = (uint64_t)temp; + + if(zerr != Z_OK) + { + // printf("zlib compress2 error %d\n", zerr); + return -1; + } + return 0; +} + +uint16_t adios_transform_zlib_get_metadata_size(struct adios_transform_spec *transform_spec) +{ + return (sizeof(uint64_t) + sizeof(char)); // metadata: original data size (uint64_t) + compression succ flag (char) +} + +void adios_transform_zlib_transformed_size_growth( + const struct adios_var_struct *var, const struct adios_transform_spec *transform_spec, + uint64_t *constant_factor, double *linear_factor, double *capped_linear_factor, uint64_t *capped_linear_cap) +{ + // Do nothing (defaults to "no transform effect on data size") +} + +int adios_transform_zlib_apply(struct adios_file_struct *fd, + struct adios_var_struct *var, + uint64_t *transformed_len, + int use_shared_buffer, + int *wrote_to_shared_buffer) +{ + // Assume this function is only called for ZLIB transform type + assert(var->transform_type == adios_transform_zlib); + + // Get the input data and data length + const uint64_t input_size = adios_transform_get_pre_transform_var_size(var); + const void *input_buff= var->data; + + // parse the compressiong parameter + /* pre-specparse code + int compress_level = Z_DEFAULT_COMPRESSION; + if(var->transform_type_param + && strlen(var->transform_type_param) > 0 + && is_digit_str(var->transform_type_param)) // all conditions should satisfy, or just use default compression level + { + compress_level = atoi(var->transform_type_param); + if(compress_level > 9 || compress_level < 1) // out of range, use default + { + compress_level = Z_DEFAULT_COMPRESSION; + } + } + */ + int compress_level = Z_DEFAULT_COMPRESSION; + if (var->transform_spec->param_count > 0) { + compress_level = atoi(var->transform_spec->params[0].key); + if (compress_level < 1 || compress_level > 9) + compress_level = Z_DEFAULT_COMPRESSION; + } + + + // decide the output buffer + uint64_t output_size = input_size; // for compression, at most the original data size + void* output_buff = NULL; + + if (use_shared_buffer) // If shared buffer is permitted, serialize to there + { + *wrote_to_shared_buffer = 1; + if (!shared_buffer_reserve(fd, output_size)) + { + log_error("Out of memory allocating %llu bytes for %s for zlib transform\n", output_size, var->name); + return 0; + } + + // Write directly to the shared buffer + output_buff = fd->buffer + fd->offset; + } + else // Else, fall back to var->data memory allocation + { + *wrote_to_shared_buffer = 0; + output_buff = malloc(output_size); + if (!output_buff) + { + log_error("Out of memory allocating %llu bytes for %s for zlib transform\n", output_size, var->name); + return 0; + } + } + + // compress it + uint64_t actual_output_size = output_size; + char compress_ok = 1; + + int rtn = compress_zlib_pre_allocated(input_buff, input_size, output_buff, &actual_output_size, compress_level); + + if(0 != rtn // compression failed for some reason, then just copy the buffer + || actual_output_size > input_size) // or size after compression is even larger (not likely to happen since compression lib will return non-zero in this case) + { + // printf("compression failed, fall back to memory copy\n"); + memcpy(output_buff, input_buff, input_size); + actual_output_size = input_size; + compress_ok = 0; // succ sign set to 0 + } + + // Wrap up, depending on buffer mode + if (use_shared_buffer) + { + shared_buffer_mark_written(fd, actual_output_size); + } + else + { + var->data = output_buff; + var->data_size = actual_output_size; + var->free_data = adios_flag_yes; + } + + // copy the metadata, simply the original size before compression + if(var->transform_metadata && var->transform_metadata_len > 0) + { + memcpy((char*)var->transform_metadata, &input_size, sizeof(uint64_t)); + memcpy((char*)var->transform_metadata + sizeof(uint64_t), &compress_ok, sizeof(char)); + } + + *transformed_len = actual_output_size; // Return the size of the data buffer + + return 1; +} + +#else + +DECLARE_TRANSFORM_WRITE_METHOD_UNIMPL(zlib) + +#endif + diff --git a/tests/libs/adios/src/transforms/transform_plugins.h b/tests/libs/adios/src/transforms/transform_plugins.h new file mode 100644 index 0000000000..0ee1938455 --- /dev/null +++ b/tests/libs/adios/src/transforms/transform_plugins.h @@ -0,0 +1,14 @@ +/* + * This file contains a registry of all transform plugins to be compiled into ADIOS. + * If you wish to add a new transform plugin, you must add a line here. + */ + +// Arguments: type ID (C identifier), in-XML name, method UID, human-readable description +REGISTER_TRANSFORM_PLUGIN(identity, "identity", "identity", "Identity transform") +REGISTER_TRANSFORM_PLUGIN(zlib, "zlib", "zlib", "zlib compression") +REGISTER_TRANSFORM_PLUGIN(bzip2, "bzip2", "bzip2", "bzip2 compression") +REGISTER_TRANSFORM_PLUGIN(szip, "szip", "szip", "szip compression") +REGISTER_TRANSFORM_PLUGIN(isobar, "isobar", "ncsu-isobar", "ISOBAR compression") +REGISTER_TRANSFORM_PLUGIN(aplod, "aplod", "ncsu-aplod", "APLOD byte-columnar precision-level-of-detail access format") +REGISTER_TRANSFORM_PLUGIN(alacrity, "alacrity", "ncsu-alacrity", "ALACRITY indexing") + diff --git a/tests/libs/adios/tests/C/CMakeLists.txt b/tests/libs/adios/tests/C/CMakeLists.txt new file mode 100644 index 0000000000..4776b6fdf8 --- /dev/null +++ b/tests/libs/adios/tests/C/CMakeLists.txt @@ -0,0 +1,20 @@ +include_directories(${PROJECT_SOURCE_DIR}/tests/C) +include_directories(${PROJECT_SOURCE_DIR}/src/public) +include_directories(${PROJECT_SOURCE_DIR}/src) +link_directories(${PROJECT_BINARY_DIR}/src) +link_directories(${MXML_INCLUDE_DIR}/../lib) + +add_executable(adios_test_c adios_test_c.c) +target_link_libraries(adios_test_c adios ${ADIOSLIB_LDADD} ${MPI_C_LIBRARIES}) +set(adios_test_c_CPPFLAGS "${ADIOSLIB_CPPFLAGS}") +set(adios_test_c_CFLAGS "${ADIOSLIB_CFLAGS}") +set_target_properties(adios_test_c PROPERTIES COMPILE_FLAGS "${adios_test_c_CFLAGS} ${adios_test_c_CPPFLAGS} ${MPI_C_COMPILE_FLAGS}") +if(MPI_LINK_FLAGS) + set_target_properties(adios_test_c PROPERTIES LINK_FLAGS "${MPI_C_LINK_FLAGS}") +endif() + +file(COPY config_c.xml DESTINATION ${PROJECT_BINARY_DIR}/tests/C) + +add_subdirectory(flexpath_tests) +add_subdirectory(fgr_tests) +add_subdirectory(query) diff --git a/tests/libs/adios/tests/C/Makefile.am b/tests/libs/adios/tests/C/Makefile.am new file mode 100644 index 0000000000..bcd3f164e5 --- /dev/null +++ b/tests/libs/adios/tests/C/Makefile.am @@ -0,0 +1,22 @@ +AM_CPPFLAGS = $(all_includes) +AM_CPPFLAGS += -I$(top_srcdir)/src -I$(top_srcdir)/src/public + +SUBDIRS=flexpath_tests fgr_tests query + +AUTOMAKE_OPTIONS = no-dependencies + +all-local: + test "$(srcdir)" = "$(builddir)" || cp $(srcdir)/*.xml $(builddir) + +noinst_PROGRAMS=adios_test_c + +adios_test_c_SOURCES = adios_test_c.c +adios_test_c_CPPFLAGS = $(AM_CPPFLAGS) $(ADIOSLIB_CPPFLAGS) +adios_test_c_CFLAGS = $(ADIOSLIB_CFLAGS) +adios_test_c_LDADD = $(top_builddir)/src/libadios.a $(ADIOSLIB_LDADD) +adios_test_c_LDFLAGS = $(ADIOSLIB_LDFLAGS) + +CLEANFILES = restart.bp +CC=$(MPICC) + +EXTRA_DIST = config_c.xml diff --git a/tests/libs/adios/tests/C/adios_test_c.c b/tests/libs/adios/tests/C/adios_test_c.c new file mode 100644 index 0000000000..cdb93c12a0 --- /dev/null +++ b/tests/libs/adios/tests/C/adios_test_c.c @@ -0,0 +1,412 @@ +/* + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + */ + +#include +#include +#include +#include +#include +#include + +// mpi +#include "mpi.h" + +#include "adios.h" + +#include +/* Subtract the `struct timeval' values X and Y, + storing the result in RESULT. + Return 1 if the difference is negative, otherwise 0. */ + +int +timeval_subtract (result, x, y) + struct timeval *result, *x, *y; +{ + /* Perform the carry for the later subtraction by updating y. */ + if (x->tv_usec < y->tv_usec) { + int nsec = (y->tv_usec - x->tv_usec) / 1000000 + 1; + y->tv_usec -= 1000000 * nsec; + y->tv_sec += nsec; + } + if (x->tv_usec - y->tv_usec > 1000000) { + int nsec = (x->tv_usec - y->tv_usec) / 1000000; + y->tv_usec += 1000000 * nsec; + y->tv_sec -= nsec; + } + + /* Compute the time remaining to wait. + tv_usec is certainly positive. */ + result->tv_sec = x->tv_sec - y->tv_sec; + result->tv_usec = x->tv_usec - y->tv_usec; + + /* Return 1 if result is negative. */ + return x->tv_sec < y->tv_sec; +} + +#define DO_WRITE 1 +#define DO_READ 0 +#define DO_APPEND 0 +#define MEMORY_THIEF 0 +#define SPLIT_FILES 0 + +int main (int argc, char ** argv) +{ + char * type_name = "restart"; + char filename [100]; + int64_t io_handle; // io handle + MPI_Comm comm = MPI_COMM_WORLD; + int rank; + int size; + struct timeval time_start; + struct timeval time_end; + struct timeval time_diff; + struct timeval time_open; + struct timeval time_group_size; + struct timeval time_write1; + struct timeval time_write2; + struct timeval * time_diff_all; + + MPI_Init (&argc, &argv); + MPI_Comm_rank (comm, &rank); + MPI_Comm_size (comm, &size); +#if SPLIT_FILES + MPI_Comm_split (MPI_COMM_WORLD, rank % 2, rank, &comm); + sprintf (filename, "restart%d.bp", rank % 2); +printf ("rank %d filename: %s\n", rank, filename); +#else + strcpy (filename, "restart.bp"); +#endif + if (!adios_init ("config_c.xml", comm)) + return -1; + + //uint64_t byte_test_length = 768LL * 1024 * 1024; + uint64_t byte_test_length = 512LL * 1024 * 1024; +if (rank == 0) printf ("Byte_test_length: %llu\n", byte_test_length); +#if DO_WRITE + char * byte_test = 0; + byte_test = malloc (byte_test_length + 1); + if (byte_test == 0) + { + fprintf (stderr, "Error allocating memory for write byte_test: %llu\n" + ,byte_test_length + ); + exit (-1); + } + byte_test [byte_test_length] = 0; +#endif +#if DO_READ + char * r_byte_test = 0; + r_byte_test = malloc (byte_test_length + 1); + if (byte_test == 0) + { + fprintf (stderr, "Error allocating memory for read byte_test: %llu\n" + ,byte_test_length + ); + exit (-1); + } + r_byte_test [byte_test_length] = 0; +#endif + + int var_x1 = 101; + int var_x2 = 102; + + int zionsize1 = 10; // fixed size + int zionsize2 = 2; // attr_dim + int zionsize3 = 5; // attr_dim2 + + float * zion1; + float * zion2; + float * zion3; + + zion1 = malloc (zionsize1 * sizeof (float)); + zion2 = malloc (zionsize2 * zionsize2 * sizeof (float)); + zion3 = malloc (zionsize2 * zionsize3 * sizeof (float)); + assert (zion1); + assert (zion2); + assert (zion3); + memset (zion1, 0, zionsize1 * sizeof (float)); + memset (zion2, 0, zionsize2 * zionsize2 * sizeof (float)); + memset (zion3, 0, zionsize2 * zionsize3 * sizeof (float)); + + int node = 0; + + uint64_t total; + int i; + int j; + + zion1 [0] = 10.0; + zion1 [1] = 11.0; + zion1 [2] = 12.0; + zion1 [3] = 13.0; + zion1 [4] = 14.0; + zion1 [5] = 15.0; + zion1 [6] = 16.0; + zion1 [7] = 17.0; + zion1 [8] = 18.0; + zion1 [9] = 19.0; + + for (i = 0; i < 100; i++) + for (j = 0; j < 26; j++) + byte_test [i * 26 + j] = 'a' + j; + + // allocate a big block of memory to stymie unwanted local caching + // that would make the numbers suspect +#if MEMORY_THIEF + uint64_t memory_thief_length = 1024 * 1024 * 1024 // 1 GB + + 128 * 1024 * 1024 // 128 MB + - byte_test_length; + char * memory_thief = malloc (1 * 1024 * 1024 * 1024); +#endif + + //if (rank == 0) + time_diff_all = (struct timeval *) malloc (size * sizeof (struct timeval)); +// else +// time_diff_all = 0; + +#if DO_WRITE +//printf ("XXXXXXXXXXXXXXXX do a write XXXXXXXXXXXXXXXXX\n"); + gettimeofday (&time_start, NULL); + adios_open (&io_handle, type_name, filename, "w", comm); + gettimeofday (&time_open, NULL); +#if 1 + adios_group_size (io_handle, 4 + byte_test_length, &total); + gettimeofday (&time_group_size, NULL); +#else + adios_group_size (io_handle, 4 + 4 + + 4 * zionsize1 + + 4 + 4 * zionsize2 * zionsize2 + + 4 + 4 * zionsize2 * zionsize3 + + 4 + + 4 + byte_test_length + ,&total + ); + gettimeofday (&time_group_size, NULL); + + adios_write (io_handle, "/mype", &var_x1); + adios_write (io_handle, "/test/mype", &var_x2); + + adios_write (io_handle, "zion1", zion1); + + adios_write (io_handle, "zionsize2", &zionsize2); + adios_write (io_handle, "zion2", zion2); + + adios_write (io_handle, "zionsize3", &zionsize3); + adios_write (io_handle, "zion3", zion3); + + adios_write (io_handle, "node-attr", &node); + +#endif + adios_write (io_handle, "byte_test_length", &byte_test_length); + gettimeofday (&time_write1, NULL); + adios_write (io_handle, "byte_test", byte_test); + gettimeofday (&time_write2, NULL); + + adios_close (io_handle); + gettimeofday (&time_end, NULL); + + + MPI_Barrier (comm); + + timeval_subtract (&time_diff, &time_end, &time_start); + MPI_Gather (&time_diff, sizeof (struct timeval), MPI_BYTE + ,time_diff_all, sizeof (struct timeval), MPI_BYTE + ,0, comm + ); + if (rank == 0) + { + memcpy (&(time_diff_all [0]), &time_diff, sizeof (struct timeval)); + int i; + int max_sec = 0; + int max_usec = 0; + int min_sec = INT_MAX; + int min_usec = INT_MAX; + printf ("Proc\tSec\n"); + for (i = 0; i < size; i++) + { + printf ("%06d\t%02lld.%06lld\n", i, + (int64_t)time_diff_all [i].tv_sec, + (int64_t)time_diff_all [i].tv_usec + ); + + if (time_diff_all [i].tv_sec >= max_sec) + { + if ( time_diff_all [i].tv_usec > max_usec + || time_diff_all [i].tv_sec > max_sec + ) + { + max_sec = time_diff_all [i].tv_sec; + max_usec = time_diff_all [i].tv_usec; + } + } + + if (time_diff_all [i].tv_sec <= min_sec) + { + if ( time_diff_all [i].tv_usec < min_usec + || time_diff_all [i].tv_sec < min_sec + ) + { + min_sec = time_diff_all [i].tv_sec; + min_usec = time_diff_all [i].tv_usec; + } + } + } + + printf ("Max time:\t%02d.%06d\n", max_sec, max_usec); + printf ("Aggregate GB/sec:\t%f\n", (1.0 * total * size / (1024 * 1024 * 1024)) / (max_sec + (max_usec / 1000000.0))); + } + timeval_subtract (&time_diff, &time_end, &time_write2); + MPI_Gather (&time_diff, sizeof (struct timeval), MPI_BYTE + ,time_diff_all, sizeof (struct timeval), MPI_BYTE + ,0, comm + ); + if (rank == 0) + { + memcpy (&(time_diff_all [0]), &time_diff, sizeof (struct timeval)); + int i; + int max_sec = 0; + int max_usec = 0; + int min_sec = INT_MAX; + int min_usec = INT_MAX; + for (i = 0; i < size; i++) + { + if (time_diff_all [i].tv_sec >= max_sec) + { + if ( time_diff_all [i].tv_usec > max_usec + || time_diff_all [i].tv_sec > max_sec + ) + { + max_sec = time_diff_all [i].tv_sec; + max_usec = time_diff_all [i].tv_usec; + } + } + + if (time_diff_all [i].tv_sec <= min_sec) + { + if ( time_diff_all [i].tv_usec < min_usec + || time_diff_all [i].tv_sec < min_sec + ) + { + min_sec = time_diff_all [i].tv_sec; + min_usec = time_diff_all [i].tv_usec; + } + } + } + + printf ("Max write only time:\t%02d.%06d\n", max_sec, max_usec); + printf ("Aggregate write only GB/sec:\t%f\n", (1.0 * total * size / (1024 * 1024 * 1024)) / (max_sec + (max_usec / 1000000.0))); + } + + MPI_Barrier (comm); +#endif + +#if DO_READ +printf ("XXXXXXXXXXXXXXXX do a read XXXXXXXXXXXXXXXXX\n"); + + int r_var_x1; + int r_var_x2; + int r_zsize; + float r_z [zionsize1]; + adios_open (&io_handle, type_name, filename, "r", comm); + adios_group_size (io_handle, 0, &total); + adios_read (io_handle, "/mype", &r_var_x1, 4); + adios_read (io_handle, "/test/mype", &r_var_x2, 4); + adios_read (io_handle, "zionsize2", &r_zsize, 4); + adios_read (io_handle, "zion1", r_z, 4 * 10); + adios_read (io_handle, "byte_test", r_byte_test, 26 * 100); + adios_close (io_handle); + + MPI_Barrier (comm); + + for (i = 0; i < byte_test_length; i++) + if (r_byte_test [i] != byte_test [i]) + { + printf ("byte_test doesn't match %d\n", i); + printf ("byte_test:\n%s\n", byte_test); + printf ("r_byte_test:\n%s\n", r_byte_test); + break; + } + + if ( var_x1 != r_var_x1 + || var_x2 != r_var_x2 + || r_zsize != zionsize2 + || r_z [0] != zion1 [0] + || r_z [1] != zion1 [1] + || r_z [2] != zion1 [2] + || r_z [3] != zion1 [3] + || r_z [4] != zion1 [4] + || r_z [5] != zion1 [5] + || r_z [6] != zion1 [6] + || r_z [7] != zion1 [7] + || r_z [8] != zion1 [8] + || r_z [9] != zion1 [9] + ) + { + int i; + printf ("rank: %d mismatch in reading\n", rank); + printf ("r_var_x1: %d (%d)\n", r_var_x1, var_x1); + printf ("r_var_x2: %d (%d)\n", r_var_x2, var_x2); + printf ("r_zsize: %d (%d)\n", r_zsize, zionsize1); + for (i = 0; i < 10; i++) + printf ("z_dim [%d]: %f (%f)\n", i, r_z [i], zion1 [i]); + } + else + { + printf ("rank: %d read matches write\n", rank); + } +#endif + +#if DO_APPEND +for (int i = 0; i < 3; i++) +{ +printf ("XXXXXXXXXXXXXXXX do an append XXXXXXXXXXXXXXXXX\n"); + var_x1 = 11; + adios_open (&io_handle, type_name, filename, "a", comm); + adios_group_size (io_handle, 4 + 4 + + 4 * zionsize1 + + 4 + 4 * zionsize2 * zionsize2 + + 4 + ,&total + ); + adios_write (io_handle, "/mype", &var_x1); + adios_write (io_handle, "/test/mype", &var_x2); + + adios_write (io_handle, "zion1", zion1); + + adios_write (io_handle, "zionsize2", &zionsize2); + adios_write (io_handle, "zion2", zion2); + + adios_write (io_handle, "node-attr", &node); + + adios_close (io_handle); + + printf ("rank: %d append completed\n", rank); +} + +#endif + + MPI_Barrier (comm); + + adios_finalize (node); + MPI_Finalize (); + + free (zion1); + free (zion2); + free (zion3); + +#if DO_WRITE + free (byte_test); +#endif +#if DO_READ + free (r_byte_test); +#endif + +#if MEMORY_THIEF + free (memory_thief); +#endif + + return 0; +} diff --git a/tests/libs/adios/tests/C/config_c.xml b/tests/libs/adios/tests/C/config_c.xml new file mode 100644 index 0000000000..fb5bc53a58 --- /dev/null +++ b/tests/libs/adios/tests/C/config_c.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + max_storage_targets=144;max_stripe_count=144;files_number=1;overlap_factor= 0;min_stripe_count=1;split_target_count=1;split_files_count=max + + + + diff --git a/tests/libs/adios/tests/C/fgr_tests/CMakeLists.txt b/tests/libs/adios/tests/C/fgr_tests/CMakeLists.txt new file mode 100644 index 0000000000..dc52e4b36a --- /dev/null +++ b/tests/libs/adios/tests/C/fgr_tests/CMakeLists.txt @@ -0,0 +1,10 @@ +include_directories(${PROJECT_SOURCE_DIR}/src/public) +include_directories(${PROJECT_SOURCE_DIR}/src) +link_directories(${PROJECT_SOURCE_DIR}/src) +link_directories(${PROJECT_BINARY_DIR}/src) +link_directories(${MXML_INCLUDE_DIR}/../lib) + + +add_executable(posix_fgr posix_fgr.c) +target_link_libraries(posix_fgr adios ${ADIOSLIB_LDADD} ${MPI_C_LIBRARIES}) + diff --git a/tests/libs/adios/tests/C/fgr_tests/Makefile.am b/tests/libs/adios/tests/C/fgr_tests/Makefile.am new file mode 100644 index 0000000000..5354372304 --- /dev/null +++ b/tests/libs/adios/tests/C/fgr_tests/Makefile.am @@ -0,0 +1,16 @@ +AM_CPPFLAGS = $(all_includes) +AM_CPPFLAGS += -I$(top_srcdir)/src -I$(top_srcdir)/src/public + +AUTOMAKE_OPTIONS = no-dependencies + +noinst_PROGRAMS=posix_fgr + +posix_fgr_SOURCES = posix_fgr.c +posix_fgr_CPPFLAGS = $(ADIOSLIB_CPPFLAGS) +posix_fgr_CFLAGS = $(ADIOSLIB_CFLAGS) +posix_fgr_LDADD = $(top_builddir)/src/libadios.a $(ADIOSLIB_LDADD) +posix_fgr_LDFLAGS = $(ADIOSLIB_LDFLAGS) + +CLEANFILES = posix_fgr.bp +CC=$(MPICC) + diff --git a/tests/libs/adios/tests/C/fgr_tests/posix_fgr.c b/tests/libs/adios/tests/C/fgr_tests/posix_fgr.c new file mode 100644 index 0000000000..4427bcaa2c --- /dev/null +++ b/tests/libs/adios/tests/C/fgr_tests/posix_fgr.c @@ -0,0 +1,129 @@ +/* + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + */ + +/* ADIOS C Example: write a global array from N processors with gwrite + * + * How to run: mpirun -np adios_global + * Output: adios_global.bp + * ADIOS config file: adios_global.xml + * +*/ +#include +#include +#include +#include +#include +#include +#include +//#include +//#endif +// from /usr/include/lustre/lustre_user.h +#define LUSTRE_SUPER_MAGIC 0x0BD00BD0 +# define LOV_USER_MAGIC 0x0BD10BD0 +# define LL_IOC_LOV_SETSTRIPE _IOW ('f', 154, long) +# define LL_IOC_LOV_GETSTRIPE _IOW ('f', 155, long) +#define O_LOV_DELAY_CREATE 0100000000 + +struct lov_user_ost_data { // per-stripe data structure + uint64_t l_object_id; // OST object ID + uint64_t l_object_gr; // OST object group (creating MDS number) + uint32_t l_ost_gen; // generation of this OST index + uint32_t l_ost_idx; // OST index in LOV +} __attribute__((packed)); +struct lov_user_md { // LOV EA user data (host-endian) + uint32_t lmm_magic; // magic number = LOV_USER_MAGIC_V1 + uint32_t lmm_pattern; // LOV_PATTERN_RAID0, LOV_PATTERN_RAID1 + uint64_t lmm_object_id; // LOV object ID + uint64_t lmm_object_gr; // LOV object group + uint32_t lmm_stripe_size; // size of stripe in bytes + uint16_t lmm_stripe_count; // num stripes in use for this object + uint16_t lmm_stripe_offset; // starting stripe offset in lmm_objects + struct lov_user_ost_data lmm_objects[0]; // per-stripe data +} __attribute__((packed)); +struct obd_uuid { + char uuid[40]; +}; + +#include "mpi.h" +#ifdef HAVE_FGR +#include "fgr.h" +#endif + +int main (int argc, char ** argv) +{ + char filename [256]; + int rank, size, i; + int NX = 262144*2*2*2*2*2*2*2*2*2; + double t[NX]; + MPI_Comm comm = MPI_COMM_WORLD; + struct lov_user_md lum; + int f; + + MPI_Init (&argc, &argv); + MPI_Comm_rank (comm, &rank); + MPI_Comm_size (comm, &size); + +#ifdef HAVE_FGR + if (fgr_init (0) == false) + { + fprintf (stderr, "fgr_init() error\n"); + } +#endif + for (i = 0; i < NX; i++) + t[i] = rank*NX + i; + + sprintf (filename, "%s.%d", "posix_fgr.bin", rank); + + MPI_Barrier (MPI_COMM_WORLD); + double start_time = MPI_Wtime(); + + f = open(filename, O_CREAT | O_RDWR | O_LOV_DELAY_CREATE, 0644); + if (f == -1) + { + fprintf (stderr,"open() failed: %s\n", filename); + return -1; + } + + lum.lmm_magic = LOV_USER_MAGIC; + lum.lmm_pattern = 0; + lum.lmm_stripe_size = NX * 8; + lum.lmm_stripe_count = 1; +#ifdef HAVE_FGR + lum.lmm_stripe_offset = find_myost(comm); +// lum.lmm_stripe_offset = rank; +#else + lum.lmm_stripe_offset = -1; +#endif + + ioctl (f, LL_IOC_LOV_SETSTRIPE ,(void *) &lum); + + for (i = 0; i < 10; i++) + { + if (write(f, t, NX*8) == -1) + { + fprintf (stderr, "write() error.\n"); + } + } + + close (f); + + double io_time = MPI_Wtime() - start_time; + double max; + + MPI_Reduce(&io_time, &max, 1, + MPI_DOUBLE, MPI_MAX, 0, + MPI_COMM_WORLD); + + if (rank == 0) + printf ("time = %4.2f\n", max); +#ifdef HAVE_FGR + fgr_finalize(); +#endif + MPI_Finalize (); + + return 0; +} diff --git a/tests/libs/adios/tests/C/flexpath_tests/1D_arr_global/CMakeLists.txt b/tests/libs/adios/tests/C/flexpath_tests/1D_arr_global/CMakeLists.txt new file mode 100644 index 0000000000..2207a63302 --- /dev/null +++ b/tests/libs/adios/tests/C/flexpath_tests/1D_arr_global/CMakeLists.txt @@ -0,0 +1,23 @@ +include_directories(${PROJECT_SOURCE_DIR}/src) +include_directories(${PROJECT_SOURCE_DIR}/src/public) +include_directories(${PROJECT_SOURCE_DIR}/tests/C/flexpath_tests/include) +link_directories(${PROJECT_BINARY_DIR}/src) + +add_executable(writer_global writer.c ../common/utils.c) +target_link_libraries(writer_global adios ${ADIOSLIB_LDADD} ${MPI_C_LIBRARIES}) +#add_custom_target( +# writer ALL +# COMMAND $(CC) writer.c ../common/utils.c -o writer -I${PROJECT_SOURCE_DIR}/src/public -I${CMAKE_CURRENT_SOURCE_DIR}/../include -ladios -L${PROJECT_BINARY_DIR}/src ${ADIOSLIB_LDADD} +# DEPENDS writer.c ../common/utils.c +# WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) + + +add_executable(reader_global reader.c ../common/utils.c) +target_link_libraries(reader_global adios ${ADIOSLIB_LDADD} ${MPI_C_LIBRARIES}) +#add_custom_target( +# reader ALL +# COMMAND $(CC) reader.c ../common/utils.c -o reader -I${PROJECT_SOURCE_DIR}/src/public -I${CMAKE_CURRENT_SOURCE_DIR}/../include -ladios -L${PROJECT_BINARY_DIR}/src ${ADIOSLIB_LDADD} +# DEPENDS reader.c ../common/utils.c +# WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) + +file(COPY test_config_flex.xml readme.txt DESTINATION ${PROJECT_BINARY_DIR}/tests/C/flexpath_tests/1D_arr_global) diff --git a/tests/libs/adios/tests/C/flexpath_tests/1D_arr_global/Makefile.am b/tests/libs/adios/tests/C/flexpath_tests/1D_arr_global/Makefile.am new file mode 100644 index 0000000000..a7877b40b0 --- /dev/null +++ b/tests/libs/adios/tests/C/flexpath_tests/1D_arr_global/Makefile.am @@ -0,0 +1,21 @@ +AM_CPPFLAGS = $(all_includes) +AM_CPPFLAGS += -I$(top_srcdir)/src -I$(top_srcdir)/src/public -I$(srcdir)/../include + +AUTOMAKE_OPTIONS = no-dependencies + +all-local: + test "$(srcdir)" = "$(builddir)" || cp $(srcdir)/*.xml $(builddir) + test "$(srcdir)" = "$(builddir)" || cp $(srcdir)/readme.txt $(builddir) + +noinst_PROGRAMS = writer_global reader_global + +writer_global_SOURCES = writer.c ../common/utils.c +writer_global_LDADD = $(top_builddir)/src/libadios.a $(ADIOSLIB_LDADD) +writer_global_LDFLAGS = $(ADIOSLIB_LDFLAGS) +reader_global_SOURCES = reader.c ../common/utils.c +reader_global_LDADD = $(top_builddir)/src/libadios.a $(ADIOSLIB_LDADD) +reader_global_LDFLAGS = $(ADIOSLIB_LDFLAGS) + +CLEANFILES = *.bp +CC=$(MPICC) +EXTRA_DIST = test_config_flex.xml cfg.h readme.txt diff --git a/tests/libs/adios/tests/C/flexpath_tests/1D_arr_global/cfg.h b/tests/libs/adios/tests/C/flexpath_tests/1D_arr_global/cfg.h new file mode 100644 index 0000000000..f8f905d016 --- /dev/null +++ b/tests/libs/adios/tests/C/flexpath_tests/1D_arr_global/cfg.h @@ -0,0 +1,15 @@ +/** + * cfg.h + * + * Created on: Sep 4, 2013 + * Author: Magda Slawinska aka Magic Magg magg dot gatech at gmail.com + */ + +#ifndef CFG_H_ +#define CFG_H_ + +//! size of the X dimension +#define NX_DIM 10 + + +#endif /* CFG_H_ */ diff --git a/tests/libs/adios/tests/C/flexpath_tests/1D_arr_global/reader.c b/tests/libs/adios/tests/C/flexpath_tests/1D_arr_global/reader.c new file mode 100644 index 0000000000..69ebb3519f --- /dev/null +++ b/tests/libs/adios/tests/C/flexpath_tests/1D_arr_global/reader.c @@ -0,0 +1,183 @@ +/** + * reader.c + * + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + * + * Created on: Jul 1, 2013 + * Author: Magda Slawinska aka Magic Magg magg dot gatech at gmail.com + * + * This is a test for the FlexPath method based on examples/C/flexpath_arrays + */ + +#include "mpi.h" +#include "adios.h" +#include "adios_read.h" + +#include "misc.h" +#include "utils.h" +#include "test_common.h" +#include "cfg.h" + +#include +#include +#include +#include + + +int main (int argc, char **argv){ + int rank =0, size =0; + int NX = 0; + double *t = NULL; + // this is an array we expect as a reference array + double *t_ref = NULL; + MPI_Comm comm = MPI_COMM_WORLD; + diag_t diag = DIAG_OK; // to store the diagnostic information + struct test_info test_result = { TEST_PASSED, "1D_arr_global" }; + struct err_counts err = { 0, 0}; + struct adios_tsprt_opts adios_opts; + + GET_ENTRY_OPTIONS(adios_opts, "Runs readers. It is recommended to run as many readers as writers."); + + // adios read initialization + MPI_Init( &argc, &argv); + MPI_Comm_rank (comm, &rank); + + // depending on the method + SET_ERROR_IF_NOT_ZERO(adios_read_init_method(adios_opts.method, comm, adios_opts.adios_options), err.adios); + RET_IF_ERROR(err.adios, rank); + + // I will be working with streams so the lock mode is necessary, + // return immediately if the stream unavailable + ADIOS_FILE *adios_handle = adios_read_open(FILE_NAME,adios_opts.method, comm, ADIOS_LOCKMODE_NONE, 0.0); + if ( !adios_handle){ + p_error("Quitting ... (%d) %s\n", adios_errno, adios_errmsg()); + return DIAG_ERR; + } + + // define portions of data how they will be read + ADIOS_SELECTION *sel = NULL; + ADIOS_VARINFO *avi = NULL; + + + // read how many processors wrote that array + avi = adios_inq_var (adios_handle, "size"); + if (!avi){ + p_error("rank %d: Quitting ... (%d) %s\n", rank, adios_errno, adios_errmsg()); + CLOSE_ADIOS_READER(adios_handle, adios_opts.method); + return DIAG_ERR; + } + size = *((int*)avi->value); + adios_free_varinfo(avi); + avi = NULL; + + // if I run the more readers than writers; just release + // the excessive readers + if (rank >= size){ + p_info("rank %d: I am an excessive rank. Nothing to read ...\n", rank); + CLOSE_ADIOS_READER(adios_handle, adios_opts.method); + return DIAG_OK; + } + + // read the size of the array + avi = adios_inq_var (adios_handle, "NX"); + if (!avi){ + p_error("rank %d: Quitting ... (%d) %s\n", rank, adios_errno, adios_errmsg()); + CLOSE_ADIOS_READER(adios_handle, adios_opts.method); + return DIAG_ERR; + } + + // I expect a scalar that will tell me the size of an array + assert(0 == avi->ndim); + assert(adios_integer == avi->type); + NX = *((int*)avi->value); + // I don't need that variable any more + adios_free_varinfo(avi); + assert(NX_DIM == NX); + avi = NULL; + + + // this will define the slice that we want to read; each rank should + // read its own slice written by a corresponding writer rank + // the var_1d is a 2-dim ADIOS variable (because we decided to have + // it as a global array); that's why we need a 2-dim ADIOS variable + uint64_t count[2] = {1,0}; + count[1] = NX; + uint64_t start[2] = {0,0}; + start[0] = rank; + + sel = adios_selection_boundingbox(2,start, count); + if( !sel ){ + p_error("rank %d: Quitting ... (%d) %s\n", rank, adios_errno, adios_errmsg()); + diag = DIAG_ERR; + goto close_adios; + } + + // allocate the memory for the actual array to be read + t = calloc(NX, sizeof(double)); + + if (adios_schedule_read(adios_handle, sel, "var_1d_array",0,1,t) != 0){ + p_error("rank %d: Quitting ...(%d) %s\n", rank, adios_errno, adios_errmsg()); + diag = DIAG_ERR; + goto just_clean; + } + + // not sure if this assumption is correct; difficult to find in the ADIOS sources + if (adios_perform_reads(adios_handle, 1) != 0){ + p_error("rank %d: Quitting ...(%d) %s\n", rank, adios_errno, adios_errmsg()); + diag = DIAG_ERR; + goto just_clean; + } + + // make the reference array with reference values I expect to get + t_ref = calloc(NX, sizeof(double)); + gen_1D_array(t_ref, NX, rank); + + // compare the values what you get with what you expect + int i = 0; + for (i = 0; i < NX; ++i) { + if (t[i] != t_ref[i]) { + p_test_failed("%s: rank %d: for t[%d] (expected %.1f, got %.1f)\n", + test_result.name, rank, i, t_ref[i], t[i]); + test_result.result = TEST_FAILED; + break; + } + } + + if (TEST_PASSED == test_result.result) + p_test_passed("%s: rank %d\n", test_result.name, rank); + + +/*#ifdef FLEXPATH_METHOD + adios_release_step(adios_handler); + // 0 - next available step, block for max 30 seconds until the next step + // is available + adios_advance_step(adios_handler, 0, 30); + if (0 == adios_errno){ + printf("Rank %d: proceeding to the next step ...\n", rank); + } else { + printf("ERROR: adios_advance_step(); anyway Quitting ... Rank %d: (%d) %s\n", rank, adios_errno, adios_errmsg()); + } +#endif +*/ + +just_clean: + // clean everything + adios_selection_delete(sel); + sel = NULL; + free(t); + t = NULL; + free(t_ref); + t_ref = NULL; + +close_adios: + CLOSE_ADIOS_READER(adios_handle, adios_opts.method); + + if ((DIAG_OK == diag) && (TEST_PASSED == test_result.result)) { + return 0; + } else { + return 1; + } +} diff --git a/tests/libs/adios/tests/C/flexpath_tests/1D_arr_global/readme.txt b/tests/libs/adios/tests/C/flexpath_tests/1D_arr_global/readme.txt new file mode 100644 index 0000000000..87e54b1984 --- /dev/null +++ b/tests/libs/adios/tests/C/flexpath_tests/1D_arr_global/readme.txt @@ -0,0 +1,108 @@ +# The protocol file generated by protogen.py ver. 1.0 on 2013-06-27 12:54 +# AUTHOR: Magda S aka Magic Magg magg dot gatech at gmail dot com +# DATE: 2013-06-27 + + +DESCRIPTION +=========== +This is a test case for Flexpath. The idea of the test: The writer writes a +1D array of NX double elements. The array is written as ADIOS global array +so each process writes in a global space, but in its own place. + +The writer writes the 1D array and the reader reads the 1D array of doubles. + +There might be as many writers as you wish, and there might be as many readers +as you wish. However, each rank reads its own rank. The reader knows how many +writers were there so if its rank is higher then it quits. + +The test can work with two modes (use '-t' option with the appropriate mode): + +1. MPI/ADIOS_READ_METHOD_BP +2. FLEXPATH/ADIOS_READ_METHOD_FLEXPATH + +BUILD +======= +# you need to set the environment variables as Makefile uses those locations +# to locate libraries and headers + +export ADIOS_ROOT=/rock/opt/adios/git-dbg +export MXML_ROOT=/rock/opt/mxml/2.7 +export MPI_ROOT=/rock/opt/openmpi/1.6.3 +export EVPATH_ROOT=/rock/opt/evpath + +# in certain cases you might need the lustre directory (e.g., on kraken) +export LUSTRE_ROOT=/opt/cray/lustre-cray_ss_s/default + + +# build +$ make -f Makefile.generic + +# should remove all unnecessary exec files +$ make -f Makefile.generic clean + +RUN +===== +# you should remove text file remnants from Flexpath _read_ready.txt, _info_writer.txt +$ make -f Makefile.generic clean_test + +$ mpirun -np 2 ./writer -t flx +$ mpirun -np 2 ./reader -t flx + +See Makefile for other options or add '-h' option to the reader or writer + +NOTES +======= +2013-09-04 - readme might be outdated + +2013-07-17 - tested on my local laptop (MPI and FLEXPATH) + + +OUTDATED (2013-07-08) +====================== +I will update later. + +RUNNING ON KRAKEN +================= +This runs one reader per node and one writer per node. + +aprun -n 1 -N 1 ./arrays_read & +aprun -n 1 -N 1 ./arrays_write + +You should be able to run the example with as many readers and writers as you wish. + +Example PBS script +------------------ +#!/bin/bash +#PBS -l walltime=00:05:00,size=24 +#PBS -A UT-TENN0033 + +date + +echo "nodefile=" +cat $PBS_NODEFILE +echo "=end nodefile" + +# make sure you have all modules loaded +module use ~smagg/opt/modulefiles +module load mag-mxml-2.7/kraken-gnu +module list + +cd $PBS_O_WORKDIR + +# on Kraken the path needs to be specified precisely +# ./writer might cause a strange error +aprun -n 24 -N 12 /lustre/scratch/smagg/writer & +sleep 20 +aprun -n 24 -N 12 /lustre/scratch/smagg/reader + +date + +# eof + + +TROUBLESHOOTING +=============== + +There might be text files left; they should be removed for the next run. + +# EOF diff --git a/tests/libs/adios/tests/C/flexpath_tests/1D_arr_global/test_config_flex.xml b/tests/libs/adios/tests/C/flexpath_tests/1D_arr_global/test_config_flex.xml new file mode 100644 index 0000000000..e359fa8022 --- /dev/null +++ b/tests/libs/adios/tests/C/flexpath_tests/1D_arr_global/test_config_flex.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + +QUEUE_SIZE=4; + + + + + diff --git a/tests/libs/adios/tests/C/flexpath_tests/1D_arr_global/writer.c b/tests/libs/adios/tests/C/flexpath_tests/1D_arr_global/writer.c new file mode 100644 index 0000000000..1b5e49a9ef --- /dev/null +++ b/tests/libs/adios/tests/C/flexpath_tests/1D_arr_global/writer.c @@ -0,0 +1,88 @@ +/** + * writer.c + * + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + * + * Created on: Jul 1, 2013 + * Author: Magda Slawinska aka Magic Magg magg dot gatech at gmail.com + * + * This is an example of writing a 1D array of doubles. Each process + * writes the NX sized array of doubles. + */ + +#include "mpi.h" +#include "adios.h" +#include "adios_read.h" // for adios_errno + +#include "misc.h" +#include "utils.h" +#include "cfg.h" +#include "test_common.h" + +#include +#include +#include +#include + + +int main(int argc, char ** argv){ + int rank=0, size=0; + int NX = NX_DIM; // size of 1D array we will write + double t[NX_DIM]; // this will contain the variables + MPI_Comm comm = MPI_COMM_WORLD; // required for ADIOS + + int64_t adios_handle; // the ADIOS file handler + int retval; + struct adios_tsprt_opts adios_opts; + int err_count = 0; + + GET_ENTRY_OPTIONS(adios_opts, "Runs writers. It is recommended to run as many writers as readers."); + + // I assume that I have all required options set in adios_opts + + // sanity check + assert(NX==NX_DIM); + + // ADIOS initialization + MPI_Init(&argc, &argv); + MPI_Comm_rank (comm, &rank); + MPI_Comm_size (comm, &size); + + SET_ERROR_IF_ZERO(adios_init(adios_opts.xml_adios_init_filename, comm), err_count); + RET_IF_ERROR(err_count, rank); + + // init the array that I will transport + if (gen_1D_array(t, NX, rank) == DIAG_ERR){ + printf("ERROR: Generating 1D array. Quitting ...\n"); + return DIAG_ERR; + } + + uint64_t adios_groupsize, adios_totalsize; + + // open with the group name as specified in the xml file + adios_open( &adios_handle, "temperature", FILE_NAME, "w", comm); + adios_groupsize = 4 + 4 + 4 + 8 * (NX); + retval=adios_group_size (adios_handle, adios_groupsize, &adios_totalsize); + fprintf(stderr, "Rank=%d adios_group_size(): adios_groupsize=%lld, adios_totalsize=%lld, retval=%d\n", + rank, adios_groupsize, adios_totalsize, retval); + + // write; don't check errors for simplicity reasons + adios_write(adios_handle, "NX", &NX); + adios_write(adios_handle, "size", &size); + adios_write(adios_handle, "rank", &rank); + adios_write(adios_handle, "var_1d_array", t); + + fprintf(stderr, "Rank=%d committed write\n", rank); + + adios_close(adios_handle); + + // clean and finalize the system + adios_finalize(rank); + MPI_Finalize(); + + return DIAG_OK; +} + diff --git a/tests/libs/adios/tests/C/flexpath_tests/1D_arr_global_noxml/CMakeLists.txt b/tests/libs/adios/tests/C/flexpath_tests/1D_arr_global_noxml/CMakeLists.txt new file mode 100644 index 0000000000..8c644f9b9a --- /dev/null +++ b/tests/libs/adios/tests/C/flexpath_tests/1D_arr_global_noxml/CMakeLists.txt @@ -0,0 +1,15 @@ +include_directories(${PROJECT_SOURCE_DIR}/src/public) +include_directories(${PROJECT_SOURCE_DIR}/src) +include_directories(${PROJECT_SOURCE_DIR}/tests/C/flexpath_tests/include) +link_directories(${PROJECT_SOURCE_DIR}/src) +link_directories(${PROJECT_BINARY_DIR}/src) +link_directories(${MXML_INCLUDE_DIR}/../lib) + + +add_executable(writer_global_noxml writer.c ../common/utils.c) +target_link_libraries(writer_global_noxml adios ${ADIOSLIB_LDADD} ${MPI_C_LIBRARIES}) + +add_executable(reader_global_noxml reader.c ../common/utils.c) +target_link_libraries(reader_global_noxml adios ${ADIOSLIB_LDADD} ${MPI_C_LIBRARIES}) + +file(COPY readme.txt DESTINATION ${PROJECT_BINARY_DIR}/tests/C/flexpath_tests/1D_arr_global_noxml) diff --git a/tests/libs/adios/tests/C/flexpath_tests/1D_arr_global_noxml/Makefile.am b/tests/libs/adios/tests/C/flexpath_tests/1D_arr_global_noxml/Makefile.am new file mode 100644 index 0000000000..fd5d416d6d --- /dev/null +++ b/tests/libs/adios/tests/C/flexpath_tests/1D_arr_global_noxml/Makefile.am @@ -0,0 +1,22 @@ +AM_CPPFLAGS = $(all_includes) +AM_CPPFLAGS += -I$(top_srcdir)/src -I$(top_srcdir)/src/public -I$(srcdir)/../include + +AUTOMAKE_OPTIONS = no-dependencies + +all-local: + test "$(srcdir)" = "$(builddir)" || cp $(srcdir)/readme.txt $(builddir) + +noinst_PROGRAMS = writer_global_noxml reader_global_noxml + +writer_global_noxml_SOURCES = writer.c ../common/utils.c +writer_global_noxml_LDADD = $(top_builddir)/src/libadios.a $(ADIOSLIB_LDADD) +writer_global_noxml_LDFLAGS = $(ADIOSLIB_LDFLAGS) +reader_global_noxml_SOURCES = reader.c ../common/utils.c +reader_global_noxml_LDADD = $(top_builddir)/src/libadios.a $(ADIOSLIB_LDADD) +reader_global_noxml_LDFLAGS = $(ADIOSLIB_LDFLAGS) + +CLEANFILES = *.bp +CC=$(MPICC) + +EXTRA_DIST = cfg.h readme.txt + diff --git a/tests/libs/adios/tests/C/flexpath_tests/1D_arr_global_noxml/cfg.h b/tests/libs/adios/tests/C/flexpath_tests/1D_arr_global_noxml/cfg.h new file mode 100644 index 0000000000..f8f905d016 --- /dev/null +++ b/tests/libs/adios/tests/C/flexpath_tests/1D_arr_global_noxml/cfg.h @@ -0,0 +1,15 @@ +/** + * cfg.h + * + * Created on: Sep 4, 2013 + * Author: Magda Slawinska aka Magic Magg magg dot gatech at gmail.com + */ + +#ifndef CFG_H_ +#define CFG_H_ + +//! size of the X dimension +#define NX_DIM 10 + + +#endif /* CFG_H_ */ diff --git a/tests/libs/adios/tests/C/flexpath_tests/1D_arr_global_noxml/reader.c b/tests/libs/adios/tests/C/flexpath_tests/1D_arr_global_noxml/reader.c new file mode 100644 index 0000000000..4f4c2b80d1 --- /dev/null +++ b/tests/libs/adios/tests/C/flexpath_tests/1D_arr_global_noxml/reader.c @@ -0,0 +1,181 @@ +/** + * arrays_read.c + * + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + * + * Created on: Jul 1, 2013 + * Author: Magda Slawinska aka Magic Magg magg dot gatech at gmail.com + * + * This is a test for the FlexPath method based on examples/C/flexpath_arrays + */ + +#include "mpi.h" +#include "adios.h" +#include "adios_read.h" + +#include "misc.h" +#include "utils.h" +#include "test_common.h" +#include "cfg.h" + +#include +#include +#include +#include + + +// for printing the values of the variable +#define STR_BUFFER_SIZE 3000 + + + +int main (int argc, char **argv){ + int rank =0, size =0; + int NX = 0; + double *t = NULL; + // this is an array we expect as a reference array + double *t_ref = NULL; + MPI_Comm comm = MPI_COMM_WORLD; + diag_t diag = DIAG_OK; // to store the diagnostic information + struct test_info test_result = {TEST_PASSED, "1D_arr_global_noxml"}; + struct err_counts err = { 0, 0}; + struct adios_tsprt_opts adios_opts; + + GET_ENTRY_OPTIONS(adios_opts, "Runs readers. It is recommended to run as many readers as writers."); + + // adios read initialization + MPI_Init( &argc, &argv); + MPI_Comm_rank (comm, &rank); + + // depending on the method + SET_ERROR_IF_NOT_ZERO(adios_read_init_method(adios_opts.method, comm, adios_opts.adios_options), err.adios); + RET_IF_ERROR(err.adios, rank); + + + // I will be working with streams so the lock mode is necessary, + // return immediately if the stream unavailable + ADIOS_FILE *adios_handle = adios_read_open(FILE_NAME, adios_opts.method, comm, ADIOS_LOCKMODE_NONE, 0.0); + if ( !adios_handle){ + p_error("Quitting ... (%d) %s\n", adios_errno, adios_errmsg()); + return DIAG_ERR; + } + + // define portions of data how they will be read + ADIOS_SELECTION *sel = NULL; + ADIOS_VARINFO *avi = NULL; + + + // for storing the variables + char buf[STR_BUFFER_SIZE]; + + int step = 0; + + // read how many processors wrote that array + avi = adios_inq_var (adios_handle, "size"); + if (!avi){ + p_error("rank %d: Quitting ... (%d) %s\n", rank, adios_errno, adios_errmsg()); + diag = DIAG_ERR; + goto close_adios; + } + size = *((int*)avi->value); + adios_free_varinfo(avi); + avi = NULL; + + // if I run the more readers than writers; just release + // the excessive readers + if (rank >= size){ + p_info("rank %d: I am an excessive rank. Nothing to read ...\n", rank); + diag = DIAG_OK; + goto close_adios; + } + + // read the size of the array + avi = adios_inq_var (adios_handle, "NX"); + if (!avi){ + p_error("rank %d: Quitting ... (%d) %s\n", rank, adios_errno, adios_errmsg()); + diag = DIAG_ERR; + goto close_adios; + } + + // I expect a scalar that will tell me the size of an array + assert(0 == avi->ndim); + assert(adios_integer == avi->type); + NX = *((int*)avi->value); + // I don't need that variable any more + adios_free_varinfo(avi); + assert(NX_DIM == NX); + avi = NULL; + + + // this will define the slice that we want to read; each rank should + // read its own slice written by a corresponding writer rank + uint64_t count[1] = { NX }; + uint64_t start[1] = { 0 }; + start[0] = rank*NX; + + sel = adios_selection_boundingbox(1,start, count); + if( !sel ){ + p_error("rank %d: Quitting ... (%d) %s\n", rank, adios_errno, adios_errmsg()); + diag = DIAG_ERR; + goto close_adios; + } + + // make the reference array with reference values I expect to get + t_ref = calloc(NX, sizeof(double)); + if (gen_1D_array(t_ref, NX, rank) == DIAG_ERR){ + p_error("Generating 1D array. Quitting ...\n"); + diag = DIAG_ERR; + goto close_adios; + } + + // allocate the memory for the actual array to be read + t = calloc(NX, sizeof(double)); + + if (adios_schedule_read(adios_handle, sel, "var_1d_array",0,1,t) != 0){ + p_error("rank %d: Quitting ...(%d) %s\n", rank, adios_errno, adios_errmsg()); + diag = DIAG_ERR; + goto just_clean; + } + + // not sure if this assumption is correct; difficult to find in the ADIOS sources + if (adios_perform_reads(adios_handle, 1) != 0){ + p_error("rank %d: Quitting ...(%d) %s\n", rank, adios_errno, adios_errmsg()); + diag = DIAG_ERR; + goto just_clean; + } + + sprintf(buf, "Rank %d: var_1d_array: step %d: t: ", rank, step); + + int i = 0; + for(i=0; i < NX; ++i){ + if( t[i] != t_ref[i] ){ + p_test_failed("%s: rank %d: for t[%d] (expected %.1f, got %.1f)\n", test_result.name, rank, i, t_ref[i], t[i] ); + test_result.result = TEST_FAILED; + break; + } + } + + if (TEST_PASSED == test_result.result) + p_test_passed("%s: rank %d\n", test_result.name, rank); + +just_clean: + // clean everything + adios_selection_delete(sel); + sel = NULL; + free(t); + t = NULL; + free(t_ref); + t_ref = NULL; + +close_adios: + CLOSE_ADIOS_READER(adios_handle, adios_opts.method); + + if ((DIAG_OK == diag) && (TEST_PASSED == test_result.result)) { + return 0; + } else { + return 1; + } +} diff --git a/tests/libs/adios/tests/C/flexpath_tests/1D_arr_global_noxml/readme.txt b/tests/libs/adios/tests/C/flexpath_tests/1D_arr_global_noxml/readme.txt new file mode 100644 index 0000000000..36e080ce30 --- /dev/null +++ b/tests/libs/adios/tests/C/flexpath_tests/1D_arr_global_noxml/readme.txt @@ -0,0 +1,104 @@ +# The protocol file generated by protogen.py ver. 1.0 on 2013-06-27 12:54 +# AUTHOR: Magda S aka Magic Magg magg dot gatech at gmail dot com +# DATE: 2013-06-27 + + +DESCRIPTION +=========== +This is a test case for ADIOS. Analogous to 1D_arr_global, but in the noxml version. + +The idea of the test. The writer writes a +1D array of NX double elements. The array is written as ADIOS global array +so each process writes in a global space, but in its own place. + +The writer writes the 1D array and the reader reads the 1D array of doubles. + +There might be as many writers as you wish, and there might be as many readers +as you wish. However, each rank reads its own rank. The reader knows how many +writers were there so if its rank is higher then it quits. + +The test uses might be run in two modes (use '-t' option with the appropriate mode). + +1. MPI/ADIOS_READ_METHOD_BP +2. FLEXPATH/ADIOS_READ_METHOD_FLEXPATH + + +BUILD +======= +# you need to set the environment variables as Makefile uses those locations +# to locate libraries and headers + +export ADIOS_ROOT=/rock/opt/adios/git-dbg +export MXML_ROOT=/rock/opt/mxml/2.7 +export MPI_ROOT=/rock/opt/openmpi/1.6.3 +export EVPATH_ROOT=/rock/opt/evpath + +# in certain cases you might need the lustre directory (e.g., on kraken) +export LUSTRE_ROOT=/opt/cray/lustre-cray_ss_s/default + +# build the MPI/ADIOS_READ_METHOD_BP +$ make -f Makefile.generic + +# should remove all unnecessary exec files +$ make -f Makefile.generic clean + +# cleans files hanging around after previous runs +$ make -f Makefile.generic clean_test + +RUN +===== +# to clean files hanging around after previous runs +$ make -f Makefile.generic clean_test + +$ mpirun -np 2 writer -t flx +$ mpirun -np 2 reader -t flx + +See Makefile for other options of running the test or use '-h'. + + +OUTDATED (2013-07-08) +====================== +I will update later. + +RUNNING ON KRAKEN +================= +This runs one reader per node and one writer per node. + +aprun -n 1 -N 1 ./arrays_read & +aprun -n 1 -N 1 ./arrays_write + +You should be able to run the example with as many readers and writers as you wish. + +Example PBS script +------------------ +#!/bash/bin +#PBS -l walltime=00:05:00,size=24 +#PBS -A UT-TENN0033 + +date + +echo "nodefile=" +cat $PBS_NODEFILE +echo "=end nodefile" + +# make sure you have all modules loaded +module use ~smagg/opt/modulefiles +module load mag-mxml-2.7/kraken-gnu +module list + +cd $PBS_O_WORKDIR + +aprun -n 1 -N 1 ./arrays_read & +aprun -n 1 -N 1 ./arrays_write + +date + +# eof + + +TROUBLESHOOTING +=============== + +There might be text files left; they should be removed for the next run. + +# EOF diff --git a/tests/libs/adios/tests/C/flexpath_tests/1D_arr_global_noxml/writer.c b/tests/libs/adios/tests/C/flexpath_tests/1D_arr_global_noxml/writer.c new file mode 100644 index 0000000000..99c467edba --- /dev/null +++ b/tests/libs/adios/tests/C/flexpath_tests/1D_arr_global_noxml/writer.c @@ -0,0 +1,124 @@ +/** + * arrays_write.c + * + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + * + * Created on: Jul 1, 2013 + * Author: Magda Slawinska aka Magic Magg magg dot gatech at gmail.com + * + * This is an example of writing a 1D array of doubles. Each process + * writes the NX sized array of doubles. + */ + +#include "mpi.h" +#include "adios.h" +#include "adios_read.h" // for adios_errno + +#include "misc.h" +#include "utils.h" +#include "cfg.h" +#include "test_common.h" + +#include +#include +#include +#include + + +int main(int argc, char ** argv){ + char filename[256]; // the name of the file to write data and compare with flexpath + int rank=0, size=0; + int NX = NX_DIM; // size of 1D array we will write + double t[NX_DIM]; // this will contain the variables to be tranpsorted + MPI_Comm comm = MPI_COMM_WORLD; // required for ADIOS + + int64_t adios_handle; // the ADIOS file handler + int retval; + + struct adios_tsprt_opts adios_opts; + int err_count = 0; + + GET_ENTRY_OPTIONS(adios_opts, "Runs writers. It is recommended to run as many writers as readers."); + + + // sanity check + assert(NX==NX_DIM); + + // where I will write the data + strcpy(filename, FILE_NAME); + + // ADIOS initialization + MPI_Init(&argc, &argv); + MPI_Comm_rank (comm, &rank); + MPI_Comm_size (comm, &size); + + // From sources it just returns 1 (2013-07-16, whatever) + adios_init_noxml(comm); + + // returns 0 (buffer allocated) or 1 (seems everything fine) + // I guess size of the buffer in MB + adios_allocate_buffer(ADIOS_BUFFER_ALLOC_NOW, 20); + + // this will hold the group id for all variables defined within this group + int64_t adios_grp; + + // now declare a group + adios_declare_group(&adios_grp, "temperature", "iter", adios_flag_yes); + + SET_ERROR_IF_ZERO(adios_select_method(adios_grp, adios_opts.transport, "", ""), err_count); + RET_IF_ERROR(err_count, rank); + + + // I am defining here a global array - global bounds is the size + // of global array for all writers; within that array there is + // an offset from which each rank has its space + int global_bounds= NX * size; + int offsets= NX * rank; + + + adios_define_var (adios_grp, "NX", "", adios_integer, 0, 0, 0); + adios_define_var (adios_grp, "size", "", adios_integer, 0, 0, 0); + adios_define_var (adios_grp, "rank", "", adios_integer, 0, 0, 0); + adios_define_var (adios_grp, "global_bounds", "", adios_integer, 0, 0, 0); + adios_define_var (adios_grp, "offsets", "", adios_integer, 0, 0, 0); + // NX - local var dimensions, global_bounds - global dimension, offsets - variable local offsets + adios_define_var (adios_grp, "var_1d_array", "", adios_double, "NX", "global_bounds", "offsets"); + + // open our group and transport method associated with it + adios_open (&adios_handle, "temperature", FILE_NAME, "w", comm); + // NX, size, rank, global_bounds, offsets,var_1d_array + uint64_t adios_groupsize = 4 + 4 + 4 + 4 + 4 + NX * 8; + uint64_t adios_totalsize = 0; + + retval=adios_group_size (adios_handle, adios_groupsize, &adios_totalsize); + fprintf(stderr, "Rank=%d adios_group_size(): adios_groupsize=%lld, adios_totalsize=%lld, retval=%d\n", + rank, adios_groupsize, adios_totalsize, retval); + + // init the array that I will transport over the sea + if (gen_1D_array(t, NX, rank) == DIAG_ERR){ + printf("ERROR: Generating 1D array. Quitting ...\n"); + return DIAG_ERR; + } + + // write; don't check errors for simplicity reasons + adios_write(adios_handle, "NX", &NX); + adios_write(adios_handle, "size", &size); + adios_write(adios_handle, "rank", &rank); + adios_write(adios_handle, "global_bounds", &global_bounds); + adios_write(adios_handle, "offsets", &offsets); + adios_write(adios_handle, "var_1d_array", t); + + fprintf(stderr, "Rank=%d committed write\n", rank); + + adios_close(adios_handle); + + // clean and finalize the system + adios_finalize(rank); + MPI_Finalize(); + + return 0; +} + diff --git a/tests/libs/adios/tests/C/flexpath_tests/CMakeLists.txt b/tests/libs/adios/tests/C/flexpath_tests/CMakeLists.txt new file mode 100644 index 0000000000..ae40d2fd86 --- /dev/null +++ b/tests/libs/adios/tests/C/flexpath_tests/CMakeLists.txt @@ -0,0 +1,8 @@ +add_subdirectory(1D_arr_global) +add_subdirectory(1D_arr_global_noxml) +add_subdirectory(global_range_select) +add_subdirectory(maya_noxml) +add_subdirectory(maya_append) +add_subdirectory(scalar) + +file(COPY README DESTINATION ${PROJECT_BINARY_DIR}/tests/C/flexpath_tests/) diff --git a/tests/libs/adios/tests/C/flexpath_tests/Makefile.am b/tests/libs/adios/tests/C/flexpath_tests/Makefile.am new file mode 100644 index 0000000000..5a751b4398 --- /dev/null +++ b/tests/libs/adios/tests/C/flexpath_tests/Makefile.am @@ -0,0 +1,5 @@ +SUBDIRS=1D_arr_global 1D_arr_global_noxml global_range_select maya_noxml maya_append scalar + +EXTRA_DIST = include/misc.h include/test_common.h include/utils.h + + diff --git a/tests/libs/adios/tests/C/flexpath_tests/README b/tests/libs/adios/tests/C/flexpath_tests/README new file mode 100644 index 0000000000..9d27d3d8d9 --- /dev/null +++ b/tests/libs/adios/tests/C/flexpath_tests/README @@ -0,0 +1,128 @@ +Flexpath Testing +================ + +Possible Test Setups +-------------------- + +1. Program which directly calls adios_flexpath functions and checks returns. +2. Program which forks readers and writers, which dump to file and checks file contents. + +Existing Directories +-------------------- + +* global_range_select - runs tests using the global range selectors. Current tests are listed below: + - 1 to 1 all to all + +* scalar - read/write a scalar with (XML API) + +* 1D_arr_global - read/write a 1D array of doubles (XML API) + +* 1D_arr_global_noxml - read/write a 1D array of doubles but no XML API (analogous + to 1D_arr_global) + +* maya_noxml - inspired by maya; same variables written multiple times (doesn't work with Flexpath) + +* maya_append - inspired by maya; testing the append mode (doesn't work with Flexpath) + +How to build and clean the build +-------------------------------- +# build +$ make +# clean +$ make clean + +How to run regression tests (might be outdated 2013-09-04) +---------------------------- +# be sure that appropriate paths for openmpi, mxml, and evpath are +# set appropriately + +module list +Currently Loaded Modules: + 1) openmpi/1.6.3 2) mxml/2.7 3) evpath + +There is a convenience bash script + +./run_tests.sh + +Run it without options to see how to run all tests. + +# to run test +# in one terminal run writers +./run_tests.sh -flx-w +# in the second terminal run readers +./run_tests.sh -flx-r + +Notes +------ +There are directories that are used to most of the tests (2013-09-04) + +include +common + +If you want to copy the individual regression test, then +copy the include and common directory and the test directory as well. + + +Recent tests +------------ + +MPI transport (2013-09-04) - my laptop + +TEST_PASSED scalar: rank 0 +TEST_PASSED scalar: rank 1 +TEST_PASSED 1D_arr_global: rank 0 +TEST_PASSED 1D_arr_global: rank 1 +TEST_PASSED 1D_arr_global_noxml: rank 0 +TEST_PASSED 1D_arr_global_noxml: rank 1 +TEST_PASSED maya_append: rank 0 +TEST_PASSED maya_noxml: rank 0 + +FLEXPATH transport (2013-09-04) - my laptop + +TEST_PASSED scalar: rank 0 +TEST_PASSED scalar: rank 1 +TEST_PASSED 1D_arr_global: rank 0 +TEST_PASSED 1D_arr_global: rank 1 +TEST_PASSED 1D_arr_global_noxml: rank 0 +TEST_PASSED 1D_arr_global_noxml: rank 1 + +maya_append and maya_noxml tests failed + +Some tests produced message + +1D_arr_global_noxml + +mpirun -np 2 ./writer -t flx +Rank=1 adios_group_size(): adios_groupsize=100, adios_totalsize=558, retval=0 +Rank=1 committed write +Rank=0 adios_group_size(): adios_groupsize=100, adios_totalsize=558, retval=0 +Rank=0 committed write +No event handler with takeable buffer executing on this CM. +No event handler with takeable buffer executing on this CM. +Event 2ad30c000b60 not found in taken events list +Event 2b3260000b60 not found in taken events list +No event handler with takeable buffer executing on this CM. +No event handler with takeable buffer executing on this CM. +Event 2b3260001b90 not found in taken events list +Event 2ad30c001b90 not found in taken events list +No event handler with takeable buffer executing on this CM. +No event handler with takeable buffer executing on this CM. +No event handler with takeable buffer executing on this CM. +Event 2ad30c03f200 not found in taken events list +No event handler with takeable buffer executing on this CM. +Event 2b326003f200 not found in taken events list +No event handler with takeable buffer executing on this CM. +Event 2ad30c03fad0 not found in taken events list +No event handler with takeable buffer executing on this CM. +Event 2b326003fad0 not found in taken events list +make[1]: Leaving directory `/rock/synchrobox/proj/w-ecl/2013-06-17-adios/tests/C/flexpath_tests/1D_arr_global_noxml' + +1D_arr_global_noxml' +mpirun -np 2 ./reader -t flx +DEBUG: DEBUG: matched overlap type 1 +matched overlap type 1 +TEST_PASSED 1D_arr_global_noxml: rank 1 +TEST_PASSED 1D_arr_global_noxml: rank 0 +DEBUG: adios_read_finalize_method completed +DEBUG: adios_read_finalize_method completed +make[1]: Leaving directory `/rock/synchrobox/proj/w-ecl/2013-06-17-adios/tests/C/flexpath_tests/1D_arr_global_noxml' diff --git a/tests/libs/adios/tests/C/flexpath_tests/common/utils.c b/tests/libs/adios/tests/C/flexpath_tests/common/utils.c new file mode 100644 index 0000000000..1ce2e1152b --- /dev/null +++ b/tests/libs/adios/tests/C/flexpath_tests/common/utils.c @@ -0,0 +1,317 @@ +/** + * utils.c + * + * Created on: Jul 5, 2013 + * Author: Magda Slawinska aka Magic Magg magg dot gatech at gmail.com + * + * Utility functions. + */ +#include "mpi.h" +#include "adios_read.h" +#include "adios.h" + +#include +#include +#include +#include + +#include "misc.h" +#include "utils.h" + + +/** + * @param program_name The name of the program + * @param program_desc The description of the program + * @return DIAG_OK Returns always DIAG_OK + */ +diag_t usage(char *program_name, char *program_desc){ + printf("USAGE\n"); + printf(" mpirun -np nprocs %s [-h] -t method\n", program_name); + printf("\nDESCRIPTION\n"); + printf(" %s\n", program_desc); + printf("\n nprocs Number of processors you want to use\n"); + printf(" -t method\n"); + printf(" The transport/read method. Currently supported flx and mpi.\n"); + printf(" flx sets the FLEXPATH/ADIOS_READ_METHOD_FLEXPATH\n"); + printf(" mpi sets the MPI/ADIOS_READ_METHOD_BP\n"); + printf(" -h\n"); + printf(" show usage\n"); + printf("\nEXAMPLES\n"); + printf("mpirun -np 2 %s -t flx\n", program_name); + printf("mpirun -np 2 %s -t mpi\n", program_name); + + return DIAG_OK; +} + +/** + * Generates the 1D array of length arr_len, based on the provided rank + * + * p_arr : rank 0: 1, 2, 3, 4, 5, .... + * rank 1: 10, 11, 12, 13, ... + * rank 2: 20, 21, 22, 23, ... + * + * The function does not check if arr_len does check if the memory is overwritten + * + * @param p_arr The pointer to the array that will hold the values + * @param arr_len The number of elements in the array + * @param rank The rank for which I want to have the number generated + * + * @return DIAG_ERR if the p_arr is NULL + * DIAG_OK otherwise + * p_arr (with generated numbers) + */ +diag_t gen_1D_array(double *p_arr, int arr_len, int rank){ + + if (!p_arr){ + fprintf(stderr, "ERROR: p_arr is NULL\n."); + return DIAG_ERR; + } + int i = 0; + for( i = 0; i < arr_len; i++){ + p_arr[i] = rank * 10 + i; + } + + return DIAG_OK; +} + +/** + * TODO each rank generates the same sequence of numbers + * Generates the 1D array of length arr_len, based on the provided rank + * It assumes that the memory is allocated for p_arr + * + * p_arr : rank 0: 1, 2, 3, 4, 5, .... + * rank 1: 10, 11, 12, 13, ... + * rank 2: 20, 21, 22, 23, ... + * + * The function does not check if the memory is overwritten + * + * @param p_arr The pointer to the array that will hold the values + * @param arr_len The number of elements in the array + * @param rank The rank for which I want to have the number generated + * + * @return DIAG_ERR if the p_arr is NULL + * DIAG_OK otherwise + * p_arr (with generated numbers) + */ +diag_t gen_1D_array2(double *p_arr, int arr_len, int rank){ + + if (!p_arr){ + fprintf(stderr, "ERROR: p_arr is NULL\n."); + return DIAG_ERR; + } + int i = 0; + for( i = 0; i < arr_len; i++){ + // see comment in @gen_1D_array + //p_arr[i] = rank * 10.0 + i; + p_arr[i] = i * 1.0; + } + + return DIAG_OK; +} + +/** + * TODO this is not true; each rank generates the same sequence of numbers + * Generates the 1D array of length arr_len, based on the provided rank + * It assumes that the memory is allocated for p_arr + * + * p_arr : rank 0: 1, 2, 3, 4, 5, .... + * rank 1: 10, 11, 12, 13, ... + * rank 2: 20, 21, 22, 23, ... + * + * The function does not check if the memory is overwritten + * + * @param p_arr The pointer to the array that will hold the values + * @param arr_len The number of elements in the array + * @param rank The rank for which I want to have the number generated + * + * @return DIAG_ERR if the p_arr is NULL + * DIAG_OK otherwise + * p_arr (with generated numbers) + */ +diag_t gen_1D_array_int(int *p_arr, int arr_len, int rank){ + + if (!p_arr){ + fprintf(stderr, "ERROR: p_arr is NULL\n."); + return DIAG_ERR; + } + int i = 0; + for( i = 0; i < arr_len; i++){ + // the diversification with rank will not work for as the last one will be used + // if more than 1 ranks will be used and the reader will signal the error + // that's why I decided to go with the same value independent on + // the rank + // TODO but the above and below is something to explore + //p_arr[i] = rank * 10 + i; + p_arr[i] = i; + } + + return DIAG_OK; +} + +/** + * get the commandline options and fills the p_tsprt_opts structure with + * relevant parameters for ADIOS; sets *p_show_help to 1 if the user + * requested the help information + * + * Currently the following options are supported: + * ./executable -h + * ./executable -t flx + * ./executable -t mpi + * + * @param p_tsprt_opts (OUT) the structure filled with parameters from + * the command line + * @param argc (IN) as from main() + * @param argv (IN) same meaning as main() + * @param p_show_help (OUT) 0 - means no help printf requested + * 1 - means the help printf info requested + * + * @return DIAG_OK if everything ok + * DIAG_ERR if some errors, e.g., the option has not been found + * + */ +diag_t get_options(struct adios_tsprt_opts * p_tsprt_opts, int argc, char ** argv, int *p_show_help){ + + diag_t diag = DIAG_OK; + int c; + char *cvalue = NULL; + int i = 0; + + opterr = 0; + + // assume that no showing help + *p_show_help = 0; + + while( (c = getopt(argc, argv, "ht:")) != -1){ + switch(c){ + case 'h': + *p_show_help = 1; + break; + case 't': + cvalue = optarg; + // by default I set adios options to be verbosed + // TODO might be changed to the actual option + strcpy(p_tsprt_opts->adios_options, "verbose=4; show hidden_attrs"); + + if (strcmp(cvalue, "flx") == 0){ + p_tsprt_opts->method = ADIOS_READ_METHOD_FLEXPATH; + strcpy(p_tsprt_opts->transport, "FLEXPATH"); + strcpy(p_tsprt_opts->xml_adios_init_filename, "test_config_flex.xml"); + } else if (strcmp(cvalue, "mpi") == 0) { + p_tsprt_opts->method = ADIOS_READ_METHOD_BP; + strcpy(p_tsprt_opts->transport, "MPI"); + strcpy(p_tsprt_opts->xml_adios_init_filename, "test_config_mpi.xml"); + } else { + diag = DIAG_ERR; + } + break; + case '?': + if ('t' == optopt){ + fprintf(stderr, "ERROR: option -%c requires transport argument. See help '-h'.\n", optopt); + } else if (isprint (optopt)) { + fprintf (stderr, "ERROR: Unknown option `-%c'.\n", optopt); + } else { + fprintf (stderr, "ERROR: Unknown option character `\\x%x'.\n", optopt); + } + diag = DIAG_ERR; + break; + default: + break; + } + } + + for(i = optind; i < argc; ++i){ + printf("ERROR: non-option argument %s\n", argv[i]); + } + + if (DIAG_OK != diag) { + p_tsprt_opts->transport[0]='\0'; + } + return diag; +} + + +/** + * Sets values the 1D array of length arr_len with a specified value + * It assumes that the memory is allocated for p_arr + * + * The function does not check if the memory is overwritten + * + * @param p_arr The pointer to the array that will hold the values + * @param arr_len The number of elements in the array + * @param value The value to be set + * + * @return DIAG_ERR if the p_arr is NULL + * DIAG_OK otherwise + * p_arr (with generated numbers) + */ +diag_t set_value(double *p_arr, int arr_len, double value){ + + if (!p_arr){ + fprintf(stderr, "p_arr is NULL\n."); + return DIAG_ERR; + } + int i = 0; + for( i = 0; i < arr_len; i++){ + p_arr[i] = value; + } + + return DIAG_OK; +} + +/** + * Get the size of the data. The function assumes that the data will be + * of a "double" type + * + * @param shape The array containing the shape values + * @param shape_elem_count How many elements is in th the shape array + * @param data_size (OUT) This value is computed based on the shape array + * + * @return DIAG_ERR if the shape is null + * DIAG_OK if the data_size contains the valid value + */ +diag_t get_data_size(int *shape, int shape_elem_count, int* data_size){ + + if (!shape){ + fprintf(stderr, "ERROR: shape is NULL\n"); + return DIAG_ERR; + } + + int i = 0; + int my_size = 8; //sizeof(double); + + for(i = 0; i < shape_elem_count; ++i){ + my_size *= shape[i]; + } + + *data_size = my_size; + + return DIAG_OK; +} + +/** + * Generates the maya var name based on the value of MAYA_GF_VAR_PFX macro and the number. + * Now it generates: MAYA_GF_VAR_PFX0, MAYA_GF_VAR_PFX1, ... + * + * The function doesn't protect against too small arra + * @param (in/out) buf the buffer for holding the maya variable; it should be big enough + * to hold additional characters that will create the final + * name of the variable; it is cleaned + * @param (in) buf_size The size of the buffer in characters + * @param (in) maya_var_pfx The prefix for the maya variable + * @param (in) number The number that will be concatenated with the prefix; + * the number should be positive + * + * @return DIAG_OK everything is ok + * != DIAG_OK something is wrong + */ +diag_t gen_maya_var_name(char *buf, int buf_size, char *maya_var_pfx, int number){ + if (number < 0){ + return DIAG_ERR; + } + + memset(buf, 0, buf_size); + sprintf(buf, "%s%d", maya_var_pfx, number); + + return DIAG_OK; +} + diff --git a/tests/libs/adios/tests/C/flexpath_tests/global_range_select/CMakeLists.txt b/tests/libs/adios/tests/C/flexpath_tests/global_range_select/CMakeLists.txt new file mode 100644 index 0000000000..29450c645c --- /dev/null +++ b/tests/libs/adios/tests/C/flexpath_tests/global_range_select/CMakeLists.txt @@ -0,0 +1,15 @@ +include_directories(${PROJECT_SOURCE_DIR}/src/public) +include_directories(${PROJECT_SOURCE_DIR}/src) +include_directories(${PROJECT_SOURCE_DIR}/test/C/flexpath_tests/include) +link_directories(${PROJECT_SOURCE_DIR}/src) +link_directories(${PROJECT_BINARY_DIR}/src) +link_directories(${MXML_INCLUDE_DIR}/../lib) + + +add_executable(arrays_writer arrays_write.c) +target_link_libraries(arrays_writer adios ${ADIOSLIB_LDADD} ${MPI_C_LIBRARIES}) + +add_executable(arrays_reader arrays_read.c) +target_link_libraries(arrays_reader adios ${ADIOSLIB_LDADD} ${MPI_C_LIBRARIES}) + +file(COPY arrays.xml DESTINATION ${PROJECT_BINARY_DIR}/tests/C/flexpath_tests/global_range_select) diff --git a/tests/libs/adios/tests/C/flexpath_tests/global_range_select/Makefile.am b/tests/libs/adios/tests/C/flexpath_tests/global_range_select/Makefile.am new file mode 100644 index 0000000000..6a6167ca26 --- /dev/null +++ b/tests/libs/adios/tests/C/flexpath_tests/global_range_select/Makefile.am @@ -0,0 +1,21 @@ +AM_CPPFLAGS = $(all_includes) +AM_CPPFLAGS += -I$(top_srcdir)/src -I$(top_srcdir)/src/public -I$(srcdir)/../include + +AUTOMAKE_OPTIONS = no-dependencies + +all-local: + test "$(srcdir)" = "$(builddir)" || cp $(srcdir)/*.xml $(builddir) + test "$(srcdir)" = "$(builddir)" || cp $(srcdir)/run_tests.pl $(builddir) + +noinst_PROGRAMS = arrays_write arrays_read + +arrays_write_SOURCES = arrays_write.c +arrays_write_LDADD = $(top_builddir)/src/libadios.a $(ADIOSLIB_LDADD) +arrays_write_LDFLAGS = $(ADIOSLIB_LDFLAGS) +arrays_read_SOURCES = arrays_read.c +arrays_read_LDADD = $(top_builddir)/src/libadios.a $(ADIOSLIB_LDADD) +arrays_read_LDFLAGS = $(ADIOSLIB_LDFLAGS) + +CLEANFILES = *.bp +CC=$(MPICC) +EXTRA_DIST = arrays.xml run_tests.pl diff --git a/tests/libs/adios/tests/C/flexpath_tests/global_range_select/arrays.xml b/tests/libs/adios/tests/C/flexpath_tests/global_range_select/arrays.xml new file mode 100644 index 0000000000..33cec61394 --- /dev/null +++ b/tests/libs/adios/tests/C/flexpath_tests/global_range_select/arrays.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + +QUEUE_SIZE=4; + + + + + diff --git a/tests/libs/adios/tests/C/flexpath_tests/global_range_select/arrays_read.c b/tests/libs/adios/tests/C/flexpath_tests/global_range_select/arrays_read.c new file mode 100644 index 0000000000..41e3f02e4b --- /dev/null +++ b/tests/libs/adios/tests/C/flexpath_tests/global_range_select/arrays_read.c @@ -0,0 +1,113 @@ +/* + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + */ + +/*************************************************************/ +/* Example of reading arrays in ADIOS */ +/* which were written from the same number of processors */ +/* */ +/* Similar example is manual/2_adios_read.c */ +/*************************************************************/ +#include +#include +#include +#include +#include "mpi.h" +#include "adios.h" +#include "adios_read.h" + +int main (int argc, char ** argv) +{ + int rank, j; + int NX, NY; + double *t; + MPI_Comm comm = MPI_COMM_WORLD; + + MPI_Init (&argc, &argv); + MPI_Comm_rank (comm, &rank); + + adios_read_init_method(ADIOS_READ_METHOD_FLEXPATH, comm, ""); + + ADIOS_SELECTION global_range_select; + //if(rank == 0){ + global_range_select.type=ADIOS_SELECTION_BOUNDINGBOX; + global_range_select.u.bb.start = malloc(sizeof(uint64_t)*2); + global_range_select.u.bb.count = malloc(sizeof(uint64_t)*2); + (global_range_select.u.bb.start)[0] = 0; + (global_range_select.u.bb.count)[0] = 4; + (global_range_select.u.bb.start)[1] = 0; + (global_range_select.u.bb.count)[1] = 40; + global_range_select.u.bb.ndim = 2; + + ADIOS_SELECTION scalar_block_select; + scalar_block_select.type = ADIOS_SELECTION_WRITEBLOCK; + scalar_block_select.u.block.index = rank; + //fprintf(stderr, "app got here\n"); + /* schedule_read of a scalar. */ + int test_scalar = -1; + ADIOS_FILE* afile = adios_read_open("arrays", + ADIOS_READ_METHOD_FLEXPATH, + comm, + ADIOS_LOCKMODE_NONE, 0.0); + + int ii = 0; + while(adios_errno != err_end_of_stream){ + + /* get a bounding box - rank 0 for now*/ + ADIOS_VARINFO* nx_info = adios_inq_var( afile, "NX"); + ADIOS_VARINFO* ny_info = adios_inq_var( afile, "NY"); + + if(nx_info->value) { + NX = *((int *)nx_info->value); + } + if(ny_info->value){ + NY= *((int*)ny_info->value); + } + + //printf("\trank=%d: NX=%d\n", rank, NX); + //printf("\trank=%d: NY=%d\n", rank, NY); + + /* Allocate space for the arrays */ + int nelem = 160; + int arr_size = sizeof(double) * nelem; + t = (double *) malloc (arr_size); + memset(t, 0, arr_size); + //fprintf(stderr, "t %p\n", t); + + /* Read the arrays */ + adios_schedule_read (afile, + &global_range_select, + "var_2d_array", + 0, 1, t); + adios_schedule_read (afile, + &scalar_block_select, + "test_scalar", + 0, 1, &test_scalar); + + adios_perform_reads (afile, 1); + + //sleep(20); + + printf("Rank=%d: test_scalar: %d step: %d, t[0,5+x] = [%6.2f", rank, test_scalar, ii, t[0]); + for(j=0; j +#include +#include "mpi.h" +#include "adios.h" + +/*************************************************************/ +/* Example of writing arrays in ADIOS */ +/* */ +/* Similar example is manual/2_adios_write.c */ +/*************************************************************/ +int main (int argc, char ** argv) +{ + char filename [256]; + int rank, size, i; + int NX = 40; + int NY = 1; + double t[NX]; + MPI_Comm comm = MPI_COMM_WORLD; + + int64_t adios_handle; + + MPI_Init (&argc, &argv); + MPI_Comm_rank (comm, &rank); + MPI_Comm_size (comm, &size); + + strcpy (filename, "arrays"); + adios_init ("arrays.xml", comm); + + int test_scalar = rank * 1000; + int ii; + for(ii = 0; ii<20; ii++){ + for (i = 0; i < NX; i++) + t[i] = rank * NX + i; + + adios_open (&adios_handle, "temperature", filename, "w", comm); + + adios_write (adios_handle, "NX", &NX); + adios_write (adios_handle, "NY", &NY); + adios_write (adios_handle, "test_scalar", &test_scalar); + adios_write (adios_handle, "size", &size); + adios_write (adios_handle, "rank", &rank); + adios_write (adios_handle, "var_2d_array", t); + + adios_close (adios_handle); + fprintf(stderr, "Rank=%d commited write %d\n", rank, ii); + } + adios_finalize (rank); + + //MPI_Finalize (); + return 0; +} diff --git a/tests/libs/adios/tests/C/flexpath_tests/global_range_select/run_tests.pl b/tests/libs/adios/tests/C/flexpath_tests/global_range_select/run_tests.pl new file mode 100644 index 0000000000..5a3f7644da --- /dev/null +++ b/tests/libs/adios/tests/C/flexpath_tests/global_range_select/run_tests.pl @@ -0,0 +1,8 @@ +$mypid = fork(); +if (! $mypid) { + system('mpirun arrays_read &>arrays_read.out'); +} elsif (undef $mypid) { + die 'fork failed'; +} else { + system('mpirun arrays_write &>arrays_write.out'); +} diff --git a/tests/libs/adios/tests/C/flexpath_tests/include/misc.h b/tests/libs/adios/tests/C/flexpath_tests/include/misc.h new file mode 100644 index 0000000000..7a0d4b5fc7 --- /dev/null +++ b/tests/libs/adios/tests/C/flexpath_tests/include/misc.h @@ -0,0 +1,118 @@ +/** + * misc.h + * + * Created on: Jul 5, 2013 + * Author: Magda Slawinska aka Magic Magg magg dot gatech at gmail.com + */ + +#ifndef MISC_H_ +#define MISC_H_ + +#include + +//! if defined (not commented) the flexpath method will +//! be used; otherwise the ADIOS_READ_METHOD_BP and MPI +//! if you are switching methods, make sure that arrays.xml +//! contains the correct method +//! you can use the -DFLEXPATH_METHOD in make CFLAGS="-DFLEXPATH_METHOD" +//! to turn this on as well +//#define FLEXPATH_METHOD 1 + +//! the name of the file to be written test values +#define FILE_NAME "test.bp" + +/* +//! size of the X dimension +#define NX_DIM 10 + +//! the xml containing configuration of ADIOS +#ifdef FLEXPATH_METHOD +#define XML_ADIOS_INIT_FILENAME "test_config_flex.xml" +#define METHOD ADIOS_READ_METHOD_FLEXPATH +#define TRANSPORT "FLEXPATH" +#else +#define XML_ADIOS_INIT_FILENAME "test_config_mpi.xml" +#define METHOD ADIOS_READ_METHOD_BP +#define TRANSPORT "MPI" +#endif + +//! options how verbose is ADIOS (see adios_read_init_method) +//! 0=quiet, ..., 4=debug +#define ADIOS_OPTIONS "verbose=4; show hidden_attrs" + +//! defines if the test passed +#define TEST_PASSED 0 +//! defines if the test failed +#define TEST_FAILED -1 + +//! indicates that the program +#define PROGRAM_ERROR -2 + +*/ + +/** + * Describes the status of a test + */ +enum test_status { + TEST_UNKNOWN = -2, + + TEST_FAILED = -1, + TEST_PASSED = 0, +}; + +/** + * Store the information about the tests + */ +struct test_info { + //! the result of the status + enum test_status result; + //! test name + char *name; +}; + +//! diagnostic information +typedef enum { + DIAG_ERR = -1, + DIAG_OK = 0, +} diag_t; + +/** + * This describes the input parameters for the test + * TODO probably not used - to be removed + */ +struct test_input_params { + //! the transport e.g., "flx", "mpi" + char tsprt[256]; + //! 0 - don't show the help + //! 1 - help requested + int help; +}; + +/** + * The structure that describes the + * ADIOS options, transport and a reading method + */ +struct adios_tsprt_opts { + //! the name of the xml file if xml method is chosen + char xml_adios_init_filename[256]; + //! the read method e.g. ADIOS_READ_METHOD_FLEXPATH or ADIOD_READ_METHOD_BP + enum ADIOS_READ_METHOD method; + //! the transport e.g., "FLEXPATH", "MPI" + char transport[256]; + //! can be used to store adios options as used by adios_read_init_method + //! 0=quieet, ..., 4=debug + char adios_options[256]; +}; + +/** + * For storing errors + */ +struct err_counts { + int adios; // counter for adios calls errors + int test; // counter for comparisons errors +}; + + + + +#endif /* MISC_H_ */ diff --git a/tests/libs/adios/tests/C/flexpath_tests/include/test_common.h b/tests/libs/adios/tests/C/flexpath_tests/include/test_common.h new file mode 100644 index 0000000000..994df35bb9 --- /dev/null +++ b/tests/libs/adios/tests/C/flexpath_tests/include/test_common.h @@ -0,0 +1,260 @@ +/** + * @file: test_common.h + * @author: Magda Slawinska, aka Magic Magg, magg dot gatech at gmail dot com + * @date: Dec 19, 2012 + * Modified: Jan 03, 2013 + * The utility macros + */ + +#ifndef TEST_COMMON_H_ +#define TEST_COMMON_H_ + +#include +#include + + +#define DBG_TEST_FAILED_STR "TEST_FAILED" +#define DBG_TEST_PASSED_STR "TEST_PASSED" + +#define DEBUG + +//! Debug printing verbosity +#define DBG_LEVEL DBG_DEBUG + +// New debug messaging state. There is no sense of a "level" for debugging. Each of these define the +// purpose of the messages and is enabled/disabled per file + +//! system cannot continue, e.g. malloc +#define DBG_ERROR 0 +//! +#define DBG_CRITICAL 1 +//! some serious problems +#define DBG_WARNING 2 +#define DBG_MESSAGE 3 +//! messages about state or configuration; high-level flow +#define DBG_INFO 4 +//! func args, variable values, etc; full flow, may slow system down +#define DBG_DEBUG 5 + +#define DBG_ERROR_STR "ERROR\t" +#define DBG_CRITICAL_STR "CRITICAL\t" +#define DBG_WARNING_STR "WARNING\t" +#define DBG_MESSAGE_STR "MESSAGE\t" +#define DBG_INFO_STR "INFO\t" +#define DBG_DEBUG_STR "DEBUG\t" +#define DBG_TODO_STR "TODO\t" + +#define p_test_failed(fmt, args...) \ + do { \ + printf("%s " fmt, DBG_TEST_FAILED_STR, ##args); \ + fflush(stdout); \ + } while(0) + +#define p_test_passed(fmt, args...) \ + do { \ + printf("%s " fmt, DBG_TEST_PASSED_STR, ##args); \ + fflush(stdout); \ + } while(0) + + + +//! @todo do something like that but smarter without unnecessary copying +#define p_error(fmt, args...) \ + do { \ + if((DBG_ERROR) <= DBG_LEVEL) { \ + printf("%s(%d) %s:%s:%d: " fmt, DBG_ERROR_STR, (DBG_ERROR), __FILE__, __FUNCTION__, __LINE__, ##args); \ + fflush(stdout); \ + } \ + } while(0) + + +#define p_warn(fmt, args...) \ + do { \ + if((DBG_WARNING) <= DBG_LEVEL) { \ + printf("%s(%d) %s:%s:%d: " fmt, DBG_WARN_STR, (DBG_ERROR), __FILE__, __FUNCTION__, __LINE__, ##args); \ + fflush(stdout); \ + } \ + } while(0) + +#define p_info(fmt, args...) \ + do { \ + if((DBG_INFO) <= DBG_LEVEL) { \ + printf("%s(%d) %s:%s:%d: " fmt, DBG_INFO_STR, (DBG_ERROR), __FILE__, __FUNCTION__, __LINE__, ##args); \ + fflush(stdout); \ + } \ + } while(0) + +#define p_debug(fmt, args...) \ + do { \ + if((DBG_DEBUG) <= DBG_LEVEL) { \ + printf("%s(%d) %s:%s:%d: " fmt, DBG_DEBUG_STR, (DBG_ERROR), __FILE__, __FUNCTION__, __LINE__, ##args); \ + fflush(stdout); \ + } \ + } while(0) + + +// ------------------------------------ +// define some useful macro idioms +// ADIOS UTILS +#define CLOSE_ADIOS_READER(handle, method) \ + adios_read_close(handle); \ + adios_read_finalize_method(method); \ + MPI_Finalize(); + +/** + * The macro gets the options from the command line + * It assumes presence and visibility of a few variables such as argc, argv + * + * @param adios_opts The structure where adios related command line options will be stored + * + * The macro causes to return DIAG_ERR if getting options returned errors + */ +#define GET_ENTRY_OPTIONS(adios_opts, help_string) \ + if (1 == argc){ \ + p_error("See '-h' for options. At least transport param needs to be specified. Quitting ...\n"); \ + return DIAG_ERR; \ + } \ + do { \ + int show_help = 0; \ + if( DIAG_OK != get_options(&adios_opts, argc, argv, &show_help) ){ \ + p_error("Got from get_options(). Quitting ...\n."); \ + return DIAG_ERR; \ + } \ + if (show_help){ \ + usage(argv[0], help_string); \ + return DIAG_OK; \ + } \ + } while(0) + +/** + * checks if the adios call returned not zero and sets the error + * if yes. Sets the error means increasing err_count++ + * @param fn_call adios function call + * @param (in/out) err_count incremented if the error observed + */ +#define SET_ERROR_IF_NOT_ZERO(fn_call, err_count) \ + do { \ + int _error_code = fn_call; \ + if (_error_code != 0){ \ + p_error("rank %d %s (%d) %s\n", rank, #fn_call, adios_errno, adios_errmsg()) ;\ + err_count++; \ + } \ + } while(0) +/** + * checks if the adios call returned not zero + * err_count++ + * @param fn_call adios function call + * @param (in/out) err_count incremented if the error observed + */ +#define SET_ERROR_IF_ZERO(fn_call, err_count) \ + do { \ + int _error_code = fn_call; \ + if (_error_code == 0){ \ + p_error("rank %d: %s: (%d) %s\n", rank, #fn_call, adios_errno, adios_errmsg()) ;\ + err_count++; \ + } \ + } while(0) +/** + * prints the info; closes adios and returns the error code + * if the err_count is set to a positive number + * + * @param err_count The variable that positive value indicates that there is an error + */ +#define RET_IF_ERROR(err_count, rank) \ + if ( err_count > 0) { \ + p_info("Rank %d: Quitting ...\n", rank); \ + return DIAG_ERR; \ + } + +/** + * prints the info; closes adios and returns the error code + * if the err_count is set to a positive number + * + * @param err_count The variable that positive value indicates that there is an error + * @param rank the rank that closes the adios + * @param handle adios handle to close ADIOS + * @param method what method to close + */ +#define RET_AND_CLOSE_ADIOS_READER_IF_ERROR(err_count, rank, handle, method) \ + if ( err_count > 0) { \ + p_error("rank %d: Quitting ...\n", rank); \ + CLOSE_ADIOS_READER(handle, method); \ + return DIAG_ERR; \ + } + +/** + * prints the info; closes adios and returns the error code + * if the err_count is set to a positive number + * + * @param test_res the test result + * @param rank the rank that closes the adios + * @param handle adios handle to close ADIOS + * @param method what method to close + */ +#define RET_AND_CLOSE_ADIOS_READER_IF_TEST_FAILED(test_res, rank, handle, method) \ + if ( TEST_FAILED == test_res.result ) { \ + p_test_failed("%s: rank %d\n", test_res.name, rank); \ + CLOSE_ADIOS_READER(handle, method); \ + return DIAG_ERR; \ + } +/** + * breaks the loop if error count is positive + * + * @param err_count The variable that positive value indicates that ther is an error + */ +#define BREAK_IF_ERROR(err_count) \ + if ( err_count > 0) { \ + break; \ + } + + + +// ------------------------------- +// test macros +// ------------------------------- +/** + * assumes that err_count is defined + * @param value_ref The reference value + * @param value The actual value + * @param err_count The value of the error counter; if the error increases + * the value will be increased + * @param test_res The result of the test + */ +#define TEST_INT_EQUAL(value_ref, value, err_count, test_res) \ + if (value != value_ref ){ \ + test_res = TEST_FAILED; \ + p_test_failed("(expected=%d, got=%d)\n", value_ref, value); \ + err_count++; \ + } + +/** + * assumes that err_count is defined + * @param value_ref The reference value + * @param value The actual value + * @param err_count The value of the error counter; if the error increases + * the value will be increased + * @param test_res The result of the test + */ +#define TEST_LONG_EQUAL(value_ref, value, err_count, test_res) \ + if (value != value_ref ){ \ + test_res = TEST_FAILED; \ + p_test_failed("(expected=%lld, got=%lld)\n", value_ref, value); \ + err_count++; \ + } + +/** + * assumes that err_count is defined + * @param value_ref The reference value + * @param value The actual value + * @param err_count The value of the error counter; if the error increases + * the value will be increased + * @param test_res The result of the test + */ +#define TEST_DOUBLE_EQUAL(value_ref, value, err_count, test_res) \ + if (value != value_ref ){ \ + test_res = TEST_FAILED; \ + p_test_failed("(expected=%0.2f, got=%0.2f)\n", value_ref, value); \ + err_count++; \ + } + +#endif /* TEST_COMMON_H_ */ diff --git a/tests/libs/adios/tests/C/flexpath_tests/include/utils.h b/tests/libs/adios/tests/C/flexpath_tests/include/utils.h new file mode 100644 index 0000000000..dbd86475af --- /dev/null +++ b/tests/libs/adios/tests/C/flexpath_tests/include/utils.h @@ -0,0 +1,24 @@ +/** + * utils.h + * + * Created on: Jul 5, 2013 + * Author: Magda Slawinska aka Magic Magg magg dot gatech at gmail.com + */ + +#ifndef UTILS_H_ +#define UTILS_H_ + +extern diag_t usage(char *program_name, char *program_desc); +extern diag_t gen_1D_array(double *p_arr, int arr_len, int rank); +extern diag_t gen_1D_array2(double *p_arr, int arr_len, int rank); +extern diag_t gen_1D_array_int(int *p_arr, int arr_len, int rank); +extern diag_t get_options(struct adios_tsprt_opts * p_tsprt_opts, int argc, char ** argv, int *p_show_help); + +extern diag_t set_value(double *p_arr, int arr_len, double value); +extern diag_t get_data_size(int *shape, int shape_elem_count, int* data_size); +extern diag_t get_maya_var_name(char *prefix, int number); +extern diag_t gen_maya_var_name(char *buf, int buf_size, char *maya_var_pfx, int number); + + + +#endif /* UTILS_H_ */ diff --git a/tests/libs/adios/tests/C/flexpath_tests/maya_append/CMakeLists.txt b/tests/libs/adios/tests/C/flexpath_tests/maya_append/CMakeLists.txt new file mode 100644 index 0000000000..143330b7ae --- /dev/null +++ b/tests/libs/adios/tests/C/flexpath_tests/maya_append/CMakeLists.txt @@ -0,0 +1,15 @@ +include_directories(${PROJECT_SOURCE_DIR}/src/public) +include_directories(${PROJECT_SOURCE_DIR}/src) +include_directories(${PROJECT_SOURCE_DIR}/tests/C/flexpath_tests/include) +link_directories(${PROJECT_SOURCE_DIR}/src) +link_directories(${PROJECT_BINARY_DIR}/src) +#link_directories(${MXML_INCLUDE_DIR}/../lib) + + +add_executable(writer_maya writer.c ../common/utils.c) +target_link_libraries(writer_maya adios ${ADIOSLIB_LDADD} ${MPI_C_LIBRARIES}) + +add_executable(reader_maya reader.c ../common/utils.c) +target_link_libraries(reader_maya adios ${ADIOSLIB_LDADD} ${MPI_C_LIBRARIES}) + +file(COPY readme.txt DESTINATION ${PROJECT_BINARY_DIR}/tests/C/flexpath_tests/maya_append) diff --git a/tests/libs/adios/tests/C/flexpath_tests/maya_append/Makefile.am b/tests/libs/adios/tests/C/flexpath_tests/maya_append/Makefile.am new file mode 100644 index 0000000000..034c175f09 --- /dev/null +++ b/tests/libs/adios/tests/C/flexpath_tests/maya_append/Makefile.am @@ -0,0 +1,19 @@ +AM_CPPFLAGS = $(all_includes) +AM_CPPFLAGS += -I$(top_srcdir)/src -I$(top_srcdir)/src/public -I$(srcdir)/../include + +AUTOMAKE_OPTIONS = no-dependencies + +noinst_PROGRAMS = writer_maya reader_maya + +writer_maya_SOURCES = writer.c ../common/utils.c +writer_maya_LDADD = $(top_builddir)/src/libadios.a $(ADIOSLIB_LDADD) +writer_maya_LDFLAGS = $(ADIOSLIB_LDFLAGS) +reader_maya_SOURCES = reader.c ../common/utils.c +reader_maya_LDADD = $(top_builddir)/src/libadios.a $(ADIOSLIB_LDADD) +reader_maya_LDFLAGS = $(ADIOSLIB_LDFLAGS) + +CLEANFILES = *.bp +CC=$(MPICC) + +EXTRA_DIST = cfg.h readme.txt + diff --git a/tests/libs/adios/tests/C/flexpath_tests/maya_append/cfg.h b/tests/libs/adios/tests/C/flexpath_tests/maya_append/cfg.h new file mode 100644 index 0000000000..52ce6d26f8 --- /dev/null +++ b/tests/libs/adios/tests/C/flexpath_tests/maya_append/cfg.h @@ -0,0 +1,26 @@ +/** + * cfg.h + * + * Created on: Aug 23, 2013 + * Author: Magda Slawinska aka Magic Magg magg dot gatech at gmail.com + */ + +#ifndef CFG_H_ +#define CFG_H_ + +//! params for the method +#define TRANSPORT_PARAMS "" + +//! adios buffer size in MB +#define ADS_BUFFER_SIZE 50 + +//! the name of adios group in the file +#define GRP_NAME "carpet_var" + +//! how many loop iterations is in the writer +#define TIMESTEP_COUNT 10 + +//! the maya grid function prefix +#define MAYA_GF_VAR_PFX "maya_gf_var" + +#endif /* CFG_H_ */ diff --git a/tests/libs/adios/tests/C/flexpath_tests/maya_append/reader.c b/tests/libs/adios/tests/C/flexpath_tests/maya_append/reader.c new file mode 100644 index 0000000000..0c96e3d743 --- /dev/null +++ b/tests/libs/adios/tests/C/flexpath_tests/maya_append/reader.c @@ -0,0 +1,137 @@ +/** + * reader.c + * + * Created on: Aug 21, 2013 + * Author: Magda Slawinska aka Magic Magg magg dot gatech at gmail.com + */ + +#include +#include "mpi.h" +#include "adios.h" +#include "adios_read.h" + +#include "misc.h" +#include "utils.h" +#include "test_common.h" +#include "cfg.h" + + +/** + * wrapper for scheduling adios reads; this macro assumes existence of + * quite a few important variables; please take a look and be careful + * how to use it + * + * @param path_str The path to the variable + * @param out_buf The output buffer + */ +#define READ_FULLPATH(attribute, grid_func_name, out_buf) \ + char fullpath[STR_BUFFER_SIZE]; \ + sprintf(fullpath, "%s%s", attribute, grid_func_name); \ + SET_ERROR_IF_NOT_ZERO(adios_schedule_read(adios_handle, sel, fullpath,0,10, out_buf), error_counts.adios); + + +// for printing the values of the variable +#define STR_BUFFER_SIZE 100 + +int main (int argc, char **argv){ + int rank =0; + MPI_Comm comm = MPI_COMM_WORLD; + struct err_counts err = {0, 0}; + struct test_info test_result = {TEST_PASSED, "maya_append"}; + struct adios_tsprt_opts adios_opts; + + GET_ENTRY_OPTIONS(adios_opts, "Runs readers. As many as you want to."); + + // adios read initialization + MPI_Init( &argc, &argv); + MPI_Comm_rank (comm, &rank); + + // depending on the method + SET_ERROR_IF_NOT_ZERO(adios_read_init_method(adios_opts.method, comm, adios_opts.adios_options), err.adios); + RET_IF_ERROR(err.adios, rank); + + + // I will be working with streams so the lock mode is necessary, + // return immediately if the stream unavailable + ADIOS_FILE *adios_handle = adios_read_open_file(FILE_NAME, adios_opts.method, comm); + if ( !adios_handle){ + p_error("Quitting ... (%d) %s\n", adios_errno, adios_errmsg()); + return DIAG_ERR; + } + + int i = 0; + // I will only support reading TIMESTEP_COUNT integers for the level value + int level[TIMESTEP_COUNT]; + int level_scalar[TIMESTEP_COUNT]; + int cctk_bbox[TIMESTEP_COUNT * 6]; + double *data = malloc(8 * 11* 12*13 * TIMESTEP_COUNT); + + memset(level, 0, sizeof(int) * TIMESTEP_COUNT); + memset(cctk_bbox, 0, sizeof(int) * TIMESTEP_COUNT*6); + memset(data, 0, sizeof(double) * 11* 12*13 * TIMESTEP_COUNT); + + // selection should be NULL or as a single variable + // just say that you want to take different steps + adios_schedule_read(adios_handle, NULL, "/level/maya_gf_var",0,10, level); + adios_schedule_read(adios_handle, NULL, "/scalar/maya_gf_var", 0, 10, level_scalar); + adios_schedule_read(adios_handle, NULL, "/cctk_bbox/maya_gf_var", 0, 10, cctk_bbox); + + // now I will try to read with a single variable but with multiple steps + ADIOS_SELECTION *sel = NULL; + uint64_t start_3D[] = {0, 0, 0}; + uint64_t count_3D[] = {11, 12, 13}; + sel = adios_selection_boundingbox(3, start_3D, count_3D ); + adios_schedule_read(adios_handle, sel, "/data/maya_gf_var", 0, 10, data); + adios_selection_delete(sel); + sel = NULL; + + SET_ERROR_IF_NOT_ZERO(adios_perform_reads(adios_handle, 1), err.adios); + + int j = 0; + if (err.adios){ + test_result.result = TEST_FAILED; + } else { + // reference data + int level_ref[TIMESTEP_COUNT]; + gen_1D_array_int(level_ref, TIMESTEP_COUNT, rank); + + int cctk_bbox_ref[6]; + gen_1D_array_int(cctk_bbox_ref, 6, rank); + + double * data_ref = (double *)malloc(11*12*13*sizeof(double)); + gen_1D_array2(data_ref, 11*12*13, rank); + + // compare with reference values + for( i = 0; i < TIMESTEP_COUNT; ++i){ + TEST_INT_EQUAL(level_ref[i], level[i], err.test, test_result.result); + BREAK_IF_ERROR(err.test); + TEST_INT_EQUAL(level_ref[i], level_scalar[i], err.test, test_result.result); + BREAK_IF_ERROR(err.test); + + for( j = 0; j < 6; ++j){ + TEST_INT_EQUAL(cctk_bbox_ref[j], cctk_bbox[i*6 + j], err.test, test_result.result); + BREAK_IF_ERROR(err.test); + } + BREAK_IF_ERROR(err.test); + + for( j = 0; j < 11 * 12 * 13; ++j){ + TEST_DOUBLE_EQUAL(data_ref[j], data[i * 11 * 12 * 13 +j], err.test, test_result.result); + BREAK_IF_ERROR(err.test); + } + BREAK_IF_ERROR(err.test); + } + + free(data_ref); + data_ref = NULL; + } + + if (TEST_PASSED == test_result.result){ + p_test_passed("%s: rank %d\n", test_result.name, rank); + } + + free(data); + data = NULL; + CLOSE_ADIOS_READER(adios_handle, adios_opts.method); + + return DIAG_OK; +} diff --git a/tests/libs/adios/tests/C/flexpath_tests/maya_append/readme.txt b/tests/libs/adios/tests/C/flexpath_tests/maya_append/readme.txt new file mode 100644 index 0000000000..b385a9f307 --- /dev/null +++ b/tests/libs/adios/tests/C/flexpath_tests/maya_append/readme.txt @@ -0,0 +1,64 @@ +# readme.txt +# Created on: Aug 21, 2013 +# Author: Magda S. aka Magic Magg magg dot gatech at gmail.com +# +DESCRIPTION +=========== +The idea is to test how to write in an appended mode and read from +that mode. This test is based on the Maya project. + +It is designed for two methods (use -t flx or -t mpi) + +1. MPI/ADIOS_READ_METHOD_BP +2. FLEXPATH/ADIOS_READ_METHOD_FLEXPATH + + +RUN +===== +# to clean files hanging around after previous runs +$ make -f Makefile.generic clean_test + +# you can run as many writers as you want and as many readers as you want +# they write and read independently; the default is to run one writer +# and one reader +$ ./writer -f mpi +$ ./reader -f mpi + +See Makefile for other options of running the test. + +PLAYING WITH TEST CONFIGURATION +=============================== +To play with the test configuration, you can modify macros in the cfg.h file + +TIMESTEP_COUNT seems to be the only reasonable setting to play so far + +NOTES +====== +2013-08-28 Test passes with the MPI method on my laptop; it fails with the FLEXPATH method +enabled (branch v1.5.1) + +$ ./reader +ERROR: FLEXPATH staging method does not support file mode for reading. Use adios_read_open() to open a staged dataset. + + + +TROUBLESHOOTING +================ + +2013-08-06, ERROR adios_allocate_buffer(): insufficient memory + +ERROR: adios_allocate_buffer (): insufficient memory: 5242880000 requested, 860221440 available. Using available. + +$ grep ADS_BUFFER_SIZE cfg.h +#define ADS_BUFFER_SIZE 50 + +Try changing the ADS_BUFFER_SIZE in cfg.h to a smaller value. + +2013-0x-0y, txt files left + +There might be text files left; they should be removed for the next run. + +# EOF + +# EOF + diff --git a/tests/libs/adios/tests/C/flexpath_tests/maya_append/writer.c b/tests/libs/adios/tests/C/flexpath_tests/maya_append/writer.c new file mode 100644 index 0000000000..cf1c5d2664 --- /dev/null +++ b/tests/libs/adios/tests/C/flexpath_tests/maya_append/writer.c @@ -0,0 +1,133 @@ +/** + * writer.c + * + * Created on: Aug 21, 2013 + * Author: Magda Slawinska aka Magic Magg magg dot gatech at gmail.com + */ + +#include "mpi.h" +#include "adios.h" +#include "adios_read.h" // for adios_errno + +#include "misc.h" +#include "test_common.h" +#include "utils.h" +#include "cfg.h" + +#include + +// for printing the values of the variable +#define STR_BUFFER_SIZE 100 + +/** + * wrapper for writes; this macro assumes existence fullpath + * quite a few important variables; please take a look and be careful + * how to use it + * + * I simulate Maya var name which consists of the attribute and the + * grid function + * + * @param attribute The attribute (part of adios variable name or path) + * @param grid_func_name The name of the grid function + * @param var The var to be written out + * + */ +#define WRITE_VAR(attribute, grid_func_name, var) \ + do { \ + sprintf(fullpath, "%s%s", attribute, grid_func_name); \ + adios_write(adios_handle, fullpath, var); \ + } while (0) + + +int main(int argc, char ** argv){ + int rank = 0, size = 0; + MPI_Comm comm = MPI_COMM_WORLD; // required for ADIOS + int64_t adios_handle; // the ADIOS file handler + int retval; + + struct adios_tsprt_opts adios_opts; + int err_count = 0; + + GET_ENTRY_OPTIONS(adios_opts, "Runs writers. As many as you want to."); + + // ADIOS initialization + MPI_Init(&argc, &argv); + MPI_Comm_rank(comm, &rank); + MPI_Comm_size(comm, &size); + + // From sources it just returns 1 (2013-07-16, whatever) + adios_init_noxml(comm); + + // returns 0 (buffer allocated) or 1 (seems everything fine) + // I guess size of the buffer in MB + adios_allocate_buffer(ADIOS_BUFFER_ALLOC_NOW, ADS_BUFFER_SIZE); + + // this will hold the group id for all variables defined within this group + int64_t adios_grp = 0; + + // now declare a group and variables you will have in the group + adios_declare_group(&adios_grp, GRP_NAME, "", adios_flag_no); + + uint64_t adios_groupsize = 0; + + adios_define_var (adios_grp, MAYA_GF_VAR_PFX, "/level", adios_integer, "1", "1", "0"); + adios_groupsize += 4; + + adios_define_var (adios_grp, MAYA_GF_VAR_PFX, "/scalar", adios_integer, "", "", ""); + adios_groupsize += sizeof(uint64_t); + + adios_define_var (adios_grp, MAYA_GF_VAR_PFX, "/cctk_bbox", adios_integer, "6", "6", "0" ); + adios_groupsize += (4 * 2 * 3); + + adios_define_var (adios_grp, MAYA_GF_VAR_PFX, "/data", adios_double, "11,12,13", "11,12,13", "0,0,0"); + adios_groupsize += (8 * 11 * 12 *13); + + + SET_ERROR_IF_ZERO(adios_select_method(adios_grp, adios_opts.transport, "", ""), err_count); + RET_IF_ERROR(err_count, rank); + + + int i = 0; + + // these are values that will be written + int level[TIMESTEP_COUNT]; + gen_1D_array_int(level, TIMESTEP_COUNT, rank); + + int cctk_bbox[6]; + gen_1D_array_int(cctk_bbox, 6, rank); + + double * data = (double *)malloc(11*12*13*sizeof(double)); + gen_1D_array2(data, 11*12*13, rank); + + + // required by WRITE_VAR macro (see the macro) + char fullpath[STR_BUFFER_SIZE]; + + // actually adios_write() doesn't write anything; the actual write + // is performed on or after adios_close() so having + // adios_open and adios_close out of the for loop will not produce + // the desired effect i.e., appending to values + for(i = 0; i < TIMESTEP_COUNT; ++i){ + // open our group and transport method associated with it + adios_open (&adios_handle, GRP_NAME, FILE_NAME, "a", comm); + + uint64_t adios_totalsize = 0; + retval=adios_group_size (adios_handle, adios_groupsize, &adios_totalsize); + fprintf(stderr, "Rank=%d adios_group_size(): adios_groupsize=%lld, adios_totalsize=%lld, retval=%d\n", + rank, adios_groupsize, adios_totalsize, retval); + WRITE_VAR("/level/", MAYA_GF_VAR_PFX, &level[i]); + WRITE_VAR("/scalar/", MAYA_GF_VAR_PFX, &level[i]); + WRITE_VAR("/cctk_bbox/", MAYA_GF_VAR_PFX, cctk_bbox); + WRITE_VAR("/data/", MAYA_GF_VAR_PFX, data); + + fprintf(stderr, "Rank=%d committed write\n", rank); + adios_close(adios_handle); + } + + free(data); + data = NULL; + adios_finalize(rank); + MPI_Finalize(); + + return 0; +} diff --git a/tests/libs/adios/tests/C/flexpath_tests/maya_noxml/CMakeLists.txt b/tests/libs/adios/tests/C/flexpath_tests/maya_noxml/CMakeLists.txt new file mode 100644 index 0000000000..7c9a99508d --- /dev/null +++ b/tests/libs/adios/tests/C/flexpath_tests/maya_noxml/CMakeLists.txt @@ -0,0 +1,15 @@ +include_directories(${PROJECT_SOURCE_DIR}/src/public) +include_directories(${PROJECT_SOURCE_DIR}/src) +include_directories(${PROJECT_SOURCE_DIR}/tests/C/flexpath_tests/include) +link_directories(${PROJECT_SOURCE_DIR}/src) +link_directories(${PROJECT_BINARY_DIR}/src) +link_directories(${MXML_INCLUDE_DIR}/../lib) + + +add_executable(writer_maya_noxml writer.c ../common/utils.c) +target_link_libraries(writer_maya_noxml adios ${ADIOSLIB_LDADD} ${MPI_C_LIBRARIES}) + +add_executable(reader_maya_noxml reader.c ../common/utils.c) +target_link_libraries(reader_maya_noxml adios ${ADIOSLIB_LDADD} ${MPI_C_LIBRARIES}) + +file(COPY readme.txt DESTINATION ${PROJECT_BINARY_DIR}/tests/C/flexpath_tests/maya_append) diff --git a/tests/libs/adios/tests/C/flexpath_tests/maya_noxml/Makefile.am b/tests/libs/adios/tests/C/flexpath_tests/maya_noxml/Makefile.am new file mode 100644 index 0000000000..e875bd36b2 --- /dev/null +++ b/tests/libs/adios/tests/C/flexpath_tests/maya_noxml/Makefile.am @@ -0,0 +1,19 @@ +AM_CPPFLAGS = $(all_includes) +AM_CPPFLAGS += -I$(top_srcdir)/src -I$(top_srcdir)/src/public -I$(srcdir)/../include + +AUTOMAKE_OPTIONS = no-dependencies + +noinst_PROGRAMS = writer_maya_noxml reader_maya_noxml + +writer_maya_noxml_SOURCES = writer.c ../common/utils.c +writer_maya_noxml_LDADD = $(top_builddir)/src/libadios.a $(ADIOSLIB_LDADD) +writer_maya_noxml_LDFLAGS = $(ADIOSLIB_LDFLAGS) +reader_maya_noxml_SOURCES = reader.c ../common/utils.c +reader_maya_noxml_LDADD = $(top_builddir)/src/libadios.a $(ADIOSLIB_LDADD) +reader_maya_noxml_LDFLAGS = $(ADIOSLIB_LDFLAGS) + +CLEANFILES = *.bp +CC=$(MPICC) + +EXTRA_DIST = cfg.h readme.txt + diff --git a/tests/libs/adios/tests/C/flexpath_tests/maya_noxml/cfg.h b/tests/libs/adios/tests/C/flexpath_tests/maya_noxml/cfg.h new file mode 100644 index 0000000000..dcf0fe1a8b --- /dev/null +++ b/tests/libs/adios/tests/C/flexpath_tests/maya_noxml/cfg.h @@ -0,0 +1,47 @@ +/** + * config.h + * + * Created on: Jul 17, 2013 + * Author: Magda Slawinska aka Magic Magg magg dot gatech at gmail.com + */ + +#ifndef CONFIG_H_ +#define CONFIG_H_ + +//! the maya grid function prefix +#define MAYA_GF_VAR_PFX "maya_gf_var" + +//! the number of grid functions; change this parameter +//! to see if test passes +//#define MAYA_GRID_FUNC_COUNT 5113 +#define MAYA_GRID_FUNC_COUNT 3 + +//! the size of the buffer for the name of maya var +#define MAYA_VAR_BUF_SIZE 30 + +//! params for the method +#define TRANSPORT_PARAMS "" + +//! adios buffer size in MB +#define ADS_BUFFER_SIZE 50 + +//! the number of patches I want to write (this is what I got from Maya) +#define GLOBAL_PATCH_COUNT 27 + +//! GLOBAL_DIMENSIONS should be in accordance with MAYA_SHAPE_MAX_XXX +//! this is responsible for shape or slice of the data +#define GLOBAL_DIMENSIONS "P,48,89,116" +#define MAYA_SHAPE_MAX_X 48 +#define MAYA_SHAPE_MAX_Y 89 +#define MAYA_SHAPE_MAX_Z 116 + +//! for defining a box; should be <= for corresponding MAYA_SHAPE_MAX_Xxx +//! actual "shape" or slice of the data (this is because we had to +//! something like this in Maya); but don't quote me on that +#define MAYA_SHAPE_X 38 +#define MAYA_SHAPE_Y 69 +#define MAYA_SHAPE_Z 38 + + +#endif //CONFIG_H_ + diff --git a/tests/libs/adios/tests/C/flexpath_tests/maya_noxml/reader.c b/tests/libs/adios/tests/C/flexpath_tests/maya_noxml/reader.c new file mode 100644 index 0000000000..2464a588cf --- /dev/null +++ b/tests/libs/adios/tests/C/flexpath_tests/maya_noxml/reader.c @@ -0,0 +1,374 @@ +/** + * reader.c + * + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + * + * Created on: Jul 19, 2013 + * Author: Magda Slawinska aka Magic Magg magg dot gatech at gmail.com + * + * This is a test for the FlexPath method based on examples/C/flexpath_arrays + */ + +#include "mpi.h" +#include "adios.h" +#include "adios_read.h" + +#include "misc.h" +#include "utils.h" +#include "test_common.h" +#include "cfg.h" + +#include +#include +#include +#include + +/* + * This is what the reader expects to read. + * + $ bpls test.bp + unsigned integer /P scalar + unsigned integer /patch_id scalar + unsigned integer /shape_dim_x scalar + unsigned integer /shape_dim_y scalar + unsigned integer /shape_dim_z scalar + double /data/maya_gf_var0 {27, 48, 89, 116} + integer /level/maya_gf_var0 {27} + integer /carpet_mglevel/maya_gf_var0 {27} + integer /timestep/maya_gf_var0 {27} + integer /group_timelevel/maya_gf_var0 {27} + double /time/maya_gf_var0 {27} + integer /cctk_bbox/maya_gf_var0 {27, 6} + integer /cctk_nghostzones/maya_gf_var0 {27, 3} + double /origin/maya_gf_var0 {27, 3} + double /delta/maya_gf_var0 {27, 3} + integer /iorigin/maya_gf_var0 {27, 3} + unsigned long long /shape/maya_gf_var0 {27, 3} +*/ + +// for printing the values of the variable +#define STR_BUFFER_SIZE 100 + +/** + * wrapper for scheduling adios reads; this macro assumes existence + * quite a few important variables; please take a look and be careful + * how to use it + * + * @param path_str The path to the variable + * @param out_buf The output buffer + */ +#define READ_FULLPATH(path_str, out_buf) \ + sprintf(fullpath, "%s%s", path_str, fullname); \ + SET_ERROR_IF_NOT_ZERO(adios_schedule_read(adios_handle, sel, fullpath,0,1, out_buf), error_counts.adios); \ + BREAK_IF_ERROR(error_counts.adios); + + + +int main (int argc, char **argv){ + int rank =0; + MPI_Comm comm = MPI_COMM_WORLD; + diag_t diag = DIAG_OK; // to store the diagnostic information + struct test_info test_result = { TEST_PASSED, "maya_noxml" }; + struct err_counts error_counts = {0, 0}; + struct adios_tsprt_opts adios_opts; + + GET_ENTRY_OPTIONS(adios_opts, "Runs readers."); + + // adios read initialization + MPI_Init( &argc, &argv); + MPI_Comm_rank (comm, &rank); + + // depending on the method + SET_ERROR_IF_NOT_ZERO(adios_read_init_method(adios_opts.method, comm, adios_opts.adios_options), error_counts.adios); + RET_IF_ERROR(error_counts.adios, rank); + + // I will be working with streams so the lock mode is necessary, + // return immediately if the stream unavailable + ADIOS_FILE *adios_handle = adios_read_open(FILE_NAME, adios_opts.method, comm, ADIOS_LOCKMODE_NONE, 0.0); + if ( !adios_handle){ + p_error("Quitting ... (%d) %s\n", adios_errno, adios_errmsg()); + return DIAG_ERR; + } + + // now I will try to read what I got from the checkpoint + // define portions of data how they will be read + ADIOS_SELECTION *sel = NULL; + ADIOS_VARINFO *avi = NULL; + + avi = adios_inq_var(adios_handle, "P"); + if (!avi){ + p_error("rank %d: Quitting ... (%d) %s\n", rank, adios_errno, adios_errmsg()); + CLOSE_ADIOS_READER(adios_handle, adios_opts.method); + return DIAG_ERR; + } + + if( GLOBAL_PATCH_COUNT != *(int*)avi->value){ + p_test_failed("%s: rank %d: global_patch_count (got %d)\n", test_result.name, rank, *(int*)avi->value ); + test_result.result = TEST_FAILED; + // clean everything + adios_free_varinfo(avi); + avi = NULL; + CLOSE_ADIOS_READER(adios_handle, adios_opts.method); + return DIAG_ERR; + } + + // for holding the name of the maya variable + char fullname[MAYA_VAR_BUF_SIZE]; + int i = 0; + // for storing shape_dim_x, shape_dim_y, shape_dim_z + int shape_max_dims[3]; + + // space for the data (size will depend on the shape_dim_x, etc) + double *data = NULL; + uint32_t patch_id = 0; + int32_t level = 0; + int32_t carpet_mglevel = 0; + int32_t timestep = 0; + int32_t grp_tl = 0; + double time_attr = 0.0; + int32_t cctk_bbox[6]; + int32_t cctk_nghostzones[3]; + double origin[3]; + double delta[3]; + int32_t iorigin[3]; + uint64_t shape[3]; + + // I think these are global variables, so shouldn't be a problem + + // first schedule reading of the entire variables (so NULL selection) + // reading the patch_id doesn't make much sense as it seems that only the + // very first value is written out so we will get 0 + SET_ERROR_IF_NOT_ZERO(adios_schedule_read(adios_handle, NULL, "patch_id",0,1, &patch_id), error_counts.adios); + RET_AND_CLOSE_ADIOS_READER_IF_ERROR(error_counts.adios, rank, adios_handle, adios_opts.method); + + SET_ERROR_IF_NOT_ZERO(adios_schedule_read(adios_handle, NULL, "shape_dim_x",0,1, &shape_max_dims[0]), error_counts.adios); + RET_AND_CLOSE_ADIOS_READER_IF_ERROR(error_counts.adios, rank, adios_handle, adios_opts.method); + + SET_ERROR_IF_NOT_ZERO(adios_schedule_read(adios_handle, NULL, "shape_dim_y",0,1, &shape_max_dims[1]), error_counts.adios); + RET_AND_CLOSE_ADIOS_READER_IF_ERROR(error_counts.adios, rank, adios_handle, adios_opts.method); + + SET_ERROR_IF_NOT_ZERO(adios_schedule_read(adios_handle, NULL, "shape_dim_z",0,1, &shape_max_dims[2]), error_counts.adios); + RET_AND_CLOSE_ADIOS_READER_IF_ERROR(error_counts.adios, rank, adios_handle, adios_opts.method); + + // not sure if this assumption is correct; difficult to find in the ADIOS sources + SET_ERROR_IF_NOT_ZERO(adios_perform_reads(adios_handle, 1), error_counts.adios); + RET_AND_CLOSE_ADIOS_READER_IF_ERROR(error_counts.adios, rank, adios_handle, adios_opts.method); + + // now test if what I read is what I supposed to get; see comment with + // adios_schedule_read(patch_id) + TEST_INT_EQUAL(0, patch_id, error_counts.test, test_result.result); + RET_AND_CLOSE_ADIOS_READER_IF_TEST_FAILED(test_result, rank, adios_handle, adios_opts.method); + + TEST_INT_EQUAL(MAYA_SHAPE_MAX_X, shape_max_dims[0], error_counts.test, test_result.result); + RET_AND_CLOSE_ADIOS_READER_IF_TEST_FAILED(test_result, rank, adios_handle, adios_opts.method); + + TEST_INT_EQUAL(MAYA_SHAPE_MAX_Y, shape_max_dims[1], error_counts.test, test_result.result); + RET_AND_CLOSE_ADIOS_READER_IF_TEST_FAILED(test_result, rank, adios_handle, adios_opts.method); + + TEST_INT_EQUAL(MAYA_SHAPE_MAX_Z, shape_max_dims[2], error_counts.test, test_result.result); + RET_AND_CLOSE_ADIOS_READER_IF_TEST_FAILED(test_result, rank, adios_handle, adios_opts.method); + + // so here I assume that our data buffer is fixed, and I allocate + // space for that buffer, and consult the reader but the + // size of the output data depends on the shape_max_dims that I have + // already tested that I read as expected + int data_size = 0; + + if (get_data_size(shape_max_dims, 3, &data_size) != DIAG_OK){ + RET_IF_ERROR(1, rank); + } + // just in case + assert(shape_max_dims[0] * shape_max_dims[1] *shape_max_dims[2] * 8 == data_size); + data = (double *) malloc(data_size); + if( !data ){ + RET_IF_ERROR(1, rank); + } + + // the data are the same for all variables so fill the reference data + double * ref_data = (double *) malloc(data_size); + if( !(ref_data) || (set_value(ref_data, shape_max_dims[0] * shape_max_dims[1] *shape_max_dims[2], (double) rank) != DIAG_OK) ){ + free(data); + RET_IF_ERROR(1, rank); + } + + + // for storing the name of the variable + char fullpath[STR_BUFFER_SIZE]; + char * levelpath = "/level/"; + char * datapath = "/data/"; + char * mglevelpath = "/carpet_mglevel/"; + char * timesteppath ="/timestep/"; + char * group_timelevelpath = "/group_timelevel/"; + char * timepath = "/time/"; + char * cbbpath = "/cctk_bbox/"; + char * cngzpath = "/cctk_nghostzones/"; + char * originpath = "/origin/"; + char * deltapath = "/delta/"; + char * ioriginpath = "/iorigin/"; + char * shapepath = "/shape/"; + + // read all variables with attributes + for(i = 0; i < MAYA_GRID_FUNC_COUNT; ++i){ + int k = 0; + + // clean the buffers to hold output data + level = 0; + carpet_mglevel = 0; + timestep = 0; + grp_tl = 0; + time_attr = 0.0; + for(k = 0 ; k < 3; ++k){ + cctk_bbox[k] = 0; + cctk_nghostzones[k] = 0; + origin[k] = 0; + delta[k] = 0; + iorigin[k] = 0; + shape[k] = 0; + } + for(k =3; k < 6; ++k){ + cctk_bbox[k] = 0; + } + + memset(data, 0, data_size); + // generate the name of maya variable + gen_maya_var_name(fullname, MAYA_VAR_BUF_SIZE, MAYA_GF_VAR_PFX, i); + + // now I need to play carefully with the selections, as ADIOS + // does not provide any help if you messed up with selections + + uint64_t count_1D = 1; + // this is assumed that the data are in this patch - we have to know + // how it was written out i-th grid function was outputted in i + uint64_t start_1D = i; + + sel = adios_selection_boundingbox(1, &start_1D, &count_1D ); + + READ_FULLPATH(levelpath, &level); + READ_FULLPATH(mglevelpath, &carpet_mglevel); + READ_FULLPATH(timesteppath, ×tep); + READ_FULLPATH(group_timelevelpath, &grp_tl); + READ_FULLPATH(timepath, &time_attr); + + adios_selection_delete(sel); + sel = NULL; + + // now more complex variables + uint64_t count_2D[] = {1, 6}; + // this is assumed that the data are in this patch - we have to know + // how it was written out i-th grid function was outputted in i-th patch + // e.g., bpls -d test.bp -s"1,0" -c/cctk_bbox/maya_gf_var1 -n 12 + uint64_t start_2D[] = {i, 0}; + + sel = adios_selection_boundingbox(2, start_2D, count_2D ); + + READ_FULLPATH(cbbpath, cctk_bbox); + + adios_selection_delete(sel); + sel = NULL; + + // now there is a deal with a 3 element vectors + count_2D[1] = 3; // this is a 3 elem vector + + sel = adios_selection_boundingbox(2, start_2D, count_2D ); + READ_FULLPATH(cngzpath, cctk_nghostzones); + READ_FULLPATH(originpath, origin); + READ_FULLPATH(deltapath, delta); + READ_FULLPATH(ioriginpath, iorigin); + READ_FULLPATH(shapepath, shape); + + adios_selection_delete(sel); + sel = NULL; + + SET_ERROR_IF_NOT_ZERO(adios_perform_reads(adios_handle, 1), error_counts.adios); + RET_AND_CLOSE_ADIOS_READER_IF_ERROR(error_counts.adios, rank, adios_handle, adios_opts.method); + + // now tests if I get what I expected to get + TEST_INT_EQUAL(i, level, error_counts.test, test_result.result); + BREAK_IF_ERROR(error_counts.test); + + TEST_INT_EQUAL(i%2, carpet_mglevel, error_counts.test, test_result.result); + BREAK_IF_ERROR(error_counts.test); + + TEST_INT_EQUAL(26, timestep, error_counts.test, test_result.result); + BREAK_IF_ERROR(error_counts.test); + + TEST_INT_EQUAL(i%3, grp_tl, error_counts.test, test_result.result); + BREAK_IF_ERROR(error_counts.test); + + TEST_DOUBLE_EQUAL(13.0, time_attr, error_counts.test, test_result.result); + BREAK_IF_ERROR(error_counts.test); + + for(k = 0; k < 6 ; ++k ){ + TEST_INT_EQUAL(13, cctk_bbox[k], error_counts.test, test_result.result); + BREAK_IF_ERROR(error_counts.test); + } + BREAK_IF_ERROR(error_counts.test); + + uint64_t shape_ref[] = {MAYA_SHAPE_X, MAYA_SHAPE_Y, MAYA_SHAPE_Z}; + + for(k = 0; k < 3; ++k){ + TEST_INT_EQUAL(14, cctk_nghostzones[k], error_counts.test, test_result.result); + BREAK_IF_ERROR(error_counts.test); + + TEST_DOUBLE_EQUAL(15.0, origin[k], error_counts.test, test_result.result ); + BREAK_IF_ERROR(error_counts.test); + + TEST_DOUBLE_EQUAL(15.0, delta[k], error_counts.test, test_result.result ); + BREAK_IF_ERROR(error_counts.test); + + TEST_INT_EQUAL(14, iorigin[k], error_counts.test, test_result.result); + BREAK_IF_ERROR(error_counts.test); + + TEST_LONG_EQUAL(shape_ref[k], shape[k], error_counts.test, test_result.result); + BREAK_IF_ERROR(error_counts.test); + } + BREAK_IF_ERROR(error_counts.test); + + // now schedule and perform reading the data; you have to know + // the value of shape[] to read the correct slice of the /data space + // double /data/maya_gf_var1 {27, 48, 89, 116} + // the sizes are the maximum values; in Maya we assume that the + // actual size are for this particular variable are stored in /shape attribute + // so for this test case they are in shape[]; and hopefully + // reading tests passed so I can use shape[] to define the appropriate + // selection + // now more complex variables + uint64_t count_4D[4]; + count_4D[0] = 1; // 1 element in the patch dimension + count_4D[1] = shape[0]; + count_4D[2] = shape[1]; + count_4D[3] = shape[2]; + // this is assumed that the data are in this patch - we have to know + // how it was written out i-th grid function was outputted in i-th patch + // e.g., bpls -d test.bp -s"1,0,0,0" -c"1,shape[0],shape[1],shape[2] /data/maya_gf_var1 -n 12 + uint64_t start_4D[] = {i, 0, 0, 0}; + + sel = adios_selection_boundingbox(4, start_4D, count_4D ); + READ_FULLPATH(datapath, data); + adios_selection_delete(sel); + sel = NULL; + + SET_ERROR_IF_NOT_ZERO(adios_perform_reads(adios_handle, 1), error_counts.adios); + RET_AND_CLOSE_ADIOS_READER_IF_ERROR(error_counts.adios, rank, adios_handle, adios_opts.method); + + // now compare what I got + for(k = 0 ; k < shape[0] *shape[1] *shape[2]; ++k){ + TEST_DOUBLE_EQUAL(ref_data[k], data[k], error_counts.test, test_result.result); + BREAK_IF_ERROR(error_counts.test); + } + BREAK_IF_ERROR(error_counts.test); + } + + adios_free_varinfo(avi); + avi = NULL; + + if (TEST_PASSED == test_result.result) + p_test_passed("%s: rank %d\n", test_result.name, rank); + + CLOSE_ADIOS_READER(adios_handle, adios_opts.method); + + return diag; +} diff --git a/tests/libs/adios/tests/C/flexpath_tests/maya_noxml/readme.txt b/tests/libs/adios/tests/C/flexpath_tests/maya_noxml/readme.txt new file mode 100644 index 0000000000..87c97665c4 --- /dev/null +++ b/tests/libs/adios/tests/C/flexpath_tests/maya_noxml/readme.txt @@ -0,0 +1,116 @@ +# The protocol file generated by protogen.py ver. 1.0 on 2013-06-27 12:54 +# AUTHOR: Magda S aka Magic Magg magg dot gatech at gmail dot com +# DATE: 2013-08-05 + + +DESCRIPTION +=========== +The idea of this test is to have something similar that we have in Maya. +We create a similar, yet simplified structure we are using in Maya. +The basic idea is to write down a lot of ADIOS variables and see if I can reread it. +You can change the number of outputted variables with in utils.h/MAYA_GRID_FUNC_COUNT. +I call them the grid function. The test is slightly convoluted. Sorry for that +but Maya is challenging. + +Actually, this test was used to find the +hash table bug (and later redesigned in the adios). As we tried to write +same variables a few times, and ADIOS at that time couldn't handle that. + +RUN +===== +# to clean files hanging around after previous runs +$ make -f Makefile.generic clean_test + +# the test is designed to run one writer and one reader +$ ./writer -t mpi +$ ./reader -t mpi + +See Makefile for other options of running the test. + +PLAYING WITH TEST CONFIGURATION +=============================== +To play with the test configuration, you can modify macros in the cfg.h file + +- MAYA_GRID_FUNC_COUNT this will increase the number of variables output + (you might need to increase/decrease the ADS_BUFFER_SIZE see troubleshooting) + +NOTES +====== +2013-08-05 Test passes with the MPI method on my laptop; it fails with the FLEXPATH method +enabled (branch v1.5.1) + + $ ./writer -t flx +ERROR: set_format: Unknown Type Error 54 +[heffalin:10320] *** Process received signal *** +[heffalin:10320] Signal: Segmentation fault (11) +[heffalin:10320] Signal code: Address not mapped (1) +[heffalin:10320] Failing at address: (nil) +[heffalin:10320] [ 0] /lib/x86_64-linux-gnu/libc.so.6(+0x364a0) [0x7fbbfda764a0] +[heffalin:10320] [ 1] ./writer(adios_flexpath_open+0x1003) [0x475d46] +[heffalin:10320] [ 2] ./writer() [0x408df1] +[heffalin:10320] [ 3] ./writer() [0x408353] +[heffalin:10320] [ 4] ./writer() [0x4077a5] +[heffalin:10320] [ 5] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed) [0x7fbbfda6176d] +[heffalin:10320] [ 6] ./writer() [0x406e19] +[heffalin:10320] *** End of error message *** +Segmentation fault + + +TROUBLESHOOTING +================ + +2013-08-06, ERROR adios_allocate_buffer(): insufficient memory + +ERROR: adios_allocate_buffer (): insufficient memory: 5242880000 requested, 860221440 available. Using available. + +$ grep ADS_BUFFER_SIZE cfg.h +#define ADS_BUFFER_SIZE 50 + +Try changing the ADS_BUFFER_SIZE in cfg.h to a smaller value. + +OUTDATED (2013-07-08) +====================== +I will update later. + +RUNNING ON KRAKEN +================= +This runs one reader per node and one writer per node. + +aprun -n 1 -N 1 ./arrays_read & +aprun -n 1 -N 1 ./arrays_write + +You should be able to run the example with as many readers and writers as you wish. + +Example PBS script +------------------ +#!/bash/bin +#PBS -l walltime=00:05:00,size=24 +#PBS -A UT-TENN0033 + +date + +echo "nodefile=" +cat $PBS_NODEFILE +echo "=end nodefile" + +# make sure you have all modules loaded +module use ~smagg/opt/modulefiles +module load mag-mxml-2.7/kraken-gnu +module list + +cd $PBS_O_WORKDIR + +aprun -n 1 -N 1 ./arrays_read & +aprun -n 1 -N 1 ./arrays_write + +date + +# eof + + +TROUBLESHOOTING +=============== + +There might be text files left; they should be removed for the next run. + +# EOF diff --git a/tests/libs/adios/tests/C/flexpath_tests/maya_noxml/writer.c b/tests/libs/adios/tests/C/flexpath_tests/maya_noxml/writer.c new file mode 100644 index 0000000000..10104cb63d --- /dev/null +++ b/tests/libs/adios/tests/C/flexpath_tests/maya_noxml/writer.c @@ -0,0 +1,292 @@ +/** + * writer.c + * + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + * + * Created on: Jul 19, 2013 + * Author: Magda Slawinska aka Magic Magg magg dot gatech at gmail.com + * + */ + +#include "mpi.h" +#include "adios.h" +#include "adios_read.h" // for adios_errno + +#include "misc.h" +#include "utils.h" +#include "cfg.h" +#include "test_common.h" + +#include +#include +#include +#include + +// for printing the values of the variable +#define STR_BUFFER_SIZE 100 + +/** + * wrapper for writes; this macro assumes existence + * quite a few important variables; please take a look and be careful + * how to use it + * + * @param path_str The path to the variable + * @param variable The var to be written out + */ +#define WRITE_FULLPATH(path_str, var) \ + sprintf(fullpath, "%s%s", path_str, fullname); \ + adios_write(adios_handle, fullpath, var); + + +int main(int argc, char ** argv){ + int rank=0, size=0; + MPI_Comm comm = MPI_COMM_WORLD; // required for ADIOS + int64_t adios_handle; // the ADIOS file handler + int retval; + struct adios_tsprt_opts adios_opts; + int err_count = 0; + + GET_ENTRY_OPTIONS(adios_opts, "Runs writers."); + + // ADIOS initialization + MPI_Init(&argc, &argv); + MPI_Comm_rank (comm, &rank); + MPI_Comm_size (comm, &size); + + // From sources it just returns 1 (2013-07-16, whatever) + adios_init_noxml(comm); + + // returns 0 (buffer allocated) or 1 (seems everything fine) + // I guess size of the buffer in MB + adios_allocate_buffer(ADIOS_BUFFER_ALLOC_NOW, ADS_BUFFER_SIZE); + + // this will hold the group id for all variables defined within this group + int64_t adios_grp = 0; + + // now declare a group + adios_declare_group(&adios_grp, "carpet_checkpoint", "", adios_flag_no); + + uint64_t adios_groupsize = 0; + + adios_define_var (adios_grp, "P", "", adios_unsigned_integer, "", "", ""); + adios_groupsize += sizeof(uint64_t); + + int i = 0; + // the dimension; for grid functions it should be 3, for scalars should be 1 + int dim = 0; + // for holding the name of the maya variable + char fullname[MAYA_VAR_BUF_SIZE]; + // the shape values + // the max box across all patches + int max_shape[3] = {MAYA_SHAPE_MAX_X, MAYA_SHAPE_MAX_Y, MAYA_SHAPE_MAX_Z}; + // the actual shape for a particular patch + int shape[3] = {MAYA_SHAPE_X, MAYA_SHAPE_Y, MAYA_SHAPE_Z}; + // the size of the data I intend to write as a meat for the checkpoint + int data_size = 0; + if (get_data_size(shape, 3, &data_size) != DIAG_OK){ + p_error("Quitting ...\n"); + return DIAG_ERR; + } + // you need to provide it for the defining the ADIOS group + int max_data_size = 0; + if (get_data_size(max_shape, 3, &max_data_size) != DIAG_OK){ + p_error("Quitting ...\n"); + return DIAG_ERR; + } + + dim = 3; + + // first define variable, since I am using no XML api + for(i = 0; i < MAYA_GRID_FUNC_COUNT; ++i ){ + // this is common for grid functions and scalars + adios_define_var (adios_grp, "patch_id", "", adios_unsigned_integer, "", "", ""); + adios_groupsize += sizeof (uint64_t); + + adios_define_var (adios_grp, "shape_dim_x", "", adios_unsigned_integer, "", "", ""); + adios_define_var (adios_grp, "shape_dim_y", "", adios_unsigned_integer, "", "", ""); + adios_define_var (adios_grp, "shape_dim_z", "", adios_unsigned_integer, "", "", ""); + adios_groupsize += 3*sizeof (uint64_t); // can be bigger + + // I simulate writing grid functions + char * dimensions="1,shape_dim_x,shape_dim_y,shape_dim_z"; + // global dimensions should be, I suppose greater than shap_dim_xxx + // i.e., shape_dim_x <= 48, shape_dim_y <= 89, shape_dim_z <= 116 + char * global_dimensions=GLOBAL_DIMENSIONS; + char * offsets="patch_id,0,0,0"; + // the name of maya variable + memset(fullname, 0, MAYA_VAR_BUF_SIZE); + sprintf(fullname, MAYA_GF_VAR_PFX "%d", i ); + + // I think this is for dataset size for doubles + adios_groupsize += max_data_size; + adios_define_var (adios_grp, fullname, "/data", adios_double, dimensions, global_dimensions, offsets); + + adios_groupsize += (4 + 4 + 4 + 4 + 8); + adios_define_var (adios_grp, fullname, "/level", adios_integer, "1", "P", "patch_id") ; + adios_define_var (adios_grp, fullname, "/carpet_mglevel", adios_integer, "1", "P", "patch_id"); + adios_define_var (adios_grp, fullname, "/timestep", adios_integer, "1", "P", "patch_id"); + adios_define_var (adios_grp, fullname, "/group_timelevel", adios_integer, "1", "P", "patch_id"); + adios_define_var (adios_grp, fullname, "/time", adios_double, "1", "P", "patch_id"); + + char ndim[16]; + char global_dims[18]; + char local_offsets[25]; + + adios_groupsize += (4 * 2 * dim); + sprintf(ndim, "1,%d", 2 * dim); + sprintf(global_dims, "P,%d", 2 * dim); + sprintf(local_offsets, "patch_id,0"); + adios_define_var(adios_grp, fullname, "/cctk_bbox", adios_integer, ndim, global_dims, local_offsets); + + adios_groupsize += (4 * dim); + sprintf(ndim, "1,%d", dim); + sprintf(global_dims, "P,%d", dim); + adios_define_var(adios_grp, fullname, "/cctk_nghostzones",adios_integer, ndim, global_dims, local_offsets); + + adios_groupsize += (8 * dim); + sprintf(ndim, "1,%d", dim); + sprintf(global_dims, "P,%d", dim); + adios_define_var(adios_grp, fullname, "/origin", adios_double, ndim, global_dims, local_offsets); + + adios_groupsize += (8 * dim); + adios_define_var(adios_grp, fullname, "/delta", adios_double, ndim, global_dims, local_offsets); + + adios_groupsize += (4 * dim); + adios_define_var(adios_grp, fullname, "/iorigin", adios_integer, ndim, global_dims, local_offsets); + + adios_groupsize += (sizeof(uint64_t) * dim); + adios_define_var(adios_grp, fullname, "/shape", adios_unsigned_long,ndim, global_dims, local_offsets); + } + + SET_ERROR_IF_ZERO(adios_select_method(adios_grp, adios_opts.transport, "", ""), err_count); + RET_IF_ERROR(err_count, rank); + + // open our group and transport method associated with it + adios_open (&adios_handle, "carpet_checkpoint", FILE_NAME, "w", comm); + uint64_t adios_totalsize = 0; + + retval=adios_group_size (adios_handle, adios_groupsize, &adios_totalsize); + fprintf(stderr, "Rank=%d adios_group_size(): adios_groupsize=%lld, adios_totalsize=%lld, retval=%d\n", + rank, adios_groupsize, adios_totalsize, retval); + + printf("Writing checkpoint to file %s using the %s method: group size is %llu, total size is %llu. ", FILE_NAME, adios_opts.transport, adios_groupsize, adios_totalsize); + + + // arbitrary, but this is what I am getting from Maya + // the number of patches I want to write + const int global_patch_count = GLOBAL_PATCH_COUNT; + + adios_write(adios_handle, "P", (void*)&global_patch_count); + + // now goes adWRiteGroupVar + + char fullpath[STR_BUFFER_SIZE]; + char * levelpath = "/level/"; + char * datapath = "/data/"; + char * mglevelpath = "/carpet_mglevel/"; + char * timesteppath ="/timestep/"; + char * group_timelevelpath = "/group_timelevel/"; + char * timepath = "/time/"; + char * cbbpath = "/cctk_bbox/"; + char * cngzpath = "/cctk_nghostzones/"; + char * originpath = "/origin/"; + char * deltapath = "/delta/"; + char * ioriginpath = "/iorigin/"; + char * shapepath = "/shape/"; + + assert(shape[0] * shape[1] *shape[2] * 8 == data_size); + assert(max_shape[0] * max_shape[1] * max_shape[2] * 8 == max_data_size); + + // generate data that I will send over the ocean + // TODO for some reason it can't be shape[] but max_shape; probably + // the definition of the ADIOS /data var requires the all bytes; + // otherwise it tries to copy some other data + double * my_data = (double *) malloc(max_data_size); + if( set_value(my_data, max_shape[0] * max_shape[1] *max_shape[2], (double) rank) != DIAG_OK ){ + p_error("with generating data. Quitting\n"); + return DIAG_ERR; + } + + int my_patch_index = 0; + + + for(i = 0; i < MAYA_GRID_FUNC_COUNT; ++i){ + + // generate the name of maya variable + gen_maya_var_name(fullname, MAYA_VAR_BUF_SIZE, MAYA_GF_VAR_PFX, i); + + // the purpose of writing this variable is to enable + // ADIOS to output the rest of variables in the correct place + // however, if I try to read the value of patch_id e.g. with + // bpls -d /patch_id, I can see only scalar with value 0 + // if you try to read the /level attribute without changing + // patch_id (i.e., keeping it at value equal 0), the level + // is always outputed in the same place so I guess the key thing + // is adios_define_var("/level", adios_integer, "1", "P", "patch_id") + // and that's why if you want to see level for different patch + // you need to have adios_write(patch_id) here; not above the + // for loop + // the idea was to write each variable with a designated different patch + adios_write (adios_handle, "patch_id", &my_patch_index); + my_patch_index++; + my_patch_index %= global_patch_count; + + // these max shape dims; this also tests if we can rewrite the + // same variable over and over; as we did this for the Maya + adios_write (adios_handle, "shape_dim_x", &max_shape[0]) ; + adios_write (adios_handle, "shape_dim_y", &max_shape[1]) ; + adios_write (adios_handle, "shape_dim_z", &max_shape[2]) ; + + // Write the data + WRITE_FULLPATH(datapath, my_data); + + int refinementlevel=i; + WRITE_FULLPATH(levelpath, &refinementlevel); + + int mglevel = i%2; + WRITE_FULLPATH(mglevelpath, &mglevel); + + int ts = 26; + WRITE_FULLPATH(timesteppath, &ts); + + int grp_tl = i%3; + WRITE_FULLPATH(group_timelevelpath, &grp_tl); + + double time_attr = 13.0; + WRITE_FULLPATH(timepath, &time_attr); + + int dim_6_int[6] = {13,13,13,13,13,13}; + int dim_3_int[3] = {14,14,14}; + double dim_3_double[3] = {15.0,15.0,15.0 }; + uint64_t dim_3_uint64_t[3] = {MAYA_SHAPE_X, MAYA_SHAPE_Y, MAYA_SHAPE_Z}; + + WRITE_FULLPATH(cbbpath, dim_6_int); + WRITE_FULLPATH(cngzpath, dim_3_int); + WRITE_FULLPATH(originpath, dim_3_double); + WRITE_FULLPATH(deltapath, dim_3_double); + WRITE_FULLPATH(ioriginpath, dim_3_int); + + // this is the size of adios_unsigned_long @see adios_get_type_size() + assert(sizeof(uint64_t) == 8); + WRITE_FULLPATH(shapepath, dim_3_uint64_t); + } + + fprintf(stderr, "Rank=%d committed write\n", rank); + + free(my_data); + my_data = NULL; + + adios_close(adios_handle); + + // clean and finalize the system + adios_finalize(rank); + MPI_Finalize(); + + printf("\n"); + + return 0; +} + diff --git a/tests/libs/adios/tests/C/flexpath_tests/scalar/CMakeLists.txt b/tests/libs/adios/tests/C/flexpath_tests/scalar/CMakeLists.txt new file mode 100644 index 0000000000..c33201e8c3 --- /dev/null +++ b/tests/libs/adios/tests/C/flexpath_tests/scalar/CMakeLists.txt @@ -0,0 +1,15 @@ +include_directories(${PROJECT_SOURCE_DIR}/src/public) +include_directories(${PROJECT_SOURCE_DIR}/src) +include_directories(${PROJECT_SOURCE_DIR}/tests/C/flexpath_tests/include) +link_directories(${PROJECT_SOURCE_DIR}/src) +link_directories(${PROJECT_BINARY_DIR}/src) +link_directories(${MXML_INCLUDE_DIR}/../lib) + + +add_executable(writer_scalar writer.c ../common/utils.c) +target_link_libraries(writer_scalar adios ${ADIOSLIB_LDADD} ${MPI_C_LIBRARIES}) + +add_executable(reader_scalar reader.c ../common/utils.c) +target_link_libraries(reader_scalar adios ${ADIOSLIB_LDADD} ${MPI_C_LIBRARIES}) + +file(COPY test_config_flex.xml test_config_mpi.xml readme.txt DESTINATION ${PROJECT_BINARY_DIR}/tests/C/flexpath_tests/maya_append) diff --git a/tests/libs/adios/tests/C/flexpath_tests/scalar/Makefile.am b/tests/libs/adios/tests/C/flexpath_tests/scalar/Makefile.am new file mode 100644 index 0000000000..f976ecfbe0 --- /dev/null +++ b/tests/libs/adios/tests/C/flexpath_tests/scalar/Makefile.am @@ -0,0 +1,21 @@ +AM_CPPFLAGS = $(all_includes) +AM_CPPFLAGS += -I$(top_srcdir)/src -I$(top_srcdir)/src/public -I$(srcdir)/../include + +AUTOMAKE_OPTIONS = no-dependencies + +all-local: + test "$(srcdir)" = "$(builddir)" || cp $(srcdir)/*.xml $(builddir) + test "$(srcdir)" = "$(builddir)" || cp $(srcdir)/readme.txt $(builddir) + +noinst_PROGRAMS = writer_scalar reader_scalar + +writer_scalar_SOURCES = writer.c ../common/utils.c +writer_scalar_LDADD = $(top_builddir)/src/libadios.a $(ADIOSLIB_LDADD) +writer_scalar_LDFLAGS = $(ADIOSLIB_LDFLAGS) +reader_scalar_SOURCES = reader.c ../common/utils.c +reader_scalar_LDADD = $(top_builddir)/src/libadios.a $(ADIOSLIB_LDADD) +reader_scalar_LDFLAGS = $(ADIOSLIB_LDFLAGS) + +CLEANFILES = *.bp +CC=$(MPICC) +EXTRA_DIST = test_config_flex.xml test_config_mpi.xml cfg.h readme.txt diff --git a/tests/libs/adios/tests/C/flexpath_tests/scalar/cfg.h b/tests/libs/adios/tests/C/flexpath_tests/scalar/cfg.h new file mode 100644 index 0000000000..e3d853ab71 --- /dev/null +++ b/tests/libs/adios/tests/C/flexpath_tests/scalar/cfg.h @@ -0,0 +1,14 @@ +/** + * cfg.h + * + * Created on: Sep 4, 2013 + * Author: Magda Slawinska aka Magic Magg magg dot gatech at gmail.com + */ + +#ifndef CFG_H_ +#define CFG_H_ + +//! size of the X dimension +#define NX_DIM 10 + +#endif /* CFG_H_ */ diff --git a/tests/libs/adios/tests/C/flexpath_tests/scalar/reader.c b/tests/libs/adios/tests/C/flexpath_tests/scalar/reader.c new file mode 100644 index 0000000000..fad707ed8a --- /dev/null +++ b/tests/libs/adios/tests/C/flexpath_tests/scalar/reader.c @@ -0,0 +1,129 @@ +/** + * reader.c + * + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + * + * Created on: Jul 1, 2013 + * Author: Magda Slawinska aka Magic Magg magg dot gatech at gmail.com + * + * The process reads an integer scalar. It should be equal to its rank. + * Excessive processes (if rank > the number of writers) quit. It is recommended, + * however, to run as many readers as writers. + */ + +#include "mpi.h" +#include "adios.h" +#include "adios_read.h" + +#include "misc.h" +#include "utils.h" +#include "test_common.h" +#include "cfg.h" + +#include +#include +#include +#include + + + +int main (int argc, char **argv){ + int rank =0, size =0; + int my_scalar = -1; // this will hold what I got from the writer + MPI_Comm comm = MPI_COMM_WORLD; + diag_t diag = DIAG_OK; // to store the diagnostic information + struct test_info test_result = { TEST_PASSED, "scalar" }; + struct err_counts err = { 0, 0}; + struct adios_tsprt_opts adios_opts; + + GET_ENTRY_OPTIONS(adios_opts, "Runs readers. It is recommended to run as many readers as writers."); + + // adios read initialization + MPI_Init( &argc, &argv); + MPI_Comm_rank (comm, &rank); + + // choose the right method depending on the method + SET_ERROR_IF_NOT_ZERO(adios_read_init_method(adios_opts.method, comm, adios_opts.adios_options), err.adios); + RET_IF_ERROR(err.adios, rank); + + + // I will be working with streams so the lock mode is necessary, + // return immediately if the stream unavailable + ADIOS_FILE *adios_handle = adios_read_open(FILE_NAME, adios_opts.method, comm, ADIOS_LOCKMODE_NONE, 0.0); + if ( !adios_handle){ + p_error("Quitting ... (%d) %s\n", adios_errno, adios_errmsg()); + return DIAG_ERR; + } + + // define portions of data how they will be read + ADIOS_SELECTION *sel = NULL; + ADIOS_VARINFO *avi = NULL; + + // read how many processors wrote that array + avi = adios_inq_var (adios_handle, "size"); + if (!avi){ + p_error("rank %d: Quitting ... (%d) %s\n", rank, adios_errno, adios_errmsg()); + diag = DIAG_ERR; + goto close_adios; + } + size = *((int*)avi->value); + adios_free_varinfo(avi); + avi = NULL; + + // if I run more readers than writers; just release + // the excessive readers + if (rank >= size){ + p_info("rank %d: I am an excessive rank. Nothing to read ...\n", rank); + // diag should be DIAG_OK + goto close_adios; + } + + // this is the index of the written block + sel = adios_selection_writeblock(rank); + if( !sel ){ + p_error("rank %d: Quitting ... (%d) %s\n", rank, adios_errno, adios_errmsg()); + diag = DIAG_ERR; + goto close_adios; + } + + // TODO as of 2013-07-08, I was told that err_end_of_stream doesn't work + // as it supposed to work + //while(adios_errno != err_end_of_stream){ + + if (adios_schedule_read(adios_handle, sel, "lucky_scalar",0,1,&my_scalar) != 0){ + p_error("rank %d: Quitting ...(%d) %s\n", rank, adios_errno, adios_errmsg()); + adios_selection_delete(sel); + sel = NULL; + CLOSE_ADIOS_READER(adios_handle, adios_opts.method); + return DIAG_ERR; + } + + // not sure if this assumption is correct; difficult to find in the ADIOS sources + if (adios_perform_reads(adios_handle, 1) != 0){ + p_error("rank %d: Quitting ...(%d) %s\n", rank, adios_errno, adios_errmsg()); + adios_selection_delete(sel); + sel = NULL; + CLOSE_ADIOS_READER(adios_handle, adios_opts.method); + return DIAG_ERR; + } + + if( rank == my_scalar){ + p_test_passed("%s: rank %d\n", test_result.name, rank); + test_result.result = TEST_PASSED; + } else { + p_test_failed("%s: rank %d: my_scalar=%d. (rank != my_scalar)\n", test_result.name, rank, my_scalar); + test_result.result = TEST_FAILED; + } + //} + + // clean everything + adios_selection_delete(sel); + sel = NULL; +close_adios: + CLOSE_ADIOS_READER(adios_handle, adios_opts.method); + + return diag; +} diff --git a/tests/libs/adios/tests/C/flexpath_tests/scalar/readme.txt b/tests/libs/adios/tests/C/flexpath_tests/scalar/readme.txt new file mode 100644 index 0000000000..21163f79ee --- /dev/null +++ b/tests/libs/adios/tests/C/flexpath_tests/scalar/readme.txt @@ -0,0 +1,108 @@ +# The protocol file generated by protogen.py ver. 1.0 on 2013-06-27 12:54 +# AUTHOR: Magda S aka Magic Magg magg dot gatech at gmail dot com +# DATE: 2013-06-27 + + +DESCRIPTION +=========== +This is a test case for Flexpath. The idea of the SCALAR_READ test: the writer writes a +an integer scalar that is the rank of the writer; the reader of should read +an integer number which is the rank of the writer and should be equal +to the rank of the reader. + +There might be as many writers as you wish, and there might be as many readers +as you wish (in theory). However, each rank reads its own rank. The reader knows how many +writers were there so if its rank is higher then it simply quits. +It is, however, recommended to run as many readers as writers. Otherwise +some processes are blocked. + + +The test can work in two modes (use switch '-t flx' or '-t mpi'): + +1. MPI/ADIOS_READ_METHOD_BP +2. FLEXPATH/ADIOS_READ_METHOD_FLEXPATH + + +NOTE: + +If you are switching please be sure that first you run make clean, and after +that make. The Makefile is not perfect. + +RUN +===== +The order of execution, i.e., first writer then reader, should not matter; +however, I run first writer then the reader. + +# should remove Flexpath contact text file remnants such as _read_ready.txt, +# _info_writer.txt, and test.bp +$ make -f Makefile.generic clean_test + +$ mpirun -np 2 ./writer -t flx +$ mpirun -np 2 ./reader -t flx + +See Makefile for other options or add '-h' option to the reader or writer + +CONTACT +========= +If you have questions or suggestions, please contact the author (see the +beginning of the file). And remember you are the master since you have the +sources. + + +TROUBLESHOOTING +================ + +* There might be text files left such as *reader_info.txt, *writer_info.txt; +they should be removed for the next run. In order to do this you can +use command: + +make clean_test + + +NOTES +======= + +2013-07-08 - tested on my local laptop (MPI and FLEXPATH) + + +----------------------------------------------------------------------------- +OUTDATED (2013-07-08) +------------------------------------------------------------------------------ +I will update later. + +RUNNING ON KRAKEN +================= +This runs one reader per node and one writer per node. + +aprun -n 1 -N 1 ./arrays_read & +aprun -n 1 -N 1 ./arrays_write + +You should be able to run the example with as many readers and writers as you wish. + +Example PBS script +------------------ +#!/bash/bin +#PBS -l walltime=00:05:00,size=24 +#PBS -A UT-TENN0033 + +date + +echo "nodefile=" +cat $PBS_NODEFILE +echo "=end nodefile" + +# make sure you have all modules loaded +module use ~smagg/opt/modulefiles +module load mag-mxml-2.7/kraken-gnu +module list + +cd $PBS_O_WORKDIR + +aprun -n 1 -N 1 ./arrays_read & +aprun -n 1 -N 1 ./arrays_write + +date + +# eof + +# EOF diff --git a/tests/libs/adios/tests/C/flexpath_tests/scalar/test_config_flex.xml b/tests/libs/adios/tests/C/flexpath_tests/scalar/test_config_flex.xml new file mode 100644 index 0000000000..7b66ee3f79 --- /dev/null +++ b/tests/libs/adios/tests/C/flexpath_tests/scalar/test_config_flex.xml @@ -0,0 +1,15 @@ + + + + + + + + + +QUEUE_SIZE=4; + + + + + diff --git a/tests/libs/adios/tests/C/flexpath_tests/scalar/test_config_mpi.xml b/tests/libs/adios/tests/C/flexpath_tests/scalar/test_config_mpi.xml new file mode 100644 index 0000000000..aa21734826 --- /dev/null +++ b/tests/libs/adios/tests/C/flexpath_tests/scalar/test_config_mpi.xml @@ -0,0 +1,15 @@ + + + + + + + + + +QUEUE_SIZE=4; + + + + + diff --git a/tests/libs/adios/tests/C/flexpath_tests/scalar/writer.c b/tests/libs/adios/tests/C/flexpath_tests/scalar/writer.c new file mode 100644 index 0000000000..e93b3fe4fe --- /dev/null +++ b/tests/libs/adios/tests/C/flexpath_tests/scalar/writer.c @@ -0,0 +1,73 @@ +/** + * writer.c + * + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + * + * Created on: Jul 1, 2013 + * Author: Magda Slawinska aka Magic Magg magg dot gatech at gmail.com + * + * This is an example of writing an integer scalar. Each process + * writes an integer which is its rank. + */ + +#include "mpi.h" +#include "adios.h" +#include "adios_read.h" // for adios_errno + +#include "misc.h" +#include "utils.h" +#include "cfg.h" +#include "test_common.h" + +#include +#include +#include +#include + + +int main(int argc, char ** argv){ + int rank=0, size=0; + MPI_Comm comm = MPI_COMM_WORLD; // required for ADIOS + + int64_t adios_handle; // the ADIOS file handle + int retval; + struct adios_tsprt_opts adios_opts; + int err_count = 0; + + GET_ENTRY_OPTIONS(adios_opts, "Runs writers. It is recommended to run as many writers as readers."); + + // ADIOS initialization + MPI_Init(&argc, &argv); + MPI_Comm_rank (comm, &rank); + MPI_Comm_size (comm, &size); + + SET_ERROR_IF_ZERO(adios_init(adios_opts.xml_adios_init_filename, comm), err_count); + RET_IF_ERROR(err_count, rank); + + uint64_t adios_groupsize, adios_totalsize; + + // open with the group name as specified in the xml file + adios_open( &adios_handle, "scalar", FILE_NAME, "w", comm); + adios_groupsize = 4 + 4 + 4; + retval=adios_group_size (adios_handle, adios_groupsize, &adios_totalsize); + fprintf(stderr, "Rank=%d adios_group_size(): adios_groupsize=%lld, adios_totalsize=%lld, retval=%d\n", + rank, adios_groupsize, adios_totalsize, retval); + + // write; don't check errors for simplicity reasons + adios_write(adios_handle, "size", &size); + adios_write(adios_handle, "rank", &rank); + adios_write(adios_handle, "lucky_scalar", &rank); + + fprintf(stderr, "Rank=%d committed write\n", rank); + + // close and finalize the ADIOS and friends + adios_close(adios_handle); + adios_finalize(rank); + MPI_Finalize(); + + return DIAG_OK; +} + diff --git a/tests/libs/adios/tests/C/query/CMakeLists.txt b/tests/libs/adios/tests/C/query/CMakeLists.txt new file mode 100644 index 0000000000..d3e61483f6 --- /dev/null +++ b/tests/libs/adios/tests/C/query/CMakeLists.txt @@ -0,0 +1,12 @@ +add_subdirectory(common) + +if(HAVE_ALACRITY) + add_subdirectory(alacrity) +endif() + +if(HAVE_FASTBIT) + add_subdirectory(fastbit) +endif() + +file(COPY query-xmls + DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) diff --git a/tests/libs/adios/tests/C/query/Makefile.am b/tests/libs/adios/tests/C/query/Makefile.am new file mode 100644 index 0000000000..d5c4f9ea29 --- /dev/null +++ b/tests/libs/adios/tests/C/query/Makefile.am @@ -0,0 +1,19 @@ +SUBDIRS = common + +if HAVE_ALACRITY +SUBDIRS += alacrity +endif + +if HAVE_FASTBIT +SUBDIRS += fastbit +endif + +#if HAVE_ALACRITY && HAVE_FASTBIT +#SUBDIRS=alacrity fastbit +#endif + +all-local: + test "$(srcdir)" = "$(builddir)" || cp -r $(srcdir)/query-xmls $(builddir) + +EXTRA_DIST = query-xmls + diff --git a/tests/libs/adios/tests/C/query/alacrity/CMakeLists.txt b/tests/libs/adios/tests/C/query/alacrity/CMakeLists.txt new file mode 100644 index 0000000000..b74743447d --- /dev/null +++ b/tests/libs/adios/tests/C/query/alacrity/CMakeLists.txt @@ -0,0 +1,29 @@ +include_directories(${PROJECT_SOURCE_DIR}/src/public) +include_directories(${PROJECT_SOURCE_DIR}/src) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../common) +link_directories(${PROJECT_BINARY_DIR}/src) +link_directories(${CMAKE_CURRENT_BINARY_DIR}../common) +link_directories(${MXML_INCLUDE_DIR}/../lib) + + +add_executable(adios_read_block adios_read_block.c) +target_link_libraries(adios_read_block adios ${ADIOSLIB_LDADD}) +set_target_properties(adios_read_block PROPERTIES COMPILE_FLAGS "${ALACRITY_CPPFLAGS}") + +add_executable(adios_read_ext_test adios_read_ext_test.c) +target_link_libraries(adios_read_ext_test adios ${ADIOSLIB_LDADD}) +set_target_properties(adios_read_ext_test PROPERTIES COMPILE_FLAGS "${ALACRITY_CPPFLAGS}") + +add_executable(adios_build_alac_index adios_build_alac_index.c) +target_link_libraries(adios_build_alac_index adios ${ADIOSLIB_LDADD}) +set_target_properties(adios_build_alac_index PROPERTIES COMPILE_FLAGS "${ALACRITY_CPPFLAGS}") + +add_executable(adios_alac_query adios_alac_query.c) +target_link_libraries(adios_alac_query parse_test_query_xml adios ${ADIOSLIB_LDADD}) +set_target_properties(adios_alac_query PROPERTIES COMPILE_FLAGS "${ALACRITY_CPPFLAGS}") + +add_executable(adios_show_bp_file adios_show_bp_file.c) +target_link_libraries(adios_show_bp_file adios ${ADIOSLIB_LDADD}) + +file(COPY xml + DESTINATION ${PROJECT_BINARY_DIR}/tests/C/query/alacrity) diff --git a/tests/libs/adios/tests/C/query/alacrity/Makefile.am b/tests/libs/adios/tests/C/query/alacrity/Makefile.am new file mode 100644 index 0000000000..805d677952 --- /dev/null +++ b/tests/libs/adios/tests/C/query/alacrity/Makefile.am @@ -0,0 +1,51 @@ +INCLUDES = $(all_includes) +INCLUDES += $(ADIOSLIB_CPPFLAGS) +INCLUDES += -I$(top_srcdir)/src -I$(top_srcdir)/src/public -I$(srcdir)/../common/ + +AUTOMAKE_OPTIONS = no-dependencies +if HAVE_ALACRITY + +noinst_PROGRAMS = adios_read_ext_test adios_build_alac_index adios_alac_query adios_show_bp_file adios_read_block +#alac_internal_test + +#alac_internal_test_SOURCES = test_query_alac_internal.c +#alac_internal_test_LDADD = $(top_builddir)/src/libadios.a $(ADIOSLIB_LDADD) +#alac_internal_test_LDFLAGS = $(ADIOSLIB_LDFLAGS) +#alac_internal_test_CPPFLAGS = $(ALACRITY_CPPFLAGS) -I$(top_srcdir)/src/core + + + +adios_read_block_SOURCES = adios_read_block.c +adios_read_block_LDADD = $(top_builddir)/src/libadios.a $(ADIOSLIB_LDADD) +adios_read_block_LDFLAGS = $(ADIOSLIB_LDFLAGS) +adios_read_block_CPPFLAGS = $(ALACRITY_CPPFLAGS) + + + +adios_read_ext_test_SOURCES = adios_read_ext_test.c +adios_read_ext_test_LDADD = $(top_builddir)/src/libadios.a $(ADIOSLIB_LDADD) +adios_read_ext_test_LDFLAGS = $(ADIOSLIB_LDFLAGS) +adios_read_ext_test_CPPFLAGS = $(ALACRITY_CPPFLAGS) + + +adios_build_alac_index_SOURCES = adios_build_alac_index.c +adios_build_alac_index_LDADD = $(top_builddir)/src/libadios.a $(ADIOSLIB_LDADD) +adios_build_alac_index_LDFLAGS = $(ADIOSLIB_LDFLAGS) +adios_build_alac_index_CPPFLAGS = $(ALACRITY_CPPFLAGS) + +adios_alac_query_SOURCES = adios_alac_query.c +adios_alac_query_LDADD = $(top_builddir)/tests/C/query/common/libparse_test_query_xml.a $(top_builddir)/src/libadios.a $(ADIOSLIB_LDADD) +adios_alac_query_LDFLAGS = $(ADIOSLIB_LDFLAGS) +adios_alac_query_CPPFLAGS = $(ALACRITY_CPPFLAGS) + +adios_show_bp_file_SOURCES = adios_show_bp_file.c +adios_show_bp_file_LDADD = $(top_builddir)/src/libadios.a $(ADIOSLIB_LDFLAGS) + +adios_show_bp_file_LDADD += $(ADIOSLIB_LDADD) + + +endif + +CLEANFILES = *.bp +CC=$(MPICC) +#EXTRA_DIST = test_config_flex.xml diff --git a/tests/libs/adios/tests/C/query/alacrity/adios_alac_query.c b/tests/libs/adios/tests/C/query/alacrity/adios_alac_query.c new file mode 100644 index 0000000000..527a4b7781 --- /dev/null +++ b/tests/libs/adios/tests/C/query/alacrity/adios_alac_query.c @@ -0,0 +1,167 @@ +/* + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + */ + +/* ADIOS C Example: read global arrays from a BP file + * + * + */ +#include +#include +#include +#include +#include +#include "adios_selection.h" +#include "adios_query.h" +#include +#include +#include "adios_query_xml_parse.h" + +void printRids(const ADIOS_SELECTION_POINTS_STRUCT * pts, uint64_t *deststart, uint64_t *destcount) { + uint64_t i = 0, rid=0; + if (pts->ndim == 3) { + for (i = 0; i < pts->npoints; i++) { + rid = (pts->points[i * 3 + 2] - deststart[2]) + (pts->points[i * 3 + 1] - deststart[1]) * destcount[2] + (pts->points[i * 3] - deststart[0]) * destcount[2] * destcount[1]; + fprintf(stdout,"[ %"PRIu64" ] ,", rid); + } + } + + if (pts->ndim == 2) { + for (i = 0; i < pts->npoints; i++) { + rid = (pts->points[i * 2 + 1] - deststart[1]) + (pts->points[i * 2 ] - deststart[0]) * destcount[1]; + fprintf(stdout,"[ %"PRIu64" ] ,", rid); + } + } + fprintf(stdout,"\n"); +} + +void printPoints(const ADIOS_SELECTION_POINTS_STRUCT * pts, const int timestep) { + uint64_t i = 0; + int j; + for (i = 0; i < pts->npoints; i++) { + // first print timestep + fprintf(stdout,"%d", timestep); + + for (j = 0; j < pts->ndim; j++) { + fprintf(stdout," %"PRIu64"", pts->points[i * pts->ndim + j]); + } + printf("\n"); + + } +} + +int performQuery(ADIOS_QUERY_TEST_INFO *queryInfo, ADIOS_FILE *f) +{ + int i = 0, timestep = 0 ; + ADIOS_VARINFO * tempVar = adios_inq_var(f, queryInfo->varName); + fprintf(stderr,"times steps for variable is: [%d, %d], batch size is %llu\n", queryInfo->fromStep, queryInfo->fromStep + queryInfo->numSteps, queryInfo->batchSize); + for (timestep = queryInfo->fromStep; timestep < queryInfo->fromStep + queryInfo->numSteps; timestep ++) { + fprintf(stderr,"querying on timestep %d \n", timestep ); + + ADIOS_SELECTION* currBatch = NULL; + while ( adios_query_evaluate(queryInfo->query, queryInfo->outputSelection, timestep, queryInfo->batchSize, &currBatch)) { + + assert(currBatch->type ==ADIOS_SELECTION_POINTS); + const ADIOS_SELECTION_POINTS_STRUCT * retrievedPts = &(currBatch->u.points); + fprintf(stderr,"retrieved points %" PRIu64 " \n", retrievedPts->npoints); + + printPoints(retrievedPts, timestep); + + int elmSize = adios_type_size(tempVar->type, NULL); + void *data = malloc(retrievedPts->npoints * elmSize); + + // check returned temp data + adios_schedule_read_byid(f, currBatch, tempVar->varid, timestep , 1, data); + adios_schedule_read (f, currBatch, queryInfo->varName, timestep , 1, data); + adios_perform_reads(f, 1); + + fprintf(stderr,"Total data retrieved:%"PRIu64"\n", retrievedPts->npoints); + if (tempVar->type == adios_double) { + for (i = 0; i < retrievedPts->npoints; i++) { + fprintf(stderr,"%.6f\t", ((double*)data)[i]); + } + fprintf(stderr,"\n"); + } + else if (tempVar->type == adios_real) { + for (i = 0; i < retrievedPts->npoints; i++) { + fprintf(stderr,"%.6f\t", ((float*)data)[i]); + } + fprintf(stderr,"\n"); + } + + + free(data); + adios_selection_delete(currBatch); + currBatch = NULL; + + } + + } + + adios_query_free(queryInfo->query); +} + +int main(int argc, char ** argv) { + + int i, j, datasize, if_any; + char xmlFileName[256]; + enum ADIOS_READ_METHOD method = ADIOS_READ_METHOD_BP; + + MPI_Comm comm = MPI_COMM_WORLD; + + ADIOS_QUERY_TEST_INFO *queryInfo; + ADIOS_FILE *f; + + + MPI_Init(&argc, &argv); + + if (argc != 4) { + fprintf(stderr," usage: %s {input bp file} {xml file} {query engine (ALACRITY/FASTBIT)}\n", argv[0]); + MPI_Finalize(); + exit(-1); + } + else { + strcpy(xmlFileName, argv[2]); + } + + enum ADIOS_QUERY_METHOD query_method = ADIOS_QUERY_METHOD_UNKNOWN; + if (strcmp(argv[3], "ALACRITY") == 0) { + query_method = ADIOS_QUERY_METHOD_ALACRITY; + abort(); + } + else if (strcmp(argv[3], "FASTBIT") == 0) { + query_method = ADIOS_QUERY_METHOD_FASTBIT; + } + else { + printf("Unsupported query engine, exiting...\n"); + MPI_Finalize(); + exit(-1); + } + + // ADIOS init + adios_read_init_method(method, comm, NULL); + + f = adios_read_open_file(argv[1], method, comm); + if (f == NULL) { + MPI_Finalize(); + fprintf(stderr," can not open file %s \n", argv[1]); + exit(-1); + } + + // Parse the xml file to generate query info + queryInfo = parseXml(xmlFileName, f); + + // perform query + adios_query_set_method(queryInfo->query, query_method); + performQuery(queryInfo, f); + + + adios_read_close(f); + adios_read_finalize_method(ADIOS_READ_METHOD_BP); + + MPI_Finalize(); + return 0; +} diff --git a/tests/libs/adios/tests/C/query/alacrity/adios_build_alac_index.c b/tests/libs/adios/tests/C/query/alacrity/adios_build_alac_index.c new file mode 100644 index 0000000000..4de7689e1b --- /dev/null +++ b/tests/libs/adios/tests/C/query/alacrity/adios_build_alac_index.c @@ -0,0 +1,729 @@ +/* + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + */ + +/* ADIOS C Example: write a global array from N processors with gwrite + * + * How to run: mpirun -np adios_global + * Output: adios_global.bp + * ADIOS config file: adios_global.xml + * +*/ +#include +#include +#include "mpi.h" +#include "adios.h" +#include +#include +#include +#include +#include +#include +//#include "core/adios_internals.c" + +//#define GET_ATTR(n,attr,var,en) +#define GET_ATTR2(n,attr,var,en) \ + if (!strcasecmp (n, attr->name)) { \ + if (!var) \ + { \ + var = attr->value; \ + continue; \ + } \ + else \ + { \ + printf ("xml: duplicate attribute %s on %s (ignored)",n,en); \ + continue; \ + } \ + } + + +void trim_spaces2 (char * str) +{ + char * t = str, * p = NULL; + while (*t != '\0') + { + if (*t == ' ') + { + p = t + 1; + strcpy (t, p); + } + else + t++; + } + +} + +void tokenize_dimensions2 (const char * str, char *** tokens, int * count) +{ + if (!str) + { + *tokens = 0; + *count = 0; + + return; + } + + char * save_str = strdup (str); + char * t = save_str; + int i; + + trim_spaces (save_str); + + if (strlen (save_str) > 0) + *count = 1; + else + { + *tokens = 0; + *count = 0; + free (save_str); + + return; + } + + while (*t) + { + if (*t == ',') + (*count)++; + t++; + } + + *tokens = (char **) malloc (sizeof (char **) * *count); + (*tokens) [0] = strdup (strtok (save_str, ",")); + for (i = 1; i < *count; i++) + { + (*tokens) [i] = strdup (strtok (NULL, ",")); + } + + free (save_str); +} +//end of stolen functions + +struct dimensions { + uint8_t ndims; + uint32_t * dims ; + uint8_t element_size; +}; + +typedef struct dimensions dim_t; + +void adios_pin_timestep(uint32_t ts); // Not in the standard header, but accessible + +dim_t * initDimension(uint8_t ndims, uint8_t elementSize){ + dim_t * D = (dim_t *) malloc(sizeof(dim_t)); + D->ndims = ndims; + D->element_size = elementSize; + D->dims = (uint32_t* ) malloc(sizeof(uint32_t) * ndims); + return D; +} + +void freeDimension(dim_t * D){ + free(D->dims); +} + +void printDimension(dim_t *D){ + printf("ndims[%u], element size [%u], ", D->ndims, D->element_size); + printf("dims ["); + uint8_t i = 0; + for(i = 0; i < D->ndims; i ++){ + if (i != D->ndims -1){ + printf("%"PRIu32",", D->dims[i]); + }else { + printf("%"PRIu32"]", D->dims[i]); + } + } + printf("\n"); +} +void printListVars(char **vars, int numVars){ + int i = 0; + printf("["); + for (i = 0; i < numVars; i ++){ + if ( i != numVars -1){ + printf("%s,", vars[i]); + }else { + printf("%s]", vars[i]); + } + } + printf("\n"); +} + +// Tang: add timestep and pg offset struct +struct timesteps { + uint8_t nts; + //uint32_t * tss ; +}; +typedef struct timesteps ts_t; + +ts_t* initTimestep(uint8_t nts){ + ts_t * D = (ts_t *) malloc(sizeof(ts_t)); + D->nts = nts; + //D->tss = (uint32_t* ) malloc(sizeof(uint32_t) * nts); + return D; +} + +void freeTimestep(ts_t * D){ + //free(D->tss); + free(D); +} + +struct pgoffset{ + uint8_t ndims; + uint8_t npg; + uint32_t * off; +}; +typedef struct pgoffset pgoff_t; + +pgoff_t* initPGoff(uint8_t npg, uint8_t ndims){ + pgoff_t * D = (pgoff_t *) malloc(sizeof(pgoff_t)); + D->npg = npg; + D->ndims = ndims; + D->off = (uint32_t* ) malloc(sizeof(uint32_t) * npg * ndims); + return D; +} + +void freePGoff(pgoff_t* D){ + free(D->off); +} + +// Tang ^ + + +/* + * calculate the offset of each PG(rank), highest dimension is the fastest dimension + */ +uint32_t * calPGOffsets(const int rank , const uint32_t *dataDim, const uint32_t *pgDim, uint8_t ndims){ + + uint32_t pgSize = 1, tmpSize = 1; + uint8_t i = 0, j = 0, k = 0; + for (i = 0; i < ndims; i ++) { + pgSize *= pgDim[i]; + } + uint32_t startOffset = rank * pgSize; + uint32_t remain = startOffset; + uint32_t * offsets= malloc(ndims* sizeof(uint32_t)); + while ( j < ndims){ // j is the dimension to been set + k = j + 1; + tmpSize = 1; + while ( k < ndims){ + tmpSize *= dataDim[k]; + k++; + } + offsets[j] = remain / tmpSize ; + remain = remain % tmpSize; + j ++; + } + return offsets; +} + +// Given the input file, you want to divide the data into different PG sizes, data is transformed by ALACRITY plugin +// Run this program with only ONE processor. +// this file is stolen from ../transform/adios_write_all_3D.c + +void adios_write_pg ( char input_dir [], char transform [], uint8_t nvars, char **vars, + dim_t *data_dim, dim_t *pg_dim, ts_t *data_ts, pgoff_t *pgOff) +{ + int rank, size; + int i = 0, pg = 0; // timestep + uint32_t pg_var_size = pg_dim->element_size; + uint32_t data_var_size = data_dim->element_size; + + uint32_t numPGs = 1; + char varfile [nvars][256]; + FILE *fp [nvars]; + + int adios_err; + uint64_t adios_groupsize, adios_totalsize; + int64_t adios_handle; + + char input_xml [256]; + char output_bp_file [256]; + + MPI_Comm comm = MPI_COMM_WORLD; + MPI_Comm_rank (comm, &rank); + MPI_Comm_size (comm, &size); + + // Get the var size and the pg size + for (i = 0; i < pg_dim->ndims; i ++) { + pg_var_size *= pg_dim->dims [i]; + } + + for (i = 0; i < data_dim->ndims; i ++) { + data_var_size *= data_dim->dims [i]; + } + printf ("pg_var_size = %u, data_var_size = %u\n", pg_var_size, data_var_size); + + // Read the XML file specific to this transform and PG size + sprintf (input_xml, "%s/%s.xml", input_dir, transform); + adios_init (input_xml, comm); + + // Name the output bp file based on the name of the transform + sprintf (output_bp_file, "%s/%s_%d.bp", input_dir, transform, pg_var_size); + + numPGs = data_var_size / pg_var_size; + + // Open the input raw data file for each variable + for (i = 0; i < nvars; i ++) { + sprintf (varfile [i], "%s/%s", input_dir, vars [i]); + fp [i] = fopen (varfile [i], "rb"); + printf("%s\n", varfile [i]); + if ( fp[i] == NULL){ + printf("can not open file %s\n", varfile[i]); + return ; + } +// assert (fp [i] != 0); + } + char *pg_var_data = (char *) malloc (pg_var_size); + + int timestep = 1; + + + adios_groupsize = 0; + adios_groupsize += 4 /*rank*/ + 4 /*size*/ ; + adios_groupsize += (4 * data_dim->ndims); // /* N_0 + N_{ndim -1} , entire data domain space*/ + adios_groupsize += (4 * data_dim->ndims); // /* O_0 + O_{ndim -1} , offset of write data subspace*/ + adios_groupsize += (4 * data_dim->ndims); // /* D_0 + D_{ndim -1} , pg dimension*/ + adios_groupsize += nvars * ( pg_var_size ); // total variable size + + /*quick dirty fix on the incorrect data size estimation on the very small data size from transformer */ + adios_groupsize += 10000; + + printf("adios_groupsize = %"PRIu64 "\n", adios_groupsize); + + char tmp[256]; + uint8_t k = 0; + + int tsIdx; + for (tsIdx = 0; tsIdx < data_ts->nts; tsIdx++) { + printf("Writing timestep %d\n", tsIdx); + if (tsIdx == 0) { + adios_open (&adios_handle, "S3D", output_bp_file, "w", comm); + } else { + adios_open (&adios_handle, "S3D", output_bp_file, "a", comm); + } + + adios_group_size (adios_handle, adios_groupsize, &adios_totalsize); + // adios_open (&adios_handle, "S3D", output_bp_file, "w", comm); + for (pg = 0; pg < numPGs; pg ++) { + + char prefix[256]; + strcpy(prefix, "N%d"); + for (k = 0; k < data_dim -> ndims ; k ++ ) { + sprintf(tmp, prefix, k); // N0, N1... D0, D1 ... O0, O1, ... + adios_write (adios_handle, tmp, &(data_dim->dims[k])); + } + strcpy(prefix, "D%d"); + for (k = 0; k < pg_dim -> ndims ; k ++ ) { + sprintf(tmp, prefix, k); // N0, N1... D0, D1 ... O0, O1, ... + adios_write (adios_handle, tmp, &(pg_dim->dims[k])); + } + strcpy(prefix, "O%d"); + for (k = 0; k < data_dim -> ndims ; k ++ ) { + sprintf(tmp, prefix, k); // N0, N1... D0, D1 ... O0, O1, ... + adios_write (adios_handle, tmp, &(pgOff->off[pg*(pg_dim->ndims)+k])); + //adios_write (adios_handle, tmp, &(offsets[k])); + } + + adios_write (adios_handle, "size", &size); + adios_write (adios_handle, "rank", &pg); + + // fread and adios_write for each variable + int readBytes; + for (i = 0; i < nvars; i ++) { + readBytes = fread (pg_var_data, sizeof (char), pg_var_size, fp [i]); + //printf("%d %x %d\n", pg_var_size, *fp [i], readBytes); + adios_write (adios_handle, vars [i], pg_var_data); + } + + } + adios_close (adios_handle); + } + + free (pg_var_data); + for (i = 0; i < nvars; i ++) { + fclose (fp [i]); + } + + adios_finalize (rank); + + return ; +} + +void testCalculation(dim_t *data_dim, dim_t *pg_dim){ + uint32_t pg_var_size = pg_dim->element_size; + uint32_t data_var_size = data_dim->element_size; + int i = 0, k; + for(i = 0;i < pg_dim->ndims;i++){ + pg_var_size *= pg_dim->dims[i]; + } + for(i = 0;i < data_dim->ndims;i++){ + data_var_size *= data_dim->dims[i]; + } + uint32_t numPGs = data_var_size / pg_var_size; + uint32_t j = 0; + uint32_t *offset; + for(j = 0;j < numPGs;j++){ + offset = calPGOffsets(j, data_dim->dims, pg_dim->dims, data_dim->ndims); + printf("rank [%d] {", j); + for(k = 0;k < data_dim->ndims;k++){ + if(k != data_dim->ndims - 1){ + printf("%d,", offset[k]); + }else{ + printf("%d}", offset[k]); + } + } + printf("\n"); + free(offset); + + } + +} + +/* + * a bunch of fixed test cases + */ +void testCalPGOffset(){ + dim_t d1 ; + dim_t p1 ; + d1.ndims = 1; + d1.element_size = 8; + d1.dims [ 0] = 128; + p1.ndims = 1 ; + p1.dims[ 0] = 32; + p1.element_size = 8; + printf("testing 1 dimension \n"); + testCalculation(&d1, &p1); + + dim_t d2 ; + dim_t p2 ; + d2.ndims = 2; + d2.element_size = 8; + d2.dims [ 0] = 32; + d2.dims [ 1] = 32; + p2.ndims = 2 ; + p2.dims[ 0] = 16; + p2.dims[ 1] = 8; + p2.element_size = 8; + printf("testing 2 dimension \n"); + testCalculation(&d2, &p2); + + dim_t data_dim; + dim_t pg_dim; + + data_dim.ndims = 3; // data variable dimension size + data_dim.dims [0] = 32; //256; + data_dim.dims [1] = 32 ; //128; + data_dim.dims [2] = 32; //128; + data_dim.element_size = 8; + + pg_dim.ndims = 3; // each block dimension size + pg_dim.dims [0] = 16; //64 + pg_dim.dims [1] = 16; //32 + pg_dim.dims [2] = 16; //32 + pg_dim.element_size = 8; + printf("testing 3 dimension \n"); + testCalculation(&data_dim, &pg_dim); +} + + +int parseInputs(char * inputxml, dim_t **dataDim, dim_t **pgDim, char*** varList, int *numVarsOut, ts_t **dataTs, pgoff_t **pgOff){ + + FILE * fp = fopen (inputxml,"r"); + if (!fp){ + printf("missing xml input file %s \n", inputxml); + return 1; + } + struct stat s; + char * buffer = NULL; + if (stat (inputxml, &s) == 0) { + buffer = malloc (s.st_size + 1); + buffer [s.st_size] = 0; + } + + if (buffer) { + size_t bytes_read = fread (buffer, 1, s.st_size, fp); + + if (bytes_read != s.st_size) { + printf("error reading input xml file: %s. Expected %ld Got %ld\n" + ,inputxml, s.st_size, bytes_read ); + fclose(fp); + return 1; + } + } + fclose (fp); + mxml_node_t * doc = NULL; + mxml_node_t * root = NULL; + mxml_node_t * varsNode = NULL; + doc = mxmlLoadString (NULL, buffer, MXML_TEXT_CALLBACK); + free (buffer); + buffer = NULL; + root = doc; + + if (!doc) { + printf( "unknown error parsing XML (probably structural)\n" + "Did you remember to start the file with\n" + "\n"); + + return 0; + } + if (strcasecmp (doc->value.element.name, "adios-alac-test-inputs")) { + root = mxmlFindElement (doc, doc, "adios-alac-test-inputs", NULL, NULL, MXML_DESCEND_FIRST); + } + + varsNode = mxmlFindElement(root, root, "vars", NULL, NULL, MXML_DESCEND_FIRST); + mxml_node_t * varnode = NULL, *dimnode = NULL; + const char * varname = 0, *dimS = 0, *dataDimS = 0, *pgDimS = 0, *numVarS=0, *elmSizeS=0; + + int numVars = 0, i, j, numDim=0, countVar= 0, elmSize = 0; + for (i = 0; i < varsNode->value.element.num_attrs; i++) { + mxml_attr_t * attr = &varsNode->value.element.attrs [i]; + GET_ATTR2("num",attr,numVarS,"vars"); + } + if ( !numVarS || !strcmp ( numVarS, "")) { + printf("missing values for num attribute \n"); + mxmlRelease(doc); + return 0; + }else { + numVars = atoi(numVarS); + } + + // Tang: parsing timestep info + mxml_node_t * tsnode = NULL; + const char * tsNumS = NULL, *tsS = NULL; + int tsNum = 0; + tsnode = mxmlFindElement(varsNode, varsNode, "timestep", NULL, NULL, MXML_DESCEND_FIRST); + if ( !tsnode) { + printf("missing timestep element under vars \n"); + mxmlRelease(doc); + return 0; + } + for (i = 0; i < tsnode->value.element.num_attrs; i++) { + mxml_attr_t * attr = &tsnode->value.element.attrs [i]; + GET_ATTR2("tsnum",attr,tsNumS,"timestep"); + } + if ( !tsNumS || !strcmp ( tsNumS, "")) { + printf("missing values for tsNum attribute on timestep element\n"); + mxmlRelease(doc); + return 0; + } + else { + tsNum = atoi(tsNumS); + } + + (*dataTs) = initTimestep(tsNum); + + // Tang: ^ + + dimnode = mxmlFindElement(varsNode, varsNode, "dimension", NULL, NULL, MXML_DESCEND_FIRST); + if ( !dimnode) { + printf("missing dimension element under vars \n"); + mxmlRelease(doc); + return 0; + } + + uint32_t * inputDataDim, * inputPGDim ; + for (i = 0; i < dimnode->value.element.num_attrs; i++) { + mxml_attr_t * attr = &dimnode->value.element.attrs [i]; + GET_ATTR2("dim",attr,dimS,"dimension"); + GET_ATTR2("elementSize",attr,elmSizeS,"dimension"); + GET_ATTR2("dataDim",attr,dataDimS,"dimension"); + GET_ATTR2("pgDim",attr,pgDimS,"dimension"); + + } + if ( !dimS || !strcmp ( dimS, "")) { + printf("missing values for dim attribute on dimension element\n"); + mxmlRelease(doc); + return 0; + }else{ + numDim = atoi(dimS); + } + if ( !elmSizeS || !strcmp ( elmSizeS, "")) { + printf("missing values for elementSize attribute on dimension element \n"); + mxmlRelease(doc); + return 0; + }else{ + elmSize = atoi(elmSizeS); + } + + + int dim_count, pgCount; + char ** dim_tokens = 0, **pgDimTokens = 0; + if ( !dataDimS || !strcmp ( dataDimS, "")) { + printf("missing values for dataDim attribute on dimension element \n"); + mxmlRelease(doc); + return 0; + } + + if ( !pgDimS || !strcmp ( pgDimS, "")) { + printf("missing values for pgDim attribute \n"); + mxmlRelease(doc); + return 0; + } + tokenize_dimensions2 (dataDimS, &dim_tokens, &dim_count); + tokenize_dimensions2 (pgDimS, &pgDimTokens, &pgCount); + if (dim_count != numDim || pgCount != numDim){ + printf("input dimension does not match expected number dimension \n"); + mxmlRelease(doc); + return 0; + } + inputDataDim = (uint32_t *) malloc(sizeof(uint32_t)*numDim); + inputPGDim = (uint32_t *) malloc(sizeof(uint32_t)*numDim); + + for (j = 0; j < numDim ; j ++){ + inputDataDim[j] = atoi(dim_tokens[j]); + inputPGDim[j] = atoi(pgDimTokens[j]); + } + + (*dataDim) = initDimension(numDim, elmSize); + memcpy((*dataDim)->dims, inputDataDim, sizeof(uint32_t)* (*dataDim)->ndims); + (*pgDim )= initDimension(numDim, elmSize); + memcpy((*pgDim)->dims, inputPGDim, sizeof(uint32_t)* (*pgDim)->ndims); + + (*varList) = (char **) malloc(sizeof(char*) * numVars); + for(i= 0; i < numVars; i ++){ + (*varList)[i] = (char*) malloc(256); + } + for (varnode = mxmlWalkNext (varsNode, doc, MXML_DESCEND_FIRST) + ;varnode + ;varnode = mxmlWalkNext (varnode, varsNode, MXML_NO_DESCEND) ){ + if (varnode->type != MXML_ELEMENT) { + continue; + } + if (!strcasecmp (varnode->value.element.name, "var")) { + for (i = 0; i < varnode->value.element.num_attrs; i++) { + mxml_attr_t * attr = &varnode->value.element.attrs [i]; + if (!strcmp(attr->name, "name")){ + strcpy((*varList)[countVar], attr->value); + countVar ++; + } + } + + } + } + + *numVarsOut = numVars; + + + // Tang: Parsing pg offset info, assuming we have already know dim dataDim and pgDim + // from parsed result of + int nPG = 1; + for (i = 0; i < numDim; i++) { + nPG *= ((*dataDim)->dims[i] / (*pgDim)->dims[i]); + } + + + mxml_node_t * pgoffnode = NULL; + const char * pgoffNumS = NULL, *pgoffS = NULL; + int pgoffNum= 0; + pgoffnode = mxmlFindElement(varsNode, varsNode, "pgoffset", NULL, NULL, MXML_DESCEND_FIRST); + + if ( !pgoffnode) { + printf("missing pgoffset element under vars \n"); + mxmlRelease(doc); + return 0; + } + + for (i = 0; i < pgoffnode->value.element.num_attrs; i++) { + mxml_attr_t * attr = &pgoffnode->value.element.attrs [i]; + GET_ATTR2("pgNum",attr,pgoffNumS,"pgoffset"); + } + + if ( !pgoffNumS || !strcmp ( pgoffNumS, "")) { + printf("missing values for tsNum attribute on timestep element\n"); + mxmlRelease(doc); + return 0; + } + else { + pgoffNum = atoi(pgoffNumS); + } + + if (pgoffNum != nPG) { + printf("pgNum from pgoffset doesn't match the number of pgs calculated from dataDim/pgDim \n"); + mxmlRelease(doc); + return 0; + } + + (*pgOff) = initPGoff(nPG, numDim); + + char pgoffName[16]; + char** pgoffValueS; + char** pgoffValue_tokens=NULL; + pgoffValueS = (char**)malloc(sizeof(char*) * nPG); + for (i = 0; i < nPG; i++) { + pgoffValueS[i] = NULL; + } + pgoffnode = mxmlFindElement(varsNode, varsNode, "pgoffset", NULL, NULL, MXML_DESCEND_FIRST); + for (i = 0; i < pgoffnode->value.element.num_attrs; i++) { + mxml_attr_t * attr = &pgoffnode->value.element.attrs [i]; + for (j = 0; j < nPG; j++) { + sprintf(pgoffName,"pg_%d", j); + if (pgoffValueS[j] != NULL) { + continue; + } + GET_ATTR2(pgoffName,attr,pgoffValueS[j],"pgoffset"); + } + } + + for (i = 0; i < nPG; i++) { + tokenize_dimensions2 (pgoffValueS[i], &pgoffValue_tokens, &numDim); + for (j = 0; j < numDim; j++) { + (*pgOff)->off[i*numDim+j] = atoi(pgoffValue_tokens[j]); + } + } + + for (i = 0; i < nPG; i++) { + printf("PG offset_%d: ",i); + for (j = 0; j < numDim; j++) { + printf("%d ",(*pgOff)->off[i*numDim+j]); + } + printf("\n"); + } + + free(pgoffValueS); + free(inputDataDim); + free(inputPGDim); + return 0; +} +/* + * ./adios_build_alac_index ./xml alacrity-1var ./xml/build-alac-index-input.xml + */ +int main (int argc, char ** argv) +{ + MPI_Init (&argc, &argv); + + if (argc >= 4) { + dim_t *dataDim , *pgDim ; + ts_t *dataTs; // Tang: add for timestep + pgoff_t *pgOff; // Tang: add for pg offsets + char **vars ; + int numVar; + //if ( parseInputs(argv[3],&dataDim,&pgDim, &vars , &numVar) ){ + if ( parseInputs(argv[3],&dataDim,&pgDim, &vars , &numVar, &dataTs, &pgOff) ){ + printf("errors in the input xml file parse \n"); + return 0; + }else { + printf("XML Inputs info \n"); + printf("data space: "); + printDimension(dataDim); + printf("PG space: "); + printDimension(pgDim); + printListVars(vars, numVar); + } + printf("Write BP file \n"); + //adios_write_pg (argv [1], argv [2], numVar, vars, dataDim, pgDim); + adios_write_pg (argv [1], argv [2], numVar, vars, dataDim, pgDim, dataTs, pgOff); + freeDimension(dataDim); + freeDimension(pgDim); + freeTimestep(dataTs); // Tang: free dataTs + freePGoff(pgOff); + + } else { + printf ("Usage: %s \n Example: ./adios_build_alac_index ./xml alacrity-1var ./xml/build-alac-index-input.xml \n", argv [0]); + } + + + MPI_Finalize (); + return 0; +} + diff --git a/tests/libs/adios/tests/C/query/alacrity/adios_read_block.c b/tests/libs/adios/tests/C/query/alacrity/adios_read_block.c new file mode 100644 index 0000000000..dcfe5e782c --- /dev/null +++ b/tests/libs/adios/tests/C/query/alacrity/adios_read_block.c @@ -0,0 +1,64 @@ +/* + * read_block.c + * + * Created on: Dec 5, 2014 + * Author: xczou + */ + + +#include +#include +#include +#include +#include +#include "adios_selection.h" +#include "adios_query.h" +#include "adios_error.h" +#include +#include +#include "adios_query_xml_parse.h" + +int main(int argc, char ** argv) { + + enum ADIOS_READ_METHOD method = ADIOS_READ_METHOD_BP; + + MPI_Comm comm = MPI_COMM_WORLD; + + ADIOS_QUERY_TEST_INFO *queryInfo; + ADIOS_FILE *f; + + + MPI_Init(&argc, &argv); + + + f = adios_read_open_file(argv[1], method, comm); + if (f == NULL) { + fprintf(stderr," can not open file %s \n", argv[1]); + MPI_Abort(comm, 1); + } + + int block = 111; + + if (argc >=3) { + block = atoi(argv[2]); + } + void *data = malloc(sizeof(double) * 44*36*22); + + ADIOS_SELECTION* currBatch = adios_selection_writeblock(block); + + adios_schedule_read (f, currBatch , "/temp", 0, 1, data); + adios_perform_reads(f, 1); + + int i = 0; + for (i = 0; i <44 * 36 *22; i++) { + fprintf(stdout,"%.6f\n", ((double*)data)[i]); + } + + adios_selection_delete(currBatch); + free(data); + adios_read_close(f); + adios_read_finalize_method(ADIOS_READ_METHOD_BP); + + MPI_Finalize(); + +} diff --git a/tests/libs/adios/tests/C/query/alacrity/adios_read_ext_test.c b/tests/libs/adios/tests/C/query/alacrity/adios_read_ext_test.c new file mode 100644 index 0000000000..880a59abc0 --- /dev/null +++ b/tests/libs/adios/tests/C/query/alacrity/adios_read_ext_test.c @@ -0,0 +1,165 @@ +/* + * adios_read_ext_test.c + * + * Created on: Jun 15, 2014 + * Author: xczou + */ + +#include +#include +#include +#include +#include +#include "mpi.h" +#include "adios_read.h" +#include "adios_read_ext.h" + +void test_adios_inq_var_transform(ADIOS_FILE *fp, ADIOS_VARINFO *v) +{ + int blockId = 0; + //======For this example, it only has one block =========/ + ADIOS_VARTRANSFORM *tfv = adios_inq_var_transform(fp, v); + ADIOS_TRANSFORM_METADATA *tmetas = tfv->transform_metadatas; + ADIOS_TRANSFORM_METADATA tmeta = tmetas[blockId]; + assert(tmeta.length == 24); + uint64_t *threeData = (uint64_t*)tmeta.content; + printf("meta size: %" PRIu64 ", index size: %" PRIu64 + ", data size: %" PRIu64 "\n" + , threeData[0], threeData[1], threeData[2]); + + adios_free_var_transform(tfv); +} + + +/* + * ADIOS_PG_INTERSECTIONS * adios_find_intersecting_pgs( + const ADIOS_FILE *fp, int varid, const ADIOS_SELECTION *sel + , const int from_step, const int nsteps); + */ + +void test_adios_find_intersecting_pgs(ADIOS_FILE *fp, ADIOS_VARINFO *v ){ + + int from_step =0; + int nsteps =1, i = 0,j =0; + + uint64_t start[3] = {128,64,64}; + uint64_t count[3] = {1,1,1}; + ADIOS_SELECTION *emtpySel = adios_selection_boundingbox(3, start, count); + ADIOS_PG_INTERSECTIONS* intersectedPGs = adios_find_intersecting_pgs( + fp, v->varid, emtpySel, from_step, nsteps); + + assert(intersectedPGs->npg == 0); +// if there is no bounding box, intersections is still non-NULL +// assert(intersectedPGs->intersections == NULL); + adios_selection_delete(emtpySel); + printf("passed emtpy selelction \n"); + adios_free_pg_intersections(&intersectedPGs); + + //TODO: free ADIOS_PG_INTERSECTIONS + + + start[0]= 12; start[1] = 10; start[2] =46; + count[0]= 188; count[1]=20; count[2]=3; + ADIOS_SELECTION *overlapSel = adios_selection_boundingbox(3, start, count); + ADIOS_PG_INTERSECTIONS* intersectedPGs2 = adios_find_intersecting_pgs( + fp, v->varid, overlapSel, from_step, nsteps); + int totalnpg = intersectedPGs2->npg; + ADIOS_PG_INTERSECTION * PGs = intersectedPGs2->intersections; + + + printf("user's input selection box: "); + if (overlapSel->type == ADIOS_SELECTION_BOUNDINGBOX ){ + const ADIOS_SELECTION_BOUNDINGBOX_STRUCT *olBB = &(overlapSel->u.bb); + for(i=0; i < olBB->ndim; i++){ + printf("(%" PRIu64 ": %"PRIu64"), " , olBB->start[i], olBB->count[i] ); + } + printf("\n"); + } + + printf("intersected # of PGs: %d \n", totalnpg); + ADIOS_PG_INTERSECTION pg; + for(j= 0; j < totalnpg; j ++){ + pg = PGs[j]; + printf("intersected PG[%d], timestep[%d], PG id in TS[%d]\n", pg.blockidx, pg.timestep, pg.blockidx_in_timestep); + ADIOS_SELECTION * pgSelBox = pg.pg_bounds_sel; + + printf("overlapped PG bounding box: "); + if (pgSelBox->type == ADIOS_SELECTION_BOUNDINGBOX ){ + const ADIOS_SELECTION_BOUNDINGBOX_STRUCT *pgBB = &(pgSelBox->u.bb); + for(i=0; i < pgBB->ndim; i++){ + printf("(%" PRIu64 ": %"PRIu64"), " , pgBB->start[i], pgBB->count[i] ); + } + printf("\n"); + } + ADIOS_SELECTION * intersectedBox = pg.intersection_sel; + printf("intersected bounding box: "); + if (intersectedBox->type == ADIOS_SELECTION_BOUNDINGBOX ){ + const ADIOS_SELECTION_BOUNDINGBOX_STRUCT *interBB = &(intersectedBox->u.bb); + for(i=0; i < interBB->ndim; i++){ + printf("(%" PRIu64 ": %"PRIu64"), " , interBB->start[i], interBB->count[i] ); + } + printf("\n"); + } + } + + adios_selection_delete(overlapSel); + adios_free_pg_intersections(&intersectedPGs2); + +} + + +/* + * RUN with one processor is enough + */ +int main (int argc, char ** argv) +{ + + char filename [256]; + int i, j, datasize, if_any; + MPI_Comm comm = MPI_COMM_WORLD; + enum ADIOS_READ_METHOD method = ADIOS_READ_METHOD_BP; + ADIOS_SELECTION * sel1, * sel2; + ADIOS_VARCHUNK * chunk = 0; + double * data = NULL; + uint64_t start[2], count[2], npoints, * points; + + MPI_Init (&argc, &argv); + + if (argc < 2 ){ + printf(" usage: %s {input bp file} \n", argv[0]); + return 1; + } + adios_read_init_method (method, comm, NULL); + + ADIOS_FILE * fp = adios_read_open_file (argv[1], method, comm); + + if ( fp == NULL){ + printf(" can not open file %s \n", argv[1]); + return 1; + } + + char varName[256] = "rdm"; + + ADIOS_VARINFO* v = adios_inq_var(fp, varName); + //====================start to test ==================// + + data_view_t dv = PHYSICAL_DATA_VIEW; + adios_read_set_data_view(fp, dv); + test_adios_inq_var_transform(fp, v); + + + + dv = LOGICAL_DATA_VIEW; + adios_read_set_data_view(fp, dv); + test_adios_find_intersecting_pgs(fp,v); + + + adios_read_close (fp); + + adios_read_finalize_method (ADIOS_READ_METHOD_BP); + + + MPI_Finalize (); + return 0; +} + diff --git a/tests/libs/adios/tests/C/query/alacrity/adios_show_bp_file.c b/tests/libs/adios/tests/C/query/alacrity/adios_show_bp_file.c new file mode 100644 index 0000000000..19cc061658 --- /dev/null +++ b/tests/libs/adios/tests/C/query/alacrity/adios_show_bp_file.c @@ -0,0 +1,117 @@ +/* + * adios_show_bp_file.c + * + * Created on: Jun 21, 2014 + * Author: xczou + */ + +#include +#include +#include +#include +#include +#include "mpi.h" +#include "adios_read.h" +#include "adios_read_ext.h" + +void showBPFile(ADIOS_FILE * fp, char *varName ); + +void showBPFile(ADIOS_FILE * fp, char *varName ){ + int i = 0, j = 0; + printf("adios file : "); + printf("nvar %d", fp->nvars); + for(i=0; i < fp->nvars; i++) { + printf(" { %s }", fp->var_namelist[i]); + } + printf(" || nattrs %d", fp->nattrs); + for(i=0; i < fp->nattrs; i++) { + printf(" { %s }", fp->attr_namelist[i]); + } + printf("\n"); + + + ADIOS_VARINFO* v = adios_inq_var(fp, varName); + if (v == NULL) { + printf(" Error! no such var:%s \n", varName); + return ; + } + + printf("var info: "); + printf("varId: %d, type: %d, ndim: %d, nsteps: %d, total nblocks: %d, ", + v->varid, v->type, v->ndim, v->nsteps, v->sum_nblocks); + + printf("dims: {"); + for(i = 0; i < v->ndim; i++){ + printf("%" PRIu64 ",", v->dims[i]); + } + printf("}\n"); + + i = adios_inq_var_blockinfo(fp, v); + if (i != 0){ + printf("error from adios_inq_var_blockinfo \n"); + return ; + } + + printf("number of blocks in each timestep: {"); + for(i = 0 ; i < v->nsteps; i++){ + printf ("%d,", v->nblocks[i]); // it is an array of length n->nsteps; + } + printf("}\n"); + + ADIOS_VARBLOCK * bi = v->blockinfo; + printf("block info: "); + for(i=0; i< v->sum_nblocks; i++){ + printf("{ "); + for(j = 0; j < v->ndim; j ++){ + printf("%" PRIu64 ": %"PRIu64 " , ", bi[i].start[j], bi[i].count[j]); + } + printf(" }"); + } + printf("\n"); +} + + +/* + * RUN with one processor is enough + */ +int main (int argc, char ** argv) +{ + + char filename [256]; + int i, j, datasize, if_any; + MPI_Comm comm = MPI_COMM_WORLD; + enum ADIOS_READ_METHOD method = ADIOS_READ_METHOD_BP; + ADIOS_SELECTION * sel1, * sel2; + ADIOS_VARCHUNK * chunk = 0; + double * data = NULL; + uint64_t start[2], count[2], npoints, * points; + + MPI_Init (&argc, &argv); + + if (argc < 3 ){ + printf(" usage: %s {input bp file} {variable name} \n", argv[0]); + return 1; + } + adios_read_init_method (method, comm, NULL); + + ADIOS_FILE * fp = adios_read_open_file (argv[1], method, comm); + + if ( fp == NULL){ + printf(" can not open file %s \n", argv[1]); + return 1; + } + + char varName[256]; + strcpy(varName, argv[2]); + ADIOS_VARINFO* v = adios_inq_var(fp, varName); + showBPFile(fp, varName); + + adios_read_close (fp); + + adios_read_finalize_method (ADIOS_READ_METHOD_BP); + + + MPI_Finalize (); + return 0; +} + diff --git a/tests/libs/adios/tests/C/query/common/CMakeLists.txt b/tests/libs/adios/tests/C/query/common/CMakeLists.txt new file mode 100644 index 0000000000..f8f7fa15f8 --- /dev/null +++ b/tests/libs/adios/tests/C/query/common/CMakeLists.txt @@ -0,0 +1,15 @@ +include_directories(${PROJECT_SOURCE_DIR}/src/public) +include_directories(${PROJECT_SOURCE_DIR}/src) +link_directories(${PROJECT_BINARY_DIR}/src) +link_directories(${MXML_INCLUDE_DIR}/../lib) +include_directories(${MXML_INCLUDE_DIR}) + +add_library(parse_test_query_xml adios_query_xml_parse.c adios_query_xml_parse.h) +target_link_libraries(parse_test_query_xml adios) + +add_executable(compute_expected_query_results compute_expected_query_results.c) +target_link_libraries(compute_expected_query_results parse_test_query_xml adios ${ADIOSLIB_LDADD}) + +add_executable(adios_query_test adios_query_test.c) +target_link_libraries(adios_query_test parse_test_query_xml adios ${ADIOSLIB_LDADD}) +set_target_properties(adios_query_test PROPERTIES COMPILE_FLAGS "${ALACRITY_CPPFLAGS}") diff --git a/tests/libs/adios/tests/C/query/common/Makefile.am b/tests/libs/adios/tests/C/query/common/Makefile.am new file mode 100644 index 0000000000..a657f25021 --- /dev/null +++ b/tests/libs/adios/tests/C/query/common/Makefile.am @@ -0,0 +1,25 @@ +INCLUDES = $(all_includes) +INCLUDES += $(ADIOSLIB_CPPFLAGS) +INCLUDES += -I$(top_srcdir)/src -I$(top_srcdir)/src/public + +AUTOMAKE_OPTIONS = no-dependencies + +noinst_PROGRAMS = compute_expected_query_results adios_query_test +noinst_LIBRARIES = libparse_test_query_xml.a + +libparse_test_query_xml_a_SOURCES = adios_query_xml_parse.c adios_query_xml_parse.h +libparse_test_query_xml_a_LIBADD = $(top_builddir)/src/libadios.a + +compute_expected_query_results_SOURCES = compute_expected_query_results.c +compute_expected_query_results_LDADD = $(builddir)/libparse_test_query_xml.a $(top_builddir)/src/libadios.a $(ADIOSLIB_LDADD) +compute_expected_query_results_LDFLAGS = $(ADIOSLIB_LDFLAGS) + +adios_query_test_SOURCES = adios_query_test.c +adios_query_test_LDADD = libparse_test_query_xml.a $(top_builddir)/src/libadios.a $(ADIOSLIB_LDADD) +adios_query_test_LDFLAGS = $(ADIOSLIB_LDFLAGS) +adios_query_test_CPPFLAGS = $(ALACRITY_CPPFLAGS) + + +CLEANFILES = *.bp +CC=$(MPICC) +#EXTRA_DIST = test_config_flex.xml diff --git a/tests/libs/adios/tests/C/query/common/adios_query_test.c b/tests/libs/adios/tests/C/query/common/adios_query_test.c new file mode 100644 index 0000000000..39c373f090 --- /dev/null +++ b/tests/libs/adios/tests/C/query/common/adios_query_test.c @@ -0,0 +1,193 @@ +/* + * adios_query_test.c + * + * Created on: Oct 2, 2014 + * Author: Houjun Tang + */ + +#include +#include +#include +#include +#include +#include "adios_selection.h" +#include "adios_query.h" +#include "adios_error.h" +#include +#include +#include "adios_query_xml_parse.h" + +void printRids(const ADIOS_SELECTION_POINTS_STRUCT * pts, uint64_t *deststart, uint64_t *destcount) { + uint64_t i = 0, rid=0; + if (pts->ndim == 3) { + for (i = 0; i < pts->npoints; i++) { + rid = (pts->points[i * 3 + 2] - deststart[2]) + (pts->points[i * 3 + 1] - deststart[1]) * destcount[2] + (pts->points[i * 3] - deststart[0]) * destcount[2] * destcount[1]; + fprintf(stdout,"[ %"PRIu64" ] ,", rid); + } + } + + if (pts->ndim == 2) { + for (i = 0; i < pts->npoints; i++) { + rid = (pts->points[i * 2 + 1] - deststart[1]) + (pts->points[i * 2 ] - deststart[0]) * destcount[1]; + fprintf(stdout,"[ %"PRIu64" ] ,", rid); + } + } + fprintf(stdout,"\n"); +} + +void printPoints(const ADIOS_SELECTION_POINTS_STRUCT * pts, const int timestep) { + uint64_t i = 0; + int j; + for (i = 0; i < pts->npoints; i++) { + // first print timestep + fprintf(stdout,"%d", timestep); + + for (j = 0; j < pts->ndim; j++) { + fprintf(stdout," %"PRIu64"", pts->points[i * pts->ndim + j]); + } + printf("\n"); + + } +} + +int performQuery(ADIOS_QUERY_TEST_INFO *queryInfo, ADIOS_FILE *f, int use_streaming, int print_points, int read_results) +{ + int i = 0, timestep = 0 ; + ADIOS_VARINFO * tempVar = adios_inq_var(f, queryInfo->varName); + + if (use_streaming) + for (timestep = 0; timestep < queryInfo->fromStep; ++timestep) + assert(adios_advance_step(f, 0, 0) == 0); + + fprintf(stderr,"times steps for variable is: [%d, %d], batch size is %llu\n", queryInfo->fromStep, queryInfo->fromStep + queryInfo->numSteps, queryInfo->batchSize); + for (timestep = queryInfo->fromStep; timestep < queryInfo->fromStep + queryInfo->numSteps; timestep ++) { + fprintf(stderr, "querying on timestep %d \n", timestep); + + ADIOS_SELECTION* currBatch = NULL; + + while (adios_query_evaluate(queryInfo->query, queryInfo->outputSelection, use_streaming ? 0 : timestep, queryInfo->batchSize, &currBatch) >= 0) { + if (currBatch == NULL) { + break; + } + assert(currBatch->type ==ADIOS_SELECTION_POINTS); + const ADIOS_SELECTION_POINTS_STRUCT * retrievedPts = &(currBatch->u.points); + /* fprintf(stderr,"retrieved points %" PRIu64 " \n", retrievedPts->npoints); */ + + if (print_points) { + printPoints(retrievedPts, timestep); + } + + if (read_results) { + int elmSize = adios_type_size(tempVar->type, NULL); + void *data = malloc(retrievedPts->npoints * elmSize); + + // read returned temp data + adios_schedule_read (f, currBatch, queryInfo->varName, use_streaming ? 0 : timestep, 1, data); + adios_perform_reads(f, 1); + + free(data); + } + + fprintf(stderr,"Total data retrieved:%"PRIu64"\n", retrievedPts->npoints); + /* if (tempVar->type == adios_double) { */ + /* for (i = 0; i < retrievedPts->npoints; i++) { */ + /* fprintf(stderr,"%.6f\t", ((double*)data)[i]); */ + /* } */ + /* fprintf(stderr,"\n"); */ + /* } */ + /* else if (tempVar->type == adios_real) { */ + /* for (i = 0; i < retrievedPts->npoints; i++) { */ + /* fprintf(stderr,"%.6f\t", ((float*)data)[i]); */ + /* } */ + /* fprintf(stderr,"\n"); */ + /* } */ + + adios_selection_delete(currBatch); + currBatch = NULL; + } + + if (use_streaming) { + const int err = adios_advance_step(f, 0, 0); + if (timestep < queryInfo->fromStep + queryInfo->numSteps - 1) { + assert(err == 0); + } else { + assert(err == err_end_of_stream || err == err_step_notready); + } + } + } + + adios_query_free(queryInfo->query); +} + +int main(int argc, char ** argv) { + + int i, j, datasize, if_any; + char xmlFileName[256]; + enum ADIOS_READ_METHOD method = ADIOS_READ_METHOD_BP; + + MPI_Comm comm = MPI_COMM_WORLD; + + ADIOS_QUERY_TEST_INFO *queryInfo; + ADIOS_FILE *f; + + + MPI_Init(&argc, &argv); + + if (argc < 4 || argc > 7) { + fprintf(stderr," usage: %s {input bp file} {xml file} {query engine (ALACRITY/FASTBIT)} [mode (FILE/stream)] [print points? (TRUE/false)] [read results? (true/FALSE)]\n", argv[0]); + MPI_Abort(comm, 1); + } + else { + strcpy(xmlFileName, argv[2]); + } + + enum ADIOS_QUERY_METHOD query_method = ADIOS_QUERY_METHOD_UNKNOWN; + if (strcasecmp(argv[3], "ALACRITY") == 0) { + // init with ALACRITY + //adios_query_init(ADIOS_QUERY_TOOL_ALACRITY); + query_method = ADIOS_QUERY_METHOD_ALACRITY; + } + else if (strcasecmp(argv[3], "FASTBIT") == 0) { + // init with FastBit + query_method = ADIOS_QUERY_METHOD_FASTBIT; + //fprintf(stderr,"FastBit not supported in this test yet, exiting...\n"); + //MPI_Abort(comm, 1); + } + else { + fprintf(stderr,"Unsupported query engine %s, exiting...\n", argv[3]); + MPI_Abort(comm, 1); + } + + const int use_streaming = (argc >= 5) && (strcasecmp(argv[4], "stream") == 0); + const int read_results = (argc >= 6) && (strcasecmp(argv[5], "true") == 0); + const int print_points = !(argc >= 7) || (strcasecmp(argv[6], "true") == 0); + + fprintf(stderr, "NOTE: Running the query in %s mode\n", use_streaming ? "STREAM" : "FILE"); + fprintf(stderr, "NOTE: %s print query result points\n", print_points ? "WILL" : "WILL NOT"); + fprintf(stderr, "NOTE: %s read data using query result point selection\n", read_results ? "WILL" : "WILL NOT"); + + // ADIOS init + adios_read_init_method(method, comm, NULL); + + f = use_streaming ? + adios_read_open(argv[1], method, comm, ADIOS_LOCKMODE_ALL, -1) : + adios_read_open_file(argv[1], method, comm); + if (f == NULL) { + fprintf(stderr," can not open file %s \n", argv[1]); + MPI_Abort(comm, 1); + } + + // Parse the xml file to generate query info + queryInfo = parseXml(xmlFileName, f); + + // perform query + adios_query_set_method(queryInfo->query, query_method); + performQuery(queryInfo, f, use_streaming, print_points, read_results); + + + adios_read_close(f); + adios_read_finalize_method(ADIOS_READ_METHOD_BP); + + MPI_Finalize(); + return 0; +} diff --git a/tests/libs/adios/tests/C/query/common/adios_query_xml_parse.c b/tests/libs/adios/tests/C/query/common/adios_query_xml_parse.c new file mode 100644 index 0000000000..866a3c9754 --- /dev/null +++ b/tests/libs/adios/tests/C/query/common/adios_query_xml_parse.c @@ -0,0 +1,463 @@ +/* + * adios_query_xml_parse.c + * + * Created on: Sep 30, 2014 + * Author: Houjun Tang + */ + +#include +#include +#include +#include +#include +#include "adios_selection.h" +#include "adios_query.h" +#include +#include + +#include "adios_query_xml_parse.h" + +#define MAXDIM 10 +#define MAXQUERY 1000 + +#define GET_ATTR2(n,attr,var,en) \ + if (!strcasecmp (n, attr->name)) { \ + if (!var) \ + { \ + var = attr->value; \ + continue; \ + } \ + else \ + { \ + printf ("xml: duplicate attribute %s on %s (ignored)",n,en); \ + continue; \ + } \ + } + +// Stack for storing queries +typedef struct { + int size; + ADIOS_QUERY *stack[MAXQUERY]; +} QueryStack; + +// init query stack +static void queryStackInit(QueryStack* queryStack) +{ + queryStack->size=0; +} + +static void queryPush(QueryStack* queryStack, ADIOS_QUERY *q) +{ + if (queryStack->size>=MAXQUERY) { + fprintf(stderr, "Query number exceeds MAXQUERY, exiting\n"); + abort(); + } + queryStack->stack[queryStack->size++] = q; + +} + +static int queryStackSize(QueryStack* queryStack) +{ + return queryStack->size; +} + +static ADIOS_QUERY * queryPop(QueryStack* queryStack) +{ + if (queryStackSize(queryStack)==0) { + fprintf(stderr, "Error: popping empty query stack, exiting...\n"); + abort(); + } + return queryStack->stack[--queryStack->size]; +} + +void trim_spaces(char * str); // in adios_internals.c +static void tokenize_dimensions2 (const char * str, char *** tokens, int * count) { + if (!str) { + *tokens = 0; + *count = 0; + + return; + } + + char * save_str = strdup (str); + char * t = save_str; + int i; + + trim_spaces (save_str); + + if (strlen (save_str) > 0) + *count = 1; + else + { + *tokens = 0; + *count = 0; + free (save_str); + + return; + } + + while (*t) + { + if (*t == ',') + (*count)++; + t++; + } + + *tokens = (char **) malloc (sizeof (char **) * *count); + (*tokens) [0] = strdup (strtok (save_str, ",")); + for (i = 1; i < *count; i++) + { + (*tokens) [i] = strdup (strtok (NULL, ",")); + } + + free (save_str); +} +//end of stolen functions + +#define CHECK_ERROR_DATA(data, num, check) { \ + uint64_t di = 0; \ + for(di = 0; di < (num); di++){ \ + if (check) \ + fprintf(stderr, "error data: %f, ", (data)[di]); \ + } \ +} + +ADIOS_QUERY_TEST_INFO * parseXml(const char *inputxml, ADIOS_FILE* f) { + int i, j; + FILE * fp = fopen (inputxml,"r"); + if (!fp){ + fprintf(stderr, "missing xml input file %s \n", inputxml); + return NULL; + } + struct stat s; + char * buffer = NULL; + if (stat (inputxml, &s) == 0) { + buffer = malloc (s.st_size + 1); + buffer [s.st_size] = 0; + } + + if (buffer) { + size_t bytes_read = fread (buffer, 1, s.st_size, fp); + + if (bytes_read != s.st_size) { + fprintf(stderr, "error reading input xml file: %s. Expected %ld Got %lld\n" + ,inputxml, s.st_size, (long long int)bytes_read ); + fclose(fp); + return NULL; + } + } + fclose (fp); + mxml_node_t * root = NULL; + root = mxmlLoadString (NULL, buffer, MXML_TEXT_CALLBACK); + free (buffer); + buffer = NULL; + + if (!root) { + fprintf(stderr, "unknown error parsing XML (probably structural)\n" + "Did you remember to start the file with\n" + "\n"); + return NULL; + } + if (strcasecmp(root->value.element.name, "query") != 0) { + root = mxmlFindElement(root, root, "query", NULL, NULL, MXML_DESCEND_FIRST); + } + + const char *numVarS=NULL; + const char *fromTimestepS=NULL; + const char *numTimestepsS=NULL; + const char *batchsizeS=NULL; + + int numQuery = 0; + int fromTimestep = 1; + int numTimesteps = 1; + uint64_t batchsize= 1; + for (i = 0; i < root->value.element.num_attrs; i++) { + mxml_attr_t * attr = &root->value.element.attrs [i]; + GET_ATTR2("num",attr,numVarS,"query"); + GET_ATTR2("from-timestep",attr,fromTimestepS,"query"); + GET_ATTR2("num-timesteps",attr,numTimestepsS,"query"); + GET_ATTR2("batchsize",attr,batchsizeS,"query"); + } + if ( !numVarS || !strcmp ( numVarS, "")) { + fprintf(stderr, "missing values for num attribute \n"); + mxmlRelease(root); + return NULL; + } + else { + numQuery = atoi(numVarS); + fromTimestep = atoi(fromTimestepS); + numTimesteps = atoi(numTimestepsS); + batchsize = strtoull(batchsizeS, NULL, 10); + } + + mxml_node_t *outputNode = NULL; + const char *outputTypeS=NULL, *outputDimS=NULL, *outputStartS=NULL, *outputCountS=NULL, *outputWbIndexS=NULL; + int outputDim; + int outputWbIndex; + int selType; + char** outputCountTokens=NULL; + char** outputStartTokens=NULL; + ADIOS_SELECTION *outputBox; + + // Parse output selection info + + outputNode = mxmlFindElement(root, root, "output", NULL, NULL, MXML_DESCEND_FIRST); + for (i = 0; i < outputNode->value.element.num_attrs; i++) { + mxml_attr_t * attr = &outputNode->value.element.attrs [i]; + GET_ATTR2("type",attr,outputTypeS,"output"); + if ( strcmp(outputTypeS, "ADIOS_SELECTION_BOUNDINGBOX") == 0) { + selType = ADIOS_SELECTION_BOUNDINGBOX; + GET_ATTR2("dim",attr,outputDimS,"output"); + GET_ATTR2("start",attr,outputStartS,"output"); + GET_ATTR2("count",attr,outputCountS,"output"); + } + else if ( strcmp(outputTypeS, "ADIOS_SELECTION_WRITEBLOCK") == 0) { + selType = ADIOS_SELECTION_WRITEBLOCK; + GET_ATTR2("index",attr,outputWbIndexS,"selection"); + } + } + if ( selType == ADIOS_SELECTION_BOUNDINGBOX ) { + if ( !outputTypeS || !outputDimS || !outputStartS || !outputCountS || !strcmp (outputTypeS, "")|| !strcmp (outputDimS, "") || !strcmp (outputStartS, "") || !strcmp (outputCountS, "") ) { + fprintf(stderr, "missing values for output attribute \n"); + mxmlRelease(root); + return NULL; + } + else { + outputDim = atoi(outputDimS); + if (outputDim > MAXDIM) { + fprintf(stderr, "QueryDim exceeds 10, readjust MAXDIM to larger value, exiting...\n"); + abort(); + } + + tokenize_dimensions2(outputStartS, &outputStartTokens, &outputDim); + tokenize_dimensions2(outputCountS, &outputCountTokens, &outputDim); + + // Allocate arrays to give to the bounding box constructor + uint64_t *outputStart = malloc(outputDim * sizeof(uint64_t)); + uint64_t *outputCount = malloc(outputDim * sizeof(uint64_t)); + + for (j = 0; j < outputDim; j ++){ + outputStart[j] = atoi(outputStartTokens[j]); + outputCount[j] = atoi(outputCountTokens[j]); + free(outputStartTokens[j]); + free(outputCountTokens[j]); + } + free(outputStartTokens); + free(outputCountTokens); + + outputBox = adios_selection_boundingbox(outputDim, outputStart, outputCount); + + /* fprintf(stderr, "Selected output boundingbox: dim:%d start:", outputDim); */ + /* for (j = 0; j < outputDim; j ++){ */ + /* fprintf(stderr, " %d", outputStart[j]); */ + /* } */ + /* fprintf(stderr, "\t count:"); */ + /* for (j = 0; j < outputDim; j ++){ */ + /* fprintf(stderr, " %d", outputCount[j]); */ + /* } */ + /* fprintf(stderr, "\n"); */ + + } + + } + else if( selType == ADIOS_SELECTION_WRITEBLOCK ) { + + if ( !outputWbIndexS || !strcmp (outputWbIndexS, "") ) { + fprintf(stderr, "missing values for selection attribute \n"); + mxmlRelease(root); + return NULL; + } + else { + outputWbIndex = atoi(outputWbIndexS); + outputBox = adios_selection_writeblock(outputWbIndex); + + /* fprintf(stderr, "Selected output writeblock: %d\n", outputWbIndex); */ + } + } + + + // Iterate all combine/entry nodes in + mxml_node_t *entryNode = NULL; + mxml_node_t *selectionNode = NULL; + const char *varNameS=NULL, *opS=NULL, *constraintS=NULL; + const char *typeS=NULL, *dimS=NULL, *startS=NULL, *countS=NULL, *wbIndexS=NULL; + int entryIter; + int queryDim; + int wbIndex; + ADIOS_SELECTION *inputSelection; + ADIOS_QUERY *q, *q1, *q2, *qc; + char** queryCountTokens=NULL; + char** queryStartTokens=NULL; + char *queryCombineOp=NULL; + + // init query stack + QueryStack queryStack; + queryStackInit(&queryStack); + + for (entryIter = 0; entryIter < (numQuery*2-1); entryIter++) { + + // Find entry node + if (entryIter == 0) { + entryNode = mxmlFindElement(root, root, "entry", NULL, NULL, MXML_DESCEND_FIRST); + } + else { + // this is the only way I found for getting the next or node + entryNode= mxmlWalkNext(entryNode, root, MXML_NO_DESCEND); + entryNode= mxmlWalkNext(entryNode, root, MXML_NO_DESCEND); + } + + // check if current node is + if ( strcmp( (&(entryNode->value.element.attrs[0]))->name, "op") == 0 ) { + queryCombineOp = (&(entryNode->value.element.attrs[0]))->value; + /* fprintf(stderr, "Found combine op %s\n", queryCombineOp); */ + // pop up two query and perform the op + if (queryStackSize(&queryStack)<2) { + fprintf(stderr, "Popping with less than 2 queries in query stack, exiting...\n"); + abort(); + } + + q1 = queryPop(&queryStack); + q2 = queryPop(&queryStack); + if (strcmp(queryCombineOp, "AND") == 0 || strcmp(queryCombineOp, "and") == 0) { + qc = adios_query_combine(q1, ADIOS_QUERY_OP_AND, q2); + } + else if (strcmp(queryCombineOp, "OR") == 0 || strcmp(queryCombineOp, "or") == 0) { + qc = adios_query_combine(q1, ADIOS_QUERY_OP_OR, q2); + } + queryPush(&queryStack,qc); + + //adios_query_free(q1); + //adios_query_free(q2); + + continue; + } + + + // Make sure all *S are NULL for verification + varNameS=NULL, opS=NULL, constraintS=NULL; + typeS=NULL, dimS=NULL, startS=NULL, countS=NULL, wbIndexS=NULL; + + for (i = 0; i < entryNode->value.element.num_attrs; i++) { + mxml_attr_t * attr = &entryNode->value.element.attrs [i]; + GET_ATTR2("var",attr,varNameS,"entry"); + GET_ATTR2("op",attr,opS,"entry"); + GET_ATTR2("constraint",attr,constraintS,"entry"); + } + if ( !varNameS || !opS || !constraintS || !strcmp (varNameS, "")|| !strcmp (opS, "") || !strcmp (constraintS, "") ) { + fprintf(stderr, "missing values for entry attribute \n"); + mxmlRelease(root); + return NULL; + } + + // Parse selection + selectionNode = mxmlFindElement(entryNode, entryNode, "selection", NULL, NULL, MXML_DESCEND_FIRST); + + if (selectionNode == NULL) { + inputSelection = NULL; + } + else { + // selection is not NULL + + for (i = 0; i < selectionNode->value.element.num_attrs; i++) { + mxml_attr_t * attr = &selectionNode->value.element.attrs [i]; + GET_ATTR2("type",attr,typeS,"selection"); + if ( strcmp(typeS, "ADIOS_SELECTION_BOUNDINGBOX") == 0) { + selType = ADIOS_SELECTION_BOUNDINGBOX; + GET_ATTR2("dim",attr,dimS,"selection"); + GET_ATTR2("start",attr,startS,"selection"); + GET_ATTR2("count",attr,countS,"selection"); + } + else if ( strcmp(typeS, "ADIOS_SELECTION_WRITEBLOCK") == 0) { + selType = ADIOS_SELECTION_WRITEBLOCK; + GET_ATTR2("index",attr,wbIndexS,"selection"); + } + } + if ( selType == ADIOS_SELECTION_BOUNDINGBOX ) { + + if ( !typeS || !dimS || !startS || !countS || !strcmp (typeS, "")|| !strcmp (dimS, "") || !strcmp (startS, "") || !strcmp (countS, "") ) { + fprintf(stderr, "missing values for selection attribute \n"); + mxmlRelease(root); + return NULL; + } + else { + queryDim = atoi(dimS); + if (queryDim > MAXDIM) { + fprintf(stderr, "QueryDim exceeds 10, readjust MAXDIM to larger value, exiting...\n"); + abort(); + } + + tokenize_dimensions2(startS, &queryStartTokens, &queryDim); + tokenize_dimensions2(countS, &queryCountTokens, &queryDim); + + // Allocate arrays to give to the bounding box constructor + uint64_t *queryStart = malloc(queryDim * sizeof(uint64_t)); + uint64_t *queryCount = malloc(queryDim * sizeof(uint64_t)); + + for (j = 0; j < queryDim; j ++){ + queryStart[j] = atoi(queryStartTokens[j]); + queryCount[j] = atoi(queryCountTokens[j]); + free(queryStartTokens[j]); + free(queryCountTokens[j]); + } + free(queryStartTokens); + free(queryCountTokens); + + inputSelection = adios_selection_boundingbox(queryDim, queryStart, queryCount); + } + + /* fprintf(stderr, "Selected input bounding box: dim:%d start:", queryDim); */ + /* for (j = 0; j < queryDim; j ++){ */ + /* fprintf(stderr, " %d", queryStart[j]); */ + /* } */ + /* fprintf(stderr, "\t count:"); */ + /* for (j = 0; j < queryDim; j ++){ */ + /* fprintf(stderr, " %d", queryCount[j]); */ + /* } */ + /* fprintf(stderr, "\n"); */ + + } // end of selType == ADIOS_SELECTION_BOUNDINGBOX + else { + // selType == ADIOS_SELECTION_WRITEBLOCK + if ( !wbIndexS || !strcmp (wbIndexS, "") ) { + fprintf(stderr, "missing values for selection attribute \n"); + mxmlRelease(root); + return NULL; + } + else { + wbIndex = atoi(wbIndexS); + } + + inputSelection = adios_selection_writeblock(wbIndex); + } + }// end of selection is not NULL + + + if( strcmp(opS, "<=") == 0 ) + q = adios_query_create(f, inputSelection, varNameS, ADIOS_LTEQ, constraintS); + else if( strcmp(opS, "<") == 0 ) + q = adios_query_create(f, inputSelection, varNameS, ADIOS_LT, constraintS); + else if( strcmp(opS, ">=") == 0 ) + q = adios_query_create(f, inputSelection, varNameS, ADIOS_GTEQ, constraintS); + else if( strcmp(opS, ">") == 0 ) + q = adios_query_create(f, inputSelection, varNameS, ADIOS_GT, constraintS); + else { + fprintf(stderr, "Unsupported entry op %s\n", opS); + return NULL; + } + + queryPush(&queryStack,q); + + /* fprintf(stderr, "Parsed entry: var=%s op=%s constraint=%s\n", varNameS, opS, constraintS); */ + } + + ADIOS_QUERY_TEST_INFO *retval = (ADIOS_QUERY_TEST_INFO *)malloc(sizeof(ADIOS_QUERY_TEST_INFO)); + *retval = (ADIOS_QUERY_TEST_INFO){ + .query = queryPop(&queryStack), + .outputSelection = outputBox, + .fromStep = fromTimestep, + .numSteps = numTimesteps, + .batchSize = batchsize, + .varName = varNameS, + }; + return retval; +} diff --git a/tests/libs/adios/tests/C/query/common/adios_query_xml_parse.h b/tests/libs/adios/tests/C/query/common/adios_query_xml_parse.h new file mode 100644 index 0000000000..c48fec9e93 --- /dev/null +++ b/tests/libs/adios/tests/C/query/common/adios_query_xml_parse.h @@ -0,0 +1,26 @@ +/* + * adios_query_xml_parse.h + * + * Created on: Sep 30, 2014 + * Author: Houjun Tang + */ +#ifndef ADIOS_QUERY_XML_PARSE_H_ +#define ADIOS_QUERY_XML_PARSE_H_ + +#include "adios_query.h" + +typedef struct { + ADIOS_QUERY *query; + ADIOS_SELECTION *outputSelection; + int fromStep; + int numSteps; + uint64_t batchSize; + const char *varName; +} ADIOS_QUERY_TEST_INFO; + +/* + * Parses the given XML file to extract the ADIOS_QUERY object described therein. + */ +ADIOS_QUERY_TEST_INFO * parseXml(const char *inputxml, ADIOS_FILE* f); + +#endif /* ADIOS_QUERY_XML_PARSE_H_ */ diff --git a/tests/libs/adios/tests/C/query/common/compute_expected_query_results.c b/tests/libs/adios/tests/C/query/common/compute_expected_query_results.c new file mode 100644 index 0000000000..d6814b916c --- /dev/null +++ b/tests/libs/adios/tests/C/query/common/compute_expected_query_results.c @@ -0,0 +1,615 @@ +/* + * compute_expected_query_results.c + * + * Created on: Sep 30, 2014 + * Author: David A. Boyuka II + */ + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include "adios_query_xml_parse.h" + +#define max(a,b) ((a)>(b)?(a):(b)) + +// Returned ADIOS selection must be freed after use, and will only be valid as long as the supplied varinfo struct is valid +static ADIOS_SELECTION * convertWBToBB(ADIOS_SELECTION *sel, int timestep, ADIOS_FILE *fp, ADIOS_VARINFO *varinfo) { + assert(sel->type == ADIOS_SELECTION_WRITEBLOCK); + + const int wbindex = sel->u.block.index; + const int abs_wbindex = adios_get_absolute_writeblock_index(varinfo, wbindex, timestep); + + if (!varinfo->blockinfo) { + const data_view_t old_view = adios_read_set_data_view(fp, LOGICAL_DATA_VIEW); + adios_read_bp_inq_var_blockinfo(fp, varinfo); + adios_read_set_data_view(fp, old_view); + } + ADIOS_VARBLOCK *vb = &varinfo->blockinfo[abs_wbindex]; + + return adios_selection_boundingbox(varinfo->ndim, vb->start, vb->count); +} + +static uint64_t computeSelectionSizeInElements(ADIOS_SELECTION *sel) { + switch (sel->type) { + case ADIOS_SELECTION_BOUNDINGBOX: { + int i; + ADIOS_SELECTION_BOUNDINGBOX_STRUCT *bb = &sel->u.bb; + uint64_t size = 1; + for (i = 0; i < bb->ndim; ++i) + size *= bb->count[i]; + return size; + } + default: + fprintf(stderr, "Unsupported selection type %d at %s:%s", sel->type, __FILE__, __LINE__); + exit(1); + return 0; + } +} + +enum REDUCED_DATATYPE { RD_UNKNOWN = -1, RD_SIGNED_INT, RD_UNSIGNED_INT, RD_DOUBLE, RD_LONG_DOUBLE, RD_STRING, RD_DOUBLE_COMPLEX }; +static enum REDUCED_DATATYPE getReducedDatatype(enum ADIOS_DATATYPES datatype) { + switch (datatype) { + case adios_byte: + case adios_short: + case adios_integer: + case adios_long: + return RD_SIGNED_INT; + case adios_unsigned_byte: + case adios_unsigned_short: + case adios_unsigned_integer: + case adios_unsigned_long: + return RD_UNSIGNED_INT; + case adios_real: + case adios_double: + return RD_DOUBLE; + case adios_long_double: + return RD_LONG_DOUBLE; + case adios_string: + return RD_STRING; + case adios_complex: + case adios_double_complex: + return RD_DOUBLE_COMPLEX; + } + return RD_UNKNOWN; +} + +#define ALLOCATE_REDUCED_DATATYPE(type) (type*)malloc(sizeof(type)) +static void * allocateReducedDatatype(enum REDUCED_DATATYPE reduced_datatype, int maxstrlen) { + switch (reduced_datatype) { + case RD_SIGNED_INT: return ALLOCATE_REDUCED_DATATYPE(int64_t); + case RD_UNSIGNED_INT: return ALLOCATE_REDUCED_DATATYPE(uint64_t); + case RD_DOUBLE: return ALLOCATE_REDUCED_DATATYPE(double); + case RD_LONG_DOUBLE: return ALLOCATE_REDUCED_DATATYPE(long double); + case RD_STRING: return (char*)malloc(maxstrlen + 1); + case RD_DOUBLE_COMPLEX: + fprintf(stderr, "Cannot handle complex or double complex datatypes (at %s:%s)\n", __FILE__, __LINE__); + exit(1); + return NULL; + } +} + +#define RETURN_REDUCED_DATATYPE(type, val) { type *rd = (type *)malloc(sizeof(type)); *rd = (val); return rd; } +static void * parseStringAsReducedDatatype(const char *str, enum REDUCED_DATATYPE reduced_datatype) { + switch (reduced_datatype) { + case RD_SIGNED_INT: RETURN_REDUCED_DATATYPE(int64_t, strtoll(str, NULL, 0)); break; + case RD_UNSIGNED_INT: RETURN_REDUCED_DATATYPE(uint64_t, strtoull(str, NULL, 0)); break; + case RD_DOUBLE: RETURN_REDUCED_DATATYPE(double, strtod(str, NULL)); break; + case RD_LONG_DOUBLE: RETURN_REDUCED_DATATYPE(long double, strtold(str, NULL)); break; + case RD_STRING: return strdup(str); + case RD_DOUBLE_COMPLEX: + fprintf(stderr, "Cannot handle complex or double complex datatypes (at %s:%s)\n", __FILE__, __LINE__); + exit(1); + return NULL; + } +} + +static void castToReducedDatatype(const void *value, enum ADIOS_DATATYPES datatype, void *outValue) { + switch (datatype) { + case adios_byte: *(int64_t*)outValue = *(const int8_t*)value; break; + case adios_short: *(int64_t*)outValue = *(const int16_t*)value; break; + case adios_integer: *(int64_t*)outValue = *(const int32_t*)value; break; + case adios_long: *(int64_t*)outValue = *(const int64_t*)value; break; + case adios_unsigned_byte: *(uint64_t*)outValue = *(const uint8_t*)value; break; + case adios_unsigned_short: *(uint64_t*)outValue = *(const uint16_t*)value; break; + case adios_unsigned_integer: *(uint64_t*)outValue = *(const uint32_t*)value; break; + case adios_unsigned_long: *(uint64_t*)outValue = *(const uint64_t*)value; break; + case adios_real: *(double*)outValue = *(const float*)value; break; + case adios_double: *(double*)outValue = *(const double*)value; break; + case adios_long_double: *(long double*)outValue = *(const long double*)value; break; + case adios_string: strcpy((char*)outValue, (const char*)value); break; + case adios_complex: + case adios_double_complex: + default: + fprintf(stderr, "Unsupported or invalid reduced datatype %d at %s:%s\n", datatype, __FILE__, __LINE__); + exit(1); + } +} + +#define RETURN_COMPARE_PTRS_CAST_TO_TYPE(ptr1, ptr2, type) { const type __v1 = *(const type*)(ptr1), __v2 = *(const type*)(ptr2); return __v1 < __v2 ? -1 : __v1 > __v2 ? 1 : 0; } +static int compareReducedDatatypeValues(const void *v1, const void *v2, enum REDUCED_DATATYPE datatype) { + switch (datatype) { + case RD_SIGNED_INT: RETURN_COMPARE_PTRS_CAST_TO_TYPE(v1, v2, int64_t); break; + case RD_UNSIGNED_INT: RETURN_COMPARE_PTRS_CAST_TO_TYPE(v1, v2, int64_t); break; + case RD_DOUBLE: RETURN_COMPARE_PTRS_CAST_TO_TYPE(v1, v2, double); break; + case RD_LONG_DOUBLE: RETURN_COMPARE_PTRS_CAST_TO_TYPE(v1, v2, long double); break; + case RD_STRING: return strcmp((const char*)v1, (const char*)v2); + case RD_DOUBLE_COMPLEX: + default: + fprintf(stderr, "Unsupported or invalid reduced datatype %d at %s:%s\n", datatype, __FILE__, __LINE__); + exit(1); + return 0; + } +} + +// NOTE: both bound and value must be (the same) reduced datatype +static int compareConstraintBoundValue(const void *bound, const void *value, enum REDUCED_DATATYPE reducedDatatype, enum ADIOS_PREDICATE_MODE comparison) { + int compare = compareReducedDatatypeValues(value, bound, reducedDatatype); + + switch (comparison) { + case ADIOS_LT: return compare < 0; + case ADIOS_LTEQ: return compare <= 0; + case ADIOS_GT: return compare > 0; + case ADIOS_GTEQ: return compare >= 0; + case ADIOS_EQ: return compare == 0; + case ADIOS_NE: return compare != 0; + } +} + +// Returns which points in the given buffer of data (buffer) for the given selection +// (insel) match the constraint in the given query (query), returning a list of points +// that are relative to (insel) +static ADIOS_SELECTION * scanBufferForMatchingPoints(const char *buffer, enum ADIOS_DATATYPES datatype, ADIOS_SELECTION *insel, ADIOS_QUERY *query) { + assert(insel->type == ADIOS_SELECTION_BOUNDINGBOX); // For now, only support bounding boxes (and writeblocks, since they are converted to bounding boxes earlier) + + const int ndim = query->varinfo->ndim; + const ADIOS_SELECTION_BOUNDINGBOX_STRUCT *bb = &insel->u.bb; + + const int datatypeSize = adios_type_size(datatype, NULL); + const enum REDUCED_DATATYPE reducedDatatype = getReducedDatatype(datatype); + const enum ADIOS_PREDICATE_MODE comparison = query->predicateOp; + + const void *boundValue = parseStringAsReducedDatatype(query->predicateValue, reducedDatatype); + void *pointValue = allocateReducedDatatype(reducedDatatype, 0); + + uint64_t elemsRemaining = computeSelectionSizeInElements(insel); + + uint64_t npoints = 0; + uint64_t pointsCapacity = 1; + uint64_t *points = (uint64_t *)calloc(pointsCapacity, ndim * sizeof(uint64_t)); // First coordinate is at 0,0,0,...,0, since the results should be relative to the selection box + assert(points); + uint64_t *nextPoint = points; + + int i; + while (elemsRemaining-- > 0) { + // Cast the point's value to a reduced datatype + castToReducedDatatype(buffer, datatype, pointValue); + + // Compare the point value to the bound value + if (compareConstraintBoundValue(boundValue, pointValue, reducedDatatype, comparison)) { + // Commit the current point as a real point + ++npoints; + + // Expand the point array if need be + if (npoints == pointsCapacity) { + const uint64_t next_point_offset = nextPoint - points; + pointsCapacity *= 2; + points = (uint64_t*)realloc(points, pointsCapacity * ndim * sizeof(uint64_t)); + assert(points); + nextPoint = points + next_point_offset; + } + + // Move to the next point + const uint64_t *curPoint = nextPoint; + nextPoint += ndim; + + // Copy the current point's coordinates to the next point's coordinates, + // so they will continue to be incremented from here + memcpy(nextPoint, curPoint, ndim * sizeof(uint64_t)); + } + + // Increment the next point's coordinates + for (i = ndim - 1; i >= 0; --i) { + ++nextPoint[i]; + if (nextPoint[i] == bb->count[i]) { + nextPoint[i] = 0; + } else { + break; + } + } + + // Advance in the input buffer + buffer += datatypeSize; + } + + free((void*)boundValue); + free(pointValue); + return adios_selection_points(ndim, npoints, points); +} + +static int pointLexCompareNumDims; +static void setPointLexCompareNumDims(int ndim) { + pointLexCompareNumDims = ndim; +} +static int pointLexCompare(const void *left, const void *right) { + const int ndim = pointLexCompareNumDims; + const uint64_t *leftpt = (const uint64_t *)left; + const uint64_t *rightpt = (const uint64_t *)right; + int i; + for (i = 0; i < ndim; ++i) { + if (*leftpt < *rightpt) + return -1; + else if (*leftpt > *rightpt) + return 1; + ++leftpt; + ++rightpt; + } return 0; + +} + +static void sortPointsLexOrder(ADIOS_SELECTION *pointsel) { + assert(pointsel->type == ADIOS_SELECTION_POINTS); + setPointLexCompareNumDims(pointsel->u.points.npoints); // Sets the ndim for pointLexCompare via global variable, since we can't pass any parameters + qsort(pointsel->u.points.points, pointsel->u.points.npoints, pointsel->u.points.ndim * sizeof(uint64_t), pointLexCompare); +} + +// Returns a point selection with points in lexicographical order +static ADIOS_SELECTION * evaluateConstraint(ADIOS_QUERY *query, int timestep) { + enum { MAX_DIMS = 32 }; + static const uint64_t ZERO[MAX_DIMS] = { 0 }; // Initializes all elements to 0 as per C standard + + assert(!query->left && !query->right); + assert(query->file && query->varName); + + if (!query->varinfo) { + query->varinfo = adios_inq_var(query->file, query->varName); + adios_inq_var_blockinfo(query->file, query->varinfo); + } + if (!query->sel) { + query->sel = adios_selection_boundingbox(query->varinfo->ndim, ZERO, query->varinfo->dims); + query->deleteSelectionWhenFreed = 1; + } + + assert(query->varinfo && query->file && query->sel); + + ADIOS_SELECTION *insel = query->sel; + ADIOS_SELECTION *globalInsel; + + if (insel->type == ADIOS_SELECTION_WRITEBLOCK) { + globalInsel = convertWBToBB(insel, timestep, query->file, query->varinfo); + } else { + globalInsel = insel; + } + + const uint64_t buffersize = computeSelectionSizeInElements(globalInsel) * adios_type_size(query->varinfo->type, NULL); + char *buffer = (char *)malloc(buffersize); + assert(buffer); + + adios_schedule_read_byid(query->file, insel, query->varinfo->varid, timestep, 1, buffer); + adios_perform_reads(query->file, 1); + + ADIOS_SELECTION *results = scanBufferForMatchingPoints(buffer, query->varinfo->type, globalInsel, query); + sortPointsLexOrder(results); // Sort the matching points in lexicographical order + + if (globalInsel != insel) + adios_selection_delete(globalInsel); + + return results; +} + +// Takes two point selections with points in lexicographical order, and +// returns a combined point selection with points in lexicographical order +static ADIOS_SELECTION * computePointListCombination(enum ADIOS_CLAUSE_OP_MODE op, ADIOS_SELECTION *leftsel, ADIOS_SELECTION *rightsel) { + assert(leftsel->u.points.ndim == rightsel->u.points.ndim); + const int ndim = leftsel->u.points.ndim; + + // Allocate an array for the combined points + const uint64_t maxNewPoints = + (op == ADIOS_QUERY_OP_AND) ? + max(leftsel->u.points.npoints, rightsel->u.points.npoints) : + leftsel->u.points.npoints + rightsel->u.points.npoints; + uint64_t *newPoints = (uint64_t *)malloc(maxNewPoints * ndim * sizeof(uint64_t)); + assert(newPoints); + + // Set up iterator pointers + const uint64_t *leftHeadPoint = leftsel->u.points.points; + const uint64_t *rightHeadPoint = rightsel->u.points.points; + const uint64_t *leftPointsEnd = leftHeadPoint + ndim * leftsel->u.points.npoints; + const uint64_t *rightPointsEnd = rightHeadPoint + ndim * rightsel->u.points.npoints; + + uint64_t newNPoints = 0; + uint64_t *curPoint = newPoints; + + // Perform a list conjunction/disjunction on the point lists + setPointLexCompareNumDims(ndim); + while (leftHeadPoint != leftPointsEnd && rightHeadPoint != rightPointsEnd) { + // Compare the head points of both point lists + const int compare = pointLexCompare(leftHeadPoint, rightHeadPoint); + + // If we are taking the OR of the lists, or we are taking the AND and + // the head points are equal, copy the lesser of the head points to the output + // (copying the lesser point works for both AND and OR cases) + if (op == ADIOS_QUERY_OP_OR || (op == ADIOS_QUERY_OP_AND && compare == 0)) { + memcpy(curPoint, (compare < 0) ? leftHeadPoint : rightHeadPoint, ndim * sizeof(uint64_t)); + ++newNPoints; + curPoint += ndim; + } + + // Increment the point list with the lesser head point + // (or both lists if the points are equal) + if (compare <= 0) + leftHeadPoint += ndim; + if (compare >= 0) + rightHeadPoint += ndim; + } + + // If we are in OR mode, copy any remaining points in the unexhausted + // list (if one of the two point lists is so) + if (op == ADIOS_QUERY_OP_OR) { + if (leftHeadPoint != leftPointsEnd) { + const uint64_t coordsRemaining = (leftPointsEnd - leftHeadPoint); + memcpy(curPoint, leftHeadPoint, coordsRemaining * sizeof(uint64_t)); + newNPoints += coordsRemaining / ndim; + } else if (rightHeadPoint != rightPointsEnd) { + const uint64_t coordsRemaining = (rightPointsEnd - rightHeadPoint); + memcpy(curPoint, rightHeadPoint, coordsRemaining * sizeof(uint64_t)); + newNPoints += coordsRemaining / ndim; + } + } + + // Free the left and right point lists, since they are no longer needed + free(leftsel->u.points.points); + free(rightsel->u.points.points); + adios_selection_delete(leftsel); + adios_selection_delete(rightsel); + + // Return the combined point list + return adios_selection_points(ndim, newNPoints, newPoints); +} + +static ADIOS_SELECTION * evaluateQueryTree(ADIOS_QUERY *query, int timestep) { + if (!query->left && !query->right) { + return evaluateConstraint(query, timestep); + } else if (query->left && query->right) { + const enum ADIOS_CLAUSE_OP_MODE op = query->combineOp; + ADIOS_SELECTION *leftsel = evaluateQueryTree(query->left, timestep); + ADIOS_SELECTION *rightsel = evaluateQueryTree(query->right, timestep); + + ADIOS_SELECTION *combinedsel = computePointListCombination(op, leftsel, rightsel); + return combinedsel; + } else if (query->left) { + return evaluateQueryTree(query->left, timestep); + } else if (query->right) { + return evaluateQueryTree(query->right, timestep); + } +} + +static ADIOS_SELECTION * derelativizePoints(ADIOS_SELECTION *inputPointsSel, ADIOS_SELECTION *outputSelection) { + ADIOS_SELECTION_POINTS_STRUCT *inputPoints = &inputPointsSel->u.points; + const int ndim = inputPoints->ndim; + + assert(outputSelection->type == ADIOS_SELECTION_BOUNDINGBOX); + const uint64_t *outputOffset = outputSelection->u.bb.start; + + uint64_t i, j; + uint64_t *curPoint = inputPoints->points; + for (i = 0; i < inputPoints->npoints; ++i) + for (j = 0; j < ndim; ++j) + *curPoint++ += outputOffset[j]; + + return inputPointsSel; +} + +static ADIOS_VARBLOCK * computePGBounds(ADIOS_QUERY *q, ADIOS_SELECTION_WRITEBLOCK_STRUCT *wb, int timestep, int *out_ndim) +{ + if (!q->left && !q->right) { + // In this case, we have reached a leaf query node, so directly + // retrieve the varblock from the varinfo + assert(q->varinfo); + + // Read the blockinfo if not already present + if (!q->varinfo->blockinfo) { + adios_read_set_data_view(q->file, LOGICAL_DATA_VIEW); + common_read_inq_var_blockinfo(q->file, q->varinfo); + } + + // Note: adios_get_absolute_writeblock_index ensures that timestep and wbindex + // are both in bounds, signalling an adios_error if not. However, there will be + // no variable name cited in the error, so perhaps better error handling would + // be desirable in the future + //const int abs_wbindex = adios_get_absolute_writeblock_index(q->varinfo, wbindex, timestep); + + int abs_wbindex; + if (wb->is_absolute_index) { + abs_wbindex = wb->index; + } else { + if (q->file->is_streaming) { + // In streaming mode, absolute == relative, so just use the index directly + abs_wbindex = wb->index; + } else { + abs_wbindex = adios_get_absolute_writeblock_index(q->varinfo, wb->index, timestep); + } + } + + // Finally, return ndim and the varblock + *out_ndim = q->varinfo->ndim; + return &q->varinfo->blockinfo[abs_wbindex]; + } else if (!q->left || !q->right) { + // In this case, we have only one subtree, so just return the + // ndim and varblock from that subtree directly, since there's + // nothing to compare against + + ADIOS_QUERY *present_subtree = q->left ? (ADIOS_QUERY*)q->left : (ADIOS_QUERY*)q->right; + return computePGBounds(present_subtree, wb, timestep, out_ndim); + } else { + // In this final case, we have two subtrees, and we must compare + // the resultant varblock from each one to ensure they are equal + // before returning + + ADIOS_QUERY *left = (ADIOS_QUERY *)q->left; + ADIOS_QUERY *right = (ADIOS_QUERY *)q->right; + + // Next, retrieve the ndim and varblock for each subtree + int left_ndim, right_ndim; + ADIOS_VARBLOCK *left_vb = computePGBounds(left, wb, timestep, &left_ndim); + ADIOS_VARBLOCK *right_vb = computePGBounds(right, wb, timestep, &right_ndim); + + // If either subtree returns an invalid (NULL) varblock, fail immediately + if (!left_vb || !right_vb) { + return NULL; + } + + // Check that the ndims are equal, failing if not + int ndim; + if (left_ndim != right_ndim) { + return NULL; + } else { + ndim = left_ndim; + } + + // Check the start/count coordinate in each dimension for equality, + // failing if any coordinate is not equal between the subtrees + int i; + for (i = 0; i < ndim; i++) { + if (left_vb->start[i] != right_vb->start[i] || + left_vb->count[i] != right_vb->count[i]) { + return NULL; + } + } + + // Finally, we have ensured that both subtrees yield valid and equal + // varblocks, so return the common ndim and varblock (arbitrarily use + // left_vb, since right and left equal) + *out_ndim = ndim; + return left_vb; + } +} + +static ADIOS_SELECTION * convertOutputWBToBB(ADIOS_QUERY *query, ADIOS_SELECTION_WRITEBLOCK_STRUCT *outputWB, int timestep) { + int ndim; + const ADIOS_VARBLOCK *outputWBBounds = computePGBounds(query, outputWB, timestep, &ndim); + + if (outputWBBounds) { + return adios_selection_boundingbox(ndim, outputWBBounds->start, outputWBBounds->count); + } else { + return NULL; + } +} + +static ADIOS_SELECTION * computeExpectedQueryResults(ADIOS_QUERY *query, ADIOS_SELECTION *outputSelection, int timestep) { + ADIOS_SELECTION *resultPointsSel = evaluateQueryTree(query, timestep); + + ADIOS_SELECTION *globalOutputSelection; + if (outputSelection->type == ADIOS_SELECTION_WRITEBLOCK) { + globalOutputSelection = convertOutputWBToBB(query, &outputSelection->u.block, timestep); + } else { + globalOutputSelection = outputSelection; + } + + derelativizePoints(resultPointsSel, globalOutputSelection); + + if (globalOutputSelection != outputSelection) + adios_selection_delete(globalOutputSelection); + + return resultPointsSel; +} + +static void printPointSelection(int timestep, ADIOS_SELECTION *sel) { + assert(sel->type == ADIOS_SELECTION_POINTS); + + const ADIOS_SELECTION_POINTS_STRUCT *pstruct = &sel->u.points; + const int ndim = pstruct->ndim; + const uint64_t npoints = pstruct->npoints; + const uint64_t *points = pstruct->points; + + uint64_t i; + int j; + for (i = 0; i < npoints; ++i) { + printf("%d", timestep); + for (j = 0; j < ndim; ++j) { + printf(" %llu", *points++); + } + printf("\n"); + } +} + +static void usage(const char *cmd) { + fprintf(stderr, "Usage: %s [stream]", cmd); +} + +#define SHIFT_N(n) { argc -= (n); argv += (n); } +#define SHIFT SHIFT_N(1) +int main(int argc, char **argv) { + const char *cmd = *argv; SHIFT; + if (argc < 2 || argc > 3) { + usage(cmd); + exit(1); + } + + const char *bp_filename = *argv; SHIFT; + const char *inputxml_filename = *argv; SHIFT; + const int use_streaming = argc && (strcasecmp(*argv, "stream") == 0); + + const MPI_Comm comm = MPI_COMM_WORLD; + + MPI_Init(&argc, &argv); + adios_read_init_method(ADIOS_READ_METHOD_BP, comm, ""); + + ADIOS_FILE *bp_file = + use_streaming ? + adios_read_open(bp_filename, ADIOS_READ_METHOD_BP, comm, ADIOS_LOCKMODE_ALL, -1) : + adios_read_open_file(bp_filename, ADIOS_READ_METHOD_BP, comm); + + if (bp_file == NULL) { + log_error("Error: could not read input dataset %s\n", bp_filename); + exit(1); + } + + ADIOS_QUERY_TEST_INFO *testinfo = parseXml(inputxml_filename, bp_file); + if (testinfo == NULL) { + log_error("Error: could not read query XML file %s\n", inputxml_filename); + exit(1); + } + + fprintf(stderr, "NOTE: Running the query in %s mode\n", use_streaming ? "STREAM" : "FILE"); + + // If we are in streaming mode, skip to the desired timestep + int timestep; + if (use_streaming) + for (timestep = 0; timestep < testinfo->fromStep; ++timestep) + assert(adios_advance_step(bp_file, 0, 0) == 0); + + for (timestep = testinfo->fromStep; timestep < testinfo->fromStep + testinfo->numSteps; ++timestep) { + ADIOS_SELECTION *result = computeExpectedQueryResults(testinfo->query, testinfo->outputSelection, use_streaming ? 0 : timestep); + printPointSelection(timestep, result); + + free(result->u.points.points); + adios_selection_delete(result); + + // If we are in streaming mode, advance to the next step + if (use_streaming) { + const int err = adios_advance_step(bp_file, 0, 0); + if (timestep < testinfo->fromStep + testinfo->numSteps - 1) { + assert(err == 0); + } else { + assert(err == err_end_of_stream || err == err_step_notready); + } + } + } + + adios_selection_delete(testinfo->outputSelection); // TODO: leaks start[] and count[] if it's a BB + adios_query_free(testinfo->query); + free(testinfo); + adios_read_close(bp_file); + + adios_read_finalize_method(ADIOS_READ_METHOD_BP); + MPI_Finalize(); +} + diff --git a/tests/libs/adios/tests/C/query/fastbit/CMakeLists.txt b/tests/libs/adios/tests/C/query/fastbit/CMakeLists.txt new file mode 100644 index 0000000000..ef31d9b985 --- /dev/null +++ b/tests/libs/adios/tests/C/query/fastbit/CMakeLists.txt @@ -0,0 +1,14 @@ +include_directories(${PROJECT_SOURCE_DIR}/src/public) +include_directories(${PROJECT_SOURCE_DIR}/src) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../common) +link_directories(${PROJECT_BINARY_DIR}/src) +link_directories(${CMAKE_CURRENT_BINARY_DIR}../common) +link_directories(${MXML_INCLUDE_DIR}/../lib) +include_directories(${MXML_INCLUDE_DIR}) + +add_executable(fastbit_tests fastbit_tests.c) +target_link_libraries(fastbit_tests adiosread_nompi adios_nompi ${ADIOSREADLIB_LDADD} ${MXML_LIBS}) +set_target_properties(fastbit_tests PROPERTIES COMPILE_FLAGS "${MACRODEFFLAG}_NOMPI") + +file(COPY query.xml + DESTINATION ${PROJECT_BINARY_DIR}/tests/C/query/fastbit) diff --git a/tests/libs/adios/tests/C/query/fastbit/Makefile.am b/tests/libs/adios/tests/C/query/fastbit/Makefile.am new file mode 100644 index 0000000000..31d70faf83 --- /dev/null +++ b/tests/libs/adios/tests/C/query/fastbit/Makefile.am @@ -0,0 +1,24 @@ +INCLUDES = $(all_includes) +# +# ${ADIOSREADLIB_CPPFLAGS} has all the flags like -DFASTBIT -DALACRITY +# as well as related includes, so it is needed here +# +INCLUDES += -I$(top_srcdir)/src/ -I$(top_srcdir)/src/public/ $(MXML_CPPFLAGS) + +AUTOMAKE_OPTIONS = no-dependencies + +noinst_PROGRAMS = + +# Only compile these test programs if we have FastBit, since they rely on FastBit +if HAVE_FASTBIT +CC=$(MPICC) + +noinst_PROGRAMS += fastbit_tests + +fastbit_tests_SOURCES = fastbit_tests.c +fastbit_tests_CPPFLAGS = ${MACRODEFFLAG}_NOMPI +fastbit_tests_LDADD = $(top_builddir)/src/libadiosread_nompi.a $(top_builddir)/src/libadios_nompi.a $(ADIOSREADLIB_LDADD) ${MXML_LIBS} +fastbit_tests_LDFLAGS = $(ADIOSREADLIB_LDFLAGS) ${MXML_LDFLAGS} + +endif # HAVE_FASTBIT +CC=$(MPICC) \ No newline at end of file diff --git a/tests/libs/adios/tests/C/query/fastbit/fastbit_tests.c b/tests/libs/adios/tests/C/query/fastbit/fastbit_tests.c new file mode 100644 index 0000000000..462c072e22 --- /dev/null +++ b/tests/libs/adios/tests/C/query/fastbit/fastbit_tests.c @@ -0,0 +1,1019 @@ +#include +#include + +#include +#include +#include + +#include +#include +/* +static int mybmreader(void *ctx, uint64_t start,uint64_t count, uint32_t *buf) { + const uint32_t *bms = (uint32_t*)ctx + start; + unsigned j; + for (j = 0; j < count; ++ j) { + buf[j] = bms[j]; + } + return 0; +} // mybmreader +*/ + +char _gTagQuery[20] = "query"; +char _gTagSel[20] = "selection"; +char _gTagEntry[20] = "entry"; +char _gTagOutput[20] = "output"; + +char _gAttrAction[20] = "action"; +char _gAttrBPFile[20] = "bpFile"; +char _gAttrBatchSize[20] = "batchSize"; +char _gAttrQueryName[20] = "name"; +char _gAttrVarName[20] = "varName"; +char _gAttrVarValue[20] = "value"; +char _gAttrOperand[20] = "op"; +char _gAttrSelType[20] = "type"; +char _gAttrSelDim[20] = "dim"; +char _gAttrSelID[20] = "id"; +char _gAttrSelStart[20] = "start"; +char _gAttrSelCount[20] = "count"; +char _gAttrNode[20] = "node"; + + +long _stageRefreshMillis = 0; +long _lastMeasuredMillis = 0; +long _queryStartMillis = 0; + +void logReport(int stage) { + long ms = fastbit_adios_getCurrentTimeMillis(); + + if (stage == -1) { // init + _lastMeasuredMillis = ms; + _stageRefreshMillis = ms; + _queryStartMillis = ms; + } else if (stage == 0) { // query + printf("\n==> Total time spent to process this query: %ld millis.\n", ms - _queryStartMillis); + } +} + + +void logTimeMillis(const char* notes) +{ + long ms = fastbit_adios_getCurrentTimeMillis(); + + if (notes == NULL) { + printf("\n"); + _stageRefreshMillis = ms; + } else { + long d = ms - _lastMeasuredMillis; + printf(" ELAPSED millis: %ld \t%s\n", d, notes); + } + _lastMeasuredMillis = ms; +} + + +static int getTotalByteSize (ADIOS_FILE* f, ADIOS_VARINFO* v, ADIOS_SELECTION* sel, + uint64_t* total_byte_size, uint64_t* dataSize, int timestep) +{ + *total_byte_size = common_read_type_size (v->type, v->value); + *dataSize = 1; + + if (sel == 0) { + uint64_t s = 0; + for (s=0; sndim; s++) { + *total_byte_size *=v->dims[s]; + *dataSize *= v->dims[s]; + // log_debug(" dim %" PRIu64 "default count %" PRIu64 "\n", s, v->dims[s]); + } + return 0; + } + + switch (sel->type) { + case ADIOS_SELECTION_BOUNDINGBOX: + { + const ADIOS_SELECTION_BOUNDINGBOX_STRUCT *bb = &(sel->u.bb); + uint64_t* count = bb->count; + uint64_t* start = bb->start; + + int s=0; + + for (s=0; sndim; s++) { + if (start[s]+count[s] > v->dims[s]) { + printf(" Invalid bounding box at %dth dim: start %" PRIu64 " + count %" PRIu64 " exceeds dim size: %" PRIu64 "\n", + s, start[s], count[s], v->dims[s]); + return -1; + } + *total_byte_size *=count[s]; + *dataSize *= count[s]; + } + + break; + } + case ADIOS_SELECTION_POINTS: + { + const ADIOS_SELECTION_POINTS_STRUCT *pts = &(sel->u.points); + *total_byte_size *= pts->npoints; + *dataSize = pts->npoints; + break; + } + case ADIOS_SELECTION_WRITEBLOCK: + { + const ADIOS_SELECTION_WRITEBLOCK_STRUCT *wb = &(sel->u.block); + + common_read_inq_var_blockinfo(f, v); + int i=0; + int min = v->nblocks[0]; + int absBlockCounter = wb->index; + + if (v->nsteps > 1) { // all timesteps are known, can get abs + for (i=0; insteps; i++) + { + int nBlocksAtStep = v->nblocks[i]; + if (nBlocksAtStep < min) { + min = nBlocksAtStep; + } + printf("\t\t currstep=%d nblocks=%d\n", i, nBlocksAtStep); + if (i < timestep) { + absBlockCounter += nBlocksAtStep; + } + } + } + + if (wb->index > min) { + printf("Error: Unable to handle this block index %d over all the timesteps. Stop.\n", wb->index); + return -1; + } + int j=0; + for (j=0; jndim; j++) + { + *total_byte_size *= v->blockinfo[absBlockCounter].count[j]; + *dataSize *= v->blockinfo[absBlockCounter].count[j]; + } + + printf("\t\t block %d, abs id:%d, bytes: %" PRIu64 ", size = %" PRIu64 " \n", wb->index, absBlockCounter, *total_byte_size, *dataSize); + + break; + } + default: + break; + } + return 0; +} + +void recursive_free(ADIOS_QUERY* q) { + ADIOS_QUERY* left = q->left; + ADIOS_QUERY* right = q->right; + + if (q->sel != NULL) { + if (q->sel->type == ADIOS_SELECTION_BOUNDINGBOX) { + const ADIOS_SELECTION_BOUNDINGBOX_STRUCT *bb = &(q->sel->u.bb); + free(bb->start); + free(bb->count); + } + adios_selection_delete(q->sel); + } + + if (left != NULL) { + recursive_free(left); + recursive_free(right); + } + + adios_query_free(q); +} + +int getInput(char* input, const char* delim, uint64_t** result, int dim) +{ + int i=0; + char* token = strtok(input, delim); + + while (token) { + (*result)[i] = atol(token); + i++; + if (i>=dim) { + break; + } + token = strtok(0, delim); + } + + if (i == dim) { + return 0; + } + return -1; +} + + +ADIOS_SELECTION* getSelFromSelectionNode(mxml_node_t* selNode) { + const char* type = mxmlElementGetAttr(selNode, _gAttrSelType); + if (type == NULL) { + printf("No type specified, treat as NULL\n"); + return NULL; + } + + if (strstr(type, "BOX") != NULL) { + const char* dimStr = mxmlElementGetAttr(selNode, _gAttrSelDim); + char* startStr = mxmlElementGetAttr(selNode, _gAttrSelStart); + char* countStr = mxmlElementGetAttr(selNode, _gAttrSelCount); + if ((dimStr == NULL) || ( startStr == NULL) || (countStr == NULL)) { + printf("One of dim/count/start is not specified in BOUNDINGBOX, treat as NULL\n"); + return NULL; + } + + int dim = atoi(dimStr); + if (dim == 0) { + printf("Invalid dim str %s: expecting to be > 0 \n", dimStr); + exit(EXIT_FAILURE); + } + + uint64_t* count = malloc(dim*sizeof(uint64_t)); + uint64_t* start = malloc(dim*sizeof(uint64_t)); + + if (getInput(startStr, ",", &start, dim) != 0) { + free(start); + return NULL; + } + if (getInput(countStr, ",", &count, dim) != 0) { + free(count); + return NULL; + } + return adios_selection_boundingbox(dim, start, count); + } else if (strstr(type, "BLOCK") != NULL) { + const char* idStr = mxmlElementGetAttr(selNode, _gAttrSelID); + if (idStr == NULL) { + printf("block id is expected but not defined. "); + return NULL; + } + int blockID = atoi(idStr); + return adios_selection_writeblock(blockID); + } + + return NULL; +} + +ADIOS_SELECTION* getSel(mxml_node_t* entryNode) { + mxml_node_t* selNode = mxmlFindElement(entryNode, entryNode, _gTagSel, NULL, NULL, MXML_DESCEND); + if (selNode == NULL) { + return NULL; + } + + return getSelFromSelectionNode(selNode); +} + + +ADIOS_QUERY* getEntryQuery(mxml_node_t* queryNode, const char* entryName, ADIOS_FILE* f) +{ + mxml_node_t* entryNode = mxmlFindElement(queryNode, queryNode, _gTagEntry, _gAttrQueryName, entryName, MXML_DESCEND); + if (entryNode == NULL) { + printf("No such subquery: %s\n", entryName); + return NULL; + } + + const char* actionAttr = mxmlElementGetAttr(entryNode,_gAttrAction); + + if (actionAttr != NULL) { // composite query + enum ADIOS_CLAUSE_OP_MODE op = ADIOS_QUERY_OP_AND; + if (strcasecmp(actionAttr, "or") == 0) { + op = ADIOS_QUERY_OP_OR; + } + //continue here.. + mxml_node_t* leftNode = mxmlFindElement(entryNode, entryNode, _gAttrNode,NULL, NULL, MXML_DESCEND); + mxml_node_t* rightNode = mxmlFindElement(leftNode, entryNode, _gAttrNode, NULL, NULL, MXML_DESCEND); + + if ((leftNode == NULL) || (rightNode == NULL)) { + return NULL; + } + + const char* leftName = leftNode->child->value.text.string; + const char* rightName = rightNode->child->value.text.string; + + ADIOS_QUERY* left = getEntryQuery(queryNode, leftName, f); + ADIOS_QUERY* right = getEntryQuery(queryNode, rightName, f); + + mxmlDelete(entryNode); + return adios_query_combine(left, op, right); + + } else { + // a leaf; + const char* varName = mxmlElementGetAttr(entryNode, _gAttrVarName); + const char* value = mxmlElementGetAttr(entryNode, _gAttrVarValue); + const char* opStr = mxmlElementGetAttr(entryNode, _gAttrOperand); + + if ((varName == NULL) || (value == NULL) || (opStr == NULL)) { + return NULL; + } + enum ADIOS_PREDICATE_MODE op = getOp(opStr); + + ADIOS_SELECTION* sel = getSel(entryNode); + + ADIOS_QUERY* q = adios_query_create(f, sel, varName, op, value); + return q; + } + + mxmlDelete(entryNode); +} + +ADIOS_QUERY* constructQuery(mxml_node_t* queryNode, ADIOS_FILE* f, const char* queryName, uint64_t batchSize) +{ + mxml_node_t* opNode = mxmlFindElement(queryNode, queryNode, _gAttrOperand, NULL, NULL, MXML_DESCEND); + if (opNode == NULL) + { + return getEntryQuery(queryNode, NULL, f); + } else { + mxml_node_t* leftNode = mxmlFindElement(opNode, opNode, _gAttrNode, NULL, NULL, MXML_DESCEND); + mxml_node_t* rightNode = mxmlFindElement(leftNode, opNode, _gAttrNode, NULL, NULL, MXML_DESCEND); + + const char* leftName = leftNode->child->value.text.string; + const char* rightName = rightNode->child->value.text.string; + + if ((leftName == NULL) || (rightName == NULL)) { + printf("Unable to get entry for combination op. \n"); + return NULL; + } + + ADIOS_QUERY* left = getEntryQuery(queryNode, leftName, f); + ADIOS_QUERY* right = getEntryQuery(queryNode, rightName, f); + + enum ADIOS_CLAUSE_OP_MODE op = ADIOS_QUERY_OP_AND; + if (opNode->value.element.num_attrs == 1) { + if (strcasecmp(opNode->value.element.attrs[0].value, "or") == 0) { + op = ADIOS_QUERY_OP_OR; + } + } + mxmlDelete(opNode); + return adios_query_combine(left, op, right); + } +} + +double getCurrentValue(void* data, uint64_t idx, enum ADIOS_DATATYPES type) +{ + switch (type) + { + case adios_unsigned_byte: + return ((uint8_t *) data)[idx]; + case adios_byte: + return ((int8_t *) data)[idx]; + case adios_short: + return ((int16_t *) data)[idx]; + case adios_unsigned_short: + return ((uint16_t *) data)[idx]; + case adios_integer: + return ((int32_t *) data)[idx]; + case adios_unsigned_integer: + return ((uint32_t *) data)[idx]; + case adios_long: + return ((int64_t *) data)[idx]; + case adios_unsigned_long: + return ((uint64_t *) data)[idx]; + case adios_real: + return ((float *) data)[idx]; + case adios_double: + return ((double *) data)[idx]; + case adios_long_double: + return ((long double *) data)[idx]; + case adios_string: + break; + case adios_complex: + break; + case adios_double_complex: + break; + } + return 0; +} + +void manualCheck(ADIOS_QUERY* q, int timestep) { + if ((q->left == NULL) && (q->right == NULL)) { + printf ("... manual check: \n"); + // proceed + uint64_t totalByteSize; + uint64_t totalSize; + + getTotalByteSize(q->file, q->varinfo, q->sel, &totalByteSize, &totalSize, timestep); + + void* output = malloc (totalByteSize); + + adios_schedule_read (q->file, q->sel, q->varName, timestep, 1, output); + adios_perform_reads (q->file, 1); + + uint64_t hits=0; + uint64_t k=0; + + char* endptr; + double vv = strtod(q->predicateValue, &endptr); + + for (k=0; kvarinfo->type); + //printf ("curr=%lg, vv=%lg\n", curr, vv); + if (curr == vv) { + if ((q->predicateOp == ADIOS_EQ) || (q->predicateOp == ADIOS_LTEQ) || (q->predicateOp == ADIOS_GTEQ)) { + hits ++; + } + } else if (curr < vv) { + if ((q->predicateOp == ADIOS_LT) || (q->predicateOp == ADIOS_LTEQ)) { + hits ++; + } + } else { // > + if ((q->predicateOp == ADIOS_GT) || (q->predicateOp == ADIOS_GTEQ)) { + hits ++; + } + } + } + free(output); + printf("... double check found %d hits\n", hits); + return; + } + printf("Skip manual check on composite query\n"); + return; +} + +ADIOS_SELECTION* getOutputSelection(mxml_node_t* queryNode) +{ + mxml_node_t* outputSelNode = mxmlFindElement(queryNode, queryNode, _gTagOutput, NULL, NULL, MXML_DESCEND); + + if (outputSelNode == NULL) { + return NULL; + } else { + return getSelFromSelectionNode(outputSelNode); + } +} + +int parseQueryXml(const char* xmlQueryFileName) +{ + int rank; + MPI_Comm_rank (MPI_COMM_WORLD, &rank); + + //adios_query_init(ADIOS_QUERY_METHOD_FASTBIT); + + + FILE * fp = fopen (xmlQueryFileName,"r"); + if (fp == NULL){ + printf("No xml query file %s\n", xmlQueryFileName); + return -1; + } + + fseek(fp, 0, SEEK_END); + long len = ftell(fp); + rewind(fp); + + if (len == 0) { + printf("No content in file %s.\n", xmlQueryFileName); + return -1; + } + + mxml_node_t* tree = mxmlLoadFile(NULL, fp, MXML_NO_CALLBACK); + fclose(fp); + + if (tree == NULL) { + printf("Invalid xml file: %d.\n", xmlQueryFileName); + return -1; + } + + ADIOS_FILE * f; + MPI_Comm comm_dummy = 0; // MPI_Comm is defined through adios_read.h + + adios_read_init_method(ADIOS_READ_METHOD_BP, comm_dummy, "verbose=2"); + + mxml_node_t* testsNode = mxmlFindElement(tree, tree, "tests", NULL, NULL, MXML_DESCEND); + + mxml_node_t* queryNode; // mxmlFindElement(testsNode, testsNode, _gTagQuery, NULL, NULL, MXML_DESCEND); + + + for (queryNode = mxmlFindElement(tree, tree, _gTagQuery, NULL, NULL, MXML_DESCEND); + queryNode != NULL; + queryNode = mxmlFindElement(queryNode, tree, _gTagQuery, NULL, NULL, MXML_DESCEND)) + + { + //printf("query: %s\n", queryNode->value.element.attrs[0].value); + mxml_value_t value = queryNode->value; + int i=0; + const char* bpFileName = NULL; + const char* queryName = NULL; + uint64_t batchSize = 0; + + + for (i = 0; i < value.element.num_attrs; i++) { + mxml_attr_t currAttr = value.element.attrs[i]; + if (strcasecmp(currAttr.name, _gAttrBPFile) == 0) { + bpFileName = currAttr.value; + } else if (strcasecmp(currAttr.name, _gAttrQueryName) == 0) { + queryName = currAttr.value; + } else if (strcasecmp(currAttr.name, _gAttrBatchSize) == 0) { + batchSize = atol(currAttr.value); + } + } + + if (bpFileName == 0) { + printf("missing data file in query.\n"); + return -1; + } + + f = adios_read_open_file (bpFileName, ADIOS_READ_METHOD_BP, comm_dummy); + if (f == NULL) { + printf("::%s\n", adios_errmsg()); + return -1; + } + + ADIOS_QUERY* q = constructQuery(queryNode, f, queryName, batchSize); + + ADIOS_SELECTION* outputBox = getOutputSelection(queryNode); + logReport(-1); // init timer + + //adios_query_set_method(q, ADIOS_QUERY_METHOD_FASTBIT); + int timestep = 0; + //ADIOS_SELECTION* noBox = 0; + while (timestep <= f->last_step) { + printf("\n ...... query=%s, %s, [TimeStep=%d of %d]\n",queryName, q->condition, timestep, f->last_step); + int64_t est = adios_query_estimate(q, timestep); + logTimeMillis(" estimated."); + printf("\n=> query %s: %s, \n\t estimated %ld hits on timestep: %d\n", queryName, q->condition, est, timestep); + ADIOS_SELECTION* currBatch = NULL; + int hasMore = 1; + while (hasMore > 0) { + hasMore = adios_query_evaluate(q, outputBox, timestep, batchSize, &currBatch); + logTimeMillis(" evaluated one batch."); + if (currBatch != NULL) { + printf("\n=> evaluated: %ld hits for %s\n", currBatch->u.points.npoints, q->condition); + } + if (currBatch != NULL) { + free (currBatch->u.points.points); + adios_selection_delete(currBatch); + } + } + logReport(0); + manualCheck(q, timestep); + logTimeMillis(" manual check done."); + timestep ++; + } + + recursive_free(q); + adios_read_close(f); + + //mxmlDelete(queryNode); + } + + mxmlDelete(testsNode); + mxmlDelete(tree); + + adios_read_finalize_method(ADIOS_READ_METHOD_BP); + adios_finalize(rank); +} + +/* +void testDefaultBoundBox(ADIOS_FILE* f, const char* varName1, const char* varName2, int timestep, const char* value1, const char* value2) +{ + printf("\n=============== testing default bound box (no box specified) for all ===========\n"); + ADIOS_SELECTION* noBox = 0; + + //const char* varName1 = "/Timestep_0/cells/X"; + enum ADIOS_PREDICATE_MODE op1 = ADIOS_LT; + //const char* value1 = "0.96874"; + + //const char* varName2 = "/Timestep_0/cells/Y"; + enum ADIOS_PREDICATE_MODE op2 = ADIOS_GT; + //const char* value2 = "0.96874"; + + ADIOS_QUERY* q1 = adios_query_create(f, noBox, varName1, op1, value1); + ADIOS_QUERY* q2 = adios_query_create(f, noBox, varName2, op2, value2); + + ADIOS_QUERY* q = adios_query_combine(q1, ADIOS_QUERY_OP_AND, q2); + + if (q != NULL) { + //int timestep = 0; + uint64_t max = 10000; + //int64_t hitSize = adios_query_evaluate(q, timestep, max); + + int64_t batchSize = 50; + while (1) { + ADIOS_SELECTION* currBatch = NULL; + int hasMore = adios_query_evaluate(q, noBox, timestep, batchSize, &currBatch); + adios_selection_delete(currBatch); + + if (hasMore <= 0) { + break; + } + } + + //fastbit_selection_free(q->_queryInternal); + adios_query_free(q); + } + + adios_query_free(q1); + adios_query_free(q2); + +} + +void testMixedIdxNoIdxCase() +{ + printf(" \n =========== testng on cases with mixed index/in-memory usage =========\n"); + + //here you go +} + +void testNoBoxOnSelection(ADIOS_FILE* f, const char* varName1, const char* lessThanValue, int timestep, enum ADIOS_PREDICATE_MODE op1) +{ + printf("\n=============== testing box in query but no bound box for selection ===========\n"); + + //uint64_t start1[] = {0, 0, 0}; + //uint64_t count1[] = {256, 1,32}; + //uint64_t count1[] = {56, 1,32}; + + ADIOS_SELECTION* noBox = NULL; + //ADIOS_SELECTION* box = adios_selection_boundingbox(3, start1, count1); + + + //enum ADIOS_PREDICATE_MODE op1 = ADIOS_LT; + //const char* value1 = "0.96874"; + + ADIOS_QUERY* q = adios_query_create(f, noBox, varName1, op1, lessThanValue); + + if (q != NULL) { + //int timestep = 0; + uint64_t max = 10000; + //int64_t hitSize = adios_query_evaluate(q, timestep, max); + + //int64_t estimated = adios_query_estimate(q); + //printf("estimated query result = %lld \n", estimated); + + int64_t batchSize = 50; + while (1) { + ADIOS_SELECTION* currBatch = NULL; + int hasMore = adios_query_evaluate(q, noBox, timestep, batchSize, &currBatch); + adios_selection_delete(currBatch); + + if (hasMore <= 0) { + break; + } + } + + adios_query_free(q); + } + +} + +void testOneBoundBox(ADIOS_FILE* f, const char* varName1, const char* value1, int timestep) +{ + printf("\n=============== testing one box specified) for all ===========\n"); + uint64_t start1[] = {0, 0, 0}; + uint64_t count1[] = {258, 34,34}; + ADIOS_SELECTION* box = adios_selection_boundingbox(3, start1, count1); + + + //const char* varName1 = "/Timestep_0/cells/X"; + enum ADIOS_PREDICATE_MODE op1 = ADIOS_LT; + //const char* value1 = "0.96874"; + + //const char* varName2 = "/Timestep_0/cells/Y"; + const char* varName2 = varName1; + enum ADIOS_PREDICATE_MODE op2 = ADIOS_GT; + const char* value2 = "0.96874"; + + ADIOS_QUERY* q1 = adios_query_create(f, box, varName1, op1, value1); + //ADIOS_QUERY* q2 = adios_query_create(f, varName2, box, op2, value2); + + //ADIOS_QUERY* q = adios_query_combine(q1, ADIOS_QUERY_OP_AND, q2); + + if (q1 != NULL) { + uint64_t max = 10000; + + //int64_t estimated = adios_query_estimate(q1); + //printf("estimated query result = %lld \n", estimated); + + int64_t batchSize = 50; + while (1) { + ADIOS_SELECTION* currBatch = NULL; + int hasMore = adios_query_evaluate(q1, box, timestep, batchSize, &currBatch); + adios_selection_delete(currBatch); + + if (hasMore <= 0) { + break; + } + } + + //fastbit_selection_free(q->_queryInternal); + adios_query_free(q1); + } + + adios_selection_delete(box); + +} + +void testTwoBoundBoxes(ADIOS_FILE* f, const char* varName1, const char* value1, const char* value2, int timestep) +{ + printf("\n=============== testing two box specified) for all ===========\n"); + + + uint64_t start1[] = {33, 0, 0}; + uint64_t count1[] = {32, 34,34}; + ADIOS_SELECTION* box1 = adios_selection_boundingbox(3, start1, count1); + + uint64_t start2[] = {65, 0, 0}; + uint64_t count2[] = {32, 34,34}; + ADIOS_SELECTION* box2 = adios_selection_boundingbox(3, start2, count2); + + + //const char* varName1 = "/Timestep_0/cells/X"; + enum ADIOS_PREDICATE_MODE op1 = ADIOS_LT; + //const char* value1 = "0.96874"; + + //const char* varName2 = "/Timestep_0/cells/Y"; + //const char* varName2 = varName1; + enum ADIOS_PREDICATE_MODE op2 = ADIOS_GT; + //const char* value2 = "0.96874"; + + ADIOS_QUERY* q1 = adios_query_create(f, box1, varName1, op1, value1); + ADIOS_QUERY* q2 = adios_query_create(f, box2, varName1, op2, value2); + + ADIOS_QUERY* q = adios_query_combine(q1, ADIOS_QUERY_OP_AND, q2); + + if (q != NULL) { + uint64_t max = 10000; + + //int64_t estimated = adios_query_estimate(q); + //printf("estimated query result = %lld \n", estimated); + + int64_t batchSize = 50; + while (1) { + ADIOS_SELECTION* currBatch = NULL; + int hasMore = adios_query_evaluate(q, box1, timestep, batchSize, &currBatch); + adios_selection_delete(currBatch); + + if (hasMore <= 0) { + break; + } + } + + //fastbit_selection_free(q->_queryInternal); + adios_query_free(q); + } + adios_query_free(q1); + adios_query_free(q2); + + adios_selection_delete(box1); + adios_selection_delete(box2); + +} + +void testUseOneWriteBlockSimpleLessThan(ADIOS_FILE* f, int blockNum, const char* varName1, const char* lessThanValue1, int timestep) +{ + printf("\n=============== testing one block for simple query: %s < %s at timestep: %d ===========\n", varName1, lessThanValue1, timestep); + + ADIOS_SELECTION* box = adios_selection_writeblock(blockNum); + + //const char* varName1 = "/Timestep_0/cells/X"; + enum ADIOS_PREDICATE_MODE op1 = ADIOS_LT; + // const char* value1 = "0.96874"; + + ADIOS_QUERY* q = adios_query_create(f, box, varName1, op1, lessThanValue1); + + if (q!= NULL) { + //int timestep = 0; + uint64_t max = 10000; + //int64_t hitSize = adios_query_evaluate(q, timestep, max); + + int64_t batchSize = 50; + + //printf("time steps for variable is: %d \n",q->_var->nsteps); + //int i=0; + //for (i=0; i_var->nsteps; i++) { + // adios_query_set_timestep(i); + + //int64_t estimated = adios_query_estimate(q); + //printf("estimated query result = %lld \n", estimated); + + while (1) { + ADIOS_SELECTION* currBatch = NULL; + int hasMore = adios_query_evaluate(q, box, timestep, batchSize, &currBatch); + adios_selection_delete(currBatch); + + if (hasMore <= 0) { + break; + } + } + //} + + //fastbit_selection_free(q->_queryInternal); + } + + adios_query_free(q); + adios_selection_delete(box); +} + +void testUseOneWriteBlock(ADIOS_FILE* f, int blockNum, const char* varName1, const char* varName2) +{ + printf("\n=============== testing one block for all ===========\n"); + + ADIOS_SELECTION* box = adios_selection_writeblock(blockNum); + + //const char* varName1 = "/Timestep_0/cells/X"; + enum ADIOS_PREDICATE_MODE op1 = ADIOS_LT; + const char* value1 = "0.96874"; + + //const char* varName2 = "/Timestep_0/cells/Y"; + enum ADIOS_PREDICATE_MODE op2 = ADIOS_GT; + const char* value2 = "0.96874"; + + ADIOS_QUERY* q1 = adios_query_create(f, box, varName1, op1, value2); + ADIOS_QUERY* q2 = adios_query_create(f, box, varName2, op2, value2); + + ADIOS_QUERY* q = adios_query_combine(q1, ADIOS_QUERY_OP_AND, q2); + + if (q!= NULL) { + int timestep = 0; + uint64_t max = 10000; + //int64_t hitSize = adios_query_evaluate(q, timestep, max); + + int64_t batchSize = 50; + + int i = 0; + printf("time steps for variable is: %d \n",q1->varinfo->nsteps); + for (i=0; ivarinfo->nsteps; i++) { + + while (1) { + ADIOS_SELECTION* currBatch = NULL; + int hasMore = adios_query_evaluate(q, box, timestep, batchSize, &currBatch); + adios_selection_delete(currBatch); + + if (hasMore <= 0) { + break; + } + } + + } + + //fastbit_selection_free(q->_queryInternal); + adios_query_free(q); + } + adios_query_free(q1); + adios_query_free(q2); + + adios_selection_delete(box); +} +*/ +/* +void doubleCheckWithIdxOnBlock(ADIOS_FILE* dataFile, const char* basefileName, int blockNum, ADIOS_VARINFO* v, int timestep, double lessThanVal) +{ + ADIOS_FILE* idxFile = fastbit_adios_util_getFastbitIndexFileToRead(basefileName, 0); + + if (idxFile == 0) { + printf("No such file.\n"); + return; + } + + char bmsVarName[100]; + char keyVarName[100]; + char offsetName[100]; + + sprintf(bmsVarName, "bms-%d-%d-%d", v->varid, timestep, blockNum); + sprintf(keyVarName, "key-%d-%d-%d", v->varid, timestep, blockNum); + sprintf(offsetName, "offset-%d-%d-%d", v->varid, timestep, blockNum); + + ADIOS_VARINFO * bmsV = adios_inq_var (idxFile, bmsVarName); + ADIOS_VARINFO * keyV = adios_inq_var (idxFile, keyVarName); + ADIOS_VARINFO * offsetV = adios_inq_var (idxFile, offsetName); + + int64_t bms_byte_size = adios_type_size (bmsV->type, bmsV->value); + int64_t key_byte_size = adios_type_size (keyV->type, keyV->value); + int64_t offset_byte_size = adios_type_size (offsetV->type, offsetV->value); + + void *bms = malloc((bmsV->dims[0])*bms_byte_size); + void *key = malloc((keyV->dims[0])*key_byte_size); + void *offset = malloc(offsetV->dims[0]*offset_byte_size); + + uint64_t start[] = {0}; + uint64_t count_bms[] = {bmsV->dims[0]}; + uint64_t count_key[] = {keyV->dims[0]}; + uint64_t count_offset[] = {offsetV->dims[0]}; + + ADIOS_SELECTION* bmsSel = adios_selection_boundingbox(bmsV->ndim, start, count_bms); + ADIOS_SELECTION* keySel = adios_selection_boundingbox(keyV->ndim, start, count_key); + ADIOS_SELECTION* offsetSel = adios_selection_boundingbox(offsetV->ndim, start, count_offset); + + // has one timestep in idx file + adios_schedule_read(idxFile, bmsSel, bmsVarName, 0, 1, bms); + adios_schedule_read(idxFile, keySel, keyVarName, 0, 1, key); + adios_schedule_read(idxFile, offsetSel, offsetName, 0, 1, offset); + + adios_perform_reads(idxFile,1); + + uint64_t nk = keyV->dims[0]; + uint64_t no = offsetV->dims[0]; + printf(" bms/key/offset data: length=%lld/%lld/%lld\n", bmsV->dims[0], keyV->dims[0], offsetV->dims[0]); + + printData(bms, bmsV->type, bmsV->dims[0]); + + adios_selection_delete(bmsSel); + adios_free_varinfo(bmsV); + adios_read_close(idxFile); + + ADIOS_SELECTION* box = adios_selection_writeblock(blockNum); + + adios_inq_var_blockinfo(dataFile, v); + uint64_t blockSize = getBlockSize(v, blockNum); + void* data = malloc(adios_type_size(v->type, v->value)*blockSize); + adios_schedule_read_byid(dataFile, box, v->varid, timestep, 1, data); + adios_perform_reads(dataFile,1); + + fastbit_iapi_register_array("testme", getFastbitDataType(v->type), data, blockSize); + + int ierr = fastbit_iapi_attach_index ("testme", key, nk, offset, no, bms, mybmreader); + if (ierr < 0) { + printf(" reattaching index failed ierr = %ld\n", ierr); + } else { + FastBitSelectionHandle h = fastbit_selection_osr("testme", FastBitCompareLess, lessThanVal); + int64_t hits = fastbit_selection_evaluate(h); + printf(" double check, hits = %ld\n", hits); + } + free(bms); + free(key); + free(offset); + +} +*/ + +void usage(char* prog) +{ + printf("Usage: %s [query]\n e.g. ./test_v1 my.bp \"x1 > 10\" \n", prog); +} + +int main (int argc, char ** argv) +{ + + parseQueryXml("query.xml"); + return 0; + + +#if 0 + + if (argc < 2) { + usage(argv[0]); + return 1; + } + + ADIOS_FILE * f; + MPI_Comm comm_dummy = 0; /* MPI_Comm is defined through adios_read.h */ + + f = adios_read_open_file (argv[1], ADIOS_READ_METHOD_BP, comm_dummy); + if (f == NULL) { + printf ("::%s\n", adios_errmsg()); + return -1; + } + + const char* varName1 = "/Timestep_0/cells/X"; + const char* varName2 = "/Timestep_0/cells/Y"; + + if (argc > 2) { + varName1 = argv[2]; + } + + + if (argc > 3) { + int blockNum = 0; // relative to timestep + int timestep = 1; + const char* lessThanVal = argv[3]; + if (argc > 4) { // e.g. ./query_fastbit data/record20110203.bp "/var/v1" 1.000 2 + timestep = atoi(argv[4]); + } + + /* + if (argc > 5) { + printf("arg: dataFile var1 value timestep var2\n"); + varName2 = argv[5]; + const char* greaterThanVal = argv[6]; + + testDefaultBoundBox(f, varName1, varName2, timestep, lessThanVal, greaterThanVal); + } + */ + + //testUseOneWriteBlockSimpleLessThan(f, blockNum, varName1, lessThanVal, timestep); + enum ADIOS_PREDICATE_MODE lessT = ADIOS_LT; + testNoBoxOnSelection(f, varName1, lessThanVal, timestep, lessT); + //testNoBoxOnSelection(f, varName1, lessThanVal, timestep, lessT); + enum ADIOS_PREDICATE_MODE greaterT = ADIOS_GT; + testNoBoxOnSelection(f, varName1, lessThanVal, timestep, greaterT); + //testNoBoxOnSelection(f, varName1, lessThanVal, timestep, greaterT); + //testOneBoundBox(f, varName1, lessThanVal, timestep); + + //const char* greaterThanVal = argv[5]; + //testTwoBoundBoxes(f, varName1, lessThanVal, greaterThanVal, timestep); + //} + + /* + ADIOS_VARINFO* v = adios_inq_var(f, varName1); + doubleCheckWithIdxOnBlock(f, argv[1], blockNum, v, timestep, atof(lessThanVal)); + + //uint64_t point[] = {33,31,31}; + //printf("testing global block #: %d\n", getGlobalBlockNumForPoint(v,point,timestep)); + + adios_free_varinfo(v); + */ + } + + //testNoBoxOnSelection(f, varName1); + //testMultiBoundBox(f, varName1, varName1); + //testAllDifferentBoundBoxes(f, varName1, varName2); + //testUseOneWriteBlock(f, 0, varName1, varName2); + + + //testOneBoundBoxForAllVar(f, varName1, varName2); + //testOnePointList(f, varName1, varName2); + + adios_read_close(f); + return 1; +#endif +} diff --git a/tests/libs/adios/tests/C/query/query-xmls/DS-1D/query0.xml b/tests/libs/adios/tests/C/query/query-xmls/DS-1D/query0.xml new file mode 100644 index 0000000000..bf9570c604 --- /dev/null +++ b/tests/libs/adios/tests/C/query/query-xmls/DS-1D/query0.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/tests/libs/adios/tests/C/query/query-xmls/DS-1D/query1.xml b/tests/libs/adios/tests/C/query/query-xmls/DS-1D/query1.xml new file mode 100644 index 0000000000..2cde58bd7f --- /dev/null +++ b/tests/libs/adios/tests/C/query/query-xmls/DS-1D/query1.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/tests/libs/adios/tests/C/query/query-xmls/DS-2D/query0.xml b/tests/libs/adios/tests/C/query/query-xmls/DS-2D/query0.xml new file mode 100644 index 0000000000..9521c65f5f --- /dev/null +++ b/tests/libs/adios/tests/C/query/query-xmls/DS-2D/query0.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/tests/libs/adios/tests/C/query/query-xmls/DS-2D/query1.xml b/tests/libs/adios/tests/C/query/query-xmls/DS-2D/query1.xml new file mode 100644 index 0000000000..c261844647 --- /dev/null +++ b/tests/libs/adios/tests/C/query/query-xmls/DS-2D/query1.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/tests/libs/adios/tests/C/query/query-xmls/DS-3D/query-wb0.xml b/tests/libs/adios/tests/C/query/query-xmls/DS-3D/query-wb0.xml new file mode 100644 index 0000000000..68d5fc1b21 --- /dev/null +++ b/tests/libs/adios/tests/C/query/query-xmls/DS-3D/query-wb0.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/tests/libs/adios/tests/C/query/query-xmls/DS-3D/query-wb1.xml b/tests/libs/adios/tests/C/query/query-xmls/DS-3D/query-wb1.xml new file mode 100644 index 0000000000..0135499f61 --- /dev/null +++ b/tests/libs/adios/tests/C/query/query-xmls/DS-3D/query-wb1.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/tests/libs/adios/tests/C/query/query-xmls/DS-3D/query0.xml b/tests/libs/adios/tests/C/query/query-xmls/DS-3D/query0.xml new file mode 100644 index 0000000000..94ec70dc8a --- /dev/null +++ b/tests/libs/adios/tests/C/query/query-xmls/DS-3D/query0.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/tests/libs/adios/tests/C/query/query-xmls/DS-3D/query1.xml b/tests/libs/adios/tests/C/query/query-xmls/DS-3D/query1.xml new file mode 100644 index 0000000000..99e2e66a20 --- /dev/null +++ b/tests/libs/adios/tests/C/query/query-xmls/DS-3D/query1.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/libs/adios/tests/C/query/query-xmls/DS-particle/DS-particle-query0.xml b/tests/libs/adios/tests/C/query/query-xmls/DS-particle/DS-particle-query0.xml new file mode 100644 index 0000000000..5e00496b33 --- /dev/null +++ b/tests/libs/adios/tests/C/query/query-xmls/DS-particle/DS-particle-query0.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/libs/adios/tests/C/query/query-xmls/DS-particle/DS-particle-query1.xml b/tests/libs/adios/tests/C/query/query-xmls/DS-particle/DS-particle-query1.xml new file mode 100644 index 0000000000..4bf2bc7672 --- /dev/null +++ b/tests/libs/adios/tests/C/query/query-xmls/DS-particle/DS-particle-query1.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/libs/adios/tests/C/query/query-xmls/DS-unevenpg/query0.xml b/tests/libs/adios/tests/C/query/query-xmls/DS-unevenpg/query0.xml new file mode 100644 index 0000000000..9521c65f5f --- /dev/null +++ b/tests/libs/adios/tests/C/query/query-xmls/DS-unevenpg/query0.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/tests/libs/adios/tests/C/query/query-xmls/DS-unevenpg/query1.xml b/tests/libs/adios/tests/C/query/query-xmls/DS-unevenpg/query1.xml new file mode 100644 index 0000000000..c261844647 --- /dev/null +++ b/tests/libs/adios/tests/C/query/query-xmls/DS-unevenpg/query1.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/tests/libs/adios/tests/CMakeLists.txt b/tests/libs/adios/tests/CMakeLists.txt new file mode 100644 index 0000000000..acf45ab435 --- /dev/null +++ b/tests/libs/adios/tests/CMakeLists.txt @@ -0,0 +1,29 @@ +set(SUITEDIR suite) +if(BUILD_WRITE) + if(BUILD_FORTRAN) + add_subdirectory(C) + add_subdirectory(Fortran) + add_subdirectory(genarray) + add_subdirectory(bp_read) + add_subdirectory(${SUITEDIR}) + else(BUILD_FORTRAN) + add_subdirectory(C) + add_subdirectory(bp_read) + add_subdirectory(${SUITEDIR}) + endif(BUILD_FORTRAN) +endif(BUILD_WRITE) + +#find_library(ADIOS_LIB adios ${PROJECT_BINARY_DIR}/src) +#if(${ADIOS_LIB}-NOTFOUND) + # message(STATUS "cannot find adios.a in ${PROJECT_BINARY_DIR}/tests makefile") +#endif(${ADIOS_LIB}-NOTFOUND) + +#if(BUILD_FORTRAN) +# find_library(ADIOSREAD_LIB NAMES adiosreadf PATHS ${PROJECT_BINARY_DIR}/src) +# find_library(ADIOSREAD_V1_LIB NAMES adiosreadf_v1 PATHS ${PROJECT_BINARY_DIR}/src) +#else(BUILD_FORTRAN) +# find_library(ADIOSREAD_LIB adiosread ${PROJECT_BINARY_DIR}/src) +# if(${ADIOSREAD_LIB}-NOTFOUND) +# message(STATUS "cannot find adiosread.a in ${PROJECT_BINARY_DIR}/tests makefile") +# endif(${ADIOSREAD_LIB}-NOTFOUND) +#endif(BUILD_FORTRAN) diff --git a/tests/libs/adios/tests/Fortran/CMakeLists.txt b/tests/libs/adios/tests/Fortran/CMakeLists.txt new file mode 100644 index 0000000000..f389eb1664 --- /dev/null +++ b/tests/libs/adios/tests/Fortran/CMakeLists.txt @@ -0,0 +1,9 @@ +include_directories(${PROJECT_BINARY_DIR}/src) +include_directories(${PROJECT_SOURCE_DIR}/tests/Fortran) +link_directories(${PROJECT_BINARY_DIR}/tests/Fortran) + +add_executable(adios_test_f adios_test_f.F90) +target_link_libraries(adios_test_f adiosf ${ADIOSLIB_LDADD}) +set_target_properties(adios_test_f PROPERTIES COMPILE_FLAGS "${ADIOSLIB_CPPFLAGS} ${ADIOSLIB_CFLAGS}") + +file(COPY config_fortran.xml DESTINATION ${PROJECT_BINARY_DIR}/tests/Fortran) diff --git a/tests/libs/adios/tests/Fortran/Makefile.am b/tests/libs/adios/tests/Fortran/Makefile.am new file mode 100644 index 0000000000..476efb8a5d --- /dev/null +++ b/tests/libs/adios/tests/Fortran/Makefile.am @@ -0,0 +1,24 @@ +AM_CPPFLAGS = $(all_includes) +AM_CPPFLAGS += -I$(top_builddir)/src + +AUTOMAKE_OPTIONS = no-dependencies + +all-local: + test "$(srcdir)" = "$(builddir)" || cp $(srcdir)/*.xml $(builddir) + +noinst_PROGRAMS=adios_test_f + +#adios_test_f_SOURCES = adios_test_f.F90 adios_module.F90 +adios_test_f_SOURCES = adios_test_f.F90 +adios_test_f_CPPFLAGS = $(AM_CPPFLAGS) $(ADIOSLIB_CPPFLAGS) +adios_test_f_CFLAGS = $(ADIOSLIB_CFLAGS) +adios_test_f_LDFLAGS = $(ADIOSLIB_LDFLAGS) +adios_test_f_LDADD = $(top_builddir)/src/libadiosf.a $(ADIOSLIB_LDADD) + +FC=$(MPIFC) + +FCLINK = \ + $(LIBTOOL) --mode=link --tag F77 $(FC) \ + $(AM_FCFLAGS) $(FCFLAGS) $(LDFLAGS) -o $@ + +EXTRA_DIST = config_fortran.xml diff --git a/tests/libs/adios/tests/Fortran/adios_test_f.F90 b/tests/libs/adios/tests/Fortran/adios_test_f.F90 new file mode 100644 index 0000000000..84e7d73859 --- /dev/null +++ b/tests/libs/adios/tests/Fortran/adios_test_f.F90 @@ -0,0 +1,199 @@ +! +! ADIOS is freely available under the terms of the BSD license described +! in the COPYING file in the top level directory of this source distribution. +! +! Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. +! + +program adios_test + use adios_write_mod + implicit none + include 'mpif.h' + character (len=200) :: group + character (len=200) :: filename + integer :: group_comm + integer :: ierr + integer :: rank + + ! write vars + integer :: small_int + integer*8 :: big_int + real :: small_real + real*8 :: big_real + integer :: z_size + real :: z_array (2) + + ! read vars + integer :: r_small_int + integer*8 :: r_big_int + real :: r_small_real + real*8 :: r_big_real + integer :: r_z_size + real :: r_z_array (2) + + group = "restart" + filename = "restart.bp" + small_int = 10 + big_int = 42949672 + small_real = 0.3 + big_real = 0.0000000000004 + z_size = 2 + z_array (1) = 11.1 + z_array (2) = 22.2 + r_z_size = 2 + + call MPI_Init (ierr) + call MPI_Comm_dup (MPI_COMM_WORLD, group_comm, ierr) + call MPI_Comm_rank (MPI_COMM_WORLD, rank, ierr) + + print '("rank=",i0," group_comm=",i0," ierr=",i0)', rank, group_comm, ierr + + call adios_allocate_buffer (10, ierr); + call adios_init ("config_fortran.xml", group_comm, ierr) + call test_write (group, filename, group_comm, small_int, big_int, small_real, big_real, z_size, z_array) + + call MPI_Barrier (MPI_COMM_WORLD, ierr) +write (*,*) "write completed" + + call test_read (group, filename, group_comm, r_small_int, r_big_int, r_small_real, r_big_real, r_z_size, r_z_array) + + if (small_int /= r_small_int .or. big_int /= r_big_int .or. & + & small_real /= r_small_real .or. big_real /= r_big_real .or.& + z_size /= r_z_size) then + write (*,*) 'rank ', rank, ' read did not match write' + else + write (*,*) 'rank ', rank, ' read matched write' + endif + + call MPI_Barrier (MPI_COMM_WORLD, ierr) + + call adios_finalize (rank, ierr) + + call MPI_Finalize (ierr) +end program adios_test + +subroutine test_write (group, filename, group_comm, small_int, big_int, small_real, big_real, a_size, a_array) + implicit none + include 'mpif.h' + character (*), intent(in) :: group + character (*), intent(in) :: filename + integer, intent (in) :: group_comm + integer, intent(in) :: small_int + integer*8, intent(in) :: big_int + real, intent(in) :: small_real + real*8, intent(in) :: big_real + integer, intent(in) :: a_size + real, intent(in) :: a_array (a_size) + + integer :: a_size2 + real :: a_array2 (a_size, 10) + + integer :: istep1 + integer :: istep2 + integer :: istep3 + + character(len=5) :: abcstr = 'abc' + + integer*8 :: handle + integer*8 :: total_size + integer :: err + integer*8 :: size + integer :: i,j + + a_size2 = 10 + + size = 900 * 1024 + + istep1 = 11 + istep2 = 22 + istep3 = 33 + do j=1,10 + do i=1,a_size + a_array2(i,j) = 1.0*i + (j-1)*a_size + end do + end do + size = 4 + 8 + 4 + 8 + 4 + 4 + a_size * 4 + a_size * 10 * 4 + 4 + 4 + 4 + + call adios_open (handle, group, filename, "w", group_comm, err) + + call adios_group_size (handle, size, total_size, err) + + call adios_write (handle, "small_int", small_int, err) + call adios_write (handle, "big_int", big_int, err) + call adios_write (handle, "small_real", small_real, err) + call adios_write (handle, "big_real", big_real, err) + call adios_write (handle, "ze0size", a_size, err) + call adios_write (handle, "ze1size", a_size2, err) + call adios_write (handle, "zelectron0", a_array, err) + call adios_write (handle, "zelectron1", a_array2, err) + + call adios_write (handle, "istep1", istep1, err) + call adios_write (handle, "istep2", istep2, err) + call adios_write (handle, "istep3", istep3, err) + + ! When writing out a string type variable, we need to add a char(0) + ! ADIOS expects here a C string + !call adios_write (handle, "str", trim("abc")//char(0), err) + call adios_write (handle, "str_var", abcstr, err) + call adios_write (handle, "str_const", "abc", err) + call adios_write (handle, "str_arr", abcstr, err) + + call adios_close (handle, err) + +end subroutine test_write + +subroutine test_read (group, filename, group_comm, small_int, big_int, small_real, big_real, a_size, a_array) + implicit none + include 'mpif.h' + character (*), intent(in) :: group + character (*), intent(in) :: filename + integer, intent (in) :: group_comm + integer, intent(out) :: small_int + integer*8, intent(out) :: big_int + real, intent(out) :: small_real + real*8, intent(out) :: big_real + integer, intent(inout) :: a_size + real, intent(out) :: a_array (a_size) + + integer*8 :: group_size = 0 + integer*8 :: total_size + integer :: err + + integer :: istep1 + integer :: istep2 + integer :: istep3 + + integer*8 :: handle + integer*8 :: buffer_size + + character (len=40) :: str + + str = '1234567890123456789012345678901234567890' + + istep1 = 11 + istep2 = 22 + istep3 = 33 + + call adios_open (handle, group, filename, "r", group_comm, err) + + call adios_group_size (handle, group_size, total_size, err) + buffer_size = 4 + call adios_read (handle, "small_int", small_int, buffer_size, err) + buffer_size = 8 + call adios_read (handle, "big_int", big_int, buffer_size, err) + buffer_size = 4 + call adios_read (handle, "small_real", small_real, buffer_size, err) + buffer_size = 8 + call adios_read (handle, "big_real", big_real, buffer_size, err) + buffer_size = 4 + call adios_read (handle, "ze0size", a_size, buffer_size, err) + buffer_size = 4 * a_size + call adios_read (handle, "zelectron0", a_array, buffer_size, err) + + !call adios_read (handle, "str", str, err) + + call adios_close (handle, err) + + !write (*,*) "read str: ", str + +end subroutine test_read diff --git a/tests/libs/adios/tests/Fortran/config_fortran.xml b/tests/libs/adios/tests/Fortran/config_fortran.xml new file mode 100644 index 0000000000..c8f97d8186 --- /dev/null +++ b/tests/libs/adios/tests/Fortran/config_fortran.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/libs/adios/tests/Makefile.am b/tests/libs/adios/tests/Makefile.am new file mode 100644 index 0000000000..17cd92dec9 --- /dev/null +++ b/tests/libs/adios/tests/Makefile.am @@ -0,0 +1,8 @@ +SUITEDIR=suite +if BUILD_WRITE +if BUILD_FORTRAN +SUBDIRS=C Fortran genarray bp_read ${SUITEDIR} +else +SUBDIRS=C bp_read ${SUITEDIR} +endif +endif diff --git a/tests/libs/adios/tests/bp_read/CMakeLists.txt b/tests/libs/adios/tests/bp_read/CMakeLists.txt new file mode 100644 index 0000000000..fc094a5d0a --- /dev/null +++ b/tests/libs/adios/tests/bp_read/CMakeLists.txt @@ -0,0 +1,39 @@ +include_directories(${PROJECT_SOURCE_DIR}/tests/bp_read) +include_directories(${PROJECT_SOURCE_DIR}/src/public) +include_directories(${PROJECT_SOURCE_DIR}/src) +include_directories(${PROJECT_BINARY_DIR}/src) +link_directories(${PROJECT_BINARY_DIR}/tests/bp_read) + +set(genbp_CPPFLAGS "${ADIOSLIB_CPPFLAGS}") +set(genbp_CFLAGS "${ADIOSLIB_CFLAGS}") + +set(bp_read_c_CPPFLAGS "-DADIOS_USE_READ_API_1 ${ADIOSLIB_CPPFLAGS}") +set(bp_read_c_CFLAGS "${ADIOSLIB_CFLAGS}") + +add_executable(genbp genbp.c) +target_link_libraries(genbp adios adiosread ${ADIOSLIB_LDADD} ${MPI_C_LIBRARIES}) +set_target_properties(genbp PROPERTIES COMPILE_FLAGS "${genbp_CPPFLAGS} ${genbp_CFLAGS} ${MPI_C_COMPILE_FLAGS}") +if(MPI_LINK_FLAGS) + set_target_properties(genbp PROPERTIES LINK_FLAGS "${MPI_C_LINK_FLAGS}") +endif() + +add_executable(bp_read_c bp_read_c.c) +target_link_libraries(bp_read_c adiosread ${ADIOSREADLIB_LDADD} ${MPI_C_LIBRARIES}) +set_target_properties(bp_read_c PROPERTIES COMPILE_FLAGS "${bp_read_c_CPPFLAGS} ${bp_read_c_CFLAGS}") + +if(BUILD_FORTRAN) + add_executable(bp_read_f bp_read_f.F90) + target_link_libraries(bp_read_f adiosreadf ${ADIOSREADLIB_LDADD}) + set(bp_read_f_CPPFLAGS "${ADIOSLIB_CPPFLAGS}") + set(bp_read_f_CFLAGS "${ADIOSLIB_CFLAGS}") + set_target_properties(bp_read_f PROPERTIES COMPILE_FLAGS "${bp_read_f_CPPFLAGS} ${bp_read_f_CFLAGS}") + + add_executable(bp_read_f_v1 bp_read_f_v1.F90) + target_link_libraries(bp_read_f_v1 adiosreadf_v1 ${ADIOSREADLIB_LDADD}) + set(bp_read_f_v1_CPPFLAGS "${ADIOSLIB_CPPFLAGS}") + set(bp_read_f_v1_CFLAGS "${ADIOSLIB_CFLAGS}") + set_target_properties(bp_read_f_v1 PROPERTIES COMPILE_FLAGS "${bp_read_f_v1_CPPFLAGS} ${bp_read_f_v1_CFLAGS}") + +endif(BUILD_FORTRAN) + +file(COPY testbp_c.xml DESTINATION ${PROJECT_BINARY_DIR}/tests/bp_read) diff --git a/tests/libs/adios/tests/bp_read/Makefile.am b/tests/libs/adios/tests/bp_read/Makefile.am new file mode 100644 index 0000000000..0011a8b112 --- /dev/null +++ b/tests/libs/adios/tests/bp_read/Makefile.am @@ -0,0 +1,57 @@ +AM_CPPFLAGS = $(all_includes) +AM_CPPFLAGS += -I$(top_builddir)/src -I$(top_srcdir)/src/public + +AUTOMAKE_OPTIONS = no-dependencies + +all-local: + test "$(srcdir)" = "$(builddir)" || cp $(srcdir)/*.xml $(builddir) + +if BUILD_FORTRAN +noinst_PROGRAMS=genbp bp_read_f bp_read_f_v1 bp_read_c +else +noinst_PROGRAMS=genbp bp_read_c +endif + +# read_coords read_phi read_parts_global read_gena read_gena_pncd read_pixie_all + +genbp_SOURCES = genbp.c +genbp_CPPFLAGS = $(AM_CPPFLAGS) $(ADIOSLIB_CPPFLAGS) +genbp_CFLAGS = $(ADIOSLIB_CFLAGS) +genbp_LDADD = $(top_builddir)/src/libadios.a $(top_builddir)/src/libadiosread.a $(ADIOSLIB_LDADD) +genbp_LDFLAGS = $(ADIOSLIB_LDFLAGS) + +if BUILD_FORTRAN +bp_read_f_SOURCES = bp_read_f.F90 +bp_read_f_CPPFLAGS = $(AM_CPPFLAGS) $(ADIOSLIB_CPPFLAGS) +bp_read_f_CFLAGS = $(ADIOSLIB_CFLAGS) +bp_read_f_LDADD = $(top_builddir)/src/libadiosreadf.a $(ADIOSREADLIB_LDADD) +bp_read_f_LDFLAGS = $(ADIOSREADLIB_LDFLAGS) + +bp_read_f_v1_SOURCES = bp_read_f_v1.F90 +bp_read_f_v1_CPPFLAGS = $(AM_CPPFLAGS) $(ADIOSLIB_CPPFLAGS) +bp_read_f_v1_CFLAGS = $(ADIOSLIB_CFLAGS) +bp_read_f_v1_LDADD = $(top_builddir)/src/libadiosreadf_v1.a $(ADIOSREADLIB_LDADD) +bp_read_f_v1_LDFLAGS = $(ADIOSREADLIB_LDFLAGS) +endif + +bp_read_c_SOURCES = bp_read_c.c +bp_read_c_CPPFLAGS = -DADIOS_USE_READ_API_1 $(AM_CPPFLAGS) $(ADIOSLIB_CPPFLAGS) +bp_read_c_CFLAGS = $(ADIOSLIB_CFLAGS) +bp_read_c_LDADD = $(top_builddir)/src/libadiosread.a $(ADIOSREADLIB_LDADD) +bp_read_c_LDFLAGS = $(ADIOSREADLIB_LDFLAGS) + +FC=$(MPIFC) +CC=$(MPICC) + +FCLINK = \ + $(LIBTOOL) --mode=link --tag F77 $(FC) \ + $(AM_FCFLAGS) $(FCFLAGS) $(LDFLAGS) -o $@ + +if BUILD_FORTRAN +CLEANFILES = bp_read_c bp_read_f genbp read_coords read_phi read_parts_global +else +CLEANFILES = bp_read_c genbp read_coords read_phi read_parts_global +endif + +EXTRA_DIST = testbp_c.xml + diff --git a/tests/libs/adios/tests/bp_read/README b/tests/libs/adios/tests/bp_read/README new file mode 100644 index 0000000000..3dcdb6e99f --- /dev/null +++ b/tests/libs/adios/tests/bp_read/README @@ -0,0 +1,3 @@ +test.py + python routines used to test the correctness of bp read APIs + for both C and Fortran routines diff --git a/tests/libs/adios/tests/bp_read/bp_read_c.c b/tests/libs/adios/tests/bp_read/bp_read_c.c new file mode 100644 index 0000000000..5ef9867ed3 --- /dev/null +++ b/tests/libs/adios/tests/bp_read/bp_read_c.c @@ -0,0 +1,192 @@ +/* + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + */ + +#include +#include +#include +#include "mpi.h" +#include "adios_read.h" + +#define PRINTDIMS(ndim, dims, ivar) if (ndim==0) \ + printf("\tscalar\n"); \ + else { \ + printf("\t%dD variable: [%lld", ndim, dims[0]); \ + for (ivar=1; ivartype); + printf("%s:\n\thas timesteps: %s\n\ttype: %s\n", + "int_1D", (vi->timedim > -1 ? "yes" : "no"), type_str); + PRINTDIMS(vi->ndim, vi->dims, i) + size[0] = 1; + start[0] = 0; + adios_read_var (gp, "int_1D", start, size, &nvar); + printf("\tfirst element value: %d\n",(nvar)); + free(vi); + + + /* variable int_2D */ + vi = adios_inq_var (gp, "int_2D"); + if (vi == NULL) { + int retval = adios_errno; + fprintf(stderr, "Error: %s\n", adios_errmsg()); + adios_fclose(fp); + adios_gclose(gp); + exit(retval); + } + + type_str = adios_type_to_string (vi->type); + printf("%s:\n\thas timesteps: %s\n\ttype: %s\n", + "int_2D", (vi->timedim > -1 ? "yes" : "no"), type_str); + PRINTDIMS(vi->ndim, vi->dims, i) + start[0]=0; + start[1]=0; + size[0]=10; + size[1]=2; + var = malloc (sizeof(int) * size[0]*size[1]); + + // time step should be no less than zero + // vnamelist[14] is not written at time step 0 + // so the function returns as error + adios_read_var (gp, "int_2D", start, size, var); + printf("\tslice (%lld:%lld, %lld:%lld) = ", + start[0], start[0]+size[0]-1, + start[1], start[1]+size[1]-1); + k=0; + for (j=0;jtype); + printf("%s:\n\thas timesteps: %s\n\ttype: %s\n", + "int_3D", (vi->timedim > -1 ? "yes" : "no"), type_str); + PRINTDIMS(vi->ndim, vi->dims, i) + + start[0]=0; + start[1]=0; + start[2]=0; + size[0]=2; + size[1]=5; + size[2]=3; + var = malloc ( sizeof(int) * size[0]*size[1]*size[2]); + adios_read_var (gp, "int_3D", start, size, var); + printf("\t[%lld:%lld, %lld:%lld, %lld:%lld]", + start[0], start[0]+size[0]-1, + start[1], start[1]+size[1]-1, + start[2], start[2]+size[2]-1 + ); + k=0; + for (nvar=0;nvar +#include +#include +#include +#include + +// mpi +#include "mpi.h" + +#include "adios.h" + +int main (int argc, char ** argv) +{ + char * type_name = "testbp"; + char * filename = "testbp_c.bp"; + int64_t io_handle; // io handle + MPI_Comm comm = MPI_COMM_WORLD; + int rank; + + int dim1 = 10; // dimension 1 + int dim2 = 7; + int dim3 = 6; + int dim4 = 3; + int dim5 = 5; + int i,j,k,l,m; // loop counters for dims + int time_start = 27; // arbitrary number to put into bp file + + + int int_1D[dim1]; + int int_2D[dim1][dim2]; + int int_3D[dim1][dim2][dim3]; + int int_4D[dim1][dim2][dim3][dim4]; + int int_5D[dim1][dim2][dim3][dim4][dim5]; + + int node = 0; + + uint64_t total; + + int vi, vj, vk, vl; + for (i = 0; i < dim1; i++) { + int_1D[i] = i; + vi = i*dim2; + // 2D arrays + for (j = 0; j < dim2; j++) { + int_2D[i][j] = vi + j; + vj = (vi + j)*dim3; + // 3D array + for (k = 0; k < dim3; k++) { + int_3D[i][j][k] = vj + k; + vk = (vj+k)*dim4; + // 4D array + for (l = 0; l < dim4; l++) { + int_4D[i][j][k][l] = vk + l; + // 5D array + vl = (vk+l)*dim5; + for (m = 0; m < dim5; m++) { + int_5D[i][j][k][l][m] = vl + m; + } + } + } + } + } + + MPI_Init (&argc, &argv); + MPI_Comm_rank (comm, &rank); + if (adios_init ("testbp_c.xml", comm)) + return -1; + + adios_open (&io_handle, type_name, filename, "w", comm); + adios_group_size (io_handle, 32 // 4 integers + + 4 * dim1 // int_1D + + 4 * dim1 * dim2 // int_2D + + 4 * dim1 * dim2 * dim3 // int_3D + + 4 * dim1 * dim2 * dim3 * dim4 // int_4D + + 4 * dim1 * dim2 * dim3 * dim4 * dim5// int_4D + ,&total + ); + adios_write (io_handle, "dim1", &dim1); + adios_write (io_handle, "dim2", &dim2); + adios_write (io_handle, "dim3", &dim3); + adios_write (io_handle, "dim4", &dim4); + adios_write (io_handle, "dim5", &dim5); + + adios_write (io_handle, "int_1D", int_1D); + adios_write (io_handle, "int_2D", int_2D); + adios_write (io_handle, "int_3D", int_3D); + adios_write (io_handle, "int_4D", int_4D); + adios_write (io_handle, "int_5D", int_5D); + + adios_write (io_handle, "time_start", &time_start); + + adios_close (io_handle); + + printf ("rank: %d write completed\n", rank); + + MPI_Barrier (MPI_COMM_WORLD); + + adios_finalize (node); + MPI_Finalize (); + + return 0; +} diff --git a/tests/libs/adios/tests/bp_read/testbp_c.xml b/tests/libs/adios/tests/bp_read/testbp_c.xml new file mode 100644 index 0000000000..a594eba2b0 --- /dev/null +++ b/tests/libs/adios/tests/bp_read/testbp_c.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/libs/adios/tests/common b/tests/libs/adios/tests/common new file mode 120000 index 0000000000..f74dff0e4d --- /dev/null +++ b/tests/libs/adios/tests/common @@ -0,0 +1 @@ +../../../common \ No newline at end of file diff --git a/tests/libs/adios/tests/genarray/CMakeLists.txt b/tests/libs/adios/tests/genarray/CMakeLists.txt new file mode 100644 index 0000000000..e822620b20 --- /dev/null +++ b/tests/libs/adios/tests/genarray/CMakeLists.txt @@ -0,0 +1,37 @@ +include_directories(${PROJECT_SOURCE_DIR}/src) +include_directories(${PROJECT_BINARY_DIR}/src) +include_directories(${PROJECT_SOURCE_DIR}/tests/genarray) +include_directories(${PROJECT_BINARY_DIR}/tests/genarray) +link_directories(${PROJECT_BINARY_DIR}/tests/genarray) + +add_executable(genarray genarray.F90 gwrite_genarray.fh) +target_link_libraries(genarray adiosf ${ADIOSLIB_LDADD}) +set_target_properties(genarray PROPERTIES COMPILE_FLAGS "${ADIOSLIB_CPPFLAGS} ${ADIOSLIB_CFLAGS}") + +add_executable(genarray2D genarray2D.F90) +target_link_libraries(genarray2D adiosf ${ADIOSLIB_LDADD}) +set_target_properties(genarray2D PROPERTIES COMPILE_FLAGS "${ADIOSLIB_CPPFLAGS} ${ADIOSLIB_CFLAGS}") + +add_executable(copyarray copyarray.F90 gread_genarray.fh) +target_link_libraries(copyarray adiosf ${ADIOSLIB_LDADD}) +set_target_properties(copyarray PROPERTIES COMPILE_FLAGS "${ADIOSLIB_CPPFLAGS} ${ADIOSLIB_CFLAGS}") + +add_executable(copyarray2D copyarray2D.F90) +target_link_libraries(copyarray2D adiosf ${ADIOSLIB_LDADD}) +set_target_properties(copyarray2D PROPERTIES COMPILE_FLAGS "${ADIOSLIB_CPPFLAGS} ${ADIOSLIB_CFLAGS}") + +add_custom_command( + OUTPUT gwrite_genarray.fh + COMMAND rm -f gwrite_genarray.fh gread_genarray.fh + COMMAND ${PROJECT_SOURCE_DIR}/utils/gpp/gpp.py ${PROJECT_SOURCE_DIR}/tests/genarray/genarray3d.xml + DEPENDS genarray3d.xml + ) + +add_custom_command( + OUTPUT gread_genarray.fh + COMMAND rm -f gwrite_genarray.fh gread_genarray.fh + COMMAND ${PROJECT_SOURCE_DIR}/utils/gpp/gpp.py ${PROJECT_SOURCE_DIR}/tests/genarray/genarray3d.xml + DEPENDS genarray3d.xml + ) + +file(COPY genarray.xml genarray3d.xml job.ewok job2D.ewok DESTINATION ${PROJECT_BINARY_DIR}/tests/genarray) diff --git a/tests/libs/adios/tests/genarray/Makefile.am b/tests/libs/adios/tests/genarray/Makefile.am new file mode 100644 index 0000000000..a9a72f1a50 --- /dev/null +++ b/tests/libs/adios/tests/genarray/Makefile.am @@ -0,0 +1,53 @@ +AM_CPPFLAGS = $(all_includes) +AM_CPPFLAGS += -I$(top_builddir)/src + +AUTOMAKE_OPTIONS = no-dependencies + +noinst_PROGRAMS=genarray genarray2D copyarray copyarray2D + +genarray_SOURCES = genarray.F90 +genarray_CPPFLAGS = $(AM_CPPFLAGS) $(ADIOSLIB_CPPFLAGS) +genarray_CFLAGS = $(ADIOSLIB_CFLAGS) +genarray_LDADD = $(top_builddir)/src/libadiosf.a $(ADIOSLIB_LDADD) +genarray_LDFLAGS = $(ADIOSLIB_LDFLAGS) + +genarray2D_SOURCES = genarray2D.F90 +genarray2D_CPPFLAGS = $(AM_CPPFLAGS) $(ADIOSLIB_CPPFLAGS) +genarray2D_CFLAGS = $(ADIOSLIB_CFLAGS) +genarray2D_LDADD = $(top_builddir)/src/libadiosf.a $(ADIOSLIB_LDADD) +genarray2D_LDFLAGS = $(ADIOSLIB_LDFLAGS) + +copyarray_SOURCES = copyarray.F90 +copyarray_CPPFLAGS = $(AM_CPPFLAGS) $(ADIOSLIB_CPPFLAGS) +copyarray_CFLAGS = $(ADIOSLIB_CFLAGS) +copyarray_LDADD = $(top_builddir)/src/libadiosf.a $(ADIOSLIB_LDADD) +copyarray_LDFLAGS = $(ADIOSLIB_LDFLAGS) + +copyarray2D_SOURCES = copyarray2D.F90 +copyarray2D_CPPFLAGS = $(AM_CPPFLAGS) $(ADIOSLIB_CPPFLAGS) +copyarray2D_CFLAGS = $(ADIOSLIB_CFLAGS) +copyarray2D_LDADD = $(top_builddir)/src/libadiosf.a $(ADIOSLIB_LDADD) +copyarray2D_LDFLAGS = $(ADIOSLIB_LDFLAGS) + +FC=$(MPIFC) + +genarray.F90: gwrite_genarray.fh +copyarray.F90: gwrite_genarray.fh gread_genarray.fh + +gwrite_genarray.fh: genarray3d.xml + rm -f gwrite_genarray.fh gread_genarray.fh + $(ADIOS_BIN)/gpp.py $(srcdir)/genarray3d.xml +gread_genarray.fh: genarray3d.xml + rm -f gwrite_genarray.fh gread_genarray.fh + $(ADIOS_BIN)/gpp.py $(srcdir)/genarray3d.xml + +FCLINK = \ + $(LIBTOOL) --mode=link --tag F77 $(FC) \ + $(AM_FCFLAGS) $(FCFLAGS) $(LDFLAGS) -o $@ + +all-local: + test "$(srcdir)" = "$(builddir)" || cp $(srcdir)/genarray3d.xml $(srcdir)/genarray.xml $(builddir) + +CLEANFILES = genarray_comm.mod genarray2d_comm.mod gwrite_genarray.fh gread_genarray.fh + +EXTRA_DIST = genarray.xml genarray3d.xml job.ewok job2D.ewok diff --git a/tests/libs/adios/tests/genarray/copyarray.F90 b/tests/libs/adios/tests/genarray/copyarray.F90 new file mode 100644 index 0000000000..adcc8afa59 --- /dev/null +++ b/tests/libs/adios/tests/genarray/copyarray.F90 @@ -0,0 +1,310 @@ +! +! ADIOS is freely available under the terms of the BSD license described +! in the COPYING file in the top level directory of this source distribution. +! +! Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. +! + +! +! COPYARRAY +! +! Write an ADIOS BP file from many processor for test purposes. +! +! nx * ny * nz processes write a 3D array, where each process writes an +! ndx * ndy * ndz piece with filling with its rank as integer (4 bytes) value +! +! +! (c) Oak Ridge National Laboratory, 2009 +! Author: Norbert Podhorszki +! +module copyarray_comm + ! arguments + character(len=256) :: outputfile, inputfile + integer :: npx, npy, npz ! # of processors in x-y-z direction + integer :: ndx, ndy, ndz ! size of array per processor + logical :: common_size ! .true. if common local sizes are given as argument + ! .false. if we have to read sizes from a file + + integer :: gndx, gndy, gndz ! size of the global array + integer :: offx,offy,offz ! offsets of local array in the global array + + real*8, dimension(:,:,:), allocatable :: double_xyz + + ! MPI variables + integer :: group_comm + integer :: rank, nproc + integer :: ierr + + ! ADIOS variables + character (len=200) :: group + character (len=200) :: filename + !character (len=6) :: nprocstr + integer*8 :: handle, total_size, group_size, adios_totalsize, adios_buf_size + integer :: err + + real*8 :: start_time, end_time, total_time,gbs,sz + real*8 :: cache_start_time, cache_end_time, cache_total_time + + +end module copyarray_comm + + +program genarray + use copyarray_comm + use adios_write_mod + implicit none + include 'mpif.h' + + call MPI_Init (ierr) + call MPI_Comm_dup (MPI_COMM_WORLD, group_comm, ierr) + call MPI_Comm_rank (MPI_COMM_WORLD, rank, ierr) + call MPI_Comm_size (group_comm, nproc , ierr) + + call adios_init ("genarray3d.xml", group_comm, ierr) + !call MPI_Barrier (group_comm, ierr) + + call processArgs() + if (rank == 0) then + print *,"Input file: "//trim(inputfile) + print *,"Output file: "//trim(outputfile) + print '(" Process number : ",i0," x ",i0," x ",i0)', npx,npy,npz + if (common_size) then + print '(" Array size per process: ",i0," x ",i0," x ",i0)', ndx,ndy,ndz + else + print *," Array sizes per processes taken from file: "//trim(inputfile) + endif + + if (nproc .ne. npx*npy*npz) then + print '(" Error: Number of processors ",i0,"does not match ndx*ndy*ndz=",i0)', nproc, npx*npy*npz + call exit(1) + endif + endif + + !write (*,*) 'rank ', rank, "init completed" + !write (nprocstr,'(i0)') nproc + + call determineLocalSize() + call determineGlobalSize() + call determineOffsets() + call generateLocalArray() + + call MPI_BARRIER(MPI_COMM_WORLD,err) + start_time = MPI_WTIME() + call readArray() + call MPI_BARRIER(MPI_COMM_WORLD,err) + end_time = MPI_WTIME() + total_time = end_time - start_time + + sz = adios_totalsize * nproc/1024.d0/1024.d0/1024.d0 !size in GB + gbs = sz/total_time + + !if (rank==0) write(6,*) total_time + if (rank==0) write(6,'(a10,d12.2,2x,d12.2,2x,d12.3)') outputfile,sz,total_time,gbs + + call MPI_BARRIER(MPI_COMM_WORLD,err) + start_time = MPI_WTIME() + call writeArray() + call MPI_BARRIER(MPI_COMM_WORLD,err) + end_time = MPI_WTIME() + total_time = end_time - start_time + + sz = adios_totalsize * nproc/1024.d0/1024.d0/1024.d0 !size in GB + gbs = sz/total_time + + !if (rank==0) write(6,*) total_time + if (rank==0) write(6,'(a10,d12.2,2x,d12.2,2x,d12.3)') outputfile,sz,total_time,gbs + + ! Terminate + call MPI_Barrier (MPI_COMM_WORLD, ierr) + call adios_finalize (rank, ierr) + call MPI_Finalize (ierr) +end program genarray + + +!!*************************** +subroutine determineLocalSize() + use copyarray_comm + implicit none + if (common_size) then + ! we are done since we know them from argument + else + ! have to read from file + print *, "To be implemented: read sizes from file 1" + call exit(2) + endif +end subroutine determineLocalSize + +!!*************************** +subroutine determineGlobalSize() + use copyarray_comm + implicit none + if (common_size) then + gndx = npx * ndx + gndy = npy * ndy + gndz = npz * ndz + else + ! have to read from file + print *, "To be implemented: read sizes from file 2" + call exit(2) + endif +end subroutine determineGlobalSize + +!!*************************** +subroutine determineOffsets() + use copyarray_comm + implicit none + integer :: posx, posy, posz ! position index in the array + if (common_size) then + posx = mod(rank, npx) ! 1st dim easy: 0, npx, 2npx... are in the same X position + posy = mod(rank/npx, npy) ! 2nd dim: (0, npx-1) have the same dim (so divide with npx first) + posz = rank/(npx*npy) ! 3rd dim: npx*npy processes belong into one dim + offx = posx * ndx + offy = posy * ndy + offz = posz * ndz + else + ! have to read from file + print *, "To be implemented: read sizes from file 3" + call exit(2) + endif +end subroutine determineOffsets + + +!!*************************** +subroutine generateLocalArray() + use copyarray_comm + implicit none + integer :: i,j,k + allocate( double_xyz(1:ndx, 1:ndy, 1:ndz) ) +! do k=1,ndz +! do j=1,ndy +! do i=1,ndx +! double_xyz(i,j,k) = 1.0d0*rank +! enddo +! enddo +! enddo +end subroutine generateLocalArray + + +!!*************************** +subroutine readArray() + use copyarray_comm + use adios_write_mod + use adios_read_mod + implicit none + integer*8 adios_handle, adios_groupsize + integer adios_err + integer*8 fp, s + include 'mpif.h' + + call MPI_BARRIER(MPI_COMM_WORLD,adios_err) + cache_start_time = MPI_WTIME() + + group = "genarray" + +! TODO: Fix this to use the new read API + + call adios_open (adios_handle, group, inputfile, "r", group_comm, adios_err) +#include "gread_genarray.fh" + call MPI_BARRIER(MPI_COMM_WORLD,adios_err) + cache_end_time = MPI_WTIME() + cache_total_time = cache_end_time - cache_start_time + + sz = adios_totalsize * nproc/1024.d0/1024.d0/1024.d0 !size in GB + gbs = sz/cache_total_time + + !if (rank==0) write(6,*) total_time + if (rank==0) print '("Reading: ",a10,d12.2,2x,d12.2,2x,d12.3)', inputfile,sz,cache_total_time,gbs + + call adios_close (adios_handle, adios_err) + + +end subroutine readArray + +!!*************************** +subroutine writeArray() + use copyarray_comm + use adios_write_mod + implicit none + integer*8 adios_handle, adios_groupsize + integer adios_err + include 'mpif.h' + + call MPI_BARRIER(MPI_COMM_WORLD,adios_err) + cache_start_time = MPI_WTIME() + + group = "genarray" + call adios_open (adios_handle, group, outputfile, "w", group_comm, adios_err) +#include "gwrite_genarray.fh" + call MPI_BARRIER(MPI_COMM_WORLD,adios_err) + cache_end_time = MPI_WTIME() + cache_total_time = cache_end_time - cache_start_time + + sz = adios_totalsize * nproc/1024.d0/1024.d0/1024.d0 !size in GB + gbs = sz/cache_total_time + + !if (rank==0) write(6,*) total_time + if (rank==0) print '("Writing: ",a10,d12.2,2x,d12.2,2x,d12.3)', outputfile,sz,cache_total_time,gbs + + call adios_start_calculation(adios_err) + call adios_end_iteration(adios_err) + call adios_stop_calculation(adios_err) + + call adios_close (adios_handle, adios_err) + + +end subroutine writeArray + + +!!*************************** +subroutine usage() + print *, "Usage: genarray input output N M K nx ny nz" + print *, "infile: name of input file (file to be copied)" + print *, "output: name of output file" + print *, "N: number of processes in X dimension" + print *, "M: number of processes in Y dimension" + print *, "K: number of processes in Z dimension" + print *, "nx: local array size in X dimension per processor" + print *, "ny: local array size in Y dimension per processor" + print *, "nz: local array size in Z dimension per processor" +end subroutine usage + +!!*************************** +subroutine processArgs() + use copyarray_comm + +#ifndef __GFORTRAN__ +#ifndef __GNUC__ + interface + integer function iargc() + end function iargc + end interface +#endif +#endif + + character(len=256) :: npx_str, npy_str, npz_str, ndx_str, ndy_str, ndz_str + integer :: numargs + + !! process arguments + numargs = iargc() + !print *,"Number of arguments:",numargs + if ( numargs < 8 ) then + call usage() + call exit(1) + endif + call getarg(1, inputfile) + call getarg(2, outputfile) + call getarg(3, npx_str) + call getarg(4, npy_str) + call getarg(5, npz_str) + call getarg(6, ndx_str) + call getarg(7, ndy_str) + call getarg(8, ndz_str) + read (npx_str,'(i5)') npx + read (npy_str,'(i5)') npy + read (npz_str,'(i5)') npz + read (ndx_str,'(i6)') ndx + read (ndy_str,'(i6)') ndy + read (ndz_str,'(i6)') ndz + common_size = .true. + +end subroutine processArgs diff --git a/tests/libs/adios/tests/genarray/copyarray2D.F90 b/tests/libs/adios/tests/genarray/copyarray2D.F90 new file mode 100644 index 0000000000..22676391a1 --- /dev/null +++ b/tests/libs/adios/tests/genarray/copyarray2D.F90 @@ -0,0 +1,376 @@ +! +! ADIOS is freely available under the terms of the BSD license described +! in the COPYING file in the top level directory of this source distribution. +! +! Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. +! + +! +! COPYARRAY +! +! Write an ADIOS BP file from many processor for test purposes. +! +! nx * ny processes write a 2D array, where each process writes an +! ndx * ndy piece with filling with some values as integer (4 bytes) value +! +! Block written from rank R: +! R*ndx ... R*ndx +! R*ndx+1 ... R*ndx+1 +! ... ... +! R*ndx+ndy-1 R*ndx+ndy-1 +! +! E.g 2x2 processes writing 2x2 blocks: +! 0 0 | 2 2 0 1 | 2 3 +! 1 1 | 3 3 4 5 | 6 7 +! ----+---- or -----+---- +! 4 4 | 6 6 8 9 | 10 11 +! 5 5 | 7 7 12 13| 14 15 +! +! (c) Oak Ridge National Laboratory, 2009 +! Author: Norbert Podhorszki +! +module copyarray2D_comm + ! arguments + character(len=256) :: outputfile, inputfile + integer :: npx, npy ! # of processors in x-y direction + integer :: ndx, ndy ! size of array per processor + integer :: timesteps ! number of timesteps to write + logical :: common_size ! .true. if common local sizes are given as argument + ! .false. if we have to read sizes from a file + + integer :: gndx, gndy ! size of the global array + integer :: posx, posy ! position index in the array + integer :: offx, offy ! offsets of local array in the global array + + integer, dimension(:,:), allocatable :: int_xy + + ! MPI variables + integer :: group_comm + integer :: rank, nproc + integer :: ierr + + ! ADIOS variables + character (len=200) :: group + character (len=200) :: filename + !character (len=6) :: nprocstr + integer*8 :: handle, total_size, group_size, adios_totalsize, adios_buf_size + integer :: err + + real*8 :: start_time, end_time, total_time,gbs,sz + real*8 :: cache_start_time, cache_end_time, cache_total_time + +end module copyarray2D_comm + + +program genarray + use copyarray2D_comm + use adios_write_mod + implicit none + include 'mpif.h' + + call MPI_Init (ierr) + call MPI_Comm_dup (MPI_COMM_WORLD, group_comm, ierr) + call MPI_Comm_rank (MPI_COMM_WORLD, rank, ierr) + call MPI_Comm_size (group_comm, nproc , ierr) + + call adios_init ("genarray.xml", group_comm, ierr) + !call MPI_Barrier (group_comm, ierr) + + call processArgs() + if (rank == 0) then + print *,"Output file: "//trim(outputfile) + print '(" Process number : ",i0," x ",i0)', npx,npy + if (common_size) then + print '(" Array size per process: ",i0," x ",i0)', ndx,ndy + else + print *," Array sizes per processes taken from file: "//trim(inputfile) + endif + + if (nproc .ne. npx*npy) then + print '(" Error: Number of processors ",i0,"does not match ndx*ndy=",i0)', nproc, npx*npy + call exit(1) + endif + endif + + !write (*,*) 'rank ', rank, "init completed" + !write (nprocstr,'(i0)') nproc + + call determineLocalSize() + call determineGlobalSize() + call determineOffsets() + call generateLocalArray() + + call MPI_BARRIER(MPI_COMM_WORLD,err) + start_time = MPI_WTIME() + call readArray() + call MPI_BARRIER(MPI_COMM_WORLD,err) + end_time = MPI_WTIME() + total_time = end_time - start_time + sz = adios_totalsize * nproc/1024.d0/1024.d0/1024.d0 !size in GB + gbs = sz/total_time + + !if (rank==0) write(6,*) total_time + if (rank==0) write(6,'(a10,d12.2,2x,d12.2,2x,d12.3)') outputfile,sz,total_time,gbs + + call MPI_BARRIER(MPI_COMM_WORLD,err) + start_time = MPI_WTIME() + call writeArray() + call MPI_BARRIER(MPI_COMM_WORLD,err) + end_time = MPI_WTIME() + total_time = end_time - start_time + sz = adios_totalsize * nproc/1024.d0/1024.d0/1024.d0 !size in GB + gbs = sz/total_time + + !if (rank==0) write(6,*) total_time + if (rank==0) write(6,'(a10,d12.2,2x,d12.2,2x,d12.3)') outputfile,sz,total_time,gbs + + ! Terminate + call MPI_Barrier (MPI_COMM_WORLD, ierr) + call adios_finalize (rank, ierr) + call MPI_Finalize (ierr) +end program genarray + + +!!*************************** +subroutine determineLocalSize() + use copyarray2D_comm + implicit none + if (common_size) then + ! we are done since we know them from argument + else + ! have to read from file + print *, "To be implemented: read sizes from file 1" + call exit(2) + endif +end subroutine determineLocalSize + +!!*************************** +subroutine determineGlobalSize() + use copyarray2D_comm + implicit none + if (common_size) then + gndx = npx * ndx + gndy = npy * ndy + else + ! have to read from file + print *, "To be implemented: read sizes from file 2" + call exit(2) + endif +end subroutine determineGlobalSize + +!!*************************** +subroutine determineOffsets() + use copyarray2D_comm + implicit none + if (common_size) then + posx = mod(rank, npx) ! 1st dim easy: 0, npx, 2npx... are in the same X position + posy = rank/npx ! 2nd dim: npx processes belong into one dim + offx = posx * ndx + offy = posy * ndy +! print '("rank=",i0," pos: ",i0,",",i0," offset: ",i0,",",i0)', & +! rank, posx, posy, offx, offy + else + ! have to read from file + print *, "To be implemented: read sizes from file 2" + call exit(2) + endif +end subroutine determineOffsets + + +!!*************************** +subroutine generateLocalArray() + use copyarray2D_comm + implicit none + integer :: i,j,k, startv + allocate( int_xy(1:ndx, 1:ndy) ) +! do j=1,ndy +! startv = (offy+j-1)*gndx + offx +! do i=1,ndx +! !int_xy(i,j) = startv+i-1 +! !int_xy(i,j) = rank*ndx+j-1 +! int_xy(i,j) = rank +! enddo +! enddo +end subroutine generateLocalArray + + +!!*************************** +subroutine readArray() + use copyarray2D_comm + use adios_write_mod + use adios_read_mod + implicit none + integer :: tstep + character(2) :: mode = "r" + include 'mpif.h' + + ! Write out data using ADIOS + group = "genarray" + ! calculate how much we write from this processor + group_size = 4 * 9 + & ! X,Y, nproc, all size_ and offs_ integers + 4 * ndx * ndy + & ! int_xy + 4 * ndx * ndy ! int_xyt + + adios_totalsize = group_size + + call MPI_BARRIER(MPI_COMM_WORLD,ierr) + cache_start_time = MPI_WTIME() + + call adios_open (handle, group, inputfile, mode, group_comm, err) + call adios_group_size (handle, group_size, total_size, err) + !print '("rank=",i0," total_size=",i0," err=",i0)', rank, total_size, err + + ! write dimensions and nproc + adios_buf_size = 4 + call adios_read (handle, "X", gndx, adios_buf_size, err) + adios_buf_size = 4 + call adios_read (handle, "Y", gndy, adios_buf_size, err) + adios_buf_size = 4 + call adios_read (handle, "npx", npx, adios_buf_size, err) + adios_buf_size = 4 + call adios_read (handle, "npy", npy, adios_buf_size, err) + adios_buf_size = 4 + call adios_read (handle, "nproc", nproc, adios_buf_size, err) + + adios_buf_size = 4 + call adios_read (handle, "size_x", ndx, adios_buf_size, err) + adios_buf_size = 4 + call adios_read (handle, "size_y", ndy, adios_buf_size, err) + adios_buf_size = 4 + call adios_read (handle, "offs_x", offx, adios_buf_size, err) + adios_buf_size = 4 + call adios_read (handle, "offs_y", offy, adios_buf_size, err) + + adios_buf_size = 4 * ndx * ndy + call adios_read (handle, "int_xy", int_xy, adios_buf_size, err) + adios_buf_size = 4 * ndx * ndy + call adios_read (handle, "int_xyt", int_xy, adios_buf_size, err) + + call MPI_BARRIER(MPI_COMM_WORLD,ierr) + cache_end_time = MPI_WTIME() + cache_total_time = cache_end_time - cache_start_time + + sz = adios_totalsize * nproc/1024.d0/1024.d0/1024.d0 !size in GB + gbs = sz/cache_total_time + + !if (rank==0) write(6,*) total_time + if (rank==0) print '("Reading: ",a10,d12.2,2x,d12.2,2x,d12.3)', outputfile,sz,cache_total_time,gbs + + ! start streaming from buffer to disk + call adios_close (handle, err) + print '("rank=",i0,": write completed")', rank +end subroutine readArray + +!!*************************** +subroutine writeArray() + use copyarray2D_comm + use adios_write_mod + implicit none + integer :: tstep + character(2) :: mode = "w" + include 'mpif.h' + + ! Write out data using ADIOS + group = "genarray" + ! calculate how much we write from this processor + group_size = 4 * 9 + & ! X,Y, nproc, all size_ and offs_ integers + 4 * ndx * ndy + & ! int_xy + 4 * ndx * ndy ! int_xyt + + adios_totalsize = group_size + + do tstep=1,timesteps + if (tstep > 1) mode = "a" + !print '("rank=",i0," group=",A," file=",A," group_size=",i0)', rank, trim(group), & + ! trim(outputfile), group_size + + call MPI_BARRIER(MPI_COMM_WORLD,ierr) + cache_start_time = MPI_WTIME() + + call adios_open (handle, group, outputfile, mode, group_comm, err) + call adios_group_size (handle, group_size, total_size, err) + !print '("rank=",i0," total_size=",i0," err=",i0)', rank, total_size, err + + ! write dimensions and nproc + call adios_write (handle, "X", gndx, err) + call adios_write (handle, "Y", gndy, err) + call adios_write (handle, "npx", npx, err) + call adios_write (handle, "npy", npy, err) + call adios_write (handle, "nproc", nproc, err) + + call adios_write (handle, "size_x", ndx, err) + call adios_write (handle, "size_y", ndy, err) + call adios_write (handle, "offs_x", offx, err) + call adios_write (handle, "offs_y", offy, err) + + if (tstep == 1) then + call adios_write (handle, "int_xy", int_xy, err) + endif + call adios_write (handle, "int_xyt", int_xy, err) + + call MPI_BARRIER(MPI_COMM_WORLD,ierr) + cache_end_time = MPI_WTIME() + cache_total_time = cache_end_time - cache_start_time + + sz = adios_totalsize * nproc/1024.d0/1024.d0/1024.d0 !size in GB + gbs = sz/cache_total_time + + !if (rank==0) write(6,*) total_time + if (rank==0) print '("Writing: ",a10,d12.2,2x,d12.2,2x,d12.3)', outputfile,sz,cache_total_time,gbs + + ! start streaming from buffer to disk + call adios_close (handle, err) +! print '("rank=",i0,": write completed")', rank + enddo +end subroutine writeArray + +!!*************************** +subroutine usage() + print *, "Usage: genarray input output N M [nx ny | infile] timesteps" + print *, "input: name of input file" + print *, "output: name of output file" + print *, "N: number of processes in X dimension" + print *, "M: number of processes in Y dimension" + print *, "nx: local array size in X dimension per processor" + print *, "ny: local array size in Y dimension per processor" + print *, "timesteps: number of time steps to write" +end subroutine usage + +!!*************************** +subroutine processArgs() + use copyarray2D_comm + +#ifndef __GFORTRAN__ +#ifndef __GNUC__ + interface + integer function iargc() + end function iargc + end interface +#endif +#endif + + character(len=256) :: npx_str, npy_str, ndx_str, ndy_str, time_str + integer :: numargs + + !! process arguments + numargs = iargc() + !print *,"Number of arguments:",numargs + if ( numargs < 7 ) then + call usage() + call exit(1) + endif + call getarg(1, inputfile) + call getarg(2, outputfile) + call getarg(3, npx_str) + call getarg(4, npy_str) + call getarg(5, ndx_str) + call getarg(6, ndy_str) + call getarg(7, time_str) + read (npx_str,'(i5)') npx + read (npy_str,'(i5)') npy + read (ndx_str,'(i6)') ndx + read (ndy_str,'(i6)') ndy + read (time_str,'(i6)') timesteps + common_size = .true. + +end subroutine processArgs diff --git a/tests/libs/adios/tests/genarray/genarray.F90 b/tests/libs/adios/tests/genarray/genarray.F90 new file mode 100644 index 0000000000..ea329f9e13 --- /dev/null +++ b/tests/libs/adios/tests/genarray/genarray.F90 @@ -0,0 +1,268 @@ + +! ADIOS is freely available under the terms of the BSD license described +! in the COPYING file in the top level directory of this source distribution. +! +! Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. +! + +! +! GENARRAY +! +! Write an ADIOS BP file from many processor for test purposes. +! +! nx * ny * nz processes write a 3D array, where each process writes an +! ndx * ndy * ndz piece with filling with its rank as integer (4 bytes) value +! +! +! (c) Oak Ridge National Laboratory, 2009 +! Author: Norbert Podhorszki +! +module genarray_comm + ! arguments + character(len=256) :: outputfile, inputfile + integer :: npx, npy, npz ! # of processors in x-y-z direction + integer :: ndx, ndy, ndz ! size of array per processor + integer :: timesteps ! number of timesteps to write + integer :: sleeptime ! time to sleep between time steps + logical :: common_size ! .true. if common local sizes are given as argument + ! .false. if we have to read sizes from a file + + integer :: gndx, gndy, gndz ! size of the global array + integer :: offx,offy,offz ! offsets of local array in the global array + + real*8, dimension(:,:,:), allocatable :: double_xyz + + ! MPI variables + integer :: group_comm + integer :: rank, nproc + integer :: ierr + + ! ADIOS variables + character (len=200) :: group + character (len=200) :: filename + !character (len=6) :: nprocstr + integer*8 :: handle, total_size, group_size, adios_totalsize + + real*8 :: start_time, end_time, total_time,gbs,sz + real*8 :: io_start_time, io_end_time, io_total_time + + +end module genarray_comm + + +program genarray + use genarray_comm + use adios_write_mod + implicit none + include 'mpif.h' + + call MPI_Init (ierr) + call MPI_Comm_dup (MPI_COMM_WORLD, group_comm, ierr) + call MPI_Comm_rank (MPI_COMM_WORLD, rank, ierr) + call MPI_Comm_size (group_comm, nproc , ierr) + + call adios_init ("genarray3d.xml", group_comm, ierr) + !call MPI_Barrier (group_comm, ierr) + + call processArgs() + if (rank == 0) then + print *,"Output file(s): "//trim(outputfile)//"..bp" + print '(" Process number : ",i0," x ",i0," x ",i0)', npx,npy,npz + if (common_size) then + print '(" Array size per process: ",i0," x ",i0," x ",i0)', ndx,ndy,ndz + else + print *," Array sizes per processes taken from file: "//trim(inputfile) + endif + + if (nproc .ne. npx*npy*npz) then + print '(" Error: Number of processors ",i0,"does not match ndx*ndy*ndz=",i0)', nproc, npx*npy*npz + call exit(1) + endif + endif + + !write (*,*) 'rank ', rank, "init completed" + !write (nprocstr,'(i0)') nproc + + call determineLocalSize() + call determineGlobalSize() + call determineOffsets() + call generateLocalArray() + + call writeArray() + ! Terminate + call MPI_Barrier (MPI_COMM_WORLD, ierr) + call adios_finalize (rank, ierr) + call MPI_Finalize (ierr) +end program genarray + + +!!*************************** +subroutine determineLocalSize() + use genarray_comm + implicit none + if (common_size) then + ! we are done since we know them from argument + else + ! have to read from file + print *, "To be implemented: read sizes from file 1" + call exit(2) + endif +end subroutine determineLocalSize + +!!*************************** +subroutine determineGlobalSize() + use genarray_comm + implicit none + if (common_size) then + gndx = npx * ndx + gndy = npy * ndy + gndz = npz * ndz + else + ! have to read from file + print *, "To be implemented: read sizes from file 2" + call exit(2) + endif +end subroutine determineGlobalSize + +!!*************************** +subroutine determineOffsets() + use genarray_comm + implicit none + integer :: posx, posy, posz ! position index in the array + if (common_size) then + posx = mod(rank, npx) ! 1st dim easy: 0, npx, 2npx... are in the same X position + posy = mod(rank/npx, npy) ! 2nd dim: (0, npx-1) have the same dim (so divide with npx first) + posz = rank/(npx*npy) ! 3rd dim: npx*npy processes belong into one dim + offx = posx * ndx + offy = posy * ndy + offz = posz * ndz + else + ! have to read from file + print *, "To be implemented: read sizes from file 3" + call exit(2) + endif +end subroutine determineOffsets + + +!!*************************** +subroutine generateLocalArray() + use genarray_comm + implicit none + integer :: i,j,k + allocate( double_xyz(1:ndx, 1:ndy, 1:ndz) ) + do k=1,ndz + do j=1,ndy + do i=1,ndx + double_xyz(i,j,k) = 1.0d0*rank + enddo + enddo + enddo +end subroutine generateLocalArray + + +!!*************************** +subroutine writeArray() + use genarray_comm + use adios_write_mod + implicit none + integer*8 adios_handle, adios_groupsize + integer adios_err + integer :: tstep + character(2) :: mode = "w" + character(len=256) :: outfilename + include 'mpif.h' + + + if (rank==0) print '("Writing: "," filename ",14x,"size(GB)",4x,"io_time(sec)",6x,"GB/s")' + do tstep=1,timesteps + !if (tstep > 1) mode = "a" + double_xyz = tstep + double_xyz + call MPI_BARRIER(MPI_COMM_WORLD,ierr) + io_start_time = MPI_WTIME() + group = "genarray" + write (outfilename,'(a,".",i3.3,".bp")') trim(outputfile),tstep + call adios_open (adios_handle, group, outfilename, mode, group_comm, adios_err) +#include "gwrite_genarray.fh" + call adios_close (adios_handle, adios_err) + call MPI_BARRIER(MPI_COMM_WORLD,ierr) + io_end_time = MPI_WTIME() + io_total_time = io_end_time - io_start_time + sz = adios_totalsize * nproc/1024.d0/1024.d0/1024.d0 !size in GB + gbs = sz/io_total_time + if (rank==0) print '("Writing: ",a20,d12.2,2x,d12.2,2x,d12.3)', outfilename,sz,io_total_time,gbs + if (tstep + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/libs/adios/tests/genarray/genarray2D.F90 b/tests/libs/adios/tests/genarray/genarray2D.F90 new file mode 100644 index 0000000000..71c67125cf --- /dev/null +++ b/tests/libs/adios/tests/genarray/genarray2D.F90 @@ -0,0 +1,310 @@ +! +! ADIOS is freely available under the terms of the BSD license described +! in the COPYING file in the top level directory of this source distribution. +! +! Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. +! + +! +! GENARRAY +! +! Write an ADIOS BP file from many processor for test purposes. +! +! nx * ny processes write a 2D array, where each process writes an +! ndx * ndy piece with filling with some values as integer (4 bytes) value +! +! Block written from rank R: +! R*ndx ... R*ndx +! R*ndx+1 ... R*ndx+1 +! ... ... +! R*ndx+ndy-1 R*ndx+ndy-1 +! +! E.g 2x2 processes writing 2x2 blocks: +! 0 0 | 2 2 0 1 | 2 3 +! 1 1 | 3 3 4 5 | 6 7 +! ----+---- or -----+---- +! 4 4 | 6 6 8 9 | 10 11 +! 5 5 | 7 7 12 13| 14 15 +! +! (c) Oak Ridge National Laboratory, 2009 +! Author: Norbert Podhorszki +! +module genarray2D_comm + ! arguments + character(len=256) :: outputfile, inputfile + integer :: npx, npy ! # of processors in x-y direction + integer :: ndx, ndy ! size of array per processor + integer :: timesteps ! number of timesteps to write + logical :: common_size ! .true. if common local sizes are given as argument + ! .false. if we have to read sizes from a file + + integer :: gndx, gndy ! size of the global array + integer :: posx, posy ! position index in the array + integer :: offx, offy ! offsets of local array in the global array + + integer, dimension(:,:), allocatable :: int_xy + + ! MPI variables + integer :: group_comm + integer :: rank, nproc + integer :: ierr + + ! ADIOS variables + character (len=200) :: group + character (len=200) :: filename + !character (len=6) :: nprocstr + integer*8 :: handle, total_size, group_size, adios_totalsize + integer :: err + + real*8 :: start_time, end_time, total_time,gbs,sz + real*8 :: cache_start_time, cache_end_time, cache_total_time + +end module genarray2D_comm + + +program genarray + use genarray2D_comm + use adios_write_mod + implicit none + include 'mpif.h' + + call MPI_Init (ierr) + call MPI_Comm_dup (MPI_COMM_WORLD, group_comm, ierr) + call MPI_Comm_rank (MPI_COMM_WORLD, rank, ierr) + call MPI_Comm_size (group_comm, nproc , ierr) + + call adios_init ("genarray.xml", group_comm, ierr) + !call MPI_Barrier (group_comm, ierr) + + call processArgs() + if (rank == 0) then + print *,"Output file: "//trim(outputfile) + print '(" Process number : ",i0," x ",i0)', npx,npy + if (common_size) then + print '(" Array size per process: ",i0," x ",i0)', ndx,ndy + else + print *," Array sizes per processes taken from file: "//trim(inputfile) + endif + + if (nproc .ne. npx*npy) then + print '(" Error: Number of processors ",i0,"does not match ndx*ndy=",i0)', nproc, npx*npy + call exit(1) + endif + endif + + !write (*,*) 'rank ', rank, "init completed" + !write (nprocstr,'(i0)') nproc + + call determineLocalSize() + call determineGlobalSize() + call determineOffsets() + call generateLocalArray() + + call MPI_BARRIER(MPI_COMM_WORLD,err) + start_time = MPI_WTIME() + call writeArray() + call MPI_BARRIER(MPI_COMM_WORLD,err) + end_time = MPI_WTIME() + total_time = end_time - start_time + sz = adios_totalsize * nproc/1024.d0/1024.d0/1024.d0 !size in GB + gbs = sz/total_time + + !if (rank==0) write(6,*) total_time + if (rank==0) write(6,'(a10,d12.2,2x,d12.2,2x,d12.3)') outputfile,sz,total_time,gbs + + ! Terminate + call MPI_Barrier (MPI_COMM_WORLD, ierr) + call adios_finalize (rank, ierr) + call MPI_Finalize (ierr) +end program genarray + + +!!*************************** +subroutine determineLocalSize() + use genarray2D_comm + implicit none + if (common_size) then + ! we are done since we know them from argument + else + ! have to read from file + print *, "To be implemented: read sizes from file 1" + call exit(2) + endif +end subroutine determineLocalSize + +!!*************************** +subroutine determineGlobalSize() + use genarray2D_comm + implicit none + if (common_size) then + gndx = npx * ndx + gndy = npy * ndy + else + ! have to read from file + print *, "To be implemented: read sizes from file 2" + call exit(2) + endif +end subroutine determineGlobalSize + +!!*************************** +subroutine determineOffsets() + use genarray2D_comm + implicit none + if (common_size) then + posx = mod(rank, npx) ! 1st dim easy: 0, npx, 2npx... are in the same X position + posy = rank/npx ! 2nd dim: npx processes belong into one dim + offx = posx * ndx + offy = posy * ndy +! print '("rank=",i0," pos: ",i0,",",i0," offset: ",i0,",",i0)', & +! rank, posx, posy, offx, offy + else + ! have to read from file + print *, "To be implemented: read sizes from file 2" + call exit(2) + endif +end subroutine determineOffsets + + +!!*************************** +subroutine generateLocalArray() + use genarray2D_comm + implicit none + integer :: i,j,k, startv + allocate( int_xy(1:ndx, 1:ndy) ) + do j=1,ndy + startv = (offy+j-1)*gndx + offx + do i=1,ndx + !int_xy(i,j) = startv+i-1 + !int_xy(i,j) = rank*ndx+j-1 + int_xy(i,j) = rank + enddo + enddo +end subroutine generateLocalArray + + +!!*************************** +subroutine writeArray() + use genarray2D_comm + use adios_write_mod + implicit none + integer :: tstep + character(2) :: mode = "w" + include 'mpif.h' + + ! Write out data using ADIOS + group = "genarray" + ! calculate how much we write from this processor + group_size = 4 * 9 + & ! X,Y, nproc, all size_ and offs_ integers + 4 * ndx * ndy + & ! int_xy + 4 * ndx * ndy ! int_xyt + + adios_totalsize = group_size + + do tstep=1,timesteps + if (tstep > 1) mode = "a" + !print '("rank=",i0," group=",A," file=",A," group_size=",i0)', rank, trim(group), & + ! trim(outputfile), group_size + + call MPI_BARRIER(MPI_COMM_WORLD,ierr) + cache_start_time = MPI_WTIME() + + call adios_open (handle, group, outputfile, mode, group_comm, err) + call adios_group_size (handle, group_size, total_size, err) + !print '("rank=",i0," total_size=",i0," err=",i0)', rank, total_size, err + + ! write dimensions and nproc + call adios_write (handle, "/dimensions/X", gndx, err) + call adios_write (handle, "/dimensions/Y", gndy, err) + call adios_write (handle, "/info/npx", npx, err) + call adios_write (handle, "/info/npy", npy, err) + call adios_write (handle, "/info/nproc", nproc, err) + + call adios_write (handle, "/aux/size_x", ndx, err) + call adios_write (handle, "/aux/size_y", ndy, err) + call adios_write (handle, "/aux/offs_x", offx, err) + call adios_write (handle, "/aux/offs_y", offy, err) + + if (tstep == 1) then + call adios_write (handle, "/var/int_xy", int_xy, err) + endif + call adios_write (handle, "/var/int_xyt", int_xy, err) + + call MPI_BARRIER(MPI_COMM_WORLD,ierr) + cache_end_time = MPI_WTIME() + cache_total_time = cache_end_time - cache_start_time + + sz = adios_totalsize * nproc/1024.d0/1024.d0/1024.d0 !size in GB + gbs = sz/cache_total_time + + !if (rank==0) write(6,*) total_time + if (rank==0) print '("Writing to cache: ",a10,d12.2,2x,d12.2,2x,d12.3)', outputfile,sz,cache_total_time,gbs + + ! start streaming from buffer to disk + call adios_close (handle, err) +! print '("rank=",i0,": write completed")', rank + enddo +end subroutine writeArray + + +!!*************************** +subroutine usage() + print *, "Usage: genarray output N M [nx ny | infile] timesteps" + print *, "output: name of output file" + print *, "N: number of processes in X dimension" + print *, "M: number of processes in Y dimension" + print *, "nx: local array size in X dimension per processor" + print *, "ny: local array size in Y dimension per processor" + print *, "infile: file that describes nx ny for each processor" + print *, "timesteps: number of time steps to write" +end subroutine usage + +!!*************************** +subroutine processArgs() + use genarray2D_comm + +#ifndef __GFORTRAN__ +#ifndef __GNUC__ + interface + integer function iargc() + end function iargc + end interface +#endif +#endif + + character(len=256) :: npx_str, npy_str, ndx_str, ndy_str, time_str + integer :: numargs + + !! process arguments + numargs = iargc() + !print *,"Number of arguments:",numargs + if ( numargs < 5 ) then + call usage() + call exit(1) + endif + call getarg(1, outputfile) + call getarg(2, npx_str) + call getarg(3, npy_str) + read (npx_str,'(i5)') npx + read (npy_str,'(i5)') npy + if ( numargs == 5 ) then + call getarg(4, inputfile) + call getarg(5, time_str) + read (timesteps,'(i6)') time_str + ndx = 0 + ndy = 0 + common_size = .false. + else if (numargs == 6) then + call getarg(4, ndx_str) + call getarg(5, ndy_str) + call getarg(6, time_str) + read (ndx_str,'(i6)') ndx + read (ndy_str,'(i6)') ndy + read (time_str,'(i6)') timesteps + inputfile=char(0) + common_size = .true. + else + call usage() + call exit(1) + endif + +end subroutine processArgs diff --git a/tests/libs/adios/tests/genarray/genarray3d.xml b/tests/libs/adios/tests/genarray/genarray3d.xml new file mode 100644 index 0000000000..179b5dca11 --- /dev/null +++ b/tests/libs/adios/tests/genarray/genarray3d.xml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/libs/adios/tests/genarray/job.ewok b/tests/libs/adios/tests/genarray/job.ewok new file mode 100755 index 0000000000..3c7955f645 --- /dev/null +++ b/tests/libs/adios/tests/genarray/job.ewok @@ -0,0 +1,19 @@ +#PBS -N genarray +#PBS -A STF006 +#PBS -V +#PBS -l nodes=32:ppn=2 +#PBS -l walltime=0:15:00 +#PBS -j eo + +NPX=4 +NPY=4 +NPZ=4 +NDX=100 +NDY=100 +NDZ=100 + +cd $PBS_O_WORKDIR + +let "NPROC=NPX*NPY*NPZ" +FN="g_${NPX}x${NPY}x${NPZ}_${NDX}x${NDY}x${NDZ}.bp" +mpirun -n $NPROC ./genarray $FN $NPX $NPY $NPZ $NDX $NDY $NDZ >& genarray.out diff --git a/tests/libs/adios/tests/genarray/job2D.ewok b/tests/libs/adios/tests/genarray/job2D.ewok new file mode 100755 index 0000000000..885fdc7728 --- /dev/null +++ b/tests/libs/adios/tests/genarray/job2D.ewok @@ -0,0 +1,17 @@ +#PBS -N genarray2D +#PBS -A STF006 +#PBS -V +#PBS -l nodes=32:ppn=2 +#PBS -l walltime=0:15:00 +#PBS -j eo + +NPX=8 +NPY=8 +NDX=100 +NDY=100 + +cd $PBS_O_WORKDIR + +let "NPROC=NPX*NPY" +FN="g_${NPX}x${NPY}_${NDX}x${NDY}.bp" +mpirun -n $NPROC ./genarray2D $FN $NPX $NPY $NDX $NDY >& genarray2D.out diff --git a/tests/libs/adios/tests/run b/tests/libs/adios/tests/run new file mode 100755 index 0000000000..58901211ac --- /dev/null +++ b/tests/libs/adios/tests/run @@ -0,0 +1,22 @@ +#!./common/bats/bin/bats +# -*-sh-*- + +load ./common/test_helper_functions || exit 1 +source ./common/functions || exit 1 +source ./common/TEST_ENV + +#if [ -s ./LOCAL_ENV ];then +# . ./LOCAL_ENV +#else +# ERROR "LOCAL_ENV does not exist" +#fi + +@test "[Adios] clean testing directory" { + make clean +} +@test "[Adios] check adios functionality" { + make -k check +} +#@test "[Adios] clean tests temporary files" { +# make distclean +#} diff --git a/tests/libs/adios/tests/suite/CMakeLists.txt b/tests/libs/adios/tests/suite/CMakeLists.txt new file mode 100644 index 0000000000..2a89487cde --- /dev/null +++ b/tests/libs/adios/tests/suite/CMakeLists.txt @@ -0,0 +1,18 @@ +add_subdirectory(programs) + +file(COPY HOWTO-Add-new-test HOWTO-Run cleanup.sh test.sh DESTINATION ${PROJECT_BINARY_DIR}/tests/suite) + +if(EXISTS ${PROJECT_BINARY_DIR}/tests/suite/reference) + file(COPY reference/ DESTINATION ${PROJECT_BINARY_DIR}/tests/suite/reference) +else() + file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/tests/suite/reference) + file(COPY reference/ DESTINATION ${PROJECT_BINARY_DIR}/tests/suite/reference) +endif() + +if(EXISTS ${PROJECT_BINARY_DIR}/tests/suite/tests) + file(COPY tests/ DESTINATION ${PROJECT_BINARY_DIR}/tests/suite/tests) +else() + file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/tests/suite/tests) + file(COPY tests/ DESTINATION ${PROJECT_BINARY_DIR}/tests/suite/tests) +endif() + diff --git a/tests/libs/adios/tests/suite/HOWTO-Add-new-test b/tests/libs/adios/tests/suite/HOWTO-Add-new-test new file mode 100644 index 0000000000..b09c9b5f50 --- /dev/null +++ b/tests/libs/adios/tests/suite/HOWTO-Add-new-test @@ -0,0 +1,45 @@ +Sequential tests +================ +They should be put into ./programs and built/run by make check. +Note that MPI codes cannot run on supercomputer login nodes, even if you have +a single process (i.e. adios write API must be tested in parallel). + +- Put your source and extra input into ./programs +- Edit the ./programs/Makefile.am to build your code. Follow the instructions + in Makefile.am +- make check + will build all codes defined in check_PROGRAMS, and runs those that are + defined in TESTS in the Makefile.am + +Parallel tests +============== +test.sh runs all .sh script found in ./tests, so you need to make your new +shell script in ./tests. + +The script has no arguments but a few environment variables are set: + MPIRUN Run command + MPIRUN_NP Run commands option to set number of processes + MAXPROCS Max number of processes allowed + HAVE_FORTRAN yes or no. If no, do not try to use the Fortran examples... + SRCDIR Test source dir where the test.sh is executed from. + Your script is in $1/tests (== `dirname $0`) + $1/references should store the data to which you compare + the test run + $1/programs should contain the binaries you use and are + built with "make check" + TRUNKDIR ADIOS trunk dir + all sources, tests and examples are accessible from this dir + +Your parallel test program should be executed as +$MPIRUN $MPIRUN_NP + +The test.sh creates a ./work.testname/ subdirectory, enters it and runs your +script from there. +All stdout and stderr of your script goes into ../log. + +Your script should exit normally (exit 0) if everything is fine, and exit 1 +on error (or any non-zero). exit 77 means skipping this test (a'la automake). +Print useful error logs to stdout/stderr to help find the tester what went +wrong. + + diff --git a/tests/libs/adios/tests/suite/HOWTO-Run b/tests/libs/adios/tests/suite/HOWTO-Run new file mode 100644 index 0000000000..71a851357a --- /dev/null +++ b/tests/libs/adios/tests/suite/HOWTO-Run @@ -0,0 +1,50 @@ +Run the test after compiling adios in the trunk. I.e. after "make" + +1. Build the codes necessary for the tests and run sequential tests, i.e. do + a "make check" in adios trunk. + +2. Run test.sh script in an interactive-job environment to run the parallel tests. + Define the command for running parallel programs like mpirun -np or aprun -q -n + Run the script in the job directory with full path. + +Usage: /`basename $0` [-m runcmd] [-n "-np"] [-p procs] [-h] [-v] [-k] + [pattern [pattern2 pattern3 ...]] + is used to find all the test codes, inputs and reference outputs. + codes and inputs will be copied to the job directory + pattern if given, only those tests are executed, that match + 'tests/**.sh'; otherwise all tests are executed. + e.g. arguments 1[0-3] attr global will execute all tests that + have any of the strings 10,11,12,13,attr or global in their name + (and end with .sh) + OPTIONS + -m runcmd command to start an MPI program. Default is "aprun -q" if aprun + is found, otherwise "mpirun" + -n runopt option to runcmd to specify number of cores. + Default is "-n" for aprun, "-np" for mpirun + -p procs Run only those tests that use less up to 'procs' processes. + Default: 128 + -k Do not remove logs and work dir of successful tests. + -v Verbose mode + -h Print this help. + +Each test will have an ./work. directory to store anything needed. +The test's stdout and stderr is redirected into ./log. file. + +E.g. +$ qsub -I -lwalltime=1:00:00 -lsize=12 +$ cd /tmp/work/pnorbert/test/adios/suite +$ /ccs/proj/e2e/pnorbert/ADIOS/ADIOS/trunk/tests/suite/test.sh -p 12 +Settings: + Test source directory: /ccs/proj/e2e/pnorbert/ADIOS/ADIOS/trunk/tests/suite + Run command: aprun -q + Run command np option: -n + Max. processes to use: 12 + Keep successful tests' output: no + +Run tests + Test 01_scalars ... OK + Test 02_attributes ... OK + Test 03_arrays ... OK + ... +$ + diff --git a/tests/libs/adios/tests/suite/Makefile.am b/tests/libs/adios/tests/suite/Makefile.am new file mode 100644 index 0000000000..480e278649 --- /dev/null +++ b/tests/libs/adios/tests/suite/Makefile.am @@ -0,0 +1,13 @@ +SUBDIRS = programs +EXTRA_DIST = HOWTO-Add-new-test \ + HOWTO-Run \ + cleanup.sh \ + reference/* \ + test.sh \ + tests/* + +all-local: + test "$(srcdir)" = "$(builddir)" || ln -sf $(srcdir)/reference $(builddir) + test "$(srcdir)" = "$(builddir)" || ln -sf $(srcdir)/tests $(builddir) + test "$(srcdir)" = "$(builddir)" || cp $(srcdir)/test.sh $(builddir) + test "$(srcdir)" = "$(builddir)" || cp $(srcdir)/cleanup.sh $(builddir) diff --git a/tests/libs/adios/tests/suite/cleanup.sh b/tests/libs/adios/tests/suite/cleanup.sh new file mode 100755 index 0000000000..624dbf5b85 --- /dev/null +++ b/tests/libs/adios/tests/suite/cleanup.sh @@ -0,0 +1,8 @@ +#!/bin/bash +# +# Deletes all test logs and work dirs in . +# + +set -v +rm -rf log.* work.* + diff --git a/tests/libs/adios/tests/suite/programs/CMakeLists.txt b/tests/libs/adios/tests/suite/programs/CMakeLists.txt new file mode 100644 index 0000000000..8bb71609be --- /dev/null +++ b/tests/libs/adios/tests/suite/programs/CMakeLists.txt @@ -0,0 +1,84 @@ +include_directories(${PROJECT_SOURCE_DIR}/tests/suite) +include_directories(${PROJECT_SOURCE_DIR}/src) +include_directories(${PROJECT_SOURCE_DIR}/src/public) +include_directories(${PROJECT_SOURCE_DIR}/tests/suite/programs) +include_directories(${PROJECT_BINARY_DIR}/tests/suite/programs) +link_directories(${PROJECT_BINARY_DIR}/tests/suite/programs) + +set (WRITE_PROGS1 local_array_time + adios_amr_write + adios_amr_write_2vars + write_read + write_alternate + two_groups + many_vars + selections + path_test + reuse_dim + adios_transforms_read_write + connect_to_space_subset + big_file + set_path + set_path_var + steps_write + blocks + build_standard_dataset) + +set(WRITE_PROGS2 adios_staged_read + adios_staged_read_v2 + adios_staged_read_2vars + steps_read_file + steps_read_stream + transforms_writeblock_read) + +set(WRITE_PROGS ${WRITE_PROGS1} + ${WRITE_PROGS2} + copy_subvolume + transforms_specparse + hashtest + group_free_test) + +if(BUILD_WRITE) + foreach (PROG ${WRITE_PROGS} ) + add_executable(${PROG} ${PROG}.c) + if(MPI_COMPILE_FLAGS) + set_target_properties(${PROG} PROPERTIES COMPILE_FLAGS "${MPI_C_COMPILE_FLAGS}") + endif() + if(MPI_LINK_FLAGS) + set_target_properties(${PROG} PROPERTIES LINK_FLAGS "${MPI_C_LINK_FLAGS}") + endif() + endforeach() + + foreach (PROG ${WRITE_PROGS1} ) + target_link_libraries(${PROG} adios ${ADIOSLIB_LDADD} ${MPI_C_LIBRARIES}) + endforeach() + + foreach (PROG ${WRITE_PROGS2} ) + target_link_libraries(${PROG} adiosread ${ADIOSREADLIB_LDADD} ${MPI_C_LIBRARIES}) + endforeach() + + target_link_libraries(copy_subvolume adiosread_nompi ${ADIOSREADLIB_SEQ_LDADD}) + target_link_libraries(transforms_specparse adios_nompi ${ADIOSLIB_SEQ_LDADD}) +# target_link_libraries(hashtest ${PROJECT_BINARY_DIR}/src/libadios_a-qhashtbl.o) + target_link_libraries(hashtest adios ${ADIOSLIB_LDADD} ${MPI_C_LIBRARIES}) + target_link_libraries(group_free_test adios_nompi ${ADIOSLIB_SEQ_LDADD}) +endif(BUILD_WRITE) + +if(BUILD_FORTRAN) + if(BUILD_WRITE) + add_executable(posix_method posix_method.F90 gwrite_posix_method.fh) + target_link_libraries(posix_method adiosf ${ADIOSLIB_LDADD} ${MPI_C_LIBRARIES}) + include_directories(${PROJECT_BINARY_DIR}/src) + add_custom_command( + OUTPUT gwrite_posix_method.fh + COMMAND ${PROJECT_SOURCE_DIR}/utils/gpp/gpp.py ${PROJECT_SOURCE_DIR}/tests/suite/programs/posix_method.xml + DEPENDS posix_method.xml + ) + endif(BUILD_WRITE) +endif(BUILD_FORTRAN) + +file(COPY adios_amr_write.xml adios_amr_write_2vars.xml posix_method.xml + local_array_time.xml write_alternate.xml write_read.xml transforms.xml + path_test.xml adios_transforms.xml set_path.xml set_path_var.xml + two_groups.xml + DESTINATION ${PROJECT_BINARY_DIR}/tests/suite/programs) diff --git a/tests/libs/adios/tests/suite/programs/Makefile.am b/tests/libs/adios/tests/suite/programs/Makefile.am new file mode 100644 index 0000000000..068391eee1 --- /dev/null +++ b/tests/libs/adios/tests/suite/programs/Makefile.am @@ -0,0 +1,232 @@ +# Add your codes that you want to build at 'make check' +# Do not build Fortran codes if Fortran is not supported. +# Do not build a code using the write API if only the read API is available +# Steps: +# 1. add code name below to check_readonly_C/check_C/check_readonly_Fortran/check_Fortran targets +# 2. add code name to TESTS if it is a sequential test +# 3. define build rules for your code +# 4. add files to CLEANFILES that should be deleted at 'make clean' +# 5. add to EXTRA_DIST any non-source files that should go with the distribution +check_readonly_C= +if BUILD_WRITE +check_C=local_array_time \ + adios_amr_write \ + adios_amr_write_2vars \ + adios_staged_read \ + adios_staged_read_v2 \ + adios_staged_read_2vars \ + write_read \ + write_alternate \ + two_groups \ + many_vars \ + selections \ + path_test \ + reuse_dim \ + adios_transforms_read_write \ + connect_to_space_subset \ + big_file \ + set_path \ + set_path_var \ + steps_write \ + steps_read_file \ + steps_read_stream \ + blocks \ + build_standard_dataset \ + transforms_writeblock_read + +test_C=copy_subvolume transforms_specparse group_free_test + +endif + +if BUILD_FORTRAN +check_readonly_Fortran= +if BUILD_WRITE +check_Fortran=posix_method +endif +endif + +check_PROGRAMS=$(check_C) $(check_Fortran) $(check_readonly_C) $(check_readonly_Fortran) $(test_C) + +# Sequential tests to be executed by "make check" can be defined right here in TESTS +# Parallel tests should be defined in ../tests/*.sh and executed by ../test.sh +TESTS=$(test_C) + +AM_CPPFLAGS = $(all_includes) +AM_CPPFLAGS += -I$(top_builddir)/src -I$(top_srcdir)/src/public + +all-local: + test "$(srcdir)" = "$(builddir)" || cp $(srcdir)/*.xml $(builddir) + +############################# +# Build rules for each test # +############################# + +# posix_method +posix_method_SOURCES=posix_method.F90 +posix_method_LDADD = $(top_builddir)/src/libadiosf.a $(ADIOSLIB_LDADD) +posix_method_LDFLAGS = $(AM_LDFLAGS) $(ADIOSLIB_LDFLAGS) +posix_method.o: gwrite_posix_method.fh +gwrite_posix_method.fh: posix_method.xml + $(ADIOS_BIN)/gpp.py $(srcdir)/posix_method.xml + +local_array_time_SOURCES=local_array_time.c +local_array_time_LDADD = $(top_builddir)/src/libadios.a $(ADIOSLIB_LDADD) +local_array_time_LDFLAGS = $(AM_LDFLAGS) $(ADIOSLIB_LDFLAGS) + +adios_amr_write_SOURCES=adios_amr_write.c +adios_amr_write_LDADD = $(top_builddir)/src/libadios.a $(ADIOSLIB_LDADD) +adios_amr_write_LDFLAGS = $(AM_LDFLAGS) $(ADIOSLIB_LDFLAGS) +adios_amr_write.o: adios_amr_write.c + +adios_amr_write_2vars_SOURCES=adios_amr_write_2vars.c +adios_amr_write_2vars_LDADD = $(top_builddir)/src/libadios.a $(ADIOSLIB_LDADD) +adios_amr_write_2vars_LDFLAGS = $(AM_LDFLAGS) $(ADIOSLIB_LDFLAGS) +adios_amr_write_2vars.o: adios_amr_write_2vars.c + +adios_staged_read_SOURCES=adios_staged_read.c +adios_staged_read_LDADD = $(top_builddir)/src/libadiosread.a $(ADIOSREADLIB_LDADD) +adios_staged_read_LDFLAGS = $(AM_LDFLAGS) $(ADIOSREADLIB_LDFLAGS) +adios_staged_read.o: adios_staged_read.c + +adios_staged_read_v2_SOURCES=adios_staged_read_v2.c +adios_staged_read_v2_LDADD = $(top_builddir)/src/libadiosread.a $(ADIOSREADLIB_LDADD) +adios_staged_read_v2_LDFLAGS = $(AM_LDFLAGS) $(ADIOSREADLIB_LDFLAGS) +adios_staged_read_v2.o: adios_staged_read_v2.c + +adios_staged_read_2vars_SOURCES=adios_staged_read_2vars.c +adios_staged_read_2vars_LDADD = $(top_builddir)/src/libadiosread.a $(ADIOSREADLIB_LDADD) +adios_staged_read_2vars_LDFLAGS = $(AM_LDFLAGS) $(ADIOSREADLIB_LDFLAGS) +adios_staged_read_2vars.o: adios_staged_read_2vars.c + +adios_transforms_read_write_SOURCES=adios_transforms_read_write.c +adios_transforms_read_write_LDADD = $(top_builddir)/src/libadios.a $(ADIOSLIB_LDADD) +adios_transforms_read_write_LDFLAGS = $(AM_LDFLAGS) $(ADIOSLIB_LDFLAGS) +adios_transforms_read_write.o: adios_transforms_read_write.c + +write_read_SOURCES=write_read.c +write_read_LDADD = $(top_builddir)/src/libadios.a $(ADIOSLIB_LDADD) +write_read_LDFLAGS = $(AM_LDFLAGS) $(ADIOSLIB_LDFLAGS) +write_read.o: write_read.c + +write_alternate_SOURCES=write_alternate.c +write_alternate_LDADD = $(top_builddir)/src/libadios.a $(ADIOSLIB_LDADD) +write_alternate_LDFLAGS = $(AM_LDFLAGS) $(ADIOSLIB_LDFLAGS) +write_alternate.o: write_alternate.c + +set_path_SOURCES=set_path.c +set_path_LDADD = $(top_builddir)/src/libadios.a $(ADIOSLIB_LDADD) +set_path_LDFLAGS = $(AM_LDFLAGS) $(ADIOSLIB_LDFLAGS) +set_path.o: set_path.c + +set_path_var_SOURCES=set_path_var.c +set_path_var_LDADD = $(top_builddir)/src/libadios.a $(ADIOSLIB_LDADD) +set_path_var_LDFLAGS = $(AM_LDFLAGS) $(ADIOSLIB_LDFLAGS) +set_path_var.o: set_path_var.c + +two_groups_SOURCES=two_groups.c +two_groups_LDADD = $(top_builddir)/src/libadios.a $(ADIOSLIB_LDADD) +two_groups_LDFLAGS = $(AM_LDFLAGS) $(ADIOSLIB_LDFLAGS) +two_groups.o: two_groups.c + +many_vars_SOURCES=many_vars.c +many_vars_LDADD = $(top_builddir)/src/libadios.a $(ADIOSLIB_LDADD) +many_vars_LDFLAGS = $(AM_LDFLAGS) $(ADIOSLIB_LDFLAGS) +many_vars.o: many_vars.c + +selections_SOURCES=selections.c +selections_LDADD = $(top_builddir)/src/libadios.a $(ADIOSLIB_LDADD) +selections_LDFLAGS = $(AM_LDFLAGS) $(ADIOSLIB_LDFLAGS) +selections.o: selections.c + +path_test_SOURCES=path_test.c +path_test_LDADD = $(top_builddir)/src/libadios.a $(ADIOSLIB_LDADD) +path_test_LDFLAGS = $(AM_LDFLAGS) $(ADIOSLIB_LDFLAGS) +path_test.o: path_test.c + +reuse_dim_SOURCES=reuse_dim.c +reuse_dim_LDADD = $(top_builddir)/src/libadios.a $(ADIOSLIB_LDADD) +reuse_dim_LDFLAGS = $(AM_LDFLAGS) $(ADIOSLIB_LDFLAGS) +reuse_dim.o: reuse_dim.c + +connect_to_space_subset_SOURCES=connect_to_space_subset.c +connect_to_space_subset_LDADD = $(top_builddir)/src/libadios.a $(ADIOSLIB_LDADD) +connect_to_space_subset_LDFLAGS = $(AM_LDFLAGS) $(ADIOSLIB_LDFLAGS) +connect_to_space_subset.o: connect_to_space_subset.c + +big_file_SOURCES=big_file.c +big_file_LDADD = $(top_builddir)/src/libadios.a $(ADIOSLIB_LDADD) +big_file_LDFLAGS = $(AM_LDFLAGS) $(ADIOSLIB_LDFLAGS) +big_file.o: big_file.c + +steps_write_SOURCES=steps_write.c +steps_write_LDADD = $(top_builddir)/src/libadios.a $(ADIOSLIB_LDADD) +steps_write_LDFLAGS = $(AM_LDFLAGS) $(ADIOSLIB_LDFLAGS) +steps_write.o: steps_write.c + +steps_read_file_SOURCES=steps_read_file.c +steps_read_file_LDADD = $(top_builddir)/src/libadiosread.a $(ADIOSREADLIB_LDADD) +steps_read_file_LDFLAGS = $(AM_LDFLAGS) $(ADIOSREADLIB_LDFLAGS) +steps_read_file.o: steps_read_file.c + +steps_read_stream_SOURCES=steps_read_stream.c +steps_read_stream_LDADD = $(top_builddir)/src/libadiosread.a $(ADIOSREADLIB_LDADD) +steps_read_stream_LDFLAGS = $(AM_LDFLAGS) $(ADIOSREADLIB_LDFLAGS) +steps_read_stream.o: steps_read_stream.c + +blocks_SOURCES=blocks.c +blocks_LDADD = $(top_builddir)/src/libadios.a $(ADIOSLIB_LDADD) +blocks_LDFLAGS = $(AM_LDFLAGS) $(ADIOSLIB_LDFLAGS) +blocks.o: blocks.c + +build_standard_dataset_SOURCES = build_standard_dataset.c +build_standard_dataset_LDADD = $(top_builddir)/src/libadios.a $(ADIOSLIB_LDADD) +build_standard_dataset_LDFLAGS = $(AM_LDFLAGS) $(ADIOSLIB_LDFLAGS) + +transforms_writeblock_read_SOURCES = transforms_writeblock_read.c +transforms_writeblock_read_LDADD = $(top_builddir)/src/libadiosread.a $(ADIOSREADLIB_LDADD) +transforms_writeblock_read_LDFLAGS = $(AM_LDFLAGS) $(ADIOSREADLIB_LDFLAGS) + +#transforms_SOURCES=transforms.c +#transforms_CPPFLAGS = -DADIOS_USE_READ_API_1 +#transforms_LDADD = $(top_builddir)/src/libadios.a $(ADIOSLIB_LDADD) +#transforms_LDFLAGS = $(AM_LDFLAGS) $(ADIOSLIB_LDFLAGS) +#transforms.o: transforms.c + +copy_subvolume_SOURCES=copy_subvolume.c +copy_subvolume_LDADD = $(top_builddir)/src/libadiosread_nompi.a $(ADIOSREADLIB_SEQ_LDADD) +copy_subvolume_LDFLAGS = $(AM_LDFLAGS) $(ADIOSREADLIB_SEQ_LDFLAGS) +copy_subvolume_CPPFLAGS = -I$(top_srcdir)/src $(ADIOSREADLIB_SEQ_CPPFLAGS) +#copy_subvolume.o: copy_subvolume.c + +transforms_specparse_SOURCES=transforms_specparse.c +transforms_specparse_LDADD = $(top_builddir)/src/libadios_nompi.a $(ADIOSLIB_SEQ_LDADD) +transforms_specparse_LDFLAGS = $(AM_LDFLAGS) $(ADIOSLIB_SEQ_LDFLAGS) +transforms_specparse_CPPFLAGS = -I$(top_srcdir)/src $(ADIOSLIB_SEQ_CPPFLAGS) +#transforms_specparse.o: transforms_specparse.c + + + + + + + +group_free_test_SOURCES=group_free_test.c +group_free_test_LDADD = $(top_builddir)/src/libadios_nompi.a $(ADIOSLIB_SEQ_LDADD) +group_free_test_LDFLAGS = $(AM_LDFLAGS) $(ADIOSLIB_SEQ_LDFLAGS) +group_free_test_CPPFLAGS = -I$(top_srcdir)/src $(ADIOSLIB_SEQ_CPPFLAGS) +group_free_test.o: group_free_test.c + +EXTRA_DIST = adios_amr_write.xml adios_amr_write_2vars.xml \ + posix_method.xml local_array_time.xml \ + write_alternate.xml write_read.xml transforms.xml \ + path_test.xml adios_transforms.xml \ + two_groups.xml set_path.xml set_path_var.xml + +CLEANFILES = gwrite_posix_method.fh gread_posix_method.fh + +CC=$(MPICC) +FC=$(MPIFC) + +FCLINK = \ + $(LIBTOOL) --mode=link --tag F77 $(FC) \ + $(AM_FCFLAGS) $(FCFLAGS) $(LDFLAGS) -o $@ diff --git a/tests/libs/adios/tests/suite/programs/adios_amr_write.c b/tests/libs/adios/tests/suite/programs/adios_amr_write.c new file mode 100644 index 0000000000..a6247b7d43 --- /dev/null +++ b/tests/libs/adios/tests/suite/programs/adios_amr_write.c @@ -0,0 +1,100 @@ +/* + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + */ + +/* ADIOS C Example: write a global array from N processors using MPI_AGGREGATE. + * + * How to run: mpirun -np adios_amr_write + * Output: adios_amr_write.bp + * ADIOS config file: adios_amr_write.xml + * +*/ +#include +#include +#include "adios.h" +int main (int argc, char ** argv) +{ + char filename [256]; + int rank, size, i, pattern, npe_1, npe_2; + int l1, l2, o1, o2, g1, g2; + double t1, t2; + MPI_Comm comm = MPI_COMM_WORLD; + + /* ADIOS variables declarations for matching gwrite_temperature.ch */ + int adios_err; + uint64_t adios_groupsize, adios_totalsize; + int64_t adios_handle; + + MPI_Init (&argc, &argv); + + if (argc != 2) + { + printf ("Invalid command line arguments.\n"); + exit (1); + } + + pattern = atoi (argv[1]); + + MPI_Comm_rank (comm, &rank); + MPI_Comm_size (comm, &size); + + g1 = 32; + g2 = 16; + + if (pattern == 1) + { + l1 = 1; + l2 = g2; + } + else if (pattern == 2) + { + /* 4x4 array */ + l1 = 4; + l2 = 4; + } + else + { + printf ("wrong argument.\n"); + } + + npe_1 = g1 / l1; + npe_2 = g2 / l2; + + o1 = (rank / npe_2) * l1; + o2 = (rank % npe_2) * l2; + + double t[l1*l2]; + + for (i = 0; i < l1 * l2; i++) + { + t[i] = o1 * g2 + o2 + (i / l2) * g2 + i % l2; + } + + strcpy (filename, "adios_amr_write.bp"); + + adios_init ("adios_amr_write.xml", comm); + + adios_open (&adios_handle, "temperature", filename, "w", comm); + + adios_groupsize = 4 * 8\ + + 8 * l1 * l2; + adios_group_size (adios_handle, adios_groupsize, &adios_totalsize); + adios_write (adios_handle, "l1", &l1); + adios_write (adios_handle, "l2", &l2); + adios_write (adios_handle, "o1", &o1); + adios_write (adios_handle, "o2", &o2); + adios_write (adios_handle, "g1", &g1); + adios_write (adios_handle, "g2", &g2); + adios_write (adios_handle, "temperature", t); + + adios_close (adios_handle); + + adios_finalize (rank); + + MPI_Finalize (); + + return 0; +} diff --git a/tests/libs/adios/tests/suite/programs/adios_amr_write.xml b/tests/libs/adios/tests/suite/programs/adios_amr_write.xml new file mode 100644 index 0000000000..6d96580816 --- /dev/null +++ b/tests/libs/adios/tests/suite/programs/adios_amr_write.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + +stripe_count=1;stripe_size=10485760;num_aggregators=8;merging_pgs=0;num_ost=2 + + + + + diff --git a/tests/libs/adios/tests/suite/programs/adios_amr_write_2vars.c b/tests/libs/adios/tests/suite/programs/adios_amr_write_2vars.c new file mode 100644 index 0000000000..e1d2ec9791 --- /dev/null +++ b/tests/libs/adios/tests/suite/programs/adios_amr_write_2vars.c @@ -0,0 +1,104 @@ +/* + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + */ + +/* ADIOS C Example: write a global array from N processors using MPI_AGGREGATE. + * + * How to run: mpirun -np adios_amr_write + * Output: adios_amr_write.bp + * ADIOS config file: adios_amr_write.xml + * +*/ +#include +#include +#include "adios.h" +int main (int argc, char ** argv) +{ + char filename [256]; + int rank, size, i, pattern, npe_1, npe_2; + int l1, l2, o1, o2, g1, g2; + double t1, t2; + MPI_Comm comm = MPI_COMM_WORLD; + + /* ADIOS variables declarations for matching gwrite_temperature.ch */ + int adios_err; + uint64_t adios_groupsize, adios_totalsize; + int64_t adios_handle; + + MPI_Init (&argc, &argv); + + if (argc != 2) + { + printf ("Invalid command line arguments.\n"); + exit (1); + } + + pattern = atoi (argv[1]); + + MPI_Comm_rank (comm, &rank); + MPI_Comm_size (comm, &size); + + g1 = 32; + g2 = 16; + + if (pattern == 1) + { + l1 = 1; + l2 = g2; + } + else if (pattern == 2) + { + /* 4x4 array */ + l1 = 4; + l2 = 4; + } + else + { + printf ("wrong argument.\n"); + } + + npe_1 = g1 / l1; + npe_2 = g2 / l2; + + o1 = (rank / npe_2) * l1; + o2 = (rank % npe_2) * l2; + + double t[l1*l2]; + int p[l1*l2]; + + for (i = 0; i < l1 * l2; i++) + { + t[i] = o1 * g2 + o2 + (i / l2) * g2 + i % l2; + p[i] = 1000 + t[i]; + } + + strcpy (filename, "adios_amr_write_2vars.bp"); + + adios_init ("adios_amr_write_2vars.xml", comm); + + adios_open (&adios_handle, "temperature", filename, "w", comm); + + adios_groupsize = 4 * 8\ + + 8 * l1 * l2 + + 4 * l1 * l2; + adios_group_size (adios_handle, adios_groupsize, &adios_totalsize); + adios_write (adios_handle, "l1", &l1); + adios_write (adios_handle, "l2", &l2); + adios_write (adios_handle, "o1", &o1); + adios_write (adios_handle, "o2", &o2); + adios_write (adios_handle, "g1", &g1); + adios_write (adios_handle, "g2", &g2); + adios_write (adios_handle, "temperature", t); + adios_write (adios_handle, "pressure", p); + + adios_close (adios_handle); + + adios_finalize (rank); + + MPI_Finalize (); + + return 0; +} diff --git a/tests/libs/adios/tests/suite/programs/adios_amr_write_2vars.xml b/tests/libs/adios/tests/suite/programs/adios_amr_write_2vars.xml new file mode 100644 index 0000000000..0e55b4d998 --- /dev/null +++ b/tests/libs/adios/tests/suite/programs/adios_amr_write_2vars.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/libs/adios/tests/suite/programs/adios_staged_read.c b/tests/libs/adios/tests/suite/programs/adios_staged_read.c new file mode 100644 index 0000000000..afac4a17db --- /dev/null +++ b/tests/libs/adios/tests/suite/programs/adios_staged_read.c @@ -0,0 +1,189 @@ +/* + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + */ + +/* This code is used to test staged-read method. +*/ +#include +#include +#include +#include + +#define ADIOS_USE_READ_API_1 +#include "adios_read.h" + +#ifdef DMALLOC +#include "dmalloc.h" +#endif + +enum pattern +{ + PATTERN_1 = 1, + PATTERN_2, + PATTERN_3, + PATTERN_4, + PATTERN_5 +}; + +int main (int argc, char ** argv) +{ + char filename [256]; + int rank, size, i, j, NX, pattern; + MPI_Comm comm = MPI_COMM_WORLD; + void * data = NULL, * data1 = NULL, * data2 = NULL; + uint64_t start[2], count[2], bytes_read = 0, slice_size; + + MPI_Init (&argc, &argv); + + if (argc != 2) + { + printf ("Invalid command line arguments.\n"); + exit (1); + } + + pattern = atoi (argv[1]); + MPI_Comm_rank (comm, &rank); + MPI_Comm_size (comm, &size); + + /* set the read method to staged read */ + adios_set_read_method (ADIOS_READ_METHOD_BP_AGGREGATE); + + ADIOS_FILE * f = adios_fopen ("adios_amr_write.bp", comm); + + if (!f) + { + printf ("%s\n", adios_errmsg()); + return -1; + } + + ADIOS_GROUP * g = adios_gopen (f, "temperature"); + if (!g) + { + printf ("%s\n", adios_errmsg()); + return -1; + } + + ADIOS_VARINFO * v = adios_inq_var (g, "temperature"); + + switch (pattern) + { + case PATTERN_1: + slice_size = v->dims[0]/size; + + start[0] = rank * slice_size; + count[0] = slice_size; + if (rank == size - 1) + { + slice_size = slice_size + v->dims[0] % size; + } + + start[1] = 0; + count[1] = v->dims[1]; + + data = malloc (slice_size * v->dims[1] * sizeof (double)); + + break; + case PATTERN_2: + start[0] = 0; + count[0] = v->dims[0]; + + slice_size = v->dims[1]/size; + + start[1] = slice_size * rank; + if (rank == size - 1) + { + slice_size = slice_size + v->dims[1] % size; + } + count[1] = slice_size; + + data = malloc (slice_size * v->dims[0] * sizeof (double)); + + break; + case PATTERN_3: + start[0] = 0; + count[0] = 4; + + slice_size = 3; + + start[1] = 2 + slice_size * rank; + count[1] = slice_size; + + data = malloc (slice_size * count[0] * sizeof (double)); + + break; + case PATTERN_4: + start[0] = 0; + count[0] = 32; + + slice_size = 3; + + start[1] = 2 + slice_size * rank; + count[1] = slice_size; + + data = malloc (slice_size * count[0] * sizeof (double)); + + break; + case PATTERN_5: + start[0] = 0; + count[0] = 32; + + slice_size = 3; + + start[1] = 2 + slice_size * rank; + count[1] = slice_size; + + data = malloc (slice_size * count[0] * sizeof (double)); + + break; + default: + printf ("wrong pattern value\n"); + } + + assert (data); + bytes_read = adios_read_var (g, "temperature", start, count, data); + + adios_gclose (g); + + adios_fclose (f); + + if (pattern != PATTERN_5) + { + if (rank == 0) + { + for (i = 0; i < count[0]; i++) + { + for (j = 0; j < count[1]; j++) + { + printf (" %7.5g", * ((double *)data + i * count[1] + j)); + } + + printf ("\n"); + } + } + } + else + { + if (rank == 1) + { + for (i = 0; i < count[0]; i++) + { + for (j = 0; j < count[1]; j++) + { + printf (" %7.5g", * ((double *)data + i * count[1] + j)); + } + + printf ("\n"); + } + } + } + + free (data); + adios_free_varinfo (v); + + MPI_Finalize (); + + return 0; +} diff --git a/tests/libs/adios/tests/suite/programs/adios_staged_read_2vars.c b/tests/libs/adios/tests/suite/programs/adios_staged_read_2vars.c new file mode 100644 index 0000000000..8cd975a308 --- /dev/null +++ b/tests/libs/adios/tests/suite/programs/adios_staged_read_2vars.c @@ -0,0 +1,271 @@ +/* + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + */ + +/* This code is used to test staged-read method. +*/ +#include +#include +#include +#include + +#define ADIOS_USE_READ_API_1 +#include "adios_read.h" + +#ifdef DMALLOC +#include "dmalloc.h" +#endif + +enum pattern +{ + PATTERN_1 = 1, + PATTERN_2, + PATTERN_3, + PATTERN_4, + PATTERN_5 +}; + +int main (int argc, char ** argv) +{ + char filename [256]; + int rank, size, i, j, NX, pattern; + MPI_Comm comm = MPI_COMM_WORLD; + void * data1 = NULL, * data2 = NULL; + uint64_t start1[2], count1[2], bytes_read = 0, slice_size; + uint64_t start2[2], count2[2]; + + MPI_Init (&argc, &argv); + + if (argc != 2) + { + printf ("Invalid command line arguments.\n"); + exit (1); + } + + pattern = atoi (argv[1]); + MPI_Comm_rank (comm, &rank); + MPI_Comm_size (comm, &size); + + /* set the read method to staged read */ + adios_set_read_method (ADIOS_READ_METHOD_BP_AGGREGATE); + + ADIOS_FILE * f = adios_fopen ("adios_amr_write_2vars.bp", comm); + + if (!f) + { + printf ("%s\n", adios_errmsg()); + return -1; + } + + ADIOS_GROUP * g = adios_gopen (f, "temperature"); + if (!g) + { + printf ("%s\n", adios_errmsg()); + return -1; + } + + ADIOS_VARINFO * v1 = adios_inq_var (g, "temperature"); + ADIOS_VARINFO * v2 = adios_inq_var (g, "pressure"); + + switch (pattern) + { + case PATTERN_1: + /* temperature */ + slice_size = v1->dims[0]/size; + + start1[0] = rank * slice_size; + count1[0] = slice_size; + if (rank == size - 1) + { + slice_size = slice_size + v1->dims[0] % size; + } + + start1[1] = 0; + count1[1] = v1->dims[1]; + + /* pressure */ + slice_size = v2->dims[0]/size; + + start2[0] = rank * slice_size; + count2[0] = slice_size; + if (rank == size - 1) + { + slice_size = slice_size + v2->dims[0] % size; + } + + start2[1] = 0; + count2[1] = v2->dims[1]; + + break; + case PATTERN_2: + /* temperature */ + start1[0] = 0; + count1[0] = v1->dims[0]; + + slice_size = v1->dims[1]/size; + + start1[1] = slice_size * rank; + if (rank == size - 1) + { + slice_size = slice_size + v1->dims[1] % size; + } + count1[1] = slice_size; + + /* pressure */ + start2[0] = 0; + count2[0] = v2->dims[0]; + + slice_size = v2->dims[1]/size; + + start2[1] = slice_size * rank; + if (rank == size - 1) + { + slice_size = slice_size + v2->dims[1] % size; + } + count2[1] = slice_size; + + break; + case PATTERN_3: + /* temperature */ + start1[0] = 0; + count1[0] = 4; + + slice_size = 3; + + start1[1] = 2 + slice_size * rank; + count1[1] = slice_size; + + /* pressure */ + start2[0] = 0; + count2[0] = 4; + + slice_size = 3; + + start2[1] = 2 + slice_size * rank; + count2[1] = slice_size; + + break; + case PATTERN_4: + /* temperature */ + start1[0] = 0; + count1[0] = 32; + + slice_size = 3; + + start1[1] = 2 + slice_size * rank; + count1[1] = slice_size; + + /* pressure */ + start2[0] = 0; + count2[0] = 32; + + slice_size = 3; + + start2[1] = 2 + slice_size * rank; + count2[1] = slice_size; + + break; + case PATTERN_5: + /* temperature */ + start1[0] = 0; + count1[0] = 32; + + slice_size = 3; + + start1[1] = 2 + slice_size * rank; + count1[1] = slice_size; + + /* pressure */ + start2[0] = 0; + count2[0] = 32; + + slice_size = 3; + + start2[1] = 2 + slice_size * rank; + count2[1] = slice_size; + + break; + default: + printf ("wrong pattern value\n"); + } + + data1 = malloc (count1[0] * count1[1] * sizeof (double)); + data2 = malloc (count2[0] * count2[1] * sizeof (int)); + assert (data1); + assert (data2); + + adios_read_var (g, "temperature", start1, count1, data1); + adios_read_var (g, "pressure", start2, count2, data2); + + adios_gclose (g); + + adios_fclose (f); + + if (pattern != PATTERN_5) + { + if (rank == 0) + { + for (i = 0; i < count1[0]; i++) + { + for (j = 0; j < count1[1]; j++) + { + printf (" %7.5g", * ((double *)data1 + i * count1[1] + j)); + } + + printf ("\n"); + } + + printf ("\n"); + + for (i = 0; i < count2[0]; i++) + { + for (j = 0; j < count2[1]; j++) + { + printf (" %7d", * ((int *)data2 + i * count2[1] + j)); + } + + printf ("\n"); + } + } + } + else + { + if (rank == 1) + { + for (i = 0; i < count1[0]; i++) + { + for (j = 0; j < count1[1]; j++) + { + printf (" %7.5g", * ((double *)data1 + i * count1[1] + j)); + } + + printf ("\n"); + } + + printf ("\n"); + + for (i = 0; i < count2[0]; i++) + { + for (j = 0; j < count2[1]; j++) + { + printf (" %7d", * ((int *)data2 + i * count2[1] + j)); + } + + printf ("\n"); + } + + } + } + + free (data1); + free (data2); + adios_free_varinfo (v1); + adios_free_varinfo (v2); + + MPI_Finalize (); + + return 0; +} diff --git a/tests/libs/adios/tests/suite/programs/adios_staged_read_v2.c b/tests/libs/adios/tests/suite/programs/adios_staged_read_v2.c new file mode 100644 index 0000000000..0c90777746 --- /dev/null +++ b/tests/libs/adios/tests/suite/programs/adios_staged_read_v2.c @@ -0,0 +1,186 @@ +/* + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + */ + +/* This code is used to test staged-read method. +*/ +#include +#include +#include +#include + +#include "adios_read.h" + +#ifdef DMALLOC +#include "dmalloc.h" +#endif + +enum pattern +{ + PATTERN_1 = 1, + PATTERN_2, + PATTERN_3, + PATTERN_4, + PATTERN_5 +}; + +int main (int argc, char ** argv) +{ + char filename [256]; + int rank, size, i, j, NX, pattern, err; + MPI_Comm comm = MPI_COMM_WORLD; + void * data = NULL, * data1 = NULL, * data2 = NULL; + uint64_t start[2], count[2], bytes_read = 0, slice_size; + ADIOS_SELECTION *sel; + ADIOS_FILE * f; + ADIOS_VARINFO * vi; + + MPI_Init (&argc, &argv); + + if (argc != 2) + { + printf ("Invalid command line arguments.\n"); + exit (1); + } + + pattern = atoi (argv[1]); + MPI_Comm_rank (comm, &rank); + MPI_Comm_size (comm, &size); + + err = adios_read_init_method(ADIOS_READ_METHOD_BP_AGGREGATE, comm, "verbose=2"); + + f = adios_read_open_file ("adios_amr_write.bp", ADIOS_READ_METHOD_BP_AGGREGATE, comm); + if (!f) + { + printf ("Error at opening file: %s\n", adios_errmsg()); + return 1; + } + + + ADIOS_VARINFO * v = adios_inq_var (f, "temperature"); + switch (pattern) + { + case PATTERN_1: + slice_size = v->dims[0]/size; + + start[0] = rank * slice_size; + count[0] = slice_size; + if (rank == size - 1) + { + slice_size = slice_size + v->dims[0] % size; + } + + start[1] = 0; + count[1] = v->dims[1]; + + data = malloc (slice_size * v->dims[1] * sizeof (double)); + + break; + case PATTERN_2: + start[0] = 0; + count[0] = v->dims[0]; + + slice_size = v->dims[1]/size; + + start[1] = slice_size * rank; + if (rank == size - 1) + { + slice_size = slice_size + v->dims[1] % size; + } + count[1] = slice_size; + + data = malloc (slice_size * v->dims[0] * sizeof (double)); + + break; + case PATTERN_3: + start[0] = 0; + count[0] = 4; + + slice_size = 3; + + start[1] = 2 + slice_size * rank; + count[1] = slice_size; + + data = malloc (slice_size * count[0] * sizeof (double)); + + break; + case PATTERN_4: + start[0] = 0; + count[0] = 32; + + slice_size = 3; + + start[1] = 2 + slice_size * rank; + count[1] = slice_size; + + data = malloc (slice_size * count[0] * sizeof (double)); + + break; + case PATTERN_5: + start[0] = 0; + count[0] = 32; + + slice_size = 3; + + start[1] = 2 + slice_size * rank; + count[1] = slice_size; + + data = malloc (slice_size * count[0] * sizeof (double)); + + break; + default: + printf ("wrong pattern value\n"); + } + + assert (data); + + sel = adios_selection_boundingbox (2, start, count); + adios_schedule_read (f, sel, "temperature", 0, 1, data); + adios_perform_reads (f, 1); + adios_selection_delete (sel); + + adios_read_close(f); + + + if (pattern != PATTERN_5) + { + if (rank == 0) + { + for (i = 0; i < count[0]; i++) + { + for (j = 0; j < count[1]; j++) + { + printf (" %7.5g", * ((double *)data + i * count[1] + j)); + } + + printf ("\n"); + } + } + } + else + { + if (rank == 1) + { + for (i = 0; i < count[0]; i++) + { + for (j = 0; j < count[1]; j++) + { + printf (" %7.5g", * ((double *)data + i * count[1] + j)); + } + + printf ("\n"); + } + } + } + + free (data); + adios_free_varinfo (v); + + adios_read_finalize_method (ADIOS_READ_METHOD_BP_AGGREGATE); + MPI_Finalize (); + + return 0; +} diff --git a/tests/libs/adios/tests/suite/programs/adios_transforms.xml b/tests/libs/adios/tests/suite/programs/adios_transforms.xml new file mode 100644 index 0000000000..414a21719d --- /dev/null +++ b/tests/libs/adios/tests/suite/programs/adios_transforms.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/libs/adios/tests/suite/programs/adios_transforms_read_write.c b/tests/libs/adios/tests/suite/programs/adios_transforms_read_write.c new file mode 100644 index 0000000000..38470a12e1 --- /dev/null +++ b/tests/libs/adios/tests/suite/programs/adios_transforms_read_write.c @@ -0,0 +1,222 @@ +/* + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + */ + +/* ADIOS C Example: write a global array from N processors using MPI_AGGREGATE. + * + * How to run: mpirun -np adios_transform_read_write + * Output: adios_transform_write.bp + * ADIOS config file: adios_transform_write.xml + * +*/ +#include +#include +#include +#include "adios.h" +#include "adios_read.h" +#include +#include + +const int ntransforms = 7; +const char varname_xform [][256] = { "t_none", + "t_identity", + "t_zlib", + "t_szip", + "t_bzip2", + "t_aplod", + "t_isobar" +}; + +int find_var (ADIOS_FILE *f, char *name) +{ + int i; + for (i=0; invars; i++) + { + // skip the leading / in the file's varname list in the comparison + if (!strcmp(name, f->var_namelist[i])) + return 1; + } + return 0; +} + + +int read_box (char *filename) +{ + + double *data_xform [ntransforms]; + MPI_Comm comm = MPI_COMM_WORLD; + + enum ADIOS_READ_METHOD method = ADIOS_READ_METHOD_BP; + ADIOS_FILE *f = adios_read_open_file (filename, method, comm); + ADIOS_VARINFO *varinfo = adios_inq_var (f, varname_xform [0]); + ADIOS_SELECTION *sel1; + + assert (varinfo); + adios_inq_var_blockinfo (f, varinfo); + + uint32_t nblocks = varinfo->sum_nblocks; + uint32_t ndim = varinfo->ndim; + uint64_t *pg_dims = varinfo->blockinfo [0].count; + + uint64_t npoints = 0; + uint64_t *starts = (uint64_t *) calloc (varinfo->ndim, sizeof (uint64_t)); + uint64_t *counts = (uint64_t *) calloc (varinfo->ndim, sizeof (uint64_t)); + + uint64_t data_size = 0; + int rank; + int i = 0; + int retval = 0; + + MPI_Comm_rank (comm, &rank); + srand (rank); + + assert (varinfo->ndim); + + npoints = 1; + + // Generate the start offsets and lengths for each dimension + for (i = 0; i < varinfo->ndim; i ++) { + + // Not really a good way to generate random numbers. But will do for + // now + starts [i] = rand () % ((varinfo->dims [i] + 1) / 2); + counts [i] = rand () % ((varinfo->dims [i] + 1) / 2) + 1; + + npoints *= counts [i]; + + // printf ("[%d] %d %lld %lld\n", rank, i, starts [i], counts [i]); + } + + sel1 = adios_selection_boundingbox (varinfo->ndim, starts, counts); + + // Allocate memory for reading in the transformed data and schedule reads + // into the buffer + for (i = 0; i < ntransforms; i ++) { + if (find_var (f, varname_xform [i])) { + printf ("\n\t %s variable exists, schedule to read...", varname_xform [i]); + data_xform [i] = malloc (npoints * sizeof (double)); + adios_schedule_read (f, sel1, varname_xform [i], 0, 1, data_xform [i]); + } else { + printf ("\n\t %s variable is not in the file, skip.", varname_xform [i]); + data_xform [i] = NULL; + } + } + printf ("\n"); + + // Read them all at once + adios_perform_reads (f, 1); + + data_size = npoints * sizeof (double); + + // Output for each transform must match that of no transform + for (i = 1; i < ntransforms; i ++) { + if (data_xform [i]) { + if (memcmp (data_xform [0], data_xform [i], data_size) != 0) { + printf ("\n\t %s --- Failed", varname_xform [i]); + retval = 1; + } else { + printf ("\n\t %s --- OK", varname_xform [i]); + } + free (data_xform [i]); + } + } + + printf ("\n"); + + free (data_xform [0]); + adios_selection_delete (sel1); + + free (starts); + free (counts); + + adios_free_varinfo (varinfo); + adios_read_close (f); + adios_read_finalize_method (ADIOS_READ_METHOD_BP); + + return retval; +} + +int main (int argc, char *argv []) +{ + char filename [256]; + int rank, size, i, retval; + int l1, l2, o1, o2, g1, g2; + MPI_Comm comm = MPI_COMM_WORLD; + + int adios_err; + uint64_t adios_groupsize, adios_totalsize; + int64_t adios_handle; + double *t; + + uint32_t timestep = 0; + + MPI_Init (&argc, &argv); + MPI_Comm_rank (comm, &rank); + MPI_Comm_size (comm, &size); + + + + + strcpy (filename, "adios_transforms_read_write.bp"); + + adios_init ("adios_transforms.xml", comm); + + o1 = rank; + o2 = 0; + l1 = 1; + l2 = 64; + + g1 = size; + g2 = 64; + + t = (double *) malloc (l1*l2*sizeof(double)); + + // Write out 'size' timesteps. During the reads each rank would read in its + // own timestep + for (timestep = 0; timestep < size; timestep ++) { + + if (timestep == 0) { + adios_open (&adios_handle, "transform", filename, "w", comm); + } else { + adios_open (&adios_handle, "transform", filename, "a", comm); + } + + adios_groupsize = 6 * sizeof (int) \ + + ntransforms * sizeof (double) * l1 * l2; + + // Taken from adios_amr_write + for (i = 0; i < l1 * l2; i++) { + t[i] = timestep + o1 * g2 + o2 + (i / l2) * g2 + i % l2; + } + + adios_group_size (adios_handle, adios_groupsize, &adios_totalsize); + //printf ("\t Per process group size = %lld, with metadata = %lld\n", + // adios_groupsize, adios_totalsize); + adios_write (adios_handle, "l1", &l1); + adios_write (adios_handle, "l2", &l2); + adios_write (adios_handle, "o1", &o1); + adios_write (adios_handle, "o2", &o2); + adios_write (adios_handle, "g1", &g1); + adios_write (adios_handle, "g2", &g2); + + // We want to test whether the arrays written out + // below can recovered without corruption during reads + for (i = 0; i < ntransforms; i ++) { + adios_write (adios_handle, varname_xform [i], t); + } + + adios_close (adios_handle); + } + + adios_finalize (rank); + + retval = read_box (filename); + + MPI_Finalize (); + + return retval; +} + diff --git a/tests/libs/adios/tests/suite/programs/big_file.c b/tests/libs/adios/tests/suite/programs/big_file.c new file mode 100644 index 0000000000..0cc1a025ca --- /dev/null +++ b/tests/libs/adios/tests/suite/programs/big_file.c @@ -0,0 +1,340 @@ +/* + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + */ + +/* ADIOS C test: + * Write >2GB data per process + * Then read them all and check if they are correct. + * + * How to run: mpirun -np big_file + * Output: big_file.bp + * + */ +#include +#include +#include +#include +#include +#include "adios.h" +#include "adios_read.h" + +#ifdef DMALLOC +#include "dmalloc.h" +#endif + +#define log(...) fprintf (stderr, "[rank=%3.3d, line %d]: ", rank, __LINE__); fprintf (stderr, __VA_ARGS__); fflush(stderr); +#define printE(...) fprintf (stderr, "[rank=%3.3d, line %d]: ERROR: ", rank, __LINE__); fprintf (stderr, __VA_ARGS__); fflush(stderr); + +int NSTEPS = 1; +static const char FILENAME[] = "big_file.bp"; +#define VALUE(rank, step) (step * 1000 + rank + 1) + +/* Variables to write */ +int *a2; + +/* 2.5GB = 32*20 * 1M * sizeof(int) */ +/* 4.25GB = 32*34 * 1M * sizeof(int) */ +static const int ldim1 = 1024*32; +static const int ldim2 = 1024*34; +int gdim1, gdim2; +int offs1, offs2; + +int64_t m_adios_group; + +/* Variables to read */ +int *r2; + +MPI_Comm comm = MPI_COMM_WORLD; +int rank; +int size; + +void alloc_vars() +{ + size_t n; + + n = (size_t)ldim1 * (size_t)ldim2; + log ("Allocate 2 arrays of %llu integers...\n",n); + a2 = (int*) malloc (n * sizeof(int)); + r2 = (int*) malloc (n * sizeof(int)); +} + +void set_gdim() +{ + gdim1 = size*ldim1; + gdim2 = ldim2; +} + +void set_offsets () +{ + offs1 = rank*ldim1; + offs2 = 0; +} + +void set_vars(int step) +{ + size_t n, i; + int v = VALUE(rank, step); + + set_offsets(); + + n = (size_t)ldim1 * (size_t)ldim2; + log (" Fill up array of %llu elements to value %d...\n",n,v); + for (i=0; i\n" + " : Number of write cycles (to same file)\n"); +} + +void define_vars (); +int write_file (int step); +int read_file (); + +int main (int argc, char ** argv) +{ + int err,i ; + + MPI_Init (&argc, &argv); + MPI_Comm_rank (comm, &rank); + MPI_Comm_size (comm, &size); + + if (argc < 2) { Usage(); return 1; } + + errno = 0; + i = strtol (argv[1], NULL, 10); + if (errno || i < 1) { printf("Invalid 1st argument %s\n", argv[1]); Usage(); return 1;} + NSTEPS = i; + + alloc_vars(); + adios_init_noxml (comm); + adios_allocate_buffer (ADIOS_BUFFER_ALLOC_NOW, 4400); + err = adios_read_init_method(ADIOS_READ_METHOD_BP, comm, "verbose=2"); + if (err) { + printE ("%s\n", adios_errmsg()); + } + + adios_declare_group (&m_adios_group, "bigdata", "iter", adios_flag_yes); + adios_select_method (m_adios_group, "MPI", "", ""); + + + define_vars(); + set_gdim(); + + for (i=0; indim != NDIM) { \ + printE ("Variable %s has %d dimensions, but expected %d\n", VARNAME, vi->ndim, NDIM); \ + err = 102; \ + goto endread; \ + } \ + if (vi->nsteps != NSTEPS) { \ + printE ("Variable %s has %d steps, but expected %d\n", VARNAME, vi->nsteps, NSTEPS); \ + err = 103; \ + /*goto endread; */\ + } \ + adios_free_varinfo (vi); + +#define CHECK_SCALAR(VARNAME, VAR, VALUE, STEP) \ + if (VAR != VALUE) { \ + printE (#VARNAME " step %d: wrote %d but read %d\n",STEP,VALUE,VAR);\ + err = 104; \ + /*goto endread;*/\ + } + +#define CHECK_ARRAY(VARNAME,A,N,VALUE,STEP,i) \ + for (i=0;i blocks + * Output: blocks.bp + * Exit code: the number of errors found (0=OK) + * + */ + +#include +#include +#include +#include +#include "adios.h" +#include "adios_read.h" +#include "adios_error.h" + +const static char fname[] = "blocks.bp"; +const static MPI_Comm comm = MPI_COMM_WORLD; +static int rank, size; +static int nerrors = 0; + +int write_blocks (); +void print_written_info(); +int read_all (); +int read_stepbystep (); +int read_scalar (); +int read_scalar_stepbystep (); + +/* Remember (on rank 0) what was written (from all process) to check against it at reading */ +static int nblocks_per_step; +static int nsteps; +static uint64_t * block_offset; // block_offset[ step*nblocks_per_step + i ] is i-th block offset written in "step". +static uint64_t * block_count; // block_count [ step*nblocks_per_step + i ] is i-th block size written in "step". +static uint64_t * gdims; // gdims[i] is the global dimension in i-th "step". + + +int main (int argc, char ** argv) +{ + MPI_Init (&argc, &argv); + MPI_Comm_rank (comm, &rank); + MPI_Comm_size (comm, &size); + + nerrors = 0; + write_blocks(); + if (!rank) { + print_written_info(); // this is just for debug to check if rank 0 stores the correct values + read_all(); + read_stepbystep(); + read_scalar(); + read_scalar_stepbystep (); + } + + MPI_Barrier (comm); + MPI_Finalize (); + free (block_offset); + free (block_count); + free (gdims); + if (!rank) printf ("----------- Done. Found %d errors -------\n", nerrors); + return nerrors; +} + +int write_blocks () +{ + int NX, G, O; + double *t; + /* ADIOS variables declarations for matching gwrite_temperature.ch */ + int it, i, r; + uint64_t adios_groupsize, adios_totalsize; + + if (!rank) printf ("------- Write blocks -------\n"); + // We will have "3 steps * 2 blocks per process * number of processes" blocks + nsteps = 3; + nblocks_per_step = 2; + block_offset = (uint64_t*) malloc (sizeof(uint64_t) * nsteps * nblocks_per_step * size); + block_count = (uint64_t*) malloc (sizeof(uint64_t) * nsteps * nblocks_per_step * size); + gdims = (uint64_t*) malloc (sizeof(uint64_t) * nsteps); + + adios_init_noxml (comm); + adios_allocate_buffer (ADIOS_BUFFER_ALLOC_NOW, 10); + + int64_t m_adios_group; + int64_t m_adios_file; + + adios_declare_group (&m_adios_group, "restart", "", adios_flag_yes); + adios_select_method (m_adios_group, "MPI", "", ""); + + adios_define_var (m_adios_group, "NX" + ,"", adios_integer + ,0, 0, 0); + + adios_define_var (m_adios_group, "G" + ,"", adios_integer + ,0, 0, 0); + + /* have to define O and temperature as many times as we + write them within one step (twice) */ + for (it=0; it < nblocks_per_step; it++) { + adios_define_var (m_adios_group, "O" + ,"", adios_integer + ,0, 0, 0); + + adios_define_var (m_adios_group, "t" + ,"", adios_double + ,"NX", "G", "O"); + } + + for (it =0; it < nsteps; it++) { + if (!rank) printf ("Step %d:\n", it); + NX = 10+it; + G = nblocks_per_step * NX * size; + + t = (double *) malloc (NX*sizeof(double)); + + for (i = 0; i < NX; i++) + t[i] = rank + it*0.1 + 0.01; + + MPI_Barrier (comm); + if (it==0) + adios_open (&m_adios_file, "restart", fname, "w", comm); + else + adios_open (&m_adios_file, "restart", fname, "a", comm); + adios_groupsize = 4 + 4 + 4 + NX * 8 + + 4 + 4 + 4 + NX * 8; + adios_group_size (m_adios_file, adios_groupsize, &adios_totalsize); + + adios_write(m_adios_file, "NX", (void *) &NX); + adios_write(m_adios_file, "G", (void *) &G); + O = rank * nblocks_per_step * NX; + adios_write(m_adios_file, "O", (void *) &O); + adios_write(m_adios_file, "t", t); + + printf ("rank %d: block 1: size=%d, offset=%d\n", rank, NX, O); + for (r = 0; r < size; r++) { + block_count [it*nblocks_per_step*size + nblocks_per_step*r] = NX; + block_offset [it*nblocks_per_step*size + nblocks_per_step*r] = r * nblocks_per_step * NX; + } + + for (i = 0; i < NX; i++) + t[i] += 0.01; + + O = rank * nblocks_per_step * NX + NX; + adios_write(m_adios_file, "O", (void *) &O); + adios_write(m_adios_file, "t", t); + + printf ("rank %d: block 2: size=%d, offset=%d\n", rank, NX, O); + for (r = 0; r < size; r++) { + block_count [it*nblocks_per_step*size + nblocks_per_step*r + 1] = NX; + block_offset [it*nblocks_per_step*size + nblocks_per_step*r + 1] = r * nblocks_per_step * NX + NX; + } + gdims [it] = G; + + adios_close (m_adios_file); + MPI_Barrier (comm); + + free(t); + } + + adios_finalize (rank); + + return 0; +} + +void print_written_info() +{ + int s, r, b; + printf ("\n------- Information recorded on rank 0 (read will compare to this info) --------\n"); + for (s = 0; s < nsteps; s++) { + printf ("Step %d:\n", s); + printf (" Global dim = %d\n", gdims[s]); + for (r = 0; r < size; r++) { + for (b = 0; b < nblocks_per_step; b++) { + printf (" rank %d: block %d: size=%llu, offset=%llu\n", r, b+1, + block_count [s*nblocks_per_step*size + nblocks_per_step*r + b], + block_offset [s*nblocks_per_step*size + nblocks_per_step*r + b] + ); + } + } + } +} + +int print_varinfo (ADIOS_FILE *f, int start_step) +{ + ADIOS_VARINFO * v; + int i,j,k; + + v = adios_inq_var (f, "t"); + adios_inq_var_blockinfo (f, v); + + printf ("ndim = %d\n", v->ndim); + printf ("dims[%llu]", v->dims[0]); + if (v->dims[0] != gdims[start_step]) + { + printf ("\tERROR: expected [%llu]", gdims[start_step]); + nerrors++; + } + printf("\n"); + printf ("nsteps = %d\n", v->nsteps); + printf ("sum_nblocks = %d\n", v->sum_nblocks); + k = 0; // blockinfo is a contigous 1D array of elements from 0 to v->sum_nblocks-1 + for (i = 0; i < v->nsteps; i++) { + printf (" nblocks[%d] = %d\n", i, v->nblocks[i]); + for (j = 0; j < v->nblocks[i]; j++) { + printf(" block %2d: [%llu:%llu]", j, + v->blockinfo[k].start[0], + v->blockinfo[k].start[0] + v->blockinfo[k].count[0]-1); + + if (v->blockinfo[k].start[0] != block_offset [(start_step+i)*nblocks_per_step*size + j] || + v->blockinfo[k].count[0] != block_count [(start_step+i)*nblocks_per_step*size + j] ) + { + nerrors++; + printf ("\tERROR: expected [%llu:%llu]", + block_offset [(start_step+i)*nblocks_per_step*size + j], + block_offset [(start_step+i)*nblocks_per_step*size + j] + + block_count [(start_step+i)*nblocks_per_step*size + j] -1 + ); + } + printf("\n"); + k++; + } + } + adios_free_varinfo (v); +} + + +int read_all () +{ + ADIOS_FILE * f; + float timeout_sec = 0.0; + int steps = 0; + int retval = 0; + MPI_Comm comm = MPI_COMM_SELF; + + adios_read_init_method (ADIOS_READ_METHOD_BP, comm, "verbose=3"); + printf ("\n--------- Read as file ------------\n"); + f = adios_read_open_file (fname, ADIOS_READ_METHOD_BP, comm); + if (f == NULL) { + printf ("Error at opening file: %s\n", adios_errmsg()); + retval = adios_errno; + } + else + { + /* Processing all the steps at once */ + print_varinfo (f, 0); + adios_read_close (f); + } + adios_read_finalize_method (ADIOS_READ_METHOD_BP); + return retval; +} + +int read_stepbystep () +{ + ADIOS_FILE * f; + float timeout_sec = 0.0; + int steps = 0; + int retval = 0; + MPI_Comm comm = MPI_COMM_SELF; + + adios_read_init_method (ADIOS_READ_METHOD_BP, comm, "verbose=3"); + printf ("\n--------- Read as stream ------------\n"); + f = adios_read_open (fname, ADIOS_READ_METHOD_BP, + comm, ADIOS_LOCKMODE_NONE, timeout_sec); + if (adios_errno == err_file_not_found) + { + printf ("Stream not found after waiting %f seconds: %s\n", + timeout_sec, adios_errmsg()); + retval = adios_errno; + } + else if (adios_errno == err_end_of_stream) + { + printf ("Stream terminated before open. %s\n", adios_errmsg()); + retval = adios_errno; + } + else if (f == NULL) { + printf ("Error at opening stream: %s\n", adios_errmsg()); + retval = adios_errno; + } + else + { + /* Processing loop over the steps (we are already in the first one) */ + while (adios_errno != err_end_of_stream) { + steps++; // steps start counting from 1 + printf ("Step: %d\n", f->current_step); + print_varinfo (f, f->current_step); + + // advance to 1) next available step with 2) blocking wait + adios_advance_step (f, 0, timeout_sec); + if (adios_errno == err_step_notready) + { + //printf ("No new step arrived within the timeout. Quit. %s\n", + // adios_errmsg()); + break; // quit while loop + } + } + adios_read_close (f); + } + adios_read_finalize_method (ADIOS_READ_METHOD_BP); + //printf ("We have processed %d steps\n", steps); + return retval; +} + + + +int print_scalar (ADIOS_FILE *f, char * name) +{ + ADIOS_VARINFO * v; + int i,j,k; + + v = adios_inq_var (f, name); + adios_inq_var_blockinfo (f, v); + + printf ("Scalar '%s':\n", name); + printf ("nsteps = %d\n", v->nsteps); + printf ("nblocks per step = %d\n", v->nblocks[0]); + + int err; + + /* Read one writeblock across all timesteps */ + int *data = (int*) calloc (v->nsteps, sizeof(int)); + ADIOS_SELECTION *s; + printf ("Read same instance across all timesteps:\n"); + for (i=0; i < v->nblocks[0]; i++) { + s = adios_selection_writeblock(i); + err = adios_schedule_read_byid(f, s, v->varid, 0, v->nsteps, data); + if (!err) + { + err = adios_perform_reads(f, 1); + if (!err) + { + err = 0; + printf (" block %d = [", i); + for (j=0; j < v->nsteps; j++) { + printf ("%d", data[j]); + if (data[j] != + block_offset [j*nblocks_per_step*size + i]) + { + err = 1; + } + if (j < v->nsteps-1) printf(","); + } + printf("]"); + + if (err) + { + nerrors++; + printf ("\tERROR expected = ["); + for (j=0; j < v->nsteps; j++) { + printf ("%llu", block_offset [j*nblocks_per_step*size + i]); + if (j < v->nsteps-1) printf(","); + } + printf("]"); + } + printf("\n"); + + } else { + printf ("ERROR at reading scalar '%s': %s\n", name, adios_errmsg()); + } + } else { + printf ("ERROR at scheduling read for scalar '%s': %s\n", name, adios_errmsg()); + } + adios_selection_delete(s); + } + + /* Now read piecewise, one writeblock at a time */ + printf ("Read each instance individually:\n"); + for (j=0; j < v->nsteps; j++) { + printf (" step %d: \n", j); + for (i=0; i < v->nblocks[j]; i++) { + s = adios_selection_writeblock(i); + err = adios_schedule_read_byid(f, s, v->varid, j, 1, data); + if (!err) + { + err = adios_perform_reads(f, 1); + if (!err) + { + printf (" block %d = %d", i, data[0]); + if (data[0] != + block_offset [j*nblocks_per_step*size + i]) + { + printf ("\tERROR expected = %llu", + block_offset [j*nblocks_per_step*size + i]); + nerrors++; + } + printf ("\n"); + } else { + printf ("ERROR at reading scalar '%s': %s\n", name, adios_errmsg()); + } + } else { + printf ("ERROR at scheduling read for scalar '%s': %s\n", name, adios_errmsg()); + } + adios_selection_delete(s); + } + } + + /* Now get them piecewise, but not with reading but through statistics */ + printf ("Get each instance individually from available statistics:\n"); + adios_inq_var_stat (f, v, 0, 1); + if (v->statistics && v->statistics->blocks) { + ADIOS_VARSTAT *stat = v->statistics; + int blockid = 0; + for (j=0; j < v->nsteps; j++) { + printf (" step %d: \n", j); + for (i=0; i < v->nblocks[j]; i++) { + printf (" block %d = %d", i, *(int*)stat->blocks->mins[blockid]); + if (*(int*)stat->blocks->mins[blockid] != + block_offset [j*nblocks_per_step*size + i]) + { + printf ("\tERROR expected = %llu", + block_offset [j*nblocks_per_step*size + i]); + nerrors++; + } + printf ("\n"); + blockid++; + } + } + } + + adios_free_varinfo (v); + free(data); +} + +int read_scalar () +{ + ADIOS_FILE * f; + float timeout_sec = 0.0; + int steps = 0; + int retval = 0; + MPI_Comm comm = MPI_COMM_SELF; + + adios_read_init_method (ADIOS_READ_METHOD_BP, comm, "verbose=3"); + printf ("\n--------- Read all instances of the scalar 'O' ------------\n"); + f = adios_read_open_file (fname, ADIOS_READ_METHOD_BP, comm); + if (f == NULL) { + printf ("Error at opening file: %s\n", adios_errmsg()); + retval = adios_errno; + } + else + { + /* Read the scalar O with writeblock selection */ + print_scalar (f, "O"); + adios_read_close (f); + } + adios_read_finalize_method (ADIOS_READ_METHOD_BP); + return retval; +} + +int read_scalar_stepbystep () +{ + ADIOS_FILE * f; + float timeout_sec = 0.0; + int steps = 0; + int retval = 0; + MPI_Comm comm = MPI_COMM_SELF; + + adios_read_init_method (ADIOS_READ_METHOD_BP, comm, "verbose=3"); + printf ("\n--------- Read scalar in stream using varinfo->value ------------\n"); + f = adios_read_open (fname, ADIOS_READ_METHOD_BP, + comm, ADIOS_LOCKMODE_NONE, timeout_sec); + if (adios_errno == err_file_not_found) + { + printf ("Stream not found after waiting %f seconds: %s\n", + timeout_sec, adios_errmsg()); + retval = adios_errno; + } + else if (adios_errno == err_end_of_stream) + { + printf ("Stream terminated before open. %s\n", adios_errmsg()); + retval = adios_errno; + } + else if (f == NULL) { + printf ("Error at opening stream: %s\n", adios_errmsg()); + retval = adios_errno; + } + else + { + /* Processing loop over the steps (we are already in the first one) */ + while (adios_errno != err_end_of_stream) { + steps++; // steps start counting from 1 + printf ("Step: %d\n", f->current_step); + + /* Check the scalar O with varinfo->value */ + ADIOS_VARINFO * v = adios_inq_var (f, "NX"); + int value = *(int*)v->value; + printf ("Scalar NX = %d", value); + if (value != + block_count [f->current_step*nblocks_per_step*size]) + { + printf ("\tERROR expected = %d", + block_count [f->current_step*nblocks_per_step*size]); + nerrors++; + } + printf ("\n"); + + // advance to 1) next available step with 2) blocking wait + adios_advance_step (f, 0, timeout_sec); + if (adios_errno == err_step_notready) + { + //printf ("No new step arrived within the timeout. Quit. %s\n", + // adios_errmsg()); + break; // quit while loop + } + } + adios_read_close (f); + } + adios_read_finalize_method (ADIOS_READ_METHOD_BP); + //printf ("We have processed %d steps\n", steps); + return retval; +} diff --git a/tests/libs/adios/tests/suite/programs/build_standard_dataset.c b/tests/libs/adios/tests/suite/programs/build_standard_dataset.c new file mode 100644 index 0000000000..dd46903233 --- /dev/null +++ b/tests/libs/adios/tests/suite/programs/build_standard_dataset.c @@ -0,0 +1,767 @@ +/* + * build_standard_dataset.c + * + * Created on: Sep 26, 2014 + * Author: David A. Boyuka II + */ + +#include +#include +#include +#include +#include + +#include +#include +#include + +// Declaration of all datasets available from this program + +typedef void (*dataset_builder_fn)(const char *filename_prefix, const char *transform_name); + +typedef struct { + const char *name; + const char *desc; + dataset_builder_fn builder_fn; +} dataset_info_t; + +// Forward declaration of dataset builder functions +static void build_dataset_1(const char *filename_prefix, const char *transform_name); +static void build_dataset_2(const char *filename_prefix, const char *transform_name); +static void build_dataset_3(const char *filename_prefix, const char *transform_name); +static void build_dataset_unevenpg(const char *filename_prefix, const char *transform_name); +static void build_dataset_particle(const char *filename_prefix, const char *transform_name); + +static const dataset_info_t DATASETS[] = { + { .name = "DS-1D", .builder_fn = build_dataset_1, + .desc = "A simple, small dataset with a 1D variable 'temp' consisting of 1 PG and 1 timestep" }, + + { .name = "DS-2D", .builder_fn = build_dataset_2, + .desc = "A simple, small dataset with a 2D (8x8) variable 'temp' decomposed in to 2x8 slices across 2 timesteps (8 PGs total)" }, + + { .name = "DS-3D", .builder_fn = build_dataset_3, + .desc = "A simple, small dataset with a 3D (4x4x4) variable 'temp' decomposed in to 2x2x2 blocks across 2 timesteps (16 PGs total)" }, + + { .name = "DS-particle", .builder_fn = build_dataset_particle, + .desc = "A dataset simulating particle data, with a 2D (3x64) 1 variable 'temp' decomposed in 3x32 slices across 2 timesteps (4 PGs total). " + "A given X coordinate represents a 'variable', as 'variables' in particle datasets are often packed as tuples." }, + { .name = "DS-unevenpg", .builder_fn = build_dataset_unevenpg, + .desc = "A simple, small dataset with a 2D (8x8) variable 'temp' decomposed in to 2x8 slices in the first timestep, and 8x2 slices in the second timestep (8 PGs total)" }, +}; +static const int NUM_DATASETS = sizeof(DATASETS)/sizeof(DATASETS[0]); + +// Dataset description/writing code + +typedef struct { + const char *group_name; + unsigned int buffer_size_mb; + const char *write_transport_method; + int ndim; + int nvar; + const char **varnames; + const enum ADIOS_DATATYPES *vartypes; +} dataset_xml_spec_t; + +// Imported from adios_internal.c +extern const char * adios_type_to_string_int(int type); // converts enum ADIOS_DATATYPES to string +extern uint64_t adios_get_type_size(enum ADIOS_DATATYPES type, void *var); // returns the size in bytes of a given enum ADIOS_DATATYPES + +static void build_dimension_var_list(int ndim, const char *dimvar_base, char *outbuf) { + int i; + for (i = 0; i < ndim; i++) + outbuf += sprintf(outbuf, i == 0 ? "%s%d" : ",%s%d", dimvar_base, i); +} + +static void produce_xml( + FILE *outfile, + const dataset_xml_spec_t *xml_spec, + const char *transform_name) +{ + static const char *HEADER_XML = + "\n" + "\n" + " \n"; + + static const char *DIMVAR_XML = + " \n" + " \n" + " \n"; + + static const char *GLOBALBOUNDS_HEADER_XML = + " \n"; + + static const char *VAR_XML = + " \n"; + + static const char *GLOBALBOUNDS_FOOTER_XML = + " \n"; + + static const char *FOOTER_XML = + " \n" + " \n" + " \n" + "\n"; + + // Actual function begins + int i; + char dimvar_list_buf1[256]; // for storing D0,D1,D2,...,Dn + char dimvar_list_buf2[256]; // for storing D0,D1,D2,...,Dn + + fprintf(outfile, HEADER_XML, xml_spec->group_name); + for (i = 0; i < xml_spec->ndim; i++) + fprintf(outfile, DIMVAR_XML, i, i, i); + + build_dimension_var_list(xml_spec->ndim, "N", dimvar_list_buf1); + build_dimension_var_list(xml_spec->ndim, "O", dimvar_list_buf2); + fprintf(outfile, GLOBALBOUNDS_HEADER_XML, dimvar_list_buf1, dimvar_list_buf2); + + for (i = 0; i < xml_spec->nvar; ++i) { + build_dimension_var_list(xml_spec->ndim, "D", dimvar_list_buf1); + fprintf(outfile, VAR_XML, xml_spec->varnames[i], adios_type_to_string_int(xml_spec->vartypes[i]), dimvar_list_buf1, transform_name); + } + + fprintf(outfile, GLOBALBOUNDS_FOOTER_XML); + fprintf(outfile, FOOTER_XML, xml_spec->group_name, xml_spec->write_transport_method, xml_spec->buffer_size_mb); +} + +static void write_adios_dimension_scalars(int64_t fd, const char *dimvar_basename, int ndim, const uint64_t *dims) { + int i; + char dimvar_name[32]; + for (i = 0; i < ndim; ++i) { + sprintf(dimvar_name, "%s%d", dimvar_basename, i); + adios_write(fd, dimvar_name, (void*)dims); + ++dims; + } +} + +typedef struct { + int num_ts; + int num_pgs_per_ts; + const uint64_t *global_dims; +} dataset_global_spec_t; + +typedef struct { + const uint64_t *pg_dim; + const uint64_t *pg_offset; + const void **vardata; +} dataset_pg_spec_t; + +static uint64_t dim_prod(int ndim, const uint64_t *dims) { + uint64_t pg_gridsize = 1; + while (ndim--) + pg_gridsize *= *dims++; + return pg_gridsize; +} + +static uint64_t compute_groupsize(uint64_t base_groupsize, const dataset_xml_spec_t *xml_spec, const dataset_pg_spec_t *pg) { + int var, dim; + + // Compute the number of points contained in this PG + uint64_t pg_gridsize = dim_prod(xml_spec->ndim, pg->pg_dim); + + // Compute the sum of the datatype sizes across all variables defined in this PG + uint64_t total_var_datatypes_size = 0; + for (var = 0; var < xml_spec->nvar; ++var) + total_var_datatypes_size += adios_get_type_size(xml_spec->vartypes[var], NULL); + + // The final group size is the product of the number of points and the number of bytes per point, plus the base groupsize + return base_groupsize + pg_gridsize * total_var_datatypes_size; +} + +extern void adios_pin_timestep(uint32_t ts); // Not in the standard header, but accessible +static void build_dataset_from_specs( + const char *filename_prefix, + const char *transform_name, + const dataset_xml_spec_t *xml_spec, + const dataset_global_spec_t *global_spec, + int num_ts, int num_pgs_per_ts, + dataset_pg_spec_t pg_specs[num_ts][num_pgs_per_ts]) // Not const because C has an corner case here (http://c-faq.com/ansi/constmismatch.html) +{ + int var; + char xml_filename[strlen(filename_prefix) + strlen(".xml") + 1]; + char bp_filename[strlen(filename_prefix) + strlen(".bp") + 1]; + int timestep, pg_in_timestep; + char dimvar[32]; + + // Construct the XML and BP filenames + sprintf(xml_filename, "%s.xml", filename_prefix); + sprintf(bp_filename, "%s.bp", filename_prefix); + + // Write out the XML file + FILE *xml_out = fopen(xml_filename, "w"); + assert(xml_out); + produce_xml(xml_out, xml_spec, transform_name); + fclose(xml_out); + + // Write out the BP file + adios_init(xml_filename, MPI_COMM_WORLD); + + // Compute the groupsize contribution of the dimension scalars + const uint64_t base_groupsize = xml_spec->ndim * 3 * 4; // *3 for 3 scalars (N, D, O) *4 for sizeof(adios_integer) (not sure how what function in the User API to call to get this programatically + + // For each timestep, for each PG in that timestep, write out all variables using the provided vardata buffers + int64_t adios_file; + for (timestep = 0; timestep < global_spec->num_ts; ++timestep) { + for (pg_in_timestep = 0; pg_in_timestep < global_spec->num_pgs_per_ts; ++pg_in_timestep) { + // (Re-)open the file in write or append mode, depending on whether or not this is the first PG written + const int is_first_pg = (timestep == 0 && pg_in_timestep == 0); + adios_open(&adios_file, xml_spec->group_name, bp_filename, is_first_pg ? "w" : "a", MPI_COMM_WORLD); + + // Pin the timestep to allow multiple adios_open/adios_close cycles to write + // to the same timestep (this simulates a parallel file write with fewer core) + adios_pin_timestep(timestep + 1); // +1 because we want the timesteps to be 1-based + + const dataset_pg_spec_t *pg_spec = &pg_specs[timestep][pg_in_timestep]; + + // Compute the group size + uint64_t groupsize = compute_groupsize(base_groupsize, xml_spec, pg_spec); + uint64_t out_groupsize; + adios_group_size(adios_file, groupsize, &out_groupsize); + + write_adios_dimension_scalars(adios_file, "N", xml_spec->ndim, global_spec->global_dims); + write_adios_dimension_scalars(adios_file, "D", xml_spec->ndim, pg_spec->pg_dim); + write_adios_dimension_scalars(adios_file, "O", xml_spec->ndim, pg_spec->pg_offset); + + // Write each variable + for (var = 0; var < xml_spec->nvar; ++var) { + adios_write(adios_file, xml_spec->varnames[var], (void*)pg_spec->vardata[var]); // (void*) to get rid of compiler complaining about constness + } + + // Close the file to commit it + adios_close(adios_file); + } + } +} + +// NOTE: varblocks_by_var is actually a 1D array varblocks_by_var[var] of 3D "arrays" varblockdata[ts][pg][point_in_pg] of type xml_spec->vartypes[var] (however, points per PG varies) +static void collect_varblocks_by_pg( + const dataset_xml_spec_t *xml_spec, + const dataset_global_spec_t *global_spec, + int num_ts, int num_pgs_per_ts, int ndim, int nvar, + const uint64_t pg_dims[num_ts][num_pgs_per_ts][ndim], + const void **varblocks_by_var, + const void *out_varblocks_by_pg[num_ts][num_pgs_per_ts][nvar]) +{ + int ts, pg, var; + + // Some maths + const uint64_t varblocks_per_ts = nvar * num_pgs_per_ts; + + // Cache the datatype size for each variable, and create a data pointer that we can advance + int var_typesizes[nvar]; + const char *varblock_datas[nvar]; + for (var = 0; var < nvar; ++var) { + var_typesizes[var] = adios_get_type_size(xml_spec->vartypes[var], NULL); + varblock_datas[var] = (const char *)varblocks_by_var[var]; + } + + // Iterate over all varblocks (var in pg in timestep), get a pointer to the data buffer for that + // varblock, and assign it to the proper place in the output array of PG data buffers + for (ts = 0; ts < num_ts; ++ts) { + for (pg = 0; pg < num_pgs_per_ts; ++pg) { + // Compute the points per varblock in this PG + const uint64_t points_per_varblock = dim_prod(ndim, pg_dims[ts][pg]); + + for (var = 0; var < nvar; ++var) { + const int var_typesize = var_typesizes[var]; + const uint64_t varblock_size = points_per_varblock * var_typesize; + + // Get the data for this varblock, and advance the pointer by one varblock + const char *data_for_varblock = varblock_datas[var]; + varblock_datas[var] += varblock_size; + + // Finally, assign the pointer + out_varblocks_by_pg[ts][pg][var] = data_for_varblock; + } + } + } +} + +// NOTE: pg_dims and pg_offsets are really a 2D arrays pd_dims[pg][dim] of dimension lengths +// NOTE: pg_datas is really a 2D array pg_datas[pg][var] of varblock buffers +// NOTE: pg_specs is really a 1D array of pg_specs[pg] of dataset_pg_spec_t's +static void collect_pg_specs( + int num_ts, int num_pgs_per_ts, int ndim, int nvar, + const uint64_t pg_dims[num_ts][num_pgs_per_ts][ndim], + const uint64_t pg_offsets[num_ts][num_pgs_per_ts][ndim], + const void *pg_datas[num_ts][num_pgs_per_ts][nvar], + dataset_pg_spec_t pg_specs[num_ts][num_pgs_per_ts]) { + int ts, pg; + for (ts = 0; ts < num_ts; ++ts) { + for (pg = 0; pg < num_pgs_per_ts; ++pg) { + pg_specs[ts][pg].pg_dim = pg_dims[ts][pg]; + pg_specs[ts][pg].pg_offset = pg_offsets[ts][pg]; + pg_specs[ts][pg].vardata = pg_datas[ts][pg]; + } + } +} + +static void build_dataset_from_varblocks_by_var( + const char *filename_prefix, + const char *transform_name, + const dataset_xml_spec_t *xml_spec, + const dataset_global_spec_t *global_spec, + int num_ts, int num_pgs_per_ts, int ndim, int nvar, + const uint64_t pg_dims[num_ts][num_pgs_per_ts][ndim], + const uint64_t pg_offsets[num_ts][num_pgs_per_ts][ndim], + const void *varblocks_by_var[nvar]) +{ + const uint64_t num_pgs = num_ts * num_pgs_per_ts; + + // Array for repackaging global per-variable data in per-PG data + const void *varblocks_by_pg[num_ts][num_pgs_per_ts][nvar]; + // Array for repackaging pieces of per-PG inforamtion into an array of per-PG specification structs + dataset_pg_spec_t pg_specs[num_ts][num_pgs_per_ts]; + + collect_varblocks_by_pg( + xml_spec, global_spec, + num_ts, num_pgs_per_ts, ndim, nvar, + pg_dims, varblocks_by_var, varblocks_by_pg); + + collect_pg_specs( + num_ts, num_pgs_per_ts, ndim, nvar, + pg_dims, pg_offsets, varblocks_by_pg, pg_specs); + + build_dataset_from_specs( + filename_prefix, transform_name, xml_spec, global_spec, + num_ts, num_pgs_per_ts, pg_specs); +} + + + + + + + +static void build_dataset_1(const char *filename_prefix, const char *transform_name) { + // Basic dataset information + // NOTE: we have to use an anonymous enum here to define these constants, since + // C is picky and doesn't consider a static const int "const enough" to use + // as an array length (e.g., if these were static const ints, it would not compile) + enum { + NUM_DIMS = 1, + NUM_TS = 1, + NUM_PGS_PER_TS = 1, + NUM_VARS = 1, + NUM_PGS = NUM_TS * NUM_PGS_PER_TS, + }; + + // Variable names/types + static const char *VARNAMES[NUM_VARS] = { "temp" }; + static const enum ADIOS_DATATYPES VARTYPES[NUM_VARS] = { adios_real }; + + // Global and PG dimensions/offsets + static const uint64_t GLOBAL_DIMS [NUM_DIMS] = { 16 }; + static const uint64_t PG_DIMS [NUM_TS][NUM_PGS_PER_TS][NUM_DIMS] = { { { 16 } } }; + static const uint64_t PG_OFFSETS [NUM_TS][NUM_PGS_PER_TS][NUM_DIMS] = { { { 0 } } }; + + // Variable data (we can use [TS][PG][16] here because every PG is the same size, 16) + static const float TEMP_DATA[NUM_TS][NUM_PGS_PER_TS][16] = { + // Timestep 1 + // PG 0 in timestep 1 + // -1.00000000 -1.00003052 2.00000000 2.00006104 + -0x1.000000p+0, -0x1.000200p+0, 0x1.000000p+1, 0x1.000200p+1, + // 2.00012207 -30.00000000 -30.00048828 -30.00097656 + 0x1.000400p+1, -0x1.e00000p+4, -0x1.e00200p+4, -0x1.e00400p+4, + // -30.00146484 50.00000000 50.00097656 50.00195312 + -0x1.e00600p+4, 0x1.900000p+5, 0x1.900200p+5, 0x1.900400p+5, + // 50.00292969 50.00390625 50.00488281 50.00585938 + 0x1.900600p+5, 0x1.900800p+5, 0x1.900a00p+5, 0x1.900c00p+5, + }; + + static const void *VARBLOCKS_BY_VAR[NUM_VARS] = { + TEMP_DATA, + }; + + // Now, collect all this information into specification structs + // File specification + static const dataset_xml_spec_t XML_SPEC = { + .group_name = "S3D", + .buffer_size_mb = 128, + .write_transport_method = "MPI", + .ndim = NUM_DIMS, + .nvar = NUM_VARS, + .varnames = VARNAMES, + .vartypes = VARTYPES, + }; + + // Global space specification + static const dataset_global_spec_t GLOBAL_SPEC = { + .num_ts = NUM_TS, + .num_pgs_per_ts = NUM_PGS_PER_TS, + .global_dims = GLOBAL_DIMS, + }; + + // Finally, invoke the dataset builder with this information + build_dataset_from_varblocks_by_var( + filename_prefix, transform_name, &XML_SPEC, &GLOBAL_SPEC, + NUM_TS, NUM_PGS_PER_TS, NUM_DIMS, NUM_VARS, + PG_DIMS, PG_OFFSETS, (const void **)VARBLOCKS_BY_VAR); +} + +// Variable data used in datasets 2 and 3 +static const float TEMP_DATA_FOR_DS2_AND_DS3[] = { + // Timestep 1 + -0x1.122f92p-5, 0x1.51e224p-2, -0x1.619b00p-1, 0x1.b0a05ap-2, -0x1.a66e56p-3, 0x1.0021acp-2, -0x1.45eb00p-1, 0x1.ba2cb6p-1, + -0x1.34e536p-2, 0x1.985a90p-6, -0x1.75c0a6p-2, 0x1.87e004p-1, -0x1.457d2ap-2, 0x1.15f8c4p-3, -0x1.b53a84p-4, 0x1.8576bep-1, + -0x1.4e8798p-4, 0x1.1a16eep-1, -0x1.211a0ep-1, 0x1.7c8df4p-1, -0x1.f6a944p-1, 0x1.c03452p-3, -0x1.d14d2ap-2, 0x1.098d06p-1, + -0x1.25ce96p-1, 0x1.1c473ep-1, -0x1.750404p-1, 0x1.41fbc4p-1, -0x1.979e1cp-1, 0x1.2adcccp-1, -0x1.195c60p-2, 0x1.a8c114p-1, + -0x1.d3cddep-1, 0x1.ee4930p-1, -0x1.022282p-2, 0x1.eb4ba0p-4, -0x1.b9681ap-3, 0x1.c6fc40p-1, -0x1.f7962ap-1, 0x1.08cca2p-1, + -0x1.d3bf16p-1, 0x1.64ecfap-2, -0x1.21594cp-2, 0x1.d9f6a6p-3, -0x1.efe95cp-2, 0x1.8ea7eep-2, -0x1.fbf468p-1, 0x1.21c5a2p-1, + -0x1.e16ae6p-1, 0x1.1d0e76p-1, -0x1.3ca72ap-2, 0x1.d8142ap-1, -0x1.8d1b8ap-1, 0x1.86fa2ap-1, -0x1.c3425ep-2, 0x1.65d43ep-2, + -0x1.4682d0p-2, 0x1.5a94cap-3, -0x1.f4e5e4p-1, 0x1.d6fc1cp-4, -0x1.818200p-1, 0x1.032826p-2, -0x1.e3a098p-1, 0x1.554fdep-1, + // Timestep 2 + -0x1.554fdep-1, 0x1.e3a098p-1, -0x1.032826p-2, 0x1.818200p-1, -0x1.d6fc1cp-4, 0x1.f4e5e4p-1, -0x1.5a94cap-3, 0x1.4682d0p-2, + -0x1.65d43ep-2, 0x1.c3425ep-2, -0x1.86fa2ap-1, 0x1.8d1b8ap-1, -0x1.d8142ap-1, 0x1.3ca72ap-2, -0x1.1d0e76p-1, 0x1.e16ae6p-1, + -0x1.21c5a2p-1, 0x1.fbf468p-1, -0x1.8ea7eep-2, 0x1.efe95cp-2, -0x1.d9f6a6p-3, 0x1.21594cp-2, -0x1.64ecfap-2, 0x1.d3bf16p-1, + -0x1.08cca2p-1, 0x1.f7962ap-1, -0x1.c6fc40p-1, 0x1.b9681ap-3, -0x1.eb4ba0p-4, 0x1.022282p-2, -0x1.ee4930p-1, 0x1.d3cddep-1, + -0x1.a8c114p-1, 0x1.195c60p-2, -0x1.2adcccp-1, 0x1.979e1cp-1, -0x1.41fbc4p-1, 0x1.750404p-1, -0x1.1c473ep-1, 0x1.25ce96p-1, + -0x1.098d06p-1, 0x1.d14d2ap-2, -0x1.c03452p-3, 0x1.f6a944p-1, -0x1.7c8df4p-1, 0x1.211a0ep-1, -0x1.1a16eep-1, 0x1.4e8798p-4, + -0x1.8576bep-1, 0x1.b53a84p-4, -0x1.15f8c4p-3, 0x1.457d2ap-2, -0x1.87e004p-1, 0x1.75c0a6p-2, -0x1.985a90p-6, 0x1.34e536p-2, + -0x1.ba2cb6p-1, 0x1.45eb00p-1, -0x1.0021acp-2, 0x1.a66e56p-3, -0x1.b0a05ap-2, 0x1.619b00p-1, -0x1.51e224p-2, 0x1.122f92p-5, +}; + +static void build_dataset_2(const char *filename_prefix, const char *transform_name) { + // Basic dataset information + // NOTE: we have to use an anonymous enum here to define these constants, since + // C is picky and doesn't consider a static const int "const enough" to use + // as an array length (e.g., if these were static const ints, it would not compile) + enum { + NUM_DIMS = 2, + NUM_TS = 2, + NUM_PGS_PER_TS = 4, + NUM_VARS = 1, + NUM_PGS = NUM_TS * NUM_PGS_PER_TS, + }; + + // Variable names/types + static const char *VARNAMES[NUM_VARS] = { "temp" }; + static const enum ADIOS_DATATYPES VARTYPES[NUM_VARS] = { adios_real }; + + // Global and PG dimensions/offsets + static const uint64_t GLOBAL_DIMS [NUM_DIMS] = { 8, 8 }; + static const uint64_t PG_DIMS [NUM_TS][NUM_PGS_PER_TS][NUM_DIMS] = { + { { 2, 8 }, { 2, 8 }, { 2, 8 }, { 2, 8 }, }, // Timestep 1 + { { 2, 8 }, { 2, 8 }, { 2, 8 }, { 2, 8 }, }, // Timestep 2 + }; + static const uint64_t PG_OFFSETS [NUM_TS][NUM_PGS_PER_TS][NUM_DIMS] = { + { { 0, 0 }, { 2, 0 }, { 4, 0 }, { 6, 0 }, }, // Timestep 1 + { { 0, 0 }, { 2, 0 }, { 4, 0 }, { 6, 0 }, }, // Timestep 2 + }; + + static const void *VARBLOCKS_BY_VAR[NUM_VARS] = { + TEMP_DATA_FOR_DS2_AND_DS3, + }; + + // Now, collect all this information into specification structs + // File specification + static const dataset_xml_spec_t XML_SPEC = { + .group_name = "S3D", + .buffer_size_mb = 128, + .write_transport_method = "MPI", + .ndim = NUM_DIMS, + .nvar = NUM_VARS, + .varnames = VARNAMES, + .vartypes = VARTYPES, + }; + + // Global space specification + static const dataset_global_spec_t GLOBAL_SPEC = { + .num_ts = NUM_TS, + .num_pgs_per_ts = NUM_PGS_PER_TS, + .global_dims = GLOBAL_DIMS, + }; + + // Finally, invoke the dataset builder with this information + build_dataset_from_varblocks_by_var( + filename_prefix, transform_name, &XML_SPEC, &GLOBAL_SPEC, + NUM_TS, NUM_PGS_PER_TS, NUM_DIMS, NUM_VARS, + PG_DIMS, PG_OFFSETS, (const void **)VARBLOCKS_BY_VAR); +} + +static void build_dataset_3(const char *filename_prefix, const char *transform_name) { + // Basic dataset information + // NOTE: we have to use an anonymous enum here to define these constants, since + // C is picky and doesn't consider a static const int "const enough" to use + // as an array length (e.g., if these were static const ints, it would not compile) + enum { + NUM_DIMS = 3, + NUM_TS = 2, + NUM_PGS_PER_TS = 8, + NUM_VARS = 1, + NUM_PGS = NUM_TS * NUM_PGS_PER_TS, + }; + + // Variable names/types + static const char *VARNAMES[NUM_VARS] = { "temp" }; + static const enum ADIOS_DATATYPES VARTYPES[NUM_VARS] = { adios_real }; + + // Global and PG dimensions/offsets + static const uint64_t GLOBAL_DIMS [NUM_DIMS] = { 4, 4, 4 }; + static const uint64_t PG_DIMS [NUM_TS][NUM_PGS_PER_TS][NUM_DIMS] = { + { { 2, 2, 2 }, { 2, 2, 2 }, { 2, 2, 2 }, { 2, 2, 2 }, { 2, 2, 2 }, { 2, 2, 2 }, { 2, 2, 2 }, { 2, 2, 2 }, }, // Timestep 1 + { { 2, 2, 2 }, { 2, 2, 2 }, { 2, 2, 2 }, { 2, 2, 2 }, { 2, 2, 2 }, { 2, 2, 2 }, { 2, 2, 2 }, { 2, 2, 2 }, }, // Timestep 2 + }; + static const uint64_t PG_OFFSETS [NUM_TS][NUM_PGS_PER_TS][NUM_DIMS] = { + { { 0, 0, 0 }, { 0, 0, 2 }, { 0, 2, 0 }, { 0, 2, 2 }, { 2, 0, 0 }, { 2, 0, 2 }, { 2, 2, 0 }, { 2, 2, 2 }, }, // Timestep 1 + { { 0, 0, 0 }, { 0, 0, 2 }, { 0, 2, 0 }, { 0, 2, 2 }, { 2, 0, 0 }, { 2, 0, 2 }, { 2, 2, 0 }, { 2, 2, 2 }, }, // Timestep 2 + }; + + static const void *VARBLOCKS_BY_VAR[NUM_VARS] = { + TEMP_DATA_FOR_DS2_AND_DS3, + }; + + // Now, collect all this information into specification structs + // File specification + static const dataset_xml_spec_t XML_SPEC = { + .group_name = "S3D", + .buffer_size_mb = 128, + .write_transport_method = "MPI", + .ndim = NUM_DIMS, + .nvar = NUM_VARS, + .varnames = VARNAMES, + .vartypes = VARTYPES, + }; + + // Global space specification + static const dataset_global_spec_t GLOBAL_SPEC = { + .num_ts = NUM_TS, + .num_pgs_per_ts = NUM_PGS_PER_TS, + .global_dims = GLOBAL_DIMS, + }; + + // Finally, invoke the dataset builder with this information + build_dataset_from_varblocks_by_var( + filename_prefix, transform_name, &XML_SPEC, &GLOBAL_SPEC, + NUM_TS, NUM_PGS_PER_TS, NUM_DIMS, NUM_VARS, + PG_DIMS, PG_OFFSETS, (const void **)VARBLOCKS_BY_VAR); +} + +static void build_dataset_particle(const char *filename_prefix, const char *transform_name) { + // Basic dataset information + // NOTE: we have to use an anonymous enum here to define these constants, since + // C is picky and doesn't consider a static const int "const enough" to use + // as an array length (e.g., if these were static const ints, it would not compile) + enum { + NUM_DIMS = 2, + NUM_TS = 2, + NUM_PGS_PER_TS = 2, + NUM_VARS = 1, + NUM_PGS = NUM_TS * NUM_PGS_PER_TS, + }; + + // Variable names/types + static const char *VARNAMES[NUM_VARS] = { "temp" }; + static const enum ADIOS_DATATYPES VARTYPES[NUM_VARS] = { adios_real }; + + // Global and PG dimensions/offsets + static const uint64_t GLOBAL_DIMS [NUM_DIMS] = { 3, 64 }; + static const uint64_t PG_DIMS [NUM_TS][NUM_PGS_PER_TS][NUM_DIMS] = { + { { 3, 32 }, { 3, 32 } }, + { { 3, 32 }, { 3, 32 } } + }; + static const uint64_t PG_OFFSETS [NUM_TS][NUM_PGS_PER_TS][NUM_DIMS] = { + { { 0, 0 }, { 0, 32 }, }, + { { 0, 0 }, { 0, 32 }, }, + }; + + // Variable data (we can use [TS][PG][96] here because every PG is the same size, 96) + static const float TEMP_DATA[NUM_TS][NUM_PGS_PER_TS][96] = { + // Timestep 1 + // PG 0 in timestep 1 + -10.033470, 10.329965, -10.690636, 10.422486, -10.206265, 10.250129, -10.636559, 10.863623, + -10.301656, 10.024924, -10.364993, 10.765381, -10.317861, 10.135729, -10.106746, 10.760672, + -10.081673, 10.550956, -10.564651, 10.743271, -10.981760, 10.218850, -10.454396, 10.518654, + -10.573842, 10.555231, -10.728546, 10.628874, -10.796128, 10.583715, -10.274767, 10.829598, + -10.913680, 10.965403, -10.252085, 10.119946, -10.215530, 10.888643, -10.983567, 10.517186, + -10.913568, 10.348560, -10.282567, 10.231427, -10.484288, 10.389313, -10.992099, 10.565961, + -10.940269, 10.556751, -10.309232, 10.922029, -10.775600, 10.763627, -10.440682, 10.349442, + -10.318858, 10.169230, -10.978316, 10.114986, -10.752945, 10.253083, -10.944585, 10.666625, + -100.033470, 100.329964, -100.690636, 100.422485, -100.206268, 100.250130, -100.636559, 100.863625, + -100.301659, 100.024925, -100.364990, 100.765381, -100.317863, 100.135727, -100.106743, 100.760674, + -100.081673, 100.550957, -100.564651, 100.743271, -100.981758, 100.218849, -100.454399, 100.518654, + -100.573845, 100.555229, -100.728546, 100.628876, -100.796127, 100.583717, -100.274765, 100.829597, + // PG 1 in timestep 1 + -100.913681, 100.965401, -100.252083, 100.119942, -100.215530, 100.888641, -100.983566, 100.517189, + -100.913567, 100.348557, -100.282570, 100.231430, -100.484291, 100.389313, -100.992096, 100.565964, + -100.940269, 100.556747, -100.309235, 100.922028, -100.775604, 100.763626, -100.440681, 100.349442, + -100.318855, 100.169228, -100.978317, 100.114990, -100.752945, 100.253082, -100.944588, 100.666626, + -1000.033447, 1000.329956, -1000.690613, 1000.422485, -1000.206238, 1000.250122, -1000.636536, 1000.863647, + -1000.301636, 1000.024902, -1000.364990, 1000.765381, -1000.317871, 1000.135742, -1000.106750, 1000.760681, + -1000.081665, 1000.550964, -1000.564636, 1000.743286, -1000.981750, 1000.218872, -1000.454407, 1000.518677, + -1000.573853, 1000.555237, -1000.728577, 1000.628845, -1000.796143, 1000.583740, -1000.274780, 1000.829590, + -1000.913696, 1000.965393, -1000.252075, 1000.119934, -1000.215515, 1000.888672, -1000.983582, 1000.517212, + -1000.913574, 1000.348572, -1000.282593, 1000.231445, -1000.484314, 1000.389282, -1000.992126, 1000.565979, + -1000.940247, 1000.556763, -1000.309204, 1000.922058, -1000.775574, 1000.763611, -1000.440674, 1000.349426, + -1000.318848, 1000.169250, -1000.978333, 1000.114990, -1000.752930, 1000.253113, -1000.944580, 1000.666626, + + // Timestep 2 + // PG 0 in timestep 2 + -10.218485, 10.196670, -10.786571, 10.434015, -10.085313, 10.770138, -10.951201, 10.998879, + -10.118698, 10.233769, -10.230308, 10.602986, -10.623081, 10.222406, -10.168947, 10.563350, + -10.779158, 10.478179, -10.485379, 10.554758, -10.241806, 10.926062, -10.904201, 10.560665, + -10.095291, 10.882517, -10.675652, 10.848236, -10.135600, 10.620235, -10.514861, 10.354085, + -10.816905, 10.301431, -10.788100, 10.902218, -10.071568, 10.739302, -10.901097, 10.190267, + -10.973071, 10.131405, -10.793253, 10.596152, -10.353811, 10.962200, -10.159503, 10.132969, + -10.440379, 10.644882, -10.687727, 10.682186, -10.570944, 10.591928, -10.242850, 10.666235, + -10.474444, 10.918502, -10.514470, 10.610044, -10.538737, 10.029331, -10.964128, 10.355642, + -100.218483, 100.196671, -100.786568, 100.434013, -100.085312, 100.770134, -100.951202, 100.998878, + -100.118698, 100.233772, -100.230309, 100.602989, -100.623085, 100.222404, -100.168945, 100.563347, + -100.779160, 100.478180, -100.485382, 100.554756, -100.241806, 100.926064, -100.904198, 100.560661, + -100.095291, 100.882515, -100.675652, 100.848236, -100.135597, 100.620239, -100.514862, 100.354088, + // PG 1 in timestep 2 + -100.816902, 100.301430, -100.788101, 100.902214, -100.071571, 100.739304, -100.901100, 100.190269, + -100.973068, 100.131409, -100.793251, 100.596153, -100.353813, 100.962204, -100.159500, 100.132965, + -100.440376, 100.644882, -100.687729, 100.682182, -100.570946, 100.591927, -100.242851, 100.666237, + -100.474442, 100.918503, -100.514473, 100.610046, -100.538734, 100.029327, -100.964127, 100.355644, + -1000.218506, 1000.196655, -1000.786560, 1000.434021, -1000.085327, 1000.770142, -1000.951172, 1000.998901, + -1000.118713, 1000.233765, -1000.230286, 1000.602966, -1000.623108, 1000.222412, -1000.168945, 1000.563354, + -1000.779175, 1000.478149, -1000.485352, 1000.554749, -1000.241821, 1000.926086, -1000.904175, 1000.560669, + -1000.095276, 1000.882507, -1000.675659, 1000.848206, -1000.135620, 1000.620239, -1000.514832, 1000.354065, + -1000.816895, 1000.301453, -1000.788086, 1000.902222, -1000.071594, 1000.739319, -1000.901123, 1000.190247, + -1000.973083, 1000.131409, -1000.793274, 1000.596130, -1000.353821, 1000.962219, -1000.159485, 1000.132996, + -1000.440369, 1000.644897, -1000.687744, 1000.682190, -1000.570923, 1000.591919, -1000.242859, 1000.666260, + -1000.474426, 1000.918518, -1000.514465, 1000.610046, -1000.538757, 1000.029358, -1000.964111, 1000.355652, + }; + + static const void *VARBLOCKS_BY_VAR[NUM_VARS] = { + TEMP_DATA + }; + + // Now, collect all this information into specification structs + // File specification + static const dataset_xml_spec_t XML_SPEC = { + .group_name = "S3D", + .buffer_size_mb = 128, + .write_transport_method = "MPI", + .ndim = NUM_DIMS, + .nvar = NUM_VARS, + .varnames = VARNAMES, + .vartypes = VARTYPES, + }; + + // Global space specification + static const dataset_global_spec_t GLOBAL_SPEC = { + .num_ts = NUM_TS, + .num_pgs_per_ts = NUM_PGS_PER_TS, + .global_dims = GLOBAL_DIMS, + }; + + // Finally, invoke the dataset builder with this information + build_dataset_from_varblocks_by_var( + filename_prefix, transform_name, &XML_SPEC, &GLOBAL_SPEC, + NUM_TS, NUM_PGS_PER_TS, NUM_DIMS, NUM_VARS, + PG_DIMS, PG_OFFSETS, (const void **)VARBLOCKS_BY_VAR); +} + +static void build_dataset_unevenpg(const char *filename_prefix, const char *transform_name) { + // Copied with only pg dim and offset modification from ds2 + // Basic dataset information + // NOTE: we have to use an anonymous enum here to define these constants, since + // C is picky and doesn't consider a static const int "const enough" to use + // as an array length (e.g., if these were static const ints, it would not compile) + enum { + NUM_DIMS = 2, + NUM_TS = 2, + NUM_PGS_PER_TS = 4, + NUM_VARS = 1, + NUM_PGS = NUM_TS * NUM_PGS_PER_TS, + }; + + // Variable names/types + static const char *VARNAMES[NUM_VARS] = { "temp" }; + static const enum ADIOS_DATATYPES VARTYPES[NUM_VARS] = { adios_real }; + + // Global and PG dimensions/offsets + static const uint64_t GLOBAL_DIMS [NUM_DIMS] = { 8, 8 }; + static const uint64_t PG_DIMS [NUM_TS][NUM_PGS_PER_TS][NUM_DIMS] = { + { { 2, 8 }, { 2, 8 }, { 2, 8 }, { 2, 8 }, }, // Timestep 1 + { { 8, 2 }, { 8, 2 }, { 8, 2 }, { 8, 2 }, }, // Timestep 2 + }; + static const uint64_t PG_OFFSETS [NUM_TS][NUM_PGS_PER_TS][NUM_DIMS] = { + { { 0, 0 }, { 2, 0 }, { 4, 0 }, { 6, 0 }, }, // Timestep 1 + { { 0, 0 }, { 0, 2 }, { 0, 4 }, { 0, 6 }, }, // Timestep 2 + }; + + static const void *VARBLOCKS_BY_VAR[NUM_VARS] = { + TEMP_DATA_FOR_DS2_AND_DS3, + }; + + // Now, collect all this information into specification structs + // File specification + static const dataset_xml_spec_t XML_SPEC = { + .group_name = "S3D", + .buffer_size_mb = 128, + .write_transport_method = "MPI", + .ndim = NUM_DIMS, + .nvar = NUM_VARS, + .varnames = VARNAMES, + .vartypes = VARTYPES, + }; + + // Global space specification + static const dataset_global_spec_t GLOBAL_SPEC = { + .num_ts = NUM_TS, + .num_pgs_per_ts = NUM_PGS_PER_TS, + .global_dims = GLOBAL_DIMS, + }; + + // Finally, invoke the dataset builder with this information + build_dataset_from_varblocks_by_var( + filename_prefix, transform_name, &XML_SPEC, &GLOBAL_SPEC, + NUM_TS, NUM_PGS_PER_TS, NUM_DIMS, NUM_VARS, + PG_DIMS, PG_OFFSETS, (const void **)VARBLOCKS_BY_VAR); +} + + + + + + +static void usage_and_exit() { + int i; + fprintf(stderr, "Usage: build_standard_dataset []\n"); + fprintf(stderr, "\n"); + fprintf(stderr, " dataset-id: the ID of a standard dataset packaged in this executable:\n"); + fprintf(stderr, " - 'DS1': 1 variable, 2D array of floats\n"); + fprintf(stderr, "\n"); + fprintf(stderr, " filename-prefix: the filename prefix for the XML and BP files to be generated.\n"); + fprintf(stderr, " - Example: filename-prefix = 'some/path/myfile':\n"); + fprintf(stderr, " -> produces some/path/myfile.xml, some/path/myfile.bp:\n"); + fprintf(stderr, "\n"); + fprintf(stderr, " transform-type: the data transform to apply (default: none). May include\n"); + fprintf(stderr, " transform parameters, just like in an ADIOS XML file."); + fprintf(stderr, "\n"); + fprintf(stderr, "Available datasets:\n"); + for (i = 0; i < NUM_DATASETS; ++i) + fprintf(stderr, "- \"%s\": %s\n", DATASETS[i].name, DATASETS[i].desc); + exit(1); +} + +int main(int argc, char **argv) { + if (argc < 3 || argc > 4) + usage_and_exit(); + + const char *dataset_id = argv[1]; + const char *path = argv[2]; + const char *transform_name = (argc >= 4) ? argv[3] : "none"; + + int i; + const dataset_info_t *dataset = NULL; + for (i = 0; i < NUM_DATASETS; ++i) + if (strcasecmp(dataset_id, DATASETS[i].name) == 0) + dataset = &DATASETS[i]; + + if (dataset == NULL) { + fprintf(stderr, "Error: '%s' does not name a dataset packaged in this executable\n"); + usage_and_exit(); + } + + MPI_Init(&argc, &argv); + + // Invoke the builder function for the selected dataset + (*dataset->builder_fn)(path, transform_name); + + MPI_Finalize(); + return 0; +} diff --git a/tests/libs/adios/tests/suite/programs/connect_to_space_subset.c b/tests/libs/adios/tests/suite/programs/connect_to_space_subset.c new file mode 100644 index 0000000000..d518bae9db --- /dev/null +++ b/tests/libs/adios/tests/suite/programs/connect_to_space_subset.c @@ -0,0 +1,174 @@ +/* + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + */ + +/* ADIOS C test: + * Connect to staging server from a subset of processes, write data and close. + * + * How to run: mpirun -np connect_to_space_subset + * where 1 <= M <= N + * Output: exit code 0 = OK, != 0 on error + * + */ +#include +#include +#include +#include +#include +#include "adios.h" +#include "adios_read.h" + +#ifdef DMALLOC +#include "dmalloc.h" +#endif + +#define log(...) fprintf (stderr, "[rank=%3.3d, line %d]: ", wrank, __LINE__); fprintf (stderr, __VA_ARGS__); fflush(stderr); +#define printE(...) fprintf (stderr, "[rank=%3.3d, line %d]: ERROR: ", wrank, __LINE__); fprintf (stderr, __VA_ARGS__); fflush(stderr); + +static const int NSTEPS = 5; +static const char FILENAME[] = "connect.bp"; +#define VALUE(rank, step) (rank * 100 + step) +#define VALUE0(step) (step) + +/* Variables to write */ +int *a1; + +static const int ldim1 = 7; +int gdim1; +int offs1; + +MPI_Comm wcomm = MPI_COMM_WORLD; +MPI_Comm subcomm; +int wrank, subrank; +int wsize, subsize; + +int64_t m_adios_group; + + +void alloc_vars() +{ + int n; + + gdim1 = subsize*ldim1; + + offs1 = subrank*ldim1; + + n = ldim1; + a1 = (int*) malloc (n * sizeof(int)); +} + +void set_vars(int step) +{ + int n, i; + int v = VALUE(subrank, step); + + n = ldim1; + for (i=0; i connect_to_space_subset \n" + " : Number of processes\n" + " : Number of processes connecting to staging server\n" + " 1 <= M <= N\n"); +} + + +int write_file (int step); + +int main (int argc, char ** argv) +{ + int err,i,M; + int iconnect; + + MPI_Init (&argc, &argv); + MPI_Comm_rank (wcomm, &wrank); + MPI_Comm_size (wcomm, &wsize); + + if (argc < 2) { Usage(); return 1; } + errno = 0; + M = strtol (argv[1], NULL, 10); + if (errno || M < 1 || M > wsize) { + printE("Invalid 1st argument %s\n", argv[1]); Usage(); return 1; + } + + iconnect = (wrank >= wsize-M); // connect to server from ranks N-M, N-M+1, ..., N + MPI_Comm_split (wcomm, iconnect, wrank+M-wsize, &subcomm); + MPI_Comm_rank (subcomm, &subrank); + MPI_Comm_size (subcomm, &subsize); + if (iconnect) { + if (subsize != M) { + printE ("Something wrong with communicator split: N=%d, M=%d, splitted size=%d\n", + wsize, M, subsize); + return 2; + } + log ("connect as subrank %d\n", subrank); + } + + alloc_vars(); + adios_read_init_method(ADIOS_READ_METHOD_DATASPACES, subcomm, "verbose=4"); + adios_init_noxml (subcomm); + adios_allocate_buffer (ADIOS_BUFFER_ALLOC_NOW, 1); + + if (iconnect) + { + adios_declare_group (&m_adios_group, "connect", "iter", adios_flag_yes); + adios_select_method (m_adios_group, "DATASPACES", "verbose=4", ""); + adios_define_var (m_adios_group, "ldim1", "", adios_integer, 0, 0, 0); + adios_define_var (m_adios_group, "gdim1", "", adios_integer, 0, 0, 0); + adios_define_var (m_adios_group, "offs1", "", adios_integer, 0, 0, 0); + adios_define_var (m_adios_group, "a1", "", adios_integer, + "ldim1", "gdim1", "offs1"); + + for (i=0; i +#include +#include +#include +#include + +#include "adios_types.h" +#include "core/adios_subvolume.h" + +// Uncomment to print all data volumes (original, intermediate, and final) +//#define VERBOSE + +#define SHIFT argv++; argc--; +#define SHIFT_N(n) argv += n; argc -= n; + +static uint64_t prod(int ndims, uint64_t *dims) { + uint64_t prod = 1; + while (ndims) { + prod *= *dims; + ndims--; + dims++; + } + return prod; +} + +static void fill_random(int ndims, uint64_t *dims, int *volume) { + int i; + if (ndims == 1) { + for (i = 0; i < *dims; i++) + volume[i] = rand(); + } else { + uint64_t stride = prod(ndims - 1, dims + 1); + for (i = 0; i < *dims; i++) { + fill_random(ndims - 1, dims + 1, volume + stride * i); + } + } +} + +static void fill(int ndims, uint64_t *dims, int *volume, int fillv) { + int i; + if (ndims == 1) { + for (i = 0; i < *dims; i++) + volume[i] = fillv; + } else { + uint64_t stride = prod(ndims - 1, dims + 1); + for (i = 0; i < *dims; i++) { + fill(ndims - 1, dims + 1, volume + stride * i, fillv); + } + } +} + +static void fill_subvolume(int ndims, uint64_t *dims, int *volume, uint64_t *offsets, uint64_t *filldims, int fillv) { + int i; + if (ndims == 1) { + for (i = *offsets; i < *offsets + *filldims; i++) + volume[i] = fillv; + } else { + uint64_t stride = prod(ndims - 1, dims + 1); + for (i = *offsets; i < *offsets + *filldims; i++) { + fill_subvolume(ndims - 1, dims + 1, volume + stride * i, offsets + 1, filldims + 1, fillv); + } + } +} + +static void printvolume(int ndims, uint64_t *dims, int *volume, int indent) { + int i, j; + if (ndims == 1) { + for (j = 0; j < indent; j++) + printf(" "); + printf("["); + for (i = 0; i < *dims; i++) + printf(" %x", volume[i]); + printf(" ]\n"); + } else { + uint64_t stride = prod(ndims - 1, dims + 1); + for (j = 0; j < indent; j++) + printf(" "); + printf("[\n"); + for (i = 0; i < *dims; i++) { + printvolume(ndims - 1, dims + 1, volume + stride * i, indent + 2); + } + for (j = 0; j < indent; j++) + printf(" "); + printf("]\n"); + } +} + +char *cmd; +static void usage_and_exit() { + fprintf(stderr, "Usage: %s ... \n", cmd); + exit(1); +} + +int runtest(int argc, char **argv) { + int ndims, nvolumes; + uint64_t *subvolume_dims; + uint64_t *volume_dims, *volume_offsets; + int **volumes; + int *final_volume; + int i, j; + + cmd = *argv; + SHIFT; + if (argc < 2) usage_and_exit(); + ndims = atoi(argv[0]); + nvolumes = atoi(argv[1]); + SHIFT_N(2); + + if (argc < 2 * ndims * nvolumes + ndims) usage_and_exit(); + +#ifdef VERBOSE + printf("Using %d-dimensional space with %d volumes\n", ndims, nvolumes); +#endif + + subvolume_dims = malloc(ndims * sizeof(uint64_t)); + volume_dims = malloc(nvolumes * ndims * sizeof(uint64_t)); + volume_offsets = malloc(nvolumes * ndims * sizeof(uint64_t)); + volumes = malloc(nvolumes * sizeof(int*)); + +#ifdef VERBOSE + printf("Subvolume dimensions:"); +#endif + for (i = 0; i < ndims; i++) { + subvolume_dims[i] = atoll(argv[i]); +#ifdef VERBOSE + printf(" %llu", subvolume_dims[i]); +#endif + } +#ifdef VERBOSE + printf("\n"); +#endif + + SHIFT_N(ndims); + + for (i = 0; i < nvolumes; i++) { +#ifdef VERBOSE + printf("Volume %d:\n", i); +#endif + +#ifdef VERBOSE + printf(" Dimensions:"); +#endif + for (j = 0; j < ndims; j++) { + volume_dims[i * ndims + j] = atoll(argv[j]); +#ifdef VERBOSE + printf(" %llu", volume_dims[i * ndims + j]); +#endif + } +#ifdef VERBOSE + printf("\n"); +#endif + SHIFT_N(ndims); + +#ifdef VERBOSE + printf(" Offsets:"); +#endif + for (j = 0; j < ndims; j++) { + volume_offsets[i * ndims + j] = atoll(argv[j]); +#ifdef VERBOSE + printf(" %llu", volume_offsets[i * ndims + j]); +#endif + assert(volume_offsets[i * ndims + j] + subvolume_dims[j] <= volume_dims[i * ndims + j]); + } +#ifdef VERBOSE + printf("\n"); +#endif + SHIFT_N(ndims); + + volumes[i] = malloc(prod(ndims, volume_dims + i*ndims) * sizeof(int)); + fill(ndims, volume_dims + i*ndims, volumes[i], i); + //printvolume(ndims, volume_dims + i*ndims, volumes[i], 0); + } + + // final_volume = first volume, but with garbage filled into the subvolume to copy + final_volume = malloc(prod(ndims, volume_dims + 0*ndims) * sizeof(int)); + memcpy(final_volume, volumes[0], prod(ndims, volume_dims + 0*ndims)); + fill_subvolume(ndims, volume_dims + 0*ndims, final_volume, volume_offsets + 0*ndims, subvolume_dims, -1); + +#ifdef VERBOSE + printf("--- Final volume before copy:\n"); + printvolume(ndims, volume_dims + 0*ndims, final_volume, 0); + printf("----------\n"); +#endif + +#ifdef VERBOSE + printf("--- Volume 0:\n"); + printvolume(ndims, volume_dims + 0*ndims, volumes[0], 0); + printf("----------\n"); +#endif + + for (i = 1; i < nvolumes; i++) { +#ifdef VERBOSE + printf("Copying subvolume from volume %d to %d\n", i-1 + 1, i + 1); +#endif + copy_subvolume(volumes[i], volumes[i-1], ndims, subvolume_dims, + volume_dims + i*ndims, volume_offsets + i*ndims, + volume_dims + (i-1)*ndims, volume_offsets + (i-1)*ndims, + adios_integer, adios_flag_no); + +#ifdef VERBOSE + printf("--- Volume %d:\n", i); + printvolume(ndims, volume_dims + i*ndims, volumes[i], 0); + printf("----------\n"); +#endif + } + +#ifdef VERBOSE + printf("Copying subvolume from volume %d to replica of volume 1\n", nvolumes); +#endif + copy_subvolume(final_volume, volumes[nvolumes-1], ndims, subvolume_dims, + volume_dims + 0*ndims, volume_offsets + 0*ndims, + volume_dims + (nvolumes-1)*ndims, volume_offsets + (nvolumes-1)*ndims, + adios_integer, adios_flag_no); + +#ifdef VERBOSE + printf("--- Final volume:\n", i); + printvolume(ndims, volume_dims + 0*ndims, final_volume, 0); + printf("----------\n"); +#endif + +#ifdef VERBOSE + printf("Comparing volume 0 and its replica after copy operations...\n"); +#endif + int success = (memcmp(volumes[0], final_volume, prod(ndims, volume_dims + 0*ndims)) == 0); + + if (success) { + printf("Success!\n"); + return 0; + } else { + printf("Failed!\n"); + return 1; + } +} + +#include +int runtest_helper(const char *cmdline) { + int argc = 0; + char *argv[256]; + char *cmdline_tmp = strdup(cmdline); + + do { + argv[argc] = strtok(argc == 0 ? cmdline_tmp : NULL, " \t"); + } while (argv[argc++]); + + argc--; +#ifdef VERBOSE + printf("argc = %d\n", argc); +#endif + + int ret = runtest(argc, argv); + + free(cmdline_tmp); + return ret; +} + +int main(int argc, char **argv) { + if (argc == 1) { + printf("Running copy_volume tests...\n"); + printf("Test 1...\n"); + int ret = runtest_helper( + "dummycmd 2 4 " \ + "10 10 " \ + "10 10 " "0 0 " \ + "20 20 " "5 5 " \ + "10 20 " "0 0 " \ + "20 10 " "0 0 "); + + if (ret != 0) + return ret; + + return 0; + } else { + return runtest(argc, argv); + } +} diff --git a/tests/libs/adios/tests/suite/programs/group_free_test.c b/tests/libs/adios/tests/suite/programs/group_free_test.c new file mode 100644 index 0000000000..5e5f10d72c --- /dev/null +++ b/tests/libs/adios/tests/suite/programs/group_free_test.c @@ -0,0 +1,86 @@ +/* + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + */ + +/* ADIOS test: declare multiple groups and free them. + * Test issue that was fixed in 084d601de8fca676361b0ac4b96735e04295fa0f + * + * How to run: group_free_test + * Output: None + * ADIOS config file: None + * + * This is a sequential test. +*/ + +/* This example will create 3 adios groups for writing, then frees them. +*/ +#ifndef _NOMPI +#define _NOMPI +#endif + +#include +#include +#include "adios.h" +#include "adios_types.h" + +const int NBLOCKS = 3; +const int NGROUPS = 3; + +int main (int argc, char ** argv) +{ + int rank, size, i, j; + int NX = 100, gb, offset; //local/global/offset + MPI_Comm comm = MPI_COMM_WORLD; + char g_str[100], o_str[100], l_str[100]; + char groupname[256]; + + MPI_Init (&argc, &argv); + MPI_Comm_rank (comm, &rank); + MPI_Comm_size (comm, &size); + + gb = NBLOCKS * NX * size; + sprintf (g_str, "%d", gb); + sprintf (l_str, "%d", NX); + + + adios_init_noxml (comm); + adios_allocate_buffer (ADIOS_BUFFER_ALLOC_NOW, 10); + + int64_t groupid[NGROUPS]; + int64_t var_ids[NGROUPS][NBLOCKS]; + + for (j = 0; j < NGROUPS; j++) + { + sprintf (groupname, "group%1.1d", j); + adios_declare_group (&groupid[j], groupname, "", adios_flag_yes); + adios_select_method (groupid[j], "MPI", "", ""); + + for (i = 0; i < NBLOCKS; i++) + { + offset = rank * NBLOCKS * NX + i * NX; + sprintf (o_str, "%d", offset); + var_ids[j][i] = adios_define_var (groupid[j], "temperature" + ,"", adios_double + ,l_str, g_str, o_str + ); + adios_set_transform (var_ids[j][i], "identity"); + } + } + + MPI_Barrier (comm); + + // free groups in an illogical order 1, 0, 2 [3 4 ...] + if (NGROUPS > 1) adios_free_group (groupid[1]); + adios_free_group (groupid[0]); + for (j = 2; j < NGROUPS; j++) + { + adios_free_group (groupid[j]); + } + + adios_finalize (rank); + MPI_Finalize (); + return 0; +} diff --git a/tests/libs/adios/tests/suite/programs/hashtest.c b/tests/libs/adios/tests/suite/programs/hashtest.c new file mode 100644 index 0000000000..a1d1dee20d --- /dev/null +++ b/tests/libs/adios/tests/suite/programs/hashtest.c @@ -0,0 +1,171 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "core/qhashtbl.h" + +/* Test the hashtable in ADIOS. + * Create a hashtable of size HASHTABLE_SIZE + * Generate variable paths of NPATHS*NVARS times as P/v + * Generate double type scalars for each path/var + * Add them to the table + * Retrieve each of them and check that the value retrieved is the expected one + */ + +const int HASHTABLE_SIZE = 100; // how many rows in hash table +const int NPATHS = 650; // number of different paths tried +const int NVARS = 100; // number of vars per path + +char ** varpaths; +char ** varnames; +double * data; // npaths * nvars doubles, pathid.nameid +int range; +int npaths; +int nvars; + +void alloc_vars() +{ + int p,v; + + varpaths = (char**) malloc (npaths * sizeof(char*)); + for (p=0; p 0) { + d *= 10; + digit++; + } + + char fmt[16]; + sprintf (fmt, "p%%%d.%dd",digit,digit); + printf ("fmt=[%s]\n", fmt); + for (p=0; p 0) { + d *= 10; + digit++; + } + + sprintf (fmt, "v%%%d.%dd",digit,digit); + printf ("fmt=[%s]\n", fmt); + for (v=0; vput2(tbl, varpaths[p], varnames[v], &data[p*nvars+v]); + } + } + time (&tput); + tput = tput - tbegin; + + /* Get each element and check value */ + printf("============== GET DATA FROM HASHTABLE ============\n"); + time (&tbegin); + for (p=npaths-1; p>=0; p--) { + for (v=nvars-1; v>=0; v--) { + d = tbl->get2(tbl, varpaths[p], varnames[v]); + if (d == NULL) { + printf ("ERROR: stored value for p=%d,v=%d not found in hash table\n", + p, v); + return 1; + } else if (*d != data[p*nvars+v]) { + printf ("ERROR: for p=%d,v=%d, found value = %lf in hash table != " + "what was put in = %lf\n", + p, v, *d, data[p*nvars+v]); + return 2; + } + + } + } + time (&tget); + tget = tget - tbegin; + printf("Timing: put %d elements in %d seconds, got them back in %d seconds\n", + npaths*nvars, tput, tget); + + /* Print hashtable */ + printf("============== PRINT HASHTABLE ============\n"); + tbl->debug(tbl,NULL,0); + + /* Free hashtable */ + tbl->free(tbl); + + free_vars(); + return 0; +} + +int main (int argc, char ** argv) +{ + int retval; + range = HASHTABLE_SIZE; + npaths = NPATHS; + nvars = NVARS; + + retval = dotest(); + + return retval; +} + diff --git a/tests/libs/adios/tests/suite/programs/local_array_time.c b/tests/libs/adios/tests/suite/programs/local_array_time.c new file mode 100644 index 0000000000..648fd01154 --- /dev/null +++ b/tests/libs/adios/tests/suite/programs/local_array_time.c @@ -0,0 +1,173 @@ +/* + + Simple cosine and sine 1D arrays over time from + a single process. + Test: can we read back the timed 2D arrays? + +*/ + +/* Include other header files */ +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* ADIOS include files */ +#include "adios.h" + +/* ------------------ Global variables (for main.c only) ------------------ */ +// Simulation Variables +//--------------------- +char basedatapath[256] ; // data output files' starting path (without varname) +char baseimgpath[256] ; // image output files' starting path (without varname) +char outpath1[256] ; // data output files' starting path (can be extended with subdirs, names, indexes) +char outpath2[256] ; // image output files' starting path (can be extended with subdirs, names, indexes) +char title[256]; // Title of the (single) plot +char subtitle[256]; // subtitle of the (single) plot +char xname[256]; // force to plot this as X axis string +char varname [100]; // variable name +char vardirpath[256]; // variable path for a variable name +char txtpath[256]; // text path for a text file to be registered +char datapath[256]; // data path for a data file to be registered +char longvarname[256]; + +// Utility variable to create directories +int res0 = 0; + +/* ------------------------------ Prototypes ------------------------------ */ +// Print out raw data files (Here simple ASCII files, later BP files) +static int print_data_1D(float timestep, int npoints, float *x, float *y, int output_xml); + +/* --------------------------------- Main --------------------------------- */ +int main( int argc, char ** argv) +{ + char filename [256]; + MPI_Comm comm = MPI_COMM_WORLD; + int rank, size; + /* ADIOS variables declarations for matching gwrite_schema.ch */ + int adios_err; + uint64_t adios_groupsize, adios_totalsize; + int64_t adios_handle; + float tmax = 10.0; + float dt = 0.5; // run from 0.0 increasing with 'dt' up to 'tmax' + int i; + + MPI_Init (&argc, &argv); + MPI_Comm_rank (comm, &rank); + MPI_Comm_size (comm, &size); + + adios_init ("local_array_time.xml", comm); + strcpy(filename, "local_array_time.bp"); + + + // Declare and Initialize essential variables + int num_points = 37; + float angles[num_points]; + float cos_of_angles[num_points]; + float sin_of_angles[num_points]; + float pi; + + // Obtain pi once for all + pi = 4.0*atan(1.0); + + // Initialize angles in degrees + float angle_degree = 0; + for (i=0; i\n"); + fprintf(f, "\n", xname, yname); + for (i=0; i %s %s \n", xstr, ystr); + } + fprintf(f, "\n"); + } else if (output_xml == 0){ + for (i=0; i + + + + + + + + + + + + + + diff --git a/tests/libs/adios/tests/suite/programs/many_vars.c b/tests/libs/adios/tests/suite/programs/many_vars.c new file mode 100644 index 0000000000..ea89543aac --- /dev/null +++ b/tests/libs/adios/tests/suite/programs/many_vars.c @@ -0,0 +1,375 @@ +/* + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + */ + +/* ADIOS C test: + * Write a huge number of variables + * Then read them all and check if they are correct. + * + * How to run: mpirun -np many_vars + * Output: many_vars.bp + * + */ +#include +#include +#include +#include +#include +#include "adios.h" +#include "adios_read.h" + +#ifdef DMALLOC +#include "dmalloc.h" +#endif + +#define log(...) fprintf (stderr, "[rank=%3.3d, line %d]: ", rank, __LINE__); fprintf (stderr, __VA_ARGS__); fflush(stderr); +#define printE(...) fprintf (stderr, "[rank=%3.3d, line %d]: ERROR: ", rank, __LINE__); fprintf (stderr, __VA_ARGS__); fflush(stderr); + +int NVARS = 1; +int NBLOCKS = 1; +int NSTEPS = 1; +static const char FILENAME[] = "many_vars.bp"; +#define VALUE(rank, step, block) (step * 10000 + 10*rank + block) + +/* Variables to write */ +int *a2; + +static const int ldim1 = 5; +static const int ldim2 = 5; +int gdim1, gdim2; +int offs1, offs2; + +int64_t m_adios_group; + +/* Variables to read */ +int *r2; + +MPI_Comm comm = MPI_COMM_WORLD; +int rank; +int size; +char ** varnames; + +void alloc_vars() +{ + int n,i; + + n = ldim1 * ldim2; + a2 = (int*) malloc (n * sizeof(int)); + r2 = (int*) malloc (n * sizeof(int)); + varnames = (char**) malloc (NVARS * sizeof(char*)); + for (i=0; i 0) { + d *= 10; + digit++; + } + + char fmt[16]; + sprintf (fmt, "v%%%d.%dd",digit,digit); + printf ("ftm=[%s]\n", fmt); + for (i=0; i \n" + " : Number of variables to generate\n" + " : Number of blocks per process to write\n" + " : Number of write cycles (to same file)\n"); +} + +void define_vars (); +int write_file (int step); +int read_file (); + +int main (int argc, char ** argv) +{ + int err,i ; + + MPI_Init (&argc, &argv); + MPI_Comm_rank (comm, &rank); + MPI_Comm_size (comm, &size); + + if (argc < 2) { Usage(); return 1; } + + errno = 0; + i = strtol (argv[1], NULL, 10); + if (errno || i < 1) { printf("Invalid 1st argument %s\n", argv[1]); Usage(); return 1;} + NVARS = i; + + if (argc > 2) { + i = strtol (argv[2], NULL, 10); + if (errno || i < 1) { printf("Invalid 2nd argument %s\n", argv[2]); Usage(); return 1;} + NBLOCKS = i; + } + + if (argc > 3) { + i = strtol (argv[3], NULL, 10); + if (errno || i < 1) { printf("Invalid 3rd argument %s\n", argv[3]); Usage(); return 1;} + NSTEPS = i; + } + + alloc_vars(); + adios_init_noxml (comm); + adios_allocate_buffer (ADIOS_BUFFER_ALLOC_NOW, 100); + err = adios_read_init_method(ADIOS_READ_METHOD_BP, comm, "verbose=2"); + if (err) { + printE ("%s\n", adios_errmsg()); + } + + adios_declare_group (&m_adios_group, "multiblock", "iter", adios_flag_yes); + adios_select_method (m_adios_group, "MPI", "", ""); + + + define_vars(); + set_gdim(); + + for (i=0; indim != NDIM) { \ + printE ("Variable %s has %d dimensions, but expected %d\n", VARNAME, vi->ndim, NDIM); \ + err = 102; \ + goto endread; \ + } \ + if (vi->nsteps != NSTEPS) { \ + printE ("Variable %s has %d steps, but expected %d\n", VARNAME, vi->nsteps, NSTEPS); \ + err = 103; \ + /*goto endread; */\ + } \ + adios_free_varinfo (vi); + +#define CHECK_SCALAR(VARNAME, VAR, VALUE, STEP) \ + if (VAR != VALUE) { \ + printE (#VARNAME " step %d: wrote %d but read %d\n",STEP,VALUE,VAR);\ + err = 104; \ + /*goto endread;*/\ + } + +#define CHECK_ARRAY(VARNAME,A,N,VALUE,STEP,BLOCK,i) \ + for (i=0;i path_test + * Output: path_test.bp + * + */ +#include +#include +#include +#include +#include "adios.h" +#include "adios_read.h" + +#ifdef DMALLOC +#include "dmalloc.h" +#endif + +#define log(...) fprintf (stderr, "[rank=%3.3d, line %d]: ", rank, __LINE__); fprintf (stderr, __VA_ARGS__); fflush(stderr); +#define printE(...) fprintf (stderr, "[rank=%3.3d, line %d]: ERROR: ", rank, __LINE__); fprintf (stderr, __VA_ARGS__); fflush(stderr); + +/* Variables to write */ +int *a1, *a2, *a3, *a4, *a5, *a6, *a7; + +/* Variables to read */ +int *r1, *r2, *r3, *r4, *r5, *r6, *r7; + +int ldim1 = 1; +int ldim2 = 2; +int ldim3 = 3; +int ldim4 = 4; +int ldim5 = 5; +int ldim6 = 6; +int ldim7 = 7; +int gdim1, gdim2, gdim3, gdim4, gdim5, gdim6, gdim7; +int offs1, offs2, offs3, offs4, offs5, offs6, offs7; + +MPI_Comm comm = MPI_COMM_WORLD; +int rank; +int size; + +void init_vars() +{ + int i; + int v = rank%10; + + gdim1 = size*ldim1; + gdim2 = size*ldim2; + gdim3 = size*ldim3; + gdim4 = size*ldim4; + gdim5 = size*ldim5; + gdim6 = size*ldim6; + gdim7 = size*ldim7; + + offs1 = rank*ldim1; + offs2 = rank*ldim2; + offs3 = rank*ldim3; + offs4 = rank*ldim4; + offs5 = rank*ldim5; + offs6 = rank*ldim6; + offs7 = rank*ldim7; + + a1 = (int*) malloc (ldim1 * sizeof(int)); + a2 = (int*) malloc (ldim2 * sizeof(int)); + a3 = (int*) malloc (ldim3 * sizeof(int)); + a4 = (int*) malloc (ldim4 * sizeof(int)); + a5 = (int*) malloc (ldim5 * sizeof(int)); + a6 = (int*) malloc (ldim6 * sizeof(int)); + a7 = (int*) malloc (ldim7 * sizeof(int)); + r1 = (int*) malloc (ldim1 * sizeof(int)); + r2 = (int*) malloc (ldim2 * sizeof(int)); + r3 = (int*) malloc (ldim3 * sizeof(int)); + r4 = (int*) malloc (ldim4 * sizeof(int)); + r5 = (int*) malloc (ldim5 * sizeof(int)); + r6 = (int*) malloc (ldim6 * sizeof(int)); + r7 = (int*) malloc (ldim7 * sizeof(int)); + + for (i=0; ivalue != VAR) { \ + printE ("Scalar %s as read from file != as written\n", VARNAME); \ + err = 102; \ + goto endread; \ + } \ + adios_free_varinfo (vi); + +#define CHECK_ARRAY(A,R,LEN) \ + for (i=0;i + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +verbose=4 + + + + + diff --git a/tests/libs/adios/tests/suite/programs/posix_method.F90 b/tests/libs/adios/tests/suite/programs/posix_method.F90 new file mode 100644 index 0000000000..3da46450b1 --- /dev/null +++ b/tests/libs/adios/tests/suite/programs/posix_method.F90 @@ -0,0 +1,106 @@ +! +! ADIOS is freely available under the terms of the BSD license described +! in the COPYING file in the top level directory of this source distribution. +! +! Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. +! + +!/*************************************************************/ +!/* Test of writing of simple arrays in ADIOS with POSIX method */ +!/* */ +!/* Similar example is examples/Fortran/arrays/arrays_write.c */ +!/*************************************************************/ +program posix_method + use adios_write_mod + implicit none + include 'mpif.h' + + character(len=30) :: filename = "posix_method.bp" + integer :: i, j, ierr + integer :: rank, size, comm + + ! ADIOS variables declarations for matching gwrite_temperature.fh + integer :: adios_err + integer*8 :: adios_groupsize, adios_totalsize + integer*8 :: adios_handle, adios_buf_size + + ! variables to write out + integer, parameter :: NX = 10, NY = 100 + integer :: NXin, NYin + real*8 :: t(NX,NY), tin(NX,NY) + integer :: p(NX), pin(NX) + + call MPI_Init (ierr) + call MPI_Comm_dup (MPI_COMM_WORLD, comm, ierr) + call MPI_Comm_rank (comm, rank, ierr) + call MPI_Comm_size (comm, size, ierr) + + do j = 1,NY + do i = 1,NX + t(i,j) = rank*NX*NY + (j-1)*NX + i-1 + enddo + enddo + + do i = 1,NX + p(i) = rank*NX + i + enddo + + call adios_init ("posix_method.xml", comm, adios_err); + + + ! Write data out + call adios_open (adios_handle, "posix_method", filename, "w", comm, adios_err); +#include "gwrite_posix_method.fh" + call adios_close (adios_handle, adios_err) + + + ! Read data in + call adios_open (adios_handle, "posix_method", filename, "r", comm, adios_err); + + ! First read in the scalars to calculate the size of the arrays + adios_buf_size = 4 + call adios_read (adios_handle, "NX", NXin, adios_buf_size, adios_err) + adios_buf_size = 4 + call adios_read (adios_handle, "NY", NYin, adios_buf_size, adios_err) + call adios_close (adios_handle, adios_err) + + if (NX /= NXin) then + write (0, '("Error: NX=",i0," read from file != NX=",i0," written to file.")') NXin, NX + call exit(1) + endif + if (NY /= NYin) then + write (0, '("Error: NY=",i0," read from file != NY=",i0," written to file.")') NYin, NY + call exit(1) + endif + + ! Read the arrays + call adios_open (adios_handle, "posix_method", filename, "r", comm, adios_err); + call adios_group_size (adios_handle, adios_groupsize, adios_totalsize, adios_err) + adios_buf_size = 8 * (NX) * (NY) + call adios_read (adios_handle, "var_double_2Darray", tin, adios_buf_size, adios_err) + adios_buf_size = 4 * (NX) + call adios_read (adios_handle, "var_int_1Darray", pin, adios_buf_size, adios_err) + call adios_close (adios_handle, adios_err) + + + ! Check input against output + do i = 1,NX + if (p(i)-pin(i) .ge. 0.000001) then + write (0,'("Error: p read from file != p written to file.")') + call exit(1) + endif + enddo + do j = 1,NY + do i = 1,NX + if (t(i,j)-tin(i,j) .ge. 0.000001 ) then + write (0,'("Error: t read from file != t written to file.")') + call exit(1) + endif + enddo + enddo + + call adios_finalize (0, adios_err); + call MPI_Finalize (ierr); + +end program + diff --git a/tests/libs/adios/tests/suite/programs/posix_method.xml b/tests/libs/adios/tests/suite/programs/posix_method.xml new file mode 100644 index 0000000000..7770ee09ba --- /dev/null +++ b/tests/libs/adios/tests/suite/programs/posix_method.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/tests/libs/adios/tests/suite/programs/reuse_dim.c b/tests/libs/adios/tests/suite/programs/reuse_dim.c new file mode 100755 index 0000000000..7f79d8cd02 --- /dev/null +++ b/tests/libs/adios/tests/suite/programs/reuse_dim.c @@ -0,0 +1,208 @@ +/* + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + */ + +/* ADIOS C Example: write two arrays, using the same dim scalar with different values + * + * How to run: ./reuse_dim + * Output: reuse_dim.bp + * ADIOS config file: None + * + */ + +/* This example will write out 2 1D arrays, and one scalar NX twice. + * The dimension of the arrays is NX, but with different values. + * This test comes from how Maya is using ADIOS to write tens of thousands + * of arrays (patches), but using the same scalar for dimension + */ + +#include +#include +#include +#include +#include "adios.h" +#include "adios_read.h" + +#ifdef DMALLOC +#include "dmalloc.h" +#endif + + +#define log(...) fprintf (stderr, "[rank=%3.3d, line %d]: ", rank, __LINE__); fprintf (stderr, __VA_ARGS__); fflush(stderr); +#define printE(...) fprintf (stderr, "[rank=%3.3d, line %d]: ERROR: ", rank, __LINE__); fprintf (stderr, __VA_ARGS__); fflush(stderr); + + +int NX = 100; +double *t, *r1, *r2; + +/* ADIOS variables declarations for matching gwrite_temperature.ch */ +int64_t m_adios_group; +int64_t m_adios_file; + +MPI_Comm comm = MPI_COMM_WORLD; +int rank; +int size; + + +void init_vars() +{ + int i; + t = (double *) malloc (NX * sizeof(double)); + r1 = (double *) malloc (NX * sizeof(double)); + r2 = (double *) malloc (NX * sizeof(double)); + for (i = 0; i < NX; i++) + t[i] = i; +} + +void fini_vars() +{ + free (t); + free (r1); + free (r2); +} + +int write_file (char *fname); +int read_file (char *fname); + +int main (int argc, char ** argv) +{ + int err; + + MPI_Init (&argc, &argv); + MPI_Comm_rank (comm, &rank); + MPI_Comm_size (comm, &size); + + init_vars(); + adios_init_noxml (comm); + err = adios_read_init_method(ADIOS_READ_METHOD_BP, comm, "verbose=2"); + if (err) { + printE ("%s\n", adios_errmsg()); + } + + if (!err) + err = declare_group (); + if (!err) + err = write_file ("reuse_dim.bp"); + if (!err) + err = read_file ("reuse_dim.bp"); + + adios_finalize (rank); + fini_vars(); + MPI_Finalize (); + return err; +} + + +int declare_group () +{ + + adios_allocate_buffer (ADIOS_BUFFER_ALLOC_NOW, 10); + + adios_declare_group (&m_adios_group, "restart", "iter", adios_flag_yes); + adios_select_method (m_adios_group, "MPI", "verbose=2", ""); + + adios_define_var (m_adios_group, "NX" + ,"", adios_integer + ,0, 0, 0); + + adios_define_var (m_adios_group, "t1" + ,"", adios_double + ,"NX", "100", "0"); + + adios_define_var (m_adios_group, "NX" + ,"", adios_integer + ,0, 0, 0); + + adios_define_var (m_adios_group, "t2" + ,"", adios_double + ,"NX", "100", "0"); + + return 0; +} + + +int write_file (char *fname) +{ + char filename [256]; + int rank, size, i, block; + int adios_err; + uint64_t adios_groupsize, adios_totalsize; + int64_t adios_handle; + + strcpy (filename, "reuse_dim.bp"); + + adios_open (&m_adios_file, "restart", filename, "w", comm); + + adios_groupsize = (2*sizeof(int) + 2*NX*sizeof(double)); + + adios_group_size (m_adios_file, adios_groupsize, &adios_totalsize); + + adios_write(m_adios_file, "NX", (void *) &NX); + adios_write(m_adios_file, "t1", t); + + adios_write(m_adios_file, "NX", (void *) &NX); + adios_write(m_adios_file, "t2", t); + + adios_close (m_adios_file); + + MPI_Barrier (comm); + + return 0; +} + +#define CHECK_ARRAY(A,R,n) \ + for (i=0;i selections + * Output: selections.bp + * + */ +#include +#include +#include +#include +#include +#include "adios.h" +#include "adios_read.h" + +#ifdef DMALLOC +#include "dmalloc.h" +#endif + +//#define DEBUG_PRINTS + +#define log(...) fprintf (stderr, "[rank=%3.3d, line %d]: ", rank, __LINE__); fprintf (stderr, __VA_ARGS__); fflush(stderr); +#define printE(...) fprintf (stderr, "[rank=%3.3d, line %d]: ERROR: ", rank, __LINE__); fprintf (stderr, __VA_ARGS__); fflush(stderr); + +static const int NSTEPS = 5; +static const char FILENAME[] = "selections.bp"; +#define VALUE1D(rank,step,i) (100*(rank)+10*(step)+i) +#define VALUE2D(rank,step,i,j) (1000*(rank)+100*(step)+10*(i)+j) +#define VALUE3D(rank,step,i,j,k) (10000*(rank)+1000*(step)+100*(i)+10*(j)+k) + +/* Variables to write */ +int a0; +int *a1; +int *a2; +int *a3; + +/* Variables to read */ +int r0; +int *r1, *r2, *r3; + +static const int ldim1 = 3; +static const int ldim2 = 5; +static const int ldim3 = 7; +int gdim1, gdim2, gdim3; +int offs1, offs2, offs3; + +MPI_Comm comm = MPI_COMM_WORLD; +int rank; +int size; +int64_t m_adios_group; +enum ADIOS_READ_METHOD read_method = ADIOS_READ_METHOD_BP; + +void alloc_vars() +{ + int n; + + gdim1 = size*ldim1; + gdim2 = ldim2; + gdim3 = ldim3; + + offs1 = rank*ldim1; + offs2 = 0; + offs3 = 0; + + n = ldim1; + a1 = (int*) malloc (n * sizeof(int)); + r1 = (int*) malloc (n * sizeof(int)); + + n = ldim1 * ldim2; + a2 = (int*) malloc (n * sizeof(int)); + r2 = (int*) malloc (n * sizeof(int)); + + n = ldim1 * ldim2 * ldim3; + a3 = (int*) malloc (n * sizeof(int)); + r3 = (int*) malloc (n * sizeof(int)); +} + +void set_vars(int step) +{ + int i, j, k; + + a0 = VALUE1D(rank,step,0); + + for (i=0; i [w|r]\n" + " : Method, 0: file, 1: staging\n" + " w: do write only\n" + " r: do read only\n"); +} + +int main (int argc, char ** argv) +{ + int err, step ; + int do_write = 1; + int do_read = 1; + int m = 0; + char write_method[16]; + + MPI_Init (&argc, &argv); + MPI_Comm_rank (comm, &rank); + MPI_Comm_size (comm, &size); + + if (argc > 1) { + m = strtol (argv[1], NULL, 10); + if (errno) { printf("Invalid 1st argument %s\n", argv[1]); Usage(); return 1;} + } + if (argc > 2) { + if (argv[2][0] == 'w' || argv[2][0] == 'W') { + do_read = 0; + } else if (argv[2][0] == 'r' || argv[2][0] == 'R') { + do_write = 0; + } else { + printE ("Invalid command line argument %s. Allowed ones:\n" + " w: do write only\n" + " r: do read only\n", argv[2]); + MPI_Finalize (); + return 1; + } + } + + if (m==0) { + read_method = ADIOS_READ_METHOD_BP; + strcpy(write_method,"MPI"); + } else { + read_method = ADIOS_READ_METHOD_DATASPACES; + strcpy(write_method,"DATASPACES"); + } + + + log ("Writing: %s method=%s\n" + "Reading: %s method=%d\n", + (do_write ? "yes" : "no"), write_method, + (do_read ? "yes" : "no"), read_method); + + alloc_vars(); + if (do_write) { + adios_init_noxml (comm); + adios_allocate_buffer (ADIOS_BUFFER_ALLOC_NOW, 10); + } + if (do_read) { + err = adios_read_init_method(read_method, comm, "verbose=2"); + if (err) { + printE ("%s\n", adios_errmsg()); + } + } + + + if (do_write) { + adios_declare_group (&m_adios_group, "selections", "iter", adios_flag_yes); + adios_select_method (m_adios_group, write_method, "verbose=2", ""); + + define_vars(); + + for (step=0; stepcurrent_step); + + + log (" Check 1D variable a1...\n"); + adios_schedule_read (f, sel1, "a1", 0, 1, r1); + adios_perform_reads (f, 1); + +#ifdef DEBUG_PRINTS + fprintf(stderr, "1D result: {"); + for (i=0; icurrent_step,i); + if (r1[i] != v) { + printE ("Error: a1[%d]=%d != read=%d\n", i, v, r1[i]); + //goto endread; + } + } + + + + log (" Check 2D variable a2...\n"); + adios_schedule_read (f, sel2, "a2", 0, 1, r2); + adios_perform_reads (f, 1); + +#ifdef DEBUG_PRINTS + fprintf(stderr, "2D result :\n"); + n = 0; + for (i=0; icurrent_step,i,j); + if (v != r2[n]) { + printE ("Error: a2[%d,%d]=%d != read=%d\n", i, j, v, r2[n]); + //goto endread; + } + n++; + } + } + + + + + log (" Check 3D variable a3...\n"); + adios_schedule_read (f, sel3, "a3", 0, 1, r3); + adios_perform_reads (f, 1); + +#ifdef DEBUG_PRINTS + fprintf(stderr, "3D selection :\n"); + n=0; + for (i=0; icurrent_step,i,j,k); + if (v != r3[n]) { + printE ("Error: a3[%d,%d,%d]=%d != read=%d\n", i, j, k, v, r3[n]); + //goto endread; + } + n++; + } + } + } + + if (n1 < NSTEPS) + { + adios_advance_step (f, 0, -1.0); + } + } + + +endread: + + adios_selection_delete (sel1); + adios_selection_delete (sel2); + adios_selection_delete (sel3); + + free(pts1); + free(pts2); + free(pts3); + + adios_read_close(f); + MPI_Barrier (comm); + return err; +} + diff --git a/tests/libs/adios/tests/suite/programs/set_path.c b/tests/libs/adios/tests/suite/programs/set_path.c new file mode 100644 index 0000000000..a8562c4970 --- /dev/null +++ b/tests/libs/adios/tests/suite/programs/set_path.c @@ -0,0 +1,333 @@ +/* + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + */ + +/* ADIOS C test: + * Write variables with different paths + * Then read them all and check if they are correct. + * + * How to run: mpirun -np set_path + * Output: set_path.bp + * + */ +#include +#include +#include +#include +#include "adios.h" +#include "adios_read.h" + +#ifdef DMALLOC +#include "dmalloc.h" +#endif + +#define log(...) fprintf (stderr, "[rank=%3.3d, line %d]: ", rank, __LINE__); fprintf (stderr, __VA_ARGS__); fflush(stderr); +#define printE(...) fprintf (stderr, "[rank=%3.3d, line %d]: ERROR: ", rank, __LINE__); fprintf (stderr, __VA_ARGS__); fflush(stderr); + +static const char FILENAME[] = "set_path.bp"; +#define VALUE(rank,varid) (100*varid+rank) +#define VALUE0(varid) VALUE(0,varid) + +/* Variables to write */ +int s0, s1, s2; +int *a0, *a1, *a2; + +/* Variables to read */ +int rs0, rs1, rs2; +int *ra0, *ra1, *ra2; + +static const int ldim1 = 7; +int gdim1; +int offs1; + +MPI_Comm comm = MPI_COMM_WORLD; +int rank; +int size; + +void alloc_vars() +{ + int n; + + gdim1 = size*ldim1; + offs1 = rank*ldim1; + + n = ldim1; + a0 = (int*) malloc (n * sizeof(int)); + a1 = (int*) malloc (n * sizeof(int)); + a2 = (int*) malloc (n * sizeof(int)); + ra0 = (int*) malloc (n * sizeof(int)); + ra1 = (int*) malloc (n * sizeof(int)); + ra2 = (int*) malloc (n * sizeof(int)); +} + +void set_vars(int rank) +{ + int n, i; + int v0, v1, v2; + + n = ldim1; + + s0 = VALUE(rank,0); + s1 = VALUE(rank,1); + s2 = VALUE(rank,2); + + for (i=0; indim != NDIM) { \ + printE ("Variable %s has %d dimensions, but expected %d\n", VARNAME, vi->ndim, NDIM); \ + err = 102; \ + goto endread; \ + } \ + if (vi->nsteps != NSTEPS) { \ + printE ("Variable %s has %d steps, but expected %d\n", VARNAME, vi->nsteps, NSTEPS); \ + err = 103; \ + /*goto endread; */\ + } \ + adios_free_varinfo (vi); + +#define CHECK_SCALAR(VARNAME, VAR, VALUE, STEP) \ + if (VAR != VALUE) { \ + printE ("%s step %d: wrote %d but read %d\n",VARNAME,STEP,VALUE,VAR);\ + err = 104; \ + /*goto endread;*/\ + } + +#define CHECK_ARRAY(VARNAME,A,N,VALUE,STEP,i) \ + for (i=0;i + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/libs/adios/tests/suite/programs/set_path_var.c b/tests/libs/adios/tests/suite/programs/set_path_var.c new file mode 100644 index 0000000000..4bdb5cac64 --- /dev/null +++ b/tests/libs/adios/tests/suite/programs/set_path_var.c @@ -0,0 +1,352 @@ +/* + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + */ + +/* ADIOS C test: + * Write variables with different paths + * Then read them all and check if they are correct. + * + * How to run: mpirun -np set_path_var + * Output: set_path_var.bp + * + */ +#include +#include +#include +#include +#include "adios.h" +#include "adios_read.h" + +#ifdef DMALLOC +#include "dmalloc.h" +#endif + +#define log(...) fprintf (stderr, "[rank=%3.3d, line %d]: ", rank, __LINE__); fprintf (stderr, __VA_ARGS__); fflush(stderr); +#define printE(...) fprintf (stderr, "[rank=%3.3d, line %d]: ERROR: ", rank, __LINE__); fprintf (stderr, __VA_ARGS__); fflush(stderr); + +static const char FILENAME[] = "set_path_var.bp"; +#define VALUE(rank,varid) (100*varid+rank) +#define VALUE0(varid) VALUE(0,varid) + +/* Variables to write */ +int s0, s1, s2; +int *a0, *a1, *a2; + +/* Variables to read */ +int rs0, rs1, rs2; +int *ra0, *ra1, *ra2; + +static const int ldim1 = 7; +int gdim1; +int offs1; + +MPI_Comm comm = MPI_COMM_WORLD; +int rank; +int size; + +void alloc_vars() +{ + int n; + + gdim1 = size*ldim1; + offs1 = rank*ldim1; + + n = ldim1; + a0 = (int*) malloc (n * sizeof(int)); + a1 = (int*) malloc (n * sizeof(int)); + a2 = (int*) malloc (n * sizeof(int)); + ra0 = (int*) malloc (n * sizeof(int)); + ra1 = (int*) malloc (n * sizeof(int)); + ra2 = (int*) malloc (n * sizeof(int)); +} + +void set_vars(int rank) +{ + int n, i; + int v0, v1, v2; + + n = ldim1; + + s0 = VALUE(rank,0); + s1 = VALUE(rank,1); + s2 = VALUE(rank,2); + + for (i=0; indim != NDIM) { \ + printE ("Variable %s has %d dimensions, but expected %d\n", VARNAME, vi->ndim, NDIM); \ + err = 102; \ + goto endread; \ + } \ + if (vi->nsteps != NSTEPS) { \ + printE ("Variable %s has %d steps, but expected %d\n", VARNAME, vi->nsteps, NSTEPS); \ + err = 103; \ + /*goto endread; */\ + } \ + adios_free_varinfo (vi); + +#define CHECK_SCALAR(VARNAME, VAR, VALUE, STEP) \ + if (VAR != VALUE) { \ + printE ("%s step %d: wrote %d but read %d\n",VARNAME,STEP,VALUE,VAR);\ + err = 104; \ + /*goto endread;*/\ + } + +#define CHECK_ARRAY(VARNAME,A,N,VALUE,STEP,i) \ + for (i=0;i + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/libs/adios/tests/suite/programs/steps_read_file.c b/tests/libs/adios/tests/suite/programs/steps_read_file.c new file mode 100644 index 0000000000..ab7e773718 --- /dev/null +++ b/tests/libs/adios/tests/suite/programs/steps_read_file.c @@ -0,0 +1,196 @@ +/* Staged write example code. + Assumptions: + - one output step fits into the memory of the staged writer. + Actually, this means, even more memory is needed than the size of output. + We need to read each variable while also buffering all of them for output. + - output steps contain the same variable set (no changes in variables) + - attributes are the same for all steps (will write only once here) +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include "adios_read.h" +#include "adios_error.h" + +// Input arguments +enum ADIOS_READ_METHOD read_method = ADIOS_READ_METHOD_BP; + +static const int max_read_buffer_size = 1024*1024*1024; +static const int max_write_buffer_size = 1024*1024*1024; + +static int timeout_sec = 30; // will stop if no data found for this time (-1: never stop) + + +// Global variables +int rank, numproc; +MPI_Comm comm; +ADIOS_FILE *f; // stream for reading +int64_t fh; // ADIOS output file handle +int64_t gh; // ADIOS group for output definitions +uint64_t write_total; // data size written by one processor +uint64_t largest_block; // the largest variable block one process reads +char ** group_namelist; // name of ADIOS group +char *readbuf; // read buffer +int decomp_values[10]; + + +int process_metadata(); +int read_records(); + +int main (int argc, char ** argv) +{ + int err; + int steps = 0, curr_step; + int retval = 0; + + MPI_Init (&argc, &argv); + comm = MPI_COMM_WORLD; + MPI_Comm_rank (comm, &rank); + MPI_Comm_size (comm, &numproc); + + char infilename[] = "steps.bp"; + + err = adios_read_init_method(ADIOS_READ_METHOD_BP, comm, + "max_chunk_size=100; " + "app_id =32767; \n" + "verbose= 3;" + "poll_interval = 100;" + ); + + if (!err) { + printf ("%s\n", adios_errmsg()); + } + + + printf ("Waiting to open stream %s...\n", infilename); + f = adios_read_open_file (infilename, read_method, comm); + if (adios_errno == err_file_not_found) + { + printf ("rank %d: Stream not found after waiting %d seconds: %s\n", + rank, timeout_sec, adios_errmsg()); + retval = adios_errno; + } + else if (adios_errno == err_end_of_stream) + { + printf ("rank %d: Stream terminated before open. %s\n", rank, adios_errmsg()); + retval = adios_errno; + } + else if (f == NULL) { + printf ("rank %d: Error at opening stream: %s\n", rank, adios_errmsg()); + retval = adios_errno; + } + else + { + // read data here... + + /* + printf ("File info:\n"); + printf (" current step: %d\n", f->current_step); + printf (" last step: %d\n", f->last_step); + printf (" # of variables: %d:\n", f->nvars); + */ + + retval = process_metadata(); + + retval = read_records(); + + adios_read_close (f); + } + + adios_read_finalize_method (read_method); + MPI_Finalize (); + + return retval; +} + + + +ADIOS_VARINFO * varinfo; +int NX, Width; + +int process_metadata() +{ + int retval = 0; + int i, j; + char gdims[256], ldims[256], offs[256]; + uint64_t sum_count; + ADIOS_VARINFO *v; // shortcut pointer + + /* First step processing */ + + printf ("Get info on variable Width\n"); + v = adios_inq_var (f, "Width"); + if (v == NULL) { + printf ("rank %d: ERROR: Variable %s inquiry failed: %s\n", + rank, "Width", adios_errmsg()); + return 1; + } + Width = *(int *)v->value; + adios_free_varinfo (v); + printf ("rank %d: Width = %d\n", rank, Width); + + printf ("Get info on variable NX\n"); + v = adios_inq_var (f, "NX"); + if (v == NULL) { + printf ("rank %d: ERROR: Variable %s inquiry failed: %s\n", + rank, "NX", adios_errmsg()); + return 1; + } + NX = *(int *)v->value; + adios_free_varinfo (v); + printf ("rank %d: NX = %d\n", rank, NX); + + printf ("Get info on variable record: %s\n", "record"); + varinfo = adios_inq_var (f, "record"); // need this struct to the end of reading + if (varinfo == NULL) { + printf ("rank %d: ERROR: Variable %s inquiry failed: %s\n", + rank, "record", adios_errmsg()); + return 1; + } + printf ("rank %d: record dims = %llu * %llu \n", rank, varinfo->dims[0], varinfo->dims[1]); + printf ("rank %d: total nblocks = %d in %d steps\n", + rank, varinfo->sum_nblocks, varinfo->nsteps); + + return retval; +} + +int read_records() +{ + int retval = 0; + int i,j; + + int N = varinfo->sum_nblocks/numproc; + int startidx=N*rank; + + char *text; + text = malloc (Width*NX+1); + text[Width*NX] = 0; + + for (i=0; i +#include +#include +#include +#include +#include +#include +#include +#include "adios_read.h" +#include "adios_error.h" + +static const int max_read_buffer_size = 1024*1024*1024; +static const int max_write_buffer_size = 1024*1024*1024; + +static int timeout_sec = 30; // will stop if no data found for this time (-1: never stop) +enum ADIOS_READ_METHOD read_method = ADIOS_READ_METHOD_BP; + + +// Global variables +int rank, numproc; +MPI_Comm comm; +ADIOS_FILE *f; // stream for reading +int64_t fh; // ADIOS output file handle +int64_t gh; // ADIOS group for output definitions +uint64_t write_total; // data size written by one processor +uint64_t largest_block; // the largest variable block one process reads +char ** group_namelist; // name of ADIOS group +char *readbuf; // read buffer +int decomp_values[10]; + + +int process_metadata(); +int read_records(); + + +int main (int argc, char ** argv) +{ + int err; + int steps = 0, curr_step; + int retval = 0; + + MPI_Init (&argc, &argv); + comm = MPI_COMM_WORLD; + MPI_Comm_rank (comm, &rank); + MPI_Comm_size (comm, &numproc); + + + char infilename[] = "steps.bp"; + + err = adios_read_init_method(read_method, comm, + "max_chunk_size=100; " + "app_id =32767; \n" + "verbose= 3;" + "poll_interval = 100;" + ); + + if (!err) { + printf ("%s\n", adios_errmsg()); + } + + + printf ("Waiting to open stream %s...\n", infilename); + f = adios_read_open_stream (infilename, read_method, comm, + ADIOS_LOCKMODE_ALL, timeout_sec); + if (adios_errno == err_file_not_found) + { + printf ("rank %d: Stream not found after waiting %d seconds: %s\n", + rank, timeout_sec, adios_errmsg()); + retval = adios_errno; + } + else if (adios_errno == err_end_of_stream) + { + printf ("rank %d: Stream terminated before open. %s\n", rank, adios_errmsg()); + retval = adios_errno; + } + else if (f == NULL) { + printf ("rank %d: Error at opening stream: %s\n", rank, adios_errmsg()); + retval = adios_errno; + } + else + { + // read data here... + while(1) { + steps++; // start counting from 1 + + /* + printf ("File info:\n"); + printf (" current step: %d\n", f->current_step); + printf (" last step: %d\n", f->last_step); + printf (" # of variables: %d:\n", f->nvars); + */ + + if (steps==1) + retval = process_metadata(); + + retval = read_records(); + + // advance to 1) next available step with 2) blocking wait + curr_step = f->current_step; // save for final bye print + adios_advance_step (f, 0, 0.0); + + if (adios_errno == err_end_of_stream) + { + break; // quit while loop + } + else if (adios_errno == err_step_notready) + { + printf ("rank %d: No new step arrived within the timeout. Quit. %s\n", + rank, adios_errmsg()); + break; // quit while loop + } + else if (f->current_step != curr_step+1) + { + // we missed some steps + printf ("rank %d: WARNING: steps %d..%d were missed when advancing.\n", + rank, curr_step+1, f->current_step-1); + } + + + } + adios_read_close (f); + } + + adios_read_finalize_method (read_method); + MPI_Finalize (); + + return retval; +} + + +typedef struct { + ADIOS_VARINFO * v; + uint64_t start[10]; + uint64_t count[10]; + uint64_t writesize; // size of subset this process writes, 0: do not write +} VarInfo; + +VarInfo * varinfo; + +int NX, Width, nblocks; + +int process_metadata() +{ + int retval = 0; + int i, j; + char gdims[256], ldims[256], offs[256]; + uint64_t sum_count; + ADIOS_VARINFO *v; // shortcut pointer + + /* First step processing */ + + printf ("Get info on variable Width\n"); + v = adios_inq_var (f, "Width"); + if (v == NULL) { + printf ("rank %d: ERROR: Variable %s inquiry failed: %s\n", + rank, "Width", adios_errmsg()); + return 1; + } + Width = *(int *)v->value; + adios_free_varinfo (v); + printf ("rank %d: Width = %d\n", rank, Width); + + printf ("Get info on variable NX\n"); + v = adios_inq_var (f, "NX"); + if (v == NULL) { + printf ("rank %d: ERROR: Variable %s inquiry failed: %s\n", + rank, "NX", adios_errmsg()); + return 1; + } + NX = *(int *)v->value; + adios_free_varinfo (v); + printf ("rank %d: NX = %d\n", rank, NX); + + printf ("Get info on variable record\n"); + v = adios_inq_var (f, "record"); + if (v == NULL) { + printf ("rank %d: ERROR: Variable %s inquiry failed: %s\n", + rank, "record", adios_errmsg()); + return 1; + } + nblocks = v->nblocks[0]; + printf ("rank %d: record dims = %llu * %llu \n", rank, v->dims[0], v->dims[1]); + adios_free_varinfo (v); + printf ("rank %d: nblocks = %d\n", rank, nblocks); + + return retval; +} + +int read_records() +{ + int retval = 0; + int i,j; + + int N = nblocks/numproc; + int startidx=N*rank; + + char *text; + text = malloc (Width*NX+1); + text[Width*NX] = 0; + + for (i=0; i +#include +#include "adios.h" +#include "adios_types.h" + +#ifdef DMALLOC +#include "dmalloc.h" +#endif + +int main (int argc, char ** argv) +{ + char filename [256]; + int rank, size, i, j, step, block; + int Offset; + + int NX = 2; // number of records written per step per process + int Width=20; + int sub_blocks = 2; // number of record-blocks written per process in one step + int steps = 3; + + char t[NX][Width]; + MPI_Comm comm = MPI_COMM_WORLD; + + /* ADIOS variables declarations for matching gwrite_temperature.ch */ + int adios_err; + uint64_t adios_groupsize, adios_totalsize; + int64_t adios_handle; + + MPI_Init (&argc, &argv); + MPI_Comm_rank (comm, &rank); + MPI_Comm_size (comm, &size); + + //Global_bounds = sub_blocks * NX * size; + + strcpy (filename, "steps.bp"); + + adios_init_noxml (comm); + adios_allocate_buffer (ADIOS_BUFFER_ALLOC_NOW, 1); + + int64_t m_adios_group; + int64_t m_adios_file; + + adios_declare_group (&m_adios_group, "steps", "", adios_flag_yes); + adios_select_method (m_adios_group, "MPI", "", ""); + + + adios_define_var (m_adios_group, "NX" ,"", adios_integer ,0, 0, 0); + adios_define_var (m_adios_group, "Width" ,"", adios_integer ,0, 0, 0); + adios_define_var (m_adios_group, "nproc" ,"", adios_integer ,0, 0, 0); + + for (i=0;i + + + + + + + + + + + diff --git a/tests/libs/adios/tests/suite/programs/transforms_specparse.c b/tests/libs/adios/tests/suite/programs/transforms_specparse.c new file mode 100644 index 0000000000..62728d4004 --- /dev/null +++ b/tests/libs/adios/tests/suite/programs/transforms_specparse.c @@ -0,0 +1,163 @@ +/* + * transforms_specparse.c + * + * Tests the "specparse" functionality, which parses the string passed as transform="..." into + * the transform ID and a list of key-value pairs. + * + * Created on: Jul 25, 2013 + * Author: David A. Boyuka II + */ + +#include +#include +#include +#include +#include "core/transforms/adios_transforms_specparse.h" + +#define DISABLE_SPECPARSE_TESTS + +#ifdef DISABLE_SPECPARSE_TESTS + +int main(int argc, char **argv) { return 0; } + +#else + +struct specparse_test { + const char *specstr; + struct adios_transform_spec expected; +} TESTS[] = { + { .specstr = "identity:a=123,b,c=321,,,f=12321", + .expected = { + .transform_type = adios_transform_identity, + .transform_type_str = "identity", + .param_count = 6, + .params = (struct adios_transform_spec_kv_pair *) { + (struct adios_transform_spec_kv_pair){ .key = "a", .value = "123" }, + (struct adios_transform_spec_kv_pair){ .key = "b", .value = NULL }, + (struct adios_transform_spec_kv_pair){ .key = "c", .value = "321" }, + (struct adios_transform_spec_kv_pair){ .key = "", .value = NULL }, + (struct adios_transform_spec_kv_pair){ .key = "", .value = NULL }, + (struct adios_transform_spec_kv_pair){ .key = "f", .value = "12321"}, + } + } + }, + { .specstr = "identity", + .expected = { + .transform_type = adios_transform_identity, + .transform_type_str = "identity", + .param_count = 0, + .params = NULL + } + }, + { .specstr = "none:a=123,b,c=321,,,f=12321", + .expected = { + .transform_type = adios_transform_none, + .transform_type_str = "none", + .param_count = 0, + .params = NULL + } + }, + { .specstr = "***impossible-transform-name***:a=123,b,c=321,,,f=12321", + .expected = { + .transform_type = adios_transform_unknown, + .transform_type_str = "***impossible-transform-name***", + .param_count = 0, + .params = NULL + } + }, +}; + + +const int NUM_TESTS = sizeof(TESTS)/sizeof(TESTS[0]); + +void run_test(struct specparse_test *test) { + const struct adios_transform_spec *actual = adios_transform_parse_spec(test->specstr, NULL); + const struct adios_transform_spec *expected = &test->expected; + + // Check transform type ID + assert(actual->transform_type == expected->transform_type); + + // Check transform type string + assert(actual->transform_type_str && expected->transform_type_str); + assert(strcmp(actual->transform_type_str, expected->transform_type_str) == 0); + + // Check parameter count, and ensure parameter list exists for both or neither + assert(actual->param_count == expected->param_count); + assert((actual->params != NULL) == (expected->params != NULL)); + + // If there is a parameter list, check it + if (expected->params) { + int i; + for (i = 0; i < expected->param_count; i++) { + const struct adios_transform_spec_kv_pair *actual_p = &actual->params[i]; + const struct adios_transform_spec_kv_pair *expected_p = &expected->params[i]; + + // Check that the keys are non-NULL and match + assert(actual_p->key && expected_p->key); + assert(strcmp(actual_p->key, expected_p->key) == 0); + + // Check that values are either both or neither present, and if the former, that they match + assert((actual_p->value != NULL) == (expected_p->value != NULL)); + if (expected_p->value != NULL) + assert(strcmp(actual_p->value, expected_p->value) == 0); + } + } + + adios_transform_free_spec(&actual); +} + +void init_tests() { + TESTS[0].specstr = strdup ("identity:a=123,b,c=321,,,f=12321"); + TESTS[0].expected.transform_type = adios_transform_identity; + TESTS[0].expected.transform_type_str = "identity"; + TESTS[0].expected.param_count = 6; + TESTS[0].expected.params = (struct adios_transform_spec_kv_pair *) + malloc (sizeof (struct adios_transform_spec_kv_pair) * 6); + TESTS[0].expected.params[0].key = strdup ("a"); + TESTS[0].expected.params[0].value = strdup ("123"); + TESTS[0].expected.params[1].key = strdup ("b"); + TESTS[0].expected.params[1].value = NULL; + TESTS[0].expected.params[2].key = strdup ("c"); + TESTS[0].expected.params[2].value = strdup ("321"); + TESTS[0].expected.params[3].key = strdup (""); + TESTS[0].expected.params[3].value = NULL; + TESTS[0].expected.params[4].key = strdup (""); + TESTS[0].expected.params[4].value = NULL; + TESTS[0].expected.params[5].key = strdup ("f"); + TESTS[0].expected.params[5].value = strdup ("12321"); + + TESTS[1].specstr = strdup ("identity"); + TESTS[1].expected.transform_type = adios_transform_identity; + TESTS[1].expected.transform_type_str = "identity"; + TESTS[1].expected.param_count = 0; + TESTS[1].expected.params = NULL; + + TESTS[2].specstr = strdup ("none:a=123,b,c=321,,,f=12321"); + TESTS[2].expected.transform_type = adios_transform_none; + TESTS[2].expected.transform_type_str = "none"; + TESTS[2].expected.param_count = 0; + TESTS[2].expected.params = NULL; + + TESTS[3].specstr = strdup ("***impossible-transform-name***:a=123,b,c=321,,,f=12321"); + TESTS[3].expected.transform_type = adios_transform_unknown; + TESTS[3].expected.transform_type_str = "***impossible-transform-name***"; + TESTS[3].expected.param_count = 0; + TESTS[3].expected.params = NULL; +} + +void run_tests() { + int i; + for (i = 0; i < NUM_TESTS; i++) { + run_test(&TESTS[i]); + } +} + +int main(int argc, char **argv) { + + init_tests(); + run_tests(); + + return 0; +} + +#endif /* else of DISABLE_SPECPARSE_TESTS */ diff --git a/tests/libs/adios/tests/suite/programs/transforms_writeblock_read.c b/tests/libs/adios/tests/suite/programs/transforms_writeblock_read.c new file mode 100644 index 0000000000..204392f888 --- /dev/null +++ b/tests/libs/adios/tests/suite/programs/transforms_writeblock_read.c @@ -0,0 +1,129 @@ +/* + * transforms_writeblock_read.c + * + * Created on: Oct 15, 2014 + * Author: David A. Boyuka II + */ + +#include +#include +#include +#include + +#include + +#define SHIFT_N(n) { argc -= (n); argv += (n); } +#define SHIFT SHIFT_N(1) + +#define MPI_Assert(comm, check) { if (!(check)) { fprintf(stderr, "[rank %d/%d] Assertion '" #check "' failed\n", rank, size); MPI_Abort((comm), 1); abort(); } } + +static const MPI_Comm COMM = MPI_COMM_WORLD; +static int rank, size; + +static void test_file_mode_reads_on_var(ADIOS_FILE *fp, const char *bp_filename, const char *varname) { + int i; + + ADIOS_VARINFO *varinfo = adios_inq_var(fp, varname); + MPI_Assert(COMM, varinfo); + + if (varinfo->value != NULL) { + //if (rank == 0) fprintf(stderr, "(skipping scalar variable '%s')\n", varname); + adios_free_varinfo(varinfo); + return; + } + + fprintf(stderr, "[rank %d/%d] Starting file-mode writeblock reads on %s:/%s\n", rank, size, bp_filename, varname); + + adios_inq_var_blockinfo(fp, varinfo); + MPI_Assert(COMM, varinfo->blockinfo); + + const enum ADIOS_DATATYPES datatype = varinfo->type; + const int datatypesize = adios_get_type_size(datatype, NULL); + + int timestep, timestep_blockidx, blockidx = 0; + for (timestep = 0; timestep < varinfo->nsteps; ++timestep) { + for (timestep_blockidx = 0; timestep_blockidx < varinfo->nblocks[timestep]; ++timestep_blockidx, ++blockidx) { + if (blockidx % size != rank) continue; + + const ADIOS_VARBLOCK *vb = &varinfo->blockinfo[blockidx]; + + ADIOS_SELECTION *block_bb = adios_selection_boundingbox(varinfo->ndim, vb->start, vb->count); + ADIOS_SELECTION *block_wb = adios_selection_writeblock(timestep_blockidx); + ADIOS_SELECTION *block_abs_wb = adios_selection_writeblock(blockidx); + block_abs_wb->u.block.is_absolute_index = 1; + + uint64_t blocksize = datatypesize; + for (i = 0; i < varinfo->ndim; ++i) + blocksize *= vb->count[i]; + + void *buf_bb = malloc(blocksize); + void *buf_wb = malloc(blocksize); + void *buf_abs_wb = malloc(blocksize); + memset(buf_bb, 0, blocksize); + memset(buf_wb, 1, blocksize); + memset(buf_abs_wb, 2, blocksize); + MPI_Assert(COMM, buf_bb && buf_wb && buf_abs_wb); + + adios_schedule_read(fp, block_bb, varname, timestep, 1, buf_bb ); + adios_schedule_read(fp, block_wb, varname, timestep, 1, buf_wb ); + adios_schedule_read(fp, block_abs_wb, varname, timestep, 1, buf_abs_wb); + adios_perform_reads(fp, 1); + + fprintf(stderr, "[rank %d/%d] Checking file-mode blockidx %d BB vs. WB...\n", rank, size, blockidx); + MPI_Assert(COMM, memcmp(buf_bb, buf_wb, blocksize) == 0); + fprintf(stderr, "[rank %d/%d] Checking file-mode blockidx %d BB vs. abs-WB...\n", rank, size, blockidx); + MPI_Assert(COMM, memcmp(buf_bb, buf_abs_wb, blocksize) == 0); + + free(buf_bb); free(buf_wb); free(buf_abs_wb); + adios_selection_delete(block_bb); + adios_selection_delete(block_wb); + adios_selection_delete(block_abs_wb); + } + } + + adios_free_varinfo(varinfo); + + fprintf(stderr, "[rank %d/%d] Finished file-mode writeblock reads on %s:/%s\n", rank, size, bp_filename, varname); +} + +static void test_file_mode_reads(const char *bp_filename) { + int i; + ADIOS_FILE *fp = adios_read_open_file(bp_filename, ADIOS_READ_METHOD_BP, COMM); + MPI_Assert(COMM, fp); + + fprintf(stderr, "[rank %d/%d] Starting file-mode writeblock reads on %s\n", rank, size, bp_filename); + + for (i = 0; i < fp->nvars; ++i) { + const char *varname = fp->var_namelist[i]; + test_file_mode_reads_on_var(fp, bp_filename, varname); + + MPI_Barrier(COMM); + } + + adios_read_close(fp); + + fprintf(stderr, "[rank %d/%d] Finished file-mode writeblock reads on %s\n", rank, size, bp_filename); +} + +int main(int argc, char **argv) { + MPI_Init(&argc, &argv); + + const char *cmd = *argv; SHIFT; + + if (argc != 1) { + if (rank == 0) fprintf(stderr, "Usage: %s \n", cmd); + MPI_Abort(COMM, 1); + } + + const char *bp_filename = *argv; SHIFT; + + MPI_Comm_rank(COMM, &rank); + MPI_Comm_size(COMM, &size); + adios_read_init_method(ADIOS_READ_METHOD_BP, COMM, ""); + + if (rank == 0) fprintf(stderr, "Starting file-mode writeblock tests on %s (%d ranks)...\n", bp_filename, size); + test_file_mode_reads(bp_filename); + + adios_read_finalize_method(ADIOS_READ_METHOD_BP); + MPI_Finalize(); +} diff --git a/tests/libs/adios/tests/suite/programs/two_groups.c b/tests/libs/adios/tests/suite/programs/two_groups.c new file mode 100644 index 0000000000..dd3e7e52ca --- /dev/null +++ b/tests/libs/adios/tests/suite/programs/two_groups.c @@ -0,0 +1,286 @@ +/* + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + */ + +/* ADIOS C test: + * Write two groups at alternative steps, different variables (a vs b) + * Then read them all and check if they are correct. + * + * How to run: mpirun -np write_alternate + * Output: write_alternate.bp + * + */ +#include +#include +#include +#include +#include "adios.h" +#include "adios_read.h" + +#ifdef DMALLOC +#include "dmalloc.h" +#endif + +#define log(...) fprintf (stderr, "[rank=%3.3d, line %d]: ", rank, __LINE__); fprintf (stderr, __VA_ARGS__); fflush(stderr); +#define printE(...) fprintf (stderr, "[rank=%3.3d, line %d]: ERROR: ", rank, __LINE__); fprintf (stderr, __VA_ARGS__); fflush(stderr); + +static const char FILENAME[] = "two_groups.bp"; +#define VALUE(rank, step) (rank * 100 + step) +#define VALUE0(step) (step) + +/* Variables to write */ +int a0; + +/* Variables to read */ +int ra, rb, rc; + +MPI_Comm comm = MPI_COMM_WORLD; +int rank; +int size; + +int write_group (int i); +int read_file (); +int read_by_group (); + +int main (int argc, char ** argv) +{ + int err,i ; + + MPI_Init (&argc, &argv); + MPI_Comm_rank (comm, &rank); + MPI_Comm_size (comm, &size); + + adios_init ("two_groups.xml", comm); + err = adios_read_init_method(ADIOS_READ_METHOD_BP, comm, "verbose=2"); + if (err) { + printE ("%s\n", adios_errmsg()); + } + + for (i=0; i<2; i++) { + if (!err) { + a0 = i; + err = write_group (i); + } + } + + if (!err) + err = read_file (); + + if (!err) + err = read_by_group (); + + adios_finalize (rank); + MPI_Finalize (); + return err; +} + + +int write_group (int step) +{ + int64_t fh; + uint64_t groupsize=0, totalsize; + + log ("Write group %d to %s\n", step, FILENAME); + adios_open (&fh, (step==1 ? "g2" : "g1"), FILENAME, (step==0 ? "w" : "a"), comm); + + groupsize = sizeof(int); // a scalar only + + adios_group_size (fh, groupsize, &totalsize); + if (step == 0) { + adios_write (fh, "a0", &a0); + } else if (step == 1) { + adios_write (fh, "b0", &a0); + } else { + adios_write (fh, "c0", &a0); + } + + adios_close (fh); + MPI_Barrier (comm); + return 0; +} + + +#define CHECK_VARINFO(VARNAME, NDIM, NSTEPS) \ + vi = adios_inq_var (f, VARNAME); \ + if (vi == NULL) { \ + printE ("No such variable " VARNAME "\n"); \ + err = 101; \ + goto endread; \ + } \ + if (vi->ndim != NDIM) { \ + printE ("Variable " VARNAME " has %d dimensions, but expected %d\n", vi->ndim, NDIM); \ + err = 102; \ + goto endread; \ + } \ + if (vi->nsteps != NSTEPS) { \ + printE ("Variable " VARNAME " has %d steps, but expected %d\n", vi->nsteps, NSTEPS); \ + err = 103; \ + /*goto endread; */\ + } \ + adios_free_varinfo (vi); + +#define CHECK_ATTR(ATTRNAME, VAL) \ + vi = adios_get_attr (f, ATTRNAME, atype, asize); \ + if (vi == NULL) { \ + printE ("No such variable " VARNAME "\n"); \ + err = 101; \ + goto endread; \ + } \ + if (vi->ndim != NDIM) { \ + printE ("Variable " VARNAME " has %d dimensions, but expected %d\n", vi->ndim, NDIM); \ + err = 102; \ + goto endread; \ + } \ + if (vi->nsteps != NSTEPS) { \ + printE ("Variable " VARNAME " has %d steps, but expected %d\n", vi->nsteps, NSTEPS); \ + err = 103; \ + /*goto endread; */\ + } \ + adios_free_varinfo (vi); + +#define CHECK_SCALAR(VARNAME, VAR, VALUE, STEP) \ + if (VAR != VALUE) { \ + printE (#VARNAME " step %d: wrote %d but read %d\n",STEP,VALUE,VAR);\ + err = 104; \ + /*goto endread;*/\ + } + +#define CHECK_ARRAY(VARNAME,A,N,VALUE,STEP,i) \ + for (i=0;i + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/libs/adios/tests/suite/programs/write_alternate.c b/tests/libs/adios/tests/suite/programs/write_alternate.c new file mode 100644 index 0000000000..92e55eabcb --- /dev/null +++ b/tests/libs/adios/tests/suite/programs/write_alternate.c @@ -0,0 +1,524 @@ +/* + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + */ + +/* ADIOS C test: + * Write a* and b* variables at alternative steps, while c* at every step. + * Then read them all and check if they are correct. + * + * How to run: mpirun -np write_alternate + * Output: write_alternate.bp + * + */ +#include +#include +#include +#include +#include "adios.h" +#include "adios_read.h" + +#ifdef DMALLOC +#include "dmalloc.h" +#endif + +#define log(...) fprintf (stderr, "[rank=%3.3d, line %d]: ", rank, __LINE__); fprintf (stderr, __VA_ARGS__); fflush(stderr); +#define printE(...) fprintf (stderr, "[rank=%3.3d, line %d]: ERROR: ", rank, __LINE__); fprintf (stderr, __VA_ARGS__); fflush(stderr); + +static const int NSTEPS = 5; +static const char FILENAME[] = "write_alternate.bp"; +#define VALUE(rank, step) (rank * 100 + step) +#define VALUE0(step) (step) + +/* Variables to write */ +int a0; +int *a1; +int *a2; +int *a3; + +/* Variables to read */ +int r0, rt0; +int *r1, *rt1, *r2, *r3; + +static const int ldim1 = 7; +static const int ldim2 = 5; +static const int ldim3 = 3; +int gdim1, gdim2, gdim3; +int offs1, offs2, offs3; + +MPI_Comm comm = MPI_COMM_WORLD; +int rank; +int size; + +void alloc_vars() +{ + int n; + + gdim1 = size*ldim1; + gdim2 = ldim2; + gdim3 = ldim3; + + offs1 = rank*ldim1; + offs2 = 0; + offs3 = 0; + + n = ldim1; + a1 = (int*) malloc (n * sizeof(int)); + r1 = (int*) malloc (n * sizeof(int)); + rt1 = (int*) malloc (n * sizeof(int)); + + n = ldim1 * ldim2; + a2 = (int*) malloc (n * sizeof(int)); + r2 = (int*) malloc (n * sizeof(int)); + + n = ldim1 * ldim2 * ldim3; + a3 = (int*) malloc (n * sizeof(int)); + r3 = (int*) malloc (n * sizeof(int)); +} + +void set_vars(int step) +{ + int n, i; + int v = VALUE(rank, step); + + a0 = v; + + n = ldim1; + for (i=0; indim != NDIM) { \ + printE ("Variable " VARNAME " has %d dimensions, but expected %d\n", vi->ndim, NDIM); \ + err = 102; \ + goto endread; \ + } \ + if (vi->nsteps != NSTEPS) { \ + printE ("Variable " VARNAME " has %d steps, but expected %d\n", vi->nsteps, NSTEPS); \ + err = 103; \ + /*goto endread; */\ + } \ + adios_free_varinfo (vi); + +#define CHECK_SCALAR(VARNAME, VAR, VALUE, STEP) \ + if (VAR != VALUE) { \ + printE (#VARNAME " step %d: wrote %d but read %d\n",STEP,VALUE,VAR);\ + err = 104; \ + /*goto endread;*/\ + } + +#define CHECK_ARRAY(VARNAME,A,N,VALUE,STEP,i) \ + for (i=0;i= 0) + n = f->current_step; + else + n++; //just to end the loop + } + +endread: + + adios_selection_delete (sel0); + adios_selection_delete (sel1); + adios_selection_delete (sel2); + adios_selection_delete (sel3); + + adios_read_close(f); + MPI_Barrier (comm); + return err; +} diff --git a/tests/libs/adios/tests/suite/programs/write_alternate.xml b/tests/libs/adios/tests/suite/programs/write_alternate.xml new file mode 100644 index 0000000000..f7a21f5fe0 --- /dev/null +++ b/tests/libs/adios/tests/suite/programs/write_alternate.xml @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/libs/adios/tests/suite/programs/write_read.c b/tests/libs/adios/tests/suite/programs/write_read.c new file mode 100644 index 0000000000..a2b04e902f --- /dev/null +++ b/tests/libs/adios/tests/suite/programs/write_read.c @@ -0,0 +1,851 @@ +/* + * ADIOS is freely available under the terms of the BSD license described + * in the COPYING file in the top level directory of this source distribution. + * + * Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved. + */ + +/* ADIOS C test: write then read adios files + * + * How to run: mpirun -np write_read + * Output: write_read.bp + * + */ +#include +#include +#include +#include +#include "adios.h" +#include "adios_read.h" + +#ifdef DMALLOC +#include "dmalloc.h" +#endif + +#define log(...) fprintf (stderr, "[rank=%3.3d, line %d]: ", rank, __LINE__); fprintf (stderr, __VA_ARGS__); fflush(stderr); +#define printE(...) fprintf (stderr, "[rank=%3.3d, line %d]: ERROR: ", rank, __LINE__); fprintf (stderr, __VA_ARGS__); fflush(stderr); + +typedef struct complex { + float r; + float i; +} complex; + +typedef struct double_complex { + double r; + double i; +} double_complex; + +/* Variables to write */ +int8_t scalar_byte = -100; +int16_t scalar_short = -10000; +int32_t scalar_int = -1000000000; +int64_t scalar_long = -1000000000000L; +uint8_t scalar_ubyte = 100; +uint16_t scalar_ushort = 10000; +uint32_t scalar_uint = 1000000000; +uint64_t scalar_ulong = 1000000000000L; +float scalar_float = 3.14159265358979323846; +double scalar_double = 2.7182818284590452353602874713526625L; +char * scalar_string = "ADIOS example string"; +complex scalar_complex; +double_complex scalar_double_complex; + +int8_t *a1_byte, *a2_byte, *a3_byte, *a6_byte; +int16_t *a1_short, *a2_short, *a3_short, *a6_short; +int32_t *a1_int, *a2_int, *a3_int, *a6_int; +int64_t *a1_long, *a2_long, *a3_long, *a6_long; +uint8_t *a1_ubyte, *a2_ubyte, *a3_ubyte, *a6_ubyte; +uint16_t *a1_ushort, *a2_ushort, *a3_ushort, *a6_ushort; +uint32_t *a1_uint, *a2_uint, *a3_uint, *a6_uint; +uint64_t *a1_ulong, *a2_ulong, *a3_ulong, *a6_ulong; +float *a1_float, *a2_float, *a3_float, *a6_float; +double *a1_double, *a2_double, *a3_double, *a6_double; +complex *a1_complex, *a2_complex, *a3_complex, *a6_complex; +double_complex *a1_double_complex, *a2_double_complex, *a3_double_complex, *a6_double_complex; + +/* Variables to read */ +int8_t *r1_byte, *r2_byte, *r3_byte, *r6_byte; +int16_t *r1_short, *r2_short, *r3_short, *r6_short; +int32_t *r1_int, *r2_int, *r3_int, *r6_int; +int64_t *r1_long, *r2_long, *r3_long, *r6_long; +uint8_t *r1_ubyte, *r2_ubyte, *r3_ubyte, *r6_ubyte; +uint16_t *r1_ushort, *r2_ushort, *r3_ushort, *r6_ushort; +uint32_t *r1_uint, *r2_uint, *r3_uint, *r6_uint; +uint64_t *r1_ulong, *r2_ulong, *r3_ulong, *r6_ulong; +float *r1_float, *r2_float, *r3_float, *r6_float; +double *r1_double, *r2_double, *r3_double, *r6_double; +complex *r1_complex, *r2_complex, *r3_complex, *r6_complex; +double_complex *r1_double_complex, *r2_double_complex, *r3_double_complex, *r6_double_complex; + +int ldim1 = 7; +int ldim2 = 5; +int ldim3 = 3; +int ldim4 = 2; +int ldim5 = 4; +int ldim6 = 9; +int gdim1, gdim2, gdim3, gdim4, gdim5, gdim6; +int offs1, offs2, offs3, offs4, offs5, offs6; + +MPI_Comm comm = MPI_COMM_WORLD; +int rank; +int size; + +void init_vars() +{ + int n, i; + int v = rank%256; + scalar_complex.r = 8.0; + scalar_complex.i = 9.0; + scalar_double_complex.r = 10.0; + scalar_double_complex.i = 11.0; + + gdim1 = size*ldim1; + gdim2 = ldim2; + gdim3 = ldim3; + gdim4 = ldim4; + gdim5 = ldim5; + gdim6 = ldim6; + + offs1 = rank*ldim1; + offs2 = 0; + offs3 = 0; + offs4 = 0; + offs5 = 0; + offs6 = 0; + + n = ldim1; + a1_byte = (int8_t*) malloc (n * sizeof(int8_t)); + a1_short = (int16_t*) malloc (n * sizeof(int16_t)); + a1_int = (int32_t*) malloc (n * sizeof(int32_t)); + a1_long = (int64_t*) malloc (n * sizeof(int64_t)); + a1_ubyte = (uint8_t*) malloc (n * sizeof(uint8_t)); + a1_ushort = (uint16_t*) malloc (n * sizeof(uint16_t)); + a1_uint = (uint32_t*) malloc (n * sizeof(uint32_t)); + a1_ulong = (uint64_t*) malloc (n * sizeof(uint64_t)); + a1_float = (float*) malloc (n * sizeof(float)); + a1_double = (double*) malloc (n * sizeof(double)); + a1_complex = (complex*) malloc (n * sizeof(complex)); + a1_double_complex = (double_complex*) malloc (n * sizeof(double_complex)); + + r1_byte = (int8_t*) malloc (n * sizeof(int8_t)); + r1_short = (int16_t*) malloc (n * sizeof(int16_t)); + r1_int = (int32_t*) malloc (n * sizeof(int32_t)); + r1_long = (int64_t*) malloc (n * sizeof(int64_t)); + r1_ubyte = (uint8_t*) malloc (n * sizeof(uint8_t)); + r1_ushort = (uint16_t*) malloc (n * sizeof(uint16_t)); + r1_uint = (uint32_t*) malloc (n * sizeof(uint32_t)); + r1_ulong = (uint64_t*) malloc (n * sizeof(uint64_t)); + r1_float = (float*) malloc (n * sizeof(float)); + r1_double = (double*) malloc (n * sizeof(double)); + r1_complex = (complex*) malloc (n * sizeof(complex)); + r1_double_complex = (double_complex*) malloc (n * sizeof(double_complex)); + + for (i=0; ivalue != VAR) { \ + printE ("Scalar %s as read from file != as written\n", VARNAME); \ + err = 102; \ + goto endread; \ + } \ + adios_free_varinfo (vi); + +#define CHECK_ARRAY(A,R) \ + for (i=0;ivalue)->r != scalar_complex.r || + ((complex*)vi->value)->i != scalar_complex.i) { + printE ("Scalar scalar_complex as read from file != as written\n"); + err = 102; + goto endread; + } + adios_free_varinfo (vi); + GET_SCALAR ("/scalars/scalar_double_complex") + if (((double_complex*)vi->value)->r != scalar_double_complex.r || + ((double_complex*)vi->value)->i != scalar_double_complex.i) { + printE ("Scalar scalar_double_complex as read from file != as written\n"); + err = 102; + goto endread; + } + adios_free_varinfo (vi); + GET_SCALAR ("/scalars/scalar_string") + if (strcmp((char*)vi->value, scalar_string)) { + printE ("Scalar scalar_string as read from file != as written: [%s] and [%s]\n", + (char*)vi->value, scalar_string); + err = 102; + goto endread; + } + adios_free_varinfo (vi); + + log (" 1D arrays... %s\n", fname); + n = ldim1; + sel = adios_selection_boundingbox (1, start, count); + adios_schedule_read (f, sel, "/1D/a1_byte", 0, 1, r1_byte); + adios_schedule_read (f, sel, "/1D/a1_short", 0, 1, r1_short); + adios_schedule_read (f, sel, "/1D/a1_int", 0, 1, r1_int); + adios_schedule_read (f, sel, "/1D/a1_long", 0, 1, r1_long); + adios_schedule_read (f, sel, "/1D/a1_ubyte", 0, 1, r1_ubyte); + adios_schedule_read (f, sel, "/1D/a1_ushort", 0, 1, r1_ushort); + adios_schedule_read (f, sel, "/1D/a1_uint", 0, 1, r1_uint); + adios_schedule_read (f, sel, "/1D/a1_ulong", 0, 1, r1_ulong); + adios_schedule_read (f, sel, "/1D/a1_float", 0, 1, r1_float); + adios_schedule_read (f, sel, "/1D/a1_double", 0, 1, r1_double); + adios_schedule_read (f, sel, "/1D/a1_complex", 0, 1, r1_complex); + adios_schedule_read (f, sel, "/1D/a1_double_complex", 0, 1, r1_double_complex); + adios_perform_reads (f, 1); + adios_selection_delete (sel); + + CHECK_ARRAY (a1_byte, r1_byte) + CHECK_ARRAY (a1_short, r1_short) + CHECK_ARRAY (a1_int, r1_int) + CHECK_ARRAY (a1_long, r1_long) + CHECK_ARRAY (a1_ubyte, r1_ubyte) + CHECK_ARRAY (a1_ushort, r1_ushort) + CHECK_ARRAY (a1_uint, r1_uint) + CHECK_ARRAY (a1_ulong, r1_ulong) + CHECK_ARRAY (a1_float, r1_float) + CHECK_ARRAY (a1_double, r1_double) + for (i=0;i + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/libs/adios/tests/suite/reference/amr_write_read_1.txt b/tests/libs/adios/tests/suite/reference/amr_write_read_1.txt new file mode 100644 index 0000000000..4bbd4bb37a --- /dev/null +++ b/tests/libs/adios/tests/suite/reference/amr_write_read_1.txt @@ -0,0 +1,8 @@ + 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 + 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 + 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 + 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 + 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 + 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 + 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 + 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 diff --git a/tests/libs/adios/tests/suite/reference/amr_write_read_2.txt b/tests/libs/adios/tests/suite/reference/amr_write_read_2.txt new file mode 100644 index 0000000000..d9b250e2ae --- /dev/null +++ b/tests/libs/adios/tests/suite/reference/amr_write_read_2.txt @@ -0,0 +1,32 @@ + 0 1 2 3 + 16 17 18 19 + 32 33 34 35 + 48 49 50 51 + 64 65 66 67 + 80 81 82 83 + 96 97 98 99 + 112 113 114 115 + 128 129 130 131 + 144 145 146 147 + 160 161 162 163 + 176 177 178 179 + 192 193 194 195 + 208 209 210 211 + 224 225 226 227 + 240 241 242 243 + 256 257 258 259 + 272 273 274 275 + 288 289 290 291 + 304 305 306 307 + 320 321 322 323 + 336 337 338 339 + 352 353 354 355 + 368 369 370 371 + 384 385 386 387 + 400 401 402 403 + 416 417 418 419 + 432 433 434 435 + 448 449 450 451 + 464 465 466 467 + 480 481 482 483 + 496 497 498 499 diff --git a/tests/libs/adios/tests/suite/reference/amr_write_read_2vars_1.txt b/tests/libs/adios/tests/suite/reference/amr_write_read_2vars_1.txt new file mode 100644 index 0000000000..654bdb37c4 --- /dev/null +++ b/tests/libs/adios/tests/suite/reference/amr_write_read_2vars_1.txt @@ -0,0 +1,16 @@ + 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 + 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 + 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 + 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 + 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 + 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 + 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 + 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 + 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 + 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 + 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 + 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 + 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 + 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 + 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 + 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 diff --git a/tests/libs/adios/tests/suite/reference/amr_write_read_2vars_2.txt b/tests/libs/adios/tests/suite/reference/amr_write_read_2vars_2.txt new file mode 100644 index 0000000000..90871521ae --- /dev/null +++ b/tests/libs/adios/tests/suite/reference/amr_write_read_2vars_2.txt @@ -0,0 +1,64 @@ + 0 1 2 3 + 16 17 18 19 + 32 33 34 35 + 48 49 50 51 + 64 65 66 67 + 80 81 82 83 + 96 97 98 99 + 112 113 114 115 + 128 129 130 131 + 144 145 146 147 + 160 161 162 163 + 176 177 178 179 + 192 193 194 195 + 208 209 210 211 + 224 225 226 227 + 240 241 242 243 + 256 257 258 259 + 272 273 274 275 + 288 289 290 291 + 304 305 306 307 + 320 321 322 323 + 336 337 338 339 + 352 353 354 355 + 368 369 370 371 + 384 385 386 387 + 400 401 402 403 + 416 417 418 419 + 432 433 434 435 + 448 449 450 451 + 464 465 466 467 + 480 481 482 483 + 496 497 498 499 + 1000 1001 1002 1003 + 1016 1017 1018 1019 + 1032 1033 1034 1035 + 1048 1049 1050 1051 + 1064 1065 1066 1067 + 1080 1081 1082 1083 + 1096 1097 1098 1099 + 1112 1113 1114 1115 + 1128 1129 1130 1131 + 1144 1145 1146 1147 + 1160 1161 1162 1163 + 1176 1177 1178 1179 + 1192 1193 1194 1195 + 1208 1209 1210 1211 + 1224 1225 1226 1227 + 1240 1241 1242 1243 + 1256 1257 1258 1259 + 1272 1273 1274 1275 + 1288 1289 1290 1291 + 1304 1305 1306 1307 + 1320 1321 1322 1323 + 1336 1337 1338 1339 + 1352 1353 1354 1355 + 1368 1369 1370 1371 + 1384 1385 1386 1387 + 1400 1401 1402 1403 + 1416 1417 1418 1419 + 1432 1433 1434 1435 + 1448 1449 1450 1451 + 1464 1465 1466 1467 + 1480 1481 1482 1483 + 1496 1497 1498 1499 diff --git a/tests/libs/adios/tests/suite/reference/amr_write_read_2vars_3.txt b/tests/libs/adios/tests/suite/reference/amr_write_read_2vars_3.txt new file mode 100644 index 0000000000..e8a0651fb5 --- /dev/null +++ b/tests/libs/adios/tests/suite/reference/amr_write_read_2vars_3.txt @@ -0,0 +1,8 @@ + 2 3 4 + 18 19 20 + 34 35 36 + 50 51 52 + 1002 1003 1004 + 1018 1019 1020 + 1034 1035 1036 + 1050 1051 1052 diff --git a/tests/libs/adios/tests/suite/reference/amr_write_read_2vars_4.txt b/tests/libs/adios/tests/suite/reference/amr_write_read_2vars_4.txt new file mode 100644 index 0000000000..907791273a --- /dev/null +++ b/tests/libs/adios/tests/suite/reference/amr_write_read_2vars_4.txt @@ -0,0 +1,64 @@ + 2 3 4 + 18 19 20 + 34 35 36 + 50 51 52 + 66 67 68 + 82 83 84 + 98 99 100 + 114 115 116 + 130 131 132 + 146 147 148 + 162 163 164 + 178 179 180 + 194 195 196 + 210 211 212 + 226 227 228 + 242 243 244 + 258 259 260 + 274 275 276 + 290 291 292 + 306 307 308 + 322 323 324 + 338 339 340 + 354 355 356 + 370 371 372 + 386 387 388 + 402 403 404 + 418 419 420 + 434 435 436 + 450 451 452 + 466 467 468 + 482 483 484 + 498 499 500 + 1002 1003 1004 + 1018 1019 1020 + 1034 1035 1036 + 1050 1051 1052 + 1066 1067 1068 + 1082 1083 1084 + 1098 1099 1100 + 1114 1115 1116 + 1130 1131 1132 + 1146 1147 1148 + 1162 1163 1164 + 1178 1179 1180 + 1194 1195 1196 + 1210 1211 1212 + 1226 1227 1228 + 1242 1243 1244 + 1258 1259 1260 + 1274 1275 1276 + 1290 1291 1292 + 1306 1307 1308 + 1322 1323 1324 + 1338 1339 1340 + 1354 1355 1356 + 1370 1371 1372 + 1386 1387 1388 + 1402 1403 1404 + 1418 1419 1420 + 1434 1435 1436 + 1450 1451 1452 + 1466 1467 1468 + 1482 1483 1484 + 1498 1499 1500 diff --git a/tests/libs/adios/tests/suite/reference/amr_write_read_2vars_5.txt b/tests/libs/adios/tests/suite/reference/amr_write_read_2vars_5.txt new file mode 100644 index 0000000000..5b190530be --- /dev/null +++ b/tests/libs/adios/tests/suite/reference/amr_write_read_2vars_5.txt @@ -0,0 +1,64 @@ + 5 6 7 + 21 22 23 + 37 38 39 + 53 54 55 + 69 70 71 + 85 86 87 + 101 102 103 + 117 118 119 + 133 134 135 + 149 150 151 + 165 166 167 + 181 182 183 + 197 198 199 + 213 214 215 + 229 230 231 + 245 246 247 + 261 262 263 + 277 278 279 + 293 294 295 + 309 310 311 + 325 326 327 + 341 342 343 + 357 358 359 + 373 374 375 + 389 390 391 + 405 406 407 + 421 422 423 + 437 438 439 + 453 454 455 + 469 470 471 + 485 486 487 + 501 502 503 + 1005 1006 1007 + 1021 1022 1023 + 1037 1038 1039 + 1053 1054 1055 + 1069 1070 1071 + 1085 1086 1087 + 1101 1102 1103 + 1117 1118 1119 + 1133 1134 1135 + 1149 1150 1151 + 1165 1166 1167 + 1181 1182 1183 + 1197 1198 1199 + 1213 1214 1215 + 1229 1230 1231 + 1245 1246 1247 + 1261 1262 1263 + 1277 1278 1279 + 1293 1294 1295 + 1309 1310 1311 + 1325 1326 1327 + 1341 1342 1343 + 1357 1358 1359 + 1373 1374 1375 + 1389 1390 1391 + 1405 1406 1407 + 1421 1422 1423 + 1437 1438 1439 + 1453 1454 1455 + 1469 1470 1471 + 1485 1486 1487 + 1501 1502 1503 diff --git a/tests/libs/adios/tests/suite/reference/amr_write_read_3.txt b/tests/libs/adios/tests/suite/reference/amr_write_read_3.txt new file mode 100644 index 0000000000..0144baf4f2 --- /dev/null +++ b/tests/libs/adios/tests/suite/reference/amr_write_read_3.txt @@ -0,0 +1,4 @@ + 2 3 4 + 18 19 20 + 34 35 36 + 50 51 52 diff --git a/tests/libs/adios/tests/suite/reference/amr_write_read_4.txt b/tests/libs/adios/tests/suite/reference/amr_write_read_4.txt new file mode 100644 index 0000000000..5bb3657b5c --- /dev/null +++ b/tests/libs/adios/tests/suite/reference/amr_write_read_4.txt @@ -0,0 +1,32 @@ + 2 3 4 + 18 19 20 + 34 35 36 + 50 51 52 + 66 67 68 + 82 83 84 + 98 99 100 + 114 115 116 + 130 131 132 + 146 147 148 + 162 163 164 + 178 179 180 + 194 195 196 + 210 211 212 + 226 227 228 + 242 243 244 + 258 259 260 + 274 275 276 + 290 291 292 + 306 307 308 + 322 323 324 + 338 339 340 + 354 355 356 + 370 371 372 + 386 387 388 + 402 403 404 + 418 419 420 + 434 435 436 + 450 451 452 + 466 467 468 + 482 483 484 + 498 499 500 diff --git a/tests/libs/adios/tests/suite/reference/amr_write_read_5.txt b/tests/libs/adios/tests/suite/reference/amr_write_read_5.txt new file mode 100644 index 0000000000..e4641f2b8b --- /dev/null +++ b/tests/libs/adios/tests/suite/reference/amr_write_read_5.txt @@ -0,0 +1,32 @@ + 5 6 7 + 21 22 23 + 37 38 39 + 53 54 55 + 69 70 71 + 85 86 87 + 101 102 103 + 117 118 119 + 133 134 135 + 149 150 151 + 165 166 167 + 181 182 183 + 197 198 199 + 213 214 215 + 229 230 231 + 245 246 247 + 261 262 263 + 277 278 279 + 293 294 295 + 309 310 311 + 325 326 327 + 341 342 343 + 357 358 359 + 373 374 375 + 389 390 391 + 405 406 407 + 421 422 423 + 437 438 439 + 453 454 455 + 469 470 471 + 485 486 487 + 501 502 503 diff --git a/tests/libs/adios/tests/suite/reference/arrays_bpls.txt b/tests/libs/adios/tests/suite/reference/arrays_bpls.txt new file mode 100644 index 0000000000..60c2d376e8 --- /dev/null +++ b/tests/libs/adios/tests/suite/reference/arrays_bpls.txt @@ -0,0 +1,13 @@ +File info: + of groups: 1 + of variables: 4 + of attributes: 0 + of meshes: 0 + time steps: 0 - 0 + bp version: 2 + statistics: Min / Max / Avg / Std_dev + + integer NX scalar = 10 + integer NY scalar = 100 + double var_double_2Darray {10, 100} = 0 / 49.99 / 24.995 / 14.4338 + integer var_int_1Darray {10} = 0 / 49 / 24.5 / 14.4309 diff --git a/tests/libs/adios/tests/suite/reference/arrays_read.txt b/tests/libs/adios/tests/suite/reference/arrays_read.txt new file mode 100644 index 0000000000..9c51b8b557 --- /dev/null +++ b/tests/libs/adios/tests/suite/reference/arrays_read.txt @@ -0,0 +1,15 @@ +rank=0: NX=10 NY=100 +rank=0: p = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] +rank=0: t[5,*] = [ 5.00, 5.01, 5.02, 5.03, 5.04, 5.05, 5.06, 5.07, 5.08, 5.09, 5.10, 5.11, 5.12, 5.13, 5.14, 5.15, 5.16, 5.17, 5.18, 5.19, 5.20, 5.21, 5.22, 5.23, 5.24, 5.25, 5.26, 5.27, 5.28, 5.29, 5.30, 5.31, 5.32, 5.33, 5.34, 5.35, 5.36, 5.37, 5.38, 5.39, 5.40, 5.41, 5.42, 5.43, 5.44, 5.45, 5.46, 5.47, 5.48, 5.49, 5.50, 5.51, 5.52, 5.53, 5.54, 5.55, 5.56, 5.57, 5.58, 5.59, 5.60, 5.61, 5.62, 5.63, 5.64, 5.65, 5.66, 5.67, 5.68, 5.69, 5.70, 5.71, 5.72, 5.73, 5.74, 5.75, 5.76, 5.77, 5.78, 5.79, 5.80, 5.81, 5.82, 5.83, 5.84, 5.85, 5.86, 5.87, 5.88, 5.89, 5.90, 5.91, 5.92, 5.93, 5.94, 5.95, 5.96, 5.97, 5.98, 5.99] +rank=1: NX=10 NY=100 +rank=1: p = [10, 11, 12, 13, 14, 15, 16, 17, 18, 19] +rank=1: t[5,*] = [ 15.00, 15.01, 15.02, 15.03, 15.04, 15.05, 15.06, 15.07, 15.08, 15.09, 15.10, 15.11, 15.12, 15.13, 15.14, 15.15, 15.16, 15.17, 15.18, 15.19, 15.20, 15.21, 15.22, 15.23, 15.24, 15.25, 15.26, 15.27, 15.28, 15.29, 15.30, 15.31, 15.32, 15.33, 15.34, 15.35, 15.36, 15.37, 15.38, 15.39, 15.40, 15.41, 15.42, 15.43, 15.44, 15.45, 15.46, 15.47, 15.48, 15.49, 15.50, 15.51, 15.52, 15.53, 15.54, 15.55, 15.56, 15.57, 15.58, 15.59, 15.60, 15.61, 15.62, 15.63, 15.64, 15.65, 15.66, 15.67, 15.68, 15.69, 15.70, 15.71, 15.72, 15.73, 15.74, 15.75, 15.76, 15.77, 15.78, 15.79, 15.80, 15.81, 15.82, 15.83, 15.84, 15.85, 15.86, 15.87, 15.88, 15.89, 15.90, 15.91, 15.92, 15.93, 15.94, 15.95, 15.96, 15.97, 15.98, 15.99] +rank=2: NX=10 NY=100 +rank=2: p = [20, 21, 22, 23, 24, 25, 26, 27, 28, 29] +rank=2: t[5,*] = [ 25.00, 25.01, 25.02, 25.03, 25.04, 25.05, 25.06, 25.07, 25.08, 25.09, 25.10, 25.11, 25.12, 25.13, 25.14, 25.15, 25.16, 25.17, 25.18, 25.19, 25.20, 25.21, 25.22, 25.23, 25.24, 25.25, 25.26, 25.27, 25.28, 25.29, 25.30, 25.31, 25.32, 25.33, 25.34, 25.35, 25.36, 25.37, 25.38, 25.39, 25.40, 25.41, 25.42, 25.43, 25.44, 25.45, 25.46, 25.47, 25.48, 25.49, 25.50, 25.51, 25.52, 25.53, 25.54, 25.55, 25.56, 25.57, 25.58, 25.59, 25.60, 25.61, 25.62, 25.63, 25.64, 25.65, 25.66, 25.67, 25.68, 25.69, 25.70, 25.71, 25.72, 25.73, 25.74, 25.75, 25.76, 25.77, 25.78, 25.79, 25.80, 25.81, 25.82, 25.83, 25.84, 25.85, 25.86, 25.87, 25.88, 25.89, 25.90, 25.91, 25.92, 25.93, 25.94, 25.95, 25.96, 25.97, 25.98, 25.99] +rank=3: NX=10 NY=100 +rank=3: p = [30, 31, 32, 33, 34, 35, 36, 37, 38, 39] +rank=3: t[5,*] = [ 35.00, 35.01, 35.02, 35.03, 35.04, 35.05, 35.06, 35.07, 35.08, 35.09, 35.10, 35.11, 35.12, 35.13, 35.14, 35.15, 35.16, 35.17, 35.18, 35.19, 35.20, 35.21, 35.22, 35.23, 35.24, 35.25, 35.26, 35.27, 35.28, 35.29, 35.30, 35.31, 35.32, 35.33, 35.34, 35.35, 35.36, 35.37, 35.38, 35.39, 35.40, 35.41, 35.42, 35.43, 35.44, 35.45, 35.46, 35.47, 35.48, 35.49, 35.50, 35.51, 35.52, 35.53, 35.54, 35.55, 35.56, 35.57, 35.58, 35.59, 35.60, 35.61, 35.62, 35.63, 35.64, 35.65, 35.66, 35.67, 35.68, 35.69, 35.70, 35.71, 35.72, 35.73, 35.74, 35.75, 35.76, 35.77, 35.78, 35.79, 35.80, 35.81, 35.82, 35.83, 35.84, 35.85, 35.86, 35.87, 35.88, 35.89, 35.90, 35.91, 35.92, 35.93, 35.94, 35.95, 35.96, 35.97, 35.98, 35.99] +rank=4: NX=10 NY=100 +rank=4: p = [40, 41, 42, 43, 44, 45, 46, 47, 48, 49] +rank=4: t[5,*] = [ 45.00, 45.01, 45.02, 45.03, 45.04, 45.05, 45.06, 45.07, 45.08, 45.09, 45.10, 45.11, 45.12, 45.13, 45.14, 45.15, 45.16, 45.17, 45.18, 45.19, 45.20, 45.21, 45.22, 45.23, 45.24, 45.25, 45.26, 45.27, 45.28, 45.29, 45.30, 45.31, 45.32, 45.33, 45.34, 45.35, 45.36, 45.37, 45.38, 45.39, 45.40, 45.41, 45.42, 45.43, 45.44, 45.45, 45.46, 45.47, 45.48, 45.49, 45.50, 45.51, 45.52, 45.53, 45.54, 45.55, 45.56, 45.57, 45.58, 45.59, 45.60, 45.61, 45.62, 45.63, 45.64, 45.65, 45.66, 45.67, 45.68, 45.69, 45.70, 45.71, 45.72, 45.73, 45.74, 45.75, 45.76, 45.77, 45.78, 45.79, 45.80, 45.81, 45.82, 45.83, 45.84, 45.85, 45.86, 45.87, 45.88, 45.89, 45.90, 45.91, 45.92, 45.93, 45.94, 45.95, 45.96, 45.97, 45.98, 45.99] diff --git a/tests/libs/adios/tests/suite/reference/attributes_bpls.txt b/tests/libs/adios/tests/suite/reference/attributes_bpls.txt new file mode 100644 index 0000000000..6a59906e5f --- /dev/null +++ b/tests/libs/adios/tests/suite/reference/attributes_bpls.txt @@ -0,0 +1,19 @@ +File info: + of groups: 1 + of variables: 6 + of attributes: 4 + of meshes: 0 + time steps: 0 - 0 + bp version: 2 + statistics: Min / Max / Avg / Std_dev + + integer NX scalar = 10 + integer size scalar = 5 + integer rank scalar = 0 + double mean scalar = 4.5 + string date scalar = "Nov, 2009" + double temperature {5, 10} = 0 / 49 / 24.5 / 14.4309 + integer temperature/number of levels attr = 1 + string temperature/description attr = "Global array written from 'size' processes" + double temperature/mean value attr = 4.5 + string temperature/date of coding attr = "Nov, 2009" diff --git a/tests/libs/adios/tests/suite/reference/attributes_read.txt b/tests/libs/adios/tests/suite/reference/attributes_read.txt new file mode 100644 index 0000000000..e9a270c799 --- /dev/null +++ b/tests/libs/adios/tests/suite/reference/attributes_read.txt @@ -0,0 +1,8 @@ +rank 0: attr: double temperature/mean value = 4.500000e+00 +rank 0: attr: integer temperature/number of levels = 1 +rank 0: attr: string temperature/date of coding = Nov, 2009 +rank 0: attr: string temperature/description = Global array written from 'size' processes +rank 1: attr: double temperature/mean value = 4.500000e+00 +rank 1: attr: integer temperature/number of levels = 1 +rank 1: attr: string temperature/date of coding = Nov, 2009 +rank 1: attr: string temperature/description = Global array written from 'size' processes diff --git a/tests/libs/adios/tests/suite/reference/global_array_bpls.txt b/tests/libs/adios/tests/suite/reference/global_array_bpls.txt new file mode 100644 index 0000000000..a5ba4fcc01 --- /dev/null +++ b/tests/libs/adios/tests/suite/reference/global_array_bpls.txt @@ -0,0 +1,13 @@ + integer NX scalar = 10 + integer size scalar = 7 + integer rank scalar = 0 + double temperature {7, 10} = 0 / 69 / 34.5 / 20.2052 + (0,0) 0 1 2 3 4 5 6 7 8 9 + (1,0) 10 11 12 13 14 15 16 17 18 19 + (2,0) 20 21 22 23 24 25 26 27 28 29 + (3,0) 30 31 32 33 34 35 36 37 38 39 + (4,0) 40 41 42 43 44 45 46 47 48 49 + (5,0) 50 51 52 53 54 55 56 57 58 59 + (6,0) 60 61 62 63 64 65 66 67 68 69 + + string temperature/description attr = "Global array written from 'size' processes" diff --git a/tests/libs/adios/tests/suite/reference/global_array_no_xml_bpls.txt b/tests/libs/adios/tests/suite/reference/global_array_no_xml_bpls.txt new file mode 100644 index 0000000000..8b4669f982 --- /dev/null +++ b/tests/libs/adios/tests/suite/reference/global_array_no_xml_bpls.txt @@ -0,0 +1,224 @@ +File info: + of groups: 1 + of variables: 4 + of attributes: 0 + of meshes: 0 + time steps: 0 - 0 + bp version: 2 + statistics: Min / Max / Avg / Std_dev + + integer NX scalar = 100 + integer Global_bounds scalar = 2100 + integer Offsets scalar = 0 + double temperature {2100} = 0 / 2099 / 1049.5 / 606.218 + ( 0) 0 1 2 3 4 5 6 7 8 9 + ( 10) 10 11 12 13 14 15 16 17 18 19 + ( 20) 20 21 22 23 24 25 26 27 28 29 + ( 30) 30 31 32 33 34 35 36 37 38 39 + ( 40) 40 41 42 43 44 45 46 47 48 49 + ( 50) 50 51 52 53 54 55 56 57 58 59 + ( 60) 60 61 62 63 64 65 66 67 68 69 + ( 70) 70 71 72 73 74 75 76 77 78 79 + ( 80) 80 81 82 83 84 85 86 87 88 89 + ( 90) 90 91 92 93 94 95 96 97 98 99 + ( 100) 100 101 102 103 104 105 106 107 108 109 + ( 110) 110 111 112 113 114 115 116 117 118 119 + ( 120) 120 121 122 123 124 125 126 127 128 129 + ( 130) 130 131 132 133 134 135 136 137 138 139 + ( 140) 140 141 142 143 144 145 146 147 148 149 + ( 150) 150 151 152 153 154 155 156 157 158 159 + ( 160) 160 161 162 163 164 165 166 167 168 169 + ( 170) 170 171 172 173 174 175 176 177 178 179 + ( 180) 180 181 182 183 184 185 186 187 188 189 + ( 190) 190 191 192 193 194 195 196 197 198 199 + ( 200) 200 201 202 203 204 205 206 207 208 209 + ( 210) 210 211 212 213 214 215 216 217 218 219 + ( 220) 220 221 222 223 224 225 226 227 228 229 + ( 230) 230 231 232 233 234 235 236 237 238 239 + ( 240) 240 241 242 243 244 245 246 247 248 249 + ( 250) 250 251 252 253 254 255 256 257 258 259 + ( 260) 260 261 262 263 264 265 266 267 268 269 + ( 270) 270 271 272 273 274 275 276 277 278 279 + ( 280) 280 281 282 283 284 285 286 287 288 289 + ( 290) 290 291 292 293 294 295 296 297 298 299 + ( 300) 300 301 302 303 304 305 306 307 308 309 + ( 310) 310 311 312 313 314 315 316 317 318 319 + ( 320) 320 321 322 323 324 325 326 327 328 329 + ( 330) 330 331 332 333 334 335 336 337 338 339 + ( 340) 340 341 342 343 344 345 346 347 348 349 + ( 350) 350 351 352 353 354 355 356 357 358 359 + ( 360) 360 361 362 363 364 365 366 367 368 369 + ( 370) 370 371 372 373 374 375 376 377 378 379 + ( 380) 380 381 382 383 384 385 386 387 388 389 + ( 390) 390 391 392 393 394 395 396 397 398 399 + ( 400) 400 401 402 403 404 405 406 407 408 409 + ( 410) 410 411 412 413 414 415 416 417 418 419 + ( 420) 420 421 422 423 424 425 426 427 428 429 + ( 430) 430 431 432 433 434 435 436 437 438 439 + ( 440) 440 441 442 443 444 445 446 447 448 449 + ( 450) 450 451 452 453 454 455 456 457 458 459 + ( 460) 460 461 462 463 464 465 466 467 468 469 + ( 470) 470 471 472 473 474 475 476 477 478 479 + ( 480) 480 481 482 483 484 485 486 487 488 489 + ( 490) 490 491 492 493 494 495 496 497 498 499 + ( 500) 500 501 502 503 504 505 506 507 508 509 + ( 510) 510 511 512 513 514 515 516 517 518 519 + ( 520) 520 521 522 523 524 525 526 527 528 529 + ( 530) 530 531 532 533 534 535 536 537 538 539 + ( 540) 540 541 542 543 544 545 546 547 548 549 + ( 550) 550 551 552 553 554 555 556 557 558 559 + ( 560) 560 561 562 563 564 565 566 567 568 569 + ( 570) 570 571 572 573 574 575 576 577 578 579 + ( 580) 580 581 582 583 584 585 586 587 588 589 + ( 590) 590 591 592 593 594 595 596 597 598 599 + ( 600) 600 601 602 603 604 605 606 607 608 609 + ( 610) 610 611 612 613 614 615 616 617 618 619 + ( 620) 620 621 622 623 624 625 626 627 628 629 + ( 630) 630 631 632 633 634 635 636 637 638 639 + ( 640) 640 641 642 643 644 645 646 647 648 649 + ( 650) 650 651 652 653 654 655 656 657 658 659 + ( 660) 660 661 662 663 664 665 666 667 668 669 + ( 670) 670 671 672 673 674 675 676 677 678 679 + ( 680) 680 681 682 683 684 685 686 687 688 689 + ( 690) 690 691 692 693 694 695 696 697 698 699 + ( 700) 700 701 702 703 704 705 706 707 708 709 + ( 710) 710 711 712 713 714 715 716 717 718 719 + ( 720) 720 721 722 723 724 725 726 727 728 729 + ( 730) 730 731 732 733 734 735 736 737 738 739 + ( 740) 740 741 742 743 744 745 746 747 748 749 + ( 750) 750 751 752 753 754 755 756 757 758 759 + ( 760) 760 761 762 763 764 765 766 767 768 769 + ( 770) 770 771 772 773 774 775 776 777 778 779 + ( 780) 780 781 782 783 784 785 786 787 788 789 + ( 790) 790 791 792 793 794 795 796 797 798 799 + ( 800) 800 801 802 803 804 805 806 807 808 809 + ( 810) 810 811 812 813 814 815 816 817 818 819 + ( 820) 820 821 822 823 824 825 826 827 828 829 + ( 830) 830 831 832 833 834 835 836 837 838 839 + ( 840) 840 841 842 843 844 845 846 847 848 849 + ( 850) 850 851 852 853 854 855 856 857 858 859 + ( 860) 860 861 862 863 864 865 866 867 868 869 + ( 870) 870 871 872 873 874 875 876 877 878 879 + ( 880) 880 881 882 883 884 885 886 887 888 889 + ( 890) 890 891 892 893 894 895 896 897 898 899 + ( 900) 900 901 902 903 904 905 906 907 908 909 + ( 910) 910 911 912 913 914 915 916 917 918 919 + ( 920) 920 921 922 923 924 925 926 927 928 929 + ( 930) 930 931 932 933 934 935 936 937 938 939 + ( 940) 940 941 942 943 944 945 946 947 948 949 + ( 950) 950 951 952 953 954 955 956 957 958 959 + ( 960) 960 961 962 963 964 965 966 967 968 969 + ( 970) 970 971 972 973 974 975 976 977 978 979 + ( 980) 980 981 982 983 984 985 986 987 988 989 + ( 990) 990 991 992 993 994 995 996 997 998 999 + (1000) 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 + (1010) 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 + (1020) 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 + (1030) 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 + (1040) 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 + (1050) 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 + (1060) 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 + (1070) 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 + (1080) 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 + (1090) 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 + (1100) 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 + (1110) 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 + (1120) 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 + (1130) 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 + (1140) 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 + (1150) 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 + (1160) 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 + (1170) 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 + (1180) 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 + (1190) 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 + (1200) 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 + (1210) 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 + (1220) 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 + (1230) 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 + (1240) 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 + (1250) 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 + (1260) 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 + (1270) 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 + (1280) 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 + (1290) 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 + (1300) 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 + (1310) 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 + (1320) 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 + (1330) 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 + (1340) 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 + (1350) 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 + (1360) 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 + (1370) 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 + (1380) 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 + (1390) 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 + (1400) 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 + (1410) 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 + (1420) 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 + (1430) 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 + (1440) 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 + (1450) 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 + (1460) 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 + (1470) 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 + (1480) 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 + (1490) 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 + (1500) 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 + (1510) 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 + (1520) 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 + (1530) 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 + (1540) 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 + (1550) 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 + (1560) 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 + (1570) 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 + (1580) 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 + (1590) 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 + (1600) 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 + (1610) 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 + (1620) 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 + (1630) 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 + (1640) 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 + (1650) 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 + (1660) 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 + (1670) 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 + (1680) 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 + (1690) 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 + (1700) 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 + (1710) 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 + (1720) 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 + (1730) 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 + (1740) 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 + (1750) 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 + (1760) 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 + (1770) 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 + (1780) 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 + (1790) 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 + (1800) 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 + (1810) 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 + (1820) 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 + (1830) 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 + (1840) 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 + (1850) 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 + (1860) 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 + (1870) 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 + (1880) 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 + (1890) 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 + (1900) 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 + (1910) 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 + (1920) 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 + (1930) 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 + (1940) 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 + (1950) 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 + (1960) 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 + (1970) 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 + (1980) 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 + (1990) 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 + (2000) 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 + (2010) 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 + (2020) 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 + (2030) 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 + (2040) 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 + (2050) 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 + (2060) 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 + (2070) 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 + (2080) 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 + (2090) 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 + diff --git a/tests/libs/adios/tests/suite/reference/global_array_no_xml_f_bpls.txt b/tests/libs/adios/tests/suite/reference/global_array_no_xml_f_bpls.txt new file mode 100644 index 0000000000..42ce305f32 --- /dev/null +++ b/tests/libs/adios/tests/suite/reference/global_array_no_xml_f_bpls.txt @@ -0,0 +1,28 @@ +File info: + of groups: 1 + of variables: 4 + of attributes: 0 + of meshes: 0 + time steps: 0 - 0 + bp version: 2 + statistics: Min / Max / Avg / Std_dev + + integer NX scalar = 10 + integer G scalar = 140 + integer O scalar = 0 + double temperature {140} = 0 / 139 / 69.5 / 40.4135 + ( 0) 0 1 2 3 4 5 6 7 8 9 + ( 10) 10 11 12 13 14 15 16 17 18 19 + ( 20) 20 21 22 23 24 25 26 27 28 29 + ( 30) 30 31 32 33 34 35 36 37 38 39 + ( 40) 40 41 42 43 44 45 46 47 48 49 + ( 50) 50 51 52 53 54 55 56 57 58 59 + ( 60) 60 61 62 63 64 65 66 67 68 69 + ( 70) 70 71 72 73 74 75 76 77 78 79 + ( 80) 80 81 82 83 84 85 86 87 88 89 + ( 90) 90 91 92 93 94 95 96 97 98 99 + (100) 100 101 102 103 104 105 106 107 108 109 + (110) 110 111 112 113 114 115 116 117 118 119 + (120) 120 121 122 123 124 125 126 127 128 129 + (130) 130 131 132 133 134 135 136 137 138 139 + diff --git a/tests/libs/adios/tests/suite/reference/global_array_no_xml_read.txt b/tests/libs/adios/tests/suite/reference/global_array_no_xml_read.txt new file mode 100644 index 0000000000..add857e963 --- /dev/null +++ b/tests/libs/adios/tests/suite/reference/global_array_no_xml_read.txt @@ -0,0 +1,213 @@ + ======== Rank 0 ========== +[0000] 0 1 2 3 4 5 6 7 8 9 +[0010] 10 11 12 13 14 15 16 17 18 19 +[0020] 20 21 22 23 24 25 26 27 28 29 +[0030] 30 31 32 33 34 35 36 37 38 39 +[0040] 40 41 42 43 44 45 46 47 48 49 +[0050] 50 51 52 53 54 55 56 57 58 59 +[0060] 60 61 62 63 64 65 66 67 68 69 +[0070] 70 71 72 73 74 75 76 77 78 79 +[0080] 80 81 82 83 84 85 86 87 88 89 +[0090] 90 91 92 93 94 95 96 97 98 99 +[0100] 100 101 102 103 104 105 106 107 108 109 +[0110] 110 111 112 113 114 115 116 117 118 119 +[0120] 120 121 122 123 124 125 126 127 128 129 +[0130] 130 131 132 133 134 135 136 137 138 139 +[0140] 140 141 142 143 144 145 146 147 148 149 +[0150] 150 151 152 153 154 155 156 157 158 159 +[0160] 160 161 162 163 164 165 166 167 168 169 +[0170] 170 171 172 173 174 175 176 177 178 179 +[0180] 180 181 182 183 184 185 186 187 188 189 +[0190] 190 191 192 193 194 195 196 197 198 199 +[0200] 200 201 202 203 204 205 206 207 208 209 +[0210] 210 211 212 213 214 215 216 217 218 219 +[0220] 220 221 222 223 224 225 226 227 228 229 +[0230] 230 231 232 233 234 235 236 237 238 239 +[0240] 240 241 242 243 244 245 246 247 248 249 +[0250] 250 251 252 253 254 255 256 257 258 259 +[0260] 260 261 262 263 264 265 266 267 268 269 +[0270] 270 271 272 273 274 275 276 277 278 279 +[0280] 280 281 282 283 284 285 286 287 288 289 +[0290] 290 291 292 293 294 295 296 297 298 299 +[0300] 300 301 302 303 304 305 306 307 308 309 +[0310] 310 311 312 313 314 315 316 317 318 319 +[0320] 320 321 322 323 324 325 326 327 328 329 +[0330] 330 331 332 333 334 335 336 337 338 339 +[0340] 340 341 342 343 344 345 346 347 348 349 +[0350] 350 351 352 353 354 355 356 357 358 359 +[0360] 360 361 362 363 364 365 366 367 368 369 +[0370] 370 371 372 373 374 375 376 377 378 379 +[0380] 380 381 382 383 384 385 386 387 388 389 +[0390] 390 391 392 393 394 395 396 397 398 399 +[0400] 400 401 402 403 404 405 406 407 408 409 +[0410] 410 411 412 413 414 415 416 417 418 419 +[0420] 420 421 422 423 424 425 426 427 428 429 +[0430] 430 431 432 433 434 435 436 437 438 439 +[0440] 440 441 442 443 444 445 446 447 448 449 +[0450] 450 451 452 453 454 455 456 457 458 459 +[0460] 460 461 462 463 464 465 466 467 468 469 +[0470] 470 471 472 473 474 475 476 477 478 479 +[0480] 480 481 482 483 484 485 486 487 488 489 +[0490] 490 491 492 493 494 495 496 497 498 499 +[0500] 500 501 502 503 504 505 506 507 508 509 +[0510] 510 511 512 513 514 515 516 517 518 519 +[0520] 520 521 522 523 524 525 526 527 528 529 +[0530] 530 531 532 533 534 535 536 537 538 539 +[0540] 540 541 542 543 544 545 546 547 548 549 +[0550] 550 551 552 553 554 555 556 557 558 559 +[0560] 560 561 562 563 564 565 566 567 568 569 +[0570] 570 571 572 573 574 575 576 577 578 579 +[0580] 580 581 582 583 584 585 586 587 588 589 +[0590] 590 591 592 593 594 595 596 597 598 599 +[0600] 600 601 602 603 604 605 606 607 608 609 +[0610] 610 611 612 613 614 615 616 617 618 619 +[0620] 620 621 622 623 624 625 626 627 628 629 +[0630] 630 631 632 633 634 635 636 637 638 639 +[0640] 640 641 642 643 644 645 646 647 648 649 +[0650] 650 651 652 653 654 655 656 657 658 659 +[0660] 660 661 662 663 664 665 666 667 668 669 +[0670] 670 671 672 673 674 675 676 677 678 679 +[0680] 680 681 682 683 684 685 686 687 688 689 +[0690] 690 691 692 693 694 695 696 697 698 699 + ======== Rank 1 ========== +[0700] 700 701 702 703 704 705 706 707 708 709 +[0710] 710 711 712 713 714 715 716 717 718 719 +[0720] 720 721 722 723 724 725 726 727 728 729 +[0730] 730 731 732 733 734 735 736 737 738 739 +[0740] 740 741 742 743 744 745 746 747 748 749 +[0750] 750 751 752 753 754 755 756 757 758 759 +[0760] 760 761 762 763 764 765 766 767 768 769 +[0770] 770 771 772 773 774 775 776 777 778 779 +[0780] 780 781 782 783 784 785 786 787 788 789 +[0790] 790 791 792 793 794 795 796 797 798 799 +[0800] 800 801 802 803 804 805 806 807 808 809 +[0810] 810 811 812 813 814 815 816 817 818 819 +[0820] 820 821 822 823 824 825 826 827 828 829 +[0830] 830 831 832 833 834 835 836 837 838 839 +[0840] 840 841 842 843 844 845 846 847 848 849 +[0850] 850 851 852 853 854 855 856 857 858 859 +[0860] 860 861 862 863 864 865 866 867 868 869 +[0870] 870 871 872 873 874 875 876 877 878 879 +[0880] 880 881 882 883 884 885 886 887 888 889 +[0890] 890 891 892 893 894 895 896 897 898 899 +[0900] 900 901 902 903 904 905 906 907 908 909 +[0910] 910 911 912 913 914 915 916 917 918 919 +[0920] 920 921 922 923 924 925 926 927 928 929 +[0930] 930 931 932 933 934 935 936 937 938 939 +[0940] 940 941 942 943 944 945 946 947 948 949 +[0950] 950 951 952 953 954 955 956 957 958 959 +[0960] 960 961 962 963 964 965 966 967 968 969 +[0970] 970 971 972 973 974 975 976 977 978 979 +[0980] 980 981 982 983 984 985 986 987 988 989 +[0990] 990 991 992 993 994 995 996 997 998 999 +[1000] 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 +[1010] 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 +[1020] 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 +[1030] 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 +[1040] 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 +[1050] 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 +[1060] 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 +[1070] 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 +[1080] 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 +[1090] 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 +[1100] 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 +[1110] 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 +[1120] 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 +[1130] 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 +[1140] 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 +[1150] 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 +[1160] 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 +[1170] 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 +[1180] 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 +[1190] 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 +[1200] 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 +[1210] 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 +[1220] 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 +[1230] 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 +[1240] 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 +[1250] 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 +[1260] 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 +[1270] 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 +[1280] 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 +[1290] 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 +[1300] 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 +[1310] 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 +[1320] 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 +[1330] 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 +[1340] 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 +[1350] 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 +[1360] 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 +[1370] 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 +[1380] 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 +[1390] 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 + ======== Rank 2 ========== +[1400] 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 +[1410] 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 +[1420] 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 +[1430] 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 +[1440] 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 +[1450] 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 +[1460] 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 +[1470] 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 +[1480] 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 +[1490] 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 +[1500] 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 +[1510] 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 +[1520] 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 +[1530] 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 +[1540] 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 +[1550] 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 +[1560] 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 +[1570] 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 +[1580] 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 +[1590] 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 +[1600] 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 +[1610] 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 +[1620] 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 +[1630] 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 +[1640] 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 +[1650] 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 +[1660] 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 +[1670] 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 +[1680] 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 +[1690] 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 +[1700] 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 +[1710] 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 +[1720] 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 +[1730] 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 +[1740] 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 +[1750] 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 +[1760] 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 +[1770] 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 +[1780] 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 +[1790] 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 +[1800] 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 +[1810] 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 +[1820] 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 +[1830] 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 +[1840] 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 +[1850] 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 +[1860] 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 +[1870] 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 +[1880] 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 +[1890] 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 +[1900] 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 +[1910] 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 +[1920] 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 +[1930] 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 +[1940] 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 +[1950] 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 +[1960] 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 +[1970] 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 +[1980] 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 +[1990] 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 +[2000] 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 +[2010] 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 +[2020] 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 +[2030] 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 +[2040] 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 +[2050] 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 +[2060] 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 +[2070] 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 +[2080] 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 +[2090] 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 diff --git a/tests/libs/adios/tests/suite/reference/global_array_read.txt b/tests/libs/adios/tests/suite/reference/global_array_read.txt new file mode 100644 index 0000000000..a4ea2fb3cb --- /dev/null +++ b/tests/libs/adios/tests/suite/reference/global_array_read.txt @@ -0,0 +1,7 @@ +rank 0: [0,0:2] 0 1 2 3 4 5 6 7 8 9 +rank 0: [1,0:2] 10 11 12 13 14 15 16 17 18 19 +rank 1: [2,0:2] 20 21 22 23 24 25 26 27 28 29 +rank 1: [3,0:2] 30 31 32 33 34 35 36 37 38 39 +rank 2: [4,0:3] 40 41 42 43 44 45 46 47 48 49 +rank 2: [5,0:3] 50 51 52 53 54 55 56 57 58 59 +rank 2: [6,0:3] 60 61 62 63 64 65 66 67 68 69 diff --git a/tests/libs/adios/tests/suite/reference/global_array_time_bpls.txt b/tests/libs/adios/tests/suite/reference/global_array_time_bpls.txt new file mode 100644 index 0000000000..753f199dd2 --- /dev/null +++ b/tests/libs/adios/tests/suite/reference/global_array_time_bpls.txt @@ -0,0 +1,7 @@ + integer NX 13*scalar = 10 / 10 / 10 / 0 + integer NY 13*scalar = 1 / 1 / 1 / 0 + integer size 13*scalar = 9 / 9 / 9 / 0 + integer rank 13*scalar = 0 / 8 / 4 / 2.58199 + double temperature 13*{9, 10} = 100 / 1389 / 744.5 / 375.067 + double pressure 13*{9, 1} = 1000 / 13008 / 7004 / 3741.66 + string temperature/description attr = "Global array written from 'size' processes over several timesteps" diff --git a/tests/libs/adios/tests/suite/reference/global_array_time_read.txt b/tests/libs/adios/tests/suite/reference/global_array_time_read.txt new file mode 100644 index 0000000000..ae5e983efc --- /dev/null +++ b/tests/libs/adios/tests/suite/reference/global_array_time_read.txt @@ -0,0 +1,226 @@ +Array size of temperature [0:9,0:10] +------------------------------------------------ +rank=0: +step 0 = [ + [100 101 102 103 104 105 106 107 108 109 ] + [110 111 112 113 114 115 116 117 118 119 ] + [120 121 122 123 124 125 126 127 128 129 ] + [130 131 132 133 134 135 136 137 138 139 ] + [140 141 142 143 144 145 146 147 148 149 ] + [150 151 152 153 154 155 156 157 158 159 ] + [160 161 162 163 164 165 166 167 168 169 ] + [170 171 172 173 174 175 176 177 178 179 ] + [180 181 182 183 184 185 186 187 188 189 ] +] +step 1 = [ + [200 201 202 203 204 205 206 207 208 209 ] + [210 211 212 213 214 215 216 217 218 219 ] + [220 221 222 223 224 225 226 227 228 229 ] + [230 231 232 233 234 235 236 237 238 239 ] + [240 241 242 243 244 245 246 247 248 249 ] + [250 251 252 253 254 255 256 257 258 259 ] + [260 261 262 263 264 265 266 267 268 269 ] + [270 271 272 273 274 275 276 277 278 279 ] + [280 281 282 283 284 285 286 287 288 289 ] +] + +------------------------------------------------ +rank=1: +step 1 = [ + [200 201 202 203 204 205 206 207 208 209 ] + [210 211 212 213 214 215 216 217 218 219 ] + [220 221 222 223 224 225 226 227 228 229 ] + [230 231 232 233 234 235 236 237 238 239 ] + [240 241 242 243 244 245 246 247 248 249 ] + [250 251 252 253 254 255 256 257 258 259 ] + [260 261 262 263 264 265 266 267 268 269 ] + [270 271 272 273 274 275 276 277 278 279 ] + [280 281 282 283 284 285 286 287 288 289 ] +] +step 2 = [ + [300 301 302 303 304 305 306 307 308 309 ] + [310 311 312 313 314 315 316 317 318 319 ] + [320 321 322 323 324 325 326 327 328 329 ] + [330 331 332 333 334 335 336 337 338 339 ] + [340 341 342 343 344 345 346 347 348 349 ] + [350 351 352 353 354 355 356 357 358 359 ] + [360 361 362 363 364 365 366 367 368 369 ] + [370 371 372 373 374 375 376 377 378 379 ] + [380 381 382 383 384 385 386 387 388 389 ] +] + +------------------------------------------------ +rank=2: +step 2 = [ + [300 301 302 303 304 305 306 307 308 309 ] + [310 311 312 313 314 315 316 317 318 319 ] + [320 321 322 323 324 325 326 327 328 329 ] + [330 331 332 333 334 335 336 337 338 339 ] + [340 341 342 343 344 345 346 347 348 349 ] + [350 351 352 353 354 355 356 357 358 359 ] + [360 361 362 363 364 365 366 367 368 369 ] + [370 371 372 373 374 375 376 377 378 379 ] + [380 381 382 383 384 385 386 387 388 389 ] +] +step 3 = [ + [400 401 402 403 404 405 406 407 408 409 ] + [410 411 412 413 414 415 416 417 418 419 ] + [420 421 422 423 424 425 426 427 428 429 ] + [430 431 432 433 434 435 436 437 438 439 ] + [440 441 442 443 444 445 446 447 448 449 ] + [450 451 452 453 454 455 456 457 458 459 ] + [460 461 462 463 464 465 466 467 468 469 ] + [470 471 472 473 474 475 476 477 478 479 ] + [480 481 482 483 484 485 486 487 488 489 ] +] + +------------------------------------------------ +rank=3: +step 3 = [ + [400 401 402 403 404 405 406 407 408 409 ] + [410 411 412 413 414 415 416 417 418 419 ] + [420 421 422 423 424 425 426 427 428 429 ] + [430 431 432 433 434 435 436 437 438 439 ] + [440 441 442 443 444 445 446 447 448 449 ] + [450 451 452 453 454 455 456 457 458 459 ] + [460 461 462 463 464 465 466 467 468 469 ] + [470 471 472 473 474 475 476 477 478 479 ] + [480 481 482 483 484 485 486 487 488 489 ] +] +step 4 = [ + [500 501 502 503 504 505 506 507 508 509 ] + [510 511 512 513 514 515 516 517 518 519 ] + [520 521 522 523 524 525 526 527 528 529 ] + [530 531 532 533 534 535 536 537 538 539 ] + [540 541 542 543 544 545 546 547 548 549 ] + [550 551 552 553 554 555 556 557 558 559 ] + [560 561 562 563 564 565 566 567 568 569 ] + [570 571 572 573 574 575 576 577 578 579 ] + [580 581 582 583 584 585 586 587 588 589 ] +] + +------------------------------------------------ +rank=4: +step 4 = [ + [500 501 502 503 504 505 506 507 508 509 ] + [510 511 512 513 514 515 516 517 518 519 ] + [520 521 522 523 524 525 526 527 528 529 ] + [530 531 532 533 534 535 536 537 538 539 ] + [540 541 542 543 544 545 546 547 548 549 ] + [550 551 552 553 554 555 556 557 558 559 ] + [560 561 562 563 564 565 566 567 568 569 ] + [570 571 572 573 574 575 576 577 578 579 ] + [580 581 582 583 584 585 586 587 588 589 ] +] +step 5 = [ + [600 601 602 603 604 605 606 607 608 609 ] + [610 611 612 613 614 615 616 617 618 619 ] + [620 621 622 623 624 625 626 627 628 629 ] + [630 631 632 633 634 635 636 637 638 639 ] + [640 641 642 643 644 645 646 647 648 649 ] + [650 651 652 653 654 655 656 657 658 659 ] + [660 661 662 663 664 665 666 667 668 669 ] + [670 671 672 673 674 675 676 677 678 679 ] + [680 681 682 683 684 685 686 687 688 689 ] +] + +------------------------------------------------ +rank=5: +step 5 = [ + [600 601 602 603 604 605 606 607 608 609 ] + [610 611 612 613 614 615 616 617 618 619 ] + [620 621 622 623 624 625 626 627 628 629 ] + [630 631 632 633 634 635 636 637 638 639 ] + [640 641 642 643 644 645 646 647 648 649 ] + [650 651 652 653 654 655 656 657 658 659 ] + [660 661 662 663 664 665 666 667 668 669 ] + [670 671 672 673 674 675 676 677 678 679 ] + [680 681 682 683 684 685 686 687 688 689 ] +] +step 6 = [ + [700 701 702 703 704 705 706 707 708 709 ] + [710 711 712 713 714 715 716 717 718 719 ] + [720 721 722 723 724 725 726 727 728 729 ] + [730 731 732 733 734 735 736 737 738 739 ] + [740 741 742 743 744 745 746 747 748 749 ] + [750 751 752 753 754 755 756 757 758 759 ] + [760 761 762 763 764 765 766 767 768 769 ] + [770 771 772 773 774 775 776 777 778 779 ] + [780 781 782 783 784 785 786 787 788 789 ] +] + +------------------------------------------------ +rank=6: +step 6 = [ + [700 701 702 703 704 705 706 707 708 709 ] + [710 711 712 713 714 715 716 717 718 719 ] + [720 721 722 723 724 725 726 727 728 729 ] + [730 731 732 733 734 735 736 737 738 739 ] + [740 741 742 743 744 745 746 747 748 749 ] + [750 751 752 753 754 755 756 757 758 759 ] + [760 761 762 763 764 765 766 767 768 769 ] + [770 771 772 773 774 775 776 777 778 779 ] + [780 781 782 783 784 785 786 787 788 789 ] +] +step 7 = [ + [800 801 802 803 804 805 806 807 808 809 ] + [810 811 812 813 814 815 816 817 818 819 ] + [820 821 822 823 824 825 826 827 828 829 ] + [830 831 832 833 834 835 836 837 838 839 ] + [840 841 842 843 844 845 846 847 848 849 ] + [850 851 852 853 854 855 856 857 858 859 ] + [860 861 862 863 864 865 866 867 868 869 ] + [870 871 872 873 874 875 876 877 878 879 ] + [880 881 882 883 884 885 886 887 888 889 ] +] + +------------------------------------------------ +rank=7: +step 7 = [ + [800 801 802 803 804 805 806 807 808 809 ] + [810 811 812 813 814 815 816 817 818 819 ] + [820 821 822 823 824 825 826 827 828 829 ] + [830 831 832 833 834 835 836 837 838 839 ] + [840 841 842 843 844 845 846 847 848 849 ] + [850 851 852 853 854 855 856 857 858 859 ] + [860 861 862 863 864 865 866 867 868 869 ] + [870 871 872 873 874 875 876 877 878 879 ] + [880 881 882 883 884 885 886 887 888 889 ] +] +step 8 = [ + [900 901 902 903 904 905 906 907 908 909 ] + [910 911 912 913 914 915 916 917 918 919 ] + [920 921 922 923 924 925 926 927 928 929 ] + [930 931 932 933 934 935 936 937 938 939 ] + [940 941 942 943 944 945 946 947 948 949 ] + [950 951 952 953 954 955 956 957 958 959 ] + [960 961 962 963 964 965 966 967 968 969 ] + [970 971 972 973 974 975 976 977 978 979 ] + [980 981 982 983 984 985 986 987 988 989 ] +] + +------------------------------------------------ +rank=8: +step 8 = [ + [900 901 902 903 904 905 906 907 908 909 ] + [910 911 912 913 914 915 916 917 918 919 ] + [920 921 922 923 924 925 926 927 928 929 ] + [930 931 932 933 934 935 936 937 938 939 ] + [940 941 942 943 944 945 946 947 948 949 ] + [950 951 952 953 954 955 956 957 958 959 ] + [960 961 962 963 964 965 966 967 968 969 ] + [970 971 972 973 974 975 976 977 978 979 ] + [980 981 982 983 984 985 986 987 988 989 ] +] +step 9 = [ + [1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 ] + [1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 ] + [1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 ] + [1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 ] + [1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 ] + [1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 ] + [1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 ] + [1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 ] + [1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 ] +] + diff --git a/tests/libs/adios/tests/suite/reference/no_xml_write_byid_bpls.txt b/tests/libs/adios/tests/suite/reference/no_xml_write_byid_bpls.txt new file mode 100644 index 0000000000..ea80c26af8 --- /dev/null +++ b/tests/libs/adios/tests/suite/reference/no_xml_write_byid_bpls.txt @@ -0,0 +1,221 @@ +File info: + of groups: 1 + of variables: 1 + of attributes: 0 + of meshes: 0 + time steps: 0 - 0 + bp version: 2 + statistics: Min / Max / Avg / Std_dev + + double temperature {2100} = 0 / 2099 / 1049.5 / 606.218 + ( 0) 0 1 2 3 4 5 6 7 8 9 + ( 10) 10 11 12 13 14 15 16 17 18 19 + ( 20) 20 21 22 23 24 25 26 27 28 29 + ( 30) 30 31 32 33 34 35 36 37 38 39 + ( 40) 40 41 42 43 44 45 46 47 48 49 + ( 50) 50 51 52 53 54 55 56 57 58 59 + ( 60) 60 61 62 63 64 65 66 67 68 69 + ( 70) 70 71 72 73 74 75 76 77 78 79 + ( 80) 80 81 82 83 84 85 86 87 88 89 + ( 90) 90 91 92 93 94 95 96 97 98 99 + ( 100) 100 101 102 103 104 105 106 107 108 109 + ( 110) 110 111 112 113 114 115 116 117 118 119 + ( 120) 120 121 122 123 124 125 126 127 128 129 + ( 130) 130 131 132 133 134 135 136 137 138 139 + ( 140) 140 141 142 143 144 145 146 147 148 149 + ( 150) 150 151 152 153 154 155 156 157 158 159 + ( 160) 160 161 162 163 164 165 166 167 168 169 + ( 170) 170 171 172 173 174 175 176 177 178 179 + ( 180) 180 181 182 183 184 185 186 187 188 189 + ( 190) 190 191 192 193 194 195 196 197 198 199 + ( 200) 200 201 202 203 204 205 206 207 208 209 + ( 210) 210 211 212 213 214 215 216 217 218 219 + ( 220) 220 221 222 223 224 225 226 227 228 229 + ( 230) 230 231 232 233 234 235 236 237 238 239 + ( 240) 240 241 242 243 244 245 246 247 248 249 + ( 250) 250 251 252 253 254 255 256 257 258 259 + ( 260) 260 261 262 263 264 265 266 267 268 269 + ( 270) 270 271 272 273 274 275 276 277 278 279 + ( 280) 280 281 282 283 284 285 286 287 288 289 + ( 290) 290 291 292 293 294 295 296 297 298 299 + ( 300) 300 301 302 303 304 305 306 307 308 309 + ( 310) 310 311 312 313 314 315 316 317 318 319 + ( 320) 320 321 322 323 324 325 326 327 328 329 + ( 330) 330 331 332 333 334 335 336 337 338 339 + ( 340) 340 341 342 343 344 345 346 347 348 349 + ( 350) 350 351 352 353 354 355 356 357 358 359 + ( 360) 360 361 362 363 364 365 366 367 368 369 + ( 370) 370 371 372 373 374 375 376 377 378 379 + ( 380) 380 381 382 383 384 385 386 387 388 389 + ( 390) 390 391 392 393 394 395 396 397 398 399 + ( 400) 400 401 402 403 404 405 406 407 408 409 + ( 410) 410 411 412 413 414 415 416 417 418 419 + ( 420) 420 421 422 423 424 425 426 427 428 429 + ( 430) 430 431 432 433 434 435 436 437 438 439 + ( 440) 440 441 442 443 444 445 446 447 448 449 + ( 450) 450 451 452 453 454 455 456 457 458 459 + ( 460) 460 461 462 463 464 465 466 467 468 469 + ( 470) 470 471 472 473 474 475 476 477 478 479 + ( 480) 480 481 482 483 484 485 486 487 488 489 + ( 490) 490 491 492 493 494 495 496 497 498 499 + ( 500) 500 501 502 503 504 505 506 507 508 509 + ( 510) 510 511 512 513 514 515 516 517 518 519 + ( 520) 520 521 522 523 524 525 526 527 528 529 + ( 530) 530 531 532 533 534 535 536 537 538 539 + ( 540) 540 541 542 543 544 545 546 547 548 549 + ( 550) 550 551 552 553 554 555 556 557 558 559 + ( 560) 560 561 562 563 564 565 566 567 568 569 + ( 570) 570 571 572 573 574 575 576 577 578 579 + ( 580) 580 581 582 583 584 585 586 587 588 589 + ( 590) 590 591 592 593 594 595 596 597 598 599 + ( 600) 600 601 602 603 604 605 606 607 608 609 + ( 610) 610 611 612 613 614 615 616 617 618 619 + ( 620) 620 621 622 623 624 625 626 627 628 629 + ( 630) 630 631 632 633 634 635 636 637 638 639 + ( 640) 640 641 642 643 644 645 646 647 648 649 + ( 650) 650 651 652 653 654 655 656 657 658 659 + ( 660) 660 661 662 663 664 665 666 667 668 669 + ( 670) 670 671 672 673 674 675 676 677 678 679 + ( 680) 680 681 682 683 684 685 686 687 688 689 + ( 690) 690 691 692 693 694 695 696 697 698 699 + ( 700) 700 701 702 703 704 705 706 707 708 709 + ( 710) 710 711 712 713 714 715 716 717 718 719 + ( 720) 720 721 722 723 724 725 726 727 728 729 + ( 730) 730 731 732 733 734 735 736 737 738 739 + ( 740) 740 741 742 743 744 745 746 747 748 749 + ( 750) 750 751 752 753 754 755 756 757 758 759 + ( 760) 760 761 762 763 764 765 766 767 768 769 + ( 770) 770 771 772 773 774 775 776 777 778 779 + ( 780) 780 781 782 783 784 785 786 787 788 789 + ( 790) 790 791 792 793 794 795 796 797 798 799 + ( 800) 800 801 802 803 804 805 806 807 808 809 + ( 810) 810 811 812 813 814 815 816 817 818 819 + ( 820) 820 821 822 823 824 825 826 827 828 829 + ( 830) 830 831 832 833 834 835 836 837 838 839 + ( 840) 840 841 842 843 844 845 846 847 848 849 + ( 850) 850 851 852 853 854 855 856 857 858 859 + ( 860) 860 861 862 863 864 865 866 867 868 869 + ( 870) 870 871 872 873 874 875 876 877 878 879 + ( 880) 880 881 882 883 884 885 886 887 888 889 + ( 890) 890 891 892 893 894 895 896 897 898 899 + ( 900) 900 901 902 903 904 905 906 907 908 909 + ( 910) 910 911 912 913 914 915 916 917 918 919 + ( 920) 920 921 922 923 924 925 926 927 928 929 + ( 930) 930 931 932 933 934 935 936 937 938 939 + ( 940) 940 941 942 943 944 945 946 947 948 949 + ( 950) 950 951 952 953 954 955 956 957 958 959 + ( 960) 960 961 962 963 964 965 966 967 968 969 + ( 970) 970 971 972 973 974 975 976 977 978 979 + ( 980) 980 981 982 983 984 985 986 987 988 989 + ( 990) 990 991 992 993 994 995 996 997 998 999 + (1000) 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 + (1010) 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 + (1020) 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 + (1030) 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 + (1040) 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 + (1050) 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 + (1060) 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 + (1070) 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 + (1080) 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 + (1090) 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 + (1100) 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 + (1110) 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 + (1120) 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 + (1130) 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 + (1140) 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 + (1150) 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 + (1160) 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 + (1170) 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 + (1180) 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 + (1190) 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 + (1200) 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 + (1210) 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 + (1220) 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 + (1230) 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 + (1240) 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 + (1250) 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 + (1260) 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 + (1270) 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 + (1280) 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 + (1290) 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 + (1300) 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 + (1310) 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 + (1320) 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 + (1330) 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 + (1340) 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 + (1350) 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 + (1360) 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 + (1370) 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 + (1380) 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 + (1390) 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 + (1400) 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 + (1410) 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 + (1420) 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 + (1430) 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 + (1440) 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 + (1450) 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 + (1460) 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 + (1470) 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 + (1480) 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 + (1490) 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 + (1500) 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 + (1510) 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 + (1520) 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 + (1530) 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 + (1540) 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 + (1550) 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 + (1560) 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 + (1570) 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 + (1580) 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 + (1590) 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 + (1600) 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 + (1610) 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 + (1620) 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 + (1630) 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 + (1640) 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 + (1650) 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 + (1660) 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 + (1670) 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 + (1680) 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 + (1690) 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 + (1700) 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 + (1710) 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 + (1720) 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 + (1730) 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 + (1740) 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 + (1750) 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 + (1760) 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 + (1770) 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 + (1780) 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 + (1790) 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 + (1800) 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 + (1810) 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 + (1820) 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 + (1830) 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 + (1840) 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 + (1850) 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 + (1860) 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 + (1870) 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 + (1880) 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 + (1890) 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 + (1900) 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 + (1910) 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 + (1920) 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 + (1930) 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 + (1940) 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 + (1950) 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 + (1960) 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 + (1970) 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 + (1980) 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 + (1990) 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 + (2000) 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 + (2010) 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 + (2020) 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 + (2030) 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 + (2040) 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 + (2050) 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 + (2060) 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 + (2070) 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 + (2080) 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 + (2090) 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 + diff --git a/tests/libs/adios/tests/suite/reference/no_xml_write_byid_f_bpls.txt b/tests/libs/adios/tests/suite/reference/no_xml_write_byid_f_bpls.txt new file mode 100644 index 0000000000..be11b59671 --- /dev/null +++ b/tests/libs/adios/tests/suite/reference/no_xml_write_byid_f_bpls.txt @@ -0,0 +1,25 @@ +File info: + of groups: 1 + of variables: 1 + of attributes: 0 + of meshes: 0 + time steps: 0 - 0 + bp version: 2 + statistics: Min / Max / Avg / Std_dev + + double temperature {140} = 0 / 139 / 69.5 / 40.4135 + ( 0) 0 1 2 3 4 5 6 7 8 9 + ( 10) 10 11 12 13 14 15 16 17 18 19 + ( 20) 20 21 22 23 24 25 26 27 28 29 + ( 30) 30 31 32 33 34 35 36 37 38 39 + ( 40) 40 41 42 43 44 45 46 47 48 49 + ( 50) 50 51 52 53 54 55 56 57 58 59 + ( 60) 60 61 62 63 64 65 66 67 68 69 + ( 70) 70 71 72 73 74 75 76 77 78 79 + ( 80) 80 81 82 83 84 85 86 87 88 89 + ( 90) 90 91 92 93 94 95 96 97 98 99 + (100) 100 101 102 103 104 105 106 107 108 109 + (110) 110 111 112 113 114 115 116 117 118 119 + (120) 120 121 122 123 124 125 126 127 128 129 + (130) 130 131 132 133 134 135 136 137 138 139 + diff --git a/tests/libs/adios/tests/suite/reference/no_xml_write_byid_read.txt b/tests/libs/adios/tests/suite/reference/no_xml_write_byid_read.txt new file mode 100644 index 0000000000..add857e963 --- /dev/null +++ b/tests/libs/adios/tests/suite/reference/no_xml_write_byid_read.txt @@ -0,0 +1,213 @@ + ======== Rank 0 ========== +[0000] 0 1 2 3 4 5 6 7 8 9 +[0010] 10 11 12 13 14 15 16 17 18 19 +[0020] 20 21 22 23 24 25 26 27 28 29 +[0030] 30 31 32 33 34 35 36 37 38 39 +[0040] 40 41 42 43 44 45 46 47 48 49 +[0050] 50 51 52 53 54 55 56 57 58 59 +[0060] 60 61 62 63 64 65 66 67 68 69 +[0070] 70 71 72 73 74 75 76 77 78 79 +[0080] 80 81 82 83 84 85 86 87 88 89 +[0090] 90 91 92 93 94 95 96 97 98 99 +[0100] 100 101 102 103 104 105 106 107 108 109 +[0110] 110 111 112 113 114 115 116 117 118 119 +[0120] 120 121 122 123 124 125 126 127 128 129 +[0130] 130 131 132 133 134 135 136 137 138 139 +[0140] 140 141 142 143 144 145 146 147 148 149 +[0150] 150 151 152 153 154 155 156 157 158 159 +[0160] 160 161 162 163 164 165 166 167 168 169 +[0170] 170 171 172 173 174 175 176 177 178 179 +[0180] 180 181 182 183 184 185 186 187 188 189 +[0190] 190 191 192 193 194 195 196 197 198 199 +[0200] 200 201 202 203 204 205 206 207 208 209 +[0210] 210 211 212 213 214 215 216 217 218 219 +[0220] 220 221 222 223 224 225 226 227 228 229 +[0230] 230 231 232 233 234 235 236 237 238 239 +[0240] 240 241 242 243 244 245 246 247 248 249 +[0250] 250 251 252 253 254 255 256 257 258 259 +[0260] 260 261 262 263 264 265 266 267 268 269 +[0270] 270 271 272 273 274 275 276 277 278 279 +[0280] 280 281 282 283 284 285 286 287 288 289 +[0290] 290 291 292 293 294 295 296 297 298 299 +[0300] 300 301 302 303 304 305 306 307 308 309 +[0310] 310 311 312 313 314 315 316 317 318 319 +[0320] 320 321 322 323 324 325 326 327 328 329 +[0330] 330 331 332 333 334 335 336 337 338 339 +[0340] 340 341 342 343 344 345 346 347 348 349 +[0350] 350 351 352 353 354 355 356 357 358 359 +[0360] 360 361 362 363 364 365 366 367 368 369 +[0370] 370 371 372 373 374 375 376 377 378 379 +[0380] 380 381 382 383 384 385 386 387 388 389 +[0390] 390 391 392 393 394 395 396 397 398 399 +[0400] 400 401 402 403 404 405 406 407 408 409 +[0410] 410 411 412 413 414 415 416 417 418 419 +[0420] 420 421 422 423 424 425 426 427 428 429 +[0430] 430 431 432 433 434 435 436 437 438 439 +[0440] 440 441 442 443 444 445 446 447 448 449 +[0450] 450 451 452 453 454 455 456 457 458 459 +[0460] 460 461 462 463 464 465 466 467 468 469 +[0470] 470 471 472 473 474 475 476 477 478 479 +[0480] 480 481 482 483 484 485 486 487 488 489 +[0490] 490 491 492 493 494 495 496 497 498 499 +[0500] 500 501 502 503 504 505 506 507 508 509 +[0510] 510 511 512 513 514 515 516 517 518 519 +[0520] 520 521 522 523 524 525 526 527 528 529 +[0530] 530 531 532 533 534 535 536 537 538 539 +[0540] 540 541 542 543 544 545 546 547 548 549 +[0550] 550 551 552 553 554 555 556 557 558 559 +[0560] 560 561 562 563 564 565 566 567 568 569 +[0570] 570 571 572 573 574 575 576 577 578 579 +[0580] 580 581 582 583 584 585 586 587 588 589 +[0590] 590 591 592 593 594 595 596 597 598 599 +[0600] 600 601 602 603 604 605 606 607 608 609 +[0610] 610 611 612 613 614 615 616 617 618 619 +[0620] 620 621 622 623 624 625 626 627 628 629 +[0630] 630 631 632 633 634 635 636 637 638 639 +[0640] 640 641 642 643 644 645 646 647 648 649 +[0650] 650 651 652 653 654 655 656 657 658 659 +[0660] 660 661 662 663 664 665 666 667 668 669 +[0670] 670 671 672 673 674 675 676 677 678 679 +[0680] 680 681 682 683 684 685 686 687 688 689 +[0690] 690 691 692 693 694 695 696 697 698 699 + ======== Rank 1 ========== +[0700] 700 701 702 703 704 705 706 707 708 709 +[0710] 710 711 712 713 714 715 716 717 718 719 +[0720] 720 721 722 723 724 725 726 727 728 729 +[0730] 730 731 732 733 734 735 736 737 738 739 +[0740] 740 741 742 743 744 745 746 747 748 749 +[0750] 750 751 752 753 754 755 756 757 758 759 +[0760] 760 761 762 763 764 765 766 767 768 769 +[0770] 770 771 772 773 774 775 776 777 778 779 +[0780] 780 781 782 783 784 785 786 787 788 789 +[0790] 790 791 792 793 794 795 796 797 798 799 +[0800] 800 801 802 803 804 805 806 807 808 809 +[0810] 810 811 812 813 814 815 816 817 818 819 +[0820] 820 821 822 823 824 825 826 827 828 829 +[0830] 830 831 832 833 834 835 836 837 838 839 +[0840] 840 841 842 843 844 845 846 847 848 849 +[0850] 850 851 852 853 854 855 856 857 858 859 +[0860] 860 861 862 863 864 865 866 867 868 869 +[0870] 870 871 872 873 874 875 876 877 878 879 +[0880] 880 881 882 883 884 885 886 887 888 889 +[0890] 890 891 892 893 894 895 896 897 898 899 +[0900] 900 901 902 903 904 905 906 907 908 909 +[0910] 910 911 912 913 914 915 916 917 918 919 +[0920] 920 921 922 923 924 925 926 927 928 929 +[0930] 930 931 932 933 934 935 936 937 938 939 +[0940] 940 941 942 943 944 945 946 947 948 949 +[0950] 950 951 952 953 954 955 956 957 958 959 +[0960] 960 961 962 963 964 965 966 967 968 969 +[0970] 970 971 972 973 974 975 976 977 978 979 +[0980] 980 981 982 983 984 985 986 987 988 989 +[0990] 990 991 992 993 994 995 996 997 998 999 +[1000] 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 +[1010] 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 +[1020] 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 +[1030] 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 +[1040] 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 +[1050] 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 +[1060] 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 +[1070] 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 +[1080] 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 +[1090] 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 +[1100] 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 +[1110] 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 +[1120] 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 +[1130] 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 +[1140] 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 +[1150] 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 +[1160] 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 +[1170] 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 +[1180] 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 +[1190] 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 +[1200] 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 +[1210] 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 +[1220] 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 +[1230] 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 +[1240] 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 +[1250] 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 +[1260] 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 +[1270] 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 +[1280] 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 +[1290] 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 +[1300] 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 +[1310] 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 +[1320] 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 +[1330] 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 +[1340] 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 +[1350] 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 +[1360] 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 +[1370] 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 +[1380] 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 +[1390] 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 + ======== Rank 2 ========== +[1400] 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 +[1410] 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 +[1420] 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 +[1430] 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 +[1440] 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 +[1450] 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 +[1460] 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 +[1470] 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 +[1480] 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 +[1490] 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 +[1500] 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 +[1510] 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 +[1520] 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 +[1530] 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 +[1540] 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 +[1550] 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 +[1560] 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 +[1570] 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 +[1580] 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 +[1590] 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 +[1600] 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 +[1610] 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 +[1620] 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 +[1630] 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 +[1640] 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 +[1650] 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 +[1660] 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 +[1670] 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 +[1680] 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 +[1690] 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 +[1700] 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 +[1710] 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 +[1720] 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 +[1730] 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 +[1740] 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 +[1750] 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 +[1760] 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 +[1770] 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 +[1780] 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 +[1790] 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 +[1800] 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 +[1810] 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 +[1820] 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 +[1830] 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 +[1840] 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 +[1850] 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 +[1860] 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 +[1870] 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 +[1880] 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 +[1890] 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 +[1900] 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 +[1910] 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 +[1920] 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 +[1930] 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 +[1940] 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 +[1950] 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 +[1960] 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 +[1970] 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 +[1980] 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 +[1990] 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 +[2000] 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 +[2010] 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 +[2020] 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 +[2030] 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 +[2040] 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 +[2050] 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 +[2060] 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 +[2070] 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 +[2080] 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 +[2090] 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 diff --git a/tests/libs/adios/tests/suite/reference/scalars_read_c.txt b/tests/libs/adios/tests/suite/reference/scalars_read_c.txt new file mode 100644 index 0000000000..ae64b8710d --- /dev/null +++ b/tests/libs/adios/tests/suite/reference/scalars_read_c.txt @@ -0,0 +1,13 @@ +byte v1 = -4 +short v2 = -3 +integer v3 = -2 +long v4 = -1 +uns.byte v5 = 1 +uns.short v6 = 2 +uns.int v7 = 3 +uns.long v8 = 4 +float v9 = 5 +double v10 = 6 +string v11 = ADIOS example +complex v12 = (8, i9) +dbl-complex v13 = (10, i11) diff --git a/tests/libs/adios/tests/suite/reference/scalars_read_f.txt b/tests/libs/adios/tests/suite/reference/scalars_read_f.txt new file mode 100644 index 0000000000..a9a72f9727 Binary files /dev/null and b/tests/libs/adios/tests/suite/reference/scalars_read_f.txt differ diff --git a/tests/libs/adios/tests/suite/reference/scalars_write_bpls.txt b/tests/libs/adios/tests/suite/reference/scalars_write_bpls.txt new file mode 100644 index 0000000000..3eb07e8b85 --- /dev/null +++ b/tests/libs/adios/tests/suite/reference/scalars_write_bpls.txt @@ -0,0 +1,22 @@ +File info: + of groups: 1 + of variables: 13 + of attributes: 0 + of meshes: 0 + time steps: 0 - 0 + bp version: 2 + statistics: Min / Max / Avg / Std_dev + + byte var_byte scalar = -4 + short var_short scalar = -3 + integer var_int scalar = -2 + long long var_long scalar = -1 + unsigned byte var_ubyte scalar = 1 + unsigned short var_ushort scalar = 2 + unsigned integer var_uint scalar = 3 + unsigned long long var_ulong scalar = 4 + real var_real scalar = 5 + double var_double scalar = 6 + string var_string scalar = "ADIOS example" + complex var_complex scalar = (8,i9) + double complex var_double_complex scalar = (10,i11) diff --git a/tests/libs/adios/tests/suite/reference/transforms_read_write_bpls.txt b/tests/libs/adios/tests/suite/reference/transforms_read_write_bpls.txt new file mode 100644 index 0000000000..0a96d296ce --- /dev/null +++ b/tests/libs/adios/tests/suite/reference/transforms_read_write_bpls.txt @@ -0,0 +1,10 @@ + integer l1 16*scalar = 1 / 1 / 1 / 0 + integer l2 16*scalar = 64 / 64 / 64 / 0 + integer o1 16*scalar = 0 / 15 / 7.5 / 4.60977 + integer o2 16*scalar = 0 / 0 / 0 / 0 + integer g1 16*scalar = 16 / 16 / 16 / 0 + integer g2 16*scalar = 64 / 64 / 64 / 0 + double t_none 16*{16, 64} = 0 / 1038 / 519 / 295.639 + double t_identity 16*{16, 64} = 0 / 1038 / 519 / 295.639 + double t_aplod 16*{16, 64} = 0 / 1038 / 519 / 295.639 + double t_isobar 16*{16, 64} = 0 / 1038 / 519 / 295.639 diff --git a/tests/libs/adios/tests/suite/reference/write_read_bpls.txt b/tests/libs/adios/tests/suite/reference/write_read_bpls.txt new file mode 100644 index 0000000000..74292fd3cb --- /dev/null +++ b/tests/libs/adios/tests/suite/reference/write_read_bpls.txt @@ -0,0 +1,79 @@ + integer gdim1 scalar + integer gdim2 scalar + integer gdim3 scalar + integer gdim4 scalar + integer gdim5 scalar + integer gdim6 scalar + integer ldim1 scalar + integer ldim2 scalar + integer ldim3 scalar + integer ldim4 scalar + integer ldim5 scalar + integer ldim6 scalar + integer offs1 scalar + integer offs2 scalar + integer offs3 scalar + integer offs4 scalar + integer offs5 scalar + integer offs6 scalar + byte /scalars/scalar_byte scalar + short /scalars/scalar_short scalar + integer /scalars/scalar_int scalar + long long /scalars/scalar_long scalar + unsigned byte /scalars/scalar_ubyte scalar + unsigned short /scalars/scalar_ushort scalar + unsigned integer /scalars/scalar_uint scalar + unsigned long long /scalars/scalar_ulong scalar + real /scalars/scalar_float scalar + double /scalars/scalar_double scalar + string /scalars/scalar_string scalar + complex /scalars/scalar_complex scalar + double complex /scalars/scalar_double_complex scalar + byte /1D/a1_byte {21} + short /1D/a1_short {21} + integer /1D/a1_int {21} + long long /1D/a1_long {21} + unsigned byte /1D/a1_ubyte {21} + unsigned short /1D/a1_ushort {21} + unsigned integer /1D/a1_uint {21} + unsigned long long /1D/a1_ulong {21} + real /1D/a1_float {21} + double /1D/a1_double {21} + complex /1D/a1_complex {21} + double complex /1D/a1_double_complex {21} + byte /2D/a2_byte {21, 5} + short /2D/a2_short {21, 5} + integer /2D/a2_int {21, 5} + long long /2D/a2_long {21, 5} + unsigned byte /2D/a2_ubyte {21, 5} + unsigned short /2D/a2_ushort {21, 5} + unsigned integer /2D/a2_uint {21, 5} + unsigned long long /2D/a2_ulong {21, 5} + real /2D/a2_float {21, 5} + double /2D/a2_double {21, 5} + complex /2D/a2_complex {21, 5} + double complex /2D/a2_double_complex {21, 5} + byte /3D/a3_byte {21, 5, 3} + short /3D/a3_short {21, 5, 3} + integer /3D/a3_int {21, 5, 3} + long long /3D/a3_long {21, 5, 3} + unsigned byte /3D/a3_ubyte {21, 5, 3} + unsigned short /3D/a3_ushort {21, 5, 3} + unsigned integer /3D/a3_uint {21, 5, 3} + unsigned long long /3D/a3_ulong {21, 5, 3} + real /3D/a3_float {21, 5, 3} + double /3D/a3_double {21, 5, 3} + complex /3D/a3_complex {21, 5, 3} + double complex /3D/a3_double_complex {21, 5, 3} + byte /6D/a6_byte {21, 5, 3, 2, 4, 9} + short /6D/a6_short {21, 5, 3, 2, 4, 9} + integer /6D/a6_int {21, 5, 3, 2, 4, 9} + long long /6D/a6_long {21, 5, 3, 2, 4, 9} + unsigned byte /6D/a6_ubyte {21, 5, 3, 2, 4, 9} + unsigned short /6D/a6_ushort {21, 5, 3, 2, 4, 9} + unsigned integer /6D/a6_uint {21, 5, 3, 2, 4, 9} + unsigned long long /6D/a6_ulong {21, 5, 3, 2, 4, 9} + real /6D/a6_float {21, 5, 3, 2, 4, 9} + double /6D/a6_double {21, 5, 3, 2, 4, 9} + complex /6D/a6_complex {21, 5, 3, 2, 4, 9} + double complex /6D/a6_double_complex {21, 5, 3, 2, 4, 9} diff --git a/tests/libs/adios/tests/suite/test.sh b/tests/libs/adios/tests/suite/test.sh new file mode 100755 index 0000000000..4e8342f499 --- /dev/null +++ b/tests/libs/adios/tests/suite/test.sh @@ -0,0 +1,172 @@ +#!/bin/bash +# +# Run this script in an interactive-job environment, with 16 cores at least. +# Define MPIRUN and NP_MPIRUN environment variables for running parallel programs +# like mpirun and -np or aprun and -n +# +# Run the script in the job directory with full path. +# +# Log output of each test can be found in ./log/ +# + +# default values +XXX=`which aprun &>/dev/null` +if [ $? == 0 ]; then + MPIRUN="aprun -q" + NP_MPIRUN=-n +else + MPIRUN=mpirun + NP_MPIRUN=-np +fi +KEEPOUTPUT=no +MAXPROCS=128 + +function add_transform_to_xmls() { + if [[ $TRANSFORM ]]; then + sed -i -e '/transform=/!s|\(|\1 transform="'$TRANSFORM'" />|' ./*.xml + fi +} +# Make this function accessible to child processes (i.e., the actual tests) +export -f add_transform_to_xmls + +EXEOPT="" + +function Usage() { + echo " +Usage: /`basename $0` [-m runcmd] [-n "-np"] [-p procs] [-h] [-k] + [pattern [pattern2 pattern3 ...]] + is used to find all the test codes, inputs and reference outputs. + codes and inputs will be copied to the job directory + pattern if given, only those tests are executed, that match + 'tests/**.sh'; otherwise all tests are executed. + e.g. arguments 1[0-3] attr global will execute all tests that + have any of the strings 10,11,12,13,attr or global in their name + (and end with .sh) + OPTIONS + -m runcmd command to start an MPI program. Default: $MPIRUN + -n runopt option to runcmd to specify number of cores. Default: $NP_MPIRUN + -p procs Run only those tests that use less up to 'procs' processes. + Default: $MAXPROCS + -k Do not remove logs and work dir of successful tests. + -t xform Run tests with transform 'xform' applied to all non-scalar variables + -e exeopt option to runcmd to specify executable. Default: empty. + BG/Q interactive jobs requires '--exe' before an executable. + -h Print this help. +" +} + +##################### +# Process arguments # +##################### + +# process option arguments +while getopts ":m:n:p:t:e:kh" Option +do + case $Option in + m) MPIRUN=$OPTARG;; + n) NP_MPIRUN=$OPTARG;; + p) MAXPROCS=$OPTARG;; + k) KEEPOUTPUT=yes;; + t) TRANSFORM=$OPTARG;; + e) EXEOPT=$OPTARG;; + h) Usage; exit 0;; + *) echo "Invalid option $Option"; Usage; exit 255;; # DEFAULT + esac +done +shift $(($OPTIND - 1)) + +# get source path +SRCDIR=`dirname $0` +TRUNKDISTANCE=../.. + +if [ "${SRCDIR:0:1}" != "/" ]; then + echo "WARNING: Jobs on some systems do not have access to any directory but to " + echo " parallel file systems. If the tests fail because of this, run this script" + echo " from a directory on the parallel file system and the script will copy the" + echo " data automatically." + echo " " +fi + +# check if Fortran codes were built +S=`grep BUILD_FORTRAN_TRUE $SRCDIR/$TRUNKDISTANCE/Makefile` +if [ -z ${S#BUILD_FORTRAN_TRUE = } ]; then + HAVE_FORTRAN=yes +else + echo "WARNING: Fortran binaries are not built, so test will not use them" + HAVE_FORTRAN=no +fi + +# Print info before running tests +echo "Settings:" +echo " Test source directory: $SRCDIR" +echo " Run command: $MPIRUN" +echo " Run command np option: $NP_MPIRUN" +echo " Max. processes to use: $MAXPROCS" +echo " Keep test output: $KEEPOUTPUT" +echo " Execute option: $EXEOPT" + +# find and list tests to be executed +TESTS= +if [ ! -z "$1" ]; then + while [ ! -z "$1" ]; do + TESTS1=`ls $SRCDIR/tests/*$1*.sh` + if [ -z "$TESTS1" ]; then + echo "ERROR: Did not find any test with name \"$1\" in $SRCDIR/tests." + else + TESTS="$TESTS $TESTS1" + fi + shift 1 + done + if [ -z "$TESTS" ]; then + exit 1 + fi + echo " Tests found: $TESTS" +else + TESTS=`ls $SRCDIR/tests/*.sh` + if [ -z "$TESTS" ]; then + echo "ERROR: Did not find any test in $SRCDIR/tests." + exit 1 + fi +fi + +echo "" +echo "Run tests" + +# run tests one by one +for TESTSCRIPT in $TESTS; do + TEST=`basename ${TESTSCRIPT%%.sh}` + echo -n " Test $TEST ... " + rm -rf log.$TEST work.$TEST + mkdir -p work.$TEST + pushd work.$TEST >/dev/null + if [ "${SRCDIR:0:1}" == "/" ]; then + TESTSRCDIR=$SRCDIR + TRUNKDIR=$SRCDIR/$TRUNKDISTANCE + else + # we are one level deeper now + TESTSRCDIR=../$SRCDIR + TRUNKDIR=../$SRCDIR/$TRUNKDISTANCE + TESTSCRIPT=../$TESTSCRIPT + fi + # Run the test script with setting the environment for it + MPIRUN="$MPIRUN" NP_MPIRUN="$NP_MPIRUN" HAVE_FORTRAN="$HAVE_FORTRAN" SRCDIR="$TESTSRCDIR" \ + TRUNKDIR="$TRUNKDIR" MAXPROCS="$MAXPROCS" \ + TRANSFORM="$TRANSFORM" \ + EXEOPT="$EXEOPT" \ + $TESTSCRIPT &> ../log.$TEST + EX=$? + popd >/dev/null + if [ $EX == 0 ]; then + echo "OK" + [ "$KEEPOUTPUT" == "no" ] && rm -rf work.$TEST log.$TEST + elif [ $EX == 77 ];then + echo "SKIP. Check log.$TEST for the reason" + [ "$KEEPOUTPUT" == "no" ] && rm -rf work.$TEST + else + echo "FAILED with exit code $EX. Check log.$TEST for details and work.$TEST/ for outputs." + fi +done + + + + diff --git a/tests/libs/adios/tests/suite/tests/01_scalars.sh b/tests/libs/adios/tests/suite/tests/01_scalars.sh new file mode 100755 index 0000000000..0bd2fec465 --- /dev/null +++ b/tests/libs/adios/tests/suite/tests/01_scalars.sh @@ -0,0 +1,108 @@ +#!/bin/bash +# +# Test if adios can write and read scalars correctly +# Uses codes from examples/C/scalars and examples/Fortran/scalars +# +# Environment variables set by caller: +# MPIRUN Run command +# NP_MPIRUN Run command's option to set number of processes +# MAXPROCS Max number of processes allowed +# HAVE_FORTRAN yes or no +# SRCDIR Test source dir (.. of this script) +# TRUNKDIR ADIOS trunk dir +# EXEOPT Run command's option to set executable + +PROCS=3 + +if [ $MAXPROCS -lt $PROCS ]; then + echo "WARNING: Needs $PROCS processes at least" + exit 77 # not failure, just skip +fi + +# copy codes and inputs to . +cp $TRUNKDIR/examples/C/scalars/scalars_read . +cp $TRUNKDIR/examples/C/scalars/scalars_write . +cp $TRUNKDIR/examples/C/scalars/scalars.xml . + +# Insert transform=X if requested by user +add_transform_to_xmls + +echo "Run C scalars_write" +echo $MPIRUN $NP_MPIRUN $PROCS $EXEOPT ./scalars_write +$MPIRUN $NP_MPIRUN $PROCS $EXEOPT ./scalars_write +EX=$? +if [ ! -f scalars.bp ]; then + echo "ERROR: C version of scalars_write failed. No BP file is created. Exit code=$EX" + exit 1 +fi + +echo "Check output with bpls" +$TRUNKDIR/utils/bpls/bpls -lav scalars.bp | grep -v -e endianness -e 'file size' > c_bpls.txt +diff -q c_bpls.txt $SRCDIR/reference/scalars_write_bpls.txt +if [ $? != 0 ]; then + echo "ERROR: C version of scalars_write produced a file different from the reference." + echo "Compare \"bpls -lav $PWD/scalars.bp | grep -v -e endianness -e 'file size'\" to reference $SRCDIR/reference/scalars_write_bpls.txt" + exit 1 +fi + +echo "Run C scalars_read" +$MPIRUN $NP_MPIRUN $PROCS $EXEOPT ./scalars_read > c_read.txt +EX=$? +if [ $? != 0 ]; then + echo "ERROR: C version of scalars_read failed with exit code $EX" + exit 1 +fi +diff -q c_read.txt $SRCDIR/reference/scalars_read_c.txt +if [ $? != 0 ]; then + echo "ERROR: C version of scalars_read produced an output different from the reference." + echo "Compare $PWD/c_read.txt reference $SRCDIR/reference/scalars_read_c.txt" + exit 1 +fi + + +if [ $HAVE_FORTRAN != yes ]; then + exit 0 +fi +# run the Fortran tests too if available + +mv scalars.xml scalars_c.xml +mv scalars.bp scalars_c.bp +cp $TRUNKDIR/examples/Fortran/scalars/scalars_read fortran_read +cp $TRUNKDIR/examples/Fortran/scalars/scalars_write fortran_write +cp $TRUNKDIR/examples/Fortran/scalars/scalars.xml . + +# Insert transform=X if requested by user +add_transform_to_xmls + +echo "Run Fortran scalar_write" +$MPIRUN $NP_MPIRUN $PROCS $EXEOPT ./fortran_write +EX=$? +if [ ! -f scalars.bp ]; then + echo "ERROR: Fortran version of scalars_write failed. No BP file is created. Exit code=$EX" + exit 1 +fi + +echo "Check output with bpls" +$TRUNKDIR/utils/bpls/bpls -lav scalars.bp | grep -v -e endianness -e 'file size' > f_bpls.txt +diff -q f_bpls.txt $SRCDIR/reference/scalars_write_bpls.txt +if [ $? != 0 ]; then + echo "ERROR: Fortran version of scalars_write produced a file different from the reference" + echo "Compare \"bpls -lav scalars.bp | grep -v -e endianness -e 'file size'\" to reference $SRCDIR/reference/scalars_write_bpls.txt" + exit 1 +fi + +echo "Run Fortran scalars_read" +$MPIRUN $NP_MPIRUN $PROCS $EXEOPT ./fortran_read > f_read.txt +EX=$? +if [ $? != 0 ]; then + echo "ERROR: Fortran version of scalars_read failed with exit code $EX" + exit 1 +fi +diff -q f_read.txt $SRCDIR/reference/scalars_read_f.txt +if [ $? != 0 ]; then + echo "ERROR: Fortran version of scalars_read produced an output different from the reference." + echo "Compare $PWD/f_read.txt reference $SRCDIR/reference/scalars_read_f.txt" + exit 1 +fi + + diff --git a/tests/libs/adios/tests/suite/tests/02_attributes.sh b/tests/libs/adios/tests/suite/tests/02_attributes.sh new file mode 100755 index 0000000000..7cb1204f9c --- /dev/null +++ b/tests/libs/adios/tests/suite/tests/02_attributes.sh @@ -0,0 +1,62 @@ +#!/bin/bash +# +# Test if adios can write and read attributes correctly +# Uses codes from examples/C/attributes +# +# Environment variables set by caller: +# MPIRUN Run command +# NP_MPIRUN Run commands option to set number of processes +# MAXPROCS Max number of processes allowed +# HAVE_FORTRAN yes or no +# SRCDIR Test source dir (.. of this script) +# TRUNKDIR ADIOS trunk dir + +PROCS=5 +READPROCS=2 + +if [ $MAXPROCS -lt $PROCS ]; then + echo "WARNING: Needs $PROCS processes at least" + exit 77 # not failure, just skip +fi + +# copy codes and inputs to . +cp $TRUNKDIR/examples/C/attributes/attributes_read . +cp $TRUNKDIR/examples/C/attributes/attributes_write . +cp $TRUNKDIR/examples/C/attributes/attributes.xml . + +# Insert transform=X if requested by user +add_transform_to_xmls + +echo "Run C attributes_write" +$MPIRUN $NP_MPIRUN $PROCS $EXEOPT ./attributes_write +EX=$? +if [ ! -f attributes.bp ]; then + echo "ERROR: C version of attributes_write failed. No BP file is created. Exit code=$EX" + exit 1 +fi + +echo "Check output with bpls" +$TRUNKDIR/utils/bpls/bpls -lav attributes.bp | grep -v -e endianness -e 'file size' > c_bpls.txt +diff -q c_bpls.txt $SRCDIR/reference/attributes_bpls.txt +if [ $? != 0 ]; then + echo "ERROR: C version of attributes_write produced a file different from the reference." + echo "Compare \"bpls -lav $PWD/attributes.bp | grep -v -e endianness -e 'file size'\" to reference $SRCDIR/reference/attributes_bpls.txt" + exit 1 +fi + +echo "Run C attributes_read" +$MPIRUN $NP_MPIRUN $READPROCS $EXEOPT ./attributes_read | sort > c_read.txt +EX=$? +if [ $? != 0 ]; then + echo "ERROR: C version of attributes_read failed with exit code $EX" + exit 1 +fi +echo "Check output" +diff -q c_read.txt $SRCDIR/reference/attributes_read.txt +if [ $? != 0 ]; then + echo "ERROR: C version of attributes_read produced an output different from the reference." + echo "Compare $PWD/c_read.txt reference $SRCDIR/reference/attributes_read.txt" + exit 1 +fi + + diff --git a/tests/libs/adios/tests/suite/tests/03_arrays.sh b/tests/libs/adios/tests/suite/tests/03_arrays.sh new file mode 100755 index 0000000000..fd8011c1c8 --- /dev/null +++ b/tests/libs/adios/tests/suite/tests/03_arrays.sh @@ -0,0 +1,61 @@ +#!/bin/bash +# +# Test if adios can write and read arrays correctly +# Uses codes from examples/C/arrays +# +# Environment variables set by caller: +# MPIRUN Run command +# NP_MPIRUN Run commands option to set number of processes +# MAXPROCS Max number of processes allowed +# HAVE_FORTRAN yes or no +# SRCDIR Test source dir (.. of this script) +# TRUNKDIR ADIOS trunk dir + +PROCS=5 + +if [ $MAXPROCS -lt $PROCS ]; then + echo "WARNING: Needs $PROCS processes at least" + exit 77 # not failure, just skip +fi + +# copy codes and inputs to . +cp $TRUNKDIR/examples/C/arrays/arrays_read . +cp $TRUNKDIR/examples/C/arrays/arrays_write . +cp $TRUNKDIR/examples/C/arrays/arrays.xml . + +# Insert transform=X if requested by user +add_transform_to_xmls + +echo "Run C arrays_write" +$MPIRUN $NP_MPIRUN $PROCS $EXEOPT ./arrays_write +EX=$? +if [ ! -f arrays.bp ]; then + echo "ERROR: C version of arrays_write failed. No BP file is created. Exit code=$EX" + exit 1 +fi + +echo "Check output with bpls" +$TRUNKDIR/utils/bpls/bpls -lav arrays.bp | grep -v -e endianness -e 'file size' > c_bpls.txt +diff -q c_bpls.txt $SRCDIR/reference/arrays_bpls.txt +if [ $? != 0 ]; then + echo "ERROR: C version of arrays_write produced a file different from the reference." + echo "Compare \"bpls -lav $PWD/arrays.bp | grep -v -e endianness -e 'file size'\" to reference $SRCDIR/reference/arrays_bpls.txt" + exit 1 +fi + +echo "Run C arrays_read" +$MPIRUN $NP_MPIRUN $PROCS $EXEOPT ./arrays_read | sort > c_read.txt +EX=$? +if [ $? != 0 ]; then + echo "ERROR: C version of arrays_read failed with exit code $EX" + exit 1 +fi +echo "Check output" +diff -q c_read.txt $SRCDIR/reference/arrays_read.txt +if [ $? != 0 ]; then + echo "ERROR: C version of arrays_read produced an output different from the reference." + echo "Compare $PWD/c_read.txt reference $SRCDIR/reference/arrays_read.txt" + exit 1 +fi + + diff --git a/tests/libs/adios/tests/suite/tests/04_global_array.sh b/tests/libs/adios/tests/suite/tests/04_global_array.sh new file mode 100755 index 0000000000..3398d45c63 --- /dev/null +++ b/tests/libs/adios/tests/suite/tests/04_global_array.sh @@ -0,0 +1,95 @@ +#!/bin/bash +# +# Test if adios can write and read global arrays over time correctly +# Uses codes from examples/C/global-array and examples/Fortran/global-array +# +# Environment variables set by caller: +# MPIRUN Run command +# NP_MPIRUN Run commands option to set number of processes +# MAXPROCS Max number of processes allowed +# HAVE_FORTRAN yes or no +# SRCDIR Test source dir (.. of this script) +# TRUNKDIR ADIOS trunk dir + +PROCS=7 +READPROCS=3 + +if [ $MAXPROCS -lt $PROCS ]; then + echo "WARNING: Needs $PROCS processes at least" + exit 77 # not failure, just skip +fi + +# copy codes and inputs to . +cp $TRUNKDIR/examples/C/global-array/adios_global . +cp $TRUNKDIR/examples/C/global-array/adios_read_global . +cp $TRUNKDIR/examples/C/global-array/adios_global.xml . + +# Insert transform=X if requested by user +add_transform_to_xmls + +echo "Run C adios_global" +$MPIRUN $NP_MPIRUN $PROCS $EXEOPT ./adios_global +EX=$? +if [ ! -f adios_global.bp ]; then + echo "ERROR: C version of adios_global failed. No BP file is created. Exit code=$EX" + exit 1 +fi + +echo "Check output with bpls" +$TRUNKDIR/utils/bpls/bpls -la adios_global.bp -d -n 10 | grep -v -e endianness -e 'file size' > c_bpls.txt +diff -q c_bpls.txt $SRCDIR/reference/global_array_bpls.txt +if [ $? != 0 ]; then + echo "ERROR: C version of adios_global produced a file different from the reference." + echo "Compare \"bpls -la $PWD/adios_global.bp -d -n 10 | grep -v -e endianness -e 'file size'\" to reference $SRCDIR/reference/global_array_bpls.txt" + exit 1 +fi + +echo "Run C adios_read_global" +$MPIRUN $NP_MPIRUN $READPROCS $EXEOPT ./adios_read_global | sort > c_read.txt +EX=$? +if [ $? != 0 ]; then + echo "ERROR: C version of adios_read_global exited with $EX" + echo "Check $PWD/c_read.txt" + exit 1 +fi + +echo "Check output" +diff -q c_read.txt $SRCDIR/reference/global_array_read.txt +if [ $? != 0 ]; then + echo "ERROR: C version of adios_read_global produced a file different from the reference." + echo "$PWD/c_read.txt to reference $SRCDIR/reference/global_array_read.txt" + exit 1 +fi + + +if [ $HAVE_FORTRAN != yes ]; then + exit 0 +fi +# run the Fortran tests too if available + +mv adios_global.xml adios_global_c.xml +mv adios_global.bp adios_global_c.bp +cp $TRUNKDIR/examples/Fortran/global-array/adios_global adios_global_f +cp $TRUNKDIR/examples/Fortran/global-array/adios_global.xml . + +# Insert transform=X if requested by user +add_transform_to_xmls + +echo "Run Fortran adios_global_f" +$MPIRUN $NP_MPIRUN $PROCS $EXEOPT ./adios_global_f +EX=$? +if [ ! -f adios_global.bp ]; then + echo "ERROR: Fortran version of adios_global failed. No BP file is created. Exit code=$EX" + exit 1 +fi + +echo "Check output with bpls" +$TRUNKDIR/utils/bpls/bpls -la adios_global.bp -d -n 10 | grep -v -e endianness -e 'file size' > f_bpls.txt +diff -q f_bpls.txt $SRCDIR/reference/global_array_bpls.txt +if [ $? != 0 ]; then + echo "ERROR: Fortran version of adios_global produced a file different from the reference." + echo "Compare \"bpls -lav $PWD/adios_global.bp -d -n 10 | grep -v -e endianness -e 'file size'\" to reference $SRCDIR/reference/global_array_bpls.txt" + exit 1 +fi + + diff --git a/tests/libs/adios/tests/suite/tests/05_global_array_time.sh b/tests/libs/adios/tests/suite/tests/05_global_array_time.sh new file mode 100755 index 0000000000..7e37b085a3 --- /dev/null +++ b/tests/libs/adios/tests/suite/tests/05_global_array_time.sh @@ -0,0 +1,93 @@ +#!/bin/bash +# +# Test if adios can write and read global arrays over time correctly +# Uses codes from examples/C/global-array-time and examples/Fortran/global-array-time +# +# Environment variables set by caller: +# MPIRUN Run command +# NP_MPIRUN Run commands option to set number of processes +# MAXPROCS Max number of processes allowed +# HAVE_FORTRAN yes or no +# SRCDIR Test source dir (.. of this script) +# TRUNKDIR ADIOS trunk dir + +PROCS=9 + +if [ $MAXPROCS -lt $PROCS ]; then + echo "WARNING: Needs $PROCS processes at least" + exit 77 # not failure, just skip +fi + +# copy codes and inputs to . +cp $TRUNKDIR/examples/C/global-array-time/adios_globaltime . +cp $TRUNKDIR/examples/C/global-array-time/adios_read_globaltime . +cp $TRUNKDIR/examples/C/global-array-time/adios_globaltime.xml . + +# Insert transform=X if requested by user +add_transform_to_xmls + +echo "Run C adios_globaltime" +$MPIRUN $NP_MPIRUN $PROCS $EXEOPT ./adios_globaltime +EX=$? +if [ ! -f adios_globaltime.bp ]; then + echo "ERROR: C version of adios_globaltime failed. No BP file is created. Exit code=$EX" + exit 1 +fi + +echo "Check output with bpls" +$TRUNKDIR/utils/bpls/bpls -la adios_globaltime.bp | grep -v -e endianness -e 'file size' > c_bpls.txt +diff -q c_bpls.txt $SRCDIR/reference/global_array_time_bpls.txt +if [ $? != 0 ]; then + echo "ERROR: C version of adios_globaltime produced a file different from the reference." + echo "Compare \"bpls -la $PWD/adios_globaltime.bp | grep -v -e endianness -e 'file size'\" to reference $SRCDIR/reference/global_array_time_bpls.txt" +fi + +echo "Run C adios_read_globaltime" +$MPIRUN $NP_MPIRUN $PROCS $EXEOPT ./adios_read_globaltime > c_read.txt +EX=$? +if [ $? != 0 ]; then + echo "ERROR: C version of adios_read_globaltime exited with $EX" + echo "Check $PWD/c_read.txt" + exit 1 +fi + +echo "Check output" +diff -q c_read.txt $SRCDIR/reference/global_array_time_read.txt +if [ $? != 0 ]; then + echo "ERROR: C version of adios_read_globaltime produced a file different from the reference." + echo "$PWD/c_read.txt to reference $SRCDIR/reference/global_array_time_read.txt" + exit 1 +fi + + +if [ $HAVE_FORTRAN != yes ]; then + exit 0 +fi +# run the Fortran tests too if available + +mv adios_globaltime.xml adios_globaltime_c.xml +mv adios_globaltime.bp adios_globaltime_c.bp +cp $TRUNKDIR/examples/Fortran/global-array-time/adios_globaltime adios_globaltime_f +cp $TRUNKDIR/examples/Fortran/global-array-time/adios_globaltime.xml . + +# Insert transform=X if requested by user +add_transform_to_xmls + +echo "Run Fortran adios_globaltime_f" +$MPIRUN $NP_MPIRUN $PROCS $EXEOPT ./adios_globaltime_f +EX=$? +if [ ! -f adios_globaltime.bp ]; then + echo "ERROR: Fortran version of adios_globaltime failed. No BP file is created. Exit code=$EX" + exit 1 +fi + +echo "Check output with bpls" +$TRUNKDIR/utils/bpls/bpls -la adios_globaltime.bp | grep -v -e endianness -e 'file size' > f_bpls.txt +diff -q f_bpls.txt $SRCDIR/reference/global_array_time_bpls.txt +if [ $? != 0 ]; then + echo "ERROR: Fortran version of adios_globaltime produced a file different from the reference." + echo "Compare \"bpls -la $PWD/adios_globaltime.bp | grep -v -e endianness -e 'file size'\" to reference $SRCDIR/reference/global_array_time_bpls.txt" + exit 1 +fi + + diff --git a/tests/libs/adios/tests/suite/tests/06_posix_method.sh b/tests/libs/adios/tests/suite/tests/06_posix_method.sh new file mode 100755 index 0000000000..25dd67f1e7 --- /dev/null +++ b/tests/libs/adios/tests/suite/tests/06_posix_method.sh @@ -0,0 +1,59 @@ +#!/bin/bash +# +# Test if adios POSIX method +# Uses codes from SRCDIR/programs/posix_method +# +# Environment variables set by caller: +# MPIRUN Run command +# NP_MPIRUN Run commands option to set number of processes +# MAXPROCS Max number of processes allowed +# HAVE_FORTRAN yes or no +# SRCDIR Test source dir (.. of this script) +# TRUNKDIR ADIOS trunk dir + +PROCS=3 + +if [ $MAXPROCS -lt $PROCS ]; then + echo "WARNING: Needs $PROCS processes at least" + exit 77 # not failure, just skip +fi + +if [ "$HAVE_FORTRAN" != "yes" ]; then + echo "Fortran is not available for this ADIOS build. This tests wants to use a Fortran90 code." + exit 77 +fi + +# copy codes and inputs to . +cp $SRCDIR/programs/posix_method . +cp $SRCDIR/programs/posix_method.xml . + +# Insert transform=X if requested by user +add_transform_to_xmls + +echo "Run posix_method" +$MPIRUN $NP_MPIRUN $PROCS $EXEOPT ./posix_method +EX=$? +if [ $EX != 0 ]; then + echo "ERROR: posix method failed with exit code=$EX" + exit $EX +fi + +if [ ! -f posix_method.bp ]; then + echo "ERROR: posix_method failed. No BP file posix_method.bp was created." + exit 1 +fi + +if [ ! -d posix_method.bp.dir ]; then + echo "ERROR: posix_method failed. No BP subfile directory posix_method.bp.dir was created." + exit 1 +fi + +for ((i=0; i<$PROCS; i++)); do + if [ ! -f posix_method.bp.dir/posix_method.bp.$i ]; then + echo "ERROR: posix_method failed. No BP subfile posix_method.bp.dir/posix_method.bp.$i was created." + exit 1 + fi +done + + + diff --git a/tests/libs/adios/tests/suite/tests/07_global_array_no_xml.sh b/tests/libs/adios/tests/suite/tests/07_global_array_no_xml.sh new file mode 100755 index 0000000000..e8b3125d07 --- /dev/null +++ b/tests/libs/adios/tests/suite/tests/07_global_array_no_xml.sh @@ -0,0 +1,92 @@ +#!/bin/bash +# +# Test if adios can write and read global arrays over time correctly +# Uses codes from examples/C/global-array and examples/Fortran/global-array +# +# Environment variables set by caller: +# MPIRUN Run command +# NP_MPIRUN Run commands option to set number of processes +# MAXPROCS Max number of processes allowed +# HAVE_FORTRAN yes or no +# SRCDIR Test source dir (.. of this script) +# TRUNKDIR ADIOS trunk dir + +PROCS=7 +READPROCS=3 + +if [ $MAXPROCS -lt $PROCS ]; then + echo "WARNING: Needs $PROCS processes at least" + exit 77 # not failure, just skip +fi + +# copy codes and inputs to . +cp $TRUNKDIR/examples/C/global-array/adios_global_no_xml . +cp $TRUNKDIR/examples/C/global-array/adios_read_global_no_xml . + +echo "Run C adios_global_no_xml" +ls -l ./adios_global_no_xml +echo $MPIRUN $NP_MPIRUN $PROCS $EXEOPT ./adios_global_no_xml +$MPIRUN $NP_MPIRUN $PROCS $EXEOPT ./adios_global_no_xml +EX=$? +if [ ! -f adios_global_no_xml.bp ]; then + echo "ERROR: C version of adios_global_no_xml failed. No BP file is created. Exit code=$EX" + exit 1 +fi + +echo "Check output with bpls" +$TRUNKDIR/utils/bpls/bpls -lav adios_global_no_xml.bp -d -n 10 | grep -v -e endianness -e 'file size' > c_bpls.txt +diff -q c_bpls.txt $SRCDIR/reference/global_array_no_xml_bpls.txt +if [ $? != 0 ]; then + echo "ERROR: C version of adios_global_no_xml produced a file different from the reference." + echo "Compare \"bpls -lav $PWD/adios_global_no_xml.bp -d -n 10 | grep -v -e endianness -e 'file size'\" to reference $SRCDIR/reference/global_array_no_xml_bpls.txt" + exit 1 +fi + +echo "Run C adios_read_global_no_xml" +$MPIRUN $NP_MPIRUN $READPROCS $EXEOPT ./adios_read_global_no_xml > c_read.txt +EX=$? +if [ $? != 0 ]; then + echo "ERROR: C version of adios_read_global_no_xml exited with $EX" + echo "Check $PWD/c_read.txt" + exit 1 +fi + +echo "Check output" +diff -q c_read.txt $SRCDIR/reference/global_array_no_xml_read.txt +if [ $? != 0 ]; then + echo "ERROR: C version of adios_read_global produced a file different from the reference." + echo "$PWD/c_read.txt to reference $SRCDIR/reference/global_array_no_xml_read.txt" + exit 1 +fi + + +if [ $HAVE_FORTRAN != yes ]; then + exit 0 +fi +# run the Fortran tests too if available + +mv adios_global_no_xml.bp adios_global_no_xml_c.bp +cp $TRUNKDIR/examples/Fortran/global-array/adios_global_no_xml adios_global_f +cp $TRUNKDIR/examples/Fortran/global-array/adios_global.xml . + +# Insert transform=X if requested by user +add_transform_to_xmls + +echo "Run Fortran adios_global_f" +$MPIRUN $NP_MPIRUN $PROCS $EXEOPT ./adios_global_f +EX=$? +if [ ! -f adios_global_no_xml.bp ]; then + echo "ERROR: Fortran version of adios_global failed. No BP file is created. Exit code=$EX" + exit 1 +fi + +echo "Check output with bpls" +$TRUNKDIR/utils/bpls/bpls -lav adios_global_no_xml.bp -d -n 10 | grep -v -e endianness -e 'file size' > f_bpls.txt +diff -q f_bpls.txt $SRCDIR/reference/global_array_no_xml_f_bpls.txt +if [ $? != 0 ]; then + echo "ERROR: Fortran version of adios_global produced a file different from the reference." + echo "Compare \"bpls -lav $PWD/adios_global_no_xml.bp -d -n 10 | grep -v -e endianness -e 'file size'\" to reference $SRCDIR/reference/global_array_no_xml_f_bpls.txt" + exit 1 +fi + + diff --git a/tests/libs/adios/tests/suite/tests/08_amr_write_read.sh b/tests/libs/adios/tests/suite/tests/08_amr_write_read.sh new file mode 100755 index 0000000000..76d3d8b038 --- /dev/null +++ b/tests/libs/adios/tests/suite/tests/08_amr_write_read.sh @@ -0,0 +1,78 @@ +#!/bin/bash +# +# Test if staged read method functions correctly +# +# Environment variables set by caller: +# MPIRUN Run command +# NP_MPIRUN Run commands option to set number of processes +# MAXPROCS Max number of processes allowed +# HAVE_FORTRAN yes or no +# SRCDIR Test source dir (.. of this script) +# TRUNKDIR ADIOS trunk dir + +PROCS=32 +READPROCS=4 + +if [ $MAXPROCS -lt $PROCS ]; then + echo "WARNING: Needs $PROCS processes at least" + exit 77 # not failure, just skip +fi + +# copy codes and inputs to . +cp $SRCDIR/programs/adios_amr_write . +cp $SRCDIR/programs/adios_amr_write.xml . +cp $SRCDIR/programs/adios_staged_read . +cp $SRCDIR/programs/adios_staged_read_v2 . + +# Insert transform=X if requested by user +add_transform_to_xmls + +for ((m=1; m <= 2 ; m++)) +do + echo "Run C adios_amr_write" + ls -l ./adios_amr_write + echo $MPIRUN $NP_MPIRUN $PROCS $EXEOPT ./adios_amr_write $m + rm -f *.bp + $MPIRUN $NP_MPIRUN $PROCS $EXEOPT ./adios_amr_write $m + EX=$? + ls -l ./adios_amr_write.bp + if [ ! -f adios_amr_write.bp ]; then + echo "ERROR: C version of adios_amr_write failed. No BP file is created. Exit code=$EX" + exit 1 + fi + + echo "Run C adios_staged_read" + ls -l ./adios_staged_read + export num_aggregators=2 + export chunk_size=64 + for ((n=1; n <= 5 ; n++)) + do + echo $MPIRUN $NP_MPIRUN $READPROCS $EXEOPT ./adios_staged_read $n + $MPIRUN $NP_MPIRUN $READPROCS $EXEOPT ./adios_staged_read $n| grep -v aggregator | grep [0-9] > 08_amr_write_read_$n.txt + EX=$? + echo "Check output with reference" + diff -q 08_amr_write_read_$n.txt $SRCDIR/reference/amr_write_read_$n.txt + if [ $? != 0 ]; then + echo "ERROR: C version of adios_staged_read produced data different from the reference." + exit 1 + fi + done + + echo "Run C adios_staged_read_v2" + ls -l ./adios_staged_read_v2 + export num_aggregators=2 + export chunk_size=64 + for ((n=1; n <= 5 ; n++)) + do + echo $MPIRUN $NP_MPIRUN $READPROCS $EXEOPT ./adios_staged_read_v2 $n + $MPIRUN $NP_MPIRUN $READPROCS $EXEOPT ./adios_staged_read_v2 $n| grep -v aggregator | grep [0-9] > 08_amr_write_read_$n.txt + EX=$? + echo "Check output with reference" + diff -q 08_amr_write_read_$n.txt $SRCDIR/reference/amr_write_read_$n.txt + if [ $? != 0 ]; then + echo "ERROR: C version of adios_staged_read_v2 produced data different from the reference." + exit 1 + fi + done + +done diff --git a/tests/libs/adios/tests/suite/tests/09_amr_write_read_2vars.sh b/tests/libs/adios/tests/suite/tests/09_amr_write_read_2vars.sh new file mode 100755 index 0000000000..5147a13d03 --- /dev/null +++ b/tests/libs/adios/tests/suite/tests/09_amr_write_read_2vars.sh @@ -0,0 +1,60 @@ +#!/bin/bash +# +# Test if staged read method functions correctly +# +# Environment variables set by caller: +# MPIRUN Run command +# NP_MPIRUN Run commands option to set number of processes +# MAXPROCS Max number of processes allowed +# HAVE_FORTRAN yes or no +# SRCDIR Test source dir (.. of this script) +# TRUNKDIR ADIOS trunk dir + +PROCS=32 +READPROCS=4 + +if [ $MAXPROCS -lt $PROCS ]; then + echo "WARNING: Needs $PROCS processes at least" + exit 77 # not failure, just skip +fi + +# copy codes and inputs to . +cp $SRCDIR/programs/adios_amr_write_2vars . +cp $SRCDIR/programs/adios_amr_write_2vars.xml . +cp $SRCDIR/programs/adios_staged_read_2vars . + +# Insert transform=X if requested by user +add_transform_to_xmls + +for ((m=1; m <= 2 ; m++)) +do + echo "Run C adios_amr_write_2vars" + ls -l ./adios_amr_write_2vars + echo $MPIRUN $NP_MPIRUN $PROCS $EXEOPT ./adios_amr_write_2vars $m + rm -f *.bp + $MPIRUN $NP_MPIRUN $PROCS $EXEOPT ./adios_amr_write_2vars $m + EX=$? + ls -l ./adios_amr_write_2vars.bp + if [ ! -f adios_amr_write_2vars.bp ]; then + echo "ERROR: C version of adios_amr_write_2vars failed. No BP file is created. Exit code=$EX" + exit 1 + fi + + echo "Run C adios_staged_read_2vars" + ls -l ./adios_staged_read_2vars + export num_aggregators=2 + export chunk_size=64 + for ((n=1; n <= 5 ; n++)) + do + echo $MPIRUN $NP_MPIRUN $READPROCS $EXEOPT ./adios_staged_read_2vars $n + $MPIRUN $NP_MPIRUN $READPROCS $EXEOPT ./adios_staged_read_2vars $n| grep -v aggregator | grep [0-9] > 09_amr_write_read_$n.txt + EX=$? + echo "Check output with reference" + diff -q 09_amr_write_read_$n.txt $SRCDIR/reference/amr_write_read_2vars_$n.txt + if [ $? != 0 ]; then + echo "ERROR: C version of adios_staged_read_2vars produced data different from the reference." + exit 1 + fi + done + +done diff --git a/tests/libs/adios/tests/suite/tests/10_write_read.sh b/tests/libs/adios/tests/suite/tests/10_write_read.sh new file mode 100755 index 0000000000..50ddda783b --- /dev/null +++ b/tests/libs/adios/tests/suite/tests/10_write_read.sh @@ -0,0 +1,61 @@ +#!/bin/bash +# +# Test if adios can write-read-write-read correctly +# Uses ../programs/write_read +# +# Environment variables set by caller: +# MPIRUN Run command +# NP_MPIRUN Run commands option to set number of processes +# MAXPROCS Max number of processes allowed +# HAVE_FORTRAN yes or no +# SRCDIR Test source dir (.. of this script) +# TRUNKDIR ADIOS trunk dir + +PROCS=3 + +if [ $MAXPROCS -lt $PROCS ]; then + echo "WARNING: Needs $PROCS processes at least" + exit 77 # not failure, just skip +fi + +# copy codes and inputs to . +cp $SRCDIR/programs/write_read . +cp $SRCDIR/programs/write_read.xml . + +# Insert transform=X if requested by user +add_transform_to_xmls + +echo "Run write_read" +$MPIRUN $NP_MPIRUN $PROCS $EXEOPT ./write_read +EX=$? +if [ ! -f write_read_1.bp ]; then + echo "ERROR: write_read failed at creating the 1st BP file, write_read_1.bp. Exit code=$EX" + exit 1 +fi + +if [ ! -f write_read_2.bp ]; then + echo "ERROR: write_read failed at creating the 2nd BP file, write_read_2.bp. Exit code=$EX" + exit 1 +fi + +if [ $EX != 0 ]; then + echo "ERROR: write_read failed with exit code=$EX" + exit 1 +fi + +echo "Check output with bpls" +$TRUNKDIR/utils/bpls/bpls write_read_1.bp > c_bpls1.txt +diff -q c_bpls1.txt $SRCDIR/reference/write_read_bpls.txt +if [ $? != 0 ]; then + echo "ERROR: C version of write_read produced a file different from the reference." + echo "Compare \"bpls $PWD/write_read_1.bp\" to reference $SRCDIR/reference/write_read_bpls.txt" + exit 1 +fi + +$TRUNKDIR/utils/bpls/bpls write_read_2.bp > c_bpls2.txt +diff -q c_bpls2.txt c_bpls1.txt +if [ $? != 0 ]; then + echo "ERROR: C version of write_read produced two different files in two steps. They should have the same list of variables" + echo "Compare \"bpls $PWD/write_read_1.bp\" to \"bpls $PWD/write_read_2.bp\"" + exit 1 +fi diff --git a/tests/libs/adios/tests/suite/tests/11_write_alternate.sh b/tests/libs/adios/tests/suite/tests/11_write_alternate.sh new file mode 100755 index 0000000000..a3d2b7a723 --- /dev/null +++ b/tests/libs/adios/tests/suite/tests/11_write_alternate.sh @@ -0,0 +1,41 @@ +#!/bin/bash +# +# Test if adios can write variables alternating in multiple steps +# and then it can read them correctly +# Uses ../programs/write_alternate +# +# Environment variables set by caller: +# MPIRUN Run command +# NP_MPIRUN Run commands option to set number of processes +# MAXPROCS Max number of processes allowed +# HAVE_FORTRAN yes or no +# SRCDIR Test source dir (.. of this script) +# TRUNKDIR ADIOS trunk dir + +PROCS=2 + +if [ $MAXPROCS -lt $PROCS ]; then + echo "WARNING: Needs $PROCS processes at least" + exit 77 # not failure, just skip +fi + +# copy codes and inputs to . +cp $SRCDIR/programs/write_alternate . +cp $SRCDIR/programs/write_alternate.xml . + +# Insert transform=X if requested by user +add_transform_to_xmls + +echo "Run write_alternate" +$MPIRUN $NP_MPIRUN $PROCS $EXEOPT ./write_alternate +EX=$? +if [ ! -f write_alternate.bp ]; then + echo "ERROR: write_alternate failed at creating the BP file, write_alternate.bp. Exit code=$EX" + exit 1 +fi + +if [ $EX != 0 ]; then + echo "ERROR: write_alternate failed with exit code=$EX" + exit 1 +fi + diff --git a/tests/libs/adios/tests/suite/tests/12_selections.sh b/tests/libs/adios/tests/suite/tests/12_selections.sh new file mode 100755 index 0000000000..61b00f5d26 --- /dev/null +++ b/tests/libs/adios/tests/suite/tests/12_selections.sh @@ -0,0 +1,36 @@ +#!/bin/bash +# +# Test if adios can read data with points selection +# Uses ../programs/selections +# +# Environment variables set by caller: +# MPIRUN Run command +# NP_MPIRUN Run commands option to set number of processes +# MAXPROCS Max number of processes allowed +# HAVE_FORTRAN yes or no +# SRCDIR Test source dir (.. of this script) +# TRUNKDIR ADIOS trunk dir + +PROCS=1 + +if [ $MAXPROCS -lt $PROCS ]; then + echo "WARNING: Needs $PROCS processes at least" + exit 77 # not failure, just skip +fi + +# copy codes and inputs to . +cp $SRCDIR/programs/selections . + +echo "Run selections" +$MPIRUN $NP_MPIRUN $PROCS $EXEOPT ./selections +EX=$? +if [ ! -f selections.bp ]; then + echo "ERROR: selections failed at creating the BP file, selections.bp. Exit code=$EX" + exit 1 +fi + +if [ $EX != 0 ]; then + echo "ERROR: selections failed with exit code=$EX" + exit 1 +fi + diff --git a/tests/libs/adios/tests/suite/tests/13_write_byid.sh b/tests/libs/adios/tests/suite/tests/13_write_byid.sh new file mode 100755 index 0000000000..e12e6f5ef1 --- /dev/null +++ b/tests/libs/adios/tests/suite/tests/13_write_byid.sh @@ -0,0 +1,88 @@ +#!/bin/bash +# +# Test if adios can write and read global arrays over time correctly +# Uses codes from examples/C/global-array and examples/Fortran/global-array +# +# Environment variables set by caller: +# MPIRUN Run command +# NP_MPIRUN Run commands option to set number of processes +# MAXPROCS Max number of processes allowed +# HAVE_FORTRAN yes or no +# SRCDIR Test source dir (.. of this script) +# TRUNKDIR ADIOS trunk dir + +PROCS=7 +READPROCS=3 + +if [ $MAXPROCS -lt $PROCS ]; then + echo "WARNING: Needs $PROCS processes at least" + exit 77 # not failure, just skip +fi + +# copy codes and inputs to . +cp $TRUNKDIR/examples/C/global-array/no_xml_write_byid . +cp $TRUNKDIR/examples/C/global-array/read_no_xml_write_byid . + +echo "Run C no_xml_write_byid" +ls -l ./no_xml_write_byid +echo $MPIRUN $NP_MPIRUN $PROCS $EXEOPT ./no_xml_write_byid +$MPIRUN $NP_MPIRUN $PROCS $EXEOPT ./no_xml_write_byid +EX=$? +if [ ! -f no_xml_write_byid.bp ]; then + echo "ERROR: C version of no_xml_write_byid failed. No BP file is created. Exit code=$EX" + exit 1 +fi + +echo "Check output with bpls" +$TRUNKDIR/utils/bpls/bpls -lav no_xml_write_byid.bp -d -n 10 | grep -v -e endianness -e 'file size' > c_bpls.txt +diff -q c_bpls.txt $SRCDIR/reference/no_xml_write_byid_bpls.txt +if [ $? != 0 ]; then + echo "ERROR: C version of no_xml_write_byid produced a file different from the reference." + echo "Compare \"bpls -lav $PWD/no_xml_write_byid.bp -d -n 10 | grep -v -e endianness -e 'file size'\" to reference $SRCDIR/reference/no_xml_write_byid_bpls.txt" + exit 1 +fi + +echo "Run C read_no_xml_write_byid" +$MPIRUN $NP_MPIRUN $READPROCS $EXEOPT ./read_no_xml_write_byid > c_read.txt +EX=$? +if [ $? != 0 ]; then + echo "ERROR: C version of read_no_xml_write_byid exited with $EX" + echo "Check $PWD/c_read.txt" + exit 1 +fi + +echo "Check output" +diff -q c_read.txt $SRCDIR/reference/no_xml_write_byid_read.txt +if [ $? != 0 ]; then + echo "ERROR: C version of read_no_xml_write_byid produced a file different from the reference." + echo "$PWD/c_read.txt to reference $SRCDIR/reference/no_xml_write_byid_read.txt" + exit 1 +fi + + +if [ $HAVE_FORTRAN != yes ]; then + exit 0 +fi +# run the Fortran tests too if available + +mv no_xml_write_byid.bp no_xml_write_byid_c.bp +cp $TRUNKDIR/examples/Fortran/global-array/no_xml_write_byid no_xml_write_byid_f + +echo "Run Fortran no_xml_write_byid" +$MPIRUN $NP_MPIRUN $PROCS $EXEOPT ./no_xml_write_byid_f +EX=$? +if [ ! -f no_xml_write_byid.bp ]; then + echo "ERROR: Fortran version of no_xml_write_byid failed. No BP file is created. Exit code=$EX" + exit 1 +fi + +echo "Check output with bpls" +$TRUNKDIR/utils/bpls/bpls -lav no_xml_write_byid.bp -d -n 10 | grep -v -e endianness -e 'file size' > f_bpls.txt +diff -q f_bpls.txt $SRCDIR/reference/no_xml_write_byid_f_bpls.txt +if [ $? != 0 ]; then + echo "ERROR: Fortran version of no_xml_write_byid produced a file different from the reference." + echo "Compare \"bpls -lav $PWD/no_xml_write_byid.bp -d -n 10 | grep -v -e endianness -e 'file size'\" to reference $SRCDIR/reference/no_xml_write_byid_f_bpls.txt" + exit 1 +fi + + diff --git a/tests/libs/adios/tests/suite/tests/14_pathtest.sh b/tests/libs/adios/tests/suite/tests/14_pathtest.sh new file mode 100755 index 0000000000..e8dcb12699 --- /dev/null +++ b/tests/libs/adios/tests/suite/tests/14_pathtest.sh @@ -0,0 +1,45 @@ +#!/bin/bash +# +# Test different path+name combinations in ADIOS xml +# Uses ../programs/path_test +# +# Environment variables set by caller: +# MPIRUN Run command +# NP_MPIRUN Run commands option to set number of processes +# MAXPROCS Max number of processes allowed +# HAVE_FORTRAN yes or no +# SRCDIR Test source dir (.. of this script) +# TRUNKDIR ADIOS trunk dir + +PROCS=1 + +if [ $MAXPROCS -lt $PROCS ]; then + echo "WARNING: Needs $PROCS processes at least" + exit 77 # not failure, just skip +fi + +# copy codes and inputs to . +cp $SRCDIR/programs/path_test . +cp $SRCDIR/programs/path_test.xml . + +# Insert transform=X if requested by user +add_transform_to_xmls + +echo "Run path_test" +$MPIRUN $NP_MPIRUN $PROCS $EXEOPT ./path_test +EX=$? +if [ ! -f path_test_1.bp ]; then + echo "ERROR: path_test failed at creating the BP file, path_test_1.bp. Exit code=$EX" + exit 1 +fi + +if [ ! -f path_test_2.bp ]; then + echo "ERROR: path_test failed at creating the BP file, path_test_2.bp. Exit code=$EX" + exit 1 +fi + +if [ $EX != 0 ]; then + echo "ERROR: path_test failed with exit code=$EX" + exit 1 +fi + diff --git a/tests/libs/adios/tests/suite/tests/15_reuse_dim.sh b/tests/libs/adios/tests/suite/tests/15_reuse_dim.sh new file mode 100755 index 0000000000..67202ac56e --- /dev/null +++ b/tests/libs/adios/tests/suite/tests/15_reuse_dim.sh @@ -0,0 +1,36 @@ +#!/bin/bash +# +# Test using one dimension scalar twice with different values for two arrays +# Uses ../programs/reuse_dim +# +# Environment variables set by caller: +# MPIRUN Run command +# NP_MPIRUN Run commands option to set number of processes +# MAXPROCS Max number of processes allowed +# HAVE_FORTRAN yes or no +# SRCDIR Test source dir (.. of this script) +# TRUNKDIR ADIOS trunk dir + +PROCS=1 + +if [ $MAXPROCS -lt $PROCS ]; then + echo "WARNING: Needs $PROCS processes at least" + exit 77 # not failure, just skip +fi + +# copy codes and inputs to . +cp $SRCDIR/programs/reuse_dim . + +echo "Run reuse_dim" +$MPIRUN $NP_MPIRUN $PROCS $EXEOPT ./reuse_dim +EX=$? +if [ ! -f reuse_dim.bp ]; then + echo "ERROR: reuse_dim failed at creating the BP file, reuse_dim.bp. Exit code=$EX" + exit 1 +fi + +if [ $EX != 0 ]; then + echo "ERROR: reuse_dim failed with exit code=$EX" + exit 1 +fi + diff --git a/tests/libs/adios/tests/suite/tests/16_transform_write_read.sh b/tests/libs/adios/tests/suite/tests/16_transform_write_read.sh new file mode 100755 index 0000000000..0d9e362b87 --- /dev/null +++ b/tests/libs/adios/tests/suite/tests/16_transform_write_read.sh @@ -0,0 +1,65 @@ +#!/bin/bash +# +# Test if adios can write and read scalars correctly +# Uses codes from examples/C/scalars and examples/Fortran/scalars +# +# Environment variables set by caller: +# MPIRUN Run command +# NP_MPIRUN Run command's option to set number of processes +# MAXPROCS Max number of processes allowed +# HAVE_FORTRAN yes or no +# SRCDIR Test source dir (.. of this script) +# TRUNKDIR ADIOS trunk dir + +PROCS=16 +TEST_NAME=transforms_read_write +PROGRAM_NAME=adios_${TEST_NAME} +OUTPUT_FILENAME=${PROGRAM_NAME}.bp + +cp ${SRCDIR}/programs/${PROGRAM_NAME} . +cp ${SRCDIR}/programs/adios_transforms.xml . + +echo "Run C ${PROGRAM_NAME}" +$MPIRUN $NP_MPIRUN $PROCS $EXEOPT ./${PROGRAM_NAME} + +EX=$? +if [ ! -f ${OUTPUT_FILENAME} ]; then + echo "ERROR: C version of ${PROGRAM_NAME} failed. No BP file is created. Exit code=$EX" + exit 1 +fi + +echo "Check output with bpls" +$TRUNKDIR/utils/bpls/bpls -la ${OUTPUT_FILENAME} | grep -v -e endianness -e 'file size' > ${TEST_NAME}_bpls.txt + +# check scalars first +echo " check scalars first" +grep -v "t_" ${TEST_NAME}_bpls.txt > c1.txt +grep -v "t_" $SRCDIR/reference/${TEST_NAME}_bpls.txt > c2.txt +diff -q c1.txt c2.txt +if [ $? != 0 ]; then + echo "ERROR: C version of ${PROGRAM_NAME} produced a file different from the reference." + echo "Some of the scalars don't match with the reference. " + echo "Compare \"bpls -la $PWD/${OUTPUT_FILENAME} | grep -v -e "t_" -e endianness -e 'file size'\" to reference $SRCDIR/reference/${TEST_NAME}_bpls.txt" + exit 1 +fi +rm c1.txt c2.txt + +for VAR in t_none t_identity t_aplod t_isobar +do + echo " $VAR" + grep "$VAR" ${TEST_NAME}_bpls.txt > c1.txt + if [ $? == 0 ]; then + grep "$VAR" $SRCDIR/reference/${TEST_NAME}_bpls.txt > c2.txt + if [ $? != 0 ]; then + echo "ERROR: C version of ${PROGRAM_NAME} produced a file different from the reference." + echo "Variable $VAR does not match with the reference. " + echo "Compare \"bpls -la $PWD/${OUTPUT_FILENAME} | grep -v -e "t_" -e endianness -e 'file size'\" to reference $SRCDIR/reference/${TEST_NAME}_bpls.txt" + exit 1 + fi + else + echo " $VAR is not in the output. Skip check." + fi + rm -f c1.txt c2.txt +done + + diff --git a/tests/libs/adios/tests/suite/tests/17_blockinfo.sh b/tests/libs/adios/tests/suite/tests/17_blockinfo.sh new file mode 100755 index 0000000000..96d4a4d83c --- /dev/null +++ b/tests/libs/adios/tests/suite/tests/17_blockinfo.sh @@ -0,0 +1,37 @@ +#!/bin/bash +# +# Test if adios can read correctly the per-block information of +# a global array that was written with multi-block per process +# Uses ../programs/blocks.c +# +# Environment variables set by caller: +# MPIRUN Run command +# NP_MPIRUN Run commands option to set number of processes +# MAXPROCS Max number of processes allowed +# HAVE_FORTRAN yes or no +# SRCDIR Test source dir (.. of this script) +# TRUNKDIR ADIOS trunk dir + +PROCS=2 + +if [ $MAXPROCS -lt $PROCS ]; then + echo "WARNING: Needs $PROCS processes at least" + exit 77 # not failure, just skip +fi + +# copy codes and inputs to . +cp $SRCDIR/programs/blocks . + +echo "Run blocks" +$MPIRUN $NP_MPIRUN $PROCS $EXEOPT ./blocks +EX=$? +if [ ! -f blocks.bp ]; then + echo "ERROR: blocks failed at creating the BP file, blocks.bp. Exit code=$EX." + exit 1 +fi + +if [ $EX != 0 ]; then + echo "ERROR: blocks failed reading per-block information from blocks.bp with $EX errors." + exit 1 +fi + diff --git a/tests/libs/adios/tests/suite/tests/18_aggregation_by_color.sh b/tests/libs/adios/tests/suite/tests/18_aggregation_by_color.sh new file mode 100755 index 0000000000..970ddda4d3 --- /dev/null +++ b/tests/libs/adios/tests/suite/tests/18_aggregation_by_color.sh @@ -0,0 +1,33 @@ +#!/bin/bash +# +# Test if adios aggregates data by color properly. +# Uses the example code from examples/C/global-array/adios_global_aggregate_by_color +# +# Environment variables set by caller: +# MPIRUN Run command +# NP_MPIRUN Run commands option to set number of processes +# MAXPROCS Max number of processes allowed +# HAVE_FORTRAN yes or no +# SRCDIR Test source dir (.. of this script) +# TRUNKDIR ADIOS trunk dir + +PROCS=7 +READPROCS=3 + +if [ $MAXPROCS -lt $PROCS ]; then + echo "WARNING: Needs $PROCS processes at least" + exit 77 # not failure, just skip +fi + +# copy codes and inputs to . +cp $TRUNKDIR/examples/C/global-array/adios_global_aggregate_by_color . + +echo "Run C adios_global_aggregate_by_color" +$MPIRUN $NP_MPIRUN $PROCS $EXEOPT ./adios_global_aggregate_by_color +EX=$? +if [ ! -f adios_global_aggregate_by_color.bp ] \ +|| [ ! -f adios_global_aggregate_by_color.bp.dir/adios_global_aggregate_by_color.bp.0 ] \ +|| [ ! -f adios_global_aggregate_by_color.bp.dir/adios_global_aggregate_by_color.bp.1 ]; then + echo "ERROR: adios_global_aggregate_by_color failed. No BP file is created. Exit code=$EX" + exit 1 +fi diff --git a/tests/libs/adios/tests/suite/tests/19_query.sh b/tests/libs/adios/tests/suite/tests/19_query.sh new file mode 100755 index 0000000000..030292a219 --- /dev/null +++ b/tests/libs/adios/tests/suite/tests/19_query.sh @@ -0,0 +1,297 @@ +#!/bin/bash +# +# Test if the ADIOS query framework can successfully perform a range of *serial* queries on simple, pre-defined datasets +# Parallel query tests are tested in *TODO* +# +# Uses: +# - tests/C/query/common/build_indexed_dataset (executable, produces the pre-defined datasets) +# - tests/C/query/common/xml-testcases/*/* (custom XML files describing interesting queries over the predefined datasets) +# - e.g. tests/C/query/common/xml-testcases/DS1/simple-query.xml +# - tests/C/query/common/compute_expected_query_results (executable, runs queries via sequential scan over a BP file) +# +# Environment variables set by caller: +# MPIRUN Run command +# NP_MPIRUN Run commands option to set number of processes +# MAXPROCS Max number of processes allowed +# HAVE_FORTRAN yes or no +# SRCDIR Test source dir (.. of this script) +# TRUNKDIR ADIOS trunk dir + +# This function prints a message to stderr, then exits with the +# given error code (defaults to 1). Usage: die +function die() { + EC=${2-1} + echo "$1" >&2 + exit $EC +} + +# mpirun for serial command +MPIRUN_SERIAL="$MPIRUN $NP_MPIRUN 1 $EXEOPT" + +# Basic directory structure +QUERY_TEST_DIR="$TRUNKDIR/tests/C/query" +QUERY_COMMON_DIR="$QUERY_TEST_DIR/common" +TEST_PROGRAMS_DIR="$TRUNKDIR/tests/suite/programs" +UTILS_DIR="$TRUNKDIR/utils" + +# Some external tools to use +DATASET_BUILDER_EXE_BASENAME="build_standard_dataset" +QUERY_SEQSCAN_EXE_BASENAME="compute_expected_query_results" +QUERY_EXE_BASENAME="adios_query_test" +LIST_METHODS_EXE_BASENAME="list_methods" + +DATASET_BUILDER_EXE_PATH="$TEST_PROGRAMS_DIR/$DATASET_BUILDER_EXE_BASENAME" +QUERY_SEQSCAN_EXE_PATH="$QUERY_COMMON_DIR/$QUERY_SEQSCAN_EXE_BASENAME" +QUERY_EXE_PATH="$QUERY_COMMON_DIR/$QUERY_EXE_BASENAME" +LIST_METHODS_EXE_PATH="$UTILS_DIR/$LIST_METHODS_EXE_BASENAME/$LIST_METHODS_EXE_BASENAME" + +# Check for the executability of all executables that we need +[ -f "$DATASET_BUILDER_EXE_PATH" -a -x "$DATASET_BUILDER_EXE_PATH" ] || die "ERROR: $DATASET_BUILDER_EXE_PATH is not executable" +[ -f "$QUERY_SEQSCAN_EXE_PATH" -a -x "$QUERY_SEQSCAN_EXE_PATH" ] || die "ERROR: $QUERY_SEQSCAN_EXE_PATH is not executable" +[ -f "$QUERY_EXE_PATH" -a -x "$QUERY_EXE_PATH" ] || die "ERROR: $QUERY_EXE_PATH is not executable" +[ -f "$LIST_METHODS_EXE_PATH" -a -x "$LIST_METHODS_EXE_PATH" ] || die "ERROR: $LIST_METHODS_EXE_PATH is not executable" + +# Copy the external tools to the working directory for convenience +DATASET_BUILDER_EXE_LOCAL="./$DATASET_BUILDER_EXE_BASENAME" +QUERY_SEQSCAN_EXE_LOCAL="./$QUERY_SEQSCAN_EXE_BASENAME" +QUERY_EXE_LOCAL="./$QUERY_EXE_BASENAME" +cp $DATASET_BUILDER_EXE_PATH $DATASET_BUILDER_EXE_LOCAL +cp $QUERY_SEQSCAN_EXE_PATH $QUERY_SEQSCAN_EXE_LOCAL +cp $QUERY_EXE_PATH $QUERY_EXE_LOCAL + +# Check for the "directory"-ness of the query XML dir +QUERY_XML_DIR="$QUERY_TEST_DIR/query-xmls/" +[ -d "$QUERY_XML_DIR" ] || die "ERROR: $QUERY_XML_DIR is not a directory" + + + +# All pre-defined dataset IDs (which can be extracted from build_indexed_dataset) +ALL_DATASET_IDS=" \ + DS-1D \ + DS-2D \ + DS-3D \ + DS-particle \ + DS-unevenpg \ +" + +# Check that query XML subdirectories exist for all datasets we're testing +for DSID in $ALL_DATASET_IDS; do + [ -d "$QUERY_XML_DIR/$DSID" ] || + die "ERROR: $QUERY_XML_DIR/$DSID is not a directory" +done + + + +# All query engine implementations to test +ALL_QUERY_ENGINES=$( \ + $MPIRUN_SERIAL $LIST_METHODS_EXE_PATH | + awk ' + /^Available/{ + transforms = ($2 == "query") + } + { + if (transforms) { + if (skippedheader) { + gsub("ADIOS_QUERY_METHOD_","",$1) + print $1 + } else { + skippedheader = 1 + } + } + } + ' | + tr "A-Z\n" 'a-z ' +) + +# Specially detect the FastBit indexing method, since it needs +# an external program to build its indexes +case $ALL_QUERY_ENGINES in *fastbit*) HAS_FASTBIT=1 ;; esac +if [ "$HAS_FASTBIT" ]; then + FASTBIT_INDEXER_EXE_BASENAME="adios_index_fastbit" + FASTBIT_INDEXER_EXE_PATH="$UTILS_DIR/fastbit/$FASTBIT_INDEXER_EXE_BASENAME" + [ -f "$FASTBIT_INDEXER_EXE_PATH" -a -x "$FASTBIT_INDEXER_EXE_PATH" ] || die "ERROR: $FASTBIT_INDEXER_EXE_PATH is not executable" + + FASTBIT_INDEXER_EXE_LOCAL="./$FASTBIT_INDEXER_EXE_BASENAME" + cp $FASTBIT_INDEXER_EXE_PATH $FASTBIT_INDEXER_EXE_LOCAL +fi + + + +# +# NO FURTHER CONFIGURATION VARIABLES BELOW THIS POINT +# + +function init_work_directory() { + echo "STEP 1: INITIALIZING THE TEST WORKING DIRECTORY..." + + local QUERY_ENGINE + + # Set up subdirectories for each query engine, since each + # one will need its own BP file indexed in a particular way + for QUERY_ENGINE in $ALL_QUERY_ENGINES; do + mkdir -p ./$QUERY_ENGINE + done +} + +function invoke_dataset_builder() { + local DSID="$1" + local DSOUTPUT="$2" + local TRANSFORM_ARG="$3" + [[ $# -eq 3 ]] || die "ERROR: Internal testing error, invalid parameters to invoke_dataset_builder: $*" + + set -o xtrace + $MPIRUN_SERIAL $DATASET_BUILDER_EXE_LOCAL "$DSID" "$DSOUTPUT" "$TRANSFORM_ARG" || + die "ERROR: $DATASET_BUILDER_EXE_LOCAL failed with exit code $? (on dataset $DSID, outputting to $DSOUTPUT, using transform argument $TRANSFORM_ARG)" + set +o xtrace + + # Rename the ADIOS XML used for writing, so it's more clear what it is used + # for (i.e., not a query test specification XML) + mv "$DSOUTPUT.xml" "$DSOUTPUT.create.xml" + + # Ensure the dataset was actually produced + local INDEXED_DS="$DSOUTPUT.bp" + [ -f "$INDEXED_DS" ] || + die "ERROR: $DATASET_BUILDER_EXE_LOCAL did not produce expected output BP file \"$INDEXED_DS\"" + + #echo $INDEXED_DS # Return the BP filename +} + +function build_indexed_datasets_alacrity() { + local DSID="$1" + local DSOUTPUT="$2" + [[ $# -eq 2 ]] || die "ERROR: Internal testing error, invalid parameters to build_indexed_datasets_alacrity: $*" + + invoke_dataset_builder "$DSID" "$DSOUTPUT.ii-16" "alacrity:indexForm=ALInvertedIndex" + invoke_dataset_builder "$DSID" "$DSOUTPUT.cii-16" "alacrity:indexForm=ALCompressedInvertedIndex" + invoke_dataset_builder "$DSID" "$DSOUTPUT.ii-12" "alacrity:indexForm=ALInvertedIndex,sigBits=12" + invoke_dataset_builder "$DSID" "$DSOUTPUT.cii-12" "alacrity:indexForm=ALCompressedInvertedIndex,sigBits=12" +} + +function build_indexed_datasets_fastbit() { + local DSID="$1" + local DSOUTPUT="$2" + [[ $# -eq 2 ]] || die "ERROR: Internal testing error, invalid parameters to build_indexed_datasets_fastbit: $*" + + invoke_dataset_builder "$DSID" "$DSOUTPUT" "none" + + set -o xtrace + $FASTBIT_INDEXER_EXE_LOCAL "$DSOUTPUT".bp ""|| + die "ERROR: $FASTBIT_INDEXER_EXE_LOCAL failed with exit code $?" + set +o xtrace +} + +function build_datasets() { + echo "STEP 2: INDEXING ALL TEST DATASETS USING ALL ENABLED INDEXING METHODS" + echo "(ALSO PRODUCING A NON-INDEXED VERSION OF EACH DATASET FOR REFERENCE)" + + local DSID + local QUERY_ENGINE + + for DSID in $ALL_DATASET_IDS; do + # Build a no-indexed dataset for use by the sequential + # scan oracle + invoke_dataset_builder "$DSID" "$DSID.noindex" "none" + + # Build indexed versions of this dataset for all query engines + for QUERY_ENGINE in $ALL_QUERY_ENGINES; do + echo "Producing indexed versions of $DSID for query engine $QUERY_ENGINE" + local QE_WORKDIR="./$QUERY_ENGINE" + + # Index the dataset using any indexing configurations desired for this + # particular query engine datasets. This function should produce BP files + # of the form $QE_WORKDIR/$DSID.$QUERY_ENGINE..bp + # (e.g. .../DS1.alacrity.cii.bp, .../DS1.fastbit.precision2.bp + build_indexed_datasets_$QUERY_ENGINE "$DSID" "$QE_WORKDIR/$DSID.$QUERY_ENGINE" + done + done +} + + +# STEP 3: RUN ALL QUERIES USING ALL QUERY ENGINES +function query_datasets() { + echo "STEP 3: RUNNING ALL QUERIES USING ALL ENABLED QUERY ENGINES ON THE INDEXED DATASETS" + + local DSID + local QUERY_XML + local QUERY_ENGINE + local INDEXED_DS + + for DSID in $ALL_DATASET_IDS; do + local NOINDEX_DS="$DSID.noindex.bp" + + # Iterate over all pre-defined queries + for QUERY_XML in "$QUERY_XML_DIR/$DSID"/*.xml; do + local QUERY_XML_BASENAME="${QUERY_XML##*/}" # Strip the path + local QUERY_NAME="${QUERY_XML_BASENAME%%.xml}" # Strip the .xml suffix + + # Copy the query XML into our working directory for easy access + local QUERY_XML_LOCAL="${QUERY_XML_BASENAME}" + cp "$QUERY_XML" "$QUERY_XML_LOCAL" + + # Compute expected query results in both FILE and STREAM modes + for FILEMODE in file stream; do + # Compute the expected results + local EXPECTED_POINTS_FILE="$DSID.$QUERY_NAME.$FILEMODE-mode.expected-points.txt" + + echo + echo "====== COMPUTING EXPECTED OUTPUT OF QUERY $QUERY_NAME ON DATASET $DSID IN $FILEMODE MODE ======" + echo + set -o xtrace + $MPIRUN_SERIAL "$QUERY_SEQSCAN_EXE_LOCAL" "$NOINDEX_DS" "$QUERY_XML_LOCAL" "$FILEMODE" > "$EXPECTED_POINTS_FILE" || + die "ERROR: $QUERY_SEQSCAN_EXE_LOCAL failed with exit code $?" + set +o xtrace + + # NOTE: the sequential scan program produces a point list that is guaranteed to be sorted in C array order, so no need to sort it here + done + + # Ensure results computed for both FILE and STREAM modes match + local ALL_EXPECTED_POINTS_FILES="$DSID.$QUERY_NAME."*"-mode.expected-points.txt" + diff -q $ALL_EXPECTED_POINTS_FILES || + die "ERROR: Computed expected query results for query $QUERY_NAME on dataset $DSID did not match between file mode and stream mode. This is either a bug in compute_expected_query_results, or in ADIOS itself." + + # Run the query for each query engine implementation and compare to the expected results + for QUERY_ENGINE in $ALL_QUERY_ENGINES; do + local QE_WORKDIR="./$QUERY_ENGINE" + + for INDEXED_DS in "$QE_WORKDIR/$DSID.$QUERY_ENGINE".*bp; do + INDEXING_NAME=${INDEXED_DS##*/$DSID.$QUERY_ENGINE.} + INDEXING_NAME=${INDEXING_NAME%.bp} + + for FILEMODE in file stream; do + local OUTPUT_POINTS_FILE="$QE_WORKDIR/$DSID.$QUERY_NAME.$FILEMODE-mode.$QUERY_ENGINE-$INDEXING_NAME-points.txt" + + # Run the query through ADIOS Query to get actual results + echo + echo "====== RUNNING QUERY $QUERY_NAME USING QUERY ENGINE $QUERY_ENGINE ON DATASET $DSID IN $FILEMODE MODE ======" + echo + set -o xtrace + $MPIRUN_SERIAL "$QUERY_EXE_LOCAL" "$INDEXED_DS" "$QUERY_XML_LOCAL" "$QUERY_ENGINE" "$FILEMODE" > "$OUTPUT_POINTS_FILE" || + die "ERROR: $QUERY_EXE_LOCAL failed with exit code $?" + set +o xtrace + + # Sort the output points in C array order, since the query engine makes no guarantee as to the ordering of the results + # Sort file in place (-o FILE) with numerical sort order (-n) on each of the first 9 fields (-k1,1 ...) + # Assumes the output will have at most 8 dimensions (+ 1 timestep column == 9), add more if needed (or use a generalized column counter) + sort -n -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 -k6,6 -k7,7 -k8,8 -k9,9 \ + "$OUTPUT_POINTS_FILE" -o "$OUTPUT_POINTS_FILE" + + # Compare the actual and expected results via diff (the matching points are sorted by tuple components) + if ! diff -q "$EXPECTED_POINTS_FILE" "$OUTPUT_POINTS_FILE"; then + echo "ERROR: ADIOS Query does not return the expected points matching query $QUERY_NAME on dataset $DSID in $FILEMODE mode using query engine $QUERY_ENGINE" + echo "Compare \"$EXPECTED_POINTS_FILE\" (expected points) vs. \"$OUTPUT_POINTS_FILE\" (returned points) in \"$PWD\"" + echo "The BP file queried is \"$INDEXED_DS\" and the query is specified by \"$QUERY_XML_LOCAL\"" + exit 1 + fi + done + done + done + done + done +} + +# FINALLY, CALL THE FUNCTIONS IN SEQUENCE +echo "NOTE: Testing query methods: $ALL_QUERY_METHODS" +echo "NOTE: Testing on datasets: $ALL_DATASETS" +init_work_directory +build_datasets +query_datasets diff --git a/tests/libs/adios/tests/suite/tests/20_transforms_writeblock.sh b/tests/libs/adios/tests/suite/tests/20_transforms_writeblock.sh new file mode 100755 index 0000000000..cd238fd6f8 --- /dev/null +++ b/tests/libs/adios/tests/suite/tests/20_transforms_writeblock.sh @@ -0,0 +1,149 @@ +#!/bin/bash +# +# Test if the ADIOS query framework can successfully perform a range of *serial* queries on simple, pre-defined datasets +# Parallel query tests are tested in *TODO* +# +# Uses: +# - tests/C/query/common/build_indexed_dataset (executable, produces the pre-defined datasets) +# - tests/C/query/common/xml-testcases/*/* (custom XML files describing interesting queries over the predefined datasets) +# - e.g. tests/C/query/common/xml-testcases/DS1/simple-query.xml +# - tests/C/query/common/compute_expected_query_results (executable, runs queries via sequential scan over a BP file) +# +# Environment variables set by caller: +# MPIRUN Run command +# NP_MPIRUN Run commands option to set number of processes +# MAXPROCS Max number of processes allowed +# HAVE_FORTRAN yes or no +# SRCDIR Test source dir (.. of this script) +# TRUNKDIR ADIOS trunk dir + +# This function prints a message to stderr, then exits with the +# given error code (defaults to 1). Usage: die +function die() { + EC=${2-1} + echo "$1" >&2 + exit $EC +} + +# mpirun for serial command + +USEPROCS=$MAXPROCS +if [[ $USEPROCS -gt 4 ]]; then USEPROCS=4; fi +MPIRUN_CMD="$MPIRUN $NP_MPIRUN $USEPROCS" + +# Basic directory structure +TEST_PROGRAMS_DIR="$TRUNKDIR/tests/suite/programs" +UTILS_DIR="$TRUNKDIR/utils" + +# Some external tools to use +DATASET_BUILDER_EXE_BASENAME="build_standard_dataset" +DATASET_TESTER_EXE_BASENAME="transforms_writeblock_read" +LIST_METHODS_EXE_BASENAME="list_methods" + +DATASET_BUILDER_EXE_PATH="$TEST_PROGRAMS_DIR/$DATASET_BUILDER_EXE_BASENAME" +DATASET_TESTER_EXE_PATH="$TEST_PROGRAMS_DIR/$DATASET_TESTER_EXE_BASENAME" +LIST_METHODS_EXE_PATH="$UTILS_DIR/list_methods/$LIST_METHODS_EXE_BASENAME" + +# Check for the executability of all executables that we need +[ -f "$DATASET_BUILDER_EXE_PATH" -a -x "$DATASET_BUILDER_EXE_PATH" ] || die "ERROR: $DATASET_BUILDER_EXE_PATH is not executable" +[ -f "$DATASET_TESTER_EXE_PATH" -a -x "$DATASET_TESTER_EXE_PATH" ] || die "ERROR: $DATASET_TESTER_EXE_PATH is not executable" +[ -f "$LIST_METHODS_EXE_PATH" -a -x "$LIST_METHODS_EXE_PATH" ] || die "ERROR: $LIST_METHODS_EXE_PATH is not executable" + +# Copy the external tools to the working directory for convenience +DATASET_BUILDER_EXE_LOCAL="./$DATASET_BUILDER_EXE_BASENAME" +DATASET_TESTER_EXE_LOCAL="./$DATASET_TESTER_EXE_BASENAME" +cp $DATASET_BUILDER_EXE_PATH $DATASET_BUILDER_EXE_LOCAL +cp $DATASET_TESTER_EXE_PATH $DATASET_TESTER_EXE_LOCAL + +# All pre-defined dataset IDs (which can be extracted from build_indexed_dataset) +ALL_DATASET_IDS=" \ + DS-1D \ + DS-2D \ + DS-3D \ + DS-particle \ +" + +ALL_TRANSFORMS=$( \ + $LIST_METHODS_EXE_PATH | + awk ' + /^Available/{ + transforms = ($2 == "data") + } + { + if (transforms) { + if (skippedheader) { + gsub("\"","",$1) + print $1 + } else { + skippedheader = 1 + } + } + } + ' | + grep -v -eisobar -eszip +) + +echo "NOTE: Testing with the following installed data transformations: $ALL_TRANSFORMS" + +function invoke_dataset_builder() { + local DSID="$1" + local DSOUTPUT="$2" + local TRANSFORM="$3" + [[ $# -eq 3 ]] || die "ERROR: Internal testing error, invalid parameters to invoke_dataset_builder: $*" + + # Use Identity because it's built-in, known-good and and should be sufficient + # to test writeblock reads over transformed data + + set -o xtrace + $DATASET_BUILDER_EXE_LOCAL "$DSID" "$DSOUTPUT" "$TRANSFORM" || + die "ERROR: $DATASET_BUILDER_EXE_LOCAL failed with exit code $? (on dataset $DSID, outputting to $DSOUTPUT, using transform argument $TRANSFORM_ARG)" + set +o xtrace + + # Rename the ADIOS XML used for writing, so it's more clear what it is used + # for (i.e., not a query test specification XML) + mv "$DSOUTPUT.xml" "$DSOUTPUT.create.xml" + + # Ensure the dataset was actually produced + local TRANSFORMED_DS="$DSOUTPUT.bp" + [ -f "$TRANSFORMED_DS" ] || + die "ERROR: $DATASET_BUILDER_EXE_LOCAL did not produce expected output BP file \"$TRANSFORMED_DS\"" +} + +function build_datasets() { + local DSID + local TRANSFORM + + for TRANSFORM in $ALL_TRANSFORMS; do + local TRANSFORM_DIR="$TRANSFORM" + mkdir -p $TRANSFORM_DIR + for DSID in $ALL_DATASET_IDS; do + invoke_dataset_builder "$DSID" "$TRANSFORM_DIR/$DSID" "$TRANSFORM" + done + done +} + + + +function test_datasets() { + local DSID + + for DSID in $ALL_DATASET_IDS; do + for TRANSFORM in $ALL_TRANSFORMS; do + local DS_FILE="$TRANSFORM/$DSID.bp" + + echo + echo "=== TESTING WRITEBLOCK READS ON DATASET $DSID TRANSFORMED WITH TRANSFORM $TRANSFORM ===" + echo + set -o xtrace + $MPIRUN_CMD "$DATASET_TESTER_EXE_LOCAL" "$DS_FILE" || + die "ERROR: $DATASET_TESTER_EXE_LOCAL failed on dataset $DSID and transform $TRANSFORM with exit code $?" + set +o xtrace + done + done +} + + + +# FINALLY, CALL THE FUNCTIONS IN SEQUENCE +build_datasets +test_datasets diff --git a/tests/libs/boost-mpi/Makefile.am b/tests/libs/boost-mpi/Makefile.am new file mode 100644 index 0000000000..8de24edca8 --- /dev/null +++ b/tests/libs/boost-mpi/Makefile.am @@ -0,0 +1,3 @@ +ACLOCAL_AMFLAGS = -I m4 +#AM_MAKEFLAGS = --no-print-directory +SUBDIRS = tests diff --git a/tests/libs/boost-mpi/bootstrap b/tests/libs/boost-mpi/bootstrap new file mode 120000 index 0000000000..b17b398013 --- /dev/null +++ b/tests/libs/boost-mpi/bootstrap @@ -0,0 +1 @@ +../../bootstrap \ No newline at end of file diff --git a/tests/libs/boost-mpi/configure.ac b/tests/libs/boost-mpi/configure.ac new file mode 100644 index 0000000000..53608e7dbf --- /dev/null +++ b/tests/libs/boost-mpi/configure.ac @@ -0,0 +1,49 @@ +# -*- Autoconf -*- +# Process this file with autoconf to produce a configure script. +# + +AC_PREREQ(2.59) +AC_INIT([boost-mpi], [0.10.0], [karl.w.schulz@intel.com]) +AC_CONFIG_MACRO_DIR([m4]) +AM_INIT_AUTOMAKE([foreign]) +m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) + +# verify we have necessary environment variables set +AC_MSG_CHECKING([for BOOST_DIR environment variable]) +if test "x$BOOST_DIR" = "x"; then + AC_MSG_RESULT([no]) + echo + AC_ERROR([BOOST_DIR not defined - please load boost environment.]) +else + AC_MSG_RESULT([yes]) +fi + +OHPC_COMPILER_FAMILY + +# test compilers + +CXX=mpicxx +AC_PROG_CXX + +# Require boost and variety of libraries + +#AC_DEFINE([MPICXX],[mpicxx]) + +# Set subdirectories +AC_CONFIG_FILES(Makefile tests/Makefile tests/module/Makefile tests/mpi/test/Makefile ) + +# Configure +AC_OUTPUT() + +echo +echo '-------------------------------------------------- SUMMARY --------------------------------------------------' +echo +echo Package version............... : $PACKAGE-$VERSION +echo OHPC compiler toolchain........ : $LMOD_FAMILY_COMPILER +echo OHPC MPI toolchain............. : $LMOD_FAMILY_MPI +echo +echo C++ compiler.................. : `which $CXX` +echo C++ compiler flags............ : $CXXFLAGS +echo Boost CPPFLAGS flags.......... : -I$BOOST_DIR/include +echo +echo '-------------------------------------------------------------------------------------------------------------' diff --git a/tests/libs/boost-mpi/m4/boost.m4 b/tests/libs/boost-mpi/m4/boost.m4 new file mode 100644 index 0000000000..f41628e529 --- /dev/null +++ b/tests/libs/boost-mpi/m4/boost.m4 @@ -0,0 +1,1261 @@ +# boost.m4: Locate Boost headers and libraries for autoconf-based projects. +# Copyright (C) 2007, 2008, 2009, 2010, 2011 Benoit Sigoure +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Additional permission under section 7 of the GNU General Public +# License, version 3 ("GPLv3"): +# +# If you convey this file as part of a work that contains a +# configuration script generated by Autoconf, you may do so under +# terms of your choice. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +m4_define([_BOOST_SERIAL], [m4_translit([ +# serial 18 +], [# +], [])]) + +# Original sources can be found at http://github.com/tsuna/boost.m4 +# You can fetch the latest version of the script by doing: +# wget http://github.com/tsuna/boost.m4/raw/master/build-aux/boost.m4 + +# ------ # +# README # +# ------ # + +# This file provides several macros to use the various Boost libraries. +# The first macro is BOOST_REQUIRE. It will simply check if it's possible to +# find the Boost headers of a given (optional) minimum version and it will +# define BOOST_CPPFLAGS accordingly. It will add an option --with-boost to +# your configure so that users can specify non standard locations. +# If the user's environment contains BOOST_ROOT and --with-boost was not +# specified, --with-boost=$BOOST_ROOT is implicitly used. +# For more README and documentation, go to http://github.com/tsuna/boost.m4 +# Note: THESE MACROS ASSUME THAT YOU USE LIBTOOL. If you don't, don't worry, +# simply read the README, it will show you what to do step by step. + +m4_pattern_forbid([^_?(BOOST|Boost)_]) + + +# _BOOST_SED_CPP(SED-PROGRAM, PROGRAM, +# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# -------------------------------------------------------- +# Same as AC_EGREP_CPP, but leave the result in conftest.i. +# +# SED-PROGRAM is *not* overquoted, as in AC_EGREP_CPP. It is expanded +# in double-quotes, so escape your double quotes. +# +# It could be useful to turn this into a macro which extracts the +# value of any macro. +m4_define([_BOOST_SED_CPP], +[AC_LANG_PREPROC_REQUIRE()dnl +AC_REQUIRE([AC_PROG_SED])dnl +AC_LANG_CONFTEST([AC_LANG_SOURCE([[$2]])]) +AS_IF([dnl eval is necessary to expand ac_cpp. +dnl Ultrix and Pyramid sh refuse to redirect output of eval, so use subshell. +dnl Beware of Windows end-of-lines, for instance if we are running +dnl some Windows programs under Wine. In that case, boost/version.hpp +dnl is certainly using "\r\n", but the regular Unix shell will only +dnl strip `\n' with backquotes, not the `\r'. This results in +dnl boost_cv_lib_version='1_37\r' for instance, which breaks +dnl everything else. +dnl Cannot use 'dnl' after [$4] because a trailing dnl may break AC_CACHE_CHECK +(eval "$ac_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD | + tr -d '\r' | + $SED -n -e "$1" >conftest.i 2>&1], + [$3], + [$4]) +rm -rf conftest* +])# AC_EGREP_CPP + + + +# BOOST_REQUIRE([VERSION], [ACTION-IF-NOT-FOUND]) +# ----------------------------------------------- +# Look for Boost. If version is given, it must either be a literal of the form +# "X.Y.Z" where X, Y and Z are integers (the ".Z" part being optional) or a +# variable "$var". +# Defines the value BOOST_CPPFLAGS. This macro only checks for headers with +# the required version, it does not check for any of the Boost libraries. +# On # success, defines HAVE_BOOST. On failure, calls the optional +# ACTION-IF-NOT-FOUND action if one was supplied. +# Otherwise aborts with an error message. +AC_DEFUN([BOOST_REQUIRE], +[AC_REQUIRE([AC_PROG_CXX])dnl +AC_REQUIRE([AC_PROG_GREP])dnl +echo "$as_me: this is boost.m4[]_BOOST_SERIAL" >&AS_MESSAGE_LOG_FD +boost_save_IFS=$IFS +boost_version_req=$1 +IFS=. +set x $boost_version_req 0 0 0 +IFS=$boost_save_IFS +shift +boost_version_req=`expr "$[1]" '*' 100000 + "$[2]" '*' 100 + "$[3]"` +boost_version_req_string=$[1].$[2].$[3] +AC_ARG_WITH([boost], + [AS_HELP_STRING([--with-boost=DIR], + [prefix of Boost $1 @<:@guess@:>@])])dnl +AC_ARG_VAR([BOOST_ROOT],[Location of Boost installation])dnl +# If BOOST_ROOT is set and the user has not provided a value to +# --with-boost, then treat BOOST_ROOT as if it the user supplied it. +if test x"$BOOST_ROOT" != x; then + if test x"$with_boost" = x; then + AC_MSG_NOTICE([Detected BOOST_ROOT; continuing with --with-boost=$BOOST_ROOT]) + with_boost=$BOOST_ROOT + else + AC_MSG_NOTICE([Detected BOOST_ROOT=$BOOST_ROOT, but overridden by --with-boost=$with_boost]) + fi +fi +AC_SUBST([DISTCHECK_CONFIGURE_FLAGS], + ["$DISTCHECK_CONFIGURE_FLAGS '--with-boost=$with_boost'"])dnl +boost_save_CPPFLAGS=$CPPFLAGS + AC_CACHE_CHECK([for Boost headers version >= $boost_version_req_string], + [boost_cv_inc_path], + [boost_cv_inc_path=no +AC_LANG_PUSH([C++])dnl +m4_pattern_allow([^BOOST_VERSION$])dnl + AC_LANG_CONFTEST([AC_LANG_PROGRAM([[#include +#if !defined BOOST_VERSION +# error BOOST_VERSION is not defined +#elif BOOST_VERSION < $boost_version_req +# error Boost headers version < $boost_version_req +#endif +]])]) + # If the user provided a value to --with-boost, use it and only it. + case $with_boost in #( + ''|yes) set x '' /opt/local/include /usr/local/include /opt/include \ + /usr/include C:/Boost/include;; #( + *) set x "$with_boost/include" "$with_boost";; + esac + shift + for boost_dir + do + # Without --layout=system, Boost (or at least some versions) installs + # itself in /include/boost-. This inner loop helps to + # find headers in such directories. + # + # Any ${boost_dir}/boost-x_xx directories are searched in reverse version + # order followed by ${boost_dir}. The final '.' is a sentinel for + # searching $boost_dir" itself. Entries are whitespace separated. + # + # I didn't indent this loop on purpose (to avoid over-indented code) + boost_layout_system_search_list=`cd "$boost_dir" 2>/dev/null \ + && ls -1 | "${GREP}" '^boost-' | sort -rn -t- -k2 \ + && echo .` + for boost_inc in $boost_layout_system_search_list + do + if test x"$boost_inc" != x.; then + boost_inc="$boost_dir/$boost_inc" + else + boost_inc="$boost_dir" # Uses sentinel in boost_layout_system_search_list + fi + if test x"$boost_inc" != x; then + # We are going to check whether the version of Boost installed + # in $boost_inc is usable by running a compilation that + # #includes it. But if we pass a -I/some/path in which Boost + # is not installed, the compiler will just skip this -I and + # use other locations (either from CPPFLAGS, or from its list + # of system include directories). As a result we would use + # header installed on the machine instead of the /some/path + # specified by the user. So in that precise case (trying + # $boost_inc), make sure the version.hpp exists. + # + # Use test -e as there can be symlinks. + test -e "$boost_inc/boost/version.hpp" || continue + CPPFLAGS="$CPPFLAGS -I$boost_inc" + fi + AC_COMPILE_IFELSE([], [boost_cv_inc_path=yes], [boost_cv_version=no]) + if test x"$boost_cv_inc_path" = xyes; then + if test x"$boost_inc" != x; then + boost_cv_inc_path=$boost_inc + fi + break 2 + fi + done + done +AC_LANG_POP([C++])dnl + ]) + case $boost_cv_inc_path in #( + no) + boost_errmsg="cannot find Boost headers version >= $boost_version_req_string" + m4_if([$2], [], [AC_MSG_ERROR([$boost_errmsg])], + [AC_MSG_NOTICE([$boost_errmsg])]) + $2 + ;;#( + yes) + BOOST_CPPFLAGS= + ;;#( + *) + AC_SUBST([BOOST_CPPFLAGS], ["-I$boost_cv_inc_path"])dnl + ;; + esac + if test x"$boost_cv_inc_path" != xno; then + AC_DEFINE([HAVE_BOOST], [1], + [Defined if the requested minimum BOOST version is satisfied]) + AC_CACHE_CHECK([for Boost's header version], + [boost_cv_lib_version], + [m4_pattern_allow([^BOOST_LIB_VERSION$])dnl + _BOOST_SED_CPP([/^boost-lib-version = /{s///;s/\"//g;p;q;}], + [#include +boost-lib-version = BOOST_LIB_VERSION], + [boost_cv_lib_version=`cat conftest.i`])]) + # e.g. "134" for 1_34_1 or "135" for 1_35 + boost_major_version=`echo "$boost_cv_lib_version" | sed 's/_//;s/_.*//'` + case $boost_major_version in #( + '' | *[[!0-9]]*) + AC_MSG_ERROR([invalid value: boost_major_version=$boost_major_version]) + ;; + esac +fi +CPPFLAGS=$boost_save_CPPFLAGS +])# BOOST_REQUIRE + +# BOOST_STATIC() +# -------------- +# Add the "--enable-static-boost" configure argument. If this argument is given +# on the command line, static versions of the libraries will be looked up. +AC_DEFUN([BOOST_STATIC], + [AC_ARG_ENABLE([static-boost], + [AS_HELP_STRING([--enable-static-boost], + [Prefer the static boost libraries over the shared ones [no]])], + [enable_static_boost=yes], + [enable_static_boost=no])])# BOOST_STATIC + +# BOOST_FIND_HEADER([HEADER-NAME], [ACTION-IF-NOT-FOUND], [ACTION-IF-FOUND]) +# -------------------------------------------------------------------------- +# Wrapper around AC_CHECK_HEADER for Boost headers. Useful to check for +# some parts of the Boost library which are only made of headers and don't +# require linking (such as Boost.Foreach). +# +# Default ACTION-IF-NOT-FOUND: Fail with a fatal error unless Boost couldn't be +# found in the first place, in which case by default a notice is issued to the +# user. Presumably if we haven't died already it's because it's OK to not have +# Boost, which is why only a notice is issued instead of a hard error. +# +# Default ACTION-IF-FOUND: define the preprocessor symbol HAVE_ in +# case of success # (where HEADER-NAME is written LIKE_THIS, e.g., +# HAVE_BOOST_FOREACH_HPP). +AC_DEFUN([BOOST_FIND_HEADER], +[AC_REQUIRE([BOOST_REQUIRE])dnl +if test x"$boost_cv_inc_path" = xno; then + m4_default([$2], [AC_MSG_NOTICE([Boost not available, not searching for $1])]) +else +AC_LANG_PUSH([C++])dnl +boost_save_CPPFLAGS=$CPPFLAGS +CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" +AC_CHECK_HEADER([$1], + [m4_default([$3], [AC_DEFINE(AS_TR_CPP([HAVE_$1]), [1], + [Define to 1 if you have <$1>])])], + [m4_default([$2], [AC_MSG_ERROR([cannot find $1])])]) +CPPFLAGS=$boost_save_CPPFLAGS +AC_LANG_POP([C++])dnl +fi +])# BOOST_FIND_HEADER + + +# BOOST_FIND_LIB([LIB-NAME], [PREFERRED-RT-OPT], [HEADER-NAME], [CXX-TEST], +# [CXX-PROLOGUE]) +# ------------------------------------------------------------------------- +# Look for the Boost library LIB-NAME (e.g., LIB-NAME = `thread', for +# libboost_thread). Check that HEADER-NAME works and check that +# libboost_LIB-NAME can link with the code CXX-TEST. The optional argument +# CXX-PROLOGUE can be used to include some C++ code before the `main' +# function. +# +# Invokes BOOST_FIND_HEADER([HEADER-NAME]) (see above). +# +# Boost libraries typically come compiled with several flavors (with different +# runtime options) so PREFERRED-RT-OPT is the preferred suffix. A suffix is one +# or more of the following letters: sgdpn (in that order). s = static +# runtime, d = debug build, g = debug/diagnostic runtime, p = STLPort build, +# n = (unsure) STLPort build without iostreams from STLPort (it looks like `n' +# must always be used along with `p'). Additionally, PREFERRED-RT-OPT can +# start with `mt-' to indicate that there is a preference for multi-thread +# builds. Some sample values for PREFERRED-RT-OPT: (nothing), mt, d, mt-d, gdp +# ... If you want to make sure you have a specific version of Boost +# (eg, >= 1.33) you *must* invoke BOOST_REQUIRE before this macro. +AC_DEFUN([BOOST_FIND_LIB], +[AC_REQUIRE([BOOST_REQUIRE])dnl +AC_REQUIRE([_BOOST_FIND_COMPILER_TAG])dnl +AC_REQUIRE([BOOST_STATIC])dnl +AC_REQUIRE([_BOOST_GUESS_WHETHER_TO_USE_MT])dnl +if test x"$boost_cv_inc_path" = xno; then + AC_MSG_NOTICE([Boost not available, not searching for the Boost $1 library]) +else +dnl The else branch is huge and wasn't intended on purpose. +AC_LANG_PUSH([C++])dnl +AS_VAR_PUSHDEF([Boost_lib], [boost_cv_lib_$1])dnl +AS_VAR_PUSHDEF([Boost_lib_LDFLAGS], [boost_cv_lib_$1_LDFLAGS])dnl +AS_VAR_PUSHDEF([Boost_lib_LDPATH], [boost_cv_lib_$1_LDPATH])dnl +AS_VAR_PUSHDEF([Boost_lib_LIBS], [boost_cv_lib_$1_LIBS])dnl +BOOST_FIND_HEADER([$3]) +boost_save_CPPFLAGS=$CPPFLAGS +CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" +# Now let's try to find the library. The algorithm is as follows: first look +# for a given library name according to the user's PREFERRED-RT-OPT. For each +# library name, we prefer to use the ones that carry the tag (toolset name). +# Each library is searched through the various standard paths were Boost is +# usually installed. If we can't find the standard variants, we try to +# enforce -mt (for instance on MacOSX, libboost_threads.dylib doesn't exist +# but there's -obviously- libboost_threads-mt.dylib). +AC_CACHE_CHECK([for the Boost $1 library], [Boost_lib], + [Boost_lib=no + case "$2" in #( + mt | mt-) boost_mt=-mt; boost_rtopt=;; #( + mt* | mt-*) boost_mt=-mt; boost_rtopt=`expr "X$2" : 'Xmt-*\(.*\)'`;; #( + *) boost_mt=; boost_rtopt=$2;; + esac + if test $enable_static_boost = yes; then + boost_rtopt="s$boost_rtopt" + fi + # Find the proper debug variant depending on what we've been asked to find. + case $boost_rtopt in #( + *d*) boost_rt_d=$boost_rtopt;; #( + *[[sgpn]]*) # Insert the `d' at the right place (in between `sg' and `pn') + boost_rt_d=`echo "$boost_rtopt" | sed 's/\(s*g*\)\(p*n*\)/\1\2/'`;; #( + *) boost_rt_d='-d';; + esac + # If the PREFERRED-RT-OPT are not empty, prepend a `-'. + test -n "$boost_rtopt" && boost_rtopt="-$boost_rtopt" + $boost_guess_use_mt && boost_mt=-mt + # Look for the abs path the static archive. + # $libext is computed by Libtool but let's make sure it's non empty. + test -z "$libext" && + AC_MSG_ERROR([the libext variable is empty, did you invoke Libtool?]) + boost_save_ac_objext=$ac_objext + # Generate the test file. + AC_LANG_CONFTEST([AC_LANG_PROGRAM([#include <$3> +$5], [$4])]) +dnl Optimization hacks: compiling C++ is slow, especially with Boost. What +dnl we're trying to do here is guess the right combination of link flags +dnl (LIBS / LDFLAGS) to use a given library. This can take several +dnl iterations before it succeeds and is thus *very* slow. So what we do +dnl instead is that we compile the code first (and thus get an object file, +dnl typically conftest.o). Then we try various combinations of link flags +dnl until we succeed to link conftest.o in an executable. The problem is +dnl that the various TRY_LINK / COMPILE_IFELSE macros of Autoconf always +dnl remove all the temporary files including conftest.o. So the trick here +dnl is to temporarily change the value of ac_objext so that conftest.o is +dnl preserved accross tests. This is obviously fragile and I will burn in +dnl hell for not respecting Autoconf's documented interfaces, but in the +dnl mean time, it optimizes the macro by a factor of 5 to 30. +dnl Another small optimization: the first argument of AC_COMPILE_IFELSE left +dnl empty because the test file is generated only once above (before we +dnl start the for loops). + AC_COMPILE_IFELSE([], + [ac_objext=do_not_rm_me_plz], + [AC_MSG_ERROR([cannot compile a test that uses Boost $1])]) + ac_objext=$boost_save_ac_objext + boost_failed_libs= +# Don't bother to ident the 6 nested for loops, only the 2 innermost ones +# matter. +for boost_tag_ in -$boost_cv_lib_tag ''; do +for boost_ver_ in -$boost_cv_lib_version ''; do +for boost_mt_ in $boost_mt -mt ''; do +for boost_rtopt_ in $boost_rtopt '' -d; do + for boost_lib in \ + boost_$1$boost_tag_$boost_mt_$boost_rtopt_$boost_ver_ \ + boost_$1$boost_tag_$boost_rtopt_$boost_ver_ \ + boost_$1$boost_tag_$boost_mt_$boost_ver_ \ + boost_$1$boost_tag_$boost_ver_ + do + # Avoid testing twice the same lib + case $boost_failed_libs in #( + *@$boost_lib@*) continue;; + esac + # If with_boost is empty, we'll search in /lib first, which is not quite + # right so instead we'll try to a location based on where the headers are. + boost_tmp_lib=$with_boost + test x"$with_boost" = x && boost_tmp_lib=${boost_cv_inc_path%/include} + for boost_ldpath in "$boost_tmp_lib/lib" '' \ + /opt/local/lib* /usr/local/lib* /opt/lib* /usr/lib* \ + "$with_boost" C:/Boost/lib /lib* + do + test -e "$boost_ldpath" || continue + boost_save_LDFLAGS=$LDFLAGS + # Are we looking for a static library? + case $boost_ldpath:$boost_rtopt_ in #( + *?*:*s*) # Yes (Non empty boost_ldpath + s in rt opt) + Boost_lib_LIBS="$boost_ldpath/lib$boost_lib.$libext" + test -e "$Boost_lib_LIBS" || continue;; #( + *) # No: use -lboost_foo to find the shared library. + Boost_lib_LIBS="-l$boost_lib";; + esac + boost_save_LIBS=$LIBS + LIBS="$Boost_lib_LIBS $LIBS" + test x"$boost_ldpath" != x && LDFLAGS="$LDFLAGS -L$boost_ldpath" +dnl First argument of AC_LINK_IFELSE left empty because the test file is +dnl generated only once above (before we start the for loops). + _BOOST_AC_LINK_IFELSE([], + [Boost_lib=yes], [Boost_lib=no]) + ac_objext=$boost_save_ac_objext + LDFLAGS=$boost_save_LDFLAGS + LIBS=$boost_save_LIBS + if test x"$Boost_lib" = xyes; then + # Check or used cached result of whether or not using -R or -rpath makes sense. + # Some implementations of ld, such as for Mac OSX, require -rpath but + # -R is the flag known to work on other systems. + # https://github.com/tsuna/boost.m4/issues/19 + AC_CACHE_VAL([boost_cv_rpath_link_ldflag], + [for boost_cv_rpath_link_ldflag in -Wl,-R, -Wl,-rpath,; do + LDFLAGS="$boost_save_LDFLAGS -L$boost_ldpath $boost_cv_rpath_link_ldflag$boost_ldpath" + LIBS="$boost_save_LIBS $Boost_lib_LIBS" + _BOOST_AC_LINK_IFELSE([], + [boost_rpath_link_ldflag_found=yes + break], + [boost_rpath_link_ldflag_found=no]) + done + AS_IF([test "x$boost_rpath_link_ldflag_found" != "xyes"], + [AC_MSG_ERROR([Unable to determine whether to use -R or -rpath])]) + LDFLAGS=$boost_save_LDFLAGS + LIBS=$boost_save_LIBS + ]) + Boost_lib_LDFLAGS="-L$boost_ldpath $boost_cv_rpath_link_ldflag$boost_ldpath" + Boost_lib_LDPATH="$boost_ldpath" + break 6 + else + boost_failed_libs="$boost_failed_libs@$boost_lib@" + fi + done + done +done +done +done +done +rm -f conftest.$ac_objext +]) +case $Boost_lib in #( + no) _AC_MSG_LOG_CONFTEST + AC_MSG_ERROR([cannot find the flags to link with Boost $1]) + ;; +esac +AC_SUBST(AS_TR_CPP([BOOST_$1_LDFLAGS]), [$Boost_lib_LDFLAGS])dnl +AC_SUBST(AS_TR_CPP([BOOST_$1_LDPATH]), [$Boost_lib_LDPATH])dnl +AC_SUBST([BOOST_LDPATH], [$Boost_lib_LDPATH])dnl +AC_SUBST(AS_TR_CPP([BOOST_$1_LIBS]), [$Boost_lib_LIBS])dnl +CPPFLAGS=$boost_save_CPPFLAGS +AS_VAR_POPDEF([Boost_lib])dnl +AS_VAR_POPDEF([Boost_lib_LDFLAGS])dnl +AS_VAR_POPDEF([Boost_lib_LDPATH])dnl +AS_VAR_POPDEF([Boost_lib_LIBS])dnl +AC_LANG_POP([C++])dnl +fi +])# BOOST_FIND_LIB + + +# --------------------------------------- # +# Checks for the various Boost libraries. # +# --------------------------------------- # + +# List of boost libraries: http://www.boost.org/libs/libraries.htm +# The page http://beta.boost.org/doc/libs is useful: it gives the first release +# version of each library (among other things). + +# BOOST_DEFUN(LIBRARY, CODE) +# -------------------------- +# Define BOOST_ as a macro that runs CODE. +# +# Use indir to avoid the warning on underquoted macro name given to AC_DEFUN. +m4_define([BOOST_DEFUN], +[m4_indir([AC_DEFUN], + m4_toupper([BOOST_$1]), +[m4_pushdef([BOOST_Library], [$1])dnl +$2 +m4_popdef([BOOST_Library])dnl +]) +]) + +# BOOST_ARRAY() +# ------------- +# Look for Boost.Array +BOOST_DEFUN([Array], +[BOOST_FIND_HEADER([boost/array.hpp])]) + + +# BOOST_ASIO() +# ------------ +# Look for Boost.Asio (new in Boost 1.35). +BOOST_DEFUN([Asio], +[AC_REQUIRE([BOOST_SYSTEM])dnl +BOOST_FIND_HEADER([boost/asio.hpp])]) + + +# BOOST_BIND() +# ------------ +# Look for Boost.Bind +BOOST_DEFUN([Bind], +[BOOST_FIND_HEADER([boost/bind.hpp])]) + + +# BOOST_CHRONO() +# ------------------ +# Look for Boost.Chrono +BOOST_DEFUN([Chrono], +[# Do we have to check for Boost.System? This link-time dependency was +# added as of 1.35.0. If we have a version <1.35, we must not attempt to +# find Boost.System as it didn't exist by then. +if test $boost_major_version -ge 135; then +BOOST_SYSTEM([$1]) +fi # end of the Boost.System check. +boost_filesystem_save_LIBS=$LIBS +boost_filesystem_save_LDFLAGS=$LDFLAGS +m4_pattern_allow([^BOOST_SYSTEM_(LIBS|LDFLAGS)$])dnl +LIBS="$LIBS $BOOST_SYSTEM_LIBS" +LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS" +BOOST_FIND_LIB([chrono], [$1], + [boost/chrono.hpp], + [boost::chrono::thread_clock d;]) +if test $enable_static_boost = yes && test $boost_major_version -ge 135; then + AC_SUBST([BOOST_FILESYSTEM_LIBS], ["$BOOST_FILESYSTEM_LIBS $BOOST_SYSTEM_LIBS"]) +fi +LIBS=$boost_filesystem_save_LIBS +LDFLAGS=$boost_filesystem_save_LDFLAGS + +])# BOOST_CHRONO + + +# BOOST_CONVERSION() +# ------------------ +# Look for Boost.Conversion (cast / lexical_cast) +BOOST_DEFUN([Conversion], +[BOOST_FIND_HEADER([boost/cast.hpp]) +BOOST_FIND_HEADER([boost/lexical_cast.hpp]) +])# BOOST_CONVERSION + + +# BOOST_CRC() +# ----------- +# Look for Boost.CRC +BOOST_DEFUN([CRC], +[BOOST_FIND_HEADER([boost/crc.hpp]) +])# BOOST_CRC + + +# BOOST_DATE_TIME([PREFERRED-RT-OPT]) +# ----------------------------------- +# Look for Boost.Date_Time. For the documentation of PREFERRED-RT-OPT, see the +# documentation of BOOST_FIND_LIB above. +BOOST_DEFUN([Date_Time], +[BOOST_FIND_LIB([date_time], [$1], + [boost/date_time/posix_time/posix_time.hpp], + [boost::posix_time::ptime t;]) +])# BOOST_DATE_TIME + + +# BOOST_FILESYSTEM([PREFERRED-RT-OPT]) +# ------------------------------------ +# Look for Boost.Filesystem. For the documentation of PREFERRED-RT-OPT, see +# the documentation of BOOST_FIND_LIB above. +# Do not check for boost/filesystem.hpp because this file was introduced in +# 1.34. +BOOST_DEFUN([Filesystem], +[# Do we have to check for Boost.System? This link-time dependency was +# added as of 1.35.0. If we have a version <1.35, we must not attempt to +# find Boost.System as it didn't exist by then. +if test $boost_major_version -ge 135; then +BOOST_SYSTEM([$1]) +fi # end of the Boost.System check. +boost_filesystem_save_LIBS=$LIBS +boost_filesystem_save_LDFLAGS=$LDFLAGS +m4_pattern_allow([^BOOST_SYSTEM_(LIBS|LDFLAGS)$])dnl +LIBS="$LIBS $BOOST_SYSTEM_LIBS" +LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS" +BOOST_FIND_LIB([filesystem], [$1], + [boost/filesystem/path.hpp], [boost::filesystem::path p;]) +if test $enable_static_boost = yes && test $boost_major_version -ge 135; then + AC_SUBST([BOOST_FILESYSTEM_LIBS], ["$BOOST_FILESYSTEM_LIBS $BOOST_SYSTEM_LIBS"]) +fi +LIBS=$boost_filesystem_save_LIBS +LDFLAGS=$boost_filesystem_save_LDFLAGS +])# BOOST_FILESYSTEM + + +# BOOST_FOREACH() +# --------------- +# Look for Boost.Foreach +BOOST_DEFUN([Foreach], +[BOOST_FIND_HEADER([boost/foreach.hpp])]) + + +# BOOST_FORMAT() +# -------------- +# Look for Boost.Format +# Note: we can't check for boost/format/format_fwd.hpp because the header isn't +# standalone. It can't be compiled because it triggers the following error: +# boost/format/detail/config_macros.hpp:88: error: 'locale' in namespace 'std' +# does not name a type +BOOST_DEFUN([Format], +[BOOST_FIND_HEADER([boost/format.hpp])]) + + +# BOOST_FUNCTION() +# ---------------- +# Look for Boost.Function +BOOST_DEFUN([Function], +[BOOST_FIND_HEADER([boost/function.hpp])]) + + +# BOOST_GEOMETRY() +# ---------------- +# Look for Boost.Geometry (new since 1.47.0). +BOOST_DEFUN([Geometry], +[BOOST_FIND_HEADER([boost/geometry.hpp]) +])# BOOST_GEOMETRY + + +# BOOST_GRAPH([PREFERRED-RT-OPT]) +# ------------------------------- +# Look for Boost.Graphs. For the documentation of PREFERRED-RT-OPT, see the +# documentation of BOOST_FIND_LIB above. +BOOST_DEFUN([Graph], +[BOOST_FIND_LIB([graph], [$1], + [boost/graph/adjacency_list.hpp], [boost::adjacency_list<> g;]) +])# BOOST_GRAPH + + +# BOOST_IOSTREAMS([PREFERRED-RT-OPT]) +# ----------------------------------- +# Look for Boost.IOStreams. For the documentation of PREFERRED-RT-OPT, see the +# documentation of BOOST_FIND_LIB above. +BOOST_DEFUN([IOStreams], +[BOOST_FIND_LIB([iostreams], [$1], + [boost/iostreams/device/file_descriptor.hpp], + [boost::iostreams::file_descriptor fd; fd.close();]) +])# BOOST_IOSTREAMS + + +# BOOST_HASH() +# ------------ +# Look for Boost.Functional/Hash +BOOST_DEFUN([Hash], +[BOOST_FIND_HEADER([boost/functional/hash.hpp])]) + + +# BOOST_LAMBDA() +# -------------- +# Look for Boost.Lambda +BOOST_DEFUN([Lambda], +[BOOST_FIND_HEADER([boost/lambda/lambda.hpp])]) + + +# BOOST_LOG([PREFERRED-RT-OPT]) +# ----------------------------- +# Look for Boost.Log For the documentation of PREFERRED-RT-OPT, see the +# documentation of BOOST_FIND_LIB above. +BOOST_DEFUN([Log], +[BOOST_FIND_LIB([log], [$1], + [boost/log/core/core.hpp], + [boost::log::attribute a; a.get_value();]) +])# BOOST_LOG + + +# BOOST_LOG_SETUP([PREFERRED-RT-OPT]) +# ----------------------------------- +# Look for Boost.Log For the documentation of PREFERRED-RT-OPT, see the +# documentation of BOOST_FIND_LIB above. +BOOST_DEFUN([Log_Setup], +[AC_REQUIRE([BOOST_LOG])dnl +BOOST_FIND_LIB([log_setup], [$1], + [boost/log/utility/init/from_settings.hpp], + [boost::log::basic_settings bs; bs.empty();]) +])# BOOST_LOG_SETUP + + +# BOOST_MATH() +# ------------ +# Look for Boost.Math +# TODO: This library isn't header-only but it comes in multiple different +# flavors that don't play well with BOOST_FIND_LIB (e.g, libboost_math_c99, +# libboost_math_c99f, libboost_math_c99l, libboost_math_tr1, +# libboost_math_tr1f, libboost_math_tr1l). This macro must be fixed to do the +# right thing anyway. +BOOST_DEFUN([Math], +[BOOST_FIND_HEADER([boost/math/special_functions.hpp])]) + +# BOOST_MPI([PREFERRED-RT-OPT]) +# ------------------------------- +# Look for Boost MPI. For the documentation of PREFERRED-RT-OPT, see the +# documentation of BOOST_FIND_LIB above. Uses MPICXX variable if it is +# set, otherwise tries CXX +# +BOOST_DEFUN([MPI], +[boost_save_CXX=${CXX} +boost_save_CXXCPP=${CXXCPP} +if test x"${MPICXX}" != x; then + CXX=${MPICXX} + CXXCPP="${MPICXX} -E" +fi +BOOST_FIND_LIB([mpi], [$1], + [boost/mpi.hpp], + [int argc = 0; + char **argv = 0; + boost::mpi::environment env(argc,argv);]) +CXX=${boost_save_CXX} +CXXCPP=${boost_save_CXXCPP} +])# BOOST_MPI + + +# BOOST_MULTIARRAY() +# ------------------ +# Look for Boost.MultiArray +BOOST_DEFUN([MultiArray], +[BOOST_FIND_HEADER([boost/multi_array.hpp])]) + + +# BOOST_NUMERIC_CONVERSION() +# -------------------------- +# Look for Boost.NumericConversion (policy-based numeric conversion) +BOOST_DEFUN([Numeric_Conversion], +[BOOST_FIND_HEADER([boost/numeric/conversion/converter.hpp]) +])# BOOST_NUMERIC_CONVERSION + + +# BOOST_OPTIONAL() +# ---------------- +# Look for Boost.Optional +BOOST_DEFUN([Optional], +[BOOST_FIND_HEADER([boost/optional.hpp])]) + + +# BOOST_PREPROCESSOR() +# -------------------- +# Look for Boost.Preprocessor +BOOST_DEFUN([Preprocessor], +[BOOST_FIND_HEADER([boost/preprocessor/repeat.hpp])]) + + +# BOOST_UNORDERED() +# ----------------- +# Look for Boost.Unordered +BOOST_DEFUN([Unordered], +[BOOST_FIND_HEADER([boost/unordered_map.hpp])]) + + +# BOOST_UUID() +# ------------ +# Look for Boost.Uuid +BOOST_DEFUN([Uuid], +[BOOST_FIND_HEADER([boost/uuid/uuid.hpp])]) + + +# BOOST_PROGRAM_OPTIONS([PREFERRED-RT-OPT]) +# ----------------------------------------- +# Look for Boost.Program_options. For the documentation of PREFERRED-RT-OPT, +# see the documentation of BOOST_FIND_LIB above. +BOOST_DEFUN([Program_Options], +[BOOST_FIND_LIB([program_options], [$1], + [boost/program_options.hpp], + [boost::program_options::options_description d("test");]) +])# BOOST_PROGRAM_OPTIONS + + + +# _BOOST_PYTHON_CONFIG(VARIABLE, FLAG) +# ------------------------------------ +# Save VARIABLE, and define it via `python-config --FLAG`. +# Substitute BOOST_PYTHON_VARIABLE. +m4_define([_BOOST_PYTHON_CONFIG], +[AC_SUBST([BOOST_PYTHON_$1], + [`python-config --$2 2>/dev/null`])dnl +boost_python_save_$1=$$1 +$1="$$1 $BOOST_PYTHON_$1"]) + + +# BOOST_PYTHON([PREFERRED-RT-OPT]) +# -------------------------------- +# Look for Boost.Python. For the documentation of PREFERRED-RT-OPT, +# see the documentation of BOOST_FIND_LIB above. +BOOST_DEFUN([Python], +[_BOOST_PYTHON_CONFIG([CPPFLAGS], [includes]) +_BOOST_PYTHON_CONFIG([LDFLAGS], [ldflags]) +_BOOST_PYTHON_CONFIG([LIBS], [libs]) +m4_pattern_allow([^BOOST_PYTHON_MODULE$])dnl +BOOST_FIND_LIB([python], [$1], + [boost/python.hpp], + [], [BOOST_PYTHON_MODULE(empty) {}]) +CPPFLAGS=$boost_python_save_CPPFLAGS +LDFLAGS=$boost_python_save_LDFLAGS +LIBS=$boost_python_save_LIBS +])# BOOST_PYTHON + + +# BOOST_REF() +# ----------- +# Look for Boost.Ref +BOOST_DEFUN([Ref], +[BOOST_FIND_HEADER([boost/ref.hpp])]) + + +# BOOST_REGEX([PREFERRED-RT-OPT]) +# ------------------------------- +# Look for Boost.Regex. For the documentation of PREFERRED-RT-OPT, see the +# documentation of BOOST_FIND_LIB above. +BOOST_DEFUN([Regex], +[BOOST_FIND_LIB([regex], [$1], + [boost/regex.hpp], + [boost::regex exp("*"); boost::regex_match("foo", exp);]) +])# BOOST_REGEX + + +# BOOST_SERIALIZATION([PREFERRED-RT-OPT]) +# --------------------------------------- +# Look for Boost.Serialization. For the documentation of PREFERRED-RT-OPT, see +# the documentation of BOOST_FIND_LIB above. +BOOST_DEFUN([Serialization], +[BOOST_FIND_LIB([serialization], [$1], + [boost/archive/text_oarchive.hpp], + [std::ostream* o = 0; // Cheap way to get an ostream... + boost::archive::text_oarchive t(*o);]) +])# BOOST_SERIALIZATION + + +# BOOST_SIGNALS([PREFERRED-RT-OPT]) +# --------------------------------- +# Look for Boost.Signals. For the documentation of PREFERRED-RT-OPT, see the +# documentation of BOOST_FIND_LIB above. +BOOST_DEFUN([Signals], +[BOOST_FIND_LIB([signals], [$1], + [boost/signal.hpp], + [boost::signal s;]) +])# BOOST_SIGNALS + + +# BOOST_SIGNALS2() +# ---------------- +# Look for Boost.Signals2 (new since 1.39.0). +BOOST_DEFUN([Signals2], +[BOOST_FIND_HEADER([boost/signals2.hpp]) +])# BOOST_SIGNALS2 + + +# BOOST_SMART_PTR() +# ----------------- +# Look for Boost.SmartPtr +BOOST_DEFUN([Smart_Ptr], +[BOOST_FIND_HEADER([boost/scoped_ptr.hpp]) +BOOST_FIND_HEADER([boost/shared_ptr.hpp]) +]) + + +# BOOST_STATICASSERT() +# -------------------- +# Look for Boost.StaticAssert +BOOST_DEFUN([StaticAssert], +[BOOST_FIND_HEADER([boost/static_assert.hpp])]) + + +# BOOST_STRING_ALGO() +# ------------------- +# Look for Boost.StringAlgo +BOOST_DEFUN([String_Algo], +[BOOST_FIND_HEADER([boost/algorithm/string.hpp]) +]) + + +# BOOST_SYSTEM([PREFERRED-RT-OPT]) +# -------------------------------- +# Look for Boost.System. For the documentation of PREFERRED-RT-OPT, see the +# documentation of BOOST_FIND_LIB above. This library was introduced in Boost +# 1.35.0. +BOOST_DEFUN([System], +[BOOST_FIND_LIB([system], [$1], + [boost/system/error_code.hpp], + [boost::system::error_code e; e.clear();]) +])# BOOST_SYSTEM + + +# BOOST_TEST([PREFERRED-RT-OPT]) +# ------------------------------ +# Look for Boost.Test. For the documentation of PREFERRED-RT-OPT, see the +# documentation of BOOST_FIND_LIB above. +BOOST_DEFUN([Test], +[m4_pattern_allow([^BOOST_CHECK$])dnl +BOOST_FIND_LIB([unit_test_framework], [$1], + [boost/test/unit_test.hpp], [BOOST_CHECK(2 == 2);], + [using boost::unit_test::test_suite; + test_suite* init_unit_test_suite(int argc, char ** argv) + { return NULL; }]) +])# BOOST_TEST + + +# BOOST_THREADS([PREFERRED-RT-OPT]) +# --------------------------------- +# Look for Boost.Thread. For the documentation of PREFERRED-RT-OPT, see the +# documentation of BOOST_FIND_LIB above. +# FIXME: Provide an alias "BOOST_THREAD". +BOOST_DEFUN([Threads], +[dnl Having the pthread flag is required at least on GCC3 where +dnl boost/thread.hpp would complain if we try to compile without +dnl -pthread on GNU/Linux. +AC_REQUIRE([_BOOST_PTHREAD_FLAG])dnl +boost_threads_save_LIBS=$LIBS +boost_threads_save_LDFLAGS=$LDFLAGS +boost_threads_save_CPPFLAGS=$CPPFLAGS +# Link-time dependency from thread to system was added as of 1.49.0. +if test $boost_major_version -ge 149; then +BOOST_SYSTEM([$1]) +fi # end of the Boost.System check. +m4_pattern_allow([^BOOST_SYSTEM_(LIBS|LDFLAGS)$])dnl +LIBS="$LIBS $BOOST_SYSTEM_LIBS $boost_cv_pthread_flag" +LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS" +# Yes, we *need* to put the -pthread thing in CPPFLAGS because with GCC3, +# boost/thread.hpp will trigger a #error if -pthread isn't used: +# boost/config/requires_threads.hpp:47:5: #error "Compiler threading support +# is not turned on. Please set the correct command line options for +# threading: -pthread (Linux), -pthreads (Solaris) or -mthreads (Mingw32)" +CPPFLAGS="$CPPFLAGS $boost_cv_pthread_flag" + +# When compiling for the Windows platform, the threads library is named +# differently. +case $host_os in + (*mingw*) + BOOST_FIND_LIB([thread_win32], [$1], + [boost/thread.hpp], [boost::thread t; boost::mutex m;]) + BOOST_THREAD_LDFLAGS=$BOOST_THREAD_WIN32_LDFLAGS + BOOST_THREAD_LDPATH=$BOOST_THREAD_WIN32_LDPATH + BOOST_THREAD_LIBS=$BOOST_THREAD_WIN32_LIBS + ;; + (*) + BOOST_FIND_LIB([thread], [$1], + [boost/thread.hpp], [boost::thread t; boost::mutex m;]) + ;; +esac + +BOOST_THREAD_LIBS="$BOOST_THREAD_LIBS $BOOST_SYSTEM_LIBS $boost_cv_pthread_flag" +BOOST_THREAD_LDFLAGS="$BOOST_SYSTEM_LDFLAGS" +BOOST_CPPFLAGS="$BOOST_CPPFLAGS $boost_cv_pthread_flag" +LIBS=$boost_threads_save_LIBS +LDFLAGS=$boost_threads_save_LDFLAGS +CPPFLAGS=$boost_threads_save_CPPFLAGS +])# BOOST_THREADS + + +# BOOST_TOKENIZER() +# ----------------- +# Look for Boost.Tokenizer +BOOST_DEFUN([Tokenizer], +[BOOST_FIND_HEADER([boost/tokenizer.hpp])]) + + +# BOOST_TRIBOOL() +# --------------- +# Look for Boost.Tribool +BOOST_DEFUN([Tribool], +[BOOST_FIND_HEADER([boost/logic/tribool_fwd.hpp]) +BOOST_FIND_HEADER([boost/logic/tribool.hpp]) +]) + + +# BOOST_TUPLE() +# ------------- +# Look for Boost.Tuple +BOOST_DEFUN([Tuple], +[BOOST_FIND_HEADER([boost/tuple/tuple.hpp])]) + + +# BOOST_TYPETRAITS() +# -------------------- +# Look for Boost.TypeTraits +BOOST_DEFUN([TypeTraits], +[BOOST_FIND_HEADER([boost/type_traits.hpp])]) + + +# BOOST_UTILITY() +# --------------- +# Look for Boost.Utility (noncopyable, result_of, base-from-member idiom, +# etc.) +BOOST_DEFUN([Utility], +[BOOST_FIND_HEADER([boost/utility.hpp])]) + + +# BOOST_VARIANT() +# --------------- +# Look for Boost.Variant. +BOOST_DEFUN([Variant], +[BOOST_FIND_HEADER([boost/variant/variant_fwd.hpp]) +BOOST_FIND_HEADER([boost/variant.hpp])]) + +# BOOST_POINTERCONTAINER() +# ------------------------ +# Look for Boost.PointerContainer +BOOST_DEFUN([Pointer_Container], +[BOOST_FIND_HEADER([boost/ptr_container/ptr_deque.hpp]) +BOOST_FIND_HEADER([boost/ptr_container/ptr_list.hpp]) +BOOST_FIND_HEADER([boost/ptr_container/ptr_vector.hpp]) +BOOST_FIND_HEADER([boost/ptr_container/ptr_array.hpp]) +BOOST_FIND_HEADER([boost/ptr_container/ptr_set.hpp]) +BOOST_FIND_HEADER([boost/ptr_container/ptr_map.hpp]) +])# BOOST_POINTERCONTAINER + +# BOOST_WAVE([PREFERRED-RT-OPT]) +# ------------------------------ +# NOTE: If you intend to use Wave/Spirit with thread support, make sure you +# call BOOST_THREADS first. +# Look for Boost.Wave. For the documentation of PREFERRED-RT-OPT, see the +# documentation of BOOST_FIND_LIB above. +BOOST_DEFUN([Wave], +[AC_REQUIRE([BOOST_FILESYSTEM])dnl +AC_REQUIRE([BOOST_DATE_TIME])dnl +boost_wave_save_LIBS=$LIBS +boost_wave_save_LDFLAGS=$LDFLAGS +m4_pattern_allow([^BOOST_((FILE)?SYSTEM|DATE_TIME|THREAD)_(LIBS|LDFLAGS)$])dnl +LIBS="$LIBS $BOOST_SYSTEM_LIBS $BOOST_FILESYSTEM_LIBS $BOOST_DATE_TIME_LIBS \ +$BOOST_THREAD_LIBS" +LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS $BOOST_FILESYSTEM_LDFLAGS \ +$BOOST_DATE_TIME_LDFLAGS $BOOST_THREAD_LDFLAGS" +BOOST_FIND_LIB([wave], [$1], + [boost/wave.hpp], + [boost::wave::token_id id; get_token_name(id);]) +LIBS=$boost_wave_save_LIBS +LDFLAGS=$boost_wave_save_LDFLAGS +])# BOOST_WAVE + + +# BOOST_XPRESSIVE() +# ----------------- +# Look for Boost.Xpressive (new since 1.36.0). +BOOST_DEFUN([Xpressive], +[BOOST_FIND_HEADER([boost/xpressive/xpressive.hpp])]) + + +# ----------------- # +# Internal helpers. # +# ----------------- # + + +# _BOOST_PTHREAD_FLAG() +# --------------------- +# Internal helper for BOOST_THREADS. Based on ACX_PTHREAD: +# http://autoconf-archive.cryp.to/acx_pthread.html +AC_DEFUN([_BOOST_PTHREAD_FLAG], +[AC_REQUIRE([AC_PROG_CXX])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_LANG_PUSH([C++])dnl +AC_CACHE_CHECK([for the flags needed to use pthreads], [boost_cv_pthread_flag], +[ boost_cv_pthread_flag= + # The ordering *is* (sometimes) important. Some notes on the + # individual items follow: + # (none): in case threads are in libc; should be tried before -Kthread and + # other compiler flags to prevent continual compiler warnings + # -lpthreads: AIX (must check this before -lpthread) + # -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) + # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) + # -llthread: LinuxThreads port on FreeBSD (also preferred to -pthread) + # -pthread: GNU Linux/GCC (kernel threads), BSD/GCC (userland threads) + # -pthreads: Solaris/GCC + # -mthreads: MinGW32/GCC, Lynx/GCC + # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it + # doesn't hurt to check since this sometimes defines pthreads too; + # also defines -D_REENTRANT) + # ... -mt is also the pthreads flag for HP/aCC + # -lpthread: GNU Linux, etc. + # --thread-safe: KAI C++ + case $host_os in #( + *solaris*) + # On Solaris (at least, for some versions), libc contains stubbed + # (non-functional) versions of the pthreads routines, so link-based + # tests will erroneously succeed. (We need to link with -pthreads/-mt/ + # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather + # a function called by this macro, so we could check for that, but + # who knows whether they'll stub that too in a future libc.) So, + # we'll just look for -pthreads and -lpthread first: + boost_pthread_flags="-pthreads -lpthread -mt -pthread";; #( + *) + boost_pthread_flags="-lpthreads -Kthread -kthread -llthread -pthread \ + -pthreads -mthreads -lpthread --thread-safe -mt";; + esac + # Generate the test file. + AC_LANG_CONFTEST([AC_LANG_PROGRAM([#include ], + [pthread_t th; pthread_join(th, 0); + pthread_attr_init(0); pthread_cleanup_push(0, 0); + pthread_create(0,0,0,0); pthread_cleanup_pop(0);])]) + for boost_pthread_flag in '' $boost_pthread_flags; do + boost_pthread_ok=false +dnl Re-use the test file already generated. + boost_pthreads__save_LIBS=$LIBS + LIBS="$LIBS $boost_pthread_flag" + AC_LINK_IFELSE([], + [if grep ".*$boost_pthread_flag" conftest.err; then + echo "This flag seems to have triggered warnings" >&AS_MESSAGE_LOG_FD + else + boost_pthread_ok=:; boost_cv_pthread_flag=$boost_pthread_flag + fi]) + LIBS=$boost_pthreads__save_LIBS + $boost_pthread_ok && break + done +]) +AC_LANG_POP([C++])dnl +])# _BOOST_PTHREAD_FLAG + + +# _BOOST_gcc_test(MAJOR, MINOR) +# ----------------------------- +# Internal helper for _BOOST_FIND_COMPILER_TAG. +m4_define([_BOOST_gcc_test], +["defined __GNUC__ && __GNUC__ == $1 && __GNUC_MINOR__ == $2 && !defined __ICC @ gcc$1$2"])dnl + + +# _BOOST_FIND_COMPILER_TAG() +# -------------------------- +# Internal. When Boost is installed without --layout=system, each library +# filename will hold a suffix that encodes the compiler used during the +# build. The Boost build system seems to call this a `tag'. +AC_DEFUN([_BOOST_FIND_COMPILER_TAG], +[AC_REQUIRE([AC_PROG_CXX])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_CACHE_CHECK([for the toolset name used by Boost for $CXX], [boost_cv_lib_tag], +[boost_cv_lib_tag=unknown +if test x$boost_cv_inc_path != xno; then + AC_LANG_PUSH([C++])dnl + # The following tests are mostly inspired by boost/config/auto_link.hpp + # The list is sorted to most recent/common to oldest compiler (in order + # to increase the likelihood of finding the right compiler with the + # least number of compilation attempt). + # Beware that some tests are sensible to the order (for instance, we must + # look for MinGW before looking for GCC3). + # I used one compilation test per compiler with a #error to recognize + # each compiler so that it works even when cross-compiling (let me know + # if you know a better approach). + # Known missing tags (known from Boost's tools/build/v2/tools/common.jam): + # como, edg, kcc, bck, mp, sw, tru, xlc + # I'm not sure about my test for `il' (be careful: Intel's ICC pre-defines + # the same defines as GCC's). + for i in \ + _BOOST_gcc_test(4, 8) \ + _BOOST_gcc_test(4, 7) \ + _BOOST_gcc_test(4, 6) \ + _BOOST_gcc_test(4, 5) \ + _BOOST_gcc_test(4, 4) \ + _BOOST_gcc_test(4, 3) \ + _BOOST_gcc_test(4, 2) \ + _BOOST_gcc_test(4, 1) \ + _BOOST_gcc_test(4, 0) \ + "defined __GNUC__ && __GNUC__ == 3 && !defined __ICC \ + && (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \ + || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw" \ + _BOOST_gcc_test(3, 4) \ + _BOOST_gcc_test(3, 3) \ + "defined _MSC_VER && _MSC_VER >= 1500 @ vc90" \ + "defined _MSC_VER && _MSC_VER == 1400 @ vc80" \ + _BOOST_gcc_test(3, 2) \ + "defined _MSC_VER && _MSC_VER == 1310 @ vc71" \ + _BOOST_gcc_test(3, 1) \ + _BOOST_gcc_test(3, 0) \ + "defined __BORLANDC__ @ bcb" \ + "defined __ICC && (defined __unix || defined __unix__) @ il" \ + "defined __ICL @ iw" \ + "defined _MSC_VER && _MSC_VER == 1300 @ vc7" \ + _BOOST_gcc_test(2, 95) \ + "defined __MWERKS__ && __MWERKS__ <= 0x32FF @ cw9" \ + "defined _MSC_VER && _MSC_VER < 1300 && !defined UNDER_CE @ vc6" \ + "defined _MSC_VER && _MSC_VER < 1300 && defined UNDER_CE @ evc4" \ + "defined __MWERKS__ && __MWERKS__ <= 0x31FF @ cw8" + do + boost_tag_test=`expr "X$i" : 'X\([[^@]]*\) @ '` + boost_tag=`expr "X$i" : 'X[[^@]]* @ \(.*\)'` + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +#if $boost_tag_test +/* OK */ +#else +# error $boost_tag_test +#endif +]])], [boost_cv_lib_tag=$boost_tag; break], []) + done +AC_LANG_POP([C++])dnl + case $boost_cv_lib_tag in #( + # Some newer (>= 1.35?) versions of Boost seem to only use "gcc" as opposed + # to "gcc41" for instance. + *-gcc | *'-gcc ') :;; #( Don't re-add -gcc: it's already in there. + gcc*) + boost_tag_x= + case $host_os in #( + darwin*) + if test $boost_major_version -ge 136; then + # The `x' added in r46793 of Boost. + boost_tag_x=x + fi;; + esac + # We can specify multiple tags in this variable because it's used by + # BOOST_FIND_LIB that does a `for tag in -$boost_cv_lib_tag' ... + boost_cv_lib_tag="$boost_tag_x$boost_cv_lib_tag -${boost_tag_x}gcc" + ;; #( + unknown) + AC_MSG_WARN([[could not figure out which toolset name to use for $CXX]]) + boost_cv_lib_tag= + ;; + esac +fi])dnl end of AC_CACHE_CHECK +])# _BOOST_FIND_COMPILER_TAG + + +# _BOOST_GUESS_WHETHER_TO_USE_MT() +# -------------------------------- +# Compile a small test to try to guess whether we should favor MT (Multi +# Thread) flavors of Boost. Sets boost_guess_use_mt accordingly. +AC_DEFUN([_BOOST_GUESS_WHETHER_TO_USE_MT], +[# Check whether we do better use `mt' even though we weren't ask to. +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +#if defined _REENTRANT || defined _MT || defined __MT__ +/* use -mt */ +#else +# error MT not needed +#endif +]])], [boost_guess_use_mt=:], [boost_guess_use_mt=false]) +]) + +# _BOOST_AC_LINK_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) +# ------------------------------------------------------------------- +# Fork of _AC_LINK_IFELSE that preserves conftest.o across calls. Fragile, +# will break when Autoconf changes its internals. Requires that you manually +# rm -f conftest.$ac_objext in between to really different tests, otherwise +# you will try to link a conftest.o left behind by a previous test. +# Used to aggressively optimize BOOST_FIND_LIB (see the big comment in this +# macro). +# +# Don't use "break" in the actions, as it would short-circuit some code +# this macro runs after the actions. +m4_define([_BOOST_AC_LINK_IFELSE], +[m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])dnl +rm -f conftest$ac_exeext +boost_save_ac_ext=$ac_ext +boost_use_source=: +# If we already have a .o, re-use it. We change $ac_ext so that $ac_link +# tries to link the existing object file instead of compiling from source. +test -f conftest.$ac_objext && ac_ext=$ac_objext && boost_use_source=false && + _AS_ECHO_LOG([re-using the existing conftest.$ac_objext]) +AS_IF([_AC_DO_STDERR($ac_link) && { + test -z "$ac_[]_AC_LANG_ABBREV[]_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_executable_p conftest$ac_exeext +dnl FIXME: use AS_TEST_X instead when 2.61 is widespread enough. + }], + [$2], + [if $boost_use_source; then + _AC_MSG_LOG_CONFTEST + fi + $3]) +ac_objext=$boost_save_ac_objext +ac_ext=$boost_save_ac_ext +dnl Delete also the IPA/IPO (Inter Procedural Analysis/Optimization) +dnl information created by the PGI compiler (conftest_ipa8_conftest.oo), +dnl as it would interfere with the next link command. +rm -f core conftest.err conftest_ipa8_conftest.oo \ + conftest$ac_exeext m4_ifval([$1], [conftest.$ac_ext])[]dnl +])# _BOOST_AC_LINK_IFELSE + +# Local Variables: +# mode: autoconf +# End: diff --git a/tests/libs/boost-mpi/m4/compiler_family.m4 b/tests/libs/boost-mpi/m4/compiler_family.m4 new file mode 100644 index 0000000000..22ec81b2ca --- /dev/null +++ b/tests/libs/boost-mpi/m4/compiler_family.m4 @@ -0,0 +1,38 @@ +# SYNOPSIS +# +# Test for OHPC supported compiler toolchains +# +# COMPILER_FAMILY() +# +# DESCRIPTION +# +# Queries configuration environment to detect compiler toolchain +# loaded via Lmod. Sets CC, CXX, and FC to match supported +# toolchains. +# +# CONTRIBUTORS +# +# Karl W. Schulz + +AC_DEFUN([OHPC_COMPILER_FAMILY], +[ + +AC_MSG_CHECKING([for loaded OHPC compiler toolchain]) + +if test "x$LMOD_FAMILY_COMPILER" = "xgnu"; then + CC=gcc + CXX=g++ + FC=gfortran + AC_MSG_RESULT([gnu]) +elif test "x$LMOD_FAMILY_COMPILER" = "xintel"; then + CC=icc + CXX=icpc + FC=ifort + AC_MSG_RESULT([intel]) +else + AC_MSG_RESULT([unknown]) + echo + AC_ERROR([Unknown compiler family - please load a compiler toolchain.]) +fi + +]) diff --git a/tests/libs/boost-mpi/ohpc-tests/test_mpi_families b/tests/libs/boost-mpi/ohpc-tests/test_mpi_families new file mode 100755 index 0000000000..94e0375c31 --- /dev/null +++ b/tests/libs/boost-mpi/ohpc-tests/test_mpi_families @@ -0,0 +1,43 @@ +#!/bin/bash +# -*-sh-*- + +TEST_LOGS="" +MAKEFLAGS="" + +source ./TEST_ENV || exit 1 +source ./common/functions || exit 1 + +cd libs/boost-mpi || exit 1 + +export BATS_JUNIT_CLASS="Boost-MPI" + +# bootstrap the local autotools project if necessary + +./bootstrap || exit 1 + +for compiler in $COMPILER_FAMILIES ; do + for mpi in $MPI_FAMILIES ; do + + echo " " + echo " " + echo "-------------------------------------------------------" + echo "Libraries: Boost MPI tests: $compiler-$mpi" + echo "-------------------------------------------------------" + + module purge || exit 1 + module load prun || exit 1 + module load $compiler || exit 1 + module load $mpi || exit 1 + module load boost || exit 1 + + ./configure || exit 1 + make clean || exit 1 + make -k check + + save_logs_mpi_family tests/module $compiler $mpi + save_logs_mpi_family tests/mpi/test $compiler $mpi + + make distclean + done +done + diff --git a/tests/libs/boost-mpi/tests/Makefile.am b/tests/libs/boost-mpi/tests/Makefile.am new file mode 100644 index 0000000000..c89ad3d598 --- /dev/null +++ b/tests/libs/boost-mpi/tests/Makefile.am @@ -0,0 +1 @@ +SUBDIRS = module mpi/test diff --git a/tests/libs/boost-mpi/tests/module/Makefile.am b/tests/libs/boost-mpi/tests/module/Makefile.am new file mode 100644 index 0000000000..3b27885444 --- /dev/null +++ b/tests/libs/boost-mpi/tests/module/Makefile.am @@ -0,0 +1 @@ +TESTS = test_module diff --git a/tests/libs/boost-mpi/tests/module/test_module b/tests/libs/boost-mpi/tests/module/test_module new file mode 100755 index 0000000000..10fd60f64f --- /dev/null +++ b/tests/libs/boost-mpi/tests/module/test_module @@ -0,0 +1,106 @@ +#!../../../../common/bats/bin/bats +# -*-sh-*- + +source ../../../../common/test_helper_functions.bash || exit 1 + +if [ -s ../../../../TEST_ENV ];then + source ../../../../TEST_ENV +fi + +PKG=BOOST +module=boost +library=libboost_mpi +header=boost/version.hpp +rpm=boost-$LMOD_FAMILY_COMPILER-$LMOD_FAMILY_MPI${DELIM} + +@test "[$PKG] Verify $PKG module is loaded and matches rpm version ($LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + module list $module | grep "1) $module" >& .cmd_output || exit 1 + run grep $module .cmd_output + assert_success + + # check version against rpm + local version="$(rpm -q --queryformat='%{VERSION}\n' $rpm)" + run cat .cmd_output + assert_output " 1) $module/$version" +} + +@test "[$PKG] Verify module ${PKG}_DIR is defined and exists ($LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + DIR=${PKG}_DIR + if [ -z ${!DIR} ];then + flunk "${PKG}_DIR directory not defined" + fi + + if [ ! -d ${!DIR} || -z "${!DIR}" ];then + flunk "directory ${!DIR} does not exist" + fi +} + +# ---------- +# Lib Tests +# ---------- + +@test "[$PKG] Verify module ${PKG}_LIB is defined and exists ($LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + LIB=${PKG}_LIB + + if [ -z ${!LIB} ];then + flunk "${PKG}_LIB directory not defined" + fi + + if [ ! -d ${!LIB} ];then + flunk "directory ${!LIB} does not exist" + fi +} + +@test "[$PKG] Verify dynamic library available in ${PKG}_LIB ($LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + LIB=${PKG}_LIB + + if [ -z ${!LIB} ];then + flunk "${PKG}_LIB directory not defined" + fi + + if [ ! -s ${!LIB}/${library}.so ];then + flunk "${library}.so does not exist" + fi +} + +@test "[$PKG] Verify static library is not present in ${PKG}_LIB ($LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + LIB=${PKG}_LIB + + if [ -z ${!LIB} ];then + flunk "${PKG}_LIB directory not defined" + fi + + if [ -e ${!LIB}/${library}.a ];then + flunk "${library}.a exists when not expecting it" + fi +} + +# -------------- +# Include Tests +# -------------- + +@test "[$PKG] Verify module ${PKG}_INC is defined and exists ($LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + INC=${PKG}_INC + + if [ -z ${!INC} ];then + flunk "${PKG}_INC directory not defined" + fi + + if [ ! -d ${!INC} ];then + flunk "directory ${!INC} does not exist" + fi +} + +@test "[$PKG] Verify header file is present in ${PKG}_INC ($LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + INC=${PKG}_INC + + if [ -z ${!INC} ];then + flunk "${PKG}_INC directory not defined" + fi + + if [ ! -s ${!INC}/${header} ];then + flunk "directory $header file does not exist" + fi +} + +rm -f .cmd_output diff --git a/tests/libs/boost-mpi/tests/mpi/test/Makefile.am b/tests/libs/boost-mpi/tests/mpi/test/Makefile.am new file mode 100644 index 0000000000..ec509a4cd3 --- /dev/null +++ b/tests/libs/boost-mpi/tests/mpi/test/Makefile.am @@ -0,0 +1,37 @@ +TESTS_ENVIRONMENT = BATS_NO_SUMMARY=1 +AM_CXXFLAGS = -I$(BOOST_INC) +AM_LDFLAGS = -L$(BOOST_LIB) -lboost_mpi -lboost_serialization + +# Test compilations/execution + +TESTS = all_gather_test +check_PROGRAMS = all_gather_test +all_gather_test_SOURCES = all_gather_test.cpp + +TESTS += all_reduce_test +check_PROGRAMS += all_reduce_test +all_reduce_test_SOURCES = all_reduce_test.cpp + +TESTS += all_to_all_test +check_PROGRAMS += all_to_all_test +all_to_all_test_SOURCES = all_to_all_test.cpp + +TESTS += groups_test +check_PROGRAMS += groups_test +groups_test_SOURCES = groups_test.cpp + +check_PROGRAMS += broadcast_test +broadcast_test_SOURCES = broadcast_test.cpp + +check_PROGRAMS += ring_test +ring_test_SOURCES = ring_test.cpp + +check_PROGRAMS += pointer_test +pointer_test_SOURCES = pointer_test.cpp + +check_PROGRAMS += nonblocking_test +nonblocking_test_SOURCES = nonblocking_test.cpp + +# Test execution through resource manager + +TESTS += rm_execution diff --git a/tests/libs/boost-mpi/tests/mpi/test/all_gather_test.cpp b/tests/libs/boost-mpi/tests/mpi/test/all_gather_test.cpp new file mode 100644 index 0000000000..a0543fd6d0 --- /dev/null +++ b/tests/libs/boost-mpi/tests/mpi/test/all_gather_test.cpp @@ -0,0 +1,108 @@ +// Copyright (C) 2005-2006 Douglas Gregor + +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// A test of the all_gather() collective. +#include +#include +#include +#include +#include +#include "gps_position.hpp" +#include +#include +#include +#include + +using boost::mpi::communicator; + +using boost::mpi::packed_skeleton_iarchive; +using boost::mpi::packed_skeleton_oarchive; + +template +void +all_gather_test(const communicator& comm, Generator generator, + const char* kind) +{ + typedef typename Generator::result_type value_type; + value_type value = generator(comm.rank()); + + using boost::mpi::all_gather; + + std::vector values; + if (comm.rank() == 0) { + std::cout << "Gathering " << kind << "..."; + std::cout.flush(); + } + + all_gather(comm, value, values); + + std::vector expected_values; + for (int p = 0; p < comm.size(); ++p) + expected_values.push_back(generator(p)); + BOOST_CHECK(values == expected_values); + if (comm.rank() == 0 && values == expected_values) + std::cout << "OK." << std::endl; + + (comm.barrier)(); +} + +// Generates integers to test with gather() +struct int_generator +{ + typedef int result_type; + + int operator()(int p) const { return 17 + p; } +}; + +// Generates GPS positions to test with gather() +struct gps_generator +{ + typedef gps_position result_type; + + gps_position operator()(int p) const + { + return gps_position(39 + p, 16, 20.2799); + } +}; + +struct string_generator +{ + typedef std::string result_type; + + std::string operator()(int p) const + { + std::string result = boost::lexical_cast(p); + result += " rosebud"; + if (p != 1) result += 's'; + return result; + } +}; + +struct string_list_generator +{ + typedef std::list result_type; + + std::list operator()(int p) const + { + std::list result; + for (int i = 0; i <= p; ++i) { + std::string value = boost::lexical_cast(i); + result.push_back(value); + } + return result; + } +}; + +int test_main(int argc, char* argv[]) +{ + boost::mpi::environment env(argc, argv); + communicator comm; + all_gather_test(comm, int_generator(), "integers"); + all_gather_test(comm, gps_generator(), "GPS positions"); + all_gather_test(comm, string_generator(), "string"); + all_gather_test(comm, string_list_generator(), "list of strings"); + return 0; +} diff --git a/tests/libs/boost-mpi/tests/mpi/test/all_reduce_test.cpp b/tests/libs/boost-mpi/tests/mpi/test/all_reduce_test.cpp new file mode 100644 index 0000000000..1486fceae5 --- /dev/null +++ b/tests/libs/boost-mpi/tests/mpi/test/all_reduce_test.cpp @@ -0,0 +1,316 @@ +// Copyright (C) 2005, 2006 Douglas Gregor. + +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// A test of the all_reduce() collective. +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using boost::mpi::communicator; + +// A simple point class that we can build, add, compare, and +// serialize. +struct point +{ + point() : x(0), y(0), z(0) { } + point(int x, int y, int z) : x(x), y(y), z(z) { } + + int x; + int y; + int z; + + private: + template + void serialize(Archiver& ar, unsigned int /*version*/) + { + ar & x & y & z; + } + + friend class boost::serialization::access; +}; + +std::ostream& operator<<(std::ostream& out, const point& p) +{ + return out << p.x << ' ' << p.y << ' ' << p.z; +} + +bool operator==(const point& p1, const point& p2) +{ + return p1.x == p2.x && p1.y == p2.y && p1.z == p2.z; +} + +bool operator!=(const point& p1, const point& p2) +{ + return !(p1 == p2); +} + +point operator+(const point& p1, const point& p2) +{ + return point(p1.x + p2.x, p1.y + p2.y, p1.z + p2.z); +} + +// test lexical order +bool operator<(const point& p1, const point& p2) +{ + return (p1.x < p2.x + ? true + : (p1.x > p2.x + ? false + : p1.y < p2.y )); +} + +namespace boost { namespace mpi { + + template <> + struct is_mpi_datatype : public mpl::true_ { }; + +} } // end namespace boost::mpi + +template +void +all_reduce_one_test(const communicator& comm, Generator generator, + const char* type_kind, Op op, const char* op_kind, + typename Generator::result_type init, bool in_place) +{ + typedef typename Generator::result_type value_type; + value_type value = generator(comm.rank()); + + using boost::mpi::all_reduce; + using boost::mpi::inplace; + + if (comm.rank() == 0) { + std::cout << "Reducing to " << op_kind << " of " << type_kind << "..."; + std::cout.flush(); + } + + value_type result_value; + if (in_place) { + all_reduce(comm, inplace(value), op); + result_value = value; + } else { + result_value = all_reduce(comm, value, op); + } + + // Compute expected result + std::vector generated_values; + for (int p = 0; p < comm.size(); ++p) + generated_values.push_back(generator(p)); + value_type expected_result = std::accumulate(generated_values.begin(), + generated_values.end(), + init, op); + BOOST_CHECK(result_value == expected_result); + if (result_value == expected_result && comm.rank() == 0) + std::cout << "OK." << std::endl; + + (comm.barrier)(); +} + +template +void +all_reduce_array_test(const communicator& comm, Generator generator, + const char* type_kind, Op op, const char* op_kind, + typename Generator::result_type init, bool in_place) +{ + typedef typename Generator::result_type value_type; + value_type value = generator(comm.rank()); + std::vector send(10, value); + + using boost::mpi::all_reduce; + using boost::mpi::inplace; + + if (comm.rank() == 0) { + char const* place = in_place ? "in place" : "out of place"; + std::cout << "Reducing (" << place << ") array to " << op_kind << " of " << type_kind << "..."; + std::cout.flush(); + } + std::vector result; + if (in_place) { + all_reduce(comm, inplace(&(send[0])), send.size(), op); + result.swap(send); + } else { + std::vector recv(10, value_type()); + all_reduce(comm, &(send[0]), send.size(), &(recv[0]), op); + result.swap(recv); + } + + // Compute expected result + std::vector generated_values; + for (int p = 0; p < comm.size(); ++p) + generated_values.push_back(generator(p)); + value_type expected_result = std::accumulate(generated_values.begin(), + generated_values.end(), + init, op); + + bool got_expected_result = (std::equal_range(result.begin(), result.end(), + expected_result) + == std::make_pair(result.begin(), result.end())); + BOOST_CHECK(got_expected_result); + if (got_expected_result && comm.rank() == 0) + std::cout << "OK." << std::endl; + + (comm.barrier)(); +} + +// Test the 4 families of all reduce: (value, array) X (in place, out of place) +template +void +all_reduce_test(const communicator& comm, Generator generator, + const char* type_kind, Op op, const char* op_kind, + typename Generator::result_type init) +{ + const bool in_place = true; + const bool out_of_place = false; + all_reduce_one_test(comm, generator, type_kind, op, op_kind, init, in_place); + all_reduce_one_test(comm, generator, type_kind, op, op_kind, init, out_of_place); + all_reduce_array_test(comm, generator, type_kind, op, op_kind, + init, in_place); + all_reduce_array_test(comm, generator, type_kind, op, op_kind, + init, out_of_place); +} + +// Generates integers to test with all_reduce() +struct int_generator +{ + typedef int result_type; + + int_generator(int base = 1) : base(base) { } + + int operator()(int p) const { return base + p; } + + private: + int base; +}; + +// Generate points to test with all_reduce() +struct point_generator +{ + typedef point result_type; + + point_generator(point origin) : origin(origin) { } + + point operator()(int p) const + { + return point(origin.x + 1, origin.y + 1, origin.z + 1); + } + + private: + point origin; +}; + +struct string_generator +{ + typedef std::string result_type; + + std::string operator()(int p) const + { + std::string result = boost::lexical_cast(p); + result += " rosebud"; + if (p != 1) result += 's'; + return result; + } +}; + +struct secret_int_bit_and +{ + int operator()(int x, int y) const { return x & y; } +}; + +struct wrapped_int +{ + wrapped_int() : value(0) { } + explicit wrapped_int(int value) : value(value) { } + + template + void serialize(Archive& ar, unsigned int /* version */) + { + ar & value; + } + + int value; +}; + +wrapped_int operator+(const wrapped_int& x, const wrapped_int& y) +{ + return wrapped_int(x.value + y.value); +} + +bool operator==(const wrapped_int& x, const wrapped_int& y) +{ + return x.value == y.value; +} + +bool operator<(const wrapped_int& x, const wrapped_int& y) +{ + return x.value < y.value; +} + +// Generates wrapped_its to test with all_reduce() +struct wrapped_int_generator +{ + typedef wrapped_int result_type; + + wrapped_int_generator(int base = 1) : base(base) { } + + wrapped_int operator()(int p) const { return wrapped_int(base + p); } + + private: + int base; +}; + +namespace boost { namespace mpi { + +// Make std::plus commutative. +template<> +struct is_commutative, wrapped_int> + : mpl::true_ { }; + +} } // end namespace boost::mpi + +int test_main(int argc, char* argv[]) +{ + using namespace boost::mpi; + environment env(argc, argv); + + communicator comm; + const bool in_place = true; + const bool out_of_place = false; + + // Built-in MPI datatypes with built-in MPI operations + all_reduce_test(comm, int_generator(), "integers", std::plus(), "sum", + 0); + all_reduce_test(comm, int_generator(), "integers", std::multiplies(), + "product", 1); + all_reduce_test(comm, int_generator(), "integers", maximum(), + "maximum", 0); + all_reduce_test(comm, int_generator(), "integers", minimum(), + "minimum", 2); + + // User-defined MPI datatypes with operations that have the + // same name as built-in operations. + all_reduce_test(comm, point_generator(point(0,0,0)), "points", + std::plus(), "sum", point()); + + // Built-in MPI datatypes with user-defined operations + all_reduce_test(comm, int_generator(17), "integers", secret_int_bit_and(), + "bitwise and", -1); + + // Arbitrary types with user-defined, commutative operations. + all_reduce_test(comm, wrapped_int_generator(17), "wrapped integers", + std::plus(), "sum", wrapped_int(0)); + + // Arbitrary types with (non-commutative) user-defined operations + all_reduce_test(comm, string_generator(), "strings", + std::plus(), "concatenation", std::string()); + + return 0; +} diff --git a/tests/libs/boost-mpi/tests/mpi/test/all_to_all_test.cpp b/tests/libs/boost-mpi/tests/mpi/test/all_to_all_test.cpp new file mode 100644 index 0000000000..4863a2cd08 --- /dev/null +++ b/tests/libs/boost-mpi/tests/mpi/test/all_to_all_test.cpp @@ -0,0 +1,113 @@ +// Copyright (C) 2005, 2006 Douglas Gregor. + +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// A test of the all_to_all() collective. +#include +#include +#include +#include +#include +#include "gps_position.hpp" +#include +#include +#include +#include + +using boost::mpi::communicator; + +using boost::mpi::packed_skeleton_iarchive; +using boost::mpi::packed_skeleton_oarchive; + +template +void +all_to_all_test(const communicator& comm, Generator generator, + const char* kind) +{ + typedef typename Generator::result_type value_type; + + using boost::mpi::all_to_all; + + std::vector in_values; + for (int p = 0; p < comm.size(); ++p) + in_values.push_back(generator((p + 1) * (comm.rank() + 1))); + + if (comm.rank() == 0) { + std::cout << "Performing all-to-all operation on " << kind << "..."; + std::cout.flush(); + } + std::vector out_values; + all_to_all(comm, in_values, out_values); + + for (int p = 0; p < comm.size(); ++p) { + BOOST_CHECK(out_values[p] == generator((p + 1) * (comm.rank() + 1))); + } + + if (comm.rank() == 0) { + std::cout << " done." << std::endl; + } + + (comm.barrier)(); +} + +// Generates integers to test with all_to_all() +struct int_generator +{ + typedef int result_type; + + int operator()(int p) const { return 17 + p; } +}; + +// Generates GPS positions to test with all_to_all() +struct gps_generator +{ + typedef gps_position result_type; + + gps_position operator()(int p) const + { + return gps_position(39 + p, 16, 20.2799); + } +}; + +struct string_generator +{ + typedef std::string result_type; + + std::string operator()(int p) const + { + std::string result = boost::lexical_cast(p); + result += " rosebud"; + if (p != 1) result += 's'; + return result; + } +}; + +struct string_list_generator +{ + typedef std::list result_type; + + std::list operator()(int p) const + { + std::list result; + for (int i = 0; i <= p; ++i) { + std::string value = boost::lexical_cast(i); + result.push_back(value); + } + return result; + } +}; + +int test_main(int argc, char* argv[]) +{ + boost::mpi::environment env(argc, argv); + + communicator comm; + all_to_all_test(comm, int_generator(), "integers"); + all_to_all_test(comm, gps_generator(), "GPS positions"); + all_to_all_test(comm, string_generator(), "string"); + all_to_all_test(comm, string_list_generator(), "list of strings"); + + return 0; +} diff --git a/tests/libs/boost-mpi/tests/mpi/test/broadcast_test.cpp b/tests/libs/boost-mpi/tests/mpi/test/broadcast_test.cpp new file mode 100644 index 0000000000..98c27c804e --- /dev/null +++ b/tests/libs/boost-mpi/tests/mpi/test/broadcast_test.cpp @@ -0,0 +1,153 @@ +// Copyright (C) 2005, 2006 Douglas Gregor. + +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// A test of the broadcast() collective. +#include +#include +#include +#include +#include +#include "gps_position.hpp" +#include +#include +#include +#include + +using boost::mpi::communicator; + +using boost::mpi::packed_skeleton_iarchive; +using boost::mpi::packed_skeleton_oarchive; + +template +void +broadcast_test(const communicator& comm, const T& bc_value, + const char* kind, int root = -1) +{ + if (root == -1) { + for (root = 0; root < comm.size(); ++root) + broadcast_test(comm, bc_value, kind, root); + } else { + using boost::mpi::broadcast; + + T value; + if (comm.rank() == root) { + value = bc_value; + std::cout << "Broadcasting " << kind << " from root " << root << "..."; + std::cout.flush(); + } + + broadcast(comm, value, root); + BOOST_CHECK(value == bc_value); + if (comm.rank() == root && value == bc_value) + std::cout << "OK." << std::endl; + } + + (comm.barrier)(); +} + +void +test_skeleton_and_content(const communicator& comm, int root = 0) +{ + using boost::mpi::content; + using boost::mpi::get_content; + using boost::make_counting_iterator; + using boost::mpi::broadcast; + + typedef std::list::iterator iterator; + + int list_size = comm.size() + 7; + if (comm.rank() == root) { + // Fill in the seed data + std::list original_list; + for (int i = 0; i < list_size; ++i) + original_list.push_back(i); + + // Build up the skeleton + packed_skeleton_oarchive oa(comm); + oa << original_list; + + // Broadcast the skeleton + std::cout << "Broadcasting integer list skeleton from root " << root + << "..."; + broadcast(comm, oa, root); + std::cout << "OK." << std::endl; + + // Broadcast the content + std::cout << "Broadcasting integer list content from root " << root + << "..."; + { + content c = get_content(original_list); + broadcast(comm, c, root); + } + std::cout << "OK." << std::endl; + + // Reverse the list, broadcast the content again + std::reverse(original_list.begin(), original_list.end()); + std::cout << "Broadcasting reversed integer list content from root " + << root << "..."; + { + content c = get_content(original_list); + broadcast(comm, c, root); + } + std::cout << "OK." << std::endl; + } else { + // Allocate some useless data, to try to get the addresses of the + // list's used later to be different across processes. + std::list junk_list(comm.rank() * 3 + 1, 17); + + // Receive the skeleton + packed_skeleton_iarchive ia(comm); + broadcast(comm, ia, root); + + // Build up a list to match the skeleton, and make sure it has the + // right structure (we have no idea what the data will be). + std::list transferred_list; + ia >> transferred_list; + BOOST_CHECK((int)transferred_list.size() == list_size); + + // Receive the content and check it + broadcast(comm, get_content(transferred_list), root); + BOOST_CHECK(std::equal(make_counting_iterator(0), + make_counting_iterator(list_size), + transferred_list.begin())); + + // Receive the reversed content and check it + broadcast(comm, get_content(transferred_list), root); + BOOST_CHECK(std::equal(make_counting_iterator(0), + make_counting_iterator(list_size), + transferred_list.rbegin())); + } + + (comm.barrier)(); +} + +int test_main(int argc, char* argv[]) +{ + boost::mpi::environment env(argc, argv); + + communicator comm; + if (comm.size() == 1) { + std::cerr << "ERROR: Must run the broadcast test with more than one " + << "process." << std::endl; + MPI_Abort(comm, -1); + } + + // Check transfer of individual objects + broadcast_test(comm, 17, "integers"); + broadcast_test(comm, gps_position(39,16,20.2799), "GPS positions"); + broadcast_test(comm, gps_position(26,25,30.0), "GPS positions"); + broadcast_test(comm, std::string("Rosie"), "string"); + + std::list strings; + strings.push_back("Hello"); + strings.push_back("MPI"); + strings.push_back("World"); + broadcast_test(comm, strings, "list of strings"); + + test_skeleton_and_content(comm, 0); + test_skeleton_and_content(comm, 1); + return 0; +} diff --git a/tests/libs/boost-mpi/tests/mpi/test/gps_position.hpp b/tests/libs/boost-mpi/tests/mpi/test/gps_position.hpp new file mode 100644 index 0000000000..109a3a9e54 --- /dev/null +++ b/tests/libs/boost-mpi/tests/mpi/test/gps_position.hpp @@ -0,0 +1,61 @@ +#ifndef GPS_POSITION_HPP +#define GPS_POSITION_HPP + +// Copyright Matthias Troyer +// 2005. Distributed under the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include + +class gps_position +{ +private: + friend class boost::serialization::access; + // When the class Archive corresponds to an output archive, the + // & operator is defined similar to <<. Likewise, when the class Archive + // is a type of input archive the & operator is defined similar to >>. + template + void serialize(Archive & ar, const unsigned int version) + { + ar & degrees & minutes & seconds; + } + int degrees; + int minutes; + float seconds; +public: + gps_position(){}; + gps_position(int d, int m, float s) : + degrees(d), minutes(m), seconds(s) + {} + + friend bool operator==(const gps_position& x, const gps_position& y) + { + return (x.degrees == y.degrees + && x.minutes == y.minutes + && x.seconds == y.seconds); + } + + inline friend bool operator!=(const gps_position& x, const gps_position& y) + { + return !(x == y); + } +}; + + +namespace boost { namespace mpi { + + template <> + struct is_mpi_datatype + : public mpl::and_ + < + is_mpi_datatype, + is_mpi_datatype + > + {}; + +} } +#endif diff --git a/tests/libs/boost-mpi/tests/mpi/test/groups_test.cpp b/tests/libs/boost-mpi/tests/mpi/test/groups_test.cpp new file mode 100644 index 0000000000..64e4a811c2 --- /dev/null +++ b/tests/libs/boost-mpi/tests/mpi/test/groups_test.cpp @@ -0,0 +1,59 @@ +// Copyright (C) 2013 Andreas Hehn , ETH Zurich + +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// A test of communicators created from groups. + +#include +#include +#include +#include +#include +#include + +namespace mpi = boost::mpi; + + +template +struct iota +{ + iota() : state(0){}; + T operator()() + { + return state++; + } + T state; +}; + +void group_test(const mpi::communicator& comm) +{ + std::vector grp_a_ranks(comm.size() / 2); + std::generate(grp_a_ranks.begin(),grp_a_ranks.end(),iota()); + + mpi::group grp_a = comm.group().include(grp_a_ranks.begin(),grp_a_ranks.end()); + mpi::group grp_b = comm.group().exclude(grp_a_ranks.begin(),grp_a_ranks.end()); + + mpi::communicator part_a(comm,grp_a); + mpi::communicator part_b(comm,grp_b); + + if(part_a) + { + std::cout << "comm rank: " << comm.rank() << " -> part_a rank:" << part_a.rank() << std::endl; + BOOST_CHECK(part_a.rank() == comm.rank()); + } + if(part_b) + { + std::cout << "comm rank: " << comm.rank() << " -> part_b rank:" << part_b.rank() << std::endl; + BOOST_CHECK(part_b.rank() == comm.rank() - comm.size()/2); + } +} + +int test_main(int argc, char* argv[]) +{ + mpi::environment env(argc,argv); + mpi::communicator comm; + group_test(comm); + return 0; +} diff --git a/tests/libs/boost-mpi/tests/mpi/test/nonblocking_test.cpp b/tests/libs/boost-mpi/tests/mpi/test/nonblocking_test.cpp new file mode 100644 index 0000000000..a3789d7dbd --- /dev/null +++ b/tests/libs/boost-mpi/tests/mpi/test/nonblocking_test.cpp @@ -0,0 +1,247 @@ +// Copyright (C) 2006 Douglas Gregor. + +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// A test of the nonblocking point-to-point operations. +#include +#include +#include +#include +#include "gps_position.hpp" +#include +#include +#include +#include +#include + +using boost::mpi::communicator; +using boost::mpi::request; +using boost::mpi::status; + +enum method_kind { + mk_wait_any, mk_test_any, mk_wait_all, mk_wait_all_keep, + mk_test_all, mk_test_all_keep, mk_wait_some, mk_wait_some_keep, + mk_test_some, mk_test_some_keep, + mk_all, // use to run all of the different methods + mk_all_except_test_all // use for serialized types +}; + +static const char* method_kind_names[mk_all] = { + "wait_any", + "test_any", + "wait_all", + "wait_all (keep results)", + "test_all", + "test_all (keep results)", + "wait_some", + "wait_some (keep results)", + "test_some", + "test_some (keep results)" +}; + + +template +void +nonblocking_test(const communicator& comm, const T* values, int num_values, + const char* kind, method_kind method = mk_all) +{ + using boost::mpi::wait_any; + using boost::mpi::test_any; + using boost::mpi::wait_all; + using boost::mpi::test_all; + using boost::mpi::wait_some; + using boost::mpi::test_some; + + if (method == mk_all || method == mk_all_except_test_all) { + nonblocking_test(comm, values, num_values, kind, mk_wait_any); + nonblocking_test(comm, values, num_values, kind, mk_test_any); + nonblocking_test(comm, values, num_values, kind, mk_wait_all); + nonblocking_test(comm, values, num_values, kind, mk_wait_all_keep); + if (method == mk_all) { + nonblocking_test(comm, values, num_values, kind, mk_test_all); + nonblocking_test(comm, values, num_values, kind, mk_test_all_keep); + } + nonblocking_test(comm, values, num_values, kind, mk_wait_some); + nonblocking_test(comm, values, num_values, kind, mk_wait_some_keep); + nonblocking_test(comm, values, num_values, kind, mk_test_some); + nonblocking_test(comm, values, num_values, kind, mk_test_some_keep); + } else { + if (comm.rank() == 0) { + std::cout << "Testing " << method_kind_names[method] + << " with " << kind << "..."; + std::cout.flush(); + } + + typedef std::pair::iterator> + status_iterator_pair; + + T incoming_value; + std::vector incoming_values(num_values); + + std::vector reqs; + // Send/receive the first value + reqs.push_back(comm.isend((comm.rank() + 1) % comm.size(), 0, values[0])); + reqs.push_back(comm.irecv((comm.rank() + comm.size() - 1) % comm.size(), + 0, incoming_value)); + + if (method != mk_wait_any && method != mk_test_any) { +#ifndef LAM_MPI + // We've run into problems here (with 0-length messages) with + // LAM/MPI on Mac OS X and x86-86 Linux. Will investigate + // further at a later time, but the problem only seems to occur + // when using shared memory, not TCP. + + // Send/receive an empty message + reqs.push_back(comm.isend((comm.rank() + 1) % comm.size(), 1)); + reqs.push_back(comm.irecv((comm.rank() + comm.size() - 1) % comm.size(), + 1)); +#endif + + // Send/receive an array + reqs.push_back(comm.isend((comm.rank() + 1) % comm.size(), 2, values, + num_values)); + reqs.push_back(comm.irecv((comm.rank() + comm.size() - 1) % comm.size(), + 2, &incoming_values.front(), num_values)); + } + + switch (method) { + case mk_wait_any: + if (wait_any(reqs.begin(), reqs.end()).second == reqs.begin()) + reqs[1].wait(); + else + reqs[0].wait(); + break; + + case mk_test_any: + { + boost::optional result; + do { + result = test_any(reqs.begin(), reqs.end()); + } while (!result); + if (result->second == reqs.begin()) + reqs[1].wait(); + else + reqs[0].wait(); + break; + } + + case mk_wait_all: + wait_all(reqs.begin(), reqs.end()); + break; + + case mk_wait_all_keep: + { + std::vector stats; + wait_all(reqs.begin(), reqs.end(), std::back_inserter(stats)); + } + break; + + case mk_test_all: + while (!test_all(reqs.begin(), reqs.end())) { /* Busy wait */ } + break; + + case mk_test_all_keep: + { + std::vector stats; + while (!test_all(reqs.begin(), reqs.end(), std::back_inserter(stats))) + /* Busy wait */; + } + break; + + case mk_wait_some: + { + std::vector::iterator pos = reqs.end(); + do { + pos = wait_some(reqs.begin(), pos); + } while (pos != reqs.begin()); + } + break; + + case mk_wait_some_keep: + { + std::vector stats; + std::vector::iterator pos = reqs.end(); + do { + pos = wait_some(reqs.begin(), pos, std::back_inserter(stats)).second; + } while (pos != reqs.begin()); + } + break; + + case mk_test_some: + { + std::vector::iterator pos = reqs.end(); + do { + pos = test_some(reqs.begin(), pos); + } while (pos != reqs.begin()); + } + break; + + case mk_test_some_keep: + { + std::vector stats; + std::vector::iterator pos = reqs.end(); + do { + pos = test_some(reqs.begin(), pos, std::back_inserter(stats)).second; + } while (pos != reqs.begin()); + } + break; + + default: + BOOST_CHECK(false); + } + + if (comm.rank() == 0) { + bool okay = true; + + if (!((incoming_value == values[0]))) + okay = false; + + if (method != mk_wait_any && method != mk_test_any + && !std::equal(incoming_values.begin(), incoming_values.end(), + values)) + okay = false; + + if (okay) + std::cout << "OK." << std::endl; + else + std::cerr << "ERROR!" << std::endl; + } + + BOOST_CHECK(incoming_value == values[0]); + + if (method != mk_wait_any && method != mk_test_any) + BOOST_CHECK(std::equal(incoming_values.begin(), incoming_values.end(), + values)); + } +} + +int test_main(int argc, char* argv[]) +{ + boost::mpi::environment env(argc, argv); + + communicator comm; + + int int_array[3] = {17, 42, 256}; + nonblocking_test(comm, int_array, 3, "integers"); + + gps_position gps_array[2] = { + gps_position(17, 42, .06), + gps_position(42, 17, .06) + }; + nonblocking_test(comm, gps_array, 2, "gps positions"); + + std::string string_array[2] = { "Hello", "World" }; + nonblocking_test(comm, string_array, 2, "strings", + mk_all_except_test_all); + + std::list lst_of_strings; + for (int i = 0; i < comm.size(); ++i) + lst_of_strings.push_back(boost::lexical_cast(i)); + + nonblocking_test(comm, &lst_of_strings, 1, "list of strings", + mk_all_except_test_all); + + return 0; +} diff --git a/tests/libs/boost-mpi/tests/mpi/test/pointer_test.cpp b/tests/libs/boost-mpi/tests/mpi/test/pointer_test.cpp new file mode 100644 index 0000000000..848b904aec --- /dev/null +++ b/tests/libs/boost-mpi/tests/mpi/test/pointer_test.cpp @@ -0,0 +1,44 @@ +// Copyright (C) 2005, 2006 Douglas Gregor. + +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + + +// a test of pointer serialization +#include +#include +#include + +class A +{ + public: + int i; + template + void serialize(Archive & ar, const unsigned int version) + { + ar & i; + } +}; + +int test_main(int argc, char* argv[]) +{ + boost::mpi::environment env(argc, argv); + boost::mpi::communicator world; + + if(world.rank() == 0) + { + boost::shared_ptr p(new A); + p->i = 42; + world.send(1, 0, p); + } + else if(world.rank() == 1) + { + boost::shared_ptr p; + world.recv(0, 0, p); + std::cout << p->i << std::endl; + BOOST_CHECK(p->i==42); + } + return 0; +} + diff --git a/tests/libs/boost-mpi/tests/mpi/test/ring_test.cpp b/tests/libs/boost-mpi/tests/mpi/test/ring_test.cpp new file mode 100644 index 0000000000..cf87a8c15a --- /dev/null +++ b/tests/libs/boost-mpi/tests/mpi/test/ring_test.cpp @@ -0,0 +1,127 @@ +// Copyright (C) 2005, 2006 Douglas Gregor. + +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// A test of the communicator that passes data around a ring and +// verifies that the same data makes it all the way. Should test all +// of the various kinds of data that can be sent (primitive types, POD +// types, serializable objects, etc.) +#include +#include +#include +#include +#include "gps_position.hpp" +#include +#include + +using boost::mpi::communicator; +using boost::mpi::status; + +template +void +ring_test(const communicator& comm, const T& pass_value, const char* kind, + int root = 0) +{ + T transferred_value; + + int rank = comm.rank(); + int size = comm.size(); + + if (rank == root) { + std::cout << "Passing " << kind << " around a ring from root " << root + << "..."; + comm.send((rank + 1) % size, 0, pass_value); + comm.recv((rank + size - 1) % size, 0, transferred_value); + BOOST_CHECK(transferred_value == pass_value); + if (transferred_value == pass_value) std::cout << " OK." << std::endl; + } else { + comm.recv((rank + size - 1) % size, 0, transferred_value); + BOOST_CHECK(transferred_value == pass_value); + comm.send((rank + 1) % size, 0, transferred_value); + } + + (comm.barrier)(); +} + + +template +void +ring_array_test(const communicator& comm, const T* pass_values, + int n, const char* kind, int root = 0) +{ + T* transferred_values = new T[n]; + int rank = comm.rank(); + int size = comm.size(); + + if (rank == root) { + + std::cout << "Passing " << kind << " array around a ring from root " + << root << "..."; + comm.send((rank + 1) % size, 0, pass_values, n); + comm.recv((rank + size - 1) % size, 0, transferred_values, n); + bool okay = std::equal(pass_values, pass_values + n, + transferred_values); + BOOST_CHECK(okay); + if (okay) std::cout << " OK." << std::endl; + } else { + status stat = comm.probe(boost::mpi::any_source, 0); + boost::optional num_values = stat.template count(); + if (boost::mpi::is_mpi_datatype()) + BOOST_CHECK(num_values && *num_values == n); + else + BOOST_CHECK(!num_values || *num_values == n); + comm.recv(stat.source(), 0, transferred_values, n); + BOOST_CHECK(std::equal(pass_values, pass_values + n, + transferred_values)); + comm.send((rank + 1) % size, 0, transferred_values, n); + } + (comm.barrier)(); + delete [] transferred_values; +} + +enum color_t {red, green, blue}; +BOOST_IS_MPI_DATATYPE(color_t) + +int test_main(int argc, char* argv[]) +{ + boost::mpi::environment env(argc, argv); + + communicator comm; + if (comm.size() == 1) { + std::cerr << "ERROR: Must run the ring test with more than one process." + << std::endl; + MPI_Abort(comm, -1); + } + + // Check transfer of individual objects + ring_test(comm, 17, "integers", 0); + ring_test(comm, 17, "integers", 1); + ring_test(comm, red, "enums", 1); + ring_test(comm, red, "enums", 1); + ring_test(comm, gps_position(39,16,20.2799), "GPS positions", 0); + ring_test(comm, gps_position(26,25,30.0), "GPS positions", 1); + ring_test(comm, std::string("Rosie"), "string", 0); + + std::list strings; + strings.push_back("Hello"); + strings.push_back("MPI"); + strings.push_back("World"); + ring_test(comm, strings, "list of strings", 1); + + // Check transfer of arrays + int int_array[2] = { 17, 42 }; + ring_array_test(comm, int_array, 2, "integer", 1); + gps_position gps_position_array[2] = { + gps_position(39,16,20.2799), + gps_position(26,25,30.0) + }; + ring_array_test(comm, gps_position_array, 2, "GPS position", 1); + + std::string string_array[3] = { "Hello", "MPI", "World" }; + ring_array_test(comm, string_array, 3, "string", 0); + ring_array_test(comm, string_array, 3, "string", 1); + + return 0; +} diff --git a/tests/libs/boost-mpi/tests/mpi/test/rm_execution b/tests/libs/boost-mpi/tests/mpi/test/rm_execution new file mode 100755 index 0000000000..a3e1f9bd7c --- /dev/null +++ b/tests/libs/boost-mpi/tests/mpi/test/rm_execution @@ -0,0 +1,92 @@ +#!../../../../../common/bats/bin/bats +# -*-sh-*- + +source ../../../../../common/test_helper_functions.bash || exit 1 +source ../../../../../common/functions || exit 1 + +if [ -s ../../../../../TEST_ENV ];then + source ../../../../../TEST_ENV +fi + +if [ "$RESOURCE_MANAGER" = "slurm" ];then + rm=slurm +else + ERROR "Unsupported or unknown resource manager" + exit 1 +fi + +PKG="Boost/MPI" + +@test "[$PKG] all_gather_test under resource manager ($rm/$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + test=all_gather_test + if [ ! -x $test ];then + flunk "$test does not exist" + fi + run_mpi_binary ./$test atest 2 16 + assert_success +} + +@test "[$PKG] all_reduce_test under resource manager ($rm/$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + test=all_reduce_test + if [ ! -x $test ];then + flunk "$test does not exist" + fi + run_mpi_binary ./$test atest 2 16 + assert_success +} + +@test "[$PKG] all_to_all_test under resource manager ($rm/$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + test=all_to_all_test + if [ ! -x $test ];then + flunk "$test does not exist" + fi + run_mpi_binary ./$test atest 2 16 + assert_success +} + +@test "[$PKG] groups_test under resource manager ($rm/$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + test=groups_test + if [ ! -x $test ];then + flunk "$test does not exist" + fi + run_mpi_binary ./$test atest 2 16 + assert_success +} + +@test "[$PKG] broadcast_test under resource manager ($rm/$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + test=broadcast_test + if [ ! -x $test ];then + flunk "$test does not exist" + fi + run_mpi_binary ./$test atest 2 16 + assert_success +} + +@test "[$PKG] ring_test under resource manager ($rm/$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + test=ring_test + if [ ! -x $test ];then + flunk "$test does not exist" + fi + run_mpi_binary ./$test atest 2 16 + assert_success +} + +@test "[$PKG] pointer_test under resource manager ($rm/$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + test=pointer_test + if [ ! -x $test ];then + flunk "$test does not exist" + fi + run_mpi_binary ./$test atest 2 16 + assert_success +} + +@test "[$PKG] nonblocking_test under resource manager ($rm/$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + test=nonblocking_test + if [ ! -x $test ];then + flunk "$test does not exist" + fi + run_mpi_binary ./$test atest 2 16 + assert_success +} + + diff --git a/tests/libs/boost/Makefile.am b/tests/libs/boost/Makefile.am new file mode 100644 index 0000000000..6965ac054e --- /dev/null +++ b/tests/libs/boost/Makefile.am @@ -0,0 +1,3 @@ +ACLOCAL_AMFLAGS = -I m4 +AM_MAKEFLAGS = --no-print-directory +SUBDIRS = tests diff --git a/tests/libs/boost/bootstrap b/tests/libs/boost/bootstrap new file mode 120000 index 0000000000..b17b398013 --- /dev/null +++ b/tests/libs/boost/bootstrap @@ -0,0 +1 @@ +../../bootstrap \ No newline at end of file diff --git a/tests/libs/boost/configure.ac b/tests/libs/boost/configure.ac new file mode 100644 index 0000000000..17bf0b0ace --- /dev/null +++ b/tests/libs/boost/configure.ac @@ -0,0 +1,59 @@ +# -*- Autoconf -*- +# Process this file with autoconf to produce a configure script. +# + +AC_PREREQ(2.59) +AC_INIT([boost], [0.10.0], [karl.w.schulz@intel.com]) +AC_CONFIG_MACRO_DIR([m4]) +AM_INIT_AUTOMAKE([foreign]) +m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) + +# verify we have necessary environment variables set +AC_MSG_CHECKING([for BOOST_DIR environment variable]) +if test "x$BOOST_DIR" = "x"; then + AC_MSG_RESULT([no]) + echo + AC_ERROR([BOOST_DIR not defined - please load boost environment.]) +else + AC_MSG_RESULT([yes]) +fi + +OHPC_COMPILER_FAMILY + +# test compilers + +# (TRon Mar 25, 2015) +# Added the AM conditionals below for use with mkl-ublas header +# with different options for ICC and GCC +AM_CONDITIONAL(ICC, test $LMOD_FAMILY_COMPILER = "intel") +AM_CONDITIONAL(GCC, test $LMOD_FAMILY_COMPILER = "gnu") + +AC_PROG_CXX + +# Set subdirectories +AC_CONFIG_FILES(Makefile tests/Makefile \ + tests/module/Makefile \ + tests/program_options/test/Makefile \ + tests/regex/test/Makefile \ + tests/regex/test/regress/Makefile \ + tests/multi_array/test/Makefile \ + tests/accumulators/test/Makefile \ + tests/random/test/Makefile \ + tests/mkl-ublas/test/Makefile \ + ) + +# Configure +AC_OUTPUT() + +echo +echo '-------------------------------------------------- SUMMARY --------------------------------------------------' +echo +echo Package version............... : $PACKAGE-$VERSION +echo OHPC compiler toolchain........ : $LMOD_FAMILY_COMPILER +echo OHPC MPI toolchain............. : $LMOD_FAMILY_MPI +echo +echo C++ compiler.................. : `which $CXX` +echo C++ compiler flags............ : $CXXFLAGS +echo Boost CPPFLAGS flags.......... : -I$BOOST_DIR/include +echo +echo '-------------------------------------------------------------------------------------------------------------' diff --git a/tests/libs/boost/m4/compiler_family.m4 b/tests/libs/boost/m4/compiler_family.m4 new file mode 100644 index 0000000000..22ec81b2ca --- /dev/null +++ b/tests/libs/boost/m4/compiler_family.m4 @@ -0,0 +1,38 @@ +# SYNOPSIS +# +# Test for OHPC supported compiler toolchains +# +# COMPILER_FAMILY() +# +# DESCRIPTION +# +# Queries configuration environment to detect compiler toolchain +# loaded via Lmod. Sets CC, CXX, and FC to match supported +# toolchains. +# +# CONTRIBUTORS +# +# Karl W. Schulz + +AC_DEFUN([OHPC_COMPILER_FAMILY], +[ + +AC_MSG_CHECKING([for loaded OHPC compiler toolchain]) + +if test "x$LMOD_FAMILY_COMPILER" = "xgnu"; then + CC=gcc + CXX=g++ + FC=gfortran + AC_MSG_RESULT([gnu]) +elif test "x$LMOD_FAMILY_COMPILER" = "xintel"; then + CC=icc + CXX=icpc + FC=ifort + AC_MSG_RESULT([intel]) +else + AC_MSG_RESULT([unknown]) + echo + AC_ERROR([Unknown compiler family - please load a compiler toolchain.]) +fi + +]) diff --git a/tests/libs/boost/ohpc-tests/test_mpi_families b/tests/libs/boost/ohpc-tests/test_mpi_families new file mode 100755 index 0000000000..100496b8f1 --- /dev/null +++ b/tests/libs/boost/ohpc-tests/test_mpi_families @@ -0,0 +1,47 @@ +#!/bin/bash +# -*-sh-*- + +TEST_LOGS="" +MAKEFLAGS="" + +source ./TEST_ENV || exit 1 +source ./common/functions || exit 1 + +cd libs/boost || exit 1 + +export BATS_JUNIT_CLASS="Boost" + +# bootstrap the local autotools project if necessary + +./bootstrap || exit 1 + +for compiler in $COMPILER_FAMILIES ; do + for mpi in $MPI_FAMILIES ; do + + echo " " + echo " " + echo "-------------------------------------------------------" + echo "Libraries: Boost tests: $compiler-$mpi" + echo "-------------------------------------------------------" + + module purge || exit 1 + module load prun || exit 1 + module load $compiler || exit 1 + module load $mpi || exit 1 + module load boost || exit 1 + if [ "$compiler" = "gnu" ]; then + module load mkl || exit 1 + fi + + ./configure || exit 1 + make clean || exit 1 + make -k check + + for dir in module program_options/test regex/test accumulators/test multi_array/test random/test; do + save_logs_mpi_family tests/$dir $compiler $mpi + done + + make distclean + done +done + diff --git a/tests/libs/boost/tests/.gitignore b/tests/libs/boost/tests/.gitignore new file mode 100644 index 0000000000..3882020597 --- /dev/null +++ b/tests/libs/boost/tests/.gitignore @@ -0,0 +1 @@ +*.tap diff --git a/tests/libs/boost/tests/Makefile.am b/tests/libs/boost/tests/Makefile.am new file mode 100644 index 0000000000..489e0f42f7 --- /dev/null +++ b/tests/libs/boost/tests/Makefile.am @@ -0,0 +1 @@ +SUBDIRS = module program_options/test regex/test accumulators/test multi_array/test random/test mkl-ublas/test diff --git a/tests/libs/boost/tests/accumulators/test/Makefile.am b/tests/libs/boost/tests/accumulators/test/Makefile.am new file mode 100644 index 0000000000..72e9ba3720 --- /dev/null +++ b/tests/libs/boost/tests/accumulators/test/Makefile.am @@ -0,0 +1,24 @@ +TESTS_ENVIRONMENT = BATS_NO_SUMMARY=1 +AM_CXXFLAGS = -I$(BOOST_INC) + +# Test compilations/execution + +TESTS = min +check_PROGRAMS = min +min_SOURCES = min.cpp + +TESTS += max +check_PROGRAMS += max +max_SOURCES = max.cpp + +TESTS += skewness +check_PROGRAMS += skewness +skewness_SOURCES = skewness.cpp + +TESTS += variance +check_PROGRAMS += variance +variance_SOURCES = variance.cpp + +# Test execution through resource manager + +TESTS += rm_execution diff --git a/tests/libs/boost/tests/accumulators/test/TEST_ENV b/tests/libs/boost/tests/accumulators/test/TEST_ENV new file mode 120000 index 0000000000..e299a1c3bd --- /dev/null +++ b/tests/libs/boost/tests/accumulators/test/TEST_ENV @@ -0,0 +1 @@ +../../../../../TEST_ENV \ No newline at end of file diff --git a/tests/libs/boost/tests/accumulators/test/common b/tests/libs/boost/tests/accumulators/test/common new file mode 120000 index 0000000000..dbd3b47ab4 --- /dev/null +++ b/tests/libs/boost/tests/accumulators/test/common @@ -0,0 +1 @@ +../../../../../common/ \ No newline at end of file diff --git a/tests/libs/boost/tests/accumulators/test/max.cpp b/tests/libs/boost/tests/accumulators/test/max.cpp new file mode 100644 index 0000000000..c3cdf03444 --- /dev/null +++ b/tests/libs/boost/tests/accumulators/test/max.cpp @@ -0,0 +1,43 @@ +// (C) Copyright Eric Niebler 2005. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include +#include + +using namespace boost; +using namespace unit_test; +using namespace accumulators; + +/////////////////////////////////////////////////////////////////////////////// +// test_stat +// +void test_stat() +{ + accumulator_set > acc; + + acc(1); + BOOST_CHECK_EQUAL(1, (max)(acc)); + + acc(0); + BOOST_CHECK_EQUAL(1, (max)(acc)); + + acc(2); + BOOST_CHECK_EQUAL(2, (max)(acc)); +} + +/////////////////////////////////////////////////////////////////////////////// +// init_unit_test_suite +// +test_suite* init_unit_test_suite( int argc, char* argv[] ) +{ + test_suite *test = BOOST_TEST_SUITE("max test"); + + test->add(BOOST_TEST_CASE(&test_stat)); + + return test; +} diff --git a/tests/libs/boost/tests/accumulators/test/min.cpp b/tests/libs/boost/tests/accumulators/test/min.cpp new file mode 100644 index 0000000000..8c4f2bb98d --- /dev/null +++ b/tests/libs/boost/tests/accumulators/test/min.cpp @@ -0,0 +1,43 @@ +// (C) Copyright Eric Niebler 2005. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include +#include + +using namespace boost; +using namespace unit_test; +using namespace accumulators; + +/////////////////////////////////////////////////////////////////////////////// +// test_stat +// +void test_stat() +{ + accumulator_set > acc; + + acc(1); + BOOST_CHECK_EQUAL(1, (min)(acc)); + + acc(0); + BOOST_CHECK_EQUAL(0, (min)(acc)); + + acc(2); + BOOST_CHECK_EQUAL(0, (min)(acc)); +} + +/////////////////////////////////////////////////////////////////////////////// +// init_unit_test_suite +// +test_suite* init_unit_test_suite( int argc, char* argv[] ) +{ + test_suite *test = BOOST_TEST_SUITE("min test"); + + test->add(BOOST_TEST_CASE(&test_stat)); + + return test; +} diff --git a/tests/libs/boost/tests/accumulators/test/rm_execution b/tests/libs/boost/tests/accumulators/test/rm_execution new file mode 100755 index 0000000000..fe06ce2804 --- /dev/null +++ b/tests/libs/boost/tests/accumulators/test/rm_execution @@ -0,0 +1,55 @@ +#!.//common/bats/bin/bats +# -*-sh-*- + +source ./common/test_helper_functions.bash || exit 1 +source ./common/functions || exit 1 + +if [ -s ./TEST_ENV ];then + source ./TEST_ENV +fi + +if [ "$RESOURCE_MANAGER" = "slurm" ];then + rm=slurm +else + ERROR "Unsupported or unknown resource manager" + exit 1 +fi + +PKG="Boost/Accumulators" + +@test "[$PKG] min-test under resource manager ($rm/$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + test=min + if [ ! -x $test ];then + flunk "$test does not exist" + fi + run_serial_binary ./$test + assert_success +} + +@test "[$PKG] max-test under resource manager ($rm/$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + test=max + if [ ! -x $test ];then + flunk "$test does not exist" + fi + run_serial_binary ./$test + assert_success +} + +@test "[$PKG] skewness-test under resource manager ($rm/$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + test=skewness + if [ ! -x $test ];then + flunk "$test does not exist" + fi + run_serial_binary ./$test + assert_success +} + +@test "[$PKG] variance-test under resource manager ($rm/$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + test=variance + if [ ! -x $test ];then + flunk "$test does not exist" + fi + run_serial_binary ./$test + assert_success +} + diff --git a/tests/libs/boost/tests/accumulators/test/skewness.cpp b/tests/libs/boost/tests/accumulators/test/skewness.cpp new file mode 100644 index 0000000000..78b7cc7570 --- /dev/null +++ b/tests/libs/boost/tests/accumulators/test/skewness.cpp @@ -0,0 +1,70 @@ +// (C) Copyright 2006 Eric Niebler, Olivier Gygi. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Test case for skewness.hpp + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace boost; +using namespace unit_test; +using namespace boost::accumulators; + +/////////////////////////////////////////////////////////////////////////////// +// test_stat +// +void test_stat() +{ + // tolerance in % + // double epsilon = 1; + + accumulator_set > acc1; + accumulator_set > acc2; + + // two random number generators + boost::lagged_fibonacci607 rng; + boost::normal_distribution<> mean_sigma(0,1); + boost::variate_generator > normal(rng, mean_sigma); + + for (std::size_t i=0; i<100000; ++i) + { + acc1(normal()); + } + + // This check fails because epsilon is relative and not absolute + // BOOST_CHECK_CLOSE( skewness(acc1), 0., epsilon ); + + acc2(2); + acc2(7); + acc2(4); + acc2(9); + acc2(3); + + BOOST_CHECK_EQUAL( mean(acc2), 5 ); + BOOST_CHECK_EQUAL( accumulators::moment<2>(acc2), 159./5. ); + BOOST_CHECK_EQUAL( accumulators::moment<3>(acc2), 1171./5. ); + BOOST_CHECK_CLOSE( skewness(acc2), 0.406040288214, 1e-6 ); +} + +/////////////////////////////////////////////////////////////////////////////// +// init_unit_test_suite +// +test_suite* init_unit_test_suite( int argc, char* argv[] ) +{ + test_suite *test = BOOST_TEST_SUITE("skewness test"); + + test->add(BOOST_TEST_CASE(&test_stat)); + + return test; +} + diff --git a/tests/libs/boost/tests/accumulators/test/variance.cpp b/tests/libs/boost/tests/accumulators/test/variance.cpp new file mode 100644 index 0000000000..8aee68a44d --- /dev/null +++ b/tests/libs/boost/tests/accumulators/test/variance.cpp @@ -0,0 +1,69 @@ +// (C) Copyright 2005 Daniel Egloff, Eric Niebler +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include +#include +#include + +using namespace boost; +using namespace unit_test; +using namespace accumulators; + +/////////////////////////////////////////////////////////////////////////////// +// test_stat +// +void test_stat() +{ + // matlab + // >> samples = [1:5]; + // >> mean(samples) + // ans = 3 + // >> sum(samples .* samples) / length(samples) + // ans = 11 + // >> sum(samples .* samples) / length(samples) - mean(samples)^2 + // ans = 2 + + // lazy variance, now lazy with syntactic sugar, thanks to Eric + accumulator_set > acc1; + + acc1(1); + acc1(2); + acc1(3); + acc1(4); + acc1(5); + + BOOST_CHECK_EQUAL(5u, count(acc1)); + BOOST_CHECK_CLOSE(3., mean(acc1), 1e-5); + BOOST_CHECK_CLOSE(11., accumulators::moment<2>(acc1), 1e-5); + BOOST_CHECK_CLOSE(2., variance(acc1), 1e-5); + + // immediate variance + accumulator_set > acc2; + + acc2(1); + acc2(2); + acc2(3); + acc2(4); + acc2(5); + + BOOST_CHECK_EQUAL(5u, count(acc2)); + BOOST_CHECK_CLOSE(3., mean(acc2), 1e-5); + BOOST_CHECK_CLOSE(2., variance(acc2), 1e-5); +} + +/////////////////////////////////////////////////////////////////////////////// +// init_unit_test_suite +// +test_suite* init_unit_test_suite( int argc, char* argv[] ) +{ + test_suite *test = BOOST_TEST_SUITE("variance test"); + + test->add(BOOST_TEST_CASE(&test_stat)); + + return test; +} diff --git a/tests/libs/boost/tests/mkl-ublas/makefile b/tests/libs/boost/tests/mkl-ublas/makefile new file mode 100644 index 0000000000..e49ace500e --- /dev/null +++ b/tests/libs/boost/tests/mkl-ublas/makefile @@ -0,0 +1,162 @@ +##****************************************************************************** +## Copyright(C) 2008-2013 Intel Corporation. All Rights Reserved. +## +## The source code, information and material ("Material") contained herein is +## owned by Intel Corporation or its suppliers or licensors, and title to such +## Material remains with Intel Corporation or its suppliers or licensors. The +## Material contains proprietary information of Intel or its suppliers and +## licensors. The Material is protected by worldwide copyright laws and treaty +## provisions. No part of the Material may be used, copied, reproduced, +## modified, published, uploaded, posted, transmitted, distributed or disclosed +## in any way without Intel's prior express written permission. No license +## under any patent, copyright or other intellectual property rights in the +## Material is granted to or conferred upon you, either expressly, by +## implication, inducement, estoppel or otherwise. Any license under such +## intellectual property rights must be express and approved by Intel in +## writing. +## +## *Third Party trademarks are the property of their respective owners. +## +## Unless otherwise agreed by Intel in writing, you may not remove or alter +## this notice or any other notice embedded in Materials by Intel or Intel's +## suppliers or licensors in any way. +## +##****************************************************************************** +## Content: +## Intel(R) Math Kernel Library UBLAS examples creation and run +##****************************************************************************** + +help: + @echo "Usage: make {libia32|soia32|libintel64|sointel64} [function=name]" + @echo "[compiler=compiler_name] [interface=interface_name] [threading=threading_name]" + @echo + @echo "name - function name. Please see ublas.lst file" + @echo + @echo "compiler_name - can be gnu or intel. Default value is intel." + @echo " Intel(R) C Compiler as default" + @echo + @echo "interface_name - can be lp64 or ilp64 for intel64. Default value is lp64." + @echo + @echo "threading_name - can be parallel or sequential. Default value is parallel." + @echo "BOOST_ROOT=path - path to Boost installation directory." + +##------------------------------------------------------------------------------ +## examples of using: +## +## make soia32 compiler=gnu - build by GNU C compiler and run all +## examples of MKL for 32-bit applications, +## dynamic linking +## +## make libintel64 compiler=gnu - build by GNU C compiler and run all +## examples of MKL for Intel(R) 64 processor +## family applications, static linking +## +## make sointel64 - build by Intel(R) C Compiler (as default) +## and run all examples of MKL for Intel(R) 64 +## processor family applications, dynamic +## linking +##------------------------------------------------------------------------------ + +include ublas.lst + +ifndef function +function = $(UBLAS) +endif + +ifndef compiler +compiler=intel +endif + +ifndef interface +interface=lp64 +endif + +ifndef threading +threading=parallel +endif + +RES = $(addsuffix .res ,$(function)) + +ifndef MKLROOT +MKLROOT = ../.. +endif +MKL_PATH = "$(MKLROOT)/lib/$(_IA)" +CMPLR_PATH = "$(MKLROOT)/../compiler/lib/$(_IA)" + +ifeq ($(compiler),gnu) +CC=gcc +IFACE_COMP_PART=intel +IFACE_THREADING_PART=intel +GNU_LIBS=-lstdc++ +else +override CC=icc +IFACE_COMP_PART=intel +IFACE_THREADING_PART=intel +endif + +ifeq ($(interface),ilp64) +IFACE_LIB=$(MKL_PATH)/libmkl_$(IFACE_COMP_PART)_ilp64.$(EXT) +COPTS = -DMKL_ILP64 +else +IFACE_LIB=$(MKL_PATH)/libmkl_$(IFACE_COMP_PART)_lp64.$(EXT) +COPTS = +endif + +ifeq ($(_IA),ia32) + ifeq ($(compiler),intel) + SPEC_OPT=-mia32 +#This option is required by Intel(R) 11.0 compiler to produce workable binaries for Pentium(R) III. +#If you don't need it, you can remove this option. + endif +IFACE_LIB=$(MKL_PATH)/libmkl_$(IFACE_COMP_PART).$(EXT) +COPTS = +endif + +ifeq ($(threading),sequential) +THREADING_LIB=$(MKL_PATH)/libmkl_sequential.$(EXT) +OMP_LIB = +else +THREADING_LIB=$(MKL_PATH)/libmkl_$(IFACE_THREADING_PART)_thread.$(EXT) +OMP_LIB = -L$(CMPLR_PATH) -liomp5 +endif + +CORE_LIB=$(MKL_PATH)/libmkl_core.$(EXT) + +MKL_LIBS=$(IFACE_LIB) -Wl,--start-group $(THREADING_LIB) $(CORE_LIB) -Wl,--end-group $(OMP_LIB) + +ifeq ($(_IA),ia32) +RES_DIR=_results/$(compiler)_$(threading)_$(_IA)_$(RES_EXT)$Z +else +RES_DIR=_results/$(compiler)_$(interface)_$(threading)_$(_IA)_$(RES_EXT)$Z +endif + +BOOST_ROOT = . + +#UOPTS = -DNDEBUG -I$(BOOST_ROOT) +# (TRon Mar 17 2015: Added dir for the added mkl header files) +UOPTS = -DNDEBUG -I$(BOOST_ROOT) -I$(BOOST_ROOT)/boost/intel-mkl + +SIZE1 = 400 +SIZE2 = 600 +ITERATIONS = 100 + +libia32 lib32: + $(MAKE) $(RES) _IA=ia32 EXT=a RES_EXT=lib +soia32 so32: + $(MAKE) $(RES) _IA=ia32 EXT=so RES_EXT=so +libintel64 libem64t: + $(MAKE) $(RES) _IA=intel64 EXT=a RES_EXT=lib +sointel64 soem64t: + $(MAKE) $(RES) _IA=intel64 EXT=so RES_EXT=so + +#------------------------------------------------------------------------------- + +vpath %.cpp source + +$(RES): %.res: %.cpp + mkdir -p ./$(RES_DIR) + $(CC) $(SPEC_OPT) $(COPTS) $(UOPTS) -w -I"$(MKLROOT)/include" $< $(GNU_LIBS) -o $(RES_DIR)/$*_ublas.out + $(CC) $(SPEC_OPT) $(COPTS) -DMKL $(UOPTS) -w -I"$(MKLROOT)/include" $< -L$(MKL_PATH) $(MKL_LIBS) $(GNU_LIBS) -lpthread -lm -ldl -o $(RES_DIR)/$*_mkl.out + export LD_LIBRARY_PATH=$(MKL_PATH):$(LD_LIBRARY_PATH):$(CMPLR_PATH); $(RES_DIR)/$*_ublas.out $(ITERATIONS) $(SIZE1) $(SIZE2) >$(RES_DIR)/$*_ublas.res + export LD_LIBRARY_PATH=$(MKL_PATH):$(LD_LIBRARY_PATH):$(CMPLR_PATH); $(RES_DIR)/$*_mkl.out $(ITERATIONS) $(SIZE1) $(SIZE2) >$(RES_DIR)/$*_mkl.res +#------------------------------------------------------------------------------- diff --git a/tests/libs/boost/tests/mkl-ublas/source/sylvester.cpp b/tests/libs/boost/tests/mkl-ublas/source/sylvester.cpp new file mode 100644 index 0000000000..8ae3775b49 --- /dev/null +++ b/tests/libs/boost/tests/mkl-ublas/source/sylvester.cpp @@ -0,0 +1,124 @@ +/******************************************************************************* +! Copyright(C) 2008-2013 Intel Corporation. All Rights Reserved. +! +! The source code, information and material ("Material") contained herein is +! owned by Intel Corporation or its suppliers or licensors, and title to such +! Material remains with Intel Corporation or its suppliers or licensors. The +! Material contains proprietary information of Intel or its suppliers and +! licensors. The Material is protected by worldwide copyright laws and treaty +! provisions. No part of the Material may be used, copied, reproduced, +! modified, published, uploaded, posted, transmitted, distributed or disclosed +! in any way without Intel's prior express written permission. No license +! under any patent, copyright or other intellectual property rights in the +! Material is granted to or conferred upon you, either expressly, by +! implication, inducement, estoppel or otherwise. Any license under such +! intellectual property rights must be express and approved by Intel in +! writing. +! +! *Third Party trademarks are the property of their respective owners. +! +! Unless otherwise agreed by Intel in writing, you may not remove or alter +! this notice or any other notice embedded in Materials by Intel or Intel's +! suppliers or licensors in any way. +! +!******************************************************************************* +! Content: +! This code solves a very special case of Sylvester equation X-BXC=D +! Example demonstrates usage of the MKL ublas header. +! Matrices D and X can be rectangular. +! Arguments (default: 1 3 4) +! sylvester [count [rows [columns]]] +! where count is iterations limit, rows of D or X, columns of D or X +!******************************************************************************/ + +#include +#include + +#include + +#ifdef MKL +#include "mkl_boost_ublas_matrix_prod.hpp" +#endif + +using namespace boost::numeric::ublas; + +template +M & +sylvester(const M &B, const M &C, const M &D, M &X, const T &eps, long max_iter); + +int main (int argc, char **argv) { + long i; + size_t csize1 = 3; + size_t csize2 = 4; + long count = 1; + double epsilon = 1e-15; + + if(argc>1) count = atol(argv[1]); + if(argc>2) csize1 = atol(argv[2]); + if(argc>3) csize2 = atol(argv[3]); + else csize2 = csize1; + +#ifdef MKL + std::cout << std::endl << " MKL: max iterations: " << count << " size: " << csize1 << "x" << csize2 << std::endl; +#else + std::cout << std::endl << "uBLAS: max iterations: " << count << " size: " << csize1 << "x" << csize2 << std::endl; +#endif + + matrix B(zero_matrix(csize1, csize1)); + matrix C(zero_matrix(csize2, csize2)); + matrix D(scalar_matrix(csize1, csize2, 1)); + matrix X(csize1, csize2); + + for(i=0;i0) + C(i,i-1) = 0.5; // and 1 lower diagonal + } + + X = sylvester(B,C,D,X,epsilon,count); + + return 0; +} + +template +M & +sylvester(const M &B, const M &C, const M &D, M &X, const T &eps, long max_iter) { + T delta = static_cast (1); + T Emax = static_cast (1e100); + long count = 0; + matrixB1(B); + matrixC1(C); + X = D; + + boost::timer tim; // Start timing + + while (eps < delta && delta < Emax) { + X = X + prod(matrix(prod(B1,X)),C1); // X = X + B*X*C; + B1 = prod(B1,B1); // B = B*B; + C1 = prod(C1,C1); // C = C*C; + delta = norm_frobenius(B1) + norm_frobenius(C1);// delta = norm(B) + norm(C); + if(count++ > max_iter) // k=k+1 + break; + } + { + double tsec = tim.elapsed(); // Finish timing + int m = (int)(tsec / 60); + double s = tsec - m*60; + std::cout << "Total time" << " " << m << ":"; + if(s<10) { std::cout << "0"; } + std::cout << s << " (" << tsec << ")" << std::endl; + } + + // norm( X - BXC - D ) + T norm = norm_frobenius(X - prod(matrix(prod(B,X)),C) - D); + + std::cout << "Iterations: " << count << " norm: " << norm << std::endl; + + return X; +} diff --git a/tests/libs/boost/tests/mkl-ublas/test/Makefile.am b/tests/libs/boost/tests/mkl-ublas/test/Makefile.am new file mode 100644 index 0000000000..d84c149abb --- /dev/null +++ b/tests/libs/boost/tests/mkl-ublas/test/Makefile.am @@ -0,0 +1,41 @@ +TESTS_ENVIRONMENT = BATS_NO_SUMMARY=1 +AM_CXXFLAGS = -I$(BOOST_ROOT) -I$(BOOST_INC) -I$(BOOST_INC)/boost/intel-mkl + +# Test compilations/execution + +TESTS = sylvester_mkl sylvester_ublas +check_PROGRAMS = sylvester_mkl sylvester_ublas +sylvester_mkl_SOURCES = sylvester.cpp +sylvester_ublas_SOURCES = sylvester.cpp + +if GCC +$(info ************ GNU VERSION ************) +sylvester_mkl_CPPFLAGS = -fopenmp -m64 -DMKL_ILP64 -DMKL -DNDEBUG -I${MKLROOT}/include +sylvester_mkl_LDFLAGS = -Wl,--no-as-needed -L${MKLROOT}/lib/intel64 -lmkl_intel_ilp64 -lmkl_core -lmkl_gnu_thread -ldl -lpthread -lm +sylvester_mkl_LDADD =/opt/ohpc/pub/compiler/gcc/4.9.2/lib64/libgomp.so +else +$(info ************ INTEL VERSION ************) +sylvester_mkl_CPPFLAGS = -openmp -DMKL_ILP64 -DMKL -DNDEBUG -I${MKLROOT}/include +sylvester_mkl_LDFLAGS = -L${MKLROOT}/lib/intel64 -lmkl_intel_ilp64 -lmkl_core -lmkl_intel_thread -lpthread -lm +sylvester_mkl_LDADD =/opt/ohpc/pub/compiler/intel/composer_xe_2015.2.164/compiler/lib/intel64/libiomp5.so +endif + +if GCC +$(info ************ GNU VERSION ************) +sylvester_ublas_CPPFLAGS = -fopenmp -m64 -DNDEBUG +sylvester_ublas_LDADD =/opt/ohpc/pub/compiler/gcc/4.9.2/lib64/libgomp.so +else +$(info ************ INTEL VERSION ************) +sylvester_ublas_CPPFLAGS = -openmp -DNDEBUG +sylvester_ublas_LDADD =/opt/ohpc/pub/compiler/intel/composer_xe_2015.2.164/compiler/lib/intel64/libiomp5.so +endif + +# Test execution through resource manager + +TESTS += rm_execution + + +## +#icc -Wl,--no-as-needed -DMKL_ILP64 -DMKL -I$BOOST_ROOT -I$BOOST_INC -I$BOOST_ROOT/include/boost/intel-mkl -I$MKLROOT/include -L$MKLROOT/lib/intel64 -I/opt/ohpc/pub/compiler/intel/composer_xe_2015.2.164/compiler/lib/intel64/ sylvester.cpp -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -liomp5 -lpthread -lm -ldl -o i.out + +#gcc -Wl,--no-as-needed -DMKL_ILP64 -DMKL -I$BOOST_ROOT -I$BOOST_INC -I$BOOST_ROOT/include/boost/intel-mkl -I$MKLROOT/include -L$MKLROOT/lib/intel64 -I/opt/ohpc/pub/compiler/intel/composer_xe_2015.2.164/compiler/lib/intel64/ sylvester.cpp -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -liomp5 -lstdc++ -lpthread -lm -ldl -o g.out diff --git a/tests/libs/boost/tests/mkl-ublas/test/Makefile.am.intel b/tests/libs/boost/tests/mkl-ublas/test/Makefile.am.intel new file mode 100644 index 0000000000..14e16bc6fa --- /dev/null +++ b/tests/libs/boost/tests/mkl-ublas/test/Makefile.am.intel @@ -0,0 +1,23 @@ +TESTS_ENVIRONMENT = BATS_NO_SUMMARY=1 +AM_CXXFLAGS = -DMKL_ILP64 -DMKL -I$(BOOST_ROOT) -I$(BOOST_INC) -I$(BOOST_INC)/boost/intel-mkl -I$(MKLROOT)/include -L$(MKLROOT)/lib/intel64 -L/opt/ohpc/pub/compiler/intel/composer_xe_2015.2.164/compiler/lib/intel64/ -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -liomp5 -lstdc++ -lpthread -lm -ldl + +INTEL_LIBS = $(MKLROOT)/lib/intel64 /opt/ohpc/pub/compiler/intel/composer_xe_2015.2.164/compiler/lib/intel64/ +# Test compilations/execution + +TESTS = sylvester +check_PROGRAMS = sylvester +#lib_PROGRAMS = +#include_PROGRAMS = +sylvester_SOURCES = sylvester.cpp +#sylvester_LDADD = $(INTEL_LIBS) + + +# Test execution through resource manager + +#TESTS += rm_execution + + +## +#icc -Wl,--no-as-needed -DMKL_ILP64 -DMKL -I$BOOST_ROOT -I$BOOST_INC -I$BOOST_ROOT/include/boost/intel-mkl -I$MKLROOT/include -L$MKLROOT/lib/intel64 -I/opt/ohpc/pub/compiler/intel/composer_xe_2015.2.164/compiler/lib/intel64/ sylvester.cpp -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -liomp5 -lpthread -lm -ldl -o i.out + +#gcc -Wl,--no-as-needed -DMKL_ILP64 -DMKL -I$BOOST_ROOT -I$BOOST_INC -I$BOOST_ROOT/include/boost/intel-mkl -I$MKLROOT/include -L$MKLROOT/lib/intel64 -I/opt/ohpc/pub/compiler/intel/composer_xe_2015.2.164/compiler/lib/intel64/ sylvester.cpp -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -liomp5 -lstdc++ -lpthread -lm -ldl -o g.out diff --git a/tests/libs/boost/tests/mkl-ublas/test/TEST_ENV b/tests/libs/boost/tests/mkl-ublas/test/TEST_ENV new file mode 120000 index 0000000000..e299a1c3bd --- /dev/null +++ b/tests/libs/boost/tests/mkl-ublas/test/TEST_ENV @@ -0,0 +1 @@ +../../../../../TEST_ENV \ No newline at end of file diff --git a/tests/libs/boost/tests/mkl-ublas/test/common b/tests/libs/boost/tests/mkl-ublas/test/common new file mode 120000 index 0000000000..115323e08d --- /dev/null +++ b/tests/libs/boost/tests/mkl-ublas/test/common @@ -0,0 +1 @@ +../../random/test/common \ No newline at end of file diff --git a/tests/libs/boost/tests/mkl-ublas/test/makefile-mkl b/tests/libs/boost/tests/mkl-ublas/test/makefile-mkl new file mode 100644 index 0000000000..f0aacc789b --- /dev/null +++ b/tests/libs/boost/tests/mkl-ublas/test/makefile-mkl @@ -0,0 +1,165 @@ +##****************************************************************************** +## Copyright(C) 2008-2013 Intel Corporation. All Rights Reserved. +## +## The source code, information and material ("Material") contained herein is +## owned by Intel Corporation or its suppliers or licensors, and title to such +## Material remains with Intel Corporation or its suppliers or licensors. The +## Material contains proprietary information of Intel or its suppliers and +## licensors. The Material is protected by worldwide copyright laws and treaty +## provisions. No part of the Material may be used, copied, reproduced, +## modified, published, uploaded, posted, transmitted, distributed or disclosed +## in any way without Intel's prior express written permission. No license +## under any patent, copyright or other intellectual property rights in the +## Material is granted to or conferred upon you, either expressly, by +## implication, inducement, estoppel or otherwise. Any license under such +## intellectual property rights must be express and approved by Intel in +## writing. +## +## *Third Party trademarks are the property of their respective owners. +## +## Unless otherwise agreed by Intel in writing, you may not remove or alter +## this notice or any other notice embedded in Materials by Intel or Intel's +## suppliers or licensors in any way. +## +##****************************************************************************** +## Content: +## Intel(R) Math Kernel Library UBLAS examples creation and run +##****************************************************************************** + +help: + @echo "Usage: make {libia32|soia32|libintel64|sointel64} [function=name]" + @echo "[compiler=compiler_name] [interface=interface_name] [threading=threading_name]" + @echo + @echo "name - function name. Please see ublas.lst file" + @echo + @echo "compiler_name - can be gnu or intel. Default value is intel." + @echo " Intel(R) C Compiler as default" + @echo + @echo "interface_name - can be lp64 or ilp64 for intel64. Default value is lp64." + @echo + @echo "threading_name - can be parallel or sequential. Default value is parallel." + @echo "BOOST_ROOT=path - path to Boost installation directory." + +##------------------------------------------------------------------------------ +## examples of using: +## +## make soia32 compiler=gnu - build by GNU C compiler and run all +## examples of MKL for 32-bit applications, +## dynamic linking +## +## make libintel64 compiler=gnu - build by GNU C compiler and run all +## examples of MKL for Intel(R) 64 processor +## family applications, static linking +## +## make sointel64 - build by Intel(R) C Compiler (as default) +## and run all examples of MKL for Intel(R) 64 +## processor family applications, dynamic +## linking +##------------------------------------------------------------------------------ + +include ublas.lst + +ifndef function +function = $(UBLAS) +endif + +ifndef compiler +compiler=intel +endif + +ifndef interface +interface=lp64 +endif + +ifndef threading +threading=parallel +endif + +RES = $(addsuffix .res ,$(function)) + +ifndef MKLROOT +MKLROOT = ../.. +endif +MKL_PATH = "$(MKLROOT)/lib/$(_IA)" +CMPLR_PATH = "$(MKLROOT)/../compiler/lib/$(_IA)" + +ifeq ($(compiler),gnu) +CC=gcc +IFACE_COMP_PART=intel +IFACE_THREADING_PART=intel +GNU_LIBS=-lstdc++ +else +override CC=icc +IFACE_COMP_PART=intel +IFACE_THREADING_PART=intel +endif + +ifeq ($(interface),ilp64) +IFACE_LIB=$(MKL_PATH)/libmkl_$(IFACE_COMP_PART)_ilp64.$(EXT) +COPTS = -DMKL_ILP64 +else +IFACE_LIB=$(MKL_PATH)/libmkl_$(IFACE_COMP_PART)_lp64.$(EXT) +COPTS = +endif + +ifeq ($(_IA),ia32) + ifeq ($(compiler),intel) + SPEC_OPT=-mia32 +#This option is required by Intel(R) 11.0 compiler to produce workable binaries for Pentium(R) III. +#If you don't need it, you can remove this option. + endif +IFACE_LIB=$(MKL_PATH)/libmkl_$(IFACE_COMP_PART).$(EXT) +COPTS = +endif + +ifeq ($(threading),sequential) +THREADING_LIB=$(MKL_PATH)/libmkl_sequential.$(EXT) +OMP_LIB = +else +THREADING_LIB=$(MKL_PATH)/libmkl_$(IFACE_THREADING_PART)_thread.$(EXT) +OMP_LIB = -L$(CMPLR_PATH) -liomp5 +endif + +CORE_LIB=$(MKL_PATH)/libmkl_core.$(EXT) + +MKL_LIBS=$(IFACE_LIB) -Wl,--start-group $(THREADING_LIB) $(CORE_LIB) -Wl,--end-group $(OMP_LIB) + +ifeq ($(_IA),ia32) +RES_DIR=_results/$(compiler)_$(threading)_$(_IA)_$(RES_EXT)$Z +else +RES_DIR=_results/$(compiler)_$(interface)_$(threading)_$(_IA)_$(RES_EXT)$Z +endif + +BOOST_ROOT = . + +#UOPTS = -DNDEBUG -I$(BOOST_ROOT) +# (TRon Mar 17 2015: Added dir for the added mkl header files) +UOPTS = -DNDEBUG -I$(BOOST_ROOT) -I$(BOOST_ROOT)/boost/intel-mkl + +SIZE1 = 400 +SIZE2 = 600 +ITERATIONS = 100 + +libia32 lib32: + $(MAKE) $(RES) _IA=ia32 EXT=a RES_EXT=lib +soia32 so32: + $(MAKE) $(RES) _IA=ia32 EXT=so RES_EXT=so +libintel64 libem64t: + $(MAKE) $(RES) _IA=intel64 EXT=a RES_EXT=lib +sointel64 soem64t: + $(MAKE) $(RES) _IA=intel64 EXT=so RES_EXT=so + +#------------------------------------------------------------------------------- + +vpath %.cpp source + +$(RES): %.res: %.cpp + mkdir -p ./$(RES_DIR) + $(CC) $(SPEC_OPT) $(COPTS) $(UOPTS) -w -I"$(MKLROOT)/include" $< $(GNU_LIBS) -o $(RES_DIR)/$*_ublas.out -lm + $(CC) $(SPEC_OPT) $(COPTS) -DMKL $(UOPTS) -w -I"$(MKLROOT)/include" $< -L$(MKL_PATH) $(MKL_LIBS) $(GNU_LIBS) -lpthread -lm -ldl -o $(RES_DIR)/$*_mkl.out + export LD_LIBRARY_PATH=$(MKL_PATH):$(LD_LIBRARY_PATH):$(CMPLR_PATH); $(RES_DIR)/$*_ublas.out $(ITERATIONS) $(SIZE1) $(SIZE2) >$(RES_DIR)/$*_ublas.res + export LD_LIBRARY_PATH=$(MKL_PATH):$(LD_LIBRARY_PATH):$(CMPLR_PATH); $(RES_DIR)/$*_mkl.out $(ITERATIONS) $(SIZE1) $(SIZE2) >$(RES_DIR)/$*_mkl.res +# +#(TRon Mar 17 2015: Added -lm for gnu build) +# $(CC) $(SPEC_OPT) $(COPTS) $(UOPTS) -w -I"$(MKLROOT)/include" $< $(GNU_LIBS) -o $(RES_DIR)/$*_ublas.out +#------------------------------------------------------------------------------- diff --git a/tests/libs/boost/tests/mkl-ublas/test/rm_execution b/tests/libs/boost/tests/mkl-ublas/test/rm_execution new file mode 100755 index 0000000000..3646689db0 --- /dev/null +++ b/tests/libs/boost/tests/mkl-ublas/test/rm_execution @@ -0,0 +1,112 @@ +#!.//common/bats/bin/bats +# -*-sh-*- + +source ./common/test_helper_functions.bash || exit 1 +source ./common/functions || exit 1 + +if [ -s ./TEST_ENV ];then + source ./TEST_ENV +fi + +if [ "$RESOURCE_MANAGER" = "slurm" ];then + rm=slurm +else + ERROR "Unsupported or unknown resource manager" + exit 1 +fi + +PKG="Boost/MKL ublas header" + + +@test "[$PKG] sylvester_mkl 100 iter 400x600 test under resource manager ($rm/$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + test="sylvester_mkl" + ARGS="100 400 600" + CMD_TIMEOUT=30 + echo $test + if [ ! -x $test ];then + flunk "$test does not exist" + fi + + rm -f $test.results + + run run_serial_binary -o $test.results ./$test $ARGS + assert_success + + # Verify a timing was recorded + run grep "Total time" $test.results + assert_success + +# run grep "Iterations" $test.results +# assert_success + +# mkl_iter_arr=($(grep Iterations $test.results | sed s/\ /\\n/g)) +} + +@test "[$PKG] sylvester_ublas 100 iter 400x600 test under resource manager ($rm/$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + test="sylvester_ublas" + ARGS="100 400 600" + CMD_TIMEOUT=30 + echo $test + if [ ! -x $test ];then + flunk "$test does not exist" + fi + + rm -f $test.results + + run run_serial_binary -o $test.results ./$test $ARGS + assert_success + + # Verify a timing was recorded + run grep "Total time" $test.results + assert_success + +# run grep "Iterations" $test.results +# assert_success + +# ublas_iter_arr=($(grep Iterations $test.results | sed s/\ /\\n/g)) +} + + +@test "[$PKG] sylvester Iterations match test between MKL and ublas" { + test1="sylvester_mkl" + test2="sylvester_ublas" + ARGS="100 400 600" + echo $test1 + if [ ! -x $test1 ];then + flunk "$test1 does not exist" + fi + + echo $test2 + if [ ! -x $test2 ];then + flunk "$test2 does not exist" + fi + + rm -f $test1.results + rm -f $test2.results + +# Removing quotes on "$ARGS" as it does not recognize the 2nd and the 3rd params + run run_serial_binary -o $test1.results ./$test1 $ARGS + assert_success + +# Weird -- the line below will only take the 1st of the ARGS parameters unlike above ... +# run run_serial_binary -o $test2.results ./$test2 $ARGS + run run_serial_binary -o $test2.results ./$test2 100 400 600 + assert_success + + mkl_iter_arr=($(grep Iterations $test1.results | sed s/\ /\\n/g)) + ublas_iter_arr=($(grep Iterations $test2.results | sed s/\ /\\n/g)) + +# echo "Test ................................................................" +# echo "MKL Iter: ${mkl_iter_arr[1]}" +# echo "ublas Iter: ${ublas_iter_arr[1]}" + + if [ ${mkl_iter_arr[1]} != ${ublas_iter_arr[1]} ]; then + echo "MKL Iter: ${mkl_iter_arr[1]}" + echo "ublas Iter: ${ublas_iter_arr[1]}" + flunk "Number of Iterations between MKL= ${mkl_iter_arr[1]} do not match ublas= ${ublas_iter_arr[1]}" +# flunk "Number of iterations between MKL and ublas do not match" + fi +} +# run run_mpi_binary -t $CMD_TIMEOUT -o $ofile ../$EXE "$ARGS" $NODES $TASKS +#ARGS="-in $ifile" +#EXE=$TEST_EXE.$LMOD_FAMILY_COMPILER.$LMOD_FAMILY_MPI diff --git a/tests/libs/boost/tests/mkl-ublas/test/source/sylvester.cpp b/tests/libs/boost/tests/mkl-ublas/test/source/sylvester.cpp new file mode 100644 index 0000000000..8ae3775b49 --- /dev/null +++ b/tests/libs/boost/tests/mkl-ublas/test/source/sylvester.cpp @@ -0,0 +1,124 @@ +/******************************************************************************* +! Copyright(C) 2008-2013 Intel Corporation. All Rights Reserved. +! +! The source code, information and material ("Material") contained herein is +! owned by Intel Corporation or its suppliers or licensors, and title to such +! Material remains with Intel Corporation or its suppliers or licensors. The +! Material contains proprietary information of Intel or its suppliers and +! licensors. The Material is protected by worldwide copyright laws and treaty +! provisions. No part of the Material may be used, copied, reproduced, +! modified, published, uploaded, posted, transmitted, distributed or disclosed +! in any way without Intel's prior express written permission. No license +! under any patent, copyright or other intellectual property rights in the +! Material is granted to or conferred upon you, either expressly, by +! implication, inducement, estoppel or otherwise. Any license under such +! intellectual property rights must be express and approved by Intel in +! writing. +! +! *Third Party trademarks are the property of their respective owners. +! +! Unless otherwise agreed by Intel in writing, you may not remove or alter +! this notice or any other notice embedded in Materials by Intel or Intel's +! suppliers or licensors in any way. +! +!******************************************************************************* +! Content: +! This code solves a very special case of Sylvester equation X-BXC=D +! Example demonstrates usage of the MKL ublas header. +! Matrices D and X can be rectangular. +! Arguments (default: 1 3 4) +! sylvester [count [rows [columns]]] +! where count is iterations limit, rows of D or X, columns of D or X +!******************************************************************************/ + +#include +#include + +#include + +#ifdef MKL +#include "mkl_boost_ublas_matrix_prod.hpp" +#endif + +using namespace boost::numeric::ublas; + +template +M & +sylvester(const M &B, const M &C, const M &D, M &X, const T &eps, long max_iter); + +int main (int argc, char **argv) { + long i; + size_t csize1 = 3; + size_t csize2 = 4; + long count = 1; + double epsilon = 1e-15; + + if(argc>1) count = atol(argv[1]); + if(argc>2) csize1 = atol(argv[2]); + if(argc>3) csize2 = atol(argv[3]); + else csize2 = csize1; + +#ifdef MKL + std::cout << std::endl << " MKL: max iterations: " << count << " size: " << csize1 << "x" << csize2 << std::endl; +#else + std::cout << std::endl << "uBLAS: max iterations: " << count << " size: " << csize1 << "x" << csize2 << std::endl; +#endif + + matrix B(zero_matrix(csize1, csize1)); + matrix C(zero_matrix(csize2, csize2)); + matrix D(scalar_matrix(csize1, csize2, 1)); + matrix X(csize1, csize2); + + for(i=0;i0) + C(i,i-1) = 0.5; // and 1 lower diagonal + } + + X = sylvester(B,C,D,X,epsilon,count); + + return 0; +} + +template +M & +sylvester(const M &B, const M &C, const M &D, M &X, const T &eps, long max_iter) { + T delta = static_cast (1); + T Emax = static_cast (1e100); + long count = 0; + matrixB1(B); + matrixC1(C); + X = D; + + boost::timer tim; // Start timing + + while (eps < delta && delta < Emax) { + X = X + prod(matrix(prod(B1,X)),C1); // X = X + B*X*C; + B1 = prod(B1,B1); // B = B*B; + C1 = prod(C1,C1); // C = C*C; + delta = norm_frobenius(B1) + norm_frobenius(C1);// delta = norm(B) + norm(C); + if(count++ > max_iter) // k=k+1 + break; + } + { + double tsec = tim.elapsed(); // Finish timing + int m = (int)(tsec / 60); + double s = tsec - m*60; + std::cout << "Total time" << " " << m << ":"; + if(s<10) { std::cout << "0"; } + std::cout << s << " (" << tsec << ")" << std::endl; + } + + // norm( X - BXC - D ) + T norm = norm_frobenius(X - prod(matrix(prod(B,X)),C) - D); + + std::cout << "Iterations: " << count << " norm: " << norm << std::endl; + + return X; +} diff --git a/tests/libs/boost/tests/mkl-ublas/test/sylvester.cpp b/tests/libs/boost/tests/mkl-ublas/test/sylvester.cpp new file mode 100644 index 0000000000..8ae3775b49 --- /dev/null +++ b/tests/libs/boost/tests/mkl-ublas/test/sylvester.cpp @@ -0,0 +1,124 @@ +/******************************************************************************* +! Copyright(C) 2008-2013 Intel Corporation. All Rights Reserved. +! +! The source code, information and material ("Material") contained herein is +! owned by Intel Corporation or its suppliers or licensors, and title to such +! Material remains with Intel Corporation or its suppliers or licensors. The +! Material contains proprietary information of Intel or its suppliers and +! licensors. The Material is protected by worldwide copyright laws and treaty +! provisions. No part of the Material may be used, copied, reproduced, +! modified, published, uploaded, posted, transmitted, distributed or disclosed +! in any way without Intel's prior express written permission. No license +! under any patent, copyright or other intellectual property rights in the +! Material is granted to or conferred upon you, either expressly, by +! implication, inducement, estoppel or otherwise. Any license under such +! intellectual property rights must be express and approved by Intel in +! writing. +! +! *Third Party trademarks are the property of their respective owners. +! +! Unless otherwise agreed by Intel in writing, you may not remove or alter +! this notice or any other notice embedded in Materials by Intel or Intel's +! suppliers or licensors in any way. +! +!******************************************************************************* +! Content: +! This code solves a very special case of Sylvester equation X-BXC=D +! Example demonstrates usage of the MKL ublas header. +! Matrices D and X can be rectangular. +! Arguments (default: 1 3 4) +! sylvester [count [rows [columns]]] +! where count is iterations limit, rows of D or X, columns of D or X +!******************************************************************************/ + +#include +#include + +#include + +#ifdef MKL +#include "mkl_boost_ublas_matrix_prod.hpp" +#endif + +using namespace boost::numeric::ublas; + +template +M & +sylvester(const M &B, const M &C, const M &D, M &X, const T &eps, long max_iter); + +int main (int argc, char **argv) { + long i; + size_t csize1 = 3; + size_t csize2 = 4; + long count = 1; + double epsilon = 1e-15; + + if(argc>1) count = atol(argv[1]); + if(argc>2) csize1 = atol(argv[2]); + if(argc>3) csize2 = atol(argv[3]); + else csize2 = csize1; + +#ifdef MKL + std::cout << std::endl << " MKL: max iterations: " << count << " size: " << csize1 << "x" << csize2 << std::endl; +#else + std::cout << std::endl << "uBLAS: max iterations: " << count << " size: " << csize1 << "x" << csize2 << std::endl; +#endif + + matrix B(zero_matrix(csize1, csize1)); + matrix C(zero_matrix(csize2, csize2)); + matrix D(scalar_matrix(csize1, csize2, 1)); + matrix X(csize1, csize2); + + for(i=0;i0) + C(i,i-1) = 0.5; // and 1 lower diagonal + } + + X = sylvester(B,C,D,X,epsilon,count); + + return 0; +} + +template +M & +sylvester(const M &B, const M &C, const M &D, M &X, const T &eps, long max_iter) { + T delta = static_cast (1); + T Emax = static_cast (1e100); + long count = 0; + matrixB1(B); + matrixC1(C); + X = D; + + boost::timer tim; // Start timing + + while (eps < delta && delta < Emax) { + X = X + prod(matrix(prod(B1,X)),C1); // X = X + B*X*C; + B1 = prod(B1,B1); // B = B*B; + C1 = prod(C1,C1); // C = C*C; + delta = norm_frobenius(B1) + norm_frobenius(C1);// delta = norm(B) + norm(C); + if(count++ > max_iter) // k=k+1 + break; + } + { + double tsec = tim.elapsed(); // Finish timing + int m = (int)(tsec / 60); + double s = tsec - m*60; + std::cout << "Total time" << " " << m << ":"; + if(s<10) { std::cout << "0"; } + std::cout << s << " (" << tsec << ")" << std::endl; + } + + // norm( X - BXC - D ) + T norm = norm_frobenius(X - prod(matrix(prod(B,X)),C) - D); + + std::cout << "Iterations: " << count << " norm: " << norm << std::endl; + + return X; +} diff --git a/tests/libs/boost/tests/mkl-ublas/test/ublas.lst b/tests/libs/boost/tests/mkl-ublas/test/ublas.lst new file mode 100644 index 0000000000..79df64172d --- /dev/null +++ b/tests/libs/boost/tests/mkl-ublas/test/ublas.lst @@ -0,0 +1 @@ +UBLAS = sylvester diff --git a/tests/libs/boost/tests/mkl-ublas/ublas.lst b/tests/libs/boost/tests/mkl-ublas/ublas.lst new file mode 100644 index 0000000000..79df64172d --- /dev/null +++ b/tests/libs/boost/tests/mkl-ublas/ublas.lst @@ -0,0 +1 @@ +UBLAS = sylvester diff --git a/tests/libs/boost/tests/module/Makefile.am b/tests/libs/boost/tests/module/Makefile.am new file mode 100644 index 0000000000..3b27885444 --- /dev/null +++ b/tests/libs/boost/tests/module/Makefile.am @@ -0,0 +1 @@ +TESTS = test_module diff --git a/tests/libs/boost/tests/module/f_test.cpp b/tests/libs/boost/tests/module/f_test.cpp new file mode 100644 index 0000000000..f7fabdee39 --- /dev/null +++ b/tests/libs/boost/tests/module/f_test.cpp @@ -0,0 +1,250 @@ +// Copyright John Maddock 2006 +// Copyright Paul A. Bristow 2007, 2008, 2010 + +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +#ifdef _MSC_VER +# pragma warning(disable: 4512) // assignment operator could not be generated. +# pragma warning(disable: 4510) // default constructor could not be generated. +# pragma warning(disable: 4610) // can never be instantiated - user defined constructor required. +# pragma warning(disable: 4180) // qualifier has no effect (in Fusion). +#endif + +#include +using std::cout; using std::endl; +using std::left; using std::fixed; using std::right; using std::scientific; +#include +using std::setw; +using std::setprecision; + +#include + +void f_test( + double sd1, // Sample 1 std deviation + double sd2, // Sample 2 std deviation + double N1, // Sample 1 size + double N2, // Sample 2 size + double alpha) // Significance level +{ + // + // An F test applied to two sets of data. + // We are testing the null hypothesis that the + // standard deviation of the samples is equal, and + // that any variation is down to chance. We can + // also test the alternative hypothesis that any + // difference is not down to chance. + // See http://www.itl.nist.gov/div898/handbook/eda/section3/eda359.htm + // + // Avoid "using namespace boost::math;" because of potential name ambiguity. + using boost::math::fisher_f; + + // Print header: + cout << + "____________________________________\n" + "F test for equal standard deviations\n" + "____________________________________\n\n"; + cout << setprecision(5); + cout << "Sample 1:\n"; + cout << setw(55) << left << "Number of Observations" << "= " << N1 << "\n"; + cout << setw(55) << left << "Sample Standard Deviation" << "= " << sd1 << "\n\n"; + cout << "Sample 2:\n"; + cout << setw(55) << left << "Number of Observations" << "= " << N2 << "\n"; + cout << setw(55) << left << "Sample Standard Deviation" << "= " << sd2 << "\n\n"; + // + // Now we can calculate and output some stats: + // + // F-statistic: + double F = (sd1 / sd2); + F *= F; + cout << setw(55) << left << "Test Statistic" << "= " << F << "\n\n"; + // + // Finally define our distribution, and get the probability: + // + fisher_f dist(N1 - 1, N2 - 1); + double p = cdf(dist, F); + cout << setw(55) << left << "CDF of test statistic: " << "= " + << setprecision(3) << scientific << p << "\n"; + double ucv = quantile(complement(dist, alpha)); + double ucv2 = quantile(complement(dist, alpha / 2)); + double lcv = quantile(dist, alpha); + double lcv2 = quantile(dist, alpha / 2); + cout << setw(55) << left << "Upper Critical Value at alpha: " << "= " + << setprecision(3) << scientific << ucv << "\n"; + cout << setw(55) << left << "Upper Critical Value at alpha/2: " << "= " + << setprecision(3) << scientific << ucv2 << "\n"; + cout << setw(55) << left << "Lower Critical Value at alpha: " << "= " + << setprecision(3) << scientific << lcv << "\n"; + cout << setw(55) << left << "Lower Critical Value at alpha/2: " << "= " + << setprecision(3) << scientific << lcv2 << "\n\n"; + // + // Finally print out results of null and alternative hypothesis: + // + cout << setw(55) << left << + "Results for Alternative Hypothesis and alpha" << "= " + << setprecision(4) << fixed << alpha << "\n\n"; + cout << "Alternative Hypothesis Conclusion\n"; + cout << "Standard deviations are unequal (two sided test) "; + if((ucv2 < F) || (lcv2 > F)) + cout << "NOT REJECTED\n"; + else + cout << "REJECTED\n"; + cout << "Standard deviation 1 is less than standard deviation 2 "; + if(lcv > F) + cout << "NOT REJECTED\n"; + else + cout << "REJECTED\n"; + cout << "Standard deviation 1 is greater than standard deviation 2 "; + if(ucv < F) + cout << "NOT REJECTED\n"; + else + cout << "REJECTED\n"; + cout << endl << endl; +} + +int main() +{ + // + // Run tests for ceramic strength data: + // see http://www.itl.nist.gov/div898/handbook/eda/section4/eda42a1.htm + // The data for this case study were collected by Said Jahanmir of the + // NIST Ceramics Division in 1996 in connection with a NIST/industry + // ceramics consortium for strength optimization of ceramic strength. + // + f_test(65.54909, 61.85425, 240, 240, 0.05); + // + // And again for the process change comparison: + // see http://www.itl.nist.gov/div898/handbook/prc/section3/prc32.htm + // A new procedure to assemble a device is introduced and tested for + // possible improvement in time of assembly. The question being addressed + // is whether the standard deviation of the new assembly process (sample 2) is + // better (i.e., smaller) than the standard deviation for the old assembly + // process (sample 1). + // + f_test(4.9082, 2.5874, 11, 9, 0.05); + return 0; +} + +/* + +Output: + + f_test.cpp + F-test_example1.vcxproj -> J:\Cpp\MathToolkit\test\Math_test\Debug\F_test_example1.exe + ____________________________________ + F test for equal standard deviations + ____________________________________ + + Sample 1: + Number of Observations = 240 + Sample Standard Deviation = 65.549 + + Sample 2: + Number of Observations = 240 + Sample Standard Deviation = 61.854 + + Test Statistic = 1.123 + + CDF of test statistic: = 8.148e-001 + Upper Critical Value at alpha: = 1.238e+000 + Upper Critical Value at alpha/2: = 1.289e+000 + Lower Critical Value at alpha: = 8.080e-001 + Lower Critical Value at alpha/2: = 7.756e-001 + + Results for Alternative Hypothesis and alpha = 0.0500 + + Alternative Hypothesis Conclusion + Standard deviations are unequal (two sided test) REJECTED + Standard deviation 1 is less than standard deviation 2 REJECTED + Standard deviation 1 is greater than standard deviation 2 REJECTED + + + ____________________________________ + F test for equal standard deviations + ____________________________________ + + Sample 1: + Number of Observations = 11.00000 + Sample Standard Deviation = 4.90820 + + Sample 2: + Number of Observations = 9.00000 + Sample Standard Deviation = 2.58740 + + Test Statistic = 3.59847 + + CDF of test statistic: = 9.589e-001 + Upper Critical Value at alpha: = 3.347e+000 + Upper Critical Value at alpha/2: = 4.295e+000 + Lower Critical Value at alpha: = 3.256e-001 + Lower Critical Value at alpha/2: = 2.594e-001 + + Results for Alternative Hypothesis and alpha = 0.0500 + + Alternative Hypothesis Conclusion + Standard deviations are unequal (two sided test) REJECTED + Standard deviation 1 is less than standard deviation 2 REJECTED + Standard deviation 1 is greater than standard deviation 2 NOT REJECTED + + + ____________________________________ + F test for equal standard deviations + ____________________________________ + + Sample 1: + Number of Observations = 240 + Sample Standard Deviation = 65.549 + + Sample 2: + Number of Observations = 240 + Sample Standard Deviation = 61.854 + + Test Statistic = 1.123 + + CDF of test statistic: = 8.148e-001 + Upper Critical Value at alpha: = 1.238e+000 + Upper Critical Value at alpha/2: = 1.289e+000 + Lower Critical Value at alpha: = 8.080e-001 + Lower Critical Value at alpha/2: = 7.756e-001 + + Results for Alternative Hypothesis and alpha = 0.0500 + + Alternative Hypothesis Conclusion + Standard deviations are unequal (two sided test) REJECTED + Standard deviation 1 is less than standard deviation 2 REJECTED + Standard deviation 1 is greater than standard deviation 2 REJECTED + + + ____________________________________ + F test for equal standard deviations + ____________________________________ + + Sample 1: + Number of Observations = 11.00000 + Sample Standard Deviation = 4.90820 + + Sample 2: + Number of Observations = 9.00000 + Sample Standard Deviation = 2.58740 + + Test Statistic = 3.59847 + + CDF of test statistic: = 9.589e-001 + Upper Critical Value at alpha: = 3.347e+000 + Upper Critical Value at alpha/2: = 4.295e+000 + Lower Critical Value at alpha: = 3.256e-001 + Lower Critical Value at alpha/2: = 2.594e-001 + + Results for Alternative Hypothesis and alpha = 0.0500 + + Alternative Hypothesis Conclusion + Standard deviations are unequal (two sided test) REJECTED + Standard deviation 1 is less than standard deviation 2 REJECTED + Standard deviation 1 is greater than standard deviation 2 NOT REJECTED + + + +*/ + diff --git a/tests/libs/boost/tests/module/test_module b/tests/libs/boost/tests/module/test_module new file mode 100755 index 0000000000..ff6f939e09 --- /dev/null +++ b/tests/libs/boost/tests/module/test_module @@ -0,0 +1,142 @@ +#!../../../../common/bats/bin/bats +# -*-sh-*- + +source ../../../../common/test_helper_functions.bash || exit 1 + +if [ -s ../../../../TEST_ENV ];then + source ../../../../TEST_ENV +fi + +PKG=BOOST +module=boost +library=libboost_program_options +header=boost/version.hpp +rpm=boost-$LMOD_FAMILY_COMPILER-$LMOD_FAMILY_MPI${DELIM} + +@test "[$PKG] Verify $PKG module is loaded and matches rpm version ($LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + module list $module | grep "1) $module" >& .cmd_output || exit 1 + run grep $module .cmd_output + assert_success + + # check version against rpm + local version="$(rpm -q --queryformat='%{VERSION}\n' $rpm)" + run cat .cmd_output + assert_output " 1) $module/$version" +} + +@test "[$PKG] Verify module ${PKG}_DIR is defined and exists ($LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + DIR=${PKG}_DIR + if [ -z ${!DIR} ];then + flunk "${PKG}_DIR directory not defined" + fi + + if [ ! -d ${!DIR} || -z "${!DIR}" ];then + flunk "directory ${!DIR} does not exist" + fi +} + +# ---------- +# Lib Tests +# ---------- + +@test "[$PKG] Verify module ${PKG}_LIB is defined and exists ($LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + LIB=${PKG}_LIB + + if [ -z ${!LIB} ];then + flunk "${PKG}_LIB directory not defined" + fi + + if [ ! -d ${!LIB} ];then + flunk "directory ${!LIB} does not exist" + fi +} + +@test "[$PKG] Verify dynamic library available in ${PKG}_LIB ($LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + LIB=${PKG}_LIB + + if [ -z ${!LIB} ];then + flunk "${PKG}_LIB directory not defined" + fi + + if [ ! -s ${!LIB}/${library}.so ];then + flunk "${library}.so does not exist" + fi +} + +@test "[$PKG] Verify static library is not present in ${PKG}_LIB ($LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + #skip "Disabling while static libs still present" + LIB=${PKG}_LIB + + if [ -z ${!LIB} ];then + flunk "${PKG}_LIB directory not defined" + fi + + if [ -e ${!LIB}/${library}.a ];then + flunk "${library}.a exists when not expecting it" + fi +} + +# -------------- +# Include Tests +# -------------- + +@test "[$PKG] Verify module ${PKG}_INC is defined and exists ($LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + INC=${PKG}_INC + + if [ -z ${!INC} ];then + flunk "${PKG}_INC directory not defined" + fi + + if [ ! -d ${!INC} ];then + flunk "directory ${!INC} does not exist" + fi +} + +@test "[$PKG] Verify header file is present in ${PKG}_INC ($LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + INC=${PKG}_INC + + if [ -z ${!INC} ];then + flunk "${PKG}_INC directory not defined" + fi + + if [ ! -s ${!INC}/${header} ];then + flunk "directory $header file does not exist" + fi +} + +# Execution Test + +@test "[$PKG] Test interactive build/exec of f_test.cpp ($LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + INC=${PKG}_INC + LIB=${PKG}_LIB + + if [ -z ${!INC} ];then + flunk "${PKG}_INC directory not defined" + fi + + if [ -z ${!LIB} ];then + flunk "${PKG}_LIB directory not defined" + fi + + if [ $LMOD_FAMILY_COMPILER == "intel" ];then + CXX=icpc + elif [ $LMOD_FAMILY_COMPILER == "gnu" ];then + CXX=g++ + else + flunk "Unknown compiler family" + fi + + run $CXX -o f_test -I${!INC} f_test.cpp -L${!LIB} -lboost_math_c99 + assert_success + run ./f_test + assert_success + module del boost + assert_success + run ./f_test + assert_failure + +} + + + +rm -f .cmd_output diff --git a/tests/libs/boost/tests/multi_array/test/Makefile.am b/tests/libs/boost/tests/multi_array/test/Makefile.am new file mode 100644 index 0000000000..a99ea86c0b --- /dev/null +++ b/tests/libs/boost/tests/multi_array/test/Makefile.am @@ -0,0 +1,24 @@ +TESTS_ENVIRONMENT = BATS_NO_SUMMARY=1 +AM_CXXFLAGS = -I$(BOOST_INC) + +# Test compilations/execution + +TESTS = access +check_PROGRAMS = access +access_SOURCES = access.cpp + +TESTS += iterators +check_PROGRAMS += iterators +iterators_SOURCES = iterators.cpp + +TESTS += resize +check_PROGRAMS += resize +resize_SOURCES = resize.cpp + +TESTS += idxgen1 +check_PROGRAMS += idxgen1 +idxgen1_SOURCES = idxgen1.cpp + +# Test execution through resource manager + +TESTS += rm_execution diff --git a/tests/libs/boost/tests/multi_array/test/TEST_ENV b/tests/libs/boost/tests/multi_array/test/TEST_ENV new file mode 120000 index 0000000000..e299a1c3bd --- /dev/null +++ b/tests/libs/boost/tests/multi_array/test/TEST_ENV @@ -0,0 +1 @@ +../../../../../TEST_ENV \ No newline at end of file diff --git a/tests/libs/boost/tests/multi_array/test/access.cpp b/tests/libs/boost/tests/multi_array/test/access.cpp new file mode 100644 index 0000000000..755a152812 --- /dev/null +++ b/tests/libs/boost/tests/multi_array/test/access.cpp @@ -0,0 +1,63 @@ +// Copyright 2002 The Trustees of Indiana University. + +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// Boost.MultiArray Library +// Authors: Ronald Garcia +// Jeremy Siek +// Andrew Lumsdaine +// See http://www.boost.org/libs/multi_array for documentation. + +// +// access.cpp - operator[] and operator() tests with various arrays +// The tests assume that they are working on an Array of shape 2x3x4 +// + +#include "generative_tests.hpp" +#include "boost/static_assert.hpp" + +template +void access(Array& A, const mutable_array_tag&) { + assign(A); + access(A,const_array_tag()); + + const Array& CA = A; + access(CA,const_array_tag()); +} + +template +void access(Array& A, const const_array_tag&) { + const unsigned int ndims = 3; + BOOST_STATIC_ASSERT((Array::dimensionality == ndims)); + typedef typename Array::index index; + const index idx0 = A.index_bases()[0]; + const index idx1 = A.index_bases()[1]; + const index idx2 = A.index_bases()[2]; + + // operator[] + int cnum = 0; + const Array& CA = A; + for (index i = idx0; i != idx0+2; ++i) + for (index j = idx1; j != idx1+3; ++j) + for (index k = idx2; k != idx2+4; ++k) { + BOOST_CHECK(A[i][j][k] == cnum++); + BOOST_CHECK(CA[i][j][k] == A[i][j][k]); + } + + // operator() + for (index i2 = idx0; i2 != idx0+2; ++i2) + for (index j2 = idx1; j2 != idx1+3; ++j2) + for (index k2 = idx2; k2 != idx2+4; ++k2) { + boost::array indices; + indices[0] = i2; indices[1] = j2; indices[2] = k2; + BOOST_CHECK(A(indices) == A[i2][j2][k2]); + BOOST_CHECK(CA(indices) == A(indices)); + } + ++tests_run; +} + +int test_main(int,char*[]) { + return run_generative_tests(); +} diff --git a/tests/libs/boost/tests/multi_array/test/common b/tests/libs/boost/tests/multi_array/test/common new file mode 120000 index 0000000000..dbd3b47ab4 --- /dev/null +++ b/tests/libs/boost/tests/multi_array/test/common @@ -0,0 +1 @@ +../../../../../common/ \ No newline at end of file diff --git a/tests/libs/boost/tests/multi_array/test/generative_tests.hpp b/tests/libs/boost/tests/multi_array/test/generative_tests.hpp new file mode 100644 index 0000000000..d246f87a57 --- /dev/null +++ b/tests/libs/boost/tests/multi_array/test/generative_tests.hpp @@ -0,0 +1,285 @@ +#ifndef GENERATIVE_TESTS_RG072001_HPP +#define GENERATIVE_TESTS_RG072001_HPP + +// Copyright 2002 The Trustees of Indiana University. + +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// Boost.MultiArray Library +// Authors: Ronald Garcia +// Jeremy Siek +// Andrew Lumsdaine +// See http://www.boost.org/libs/multi_array for documentation. + +// +// generative-tests.hpp - Framework for running tests on all the types +// of multi_array +// +// In order to create a set of tests, you must define the following two +// function signatures: +// template +// void access(Array& A, const mutable_array_tag&); +// +// template +// void access(Array& A, const const_array_tag&); +// +// The framework will always pass 2x3x4 arrays into these functions. +// The const_array_tag version of access must NOT attempt to modify +// the array. Assume that the passed array has constness in this case. +// +// The mutable_array_tag version of access should pass the array to the +// assign() function in order to set its values before running tests. +// +// If you wish to write your own code to assign data to the array +// (ie. test the iterators by assigning data with them), you must +// #define MULTIARRAY_TEST_ASSIGN before including this file. +// assign() will call this function. +// +// If you wish to know how many tests were run, you must increment +// the global variable 'tests_run' somewhere in your test code. +// +// Since generative-tests uses the Boost.Test framework, you must +// define at least the following: +// +// int test_main(int,char*[]) { return run_generative_tests(); } +// +#include "boost/multi_array.hpp" + +#include "boost/test/minimal.hpp" + +#include /* BOOST_NO_SFINAE */ +#include +#include +#include + +namespace { + unsigned int tests_run = 0; +} // empty namespace + +struct mutable_array_tag { }; +struct const_array_tag { }; + +template +void assign_if_not_const(Array&, const const_array_tag&) { + // do nothing +} + +template +void assign_if_not_const(Array& A, const mutable_array_tag&); + +#ifndef MULTIARRAY_TEST_ASSIGN +template +void assign_if_not_const(Array& A, const mutable_array_tag&) { + + typedef typename Array::index index; + + const index idx0 = A.index_bases()[0]; + const index idx1 = A.index_bases()[1]; + const index idx2 = A.index_bases()[2]; + + + int num = 0; + for (index i = idx0; i != idx0 + 2; ++i) + for (index j = idx1; j != idx1 + 3; ++j) + for (index k = idx2; k != idx2 + 4; ++k) + A[i][j][k] = num++; +} +#endif // MULTIARRAY_TEST_ASSIGN + +template +void assign(Array& A) { + assign_if_not_const(A,mutable_array_tag()); +} + +template +void access(Array& A, const mutable_array_tag&); + +template +void access(Array& A, const const_array_tag&); + +template +int run_configuration(const StorageOrder3& so3, + const StorageOrder4& so4, + const Modifier& modifier) { + // multi_array + { + typedef boost::multi_array array; + typename array::extent_gen extents; + { + array A(extents[2][3][4],so3); + modifier.modify(A); + access(A,mutable_array_tag()); + } + } + // multi_array_ref + { + typedef boost::multi_array_ref array_ref; + typename array_ref::extent_gen extents; + { + int local[24]; + array_ref A(local,extents[2][3][4],so3); + modifier.modify(A); + access(A,mutable_array_tag()); + } + } + // const_multi_array_ref + { + typedef boost::multi_array_ref array_ref; + typedef boost::const_multi_array_ref const_array_ref; + typename array_ref::extent_gen extents; + { + int local[24]; + array_ref A(local,extents[2][3][4],so3); + modifier.modify(A); + assign(A); + + const_array_ref B = A; + access(B,const_array_tag()); + } + } + // sub_array + { + typedef boost::multi_array array; + typename array::extent_gen extents; + { + array A(extents[2][2][3][4],so4); + modifier.modify(A); + typename array::template subarray<3>::type B = A[1]; + access(B,mutable_array_tag()); + } + } + // const_sub_array + { + typedef boost::multi_array array; + typename array::extent_gen extents; + { + array A(extents[2][2][3][4],so4); + modifier.modify(A); + typename array::template subarray<3>::type B = A[1]; + assign(B); + + typename array::template const_subarray<3>::type C = B; + access(C,const_array_tag()); + } + } + // array_view + { + typedef boost::multi_array array; + typedef typename array::index_range range; + typename array::index_gen indices; + typename array::extent_gen extents; + { + typedef typename array::index index; + + array A(extents[4][5][6],so3); + modifier.modify(A); + const index idx0 = A.index_bases()[0]; + const index idx1 = A.index_bases()[1]; + const index idx2 = A.index_bases()[2]; + + typename array::template array_view<3>::type B =A[ + indices[range(idx0+1,idx0+3)] + [range(idx1+1,idx1+4)] + [range(idx2+1,idx2+5)] + ]; + access(B,mutable_array_tag()); + } + } + // const_array_view + { + typedef boost::multi_array array; + typedef typename array::index_range range; + typename array::index_gen indices; + typename array::extent_gen extents; + { + typedef typename array::index index; + + array A(extents[4][5][6],so3); + modifier.modify(A); + const index idx0 = A.index_bases()[0]; + const index idx1 = A.index_bases()[1]; + const index idx2 = A.index_bases()[2]; + + typename array::template array_view<3>::type B =A[ + indices[range(idx0+1,idx0+3)] + [range(idx1+1,idx1+4)] + [range(idx2+1,idx2+5)] + ]; + assign(B); + + typename array::template const_array_view<3>::type C = B; + access(C,const_array_tag()); + } + } + return boost::exit_success; +} + +template +int run_storage_tests(const ArrayModifier& modifier) { + run_configuration(boost::c_storage_order(), + boost::c_storage_order(),modifier); + run_configuration(boost::fortran_storage_order(), + boost::fortran_storage_order(),modifier); + + std::size_t ordering[] = {2,0,1,3}; + bool ascending[] = {false,true,true,true}; + run_configuration(boost::general_storage_order<3>(ordering,ascending), + boost::general_storage_order<4>(ordering,ascending), + modifier); + + return boost::exit_success; +} + +struct null_modifier { + template + void modify(Array&) const { } +}; + +struct set_index_base_modifier { + template + void modify(Array& A) const { +#ifdef BOOST_NO_SFINAE + typedef boost::multi_array_types::index index; + A.reindex(index(1)); +#else + A.reindex(1); +#endif + } +}; + +struct reindex_modifier { + template + void modify(Array& A) const { + boost::array bases = {{1,2,3,4}}; + A.reindex(bases); + } +}; + +struct reshape_modifier { + template + void modify(Array& A) const { + typedef typename Array::size_type size_type; + std::vector old_shape(A.num_dimensions()); + std::vector new_shape(A.num_dimensions()); + + std::copy(A.shape(),A.shape()+A.num_dimensions(),old_shape.begin()); + std::copy(old_shape.rbegin(),old_shape.rend(),new_shape.begin()); + + A.reshape(new_shape); + A.reshape(old_shape); + } +}; + +int run_generative_tests() { + + run_storage_tests(null_modifier()); + run_storage_tests(set_index_base_modifier()); + run_storage_tests(reindex_modifier()); + run_storage_tests(reshape_modifier()); + std::cout << "Total Tests Run: " << tests_run << '\n'; + return boost::exit_success; +} + +#endif // GENERATIVE_TESTS_RG072001_HPP diff --git a/tests/libs/boost/tests/multi_array/test/idxgen1.cpp b/tests/libs/boost/tests/multi_array/test/idxgen1.cpp new file mode 100644 index 0000000000..67cbb2fb4b --- /dev/null +++ b/tests/libs/boost/tests/multi_array/test/idxgen1.cpp @@ -0,0 +1,81 @@ +// Copyright 2002 The Trustees of Indiana University. + +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// Boost.MultiArray Library +// Authors: Ronald Garcia +// Jeremy Siek +// Andrew Lumsdaine +// See http://www.boost.org/libs/multi_array for documentation. + +// +// idxset1.cpp - testing the code for index_gen +// + +#include "boost/multi_array/index_gen.hpp" +#include "boost/multi_array/index_range.hpp" +#include "boost/multi_array/types.hpp" +#include "boost/test/minimal.hpp" + +#include "boost/array.hpp" + +typedef boost::detail::multi_array::index index_type; +typedef boost::detail::multi_array::size_type size_type; +typedef boost::detail::multi_array::index_range range; + +template +void check(const boost::detail::multi_array:: + index_gen&) { } + +bool operator==(const range& lhs,const range& rhs) { + return lhs.start_ == rhs.start_ && + lhs.finish_ == rhs.finish_ && + lhs.stride_ == rhs.stride_ && + lhs.degenerate_ == rhs.degenerate_; +} + +int +test_main(int,char*[]) +{ + + boost::detail::multi_array::index_gen<0,0> indices; + + + check<1,1>(indices[range()]); + check<2,2>(indices[range()][range()]); + check<3,3>(indices[range()][range()][range()]); + + check<1,0>(indices[0]); + check<2,0>(indices[0][0]); + check<2,1>(indices[range()][0]); + check<2,1>(indices[0][range()]); + check<3,0>(indices[0][0][0]); + check<3,1>(indices[range()][0][0]); + check<3,1>(indices[0][range()][0]); + check<3,1>(indices[0][0][range()]); + check<3,2>(indices[range()][range()][0]); + check<3,2>(indices[range()][0][range()]); + check<3,2>(indices[0][range()][range()]); + + { + boost::detail::multi_array::index_gen<3,3> is1 = + indices[range(0,1,2)][range(1,2,3)][range(2,3,4)]; + BOOST_CHECK(is1.ranges_[0] == range(0,1,2)); + BOOST_CHECK(is1.ranges_[1] == range(1,2,3)); + BOOST_CHECK(is1.ranges_[2] == range(2,3,4)); + } + + { + boost::detail::multi_array::index_gen<3,2> is2 = + indices[range(0,1,2)][2][range(2,3,4)]; + BOOST_CHECK(is2.ranges_[0] == range(0,1,2)); + BOOST_CHECK(is2.ranges_[1] == range(2)); + BOOST_CHECK(is2.ranges_[1].is_degenerate()); + BOOST_CHECK(is2.ranges_[2] == range(2,3,4)); + } + + return boost::exit_success; +} + diff --git a/tests/libs/boost/tests/multi_array/test/iterators.cpp b/tests/libs/boost/tests/multi_array/test/iterators.cpp new file mode 100644 index 0000000000..5686c2bd89 --- /dev/null +++ b/tests/libs/boost/tests/multi_array/test/iterators.cpp @@ -0,0 +1,188 @@ +// Copyright 2002 The Trustees of Indiana University. + +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// Boost.MultiArray Library +// Authors: Ronald Garcia +// Jeremy Siek +// Andrew Lumsdaine +// See http://www.boost.org/libs/multi_array for documentation. + +// +// iterators.cpp - checking out iterator stuffs. +// The tests assume that the array has shape 2x3x4 +// + +#define MULTIARRAY_TEST_ASSIGN +#include "generative_tests.hpp" +#include "boost/concept_check.hpp" // for ignore_unused_variable_warning +#include "boost/mpl/if.hpp" +#include "boost/type_traits/is_same.hpp" + +// iterator-test-specific code + +template +void assign_if_not_const(Array& A, const mutable_array_tag&) { + + typedef typename Array::iterator iterator3; + typedef typename Array::template subarray<2>::type::iterator iterator2; + typedef typename Array::template subarray<1>::type::iterator iterator1; + + int num = 0; + for (iterator3 i = A.begin(); i != A.end(); ++i) + for(iterator2 ii = (*i).begin(); ii != (*i).end(); ++ii) + for(iterator1 iii = (*ii).begin(); iii != (*ii).end(); ++iii) + *iii = num++; +} + + +template +struct ittraits_const { + typedef typename Array::const_iterator iterator3; + typedef typename boost::subarray_gen::type::const_iterator + iterator2; + typedef typename boost::subarray_gen::type::const_iterator + iterator1; + + typedef typename Array::const_reverse_iterator riterator3; + typedef typename boost::subarray_gen::type::const_reverse_iterator + riterator2; + typedef typename boost::subarray_gen::type::const_reverse_iterator + riterator1; +}; + +template +struct ittraits_mutable { + typedef typename Array::iterator iterator3; + typedef typename boost::subarray_gen::type::iterator iterator2; + typedef typename boost::subarray_gen::type::iterator iterator1; + + typedef typename Array::reverse_iterator riterator3; + typedef typename boost::subarray_gen::type::reverse_iterator + riterator2; + typedef typename boost::subarray_gen::type::reverse_iterator + riterator1; +}; + + +// Meta-program chooses ittraits implementation. +template +struct ittraits_generator : + boost::mpl::if_< boost::is_same, + ittraits_const, + ittraits_mutable > +{}; + + +template +void construct_iterators(Array&) { + + // Default constructed iterators and + // const iterators constructed from iterators. + { + typename Array::iterator i1; + typename Array::const_iterator ci1; + typename Array::reverse_iterator r1; + typename Array::const_reverse_iterator cr1; + +#if 0 // RG - MSVC fails to compile these + typename Array::const_iterator ci2 = + typename Array::iterator(); + typename Array::const_reverse_iterator cr2 = + typename Array::reverse_iterator(); +#endif + typename Array::const_iterator ci2 = i1; + typename Array::const_reverse_iterator cr2 = cr1; + boost::ignore_unused_variable_warning(cr2); + } +} + +template +void test_iterators(Array& A, const IterTraits&) { + + // Iterator comparison and arithmetic + { + typedef typename IterTraits::iterator3 iterator; + iterator i1 = A.begin(); + iterator i2 = A.end(); + BOOST_CHECK(i1 < i2); + BOOST_CHECK((i2 - i1) == typename iterator::difference_type(2)); + } + + // Standard Array Iteration + { + typedef typename IterTraits::iterator3 iterator3; + typedef typename IterTraits::iterator2 iterator2; + typedef typename IterTraits::iterator1 iterator1; + + int vals = 0; + for (iterator3 i = A.begin(); i != A.end(); ++i) + for(iterator2 ii = (*i).begin(); ii != (*i).end(); ++ii) + for(iterator1 iii = (*ii).begin(); iii != (*ii).end(); ++iii) + BOOST_CHECK(*iii == vals++); + } + + // Using operator->() on iterators + { + typedef typename IterTraits::iterator3 iterator3; + typedef typename IterTraits::iterator2 iterator2; + typedef typename IterTraits::iterator1 iterator1; + + int vals = 0; + for (iterator3 i = A.begin(); i != A.end(); ++i) + for(iterator2 ii = i->begin(); ii != i->end(); ++ii) + for(iterator1 iii = ii->begin(); iii != ii->end(); ++iii) + BOOST_CHECK(*iii == vals++); + } + + // Reverse Iterator Hierarchy Test + { + typedef typename IterTraits::riterator3 riterator3; + typedef typename IterTraits::riterator2 riterator2; + typedef typename IterTraits::riterator1 riterator1; + + int check_iter_val = A.num_elements()-1; + for (riterator3 i = A.rbegin(); i != (riterator3)A.rend(); ++i) + for(riterator2 ii = (*i).rbegin(); ii != (riterator2)(*i).rend(); ++ii) + for(riterator1 iii = (*ii).rbegin(); iii != (riterator1)(*ii).rend(); + ++iii) + BOOST_CHECK(*iii == check_iter_val--); + } + ++tests_run; +} + + +template +void access(Array& A, const mutable_array_tag&) { + assign(A); + + construct_iterators(A); + + typedef typename ittraits_generator::type + m_iter_traits; + + typedef typename ittraits_generator::type + c_iter_traits; + test_iterators(A,m_iter_traits()); + test_iterators(A,c_iter_traits()); + + const Array& CA = A; + test_iterators(CA,c_iter_traits()); +} + +template +void access(Array& A, const const_array_tag&) { + construct_iterators(A); + typedef typename ittraits_generator::type + c_iter_traits; + test_iterators(A,c_iter_traits()); +} + + +int +test_main(int, char*[]) +{ + return run_generative_tests(); +} diff --git a/tests/libs/boost/tests/multi_array/test/regression.cfg b/tests/libs/boost/tests/multi_array/test/regression.cfg new file mode 100644 index 0000000000..020b33ec0d --- /dev/null +++ b/tests/libs/boost/tests/multi_array/test/regression.cfg @@ -0,0 +1,38 @@ +// Regression suite file for boost::multi_array + +run libs/multi_array/test/constructors.cpp +run libs/multi_array/test/access.cpp +run libs/multi_array/test/compare.cpp +run libs/multi_array/test/iterators.cpp +run libs/multi_array/test/slice.cpp +run libs/multi_array/test/assign.cpp +run libs/multi_array/test/index_bases.cpp +run libs/multi_array/test/storage_order.cpp +run libs/multi_array/test/reshape.cpp +run libs/multi_array/test/range1.cpp +run libs/multi_array/test/idxgen1.cpp +run libs/multi_array/test/stl_interaction.cpp +compile libs/multi_array/test/concept_checks.cpp + +compile-fail libs/multi_array/test/fail_cbracket.cpp +compile-fail libs/multi_array/test/fail_cdata.cpp +compile-fail libs/multi_array/test/fail_citerator.cpp +compile-fail libs/multi_array/test/fail_cparen.cpp +compile-fail libs/multi_array/test/fail_criterator.cpp +compile-fail libs/multi_array/test/fail_csubarray.cpp +compile-fail libs/multi_array/test/fail_csubarray2.cpp +compile-fail libs/multi_array/test/fail_csubarray3.cpp +compile-fail libs/multi_array/test/fail_cview.cpp +compile-fail libs/multi_array/test/fail_cview2.cpp +compile-fail libs/multi_array/test/fail_cview3.cpp +compile-fail libs/multi_array/test/fail_ref_cbracket.cpp +compile-fail libs/multi_array/test/fail_ref_cdata.cpp +compile-fail libs/multi_array/test/fail_ref_citerator.cpp +compile-fail libs/multi_array/test/fail_ref_cparen.cpp +compile-fail libs/multi_array/test/fail_ref_criterator.cpp +compile-fail libs/multi_array/test/fail_ref_csubarray.cpp +compile-fail libs/multi_array/test/fail_ref_csubarray2.cpp +compile-fail libs/multi_array/test/fail_ref_csubarray3.cpp +compile-fail libs/multi_array/test/fail_ref_cview.cpp +compile-fail libs/multi_array/test/fail_ref_cview2.cpp +compile-fail libs/multi_array/test/fail_ref_cview3.cpp diff --git a/tests/libs/boost/tests/multi_array/test/resize.cpp b/tests/libs/boost/tests/multi_array/test/resize.cpp new file mode 100644 index 0000000000..c00e740223 --- /dev/null +++ b/tests/libs/boost/tests/multi_array/test/resize.cpp @@ -0,0 +1,127 @@ +// Copyright 2002 The Trustees of Indiana University. + +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// Boost.MultiArray Library +// Authors: Ronald Garcia +// Jeremy Siek +// Andrew Lumsdaine +// See http://www.boost.org/libs/multi_array for documentation. + +// +// resize.cpp - Test of resizing multi_arrays +// + +#include "boost/test/minimal.hpp" +#include "boost/multi_array.hpp" +#include +using namespace std; + + +int test_main(int,char*[]) { + + typedef boost::multi_array marray; + + + int A_data[] = { + 0,1,2,3, + 4,5,6,7, + 8,9,10,11, + + 12,13,14,15, + 16,17,18,19, + 20,21,22,23 + }; + + int A_resize[] = { + 0,1, + 4,5, + 8,9, + + 12,13, + 16,17, + 20,21, + + 0,0, + 0,0, + 0,0, + + 0,0, + 0,0, + 0,0 + }; + + // resize through the extent_gen interface + { + marray A(boost::extents[2][3][4]); + A.assign(A_data,A_data+(2*3*4)); + A.resize(boost::extents[4][3][2]); + BOOST_CHECK(std::equal(A_resize,A_resize+(4*3*2),A.data())); + } + + // resize through the Collection + { + marray A(boost::extents[2][3][4]); + A.assign(A_data,A_data+(2*3*4)); + boost::array new_extents = {{4,3,2}}; + A.resize(new_extents); + BOOST_CHECK(std::equal(A_resize,A_resize+(4*3*2),A.data())); + } + + // default construct all the new elements (in this case, all elements) + { + marray defaultA; + defaultA.resize(boost::extents[2][3][4]); + BOOST_CHECK(std::accumulate(defaultA.data(), + defaultA.data()+(2*3*4),0) == 0); + } + + + + // verify the preservation of storage order + { + int tiling_graph_storage_order[] = {2, 0, 1}; + bool tiling_graph_index_order[] = {true, true, true}; + + marray A(boost::extents[3][4][2], + boost::general_storage_order<3>(tiling_graph_storage_order, + tiling_graph_index_order)); + + + int value = 0; + for (int i = 0; i < 3; i++) { + for (int j = 0; j < 4; j++) { + for (int k = 0; k < 2; k++) { + *(A.data() + value) = value; + ++value; + } + } + } + + // "Resize" to the same size + A.resize(boost::extents[3][4][2]); + + int check = 0; + for (int x = 0; x < 3; x++) { + for (int y = 0; y < 4; y++) { + for (int z = 0; z < 2; z++) { + BOOST_CHECK(*(A.data() + check) == check); + ++check; + } + } + } + } + + // Resizing that changes index bases too (impl bug caused an assert) + { + typedef boost::multi_array ar_t; + typedef ar_t::extent_range range; + ar_t ar; + ar.resize(boost::extents[range(-3, 3)]); + } + + + return boost::exit_success; +} diff --git a/tests/libs/boost/tests/multi_array/test/rm_execution b/tests/libs/boost/tests/multi_array/test/rm_execution new file mode 100755 index 0000000000..db6a2a6651 --- /dev/null +++ b/tests/libs/boost/tests/multi_array/test/rm_execution @@ -0,0 +1,55 @@ +#!.//common/bats/bin/bats +# -*-sh-*- + +source ./common/test_helper_functions.bash || exit 1 +source ./common/functions || exit 1 + +if [ -s ./TEST_ENV ];then + source ./TEST_ENV +fi + +if [ "$RESOURCE_MANAGER" = "slurm" ];then + rm=slurm +else + ERROR "Unsupported or unknown resource manager" + exit 1 +fi + +PKG="Boost/Multi Array" + +@test "[$PKG] access-test under resource manager ($rm/$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + test=access + if [ ! -x $test ];then + flunk "$test does not exist" + fi + run_serial_binary ./$test + assert_success +} + +@test "[$PKG] iterators-test under resource manager ($rm/$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + test=iterators + if [ ! -x $test ];then + flunk "$test does not exist" + fi + run_serial_binary ./$test + assert_success +} + +@test "[$PKG] resize-test under resource manager ($rm/$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + test=resize + if [ ! -x $test ];then + flunk "$test does not exist" + fi + run_serial_binary ./$test + assert_success +} + +@test "[$PKG] idxgen1-test under resource manager ($rm/$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" { + test=idxgen1 + if [ ! -x $test ];then + flunk "$test does not exist" + fi + run_serial_binary ./$test + assert_success +} + diff --git a/tests/libs/boost/tests/program_options/test/Makefile.am b/tests/libs/boost/tests/program_options/test/Makefile.am new file mode 100644 index 0000000000..4473ad2373 --- /dev/null +++ b/tests/libs/boost/tests/program_options/test/Makefile.am @@ -0,0 +1,43 @@ +TESTS_ENVIRONMENT = BATS_NO_SUMMARY=1 +AM_CXXFLAGS = -I$(BOOST_INC) +AM_LDFLAGS = -L$(BOOST_LIB) -lboost_program_options + +# Test compilations/execution + +TESTS = cmdline_test +check_PROGRAMS = cmdline_test +cmdline_test_SOURCES = cmdline_test.cpp + +TESTS += exception_test +check_PROGRAMS += exception_test +exception_test_SOURCES = exception_test.cpp + +TESTS += options_description_test +check_PROGRAMS += options_description_test +options_description_test_SOURCES = options_description_test.cpp + +check_PROGRAMS += parsers_test +parsers_test_SOURCES = parsers_test.cpp + +TESTS += positional_options_test +check_PROGRAMS += positional_options_test +positional_options_test_SOURCES = positional_options_test.cpp + +check_PROGRAMS += required_test +required_test_SOURCES = required_test.cpp + +TESTS += unicode_test +check_PROGRAMS += unicode_test +unicode_test_SOURCES = unicode_test.cpp + +TESTS += unrecognized_test +check_PROGRAMS += unrecognized_test +unrecognized_test_SOURCES = unrecognized_test.cpp + +TESTS += variable_map_test +check_PROGRAMS += variable_map_test +variable_map_test_SOURCES = variable_map_test.cpp + +# Test execution through resource manager + +TESTS += rm_execution diff --git a/tests/libs/boost/tests/program_options/test/cmdline_test.cpp b/tests/libs/boost/tests/program_options/test/cmdline_test.cpp new file mode 100644 index 0000000000..ed86160d4a --- /dev/null +++ b/tests/libs/boost/tests/program_options/test/cmdline_test.cpp @@ -0,0 +1,624 @@ +// Copyright Vladimir Prus 2002-2004. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +using namespace boost::program_options; +using boost::program_options::detail::cmdline; + +#include +#include +#include +#include +using namespace std; + +#include "minitest.hpp" + +/* To facilitate testing, declare a number of error codes. Otherwise, + we'd have to specify the type of exception that should be thrown. +*/ + +const int s_success = 0; +const int s_unknown_option = 1; +const int s_ambiguous_option = 2; +const int s_long_not_allowed = 3; +const int s_long_adjacent_not_allowed = 4; +const int s_short_adjacent_not_allowed = 5; +const int s_empty_adjacent_parameter = 6; +const int s_missing_parameter = 7; +const int s_extra_parameter = 8; +const int s_unrecognized_line = 9; + +int translate_syntax_error_kind(invalid_command_line_syntax::kind_t k) +{ + invalid_command_line_syntax::kind_t table[] = { + invalid_command_line_syntax::long_not_allowed, + invalid_command_line_syntax::long_adjacent_not_allowed, + invalid_command_line_syntax::short_adjacent_not_allowed, + invalid_command_line_syntax::empty_adjacent_parameter, + invalid_command_line_syntax::missing_parameter, + invalid_command_line_syntax::extra_parameter, + invalid_command_line_syntax::unrecognized_line + }; + invalid_command_line_syntax::kind_t *b, *e, *i; + b = table; + e = table + sizeof(table)/sizeof(table[0]); + i = std::find(b, e, k); + assert(i != e); + return std::distance(b, i) + 3; +} + +struct test_case { + const char* input; + int expected_status; + const char* expected_result; +}; + + +/* Parses the syntax description in 'syntax' and initialized + 'cmd' accordingly' + The "boost::program_options" in parameter type is needed because CW9 + has std::detail and it causes an ambiguity. +*/ +void apply_syntax(options_description& desc, + const char* syntax) +{ + + string s; + stringstream ss; + ss << syntax; + while(ss >> s) { + value_semantic* v = 0; + + if (*(s.end()-1) == '=') { + v = value(); + s.resize(s.size()-1); + } else if (*(s.end()-1) == '?') { + //v = value()->implicit(); + v = value(); + s.resize(s.size()-1); + } else if (*(s.end()-1) == '*') { + v = value >()->multitoken(); + s.resize(s.size()-1); + } else if (*(s.end()-1) == '+') { + v = value >()->multitoken(); + s.resize(s.size()-1); + } + if (v) { + desc.add_options() + (s.c_str(), v, ""); + } else { + desc.add_options() + (s.c_str(), ""); + } + } +} + +void test_cmdline(const char* syntax, + command_line_style::style_t style, + const test_case* cases) +{ + for (int i = 0; cases[i].input; ++i) { + // Parse input + vector xinput; + { + string s; + stringstream ss; + ss << cases[i].input; + while (ss >> s) { + xinput.push_back(s); + } + } + options_description desc; + apply_syntax(desc, syntax); + + cmdline cmd(xinput); + cmd.style(style); + cmd.set_options_description(desc); + + + string result; + int status = 0; + + try { + vector